From: support Date: Mon, 12 Sep 2022 09:34:34 +0000 (+0000) Subject: Built motion from commit f296b652.|2.6.15 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%201101license.mail?a=commitdiff_plain;h=6f3faefe3e9f320b333283d33164e38644854f99;p=motion2.git Built motion from commit f296b652.|2.6.15 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 5032bbe..4427f1e 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-10T16:24:22.699Z", + "time": "2022-09-12T09:26:32.890Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 31562e2..ae80f8d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-10T16:24:22.699Z", + "time": "2022-09-12T09:26:32.890Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/package.json b/package.json index 3ccea66..6d6dbe7 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,7 @@ "prettier:write": "prettier --write './**/*'", "format-all": "npm run js-beautify && npm run prettier:write", "test": "mocha server/test --timeout 5000", - "aux-containers": "docker-compose up -d database cache", - "db-dump": "docker-compose exec -u root database /xmotion_mysql_bk.sh dump", - "db-restore": "docker-compose exec -u root database /xmotion_mysql_bk.sh restore" + "aux-containers": "docker-compose up -d database cache" }, "dependencies": { "@types/express-serve-static-core": "4.17.28", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 0b59528..675b899 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 _0xd743=['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]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x51047c,_0x22f69e){var _0xa5be1f=function(_0x450d39){while(--_0x450d39){_0x51047c['push'](_0x51047c['shift']());}};_0xa5be1f(++_0x22f69e);}(_0xd743,0xee));var _0x3d74=function(_0x513a82,_0x15be29){_0x513a82=_0x513a82-0x0;var _0x17eaf3=_0xd743[_0x513a82];return _0x17eaf3;};'use strict';var Sequelize=require('sequelize');module[_0x3d74('0x0')]={'name':{'type':Sequelize[_0x3d74('0x1')],'get':function(_0x2aaa41){return this[_0x3d74('0x2')](_0x3d74('0x3'));}},'action':{'type':Sequelize[_0x3d74('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3d74('0x5'),_0x3d74('0x6'),_0x3d74('0x7'),_0x3d74('0x8'),_0x3d74('0x9'),_0x3d74('0xa'),_0x3d74('0xb'),_0x3d74('0xc')]],'msg':_0x3d74('0xd')}},'comment':_0x3d74('0xd')},'data1':{'type':Sequelize[_0x3d74('0x4')](0x1000),'comment':_0x3d74('0xe')},'data2':{'type':Sequelize[_0x3d74('0x4')](0x1000),'comment':_0x3d74('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x3d74('0x10')},'data7':{'type':Sequelize[_0x3d74('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xb58d=['action','contactManager','motionbar','jscripty','urlForward','browser','script','STRING','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','urlForward[body]','sequelize','exports','VIRTUAL'];(function(_0x39aec5,_0x2c0b3b){var _0x27d1c3=function(_0x205748){while(--_0x205748){_0x39aec5['push'](_0x39aec5['shift']());}};_0x27d1c3(++_0x2c0b3b);}(_0xb58d,0x141));var _0xdb58=function(_0x4cf1ad,_0x2929f0){_0x4cf1ad=_0x4cf1ad-0x0;var _0x3b210f=_0xb58d[_0x4cf1ad];return _0x3b210f;};'use strict';var Sequelize=require(_0xdb58('0x0'));module[_0xdb58('0x1')]={'name':{'type':Sequelize[_0xdb58('0x2')],'get':function(_0x4e9eea){return this['getDataValue'](_0xdb58('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xdb58('0x4'),'integration',_0xdb58('0x5'),_0xdb58('0x6'),_0xdb58('0x7'),_0xdb58('0x8'),'bot',_0xdb58('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0xdb58('0xa')](0x1000),'comment':_0xdb58('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdb58('0xc')},'data4':{'type':Sequelize[_0xdb58('0xa')](0x1000),'comments':_0xdb58('0xd')},'data5':{'type':Sequelize[_0xdb58('0xa')](0x1000),'comments':_0xdb58('0xe')},'data6':{'type':Sequelize[_0xdb58('0xa')],'comments':_0xdb58('0xf')},'data7':{'type':Sequelize[_0xdb58('0x10')],'comments':_0xdb58('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index eb10e5b..6d53f63 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 _0x4eb2=['find','params','catch','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','squel','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','name','body','Action'];(function(_0x3d31aa,_0x477741){var _0x347315=function(_0x5acd0c){while(--_0x5acd0c){_0x3d31aa['push'](_0x3d31aa['shift']());}};_0x347315(++_0x477741);}(_0x4eb2,0x75));var _0x24eb=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x4eb2[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require(_0x24eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24eb('0x1'));var jsonpatch=require(_0x24eb('0x2'));var rp=require('request-promise');var moment=require(_0x24eb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x24eb('0x4'));var util=require(_0x24eb('0x5'));var path=require(_0x24eb('0x6'));var sox=require(_0x24eb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24eb('0x8'));var _=require('lodash');var squel=require(_0x24eb('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x24eb('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x24eb('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x24eb('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24eb('0xd'));var logger=require(_0x24eb('0xe'))('api');var utils=require(_0x24eb('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x24eb('0x10'));var db=require(_0x24eb('0x11'))['db'];function respondWithStatusCode(_0x4d9c74,_0x490647){_0x490647=_0x490647||0xcc;return function(_0x64eb36){if(_0x64eb36){return _0x4d9c74[_0x24eb('0x12')](_0x490647);}return _0x4d9c74[_0x24eb('0x13')](_0x490647)[_0x24eb('0x14')]();};}function respondWithResult(_0x459a8e,_0x58247d){_0x58247d=_0x58247d||0xc8;return function(_0x2b43d6){if(_0x2b43d6){return _0x459a8e[_0x24eb('0x13')](_0x58247d)[_0x24eb('0x15')](_0x2b43d6);}};}function respondWithFilteredResult(_0x18f9ee,_0x1f4c1f){return function(_0x3cce59){if(_0x3cce59){var _0x4c4f9e=typeof _0x1f4c1f[_0x24eb('0x16')]===_0x24eb('0x17')&&typeof _0x1f4c1f[_0x24eb('0x18')]===_0x24eb('0x17');var _0x71d8d1=_0x3cce59[_0x24eb('0x19')];var _0x27fe8b=_0x4c4f9e?0x0:_0x1f4c1f[_0x24eb('0x16')];var _0x147ede=_0x4c4f9e?_0x3cce59[_0x24eb('0x19')]:_0x1f4c1f[_0x24eb('0x16')]+_0x1f4c1f[_0x24eb('0x18')];var _0x2ccfe3;if(_0x147ede>=_0x71d8d1){_0x147ede=_0x71d8d1;_0x2ccfe3=0xc8;}else{_0x2ccfe3=0xce;}_0x18f9ee[_0x24eb('0x13')](_0x2ccfe3);return _0x18f9ee[_0x24eb('0x1a')](_0x24eb('0x1b'),_0x27fe8b+'-'+_0x147ede+'/'+_0x71d8d1)[_0x24eb('0x15')](_0x3cce59);}return null;};}function patchUpdates(_0x2102cc){return function(_0x914a2c){try{jsonpatch[_0x24eb('0x1c')](_0x914a2c,_0x2102cc,!![]);}catch(_0x3f490c){return BPromise['reject'](_0x3f490c);}return _0x914a2c['save']();};}function saveUpdates(_0x2fb99d,_0xacacd9){return function(_0x3670d8){if(_0x3670d8){return _0x3670d8[_0x24eb('0x1d')](_0x2fb99d)[_0x24eb('0x1e')](function(_0x704f15){return _0x704f15;});}return null;};}function removeEntity(_0x433612,_0x3fffd1){return function(_0x3b8e86){if(_0x3b8e86){return _0x3b8e86[_0x24eb('0x1f')]()[_0x24eb('0x1e')](function(){_0x433612[_0x24eb('0x13')](0xcc)[_0x24eb('0x14')]();});}};}function handleEntityNotFound(_0x59517b,_0x5763d0){return function(_0x2270d0){if(!_0x2270d0){_0x59517b['sendStatus'](0x194);}return _0x2270d0;};}function handleError(_0x40470f,_0x23aaf1){_0x23aaf1=_0x23aaf1||0x1f4;return function(_0x386350){logger['error'](_0x386350['stack']);if(_0x386350[_0x24eb('0x20')]){delete _0x386350[_0x24eb('0x20')];}_0x40470f[_0x24eb('0x13')](_0x23aaf1)['send'](_0x386350);};}exports[_0x24eb('0x1d')]=function(_0x137f1b,_0x3eef3b){if(_0x137f1b[_0x24eb('0x21')]['id']){delete _0x137f1b['body']['id'];}return db[_0x24eb('0x22')][_0x24eb('0x23')]({'where':{'id':_0x137f1b[_0x24eb('0x24')]['id']}})['then'](handleEntityNotFound(_0x3eef3b,null))[_0x24eb('0x1e')](saveUpdates(_0x137f1b[_0x24eb('0x21')],null))['then'](respondWithResult(_0x3eef3b,null))[_0x24eb('0x25')](handleError(_0x3eef3b,null));};exports['destroy']=function(_0x430c2a,_0x4ac1ec){return db[_0x24eb('0x22')][_0x24eb('0x23')]({'where':{'id':_0x430c2a['params']['id']}})[_0x24eb('0x1e')](handleEntityNotFound(_0x4ac1ec,null))[_0x24eb('0x1e')](removeEntity(_0x4ac1ec,null))[_0x24eb('0x25')](handleError(_0x4ac1ec,null));}; \ No newline at end of file +var _0xe9ff=['request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x331c5a,_0x5d85f4){var _0x34fda5=function(_0x2e9d35){while(--_0x2e9d35){_0x331c5a['push'](_0x331c5a['shift']());}};_0x34fda5(++_0x5d85f4);}(_0xe9ff,0x1be));var _0xfe9f=function(_0x75a383,_0x265b4b){_0x75a383=_0x75a383-0x0;var _0x2f70a0=_0xe9ff[_0x75a383];return _0x2f70a0;};'use strict';var emlformat=require(_0xfe9f('0x0'));var rimraf=require(_0xfe9f('0x1'));var zipdir=require(_0xfe9f('0x2'));var jsonpatch=require(_0xfe9f('0x3'));var rp=require(_0xfe9f('0x4'));var moment=require(_0xfe9f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe9f('0x6'));var path=require('path');var sox=require(_0xfe9f('0x7'));var csv=require(_0xfe9f('0x8'));var ejs=require(_0xfe9f('0x9'));var fs=require('fs');var fs_extra=require(_0xfe9f('0xa'));var _=require(_0xfe9f('0xb'));var squel=require(_0xfe9f('0xc'));var crypto=require(_0xfe9f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfe9f('0xe'));var toCsv=require(_0xfe9f('0x8'));var querystring=require(_0xfe9f('0xf'));var Papa=require('papaparse');var Redis=require(_0xfe9f('0x10'));var authService=require(_0xfe9f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfe9f('0x12'));var hardwareService=require(_0xfe9f('0x13'));var logger=require(_0xfe9f('0x14'))(_0xfe9f('0x15'));var utils=require(_0xfe9f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfe9f('0x17'))['db'];function respondWithStatusCode(_0x3e7898,_0x2adba8){_0x2adba8=_0x2adba8||0xcc;return function(_0x315bcb){if(_0x315bcb){return _0x3e7898[_0xfe9f('0x18')](_0x2adba8);}return _0x3e7898[_0xfe9f('0x19')](_0x2adba8)[_0xfe9f('0x1a')]();};}function respondWithResult(_0x16086b,_0x44fa17){_0x44fa17=_0x44fa17||0xc8;return function(_0x48be7f){if(_0x48be7f){return _0x16086b[_0xfe9f('0x19')](_0x44fa17)[_0xfe9f('0x1b')](_0x48be7f);}};}function respondWithFilteredResult(_0x538bf6,_0xd21849){return function(_0x4de0c8){if(_0x4de0c8){var _0x294a52=typeof _0xd21849['offset']===_0xfe9f('0x1c')&&typeof _0xd21849[_0xfe9f('0x1d')]==='undefined';var _0x2531fb=_0x4de0c8[_0xfe9f('0x1e')];var _0x39463a=_0x294a52?0x0:_0xd21849[_0xfe9f('0x1f')];var _0xe70804=_0x294a52?_0x4de0c8[_0xfe9f('0x1e')]:_0xd21849['offset']+_0xd21849['limit'];var _0x9d686e;if(_0xe70804>=_0x2531fb){_0xe70804=_0x2531fb;_0x9d686e=0xc8;}else{_0x9d686e=0xce;}_0x538bf6['status'](_0x9d686e);return _0x538bf6[_0xfe9f('0x20')](_0xfe9f('0x21'),_0x39463a+'-'+_0xe70804+'/'+_0x2531fb)[_0xfe9f('0x1b')](_0x4de0c8);}return null;};}function patchUpdates(_0x242c72){return function(_0x28212c){try{jsonpatch[_0xfe9f('0x22')](_0x28212c,_0x242c72,!![]);}catch(_0x4e6179){return BPromise['reject'](_0x4e6179);}return _0x28212c[_0xfe9f('0x23')]();};}function saveUpdates(_0x2932e5,_0x245b4b){return function(_0x5d37e1){if(_0x5d37e1){return _0x5d37e1[_0xfe9f('0x24')](_0x2932e5)[_0xfe9f('0x25')](function(_0x4d7eb2){return _0x4d7eb2;});}return null;};}function removeEntity(_0x1ff2e8,_0x37163d){return function(_0xb2ae03){if(_0xb2ae03){return _0xb2ae03['destroy']()[_0xfe9f('0x25')](function(){_0x1ff2e8['status'](0xcc)[_0xfe9f('0x1a')]();});}};}function handleEntityNotFound(_0x5d804b,_0x239049){return function(_0x2e2970){if(!_0x2e2970){_0x5d804b[_0xfe9f('0x18')](0x194);}return _0x2e2970;};}function handleError(_0x288dbb,_0x450478){_0x450478=_0x450478||0x1f4;return function(_0x4d5fdd){logger['error'](_0x4d5fdd['stack']);if(_0x4d5fdd[_0xfe9f('0x26')]){delete _0x4d5fdd[_0xfe9f('0x26')];}_0x288dbb[_0xfe9f('0x19')](_0x450478)[_0xfe9f('0x27')](_0x4d5fdd);};}exports[_0xfe9f('0x24')]=function(_0x5b0030,_0xbacc12){if(_0x5b0030[_0xfe9f('0x28')]['id']){delete _0x5b0030[_0xfe9f('0x28')]['id'];}return db[_0xfe9f('0x29')][_0xfe9f('0x2a')]({'where':{'id':_0x5b0030[_0xfe9f('0x2b')]['id']}})[_0xfe9f('0x25')](handleEntityNotFound(_0xbacc12,null))[_0xfe9f('0x25')](saveUpdates(_0x5b0030[_0xfe9f('0x28')],null))[_0xfe9f('0x25')](respondWithResult(_0xbacc12,null))[_0xfe9f('0x2c')](handleError(_0xbacc12,null));};exports['destroy']=function(_0x2b5ed3,_0x5111e5){return db[_0xfe9f('0x29')][_0xfe9f('0x2a')]({'where':{'id':_0x2b5ed3['params']['id']}})['then'](handleEntityNotFound(_0x5111e5,null))['then'](removeEntity(_0x5111e5,null))['catch'](handleError(_0x5111e5,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index efd06eb..01d5ecd 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 _0xe9ab=['define','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x38c1be,_0x248054){var _0xaa55c2=function(_0x1cfea9){while(--_0x1cfea9){_0x38c1be['push'](_0x38c1be['shift']());}};_0xaa55c2(++_0x248054);}(_0xe9ab,0xc3));var _0xbe9a=function(_0x110a8c,_0x516705){_0x110a8c=_0x110a8c-0x0;var _0x4da8ee=_0xe9ab[_0x110a8c];return _0x4da8ee;};'use strict';var _=require(_0xbe9a('0x0'));var util=require('util');var logger=require(_0xbe9a('0x1'))(_0xbe9a('0x2'));var moment=require(_0xbe9a('0x3'));var BPromise=require(_0xbe9a('0x4'));var rp=require(_0xbe9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe9a('0x6'));var config=require(_0xbe9a('0x7'));var attributes=require('./action.attributes');module[_0xbe9a('0x8')]=function(_0x23203d,_0x2185ca){return _0x23203d[_0xbe9a('0x9')](_0xbe9a('0xa'),attributes,{'tableName':_0xbe9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7677=['exports','Action','tools_actions','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3ac552,_0x257348){var _0xcb4fb9=function(_0x120f0a){while(--_0x120f0a){_0x3ac552['push'](_0x3ac552['shift']());}};_0xcb4fb9(++_0x257348);}(_0x7677,0x18f));var _0x7767=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7677[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7767('0x0'));var util=require('util');var logger=require(_0x7767('0x1'))(_0x7767('0x2'));var moment=require(_0x7767('0x3'));var BPromise=require('bluebird');var rp=require(_0x7767('0x4'));var fs=require('fs');var path=require(_0x7767('0x5'));var rimraf=require(_0x7767('0x6'));var config=require(_0x7767('0x7'));var attributes=require(_0x7767('0x8'));module[_0x7767('0x9')]=function(_0x40ebd6,_0x12cc0c){return _0x40ebd6['define'](_0x7767('0xa'),attributes,{'tableName':_0x7767('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 0cb68b6..de1b76c 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5cb149,_0x6b9a48){_0x5cb149=_0x5cb149-0x0;var _0x354337=_0x1cb9[_0x5cb149];return _0x354337;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x15a0c4,_0x3ceeca){var _0x1abadf=function(_0x2a047b){while(--_0x2a047b){_0x15a0c4['push'](_0x15a0c4['shift']());}};_0x1abadf(++_0x3ceeca);}(_0x8ef6,0xf2));var _0x68ef=function(_0x327da6,_0x2c1c80){_0x327da6=_0x327da6-0x0;var _0x4f1297=_0x8ef6[_0x327da6];return _0x4f1297;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Action,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Action,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 1e593a4..9940f83 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 _0x8d67=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0xfe3407,_0x2d93f9){var _0x2a86ba=function(_0x557e9e){while(--_0x557e9e){_0xfe3407['push'](_0xfe3407['shift']());}};_0x2a86ba(++_0x2d93f9);}(_0x8d67,0x1c9));var _0x78d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d67[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x78d6('0x0'));var util=require(_0x78d6('0x1'));var path=require(_0x78d6('0x2'));var timeout=require(_0x78d6('0x3'));var express=require(_0x78d6('0x4'));var router=express[_0x78d6('0x5')]();var fs_extra=require(_0x78d6('0x6'));var auth=require(_0x78d6('0x7'));var interaction=require(_0x78d6('0x8'));var config=require(_0x78d6('0x9'));var controller=require('./action.controller');router[_0x78d6('0xa')](_0x78d6('0xb'),auth[_0x78d6('0xc')](),controller[_0x78d6('0xd')]);router[_0x78d6('0xe')](_0x78d6('0xb'),auth['isAuthenticated'](),controller[_0x78d6('0xf')]);module[_0x78d6('0x10')]=router; \ No newline at end of file +var _0x79cb=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x13f731,_0x1c061a){var _0x3ac7d7=function(_0x347227){while(--_0x347227){_0x13f731['push'](_0x13f731['shift']());}};_0x3ac7d7(++_0x1c061a);}(_0x79cb,0xf4));var _0xb79c=function(_0x291578,_0x23098a){_0x291578=_0x291578-0x0;var _0x58bf79=_0x79cb[_0x291578];return _0x58bf79;};'use strict';var multer=require('multer');var util=require(_0xb79c('0x0'));var path=require(_0xb79c('0x1'));var timeout=require(_0xb79c('0x2'));var express=require(_0xb79c('0x3'));var router=express['Router']();var fs_extra=require(_0xb79c('0x4'));var auth=require(_0xb79c('0x5'));var interaction=require(_0xb79c('0x6'));var config=require(_0xb79c('0x7'));var controller=require(_0xb79c('0x8'));router[_0xb79c('0x9')](_0xb79c('0xa'),auth['isAuthenticated'](),controller[_0xb79c('0xb')]);router[_0xb79c('0xc')](_0xb79c('0xa'),auth['isAuthenticated'](),controller[_0xb79c('0xd')]);module[_0xb79c('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 601c669..81b6e53 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 _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x101d04,_0x4b5fa2){var _0x27f9f7=function(_0x35eb5d){while(--_0x35eb5d){_0x101d04['push'](_0x101d04['shift']());}};_0x27f9f7(++_0x4b5fa2);}(_0x5d17,0x114));var _0x75d1=function(_0x503325,_0x24a407){_0x503325=_0x503325-0x0;var _0x452fff=_0x5d17[_0x503325];return _0x452fff;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x4ccb98,_0x50bbf6){var _0x2385aa=function(_0x40c1e5){while(--_0x40c1e5){_0x4ccb98['push'](_0x4ccb98['shift']());}};_0x2385aa(++_0x50bbf6);}(_0x98a8,0x12c));var _0x898a=function(_0x5ed353,_0x1dff87){_0x5ed353=_0x5ed353-0x0;var _0x59f15f=_0x98a8[_0x5ed353];return _0x59f15f;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 0cc74b9..dd9c5fa 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 _0xf5bf=['.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','../../components/export/','countTable','COUNT(*)','QueryTypes','run','runReport','GROUP_CONCAT(%s)','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','send','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','name','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%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','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','clone','debug','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20EMPTY','operator','Please\x20insert\x20at\x20least\x20one\x20field','from','orderBy','parse','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x1f53c3,_0x4e8a17){var _0x454280=function(_0x29e71e){while(--_0x29e71e){_0x1f53c3['push'](_0x1f53c3['shift']());}};_0x454280(++_0x4e8a17);}(_0xf5bf,0x15c));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xff5b('0x0'));var rimraf=require(_0xff5b('0x1'));var zipdir=require(_0xff5b('0x2'));var jsonpatch=require(_0xff5b('0x3'));var rp=require(_0xff5b('0x4'));var moment=require(_0xff5b('0x5'));var BPromise=require(_0xff5b('0x6'));var Mustache=require(_0xff5b('0x7'));var util=require('util');var path=require(_0xff5b('0x8'));var sox=require(_0xff5b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff5b('0xa'));var _=require('lodash');var squel=require(_0xff5b('0xb'));var crypto=require('crypto');var jsforce=require(_0xff5b('0xc'));var deskjs=require(_0xff5b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xff5b('0xe'));var Papa=require(_0xff5b('0xf'));var Redis=require(_0xff5b('0x10'));var authService=require(_0xff5b('0x11'));var qs=require(_0xff5b('0x12'));var as=require(_0xff5b('0x13'));var hardwareService=require(_0xff5b('0x14'));var logger=require('../../config/logger')(_0xff5b('0x15'));var utils=require(_0xff5b('0x16'));var config=require(_0xff5b('0x17'));var licenseUtil=require(_0xff5b('0x18'));var db=require(_0xff5b('0x19'))['db'];var dbH=require(_0xff5b('0x19'))[_0xff5b('0x1a')];function respondWithStatusCode(_0x38bcab,_0x4cfde4){_0x4cfde4=_0x4cfde4||0xcc;return function(_0x2e4077){if(_0x2e4077){return _0x38bcab[_0xff5b('0x1b')](_0x4cfde4);}return _0x38bcab[_0xff5b('0x1c')](_0x4cfde4)[_0xff5b('0x1d')]();};}function respondWithResult(_0x4c973e,_0x56c723){_0x56c723=_0x56c723||0xc8;return function(_0x1cf8a1){if(_0x1cf8a1){return _0x4c973e['status'](_0x56c723)['json'](_0x1cf8a1);}};}function respondWithFilteredResult(_0x1e5940,_0x294c2e){return function(_0xc5a208){if(_0xc5a208){var _0x22d55e=typeof _0x294c2e['offset']===_0xff5b('0x1e')&&typeof _0x294c2e[_0xff5b('0x1f')]==='undefined';var _0x5af73a=_0xc5a208[_0xff5b('0x20')];var _0x3de7cf=_0x22d55e?0x0:_0x294c2e[_0xff5b('0x21')];var _0x3e9604=_0x22d55e?_0xc5a208[_0xff5b('0x20')]:_0x294c2e[_0xff5b('0x21')]+_0x294c2e[_0xff5b('0x1f')];var _0x13e3d3;if(_0x3e9604>=_0x5af73a){_0x3e9604=_0x5af73a;_0x13e3d3=0xc8;}else{_0x13e3d3=0xce;}_0x1e5940[_0xff5b('0x1c')](_0x13e3d3);return _0x1e5940[_0xff5b('0x22')]('Content-Range',_0x3de7cf+'-'+_0x3e9604+'/'+_0x5af73a)[_0xff5b('0x23')](_0xc5a208);}return null;};}function patchUpdates(_0xd049ec){return function(_0x1142c9){try{jsonpatch['apply'](_0x1142c9,_0xd049ec,!![]);}catch(_0x95a62){return BPromise[_0xff5b('0x24')](_0x95a62);}return _0x1142c9[_0xff5b('0x25')]();};}function saveUpdates(_0x26b37c,_0x5f56ea){return function(_0x622b3d){if(_0x622b3d){return _0x622b3d[_0xff5b('0x26')](_0x26b37c)[_0xff5b('0x27')](function(_0x475f5f){return _0x475f5f;});}return null;};}function removeEntity(_0x2d0fbb,_0x7a8d0f){return function(_0x1ed9cb){if(_0x1ed9cb){return _0x1ed9cb[_0xff5b('0x28')]()['then'](function(){var _0xc4913d=_0x1ed9cb[_0xff5b('0x29')]({'plain':!![]});var _0x5cd76c=_0xff5b('0x2a');return db[_0xff5b('0x2b')][_0xff5b('0x28')]({'where':{'type':_0x5cd76c,'resourceId':_0xc4913d['id']}})[_0xff5b('0x27')](function(){return _0x1ed9cb;});})[_0xff5b('0x27')](function(){_0x2d0fbb['status'](0xcc)[_0xff5b('0x1d')]();});}};}function handleEntityNotFound(_0x1dfa3c,_0x1924ec){return function(_0x39de64){if(!_0x39de64){_0x1dfa3c[_0xff5b('0x1b')](0x194);}return _0x39de64;};}function handleError(_0xc4b2dc,_0x419aa3){_0x419aa3=_0x419aa3||0x1f4;return function(_0x2d0dd9){logger[_0xff5b('0x2c')](_0x2d0dd9[_0xff5b('0x2d')]);if(_0x2d0dd9['name']){delete _0x2d0dd9['name'];}_0xc4b2dc['status'](_0x419aa3)[_0xff5b('0x2e')](_0x2d0dd9);};}exports['index']=function(_0x417d2a,_0x5bc691){var _0x2f394c={},_0x202174={},_0x27d346={'count':0x0,'rows':[]};var _0x43e588=_[_0xff5b('0x2f')](db[_0xff5b('0x30')][_0xff5b('0x31')],function(_0x2ff8bd){return{'name':_0x2ff8bd[_0xff5b('0x32')],'type':_0x2ff8bd['type'][_0xff5b('0x33')]};});_0x202174[_0xff5b('0x34')]=_['map'](_0x43e588,'name');_0x202174[_0xff5b('0x35')]=_['keys'](_0x417d2a[_0xff5b('0x35')]);_0x202174[_0xff5b('0x36')]=_['intersection'](_0x202174['model'],_0x202174[_0xff5b('0x35')]);_0x2f394c[_0xff5b('0x37')]=_[_0xff5b('0x38')](_0x202174[_0xff5b('0x34')],qs[_0xff5b('0x39')](_0x417d2a[_0xff5b('0x35')]['fields']));_0x2f394c[_0xff5b('0x37')]=_0x2f394c[_0xff5b('0x37')][_0xff5b('0x3a')]?_0x2f394c['attributes']:_0x202174[_0xff5b('0x34')];if(!_0x417d2a['query'][_0xff5b('0x3b')](_0xff5b('0x3c'))){_0x2f394c[_0xff5b('0x1f')]=qs['limit'](_0x417d2a[_0xff5b('0x35')][_0xff5b('0x1f')]);_0x2f394c['offset']=qs[_0xff5b('0x21')](_0x417d2a[_0xff5b('0x35')]['offset']);}_0x2f394c[_0xff5b('0x3d')]=qs['sort'](_0x417d2a[_0xff5b('0x35')][_0xff5b('0x3e')]);_0x2f394c['where']=qs[_0xff5b('0x36')](_[_0xff5b('0x3f')](_0x417d2a[_0xff5b('0x35')],_0x202174[_0xff5b('0x36')]),_0x43e588);if(_0x417d2a['query']['filter']){_0x2f394c[_0xff5b('0x40')]=_[_0xff5b('0x41')](_0x2f394c['where'],{'$or':_[_0xff5b('0x2f')](_0x43e588,function(_0x497eb1){if(_0x497eb1[_0xff5b('0x42')]!=='VIRTUAL'){var _0x4764d0={};_0x4764d0[_0x497eb1[_0xff5b('0x43')]]={'$like':'%'+_0x417d2a[_0xff5b('0x35')][_0xff5b('0x44')]+'%'};return _0x4764d0;}})});}_0x2f394c=_['merge']({},_0x2f394c,_0x417d2a[_0xff5b('0x45')]);var _0x585abf={'where':_0x2f394c[_0xff5b('0x40')]};return db[_0xff5b('0x30')][_0xff5b('0x20')](_0x585abf)['then'](function(_0x1a5615){_0x27d346[_0xff5b('0x20')]=_0x1a5615;if(_0x417d2a[_0xff5b('0x35')][_0xff5b('0x46')]){_0x2f394c[_0xff5b('0x47')]=[{'all':!![]}];}return db[_0xff5b('0x30')][_0xff5b('0x48')](_0x2f394c);})[_0xff5b('0x27')](function(_0x6cd7f7){_0x27d346[_0xff5b('0x49')]=_0x6cd7f7;return _0x27d346;})[_0xff5b('0x27')](respondWithFilteredResult(_0x5bc691,_0x2f394c))[_0xff5b('0x4a')](handleError(_0x5bc691,null));};exports[_0xff5b('0x4b')]=function(_0x4ac90d,_0x4ac1ae){var _0x11e2b9={'raw':![],'where':{'id':_0x4ac90d[_0xff5b('0x4c')]['id']}},_0x5667ae={};_0x5667ae[_0xff5b('0x34')]=_[_0xff5b('0x4d')](db[_0xff5b('0x30')][_0xff5b('0x31')]);_0x5667ae[_0xff5b('0x35')]=_['keys'](_0x4ac90d['query']);_0x5667ae[_0xff5b('0x36')]=_[_0xff5b('0x38')](_0x5667ae['model'],_0x5667ae[_0xff5b('0x35')]);_0x11e2b9[_0xff5b('0x37')]=_[_0xff5b('0x38')](_0x5667ae[_0xff5b('0x34')],qs['fields'](_0x4ac90d[_0xff5b('0x35')]['fields']));_0x11e2b9[_0xff5b('0x37')]=_0x11e2b9[_0xff5b('0x37')][_0xff5b('0x3a')]?_0x11e2b9[_0xff5b('0x37')]:_0x5667ae[_0xff5b('0x34')];if(_0x4ac90d[_0xff5b('0x35')][_0xff5b('0x46')]){_0x11e2b9['include']=[{'all':!![]}];}_0x11e2b9=_[_0xff5b('0x41')]({},_0x11e2b9,_0x4ac90d[_0xff5b('0x45')]);return db[_0xff5b('0x30')][_0xff5b('0x4e')](_0x11e2b9)[_0xff5b('0x27')](handleEntityNotFound(_0x4ac1ae,null))[_0xff5b('0x27')](respondWithResult(_0x4ac1ae,null))[_0xff5b('0x4a')](handleError(_0x4ac1ae,null));};exports[_0xff5b('0x4f')]=function(_0x13241c,_0x1b722a){return db[_0xff5b('0x30')][_0xff5b('0x4f')](_0x13241c[_0xff5b('0x50')],{})['then'](function(_0x7541ad){var _0x3a437b=_0x13241c['user'][_0xff5b('0x29')]({'plain':!![]});if(!_0x3a437b)throw new Error(_0xff5b('0x51'));if(_0x3a437b[_0xff5b('0x52')]===_0xff5b('0x53')){var _0xe7dccb=_0x7541ad['get']({'plain':!![]});var _0x228404=_0xff5b('0x54');return db['UserProfileSection'][_0xff5b('0x4e')]({'where':{'name':_0x228404,'userProfileId':_0x3a437b[_0xff5b('0x55')]},'raw':!![]})[_0xff5b('0x27')](function(_0x5222cd){if(_0x5222cd&&_0x5222cd[_0xff5b('0x56')]===0x0){return db[_0xff5b('0x2b')][_0xff5b('0x4f')]({'name':_0xe7dccb[_0xff5b('0x43')],'resourceId':_0xe7dccb['id'],'type':_0xff5b('0x2a'),'sectionId':_0x5222cd['id']},{})[_0xff5b('0x27')](function(){return _0x7541ad;});}else{return _0x7541ad;}})[_0xff5b('0x4a')](function(_0x200977){logger[_0xff5b('0x2c')](_0xff5b('0x57'),_0x200977);throw _0x200977;});}return _0x7541ad;})['then'](respondWithResult(_0x1b722a,0xc9))[_0xff5b('0x4a')](handleError(_0x1b722a,null));};exports[_0xff5b('0x26')]=function(_0x23e046,_0x27862f){if(_0x23e046['body']['id']){delete _0x23e046[_0xff5b('0x50')]['id'];}return db[_0xff5b('0x30')]['find']({'where':{'id':_0x23e046['params']['id']}})['then'](handleEntityNotFound(_0x27862f,null))[_0xff5b('0x27')](saveUpdates(_0x23e046[_0xff5b('0x50')],null))['then'](respondWithResult(_0x27862f,null))[_0xff5b('0x4a')](handleError(_0x27862f,null));};exports[_0xff5b('0x28')]=function(_0xcc0536,_0x3b2eec){return db[_0xff5b('0x30')][_0xff5b('0x4e')]({'where':{'id':_0xcc0536[_0xff5b('0x4c')]['id']}})[_0xff5b('0x27')](handleEntityNotFound(_0x3b2eec,null))['then'](removeEntity(_0x3b2eec,null))[_0xff5b('0x4a')](handleError(_0x3b2eec,null));};exports[_0xff5b('0x58')]=function(_0x1dfcff,_0x3dea54){var _0x98c40d=0xa;var _0x14f798=[_0xff5b('0x59'),_0xff5b('0x5a'),_0xff5b('0x5b'),_0xff5b('0x5c')];var _0x25be6d={'SUM':_0xff5b('0x5d'),'COUNT':_0xff5b('0x5e'),'COUNT DISTINCT':_0xff5b('0x5f'),'MAX':_0xff5b('0x60'),'MIN':_0xff5b('0x61'),'AVG':_0xff5b('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xff5b('0x63')};var _0x56b048={'SEC_TO_TIME':_0xff5b('0x64'),'DATE':'DATE(%s)','HOUR':_0xff5b('0x65'),'ROUND':_0xff5b('0x66'),'UNIX_TIMESTAMP':_0xff5b('0x67')};var _0x3963de=function(_0x1b7ba2){return!_[_0xff5b('0x68')]([_0xff5b('0x69'),_0xff5b('0x6a'),'IS\x20EMPTY',_0xff5b('0x6b')],_0x1b7ba2);};var _0x4a000c=function(_0x42e567){if(!_0x42e567||!_0x42e567[_0xff5b('0x6c')][_0xff5b('0x3a')]){return'';}for(var _0x5d8269='(',_0x4106bd=0x0;_0x4106bd<_0x42e567[_0xff5b('0x6c')][_0xff5b('0x3a')];_0x4106bd+=0x1){_0x4106bd>0x0&&(_0x5d8269+='\x20'+_0x42e567['operator']+'\x20');_0x5d8269+=_0x42e567[_0xff5b('0x6c')][_0x4106bd][_0xff5b('0x6d')]?_0x4a000c(_0x42e567[_0xff5b('0x6c')][_0x4106bd][_0xff5b('0x6d')]):_0x42e567[_0xff5b('0x6c')][_0x4106bd][_0xff5b('0x6e')]+'\x20'+_0x42e567['rules'][_0x4106bd][_0xff5b('0x6f')]+(_0x3963de(_0x42e567[_0xff5b('0x6c')][_0x4106bd][_0xff5b('0x6f')])?'\x20'+_0x42e567[_0xff5b('0x6c')][_0x4106bd][_0xff5b('0x70')]:'');}return _0x5d8269+')';};var _0x3dc43f={'where':{'id':_0x1dfcff[_0xff5b('0x4c')]['id']}},_0x2ea277,_0xf3a890,_0x384d87,_0x21a98a,_0xef0541;_0x3dc43f=_[_0xff5b('0x41')]({},_0x3dc43f,_0x1dfcff[_0xff5b('0x45')]);return db[_0xff5b('0x30')][_0xff5b('0x4e')](_0x3dc43f)[_0xff5b('0x27')](function(_0x26e12a){if(_0x26e12a){_0x2ea277=_0x26e12a;return _0x26e12a[_0xff5b('0x71')]();}return null;})[_0xff5b('0x27')](function(_0x2be73d){if(_0x2be73d){if(!_0x2be73d[_0xff5b('0x3a')]){throw new db[(_0xff5b('0x72'))][(_0xff5b('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xf3a890=_0x2be73d;return db[_0xff5b('0x74')][_0xff5b('0x48')]({'raw':!![]});}return null;})[_0xff5b('0x27')](function(_0x4e81b8){if(_0x4e81b8){_0x384d87=_[_0xff5b('0x75')](_0x4e81b8,'id');var _0x891767;var _0x144a31=squel[_0xff5b('0x76')]();_0x144a31['from'](_0x2ea277[_0xff5b('0x77')]);for(var _0x3fa56b=0x0;_0x3fa56b<_0xf3a890[_0xff5b('0x3a')];_0x3fa56b+=0x1){_0x891767=_0xf3a890[_0x3fa56b][_0xff5b('0x78')]?_0x384d87[_0xf3a890[_0x3fa56b][_0xff5b('0x78')]][_0xff5b('0x79')]:_0xf3a890[_0x3fa56b][_0xff5b('0x6e')];_0x891767=_0xf3a890[_0x3fa56b][_0xff5b('0x7a')]?_['replace'](_0x25be6d[_0xf3a890[_0x3fa56b]['function']],'%s',_0x891767):_0x891767;_0x891767=_0xf3a890[_0x3fa56b][_0xff5b('0x7b')]?_[_0xff5b('0x7c')](_0x56b048[_0xf3a890[_0x3fa56b][_0xff5b('0x7b')]],'%s',_0x891767):_0x891767;if(_0xf3a890[_0x3fa56b][_0xff5b('0x7d')]){_0x144a31[_0xff5b('0x6d')](_0x891767);}_0xf3a890[_0x3fa56b]['orderBy']&&_0x144a31[_0xff5b('0x3d')](_0x891767,_0xf3a890[_0x3fa56b]['orderBy']===_0xff5b('0x7e')?![]:!![]);_0x144a31[_0xff5b('0x6e')](_0x891767,_0xf3a890[_0x3fa56b][_0xff5b('0x7f')]||_0x891767);}if(_0x2ea277[_0xff5b('0x80')]){_0x2ea277[_0xff5b('0x80')]=JSON['parse'](_0x2ea277['joins']);for(var _0xfdb197=0x0;_0xfdb197<_0x2ea277[_0xff5b('0x80')][_0xff5b('0x3a')];_0xfdb197+=0x1){if(_0x2ea277['joins'][_0xfdb197][_0xff5b('0x42')]&&_[_0xff5b('0x68')](_0x14f798,_0x2ea277[_0xff5b('0x80')][_0xfdb197]['type'])&&_0x2ea277[_0xff5b('0x80')][_0xfdb197][_0xff5b('0x81')]&&_0x2ea277['joins'][_0xfdb197][_0xff5b('0x82')]&&_0x2ea277[_0xff5b('0x80')][_0xfdb197][_0xff5b('0x83')]){_0x144a31[_0x2ea277[_0xff5b('0x80')][_0xfdb197][_0xff5b('0x42')]](_0x2ea277[_0xff5b('0x80')][_0xfdb197][_0xff5b('0x82')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2ea277[_0xff5b('0x77')],_0x2ea277[_0xff5b('0x80')][_0xfdb197]['parentKey'],_0x2ea277[_0xff5b('0x80')][_0xfdb197]['foreignTable'],_0x2ea277[_0xff5b('0x80')][_0xfdb197][_0xff5b('0x83')]));}}}if(_0x2ea277[_0xff5b('0x84')]){_0x2ea277['conditions']=JSON['parse'](_0x2ea277[_0xff5b('0x84')]);_0x144a31[_0xff5b('0x40')](_0x4a000c(_0x2ea277[_0xff5b('0x84')]['group']));}_0xef0541=_0x144a31[_0xff5b('0x85')]();_0x144a31[_0xff5b('0x1f')](_0x98c40d);_0x144a31[_0xff5b('0x21')](0x0);logger[_0xff5b('0x86')]('Limited\x20Query:',_0x144a31['toString']());return dbH[_0xff5b('0x87')][_0xff5b('0x35')](_0x144a31[_0xff5b('0x88')](),{'type':dbH[_0xff5b('0x87')]['QueryTypes'][_0xff5b('0x89')]});}})[_0xff5b('0x27')](respondWithResult(_0x3dea54,null))[_0xff5b('0x4a')](handleError(_0x3dea54,null));};function runReport(_0x273b38,_0x10819d,_0x336c59){var _0xcee392=_0x10819d[_0xff5b('0x43')];var _0x1190fb=0xa;var _0x3261f5=[_0xff5b('0x59'),_0xff5b('0x5a'),_0xff5b('0x5b'),_0xff5b('0x5c')];var _0x389a8b={'SUM':_0xff5b('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xff5b('0x5f'),'MAX':_0xff5b('0x60'),'MIN':_0xff5b('0x61'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xff5b('0x8a'),'GROUP_CONCAT DESC':_0xff5b('0x63')};var _0x232e62={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xff5b('0x8b'),'HOUR':_0xff5b('0x65'),'ROUND':_0xff5b('0x66'),'UNIX_TIMESTAMP':_0xff5b('0x67')};var _0x2a7d1f=function(_0x395c3b){return!_['includes'](['IS\x20NULL',_0xff5b('0x6a'),_0xff5b('0x8c'),_0xff5b('0x6b')],_0x395c3b);};var _0x1c5998=function(_0x147437){if(!_0x147437||!_0x147437[_0xff5b('0x6c')][_0xff5b('0x3a')]){return'';}for(var _0x1e93f9='(',_0x1c903b=0x0;_0x1c903b<_0x147437['rules'][_0xff5b('0x3a')];_0x1c903b+=0x1){_0x1c903b>0x0&&(_0x1e93f9+='\x20'+_0x147437[_0xff5b('0x8d')]+'\x20');_0x1e93f9+=_0x147437[_0xff5b('0x6c')][_0x1c903b][_0xff5b('0x6d')]?_0x1c5998(_0x147437['rules'][_0x1c903b][_0xff5b('0x6d')]):_0x147437[_0xff5b('0x6c')][_0x1c903b][_0xff5b('0x6e')]+'\x20'+_0x147437['rules'][_0x1c903b][_0xff5b('0x6f')]+(_0x2a7d1f(_0x147437[_0xff5b('0x6c')][_0x1c903b][_0xff5b('0x6f')])?'\x20'+_0x147437[_0xff5b('0x6c')][_0x1c903b][_0xff5b('0x70')]:'');}return _0x1e93f9+')';};var _0x2042d6={'where':{'id':_0x273b38['id']}},_0x1a88bb,_0xebc32,_0xa44fb4,_0x56522a,_0x23eb49;_0x2042d6=_[_0xff5b('0x41')]({},_0x2042d6,_0x336c59);return db[_0xff5b('0x30')]['find'](_0x2042d6)[_0xff5b('0x27')](function(_0x3b688a){if(_0x3b688a){_0x1a88bb=_0x3b688a;return _0x3b688a[_0xff5b('0x71')]();}return null;})[_0xff5b('0x27')](function(_0x3e829d){if(_0x3e829d){if(!_0x3e829d[_0xff5b('0x3a')]){throw new db[(_0xff5b('0x72'))][(_0xff5b('0x73'))](_0xff5b('0x8e'),0x193);}_0xebc32=_0x3e829d;return db[_0xff5b('0x74')][_0xff5b('0x48')]({'raw':!![]});}return null;})[_0xff5b('0x27')](function(_0x55eb94){if(_0x55eb94){_0xa44fb4=_[_0xff5b('0x75')](_0x55eb94,'id');var _0x589202;var _0x31ef0f=squel[_0xff5b('0x76')]();_0x31ef0f[_0xff5b('0x8f')](_0x1a88bb[_0xff5b('0x77')]);for(var _0x2db287=0x0;_0x2db287<_0xebc32['length'];_0x2db287+=0x1){_0x589202=_0xebc32[_0x2db287][_0xff5b('0x78')]?_0xa44fb4[_0xebc32[_0x2db287]['MetricId']][_0xff5b('0x79')]:_0xebc32[_0x2db287][_0xff5b('0x6e')];_0x589202=_0xebc32[_0x2db287][_0xff5b('0x7a')]?_['replace'](_0x389a8b[_0xebc32[_0x2db287]['function']],'%s',_0x589202):_0x589202;_0x589202=_0xebc32[_0x2db287][_0xff5b('0x7b')]?_[_0xff5b('0x7c')](_0x232e62[_0xebc32[_0x2db287][_0xff5b('0x7b')]],'%s',_0x589202):_0x589202;if(_0xebc32[_0x2db287][_0xff5b('0x7d')]){_0x31ef0f[_0xff5b('0x6d')](_0x589202);}_0xebc32[_0x2db287][_0xff5b('0x90')]&&_0x31ef0f[_0xff5b('0x3d')](_0x589202,_0xebc32[_0x2db287]['orderBy']===_0xff5b('0x7e')?![]:!![]);_0x31ef0f[_0xff5b('0x6e')](_0x589202,_0xebc32[_0x2db287][_0xff5b('0x7f')]||_0x589202);}if(_0x1a88bb[_0xff5b('0x80')]){_0x1a88bb['joins']=JSON[_0xff5b('0x91')](_0x1a88bb[_0xff5b('0x80')]);for(var _0x260069=0x0;_0x260069<_0x1a88bb['joins']['length'];_0x260069+=0x1){if(_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x42')]&&_[_0xff5b('0x68')](_0x3261f5,_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x42')])&&_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x81')]&&_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x82')]&&_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x83')]){_0x31ef0f[_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x42')]](_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x82')],null,util[_0xff5b('0x7b')](_0xff5b('0x92'),_0x1a88bb[_0xff5b('0x77')],_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x81')],_0x1a88bb['joins'][_0x260069][_0xff5b('0x82')],_0x1a88bb[_0xff5b('0x80')][_0x260069][_0xff5b('0x83')]));}}}if(_0x1a88bb[_0xff5b('0x84')]){_0x1a88bb[_0xff5b('0x84')]=JSON[_0xff5b('0x91')](_0x1a88bb[_0xff5b('0x84')]);_0x31ef0f[_0xff5b('0x40')](_0x1c5998(_0x1a88bb[_0xff5b('0x84')][_0xff5b('0x6d')]));}_0x23eb49=_0x31ef0f[_0xff5b('0x85')]();_0x31ef0f[_0xff5b('0x1f')](_0x1190fb);_0x31ef0f[_0xff5b('0x21')](0x0);return;}})[_0xff5b('0x27')](function(){if(_0x10819d[_0xff5b('0x93')]===_0xff5b('0x94')){return null;}var _0x233400=_[_0xff5b('0x41')](_0x10819d,{'name':_0x10819d['fullPath']||_0x10819d[_0xff5b('0x43')]||_0x1a88bb[_0xff5b('0x43')],'basename':_0xcee392,'savename':util['format'](_0xff5b('0x95'),_0x10819d[_0xff5b('0x43')]||_0x1a88bb[_0xff5b('0x43')],require('randomstring')[_0xff5b('0x96')](0x4),_0x10819d[_0xff5b('0x93')]||_0xff5b('0x97')),'reportId':_0x1a88bb['id'],'reportType':_0xff5b('0x98')});return db['AnalyticExtractedReport']['create'](_0x233400,{'raw':!![]});})[_0xff5b('0x27')](function(_0x204583){if(_0x1a88bb[_0xff5b('0x77')]===_0xff5b('0x99')){_0x23eb49[_0xff5b('0x40')](_0x1a88bb[_0xff5b('0x77')]+_0xff5b('0x9a'),_0x10819d['startDate'],_0x10819d[_0xff5b('0x9b')]);}else{_0x23eb49[_0xff5b('0x40')](_0x1a88bb[_0xff5b('0x77')]+_0xff5b('0x9c'),_0x10819d[_0xff5b('0x9d')],_0x10819d['endDate']);}if(_0x204583){logger[_0xff5b('0x9e')]('Run\x20Query:',_0x23eb49['toString']());require(_0xff5b('0x9f'))['fork'](path[_0xff5b('0x59')](__dirname,_0xff5b('0xa0'),_0x204583[_0xff5b('0x93')]),[_0x204583['id'],_0x23eb49[_0xff5b('0x88')](),path[_0xff5b('0x59')](__dirname,'../../files/reports',_0x204583['savename']),_0xcee392]);return _0x204583;}else{var _0x55c4ad=squel[_0xff5b('0x76')]();_0x55c4ad[_0xff5b('0x8f')]('('+_0x23eb49[_0xff5b('0x88')]()+')',_0xff5b('0xa1'));_0x55c4ad[_0xff5b('0x6e')](_0xff5b('0xa2'),_0xff5b('0x20'));_0x23eb49[_0xff5b('0x1f')](_0x10819d[_0xff5b('0x1f')]||_0x1190fb);_0x23eb49[_0xff5b('0x21')](_0x10819d[_0xff5b('0x21')]||0x0);return dbH[_0xff5b('0x87')][_0xff5b('0x35')](_0x55c4ad[_0xff5b('0x88')](),{'type':dbH['sequelize'][_0xff5b('0xa3')]['SELECT']})[_0xff5b('0x27')](function(_0x5dcac6){if(!_0x5dcac6[_0xff5b('0x3a')]){_0x56522a=0x0;}else{_0x56522a=_0x5dcac6[0x0][_0xff5b('0x20')]||0x0;}return dbH[_0xff5b('0x87')][_0xff5b('0x35')](_0x23eb49['toString'](),{'type':dbH[_0xff5b('0x87')][_0xff5b('0xa3')][_0xff5b('0x89')]});})[_0xff5b('0x27')](function(_0x277656){return{'rows':_0x277656||[],'count':_0x56522a};});}});}exports[_0xff5b('0xa4')]=function(_0x3ad62c,_0x192c95){return runReport(_0x3ad62c['params'],_0x3ad62c['query'],_0x3ad62c[_0xff5b('0x45')])['then'](respondWithResult(_0x192c95,null))[_0xff5b('0x4a')](handleError(_0x192c95,null));};exports[_0xff5b('0xa5')]=runReport;exports[_0xff5b('0x35')]=function(_0x57dddc,_0x528e52){var _0x2f71c5=0xa;var _0xbfa480=[_0xff5b('0x59'),_0xff5b('0x5a'),_0xff5b('0x5b'),_0xff5b('0x5c')];var _0xf1177d={'SUM':_0xff5b('0x5d'),'COUNT':_0xff5b('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xff5b('0x60'),'MIN':_0xff5b('0x61'),'AVG':_0xff5b('0x62'),'GROUP_CONCAT':_0xff5b('0xa6'),'GROUP_CONCAT ASC':_0xff5b('0x8a'),'GROUP_CONCAT DESC':_0xff5b('0x63')};var _0x3a8f4c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xff5b('0x8b'),'HOUR':'HOUR(%s)','ROUND':_0xff5b('0x66'),'UNIX_TIMESTAMP':_0xff5b('0x67')};var _0x1d10f9=function(_0x2928e1){return!_['includes']([_0xff5b('0x69'),_0xff5b('0x6a'),_0xff5b('0x8c'),_0xff5b('0x6b')],_0x2928e1);};var _0x342f4e=function(_0x450db9){if(!_0x450db9||!_0x450db9[_0xff5b('0x6c')][_0xff5b('0x3a')]){return'';}for(var _0xb73ae3='(',_0x523a02=0x0;_0x523a02<_0x450db9[_0xff5b('0x6c')][_0xff5b('0x3a')];_0x523a02+=0x1){_0x523a02>0x0&&(_0xb73ae3+='\x20'+_0x450db9[_0xff5b('0x8d')]+'\x20');_0xb73ae3+=_0x450db9['rules'][_0x523a02][_0xff5b('0x6d')]?_0x342f4e(_0x450db9[_0xff5b('0x6c')][_0x523a02]['group']):_0x450db9['rules'][_0x523a02][_0xff5b('0x6e')]+'\x20'+_0x450db9['rules'][_0x523a02][_0xff5b('0x6f')]+(_0x1d10f9(_0x450db9[_0xff5b('0x6c')][_0x523a02][_0xff5b('0x6f')])?'\x20'+_0x450db9['rules'][_0x523a02][_0xff5b('0x70')]:'');}return _0xb73ae3+')';};var _0x30c1bd={'where':{'id':_0x57dddc['params']['id']}},_0x379416,_0x42072f,_0x420ce1,_0x35f4dc,_0xa37a7a;_0x30c1bd=_[_0xff5b('0x41')]({},_0x30c1bd,_0x57dddc['options']);return db[_0xff5b('0x30')]['find'](_0x30c1bd)[_0xff5b('0x27')](function(_0x1ee292){if(_0x1ee292){_0x379416=_0x1ee292;return _0x1ee292['getFields']();}return null;})[_0xff5b('0x27')](function(_0xaa6b72){if(_0xaa6b72){if(!_0xaa6b72['length']){throw new db[(_0xff5b('0x72'))]['ValidationErrorItem'](_0xff5b('0x8e'),0x193);}_0x42072f=_0xaa6b72;return db[_0xff5b('0x74')]['findAll']({'raw':!![]});}return null;})[_0xff5b('0x27')](function(_0x4fb6e7){if(_0x4fb6e7){_0x420ce1=_[_0xff5b('0x75')](_0x4fb6e7,'id');var _0x18f0af;var _0x5f0c6a=squel[_0xff5b('0x76')]();_0x5f0c6a[_0xff5b('0x8f')](_0x379416['table']);for(var _0x5c6da4=0x0;_0x5c6da4<_0x42072f[_0xff5b('0x3a')];_0x5c6da4+=0x1){_0x18f0af=_0x42072f[_0x5c6da4][_0xff5b('0x78')]?_0x420ce1[_0x42072f[_0x5c6da4][_0xff5b('0x78')]][_0xff5b('0x79')]:_0x42072f[_0x5c6da4]['field'];_0x18f0af=_0x42072f[_0x5c6da4][_0xff5b('0x7a')]?_[_0xff5b('0x7c')](_0xf1177d[_0x42072f[_0x5c6da4][_0xff5b('0x7a')]],'%s',_0x18f0af):_0x18f0af;_0x18f0af=_0x42072f[_0x5c6da4][_0xff5b('0x7b')]?_[_0xff5b('0x7c')](_0x3a8f4c[_0x42072f[_0x5c6da4]['format']],'%s',_0x18f0af):_0x18f0af;if(_0x42072f[_0x5c6da4][_0xff5b('0x7d')]){_0x5f0c6a[_0xff5b('0x6d')](_0x18f0af);}_0x42072f[_0x5c6da4]['orderBy']&&_0x5f0c6a[_0xff5b('0x3d')](_0x18f0af,_0x42072f[_0x5c6da4][_0xff5b('0x90')]===_0xff5b('0x7e')?![]:!![]);_0x5f0c6a[_0xff5b('0x6e')](_0x18f0af,_0x42072f[_0x5c6da4][_0xff5b('0x7f')]||_0x18f0af);}if(_0x379416[_0xff5b('0x80')]){_0x379416['joins']=JSON[_0xff5b('0x91')](_0x379416[_0xff5b('0x80')]);for(var _0x4e7d67=0x0;_0x4e7d67<_0x379416[_0xff5b('0x80')][_0xff5b('0x3a')];_0x4e7d67+=0x1){if(_0x379416['joins'][_0x4e7d67][_0xff5b('0x42')]&&_['includes'](_0xbfa480,_0x379416[_0xff5b('0x80')][_0x4e7d67][_0xff5b('0x42')])&&_0x379416['joins'][_0x4e7d67][_0xff5b('0x81')]&&_0x379416['joins'][_0x4e7d67][_0xff5b('0x82')]&&_0x379416[_0xff5b('0x80')][_0x4e7d67]['foreignKey']){_0x5f0c6a[_0x379416[_0xff5b('0x80')][_0x4e7d67][_0xff5b('0x42')]](_0x379416[_0xff5b('0x80')][_0x4e7d67]['foreignTable'],null,util['format'](_0xff5b('0x92'),_0x379416[_0xff5b('0x77')],_0x379416[_0xff5b('0x80')][_0x4e7d67][_0xff5b('0x81')],_0x379416[_0xff5b('0x80')][_0x4e7d67][_0xff5b('0x82')],_0x379416[_0xff5b('0x80')][_0x4e7d67]['foreignKey']));}}}if(_0x379416['conditions']){_0x379416[_0xff5b('0x84')]=JSON[_0xff5b('0x91')](_0x379416[_0xff5b('0x84')]);_0x5f0c6a['where'](_0x342f4e(_0x379416['conditions'][_0xff5b('0x6d')]));}_0xa37a7a=_0x5f0c6a[_0xff5b('0x85')]();_0x5f0c6a[_0xff5b('0x1f')](_0x2f71c5);_0x5f0c6a[_0xff5b('0x21')](0x0);logger[_0xff5b('0x86')](_0xff5b('0xa7'),_0x5f0c6a[_0xff5b('0x88')]());return dbH[_0xff5b('0x87')][_0xff5b('0x35')](_0x5f0c6a[_0xff5b('0x88')](),{'type':dbH[_0xff5b('0x87')][_0xff5b('0xa3')][_0xff5b('0x89')]});}})['then'](function(){return{'sql':_0xa37a7a['toString']()};})[_0xff5b('0x27')](respondWithResult(_0x528e52,null))[_0xff5b('0x4a')](handleError(_0x528e52,null));}; \ No newline at end of file +var _0x3aee=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','dbH','sendStatus','end','status','offset','undefined','count','limit','json','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','catch','params','keys','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','MetricId','metric','field','function','replace','format','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','value','Please\x20insert\x20at\x20least\x20one\x20field','select','from','groupBy','clone','web','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','runReport','AVG(%s)','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware'];(function(_0x492375,_0xcdc033){var _0x507fd7=function(_0x184211){while(--_0x184211){_0x492375['push'](_0x492375['shift']());}};_0x507fd7(++_0xcdc033);}(_0x3aee,0x131));var _0xe3ae=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x3aee[_0x255ac0];return _0x437bf1;};'use strict';var emlformat=require(_0xe3ae('0x0'));var rimraf=require(_0xe3ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3ae('0x2'));var rp=require(_0xe3ae('0x3'));var moment=require(_0xe3ae('0x4'));var BPromise=require(_0xe3ae('0x5'));var Mustache=require(_0xe3ae('0x6'));var util=require(_0xe3ae('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe3ae('0x8'));var ejs=require(_0xe3ae('0x9'));var fs=require('fs');var fs_extra=require(_0xe3ae('0xa'));var _=require(_0xe3ae('0xb'));var squel=require(_0xe3ae('0xc'));var crypto=require(_0xe3ae('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe3ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe3ae('0xf'));var Papa=require(_0xe3ae('0x10'));var Redis=require(_0xe3ae('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3ae('0x12'));var logger=require(_0xe3ae('0x13'))(_0xe3ae('0x14'));var utils=require(_0xe3ae('0x15'));var config=require(_0xe3ae('0x16'));var licenseUtil=require(_0xe3ae('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xe3ae('0x18')];function respondWithStatusCode(_0x3b4915,_0x51fb1d){_0x51fb1d=_0x51fb1d||0xcc;return function(_0x4c07b6){if(_0x4c07b6){return _0x3b4915[_0xe3ae('0x19')](_0x51fb1d);}return _0x3b4915['status'](_0x51fb1d)[_0xe3ae('0x1a')]();};}function respondWithResult(_0x16eb0d,_0x6ecd9b){_0x6ecd9b=_0x6ecd9b||0xc8;return function(_0x22c790){if(_0x22c790){return _0x16eb0d[_0xe3ae('0x1b')](_0x6ecd9b)['json'](_0x22c790);}};}function respondWithFilteredResult(_0xc17690,_0x4b5826){return function(_0x4e505a){if(_0x4e505a){var _0x34ba70=typeof _0x4b5826[_0xe3ae('0x1c')]===_0xe3ae('0x1d')&&typeof _0x4b5826['limit']===_0xe3ae('0x1d');var _0x1cd220=_0x4e505a['count'];var _0x34f11f=_0x34ba70?0x0:_0x4b5826['offset'];var _0x3522c0=_0x34ba70?_0x4e505a[_0xe3ae('0x1e')]:_0x4b5826[_0xe3ae('0x1c')]+_0x4b5826[_0xe3ae('0x1f')];var _0x2272c0;if(_0x3522c0>=_0x1cd220){_0x3522c0=_0x1cd220;_0x2272c0=0xc8;}else{_0x2272c0=0xce;}_0xc17690[_0xe3ae('0x1b')](_0x2272c0);return _0xc17690['set']('Content-Range',_0x34f11f+'-'+_0x3522c0+'/'+_0x1cd220)[_0xe3ae('0x20')](_0x4e505a);}return null;};}function patchUpdates(_0x45b2c4){return function(_0x42ce83){try{jsonpatch['apply'](_0x42ce83,_0x45b2c4,!![]);}catch(_0x28b092){return BPromise[_0xe3ae('0x21')](_0x28b092);}return _0x42ce83[_0xe3ae('0x22')]();};}function saveUpdates(_0x14aa59,_0x2b07e8){return function(_0x451ec1){if(_0x451ec1){return _0x451ec1[_0xe3ae('0x23')](_0x14aa59)[_0xe3ae('0x24')](function(_0x42b68f){return _0x42b68f;});}return null;};}function removeEntity(_0x36225b,_0x56b4f2){return function(_0x9e7ce0){if(_0x9e7ce0){return _0x9e7ce0[_0xe3ae('0x25')]()[_0xe3ae('0x24')](function(){var _0x5c1efa=_0x9e7ce0[_0xe3ae('0x26')]({'plain':!![]});var _0x2eaeed=_0xe3ae('0x27');return db[_0xe3ae('0x28')]['destroy']({'where':{'type':_0x2eaeed,'resourceId':_0x5c1efa['id']}})[_0xe3ae('0x24')](function(){return _0x9e7ce0;});})[_0xe3ae('0x24')](function(){_0x36225b[_0xe3ae('0x1b')](0xcc)[_0xe3ae('0x1a')]();});}};}function handleEntityNotFound(_0x52b822,_0x4c0a5c){return function(_0x156b78){if(!_0x156b78){_0x52b822[_0xe3ae('0x19')](0x194);}return _0x156b78;};}function handleError(_0x2ed03a,_0x540bd5){_0x540bd5=_0x540bd5||0x1f4;return function(_0x3d67e1){logger['error'](_0x3d67e1[_0xe3ae('0x29')]);if(_0x3d67e1['name']){delete _0x3d67e1[_0xe3ae('0x2a')];}_0x2ed03a[_0xe3ae('0x1b')](_0x540bd5)[_0xe3ae('0x2b')](_0x3d67e1);};}exports[_0xe3ae('0x2c')]=function(_0x2d5b70,_0x99520e){var _0x312454={},_0x26f52e={},_0x234c08={'count':0x0,'rows':[]};var _0x14d09d=_[_0xe3ae('0x2d')](db[_0xe3ae('0x2e')][_0xe3ae('0x2f')],function(_0x265f8e){return{'name':_0x265f8e['fieldName'],'type':_0x265f8e[_0xe3ae('0x30')][_0xe3ae('0x31')]};});_0x26f52e[_0xe3ae('0x32')]=_['map'](_0x14d09d,'name');_0x26f52e[_0xe3ae('0x33')]=_['keys'](_0x2d5b70[_0xe3ae('0x33')]);_0x26f52e[_0xe3ae('0x34')]=_[_0xe3ae('0x35')](_0x26f52e['model'],_0x26f52e[_0xe3ae('0x33')]);_0x312454[_0xe3ae('0x36')]=_[_0xe3ae('0x35')](_0x26f52e[_0xe3ae('0x32')],qs[_0xe3ae('0x37')](_0x2d5b70[_0xe3ae('0x33')]['fields']));_0x312454[_0xe3ae('0x36')]=_0x312454[_0xe3ae('0x36')][_0xe3ae('0x38')]?_0x312454[_0xe3ae('0x36')]:_0x26f52e[_0xe3ae('0x32')];if(!_0x2d5b70['query']['hasOwnProperty'](_0xe3ae('0x39'))){_0x312454[_0xe3ae('0x1f')]=qs[_0xe3ae('0x1f')](_0x2d5b70[_0xe3ae('0x33')][_0xe3ae('0x1f')]);_0x312454[_0xe3ae('0x1c')]=qs[_0xe3ae('0x1c')](_0x2d5b70[_0xe3ae('0x33')][_0xe3ae('0x1c')]);}_0x312454['order']=qs[_0xe3ae('0x3a')](_0x2d5b70['query'][_0xe3ae('0x3a')]);_0x312454[_0xe3ae('0x3b')]=qs[_0xe3ae('0x34')](_[_0xe3ae('0x3c')](_0x2d5b70[_0xe3ae('0x33')],_0x26f52e[_0xe3ae('0x34')]),_0x14d09d);if(_0x2d5b70[_0xe3ae('0x33')]['filter']){_0x312454[_0xe3ae('0x3b')]=_[_0xe3ae('0x3d')](_0x312454[_0xe3ae('0x3b')],{'$or':_[_0xe3ae('0x2d')](_0x14d09d,function(_0x2271a1){if(_0x2271a1[_0xe3ae('0x30')]!==_0xe3ae('0x3e')){var _0x83b798={};_0x83b798[_0x2271a1[_0xe3ae('0x2a')]]={'$like':'%'+_0x2d5b70[_0xe3ae('0x33')]['filter']+'%'};return _0x83b798;}})});}_0x312454=_[_0xe3ae('0x3d')]({},_0x312454,_0x2d5b70['options']);var _0x151fa6={'where':_0x312454[_0xe3ae('0x3b')]};return db[_0xe3ae('0x2e')][_0xe3ae('0x1e')](_0x151fa6)['then'](function(_0x27080f){_0x234c08[_0xe3ae('0x1e')]=_0x27080f;if(_0x2d5b70[_0xe3ae('0x33')][_0xe3ae('0x3f')]){_0x312454[_0xe3ae('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xe3ae('0x41')](_0x312454);})[_0xe3ae('0x24')](function(_0x38d643){_0x234c08['rows']=_0x38d643;return _0x234c08;})[_0xe3ae('0x24')](respondWithFilteredResult(_0x99520e,_0x312454))[_0xe3ae('0x42')](handleError(_0x99520e,null));};exports['show']=function(_0x3e2de9,_0x28f8eb){var _0x5b00a9={'raw':![],'where':{'id':_0x3e2de9[_0xe3ae('0x43')]['id']}},_0xcbd164={};_0xcbd164[_0xe3ae('0x32')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0xcbd164['query']=_[_0xe3ae('0x44')](_0x3e2de9[_0xe3ae('0x33')]);_0xcbd164[_0xe3ae('0x34')]=_['intersection'](_0xcbd164['model'],_0xcbd164['query']);_0x5b00a9[_0xe3ae('0x36')]=_[_0xe3ae('0x35')](_0xcbd164['model'],qs[_0xe3ae('0x37')](_0x3e2de9[_0xe3ae('0x33')][_0xe3ae('0x37')]));_0x5b00a9[_0xe3ae('0x36')]=_0x5b00a9['attributes'][_0xe3ae('0x38')]?_0x5b00a9['attributes']:_0xcbd164['model'];if(_0x3e2de9[_0xe3ae('0x33')][_0xe3ae('0x3f')]){_0x5b00a9['include']=[{'all':!![]}];}_0x5b00a9=_[_0xe3ae('0x3d')]({},_0x5b00a9,_0x3e2de9[_0xe3ae('0x45')]);return db[_0xe3ae('0x2e')]['find'](_0x5b00a9)['then'](handleEntityNotFound(_0x28f8eb,null))[_0xe3ae('0x24')](respondWithResult(_0x28f8eb,null))[_0xe3ae('0x42')](handleError(_0x28f8eb,null));};exports['create']=function(_0x206234,_0x11681f){return db['AnalyticCustomReport'][_0xe3ae('0x46')](_0x206234[_0xe3ae('0x47')],{})['then'](function(_0x46bc95){var _0x41f07d=_0x206234['user'][_0xe3ae('0x26')]({'plain':!![]});if(!_0x41f07d)throw new Error(_0xe3ae('0x48'));if(_0x41f07d[_0xe3ae('0x49')]==='user'){var _0x42e987=_0x46bc95[_0xe3ae('0x26')]({'plain':!![]});var _0x2b1c17=_0xe3ae('0x4a');return db[_0xe3ae('0x4b')][_0xe3ae('0x4c')]({'where':{'name':_0x2b1c17,'userProfileId':_0x41f07d[_0xe3ae('0x4d')]},'raw':!![]})['then'](function(_0x59fd0e){if(_0x59fd0e&&_0x59fd0e['autoAssociation']===0x0){return db[_0xe3ae('0x28')][_0xe3ae('0x46')]({'name':_0x42e987['name'],'resourceId':_0x42e987['id'],'type':_0xe3ae('0x27'),'sectionId':_0x59fd0e['id']},{})['then'](function(){return _0x46bc95;});}else{return _0x46bc95;}})[_0xe3ae('0x42')](function(_0x1dd124){logger['error'](_0xe3ae('0x4e'),_0x1dd124);throw _0x1dd124;});}return _0x46bc95;})[_0xe3ae('0x24')](respondWithResult(_0x11681f,0xc9))[_0xe3ae('0x42')](handleError(_0x11681f,null));};exports[_0xe3ae('0x23')]=function(_0xe599a7,_0x3cf9e6){if(_0xe599a7[_0xe3ae('0x47')]['id']){delete _0xe599a7[_0xe3ae('0x47')]['id'];}return db[_0xe3ae('0x2e')]['find']({'where':{'id':_0xe599a7['params']['id']}})[_0xe3ae('0x24')](handleEntityNotFound(_0x3cf9e6,null))[_0xe3ae('0x24')](saveUpdates(_0xe599a7[_0xe3ae('0x47')],null))[_0xe3ae('0x24')](respondWithResult(_0x3cf9e6,null))[_0xe3ae('0x42')](handleError(_0x3cf9e6,null));};exports[_0xe3ae('0x25')]=function(_0x37737e,_0x3c0fca){return db[_0xe3ae('0x2e')][_0xe3ae('0x4c')]({'where':{'id':_0x37737e[_0xe3ae('0x43')]['id']}})[_0xe3ae('0x24')](handleEntityNotFound(_0x3c0fca,null))[_0xe3ae('0x24')](removeEntity(_0x3c0fca,null))[_0xe3ae('0x42')](handleError(_0x3c0fca,null));};exports['preview']=function(_0x40be3c,_0x1f03e9){var _0x21772e=0xa;var _0x52f49f=[_0xe3ae('0x4f'),_0xe3ae('0x50'),'right_join',_0xe3ae('0x51')];var _0x47a824={'SUM':_0xe3ae('0x52'),'COUNT':_0xe3ae('0x53'),'COUNT DISTINCT':_0xe3ae('0x54'),'MAX':'MAX(%s)','MIN':_0xe3ae('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe3ae('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe3ae('0x57')};var _0x1a889e={'SEC_TO_TIME':_0xe3ae('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xe3ae('0x59'),'UNIX_TIMESTAMP':_0xe3ae('0x5a')};var _0x58f361=function(_0x4d8daf){return!_[_0xe3ae('0x5b')](['IS\x20NULL',_0xe3ae('0x5c'),_0xe3ae('0x5d'),'IS\x20NOT\x20EMPTY'],_0x4d8daf);};var _0x454160=function(_0x34e85f){if(!_0x34e85f||!_0x34e85f[_0xe3ae('0x5e')][_0xe3ae('0x38')]){return'';}for(var _0x4b153d='(',_0x21b6bf=0x0;_0x21b6bf<_0x34e85f['rules'][_0xe3ae('0x38')];_0x21b6bf+=0x1){_0x21b6bf>0x0&&(_0x4b153d+='\x20'+_0x34e85f[_0xe3ae('0x5f')]+'\x20');_0x4b153d+=_0x34e85f['rules'][_0x21b6bf][_0xe3ae('0x60')]?_0x454160(_0x34e85f['rules'][_0x21b6bf]['group']):_0x34e85f['rules'][_0x21b6bf]['field']+'\x20'+_0x34e85f[_0xe3ae('0x5e')][_0x21b6bf][_0xe3ae('0x61')]+(_0x58f361(_0x34e85f[_0xe3ae('0x5e')][_0x21b6bf][_0xe3ae('0x61')])?'\x20'+_0x34e85f[_0xe3ae('0x5e')][_0x21b6bf]['value']:'');}return _0x4b153d+')';};var _0x226533={'where':{'id':_0x40be3c[_0xe3ae('0x43')]['id']}},_0x170745,_0x1c63ed,_0x4f2671,_0x6b7d1e,_0x5d8fb0;_0x226533=_[_0xe3ae('0x3d')]({},_0x226533,_0x40be3c[_0xe3ae('0x45')]);return db['AnalyticCustomReport'][_0xe3ae('0x4c')](_0x226533)['then'](function(_0x46ecf3){if(_0x46ecf3){_0x170745=_0x46ecf3;return _0x46ecf3['getFields']();}return null;})[_0xe3ae('0x24')](function(_0xc54a58){if(_0xc54a58){if(!_0xc54a58[_0xe3ae('0x38')]){throw new db[(_0xe3ae('0x62'))][(_0xe3ae('0x63'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1c63ed=_0xc54a58;return db[_0xe3ae('0x64')][_0xe3ae('0x41')]({'raw':!![]});}return null;})[_0xe3ae('0x24')](function(_0x6c558b){if(_0x6c558b){_0x4f2671=_[_0xe3ae('0x65')](_0x6c558b,'id');var _0x3041b3;var _0x1e0703=squel['select']();_0x1e0703['from'](_0x170745['table']);for(var _0x293345=0x0;_0x293345<_0x1c63ed['length'];_0x293345+=0x1){_0x3041b3=_0x1c63ed[_0x293345][_0xe3ae('0x66')]?_0x4f2671[_0x1c63ed[_0x293345][_0xe3ae('0x66')]][_0xe3ae('0x67')]:_0x1c63ed[_0x293345][_0xe3ae('0x68')];_0x3041b3=_0x1c63ed[_0x293345][_0xe3ae('0x69')]?_[_0xe3ae('0x6a')](_0x47a824[_0x1c63ed[_0x293345][_0xe3ae('0x69')]],'%s',_0x3041b3):_0x3041b3;_0x3041b3=_0x1c63ed[_0x293345][_0xe3ae('0x6b')]?_[_0xe3ae('0x6a')](_0x1a889e[_0x1c63ed[_0x293345]['format']],'%s',_0x3041b3):_0x3041b3;if(_0x1c63ed[_0x293345]['groupBy']){_0x1e0703['group'](_0x3041b3);}_0x1c63ed[_0x293345][_0xe3ae('0x6c')]&&_0x1e0703[_0xe3ae('0x6d')](_0x3041b3,_0x1c63ed[_0x293345][_0xe3ae('0x6c')]===_0xe3ae('0x6e')?![]:!![]);_0x1e0703[_0xe3ae('0x68')](_0x3041b3,_0x1c63ed[_0x293345][_0xe3ae('0x6f')]||_0x3041b3);}if(_0x170745[_0xe3ae('0x70')]){_0x170745[_0xe3ae('0x70')]=JSON[_0xe3ae('0x71')](_0x170745[_0xe3ae('0x70')]);for(var _0x40bf63=0x0;_0x40bf63<_0x170745[_0xe3ae('0x70')][_0xe3ae('0x38')];_0x40bf63+=0x1){if(_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x30')]&&_[_0xe3ae('0x5b')](_0x52f49f,_0x170745[_0xe3ae('0x70')][_0x40bf63]['type'])&&_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x72')]&&_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x73')]&&_0x170745[_0xe3ae('0x70')][_0x40bf63]['foreignKey']){_0x1e0703[_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x30')]](_0x170745['joins'][_0x40bf63]['foreignTable'],null,util[_0xe3ae('0x6b')](_0xe3ae('0x74'),_0x170745[_0xe3ae('0x75')],_0x170745['joins'][_0x40bf63][_0xe3ae('0x72')],_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x73')],_0x170745[_0xe3ae('0x70')][_0x40bf63][_0xe3ae('0x76')]));}}}if(_0x170745[_0xe3ae('0x77')]){_0x170745[_0xe3ae('0x77')]=JSON[_0xe3ae('0x71')](_0x170745[_0xe3ae('0x77')]);_0x1e0703['where'](_0x454160(_0x170745[_0xe3ae('0x77')][_0xe3ae('0x60')]));}_0x5d8fb0=_0x1e0703['clone']();_0x1e0703[_0xe3ae('0x1f')](_0x21772e);_0x1e0703['offset'](0x0);logger[_0xe3ae('0x78')](_0xe3ae('0x79'),_0x1e0703[_0xe3ae('0x7a')]());return dbH['sequelize']['query'](_0x1e0703[_0xe3ae('0x7a')](),{'type':dbH[_0xe3ae('0x7b')][_0xe3ae('0x7c')][_0xe3ae('0x7d')]});}})[_0xe3ae('0x24')](respondWithResult(_0x1f03e9,null))[_0xe3ae('0x42')](handleError(_0x1f03e9,null));};function runReport(_0x5dc21d,_0x390a2a,_0x35aeac){var _0x30824a=_0x390a2a['name'];var _0x5cbabe=0xa;var _0x5aba03=[_0xe3ae('0x4f'),_0xe3ae('0x50'),_0xe3ae('0x7e'),_0xe3ae('0x51')];var _0x58e092={'SUM':_0xe3ae('0x52'),'COUNT':_0xe3ae('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe3ae('0x7f'),'MIN':_0xe3ae('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe3ae('0x80'),'GROUP_CONCAT DESC':_0xe3ae('0x57')};var _0xe139a6={'SEC_TO_TIME':_0xe3ae('0x58'),'DATE':_0xe3ae('0x81'),'HOUR':_0xe3ae('0x82'),'ROUND':_0xe3ae('0x59'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1e8e29=function(_0x167eb3){return!_[_0xe3ae('0x5b')]([_0xe3ae('0x83'),_0xe3ae('0x5c'),_0xe3ae('0x5d'),_0xe3ae('0x84')],_0x167eb3);};var _0x379986=function(_0x4f0532){if(!_0x4f0532||!_0x4f0532['rules'][_0xe3ae('0x38')]){return'';}for(var _0x2c54e7='(',_0x3ad5ca=0x0;_0x3ad5ca<_0x4f0532['rules'][_0xe3ae('0x38')];_0x3ad5ca+=0x1){_0x3ad5ca>0x0&&(_0x2c54e7+='\x20'+_0x4f0532[_0xe3ae('0x5f')]+'\x20');_0x2c54e7+=_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca][_0xe3ae('0x60')]?_0x379986(_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca]['group']):_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca]['field']+'\x20'+_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca][_0xe3ae('0x61')]+(_0x1e8e29(_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca]['condition'])?'\x20'+_0x4f0532[_0xe3ae('0x5e')][_0x3ad5ca][_0xe3ae('0x85')]:'');}return _0x2c54e7+')';};var _0x4164bd={'where':{'id':_0x5dc21d['id']}},_0x5eb360,_0x55e634,_0x5070b0,_0x3ffab1,_0x1e9b60;_0x4164bd=_[_0xe3ae('0x3d')]({},_0x4164bd,_0x35aeac);return db[_0xe3ae('0x2e')][_0xe3ae('0x4c')](_0x4164bd)[_0xe3ae('0x24')](function(_0x4cb140){if(_0x4cb140){_0x5eb360=_0x4cb140;return _0x4cb140['getFields']();}return null;})[_0xe3ae('0x24')](function(_0x9b68fb){if(_0x9b68fb){if(!_0x9b68fb['length']){throw new db[(_0xe3ae('0x62'))]['ValidationErrorItem'](_0xe3ae('0x86'),0x193);}_0x55e634=_0x9b68fb;return db[_0xe3ae('0x64')][_0xe3ae('0x41')]({'raw':!![]});}return null;})[_0xe3ae('0x24')](function(_0x405609){if(_0x405609){_0x5070b0=_[_0xe3ae('0x65')](_0x405609,'id');var _0x5381ee;var _0xaf2da4=squel[_0xe3ae('0x87')]();_0xaf2da4[_0xe3ae('0x88')](_0x5eb360[_0xe3ae('0x75')]);for(var _0x40e21d=0x0;_0x40e21d<_0x55e634[_0xe3ae('0x38')];_0x40e21d+=0x1){_0x5381ee=_0x55e634[_0x40e21d][_0xe3ae('0x66')]?_0x5070b0[_0x55e634[_0x40e21d]['MetricId']][_0xe3ae('0x67')]:_0x55e634[_0x40e21d][_0xe3ae('0x68')];_0x5381ee=_0x55e634[_0x40e21d]['function']?_[_0xe3ae('0x6a')](_0x58e092[_0x55e634[_0x40e21d][_0xe3ae('0x69')]],'%s',_0x5381ee):_0x5381ee;_0x5381ee=_0x55e634[_0x40e21d]['format']?_[_0xe3ae('0x6a')](_0xe139a6[_0x55e634[_0x40e21d][_0xe3ae('0x6b')]],'%s',_0x5381ee):_0x5381ee;if(_0x55e634[_0x40e21d][_0xe3ae('0x89')]){_0xaf2da4[_0xe3ae('0x60')](_0x5381ee);}_0x55e634[_0x40e21d]['orderBy']&&_0xaf2da4['order'](_0x5381ee,_0x55e634[_0x40e21d]['orderBy']==='DESC'?![]:!![]);_0xaf2da4[_0xe3ae('0x68')](_0x5381ee,_0x55e634[_0x40e21d][_0xe3ae('0x6f')]||_0x5381ee);}if(_0x5eb360[_0xe3ae('0x70')]){_0x5eb360['joins']=JSON['parse'](_0x5eb360[_0xe3ae('0x70')]);for(var _0x40c6c0=0x0;_0x40c6c0<_0x5eb360[_0xe3ae('0x70')][_0xe3ae('0x38')];_0x40c6c0+=0x1){if(_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x30')]&&_[_0xe3ae('0x5b')](_0x5aba03,_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x30')])&&_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x72')]&&_0x5eb360[_0xe3ae('0x70')][_0x40c6c0]['foreignTable']&&_0x5eb360[_0xe3ae('0x70')][_0x40c6c0]['foreignKey']){_0xaf2da4[_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x30')]](_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x73')],null,util[_0xe3ae('0x6b')](_0xe3ae('0x74'),_0x5eb360['table'],_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x72')],_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x73')],_0x5eb360[_0xe3ae('0x70')][_0x40c6c0][_0xe3ae('0x76')]));}}}if(_0x5eb360[_0xe3ae('0x77')]){_0x5eb360[_0xe3ae('0x77')]=JSON[_0xe3ae('0x71')](_0x5eb360[_0xe3ae('0x77')]);_0xaf2da4['where'](_0x379986(_0x5eb360[_0xe3ae('0x77')]['group']));}_0x1e9b60=_0xaf2da4[_0xe3ae('0x8a')]();_0xaf2da4[_0xe3ae('0x1f')](_0x5cbabe);_0xaf2da4[_0xe3ae('0x1c')](0x0);return;}})['then'](function(){if(_0x390a2a['output']===_0xe3ae('0x8b')){return null;}var _0x136196=_[_0xe3ae('0x3d')](_0x390a2a,{'name':_0x390a2a['fullPath']||_0x390a2a[_0xe3ae('0x2a')]||_0x5eb360[_0xe3ae('0x2a')],'basename':_0x30824a,'savename':util[_0xe3ae('0x6b')](_0xe3ae('0x8c'),_0x390a2a[_0xe3ae('0x2a')]||_0x5eb360[_0xe3ae('0x2a')],require(_0xe3ae('0x8d'))[_0xe3ae('0x8e')](0x4),_0x390a2a[_0xe3ae('0x8f')]||_0xe3ae('0x90')),'reportId':_0x5eb360['id'],'reportType':'custom'});return db[_0xe3ae('0x91')]['create'](_0x136196,{'raw':!![]});})[_0xe3ae('0x24')](function(_0x1ce822){if(_0x5eb360[_0xe3ae('0x75')]===_0xe3ae('0x92')){_0x1e9b60[_0xe3ae('0x3b')](_0x5eb360[_0xe3ae('0x75')]+_0xe3ae('0x93'),_0x390a2a[_0xe3ae('0x94')],_0x390a2a[_0xe3ae('0x95')]);}else{_0x1e9b60[_0xe3ae('0x3b')](_0x5eb360[_0xe3ae('0x75')]+_0xe3ae('0x96'),_0x390a2a[_0xe3ae('0x94')],_0x390a2a[_0xe3ae('0x95')]);}if(_0x1ce822){logger[_0xe3ae('0x97')](_0xe3ae('0x98'),_0x1e9b60[_0xe3ae('0x7a')]());require(_0xe3ae('0x99'))[_0xe3ae('0x9a')](path['join'](__dirname,_0xe3ae('0x9b'),_0x1ce822[_0xe3ae('0x8f')]),[_0x1ce822['id'],_0x1e9b60[_0xe3ae('0x7a')](),path[_0xe3ae('0x4f')](__dirname,_0xe3ae('0x9c'),_0x1ce822[_0xe3ae('0x9d')]),_0x30824a]);return _0x1ce822;}else{var _0x341ffd=squel[_0xe3ae('0x87')]();_0x341ffd[_0xe3ae('0x88')]('('+_0x1e9b60['toString']()+')',_0xe3ae('0x9e'));_0x341ffd[_0xe3ae('0x68')]('COUNT(*)',_0xe3ae('0x1e'));_0x1e9b60[_0xe3ae('0x1f')](_0x390a2a[_0xe3ae('0x1f')]||_0x5cbabe);_0x1e9b60[_0xe3ae('0x1c')](_0x390a2a['offset']||0x0);return dbH[_0xe3ae('0x7b')][_0xe3ae('0x33')](_0x341ffd[_0xe3ae('0x7a')](),{'type':dbH[_0xe3ae('0x7b')][_0xe3ae('0x7c')][_0xe3ae('0x7d')]})[_0xe3ae('0x24')](function(_0xfe9e73){if(!_0xfe9e73['length']){_0x3ffab1=0x0;}else{_0x3ffab1=_0xfe9e73[0x0][_0xe3ae('0x1e')]||0x0;}return dbH[_0xe3ae('0x7b')][_0xe3ae('0x33')](_0x1e9b60['toString'](),{'type':dbH[_0xe3ae('0x7b')]['QueryTypes'][_0xe3ae('0x7d')]});})[_0xe3ae('0x24')](function(_0x2d23a9){return{'rows':_0x2d23a9||[],'count':_0x3ffab1};});}});}exports['run']=function(_0x323040,_0x1563f8){return runReport(_0x323040['params'],_0x323040[_0xe3ae('0x33')],_0x323040[_0xe3ae('0x45')])['then'](respondWithResult(_0x1563f8,null))[_0xe3ae('0x42')](handleError(_0x1563f8,null));};exports[_0xe3ae('0x9f')]=runReport;exports[_0xe3ae('0x33')]=function(_0x9d3d22,_0x3c3d81){var _0x5b5042=0xa;var _0x4785ea=[_0xe3ae('0x4f'),_0xe3ae('0x50'),_0xe3ae('0x7e'),_0xe3ae('0x51')];var _0x4f394c={'SUM':_0xe3ae('0x52'),'COUNT':_0xe3ae('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe3ae('0x7f'),'MIN':_0xe3ae('0x55'),'AVG':_0xe3ae('0xa0'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe3ae('0x80'),'GROUP_CONCAT DESC':_0xe3ae('0x57')};var _0x84d115={'SEC_TO_TIME':_0xe3ae('0x58'),'DATE':_0xe3ae('0x81'),'HOUR':_0xe3ae('0x82'),'ROUND':_0xe3ae('0x59'),'UNIX_TIMESTAMP':_0xe3ae('0x5a')};var _0x5a7f29=function(_0x5431e5){return!_[_0xe3ae('0x5b')]([_0xe3ae('0x83'),_0xe3ae('0x5c'),'IS\x20EMPTY',_0xe3ae('0x84')],_0x5431e5);};var _0x2c2e8e=function(_0x22c379){if(!_0x22c379||!_0x22c379[_0xe3ae('0x5e')][_0xe3ae('0x38')]){return'';}for(var _0xb8869d='(',_0x3be6cb=0x0;_0x3be6cb<_0x22c379[_0xe3ae('0x5e')][_0xe3ae('0x38')];_0x3be6cb+=0x1){_0x3be6cb>0x0&&(_0xb8869d+='\x20'+_0x22c379[_0xe3ae('0x5f')]+'\x20');_0xb8869d+=_0x22c379[_0xe3ae('0x5e')][_0x3be6cb][_0xe3ae('0x60')]?_0x2c2e8e(_0x22c379[_0xe3ae('0x5e')][_0x3be6cb][_0xe3ae('0x60')]):_0x22c379[_0xe3ae('0x5e')][_0x3be6cb][_0xe3ae('0x68')]+'\x20'+_0x22c379[_0xe3ae('0x5e')][_0x3be6cb][_0xe3ae('0x61')]+(_0x5a7f29(_0x22c379['rules'][_0x3be6cb][_0xe3ae('0x61')])?'\x20'+_0x22c379['rules'][_0x3be6cb]['value']:'');}return _0xb8869d+')';};var _0x158a85={'where':{'id':_0x9d3d22['params']['id']}},_0x32bb6d,_0x2094c7,_0x2588ef,_0x6c6485,_0x2f3702;_0x158a85=_['merge']({},_0x158a85,_0x9d3d22['options']);return db['AnalyticCustomReport'][_0xe3ae('0x4c')](_0x158a85)[_0xe3ae('0x24')](function(_0x441e52){if(_0x441e52){_0x32bb6d=_0x441e52;return _0x441e52[_0xe3ae('0xa1')]();}return null;})[_0xe3ae('0x24')](function(_0x3898a0){if(_0x3898a0){if(!_0x3898a0[_0xe3ae('0x38')]){throw new db[(_0xe3ae('0x62'))][(_0xe3ae('0x63'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2094c7=_0x3898a0;return db[_0xe3ae('0x64')][_0xe3ae('0x41')]({'raw':!![]});}return null;})[_0xe3ae('0x24')](function(_0x201400){if(_0x201400){_0x2588ef=_[_0xe3ae('0x65')](_0x201400,'id');var _0x3fb853;var _0x401da5=squel[_0xe3ae('0x87')]();_0x401da5['from'](_0x32bb6d[_0xe3ae('0x75')]);for(var _0x8c8dd0=0x0;_0x8c8dd0<_0x2094c7[_0xe3ae('0x38')];_0x8c8dd0+=0x1){_0x3fb853=_0x2094c7[_0x8c8dd0][_0xe3ae('0x66')]?_0x2588ef[_0x2094c7[_0x8c8dd0][_0xe3ae('0x66')]][_0xe3ae('0x67')]:_0x2094c7[_0x8c8dd0][_0xe3ae('0x68')];_0x3fb853=_0x2094c7[_0x8c8dd0]['function']?_[_0xe3ae('0x6a')](_0x4f394c[_0x2094c7[_0x8c8dd0][_0xe3ae('0x69')]],'%s',_0x3fb853):_0x3fb853;_0x3fb853=_0x2094c7[_0x8c8dd0]['format']?_[_0xe3ae('0x6a')](_0x84d115[_0x2094c7[_0x8c8dd0]['format']],'%s',_0x3fb853):_0x3fb853;if(_0x2094c7[_0x8c8dd0]['groupBy']){_0x401da5[_0xe3ae('0x60')](_0x3fb853);}_0x2094c7[_0x8c8dd0][_0xe3ae('0x6c')]&&_0x401da5[_0xe3ae('0x6d')](_0x3fb853,_0x2094c7[_0x8c8dd0][_0xe3ae('0x6c')]===_0xe3ae('0x6e')?![]:!![]);_0x401da5['field'](_0x3fb853,_0x2094c7[_0x8c8dd0][_0xe3ae('0x6f')]||_0x3fb853);}if(_0x32bb6d['joins']){_0x32bb6d[_0xe3ae('0x70')]=JSON[_0xe3ae('0x71')](_0x32bb6d[_0xe3ae('0x70')]);for(var _0x4ebbd4=0x0;_0x4ebbd4<_0x32bb6d['joins'][_0xe3ae('0x38')];_0x4ebbd4+=0x1){if(_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x30')]&&_['includes'](_0x4785ea,_0x32bb6d['joins'][_0x4ebbd4]['type'])&&_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x72')]&&_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4]['foreignTable']&&_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x76')]){_0x401da5[_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x30')]](_0x32bb6d['joins'][_0x4ebbd4][_0xe3ae('0x73')],null,util[_0xe3ae('0x6b')](_0xe3ae('0x74'),_0x32bb6d[_0xe3ae('0x75')],_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x72')],_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4]['foreignTable'],_0x32bb6d[_0xe3ae('0x70')][_0x4ebbd4][_0xe3ae('0x76')]));}}}if(_0x32bb6d[_0xe3ae('0x77')]){_0x32bb6d[_0xe3ae('0x77')]=JSON[_0xe3ae('0x71')](_0x32bb6d[_0xe3ae('0x77')]);_0x401da5['where'](_0x2c2e8e(_0x32bb6d['conditions'][_0xe3ae('0x60')]));}_0x2f3702=_0x401da5[_0xe3ae('0x8a')]();_0x401da5['limit'](_0x5b5042);_0x401da5[_0xe3ae('0x1c')](0x0);logger[_0xe3ae('0x78')](_0xe3ae('0x79'),_0x401da5[_0xe3ae('0x7a')]());return dbH[_0xe3ae('0x7b')]['query'](_0x401da5[_0xe3ae('0x7a')](),{'type':dbH['sequelize'][_0xe3ae('0x7c')][_0xe3ae('0x7d')]});}})[_0xe3ae('0x24')](function(){return{'sql':_0x2f3702[_0xe3ae('0x7a')]()};})[_0xe3ae('0x24')](respondWithResult(_0x3c3d81,null))[_0xe3ae('0x42')](handleError(_0x3c3d81,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index f6fd470..392bd8d 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 _0x55ac=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x5d4f19,_0x1e6a77){var _0x38ff80=function(_0x30be54){while(--_0x30be54){_0x5d4f19['push'](_0x5d4f19['shift']());}};_0x38ff80(++_0x1e6a77);}(_0x55ac,0x1f0));var _0xc55a=function(_0x3156b6,_0x112012){_0x3156b6=_0x3156b6-0x0;var _0x3bd46f=_0x55ac[_0x3156b6];return _0x3bd46f;};'use strict';var _=require(_0xc55a('0x0'));var util=require(_0xc55a('0x1'));var logger=require(_0xc55a('0x2'))(_0xc55a('0x3'));var moment=require(_0xc55a('0x4'));var BPromise=require('bluebird');var rp=require(_0xc55a('0x5'));var fs=require('fs');var path=require(_0xc55a('0x6'));var rimraf=require('rimraf');var config=require(_0xc55a('0x7'));var attributes=require(_0xc55a('0x8'));module[_0xc55a('0x9')]=function(_0x4528da,_0x111e5c){return _0x4528da[_0xc55a('0xa')](_0xc55a('0xb'),attributes,{'tableName':_0xc55a('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7372=['define','analytics_custom_reports','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x298b53,_0x3f830d){var _0x370c14=function(_0x16a8d7){while(--_0x16a8d7){_0x298b53['push'](_0x298b53['shift']());}};_0x370c14(++_0x3f830d);}(_0x7372,0xe9));var _0x2737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7372[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2737('0x0'));var logger=require(_0x2737('0x1'))(_0x2737('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2737('0x3'));var fs=require('fs');var path=require(_0x2737('0x4'));var rimraf=require(_0x2737('0x5'));var config=require(_0x2737('0x6'));var attributes=require(_0x2737('0x7'));module[_0x2737('0x8')]=function(_0x21d3ac,_0x56634c){return _0x21d3ac[_0x2737('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x2737('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index d06ad45..289ad0f 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 _0x95cc=['request\x20sent','AnalyticCustomReport,\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','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x290da7,_0x1684e8){var _0x12419d=function(_0xf8d1d9){while(--_0xf8d1d9){_0x290da7['push'](_0x290da7['shift']());}};_0x12419d(++_0x1684e8);}(_0x95cc,0x1e3));var _0xc95c=function(_0x3b9060,_0x3a34af){_0x3b9060=_0x3b9060-0x0;var _0x25fdc9=_0x95cc[_0x3b9060];return _0x25fdc9;};'use strict';var _=require(_0xc95c('0x0'));var util=require(_0xc95c('0x1'));var moment=require(_0xc95c('0x2'));var BPromise=require(_0xc95c('0x3'));var rs=require(_0xc95c('0x4'));var fs=require('fs');var Redis=require(_0xc95c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc95c('0x6'));var logger=require(_0xc95c('0x7'))(_0xc95c('0x8'));var config=require(_0xc95c('0x9'));var jayson=require(_0xc95c('0xa'));var client=jayson[_0xc95c('0xb')][_0xc95c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2749ef,_0x361dfd,_0x26e21e){return new BPromise(function(_0x557fb9,_0x5366dd){return client[_0xc95c('0xd')](_0x2749ef,_0x26e21e)[_0xc95c('0xe')](function(_0x145f7e){logger[_0xc95c('0xf')](_0xc95c('0x10'),_0x361dfd,_0xc95c('0x11'));logger['debug'](_0xc95c('0x12'),_0x361dfd,_0xc95c('0x11'),JSON[_0xc95c('0x13')](_0x145f7e));if(_0x145f7e['error']){if(_0x145f7e[_0xc95c('0x14')][_0xc95c('0x15')]===0x1f4){logger['error'](_0xc95c('0x10'),_0x361dfd,_0x145f7e[_0xc95c('0x14')]['message']);return _0x5366dd(_0x145f7e[_0xc95c('0x14')][_0xc95c('0x16')]);}logger[_0xc95c('0x14')](_0xc95c('0x10'),_0x361dfd,_0x145f7e[_0xc95c('0x14')][_0xc95c('0x16')]);return _0x557fb9(_0x145f7e[_0xc95c('0x14')][_0xc95c('0x16')]);}else{logger[_0xc95c('0xf')](_0xc95c('0x10'),_0x361dfd,'request\x20sent');_0x557fb9(_0x145f7e[_0xc95c('0x17')][_0xc95c('0x16')]);}})[_0xc95c('0x18')](function(_0x57e07d){logger[_0xc95c('0x14')](_0xc95c('0x10'),_0x361dfd,_0x57e07d);_0x5366dd(_0x57e07d);});});} \ No newline at end of file +var _0xc400=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x3b49f8,_0x567194){var _0x1bc638=function(_0xbb3a87){while(--_0xbb3a87){_0x3b49f8['push'](_0x3b49f8['shift']());}};_0x1bc638(++_0x567194);}(_0xc400,0xf9));var _0x0c40=function(_0x493a9a,_0x44a487){_0x493a9a=_0x493a9a-0x0;var _0x2ff0a6=_0xc400[_0x493a9a];return _0x2ff0a6;};'use strict';var _=require(_0x0c40('0x0'));var util=require('util');var moment=require(_0x0c40('0x1'));var BPromise=require(_0x0c40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c40('0x3'));var db=require(_0x0c40('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c40('0x5'))(_0x0c40('0x6'));var config=require('../../config/environment');var jayson=require(_0x0c40('0x7'));var client=jayson[_0x0c40('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31a8f6,_0x57b6ec,_0x3657fa){return new BPromise(function(_0x21af46,_0x30815a){return client[_0x0c40('0x9')](_0x31a8f6,_0x3657fa)[_0x0c40('0xa')](function(_0x21d20a){logger[_0x0c40('0xb')](_0x0c40('0xc'),_0x57b6ec,_0x0c40('0xd'));logger[_0x0c40('0xe')](_0x0c40('0xf'),_0x57b6ec,_0x0c40('0xd'),JSON['stringify'](_0x21d20a));if(_0x21d20a[_0x0c40('0x10')]){if(_0x21d20a[_0x0c40('0x10')][_0x0c40('0x11')]===0x1f4){logger[_0x0c40('0x10')](_0x0c40('0xc'),_0x57b6ec,_0x21d20a[_0x0c40('0x10')][_0x0c40('0x12')]);return _0x30815a(_0x21d20a[_0x0c40('0x10')][_0x0c40('0x12')]);}logger[_0x0c40('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57b6ec,_0x21d20a['error']['message']);return _0x21af46(_0x21d20a['error']['message']);}else{logger[_0x0c40('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57b6ec,_0x0c40('0xd'));_0x21af46(_0x21d20a[_0x0c40('0x13')]['message']);}})[_0x0c40('0x14')](function(_0x23ce6a){logger['error'](_0x0c40('0xc'),_0x57b6ec,_0x23ce6a);_0x30815a(_0x23ce6a);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 7657891..e9be345 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 _0x5022=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','create','put','update','delete','multer','util','path'];(function(_0x5ed83b,_0x4b0e47){var _0x613430=function(_0x392d22){while(--_0x392d22){_0x5ed83b['push'](_0x5ed83b['shift']());}};_0x613430(++_0x4b0e47);}(_0x5022,0x189));var _0x2502=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x5022[_0x4a3898];return _0x25ceb0;};'use strict';var multer=require(_0x2502('0x0'));var util=require(_0x2502('0x1'));var path=require(_0x2502('0x2'));var timeout=require(_0x2502('0x3'));var express=require(_0x2502('0x4'));var router=express[_0x2502('0x5')]();var fs_extra=require(_0x2502('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2502('0x7'));var config=require('../../config/environment');var controller=require(_0x2502('0x8'));router[_0x2502('0x9')]('/',auth[_0x2502('0xa')](),controller[_0x2502('0xb')]);router[_0x2502('0x9')](_0x2502('0xc'),auth[_0x2502('0xa')](),controller['show']);router[_0x2502('0x9')](_0x2502('0xd'),auth[_0x2502('0xa')](),controller[_0x2502('0xe')]);router[_0x2502('0x9')](_0x2502('0xf'),auth[_0x2502('0xa')](),controller['run']);router[_0x2502('0x9')](_0x2502('0x10'),auth[_0x2502('0xa')](),controller[_0x2502('0x11')]);router['post']('/',auth[_0x2502('0xa')](),controller[_0x2502('0x12')]);router[_0x2502('0x13')](_0x2502('0xc'),auth[_0x2502('0xa')](),controller[_0x2502('0x14')]);router[_0x2502('0x15')](_0x2502('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf55e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy'];(function(_0x47729a,_0x197fdd){var _0x4dedd1=function(_0x467912){while(--_0x467912){_0x47729a['push'](_0x47729a['shift']());}};_0x4dedd1(++_0x197fdd);}(_0xf55e,0x191));var _0xef55=function(_0x4452d6,_0x2c1d0f){_0x4452d6=_0x4452d6-0x0;var _0x2c7fa1=_0xf55e[_0x4452d6];return _0x2c7fa1;};'use strict';var multer=require(_0xef55('0x0'));var util=require(_0xef55('0x1'));var path=require(_0xef55('0x2'));var timeout=require(_0xef55('0x3'));var express=require(_0xef55('0x4'));var router=express['Router']();var fs_extra=require(_0xef55('0x5'));var auth=require(_0xef55('0x6'));var interaction=require(_0xef55('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xef55('0x8')]('/',auth[_0xef55('0x9')](),controller[_0xef55('0xa')]);router[_0xef55('0x8')](_0xef55('0xb'),auth[_0xef55('0x9')](),controller[_0xef55('0xc')]);router[_0xef55('0x8')](_0xef55('0xd'),auth['isAuthenticated'](),controller[_0xef55('0xe')]);router['get'](_0xef55('0xf'),auth[_0xef55('0x9')](),controller[_0xef55('0x10')]);router[_0xef55('0x8')](_0xef55('0x11'),auth[_0xef55('0x9')](),controller[_0xef55('0x12')]);router[_0xef55('0x13')]('/',auth[_0xef55('0x9')](),controller[_0xef55('0x14')]);router[_0xef55('0x15')](_0xef55('0xb'),auth['isAuthenticated'](),controller[_0xef55('0x16')]);router['delete'](_0xef55('0xb'),auth[_0xef55('0x9')](),controller[_0xef55('0x17')]);module[_0xef55('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 2dbba72..38ad115 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 _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0x32a223,_0x446b81){var _0x4290a9=function(_0x5625a8){while(--_0x5625a8){_0x32a223['push'](_0x32a223['shift']());}};_0x4290a9(++_0x446b81);}(_0xa630,0xbe));var _0x0a63=function(_0x8239df,_0x3d51a1){_0x8239df=_0x8239df-0x0;var _0x40de17=_0xa630[_0x8239df];return _0x40de17;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x46ed,0x168));var _0xd46e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x46ed[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e571549..4d67d76 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(_0x4191f6,_0x3e0fdb){var _0x5cb2ac=function(_0x55083f){while(--_0x55083f){_0x4191f6['push'](_0x4191f6['shift']());}};_0x5cb2ac(++_0x3e0fdb);}(_0x2675,0x75));var _0x5267=function(_0xad9357,_0x4a0a20){_0xad9357=_0xad9357-0x0;var _0x3780f7=_0x2675[_0xad9357];return _0x3780f7;};'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 _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x5dbb0a,_0x2daefa){var _0x2100e9=function(_0x261959){while(--_0x261959){_0x5dbb0a['push'](_0x5dbb0a['shift']());}};_0x2100e9(++_0x2daefa);}(_0x5fab,0x177));var _0xb5fa=function(_0x27c69b,_0x4cbe55){_0x27c69b=_0x27c69b-0x0;var _0x198ac4=_0x5fab[_0x27c69b];return _0x198ac4;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 3582a0c..ce5237b 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 _0x12bc=['rimraf','exports','AnalyticDefaultReport','analytics_default_reports','lodash','bluebird','request-promise'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0x12bc,0x162));var _0xc12b=function(_0x5834dc,_0x45d530){_0x5834dc=_0x5834dc-0x0;var _0x394d8b=_0x12bc[_0x5834dc];return _0x394d8b;};'use strict';var _=require(_0xc12b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc12b('0x1'));var rp=require(_0xc12b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc12b('0x3'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0xc12b('0x4')]=function(_0xe3c117,_0x2a65e3){return _0xe3c117['define'](_0xc12b('0x5'),attributes,{'tableName':_0xc12b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf716=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define'];(function(_0x5e586d,_0x2c47de){var _0x4aa612=function(_0x471241){while(--_0x471241){_0x5e586d['push'](_0x5e586d['shift']());}};_0x4aa612(++_0x2c47de);}(_0xf716,0x91));var _0x6f71=function(_0x355bc3,_0x7a93f7){_0x355bc3=_0x355bc3-0x0;var _0x34a9b3=_0xf716[_0x355bc3];return _0x34a9b3;};'use strict';var _=require(_0x6f71('0x0'));var util=require(_0x6f71('0x1'));var logger=require(_0x6f71('0x2'))(_0x6f71('0x3'));var moment=require(_0x6f71('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f71('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f71('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x6f71('0x7')]=function(_0x5dbf3b,_0x7accc9){return _0x5dbf3b[_0x6f71('0x8')](_0x6f71('0x9'),attributes,{'tableName':_0x6f71('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 2c34cd0..3279cb2 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 _0x1f5b=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x216b8d,_0x2e1a02){var _0x3f0f2b=function(_0x43bc2e){while(--_0x43bc2e){_0x216b8d['push'](_0x216b8d['shift']());}};_0x3f0f2b(++_0x2e1a02);}(_0x1f5b,0x182));var _0xb1f5=function(_0x23f88c,_0x421f3d){_0x23f88c=_0x23f88c-0x0;var _0x502409=_0x1f5b[_0x23f88c];return _0x502409;};'use strict';var _=require(_0xb1f5('0x0'));var util=require('util');var moment=require(_0xb1f5('0x1'));var BPromise=require(_0xb1f5('0x2'));var rs=require(_0xb1f5('0x3'));var fs=require('fs');var Redis=require(_0xb1f5('0x4'));var db=require(_0xb1f5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb1f5('0x6'));var config=require(_0xb1f5('0x7'));var jayson=require(_0xb1f5('0x8'));var client=jayson['client'][_0xb1f5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1895b1,_0x48d36a,_0x1319e1){return new BPromise(function(_0x49e209,_0x3ddfcc){return client[_0xb1f5('0xa')](_0x1895b1,_0x1319e1)['then'](function(_0x1e2e29){logger[_0xb1f5('0xb')](_0xb1f5('0xc'),_0x48d36a,'request\x20sent');logger[_0xb1f5('0xd')](_0xb1f5('0xe'),_0x48d36a,_0xb1f5('0xf'),JSON[_0xb1f5('0x10')](_0x1e2e29));if(_0x1e2e29[_0xb1f5('0x11')]){if(_0x1e2e29['error'][_0xb1f5('0x12')]===0x1f4){logger[_0xb1f5('0x11')](_0xb1f5('0xc'),_0x48d36a,_0x1e2e29[_0xb1f5('0x11')][_0xb1f5('0x13')]);return _0x3ddfcc(_0x1e2e29[_0xb1f5('0x11')][_0xb1f5('0x13')]);}logger['error'](_0xb1f5('0xc'),_0x48d36a,_0x1e2e29['error']['message']);return _0x49e209(_0x1e2e29['error'][_0xb1f5('0x13')]);}else{logger[_0xb1f5('0xb')](_0xb1f5('0xc'),_0x48d36a,'request\x20sent');_0x49e209(_0x1e2e29['result'][_0xb1f5('0x13')]);}})[_0xb1f5('0x14')](function(_0xf41990){logger[_0xb1f5('0x11')](_0xb1f5('0xc'),_0x48d36a,_0xf41990);_0x3ddfcc(_0xf41990);});});} \ No newline at end of file +var _0x1310=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then'];(function(_0x1444b0,_0x187724){var _0x29617b=function(_0x58a705){while(--_0x58a705){_0x1444b0['push'](_0x1444b0['shift']());}};_0x29617b(++_0x187724);}(_0x1310,0x7c));var _0x0131=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1310[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0131('0x0'));var util=require(_0x0131('0x1'));var moment=require(_0x0131('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0131('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0131('0x4'));var logger=require(_0x0131('0x5'))('rpc');var config=require(_0x0131('0x6'));var jayson=require(_0x0131('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d56ee,_0x48aea9,_0x13f525){return new BPromise(function(_0x2cee2f,_0x267601){return client['request'](_0x4d56ee,_0x13f525)[_0x0131('0x8')](function(_0xe1e68c){logger[_0x0131('0x9')](_0x0131('0xa'),_0x48aea9,_0x0131('0xb'));logger[_0x0131('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x48aea9,_0x0131('0xb'),JSON[_0x0131('0xd')](_0xe1e68c));if(_0xe1e68c['error']){if(_0xe1e68c[_0x0131('0xe')][_0x0131('0xf')]===0x1f4){logger[_0x0131('0xe')](_0x0131('0xa'),_0x48aea9,_0xe1e68c[_0x0131('0xe')][_0x0131('0x10')]);return _0x267601(_0xe1e68c['error'][_0x0131('0x10')]);}logger[_0x0131('0xe')](_0x0131('0xa'),_0x48aea9,_0xe1e68c[_0x0131('0xe')][_0x0131('0x10')]);return _0x2cee2f(_0xe1e68c[_0x0131('0xe')][_0x0131('0x10')]);}else{logger['info'](_0x0131('0xa'),_0x48aea9,'request\x20sent');_0x2cee2f(_0xe1e68c[_0x0131('0x11')][_0x0131('0x10')]);}})[_0x0131('0x12')](function(_0x12dcc6){logger[_0x0131('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x48aea9,_0x12dcc6);_0x267601(_0x12dcc6);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 5f1e293..a9297f8 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 _0xfa9f=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','/:id','show','get','preview','/:id/run','run','/:id/query','query','post','create','put','update'];(function(_0xb22b2a,_0x18476c){var _0x2df981=function(_0x283180){while(--_0x283180){_0xb22b2a['push'](_0xb22b2a['shift']());}};_0x2df981(++_0x18476c);}(_0xfa9f,0x93));var _0xffa9=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0xfa9f[_0x314a8c];return _0x1d4607;};'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/preview',auth[_0xffa9('0x8')](),controller[_0xffa9('0xc')]);router[_0xffa9('0xb')](_0xffa9('0xd'),auth[_0xffa9('0x8')](),controller[_0xffa9('0xe')]);router[_0xffa9('0xb')](_0xffa9('0xf'),auth[_0xffa9('0x8')](),controller[_0xffa9('0x10')]);router[_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 +var _0x0ab3=['get','isAuthenticated','/:id','show','/:id/run','/:id/query','query','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0ab3,0x111));var _0x30ab=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0ab3[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0x30ab('0x0'));var path=require(_0x30ab('0x1'));var timeout=require(_0x30ab('0x2'));var express=require(_0x30ab('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x30ab('0x4'));var interaction=require(_0x30ab('0x5'));var config=require('../../config/environment');var controller=require(_0x30ab('0x6'));router[_0x30ab('0x7')]('/',auth[_0x30ab('0x8')](),controller['index']);router[_0x30ab('0x7')](_0x30ab('0x9'),auth[_0x30ab('0x8')](),controller[_0x30ab('0xa')]);router[_0x30ab('0x7')]('/:id/preview',auth[_0x30ab('0x8')](),controller['preview']);router[_0x30ab('0x7')](_0x30ab('0xb'),auth[_0x30ab('0x8')](),controller['run']);router[_0x30ab('0x7')](_0x30ab('0xc'),auth[_0x30ab('0x8')](),controller[_0x30ab('0xd')]);router[_0x30ab('0xe')]('/',auth[_0x30ab('0x8')](),controller[_0x30ab('0xf')]);router[_0x30ab('0x10')](_0x30ab('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x30ab('0x11')](_0x30ab('0x9'),auth[_0x30ab('0x8')](),controller[_0x30ab('0x12')]);module[_0x30ab('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 2600aa4..f04514a 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 _0xf2e5=['INTEGER','UNSIGNED','sequelize','exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled'];(function(_0x1dde9c,_0x54f66c){var _0x42a2f3=function(_0x37e0c9){while(--_0x37e0c9){_0x1dde9c['push'](_0x1dde9c['shift']());}};_0x42a2f3(++_0x54f66c);}(_0xf2e5,0x12e));var _0x5f2e=function(_0x20c757,_0xf1f53b){_0x20c757=_0x20c757-0x0;var _0x2720f3=_0xf2e5[_0x20c757];return _0x2720f3;};'use strict';var Sequelize=require(_0x5f2e('0x0'));var moment=require('moment');module[_0x5f2e('0x1')]={'name':{'type':Sequelize[_0x5f2e('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x5f2e('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x5f2e('0x3'),_0x5f2e('0x4'),_0x5f2e('0x5')),'allowNull':![],'defaultValue':_0x5f2e('0x3')},'savename':{'type':Sequelize[_0x5f2e('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x5f2e('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x5f2e('0x7')](_0x5f2e('0x8'),_0x5f2e('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x5f2e('0xa')](0xb)[_0x5f2e('0xb')]},'reportType':{'type':Sequelize[_0x5f2e('0x2')]}}; \ No newline at end of file +var _0xd183=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED'];(function(_0x129046,_0x519448){var _0x4d06d9=function(_0x425c26){while(--_0x425c26){_0x129046['push'](_0x129046['shift']());}};_0x4d06d9(++_0x519448);}(_0xd183,0xb0));var _0x3d18=function(_0x5e2b95,_0x45e3a2){_0x5e2b95=_0x5e2b95-0x0;var _0x23aebd=_0xd183[_0x5e2b95];return _0x23aebd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3d18('0x0'));module[_0x3d18('0x1')]={'name':{'type':Sequelize[_0x3d18('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3d18('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3d18('0x3')](_0x3d18('0x4'),_0x3d18('0x5'),_0x3d18('0x6')),'allowNull':![],'defaultValue':_0x3d18('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x3d18('0x7')]},'endDate':{'type':Sequelize[_0x3d18('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3d18('0x3')](_0x3d18('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x3d18('0x9')](0xb)[_0x3d18('0xa')]},'reportType':{'type':Sequelize[_0x3d18('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 5526a61..2fdcdd1 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 _0x2892=['findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','autoAssociation','body','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','includeAll'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2892,0x1f2));var _0x2289=function(_0x3ad0ed,_0x575f2f){_0x3ad0ed=_0x3ad0ed-0x0;var _0x17cb39=_0x2892[_0x3ad0ed];return _0x17cb39;};'use strict';var emlformat=require(_0x2289('0x0'));var rimraf=require(_0x2289('0x1'));var zipdir=require(_0x2289('0x2'));var jsonpatch=require(_0x2289('0x3'));var rp=require(_0x2289('0x4'));var moment=require('moment');var BPromise=require(_0x2289('0x5'));var Mustache=require(_0x2289('0x6'));var util=require(_0x2289('0x7'));var path=require(_0x2289('0x8'));var sox=require(_0x2289('0x9'));var csv=require(_0x2289('0xa'));var ejs=require(_0x2289('0xb'));var fs=require('fs');var fs_extra=require(_0x2289('0xc'));var _=require(_0x2289('0xd'));var squel=require(_0x2289('0xe'));var crypto=require(_0x2289('0xf'));var jsforce=require(_0x2289('0x10'));var deskjs=require(_0x2289('0x11'));var toCsv=require(_0x2289('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2289('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2289('0x13'));var as=require(_0x2289('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2289('0x15'))(_0x2289('0x16'));var utils=require(_0x2289('0x17'));var config=require(_0x2289('0x18'));var licenseUtil=require(_0x2289('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37fcce,_0x406d03){_0x406d03=_0x406d03||0xcc;return function(_0x2156e9){if(_0x2156e9){return _0x37fcce[_0x2289('0x1a')](_0x406d03);}return _0x37fcce[_0x2289('0x1b')](_0x406d03)[_0x2289('0x1c')]();};}function respondWithResult(_0x441528,_0x1e0dd0){_0x1e0dd0=_0x1e0dd0||0xc8;return function(_0x2575af){if(_0x2575af){return _0x441528[_0x2289('0x1b')](_0x1e0dd0)['json'](_0x2575af);}};}function respondWithFilteredResult(_0x4b822e,_0x4e12dc){return function(_0x501bc2){if(_0x501bc2){var _0x1dd7df=typeof _0x4e12dc['offset']===_0x2289('0x1d')&&typeof _0x4e12dc[_0x2289('0x1e')]===_0x2289('0x1d');var _0x105fb5=_0x501bc2[_0x2289('0x1f')];var _0x20626a=_0x1dd7df?0x0:_0x4e12dc[_0x2289('0x20')];var _0x26b66d=_0x1dd7df?_0x501bc2[_0x2289('0x1f')]:_0x4e12dc[_0x2289('0x20')]+_0x4e12dc[_0x2289('0x1e')];var _0x4c5fa5;if(_0x26b66d>=_0x105fb5){_0x26b66d=_0x105fb5;_0x4c5fa5=0xc8;}else{_0x4c5fa5=0xce;}_0x4b822e[_0x2289('0x1b')](_0x4c5fa5);return _0x4b822e[_0x2289('0x21')](_0x2289('0x22'),_0x20626a+'-'+_0x26b66d+'/'+_0x105fb5)['json'](_0x501bc2);}return null;};}function patchUpdates(_0x484969){return function(_0x1446af){try{jsonpatch['apply'](_0x1446af,_0x484969,!![]);}catch(_0x575704){return BPromise[_0x2289('0x23')](_0x575704);}return _0x1446af['save']();};}function saveUpdates(_0x344d6b,_0x4fd457){return function(_0x36317e){if(_0x36317e){return _0x36317e['update'](_0x344d6b)[_0x2289('0x24')](function(_0x39b51a){return _0x39b51a;});}return null;};}function removeEntity(_0x1c5fba,_0x9b5b48){return function(_0xe9fb56){if(_0xe9fb56){return _0xe9fb56[_0x2289('0x25')]()[_0x2289('0x24')](function(){var _0x3f75e7=_0xe9fb56[_0x2289('0x26')]({'plain':!![]});var _0x4d6976='ExtractedReports';return db[_0x2289('0x27')][_0x2289('0x25')]({'where':{'type':_0x4d6976,'resourceId':_0x3f75e7['id']}})[_0x2289('0x24')](function(){return _0xe9fb56;});})[_0x2289('0x24')](function(){_0x1c5fba[_0x2289('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f0997,_0x191c68){return function(_0x7ba854){if(!_0x7ba854){_0x1f0997[_0x2289('0x1a')](0x194);}return _0x7ba854;};}function handleError(_0x369333,_0x516457){_0x516457=_0x516457||0x1f4;return function(_0x129448){logger[_0x2289('0x28')](_0x129448[_0x2289('0x29')]);if(_0x129448[_0x2289('0x2a')]){delete _0x129448[_0x2289('0x2a')];}_0x369333[_0x2289('0x1b')](_0x516457)[_0x2289('0x2b')](_0x129448);};}exports[_0x2289('0x2c')]=function(_0x1cbfc7,_0x208fe3){var _0x5bf0d3={},_0x330af5={},_0x135e41={'count':0x0,'rows':[]};var _0x315e44=_[_0x2289('0x2d')](db[_0x2289('0x2e')]['rawAttributes'],function(_0x266d98){return{'name':_0x266d98[_0x2289('0x2f')],'type':_0x266d98['type']['key']};});_0x330af5['model']=_[_0x2289('0x2d')](_0x315e44,_0x2289('0x2a'));_0x330af5[_0x2289('0x30')]=_[_0x2289('0x31')](_0x1cbfc7['query']);_0x330af5[_0x2289('0x32')]=_[_0x2289('0x33')](_0x330af5['model'],_0x330af5[_0x2289('0x30')]);_0x5bf0d3[_0x2289('0x34')]=_[_0x2289('0x33')](_0x330af5[_0x2289('0x35')],qs[_0x2289('0x36')](_0x1cbfc7['query'][_0x2289('0x36')]));_0x5bf0d3['attributes']=_0x5bf0d3[_0x2289('0x34')][_0x2289('0x37')]?_0x5bf0d3['attributes']:_0x330af5[_0x2289('0x35')];if(!_0x1cbfc7[_0x2289('0x30')][_0x2289('0x38')](_0x2289('0x39'))){_0x5bf0d3[_0x2289('0x1e')]=qs['limit'](_0x1cbfc7[_0x2289('0x30')][_0x2289('0x1e')]);_0x5bf0d3[_0x2289('0x20')]=qs[_0x2289('0x20')](_0x1cbfc7[_0x2289('0x30')][_0x2289('0x20')]);}_0x5bf0d3['order']=qs[_0x2289('0x3a')](_0x1cbfc7[_0x2289('0x30')][_0x2289('0x3a')]);_0x5bf0d3['where']=qs[_0x2289('0x32')](_[_0x2289('0x3b')](_0x1cbfc7[_0x2289('0x30')],_0x330af5[_0x2289('0x32')]),_0x315e44);if(_0x1cbfc7[_0x2289('0x30')][_0x2289('0x3c')]){_0x5bf0d3[_0x2289('0x3d')]=_[_0x2289('0x3e')](_0x5bf0d3['where'],{'$or':_['map'](_0x315e44,function(_0x2b057d){if(_0x2b057d[_0x2289('0x3f')]!=='VIRTUAL'){var _0x36c835={};_0x36c835[_0x2b057d['name']]={'$like':'%'+_0x1cbfc7[_0x2289('0x30')][_0x2289('0x3c')]+'%'};return _0x36c835;}})});}_0x5bf0d3=_[_0x2289('0x3e')]({},_0x5bf0d3,_0x1cbfc7[_0x2289('0x40')]);var _0x3e1674={'where':_0x5bf0d3['where']};return db['AnalyticExtractedReport'][_0x2289('0x1f')](_0x3e1674)[_0x2289('0x24')](function(_0xad5599){_0x135e41[_0x2289('0x1f')]=_0xad5599;if(_0x1cbfc7[_0x2289('0x30')][_0x2289('0x41')]){_0x5bf0d3['include']=[{'all':!![]}];}return db[_0x2289('0x2e')][_0x2289('0x42')](_0x5bf0d3);})[_0x2289('0x24')](function(_0x10d1b0){_0x135e41[_0x2289('0x43')]=_0x10d1b0;return _0x135e41;})[_0x2289('0x24')](respondWithFilteredResult(_0x208fe3,_0x5bf0d3))[_0x2289('0x44')](handleError(_0x208fe3,null));};exports[_0x2289('0x45')]=function(_0x103470,_0x528bda){var _0x532fe4={'raw':!![],'where':{'id':_0x103470[_0x2289('0x46')]['id']}},_0x2cf73b={};_0x2cf73b[_0x2289('0x35')]=_[_0x2289('0x31')](db['AnalyticExtractedReport']['rawAttributes']);_0x2cf73b[_0x2289('0x30')]=_[_0x2289('0x31')](_0x103470[_0x2289('0x30')]);_0x2cf73b[_0x2289('0x32')]=_['intersection'](_0x2cf73b[_0x2289('0x35')],_0x2cf73b[_0x2289('0x30')]);_0x532fe4[_0x2289('0x34')]=_['intersection'](_0x2cf73b[_0x2289('0x35')],qs['fields'](_0x103470[_0x2289('0x30')][_0x2289('0x36')]));_0x532fe4[_0x2289('0x34')]=_0x532fe4['attributes'][_0x2289('0x37')]?_0x532fe4[_0x2289('0x34')]:_0x2cf73b['model'];if(_0x103470[_0x2289('0x30')][_0x2289('0x41')]){_0x532fe4[_0x2289('0x47')]=[{'all':!![]}];}_0x532fe4=_['merge']({},_0x532fe4,_0x103470['options']);return db['AnalyticExtractedReport'][_0x2289('0x48')](_0x532fe4)[_0x2289('0x24')](handleEntityNotFound(_0x528bda,null))[_0x2289('0x24')](respondWithResult(_0x528bda,null))['catch'](handleError(_0x528bda,null));};exports['create']=function(_0x1eed97,_0x3dbdaf){return db['AnalyticExtractedReport'][_0x2289('0x49')](_0x1eed97['body'],{})[_0x2289('0x24')](function(_0x125834){var _0x509615=_0x1eed97[_0x2289('0x4a')][_0x2289('0x26')]({'plain':!![]});if(!_0x509615)throw new Error(_0x2289('0x4b'));if(_0x509615[_0x2289('0x4c')]===_0x2289('0x4a')){var _0x53463d=_0x125834[_0x2289('0x26')]({'plain':!![]});var _0x781d7d=_0x2289('0x4d');return db['UserProfileSection'][_0x2289('0x48')]({'where':{'name':_0x781d7d,'userProfileId':_0x509615['userProfileId']},'raw':!![]})[_0x2289('0x24')](function(_0x2eb47d){if(_0x2eb47d&&_0x2eb47d[_0x2289('0x4e')]===0x0){return db[_0x2289('0x27')][_0x2289('0x49')]({'name':_0x53463d[_0x2289('0x2a')],'resourceId':_0x53463d['id'],'type':_0x2eb47d[_0x2289('0x2a')],'sectionId':_0x2eb47d['id']},{})[_0x2289('0x24')](function(){return _0x125834;});}else{return _0x125834;}})['catch'](function(_0x17f443){logger[_0x2289('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17f443);throw _0x17f443;});}return _0x125834;})['then'](respondWithResult(_0x3dbdaf,0xc9))[_0x2289('0x44')](handleError(_0x3dbdaf,null));};exports['update']=function(_0x3a9b01,_0x5a644d){if(_0x3a9b01['body']['id']){delete _0x3a9b01[_0x2289('0x4f')]['id'];}return db[_0x2289('0x2e')][_0x2289('0x48')]({'where':{'id':_0x3a9b01['params']['id']}})['then'](handleEntityNotFound(_0x5a644d,null))[_0x2289('0x24')](saveUpdates(_0x3a9b01['body'],null))[_0x2289('0x24')](respondWithResult(_0x5a644d,null))[_0x2289('0x44')](handleError(_0x5a644d,null));};exports[_0x2289('0x25')]=function(_0xb14d96,_0x1ece49){return db[_0x2289('0x2e')][_0x2289('0x48')]({'where':{'id':_0xb14d96[_0x2289('0x46')]['id']}})[_0x2289('0x24')](handleEntityNotFound(_0x1ece49,null))['then'](removeEntity(_0x1ece49,null))[_0x2289('0x44')](handleError(_0x1ece49,null));};exports[_0x2289('0x50')]=function(_0x4f97c1,_0x565922,_0x364f3a){return db[_0x2289('0x2e')][_0x2289('0x48')]({'where':{'id':_0x4f97c1['params']['id']},'attributes':[_0x2289('0x2a'),_0x2289('0x51'),_0x2289('0x52'),_0x2289('0x53')],'raw':!![]})[_0x2289('0x24')](handleEntityNotFound(_0x565922,null))[_0x2289('0x24')](function(_0x2d90b9){if(_0x2d90b9){if(!fs[_0x2289('0x54')](path[_0x2289('0x55')](config[_0x2289('0x56')],_0x2289('0x57'),_0x2d90b9['savename']))){throw new db[(_0x2289('0x58'))][(_0x2289('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4f97c1['query'][_0x2289('0x5a')]){return _0x565922[_0x2289('0x1a')](0xc8);}return _0x565922[_0x2289('0x50')](path[_0x2289('0x55')](config[_0x2289('0x56')],_0x2289('0x57'),_0x2d90b9[_0x2289('0x52')]),util[_0x2289('0x5b')](_0x2289('0x5c'),_0x2d90b9['basename']||_0x2d90b9[_0x2289('0x2a')],_0x2d90b9[_0x2289('0x53')][_0x2289('0x5d')]()));}})[_0x2289('0x44')](handleError(_0x565922,null));}; \ No newline at end of file +var _0x0399=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','error','name','send','map','AnalyticExtractedReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x39cbb3,_0x5e1877){var _0xb6aea2=function(_0x4e6f49){while(--_0x4e6f49){_0x39cbb3['push'](_0x39cbb3['shift']());}};_0xb6aea2(++_0x5e1877);}(_0x0399,0x1de));var _0x9039=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0399[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x9039('0x0'));var rimraf=require(_0x9039('0x1'));var zipdir=require(_0x9039('0x2'));var jsonpatch=require(_0x9039('0x3'));var rp=require(_0x9039('0x4'));var moment=require(_0x9039('0x5'));var BPromise=require(_0x9039('0x6'));var Mustache=require(_0x9039('0x7'));var util=require(_0x9039('0x8'));var path=require(_0x9039('0x9'));var sox=require(_0x9039('0xa'));var csv=require(_0x9039('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9039('0xc'));var _=require(_0x9039('0xd'));var squel=require(_0x9039('0xe'));var crypto=require('crypto');var jsforce=require(_0x9039('0xf'));var deskjs=require(_0x9039('0x10'));var toCsv=require(_0x9039('0xb'));var querystring=require(_0x9039('0x11'));var Papa=require(_0x9039('0x12'));var Redis=require(_0x9039('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9039('0x14'));var as=require(_0x9039('0x15'));var hardwareService=require(_0x9039('0x16'));var logger=require(_0x9039('0x17'))(_0x9039('0x18'));var utils=require(_0x9039('0x19'));var config=require(_0x9039('0x1a'));var licenseUtil=require(_0x9039('0x1b'));var db=require(_0x9039('0x1c'))['db'];function respondWithStatusCode(_0x4a674b,_0x56e270){_0x56e270=_0x56e270||0xcc;return function(_0x1b2195){if(_0x1b2195){return _0x4a674b['sendStatus'](_0x56e270);}return _0x4a674b[_0x9039('0x1d')](_0x56e270)['end']();};}function respondWithResult(_0x2486c9,_0x4fdcab){_0x4fdcab=_0x4fdcab||0xc8;return function(_0x15f9b4){if(_0x15f9b4){return _0x2486c9['status'](_0x4fdcab)[_0x9039('0x1e')](_0x15f9b4);}};}function respondWithFilteredResult(_0x1be16c,_0x375575){return function(_0xef61a9){if(_0xef61a9){var _0x46ae7e=typeof _0x375575[_0x9039('0x1f')]===_0x9039('0x20')&&typeof _0x375575[_0x9039('0x21')]===_0x9039('0x20');var _0x5df6bd=_0xef61a9[_0x9039('0x22')];var _0x1ea359=_0x46ae7e?0x0:_0x375575[_0x9039('0x1f')];var _0x1b6fb5=_0x46ae7e?_0xef61a9['count']:_0x375575[_0x9039('0x1f')]+_0x375575['limit'];var _0x38e6df;if(_0x1b6fb5>=_0x5df6bd){_0x1b6fb5=_0x5df6bd;_0x38e6df=0xc8;}else{_0x38e6df=0xce;}_0x1be16c['status'](_0x38e6df);return _0x1be16c[_0x9039('0x23')](_0x9039('0x24'),_0x1ea359+'-'+_0x1b6fb5+'/'+_0x5df6bd)[_0x9039('0x1e')](_0xef61a9);}return null;};}function patchUpdates(_0x9dc205){return function(_0x18aaf5){try{jsonpatch[_0x9039('0x25')](_0x18aaf5,_0x9dc205,!![]);}catch(_0x1aea83){return BPromise[_0x9039('0x26')](_0x1aea83);}return _0x18aaf5[_0x9039('0x27')]();};}function saveUpdates(_0x55919a,_0xe85dae){return function(_0x37e2bf){if(_0x37e2bf){return _0x37e2bf[_0x9039('0x28')](_0x55919a)[_0x9039('0x29')](function(_0x3ae0b4){return _0x3ae0b4;});}return null;};}function removeEntity(_0x50e093,_0x37614f){return function(_0x465b64){if(_0x465b64){return _0x465b64['destroy']()[_0x9039('0x29')](function(){var _0x337399=_0x465b64[_0x9039('0x2a')]({'plain':!![]});var _0x38c8ec=_0x9039('0x2b');return db[_0x9039('0x2c')][_0x9039('0x2d')]({'where':{'type':_0x38c8ec,'resourceId':_0x337399['id']}})[_0x9039('0x29')](function(){return _0x465b64;});})['then'](function(){_0x50e093[_0x9039('0x1d')](0xcc)[_0x9039('0x2e')]();});}};}function handleEntityNotFound(_0x3ec235,_0x35ae1c){return function(_0x4cdd30){if(!_0x4cdd30){_0x3ec235['sendStatus'](0x194);}return _0x4cdd30;};}function handleError(_0x310682,_0x4d1a46){_0x4d1a46=_0x4d1a46||0x1f4;return function(_0x6f6139){logger[_0x9039('0x2f')](_0x6f6139['stack']);if(_0x6f6139[_0x9039('0x30')]){delete _0x6f6139['name'];}_0x310682['status'](_0x4d1a46)[_0x9039('0x31')](_0x6f6139);};}exports['index']=function(_0x120618,_0x57ceed){var _0x2c58a4={},_0xa9e7ee={},_0x987607={'count':0x0,'rows':[]};var _0x938dbd=_[_0x9039('0x32')](db[_0x9039('0x33')][_0x9039('0x34')],function(_0x56f572){return{'name':_0x56f572['fieldName'],'type':_0x56f572[_0x9039('0x35')]['key']};});_0xa9e7ee[_0x9039('0x36')]=_[_0x9039('0x32')](_0x938dbd,'name');_0xa9e7ee[_0x9039('0x37')]=_[_0x9039('0x38')](_0x120618[_0x9039('0x37')]);_0xa9e7ee[_0x9039('0x39')]=_[_0x9039('0x3a')](_0xa9e7ee['model'],_0xa9e7ee[_0x9039('0x37')]);_0x2c58a4['attributes']=_[_0x9039('0x3a')](_0xa9e7ee[_0x9039('0x36')],qs[_0x9039('0x3b')](_0x120618[_0x9039('0x37')]['fields']));_0x2c58a4[_0x9039('0x3c')]=_0x2c58a4[_0x9039('0x3c')][_0x9039('0x3d')]?_0x2c58a4[_0x9039('0x3c')]:_0xa9e7ee[_0x9039('0x36')];if(!_0x120618['query'][_0x9039('0x3e')]('nolimit')){_0x2c58a4[_0x9039('0x21')]=qs['limit'](_0x120618[_0x9039('0x37')]['limit']);_0x2c58a4['offset']=qs[_0x9039('0x1f')](_0x120618[_0x9039('0x37')][_0x9039('0x1f')]);}_0x2c58a4['order']=qs[_0x9039('0x3f')](_0x120618[_0x9039('0x37')][_0x9039('0x3f')]);_0x2c58a4[_0x9039('0x40')]=qs[_0x9039('0x39')](_[_0x9039('0x41')](_0x120618[_0x9039('0x37')],_0xa9e7ee[_0x9039('0x39')]),_0x938dbd);if(_0x120618['query'][_0x9039('0x42')]){_0x2c58a4[_0x9039('0x40')]=_['merge'](_0x2c58a4[_0x9039('0x40')],{'$or':_['map'](_0x938dbd,function(_0x4fada9){if(_0x4fada9[_0x9039('0x35')]!==_0x9039('0x43')){var _0x44b187={};_0x44b187[_0x4fada9[_0x9039('0x30')]]={'$like':'%'+_0x120618[_0x9039('0x37')][_0x9039('0x42')]+'%'};return _0x44b187;}})});}_0x2c58a4=_[_0x9039('0x44')]({},_0x2c58a4,_0x120618[_0x9039('0x45')]);var _0x4cea03={'where':_0x2c58a4[_0x9039('0x40')]};return db[_0x9039('0x33')][_0x9039('0x22')](_0x4cea03)[_0x9039('0x29')](function(_0x41776c){_0x987607[_0x9039('0x22')]=_0x41776c;if(_0x120618[_0x9039('0x37')]['includeAll']){_0x2c58a4['include']=[{'all':!![]}];}return db[_0x9039('0x33')][_0x9039('0x46')](_0x2c58a4);})[_0x9039('0x29')](function(_0x5880a8){_0x987607[_0x9039('0x47')]=_0x5880a8;return _0x987607;})['then'](respondWithFilteredResult(_0x57ceed,_0x2c58a4))[_0x9039('0x48')](handleError(_0x57ceed,null));};exports['show']=function(_0x24ea2e,_0x21ad96){var _0x2eabdc={'raw':!![],'where':{'id':_0x24ea2e[_0x9039('0x49')]['id']}},_0x3da029={};_0x3da029[_0x9039('0x36')]=_[_0x9039('0x38')](db[_0x9039('0x33')][_0x9039('0x34')]);_0x3da029[_0x9039('0x37')]=_[_0x9039('0x38')](_0x24ea2e[_0x9039('0x37')]);_0x3da029[_0x9039('0x39')]=_['intersection'](_0x3da029[_0x9039('0x36')],_0x3da029[_0x9039('0x37')]);_0x2eabdc[_0x9039('0x3c')]=_[_0x9039('0x3a')](_0x3da029[_0x9039('0x36')],qs['fields'](_0x24ea2e['query'][_0x9039('0x3b')]));_0x2eabdc[_0x9039('0x3c')]=_0x2eabdc[_0x9039('0x3c')][_0x9039('0x3d')]?_0x2eabdc[_0x9039('0x3c')]:_0x3da029[_0x9039('0x36')];if(_0x24ea2e['query'][_0x9039('0x4a')]){_0x2eabdc[_0x9039('0x4b')]=[{'all':!![]}];}_0x2eabdc=_[_0x9039('0x44')]({},_0x2eabdc,_0x24ea2e[_0x9039('0x45')]);return db[_0x9039('0x33')][_0x9039('0x4c')](_0x2eabdc)[_0x9039('0x29')](handleEntityNotFound(_0x21ad96,null))[_0x9039('0x29')](respondWithResult(_0x21ad96,null))[_0x9039('0x48')](handleError(_0x21ad96,null));};exports[_0x9039('0x4d')]=function(_0x370555,_0x904df8){return db[_0x9039('0x33')]['create'](_0x370555[_0x9039('0x4e')],{})['then'](function(_0x4591e5){var _0x3c10a4=_0x370555['user'][_0x9039('0x2a')]({'plain':!![]});if(!_0x3c10a4)throw new Error(_0x9039('0x4f'));if(_0x3c10a4[_0x9039('0x50')]===_0x9039('0x51')){var _0x1484d1=_0x4591e5[_0x9039('0x2a')]({'plain':!![]});var _0x7712aa=_0x9039('0x2b');return db[_0x9039('0x52')][_0x9039('0x4c')]({'where':{'name':_0x7712aa,'userProfileId':_0x3c10a4['userProfileId']},'raw':!![]})['then'](function(_0xbf7a75){if(_0xbf7a75&&_0xbf7a75['autoAssociation']===0x0){return db[_0x9039('0x2c')][_0x9039('0x4d')]({'name':_0x1484d1[_0x9039('0x30')],'resourceId':_0x1484d1['id'],'type':_0xbf7a75['name'],'sectionId':_0xbf7a75['id']},{})['then'](function(){return _0x4591e5;});}else{return _0x4591e5;}})[_0x9039('0x48')](function(_0x3dedb4){logger[_0x9039('0x2f')](_0x9039('0x53'),_0x3dedb4);throw _0x3dedb4;});}return _0x4591e5;})['then'](respondWithResult(_0x904df8,0xc9))[_0x9039('0x48')](handleError(_0x904df8,null));};exports['update']=function(_0x2d2aa2,_0x3f9e46){if(_0x2d2aa2[_0x9039('0x4e')]['id']){delete _0x2d2aa2['body']['id'];}return db[_0x9039('0x33')][_0x9039('0x4c')]({'where':{'id':_0x2d2aa2[_0x9039('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f9e46,null))[_0x9039('0x29')](saveUpdates(_0x2d2aa2['body'],null))[_0x9039('0x29')](respondWithResult(_0x3f9e46,null))[_0x9039('0x48')](handleError(_0x3f9e46,null));};exports['destroy']=function(_0x3df798,_0x183ea9){return db[_0x9039('0x33')][_0x9039('0x4c')]({'where':{'id':_0x3df798[_0x9039('0x49')]['id']}})[_0x9039('0x29')](handleEntityNotFound(_0x183ea9,null))[_0x9039('0x29')](removeEntity(_0x183ea9,null))[_0x9039('0x48')](handleError(_0x183ea9,null));};exports[_0x9039('0x54')]=function(_0x488511,_0x1014c4,_0x22b98c){return db[_0x9039('0x33')][_0x9039('0x4c')]({'where':{'id':_0x488511['params']['id']},'attributes':['name',_0x9039('0x55'),_0x9039('0x56'),_0x9039('0x57')],'raw':!![]})[_0x9039('0x29')](handleEntityNotFound(_0x1014c4,null))['then'](function(_0x256106){if(_0x256106){if(!fs[_0x9039('0x58')](path[_0x9039('0x59')](config['root'],_0x9039('0x5a'),_0x256106[_0x9039('0x56')]))){throw new db[(_0x9039('0x5b'))][(_0x9039('0x5c'))](_0x9039('0x5d'));}if(_0x488511[_0x9039('0x37')][_0x9039('0x5e')]){return _0x1014c4[_0x9039('0x5f')](0xc8);}return _0x1014c4['download'](path[_0x9039('0x59')](config['root'],_0x9039('0x5a'),_0x256106[_0x9039('0x56')]),util[_0x9039('0x60')](_0x9039('0x61'),_0x256106[_0x9039('0x55')]||_0x256106[_0x9039('0x30')],_0x256106['output']['toLowerCase']()));}})[_0x9039('0x48')](handleError(_0x1014c4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 681b5fe..0d8b5cb 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 _0x75d7=['request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x75d7,0x14c));var _0x775d=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0x75d7[_0x4b5813];return _0x423465;};'use strict';var _=require(_0x775d('0x0'));var util=require(_0x775d('0x1'));var logger=require('../../config/logger')(_0x775d('0x2'));var moment=require(_0x775d('0x3'));var BPromise=require('bluebird');var rp=require(_0x775d('0x4'));var fs=require('fs');var path=require(_0x775d('0x5'));var rimraf=require('rimraf');var config=require(_0x775d('0x6'));var attributes=require(_0x775d('0x7'));module[_0x775d('0x8')]=function(_0x4bac2c,_0x460ab3){return _0x4bac2c[_0x775d('0x9')](_0x775d('0xa'),attributes,{'tableName':_0x775d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86ca=['analytics_extracted_reports','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x86ca,0x119));var _0xa86c=function(_0x349b26,_0x5b560b){_0x349b26=_0x349b26-0x0;var _0x2c1235=_0x86ca[_0x349b26];return _0x2c1235;};'use strict';var _=require(_0xa86c('0x0'));var util=require('util');var logger=require(_0xa86c('0x1'))(_0xa86c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa86c('0x3'));var fs=require('fs');var path=require(_0xa86c('0x4'));var rimraf=require(_0xa86c('0x5'));var config=require(_0xa86c('0x6'));var attributes=require(_0xa86c('0x7'));module[_0xa86c('0x8')]=function(_0x448dfb,_0x30a5d6){return _0x448dfb['define']('AnalyticExtractedReport',attributes,{'tableName':_0xa86c('0x9'),'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 616cae3..27db164 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 _0xaac0=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x322296,_0x57eb19){var _0x432ea7=function(_0x4bd2b3){while(--_0x4bd2b3){_0x322296['push'](_0x322296['shift']());}};_0x432ea7(++_0x57eb19);}(_0xaac0,0x10c));var _0x0aac=function(_0x3fa1e1,_0x4e39f0){_0x3fa1e1=_0x3fa1e1-0x0;var _0x1cc2ad=_0xaac0[_0x3fa1e1];return _0x1cc2ad;};'use strict';var _=require(_0x0aac('0x0'));var util=require(_0x0aac('0x1'));var moment=require('moment');var BPromise=require(_0x0aac('0x2'));var rs=require(_0x0aac('0x3'));var fs=require('fs');var Redis=require(_0x0aac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0aac('0x5'));var logger=require('../../config/logger')(_0x0aac('0x6'));var config=require(_0x0aac('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0aac('0x8')][_0x0aac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21bc06,_0x1147e7,_0x1f2ebf){return new BPromise(function(_0x1f4a36,_0x12c247){return client['request'](_0x21bc06,_0x1f2ebf)['then'](function(_0x5bb044){logger[_0x0aac('0xa')](_0x0aac('0xb'),_0x1147e7,_0x0aac('0xc'));logger['debug'](_0x0aac('0xd'),_0x1147e7,_0x0aac('0xc'),JSON[_0x0aac('0xe')](_0x5bb044));if(_0x5bb044['error']){if(_0x5bb044['error']['code']===0x1f4){logger[_0x0aac('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1147e7,_0x5bb044['error'][_0x0aac('0x10')]);return _0x12c247(_0x5bb044[_0x0aac('0xf')]['message']);}logger[_0x0aac('0xf')](_0x0aac('0xb'),_0x1147e7,_0x5bb044[_0x0aac('0xf')][_0x0aac('0x10')]);return _0x1f4a36(_0x5bb044[_0x0aac('0xf')][_0x0aac('0x10')]);}else{logger[_0x0aac('0xa')](_0x0aac('0xb'),_0x1147e7,_0x0aac('0xc'));_0x1f4a36(_0x5bb044[_0x0aac('0x11')][_0x0aac('0x10')]);}})[_0x0aac('0x12')](function(_0x2807a8){logger[_0x0aac('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1147e7,_0x2807a8);_0x12c247(_0x2807a8);});});} \ No newline at end of file +var _0x7948=['jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e2135,_0x55d94e){var _0x39ac3d=function(_0xb3c8f6){while(--_0xb3c8f6){_0x5e2135['push'](_0x5e2135['shift']());}};_0x39ac3d(++_0x55d94e);}(_0x7948,0x185));var _0x8794=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x7948[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x8794('0x0'));var util=require(_0x8794('0x1'));var moment=require(_0x8794('0x2'));var BPromise=require(_0x8794('0x3'));var rs=require(_0x8794('0x4'));var fs=require('fs');var Redis=require(_0x8794('0x5'));var db=require(_0x8794('0x6'))['db'];var utils=require(_0x8794('0x7'));var logger=require(_0x8794('0x8'))(_0x8794('0x9'));var config=require(_0x8794('0xa'));var jayson=require(_0x8794('0xb'));var client=jayson[_0x8794('0xc')][_0x8794('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28d12e,_0x2276f2,_0x22b452){return new BPromise(function(_0x27f31e,_0x6d7e86){return client[_0x8794('0xe')](_0x28d12e,_0x22b452)[_0x8794('0xf')](function(_0x2305d8){logger[_0x8794('0x10')](_0x8794('0x11'),_0x2276f2,_0x8794('0x12'));logger[_0x8794('0x13')](_0x8794('0x14'),_0x2276f2,_0x8794('0x12'),JSON[_0x8794('0x15')](_0x2305d8));if(_0x2305d8[_0x8794('0x16')]){if(_0x2305d8[_0x8794('0x16')]['code']===0x1f4){logger[_0x8794('0x16')](_0x8794('0x11'),_0x2276f2,_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);return _0x6d7e86(_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);}logger[_0x8794('0x16')](_0x8794('0x11'),_0x2276f2,_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);return _0x27f31e(_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);}else{logger[_0x8794('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2276f2,_0x8794('0x12'));_0x27f31e(_0x2305d8['result']['message']);}})[_0x8794('0x18')](function(_0x8b862a){logger[_0x8794('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2276f2,_0x8b862a);_0x6d7e86(_0x8b862a);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 984eb8f..2a28f6d 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 _0x66ef=['/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id'];(function(_0x29c4ed,_0x2d0586){var _0x4fcf0c=function(_0x24917c){while(--_0x24917c){_0x29c4ed['push'](_0x29c4ed['shift']());}};_0x4fcf0c(++_0x2d0586);}(_0x66ef,0x8d));var _0xf66e=function(_0x1d0e05,_0x5b3fb4){_0x1d0e05=_0x1d0e05-0x0;var _0x510b02=_0x66ef[_0x1d0e05];return _0x510b02;};'use strict';var multer=require(_0xf66e('0x0'));var util=require(_0xf66e('0x1'));var path=require(_0xf66e('0x2'));var timeout=require(_0xf66e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf66e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf66e('0x5'));var config=require(_0xf66e('0x6'));var controller=require(_0xf66e('0x7'));router[_0xf66e('0x8')]('/',auth[_0xf66e('0x9')](),controller['index']);router[_0xf66e('0x8')](_0xf66e('0xa'),auth[_0xf66e('0x9')](),controller['show']);router[_0xf66e('0x8')](_0xf66e('0xb'),auth[_0xf66e('0x9')](),controller[_0xf66e('0xc')]);router['post']('/',auth[_0xf66e('0x9')](),controller[_0xf66e('0xd')]);router[_0xf66e('0xe')](_0xf66e('0xa'),auth[_0xf66e('0x9')](),controller[_0xf66e('0xf')]);router[_0xf66e('0x10')]('/:id',auth[_0xf66e('0x9')](),controller[_0xf66e('0x11')]);module[_0xf66e('0x12')]=router; \ No newline at end of file +var _0x97ef=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','download','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2ea262,_0x58ada0){var _0x4f51ad=function(_0xd0ba71){while(--_0xd0ba71){_0x2ea262['push'](_0x2ea262['shift']());}};_0x4f51ad(++_0x58ada0);}(_0x97ef,0x71));var _0xf97e=function(_0xc7ef13,_0x5366b9){_0xc7ef13=_0xc7ef13-0x0;var _0x368264=_0x97ef[_0xc7ef13];return _0x368264;};'use strict';var multer=require(_0xf97e('0x0'));var util=require(_0xf97e('0x1'));var path=require(_0xf97e('0x2'));var timeout=require(_0xf97e('0x3'));var express=require(_0xf97e('0x4'));var router=express[_0xf97e('0x5')]();var fs_extra=require(_0xf97e('0x6'));var auth=require(_0xf97e('0x7'));var interaction=require(_0xf97e('0x8'));var config=require(_0xf97e('0x9'));var controller=require(_0xf97e('0xa'));router[_0xf97e('0xb')]('/',auth['isAuthenticated'](),controller[_0xf97e('0xc')]);router[_0xf97e('0xb')](_0xf97e('0xd'),auth[_0xf97e('0xe')](),controller[_0xf97e('0xf')]);router[_0xf97e('0xb')]('/:id/download',auth[_0xf97e('0xe')](),controller[_0xf97e('0x10')]);router['post']('/',auth[_0xf97e('0xe')](),controller[_0xf97e('0x11')]);router[_0xf97e('0x12')](_0xf97e('0xd'),auth[_0xf97e('0xe')](),controller[_0xf97e('0x13')]);router[_0xf97e('0x14')](_0xf97e('0xd'),auth[_0xf97e('0xe')](),controller[_0xf97e('0x15')]);module[_0xf97e('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index c780610..28effe5 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 _0x7dcc=['exports','TEXT','BOOLEAN','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7dcc,0x1b7));var _0xc7dc=function(_0x17f397,_0x5bf1eb){_0x17f397=_0x17f397-0x0;var _0x65aa26=_0x7dcc[_0x17f397];return _0x65aa26;};'use strict';var Sequelize=require(_0xc7dc('0x0'));module[_0xc7dc('0x1')]={'field':{'type':Sequelize[_0xc7dc('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xc7dc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc7dc('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xd94e=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x50d46c,_0x17ea61){var _0x18d2eb=function(_0x2599b3){while(--_0x2599b3){_0x50d46c['push'](_0x50d46c['shift']());}};_0x18d2eb(++_0x17ea61);}(_0xd94e,0xc3));var _0xed94=function(_0x4c6058,_0x4b5868){_0x4c6058=_0x4c6058-0x0;var _0x8d1b4c=_0xd94e[_0x4c6058];return _0x8d1b4c;};'use strict';var Sequelize=require(_0xed94('0x0'));module[_0xed94('0x1')]={'field':{'type':Sequelize[_0xed94('0x2')]},'alias':{'type':Sequelize[_0xed94('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xed94('0x3')]},'groupBy':{'type':Sequelize[_0xed94('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xed94('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index a666b09..f97b2a1 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 _0x3804=['../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','map','AnalyticFieldReport','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','bulkCreate','params','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x278360,_0x437741){var _0x29d8a9=function(_0x4a3cd6){while(--_0x4a3cd6){_0x278360['push'](_0x278360['shift']());}};_0x29d8a9(++_0x437741);}(_0x3804,0x90));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4380('0x0'));var rimraf=require(_0x4380('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4380('0x2'));var rp=require(_0x4380('0x3'));var moment=require(_0x4380('0x4'));var BPromise=require(_0x4380('0x5'));var Mustache=require(_0x4380('0x6'));var util=require('util');var path=require(_0x4380('0x7'));var sox=require('sox');var csv=require(_0x4380('0x8'));var ejs=require(_0x4380('0x9'));var fs=require('fs');var fs_extra=require(_0x4380('0xa'));var _=require(_0x4380('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4380('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4380('0xd'));var Papa=require(_0x4380('0xe'));var Redis=require('ioredis');var authService=require(_0x4380('0xf'));var qs=require(_0x4380('0x10'));var as=require(_0x4380('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4380('0x12'))(_0x4380('0x13'));var utils=require(_0x4380('0x14'));var config=require(_0x4380('0x15'));var licenseUtil=require(_0x4380('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b02f4,_0x215d58){_0x215d58=_0x215d58||0xcc;return function(_0x1244eb){if(_0x1244eb){return _0x1b02f4[_0x4380('0x17')](_0x215d58);}return _0x1b02f4['status'](_0x215d58)['end']();};}function respondWithResult(_0x2cb5ac,_0xf3741f){_0xf3741f=_0xf3741f||0xc8;return function(_0x30c1dd){if(_0x30c1dd){return _0x2cb5ac[_0x4380('0x18')](_0xf3741f)[_0x4380('0x19')](_0x30c1dd);}};}function respondWithFilteredResult(_0x32bc38,_0x24d075){return function(_0x566434){if(_0x566434){var _0xcc9e86=typeof _0x24d075[_0x4380('0x1a')]==='undefined'&&typeof _0x24d075[_0x4380('0x1b')]===_0x4380('0x1c');var _0xb0fc55=_0x566434[_0x4380('0x1d')];var _0x260ceb=_0xcc9e86?0x0:_0x24d075[_0x4380('0x1a')];var _0x3fb8d2=_0xcc9e86?_0x566434['count']:_0x24d075['offset']+_0x24d075[_0x4380('0x1b')];var _0x19a76d;if(_0x3fb8d2>=_0xb0fc55){_0x3fb8d2=_0xb0fc55;_0x19a76d=0xc8;}else{_0x19a76d=0xce;}_0x32bc38['status'](_0x19a76d);return _0x32bc38[_0x4380('0x1e')](_0x4380('0x1f'),_0x260ceb+'-'+_0x3fb8d2+'/'+_0xb0fc55)[_0x4380('0x19')](_0x566434);}return null;};}function patchUpdates(_0x1cafd5){return function(_0x575c79){try{jsonpatch[_0x4380('0x20')](_0x575c79,_0x1cafd5,!![]);}catch(_0x96f70b){return BPromise[_0x4380('0x21')](_0x96f70b);}return _0x575c79[_0x4380('0x22')]();};}function saveUpdates(_0x307ad1,_0x5b1645){return function(_0x28c617){if(_0x28c617){return _0x28c617[_0x4380('0x23')](_0x307ad1)[_0x4380('0x24')](function(_0xfd73e5){return _0xfd73e5;});}return null;};}function removeEntity(_0x55d09f,_0x24d414){return function(_0x1ea5a3){if(_0x1ea5a3){return _0x1ea5a3['destroy']()[_0x4380('0x24')](function(){_0x55d09f[_0x4380('0x18')](0xcc)[_0x4380('0x25')]();});}};}function handleEntityNotFound(_0x56e4fd,_0x43c1a2){return function(_0x1af850){if(!_0x1af850){_0x56e4fd['sendStatus'](0x194);}return _0x1af850;};}function handleError(_0x62c2d,_0x5ee2b1){_0x5ee2b1=_0x5ee2b1||0x1f4;return function(_0x495ad8){logger[_0x4380('0x26')](_0x495ad8['stack']);if(_0x495ad8[_0x4380('0x27')]){delete _0x495ad8[_0x4380('0x27')];}_0x62c2d[_0x4380('0x18')](_0x5ee2b1)[_0x4380('0x28')](_0x495ad8);};}exports[_0x4380('0x29')]=function(_0x4b56e4,_0x540677){var _0x17ed05={},_0x20a905={},_0x22b212={'count':0x0,'rows':[]};var _0x48197f=_[_0x4380('0x2a')](db[_0x4380('0x2b')]['rawAttributes'],function(_0x593e63){return{'name':_0x593e63['fieldName'],'type':_0x593e63[_0x4380('0x2c')][_0x4380('0x2d')]};});_0x20a905['model']=_[_0x4380('0x2a')](_0x48197f,_0x4380('0x27'));_0x20a905[_0x4380('0x2e')]=_['keys'](_0x4b56e4['query']);_0x20a905[_0x4380('0x2f')]=_[_0x4380('0x30')](_0x20a905[_0x4380('0x31')],_0x20a905[_0x4380('0x2e')]);_0x17ed05[_0x4380('0x32')]=_[_0x4380('0x30')](_0x20a905['model'],qs[_0x4380('0x33')](_0x4b56e4['query'][_0x4380('0x33')]));_0x17ed05[_0x4380('0x32')]=_0x17ed05[_0x4380('0x32')][_0x4380('0x34')]?_0x17ed05[_0x4380('0x32')]:_0x20a905[_0x4380('0x31')];if(!_0x4b56e4['query']['hasOwnProperty'](_0x4380('0x35'))){_0x17ed05[_0x4380('0x1b')]=qs[_0x4380('0x1b')](_0x4b56e4[_0x4380('0x2e')][_0x4380('0x1b')]);_0x17ed05[_0x4380('0x1a')]=qs['offset'](_0x4b56e4[_0x4380('0x2e')][_0x4380('0x1a')]);}_0x17ed05[_0x4380('0x36')]=qs[_0x4380('0x37')](_0x4b56e4[_0x4380('0x2e')][_0x4380('0x37')]);_0x17ed05['where']=qs[_0x4380('0x2f')](_[_0x4380('0x38')](_0x4b56e4[_0x4380('0x2e')],_0x20a905['filters']),_0x48197f);if(_0x4b56e4[_0x4380('0x2e')]['filter']){_0x17ed05['where']=_[_0x4380('0x39')](_0x17ed05[_0x4380('0x3a')],{'$or':_['map'](_0x48197f,function(_0x22cf90){if(_0x22cf90[_0x4380('0x2c')]!==_0x4380('0x3b')){var _0x157b7b={};_0x157b7b[_0x22cf90[_0x4380('0x27')]]={'$like':'%'+_0x4b56e4[_0x4380('0x2e')][_0x4380('0x3c')]+'%'};return _0x157b7b;}})});}_0x17ed05=_[_0x4380('0x39')]({},_0x17ed05,_0x4b56e4[_0x4380('0x3d')]);var _0x57ced1={'where':_0x17ed05[_0x4380('0x3a')]};return db[_0x4380('0x2b')][_0x4380('0x1d')](_0x57ced1)[_0x4380('0x24')](function(_0x34bbeb){_0x22b212[_0x4380('0x1d')]=_0x34bbeb;if(_0x4b56e4[_0x4380('0x2e')][_0x4380('0x3e')]){_0x17ed05['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4380('0x3f')](_0x17ed05);})['then'](function(_0x108be9){_0x22b212[_0x4380('0x40')]=_0x108be9;return _0x22b212;})[_0x4380('0x24')](respondWithFilteredResult(_0x540677,_0x17ed05))[_0x4380('0x41')](handleError(_0x540677,null));};exports[_0x4380('0x42')]=function(_0x51c5fa,_0x4ddae7){var _0x35049e={'raw':![],'where':{'id':_0x51c5fa['params']['id']}},_0x45c834={};_0x45c834[_0x4380('0x31')]=_[_0x4380('0x43')](db['AnalyticFieldReport'][_0x4380('0x44')]);_0x45c834[_0x4380('0x2e')]=_['keys'](_0x51c5fa['query']);_0x45c834['filters']=_[_0x4380('0x30')](_0x45c834['model'],_0x45c834[_0x4380('0x2e')]);_0x35049e['attributes']=_[_0x4380('0x30')](_0x45c834[_0x4380('0x31')],qs[_0x4380('0x33')](_0x51c5fa[_0x4380('0x2e')][_0x4380('0x33')]));_0x35049e[_0x4380('0x32')]=_0x35049e['attributes'][_0x4380('0x34')]?_0x35049e[_0x4380('0x32')]:_0x45c834[_0x4380('0x31')];if(_0x51c5fa[_0x4380('0x2e')][_0x4380('0x3e')]){_0x35049e[_0x4380('0x45')]=[{'all':!![]}];}_0x35049e=_[_0x4380('0x39')]({},_0x35049e,_0x51c5fa[_0x4380('0x3d')]);return db[_0x4380('0x2b')][_0x4380('0x46')](_0x35049e)[_0x4380('0x24')](handleEntityNotFound(_0x4ddae7,null))[_0x4380('0x24')](respondWithResult(_0x4ddae7,null))[_0x4380('0x41')](handleError(_0x4ddae7,null));};exports[_0x4380('0x47')]=function(_0x484734,_0x56657b){return db[_0x4380('0x2b')]['create'](_0x484734[_0x4380('0x48')],{})['then'](respondWithResult(_0x56657b,0xc9))['catch'](handleError(_0x56657b,null));};exports[_0x4380('0x49')]=function(_0x6c56fc,_0x5733e4){return db['AnalyticFieldReport'][_0x4380('0x49')](_0x6c56fc[_0x4380('0x48')],{'raw':![],'individualHooks':!![]})[_0x4380('0x24')](respondWithResult(_0x5733e4,0xc9))['catch'](handleError(_0x5733e4,null));};exports[_0x4380('0x23')]=function(_0x2deb67,_0x39941a){if(_0x2deb67[_0x4380('0x48')]['id']){delete _0x2deb67['body']['id'];}return db[_0x4380('0x2b')][_0x4380('0x46')]({'where':{'id':_0x2deb67[_0x4380('0x4a')]['id']}})[_0x4380('0x24')](handleEntityNotFound(_0x39941a,null))[_0x4380('0x24')](saveUpdates(_0x2deb67[_0x4380('0x48')],null))['then'](respondWithResult(_0x39941a,null))[_0x4380('0x41')](handleError(_0x39941a,null));};exports['destroy']=function(_0xa7ce6a,_0x2c0c8b){return db[_0x4380('0x2b')][_0x4380('0x46')]({'where':{'id':_0xa7ce6a[_0x4380('0x4a')]['id']}})[_0x4380('0x24')](handleEntityNotFound(_0x2c0c8b,null))[_0x4380('0x24')](removeEntity(_0x2c0c8b,null))['catch'](handleError(_0x2c0c8b,null));};exports[_0x4380('0x4b')]=function(_0x2f22e4,_0x28f924){return db[_0x4380('0x2b')][_0x4380('0x4c')]({'where':{'id':_0x2f22e4[_0x4380('0x2e')][_0x4380('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x4380('0x24')](respondWithResult(_0x28f924,0xcc))[_0x4380('0x41')](handleError(_0x28f924,null));};exports[_0x4380('0x4e')]=function(_0x129c34,_0x2d187b,_0x1d8714){return db[_0x4380('0x4f')][_0x4380('0x50')]({'where':{'id':_0x129c34[_0x4380('0x4a')]['id']}})[_0x4380('0x24')](handleEntityNotFound(_0x2d187b,null))[_0x4380('0x24')](function(_0x14358c){if(_0x14358c){return db[_0x4380('0x51')]['transaction'](function(_0xaa976e){return db[_0x4380('0x2b')][_0x4380('0x4c')]({'where':{'CustomReportId':_0x129c34[_0x4380('0x4a')]['id']},'transaction':_0xaa976e})[_0x4380('0x24')](function(_0x2f2100){var _0xb71831=_[_0x4380('0x2a')](_0x129c34['body'],function(_0x564d28){delete _0x564d28['id'];_0x564d28[_0x4380('0x52')]=_0x129c34[_0x4380('0x4a')]['id'];return _0x564d28;});return db[_0x4380('0x2b')]['bulkCreate'](_0xb71831,{'transaction':_0xaa976e});});})[_0x4380('0x24')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x129c34[_0x4380('0x4a')]['id']}});});}})[_0x4380('0x24')](respondWithResult(_0x2d187b,null))[_0x4380('0x41')](handleError(_0x2d187b,null));}; \ No newline at end of file +var _0xb9e4=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','create','bulkCreate','body','find','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x39758e,_0x1c4f9e){var _0x467281=function(_0x14ba8e){while(--_0x14ba8e){_0x39758e['push'](_0x39758e['shift']());}};_0x467281(++_0x1c4f9e);}(_0xb9e4,0x1a9));var _0x4b9e=function(_0x456392,_0x1b2b72){_0x456392=_0x456392-0x0;var _0x4a8c6b=_0xb9e4[_0x456392];return _0x4a8c6b;};'use strict';var emlformat=require(_0x4b9e('0x0'));var rimraf=require(_0x4b9e('0x1'));var zipdir=require(_0x4b9e('0x2'));var jsonpatch=require(_0x4b9e('0x3'));var rp=require(_0x4b9e('0x4'));var moment=require(_0x4b9e('0x5'));var BPromise=require(_0x4b9e('0x6'));var Mustache=require(_0x4b9e('0x7'));var util=require(_0x4b9e('0x8'));var path=require(_0x4b9e('0x9'));var sox=require(_0x4b9e('0xa'));var csv=require(_0x4b9e('0xb'));var ejs=require(_0x4b9e('0xc'));var fs=require('fs');var fs_extra=require(_0x4b9e('0xd'));var _=require(_0x4b9e('0xe'));var squel=require(_0x4b9e('0xf'));var crypto=require(_0x4b9e('0x10'));var jsforce=require(_0x4b9e('0x11'));var deskjs=require(_0x4b9e('0x12'));var toCsv=require('to-csv');var querystring=require(_0x4b9e('0x13'));var Papa=require(_0x4b9e('0x14'));var Redis=require(_0x4b9e('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x4b9e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b9e('0x17'));var logger=require(_0x4b9e('0x18'))(_0x4b9e('0x19'));var utils=require('../../config/utils');var config=require(_0x4b9e('0x1a'));var licenseUtil=require(_0x4b9e('0x1b'));var db=require(_0x4b9e('0x1c'))['db'];function respondWithStatusCode(_0x577e6f,_0x375559){_0x375559=_0x375559||0xcc;return function(_0x49f6c0){if(_0x49f6c0){return _0x577e6f[_0x4b9e('0x1d')](_0x375559);}return _0x577e6f[_0x4b9e('0x1e')](_0x375559)[_0x4b9e('0x1f')]();};}function respondWithResult(_0xd4346d,_0x1e5715){_0x1e5715=_0x1e5715||0xc8;return function(_0x36eacb){if(_0x36eacb){return _0xd4346d[_0x4b9e('0x1e')](_0x1e5715)[_0x4b9e('0x20')](_0x36eacb);}};}function respondWithFilteredResult(_0x5e1022,_0x508bc2){return function(_0x1a2300){if(_0x1a2300){var _0x321902=typeof _0x508bc2['offset']===_0x4b9e('0x21')&&typeof _0x508bc2[_0x4b9e('0x22')]===_0x4b9e('0x21');var _0x2be27f=_0x1a2300[_0x4b9e('0x23')];var _0x17172a=_0x321902?0x0:_0x508bc2['offset'];var _0x46fc88=_0x321902?_0x1a2300[_0x4b9e('0x23')]:_0x508bc2[_0x4b9e('0x24')]+_0x508bc2['limit'];var _0xa5a995;if(_0x46fc88>=_0x2be27f){_0x46fc88=_0x2be27f;_0xa5a995=0xc8;}else{_0xa5a995=0xce;}_0x5e1022['status'](_0xa5a995);return _0x5e1022[_0x4b9e('0x25')](_0x4b9e('0x26'),_0x17172a+'-'+_0x46fc88+'/'+_0x2be27f)[_0x4b9e('0x20')](_0x1a2300);}return null;};}function patchUpdates(_0x33abd1){return function(_0xeafdfa){try{jsonpatch['apply'](_0xeafdfa,_0x33abd1,!![]);}catch(_0x2d453a){return BPromise['reject'](_0x2d453a);}return _0xeafdfa['save']();};}function saveUpdates(_0x3d7a4f,_0x5926f2){return function(_0x199be3){if(_0x199be3){return _0x199be3[_0x4b9e('0x27')](_0x3d7a4f)[_0x4b9e('0x28')](function(_0x539ce0){return _0x539ce0;});}return null;};}function removeEntity(_0x6423ae,_0x3ea343){return function(_0x4aa7ff){if(_0x4aa7ff){return _0x4aa7ff[_0x4b9e('0x29')]()[_0x4b9e('0x28')](function(){_0x6423ae[_0x4b9e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f631d,_0x3eaa40){return function(_0x217a98){if(!_0x217a98){_0x2f631d[_0x4b9e('0x1d')](0x194);}return _0x217a98;};}function handleError(_0x57f7d3,_0x10e5b2){_0x10e5b2=_0x10e5b2||0x1f4;return function(_0x5029cd){logger[_0x4b9e('0x2a')](_0x5029cd[_0x4b9e('0x2b')]);if(_0x5029cd[_0x4b9e('0x2c')]){delete _0x5029cd['name'];}_0x57f7d3[_0x4b9e('0x1e')](_0x10e5b2)[_0x4b9e('0x2d')](_0x5029cd);};}exports[_0x4b9e('0x2e')]=function(_0xa2c0c8,_0x593b34){var _0x233c08={},_0x54ba7d={},_0x3a4126={'count':0x0,'rows':[]};var _0x261726=_[_0x4b9e('0x2f')](db[_0x4b9e('0x30')][_0x4b9e('0x31')],function(_0x428097){return{'name':_0x428097[_0x4b9e('0x32')],'type':_0x428097[_0x4b9e('0x33')][_0x4b9e('0x34')]};});_0x54ba7d['model']=_['map'](_0x261726,'name');_0x54ba7d[_0x4b9e('0x35')]=_[_0x4b9e('0x36')](_0xa2c0c8[_0x4b9e('0x35')]);_0x54ba7d['filters']=_['intersection'](_0x54ba7d[_0x4b9e('0x37')],_0x54ba7d[_0x4b9e('0x35')]);_0x233c08[_0x4b9e('0x38')]=_[_0x4b9e('0x39')](_0x54ba7d[_0x4b9e('0x37')],qs[_0x4b9e('0x3a')](_0xa2c0c8[_0x4b9e('0x35')][_0x4b9e('0x3a')]));_0x233c08[_0x4b9e('0x38')]=_0x233c08[_0x4b9e('0x38')][_0x4b9e('0x3b')]?_0x233c08['attributes']:_0x54ba7d[_0x4b9e('0x37')];if(!_0xa2c0c8[_0x4b9e('0x35')][_0x4b9e('0x3c')](_0x4b9e('0x3d'))){_0x233c08['limit']=qs['limit'](_0xa2c0c8['query'][_0x4b9e('0x22')]);_0x233c08[_0x4b9e('0x24')]=qs[_0x4b9e('0x24')](_0xa2c0c8[_0x4b9e('0x35')][_0x4b9e('0x24')]);}_0x233c08[_0x4b9e('0x3e')]=qs[_0x4b9e('0x3f')](_0xa2c0c8['query']['sort']);_0x233c08['where']=qs['filters'](_[_0x4b9e('0x40')](_0xa2c0c8[_0x4b9e('0x35')],_0x54ba7d[_0x4b9e('0x41')]),_0x261726);if(_0xa2c0c8['query'][_0x4b9e('0x42')]){_0x233c08[_0x4b9e('0x43')]=_[_0x4b9e('0x44')](_0x233c08['where'],{'$or':_['map'](_0x261726,function(_0x388080){if(_0x388080[_0x4b9e('0x33')]!==_0x4b9e('0x45')){var _0x2f3b20={};_0x2f3b20[_0x388080[_0x4b9e('0x2c')]]={'$like':'%'+_0xa2c0c8['query'][_0x4b9e('0x42')]+'%'};return _0x2f3b20;}})});}_0x233c08=_[_0x4b9e('0x44')]({},_0x233c08,_0xa2c0c8[_0x4b9e('0x46')]);var _0x3c176e={'where':_0x233c08[_0x4b9e('0x43')]};return db[_0x4b9e('0x30')][_0x4b9e('0x23')](_0x3c176e)['then'](function(_0x35f3e2){_0x3a4126[_0x4b9e('0x23')]=_0x35f3e2;if(_0xa2c0c8[_0x4b9e('0x35')][_0x4b9e('0x47')]){_0x233c08[_0x4b9e('0x48')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x233c08);})[_0x4b9e('0x28')](function(_0x286798){_0x3a4126['rows']=_0x286798;return _0x3a4126;})['then'](respondWithFilteredResult(_0x593b34,_0x233c08))[_0x4b9e('0x49')](handleError(_0x593b34,null));};exports['show']=function(_0x335ebf,_0x349940){var _0x52cddf={'raw':![],'where':{'id':_0x335ebf[_0x4b9e('0x4a')]['id']}},_0x4ed67e={};_0x4ed67e['model']=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x4ed67e[_0x4b9e('0x35')]=_[_0x4b9e('0x36')](_0x335ebf[_0x4b9e('0x35')]);_0x4ed67e['filters']=_[_0x4b9e('0x39')](_0x4ed67e['model'],_0x4ed67e[_0x4b9e('0x35')]);_0x52cddf[_0x4b9e('0x38')]=_[_0x4b9e('0x39')](_0x4ed67e['model'],qs['fields'](_0x335ebf[_0x4b9e('0x35')][_0x4b9e('0x3a')]));_0x52cddf[_0x4b9e('0x38')]=_0x52cddf[_0x4b9e('0x38')][_0x4b9e('0x3b')]?_0x52cddf[_0x4b9e('0x38')]:_0x4ed67e[_0x4b9e('0x37')];if(_0x335ebf[_0x4b9e('0x35')][_0x4b9e('0x47')]){_0x52cddf[_0x4b9e('0x48')]=[{'all':!![]}];}_0x52cddf=_[_0x4b9e('0x44')]({},_0x52cddf,_0x335ebf[_0x4b9e('0x46')]);return db[_0x4b9e('0x30')]['find'](_0x52cddf)[_0x4b9e('0x28')](handleEntityNotFound(_0x349940,null))['then'](respondWithResult(_0x349940,null))[_0x4b9e('0x49')](handleError(_0x349940,null));};exports[_0x4b9e('0x4b')]=function(_0x342614,_0x1104bd){return db[_0x4b9e('0x30')]['create'](_0x342614['body'],{})['then'](respondWithResult(_0x1104bd,0xc9))['catch'](handleError(_0x1104bd,null));};exports[_0x4b9e('0x4c')]=function(_0x47e87e,_0x295848){return db['AnalyticFieldReport'][_0x4b9e('0x4c')](_0x47e87e[_0x4b9e('0x4d')],{'raw':![],'individualHooks':!![]})[_0x4b9e('0x28')](respondWithResult(_0x295848,0xc9))[_0x4b9e('0x49')](handleError(_0x295848,null));};exports[_0x4b9e('0x27')]=function(_0x3528dd,_0x45b285){if(_0x3528dd[_0x4b9e('0x4d')]['id']){delete _0x3528dd['body']['id'];}return db[_0x4b9e('0x30')]['find']({'where':{'id':_0x3528dd[_0x4b9e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x45b285,null))[_0x4b9e('0x28')](saveUpdates(_0x3528dd[_0x4b9e('0x4d')],null))['then'](respondWithResult(_0x45b285,null))[_0x4b9e('0x49')](handleError(_0x45b285,null));};exports['destroy']=function(_0x25ec27,_0x112add){return db[_0x4b9e('0x30')][_0x4b9e('0x4e')]({'where':{'id':_0x25ec27['params']['id']}})[_0x4b9e('0x28')](handleEntityNotFound(_0x112add,null))[_0x4b9e('0x28')](removeEntity(_0x112add,null))[_0x4b9e('0x49')](handleError(_0x112add,null));};exports[_0x4b9e('0x4f')]=function(_0x4e3c68,_0x3eb8c5){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x4e3c68[_0x4b9e('0x35')][_0x4b9e('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0x4b9e('0x28')](respondWithResult(_0x3eb8c5,0xcc))[_0x4b9e('0x49')](handleError(_0x3eb8c5,null));};exports[_0x4b9e('0x51')]=function(_0x24698b,_0x47b292,_0x396bd6){return db['AnalyticCustomReport'][_0x4b9e('0x52')]({'where':{'id':_0x24698b['params']['id']}})[_0x4b9e('0x28')](handleEntityNotFound(_0x47b292,null))[_0x4b9e('0x28')](function(_0x166932){if(_0x166932){return db[_0x4b9e('0x53')][_0x4b9e('0x54')](function(_0x17c3d7){return db['AnalyticFieldReport'][_0x4b9e('0x29')]({'where':{'CustomReportId':_0x24698b['params']['id']},'transaction':_0x17c3d7})[_0x4b9e('0x28')](function(_0x4147f1){var _0x55aa10=_[_0x4b9e('0x2f')](_0x24698b['body'],function(_0x358ecd){delete _0x358ecd['id'];_0x358ecd[_0x4b9e('0x55')]=_0x24698b[_0x4b9e('0x4a')]['id'];return _0x358ecd;});return db[_0x4b9e('0x30')][_0x4b9e('0x4c')](_0x55aa10,{'transaction':_0x17c3d7});});})[_0x4b9e('0x28')](function(){return db[_0x4b9e('0x30')][_0x4b9e('0x56')]({'where':{'CustomReportId':_0x24698b['params']['id']}});});}})[_0x4b9e('0x28')](respondWithResult(_0x47b292,null))['catch'](handleError(_0x47b292,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index f754be6..e1da2ad 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 _0xd43a=['util','bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','analytics_report_fields'];(function(_0xc63d7a,_0x5e5ff2){var _0x155215=function(_0x502d9d){while(--_0x502d9d){_0xc63d7a['push'](_0xc63d7a['shift']());}};_0x155215(++_0x5e5ff2);}(_0xd43a,0x1e3));var _0xad43=function(_0xf3a037,_0x2807de){_0xf3a037=_0xf3a037-0x0;var _0x3a5ca3=_0xd43a[_0xf3a037];return _0x3a5ca3;};'use strict';var _=require('lodash');var util=require(_0xad43('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xad43('0x1'));var rp=require(_0xad43('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad43('0x3'));var attributes=require(_0xad43('0x4'));module[_0xad43('0x5')]=function(_0x485e4a,_0x12ac82){return _0x485e4a['define']('AnalyticFieldReport',attributes,{'tableName':_0xad43('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a07=['api','bluebird','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','util','../../config/logger'];(function(_0x4eab11,_0x420bfb){var _0x417a63=function(_0x35f378){while(--_0x35f378){_0x4eab11['push'](_0x4eab11['shift']());}};_0x417a63(++_0x420bfb);}(_0x0a07,0x7b));var _0x70a0=function(_0x4c3184,_0x52ea70){_0x4c3184=_0x4c3184-0x0;var _0x2ff62b=_0x0a07[_0x4c3184];return _0x2ff62b;};'use strict';var _=require(_0x70a0('0x0'));var util=require(_0x70a0('0x1'));var logger=require(_0x70a0('0x2'))(_0x70a0('0x3'));var moment=require('moment');var BPromise=require(_0x70a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x70a0('0x5'));var attributes=require(_0x70a0('0x6'));module['exports']=function(_0x3d06d3,_0x50fa55){return _0x3d06d3[_0x70a0('0x7')](_0x70a0('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index dd622ad..8782aa7 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 _0xf531=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf531,0x1d3));var _0x1f53=function(_0x59de5a,_0x1c31ab){_0x59de5a=_0x59de5a-0x0;var _0x1e86eb=_0xf531[_0x59de5a];return _0x1e86eb;};'use strict';var _=require(_0x1f53('0x0'));var util=require(_0x1f53('0x1'));var moment=require(_0x1f53('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f53('0x3'));var fs=require('fs');var Redis=require(_0x1f53('0x4'));var db=require(_0x1f53('0x5'))['db'];var utils=require(_0x1f53('0x6'));var logger=require('../../config/logger')(_0x1f53('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f53('0x8')][_0x1f53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26bef6,_0x48e6e6,_0x4c706a){return new BPromise(function(_0x29e6e6,_0x4e68e9){return client[_0x1f53('0xa')](_0x26bef6,_0x4c706a)['then'](function(_0x24bbd4){logger[_0x1f53('0xb')](_0x1f53('0xc'),_0x48e6e6,_0x1f53('0xd'));logger[_0x1f53('0xe')](_0x1f53('0xf'),_0x48e6e6,'request\x20sent',JSON[_0x1f53('0x10')](_0x24bbd4));if(_0x24bbd4['error']){if(_0x24bbd4[_0x1f53('0x11')][_0x1f53('0x12')]===0x1f4){logger[_0x1f53('0x11')](_0x1f53('0xc'),_0x48e6e6,_0x24bbd4[_0x1f53('0x11')][_0x1f53('0x13')]);return _0x4e68e9(_0x24bbd4['error'][_0x1f53('0x13')]);}logger['error'](_0x1f53('0xc'),_0x48e6e6,_0x24bbd4[_0x1f53('0x11')][_0x1f53('0x13')]);return _0x29e6e6(_0x24bbd4[_0x1f53('0x11')][_0x1f53('0x13')]);}else{logger['info'](_0x1f53('0xc'),_0x48e6e6,_0x1f53('0xd'));_0x29e6e6(_0x24bbd4[_0x1f53('0x14')][_0x1f53('0x13')]);}})[_0x1f53('0x15')](function(_0x2be034){logger[_0x1f53('0x11')](_0x1f53('0xc'),_0x48e6e6,_0x2be034);_0x4e68e9(_0x2be034);});});} \ No newline at end of file +var _0xe319=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x1e5a0c,_0x3a16fc){var _0x5cc15b=function(_0x39e08f){while(--_0x39e08f){_0x1e5a0c['push'](_0x1e5a0c['shift']());}};_0x5cc15b(++_0x3a16fc);}(_0xe319,0xac));var _0x9e31=function(_0x3f5002,_0x51cd58){_0x3f5002=_0x3f5002-0x0;var _0x357b9e=_0xe319[_0x3f5002];return _0x357b9e;};'use strict';var _=require(_0x9e31('0x0'));var util=require('util');var moment=require(_0x9e31('0x1'));var BPromise=require(_0x9e31('0x2'));var rs=require(_0x9e31('0x3'));var fs=require('fs');var Redis=require(_0x9e31('0x4'));var db=require(_0x9e31('0x5'))['db'];var utils=require(_0x9e31('0x6'));var logger=require(_0x9e31('0x7'))('rpc');var config=require(_0x9e31('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e31('0x9')][_0x9e31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2965ee,_0x3ba86a,_0x5ebbe1){return new BPromise(function(_0x500d47,_0x54a522){return client['request'](_0x2965ee,_0x5ebbe1)[_0x9e31('0xb')](function(_0x1177df){logger[_0x9e31('0xc')](_0x9e31('0xd'),_0x3ba86a,_0x9e31('0xe'));logger[_0x9e31('0xf')](_0x9e31('0x10'),_0x3ba86a,_0x9e31('0xe'),JSON[_0x9e31('0x11')](_0x1177df));if(_0x1177df[_0x9e31('0x12')]){if(_0x1177df[_0x9e31('0x12')][_0x9e31('0x13')]===0x1f4){logger[_0x9e31('0x12')](_0x9e31('0xd'),_0x3ba86a,_0x1177df[_0x9e31('0x12')]['message']);return _0x54a522(_0x1177df['error'][_0x9e31('0x14')]);}logger[_0x9e31('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ba86a,_0x1177df[_0x9e31('0x12')][_0x9e31('0x14')]);return _0x500d47(_0x1177df[_0x9e31('0x12')][_0x9e31('0x14')]);}else{logger[_0x9e31('0xc')](_0x9e31('0xd'),_0x3ba86a,_0x9e31('0xe'));_0x500d47(_0x1177df[_0x9e31('0x15')]['message']);}})[_0x9e31('0x16')](function(_0x4bcf6e){logger['error'](_0x9e31('0xd'),_0x3ba86a,_0x4bcf6e);_0x54a522(_0x4bcf6e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 92c5191..0da01b0 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(_0x54996a,_0x4670ee){var _0x2f2bdd=function(_0x4e87bc){while(--_0x4e87bc){_0x54996a['push'](_0x54996a['shift']());}};_0x2f2bdd(++_0x4670ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x1450b6,_0xa089aa){var _0x29d3a8=function(_0x18a928){while(--_0x18a928){_0x1450b6['push'](_0x1450b6['shift']());}};_0x29d3a8(++_0xa089aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 aa131ba..ae0f096 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 _0xbdb7=['name','TEXT','sequelize','exports','STRING'];(function(_0xf48d27,_0xc761af){var _0x172722=function(_0x4722d1){while(--_0x4722d1){_0xf48d27['push'](_0xf48d27['shift']());}};_0x172722(++_0xc761af);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5be8ab,_0x4000a6){_0x5be8ab=_0x5be8ab-0x0;var _0x35914d=_0xbdb7[_0x5be8ab];return _0x35914d;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'allowNull':![],'unique':_0x7bdb('0x3')},'table':{'type':Sequelize[_0x7bdb('0x2')]},'metric':{'type':Sequelize[_0x7bdb('0x4')]},'description':{'type':Sequelize[_0x7bdb('0x2')]}}; \ No newline at end of file +var _0x6c63=['exports','STRING','name','TEXT','sequelize'];(function(_0x4c78c6,_0x3d6889){var _0x5431b8=function(_0x192846){while(--_0x192846){_0x4c78c6['push'](_0x4c78c6['shift']());}};_0x5431b8(++_0x3d6889);}(_0x6c63,0x1ee));var _0x36c6=function(_0x5bf329,_0x5379ae){_0x5bf329=_0x5bf329-0x0;var _0x1b7005=_0x6c63[_0x5bf329];return _0x1b7005;};'use strict';var Sequelize=require(_0x36c6('0x0'));module[_0x36c6('0x1')]={'name':{'type':Sequelize[_0x36c6('0x2')],'allowNull':![],'unique':_0x36c6('0x3')},'table':{'type':Sequelize[_0x36c6('0x2')]},'metric':{'type':Sequelize[_0x36c6('0x4')]},'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 dc63b90..3f3ca3b 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 _0x46ed=['where','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x2fb5bb,_0x201913){var _0x3f57f1=function(_0x143a18){while(--_0x143a18){_0x2fb5bb['push'](_0x2fb5bb['shift']());}};_0x3f57f1(++_0x201913);}(_0x46ed,0x168));var _0xd46e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x46ed[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Metrics';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));}; \ No newline at end of file +var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x4deac3,_0x49a143){var _0x190902=function(_0x55a521){while(--_0x55a521){_0x4deac3['push'](_0x4deac3['shift']());}};_0x190902(++_0x49a143);}(_0x9a19,0x114));var _0x99a1=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9a19[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index c33aeac..5275479 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 _0xa498=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric'];(function(_0x53ad9e,_0x324487){var _0x5abb46=function(_0x350461){while(--_0x350461){_0x53ad9e['push'](_0x53ad9e['shift']());}};_0x5abb46(++_0x324487);}(_0xa498,0x1d6));var _0x8a49=function(_0x5adfa9,_0x4b835d){_0x5adfa9=_0x5adfa9-0x0;var _0x458f41=_0xa498[_0x5adfa9];return _0x458f41;};'use strict';var _=require('lodash');var util=require(_0x8a49('0x0'));var logger=require(_0x8a49('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8a49('0x2'));var rp=require(_0x8a49('0x3'));var fs=require('fs');var path=require(_0x8a49('0x4'));var rimraf=require(_0x8a49('0x5'));var config=require(_0x8a49('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x8a49('0x7')]=function(_0x5c5df6,_0x366d5b){return _0x5c5df6[_0x8a49('0x8')](_0x8a49('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13c5=['exports','analytics_metrics','lodash','path','./analyticMetric.attributes'];(function(_0x8b06f7,_0x2afcff){var _0x30d20a=function(_0x2388ed){while(--_0x2388ed){_0x8b06f7['push'](_0x8b06f7['shift']());}};_0x30d20a(++_0x2afcff);}(_0x13c5,0x7a));var _0x513c=function(_0x3e5eda,_0x156d80){_0x3e5eda=_0x3e5eda-0x0;var _0x482d3f=_0x13c5[_0x3e5eda];return _0x482d3f;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x513c('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x513c('0x2'));module[_0x513c('0x3')]=function(_0x982017,_0x2ad2db){return _0x982017['define']('AnalyticMetric',attributes,{'tableName':_0x513c('0x4'),'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 48a90da..17c7482 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 _0xd0e4=['result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x42c7f9,_0x5299ba){var _0x18ef11=function(_0x5b2750){while(--_0x5b2750){_0x42c7f9['push'](_0x42c7f9['shift']());}};_0x18ef11(++_0x5299ba);}(_0xd0e4,0x1ba));var _0x4d0e=function(_0x5f596d,_0x3991d6){_0x5f596d=_0x5f596d-0x0;var _0x31e495=_0xd0e4[_0x5f596d];return _0x31e495;};'use strict';var _=require(_0x4d0e('0x0'));var util=require(_0x4d0e('0x1'));var moment=require('moment');var BPromise=require(_0x4d0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d0e('0x3'));var db=require(_0x4d0e('0x4'))['db'];var utils=require(_0x4d0e('0x5'));var logger=require(_0x4d0e('0x6'))(_0x4d0e('0x7'));var config=require(_0x4d0e('0x8'));var jayson=require(_0x4d0e('0x9'));var client=jayson[_0x4d0e('0xa')][_0x4d0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22059c,_0x1fedcf,_0x61f045){return new BPromise(function(_0x13d8aa,_0x5431a7){return client[_0x4d0e('0xc')](_0x22059c,_0x61f045)['then'](function(_0x2d8b3c){logger['info'](_0x4d0e('0xd'),_0x1fedcf,_0x4d0e('0xe'));logger[_0x4d0e('0xf')](_0x4d0e('0x10'),_0x1fedcf,'request\x20sent',JSON['stringify'](_0x2d8b3c));if(_0x2d8b3c[_0x4d0e('0x11')]){if(_0x2d8b3c[_0x4d0e('0x11')]['code']===0x1f4){logger[_0x4d0e('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1fedcf,_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);return _0x5431a7(_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);}logger['error'](_0x4d0e('0xd'),_0x1fedcf,_0x2d8b3c[_0x4d0e('0x11')]['message']);return _0x13d8aa(_0x2d8b3c[_0x4d0e('0x11')][_0x4d0e('0x12')]);}else{logger[_0x4d0e('0x13')](_0x4d0e('0xd'),_0x1fedcf,'request\x20sent');_0x13d8aa(_0x2d8b3c[_0x4d0e('0x14')][_0x4d0e('0x12')]);}})['catch'](function(_0x14227){logger[_0x4d0e('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1fedcf,_0x14227);_0x5431a7(_0x14227);});});} \ No newline at end of file +var _0x7295=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s'];(function(_0x410464,_0x31b526){var _0x2dbece=function(_0x5966c6){while(--_0x5966c6){_0x410464['push'](_0x410464['shift']());}};_0x2dbece(++_0x31b526);}(_0x7295,0x10b));var _0x5729=function(_0x47cc41,_0x11e552){_0x47cc41=_0x47cc41-0x0;var _0x580c72=_0x7295[_0x47cc41];return _0x580c72;};'use strict';var _=require(_0x5729('0x0'));var util=require(_0x5729('0x1'));var moment=require(_0x5729('0x2'));var BPromise=require(_0x5729('0x3'));var rs=require(_0x5729('0x4'));var fs=require('fs');var Redis=require(_0x5729('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5729('0x6'));var logger=require(_0x5729('0x7'))('rpc');var config=require(_0x5729('0x8'));var jayson=require(_0x5729('0x9'));var client=jayson['client'][_0x5729('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x321f77,_0x55f6cd,_0xa8dd21){return new BPromise(function(_0x58d51e,_0x27fa78){return client['request'](_0x321f77,_0xa8dd21)['then'](function(_0x423f17){logger[_0x5729('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x55f6cd,_0x5729('0xc'));logger[_0x5729('0xd')](_0x5729('0xe'),_0x55f6cd,_0x5729('0xc'),JSON[_0x5729('0xf')](_0x423f17));if(_0x423f17[_0x5729('0x10')]){if(_0x423f17['error']['code']===0x1f4){logger['error'](_0x5729('0x11'),_0x55f6cd,_0x423f17[_0x5729('0x10')]['message']);return _0x27fa78(_0x423f17['error'][_0x5729('0x12')]);}logger[_0x5729('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x55f6cd,_0x423f17[_0x5729('0x10')][_0x5729('0x12')]);return _0x58d51e(_0x423f17[_0x5729('0x10')][_0x5729('0x12')]);}else{logger[_0x5729('0xb')](_0x5729('0x11'),_0x55f6cd,_0x5729('0xc'));_0x58d51e(_0x423f17['result'][_0x5729('0x12')]);}})['catch'](function(_0x5cc425){logger[_0x5729('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x55f6cd,_0x5cc425);_0x27fa78(_0x5cc425);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index b584db6..8350541 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 _0x7f3f=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x20a822,_0x5dc295){_0x20a822=_0x20a822-0x0;var _0x3775d1=_0x7f3f[_0x20a822];return _0x3775d1;};'use strict';var multer=require(_0xf7f3('0x0'));var util=require(_0xf7f3('0x1'));var path=require('path');var timeout=require(_0xf7f3('0x2'));var express=require(_0xf7f3('0x3'));var router=express[_0xf7f3('0x4')]();var fs_extra=require(_0xf7f3('0x5'));var auth=require(_0xf7f3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7f3('0x7'));var controller=require(_0xf7f3('0x8'));router['get']('/',auth[_0xf7f3('0x9')](),controller[_0xf7f3('0xa')]);router[_0xf7f3('0xb')](_0xf7f3('0xc'),auth[_0xf7f3('0x9')](),controller[_0xf7f3('0xd')]);router[_0xf7f3('0xe')]('/',auth['isAuthenticated'](),controller[_0xf7f3('0xf')]);router[_0xf7f3('0x10')](_0xf7f3('0xc'),auth[_0xf7f3('0x9')](),controller[_0xf7f3('0x11')]);router[_0xf7f3('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf7f3('0x13')]);module['exports']=router; \ No newline at end of file +var _0x56da=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xb16083,_0xa1e4c5){var _0x5b1a52=function(_0x36b703){while(--_0x36b703){_0xb16083['push'](_0xb16083['shift']());}};_0x5b1a52(++_0xa1e4c5);}(_0x56da,0x119));var _0xa56d=function(_0x18daeb,_0x1b8ff3){_0x18daeb=_0x18daeb-0x0;var _0x425a30=_0x56da[_0x18daeb];return _0x425a30;};'use strict';var multer=require(_0xa56d('0x0'));var util=require('util');var path=require(_0xa56d('0x1'));var timeout=require(_0xa56d('0x2'));var express=require('express');var router=express[_0xa56d('0x3')]();var fs_extra=require(_0xa56d('0x4'));var auth=require(_0xa56d('0x5'));var interaction=require(_0xa56d('0x6'));var config=require(_0xa56d('0x7'));var controller=require(_0xa56d('0x8'));router[_0xa56d('0x9')]('/',auth[_0xa56d('0xa')](),controller[_0xa56d('0xb')]);router[_0xa56d('0x9')](_0xa56d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa56d('0xd')]('/',auth[_0xa56d('0xa')](),controller[_0xa56d('0xe')]);router[_0xa56d('0xf')](_0xa56d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa56d('0x10')](_0xa56d('0xc'),auth[_0xa56d('0xa')](),controller['destroy']);module[_0xa56d('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index bba4dcd..f8b47ae 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 _0xc969=['sequelize'];(function(_0x5ee897,_0x327f73){var _0x71dce9=function(_0x27dbbf){while(--_0x27dbbf){_0x5ee897['push'](_0x5ee897['shift']());}};_0x71dce9(++_0x327f73);}(_0xc969,0x171));var _0x9c96=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xc969[_0x13ce0c];return _0x4388fb;};'use strict';var Sequelize=require(_0x9c96('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xe62b=['sequelize','TEXT'];(function(_0xbb17d0,_0x597619){var _0x5238b0=function(_0x55f29c){while(--_0x55f29c){_0xbb17d0['push'](_0xbb17d0['shift']());}};_0x5238b0(++_0x597619);}(_0xe62b,0x180));var _0xbe62=function(_0x528b92,_0x2a3971){_0x528b92=_0x528b92-0x0;var _0x171eba=_0xe62b[_0x528b92];return _0x171eba;};'use strict';var Sequelize=require(_0xbe62('0x0'));module['exports']={'tree':{'type':Sequelize[_0xbe62('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 8c87213..0e1ff5d 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 _0x505e=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x28cbac,_0x5effbc){var _0x109cc2=function(_0x3fdc24){while(--_0x3fdc24){_0x28cbac['push'](_0x28cbac['shift']());}};_0x109cc2(++_0x5effbc);}(_0x505e,0x14e));var _0xe505=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0x505e[_0x22e9fe];return _0x47cd19;};'use strict';var emlformat=require(_0xe505('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe505('0x1'));var jsonpatch=require(_0xe505('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe505('0x3'));var Mustache=require(_0xe505('0x4'));var util=require(_0xe505('0x5'));var path=require(_0xe505('0x6'));var sox=require('sox');var csv=require(_0xe505('0x7'));var ejs=require(_0xe505('0x8'));var fs=require('fs');var fs_extra=require(_0xe505('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe505('0xa'));var toCsv=require(_0xe505('0x7'));var querystring=require(_0xe505('0xb'));var Papa=require(_0xe505('0xc'));var Redis=require('ioredis');var authService=require(_0xe505('0xd'));var qs=require(_0xe505('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe505('0xf'))(_0xe505('0x10'));var utils=require('../../config/utils');var config=require(_0xe505('0x11'));var licenseUtil=require(_0xe505('0x12'));var db=require(_0xe505('0x13'))['db'];function respondWithStatusCode(_0xa59f15,_0x4782b7){_0x4782b7=_0x4782b7||0xcc;return function(_0x1f0fc7){if(_0x1f0fc7){return _0xa59f15[_0xe505('0x14')](_0x4782b7);}return _0xa59f15[_0xe505('0x15')](_0x4782b7)[_0xe505('0x16')]();};}function respondWithResult(_0x9707b6,_0x5d91b1){_0x5d91b1=_0x5d91b1||0xc8;return function(_0xf644ef){if(_0xf644ef){return _0x9707b6['status'](_0x5d91b1)['json'](_0xf644ef);}};}function respondWithFilteredResult(_0x5c39f2,_0x2705b7){return function(_0x3c0456){if(_0x3c0456){var _0x426fea=typeof _0x2705b7[_0xe505('0x17')]===_0xe505('0x18')&&typeof _0x2705b7[_0xe505('0x19')]==='undefined';var _0x16ff26=_0x3c0456[_0xe505('0x1a')];var _0x410f7f=_0x426fea?0x0:_0x2705b7[_0xe505('0x17')];var _0x50a6da=_0x426fea?_0x3c0456[_0xe505('0x1a')]:_0x2705b7[_0xe505('0x17')]+_0x2705b7[_0xe505('0x19')];var _0x422074;if(_0x50a6da>=_0x16ff26){_0x50a6da=_0x16ff26;_0x422074=0xc8;}else{_0x422074=0xce;}_0x5c39f2[_0xe505('0x15')](_0x422074);return _0x5c39f2['set'](_0xe505('0x1b'),_0x410f7f+'-'+_0x50a6da+'/'+_0x16ff26)[_0xe505('0x1c')](_0x3c0456);}return null;};}function patchUpdates(_0x2537d0){return function(_0x18dacc){try{jsonpatch['apply'](_0x18dacc,_0x2537d0,!![]);}catch(_0xc82ec3){return BPromise[_0xe505('0x1d')](_0xc82ec3);}return _0x18dacc[_0xe505('0x1e')]();};}function saveUpdates(_0x46b92b,_0x30c3f2){return function(_0x1f8f15){if(_0x1f8f15){return _0x1f8f15[_0xe505('0x1f')](_0x46b92b)['then'](function(_0x2d7a4b){return _0x2d7a4b;});}return null;};}function removeEntity(_0x9cb898,_0x2f3df2){return function(_0x193e7a){if(_0x193e7a){return _0x193e7a[_0xe505('0x20')]()['then'](function(){_0x9cb898['status'](0xcc)[_0xe505('0x16')]();});}};}function handleEntityNotFound(_0x3c3f0b,_0x1c5df6){return function(_0x45f0f8){if(!_0x45f0f8){_0x3c3f0b[_0xe505('0x14')](0x194);}return _0x45f0f8;};}function handleError(_0x2ceb68,_0x40458e){_0x40458e=_0x40458e||0x1f4;return function(_0x9353a5){logger[_0xe505('0x21')](_0x9353a5['stack']);if(_0x9353a5[_0xe505('0x22')]){delete _0x9353a5['name'];}_0x2ceb68['status'](_0x40458e)[_0xe505('0x23')](_0x9353a5);};}exports[_0xe505('0x24')]=function(_0x157c37,_0x362a98){var _0x3ed28b={},_0x91ef89={},_0x287725={'count':0x0,'rows':[]};var _0x52b0db=_[_0xe505('0x25')](db[_0xe505('0x26')][_0xe505('0x27')],function(_0x26bf37){return{'name':_0x26bf37['fieldName'],'type':_0x26bf37[_0xe505('0x28')][_0xe505('0x29')]};});_0x91ef89[_0xe505('0x2a')]=_['map'](_0x52b0db,'name');_0x91ef89[_0xe505('0x2b')]=_[_0xe505('0x2c')](_0x157c37['query']);_0x91ef89[_0xe505('0x2d')]=_[_0xe505('0x2e')](_0x91ef89[_0xe505('0x2a')],_0x91ef89['query']);_0x3ed28b[_0xe505('0x2f')]=_[_0xe505('0x2e')](_0x91ef89['model'],qs['fields'](_0x157c37[_0xe505('0x2b')][_0xe505('0x30')]));_0x3ed28b['attributes']=_0x3ed28b[_0xe505('0x2f')][_0xe505('0x31')]?_0x3ed28b[_0xe505('0x2f')]:_0x91ef89[_0xe505('0x2a')];if(!_0x157c37[_0xe505('0x2b')]['hasOwnProperty'](_0xe505('0x32'))){_0x3ed28b['limit']=qs[_0xe505('0x19')](_0x157c37[_0xe505('0x2b')][_0xe505('0x19')]);_0x3ed28b[_0xe505('0x17')]=qs[_0xe505('0x17')](_0x157c37[_0xe505('0x2b')][_0xe505('0x17')]);}_0x3ed28b[_0xe505('0x33')]=qs[_0xe505('0x34')](_0x157c37['query']['sort']);_0x3ed28b['where']=qs[_0xe505('0x2d')](_[_0xe505('0x35')](_0x157c37[_0xe505('0x2b')],_0x91ef89[_0xe505('0x2d')]),_0x52b0db);if(_0x157c37[_0xe505('0x2b')][_0xe505('0x36')]){_0x3ed28b[_0xe505('0x37')]=_[_0xe505('0x38')](_0x3ed28b[_0xe505('0x37')],{'$or':_['map'](_0x52b0db,function(_0x33deb2){if(_0x33deb2['type']!==_0xe505('0x39')){var _0xac2b7d={};_0xac2b7d[_0x33deb2['name']]={'$like':'%'+_0x157c37[_0xe505('0x2b')]['filter']+'%'};return _0xac2b7d;}})});}_0x3ed28b=_['merge']({},_0x3ed28b,_0x157c37[_0xe505('0x3a')]);var _0x1fdcc8={'where':_0x3ed28b[_0xe505('0x37')]};return db[_0xe505('0x26')][_0xe505('0x1a')](_0x1fdcc8)['then'](function(_0x422852){_0x287725[_0xe505('0x1a')]=_0x422852;if(_0x157c37[_0xe505('0x2b')][_0xe505('0x3b')]){_0x3ed28b[_0xe505('0x3c')]=[{'all':!![]}];}return db[_0xe505('0x26')][_0xe505('0x3d')](_0x3ed28b);})[_0xe505('0x3e')](function(_0x31a48d){_0x287725[_0xe505('0x3f')]=_0x31a48d;return _0x287725;})['then'](respondWithFilteredResult(_0x362a98,_0x3ed28b))[_0xe505('0x40')](handleError(_0x362a98,null));};exports[_0xe505('0x41')]=function(_0x1dfd2e,_0x4f73da){var _0x12dabb={'raw':!![],'where':{'id':_0x1dfd2e[_0xe505('0x42')]['id']}},_0x531b75={};_0x531b75['model']=_[_0xe505('0x2c')](db[_0xe505('0x26')][_0xe505('0x27')]);_0x531b75[_0xe505('0x2b')]=_[_0xe505('0x2c')](_0x1dfd2e[_0xe505('0x2b')]);_0x531b75[_0xe505('0x2d')]=_[_0xe505('0x2e')](_0x531b75['model'],_0x531b75[_0xe505('0x2b')]);_0x12dabb[_0xe505('0x2f')]=_['intersection'](_0x531b75[_0xe505('0x2a')],qs['fields'](_0x1dfd2e[_0xe505('0x2b')][_0xe505('0x30')]));_0x12dabb[_0xe505('0x2f')]=_0x12dabb['attributes'][_0xe505('0x31')]?_0x12dabb['attributes']:_0x531b75['model'];if(_0x1dfd2e[_0xe505('0x2b')][_0xe505('0x3b')]){_0x12dabb[_0xe505('0x3c')]=[{'all':!![]}];}_0x12dabb=_[_0xe505('0x38')]({},_0x12dabb,_0x1dfd2e['options']);return db['AnalyticTreeReport'][_0xe505('0x43')](_0x12dabb)[_0xe505('0x3e')](handleEntityNotFound(_0x4f73da,null))[_0xe505('0x3e')](respondWithResult(_0x4f73da,null))[_0xe505('0x40')](handleError(_0x4f73da,null));};exports[_0xe505('0x44')]=function(_0x4fdc1c,_0x593ce5){return db[_0xe505('0x26')][_0xe505('0x44')](_0x4fdc1c[_0xe505('0x45')],{})[_0xe505('0x3e')](respondWithResult(_0x593ce5,0xc9))[_0xe505('0x40')](handleError(_0x593ce5,null));};exports[_0xe505('0x1f')]=function(_0xf495a2,_0x5a7ce0){if(_0xf495a2[_0xe505('0x45')]['id']){delete _0xf495a2[_0xe505('0x45')]['id'];}return db[_0xe505('0x26')][_0xe505('0x43')]({'where':{'id':_0xf495a2[_0xe505('0x42')]['id']}})[_0xe505('0x3e')](handleEntityNotFound(_0x5a7ce0,null))[_0xe505('0x3e')](saveUpdates(_0xf495a2[_0xe505('0x45')],null))['then'](respondWithResult(_0x5a7ce0,null))[_0xe505('0x40')](handleError(_0x5a7ce0,null));};exports[_0xe505('0x20')]=function(_0x249909,_0x320b41){return db[_0xe505('0x26')][_0xe505('0x43')]({'where':{'id':_0x249909[_0xe505('0x42')]['id']}})[_0xe505('0x3e')](handleEntityNotFound(_0x320b41,null))[_0xe505('0x3e')](removeEntity(_0x320b41,null))[_0xe505('0x40')](handleError(_0x320b41,null));}; \ No newline at end of file +var _0xf298=['status','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','filter','merge','includeAll','include','AnalyticTreeReport','findAll','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xfa0d6,_0x2feed0){var _0x543b26=function(_0x410d31){while(--_0x410d31){_0xfa0d6['push'](_0xfa0d6['shift']());}};_0x543b26(++_0x2feed0);}(_0xf298,0xf6));var _0x8f29=function(_0x42bdaf,_0x510fb2){_0x42bdaf=_0x42bdaf-0x0;var _0x96cc6b=_0xf298[_0x42bdaf];return _0x96cc6b;};'use strict';var emlformat=require(_0x8f29('0x0'));var rimraf=require(_0x8f29('0x1'));var zipdir=require(_0x8f29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f29('0x3'));var moment=require(_0x8f29('0x4'));var BPromise=require(_0x8f29('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8f29('0x6'));var csv=require(_0x8f29('0x7'));var ejs=require(_0x8f29('0x8'));var fs=require('fs');var fs_extra=require(_0x8f29('0x9'));var _=require(_0x8f29('0xa'));var squel=require('squel');var crypto=require(_0x8f29('0xb'));var jsforce=require(_0x8f29('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8f29('0xd'));var Papa=require(_0x8f29('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8f29('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8f29('0x10'));var utils=require(_0x8f29('0x11'));var config=require(_0x8f29('0x12'));var licenseUtil=require(_0x8f29('0x13'));var db=require(_0x8f29('0x14'))['db'];function respondWithStatusCode(_0x4ab8bb,_0xd636c6){_0xd636c6=_0xd636c6||0xcc;return function(_0x48a4d8){if(_0x48a4d8){return _0x4ab8bb[_0x8f29('0x15')](_0xd636c6);}return _0x4ab8bb[_0x8f29('0x16')](_0xd636c6)['end']();};}function respondWithResult(_0x36f34c,_0x49b891){_0x49b891=_0x49b891||0xc8;return function(_0x3771ba){if(_0x3771ba){return _0x36f34c[_0x8f29('0x16')](_0x49b891)['json'](_0x3771ba);}};}function respondWithFilteredResult(_0x386590,_0x10daa7){return function(_0xa882ba){if(_0xa882ba){var _0x1269ad=typeof _0x10daa7['offset']==='undefined'&&typeof _0x10daa7[_0x8f29('0x17')]===_0x8f29('0x18');var _0x4eb4f1=_0xa882ba[_0x8f29('0x19')];var _0x17906c=_0x1269ad?0x0:_0x10daa7['offset'];var _0x7fd74=_0x1269ad?_0xa882ba[_0x8f29('0x19')]:_0x10daa7['offset']+_0x10daa7[_0x8f29('0x17')];var _0x560960;if(_0x7fd74>=_0x4eb4f1){_0x7fd74=_0x4eb4f1;_0x560960=0xc8;}else{_0x560960=0xce;}_0x386590[_0x8f29('0x16')](_0x560960);return _0x386590[_0x8f29('0x1a')](_0x8f29('0x1b'),_0x17906c+'-'+_0x7fd74+'/'+_0x4eb4f1)[_0x8f29('0x1c')](_0xa882ba);}return null;};}function patchUpdates(_0x337f00){return function(_0x2aace8){try{jsonpatch[_0x8f29('0x1d')](_0x2aace8,_0x337f00,!![]);}catch(_0xd9672a){return BPromise[_0x8f29('0x1e')](_0xd9672a);}return _0x2aace8['save']();};}function saveUpdates(_0x5e418e,_0x1deecd){return function(_0x63abb7){if(_0x63abb7){return _0x63abb7[_0x8f29('0x1f')](_0x5e418e)['then'](function(_0x47df32){return _0x47df32;});}return null;};}function removeEntity(_0x4c9d6f,_0x3ff104){return function(_0x19135a){if(_0x19135a){return _0x19135a['destroy']()[_0x8f29('0x20')](function(){_0x4c9d6f[_0x8f29('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d77a2,_0xa52716){return function(_0x2bbe8b){if(!_0x2bbe8b){_0x4d77a2[_0x8f29('0x15')](0x194);}return _0x2bbe8b;};}function handleError(_0x1765e7,_0x430852){_0x430852=_0x430852||0x1f4;return function(_0x5809ef){logger[_0x8f29('0x21')](_0x5809ef[_0x8f29('0x22')]);if(_0x5809ef['name']){delete _0x5809ef[_0x8f29('0x23')];}_0x1765e7[_0x8f29('0x16')](_0x430852)[_0x8f29('0x24')](_0x5809ef);};}exports['index']=function(_0x28cb42,_0xd8d6ba){var _0x2f6c58={},_0x5f0a7d={},_0xe35d6e={'count':0x0,'rows':[]};var _0x3ea003=_[_0x8f29('0x25')](db['AnalyticTreeReport'][_0x8f29('0x26')],function(_0x7785c3){return{'name':_0x7785c3['fieldName'],'type':_0x7785c3[_0x8f29('0x27')]['key']};});_0x5f0a7d[_0x8f29('0x28')]=_['map'](_0x3ea003,_0x8f29('0x23'));_0x5f0a7d[_0x8f29('0x29')]=_[_0x8f29('0x2a')](_0x28cb42[_0x8f29('0x29')]);_0x5f0a7d['filters']=_[_0x8f29('0x2b')](_0x5f0a7d[_0x8f29('0x28')],_0x5f0a7d[_0x8f29('0x29')]);_0x2f6c58[_0x8f29('0x2c')]=_[_0x8f29('0x2b')](_0x5f0a7d[_0x8f29('0x28')],qs[_0x8f29('0x2d')](_0x28cb42[_0x8f29('0x29')]['fields']));_0x2f6c58[_0x8f29('0x2c')]=_0x2f6c58[_0x8f29('0x2c')][_0x8f29('0x2e')]?_0x2f6c58[_0x8f29('0x2c')]:_0x5f0a7d[_0x8f29('0x28')];if(!_0x28cb42['query']['hasOwnProperty'](_0x8f29('0x2f'))){_0x2f6c58[_0x8f29('0x17')]=qs[_0x8f29('0x17')](_0x28cb42['query']['limit']);_0x2f6c58[_0x8f29('0x30')]=qs[_0x8f29('0x30')](_0x28cb42[_0x8f29('0x29')][_0x8f29('0x30')]);}_0x2f6c58[_0x8f29('0x31')]=qs[_0x8f29('0x32')](_0x28cb42[_0x8f29('0x29')][_0x8f29('0x32')]);_0x2f6c58[_0x8f29('0x33')]=qs[_0x8f29('0x34')](_[_0x8f29('0x35')](_0x28cb42[_0x8f29('0x29')],_0x5f0a7d[_0x8f29('0x34')]),_0x3ea003);if(_0x28cb42[_0x8f29('0x29')][_0x8f29('0x36')]){_0x2f6c58[_0x8f29('0x33')]=_[_0x8f29('0x37')](_0x2f6c58[_0x8f29('0x33')],{'$or':_['map'](_0x3ea003,function(_0xf86c0c){if(_0xf86c0c['type']!=='VIRTUAL'){var _0x3cb183={};_0x3cb183[_0xf86c0c[_0x8f29('0x23')]]={'$like':'%'+_0x28cb42[_0x8f29('0x29')][_0x8f29('0x36')]+'%'};return _0x3cb183;}})});}_0x2f6c58=_[_0x8f29('0x37')]({},_0x2f6c58,_0x28cb42['options']);var _0x60980b={'where':_0x2f6c58[_0x8f29('0x33')]};return db['AnalyticTreeReport'][_0x8f29('0x19')](_0x60980b)[_0x8f29('0x20')](function(_0x4eefaf){_0xe35d6e['count']=_0x4eefaf;if(_0x28cb42[_0x8f29('0x29')][_0x8f29('0x38')]){_0x2f6c58[_0x8f29('0x39')]=[{'all':!![]}];}return db[_0x8f29('0x3a')][_0x8f29('0x3b')](_0x2f6c58);})[_0x8f29('0x20')](function(_0x3f20d2){_0xe35d6e['rows']=_0x3f20d2;return _0xe35d6e;})['then'](respondWithFilteredResult(_0xd8d6ba,_0x2f6c58))[_0x8f29('0x3c')](handleError(_0xd8d6ba,null));};exports[_0x8f29('0x3d')]=function(_0xfcbcff,_0x4bfa06){var _0x56f25b={'raw':!![],'where':{'id':_0xfcbcff[_0x8f29('0x3e')]['id']}},_0x3c8d6d={};_0x3c8d6d['model']=_[_0x8f29('0x2a')](db[_0x8f29('0x3a')][_0x8f29('0x26')]);_0x3c8d6d[_0x8f29('0x29')]=_[_0x8f29('0x2a')](_0xfcbcff[_0x8f29('0x29')]);_0x3c8d6d[_0x8f29('0x34')]=_[_0x8f29('0x2b')](_0x3c8d6d['model'],_0x3c8d6d[_0x8f29('0x29')]);_0x56f25b[_0x8f29('0x2c')]=_[_0x8f29('0x2b')](_0x3c8d6d[_0x8f29('0x28')],qs[_0x8f29('0x2d')](_0xfcbcff[_0x8f29('0x29')][_0x8f29('0x2d')]));_0x56f25b[_0x8f29('0x2c')]=_0x56f25b[_0x8f29('0x2c')][_0x8f29('0x2e')]?_0x56f25b['attributes']:_0x3c8d6d['model'];if(_0xfcbcff[_0x8f29('0x29')][_0x8f29('0x38')]){_0x56f25b['include']=[{'all':!![]}];}_0x56f25b=_[_0x8f29('0x37')]({},_0x56f25b,_0xfcbcff[_0x8f29('0x3f')]);return db[_0x8f29('0x3a')][_0x8f29('0x40')](_0x56f25b)['then'](handleEntityNotFound(_0x4bfa06,null))[_0x8f29('0x20')](respondWithResult(_0x4bfa06,null))[_0x8f29('0x3c')](handleError(_0x4bfa06,null));};exports['create']=function(_0x1d2a4b,_0x388601){return db[_0x8f29('0x3a')][_0x8f29('0x41')](_0x1d2a4b[_0x8f29('0x42')],{})[_0x8f29('0x20')](respondWithResult(_0x388601,0xc9))['catch'](handleError(_0x388601,null));};exports[_0x8f29('0x1f')]=function(_0x3fb6c7,_0x178e90){if(_0x3fb6c7['body']['id']){delete _0x3fb6c7['body']['id'];}return db[_0x8f29('0x3a')][_0x8f29('0x40')]({'where':{'id':_0x3fb6c7[_0x8f29('0x3e')]['id']}})['then'](handleEntityNotFound(_0x178e90,null))['then'](saveUpdates(_0x3fb6c7[_0x8f29('0x42')],null))[_0x8f29('0x20')](respondWithResult(_0x178e90,null))[_0x8f29('0x3c')](handleError(_0x178e90,null));};exports['destroy']=function(_0xace800,_0xdf0cd6){return db[_0x8f29('0x3a')][_0x8f29('0x40')]({'where':{'id':_0xace800[_0x8f29('0x3e')]['id']}})['then'](handleEntityNotFound(_0xdf0cd6,null))[_0x8f29('0x20')](removeEntity(_0xdf0cd6,null))[_0x8f29('0x3c')](handleError(_0xdf0cd6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index b0c45fb..c8ad5ed 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 _0x8944=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','util','../../config/logger','moment','bluebird'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x8944,0x193));var _0x4894=function(_0x2a5fdf,_0x29358d){_0x2a5fdf=_0x2a5fdf-0x0;var _0x40a66e=_0x8944[_0x2a5fdf];return _0x40a66e;};'use strict';var _=require('lodash');var util=require(_0x4894('0x0'));var logger=require(_0x4894('0x1'))('api');var moment=require(_0x4894('0x2'));var BPromise=require(_0x4894('0x3'));var rp=require(_0x4894('0x4'));var fs=require('fs');var path=require(_0x4894('0x5'));var rimraf=require(_0x4894('0x6'));var config=require(_0x4894('0x7'));var attributes=require(_0x4894('0x8'));module[_0x4894('0x9')]=function(_0x37cfb5,_0x4b594f){return _0x37cfb5[_0x4894('0xa')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8f3=['request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment'];(function(_0x33f34e,_0x4fde5b){var _0x58dc01=function(_0x36e155){while(--_0x36e155){_0x33f34e['push'](_0x33f34e['shift']());}};_0x58dc01(++_0x4fde5b);}(_0xb8f3,0xbe));var _0x3b8f=function(_0x3f4568,_0x9eb0ee){_0x3f4568=_0x3f4568-0x0;var _0xee2340=_0xb8f3[_0x3f4568];return _0xee2340;};'use strict';var _=require(_0x3b8f('0x0'));var util=require(_0x3b8f('0x1'));var logger=require(_0x3b8f('0x2'))(_0x3b8f('0x3'));var moment=require(_0x3b8f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3b8f('0x5'));var fs=require('fs');var path=require(_0x3b8f('0x6'));var rimraf=require(_0x3b8f('0x7'));var config=require('../../config/environment');var attributes=require(_0x3b8f('0x8'));module[_0x3b8f('0x9')]=function(_0x321272,_0x1dc460){return _0x321272[_0x3b8f('0xa')](_0x3b8f('0xb'),attributes,{'tableName':_0x3b8f('0xc'),'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 11b6fb0..7a43fdb 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(_0x21790c,_0x548045){var _0x518201=function(_0x308eb1){while(--_0x308eb1){_0x21790c['push'](_0x21790c['shift']());}};_0x518201(++_0x548045);}(_0x1261,0x144));var _0x1126=function(_0x3e8930,_0x154364){_0x3e8930=_0x3e8930-0x0;var _0x15b38f=_0x1261[_0x3e8930];return _0x15b38f;};'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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x367b96,_0x2bc5d5){var _0x19fd6e=function(_0x12681c){while(--_0x12681c){_0x367b96['push'](_0x367b96['shift']());}};_0x19fd6e(++_0x2bc5d5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x284609,_0x386b54){_0x284609=_0x284609-0x0;var _0x55116b=_0x5f2f[_0x284609];return _0x55116b;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 0b55aa3..72b3cc2 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 _0x6574=['../../config/environment','index','get','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x8bd9ad,_0x44a34d){var _0x492b04=function(_0x167e0b){while(--_0x167e0b){_0x8bd9ad['push'](_0x8bd9ad['shift']());}};_0x492b04(++_0x44a34d);}(_0x6574,0x13b));var _0x4657=function(_0x3a7fa1,_0x588bb8){_0x3a7fa1=_0x3a7fa1-0x0;var _0x23d89a=_0x6574[_0x3a7fa1];return _0x23d89a;};'use strict';var multer=require(_0x4657('0x0'));var util=require(_0x4657('0x1'));var path=require(_0x4657('0x2'));var timeout=require('connect-timeout');var express=require(_0x4657('0x3'));var router=express[_0x4657('0x4')]();var fs_extra=require(_0x4657('0x5'));var auth=require(_0x4657('0x6'));var interaction=require(_0x4657('0x7'));var config=require(_0x4657('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4657('0x9')]);router[_0x4657('0xa')](_0x4657('0xb'),auth[_0x4657('0xc')](),controller[_0x4657('0xd')]);router[_0x4657('0xe')]('/',auth[_0x4657('0xc')](),controller['create']);router[_0x4657('0xf')](_0x4657('0xb'),auth[_0x4657('0xc')](),controller[_0x4657('0x10')]);router[_0x4657('0x11')]('/:id',auth[_0x4657('0xc')](),controller['destroy']);module[_0x4657('0x12')]=router; \ No newline at end of file +var _0xc0a1=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','put','update','delete','destroy','exports'];(function(_0x4fd6d0,_0x55451a){var _0x2452de=function(_0x517b1a){while(--_0x517b1a){_0x4fd6d0['push'](_0x4fd6d0['shift']());}};_0x2452de(++_0x55451a);}(_0xc0a1,0x90));var _0x1c0a=function(_0xc31458,_0x45ee76){_0xc31458=_0xc31458-0x0;var _0x1b4a90=_0xc0a1[_0xc31458];return _0x1b4a90;};'use strict';var multer=require('multer');var util=require(_0x1c0a('0x0'));var path=require(_0x1c0a('0x1'));var timeout=require(_0x1c0a('0x2'));var express=require(_0x1c0a('0x3'));var router=express[_0x1c0a('0x4')]();var fs_extra=require(_0x1c0a('0x5'));var auth=require(_0x1c0a('0x6'));var interaction=require(_0x1c0a('0x7'));var config=require(_0x1c0a('0x8'));var controller=require(_0x1c0a('0x9'));router[_0x1c0a('0xa')]('/',auth[_0x1c0a('0xb')](),controller['index']);router[_0x1c0a('0xa')](_0x1c0a('0xc'),auth[_0x1c0a('0xb')](),controller['show']);router['post']('/',auth[_0x1c0a('0xb')](),controller['create']);router[_0x1c0a('0xd')](_0x1c0a('0xc'),auth['isAuthenticated'](),controller[_0x1c0a('0xe')]);router[_0x1c0a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x1c0a('0x10')]);module[_0x1c0a('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 138246a..5dfab70 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 _0x975f=['STRING','sequelize','exports'];(function(_0x211e31,_0x53b052){var _0x481218=function(_0x59a891){while(--_0x59a891){_0x211e31['push'](_0x211e31['shift']());}};_0x481218(++_0x53b052);}(_0x975f,0x109));var _0xf975=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x975f[_0x6173fc];return _0x965fbe;};'use strict';var Sequelize=require(_0xf975('0x0'));module[_0xf975('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf975('0x2')]}}; \ No newline at end of file +var _0x83f1=['STRING','sequelize','exports'];(function(_0xea86b9,_0x55f73f){var _0x340174=function(_0x5c6350){while(--_0x5c6350){_0xea86b9['push'](_0xea86b9['shift']());}};_0x340174(++_0x55f73f);}(_0x83f1,0x1cc));var _0x183f=function(_0x1c55ed,_0x485ab0){_0x1c55ed=_0x1c55ed-0x0;var _0x3174bd=_0x83f1[_0x1c55ed];return _0x3174bd;};'use strict';var Sequelize=require(_0x183f('0x0'));module[_0x183f('0x1')]={'name':{'type':Sequelize[_0x183f('0x2')]},'basename':{'type':Sequelize[_0x183f('0x2')]},'type':{'type':Sequelize[_0x183f('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 112fa1f..ad863b7 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 _0xb463=['send','map','Attachment','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','body','create','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','then','error','stack','name'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xb463,0xd7));var _0x3b46=function(_0x240c96,_0x3b09ea){_0x240c96=_0x240c96-0x0;var _0xefdc0f=_0xb463[_0x240c96];return _0xefdc0f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3b46('0x0'));var rp=require(_0x3b46('0x1'));var moment=require(_0x3b46('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3b46('0x3'));var util=require(_0x3b46('0x4'));var path=require(_0x3b46('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3b46('0x6'));var fs=require('fs');var fs_extra=require(_0x3b46('0x7'));var _=require(_0x3b46('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3b46('0x9'));var deskjs=require(_0x3b46('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3b46('0xb'));var authService=require(_0x3b46('0xc'));var qs=require(_0x3b46('0xd'));var as=require(_0x3b46('0xe'));var hardwareService=require(_0x3b46('0xf'));var logger=require(_0x3b46('0x10'))(_0x3b46('0x11'));var utils=require(_0x3b46('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3b46('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x567b6f,_0x53a787){_0x53a787=_0x53a787||0xcc;return function(_0x541c63){if(_0x541c63){return _0x567b6f[_0x3b46('0x14')](_0x53a787);}return _0x567b6f[_0x3b46('0x15')](_0x53a787)[_0x3b46('0x16')]();};}function respondWithResult(_0x50f75b,_0x2a3cd7){_0x2a3cd7=_0x2a3cd7||0xc8;return function(_0x4cc97d){if(_0x4cc97d){return _0x50f75b[_0x3b46('0x15')](_0x2a3cd7)[_0x3b46('0x17')](_0x4cc97d);}};}function respondWithFilteredResult(_0x41b43e,_0x334d1c){return function(_0x4ce6cc){if(_0x4ce6cc){var _0x4cfd61=typeof _0x334d1c[_0x3b46('0x18')]===_0x3b46('0x19')&&typeof _0x334d1c['limit']===_0x3b46('0x19');var _0x5a9e93=_0x4ce6cc[_0x3b46('0x1a')];var _0x4e40f4=_0x4cfd61?0x0:_0x334d1c[_0x3b46('0x18')];var _0x1fc012=_0x4cfd61?_0x4ce6cc['count']:_0x334d1c['offset']+_0x334d1c[_0x3b46('0x1b')];var _0x236764;if(_0x1fc012>=_0x5a9e93){_0x1fc012=_0x5a9e93;_0x236764=0xc8;}else{_0x236764=0xce;}_0x41b43e[_0x3b46('0x15')](_0x236764);return _0x41b43e['set']('Content-Range',_0x4e40f4+'-'+_0x1fc012+'/'+_0x5a9e93)[_0x3b46('0x17')](_0x4ce6cc);}return null;};}function patchUpdates(_0x3224f4){return function(_0x1893a2){try{jsonpatch[_0x3b46('0x1c')](_0x1893a2,_0x3224f4,!![]);}catch(_0x2942c3){return BPromise[_0x3b46('0x1d')](_0x2942c3);}return _0x1893a2[_0x3b46('0x1e')]();};}function saveUpdates(_0x1b69e0,_0x1b92fd){return function(_0x553944){if(_0x553944){return _0x553944[_0x3b46('0x1f')](_0x1b69e0)['then'](function(_0x44a060){return _0x44a060;});}return null;};}function removeEntity(_0x37c8cc,_0x19057d){return function(_0x9a219c){if(_0x9a219c){return _0x9a219c[_0x3b46('0x20')]()[_0x3b46('0x21')](function(){_0x37c8cc[_0x3b46('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18c9b5,_0x31e0a2){return function(_0x4692f8){if(!_0x4692f8){_0x18c9b5[_0x3b46('0x14')](0x194);}return _0x4692f8;};}function handleError(_0x2f9a40,_0x477dc6){_0x477dc6=_0x477dc6||0x1f4;return function(_0x34b423){logger[_0x3b46('0x22')](_0x34b423[_0x3b46('0x23')]);if(_0x34b423[_0x3b46('0x24')]){delete _0x34b423[_0x3b46('0x24')];}_0x2f9a40[_0x3b46('0x15')](_0x477dc6)[_0x3b46('0x25')](_0x34b423);};}exports['index']=function(_0x4a457a,_0x1acd6c){var _0x49dae0={},_0x242e24={},_0x2d6f9d={'count':0x0,'rows':[]};var _0x19b155=_[_0x3b46('0x26')](db[_0x3b46('0x27')][_0x3b46('0x28')],function(_0x4ba8a9){return{'name':_0x4ba8a9[_0x3b46('0x29')],'type':_0x4ba8a9[_0x3b46('0x2a')]['key']};});_0x242e24[_0x3b46('0x2b')]=_[_0x3b46('0x26')](_0x19b155,_0x3b46('0x24'));_0x242e24['query']=_[_0x3b46('0x2c')](_0x4a457a[_0x3b46('0x2d')]);_0x242e24[_0x3b46('0x2e')]=_[_0x3b46('0x2f')](_0x242e24['model'],_0x242e24['query']);_0x49dae0[_0x3b46('0x30')]=_[_0x3b46('0x2f')](_0x242e24['model'],qs[_0x3b46('0x31')](_0x4a457a[_0x3b46('0x2d')][_0x3b46('0x31')]));_0x49dae0['attributes']=_0x49dae0[_0x3b46('0x30')][_0x3b46('0x32')]?_0x49dae0['attributes']:_0x242e24['model'];if(!_0x4a457a[_0x3b46('0x2d')]['hasOwnProperty']('nolimit')){_0x49dae0['limit']=qs[_0x3b46('0x1b')](_0x4a457a[_0x3b46('0x2d')]['limit']);_0x49dae0[_0x3b46('0x18')]=qs[_0x3b46('0x18')](_0x4a457a[_0x3b46('0x2d')][_0x3b46('0x18')]);}_0x49dae0['order']=qs[_0x3b46('0x33')](_0x4a457a[_0x3b46('0x2d')]['sort']);_0x49dae0[_0x3b46('0x34')]=qs[_0x3b46('0x2e')](_[_0x3b46('0x35')](_0x4a457a['query'],_0x242e24['filters']),_0x19b155);if(_0x4a457a[_0x3b46('0x2d')][_0x3b46('0x36')]){_0x49dae0[_0x3b46('0x34')]=_[_0x3b46('0x37')](_0x49dae0[_0x3b46('0x34')],{'$or':_[_0x3b46('0x26')](_0x19b155,function(_0x348534){if(_0x348534[_0x3b46('0x2a')]!==_0x3b46('0x38')){var _0x1cbd89={};_0x1cbd89[_0x348534[_0x3b46('0x24')]]={'$like':'%'+_0x4a457a['query'][_0x3b46('0x36')]+'%'};return _0x1cbd89;}})});}_0x49dae0=_['merge']({},_0x49dae0,_0x4a457a[_0x3b46('0x39')]);var _0x3b334b={'where':_0x49dae0['where']};return db[_0x3b46('0x27')][_0x3b46('0x1a')](_0x3b334b)[_0x3b46('0x21')](function(_0xa316a9){_0x2d6f9d[_0x3b46('0x1a')]=_0xa316a9;if(_0x4a457a[_0x3b46('0x2d')][_0x3b46('0x3a')]){_0x49dae0[_0x3b46('0x3b')]=[{'all':!![]}];}return db['Attachment'][_0x3b46('0x3c')](_0x49dae0);})[_0x3b46('0x21')](function(_0x4fb708){_0x2d6f9d[_0x3b46('0x3d')]=_0x4fb708;return _0x2d6f9d;})[_0x3b46('0x21')](respondWithFilteredResult(_0x1acd6c,_0x49dae0))[_0x3b46('0x3e')](handleError(_0x1acd6c,null));};exports[_0x3b46('0x3f')]=function(_0x17941e,_0x4faf0f){var _0x5c275d={'raw':!![],'where':{'id':_0x17941e[_0x3b46('0x40')]['id']}},_0x2ba592={};_0x2ba592['model']=_[_0x3b46('0x2c')](db[_0x3b46('0x27')][_0x3b46('0x28')]);_0x2ba592[_0x3b46('0x2d')]=_[_0x3b46('0x2c')](_0x17941e[_0x3b46('0x2d')]);_0x2ba592[_0x3b46('0x2e')]=_['intersection'](_0x2ba592[_0x3b46('0x2b')],_0x2ba592[_0x3b46('0x2d')]);_0x5c275d['attributes']=_[_0x3b46('0x2f')](_0x2ba592[_0x3b46('0x2b')],qs['fields'](_0x17941e[_0x3b46('0x2d')]['fields']));_0x5c275d[_0x3b46('0x30')]=_0x5c275d[_0x3b46('0x30')]['length']?_0x5c275d['attributes']:_0x2ba592[_0x3b46('0x2b')];if(_0x17941e[_0x3b46('0x2d')][_0x3b46('0x3a')]){_0x5c275d[_0x3b46('0x3b')]=[{'all':!![]}];}_0x5c275d=_['merge']({},_0x5c275d,_0x17941e['options']);return db['Attachment'][_0x3b46('0x41')](_0x5c275d)[_0x3b46('0x21')](handleEntityNotFound(_0x4faf0f,null))[_0x3b46('0x21')](respondWithResult(_0x4faf0f,null))['catch'](handleError(_0x4faf0f,null));};exports[_0x3b46('0x42')]=function(_0x311d64,_0x2b1d9f){var _0x22ed80={'where':{'id':_0x311d64[_0x3b46('0x40')]['id']}},_0x4ced71={};_0x4ced71['model']=_[_0x3b46('0x2c')](db[_0x3b46('0x27')]['rawAttributes']);_0x22ed80[_0x3b46('0x30')]=_[_0x3b46('0x2f')](_0x4ced71[_0x3b46('0x2b')],qs[_0x3b46('0x31')](_0x311d64[_0x3b46('0x2d')][_0x3b46('0x31')]));_0x22ed80[_0x3b46('0x30')]=_0x22ed80[_0x3b46('0x30')][_0x3b46('0x32')]?_0x22ed80[_0x3b46('0x30')]:_0x4ced71[_0x3b46('0x2b')];if(_0x311d64[_0x3b46('0x2d')][_0x3b46('0x3a')]){_0x22ed80['include']=[{'all':!![]}];}_0x22ed80=_[_0x3b46('0x37')]({},_0x22ed80,_0x311d64['options']);return db[_0x3b46('0x27')]['find'](_0x22ed80)['then'](handleEntityNotFound(_0x2b1d9f,null))['then'](function(_0x37230d){if(_0x37230d){var _0x2f2799=_0x37230d[_0x3b46('0x43')]({'plain':!![]});_0x2f2799=qs[_0x3b46('0x44')](_0x2f2799,['id',_0x3b46('0x45'),'updatedAt']);_0x311d64[_0x3b46('0x46')]=_[_0x3b46('0x44')](_0x311d64[_0x3b46('0x46')],['id',_0x3b46('0x45'),'updatedAt']);return db[_0x3b46('0x27')][_0x3b46('0x47')](_[_0x3b46('0x37')](_0x2f2799,_0x311d64[_0x3b46('0x46')]),{'include':_0x311d64[_0x3b46('0x2d')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x3b46('0x21')](respondWithResult(_0x2b1d9f,0xc9))['catch'](handleError(_0x2b1d9f,null));};exports[_0x3b46('0x1f')]=function(_0x1c9e2c,_0x1e59a0){if(_0x1c9e2c[_0x3b46('0x46')]['id']){delete _0x1c9e2c[_0x3b46('0x46')]['id'];}return db[_0x3b46('0x27')][_0x3b46('0x41')]({'where':{'id':_0x1c9e2c[_0x3b46('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e59a0,null))[_0x3b46('0x21')](saveUpdates(_0x1c9e2c[_0x3b46('0x46')],null))[_0x3b46('0x21')](respondWithResult(_0x1e59a0,null))[_0x3b46('0x3e')](handleError(_0x1e59a0,null));};exports[_0x3b46('0x20')]=function(_0x444591,_0x297481){return db['Attachment'][_0x3b46('0x41')]({'where':{'id':_0x444591['params']['id']}})[_0x3b46('0x21')](handleEntityNotFound(_0x297481,null))[_0x3b46('0x21')](removeEntity(_0x297481,null))['catch'](handleError(_0x297481,null));};exports['create']=function(_0x455f7c,_0x4d4120,_0xdbf51c){_0x455f7c[_0x3b46('0x46')][_0x3b46('0x24')]=_0x455f7c[_0x3b46('0x48')][_0x3b46('0x49')];_0x455f7c[_0x3b46('0x46')]['basename']=_0x455f7c[_0x3b46('0x48')][_0x3b46('0x4a')];_0x455f7c[_0x3b46('0x46')]['type']=_0x455f7c[_0x3b46('0x48')][_0x3b46('0x4b')];return db[_0x3b46('0x27')][_0x3b46('0x47')](_0x455f7c[_0x3b46('0x46')])[_0x3b46('0x21')](respondWithResult(_0x4d4120,0xc9))[_0x3b46('0x3e')](handleError(_0x4d4120,null));};exports['download']=function(_0x3d6cf2,_0x4cdcc5,_0x259b6b){return db[_0x3b46('0x27')][_0x3b46('0x4c')]({'where':{'id':_0x3d6cf2[_0x3b46('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4cdcc5,null))[_0x3b46('0x21')](function(_0xf11d32){if(_0xf11d32){var _0x22e392=_0xf11d32[_0x3b46('0x4d')]!==null;var _0xcadf76=path['join'](config[_0x3b46('0x4e')],_0x3b46('0x4f'));if(_0x22e392){_0xcadf76=path[_0x3b46('0x50')](_0xcadf76,_0x3b46('0x51'));}var _0x29dc8e=path['join'](_0xcadf76,_0xf11d32[_0x3b46('0x52')]);return _0x4cdcc5[_0x3b46('0x53')](_0x29dc8e);}})[_0x3b46('0x3e')](handleError(_0x4cdcc5,null));}; \ No newline at end of file +var _0xc697=['filter','options','includeAll','include','catch','show','params','rawAttributes','clone','find','get','updatedAt','body','omit','createdAt','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','fast-json-patch','request-promise','moment','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','Attachment','fieldName','key','keys','filters','intersection','model','attributes','query','fields','length','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL'];(function(_0x4489b6,_0x47c466){var _0x13a4bb=function(_0x25092f){while(--_0x25092f){_0x4489b6['push'](_0x4489b6['shift']());}};_0x13a4bb(++_0x47c466);}(_0xc697,0xcd));var _0x7c69=function(_0x1ca099,_0x1a03c9){_0x1ca099=_0x1ca099-0x0;var _0x16e20d=_0xc697[_0x1ca099];return _0x16e20d;};'use strict';var emlformat=require(_0x7c69('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c69('0x1'));var rp=require(_0x7c69('0x2'));var moment=require(_0x7c69('0x3'));var BPromise=require(_0x7c69('0x4'));var Mustache=require(_0x7c69('0x5'));var util=require('util');var path=require(_0x7c69('0x6'));var sox=require(_0x7c69('0x7'));var csv=require(_0x7c69('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c69('0x9'));var squel=require(_0x7c69('0xa'));var crypto=require(_0x7c69('0xb'));var jsforce=require(_0x7c69('0xc'));var deskjs=require(_0x7c69('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7c69('0xe'));var Papa=require(_0x7c69('0xf'));var Redis=require(_0x7c69('0x10'));var authService=require(_0x7c69('0x11'));var qs=require(_0x7c69('0x12'));var as=require(_0x7c69('0x13'));var hardwareService=require(_0x7c69('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7c69('0x15'));var config=require(_0x7c69('0x16'));var licenseUtil=require(_0x7c69('0x17'));var db=require(_0x7c69('0x18'))['db'];function respondWithStatusCode(_0x113219,_0x4eea62){_0x4eea62=_0x4eea62||0xcc;return function(_0x3476c9){if(_0x3476c9){return _0x113219[_0x7c69('0x19')](_0x4eea62);}return _0x113219[_0x7c69('0x1a')](_0x4eea62)[_0x7c69('0x1b')]();};}function respondWithResult(_0x29a551,_0xdd1861){_0xdd1861=_0xdd1861||0xc8;return function(_0x5ac9c4){if(_0x5ac9c4){return _0x29a551[_0x7c69('0x1a')](_0xdd1861)[_0x7c69('0x1c')](_0x5ac9c4);}};}function respondWithFilteredResult(_0x7f1d73,_0x4e3a5f){return function(_0x5dfe2d){if(_0x5dfe2d){var _0x405d5d=typeof _0x4e3a5f[_0x7c69('0x1d')]===_0x7c69('0x1e')&&typeof _0x4e3a5f[_0x7c69('0x1f')]===_0x7c69('0x1e');var _0x471867=_0x5dfe2d[_0x7c69('0x20')];var _0x37a30e=_0x405d5d?0x0:_0x4e3a5f[_0x7c69('0x1d')];var _0x34323c=_0x405d5d?_0x5dfe2d['count']:_0x4e3a5f[_0x7c69('0x1d')]+_0x4e3a5f[_0x7c69('0x1f')];var _0x18a9f5;if(_0x34323c>=_0x471867){_0x34323c=_0x471867;_0x18a9f5=0xc8;}else{_0x18a9f5=0xce;}_0x7f1d73[_0x7c69('0x1a')](_0x18a9f5);return _0x7f1d73['set'](_0x7c69('0x21'),_0x37a30e+'-'+_0x34323c+'/'+_0x471867)[_0x7c69('0x1c')](_0x5dfe2d);}return null;};}function patchUpdates(_0x564e67){return function(_0x1658ea){try{jsonpatch[_0x7c69('0x22')](_0x1658ea,_0x564e67,!![]);}catch(_0xc0b66d){return BPromise[_0x7c69('0x23')](_0xc0b66d);}return _0x1658ea['save']();};}function saveUpdates(_0x29ce73,_0x310e67){return function(_0x542b24){if(_0x542b24){return _0x542b24['update'](_0x29ce73)[_0x7c69('0x24')](function(_0x5ad83c){return _0x5ad83c;});}return null;};}function removeEntity(_0x4f0cd3,_0x53fe2b){return function(_0x393a0c){if(_0x393a0c){return _0x393a0c[_0x7c69('0x25')]()[_0x7c69('0x24')](function(){_0x4f0cd3[_0x7c69('0x1a')](0xcc)[_0x7c69('0x1b')]();});}};}function handleEntityNotFound(_0x52b018,_0x208e12){return function(_0x21f0b0){if(!_0x21f0b0){_0x52b018[_0x7c69('0x19')](0x194);}return _0x21f0b0;};}function handleError(_0x22f2dd,_0x19bea4){_0x19bea4=_0x19bea4||0x1f4;return function(_0x158b4c){logger[_0x7c69('0x26')](_0x158b4c[_0x7c69('0x27')]);if(_0x158b4c[_0x7c69('0x28')]){delete _0x158b4c[_0x7c69('0x28')];}_0x22f2dd[_0x7c69('0x1a')](_0x19bea4)[_0x7c69('0x29')](_0x158b4c);};}exports['index']=function(_0x52b84b,_0x1a0b64){var _0x2944a7={},_0x3f1de6={},_0x40beb5={'count':0x0,'rows':[]};var _0x491e03=_['map'](db[_0x7c69('0x2a')]['rawAttributes'],function(_0x2ffe1a){return{'name':_0x2ffe1a[_0x7c69('0x2b')],'type':_0x2ffe1a['type'][_0x7c69('0x2c')]};});_0x3f1de6['model']=_['map'](_0x491e03,'name');_0x3f1de6['query']=_[_0x7c69('0x2d')](_0x52b84b['query']);_0x3f1de6[_0x7c69('0x2e')]=_[_0x7c69('0x2f')](_0x3f1de6[_0x7c69('0x30')],_0x3f1de6['query']);_0x2944a7[_0x7c69('0x31')]=_['intersection'](_0x3f1de6['model'],qs['fields'](_0x52b84b[_0x7c69('0x32')][_0x7c69('0x33')]));_0x2944a7['attributes']=_0x2944a7[_0x7c69('0x31')][_0x7c69('0x34')]?_0x2944a7[_0x7c69('0x31')]:_0x3f1de6[_0x7c69('0x30')];if(!_0x52b84b[_0x7c69('0x32')]['hasOwnProperty'](_0x7c69('0x35'))){_0x2944a7[_0x7c69('0x1f')]=qs['limit'](_0x52b84b['query'][_0x7c69('0x1f')]);_0x2944a7[_0x7c69('0x1d')]=qs[_0x7c69('0x1d')](_0x52b84b[_0x7c69('0x32')][_0x7c69('0x1d')]);}_0x2944a7[_0x7c69('0x36')]=qs['sort'](_0x52b84b[_0x7c69('0x32')][_0x7c69('0x37')]);_0x2944a7[_0x7c69('0x38')]=qs[_0x7c69('0x2e')](_[_0x7c69('0x39')](_0x52b84b['query'],_0x3f1de6[_0x7c69('0x2e')]),_0x491e03);if(_0x52b84b['query']['filter']){_0x2944a7[_0x7c69('0x38')]=_[_0x7c69('0x3a')](_0x2944a7['where'],{'$or':_[_0x7c69('0x3b')](_0x491e03,function(_0x44c7b8){if(_0x44c7b8[_0x7c69('0x3c')]!==_0x7c69('0x3d')){var _0x144a45={};_0x144a45[_0x44c7b8[_0x7c69('0x28')]]={'$like':'%'+_0x52b84b[_0x7c69('0x32')][_0x7c69('0x3e')]+'%'};return _0x144a45;}})});}_0x2944a7=_[_0x7c69('0x3a')]({},_0x2944a7,_0x52b84b[_0x7c69('0x3f')]);var _0x5de3={'where':_0x2944a7['where']};return db['Attachment']['count'](_0x5de3)[_0x7c69('0x24')](function(_0xff121a){_0x40beb5[_0x7c69('0x20')]=_0xff121a;if(_0x52b84b[_0x7c69('0x32')][_0x7c69('0x40')]){_0x2944a7[_0x7c69('0x41')]=[{'all':!![]}];}return db[_0x7c69('0x2a')]['findAll'](_0x2944a7);})[_0x7c69('0x24')](function(_0x2e4a04){_0x40beb5['rows']=_0x2e4a04;return _0x40beb5;})['then'](respondWithFilteredResult(_0x1a0b64,_0x2944a7))[_0x7c69('0x42')](handleError(_0x1a0b64,null));};exports[_0x7c69('0x43')]=function(_0x499a4a,_0x5c4cf1){var _0x369ea9={'raw':!![],'where':{'id':_0x499a4a[_0x7c69('0x44')]['id']}},_0x20e7d7={};_0x20e7d7['model']=_[_0x7c69('0x2d')](db['Attachment'][_0x7c69('0x45')]);_0x20e7d7['query']=_['keys'](_0x499a4a[_0x7c69('0x32')]);_0x20e7d7['filters']=_[_0x7c69('0x2f')](_0x20e7d7[_0x7c69('0x30')],_0x20e7d7[_0x7c69('0x32')]);_0x369ea9['attributes']=_[_0x7c69('0x2f')](_0x20e7d7[_0x7c69('0x30')],qs[_0x7c69('0x33')](_0x499a4a[_0x7c69('0x32')][_0x7c69('0x33')]));_0x369ea9[_0x7c69('0x31')]=_0x369ea9[_0x7c69('0x31')][_0x7c69('0x34')]?_0x369ea9[_0x7c69('0x31')]:_0x20e7d7[_0x7c69('0x30')];if(_0x499a4a['query'][_0x7c69('0x40')]){_0x369ea9['include']=[{'all':!![]}];}_0x369ea9=_[_0x7c69('0x3a')]({},_0x369ea9,_0x499a4a['options']);return db[_0x7c69('0x2a')]['find'](_0x369ea9)[_0x7c69('0x24')](handleEntityNotFound(_0x5c4cf1,null))[_0x7c69('0x24')](respondWithResult(_0x5c4cf1,null))[_0x7c69('0x42')](handleError(_0x5c4cf1,null));};exports[_0x7c69('0x46')]=function(_0x563b13,_0x50b906){var _0x4ef6ff={'where':{'id':_0x563b13[_0x7c69('0x44')]['id']}},_0x3f72f0={};_0x3f72f0[_0x7c69('0x30')]=_[_0x7c69('0x2d')](db['Attachment'][_0x7c69('0x45')]);_0x4ef6ff[_0x7c69('0x31')]=_[_0x7c69('0x2f')](_0x3f72f0[_0x7c69('0x30')],qs['fields'](_0x563b13['query'][_0x7c69('0x33')]));_0x4ef6ff['attributes']=_0x4ef6ff[_0x7c69('0x31')]['length']?_0x4ef6ff[_0x7c69('0x31')]:_0x3f72f0['model'];if(_0x563b13['query'][_0x7c69('0x40')]){_0x4ef6ff[_0x7c69('0x41')]=[{'all':!![]}];}_0x4ef6ff=_[_0x7c69('0x3a')]({},_0x4ef6ff,_0x563b13[_0x7c69('0x3f')]);return db[_0x7c69('0x2a')][_0x7c69('0x47')](_0x4ef6ff)[_0x7c69('0x24')](handleEntityNotFound(_0x50b906,null))[_0x7c69('0x24')](function(_0x442730){if(_0x442730){var _0x327fd7=_0x442730[_0x7c69('0x48')]({'plain':!![]});_0x327fd7=qs['omit'](_0x327fd7,['id','createdAt',_0x7c69('0x49')]);_0x563b13[_0x7c69('0x4a')]=_[_0x7c69('0x4b')](_0x563b13['body'],['id',_0x7c69('0x4c'),'updatedAt']);return db['Attachment']['create'](_[_0x7c69('0x3a')](_0x327fd7,_0x563b13[_0x7c69('0x4a')]),{'include':_0x563b13[_0x7c69('0x32')][_0x7c69('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x50b906,0xc9))[_0x7c69('0x42')](handleError(_0x50b906,null));};exports['update']=function(_0x375abd,_0x274384){if(_0x375abd[_0x7c69('0x4a')]['id']){delete _0x375abd['body']['id'];}return db[_0x7c69('0x2a')]['find']({'where':{'id':_0x375abd[_0x7c69('0x44')]['id']}})[_0x7c69('0x24')](handleEntityNotFound(_0x274384,null))['then'](saveUpdates(_0x375abd[_0x7c69('0x4a')],null))[_0x7c69('0x24')](respondWithResult(_0x274384,null))['catch'](handleError(_0x274384,null));};exports[_0x7c69('0x25')]=function(_0x3b587c,_0x23bcdc){return db['Attachment'][_0x7c69('0x47')]({'where':{'id':_0x3b587c[_0x7c69('0x44')]['id']}})['then'](handleEntityNotFound(_0x23bcdc,null))['then'](removeEntity(_0x23bcdc,null))[_0x7c69('0x42')](handleError(_0x23bcdc,null));};exports[_0x7c69('0x4d')]=function(_0x35bfde,_0xeb3a02,_0x4c7954){_0x35bfde['body']['name']=_0x35bfde[_0x7c69('0x4e')][_0x7c69('0x4f')];_0x35bfde[_0x7c69('0x4a')][_0x7c69('0x50')]=_0x35bfde[_0x7c69('0x4e')][_0x7c69('0x51')];_0x35bfde[_0x7c69('0x4a')][_0x7c69('0x3c')]=_0x35bfde['file'][_0x7c69('0x52')];return db[_0x7c69('0x2a')][_0x7c69('0x4d')](_0x35bfde[_0x7c69('0x4a')])[_0x7c69('0x24')](respondWithResult(_0xeb3a02,0xc9))[_0x7c69('0x42')](handleError(_0xeb3a02,null));};exports[_0x7c69('0x53')]=function(_0x33ccb8,_0x58e5f7,_0x4499a7){return db[_0x7c69('0x2a')][_0x7c69('0x54')]({'where':{'id':_0x33ccb8[_0x7c69('0x44')]['id']},'raw':!![]})[_0x7c69('0x24')](handleEntityNotFound(_0x58e5f7,null))['then'](function(_0x22669d){if(_0x22669d){var _0x5384c6=_0x22669d[_0x7c69('0x55')]!==null;var _0x5053ed=path[_0x7c69('0x56')](config['root'],_0x7c69('0x57'));if(_0x5384c6){_0x5053ed=path[_0x7c69('0x56')](_0x5053ed,_0x7c69('0x58'));}var _0x364fed=path[_0x7c69('0x56')](_0x5053ed,_0x22669d[_0x7c69('0x50')]);return _0x58e5f7[_0x7c69('0x53')](_0x364fed);}})[_0x7c69('0x42')](handleError(_0x58e5f7,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 9fab52a..bb8c4c9 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 _0x5463=['moment','path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x5463,0xc8));var _0x3546=function(_0x472ab3,_0x4c1c8f){_0x472ab3=_0x472ab3-0x0;var _0xa18704=_0x5463[_0x472ab3];return _0xa18704;};'use strict';var _=require(_0x3546('0x0'));var util=require(_0x3546('0x1'));var logger=require(_0x3546('0x2'))(_0x3546('0x3'));var moment=require(_0x3546('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3546('0x5'));var rimraf=require('rimraf');var config=require(_0x3546('0x6'));var attributes=require(_0x3546('0x7'));module[_0x3546('0x8')]=function(_0x1aa140,_0x4dacc7){return _0x1aa140[_0x3546('0x9')](_0x3546('0xa'),attributes,{'tableName':_0x3546('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x089a=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','attachments'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x089a,0x174));var _0xa089=function(_0x492707,_0x3e65dd){_0x492707=_0x492707-0x0;var _0x299c4d=_0x089a[_0x492707];return _0x299c4d;};'use strict';var _=require(_0xa089('0x0'));var util=require(_0xa089('0x1'));var logger=require(_0xa089('0x2'))('api');var moment=require(_0xa089('0x3'));var BPromise=require(_0xa089('0x4'));var rp=require(_0xa089('0x5'));var fs=require('fs');var path=require(_0xa089('0x6'));var rimraf=require('rimraf');var config=require(_0xa089('0x7'));var attributes=require(_0xa089('0x8'));module[_0xa089('0x9')]=function(_0x110ffa,_0x56cb50){return _0x110ffa[_0xa089('0xa')]('Attachment',attributes,{'tableName':_0xa089('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 2b481a4..6e28688 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 _0xde2c=['raw','stringify','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Attachment','create','body','options'];(function(_0x29c493,_0x55f019){var _0x58b033=function(_0x7dcb05){while(--_0x7dcb05){_0x29c493['push'](_0x29c493['shift']());}};_0x58b033(++_0x55f019);}(_0xde2c,0x7f));var _0xcde2=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0xde2c[_0x31abee];return _0x3c1761;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('Attachment,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});}exports['CreateAttachment']=function(_0x4fd5aa){var _0x4fe586=this;return new Promise(function(_0x2b4468,_0x582e84){return db[_0xcde2('0x18')][_0xcde2('0x19')](_0x4fd5aa[_0xcde2('0x1a')],{'raw':_0x4fd5aa['options']?_0x4fd5aa[_0xcde2('0x1b')][_0xcde2('0x1c')]===undefined?!![]:![]:!![]})[_0xcde2('0xd')](function(_0x3c1d7e){logger[_0xcde2('0x15')]('CreateAttachment',_0x4fd5aa);logger['debug']('CreateAttachment',_0x4fd5aa,JSON[_0xcde2('0x1d')](_0x3c1d7e));_0x2b4468(_0x3c1d7e);})[_0xcde2('0x17')](function(_0x2c9562){logger[_0xcde2('0x12')](_0xcde2('0x1e'),_0x2c9562['message'],_0x4fd5aa);_0x582e84(_0x4fe586[_0xcde2('0x12')](0x1f4,_0x2c9562['message']));});});}; \ No newline at end of file +var _0xc964=['request\x20sent','stringify','error','Attachment,\x20%s,\x20%s','message','result','Attachment','create','body','options','raw','then','catch','CreateAttachment','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x268d8b,_0xde6a32){var _0x4ee10b=function(_0x10fd20){while(--_0x10fd20){_0x268d8b['push'](_0x268d8b['shift']());}};_0x4ee10b(++_0xde6a32);}(_0xc964,0x7e));var _0x4c96=function(_0x37c648,_0x3f1fe7){_0x37c648=_0x37c648-0x0;var _0x57fb7a=_0xc964[_0x37c648];return _0x57fb7a;};'use strict';var _=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var moment=require('moment');var BPromise=require(_0x4c96('0x2'));var rs=require(_0x4c96('0x3'));var fs=require('fs');var Redis=require(_0x4c96('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c96('0x5'));var logger=require('../../config/logger')(_0x4c96('0x6'));var config=require(_0x4c96('0x7'));var jayson=require(_0x4c96('0x8'));var client=jayson[_0x4c96('0x9')][_0x4c96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fa8a0,_0x4070a5,_0x493618){return new BPromise(function(_0x19ed76,_0xaa3f20){return client[_0x4c96('0xb')](_0x1fa8a0,_0x493618)['then'](function(_0x208911){logger[_0x4c96('0xc')]('Attachment,\x20%s,\x20%s',_0x4070a5,'request\x20sent');logger['debug'](_0x4c96('0xd'),_0x4070a5,_0x4c96('0xe'),JSON[_0x4c96('0xf')](_0x208911));if(_0x208911['error']){if(_0x208911[_0x4c96('0x10')]['code']===0x1f4){logger['error'](_0x4c96('0x11'),_0x4070a5,_0x208911[_0x4c96('0x10')][_0x4c96('0x12')]);return _0xaa3f20(_0x208911['error']['message']);}logger[_0x4c96('0x10')](_0x4c96('0x11'),_0x4070a5,_0x208911[_0x4c96('0x10')]['message']);return _0x19ed76(_0x208911[_0x4c96('0x10')][_0x4c96('0x12')]);}else{logger[_0x4c96('0xc')](_0x4c96('0x11'),_0x4070a5,_0x4c96('0xe'));_0x19ed76(_0x208911[_0x4c96('0x13')][_0x4c96('0x12')]);}})['catch'](function(_0x388237){logger['error'](_0x4c96('0x11'),_0x4070a5,_0x388237);_0xaa3f20(_0x388237);});});}exports['CreateAttachment']=function(_0x2453e0){var _0x494a26=this;return new Promise(function(_0x17891b,_0x1807b6){return db[_0x4c96('0x14')][_0x4c96('0x15')](_0x2453e0[_0x4c96('0x16')],{'raw':_0x2453e0[_0x4c96('0x17')]?_0x2453e0[_0x4c96('0x17')][_0x4c96('0x18')]===undefined?!![]:![]:!![]})[_0x4c96('0x19')](function(_0x9546c5){logger[_0x4c96('0xc')]('CreateAttachment',_0x2453e0);logger['debug']('CreateAttachment',_0x2453e0,JSON[_0x4c96('0xf')](_0x9546c5));_0x17891b(_0x9546c5);})[_0x4c96('0x1a')](function(_0x29f3a3){logger[_0x4c96('0x10')](_0x4c96('0x1b'),_0x29f3a3[_0x4c96('0x12')],_0x2453e0);_0x1807b6(_0x494a26['error'](0x1f4,_0x29f3a3[_0x4c96('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 463349f..b2fa122 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1622a0,_0x2b55a9){_0x1622a0=_0x1622a0-0x0;var _0x2a2308=_0x0b0e[_0x1622a0];return _0x2a2308;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 60784c8..f24ac56 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 _0x16a8=['ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','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','findOne','adSsoEnabled','blockDuration','then','name','password','role','disabled','blocked','blockedAt','online','admin','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','login'];(function(_0x24f0a6,_0x54b95b){var _0x1023b9=function(_0x3aa1fb){while(--_0x3aa1fb){_0x24f0a6['push'](_0x24f0a6['shift']());}};_0x1023b9(++_0x54b95b);}(_0x16a8,0x1db));var _0x816a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x16a8[_0x3ab51d];return _0x29a04e;};'use strict';var passport=require(_0x816a('0x0'));var LocalStrategy=require(_0x816a('0x1'))[_0x816a('0x2')];var moment=require(_0x816a('0x3'));var ActiveDirectory=require(_0x816a('0x4'));var BPromise=require(_0x816a('0x5'));var util=require(_0x816a('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x816a('0x7'));var utils=require(_0x816a('0x8'));var config=require(_0x816a('0x9'));var logger=require('../../config/logger')(_0x816a('0xa'));function isActiveDirectoryConfigured(_0x575a8b){var _0x58a685=![];if(typeof _0x575a8b[_0x816a('0xb')]!==_0x816a('0xc')){_0x58a685=_0x575a8b[_0x816a('0xb')][_0x816a('0xd')]&&_0x575a8b['activedirectory'][_0x816a('0xe')]&&_0x575a8b['activedirectory'][_0x816a('0xf')];}return _0x58a685;}function adAuthenticate(_0xd79192,_0x5e518a,_0xfef10b){return new BPromise(function(_0x589c39,_0xab0edd){try{var _0x19e521=new ActiveDirectory(_0xd79192);_0x19e521['authenticate'](_0x5e518a,_0xfef10b,function(_0x254d51,_0x3eb2af){if(_0x254d51){logger[_0x816a('0x10')](_0x816a('0x11'),_0x5e518a,util[_0x816a('0x12')](_0x254d51,{'showHidden':![],'depth':null}));_0xab0edd(_0x816a('0x13'));}else if(!_0x3eb2af){logger[_0x816a('0x10')](_0x816a('0x14'),_0x5e518a);_0xab0edd('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x589c39(_0x3eb2af);}});}catch(_0x4e1a15){_0xab0edd(_0x4e1a15);}});}function ActiveDirectoryAuthenticate(_0x11fb8f,_0x2760ab,_0xe02be5,_0x22869b){var _0x49ee45,_0x4c5b9e;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2760ab);return _0x22869b(null,![],{'message':_0x816a('0x13')});}return db['Setting'][_0x816a('0x15')]({'where':{'id':0x1},'attributes':[_0x816a('0x16'),_0x816a('0x17')],'raw':!![]})[_0x816a('0x18')](function(_0xf52145){_0x49ee45=_0xf52145;if(!_0x49ee45[_0x816a('0x16')]){logger[_0x816a('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x2760ab);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x11fb8f[_0x816a('0x15')]({'attributes':['id',_0x816a('0x19'),_0x816a('0x1a'),'salt',_0x816a('0x1b'),_0x816a('0x1c'),_0x816a('0x1d'),_0x816a('0x1e'),_0x816a('0x1f')],'where':{'name':_0x2760ab,'role':{'$or':[_0x816a('0x20'),'user',_0x816a('0x21')]},'adSsoEnabled':!![]}});})[_0x816a('0x18')](function(_0x8b0706){if(!_0x8b0706||_0x8b0706&&_0x8b0706[_0x816a('0x19')]!==_0x2760ab){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x4c5b9e=_0x8b0706;var _0x41ee07=_0x4c5b9e['name']+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x816a('0xb')],_0x41ee07,_0xe02be5);})[_0x816a('0x18')](function(_0x4f2a4e){if(_0x4c5b9e['disabled']){throw new Error(_0x816a('0x13'));}if(_0x49ee45[_0x816a('0x17')]>0x0){if(_0x4c5b9e[_0x816a('0x1d')]){if(moment(_0x4c5b9e[_0x816a('0x1e')])[_0x816a('0x22')](_0x49ee45['blockDuration'],_0x816a('0x23'))>moment()){throw new Error(_0x816a('0x13'));}return utils[_0x816a('0x24')](_0x4c5b9e,0x0,![],null)[_0x816a('0x18')](function(){return utils['getLicense'](_0x4c5b9e);})[_0x816a('0x18')](function(){return _0x22869b(null,_0x4c5b9e);});}else{return utils[_0x816a('0x25')](_0x4c5b9e)[_0x816a('0x18')](function(){return _0x22869b(null,_0x4c5b9e);});}}else{return utils[_0x816a('0x25')](_0x4c5b9e)[_0x816a('0x18')](function(){return _0x22869b(null,_0x4c5b9e);});}})[_0x816a('0x26')](function(_0x42cf11){return _0x22869b(null,![],_0x42cf11);});}function handleError(_0x197110,_0x100a78,_0x46a7e6){return _0x197110[_0x816a('0x27')](_0x100a78||0x1f4)[_0x816a('0x28')]({'message':_0x46a7e6?_0x46a7e6['message']||_0x46a7e6:''});}exports[_0x816a('0x29')]=function(_0x581896,_0x2d2d23,_0x1e45f0){passport['authenticate'](_0x816a('0x2a'),function(_0x4c6720,_0x3f0e8f,_0x2a1757){var _0x3e0ea9=_0x4c6720||_0x2a1757;if(_0x3e0ea9){return handleError(_0x2d2d23,0x191,_0x3e0ea9);}if(!_0x3f0e8f){return handleError(_0x2d2d23,0x194,{'message':_0x816a('0x2b')});}else{var _0x48ae3e={'payload':{'id':_0x3f0e8f['id'],'role':_0x3f0e8f[_0x816a('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x816a('0x2c')](_0x48ae3e)[_0x816a('0x18')](function(_0x5ecf3e){_0x2d2d23['json']({'id':_0x3f0e8f['id'],'token':_0x5ecf3e,'statusCall':'','isAlreadyLogged':_0x3f0e8f[_0x816a('0x1f')]});});}})(_0x581896,_0x2d2d23,_0x1e45f0);};passport[_0x816a('0x2d')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x816a('0x1a')},function(_0x404b12,_0x5b1158,_0x404f27){return ActiveDirectoryAuthenticate(db[_0x816a('0x2e')],_0x404b12,_0x5b1158,_0x404f27);})); \ No newline at end of file +var _0xd966=['blockedAt','online','admin','user','agent','then','getLicense','catch','status','send','login','ad-login','use','passport-local','moment','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','url','domain','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked'];(function(_0x4f0b31,_0x2ffd23){var _0x202c4f=function(_0x287fbb){while(--_0x287fbb){_0x4f0b31['push'](_0x4f0b31['shift']());}};_0x202c4f(++_0x2ffd23);}(_0xd966,0xad));var _0x6d96=function(_0x34365b,_0x418c5a){_0x34365b=_0x34365b-0x0;var _0x12d73a=_0xd966[_0x34365b];return _0x12d73a;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x6d96('0x0'))['Strategy'];var moment=require(_0x6d96('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x6d96('0x2'));var util=require('util');var db=require(_0x6d96('0x3'))['db'];var authService=require(_0x6d96('0x4'));var utils=require(_0x6d96('0x5'));var config=require(_0x6d96('0x6'));var logger=require(_0x6d96('0x7'))('api');function isActiveDirectoryConfigured(_0x198db2){var _0x49f13a=![];if(typeof _0x198db2['activedirectory']!==_0x6d96('0x8')){_0x49f13a=_0x198db2[_0x6d96('0x9')][_0x6d96('0xa')]&&_0x198db2['activedirectory'][_0x6d96('0xb')]&&_0x198db2[_0x6d96('0x9')][_0x6d96('0xc')];}return _0x49f13a;}function adAuthenticate(_0x5dcefc,_0x5da8e1,_0x144ba9){return new BPromise(function(_0x5dde43,_0x5e05ca){try{var _0x2d3ec4=new ActiveDirectory(_0x5dcefc);_0x2d3ec4[_0x6d96('0xd')](_0x5da8e1,_0x144ba9,function(_0xd90bf2,_0x4c7535){if(_0xd90bf2){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x5da8e1,util['inspect'](_0xd90bf2,{'showHidden':![],'depth':null}));_0x5e05ca('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x4c7535){logger[_0x6d96('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5da8e1);_0x5e05ca(_0x6d96('0xf'));}else{_0x5dde43(_0x4c7535);}});}catch(_0x581ae8){_0x5e05ca(_0x581ae8);}});}function ActiveDirectoryAuthenticate(_0x3c4008,_0x487be5,_0x1f500f,_0x3f7509){var _0x18b257,_0x189cb2;if(!isActiveDirectoryConfigured(config)){logger[_0x6d96('0xe')](_0x6d96('0x10'),_0x487be5);return _0x3f7509(null,![],{'message':_0x6d96('0xf')});}return db[_0x6d96('0x11')][_0x6d96('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x6d96('0x13')],'raw':!![]})['then'](function(_0x2fe330){_0x18b257=_0x2fe330;if(!_0x18b257[_0x6d96('0x14')]){logger['error'](_0x6d96('0x15'),_0x487be5);throw new Error(_0x6d96('0xf'));}return _0x3c4008['findOne']({'attributes':['id',_0x6d96('0x16'),_0x6d96('0x17'),'salt',_0x6d96('0x18'),_0x6d96('0x19'),_0x6d96('0x1a'),_0x6d96('0x1b'),_0x6d96('0x1c')],'where':{'name':_0x487be5,'role':{'$or':[_0x6d96('0x1d'),_0x6d96('0x1e'),_0x6d96('0x1f')]},'adSsoEnabled':!![]}});})[_0x6d96('0x20')](function(_0x1662f1){if(!_0x1662f1||_0x1662f1&&_0x1662f1[_0x6d96('0x16')]!==_0x487be5){throw new Error(_0x6d96('0xf'));}_0x189cb2=_0x1662f1;var _0x243b1d=_0x189cb2['name']+'@'+config[_0x6d96('0x9')][_0x6d96('0xc')];return adAuthenticate(config[_0x6d96('0x9')],_0x243b1d,_0x1f500f);})[_0x6d96('0x20')](function(_0x59f267){if(_0x189cb2['disabled']){throw new Error(_0x6d96('0xf'));}if(_0x18b257['blockDuration']>0x0){if(_0x189cb2[_0x6d96('0x1a')]){if(moment(_0x189cb2[_0x6d96('0x1b')])['add'](_0x18b257[_0x6d96('0x13')],'minutes')>moment()){throw new Error(_0x6d96('0xf'));}return utils['clearBlockUser'](_0x189cb2,0x0,![],null)['then'](function(){return utils['getLicense'](_0x189cb2);})['then'](function(){return _0x3f7509(null,_0x189cb2);});}else{return utils[_0x6d96('0x21')](_0x189cb2)[_0x6d96('0x20')](function(){return _0x3f7509(null,_0x189cb2);});}}else{return utils[_0x6d96('0x21')](_0x189cb2)[_0x6d96('0x20')](function(){return _0x3f7509(null,_0x189cb2);});}})[_0x6d96('0x22')](function(_0x9ceac7){return _0x3f7509(null,![],_0x9ceac7);});}function handleError(_0x1c299f,_0x2849e7,_0x3d36ca){return _0x1c299f[_0x6d96('0x23')](_0x2849e7||0x1f4)[_0x6d96('0x24')]({'message':_0x3d36ca?_0x3d36ca['message']||_0x3d36ca:''});}exports[_0x6d96('0x25')]=function(_0x2d8ae1,_0x4ebbed,_0x5500bf){passport['authenticate'](_0x6d96('0x26'),function(_0x48c9ce,_0x163a65,_0x5aacda){var _0x1e226d=_0x48c9ce||_0x5aacda;if(_0x1e226d){return handleError(_0x4ebbed,0x191,_0x1e226d);}if(!_0x163a65){return handleError(_0x4ebbed,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x414ec9={'payload':{'id':_0x163a65['id'],'role':_0x163a65['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x414ec9)['then'](function(_0x1a85c3){_0x4ebbed['json']({'id':_0x163a65['id'],'token':_0x1a85c3,'statusCall':'','isAlreadyLogged':_0x163a65[_0x6d96('0x1c')]});});}})(_0x2d8ae1,_0x4ebbed,_0x5500bf);};passport[_0x6d96('0x27')](_0x6d96('0x26'),new LocalStrategy({'usernameField':'name','passwordField':_0x6d96('0x17')},function(_0x193a56,_0x19a511,_0x423f82){return ActiveDirectoryAuthenticate(db['User'],_0x193a56,_0x19a511,_0x423f82);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 3e37f46..4e16ed0 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 _0x23f0=['express','Router','post','login','exports'];(function(_0x1cffe2,_0x5383e8){var _0x57030e=function(_0xe9c73f){while(--_0xe9c73f){_0x1cffe2['push'](_0x1cffe2['shift']());}};_0x57030e(++_0x5383e8);}(_0x23f0,0x113));var _0x023f=function(_0x3e7428,_0x489914){_0x3e7428=_0x3e7428-0x0;var _0x51557d=_0x23f0[_0x3e7428];return _0x51557d;};'use strict';var express=require(_0x023f('0x0'));var router=express[_0x023f('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x023f('0x2')]('/',controller[_0x023f('0x3')]);module[_0x023f('0x4')]=router; \ No newline at end of file +var _0x109c=['post','login','exports','Router','./authActiveDirectory.controller'];(function(_0x1b6e9c,_0xb7dc58){var _0x101b7c=function(_0xaa159c){while(--_0xaa159c){_0x1b6e9c['push'](_0x1b6e9c['shift']());}};_0x101b7c(++_0xb7dc58);}(_0x109c,0xda));var _0xc109=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x109c[_0x397e5f];return _0x5302b8;};'use strict';var express=require('express');var router=express[_0xc109('0x0')]();var controller=require(_0xc109('0x1'));router[_0xc109('0x2')]('/',controller[_0xc109('0x3')]);module[_0xc109('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index a7b3e73..49d7662 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x7a54,0x106));var _0x47a5=function(_0x1d4435,_0x3b08c4){_0x1d4435=_0x1d4435-0x0;var _0x2f4dd3=_0x7a54[_0x1d4435];return _0x2f4dd3;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x411e96,_0x3f7c9a){var _0x87b13c=function(_0x3f1421){while(--_0x3f1421){_0x411e96['push'](_0x411e96['shift']());}};_0x87b13c(++_0x3f7c9a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 28d5315..126b3a2 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 _0x88c9=['isMiddleware','login','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback'];(function(_0x3f3ae9,_0x46b55c){var _0x2700d4=function(_0x227480){while(--_0x227480){_0x3f3ae9['push'](_0x3f3ae9['shift']());}};_0x2700d4(++_0x46b55c);}(_0x88c9,0x1f2));var _0x988c=function(_0x34f244,_0x1e332b){_0x34f244=_0x34f244-0x0;var _0x37ccdb=_0x88c9[_0x34f244];return _0x37ccdb;};'use strict';var express=require(_0x988c('0x0'));var passport=require(_0x988c('0x1'));var router=express[_0x988c('0x2')]();var controller=require(_0x988c('0x3'));var userController=require(_0x988c('0x4'));var authService=require('../../components/auth/service');router[_0x988c('0x5')]('/',controller['login']);router['get'](_0x988c('0x6'),controller[_0x988c('0x7')],authService[_0x988c('0x8')],userController[_0x988c('0x9')],authService[_0x988c('0xa')]);module['exports']=router; \ No newline at end of file +var _0xae1c=['isMiddleware','setTokenCookie','exports','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x374a2c,_0x4563cc){var _0x2811a2=function(_0x182761){while(--_0x182761){_0x374a2c['push'](_0x374a2c['shift']());}};_0x2811a2(++_0x4563cc);}(_0xae1c,0xff));var _0xcae1=function(_0x18fbcc,_0x3a3020){_0x18fbcc=_0x18fbcc-0x0;var _0x609604=_0xae1c[_0x18fbcc];return _0x609604;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xcae1('0x0'));var authService=require(_0xcae1('0x1'));router[_0xcae1('0x2')]('/',controller[_0xcae1('0x3')]);router[_0xcae1('0x2')](_0xcae1('0x4'),controller[_0xcae1('0x5')],authService[_0xcae1('0x6')],userController[_0xcae1('0x3')],authService[_0xcae1('0x7')]);module[_0xcae1('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 64029af..97f048a 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 _0x2bbf=['\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','body','Email\x20parameter\x20is\x20missing','generate','email','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','resetPasswordExpires','save','status','Password\x20reset!','use','local-login','User','passport','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','blocked','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','blockedAt','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2bbf,0x1cb));var _0xf2bb=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x2bbf[_0x4b055c];return _0x4b62bb;};'use strict';var util=require('util');var passport=require(_0xf2bb('0x0'));var LocalStrategy=require(_0xf2bb('0x1'))[_0xf2bb('0x2')];var jayson=require('jayson/promise');var _=require(_0xf2bb('0x3'));var rs=require(_0xf2bb('0x4'));var moment=require('moment');var db=require(_0xf2bb('0x5'))['db'];var authService=require(_0xf2bb('0x6'));var utils=require(_0xf2bb('0x7'));var client=jayson['client'][_0xf2bb('0x8')]({'port':0x232b});function localAuthenticate(_0x3ab3b9,_0x268e6b,_0x3f2398,_0x4f4211){var _0x4d6f2b,_0x3d7d3c;return db[_0xf2bb('0x9')][_0xf2bb('0xa')]({'where':{'id':0x1},'attributes':[_0xf2bb('0xb'),'blockDuration'],'raw':!![]})[_0xf2bb('0xc')](function(_0x481b2c){_0x4d6f2b=_0x481b2c;return _0x3ab3b9[_0xf2bb('0xa')]({'attributes':['id',_0xf2bb('0xd'),_0xf2bb('0xe'),_0xf2bb('0xf'),_0xf2bb('0x10'),'disabled',_0xf2bb('0x11'),'blockedAt',_0xf2bb('0x12')],'where':{'name':_0x268e6b,'role':{'$or':[_0xf2bb('0x13'),_0xf2bb('0x14'),'agent']}}});})['then'](function(_0x47769e){if(!_0x47769e||_0x47769e&&_0x47769e[_0xf2bb('0xd')]!==_0x268e6b){throw new Error(_0xf2bb('0x15'));}else{_0x3d7d3c=_0x47769e;return _0x3d7d3c;}})[_0xf2bb('0xc')](function(){_0x3d7d3c[_0xf2bb('0x16')](_0x3f2398,function(_0x143ae8,_0xf0f3f5){var _0x5425d1=_0x3d7d3c[_0xf2bb('0x12')]+0x1;if(_0x143ae8){return _0x4f4211(_0x143ae8);}else if(!_0xf0f3f5){if(_0x3d7d3c[_0xf2bb('0x17')]){return _0x4f4211(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4d6f2b[_0xf2bb('0xb')]>0x0){if(_0x3d7d3c[_0xf2bb('0x11')]){if(_0x4d6f2b[_0xf2bb('0x18')]>0x0){if(moment(_0x3d7d3c[_0xf2bb('0x19')])[_0xf2bb('0x1a')](_0x4d6f2b[_0xf2bb('0x18')],'minutes')>moment()){return _0x4f4211(null,![],{'message':_0xf2bb('0x15')});}else{return utils['clearBlockUser'](_0x3d7d3c,_0x5425d1,![],null)['then'](function(){return _0x4f4211(null,![],{'message':_0xf2bb('0x15')});});}}else{return _0x4f4211(null,![],{'message':_0xf2bb('0x15')});}}else{if(_0x5425d1>=_0x4d6f2b[_0xf2bb('0xb')]){return utils[_0xf2bb('0x1b')](_0x3d7d3c,0x0,!![],moment())[_0xf2bb('0xc')](function(){return _0x4f4211(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf2bb('0x1b')](_0x3d7d3c,_0x5425d1,![],null)[_0xf2bb('0xc')](function(){return _0x4f4211(null,![],{'message':_0xf2bb('0x15')});});}}}else{return _0x4f4211(null,![],{'message':_0xf2bb('0x15')});}}else{if(_0x3d7d3c['disabled']){return _0x4f4211(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4d6f2b[_0xf2bb('0xb')]>0x0){if(_0x3d7d3c[_0xf2bb('0x11')]){if(_0x4d6f2b[_0xf2bb('0x18')]>0x0){if(moment(_0x3d7d3c[_0xf2bb('0x19')])[_0xf2bb('0x1a')](_0x4d6f2b[_0xf2bb('0x18')],_0xf2bb('0x1c'))>moment()){return _0x4f4211(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf2bb('0x1b')](_0x3d7d3c,0x0,![],null)[_0xf2bb('0xc')](function(){return utils[_0xf2bb('0x1d')](_0x3d7d3c);})['then'](function(){return _0x4f4211(null,_0x3d7d3c);});}}else{return _0x4f4211(null,![],{'message':_0xf2bb('0x15')});}}else{return utils[_0xf2bb('0x1b')](_0x3d7d3c,0x0,![],null)['then'](function(){return utils[_0xf2bb('0x1d')](_0x3d7d3c);})[_0xf2bb('0xc')](function(){return _0x4f4211(null,_0x3d7d3c);})[_0xf2bb('0x1e')](function(_0x1770fa){return _0x4f4211(null,![],_0x1770fa);});}}else{if(_0x3d7d3c[_0xf2bb('0x11')]){return _0x4f4211(null,![],{'message':_0xf2bb('0x15')});}else{return utils['getLicense'](_0x3d7d3c)['then'](function(){return _0x4f4211(null,_0x3d7d3c);});}}}});})['catch'](function(_0x5bced8){return _0x4f4211(null,![],_0x5bced8);});}function sendServiceMail(_0x2188dc){return db[_0xf2bb('0x1f')][_0xf2bb('0x20')]({'where':{'service':!![]},'attributes':['id',_0xf2bb('0xd'),'email'],'include':[{'model':db[_0xf2bb('0x21')],'as':_0xf2bb('0x22'),'include':[{'model':db[_0xf2bb('0x23')],'as':_0xf2bb('0x23')}]}]})[_0xf2bb('0xc')](function(_0x4e0573){if(!_0x4e0573){throw new Error(_0xf2bb('0x24'));}var _0x4daab3=_0x4e0573[_0xf2bb('0x25')]();var _0x3c8852={'account':_0x4daab3,'message':_['merge']({'from':util[_0xf2bb('0x26')](_0xf2bb('0x27'),_0x4e0573['name'],_0x4e0573['email']||_0x4e0573[_0xf2bb('0x22')]['user'])},_0x2188dc)};return client[_0xf2bb('0x28')](_0xf2bb('0x29'),_0x3c8852);})[_0xf2bb('0xc')](function(_0xf80fef){if(_0xf80fef['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xf80fef[_0xf2bb('0x2a')][_0xf2bb('0x2b')]||JSON[_0xf2bb('0x2c')](_0xf80fef[_0xf2bb('0x2a')])));}return!![];});}function handleError(_0x469e46,_0x13b4e0,_0x5ee924){return _0x469e46['status'](_0x13b4e0||0x1f4)[_0xf2bb('0x2d')]({'message':_0x5ee924?_0x5ee924[_0xf2bb('0x2b')]||_0x5ee924:''});}exports[_0xf2bb('0x2e')]=function(_0xa60169,_0x402e63,_0x3175d3){passport[_0xf2bb('0x16')]('local-login',function(_0x26eb57,_0x4d8cbb,_0x5582ae){var _0x507c81=_0x26eb57||_0x5582ae;if(_0x507c81){return handleError(_0x402e63,0x191,_0x507c81);}if(!_0x4d8cbb){return handleError(_0x402e63,0x194,{'message':_0xf2bb('0x2f')});}else{var _0x407cf5={'payload':{'id':_0x4d8cbb['id'],'role':_0x4d8cbb[_0xf2bb('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xf2bb('0x30')](_0x407cf5)[_0xf2bb('0xc')](function(_0x3f1bf1){_0x402e63['json']({'id':_0x4d8cbb['id'],'token':_0x3f1bf1,'statusCall':'','isAlreadyLogged':_0x4d8cbb[_0xf2bb('0x31')]});});}})(_0xa60169,_0x402e63,_0x3175d3);};exports['forgot']=function(_0x2f3262,_0x44bd16){if(!_0x2f3262[_0xf2bb('0x32')]['email']){return handleError(_0x44bd16,0x1f4,{'message':_0xf2bb('0x33')});}var _0x5ccb40=rs[_0xf2bb('0x34')]();_0x2f3262['body'][_0xf2bb('0x35')]=_0x2f3262[_0xf2bb('0x32')][_0xf2bb('0x35')][_0xf2bb('0x36')]()[_0xf2bb('0x37')]();var _0x11c52d;return db['Setting'][_0xf2bb('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xf2bb('0xc')](function(_0x50ba74){_0x11c52d=_0x50ba74;return db['User'][_0xf2bb('0x20')]({'where':{'email':_0x2f3262[_0xf2bb('0x32')][_0xf2bb('0x35')]}});})[_0xf2bb('0xc')](function(_0x5ae6a6){if(!_0x5ae6a6){throw new Error(_0xf2bb('0x38'));}if(_0x5ae6a6[_0xf2bb('0x17')]){throw new Error(_0xf2bb('0x39'));}if(_0x5ae6a6['blocked']){if(moment(_0x5ae6a6['blockedAt'])['add'](_0x11c52d[_0xf2bb('0x18')],_0xf2bb('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x5ae6a6[_0xf2bb('0x11')]=![];_0x5ae6a6[_0xf2bb('0x19')]=null;}}_0x5ae6a6[_0xf2bb('0x3a')]=_0x5ccb40;_0x5ae6a6['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x5ae6a6['save']();})['then'](function(){return sendServiceMail({'to':_0x2f3262[_0xf2bb('0x32')][_0xf2bb('0x35')],'subject':_0xf2bb('0x3b'),'text':_0xf2bb('0x3c')+_0xf2bb('0x3d')+_0xf2bb('0x3e')+_0x2f3262['headers']['host']+_0xf2bb('0x3f')+_0x5ccb40+'\x0a\x0a'+_0xf2bb('0x40')});})[_0xf2bb('0xc')](function(){_0x44bd16['status'](0xc8)[_0xf2bb('0x2d')]({'message':_0xf2bb('0x41')});})[_0xf2bb('0x1e')](function(_0x2f05d2){return handleError(_0x44bd16,0x1f4,_0x2f05d2);});};exports[_0xf2bb('0x42')]=function(_0x86951c,_0x4429a6){return db['User']['find']({'where':{'resetPasswordToken':_0x86951c[_0xf2bb('0x43')][_0xf2bb('0x44')],'resetPasswordExpires':{'$gt':Date[_0xf2bb('0x45')]()}}})[_0xf2bb('0xc')](function(_0x6fa97){if(!_0x6fa97){throw new Error(_0xf2bb('0x46'));}return db[_0xf2bb('0x9')][_0xf2bb('0xa')]({'attributes':['id',_0xf2bb('0x47'),_0xf2bb('0x48'),_0xf2bb('0x49')]})[_0xf2bb('0xc')](function(_0x44a8d5){if(_0x44a8d5['securePassword'])authService['validatePasswordPattern'](_0x86951c[_0xf2bb('0x32')][_0xf2bb('0xe')]);if(!_0x44a8d5[_0xf2bb('0x48')]||!_0x6fa97['previousPasswords'])return _0x6fa97;authService[_0xf2bb('0x4a')](_0x86951c[_0xf2bb('0x32')][_0xf2bb('0xe')],_0x6fa97[_0xf2bb('0x4b')],_0x44a8d5['passwordHistoryLimit']);return _0x6fa97;})[_0xf2bb('0xc')](function(){_0x6fa97['password']=_0x86951c[_0xf2bb('0x32')]['password'];_0x6fa97[_0xf2bb('0x3a')]=null;_0x6fa97[_0xf2bb('0x4c')]=null;return _0x6fa97[_0xf2bb('0x4d')]();});})[_0xf2bb('0xc')](function(){_0x4429a6[_0xf2bb('0x4e')](0xc8)['send']({'message':_0xf2bb('0x4f')});})[_0xf2bb('0x1e')](function(_0x267c3f){return handleError(_0x4429a6,0x1f4,_0x267c3f);});};passport[_0xf2bb('0x50')](_0xf2bb('0x51'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xd765ad,_0x380f59,_0x37004b){return localAuthenticate(db[_0xf2bb('0x52')],_0xd765ad,_0x380f59,_0x37004b);})); \ No newline at end of file +var _0xc11c=['previousPasswords','Password\x20reset!','use','local-login','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','role','disabled','blocked','blockedAt','user','agent','then','authenticate','loginAttempts','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password'];(function(_0x5e499f,_0x46daa9){var _0x5995b1=function(_0x54f226){while(--_0x54f226){_0x5e499f['push'](_0x5e499f['shift']());}};_0x5995b1(++_0x46daa9);}(_0xc11c,0x144));var _0xcc11=function(_0x42777b,_0x29d3fb){_0x42777b=_0x42777b-0x0;var _0x2fb268=_0xc11c[_0x42777b];return _0x2fb268;};'use strict';var util=require('util');var passport=require(_0xcc11('0x0'));var LocalStrategy=require(_0xcc11('0x1'))[_0xcc11('0x2')];var jayson=require(_0xcc11('0x3'));var _=require('lodash');var rs=require(_0xcc11('0x4'));var moment=require(_0xcc11('0x5'));var db=require(_0xcc11('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xcc11('0x7'));var client=jayson[_0xcc11('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x1b4110,_0xe54839,_0x5108b7,_0x54104e){var _0x5a1be7,_0x161fa9;return db[_0xcc11('0x9')][_0xcc11('0xa')]({'where':{'id':0x1},'attributes':[_0xcc11('0xb'),_0xcc11('0xc')],'raw':!![]})['then'](function(_0x343145){_0x5a1be7=_0x343145;return _0x1b4110[_0xcc11('0xa')]({'attributes':['id',_0xcc11('0xd'),'password','salt',_0xcc11('0xe'),_0xcc11('0xf'),_0xcc11('0x10'),_0xcc11('0x11'),'loginAttempts'],'where':{'name':_0xe54839,'role':{'$or':['admin',_0xcc11('0x12'),_0xcc11('0x13')]}}});})[_0xcc11('0x14')](function(_0x391930){if(!_0x391930||_0x391930&&_0x391930['name']!==_0xe54839){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x161fa9=_0x391930;return _0x161fa9;}})['then'](function(){_0x161fa9[_0xcc11('0x15')](_0x5108b7,function(_0x5a3d23,_0x5522ca){var _0x325b4b=_0x161fa9[_0xcc11('0x16')]+0x1;if(_0x5a3d23){return _0x54104e(_0x5a3d23);}else if(!_0x5522ca){if(_0x161fa9[_0xcc11('0xf')]){return _0x54104e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5a1be7[_0xcc11('0xb')]>0x0){if(_0x161fa9['blocked']){if(_0x5a1be7[_0xcc11('0xc')]>0x0){if(moment(_0x161fa9[_0xcc11('0x11')])[_0xcc11('0x17')](_0x5a1be7['blockDuration'],'minutes')>moment()){return _0x54104e(null,![],{'message':_0xcc11('0x18')});}else{return utils[_0xcc11('0x19')](_0x161fa9,_0x325b4b,![],null)['then'](function(){return _0x54104e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x54104e(null,![],{'message':_0xcc11('0x18')});}}else{if(_0x325b4b>=_0x5a1be7[_0xcc11('0xb')]){return utils[_0xcc11('0x19')](_0x161fa9,0x0,!![],moment())[_0xcc11('0x14')](function(){return _0x54104e(null,![],{'message':_0xcc11('0x18')});});}else{return utils[_0xcc11('0x19')](_0x161fa9,_0x325b4b,![],null)[_0xcc11('0x14')](function(){return _0x54104e(null,![],{'message':_0xcc11('0x18')});});}}}else{return _0x54104e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x161fa9[_0xcc11('0xf')]){return _0x54104e(null,![],{'message':_0xcc11('0x18')});}else if(_0x5a1be7[_0xcc11('0xb')]>0x0){if(_0x161fa9[_0xcc11('0x10')]){if(_0x5a1be7[_0xcc11('0xc')]>0x0){if(moment(_0x161fa9[_0xcc11('0x11')])[_0xcc11('0x17')](_0x5a1be7[_0xcc11('0xc')],_0xcc11('0x1a'))>moment()){return _0x54104e(null,![],{'message':_0xcc11('0x18')});}else{return utils[_0xcc11('0x19')](_0x161fa9,0x0,![],null)['then'](function(){return utils[_0xcc11('0x1b')](_0x161fa9);})[_0xcc11('0x14')](function(){return _0x54104e(null,_0x161fa9);});}}else{return _0x54104e(null,![],{'message':_0xcc11('0x18')});}}else{return utils[_0xcc11('0x19')](_0x161fa9,0x0,![],null)[_0xcc11('0x14')](function(){return utils[_0xcc11('0x1b')](_0x161fa9);})[_0xcc11('0x14')](function(){return _0x54104e(null,_0x161fa9);})[_0xcc11('0x1c')](function(_0x9230ab){return _0x54104e(null,![],_0x9230ab);});}}else{if(_0x161fa9[_0xcc11('0x10')]){return _0x54104e(null,![],{'message':_0xcc11('0x18')});}else{return utils[_0xcc11('0x1b')](_0x161fa9)['then'](function(){return _0x54104e(null,_0x161fa9);});}}}});})[_0xcc11('0x1c')](function(_0x4231f3){return _0x54104e(null,![],_0x4231f3);});}function sendServiceMail(_0x20f14b){return db['MailAccount'][_0xcc11('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xcc11('0xd'),_0xcc11('0x1e')],'include':[{'model':db[_0xcc11('0x1f')],'as':_0xcc11('0x20'),'include':[{'model':db[_0xcc11('0x21')],'as':_0xcc11('0x21')}]}]})[_0xcc11('0x14')](function(_0x3887f4){if(!_0x3887f4){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5e8109=_0x3887f4['getSmtpOptions']();var _0x177622={'account':_0x5e8109,'message':_['merge']({'from':util[_0xcc11('0x22')](_0xcc11('0x23'),_0x3887f4[_0xcc11('0xd')],_0x3887f4[_0xcc11('0x1e')]||_0x3887f4['Smtp'][_0xcc11('0x12')])},_0x20f14b)};return client[_0xcc11('0x24')](_0xcc11('0x25'),_0x177622);})['then'](function(_0x43fa93){if(_0x43fa93[_0xcc11('0x26')]){throw new Error(util[_0xcc11('0x22')](_0xcc11('0x27'),_0x43fa93[_0xcc11('0x26')][_0xcc11('0x28')]||JSON[_0xcc11('0x29')](_0x43fa93[_0xcc11('0x26')])));}return!![];});}function handleError(_0x162a5b,_0x3eb20c,_0x2fe433){return _0x162a5b['status'](_0x3eb20c||0x1f4)['send']({'message':_0x2fe433?_0x2fe433['message']||_0x2fe433:''});}exports['login']=function(_0x2fd5ce,_0x24fa0d,_0x5a3f0e){passport[_0xcc11('0x15')]('local-login',function(_0x4d67c6,_0x965ace,_0x49750c){var _0x212f99=_0x4d67c6||_0x49750c;if(_0x212f99){return handleError(_0x24fa0d,0x191,_0x212f99);}if(!_0x965ace){return handleError(_0x24fa0d,0x194,{'message':_0xcc11('0x2a')});}else{var _0x599301={'payload':{'id':_0x965ace['id'],'role':_0x965ace[_0xcc11('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xcc11('0x2b')](_0x599301)[_0xcc11('0x14')](function(_0x206412){_0x24fa0d[_0xcc11('0x2c')]({'id':_0x965ace['id'],'token':_0x206412,'statusCall':'','isAlreadyLogged':_0x965ace[_0xcc11('0x2d')]});});}})(_0x2fd5ce,_0x24fa0d,_0x5a3f0e);};exports[_0xcc11('0x2e')]=function(_0x37fc3d,_0x3bb5d6){if(!_0x37fc3d['body'][_0xcc11('0x1e')]){return handleError(_0x3bb5d6,0x1f4,{'message':_0xcc11('0x2f')});}var _0x32d345=rs['generate']();_0x37fc3d[_0xcc11('0x30')][_0xcc11('0x1e')]=_0x37fc3d[_0xcc11('0x30')][_0xcc11('0x1e')][_0xcc11('0x31')]()['toLowerCase']();var _0x991037;return db['Setting'][_0xcc11('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xcc11('0x14')](function(_0x8e50dc){_0x991037=_0x8e50dc;return db[_0xcc11('0x32')][_0xcc11('0x1d')]({'where':{'email':_0x37fc3d[_0xcc11('0x30')][_0xcc11('0x1e')]}});})[_0xcc11('0x14')](function(_0x7ddce3){if(!_0x7ddce3){throw new Error(_0xcc11('0x33'));}if(_0x7ddce3[_0xcc11('0xf')]){throw new Error(_0xcc11('0x34'));}if(_0x7ddce3['blocked']){if(moment(_0x7ddce3['blockedAt'])['add'](_0x991037[_0xcc11('0xc')],_0xcc11('0x1a'))>moment()){throw new Error(_0xcc11('0x35'));}else{_0x7ddce3[_0xcc11('0x10')]=![];_0x7ddce3[_0xcc11('0x11')]=null;}}_0x7ddce3[_0xcc11('0x36')]=_0x32d345;_0x7ddce3[_0xcc11('0x37')]=Date[_0xcc11('0x38')]()+0x36ee80;return _0x7ddce3[_0xcc11('0x39')]();})[_0xcc11('0x14')](function(){return sendServiceMail({'to':_0x37fc3d[_0xcc11('0x30')]['email'],'subject':_0xcc11('0x3a'),'text':_0xcc11('0x3b')+_0xcc11('0x3c')+_0xcc11('0x3d')+_0x37fc3d[_0xcc11('0x3e')][_0xcc11('0x3f')]+_0xcc11('0x40')+_0x32d345+'\x0a\x0a'+_0xcc11('0x41')});})[_0xcc11('0x14')](function(){_0x3bb5d6[_0xcc11('0x42')](0xc8)[_0xcc11('0x43')]({'message':_0xcc11('0x44')});})[_0xcc11('0x1c')](function(_0x5efd70){return handleError(_0x3bb5d6,0x1f4,_0x5efd70);});};exports['reset']=function(_0x14bed9,_0x49b6e3){return db[_0xcc11('0x32')]['find']({'where':{'resetPasswordToken':_0x14bed9['params'][_0xcc11('0x45')],'resetPasswordExpires':{'$gt':Date[_0xcc11('0x38')]()}}})[_0xcc11('0x14')](function(_0x7669be){if(!_0x7669be){throw new Error(_0xcc11('0x46'));}return db[_0xcc11('0x9')][_0xcc11('0xa')]({'attributes':['id',_0xcc11('0x47'),_0xcc11('0x48'),_0xcc11('0x49')]})[_0xcc11('0x14')](function(_0x41f0f3){if(_0x41f0f3[_0xcc11('0x47')])authService[_0xcc11('0x4a')](_0x14bed9[_0xcc11('0x30')][_0xcc11('0x4b')]);if(!_0x41f0f3[_0xcc11('0x48')]||!_0x7669be[_0xcc11('0x4c')])return _0x7669be;authService['validatePasswordHistory'](_0x14bed9[_0xcc11('0x30')][_0xcc11('0x4b')],_0x7669be['previousPasswords'],_0x41f0f3['passwordHistoryLimit']);return _0x7669be;})[_0xcc11('0x14')](function(){_0x7669be[_0xcc11('0x4b')]=_0x14bed9[_0xcc11('0x30')][_0xcc11('0x4b')];_0x7669be[_0xcc11('0x36')]=null;_0x7669be[_0xcc11('0x37')]=null;return _0x7669be['save']();});})[_0xcc11('0x14')](function(){_0x49b6e3[_0xcc11('0x42')](0xc8)[_0xcc11('0x43')]({'message':_0xcc11('0x4d')});})[_0xcc11('0x1c')](function(_0x205473){return handleError(_0x49b6e3,0x1f4,_0x205473);});};passport[_0xcc11('0x4e')](_0xcc11('0x4f'),new LocalStrategy({'usernameField':_0xcc11('0xd'),'passwordField':_0xcc11('0x4b')},function(_0x139688,_0x2cbd3a,_0x289916){return localAuthenticate(db[_0xcc11('0x32')],_0x139688,_0x2cbd3a,_0x289916);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index e9f8cfa..5fd6ceb 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 _0xc25e=['/forgot','forgot','/reset/:token','exports','express','./authLocal.controller','post','login'];(function(_0x364076,_0xa57f11){var _0x311172=function(_0x417910){while(--_0x417910){_0x364076['push'](_0x364076['shift']());}};_0x311172(++_0xa57f11);}(_0xc25e,0x19c));var _0xec25=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xc25e[_0x28947d];return _0x12d2ee;};'use strict';var express=require(_0xec25('0x0'));var router=express['Router']();var controller=require(_0xec25('0x1'));router[_0xec25('0x2')]('/',controller[_0xec25('0x3')]);router[_0xec25('0x2')](_0xec25('0x4'),controller[_0xec25('0x5')]);router[_0xec25('0x2')](_0xec25('0x6'),controller['reset']);module[_0xec25('0x7')]=router; \ No newline at end of file +var _0x6c40=['post','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0xc88a95,_0x132392){var _0x5ae1b2=function(_0x5458aa){while(--_0x5458aa){_0xc88a95['push'](_0xc88a95['shift']());}};_0x5ae1b2(++_0x132392);}(_0x6c40,0x19d));var _0x06c4=function(_0x31459c,_0x898143){_0x31459c=_0x31459c-0x0;var _0x7aba2b=_0x6c40[_0x31459c];return _0x7aba2b;};'use strict';var express=require(_0x06c4('0x0'));var router=express[_0x06c4('0x1')]();var controller=require(_0x06c4('0x2'));router[_0x06c4('0x3')]('/',controller['login']);router['post']('/forgot',controller[_0x06c4('0x4')]);router[_0x06c4('0x3')](_0x06c4('0x5'),controller[_0x06c4('0x6')]);module[_0x06c4('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 395920f..5ce23ea 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 _0x7f08=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x4581cc,_0x385bce){var _0x8f7555=function(_0x2f11b4){while(--_0x2f11b4){_0x4581cc['push'](_0x4581cc['shift']());}};_0x8f7555(++_0x385bce);}(_0x7f08,0x174));var _0x87f0=function(_0x3fc4e5,_0x33cd9f){_0x3fc4e5=_0x3fc4e5-0x0;var _0x24958c=_0x7f08[_0x3fc4e5];return _0x24958c;};'use strict';var Sequelize=require('sequelize');module[_0x87f0('0x0')]={'name':{'type':Sequelize[_0x87f0('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x87f0('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x87f0('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x87f0('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x7c7d=['INTEGER','exports','STRING'];(function(_0x2f0622,_0x3aad7f){var _0x3ec353=function(_0xc8784a){while(--_0xc8784a){_0x2f0622['push'](_0x2f0622['shift']());}};_0x3ec353(++_0x3aad7f);}(_0x7c7d,0xfa));var _0xd7c7=function(_0x2bfc42,_0x5a9e74){_0x2bfc42=_0x2bfc42-0x0;var _0x1630ef=_0x7c7d[_0x2bfc42];return _0x1630ef;};'use strict';var Sequelize=require('sequelize');module[_0xd7c7('0x0')]={'name':{'type':Sequelize[_0xd7c7('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xd7c7('0x1')]},'description':{'type':Sequelize[_0xd7c7('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd7c7('0x2')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 10e4558..ac7cddd 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 _0x9d46=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','length','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0x9d46,0x12b));var _0x69d4=function(_0x4a8237,_0x57a26b){_0x4a8237=_0x4a8237-0x0;var _0x1c69dc=_0x9d46[_0x4a8237];return _0x1c69dc;};'use strict';var emlformat=require(_0x69d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69d4('0x1'));var jsonpatch=require(_0x69d4('0x2'));var rp=require(_0x69d4('0x3'));var moment=require(_0x69d4('0x4'));var BPromise=require(_0x69d4('0x5'));var Mustache=require('mustache');var util=require(_0x69d4('0x6'));var path=require(_0x69d4('0x7'));var sox=require(_0x69d4('0x8'));var csv=require(_0x69d4('0x9'));var ejs=require(_0x69d4('0xa'));var fs=require('fs');var fs_extra=require(_0x69d4('0xb'));var _=require(_0x69d4('0xc'));var squel=require('squel');var crypto=require(_0x69d4('0xd'));var jsforce=require(_0x69d4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x69d4('0x9'));var querystring=require(_0x69d4('0xf'));var Papa=require(_0x69d4('0x10'));var Redis=require(_0x69d4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x69d4('0x12'));var as=require(_0x69d4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x69d4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x69d4('0x15'))['db'];function respondWithStatusCode(_0x3c5fa3,_0x25c337){_0x25c337=_0x25c337||0xcc;return function(_0x34e010){if(_0x34e010){return _0x3c5fa3[_0x69d4('0x16')](_0x25c337);}return _0x3c5fa3['status'](_0x25c337)[_0x69d4('0x17')]();};}function respondWithResult(_0x4b63a6,_0x3489d4){_0x3489d4=_0x3489d4||0xc8;return function(_0x432e04){if(_0x432e04){return _0x4b63a6[_0x69d4('0x18')](_0x3489d4)[_0x69d4('0x19')](_0x432e04);}};}function respondWithFilteredResult(_0x4b9d26,_0x481402){return function(_0x119256){if(_0x119256){var _0x506023=typeof _0x481402[_0x69d4('0x1a')]===_0x69d4('0x1b')&&typeof _0x481402[_0x69d4('0x1c')]===_0x69d4('0x1b');var _0x43d079=_0x119256[_0x69d4('0x1d')];var _0x5f23ea=_0x506023?0x0:_0x481402[_0x69d4('0x1a')];var _0x2cfff0=_0x506023?_0x119256[_0x69d4('0x1d')]:_0x481402[_0x69d4('0x1a')]+_0x481402['limit'];var _0x113503;if(_0x2cfff0>=_0x43d079){_0x2cfff0=_0x43d079;_0x113503=0xc8;}else{_0x113503=0xce;}_0x4b9d26['status'](_0x113503);return _0x4b9d26['set']('Content-Range',_0x5f23ea+'-'+_0x2cfff0+'/'+_0x43d079)[_0x69d4('0x19')](_0x119256);}return null;};}function patchUpdates(_0x5de31f){return function(_0x2ea429){try{jsonpatch['apply'](_0x2ea429,_0x5de31f,!![]);}catch(_0x16c015){return BPromise[_0x69d4('0x1e')](_0x16c015);}return _0x2ea429[_0x69d4('0x1f')]();};}function saveUpdates(_0x24b0fe,_0x25b368){return function(_0x5ab504){if(_0x5ab504){return _0x5ab504[_0x69d4('0x20')](_0x24b0fe)[_0x69d4('0x21')](function(_0x136f0c){return _0x136f0c;});}return null;};}function removeEntity(_0x17b757,_0x3a06df){return function(_0x734e77){if(_0x734e77){return _0x734e77[_0x69d4('0x22')]()[_0x69d4('0x21')](function(){_0x17b757['status'](0xcc)[_0x69d4('0x17')]();});}};}function handleEntityNotFound(_0x5b9b63,_0x1f81cb){return function(_0x3c68f8){if(!_0x3c68f8){_0x5b9b63[_0x69d4('0x16')](0x194);}return _0x3c68f8;};}function handleError(_0x19b986,_0x1fa0b8){_0x1fa0b8=_0x1fa0b8||0x1f4;return function(_0x1a0f85){logger[_0x69d4('0x23')](_0x1a0f85[_0x69d4('0x24')]);if(_0x1a0f85[_0x69d4('0x25')]){delete _0x1a0f85[_0x69d4('0x25')];}_0x19b986[_0x69d4('0x18')](_0x1fa0b8)['send'](_0x1a0f85);};}exports[_0x69d4('0x26')]=function(_0x435495,_0x3e5d51){var _0x3c19bc={},_0x716b60={},_0x275b3e={'count':0x0,'rows':[]};var _0x1fa28b=_[_0x69d4('0x27')](db[_0x69d4('0x28')][_0x69d4('0x29')],function(_0x34eaef){return{'name':_0x34eaef[_0x69d4('0x2a')],'type':_0x34eaef[_0x69d4('0x2b')][_0x69d4('0x2c')]};});_0x716b60[_0x69d4('0x2d')]=_['map'](_0x1fa28b,_0x69d4('0x25'));_0x716b60[_0x69d4('0x2e')]=_[_0x69d4('0x2f')](_0x435495[_0x69d4('0x2e')]);_0x716b60[_0x69d4('0x30')]=_[_0x69d4('0x31')](_0x716b60[_0x69d4('0x2d')],_0x716b60[_0x69d4('0x2e')]);_0x3c19bc['attributes']=_[_0x69d4('0x31')](_0x716b60[_0x69d4('0x2d')],qs[_0x69d4('0x32')](_0x435495['query'][_0x69d4('0x32')]));_0x3c19bc[_0x69d4('0x33')]=_0x3c19bc[_0x69d4('0x33')]['length']?_0x3c19bc[_0x69d4('0x33')]:_0x716b60['model'];if(!_0x435495[_0x69d4('0x2e')]['hasOwnProperty'](_0x69d4('0x34'))){_0x3c19bc[_0x69d4('0x1c')]=qs[_0x69d4('0x1c')](_0x435495[_0x69d4('0x2e')][_0x69d4('0x1c')]);_0x3c19bc[_0x69d4('0x1a')]=qs[_0x69d4('0x1a')](_0x435495['query'][_0x69d4('0x1a')]);}_0x3c19bc[_0x69d4('0x35')]=qs['sort'](_0x435495[_0x69d4('0x2e')][_0x69d4('0x36')]);_0x3c19bc[_0x69d4('0x37')]=qs[_0x69d4('0x30')](_[_0x69d4('0x38')](_0x435495[_0x69d4('0x2e')],_0x716b60['filters']),_0x1fa28b);if(_0x435495['query'][_0x69d4('0x39')]){_0x3c19bc[_0x69d4('0x37')]=_[_0x69d4('0x3a')](_0x3c19bc[_0x69d4('0x37')],{'$or':_[_0x69d4('0x27')](_0x1fa28b,function(_0x3c8ce7){if(_0x3c8ce7[_0x69d4('0x2b')]!==_0x69d4('0x3b')){var _0x3543bb={};_0x3543bb[_0x3c8ce7[_0x69d4('0x25')]]={'$like':'%'+_0x435495[_0x69d4('0x2e')][_0x69d4('0x39')]+'%'};return _0x3543bb;}})});}_0x3c19bc=_[_0x69d4('0x3a')]({},_0x3c19bc,_0x435495[_0x69d4('0x3c')]);var _0x243542={'where':_0x3c19bc['where']};return db[_0x69d4('0x28')]['count'](_0x243542)['then'](function(_0x21025c){_0x275b3e[_0x69d4('0x1d')]=_0x21025c;if(_0x435495['query'][_0x69d4('0x3d')]){_0x3c19bc['include']=[{'all':!![]}];}return db[_0x69d4('0x28')][_0x69d4('0x3e')](_0x3c19bc);})[_0x69d4('0x21')](function(_0x18e8ac){_0x275b3e['rows']=_0x18e8ac;return _0x275b3e;})[_0x69d4('0x21')](respondWithFilteredResult(_0x3e5d51,_0x3c19bc))[_0x69d4('0x3f')](handleError(_0x3e5d51,null));};exports[_0x69d4('0x40')]=function(_0x560f42,_0x58d5f8){var _0x2656ff={'raw':![],'where':{'id':_0x560f42[_0x69d4('0x41')]['id']}},_0x8e5d9e={};_0x8e5d9e['model']=_[_0x69d4('0x2f')](db[_0x69d4('0x28')][_0x69d4('0x29')]);_0x8e5d9e[_0x69d4('0x2e')]=_[_0x69d4('0x2f')](_0x560f42[_0x69d4('0x2e')]);_0x8e5d9e['filters']=_['intersection'](_0x8e5d9e['model'],_0x8e5d9e[_0x69d4('0x2e')]);_0x2656ff[_0x69d4('0x33')]=_[_0x69d4('0x31')](_0x8e5d9e['model'],qs[_0x69d4('0x32')](_0x560f42[_0x69d4('0x2e')][_0x69d4('0x32')]));_0x2656ff[_0x69d4('0x33')]=_0x2656ff['attributes'][_0x69d4('0x42')]?_0x2656ff[_0x69d4('0x33')]:_0x8e5d9e[_0x69d4('0x2d')];if(_0x560f42[_0x69d4('0x2e')]['includeAll']){_0x2656ff['include']=[{'all':!![]}];}_0x2656ff=_[_0x69d4('0x3a')]({},_0x2656ff,_0x560f42[_0x69d4('0x3c')]);return db[_0x69d4('0x28')][_0x69d4('0x43')](_0x2656ff)[_0x69d4('0x21')](handleEntityNotFound(_0x58d5f8,null))[_0x69d4('0x21')](respondWithResult(_0x58d5f8,null))['catch'](handleError(_0x58d5f8,null));};exports['create']=function(_0x5ba87a,_0x594d1b){return db[_0x69d4('0x28')][_0x69d4('0x44')](_0x5ba87a[_0x69d4('0x45')],{})['then'](respondWithResult(_0x594d1b,0xc9))[_0x69d4('0x3f')](handleError(_0x594d1b,null));};exports[_0x69d4('0x20')]=function(_0x10962a,_0x25bb4b){if(_0x10962a[_0x69d4('0x45')]['id']){delete _0x10962a['body']['id'];}return db['Automation'][_0x69d4('0x43')]({'where':{'id':_0x10962a[_0x69d4('0x41')]['id']}})[_0x69d4('0x21')](handleEntityNotFound(_0x25bb4b,null))[_0x69d4('0x21')](saveUpdates(_0x10962a[_0x69d4('0x45')],null))[_0x69d4('0x21')](respondWithResult(_0x25bb4b,null))[_0x69d4('0x3f')](handleError(_0x25bb4b,null));};exports[_0x69d4('0x22')]=function(_0x1d3856,_0x3e7da8){return db['Automation']['find']({'where':{'id':_0x1d3856[_0x69d4('0x41')]['id']}})[_0x69d4('0x21')](handleEntityNotFound(_0x3e7da8,null))[_0x69d4('0x21')](removeEntity(_0x3e7da8,null))[_0x69d4('0x3f')](handleError(_0x3e7da8,null));};exports[_0x69d4('0x46')]=function(_0x214bf3,_0x5a7d97,_0x3b47e1){return db[_0x69d4('0x47')][_0x69d4('0x43')]({'where':{'id':_0x214bf3[_0x69d4('0x41')]['id']}})[_0x69d4('0x21')](handleEntityNotFound(_0x5a7d97,null))['then'](function(_0xb36f47){if(_0xb36f47){return _0xb36f47[_0x69d4('0x46')](_0x214bf3[_0x69d4('0x45')][_0x69d4('0x48')],_[_0x69d4('0x49')](_0x214bf3[_0x69d4('0x45')],[_0x69d4('0x48'),'id'])||{});}})[_0x69d4('0x21')](respondWithResult(_0x5a7d97,null))['catch'](handleError(_0x5a7d97,null));};exports[_0x69d4('0x4a')]=function(_0xa83444,_0x19c6d6,_0x55af97){var _0x5791c7={};var _0x1e5da7={};var _0x19367e;var _0x11e66a;return db[_0x69d4('0x28')][_0x69d4('0x4b')]({'where':{'id':_0xa83444[_0x69d4('0x41')]['id']}})['then'](handleEntityNotFound(_0x19c6d6,null))[_0x69d4('0x21')](function(_0x209249){if(_0x209249){_0x19367e=_0x209249;_0x1e5da7[_0x69d4('0x2d')]=_[_0x69d4('0x2f')](db['Condition'][_0x69d4('0x29')]);_0x1e5da7[_0x69d4('0x2e')]=_[_0x69d4('0x2f')](_0xa83444[_0x69d4('0x2e')]);_0x1e5da7[_0x69d4('0x30')]=_[_0x69d4('0x31')](_0x1e5da7[_0x69d4('0x2d')],_0x1e5da7[_0x69d4('0x2e')]);_0x5791c7[_0x69d4('0x33')]=_['intersection'](_0x1e5da7[_0x69d4('0x2d')],qs[_0x69d4('0x32')](_0xa83444[_0x69d4('0x2e')]['fields']));_0x5791c7[_0x69d4('0x33')]=_0x5791c7['attributes'][_0x69d4('0x42')]?_0x5791c7[_0x69d4('0x33')]:_0x1e5da7[_0x69d4('0x2d')];_0x5791c7[_0x69d4('0x35')]=qs['sort'](_0xa83444[_0x69d4('0x2e')][_0x69d4('0x36')]);_0x5791c7[_0x69d4('0x37')]=qs[_0x69d4('0x30')](_['pick'](_0xa83444[_0x69d4('0x2e')],_0x1e5da7[_0x69d4('0x30')]));if(_0xa83444['query'][_0x69d4('0x39')]){_0x5791c7[_0x69d4('0x37')]=_['merge'](_0x5791c7['where'],{'$or':_[_0x69d4('0x27')](_0x5791c7['attributes'],function(_0x4e5d50){var _0x573a34={};_0x573a34[_0x4e5d50]={'$like':'%'+_0xa83444['query'][_0x69d4('0x39')]+'%'};return _0x573a34;})});}_0x5791c7=_[_0x69d4('0x3a')]({},_0x5791c7,_0xa83444[_0x69d4('0x3c')]);return _0x19367e['getConditions'](_0x5791c7);}})[_0x69d4('0x21')](function(_0x151268){if(_0x151268){_0x11e66a=_0x151268[_0x69d4('0x42')];if(!_0xa83444[_0x69d4('0x2e')][_0x69d4('0x4c')](_0x69d4('0x34'))){_0x5791c7[_0x69d4('0x1c')]=qs[_0x69d4('0x1c')](_0xa83444[_0x69d4('0x2e')][_0x69d4('0x1c')]);_0x5791c7[_0x69d4('0x1a')]=qs[_0x69d4('0x1a')](_0xa83444['query']['offset']);}return _0x19367e['getConditions'](_0x5791c7);}})[_0x69d4('0x21')](function(_0x3b66c7){if(_0x3b66c7){return _0x3b66c7?{'count':_0x11e66a,'rows':_0x3b66c7}:null;}})[_0x69d4('0x21')](respondWithResult(_0x19c6d6,null))['catch'](handleError(_0x19c6d6,null));};exports[_0x69d4('0x4d')]=function(_0x39f190,_0x10b767,_0x424490){return db['Action']['find']({'where':{'id':_0x39f190['params']['id']}})[_0x69d4('0x21')](handleEntityNotFound(_0x10b767,null))['then'](function(_0x57f1b4){if(_0x57f1b4){return _0x57f1b4[_0x69d4('0x4d')](_0x39f190[_0x69d4('0x45')][_0x69d4('0x48')],_[_0x69d4('0x49')](_0x39f190['body'],[_0x69d4('0x48'),'id'])||{});}})['then'](respondWithResult(_0x10b767,null))[_0x69d4('0x3f')](handleError(_0x10b767,null));};exports[_0x69d4('0x4e')]=function(_0x5a6df2,_0x446f3c,_0x39b847){var _0x475b60={};var _0x4dbd30={};var _0x53755f;var _0x34e707;return db[_0x69d4('0x28')]['findOne']({'where':{'id':_0x5a6df2[_0x69d4('0x41')]['id']}})[_0x69d4('0x21')](handleEntityNotFound(_0x446f3c,null))[_0x69d4('0x21')](function(_0x37f05d){if(_0x37f05d){_0x53755f=_0x37f05d;_0x4dbd30[_0x69d4('0x2d')]=_[_0x69d4('0x2f')](db['Action'][_0x69d4('0x29')]);_0x4dbd30[_0x69d4('0x2e')]=_[_0x69d4('0x2f')](_0x5a6df2['query']);_0x4dbd30['filters']=_[_0x69d4('0x31')](_0x4dbd30['model'],_0x4dbd30[_0x69d4('0x2e')]);_0x475b60[_0x69d4('0x33')]=_['intersection'](_0x4dbd30[_0x69d4('0x2d')],qs[_0x69d4('0x32')](_0x5a6df2['query'][_0x69d4('0x32')]));_0x475b60['attributes']=_0x475b60[_0x69d4('0x33')][_0x69d4('0x42')]?_0x475b60[_0x69d4('0x33')]:_0x4dbd30['model'];_0x475b60[_0x69d4('0x35')]=qs[_0x69d4('0x36')](_0x5a6df2[_0x69d4('0x2e')][_0x69d4('0x36')]);_0x475b60['where']=qs[_0x69d4('0x30')](_[_0x69d4('0x38')](_0x5a6df2['query'],_0x4dbd30['filters']));if(_0x5a6df2['query'][_0x69d4('0x39')]){_0x475b60['where']=_[_0x69d4('0x3a')](_0x475b60['where'],{'$or':_[_0x69d4('0x27')](_0x475b60[_0x69d4('0x33')],function(_0x3a2755){var _0x2472d8={};_0x2472d8[_0x3a2755]={'$like':'%'+_0x5a6df2[_0x69d4('0x2e')][_0x69d4('0x39')]+'%'};return _0x2472d8;})});}_0x475b60=_['merge']({},_0x475b60,_0x5a6df2[_0x69d4('0x3c')]);return _0x53755f[_0x69d4('0x4e')](_0x475b60);}})[_0x69d4('0x21')](function(_0x2292fa){if(_0x2292fa){_0x34e707=_0x2292fa[_0x69d4('0x42')];if(!_0x5a6df2['query'][_0x69d4('0x4c')](_0x69d4('0x34'))){_0x475b60[_0x69d4('0x1c')]=qs['limit'](_0x5a6df2[_0x69d4('0x2e')][_0x69d4('0x1c')]);_0x475b60[_0x69d4('0x1a')]=qs['offset'](_0x5a6df2[_0x69d4('0x2e')][_0x69d4('0x1a')]);}return _0x53755f[_0x69d4('0x4e')](_0x475b60);}})[_0x69d4('0x21')](function(_0x3b77f6){if(_0x3b77f6){return _0x3b77f6?{'count':_0x34e707,'rows':_0x3b77f6}:null;}})[_0x69d4('0x21')](respondWithResult(_0x446f3c,null))[_0x69d4('0x3f')](handleError(_0x446f3c,null));}; \ No newline at end of file +var _0xe4f3=['addConditions','Condition','omit','ids','getConditions','findOne','merge','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','catch','rawAttributes','include','find','create','body','params'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xe4f3,0x1a9));var _0x3e4f=function(_0x45c96a,_0x4cfc11){_0x45c96a=_0x45c96a-0x0;var _0x314fed=_0xe4f3[_0x45c96a];return _0x314fed;};'use strict';var emlformat=require(_0x3e4f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e4f('0x1'));var jsonpatch=require(_0x3e4f('0x2'));var rp=require(_0x3e4f('0x3'));var moment=require(_0x3e4f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3e4f('0x5'));var util=require(_0x3e4f('0x6'));var path=require(_0x3e4f('0x7'));var sox=require(_0x3e4f('0x8'));var csv=require(_0x3e4f('0x9'));var ejs=require(_0x3e4f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3e4f('0xb'));var crypto=require(_0x3e4f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e4f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3e4f('0xe'));var Papa=require(_0x3e4f('0xf'));var Redis=require(_0x3e4f('0x10'));var authService=require(_0x3e4f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e4f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3e4f('0x13'));var config=require(_0x3e4f('0x14'));var licenseUtil=require(_0x3e4f('0x15'));var db=require(_0x3e4f('0x16'))['db'];function respondWithStatusCode(_0x3b1209,_0xfae52d){_0xfae52d=_0xfae52d||0xcc;return function(_0x46fba1){if(_0x46fba1){return _0x3b1209[_0x3e4f('0x17')](_0xfae52d);}return _0x3b1209[_0x3e4f('0x18')](_0xfae52d)[_0x3e4f('0x19')]();};}function respondWithResult(_0x386231,_0x9f797c){_0x9f797c=_0x9f797c||0xc8;return function(_0x4b15cf){if(_0x4b15cf){return _0x386231[_0x3e4f('0x18')](_0x9f797c)['json'](_0x4b15cf);}};}function respondWithFilteredResult(_0x536456,_0x3dfe89){return function(_0xff912){if(_0xff912){var _0x70d5c1=typeof _0x3dfe89[_0x3e4f('0x1a')]===_0x3e4f('0x1b')&&typeof _0x3dfe89[_0x3e4f('0x1c')]===_0x3e4f('0x1b');var _0x20b221=_0xff912[_0x3e4f('0x1d')];var _0x2a050f=_0x70d5c1?0x0:_0x3dfe89[_0x3e4f('0x1a')];var _0x292cb9=_0x70d5c1?_0xff912[_0x3e4f('0x1d')]:_0x3dfe89[_0x3e4f('0x1a')]+_0x3dfe89[_0x3e4f('0x1c')];var _0x141132;if(_0x292cb9>=_0x20b221){_0x292cb9=_0x20b221;_0x141132=0xc8;}else{_0x141132=0xce;}_0x536456[_0x3e4f('0x18')](_0x141132);return _0x536456[_0x3e4f('0x1e')](_0x3e4f('0x1f'),_0x2a050f+'-'+_0x292cb9+'/'+_0x20b221)[_0x3e4f('0x20')](_0xff912);}return null;};}function patchUpdates(_0x46a7b1){return function(_0x467f05){try{jsonpatch[_0x3e4f('0x21')](_0x467f05,_0x46a7b1,!![]);}catch(_0x2a404e){return BPromise[_0x3e4f('0x22')](_0x2a404e);}return _0x467f05[_0x3e4f('0x23')]();};}function saveUpdates(_0x20d559,_0x25b68c){return function(_0x48f0ff){if(_0x48f0ff){return _0x48f0ff[_0x3e4f('0x24')](_0x20d559)[_0x3e4f('0x25')](function(_0x4904a9){return _0x4904a9;});}return null;};}function removeEntity(_0x1ef0fd,_0x4eb89a){return function(_0x46bd12){if(_0x46bd12){return _0x46bd12[_0x3e4f('0x26')]()['then'](function(){_0x1ef0fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xec7dde,_0x544f5){return function(_0x40e487){if(!_0x40e487){_0xec7dde[_0x3e4f('0x17')](0x194);}return _0x40e487;};}function handleError(_0x45c11c,_0xade20b){_0xade20b=_0xade20b||0x1f4;return function(_0x126d68){logger[_0x3e4f('0x27')](_0x126d68['stack']);if(_0x126d68[_0x3e4f('0x28')]){delete _0x126d68[_0x3e4f('0x28')];}_0x45c11c[_0x3e4f('0x18')](_0xade20b)['send'](_0x126d68);};}exports[_0x3e4f('0x29')]=function(_0x275495,_0x4739bf){var _0x5c5cb6={},_0xa969de={},_0x4d3f9d={'count':0x0,'rows':[]};var _0x34e929=_[_0x3e4f('0x2a')](db[_0x3e4f('0x2b')]['rawAttributes'],function(_0xc59956){return{'name':_0xc59956[_0x3e4f('0x2c')],'type':_0xc59956[_0x3e4f('0x2d')][_0x3e4f('0x2e')]};});_0xa969de[_0x3e4f('0x2f')]=_['map'](_0x34e929,_0x3e4f('0x28'));_0xa969de[_0x3e4f('0x30')]=_[_0x3e4f('0x31')](_0x275495[_0x3e4f('0x30')]);_0xa969de[_0x3e4f('0x32')]=_[_0x3e4f('0x33')](_0xa969de[_0x3e4f('0x2f')],_0xa969de['query']);_0x5c5cb6[_0x3e4f('0x34')]=_['intersection'](_0xa969de[_0x3e4f('0x2f')],qs[_0x3e4f('0x35')](_0x275495['query'][_0x3e4f('0x35')]));_0x5c5cb6['attributes']=_0x5c5cb6[_0x3e4f('0x34')][_0x3e4f('0x36')]?_0x5c5cb6[_0x3e4f('0x34')]:_0xa969de[_0x3e4f('0x2f')];if(!_0x275495[_0x3e4f('0x30')][_0x3e4f('0x37')](_0x3e4f('0x38'))){_0x5c5cb6[_0x3e4f('0x1c')]=qs[_0x3e4f('0x1c')](_0x275495[_0x3e4f('0x30')][_0x3e4f('0x1c')]);_0x5c5cb6[_0x3e4f('0x1a')]=qs[_0x3e4f('0x1a')](_0x275495[_0x3e4f('0x30')][_0x3e4f('0x1a')]);}_0x5c5cb6[_0x3e4f('0x39')]=qs['sort'](_0x275495[_0x3e4f('0x30')][_0x3e4f('0x3a')]);_0x5c5cb6[_0x3e4f('0x3b')]=qs['filters'](_[_0x3e4f('0x3c')](_0x275495['query'],_0xa969de[_0x3e4f('0x32')]),_0x34e929);if(_0x275495[_0x3e4f('0x30')]['filter']){_0x5c5cb6[_0x3e4f('0x3b')]=_['merge'](_0x5c5cb6['where'],{'$or':_[_0x3e4f('0x2a')](_0x34e929,function(_0x4960fc){if(_0x4960fc[_0x3e4f('0x2d')]!==_0x3e4f('0x3d')){var _0x60fa89={};_0x60fa89[_0x4960fc[_0x3e4f('0x28')]]={'$like':'%'+_0x275495['query'][_0x3e4f('0x3e')]+'%'};return _0x60fa89;}})});}_0x5c5cb6=_['merge']({},_0x5c5cb6,_0x275495[_0x3e4f('0x3f')]);var _0x393ce2={'where':_0x5c5cb6[_0x3e4f('0x3b')]};return db[_0x3e4f('0x2b')]['count'](_0x393ce2)[_0x3e4f('0x25')](function(_0x12eb83){_0x4d3f9d[_0x3e4f('0x1d')]=_0x12eb83;if(_0x275495['query'][_0x3e4f('0x40')]){_0x5c5cb6['include']=[{'all':!![]}];}return db[_0x3e4f('0x2b')][_0x3e4f('0x41')](_0x5c5cb6);})[_0x3e4f('0x25')](function(_0x416cf9){_0x4d3f9d['rows']=_0x416cf9;return _0x4d3f9d;})[_0x3e4f('0x25')](respondWithFilteredResult(_0x4739bf,_0x5c5cb6))[_0x3e4f('0x42')](handleError(_0x4739bf,null));};exports['show']=function(_0x2a363d,_0x2ac78e){var _0x6456e6={'raw':![],'where':{'id':_0x2a363d['params']['id']}},_0x373ce2={};_0x373ce2['model']=_[_0x3e4f('0x31')](db[_0x3e4f('0x2b')][_0x3e4f('0x43')]);_0x373ce2[_0x3e4f('0x30')]=_[_0x3e4f('0x31')](_0x2a363d['query']);_0x373ce2[_0x3e4f('0x32')]=_[_0x3e4f('0x33')](_0x373ce2['model'],_0x373ce2[_0x3e4f('0x30')]);_0x6456e6[_0x3e4f('0x34')]=_[_0x3e4f('0x33')](_0x373ce2[_0x3e4f('0x2f')],qs[_0x3e4f('0x35')](_0x2a363d['query'][_0x3e4f('0x35')]));_0x6456e6[_0x3e4f('0x34')]=_0x6456e6[_0x3e4f('0x34')]['length']?_0x6456e6[_0x3e4f('0x34')]:_0x373ce2[_0x3e4f('0x2f')];if(_0x2a363d[_0x3e4f('0x30')][_0x3e4f('0x40')]){_0x6456e6[_0x3e4f('0x44')]=[{'all':!![]}];}_0x6456e6=_['merge']({},_0x6456e6,_0x2a363d[_0x3e4f('0x3f')]);return db[_0x3e4f('0x2b')][_0x3e4f('0x45')](_0x6456e6)['then'](handleEntityNotFound(_0x2ac78e,null))[_0x3e4f('0x25')](respondWithResult(_0x2ac78e,null))[_0x3e4f('0x42')](handleError(_0x2ac78e,null));};exports[_0x3e4f('0x46')]=function(_0x5136a2,_0x290c0b){return db[_0x3e4f('0x2b')][_0x3e4f('0x46')](_0x5136a2[_0x3e4f('0x47')],{})[_0x3e4f('0x25')](respondWithResult(_0x290c0b,0xc9))[_0x3e4f('0x42')](handleError(_0x290c0b,null));};exports['update']=function(_0x5f5270,_0x263805){if(_0x5f5270[_0x3e4f('0x47')]['id']){delete _0x5f5270[_0x3e4f('0x47')]['id'];}return db['Automation'][_0x3e4f('0x45')]({'where':{'id':_0x5f5270[_0x3e4f('0x48')]['id']}})[_0x3e4f('0x25')](handleEntityNotFound(_0x263805,null))[_0x3e4f('0x25')](saveUpdates(_0x5f5270[_0x3e4f('0x47')],null))[_0x3e4f('0x25')](respondWithResult(_0x263805,null))[_0x3e4f('0x42')](handleError(_0x263805,null));};exports[_0x3e4f('0x26')]=function(_0x33e381,_0x51b1a6){return db['Automation'][_0x3e4f('0x45')]({'where':{'id':_0x33e381['params']['id']}})['then'](handleEntityNotFound(_0x51b1a6,null))['then'](removeEntity(_0x51b1a6,null))[_0x3e4f('0x42')](handleError(_0x51b1a6,null));};exports[_0x3e4f('0x49')]=function(_0x445f90,_0x52e5cc,_0x41ee82){return db[_0x3e4f('0x4a')][_0x3e4f('0x45')]({'where':{'id':_0x445f90[_0x3e4f('0x48')]['id']}})[_0x3e4f('0x25')](handleEntityNotFound(_0x52e5cc,null))[_0x3e4f('0x25')](function(_0x548e6c){if(_0x548e6c){return _0x548e6c[_0x3e4f('0x49')](_0x445f90[_0x3e4f('0x47')]['ids'],_[_0x3e4f('0x4b')](_0x445f90[_0x3e4f('0x47')],[_0x3e4f('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x52e5cc,null))[_0x3e4f('0x42')](handleError(_0x52e5cc,null));};exports[_0x3e4f('0x4d')]=function(_0x287d10,_0x858ac,_0x3482b4){var _0xbc27f7={};var _0x48a670={};var _0x16af7e;var _0x6e625a;return db['Automation'][_0x3e4f('0x4e')]({'where':{'id':_0x287d10[_0x3e4f('0x48')]['id']}})[_0x3e4f('0x25')](handleEntityNotFound(_0x858ac,null))['then'](function(_0x3044e3){if(_0x3044e3){_0x16af7e=_0x3044e3;_0x48a670[_0x3e4f('0x2f')]=_[_0x3e4f('0x31')](db[_0x3e4f('0x4a')][_0x3e4f('0x43')]);_0x48a670['query']=_[_0x3e4f('0x31')](_0x287d10[_0x3e4f('0x30')]);_0x48a670[_0x3e4f('0x32')]=_[_0x3e4f('0x33')](_0x48a670[_0x3e4f('0x2f')],_0x48a670['query']);_0xbc27f7[_0x3e4f('0x34')]=_[_0x3e4f('0x33')](_0x48a670[_0x3e4f('0x2f')],qs['fields'](_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x35')]));_0xbc27f7['attributes']=_0xbc27f7['attributes'][_0x3e4f('0x36')]?_0xbc27f7[_0x3e4f('0x34')]:_0x48a670[_0x3e4f('0x2f')];_0xbc27f7[_0x3e4f('0x39')]=qs[_0x3e4f('0x3a')](_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x3a')]);_0xbc27f7['where']=qs[_0x3e4f('0x32')](_[_0x3e4f('0x3c')](_0x287d10['query'],_0x48a670[_0x3e4f('0x32')]));if(_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x3e')]){_0xbc27f7[_0x3e4f('0x3b')]=_['merge'](_0xbc27f7['where'],{'$or':_[_0x3e4f('0x2a')](_0xbc27f7['attributes'],function(_0x4b1d30){var _0x763508={};_0x763508[_0x4b1d30]={'$like':'%'+_0x287d10['query'][_0x3e4f('0x3e')]+'%'};return _0x763508;})});}_0xbc27f7=_[_0x3e4f('0x4f')]({},_0xbc27f7,_0x287d10[_0x3e4f('0x3f')]);return _0x16af7e[_0x3e4f('0x4d')](_0xbc27f7);}})[_0x3e4f('0x25')](function(_0x225c8f){if(_0x225c8f){_0x6e625a=_0x225c8f[_0x3e4f('0x36')];if(!_0x287d10[_0x3e4f('0x30')]['hasOwnProperty'](_0x3e4f('0x38'))){_0xbc27f7['limit']=qs[_0x3e4f('0x1c')](_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x1c')]);_0xbc27f7[_0x3e4f('0x1a')]=qs[_0x3e4f('0x1a')](_0x287d10[_0x3e4f('0x30')][_0x3e4f('0x1a')]);}return _0x16af7e['getConditions'](_0xbc27f7);}})[_0x3e4f('0x25')](function(_0x1b4a10){if(_0x1b4a10){return _0x1b4a10?{'count':_0x6e625a,'rows':_0x1b4a10}:null;}})[_0x3e4f('0x25')](respondWithResult(_0x858ac,null))[_0x3e4f('0x42')](handleError(_0x858ac,null));};exports[_0x3e4f('0x50')]=function(_0x2f04e9,_0x895589,_0x1db8e0){return db[_0x3e4f('0x51')]['find']({'where':{'id':_0x2f04e9[_0x3e4f('0x48')]['id']}})[_0x3e4f('0x25')](handleEntityNotFound(_0x895589,null))[_0x3e4f('0x25')](function(_0x5834c5){if(_0x5834c5){return _0x5834c5['addActions'](_0x2f04e9[_0x3e4f('0x47')][_0x3e4f('0x4c')],_[_0x3e4f('0x4b')](_0x2f04e9['body'],[_0x3e4f('0x4c'),'id'])||{});}})[_0x3e4f('0x25')](respondWithResult(_0x895589,null))[_0x3e4f('0x42')](handleError(_0x895589,null));};exports[_0x3e4f('0x52')]=function(_0x39b55f,_0x5bab1e,_0x2545d8){var _0x45b34a={};var _0x1460ef={};var _0x4e89c3;var _0x28b995;return db[_0x3e4f('0x2b')][_0x3e4f('0x4e')]({'where':{'id':_0x39b55f[_0x3e4f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bab1e,null))['then'](function(_0x148bda){if(_0x148bda){_0x4e89c3=_0x148bda;_0x1460ef['model']=_[_0x3e4f('0x31')](db[_0x3e4f('0x51')][_0x3e4f('0x43')]);_0x1460ef[_0x3e4f('0x30')]=_[_0x3e4f('0x31')](_0x39b55f[_0x3e4f('0x30')]);_0x1460ef[_0x3e4f('0x32')]=_[_0x3e4f('0x33')](_0x1460ef[_0x3e4f('0x2f')],_0x1460ef[_0x3e4f('0x30')]);_0x45b34a[_0x3e4f('0x34')]=_['intersection'](_0x1460ef['model'],qs[_0x3e4f('0x35')](_0x39b55f[_0x3e4f('0x30')]['fields']));_0x45b34a[_0x3e4f('0x34')]=_0x45b34a[_0x3e4f('0x34')]['length']?_0x45b34a[_0x3e4f('0x34')]:_0x1460ef['model'];_0x45b34a[_0x3e4f('0x39')]=qs[_0x3e4f('0x3a')](_0x39b55f[_0x3e4f('0x30')][_0x3e4f('0x3a')]);_0x45b34a['where']=qs[_0x3e4f('0x32')](_[_0x3e4f('0x3c')](_0x39b55f[_0x3e4f('0x30')],_0x1460ef[_0x3e4f('0x32')]));if(_0x39b55f['query']['filter']){_0x45b34a[_0x3e4f('0x3b')]=_['merge'](_0x45b34a[_0x3e4f('0x3b')],{'$or':_[_0x3e4f('0x2a')](_0x45b34a[_0x3e4f('0x34')],function(_0xc483ba){var _0x4a72e4={};_0x4a72e4[_0xc483ba]={'$like':'%'+_0x39b55f[_0x3e4f('0x30')][_0x3e4f('0x3e')]+'%'};return _0x4a72e4;})});}_0x45b34a=_[_0x3e4f('0x4f')]({},_0x45b34a,_0x39b55f[_0x3e4f('0x3f')]);return _0x4e89c3[_0x3e4f('0x52')](_0x45b34a);}})[_0x3e4f('0x25')](function(_0x33bd89){if(_0x33bd89){_0x28b995=_0x33bd89['length'];if(!_0x39b55f[_0x3e4f('0x30')][_0x3e4f('0x37')](_0x3e4f('0x38'))){_0x45b34a['limit']=qs[_0x3e4f('0x1c')](_0x39b55f['query']['limit']);_0x45b34a[_0x3e4f('0x1a')]=qs[_0x3e4f('0x1a')](_0x39b55f[_0x3e4f('0x30')][_0x3e4f('0x1a')]);}return _0x4e89c3['getActions'](_0x45b34a);}})['then'](function(_0x3e25b0){if(_0x3e25b0){return _0x3e25b0?{'count':_0x28b995,'rows':_0x3e25b0}:null;}})['then'](respondWithResult(_0x5bab1e,null))[_0x3e4f('0x42')](handleError(_0x5bab1e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 06a6365..89d3bbe 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 _0x789c=['tools_automations','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x789c,0x15f));var _0xc789=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x789c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc789('0x0'));var util=require('util');var logger=require(_0xc789('0x1'))(_0xc789('0x2'));var moment=require(_0xc789('0x3'));var BPromise=require(_0xc789('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc789('0x5'));var config=require(_0xc789('0x6'));var attributes=require(_0xc789('0x7'));module[_0xc789('0x8')]=function(_0x961b05,_0x91c3cd){return _0x961b05['define']('Automation',attributes,{'tableName':_0xc789('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac06=['Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports','define'];(function(_0x4ab311,_0x51ac35){var _0x2c56c0=function(_0x17186d){while(--_0x17186d){_0x4ab311['push'](_0x4ab311['shift']());}};_0x2c56c0(++_0x51ac35);}(_0xac06,0x147));var _0x6ac0=function(_0x32dee9,_0x1d1b20){_0x32dee9=_0x32dee9-0x0;var _0x12b69d=_0xac06[_0x32dee9];return _0x12b69d;};'use strict';var _=require(_0x6ac0('0x0'));var util=require(_0x6ac0('0x1'));var logger=require(_0x6ac0('0x2'))(_0x6ac0('0x3'));var moment=require(_0x6ac0('0x4'));var BPromise=require(_0x6ac0('0x5'));var rp=require(_0x6ac0('0x6'));var fs=require('fs');var path=require(_0x6ac0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ac0('0x8'));module[_0x6ac0('0x9')]=function(_0x428ce6,_0x5770a0){return _0x428ce6[_0x6ac0('0xa')](_0x6ac0('0xb'),attributes,{'tableName':_0x6ac0('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 c2eca10..e437c88 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 _0x56c8=['message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','Automation,\x20%s,\x20%s'];(function(_0x5ca7a0,_0x283e56){var _0x21b556=function(_0x269c26){while(--_0x269c26){_0x5ca7a0['push'](_0x5ca7a0['shift']());}};_0x21b556(++_0x283e56);}(_0x56c8,0x12f));var _0x856c=function(_0x3b3db7,_0xc205e4){_0x3b3db7=_0x3b3db7-0x0;var _0x1f0b26=_0x56c8[_0x3b3db7];return _0x1f0b26;};'use strict';var _=require(_0x856c('0x0'));var util=require(_0x856c('0x1'));var moment=require(_0x856c('0x2'));var BPromise=require(_0x856c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x856c('0x4'));var db=require(_0x856c('0x5'))['db'];var utils=require(_0x856c('0x6'));var logger=require(_0x856c('0x7'))(_0x856c('0x8'));var config=require('../../config/environment');var jayson=require(_0x856c('0x9'));var client=jayson[_0x856c('0xa')][_0x856c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15a17c,_0x338a7e,_0x456bdb){return new BPromise(function(_0x48d81b,_0x5064ef){return client[_0x856c('0xc')](_0x15a17c,_0x456bdb)[_0x856c('0xd')](function(_0xa2bd07){logger['info']('Automation,\x20%s,\x20%s',_0x338a7e,'request\x20sent');logger[_0x856c('0xe')](_0x856c('0xf'),_0x338a7e,_0x856c('0x10'),JSON['stringify'](_0xa2bd07));if(_0xa2bd07[_0x856c('0x11')]){if(_0xa2bd07[_0x856c('0x11')]['code']===0x1f4){logger[_0x856c('0x11')](_0x856c('0x12'),_0x338a7e,_0xa2bd07[_0x856c('0x11')][_0x856c('0x13')]);return _0x5064ef(_0xa2bd07[_0x856c('0x11')][_0x856c('0x13')]);}logger[_0x856c('0x11')](_0x856c('0x12'),_0x338a7e,_0xa2bd07['error'][_0x856c('0x13')]);return _0x48d81b(_0xa2bd07['error'][_0x856c('0x13')]);}else{logger[_0x856c('0x14')](_0x856c('0x12'),_0x338a7e,_0x856c('0x10'));_0x48d81b(_0xa2bd07[_0x856c('0x15')][_0x856c('0x13')]);}})[_0x856c('0x16')](function(_0x13b1c6){logger[_0x856c('0x11')](_0x856c('0x12'),_0x338a7e,_0x13b1c6);_0x5064ef(_0x13b1c6);});});} \ No newline at end of file +var _0x9ab8=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0x9ab8,0x81));var _0x89ab=function(_0x5995e1,_0x5282b8){_0x5995e1=_0x5995e1-0x0;var _0x4a4f39=_0x9ab8[_0x5995e1];return _0x4a4f39;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var moment=require(_0x89ab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x89ab('0x4'));var logger=require(_0x89ab('0x5'))('rpc');var config=require(_0x89ab('0x6'));var jayson=require(_0x89ab('0x7'));var client=jayson[_0x89ab('0x8')][_0x89ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29a984,_0x3ecaa0,_0x366c32){return new BPromise(function(_0x5fd99f,_0x42da87){return client[_0x89ab('0xa')](_0x29a984,_0x366c32)[_0x89ab('0xb')](function(_0x36dc63){logger['info']('Automation,\x20%s,\x20%s',_0x3ecaa0,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3ecaa0,_0x89ab('0xc'),JSON[_0x89ab('0xd')](_0x36dc63));if(_0x36dc63[_0x89ab('0xe')]){if(_0x36dc63[_0x89ab('0xe')][_0x89ab('0xf')]===0x1f4){logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x36dc63['error'][_0x89ab('0x11')]);return _0x42da87(_0x36dc63[_0x89ab('0xe')][_0x89ab('0x11')]);}logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x36dc63['error'][_0x89ab('0x11')]);return _0x5fd99f(_0x36dc63[_0x89ab('0xe')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3ecaa0,'request\x20sent');_0x5fd99f(_0x36dc63['result']['message']);}})[_0x89ab('0x12')](function(_0x1ce918){logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x1ce918);_0x42da87(_0x1ce918);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 551c599..101c8b6 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 _0x5a53=['../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','/:id/actions','create','post','addActions','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x485539,_0x5491b7){var _0x2d3d75=function(_0x46ae89){while(--_0x46ae89){_0x485539['push'](_0x485539['shift']());}};_0x2d3d75(++_0x5491b7);}(_0x5a53,0x1d2));var _0x35a5=function(_0x25b2e9,_0x32e1eb){_0x25b2e9=_0x25b2e9-0x0;var _0x3e7159=_0x5a53[_0x25b2e9];return _0x3e7159;};'use strict';var multer=require(_0x35a5('0x0'));var util=require(_0x35a5('0x1'));var path=require(_0x35a5('0x2'));var timeout=require(_0x35a5('0x3'));var express=require(_0x35a5('0x4'));var router=express[_0x35a5('0x5')]();var fs_extra=require(_0x35a5('0x6'));var auth=require(_0x35a5('0x7'));var interaction=require(_0x35a5('0x8'));var config=require(_0x35a5('0x9'));var controller=require(_0x35a5('0xa'));router['get']('/',auth[_0x35a5('0xb')](),controller[_0x35a5('0xc')]);router[_0x35a5('0xd')](_0x35a5('0xe'),auth['isAuthenticated'](),controller[_0x35a5('0xf')]);router[_0x35a5('0xd')](_0x35a5('0x10'),auth['isAuthenticated'](),controller['getConditions']);router[_0x35a5('0xd')](_0x35a5('0x11'),auth[_0x35a5('0xb')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x35a5('0x12')]);router[_0x35a5('0x13')](_0x35a5('0x10'),auth[_0x35a5('0xb')](),controller['addConditions']);router[_0x35a5('0x13')](_0x35a5('0x11'),auth['isAuthenticated'](),controller[_0x35a5('0x14')]);router[_0x35a5('0x15')](_0x35a5('0xe'),auth[_0x35a5('0xb')](),controller[_0x35a5('0x16')]);router['delete'](_0x35a5('0xe'),auth[_0x35a5('0xb')](),controller[_0x35a5('0x17')]);module[_0x35a5('0x18')]=router; \ No newline at end of file +var _0xd33b=['/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd33b,0x1af));var _0xbd33=function(_0x5e20f3,_0x53bc46){_0x5e20f3=_0x5e20f3-0x0;var _0x3442ae=_0xd33b[_0x5e20f3];return _0x3442ae;};'use strict';var multer=require(_0xbd33('0x0'));var util=require(_0xbd33('0x1'));var path=require('path');var timeout=require(_0xbd33('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd33('0x3'));var interaction=require(_0xbd33('0x4'));var config=require('../../config/environment');var controller=require(_0xbd33('0x5'));router[_0xbd33('0x6')]('/',auth[_0xbd33('0x7')](),controller[_0xbd33('0x8')]);router['get'](_0xbd33('0x9'),auth['isAuthenticated'](),controller[_0xbd33('0xa')]);router[_0xbd33('0x6')](_0xbd33('0xb'),auth[_0xbd33('0x7')](),controller[_0xbd33('0xc')]);router[_0xbd33('0x6')](_0xbd33('0xd'),auth['isAuthenticated'](),controller[_0xbd33('0xe')]);router[_0xbd33('0xf')]('/',auth['isAuthenticated'](),controller[_0xbd33('0x10')]);router[_0xbd33('0xf')](_0xbd33('0xb'),auth['isAuthenticated'](),controller[_0xbd33('0x11')]);router[_0xbd33('0xf')](_0xbd33('0xd'),auth[_0xbd33('0x7')](),controller[_0xbd33('0x12')]);router[_0xbd33('0x13')](_0xbd33('0x9'),auth['isAuthenticated'](),controller[_0xbd33('0x14')]);router[_0xbd33('0x15')](_0xbd33('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 6cc9f19..8d59d3d 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 _0x6817=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)'];(function(_0x405022,_0x2377a8){var _0x3b29e7=function(_0xb927b5){while(--_0xb927b5){_0x405022['push'](_0x405022['shift']());}};_0x3b29e7(++_0x2377a8);}(_0x6817,0xf8));var _0x7681=function(_0x34bc59,_0x144bd3){_0x34bc59=_0x34bc59-0x0;var _0x5c40ad=_0x6817[_0x34bc59];return _0x5c40ad;};'use strict';var Sequelize=require(_0x7681('0x0'));module[_0x7681('0x1')]={'name':{'type':Sequelize[_0x7681('0x2')],'unique':_0x7681('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7681('0x4')](_0x7681('0x5')),'allowNull':![],'defaultValue':_0x7681('0x5')},'description':{'type':Sequelize[_0x7681('0x2')]},'active':{'type':Sequelize[_0x7681('0x6')],'defaultValue':0x0,'comment':_0x7681('0x7')},'limitCalls':{'type':Sequelize[_0x7681('0x8')](0x4)[_0x7681('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7681('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7681('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x7681('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7681('0x8')](0x3)[_0x7681('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7681('0x8')](0x5)[_0x7681('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x7681('0x8')](0x3)[_0x7681('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7681('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7681('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7681('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x7681('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7681('0x8')](0x5)[_0x7681('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7681('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7681('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7681('0xf')},'dialTimezone':{'type':Sequelize[_0x7681('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7681('0x4')](_0x7681('0x10'),_0x7681('0x11'),_0x7681('0x12')),'defaultValue':_0x7681('0x10')},'dialAMDActive':{'type':Sequelize[_0x7681('0x6')],'defaultValue':0x0,'comment':_0x7681('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x7681('0x8')](0x9)[_0x7681('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7681('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x7681('0x8')](0x9)[_0x7681('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7681('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7681('0x8')](0x9)[_0x7681('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7681('0x8')](0x9)[_0x7681('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7681('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x7681('0x8')](0x9)[_0x7681('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7681('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7681('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7681('0x8')](0x9)[_0x7681('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7681('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7681('0x8')](0x9)[_0x7681('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7681('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7681('0x4')](_0x7681('0x1a'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7681('0x8')](0x3)[_0x7681('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7681('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7681('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7681('0x8')](0x3)[_0x7681('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7681('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7681('0x8')](0x5)[_0x7681('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7681('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7681('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7681('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x7681('0x8')](0x5)[_0x7681('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7681('0x8')](0x3)[_0x7681('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7681('0x8')](0x5)[_0x7681('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7681('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x7681('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7681('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7681('0x8')](0x5)[_0x7681('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7681('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7681('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7681('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x834c=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','STRING','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x57a75f,_0x4c764d){var _0x1b7bda=function(_0x3d200e){while(--_0x3d200e){_0x57a75f['push'](_0x57a75f['shift']());}};_0x1b7bda(++_0x4c764d);}(_0x834c,0x73));var _0xc834=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0x834c[_0x514c15];return _0x16283e;};'use strict';var Sequelize=require(_0xc834('0x0'));module[_0xc834('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc834('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc834('0x3')](_0xc834('0x4')),'allowNull':![],'defaultValue':_0xc834('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc834('0x5')],'defaultValue':0x0,'comment':_0xc834('0x6')},'limitCalls':{'type':Sequelize[_0xc834('0x7')](0x4)[_0xc834('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc834('0x9')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc834('0x9')]},'dialOriginateTimeout':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc834('0x9')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc834('0x9')],'defaultValue':_0xc834('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc834('0x3')](_0xc834('0x10'),_0xc834('0x11'),'onlyIfOpen'),'defaultValue':_0xc834('0x10')},'dialAMDActive':{'type':Sequelize[_0xc834('0x5')],'defaultValue':0x0,'comment':_0xc834('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc834('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xc834('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc834('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc834('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc834('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc834('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc834('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc834('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc834('0x7')](0x9)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc834('0x7')](0x5)[_0xc834('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc834('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xc834('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc834('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xc834('0x9')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc834('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc834('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc834('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0x1c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc834('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc834('0x7')](0x3)[_0xc834('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc834('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc834('0x7')](0x5)[_0xc834('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ba950b3..f067576 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 _0x9173=['from','cm_contacts','deletedAt\x20IS\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','NOW()','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cmHopperId','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','omit','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','IvrCampaigns','UserProfileResource','then','sendStatus','error','stack','name','send','Campaign','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','find','update','getHoppers','CmHopper','findAll','getHopperHistories','findOne','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','field','CmListId','toString','ListId'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x9173,0xb4));var _0x3917=function(_0x45fc2e,_0x23f96b){_0x45fc2e=_0x45fc2e-0x0;var _0x2e193e=_0x9173[_0x45fc2e];return _0x2e193e;};'use strict';var emlformat=require(_0x3917('0x0'));var rimraf=require(_0x3917('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3917('0x2'));var rp=require(_0x3917('0x3'));var moment=require(_0x3917('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3917('0x5'));var util=require('util');var path=require(_0x3917('0x6'));var sox=require(_0x3917('0x7'));var csv=require(_0x3917('0x8'));var ejs=require(_0x3917('0x9'));var fs=require('fs');var fs_extra=require(_0x3917('0xa'));var _=require('lodash');var squel=require(_0x3917('0xb'));var crypto=require(_0x3917('0xc'));var jsforce=require(_0x3917('0xd'));var deskjs=require(_0x3917('0xe'));var toCsv=require(_0x3917('0x8'));var querystring=require(_0x3917('0xf'));var Papa=require('papaparse');var Redis=require(_0x3917('0x10'));var authService=require(_0x3917('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3917('0x12'));var hardwareService=require(_0x3917('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3917('0x14'));var licenseUtil=require(_0x3917('0x15'));var db=require(_0x3917('0x16'))['db'];function respondWithStatusCode(_0x351db3,_0x3b3b40){_0x3b3b40=_0x3b3b40||0xcc;return function(_0xc0902d){if(_0xc0902d){return _0x351db3['sendStatus'](_0x3b3b40);}return _0x351db3[_0x3917('0x17')](_0x3b3b40)[_0x3917('0x18')]();};}function respondWithResult(_0x3268eb,_0x1d19bc){_0x1d19bc=_0x1d19bc||0xc8;return function(_0x4d7f6c){if(_0x4d7f6c){return _0x3268eb[_0x3917('0x17')](_0x1d19bc)[_0x3917('0x19')](_0x4d7f6c);}};}function respondWithFilteredResult(_0x36b162,_0x291147){return function(_0x23821c){if(_0x23821c){var _0x483e45=typeof _0x291147[_0x3917('0x1a')]==='undefined'&&typeof _0x291147['limit']===_0x3917('0x1b');var _0x42b9d4=_0x23821c[_0x3917('0x1c')];var _0x509b2b=_0x483e45?0x0:_0x291147[_0x3917('0x1a')];var _0x504934=_0x483e45?_0x23821c['count']:_0x291147[_0x3917('0x1a')]+_0x291147['limit'];var _0x1f91a5;if(_0x504934>=_0x42b9d4){_0x504934=_0x42b9d4;_0x1f91a5=0xc8;}else{_0x1f91a5=0xce;}_0x36b162[_0x3917('0x17')](_0x1f91a5);return _0x36b162[_0x3917('0x1d')](_0x3917('0x1e'),_0x509b2b+'-'+_0x504934+'/'+_0x42b9d4)[_0x3917('0x19')](_0x23821c);}return null;};}function patchUpdates(_0x2f9f7d){return function(_0x1d4e33){try{jsonpatch[_0x3917('0x1f')](_0x1d4e33,_0x2f9f7d,!![]);}catch(_0x15e00f){return BPromise[_0x3917('0x20')](_0x15e00f);}return _0x1d4e33[_0x3917('0x21')]();};}function saveUpdates(_0x4cc295,_0x1e3d24){return function(_0x1adbe4){if(_0x1adbe4){return _0x1adbe4['update'](_0x4cc295)['then'](function(_0xc3397){return _0xc3397;});}return null;};}function removeEntity(_0x52f027,_0x127ab5){return function(_0x337aba){if(_0x337aba){return _0x337aba[_0x3917('0x22')]()['then'](function(){var _0x1e47a2=_0x337aba['get']({'plain':!![]});var _0x454b17=_0x3917('0x23');return db[_0x3917('0x24')]['destroy']({'where':{'type':_0x454b17,'resourceId':_0x1e47a2['id']}})[_0x3917('0x25')](function(){return _0x337aba;});})[_0x3917('0x25')](function(){_0x52f027[_0x3917('0x17')](0xcc)[_0x3917('0x18')]();});}};}function handleEntityNotFound(_0x1ac054,_0x5dfec9){return function(_0x49da86){if(!_0x49da86){_0x1ac054[_0x3917('0x26')](0x194);}return _0x49da86;};}function handleError(_0x2878b2,_0x1c38b2){_0x1c38b2=_0x1c38b2||0x1f4;return function(_0x29eb9b){logger[_0x3917('0x27')](_0x29eb9b[_0x3917('0x28')]);if(_0x29eb9b[_0x3917('0x29')]){delete _0x29eb9b[_0x3917('0x29')];}_0x2878b2[_0x3917('0x17')](_0x1c38b2)[_0x3917('0x2a')](_0x29eb9b);};}exports['index']=function(_0x345869,_0x59096c){var _0x2461a5={},_0x52fc28={},_0xbc4ae={'count':0x0,'rows':[]};var _0x41661a=_['map'](db[_0x3917('0x2b')][_0x3917('0x2c')],function(_0xcf532a){return{'name':_0xcf532a[_0x3917('0x2d')],'type':_0xcf532a['type'][_0x3917('0x2e')]};});_0x52fc28[_0x3917('0x2f')]=_[_0x3917('0x30')](_0x41661a,_0x3917('0x29'));_0x52fc28[_0x3917('0x31')]=_[_0x3917('0x32')](_0x345869[_0x3917('0x31')]);_0x52fc28[_0x3917('0x33')]=_['intersection'](_0x52fc28[_0x3917('0x2f')],_0x52fc28[_0x3917('0x31')]);_0x2461a5[_0x3917('0x34')]=_[_0x3917('0x35')](_0x52fc28[_0x3917('0x2f')],qs['fields'](_0x345869[_0x3917('0x31')]['fields']));_0x2461a5[_0x3917('0x34')]=_0x2461a5[_0x3917('0x34')]['length']?_0x2461a5[_0x3917('0x34')]:_0x52fc28[_0x3917('0x2f')];if(!_0x345869[_0x3917('0x31')][_0x3917('0x36')](_0x3917('0x37'))){_0x2461a5[_0x3917('0x38')]=qs[_0x3917('0x38')](_0x345869[_0x3917('0x31')][_0x3917('0x38')]);_0x2461a5[_0x3917('0x1a')]=qs[_0x3917('0x1a')](_0x345869[_0x3917('0x31')]['offset']);}_0x2461a5[_0x3917('0x39')]=qs[_0x3917('0x3a')](_0x345869[_0x3917('0x31')][_0x3917('0x3a')]);_0x2461a5[_0x3917('0x3b')]=qs['filters'](_[_0x3917('0x3c')](_0x345869[_0x3917('0x31')],_0x52fc28['filters']),_0x41661a);if(_0x345869[_0x3917('0x31')][_0x3917('0x3d')]){_0x2461a5[_0x3917('0x3b')]=_[_0x3917('0x3e')](_0x2461a5['where'],{'$or':_[_0x3917('0x30')](_0x41661a,function(_0x3a4f5f){if(_0x3a4f5f['type']!==_0x3917('0x3f')){var _0xdfa8c1={};_0xdfa8c1[_0x3a4f5f[_0x3917('0x29')]]={'$like':'%'+_0x345869[_0x3917('0x31')]['filter']+'%'};return _0xdfa8c1;}})});}_0x2461a5=_['merge']({},_0x2461a5,_0x345869[_0x3917('0x40')]);var _0x1a5ccc={'where':_0x2461a5[_0x3917('0x3b')]};return db[_0x3917('0x2b')][_0x3917('0x1c')](_0x1a5ccc)['then'](function(_0x20e7a9){_0xbc4ae[_0x3917('0x1c')]=_0x20e7a9;if(_0x345869[_0x3917('0x31')][_0x3917('0x41')]){_0x2461a5[_0x3917('0x42')]=[{'all':!![]}];}return db[_0x3917('0x2b')]['findAll'](_0x2461a5);})[_0x3917('0x25')](function(_0x2b0f07){_0xbc4ae[_0x3917('0x43')]=_0x2b0f07;return _0xbc4ae;})[_0x3917('0x25')](respondWithFilteredResult(_0x59096c,_0x2461a5))[_0x3917('0x44')](handleError(_0x59096c,null));};exports[_0x3917('0x45')]=function(_0x40a439,_0x264aa6){var _0x183931={'raw':![],'where':{'id':_0x40a439[_0x3917('0x46')]['id']}},_0x1d904f={};_0x1d904f[_0x3917('0x2f')]=_[_0x3917('0x32')](db[_0x3917('0x2b')][_0x3917('0x2c')]);_0x1d904f['query']=_[_0x3917('0x32')](_0x40a439[_0x3917('0x31')]);_0x1d904f[_0x3917('0x33')]=_[_0x3917('0x35')](_0x1d904f[_0x3917('0x2f')],_0x1d904f[_0x3917('0x31')]);_0x183931[_0x3917('0x34')]=_[_0x3917('0x35')](_0x1d904f['model'],qs[_0x3917('0x47')](_0x40a439[_0x3917('0x31')][_0x3917('0x47')]));_0x183931['attributes']=_0x183931['attributes'][_0x3917('0x48')]?_0x183931[_0x3917('0x34')]:_0x1d904f[_0x3917('0x2f')];if(_0x40a439[_0x3917('0x31')][_0x3917('0x41')]){_0x183931[_0x3917('0x42')]=[{'all':!![]}];}_0x183931=_[_0x3917('0x3e')]({},_0x183931,_0x40a439[_0x3917('0x40')]);return db['Campaign']['find'](_0x183931)[_0x3917('0x25')](handleEntityNotFound(_0x264aa6,null))[_0x3917('0x25')](respondWithResult(_0x264aa6,null))[_0x3917('0x44')](handleError(_0x264aa6,null));};exports['create']=function(_0x4ba630,_0xac3a4a){return db['Campaign'][_0x3917('0x49')](_0x4ba630[_0x3917('0x4a')],{})[_0x3917('0x25')](function(_0x41a49b){var _0x32aeee=_0x4ba630[_0x3917('0x4b')][_0x3917('0x4c')]({'plain':!![]});if(!_0x32aeee)throw new Error(_0x3917('0x4d'));if(_0x32aeee[_0x3917('0x4e')]===_0x3917('0x4b')){var _0x13efbb=_0x41a49b[_0x3917('0x4c')]({'plain':!![]});var _0x31cdb6=_0x3917('0x23');return db[_0x3917('0x4f')]['find']({'where':{'name':_0x31cdb6,'userProfileId':_0x32aeee[_0x3917('0x50')]},'raw':!![]})[_0x3917('0x25')](function(_0x11cc83){if(_0x11cc83&&_0x11cc83[_0x3917('0x51')]===0x0){return db['UserProfileResource'][_0x3917('0x49')]({'name':_0x13efbb[_0x3917('0x29')],'resourceId':_0x13efbb['id'],'type':_0x11cc83[_0x3917('0x29')],'sectionId':_0x11cc83['id']},{})[_0x3917('0x25')](function(){return _0x41a49b;});}else{return _0x41a49b;}})['catch'](function(_0x4ff953){logger[_0x3917('0x27')](_0x3917('0x52'),_0x4ff953);throw _0x4ff953;});}return _0x41a49b;})['then'](respondWithResult(_0xac3a4a,0xc9))[_0x3917('0x44')](handleError(_0xac3a4a,null));};exports[_0x3917('0x53')]=function(_0x16ce77,_0x59a635){var _0x1b9429={'where':{'id':_0x16ce77[_0x3917('0x46')]['id']}},_0x10f0e4={};_0x10f0e4[_0x3917('0x2f')]=_[_0x3917('0x32')](db[_0x3917('0x2b')][_0x3917('0x2c')]);_0x1b9429[_0x3917('0x34')]=_[_0x3917('0x35')](_0x10f0e4[_0x3917('0x2f')],qs['fields'](_0x16ce77[_0x3917('0x31')][_0x3917('0x47')]));_0x1b9429[_0x3917('0x34')]=_0x1b9429['attributes'][_0x3917('0x48')]?_0x1b9429[_0x3917('0x34')]:_0x10f0e4[_0x3917('0x2f')];if(_0x16ce77['query']['includeAll']){_0x1b9429[_0x3917('0x42')]=[{'all':!![]}];}_0x1b9429=_[_0x3917('0x3e')]({},_0x1b9429,_0x16ce77[_0x3917('0x40')]);return db[_0x3917('0x2b')]['find'](_0x1b9429)[_0x3917('0x25')](handleEntityNotFound(_0x59a635,null))['then'](function(_0x58f800){if(_0x58f800){var _0x25b8fd=_0x58f800[_0x3917('0x4c')]({'plain':!![]});_0x25b8fd=qs['omit'](_0x25b8fd,['id',_0x3917('0x54'),_0x3917('0x55')]);_0x16ce77[_0x3917('0x4a')]=_['omit'](_0x16ce77[_0x3917('0x4a')],['id','createdAt','updatedAt']);return db['Campaign'][_0x3917('0x49')](_['merge'](_0x25b8fd,_0x16ce77[_0x3917('0x4a')]),{'include':_0x16ce77[_0x3917('0x31')][_0x3917('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x7f0063){var _0x327b26=_0x16ce77['user'][_0x3917('0x4c')]({'plain':!![]});if(!_0x327b26)throw new Error(_0x3917('0x4d'));if(_0x327b26['role']==='user'){var _0x344fc3=_0x7f0063['get']({'plain':!![]});var _0x33bf40=_0x3917('0x23');return db[_0x3917('0x4f')][_0x3917('0x56')]({'where':{'name':_0x33bf40,'userProfileId':_0x327b26[_0x3917('0x50')]},'raw':!![]})[_0x3917('0x25')](function(_0x3a53dc){if(_0x3a53dc&&_0x3a53dc[_0x3917('0x51')]===0x0){return db[_0x3917('0x24')][_0x3917('0x49')]({'name':_0x344fc3[_0x3917('0x29')],'resourceId':_0x344fc3['id'],'type':_0x3a53dc[_0x3917('0x29')],'sectionId':_0x3a53dc['id']},{})[_0x3917('0x25')](function(){return _0x7f0063;});}else{return _0x7f0063;}})[_0x3917('0x44')](function(_0x5da6bf){logger[_0x3917('0x27')](_0x3917('0x52'),_0x5da6bf);throw _0x5da6bf;});}return _0x7f0063;});}})[_0x3917('0x25')](respondWithResult(_0x59a635,0xc9))[_0x3917('0x44')](handleError(_0x59a635,null));};exports[_0x3917('0x57')]=function(_0x5de713,_0x1c76bd){if(_0x5de713[_0x3917('0x4a')]['id']){delete _0x5de713[_0x3917('0x4a')]['id'];}return db[_0x3917('0x2b')][_0x3917('0x56')]({'where':{'id':_0x5de713[_0x3917('0x46')]['id']}})[_0x3917('0x25')](handleEntityNotFound(_0x1c76bd,null))[_0x3917('0x25')](saveUpdates(_0x5de713[_0x3917('0x4a')],null))['then'](respondWithResult(_0x1c76bd,null))[_0x3917('0x44')](handleError(_0x1c76bd,null));};exports[_0x3917('0x22')]=function(_0x270a97,_0x1e0932){return db[_0x3917('0x2b')]['find']({'where':{'id':_0x270a97[_0x3917('0x46')]['id']}})[_0x3917('0x25')](handleEntityNotFound(_0x1e0932,null))[_0x3917('0x25')](removeEntity(_0x1e0932,null))[_0x3917('0x44')](handleError(_0x1e0932,null));};exports[_0x3917('0x58')]=function(_0x13edcf,_0x3e0be6,_0x252eba){var _0x3d3b8c={'raw':!![],'where':{}};var _0x4bf1a2={};var _0x1eb196={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x13edcf[_0x3917('0x46')]['id']}})[_0x3917('0x25')](handleEntityNotFound(_0x3e0be6,null))[_0x3917('0x25')](function(_0x48ce29){if(_0x48ce29){_0x4bf1a2[_0x3917('0x2f')]=_[_0x3917('0x32')](db[_0x3917('0x59')][_0x3917('0x2c')]);_0x4bf1a2[_0x3917('0x31')]=_[_0x3917('0x32')](_0x13edcf[_0x3917('0x31')]);_0x4bf1a2['filters']=_[_0x3917('0x35')](_0x4bf1a2[_0x3917('0x2f')],_0x4bf1a2['query']);_0x3d3b8c[_0x3917('0x34')]=_['intersection'](_0x4bf1a2[_0x3917('0x2f')],qs[_0x3917('0x47')](_0x13edcf[_0x3917('0x31')][_0x3917('0x47')]));_0x3d3b8c[_0x3917('0x34')]=_0x3d3b8c['attributes'][_0x3917('0x48')]?_0x3d3b8c[_0x3917('0x34')]:_0x4bf1a2['model'];if(!_0x13edcf[_0x3917('0x31')][_0x3917('0x36')](_0x3917('0x37'))){_0x3d3b8c[_0x3917('0x38')]=qs[_0x3917('0x38')](_0x13edcf[_0x3917('0x31')][_0x3917('0x38')]);_0x3d3b8c[_0x3917('0x1a')]=qs[_0x3917('0x1a')](_0x13edcf[_0x3917('0x31')][_0x3917('0x1a')]);}_0x3d3b8c['order']=qs[_0x3917('0x3a')](_0x13edcf[_0x3917('0x31')][_0x3917('0x3a')]);_0x3d3b8c['where']=qs['filters'](_[_0x3917('0x3c')](_0x13edcf[_0x3917('0x31')],_0x4bf1a2[_0x3917('0x33')]));_0x3d3b8c['where']['CampaignId']=_0x48ce29['id'];if(_0x13edcf[_0x3917('0x31')][_0x3917('0x3d')]){_0x3d3b8c[_0x3917('0x3b')]=_[_0x3917('0x3e')](_0x3d3b8c['where'],{'$or':_[_0x3917('0x30')](_0x3d3b8c[_0x3917('0x34')],function(_0x177915){var _0x1b8816={};_0x1b8816[_0x177915]={'$like':'%'+_0x13edcf[_0x3917('0x31')][_0x3917('0x3d')]+'%'};return _0x1b8816;})});}_0x3d3b8c=_['merge']({},_0x3d3b8c,_0x13edcf['options']);return db['CmHopper']['count']({'where':_0x3d3b8c['where']})[_0x3917('0x25')](function(_0x44e866){_0x1eb196[_0x3917('0x1c')]=_0x44e866;if(_0x13edcf[_0x3917('0x31')][_0x3917('0x41')]){_0x3d3b8c[_0x3917('0x42')]=[{'all':!![]}];}return db[_0x3917('0x59')][_0x3917('0x5a')](_0x3d3b8c);})[_0x3917('0x25')](function(_0x7e1bae){_0x1eb196['rows']=_0x7e1bae;return _0x1eb196;});}})[_0x3917('0x25')](respondWithFilteredResult(_0x3e0be6,_0x3d3b8c))['catch'](handleError(_0x3e0be6,null));};exports[_0x3917('0x5b')]=function(_0x3e9151,_0xe36090,_0x5dfb88){var _0x2a95ab={'raw':!![],'where':{}};var _0x16baa7={};var _0x1bee5f={'count':0x0,'rows':[]};return db[_0x3917('0x2b')][_0x3917('0x5c')]({'where':{'id':_0x3e9151[_0x3917('0x46')]['id']}})[_0x3917('0x25')](handleEntityNotFound(_0xe36090,null))[_0x3917('0x25')](function(_0x507d19){if(_0x507d19){_0x16baa7[_0x3917('0x2f')]=_[_0x3917('0x32')](db['CmHopperHistory'][_0x3917('0x2c')]);_0x16baa7['query']=_[_0x3917('0x32')](_0x3e9151[_0x3917('0x31')]);_0x16baa7[_0x3917('0x33')]=_['intersection'](_0x16baa7[_0x3917('0x2f')],_0x16baa7['query']);_0x2a95ab[_0x3917('0x34')]=_[_0x3917('0x35')](_0x16baa7[_0x3917('0x2f')],qs[_0x3917('0x47')](_0x3e9151[_0x3917('0x31')][_0x3917('0x47')]));_0x2a95ab['attributes']=_0x2a95ab['attributes'][_0x3917('0x48')]?_0x2a95ab[_0x3917('0x34')]:_0x16baa7[_0x3917('0x2f')];if(!_0x3e9151[_0x3917('0x31')]['hasOwnProperty']('nolimit')){_0x2a95ab[_0x3917('0x38')]=qs[_0x3917('0x38')](_0x3e9151[_0x3917('0x31')][_0x3917('0x38')]);_0x2a95ab['offset']=qs['offset'](_0x3e9151[_0x3917('0x31')][_0x3917('0x1a')]);}_0x2a95ab[_0x3917('0x39')]=qs[_0x3917('0x3a')](_0x3e9151['query'][_0x3917('0x3a')]);_0x2a95ab[_0x3917('0x3b')]=qs[_0x3917('0x33')](_['pick'](_0x3e9151['query'],_0x16baa7[_0x3917('0x33')]));_0x2a95ab[_0x3917('0x3b')][_0x3917('0x5d')]=_0x507d19['id'];if(_0x3e9151[_0x3917('0x31')][_0x3917('0x3d')]){_0x2a95ab['where']=_[_0x3917('0x3e')](_0x2a95ab[_0x3917('0x3b')],{'$or':_[_0x3917('0x30')](_0x2a95ab[_0x3917('0x34')],function(_0x43abaf){var _0x45539a={};_0x45539a[_0x43abaf]={'$like':'%'+_0x3e9151[_0x3917('0x31')]['filter']+'%'};return _0x45539a;})});}_0x2a95ab=_[_0x3917('0x3e')]({},_0x2a95ab,_0x3e9151[_0x3917('0x40')]);return db['CmHopperHistory'][_0x3917('0x1c')]({'where':_0x2a95ab['where']})[_0x3917('0x25')](function(_0x5aa45e){_0x1bee5f[_0x3917('0x1c')]=_0x5aa45e;if(_0x3e9151['query'][_0x3917('0x41')]){_0x2a95ab[_0x3917('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3917('0x5a')](_0x2a95ab);})[_0x3917('0x25')](function(_0x1bbf5e){_0x1bee5f['rows']=_0x1bbf5e;return _0x1bee5f;});}})[_0x3917('0x25')](respondWithFilteredResult(_0xe36090,_0x2a95ab))[_0x3917('0x44')](handleError(_0xe36090,null));};exports[_0x3917('0x5e')]=function(_0x4018d4,_0x4b3c61,_0x104872){var _0x475df0={'raw':!![],'where':{}};var _0x447756={};var _0x58ee55={'count':0x0,'rows':[]};return db[_0x3917('0x2b')][_0x3917('0x5c')]({'where':{'id':_0x4018d4[_0x3917('0x46')]['id']}})[_0x3917('0x25')](handleEntityNotFound(_0x4b3c61,null))['then'](function(_0x496bd7){if(_0x496bd7){_0x447756[_0x3917('0x2f')]=_[_0x3917('0x32')](db[_0x3917('0x5f')][_0x3917('0x2c')]);_0x447756[_0x3917('0x31')]=_['keys'](_0x4018d4[_0x3917('0x31')]);_0x447756[_0x3917('0x33')]=_['intersection'](_0x447756[_0x3917('0x2f')],_0x447756[_0x3917('0x31')]);_0x475df0[_0x3917('0x34')]=_['intersection'](_0x447756[_0x3917('0x2f')],qs['fields'](_0x4018d4[_0x3917('0x31')][_0x3917('0x47')]));_0x475df0[_0x3917('0x34')]=_0x475df0[_0x3917('0x34')]['length']?_0x475df0[_0x3917('0x34')]:_0x447756['model'];if(!_0x4018d4[_0x3917('0x31')][_0x3917('0x36')](_0x3917('0x37'))){_0x475df0[_0x3917('0x38')]=qs[_0x3917('0x38')](_0x4018d4[_0x3917('0x31')]['limit']);_0x475df0[_0x3917('0x1a')]=qs[_0x3917('0x1a')](_0x4018d4[_0x3917('0x31')][_0x3917('0x1a')]);}_0x475df0[_0x3917('0x39')]=qs['sort'](_0x4018d4[_0x3917('0x31')][_0x3917('0x3a')]);_0x475df0['where']=qs[_0x3917('0x33')](_['pick'](_0x4018d4[_0x3917('0x31')],_0x447756[_0x3917('0x33')]));_0x475df0[_0x3917('0x3b')][_0x3917('0x5d')]=_0x496bd7['id'];if(_0x4018d4[_0x3917('0x31')][_0x3917('0x3d')]){_0x475df0[_0x3917('0x3b')]=_[_0x3917('0x3e')](_0x475df0[_0x3917('0x3b')],{'$or':_['map'](_0x475df0['attributes'],function(_0x1571af){var _0x2c9068={};_0x2c9068[_0x1571af]={'$like':'%'+_0x4018d4[_0x3917('0x31')]['filter']+'%'};return _0x2c9068;})});}_0x475df0=_[_0x3917('0x3e')]({},_0x475df0,_0x4018d4[_0x3917('0x40')]);return db[_0x3917('0x5f')]['count']({'where':_0x475df0[_0x3917('0x3b')]})['then'](function(_0x1f66a9){_0x58ee55[_0x3917('0x1c')]=_0x1f66a9;if(_0x4018d4[_0x3917('0x31')][_0x3917('0x41')]){_0x475df0[_0x3917('0x42')]=[{'all':!![]}];}return db[_0x3917('0x5f')][_0x3917('0x5a')](_0x475df0);})[_0x3917('0x25')](function(_0x1c6d5c){_0x58ee55[_0x3917('0x43')]=_0x1c6d5c;return _0x58ee55;});}})[_0x3917('0x25')](respondWithFilteredResult(_0x4b3c61,_0x475df0))['catch'](handleError(_0x4b3c61,null));};exports[_0x3917('0x60')]=function(_0x17f0d6,_0x435227,_0x5a2b73){var _0x33ee1e={'raw':!![],'where':{}};var _0x3a9c92={};var _0x775b9b={'count':0x0,'rows':[]};return db[_0x3917('0x2b')][_0x3917('0x5c')]({'where':{'id':_0x17f0d6[_0x3917('0x46')]['id']}})['then'](handleEntityNotFound(_0x435227,null))[_0x3917('0x25')](function(_0x47c666){if(_0x47c666){_0x3a9c92[_0x3917('0x2f')]=_['keys'](db[_0x3917('0x61')]['rawAttributes']);_0x3a9c92[_0x3917('0x31')]=_['keys'](_0x17f0d6[_0x3917('0x31')]);_0x3a9c92['filters']=_[_0x3917('0x35')](_0x3a9c92[_0x3917('0x2f')],_0x3a9c92['query']);_0x33ee1e['attributes']=_[_0x3917('0x35')](_0x3a9c92[_0x3917('0x2f')],qs['fields'](_0x17f0d6['query'][_0x3917('0x47')]));_0x33ee1e[_0x3917('0x34')]=_0x33ee1e[_0x3917('0x34')][_0x3917('0x48')]?_0x33ee1e['attributes']:_0x3a9c92['model'];if(!_0x17f0d6['query'][_0x3917('0x36')](_0x3917('0x37'))){_0x33ee1e[_0x3917('0x38')]=qs[_0x3917('0x38')](_0x17f0d6[_0x3917('0x31')]['limit']);_0x33ee1e['offset']=qs[_0x3917('0x1a')](_0x17f0d6['query'][_0x3917('0x1a')]);}_0x33ee1e[_0x3917('0x39')]=qs[_0x3917('0x3a')](_0x17f0d6[_0x3917('0x31')][_0x3917('0x3a')]);_0x33ee1e[_0x3917('0x3b')]=qs[_0x3917('0x33')](_[_0x3917('0x3c')](_0x17f0d6[_0x3917('0x31')],_0x3a9c92[_0x3917('0x33')]));_0x33ee1e[_0x3917('0x3b')][_0x3917('0x5d')]=_0x47c666['id'];if(_0x17f0d6['query'][_0x3917('0x3d')]){_0x33ee1e['where']=_[_0x3917('0x3e')](_0x33ee1e['where'],{'$or':_['map'](_0x33ee1e[_0x3917('0x34')],function(_0x2ab98d){var _0x2013e8={};_0x2013e8[_0x2ab98d]={'$like':'%'+_0x17f0d6[_0x3917('0x31')][_0x3917('0x3d')]+'%'};return _0x2013e8;})});}_0x33ee1e=_[_0x3917('0x3e')]({},_0x33ee1e,_0x17f0d6['options']);return db['CmHopperBlack'][_0x3917('0x1c')]({'where':_0x33ee1e['where']})[_0x3917('0x25')](function(_0x161220){_0x775b9b[_0x3917('0x1c')]=_0x161220;if(_0x17f0d6[_0x3917('0x31')][_0x3917('0x41')]){_0x33ee1e[_0x3917('0x42')]=[{'all':!![]}];}return db[_0x3917('0x61')][_0x3917('0x5a')](_0x33ee1e);})[_0x3917('0x25')](function(_0x19720c){_0x775b9b[_0x3917('0x43')]=_0x19720c;return _0x775b9b;});}})['then'](respondWithFilteredResult(_0x435227,_0x33ee1e))[_0x3917('0x44')](handleError(_0x435227,null));};exports['getLists']=function(_0x4d9990,_0x596935,_0x37d757){var _0x16c5b5={};var _0x1beb30={};var _0xc4b3bf;var _0x3ae46c;return db[_0x3917('0x2b')][_0x3917('0x5c')]({'where':{'id':_0x4d9990['params']['id']}})[_0x3917('0x25')](handleEntityNotFound(_0x596935,null))[_0x3917('0x25')](function(_0x507ce2){if(_0x507ce2){_0xc4b3bf=_0x507ce2;_0x1beb30[_0x3917('0x2f')]=_['keys'](db['CmList']['rawAttributes']);_0x1beb30['query']=_[_0x3917('0x32')](_0x4d9990[_0x3917('0x31')]);_0x1beb30[_0x3917('0x33')]=_[_0x3917('0x35')](_0x1beb30['model'],_0x1beb30[_0x3917('0x31')]);_0x16c5b5['attributes']=_['intersection'](_0x1beb30['model'],qs['fields'](_0x4d9990[_0x3917('0x31')][_0x3917('0x47')]));_0x16c5b5[_0x3917('0x34')]=_0x16c5b5[_0x3917('0x34')]['length']?_0x16c5b5[_0x3917('0x34')]:_0x1beb30[_0x3917('0x2f')];_0x16c5b5[_0x3917('0x39')]=qs['sort'](_0x4d9990[_0x3917('0x31')][_0x3917('0x3a')]);_0x16c5b5[_0x3917('0x3b')]=qs[_0x3917('0x33')](_['pick'](_0x4d9990[_0x3917('0x31')],_0x1beb30[_0x3917('0x33')]));if(_0x4d9990['query'][_0x3917('0x3d')]){_0x16c5b5['where']=_[_0x3917('0x3e')](_0x16c5b5[_0x3917('0x3b')],{'$or':_[_0x3917('0x30')](_0x16c5b5[_0x3917('0x34')],function(_0x47e122){var _0x559200={};_0x559200[_0x47e122]={'$like':'%'+_0x4d9990[_0x3917('0x31')][_0x3917('0x3d')]+'%'};return _0x559200;})});}_0x16c5b5=_[_0x3917('0x3e')]({},_0x16c5b5,_0x4d9990[_0x3917('0x40')]);return _0xc4b3bf[_0x3917('0x62')](_0x16c5b5);}})[_0x3917('0x25')](function(_0x37fa99){if(_0x37fa99){_0x3ae46c=_0x37fa99[_0x3917('0x48')];if(!_0x4d9990[_0x3917('0x31')][_0x3917('0x36')](_0x3917('0x37'))){_0x16c5b5[_0x3917('0x38')]=qs[_0x3917('0x38')](_0x4d9990[_0x3917('0x31')][_0x3917('0x38')]);_0x16c5b5['offset']=qs[_0x3917('0x1a')](_0x4d9990[_0x3917('0x31')]['offset']);}return _0xc4b3bf[_0x3917('0x62')](_0x16c5b5);}})['then'](function(_0x3b5446){if(_0x3b5446){return _0x3b5446?{'count':_0x3ae46c,'rows':_0x3b5446}:null;}})['then'](respondWithResult(_0x596935,null))[_0x3917('0x44')](handleError(_0x596935,null));};exports['addLists']=function(_0x72cb5a,_0x132ceb,_0x476dbf){var _0x577c34,_0x4c6dc4;var _0x4438f4=[];var _0x2fd9d8=moment()[_0x3917('0x63')](_0x3917('0x64'));return db[_0x3917('0x2b')][_0x3917('0x56')]({'where':{'id':_0x72cb5a['params']['id']}})['then'](handleEntityNotFound(_0x132ceb,null))[_0x3917('0x25')](function(_0x2f0d10){if(_0x2f0d10){_0x4c6dc4=_0x2f0d10;return _0x2f0d10[_0x3917('0x65')](_0x72cb5a[_0x3917('0x4a')]['ids'],_['omit'](_0x72cb5a[_0x3917('0x4a')],[_0x3917('0x66'),'id'])||{});}return null;})['spread'](function(_0x1ca27f){var _0x4b0407;var _0x2e7300;_0x577c34=_0x1ca27f||[];var _0xb307be=[];if(_0x1ca27f){for(var _0x3b9fd5=0x0;_0x3b9fd5<_0x1ca27f[_0x3917('0x48')];_0x3b9fd5+=0x1){var _0x2c897e=_0x1ca27f[_0x3b9fd5]['get']({'plain':!![]});_0x4c6dc4['dialCheckDuplicateType']=_0x72cb5a['body'][_0x3917('0x67')]?_0x72cb5a[_0x3917('0x4a')][_0x3917('0x67')]:_0x4c6dc4[_0x3917('0x67')];switch(_0x4c6dc4[_0x3917('0x67')]){case _0x3917('0x68'):_0x4b0407=squel[_0x3917('0x69')]()[_0x3917('0x6a')](_0x3917('0x6b'))[_0x3917('0x6c')]([_0x3917('0x6d'),_0x3917('0x6e'),_0x3917('0x6f'),'ListId','CampaignId',_0x3917('0x54'),_0x3917('0x55')],squel['select']()['field'](_0x3917('0x6d'),'phone')[_0x3917('0x70')]('NOW()',_0x3917('0x6e'))[_0x3917('0x70')]('id',_0x3917('0x6f'))[_0x3917('0x70')](_0x2c897e[_0x3917('0x71')][_0x3917('0x72')](),_0x3917('0x73'))['field'](_0x72cb5a[_0x3917('0x46')]['id'][_0x3917('0x72')](),_0x3917('0x5d'))[_0x3917('0x70')]('\x27'+_0x2fd9d8+'\x27','createdAt')[_0x3917('0x70')]('\x27'+_0x2fd9d8+'\x27',_0x3917('0x55'))[_0x3917('0x74')](_0x3917('0x75'))[_0x3917('0x3b')](_0x3917('0x76'))[_0x3917('0x3b')]('ListId\x20=\x20?',_0x2c897e[_0x3917('0x71')][_0x3917('0x72')]())[_0x3917('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x3917('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3917('0x77')]()[_0x3917('0x70')](_0x3917('0x78'))['from'](_0x3917('0x79'))[_0x3917('0x3b')](_0x3917('0x7a'),_0x72cb5a[_0x3917('0x46')]['id'][_0x3917('0x72')]()))[_0x3917('0x3b')](_0x3917('0x7b'),squel['select']()[_0x3917('0x70')](_0x3917('0x7c'))['from'](_0x3917('0x6b'))['where'](_0x3917('0x7a'),_0x72cb5a[_0x3917('0x46')]['id']['toString']())))['toString']();break;case _0x3917('0x7d'):_0x4b0407=squel[_0x3917('0x69')]()[_0x3917('0x6a')]('cm_hopper')[_0x3917('0x6c')]([_0x3917('0x6d'),'scheduledAt','ContactId',_0x3917('0x73'),_0x3917('0x5d'),_0x3917('0x54'),'updatedAt'],squel[_0x3917('0x77')]()[_0x3917('0x70')](_0x3917('0x6d'),_0x3917('0x6d'))[_0x3917('0x70')](_0x3917('0x7e'),_0x3917('0x6e'))[_0x3917('0x70')]('id',_0x3917('0x6f'))['field'](_0x2c897e[_0x3917('0x71')][_0x3917('0x72')](),_0x3917('0x73'))[_0x3917('0x70')](_0x72cb5a['params']['id'][_0x3917('0x72')](),_0x3917('0x5d'))[_0x3917('0x70')]('\x27'+_0x2fd9d8+'\x27',_0x3917('0x54'))[_0x3917('0x70')]('\x27'+_0x2fd9d8+'\x27',_0x3917('0x55'))[_0x3917('0x74')](_0x3917('0x75'))[_0x3917('0x3b')]('deletedAt\x20IS\x20NULL')[_0x3917('0x3b')]('ListId\x20=\x20?',_0x2c897e[_0x3917('0x71')][_0x3917('0x72')]())[_0x3917('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x3917('0x7b'),squel['select']()[_0x3917('0x70')]('COALESCE(phone,\x27\x27)')['from'](_0x3917('0x6b'))['where'](_0x3917('0x7a'),_0x72cb5a[_0x3917('0x46')]['id'][_0x3917('0x72')]())))[_0x3917('0x72')]();break;default:_0x4b0407=squel[_0x3917('0x69')]()[_0x3917('0x6a')](_0x3917('0x6b'))[_0x3917('0x6c')]([_0x3917('0x6d'),'scheduledAt','ContactId',_0x3917('0x73'),_0x3917('0x5d'),'createdAt',_0x3917('0x55')],squel[_0x3917('0x77')]()['field'](_0x3917('0x6d'),_0x3917('0x6d'))[_0x3917('0x70')](_0x3917('0x7e'),'scheduledAt')['field']('id','ContactId')['field'](_0x2c897e[_0x3917('0x71')][_0x3917('0x72')](),_0x3917('0x73'))[_0x3917('0x70')](_0x72cb5a[_0x3917('0x46')]['id']['toString'](),_0x3917('0x5d'))[_0x3917('0x70')]('\x27'+_0x2fd9d8+'\x27',_0x3917('0x54'))[_0x3917('0x70')]('\x27'+_0x2fd9d8+'\x27',_0x3917('0x55'))['from'](_0x3917('0x75'))[_0x3917('0x3b')](_0x3917('0x76'))[_0x3917('0x3b')](_0x3917('0x7f'),_0x2c897e['CmListId'][_0x3917('0x72')]())[_0x3917('0x3b')](_0x3917('0x80')))['toString']();}_0x2e7300=squel[_0x3917('0x69')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x3917('0x81'),_0x3917('0x6e'),_0x3917('0x6d'),_0x3917('0x82'),_0x3917('0x54'),_0x3917('0x55')],squel[_0x3917('0x77')]()[_0x3917('0x70')](_0x3917('0x83'),'id')[_0x3917('0x70')](_0x3917('0x7e'),_0x3917('0x6e'))[_0x3917('0x70')]('ci.item',_0x3917('0x6d'))['field'](_0x3917('0x84'),'OrderBy')['field']('\x27'+_0x2fd9d8+'\x27',_0x3917('0x54'))['field']('\x27'+_0x2fd9d8+'\x27','updatedAt')[_0x3917('0x74')](_0x3917('0x85'),'ci')[_0x3917('0x86')](_0x3917('0x6b'),'h',_0x3917('0x87'))[_0x3917('0x3b')](_0x3917('0x88'),_0x2c897e['CmListId'][_0x3917('0x72')]())[_0x3917('0x3b')](_0x3917('0x89'),_0x72cb5a[_0x3917('0x46')]['id']['toString']())[_0x3917('0x3b')]('h.createdAt\x20=\x20?',_0x2fd9d8))['toString']();_0xb307be[_0x3917('0x8a')](db[_0x3917('0x8b')][_0x3917('0x31')](_0x4b0407));_0x4438f4[_0x3917('0x8a')](db['sequelize']['query'](_0x2e7300));}return BPromise[_0x3917('0x8c')](_0xb307be);}})[_0x3917('0x25')](function(){return BPromise['all'](_0x4438f4);})[_0x3917('0x25')](function(){return _0x577c34;})[_0x3917('0x25')](respondWithResult(_0x132ceb,null))[_0x3917('0x44')](handleError(_0x132ceb,null));};exports[_0x3917('0x8d')]=function(_0x3ad94b,_0xf42d28,_0x227276){return db[_0x3917('0x2b')]['find']({'where':{'id':_0x3ad94b[_0x3917('0x46')]['id']}})[_0x3917('0x25')](handleEntityNotFound(_0xf42d28,null))[_0x3917('0x25')](function(_0x3c6faf){if(_0x3c6faf){return _0x3c6faf[_0x3917('0x8d')](_0x3ad94b['query']['ids']);}})[_0x3917('0x25')](function(_0x568eb4){if(_0x568eb4){return db[_0x3917('0x59')][_0x3917('0x22')]({'where':{'ListId':_0x3ad94b[_0x3917('0x31')]['ids'],'CampaignId':_0x3ad94b['params']['id']}})[_0x3917('0x25')](function(){return _0x568eb4;});}})[_0x3917('0x25')](respondWithStatusCode(_0xf42d28,null))[_0x3917('0x44')](handleError(_0xf42d28,null));};exports[_0x3917('0x8e')]=function(_0x18145f,_0x5a2fa1,_0x2f0940){var _0x5519de={};var _0x47cdf2={};var _0x386f6a;var _0x1ad520;return db['Campaign'][_0x3917('0x5c')]({'where':{'id':_0x18145f[_0x3917('0x46')]['id']}})[_0x3917('0x25')](handleEntityNotFound(_0x5a2fa1,null))['then'](function(_0x2953ca){if(_0x2953ca){_0x386f6a=_0x2953ca;_0x47cdf2[_0x3917('0x2f')]=_['keys'](db[_0x3917('0x8f')][_0x3917('0x2c')]);_0x47cdf2['query']=_[_0x3917('0x32')](_0x18145f[_0x3917('0x31')]);_0x47cdf2[_0x3917('0x33')]=_['intersection'](_0x47cdf2[_0x3917('0x2f')],_0x47cdf2[_0x3917('0x31')]);_0x5519de[_0x3917('0x34')]=_[_0x3917('0x35')](_0x47cdf2[_0x3917('0x2f')],qs[_0x3917('0x47')](_0x18145f[_0x3917('0x31')][_0x3917('0x47')]));_0x5519de['attributes']=_0x5519de['attributes'][_0x3917('0x48')]?_0x5519de[_0x3917('0x34')]:_0x47cdf2[_0x3917('0x2f')];_0x5519de[_0x3917('0x39')]=qs[_0x3917('0x3a')](_0x18145f[_0x3917('0x31')][_0x3917('0x3a')]);_0x5519de[_0x3917('0x3b')]=qs['filters'](_[_0x3917('0x3c')](_0x18145f[_0x3917('0x31')],_0x47cdf2[_0x3917('0x33')]));if(_0x18145f['query']['filter']){_0x5519de[_0x3917('0x3b')]=_[_0x3917('0x3e')](_0x5519de[_0x3917('0x3b')],{'$or':_[_0x3917('0x30')](_0x5519de['attributes'],function(_0x10d7e5){var _0x3a0405={};_0x3a0405[_0x10d7e5]={'$like':'%'+_0x18145f['query'][_0x3917('0x3d')]+'%'};return _0x3a0405;})});}_0x5519de=_['merge']({},_0x5519de,_0x18145f[_0x3917('0x40')]);return _0x386f6a[_0x3917('0x8e')](_0x5519de);}})[_0x3917('0x25')](function(_0xab2132){if(_0xab2132){_0x1ad520=_0xab2132['length'];if(!_0x18145f[_0x3917('0x31')][_0x3917('0x36')](_0x3917('0x37'))){_0x5519de[_0x3917('0x38')]=qs[_0x3917('0x38')](_0x18145f[_0x3917('0x31')][_0x3917('0x38')]);_0x5519de[_0x3917('0x1a')]=qs[_0x3917('0x1a')](_0x18145f[_0x3917('0x31')]['offset']);}return _0x386f6a[_0x3917('0x8e')](_0x5519de);}})[_0x3917('0x25')](function(_0x3a55c1){if(_0x3a55c1){return _0x3a55c1?{'count':_0x1ad520,'rows':_0x3a55c1}:null;}})[_0x3917('0x25')](respondWithResult(_0x5a2fa1,null))[_0x3917('0x44')](handleError(_0x5a2fa1,null));};exports['addBlackLists']=function(_0x4bbd80,_0x2632b7,_0x45cafe){var _0x1426a2,_0xfbc20b;var _0x3b01bb=[];var _0x2b36cd=moment()[_0x3917('0x63')](_0x3917('0x64'));return db[_0x3917('0x2b')][_0x3917('0x56')]({'where':{'id':_0x4bbd80['params']['id']}})[_0x3917('0x25')](handleEntityNotFound(_0x2632b7,null))[_0x3917('0x25')](function(_0x249adb){if(_0x249adb){_0xfbc20b=_0x249adb;return _0x249adb[_0x3917('0x90')](_0x4bbd80[_0x3917('0x4a')][_0x3917('0x66')],_[_0x3917('0x91')](_0x4bbd80[_0x3917('0x4a')],['ids','id'])||{});}return null;})['spread'](function(_0x4d3742){var _0x3c4231;var _0x2679c5;_0x1426a2=_0x4d3742||[];var _0x2f772d=[];if(_0x4d3742){for(var _0x561287=0x0;_0x561287<_0x4d3742[_0x3917('0x48')];_0x561287+=0x1){var _0x7dc823=_0x4d3742[_0x561287][_0x3917('0x4c')]({'plain':!![]});_0x3c4231=squel[_0x3917('0x69')]()[_0x3917('0x6a')](_0x3917('0x92'))[_0x3917('0x6c')]([_0x3917('0x6d'),_0x3917('0x6f'),_0x3917('0x73'),_0x3917('0x5d'),_0x3917('0x54'),_0x3917('0x55')],squel[_0x3917('0x77')]()[_0x3917('0x70')]('phone',_0x3917('0x6d'))['field']('id',_0x3917('0x6f'))[_0x3917('0x70')](_0x7dc823[_0x3917('0x71')][_0x3917('0x72')](),_0x3917('0x73'))[_0x3917('0x70')](_0x4bbd80[_0x3917('0x46')]['id'][_0x3917('0x72')](),_0x3917('0x5d'))[_0x3917('0x70')](_0x3917('0x7e'),_0x3917('0x54'))[_0x3917('0x70')](_0x3917('0x7e'),_0x3917('0x55'))['from'](_0x3917('0x75'))[_0x3917('0x3b')](_0x3917('0x76'))['where'](_0x3917('0x7f'),_0x7dc823[_0x3917('0x71')][_0x3917('0x72')]())[_0x3917('0x3b')](_0x3917('0x80')))[_0x3917('0x72')]();_0x2f772d['push'](db[_0x3917('0x8b')][_0x3917('0x31')](_0x3c4231));}return BPromise[_0x3917('0x8c')](_0x2f772d);}})[_0x3917('0x25')](function(){return _0x1426a2;})[_0x3917('0x25')](respondWithResult(_0x2632b7,null))[_0x3917('0x44')](handleError(_0x2632b7,null));};exports[_0x3917('0x93')]=function(_0x47f38f,_0x2e3693,_0x1e894a){return db[_0x3917('0x2b')][_0x3917('0x56')]({'where':{'id':_0x47f38f[_0x3917('0x46')]['id']}})[_0x3917('0x25')](handleEntityNotFound(_0x2e3693,null))[_0x3917('0x25')](function(_0x39cac5){if(_0x39cac5){return _0x39cac5['removeBlackLists'](_0x47f38f['query'][_0x3917('0x66')]);}})[_0x3917('0x25')](function(_0x5cba25){if(_0x5cba25){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x47f38f[_0x3917('0x31')][_0x3917('0x66')],'CampaignId':_0x47f38f[_0x3917('0x46')]['id']}})[_0x3917('0x25')](function(){return _0x5cba25;});}})[_0x3917('0x25')](respondWithStatusCode(_0x2e3693,null))['catch'](handleError(_0x2e3693,null));}; \ No newline at end of file +var _0x565c=['save','update','destroy','then','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','send','map','Campaign','fieldName','type','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','intersection','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','createdAt','updatedAt','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','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','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject'];(function(_0x484f58,_0x521a54){var _0x87ee76=function(_0x5290f7){while(--_0x5290f7){_0x484f58['push'](_0x484f58['shift']());}};_0x87ee76(++_0x521a54);}(_0x565c,0x73));var _0xc565=function(_0x47ec78,_0x9eadfa){_0x47ec78=_0x47ec78-0x0;var _0x1e032d=_0x565c[_0x47ec78];return _0x1e032d;};'use strict';var emlformat=require(_0xc565('0x0'));var rimraf=require(_0xc565('0x1'));var zipdir=require(_0xc565('0x2'));var jsonpatch=require(_0xc565('0x3'));var rp=require(_0xc565('0x4'));var moment=require(_0xc565('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc565('0x6'));var sox=require(_0xc565('0x7'));var csv=require(_0xc565('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc565('0x9'));var squel=require('squel');var crypto=require(_0xc565('0xa'));var jsforce=require(_0xc565('0xb'));var deskjs=require(_0xc565('0xc'));var toCsv=require(_0xc565('0x8'));var querystring=require(_0xc565('0xd'));var Papa=require(_0xc565('0xe'));var Redis=require('ioredis');var authService=require(_0xc565('0xf'));var qs=require(_0xc565('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc565('0x11'));var logger=require(_0xc565('0x12'))(_0xc565('0x13'));var utils=require(_0xc565('0x14'));var config=require(_0xc565('0x15'));var licenseUtil=require(_0xc565('0x16'));var db=require(_0xc565('0x17'))['db'];function respondWithStatusCode(_0x214f27,_0x3ca9a6){_0x3ca9a6=_0x3ca9a6||0xcc;return function(_0x54d900){if(_0x54d900){return _0x214f27['sendStatus'](_0x3ca9a6);}return _0x214f27['status'](_0x3ca9a6)['end']();};}function respondWithResult(_0x11853a,_0x26c026){_0x26c026=_0x26c026||0xc8;return function(_0x543d68){if(_0x543d68){return _0x11853a[_0xc565('0x18')](_0x26c026)[_0xc565('0x19')](_0x543d68);}};}function respondWithFilteredResult(_0x297d35,_0x200ebb){return function(_0x66c6cb){if(_0x66c6cb){var _0x11d3f1=typeof _0x200ebb[_0xc565('0x1a')]===_0xc565('0x1b')&&typeof _0x200ebb[_0xc565('0x1c')]===_0xc565('0x1b');var _0x1de92c=_0x66c6cb[_0xc565('0x1d')];var _0x16cabe=_0x11d3f1?0x0:_0x200ebb[_0xc565('0x1a')];var _0x275e7b=_0x11d3f1?_0x66c6cb['count']:_0x200ebb['offset']+_0x200ebb[_0xc565('0x1c')];var _0x3b88b4;if(_0x275e7b>=_0x1de92c){_0x275e7b=_0x1de92c;_0x3b88b4=0xc8;}else{_0x3b88b4=0xce;}_0x297d35[_0xc565('0x18')](_0x3b88b4);return _0x297d35[_0xc565('0x1e')]('Content-Range',_0x16cabe+'-'+_0x275e7b+'/'+_0x1de92c)[_0xc565('0x19')](_0x66c6cb);}return null;};}function patchUpdates(_0x166fa7){return function(_0x1ab8ec){try{jsonpatch[_0xc565('0x1f')](_0x1ab8ec,_0x166fa7,!![]);}catch(_0x4d6939){return BPromise[_0xc565('0x20')](_0x4d6939);}return _0x1ab8ec[_0xc565('0x21')]();};}function saveUpdates(_0x404b39,_0x43769e){return function(_0x36a386){if(_0x36a386){return _0x36a386[_0xc565('0x22')](_0x404b39)['then'](function(_0x4a2807){return _0x4a2807;});}return null;};}function removeEntity(_0xefedf6,_0x422a6c){return function(_0x2d91b0){if(_0x2d91b0){return _0x2d91b0[_0xc565('0x23')]()[_0xc565('0x24')](function(){var _0x4eee02=_0x2d91b0['get']({'plain':!![]});var _0x2d3961=_0xc565('0x25');return db[_0xc565('0x26')]['destroy']({'where':{'type':_0x2d3961,'resourceId':_0x4eee02['id']}})[_0xc565('0x24')](function(){return _0x2d91b0;});})[_0xc565('0x24')](function(){_0xefedf6[_0xc565('0x18')](0xcc)[_0xc565('0x27')]();});}};}function handleEntityNotFound(_0x175d05,_0x5722da){return function(_0x42a0c9){if(!_0x42a0c9){_0x175d05[_0xc565('0x28')](0x194);}return _0x42a0c9;};}function handleError(_0xf4272c,_0x512d68){_0x512d68=_0x512d68||0x1f4;return function(_0x2149ee){logger[_0xc565('0x29')](_0x2149ee[_0xc565('0x2a')]);if(_0x2149ee[_0xc565('0x2b')]){delete _0x2149ee[_0xc565('0x2b')];}_0xf4272c[_0xc565('0x18')](_0x512d68)[_0xc565('0x2c')](_0x2149ee);};}exports['index']=function(_0x3c2ed3,_0x1fd840){var _0x31f1c6={},_0x2553a5={},_0x2f8671={'count':0x0,'rows':[]};var _0x270b63=_[_0xc565('0x2d')](db[_0xc565('0x2e')]['rawAttributes'],function(_0x54d14e){return{'name':_0x54d14e[_0xc565('0x2f')],'type':_0x54d14e[_0xc565('0x30')]['key']};});_0x2553a5[_0xc565('0x31')]=_[_0xc565('0x2d')](_0x270b63,_0xc565('0x2b'));_0x2553a5[_0xc565('0x32')]=_[_0xc565('0x33')](_0x3c2ed3[_0xc565('0x32')]);_0x2553a5[_0xc565('0x34')]=_['intersection'](_0x2553a5[_0xc565('0x31')],_0x2553a5[_0xc565('0x32')]);_0x31f1c6[_0xc565('0x35')]=_['intersection'](_0x2553a5[_0xc565('0x31')],qs['fields'](_0x3c2ed3[_0xc565('0x32')]['fields']));_0x31f1c6[_0xc565('0x35')]=_0x31f1c6[_0xc565('0x35')][_0xc565('0x36')]?_0x31f1c6[_0xc565('0x35')]:_0x2553a5[_0xc565('0x31')];if(!_0x3c2ed3[_0xc565('0x32')][_0xc565('0x37')](_0xc565('0x38'))){_0x31f1c6[_0xc565('0x1c')]=qs['limit'](_0x3c2ed3[_0xc565('0x32')][_0xc565('0x1c')]);_0x31f1c6[_0xc565('0x1a')]=qs[_0xc565('0x1a')](_0x3c2ed3[_0xc565('0x32')][_0xc565('0x1a')]);}_0x31f1c6[_0xc565('0x39')]=qs['sort'](_0x3c2ed3['query'][_0xc565('0x3a')]);_0x31f1c6[_0xc565('0x3b')]=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x3c2ed3[_0xc565('0x32')],_0x2553a5[_0xc565('0x34')]),_0x270b63);if(_0x3c2ed3[_0xc565('0x32')]['filter']){_0x31f1c6[_0xc565('0x3b')]=_['merge'](_0x31f1c6[_0xc565('0x3b')],{'$or':_[_0xc565('0x2d')](_0x270b63,function(_0xe43c87){if(_0xe43c87['type']!=='VIRTUAL'){var _0x197419={};_0x197419[_0xe43c87[_0xc565('0x2b')]]={'$like':'%'+_0x3c2ed3[_0xc565('0x32')][_0xc565('0x3d')]+'%'};return _0x197419;}})});}_0x31f1c6=_[_0xc565('0x3e')]({},_0x31f1c6,_0x3c2ed3[_0xc565('0x3f')]);var _0x2fa276={'where':_0x31f1c6[_0xc565('0x3b')]};return db['Campaign'][_0xc565('0x1d')](_0x2fa276)[_0xc565('0x24')](function(_0x3fd0ad){_0x2f8671[_0xc565('0x1d')]=_0x3fd0ad;if(_0x3c2ed3[_0xc565('0x32')][_0xc565('0x40')]){_0x31f1c6[_0xc565('0x41')]=[{'all':!![]}];}return db['Campaign'][_0xc565('0x42')](_0x31f1c6);})[_0xc565('0x24')](function(_0x533793){_0x2f8671['rows']=_0x533793;return _0x2f8671;})[_0xc565('0x24')](respondWithFilteredResult(_0x1fd840,_0x31f1c6))['catch'](handleError(_0x1fd840,null));};exports[_0xc565('0x43')]=function(_0x43af71,_0x1f898e){var _0x18e4cb={'raw':![],'where':{'id':_0x43af71[_0xc565('0x44')]['id']}},_0x1e4810={};_0x1e4810[_0xc565('0x31')]=_['keys'](db['Campaign'][_0xc565('0x45')]);_0x1e4810[_0xc565('0x32')]=_[_0xc565('0x33')](_0x43af71[_0xc565('0x32')]);_0x1e4810['filters']=_[_0xc565('0x46')](_0x1e4810[_0xc565('0x31')],_0x1e4810[_0xc565('0x32')]);_0x18e4cb[_0xc565('0x35')]=_[_0xc565('0x46')](_0x1e4810[_0xc565('0x31')],qs[_0xc565('0x47')](_0x43af71['query'][_0xc565('0x47')]));_0x18e4cb[_0xc565('0x35')]=_0x18e4cb[_0xc565('0x35')][_0xc565('0x36')]?_0x18e4cb[_0xc565('0x35')]:_0x1e4810['model'];if(_0x43af71['query'][_0xc565('0x40')]){_0x18e4cb[_0xc565('0x41')]=[{'all':!![]}];}_0x18e4cb=_['merge']({},_0x18e4cb,_0x43af71[_0xc565('0x3f')]);return db[_0xc565('0x2e')][_0xc565('0x48')](_0x18e4cb)[_0xc565('0x24')](handleEntityNotFound(_0x1f898e,null))[_0xc565('0x24')](respondWithResult(_0x1f898e,null))['catch'](handleError(_0x1f898e,null));};exports['create']=function(_0x42b435,_0x296816){return db['Campaign'][_0xc565('0x49')](_0x42b435[_0xc565('0x4a')],{})[_0xc565('0x24')](function(_0x329615){var _0x3bdb55=_0x42b435[_0xc565('0x4b')][_0xc565('0x4c')]({'plain':!![]});if(!_0x3bdb55)throw new Error(_0xc565('0x4d'));if(_0x3bdb55['role']===_0xc565('0x4b')){var _0x4f4f7d=_0x329615['get']({'plain':!![]});var _0x21128d=_0xc565('0x25');return db[_0xc565('0x4e')]['find']({'where':{'name':_0x21128d,'userProfileId':_0x3bdb55[_0xc565('0x4f')]},'raw':!![]})[_0xc565('0x24')](function(_0x5d93f7){if(_0x5d93f7&&_0x5d93f7[_0xc565('0x50')]===0x0){return db[_0xc565('0x26')][_0xc565('0x49')]({'name':_0x4f4f7d['name'],'resourceId':_0x4f4f7d['id'],'type':_0x5d93f7[_0xc565('0x2b')],'sectionId':_0x5d93f7['id']},{})[_0xc565('0x24')](function(){return _0x329615;});}else{return _0x329615;}})['catch'](function(_0x39267f){logger[_0xc565('0x29')](_0xc565('0x51'),_0x39267f);throw _0x39267f;});}return _0x329615;})['then'](respondWithResult(_0x296816,0xc9))[_0xc565('0x52')](handleError(_0x296816,null));};exports[_0xc565('0x53')]=function(_0x3c4b60,_0x315ee4){var _0x3505b5={'where':{'id':_0x3c4b60['params']['id']}},_0x13d28c={};_0x13d28c[_0xc565('0x31')]=_[_0xc565('0x33')](db[_0xc565('0x2e')][_0xc565('0x45')]);_0x3505b5[_0xc565('0x35')]=_[_0xc565('0x46')](_0x13d28c[_0xc565('0x31')],qs[_0xc565('0x47')](_0x3c4b60[_0xc565('0x32')][_0xc565('0x47')]));_0x3505b5[_0xc565('0x35')]=_0x3505b5['attributes'][_0xc565('0x36')]?_0x3505b5[_0xc565('0x35')]:_0x13d28c[_0xc565('0x31')];if(_0x3c4b60[_0xc565('0x32')][_0xc565('0x40')]){_0x3505b5['include']=[{'all':!![]}];}_0x3505b5=_[_0xc565('0x3e')]({},_0x3505b5,_0x3c4b60[_0xc565('0x3f')]);return db['Campaign'][_0xc565('0x48')](_0x3505b5)[_0xc565('0x24')](handleEntityNotFound(_0x315ee4,null))[_0xc565('0x24')](function(_0x571b62){if(_0x571b62){var _0x54c02a=_0x571b62[_0xc565('0x4c')]({'plain':!![]});_0x54c02a=qs[_0xc565('0x54')](_0x54c02a,['id',_0xc565('0x55'),'updatedAt']);_0x3c4b60[_0xc565('0x4a')]=_[_0xc565('0x54')](_0x3c4b60[_0xc565('0x4a')],['id',_0xc565('0x55'),_0xc565('0x56')]);return db[_0xc565('0x2e')][_0xc565('0x49')](_['merge'](_0x54c02a,_0x3c4b60['body']),{'include':_0x3c4b60[_0xc565('0x32')][_0xc565('0x40')]?[{'all':!![]}]:undefined})[_0xc565('0x24')](function(_0x2b9bd7){var _0x11210f=_0x3c4b60[_0xc565('0x4b')][_0xc565('0x4c')]({'plain':!![]});if(!_0x11210f)throw new Error(_0xc565('0x4d'));if(_0x11210f['role']===_0xc565('0x4b')){var _0x51e40c=_0x2b9bd7[_0xc565('0x4c')]({'plain':!![]});var _0x240fbd=_0xc565('0x25');return db['UserProfileSection'][_0xc565('0x48')]({'where':{'name':_0x240fbd,'userProfileId':_0x11210f[_0xc565('0x4f')]},'raw':!![]})[_0xc565('0x24')](function(_0x32b4f1){if(_0x32b4f1&&_0x32b4f1[_0xc565('0x50')]===0x0){return db[_0xc565('0x26')][_0xc565('0x49')]({'name':_0x51e40c[_0xc565('0x2b')],'resourceId':_0x51e40c['id'],'type':_0x32b4f1[_0xc565('0x2b')],'sectionId':_0x32b4f1['id']},{})[_0xc565('0x24')](function(){return _0x2b9bd7;});}else{return _0x2b9bd7;}})[_0xc565('0x52')](function(_0x7537be){logger['error'](_0xc565('0x51'),_0x7537be);throw _0x7537be;});}return _0x2b9bd7;});}})['then'](respondWithResult(_0x315ee4,0xc9))[_0xc565('0x52')](handleError(_0x315ee4,null));};exports[_0xc565('0x22')]=function(_0x4d1a01,_0x49cb51){if(_0x4d1a01['body']['id']){delete _0x4d1a01[_0xc565('0x4a')]['id'];}return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x4d1a01[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x49cb51,null))['then'](saveUpdates(_0x4d1a01[_0xc565('0x4a')],null))[_0xc565('0x24')](respondWithResult(_0x49cb51,null))[_0xc565('0x52')](handleError(_0x49cb51,null));};exports['destroy']=function(_0x425e1c,_0x425a9c){return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x425e1c['params']['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x425a9c,null))['then'](removeEntity(_0x425a9c,null))['catch'](handleError(_0x425a9c,null));};exports['getHoppers']=function(_0x47004b,_0x5d8233,_0x233a16){var _0x37a93c={'raw':!![],'where':{}};var _0x3f7dd0={};var _0x1e1e75={'count':0x0,'rows':[]};return db[_0xc565('0x2e')][_0xc565('0x57')]({'where':{'id':_0x47004b[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x5d8233,null))[_0xc565('0x24')](function(_0x28b54e){if(_0x28b54e){_0x3f7dd0['model']=_[_0xc565('0x33')](db[_0xc565('0x58')][_0xc565('0x45')]);_0x3f7dd0[_0xc565('0x32')]=_['keys'](_0x47004b[_0xc565('0x32')]);_0x3f7dd0[_0xc565('0x34')]=_['intersection'](_0x3f7dd0[_0xc565('0x31')],_0x3f7dd0[_0xc565('0x32')]);_0x37a93c[_0xc565('0x35')]=_[_0xc565('0x46')](_0x3f7dd0[_0xc565('0x31')],qs[_0xc565('0x47')](_0x47004b['query'][_0xc565('0x47')]));_0x37a93c[_0xc565('0x35')]=_0x37a93c[_0xc565('0x35')][_0xc565('0x36')]?_0x37a93c[_0xc565('0x35')]:_0x3f7dd0['model'];if(!_0x47004b[_0xc565('0x32')]['hasOwnProperty']('nolimit')){_0x37a93c['limit']=qs['limit'](_0x47004b['query']['limit']);_0x37a93c['offset']=qs['offset'](_0x47004b[_0xc565('0x32')][_0xc565('0x1a')]);}_0x37a93c[_0xc565('0x39')]=qs[_0xc565('0x3a')](_0x47004b[_0xc565('0x32')][_0xc565('0x3a')]);_0x37a93c[_0xc565('0x3b')]=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x47004b[_0xc565('0x32')],_0x3f7dd0[_0xc565('0x34')]));_0x37a93c[_0xc565('0x3b')][_0xc565('0x59')]=_0x28b54e['id'];if(_0x47004b['query'][_0xc565('0x3d')]){_0x37a93c[_0xc565('0x3b')]=_['merge'](_0x37a93c[_0xc565('0x3b')],{'$or':_[_0xc565('0x2d')](_0x37a93c[_0xc565('0x35')],function(_0x5e8b12){var _0x8dff3e={};_0x8dff3e[_0x5e8b12]={'$like':'%'+_0x47004b[_0xc565('0x32')]['filter']+'%'};return _0x8dff3e;})});}_0x37a93c=_['merge']({},_0x37a93c,_0x47004b[_0xc565('0x3f')]);return db[_0xc565('0x58')]['count']({'where':_0x37a93c[_0xc565('0x3b')]})[_0xc565('0x24')](function(_0x27f5d9){_0x1e1e75['count']=_0x27f5d9;if(_0x47004b[_0xc565('0x32')][_0xc565('0x40')]){_0x37a93c[_0xc565('0x41')]=[{'all':!![]}];}return db[_0xc565('0x58')][_0xc565('0x42')](_0x37a93c);})[_0xc565('0x24')](function(_0x4a816b){_0x1e1e75['rows']=_0x4a816b;return _0x1e1e75;});}})[_0xc565('0x24')](respondWithFilteredResult(_0x5d8233,_0x37a93c))[_0xc565('0x52')](handleError(_0x5d8233,null));};exports[_0xc565('0x5a')]=function(_0x25a42c,_0x1c42e7,_0x115de6){var _0x5ec2e0={'raw':!![],'where':{}};var _0x519e44={};var _0x194202={'count':0x0,'rows':[]};return db[_0xc565('0x2e')][_0xc565('0x57')]({'where':{'id':_0x25a42c[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x1c42e7,null))['then'](function(_0xc99864){if(_0xc99864){_0x519e44[_0xc565('0x31')]=_[_0xc565('0x33')](db[_0xc565('0x5b')]['rawAttributes']);_0x519e44[_0xc565('0x32')]=_['keys'](_0x25a42c[_0xc565('0x32')]);_0x519e44[_0xc565('0x34')]=_['intersection'](_0x519e44[_0xc565('0x31')],_0x519e44[_0xc565('0x32')]);_0x5ec2e0[_0xc565('0x35')]=_[_0xc565('0x46')](_0x519e44[_0xc565('0x31')],qs['fields'](_0x25a42c[_0xc565('0x32')]['fields']));_0x5ec2e0[_0xc565('0x35')]=_0x5ec2e0['attributes']['length']?_0x5ec2e0[_0xc565('0x35')]:_0x519e44[_0xc565('0x31')];if(!_0x25a42c[_0xc565('0x32')][_0xc565('0x37')]('nolimit')){_0x5ec2e0[_0xc565('0x1c')]=qs['limit'](_0x25a42c[_0xc565('0x32')]['limit']);_0x5ec2e0[_0xc565('0x1a')]=qs[_0xc565('0x1a')](_0x25a42c[_0xc565('0x32')][_0xc565('0x1a')]);}_0x5ec2e0[_0xc565('0x39')]=qs['sort'](_0x25a42c['query'][_0xc565('0x3a')]);_0x5ec2e0['where']=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x25a42c['query'],_0x519e44[_0xc565('0x34')]));_0x5ec2e0[_0xc565('0x3b')][_0xc565('0x59')]=_0xc99864['id'];if(_0x25a42c[_0xc565('0x32')][_0xc565('0x3d')]){_0x5ec2e0[_0xc565('0x3b')]=_[_0xc565('0x3e')](_0x5ec2e0[_0xc565('0x3b')],{'$or':_['map'](_0x5ec2e0[_0xc565('0x35')],function(_0x234a51){var _0x4c74e5={};_0x4c74e5[_0x234a51]={'$like':'%'+_0x25a42c[_0xc565('0x32')][_0xc565('0x3d')]+'%'};return _0x4c74e5;})});}_0x5ec2e0=_[_0xc565('0x3e')]({},_0x5ec2e0,_0x25a42c[_0xc565('0x3f')]);return db[_0xc565('0x5b')][_0xc565('0x1d')]({'where':_0x5ec2e0[_0xc565('0x3b')]})[_0xc565('0x24')](function(_0x735821){_0x194202[_0xc565('0x1d')]=_0x735821;if(_0x25a42c[_0xc565('0x32')][_0xc565('0x40')]){_0x5ec2e0[_0xc565('0x41')]=[{'all':!![]}];}return db[_0xc565('0x5b')][_0xc565('0x42')](_0x5ec2e0);})[_0xc565('0x24')](function(_0x32c630){_0x194202[_0xc565('0x5c')]=_0x32c630;return _0x194202;});}})['then'](respondWithFilteredResult(_0x1c42e7,_0x5ec2e0))['catch'](handleError(_0x1c42e7,null));};exports[_0xc565('0x5d')]=function(_0x3a2217,_0xaf4f7f,_0x2b4fb2){var _0x454664={'raw':!![],'where':{}};var _0x3f083d={};var _0x10e7b4={'count':0x0,'rows':[]};return db[_0xc565('0x2e')]['findOne']({'where':{'id':_0x3a2217['params']['id']}})[_0xc565('0x24')](handleEntityNotFound(_0xaf4f7f,null))['then'](function(_0x312027){if(_0x312027){_0x3f083d[_0xc565('0x31')]=_[_0xc565('0x33')](db['CmHopperFinal'][_0xc565('0x45')]);_0x3f083d[_0xc565('0x32')]=_[_0xc565('0x33')](_0x3a2217[_0xc565('0x32')]);_0x3f083d[_0xc565('0x34')]=_[_0xc565('0x46')](_0x3f083d[_0xc565('0x31')],_0x3f083d[_0xc565('0x32')]);_0x454664[_0xc565('0x35')]=_[_0xc565('0x46')](_0x3f083d[_0xc565('0x31')],qs[_0xc565('0x47')](_0x3a2217['query']['fields']));_0x454664[_0xc565('0x35')]=_0x454664[_0xc565('0x35')][_0xc565('0x36')]?_0x454664[_0xc565('0x35')]:_0x3f083d[_0xc565('0x31')];if(!_0x3a2217[_0xc565('0x32')][_0xc565('0x37')](_0xc565('0x38'))){_0x454664[_0xc565('0x1c')]=qs[_0xc565('0x1c')](_0x3a2217[_0xc565('0x32')][_0xc565('0x1c')]);_0x454664[_0xc565('0x1a')]=qs['offset'](_0x3a2217['query'][_0xc565('0x1a')]);}_0x454664['order']=qs[_0xc565('0x3a')](_0x3a2217[_0xc565('0x32')]['sort']);_0x454664[_0xc565('0x3b')]=qs[_0xc565('0x34')](_['pick'](_0x3a2217[_0xc565('0x32')],_0x3f083d[_0xc565('0x34')]));_0x454664['where'][_0xc565('0x59')]=_0x312027['id'];if(_0x3a2217[_0xc565('0x32')][_0xc565('0x3d')]){_0x454664[_0xc565('0x3b')]=_[_0xc565('0x3e')](_0x454664[_0xc565('0x3b')],{'$or':_[_0xc565('0x2d')](_0x454664[_0xc565('0x35')],function(_0x2326fa){var _0x75b9f3={};_0x75b9f3[_0x2326fa]={'$like':'%'+_0x3a2217['query']['filter']+'%'};return _0x75b9f3;})});}_0x454664=_[_0xc565('0x3e')]({},_0x454664,_0x3a2217[_0xc565('0x3f')]);return db[_0xc565('0x5e')]['count']({'where':_0x454664[_0xc565('0x3b')]})[_0xc565('0x24')](function(_0x4131f6){_0x10e7b4[_0xc565('0x1d')]=_0x4131f6;if(_0x3a2217[_0xc565('0x32')][_0xc565('0x40')]){_0x454664['include']=[{'all':!![]}];}return db[_0xc565('0x5e')][_0xc565('0x42')](_0x454664);})['then'](function(_0x1d7106){_0x10e7b4[_0xc565('0x5c')]=_0x1d7106;return _0x10e7b4;});}})[_0xc565('0x24')](respondWithFilteredResult(_0xaf4f7f,_0x454664))[_0xc565('0x52')](handleError(_0xaf4f7f,null));};exports[_0xc565('0x5f')]=function(_0x31c579,_0x43f0b3,_0x115a26){var _0x5bc838={'raw':!![],'where':{}};var _0x353d6e={};var _0x146a9c={'count':0x0,'rows':[]};return db[_0xc565('0x2e')]['findOne']({'where':{'id':_0x31c579[_0xc565('0x44')]['id']}})['then'](handleEntityNotFound(_0x43f0b3,null))[_0xc565('0x24')](function(_0x24509f){if(_0x24509f){_0x353d6e[_0xc565('0x31')]=_['keys'](db[_0xc565('0x60')][_0xc565('0x45')]);_0x353d6e[_0xc565('0x32')]=_[_0xc565('0x33')](_0x31c579[_0xc565('0x32')]);_0x353d6e['filters']=_['intersection'](_0x353d6e[_0xc565('0x31')],_0x353d6e[_0xc565('0x32')]);_0x5bc838[_0xc565('0x35')]=_[_0xc565('0x46')](_0x353d6e[_0xc565('0x31')],qs[_0xc565('0x47')](_0x31c579[_0xc565('0x32')][_0xc565('0x47')]));_0x5bc838[_0xc565('0x35')]=_0x5bc838['attributes'][_0xc565('0x36')]?_0x5bc838['attributes']:_0x353d6e['model'];if(!_0x31c579['query'][_0xc565('0x37')]('nolimit')){_0x5bc838[_0xc565('0x1c')]=qs[_0xc565('0x1c')](_0x31c579['query'][_0xc565('0x1c')]);_0x5bc838[_0xc565('0x1a')]=qs['offset'](_0x31c579[_0xc565('0x32')][_0xc565('0x1a')]);}_0x5bc838[_0xc565('0x39')]=qs['sort'](_0x31c579['query'][_0xc565('0x3a')]);_0x5bc838[_0xc565('0x3b')]=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x31c579[_0xc565('0x32')],_0x353d6e[_0xc565('0x34')]));_0x5bc838[_0xc565('0x3b')]['CampaignId']=_0x24509f['id'];if(_0x31c579[_0xc565('0x32')][_0xc565('0x3d')]){_0x5bc838['where']=_[_0xc565('0x3e')](_0x5bc838[_0xc565('0x3b')],{'$or':_['map'](_0x5bc838[_0xc565('0x35')],function(_0x1711e2){var _0x5e1a86={};_0x5e1a86[_0x1711e2]={'$like':'%'+_0x31c579[_0xc565('0x32')]['filter']+'%'};return _0x5e1a86;})});}_0x5bc838=_[_0xc565('0x3e')]({},_0x5bc838,_0x31c579['options']);return db[_0xc565('0x60')][_0xc565('0x1d')]({'where':_0x5bc838[_0xc565('0x3b')]})[_0xc565('0x24')](function(_0x38d32c){_0x146a9c['count']=_0x38d32c;if(_0x31c579[_0xc565('0x32')][_0xc565('0x40')]){_0x5bc838[_0xc565('0x41')]=[{'all':!![]}];}return db[_0xc565('0x60')]['findAll'](_0x5bc838);})[_0xc565('0x24')](function(_0xcb16e){_0x146a9c[_0xc565('0x5c')]=_0xcb16e;return _0x146a9c;});}})['then'](respondWithFilteredResult(_0x43f0b3,_0x5bc838))[_0xc565('0x52')](handleError(_0x43f0b3,null));};exports['getLists']=function(_0x337bb9,_0x54dfb4,_0x426ea8){var _0x201b2e={};var _0x358407={};var _0x2446cb;var _0x8f9f02;return db[_0xc565('0x2e')][_0xc565('0x57')]({'where':{'id':_0x337bb9[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x54dfb4,null))[_0xc565('0x24')](function(_0x36cd5c){if(_0x36cd5c){_0x2446cb=_0x36cd5c;_0x358407['model']=_[_0xc565('0x33')](db[_0xc565('0x61')]['rawAttributes']);_0x358407[_0xc565('0x32')]=_['keys'](_0x337bb9[_0xc565('0x32')]);_0x358407[_0xc565('0x34')]=_[_0xc565('0x46')](_0x358407['model'],_0x358407['query']);_0x201b2e[_0xc565('0x35')]=_[_0xc565('0x46')](_0x358407['model'],qs[_0xc565('0x47')](_0x337bb9['query']['fields']));_0x201b2e[_0xc565('0x35')]=_0x201b2e[_0xc565('0x35')]['length']?_0x201b2e['attributes']:_0x358407[_0xc565('0x31')];_0x201b2e['order']=qs[_0xc565('0x3a')](_0x337bb9[_0xc565('0x32')][_0xc565('0x3a')]);_0x201b2e[_0xc565('0x3b')]=qs[_0xc565('0x34')](_['pick'](_0x337bb9[_0xc565('0x32')],_0x358407[_0xc565('0x34')]));if(_0x337bb9['query'][_0xc565('0x3d')]){_0x201b2e['where']=_[_0xc565('0x3e')](_0x201b2e[_0xc565('0x3b')],{'$or':_['map'](_0x201b2e[_0xc565('0x35')],function(_0x4180dc){var _0x50938f={};_0x50938f[_0x4180dc]={'$like':'%'+_0x337bb9['query'][_0xc565('0x3d')]+'%'};return _0x50938f;})});}_0x201b2e=_[_0xc565('0x3e')]({},_0x201b2e,_0x337bb9[_0xc565('0x3f')]);return _0x2446cb[_0xc565('0x62')](_0x201b2e);}})['then'](function(_0x70a69d){if(_0x70a69d){_0x8f9f02=_0x70a69d[_0xc565('0x36')];if(!_0x337bb9[_0xc565('0x32')][_0xc565('0x37')](_0xc565('0x38'))){_0x201b2e[_0xc565('0x1c')]=qs[_0xc565('0x1c')](_0x337bb9[_0xc565('0x32')]['limit']);_0x201b2e[_0xc565('0x1a')]=qs[_0xc565('0x1a')](_0x337bb9[_0xc565('0x32')]['offset']);}return _0x2446cb[_0xc565('0x62')](_0x201b2e);}})['then'](function(_0x29c54b){if(_0x29c54b){return _0x29c54b?{'count':_0x8f9f02,'rows':_0x29c54b}:null;}})[_0xc565('0x24')](respondWithResult(_0x54dfb4,null))[_0xc565('0x52')](handleError(_0x54dfb4,null));};exports[_0xc565('0x63')]=function(_0x1ee4d6,_0x21f094,_0x15a7f8){var _0x3f5685,_0x1721e4;var _0xd3059e=[];var _0x58f233=moment()[_0xc565('0x64')](_0xc565('0x65'));return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x1ee4d6[_0xc565('0x44')]['id']}})['then'](handleEntityNotFound(_0x21f094,null))[_0xc565('0x24')](function(_0x5d1787){if(_0x5d1787){_0x1721e4=_0x5d1787;return _0x5d1787[_0xc565('0x63')](_0x1ee4d6[_0xc565('0x4a')][_0xc565('0x66')],_[_0xc565('0x54')](_0x1ee4d6[_0xc565('0x4a')],[_0xc565('0x66'),'id'])||{});}return null;})[_0xc565('0x67')](function(_0x3f6764){var _0x17dda1;var _0x44ed4e;_0x3f5685=_0x3f6764||[];var _0x504a6c=[];if(_0x3f6764){for(var _0x1e1598=0x0;_0x1e1598<_0x3f6764[_0xc565('0x36')];_0x1e1598+=0x1){var _0x1fc403=_0x3f6764[_0x1e1598][_0xc565('0x4c')]({'plain':!![]});_0x1721e4[_0xc565('0x68')]=_0x1ee4d6[_0xc565('0x4a')][_0xc565('0x68')]?_0x1ee4d6['body'][_0xc565('0x68')]:_0x1721e4['dialCheckDuplicateType'];switch(_0x1721e4[_0xc565('0x68')]){case _0xc565('0x69'):_0x17dda1=squel[_0xc565('0x6a')]()[_0xc565('0x6b')](_0xc565('0x6c'))[_0xc565('0x6d')]([_0xc565('0x6e'),_0xc565('0x6f'),_0xc565('0x70'),_0xc565('0x71'),'CampaignId',_0xc565('0x55'),_0xc565('0x56')],squel[_0xc565('0x72')]()[_0xc565('0x73')]('phone','phone')['field'](_0xc565('0x74'),_0xc565('0x6f'))['field']('id',_0xc565('0x70'))[_0xc565('0x73')](_0x1fc403[_0xc565('0x75')][_0xc565('0x76')](),_0xc565('0x71'))[_0xc565('0x73')](_0x1ee4d6['params']['id']['toString'](),_0xc565('0x59'))[_0xc565('0x73')]('\x27'+_0x58f233+'\x27','createdAt')['field']('\x27'+_0x58f233+'\x27',_0xc565('0x56'))[_0xc565('0x77')](_0xc565('0x78'))[_0xc565('0x3b')](_0xc565('0x79'))[_0xc565('0x3b')](_0xc565('0x7a'),_0x1fc403['CmListId'][_0xc565('0x76')]())['where'](_0xc565('0x7b'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xc565('0x72')]()[_0xc565('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0xc565('0x77')](_0xc565('0x7c'))['where'](_0xc565('0x7d'),_0x1ee4d6[_0xc565('0x44')]['id'][_0xc565('0x76')]()))[_0xc565('0x3b')](_0xc565('0x7e'),squel['select']()[_0xc565('0x73')]('COALESCE(phone,\x27\x27)')[_0xc565('0x77')](_0xc565('0x6c'))[_0xc565('0x3b')](_0xc565('0x7d'),_0x1ee4d6['params']['id'][_0xc565('0x76')]())))[_0xc565('0x76')]();break;case _0xc565('0x7f'):_0x17dda1=squel['insert']()[_0xc565('0x6b')](_0xc565('0x6c'))[_0xc565('0x6d')]([_0xc565('0x6e'),_0xc565('0x6f'),_0xc565('0x70'),_0xc565('0x71'),_0xc565('0x59'),_0xc565('0x55'),_0xc565('0x56')],squel[_0xc565('0x72')]()[_0xc565('0x73')](_0xc565('0x6e'),_0xc565('0x6e'))[_0xc565('0x73')]('NOW()',_0xc565('0x6f'))[_0xc565('0x73')]('id',_0xc565('0x70'))[_0xc565('0x73')](_0x1fc403['CmListId']['toString'](),'ListId')[_0xc565('0x73')](_0x1ee4d6['params']['id']['toString'](),'CampaignId')[_0xc565('0x73')]('\x27'+_0x58f233+'\x27',_0xc565('0x55'))[_0xc565('0x73')]('\x27'+_0x58f233+'\x27',_0xc565('0x56'))[_0xc565('0x77')]('cm_contacts')['where'](_0xc565('0x79'))[_0xc565('0x3b')](_0xc565('0x7a'),_0x1fc403[_0xc565('0x75')][_0xc565('0x76')]())[_0xc565('0x3b')](_0xc565('0x7b'))[_0xc565('0x3b')](_0xc565('0x7e'),squel['select']()['field'](_0xc565('0x80'))[_0xc565('0x77')](_0xc565('0x6c'))['where'](_0xc565('0x7d'),_0x1ee4d6['params']['id'][_0xc565('0x76')]())))[_0xc565('0x76')]();break;default:_0x17dda1=squel['insert']()[_0xc565('0x6b')](_0xc565('0x6c'))[_0xc565('0x6d')](['phone',_0xc565('0x6f'),_0xc565('0x70'),'ListId',_0xc565('0x59'),_0xc565('0x55'),_0xc565('0x56')],squel[_0xc565('0x72')]()[_0xc565('0x73')](_0xc565('0x6e'),'phone')[_0xc565('0x73')](_0xc565('0x74'),_0xc565('0x6f'))[_0xc565('0x73')]('id',_0xc565('0x70'))[_0xc565('0x73')](_0x1fc403['CmListId'][_0xc565('0x76')](),_0xc565('0x71'))[_0xc565('0x73')](_0x1ee4d6[_0xc565('0x44')]['id'][_0xc565('0x76')](),_0xc565('0x59'))['field']('\x27'+_0x58f233+'\x27',_0xc565('0x55'))[_0xc565('0x73')]('\x27'+_0x58f233+'\x27',_0xc565('0x56'))[_0xc565('0x77')](_0xc565('0x78'))[_0xc565('0x3b')](_0xc565('0x79'))[_0xc565('0x3b')](_0xc565('0x7a'),_0x1fc403[_0xc565('0x75')][_0xc565('0x76')]())[_0xc565('0x3b')](_0xc565('0x7b')))[_0xc565('0x76')]();}_0x44ed4e=squel[_0xc565('0x6a')]()[_0xc565('0x6b')](_0xc565('0x81'))['fromQuery']([_0xc565('0x82'),'scheduledAt','phone','OrderBy','createdAt',_0xc565('0x56')],squel[_0xc565('0x72')]()[_0xc565('0x73')](_0xc565('0x83'),'id')[_0xc565('0x73')](_0xc565('0x74'),_0xc565('0x6f'))['field']('ci.item','phone')[_0xc565('0x73')](_0xc565('0x84'),_0xc565('0x85'))['field']('\x27'+_0x58f233+'\x27',_0xc565('0x55'))[_0xc565('0x73')]('\x27'+_0x58f233+'\x27',_0xc565('0x56'))[_0xc565('0x77')](_0xc565('0x86'),'ci')[_0xc565('0x87')](_0xc565('0x6c'),'h',_0xc565('0x88'))[_0xc565('0x3b')](_0xc565('0x89'),_0x1fc403[_0xc565('0x75')][_0xc565('0x76')]())[_0xc565('0x3b')](_0xc565('0x8a'),_0x1ee4d6[_0xc565('0x44')]['id']['toString']())[_0xc565('0x3b')](_0xc565('0x8b'),_0x58f233))[_0xc565('0x76')]();_0x504a6c[_0xc565('0x8c')](db[_0xc565('0x8d')][_0xc565('0x32')](_0x17dda1));_0xd3059e[_0xc565('0x8c')](db[_0xc565('0x8d')][_0xc565('0x32')](_0x44ed4e));}return BPromise[_0xc565('0x8e')](_0x504a6c);}})[_0xc565('0x24')](function(){return BPromise['all'](_0xd3059e);})['then'](function(){return _0x3f5685;})['then'](respondWithResult(_0x21f094,null))[_0xc565('0x52')](handleError(_0x21f094,null));};exports[_0xc565('0x8f')]=function(_0x5c3c8e,_0x1dfebf,_0x2077f3){return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x5c3c8e[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x1dfebf,null))[_0xc565('0x24')](function(_0x5c08bd){if(_0x5c08bd){return _0x5c08bd[_0xc565('0x8f')](_0x5c3c8e[_0xc565('0x32')][_0xc565('0x66')]);}})[_0xc565('0x24')](function(_0x4cfe25){if(_0x4cfe25){return db['CmHopper']['destroy']({'where':{'ListId':_0x5c3c8e[_0xc565('0x32')][_0xc565('0x66')],'CampaignId':_0x5c3c8e[_0xc565('0x44')]['id']}})[_0xc565('0x24')](function(){return _0x4cfe25;});}})[_0xc565('0x24')](respondWithStatusCode(_0x1dfebf,null))[_0xc565('0x52')](handleError(_0x1dfebf,null));};exports[_0xc565('0x90')]=function(_0x4ea3a9,_0x2b7e29,_0x1a86ff){var _0x582096={};var _0x5f089e={};var _0x39bebb;var _0x3609f0;return db[_0xc565('0x2e')][_0xc565('0x57')]({'where':{'id':_0x4ea3a9[_0xc565('0x44')]['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x2b7e29,null))[_0xc565('0x24')](function(_0x46b6b3){if(_0x46b6b3){_0x39bebb=_0x46b6b3;_0x5f089e[_0xc565('0x31')]=_['keys'](db['CmList'][_0xc565('0x45')]);_0x5f089e[_0xc565('0x32')]=_[_0xc565('0x33')](_0x4ea3a9['query']);_0x5f089e[_0xc565('0x34')]=_[_0xc565('0x46')](_0x5f089e[_0xc565('0x31')],_0x5f089e[_0xc565('0x32')]);_0x582096[_0xc565('0x35')]=_[_0xc565('0x46')](_0x5f089e[_0xc565('0x31')],qs[_0xc565('0x47')](_0x4ea3a9['query']['fields']));_0x582096[_0xc565('0x35')]=_0x582096['attributes'][_0xc565('0x36')]?_0x582096[_0xc565('0x35')]:_0x5f089e[_0xc565('0x31')];_0x582096['order']=qs[_0xc565('0x3a')](_0x4ea3a9[_0xc565('0x32')][_0xc565('0x3a')]);_0x582096[_0xc565('0x3b')]=qs[_0xc565('0x34')](_[_0xc565('0x3c')](_0x4ea3a9[_0xc565('0x32')],_0x5f089e[_0xc565('0x34')]));if(_0x4ea3a9[_0xc565('0x32')][_0xc565('0x3d')]){_0x582096[_0xc565('0x3b')]=_[_0xc565('0x3e')](_0x582096[_0xc565('0x3b')],{'$or':_[_0xc565('0x2d')](_0x582096[_0xc565('0x35')],function(_0x2f0b73){var _0x26f43e={};_0x26f43e[_0x2f0b73]={'$like':'%'+_0x4ea3a9[_0xc565('0x32')][_0xc565('0x3d')]+'%'};return _0x26f43e;})});}_0x582096=_[_0xc565('0x3e')]({},_0x582096,_0x4ea3a9['options']);return _0x39bebb[_0xc565('0x90')](_0x582096);}})['then'](function(_0x3d1a0a){if(_0x3d1a0a){_0x3609f0=_0x3d1a0a[_0xc565('0x36')];if(!_0x4ea3a9[_0xc565('0x32')]['hasOwnProperty'](_0xc565('0x38'))){_0x582096[_0xc565('0x1c')]=qs['limit'](_0x4ea3a9[_0xc565('0x32')][_0xc565('0x1c')]);_0x582096[_0xc565('0x1a')]=qs[_0xc565('0x1a')](_0x4ea3a9[_0xc565('0x32')][_0xc565('0x1a')]);}return _0x39bebb[_0xc565('0x90')](_0x582096);}})[_0xc565('0x24')](function(_0x178a31){if(_0x178a31){return _0x178a31?{'count':_0x3609f0,'rows':_0x178a31}:null;}})[_0xc565('0x24')](respondWithResult(_0x2b7e29,null))['catch'](handleError(_0x2b7e29,null));};exports[_0xc565('0x91')]=function(_0x277480,_0x2915b0,_0x231bb4){var _0x369380,_0x4d4d60;var _0x582431=[];var _0x3a3231=moment()[_0xc565('0x64')](_0xc565('0x65'));return db[_0xc565('0x2e')][_0xc565('0x48')]({'where':{'id':_0x277480['params']['id']}})[_0xc565('0x24')](handleEntityNotFound(_0x2915b0,null))['then'](function(_0x3bb885){if(_0x3bb885){_0x4d4d60=_0x3bb885;return _0x3bb885[_0xc565('0x91')](_0x277480[_0xc565('0x4a')][_0xc565('0x66')],_[_0xc565('0x54')](_0x277480[_0xc565('0x4a')],[_0xc565('0x66'),'id'])||{});}return null;})[_0xc565('0x67')](function(_0x4e9adb){var _0x3118f4;var _0xe2d1cb;_0x369380=_0x4e9adb||[];var _0x4ef476=[];if(_0x4e9adb){for(var _0x211cc8=0x0;_0x211cc8<_0x4e9adb[_0xc565('0x36')];_0x211cc8+=0x1){var _0x1cb366=_0x4e9adb[_0x211cc8][_0xc565('0x4c')]({'plain':!![]});_0x3118f4=squel[_0xc565('0x6a')]()['into'](_0xc565('0x92'))[_0xc565('0x6d')]([_0xc565('0x6e'),_0xc565('0x70'),_0xc565('0x71'),_0xc565('0x59'),'createdAt','updatedAt'],squel[_0xc565('0x72')]()[_0xc565('0x73')]('phone',_0xc565('0x6e'))['field']('id',_0xc565('0x70'))['field'](_0x1cb366[_0xc565('0x75')][_0xc565('0x76')](),'ListId')['field'](_0x277480[_0xc565('0x44')]['id'][_0xc565('0x76')](),_0xc565('0x59'))[_0xc565('0x73')]('NOW()',_0xc565('0x55'))[_0xc565('0x73')](_0xc565('0x74'),_0xc565('0x56'))['from']('cm_contacts')[_0xc565('0x3b')](_0xc565('0x79'))[_0xc565('0x3b')](_0xc565('0x7a'),_0x1cb366[_0xc565('0x75')][_0xc565('0x76')]())[_0xc565('0x3b')](_0xc565('0x7b')))[_0xc565('0x76')]();_0x4ef476['push'](db[_0xc565('0x8d')][_0xc565('0x32')](_0x3118f4));}return BPromise[_0xc565('0x8e')](_0x4ef476);}})[_0xc565('0x24')](function(){return _0x369380;})[_0xc565('0x24')](respondWithResult(_0x2915b0,null))[_0xc565('0x52')](handleError(_0x2915b0,null));};exports[_0xc565('0x93')]=function(_0x40f562,_0x1ee15d,_0x48d094){return db[_0xc565('0x2e')]['find']({'where':{'id':_0x40f562[_0xc565('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ee15d,null))[_0xc565('0x24')](function(_0x397435){if(_0x397435){return _0x397435[_0xc565('0x93')](_0x40f562[_0xc565('0x32')][_0xc565('0x66')]);}})[_0xc565('0x24')](function(_0x2f4bce){if(_0x2f4bce){return db['CmHopperBlack'][_0xc565('0x23')]({'where':{'ListId':_0x40f562[_0xc565('0x32')][_0xc565('0x66')],'CampaignId':_0x40f562[_0xc565('0x44')]['id']}})[_0xc565('0x24')](function(){return _0x2f4bce;});}})[_0xc565('0x24')](respondWithStatusCode(_0x1ee15d,null))[_0xc565('0x52')](handleError(_0x1ee15d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 72906be..abad4c3 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(_0x20f256,_0x2f58ec){var _0x5ced25=function(_0x15a4c4){while(--_0x15a4c4){_0x20f256['push'](_0x20f256['shift']());}};_0x5ced25(++_0x2f58ec);}(_0x7a54,0x106));var _0x47a5=function(_0x5759af,_0x2ec750){_0x5759af=_0x5759af-0x0;var _0x444369=_0x7a54[_0x5759af];return _0x444369;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x26b30a,_0xfb3217){var _0x269187=function(_0x468148){while(--_0x468148){_0x26b30a['push'](_0x26b30a['shift']());}};_0x269187(++_0xfb3217);}(_0x7a54,0x106));var _0x47a5=function(_0x47b928,_0x3c8344){_0x47b928=_0x47b928-0x0;var _0xa64cea=_0x7a54[_0x47b928];return _0xa64cea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 2fa1410..fb9942d 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x984b=['ioredis','../../config/logger','rpc','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','bluebird','randomstring'];(function(_0x39b86c,_0x5a8b64){var _0x120b7a=function(_0x3478f7){while(--_0x3478f7){_0x39b86c['push'](_0x39b86c['shift']());}};_0x120b7a(++_0x5a8b64);}(_0x984b,0xee));var _0xb984=function(_0x1277d8,_0x317bfb){_0x1277d8=_0x1277d8-0x0;var _0x3081a5=_0x984b[_0x1277d8];return _0x3081a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});}exports['GetCampaign']=function(_0x396c36){var _0x35bd75=this;return new Promise(function(_0x3a5c96,_0x9afbee){return db[_0xb984('0x13')][_0xb984('0x14')]({'raw':_0x396c36['options']?_0x396c36[_0xb984('0x15')][_0xb984('0x16')]===undefined?!![]:![]:!![],'where':_0x396c36[_0xb984('0x15')]?_0x396c36[_0xb984('0x15')][_0xb984('0x17')]||null:null,'attributes':_0x396c36[_0xb984('0x15')]?_0x396c36['options'][_0xb984('0x18')]||null:null,'limit':_0x396c36[_0xb984('0x15')]?_0x396c36['options'][_0xb984('0x19')]||null:null,'include':_0x396c36[_0xb984('0x15')]?_0x396c36[_0xb984('0x15')][_0xb984('0x1a')]?_[_0xb984('0x1b')](_0x396c36[_0xb984('0x15')][_0xb984('0x1a')],function(_0x52c581){return{'model':db[_0x52c581[_0xb984('0x1c')]],'as':_0x52c581['as'],'attributes':_0x52c581[_0xb984('0x18')],'include':_0x52c581[_0xb984('0x1a')]?_['map'](_0x52c581[_0xb984('0x1a')],function(_0x2e806e){return{'model':db[_0x2e806e[_0xb984('0x1c')]],'as':_0x2e806e['as'],'attributes':_0x2e806e[_0xb984('0x18')],'include':_0x2e806e[_0xb984('0x1a')]?_[_0xb984('0x1b')](_0x2e806e[_0xb984('0x1a')],function(_0x4b3da0){return{'model':db[_0x4b3da0['model']],'as':_0x4b3da0['as'],'attributes':_0x4b3da0[_0xb984('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb984('0x7')](function(_0x3e254b){logger[_0xb984('0x8')]('GetCampaign',_0x396c36);logger[_0xb984('0xb')](_0xb984('0x1d'),_0x396c36,JSON[_0xb984('0xd')](_0x3e254b));_0x3a5c96(_0x3e254b);})['catch'](function(_0x363e33){logger[_0xb984('0xe')](_0xb984('0x1d'),_0x363e33[_0xb984('0x10')],_0x396c36);_0x9afbee(_0x35bd75['error'](0x1f4,_0x363e33['message']));});});}; \ No newline at end of file +var _0xaf80=['then','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCampaign','options','raw','attributes','limit','include','map','model'];(function(_0xa1b5fb,_0x41a2bd){var _0x123597=function(_0x1b3157){while(--_0x1b3157){_0xa1b5fb['push'](_0xa1b5fb['shift']());}};_0x123597(++_0x41a2bd);}(_0xaf80,0x1ef));var _0x0af8=function(_0x31c8fb,_0x3cf630){_0x31c8fb=_0x31c8fb-0x0;var _0x3c0773=_0xaf80[_0x31c8fb];return _0x3c0773;};'use strict';var _=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var moment=require(_0x0af8('0x2'));var BPromise=require(_0x0af8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0af8('0x4'));var logger=require(_0x0af8('0x5'))(_0x0af8('0x6'));var config=require(_0x0af8('0x7'));var jayson=require(_0x0af8('0x8'));var client=jayson[_0x0af8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bce2c,_0x28f555,_0x538c1c){return new BPromise(function(_0x207a9b,_0x430bd4){return client[_0x0af8('0xa')](_0x4bce2c,_0x538c1c)['then'](function(_0xc0d5eb){logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,'request\x20sent');logger['debug'](_0x0af8('0xd'),_0x28f555,_0x0af8('0xe'),JSON[_0x0af8('0xf')](_0xc0d5eb));if(_0xc0d5eb[_0x0af8('0x10')]){if(_0xc0d5eb[_0x0af8('0x10')]['code']===0x1f4){logger[_0x0af8('0x10')](_0x0af8('0xc'),_0x28f555,_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);return _0x430bd4(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}logger[_0x0af8('0x10')]('Campaign,\x20%s,\x20%s',_0x28f555,_0xc0d5eb['error'][_0x0af8('0x11')]);return _0x207a9b(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}else{logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,_0x0af8('0xe'));_0x207a9b(_0xc0d5eb[_0x0af8('0x12')][_0x0af8('0x11')]);}})['catch'](function(_0x5f4275){logger['error'](_0x0af8('0xc'),_0x28f555,_0x5f4275);_0x430bd4(_0x5f4275);});});}exports[_0x0af8('0x13')]=function(_0x54e946){var _0x2ace30=this;return new Promise(function(_0x230a68,_0x38068d){return db['Campaign']['findAll']({'raw':_0x54e946['options']?_0x54e946[_0x0af8('0x14')][_0x0af8('0x15')]===undefined?!![]:![]:!![],'where':_0x54e946['options']?_0x54e946[_0x0af8('0x14')]['where']||null:null,'attributes':_0x54e946['options']?_0x54e946[_0x0af8('0x14')][_0x0af8('0x16')]||null:null,'limit':_0x54e946[_0x0af8('0x14')]?_0x54e946[_0x0af8('0x14')][_0x0af8('0x17')]||null:null,'include':_0x54e946['options']?_0x54e946['options'][_0x0af8('0x18')]?_[_0x0af8('0x19')](_0x54e946[_0x0af8('0x14')][_0x0af8('0x18')],function(_0x320d0c){return{'model':db[_0x320d0c[_0x0af8('0x1a')]],'as':_0x320d0c['as'],'attributes':_0x320d0c[_0x0af8('0x16')],'include':_0x320d0c[_0x0af8('0x18')]?_['map'](_0x320d0c['include'],function(_0x1c6306){return{'model':db[_0x1c6306[_0x0af8('0x1a')]],'as':_0x1c6306['as'],'attributes':_0x1c6306[_0x0af8('0x16')],'include':_0x1c6306[_0x0af8('0x18')]?_['map'](_0x1c6306['include'],function(_0x315ad){return{'model':db[_0x315ad[_0x0af8('0x1a')]],'as':_0x315ad['as'],'attributes':_0x315ad[_0x0af8('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0af8('0x1b')](function(_0x2e8853){logger[_0x0af8('0xb')](_0x0af8('0x13'),_0x54e946);logger['debug'](_0x0af8('0x13'),_0x54e946,JSON[_0x0af8('0xf')](_0x2e8853));_0x230a68(_0x2e8853);})[_0x0af8('0x1c')](function(_0x20eab4){logger[_0x0af8('0x10')](_0x0af8('0x13'),_0x20eab4[_0x0af8('0x11')],_0x54e946);_0x38068d(_0x2ace30[_0x0af8('0x10')](0x1f4,_0x20eab4[_0x0af8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 4f182b2..ceb618c 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 _0x3e0b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addLists','addBlackLists','put','/:id','delete','removeBlackLists','exports','multer'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x3e0b,0x1db));var _0xb3e0=function(_0x3b6601,_0x947385){_0x3b6601=_0x3b6601-0x0;var _0x3bb5ad=_0x3e0b[_0x3b6601];return _0x3bb5ad;};'use strict';var multer=require(_0xb3e0('0x0'));var util=require(_0xb3e0('0x1'));var path=require(_0xb3e0('0x2'));var timeout=require(_0xb3e0('0x3'));var express=require(_0xb3e0('0x4'));var router=express[_0xb3e0('0x5')]();var fs_extra=require(_0xb3e0('0x6'));var auth=require(_0xb3e0('0x7'));var interaction=require(_0xb3e0('0x8'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xb3e0('0x9')]('/',auth[_0xb3e0('0xa')](),controller[_0xb3e0('0xb')]);router[_0xb3e0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb3e0('0xc')]);router['get'](_0xb3e0('0xd'),auth['isAuthenticated'](),controller[_0xb3e0('0xe')]);router[_0xb3e0('0x9')](_0xb3e0('0xf'),auth['isAuthenticated'](),controller[_0xb3e0('0x10')]);router[_0xb3e0('0x9')](_0xb3e0('0x11'),auth[_0xb3e0('0xa')](),controller[_0xb3e0('0x12')]);router['get'](_0xb3e0('0x13'),auth[_0xb3e0('0xa')](),controller[_0xb3e0('0x14')]);router['get'](_0xb3e0('0x15'),auth[_0xb3e0('0xa')](),controller[_0xb3e0('0x16')]);router[_0xb3e0('0x9')](_0xb3e0('0x17'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xb3e0('0x18')]('/',auth[_0xb3e0('0xa')](),controller[_0xb3e0('0x19')]);router['post'](_0xb3e0('0x1a'),auth['isAuthenticated'](),controller['clone']);router[_0xb3e0('0x18')](_0xb3e0('0x15'),auth[_0xb3e0('0xa')](),controller[_0xb3e0('0x1b')]);router[_0xb3e0('0x18')](_0xb3e0('0x17'),auth[_0xb3e0('0xa')](),controller[_0xb3e0('0x1c')]);router[_0xb3e0('0x1d')](_0xb3e0('0x1e'),auth[_0xb3e0('0xa')](),controller['update']);router[_0xb3e0('0x1f')](_0xb3e0('0x1e'),auth[_0xb3e0('0xa')](),controller['destroy']);router[_0xb3e0('0x1f')](_0xb3e0('0x15'),auth[_0xb3e0('0xa')](),controller['removeLists']);router[_0xb3e0('0x1f')](_0xb3e0('0x17'),auth[_0xb3e0('0xa')](),controller[_0xb3e0('0x20')]);module[_0xb3e0('0x21')]=router; \ No newline at end of file +var _0xe827=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','post','create','clone','addLists','addBlackLists','destroy','delete','removeBlackLists','multer','util','path'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0xe827,0x1dd));var _0x7e82=function(_0x3a2d49,_0x53d190){_0x3a2d49=_0x3a2d49-0x0;var _0x277b78=_0xe827[_0x3a2d49];return _0x277b78;};'use strict';var multer=require(_0x7e82('0x0'));var util=require(_0x7e82('0x1'));var path=require(_0x7e82('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e82('0x3'));var router=express[_0x7e82('0x4')]();var fs_extra=require(_0x7e82('0x5'));var auth=require(_0x7e82('0x6'));var interaction=require(_0x7e82('0x7'));var config=require(_0x7e82('0x8'));var controller=require('./campaign.controller');router['get']('/',auth[_0x7e82('0x9')](),controller[_0x7e82('0xa')]);router[_0x7e82('0xb')](_0x7e82('0xc'),auth['isAuthenticated'](),controller[_0x7e82('0xd')]);router['get'](_0x7e82('0xe'),auth[_0x7e82('0x9')](),controller[_0x7e82('0xf')]);router['get'](_0x7e82('0x10'),auth['isAuthenticated'](),controller[_0x7e82('0x11')]);router[_0x7e82('0xb')](_0x7e82('0x12'),auth[_0x7e82('0x9')](),controller[_0x7e82('0x13')]);router['get'](_0x7e82('0x14'),auth[_0x7e82('0x9')](),controller['getHopperBlacks']);router['get'](_0x7e82('0x15'),auth[_0x7e82('0x9')](),controller[_0x7e82('0x16')]);router[_0x7e82('0xb')](_0x7e82('0x17'),auth[_0x7e82('0x9')](),controller['getBlackLists']);router[_0x7e82('0x18')]('/',auth[_0x7e82('0x9')](),controller[_0x7e82('0x19')]);router[_0x7e82('0x18')]('/:id/clone',auth[_0x7e82('0x9')](),controller[_0x7e82('0x1a')]);router['post'](_0x7e82('0x15'),auth[_0x7e82('0x9')](),controller[_0x7e82('0x1b')]);router[_0x7e82('0x18')](_0x7e82('0x17'),auth[_0x7e82('0x9')](),controller[_0x7e82('0x1c')]);router['put'](_0x7e82('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x7e82('0x9')](),controller[_0x7e82('0x1d')]);router[_0x7e82('0x1e')](_0x7e82('0x15'),auth[_0x7e82('0x9')](),controller['removeLists']);router[_0x7e82('0x1e')]('/:id/blacklists',auth[_0x7e82('0x9')](),controller[_0x7e82('0x1f')]);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 aafb701..f316bb7 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 _0xd9c7=['key','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x128eec,_0x19cb9b){var _0x4f8430=function(_0x4ef6a1){while(--_0x4ef6a1){_0x128eec['push'](_0x128eec['shift']());}};_0x4f8430(++_0x19cb9b);}(_0xd9c7,0xeb));var _0x7d9c=function(_0x345231,_0x4130d9){_0x345231=_0x345231-0x0;var _0x8da556=_0xd9c7[_0x345231];return _0x8da556;};'use strict';var Sequelize=require('sequelize');module[_0x7d9c('0x0')]={'key':{'type':Sequelize[_0x7d9c('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7d9c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7d9c('0x1')]},'name':{'type':Sequelize[_0x7d9c('0x3')],'get':function(){return this[_0x7d9c('0x4')](_0x7d9c('0x5'));}}}; \ No newline at end of file +var _0x415f=['sequelize','exports','STRING','TEXT'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x415f,0x70));var _0xf415=function(_0x32007b,_0x29939e){_0x32007b=_0x32007b-0x0;var _0x596b8b=_0x415f[_0x32007b];return _0x596b8b;};'use strict';var Sequelize=require(_0xf415('0x0'));module[_0xf415('0x1')]={'key':{'type':Sequelize[_0xf415('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf415('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf415('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 2838d29..c59ee3e 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 _0x83f2=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','findAll','rows','params','body','find','catch','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x26a10d,_0xe5c001){var _0xf90201=function(_0x48535b){while(--_0x48535b){_0x26a10d['push'](_0x26a10d['shift']());}};_0xf90201(++_0xe5c001);}(_0x83f2,0x1e3));var _0x283f=function(_0x47b305,_0xfb55b5){_0x47b305=_0x47b305-0x0;var _0x27210d=_0x83f2[_0x47b305];return _0x27210d;};'use strict';var emlformat=require(_0x283f('0x0'));var rimraf=require(_0x283f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x283f('0x2'));var rp=require('request-promise');var moment=require(_0x283f('0x3'));var BPromise=require(_0x283f('0x4'));var Mustache=require('mustache');var util=require(_0x283f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x283f('0x6'));var ejs=require(_0x283f('0x7'));var fs=require('fs');var fs_extra=require(_0x283f('0x8'));var _=require(_0x283f('0x9'));var squel=require(_0x283f('0xa'));var crypto=require(_0x283f('0xb'));var jsforce=require(_0x283f('0xc'));var deskjs=require(_0x283f('0xd'));var toCsv=require(_0x283f('0x6'));var querystring=require('querystring');var Papa=require(_0x283f('0xe'));var Redis=require(_0x283f('0xf'));var authService=require(_0x283f('0x10'));var qs=require(_0x283f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x283f('0x12'));var logger=require('../../config/logger')(_0x283f('0x13'));var utils=require(_0x283f('0x14'));var config=require(_0x283f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x283f('0x16'))['db'];function respondWithStatusCode(_0x1cffb9,_0x38192c){_0x38192c=_0x38192c||0xcc;return function(_0x4fa8ec){if(_0x4fa8ec){return _0x1cffb9[_0x283f('0x17')](_0x38192c);}return _0x1cffb9[_0x283f('0x18')](_0x38192c)[_0x283f('0x19')]();};}function respondWithResult(_0x4fcbfc,_0x1c33ed){_0x1c33ed=_0x1c33ed||0xc8;return function(_0x27d0bc){if(_0x27d0bc){return _0x4fcbfc['status'](_0x1c33ed)[_0x283f('0x1a')](_0x27d0bc);}};}function respondWithFilteredResult(_0x3cf4df,_0x32a00f){return function(_0x4ad1f4){if(_0x4ad1f4){var _0x10020e=typeof _0x32a00f['offset']==='undefined'&&typeof _0x32a00f['limit']==='undefined';var _0x4e1155=_0x4ad1f4[_0x283f('0x1b')];var _0x5b2b75=_0x10020e?0x0:_0x32a00f[_0x283f('0x1c')];var _0x12d746=_0x10020e?_0x4ad1f4['count']:_0x32a00f[_0x283f('0x1c')]+_0x32a00f[_0x283f('0x1d')];var _0x2a14bd;if(_0x12d746>=_0x4e1155){_0x12d746=_0x4e1155;_0x2a14bd=0xc8;}else{_0x2a14bd=0xce;}_0x3cf4df[_0x283f('0x18')](_0x2a14bd);return _0x3cf4df[_0x283f('0x1e')]('Content-Range',_0x5b2b75+'-'+_0x12d746+'/'+_0x4e1155)['json'](_0x4ad1f4);}return null;};}function patchUpdates(_0x4f6538){return function(_0x4c2bbe){try{jsonpatch[_0x283f('0x1f')](_0x4c2bbe,_0x4f6538,!![]);}catch(_0xebd8ff){return BPromise[_0x283f('0x20')](_0xebd8ff);}return _0x4c2bbe[_0x283f('0x21')]();};}function saveUpdates(_0x302534,_0x432907){return function(_0x125433){if(_0x125433){return _0x125433[_0x283f('0x22')](_0x302534)[_0x283f('0x23')](function(_0xcd3bc1){return _0xcd3bc1;});}return null;};}function removeEntity(_0xa649bd,_0x558b9a){return function(_0x324aaf){if(_0x324aaf){return _0x324aaf['destroy']()[_0x283f('0x23')](function(){var _0x2f324c=_0x324aaf['get']({'plain':!![]});var _0x21ebb2=_0x283f('0x24');return db[_0x283f('0x25')][_0x283f('0x26')]({'where':{'type':_0x21ebb2,'resourceId':_0x2f324c['id']}})[_0x283f('0x23')](function(){return _0x324aaf;});})[_0x283f('0x23')](function(){_0xa649bd[_0x283f('0x18')](0xcc)[_0x283f('0x19')]();});}};}function handleEntityNotFound(_0x1af380,_0x44f504){return function(_0x5d51){if(!_0x5d51){_0x1af380['sendStatus'](0x194);}return _0x5d51;};}function handleError(_0x7e356f,_0x21a7e8){_0x21a7e8=_0x21a7e8||0x1f4;return function(_0x42ffee){logger[_0x283f('0x27')](_0x42ffee[_0x283f('0x28')]);if(_0x42ffee[_0x283f('0x29')]){delete _0x42ffee['name'];}_0x7e356f[_0x283f('0x18')](_0x21a7e8)[_0x283f('0x2a')](_0x42ffee);};}exports[_0x283f('0x2b')]=function(_0x36b7e3,_0x21fd48){var _0x2594b9={},_0x19e4f7={},_0x358b16={'count':0x0,'rows':[]};var _0x44ffe7=_[_0x283f('0x2c')](db[_0x283f('0x2d')][_0x283f('0x2e')],function(_0x4a1e24){return{'name':_0x4a1e24[_0x283f('0x2f')],'type':_0x4a1e24[_0x283f('0x30')][_0x283f('0x31')]};});_0x19e4f7[_0x283f('0x32')]=_[_0x283f('0x2c')](_0x44ffe7,_0x283f('0x29'));_0x19e4f7[_0x283f('0x33')]=_[_0x283f('0x34')](_0x36b7e3['query']);_0x19e4f7[_0x283f('0x35')]=_[_0x283f('0x36')](_0x19e4f7['model'],_0x19e4f7[_0x283f('0x33')]);_0x2594b9[_0x283f('0x37')]=_['intersection'](_0x19e4f7[_0x283f('0x32')],qs['fields'](_0x36b7e3[_0x283f('0x33')][_0x283f('0x38')]));_0x2594b9[_0x283f('0x37')]=_0x2594b9[_0x283f('0x37')][_0x283f('0x39')]?_0x2594b9[_0x283f('0x37')]:_0x19e4f7[_0x283f('0x32')];if(!_0x36b7e3[_0x283f('0x33')][_0x283f('0x3a')]('nolimit')){_0x2594b9['limit']=qs[_0x283f('0x1d')](_0x36b7e3[_0x283f('0x33')]['limit']);_0x2594b9['offset']=qs['offset'](_0x36b7e3[_0x283f('0x33')][_0x283f('0x1c')]);}_0x2594b9['order']=qs[_0x283f('0x3b')](_0x36b7e3[_0x283f('0x33')][_0x283f('0x3b')]);_0x2594b9['where']=qs['filters'](_['pick'](_0x36b7e3[_0x283f('0x33')],_0x19e4f7[_0x283f('0x35')]),_0x44ffe7);if(_0x36b7e3[_0x283f('0x33')][_0x283f('0x3c')]){_0x2594b9[_0x283f('0x3d')]=_[_0x283f('0x3e')](_0x2594b9['where'],{'$or':[{'key':{'$like':'%'+_0x36b7e3[_0x283f('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x36b7e3[_0x283f('0x33')][_0x283f('0x3c')]+'%'}}]});}_0x2594b9=_[_0x283f('0x3e')]({},_0x2594b9,_0x36b7e3[_0x283f('0x3f')]);var _0xbb312b={'where':_0x2594b9[_0x283f('0x3d')]};return db['CannedAnswer'][_0x283f('0x1b')](_0xbb312b)[_0x283f('0x23')](function(_0x485496){_0x358b16['count']=_0x485496;if(_0x36b7e3['query'][_0x283f('0x40')]){_0x2594b9[_0x283f('0x41')]=[{'all':!![]}];}return db[_0x283f('0x2d')][_0x283f('0x42')](_0x2594b9);})[_0x283f('0x23')](function(_0x4a1df1){_0x358b16[_0x283f('0x43')]=_0x4a1df1;return _0x358b16;})['then'](respondWithFilteredResult(_0x21fd48,_0x2594b9))['catch'](handleError(_0x21fd48,null));};exports['show']=function(_0x265720,_0x128c60){var _0xec1481={'raw':!![],'where':{'id':_0x265720[_0x283f('0x44')]['id']}},_0x1a47bc={};_0x1a47bc[_0x283f('0x32')]=_[_0x283f('0x34')](db[_0x283f('0x2d')][_0x283f('0x2e')]);_0x1a47bc[_0x283f('0x33')]=_['keys'](_0x265720[_0x283f('0x33')]);_0x1a47bc[_0x283f('0x35')]=_[_0x283f('0x36')](_0x1a47bc[_0x283f('0x32')],_0x1a47bc[_0x283f('0x33')]);_0xec1481[_0x283f('0x37')]=_[_0x283f('0x36')](_0x1a47bc['model'],qs[_0x283f('0x38')](_0x265720[_0x283f('0x33')][_0x283f('0x38')]));_0xec1481[_0x283f('0x37')]=_0xec1481['attributes']['length']?_0xec1481[_0x283f('0x37')]:_0x1a47bc[_0x283f('0x32')];if(_0x265720[_0x283f('0x33')]['includeAll']){_0xec1481['include']=[{'all':!![]}];}_0xec1481=_[_0x283f('0x3e')]({},_0xec1481,_0x265720[_0x283f('0x3f')]);return db[_0x283f('0x2d')]['find'](_0xec1481)[_0x283f('0x23')](handleEntityNotFound(_0x128c60,null))[_0x283f('0x23')](respondWithResult(_0x128c60,null))['catch'](handleError(_0x128c60,null));};exports['update']=function(_0x5840d1,_0x21ec31){if(_0x5840d1[_0x283f('0x45')]['id']){delete _0x5840d1[_0x283f('0x45')]['id'];}return db[_0x283f('0x2d')][_0x283f('0x46')]({'where':{'id':_0x5840d1[_0x283f('0x44')]['id']}})['then'](handleEntityNotFound(_0x21ec31,null))['then'](saveUpdates(_0x5840d1[_0x283f('0x45')],null))[_0x283f('0x23')](respondWithResult(_0x21ec31,null))[_0x283f('0x47')](handleError(_0x21ec31,null));};exports[_0x283f('0x26')]=function(_0x15ece7,_0x574d81){return db[_0x283f('0x2d')][_0x283f('0x46')]({'where':{'id':_0x15ece7[_0x283f('0x44')]['id']}})[_0x283f('0x23')](handleEntityNotFound(_0x574d81,null))[_0x283f('0x23')](removeEntity(_0x574d81,null))['catch'](handleError(_0x574d81,null));};exports['create']=function(_0x2fc0d4,_0x3a1015){var _0x535985={'key':_0x2fc0d4[_0x283f('0x45')][_0x283f('0x31')]};if(_0x2fc0d4[_0x283f('0x45')]['MailAccountId']){_0x535985['MailAccountId']=_0x2fc0d4[_0x283f('0x45')]['MailAccountId'];}else if(_0x2fc0d4['body'][_0x283f('0x48')]){_0x535985[_0x283f('0x48')]=_0x2fc0d4[_0x283f('0x45')][_0x283f('0x48')];}else if(_0x2fc0d4[_0x283f('0x45')][_0x283f('0x49')]){_0x535985[_0x283f('0x49')]=_0x2fc0d4[_0x283f('0x45')][_0x283f('0x49')];}else if(_0x2fc0d4['body'][_0x283f('0x4a')]){_0x535985[_0x283f('0x4a')]=_0x2fc0d4[_0x283f('0x45')][_0x283f('0x4a')];}return db['CannedAnswer'][_0x283f('0x46')]({'where':_0x535985})[_0x283f('0x23')](function(_0x51e66c){if(_0x51e66c){throw new db['Sequelize']['ValidationError'](_0x283f('0x4b'));}return db[_0x283f('0x2d')][_0x283f('0x4c')](_0x2fc0d4[_0x283f('0x45')]);})[_0x283f('0x23')](function(_0x4bae9c){var _0x5e9289=_0x2fc0d4[_0x283f('0x4d')]['get']({'plain':!![]});if(!_0x5e9289)throw new Error(_0x283f('0x4e'));if(_0x5e9289[_0x283f('0x4f')]===_0x283f('0x4d')){var _0x14def8=_0x4bae9c['get']({'plain':!![]});return db[_0x283f('0x50')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x5e9289[_0x283f('0x51')]},'raw':!![]})['then'](function(_0x4eb667){if(_0x4eb667&&_0x4eb667[_0x283f('0x52')]===0x0){return db[_0x283f('0x25')][_0x283f('0x4c')]({'name':_0x14def8[_0x283f('0x29')],'resourceId':_0x14def8['id'],'type':_0x4eb667[_0x283f('0x29')],'sectionId':_0x4eb667['id']},{})['then'](function(){return _0x4bae9c;});}else{return _0x4bae9c;}})[_0x283f('0x47')](function(_0x421e49){logger[_0x283f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x421e49);throw _0x421e49;});}return _0x4bae9c;})[_0x283f('0x23')](respondWithResult(_0x3a1015,0xc9))[_0x283f('0x47')](handleError(_0x3a1015,null));}; \ No newline at end of file +var _0x197e=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','count','include','rows','catch','show','rawAttributes','includeAll','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x197e,0x1cc));var _0xe197=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x197e[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xe197('0x0'));var rimraf=require(_0xe197('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe197('0x2'));var moment=require(_0xe197('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe197('0x4'));var util=require('util');var path=require(_0xe197('0x5'));var sox=require(_0xe197('0x6'));var csv=require(_0xe197('0x7'));var ejs=require(_0xe197('0x8'));var fs=require('fs');var fs_extra=require(_0xe197('0x9'));var _=require(_0xe197('0xa'));var squel=require('squel');var crypto=require(_0xe197('0xb'));var jsforce=require(_0xe197('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe197('0x7'));var querystring=require(_0xe197('0xd'));var Papa=require(_0xe197('0xe'));var Redis=require(_0xe197('0xf'));var authService=require(_0xe197('0x10'));var qs=require(_0xe197('0x11'));var as=require(_0xe197('0x12'));var hardwareService=require(_0xe197('0x13'));var logger=require(_0xe197('0x14'))(_0xe197('0x15'));var utils=require(_0xe197('0x16'));var config=require(_0xe197('0x17'));var licenseUtil=require(_0xe197('0x18'));var db=require(_0xe197('0x19'))['db'];function respondWithStatusCode(_0x4450a5,_0x5e4779){_0x5e4779=_0x5e4779||0xcc;return function(_0x53a002){if(_0x53a002){return _0x4450a5['sendStatus'](_0x5e4779);}return _0x4450a5[_0xe197('0x1a')](_0x5e4779)[_0xe197('0x1b')]();};}function respondWithResult(_0x5f3b94,_0x74641c){_0x74641c=_0x74641c||0xc8;return function(_0xd700aa){if(_0xd700aa){return _0x5f3b94[_0xe197('0x1a')](_0x74641c)[_0xe197('0x1c')](_0xd700aa);}};}function respondWithFilteredResult(_0x23763c,_0x36cac1){return function(_0x320314){if(_0x320314){var _0x12628d=typeof _0x36cac1[_0xe197('0x1d')]===_0xe197('0x1e')&&typeof _0x36cac1[_0xe197('0x1f')]===_0xe197('0x1e');var _0x479df4=_0x320314['count'];var _0x1c0b7c=_0x12628d?0x0:_0x36cac1[_0xe197('0x1d')];var _0x112283=_0x12628d?_0x320314['count']:_0x36cac1[_0xe197('0x1d')]+_0x36cac1['limit'];var _0x447472;if(_0x112283>=_0x479df4){_0x112283=_0x479df4;_0x447472=0xc8;}else{_0x447472=0xce;}_0x23763c[_0xe197('0x1a')](_0x447472);return _0x23763c[_0xe197('0x20')](_0xe197('0x21'),_0x1c0b7c+'-'+_0x112283+'/'+_0x479df4)[_0xe197('0x1c')](_0x320314);}return null;};}function patchUpdates(_0x23df4b){return function(_0x259a2b){try{jsonpatch[_0xe197('0x22')](_0x259a2b,_0x23df4b,!![]);}catch(_0xf81da8){return BPromise[_0xe197('0x23')](_0xf81da8);}return _0x259a2b[_0xe197('0x24')]();};}function saveUpdates(_0x1cb871,_0x3f6b11){return function(_0x5b9f3d){if(_0x5b9f3d){return _0x5b9f3d[_0xe197('0x25')](_0x1cb871)[_0xe197('0x26')](function(_0x47617b){return _0x47617b;});}return null;};}function removeEntity(_0x410c79,_0x43b1ae){return function(_0x1f43e2){if(_0x1f43e2){return _0x1f43e2['destroy']()[_0xe197('0x26')](function(){var _0x3e3cd3=_0x1f43e2['get']({'plain':!![]});var _0x427fcc=_0xe197('0x27');return db[_0xe197('0x28')][_0xe197('0x29')]({'where':{'type':_0x427fcc,'resourceId':_0x3e3cd3['id']}})[_0xe197('0x26')](function(){return _0x1f43e2;});})[_0xe197('0x26')](function(){_0x410c79[_0xe197('0x1a')](0xcc)[_0xe197('0x1b')]();});}};}function handleEntityNotFound(_0x36c44c,_0x1b3d79){return function(_0x55d253){if(!_0x55d253){_0x36c44c[_0xe197('0x2a')](0x194);}return _0x55d253;};}function handleError(_0x1d4b9b,_0x31b57b){_0x31b57b=_0x31b57b||0x1f4;return function(_0x312196){logger[_0xe197('0x2b')](_0x312196[_0xe197('0x2c')]);if(_0x312196[_0xe197('0x2d')]){delete _0x312196[_0xe197('0x2d')];}_0x1d4b9b[_0xe197('0x1a')](_0x31b57b)[_0xe197('0x2e')](_0x312196);};}exports[_0xe197('0x2f')]=function(_0x4e7fe8,_0x36c9fb){var _0x463d5b={},_0x5496bc={},_0x49c201={'count':0x0,'rows':[]};var _0x16e6ea=_[_0xe197('0x30')](db['CannedAnswer']['rawAttributes'],function(_0x1813ca){return{'name':_0x1813ca[_0xe197('0x31')],'type':_0x1813ca['type'][_0xe197('0x32')]};});_0x5496bc[_0xe197('0x33')]=_[_0xe197('0x30')](_0x16e6ea,_0xe197('0x2d'));_0x5496bc[_0xe197('0x34')]=_[_0xe197('0x35')](_0x4e7fe8[_0xe197('0x34')]);_0x5496bc['filters']=_[_0xe197('0x36')](_0x5496bc[_0xe197('0x33')],_0x5496bc[_0xe197('0x34')]);_0x463d5b['attributes']=_[_0xe197('0x36')](_0x5496bc[_0xe197('0x33')],qs[_0xe197('0x37')](_0x4e7fe8[_0xe197('0x34')][_0xe197('0x37')]));_0x463d5b[_0xe197('0x38')]=_0x463d5b['attributes'][_0xe197('0x39')]?_0x463d5b[_0xe197('0x38')]:_0x5496bc[_0xe197('0x33')];if(!_0x4e7fe8[_0xe197('0x34')][_0xe197('0x3a')](_0xe197('0x3b'))){_0x463d5b[_0xe197('0x1f')]=qs['limit'](_0x4e7fe8[_0xe197('0x34')][_0xe197('0x1f')]);_0x463d5b[_0xe197('0x1d')]=qs[_0xe197('0x1d')](_0x4e7fe8['query'][_0xe197('0x1d')]);}_0x463d5b[_0xe197('0x3c')]=qs[_0xe197('0x3d')](_0x4e7fe8[_0xe197('0x34')][_0xe197('0x3d')]);_0x463d5b[_0xe197('0x3e')]=qs[_0xe197('0x3f')](_[_0xe197('0x40')](_0x4e7fe8[_0xe197('0x34')],_0x5496bc[_0xe197('0x3f')]),_0x16e6ea);if(_0x4e7fe8[_0xe197('0x34')][_0xe197('0x41')]){_0x463d5b[_0xe197('0x3e')]=_['merge'](_0x463d5b['where'],{'$or':[{'key':{'$like':'%'+_0x4e7fe8[_0xe197('0x34')][_0xe197('0x41')]+'%'}},{'value':{'$like':'%'+_0x4e7fe8['query']['filter']+'%'}}]});}_0x463d5b=_[_0xe197('0x42')]({},_0x463d5b,_0x4e7fe8[_0xe197('0x43')]);var _0xdd4f7c={'where':_0x463d5b[_0xe197('0x3e')]};return db[_0xe197('0x44')][_0xe197('0x45')](_0xdd4f7c)[_0xe197('0x26')](function(_0x283c7e){_0x49c201['count']=_0x283c7e;if(_0x4e7fe8[_0xe197('0x34')]['includeAll']){_0x463d5b[_0xe197('0x46')]=[{'all':!![]}];}return db[_0xe197('0x44')]['findAll'](_0x463d5b);})[_0xe197('0x26')](function(_0x28c027){_0x49c201[_0xe197('0x47')]=_0x28c027;return _0x49c201;})[_0xe197('0x26')](respondWithFilteredResult(_0x36c9fb,_0x463d5b))[_0xe197('0x48')](handleError(_0x36c9fb,null));};exports[_0xe197('0x49')]=function(_0x16ec13,_0x5de306){var _0x53bd79={'raw':!![],'where':{'id':_0x16ec13['params']['id']}},_0x2ca1be={};_0x2ca1be[_0xe197('0x33')]=_[_0xe197('0x35')](db[_0xe197('0x44')][_0xe197('0x4a')]);_0x2ca1be[_0xe197('0x34')]=_[_0xe197('0x35')](_0x16ec13[_0xe197('0x34')]);_0x2ca1be['filters']=_[_0xe197('0x36')](_0x2ca1be[_0xe197('0x33')],_0x2ca1be[_0xe197('0x34')]);_0x53bd79[_0xe197('0x38')]=_[_0xe197('0x36')](_0x2ca1be[_0xe197('0x33')],qs[_0xe197('0x37')](_0x16ec13[_0xe197('0x34')][_0xe197('0x37')]));_0x53bd79[_0xe197('0x38')]=_0x53bd79[_0xe197('0x38')]['length']?_0x53bd79[_0xe197('0x38')]:_0x2ca1be[_0xe197('0x33')];if(_0x16ec13[_0xe197('0x34')][_0xe197('0x4b')]){_0x53bd79[_0xe197('0x46')]=[{'all':!![]}];}_0x53bd79=_[_0xe197('0x42')]({},_0x53bd79,_0x16ec13['options']);return db[_0xe197('0x44')][_0xe197('0x4c')](_0x53bd79)['then'](handleEntityNotFound(_0x5de306,null))[_0xe197('0x26')](respondWithResult(_0x5de306,null))[_0xe197('0x48')](handleError(_0x5de306,null));};exports[_0xe197('0x25')]=function(_0x3326f6,_0x1b8952){if(_0x3326f6[_0xe197('0x4d')]['id']){delete _0x3326f6[_0xe197('0x4d')]['id'];}return db[_0xe197('0x44')]['find']({'where':{'id':_0x3326f6[_0xe197('0x4e')]['id']}})[_0xe197('0x26')](handleEntityNotFound(_0x1b8952,null))[_0xe197('0x26')](saveUpdates(_0x3326f6[_0xe197('0x4d')],null))[_0xe197('0x26')](respondWithResult(_0x1b8952,null))[_0xe197('0x48')](handleError(_0x1b8952,null));};exports[_0xe197('0x29')]=function(_0x204918,_0x931929){return db[_0xe197('0x44')][_0xe197('0x4c')]({'where':{'id':_0x204918[_0xe197('0x4e')]['id']}})[_0xe197('0x26')](handleEntityNotFound(_0x931929,null))[_0xe197('0x26')](removeEntity(_0x931929,null))[_0xe197('0x48')](handleError(_0x931929,null));};exports[_0xe197('0x4f')]=function(_0x4ba528,_0x5cdbd5){var _0xd6b302={'key':_0x4ba528[_0xe197('0x4d')][_0xe197('0x32')]};if(_0x4ba528[_0xe197('0x4d')][_0xe197('0x50')]){_0xd6b302[_0xe197('0x50')]=_0x4ba528[_0xe197('0x4d')][_0xe197('0x50')];}else if(_0x4ba528[_0xe197('0x4d')][_0xe197('0x51')]){_0xd6b302['SmsAccountId']=_0x4ba528[_0xe197('0x4d')][_0xe197('0x51')];}else if(_0x4ba528[_0xe197('0x4d')][_0xe197('0x52')]){_0xd6b302[_0xe197('0x52')]=_0x4ba528[_0xe197('0x4d')][_0xe197('0x52')];}else if(_0x4ba528[_0xe197('0x4d')][_0xe197('0x53')]){_0xd6b302['ChatWebsiteId']=_0x4ba528['body']['ChatWebsiteId'];}return db[_0xe197('0x44')]['find']({'where':_0xd6b302})['then'](function(_0x596d82){if(_0x596d82){throw new db[(_0xe197('0x54'))]['ValidationError'](_0xe197('0x55'));}return db['CannedAnswer'][_0xe197('0x4f')](_0x4ba528[_0xe197('0x4d')]);})[_0xe197('0x26')](function(_0x1f8b31){var _0x2a1de0=_0x4ba528['user'][_0xe197('0x56')]({'plain':!![]});if(!_0x2a1de0)throw new Error(_0xe197('0x57'));if(_0x2a1de0['role']==='user'){var _0x3d35c3=_0x1f8b31[_0xe197('0x56')]({'plain':!![]});return db[_0xe197('0x58')]['find']({'where':{'name':_0xe197('0x27'),'userProfileId':_0x2a1de0[_0xe197('0x59')]},'raw':!![]})['then'](function(_0x40ccfb){if(_0x40ccfb&&_0x40ccfb[_0xe197('0x5a')]===0x0){return db[_0xe197('0x28')][_0xe197('0x4f')]({'name':_0x3d35c3[_0xe197('0x2d')],'resourceId':_0x3d35c3['id'],'type':_0x40ccfb[_0xe197('0x2d')],'sectionId':_0x40ccfb['id']},{})[_0xe197('0x26')](function(){return _0x1f8b31;});}else{return _0x1f8b31;}})['catch'](function(_0x4ed6eb){logger[_0xe197('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ed6eb);throw _0x4ed6eb;});}return _0x1f8b31;})[_0xe197('0x26')](respondWithResult(_0x5cdbd5,0xc9))[_0xe197('0x48')](handleError(_0x5cdbd5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 1a28beb..af35ae3 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 _0xde70=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers'];(function(_0x3a692a,_0x169eae){var _0x2ad83d=function(_0xb64fd1){while(--_0xb64fd1){_0x3a692a['push'](_0x3a692a['shift']());}};_0x2ad83d(++_0x169eae);}(_0xde70,0x1a2));var _0x0de7=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0xde70[_0x529059];return _0x156bc2;};'use strict';var _=require(_0x0de7('0x0'));var util=require(_0x0de7('0x1'));var logger=require(_0x0de7('0x2'))(_0x0de7('0x3'));var moment=require(_0x0de7('0x4'));var BPromise=require(_0x0de7('0x5'));var rp=require(_0x0de7('0x6'));var fs=require('fs');var path=require(_0x0de7('0x7'));var rimraf=require(_0x0de7('0x8'));var config=require(_0x0de7('0x9'));var attributes=require(_0x0de7('0xa'));module['exports']=function(_0x5f5994,_0x16f694){return _0x5f5994[_0x0de7('0xb')](_0x0de7('0xc'),attributes,{'tableName':_0x0de7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0de7('0xe'),'collate':_0x0de7('0xf')});}; \ No newline at end of file +var _0x9507=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x590efd,_0x2aa5bd){var _0x2c3032=function(_0x58b3a2){while(--_0x58b3a2){_0x590efd['push'](_0x590efd['shift']());}};_0x2c3032(++_0x2aa5bd);}(_0x9507,0x1a7));var _0x7950=function(_0x45331f,_0x93c8d8){_0x45331f=_0x45331f-0x0;var _0x16277b=_0x9507[_0x45331f];return _0x16277b;};'use strict';var _=require(_0x7950('0x0'));var util=require(_0x7950('0x1'));var logger=require(_0x7950('0x2'))('api');var moment=require(_0x7950('0x3'));var BPromise=require(_0x7950('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7950('0x5'));var rimraf=require(_0x7950('0x6'));var config=require(_0x7950('0x7'));var attributes=require(_0x7950('0x8'));module[_0x7950('0x9')]=function(_0x5ceb3d,_0x388acd){return _0x5ceb3d[_0x7950('0xa')](_0x7950('0xb'),attributes,{'tableName':_0x7950('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7950('0xd'),'collate':_0x7950('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index f2d243f..6654acc 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(_0x26dab3,_0x7aae57){var _0x33fcff=function(_0x343268){while(--_0x343268){_0x26dab3['push'](_0x26dab3['shift']());}};_0x33fcff(++_0x7aae57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x36cb4c,_0x320bad){var _0x5c331c=function(_0x3c2f25){while(--_0x3c2f25){_0x36cb4c['push'](_0x36cb4c['shift']());}};_0x5c331c(++_0x320bad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 1c14cac..a06fe21 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 _0xf780=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy'];(function(_0xdbb6cb,_0x3b8fda){var _0x476b50=function(_0x470ebb){while(--_0x470ebb){_0xdbb6cb['push'](_0xdbb6cb['shift']());}};_0x476b50(++_0x3b8fda);}(_0xf780,0x13b));var _0x0f78=function(_0x1a8c7a,_0x1e7d99){_0x1a8c7a=_0x1a8c7a-0x0;var _0x2af4a9=_0xf780[_0x1a8c7a];return _0x2af4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0f78('0x0'));var express=require(_0x0f78('0x1'));var router=express[_0x0f78('0x2')]();var fs_extra=require(_0x0f78('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0f78('0x4'));var config=require(_0x0f78('0x5'));var controller=require('./cannedAnswer.controller');router[_0x0f78('0x6')]('/',auth[_0x0f78('0x7')](),controller[_0x0f78('0x8')]);router[_0x0f78('0x6')](_0x0f78('0x9'),auth['isAuthenticated'](),controller[_0x0f78('0xa')]);router[_0x0f78('0xb')]('/',auth[_0x0f78('0x7')](),controller['create']);router[_0x0f78('0xc')](_0x0f78('0x9'),auth[_0x0f78('0x7')](),controller[_0x0f78('0xd')]);router['delete'](_0x0f78('0x9'),auth[_0x0f78('0x7')](),controller[_0x0f78('0xe')]);module['exports']=router; \ No newline at end of file +var _0x6ebb=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1355c9,_0x1b94a7){var _0x22bf92=function(_0x45278e){while(--_0x45278e){_0x1355c9['push'](_0x1355c9['shift']());}};_0x22bf92(++_0x1b94a7);}(_0x6ebb,0x191));var _0xb6eb=function(_0x101877,_0x44bf48){_0x101877=_0x101877-0x0;var _0x57e807=_0x6ebb[_0x101877];return _0x57e807;};'use strict';var multer=require(_0xb6eb('0x0'));var util=require('util');var path=require(_0xb6eb('0x1'));var timeout=require(_0xb6eb('0x2'));var express=require(_0xb6eb('0x3'));var router=express[_0xb6eb('0x4')]();var fs_extra=require(_0xb6eb('0x5'));var auth=require(_0xb6eb('0x6'));var interaction=require(_0xb6eb('0x7'));var config=require('../../config/environment');var controller=require(_0xb6eb('0x8'));router['get']('/',auth[_0xb6eb('0x9')](),controller['index']);router[_0xb6eb('0xa')](_0xb6eb('0xb'),auth[_0xb6eb('0x9')](),controller[_0xb6eb('0xc')]);router[_0xb6eb('0xd')]('/',auth[_0xb6eb('0x9')](),controller[_0xb6eb('0xe')]);router[_0xb6eb('0xf')](_0xb6eb('0xb'),auth[_0xb6eb('0x9')](),controller[_0xb6eb('0x10')]);router[_0xb6eb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb6eb('0x12')]);module[_0xb6eb('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 1f03adc..3480258 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 _0x1e1a=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x230024,_0x44cfca){var _0x49f0ae=function(_0x2621fa){while(--_0x2621fa){_0x230024['push'](_0x230024['shift']());}};_0x49f0ae(++_0x44cfca);}(_0x1e1a,0x175));var _0xa1e1=function(_0x13e6e1,_0x22c6f9){_0x13e6e1=_0x13e6e1-0x0;var _0xab9bd6=_0x1e1a[_0x13e6e1];return _0xab9bd6;};'use strict';var Sequelize=require('sequelize');module[_0xa1e1('0x0')]={'calldate':{'type':Sequelize[_0xa1e1('0x1')],'allowNull':![],'defaultValue':_0xa1e1('0x2')},'clid':{'type':Sequelize[_0xa1e1('0x3')]},'src':{'type':Sequelize[_0xa1e1('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xa1e1('0x3')]},'channel':{'type':Sequelize[_0xa1e1('0x3')]},'dstchannel':{'type':Sequelize[_0xa1e1('0x3')]},'lastapp':{'type':Sequelize[_0xa1e1('0x3')]},'lastdata':{'type':Sequelize[_0xa1e1('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa1e1('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa1e1('0x3')]},'amaflags':{'type':Sequelize[_0xa1e1('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xa1e1('0x3')]},'uniqueid':{'type':Sequelize[_0xa1e1('0x3')]},'linkedid':{'type':Sequelize[_0xa1e1('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xa1e1('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xa1e1('0x3')]}}; \ No newline at end of file +var _0xedd9=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x24f5b1,_0x350007){var _0x451a13=function(_0x30d668){while(--_0x30d668){_0x24f5b1['push'](_0x24f5b1['shift']());}};_0x451a13(++_0x350007);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f59f8,_0x47bfa1){_0x1f59f8=_0x1f59f8-0x0;var _0x3bbd03=_0xedd9[_0x1f59f8];return _0x3bbd03;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'calldate':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![],'defaultValue':_0x9edd('0x2')},'clid':{'type':Sequelize[_0x9edd('0x3')]},'src':{'type':Sequelize[_0x9edd('0x3')]},'dst':{'type':Sequelize[_0x9edd('0x3')]},'dcontext':{'type':Sequelize[_0x9edd('0x3')]},'channel':{'type':Sequelize[_0x9edd('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9edd('0x3')]},'lastdata':{'type':Sequelize[_0x9edd('0x3')]},'duration':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9edd('0x3')]},'uniqueid':{'type':Sequelize[_0x9edd('0x3')]},'linkedid':{'type':Sequelize[_0x9edd('0x3')]},'sequence':{'type':Sequelize[_0x9edd('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9edd('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 4359c2b..b5077f4 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 _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf987,0x18a));var _0x7f98=function(_0x1cb5a3,_0x3102d3){_0x1cb5a3=_0x1cb5a3-0x0;var _0x339027=_0xf987[_0x1cb5a3];return _0x339027;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['Cdr']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['Cdr'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['Cdr'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['Cdr'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['Cdr'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));}; \ No newline at end of file +var _0xe0c3=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','Cdr','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x29a383,_0x6b9270){var _0x1aa80b=function(_0x536586){while(--_0x536586){_0x29a383['push'](_0x29a383['shift']());}};_0x1aa80b(++_0x6b9270);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e0c('0x1'));var jsonpatch=require(_0x3e0c('0x2'));var rp=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var BPromise=require(_0x3e0c('0x5'));var Mustache=require(_0x3e0c('0x6'));var util=require(_0x3e0c('0x7'));var path=require(_0x3e0c('0x8'));var sox=require(_0x3e0c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e0c('0xa'));var _=require(_0x3e0c('0xb'));var squel=require(_0x3e0c('0xc'));var crypto=require(_0x3e0c('0xd'));var jsforce=require(_0x3e0c('0xe'));var deskjs=require(_0x3e0c('0xf'));var toCsv=require(_0x3e0c('0x10'));var querystring=require(_0x3e0c('0x11'));var Papa=require(_0x3e0c('0x12'));var Redis=require(_0x3e0c('0x13'));var authService=require(_0x3e0c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e0c('0x15'));var logger=require(_0x3e0c('0x16'))(_0x3e0c('0x17'));var utils=require(_0x3e0c('0x18'));var config=require(_0x3e0c('0x19'));var licenseUtil=require(_0x3e0c('0x1a'));var db=require(_0x3e0c('0x1b'))['db'];function respondWithStatusCode(_0x5dc732,_0x38b416){_0x38b416=_0x38b416||0xcc;return function(_0x491432){if(_0x491432){return _0x5dc732[_0x3e0c('0x1c')](_0x38b416);}return _0x5dc732[_0x3e0c('0x1d')](_0x38b416)['end']();};}function respondWithResult(_0x5f2654,_0x6d9c61){_0x6d9c61=_0x6d9c61||0xc8;return function(_0x409b2c){if(_0x409b2c){return _0x5f2654[_0x3e0c('0x1d')](_0x6d9c61)[_0x3e0c('0x1e')](_0x409b2c);}};}function respondWithFilteredResult(_0x15a269,_0x24fcf9){return function(_0x1947c2){if(_0x1947c2){var _0x274d75=typeof _0x24fcf9[_0x3e0c('0x1f')]===_0x3e0c('0x20')&&typeof _0x24fcf9[_0x3e0c('0x21')]==='undefined';var _0x58c498=_0x1947c2[_0x3e0c('0x22')];var _0x216993=_0x274d75?0x0:_0x24fcf9[_0x3e0c('0x1f')];var _0x41b19f=_0x274d75?_0x1947c2[_0x3e0c('0x22')]:_0x24fcf9[_0x3e0c('0x1f')]+_0x24fcf9['limit'];var _0x2e4a4a;if(_0x41b19f>=_0x58c498){_0x41b19f=_0x58c498;_0x2e4a4a=0xc8;}else{_0x2e4a4a=0xce;}_0x15a269[_0x3e0c('0x1d')](_0x2e4a4a);return _0x15a269[_0x3e0c('0x23')]('Content-Range',_0x216993+'-'+_0x41b19f+'/'+_0x58c498)[_0x3e0c('0x1e')](_0x1947c2);}return null;};}function patchUpdates(_0x5e3a93){return function(_0x479265){try{jsonpatch[_0x3e0c('0x24')](_0x479265,_0x5e3a93,!![]);}catch(_0x1f3bad){return BPromise[_0x3e0c('0x25')](_0x1f3bad);}return _0x479265[_0x3e0c('0x26')]();};}function saveUpdates(_0x4f8d38,_0x4cd447){return function(_0x3320c6){if(_0x3320c6){return _0x3320c6['update'](_0x4f8d38)['then'](function(_0x3fd7de){return _0x3fd7de;});}return null;};}function removeEntity(_0x1769b1,_0x44ce68){return function(_0x5bb7aa){if(_0x5bb7aa){return _0x5bb7aa[_0x3e0c('0x27')]()[_0x3e0c('0x28')](function(){_0x1769b1['status'](0xcc)[_0x3e0c('0x29')]();});}};}function handleEntityNotFound(_0x3de58b,_0x308fd5){return function(_0x1db945){if(!_0x1db945){_0x3de58b['sendStatus'](0x194);}return _0x1db945;};}function handleError(_0x412960,_0xc2f3cc){_0xc2f3cc=_0xc2f3cc||0x1f4;return function(_0x2c5fba){logger[_0x3e0c('0x2a')](_0x2c5fba['stack']);if(_0x2c5fba[_0x3e0c('0x2b')]){delete _0x2c5fba['name'];}_0x412960['status'](_0xc2f3cc)[_0x3e0c('0x2c')](_0x2c5fba);};}exports[_0x3e0c('0x2d')]=function(_0x4d3ce2,_0x16fb92){var _0x3f22b1={},_0x21d7a0={},_0x59c22f={'count':0x0,'rows':[]};var _0x44ecad=_[_0x3e0c('0x2e')](db['Cdr'][_0x3e0c('0x2f')],function(_0x2f31ad){return{'name':_0x2f31ad[_0x3e0c('0x30')],'type':_0x2f31ad[_0x3e0c('0x31')]['key']};});_0x21d7a0[_0x3e0c('0x32')]=_[_0x3e0c('0x2e')](_0x44ecad,_0x3e0c('0x2b'));_0x21d7a0['query']=_[_0x3e0c('0x33')](_0x4d3ce2[_0x3e0c('0x34')]);_0x21d7a0[_0x3e0c('0x35')]=_['intersection'](_0x21d7a0[_0x3e0c('0x32')],_0x21d7a0[_0x3e0c('0x34')]);_0x3f22b1[_0x3e0c('0x36')]=_[_0x3e0c('0x37')](_0x21d7a0[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x3f22b1[_0x3e0c('0x36')]=_0x3f22b1[_0x3e0c('0x36')][_0x3e0c('0x39')]?_0x3f22b1[_0x3e0c('0x36')]:_0x21d7a0[_0x3e0c('0x32')];if(!_0x4d3ce2[_0x3e0c('0x34')]['hasOwnProperty'](_0x3e0c('0x3a'))){_0x3f22b1[_0x3e0c('0x21')]=qs[_0x3e0c('0x21')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x21')]);_0x3f22b1[_0x3e0c('0x1f')]=qs[_0x3e0c('0x1f')](_0x4d3ce2[_0x3e0c('0x34')]['offset']);}_0x3f22b1['order']=qs[_0x3e0c('0x3b')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3b')]);_0x3f22b1[_0x3e0c('0x3c')]=qs[_0x3e0c('0x35')](_[_0x3e0c('0x3d')](_0x4d3ce2['query'],_0x21d7a0[_0x3e0c('0x35')]),_0x44ecad);if(_0x4d3ce2[_0x3e0c('0x34')]['filter']){_0x3f22b1['where']=_['merge'](_0x3f22b1[_0x3e0c('0x3c')],{'$or':_[_0x3e0c('0x2e')](_0x44ecad,function(_0x3d6ed7){if(_0x3d6ed7[_0x3e0c('0x31')]!==_0x3e0c('0x3e')){var _0x45ec69={};_0x45ec69[_0x3d6ed7[_0x3e0c('0x2b')]]={'$like':'%'+_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3f')]+'%'};return _0x45ec69;}})});}_0x3f22b1=_[_0x3e0c('0x40')]({},_0x3f22b1,_0x4d3ce2[_0x3e0c('0x41')]);var _0x20135d={'where':_0x3f22b1['where']};return db['Cdr']['count'](_0x20135d)[_0x3e0c('0x28')](function(_0x22fcd8){_0x59c22f['count']=_0x22fcd8;if(_0x4d3ce2['query'][_0x3e0c('0x42')]){_0x3f22b1[_0x3e0c('0x43')]=[{'all':!![]}];}return db[_0x3e0c('0x44')][_0x3e0c('0x45')](_0x3f22b1);})['then'](function(_0x2e562f){_0x59c22f[_0x3e0c('0x46')]=_0x2e562f;return _0x59c22f;})[_0x3e0c('0x28')](respondWithFilteredResult(_0x16fb92,_0x3f22b1))[_0x3e0c('0x47')](handleError(_0x16fb92,null));};exports[_0x3e0c('0x48')]=function(_0x4b5638,_0x1bc4b3){var _0x5f4274={'raw':!![],'where':{'id':_0x4b5638[_0x3e0c('0x49')]['id']}},_0x35111f={};_0x35111f['model']=_['keys'](db[_0x3e0c('0x44')][_0x3e0c('0x2f')]);_0x35111f['query']=_[_0x3e0c('0x33')](_0x4b5638[_0x3e0c('0x34')]);_0x35111f[_0x3e0c('0x35')]=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],_0x35111f[_0x3e0c('0x34')]);_0x5f4274['attributes']=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4b5638[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x5f4274[_0x3e0c('0x36')]=_0x5f4274['attributes'][_0x3e0c('0x39')]?_0x5f4274[_0x3e0c('0x36')]:_0x35111f[_0x3e0c('0x32')];if(_0x4b5638['query'][_0x3e0c('0x42')]){_0x5f4274[_0x3e0c('0x43')]=[{'all':!![]}];}_0x5f4274=_['merge']({},_0x5f4274,_0x4b5638[_0x3e0c('0x41')]);return db[_0x3e0c('0x44')][_0x3e0c('0x4a')](_0x5f4274)['then'](handleEntityNotFound(_0x1bc4b3,null))[_0x3e0c('0x28')](respondWithResult(_0x1bc4b3,null))[_0x3e0c('0x47')](handleError(_0x1bc4b3,null));};exports[_0x3e0c('0x4b')]=function(_0x2c7b8c,_0x109078){return db[_0x3e0c('0x44')][_0x3e0c('0x4b')](_0x2c7b8c[_0x3e0c('0x4c')],{})[_0x3e0c('0x28')](respondWithResult(_0x109078,0xc9))[_0x3e0c('0x47')](handleError(_0x109078,null));};exports[_0x3e0c('0x4d')]=function(_0x4efbf2,_0x20c9df){if(_0x4efbf2['body']['id']){delete _0x4efbf2['body']['id'];}return db[_0x3e0c('0x44')]['find']({'where':{'id':_0x4efbf2[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x20c9df,null))['then'](saveUpdates(_0x4efbf2[_0x3e0c('0x4c')],null))[_0x3e0c('0x28')](respondWithResult(_0x20c9df,null))['catch'](handleError(_0x20c9df,null));};exports[_0x3e0c('0x27')]=function(_0x3e04c9,_0x166203){return db[_0x3e0c('0x44')][_0x3e0c('0x4a')]({'where':{'id':_0x3e04c9[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x166203,null))[_0x3e0c('0x28')](removeEntity(_0x166203,null))[_0x3e0c('0x47')](handleError(_0x166203,null));};exports[_0x3e0c('0x4e')]=function(_0x4d0f77,_0x3743ae){return db[_0x3e0c('0x44')][_0x3e0c('0x4e')]()[_0x3e0c('0x28')](respondWithResult(_0x3743ae,null))[_0x3e0c('0x47')](handleError(_0x3743ae,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index e438eae..e7ed322 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(_0x9e7aa6,_0x1607d4){var _0x5d5ff0=function(_0x3f800d){while(--_0x3f800d){_0x9e7aa6['push'](_0x9e7aa6['shift']());}};_0x5d5ff0(++_0x1607d4);}(_0x7a54,0x106));var _0x47a5=function(_0x407949,_0x29362c){_0x407949=_0x407949-0x0;var _0x5a3b3b=_0x7a54[_0x407949];return _0x5a3b3b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3b76c6,_0x1d8403){var _0x32eecd=function(_0x3342ed){while(--_0x3342ed){_0x3b76c6['push'](_0x3b76c6['shift']());}};_0x32eecd(++_0x1d8403);}(_0x7a54,0x106));var _0x47a5=function(_0x1f1fc1,_0x15b3f3){_0x1f1fc1=_0x1f1fc1-0x0;var _0x747d4f=_0x7a54[_0x1f1fc1];return _0x747d4f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 104cd99..baf1093 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 _0x5349=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x288a83,_0x107196){var _0x2c1f9f=function(_0x262038){while(--_0x262038){_0x288a83['push'](_0x288a83['shift']());}};_0x2c1f9f(++_0x107196);}(_0x5349,0x14a));var _0x9534=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x5349[_0x4d07cc];return _0x42de3b;};'use strict';var _=require('lodash');var util=require(_0x9534('0x0'));var moment=require(_0x9534('0x1'));var BPromise=require(_0x9534('0x2'));var rs=require(_0x9534('0x3'));var fs=require('fs');var Redis=require(_0x9534('0x4'));var db=require(_0x9534('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9534('0x6'))(_0x9534('0x7'));var config=require(_0x9534('0x8'));var jayson=require(_0x9534('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e902d,_0x2a175f,_0x4e3529){return new BPromise(function(_0x44c411,_0x487445){return client[_0x9534('0xa')](_0x5e902d,_0x4e3529)['then'](function(_0x4fc98a){logger[_0x9534('0xb')](_0x9534('0xc'),_0x2a175f,_0x9534('0xd'));logger[_0x9534('0xe')](_0x9534('0xf'),_0x2a175f,_0x9534('0xd'),JSON[_0x9534('0x10')](_0x4fc98a));if(_0x4fc98a['error']){if(_0x4fc98a['error'][_0x9534('0x11')]===0x1f4){logger[_0x9534('0x12')](_0x9534('0xc'),_0x2a175f,_0x4fc98a[_0x9534('0x12')][_0x9534('0x13')]);return _0x487445(_0x4fc98a[_0x9534('0x12')][_0x9534('0x13')]);}logger[_0x9534('0x12')](_0x9534('0xc'),_0x2a175f,_0x4fc98a[_0x9534('0x12')][_0x9534('0x13')]);return _0x44c411(_0x4fc98a[_0x9534('0x12')]['message']);}else{logger[_0x9534('0xb')]('Cdr,\x20%s,\x20%s',_0x2a175f,_0x9534('0xd'));_0x44c411(_0x4fc98a[_0x9534('0x14')][_0x9534('0x13')]);}})[_0x9534('0x15')](function(_0x986279){logger[_0x9534('0x12')](_0x9534('0xc'),_0x2a175f,_0x986279);_0x487445(_0x986279);});});} \ No newline at end of file +var _0x5bc4=['code','message','Cdr,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5bc4,0xe0));var _0x45bc=function(_0x54af28,_0x1a0cc3){_0x54af28=_0x54af28-0x0;var _0x394eef=_0x5bc4[_0x54af28];return _0x394eef;};'use strict';var _=require(_0x45bc('0x0'));var util=require(_0x45bc('0x1'));var moment=require(_0x45bc('0x2'));var BPromise=require(_0x45bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45bc('0x4'));var db=require(_0x45bc('0x5'))['db'];var utils=require(_0x45bc('0x6'));var logger=require('../../config/logger')(_0x45bc('0x7'));var config=require(_0x45bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x45bc('0x9')][_0x45bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f5c86,_0x2b2b27,_0x190f53){return new BPromise(function(_0x129c94,_0x270bff){return client[_0x45bc('0xb')](_0x5f5c86,_0x190f53)[_0x45bc('0xc')](function(_0x42913b){logger[_0x45bc('0xd')]('Cdr,\x20%s,\x20%s',_0x2b2b27,_0x45bc('0xe'));logger['debug'](_0x45bc('0xf'),_0x2b2b27,_0x45bc('0xe'),JSON[_0x45bc('0x10')](_0x42913b));if(_0x42913b[_0x45bc('0x11')]){if(_0x42913b[_0x45bc('0x11')][_0x45bc('0x12')]===0x1f4){logger[_0x45bc('0x11')]('Cdr,\x20%s,\x20%s',_0x2b2b27,_0x42913b[_0x45bc('0x11')][_0x45bc('0x13')]);return _0x270bff(_0x42913b[_0x45bc('0x11')][_0x45bc('0x13')]);}logger[_0x45bc('0x11')](_0x45bc('0x14'),_0x2b2b27,_0x42913b['error']['message']);return _0x129c94(_0x42913b[_0x45bc('0x11')][_0x45bc('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x2b2b27,_0x45bc('0xe'));_0x129c94(_0x42913b[_0x45bc('0x15')][_0x45bc('0x13')]);}})['catch'](function(_0x28374c){logger['error']('Cdr,\x20%s,\x20%s',_0x2b2b27,_0x28374c);_0x270bff(_0x28374c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 579b0e5..abf2b8d 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x28ea40,_0x189bdc){var _0x1507be=function(_0x49f421){while(--_0x49f421){_0x28ea40['push'](_0x28ea40['shift']());}};_0x1507be(++_0x189bdc);}(_0xb10b,0x12a));var _0xbb10=function(_0x27a997,_0x85f149){_0x27a997=_0x27a997-0x0;var _0x5aa288=_0xb10b[_0x27a997];return _0x5aa288;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 526b30c..b9d45b1 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 _0xd46a=['STRING','TEXT'];(function(_0x1e1f17,_0x4bd574){var _0x465b52=function(_0x46accd){while(--_0x46accd){_0x1e1f17['push'](_0x1e1f17['shift']());}};_0x465b52(++_0x4bd574);}(_0xd46a,0x80));var _0xad46=function(_0x58aa51,_0x18128d){_0x58aa51=_0x58aa51-0x0;var _0x3ff44f=_0xd46a[_0x58aa51];return _0x3ff44f;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xad46('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xad46('0x1')]()},'description':{'type':Sequelize[_0xad46('0x0')]},'interval':{'type':Sequelize[_0xad46('0x0')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xbb73=['exports','INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x2a1044,_0x455364){var _0x392a9e=function(_0x9d8758){while(--_0x9d8758){_0x2a1044['push'](_0x2a1044['shift']());}};_0x392a9e(++_0x455364);}(_0xbb73,0x130));var _0x3bb7=function(_0x1488e7,_0xa3c91b){_0x1488e7=_0x1488e7-0x0;var _0x2a62ea=_0xbb73[_0x1488e7];return _0x2a62ea;};'use strict';var Sequelize=require(_0x3bb7('0x0'));module[_0x3bb7('0x1')]={'priority':{'type':Sequelize[_0x3bb7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3bb7('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3bb7('0x3')]},'interval':{'type':Sequelize[_0x3bb7('0x3')],'defaultValue':_0x3bb7('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 694b074..c322c0e 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 _0xeb74=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','show','params','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x260c74,_0x3c9405){var _0x55c466=function(_0x35b0f4){while(--_0x35b0f4){_0x260c74['push'](_0x260c74['shift']());}};_0x55c466(++_0x3c9405);}(_0xeb74,0xe3));var _0x4eb7=function(_0x578676,_0x5cd3af){_0x578676=_0x578676-0x0;var _0x35d935=_0xeb74[_0x578676];return _0x35d935;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={'raw':!![],'where':{'id':_0x33a2c1[_0x4eb7('0x2e')]['id']}},_0x17030a={};_0x17030a['model']=_[_0x4eb7('0x2f')](db['ChatApplication'][_0x4eb7('0x30')]);_0x17030a[_0x4eb7('0x31')]=_[_0x4eb7('0x2f')](_0x33a2c1[_0x4eb7('0x31')]);_0x17030a[_0x4eb7('0x32')]=_[_0x4eb7('0x33')](_0x17030a[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x31')]);_0x114c68[_0x4eb7('0x35')]=_['intersection'](_0x17030a[_0x4eb7('0x34')],qs['fields'](_0x33a2c1[_0x4eb7('0x31')][_0x4eb7('0x36')]));_0x114c68['attributes']=_0x114c68['attributes'][_0x4eb7('0x37')]?_0x114c68[_0x4eb7('0x35')]:_0x17030a[_0x4eb7('0x34')];if(_0x33a2c1[_0x4eb7('0x31')]['includeAll']){_0x114c68[_0x4eb7('0x38')]=[{'all':!![]}];}_0x114c68=_[_0x4eb7('0x39')]({},_0x114c68,_0x33a2c1[_0x4eb7('0x3a')]);return db[_0x4eb7('0x3b')][_0x4eb7('0x3c')](_0x114c68)['then'](handleEntityNotFound(_0x28fda8,null))[_0x4eb7('0x25')](respondWithResult(_0x28fda8,null))[_0x4eb7('0x3d')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x24')]=function(_0x59d70a,_0x115642){if(_0x59d70a[_0x4eb7('0x3e')]['id']){delete _0x59d70a[_0x4eb7('0x3e')]['id'];}return db['ChatApplication'][_0x4eb7('0x3c')]({'where':{'id':_0x59d70a['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x115642,null))[_0x4eb7('0x25')](saveUpdates(_0x59d70a[_0x4eb7('0x3e')],null))[_0x4eb7('0x25')](respondWithResult(_0x115642,null))['catch'](handleError(_0x115642,null));};exports[_0x4eb7('0x26')]=function(_0xfd2721,_0x9c44e9){return db[_0x4eb7('0x3b')]['find']({'where':{'id':_0xfd2721['params']['id']}})['then'](handleEntityNotFound(_0x9c44e9,null))[_0x4eb7('0x25')](removeEntity(_0x9c44e9,null))[_0x4eb7('0x3d')](handleError(_0x9c44e9,null));}; \ No newline at end of file +var _0xad13=['length','includeAll','ChatApplication','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','show','keys','rawAttributes','query','filters','intersection','model','attributes','fields'];(function(_0x570815,_0x66adde){var _0x1ae40c=function(_0x163c2e){while(--_0x163c2e){_0x570815['push'](_0x570815['shift']());}};_0x1ae40c(++_0x66adde);}(_0xad13,0x79));var _0x3ad1=function(_0x28cddc,_0x1be16d){_0x28cddc=_0x28cddc-0x0;var _0x5ce855=_0xad13[_0x28cddc];return _0x5ce855;};'use strict';var emlformat=require(_0x3ad1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ad1('0x1'));var jsonpatch=require(_0x3ad1('0x2'));var rp=require(_0x3ad1('0x3'));var moment=require(_0x3ad1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ad1('0x5'));var util=require(_0x3ad1('0x6'));var path=require(_0x3ad1('0x7'));var sox=require(_0x3ad1('0x8'));var csv=require(_0x3ad1('0x9'));var ejs=require(_0x3ad1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ad1('0xb'));var _=require(_0x3ad1('0xc'));var squel=require(_0x3ad1('0xd'));var crypto=require(_0x3ad1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ad1('0xf'));var toCsv=require(_0x3ad1('0x9'));var querystring=require(_0x3ad1('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ad1('0x11'));var authService=require(_0x3ad1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3ad1('0x13'));var hardwareService=require(_0x3ad1('0x14'));var logger=require(_0x3ad1('0x15'))(_0x3ad1('0x16'));var utils=require(_0x3ad1('0x17'));var config=require(_0x3ad1('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x142957,_0x42f6a0){_0x42f6a0=_0x42f6a0||0xcc;return function(_0x4544c0){if(_0x4544c0){return _0x142957[_0x3ad1('0x19')](_0x42f6a0);}return _0x142957['status'](_0x42f6a0)[_0x3ad1('0x1a')]();};}function respondWithResult(_0x4bf44f,_0x19b1db){_0x19b1db=_0x19b1db||0xc8;return function(_0x3b68de){if(_0x3b68de){return _0x4bf44f[_0x3ad1('0x1b')](_0x19b1db)[_0x3ad1('0x1c')](_0x3b68de);}};}function respondWithFilteredResult(_0x5448a1,_0x4104aa){return function(_0xce229){if(_0xce229){var _0x384ed5=typeof _0x4104aa[_0x3ad1('0x1d')]===_0x3ad1('0x1e')&&typeof _0x4104aa[_0x3ad1('0x1f')]===_0x3ad1('0x1e');var _0x5cf66b=_0xce229[_0x3ad1('0x20')];var _0x30e53f=_0x384ed5?0x0:_0x4104aa[_0x3ad1('0x1d')];var _0xd43203=_0x384ed5?_0xce229[_0x3ad1('0x20')]:_0x4104aa['offset']+_0x4104aa[_0x3ad1('0x1f')];var _0x3de9a2;if(_0xd43203>=_0x5cf66b){_0xd43203=_0x5cf66b;_0x3de9a2=0xc8;}else{_0x3de9a2=0xce;}_0x5448a1['status'](_0x3de9a2);return _0x5448a1[_0x3ad1('0x21')](_0x3ad1('0x22'),_0x30e53f+'-'+_0xd43203+'/'+_0x5cf66b)[_0x3ad1('0x1c')](_0xce229);}return null;};}function patchUpdates(_0x46649d){return function(_0x1f65ff){try{jsonpatch[_0x3ad1('0x23')](_0x1f65ff,_0x46649d,!![]);}catch(_0x5aa568){return BPromise[_0x3ad1('0x24')](_0x5aa568);}return _0x1f65ff['save']();};}function saveUpdates(_0xc78309,_0x5f1031){return function(_0x21ed3b){if(_0x21ed3b){return _0x21ed3b[_0x3ad1('0x25')](_0xc78309)[_0x3ad1('0x26')](function(_0x3e9c1f){return _0x3e9c1f;});}return null;};}function removeEntity(_0x2365f3,_0x3a0166){return function(_0x2fd5e6){if(_0x2fd5e6){return _0x2fd5e6['destroy']()[_0x3ad1('0x26')](function(){_0x2365f3[_0x3ad1('0x1b')](0xcc)[_0x3ad1('0x1a')]();});}};}function handleEntityNotFound(_0x2ee2e8,_0x1d82a8){return function(_0x2cd135){if(!_0x2cd135){_0x2ee2e8['sendStatus'](0x194);}return _0x2cd135;};}function handleError(_0x5b5abc,_0x7b69e5){_0x7b69e5=_0x7b69e5||0x1f4;return function(_0x5e1c03){logger['error'](_0x5e1c03[_0x3ad1('0x27')]);if(_0x5e1c03[_0x3ad1('0x28')]){delete _0x5e1c03[_0x3ad1('0x28')];}_0x5b5abc[_0x3ad1('0x1b')](_0x7b69e5)['send'](_0x5e1c03);};}exports[_0x3ad1('0x29')]=function(_0xc56f8a,_0x402df6){var _0x3753f1={'raw':!![],'where':{'id':_0xc56f8a['params']['id']}},_0x345cb9={};_0x345cb9['model']=_[_0x3ad1('0x2a')](db['ChatApplication'][_0x3ad1('0x2b')]);_0x345cb9[_0x3ad1('0x2c')]=_[_0x3ad1('0x2a')](_0xc56f8a[_0x3ad1('0x2c')]);_0x345cb9[_0x3ad1('0x2d')]=_[_0x3ad1('0x2e')](_0x345cb9[_0x3ad1('0x2f')],_0x345cb9[_0x3ad1('0x2c')]);_0x3753f1[_0x3ad1('0x30')]=_['intersection'](_0x345cb9[_0x3ad1('0x2f')],qs['fields'](_0xc56f8a[_0x3ad1('0x2c')][_0x3ad1('0x31')]));_0x3753f1[_0x3ad1('0x30')]=_0x3753f1[_0x3ad1('0x30')][_0x3ad1('0x32')]?_0x3753f1[_0x3ad1('0x30')]:_0x345cb9[_0x3ad1('0x2f')];if(_0xc56f8a['query'][_0x3ad1('0x33')]){_0x3753f1['include']=[{'all':!![]}];}_0x3753f1=_['merge']({},_0x3753f1,_0xc56f8a['options']);return db[_0x3ad1('0x34')][_0x3ad1('0x35')](_0x3753f1)[_0x3ad1('0x26')](handleEntityNotFound(_0x402df6,null))[_0x3ad1('0x26')](respondWithResult(_0x402df6,null))[_0x3ad1('0x36')](handleError(_0x402df6,null));};exports[_0x3ad1('0x25')]=function(_0x54f100,_0x51d21b){if(_0x54f100[_0x3ad1('0x37')]['id']){delete _0x54f100[_0x3ad1('0x37')]['id'];}return db[_0x3ad1('0x34')][_0x3ad1('0x35')]({'where':{'id':_0x54f100[_0x3ad1('0x38')]['id']}})['then'](handleEntityNotFound(_0x51d21b,null))['then'](saveUpdates(_0x54f100['body'],null))['then'](respondWithResult(_0x51d21b,null))[_0x3ad1('0x36')](handleError(_0x51d21b,null));};exports['destroy']=function(_0x5c2acd,_0x78b554){return db[_0x3ad1('0x34')]['find']({'where':{'id':_0x5c2acd[_0x3ad1('0x38')]['id']}})[_0x3ad1('0x26')](handleEntityNotFound(_0x78b554,null))['then'](removeEntity(_0x78b554,null))[_0x3ad1('0x36')](handleError(_0x78b554,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 713d33c..a7ea468 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 _0x9bad=['rimraf','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x17871b,_0x2b7413){var _0x4e8fc4=function(_0x297ea9){while(--_0x297ea9){_0x17871b['push'](_0x17871b['shift']());}};_0x4e8fc4(++_0x2b7413);}(_0x9bad,0xa2));var _0xd9ba=function(_0x47eea0,_0x23ec31){_0x47eea0=_0x47eea0-0x0;var _0x2b1441=_0x9bad[_0x47eea0];return _0x2b1441;};'use strict';var _=require(_0xd9ba('0x0'));var util=require('util');var logger=require(_0xd9ba('0x1'))(_0xd9ba('0x2'));var moment=require('moment');var BPromise=require(_0xd9ba('0x3'));var rp=require(_0xd9ba('0x4'));var fs=require('fs');var path=require(_0xd9ba('0x5'));var rimraf=require(_0xd9ba('0x6'));var config=require('../../config/environment');var attributes=require(_0xd9ba('0x7'));module[_0xd9ba('0x8')]=function(_0x32d8b7,_0x4ffbb7){return _0x32d8b7[_0xd9ba('0x9')](_0xd9ba('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd9ba('0xb')});}; \ No newline at end of file +var _0x75e0=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x75e0,0x1c8));var _0x075e=function(_0x37c1d2,_0x33b3da){_0x37c1d2=_0x37c1d2-0x0;var _0x67375=_0x75e0[_0x37c1d2];return _0x67375;};'use strict';var _=require(_0x075e('0x0'));var util=require(_0x075e('0x1'));var logger=require(_0x075e('0x2'))('api');var moment=require(_0x075e('0x3'));var BPromise=require(_0x075e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x075e('0x5'));var rimraf=require('rimraf');var config=require(_0x075e('0x6'));var attributes=require(_0x075e('0x7'));module[_0x075e('0x8')]=function(_0x17a2ff,_0x379b0e){return _0x17a2ff[_0x075e('0x9')](_0x075e('0xa'),attributes,{'tableName':_0x075e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x075e('0xc'),'collate':_0x075e('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 42f5a74..a7b7c79 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 _0xa350=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x263439,_0x35bd4d){var _0x202099=function(_0x326345){while(--_0x326345){_0x263439['push'](_0x263439['shift']());}};_0x202099(++_0x35bd4d);}(_0xa350,0x1e3));var _0x0a35=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xa350[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x0a35('0x0'));var util=require('util');var moment=require(_0x0a35('0x1'));var BPromise=require(_0x0a35('0x2'));var rs=require(_0x0a35('0x3'));var fs=require('fs');var Redis=require(_0x0a35('0x4'));var db=require(_0x0a35('0x5'))['db'];var utils=require(_0x0a35('0x6'));var logger=require(_0x0a35('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0a35('0x8'));var client=jayson[_0x0a35('0x9')][_0x0a35('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ea90,_0x2a99ff,_0x4bf15a){return new BPromise(function(_0x70945,_0x1f2964){return client[_0x0a35('0xb')](_0x57ea90,_0x4bf15a)[_0x0a35('0xc')](function(_0x34ffd6){logger[_0x0a35('0xd')](_0x0a35('0xe'),_0x2a99ff,_0x0a35('0xf'));logger[_0x0a35('0x10')](_0x0a35('0x11'),_0x2a99ff,_0x0a35('0xf'),JSON[_0x0a35('0x12')](_0x34ffd6));if(_0x34ffd6['error']){if(_0x34ffd6[_0x0a35('0x13')]['code']===0x1f4){logger[_0x0a35('0x13')](_0x0a35('0xe'),_0x2a99ff,_0x34ffd6[_0x0a35('0x13')][_0x0a35('0x14')]);return _0x1f2964(_0x34ffd6['error'][_0x0a35('0x14')]);}logger[_0x0a35('0x13')]('ChatApplication,\x20%s,\x20%s',_0x2a99ff,_0x34ffd6['error'][_0x0a35('0x14')]);return _0x70945(_0x34ffd6[_0x0a35('0x13')][_0x0a35('0x14')]);}else{logger[_0x0a35('0xd')](_0x0a35('0xe'),_0x2a99ff,_0x0a35('0xf'));_0x70945(_0x34ffd6[_0x0a35('0x15')][_0x0a35('0x14')]);}})[_0x0a35('0x16')](function(_0x1087e0){logger[_0x0a35('0x13')]('ChatApplication,\x20%s,\x20%s',_0x2a99ff,_0x1087e0);_0x1f2964(_0x1087e0);});});} \ No newline at end of file +var _0x7731=['debug','stringify','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/environment','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x11691e,_0x148f26){var _0x35fd19=function(_0x3324ea){while(--_0x3324ea){_0x11691e['push'](_0x11691e['shift']());}};_0x35fd19(++_0x148f26);}(_0x7731,0x1a6));var _0x1773=function(_0x4d883e,_0x3f74fd){_0x4d883e=_0x4d883e-0x0;var _0x2f7fc9=_0x7731[_0x4d883e];return _0x2f7fc9;};'use strict';var _=require(_0x1773('0x0'));var util=require(_0x1773('0x1'));var moment=require(_0x1773('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1773('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1773('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf83acc,_0x368043,_0x2f6b4f){return new BPromise(function(_0x238043,_0x57d81c){return client[_0x1773('0x5')](_0xf83acc,_0x2f6b4f)[_0x1773('0x6')](function(_0x10857a){logger[_0x1773('0x7')](_0x1773('0x8'),_0x368043,_0x1773('0x9'));logger[_0x1773('0xa')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x368043,_0x1773('0x9'),JSON[_0x1773('0xb')](_0x10857a));if(_0x10857a[_0x1773('0xc')]){if(_0x10857a['error']['code']===0x1f4){logger[_0x1773('0xc')](_0x1773('0x8'),_0x368043,_0x10857a[_0x1773('0xc')]['message']);return _0x57d81c(_0x10857a['error']['message']);}logger[_0x1773('0xc')](_0x1773('0x8'),_0x368043,_0x10857a[_0x1773('0xc')][_0x1773('0xd')]);return _0x238043(_0x10857a[_0x1773('0xc')][_0x1773('0xd')]);}else{logger[_0x1773('0x7')]('ChatApplication,\x20%s,\x20%s',_0x368043,_0x1773('0x9'));_0x238043(_0x10857a[_0x1773('0xe')][_0x1773('0xd')]);}})[_0x1773('0xf')](function(_0x232508){logger['error'](_0x1773('0x8'),_0x368043,_0x232508);_0x57d81c(_0x232508);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 4d9083e..da50f17 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 _0x4f10=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','express','Router','fs-extra'];(function(_0x11aaa9,_0x1612c0){var _0x3d085b=function(_0x2b2020){while(--_0x2b2020){_0x11aaa9['push'](_0x11aaa9['shift']());}};_0x3d085b(++_0x1612c0);}(_0x4f10,0x1cd));var _0x04f1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4f10[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x04f1('0x0'));var router=express[_0x04f1('0x1')]();var fs_extra=require(_0x04f1('0x2'));var auth=require(_0x04f1('0x3'));var interaction=require(_0x04f1('0x4'));var config=require(_0x04f1('0x5'));var controller=require(_0x04f1('0x6'));router[_0x04f1('0x7')](_0x04f1('0x8'),auth[_0x04f1('0x9')](),controller[_0x04f1('0xa')]);router[_0x04f1('0xb')](_0x04f1('0x8'),auth[_0x04f1('0x9')](),controller[_0x04f1('0xc')]);router[_0x04f1('0xd')](_0x04f1('0x8'),auth[_0x04f1('0x9')](),controller[_0x04f1('0xe')]);module[_0x04f1('0xf')]=router; \ No newline at end of file +var _0xde40=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x433c2e,_0x3338c6){var _0x40acfa=function(_0x5adc05){while(--_0x5adc05){_0x433c2e['push'](_0x433c2e['shift']());}};_0x40acfa(++_0x3338c6);}(_0xde40,0xca));var _0x0de4=function(_0x25c85b,_0x4b3358){_0x25c85b=_0x25c85b-0x0;var _0x78f460=_0xde40[_0x25c85b];return _0x78f460;};'use strict';var multer=require(_0x0de4('0x0'));var util=require(_0x0de4('0x1'));var path=require(_0x0de4('0x2'));var timeout=require(_0x0de4('0x3'));var express=require('express');var router=express[_0x0de4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0de4('0x5'));var interaction=require(_0x0de4('0x6'));var config=require(_0x0de4('0x7'));var controller=require(_0x0de4('0x8'));router[_0x0de4('0x9')](_0x0de4('0xa'),auth['isAuthenticated'](),controller['show']);router['put'](_0x0de4('0xa'),auth['isAuthenticated'](),controller[_0x0de4('0xb')]);router[_0x0de4('0xc')](_0x0de4('0xa'),auth[_0x0de4('0xd')](),controller[_0x0de4('0xe')]);module[_0x0de4('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index a7a294f..4df3fd2 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 _0xc748=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5dccda,_0x244552){var _0x4e8c52=function(_0x168253){while(--_0x168253){_0x5dccda['push'](_0x5dccda['shift']());}};_0x4e8c52(++_0x244552);}(_0xc748,0x12a));var _0x8c74=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xc748[_0x2576d7];return _0x16a08c;};'use strict';var Sequelize=require(_0x8c74('0x0'));module[_0x8c74('0x1')]={'name':{'type':Sequelize[_0x8c74('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8c74('0x2')]},'write':{'type':Sequelize[_0x8c74('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd600=['STRING','BOOLEAN','exports'];(function(_0x486ab6,_0x257c0a){var _0x1ce5ea=function(_0x1443a5){while(--_0x1443a5){_0x486ab6['push'](_0x486ab6['shift']());}};_0x1ce5ea(++_0x257c0a);}(_0xd600,0x1d6));var _0x0d60=function(_0x107c3f,_0x5334ee){_0x107c3f=_0x107c3f-0x0;var _0x23032d=_0xd600[_0x107c3f];return _0x23032d;};'use strict';var Sequelize=require('sequelize');module[_0x0d60('0x0')]={'name':{'type':Sequelize[_0x0d60('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0d60('0x1')]},'write':{'type':Sequelize[_0x0d60('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index c5b283d..4e49d98 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 _0x62b2=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','ChatGroup','includeAll','then','rows','catch','show','params','include','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters'];(function(_0x14a333,_0x2e44cf){var _0x322cf5=function(_0x2e79b3){while(--_0x2e79b3){_0x14a333['push'](_0x14a333['shift']());}};_0x322cf5(++_0x2e44cf);}(_0x62b2,0x91));var _0x262b=function(_0xa73d3f,_0xb50b97){_0xa73d3f=_0xa73d3f-0x0;var _0xafcda5=_0x62b2[_0xa73d3f];return _0xafcda5;};'use strict';var emlformat=require(_0x262b('0x0'));var rimraf=require(_0x262b('0x1'));var zipdir=require(_0x262b('0x2'));var jsonpatch=require(_0x262b('0x3'));var rp=require(_0x262b('0x4'));var moment=require(_0x262b('0x5'));var BPromise=require(_0x262b('0x6'));var Mustache=require(_0x262b('0x7'));var util=require(_0x262b('0x8'));var path=require(_0x262b('0x9'));var sox=require(_0x262b('0xa'));var csv=require(_0x262b('0xb'));var ejs=require(_0x262b('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x262b('0xd'));var squel=require(_0x262b('0xe'));var crypto=require(_0x262b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x262b('0x10'));var toCsv=require(_0x262b('0xb'));var querystring=require(_0x262b('0x11'));var Papa=require(_0x262b('0x12'));var Redis=require(_0x262b('0x13'));var authService=require(_0x262b('0x14'));var qs=require(_0x262b('0x15'));var as=require(_0x262b('0x16'));var hardwareService=require(_0x262b('0x17'));var logger=require(_0x262b('0x18'))(_0x262b('0x19'));var utils=require(_0x262b('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x262b('0x1b'));var db=require('../../mysqldb')['db'];config[_0x262b('0x1c')]=_['defaults'](config[_0x262b('0x1c')],{'host':_0x262b('0x1d'),'port':0x18eb});var socket=require(_0x262b('0x1e'))(new Redis(config['redis']));require(_0x262b('0x1f'))['register'](socket);function respondWithStatusCode(_0x43909a,_0x1a28a6){_0x1a28a6=_0x1a28a6||0xcc;return function(_0x29748c){if(_0x29748c){return _0x43909a[_0x262b('0x20')](_0x1a28a6);}return _0x43909a[_0x262b('0x21')](_0x1a28a6)[_0x262b('0x22')]();};}function respondWithResult(_0x3aa0b9,_0x51c9db){_0x51c9db=_0x51c9db||0xc8;return function(_0x1deb06){if(_0x1deb06){return _0x3aa0b9[_0x262b('0x21')](_0x51c9db)[_0x262b('0x23')](_0x1deb06);}};}function respondWithFilteredResult(_0x4fea4c,_0x3a9be7){return function(_0x5a3b74){if(_0x5a3b74){var _0x13404c=typeof _0x3a9be7[_0x262b('0x24')]===_0x262b('0x25')&&typeof _0x3a9be7[_0x262b('0x26')]===_0x262b('0x25');var _0x1e7514=_0x5a3b74['count'];var _0xe9499a=_0x13404c?0x0:_0x3a9be7[_0x262b('0x24')];var _0x2e57e6=_0x13404c?_0x5a3b74[_0x262b('0x27')]:_0x3a9be7['offset']+_0x3a9be7['limit'];var _0x2093be;if(_0x2e57e6>=_0x1e7514){_0x2e57e6=_0x1e7514;_0x2093be=0xc8;}else{_0x2093be=0xce;}_0x4fea4c[_0x262b('0x21')](_0x2093be);return _0x4fea4c[_0x262b('0x28')](_0x262b('0x29'),_0xe9499a+'-'+_0x2e57e6+'/'+_0x1e7514)[_0x262b('0x23')](_0x5a3b74);}return null;};}function patchUpdates(_0x65266d){return function(_0x4acdda){try{jsonpatch[_0x262b('0x2a')](_0x4acdda,_0x65266d,!![]);}catch(_0x16104c){return BPromise[_0x262b('0x2b')](_0x16104c);}return _0x4acdda[_0x262b('0x2c')]();};}function saveUpdates(_0xe64b87,_0x5aa45c){return function(_0x233a3b){if(_0x233a3b){return _0x233a3b[_0x262b('0x2d')](_0xe64b87)['then'](function(_0x34b499){return _0x34b499;});}return null;};}function removeEntity(_0x3a8402,_0xd8df04){return function(_0x445797){if(_0x445797){return _0x445797[_0x262b('0x2e')]()['then'](function(){_0x3a8402[_0x262b('0x21')](0xcc)[_0x262b('0x22')]();});}};}function handleEntityNotFound(_0x15181f,_0x57d7b4){return function(_0x30f38a){if(!_0x30f38a){_0x15181f['sendStatus'](0x194);}return _0x30f38a;};}function handleError(_0x29c6c1,_0x136fea){_0x136fea=_0x136fea||0x1f4;return function(_0x9d5928){logger[_0x262b('0x2f')](_0x9d5928[_0x262b('0x30')]);if(_0x9d5928[_0x262b('0x31')]){delete _0x9d5928['name'];}_0x29c6c1[_0x262b('0x21')](_0x136fea)[_0x262b('0x32')](_0x9d5928);};}exports[_0x262b('0x33')]=function(_0x287df2,_0x1708ff){var _0x4aa948={},_0x4e896d={},_0x398ea4={'count':0x0,'rows':[]};var _0x4fe66e=_[_0x262b('0x34')](db['ChatGroup'][_0x262b('0x35')],function(_0x101402){return{'name':_0x101402['fieldName'],'type':_0x101402['type'][_0x262b('0x36')]};});_0x4e896d[_0x262b('0x37')]=_[_0x262b('0x34')](_0x4fe66e,_0x262b('0x31'));_0x4e896d[_0x262b('0x38')]=_[_0x262b('0x39')](_0x287df2[_0x262b('0x38')]);_0x4e896d[_0x262b('0x3a')]=_['intersection'](_0x4e896d[_0x262b('0x37')],_0x4e896d[_0x262b('0x38')]);_0x4aa948[_0x262b('0x3b')]=_[_0x262b('0x3c')](_0x4e896d[_0x262b('0x37')],qs[_0x262b('0x3d')](_0x287df2['query'][_0x262b('0x3d')]));_0x4aa948['attributes']=_0x4aa948[_0x262b('0x3b')][_0x262b('0x3e')]?_0x4aa948[_0x262b('0x3b')]:_0x4e896d[_0x262b('0x37')];if(!_0x287df2[_0x262b('0x38')][_0x262b('0x3f')](_0x262b('0x40'))){_0x4aa948['limit']=qs[_0x262b('0x26')](_0x287df2[_0x262b('0x38')][_0x262b('0x26')]);_0x4aa948[_0x262b('0x24')]=qs[_0x262b('0x24')](_0x287df2[_0x262b('0x38')][_0x262b('0x24')]);}_0x4aa948[_0x262b('0x41')]=qs['sort'](_0x287df2[_0x262b('0x38')][_0x262b('0x42')]);_0x4aa948[_0x262b('0x43')]=qs[_0x262b('0x3a')](_['pick'](_0x287df2[_0x262b('0x38')],_0x4e896d['filters']),_0x4fe66e);if(_0x287df2[_0x262b('0x38')][_0x262b('0x44')]){_0x4aa948['where']=_['merge'](_0x4aa948[_0x262b('0x43')],{'$or':_['map'](_0x4fe66e,function(_0x467038){if(_0x467038[_0x262b('0x45')]!==_0x262b('0x46')){var _0x3ee674={};_0x3ee674[_0x467038[_0x262b('0x31')]]={'$like':'%'+_0x287df2['query'][_0x262b('0x44')]+'%'};return _0x3ee674;}})});}_0x4aa948=_[_0x262b('0x47')]({},_0x4aa948,_0x287df2['options']);var _0x102cf5={'where':_0x4aa948[_0x262b('0x43')]};return db[_0x262b('0x48')][_0x262b('0x27')](_0x102cf5)['then'](function(_0x2fc130){_0x398ea4['count']=_0x2fc130;if(_0x287df2[_0x262b('0x38')][_0x262b('0x49')]){_0x4aa948['include']=[{'all':!![]}];}return db[_0x262b('0x48')]['findAll'](_0x4aa948);})[_0x262b('0x4a')](function(_0x4e808d){_0x398ea4[_0x262b('0x4b')]=_0x4e808d;return _0x398ea4;})[_0x262b('0x4a')](respondWithFilteredResult(_0x1708ff,_0x4aa948))[_0x262b('0x4c')](handleError(_0x1708ff,null));};exports[_0x262b('0x4d')]=function(_0x38aea2,_0x2e8d15){var _0x3b641f={'raw':!![],'where':{'id':_0x38aea2[_0x262b('0x4e')]['id']}},_0x451288={};_0x451288['model']=_[_0x262b('0x39')](db['ChatGroup'][_0x262b('0x35')]);_0x451288[_0x262b('0x38')]=_[_0x262b('0x39')](_0x38aea2[_0x262b('0x38')]);_0x451288[_0x262b('0x3a')]=_['intersection'](_0x451288[_0x262b('0x37')],_0x451288['query']);_0x3b641f[_0x262b('0x3b')]=_[_0x262b('0x3c')](_0x451288[_0x262b('0x37')],qs[_0x262b('0x3d')](_0x38aea2['query'][_0x262b('0x3d')]));_0x3b641f['attributes']=_0x3b641f[_0x262b('0x3b')][_0x262b('0x3e')]?_0x3b641f[_0x262b('0x3b')]:_0x451288[_0x262b('0x37')];if(_0x38aea2[_0x262b('0x38')][_0x262b('0x49')]){_0x3b641f[_0x262b('0x4f')]=[{'all':!![]}];}_0x3b641f=_[_0x262b('0x47')]({},_0x3b641f,_0x38aea2[_0x262b('0x50')]);return db[_0x262b('0x48')][_0x262b('0x51')](_0x3b641f)[_0x262b('0x4a')](handleEntityNotFound(_0x2e8d15,null))[_0x262b('0x4a')](respondWithResult(_0x2e8d15,null))['catch'](handleError(_0x2e8d15,null));};exports[_0x262b('0x52')]=function(_0x291c53,_0x54a93e){return db[_0x262b('0x48')][_0x262b('0x52')](_0x291c53[_0x262b('0x53')],{})['then'](respondWithResult(_0x54a93e,0xc9))[_0x262b('0x4c')](handleError(_0x54a93e,null));};exports['update']=function(_0x5eac53,_0x368f4a){if(_0x5eac53['body']['id']){delete _0x5eac53[_0x262b('0x53')]['id'];}return db[_0x262b('0x48')][_0x262b('0x51')]({'where':{'id':_0x5eac53[_0x262b('0x4e')]['id']}})[_0x262b('0x4a')](handleEntityNotFound(_0x368f4a,null))[_0x262b('0x4a')](saveUpdates(_0x5eac53['body'],null))[_0x262b('0x4a')](respondWithResult(_0x368f4a,null))[_0x262b('0x4c')](handleError(_0x368f4a,null));};exports['destroy']=function(_0x57410f,_0x4d613e){return db[_0x262b('0x48')][_0x262b('0x51')]({'where':{'id':_0x57410f[_0x262b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d613e,null))[_0x262b('0x4a')](removeEntity(_0x4d613e,null))[_0x262b('0x4c')](handleError(_0x4d613e,null));};exports['describe']=function(_0x2e08f3,_0x2439eb){return db['ChatGroup'][_0x262b('0x54')]()[_0x262b('0x4a')](respondWithResult(_0x2439eb,null))[_0x262b('0x4c')](handleError(_0x2439eb,null));};exports[_0x262b('0x55')]=function(_0x2ef772,_0x466708,_0x22cdb3){return db[_0x262b('0x56')][_0x262b('0x27')]({'where':{'ChatGroupId':_0x2ef772['params']['id'],'ToId':_0x2ef772[_0x262b('0x57')]['id'],'read':![]}})[_0x262b('0x4a')](function(_0x33bbd1){return{'id':_[_0x262b('0x58')](_0x2ef772[_0x262b('0x4e')]['id']),'count':_0x33bbd1};})[_0x262b('0x4a')](respondWithResult(_0x466708,null))['catch'](handleError(_0x466708,null));};exports['addMembers']=function(_0x20f2e9,_0x243be6,_0x5cb0fd){return db['ChatGroup'][_0x262b('0x51')]({'where':{'id':_0x20f2e9[_0x262b('0x4e')]['id']}})[_0x262b('0x4a')](handleEntityNotFound(_0x243be6,null))[_0x262b('0x4a')](function(_0x36d8e3){if(_0x36d8e3){return _0x36d8e3[_0x262b('0x59')](_0x20f2e9[_0x262b('0x53')][_0x262b('0x5a')],_[_0x262b('0x5b')](_0x20f2e9[_0x262b('0x53')],[_0x262b('0x5a'),'id'])||{});}})[_0x262b('0x4a')](respondWithResult(_0x243be6,null))[_0x262b('0x4c')](handleError(_0x243be6,null));};exports[_0x262b('0x5c')]=function(_0x323aa4,_0x28530f,_0x395438){var _0xb3923e={};var _0xdb23bb={};var _0x6a5e65;var _0x20a099;return db[_0x262b('0x48')]['findOne']({'where':{'id':_0x323aa4[_0x262b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x28530f,null))['then'](function(_0x5ff376){if(_0x5ff376){_0x6a5e65=_0x5ff376;_0xdb23bb[_0x262b('0x37')]=_[_0x262b('0x39')](db[_0x262b('0x5d')][_0x262b('0x35')]);_0xdb23bb['query']=_[_0x262b('0x39')](_0x323aa4[_0x262b('0x38')]);_0xdb23bb[_0x262b('0x3a')]=_[_0x262b('0x3c')](_0xdb23bb[_0x262b('0x37')],_0xdb23bb[_0x262b('0x38')]);_0xb3923e[_0x262b('0x3b')]=_[_0x262b('0x3c')](_0xdb23bb[_0x262b('0x37')],qs[_0x262b('0x3d')](_0x323aa4[_0x262b('0x38')]['fields']));_0xb3923e[_0x262b('0x3b')]=_0xb3923e[_0x262b('0x3b')][_0x262b('0x3e')]?_0xb3923e[_0x262b('0x3b')]:_0xdb23bb[_0x262b('0x37')];_0xb3923e[_0x262b('0x41')]=qs[_0x262b('0x42')](_0x323aa4[_0x262b('0x38')][_0x262b('0x42')]);_0xb3923e['where']=qs[_0x262b('0x3a')](_[_0x262b('0x5e')](_0x323aa4['query'],_0xdb23bb[_0x262b('0x3a')]));if(_0x323aa4[_0x262b('0x38')][_0x262b('0x44')]){_0xb3923e['where']=_[_0x262b('0x47')](_0xb3923e[_0x262b('0x43')],{'$or':_['map'](_0xb3923e[_0x262b('0x3b')],function(_0x115e58){var _0x46460a={};_0x46460a[_0x115e58]={'$like':'%'+_0x323aa4['query'][_0x262b('0x44')]+'%'};return _0x46460a;})});}_0xb3923e=_['merge']({},_0xb3923e,_0x323aa4[_0x262b('0x50')]);return _0x6a5e65['getMembers'](_0xb3923e);}})[_0x262b('0x4a')](function(_0x33e35e){if(_0x33e35e){_0x20a099=_0x33e35e['length'];if(!_0x323aa4[_0x262b('0x38')]['hasOwnProperty'](_0x262b('0x40'))){_0xb3923e[_0x262b('0x26')]=qs[_0x262b('0x26')](_0x323aa4[_0x262b('0x38')][_0x262b('0x26')]);_0xb3923e[_0x262b('0x24')]=qs[_0x262b('0x24')](_0x323aa4[_0x262b('0x38')][_0x262b('0x24')]);}return _0x6a5e65['getMembers'](_0xb3923e);}})[_0x262b('0x4a')](function(_0x21064f){if(_0x21064f){return _0x21064f?{'count':_0x20a099,'rows':_0x21064f}:null;}})['then'](respondWithResult(_0x28530f,null))[_0x262b('0x4c')](handleError(_0x28530f,null));};exports[_0x262b('0x5f')]=function(_0xb2e8a3,_0x23ef2d,_0x2f3cd0){return db[_0x262b('0x48')][_0x262b('0x51')]({'where':{'id':_0xb2e8a3[_0x262b('0x4e')]['id']}})[_0x262b('0x4a')](handleEntityNotFound(_0x23ef2d,null))[_0x262b('0x4a')](function(_0x2c7e9c){if(_0x2c7e9c){return _0x2c7e9c['removeMembers'](_0xb2e8a3['query']['ids']);}})['then'](respondWithStatusCode(_0x23ef2d,null))[_0x262b('0x4c')](handleError(_0x23ef2d,null));};exports[_0x262b('0x60')]=function(_0x1e6180,_0x34e54e,_0x3c0d7f){if(_0x1e6180[_0x262b('0x53')]['id']){delete _0x1e6180[_0x262b('0x53')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1e6180['params']['id']}})['then'](handleEntityNotFound(_0x34e54e,null))['then'](function(_0x5b78c5){if(_0x5b78c5){_0x1e6180[_0x262b('0x53')][_0x262b('0x61')]=_0x5b78c5['id'];return db['ChatInternalMessage'][_0x262b('0x52')](_0x1e6180['body']);}})[_0x262b('0x4a')](respondWithResult(_0x34e54e,null))[_0x262b('0x4c')](handleError(_0x34e54e,null));};exports[_0x262b('0x62')]=function(_0x4a1cf5,_0x4b1a2f,_0x384a0a){var _0x2aebc7={};var _0x2ce7bf={};var _0x3ce546;var _0x2e09ee;return db[_0x262b('0x48')][_0x262b('0x63')]({'where':{'id':_0x4a1cf5[_0x262b('0x4e')]['id']}})[_0x262b('0x4a')](handleEntityNotFound(_0x4b1a2f,null))[_0x262b('0x4a')](function(_0x4e8329){if(_0x4e8329){_0x3ce546=_0x4e8329;_0x2ce7bf[_0x262b('0x37')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x2ce7bf[_0x262b('0x38')]=_[_0x262b('0x39')](_0x4a1cf5['query']);_0x2ce7bf['filters']=_[_0x262b('0x3c')](_0x2ce7bf[_0x262b('0x37')],_0x2ce7bf[_0x262b('0x38')]);_0x2aebc7[_0x262b('0x3b')]=_[_0x262b('0x3c')](_0x2ce7bf[_0x262b('0x37')],qs[_0x262b('0x3d')](_0x4a1cf5[_0x262b('0x38')][_0x262b('0x3d')]));_0x2aebc7[_0x262b('0x3b')]=_0x2aebc7['attributes'][_0x262b('0x3e')]?_0x2aebc7['attributes']:_0x2ce7bf[_0x262b('0x37')];_0x2aebc7[_0x262b('0x41')]=qs[_0x262b('0x42')](_0x4a1cf5[_0x262b('0x38')][_0x262b('0x42')]);_0x2aebc7['where']=qs[_0x262b('0x3a')](_[_0x262b('0x5e')](_0x4a1cf5['query'],_0x2ce7bf[_0x262b('0x3a')]));if(_0x4a1cf5[_0x262b('0x38')][_0x262b('0x44')]){_0x2aebc7[_0x262b('0x43')]=_[_0x262b('0x47')](_0x2aebc7['where'],{'$or':_[_0x262b('0x34')](_0x2aebc7[_0x262b('0x3b')],function(_0xb65ede){var _0x4a1a74={};_0x4a1a74[_0xb65ede]={'$like':'%'+_0x4a1cf5[_0x262b('0x38')]['filter']+'%'};return _0x4a1a74;})});}if(_0x4a1cf5['query'][_0x262b('0x64')]){var _0x257dc6=_0x4a1cf5[_0x262b('0x38')]['$gte']['split'](',');var _0x843ba9={};_0x843ba9[_0x257dc6[0x0]]={'$gte':moment(_0x257dc6[0x1])['format'](_0x262b('0x65'))};_0x2aebc7[_0x262b('0x43')]=_[_0x262b('0x47')](_0x2aebc7[_0x262b('0x43')],_0x843ba9);}_0x2aebc7=_['merge']({},_0x2aebc7,_0x4a1cf5[_0x262b('0x50')]);return _0x3ce546[_0x262b('0x62')](_0x2aebc7);}})['then'](function(_0x37cb42){if(_0x37cb42){_0x2e09ee=_0x37cb42[_0x262b('0x3e')];if(!_0x4a1cf5[_0x262b('0x38')][_0x262b('0x3f')](_0x262b('0x40'))){_0x2aebc7['limit']=qs[_0x262b('0x26')](_0x4a1cf5['query'][_0x262b('0x26')]);_0x2aebc7[_0x262b('0x24')]=qs['offset'](_0x4a1cf5[_0x262b('0x38')]['offset']);}return _0x3ce546['getMessages'](_0x2aebc7);}})['then'](function(_0x470cc6){if(_0x470cc6){return _0x470cc6?{'count':_0x2e09ee,'rows':_0x470cc6}:null;}})['then'](respondWithResult(_0x4b1a2f,null))[_0x262b('0x4c')](handleError(_0x4b1a2f,null));}; \ No newline at end of file +var _0x9906=['merge','VIRTUAL','options','ChatGroup','includeAll','include','rows','catch','show','params','keys','fields','find','create','body','destroy','describe','getUnread','toInteger','addMembers','omit','getMembers','User','pick','removeMembers','ids','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x9906,0x1b3));var _0x6990=function(_0x541880,_0x27f2aa){_0x541880=_0x541880-0x0;var _0x2ff9ac=_0x9906[_0x541880];return _0x2ff9ac;};'use strict';var emlformat=require(_0x6990('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6990('0x1'));var jsonpatch=require(_0x6990('0x2'));var rp=require(_0x6990('0x3'));var moment=require(_0x6990('0x4'));var BPromise=require(_0x6990('0x5'));var Mustache=require(_0x6990('0x6'));var util=require(_0x6990('0x7'));var path=require(_0x6990('0x8'));var sox=require(_0x6990('0x9'));var csv=require('to-csv');var ejs=require(_0x6990('0xa'));var fs=require('fs');var fs_extra=require(_0x6990('0xb'));var _=require(_0x6990('0xc'));var squel=require(_0x6990('0xd'));var crypto=require(_0x6990('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6990('0xf'));var toCsv=require(_0x6990('0x10'));var querystring=require(_0x6990('0x11'));var Papa=require(_0x6990('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6990('0x13'));var as=require(_0x6990('0x14'));var hardwareService=require(_0x6990('0x15'));var logger=require(_0x6990('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6990('0x17'));var db=require(_0x6990('0x18'))['db'];config[_0x6990('0x19')]=_['defaults'](config['redis'],{'host':_0x6990('0x1a'),'port':0x18eb});var socket=require(_0x6990('0x1b'))(new Redis(config[_0x6990('0x19')]));require(_0x6990('0x1c'))[_0x6990('0x1d')](socket);function respondWithStatusCode(_0x41016a,_0x5d7296){_0x5d7296=_0x5d7296||0xcc;return function(_0x9e6faf){if(_0x9e6faf){return _0x41016a['sendStatus'](_0x5d7296);}return _0x41016a[_0x6990('0x1e')](_0x5d7296)[_0x6990('0x1f')]();};}function respondWithResult(_0x500b47,_0x4e8999){_0x4e8999=_0x4e8999||0xc8;return function(_0x5e35e9){if(_0x5e35e9){return _0x500b47['status'](_0x4e8999)[_0x6990('0x20')](_0x5e35e9);}};}function respondWithFilteredResult(_0xb2bb00,_0x4bae84){return function(_0x580656){if(_0x580656){var _0x3aac68=typeof _0x4bae84['offset']===_0x6990('0x21')&&typeof _0x4bae84['limit']===_0x6990('0x21');var _0x3c42ef=_0x580656[_0x6990('0x22')];var _0x185f0f=_0x3aac68?0x0:_0x4bae84[_0x6990('0x23')];var _0x55a454=_0x3aac68?_0x580656[_0x6990('0x22')]:_0x4bae84['offset']+_0x4bae84['limit'];var _0x264008;if(_0x55a454>=_0x3c42ef){_0x55a454=_0x3c42ef;_0x264008=0xc8;}else{_0x264008=0xce;}_0xb2bb00[_0x6990('0x1e')](_0x264008);return _0xb2bb00[_0x6990('0x24')](_0x6990('0x25'),_0x185f0f+'-'+_0x55a454+'/'+_0x3c42ef)[_0x6990('0x20')](_0x580656);}return null;};}function patchUpdates(_0x490f31){return function(_0x48163e){try{jsonpatch['apply'](_0x48163e,_0x490f31,!![]);}catch(_0x29b564){return BPromise[_0x6990('0x26')](_0x29b564);}return _0x48163e[_0x6990('0x27')]();};}function saveUpdates(_0x4347df,_0x1402c0){return function(_0x21c456){if(_0x21c456){return _0x21c456[_0x6990('0x28')](_0x4347df)[_0x6990('0x29')](function(_0x4d17ca){return _0x4d17ca;});}return null;};}function removeEntity(_0x308d88,_0xdddf5){return function(_0x19a6ff){if(_0x19a6ff){return _0x19a6ff['destroy']()[_0x6990('0x29')](function(){_0x308d88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x481e57,_0x260f3e){return function(_0x166bb2){if(!_0x166bb2){_0x481e57[_0x6990('0x2a')](0x194);}return _0x166bb2;};}function handleError(_0x47352e,_0x5b0f40){_0x5b0f40=_0x5b0f40||0x1f4;return function(_0x371039){logger['error'](_0x371039[_0x6990('0x2b')]);if(_0x371039[_0x6990('0x2c')]){delete _0x371039[_0x6990('0x2c')];}_0x47352e[_0x6990('0x1e')](_0x5b0f40)[_0x6990('0x2d')](_0x371039);};}exports[_0x6990('0x2e')]=function(_0x4a5212,_0x535945){var _0x43d9fb={},_0x5b5091={},_0x4d2395={'count':0x0,'rows':[]};var _0x77a7f2=_[_0x6990('0x2f')](db['ChatGroup'][_0x6990('0x30')],function(_0x34f8c5){return{'name':_0x34f8c5[_0x6990('0x31')],'type':_0x34f8c5[_0x6990('0x32')][_0x6990('0x33')]};});_0x5b5091[_0x6990('0x34')]=_[_0x6990('0x2f')](_0x77a7f2,_0x6990('0x2c'));_0x5b5091[_0x6990('0x35')]=_['keys'](_0x4a5212[_0x6990('0x35')]);_0x5b5091['filters']=_[_0x6990('0x36')](_0x5b5091['model'],_0x5b5091['query']);_0x43d9fb[_0x6990('0x37')]=_[_0x6990('0x36')](_0x5b5091[_0x6990('0x34')],qs['fields'](_0x4a5212[_0x6990('0x35')]['fields']));_0x43d9fb[_0x6990('0x37')]=_0x43d9fb[_0x6990('0x37')][_0x6990('0x38')]?_0x43d9fb[_0x6990('0x37')]:_0x5b5091[_0x6990('0x34')];if(!_0x4a5212[_0x6990('0x35')][_0x6990('0x39')](_0x6990('0x3a'))){_0x43d9fb[_0x6990('0x3b')]=qs['limit'](_0x4a5212[_0x6990('0x35')]['limit']);_0x43d9fb[_0x6990('0x23')]=qs[_0x6990('0x23')](_0x4a5212[_0x6990('0x35')][_0x6990('0x23')]);}_0x43d9fb[_0x6990('0x3c')]=qs[_0x6990('0x3d')](_0x4a5212['query'][_0x6990('0x3d')]);_0x43d9fb[_0x6990('0x3e')]=qs['filters'](_['pick'](_0x4a5212[_0x6990('0x35')],_0x5b5091[_0x6990('0x3f')]),_0x77a7f2);if(_0x4a5212[_0x6990('0x35')][_0x6990('0x40')]){_0x43d9fb['where']=_[_0x6990('0x41')](_0x43d9fb[_0x6990('0x3e')],{'$or':_[_0x6990('0x2f')](_0x77a7f2,function(_0x321b2e){if(_0x321b2e[_0x6990('0x32')]!==_0x6990('0x42')){var _0x36fe4d={};_0x36fe4d[_0x321b2e[_0x6990('0x2c')]]={'$like':'%'+_0x4a5212[_0x6990('0x35')]['filter']+'%'};return _0x36fe4d;}})});}_0x43d9fb=_[_0x6990('0x41')]({},_0x43d9fb,_0x4a5212[_0x6990('0x43')]);var _0x5b5a61={'where':_0x43d9fb[_0x6990('0x3e')]};return db[_0x6990('0x44')][_0x6990('0x22')](_0x5b5a61)[_0x6990('0x29')](function(_0x37d071){_0x4d2395[_0x6990('0x22')]=_0x37d071;if(_0x4a5212[_0x6990('0x35')][_0x6990('0x45')]){_0x43d9fb[_0x6990('0x46')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x43d9fb);})[_0x6990('0x29')](function(_0x52efab){_0x4d2395[_0x6990('0x47')]=_0x52efab;return _0x4d2395;})['then'](respondWithFilteredResult(_0x535945,_0x43d9fb))[_0x6990('0x48')](handleError(_0x535945,null));};exports[_0x6990('0x49')]=function(_0xae4747,_0x3ad938){var _0x4cddf9={'raw':!![],'where':{'id':_0xae4747[_0x6990('0x4a')]['id']}},_0x2bc71a={};_0x2bc71a['model']=_[_0x6990('0x4b')](db[_0x6990('0x44')][_0x6990('0x30')]);_0x2bc71a[_0x6990('0x35')]=_[_0x6990('0x4b')](_0xae4747[_0x6990('0x35')]);_0x2bc71a[_0x6990('0x3f')]=_['intersection'](_0x2bc71a[_0x6990('0x34')],_0x2bc71a[_0x6990('0x35')]);_0x4cddf9[_0x6990('0x37')]=_['intersection'](_0x2bc71a[_0x6990('0x34')],qs[_0x6990('0x4c')](_0xae4747['query'][_0x6990('0x4c')]));_0x4cddf9[_0x6990('0x37')]=_0x4cddf9[_0x6990('0x37')][_0x6990('0x38')]?_0x4cddf9['attributes']:_0x2bc71a['model'];if(_0xae4747[_0x6990('0x35')]['includeAll']){_0x4cddf9['include']=[{'all':!![]}];}_0x4cddf9=_[_0x6990('0x41')]({},_0x4cddf9,_0xae4747['options']);return db[_0x6990('0x44')][_0x6990('0x4d')](_0x4cddf9)['then'](handleEntityNotFound(_0x3ad938,null))['then'](respondWithResult(_0x3ad938,null))[_0x6990('0x48')](handleError(_0x3ad938,null));};exports[_0x6990('0x4e')]=function(_0x8a22e3,_0x49e268){return db[_0x6990('0x44')][_0x6990('0x4e')](_0x8a22e3[_0x6990('0x4f')],{})[_0x6990('0x29')](respondWithResult(_0x49e268,0xc9))[_0x6990('0x48')](handleError(_0x49e268,null));};exports[_0x6990('0x28')]=function(_0x4ffc87,_0x488b7f){if(_0x4ffc87[_0x6990('0x4f')]['id']){delete _0x4ffc87['body']['id'];}return db[_0x6990('0x44')][_0x6990('0x4d')]({'where':{'id':_0x4ffc87[_0x6990('0x4a')]['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x488b7f,null))['then'](saveUpdates(_0x4ffc87[_0x6990('0x4f')],null))['then'](respondWithResult(_0x488b7f,null))[_0x6990('0x48')](handleError(_0x488b7f,null));};exports[_0x6990('0x50')]=function(_0x4f2ba9,_0x365f2e){return db[_0x6990('0x44')][_0x6990('0x4d')]({'where':{'id':_0x4f2ba9['params']['id']}})['then'](handleEntityNotFound(_0x365f2e,null))['then'](removeEntity(_0x365f2e,null))[_0x6990('0x48')](handleError(_0x365f2e,null));};exports[_0x6990('0x51')]=function(_0x5c3877,_0x183a4e){return db['ChatGroup'][_0x6990('0x51')]()[_0x6990('0x29')](respondWithResult(_0x183a4e,null))[_0x6990('0x48')](handleError(_0x183a4e,null));};exports[_0x6990('0x52')]=function(_0x2d9faa,_0x24b41c,_0x46cf25){return db['ChatInternalMessage'][_0x6990('0x22')]({'where':{'ChatGroupId':_0x2d9faa[_0x6990('0x4a')]['id'],'ToId':_0x2d9faa['user']['id'],'read':![]}})[_0x6990('0x29')](function(_0x5e816a){return{'id':_[_0x6990('0x53')](_0x2d9faa[_0x6990('0x4a')]['id']),'count':_0x5e816a};})['then'](respondWithResult(_0x24b41c,null))[_0x6990('0x48')](handleError(_0x24b41c,null));};exports[_0x6990('0x54')]=function(_0x11ea34,_0x8f7b5a,_0x274c65){return db['ChatGroup'][_0x6990('0x4d')]({'where':{'id':_0x11ea34['params']['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x8f7b5a,null))['then'](function(_0x1528ef){if(_0x1528ef){return _0x1528ef['addMembers'](_0x11ea34['body']['ids'],_[_0x6990('0x55')](_0x11ea34[_0x6990('0x4f')],['ids','id'])||{});}})['then'](respondWithResult(_0x8f7b5a,null))[_0x6990('0x48')](handleError(_0x8f7b5a,null));};exports[_0x6990('0x56')]=function(_0x2fdee,_0x8852a5,_0x3b3e10){var _0x442659={};var _0x67c9c7={};var _0xfc7d6b;var _0x3f7eb9;return db['ChatGroup']['findOne']({'where':{'id':_0x2fdee['params']['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x8852a5,null))[_0x6990('0x29')](function(_0x458e45){if(_0x458e45){_0xfc7d6b=_0x458e45;_0x67c9c7[_0x6990('0x34')]=_['keys'](db[_0x6990('0x57')][_0x6990('0x30')]);_0x67c9c7[_0x6990('0x35')]=_['keys'](_0x2fdee[_0x6990('0x35')]);_0x67c9c7[_0x6990('0x3f')]=_['intersection'](_0x67c9c7['model'],_0x67c9c7['query']);_0x442659[_0x6990('0x37')]=_['intersection'](_0x67c9c7[_0x6990('0x34')],qs[_0x6990('0x4c')](_0x2fdee['query'][_0x6990('0x4c')]));_0x442659['attributes']=_0x442659[_0x6990('0x37')][_0x6990('0x38')]?_0x442659[_0x6990('0x37')]:_0x67c9c7[_0x6990('0x34')];_0x442659[_0x6990('0x3c')]=qs[_0x6990('0x3d')](_0x2fdee[_0x6990('0x35')]['sort']);_0x442659[_0x6990('0x3e')]=qs[_0x6990('0x3f')](_[_0x6990('0x58')](_0x2fdee[_0x6990('0x35')],_0x67c9c7['filters']));if(_0x2fdee[_0x6990('0x35')][_0x6990('0x40')]){_0x442659[_0x6990('0x3e')]=_[_0x6990('0x41')](_0x442659[_0x6990('0x3e')],{'$or':_[_0x6990('0x2f')](_0x442659[_0x6990('0x37')],function(_0x5cf827){var _0x15f470={};_0x15f470[_0x5cf827]={'$like':'%'+_0x2fdee[_0x6990('0x35')][_0x6990('0x40')]+'%'};return _0x15f470;})});}_0x442659=_[_0x6990('0x41')]({},_0x442659,_0x2fdee[_0x6990('0x43')]);return _0xfc7d6b[_0x6990('0x56')](_0x442659);}})['then'](function(_0x530600){if(_0x530600){_0x3f7eb9=_0x530600[_0x6990('0x38')];if(!_0x2fdee[_0x6990('0x35')]['hasOwnProperty']('nolimit')){_0x442659[_0x6990('0x3b')]=qs[_0x6990('0x3b')](_0x2fdee[_0x6990('0x35')][_0x6990('0x3b')]);_0x442659[_0x6990('0x23')]=qs[_0x6990('0x23')](_0x2fdee[_0x6990('0x35')][_0x6990('0x23')]);}return _0xfc7d6b['getMembers'](_0x442659);}})['then'](function(_0x42522b){if(_0x42522b){return _0x42522b?{'count':_0x3f7eb9,'rows':_0x42522b}:null;}})['then'](respondWithResult(_0x8852a5,null))[_0x6990('0x48')](handleError(_0x8852a5,null));};exports[_0x6990('0x59')]=function(_0x53a104,_0x939b84,_0x36b70e){return db[_0x6990('0x44')][_0x6990('0x4d')]({'where':{'id':_0x53a104[_0x6990('0x4a')]['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x939b84,null))[_0x6990('0x29')](function(_0x316156){if(_0x316156){return _0x316156[_0x6990('0x59')](_0x53a104[_0x6990('0x35')][_0x6990('0x5a')]);}})[_0x6990('0x29')](respondWithStatusCode(_0x939b84,null))[_0x6990('0x48')](handleError(_0x939b84,null));};exports[_0x6990('0x5b')]=function(_0xea3295,_0x2459e3,_0x487785){if(_0xea3295['body']['id']){delete _0xea3295[_0x6990('0x4f')]['id'];}return db[_0x6990('0x44')][_0x6990('0x4d')]({'where':{'id':_0xea3295[_0x6990('0x4a')]['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x2459e3,null))['then'](function(_0x475925){if(_0x475925){_0xea3295[_0x6990('0x4f')][_0x6990('0x5c')]=_0x475925['id'];return db[_0x6990('0x5d')]['create'](_0xea3295[_0x6990('0x4f')]);}})[_0x6990('0x29')](respondWithResult(_0x2459e3,null))['catch'](handleError(_0x2459e3,null));};exports[_0x6990('0x5e')]=function(_0x4deb3e,_0x481508,_0x3db33d){var _0x32ac39={};var _0xb912ab={};var _0x118ad2;var _0x359729;return db[_0x6990('0x44')][_0x6990('0x5f')]({'where':{'id':_0x4deb3e[_0x6990('0x4a')]['id']}})[_0x6990('0x29')](handleEntityNotFound(_0x481508,null))[_0x6990('0x29')](function(_0x3424fc){if(_0x3424fc){_0x118ad2=_0x3424fc;_0xb912ab[_0x6990('0x34')]=_[_0x6990('0x4b')](db['ChatInternalMessage'][_0x6990('0x30')]);_0xb912ab[_0x6990('0x35')]=_[_0x6990('0x4b')](_0x4deb3e[_0x6990('0x35')]);_0xb912ab[_0x6990('0x3f')]=_[_0x6990('0x36')](_0xb912ab[_0x6990('0x34')],_0xb912ab[_0x6990('0x35')]);_0x32ac39[_0x6990('0x37')]=_[_0x6990('0x36')](_0xb912ab[_0x6990('0x34')],qs[_0x6990('0x4c')](_0x4deb3e[_0x6990('0x35')]['fields']));_0x32ac39['attributes']=_0x32ac39[_0x6990('0x37')][_0x6990('0x38')]?_0x32ac39[_0x6990('0x37')]:_0xb912ab[_0x6990('0x34')];_0x32ac39[_0x6990('0x3c')]=qs[_0x6990('0x3d')](_0x4deb3e['query'][_0x6990('0x3d')]);_0x32ac39[_0x6990('0x3e')]=qs['filters'](_[_0x6990('0x58')](_0x4deb3e[_0x6990('0x35')],_0xb912ab[_0x6990('0x3f')]));if(_0x4deb3e[_0x6990('0x35')][_0x6990('0x40')]){_0x32ac39[_0x6990('0x3e')]=_[_0x6990('0x41')](_0x32ac39[_0x6990('0x3e')],{'$or':_[_0x6990('0x2f')](_0x32ac39[_0x6990('0x37')],function(_0x2802da){var _0x6ad376={};_0x6ad376[_0x2802da]={'$like':'%'+_0x4deb3e[_0x6990('0x35')][_0x6990('0x40')]+'%'};return _0x6ad376;})});}if(_0x4deb3e['query'][_0x6990('0x60')]){var _0x30c134=_0x4deb3e['query']['$gte'][_0x6990('0x61')](',');var _0x3085bd={};_0x3085bd[_0x30c134[0x0]]={'$gte':moment(_0x30c134[0x1])[_0x6990('0x62')](_0x6990('0x63'))};_0x32ac39[_0x6990('0x3e')]=_[_0x6990('0x41')](_0x32ac39['where'],_0x3085bd);}_0x32ac39=_[_0x6990('0x41')]({},_0x32ac39,_0x4deb3e['options']);return _0x118ad2[_0x6990('0x5e')](_0x32ac39);}})['then'](function(_0x494bd3){if(_0x494bd3){_0x359729=_0x494bd3[_0x6990('0x38')];if(!_0x4deb3e['query'][_0x6990('0x39')](_0x6990('0x3a'))){_0x32ac39[_0x6990('0x3b')]=qs[_0x6990('0x3b')](_0x4deb3e[_0x6990('0x35')][_0x6990('0x3b')]);_0x32ac39[_0x6990('0x23')]=qs['offset'](_0x4deb3e[_0x6990('0x35')][_0x6990('0x23')]);}return _0x118ad2[_0x6990('0x5e')](_0x32ac39);}})[_0x6990('0x29')](function(_0x3a6fb9){if(_0x3a6fb9){return _0x3a6fb9?{'count':_0x359729,'rows':_0x3a6fb9}:null;}})[_0x6990('0x29')](respondWithResult(_0x481508,null))[_0x6990('0x48')](handleError(_0x481508,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 87b3e22..b62b227 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 _0x161c=['exports','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0x161c,0xb7));var _0xc161=function(_0x546905,_0x274c65){_0x546905=_0x546905-0x0;var _0x1b670e=_0x161c[_0x546905];return _0x1b670e;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xc161('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc161('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc161('0x2'),'afterDestroy':'remove'};function emitEvent(_0x336a55){return function(_0x2d9ae2,_0x4653a3,_0xa9e9ef){ChatGroupEvents[_0xc161('0x3')](_0x336a55+':'+_0x2d9ae2['id'],_0x2d9ae2);ChatGroupEvents[_0xc161('0x3')](_0x336a55,_0x2d9ae2);_0xa9e9ef(null);};}for(var e in events){if(events[_0xc161('0x4')](e)){var event=events[e];ChatGroup[_0xc161('0x5')](e,emitEvent(event));}}module[_0xc161('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x4c50=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x34528f,_0x540ca4){var _0x11861b=function(_0x26233f){while(--_0x26233f){_0x34528f['push'](_0x34528f['shift']());}};_0x11861b(++_0x540ca4);}(_0x4c50,0x10f));var _0x04c5=function(_0x33f820,_0x2587c2){_0x33f820=_0x33f820-0x0;var _0x378b18=_0x4c50[_0x33f820];return _0x378b18;};'use strict';var EventEmitter=require(_0x04c5('0x0'));var ChatGroup=require(_0x04c5('0x1'))['db'][_0x04c5('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x04c5('0x3')](0x0);var events={'afterCreate':_0x04c5('0x4'),'afterUpdate':_0x04c5('0x5'),'afterDestroy':_0x04c5('0x6')};function emitEvent(_0x5a0501){return function(_0x4fd529,_0x1ae103,_0x1d623d){ChatGroupEvents['emit'](_0x5a0501+':'+_0x4fd529['id'],_0x4fd529);ChatGroupEvents[_0x04c5('0x7')](_0x5a0501,_0x4fd529);_0x1d623d(null);};}for(var e in events){if(events[_0x04c5('0x8')](e)){var event=events[e];ChatGroup[_0x04c5('0x9')](e,emitEvent(event));}}module[_0x04c5('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index f2f3db0..c0fa63d 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 _0x4ce6=['./chatGroup.attributes','exports','lodash','api','request-promise','rimraf','../../config/environment'];(function(_0x17c027,_0x5294a5){var _0xc669b9=function(_0x5e4095){while(--_0x5e4095){_0x17c027['push'](_0x17c027['shift']());}};_0xc669b9(++_0x5294a5);}(_0x4ce6,0xb8));var _0x64ce=function(_0x373096,_0x4d37aa){_0x373096=_0x373096-0x0;var _0x14a6d0=_0x4ce6[_0x373096];return _0x14a6d0;};'use strict';var _=require(_0x64ce('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x64ce('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64ce('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64ce('0x3'));var config=require(_0x64ce('0x4'));var attributes=require(_0x64ce('0x5'));module[_0x64ce('0x6')]=function(_0x520e5a,_0x3b34ef){return _0x520e5a['define']('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b8f=['util','../../config/logger','bluebird','path','rimraf','./chatGroup.attributes','exports','define','chat_groups','lodash'];(function(_0xfd5475,_0x59217c){var _0x599901=function(_0x5271f1){while(--_0x5271f1){_0xfd5475['push'](_0xfd5475['shift']());}};_0x599901(++_0x59217c);}(_0x1b8f,0xb3));var _0xf1b8=function(_0xa83fe4,_0x5841ca){_0xa83fe4=_0xa83fe4-0x0;var _0x4804da=_0x1b8f[_0xa83fe4];return _0x4804da;};'use strict';var _=require(_0xf1b8('0x0'));var util=require(_0xf1b8('0x1'));var logger=require(_0xf1b8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf1b8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1b8('0x4'));var rimraf=require(_0xf1b8('0x5'));var config=require('../../config/environment');var attributes=require(_0xf1b8('0x6'));module[_0xf1b8('0x7')]=function(_0x5a4289,_0x5efc4a){return _0x5a4289[_0xf1b8('0x8')]('ChatGroup',attributes,{'tableName':_0xf1b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index ba5c38e..8b3e2e4 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 _0xc992=['http','redis','defaults','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','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xc992,0xbb));var _0x2c99=function(_0x33a734,_0x366b6d){_0x33a734=_0x33a734-0x0;var _0x49fd9b=_0xc992[_0x33a734];return _0x49fd9b;};'use strict';var _=require(_0x2c99('0x0'));var util=require('util');var moment=require(_0x2c99('0x1'));var BPromise=require(_0x2c99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c99('0x3'));var db=require(_0x2c99('0x4'))['db'];var utils=require(_0x2c99('0x5'));var logger=require('../../config/logger')(_0x2c99('0x6'));var config=require('../../config/environment');var jayson=require(_0x2c99('0x7'));var client=jayson[_0x2c99('0x8')][_0x2c99('0x9')]({'port':0x232a});config[_0x2c99('0xa')]=_[_0x2c99('0xb')](config[_0x2c99('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c99('0xc'))(new Redis(config[_0x2c99('0xa')]));require(_0x2c99('0xd'))[_0x2c99('0xe')](socket);function respondWithRpcPromise(_0x4d4aca,_0x16c86c,_0x2ab06c){return new BPromise(function(_0x4e2e75,_0x4ada30){return client[_0x2c99('0xf')](_0x4d4aca,_0x2ab06c)[_0x2c99('0x10')](function(_0x4948b4){logger[_0x2c99('0x11')](_0x2c99('0x12'),_0x16c86c,_0x2c99('0x13'));logger[_0x2c99('0x14')](_0x2c99('0x15'),_0x16c86c,_0x2c99('0x13'),JSON[_0x2c99('0x16')](_0x4948b4));if(_0x4948b4[_0x2c99('0x17')]){if(_0x4948b4[_0x2c99('0x17')][_0x2c99('0x18')]===0x1f4){logger[_0x2c99('0x17')](_0x2c99('0x12'),_0x16c86c,_0x4948b4['error'][_0x2c99('0x19')]);return _0x4ada30(_0x4948b4[_0x2c99('0x17')][_0x2c99('0x19')]);}logger[_0x2c99('0x17')](_0x2c99('0x12'),_0x16c86c,_0x4948b4[_0x2c99('0x17')][_0x2c99('0x19')]);return _0x4e2e75(_0x4948b4['error'][_0x2c99('0x19')]);}else{logger[_0x2c99('0x11')](_0x2c99('0x12'),_0x16c86c,_0x2c99('0x13'));_0x4e2e75(_0x4948b4[_0x2c99('0x1a')][_0x2c99('0x19')]);}})[_0x2c99('0x1b')](function(_0x1e5846){logger['error']('ChatGroup,\x20%s,\x20%s',_0x16c86c,_0x1e5846);_0x4ada30(_0x1e5846);});});} \ No newline at end of file +var _0x72b1=['error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4488e2,_0x41ac44){var _0x37f4be=function(_0x424dc7){while(--_0x424dc7){_0x4488e2['push'](_0x4488e2['shift']());}};_0x37f4be(++_0x41ac44);}(_0x72b1,0x16e));var _0x172b=function(_0x47f356,_0x2974b9){_0x47f356=_0x47f356-0x0;var _0x26c706=_0x72b1[_0x47f356];return _0x26c706;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var moment=require(_0x172b('0x1'));var BPromise=require(_0x172b('0x2'));var rs=require(_0x172b('0x3'));var fs=require('fs');var Redis=require(_0x172b('0x4'));var db=require(_0x172b('0x5'))['db'];var utils=require(_0x172b('0x6'));var logger=require(_0x172b('0x7'))('rpc');var config=require(_0x172b('0x8'));var jayson=require(_0x172b('0x9'));var client=jayson[_0x172b('0xa')][_0x172b('0xb')]({'port':0x232a});config['redis']=_[_0x172b('0xc')](config['redis'],{'host':_0x172b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x172b('0xe')]));require(_0x172b('0xf'))[_0x172b('0x10')](socket);function respondWithRpcPromise(_0x392f1e,_0x50e58a,_0x3b6daf){return new BPromise(function(_0x375bde,_0x28aaad){return client[_0x172b('0x11')](_0x392f1e,_0x3b6daf)[_0x172b('0x12')](function(_0x131762){logger[_0x172b('0x13')]('ChatGroup,\x20%s,\x20%s',_0x50e58a,_0x172b('0x14'));logger[_0x172b('0x15')](_0x172b('0x16'),_0x50e58a,'request\x20sent',JSON[_0x172b('0x17')](_0x131762));if(_0x131762['error']){if(_0x131762[_0x172b('0x18')][_0x172b('0x19')]===0x1f4){logger['error'](_0x172b('0x1a'),_0x50e58a,_0x131762[_0x172b('0x18')][_0x172b('0x1b')]);return _0x28aaad(_0x131762[_0x172b('0x18')]['message']);}logger['error'](_0x172b('0x1a'),_0x50e58a,_0x131762[_0x172b('0x18')][_0x172b('0x1b')]);return _0x375bde(_0x131762[_0x172b('0x18')]['message']);}else{logger['info'](_0x172b('0x1a'),_0x50e58a,_0x172b('0x14'));_0x375bde(_0x131762[_0x172b('0x1c')][_0x172b('0x1b')]);}})[_0x172b('0x1d')](function(_0x4e7cb9){logger[_0x172b('0x18')](_0x172b('0x1a'),_0x50e58a,_0x4e7cb9);_0x28aaad(_0x4e7cb9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 75bd01f..36102e7 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 _0x9abd=['update','emit','removeListener','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x2f2cb8,_0x417d38){var _0x5a7add=function(_0xc1da1d){while(--_0xc1da1d){_0x2f2cb8['push'](_0x2f2cb8['shift']());}};_0x5a7add(++_0x417d38);}(_0x9abd,0xa5));var _0xd9ab=function(_0x1c0b19,_0x18296a){_0x1c0b19=_0x1c0b19-0x0;var _0x5eb9cc=_0x9abd[_0x1c0b19];return _0x5eb9cc;};'use strict';var ChatGroupEvents=require(_0xd9ab('0x0'));var events=[_0xd9ab('0x1'),_0xd9ab('0x2'),_0xd9ab('0x3')];function createListener(_0xd9d54b,_0x25172a){return function(_0x2edbed){_0x25172a[_0xd9ab('0x4')](_0xd9d54b,_0x2edbed);};}function removeListener(_0x28cd74,_0x19c713){return function(){ChatGroupEvents[_0xd9ab('0x5')](_0x28cd74,_0x19c713);};}exports['register']=function(_0x344ab5){for(var _0x590617=0x0,_0x54115a=events[_0xd9ab('0x6')];_0x590617<_0x54115a;_0x590617++){var _0x20751e=events[_0x590617];var _0xf3fc51=createListener(_0xd9ab('0x7')+_0x20751e,_0x344ab5);ChatGroupEvents['on'](_0x20751e,_0xf3fc51);}}; \ No newline at end of file +var _0x991a=['./chatGroup.events','save','update','removeListener','length','chatGroup:'];(function(_0x23bcf2,_0x1c6764){var _0x16dff4=function(_0x585464){while(--_0x585464){_0x23bcf2['push'](_0x23bcf2['shift']());}};_0x16dff4(++_0x1c6764);}(_0x991a,0x1ec));var _0xa991=function(_0x5733d6,_0x3fede9){_0x5733d6=_0x5733d6-0x0;var _0x5b4755=_0x991a[_0x5733d6];return _0x5b4755;};'use strict';var ChatGroupEvents=require(_0xa991('0x0'));var events=[_0xa991('0x1'),'remove',_0xa991('0x2')];function createListener(_0x45f6ed,_0x3d9e39){return function(_0x3991fd){_0x3d9e39['emit'](_0x45f6ed,_0x3991fd);};}function removeListener(_0x37a5b0,_0x5e723a){return function(){ChatGroupEvents[_0xa991('0x3')](_0x37a5b0,_0x5e723a);};}exports['register']=function(_0x57ecc5){for(var _0x36842f=0x0,_0x50d2cb=events[_0xa991('0x4')];_0x36842f<_0x50d2cb;_0x36842f++){var _0x3e1972=events[_0x36842f];var _0x13bd2a=createListener(_0xa991('0x5')+_0x3e1972,_0x57ecc5);ChatGroupEvents['on'](_0x3e1972,_0x13bd2a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 3393d66..bcfcdce 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 _0xd9a9=['./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2fa5ba,_0x4a70a1){var _0x38aa4b=function(_0xf2ab76){while(--_0xf2ab76){_0x2fa5ba['push'](_0x2fa5ba['shift']());}};_0x38aa4b(++_0x4a70a1);}(_0xd9a9,0x15f));var _0x9d9a=function(_0x553caf,_0x363347){_0x553caf=_0x553caf-0x0;var _0x59b8b1=_0xd9a9[_0x553caf];return _0x59b8b1;};'use strict';var multer=require(_0x9d9a('0x0'));var util=require(_0x9d9a('0x1'));var path=require(_0x9d9a('0x2'));var timeout=require(_0x9d9a('0x3'));var express=require(_0x9d9a('0x4'));var router=express['Router']();var fs_extra=require(_0x9d9a('0x5'));var auth=require(_0x9d9a('0x6'));var interaction=require(_0x9d9a('0x7'));var config=require(_0x9d9a('0x8'));var controller=require(_0x9d9a('0x9'));router[_0x9d9a('0xa')]('/',auth[_0x9d9a('0xb')](),controller['index']);router[_0x9d9a('0xa')](_0x9d9a('0xc'),auth[_0x9d9a('0xb')](),controller[_0x9d9a('0xd')]);router[_0x9d9a('0xa')](_0x9d9a('0xe'),auth['isAuthenticated'](),controller[_0x9d9a('0xf')]);router[_0x9d9a('0xa')](_0x9d9a('0x10'),auth['isAuthenticated'](),controller[_0x9d9a('0x11')]);router[_0x9d9a('0xa')](_0x9d9a('0x12'),auth[_0x9d9a('0xb')](),controller['getMembers']);router[_0x9d9a('0xa')](_0x9d9a('0x13'),auth[_0x9d9a('0xb')](),controller[_0x9d9a('0x14')]);router[_0x9d9a('0x15')]('/',auth[_0x9d9a('0xb')](),controller[_0x9d9a('0x16')]);router[_0x9d9a('0x15')]('/:id/members',auth[_0x9d9a('0xb')](),controller[_0x9d9a('0x17')]);router[_0x9d9a('0x15')](_0x9d9a('0x13'),auth[_0x9d9a('0xb')](),controller[_0x9d9a('0x18')]);router[_0x9d9a('0x19')](_0x9d9a('0xe'),auth[_0x9d9a('0xb')](),controller[_0x9d9a('0x1a')]);router[_0x9d9a('0x1b')]('/:id',auth[_0x9d9a('0xb')](),controller[_0x9d9a('0x1c')]);router[_0x9d9a('0x1b')](_0x9d9a('0x12'),auth[_0x9d9a('0xb')](),controller['removeMembers']);module[_0x9d9a('0x1d')]=router; \ No newline at end of file +var _0x995f=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','/:id','update','destroy','delete','removeMembers'];(function(_0x7748a6,_0x450b0f){var _0x2aa04c=function(_0x532ed3){while(--_0x532ed3){_0x7748a6['push'](_0x7748a6['shift']());}};_0x2aa04c(++_0x450b0f);}(_0x995f,0x1e1));var _0xf995=function(_0x4b0c3e,_0x50754a){_0x4b0c3e=_0x4b0c3e-0x0;var _0xa99d4e=_0x995f[_0x4b0c3e];return _0xa99d4e;};'use strict';var multer=require(_0xf995('0x0'));var util=require(_0xf995('0x1'));var path=require(_0xf995('0x2'));var timeout=require(_0xf995('0x3'));var express=require(_0xf995('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf995('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf995('0x6'));var controller=require(_0xf995('0x7'));router['get']('/',auth[_0xf995('0x8')](),controller[_0xf995('0x9')]);router[_0xf995('0xa')](_0xf995('0xb'),auth['isAuthenticated'](),controller[_0xf995('0xc')]);router[_0xf995('0xa')]('/:id',auth[_0xf995('0x8')](),controller[_0xf995('0xd')]);router[_0xf995('0xa')](_0xf995('0xe'),auth[_0xf995('0x8')](),controller[_0xf995('0xf')]);router[_0xf995('0xa')](_0xf995('0x10'),auth[_0xf995('0x8')](),controller[_0xf995('0x11')]);router['get'](_0xf995('0x12'),auth[_0xf995('0x8')](),controller[_0xf995('0x13')]);router[_0xf995('0x14')]('/',auth[_0xf995('0x8')](),controller[_0xf995('0x15')]);router[_0xf995('0x14')](_0xf995('0x10'),auth[_0xf995('0x8')](),controller['addMembers']);router['post'](_0xf995('0x12'),auth['isAuthenticated'](),controller[_0xf995('0x16')]);router[_0xf995('0x17')](_0xf995('0x18'),auth[_0xf995('0x8')](),controller[_0xf995('0x19')]);router['delete'](_0xf995('0x18'),auth['isAuthenticated'](),controller[_0xf995('0x1a')]);router[_0xf995('0x1b')](_0xf995('0x10'),auth[_0xf995('0x8')](),controller[_0xf995('0x1c')]);module[_0xf995('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 05d8e58..d813647 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 _0x065e=['sequelize','ENUM','star','thumb','TEXT','STRING','long','DATE','BOOLEAN'];(function(_0x25d6ce,_0x30d64a){var _0x1aef15=function(_0x13aa4f){while(--_0x13aa4f){_0x25d6ce['push'](_0x25d6ce['shift']());}};_0x1aef15(++_0x30d64a);}(_0x065e,0x1a7));var _0xe065=function(_0x26a2b4,_0x506a13){_0x26a2b4=_0x26a2b4-0x0;var _0x4b1414=_0x065e[_0x26a2b4];return _0x4b1414;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xe065('0x1')](_0xe065('0x2'),_0xe065('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xe065('0x4')]},'mailTranscript':{'type':Sequelize[_0xe065('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe065('0x5')]},'secondDisposition':{'type':Sequelize[_0xe065('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe065('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xe065('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xe065('0x5')]},'osVersion':{'type':Sequelize[_0xe065('0x5')]},'deviceModel':{'type':Sequelize[_0xe065('0x5')]},'deviceVendor':{'type':Sequelize[_0xe065('0x5')]},'deviceType':{'type':Sequelize[_0xe065('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xe065('0x5')]},'formData':{'type':Sequelize[_0xe065('0x4')](_0xe065('0x6'))},'read1stAt':{'type':Sequelize[_0xe065('0x7')]},'lastMsgAt':{'type':Sequelize[_0xe065('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xe065('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xe065('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xe065('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xe065('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x9ffd=['TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x90aafe,_0x54198f){var _0x4f486c=function(_0xb647af){while(--_0xb647af){_0x90aafe['push'](_0x90aafe['shift']());}};_0x4f486c(++_0x54198f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x7847b9,_0x188e55){_0x7847b9=_0x7847b9-0x0;var _0x59082c=_0x9ffd[_0x7847b9];return _0x59082c;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'closed':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xd9ff('0x3')](_0xd9ff('0x4'),_0xd9ff('0x5')),'defaultValue':_0xd9ff('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd9ff('0x6')]},'mailTranscript':{'type':Sequelize[_0xd9ff('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd9ff('0x7')]},'secondDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'thirdDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'note':{'type':Sequelize[_0xd9ff('0x7')]},'browserName':{'type':Sequelize[_0xd9ff('0x7')]},'browserVersion':{'type':Sequelize[_0xd9ff('0x7')]},'osName':{'type':Sequelize[_0xd9ff('0x7')]},'osVersion':{'type':Sequelize[_0xd9ff('0x7')]},'deviceModel':{'type':Sequelize[_0xd9ff('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd9ff('0x6')](_0xd9ff('0x8'))},'read1stAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xd9ff('0x3')]('in',_0xd9ff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd9ff('0x7')]},'customerPort':{'type':Sequelize[_0xd9ff('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 07cfdb4..e81c5f4 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 _0xdb0b=['then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','stack','name','send','render','body','agent','interaction','account','index','map','rawAttributes','type','key','getOptions','query','user','show','params','keys','filters','intersection','model','attributes','fields','length','include','merge','ChatInteraction','find','create','destroy','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','isNull','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','file','originalname','basename','filename','mimetype','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','format','%s%d','customer','agentIdentifier','agentAlias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','omit','getMessages','hasOwnProperty','order','sort','pick','where','filter','$gte','includeAll','rows','nolimit','includeAgent','setTags','ids','spread','Tag','findAll','color','emit','chatInteractionTags:save','server','files','tmp','attachments','transcript-%d-%s.zip','push','createdAt','read','Owner','get','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xdb0b,0xb4));var _0xbdb0=function(_0x3f791d,_0x217301){_0x3f791d=_0x3f791d-0x0;var _0x3f4bf5=_0xdb0b[_0x3f791d];return _0x3f4bf5;};'use strict';var rimraf=require(_0xbdb0('0x0'));var zipdir=require(_0xbdb0('0x1'));var rp=require(_0xbdb0('0x2'));var moment=require(_0xbdb0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbdb0('0x4'));var util=require('util');var path=require(_0xbdb0('0x5'));var ejs=require(_0xbdb0('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xbdb0('0x7'));var interaction=require(_0xbdb0('0x8'));var qs=require(_0xbdb0('0x9'));var pdf=require(_0xbdb0('0xa'));var logger=require(_0xbdb0('0xb'))(_0xbdb0('0xc'));var config=require('../../config/environment');var db=require(_0xbdb0('0xd'))['db'];config['redis']=_['defaults'](config[_0xbdb0('0xe')],{'host':_0xbdb0('0xf'),'port':0x18eb});var socket=require(_0xbdb0('0x10'))(new Redis(config[_0xbdb0('0xe')]));require(_0xbdb0('0x11'))[_0xbdb0('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbdb0('0x13')][_0xbdb0('0x14')]({'port':0x232b});var client9004=jayson[_0xbdb0('0x13')][_0xbdb0('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x19de7f,_0xd171f0,_0x3dd412,_0x5a3263){return new BPromise(function(_0x4e95db,_0x526a70){var _0x2da608=_0x5a3263||client;return _0x2da608[_0xbdb0('0x15')](_0x19de7f,_0x3dd412)[_0xbdb0('0x16')](function(_0x231120){logger[_0xbdb0('0x17')](_0xbdb0('0x18'),_0xd171f0,_0xbdb0('0x19'));logger[_0xbdb0('0x1a')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd171f0,_0xbdb0('0x19'),JSON['stringify'](_0x231120));if(_0x231120[_0xbdb0('0x1b')]){if(_0x231120[_0xbdb0('0x1b')][_0xbdb0('0x1c')]===0x1f4){logger[_0xbdb0('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0xd171f0,_0x231120[_0xbdb0('0x1b')]['message']);return _0x526a70(_0x231120[_0xbdb0('0x1b')]['message']);}logger[_0xbdb0('0x1b')](_0xbdb0('0x18'),_0xd171f0,_0x231120[_0xbdb0('0x1b')]['message']);return _0x4e95db(_0x231120[_0xbdb0('0x1b')][_0xbdb0('0x1d')]);}else{logger['info'](_0xbdb0('0x18'),_0xd171f0,'request\x20sent');_0x4e95db(_0x231120['result'][_0xbdb0('0x1d')]);}})[_0xbdb0('0x1e')](function(_0x28301e){logger['error'](_0xbdb0('0x18'),_0xd171f0,_0x28301e);_0x526a70(_0x28301e);});});}function respondWithStatusCode(_0xf190ba,_0x622ec3){_0x622ec3=_0x622ec3||0xcc;return function(_0x19113e){if(_0x19113e){return _0xf190ba['sendStatus'](_0x622ec3);}return _0xf190ba[_0xbdb0('0x1f')](_0x622ec3)[_0xbdb0('0x20')]();};}function respondWithResult(_0x46f913,_0x4593aa){_0x4593aa=_0x4593aa||0xc8;return function(_0x4688e){if(_0x4688e){return _0x46f913[_0xbdb0('0x1f')](_0x4593aa)[_0xbdb0('0x21')](_0x4688e);}};}function respondWithFilteredResult(_0x402955,_0x157ada){return function(_0x26fa9e){if(_0x26fa9e){var _0x54b18e=typeof _0x157ada[_0xbdb0('0x22')]===_0xbdb0('0x23')&&typeof _0x157ada[_0xbdb0('0x24')]===_0xbdb0('0x23');var _0x49e7a6=_0x26fa9e['count'];var _0x248a81=_0x54b18e?0x0:_0x157ada[_0xbdb0('0x22')];var _0x48e4f9=_0x54b18e?_0x26fa9e[_0xbdb0('0x25')]:_0x157ada[_0xbdb0('0x22')]+_0x157ada[_0xbdb0('0x24')];var _0x5cea3c;if(_0x48e4f9>=_0x49e7a6){_0x48e4f9=_0x49e7a6;_0x5cea3c=0xc8;}else{_0x5cea3c=0xce;}_0x402955[_0xbdb0('0x1f')](_0x5cea3c);return _0x402955[_0xbdb0('0x26')](_0xbdb0('0x27'),_0x248a81+'-'+_0x48e4f9+'/'+_0x49e7a6)[_0xbdb0('0x21')](_0x26fa9e);}return null;};}function saveUpdates(_0x2c7a80){return function(_0x591e44){if(_0x591e44){return _0x591e44[_0xbdb0('0x28')](_0x2c7a80)[_0xbdb0('0x16')](function(_0x3947e0){return _0x3947e0;});}return null;};}function removeEntity(_0x14e41d){return function(_0x4085ba){if(_0x4085ba){return _0x4085ba['destroy']()[_0xbdb0('0x16')](function(){_0x14e41d[_0xbdb0('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b8f2c){return function(_0x503c76){if(!_0x503c76){_0x5b8f2c[_0xbdb0('0x29')](0x194);}return _0x503c76;};}function handleError(_0x45cc8f,_0x24ef18){_0x24ef18=_0x24ef18||0x1f4;return function(_0xea5cd2){logger[_0xbdb0('0x1b')](_0xea5cd2[_0xbdb0('0x2a')]);if(_0xea5cd2[_0xbdb0('0x2b')]){delete _0xea5cd2[_0xbdb0('0x2b')];}_0x45cc8f['status'](_0x24ef18)[_0xbdb0('0x2c')](_0xea5cd2);};}function getMustacheRender(_0x29c7d0,_0x120148){return Mustache[_0xbdb0('0x2d')](_0x29c7d0,_['merge'](_0x120148[_0xbdb0('0x2e')],{'contact':_0x120148['contact'],'message':_0x120148[_0xbdb0('0x1d')],'agent':_0x120148[_0xbdb0('0x2f')],'interaction':_0x120148[_0xbdb0('0x30')],'account':_0x120148[_0xbdb0('0x31')]}))||'';}exports[_0xbdb0('0x32')]=function(_0x1e2c59,_0x1eaec6){var _0x58f215={};var _0x440cc3=_[_0xbdb0('0x33')](db['ChatInteraction'][_0xbdb0('0x34')],function(_0x1bce9e){return{'name':_0x1bce9e['fieldName'],'type':_0x1bce9e[_0xbdb0('0x35')][_0xbdb0('0x36')]};});_0x58f215=qs[_0xbdb0('0x37')](_0x440cc3,_0x1e2c59);return interaction['findAll']('chat',_0x1e2c59[_0xbdb0('0x38')],_0x1e2c59[_0xbdb0('0x39')],_0x58f215,_0x440cc3)[_0xbdb0('0x16')](respondWithFilteredResult(_0x1eaec6,_0x58f215))[_0xbdb0('0x1e')](handleError(_0x1eaec6,null));};exports[_0xbdb0('0x3a')]=function(_0x2d8ddf,_0x3300c3){var _0x51e06f={'raw':![],'where':{'id':_0x2d8ddf[_0xbdb0('0x3b')]['id']}},_0x519a4e={};_0x519a4e['model']=_[_0xbdb0('0x3c')](db['ChatInteraction'][_0xbdb0('0x34')]);_0x519a4e[_0xbdb0('0x38')]=_['keys'](_0x2d8ddf[_0xbdb0('0x38')]);_0x519a4e[_0xbdb0('0x3d')]=_[_0xbdb0('0x3e')](_0x519a4e[_0xbdb0('0x3f')],_0x519a4e[_0xbdb0('0x38')]);_0x51e06f[_0xbdb0('0x40')]=_[_0xbdb0('0x3e')](_0x519a4e['model'],qs[_0xbdb0('0x41')](_0x2d8ddf[_0xbdb0('0x38')][_0xbdb0('0x41')]));_0x51e06f[_0xbdb0('0x40')]=_0x51e06f[_0xbdb0('0x40')][_0xbdb0('0x42')]?_0x51e06f[_0xbdb0('0x40')]:_0x519a4e['model'];if(_0x2d8ddf[_0xbdb0('0x38')]['includeAll']){_0x51e06f[_0xbdb0('0x43')]=[{'all':!![]}];}_0x51e06f=_[_0xbdb0('0x44')]({},_0x51e06f,_0x2d8ddf['options']);return db[_0xbdb0('0x45')][_0xbdb0('0x46')](_0x51e06f)['then'](handleEntityNotFound(_0x3300c3,null))[_0xbdb0('0x16')](respondWithResult(_0x3300c3,null))[_0xbdb0('0x1e')](handleError(_0x3300c3,null));};exports[_0xbdb0('0x47')]=function(_0x50f7aa,_0x2baf06){return db['ChatInteraction'][_0xbdb0('0x47')](_0x50f7aa[_0xbdb0('0x2e')],{})[_0xbdb0('0x16')](respondWithResult(_0x2baf06,0xc9))[_0xbdb0('0x1e')](handleError(_0x2baf06,null));};exports[_0xbdb0('0x28')]=function(_0x4d2959,_0x2de707){if(_0x4d2959['body']['id']){delete _0x4d2959[_0xbdb0('0x2e')]['id'];}return db['ChatInteraction'][_0xbdb0('0x46')]({'where':{'id':_0x4d2959[_0xbdb0('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2de707,null))['then'](saveUpdates(_0x4d2959[_0xbdb0('0x2e')],null))[_0xbdb0('0x16')](respondWithResult(_0x2de707,null))['catch'](handleError(_0x2de707,null));};exports[_0xbdb0('0x48')]=function(_0x2e1d8c,_0x1e1986){return db[_0xbdb0('0x45')][_0xbdb0('0x46')]({'where':{'id':_0x2e1d8c['params']['id']}})[_0xbdb0('0x16')](handleEntityNotFound(_0x1e1986,null))[_0xbdb0('0x16')](removeEntity(_0x1e1986,null))[_0xbdb0('0x1e')](handleError(_0x1e1986,null));};exports[_0xbdb0('0x49')]=function(_0x2e78a8,_0x35db16){return db[_0xbdb0('0x45')][_0xbdb0('0x49')]()['then'](respondWithResult(_0x35db16,null))[_0xbdb0('0x1e')](handleError(_0x35db16,null));};exports['createVidaooSession']=function(_0x4a8c1c,_0x50e688){var _0x578ad1=_0x4a8c1c[_0xbdb0('0x3b')]['id'];var _0x44002c;var _0x3ed029;var _0x5ef58a;return db[_0xbdb0('0x45')][_0xbdb0('0x4a')]({'where':{'id':_0x578ad1}})[_0xbdb0('0x16')](function(_0x262e92){_0x44002c=_0x262e92;return db[_0xbdb0('0x4b')][_0xbdb0('0x4a')]({'where':{'id':_0x262e92[_0xbdb0('0x4c')]},'attributes':['id',_0xbdb0('0x4d'),_0xbdb0('0x4e'),_0xbdb0('0x4f'),_0xbdb0('0x50'),_0xbdb0('0x51')],'raw':!![]});})[_0xbdb0('0x16')](function(_0x2d6307){if(_0x2d6307&&_0x2d6307[_0xbdb0('0x4d')]&&_0x2d6307[_0xbdb0('0x4e')]){_0x3ed029=_0x2d6307;var _0x3992d8={'interaction':{'id':_0x578ad1},'agent':{'id':_0x4a8c1c[_0xbdb0('0x39')]['id'],'name':_0x4a8c1c[_0xbdb0('0x39')]['name'],'fullname':_0x4a8c1c['user'][_0xbdb0('0x52')],'email':_0x4a8c1c[_0xbdb0('0x39')][_0xbdb0('0x53')]},'contact':_0x4a8c1c[_0xbdb0('0x2e')][_0xbdb0('0x54')],'account':_0x4a8c1c[_0xbdb0('0x2e')]['account']};var _0x242e85={'rejectUnauthorized':![],'method':_0xbdb0('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2d6307[_0xbdb0('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4a8c1c[_0xbdb0('0x39')][_0xbdb0('0x53')]],'buttons':null,'topic':_0x3ed029[_0xbdb0('0x4f')],'note':_[_0xbdb0('0x56')](_0x3ed029[_0xbdb0('0x50')])?null:getMustacheRender(_0x3ed029[_0xbdb0('0x50')],_0x3992d8),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xbdb0('0x56')](_0x3ed029['vidaooMetadata'])){var _0x11c663=getMustacheRender(_0x3ed029[_0xbdb0('0x51')],_0x3992d8);var _0x214e8c=JSON[_0xbdb0('0x57')](_0x11c663);_0x242e85[_0xbdb0('0x2e')]['metadata']=_0x214e8c;}}catch(_0x24bdb4){throw new db[(_0xbdb0('0x58'))]['ValidationError'](_0xbdb0('0x59'));}return rp(_0x242e85);}else{throw new db[(_0xbdb0('0x58'))][(_0xbdb0('0x5a'))](_0xbdb0('0x5b'));}})[_0xbdb0('0x16')](function(_0x6afa){_0x5ef58a=_0x6afa;if(_0x5ef58a['id']){var _0x24e069={'body':_0x5ef58a['join_url'],'ChatWebsiteId':_0x3ed029['id'],'ChatInteractionId':_0x44002c['id'],'direction':_0xbdb0('0x5c'),'UserId':_0x4a8c1c[_0xbdb0('0x39')]['id']};return db[_0xbdb0('0x5d')][_0xbdb0('0x47')](_0x24e069,{});}else{throw new db[(_0xbdb0('0x58'))][(_0xbdb0('0x5a'))](_0xbdb0('0x5e'));}})['then'](function(){return _0x44002c[_0xbdb0('0x5f')]({'vidaooSessionId':_0x5ef58a['id']});})[_0xbdb0('0x16')](respondWithResult(_0x50e688,null))[_0xbdb0('0x1e')](handleError(_0x50e688,null));};exports[_0xbdb0('0x60')]=function(_0x3bc336,_0x20b21d){if(_0x3bc336[_0xbdb0('0x2e')]['id']){delete _0x3bc336['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3bc336[_0xbdb0('0x3b')]['id']},'include':[{'model':db[_0xbdb0('0x61')],'as':_0xbdb0('0x62')}]})['then'](handleEntityNotFound(_0x20b21d,null))['then'](saveUpdates(_0x3bc336[_0xbdb0('0x2e')],null))['then'](respondWithResult(_0x20b21d,null))[_0xbdb0('0x1e')](handleError(_0x20b21d,null));};exports[_0xbdb0('0x63')]=function(_0x21ec7d,_0x1543ed){if(_0x21ec7d[_0xbdb0('0x2e')]['id']){delete _0x21ec7d[_0xbdb0('0x2e')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x21ec7d[_0xbdb0('0x3b')]['id']}})['then'](function(_0x2dfd64){if(!_0x2dfd64){logger[_0xbdb0('0x1b')](_0xbdb0('0x64'),'abandon',0x194,_0xbdb0('0x65'));_0x1543ed[_0xbdb0('0x29')](0x194);}else{if(_0x2dfd64[_0xbdb0('0x66')]){throw new db['Sequelize'][(_0xbdb0('0x5a'))](_0xbdb0('0x67'));}}return _0x2dfd64;})['then'](function(_0x268b9a){if(_0x268b9a){return _0x268b9a[_0xbdb0('0x28')]({'closed':_0x21ec7d[_0xbdb0('0x2e')]['closed'],'disposition':_0x21ec7d[_0xbdb0('0x2e')]['disposition']})[_0xbdb0('0x16')](function(_0xa433eb){return _0xa433eb;});}})[_0xbdb0('0x16')](function(){return respondWithRpcPromise(_0xbdb0('0x68'),_0xbdb0('0x63'),_0x21ec7d[_0xbdb0('0x2e')],client9004);})[_0xbdb0('0x16')](respondWithResult(_0x1543ed,null))[_0xbdb0('0x1e')](handleError(_0x1543ed,null));};exports['attachmentUpload']=function(_0x16fc52,_0x32a578){_0x16fc52[_0xbdb0('0x2e')]['name']=_0x16fc52[_0xbdb0('0x69')][_0xbdb0('0x6a')];_0x16fc52[_0xbdb0('0x2e')][_0xbdb0('0x6b')]=_0x16fc52['file'][_0xbdb0('0x6c')];_0x16fc52[_0xbdb0('0x2e')][_0xbdb0('0x35')]=_0x16fc52[_0xbdb0('0x69')][_0xbdb0('0x6d')];return db['Attachment'][_0xbdb0('0x47')](_0x16fc52[_0xbdb0('0x2e')])[_0xbdb0('0x16')](respondWithResult(_0x32a578,0xc9))[_0xbdb0('0x1e')](handleError(_0x32a578,null));};exports['attachmentDownload']=function(_0x4eb9a9,_0x4c4c58){return db[_0xbdb0('0x45')]['findOne']({'where':{'id':_0x4eb9a9[_0xbdb0('0x3b')]['id']},'raw':!![]})[_0xbdb0('0x16')](handleEntityNotFound(_0x4c4c58,null))[_0xbdb0('0x16')](function(_0x2db42b){if(_0x2db42b){if(_0x2db42b[_0xbdb0('0x6e')]){return _0x4c4c58[_0xbdb0('0x1f')](0x193)['json']({'status':0x193,'message':_0xbdb0('0x6f')});}return db[_0xbdb0('0x70')]['findOne']({'where':{'id':_0x4eb9a9['query'][_0xbdb0('0x71')]},'raw':!![]})[_0xbdb0('0x16')](handleEntityNotFound(_0x4c4c58,null));}})[_0xbdb0('0x16')](function(_0x55ec26){if(_0x55ec26){var _0x1c200f=_0x55ec26[_0xbdb0('0x72')]!==null;var _0x460e45=path[_0xbdb0('0x73')](config['root'],_0xbdb0('0x74'));if(_0x1c200f){_0x460e45=path[_0xbdb0('0x73')](_0x460e45,_0xbdb0('0x75'));}var _0x223ecd=path[_0xbdb0('0x73')](_0x460e45,_0x55ec26[_0xbdb0('0x6b')]);return _0x4c4c58[_0xbdb0('0x76')](_0x223ecd);}})[_0xbdb0('0x1e')](handleError(_0x4c4c58,null));};exports['close']=function(_0x55abd9,_0x41d4c8){var _0x181d71=null;var _0x4dced0=null;var _0xc1345b=null;if(_0x55abd9[_0xbdb0('0x2e')]['id']){delete _0x55abd9[_0xbdb0('0x2e')]['id'];}if(_0x55abd9[_0xbdb0('0x2e')][_0xbdb0('0x77')]){_0xc1345b=path['join'](config[_0xbdb0('0x78')],_0xbdb0('0x79'),util['format'](_0xbdb0('0x7a'),Date[_0xbdb0('0x7b')]()));_0x55abd9[_0xbdb0('0x2e')][_0xbdb0('0x7c')]=_0xc1345b;}return db[_0xbdb0('0x45')]['find']({'where':{'id':_0x55abd9[_0xbdb0('0x3b')]['id']},'include':[{'model':db[_0xbdb0('0x5d')],'as':_0xbdb0('0x7d'),'include':[{'model':db['User'],'as':_0xbdb0('0x7e')}]}]})[_0xbdb0('0x16')](handleEntityNotFound(_0x41d4c8,null))[_0xbdb0('0x16')](saveUpdates(_0x55abd9[_0xbdb0('0x2e')],null))[_0xbdb0('0x16')](function(_0x30301c){if(_0x30301c){_0x181d71=_0x30301c;return db[_0xbdb0('0x4b')][_0xbdb0('0x46')]({'where':{'id':_0x181d71[_0xbdb0('0x4c')]}});}})[_0xbdb0('0x16')](function(_0x15fbbe){if(_0x15fbbe){_0x4dced0=_0x15fbbe;return db[_0xbdb0('0x61')][_0xbdb0('0x46')]({'where':{'id':_0x181d71[_0xbdb0('0x7f')]}});}})[_0xbdb0('0x16')](function(_0x153845){if(_0x153845){if(_0xc1345b){var _0x4898e2=null;for(var _0x240b40=0x1;_0x240b40<_0x181d71['Messages'][_0xbdb0('0x42')];++_0x240b40){_0x4898e2=_0x181d71[_0xbdb0('0x7d')][_0x240b40];var _0x459427=_0x4898e2[_0xbdb0('0x66')]?util[_0xbdb0('0x80')](_0xbdb0('0x81'),_0x4dced0['agentAlias'],_0x4898e2[_0xbdb0('0x66')]):'System';var _0x4b3f0f=_0x55abd9['body'][_0xbdb0('0x82')]||util[_0xbdb0('0x80')](_0xbdb0('0x81'),'Visitor',_0x4898e2[_0xbdb0('0x7f')]);switch(_0x4dced0[_0xbdb0('0x83')]){case'website_alias':_0x459427=_0x4898e2[_0xbdb0('0x66')]?util['format'](_0xbdb0('0x81'),_0x4dced0[_0xbdb0('0x84')],_0x4898e2[_0xbdb0('0x66')]):_0xbdb0('0x85');break;case _0xbdb0('0x86'):_0x459427=_0x4898e2[_0xbdb0('0x66')]?_0x4898e2[_0xbdb0('0x7e')][_0xbdb0('0x87')]||_0x4898e2[_0xbdb0('0x7e')][_0xbdb0('0x52')]:'System';break;case _0xbdb0('0x88'):_0x459427=_0x4898e2[_0xbdb0('0x66')]?_0x4898e2[_0xbdb0('0x7e')]['fullname']:_0xbdb0('0x85');break;default:_0x459427=_0x4898e2[_0xbdb0('0x66')]?util[_0xbdb0('0x80')](_0xbdb0('0x81'),_0x4dced0['agentAlias'],_0x4898e2['UserId']):_0xbdb0('0x85');}var _0x3715c5=util[_0xbdb0('0x80')](_0xbdb0('0x89'),moment(_0x4898e2['createdAt'])['format'](_0xbdb0('0x8a')),_0x4898e2[_0xbdb0('0x8b')]==='in'?_0x4b3f0f:_0x459427,_0x4898e2[_0xbdb0('0x2e')]);if(!_0x4898e2[_0xbdb0('0x8c')]){fs[_0xbdb0('0x8d')](_0xc1345b,_0x3715c5);}}return db[_0xbdb0('0x8e')][_0xbdb0('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xbdb0('0x8f')],'as':_0xbdb0('0x90'),'raw':!![],'include':[{'model':db[_0xbdb0('0x91')],'as':_0xbdb0('0x91'),'raw':!![]}]}]});}}})[_0xbdb0('0x16')](function(_0x4f51ce){if(!_0x4f51ce||!_0x4f51ce['Smtp']||!_0x55abd9[_0xbdb0('0x2e')])return _0x181d71;var _0x104ab6=_0x4f51ce[_0xbdb0('0x92')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x104ab6,'message':{'from':util['format'](_0xbdb0('0x93'),_0x4f51ce[_0xbdb0('0x2b')],_0x4f51ce['email']||_0x4f51ce[_0xbdb0('0x90')][_0xbdb0('0x39')]),'to':_0x55abd9[_0xbdb0('0x2e')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0xbdb0('0x80')](_0xbdb0('0x94'),_0x55abd9[_0xbdb0('0x2e')]['mailTranscript']),'attachments':[{'path':_0xc1345b}]}})[_0xbdb0('0x16')](function(){return _0x181d71;})[_0xbdb0('0x1e')](function(_0x56dcbc){logger['error'](_0x56dcbc);});})['then'](respondWithStatusCode(_0x41d4c8,0xc8))[_0xbdb0('0x1e')](handleError(_0x41d4c8,null));};exports['addMessage']=function(_0x4b9cd3,_0x1ce4ab){return db['ChatMessage']['find']({'where':{'id':_0x4b9cd3[_0xbdb0('0x3b')]['id']}})[_0xbdb0('0x16')](handleEntityNotFound(_0x1ce4ab,null))['then'](function(_0x26969f){if(_0x26969f){return _0x26969f['addMessage'](_0x4b9cd3[_0xbdb0('0x2e')]['ids'],_[_0xbdb0('0x95')](_0x4b9cd3[_0xbdb0('0x2e')],['ids','id'])||{});}})[_0xbdb0('0x16')](respondWithResult(_0x1ce4ab,null))['catch'](handleError(_0x1ce4ab,null));};exports[_0xbdb0('0x96')]=function(_0x1eba1f,_0x14962e){var _0x3bda55={'raw':![],'where':{}};var _0x3095c8={};var _0x1a3214={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1eba1f[_0xbdb0('0x3b')]['id']}})[_0xbdb0('0x16')](handleEntityNotFound(_0x14962e,null))[_0xbdb0('0x16')](function(_0x117e14){if(_0x117e14){_0x3095c8[_0xbdb0('0x3f')]=_[_0xbdb0('0x3c')](db['ChatMessage'][_0xbdb0('0x34')]);_0x3095c8[_0xbdb0('0x38')]=_[_0xbdb0('0x3c')](_0x1eba1f[_0xbdb0('0x38')]);_0x3095c8[_0xbdb0('0x3d')]=_[_0xbdb0('0x3e')](_0x3095c8[_0xbdb0('0x3f')],_0x3095c8[_0xbdb0('0x38')]);_0x3bda55[_0xbdb0('0x40')]=_[_0xbdb0('0x3e')](_0x3095c8[_0xbdb0('0x3f')],qs[_0xbdb0('0x41')](_0x1eba1f[_0xbdb0('0x38')]['fields']));_0x3bda55['attributes']=_0x3bda55[_0xbdb0('0x40')]['length']?_0x3bda55['attributes']:_0x3095c8[_0xbdb0('0x3f')];if(!_0x1eba1f['query'][_0xbdb0('0x97')]('nolimit')){_0x3bda55[_0xbdb0('0x24')]=qs[_0xbdb0('0x24')](_0x1eba1f[_0xbdb0('0x38')][_0xbdb0('0x24')]);_0x3bda55[_0xbdb0('0x22')]=qs[_0xbdb0('0x22')](_0x1eba1f[_0xbdb0('0x38')][_0xbdb0('0x22')]);}_0x3bda55[_0xbdb0('0x98')]=qs[_0xbdb0('0x99')](_0x1eba1f[_0xbdb0('0x38')][_0xbdb0('0x99')]);_0x3bda55['where']=qs[_0xbdb0('0x3d')](_[_0xbdb0('0x9a')](_0x1eba1f[_0xbdb0('0x38')],_0x3095c8[_0xbdb0('0x3d')]));_0x3bda55[_0xbdb0('0x9b')]['ChatInteractionId']=_0x117e14['id'];if(_0x1eba1f[_0xbdb0('0x38')]['filter']){_0x3bda55[_0xbdb0('0x9b')]=_[_0xbdb0('0x44')](_0x3bda55[_0xbdb0('0x9b')],{'$or':_[_0xbdb0('0x33')](_0x3bda55['attributes'],function(_0x262b61){var _0x131681={};_0x131681[_0x262b61]={'$like':'%'+_0x1eba1f[_0xbdb0('0x38')][_0xbdb0('0x9c')]+'%'};return _0x131681;})});}if(_0x1eba1f[_0xbdb0('0x38')][_0xbdb0('0x9d')]){var _0x257f24=_0x1eba1f[_0xbdb0('0x38')][_0xbdb0('0x9d')]['split'](',');var _0x30c8cb={};_0x30c8cb[_0x257f24[0x0]]={'$gte':moment(_0x257f24[0x1])[_0xbdb0('0x80')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3bda55[_0xbdb0('0x9b')]=_['merge'](_0x3bda55[_0xbdb0('0x9b')],_0x30c8cb);}_0x3bda55=_[_0xbdb0('0x44')]({},_0x3bda55,_0x1eba1f['options']);return db[_0xbdb0('0x5d')][_0xbdb0('0x25')]({'where':_0x3bda55[_0xbdb0('0x9b')]})[_0xbdb0('0x16')](function(_0x24358e){_0x1a3214[_0xbdb0('0x25')]=_0x24358e;if(_0x1eba1f[_0xbdb0('0x38')][_0xbdb0('0x9e')]){_0x3bda55[_0xbdb0('0x43')]=[{'all':!![]}];}return db[_0xbdb0('0x5d')]['findAll'](_0x3bda55);})[_0xbdb0('0x16')](function(_0x44b374){_0x1a3214[_0xbdb0('0x9f')]=_0x44b374;return _0x1a3214;});}})['then'](respondWithFilteredResult(_0x14962e,_0x3bda55))[_0xbdb0('0x1e')](handleError(_0x14962e,null));};exports['getMyMessages']=function(_0x550a60,_0x2641fb){var _0x2bf06d={'where':{}},_0x419cec={},_0x2e934d={'count':0x0,'rows':[]};return db[_0xbdb0('0x45')][_0xbdb0('0x4a')]({'where':{'id':_0x550a60['params']['id']}})[_0xbdb0('0x16')](handleEntityNotFound(_0x2641fb,null))[_0xbdb0('0x16')](function(_0x4730a8){if(_0x4730a8){_0x419cec['model']=_[_0xbdb0('0x3c')](db[_0xbdb0('0x5d')][_0xbdb0('0x34')]);_0x419cec[_0xbdb0('0x38')]=_[_0xbdb0('0x3c')](_0x550a60[_0xbdb0('0x38')]);_0x419cec[_0xbdb0('0x3d')]=_[_0xbdb0('0x3e')](_0x419cec[_0xbdb0('0x3f')],_0x419cec[_0xbdb0('0x38')]);_0x2bf06d[_0xbdb0('0x40')]=_['intersection'](_0x419cec[_0xbdb0('0x3f')],qs[_0xbdb0('0x41')](_0x550a60['query'][_0xbdb0('0x41')]));_0x2bf06d[_0xbdb0('0x40')]=_0x2bf06d[_0xbdb0('0x40')][_0xbdb0('0x42')]?_0x2bf06d[_0xbdb0('0x40')]:_0x419cec[_0xbdb0('0x3f')];if(!_0x550a60[_0xbdb0('0x38')][_0xbdb0('0x97')](_0xbdb0('0xa0'))){_0x2bf06d['limit']=qs['limit'](_0x550a60[_0xbdb0('0x38')][_0xbdb0('0x24')]);_0x2bf06d['offset']=qs[_0xbdb0('0x22')](_0x550a60['query'][_0xbdb0('0x22')]);}_0x2bf06d[_0xbdb0('0x98')]=qs[_0xbdb0('0x99')](_0x550a60[_0xbdb0('0x38')][_0xbdb0('0x99')]);_0x2bf06d['where']=qs[_0xbdb0('0x3d')](_[_0xbdb0('0x9a')](_0x550a60['query'],_0x419cec[_0xbdb0('0x3d')]));_0x2bf06d[_0xbdb0('0x9b')]['ChatInteractionId']=_0x4730a8['id'];if(_0x550a60['query'][_0xbdb0('0x9c')]){_0x2bf06d[_0xbdb0('0x9b')]=_['merge'](_0x2bf06d[_0xbdb0('0x9b')],{'$or':_[_0xbdb0('0x33')](_0x2bf06d[_0xbdb0('0x40')],function(_0x9b63aa){var _0x543b29={};_0x543b29[_0x9b63aa]={'$like':'%'+_0x550a60[_0xbdb0('0x38')][_0xbdb0('0x9c')]+'%'};return _0x543b29;})});}_0x2bf06d[_0xbdb0('0x9b')][_0xbdb0('0x8c')]=![];if(_0x550a60[_0xbdb0('0x38')]['id']){_0x2bf06d[_0xbdb0('0x9b')]['id']={'$gt':_0x550a60[_0xbdb0('0x38')]['id']};}_0x2bf06d=_['merge']({},_0x2bf06d,_0x550a60['options']);return db['ChatMessage'][_0xbdb0('0x25')]({'where':_0x2bf06d[_0xbdb0('0x9b')]})[_0xbdb0('0x16')](function(_0x4e88e0){_0x2e934d['count']=_0x4e88e0;_0x2bf06d[_0xbdb0('0x43')]=[];if(_0x550a60[_0xbdb0('0x38')][_0xbdb0('0xa1')]){_0x2bf06d[_0xbdb0('0x43')]['push']({'model':db['User'],'as':'User','attributes':['id','fullname',_0xbdb0('0x87')]});}if(_0x550a60[_0xbdb0('0x38')][_0xbdb0('0x9e')]){_0x2bf06d[_0xbdb0('0x43')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2bf06d);})['then'](function(_0x1fd108){_0x2e934d[_0xbdb0('0x9f')]=_0x1fd108;return _0x2e934d;});}})[_0xbdb0('0x16')](respondWithFilteredResult(_0x2641fb,_0x2bf06d))['catch'](handleError(_0x2641fb,null));};exports['addTags']=function(_0x5e686e,_0x3b2790){return db[_0xbdb0('0x45')][_0xbdb0('0x46')]({'where':{'id':_0x5e686e[_0xbdb0('0x3b')]['id']}})[_0xbdb0('0x16')](handleEntityNotFound(_0x3b2790,null))[_0xbdb0('0x16')](function(_0x944c64){if(_0x944c64){return _0x944c64[_0xbdb0('0xa2')](_0x5e686e[_0xbdb0('0x2e')][_0xbdb0('0xa3')],_[_0xbdb0('0x95')](_0x5e686e[_0xbdb0('0x2e')],[_0xbdb0('0xa3'),'id'])||{})[_0xbdb0('0xa4')](function(){return db[_0xbdb0('0xa5')][_0xbdb0('0xa6')]({'attributes':['id',_0xbdb0('0x2b'),_0xbdb0('0xa7')],'where':{'id':_0x5e686e[_0xbdb0('0x2e')][_0xbdb0('0xa3')]}});})[_0xbdb0('0x16')](function(_0x49f843){socket[_0xbdb0('0xa8')](_0xbdb0('0xa9'),{'id':Number(_0x5e686e['params']['id']),'tags':_0x49f843||[]});return{'id':Number(_0x5e686e['params']['id']),'tags':_0x49f843||[]};});}})[_0xbdb0('0x16')](respondWithResult(_0x3b2790,null))[_0xbdb0('0x1e')](handleError(_0x3b2790,null));};exports['removeTags']=function(_0x3b45ae,_0x21219d){return db[_0xbdb0('0x45')][_0xbdb0('0x46')]({'where':{'id':_0x3b45ae[_0xbdb0('0x3b')]['id']}})[_0xbdb0('0x16')](handleEntityNotFound(_0x21219d,null))[_0xbdb0('0x16')](function(_0xc82347){if(_0xc82347){return _0xc82347['removeTags'](_0x3b45ae[_0xbdb0('0x38')][_0xbdb0('0xa3')]);}})[_0xbdb0('0x16')](respondWithStatusCode(_0x21219d,null))[_0xbdb0('0x1e')](handleError(_0x21219d,null));};exports['download']=function(_0x5ce773,_0x6bd17b){var _0x54bb87=moment()['unix']()['toString']();var _0x470219=path[_0xbdb0('0x73')](config['root'],_0xbdb0('0xaa'),_0xbdb0('0xab'),_0xbdb0('0xac'));var _0xa89db=path['join'](config[_0xbdb0('0x78')],_0xbdb0('0xaa'),'files',_0xbdb0('0xad'));var _0x383ee9=path[_0xbdb0('0x73')](_0x470219,_0x54bb87);var _0x37409a=util[_0xbdb0('0x80')](_0xbdb0('0xae'),_0x5ce773[_0xbdb0('0x3b')]['id'],_0x54bb87);var _0x29d2be=path[_0xbdb0('0x73')](_0x470219,_0x37409a);var _0x1cb3f2=[];_0x1cb3f2[_0xbdb0('0xaf')]({'model':db[_0xbdb0('0x7e')],'as':_0xbdb0('0x7e'),'attributes':['id',_0xbdb0('0x52')],'raw':!![]});_0x1cb3f2[_0xbdb0('0xaf')]({'model':db[_0xbdb0('0x61')],'as':_0xbdb0('0x62'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x5ce773[_0xbdb0('0x38')]['attachments']){_0x1cb3f2[_0xbdb0('0xaf')]({'model':db[_0xbdb0('0x70')],'as':_0xbdb0('0x70'),'raw':!![]});}var _0x4e74c8=[{'model':db['ChatMessage'],'as':_0xbdb0('0x7d'),'attributes':['id',_0xbdb0('0x2e'),_0xbdb0('0xb0'),'direction',_0xbdb0('0x8c'),_0xbdb0('0xb1')],'include':_0x1cb3f2}];_0x4e74c8[_0xbdb0('0xaf')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xbdb0('0x2b')]});_0x4e74c8[_0xbdb0('0xaf')]({'model':db[_0xbdb0('0x7e')],'as':_0xbdb0('0xb2'),'attributes':['id',_0xbdb0('0x52')]});return db[_0xbdb0('0x45')][_0xbdb0('0x46')]({'where':{'id':_0x5ce773[_0xbdb0('0x3b')]['id']},'include':_0x4e74c8})[_0xbdb0('0x16')](handleEntityNotFound(_0x6bd17b,null))[_0xbdb0('0x16')](function(_0x4a7059){if(_0x4a7059){var _0x1b086a=_0x4a7059[_0xbdb0('0xb3')]({'plain':!![]});fs['mkdirSync'](_0x383ee9);var _0xd255d5={'channel':_0xbdb0('0xb4'),'account':_0x1b086a[_0xbdb0('0xb5')][_0xbdb0('0x2b')],'agent':_0x1b086a[_0xbdb0('0xb2')]?_0x1b086a[_0xbdb0('0xb2')][_0xbdb0('0x52')]:_0xbdb0('0xb6'),'createdAt':moment(_0x1b086a[_0xbdb0('0xb0')])[_0xbdb0('0x80')](_0xbdb0('0xb7'))[_0xbdb0('0xb8')](),'closedAt':_0x1b086a[_0xbdb0('0x6e')]?moment(_0x1b086a[_0xbdb0('0xb9')])[_0xbdb0('0x80')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbdb0('0xb8')]():'','disposition':_0x1b086a['disposition'],'chatInfo':{'browser':_0x1b086a[_0xbdb0('0xba')],'os':_0x1b086a[_0xbdb0('0xbb')],'referer':_0x1b086a['referer'],'customerIp':_0x1b086a[_0xbdb0('0xbc')],'customerPort':_0x1b086a[_0xbdb0('0xbd')]?_0x1b086a['customerPort']:_0xbdb0('0xb6')},'messages':_(_0x1b086a[_0xbdb0('0x7d')])[_0xbdb0('0xbe')]()[_0xbdb0('0x9c')]({'secret':![]})[_0xbdb0('0x33')](function(_0x3f5361){if(_0x3f5361['Attachment']){var _0x2c2735=path[_0xbdb0('0x73')](_0xa89db,_0x3f5361[_0xbdb0('0x70')][_0xbdb0('0x6b')]);if(fs[_0xbdb0('0xbf')](_0x2c2735)){fs[_0xbdb0('0xc0')](_0x2c2735)[_0xbdb0('0xc1')](fs[_0xbdb0('0xc2')](path[_0xbdb0('0x73')](_0x383ee9,_0x3f5361['Attachment'][_0xbdb0('0x6b')])));}}return{'date':moment(_0x3f5361[_0xbdb0('0xb0')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbdb0('0xb8')](),'sender':_0x3f5361['direction']===_0xbdb0('0x5c')?_0x3f5361['User']?_0x3f5361[_0xbdb0('0x7e')]['fullname']:'System':_0x3f5361[_0xbdb0('0x62')]['firstName']+(_0x3f5361[_0xbdb0('0x62')][_0xbdb0('0xc3')]?'\x20'+_0x3f5361[_0xbdb0('0x62')]['lastName']:''),'body':_0x3f5361[_0xbdb0('0x70')]?_0x3f5361[_0xbdb0('0x70')]['basename']:_0x3f5361['body'],'direction':_0x3f5361[_0xbdb0('0x8b')]===_0xbdb0('0x5c')?'A':'C','secret':_0x3f5361[_0xbdb0('0x8c')],'read':_0x3f5361['read'],'attachment':_0x3f5361['Attachment']};})[_0xbdb0('0xc4')]()};return ejs[_0xbdb0('0xc5')](path[_0xbdb0('0x73')](config[_0xbdb0('0x78')],_0xbdb0('0xaa'),_0xbdb0('0xc6'),_0xbdb0('0xc7')),{'interaction':_0xd255d5})['then'](function(_0x18eeb3){var _0x4f6fc5=path[_0xbdb0('0x73')](_0x383ee9,'transcript-'+_0x1b086a['id']+'-'+_0x54bb87+_0xbdb0('0xc8'));var _0x73934f={'path':_0x4f6fc5,'channel':_0xbdb0('0xb4'),'interactionId':_0x1b086a['id']};return pdf['createPdfFromHTML'](_0x18eeb3,_0x73934f);})['then'](function(){return new Promise(function(_0x59af62,_0x4e02a7){zipdir(_0x383ee9,{'saveTo':_0x29d2be},function(_0x200730,_0x1aee48){if(_0x200730)return _0x4e02a7(_0x200730);return _0x59af62(_0x1aee48);});})[_0xbdb0('0x16')](function(){return new BPromise(function(_0x5af6fd,_0x3063c9){rimraf(_0x383ee9,function(_0x1af9ca){if(_0x1af9ca)_0x3063c9(_0x1af9ca);return _0x5af6fd();});});})[_0xbdb0('0x16')](function(){return _0x6bd17b[_0xbdb0('0x76')](_0x29d2be,_0x37409a,function(_0x3a65d0){if(_0x3a65d0){logger['error']('err',_0x3a65d0);}else{fs[_0xbdb0('0xc9')](_0x29d2be);}});});});}else{return _0x6bd17b[_0xbdb0('0x29')](0xc8);}})[_0xbdb0('0x1e')](handleError(_0x6bd17b,null));}; \ No newline at end of file +var _0x065a=['closedAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','createReadStream','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','out','firstName','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','util','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','end','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','query','user','catch','show','params','model','keys','intersection','attributes','fields','include','options','find','create','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','closed','AbandonInteraction','attachmentUpload','file','basename','mimetype','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ChatWebsite','ContactId','Messages','length','%s%d','agentAlias','System','Visitor','agentIdentifier','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','rawAttributes','filters','hasOwnProperty','order','sort','where','filter','$gte','includeAll','rows','nolimit','includeAgent','push','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','direction','secret','read','Owner','get','mkdirSync','Chat','Account'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x065a,0xe9));var _0xa065=function(_0x1d26d1,_0x2294e4){_0x1d26d1=_0x1d26d1-0x0;var _0x2d3fb2=_0x065a[_0x1d26d1];return _0x2d3fb2;};'use strict';var rimraf=require(_0xa065('0x0'));var zipdir=require(_0xa065('0x1'));var rp=require(_0xa065('0x2'));var moment=require(_0xa065('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa065('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa065('0x5'));var Redis=require(_0xa065('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xa065('0x7'));var pdf=require(_0xa065('0x8'));var logger=require(_0xa065('0x9'))(_0xa065('0xa'));var config=require(_0xa065('0xb'));var db=require(_0xa065('0xc'))['db'];config[_0xa065('0xd')]=_['defaults'](config['redis'],{'host':_0xa065('0xe'),'port':0x18eb});var socket=require(_0xa065('0xf'))(new Redis(config[_0xa065('0xd')]));require(_0xa065('0x10'))['register'](socket);var jayson=require(_0xa065('0x11'));var client=jayson[_0xa065('0x12')][_0xa065('0x13')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2abd0a,_0xe85152,_0x376794,_0x140d59){return new BPromise(function(_0x5d2ef5,_0x13d87d){var _0x1e586b=_0x140d59||client;return _0x1e586b['request'](_0x2abd0a,_0x376794)[_0xa065('0x14')](function(_0x2f6eda){logger['info'](_0xa065('0x15'),_0xe85152,_0xa065('0x16'));logger[_0xa065('0x17')](_0xa065('0x18'),_0xe85152,_0xa065('0x16'),JSON[_0xa065('0x19')](_0x2f6eda));if(_0x2f6eda[_0xa065('0x1a')]){if(_0x2f6eda['error'][_0xa065('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xe85152,_0x2f6eda[_0xa065('0x1a')][_0xa065('0x1c')]);return _0x13d87d(_0x2f6eda[_0xa065('0x1a')][_0xa065('0x1c')]);}logger[_0xa065('0x1a')](_0xa065('0x15'),_0xe85152,_0x2f6eda['error'][_0xa065('0x1c')]);return _0x5d2ef5(_0x2f6eda[_0xa065('0x1a')][_0xa065('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0xe85152,'request\x20sent');_0x5d2ef5(_0x2f6eda[_0xa065('0x1d')][_0xa065('0x1c')]);}})['catch'](function(_0x134e18){logger[_0xa065('0x1a')](_0xa065('0x15'),_0xe85152,_0x134e18);_0x13d87d(_0x134e18);});});}function respondWithStatusCode(_0x163620,_0x53e880){_0x53e880=_0x53e880||0xcc;return function(_0x5109fb){if(_0x5109fb){return _0x163620[_0xa065('0x1e')](_0x53e880);}return _0x163620[_0xa065('0x1f')](_0x53e880)['end']();};}function respondWithResult(_0x3073f7,_0x2c991d){_0x2c991d=_0x2c991d||0xc8;return function(_0x18a712){if(_0x18a712){return _0x3073f7[_0xa065('0x1f')](_0x2c991d)[_0xa065('0x20')](_0x18a712);}};}function respondWithFilteredResult(_0x633f1f,_0x2b57f5){return function(_0x5d18aa){if(_0x5d18aa){var _0x1748ad=typeof _0x2b57f5['offset']===_0xa065('0x21')&&typeof _0x2b57f5[_0xa065('0x22')]==='undefined';var _0x221a1d=_0x5d18aa[_0xa065('0x23')];var _0x6cad56=_0x1748ad?0x0:_0x2b57f5[_0xa065('0x24')];var _0x3b972c=_0x1748ad?_0x5d18aa[_0xa065('0x23')]:_0x2b57f5[_0xa065('0x24')]+_0x2b57f5['limit'];var _0x5289a0;if(_0x3b972c>=_0x221a1d){_0x3b972c=_0x221a1d;_0x5289a0=0xc8;}else{_0x5289a0=0xce;}_0x633f1f[_0xa065('0x1f')](_0x5289a0);return _0x633f1f[_0xa065('0x25')](_0xa065('0x26'),_0x6cad56+'-'+_0x3b972c+'/'+_0x221a1d)[_0xa065('0x20')](_0x5d18aa);}return null;};}function saveUpdates(_0x4a3464){return function(_0x3d0234){if(_0x3d0234){return _0x3d0234[_0xa065('0x27')](_0x4a3464)['then'](function(_0x119c7d){return _0x119c7d;});}return null;};}function removeEntity(_0x41fc86){return function(_0x809592){if(_0x809592){return _0x809592['destroy']()[_0xa065('0x14')](function(){_0x41fc86[_0xa065('0x1f')](0xcc)[_0xa065('0x28')]();});}};}function handleEntityNotFound(_0x497ba2){return function(_0x2f744b){if(!_0x2f744b){_0x497ba2['sendStatus'](0x194);}return _0x2f744b;};}function handleError(_0x3568dc,_0xca6563){_0xca6563=_0xca6563||0x1f4;return function(_0x25416e){logger[_0xa065('0x1a')](_0x25416e['stack']);if(_0x25416e[_0xa065('0x29')]){delete _0x25416e[_0xa065('0x29')];}_0x3568dc['status'](_0xca6563)[_0xa065('0x2a')](_0x25416e);};}function getMustacheRender(_0x36f72b,_0x1b7a4a){return Mustache[_0xa065('0x2b')](_0x36f72b,_[_0xa065('0x2c')](_0x1b7a4a[_0xa065('0x2d')],{'contact':_0x1b7a4a[_0xa065('0x2e')],'message':_0x1b7a4a[_0xa065('0x1c')],'agent':_0x1b7a4a[_0xa065('0x2f')],'interaction':_0x1b7a4a[_0xa065('0x30')],'account':_0x1b7a4a[_0xa065('0x31')]}))||'';}exports[_0xa065('0x32')]=function(_0x3ac2a0,_0x2ee3f6){var _0x1343f={};var _0x3cf498=_[_0xa065('0x33')](db[_0xa065('0x34')]['rawAttributes'],function(_0x15e836){return{'name':_0x15e836[_0xa065('0x35')],'type':_0x15e836[_0xa065('0x36')][_0xa065('0x37')]};});_0x1343f=qs[_0xa065('0x38')](_0x3cf498,_0x3ac2a0);return interaction[_0xa065('0x39')](_0xa065('0x3a'),_0x3ac2a0[_0xa065('0x3b')],_0x3ac2a0[_0xa065('0x3c')],_0x1343f,_0x3cf498)['then'](respondWithFilteredResult(_0x2ee3f6,_0x1343f))[_0xa065('0x3d')](handleError(_0x2ee3f6,null));};exports[_0xa065('0x3e')]=function(_0x18ce27,_0x3a0fbe){var _0x3d910c={'raw':![],'where':{'id':_0x18ce27[_0xa065('0x3f')]['id']}},_0x555703={};_0x555703[_0xa065('0x40')]=_[_0xa065('0x41')](db[_0xa065('0x34')]['rawAttributes']);_0x555703[_0xa065('0x3b')]=_[_0xa065('0x41')](_0x18ce27[_0xa065('0x3b')]);_0x555703['filters']=_[_0xa065('0x42')](_0x555703[_0xa065('0x40')],_0x555703[_0xa065('0x3b')]);_0x3d910c[_0xa065('0x43')]=_[_0xa065('0x42')](_0x555703[_0xa065('0x40')],qs[_0xa065('0x44')](_0x18ce27[_0xa065('0x3b')][_0xa065('0x44')]));_0x3d910c[_0xa065('0x43')]=_0x3d910c[_0xa065('0x43')]['length']?_0x3d910c[_0xa065('0x43')]:_0x555703[_0xa065('0x40')];if(_0x18ce27['query']['includeAll']){_0x3d910c[_0xa065('0x45')]=[{'all':!![]}];}_0x3d910c=_[_0xa065('0x2c')]({},_0x3d910c,_0x18ce27[_0xa065('0x46')]);return db['ChatInteraction'][_0xa065('0x47')](_0x3d910c)[_0xa065('0x14')](handleEntityNotFound(_0x3a0fbe,null))[_0xa065('0x14')](respondWithResult(_0x3a0fbe,null))[_0xa065('0x3d')](handleError(_0x3a0fbe,null));};exports[_0xa065('0x48')]=function(_0x4e483b,_0x315b2d){return db[_0xa065('0x34')][_0xa065('0x48')](_0x4e483b['body'],{})[_0xa065('0x14')](respondWithResult(_0x315b2d,0xc9))[_0xa065('0x3d')](handleError(_0x315b2d,null));};exports[_0xa065('0x27')]=function(_0x164be5,_0x423e57){if(_0x164be5['body']['id']){delete _0x164be5['body']['id'];}return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x164be5[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0x423e57,null))['then'](saveUpdates(_0x164be5[_0xa065('0x2d')],null))[_0xa065('0x14')](respondWithResult(_0x423e57,null))[_0xa065('0x3d')](handleError(_0x423e57,null));};exports[_0xa065('0x49')]=function(_0x585c99,_0xf7d9f3){return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x585c99[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0xf7d9f3,null))[_0xa065('0x14')](removeEntity(_0xf7d9f3,null))[_0xa065('0x3d')](handleError(_0xf7d9f3,null));};exports[_0xa065('0x4a')]=function(_0x56b850,_0x3c11c3){return db['ChatInteraction'][_0xa065('0x4a')]()[_0xa065('0x14')](respondWithResult(_0x3c11c3,null))['catch'](handleError(_0x3c11c3,null));};exports[_0xa065('0x4b')]=function(_0x234246,_0x4a6d4e){var _0x4d4666=_0x234246[_0xa065('0x3f')]['id'];var _0x3ca7c7;var _0x51b0bd;var _0x4b3e8b;return db[_0xa065('0x34')]['findOne']({'where':{'id':_0x4d4666}})['then'](function(_0x5e45b0){_0x3ca7c7=_0x5e45b0;return db['ChatWebsite'][_0xa065('0x4c')]({'where':{'id':_0x5e45b0[_0xa065('0x4d')]},'attributes':['id',_0xa065('0x4e'),_0xa065('0x4f'),_0xa065('0x50'),_0xa065('0x51'),'vidaooMetadata'],'raw':!![]});})[_0xa065('0x14')](function(_0x36bb53){if(_0x36bb53&&_0x36bb53[_0xa065('0x4e')]&&_0x36bb53[_0xa065('0x4f')]){_0x51b0bd=_0x36bb53;var _0x3bf8d7={'interaction':{'id':_0x4d4666},'agent':{'id':_0x234246['user']['id'],'name':_0x234246[_0xa065('0x3c')][_0xa065('0x29')],'fullname':_0x234246['user'][_0xa065('0x52')],'email':_0x234246['user']['email']},'contact':_0x234246[_0xa065('0x2d')]['contact'],'account':_0x234246[_0xa065('0x2d')][_0xa065('0x31')]};var _0x1eb8ce={'rejectUnauthorized':![],'method':_0xa065('0x53'),'url':_0xa065('0x54'),'headers':{'X-APIKEY':_0x36bb53[_0xa065('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x234246['user'][_0xa065('0x55')]],'buttons':null,'topic':_0x51b0bd[_0xa065('0x50')],'note':_[_0xa065('0x56')](_0x51b0bd[_0xa065('0x51')])?null:getMustacheRender(_0x51b0bd[_0xa065('0x51')],_0x3bf8d7),'metadata':null},'redirect':_0xa065('0x57'),'json':!![]};try{if(!_['isNull'](_0x51b0bd[_0xa065('0x58')])){var _0x5e8a8=getMustacheRender(_0x51b0bd[_0xa065('0x58')],_0x3bf8d7);var _0x22ff7f=JSON[_0xa065('0x59')](_0x5e8a8);_0x1eb8ce[_0xa065('0x2d')][_0xa065('0x5a')]=_0x22ff7f;}}catch(_0x5c0790){throw new db[(_0xa065('0x5b'))][(_0xa065('0x5c'))](_0xa065('0x5d'));}return rp(_0x1eb8ce);}else{throw new db['Sequelize'][(_0xa065('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa065('0x14')](function(_0x424743){_0x4b3e8b=_0x424743;if(_0x4b3e8b['id']){var _0x2c3323={'body':_0x4b3e8b[_0xa065('0x5e')],'ChatWebsiteId':_0x51b0bd['id'],'ChatInteractionId':_0x3ca7c7['id'],'direction':'out','UserId':_0x234246['user']['id']};return db[_0xa065('0x5f')][_0xa065('0x48')](_0x2c3323,{});}else{throw new db[(_0xa065('0x5b'))][(_0xa065('0x5c'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa065('0x14')](function(){return _0x3ca7c7[_0xa065('0x60')]({'vidaooSessionId':_0x4b3e8b['id']});})[_0xa065('0x14')](respondWithResult(_0x4a6d4e,null))['catch'](handleError(_0x4a6d4e,null));};exports[_0xa065('0x61')]=function(_0x259d56,_0x47e50f){if(_0x259d56['body']['id']){delete _0x259d56[_0xa065('0x2d')]['id'];}return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x259d56['params']['id']},'include':[{'model':db[_0xa065('0x62')],'as':_0xa065('0x63')}]})[_0xa065('0x14')](handleEntityNotFound(_0x47e50f,null))['then'](saveUpdates(_0x259d56['body'],null))['then'](respondWithResult(_0x47e50f,null))[_0xa065('0x3d')](handleError(_0x47e50f,null));};exports[_0xa065('0x64')]=function(_0x4f6b79,_0xc4e68f){if(_0x4f6b79['body']['id']){delete _0x4f6b79['body']['id'];}return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x4f6b79[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](function(_0x2d24f2){if(!_0x2d24f2){logger[_0xa065('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xa065('0x64'),0x194,_0xa065('0x65'));_0xc4e68f[_0xa065('0x1e')](0x194);}else{if(_0x2d24f2[_0xa065('0x66')]){throw new db[(_0xa065('0x5b'))][(_0xa065('0x5c'))]('Interaction\x20already\x20assigned');}}return _0x2d24f2;})[_0xa065('0x14')](function(_0x51f82a){if(_0x51f82a){return _0x51f82a[_0xa065('0x27')]({'closed':_0x4f6b79[_0xa065('0x2d')][_0xa065('0x67')],'disposition':_0x4f6b79[_0xa065('0x2d')]['disposition']})[_0xa065('0x14')](function(_0x36f887){return _0x36f887;});}})[_0xa065('0x14')](function(){return respondWithRpcPromise(_0xa065('0x68'),'abandon',_0x4f6b79[_0xa065('0x2d')],client9004);})[_0xa065('0x14')](respondWithResult(_0xc4e68f,null))[_0xa065('0x3d')](handleError(_0xc4e68f,null));};exports[_0xa065('0x69')]=function(_0x435dec,_0x1c3dc4){_0x435dec[_0xa065('0x2d')][_0xa065('0x29')]=_0x435dec[_0xa065('0x6a')]['originalname'];_0x435dec['body'][_0xa065('0x6b')]=_0x435dec[_0xa065('0x6a')]['filename'];_0x435dec[_0xa065('0x2d')]['type']=_0x435dec['file'][_0xa065('0x6c')];return db['Attachment'][_0xa065('0x48')](_0x435dec[_0xa065('0x2d')])[_0xa065('0x14')](respondWithResult(_0x1c3dc4,0xc9))[_0xa065('0x3d')](handleError(_0x1c3dc4,null));};exports['attachmentDownload']=function(_0x2a94d5,_0x2efc4c){return db[_0xa065('0x34')][_0xa065('0x4c')]({'where':{'id':_0x2a94d5[_0xa065('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2efc4c,null))[_0xa065('0x14')](function(_0x5eb3db){if(_0x5eb3db){if(_0x5eb3db[_0xa065('0x67')]){return _0x2efc4c[_0xa065('0x1f')](0x193)[_0xa065('0x20')]({'status':0x193,'message':_0xa065('0x6d')});}return db[_0xa065('0x6e')][_0xa065('0x4c')]({'where':{'id':_0x2a94d5['query'][_0xa065('0x6f')]},'raw':!![]})[_0xa065('0x14')](handleEntityNotFound(_0x2efc4c,null));}})[_0xa065('0x14')](function(_0x8d5581){if(_0x8d5581){var _0x2ab43f=_0x8d5581[_0xa065('0x70')]!==null;var _0x2431bb=path[_0xa065('0x71')](config[_0xa065('0x72')],_0xa065('0x73'));if(_0x2ab43f){_0x2431bb=path['join'](_0x2431bb,_0xa065('0x74'));}var _0x4f4f4f=path[_0xa065('0x71')](_0x2431bb,_0x8d5581[_0xa065('0x6b')]);return _0x2efc4c[_0xa065('0x75')](_0x4f4f4f);}})[_0xa065('0x3d')](handleError(_0x2efc4c,null));};exports[_0xa065('0x76')]=function(_0x50f700,_0x498598){var _0x13abaa=null;var _0x3a06a1=null;var _0x3aafb4=null;if(_0x50f700['body']['id']){delete _0x50f700[_0xa065('0x2d')]['id'];}if(_0x50f700['body'][_0xa065('0x77')]){_0x3aafb4=path['join'](config['root'],_0xa065('0x78'),util[_0xa065('0x79')](_0xa065('0x7a'),Date[_0xa065('0x7b')]()));_0x50f700['body'][_0xa065('0x7c')]=_0x3aafb4;}return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x50f700['params']['id']},'include':[{'model':db[_0xa065('0x5f')],'as':'Messages','include':[{'model':db[_0xa065('0x7d')],'as':_0xa065('0x7d')}]}]})[_0xa065('0x14')](handleEntityNotFound(_0x498598,null))[_0xa065('0x14')](saveUpdates(_0x50f700[_0xa065('0x2d')],null))[_0xa065('0x14')](function(_0x8d1845){if(_0x8d1845){_0x13abaa=_0x8d1845;return db[_0xa065('0x7e')][_0xa065('0x47')]({'where':{'id':_0x13abaa[_0xa065('0x4d')]}});}})[_0xa065('0x14')](function(_0x550ea0){if(_0x550ea0){_0x3a06a1=_0x550ea0;return db[_0xa065('0x62')][_0xa065('0x47')]({'where':{'id':_0x13abaa[_0xa065('0x7f')]}});}})[_0xa065('0x14')](function(_0x3a743c){if(_0x3a743c){if(_0x3aafb4){var _0xfa1e14=null;for(var _0x59e601=0x1;_0x59e601<_0x13abaa[_0xa065('0x80')][_0xa065('0x81')];++_0x59e601){_0xfa1e14=_0x13abaa[_0xa065('0x80')][_0x59e601];var _0x3415c7=_0xfa1e14[_0xa065('0x66')]?util[_0xa065('0x79')](_0xa065('0x82'),_0x3a06a1[_0xa065('0x83')],_0xfa1e14['UserId']):_0xa065('0x84');var _0x18749c=_0x50f700[_0xa065('0x2d')]['customer']||util[_0xa065('0x79')](_0xa065('0x82'),_0xa065('0x85'),_0xfa1e14[_0xa065('0x7f')]);switch(_0x3a06a1[_0xa065('0x86')]){case'website_alias':_0x3415c7=_0xfa1e14[_0xa065('0x66')]?util['format'](_0xa065('0x82'),_0x3a06a1['agentAlias'],_0xfa1e14[_0xa065('0x66')]):'System';break;case'agent_alias':_0x3415c7=_0xfa1e14['UserId']?_0xfa1e14[_0xa065('0x7d')][_0xa065('0x87')]||_0xfa1e14[_0xa065('0x7d')][_0xa065('0x52')]:_0xa065('0x84');break;case _0xa065('0x88'):_0x3415c7=_0xfa1e14['UserId']?_0xfa1e14['User']['fullname']:_0xa065('0x84');break;default:_0x3415c7=_0xfa1e14[_0xa065('0x66')]?util[_0xa065('0x79')](_0xa065('0x82'),_0x3a06a1['agentAlias'],_0xfa1e14[_0xa065('0x66')]):_0xa065('0x84');}var _0x398105=util[_0xa065('0x79')](_0xa065('0x89'),moment(_0xfa1e14[_0xa065('0x8a')])[_0xa065('0x79')](_0xa065('0x8b')),_0xfa1e14['direction']==='in'?_0x18749c:_0x3415c7,_0xfa1e14[_0xa065('0x2d')]);if(!_0xfa1e14['secret']){fs[_0xa065('0x8c')](_0x3aafb4,_0x398105);}}return db[_0xa065('0x8d')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xa065('0x8e')],'as':_0xa065('0x8f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa065('0x90'),'raw':!![]}]}]});}}})[_0xa065('0x14')](function(_0x2287ef){if(!_0x2287ef||!_0x2287ef[_0xa065('0x8f')]||!_0x50f700[_0xa065('0x2d')])return _0x13abaa;var _0x1db119=_0x2287ef[_0xa065('0x91')]();return respondWithRpcPromise('SendMail',_0xa065('0x92'),{'account':_0x1db119,'message':{'from':util[_0xa065('0x79')](_0xa065('0x93'),_0x2287ef[_0xa065('0x29')],_0x2287ef['email']||_0x2287ef['Smtp'][_0xa065('0x3c')]),'to':_0x50f700[_0xa065('0x2d')][_0xa065('0x77')],'subject':'Mail\x20Transcript','text':util['format'](_0xa065('0x94'),_0x50f700[_0xa065('0x2d')]['mailTranscript']),'attachments':[{'path':_0x3aafb4}]}})['then'](function(){return _0x13abaa;})['catch'](function(_0x2982b9){logger[_0xa065('0x1a')](_0x2982b9);});})[_0xa065('0x14')](respondWithStatusCode(_0x498598,0xc8))['catch'](handleError(_0x498598,null));};exports[_0xa065('0x95')]=function(_0x840dba,_0x5b4b16){return db[_0xa065('0x5f')][_0xa065('0x47')]({'where':{'id':_0x840dba[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0x5b4b16,null))[_0xa065('0x14')](function(_0x116fd3){if(_0x116fd3){return _0x116fd3[_0xa065('0x95')](_0x840dba['body'][_0xa065('0x96')],_[_0xa065('0x97')](_0x840dba[_0xa065('0x2d')],[_0xa065('0x96'),'id'])||{});}})[_0xa065('0x14')](respondWithResult(_0x5b4b16,null))['catch'](handleError(_0x5b4b16,null));};exports[_0xa065('0x98')]=function(_0x5e8d48,_0x2cc5e6){var _0x98ffe5={'raw':![],'where':{}};var _0x28cf05={};var _0x553d4e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa065('0x4c')]({'where':{'id':_0x5e8d48[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0x2cc5e6,null))[_0xa065('0x14')](function(_0x1c4b74){if(_0x1c4b74){_0x28cf05[_0xa065('0x40')]=_[_0xa065('0x41')](db[_0xa065('0x5f')][_0xa065('0x99')]);_0x28cf05[_0xa065('0x3b')]=_['keys'](_0x5e8d48['query']);_0x28cf05[_0xa065('0x9a')]=_[_0xa065('0x42')](_0x28cf05[_0xa065('0x40')],_0x28cf05['query']);_0x98ffe5[_0xa065('0x43')]=_[_0xa065('0x42')](_0x28cf05['model'],qs['fields'](_0x5e8d48[_0xa065('0x3b')][_0xa065('0x44')]));_0x98ffe5[_0xa065('0x43')]=_0x98ffe5['attributes'][_0xa065('0x81')]?_0x98ffe5[_0xa065('0x43')]:_0x28cf05[_0xa065('0x40')];if(!_0x5e8d48[_0xa065('0x3b')][_0xa065('0x9b')]('nolimit')){_0x98ffe5[_0xa065('0x22')]=qs[_0xa065('0x22')](_0x5e8d48['query'][_0xa065('0x22')]);_0x98ffe5[_0xa065('0x24')]=qs[_0xa065('0x24')](_0x5e8d48[_0xa065('0x3b')][_0xa065('0x24')]);}_0x98ffe5[_0xa065('0x9c')]=qs['sort'](_0x5e8d48[_0xa065('0x3b')][_0xa065('0x9d')]);_0x98ffe5[_0xa065('0x9e')]=qs[_0xa065('0x9a')](_['pick'](_0x5e8d48[_0xa065('0x3b')],_0x28cf05[_0xa065('0x9a')]));_0x98ffe5[_0xa065('0x9e')]['ChatInteractionId']=_0x1c4b74['id'];if(_0x5e8d48['query']['filter']){_0x98ffe5['where']=_['merge'](_0x98ffe5['where'],{'$or':_[_0xa065('0x33')](_0x98ffe5[_0xa065('0x43')],function(_0x473c33){var _0x65f2cd={};_0x65f2cd[_0x473c33]={'$like':'%'+_0x5e8d48[_0xa065('0x3b')][_0xa065('0x9f')]+'%'};return _0x65f2cd;})});}if(_0x5e8d48[_0xa065('0x3b')][_0xa065('0xa0')]){var _0x2066bf=_0x5e8d48[_0xa065('0x3b')][_0xa065('0xa0')]['split'](',');var _0x21c234={};_0x21c234[_0x2066bf[0x0]]={'$gte':moment(_0x2066bf[0x1])[_0xa065('0x79')]('YYYY-MM-DD\x20HH:mm:ss')};_0x98ffe5['where']=_[_0xa065('0x2c')](_0x98ffe5[_0xa065('0x9e')],_0x21c234);}_0x98ffe5=_['merge']({},_0x98ffe5,_0x5e8d48[_0xa065('0x46')]);return db[_0xa065('0x5f')][_0xa065('0x23')]({'where':_0x98ffe5[_0xa065('0x9e')]})[_0xa065('0x14')](function(_0x8f5cd4){_0x553d4e['count']=_0x8f5cd4;if(_0x5e8d48[_0xa065('0x3b')][_0xa065('0xa1')]){_0x98ffe5[_0xa065('0x45')]=[{'all':!![]}];}return db[_0xa065('0x5f')][_0xa065('0x39')](_0x98ffe5);})[_0xa065('0x14')](function(_0x527f85){_0x553d4e[_0xa065('0xa2')]=_0x527f85;return _0x553d4e;});}})[_0xa065('0x14')](respondWithFilteredResult(_0x2cc5e6,_0x98ffe5))[_0xa065('0x3d')](handleError(_0x2cc5e6,null));};exports['getMyMessages']=function(_0xaaf172,_0x50144f){var _0x1e9f0b={'where':{}},_0x52173b={},_0x17ab75={'count':0x0,'rows':[]};return db[_0xa065('0x34')][_0xa065('0x4c')]({'where':{'id':_0xaaf172[_0xa065('0x3f')]['id']}})['then'](handleEntityNotFound(_0x50144f,null))[_0xa065('0x14')](function(_0x2262d2){if(_0x2262d2){_0x52173b[_0xa065('0x40')]=_[_0xa065('0x41')](db[_0xa065('0x5f')][_0xa065('0x99')]);_0x52173b[_0xa065('0x3b')]=_[_0xa065('0x41')](_0xaaf172['query']);_0x52173b[_0xa065('0x9a')]=_[_0xa065('0x42')](_0x52173b[_0xa065('0x40')],_0x52173b[_0xa065('0x3b')]);_0x1e9f0b[_0xa065('0x43')]=_[_0xa065('0x42')](_0x52173b[_0xa065('0x40')],qs[_0xa065('0x44')](_0xaaf172[_0xa065('0x3b')]['fields']));_0x1e9f0b['attributes']=_0x1e9f0b[_0xa065('0x43')][_0xa065('0x81')]?_0x1e9f0b[_0xa065('0x43')]:_0x52173b[_0xa065('0x40')];if(!_0xaaf172['query'][_0xa065('0x9b')](_0xa065('0xa3'))){_0x1e9f0b[_0xa065('0x22')]=qs['limit'](_0xaaf172[_0xa065('0x3b')][_0xa065('0x22')]);_0x1e9f0b[_0xa065('0x24')]=qs['offset'](_0xaaf172[_0xa065('0x3b')][_0xa065('0x24')]);}_0x1e9f0b[_0xa065('0x9c')]=qs['sort'](_0xaaf172['query']['sort']);_0x1e9f0b['where']=qs[_0xa065('0x9a')](_['pick'](_0xaaf172['query'],_0x52173b[_0xa065('0x9a')]));_0x1e9f0b['where']['ChatInteractionId']=_0x2262d2['id'];if(_0xaaf172[_0xa065('0x3b')][_0xa065('0x9f')]){_0x1e9f0b[_0xa065('0x9e')]=_[_0xa065('0x2c')](_0x1e9f0b[_0xa065('0x9e')],{'$or':_[_0xa065('0x33')](_0x1e9f0b[_0xa065('0x43')],function(_0x218823){var _0x119834={};_0x119834[_0x218823]={'$like':'%'+_0xaaf172[_0xa065('0x3b')]['filter']+'%'};return _0x119834;})});}_0x1e9f0b['where']['secret']=![];if(_0xaaf172[_0xa065('0x3b')]['id']){_0x1e9f0b[_0xa065('0x9e')]['id']={'$gt':_0xaaf172[_0xa065('0x3b')]['id']};}_0x1e9f0b=_['merge']({},_0x1e9f0b,_0xaaf172[_0xa065('0x46')]);return db[_0xa065('0x5f')][_0xa065('0x23')]({'where':_0x1e9f0b[_0xa065('0x9e')]})['then'](function(_0x1e0c2f){_0x17ab75[_0xa065('0x23')]=_0x1e0c2f;_0x1e9f0b[_0xa065('0x45')]=[];if(_0xaaf172[_0xa065('0x3b')][_0xa065('0xa4')]){_0x1e9f0b[_0xa065('0x45')][_0xa065('0xa5')]({'model':db[_0xa065('0x7d')],'as':_0xa065('0x7d'),'attributes':['id',_0xa065('0x52'),_0xa065('0x87')]});}if(_0xaaf172[_0xa065('0x3b')][_0xa065('0xa1')]){_0x1e9f0b[_0xa065('0x45')]=[{'all':!![]}];}return db[_0xa065('0x5f')][_0xa065('0x39')](_0x1e9f0b);})[_0xa065('0x14')](function(_0x397bde){_0x17ab75[_0xa065('0xa2')]=_0x397bde;return _0x17ab75;});}})[_0xa065('0x14')](respondWithFilteredResult(_0x50144f,_0x1e9f0b))[_0xa065('0x3d')](handleError(_0x50144f,null));};exports[_0xa065('0xa6')]=function(_0x2c8ebd,_0x298d57){return db['ChatInteraction']['find']({'where':{'id':_0x2c8ebd[_0xa065('0x3f')]['id']}})['then'](handleEntityNotFound(_0x298d57,null))[_0xa065('0x14')](function(_0x447a4e){if(_0x447a4e){return _0x447a4e[_0xa065('0xa7')](_0x2c8ebd[_0xa065('0x2d')][_0xa065('0x96')],_[_0xa065('0x97')](_0x2c8ebd[_0xa065('0x2d')],[_0xa065('0x96'),'id'])||{})['spread'](function(){return db['Tag'][_0xa065('0x39')]({'attributes':['id',_0xa065('0x29'),_0xa065('0xa8')],'where':{'id':_0x2c8ebd[_0xa065('0x2d')][_0xa065('0x96')]}});})['then'](function(_0x3c4b77){socket[_0xa065('0xa9')](_0xa065('0xaa'),{'id':Number(_0x2c8ebd[_0xa065('0x3f')]['id']),'tags':_0x3c4b77||[]});return{'id':Number(_0x2c8ebd[_0xa065('0x3f')]['id']),'tags':_0x3c4b77||[]};});}})['then'](respondWithResult(_0x298d57,null))[_0xa065('0x3d')](handleError(_0x298d57,null));};exports[_0xa065('0xab')]=function(_0x4f3542,_0x418141){return db[_0xa065('0x34')][_0xa065('0x47')]({'where':{'id':_0x4f3542[_0xa065('0x3f')]['id']}})[_0xa065('0x14')](handleEntityNotFound(_0x418141,null))[_0xa065('0x14')](function(_0x285611){if(_0x285611){return _0x285611[_0xa065('0xab')](_0x4f3542[_0xa065('0x3b')][_0xa065('0x96')]);}})[_0xa065('0x14')](respondWithStatusCode(_0x418141,null))[_0xa065('0x3d')](handleError(_0x418141,null));};exports[_0xa065('0x75')]=function(_0x481cce,_0x39a495){var _0x1f0e3c=moment()[_0xa065('0xac')]()[_0xa065('0xad')]();var _0x30bb8f=path['join'](config[_0xa065('0x72')],_0xa065('0xae'),_0xa065('0xaf'),_0xa065('0xb0'));var _0x53f325=path[_0xa065('0x71')](config[_0xa065('0x72')],'server','files',_0xa065('0xb1'));var _0x538358=path['join'](_0x30bb8f,_0x1f0e3c);var _0x29d909=util[_0xa065('0x79')](_0xa065('0xb2'),_0x481cce[_0xa065('0x3f')]['id'],_0x1f0e3c);var _0x338c4a=path[_0xa065('0x71')](_0x30bb8f,_0x29d909);var _0xff7ad2=[];_0xff7ad2['push']({'model':db[_0xa065('0x7d')],'as':_0xa065('0x7d'),'attributes':['id',_0xa065('0x52')],'raw':!![]});_0xff7ad2[_0xa065('0xa5')]({'model':db[_0xa065('0x62')],'as':_0xa065('0x63'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x481cce[_0xa065('0x3b')][_0xa065('0xb1')]){_0xff7ad2[_0xa065('0xa5')]({'model':db['Attachment'],'as':_0xa065('0x6e'),'raw':!![]});}var _0x2abe04=[{'model':db[_0xa065('0x5f')],'as':_0xa065('0x80'),'attributes':['id',_0xa065('0x2d'),'createdAt',_0xa065('0xb3'),_0xa065('0xb4'),_0xa065('0xb5')],'include':_0xff7ad2}];_0x2abe04[_0xa065('0xa5')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xa065('0x29')]});_0x2abe04[_0xa065('0xa5')]({'model':db[_0xa065('0x7d')],'as':_0xa065('0xb6'),'attributes':['id','fullname']});return db[_0xa065('0x34')]['find']({'where':{'id':_0x481cce[_0xa065('0x3f')]['id']},'include':_0x2abe04})[_0xa065('0x14')](handleEntityNotFound(_0x39a495,null))[_0xa065('0x14')](function(_0x1438f6){if(_0x1438f6){var _0x590aa3=_0x1438f6[_0xa065('0xb7')]({'plain':!![]});fs[_0xa065('0xb8')](_0x538358);var _0x534ab4={'channel':_0xa065('0xb9'),'account':_0x590aa3[_0xa065('0xba')][_0xa065('0x29')],'agent':_0x590aa3[_0xa065('0xb6')]?_0x590aa3['Owner'][_0xa065('0x52')]:'N.A.','createdAt':moment(_0x590aa3['createdAt'])[_0xa065('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa065('0xad')](),'closedAt':_0x590aa3[_0xa065('0x67')]?moment(_0x590aa3[_0xa065('0xbb')])[_0xa065('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa065('0xad')]():'','disposition':_0x590aa3[_0xa065('0xbc')],'chatInfo':{'browser':_0x590aa3[_0xa065('0xbd')],'os':_0x590aa3[_0xa065('0xbe')],'referer':_0x590aa3[_0xa065('0xbf')],'customerIp':_0x590aa3[_0xa065('0xc0')],'customerPort':_0x590aa3['customerPort']?_0x590aa3[_0xa065('0xc1')]:_0xa065('0xc2')},'messages':_(_0x590aa3[_0xa065('0x80')])[_0xa065('0xc3')]()[_0xa065('0x9f')]({'secret':![]})['map'](function(_0x409759){if(_0x409759[_0xa065('0x6e')]){var _0x3de1b2=path[_0xa065('0x71')](_0x53f325,_0x409759[_0xa065('0x6e')]['basename']);if(fs['existsSync'](_0x3de1b2)){fs[_0xa065('0xc4')](_0x3de1b2)['pipe'](fs[_0xa065('0xc5')](path[_0xa065('0x71')](_0x538358,_0x409759['Attachment']['basename'])));}}return{'date':moment(_0x409759['createdAt'])[_0xa065('0x79')](_0xa065('0xc6'))['toString'](),'sender':_0x409759['direction']===_0xa065('0xc7')?_0x409759['User']?_0x409759['User'][_0xa065('0x52')]:_0xa065('0x84'):_0x409759[_0xa065('0x63')][_0xa065('0xc8')]+(_0x409759['Contact'][_0xa065('0xc9')]?'\x20'+_0x409759[_0xa065('0x63')][_0xa065('0xc9')]:''),'body':_0x409759[_0xa065('0x6e')]?_0x409759[_0xa065('0x6e')][_0xa065('0x6b')]:_0x409759[_0xa065('0x2d')],'direction':_0x409759[_0xa065('0xb3')]==='out'?'A':'C','secret':_0x409759[_0xa065('0xb4')],'read':_0x409759[_0xa065('0xb5')],'attachment':_0x409759[_0xa065('0x6e')]};})[_0xa065('0xca')]()};return ejs[_0xa065('0xcb')](path[_0xa065('0x71')](config[_0xa065('0x72')],_0xa065('0xae'),_0xa065('0xcc'),_0xa065('0xcd')),{'interaction':_0x534ab4})[_0xa065('0x14')](function(_0xcbb09b){var _0x59885c=path[_0xa065('0x71')](_0x538358,_0xa065('0xce')+_0x590aa3['id']+'-'+_0x1f0e3c+_0xa065('0xcf'));var _0x21ad24={'path':_0x59885c,'channel':_0xa065('0xb9'),'interactionId':_0x590aa3['id']};return pdf['createPdfFromHTML'](_0xcbb09b,_0x21ad24);})[_0xa065('0x14')](function(){return new Promise(function(_0x5d5a25,_0xa07c6d){zipdir(_0x538358,{'saveTo':_0x338c4a},function(_0x57b779,_0x365ece){if(_0x57b779)return _0xa07c6d(_0x57b779);return _0x5d5a25(_0x365ece);});})[_0xa065('0x14')](function(){return new BPromise(function(_0x1c2fc9,_0x55734d){rimraf(_0x538358,function(_0x8a6890){if(_0x8a6890)_0x55734d(_0x8a6890);return _0x1c2fc9();});});})[_0xa065('0x14')](function(){return _0x39a495['download'](_0x338c4a,_0x29d909,function(_0x38aa42){if(_0x38aa42){logger[_0xa065('0x1a')](_0xa065('0xd0'),_0x38aa42);}else{fs[_0xa065('0xd1')](_0x338c4a);}});});});}else{return _0x39a495['sendStatus'](0xc8);}})[_0xa065('0x3d')](handleError(_0x39a495,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index bf83f25..679681f 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 _0x6fe9=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x6fe9,0x135));var _0x96fe=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x6fe9[_0x334841];return _0x5beb4b;};'use strict';var EventEmitter=require(_0x96fe('0x0'));var ChatInteraction=require(_0x96fe('0x1'))['db'][_0x96fe('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x96fe('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x96fe('0x4')](0x0);var events={'afterCreate':_0x96fe('0x5'),'afterUpdate':_0x96fe('0x6'),'afterDestroy':_0x96fe('0x7')};function emitEvent(_0xcce54f){return function(_0x349793,_0x465783,_0x1816ba){_0x349793[_0x96fe('0x8')]({'attributes':['id'],'raw':!![]})[_0x96fe('0x9')](function(_0x15d888){_0x349793[_0x96fe('0xa')]('Users',_0x15d888[_0x96fe('0xb')](function(_0x1499bb){return{'id':_0x1499bb['id']};}));return ChatMessage[_0x96fe('0xc')]({'where':{'ChatInteractionId':_0x349793['id'],'direction':'in','read':![]},'raw':!![]});})[_0x96fe('0x9')](function(_0x7ef00f){_0x349793[_0x96fe('0xa')](_0x96fe('0xd'),_0x7ef00f[_0x96fe('0xe')]);ChatInteractionEvents[_0x96fe('0xf')](_0xcce54f+':'+_0x349793['id'],_0x349793);ChatInteractionEvents[_0x96fe('0xf')](_0xcce54f,_0x349793);_0x1816ba(null);})['catch'](_0x1816ba(null));};}for(var e in events){if(events[_0x96fe('0x10')](e)){var event=events[e];ChatInteraction[_0x96fe('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x5529=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','Users','map','findAll','then'];(function(_0x5c6712,_0x36ef0c){var _0x4bb74e=function(_0x4e1fb2){while(--_0x4e1fb2){_0x5c6712['push'](_0x5c6712['shift']());}};_0x4bb74e(++_0x36ef0c);}(_0x5529,0xdf));var _0x9552=function(_0x2701bb,_0x29c1cc){_0x2701bb=_0x2701bb-0x0;var _0x2779db=_0x5529[_0x2701bb];return _0x2779db;};'use strict';var EventEmitter=require(_0x9552('0x0'));var ChatInteraction=require(_0x9552('0x1'))['db'][_0x9552('0x2')];var ChatMessage=require(_0x9552('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9552('0x3')](0x0);var events={'afterCreate':_0x9552('0x4'),'afterUpdate':_0x9552('0x5'),'afterDestroy':_0x9552('0x6')};function emitEvent(_0x4ae26c){return function(_0x5487f0,_0x53ecae,_0x3d4ebf){_0x5487f0['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1b4695){_0x5487f0['setDataValue'](_0x9552('0x7'),_0x1b4695[_0x9552('0x8')](function(_0x490346){return{'id':_0x490346['id']};}));return ChatMessage[_0x9552('0x9')]({'where':{'ChatInteractionId':_0x5487f0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9552('0xa')](function(_0x50842a){_0x5487f0[_0x9552('0xb')](_0x9552('0xc'),_0x50842a[_0x9552('0xd')]);ChatInteractionEvents[_0x9552('0xe')](_0x4ae26c+':'+_0x5487f0['id'],_0x5487f0);ChatInteractionEvents[_0x9552('0xe')](_0x4ae26c,_0x5487f0);_0x3d4ebf(null);})[_0x9552('0xf')](_0x3d4ebf(null));};}for(var e in events){if(events[_0x9552('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x9552('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 2e87520..5245385 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 _0x36fb=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','rimraf','./chatInteraction.attributes','exports','define','changed','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x9d93d1,_0x21e0c6){var _0x67fa0=function(_0x4e098d){while(--_0x4e098d){_0x9d93d1['push'](_0x9d93d1['shift']());}};_0x67fa0(++_0x21e0c6);}(_0x36fb,0x147));var _0xb36f=function(_0x2f405a,_0x1ae5b9){_0x2f405a=_0x2f405a-0x0;var _0x1e0aee=_0x36fb[_0x2f405a];return _0x1e0aee;};'use strict';var _=require('lodash');var util=require(_0xb36f('0x0'));var logger=require(_0xb36f('0x1'))(_0xb36f('0x2'));var moment=require(_0xb36f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb36f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb36f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb36f('0x6'));module[_0xb36f('0x7')]=function(_0x4b7ec1,_0x105876){return _0x4b7ec1[_0xb36f('0x8')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10c713,_0x51fa52,_0x321c90){if(_0x10c713[_0xb36f('0x9')]('closed')){_0x10c713['closedAt']=moment()['format'](_0xb36f('0xa'));}_0x321c90(null,_0x10c713);}},'charset':_0xb36f('0xb'),'collate':_0xb36f('0xc')});}; \ No newline at end of file +var _0x15d0=['request-promise','path','rimraf','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x2999c7,_0x50c6cc){var _0xc521f0=function(_0x2b624b){while(--_0x2b624b){_0x2999c7['push'](_0x2999c7['shift']());}};_0xc521f0(++_0x50c6cc);}(_0x15d0,0x14c));var _0x015d=function(_0x6bfd84,_0x5d5e05){_0x6bfd84=_0x6bfd84-0x0;var _0xf3b43a=_0x15d0[_0x6bfd84];return _0xf3b43a;};'use strict';var _=require(_0x015d('0x0'));var util=require('util');var logger=require(_0x015d('0x1'))(_0x015d('0x2'));var moment=require(_0x015d('0x3'));var BPromise=require('bluebird');var rp=require(_0x015d('0x4'));var fs=require('fs');var path=require(_0x015d('0x5'));var rimraf=require(_0x015d('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x015d('0x7')]=function(_0x52def4,_0x14c8a6){return _0x52def4[_0x015d('0x8')](_0x015d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4adc26,_0xa9cf24,_0x34d298){if(_0x4adc26[_0x015d('0xa')](_0x015d('0xb'))){_0x4adc26['closedAt']=moment()[_0x015d('0xc')](_0x015d('0xd'));}_0x34d298(null,_0x4adc26);}},'charset':_0x015d('0xe'),'collate':_0x015d('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index f96e185..3806bdb 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 _0x566c=['message','result','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','limit','catch','find','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x137d80,_0x4ca815){var _0x406c15=function(_0x1f0e13){while(--_0x1f0e13){_0x137d80['push'](_0x137d80['shift']());}};_0x406c15(++_0x4ca815);}(_0x566c,0x11b));var _0xc566=function(_0x5c0a8b,_0x55dfb0){_0x5c0a8b=_0x5c0a8b-0x0;var _0x322f13=_0x566c[_0x5c0a8b];return _0x322f13;};'use strict';var _=require(_0xc566('0x0'));var util=require(_0xc566('0x1'));var moment=require(_0xc566('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc566('0x3'))['db'];var utils=require(_0xc566('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc566('0x5'));var jayson=require(_0xc566('0x6'));var client=jayson[_0xc566('0x7')][_0xc566('0x8')]({'port':0x232a});config['redis']=_[_0xc566('0x9')](config[_0xc566('0xa')],{'host':_0xc566('0xb'),'port':0x18eb});var socket=require(_0xc566('0xc'))(new Redis(config[_0xc566('0xa')]));require(_0xc566('0xd'))[_0xc566('0xe')](socket);function respondWithRpcPromise(_0x909714,_0x5982d4,_0x21e098){return new BPromise(function(_0xf33221,_0x207b89){return client['request'](_0x909714,_0x21e098)[_0xc566('0xf')](function(_0x2a2c3f){logger[_0xc566('0x10')](_0xc566('0x11'),_0x5982d4,_0xc566('0x12'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5982d4,_0xc566('0x12'),JSON['stringify'](_0x2a2c3f));if(_0x2a2c3f[_0xc566('0x13')]){if(_0x2a2c3f[_0xc566('0x13')][_0xc566('0x14')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5982d4,_0x2a2c3f[_0xc566('0x13')][_0xc566('0x15')]);return _0x207b89(_0x2a2c3f[_0xc566('0x13')][_0xc566('0x15')]);}logger[_0xc566('0x13')](_0xc566('0x11'),_0x5982d4,_0x2a2c3f[_0xc566('0x13')]['message']);return _0xf33221(_0x2a2c3f['error'][_0xc566('0x15')]);}else{logger[_0xc566('0x10')](_0xc566('0x11'),_0x5982d4,'request\x20sent');_0xf33221(_0x2a2c3f[_0xc566('0x16')][_0xc566('0x15')]);}})['catch'](function(_0x16016d){logger[_0xc566('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x5982d4,_0x16016d);_0x207b89(_0x16016d);});});}exports[_0xc566('0x17')]=function(_0x5916f4){var _0x2a92b7=this;return new Promise(function(_0x317103,_0x1fee69){return db[_0xc566('0x18')][_0xc566('0x19')](_0x5916f4[_0xc566('0x1a')],{'raw':_0x5916f4[_0xc566('0x1b')]?_0x5916f4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5916f4[_0xc566('0x1b')]?_0x5916f4['options']['where']||null:null,'attributes':_0x5916f4[_0xc566('0x1b')]?_0x5916f4[_0xc566('0x1b')][_0xc566('0x1c')]||null:null,'limit':_0x5916f4[_0xc566('0x1b')]?_0x5916f4[_0xc566('0x1b')][_0xc566('0x1d')]||null:null})[_0xc566('0xf')](function(_0x5f10a9){logger['info'](_0xc566('0x17'),_0x5916f4);logger['debug']('UpdateChatInteraction',_0x5916f4,JSON['stringify'](_0x5f10a9));_0x317103(_0x5f10a9);})[_0xc566('0x1e')](function(_0x671fb4){logger[_0xc566('0x13')](_0xc566('0x17'),_0x671fb4[_0xc566('0x15')],_0x5916f4);_0x1fee69(_0x2a92b7[_0xc566('0x13')](0x1f4,_0x671fb4[_0xc566('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x58b9f6){return new Promise(function(_0x112fd1,_0x2eb77d){return db[_0xc566('0x18')][_0xc566('0x1f')]({'where':_0x58b9f6[_0xc566('0x1b')]?_0x58b9f6[_0xc566('0x1b')]['where']||null:null})['then'](function(_0x22e72c){if(_0x22e72c){return _0x22e72c[_0xc566('0x20')](_0x58b9f6['body'][_0xc566('0x21')],_[_0xc566('0x22')](_0x58b9f6[_0xc566('0x1a')],[_0xc566('0x21'),'id'])||{});}})[_0xc566('0x23')](function(_0x3dc1e0){logger[_0xc566('0x10')](_0xc566('0x24'),_0x58b9f6);logger[_0xc566('0x25')]('AddTags',_0x58b9f6,JSON['stringify'](_0x3dc1e0));_0x112fd1(_0x3dc1e0);})[_0xc566('0x1e')](function(_0x252815){logger['error'](_0xc566('0x24'),_0x252815[_0xc566('0x15')],_0x58b9f6);_0x2eb77d(_this['error'](0x1f4,_0x252815[_0xc566('0x15')]));});});}; \ No newline at end of file +var _0x17bf=['spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','addTags','ids','omit'];(function(_0x35747a,_0x5763f4){var _0x224e75=function(_0x16e3dd){while(--_0x16e3dd){_0x35747a['push'](_0x35747a['shift']());}};_0x224e75(++_0x5763f4);}(_0x17bf,0xae));var _0xf17b=function(_0x166362,_0x349328){_0x166362=_0x166362-0x0;var _0x1225ed=_0x17bf[_0x166362];return _0x1225ed;};'use strict';var _=require(_0xf17b('0x0'));var util=require(_0xf17b('0x1'));var moment=require('moment');var BPromise=require(_0xf17b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf17b('0x3'));var db=require(_0xf17b('0x4'))['db'];var utils=require(_0xf17b('0x5'));var logger=require('../../config/logger')(_0xf17b('0x6'));var config=require(_0xf17b('0x7'));var jayson=require(_0xf17b('0x8'));var client=jayson[_0xf17b('0x9')][_0xf17b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf17b('0xb')],{'host':_0xf17b('0xc'),'port':0x18eb});var socket=require(_0xf17b('0xd'))(new Redis(config['redis']));require(_0xf17b('0xe'))['register'](socket);function respondWithRpcPromise(_0x189258,_0x2cdd92,_0x22d2db){return new BPromise(function(_0x4e7cb0,_0x2c3c03){return client[_0xf17b('0xf')](_0x189258,_0x22d2db)[_0xf17b('0x10')](function(_0x589fd7){logger['info'](_0xf17b('0x11'),_0x2cdd92,_0xf17b('0x12'));logger[_0xf17b('0x13')](_0xf17b('0x14'),_0x2cdd92,_0xf17b('0x12'),JSON[_0xf17b('0x15')](_0x589fd7));if(_0x589fd7[_0xf17b('0x16')]){if(_0x589fd7[_0xf17b('0x16')][_0xf17b('0x17')]===0x1f4){logger['error'](_0xf17b('0x11'),_0x2cdd92,_0x589fd7[_0xf17b('0x16')]['message']);return _0x2c3c03(_0x589fd7[_0xf17b('0x16')][_0xf17b('0x18')]);}logger[_0xf17b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2cdd92,_0x589fd7[_0xf17b('0x16')]['message']);return _0x4e7cb0(_0x589fd7['error']['message']);}else{logger[_0xf17b('0x19')](_0xf17b('0x11'),_0x2cdd92,_0xf17b('0x12'));_0x4e7cb0(_0x589fd7[_0xf17b('0x1a')][_0xf17b('0x18')]);}})['catch'](function(_0x38e4cb){logger[_0xf17b('0x16')](_0xf17b('0x11'),_0x2cdd92,_0x38e4cb);_0x2c3c03(_0x38e4cb);});});}exports[_0xf17b('0x1b')]=function(_0x41db4e){var _0x895ebf=this;return new Promise(function(_0x23fca0,_0x4b86a5){return db[_0xf17b('0x1c')][_0xf17b('0x1d')](_0x41db4e[_0xf17b('0x1e')],{'raw':_0x41db4e[_0xf17b('0x1f')]?_0x41db4e['options'][_0xf17b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41db4e[_0xf17b('0x1f')]?_0x41db4e[_0xf17b('0x1f')][_0xf17b('0x21')]||null:null,'attributes':_0x41db4e[_0xf17b('0x1f')]?_0x41db4e[_0xf17b('0x1f')][_0xf17b('0x22')]||null:null,'limit':_0x41db4e[_0xf17b('0x1f')]?_0x41db4e['options'][_0xf17b('0x23')]||null:null})[_0xf17b('0x10')](function(_0x28489f){logger[_0xf17b('0x19')](_0xf17b('0x1b'),_0x41db4e);logger[_0xf17b('0x13')]('UpdateChatInteraction',_0x41db4e,JSON[_0xf17b('0x15')](_0x28489f));_0x23fca0(_0x28489f);})[_0xf17b('0x24')](function(_0x3e6964){logger[_0xf17b('0x16')](_0xf17b('0x1b'),_0x3e6964[_0xf17b('0x18')],_0x41db4e);_0x4b86a5(_0x895ebf['error'](0x1f4,_0x3e6964[_0xf17b('0x18')]));});});};exports[_0xf17b('0x25')]=function(_0x1549e7){return new Promise(function(_0x1459ee,_0x3ea855){return db[_0xf17b('0x1c')]['find']({'where':_0x1549e7['options']?_0x1549e7[_0xf17b('0x1f')][_0xf17b('0x21')]||null:null})[_0xf17b('0x10')](function(_0x30d703){if(_0x30d703){return _0x30d703[_0xf17b('0x26')](_0x1549e7['body'][_0xf17b('0x27')],_[_0xf17b('0x28')](_0x1549e7[_0xf17b('0x1e')],[_0xf17b('0x27'),'id'])||{});}})[_0xf17b('0x29')](function(_0x3a9d3c){logger['info'](_0xf17b('0x2a'),_0x1549e7);logger[_0xf17b('0x13')](_0xf17b('0x2a'),_0x1549e7,JSON[_0xf17b('0x15')](_0x3a9d3c));_0x1459ee(_0x3a9d3c);})[_0xf17b('0x24')](function(_0x1822d3){logger[_0xf17b('0x16')](_0xf17b('0x2a'),_0x1822d3[_0xf17b('0x18')],_0x1549e7);_0x3ea855(_this[_0xf17b('0x16')](0x1f4,_0x1822d3[_0xf17b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 896cb44..42fc06f 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 _0x8c39=['removeListener','register','length','chatInteraction:','./chatInteraction.events','remove','emit'];(function(_0x24708b,_0xfa72f3){var _0x2e073d=function(_0x4fdd2b){while(--_0x4fdd2b){_0x24708b['push'](_0x24708b['shift']());}};_0x2e073d(++_0xfa72f3);}(_0x8c39,0x146));var _0x98c3=function(_0xc6bb78,_0x47fc0b){_0xc6bb78=_0xc6bb78-0x0;var _0x29eb7a=_0x8c39[_0xc6bb78];return _0x29eb7a;};'use strict';var ChatInteractionEvents=require(_0x98c3('0x0'));var events=['save',_0x98c3('0x1'),'update'];function createListener(_0x37ccaa,_0x5888e1){return function(_0x48db0e){_0x5888e1[_0x98c3('0x2')](_0x37ccaa,_0x48db0e);};}function removeListener(_0x4c7ef9,_0x56d3a0){return function(){ChatInteractionEvents[_0x98c3('0x3')](_0x4c7ef9,_0x56d3a0);};}exports[_0x98c3('0x4')]=function(_0x4278a0){for(var _0x2bca2b=0x0,_0x142ee9=events[_0x98c3('0x5')];_0x2bca2b<_0x142ee9;_0x2bca2b++){var _0x30fccb=events[_0x2bca2b];var _0x10add2=createListener(_0x98c3('0x6')+_0x30fccb,_0x4278a0);ChatInteractionEvents['on'](_0x30fccb,_0x10add2);}}; \ No newline at end of file +var _0x4fb6=['remove','update','length'];(function(_0x28016b,_0x1affb6){var _0x13d511=function(_0x1ec008){while(--_0x1ec008){_0x28016b['push'](_0x28016b['shift']());}};_0x13d511(++_0x1affb6);}(_0x4fb6,0x15f));var _0x64fb=function(_0x4697fa,_0x21c841){_0x4697fa=_0x4697fa-0x0;var _0x390950=_0x4fb6[_0x4697fa];return _0x390950;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x64fb('0x0'),_0x64fb('0x1')];function createListener(_0x18cd78,_0x186470){return function(_0x5e0d28){_0x186470['emit'](_0x18cd78,_0x5e0d28);};}function removeListener(_0x5f45f7,_0x1b04ea){return function(){ChatInteractionEvents['removeListener'](_0x5f45f7,_0x1b04ea);};}exports['register']=function(_0x2588cb){for(var _0x40ac85=0x0,_0x25599c=events[_0x64fb('0x2')];_0x40ac85<_0x25599c;_0x40ac85++){var _0x2e0297=events[_0x40ac85];var _0x1b3ba0=createListener('chatInteraction:'+_0x2e0297,_0x2588cb);ChatInteractionEvents['on'](_0x2e0297,_0x1b3ba0);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c80acba..a068725 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 _0x26bc=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','diskStorage','root','format','%s-%s','now','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','destroy','delete','/:id/tags','removeTags','exports','path'];(function(_0x537e9f,_0x3072f6){var _0x16d448=function(_0x10593d){while(--_0x10593d){_0x537e9f['push'](_0x537e9f['shift']());}};_0x16d448(++_0x3072f6);}(_0x26bc,0x16b));var _0xc26b=function(_0x15618e,_0x3bf960){_0x15618e=_0x15618e-0x0;var _0x3e1d5c=_0x26bc[_0x15618e];return _0x3e1d5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc26b('0x0'));var timeout=require(_0xc26b('0x1'));var express=require(_0xc26b('0x2'));var router=express[_0xc26b('0x3')]();var fs_extra=require(_0xc26b('0x4'));var auth=require(_0xc26b('0x5'));var interaction=require(_0xc26b('0x6'));var config=require('../../config/environment');var controller=require(_0xc26b('0x7'));router[_0xc26b('0x8')]('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0xa')]);router['get'](_0xc26b('0xb'),auth[_0xc26b('0x9')](),controller[_0xc26b('0xc')]);router[_0xc26b('0x8')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0xc26b('0xd')]);router['get'](_0xc26b('0xe'),auth[_0xc26b('0xf')](),controller[_0xc26b('0x10')]);router['get'](_0xc26b('0x11'),auth[_0xc26b('0x9')](),controller['getMessages']);router[_0xc26b('0x8')](_0xc26b('0x12'),auth[_0xc26b('0xf')](),controller[_0xc26b('0x13')]);router['get'](_0xc26b('0x14'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x15')]);router[_0xc26b('0x16')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc26b('0x17'),auth[_0xc26b('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xc26b('0x18')]({'destination':function(_0x5cb03a,_0x41aca8,_0x4d4f67){_0x4d4f67(null,path['join'](config[_0xc26b('0x19')],'server/files/attachments/'));},'filename':function(_0x35ddd8,_0x2ed3da,_0x43b567){_0x43b567(null,util[_0xc26b('0x1a')](_0xc26b('0x1b'),Date[_0xc26b('0x1c')](),_0x2ed3da['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc26b('0x16')](_0xc26b('0x1d'),upload[_0xc26b('0x1e')](_0xc26b('0x1f')),controller[_0xc26b('0x20')]);router[_0xc26b('0x16')](_0xc26b('0x11'),auth[_0xc26b('0xf')](),controller[_0xc26b('0x21')]);router[_0xc26b('0x16')]('/:id/tags',auth[_0xc26b('0x9')](),interaction[_0xc26b('0x22')](_0xc26b('0x23'),_0xc26b('0x24')),controller[_0xc26b('0x25')]);router[_0xc26b('0x26')](_0xc26b('0x27'),auth[_0xc26b('0x9')](),interaction[_0xc26b('0x22')](_0xc26b('0x23'),_0xc26b('0x28')),controller[_0xc26b('0x29')]);router[_0xc26b('0x26')](_0xc26b('0x2a'),controller[_0xc26b('0x2b')]);router['put'](_0xc26b('0x2c'),auth[_0xc26b('0xf')](),controller[_0xc26b('0x2d')]);router['put'](_0xc26b('0x2e'),controller['close']);router['delete'](_0xc26b('0x27'),auth[_0xc26b('0x9')](),interaction[_0xc26b('0x22')](_0xc26b('0x23'),'chatinteraction:destroy'),controller[_0xc26b('0x2f')]);router[_0xc26b('0x30')](_0xc26b('0x31'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x32')]);module[_0xc26b('0x33')]=router; \ No newline at end of file +var _0x420f=['describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','now','originalname','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe'];(function(_0x3eefec,_0x3dfab2){var _0x1de7b4=function(_0x188817){while(--_0x188817){_0x3eefec['push'](_0x3eefec['shift']());}};_0x1de7b4(++_0x3dfab2);}(_0x420f,0xbb));var _0xf420=function(_0x4cd7bd,_0x33b3e1){_0x4cd7bd=_0x4cd7bd-0x0;var _0x3833b7=_0x420f[_0x4cd7bd];return _0x3833b7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf420('0x0'));var express=require('express');var router=express[_0xf420('0x1')]();var fs_extra=require(_0xf420('0x2'));var auth=require(_0xf420('0x3'));var interaction=require(_0xf420('0x4'));var config=require('../../config/environment');var controller=require(_0xf420('0x5'));router[_0xf420('0x6')]('/',auth[_0xf420('0x7')](),controller['index']);router['get'](_0xf420('0x8'),auth[_0xf420('0x7')](),controller[_0xf420('0x9')]);router[_0xf420('0x6')](_0xf420('0xa'),auth[_0xf420('0xb')](),controller[_0xf420('0xc')]);router[_0xf420('0x6')](_0xf420('0xd'),auth[_0xf420('0xb')](),controller[_0xf420('0xe')]);router[_0xf420('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf420('0xf')]);router[_0xf420('0x6')](_0xf420('0x10'),auth[_0xf420('0xb')](),controller[_0xf420('0x11')]);router[_0xf420('0x6')]('/:id/download',auth[_0xf420('0x7')](),controller[_0xf420('0x12')]);router[_0xf420('0x13')]('/',auth['isAuthenticated'](),controller[_0xf420('0x14')]);router[_0xf420('0x13')](_0xf420('0x15'),auth['isAuthenticated'](),controller[_0xf420('0x16')]);var upload=multer({'storage':multer[_0xf420('0x17')]({'destination':function(_0x1cb842,_0x534eb1,_0x3f9d9f){_0x3f9d9f(null,path['join'](config[_0xf420('0x18')],_0xf420('0x19')));},'filename':function(_0x493e3e,_0x5dc7fb,_0x88a946){_0x88a946(null,util['format']('%s-%s',Date[_0xf420('0x1a')](),_0x5dc7fb[_0xf420('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf420('0x13')](_0xf420('0x1c'),upload[_0xf420('0x1d')]('file'),controller[_0xf420('0x1e')]);router[_0xf420('0x13')](_0xf420('0x1f'),auth[_0xf420('0xb')](),controller[_0xf420('0x20')]);router[_0xf420('0x13')]('/:id/tags',auth[_0xf420('0x7')](),interaction[_0xf420('0x21')](_0xf420('0x22'),_0xf420('0x23')),controller[_0xf420('0x24')]);router[_0xf420('0x25')](_0xf420('0xa'),auth[_0xf420('0x7')](),interaction[_0xf420('0x21')](_0xf420('0x22'),'chatinteraction:update'),controller[_0xf420('0x26')]);router['put'](_0xf420('0x27'),controller['customUpdate']);router[_0xf420('0x25')](_0xf420('0x28'),auth[_0xf420('0xb')](),controller[_0xf420('0x29')]);router['put'](_0xf420('0x2a'),controller['close']);router['delete'](_0xf420('0xa'),auth[_0xf420('0x7')](),interaction['tracked'](_0xf420('0x22'),_0xf420('0x2b')),controller[_0xf420('0x2c')]);router[_0xf420('0x2d')](_0xf420('0x2e'),auth[_0xf420('0x7')](),controller[_0xf420('0x2f')]);module[_0xf420('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d73d0fb..51132b0 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 _0x702b=['TEXT','sequelize','exports'];(function(_0x47731f,_0x3a9da0){var _0x8b287=function(_0x1ec657){while(--_0x1ec657){_0x47731f['push'](_0x47731f['shift']());}};_0x8b287(++_0x3a9da0);}(_0x702b,0xc1));var _0xb702=function(_0x52fab4,_0xd95117){_0x52fab4=_0x52fab4-0x0;var _0x142229=_0x702b[_0x52fab4];return _0x142229;};'use strict';var Sequelize=require(_0xb702('0x0'));module[_0xb702('0x1')]={'body':{'type':Sequelize[_0xb702('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xcbf0=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x55f562,_0x3f96c4){var _0x55922b=function(_0x246460){while(--_0x246460){_0x55f562['push'](_0x55f562['shift']());}};_0x55922b(++_0x3f96c4);}(_0xcbf0,0x12e));var _0x0cbf=function(_0x4ae340,_0x459aaa){_0x4ae340=_0x4ae340-0x0;var _0xfa456=_0xcbf0[_0x4ae340];return _0xfa456;};'use strict';var Sequelize=require(_0x0cbf('0x0'));module[_0x0cbf('0x1')]={'body':{'type':Sequelize[_0x0cbf('0x2')](_0x0cbf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0cbf('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0cbf('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 62b75c0..23c6c8d 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 _0xfca7=['body','describe','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','createdAt','ToId','read','-createdAt','all','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','status','end','json','undefined','limit','count','offset','Content-Range','save','update','then','destroy','sendStatus','error','name','index','map','ChatInternalMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','rawAttributes','find','create'];(function(_0x5137ee,_0x2a41dd){var _0x486cc1=function(_0x576200){while(--_0x576200){_0x5137ee['push'](_0x5137ee['shift']());}};_0x486cc1(++_0x2a41dd);}(_0xfca7,0x16e));var _0x7fca=function(_0x3ce1eb,_0x5b60a3){_0x3ce1eb=_0x3ce1eb-0x0;var _0x375bba=_0xfca7[_0x3ce1eb];return _0x375bba;};'use strict';var emlformat=require(_0x7fca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7fca('0x1'));var rp=require(_0x7fca('0x2'));var moment=require(_0x7fca('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7fca('0x4'));var path=require(_0x7fca('0x5'));var sox=require(_0x7fca('0x6'));var csv=require(_0x7fca('0x7'));var ejs=require(_0x7fca('0x8'));var fs=require('fs');var fs_extra=require(_0x7fca('0x9'));var _=require('lodash');var squel=require(_0x7fca('0xa'));var crypto=require(_0x7fca('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7fca('0xc'));var toCsv=require(_0x7fca('0x7'));var querystring=require(_0x7fca('0xd'));var Papa=require(_0x7fca('0xe'));var Redis=require(_0x7fca('0xf'));var authService=require(_0x7fca('0x10'));var qs=require(_0x7fca('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fca('0x12'));var logger=require('../../config/logger')(_0x7fca('0x13'));var utils=require(_0x7fca('0x14'));var config=require(_0x7fca('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fca('0x16'))['db'];config[_0x7fca('0x17')]=_[_0x7fca('0x18')](config[_0x7fca('0x17')],{'host':_0x7fca('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fca('0x17')]));require(_0x7fca('0x1a'))[_0x7fca('0x1b')](socket);function respondWithStatusCode(_0x33c69a,_0x451668){_0x451668=_0x451668||0xcc;return function(_0x5c9bf9){if(_0x5c9bf9){return _0x33c69a['sendStatus'](_0x451668);}return _0x33c69a[_0x7fca('0x1c')](_0x451668)[_0x7fca('0x1d')]();};}function respondWithResult(_0x7e2f8b,_0x59fd64){_0x59fd64=_0x59fd64||0xc8;return function(_0x15b839){if(_0x15b839){return _0x7e2f8b['status'](_0x59fd64)[_0x7fca('0x1e')](_0x15b839);}};}function respondWithFilteredResult(_0x3d2f68,_0x565f89){return function(_0x38ce71){if(_0x38ce71){var _0x34cbc0=typeof _0x565f89['offset']===_0x7fca('0x1f')&&typeof _0x565f89[_0x7fca('0x20')]===_0x7fca('0x1f');var _0x35841e=_0x38ce71[_0x7fca('0x21')];var _0x5d87c4=_0x34cbc0?0x0:_0x565f89[_0x7fca('0x22')];var _0x257d3e=_0x34cbc0?_0x38ce71['count']:_0x565f89['offset']+_0x565f89[_0x7fca('0x20')];var _0x51b6f3;if(_0x257d3e>=_0x35841e){_0x257d3e=_0x35841e;_0x51b6f3=0xc8;}else{_0x51b6f3=0xce;}_0x3d2f68[_0x7fca('0x1c')](_0x51b6f3);return _0x3d2f68['set'](_0x7fca('0x23'),_0x5d87c4+'-'+_0x257d3e+'/'+_0x35841e)['json'](_0x38ce71);}return null;};}function patchUpdates(_0x3615aa){return function(_0x589364){try{jsonpatch['apply'](_0x589364,_0x3615aa,!![]);}catch(_0x3d6572){return BPromise['reject'](_0x3d6572);}return _0x589364[_0x7fca('0x24')]();};}function saveUpdates(_0x573434,_0x481812){return function(_0x1851b5){if(_0x1851b5){return _0x1851b5[_0x7fca('0x25')](_0x573434)[_0x7fca('0x26')](function(_0x36a057){return _0x36a057;});}return null;};}function removeEntity(_0x6a0461,_0x18f7a8){return function(_0x4fa7df){if(_0x4fa7df){return _0x4fa7df[_0x7fca('0x27')]()['then'](function(){_0x6a0461[_0x7fca('0x1c')](0xcc)[_0x7fca('0x1d')]();});}};}function handleEntityNotFound(_0x3d3458,_0x5c8748){return function(_0x43355e){if(!_0x43355e){_0x3d3458[_0x7fca('0x28')](0x194);}return _0x43355e;};}function handleError(_0x4da97d,_0x48a4c4){_0x48a4c4=_0x48a4c4||0x1f4;return function(_0x23118a){logger[_0x7fca('0x29')](_0x23118a['stack']);if(_0x23118a[_0x7fca('0x2a')]){delete _0x23118a[_0x7fca('0x2a')];}_0x4da97d[_0x7fca('0x1c')](_0x48a4c4)['send'](_0x23118a);};}exports[_0x7fca('0x2b')]=function(_0x4f6a32,_0x58869a){var _0x4968fb={},_0x3a0670={},_0x4e5d4f={'count':0x0,'rows':[]};var _0x259d9d=_[_0x7fca('0x2c')](db[_0x7fca('0x2d')]['rawAttributes'],function(_0x24598d){return{'name':_0x24598d[_0x7fca('0x2e')],'type':_0x24598d[_0x7fca('0x2f')][_0x7fca('0x30')]};});_0x3a0670[_0x7fca('0x31')]=_['map'](_0x259d9d,_0x7fca('0x2a'));_0x3a0670[_0x7fca('0x32')]=_['keys'](_0x4f6a32['query']);_0x3a0670[_0x7fca('0x33')]=_[_0x7fca('0x34')](_0x3a0670[_0x7fca('0x31')],_0x3a0670[_0x7fca('0x32')]);_0x4968fb[_0x7fca('0x35')]=_[_0x7fca('0x34')](_0x3a0670[_0x7fca('0x31')],qs[_0x7fca('0x36')](_0x4f6a32[_0x7fca('0x32')][_0x7fca('0x36')]));_0x4968fb[_0x7fca('0x35')]=_0x4968fb[_0x7fca('0x35')][_0x7fca('0x37')]?_0x4968fb['attributes']:_0x3a0670[_0x7fca('0x31')];if(!_0x4f6a32[_0x7fca('0x32')]['hasOwnProperty'](_0x7fca('0x38'))){_0x4968fb[_0x7fca('0x20')]=qs[_0x7fca('0x20')](_0x4f6a32[_0x7fca('0x32')][_0x7fca('0x20')]);_0x4968fb['offset']=qs[_0x7fca('0x22')](_0x4f6a32[_0x7fca('0x32')]['offset']);}_0x4968fb[_0x7fca('0x39')]=qs[_0x7fca('0x3a')](_0x4f6a32[_0x7fca('0x32')][_0x7fca('0x3a')]);_0x4968fb[_0x7fca('0x3b')]=qs[_0x7fca('0x33')](_[_0x7fca('0x3c')](_0x4f6a32[_0x7fca('0x32')],_0x3a0670[_0x7fca('0x33')]),_0x259d9d);if(_0x4f6a32[_0x7fca('0x32')][_0x7fca('0x3d')]){_0x4968fb[_0x7fca('0x3b')]=_[_0x7fca('0x3e')](_0x4968fb[_0x7fca('0x3b')],{'$or':_['map'](_0x259d9d,function(_0x3366f3){if(_0x3366f3['type']!==_0x7fca('0x3f')){var _0x2d7c4a={};_0x2d7c4a[_0x3366f3[_0x7fca('0x2a')]]={'$like':'%'+_0x4f6a32['query'][_0x7fca('0x3d')]+'%'};return _0x2d7c4a;}})});}_0x4968fb=_[_0x7fca('0x3e')]({},_0x4968fb,_0x4f6a32[_0x7fca('0x40')]);var _0x39737c={'where':_0x4968fb[_0x7fca('0x3b')]};return db[_0x7fca('0x2d')][_0x7fca('0x21')](_0x39737c)['then'](function(_0x256dc3){_0x4e5d4f[_0x7fca('0x21')]=_0x256dc3;if(_0x4f6a32[_0x7fca('0x32')][_0x7fca('0x41')]){_0x4968fb[_0x7fca('0x42')]=[{'all':!![]}];}return db[_0x7fca('0x2d')]['findAll'](_0x4968fb);})[_0x7fca('0x26')](function(_0x1b3303){_0x4e5d4f[_0x7fca('0x43')]=_0x1b3303;return _0x4e5d4f;})[_0x7fca('0x26')](respondWithFilteredResult(_0x58869a,_0x4968fb))[_0x7fca('0x44')](handleError(_0x58869a,null));};exports['show']=function(_0x4001d0,_0x31963a){var _0x4bb136={'raw':!![],'where':{'id':_0x4001d0[_0x7fca('0x45')]['id']}},_0xf77581={};_0xf77581[_0x7fca('0x31')]=_[_0x7fca('0x46')](db[_0x7fca('0x2d')][_0x7fca('0x47')]);_0xf77581[_0x7fca('0x32')]=_['keys'](_0x4001d0[_0x7fca('0x32')]);_0xf77581[_0x7fca('0x33')]=_[_0x7fca('0x34')](_0xf77581[_0x7fca('0x31')],_0xf77581['query']);_0x4bb136[_0x7fca('0x35')]=_[_0x7fca('0x34')](_0xf77581[_0x7fca('0x31')],qs['fields'](_0x4001d0[_0x7fca('0x32')]['fields']));_0x4bb136['attributes']=_0x4bb136['attributes'][_0x7fca('0x37')]?_0x4bb136['attributes']:_0xf77581[_0x7fca('0x31')];if(_0x4001d0[_0x7fca('0x32')][_0x7fca('0x41')]){_0x4bb136['include']=[{'all':!![]}];}_0x4bb136=_['merge']({},_0x4bb136,_0x4001d0[_0x7fca('0x40')]);return db['ChatInternalMessage'][_0x7fca('0x48')](_0x4bb136)['then'](handleEntityNotFound(_0x31963a,null))[_0x7fca('0x26')](respondWithResult(_0x31963a,null))['catch'](handleError(_0x31963a,null));};exports[_0x7fca('0x49')]=function(_0x47fb23,_0x281a9d){return db[_0x7fca('0x2d')][_0x7fca('0x49')](_0x47fb23[_0x7fca('0x4a')],{})['then'](respondWithResult(_0x281a9d,0xc9))[_0x7fca('0x44')](handleError(_0x281a9d,null));};exports[_0x7fca('0x25')]=function(_0x7746c6,_0x418978){if(_0x7746c6[_0x7fca('0x4a')]['id']){delete _0x7746c6[_0x7fca('0x4a')]['id'];}return db[_0x7fca('0x2d')]['find']({'where':{'id':_0x7746c6[_0x7fca('0x45')]['id']}})[_0x7fca('0x26')](handleEntityNotFound(_0x418978,null))[_0x7fca('0x26')](saveUpdates(_0x7746c6[_0x7fca('0x4a')],null))[_0x7fca('0x26')](respondWithResult(_0x418978,null))[_0x7fca('0x44')](handleError(_0x418978,null));};exports[_0x7fca('0x27')]=function(_0x513a5d,_0x9834e1){return db[_0x7fca('0x2d')][_0x7fca('0x48')]({'where':{'id':_0x513a5d[_0x7fca('0x45')]['id']}})[_0x7fca('0x26')](handleEntityNotFound(_0x9834e1,null))['then'](removeEntity(_0x9834e1,null))[_0x7fca('0x44')](handleError(_0x9834e1,null));};exports[_0x7fca('0x4b')]=function(_0x64c28a,_0x4010c6){return db[_0x7fca('0x2d')]['describe']()[_0x7fca('0x26')](respondWithResult(_0x4010c6,null))[_0x7fca('0x44')](handleError(_0x4010c6,null));};function wrapUser(_0x15ca24){return function(_0x28fbf1){var _0x5175be=_0x15ca24['get']({'plain':!![]});_0x5175be[_0x7fca('0x4c')]=[];if(_0x28fbf1){_0x5175be['lastMessageAt']=_0x28fbf1['createdAt'];_0x5175be[_0x7fca('0x4d')]=_0x28fbf1;}else{_0x5175be[_0x7fca('0x4e')]=moment(0x0)[_0x7fca('0x4f')](_0x7fca('0x50'));_0x5175be[_0x7fca('0x4d')]={};}return _0x5175be;};}exports[_0x7fca('0x51')]=function(_0x270b67,_0x422611,_0x106142){var _0x5c24ec=[];return db[_0x7fca('0x52')][_0x7fca('0x53')]({'where':{'role':['agent',_0x7fca('0x54'),'user']},'attributes':['id',_0x7fca('0x55'),_0x7fca('0x2a'),_0x7fca('0x56'),_0x7fca('0x57'),_0x7fca('0x58'),_0x7fca('0x59'),_0x7fca('0x5a'),_0x7fca('0x5b'),_0x7fca('0x5c')],'order':qs[_0x7fca('0x3a')](_0x7fca('0x5d')),'include':[{'model':db[_0x7fca('0x5e')],'as':_0x7fca('0x5f'),'attributes':['id',_0x7fca('0x2a'),_0x7fca('0x2f')],'through':{'attributes':[]}}]})[_0x7fca('0x26')](function(_0x14c162){if(_0x14c162){var _0x362e32=_0x270b67[_0x7fca('0x60')][_0x7fca('0x61')]({'plain':!![]});if(!_0x362e32)throw new Error(_0x7fca('0x62'));if(_0x362e32[_0x7fca('0x56')]===_0x7fca('0x60')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x362e32['userProfileId']},'raw':!![]})[_0x7fca('0x26')](function(_0x2e75d2){if(_0x2e75d2){if(_0x2e75d2[_0x7fca('0x63')]===0x0){return db[_0x7fca('0x64')][_0x7fca('0x53')]({'where':{'sectionId':_0x2e75d2['id']},'raw':!![]})[_0x7fca('0x26')](function(_0x364bf1){var _0xc51520=[];if(_[_0x7fca('0x65')](_0x364bf1)){_0xc51520=_[_0x7fca('0x3d')](_0x14c162,function(_0x919db8){if(_0x919db8['role']!==_0x7fca('0x66')){return _0x919db8;}});return _0xc51520;}else{for(var _0x25d2a9=0x0;_0x25d2a9<_0x14c162['length'];_0x25d2a9++){var _0x16e1b6=_0x14c162[_0x25d2a9];if(_0x16e1b6[_0x7fca('0x56')]===_0x7fca('0x66')){var _0x7672d6=_[_0x7fca('0x48')](_0x364bf1,function(_0xfe1f68){return _0xfe1f68[_0x7fca('0x67')]===_0x16e1b6['id'];});if(_0x7672d6)_0xc51520[_0x7fca('0x68')](_0x16e1b6);}else{_0xc51520['push'](_0x16e1b6);}}return _0xc51520;}});}else{return _0x14c162;}}else{var _0x5d2bfb=_[_0x7fca('0x3d')](_0x14c162,function(_0x1084df){if(_0x1084df[_0x7fca('0x56')]!==_0x7fca('0x66')){return _0x1084df;}});return _0x5d2bfb;}});}else{return _0x14c162;}}})['then'](function(_0x57160c){var _0x3aa2cd=[];if(_0x57160c){_0x5c24ec=_0x57160c;for(var _0x235806=0x0;_0x235806<_0x57160c[_0x7fca('0x37')];_0x235806+=0x1){_0x5c24ec[_0x235806]['messages']=[];_0x3aa2cd[_0x7fca('0x68')](db[_0x7fca('0x2d')]['find']({'where':{'FromId':[_0x270b67[_0x7fca('0x60')]['id'],_0x57160c[_0x235806]['id']],'ToId':[_0x270b67[_0x7fca('0x60')]['id'],_0x57160c[_0x235806]['id']],'ChatGroupId':null},'attributes':['id',_0x7fca('0x69'),'FromId',_0x7fca('0x6a'),_0x7fca('0x6b'),_0x7fca('0x4a')],'order':qs['sort'](_0x7fca('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7fca('0x26')](wrapUser(_0x57160c[_0x235806])));}return BPromise[_0x7fca('0x6d')](_0x3aa2cd);}return[];})[_0x7fca('0x26')](function(_0x9f4926){return{'rows':_0x9f4926,'count':_0x9f4926[_0x7fca('0x37')]};})[_0x7fca('0x26')](respondWithResult(_0x422611,null))[_0x7fca('0x44')](handleError(_0x422611,null));}; \ No newline at end of file +var _0x341f=['createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','fullname','role','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','push','messages','ToId','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','ejs','fs-extra','lodash','squel','crypto','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','defaults','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','then','includeAll','include','rows','catch','show','options','find','create','body','params','describe','get','lastMessageAt'];(function(_0x25d4ab,_0x307164){var _0x3b31f3=function(_0x12f56c){while(--_0x12f56c){_0x25d4ab['push'](_0x25d4ab['shift']());}};_0x3b31f3(++_0x307164);}(_0x341f,0xf5));var _0xf341=function(_0x2e2056,_0x2e55a0){_0x2e2056=_0x2e2056-0x0;var _0x235b7a=_0x341f[_0x2e2056];return _0x235b7a;};'use strict';var emlformat=require(_0xf341('0x0'));var rimraf=require(_0xf341('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf341('0x2'));var rp=require(_0xf341('0x3'));var moment=require(_0xf341('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf341('0x5'));var csv=require('to-csv');var ejs=require(_0xf341('0x6'));var fs=require('fs');var fs_extra=require(_0xf341('0x7'));var _=require(_0xf341('0x8'));var squel=require(_0xf341('0x9'));var crypto=require(_0xf341('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf341('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf341('0xc'));var Papa=require(_0xf341('0xd'));var Redis=require(_0xf341('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf341('0xf'));var as=require(_0xf341('0x10'));var hardwareService=require(_0xf341('0x11'));var logger=require(_0xf341('0x12'))(_0xf341('0x13'));var utils=require(_0xf341('0x14'));var config=require(_0xf341('0x15'));var licenseUtil=require(_0xf341('0x16'));var db=require(_0xf341('0x17'))['db'];config['redis']=_[_0xf341('0x18')](config[_0xf341('0x19')],{'host':_0xf341('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf341('0x19')]));require(_0xf341('0x1b'))[_0xf341('0x1c')](socket);function respondWithStatusCode(_0x2d244a,_0x124fa8){_0x124fa8=_0x124fa8||0xcc;return function(_0x4991de){if(_0x4991de){return _0x2d244a[_0xf341('0x1d')](_0x124fa8);}return _0x2d244a[_0xf341('0x1e')](_0x124fa8)[_0xf341('0x1f')]();};}function respondWithResult(_0x154018,_0x4ae94c){_0x4ae94c=_0x4ae94c||0xc8;return function(_0x360616){if(_0x360616){return _0x154018[_0xf341('0x1e')](_0x4ae94c)[_0xf341('0x20')](_0x360616);}};}function respondWithFilteredResult(_0x2ff88e,_0x47d2ef){return function(_0x1d2832){if(_0x1d2832){var _0x26e3a1=typeof _0x47d2ef[_0xf341('0x21')]===_0xf341('0x22')&&typeof _0x47d2ef[_0xf341('0x23')]==='undefined';var _0x4d6757=_0x1d2832['count'];var _0x442ceb=_0x26e3a1?0x0:_0x47d2ef[_0xf341('0x21')];var _0x909f85=_0x26e3a1?_0x1d2832['count']:_0x47d2ef[_0xf341('0x21')]+_0x47d2ef[_0xf341('0x23')];var _0xc4ec7;if(_0x909f85>=_0x4d6757){_0x909f85=_0x4d6757;_0xc4ec7=0xc8;}else{_0xc4ec7=0xce;}_0x2ff88e[_0xf341('0x1e')](_0xc4ec7);return _0x2ff88e['set'](_0xf341('0x24'),_0x442ceb+'-'+_0x909f85+'/'+_0x4d6757)[_0xf341('0x20')](_0x1d2832);}return null;};}function patchUpdates(_0x7b1731){return function(_0x1b640c){try{jsonpatch[_0xf341('0x25')](_0x1b640c,_0x7b1731,!![]);}catch(_0x2f4566){return BPromise['reject'](_0x2f4566);}return _0x1b640c[_0xf341('0x26')]();};}function saveUpdates(_0x5b4f30,_0x46c4fc){return function(_0x1f3b08){if(_0x1f3b08){return _0x1f3b08[_0xf341('0x27')](_0x5b4f30)['then'](function(_0x5490a2){return _0x5490a2;});}return null;};}function removeEntity(_0x3fa14b,_0x12e5bf){return function(_0x4d4903){if(_0x4d4903){return _0x4d4903[_0xf341('0x28')]()['then'](function(){_0x3fa14b[_0xf341('0x1e')](0xcc)[_0xf341('0x1f')]();});}};}function handleEntityNotFound(_0x268575,_0x47245a){return function(_0x5c6ce1){if(!_0x5c6ce1){_0x268575[_0xf341('0x1d')](0x194);}return _0x5c6ce1;};}function handleError(_0x38c835,_0x4ff47f){_0x4ff47f=_0x4ff47f||0x1f4;return function(_0x3c65b6){logger[_0xf341('0x29')](_0x3c65b6[_0xf341('0x2a')]);if(_0x3c65b6['name']){delete _0x3c65b6[_0xf341('0x2b')];}_0x38c835[_0xf341('0x1e')](_0x4ff47f)[_0xf341('0x2c')](_0x3c65b6);};}exports[_0xf341('0x2d')]=function(_0x2b3a48,_0x3fdbec){var _0x2037b5={},_0x39bdb4={},_0x50509c={'count':0x0,'rows':[]};var _0xc91abb=_[_0xf341('0x2e')](db[_0xf341('0x2f')][_0xf341('0x30')],function(_0x53d02f){return{'name':_0x53d02f[_0xf341('0x31')],'type':_0x53d02f[_0xf341('0x32')][_0xf341('0x33')]};});_0x39bdb4[_0xf341('0x34')]=_[_0xf341('0x2e')](_0xc91abb,'name');_0x39bdb4[_0xf341('0x35')]=_[_0xf341('0x36')](_0x2b3a48['query']);_0x39bdb4[_0xf341('0x37')]=_[_0xf341('0x38')](_0x39bdb4[_0xf341('0x34')],_0x39bdb4[_0xf341('0x35')]);_0x2037b5['attributes']=_[_0xf341('0x38')](_0x39bdb4[_0xf341('0x34')],qs[_0xf341('0x39')](_0x2b3a48[_0xf341('0x35')][_0xf341('0x39')]));_0x2037b5[_0xf341('0x3a')]=_0x2037b5[_0xf341('0x3a')]['length']?_0x2037b5['attributes']:_0x39bdb4['model'];if(!_0x2b3a48[_0xf341('0x35')][_0xf341('0x3b')](_0xf341('0x3c'))){_0x2037b5[_0xf341('0x23')]=qs['limit'](_0x2b3a48['query'][_0xf341('0x23')]);_0x2037b5[_0xf341('0x21')]=qs['offset'](_0x2b3a48[_0xf341('0x35')][_0xf341('0x21')]);}_0x2037b5[_0xf341('0x3d')]=qs[_0xf341('0x3e')](_0x2b3a48[_0xf341('0x35')]['sort']);_0x2037b5[_0xf341('0x3f')]=qs['filters'](_[_0xf341('0x40')](_0x2b3a48[_0xf341('0x35')],_0x39bdb4['filters']),_0xc91abb);if(_0x2b3a48['query'][_0xf341('0x41')]){_0x2037b5[_0xf341('0x3f')]=_[_0xf341('0x42')](_0x2037b5[_0xf341('0x3f')],{'$or':_[_0xf341('0x2e')](_0xc91abb,function(_0xd4e5e9){if(_0xd4e5e9[_0xf341('0x32')]!=='VIRTUAL'){var _0x24e036={};_0x24e036[_0xd4e5e9[_0xf341('0x2b')]]={'$like':'%'+_0x2b3a48[_0xf341('0x35')][_0xf341('0x41')]+'%'};return _0x24e036;}})});}_0x2037b5=_[_0xf341('0x42')]({},_0x2037b5,_0x2b3a48['options']);var _0x3d943e={'where':_0x2037b5['where']};return db[_0xf341('0x2f')][_0xf341('0x43')](_0x3d943e)[_0xf341('0x44')](function(_0x44c8a3){_0x50509c[_0xf341('0x43')]=_0x44c8a3;if(_0x2b3a48[_0xf341('0x35')][_0xf341('0x45')]){_0x2037b5[_0xf341('0x46')]=[{'all':!![]}];}return db[_0xf341('0x2f')]['findAll'](_0x2037b5);})[_0xf341('0x44')](function(_0x46e5d6){_0x50509c[_0xf341('0x47')]=_0x46e5d6;return _0x50509c;})[_0xf341('0x44')](respondWithFilteredResult(_0x3fdbec,_0x2037b5))[_0xf341('0x48')](handleError(_0x3fdbec,null));};exports[_0xf341('0x49')]=function(_0x275a2c,_0x5c7df7){var _0x4d109a={'raw':!![],'where':{'id':_0x275a2c['params']['id']}},_0x49b93c={};_0x49b93c[_0xf341('0x34')]=_[_0xf341('0x36')](db['ChatInternalMessage'][_0xf341('0x30')]);_0x49b93c[_0xf341('0x35')]=_[_0xf341('0x36')](_0x275a2c[_0xf341('0x35')]);_0x49b93c['filters']=_['intersection'](_0x49b93c[_0xf341('0x34')],_0x49b93c[_0xf341('0x35')]);_0x4d109a[_0xf341('0x3a')]=_[_0xf341('0x38')](_0x49b93c['model'],qs[_0xf341('0x39')](_0x275a2c[_0xf341('0x35')]['fields']));_0x4d109a['attributes']=_0x4d109a[_0xf341('0x3a')]['length']?_0x4d109a['attributes']:_0x49b93c[_0xf341('0x34')];if(_0x275a2c[_0xf341('0x35')][_0xf341('0x45')]){_0x4d109a[_0xf341('0x46')]=[{'all':!![]}];}_0x4d109a=_[_0xf341('0x42')]({},_0x4d109a,_0x275a2c[_0xf341('0x4a')]);return db[_0xf341('0x2f')][_0xf341('0x4b')](_0x4d109a)[_0xf341('0x44')](handleEntityNotFound(_0x5c7df7,null))[_0xf341('0x44')](respondWithResult(_0x5c7df7,null))[_0xf341('0x48')](handleError(_0x5c7df7,null));};exports[_0xf341('0x4c')]=function(_0x4e8254,_0x47792b){return db[_0xf341('0x2f')]['create'](_0x4e8254[_0xf341('0x4d')],{})['then'](respondWithResult(_0x47792b,0xc9))[_0xf341('0x48')](handleError(_0x47792b,null));};exports['update']=function(_0x538a3d,_0x37e83a){if(_0x538a3d[_0xf341('0x4d')]['id']){delete _0x538a3d['body']['id'];}return db['ChatInternalMessage'][_0xf341('0x4b')]({'where':{'id':_0x538a3d['params']['id']}})['then'](handleEntityNotFound(_0x37e83a,null))[_0xf341('0x44')](saveUpdates(_0x538a3d[_0xf341('0x4d')],null))['then'](respondWithResult(_0x37e83a,null))[_0xf341('0x48')](handleError(_0x37e83a,null));};exports[_0xf341('0x28')]=function(_0x2a6460,_0x3735d4){return db[_0xf341('0x2f')][_0xf341('0x4b')]({'where':{'id':_0x2a6460[_0xf341('0x4e')]['id']}})[_0xf341('0x44')](handleEntityNotFound(_0x3735d4,null))[_0xf341('0x44')](removeEntity(_0x3735d4,null))[_0xf341('0x48')](handleError(_0x3735d4,null));};exports[_0xf341('0x4f')]=function(_0x53efd0,_0x30f58e){return db[_0xf341('0x2f')][_0xf341('0x4f')]()[_0xf341('0x44')](respondWithResult(_0x30f58e,null))[_0xf341('0x48')](handleError(_0x30f58e,null));};function wrapUser(_0x3d9da3){return function(_0x2df7cf){var _0x3066fa=_0x3d9da3[_0xf341('0x50')]({'plain':!![]});_0x3066fa['messages']=[];if(_0x2df7cf){_0x3066fa[_0xf341('0x51')]=_0x2df7cf[_0xf341('0x52')];_0x3066fa[_0xf341('0x53')]=_0x2df7cf;}else{_0x3066fa[_0xf341('0x51')]=moment(0x0)[_0xf341('0x54')](_0xf341('0x55'));_0x3066fa['lastMessage']={};}return _0x3066fa;};}exports['getUsers']=function(_0x25ed74,_0x410aaf,_0x3ccbdb){var _0x164987=[];return db[_0xf341('0x56')][_0xf341('0x57')]({'where':{'role':[_0xf341('0x58'),_0xf341('0x59'),'user']},'attributes':['id',_0xf341('0x5a'),_0xf341('0x2b'),_0xf341('0x5b'),'userpic',_0xf341('0x5c'),'online',_0xf341('0x5d'),_0xf341('0x5e'),_0xf341('0x5f')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xf341('0x60'),'attributes':['id',_0xf341('0x2b'),_0xf341('0x32')],'through':{'attributes':[]}}]})[_0xf341('0x44')](function(_0x55eda7){if(_0x55eda7){var _0x319be2=_0x25ed74[_0xf341('0x61')][_0xf341('0x50')]({'plain':!![]});if(!_0x319be2)throw new Error(_0xf341('0x62'));if(_0x319be2[_0xf341('0x5b')]===_0xf341('0x61')){return db['UserProfileSection'][_0xf341('0x4b')]({'where':{'name':'Agents','userProfileId':_0x319be2[_0xf341('0x63')]},'raw':!![]})['then'](function(_0x4f9b30){if(_0x4f9b30){if(_0x4f9b30[_0xf341('0x64')]===0x0){return db[_0xf341('0x65')][_0xf341('0x57')]({'where':{'sectionId':_0x4f9b30['id']},'raw':!![]})['then'](function(_0x5bfd26){var _0x413f87=[];if(_[_0xf341('0x66')](_0x5bfd26)){_0x413f87=_[_0xf341('0x41')](_0x55eda7,function(_0x1f1f20){if(_0x1f1f20['role']!==_0xf341('0x58')){return _0x1f1f20;}});return _0x413f87;}else{for(var _0x192c69=0x0;_0x192c69<_0x55eda7[_0xf341('0x67')];_0x192c69++){var _0x13ba0c=_0x55eda7[_0x192c69];if(_0x13ba0c[_0xf341('0x5b')]==='agent'){var _0x14b84b=_['find'](_0x5bfd26,function(_0x45edea){return _0x45edea['resourceId']===_0x13ba0c['id'];});if(_0x14b84b)_0x413f87[_0xf341('0x68')](_0x13ba0c);}else{_0x413f87['push'](_0x13ba0c);}}return _0x413f87;}});}else{return _0x55eda7;}}else{var _0x7bb594=_[_0xf341('0x41')](_0x55eda7,function(_0x5d8340){if(_0x5d8340[_0xf341('0x5b')]!==_0xf341('0x58')){return _0x5d8340;}});return _0x7bb594;}});}else{return _0x55eda7;}}})['then'](function(_0x26d95f){var _0x2dc6d2=[];if(_0x26d95f){_0x164987=_0x26d95f;for(var _0x2c4e78=0x0;_0x2c4e78<_0x26d95f[_0xf341('0x67')];_0x2c4e78+=0x1){_0x164987[_0x2c4e78][_0xf341('0x69')]=[];_0x2dc6d2[_0xf341('0x68')](db[_0xf341('0x2f')][_0xf341('0x4b')]({'where':{'FromId':[_0x25ed74['user']['id'],_0x26d95f[_0x2c4e78]['id']],'ToId':[_0x25ed74[_0xf341('0x61')]['id'],_0x26d95f[_0x2c4e78]['id']],'ChatGroupId':null},'attributes':['id',_0xf341('0x52'),'FromId',_0xf341('0x6a'),'read',_0xf341('0x4d')],'order':qs['sort'](_0xf341('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf341('0x44')](wrapUser(_0x26d95f[_0x2c4e78])));}return BPromise[_0xf341('0x6c')](_0x2dc6d2);}return[];})[_0xf341('0x44')](function(_0x348e21){return{'rows':_0x348e21,'count':_0x348e21[_0xf341('0x67')]};})[_0xf341('0x44')](respondWithResult(_0x410aaf,null))[_0xf341('0x48')](handleError(_0x410aaf,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 3f01f7a..2e5e30f 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 _0x54a2=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage'];(function(_0x5c7752,_0x42c547){var _0x4f3de0=function(_0x2c60fe){while(--_0x2c60fe){_0x5c7752['push'](_0x5c7752['shift']());}};_0x4f3de0(++_0x42c547);}(_0x54a2,0x10c));var _0x254a=function(_0x5e1aa5,_0x35d6e9){_0x5e1aa5=_0x5e1aa5-0x0;var _0x2c4704=_0x54a2[_0x5e1aa5];return _0x2c4704;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x254a('0x0'))['db'][_0x254a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x254a('0x2')](0x0);var events={'afterCreate':_0x254a('0x3'),'afterUpdate':_0x254a('0x4'),'afterDestroy':_0x254a('0x5')};function emitEvent(_0x4f2ca4){return function(_0x75ff6,_0x3fb21a,_0x5ced29){ChatInternalMessageEvents[_0x254a('0x6')](_0x4f2ca4+':'+_0x75ff6['id'],_0x75ff6);ChatInternalMessageEvents[_0x254a('0x6')](_0x4f2ca4,_0x75ff6);_0x5ced29(null);};}for(var e in events){if(events[_0x254a('0x7')](e)){var event=events[e];ChatInternalMessage[_0x254a('0x8')](e,emitEvent(event));}}module[_0x254a('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x254e=['ChatInternalMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5c66c1,_0x31eafd){var _0x54ffd2=function(_0x3141dd){while(--_0x3141dd){_0x5c66c1['push'](_0x5c66c1['shift']());}};_0x54ffd2(++_0x31eafd);}(_0x254e,0x19c));var _0xe254=function(_0x214de5,_0x2662e9){_0x214de5=_0x214de5-0x0;var _0x808650=_0x254e[_0x214de5];return _0x808650;};'use strict';var EventEmitter=require(_0xe254('0x0'));var ChatInternalMessage=require(_0xe254('0x1'))['db'][_0xe254('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe254('0x3'),'afterUpdate':_0xe254('0x4'),'afterDestroy':_0xe254('0x5')};function emitEvent(_0x4defa5){return function(_0xfe5d3d,_0x33bb5b,_0x4c4775){ChatInternalMessageEvents[_0xe254('0x6')](_0x4defa5+':'+_0xfe5d3d['id'],_0xfe5d3d);ChatInternalMessageEvents[_0xe254('0x6')](_0x4defa5,_0xfe5d3d);_0x4c4775(null);};}for(var e in events){if(events[_0xe254('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xe254('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 f9969fb..5cc0ac6 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 _0x2779=['../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','lodash','util','../../config/logger','request-promise'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x2779,0x9e));var _0x9277=function(_0x381abc,_0x298141){_0x381abc=_0x381abc-0x0;var _0x3b57f9=_0x2779[_0x381abc];return _0x3b57f9;};'use strict';var _=require(_0x9277('0x0'));var util=require(_0x9277('0x1'));var logger=require(_0x9277('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9277('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9277('0x4'));var attributes=require(_0x9277('0x5'));module[_0x9277('0x6')]=function(_0x1864f3,_0x2aa23b){return _0x1864f3[_0x9277('0x7')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9277('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xea88=['chat_internal_messages','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0xea88,0x106));var _0x8ea8=function(_0x47abd5,_0x522f85){_0x47abd5=_0x47abd5-0x0;var _0x35bb61=_0xea88[_0x47abd5];return _0x35bb61;};'use strict';var _=require(_0x8ea8('0x0'));var util=require('util');var logger=require(_0x8ea8('0x1'))(_0x8ea8('0x2'));var moment=require(_0x8ea8('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ea8('0x4'));var fs=require('fs');var path=require(_0x8ea8('0x5'));var rimraf=require(_0x8ea8('0x6'));var config=require(_0x8ea8('0x7'));var attributes=require(_0x8ea8('0x8'));module['exports']=function(_0x4504d8,_0x2e884a){return _0x4504d8[_0x8ea8('0x9')](_0x8ea8('0xa'),attributes,{'tableName':_0x8ea8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ea8('0xc'),'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 04bb914..90b4e4b 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 _0x59e4=['http','redis','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x5842c3,_0x56bd74){var _0x44bf8c=function(_0x79551f){while(--_0x79551f){_0x5842c3['push'](_0x5842c3['shift']());}};_0x44bf8c(++_0x56bd74);}(_0x59e4,0x1a8));var _0x459e=function(_0x2fb0e5,_0x45e57a){_0x2fb0e5=_0x2fb0e5-0x0;var _0x584d1f=_0x59e4[_0x2fb0e5];return _0x584d1f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x459e('0x0'));var BPromise=require(_0x459e('0x1'));var rs=require(_0x459e('0x2'));var fs=require('fs');var Redis=require(_0x459e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x459e('0x4'))(_0x459e('0x5'));var config=require('../../config/environment');var jayson=require(_0x459e('0x6'));var client=jayson[_0x459e('0x7')][_0x459e('0x8')]({'port':0x232a});config[_0x459e('0x9')]=_['defaults'](config[_0x459e('0x9')],{'host':_0x459e('0xa'),'port':0x18eb});var socket=require(_0x459e('0xb'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0xd0a100,_0x5bc0f2,_0x41bf82){return new BPromise(function(_0x504767,_0x169a3b){return client[_0x459e('0xc')](_0xd0a100,_0x41bf82)[_0x459e('0xd')](function(_0x5cceed){logger[_0x459e('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x5bc0f2,'request\x20sent');logger['debug'](_0x459e('0xf'),_0x5bc0f2,_0x459e('0x10'),JSON[_0x459e('0x11')](_0x5cceed));if(_0x5cceed[_0x459e('0x12')]){if(_0x5cceed[_0x459e('0x12')][_0x459e('0x13')]===0x1f4){logger['error'](_0x459e('0x14'),_0x5bc0f2,_0x5cceed[_0x459e('0x12')][_0x459e('0x15')]);return _0x169a3b(_0x5cceed['error']['message']);}logger[_0x459e('0x12')](_0x459e('0x14'),_0x5bc0f2,_0x5cceed[_0x459e('0x12')][_0x459e('0x15')]);return _0x504767(_0x5cceed[_0x459e('0x12')][_0x459e('0x15')]);}else{logger['info'](_0x459e('0x14'),_0x5bc0f2,_0x459e('0x10'));_0x504767(_0x5cceed[_0x459e('0x16')][_0x459e('0x15')]);}})[_0x459e('0x17')](function(_0x5f064b){logger[_0x459e('0x12')](_0x459e('0x14'),_0x5bc0f2,_0x5f064b);_0x169a3b(_0x5f064b);});});} \ No newline at end of file +var _0xdafa=['jayson/promise','redis','localhost','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0xdafa,0x1c5));var _0xadaf=function(_0x42951e,_0x3ecd95){_0x42951e=_0x42951e-0x0;var _0x3cf693=_0xdafa[_0x42951e];return _0x3cf693;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xadaf('0x0'));var rs=require(_0xadaf('0x1'));var fs=require('fs');var Redis=require(_0xadaf('0x2'));var db=require(_0xadaf('0x3'))['db'];var utils=require(_0xadaf('0x4'));var logger=require(_0xadaf('0x5'))(_0xadaf('0x6'));var config=require('../../config/environment');var jayson=require(_0xadaf('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xadaf('0x8')]=_['defaults'](config[_0xadaf('0x8')],{'host':_0xadaf('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadaf('0x8')]));require(_0xadaf('0xa'))[_0xadaf('0xb')](socket);function respondWithRpcPromise(_0x5a5886,_0x1a08e5,_0x2cd59f){return new BPromise(function(_0x38a83b,_0x11c061){return client[_0xadaf('0xc')](_0x5a5886,_0x2cd59f)['then'](function(_0x3329ca){logger[_0xadaf('0xd')](_0xadaf('0xe'),_0x1a08e5,_0xadaf('0xf'));logger['debug'](_0xadaf('0x10'),_0x1a08e5,_0xadaf('0xf'),JSON[_0xadaf('0x11')](_0x3329ca));if(_0x3329ca['error']){if(_0x3329ca[_0xadaf('0x12')][_0xadaf('0x13')]===0x1f4){logger[_0xadaf('0x12')](_0xadaf('0xe'),_0x1a08e5,_0x3329ca[_0xadaf('0x12')][_0xadaf('0x14')]);return _0x11c061(_0x3329ca[_0xadaf('0x12')]['message']);}logger[_0xadaf('0x12')](_0xadaf('0xe'),_0x1a08e5,_0x3329ca['error'][_0xadaf('0x14')]);return _0x38a83b(_0x3329ca['error'][_0xadaf('0x14')]);}else{logger['info'](_0xadaf('0xe'),_0x1a08e5,_0xadaf('0xf'));_0x38a83b(_0x3329ca[_0xadaf('0x15')][_0xadaf('0x14')]);}})[_0xadaf('0x16')](function(_0x32506f){logger[_0xadaf('0x12')](_0xadaf('0xe'),_0x1a08e5,_0x32506f);_0x11c061(_0x32506f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 1013354..c45379b 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 _0xe58d=['remove','update','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x1225b7,_0x1ca4a1){var _0x2f6aac=function(_0x4e50cc){while(--_0x4e50cc){_0x1225b7['push'](_0x1225b7['shift']());}};_0x2f6aac(++_0x1ca4a1);}(_0xe58d,0x86));var _0xde58=function(_0x4d7bbe,_0x216928){_0x4d7bbe=_0x4d7bbe-0x0;var _0x53c370=_0xe58d[_0x4d7bbe];return _0x53c370;};'use strict';var ChatInternalMessageEvents=require(_0xde58('0x0'));var events=[_0xde58('0x1'),_0xde58('0x2'),_0xde58('0x3')];function createListener(_0x163adb,_0x48b067){return function(_0x3bbd1e){_0x48b067[_0xde58('0x4')](_0x163adb,_0x3bbd1e);};}function removeListener(_0x3f23b7,_0x127c6d){return function(){ChatInternalMessageEvents[_0xde58('0x5')](_0x3f23b7,_0x127c6d);};}exports[_0xde58('0x6')]=function(_0x25d01d){for(var _0x4b4ff7=0x0,_0x2c8ea1=events[_0xde58('0x7')];_0x4b4ff7<_0x2c8ea1;_0x4b4ff7++){var _0x162efb=events[_0x4b4ff7];var _0x408a13=createListener('chatInternalMessage:'+_0x162efb,_0x25d01d);ChatInternalMessageEvents['on'](_0x162efb,_0x408a13);}}; \ No newline at end of file +var _0xca97=['register','length','chatInternalMessage:','save','remove','update','emit','removeListener'];(function(_0x3b2e06,_0x4f2695){var _0x53fa2d=function(_0xc94883){while(--_0xc94883){_0x3b2e06['push'](_0x3b2e06['shift']());}};_0x53fa2d(++_0x4f2695);}(_0xca97,0x163));var _0x7ca9=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xca97[_0x5ddb1c];return _0x354adc;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x7ca9('0x0'),_0x7ca9('0x1'),_0x7ca9('0x2')];function createListener(_0x237aca,_0xbb63a0){return function(_0x3267ff){_0xbb63a0[_0x7ca9('0x3')](_0x237aca,_0x3267ff);};}function removeListener(_0x4d241f,_0x584cf1){return function(){ChatInternalMessageEvents[_0x7ca9('0x4')](_0x4d241f,_0x584cf1);};}exports[_0x7ca9('0x5')]=function(_0x3616c5){for(var _0x556181=0x0,_0x9e2e3=events[_0x7ca9('0x6')];_0x556181<_0x9e2e3;_0x556181++){var _0x1eeeeb=events[_0x556181];var _0x40f1a6=createListener(_0x7ca9('0x7')+_0x1eeeeb,_0x3616c5);ChatInternalMessageEvents['on'](_0x1eeeeb,_0x40f1a6);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index daa12d8..36372e0 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 _0xa30b=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','getUsers','/:id','show','create','put','update','destroy','exports','multer'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa30b,0x1a3));var _0xba30=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa30b[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xba30('0x0'));var util=require('util');var path=require(_0xba30('0x1'));var timeout=require(_0xba30('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xba30('0x3'));var auth=require(_0xba30('0x4'));var interaction=require(_0xba30('0x5'));var config=require(_0xba30('0x6'));var controller=require(_0xba30('0x7'));router[_0xba30('0x8')]('/',auth[_0xba30('0x9')](),controller['index']);router[_0xba30('0x8')](_0xba30('0xa'),auth[_0xba30('0x9')](),controller['describe']);router['get'](_0xba30('0xb'),auth['isAuthenticated'](),controller[_0xba30('0xc')]);router['get'](_0xba30('0xd'),auth[_0xba30('0x9')](),controller[_0xba30('0xe')]);router['post']('/',auth[_0xba30('0x9')](),controller[_0xba30('0xf')]);router[_0xba30('0x10')](_0xba30('0xd'),controller[_0xba30('0x11')]);router['delete'](_0xba30('0xd'),auth[_0xba30('0x9')](),controller[_0xba30('0x12')]);module[_0xba30('0x13')]=router; \ No newline at end of file +var _0xd99c=['put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create'];(function(_0x17e0ff,_0x4dbd1e){var _0x357979=function(_0x443276){while(--_0x443276){_0x17e0ff['push'](_0x17e0ff['shift']());}};_0x357979(++_0x4dbd1e);}(_0xd99c,0x9d));var _0xcd99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd99c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcd99('0x0'));var util=require('util');var path=require(_0xcd99('0x1'));var timeout=require(_0xcd99('0x2'));var express=require(_0xcd99('0x3'));var router=express[_0xcd99('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcd99('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcd99('0x6'));var controller=require(_0xcd99('0x7'));router[_0xcd99('0x8')]('/',auth[_0xcd99('0x9')](),controller[_0xcd99('0xa')]);router['get'](_0xcd99('0xb'),auth['isAuthenticated'](),controller[_0xcd99('0xc')]);router['get'](_0xcd99('0xd'),auth['isAuthenticated'](),controller[_0xcd99('0xe')]);router[_0xcd99('0x8')](_0xcd99('0xf'),auth[_0xcd99('0x9')](),controller[_0xcd99('0x10')]);router[_0xcd99('0x11')]('/',auth[_0xcd99('0x9')](),controller[_0xcd99('0x12')]);router[_0xcd99('0x13')](_0xcd99('0xf'),controller['update']);router[_0xcd99('0x14')]('/:id',auth[_0xcd99('0x9')](),controller[_0xcd99('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b8e459b..b574437 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 _0x65c9=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x519f88,_0x3f24bb){var _0x26dbf1=function(_0x3db242){while(--_0x3db242){_0x519f88['push'](_0x519f88['shift']());}};_0x26dbf1(++_0x3f24bb);}(_0x65c9,0x182));var _0x965c=function(_0xe0a926,_0x3a3749){_0xe0a926=_0xe0a926-0x0;var _0x369e15=_0x65c9[_0xe0a926];return _0x369e15;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x965c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x965c('0x4')]('in',_0x965c('0x5')),'defaultValue':_0x965c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x965c('0x6')]},'providerName':{'type':Sequelize[_0x965c('0x7')]},'providerResponse':{'type':Sequelize[_0x965c('0x8')]}}; \ No newline at end of file +var _0xd0e4=['out','DATE','STRING','sequelize','exports','TEXT','medium','ENUM'];(function(_0x2d66b6,_0x38c46e){var _0x4649e7=function(_0x5230b1){while(--_0x5230b1){_0x2d66b6['push'](_0x2d66b6['shift']());}};_0x4649e7(++_0x38c46e);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x5b5960,_0x2bab09){_0x5b5960=_0x5b5960-0x0;var _0x16b671=_0xd0e4[_0x5b5960];return _0x16b671;};'use strict';var Sequelize=require(_0x4d0e('0x0'));module[_0x4d0e('0x1')]={'body':{'type':Sequelize[_0x4d0e('0x2')](_0x4d0e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4d0e('0x4')]('in',_0x4d0e('0x5')),'defaultValue':_0x4d0e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4d0e('0x6')]},'providerName':{'type':Sequelize[_0x4d0e('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 55bc9ba..578b454 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 _0xb128=['email','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','ChatMessage','findAll','rows','catch','show','params','find','create','body','describe','chat-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage'];(function(_0x3f553b,_0x49a9c2){var _0x183c4e=function(_0x873b22){while(--_0x873b22){_0x3f553b['push'](_0x3f553b['shift']());}};_0x183c4e(++_0x49a9c2);}(_0xb128,0x113));var _0x8b12=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xb128[_0x17406a];return _0x1501ff;};'use strict';var emlformat=require(_0x8b12('0x0'));var rimraf=require(_0x8b12('0x1'));var zipdir=require(_0x8b12('0x2'));var jsonpatch=require(_0x8b12('0x3'));var rp=require('request-promise');var moment=require(_0x8b12('0x4'));var BPromise=require(_0x8b12('0x5'));var Mustache=require(_0x8b12('0x6'));var util=require(_0x8b12('0x7'));var path=require('path');var sox=require(_0x8b12('0x8'));var csv=require(_0x8b12('0x9'));var ejs=require(_0x8b12('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b12('0xb'));var squel=require(_0x8b12('0xc'));var crypto=require(_0x8b12('0xd'));var jsforce=require(_0x8b12('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8b12('0xf'));var Papa=require(_0x8b12('0x10'));var Redis=require(_0x8b12('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8b12('0x12'));var hardwareService=require(_0x8b12('0x13'));var logger=require(_0x8b12('0x14'))(_0x8b12('0x15'));var utils=require(_0x8b12('0x16'));var config=require(_0x8b12('0x17'));var licenseUtil=require(_0x8b12('0x18'));var db=require(_0x8b12('0x19'))['db'];config[_0x8b12('0x1a')]=_[_0x8b12('0x1b')](config[_0x8b12('0x1a')],{'host':_0x8b12('0x1c'),'port':0x18eb});var socket=require(_0x8b12('0x1d'))(new Redis(config['redis']));require(_0x8b12('0x1e'))[_0x8b12('0x1f')](socket);var jayson=require(_0x8b12('0x20'));var client=jayson[_0x8b12('0x21')][_0x8b12('0x22')]({'port':0x232c});var client9002=jayson[_0x8b12('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f2dfc,_0x443812,_0x1e9d38,_0x66e93){return new BPromise(function(_0x50b0b9,_0x63ccd7){var _0x33af3e=_0x66e93||client;return _0x33af3e[_0x8b12('0x23')](_0x2f2dfc,_0x1e9d38)[_0x8b12('0x24')](function(_0x2893b8){logger[_0x8b12('0x25')]('ChatMessage,\x20%s,\x20%s',_0x443812,_0x8b12('0x26'));logger[_0x8b12('0x27')](_0x8b12('0x28'),_0x443812,_0x8b12('0x26'),JSON['stringify'](_0x2893b8));if(_0x2893b8['error']){if(_0x2893b8[_0x8b12('0x29')][_0x8b12('0x2a')]===0x1f4){logger['error'](_0x8b12('0x2b'),_0x443812,_0x2893b8['error'][_0x8b12('0x2c')]);return _0x63ccd7(_0x2893b8['error'][_0x8b12('0x2c')]);}logger['error'](_0x8b12('0x2b'),_0x443812,_0x2893b8[_0x8b12('0x29')][_0x8b12('0x2c')]);return _0x50b0b9(_0x2893b8['error']['message']);}else{logger[_0x8b12('0x25')](_0x8b12('0x2b'),_0x443812,_0x8b12('0x26'));_0x50b0b9(_0x2893b8[_0x8b12('0x2d')][_0x8b12('0x2c')]);}})['catch'](function(_0x4c38c1){logger[_0x8b12('0x29')]('ChatMessage,\x20%s,\x20%s',_0x443812,_0x4c38c1);_0x63ccd7(_0x4c38c1);});});}function respondWithStatusCode(_0x2eaec4,_0x41ac18){_0x41ac18=_0x41ac18||0xcc;return function(_0x2445d3){if(_0x2445d3){return _0x2eaec4['sendStatus'](_0x41ac18);}return _0x2eaec4[_0x8b12('0x2e')](_0x41ac18)['end']();};}function respondWithResult(_0x573a09,_0x510d12){_0x510d12=_0x510d12||0xc8;return function(_0x2d230e){if(_0x2d230e){return _0x573a09[_0x8b12('0x2e')](_0x510d12)[_0x8b12('0x2f')](_0x2d230e);}};}function respondWithFilteredResult(_0x4dd196,_0x598f43){return function(_0x59373e){if(_0x59373e){var _0x6818b6=typeof _0x598f43[_0x8b12('0x30')]===_0x8b12('0x31')&&typeof _0x598f43['limit']===_0x8b12('0x31');var _0x5c1f78=_0x59373e['count'];var _0x2cfe4a=_0x6818b6?0x0:_0x598f43[_0x8b12('0x30')];var _0x3246d7=_0x6818b6?_0x59373e['count']:_0x598f43[_0x8b12('0x30')]+_0x598f43[_0x8b12('0x32')];var _0x3bfc10;if(_0x3246d7>=_0x5c1f78){_0x3246d7=_0x5c1f78;_0x3bfc10=0xc8;}else{_0x3bfc10=0xce;}_0x4dd196[_0x8b12('0x2e')](_0x3bfc10);return _0x4dd196[_0x8b12('0x33')](_0x8b12('0x34'),_0x2cfe4a+'-'+_0x3246d7+'/'+_0x5c1f78)['json'](_0x59373e);}return null;};}function patchUpdates(_0xd2ebdb){return function(_0x56f241){try{jsonpatch['apply'](_0x56f241,_0xd2ebdb,!![]);}catch(_0x25bf04){return BPromise[_0x8b12('0x35')](_0x25bf04);}return _0x56f241[_0x8b12('0x36')]();};}function saveUpdates(_0x55ee00,_0x5993ce){return function(_0x46be35){if(_0x46be35){return _0x46be35[_0x8b12('0x37')](_0x55ee00)[_0x8b12('0x24')](function(_0x47ec3c){return _0x47ec3c;});}return null;};}function removeEntity(_0x4d8715,_0x3bbaf9){return function(_0x48d7c2){if(_0x48d7c2){return _0x48d7c2[_0x8b12('0x38')]()['then'](function(){_0x4d8715[_0x8b12('0x2e')](0xcc)[_0x8b12('0x39')]();});}};}function handleEntityNotFound(_0xeef792,_0x2ff925){return function(_0x527bb5){if(!_0x527bb5){_0xeef792[_0x8b12('0x3a')](0x194);}return _0x527bb5;};}function handleError(_0x4cc945,_0x1d329a){_0x1d329a=_0x1d329a||0x1f4;return function(_0x59ccdd){logger[_0x8b12('0x29')](_0x59ccdd[_0x8b12('0x3b')]);if(_0x59ccdd[_0x8b12('0x3c')]){delete _0x59ccdd[_0x8b12('0x3c')];}_0x4cc945[_0x8b12('0x2e')](_0x1d329a)[_0x8b12('0x3d')](_0x59ccdd);};}exports['index']=function(_0x275f54,_0x3c4bfa){var _0x12a795={},_0x2fe68b={},_0x1a564d={'count':0x0,'rows':[]};var _0x693844=_[_0x8b12('0x3e')](db['ChatMessage'][_0x8b12('0x3f')],function(_0x4ddfb1){return{'name':_0x4ddfb1[_0x8b12('0x40')],'type':_0x4ddfb1[_0x8b12('0x41')][_0x8b12('0x42')]};});_0x2fe68b[_0x8b12('0x43')]=_[_0x8b12('0x3e')](_0x693844,_0x8b12('0x3c'));_0x2fe68b[_0x8b12('0x44')]=_[_0x8b12('0x45')](_0x275f54[_0x8b12('0x44')]);_0x2fe68b[_0x8b12('0x46')]=_['intersection'](_0x2fe68b[_0x8b12('0x43')],_0x2fe68b['query']);_0x12a795[_0x8b12('0x47')]=_[_0x8b12('0x48')](_0x2fe68b[_0x8b12('0x43')],qs['fields'](_0x275f54['query'][_0x8b12('0x49')]));_0x12a795[_0x8b12('0x47')]=_0x12a795[_0x8b12('0x47')][_0x8b12('0x4a')]?_0x12a795[_0x8b12('0x47')]:_0x2fe68b['model'];if(!_0x275f54['query'][_0x8b12('0x4b')](_0x8b12('0x4c'))){_0x12a795['limit']=qs['limit'](_0x275f54['query']['limit']);_0x12a795[_0x8b12('0x30')]=qs[_0x8b12('0x30')](_0x275f54[_0x8b12('0x44')][_0x8b12('0x30')]);}_0x12a795[_0x8b12('0x4d')]=qs[_0x8b12('0x4e')](_0x275f54[_0x8b12('0x44')][_0x8b12('0x4e')]);_0x12a795[_0x8b12('0x4f')]=qs[_0x8b12('0x46')](_[_0x8b12('0x50')](_0x275f54['query'],_0x2fe68b[_0x8b12('0x46')]),_0x693844);if(_0x275f54[_0x8b12('0x44')][_0x8b12('0x51')]){_0x12a795[_0x8b12('0x4f')]=_['merge'](_0x12a795[_0x8b12('0x4f')],{'$or':_[_0x8b12('0x3e')](_0x693844,function(_0x530764){if(_0x530764[_0x8b12('0x41')]!=='VIRTUAL'){var _0xf70a9f={};_0xf70a9f[_0x530764[_0x8b12('0x3c')]]={'$like':'%'+_0x275f54['query']['filter']+'%'};return _0xf70a9f;}})});}_0x12a795=_[_0x8b12('0x52')]({},_0x12a795,_0x275f54[_0x8b12('0x53')]);var _0x5b097f={'where':_0x12a795[_0x8b12('0x4f')]};return db['ChatMessage'][_0x8b12('0x54')](_0x5b097f)[_0x8b12('0x24')](function(_0x494dc9){_0x1a564d[_0x8b12('0x54')]=_0x494dc9;if(_0x275f54[_0x8b12('0x44')][_0x8b12('0x55')]){_0x12a795[_0x8b12('0x56')]=[{'all':!![]}];}return db[_0x8b12('0x57')][_0x8b12('0x58')](_0x12a795);})[_0x8b12('0x24')](function(_0x5a0560){_0x1a564d[_0x8b12('0x59')]=_0x5a0560;return _0x1a564d;})[_0x8b12('0x24')](respondWithFilteredResult(_0x3c4bfa,_0x12a795))[_0x8b12('0x5a')](handleError(_0x3c4bfa,null));};exports[_0x8b12('0x5b')]=function(_0x5e0446,_0x7e8ea0){var _0x252aed={'raw':!![],'where':{'id':_0x5e0446[_0x8b12('0x5c')]['id']}},_0x20e862={};_0x20e862['model']=_[_0x8b12('0x45')](db[_0x8b12('0x57')]['rawAttributes']);_0x20e862[_0x8b12('0x44')]=_[_0x8b12('0x45')](_0x5e0446[_0x8b12('0x44')]);_0x20e862[_0x8b12('0x46')]=_[_0x8b12('0x48')](_0x20e862[_0x8b12('0x43')],_0x20e862['query']);_0x252aed['attributes']=_[_0x8b12('0x48')](_0x20e862[_0x8b12('0x43')],qs[_0x8b12('0x49')](_0x5e0446[_0x8b12('0x44')][_0x8b12('0x49')]));_0x252aed[_0x8b12('0x47')]=_0x252aed[_0x8b12('0x47')][_0x8b12('0x4a')]?_0x252aed['attributes']:_0x20e862[_0x8b12('0x43')];if(_0x5e0446[_0x8b12('0x44')][_0x8b12('0x55')]){_0x252aed['include']=[{'all':!![]}];}_0x252aed=_[_0x8b12('0x52')]({},_0x252aed,_0x5e0446[_0x8b12('0x53')]);return db[_0x8b12('0x57')][_0x8b12('0x5d')](_0x252aed)[_0x8b12('0x24')](handleEntityNotFound(_0x7e8ea0,null))[_0x8b12('0x24')](respondWithResult(_0x7e8ea0,null))[_0x8b12('0x5a')](handleError(_0x7e8ea0,null));};exports[_0x8b12('0x5e')]=function(_0x4dd753,_0x245acd){return db['ChatMessage'][_0x8b12('0x5e')](_0x4dd753['body'],{})['then'](respondWithResult(_0x245acd,0xc9))[_0x8b12('0x5a')](handleError(_0x245acd,null));};exports[_0x8b12('0x37')]=function(_0x479ec0,_0x998b47){if(_0x479ec0['body']['id']){delete _0x479ec0[_0x8b12('0x5f')]['id'];}return db[_0x8b12('0x57')][_0x8b12('0x5d')]({'where':{'id':_0x479ec0[_0x8b12('0x5c')]['id']}})[_0x8b12('0x24')](handleEntityNotFound(_0x998b47,null))[_0x8b12('0x24')](saveUpdates(_0x479ec0[_0x8b12('0x5f')],null))['then'](respondWithResult(_0x998b47,null))[_0x8b12('0x5a')](handleError(_0x998b47,null));};exports[_0x8b12('0x38')]=function(_0x1347b3,_0x2df5d8){return db[_0x8b12('0x57')][_0x8b12('0x5d')]({'where':{'id':_0x1347b3[_0x8b12('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2df5d8,null))[_0x8b12('0x24')](removeEntity(_0x2df5d8,null))[_0x8b12('0x5a')](handleError(_0x2df5d8,null));};exports[_0x8b12('0x60')]=function(_0x2a6773,_0x165928){return db[_0x8b12('0x57')]['describe']()['then'](respondWithResult(_0x165928,null))[_0x8b12('0x5a')](handleError(_0x165928,null));};var interaction_log=require('../../config/logger')(_0x8b12('0x61'));exports['accept']=function(_0x147373,_0x49446c,_0x4e161e){var _0x487686={'agent':{},'channel':'chat'};if(_0x147373[_0x8b12('0x5f')]['id']){delete _0x147373[_0x8b12('0x5f')]['id'];}_0x147373[_0x8b12('0x5f')]['read']=!![];_0x147373[_0x8b12('0x5f')][_0x8b12('0x62')]=moment()[_0x8b12('0x63')](_0x8b12('0x64'));_0x147373['body']['UserId']=_0x147373[_0x8b12('0x5f')][_0x8b12('0x65')]||_0x147373[_0x8b12('0x66')]['id'];_0x487686[_0x8b12('0x67')]['id']=_0x147373[_0x8b12('0x5f')][_0x8b12('0x65')];return db[_0x8b12('0x57')][_0x8b12('0x5d')]({'where':{'id':_0x147373[_0x8b12('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49446c,null))[_0x8b12('0x24')](saveUpdates(_0x147373[_0x8b12('0x5f')],null))[_0x8b12('0x24')](function(_0x118bc0){if(_0x118bc0){_0x487686[_0x8b12('0x2c')]=_0x118bc0[_0x8b12('0x68')]({'plain':!![]});return db[_0x8b12('0x69')][_0x8b12('0x5d')]({'where':{'id':_0x118bc0[_0x8b12('0x6a')]}});}return null;})[_0x8b12('0x24')](handleEntityNotFound(_0x49446c,null))['then'](function(_0x5db9e9){if(_0x5db9e9){return _0x5db9e9[_0x8b12('0x37')]({'UserId':_0x147373[_0x8b12('0x5f')][_0x8b12('0x65')],'read1stAt':_[_0x8b12('0x6b')](_0x5db9e9['read1stAt'])?moment()[_0x8b12('0x63')](_0x8b12('0x64')):undefined});}return null;})[_0x8b12('0x24')](function(_0x5f2435){if(_0x5f2435){_0x487686['interaction']=_0x5f2435[_0x8b12('0x68')]({'plain':!![]});interaction_log['info'](_0x8b12('0x6c'),_0x147373[_0x8b12('0x66')]['id'],_0x147373[_0x8b12('0x66')][_0x8b12('0x3c')],_0x147373['user'][_0x8b12('0x6d')],_0x487686[_0x8b12('0x6e')]['id'],_0x147373[_0x8b12('0x5f')]?JSON[_0x8b12('0x6f')](_0x147373[_0x8b12('0x5f')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x487686);}return null;})[_0x8b12('0x24')](function(_0x34501a){var _0xeca37e=_0x8b12('0x70')+_0x34501a['message'][_0x8b12('0x71')];return db['sequelize']['query'](_0xeca37e,{'type':db[_0x8b12('0x72')][_0x8b12('0x73')][_0x8b12('0x74')],'raw':!![]})[_0x8b12('0x24')](function(_0x3ecbcd){return _0x3ecbcd;});})[_0x8b12('0x24')](function(_0x1c8a85){if(_0x1c8a85){_0x487686[_0x8b12('0x2c')][_0x8b12('0x75')]=_0x1c8a85[0x0];if(!_0x147373[_0x8b12('0x5f')]['UserId'])return;return db[_0x8b12('0x76')][_0x8b12('0x5d')]({'where':{'id':_0x147373[_0x8b12('0x5f')][_0x8b12('0x65')],'role':'agent'},'attributes':['id',_0x8b12('0x3c'),_0x8b12('0x77'),'email','internal'],'raw':!![]});}return null;})[_0x8b12('0x24')](function(_0x83e1f3){if(!_0x83e1f3)return null;_0x487686[_0x8b12('0x2c')]['agent']=_0x83e1f3;return _0x487686;})['then'](function(_0x2fdf4a){if(_0x2fdf4a){if(_0x147373['body']['manual']){_0x487686[_0x8b12('0x2c')][_0x8b12('0x78')]=util[_0x8b12('0x63')](_0x8b12('0x79'),_0x147373['user'][_0x8b12('0x3c')]);_0x487686[_0x8b12('0x2c')][_0x8b12('0x7a')]=_0x487686['channel'];_0x487686[_0x8b12('0x2c')]['motionChannel']=_0x487686[_0x8b12('0x7a')];_0x487686[_0x8b12('0x2c')][_0x8b12('0x7b')]=_0x8b12('0x7c');return respondWithRpcPromise(_0x8b12('0x7d'),'EventManager',{'event':_0x8b12('0x7e'),'message':_[_0x8b12('0x52')](_0x487686[_0x8b12('0x2c')],JSON[_0x8b12('0x7f')](_0x487686[_0x8b12('0x6e')][_0x8b12('0x80')]))},client9002)[_0x8b12('0x24')](function(){return _0x487686;});}return _0x487686;}return null;})[_0x8b12('0x24')](respondWithResult(_0x49446c,null))[_0x8b12('0x5a')](handleError(_0x49446c,null));};var interaction_log=require(_0x8b12('0x14'))(_0x8b12('0x61'));exports[_0x8b12('0x35')]=function(_0x12868b,_0x506a6a,_0x432924){var _0xbd3f0e={'agent':{},'channel':'chat'};if(_0x12868b[_0x8b12('0x5f')]['id']){delete _0x12868b[_0x8b12('0x5f')]['id'];}_0x12868b[_0x8b12('0x5f')]['UserId']=_0x12868b['body'][_0x8b12('0x65')]||_0x12868b[_0x8b12('0x66')]['id'];_0xbd3f0e[_0x8b12('0x67')]['id']=_0x12868b['body'][_0x8b12('0x65')];return db[_0x8b12('0x57')][_0x8b12('0x5d')]({'where':{'id':_0x12868b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x506a6a,null))[_0x8b12('0x24')](function(_0x3091dc){if(_0x3091dc){_0xbd3f0e['message']=_0x3091dc[_0x8b12('0x68')]({'plain':!![]});return db['ChatInteraction'][_0x8b12('0x5d')]({'where':{'id':_0x3091dc[_0x8b12('0x6a')]}});}return null;})[_0x8b12('0x24')](handleEntityNotFound(_0x506a6a,null))[_0x8b12('0x24')](function(_0x42bffd){if(_0x42bffd){_0xbd3f0e[_0x8b12('0x6e')]=_0x42bffd[_0x8b12('0x68')]({'plain':!![]});interaction_log['info'](_0x8b12('0x81'),_0x12868b['user']['id'],_0x12868b[_0x8b12('0x66')]['name'],_0x12868b[_0x8b12('0x66')][_0x8b12('0x6d')],_0xbd3f0e['interaction']['id'],_0x12868b[_0x8b12('0x5f')]?JSON['stringify'](_0x12868b[_0x8b12('0x5f')]):_0x8b12('0x82'));return respondWithRpcPromise(_0x8b12('0x83'),_0x8b12('0x84'),_0xbd3f0e);}return null;})[_0x8b12('0x24')](function(_0x2d2233){var _0x556c22='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d2233[_0x8b12('0x2c')][_0x8b12('0x71')];return db['sequelize'][_0x8b12('0x44')](_0x556c22,{'type':db[_0x8b12('0x72')]['QueryTypes'][_0x8b12('0x74')],'raw':!![]})[_0x8b12('0x24')](function(_0x3ab519){return _0x3ab519;});})[_0x8b12('0x24')](function(_0x3347e6){if(_0x3347e6){_0xbd3f0e['message'][_0x8b12('0x75')]=_0x3347e6[0x0];if(!_0x12868b[_0x8b12('0x5f')][_0x8b12('0x65')])return;return db[_0x8b12('0x76')][_0x8b12('0x5d')]({'where':{'id':_0x12868b[_0x8b12('0x5f')]['UserId'],'role':_0x8b12('0x67')},'attributes':['id',_0x8b12('0x3c'),'fullname',_0x8b12('0x85'),'internal'],'raw':!![]});}return null;})[_0x8b12('0x24')](function(_0x381e76){if(!_0x381e76)return null;_0xbd3f0e['message'][_0x8b12('0x67')]=_0x381e76;return _0xbd3f0e;})[_0x8b12('0x24')](function(_0x297eb8){if(_0x297eb8){_0x297eb8[_0x8b12('0x2c')][_0x8b12('0x78')]=util['format'](_0x8b12('0x79'),_0x12868b[_0x8b12('0x66')][_0x8b12('0x3c')]);_0x297eb8[_0x8b12('0x2c')]['channel']=_0xbd3f0e[_0x8b12('0x7a')];_0x297eb8[_0x8b12('0x2c')][_0x8b12('0x86')]=_0xbd3f0e[_0x8b12('0x7a')];_0x297eb8['message'][_0x8b12('0x7b')]='reject';respondWithRpcPromise(_0x8b12('0x7d'),_0x8b12('0x7d'),{'event':_0x8b12('0x87'),'message':_[_0x8b12('0x52')](_0xbd3f0e[_0x8b12('0x2c')],JSON[_0x8b12('0x7f')](_0xbd3f0e[_0x8b12('0x6e')][_0x8b12('0x80')]))},client9002);return _0xbd3f0e;}return null;})[_0x8b12('0x24')](respondWithResult(_0x506a6a,null))[_0x8b12('0x5a')](handleError(_0x506a6a,null));}; \ No newline at end of file +var _0x3a6b=['format','UserId','agent','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','Sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','ChatMessage','findAll','show','params','keys','length','find','create','body','describe','chat-interactions','accept','readAt'];(function(_0x1fa20a,_0x1a127c){var _0xe73e93=function(_0x55b6d8){while(--_0x55b6d8){_0x1fa20a['push'](_0x1fa20a['shift']());}};_0xe73e93(++_0x1a127c);}(_0x3a6b,0xb5));var _0xb3a6=function(_0x283b39,_0x5ade81){_0x283b39=_0x283b39-0x0;var _0x27414c=_0x3a6b[_0x283b39];return _0x27414c;};'use strict';var emlformat=require(_0xb3a6('0x0'));var rimraf=require(_0xb3a6('0x1'));var zipdir=require(_0xb3a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3a6('0x3'));var moment=require(_0xb3a6('0x4'));var BPromise=require(_0xb3a6('0x5'));var Mustache=require('mustache');var util=require(_0xb3a6('0x6'));var path=require(_0xb3a6('0x7'));var sox=require('sox');var csv=require(_0xb3a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3a6('0x9'));var _=require('lodash');var squel=require(_0xb3a6('0xa'));var crypto=require(_0xb3a6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb3a6('0xc'));var toCsv=require(_0xb3a6('0x8'));var querystring=require('querystring');var Papa=require(_0xb3a6('0xd'));var Redis=require(_0xb3a6('0xe'));var authService=require(_0xb3a6('0xf'));var qs=require(_0xb3a6('0x10'));var as=require(_0xb3a6('0x11'));var hardwareService=require(_0xb3a6('0x12'));var logger=require(_0xb3a6('0x13'))(_0xb3a6('0x14'));var utils=require(_0xb3a6('0x15'));var config=require(_0xb3a6('0x16'));var licenseUtil=require(_0xb3a6('0x17'));var db=require(_0xb3a6('0x18'))['db'];config[_0xb3a6('0x19')]=_[_0xb3a6('0x1a')](config[_0xb3a6('0x19')],{'host':_0xb3a6('0x1b'),'port':0x18eb});var socket=require(_0xb3a6('0x1c'))(new Redis(config[_0xb3a6('0x19')]));require(_0xb3a6('0x1d'))[_0xb3a6('0x1e')](socket);var jayson=require(_0xb3a6('0x1f'));var client=jayson[_0xb3a6('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xb3a6('0x20')][_0xb3a6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x52176a,_0x406b9c,_0x3a087c,_0x4e6c32){return new BPromise(function(_0x2ed9a4,_0x47b82a){var _0x2c33f9=_0x4e6c32||client;return _0x2c33f9['request'](_0x52176a,_0x3a087c)['then'](function(_0x29bacf){logger['info'](_0xb3a6('0x22'),_0x406b9c,_0xb3a6('0x23'));logger['debug'](_0xb3a6('0x24'),_0x406b9c,_0xb3a6('0x23'),JSON[_0xb3a6('0x25')](_0x29bacf));if(_0x29bacf[_0xb3a6('0x26')]){if(_0x29bacf[_0xb3a6('0x26')][_0xb3a6('0x27')]===0x1f4){logger[_0xb3a6('0x26')](_0xb3a6('0x22'),_0x406b9c,_0x29bacf[_0xb3a6('0x26')][_0xb3a6('0x28')]);return _0x47b82a(_0x29bacf[_0xb3a6('0x26')][_0xb3a6('0x28')]);}logger[_0xb3a6('0x26')](_0xb3a6('0x22'),_0x406b9c,_0x29bacf['error']['message']);return _0x2ed9a4(_0x29bacf['error'][_0xb3a6('0x28')]);}else{logger[_0xb3a6('0x29')](_0xb3a6('0x22'),_0x406b9c,_0xb3a6('0x23'));_0x2ed9a4(_0x29bacf[_0xb3a6('0x2a')]['message']);}})[_0xb3a6('0x2b')](function(_0xb7360a){logger['error'](_0xb3a6('0x22'),_0x406b9c,_0xb7360a);_0x47b82a(_0xb7360a);});});}function respondWithStatusCode(_0x2aa0ad,_0x4f0d71){_0x4f0d71=_0x4f0d71||0xcc;return function(_0x168ffb){if(_0x168ffb){return _0x2aa0ad['sendStatus'](_0x4f0d71);}return _0x2aa0ad[_0xb3a6('0x2c')](_0x4f0d71)[_0xb3a6('0x2d')]();};}function respondWithResult(_0xf78a3b,_0x48b907){_0x48b907=_0x48b907||0xc8;return function(_0x18727e){if(_0x18727e){return _0xf78a3b['status'](_0x48b907)[_0xb3a6('0x2e')](_0x18727e);}};}function respondWithFilteredResult(_0x54903d,_0x3fdb49){return function(_0x119108){if(_0x119108){var _0x198b49=typeof _0x3fdb49['offset']===_0xb3a6('0x2f')&&typeof _0x3fdb49['limit']===_0xb3a6('0x2f');var _0x1da17c=_0x119108[_0xb3a6('0x30')];var _0x58df66=_0x198b49?0x0:_0x3fdb49[_0xb3a6('0x31')];var _0x163dff=_0x198b49?_0x119108[_0xb3a6('0x30')]:_0x3fdb49[_0xb3a6('0x31')]+_0x3fdb49[_0xb3a6('0x32')];var _0x631eeb;if(_0x163dff>=_0x1da17c){_0x163dff=_0x1da17c;_0x631eeb=0xc8;}else{_0x631eeb=0xce;}_0x54903d[_0xb3a6('0x2c')](_0x631eeb);return _0x54903d['set'](_0xb3a6('0x33'),_0x58df66+'-'+_0x163dff+'/'+_0x1da17c)[_0xb3a6('0x2e')](_0x119108);}return null;};}function patchUpdates(_0x372066){return function(_0x149adc){try{jsonpatch[_0xb3a6('0x34')](_0x149adc,_0x372066,!![]);}catch(_0x29c850){return BPromise[_0xb3a6('0x35')](_0x29c850);}return _0x149adc[_0xb3a6('0x36')]();};}function saveUpdates(_0x3c9617,_0x286037){return function(_0x3023aa){if(_0x3023aa){return _0x3023aa['update'](_0x3c9617)[_0xb3a6('0x37')](function(_0x3491ba){return _0x3491ba;});}return null;};}function removeEntity(_0x140d43,_0x3358a3){return function(_0x2299e7){if(_0x2299e7){return _0x2299e7[_0xb3a6('0x38')]()[_0xb3a6('0x37')](function(){_0x140d43[_0xb3a6('0x2c')](0xcc)[_0xb3a6('0x2d')]();});}};}function handleEntityNotFound(_0x4c4cbf,_0x404d77){return function(_0x364406){if(!_0x364406){_0x4c4cbf[_0xb3a6('0x39')](0x194);}return _0x364406;};}function handleError(_0x4cc1eb,_0x3bcb73){_0x3bcb73=_0x3bcb73||0x1f4;return function(_0x3f3f54){logger[_0xb3a6('0x26')](_0x3f3f54[_0xb3a6('0x3a')]);if(_0x3f3f54[_0xb3a6('0x3b')]){delete _0x3f3f54[_0xb3a6('0x3b')];}_0x4cc1eb[_0xb3a6('0x2c')](_0x3bcb73)[_0xb3a6('0x3c')](_0x3f3f54);};}exports['index']=function(_0x5fa761,_0x56ca94){var _0x56b6d1={},_0x3daa7c={},_0x1ee49e={'count':0x0,'rows':[]};var _0x52aed2=_[_0xb3a6('0x3d')](db['ChatMessage'][_0xb3a6('0x3e')],function(_0x38dda1){return{'name':_0x38dda1[_0xb3a6('0x3f')],'type':_0x38dda1['type'][_0xb3a6('0x40')]};});_0x3daa7c[_0xb3a6('0x41')]=_['map'](_0x52aed2,_0xb3a6('0x3b'));_0x3daa7c[_0xb3a6('0x42')]=_['keys'](_0x5fa761[_0xb3a6('0x42')]);_0x3daa7c['filters']=_[_0xb3a6('0x43')](_0x3daa7c[_0xb3a6('0x41')],_0x3daa7c[_0xb3a6('0x42')]);_0x56b6d1['attributes']=_['intersection'](_0x3daa7c[_0xb3a6('0x41')],qs[_0xb3a6('0x44')](_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x44')]));_0x56b6d1[_0xb3a6('0x45')]=_0x56b6d1['attributes']['length']?_0x56b6d1[_0xb3a6('0x45')]:_0x3daa7c['model'];if(!_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x46')]('nolimit')){_0x56b6d1[_0xb3a6('0x32')]=qs['limit'](_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x32')]);_0x56b6d1[_0xb3a6('0x31')]=qs[_0xb3a6('0x31')](_0x5fa761['query'][_0xb3a6('0x31')]);}_0x56b6d1[_0xb3a6('0x47')]=qs['sort'](_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x48')]);_0x56b6d1[_0xb3a6('0x49')]=qs[_0xb3a6('0x4a')](_['pick'](_0x5fa761[_0xb3a6('0x42')],_0x3daa7c[_0xb3a6('0x4a')]),_0x52aed2);if(_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x4b')]){_0x56b6d1[_0xb3a6('0x49')]=_[_0xb3a6('0x4c')](_0x56b6d1[_0xb3a6('0x49')],{'$or':_[_0xb3a6('0x3d')](_0x52aed2,function(_0xe44f22){if(_0xe44f22[_0xb3a6('0x4d')]!==_0xb3a6('0x4e')){var _0x179511={};_0x179511[_0xe44f22[_0xb3a6('0x3b')]]={'$like':'%'+_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x4b')]+'%'};return _0x179511;}})});}_0x56b6d1=_[_0xb3a6('0x4c')]({},_0x56b6d1,_0x5fa761[_0xb3a6('0x4f')]);var _0x5f11b4={'where':_0x56b6d1[_0xb3a6('0x49')]};return db['ChatMessage'][_0xb3a6('0x30')](_0x5f11b4)[_0xb3a6('0x37')](function(_0x224cb8){_0x1ee49e[_0xb3a6('0x30')]=_0x224cb8;if(_0x5fa761[_0xb3a6('0x42')][_0xb3a6('0x50')]){_0x56b6d1[_0xb3a6('0x51')]=[{'all':!![]}];}return db[_0xb3a6('0x52')][_0xb3a6('0x53')](_0x56b6d1);})[_0xb3a6('0x37')](function(_0x516115){_0x1ee49e['rows']=_0x516115;return _0x1ee49e;})[_0xb3a6('0x37')](respondWithFilteredResult(_0x56ca94,_0x56b6d1))[_0xb3a6('0x2b')](handleError(_0x56ca94,null));};exports[_0xb3a6('0x54')]=function(_0xdf1069,_0x1ed498){var _0x42668b={'raw':!![],'where':{'id':_0xdf1069[_0xb3a6('0x55')]['id']}},_0x5109ae={};_0x5109ae[_0xb3a6('0x41')]=_[_0xb3a6('0x56')](db[_0xb3a6('0x52')][_0xb3a6('0x3e')]);_0x5109ae[_0xb3a6('0x42')]=_[_0xb3a6('0x56')](_0xdf1069[_0xb3a6('0x42')]);_0x5109ae[_0xb3a6('0x4a')]=_[_0xb3a6('0x43')](_0x5109ae[_0xb3a6('0x41')],_0x5109ae['query']);_0x42668b[_0xb3a6('0x45')]=_[_0xb3a6('0x43')](_0x5109ae[_0xb3a6('0x41')],qs['fields'](_0xdf1069[_0xb3a6('0x42')][_0xb3a6('0x44')]));_0x42668b[_0xb3a6('0x45')]=_0x42668b[_0xb3a6('0x45')][_0xb3a6('0x57')]?_0x42668b[_0xb3a6('0x45')]:_0x5109ae[_0xb3a6('0x41')];if(_0xdf1069[_0xb3a6('0x42')][_0xb3a6('0x50')]){_0x42668b['include']=[{'all':!![]}];}_0x42668b=_[_0xb3a6('0x4c')]({},_0x42668b,_0xdf1069['options']);return db[_0xb3a6('0x52')][_0xb3a6('0x58')](_0x42668b)['then'](handleEntityNotFound(_0x1ed498,null))['then'](respondWithResult(_0x1ed498,null))['catch'](handleError(_0x1ed498,null));};exports['create']=function(_0x94988d,_0x53ac8d){return db[_0xb3a6('0x52')][_0xb3a6('0x59')](_0x94988d[_0xb3a6('0x5a')],{})['then'](respondWithResult(_0x53ac8d,0xc9))[_0xb3a6('0x2b')](handleError(_0x53ac8d,null));};exports['update']=function(_0x2d8d77,_0x1e8b9c){if(_0x2d8d77[_0xb3a6('0x5a')]['id']){delete _0x2d8d77['body']['id'];}return db['ChatMessage'][_0xb3a6('0x58')]({'where':{'id':_0x2d8d77[_0xb3a6('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e8b9c,null))[_0xb3a6('0x37')](saveUpdates(_0x2d8d77[_0xb3a6('0x5a')],null))[_0xb3a6('0x37')](respondWithResult(_0x1e8b9c,null))[_0xb3a6('0x2b')](handleError(_0x1e8b9c,null));};exports[_0xb3a6('0x38')]=function(_0x289aa0,_0xbd378){return db[_0xb3a6('0x52')]['find']({'where':{'id':_0x289aa0[_0xb3a6('0x55')]['id']}})['then'](handleEntityNotFound(_0xbd378,null))[_0xb3a6('0x37')](removeEntity(_0xbd378,null))[_0xb3a6('0x2b')](handleError(_0xbd378,null));};exports[_0xb3a6('0x5b')]=function(_0x3d2af5,_0x162681){return db[_0xb3a6('0x52')]['describe']()[_0xb3a6('0x37')](respondWithResult(_0x162681,null))['catch'](handleError(_0x162681,null));};var interaction_log=require('../../config/logger')(_0xb3a6('0x5c'));exports[_0xb3a6('0x5d')]=function(_0x4fdbf4,_0xf69f2b,_0x502fdd){var _0x16078a={'agent':{},'channel':'chat'};if(_0x4fdbf4[_0xb3a6('0x5a')]['id']){delete _0x4fdbf4[_0xb3a6('0x5a')]['id'];}_0x4fdbf4[_0xb3a6('0x5a')]['read']=!![];_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x5e')]=moment()[_0xb3a6('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4fdbf4[_0xb3a6('0x5a')]['UserId']=_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x60')]||_0x4fdbf4['user']['id'];_0x16078a[_0xb3a6('0x61')]['id']=_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x60')];return db[_0xb3a6('0x52')]['find']({'where':{'id':_0x4fdbf4[_0xb3a6('0x55')]['id'],'UserId':null}})[_0xb3a6('0x37')](handleEntityNotFound(_0xf69f2b,null))[_0xb3a6('0x37')](saveUpdates(_0x4fdbf4[_0xb3a6('0x5a')],null))[_0xb3a6('0x37')](function(_0x20fc3c){if(_0x20fc3c){_0x16078a['message']=_0x20fc3c[_0xb3a6('0x62')]({'plain':!![]});return db[_0xb3a6('0x63')][_0xb3a6('0x58')]({'where':{'id':_0x20fc3c[_0xb3a6('0x64')]}});}return null;})[_0xb3a6('0x37')](handleEntityNotFound(_0xf69f2b,null))[_0xb3a6('0x37')](function(_0x44788d){if(_0x44788d){return _0x44788d[_0xb3a6('0x65')]({'UserId':_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x60')],'read1stAt':_[_0xb3a6('0x66')](_0x44788d[_0xb3a6('0x67')])?moment()['format'](_0xb3a6('0x68')):undefined});}return null;})[_0xb3a6('0x37')](function(_0x3a9c28){if(_0x3a9c28){_0x16078a[_0xb3a6('0x69')]=_0x3a9c28['get']({'plain':!![]});interaction_log[_0xb3a6('0x29')](_0xb3a6('0x6a'),_0x4fdbf4['user']['id'],_0x4fdbf4['user'][_0xb3a6('0x3b')],_0x4fdbf4[_0xb3a6('0x6b')][_0xb3a6('0x6c')],_0x16078a['interaction']['id'],_0x4fdbf4[_0xb3a6('0x5a')]?JSON['stringify'](_0x4fdbf4['body']):_0xb3a6('0x6d'));return respondWithRpcPromise(_0xb3a6('0x6e'),_0xb3a6('0x6f'),_0x16078a);}return null;})[_0xb3a6('0x37')](function(_0x2bbb17){var _0x50d564='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2bbb17[_0xb3a6('0x28')]['ContactId'];return db['sequelize'][_0xb3a6('0x42')](_0x50d564,{'type':db[_0xb3a6('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x520b48){return _0x520b48;});})['then'](function(_0x51ed21){if(_0x51ed21){_0x16078a['message'][_0xb3a6('0x71')]=_0x51ed21[0x0];if(!_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x60')])return;return db[_0xb3a6('0x72')]['find']({'where':{'id':_0x4fdbf4[_0xb3a6('0x5a')]['UserId'],'role':_0xb3a6('0x61')},'attributes':['id','name','fullname',_0xb3a6('0x73'),_0xb3a6('0x74')],'raw':!![]});}return null;})['then'](function(_0x1e651c){if(!_0x1e651c)return null;_0x16078a['message']['agent']=_0x1e651c;return _0x16078a;})['then'](function(_0x3fefcb){if(_0x3fefcb){if(_0x4fdbf4[_0xb3a6('0x5a')][_0xb3a6('0x75')]){_0x16078a[_0xb3a6('0x28')][_0xb3a6('0x76')]=util[_0xb3a6('0x5f')](_0xb3a6('0x77'),_0x4fdbf4[_0xb3a6('0x6b')][_0xb3a6('0x3b')]);_0x16078a[_0xb3a6('0x28')][_0xb3a6('0x78')]=_0x16078a[_0xb3a6('0x78')];_0x16078a[_0xb3a6('0x28')][_0xb3a6('0x79')]=_0x16078a[_0xb3a6('0x78')];_0x16078a[_0xb3a6('0x28')][_0xb3a6('0x7a')]=_0xb3a6('0x5d');return respondWithRpcPromise(_0xb3a6('0x7b'),_0xb3a6('0x7b'),{'event':_0xb3a6('0x7c'),'message':_[_0xb3a6('0x4c')](_0x16078a[_0xb3a6('0x28')],JSON[_0xb3a6('0x7d')](_0x16078a[_0xb3a6('0x69')][_0xb3a6('0x7e')]))},client9002)[_0xb3a6('0x37')](function(){return _0x16078a;});}return _0x16078a;}return null;})['then'](respondWithResult(_0xf69f2b,null))['catch'](handleError(_0xf69f2b,null));};var interaction_log=require(_0xb3a6('0x13'))(_0xb3a6('0x5c'));exports[_0xb3a6('0x35')]=function(_0x523667,_0xba9453,_0x1ae8d1){var _0x2d8b47={'agent':{},'channel':_0xb3a6('0x7f')};if(_0x523667['body']['id']){delete _0x523667[_0xb3a6('0x5a')]['id'];}_0x523667[_0xb3a6('0x5a')][_0xb3a6('0x60')]=_0x523667[_0xb3a6('0x5a')][_0xb3a6('0x60')]||_0x523667[_0xb3a6('0x6b')]['id'];_0x2d8b47['agent']['id']=_0x523667[_0xb3a6('0x5a')][_0xb3a6('0x60')];return db[_0xb3a6('0x52')][_0xb3a6('0x58')]({'where':{'id':_0x523667[_0xb3a6('0x55')]['id'],'UserId':null}})[_0xb3a6('0x37')](handleEntityNotFound(_0xba9453,null))[_0xb3a6('0x37')](function(_0x430e44){if(_0x430e44){_0x2d8b47[_0xb3a6('0x28')]=_0x430e44[_0xb3a6('0x62')]({'plain':!![]});return db[_0xb3a6('0x63')][_0xb3a6('0x58')]({'where':{'id':_0x430e44[_0xb3a6('0x64')]}});}return null;})[_0xb3a6('0x37')](handleEntityNotFound(_0xba9453,null))[_0xb3a6('0x37')](function(_0x589cce){if(_0x589cce){_0x2d8b47['interaction']=_0x589cce['get']({'plain':!![]});interaction_log[_0xb3a6('0x29')](_0xb3a6('0x80'),_0x523667[_0xb3a6('0x6b')]['id'],_0x523667[_0xb3a6('0x6b')][_0xb3a6('0x3b')],_0x523667[_0xb3a6('0x6b')][_0xb3a6('0x6c')],_0x2d8b47[_0xb3a6('0x69')]['id'],_0x523667[_0xb3a6('0x5a')]?JSON[_0xb3a6('0x25')](_0x523667[_0xb3a6('0x5a')]):'null');return respondWithRpcPromise(_0xb3a6('0x81'),_0xb3a6('0x82'),_0x2d8b47);}return null;})[_0xb3a6('0x37')](function(_0x1e4762){var _0x83b369=_0xb3a6('0x83')+_0x1e4762[_0xb3a6('0x28')][_0xb3a6('0x84')];return db[_0xb3a6('0x85')][_0xb3a6('0x42')](_0x83b369,{'type':db[_0xb3a6('0x70')][_0xb3a6('0x86')][_0xb3a6('0x87')],'raw':!![]})[_0xb3a6('0x37')](function(_0x1c8d31){return _0x1c8d31;});})['then'](function(_0x1c06ee){if(_0x1c06ee){_0x2d8b47[_0xb3a6('0x28')][_0xb3a6('0x71')]=_0x1c06ee[0x0];if(!_0x523667['body'][_0xb3a6('0x60')])return;return db[_0xb3a6('0x72')][_0xb3a6('0x58')]({'where':{'id':_0x523667[_0xb3a6('0x5a')][_0xb3a6('0x60')],'role':_0xb3a6('0x61')},'attributes':['id',_0xb3a6('0x3b'),_0xb3a6('0x88'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x396269){if(!_0x396269)return null;_0x2d8b47[_0xb3a6('0x28')][_0xb3a6('0x61')]=_0x396269;return _0x2d8b47;})[_0xb3a6('0x37')](function(_0x51e52c){if(_0x51e52c){_0x51e52c[_0xb3a6('0x28')]['interface']=util[_0xb3a6('0x5f')](_0xb3a6('0x77'),_0x523667[_0xb3a6('0x6b')][_0xb3a6('0x3b')]);_0x51e52c[_0xb3a6('0x28')][_0xb3a6('0x78')]=_0x2d8b47['channel'];_0x51e52c[_0xb3a6('0x28')][_0xb3a6('0x79')]=_0x2d8b47[_0xb3a6('0x78')];_0x51e52c[_0xb3a6('0x28')][_0xb3a6('0x7a')]='reject';respondWithRpcPromise(_0xb3a6('0x7b'),'EventManager',{'event':_0xb3a6('0x89'),'message':_[_0xb3a6('0x4c')](_0x2d8b47[_0xb3a6('0x28')],JSON['parse'](_0x2d8b47['interaction'][_0xb3a6('0x7e')]))},client9002);return _0x2d8b47;}return null;})['then'](respondWithResult(_0xba9453,null))[_0xb3a6('0x2b')](handleError(_0xba9453,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index a6b6623..259134b 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 _0x9aeb=['update','remove','emit','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9aeb,0x85));var _0xb9ae=function(_0x4593b6,_0x2a4fa9){_0x4593b6=_0x4593b6-0x0;var _0x2eceed=_0x9aeb[_0x4593b6];return _0x2eceed;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb9ae('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb9ae('0x1')](0x0);var events={'afterCreate':_0xb9ae('0x2'),'afterUpdate':_0xb9ae('0x3'),'afterDestroy':_0xb9ae('0x4')};function emitEvent(_0x1ad00e){return function(_0x4e28bd,_0x162dfd,_0xc812a2){ChatMessageEvents[_0xb9ae('0x5')](_0x1ad00e+':'+_0x4e28bd['id'],_0x4e28bd);ChatMessageEvents[_0xb9ae('0x5')](_0x1ad00e,_0x4e28bd);_0xc812a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb9ae('0x6')](e,emitEvent(event));}}module[_0xb9ae('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x4bef=['events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1ce919,_0x1bbb96){var _0x34ec94=function(_0x3f7a6f){while(--_0x3f7a6f){_0x1ce919['push'](_0x1ce919['shift']());}};_0x34ec94(++_0x1bbb96);}(_0x4bef,0x82));var _0xf4be=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x4bef[_0x8b8564];return _0x360c61;};'use strict';var EventEmitter=require(_0xf4be('0x0'));var ChatMessage=require(_0xf4be('0x1'))['db'][_0xf4be('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf4be('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf4be('0x4'),'afterDestroy':_0xf4be('0x5')};function emitEvent(_0x5920f1){return function(_0x94fa24,_0x10b8f1,_0x170be8){ChatMessageEvents[_0xf4be('0x6')](_0x5920f1+':'+_0x94fa24['id'],_0x94fa24);ChatMessageEvents[_0xf4be('0x6')](_0x5920f1,_0x94fa24);_0x170be8(null);};}for(var e in events){if(events[_0xf4be('0x7')](e)){var event=events[e];ChatMessage[_0xf4be('0x8')](e,emitEvent(event));}}module[_0xf4be('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 19c115b..8359650 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 _0xb91a=['out','secret','isNil','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','models','get','direction','toLowerCase'];(function(_0x760d25,_0x322dbf){var _0xe1ac84=function(_0x3b596b){while(--_0x3b596b){_0x760d25['push'](_0x760d25['shift']());}};_0xe1ac84(++_0x322dbf);}(_0xb91a,0xf4));var _0xab91=function(_0x28bf14,_0x128eb5){_0x28bf14=_0x28bf14-0x0;var _0x4560ad=_0xb91a[_0x28bf14];return _0x4560ad;};'use strict';var _=require(_0xab91('0x0'));var util=require(_0xab91('0x1'));var logger=require(_0xab91('0x2'))('api');var moment=require('moment');var BPromise=require(_0xab91('0x3'));var rp=require(_0xab91('0x4'));var fs=require('fs');var path=require(_0xab91('0x5'));var rimraf=require(_0xab91('0x6'));var config=require(_0xab91('0x7'));var attributes=require(_0xab91('0x8'));module[_0xab91('0x9')]=function(_0x429933,_0x290af9){return _0x429933[_0xab91('0xa')]('ChatMessage',attributes,{'tableName':_0xab91('0xb'),'paranoid':![],'indexes':[{'name':_0xab91('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51c663,_0x19e61d,_0x354b1b){var _0x275029=_0x429933[_0xab91('0xd')];var _0x163148=_0x51c663[_0xab91('0xe')]({'plain':!![]});if(_0x163148[_0xab91('0xf')][_0xab91('0x10')]()==='in'||_0x163148[_0xab91('0xf')][_0xab91('0x10')]()===_0xab91('0x11')&&!_0x163148[_0xab91('0x12')]&&!_[_0xab91('0x13')](_0x163148['UserId'])){_0x275029['ChatInteraction'][_0xab91('0x14')]({'where':{'id':_0x163148[_0xab91('0x15')]}})[_0xab91('0x16')](function(_0x14bded){if(_0x14bded){_0x14bded[_0xab91('0x17')]({'lastMsgAt':_0x163148[_0xab91('0x18')],'lastMsgDirection':_0x163148['direction']['toLowerCase']()});}})[_0xab91('0x19')](function(_0x3565c0){console[_0xab91('0x1a')](_0x3565c0);});}_0x354b1b();}},'charset':_0xab91('0x1b'),'collate':_0xab91('0x1c')});}; \ No newline at end of file +var _0x8796=['error','utf8mb4','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch'];(function(_0x98ee7c,_0x499bff){var _0xe4d709=function(_0x12791a){while(--_0x12791a){_0x98ee7c['push'](_0x98ee7c['shift']());}};_0xe4d709(++_0x499bff);}(_0x8796,0xcd));var _0x6879=function(_0x3d5416,_0x28a599){_0x3d5416=_0x3d5416-0x0;var _0x17712c=_0x8796[_0x3d5416];return _0x17712c;};'use strict';var _=require(_0x6879('0x0'));var util=require(_0x6879('0x1'));var logger=require(_0x6879('0x2'))(_0x6879('0x3'));var moment=require('moment');var BPromise=require(_0x6879('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6879('0x5'));var config=require(_0x6879('0x6'));var attributes=require(_0x6879('0x7'));module[_0x6879('0x8')]=function(_0x505d7e,_0x3ecef8){return _0x505d7e[_0x6879('0x9')](_0x6879('0xa'),attributes,{'tableName':_0x6879('0xb'),'paranoid':![],'indexes':[{'name':_0x6879('0xc'),'fields':[_0x6879('0xd')],'type':_0x6879('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32886e,_0x15fd3e,_0x1c718b){var _0x5e731c=_0x505d7e[_0x6879('0xf')];var _0xa9aceb=_0x32886e['get']({'plain':!![]});if(_0xa9aceb[_0x6879('0x10')][_0x6879('0x11')]()==='in'||_0xa9aceb[_0x6879('0x10')][_0x6879('0x11')]()==='out'&&!_0xa9aceb[_0x6879('0x12')]&&!_[_0x6879('0x13')](_0xa9aceb[_0x6879('0x14')])){_0x5e731c[_0x6879('0x15')][_0x6879('0x16')]({'where':{'id':_0xa9aceb[_0x6879('0x17')]}})[_0x6879('0x18')](function(_0x4edb5d){if(_0x4edb5d){_0x4edb5d['update']({'lastMsgAt':_0xa9aceb[_0x6879('0x19')],'lastMsgDirection':_0xa9aceb[_0x6879('0x10')][_0x6879('0x11')]()});}})[_0x6879('0x1a')](function(_0x15dc85){console[_0x6879('0x1b')](_0x15dc85);});}_0x1c718b();}},'charset':_0x6879('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 855ee57..bf2c235 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 _0x8e08=['ioredis','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatMessage','create','body','options','then','debug','CreateChatMessage','util','bluebird','randomstring'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0x8e08,0xf9));var _0x88e0=function(_0x1206fd,_0x39092a){_0x1206fd=_0x1206fd-0x0;var _0xbe06a4=_0x8e08[_0x1206fd];return _0xbe06a4;};'use strict';var _=require('lodash');var util=require(_0x88e0('0x0'));var moment=require('moment');var BPromise=require(_0x88e0('0x1'));var rs=require(_0x88e0('0x2'));var fs=require('fs');var Redis=require(_0x88e0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x88e0('0x4'));var logger=require(_0x88e0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88e0('0x6')][_0x88e0('0x7')]({'port':0x232a});config[_0x88e0('0x8')]=_['defaults'](config['redis'],{'host':_0x88e0('0x9'),'port':0x18eb});var socket=require(_0x88e0('0xa'))(new Redis(config[_0x88e0('0x8')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4fee66,_0x26233d,_0x596514){return new BPromise(function(_0x18da09,_0x5a5f7b){return client[_0x88e0('0xb')](_0x4fee66,_0x596514)['then'](function(_0x392f49){logger[_0x88e0('0xc')](_0x88e0('0xd'),_0x26233d,'request\x20sent');logger['debug'](_0x88e0('0xe'),_0x26233d,'request\x20sent',JSON[_0x88e0('0xf')](_0x392f49));if(_0x392f49[_0x88e0('0x10')]){if(_0x392f49[_0x88e0('0x10')][_0x88e0('0x11')]===0x1f4){logger[_0x88e0('0x10')](_0x88e0('0xd'),_0x26233d,_0x392f49[_0x88e0('0x10')][_0x88e0('0x12')]);return _0x5a5f7b(_0x392f49[_0x88e0('0x10')][_0x88e0('0x12')]);}logger[_0x88e0('0x10')](_0x88e0('0xd'),_0x26233d,_0x392f49[_0x88e0('0x10')][_0x88e0('0x12')]);return _0x18da09(_0x392f49['error'][_0x88e0('0x12')]);}else{logger[_0x88e0('0xc')](_0x88e0('0xd'),_0x26233d,'request\x20sent');_0x18da09(_0x392f49[_0x88e0('0x13')]['message']);}})[_0x88e0('0x14')](function(_0x1df32c){logger[_0x88e0('0x10')](_0x88e0('0xd'),_0x26233d,_0x1df32c);_0x5a5f7b(_0x1df32c);});});}exports['CreateChatMessage']=function(_0x4a50b0){var _0xcee4b9=this;return new Promise(function(_0xa9ba4,_0x234327){return db[_0x88e0('0x15')][_0x88e0('0x16')](_0x4a50b0[_0x88e0('0x17')],{'raw':_0x4a50b0[_0x88e0('0x18')]?_0x4a50b0[_0x88e0('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x88e0('0x19')](function(_0x37d117){logger[_0x88e0('0xc')]('CreateChatMessage',_0x4a50b0);logger[_0x88e0('0x1a')](_0x88e0('0x1b'),_0x4a50b0,JSON[_0x88e0('0xf')](_0x37d117));_0xa9ba4(_0x37d117);})[_0x88e0('0x14')](function(_0x13b81e){logger[_0x88e0('0x10')](_0x88e0('0x1b'),_0x13b81e['message'],_0x4a50b0);_0x234327(_0xcee4b9['error'](0x1f4,_0x13b81e['message']));});});}; \ No newline at end of file +var _0x6f7a=['request','then','info','ChatMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateChatMessage','ChatMessage','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x6f7a,0x117));var _0xa6f7=function(_0xcdf41,_0x3abe4f){_0xcdf41=_0xcdf41-0x0;var _0x457537=_0x6f7a[_0xcdf41];return _0x457537;};'use strict';var _=require('lodash');var util=require(_0xa6f7('0x0'));var moment=require(_0xa6f7('0x1'));var BPromise=require(_0xa6f7('0x2'));var rs=require(_0xa6f7('0x3'));var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6f7('0x5'));var logger=require(_0xa6f7('0x6'))(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var jayson=require(_0xa6f7('0x9'));var client=jayson[_0xa6f7('0xa')][_0xa6f7('0xb')]({'port':0x232a});config[_0xa6f7('0xc')]=_[_0xa6f7('0xd')](config[_0xa6f7('0xc')],{'host':_0xa6f7('0xe'),'port':0x18eb});var socket=require(_0xa6f7('0xf'))(new Redis(config['redis']));require(_0xa6f7('0x10'))[_0xa6f7('0x11')](socket);function respondWithRpcPromise(_0x4f0b3d,_0x1fa009,_0xc430ca){return new BPromise(function(_0x3be18a,_0x13d6e3){return client[_0xa6f7('0x12')](_0x4f0b3d,_0xc430ca)[_0xa6f7('0x13')](function(_0x341b48){logger[_0xa6f7('0x14')](_0xa6f7('0x15'),_0x1fa009,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1fa009,'request\x20sent',JSON[_0xa6f7('0x16')](_0x341b48));if(_0x341b48[_0xa6f7('0x17')]){if(_0x341b48[_0xa6f7('0x17')][_0xa6f7('0x18')]===0x1f4){logger[_0xa6f7('0x17')](_0xa6f7('0x15'),_0x1fa009,_0x341b48['error']['message']);return _0x13d6e3(_0x341b48['error'][_0xa6f7('0x19')]);}logger[_0xa6f7('0x17')](_0xa6f7('0x15'),_0x1fa009,_0x341b48[_0xa6f7('0x17')]['message']);return _0x3be18a(_0x341b48[_0xa6f7('0x17')][_0xa6f7('0x19')]);}else{logger['info'](_0xa6f7('0x15'),_0x1fa009,_0xa6f7('0x1a'));_0x3be18a(_0x341b48['result'][_0xa6f7('0x19')]);}})[_0xa6f7('0x1b')](function(_0xa72087){logger[_0xa6f7('0x17')]('ChatMessage,\x20%s,\x20%s',_0x1fa009,_0xa72087);_0x13d6e3(_0xa72087);});});}exports[_0xa6f7('0x1c')]=function(_0x55957b){var _0x57d4f2=this;return new Promise(function(_0x30752c,_0x2907aa){return db[_0xa6f7('0x1d')][_0xa6f7('0x1e')](_0x55957b['body'],{'raw':_0x55957b[_0xa6f7('0x1f')]?_0x55957b['options'][_0xa6f7('0x20')]===undefined?!![]:![]:!![]})[_0xa6f7('0x13')](function(_0x2eaeaa){logger[_0xa6f7('0x14')](_0xa6f7('0x1c'),_0x55957b);logger['debug']('CreateChatMessage',_0x55957b,JSON[_0xa6f7('0x16')](_0x2eaeaa));_0x30752c(_0x2eaeaa);})[_0xa6f7('0x1b')](function(_0x326fc4){logger[_0xa6f7('0x17')](_0xa6f7('0x1c'),_0x326fc4['message'],_0x55957b);_0x2907aa(_0x57d4f2[_0xa6f7('0x17')](0x1f4,_0x326fc4[_0xa6f7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 0360442..19469e9 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 _0xeec6=['length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x837006,_0x326159){var _0x4cf513=function(_0x2ac68e){while(--_0x2ac68e){_0x837006['push'](_0x837006['shift']());}};_0x4cf513(++_0x326159);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3a951e,_0x35eade){_0x3a951e=_0x3a951e-0x0;var _0x142e63=_0xeec6[_0x3a951e];return _0x142e63;};'use strict';var ChatMessageEvents=require(_0x6eec('0x0'));var events=[_0x6eec('0x1'),_0x6eec('0x2'),_0x6eec('0x3')];function createListener(_0x535568,_0x471d43){return function(_0x3e4f10){_0x471d43[_0x6eec('0x4')](_0x535568,_0x3e4f10);};}function removeListener(_0x2d7a15,_0x3e7b6b){return function(){ChatMessageEvents[_0x6eec('0x5')](_0x2d7a15,_0x3e7b6b);};}exports['register']=function(_0x185f31){for(var _0x3c6eda=0x0,_0x48064a=events[_0x6eec('0x6')];_0x3c6eda<_0x48064a;_0x3c6eda++){var _0x1c810e=events[_0x3c6eda];var _0x3443c2=createListener(_0x6eec('0x7')+_0x1c810e,_0x185f31);ChatMessageEvents['on'](_0x1c810e,_0x3443c2);}}; \ No newline at end of file +var _0x2123=['./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x15b3d6,_0x3dc9ac){var _0x4c124a=function(_0x1b7ba4){while(--_0x1b7ba4){_0x15b3d6['push'](_0x15b3d6['shift']());}};_0x4c124a(++_0x3dc9ac);}(_0x2123,0x190));var _0x3212=function(_0x3e84f0,_0x447cf5){_0x3e84f0=_0x3e84f0-0x0;var _0x49165f=_0x2123[_0x3e84f0];return _0x49165f;};'use strict';var ChatMessageEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatMessageEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatMessage:'+_0x4b35e9,_0x5d9d36);ChatMessageEvents['on'](_0x4b35e9,_0x3e17a3);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6e54f24..74c5059 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 _0xa215=['describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x34c3f3,_0x15f139){var _0x3ca5cb=function(_0x1c7ed6){while(--_0x1c7ed6){_0x34c3f3['push'](_0x34c3f3['shift']());}};_0x3ca5cb(++_0x15f139);}(_0xa215,0xe7));var _0x5a21=function(_0x4a8fea,_0x4603f4){_0x4a8fea=_0x4a8fea-0x0;var _0x5e23a4=_0xa215[_0x4a8fea];return _0x5e23a4;};'use strict';var multer=require(_0x5a21('0x0'));var util=require(_0x5a21('0x1'));var path=require(_0x5a21('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a21('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5a21('0x4'));var interaction=require(_0x5a21('0x5'));var config=require(_0x5a21('0x6'));var controller=require(_0x5a21('0x7'));router[_0x5a21('0x8')]('/',auth[_0x5a21('0x9')](),controller[_0x5a21('0xa')]);router['get'](_0x5a21('0xb'),auth[_0x5a21('0x9')](),controller[_0x5a21('0xc')]);router[_0x5a21('0x8')](_0x5a21('0xd'),auth['isAuthenticated'](),controller[_0x5a21('0xe')]);router[_0x5a21('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x5a21('0x10'),_0x5a21('0x11')),controller[_0x5a21('0x12')]);router[_0x5a21('0x13')](_0x5a21('0xd'),controller[_0x5a21('0x14')]);router[_0x5a21('0x13')](_0x5a21('0x15'),auth[_0x5a21('0x9')](),controller['accept']);router[_0x5a21('0x13')](_0x5a21('0x16'),auth[_0x5a21('0x9')](),controller[_0x5a21('0x17')]);router[_0x5a21('0x18')](_0x5a21('0xd'),auth[_0x5a21('0x9')](),controller[_0x5a21('0x19')]);module[_0x5a21('0x1a')]=router; \ No newline at end of file +var _0x45e3=['index','/describe','describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0xb98d8d,_0x481423){var _0x489b15=function(_0x409a13){while(--_0x409a13){_0xb98d8d['push'](_0xb98d8d['shift']());}};_0x489b15(++_0x481423);}(_0x45e3,0x145));var _0x345e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x45e3[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x345e('0x0'));var util=require(_0x345e('0x1'));var path=require(_0x345e('0x2'));var timeout=require(_0x345e('0x3'));var express=require(_0x345e('0x4'));var router=express[_0x345e('0x5')]();var fs_extra=require(_0x345e('0x6'));var auth=require(_0x345e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x345e('0x8'));var controller=require('./chatMessage.controller');router[_0x345e('0x9')]('/',auth[_0x345e('0xa')](),controller[_0x345e('0xb')]);router[_0x345e('0x9')](_0x345e('0xc'),auth[_0x345e('0xa')](),controller[_0x345e('0xd')]);router[_0x345e('0x9')](_0x345e('0xe'),auth['isAuthenticated'](),controller[_0x345e('0xf')]);router[_0x345e('0x10')]('/',auth[_0x345e('0xa')](),interaction['tracked'](_0x345e('0x11'),_0x345e('0x12')),controller[_0x345e('0x13')]);router[_0x345e('0x14')]('/:id',controller[_0x345e('0x15')]);router[_0x345e('0x14')](_0x345e('0x16'),auth[_0x345e('0xa')](),controller[_0x345e('0x17')]);router[_0x345e('0x14')](_0x345e('0x18'),auth[_0x345e('0xa')](),controller[_0x345e('0x19')]);router['delete'](_0x345e('0xe'),auth[_0x345e('0xa')](),controller[_0x345e('0x1a')]);module[_0x345e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 6674eee..ef47712 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x1519b7,_0xd828f1){var _0x328610=function(_0x34cb13){while(--_0x34cb13){_0x1519b7['push'](_0x1519b7['shift']());}};_0x328610(++_0xd828f1);}(_0xb10b,0x12a));var _0xbb10=function(_0x159f8e,_0x258d08){_0x159f8e=_0x159f8e-0x0;var _0x458e17=_0xb10b[_0x159f8e];return _0x458e17;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['medium','TEXT','exports'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0xadb5,0xad));var _0x5adb=function(_0x21a5d3,_0x3dcffd){_0x21a5d3=_0x21a5d3-0x0;var _0x3dfc60=_0xadb5[_0x21a5d3];return _0x3dfc60;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index cf903fc..7497e00 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x7a54,0x106));var _0x47a5=function(_0x2d2741,_0x5023a0){_0x2d2741=_0x2d2741-0x0;var _0x20d5da=_0x7a54[_0x2d2741];return _0x20d5da;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _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(_0x375db0,_0xec03ce){var _0x1eaf0c=function(_0x3b3c52){while(--_0x3b3c52){_0x375db0['push'](_0x375db0['shift']());}};_0x1eaf0c(++_0xec03ce);}(_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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index b154f8f..b33cfe1 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 _0xcb7a=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','events'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0xcb7a,0x1c6));var _0xacb7=function(_0x2cfc69,_0x56ee10){_0x2cfc69=_0x2cfc69-0x0;var _0x31beda=_0xcb7a[_0x2cfc69];return _0x31beda;};'use strict';var EventEmitter=require(_0xacb7('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xacb7('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xacb7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xacb7('0x3'),'afterDestroy':_0xacb7('0x4')};function emitEvent(_0x28cdd8){return function(_0x50ee65,_0x59a1a4,_0x33a4be){ChatOfflineMessageEvents[_0xacb7('0x5')](_0x28cdd8+':'+_0x50ee65['id'],_0x50ee65);ChatOfflineMessageEvents[_0xacb7('0x5')](_0x28cdd8,_0x50ee65);_0x33a4be(null);};}for(var e in events){if(events[_0xacb7('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x4b66=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x1dad92,_0x2f948c){var _0x90a9f6=function(_0x5644db){while(--_0x5644db){_0x1dad92['push'](_0x1dad92['shift']());}};_0x90a9f6(++_0x2f948c);}(_0x4b66,0x1dc));var _0x64b6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4b66[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x64b6('0x0'));var ChatOfflineMessage=require(_0x64b6('0x1'))['db'][_0x64b6('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x64b6('0x3')](0x0);var events={'afterCreate':_0x64b6('0x4'),'afterUpdate':_0x64b6('0x5'),'afterDestroy':_0x64b6('0x6')};function emitEvent(_0x8d82d1){return function(_0xa00e7f,_0xf885f2,_0x4780bd){ChatOfflineMessageEvents[_0x64b6('0x7')](_0x8d82d1+':'+_0xa00e7f['id'],_0xa00e7f);ChatOfflineMessageEvents[_0x64b6('0x7')](_0x8d82d1,_0xa00e7f);_0x4780bd(null);};}for(var e in events){if(events[_0x64b6('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x64b6('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 7ed74dd..cf4faba 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 _0xaa90=['define','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0xaa90,0x86));var _0x0aa9=function(_0x419b41,_0x196939){_0x419b41=_0x419b41-0x0;var _0x598ca9=_0xaa90[_0x419b41];return _0x598ca9;};'use strict';var attributes=require(_0x0aa9('0x0'));module[_0x0aa9('0x1')]=function(_0xf86838){return _0xf86838[_0x0aa9('0x2')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0aa9('0x3')});}; \ No newline at end of file +var _0xd235=['ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x18703c,_0x125f2a){var _0x29d475=function(_0x156808){while(--_0x156808){_0x18703c['push'](_0x18703c['shift']());}};_0x29d475(++_0x125f2a);}(_0xd235,0x177));var _0x5d23=function(_0x479eca,_0x4aa570){_0x479eca=_0x479eca-0x0;var _0x30ccaf=_0xd235[_0x479eca];return _0x30ccaf;};'use strict';var attributes=require(_0x5d23('0x0'));module[_0x5d23('0x1')]=function(_0x3f7da6){return _0x3f7da6[_0x5d23('0x2')](_0x5d23('0x3'),attributes,{'tableName':_0x5d23('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d23('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 0403d5d..f821cd9 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 _0x6594=['jayson/promise','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x6594,0x112));var _0x4659=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0x6594[_0x4d2263];return _0x24aba0;};'use strict';var _=require(_0x4659('0x0'));var util=require(_0x4659('0x1'));var moment=require('moment');var BPromise=require(_0x4659('0x2'));var rs=require(_0x4659('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4659('0x4'));var logger=require(_0x4659('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4659('0x6'));var client=jayson['client'][_0x4659('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3be576,_0x396f9b,_0xff7aef){return new BPromise(function(_0x51c73f,_0x28113d){return client[_0x4659('0x8')](_0x3be576,_0xff7aef)['then'](function(_0xb60a09){logger[_0x4659('0x9')](_0x4659('0xa'),_0x396f9b,'request\x20sent');logger[_0x4659('0xb')](_0x4659('0xc'),_0x396f9b,'request\x20sent',JSON[_0x4659('0xd')](_0xb60a09));if(_0xb60a09[_0x4659('0xe')]){if(_0xb60a09[_0x4659('0xe')][_0x4659('0xf')]===0x1f4){logger['error'](_0x4659('0xa'),_0x396f9b,_0xb60a09[_0x4659('0xe')][_0x4659('0x10')]);return _0x28113d(_0xb60a09['error'][_0x4659('0x10')]);}logger[_0x4659('0xe')](_0x4659('0xa'),_0x396f9b,_0xb60a09['error'][_0x4659('0x10')]);return _0x51c73f(_0xb60a09[_0x4659('0xe')][_0x4659('0x10')]);}else{logger[_0x4659('0x9')](_0x4659('0xa'),_0x396f9b,_0x4659('0x11'));_0x51c73f(_0xb60a09[_0x4659('0x12')][_0x4659('0x10')]);}})[_0x4659('0x13')](function(_0x247b82){logger[_0x4659('0xe')](_0x4659('0xa'),_0x396f9b,_0x247b82);_0x28113d(_0x247b82);});});} \ No newline at end of file +var _0xb681=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0xb681,0x153));var _0x1b68=function(_0x27b436,_0x5b1fc3){_0x27b436=_0x27b436-0x0;var _0x1e2f0f=_0xb681[_0x27b436];return _0x1e2f0f;};'use strict';var _=require(_0x1b68('0x0'));var util=require(_0x1b68('0x1'));var moment=require(_0x1b68('0x2'));var BPromise=require(_0x1b68('0x3'));var rs=require(_0x1b68('0x4'));var fs=require('fs');var Redis=require(_0x1b68('0x5'));var db=require(_0x1b68('0x6'))['db'];var utils=require(_0x1b68('0x7'));var logger=require(_0x1b68('0x8'))(_0x1b68('0x9'));var config=require('../../config/environment');var jayson=require(_0x1b68('0xa'));var client=jayson['client'][_0x1b68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x103d40,_0x1166ab,_0x536e88){return new BPromise(function(_0x5b3ebb,_0x54c76f){return client['request'](_0x103d40,_0x536e88)['then'](function(_0x1f0f1b){logger[_0x1b68('0xc')](_0x1b68('0xd'),_0x1166ab,_0x1b68('0xe'));logger[_0x1b68('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1166ab,_0x1b68('0xe'),JSON['stringify'](_0x1f0f1b));if(_0x1f0f1b[_0x1b68('0x10')]){if(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x11')]===0x1f4){logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);return _0x54c76f(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);}logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);return _0x5b3ebb(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);}else{logger['info'](_0x1b68('0xd'),_0x1166ab,_0x1b68('0xe'));_0x5b3ebb(_0x1f0f1b[_0x1b68('0x13')][_0x1b68('0x12')]);}})[_0x1b68('0x14')](function(_0x2255cf){logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x2255cf);_0x54c76f(_0x2255cf);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 5442c1a..55f63a4 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 _0xf545=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xf545,0xeb));var _0x5f54=function(_0x5cdf3c,_0x233f63){_0x5cdf3c=_0x5cdf3c-0x0;var _0x515b20=_0xf545[_0x5cdf3c];return _0x515b20;};'use strict';var multer=require(_0x5f54('0x0'));var util=require(_0x5f54('0x1'));var path=require(_0x5f54('0x2'));var timeout=require(_0x5f54('0x3'));var express=require(_0x5f54('0x4'));var router=express['Router']();var fs_extra=require(_0x5f54('0x5'));var auth=require(_0x5f54('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f54('0x7'));var controller=require(_0x5f54('0x8'));router['get']('/',auth[_0x5f54('0x9')](),controller[_0x5f54('0xa')]);router[_0x5f54('0xb')](_0x5f54('0xc'),auth[_0x5f54('0x9')](),controller[_0x5f54('0xd')]);router[_0x5f54('0xb')](_0x5f54('0xe'),auth[_0x5f54('0x9')](),controller['show']);router[_0x5f54('0xf')]('/',auth[_0x5f54('0x9')](),controller[_0x5f54('0x10')]);router['put'](_0x5f54('0xe'),auth[_0x5f54('0x9')](),controller[_0x5f54('0x11')]);router[_0x5f54('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5f54('0x13')]);module['exports']=router; \ No newline at end of file +var _0xec87=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xec87,0x19b));var _0x7ec8=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0xec87[_0x52c4e9];return _0x252a03;};'use strict';var multer=require(_0x7ec8('0x0'));var util=require(_0x7ec8('0x1'));var path=require(_0x7ec8('0x2'));var timeout=require(_0x7ec8('0x3'));var express=require(_0x7ec8('0x4'));var router=express[_0x7ec8('0x5')]();var fs_extra=require(_0x7ec8('0x6'));var auth=require(_0x7ec8('0x7'));var interaction=require(_0x7ec8('0x8'));var config=require(_0x7ec8('0x9'));var controller=require(_0x7ec8('0xa'));router[_0x7ec8('0xb')]('/',auth[_0x7ec8('0xc')](),controller[_0x7ec8('0xd')]);router[_0x7ec8('0xb')](_0x7ec8('0xe'),auth[_0x7ec8('0xc')](),controller[_0x7ec8('0xf')]);router[_0x7ec8('0xb')](_0x7ec8('0x10'),auth['isAuthenticated'](),controller[_0x7ec8('0x11')]);router[_0x7ec8('0x12')]('/',auth[_0x7ec8('0xc')](),controller['create']);router[_0x7ec8('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7ec8('0x14')]);router['delete']('/:id',auth[_0x7ec8('0xc')](),controller[_0x7ec8('0x15')]);module[_0x7ec8('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index fdd5f9b..24cf100 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 _0x0ec0=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x4afff0,_0x29e1b6){var _0x3a6bb5=function(_0x4f86c3){while(--_0x4f86c3){_0x4afff0['push'](_0x4afff0['shift']());}};_0x3a6bb5(++_0x29e1b6);}(_0x0ec0,0x6e));var _0x00ec=function(_0x45432c,_0x2bb432){_0x45432c=_0x45432c-0x0;var _0x1aa637=_0x0ec0[_0x45432c];return _0x1aa637;};'use strict';var Sequelize=require(_0x00ec('0x0'));module[_0x00ec('0x1')]={'name':{'type':Sequelize[_0x00ec('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x00ec('0x3')](_0x00ec('0x4'),_0x00ec('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x69e7=['ENUM','mouseOver','timeout','STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69e7,0x11c));var _0x769e=function(_0x5e66b0,_0x5bef62){_0x5e66b0=_0x5e66b0-0x0;var _0x9a3372=_0x69e7[_0x5e66b0];return _0x9a3372;};'use strict';var Sequelize=require('sequelize');module[_0x769e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x769e('0x1')](_0x769e('0x2'),_0x769e('0x3')),'defaultValue':_0x769e('0x2')},'selector':{'type':Sequelize[_0x769e('0x4')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 2dbd804..3af3d90 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 _0x4b1f=['rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','create','body','catch','eml-format'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4b1f,0x195));var _0xf4b1=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x4b1f[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require(_0xf4b1('0x0'));var rimraf=require(_0xf4b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4b1('0x2'));var rp=require(_0xf4b1('0x3'));var moment=require(_0xf4b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4b1('0x5'));var util=require(_0xf4b1('0x6'));var path=require(_0xf4b1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4b1('0x8'));var fs=require('fs');var fs_extra=require(_0xf4b1('0x9'));var _=require(_0xf4b1('0xa'));var squel=require(_0xf4b1('0xb'));var crypto=require(_0xf4b1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4b1('0xd'));var Papa=require('papaparse');var Redis=require(_0xf4b1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4b1('0xf'));var hardwareService=require(_0xf4b1('0x10'));var logger=require(_0xf4b1('0x11'))(_0xf4b1('0x12'));var utils=require(_0xf4b1('0x13'));var config=require(_0xf4b1('0x14'));var licenseUtil=require(_0xf4b1('0x15'));var db=require(_0xf4b1('0x16'))['db'];function respondWithStatusCode(_0x38afbb,_0xf66b4c){_0xf66b4c=_0xf66b4c||0xcc;return function(_0x2c4eb9){if(_0x2c4eb9){return _0x38afbb[_0xf4b1('0x17')](_0xf66b4c);}return _0x38afbb[_0xf4b1('0x18')](_0xf66b4c)['end']();};}function respondWithResult(_0x591476,_0x3ea6f3){_0x3ea6f3=_0x3ea6f3||0xc8;return function(_0x5cbc25){if(_0x5cbc25){return _0x591476['status'](_0x3ea6f3)[_0xf4b1('0x19')](_0x5cbc25);}};}function respondWithFilteredResult(_0x51c39f,_0x5764b1){return function(_0x293f59){if(_0x293f59){var _0x4968f4=typeof _0x5764b1['offset']==='undefined'&&typeof _0x5764b1['limit']===_0xf4b1('0x1a');var _0x3ee70a=_0x293f59['count'];var _0x3b378e=_0x4968f4?0x0:_0x5764b1[_0xf4b1('0x1b')];var _0x322b38=_0x4968f4?_0x293f59[_0xf4b1('0x1c')]:_0x5764b1[_0xf4b1('0x1b')]+_0x5764b1[_0xf4b1('0x1d')];var _0x5b0214;if(_0x322b38>=_0x3ee70a){_0x322b38=_0x3ee70a;_0x5b0214=0xc8;}else{_0x5b0214=0xce;}_0x51c39f[_0xf4b1('0x18')](_0x5b0214);return _0x51c39f[_0xf4b1('0x1e')]('Content-Range',_0x3b378e+'-'+_0x322b38+'/'+_0x3ee70a)[_0xf4b1('0x19')](_0x293f59);}return null;};}function patchUpdates(_0x30c239){return function(_0x56ef48){try{jsonpatch[_0xf4b1('0x1f')](_0x56ef48,_0x30c239,!![]);}catch(_0x559a64){return BPromise[_0xf4b1('0x20')](_0x559a64);}return _0x56ef48[_0xf4b1('0x21')]();};}function saveUpdates(_0x5c50e8,_0x20013c){return function(_0x29b8c1){if(_0x29b8c1){return _0x29b8c1[_0xf4b1('0x22')](_0x5c50e8)[_0xf4b1('0x23')](function(_0x58376d){return _0x58376d;});}return null;};}function removeEntity(_0x92b390,_0x474212){return function(_0x4b6c08){if(_0x4b6c08){return _0x4b6c08[_0xf4b1('0x24')]()['then'](function(){_0x92b390[_0xf4b1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x238fbe,_0x392165){return function(_0x2e803d){if(!_0x2e803d){_0x238fbe['sendStatus'](0x194);}return _0x2e803d;};}function handleError(_0x10bea4,_0x5ace8c){_0x5ace8c=_0x5ace8c||0x1f4;return function(_0x2e3b90){logger['error'](_0x2e3b90[_0xf4b1('0x25')]);if(_0x2e3b90[_0xf4b1('0x26')]){delete _0x2e3b90['name'];}_0x10bea4[_0xf4b1('0x18')](_0x5ace8c)[_0xf4b1('0x27')](_0x2e3b90);};}exports['show']=function(_0x125bf4,_0x35877b){var _0x3fe08e={'raw':!![],'where':{'id':_0x125bf4[_0xf4b1('0x28')]['id']}},_0x11ffb3={};_0x11ffb3[_0xf4b1('0x29')]=_[_0xf4b1('0x2a')](db['ChatProactiveAction']['rawAttributes']);_0x11ffb3[_0xf4b1('0x2b')]=_[_0xf4b1('0x2a')](_0x125bf4[_0xf4b1('0x2b')]);_0x11ffb3[_0xf4b1('0x2c')]=_[_0xf4b1('0x2d')](_0x11ffb3['model'],_0x11ffb3[_0xf4b1('0x2b')]);_0x3fe08e[_0xf4b1('0x2e')]=_[_0xf4b1('0x2d')](_0x11ffb3[_0xf4b1('0x29')],qs[_0xf4b1('0x2f')](_0x125bf4[_0xf4b1('0x2b')][_0xf4b1('0x2f')]));_0x3fe08e[_0xf4b1('0x2e')]=_0x3fe08e['attributes'][_0xf4b1('0x30')]?_0x3fe08e['attributes']:_0x11ffb3['model'];if(_0x125bf4['query'][_0xf4b1('0x31')]){_0x3fe08e[_0xf4b1('0x32')]=[{'all':!![]}];}_0x3fe08e=_[_0xf4b1('0x33')]({},_0x3fe08e,_0x125bf4[_0xf4b1('0x34')]);return db[_0xf4b1('0x35')][_0xf4b1('0x36')](_0x3fe08e)[_0xf4b1('0x23')](handleEntityNotFound(_0x35877b,null))[_0xf4b1('0x23')](respondWithResult(_0x35877b,null))['catch'](handleError(_0x35877b,null));};exports[_0xf4b1('0x37')]=function(_0x5ace1a,_0x24bcae){return db[_0xf4b1('0x35')]['create'](_0x5ace1a[_0xf4b1('0x38')],{})[_0xf4b1('0x23')](respondWithResult(_0x24bcae,0xc9))[_0xf4b1('0x39')](handleError(_0x24bcae,null));};exports[_0xf4b1('0x22')]=function(_0x23b3ac,_0x54e422){if(_0x23b3ac[_0xf4b1('0x38')]['id']){delete _0x23b3ac['body']['id'];}return db[_0xf4b1('0x35')]['find']({'where':{'id':_0x23b3ac[_0xf4b1('0x28')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x54e422,null))[_0xf4b1('0x23')](saveUpdates(_0x23b3ac['body'],null))[_0xf4b1('0x23')](respondWithResult(_0x54e422,null))[_0xf4b1('0x39')](handleError(_0x54e422,null));};exports[_0xf4b1('0x24')]=function(_0x3c9656,_0x43ba77){return db[_0xf4b1('0x35')][_0xf4b1('0x36')]({'where':{'id':_0x3c9656['params']['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x43ba77,null))[_0xf4b1('0x23')](removeEntity(_0x43ba77,null))[_0xf4b1('0x39')](handleError(_0x43ba77,null));}; \ No newline at end of file +var _0x72b1=['include','options','find','body','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72b1,0x16e));var _0x172b=function(_0x57beb4,_0x45dbe1){_0x57beb4=_0x57beb4-0x0;var _0x4a547d=_0x72b1[_0x57beb4];return _0x4a547d;};'use strict';var emlformat=require(_0x172b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x172b('0x1'));var jsonpatch=require(_0x172b('0x2'));var rp=require(_0x172b('0x3'));var moment=require(_0x172b('0x4'));var BPromise=require(_0x172b('0x5'));var Mustache=require(_0x172b('0x6'));var util=require(_0x172b('0x7'));var path=require('path');var sox=require(_0x172b('0x8'));var csv=require(_0x172b('0x9'));var ejs=require(_0x172b('0xa'));var fs=require('fs');var fs_extra=require(_0x172b('0xb'));var _=require('lodash');var squel=require(_0x172b('0xc'));var crypto=require('crypto');var jsforce=require(_0x172b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x172b('0x9'));var querystring=require(_0x172b('0xe'));var Papa=require(_0x172b('0xf'));var Redis=require(_0x172b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x172b('0x11'));var as=require(_0x172b('0x12'));var hardwareService=require(_0x172b('0x13'));var logger=require(_0x172b('0x14'))(_0x172b('0x15'));var utils=require(_0x172b('0x16'));var config=require(_0x172b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x172b('0x18'))['db'];function respondWithStatusCode(_0x82727f,_0xdf832e){_0xdf832e=_0xdf832e||0xcc;return function(_0x4970f8){if(_0x4970f8){return _0x82727f[_0x172b('0x19')](_0xdf832e);}return _0x82727f['status'](_0xdf832e)[_0x172b('0x1a')]();};}function respondWithResult(_0x81e11e,_0x5239b9){_0x5239b9=_0x5239b9||0xc8;return function(_0x1b7247){if(_0x1b7247){return _0x81e11e[_0x172b('0x1b')](_0x5239b9)[_0x172b('0x1c')](_0x1b7247);}};}function respondWithFilteredResult(_0xa28463,_0x5b0ab1){return function(_0x5293ef){if(_0x5293ef){var _0x3625bb=typeof _0x5b0ab1[_0x172b('0x1d')]===_0x172b('0x1e')&&typeof _0x5b0ab1[_0x172b('0x1f')]==='undefined';var _0x4f369b=_0x5293ef[_0x172b('0x20')];var _0x3b2701=_0x3625bb?0x0:_0x5b0ab1[_0x172b('0x1d')];var _0xba7825=_0x3625bb?_0x5293ef[_0x172b('0x20')]:_0x5b0ab1['offset']+_0x5b0ab1[_0x172b('0x1f')];var _0x2d24f9;if(_0xba7825>=_0x4f369b){_0xba7825=_0x4f369b;_0x2d24f9=0xc8;}else{_0x2d24f9=0xce;}_0xa28463[_0x172b('0x1b')](_0x2d24f9);return _0xa28463[_0x172b('0x21')](_0x172b('0x22'),_0x3b2701+'-'+_0xba7825+'/'+_0x4f369b)[_0x172b('0x1c')](_0x5293ef);}return null;};}function patchUpdates(_0x296aa6){return function(_0x5c7e17){try{jsonpatch['apply'](_0x5c7e17,_0x296aa6,!![]);}catch(_0x562db9){return BPromise['reject'](_0x562db9);}return _0x5c7e17[_0x172b('0x23')]();};}function saveUpdates(_0x4c8090,_0x721d07){return function(_0x25ee62){if(_0x25ee62){return _0x25ee62[_0x172b('0x24')](_0x4c8090)[_0x172b('0x25')](function(_0x32419a){return _0x32419a;});}return null;};}function removeEntity(_0x24e4ff,_0x507b99){return function(_0x1cefd1){if(_0x1cefd1){return _0x1cefd1[_0x172b('0x26')]()['then'](function(){_0x24e4ff[_0x172b('0x1b')](0xcc)[_0x172b('0x1a')]();});}};}function handleEntityNotFound(_0x3df490,_0x29e1d4){return function(_0x356c83){if(!_0x356c83){_0x3df490[_0x172b('0x19')](0x194);}return _0x356c83;};}function handleError(_0x39bdc5,_0x5ee442){_0x5ee442=_0x5ee442||0x1f4;return function(_0x1deb7e){logger[_0x172b('0x27')](_0x1deb7e['stack']);if(_0x1deb7e[_0x172b('0x28')]){delete _0x1deb7e[_0x172b('0x28')];}_0x39bdc5[_0x172b('0x1b')](_0x5ee442)[_0x172b('0x29')](_0x1deb7e);};}exports[_0x172b('0x2a')]=function(_0x4bea8e,_0x9624f5){var _0x37acc5={'raw':!![],'where':{'id':_0x4bea8e['params']['id']}},_0x596b4c={};_0x596b4c[_0x172b('0x2b')]=_[_0x172b('0x2c')](db[_0x172b('0x2d')][_0x172b('0x2e')]);_0x596b4c[_0x172b('0x2f')]=_[_0x172b('0x2c')](_0x4bea8e[_0x172b('0x2f')]);_0x596b4c[_0x172b('0x30')]=_[_0x172b('0x31')](_0x596b4c[_0x172b('0x2b')],_0x596b4c[_0x172b('0x2f')]);_0x37acc5[_0x172b('0x32')]=_[_0x172b('0x31')](_0x596b4c[_0x172b('0x2b')],qs[_0x172b('0x33')](_0x4bea8e[_0x172b('0x2f')][_0x172b('0x33')]));_0x37acc5[_0x172b('0x32')]=_0x37acc5[_0x172b('0x32')][_0x172b('0x34')]?_0x37acc5[_0x172b('0x32')]:_0x596b4c[_0x172b('0x2b')];if(_0x4bea8e[_0x172b('0x2f')][_0x172b('0x35')]){_0x37acc5[_0x172b('0x36')]=[{'all':!![]}];}_0x37acc5=_['merge']({},_0x37acc5,_0x4bea8e[_0x172b('0x37')]);return db[_0x172b('0x2d')][_0x172b('0x38')](_0x37acc5)['then'](handleEntityNotFound(_0x9624f5,null))[_0x172b('0x25')](respondWithResult(_0x9624f5,null))['catch'](handleError(_0x9624f5,null));};exports['create']=function(_0x5cc073,_0x1009ae){return db['ChatProactiveAction']['create'](_0x5cc073[_0x172b('0x39')],{})[_0x172b('0x25')](respondWithResult(_0x1009ae,0xc9))[_0x172b('0x3a')](handleError(_0x1009ae,null));};exports['update']=function(_0x6e07a2,_0x1f5516){if(_0x6e07a2[_0x172b('0x39')]['id']){delete _0x6e07a2[_0x172b('0x39')]['id'];}return db[_0x172b('0x2d')][_0x172b('0x38')]({'where':{'id':_0x6e07a2[_0x172b('0x3b')]['id']}})[_0x172b('0x25')](handleEntityNotFound(_0x1f5516,null))[_0x172b('0x25')](saveUpdates(_0x6e07a2[_0x172b('0x39')],null))[_0x172b('0x25')](respondWithResult(_0x1f5516,null))[_0x172b('0x3a')](handleError(_0x1f5516,null));};exports[_0x172b('0x26')]=function(_0x45ee12,_0x51ac71){return db[_0x172b('0x2d')][_0x172b('0x38')]({'where':{'id':_0x45ee12[_0x172b('0x3b')]['id']}})[_0x172b('0x25')](handleEntityNotFound(_0x51ac71,null))['then'](removeEntity(_0x51ac71,null))['catch'](handleError(_0x51ac71,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 57aee1a..ccf2a7d 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 _0x83b2=['bluebird','request-promise','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x83b2,0x1b5));var _0x283b=function(_0x1bab72,_0x15b7ac){_0x1bab72=_0x1bab72-0x0;var _0x8ba5be=_0x83b2[_0x1bab72];return _0x8ba5be;};'use strict';var _=require(_0x283b('0x0'));var util=require(_0x283b('0x1'));var logger=require(_0x283b('0x2'))(_0x283b('0x3'));var moment=require(_0x283b('0x4'));var BPromise=require(_0x283b('0x5'));var rp=require(_0x283b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x283b('0x7'));var config=require('../../config/environment');var attributes=require(_0x283b('0x8'));module[_0x283b('0x9')]=function(_0x354e98,_0x57ca64){return _0x354e98[_0x283b('0xa')](_0x283b('0xb'),attributes,{'tableName':_0x283b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc35=['chat_proactive_actions','lodash','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction'];(function(_0x23774a,_0x4a5bed){var _0x29c41c=function(_0xc4f0cf){while(--_0xc4f0cf){_0x23774a['push'](_0x23774a['shift']());}};_0x29c41c(++_0x4a5bed);}(_0xfc35,0x196));var _0x5fc3=function(_0x423d72,_0x23b4b1){_0x423d72=_0x423d72-0x0;var _0x502c2a=_0xfc35[_0x423d72];return _0x502c2a;};'use strict';var _=require(_0x5fc3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5fc3('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fc3('0x2'));var rimraf=require(_0x5fc3('0x3'));var config=require(_0x5fc3('0x4'));var attributes=require('./chatProactiveAction.attributes');module[_0x5fc3('0x5')]=function(_0x320f80,_0x4c07ae){return _0x320f80[_0x5fc3('0x6')](_0x5fc3('0x7'),attributes,{'tableName':_0x5fc3('0x8'),'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 3c09999..b05030d 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 _0x7b81=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','moment','bluebird'];(function(_0x3312ee,_0x686154){var _0x5e5fbf=function(_0x3941db){while(--_0x3941db){_0x3312ee['push'](_0x3312ee['shift']());}};_0x5e5fbf(++_0x686154);}(_0x7b81,0x189));var _0x17b8=function(_0x26456d,_0x4cdf03){_0x26456d=_0x26456d-0x0;var _0x7acbf0=_0x7b81[_0x26456d];return _0x7acbf0;};'use strict';var _=require(_0x17b8('0x0'));var util=require('util');var moment=require(_0x17b8('0x1'));var BPromise=require(_0x17b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17b8('0x3'));var db=require(_0x17b8('0x4'))['db'];var utils=require(_0x17b8('0x5'));var logger=require(_0x17b8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x17b8('0x7'));var client=jayson[_0x17b8('0x8')][_0x17b8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e17e7,_0x3b92ae,_0x4ed4d1){return new BPromise(function(_0xf8e6bf,_0x3a58a3){return client[_0x17b8('0xa')](_0x3e17e7,_0x4ed4d1)[_0x17b8('0xb')](function(_0x2d457f){logger[_0x17b8('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b92ae,_0x17b8('0xd'));logger['debug'](_0x17b8('0xe'),_0x3b92ae,'request\x20sent',JSON[_0x17b8('0xf')](_0x2d457f));if(_0x2d457f[_0x17b8('0x10')]){if(_0x2d457f[_0x17b8('0x10')][_0x17b8('0x11')]===0x1f4){logger[_0x17b8('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b92ae,_0x2d457f['error'][_0x17b8('0x12')]);return _0x3a58a3(_0x2d457f['error'][_0x17b8('0x12')]);}logger[_0x17b8('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b92ae,_0x2d457f[_0x17b8('0x10')][_0x17b8('0x12')]);return _0xf8e6bf(_0x2d457f['error'][_0x17b8('0x12')]);}else{logger[_0x17b8('0xc')](_0x17b8('0x13'),_0x3b92ae,_0x17b8('0xd'));_0xf8e6bf(_0x2d457f[_0x17b8('0x14')]['message']);}})[_0x17b8('0x15')](function(_0x398a49){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3b92ae,_0x398a49);_0x3a58a3(_0x398a49);});});} \ No newline at end of file +var _0xfa69=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x143a6a,_0x560e0f){var _0x4bbe68=function(_0x200889){while(--_0x200889){_0x143a6a['push'](_0x143a6a['shift']());}};_0x4bbe68(++_0x560e0f);}(_0xfa69,0x17e));var _0x9fa6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfa69[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x9fa6('0x0'));var util=require(_0x9fa6('0x1'));var moment=require(_0x9fa6('0x2'));var BPromise=require(_0x9fa6('0x3'));var rs=require(_0x9fa6('0x4'));var fs=require('fs');var Redis=require(_0x9fa6('0x5'));var db=require(_0x9fa6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9fa6('0x7'))(_0x9fa6('0x8'));var config=require(_0x9fa6('0x9'));var jayson=require(_0x9fa6('0xa'));var client=jayson[_0x9fa6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x505a79,_0x20db51,_0x150927){return new BPromise(function(_0x5565f6,_0x9b63f1){return client[_0x9fa6('0xc')](_0x505a79,_0x150927)[_0x9fa6('0xd')](function(_0x2bc8d4){logger[_0x9fa6('0xe')](_0x9fa6('0xf'),_0x20db51,_0x9fa6('0x10'));logger[_0x9fa6('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x20db51,'request\x20sent',JSON[_0x9fa6('0x12')](_0x2bc8d4));if(_0x2bc8d4[_0x9fa6('0x13')]){if(_0x2bc8d4[_0x9fa6('0x13')][_0x9fa6('0x14')]===0x1f4){logger[_0x9fa6('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x20db51,_0x2bc8d4[_0x9fa6('0x13')][_0x9fa6('0x15')]);return _0x9b63f1(_0x2bc8d4[_0x9fa6('0x13')][_0x9fa6('0x15')]);}logger[_0x9fa6('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x20db51,_0x2bc8d4['error']['message']);return _0x5565f6(_0x2bc8d4[_0x9fa6('0x13')][_0x9fa6('0x15')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x20db51,_0x9fa6('0x10'));_0x5565f6(_0x2bc8d4[_0x9fa6('0x16')][_0x9fa6('0x15')]);}})[_0x9fa6('0x17')](function(_0x5aae1d){logger[_0x9fa6('0x13')](_0x9fa6('0xf'),_0x20db51,_0x5aae1d);_0x9b63f1(_0x5aae1d);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 7d7a3d3..54cce54 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 _0x55ca=['multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','destroy','exports'];(function(_0x1fba51,_0x42048b){var _0x179faf=function(_0x28b61d){while(--_0x28b61d){_0x1fba51['push'](_0x1fba51['shift']());}};_0x179faf(++_0x42048b);}(_0x55ca,0x126));var _0xa55c=function(_0x354083,_0x1a40bb){_0x354083=_0x354083-0x0;var _0x37e5a2=_0x55ca[_0x354083];return _0x37e5a2;};'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')](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x9')](),controller[_0xa55c('0xb')]);router['put'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller['update']);router['delete'](_0xa55c('0x8'),auth[_0xa55c('0x9')](),controller[_0xa55c('0xc')]);module[_0xa55c('0xd')]=router; \ No newline at end of file +var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xeff8,0x186));var _0x8eff=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xeff8[_0x45f951];return _0x24756c;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);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 a0c6c70..ebabff0 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 _0x450d=['INTEGER','ENUM','beepall','sequelize','exports','STRING','name'];(function(_0x15c4ee,_0x2d6e6b){var _0x4f055e=function(_0x3a0c79){while(--_0x3a0c79){_0x15c4ee['push'](_0x15c4ee['shift']());}};_0x4f055e(++_0x2d6e6b);}(_0x450d,0x15a));var _0xd450=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x450d[_0xb24a3e];return _0x4038d7;};'use strict';var Sequelize=require(_0xd450('0x0'));module[_0xd450('0x1')]={'name':{'type':Sequelize[_0xd450('0x2')],'unique':_0xd450('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd450('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd450('0x5')]('rrmemory',_0xd450('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x9ac6=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x5b4657,_0x3cf2d7){var _0x484a5f=function(_0x54f6a6){while(--_0x54f6a6){_0x5b4657['push'](_0x5b4657['shift']());}};_0x484a5f(++_0x3cf2d7);}(_0x9ac6,0xe6));var _0x69ac=function(_0x2c3ee4,_0x1009ea){_0x2c3ee4=_0x2c3ee4-0x0;var _0x12fefa=_0x9ac6[_0x2c3ee4];return _0x12fefa;};'use strict';var Sequelize=require(_0x69ac('0x0'));module[_0x69ac('0x1')]={'name':{'type':Sequelize[_0x69ac('0x2')],'unique':_0x69ac('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x69ac('0x2')]},'timeout':{'type':Sequelize[_0x69ac('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x69ac('0x5'),_0x69ac('0x6'),_0x69ac('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 5c801df..fa2fca7 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 _0xdc5c=['isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','./chatQueue.socket','register','jayson/promise','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','name','index','ChatQueue','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','sort','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','pick','ids','Agents','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdc5c,0x99));var _0xcdc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc5c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdc5('0x0'));var zipdir=require(_0xcdc5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcdc5('0x2'));var BPromise=require(_0xcdc5('0x3'));var Mustache=require(_0xcdc5('0x4'));var util=require(_0xcdc5('0x5'));var path=require(_0xcdc5('0x6'));var sox=require(_0xcdc5('0x7'));var csv=require(_0xcdc5('0x8'));var ejs=require(_0xcdc5('0x9'));var fs=require('fs');var fs_extra=require(_0xcdc5('0xa'));var _=require(_0xcdc5('0xb'));var squel=require(_0xcdc5('0xc'));var crypto=require(_0xcdc5('0xd'));var jsforce=require(_0xcdc5('0xe'));var deskjs=require(_0xcdc5('0xf'));var toCsv=require(_0xcdc5('0x8'));var querystring=require('querystring');var Papa=require(_0xcdc5('0x10'));var Redis=require(_0xcdc5('0x11'));var authService=require(_0xcdc5('0x12'));var qs=require(_0xcdc5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdc5('0x14'));var logger=require(_0xcdc5('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcdc5('0x16'));var licenseUtil=require(_0xcdc5('0x17'));var db=require(_0xcdc5('0x18'))['db'];config[_0xcdc5('0x19')]=_['defaults'](config[_0xcdc5('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcdc5('0x19')]));require(_0xcdc5('0x1a'))[_0xcdc5('0x1b')](socket);var jayson=require(_0xcdc5('0x1c'));var client=jayson[_0xcdc5('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462a06,_0x2c114d,_0x3e6c48,_0x29298e){return new BPromise(function(_0x357e91,_0x1727dd){var _0x1f9115=_0x29298e||client;return _0x1f9115['request'](_0x462a06,_0x3e6c48)[_0xcdc5('0x1e')](function(_0x278a82){logger[_0xcdc5('0x1f')](_0xcdc5('0x20'),_0x2c114d,_0xcdc5('0x21'));logger[_0xcdc5('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2c114d,_0xcdc5('0x21'),JSON[_0xcdc5('0x23')](_0x278a82));if(_0x278a82[_0xcdc5('0x24')]){if(_0x278a82[_0xcdc5('0x24')]['code']===0x1f4){logger['error'](_0xcdc5('0x20'),_0x2c114d,_0x278a82[_0xcdc5('0x24')][_0xcdc5('0x25')]);return _0x1727dd(_0x278a82['error'][_0xcdc5('0x25')]);}logger['error'](_0xcdc5('0x20'),_0x2c114d,_0x278a82[_0xcdc5('0x24')]['message']);return _0x357e91(_0x278a82['error'][_0xcdc5('0x25')]);}else{logger[_0xcdc5('0x1f')](_0xcdc5('0x20'),_0x2c114d,_0xcdc5('0x21'));_0x357e91(_0x278a82['result'][_0xcdc5('0x25')]);}})[_0xcdc5('0x26')](function(_0x4fd30f){logger[_0xcdc5('0x24')](_0xcdc5('0x20'),_0x2c114d,_0x4fd30f);_0x1727dd(_0x4fd30f);});});}function respondWithStatusCode(_0x24d483,_0x3f797b){_0x3f797b=_0x3f797b||0xcc;return function(_0x1820ea){if(_0x1820ea){return _0x24d483[_0xcdc5('0x27')](_0x3f797b);}return _0x24d483[_0xcdc5('0x28')](_0x3f797b)[_0xcdc5('0x29')]();};}function respondWithResult(_0x4b8839,_0x40866b){_0x40866b=_0x40866b||0xc8;return function(_0x1b8956){if(_0x1b8956){return _0x4b8839[_0xcdc5('0x28')](_0x40866b)['json'](_0x1b8956);}};}function respondWithFilteredResult(_0x20b6b0,_0x3a4a71){return function(_0x2d56d6){if(_0x2d56d6){var _0x21a593=typeof _0x3a4a71[_0xcdc5('0x2a')]===_0xcdc5('0x2b')&&typeof _0x3a4a71['limit']===_0xcdc5('0x2b');var _0x55f1d0=_0x2d56d6['count'];var _0x3b9441=_0x21a593?0x0:_0x3a4a71[_0xcdc5('0x2a')];var _0x1f96b7=_0x21a593?_0x2d56d6[_0xcdc5('0x2c')]:_0x3a4a71['offset']+_0x3a4a71[_0xcdc5('0x2d')];var _0x4f3154;if(_0x1f96b7>=_0x55f1d0){_0x1f96b7=_0x55f1d0;_0x4f3154=0xc8;}else{_0x4f3154=0xce;}_0x20b6b0[_0xcdc5('0x28')](_0x4f3154);return _0x20b6b0[_0xcdc5('0x2e')](_0xcdc5('0x2f'),_0x3b9441+'-'+_0x1f96b7+'/'+_0x55f1d0)['json'](_0x2d56d6);}return null;};}function patchUpdates(_0xe69ffd){return function(_0x2f158a){try{jsonpatch[_0xcdc5('0x30')](_0x2f158a,_0xe69ffd,!![]);}catch(_0x21720a){return BPromise['reject'](_0x21720a);}return _0x2f158a[_0xcdc5('0x31')]();};}function saveUpdates(_0x2bd028,_0x51f417){return function(_0x324ae2){if(_0x324ae2){return _0x324ae2[_0xcdc5('0x32')](_0x2bd028)[_0xcdc5('0x1e')](function(_0x17606a){return _0x17606a;});}return null;};}function removeEntity(_0x985d8f,_0x455b02){return function(_0x50f983){if(_0x50f983){return _0x50f983[_0xcdc5('0x33')]()['then'](function(){var _0x182c75=_0x50f983[_0xcdc5('0x34')]({'plain':!![]});var _0x1525d7=_0xcdc5('0x35');return db[_0xcdc5('0x36')][_0xcdc5('0x33')]({'where':{'type':_0x1525d7,'resourceId':_0x182c75['id']}})[_0xcdc5('0x1e')](function(){return _0x50f983;});})[_0xcdc5('0x1e')](function(){_0x985d8f[_0xcdc5('0x28')](0xcc)[_0xcdc5('0x29')]();});}};}function handleEntityNotFound(_0x19152a,_0x4f788c){return function(_0x18f572){if(!_0x18f572){_0x19152a['sendStatus'](0x194);}return _0x18f572;};}function handleError(_0x5ddf73,_0x35de37){_0x35de37=_0x35de37||0x1f4;return function(_0x3bad92){logger[_0xcdc5('0x24')](_0x3bad92['stack']);if(_0x3bad92[_0xcdc5('0x37')]){delete _0x3bad92[_0xcdc5('0x37')];}_0x5ddf73[_0xcdc5('0x28')](_0x35de37)['send'](_0x3bad92);};}exports[_0xcdc5('0x38')]=function(_0x311ea8,_0x3f8fb6){var _0x36339c={},_0x430b93={},_0x1eba64={'count':0x0,'rows':[]};var _0x52edd5=_['map'](db[_0xcdc5('0x39')][_0xcdc5('0x3a')],function(_0x2df204){return{'name':_0x2df204[_0xcdc5('0x3b')],'type':_0x2df204['type']['key']};});_0x430b93['model']=_[_0xcdc5('0x3c')](_0x52edd5,_0xcdc5('0x37'));_0x430b93['query']=_[_0xcdc5('0x3d')](_0x311ea8[_0xcdc5('0x3e')]);_0x430b93[_0xcdc5('0x3f')]=_[_0xcdc5('0x40')](_0x430b93[_0xcdc5('0x41')],_0x430b93[_0xcdc5('0x3e')]);_0x36339c[_0xcdc5('0x42')]=_[_0xcdc5('0x40')](_0x430b93[_0xcdc5('0x41')],qs[_0xcdc5('0x43')](_0x311ea8[_0xcdc5('0x3e')]['fields']));_0x36339c[_0xcdc5('0x42')]=_0x36339c[_0xcdc5('0x42')][_0xcdc5('0x44')]?_0x36339c['attributes']:_0x430b93[_0xcdc5('0x41')];if(!_0x311ea8['query']['hasOwnProperty'](_0xcdc5('0x45'))){_0x36339c['limit']=qs['limit'](_0x311ea8[_0xcdc5('0x3e')][_0xcdc5('0x2d')]);_0x36339c['offset']=qs[_0xcdc5('0x2a')](_0x311ea8['query'][_0xcdc5('0x2a')]);}_0x36339c['order']=qs['sort'](_0x311ea8[_0xcdc5('0x3e')]['sort']);_0x36339c[_0xcdc5('0x46')]=qs[_0xcdc5('0x3f')](_['pick'](_0x311ea8[_0xcdc5('0x3e')],_0x430b93['filters']),_0x52edd5);if(_0x311ea8['query'][_0xcdc5('0x47')]){_0x36339c[_0xcdc5('0x46')]=_[_0xcdc5('0x48')](_0x36339c[_0xcdc5('0x46')],{'$or':_['map'](_0x52edd5,function(_0x27b5cb){if(_0x27b5cb[_0xcdc5('0x49')]!==_0xcdc5('0x4a')){var _0x241c78={};_0x241c78[_0x27b5cb[_0xcdc5('0x37')]]={'$like':'%'+_0x311ea8[_0xcdc5('0x3e')][_0xcdc5('0x47')]+'%'};return _0x241c78;}})});}_0x36339c=_[_0xcdc5('0x48')]({},_0x36339c,_0x311ea8[_0xcdc5('0x4b')]);var _0x4ab04f={'where':_0x36339c[_0xcdc5('0x46')]};return db[_0xcdc5('0x39')][_0xcdc5('0x2c')](_0x4ab04f)['then'](function(_0xbab22a){_0x1eba64[_0xcdc5('0x2c')]=_0xbab22a;if(_0x311ea8[_0xcdc5('0x3e')][_0xcdc5('0x4c')]){_0x36339c['include']=[{'all':!![]}];}return db['ChatQueue'][_0xcdc5('0x4d')](_0x36339c);})[_0xcdc5('0x1e')](function(_0x343353){_0x1eba64[_0xcdc5('0x4e')]=_0x343353;return _0x1eba64;})[_0xcdc5('0x1e')](respondWithFilteredResult(_0x3f8fb6,_0x36339c))['catch'](handleError(_0x3f8fb6,null));};exports[_0xcdc5('0x4f')]=function(_0x18c8ba,_0xe30482){var _0x18a77b={'raw':!![],'where':{'id':_0x18c8ba[_0xcdc5('0x50')]['id']}},_0x300611={};_0x300611[_0xcdc5('0x41')]=_['keys'](db[_0xcdc5('0x39')][_0xcdc5('0x3a')]);_0x300611[_0xcdc5('0x3e')]=_[_0xcdc5('0x3d')](_0x18c8ba[_0xcdc5('0x3e')]);_0x300611[_0xcdc5('0x3f')]=_[_0xcdc5('0x40')](_0x300611[_0xcdc5('0x41')],_0x300611[_0xcdc5('0x3e')]);_0x18a77b[_0xcdc5('0x42')]=_[_0xcdc5('0x40')](_0x300611[_0xcdc5('0x41')],qs[_0xcdc5('0x43')](_0x18c8ba[_0xcdc5('0x3e')][_0xcdc5('0x43')]));_0x18a77b[_0xcdc5('0x42')]=_0x18a77b[_0xcdc5('0x42')][_0xcdc5('0x44')]?_0x18a77b[_0xcdc5('0x42')]:_0x300611['model'];if(_0x18c8ba['query'][_0xcdc5('0x4c')]){_0x18a77b['include']=[{'all':!![]}];}_0x18a77b=_[_0xcdc5('0x48')]({},_0x18a77b,_0x18c8ba[_0xcdc5('0x4b')]);return db[_0xcdc5('0x39')][_0xcdc5('0x51')](_0x18a77b)[_0xcdc5('0x1e')](handleEntityNotFound(_0xe30482,null))['then'](respondWithResult(_0xe30482,null))[_0xcdc5('0x26')](handleError(_0xe30482,null));};exports[_0xcdc5('0x52')]=function(_0x4f2db2,_0xe8d89f){return db[_0xcdc5('0x39')][_0xcdc5('0x52')](_0x4f2db2['body'],{})[_0xcdc5('0x1e')](function(_0x43d1a0){var _0x5c1c5f=_0x4f2db2[_0xcdc5('0x53')]['get']({'plain':!![]});if(!_0x5c1c5f)throw new Error(_0xcdc5('0x54'));if(_0x5c1c5f[_0xcdc5('0x55')]===_0xcdc5('0x53')){var _0xfb01d9=_0x43d1a0[_0xcdc5('0x34')]({'plain':!![]});var _0xa4c4b2=_0xcdc5('0x35');return db['UserProfileSection'][_0xcdc5('0x51')]({'where':{'name':_0xa4c4b2,'userProfileId':_0x5c1c5f['userProfileId']},'raw':!![]})[_0xcdc5('0x1e')](function(_0x5408f1){if(_0x5408f1&&_0x5408f1['autoAssociation']===0x0){return db[_0xcdc5('0x36')][_0xcdc5('0x52')]({'name':_0xfb01d9[_0xcdc5('0x37')],'resourceId':_0xfb01d9['id'],'type':_0x5408f1['name'],'sectionId':_0x5408f1['id']},{})['then'](function(){return _0x43d1a0;});}else{return _0x43d1a0;}})['catch'](function(_0x1b6c52){logger[_0xcdc5('0x24')](_0xcdc5('0x56'),_0x1b6c52);throw _0x1b6c52;});}return _0x43d1a0;})[_0xcdc5('0x1e')](respondWithResult(_0xe8d89f,0xc9))[_0xcdc5('0x26')](handleError(_0xe8d89f,null));};exports[_0xcdc5('0x32')]=function(_0x2ed9b4,_0x896d90){if(_0x2ed9b4[_0xcdc5('0x57')]['id']){delete _0x2ed9b4[_0xcdc5('0x57')]['id'];}return db[_0xcdc5('0x39')]['find']({'where':{'id':_0x2ed9b4['params']['id']}})[_0xcdc5('0x1e')](handleEntityNotFound(_0x896d90,null))[_0xcdc5('0x1e')](saveUpdates(_0x2ed9b4[_0xcdc5('0x57')],null))[_0xcdc5('0x1e')](respondWithResult(_0x896d90,null))['catch'](handleError(_0x896d90,null));};exports['destroy']=function(_0x3ee0bb,_0x355f10){return db[_0xcdc5('0x39')][_0xcdc5('0x51')]({'where':{'id':_0x3ee0bb[_0xcdc5('0x50')]['id']}})[_0xcdc5('0x1e')](handleEntityNotFound(_0x355f10,null))[_0xcdc5('0x1e')](removeEntity(_0x355f10,null))['catch'](handleError(_0x355f10,null));};exports[_0xcdc5('0x58')]=function(_0x3f0800,_0x3ea2e0){return db[_0xcdc5('0x39')][_0xcdc5('0x58')]()[_0xcdc5('0x1e')](respondWithResult(_0x3ea2e0,null))['catch'](handleError(_0x3ea2e0,null));};exports[_0xcdc5('0x59')]=function(_0x8d140b,_0x3881ca,_0x5e95ef){var _0x1c2bab={'raw':!![],'where':{}},_0x5cd35b={},_0x216352;return db['ChatQueue'][_0xcdc5('0x5a')]({'where':{'id':_0x8d140b[_0xcdc5('0x50')]['id']}})[_0xcdc5('0x1e')](handleEntityNotFound(_0x3881ca,null))[_0xcdc5('0x1e')](function(_0x170831){if(_0x170831){_0x216352=_0x170831['get']({'plain':!![]});_0x5cd35b[_0xcdc5('0x41')]=_['keys'](db[_0xcdc5('0x5b')]['rawAttributes']);_0x5cd35b[_0xcdc5('0x3e')]=_['keys'](_0x8d140b[_0xcdc5('0x3e')]);_0x5cd35b[_0xcdc5('0x3f')]=_[_0xcdc5('0x40')](_0x5cd35b[_0xcdc5('0x41')],_0x5cd35b[_0xcdc5('0x3e')]);_0x1c2bab[_0xcdc5('0x42')]=_[_0xcdc5('0x40')](_0x5cd35b[_0xcdc5('0x41')],qs[_0xcdc5('0x43')](_0x8d140b['query']['fields']));_0x1c2bab[_0xcdc5('0x42')]=_0x1c2bab['attributes'][_0xcdc5('0x44')]?_0x1c2bab[_0xcdc5('0x42')]:_0x5cd35b[_0xcdc5('0x41')];if(!_0x8d140b['query'][_0xcdc5('0x5c')](_0xcdc5('0x45'))){_0x1c2bab[_0xcdc5('0x2d')]=qs[_0xcdc5('0x2d')](_0x8d140b['query'][_0xcdc5('0x2d')]);_0x1c2bab[_0xcdc5('0x2a')]=qs[_0xcdc5('0x2a')](_0x8d140b[_0xcdc5('0x3e')][_0xcdc5('0x2a')]);}_0x1c2bab[_0xcdc5('0x5d')]=qs[_0xcdc5('0x5e')](_0x8d140b[_0xcdc5('0x3e')]['sort']);_0x1c2bab['where']=qs['filters'](_['pick'](_0x8d140b['query'],_0x5cd35b[_0xcdc5('0x3f')]));_0x1c2bab[_0xcdc5('0x46')][_0xcdc5('0x5f')]=_0x170831['id'];if(_0x8d140b[_0xcdc5('0x3e')]['filter']){_0x1c2bab[_0xcdc5('0x46')]=_[_0xcdc5('0x48')](_0x1c2bab[_0xcdc5('0x46')],{'$or':_[_0xcdc5('0x3c')](_0x1c2bab[_0xcdc5('0x42')],function(_0x31fb29){var _0x3516b4={};_0x3516b4[_0x31fb29]={'$like':'%'+_0x8d140b['query']['filter']+'%'};return _0x3516b4;})});}_0x1c2bab=_['merge']({},_0x1c2bab,_0x8d140b[_0xcdc5('0x4b')]);return db['UserChatQueue'][_0xcdc5('0x4d')](_0x1c2bab);}})[_0xcdc5('0x1e')](function(_0x4776cf){if(_0x4776cf){return db[_0xcdc5('0x60')][_0xcdc5('0x61')]({'where':{'id':_[_0xcdc5('0x3c')](_0x4776cf,_0xcdc5('0x62')),'role':_0xcdc5('0x63')},'attributes':['id','name',_0xcdc5('0x64'),_0xcdc5('0x65'),_0xcdc5('0x66')]});}})[_0xcdc5('0x1e')](function(_0x379904){if(_0x379904){return{'count':_0x379904[_0xcdc5('0x2c')],'rows':_['map'](_0x379904[_0xcdc5('0x4e')],function(_0x2bd321){return{'membername':_0x2bd321[_0xcdc5('0x37')],'UserId':_0x2bd321['id'],'queue_name':_0x216352['name'],'ChatQueueId':_0x216352['id'],'interface':util[_0xcdc5('0x67')]('%s/%s',_0xcdc5('0x68'),_0x2bd321[_0xcdc5('0x37')]),'penalty':0x0,'paused':_0x2bd321[_0xcdc5('0x64')],'createdAt':_0x2bd321[_0xcdc5('0x66')],'updatedAt':_0x2bd321['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xcdc5('0x1e')](respondWithFilteredResult(_0x3881ca,_0x1c2bab))[_0xcdc5('0x26')](handleError(_0x3881ca,null));};exports[_0xcdc5('0x69')]=function(_0x57ee79,_0x3787d6,_0x55487a){var _0x385bfe={};var _0x5e43dd={};var _0x4ea006;var _0x2f3af4;return db['ChatQueue']['findOne']({'where':{'id':_0x57ee79[_0xcdc5('0x50')]['id']}})[_0xcdc5('0x1e')](handleEntityNotFound(_0x3787d6,null))[_0xcdc5('0x1e')](function(_0x385071){if(_0x385071){_0x4ea006=_0x385071;_0x5e43dd[_0xcdc5('0x41')]=_[_0xcdc5('0x3d')](db[_0xcdc5('0x6a')][_0xcdc5('0x3a')]);_0x5e43dd['query']=_[_0xcdc5('0x3d')](_0x57ee79['query']);_0x5e43dd[_0xcdc5('0x3f')]=_['intersection'](_0x5e43dd[_0xcdc5('0x41')],_0x5e43dd['query']);_0x385bfe[_0xcdc5('0x42')]=_[_0xcdc5('0x40')](_0x5e43dd[_0xcdc5('0x41')],qs['fields'](_0x57ee79[_0xcdc5('0x3e')][_0xcdc5('0x43')]));_0x385bfe[_0xcdc5('0x42')]=_0x385bfe[_0xcdc5('0x42')][_0xcdc5('0x44')]?_0x385bfe['attributes']:_0x5e43dd[_0xcdc5('0x41')];_0x385bfe[_0xcdc5('0x5d')]=qs['sort'](_0x57ee79[_0xcdc5('0x3e')]['sort']);_0x385bfe['where']=qs[_0xcdc5('0x3f')](_[_0xcdc5('0x6b')](_0x57ee79['query'],_0x5e43dd[_0xcdc5('0x3f')]));if(_0x57ee79[_0xcdc5('0x3e')][_0xcdc5('0x47')]){_0x385bfe[_0xcdc5('0x46')]=_[_0xcdc5('0x48')](_0x385bfe[_0xcdc5('0x46')],{'$or':_[_0xcdc5('0x3c')](_0x385bfe[_0xcdc5('0x42')],function(_0x3b8e35){var _0x50ca0e={};_0x50ca0e[_0x3b8e35]={'$like':'%'+_0x57ee79[_0xcdc5('0x3e')][_0xcdc5('0x47')]+'%'};return _0x50ca0e;})});}_0x385bfe=_[_0xcdc5('0x48')]({},_0x385bfe,_0x57ee79[_0xcdc5('0x4b')]);return _0x4ea006[_0xcdc5('0x69')](_0x385bfe);}})[_0xcdc5('0x1e')](function(_0x2e8729){if(_0x2e8729){_0x2f3af4=_0x2e8729['length'];if(!_0x57ee79[_0xcdc5('0x3e')][_0xcdc5('0x5c')](_0xcdc5('0x45'))){_0x385bfe[_0xcdc5('0x2d')]=qs['limit'](_0x57ee79[_0xcdc5('0x3e')][_0xcdc5('0x2d')]);_0x385bfe[_0xcdc5('0x2a')]=qs[_0xcdc5('0x2a')](_0x57ee79[_0xcdc5('0x3e')][_0xcdc5('0x2a')]);}return _0x4ea006[_0xcdc5('0x69')](_0x385bfe);}})[_0xcdc5('0x1e')](function(_0x109a62){if(_0x109a62){return _0x109a62?{'count':_0x2f3af4,'rows':_0x109a62}:null;}})[_0xcdc5('0x1e')](respondWithResult(_0x3787d6,null))[_0xcdc5('0x26')](handleError(_0x3787d6,null));};exports['addTeams']=function(_0xf6b734,_0x209a26,_0xcdff85){var _0x5b5287=_0xf6b734[_0xcdc5('0x57')][_0xcdc5('0x6c')];return db[_0xcdc5('0x6a')][_0xcdc5('0x4d')]({'where':{'id':_0x5b5287},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcdc5('0x6d'),'attributes':['id',_0xcdc5('0x37'),'online','voicePause','interface'],'raw':!![]}]})[_0xcdc5('0x1e')](function(_0x379034){if(_0x379034){var _0x5442ce=_[_0xcdc5('0x6e')](_0x379034,function(_0x4a7d9a){var _0x556514=_0x4a7d9a[_0xcdc5('0x34')]({'plain':!![]});return _0x556514['Agents'];});return db['ChatQueue'][_0xcdc5('0x51')]({'where':{'id':_0xf6b734[_0xcdc5('0x50')]['id']}})[_0xcdc5('0x1e')](function(_0x27b87b){return db[_0xcdc5('0x6f')][_0xcdc5('0x70')](function(_0x2feffc){return _0x27b87b[_0xcdc5('0x71')](_0x5b5287,{'transaction':_0x2feffc})[_0xcdc5('0x1e')](function(){return BPromise[_0xcdc5('0x72')](_0x5442ce,function(_0x30fbf7){return db['UserChatQueue'][_0xcdc5('0x73')]({'where':{'UserId':_0x30fbf7['id'],'ChatQueueId':_0xf6b734[_0xcdc5('0x50')]['id']},'transaction':_0x2feffc});});})[_0xcdc5('0x1e')](function(){_0x5442ce[_0xcdc5('0x74')](function(_0x51e4a6){socket[_0xcdc5('0x75')](_0xcdc5('0x76'),{'UserId':_0x51e4a6['id'],'ChatQueueId':_0x27b87b['id']});});});});});}})[_0xcdc5('0x1e')](respondWithStatusCode(_0x209a26,null))[_0xcdc5('0x26')](handleError(_0x209a26,null));};exports[_0xcdc5('0x77')]=function(_0x4b72b7,_0x4f0822,_0x5200ae){return db[_0xcdc5('0x6a')]['findAll']({'where':{'id':_0x4b72b7['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xcdc5('0x60')],'as':_0xcdc5('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xcdc5('0x1e')](handleEntityNotFound(_0x4f0822,null))[_0xcdc5('0x1e')](function(_0x576757){var _0x4bebc7=_['map'](_0x576757,'id');var _0x4c3bda=[];var _0x3c6331=[];var _0x4d328a=squel[_0xcdc5('0x78')]();_0x4d328a['field']('tq.TeamId')[_0xcdc5('0x79')]('team_has_chat_queues','tq')[_0xcdc5('0x7a')](_0xcdc5('0x7b'),'ut',_0xcdc5('0x7c'))[_0xcdc5('0x46')](_0xcdc5('0x7d'),_0x4b72b7[_0xcdc5('0x50')]['id']);for(var _0x7a8648=0x0;_0x7a8648<_0x576757['length'];_0x7a8648+=0x1){let _0x20918c=_0x576757[_0x7a8648];for(var _0x40f50f=0x0;_0x40f50f<_0x20918c[_0xcdc5('0x6d')][_0xcdc5('0x44')];_0x40f50f+=0x1){let _0x11444a=_0x20918c[_0xcdc5('0x6d')][_0x40f50f];var _0x46fb08=_0x4d328a[_0xcdc5('0x7e')]();_0x46fb08[_0xcdc5('0x46')](_0xcdc5('0x7f'),_0x11444a['id']);_0x3c6331['push'](db[_0xcdc5('0x6f')][_0xcdc5('0x3e')](_0x46fb08['toString'](),{'type':db[_0xcdc5('0x6f')][_0xcdc5('0x80')][_0xcdc5('0x81')]})[_0xcdc5('0x1e')](function(_0x546ac5){if(_0x546ac5[_0xcdc5('0x44')]===0x1){return _0x11444a['id'];}else{var _0x61b845=_[_0xcdc5('0x82')](_['map'](_0x546ac5,_0xcdc5('0x83')),function(_0x71f23a){return _[_0xcdc5('0x84')](_0x4bebc7,_0x71f23a);});if(_0x61b845){return _0x11444a['id'];}}}));}}return BPromise[_0xcdc5('0x85')](_0x3c6331)[_0xcdc5('0x1e')](function(_0x8fe1ab){_0x4c3bda=_(_0x4c3bda)[_0xcdc5('0x86')](_0x8fe1ab)[_0xcdc5('0x87')]()[_0xcdc5('0x88')]();return db['ChatQueue']['find']({'where':{'id':_0x4b72b7['params']['id']}})['then'](function(_0x30eb78){return db[_0xcdc5('0x6f')]['transaction'](function(_0x1b0ef4){return _0x30eb78['removeTeams'](_0x4b72b7['query']['ids'],{'transaction':_0x1b0ef4})[_0xcdc5('0x1e')](function(){if(!_[_0xcdc5('0x89')](_0x4c3bda)){return _0x30eb78[_0xcdc5('0x8a')](_0x4c3bda,{'transaction':_0x1b0ef4});}})[_0xcdc5('0x1e')](function(){_0x4c3bda[_0xcdc5('0x74')](function(_0x3706d0){socket['emit'](_0xcdc5('0x8b'),{'UserId':_0x3706d0,'ChatQueueId':_0x30eb78['id']});});});});});});})[_0xcdc5('0x1e')](respondWithStatusCode(_0x4f0822,null))['catch'](handleError(_0x4f0822,null));};exports['addAgents']=function(_0xacf650,_0x5bb6f1,_0x4f7108){return db['ChatQueue'][_0xcdc5('0x51')]({'where':{'id':_0xacf650[_0xcdc5('0x50')]['id']}})[_0xcdc5('0x1e')](handleEntityNotFound(_0x5bb6f1,null))['then'](function(_0xc7c3ec){if(_0xc7c3ec){return _0xc7c3ec[_0xcdc5('0x8c')](_0xacf650[_0xcdc5('0x57')]['ids'],_[_0xcdc5('0x8d')](_0xacf650[_0xcdc5('0x57')],[_0xcdc5('0x6c'),'id'])||{})[_0xcdc5('0x8e')](function(_0x489db3){for(var _0x5c3ed6=0x0;_0x5c3ed6<_0xacf650[_0xcdc5('0x57')][_0xcdc5('0x6c')][_0xcdc5('0x44')];_0x5c3ed6+=0x1){socket[_0xcdc5('0x75')](_0xcdc5('0x76'),{'UserId':Number(_0xacf650[_0xcdc5('0x57')][_0xcdc5('0x6c')][_0x5c3ed6]),'ChatQueueId':Number(_0xacf650['params']['id'])});}return _0x489db3;});}})[_0xcdc5('0x1e')](respondWithResult(_0x5bb6f1,null))[_0xcdc5('0x26')](handleError(_0x5bb6f1,null));};exports[_0xcdc5('0x8a')]=function(_0x57b196,_0x5967d2,_0x141bf0){return db[_0xcdc5('0x39')][_0xcdc5('0x51')]({'where':{'id':_0x57b196[_0xcdc5('0x50')]['id']}})[_0xcdc5('0x1e')](handleEntityNotFound(_0x5967d2,null))[_0xcdc5('0x1e')](function(_0x3d217a){if(_0x3d217a){return _0x3d217a[_0xcdc5('0x8a')](_0x57b196['query'][_0xcdc5('0x6c')])[_0xcdc5('0x1e')](function(){if(_[_0xcdc5('0x8f')](_0x57b196[_0xcdc5('0x3e')][_0xcdc5('0x6c')])){for(var _0x3ca6a6=0x0;_0x3ca6a6<_0x57b196[_0xcdc5('0x3e')][_0xcdc5('0x6c')][_0xcdc5('0x44')];_0x3ca6a6+=0x1){socket['emit'](_0xcdc5('0x8b'),{'UserId':Number(_0x57b196[_0xcdc5('0x3e')][_0xcdc5('0x6c')][_0x3ca6a6]),'ChatQueueId':Number(_0x57b196['params']['id'])});}}else{socket[_0xcdc5('0x75')](_0xcdc5('0x8b'),{'UserId':Number(_0x57b196[_0xcdc5('0x3e')][_0xcdc5('0x6c')]),'ChatQueueId':Number(_0x57b196[_0xcdc5('0x50')]['id'])});}});}})[_0xcdc5('0x1e')](respondWithStatusCode(_0x5967d2,null))[_0xcdc5('0x26')](handleError(_0x5967d2,null));};exports[_0xcdc5('0x90')]=function(_0x42e622,_0x304d7c,_0x60a8f5){var _0x478661={};var _0x3b4c8a={};var _0x2730f7;var _0x1deb89;return db['ChatQueue'][_0xcdc5('0x5a')]({'where':{'id':_0x42e622[_0xcdc5('0x50')]['id']}})[_0xcdc5('0x1e')](handleEntityNotFound(_0x304d7c,null))[_0xcdc5('0x1e')](function(_0x491be0){if(_0x491be0){_0x2730f7=_0x491be0;_0x3b4c8a[_0xcdc5('0x41')]=_[_0xcdc5('0x3d')](db[_0xcdc5('0x60')][_0xcdc5('0x3a')]);_0x3b4c8a['query']=_[_0xcdc5('0x3d')](_0x42e622['query']);_0x3b4c8a['filters']=_[_0xcdc5('0x40')](_0x3b4c8a[_0xcdc5('0x41')],_0x3b4c8a[_0xcdc5('0x3e')]);_0x478661[_0xcdc5('0x42')]=_[_0xcdc5('0x40')](_0x3b4c8a[_0xcdc5('0x41')],qs[_0xcdc5('0x43')](_0x42e622[_0xcdc5('0x3e')]['fields']));_0x478661[_0xcdc5('0x42')]=_0x478661[_0xcdc5('0x42')]['length']?_0x478661[_0xcdc5('0x42')]:_0x3b4c8a[_0xcdc5('0x41')];_0x478661[_0xcdc5('0x5d')]=qs['sort'](_0x42e622['query'][_0xcdc5('0x5e')]);_0x478661[_0xcdc5('0x46')]=qs[_0xcdc5('0x3f')](_[_0xcdc5('0x6b')](_0x42e622[_0xcdc5('0x3e')],_0x3b4c8a[_0xcdc5('0x3f')]));if(_0x42e622['query'][_0xcdc5('0x47')]){_0x478661['where']=_[_0xcdc5('0x48')](_0x478661[_0xcdc5('0x46')],{'$or':_[_0xcdc5('0x3c')](_0x478661[_0xcdc5('0x42')],function(_0x2ba83f){var _0x15ef63={};_0x15ef63[_0x2ba83f]={'$like':'%'+_0x42e622[_0xcdc5('0x3e')][_0xcdc5('0x47')]+'%'};return _0x15ef63;})});}_0x478661=_[_0xcdc5('0x48')]({},_0x478661,_0x42e622[_0xcdc5('0x4b')]);return _0x2730f7[_0xcdc5('0x90')](_0x478661);}})['then'](function(_0x13ae2a){if(_0x13ae2a){_0x1deb89=_0x13ae2a['length'];if(!_0x42e622[_0xcdc5('0x3e')][_0xcdc5('0x5c')](_0xcdc5('0x45'))){_0x478661[_0xcdc5('0x2d')]=qs[_0xcdc5('0x2d')](_0x42e622['query']['limit']);_0x478661[_0xcdc5('0x2a')]=qs[_0xcdc5('0x2a')](_0x42e622[_0xcdc5('0x3e')][_0xcdc5('0x2a')]);}return _0x2730f7[_0xcdc5('0x90')](_0x478661);}})[_0xcdc5('0x1e')](function(_0x189153){if(_0x189153){return _0x189153?{'count':_0x1deb89,'rows':_0x189153}:null;}})['then'](respondWithResult(_0x304d7c,null))[_0xcdc5('0x26')](handleError(_0x304d7c,null));}; \ No newline at end of file +var _0xe130=['to-csv','ejs','fs-extra','squel','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','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','params','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','order','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','path'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0xe130,0x94));var _0x0e13=function(_0x4607fd,_0x53c0d5){_0x4607fd=_0x4607fd-0x0;var _0x1452ed=_0xe130[_0x4607fd];return _0x1452ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e13('0x0'));var zipdir=require(_0x0e13('0x1'));var jsonpatch=require(_0x0e13('0x2'));var rp=require(_0x0e13('0x3'));var moment=require(_0x0e13('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0e13('0x5'));var sox=require('sox');var csv=require(_0x0e13('0x6'));var ejs=require(_0x0e13('0x7'));var fs=require('fs');var fs_extra=require(_0x0e13('0x8'));var _=require('lodash');var squel=require(_0x0e13('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e13('0xa'));var toCsv=require(_0x0e13('0x6'));var querystring=require(_0x0e13('0xb'));var Papa=require('papaparse');var Redis=require(_0x0e13('0xc'));var authService=require(_0x0e13('0xd'));var qs=require(_0x0e13('0xe'));var as=require(_0x0e13('0xf'));var hardwareService=require(_0x0e13('0x10'));var logger=require(_0x0e13('0x11'))(_0x0e13('0x12'));var utils=require(_0x0e13('0x13'));var config=require(_0x0e13('0x14'));var licenseUtil=require(_0x0e13('0x15'));var db=require('../../mysqldb')['db'];config[_0x0e13('0x16')]=_[_0x0e13('0x17')](config[_0x0e13('0x16')],{'host':_0x0e13('0x18'),'port':0x18eb});var socket=require(_0x0e13('0x19'))(new Redis(config['redis']));require(_0x0e13('0x1a'))[_0x0e13('0x1b')](socket);var jayson=require(_0x0e13('0x1c'));var client=jayson[_0x0e13('0x1d')][_0x0e13('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x209313,_0x2b0768,_0x28f699,_0x3a6366){return new BPromise(function(_0x43700a,_0x1eaf1c){var _0x24f9b8=_0x3a6366||client;return _0x24f9b8['request'](_0x209313,_0x28f699)[_0x0e13('0x1f')](function(_0x1d5a3c){logger[_0x0e13('0x20')](_0x0e13('0x21'),_0x2b0768,_0x0e13('0x22'));logger[_0x0e13('0x23')](_0x0e13('0x24'),_0x2b0768,_0x0e13('0x22'),JSON[_0x0e13('0x25')](_0x1d5a3c));if(_0x1d5a3c['error']){if(_0x1d5a3c['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2b0768,_0x1d5a3c[_0x0e13('0x26')][_0x0e13('0x27')]);return _0x1eaf1c(_0x1d5a3c[_0x0e13('0x26')]['message']);}logger['error'](_0x0e13('0x21'),_0x2b0768,_0x1d5a3c[_0x0e13('0x26')]['message']);return _0x43700a(_0x1d5a3c['error'][_0x0e13('0x27')]);}else{logger[_0x0e13('0x20')](_0x0e13('0x21'),_0x2b0768,_0x0e13('0x22'));_0x43700a(_0x1d5a3c[_0x0e13('0x28')]['message']);}})['catch'](function(_0x301c86){logger[_0x0e13('0x26')](_0x0e13('0x21'),_0x2b0768,_0x301c86);_0x1eaf1c(_0x301c86);});});}function respondWithStatusCode(_0x362bf0,_0x1f00ba){_0x1f00ba=_0x1f00ba||0xcc;return function(_0x5b54ac){if(_0x5b54ac){return _0x362bf0[_0x0e13('0x29')](_0x1f00ba);}return _0x362bf0[_0x0e13('0x2a')](_0x1f00ba)[_0x0e13('0x2b')]();};}function respondWithResult(_0x520f61,_0x26b33d){_0x26b33d=_0x26b33d||0xc8;return function(_0x1dfbfb){if(_0x1dfbfb){return _0x520f61[_0x0e13('0x2a')](_0x26b33d)[_0x0e13('0x2c')](_0x1dfbfb);}};}function respondWithFilteredResult(_0x40fe33,_0x4d313d){return function(_0x166d90){if(_0x166d90){var _0x402e30=typeof _0x4d313d[_0x0e13('0x2d')]===_0x0e13('0x2e')&&typeof _0x4d313d[_0x0e13('0x2f')]===_0x0e13('0x2e');var _0x435668=_0x166d90[_0x0e13('0x30')];var _0x575dad=_0x402e30?0x0:_0x4d313d[_0x0e13('0x2d')];var _0x85fd70=_0x402e30?_0x166d90[_0x0e13('0x30')]:_0x4d313d[_0x0e13('0x2d')]+_0x4d313d[_0x0e13('0x2f')];var _0x34b990;if(_0x85fd70>=_0x435668){_0x85fd70=_0x435668;_0x34b990=0xc8;}else{_0x34b990=0xce;}_0x40fe33[_0x0e13('0x2a')](_0x34b990);return _0x40fe33[_0x0e13('0x31')]('Content-Range',_0x575dad+'-'+_0x85fd70+'/'+_0x435668)[_0x0e13('0x2c')](_0x166d90);}return null;};}function patchUpdates(_0x26b62d){return function(_0x63a23c){try{jsonpatch[_0x0e13('0x32')](_0x63a23c,_0x26b62d,!![]);}catch(_0x21432b){return BPromise[_0x0e13('0x33')](_0x21432b);}return _0x63a23c[_0x0e13('0x34')]();};}function saveUpdates(_0x40a632,_0x5c4328){return function(_0x36f92e){if(_0x36f92e){return _0x36f92e[_0x0e13('0x35')](_0x40a632)[_0x0e13('0x1f')](function(_0x2e29b2){return _0x2e29b2;});}return null;};}function removeEntity(_0x3a7bb0,_0x27c31c){return function(_0x3d5fd9){if(_0x3d5fd9){return _0x3d5fd9[_0x0e13('0x36')]()['then'](function(){var _0x39b60a=_0x3d5fd9['get']({'plain':!![]});var _0x21b3c6='ChatQueues';return db[_0x0e13('0x37')][_0x0e13('0x36')]({'where':{'type':_0x21b3c6,'resourceId':_0x39b60a['id']}})['then'](function(){return _0x3d5fd9;});})['then'](function(){_0x3a7bb0[_0x0e13('0x2a')](0xcc)[_0x0e13('0x2b')]();});}};}function handleEntityNotFound(_0x174bea,_0x43ed48){return function(_0x31aa2a){if(!_0x31aa2a){_0x174bea[_0x0e13('0x29')](0x194);}return _0x31aa2a;};}function handleError(_0x39054c,_0x31d636){_0x31d636=_0x31d636||0x1f4;return function(_0x573bf7){logger[_0x0e13('0x26')](_0x573bf7[_0x0e13('0x38')]);if(_0x573bf7[_0x0e13('0x39')]){delete _0x573bf7[_0x0e13('0x39')];}_0x39054c[_0x0e13('0x2a')](_0x31d636)[_0x0e13('0x3a')](_0x573bf7);};}exports[_0x0e13('0x3b')]=function(_0x4848d8,_0x4cc70e){var _0x5dc3dd={},_0x159914={},_0x2e448d={'count':0x0,'rows':[]};var _0x28c368=_[_0x0e13('0x3c')](db[_0x0e13('0x3d')][_0x0e13('0x3e')],function(_0x1940f4){return{'name':_0x1940f4[_0x0e13('0x3f')],'type':_0x1940f4['type'][_0x0e13('0x40')]};});_0x159914[_0x0e13('0x41')]=_[_0x0e13('0x3c')](_0x28c368,_0x0e13('0x39'));_0x159914['query']=_[_0x0e13('0x42')](_0x4848d8[_0x0e13('0x43')]);_0x159914[_0x0e13('0x44')]=_[_0x0e13('0x45')](_0x159914[_0x0e13('0x41')],_0x159914[_0x0e13('0x43')]);_0x5dc3dd[_0x0e13('0x46')]=_['intersection'](_0x159914['model'],qs[_0x0e13('0x47')](_0x4848d8['query']['fields']));_0x5dc3dd[_0x0e13('0x46')]=_0x5dc3dd['attributes'][_0x0e13('0x48')]?_0x5dc3dd[_0x0e13('0x46')]:_0x159914[_0x0e13('0x41')];if(!_0x4848d8[_0x0e13('0x43')][_0x0e13('0x49')](_0x0e13('0x4a'))){_0x5dc3dd[_0x0e13('0x2f')]=qs[_0x0e13('0x2f')](_0x4848d8[_0x0e13('0x43')][_0x0e13('0x2f')]);_0x5dc3dd[_0x0e13('0x2d')]=qs['offset'](_0x4848d8['query'][_0x0e13('0x2d')]);}_0x5dc3dd['order']=qs[_0x0e13('0x4b')](_0x4848d8[_0x0e13('0x43')][_0x0e13('0x4b')]);_0x5dc3dd[_0x0e13('0x4c')]=qs[_0x0e13('0x44')](_[_0x0e13('0x4d')](_0x4848d8[_0x0e13('0x43')],_0x159914[_0x0e13('0x44')]),_0x28c368);if(_0x4848d8[_0x0e13('0x43')][_0x0e13('0x4e')]){_0x5dc3dd[_0x0e13('0x4c')]=_[_0x0e13('0x4f')](_0x5dc3dd['where'],{'$or':_[_0x0e13('0x3c')](_0x28c368,function(_0x3f3d83){if(_0x3f3d83[_0x0e13('0x50')]!==_0x0e13('0x51')){var _0x4b0b18={};_0x4b0b18[_0x3f3d83[_0x0e13('0x39')]]={'$like':'%'+_0x4848d8[_0x0e13('0x43')]['filter']+'%'};return _0x4b0b18;}})});}_0x5dc3dd=_[_0x0e13('0x4f')]({},_0x5dc3dd,_0x4848d8['options']);var _0x166b4d={'where':_0x5dc3dd[_0x0e13('0x4c')]};return db['ChatQueue'][_0x0e13('0x30')](_0x166b4d)[_0x0e13('0x1f')](function(_0x8ce237){_0x2e448d[_0x0e13('0x30')]=_0x8ce237;if(_0x4848d8[_0x0e13('0x43')][_0x0e13('0x52')]){_0x5dc3dd['include']=[{'all':!![]}];}return db[_0x0e13('0x3d')][_0x0e13('0x53')](_0x5dc3dd);})[_0x0e13('0x1f')](function(_0x3b495c){_0x2e448d['rows']=_0x3b495c;return _0x2e448d;})['then'](respondWithFilteredResult(_0x4cc70e,_0x5dc3dd))[_0x0e13('0x54')](handleError(_0x4cc70e,null));};exports['show']=function(_0x2d5154,_0x594910){var _0x3df5c9={'raw':!![],'where':{'id':_0x2d5154[_0x0e13('0x55')]['id']}},_0x28d4ad={};_0x28d4ad[_0x0e13('0x41')]=_[_0x0e13('0x42')](db['ChatQueue'][_0x0e13('0x3e')]);_0x28d4ad[_0x0e13('0x43')]=_[_0x0e13('0x42')](_0x2d5154[_0x0e13('0x43')]);_0x28d4ad[_0x0e13('0x44')]=_[_0x0e13('0x45')](_0x28d4ad[_0x0e13('0x41')],_0x28d4ad['query']);_0x3df5c9[_0x0e13('0x46')]=_[_0x0e13('0x45')](_0x28d4ad[_0x0e13('0x41')],qs[_0x0e13('0x47')](_0x2d5154[_0x0e13('0x43')][_0x0e13('0x47')]));_0x3df5c9[_0x0e13('0x46')]=_0x3df5c9[_0x0e13('0x46')][_0x0e13('0x48')]?_0x3df5c9[_0x0e13('0x46')]:_0x28d4ad[_0x0e13('0x41')];if(_0x2d5154[_0x0e13('0x43')][_0x0e13('0x52')]){_0x3df5c9[_0x0e13('0x56')]=[{'all':!![]}];}_0x3df5c9=_['merge']({},_0x3df5c9,_0x2d5154[_0x0e13('0x57')]);return db[_0x0e13('0x3d')][_0x0e13('0x58')](_0x3df5c9)[_0x0e13('0x1f')](handleEntityNotFound(_0x594910,null))[_0x0e13('0x1f')](respondWithResult(_0x594910,null))[_0x0e13('0x54')](handleError(_0x594910,null));};exports['create']=function(_0xa140a2,_0x1730e2){return db[_0x0e13('0x3d')][_0x0e13('0x59')](_0xa140a2[_0x0e13('0x5a')],{})[_0x0e13('0x1f')](function(_0x306962){var _0x591e59=_0xa140a2[_0x0e13('0x5b')][_0x0e13('0x5c')]({'plain':!![]});if(!_0x591e59)throw new Error(_0x0e13('0x5d'));if(_0x591e59[_0x0e13('0x5e')]==='user'){var _0x14bdd8=_0x306962[_0x0e13('0x5c')]({'plain':!![]});var _0x35585a=_0x0e13('0x5f');return db['UserProfileSection'][_0x0e13('0x58')]({'where':{'name':_0x35585a,'userProfileId':_0x591e59['userProfileId']},'raw':!![]})[_0x0e13('0x1f')](function(_0xf2389b){if(_0xf2389b&&_0xf2389b[_0x0e13('0x60')]===0x0){return db[_0x0e13('0x37')][_0x0e13('0x59')]({'name':_0x14bdd8[_0x0e13('0x39')],'resourceId':_0x14bdd8['id'],'type':_0xf2389b['name'],'sectionId':_0xf2389b['id']},{})[_0x0e13('0x1f')](function(){return _0x306962;});}else{return _0x306962;}})[_0x0e13('0x54')](function(_0x503d01){logger['error'](_0x0e13('0x61'),_0x503d01);throw _0x503d01;});}return _0x306962;})[_0x0e13('0x1f')](respondWithResult(_0x1730e2,0xc9))[_0x0e13('0x54')](handleError(_0x1730e2,null));};exports['update']=function(_0x7826e,_0x2740ba){if(_0x7826e[_0x0e13('0x5a')]['id']){delete _0x7826e['body']['id'];}return db[_0x0e13('0x3d')][_0x0e13('0x58')]({'where':{'id':_0x7826e[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x2740ba,null))[_0x0e13('0x1f')](saveUpdates(_0x7826e['body'],null))[_0x0e13('0x1f')](respondWithResult(_0x2740ba,null))['catch'](handleError(_0x2740ba,null));};exports[_0x0e13('0x36')]=function(_0x4ee433,_0xe0cc64){return db[_0x0e13('0x3d')][_0x0e13('0x58')]({'where':{'id':_0x4ee433[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0xe0cc64,null))[_0x0e13('0x1f')](removeEntity(_0xe0cc64,null))[_0x0e13('0x54')](handleError(_0xe0cc64,null));};exports[_0x0e13('0x62')]=function(_0x5610f5,_0x58dc47){return db[_0x0e13('0x3d')][_0x0e13('0x62')]()[_0x0e13('0x1f')](respondWithResult(_0x58dc47,null))[_0x0e13('0x54')](handleError(_0x58dc47,null));};exports[_0x0e13('0x63')]=function(_0x410f39,_0x2c799d,_0x3a7092){var _0x31ff72={'raw':!![],'where':{}},_0x36921c={},_0x48a221;return db[_0x0e13('0x3d')]['findOne']({'where':{'id':_0x410f39[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x2c799d,null))[_0x0e13('0x1f')](function(_0x21bba6){if(_0x21bba6){_0x48a221=_0x21bba6['get']({'plain':!![]});_0x36921c[_0x0e13('0x41')]=_['keys'](db[_0x0e13('0x64')][_0x0e13('0x3e')]);_0x36921c[_0x0e13('0x43')]=_['keys'](_0x410f39[_0x0e13('0x43')]);_0x36921c[_0x0e13('0x44')]=_[_0x0e13('0x45')](_0x36921c[_0x0e13('0x41')],_0x36921c[_0x0e13('0x43')]);_0x31ff72[_0x0e13('0x46')]=_[_0x0e13('0x45')](_0x36921c['model'],qs[_0x0e13('0x47')](_0x410f39['query']['fields']));_0x31ff72['attributes']=_0x31ff72[_0x0e13('0x46')][_0x0e13('0x48')]?_0x31ff72[_0x0e13('0x46')]:_0x36921c[_0x0e13('0x41')];if(!_0x410f39[_0x0e13('0x43')][_0x0e13('0x49')](_0x0e13('0x4a'))){_0x31ff72['limit']=qs[_0x0e13('0x2f')](_0x410f39[_0x0e13('0x43')][_0x0e13('0x2f')]);_0x31ff72[_0x0e13('0x2d')]=qs[_0x0e13('0x2d')](_0x410f39[_0x0e13('0x43')]['offset']);}_0x31ff72[_0x0e13('0x65')]=qs[_0x0e13('0x4b')](_0x410f39[_0x0e13('0x43')][_0x0e13('0x4b')]);_0x31ff72[_0x0e13('0x4c')]=qs['filters'](_['pick'](_0x410f39[_0x0e13('0x43')],_0x36921c[_0x0e13('0x44')]));_0x31ff72[_0x0e13('0x4c')][_0x0e13('0x66')]=_0x21bba6['id'];if(_0x410f39[_0x0e13('0x43')][_0x0e13('0x4e')]){_0x31ff72[_0x0e13('0x4c')]=_[_0x0e13('0x4f')](_0x31ff72[_0x0e13('0x4c')],{'$or':_[_0x0e13('0x3c')](_0x31ff72['attributes'],function(_0x1351b3){var _0x26241d={};_0x26241d[_0x1351b3]={'$like':'%'+_0x410f39[_0x0e13('0x43')][_0x0e13('0x4e')]+'%'};return _0x26241d;})});}_0x31ff72=_['merge']({},_0x31ff72,_0x410f39[_0x0e13('0x57')]);return db[_0x0e13('0x64')][_0x0e13('0x53')](_0x31ff72);}})['then'](function(_0x426e0f){if(_0x426e0f){return db[_0x0e13('0x67')][_0x0e13('0x68')]({'where':{'id':_[_0x0e13('0x3c')](_0x426e0f,_0x0e13('0x69')),'role':_0x0e13('0x6a')},'attributes':['id',_0x0e13('0x39'),'chatPause',_0x0e13('0x6b'),_0x0e13('0x6c')]});}})[_0x0e13('0x1f')](function(_0x1e7522){if(_0x1e7522){return{'count':_0x1e7522[_0x0e13('0x30')],'rows':_[_0x0e13('0x3c')](_0x1e7522['rows'],function(_0x149795){return{'membername':_0x149795['name'],'UserId':_0x149795['id'],'queue_name':_0x48a221[_0x0e13('0x39')],'ChatQueueId':_0x48a221['id'],'interface':util[_0x0e13('0x6d')](_0x0e13('0x6e'),_0x0e13('0x6f'),_0x149795[_0x0e13('0x39')]),'penalty':0x0,'paused':_0x149795[_0x0e13('0x70')],'createdAt':_0x149795[_0x0e13('0x6c')],'updatedAt':_0x149795[_0x0e13('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2c799d,_0x31ff72))['catch'](handleError(_0x2c799d,null));};exports[_0x0e13('0x71')]=function(_0x2a58c7,_0x5c02a8,_0x25a0e5){var _0x56eda9={};var _0x5d0a82={};var _0x36b5d9;var _0x26e14b;return db[_0x0e13('0x3d')][_0x0e13('0x72')]({'where':{'id':_0x2a58c7[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x5c02a8,null))['then'](function(_0x4edd43){if(_0x4edd43){_0x36b5d9=_0x4edd43;_0x5d0a82['model']=_[_0x0e13('0x42')](db[_0x0e13('0x73')][_0x0e13('0x3e')]);_0x5d0a82[_0x0e13('0x43')]=_[_0x0e13('0x42')](_0x2a58c7[_0x0e13('0x43')]);_0x5d0a82[_0x0e13('0x44')]=_[_0x0e13('0x45')](_0x5d0a82[_0x0e13('0x41')],_0x5d0a82[_0x0e13('0x43')]);_0x56eda9['attributes']=_[_0x0e13('0x45')](_0x5d0a82[_0x0e13('0x41')],qs[_0x0e13('0x47')](_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x47')]));_0x56eda9['attributes']=_0x56eda9[_0x0e13('0x46')][_0x0e13('0x48')]?_0x56eda9['attributes']:_0x5d0a82['model'];_0x56eda9[_0x0e13('0x65')]=qs[_0x0e13('0x4b')](_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x4b')]);_0x56eda9['where']=qs[_0x0e13('0x44')](_[_0x0e13('0x4d')](_0x2a58c7[_0x0e13('0x43')],_0x5d0a82[_0x0e13('0x44')]));if(_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x4e')]){_0x56eda9[_0x0e13('0x4c')]=_['merge'](_0x56eda9[_0x0e13('0x4c')],{'$or':_[_0x0e13('0x3c')](_0x56eda9[_0x0e13('0x46')],function(_0x403641){var _0xff10bc={};_0xff10bc[_0x403641]={'$like':'%'+_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x4e')]+'%'};return _0xff10bc;})});}_0x56eda9=_[_0x0e13('0x4f')]({},_0x56eda9,_0x2a58c7[_0x0e13('0x57')]);return _0x36b5d9[_0x0e13('0x71')](_0x56eda9);}})[_0x0e13('0x1f')](function(_0x382897){if(_0x382897){_0x26e14b=_0x382897[_0x0e13('0x48')];if(!_0x2a58c7['query'][_0x0e13('0x49')](_0x0e13('0x4a'))){_0x56eda9[_0x0e13('0x2f')]=qs[_0x0e13('0x2f')](_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x2f')]);_0x56eda9[_0x0e13('0x2d')]=qs[_0x0e13('0x2d')](_0x2a58c7[_0x0e13('0x43')][_0x0e13('0x2d')]);}return _0x36b5d9[_0x0e13('0x71')](_0x56eda9);}})[_0x0e13('0x1f')](function(_0x31eb07){if(_0x31eb07){return _0x31eb07?{'count':_0x26e14b,'rows':_0x31eb07}:null;}})[_0x0e13('0x1f')](respondWithResult(_0x5c02a8,null))['catch'](handleError(_0x5c02a8,null));};exports[_0x0e13('0x74')]=function(_0x4a74ce,_0x4c4228,_0x4f67a2){var _0x2dbf20=_0x4a74ce[_0x0e13('0x5a')][_0x0e13('0x75')];return db[_0x0e13('0x73')]['findAll']({'where':{'id':_0x2dbf20},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0e13('0x76'),'attributes':['id',_0x0e13('0x39'),_0x0e13('0x77'),_0x0e13('0x78'),_0x0e13('0x79')],'raw':!![]}]})[_0x0e13('0x1f')](function(_0x2891f3){if(_0x2891f3){var _0x165db1=_[_0x0e13('0x7a')](_0x2891f3,function(_0x5a6a3d){var _0x44e022=_0x5a6a3d[_0x0e13('0x5c')]({'plain':!![]});return _0x44e022['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x4a74ce[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](function(_0x400d90){return db[_0x0e13('0x7b')][_0x0e13('0x7c')](function(_0x25fff1){return _0x400d90[_0x0e13('0x74')](_0x2dbf20,{'transaction':_0x25fff1})[_0x0e13('0x1f')](function(){return BPromise[_0x0e13('0x7d')](_0x165db1,function(_0x36d7b2){return db['UserChatQueue'][_0x0e13('0x7e')]({'where':{'UserId':_0x36d7b2['id'],'ChatQueueId':_0x4a74ce[_0x0e13('0x55')]['id']},'transaction':_0x25fff1});});})[_0x0e13('0x1f')](function(){_0x165db1[_0x0e13('0x7f')](function(_0x37a25e){socket[_0x0e13('0x80')](_0x0e13('0x81'),{'UserId':_0x37a25e['id'],'ChatQueueId':_0x400d90['id']});});});});});}})[_0x0e13('0x1f')](respondWithStatusCode(_0x4c4228,null))['catch'](handleError(_0x4c4228,null));};exports[_0x0e13('0x82')]=function(_0x5645c8,_0x4ce16d,_0xe6bd31){return db[_0x0e13('0x73')][_0x0e13('0x53')]({'where':{'id':_0x5645c8['query'][_0x0e13('0x75')]},'attributes':['id'],'include':[{'model':db[_0x0e13('0x67')],'as':_0x0e13('0x76'),'attributes':['id'],'raw':!![]}]})[_0x0e13('0x1f')](handleEntityNotFound(_0x4ce16d,null))[_0x0e13('0x1f')](function(_0x1aca9b){var _0x1e1cd0=_[_0x0e13('0x3c')](_0x1aca9b,'id');var _0x201cf1=[];var _0x36d270=[];var _0x3576be=squel[_0x0e13('0x83')]();_0x3576be[_0x0e13('0x84')](_0x0e13('0x85'))[_0x0e13('0x86')](_0x0e13('0x87'),'tq')['join'](_0x0e13('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0e13('0x4c')](_0x0e13('0x89'),_0x5645c8[_0x0e13('0x55')]['id']);for(var _0x2618dc=0x0;_0x2618dc<_0x1aca9b['length'];_0x2618dc+=0x1){let _0x1f7a35=_0x1aca9b[_0x2618dc];for(var _0x13bb89=0x0;_0x13bb89<_0x1f7a35[_0x0e13('0x76')][_0x0e13('0x48')];_0x13bb89+=0x1){let _0x1e057e=_0x1f7a35[_0x0e13('0x76')][_0x13bb89];var _0x208edf=_0x3576be[_0x0e13('0x8a')]();_0x208edf[_0x0e13('0x4c')](_0x0e13('0x8b'),_0x1e057e['id']);_0x36d270[_0x0e13('0x8c')](db[_0x0e13('0x7b')]['query'](_0x208edf[_0x0e13('0x8d')](),{'type':db[_0x0e13('0x7b')]['QueryTypes'][_0x0e13('0x8e')]})[_0x0e13('0x1f')](function(_0x3f6b26){if(_0x3f6b26[_0x0e13('0x48')]===0x1){return _0x1e057e['id'];}else{var _0x54d955=_['every'](_[_0x0e13('0x3c')](_0x3f6b26,_0x0e13('0x8f')),function(_0x1fc1b9){return _['includes'](_0x1e1cd0,_0x1fc1b9);});if(_0x54d955){return _0x1e057e['id'];}}}));}}return BPromise[_0x0e13('0x90')](_0x36d270)[_0x0e13('0x1f')](function(_0x3ef2db){_0x201cf1=_(_0x201cf1)[_0x0e13('0x91')](_0x3ef2db)['compact']()[_0x0e13('0x92')]();return db[_0x0e13('0x3d')][_0x0e13('0x58')]({'where':{'id':_0x5645c8[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](function(_0x4bcf6e){return db['sequelize'][_0x0e13('0x7c')](function(_0x59afe7){return _0x4bcf6e['removeTeams'](_0x5645c8[_0x0e13('0x43')]['ids'],{'transaction':_0x59afe7})[_0x0e13('0x1f')](function(){if(!_[_0x0e13('0x93')](_0x201cf1)){return _0x4bcf6e[_0x0e13('0x94')](_0x201cf1,{'transaction':_0x59afe7});}})[_0x0e13('0x1f')](function(){_0x201cf1['forEach'](function(_0x1ca348){socket[_0x0e13('0x80')](_0x0e13('0x95'),{'UserId':_0x1ca348,'ChatQueueId':_0x4bcf6e['id']});});});});});});})['then'](respondWithStatusCode(_0x4ce16d,null))[_0x0e13('0x54')](handleError(_0x4ce16d,null));};exports['addAgents']=function(_0x4e2340,_0x261337,_0x12e630){return db['ChatQueue'][_0x0e13('0x58')]({'where':{'id':_0x4e2340[_0x0e13('0x55')]['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x261337,null))[_0x0e13('0x1f')](function(_0x1662d9){if(_0x1662d9){return _0x1662d9[_0x0e13('0x96')](_0x4e2340[_0x0e13('0x5a')]['ids'],_[_0x0e13('0x97')](_0x4e2340[_0x0e13('0x5a')],[_0x0e13('0x75'),'id'])||{})[_0x0e13('0x98')](function(_0x3a2f86){for(var _0x200b25=0x0;_0x200b25<_0x4e2340[_0x0e13('0x5a')][_0x0e13('0x75')][_0x0e13('0x48')];_0x200b25+=0x1){socket[_0x0e13('0x80')](_0x0e13('0x81'),{'UserId':Number(_0x4e2340['body']['ids'][_0x200b25]),'ChatQueueId':Number(_0x4e2340[_0x0e13('0x55')]['id'])});}return _0x3a2f86;});}})[_0x0e13('0x1f')](respondWithResult(_0x261337,null))[_0x0e13('0x54')](handleError(_0x261337,null));};exports['removeAgents']=function(_0xad0494,_0x2ae831,_0x4bc2ac){return db['ChatQueue']['find']({'where':{'id':_0xad0494['params']['id']}})['then'](handleEntityNotFound(_0x2ae831,null))[_0x0e13('0x1f')](function(_0x18a0b3){if(_0x18a0b3){return _0x18a0b3[_0x0e13('0x94')](_0xad0494[_0x0e13('0x43')][_0x0e13('0x75')])['then'](function(){if(_['isArray'](_0xad0494[_0x0e13('0x43')][_0x0e13('0x75')])){for(var _0x1ff884=0x0;_0x1ff884<_0xad0494[_0x0e13('0x43')][_0x0e13('0x75')][_0x0e13('0x48')];_0x1ff884+=0x1){socket['emit'](_0x0e13('0x95'),{'UserId':Number(_0xad0494[_0x0e13('0x43')][_0x0e13('0x75')][_0x1ff884]),'ChatQueueId':Number(_0xad0494[_0x0e13('0x55')]['id'])});}}else{socket[_0x0e13('0x80')]('userChatQueue:remove',{'UserId':Number(_0xad0494['query'][_0x0e13('0x75')]),'ChatQueueId':Number(_0xad0494[_0x0e13('0x55')]['id'])});}});}})[_0x0e13('0x1f')](respondWithStatusCode(_0x2ae831,null))['catch'](handleError(_0x2ae831,null));};exports[_0x0e13('0x99')]=function(_0x2be267,_0x373be8,_0x166004){var _0x450ace={};var _0xb0b82b={};var _0x366b4e;var _0x407011;return db['ChatQueue'][_0x0e13('0x72')]({'where':{'id':_0x2be267['params']['id']}})[_0x0e13('0x1f')](handleEntityNotFound(_0x373be8,null))[_0x0e13('0x1f')](function(_0x32a999){if(_0x32a999){_0x366b4e=_0x32a999;_0xb0b82b[_0x0e13('0x41')]=_[_0x0e13('0x42')](db[_0x0e13('0x67')][_0x0e13('0x3e')]);_0xb0b82b['query']=_[_0x0e13('0x42')](_0x2be267[_0x0e13('0x43')]);_0xb0b82b[_0x0e13('0x44')]=_['intersection'](_0xb0b82b[_0x0e13('0x41')],_0xb0b82b[_0x0e13('0x43')]);_0x450ace[_0x0e13('0x46')]=_['intersection'](_0xb0b82b[_0x0e13('0x41')],qs[_0x0e13('0x47')](_0x2be267[_0x0e13('0x43')][_0x0e13('0x47')]));_0x450ace['attributes']=_0x450ace[_0x0e13('0x46')][_0x0e13('0x48')]?_0x450ace[_0x0e13('0x46')]:_0xb0b82b[_0x0e13('0x41')];_0x450ace[_0x0e13('0x65')]=qs[_0x0e13('0x4b')](_0x2be267['query']['sort']);_0x450ace[_0x0e13('0x4c')]=qs[_0x0e13('0x44')](_[_0x0e13('0x4d')](_0x2be267[_0x0e13('0x43')],_0xb0b82b[_0x0e13('0x44')]));if(_0x2be267[_0x0e13('0x43')][_0x0e13('0x4e')]){_0x450ace[_0x0e13('0x4c')]=_[_0x0e13('0x4f')](_0x450ace['where'],{'$or':_['map'](_0x450ace[_0x0e13('0x46')],function(_0xa4c983){var _0x280b8b={};_0x280b8b[_0xa4c983]={'$like':'%'+_0x2be267[_0x0e13('0x43')][_0x0e13('0x4e')]+'%'};return _0x280b8b;})});}_0x450ace=_[_0x0e13('0x4f')]({},_0x450ace,_0x2be267[_0x0e13('0x57')]);return _0x366b4e['getAgents'](_0x450ace);}})[_0x0e13('0x1f')](function(_0x1ac2a6){if(_0x1ac2a6){_0x407011=_0x1ac2a6[_0x0e13('0x48')];if(!_0x2be267[_0x0e13('0x43')][_0x0e13('0x49')](_0x0e13('0x4a'))){_0x450ace[_0x0e13('0x2f')]=qs[_0x0e13('0x2f')](_0x2be267[_0x0e13('0x43')][_0x0e13('0x2f')]);_0x450ace['offset']=qs['offset'](_0x2be267['query'][_0x0e13('0x2d')]);}return _0x366b4e[_0x0e13('0x99')](_0x450ace);}})[_0x0e13('0x1f')](function(_0x2fe6e3){if(_0x2fe6e3){return _0x2fe6e3?{'count':_0x407011,'rows':_0x2fe6e3}:null;}})[_0x0e13('0x1f')](respondWithResult(_0x373be8,null))[_0x0e13('0x54')](handleError(_0x373be8,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index ed1ced2..2b5e7ef 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 _0xdab2=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3b8f2e,_0x5a99a8){var _0x1433d5=function(_0x5e0353){while(--_0x5e0353){_0x3b8f2e['push'](_0x3b8f2e['shift']());}};_0x1433d5(++_0x5a99a8);}(_0xdab2,0x15c));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2dab('0x0'));var ChatQueue=require(_0x2dab('0x1'))['db'][_0x2dab('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2dab('0x3')](0x0);var events={'afterCreate':_0x2dab('0x4'),'afterUpdate':_0x2dab('0x5'),'afterDestroy':_0x2dab('0x6')};function emitEvent(_0x4ce1e5){return function(_0x32021b,_0x163da4,_0x15c46e){ChatQueueEvents[_0x2dab('0x7')](_0x4ce1e5+':'+_0x32021b['id'],_0x32021b);ChatQueueEvents[_0x2dab('0x7')](_0x4ce1e5,_0x32021b);_0x15c46e(null);};}for(var e in events){if(events[_0x2dab('0x8')](e)){var event=events[e];ChatQueue[_0x2dab('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xc1d9=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x4e9b9a,_0x53510c){var _0x1a7167=function(_0x3d0f53){while(--_0x3d0f53){_0x4e9b9a['push'](_0x4e9b9a['shift']());}};_0x1a7167(++_0x53510c);}(_0xc1d9,0xd7));var _0x9c1d=function(_0x97ecd,_0x1d82c1){_0x97ecd=_0x97ecd-0x0;var _0x5a0903=_0xc1d9[_0x97ecd];return _0x5a0903;};'use strict';var EventEmitter=require(_0x9c1d('0x0'));var ChatQueue=require(_0x9c1d('0x1'))['db'][_0x9c1d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9c1d('0x3')](0x0);var events={'afterCreate':_0x9c1d('0x4'),'afterUpdate':_0x9c1d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x358db5){return function(_0x3076a5,_0x165598,_0x29df1a){ChatQueueEvents[_0x9c1d('0x6')](_0x358db5+':'+_0x3076a5['id'],_0x3076a5);ChatQueueEvents[_0x9c1d('0x6')](_0x358db5,_0x3076a5);_0x29df1a(null);};}for(var e in events){if(events[_0x9c1d('0x7')](e)){var event=events[e];ChatQueue[_0x9c1d('0x8')](e,emitEvent(event));}}module[_0x9c1d('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 4b5ee2e..0003046 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 _0xae8a=['define','ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x56e429,_0x546a27){var _0x20d987=function(_0x4b0b5b){while(--_0x4b0b5b){_0x56e429['push'](_0x56e429['shift']());}};_0x20d987(++_0x546a27);}(_0xae8a,0xf3));var _0xaae8=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xae8a[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaae8('0x0'))(_0xaae8('0x1'));var moment=require(_0xaae8('0x2'));var BPromise=require(_0xaae8('0x3'));var rp=require(_0xaae8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaae8('0x5'));var config=require(_0xaae8('0x6'));var attributes=require(_0xaae8('0x7'));module[_0xaae8('0x8')]=function(_0x3b86cd,_0x3b3088){return _0x3b86cd[_0xaae8('0x9')](_0xaae8('0xa'),attributes,{'tableName':_0xaae8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb645=['exports','define','ChatQueue','chat_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x41f0c7,_0x7e3c){var _0x37606d=function(_0x13e3fe){while(--_0x13e3fe){_0x41f0c7['push'](_0x41f0c7['shift']());}};_0x37606d(++_0x7e3c);}(_0xb645,0x154));var _0x5b64=function(_0x5ca232,_0x398303){_0x5ca232=_0x5ca232-0x0;var _0x2f98b4=_0xb645[_0x5ca232];return _0x2f98b4;};'use strict';var _=require('lodash');var util=require(_0x5b64('0x0'));var logger=require(_0x5b64('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5b64('0x2'));var rp=require(_0x5b64('0x3'));var fs=require('fs');var path=require(_0x5b64('0x4'));var rimraf=require(_0x5b64('0x5'));var config=require(_0x5b64('0x6'));var attributes=require(_0x5b64('0x7'));module[_0x5b64('0x8')]=function(_0x5a7601,_0x14f558){return _0x5a7601[_0x5b64('0x9')](_0x5b64('0xa'),attributes,{'tableName':_0x5b64('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 1e73f0e..dd3af22 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 _0xb57d=['error','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','catch','ShowChatQueue','ChatQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x18c192,_0xc1eaf4){var _0x4b9119=function(_0x2333d0){while(--_0x2333d0){_0x18c192['push'](_0x18c192['shift']());}};_0x4b9119(++_0xc1eaf4);}(_0xb57d,0x18d));var _0xdb57=function(_0x20db9d,_0x546371){_0x20db9d=_0x20db9d-0x0;var _0xa2724a=_0xb57d[_0x20db9d];return _0xa2724a;};'use strict';var _=require(_0xdb57('0x0'));var util=require(_0xdb57('0x1'));var moment=require(_0xdb57('0x2'));var BPromise=require(_0xdb57('0x3'));var rs=require(_0xdb57('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb57('0x5'))['db'];var utils=require(_0xdb57('0x6'));var logger=require(_0xdb57('0x7'))(_0xdb57('0x8'));var config=require('../../config/environment');var jayson=require(_0xdb57('0x9'));var client=jayson[_0xdb57('0xa')]['http']({'port':0x232a});config[_0xdb57('0xb')]=_['defaults'](config['redis'],{'host':_0xdb57('0xc'),'port':0x18eb});var socket=require(_0xdb57('0xd'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xdb57('0xe')](socket);function respondWithRpcPromise(_0x447edd,_0x432b43,_0x25a708){return new BPromise(function(_0x348c57,_0x242561){return client['request'](_0x447edd,_0x25a708)[_0xdb57('0xf')](function(_0x4801ac){logger[_0xdb57('0x10')](_0xdb57('0x11'),_0x432b43,_0xdb57('0x12'));logger[_0xdb57('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x432b43,'request\x20sent',JSON[_0xdb57('0x14')](_0x4801ac));if(_0x4801ac[_0xdb57('0x15')]){if(_0x4801ac[_0xdb57('0x15')]['code']===0x1f4){logger[_0xdb57('0x15')](_0xdb57('0x11'),_0x432b43,_0x4801ac[_0xdb57('0x15')][_0xdb57('0x16')]);return _0x242561(_0x4801ac[_0xdb57('0x15')]['message']);}logger[_0xdb57('0x15')](_0xdb57('0x11'),_0x432b43,_0x4801ac[_0xdb57('0x15')][_0xdb57('0x16')]);return _0x348c57(_0x4801ac['error'][_0xdb57('0x16')]);}else{logger['info'](_0xdb57('0x11'),_0x432b43,_0xdb57('0x12'));_0x348c57(_0x4801ac[_0xdb57('0x17')][_0xdb57('0x16')]);}})['catch'](function(_0x1328f7){logger[_0xdb57('0x15')](_0xdb57('0x11'),_0x432b43,_0x1328f7);_0x242561(_0x1328f7);});});}exports['GetChatQueue']=function(_0x5c327e){var _0x1e9441=this;return new Promise(function(_0x1e5503,_0x4ee3af){return db['ChatQueue'][_0xdb57('0x18')]({'raw':_0x5c327e['options']?_0x5c327e[_0xdb57('0x19')][_0xdb57('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c327e[_0xdb57('0x19')]?_0x5c327e[_0xdb57('0x19')][_0xdb57('0x1b')]||null:null,'attributes':_0x5c327e[_0xdb57('0x19')]?_0x5c327e[_0xdb57('0x19')][_0xdb57('0x1c')]||null:null,'limit':_0x5c327e[_0xdb57('0x19')]?_0x5c327e[_0xdb57('0x19')][_0xdb57('0x1d')]||null:null,'include':_0x5c327e[_0xdb57('0x19')]?_0x5c327e[_0xdb57('0x19')]['include']?_['map'](_0x5c327e['options'][_0xdb57('0x1e')],function(_0x283e7d){return{'model':db[_0x283e7d['model']],'as':_0x283e7d['as'],'attributes':_0x283e7d[_0xdb57('0x1c')],'include':_0x283e7d[_0xdb57('0x1e')]?_[_0xdb57('0x1f')](_0x283e7d[_0xdb57('0x1e')],function(_0x38216c){return{'model':db[_0x38216c['model']],'as':_0x38216c['as'],'attributes':_0x38216c[_0xdb57('0x1c')],'include':_0x38216c[_0xdb57('0x1e')]?_[_0xdb57('0x1f')](_0x38216c[_0xdb57('0x1e')],function(_0x51d0f0){return{'model':db[_0x51d0f0[_0xdb57('0x20')]],'as':_0x51d0f0['as'],'attributes':_0x51d0f0['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb57('0xf')](function(_0x5cf3fe){logger[_0xdb57('0x10')](_0xdb57('0x21'),_0x5c327e);logger[_0xdb57('0x13')](_0xdb57('0x21'),_0x5c327e,JSON[_0xdb57('0x14')](_0x5cf3fe));_0x1e5503(_0x5cf3fe);})[_0xdb57('0x22')](function(_0x563ed9){logger[_0xdb57('0x15')](_0xdb57('0x21'),_0x563ed9[_0xdb57('0x16')],_0x5c327e);_0x4ee3af(_0x1e9441[_0xdb57('0x15')](0x1f4,_0x563ed9[_0xdb57('0x16')]));});});};exports[_0xdb57('0x23')]=function(_0x5d2ecb){var _0x2c299d=this;return new Promise(function(_0x7e1dd6,_0x1aa7d7){return db[_0xdb57('0x24')][_0xdb57('0x25')]({'raw':_0x5d2ecb['options']?_0x5d2ecb[_0xdb57('0x19')][_0xdb57('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d2ecb['options']?_0x5d2ecb[_0xdb57('0x19')][_0xdb57('0x1b')]||null:null,'attributes':_0x5d2ecb[_0xdb57('0x19')]?_0x5d2ecb[_0xdb57('0x19')]['attributes']||null:null,'include':_0x5d2ecb[_0xdb57('0x19')]?_0x5d2ecb[_0xdb57('0x19')][_0xdb57('0x1e')]?_[_0xdb57('0x1f')](_0x5d2ecb[_0xdb57('0x19')][_0xdb57('0x1e')],function(_0x39dd24){return{'model':db[_0x39dd24[_0xdb57('0x20')]],'as':_0x39dd24['as'],'attributes':_0x39dd24['attributes'],'include':_0x39dd24['include']?_[_0xdb57('0x1f')](_0x39dd24[_0xdb57('0x1e')],function(_0x2aab67){return{'model':db[_0x2aab67[_0xdb57('0x20')]],'as':_0x2aab67['as'],'attributes':_0x2aab67[_0xdb57('0x1c')],'include':_0x2aab67[_0xdb57('0x1e')]?_[_0xdb57('0x1f')](_0x2aab67[_0xdb57('0x1e')],function(_0x2b97f5){return{'model':db[_0x2b97f5[_0xdb57('0x20')]],'as':_0x2b97f5['as'],'attributes':_0x2b97f5[_0xdb57('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdb57('0xf')](function(_0xf3988f){logger[_0xdb57('0x10')](_0xdb57('0x23'),_0x5d2ecb);logger[_0xdb57('0x13')]('ShowChatQueue',_0x5d2ecb,JSON['stringify'](_0xf3988f));_0x7e1dd6(_0xf3988f);})[_0xdb57('0x22')](function(_0x116632){logger['error'](_0xdb57('0x23'),_0x116632[_0xdb57('0x16')],_0x5d2ecb);_0x1aa7d7(_0x2c299d[_0xdb57('0x15')](0x1f4,_0x116632[_0xdb57('0x16')]));});});}; \ No newline at end of file +var _0xba26=['socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetChatQueue','ShowChatQueue','ChatQueue','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xba26,0x1c9));var _0x6ba2=function(_0x55d46b,_0xbd504c){_0x55d46b=_0x55d46b-0x0;var _0x4a1f2d=_0xba26[_0x55d46b];return _0x4a1f2d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6ba2('0x0'));var BPromise=require(_0x6ba2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ba2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ba2('0x3'));var logger=require(_0x6ba2('0x4'))('rpc');var config=require(_0x6ba2('0x5'));var jayson=require(_0x6ba2('0x6'));var client=jayson[_0x6ba2('0x7')][_0x6ba2('0x8')]({'port':0x232a});config[_0x6ba2('0x9')]=_['defaults'](config[_0x6ba2('0x9')],{'host':_0x6ba2('0xa'),'port':0x18eb});var socket=require(_0x6ba2('0xb'))(new Redis(config[_0x6ba2('0x9')]));require(_0x6ba2('0xc'))[_0x6ba2('0xd')](socket);function respondWithRpcPromise(_0x27a505,_0x1b0e9b,_0x4b840b){return new BPromise(function(_0x192bc1,_0x37dd49){return client['request'](_0x27a505,_0x4b840b)['then'](function(_0x54574f){logger[_0x6ba2('0xe')](_0x6ba2('0xf'),_0x1b0e9b,_0x6ba2('0x10'));logger[_0x6ba2('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1b0e9b,'request\x20sent',JSON[_0x6ba2('0x12')](_0x54574f));if(_0x54574f[_0x6ba2('0x13')]){if(_0x54574f[_0x6ba2('0x13')][_0x6ba2('0x14')]===0x1f4){logger[_0x6ba2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x1b0e9b,_0x54574f[_0x6ba2('0x13')][_0x6ba2('0x15')]);return _0x37dd49(_0x54574f['error'][_0x6ba2('0x15')]);}logger[_0x6ba2('0x13')](_0x6ba2('0xf'),_0x1b0e9b,_0x54574f[_0x6ba2('0x13')][_0x6ba2('0x15')]);return _0x192bc1(_0x54574f[_0x6ba2('0x13')][_0x6ba2('0x15')]);}else{logger['info'](_0x6ba2('0xf'),_0x1b0e9b,_0x6ba2('0x10'));_0x192bc1(_0x54574f['result']['message']);}})[_0x6ba2('0x16')](function(_0x3f09f3){logger[_0x6ba2('0x13')](_0x6ba2('0xf'),_0x1b0e9b,_0x3f09f3);_0x37dd49(_0x3f09f3);});});}exports['GetChatQueue']=function(_0x56e627){var _0x256feb=this;return new Promise(function(_0x431bd2,_0x420163){return db['ChatQueue'][_0x6ba2('0x17')]({'raw':_0x56e627[_0x6ba2('0x18')]?_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x19')]===undefined?!![]:![]:!![],'where':_0x56e627[_0x6ba2('0x18')]?_0x56e627['options'][_0x6ba2('0x1a')]||null:null,'attributes':_0x56e627['options']?_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x1b')]||null:null,'limit':_0x56e627[_0x6ba2('0x18')]?_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x1c')]||null:null,'include':_0x56e627[_0x6ba2('0x18')]?_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x1d')]?_[_0x6ba2('0x1e')](_0x56e627[_0x6ba2('0x18')][_0x6ba2('0x1d')],function(_0x51c30c){return{'model':db[_0x51c30c[_0x6ba2('0x1f')]],'as':_0x51c30c['as'],'attributes':_0x51c30c[_0x6ba2('0x1b')],'include':_0x51c30c['include']?_['map'](_0x51c30c[_0x6ba2('0x1d')],function(_0x150688){return{'model':db[_0x150688[_0x6ba2('0x1f')]],'as':_0x150688['as'],'attributes':_0x150688['attributes'],'include':_0x150688[_0x6ba2('0x1d')]?_['map'](_0x150688[_0x6ba2('0x1d')],function(_0x3777b8){return{'model':db[_0x3777b8['model']],'as':_0x3777b8['as'],'attributes':_0x3777b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ba2('0x20')](function(_0x508cac){logger[_0x6ba2('0xe')](_0x6ba2('0x21'),_0x56e627);logger[_0x6ba2('0x11')](_0x6ba2('0x21'),_0x56e627,JSON[_0x6ba2('0x12')](_0x508cac));_0x431bd2(_0x508cac);})[_0x6ba2('0x16')](function(_0x5459c8){logger[_0x6ba2('0x13')](_0x6ba2('0x21'),_0x5459c8['message'],_0x56e627);_0x420163(_0x256feb[_0x6ba2('0x13')](0x1f4,_0x5459c8['message']));});});};exports[_0x6ba2('0x22')]=function(_0x59d6b9){var _0x589e49=this;return new Promise(function(_0x3537ec,_0x3b4674){return db[_0x6ba2('0x23')]['find']({'raw':_0x59d6b9['options']?_0x59d6b9['options']['raw']===undefined?!![]:![]:!![],'where':_0x59d6b9[_0x6ba2('0x18')]?_0x59d6b9[_0x6ba2('0x18')][_0x6ba2('0x1a')]||null:null,'attributes':_0x59d6b9[_0x6ba2('0x18')]?_0x59d6b9['options']['attributes']||null:null,'include':_0x59d6b9[_0x6ba2('0x18')]?_0x59d6b9[_0x6ba2('0x18')][_0x6ba2('0x1d')]?_['map'](_0x59d6b9[_0x6ba2('0x18')][_0x6ba2('0x1d')],function(_0xe3b17f){return{'model':db[_0xe3b17f[_0x6ba2('0x1f')]],'as':_0xe3b17f['as'],'attributes':_0xe3b17f['attributes'],'include':_0xe3b17f['include']?_[_0x6ba2('0x1e')](_0xe3b17f[_0x6ba2('0x1d')],function(_0x565f17){return{'model':db[_0x565f17['model']],'as':_0x565f17['as'],'attributes':_0x565f17[_0x6ba2('0x1b')],'include':_0x565f17[_0x6ba2('0x1d')]?_[_0x6ba2('0x1e')](_0x565f17[_0x6ba2('0x1d')],function(_0x3fef03){return{'model':db[_0x3fef03[_0x6ba2('0x1f')]],'as':_0x3fef03['as'],'attributes':_0x3fef03[_0x6ba2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6ba2('0x20')](function(_0x3ffdc8){logger[_0x6ba2('0xe')](_0x6ba2('0x22'),_0x59d6b9);logger[_0x6ba2('0x11')](_0x6ba2('0x22'),_0x59d6b9,JSON[_0x6ba2('0x12')](_0x3ffdc8));_0x3537ec(_0x3ffdc8);})[_0x6ba2('0x16')](function(_0x495838){logger[_0x6ba2('0x13')](_0x6ba2('0x22'),_0x495838[_0x6ba2('0x15')],_0x59d6b9);_0x3b4674(_0x589e49[_0x6ba2('0x13')](0x1f4,_0x495838[_0x6ba2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 8c622ff..dc8d940 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 _0xcb99=['chatQueue:','./chatQueue.events','remove','emit','removeListener','length'];(function(_0x1c6afd,_0x306d69){var _0x4f8ad8=function(_0x197a6c){while(--_0x197a6c){_0x1c6afd['push'](_0x1c6afd['shift']());}};_0x4f8ad8(++_0x306d69);}(_0xcb99,0x8b));var _0x9cb9=function(_0x4c0a0e,_0x2e4b1a){_0x4c0a0e=_0x4c0a0e-0x0;var _0x284bd0=_0xcb99[_0x4c0a0e];return _0x284bd0;};'use strict';var ChatQueueEvents=require(_0x9cb9('0x0'));var events=['save',_0x9cb9('0x1'),'update'];function createListener(_0x480364,_0x3a2f21){return function(_0x1308a8){_0x3a2f21[_0x9cb9('0x2')](_0x480364,_0x1308a8);};}function removeListener(_0x51f2ee,_0x167735){return function(){ChatQueueEvents[_0x9cb9('0x3')](_0x51f2ee,_0x167735);};}exports['register']=function(_0x214b72){for(var _0x509cfc=0x0,_0x2ed26a=events[_0x9cb9('0x4')];_0x509cfc<_0x2ed26a;_0x509cfc++){var _0x1bf9b7=events[_0x509cfc];var _0x1dd62f=createListener(_0x9cb9('0x5')+_0x1bf9b7,_0x214b72);ChatQueueEvents['on'](_0x1bf9b7,_0x1dd62f);}}; \ No newline at end of file +var _0x702d=['remove','update','emit','register','length','./chatQueue.events','save'];(function(_0x3008b9,_0x3ef5f1){var _0x2798c4=function(_0x5d0e99){while(--_0x5d0e99){_0x3008b9['push'](_0x3008b9['shift']());}};_0x2798c4(++_0x3ef5f1);}(_0x702d,0x147));var _0xd702=function(_0x242e1a,_0x58dbf7){_0x242e1a=_0x242e1a-0x0;var _0x40c562=_0x702d[_0x242e1a];return _0x40c562;};'use strict';var ChatQueueEvents=require(_0xd702('0x0'));var events=[_0xd702('0x1'),_0xd702('0x2'),_0xd702('0x3')];function createListener(_0x37ed5c,_0x5c2b9e){return function(_0x20c11a){_0x5c2b9e[_0xd702('0x4')](_0x37ed5c,_0x20c11a);};}function removeListener(_0x27b260,_0x1c5a32){return function(){ChatQueueEvents['removeListener'](_0x27b260,_0x1c5a32);};}exports[_0xd702('0x5')]=function(_0x544e94){for(var _0x1aecfc=0x0,_0x3a2c03=events[_0xd702('0x6')];_0x1aecfc<_0x3a2c03;_0x1aecfc++){var _0x5af246=events[_0x1aecfc];var _0x12bb75=createListener('chatQueue:'+_0x5af246,_0x544e94);ChatQueueEvents['on'](_0x5af246,_0x12bb75);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 0e1d2aa..cb10719 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0xf0949c,_0x333f08){var _0x54ec60=function(_0x362163){while(--_0x362163){_0xf0949c['push'](_0xf0949c['shift']());}};_0x54ec60(++_0x333f08);}(_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',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0xbdead3,_0x3d5499){var _0x3685cf=function(_0x2071bf){while(--_0x2071bf){_0xbdead3['push'](_0xbdead3['shift']());}};_0x3685cf(++_0x3d5499);}(_0x55ca,0x126));var _0xa55c=function(_0x1ed034,_0x5d495d){_0x1ed034=_0x1ed034-0x0;var _0x4a82b7=_0x55ca[_0x1ed034];return _0x4a82b7;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 51c521c..0742420 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 _0xd21c=['exports','STRING','DATE','sequelize'];(function(_0x2233e7,_0x103f19){var _0x33c74c=function(_0x52a5b6){while(--_0x52a5b6){_0x2233e7['push'](_0x2233e7['shift']());}};_0x33c74c(++_0x103f19);}(_0xd21c,0xf3));var _0xcd21=function(_0x56e2ed,_0x1c4781){_0x56e2ed=_0x56e2ed-0x0;var _0x5237b2=_0xd21c[_0x56e2ed];return _0x5237b2;};'use strict';var moment=require('moment');var Sequelize=require(_0xcd21('0x0'));module[_0xcd21('0x1')]={'uniqueid':{'type':Sequelize[_0xcd21('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcd21('0x2')]},'joinAt':{'type':Sequelize[_0xcd21('0x3')]},'leaveAt':{'type':Sequelize[_0xcd21('0x3')]},'acceptAt':{'type':Sequelize[_0xcd21('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xcd21('0x2')]}}; \ No newline at end of file +var _0x99c8=['STRING','DATE','exports'];(function(_0x547030,_0x5ac365){var _0x20dd29=function(_0x138efd){while(--_0x138efd){_0x547030['push'](_0x547030['shift']());}};_0x20dd29(++_0x5ac365);}(_0x99c8,0x10d));var _0x899c=function(_0x48604b,_0x518ed1){_0x48604b=_0x48604b-0x0;var _0x874edb=_0x99c8[_0x48604b];return _0x874edb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x899c('0x0')]={'uniqueid':{'type':Sequelize[_0x899c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x899c('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x899c('0x2')]},'acceptAt':{'type':Sequelize[_0x899c('0x2')]},'exitAt':{'type':Sequelize[_0x899c('0x2')]},'reason':{'type':Sequelize[_0x899c('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 5c41b98..0df36e5 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 _0x9206=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','ChatQueueReport','fieldName','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','length','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel'];(function(_0x45ca17,_0x3e0b94){var _0x46a3c6=function(_0x3dfe08){while(--_0x3dfe08){_0x45ca17['push'](_0x45ca17['shift']());}};_0x46a3c6(++_0x3e0b94);}(_0x9206,0x176));var _0x6920=function(_0x303f94,_0x52e489){_0x303f94=_0x303f94-0x0;var _0x1a12a9=_0x9206[_0x303f94];return _0x1a12a9;};'use strict';var emlformat=require(_0x6920('0x0'));var rimraf=require(_0x6920('0x1'));var zipdir=require(_0x6920('0x2'));var jsonpatch=require(_0x6920('0x3'));var rp=require(_0x6920('0x4'));var moment=require(_0x6920('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6920('0x6'));var path=require(_0x6920('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6920('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6920('0x9'));var squel=require(_0x6920('0xa'));var crypto=require(_0x6920('0xb'));var jsforce=require(_0x6920('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6920('0xd'));var Papa=require(_0x6920('0xe'));var Redis=require(_0x6920('0xf'));var authService=require(_0x6920('0x10'));var qs=require(_0x6920('0x11'));var as=require(_0x6920('0x12'));var hardwareService=require(_0x6920('0x13'));var logger=require(_0x6920('0x14'))(_0x6920('0x15'));var utils=require(_0x6920('0x16'));var config=require(_0x6920('0x17'));var licenseUtil=require(_0x6920('0x18'));var db=require(_0x6920('0x19'))['db'];function respondWithStatusCode(_0x5ad438,_0x4f8430){_0x4f8430=_0x4f8430||0xcc;return function(_0x31730c){if(_0x31730c){return _0x5ad438[_0x6920('0x1a')](_0x4f8430);}return _0x5ad438['status'](_0x4f8430)[_0x6920('0x1b')]();};}function respondWithResult(_0xfa2823,_0x18140a){_0x18140a=_0x18140a||0xc8;return function(_0x2c3a35){if(_0x2c3a35){return _0xfa2823[_0x6920('0x1c')](_0x18140a)['json'](_0x2c3a35);}};}function respondWithFilteredResult(_0x338e5f,_0x20cdfb){return function(_0x15d8af){if(_0x15d8af){var _0xa64034=typeof _0x20cdfb[_0x6920('0x1d')]===_0x6920('0x1e')&&typeof _0x20cdfb[_0x6920('0x1f')]===_0x6920('0x1e');var _0x11ce91=_0x15d8af[_0x6920('0x20')];var _0x462500=_0xa64034?0x0:_0x20cdfb[_0x6920('0x1d')];var _0xc6e86b=_0xa64034?_0x15d8af[_0x6920('0x20')]:_0x20cdfb[_0x6920('0x1d')]+_0x20cdfb['limit'];var _0x3a0c0c;if(_0xc6e86b>=_0x11ce91){_0xc6e86b=_0x11ce91;_0x3a0c0c=0xc8;}else{_0x3a0c0c=0xce;}_0x338e5f[_0x6920('0x1c')](_0x3a0c0c);return _0x338e5f[_0x6920('0x21')](_0x6920('0x22'),_0x462500+'-'+_0xc6e86b+'/'+_0x11ce91)[_0x6920('0x23')](_0x15d8af);}return null;};}function patchUpdates(_0x16cb96){return function(_0x2cce0b){try{jsonpatch[_0x6920('0x24')](_0x2cce0b,_0x16cb96,!![]);}catch(_0xaf93ba){return BPromise[_0x6920('0x25')](_0xaf93ba);}return _0x2cce0b[_0x6920('0x26')]();};}function saveUpdates(_0x39013e,_0x1df372){return function(_0x2dd788){if(_0x2dd788){return _0x2dd788[_0x6920('0x27')](_0x39013e)[_0x6920('0x28')](function(_0x1ae686){return _0x1ae686;});}return null;};}function removeEntity(_0x3a6e48,_0xa8f55){return function(_0x258986){if(_0x258986){return _0x258986['destroy']()[_0x6920('0x28')](function(){_0x3a6e48['status'](0xcc)[_0x6920('0x1b')]();});}};}function handleEntityNotFound(_0x4dd08b,_0x72316a){return function(_0x32a6ae){if(!_0x32a6ae){_0x4dd08b[_0x6920('0x1a')](0x194);}return _0x32a6ae;};}function handleError(_0xd069c,_0x5868e1){_0x5868e1=_0x5868e1||0x1f4;return function(_0x1cab00){logger[_0x6920('0x29')](_0x1cab00[_0x6920('0x2a')]);if(_0x1cab00[_0x6920('0x2b')]){delete _0x1cab00[_0x6920('0x2b')];}_0xd069c[_0x6920('0x1c')](_0x5868e1)[_0x6920('0x2c')](_0x1cab00);};}exports[_0x6920('0x2d')]=function(_0x400894,_0x2f5ce8){var _0x6860c7={},_0x2b2cd9={},_0x548fbc={'count':0x0,'rows':[]};var _0x182f1b=_['map'](db[_0x6920('0x2e')]['rawAttributes'],function(_0x31aa90){return{'name':_0x31aa90[_0x6920('0x2f')],'type':_0x31aa90['type'][_0x6920('0x30')]};});_0x2b2cd9[_0x6920('0x31')]=_[_0x6920('0x32')](_0x182f1b,'name');_0x2b2cd9['query']=_[_0x6920('0x33')](_0x400894['query']);_0x2b2cd9['filters']=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],_0x2b2cd9[_0x6920('0x35')]);_0x6860c7[_0x6920('0x36')]=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],qs[_0x6920('0x37')](_0x400894['query'][_0x6920('0x37')]));_0x6860c7['attributes']=_0x6860c7[_0x6920('0x36')]['length']?_0x6860c7['attributes']:_0x2b2cd9[_0x6920('0x31')];if(!_0x400894[_0x6920('0x35')][_0x6920('0x38')](_0x6920('0x39'))){_0x6860c7[_0x6920('0x1f')]=qs[_0x6920('0x1f')](_0x400894[_0x6920('0x35')][_0x6920('0x1f')]);_0x6860c7[_0x6920('0x1d')]=qs[_0x6920('0x1d')](_0x400894[_0x6920('0x35')][_0x6920('0x1d')]);}_0x6860c7['order']=qs[_0x6920('0x3a')](_0x400894['query'][_0x6920('0x3a')]);_0x6860c7[_0x6920('0x3b')]=qs[_0x6920('0x3c')](_['pick'](_0x400894[_0x6920('0x35')],_0x2b2cd9[_0x6920('0x3c')]),_0x182f1b);if(_0x400894[_0x6920('0x35')][_0x6920('0x3d')]){_0x6860c7['where']=_[_0x6920('0x3e')](_0x6860c7[_0x6920('0x3b')],{'$or':_['map'](_0x182f1b,function(_0x49be52){if(_0x49be52[_0x6920('0x3f')]!==_0x6920('0x40')){var _0x56ca8f={};_0x56ca8f[_0x49be52[_0x6920('0x2b')]]={'$like':'%'+_0x400894[_0x6920('0x35')]['filter']+'%'};return _0x56ca8f;}})});}_0x6860c7=_['merge']({},_0x6860c7,_0x400894[_0x6920('0x41')]);var _0x1f0c5f={'where':_0x6860c7[_0x6920('0x3b')]};return db[_0x6920('0x2e')][_0x6920('0x20')](_0x1f0c5f)['then'](function(_0x58f0e8){_0x548fbc['count']=_0x58f0e8;if(_0x400894[_0x6920('0x35')]['includeAll']){_0x6860c7['include']=[{'all':!![]}];}return db[_0x6920('0x2e')][_0x6920('0x42')](_0x6860c7);})['then'](function(_0x3aad11){_0x548fbc['rows']=_0x3aad11;return _0x548fbc;})[_0x6920('0x28')](respondWithFilteredResult(_0x2f5ce8,_0x6860c7))[_0x6920('0x43')](handleError(_0x2f5ce8,null));};exports[_0x6920('0x44')]=function(_0x1b3ebb,_0x3a994d){var _0x55d7b5={'raw':!![],'where':{'id':_0x1b3ebb[_0x6920('0x45')]['id']}},_0x4dfa0c={};_0x4dfa0c['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x4dfa0c[_0x6920('0x35')]=_[_0x6920('0x33')](_0x1b3ebb[_0x6920('0x35')]);_0x4dfa0c['filters']=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],_0x4dfa0c[_0x6920('0x35')]);_0x55d7b5[_0x6920('0x36')]=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],qs['fields'](_0x1b3ebb[_0x6920('0x35')][_0x6920('0x37')]));_0x55d7b5[_0x6920('0x36')]=_0x55d7b5[_0x6920('0x36')][_0x6920('0x46')]?_0x55d7b5[_0x6920('0x36')]:_0x4dfa0c[_0x6920('0x31')];if(_0x1b3ebb[_0x6920('0x35')][_0x6920('0x47')]){_0x55d7b5[_0x6920('0x48')]=[{'all':!![]}];}_0x55d7b5=_[_0x6920('0x3e')]({},_0x55d7b5,_0x1b3ebb[_0x6920('0x41')]);return db['ChatQueueReport'][_0x6920('0x49')](_0x55d7b5)[_0x6920('0x28')](handleEntityNotFound(_0x3a994d,null))['then'](respondWithResult(_0x3a994d,null))['catch'](handleError(_0x3a994d,null));};exports[_0x6920('0x4a')]=function(_0x3c231e,_0x20fab4){return db[_0x6920('0x2e')][_0x6920('0x4a')](_0x3c231e['body'],{})[_0x6920('0x28')](respondWithResult(_0x20fab4,0xc9))[_0x6920('0x43')](handleError(_0x20fab4,null));};exports[_0x6920('0x27')]=function(_0x51b12d,_0x4d1c79){if(_0x51b12d[_0x6920('0x4b')]['id']){delete _0x51b12d[_0x6920('0x4b')]['id'];}return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x51b12d['params']['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x4d1c79,null))[_0x6920('0x28')](saveUpdates(_0x51b12d[_0x6920('0x4b')],null))[_0x6920('0x28')](respondWithResult(_0x4d1c79,null))[_0x6920('0x43')](handleError(_0x4d1c79,null));};exports['destroy']=function(_0x1c0dd9,_0x3fe81d){return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x1c0dd9[_0x6920('0x45')]['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x3fe81d,null))[_0x6920('0x28')](removeEntity(_0x3fe81d,null))[_0x6920('0x43')](handleError(_0x3fe81d,null));};exports[_0x6920('0x4c')]=function(_0x1c6bba,_0x492a02){return db[_0x6920('0x2e')][_0x6920('0x4c')]()[_0x6920('0x28')](respondWithResult(_0x492a02,null))[_0x6920('0x43')](handleError(_0x492a02,null));}; \ No newline at end of file +var _0xa4bd=['count','set','reject','save','update','then','destroy','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x5b23f2,_0x9d16ef){_0x5b23f2=_0x5b23f2-0x0;var _0x19986d=_0xa4bd[_0x5b23f2];return _0x19986d;};'use strict';var emlformat=require(_0xda4b('0x0'));var rimraf=require(_0xda4b('0x1'));var zipdir=require(_0xda4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda4b('0x3'));var moment=require(_0xda4b('0x4'));var BPromise=require(_0xda4b('0x5'));var Mustache=require(_0xda4b('0x6'));var util=require(_0xda4b('0x7'));var path=require(_0xda4b('0x8'));var sox=require(_0xda4b('0x9'));var csv=require(_0xda4b('0xa'));var ejs=require(_0xda4b('0xb'));var fs=require('fs');var fs_extra=require(_0xda4b('0xc'));var _=require('lodash');var squel=require(_0xda4b('0xd'));var crypto=require(_0xda4b('0xe'));var jsforce=require(_0xda4b('0xf'));var deskjs=require(_0xda4b('0x10'));var toCsv=require('to-csv');var querystring=require(_0xda4b('0x11'));var Papa=require(_0xda4b('0x12'));var Redis=require(_0xda4b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xda4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda4b('0x15'));var logger=require(_0xda4b('0x16'))(_0xda4b('0x17'));var utils=require(_0xda4b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xda4b('0x19'));var db=require(_0xda4b('0x1a'))['db'];function respondWithStatusCode(_0x2781d3,_0x2f9554){_0x2f9554=_0x2f9554||0xcc;return function(_0x2d3243){if(_0x2d3243){return _0x2781d3[_0xda4b('0x1b')](_0x2f9554);}return _0x2781d3[_0xda4b('0x1c')](_0x2f9554)[_0xda4b('0x1d')]();};}function respondWithResult(_0xb5881c,_0xb70e25){_0xb70e25=_0xb70e25||0xc8;return function(_0x4c25db){if(_0x4c25db){return _0xb5881c[_0xda4b('0x1c')](_0xb70e25)[_0xda4b('0x1e')](_0x4c25db);}};}function respondWithFilteredResult(_0xb7ec2c,_0x2fb875){return function(_0x1a3115){if(_0x1a3115){var _0x12e7fc=typeof _0x2fb875[_0xda4b('0x1f')]===_0xda4b('0x20')&&typeof _0x2fb875[_0xda4b('0x21')]===_0xda4b('0x20');var _0x30185e=_0x1a3115[_0xda4b('0x22')];var _0x5ed049=_0x12e7fc?0x0:_0x2fb875[_0xda4b('0x1f')];var _0x56c65e=_0x12e7fc?_0x1a3115['count']:_0x2fb875[_0xda4b('0x1f')]+_0x2fb875[_0xda4b('0x21')];var _0x42834c;if(_0x56c65e>=_0x30185e){_0x56c65e=_0x30185e;_0x42834c=0xc8;}else{_0x42834c=0xce;}_0xb7ec2c[_0xda4b('0x1c')](_0x42834c);return _0xb7ec2c[_0xda4b('0x23')]('Content-Range',_0x5ed049+'-'+_0x56c65e+'/'+_0x30185e)['json'](_0x1a3115);}return null;};}function patchUpdates(_0x2397de){return function(_0x139bfa){try{jsonpatch['apply'](_0x139bfa,_0x2397de,!![]);}catch(_0x2a8425){return BPromise[_0xda4b('0x24')](_0x2a8425);}return _0x139bfa[_0xda4b('0x25')]();};}function saveUpdates(_0x56566a,_0x48d8a8){return function(_0x3e9f20){if(_0x3e9f20){return _0x3e9f20[_0xda4b('0x26')](_0x56566a)[_0xda4b('0x27')](function(_0x1c57ce){return _0x1c57ce;});}return null;};}function removeEntity(_0x318d48,_0x606e86){return function(_0x108adf){if(_0x108adf){return _0x108adf[_0xda4b('0x28')]()[_0xda4b('0x27')](function(){_0x318d48[_0xda4b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f6ecc,_0x5f19ef){return function(_0x3046dc){if(!_0x3046dc){_0x2f6ecc[_0xda4b('0x1b')](0x194);}return _0x3046dc;};}function handleError(_0x4a7cac,_0x5ecf1a){_0x5ecf1a=_0x5ecf1a||0x1f4;return function(_0x1b03f1){logger['error'](_0x1b03f1[_0xda4b('0x29')]);if(_0x1b03f1[_0xda4b('0x2a')]){delete _0x1b03f1[_0xda4b('0x2a')];}_0x4a7cac[_0xda4b('0x1c')](_0x5ecf1a)['send'](_0x1b03f1);};}exports[_0xda4b('0x2b')]=function(_0x1ce977,_0x18f78a){var _0x550ec4={},_0x52022b={},_0x218bb2={'count':0x0,'rows':[]};var _0x1277cc=_['map'](db[_0xda4b('0x2c')][_0xda4b('0x2d')],function(_0x5312ab){return{'name':_0x5312ab[_0xda4b('0x2e')],'type':_0x5312ab[_0xda4b('0x2f')]['key']};});_0x52022b[_0xda4b('0x30')]=_[_0xda4b('0x31')](_0x1277cc,_0xda4b('0x2a'));_0x52022b['query']=_['keys'](_0x1ce977[_0xda4b('0x32')]);_0x52022b[_0xda4b('0x33')]=_[_0xda4b('0x34')](_0x52022b['model'],_0x52022b[_0xda4b('0x32')]);_0x550ec4['attributes']=_[_0xda4b('0x34')](_0x52022b[_0xda4b('0x30')],qs['fields'](_0x1ce977[_0xda4b('0x32')][_0xda4b('0x35')]));_0x550ec4[_0xda4b('0x36')]=_0x550ec4[_0xda4b('0x36')]['length']?_0x550ec4['attributes']:_0x52022b['model'];if(!_0x1ce977[_0xda4b('0x32')][_0xda4b('0x37')]('nolimit')){_0x550ec4['limit']=qs[_0xda4b('0x21')](_0x1ce977[_0xda4b('0x32')]['limit']);_0x550ec4[_0xda4b('0x1f')]=qs[_0xda4b('0x1f')](_0x1ce977['query'][_0xda4b('0x1f')]);}_0x550ec4[_0xda4b('0x38')]=qs[_0xda4b('0x39')](_0x1ce977[_0xda4b('0x32')][_0xda4b('0x39')]);_0x550ec4['where']=qs[_0xda4b('0x33')](_['pick'](_0x1ce977[_0xda4b('0x32')],_0x52022b[_0xda4b('0x33')]),_0x1277cc);if(_0x1ce977['query'][_0xda4b('0x3a')]){_0x550ec4['where']=_[_0xda4b('0x3b')](_0x550ec4[_0xda4b('0x3c')],{'$or':_[_0xda4b('0x31')](_0x1277cc,function(_0x46b8e1){if(_0x46b8e1[_0xda4b('0x2f')]!==_0xda4b('0x3d')){var _0x5b7350={};_0x5b7350[_0x46b8e1[_0xda4b('0x2a')]]={'$like':'%'+_0x1ce977[_0xda4b('0x32')][_0xda4b('0x3a')]+'%'};return _0x5b7350;}})});}_0x550ec4=_[_0xda4b('0x3b')]({},_0x550ec4,_0x1ce977[_0xda4b('0x3e')]);var _0x710929={'where':_0x550ec4['where']};return db['ChatQueueReport'][_0xda4b('0x22')](_0x710929)[_0xda4b('0x27')](function(_0x18b7bb){_0x218bb2[_0xda4b('0x22')]=_0x18b7bb;if(_0x1ce977[_0xda4b('0x32')][_0xda4b('0x3f')]){_0x550ec4[_0xda4b('0x40')]=[{'all':!![]}];}return db[_0xda4b('0x2c')]['findAll'](_0x550ec4);})['then'](function(_0x5a7988){_0x218bb2[_0xda4b('0x41')]=_0x5a7988;return _0x218bb2;})[_0xda4b('0x27')](respondWithFilteredResult(_0x18f78a,_0x550ec4))[_0xda4b('0x42')](handleError(_0x18f78a,null));};exports[_0xda4b('0x43')]=function(_0x1b0f58,_0x1d875b){var _0x59f5a8={'raw':!![],'where':{'id':_0x1b0f58[_0xda4b('0x44')]['id']}},_0x1b1abb={};_0x1b1abb[_0xda4b('0x30')]=_[_0xda4b('0x45')](db[_0xda4b('0x2c')][_0xda4b('0x2d')]);_0x1b1abb[_0xda4b('0x32')]=_[_0xda4b('0x45')](_0x1b0f58[_0xda4b('0x32')]);_0x1b1abb[_0xda4b('0x33')]=_[_0xda4b('0x34')](_0x1b1abb[_0xda4b('0x30')],_0x1b1abb[_0xda4b('0x32')]);_0x59f5a8[_0xda4b('0x36')]=_[_0xda4b('0x34')](_0x1b1abb[_0xda4b('0x30')],qs[_0xda4b('0x35')](_0x1b0f58[_0xda4b('0x32')][_0xda4b('0x35')]));_0x59f5a8[_0xda4b('0x36')]=_0x59f5a8[_0xda4b('0x36')]['length']?_0x59f5a8[_0xda4b('0x36')]:_0x1b1abb[_0xda4b('0x30')];if(_0x1b0f58[_0xda4b('0x32')][_0xda4b('0x3f')]){_0x59f5a8['include']=[{'all':!![]}];}_0x59f5a8=_[_0xda4b('0x3b')]({},_0x59f5a8,_0x1b0f58[_0xda4b('0x3e')]);return db[_0xda4b('0x2c')][_0xda4b('0x46')](_0x59f5a8)[_0xda4b('0x27')](handleEntityNotFound(_0x1d875b,null))[_0xda4b('0x27')](respondWithResult(_0x1d875b,null))[_0xda4b('0x42')](handleError(_0x1d875b,null));};exports[_0xda4b('0x47')]=function(_0x633f12,_0x579261){return db[_0xda4b('0x2c')][_0xda4b('0x47')](_0x633f12[_0xda4b('0x48')],{})[_0xda4b('0x27')](respondWithResult(_0x579261,0xc9))[_0xda4b('0x42')](handleError(_0x579261,null));};exports[_0xda4b('0x26')]=function(_0x5c8aef,_0x2311be){if(_0x5c8aef[_0xda4b('0x48')]['id']){delete _0x5c8aef[_0xda4b('0x48')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5c8aef[_0xda4b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2311be,null))[_0xda4b('0x27')](saveUpdates(_0x5c8aef['body'],null))[_0xda4b('0x27')](respondWithResult(_0x2311be,null))[_0xda4b('0x42')](handleError(_0x2311be,null));};exports[_0xda4b('0x28')]=function(_0x4c139e,_0x50fd28){return db[_0xda4b('0x2c')][_0xda4b('0x46')]({'where':{'id':_0x4c139e['params']['id']}})[_0xda4b('0x27')](handleEntityNotFound(_0x50fd28,null))[_0xda4b('0x27')](removeEntity(_0x50fd28,null))[_0xda4b('0x42')](handleError(_0x50fd28,null));};exports['describe']=function(_0x521cd4,_0x162d6f){return db['ChatQueueReport'][_0xda4b('0x49')]()[_0xda4b('0x27')](respondWithResult(_0x162d6f,null))[_0xda4b('0x42')](handleError(_0x162d6f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 04404e0..e158940 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4eea2a,_0x4ac868){var _0x49c5e7=function(_0x3c7e30){while(--_0x3c7e30){_0x4eea2a['push'](_0x4eea2a['shift']());}};_0x49c5e7(++_0x4ac868);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0xcb91[_0x4164f2];return _0x2575c7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xde8d6d,_0x36f308){var _0x3a880d=function(_0x5c340f){while(--_0x5c340f){_0xde8d6d['push'](_0xde8d6d['shift']());}};_0x3a880d(++_0x36f308);}(_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 3ed0e22..ecd60a5 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 _0x478d=['code','ChatQueueReport,\x20%s,\x20%s','message','CreateChatQueueReport','ChatQueueReport','create','body','options','debug','catch','UpdateChatQueueReport','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a84d6,_0x538497){var _0x55c2ea=function(_0x3f5d46){while(--_0x3f5d46){_0x2a84d6['push'](_0x2a84d6['shift']());}};_0x55c2ea(++_0x538497);}(_0x478d,0x89));var _0xd478=function(_0x18b73d,_0x310f91){_0x18b73d=_0x18b73d-0x0;var _0x24b2ec=_0x478d[_0x18b73d];return _0x24b2ec;};'use strict';var _=require(_0xd478('0x0'));var util=require(_0xd478('0x1'));var moment=require(_0xd478('0x2'));var BPromise=require(_0xd478('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd478('0x4'))['db'];var utils=require(_0xd478('0x5'));var logger=require(_0xd478('0x6'))(_0xd478('0x7'));var config=require(_0xd478('0x8'));var jayson=require(_0xd478('0x9'));var client=jayson[_0xd478('0xa')][_0xd478('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x279d88,_0x286f0a,_0x4f0e05){return new BPromise(function(_0x2450f5,_0x36b698){return client[_0xd478('0xc')](_0x279d88,_0x4f0e05)[_0xd478('0xd')](function(_0x107353){logger[_0xd478('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x286f0a,'request\x20sent');logger['debug'](_0xd478('0xf'),_0x286f0a,'request\x20sent',JSON[_0xd478('0x10')](_0x107353));if(_0x107353[_0xd478('0x11')]){if(_0x107353[_0xd478('0x11')][_0xd478('0x12')]===0x1f4){logger[_0xd478('0x11')](_0xd478('0x13'),_0x286f0a,_0x107353['error']['message']);return _0x36b698(_0x107353[_0xd478('0x11')][_0xd478('0x14')]);}logger[_0xd478('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x286f0a,_0x107353[_0xd478('0x11')]['message']);return _0x2450f5(_0x107353[_0xd478('0x11')][_0xd478('0x14')]);}else{logger[_0xd478('0xe')](_0xd478('0x13'),_0x286f0a,'request\x20sent');_0x2450f5(_0x107353['result']['message']);}})['catch'](function(_0x370b27){logger[_0xd478('0x11')](_0xd478('0x13'),_0x286f0a,_0x370b27);_0x36b698(_0x370b27);});});}exports[_0xd478('0x15')]=function(_0x4bcd77){var _0x1bb996=this;return new Promise(function(_0x2b36cd,_0x2d2715){return db[_0xd478('0x16')][_0xd478('0x17')](_0x4bcd77[_0xd478('0x18')],{'raw':_0x4bcd77['options']?_0x4bcd77[_0xd478('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xd478('0xd')](function(_0xc8dff){logger[_0xd478('0xe')](_0xd478('0x15'),_0x4bcd77);logger[_0xd478('0x1a')](_0xd478('0x15'),_0x4bcd77,JSON['stringify'](_0xc8dff));_0x2b36cd(_0xc8dff);})[_0xd478('0x1b')](function(_0x428bcf){logger[_0xd478('0x11')](_0xd478('0x15'),_0x428bcf[_0xd478('0x14')],_0x4bcd77);_0x2d2715(_0x1bb996[_0xd478('0x11')](0x1f4,_0x428bcf[_0xd478('0x14')]));});});};exports[_0xd478('0x1c')]=function(_0x470a11){var _0x476396=this;return new Promise(function(_0x5b6d7e,_0x57a799){return db[_0xd478('0x16')]['update'](_0x470a11[_0xd478('0x18')],{'raw':_0x470a11[_0xd478('0x19')]?_0x470a11[_0xd478('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x470a11[_0xd478('0x19')]?_0x470a11['options']['where']||null:null,'attributes':_0x470a11[_0xd478('0x19')]?_0x470a11[_0xd478('0x19')][_0xd478('0x1d')]||null:null,'limit':_0x470a11['options']?_0x470a11[_0xd478('0x19')][_0xd478('0x1e')]||null:null})[_0xd478('0xd')](function(_0xf6d0e5){logger[_0xd478('0xe')](_0xd478('0x1c'),_0x470a11);logger['debug'](_0xd478('0x1c'),_0x470a11,JSON[_0xd478('0x10')](_0xf6d0e5));_0x5b6d7e(_0xf6d0e5);})[_0xd478('0x1b')](function(_0x5d4d15){logger['error']('UpdateChatQueueReport',_0x5d4d15[_0xd478('0x14')],_0x470a11);_0x57a799(_0x476396[_0xd478('0x11')](0x1f4,_0x5d4d15[_0xd478('0x14')]));});});}; \ No newline at end of file +var _0x7a27=['ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','info','stringify','where','attributes','UpdateChatQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0x7a27,0x172));var _0x77a2=function(_0x191d1c,_0x11b4a0){_0x191d1c=_0x191d1c-0x0;var _0x5d2bac=_0x7a27[_0x191d1c];return _0x5d2bac;};'use strict';var _=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var moment=require(_0x77a2('0x2'));var BPromise=require(_0x77a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77a2('0x4'));var db=require(_0x77a2('0x5'))['db'];var utils=require(_0x77a2('0x6'));var logger=require(_0x77a2('0x7'))('rpc');var config=require(_0x77a2('0x8'));var jayson=require(_0x77a2('0x9'));var client=jayson[_0x77a2('0xa')][_0x77a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b6037,_0x4a0fe4,_0x4e41b2){return new BPromise(function(_0x144d6e,_0xedb0bf){return client[_0x77a2('0xc')](_0x5b6037,_0x4e41b2)[_0x77a2('0xd')](function(_0x1379b0){logger['info'](_0x77a2('0xe'),_0x4a0fe4,'request\x20sent');logger['debug'](_0x77a2('0xf'),_0x4a0fe4,_0x77a2('0x10'),JSON['stringify'](_0x1379b0));if(_0x1379b0['error']){if(_0x1379b0[_0x77a2('0x11')][_0x77a2('0x12')]===0x1f4){logger[_0x77a2('0x11')](_0x77a2('0xe'),_0x4a0fe4,_0x1379b0[_0x77a2('0x11')][_0x77a2('0x13')]);return _0xedb0bf(_0x1379b0['error'][_0x77a2('0x13')]);}logger[_0x77a2('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x4a0fe4,_0x1379b0[_0x77a2('0x11')]['message']);return _0x144d6e(_0x1379b0[_0x77a2('0x11')][_0x77a2('0x13')]);}else{logger['info'](_0x77a2('0xe'),_0x4a0fe4,_0x77a2('0x10'));_0x144d6e(_0x1379b0['result'][_0x77a2('0x13')]);}})[_0x77a2('0x14')](function(_0x48c438){logger[_0x77a2('0x11')](_0x77a2('0xe'),_0x4a0fe4,_0x48c438);_0xedb0bf(_0x48c438);});});}exports[_0x77a2('0x15')]=function(_0x49fd4d){var _0x403b03=this;return new Promise(function(_0x76196d,_0x390b91){return db[_0x77a2('0x16')][_0x77a2('0x17')](_0x49fd4d[_0x77a2('0x18')],{'raw':_0x49fd4d[_0x77a2('0x19')]?_0x49fd4d[_0x77a2('0x19')][_0x77a2('0x1a')]===undefined?!![]:![]:!![]})[_0x77a2('0xd')](function(_0x52fe6c){logger[_0x77a2('0x1b')](_0x77a2('0x15'),_0x49fd4d);logger['debug'](_0x77a2('0x15'),_0x49fd4d,JSON[_0x77a2('0x1c')](_0x52fe6c));_0x76196d(_0x52fe6c);})['catch'](function(_0x3a05b0){logger[_0x77a2('0x11')](_0x77a2('0x15'),_0x3a05b0[_0x77a2('0x13')],_0x49fd4d);_0x390b91(_0x403b03[_0x77a2('0x11')](0x1f4,_0x3a05b0[_0x77a2('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x236ef8){var _0x1b4c14=this;return new Promise(function(_0x33e386,_0x480c9b){return db[_0x77a2('0x16')]['update'](_0x236ef8[_0x77a2('0x18')],{'raw':_0x236ef8[_0x77a2('0x19')]?_0x236ef8[_0x77a2('0x19')][_0x77a2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x236ef8[_0x77a2('0x19')]?_0x236ef8['options'][_0x77a2('0x1d')]||null:null,'attributes':_0x236ef8[_0x77a2('0x19')]?_0x236ef8['options'][_0x77a2('0x1e')]||null:null,'limit':_0x236ef8['options']?_0x236ef8['options']['limit']||null:null})[_0x77a2('0xd')](function(_0x49b1a6){logger['info'](_0x77a2('0x1f'),_0x236ef8);logger['debug'](_0x77a2('0x1f'),_0x236ef8,JSON[_0x77a2('0x1c')](_0x49b1a6));_0x33e386(_0x49b1a6);})['catch'](function(_0x3452a3){logger[_0x77a2('0x11')](_0x77a2('0x1f'),_0x3452a3[_0x77a2('0x13')],_0x236ef8);_0x480c9b(_0x1b4c14[_0x77a2('0x11')](0x1f4,_0x3452a3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index db64c1f..a971159 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 _0x0e2e=['/describe','describe','/:id','post','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x8a7344,_0x49e867){var _0x4f266d=function(_0x29c0af){while(--_0x29c0af){_0x8a7344['push'](_0x8a7344['shift']());}};_0x4f266d(++_0x49e867);}(_0x0e2e,0xf5));var _0xe0e2=function(_0x45ccda,_0xf0d2a2){_0x45ccda=_0x45ccda-0x0;var _0x45162d=_0x0e2e[_0x45ccda];return _0x45162d;};'use strict';var multer=require(_0xe0e2('0x0'));var util=require('util');var path=require(_0xe0e2('0x1'));var timeout=require(_0xe0e2('0x2'));var express=require(_0xe0e2('0x3'));var router=express[_0xe0e2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe0e2('0x5'));var interaction=require(_0xe0e2('0x6'));var config=require(_0xe0e2('0x7'));var controller=require('./chatQueueReport.controller');router[_0xe0e2('0x8')]('/',auth[_0xe0e2('0x9')](),controller['index']);router[_0xe0e2('0x8')](_0xe0e2('0xa'),auth[_0xe0e2('0x9')](),controller[_0xe0e2('0xb')]);router['get'](_0xe0e2('0xc'),auth[_0xe0e2('0x9')](),controller['show']);router[_0xe0e2('0xd')]('/',auth[_0xe0e2('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe0e2('0xe')](_0xe0e2('0xc'),auth[_0xe0e2('0x9')](),controller[_0xe0e2('0xf')]);module[_0xe0e2('0x10')]=router; \ No newline at end of file +var _0x385f=['post','update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x56321f,_0x1c41eb){var _0x5aa129=function(_0x5cab95){while(--_0x5cab95){_0x56321f['push'](_0x56321f['shift']());}};_0x5aa129(++_0x1c41eb);}(_0x385f,0x191));var _0xf385=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x385f[_0x3c51d4];return _0x53c45f;};'use strict';var multer=require('multer');var util=require(_0xf385('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf385('0x1')]();var fs_extra=require(_0xf385('0x2'));var auth=require(_0xf385('0x3'));var interaction=require(_0xf385('0x4'));var config=require('../../config/environment');var controller=require(_0xf385('0x5'));router['get']('/',auth[_0xf385('0x6')](),controller[_0xf385('0x7')]);router[_0xf385('0x8')](_0xf385('0x9'),auth[_0xf385('0x6')](),controller[_0xf385('0xa')]);router[_0xf385('0x8')](_0xf385('0xb'),auth[_0xf385('0x6')](),controller[_0xf385('0xc')]);router[_0xf385('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xf385('0x6')](),controller[_0xf385('0xe')]);router[_0xf385('0xf')](_0xf385('0xb'),auth[_0xf385('0x6')](),controller[_0xf385('0x10')]);module[_0xf385('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6c0beb0..5d24e72 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x437e08,_0x1cab6c){var _0xcf57f2=function(_0x2ef02e){while(--_0x2ef02e){_0x437e08['push'](_0x437e08['shift']());}};_0xcf57f2(++_0x1cab6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x54d624,_0x481973){var _0x2de0dc=function(_0x2d8385){while(--_0x2d8385){_0x54d624['push'](_0x54d624['shift']());}};_0x2de0dc(++_0x481973);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index ceaad22..1590d16 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 _0x38a6=['json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','catch','create','body','find','destroy','describe','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1b6704,_0x44d3fb){var _0x4cb50d=function(_0x235c04){while(--_0x235c04){_0x1b6704['push'](_0x1b6704['shift']());}};_0x4cb50d(++_0x44d3fb);}(_0x38a6,0x192));var _0x638a=function(_0x2bffb3,_0x478642){_0x2bffb3=_0x2bffb3-0x0;var _0x5137bd=_0x38a6[_0x2bffb3];return _0x5137bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x638a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x638a('0x1'));var rp=require('request-promise');var moment=require(_0x638a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x638a('0x3'));var util=require(_0x638a('0x4'));var path=require(_0x638a('0x5'));var sox=require(_0x638a('0x6'));var csv=require(_0x638a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x638a('0x8'));var _=require('lodash');var squel=require(_0x638a('0x9'));var crypto=require(_0x638a('0xa'));var jsforce=require(_0x638a('0xb'));var deskjs=require(_0x638a('0xc'));var toCsv=require(_0x638a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x638a('0xd'));var authService=require(_0x638a('0xe'));var qs=require(_0x638a('0xf'));var as=require(_0x638a('0x10'));var hardwareService=require(_0x638a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x638a('0x12'));var config=require(_0x638a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x638a('0x14'))['db'];function respondWithStatusCode(_0x2ccf8e,_0x19b41){_0x19b41=_0x19b41||0xcc;return function(_0x2afa8a){if(_0x2afa8a){return _0x2ccf8e[_0x638a('0x15')](_0x19b41);}return _0x2ccf8e[_0x638a('0x16')](_0x19b41)[_0x638a('0x17')]();};}function respondWithResult(_0x47139b,_0x4f9295){_0x4f9295=_0x4f9295||0xc8;return function(_0x418fb9){if(_0x418fb9){return _0x47139b[_0x638a('0x16')](_0x4f9295)[_0x638a('0x18')](_0x418fb9);}};}function respondWithFilteredResult(_0x5c1b50,_0x3524cd){return function(_0x57b690){if(_0x57b690){var _0x225eb2=typeof _0x3524cd[_0x638a('0x19')]===_0x638a('0x1a')&&typeof _0x3524cd[_0x638a('0x1b')]==='undefined';var _0x434179=_0x57b690[_0x638a('0x1c')];var _0x102e8e=_0x225eb2?0x0:_0x3524cd[_0x638a('0x19')];var _0x2fdfef=_0x225eb2?_0x57b690['count']:_0x3524cd[_0x638a('0x19')]+_0x3524cd[_0x638a('0x1b')];var _0x1fca85;if(_0x2fdfef>=_0x434179){_0x2fdfef=_0x434179;_0x1fca85=0xc8;}else{_0x1fca85=0xce;}_0x5c1b50['status'](_0x1fca85);return _0x5c1b50[_0x638a('0x1d')]('Content-Range',_0x102e8e+'-'+_0x2fdfef+'/'+_0x434179)[_0x638a('0x18')](_0x57b690);}return null;};}function patchUpdates(_0x312be7){return function(_0x3b2840){try{jsonpatch[_0x638a('0x1e')](_0x3b2840,_0x312be7,!![]);}catch(_0x354c3e){return BPromise[_0x638a('0x1f')](_0x354c3e);}return _0x3b2840[_0x638a('0x20')]();};}function saveUpdates(_0x1bb089,_0x17c83b){return function(_0x4090e1){if(_0x4090e1){return _0x4090e1[_0x638a('0x21')](_0x1bb089)[_0x638a('0x22')](function(_0x3376b9){return _0x3376b9;});}return null;};}function removeEntity(_0x371a38,_0x7dcd65){return function(_0x5545bc){if(_0x5545bc){return _0x5545bc['destroy']()[_0x638a('0x22')](function(){_0x371a38[_0x638a('0x16')](0xcc)[_0x638a('0x17')]();});}};}function handleEntityNotFound(_0xe4372,_0x4fd227){return function(_0xe9000a){if(!_0xe9000a){_0xe4372[_0x638a('0x15')](0x194);}return _0xe9000a;};}function handleError(_0x206e0a,_0x5c2761){_0x5c2761=_0x5c2761||0x1f4;return function(_0x58d406){logger[_0x638a('0x23')](_0x58d406[_0x638a('0x24')]);if(_0x58d406[_0x638a('0x25')]){delete _0x58d406[_0x638a('0x25')];}_0x206e0a[_0x638a('0x16')](_0x5c2761)[_0x638a('0x26')](_0x58d406);};}exports[_0x638a('0x27')]=function(_0x5a1291,_0x2846f8){var _0x5c3d6d={},_0xb862ce={},_0x2676a0={'count':0x0,'rows':[]};var _0x1339c7=_[_0x638a('0x28')](db[_0x638a('0x29')][_0x638a('0x2a')],function(_0x1878b3){return{'name':_0x1878b3['fieldName'],'type':_0x1878b3[_0x638a('0x2b')][_0x638a('0x2c')]};});_0xb862ce[_0x638a('0x2d')]=_[_0x638a('0x28')](_0x1339c7,_0x638a('0x25'));_0xb862ce[_0x638a('0x2e')]=_[_0x638a('0x2f')](_0x5a1291[_0x638a('0x2e')]);_0xb862ce[_0x638a('0x30')]=_[_0x638a('0x31')](_0xb862ce[_0x638a('0x2d')],_0xb862ce[_0x638a('0x2e')]);_0x5c3d6d['attributes']=_[_0x638a('0x31')](_0xb862ce[_0x638a('0x2d')],qs[_0x638a('0x32')](_0x5a1291[_0x638a('0x2e')][_0x638a('0x32')]));_0x5c3d6d[_0x638a('0x33')]=_0x5c3d6d[_0x638a('0x33')]['length']?_0x5c3d6d[_0x638a('0x33')]:_0xb862ce[_0x638a('0x2d')];if(!_0x5a1291[_0x638a('0x2e')]['hasOwnProperty']('nolimit')){_0x5c3d6d['limit']=qs[_0x638a('0x1b')](_0x5a1291[_0x638a('0x2e')][_0x638a('0x1b')]);_0x5c3d6d[_0x638a('0x19')]=qs[_0x638a('0x19')](_0x5a1291[_0x638a('0x2e')][_0x638a('0x19')]);}_0x5c3d6d[_0x638a('0x34')]=qs[_0x638a('0x35')](_0x5a1291[_0x638a('0x2e')][_0x638a('0x35')]);_0x5c3d6d[_0x638a('0x36')]=qs['filters'](_['pick'](_0x5a1291['query'],_0xb862ce[_0x638a('0x30')]),_0x1339c7);if(_0x5a1291[_0x638a('0x2e')][_0x638a('0x37')]){_0x5c3d6d[_0x638a('0x36')]=_[_0x638a('0x38')](_0x5c3d6d[_0x638a('0x36')],{'$or':_[_0x638a('0x28')](_0x1339c7,function(_0x38b951){if(_0x38b951['type']!==_0x638a('0x39')){var _0x41807e={};_0x41807e[_0x38b951['name']]={'$like':'%'+_0x5a1291[_0x638a('0x2e')]['filter']+'%'};return _0x41807e;}})});}_0x5c3d6d=_[_0x638a('0x38')]({},_0x5c3d6d,_0x5a1291[_0x638a('0x3a')]);var _0x47f3f0={'where':_0x5c3d6d['where']};return db[_0x638a('0x29')][_0x638a('0x1c')](_0x47f3f0)[_0x638a('0x22')](function(_0x5f291b){_0x2676a0['count']=_0x5f291b;if(_0x5a1291[_0x638a('0x2e')][_0x638a('0x3b')]){_0x5c3d6d[_0x638a('0x3c')]=[{'all':!![]}];}return db[_0x638a('0x29')]['findAll'](_0x5c3d6d);})[_0x638a('0x22')](function(_0x4b1e3d){_0x2676a0[_0x638a('0x3d')]=_0x4b1e3d;return _0x2676a0;})[_0x638a('0x22')](respondWithFilteredResult(_0x2846f8,_0x5c3d6d))['catch'](handleError(_0x2846f8,null));};exports[_0x638a('0x3e')]=function(_0x30b7c6,_0x5d865f){var _0x142a45={'raw':!![],'where':{'id':_0x30b7c6[_0x638a('0x3f')]['id']}},_0x5a89d2={};_0x5a89d2[_0x638a('0x2d')]=_[_0x638a('0x2f')](db[_0x638a('0x29')][_0x638a('0x2a')]);_0x5a89d2['query']=_[_0x638a('0x2f')](_0x30b7c6[_0x638a('0x2e')]);_0x5a89d2[_0x638a('0x30')]=_[_0x638a('0x31')](_0x5a89d2[_0x638a('0x2d')],_0x5a89d2[_0x638a('0x2e')]);_0x142a45[_0x638a('0x33')]=_[_0x638a('0x31')](_0x5a89d2[_0x638a('0x2d')],qs[_0x638a('0x32')](_0x30b7c6[_0x638a('0x2e')][_0x638a('0x32')]));_0x142a45[_0x638a('0x33')]=_0x142a45[_0x638a('0x33')][_0x638a('0x40')]?_0x142a45[_0x638a('0x33')]:_0x5a89d2[_0x638a('0x2d')];if(_0x30b7c6[_0x638a('0x2e')][_0x638a('0x3b')]){_0x142a45['include']=[{'all':!![]}];}_0x142a45=_[_0x638a('0x38')]({},_0x142a45,_0x30b7c6[_0x638a('0x3a')]);return db[_0x638a('0x29')]['find'](_0x142a45)['then'](handleEntityNotFound(_0x5d865f,null))[_0x638a('0x22')](respondWithResult(_0x5d865f,null))[_0x638a('0x41')](handleError(_0x5d865f,null));};exports[_0x638a('0x42')]=function(_0x527131,_0x20d2fa){return db['ChatTransferReport']['create'](_0x527131['body'],{})[_0x638a('0x22')](respondWithResult(_0x20d2fa,0xc9))[_0x638a('0x41')](handleError(_0x20d2fa,null));};exports[_0x638a('0x21')]=function(_0x50ba75,_0x46eaed){if(_0x50ba75[_0x638a('0x43')]['id']){delete _0x50ba75['body']['id'];}return db[_0x638a('0x29')][_0x638a('0x44')]({'where':{'id':_0x50ba75[_0x638a('0x3f')]['id']}})[_0x638a('0x22')](handleEntityNotFound(_0x46eaed,null))[_0x638a('0x22')](saveUpdates(_0x50ba75['body'],null))[_0x638a('0x22')](respondWithResult(_0x46eaed,null))[_0x638a('0x41')](handleError(_0x46eaed,null));};exports[_0x638a('0x45')]=function(_0x300cce,_0x5b67ea){return db['ChatTransferReport'][_0x638a('0x44')]({'where':{'id':_0x300cce[_0x638a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5b67ea,null))[_0x638a('0x22')](removeEntity(_0x5b67ea,null))[_0x638a('0x41')](handleError(_0x5b67ea,null));};exports[_0x638a('0x46')]=function(_0x1933fb,_0x34c3a0){return db[_0x638a('0x29')][_0x638a('0x46')]()[_0x638a('0x22')](respondWithResult(_0x34c3a0,null))[_0x638a('0x41')](handleError(_0x34c3a0,null));}; \ No newline at end of file +var _0x9fc4=['include','findAll','rows','catch','show','length','find','create','body','update','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','set','Content-Range','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','count','includeAll'];(function(_0x1f4074,_0x18dbab){var _0x196b7a=function(_0x46328c){while(--_0x46328c){_0x1f4074['push'](_0x1f4074['shift']());}};_0x196b7a(++_0x18dbab);}(_0x9fc4,0xf3));var _0x49fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fc4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x49fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49fc('0x2'));var moment=require(_0x49fc('0x3'));var BPromise=require(_0x49fc('0x4'));var Mustache=require('mustache');var util=require(_0x49fc('0x5'));var path=require(_0x49fc('0x6'));var sox=require('sox');var csv=require(_0x49fc('0x7'));var ejs=require(_0x49fc('0x8'));var fs=require('fs');var fs_extra=require(_0x49fc('0x9'));var _=require(_0x49fc('0xa'));var squel=require('squel');var crypto=require(_0x49fc('0xb'));var jsforce=require(_0x49fc('0xc'));var deskjs=require(_0x49fc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x49fc('0xe'));var Papa=require(_0x49fc('0xf'));var Redis=require(_0x49fc('0x10'));var authService=require(_0x49fc('0x11'));var qs=require(_0x49fc('0x12'));var as=require(_0x49fc('0x13'));var hardwareService=require(_0x49fc('0x14'));var logger=require(_0x49fc('0x15'))(_0x49fc('0x16'));var utils=require(_0x49fc('0x17'));var config=require(_0x49fc('0x18'));var licenseUtil=require(_0x49fc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d34e5,_0x4b52b8){_0x4b52b8=_0x4b52b8||0xcc;return function(_0x26a0a1){if(_0x26a0a1){return _0x2d34e5['sendStatus'](_0x4b52b8);}return _0x2d34e5[_0x49fc('0x1a')](_0x4b52b8)['end']();};}function respondWithResult(_0x1546ed,_0x2fe96e){_0x2fe96e=_0x2fe96e||0xc8;return function(_0x2e31b8){if(_0x2e31b8){return _0x1546ed[_0x49fc('0x1a')](_0x2fe96e)[_0x49fc('0x1b')](_0x2e31b8);}};}function respondWithFilteredResult(_0x1c8e66,_0x3eeab0){return function(_0xfadf3f){if(_0xfadf3f){var _0x3026f5=typeof _0x3eeab0[_0x49fc('0x1c')]===_0x49fc('0x1d')&&typeof _0x3eeab0[_0x49fc('0x1e')]===_0x49fc('0x1d');var _0x3c9aef=_0xfadf3f['count'];var _0x13cffb=_0x3026f5?0x0:_0x3eeab0[_0x49fc('0x1c')];var _0x3f4cde=_0x3026f5?_0xfadf3f['count']:_0x3eeab0[_0x49fc('0x1c')]+_0x3eeab0[_0x49fc('0x1e')];var _0x31ab06;if(_0x3f4cde>=_0x3c9aef){_0x3f4cde=_0x3c9aef;_0x31ab06=0xc8;}else{_0x31ab06=0xce;}_0x1c8e66[_0x49fc('0x1a')](_0x31ab06);return _0x1c8e66[_0x49fc('0x1f')](_0x49fc('0x20'),_0x13cffb+'-'+_0x3f4cde+'/'+_0x3c9aef)[_0x49fc('0x1b')](_0xfadf3f);}return null;};}function patchUpdates(_0x347a1e){return function(_0x2a5aa9){try{jsonpatch['apply'](_0x2a5aa9,_0x347a1e,!![]);}catch(_0x4f3354){return BPromise['reject'](_0x4f3354);}return _0x2a5aa9[_0x49fc('0x21')]();};}function saveUpdates(_0x359173,_0x765111){return function(_0xd63a92){if(_0xd63a92){return _0xd63a92['update'](_0x359173)[_0x49fc('0x22')](function(_0x592447){return _0x592447;});}return null;};}function removeEntity(_0x21c3f7,_0x43a381){return function(_0x3cbd06){if(_0x3cbd06){return _0x3cbd06[_0x49fc('0x23')]()[_0x49fc('0x22')](function(){_0x21c3f7[_0x49fc('0x1a')](0xcc)[_0x49fc('0x24')]();});}};}function handleEntityNotFound(_0x2e4f43,_0x13ed55){return function(_0x529ded){if(!_0x529ded){_0x2e4f43[_0x49fc('0x25')](0x194);}return _0x529ded;};}function handleError(_0xbe1da,_0x53f5a7){_0x53f5a7=_0x53f5a7||0x1f4;return function(_0x1c6881){logger[_0x49fc('0x26')](_0x1c6881[_0x49fc('0x27')]);if(_0x1c6881[_0x49fc('0x28')]){delete _0x1c6881['name'];}_0xbe1da[_0x49fc('0x1a')](_0x53f5a7)[_0x49fc('0x29')](_0x1c6881);};}exports[_0x49fc('0x2a')]=function(_0x5b9c7c,_0xdea5c1){var _0x1976ef={},_0x1773d4={},_0x5d955b={'count':0x0,'rows':[]};var _0x513350=_[_0x49fc('0x2b')](db[_0x49fc('0x2c')][_0x49fc('0x2d')],function(_0x4170fd){return{'name':_0x4170fd[_0x49fc('0x2e')],'type':_0x4170fd['type']['key']};});_0x1773d4[_0x49fc('0x2f')]=_[_0x49fc('0x2b')](_0x513350,_0x49fc('0x28'));_0x1773d4['query']=_[_0x49fc('0x30')](_0x5b9c7c[_0x49fc('0x31')]);_0x1773d4['filters']=_['intersection'](_0x1773d4['model'],_0x1773d4['query']);_0x1976ef['attributes']=_[_0x49fc('0x32')](_0x1773d4[_0x49fc('0x2f')],qs['fields'](_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x33')]));_0x1976ef[_0x49fc('0x34')]=_0x1976ef[_0x49fc('0x34')]['length']?_0x1976ef[_0x49fc('0x34')]:_0x1773d4[_0x49fc('0x2f')];if(!_0x5b9c7c[_0x49fc('0x31')]['hasOwnProperty'](_0x49fc('0x35'))){_0x1976ef[_0x49fc('0x1e')]=qs[_0x49fc('0x1e')](_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x1e')]);_0x1976ef[_0x49fc('0x1c')]=qs[_0x49fc('0x1c')](_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x1c')]);}_0x1976ef[_0x49fc('0x36')]=qs['sort'](_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x37')]);_0x1976ef[_0x49fc('0x38')]=qs[_0x49fc('0x39')](_['pick'](_0x5b9c7c[_0x49fc('0x31')],_0x1773d4[_0x49fc('0x39')]),_0x513350);if(_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x3a')]){_0x1976ef['where']=_['merge'](_0x1976ef['where'],{'$or':_[_0x49fc('0x2b')](_0x513350,function(_0x585c26){if(_0x585c26[_0x49fc('0x3b')]!==_0x49fc('0x3c')){var _0x5c87e9={};_0x5c87e9[_0x585c26['name']]={'$like':'%'+_0x5b9c7c[_0x49fc('0x31')]['filter']+'%'};return _0x5c87e9;}})});}_0x1976ef=_[_0x49fc('0x3d')]({},_0x1976ef,_0x5b9c7c[_0x49fc('0x3e')]);var _0x1fc7fd={'where':_0x1976ef['where']};return db[_0x49fc('0x2c')]['count'](_0x1fc7fd)['then'](function(_0x19d218){_0x5d955b[_0x49fc('0x3f')]=_0x19d218;if(_0x5b9c7c[_0x49fc('0x31')][_0x49fc('0x40')]){_0x1976ef[_0x49fc('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x49fc('0x42')](_0x1976ef);})[_0x49fc('0x22')](function(_0x2eb54a){_0x5d955b[_0x49fc('0x43')]=_0x2eb54a;return _0x5d955b;})['then'](respondWithFilteredResult(_0xdea5c1,_0x1976ef))[_0x49fc('0x44')](handleError(_0xdea5c1,null));};exports[_0x49fc('0x45')]=function(_0x2ae3fd,_0x4613fc){var _0x5da60a={'raw':!![],'where':{'id':_0x2ae3fd['params']['id']}},_0x15f065={};_0x15f065[_0x49fc('0x2f')]=_[_0x49fc('0x30')](db[_0x49fc('0x2c')]['rawAttributes']);_0x15f065[_0x49fc('0x31')]=_[_0x49fc('0x30')](_0x2ae3fd[_0x49fc('0x31')]);_0x15f065['filters']=_['intersection'](_0x15f065[_0x49fc('0x2f')],_0x15f065['query']);_0x5da60a[_0x49fc('0x34')]=_['intersection'](_0x15f065[_0x49fc('0x2f')],qs['fields'](_0x2ae3fd[_0x49fc('0x31')]['fields']));_0x5da60a['attributes']=_0x5da60a[_0x49fc('0x34')][_0x49fc('0x46')]?_0x5da60a[_0x49fc('0x34')]:_0x15f065[_0x49fc('0x2f')];if(_0x2ae3fd[_0x49fc('0x31')]['includeAll']){_0x5da60a['include']=[{'all':!![]}];}_0x5da60a=_[_0x49fc('0x3d')]({},_0x5da60a,_0x2ae3fd['options']);return db[_0x49fc('0x2c')][_0x49fc('0x47')](_0x5da60a)[_0x49fc('0x22')](handleEntityNotFound(_0x4613fc,null))[_0x49fc('0x22')](respondWithResult(_0x4613fc,null))[_0x49fc('0x44')](handleError(_0x4613fc,null));};exports[_0x49fc('0x48')]=function(_0x1b7f64,_0x59cfb3){return db[_0x49fc('0x2c')]['create'](_0x1b7f64[_0x49fc('0x49')],{})[_0x49fc('0x22')](respondWithResult(_0x59cfb3,0xc9))[_0x49fc('0x44')](handleError(_0x59cfb3,null));};exports[_0x49fc('0x4a')]=function(_0x30640c,_0x401a64){if(_0x30640c[_0x49fc('0x49')]['id']){delete _0x30640c[_0x49fc('0x49')]['id'];}return db[_0x49fc('0x2c')][_0x49fc('0x47')]({'where':{'id':_0x30640c['params']['id']}})['then'](handleEntityNotFound(_0x401a64,null))[_0x49fc('0x22')](saveUpdates(_0x30640c[_0x49fc('0x49')],null))['then'](respondWithResult(_0x401a64,null))[_0x49fc('0x44')](handleError(_0x401a64,null));};exports[_0x49fc('0x23')]=function(_0xeb247e,_0x202dbc){return db['ChatTransferReport'][_0x49fc('0x47')]({'where':{'id':_0xeb247e[_0x49fc('0x4b')]['id']}})[_0x49fc('0x22')](handleEntityNotFound(_0x202dbc,null))[_0x49fc('0x22')](removeEntity(_0x202dbc,null))[_0x49fc('0x44')](handleError(_0x202dbc,null));};exports['describe']=function(_0x24a817,_0x272be9){return db[_0x49fc('0x2c')][_0x49fc('0x4c')]()['then'](respondWithResult(_0x272be9,null))[_0x49fc('0x44')](handleError(_0x272be9,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index fee60ce..4c6dbc1 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 _0x2e08=['bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x2e08,0x127));var _0x82e0=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2e08[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x82e0('0x0'));var util=require(_0x82e0('0x1'));var logger=require(_0x82e0('0x2'))(_0x82e0('0x3'));var moment=require(_0x82e0('0x4'));var BPromise=require(_0x82e0('0x5'));var rp=require(_0x82e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82e0('0x7'));var config=require(_0x82e0('0x8'));var attributes=require(_0x82e0('0x9'));module[_0x82e0('0xa')]=function(_0x44f3f2,_0x3e7bbe){return _0x44f3f2[_0x82e0('0xb')](_0x82e0('0xc'),attributes,{'tableName':_0x82e0('0xd'),'paranoid':![],'indexes':[{'name':_0x82e0('0xe'),'fields':[_0x82e0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2db6=['exports','define','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','./chatTransferReport.attributes'];(function(_0x2bd408,_0x4c5659){var _0x54c9f1=function(_0x11e6e3){while(--_0x11e6e3){_0x2bd408['push'](_0x2bd408['shift']());}};_0x54c9f1(++_0x4c5659);}(_0x2db6,0xa8));var _0x62db=function(_0x38b7fc,_0xe48357){_0x38b7fc=_0x38b7fc-0x0;var _0x43b19a=_0x2db6[_0x38b7fc];return _0x43b19a;};'use strict';var _=require(_0x62db('0x0'));var util=require(_0x62db('0x1'));var logger=require(_0x62db('0x2'))(_0x62db('0x3'));var moment=require(_0x62db('0x4'));var BPromise=require('bluebird');var rp=require(_0x62db('0x5'));var fs=require('fs');var path=require(_0x62db('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62db('0x7'));module[_0x62db('0x8')]=function(_0x131989,_0x571f6d){return _0x131989[_0x62db('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x62db('0xa'),'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 77c84a1..890eda4 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 _0xaafe=['info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x311888,_0x366dfa){var _0x318e98=function(_0x267792){while(--_0x267792){_0x311888['push'](_0x311888['shift']());}};_0x318e98(++_0x366dfa);}(_0xaafe,0xf5));var _0xeaaf=function(_0x24755e,_0x183154){_0x24755e=_0x24755e-0x0;var _0x352741=_0xaafe[_0x24755e];return _0x352741;};'use strict';var _=require(_0xeaaf('0x0'));var util=require(_0xeaaf('0x1'));var moment=require(_0xeaaf('0x2'));var BPromise=require('bluebird');var rs=require(_0xeaaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaaf('0x4'))['db'];var utils=require(_0xeaaf('0x5'));var logger=require(_0xeaaf('0x6'))(_0xeaaf('0x7'));var config=require(_0xeaaf('0x8'));var jayson=require(_0xeaaf('0x9'));var client=jayson[_0xeaaf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x282a86,_0x3e0482,_0x5e62d8){return new BPromise(function(_0x373d73,_0x56a352){return client['request'](_0x282a86,_0x5e62d8)['then'](function(_0xfece57){logger['info'](_0xeaaf('0xb'),_0x3e0482,_0xeaaf('0xc'));logger[_0xeaaf('0xd')](_0xeaaf('0xe'),_0x3e0482,_0xeaaf('0xc'),JSON[_0xeaaf('0xf')](_0xfece57));if(_0xfece57['error']){if(_0xfece57[_0xeaaf('0x10')][_0xeaaf('0x11')]===0x1f4){logger[_0xeaaf('0x10')](_0xeaaf('0xb'),_0x3e0482,_0xfece57['error'][_0xeaaf('0x12')]);return _0x56a352(_0xfece57[_0xeaaf('0x10')]['message']);}logger['error'](_0xeaaf('0xb'),_0x3e0482,_0xfece57[_0xeaaf('0x10')]['message']);return _0x373d73(_0xfece57[_0xeaaf('0x10')][_0xeaaf('0x12')]);}else{logger[_0xeaaf('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3e0482,'request\x20sent');_0x373d73(_0xfece57[_0xeaaf('0x14')][_0xeaaf('0x12')]);}})[_0xeaaf('0x15')](function(_0xe284e9){logger[_0xeaaf('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x3e0482,_0xe284e9);_0x56a352(_0xe284e9);});});} \ No newline at end of file +var _0x07b8=['then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x36ed40,_0x13d2fc){var _0x1069ab=function(_0x19289f){while(--_0x19289f){_0x36ed40['push'](_0x36ed40['shift']());}};_0x1069ab(++_0x13d2fc);}(_0x07b8,0x1ae));var _0x807b=function(_0x5621b4,_0x49c7bd){_0x5621b4=_0x5621b4-0x0;var _0x54bb44=_0x07b8[_0x5621b4];return _0x54bb44;};'use strict';var _=require('lodash');var util=require(_0x807b('0x0'));var moment=require('moment');var BPromise=require(_0x807b('0x1'));var rs=require(_0x807b('0x2'));var fs=require('fs');var Redis=require(_0x807b('0x3'));var db=require(_0x807b('0x4'))['db'];var utils=require(_0x807b('0x5'));var logger=require(_0x807b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x807b('0x7'));var client=jayson[_0x807b('0x8')][_0x807b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x226fa5,_0xb5f2cb,_0x353cfc){return new BPromise(function(_0x6167b5,_0x385586){return client[_0x807b('0xa')](_0x226fa5,_0x353cfc)[_0x807b('0xb')](function(_0x299ee8){logger[_0x807b('0xc')](_0x807b('0xd'),_0xb5f2cb,_0x807b('0xe'));logger[_0x807b('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xb5f2cb,_0x807b('0xe'),JSON['stringify'](_0x299ee8));if(_0x299ee8[_0x807b('0x10')]){if(_0x299ee8[_0x807b('0x10')][_0x807b('0x11')]===0x1f4){logger[_0x807b('0x10')](_0x807b('0xd'),_0xb5f2cb,_0x299ee8[_0x807b('0x10')][_0x807b('0x12')]);return _0x385586(_0x299ee8[_0x807b('0x10')][_0x807b('0x12')]);}logger[_0x807b('0x10')](_0x807b('0xd'),_0xb5f2cb,_0x299ee8['error'][_0x807b('0x12')]);return _0x6167b5(_0x299ee8[_0x807b('0x10')][_0x807b('0x12')]);}else{logger[_0x807b('0xc')](_0x807b('0xd'),_0xb5f2cb,'request\x20sent');_0x6167b5(_0x299ee8[_0x807b('0x13')][_0x807b('0x12')]);}})[_0x807b('0x14')](function(_0x41c122){logger[_0x807b('0x10')](_0x807b('0xd'),_0xb5f2cb,_0x41c122);_0x385586(_0x41c122);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index f62a91e..13c6b46 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 _0x8e35=['describe','/:id','show','post','put','delete','exports','multer','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1c4d2a,_0x5ec079){var _0x20a649=function(_0x9e020e){while(--_0x9e020e){_0x1c4d2a['push'](_0x1c4d2a['shift']());}};_0x20a649(++_0x5ec079);}(_0x8e35,0x67));var _0x58e3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8e35[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x58e3('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x58e3('0x1')]();var fs_extra=require(_0x58e3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x58e3('0x3'));var config=require('../../config/environment');var controller=require(_0x58e3('0x4'));router[_0x58e3('0x5')]('/',auth[_0x58e3('0x6')](),controller[_0x58e3('0x7')]);router[_0x58e3('0x5')](_0x58e3('0x8'),auth[_0x58e3('0x6')](),controller[_0x58e3('0x9')]);router[_0x58e3('0x5')](_0x58e3('0xa'),auth['isAuthenticated'](),controller[_0x58e3('0xb')]);router[_0x58e3('0xc')]('/',auth[_0x58e3('0x6')](),controller['create']);router[_0x58e3('0xd')](_0x58e3('0xa'),auth[_0x58e3('0x6')](),controller['update']);router[_0x58e3('0xe')](_0x58e3('0xa'),auth[_0x58e3('0x6')](),controller['destroy']);module[_0x58e3('0xf')]=router; \ No newline at end of file +var _0x8983=['../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service'];(function(_0x43555b,_0x1774ce){var _0x46291d=function(_0xd9bf4a){while(--_0xd9bf4a){_0x43555b['push'](_0x43555b['shift']());}};_0x46291d(++_0x1774ce);}(_0x8983,0x13e));var _0x3898=function(_0x51f950,_0x3ecf51){_0x51f950=_0x51f950-0x0;var _0x3941d9=_0x8983[_0x51f950];return _0x3941d9;};'use strict';var multer=require(_0x3898('0x0'));var util=require(_0x3898('0x1'));var path=require('path');var timeout=require(_0x3898('0x2'));var express=require(_0x3898('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3898('0x4'));var config=require(_0x3898('0x5'));var controller=require(_0x3898('0x6'));router['get']('/',auth[_0x3898('0x7')](),controller[_0x3898('0x8')]);router[_0x3898('0x9')](_0x3898('0xa'),auth[_0x3898('0x7')](),controller[_0x3898('0xb')]);router[_0x3898('0x9')]('/:id',auth[_0x3898('0x7')](),controller[_0x3898('0xc')]);router[_0x3898('0xd')]('/',auth[_0x3898('0x7')](),controller['create']);router[_0x3898('0xe')](_0x3898('0xf'),auth[_0x3898('0x7')](),controller[_0x3898('0x10')]);router[_0x3898('0x11')](_0x3898('0xf'),auth[_0x3898('0x7')](),controller[_0x3898('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e70232f..bfe7296 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 _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','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','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x85e3f2,_0x32270d){var _0x323577=function(_0x3856b2){while(--_0x3856b2){_0x85e3f2['push'](_0x85e3f2['shift']());}};_0x323577(++_0x32270d);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3e3f2f,_0x3c68eb){_0x3e3f2f=_0x3e3f2f-0x0;var _0x13d9c6=_0xee5b[_0x3e3f2f];return _0x13d9c6;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}}; \ No newline at end of file +var _0x41bb=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Chat','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','ENUM','star','thumb','name','text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','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','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x3e9092,_0x2b7060){var _0x47e452=function(_0x2f93dc){while(--_0x2f93dc){_0x3e9092['push'](_0x3e9092['shift']());}};_0x47e452(++_0x2b7060);}(_0x41bb,0xc5));var _0xb41b=function(_0xd45615,_0x1eee52){_0xd45615=_0xd45615-0x0;var _0xde4c1c=_0x41bb[_0xd45615];return _0xde4c1c;};'use strict';var Sequelize=require(_0xb41b('0x0'));var rs=require(_0xb41b('0x1'));module['exports']={'name':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb41b('0x3')},'description':{'type':Sequelize[_0xb41b('0x2')]},'mapKey':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x4')},'key':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb41b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb41b('0x2')]},'animation':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb41b('0x9'),'squared'),'defaultValue':_0xb41b('0x9')},'header_online':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xa')},'start_chat_button':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0xc')},'header_offline':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xd')},'download_transcript':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb41b('0xe')]},'closingQuestion':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x11')},'noteTitle':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x12')},'placeholderMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x13')},'closingMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb41b('0x16')](_0xb41b('0x17'),_0xb41b('0x18')),'defaultValue':_0xb41b('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xb41b('0x19'),'type':_0xb41b('0x1a'),'required':!![]},'props':{'title':_0xb41b('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xb41b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb41b('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb41b('0x1b')](_0xb41b('0x1c'))?JSON['parse'](this[_0xb41b('0x1b')]('onlineForm')):{};},'set':function(_0x2d0f27){return this[_0xb41b('0x1d')]('onlineForm',JSON[_0xb41b('0x1e')](_0x2d0f27));}},'offlineForm':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xb41b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb41b('0x4'),'type':_0xb41b('0x4')},'variable':null},{'type':_0xb41b('0x1f'),'config':{'placeholder':_0xb41b('0x20')},'props':{'title':_0xb41b('0x20'),'helpText':_0xb41b('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xb41b('0x22'))?JSON[_0xb41b('0x23')](this['getDataValue'](_0xb41b('0x22'))):{};},'set':function(_0x482764){return this[_0xb41b('0x1d')](_0xb41b('0x22'),JSON['stringify'](_0x482764));}},'token':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb41b('0x2')]},'forwardOffline':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb41b('0x2')]},'waitingTitle':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x24')},'waitingMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x26')},'offlineMessageBody':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x15')},'sendUnmanaged':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb41b('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb41b('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return _0xb41b('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x2a')},'defaultTitle':{'type':Sequelize[_0xb41b('0x2')]},'customerAvatar':{'type':Sequelize[_0xb41b('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb41b('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x2c')},'systemAvatar':{'type':Sequelize[_0xb41b('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb41b('0x7')],'comment':_0xb41b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x49e8c4){if(!_0x49e8c4)this['setDataValue'](_0xb41b('0x2e'),null);this['setDataValue']('mandatoryDisposition',_0x49e8c4);}},'vidaooEscalation':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x2f')},'vidaooNote':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':function(){return _0xb41b('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb41b('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 6ee4efe..17e98d5 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 _0xf809=['EventManager','notify','offline','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','subjectOffline','toPairsIn','mapValues','lastName','Chat','MailAccountId','NotifyMailAccount','server','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','timezone','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','push','all','some','utf8','URL','address','origin','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','sequelize','Transaction','ChatApplication','findAndCountAll','finally','json','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','ChatWebsites','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','pick','rows','removeDispositions','ids','CannedAnswer','getAnswers','length','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','root','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','server/files/images/avatars/system_avatar.png','systemAvatar','headers','user-agent','getResult','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','Applications','account','applications','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','format','%s\x20%s','version','unknown','browser','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting'];(function(_0x490d5b,_0x2639a0){var _0x311d1e=function(_0x329145){while(--_0x329145){_0x490d5b['push'](_0x490d5b['shift']());}};_0x311d1e(++_0x2639a0);}(_0xf809,0x6f));var _0x9f80=function(_0x56e842,_0x536f0c){_0x56e842=_0x56e842-0x0;var _0x42aeb4=_0xf809[_0x56e842];return _0x42aeb4;};'use strict';var BPromise=require(_0x9f80('0x0'));var Mustache=require(_0x9f80('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f80('0x2'));var _=require(_0x9f80('0x3'));var querystring=require(_0x9f80('0x4'));var Redis=require(_0x9f80('0x5'));var qs=require(_0x9f80('0x6'));var logger=require(_0x9f80('0x7'))(_0x9f80('0x8'));var config=require(_0x9f80('0x9'));var url=require(_0x9f80('0xa'));var db=require('../../mysqldb')['db'];config[_0x9f80('0xb')]=_[_0x9f80('0xc')](config[_0x9f80('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f80('0xd'))(new Redis(config[_0x9f80('0xb')]));require(_0x9f80('0xe'))[_0x9f80('0xf')](socket);var htmlToText=require(_0x9f80('0x10'));var jayson=require('jayson/promise');var client=jayson[_0x9f80('0x11')]['http']({'port':0x232c});var client9002=jayson[_0x9f80('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x9f80('0x11')][_0x9f80('0x12')]({'port':0x232b});var client9001=jayson['client'][_0x9f80('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x69aefa,_0x37ab00,_0x2e316c,_0x2afc80){return new BPromise(function(_0x4ba58e,_0x4f4211){var _0x27d563=_0x2afc80||client;return _0x27d563[_0x9f80('0x13')](_0x69aefa,_0x2e316c)['then'](function(_0x1ca258){logger[_0x9f80('0x14')](_0x9f80('0x15'),_0x37ab00,'request\x20sent');logger['debug'](_0x9f80('0x16'),_0x37ab00,_0x9f80('0x17'),JSON[_0x9f80('0x18')](_0x1ca258));if(_0x1ca258[_0x9f80('0x19')]){if(_0x1ca258[_0x9f80('0x19')]['code']===0x1f4){logger[_0x9f80('0x19')](_0x9f80('0x15'),_0x37ab00,_0x1ca258['error'][_0x9f80('0x1a')]);return _0x4f4211(_0x1ca258['error'][_0x9f80('0x1a')]);}logger[_0x9f80('0x19')](_0x9f80('0x15'),_0x37ab00,_0x1ca258[_0x9f80('0x19')]['message']);return _0x4ba58e(_0x1ca258[_0x9f80('0x19')][_0x9f80('0x1a')]);}else{logger['info'](_0x9f80('0x15'),_0x37ab00,_0x9f80('0x17'));_0x4ba58e(_0x1ca258['result'][_0x9f80('0x1a')]);}})[_0x9f80('0x1b')](function(_0x3e2b51){logger['error'](_0x9f80('0x15'),_0x37ab00,_0x3e2b51);_0x4f4211(_0x3e2b51);});});}function respondWithStatusCode(_0x46278d,_0x3e4f4d){_0x3e4f4d=_0x3e4f4d||0xcc;return function(_0xa6e98a){if(_0xa6e98a){return _0x46278d[_0x9f80('0x1c')](_0x3e4f4d);}return _0x46278d['status'](_0x3e4f4d)['end']();};}function respondWithResult(_0x3f353f,_0x16acde){_0x16acde=_0x16acde||0xc8;return function(_0x460bc6){if(_0x460bc6){return _0x3f353f[_0x9f80('0x1d')](_0x16acde)['json'](_0x460bc6);}};}function respondWithFilteredResult(_0x453ac3,_0x3bb5e7){return function(_0x1df332){if(_0x1df332){var _0x2db7e9=typeof _0x3bb5e7[_0x9f80('0x1e')]===_0x9f80('0x1f')&&typeof _0x3bb5e7['limit']===_0x9f80('0x1f');var _0x5dda79=_0x1df332[_0x9f80('0x20')];var _0x28180e=_0x2db7e9?0x0:_0x3bb5e7[_0x9f80('0x1e')];var _0x14b3fb=_0x2db7e9?_0x1df332[_0x9f80('0x20')]:_0x3bb5e7[_0x9f80('0x1e')]+_0x3bb5e7[_0x9f80('0x21')];var _0x188919;if(_0x14b3fb>=_0x5dda79){_0x14b3fb=_0x5dda79;_0x188919=0xc8;}else{_0x188919=0xce;}_0x453ac3['status'](_0x188919);return _0x453ac3[_0x9f80('0x22')](_0x9f80('0x23'),_0x28180e+'-'+_0x14b3fb+'/'+_0x5dda79)['json'](_0x1df332);}return null;};}function saveUpdates(_0x364db0){return function(_0x3f61d8){if(_0x3f61d8){return _0x3f61d8[_0x9f80('0x24')](_0x364db0)[_0x9f80('0x25')](function(_0x14d2fd){return _0x14d2fd;});}return null;};}function removeEntity(_0x55a762){return function(_0x47d4e2){if(_0x47d4e2){return _0x47d4e2[_0x9f80('0x26')]()[_0x9f80('0x25')](function(){var _0x1d43bc=_0x47d4e2[_0x9f80('0x27')]({'plain':!![]});var _0x5e014d=_0x9f80('0x28');return db['UserProfileResource'][_0x9f80('0x26')]({'where':{'type':_0x5e014d,'resourceId':_0x1d43bc['id']}})['then'](function(){return _0x47d4e2;});})[_0x9f80('0x25')](function(){_0x55a762[_0x9f80('0x1d')](0xcc)[_0x9f80('0x29')]();});}};}function handleEntityNotFound(_0x3a3b7f){return function(_0x2c02dc){if(!_0x2c02dc){_0x3a3b7f[_0x9f80('0x1c')](0x194);}return _0x2c02dc;};}function handleError(_0x11e6d0,_0x5e9e6f){_0x5e9e6f=_0x5e9e6f||0x1f4;return function(_0x490b1b){logger[_0x9f80('0x19')](_0x490b1b[_0x9f80('0x2a')]);if(_0x490b1b['name']){delete _0x490b1b[_0x9f80('0x2b')];}_0x11e6d0[_0x9f80('0x1d')](_0x5e9e6f)[_0x9f80('0x2c')](_0x490b1b);};}exports[_0x9f80('0x2d')]=function(_0x440c97,_0x39fa2f){var _0x33921a={'include':[{'model':db[_0x9f80('0x2e')],'as':_0x9f80('0x2f')}]},_0x1db9f5={},_0x4f4cd4={'count':0x0,'rows':[]};var _0x1ae70d=_[_0x9f80('0x30')](db[_0x9f80('0x31')][_0x9f80('0x32')],function(_0x4cb623){return{'name':_0x4cb623[_0x9f80('0x33')],'type':_0x4cb623[_0x9f80('0x34')][_0x9f80('0x35')]};});_0x1db9f5['model']=_[_0x9f80('0x30')](_0x1ae70d,_0x9f80('0x2b'));_0x1db9f5['query']=_[_0x9f80('0x36')](_0x440c97[_0x9f80('0x37')]);_0x1db9f5[_0x9f80('0x38')]=_[_0x9f80('0x39')](_0x1db9f5[_0x9f80('0x3a')],_0x1db9f5['query']);_0x33921a[_0x9f80('0x3b')]=_[_0x9f80('0x39')](_0x1db9f5[_0x9f80('0x3a')],qs[_0x9f80('0x3c')](_0x440c97[_0x9f80('0x37')][_0x9f80('0x3c')]));_0x33921a[_0x9f80('0x3b')]=_0x33921a[_0x9f80('0x3b')]['length']?_0x33921a[_0x9f80('0x3b')]:_0x1db9f5['model'];if(!_0x440c97[_0x9f80('0x37')][_0x9f80('0x3d')](_0x9f80('0x3e'))){_0x33921a['limit']=qs[_0x9f80('0x21')](_0x440c97[_0x9f80('0x37')][_0x9f80('0x21')]);_0x33921a['offset']=qs[_0x9f80('0x1e')](_0x440c97[_0x9f80('0x37')]['offset']);}_0x33921a[_0x9f80('0x3f')]=qs[_0x9f80('0x40')](_0x440c97['query'][_0x9f80('0x40')]);_0x33921a[_0x9f80('0x41')]=qs[_0x9f80('0x38')](_['pick'](_0x440c97[_0x9f80('0x37')],_0x1db9f5['filters']),_0x1ae70d);if(_0x440c97[_0x9f80('0x37')][_0x9f80('0x42')]){_0x33921a['where']=_[_0x9f80('0x43')](_0x33921a[_0x9f80('0x41')],{'$or':_['map'](_0x1ae70d,function(_0x5528d3){if(_0x5528d3[_0x9f80('0x34')]!==_0x9f80('0x44')){var _0x2a248a={};_0x2a248a[_0x5528d3['name']]={'$like':'%'+_0x440c97[_0x9f80('0x37')][_0x9f80('0x42')]+'%'};return _0x2a248a;}})});}_0x33921a=_[_0x9f80('0x43')]({},_0x33921a,_0x440c97[_0x9f80('0x45')]);var _0xa2309d={'where':_0x33921a['where']};return db['ChatWebsite'][_0x9f80('0x20')](_0xa2309d)[_0x9f80('0x25')](function(_0x3246db){_0x4f4cd4['count']=_0x3246db;if(_0x440c97[_0x9f80('0x37')][_0x9f80('0x46')]){_0x33921a['include']=[{'all':!![]}];}return db[_0x9f80('0x31')][_0x9f80('0x47')](_0x33921a);})[_0x9f80('0x25')](function(_0x21b787){_0x4f4cd4['rows']=_0x21b787;return _0x4f4cd4;})[_0x9f80('0x25')](respondWithFilteredResult(_0x39fa2f,_0x33921a))[_0x9f80('0x1b')](handleError(_0x39fa2f,null));};exports['show']=function(_0x26920d,_0x2dd631){var _0x2e258c={'raw':![],'where':{'id':_0x26920d[_0x9f80('0x48')]['id']},'include':[{'model':db[_0x9f80('0x2e')],'as':_0x9f80('0x2f')}]},_0x17b72c={};_0x17b72c[_0x9f80('0x3a')]=_[_0x9f80('0x36')](db[_0x9f80('0x31')][_0x9f80('0x32')]);_0x17b72c[_0x9f80('0x37')]=_['keys'](_0x26920d[_0x9f80('0x37')]);_0x17b72c['filters']=_[_0x9f80('0x39')](_0x17b72c[_0x9f80('0x3a')],_0x17b72c[_0x9f80('0x37')]);_0x2e258c[_0x9f80('0x3b')]=_[_0x9f80('0x39')](_0x17b72c[_0x9f80('0x3a')],qs[_0x9f80('0x3c')](_0x26920d[_0x9f80('0x37')][_0x9f80('0x3c')]));_0x2e258c[_0x9f80('0x3b')]=_0x2e258c['attributes']['length']?_0x2e258c[_0x9f80('0x3b')]:_0x17b72c['model'];if(_0x26920d[_0x9f80('0x37')]['includeAll']){_0x2e258c[_0x9f80('0x49')]=[{'all':!![]}];}_0x2e258c=_[_0x9f80('0x43')]({},_0x2e258c,_0x26920d[_0x9f80('0x45')]);return db[_0x9f80('0x31')][_0x9f80('0x4a')](_0x2e258c)[_0x9f80('0x25')](handleEntityNotFound(_0x2dd631,null))[_0x9f80('0x25')](respondWithResult(_0x2dd631,null))['catch'](handleError(_0x2dd631,null));};exports[_0x9f80('0x4b')]=function(_0x2f9f30,_0x34e829){return db[_0x9f80('0x31')][_0x9f80('0x4b')](_0x2f9f30[_0x9f80('0x4c')],{})['then'](function(_0xa10ab8){var _0x3bdac3=_0x2f9f30[_0x9f80('0x4d')][_0x9f80('0x27')]({'plain':!![]});if(!_0x3bdac3)throw new Error(_0x9f80('0x4e'));if(_0x3bdac3[_0x9f80('0x4f')]==='user'){var _0x575ac7=_0xa10ab8[_0x9f80('0x27')]({'plain':!![]});var _0x18d1ec='ChatWebsites';return db[_0x9f80('0x50')][_0x9f80('0x4a')]({'where':{'name':_0x18d1ec,'userProfileId':_0x3bdac3['userProfileId']},'raw':!![]})[_0x9f80('0x25')](function(_0x421f3c){if(_0x421f3c&&_0x421f3c[_0x9f80('0x51')]===0x0){return db[_0x9f80('0x52')][_0x9f80('0x4b')]({'name':_0x575ac7[_0x9f80('0x2b')],'resourceId':_0x575ac7['id'],'type':_0x421f3c[_0x9f80('0x2b')],'sectionId':_0x421f3c['id']},{})[_0x9f80('0x25')](function(){return _0xa10ab8;});}else{return _0xa10ab8;}})[_0x9f80('0x1b')](function(_0x1ab079){logger[_0x9f80('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ab079);throw _0x1ab079;});}return _0xa10ab8;})[_0x9f80('0x25')](respondWithResult(_0x34e829,0xc9))[_0x9f80('0x1b')](handleError(_0x34e829,null));};exports['update']=function(_0x2acf80,_0x1a7631){if(_0x2acf80[_0x9f80('0x4c')]['id']){delete _0x2acf80[_0x9f80('0x4c')]['id'];}return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x2acf80[_0x9f80('0x48')]['id']},'include':[{'model':db[_0x9f80('0x2e')],'as':_0x9f80('0x2f')}]})[_0x9f80('0x25')](handleEntityNotFound(_0x1a7631,null))[_0x9f80('0x25')](saveUpdates(_0x2acf80[_0x9f80('0x4c')],null))[_0x9f80('0x25')](respondWithResult(_0x1a7631,null))[_0x9f80('0x1b')](handleError(_0x1a7631,null));};exports[_0x9f80('0x26')]=function(_0x4a1469,_0x4cb0c0){return db['ChatWebsite'][_0x9f80('0x4a')]({'where':{'id':_0x4a1469['params']['id']}})['then'](handleEntityNotFound(_0x4cb0c0,null))[_0x9f80('0x25')](removeEntity(_0x4cb0c0,null))['catch'](handleError(_0x4cb0c0,null));};exports[_0x9f80('0x53')]=function(_0x3f624d,_0x5ce6b0){return db[_0x9f80('0x31')][_0x9f80('0x53')]()[_0x9f80('0x25')](respondWithResult(_0x5ce6b0,null))[_0x9f80('0x1b')](handleError(_0x5ce6b0,null));};exports[_0x9f80('0x54')]=function(_0x57869c,_0x5a6308){if(_0x57869c[_0x9f80('0x4c')]['id']){delete _0x57869c[_0x9f80('0x4c')]['id'];}return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x57869c[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x5a6308,null))[_0x9f80('0x25')](function(_0x6b4a2c){if(_0x6b4a2c){_0x57869c[_0x9f80('0x4c')][_0x9f80('0x55')]=_0x6b4a2c['id'];return db[_0x9f80('0x56')][_0x9f80('0x4b')](_0x57869c[_0x9f80('0x4c')]);}})['then'](respondWithResult(_0x5a6308,null))[_0x9f80('0x1b')](handleError(_0x5a6308,null));};exports[_0x9f80('0x57')]=function(_0x193be3,_0xe596a5){var _0x37dce5={'raw':![],'where':{}};var _0xaffa28={};var _0xd0cd21={'count':0x0,'rows':[]};return db[_0x9f80('0x31')][_0x9f80('0x58')]({'where':{'id':_0x193be3[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0xe596a5,null))[_0x9f80('0x25')](function(_0x56d685){if(_0x56d685){_0xaffa28[_0x9f80('0x3a')]=_[_0x9f80('0x36')](db[_0x9f80('0x56')]['rawAttributes']);_0xaffa28[_0x9f80('0x37')]=_[_0x9f80('0x36')](_0x193be3[_0x9f80('0x37')]);_0xaffa28[_0x9f80('0x38')]=_[_0x9f80('0x39')](_0xaffa28[_0x9f80('0x3a')],_0xaffa28[_0x9f80('0x37')]);_0x37dce5['attributes']=_[_0x9f80('0x39')](_0xaffa28[_0x9f80('0x3a')],qs[_0x9f80('0x3c')](_0x193be3[_0x9f80('0x37')][_0x9f80('0x3c')]));_0x37dce5[_0x9f80('0x3b')]=_0x37dce5[_0x9f80('0x3b')]['length']?_0x37dce5[_0x9f80('0x3b')]:_0xaffa28[_0x9f80('0x3a')];if(!_0x193be3[_0x9f80('0x37')][_0x9f80('0x3d')](_0x9f80('0x3e'))){_0x37dce5[_0x9f80('0x21')]=qs[_0x9f80('0x21')](_0x193be3[_0x9f80('0x37')][_0x9f80('0x21')]);_0x37dce5[_0x9f80('0x1e')]=qs[_0x9f80('0x1e')](_0x193be3['query'][_0x9f80('0x1e')]);}_0x37dce5[_0x9f80('0x3f')]=qs[_0x9f80('0x40')](_0x193be3[_0x9f80('0x37')]['sort']);_0x37dce5[_0x9f80('0x41')]=qs[_0x9f80('0x38')](_[_0x9f80('0x59')](_0x193be3[_0x9f80('0x37')],_0xaffa28[_0x9f80('0x38')]));_0x37dce5['where'][_0x9f80('0x55')]=_0x56d685['id'];if(_0x193be3['query'][_0x9f80('0x42')]){_0x37dce5[_0x9f80('0x41')]=_[_0x9f80('0x43')](_0x37dce5[_0x9f80('0x41')],{'$or':_[_0x9f80('0x30')](_0x37dce5[_0x9f80('0x3b')],function(_0x20440e){var _0x5128f7={};_0x5128f7[_0x20440e]={'$like':'%'+_0x193be3[_0x9f80('0x37')][_0x9f80('0x42')]+'%'};return _0x5128f7;})});}_0x37dce5=_[_0x9f80('0x43')]({},_0x37dce5,_0x193be3[_0x9f80('0x45')]);return db[_0x9f80('0x56')][_0x9f80('0x20')]({'where':_0x37dce5[_0x9f80('0x41')]})[_0x9f80('0x25')](function(_0x1b56ea){_0xd0cd21['count']=_0x1b56ea;if(_0x193be3[_0x9f80('0x37')][_0x9f80('0x46')]){_0x37dce5[_0x9f80('0x49')]=[{'all':!![]}];}return db[_0x9f80('0x56')]['findAll'](_0x37dce5);})[_0x9f80('0x25')](function(_0x3039a6){_0xd0cd21[_0x9f80('0x5a')]=_0x3039a6;return _0xd0cd21;});}})['then'](respondWithFilteredResult(_0xe596a5,_0x37dce5))[_0x9f80('0x1b')](handleError(_0xe596a5,null));};exports[_0x9f80('0x5b')]=function(_0x3d2cc4,_0x33ec5){return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x3d2cc4['params']['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x33ec5,null))[_0x9f80('0x25')](function(_0x32ca1b){if(_0x32ca1b){return _0x32ca1b['removeDispositions'](_0x3d2cc4[_0x9f80('0x37')][_0x9f80('0x5c')]);}})[_0x9f80('0x25')](respondWithStatusCode(_0x33ec5,null))[_0x9f80('0x1b')](handleError(_0x33ec5,null));};exports['addAnswer']=function(_0x4c307d,_0x26c16a){if(_0x4c307d[_0x9f80('0x4c')]['id']){delete _0x4c307d[_0x9f80('0x4c')]['id'];}return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x4c307d[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x26c16a,null))[_0x9f80('0x25')](function(_0x3f34ac){if(_0x3f34ac){_0x4c307d['body'][_0x9f80('0x55')]=_0x3f34ac['id'];return db[_0x9f80('0x5d')][_0x9f80('0x4b')](_0x4c307d['body']);}})[_0x9f80('0x25')](respondWithResult(_0x26c16a,null))[_0x9f80('0x1b')](handleError(_0x26c16a,null));};exports[_0x9f80('0x5e')]=function(_0x126464,_0x22bb77){var _0x4940b8={'raw':![],'where':{}};var _0x3690f8={};var _0x4e0119={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9f80('0x58')]({'where':{'id':_0x126464[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x22bb77,null))[_0x9f80('0x25')](function(_0x11be99){if(_0x11be99){_0x3690f8[_0x9f80('0x3a')]=_[_0x9f80('0x36')](db['CannedAnswer'][_0x9f80('0x32')]);_0x3690f8[_0x9f80('0x37')]=_[_0x9f80('0x36')](_0x126464[_0x9f80('0x37')]);_0x3690f8[_0x9f80('0x38')]=_['intersection'](_0x3690f8[_0x9f80('0x3a')],_0x3690f8[_0x9f80('0x37')]);_0x4940b8[_0x9f80('0x3b')]=_[_0x9f80('0x39')](_0x3690f8[_0x9f80('0x3a')],qs[_0x9f80('0x3c')](_0x126464[_0x9f80('0x37')]['fields']));_0x4940b8[_0x9f80('0x3b')]=_0x4940b8[_0x9f80('0x3b')][_0x9f80('0x5f')]?_0x4940b8[_0x9f80('0x3b')]:_0x3690f8[_0x9f80('0x3a')];if(!_0x126464[_0x9f80('0x37')][_0x9f80('0x3d')](_0x9f80('0x3e'))){_0x4940b8[_0x9f80('0x21')]=qs[_0x9f80('0x21')](_0x126464[_0x9f80('0x37')][_0x9f80('0x21')]);_0x4940b8[_0x9f80('0x1e')]=qs[_0x9f80('0x1e')](_0x126464['query']['offset']);}_0x4940b8['order']=qs[_0x9f80('0x40')](_0x126464[_0x9f80('0x37')][_0x9f80('0x40')]);_0x4940b8[_0x9f80('0x41')]=qs[_0x9f80('0x38')](_[_0x9f80('0x59')](_0x126464[_0x9f80('0x37')],_0x3690f8[_0x9f80('0x38')]));_0x4940b8[_0x9f80('0x41')][_0x9f80('0x55')]=_0x11be99['id'];if(_0x126464[_0x9f80('0x37')][_0x9f80('0x42')]){_0x4940b8[_0x9f80('0x41')]=_[_0x9f80('0x43')](_0x4940b8[_0x9f80('0x41')],{'$or':_[_0x9f80('0x30')](_0x4940b8[_0x9f80('0x3b')],function(_0x263c08){var _0x414cec={};_0x414cec[_0x263c08]={'$like':'%'+_0x126464[_0x9f80('0x37')][_0x9f80('0x42')]+'%'};return _0x414cec;})});}_0x4940b8=_[_0x9f80('0x43')]({},_0x4940b8,_0x126464[_0x9f80('0x45')]);return db['CannedAnswer']['count']({'where':_0x4940b8[_0x9f80('0x41')]})[_0x9f80('0x25')](function(_0x16a04d){_0x4e0119[_0x9f80('0x20')]=_0x16a04d;if(_0x126464[_0x9f80('0x37')][_0x9f80('0x46')]){_0x4940b8['include']=[{'all':!![]}];}return db[_0x9f80('0x5d')]['findAll'](_0x4940b8);})['then'](function(_0x3155cc){_0x4e0119['rows']=_0x3155cc;return _0x4e0119;});}})[_0x9f80('0x25')](respondWithFilteredResult(_0x22bb77,_0x4940b8))['catch'](handleError(_0x22bb77,null));};exports['removeAnswers']=function(_0x5731a6,_0x526392){return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x5731a6[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x526392,null))[_0x9f80('0x25')](function(_0x33e17c){if(_0x33e17c){return _0x33e17c[_0x9f80('0x60')](_0x5731a6[_0x9f80('0x37')][_0x9f80('0x5c')]);}})[_0x9f80('0x25')](respondWithStatusCode(_0x526392,null))[_0x9f80('0x1b')](handleError(_0x526392,null));};exports[_0x9f80('0x61')]=function(_0x41a070,_0x2543be){_0x41a070[_0x9f80('0x4c')][_0x9f80('0x62')]=_0x41a070[_0x9f80('0x63')][_0x9f80('0x64')];return db[_0x9f80('0x31')]['find']({'where':{'id':_0x41a070[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x2543be,null))[_0x9f80('0x25')](saveUpdates(_0x41a070[_0x9f80('0x4c')],null))[_0x9f80('0x25')](respondWithResult(_0x2543be,null))['catch'](handleError(_0x2543be,null));};exports[_0x9f80('0x65')]=function(_0x3caaae,_0x53a20e){_0x3caaae['body'][_0x9f80('0x66')]=_0x3caaae['file'][_0x9f80('0x64')];return db[_0x9f80('0x31')]['find']({'where':{'id':_0x3caaae[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x53a20e,null))[_0x9f80('0x25')](saveUpdates(_0x3caaae[_0x9f80('0x4c')],null))[_0x9f80('0x25')](respondWithResult(_0x53a20e,null))['catch'](handleError(_0x53a20e,null));};exports[_0x9f80('0x67')]=function(_0x437b03,_0x207837){_0x437b03[_0x9f80('0x4c')][_0x9f80('0x68')]=_0x437b03[_0x9f80('0x63')][_0x9f80('0x64')];return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x437b03[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x207837,null))['then'](saveUpdates(_0x437b03[_0x9f80('0x4c')],null))[_0x9f80('0x25')](respondWithResult(_0x207837,null))[_0x9f80('0x1b')](handleError(_0x207837,null));};exports[_0x9f80('0x69')]=function(_0x4e8e81,_0x1343bc){_0x4e8e81['body']['systemAvatar']=_0x4e8e81[_0x9f80('0x63')][_0x9f80('0x64')];return db[_0x9f80('0x31')]['find']({'where':{'id':_0x4e8e81[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x1343bc,null))[_0x9f80('0x25')](saveUpdates(_0x4e8e81[_0x9f80('0x4c')],null))[_0x9f80('0x25')](respondWithResult(_0x1343bc,null))['catch'](handleError(_0x1343bc,null));};exports['getLogo']=function(_0x23061d,_0x87f69b){var _0x4b7131=path[_0x9f80('0x6a')](config['root'],_0x9f80('0x6b'));var _0x4b0aef={'where':{'id':_0x23061d[_0x9f80('0x48')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1310a0=![];return require(_0x9f80('0x6c'))[_0x9f80('0x6d')]()[_0x9f80('0x25')](function(_0x48c43a){if(_0x48c43a){_0x1310a0=_0x48c43a[_0x9f80('0x6e')];}})['then'](function(){return db[_0x9f80('0x31')][_0x9f80('0x4a')](_0x4b0aef);})[_0x9f80('0x25')](handleEntityNotFound(_0x87f69b,null))[_0x9f80('0x25')](function(_0x3477ff){if(_0x3477ff){if(!_['isNil'](_0x3477ff[_0x9f80('0x62')])){if(fs[_0x9f80('0x6f')](path[_0x9f80('0x6a')](config['root'],'server/files/images/logos/',_0x3477ff[_0x9f80('0x62')]))&&_0x1310a0){_0x4b7131=path[_0x9f80('0x6a')](config['root'],_0x9f80('0x70'),_0x3477ff[_0x9f80('0x62')]);}}return _0x87f69b[_0x9f80('0x71')](_0x4b7131);}})[_0x9f80('0x1b')](handleError(_0x87f69b,null));};exports[_0x9f80('0x72')]=function(_0x32a999,_0xa5fe79){var _0x37af7a=path[_0x9f80('0x6a')](config['root'],_0x9f80('0x73'));var _0x2313f2={'where':{'id':_0x32a999[_0x9f80('0x48')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x2313f2)[_0x9f80('0x25')](handleEntityNotFound(_0xa5fe79,null))[_0x9f80('0x25')](function(_0x45343e){if(_0x45343e){if(!_['isNil'](_0x45343e[_0x9f80('0x66')])){if(fs[_0x9f80('0x6f')](path[_0x9f80('0x6a')](config[_0x9f80('0x74')],_0x9f80('0x75'),_0x45343e['agentAvatar']))){_0x37af7a=path[_0x9f80('0x6a')](config[_0x9f80('0x74')],_0x9f80('0x75'),_0x45343e[_0x9f80('0x66')]);}}return _0xa5fe79[_0x9f80('0x71')](_0x37af7a);}})['catch'](handleError(_0xa5fe79,null));};exports[_0x9f80('0x76')]=function(_0x2c5191,_0x155b8a){var _0x56c1d3=path[_0x9f80('0x6a')](config[_0x9f80('0x74')],_0x9f80('0x77'));var _0x2d9f06={'where':{'id':_0x2c5191[_0x9f80('0x48')]['id']},'attributes':['id',_0x9f80('0x68'),_0x9f80('0x78')],'raw':!![]};return db[_0x9f80('0x31')][_0x9f80('0x4a')](_0x2d9f06)[_0x9f80('0x25')](handleEntityNotFound(_0x155b8a,null))[_0x9f80('0x25')](function(_0x1a516e){if(_0x1a516e){if(!_[_0x9f80('0x79')](_0x1a516e[_0x9f80('0x68')])){if(fs[_0x9f80('0x6f')](path['join'](config[_0x9f80('0x74')],_0x9f80('0x75'),_0x1a516e['customerAvatar']))&&_0x1a516e['showCustomerAvatar']){_0x56c1d3=path['join'](config[_0x9f80('0x74')],'server/files/images/avatars/',_0x1a516e[_0x9f80('0x68')]);}}return _0x155b8a[_0x9f80('0x71')](_0x56c1d3);}})['catch'](handleError(_0x155b8a,null));};exports['getSystemAvatar']=function(_0x4ac2ae,_0x1b04a0){var _0x425b24=path[_0x9f80('0x6a')](config[_0x9f80('0x74')],_0x9f80('0x7a'));var _0x5d46de={'where':{'id':_0x4ac2ae[_0x9f80('0x48')]['id']},'attributes':['id',_0x9f80('0x7b')],'raw':!![]};return db['ChatWebsite']['find'](_0x5d46de)[_0x9f80('0x25')](handleEntityNotFound(_0x1b04a0,null))['then'](function(_0x4ffff7){if(_0x4ffff7){if(!_[_0x9f80('0x79')](_0x4ffff7[_0x9f80('0x7b')])){if(fs[_0x9f80('0x6f')](path[_0x9f80('0x6a')](config[_0x9f80('0x74')],_0x9f80('0x75'),_0x4ffff7[_0x9f80('0x7b')]))){_0x425b24=path[_0x9f80('0x6a')](config[_0x9f80('0x74')],_0x9f80('0x75'),_0x4ffff7['systemAvatar']);}}return _0x1b04a0[_0x9f80('0x71')](_0x425b24);}})[_0x9f80('0x1b')](handleError(_0x1b04a0,null));};exports['notify']=function(_0x4dc36b,_0x456750){var _0x471ad0=require('user-agent-parser');var _0x2bd7dd=new _0x471ad0();var _0x1e0b9e=_0x2bd7dd['setUA'](_0x4dc36b[_0x9f80('0x7c')][_0x9f80('0x7d')])[_0x9f80('0x7e')]();var _0x5c601c={'body':_0x4dc36b['body'],'channel':'chat'};var _0x182b71=[];var _0x5b4327=[];var _0xfdd744={};var _0x1b2542=![];return db['CmContact'][_0x9f80('0x53')]()[_0x9f80('0x25')](function(_0x203100){if(!_0x203100){throw new db[(_0x9f80('0x7f'))][(_0x9f80('0x80'))]('no\x20available\x20attributes');}_0x182b71=_[_0x9f80('0x81')](_['keys'](_0x203100),[_0x9f80('0x82'),_0x9f80('0x83')]);_0x5b4327=_[_0x9f80('0x81')](_[_0x9f80('0x36')](_0x203100),[_0x9f80('0x82'),_0x9f80('0x83'),_0x9f80('0x84'),_0x9f80('0x85')]);if(_0x4dc36b[_0x9f80('0x4c')]['id']){delete _0x4dc36b[_0x9f80('0x4c')]['id'];}if(_[_0x9f80('0x79')](_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x86')])){throw new db[(_0x9f80('0x7f'))][(_0x9f80('0x80'))](_0x9f80('0x87'));}if(_[_0x9f80('0x79')](_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x4c')])||_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x4c')]===''){throw new db[(_0x9f80('0x7f'))]['ValidationError'](_0x9f80('0x88'));}if(_[_0x9f80('0x79')](_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x89')])){throw new db[(_0x9f80('0x7f'))][(_0x9f80('0x80'))](_0x9f80('0x8a')+_0x5b4327);}if(!_[_0x9f80('0x8b')](_0x5b4327,_0x4dc36b[_0x9f80('0x4c')]['mapKey'])){throw new db[(_0x9f80('0x7f'))][(_0x9f80('0x80'))](_0x9f80('0x8c')+_0x5b4327);}_0xfdd744[_0x4dc36b[_0x9f80('0x4c')]['mapKey']]=_0x4dc36b['body'][_0x9f80('0x86')];})['then'](function(){return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x4dc36b[_0x9f80('0x48')]['id']},'include':[{'model':db[_0x9f80('0x8d')],'as':_0x9f80('0x8e'),'include':[{'model':db[_0x9f80('0x8f')],'as':_0x9f80('0x90'),'where':_0xfdd744,'limit':0x1,'order':[[_0x9f80('0x83'),_0x9f80('0x91')]]}]},{'model':db['ChatApplication'],'as':_0x9f80('0x92')}]});})[_0x9f80('0x25')](handleEntityNotFound(_0x456750,null))[_0x9f80('0x25')](function(_0x290962){if(_0x290962&&_0x290962[_0x9f80('0x8e')]){_0x5c601c[_0x9f80('0x93')]=_0x290962;_0x5c601c['applications']=_0x290962[_0x9f80('0x92')];_0x5c601c['list']=_0x290962[_0x9f80('0x8e')];_0x5c601c[_0x9f80('0x94')]=_['orderBy'](_0x5c601c[_0x9f80('0x94')],[_0x9f80('0x95')],[_0x9f80('0x96')]);if(_0x5c601c[_0x9f80('0x93')][_0x9f80('0x92')]){delete _0x5c601c['account'][_0x9f80('0x92')];}if(_0x5c601c[_0x9f80('0x93')][_0x9f80('0x8e')]&&_0x5c601c[_0x9f80('0x93')]['List']['Contacts'][_0x9f80('0x5f')]){return _0x5c601c['account'][_0x9f80('0x8e')][_0x9f80('0x90')][0x0];}var _0x5177b4=_[_0x9f80('0xc')](_0x4dc36b[_0x9f80('0x4c')],{'firstName':_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x86')],'ListId':_0x290962[_0x9f80('0x85')]});_0x5177b4[_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x89')]]=_0x4dc36b[_0x9f80('0x4c')]['from'];return db[_0x9f80('0x8f')][_0x9f80('0x4b')](_0x5177b4,{'fields':_0x182b71,'raw':!![]});}})[_0x9f80('0x25')](handleEntityNotFound(_0x456750,null))[_0x9f80('0x25')](function(_0x1e4c80){_0x5c601c[_0x9f80('0x97')]=_0x1e4c80;var _0x56a9c8=_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x98')];if(_0x4dc36b[_0x9f80('0x7c')]['cf-connecting-ip']){_0x56a9c8=_0x4dc36b['headers'][_0x9f80('0x99')];}else if(_0x4dc36b[_0x9f80('0x7c')]['x-forwarded-for']){_0x56a9c8=_[_0x9f80('0x9a')](_0x4dc36b[_0x9f80('0x7c')][_0x9f80('0x9b')][_0x9f80('0x9c')](','));}if(_0x1e4c80){var _0xee2a4a={'ContactId':_0x1e4c80['id'],'ChatWebsiteId':_0x4dc36b['params']['id'],'from':(_0x1e4c80[_0x9f80('0x9d')]||'')+'\x20'+(_0x1e4c80['lastName']||''),'customerIp':_0x56a9c8,'customerPort':_0x4dc36b['headers'][_0x9f80('0x9e')]?_0x4dc36b[_0x9f80('0x7c')][_0x9f80('0x9e')]:null,'referer':_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x9f')],'browserName':_0x1e0b9e['browser'][_0x9f80('0x2b')]&&_0x1e0b9e['browser']['version']?util[_0x9f80('0xa0')](_0x9f80('0xa1'),_0x1e0b9e['browser'][_0x9f80('0x2b')],_0x1e0b9e['browser'][_0x9f80('0xa2')]):_0x9f80('0xa3'),'browserVersion':_0x1e0b9e[_0x9f80('0xa4')][_0x9f80('0xa2')]||_0x9f80('0xa3'),'osName':util['format'](_0x9f80('0xa1'),_0x1e0b9e['os'][_0x9f80('0x2b')],_0x1e0b9e['os'][_0x9f80('0xa2')]),'osVersion':_0x1e0b9e['os'][_0x9f80('0xa2')],'deviceModel':_0x1e0b9e['device']['model']&&_0x1e0b9e[_0x9f80('0xa5')][_0x9f80('0xa6')]?util[_0x9f80('0xa0')](_0x9f80('0xa7'),_0x1e0b9e[_0x9f80('0xa5')]['model'],_0x1e0b9e['device'][_0x9f80('0xa6')],_0x1e0b9e['device'][_0x9f80('0x34')]):null,'deviceVendor':_0x1e0b9e[_0x9f80('0xa5')][_0x9f80('0xa6')],'deviceType':_0x1e0b9e[_0x9f80('0xa5')][_0x9f80('0x34')],'formData':JSON[_0x9f80('0x18')](_0x4dc36b[_0x9f80('0x4c')])};var _0x4a5b98={'ChatWebsiteId':_0x4dc36b[_0x9f80('0x48')]['id'],'closed':![]};if(_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0xa8')]){_0x4a5b98[_0x9f80('0xa8')]=_0x4dc36b[_0x9f80('0x4c')]['threadId'];return db[_0x9f80('0xa9')]['find']({'where':_0x4a5b98})[_0x9f80('0x25')](function(_0x49577c){if(_0x49577c){return[_0x49577c,![]];}_0xee2a4a[_0x9f80('0xa8')]=_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0xa8')];_0xee2a4a[_0x9f80('0xaa')]=_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0xaa')];return db['ChatInteraction'][_0x9f80('0x4b')](_0xee2a4a)['then'](function(_0x2c1d12){return[_0x2c1d12,!![]];});});}_0x4a5b98[_0x9f80('0xab')]=_0x1e4c80['id'];if(_0x4dc36b['body']['interaction']&&_0x4dc36b['body'][_0x9f80('0xac')]['id']){_0x4a5b98['id']=_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0xac')]['id'];return db[_0x9f80('0xa9')][_0x9f80('0x4a')]({'where':_0x4a5b98})[_0x9f80('0x25')](function(_0x5b5af4){if(_0x5b5af4){return[_0x5b5af4,![]];}return db[_0x9f80('0xa9')][_0x9f80('0x4b')](_0xee2a4a)[_0x9f80('0x25')](function(_0x4b8362){return[_0x4b8362,!![]];});});}return db['ChatInteraction'][_0x9f80('0x4b')](_0xee2a4a)[_0x9f80('0x25')](function(_0x5f09a5){return[_0x5f09a5,!![]];});}})[_0x9f80('0xad')](function(_0x4a469d,_0x1dd0c3){if(_0x4a469d){_0x1b2542=_0x1dd0c3;if(!_0x1dd0c3){var _0x267cb8={'from':(_0x5c601c[_0x9f80('0x97')][_0x9f80('0x9d')]||'')+'\x20'+(_0x5c601c['contact']['lastName']||'')};if(_0x4dc36b[_0x9f80('0x4c')]['threadId']&&_0x4dc36b['body']['messageId']&&_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0xa8')]!=_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0xae')]){_0x267cb8[_0x9f80('0xa8')]=_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0xae')];}return _0x4a469d[_0x9f80('0x24')](_0x267cb8);}else{return _0x4a469d;}}})['then'](function(_0x3875fb){_0x5c601c[_0x9f80('0xac')]=_0x3875fb[_0x9f80('0x27')]({'plain':!![]});_0x5c601c[_0x9f80('0xac')][_0x9f80('0xaf')]=_0x1b2542;if(_0x5c601c[_0x9f80('0xac')]['created']){if(_0x5c601c[_0x9f80('0x93')][_0x9f80('0xb0')]){_0x5c601c['applications']['push']({'id':0x0,'priority':_0x5c601c['applications']['length']+0x1,'app':_0x9f80('0xb1'),'appdata':'unmanaged','interval':_0x9f80('0xb2')});}}return db[_0x9f80('0xb3')]['create']({'body':_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0x4c')],'ChatWebsiteId':_0x4dc36b[_0x9f80('0x48')]['id'],'ChatInteractionId':_0x3875fb['id'],'direction':'in','ContactId':_0x5c601c['contact']['id'],'AttachmentId':_0x4dc36b[_0x9f80('0x4c')][_0x9f80('0xb4')]});})[_0x9f80('0x25')](function(_0x3e8430){_0x5c601c[_0x9f80('0x1a')]=_0x3e8430;if(_0x5c601c['interaction'][_0x9f80('0xb5')]){return db[_0x9f80('0xb6')][_0x9f80('0x4a')]({'attributes':['id','name'],'where':{'id':_0x5c601c['interaction'][_0x9f80('0xb5')]}})[_0x9f80('0x25')](function(_0xf67cb4){if(_0xf67cb4){_0x5c601c[_0x9f80('0x94')][_0x9f80('0xb7')]({'id':0x0,'priority':0x0,'app':_0x9f80('0xb8'),'appdata':_0xf67cb4['name']+','+(_0x5c601c[_0x9f80('0x93')][_0x9f80('0xb9')]||0xa),'interval':_0x9f80('0xb2')});_0x5c601c[_0x9f80('0xba')]=!![];}return respondWithRpcPromise(_0x9f80('0xbb'),_0x9f80('0xbc'),_0x5c601c);});}return respondWithRpcPromise(_0x9f80('0xbb'),_0x9f80('0xbc'),_0x5c601c);})['then'](function(_0x5da080){respondWithRpcPromise(_0x9f80('0xbd'),_0x9f80('0xbd'),{'event':_0x9f80('0xbe'),'message':_0x5da080},client9002);return _0x5da080;})[_0x9f80('0x25')](respondWithResult(_0x456750,null))[_0x9f80('0x1b')](handleError(_0x456750,null));};exports[_0x9f80('0xbf')]=function(_0x1d0583,_0x3f8408){var _0x131c56,_0x346188,_0x4c061c;var _0xf18357=[];var _0x5c9ff7={};var _0x365436=_0x1d0583[_0x9f80('0xc0')]||[];var _0x5928d1=[];var _0x403504;return db[_0x9f80('0x8f')][_0x9f80('0x53')]()[_0x9f80('0x25')](function(_0x297e77){if(!_0x297e77){throw new db[(_0x9f80('0x7f'))][(_0x9f80('0x80'))](_0x9f80('0xc1'));}_0xf18357=_[_0x9f80('0x81')](_[_0x9f80('0x36')](_0x297e77),[_0x9f80('0x82'),_0x9f80('0x83'),_0x9f80('0x84'),_0x9f80('0x85')]);if(_0x1d0583[_0x9f80('0x4c')]['id']){delete _0x1d0583[_0x9f80('0x4c')]['id'];}if(_[_0x9f80('0x79')](_0x1d0583[_0x9f80('0x4c')][_0x9f80('0x86')])){throw _0x3f8408[_0x9f80('0x1d')](0x1f4)[_0x9f80('0x2c')](new db['Sequelize'][(_0x9f80('0x80'))](_0x9f80('0x87')));}if(_['isNil'](_0x1d0583[_0x9f80('0x4c')]['body'])||_0x1d0583[_0x9f80('0x4c')]['body']===''){throw _0x3f8408['status'](0x1f4)['send'](new db[(_0x9f80('0x7f'))][(_0x9f80('0x80'))](_0x9f80('0x88')));}if(_[_0x9f80('0x79')](_0x1d0583['body']['mapKeyOffline'])){throw _0x3f8408['status'](0x1f4)[_0x9f80('0x2c')](new db['Sequelize'][(_0x9f80('0x80'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf18357));}if(!_['includes'](_0xf18357,_0x1d0583[_0x9f80('0x4c')][_0x9f80('0xc2')])){throw _0x3f8408[_0x9f80('0x1d')](0x1f4)['send'](new db[(_0x9f80('0x7f'))][(_0x9f80('0x80'))](_0x9f80('0xc3')+_0xf18357));}_0x5c9ff7[_0x1d0583[_0x9f80('0x4c')][_0x9f80('0xc2')]]=_0x1d0583['body']['from'];})['then'](function(){return db[_0x9f80('0x31')]['find']({'where':{'id':_0x1d0583['params']['id']},'include':[{'model':db[_0x9f80('0x8d')],'as':_0x9f80('0x8e')},{'model':db[_0x9f80('0xc4')],'as':'MailAccount'}]});})[_0x9f80('0x25')](handleEntityNotFound(_0x3f8408,null))[_0x9f80('0x25')](function(_0x5a9ce6){if(_0x5a9ce6&&_0x5a9ce6[_0x9f80('0x8e')]){_0x346188=_0x5a9ce6;var _0x12583f=_[_0x9f80('0xc')](_0x1d0583[_0x9f80('0x4c')],{'firstName':_0x1d0583[_0x9f80('0x4c')][_0x9f80('0x86')],'phone':_0x1d0583[_0x9f80('0x4c')][_0x9f80('0x86')],'ListId':_0x5a9ce6[_0x9f80('0x85')]});_0x12583f[_0x1d0583[_0x9f80('0x4c')]['mapKeyOffline']]=_0x1d0583[_0x9f80('0x4c')]['from'];return db[_0x9f80('0x8f')]['findOrCreate']({'where':_0x5c9ff7,'defaults':_0x12583f});}})['spread'](function(_0x47ed39){if(_0x47ed39){_0x4c061c=_0x47ed39;var _0x383e5c=fs['readFileSync'](path[_0x9f80('0x6a')](config[_0x9f80('0x74')],_0x9f80('0xc5')),'utf8');var _0x404af6=ejs[_0x9f80('0xc6')](_0x383e5c,{'body':_[_0x9f80('0xc7')](_0x1d0583[_0x9f80('0x4c')]['body']),'bodyTitle':_0x346188[_0x9f80('0xc8')]});return db[_0x9f80('0xc9')][_0x9f80('0x4b')]({'body':_0x404af6,'plainBody':htmlToText[_0x9f80('0xca')](_0x404af6),'ContactId':_0x47ed39['id'],'ChatWebsiteId':_0x346188['id']});}})['then'](function(_0x47fa4c){_0x403504=_0x47fa4c;if(_0x365436[_0x9f80('0x5f')]){var _0x100bef=_0x365436[_0x9f80('0x30')](function(_0x2511b1){return{'name':_0x2511b1[_0x9f80('0xcb')],'basename':_0x2511b1[_0x9f80('0x64')],'type':_0x2511b1[_0x9f80('0xcc')],'ChatOfflineMessageId':_0x47fa4c['id']};});_0x5928d1=_0x100bef['map'](_0x1d4122=>{var _0x3ee1e9={'filename':_0x1d4122['name'],'path':path['join'](config[_0x9f80('0x74')],'server',_0x9f80('0xc0'),_0x9f80('0xcd'),_0x9f80('0xce'),_0x1d4122[_0x9f80('0xcf')])};return _0x3ee1e9;});if(!_0x346188['openNewInteraction']){return db['sequelize'][_0x9f80('0xd0')](function(_0x3e0165){return db[_0x9f80('0xd1')][_0x9f80('0xd2')](_0x100bef,{'transaction':_0x3e0165});});}}})[_0x9f80('0x25')](function(){if(_0x403504){_0x131c56=_0x403504;return db[_0x9f80('0xc4')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x9f80('0xd3')],'as':_0x9f80('0xd4'),'raw':!![],'include':[{'model':db[_0x9f80('0xd5')],'as':_0x9f80('0xd5'),'raw':!![]}]}]});}})['then'](function(_0x1ca1a6){if(_0x1ca1a6&&_0x1ca1a6[_0x9f80('0xd4')]&&_0x346188[_0x9f80('0xd6')]&&_0x346188[_0x9f80('0xd7')]){var _0x46d41d=_0x1ca1a6[_0x9f80('0xd8')]();return respondWithRpcPromise('SendMail',_0x9f80('0xd9'),{'account':_0x46d41d,'message':{'from':util[_0x9f80('0xa0')](_0x9f80('0xda'),_0x1ca1a6[_0x9f80('0x2b')],_0x1ca1a6[_0x9f80('0xdb')]||_0x1ca1a6[_0x9f80('0xd4')][_0x9f80('0x4d')]),'to':_0x346188[_0x9f80('0xd7')],'subject':_0x346188[_0x9f80('0xdc')],'html':_0x131c56[_0x9f80('0x4c')],'attachments':_0x5928d1}},client9003)[_0x9f80('0x25')](function(){return _0x131c56;})[_0x9f80('0x1b')](function(_0x5aa274){logger[_0x9f80('0x19')](_0x5aa274);});}})[_0x9f80('0x25')](function(){if(_0x346188&&_0x346188[_0x9f80('0xdd')]&&_0x346188['MailAccountId']){var _0x17022c=[];if(_0x365436[_0x9f80('0x5f')]){_0x17022c=_0x365436[_0x9f80('0x30')](function(_0xd84d42){return{'name':_0xd84d42['originalname'],'basename':_0xd84d42['filename'],'type':_0xd84d42[_0x9f80('0xcc')],'ChatOfflineMessageId':_0x403504['id']};});}var _0x26fac9;if(!_['isNil'](_0x346188[_0x9f80('0xde')])){var _0x10edd0=_[_0x9f80('0x30')](_0x1d0583[_0x9f80('0x4c')],function(_0x5a5b21){return _0x5a5b21;});var _0x4303d5=_[_0x9f80('0xdf')](_0x10edd0)[0x0];var _0x1c8189=_[_0x9f80('0xe0')](_0x4303d5,function(_0x493787){return _0x493787;});_0x26fac9=_0x1c8189[0x1][_0x346188['subjectOffline']];}var _0x464e6a={'from':_0x4c061c[_0x9f80('0xdb')],'firstName':_0x4c061c[_0x9f80('0x9d')],'lastName':_0x4c061c[_0x9f80('0xe1')],'mapKey':_0x9f80('0xdb'),'message':{'from':_0x4c061c[_0x9f80('0xdb')],'to':_0x346188[_0x9f80('0xc4')][_0x9f80('0xdb')],'cc':'','subject':_[_0x9f80('0x79')](_0x26fac9)?_0x346188[_0x9f80('0xdc')]:_0x26fac9,'messageId':'','sentAt':new Date(),'attach':_0x17022c[_0x9f80('0x5f')],'attachments':_0x17022c,'originChannel':_0x9f80('0xe2'),'ChatWebsiteId':_0x346188['id'],'ChatOfflineMessageId':_0x131c56['id'],'originTo':_0x346188[_0x9f80('0xc4')][_0x9f80('0xdb')]},'body':_0x131c56[_0x9f80('0x4c')]};var _0x2fcd26={'account':{'id':_0x346188[_0x9f80('0xe3')]},'body':_0x464e6a,'log':_0x9f80('0xe4')};return respondWithRpcPromise(_0x9f80('0xe4'),'notifyMail',_0x2fcd26,client9001)[_0x9f80('0x25')](function(){return _0x131c56;})[_0x9f80('0x1b')](function(_0x56dbf7){logger[_0x9f80('0x19')](_0x56dbf7);});}return;})[_0x9f80('0x25')](function(){if(_0x131c56){return _0x131c56;}})[_0x9f80('0x25')](respondWithResult(_0x3f8408,null))[_0x9f80('0x1b')](function(_0x1b769a){logger['error'](_0x9f80('0x1b'),_0x1b769a);for(var _0x44875d of _0x365436){var _0x31d100=path[_0x9f80('0x6a')](config[_0x9f80('0x74')],_0x9f80('0xe5'),_0x9f80('0xc0'),'attachments','offline-chat',_0x44875d[_0x9f80('0x64')]);fs_extra['remove'](_0x31d100)[_0x9f80('0x1b')](function(_0x148193){logger[_0x9f80('0x19')](_0x9f80('0xe6'),_0x31d100,_0x148193);});}});};exports[_0x9f80('0xe7')]=function(_0x3080fe,_0x52478e){return db[_0x9f80('0xa9')][_0x9f80('0x4a')]({'where':{'id':_0x3080fe[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x52478e,null))[_0x9f80('0x25')](function(_0x33e980){if(_0x33e980){return _0x33e980[_0x9f80('0xe7')](_0x3080fe[_0x9f80('0x4c')][_0x9f80('0x5c')],_['omit'](_0x3080fe[_0x9f80('0x4c')],['ids','id'])||{});}})[_0x9f80('0x25')](respondWithResult(_0x52478e,null))[_0x9f80('0x1b')](handleError(_0x52478e,null));};exports[_0x9f80('0xe8')]=function(_0x246fc5,_0x597bff){var _0x778a78={'raw':![],'where':{}};var _0x45aab3={};var _0x4a62e4={'count':0x0,'rows':[]};return db[_0x9f80('0x31')]['findOne']({'where':{'id':_0x246fc5[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x597bff,null))['then'](function(_0x1d277d){if(_0x1d277d){_0x45aab3[_0x9f80('0x3a')]=_['keys'](db[_0x9f80('0xa9')][_0x9f80('0x32')]);_0x45aab3[_0x9f80('0x37')]=_[_0x9f80('0x36')](_0x246fc5[_0x9f80('0x37')]);_0x45aab3[_0x9f80('0x38')]=_['intersection'](_0x45aab3[_0x9f80('0x3a')],_0x45aab3[_0x9f80('0x37')]);_0x778a78[_0x9f80('0x3b')]=_[_0x9f80('0x39')](_0x45aab3[_0x9f80('0x3a')],qs['fields'](_0x246fc5['query'][_0x9f80('0x3c')]));_0x778a78['attributes']=_0x778a78['attributes'][_0x9f80('0x5f')]?_0x778a78[_0x9f80('0x3b')]:_0x45aab3[_0x9f80('0x3a')];if(!_0x246fc5[_0x9f80('0x37')][_0x9f80('0x3d')](_0x9f80('0x3e'))){_0x778a78[_0x9f80('0x21')]=qs[_0x9f80('0x21')](_0x246fc5[_0x9f80('0x37')]['limit']);_0x778a78[_0x9f80('0x1e')]=qs['offset'](_0x246fc5['query'][_0x9f80('0x1e')]);}_0x778a78[_0x9f80('0x3f')]=qs['sort'](_0x246fc5['query'][_0x9f80('0x40')]);_0x778a78[_0x9f80('0x41')]=qs[_0x9f80('0x38')](_[_0x9f80('0x59')](_0x246fc5[_0x9f80('0x37')],_0x45aab3[_0x9f80('0x38')]));_0x778a78[_0x9f80('0x41')]['ChatWebsiteId']=_0x1d277d['id'];if(_0x246fc5[_0x9f80('0x37')][_0x9f80('0x42')]){_0x778a78[_0x9f80('0x41')]=_[_0x9f80('0x43')](_0x778a78['where'],{'$or':_['map'](_0x778a78['attributes'],function(_0x16209d){var _0x4bfb41={};_0x4bfb41[_0x16209d]={'$like':'%'+_0x246fc5[_0x9f80('0x37')][_0x9f80('0x42')]+'%'};return _0x4bfb41;})});}_0x778a78=_[_0x9f80('0x43')]({},_0x778a78,_0x246fc5[_0x9f80('0x45')]);return db[_0x9f80('0xa9')][_0x9f80('0x20')]({'where':_0x778a78[_0x9f80('0x41')]})['then'](function(_0x591cf2){_0x4a62e4[_0x9f80('0x20')]=_0x591cf2;if(_0x246fc5[_0x9f80('0x37')][_0x9f80('0x46')]){_0x778a78[_0x9f80('0x49')]=[{'model':db[_0x9f80('0x8f')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x9f80('0xe9'),'attributes':[_0x9f80('0x2b'),_0x9f80('0xea'),_0x9f80('0xeb')],'required':![]},{'model':db[_0x9f80('0xec')],'as':_0x9f80('0xed'),'attributes':['id',_0x9f80('0x2b'),'color'],'where':_0x246fc5['query'][_0x9f80('0xee')]?{'id':_0x246fc5['query'][_0x9f80('0xee')]}:undefined,'required':_0x246fc5[_0x9f80('0x37')][_0x9f80('0xee')]?!![]:![]}];}return db['ChatInteraction'][_0x9f80('0x47')](_0x778a78);})[_0x9f80('0x25')](function(_0x21f153){_0x4a62e4[_0x9f80('0x5a')]=_0x21f153;return _0x4a62e4;});}})[_0x9f80('0x25')](respondWithFilteredResult(_0x597bff,_0x778a78))[_0x9f80('0x1b')](handleError(_0x597bff,null));};function iftimePromise(_0x9fb195,_0x2c2ed3){return respondWithRpcPromise(_0x9f80('0xef'),_0x9f80('0xf0'),{'command':_0x2c2ed3['timezone']?util['format'](_0x9f80('0xf1'),_0x9fb195[_0x9f80('0xf2')],_0x2c2ed3['timezone']):util[_0x9f80('0xa0')](_0x9f80('0xf3'),_0x9fb195[_0x9f80('0xf2')])},client9002)[_0x9f80('0x25')](function(_0x4d5742){var _0x3ec9eb=_0x4d5742&&_0x4d5742['indexOf']('true')>=0x0?!![]:![];logger[_0x9f80('0x14')](_0x9f80('0xf4'),_0x2c2ed3['id'],_0x9fb195['id'],_0x9fb195[_0x9f80('0xf2')],_0x3ec9eb?_0x9f80('0xf5'):_0x9f80('0xf6'),_0x2c2ed3['timezone']?_0x2c2ed3['timezone']:_0x9f80('0xf7'));return _0x3ec9eb;})[_0x9f80('0x1b')](function(_0xc8c736){logger[_0x9f80('0x19')](_0x9f80('0xf4'),_0x2c2ed3['id'],_0x9fb195['id'],_0x9fb195[_0x9f80('0xf2')],util[_0x9f80('0xf8')](_0xc8c736,{'showHidden':![],'depth':null}),_0x2c2ed3['timezone']?_0x2c2ed3[_0x9f80('0xf9')]:_0x9f80('0xf7'));return![];});}exports[_0x9f80('0xf0')]=function(_0x264be5,_0x483a87){var _0x541a7b=0x0;var _0x3a5b29=0x0;var _0xfcd4e9=![];var _0x54fdf2;var _0x46214e;return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x264be5['params']['id']},'include':[{'model':db[_0x9f80('0xfa')],'as':'Interval','include':[{'model':db[_0x9f80('0xfa')],'as':'Intervals','attributes':['id',_0x9f80('0xf2')],'raw':!![]}]}]})[_0x9f80('0x25')](handleEntityNotFound(_0x483a87,null))['then'](function(_0x167a0b){if(_0x167a0b){_0x54fdf2=_0x167a0b;return _0x167a0b[_0x9f80('0xfb')]({'raw':!![]});}})['then'](function(_0x30c3c6){if(_0x54fdf2){if(_0x30c3c6){_0x46214e=_0x30c3c6;}}return require(_0x9f80('0x6c'))[_0x9f80('0x6d')]();})[_0x9f80('0x25')](function(_0x52bc20){if(_0x52bc20){_0x3a5b29=_0x52bc20[_0x9f80('0xfc')];_0xfcd4e9=_0x52bc20[_0x9f80('0x6e')];}})[_0x9f80('0x25')](function(){return db[_0x9f80('0xa9')][_0x9f80('0x20')]({'where':{'closed':![]}});})[_0x9f80('0x25')](function(_0x433269){_0x541a7b=_0x433269;if(_0x3a5b29&&_0x433269>_0x3a5b29){return db[_0x9f80('0xfd')]['findOne']({'where':{'id':0x1}})[_0x9f80('0x25')](function(_0x41e2fd){if(_0x41e2fd){_0x41e2fd['increment'](_0x9f80('0xfe'));}});}})['then'](function(){if(_0x54fdf2['Interval']&&_0x54fdf2[_0x9f80('0xfa')][_0x9f80('0xff')]){var _0x5ca20e=[];for(var _0x2d1776=0x0;_0x2d1776<_0x54fdf2['Interval'][_0x9f80('0xff')]['length'];_0x2d1776++){var _0x5b3951=_0x54fdf2[_0x9f80('0xfa')][_0x9f80('0xff')][_0x2d1776][_0x9f80('0x27')]({'plain':!![]});_0x5ca20e[_0x9f80('0x100')](iftimePromise(_0x5b3951,_0x54fdf2));}return BPromise[_0x9f80('0x101')](_0x5ca20e)[_0x9f80('0x25')](function(_0x261f1f){return _[_0x9f80('0x102')](_0x261f1f);});}else{return!![];}})[_0x9f80('0x25')](function(_0x147b35){var _0x1400f6=fs['readFileSync'](path[_0x9f80('0x6a')](config[_0x9f80('0x74')],'server/files/chat/iframe.ejs'),_0x9f80('0x103'));var _0xe60bc5=new url[(_0x9f80('0x104'))](_0x54fdf2[_0x9f80('0x105')])[_0x9f80('0x106')];var _0xc3518='3.1.0';var _0x1574ad=![];var _0x327bb0={'chatVersion':_0xc3518,'chatWebsiteAddressOrigin':_0xe60bc5,'remote':_0x54fdf2[_0x9f80('0x107')],'query':querystring[_0x9f80('0x18')](_[_0x9f80('0x43')](_0x54fdf2[_0x9f80('0x27')]({'plain':!![]}),{'customerIp':_0x264be5[_0x9f80('0x7c')]['x-forwarded-for']||_0x264be5[_0x9f80('0x7c')][_0x9f80('0x108')]||_0x264be5[_0x9f80('0x109')][_0x9f80('0x10a')]||_0x264be5['ip'],'referer':_0x264be5[_0x9f80('0x7c')]['referer'],'openedInteractions':_0x541a7b,'maxInteractions':_0x3a5b29,'virtual':_0xfcd4e9['virtual'],'online':_0x147b35,'custom':_0xfcd4e9}))[_0x9f80('0x10b')](/'/g,'\x5c\x27')};_0x483a87[_0x9f80('0x2c')](ejs[_0x9f80('0xc6')](Mustache[_0x9f80('0xc6')](_0x1400f6,_0x327bb0),{'proactiveActions':_0x46214e,'alignment':_0x54fdf2['alignment'],'verticalAlignment':_0x54fdf2[_0x9f80('0x10c')],'div_color':_0x54fdf2['color'],'labelText':_0x54fdf2[_0x9f80('0x10d')],'text_color':_0x54fdf2[_0x9f80('0x10e')],'text_button_color':_0x54fdf2[_0x9f80('0x10f')],'button_color':_0x54fdf2['color_button'],'background_color':_0x54fdf2[_0x9f80('0x110')],'hideWhenOffline':_0x54fdf2[_0x9f80('0x111')],'intervalId':_0x54fdf2[_0x9f80('0x112')],'isDevelopment':_0x1574ad,'chatVersion':_0xc3518}));})['catch'](handleError(_0x483a87,null));};exports['addApplications']=function(_0x45b80b,_0x433bbf){var _0x374bdd=_0x45b80b['params']['id'];var _0x1fedd2=_0x45b80b[_0x9f80('0x4c')];var _0x38057e=0xc8;var _0x19c385=null;return db[_0x9f80('0x113')]['transaction']({'isolationLevel':db[_0x9f80('0x113')][_0x9f80('0x114')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4c1312){return db['ChatWebsite'][_0x9f80('0x58')]({'where':{'id':_0x374bdd},'transaction':_0x4c1312})[_0x9f80('0x25')](function(_0xe68ab6){if(_0xe68ab6){return db[_0x9f80('0x115')][_0x9f80('0x26')]({'where':{'ChatWebsiteId':_0x374bdd},'transaction':_0x4c1312})[_0x9f80('0x25')](function(){var _0x5c800d=_['map'](_0x1fedd2,function(_0x291627){_0x291627[_0x9f80('0x55')]=_0x374bdd;return _0x291627;});return db[_0x9f80('0x115')][_0x9f80('0xd2')](_0x5c800d,{'transaction':_0x4c1312});});}else{_0x38057e=0x194;_0x19c385=[];}});})[_0x9f80('0x25')](function(){if(_0x38057e!==0x194){return db[_0x9f80('0x115')][_0x9f80('0x116')]({'where':{'ChatWebsiteId':_0x374bdd},'order':_0x9f80('0x95')})['then'](function(_0x550a8f){_0x19c385=_0x550a8f;});}})[_0x9f80('0x1b')](function(_0xc098f4){_0x38057e=0x1f4;logger[_0x9f80('0x19')](_0xc098f4[_0x9f80('0x2a')]);if(_0xc098f4['name']){delete _0xc098f4[_0x9f80('0x2b')];}_0x19c385=_0xc098f4;})[_0x9f80('0x117')](function(){if(_0x19c385===null){_0x433bbf['sendStatus'](_0x38057e);}else{if(_0x38057e===0x1f4){_0x433bbf[_0x9f80('0x1d')](_0x38057e)['send'](_0x19c385);}else{_0x433bbf[_0x9f80('0x1d')](_0x38057e)[_0x9f80('0x118')](_0x19c385);}}});};exports[_0x9f80('0x119')]=function(_0x304157,_0x55edb1){var _0x35c4bc={};var _0x585354={};var _0x49ba2b;var _0xa7cf72;return db[_0x9f80('0x31')]['findOne']({'where':{'id':_0x304157[_0x9f80('0x48')]['id']}})['then'](handleEntityNotFound(_0x55edb1,null))['then'](function(_0x27c4d0){if(_0x27c4d0){_0x49ba2b=_0x27c4d0;_0x585354[_0x9f80('0x3a')]=_[_0x9f80('0x36')](db[_0x9f80('0x115')][_0x9f80('0x32')]);_0x585354['query']=_[_0x9f80('0x36')](_0x304157[_0x9f80('0x37')]);_0x585354[_0x9f80('0x38')]=_[_0x9f80('0x39')](_0x585354[_0x9f80('0x3a')],_0x585354[_0x9f80('0x37')]);_0x35c4bc[_0x9f80('0x3b')]=_[_0x9f80('0x39')](_0x585354[_0x9f80('0x3a')],qs['fields'](_0x304157[_0x9f80('0x37')]['fields']));_0x35c4bc[_0x9f80('0x3b')]=_0x35c4bc[_0x9f80('0x3b')][_0x9f80('0x5f')]?_0x35c4bc[_0x9f80('0x3b')]:_0x585354['model'];_0x35c4bc['order']=qs[_0x9f80('0x40')](_0x304157['query'][_0x9f80('0x40')]);_0x35c4bc[_0x9f80('0x41')]=qs['filters'](_['pick'](_0x304157[_0x9f80('0x37')],_0x585354['filters']));if(_0x304157['query'][_0x9f80('0x42')]){_0x35c4bc[_0x9f80('0x41')]=_[_0x9f80('0x43')](_0x35c4bc[_0x9f80('0x41')],{'$or':_['map'](_0x35c4bc[_0x9f80('0x3b')],function(_0x1c96e9){var _0x3f16fc={};_0x3f16fc[_0x1c96e9]={'$like':'%'+_0x304157[_0x9f80('0x37')][_0x9f80('0x42')]+'%'};return _0x3f16fc;})});}_0x35c4bc=_[_0x9f80('0x43')]({},_0x35c4bc,_0x304157[_0x9f80('0x45')]);return _0x49ba2b[_0x9f80('0x119')](_0x35c4bc);}})[_0x9f80('0x25')](function(_0x119392){if(_0x119392){_0xa7cf72=_0x119392[_0x9f80('0x5f')];if(!_0x304157[_0x9f80('0x37')][_0x9f80('0x3d')](_0x9f80('0x3e'))){_0x35c4bc[_0x9f80('0x21')]=qs['limit'](_0x304157[_0x9f80('0x37')][_0x9f80('0x21')]);_0x35c4bc[_0x9f80('0x1e')]=qs['offset'](_0x304157[_0x9f80('0x37')][_0x9f80('0x1e')]);}return _0x49ba2b[_0x9f80('0x119')](_0x35c4bc);}})[_0x9f80('0x25')](function(_0x3446be){if(_0x3446be){return _0x3446be?{'count':_0xa7cf72,'rows':_0x3446be}:null;}})['then'](respondWithResult(_0x55edb1,null))['catch'](handleError(_0x55edb1,null));};exports[_0x9f80('0x11a')]=function(_0x9117ac,_0x3bd769){return db[_0x9f80('0x11b')]['find']({'where':{'id':_0x9117ac[_0x9f80('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bd769,null))['then'](function(_0x2d1c2d){if(_0x2d1c2d){return _0x2d1c2d['addProactiveActions'](_0x9117ac[_0x9f80('0x4c')][_0x9f80('0x5c')],_[_0x9f80('0x11c')](_0x9117ac['body'],['ids','id'])||{});}})[_0x9f80('0x25')](respondWithResult(_0x3bd769,null))['catch'](handleError(_0x3bd769,null));};exports[_0x9f80('0xfb')]=function(_0x3d22f1,_0xf8a5ef){var _0x596bd8={};var _0x481c8b={};var _0x24de83;var _0x356335;return db['ChatWebsite'][_0x9f80('0x58')]({'where':{'id':_0x3d22f1[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0xf8a5ef,null))[_0x9f80('0x25')](function(_0x3c4110){if(_0x3c4110){_0x24de83=_0x3c4110;_0x481c8b[_0x9f80('0x3a')]=_[_0x9f80('0x36')](db[_0x9f80('0x11d')][_0x9f80('0x32')]);_0x481c8b[_0x9f80('0x37')]=_[_0x9f80('0x36')](_0x3d22f1[_0x9f80('0x37')]);_0x481c8b[_0x9f80('0x38')]=_[_0x9f80('0x39')](_0x481c8b[_0x9f80('0x3a')],_0x481c8b[_0x9f80('0x37')]);_0x596bd8[_0x9f80('0x3b')]=_[_0x9f80('0x39')](_0x481c8b['model'],qs[_0x9f80('0x3c')](_0x3d22f1['query'][_0x9f80('0x3c')]));_0x596bd8['attributes']=_0x596bd8['attributes'][_0x9f80('0x5f')]?_0x596bd8[_0x9f80('0x3b')]:_0x481c8b[_0x9f80('0x3a')];_0x596bd8['order']=qs[_0x9f80('0x40')](_0x3d22f1[_0x9f80('0x37')]['sort']);_0x596bd8['where']=qs['filters'](_['pick'](_0x3d22f1[_0x9f80('0x37')],_0x481c8b['filters']));if(_0x3d22f1[_0x9f80('0x37')][_0x9f80('0x42')]){_0x596bd8[_0x9f80('0x41')]=_[_0x9f80('0x43')](_0x596bd8[_0x9f80('0x41')],{'$or':_['map'](_0x596bd8[_0x9f80('0x3b')],function(_0x2d27c3){var _0x3ec373={};_0x3ec373[_0x2d27c3]={'$like':'%'+_0x3d22f1['query'][_0x9f80('0x42')]+'%'};return _0x3ec373;})});}_0x596bd8=_['merge']({},_0x596bd8,_0x3d22f1[_0x9f80('0x45')]);return _0x24de83[_0x9f80('0xfb')](_0x596bd8);}})[_0x9f80('0x25')](function(_0x4b105c){if(_0x4b105c){_0x356335=_0x4b105c[_0x9f80('0x5f')];if(!_0x3d22f1[_0x9f80('0x37')][_0x9f80('0x3d')]('nolimit')){_0x596bd8[_0x9f80('0x21')]=qs['limit'](_0x3d22f1[_0x9f80('0x37')][_0x9f80('0x21')]);_0x596bd8[_0x9f80('0x1e')]=qs[_0x9f80('0x1e')](_0x3d22f1[_0x9f80('0x37')][_0x9f80('0x1e')]);}return _0x24de83[_0x9f80('0xfb')](_0x596bd8);}})[_0x9f80('0x25')](function(_0x40bcf7){if(_0x40bcf7){return _0x40bcf7?{'count':_0x356335,'rows':_0x40bcf7}:null;}})[_0x9f80('0x25')](respondWithResult(_0xf8a5ef,null))[_0x9f80('0x1b')](handleError(_0xf8a5ef,null));};exports['getFields']=function(_0x1d23f2,_0x135c84){var _0x371444=_0x1d23f2[_0x9f80('0x37')][_0x9f80('0x11e')]==='false'?_0x9f80('0x11f'):_0x9f80('0x120');return db['ChatWebsite'][_0x9f80('0x4a')]({'attributes':['id',_0x371444],'where':{'id':_0x1d23f2[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x135c84,null))[_0x9f80('0x25')](function(_0xfdaf20){if(_0xfdaf20){var _0x128a94=_0xfdaf20[_0x371444];var _0x1e7ee5=_0x128a94&&_0x128a94['items']?_0x128a94[_0x9f80('0x121')]:[];_0x135c84[_0x9f80('0x2c')]({'fromKey':_[_0x9f80('0x79')](_0x128a94[_0x9f80('0x122')])?undefined:_0x128a94[_0x9f80('0x122')],'count':_0x1e7ee5['length'],'rows':_0x1e7ee5});}})[_0x9f80('0x1b')](handleError(_0x135c84,null));};exports['getOfflineMessages']=function(_0x2ac527,_0x3534ae){var _0x519b18={'raw':![],'where':{}};var _0x84f4ee={};var _0x38c7d3={'count':0x0,'rows':[]};return db[_0x9f80('0x31')][_0x9f80('0x58')]({'where':{'id':_0x2ac527[_0x9f80('0x48')]['id']}})['then'](handleEntityNotFound(_0x3534ae,null))[_0x9f80('0x25')](function(_0x8fba1f){if(_0x8fba1f){_0x84f4ee[_0x9f80('0x3a')]=_[_0x9f80('0x36')](db[_0x9f80('0xc9')][_0x9f80('0x32')]);_0x84f4ee['query']=_[_0x9f80('0x36')](_0x2ac527[_0x9f80('0x37')]);_0x84f4ee[_0x9f80('0x38')]=_['intersection'](_0x84f4ee['model'],_0x84f4ee[_0x9f80('0x37')]);_0x519b18[_0x9f80('0x3b')]=_[_0x9f80('0x39')](_0x84f4ee[_0x9f80('0x3a')],qs[_0x9f80('0x3c')](_0x2ac527[_0x9f80('0x37')]['fields']));_0x519b18['attributes']=_0x519b18[_0x9f80('0x3b')][_0x9f80('0x5f')]?_0x519b18[_0x9f80('0x3b')]:_0x84f4ee[_0x9f80('0x3a')];if(!_0x2ac527[_0x9f80('0x37')]['hasOwnProperty'](_0x9f80('0x3e'))){_0x519b18[_0x9f80('0x21')]=qs[_0x9f80('0x21')](_0x2ac527[_0x9f80('0x37')][_0x9f80('0x21')]);_0x519b18['offset']=qs['offset'](_0x2ac527[_0x9f80('0x37')][_0x9f80('0x1e')]);}_0x519b18['order']=qs['sort'](_0x2ac527[_0x9f80('0x37')][_0x9f80('0x40')]);_0x519b18[_0x9f80('0x41')]=qs[_0x9f80('0x38')](_[_0x9f80('0x59')](_0x2ac527[_0x9f80('0x37')],_0x84f4ee['filters']));_0x519b18[_0x9f80('0x41')][_0x9f80('0x55')]=_0x8fba1f['id'];if(_0x2ac527['query'][_0x9f80('0x42')]){_0x519b18[_0x9f80('0x41')]=_['merge'](_0x519b18[_0x9f80('0x41')],{'$or':_['map'](_0x519b18[_0x9f80('0x3b')],function(_0x4e8285){var _0x4b3a25={};_0x4b3a25[_0x4e8285]={'$like':'%'+_0x2ac527[_0x9f80('0x37')][_0x9f80('0x42')]+'%'};return _0x4b3a25;})});}_0x519b18=_['merge']({},_0x519b18,_0x2ac527['options']);return db['ChatOfflineMessage'][_0x9f80('0x20')]({'where':_0x519b18[_0x9f80('0x41')]})[_0x9f80('0x25')](function(_0x3766fb){_0x38c7d3[_0x9f80('0x20')]=_0x3766fb;if(_0x2ac527['query'][_0x9f80('0x46')]){_0x519b18[_0x9f80('0x49')]=[{'all':!![]}];}else{_0x519b18[_0x9f80('0x49')]=[{'model':db[_0x9f80('0x8f')],'as':_0x9f80('0x123'),'required':![]},{'model':db[_0x9f80('0xd1')],'as':_0x9f80('0x124'),'required':![]}];}return db[_0x9f80('0xc9')][_0x9f80('0x47')](_0x519b18);})[_0x9f80('0x25')](function(_0x2fd693){_0x38c7d3['rows']=_0x2fd693;return _0x38c7d3;});}})[_0x9f80('0x25')](respondWithFilteredResult(_0x3534ae,_0x519b18))[_0x9f80('0x1b')](handleError(_0x3534ae,null));};exports[_0x9f80('0x125')]=function(_0xcb36fe,_0xaa2766){return db[_0x9f80('0x31')]['find']({'where':{'id':_0xcb36fe['params']['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0xaa2766,null))['then'](function(_0x10c62c){if(_0x10c62c){return _0x10c62c['addAgents'](_0xcb36fe[_0x9f80('0x4c')][_0x9f80('0x5c')],_[_0x9f80('0x11c')](_0xcb36fe['body'],[_0x9f80('0x5c'),'id'])||{})[_0x9f80('0xad')](function(_0x235ef3){for(var _0xd102ef=0x0;_0xd102ef<_0xcb36fe['body'][_0x9f80('0x5c')][_0x9f80('0x5f')];_0xd102ef+=0x1){socket[_0x9f80('0x126')](_0x9f80('0x127'),{'UserId':Number(_0xcb36fe[_0x9f80('0x4c')][_0x9f80('0x5c')][_0xd102ef]),'ChatWebsiteId':Number(_0xcb36fe['params']['id'])});}return _0x235ef3;});}})['then'](respondWithResult(_0xaa2766,null))['catch'](handleError(_0xaa2766,null));};exports[_0x9f80('0x128')]=function(_0x58cc24,_0xd07839){return db[_0x9f80('0x31')][_0x9f80('0x4a')]({'where':{'id':_0x58cc24[_0x9f80('0x48')]['id']}})['then'](handleEntityNotFound(_0xd07839,null))[_0x9f80('0x25')](function(_0xdc5555){if(_0xdc5555){return _0xdc5555[_0x9f80('0x128')](_0x58cc24[_0x9f80('0x37')][_0x9f80('0x5c')])[_0x9f80('0x25')](function(){if(_[_0x9f80('0x129')](_0x58cc24[_0x9f80('0x37')][_0x9f80('0x5c')])){for(var _0x4acc12=0x0;_0x4acc12<_0x58cc24['query'][_0x9f80('0x5c')]['length'];_0x4acc12+=0x1){socket['emit'](_0x9f80('0x12a'),{'UserId':Number(_0x58cc24[_0x9f80('0x37')]['ids'][_0x4acc12]),'ChatWebsiteId':Number(_0x58cc24[_0x9f80('0x48')]['id'])});}}else{socket[_0x9f80('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x58cc24[_0x9f80('0x37')]['ids']),'ChatWebsiteId':Number(_0x58cc24[_0x9f80('0x48')]['id'])});}});}})[_0x9f80('0x25')](respondWithStatusCode(_0xd07839,null))['catch'](handleError(_0xd07839,null));};exports[_0x9f80('0x12b')]=function(_0x174e39,_0x55f218){var _0x46d719={};var _0x35a8eb={};var _0x30a046;var _0x3040ac;return db[_0x9f80('0x31')]['findOne']({'where':{'id':_0x174e39[_0x9f80('0x48')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x55f218,null))['then'](function(_0x3a8317){if(_0x3a8317){_0x30a046=_0x3a8317;_0x35a8eb[_0x9f80('0x3a')]=_[_0x9f80('0x36')](db[_0x9f80('0xb6')][_0x9f80('0x32')]);_0x35a8eb[_0x9f80('0x37')]=_[_0x9f80('0x36')](_0x174e39[_0x9f80('0x37')]);_0x35a8eb[_0x9f80('0x38')]=_[_0x9f80('0x39')](_0x35a8eb[_0x9f80('0x3a')],_0x35a8eb[_0x9f80('0x37')]);_0x46d719[_0x9f80('0x3b')]=_[_0x9f80('0x39')](_0x35a8eb[_0x9f80('0x3a')],qs[_0x9f80('0x3c')](_0x174e39['query'][_0x9f80('0x3c')]));_0x46d719[_0x9f80('0x3b')]=_0x46d719[_0x9f80('0x3b')][_0x9f80('0x5f')]?_0x46d719['attributes']:_0x35a8eb['model'];_0x46d719[_0x9f80('0x3f')]=qs[_0x9f80('0x40')](_0x174e39['query'][_0x9f80('0x40')]);_0x46d719[_0x9f80('0x41')]=qs['filters'](_[_0x9f80('0x59')](_0x174e39[_0x9f80('0x37')],_0x35a8eb['filters']));if(_0x174e39['query']['filter']){_0x46d719[_0x9f80('0x41')]=_['merge'](_0x46d719[_0x9f80('0x41')],{'$or':_[_0x9f80('0x30')](_0x46d719[_0x9f80('0x3b')],function(_0x44aae1){var _0x468474={};_0x468474[_0x44aae1]={'$like':'%'+_0x174e39[_0x9f80('0x37')][_0x9f80('0x42')]+'%'};return _0x468474;})});}_0x46d719=_[_0x9f80('0x43')]({},_0x46d719,_0x174e39[_0x9f80('0x45')]);return _0x30a046['getAgents'](_0x46d719);}})[_0x9f80('0x25')](function(_0x35aa17){if(_0x35aa17){_0x3040ac=_0x35aa17[_0x9f80('0x5f')];if(!_0x174e39[_0x9f80('0x37')][_0x9f80('0x3d')]('nolimit')){_0x46d719[_0x9f80('0x21')]=qs[_0x9f80('0x21')](_0x174e39[_0x9f80('0x37')][_0x9f80('0x21')]);_0x46d719[_0x9f80('0x1e')]=qs['offset'](_0x174e39[_0x9f80('0x37')][_0x9f80('0x1e')]);}return _0x30a046[_0x9f80('0x12b')](_0x46d719);}})[_0x9f80('0x25')](function(_0x4e4980){if(_0x4e4980){return _0x4e4980?{'count':_0x3040ac,'rows':_0x4e4980}:null;}})[_0x9f80('0x25')](respondWithResult(_0x55f218,null))[_0x9f80('0x1b')](handleError(_0x55f218,null));}; \ No newline at end of file +var _0x51a8=['sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','orderBy','priority','headers','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','close','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','../../config/license/util','virtual','custom','chatLicenseExceeded','Intervals','push','all','some','readFileSync','server/files/chat/iframe.ejs','URL','3.1.0','x-forwarded-for','x-real-ip','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','get','ChatWebsites','UserProfileResource','destroy','stack','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','map','name','keys','filters','intersection','model','query','fields','attributes','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','ChatWebsite','include','findAll','rows','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','getAnswers','CannedAnswer','includeAll','removeAnswers','ids','addLogo'];(function(_0x2b704a,_0x7c5ca9){var _0x41eb36=function(_0x1bbc21){while(--_0x1bbc21){_0x2b704a['push'](_0x2b704a['shift']());}};_0x41eb36(++_0x7c5ca9);}(_0x51a8,0xc5));var _0x851a=function(_0x16c02d,_0x24d20d){_0x16c02d=_0x16c02d-0x0;var _0x27f7ec=_0x51a8[_0x16c02d];return _0x27f7ec;};'use strict';var BPromise=require(_0x851a('0x0'));var Mustache=require('mustache');var util=require(_0x851a('0x1'));var path=require('path');var ejs=require(_0x851a('0x2'));var fs=require('fs');var fs_extra=require(_0x851a('0x3'));var _=require(_0x851a('0x4'));var querystring=require(_0x851a('0x5'));var Redis=require('ioredis');var qs=require(_0x851a('0x6'));var logger=require(_0x851a('0x7'))(_0x851a('0x8'));var config=require(_0x851a('0x9'));var url=require(_0x851a('0xa'));var db=require(_0x851a('0xb'))['db'];config[_0x851a('0xc')]=_[_0x851a('0xd')](config['redis'],{'host':_0x851a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x851a('0xc')]));require(_0x851a('0xf'))[_0x851a('0x10')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x851a('0x11'));var client=jayson[_0x851a('0x12')][_0x851a('0x13')]({'port':0x232c});var client9002=jayson['client'][_0x851a('0x13')]({'port':0x232a});var client9003=jayson[_0x851a('0x12')][_0x851a('0x13')]({'port':0x232b});var client9001=jayson[_0x851a('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x250074,_0x5c4373,_0x4dc52f,_0x5af44a){return new BPromise(function(_0x1c334f,_0xc1ef83){var _0x42f8eb=_0x5af44a||client;return _0x42f8eb[_0x851a('0x14')](_0x250074,_0x4dc52f)[_0x851a('0x15')](function(_0x343f1f){logger[_0x851a('0x16')](_0x851a('0x17'),_0x5c4373,_0x851a('0x18'));logger[_0x851a('0x19')](_0x851a('0x1a'),_0x5c4373,_0x851a('0x18'),JSON[_0x851a('0x1b')](_0x343f1f));if(_0x343f1f[_0x851a('0x1c')]){if(_0x343f1f['error'][_0x851a('0x1d')]===0x1f4){logger['error'](_0x851a('0x17'),_0x5c4373,_0x343f1f['error'][_0x851a('0x1e')]);return _0xc1ef83(_0x343f1f['error'][_0x851a('0x1e')]);}logger[_0x851a('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x5c4373,_0x343f1f[_0x851a('0x1c')]['message']);return _0x1c334f(_0x343f1f[_0x851a('0x1c')][_0x851a('0x1e')]);}else{logger[_0x851a('0x16')](_0x851a('0x17'),_0x5c4373,'request\x20sent');_0x1c334f(_0x343f1f[_0x851a('0x1f')]['message']);}})[_0x851a('0x20')](function(_0x39fa52){logger[_0x851a('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x5c4373,_0x39fa52);_0xc1ef83(_0x39fa52);});});}function respondWithStatusCode(_0x207128,_0x32e55c){_0x32e55c=_0x32e55c||0xcc;return function(_0x13a92c){if(_0x13a92c){return _0x207128[_0x851a('0x21')](_0x32e55c);}return _0x207128[_0x851a('0x22')](_0x32e55c)[_0x851a('0x23')]();};}function respondWithResult(_0x46579c,_0x1b9eb4){_0x1b9eb4=_0x1b9eb4||0xc8;return function(_0x14bc9b){if(_0x14bc9b){return _0x46579c[_0x851a('0x22')](_0x1b9eb4)[_0x851a('0x24')](_0x14bc9b);}};}function respondWithFilteredResult(_0x146bd5,_0x382f7c){return function(_0x139cb2){if(_0x139cb2){var _0x15d3f9=typeof _0x382f7c[_0x851a('0x25')]===_0x851a('0x26')&&typeof _0x382f7c[_0x851a('0x27')]===_0x851a('0x26');var _0x46ef07=_0x139cb2[_0x851a('0x28')];var _0x1443f0=_0x15d3f9?0x0:_0x382f7c[_0x851a('0x25')];var _0xa0ff11=_0x15d3f9?_0x139cb2[_0x851a('0x28')]:_0x382f7c['offset']+_0x382f7c[_0x851a('0x27')];var _0x1459e8;if(_0xa0ff11>=_0x46ef07){_0xa0ff11=_0x46ef07;_0x1459e8=0xc8;}else{_0x1459e8=0xce;}_0x146bd5[_0x851a('0x22')](_0x1459e8);return _0x146bd5[_0x851a('0x29')]('Content-Range',_0x1443f0+'-'+_0xa0ff11+'/'+_0x46ef07)[_0x851a('0x24')](_0x139cb2);}return null;};}function saveUpdates(_0x1e176b){return function(_0x3db25e){if(_0x3db25e){return _0x3db25e[_0x851a('0x2a')](_0x1e176b)[_0x851a('0x15')](function(_0x392704){return _0x392704;});}return null;};}function removeEntity(_0x2b70ac){return function(_0x2f5490){if(_0x2f5490){return _0x2f5490['destroy']()[_0x851a('0x15')](function(){var _0x360c82=_0x2f5490[_0x851a('0x2b')]({'plain':!![]});var _0x5daea4=_0x851a('0x2c');return db[_0x851a('0x2d')][_0x851a('0x2e')]({'where':{'type':_0x5daea4,'resourceId':_0x360c82['id']}})[_0x851a('0x15')](function(){return _0x2f5490;});})[_0x851a('0x15')](function(){_0x2b70ac[_0x851a('0x22')](0xcc)[_0x851a('0x23')]();});}};}function handleEntityNotFound(_0x348d53){return function(_0x3139f2){if(!_0x3139f2){_0x348d53[_0x851a('0x21')](0x194);}return _0x3139f2;};}function handleError(_0x3dbce1,_0x5adbcc){_0x5adbcc=_0x5adbcc||0x1f4;return function(_0xca90ef){logger[_0x851a('0x1c')](_0xca90ef[_0x851a('0x2f')]);if(_0xca90ef['name']){delete _0xca90ef['name'];}_0x3dbce1[_0x851a('0x22')](_0x5adbcc)[_0x851a('0x30')](_0xca90ef);};}exports[_0x851a('0x31')]=function(_0x1619ea,_0x3c7e54){var _0x4c629f={'include':[{'model':db[_0x851a('0x32')],'as':_0x851a('0x33')}]},_0x584ec2={},_0x5dec4d={'count':0x0,'rows':[]};var _0x143bb0=_['map'](db['ChatWebsite'][_0x851a('0x34')],function(_0xdfce00){return{'name':_0xdfce00[_0x851a('0x35')],'type':_0xdfce00['type'][_0x851a('0x36')]};});_0x584ec2['model']=_[_0x851a('0x37')](_0x143bb0,_0x851a('0x38'));_0x584ec2['query']=_[_0x851a('0x39')](_0x1619ea['query']);_0x584ec2[_0x851a('0x3a')]=_[_0x851a('0x3b')](_0x584ec2[_0x851a('0x3c')],_0x584ec2[_0x851a('0x3d')]);_0x4c629f['attributes']=_[_0x851a('0x3b')](_0x584ec2['model'],qs[_0x851a('0x3e')](_0x1619ea[_0x851a('0x3d')]['fields']));_0x4c629f['attributes']=_0x4c629f[_0x851a('0x3f')]['length']?_0x4c629f[_0x851a('0x3f')]:_0x584ec2['model'];if(!_0x1619ea[_0x851a('0x3d')]['hasOwnProperty'](_0x851a('0x40'))){_0x4c629f['limit']=qs[_0x851a('0x27')](_0x1619ea[_0x851a('0x3d')]['limit']);_0x4c629f[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x1619ea['query']['offset']);}_0x4c629f[_0x851a('0x41')]=qs[_0x851a('0x42')](_0x1619ea['query'][_0x851a('0x42')]);_0x4c629f[_0x851a('0x43')]=qs['filters'](_['pick'](_0x1619ea[_0x851a('0x3d')],_0x584ec2['filters']),_0x143bb0);if(_0x1619ea[_0x851a('0x3d')]['filter']){_0x4c629f[_0x851a('0x43')]=_[_0x851a('0x44')](_0x4c629f[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x143bb0,function(_0x55f374){if(_0x55f374[_0x851a('0x45')]!==_0x851a('0x46')){var _0x67f951={};_0x67f951[_0x55f374[_0x851a('0x38')]]={'$like':'%'+_0x1619ea['query'][_0x851a('0x47')]+'%'};return _0x67f951;}})});}_0x4c629f=_[_0x851a('0x44')]({},_0x4c629f,_0x1619ea[_0x851a('0x48')]);var _0x46e392={'where':_0x4c629f['where']};return db[_0x851a('0x49')]['count'](_0x46e392)[_0x851a('0x15')](function(_0x46965e){_0x5dec4d[_0x851a('0x28')]=_0x46965e;if(_0x1619ea['query']['includeAll']){_0x4c629f[_0x851a('0x4a')]=[{'all':!![]}];}return db[_0x851a('0x49')][_0x851a('0x4b')](_0x4c629f);})[_0x851a('0x15')](function(_0x4e173e){_0x5dec4d[_0x851a('0x4c')]=_0x4e173e;return _0x5dec4d;})[_0x851a('0x15')](respondWithFilteredResult(_0x3c7e54,_0x4c629f))[_0x851a('0x20')](handleError(_0x3c7e54,null));};exports[_0x851a('0x4d')]=function(_0x1eacbe,_0x345856){var _0x5a0e71={'raw':![],'where':{'id':_0x1eacbe['params']['id']},'include':[{'model':db[_0x851a('0x32')],'as':'mandatoryDispositionPause'}]},_0x4e46b9={};_0x4e46b9['model']=_[_0x851a('0x39')](db[_0x851a('0x49')]['rawAttributes']);_0x4e46b9[_0x851a('0x3d')]=_[_0x851a('0x39')](_0x1eacbe[_0x851a('0x3d')]);_0x4e46b9['filters']=_[_0x851a('0x3b')](_0x4e46b9[_0x851a('0x3c')],_0x4e46b9['query']);_0x5a0e71['attributes']=_[_0x851a('0x3b')](_0x4e46b9[_0x851a('0x3c')],qs['fields'](_0x1eacbe[_0x851a('0x3d')][_0x851a('0x3e')]));_0x5a0e71[_0x851a('0x3f')]=_0x5a0e71[_0x851a('0x3f')][_0x851a('0x4e')]?_0x5a0e71[_0x851a('0x3f')]:_0x4e46b9[_0x851a('0x3c')];if(_0x1eacbe[_0x851a('0x3d')]['includeAll']){_0x5a0e71[_0x851a('0x4a')]=[{'all':!![]}];}_0x5a0e71=_[_0x851a('0x44')]({},_0x5a0e71,_0x1eacbe['options']);return db[_0x851a('0x49')][_0x851a('0x4f')](_0x5a0e71)[_0x851a('0x15')](handleEntityNotFound(_0x345856,null))[_0x851a('0x15')](respondWithResult(_0x345856,null))['catch'](handleError(_0x345856,null));};exports[_0x851a('0x50')]=function(_0x4b443a,_0x523557){return db[_0x851a('0x49')][_0x851a('0x50')](_0x4b443a['body'],{})[_0x851a('0x15')](function(_0x2871fd){var _0x40776c=_0x4b443a[_0x851a('0x51')][_0x851a('0x2b')]({'plain':!![]});if(!_0x40776c)throw new Error(_0x851a('0x52'));if(_0x40776c['role']===_0x851a('0x51')){var _0x3e338c=_0x2871fd['get']({'plain':!![]});var _0x7ddca1=_0x851a('0x2c');return db['UserProfileSection'][_0x851a('0x4f')]({'where':{'name':_0x7ddca1,'userProfileId':_0x40776c[_0x851a('0x53')]},'raw':!![]})[_0x851a('0x15')](function(_0xe30d06){if(_0xe30d06&&_0xe30d06[_0x851a('0x54')]===0x0){return db[_0x851a('0x2d')][_0x851a('0x50')]({'name':_0x3e338c['name'],'resourceId':_0x3e338c['id'],'type':_0xe30d06[_0x851a('0x38')],'sectionId':_0xe30d06['id']},{})['then'](function(){return _0x2871fd;});}else{return _0x2871fd;}})[_0x851a('0x20')](function(_0xd09372){logger[_0x851a('0x1c')](_0x851a('0x55'),_0xd09372);throw _0xd09372;});}return _0x2871fd;})[_0x851a('0x15')](respondWithResult(_0x523557,0xc9))[_0x851a('0x20')](handleError(_0x523557,null));};exports[_0x851a('0x2a')]=function(_0x483db1,_0x185ce0){if(_0x483db1[_0x851a('0x56')]['id']){delete _0x483db1['body']['id'];}return db[_0x851a('0x49')]['find']({'where':{'id':_0x483db1[_0x851a('0x57')]['id']},'include':[{'model':db[_0x851a('0x32')],'as':_0x851a('0x33')}]})[_0x851a('0x15')](handleEntityNotFound(_0x185ce0,null))['then'](saveUpdates(_0x483db1[_0x851a('0x56')],null))[_0x851a('0x15')](respondWithResult(_0x185ce0,null))['catch'](handleError(_0x185ce0,null));};exports[_0x851a('0x2e')]=function(_0x301ccd,_0x2b3af8){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x301ccd[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x2b3af8,null))[_0x851a('0x15')](removeEntity(_0x2b3af8,null))[_0x851a('0x20')](handleError(_0x2b3af8,null));};exports[_0x851a('0x58')]=function(_0x45d402,_0xc4b06a){return db[_0x851a('0x49')][_0x851a('0x58')]()[_0x851a('0x15')](respondWithResult(_0xc4b06a,null))['catch'](handleError(_0xc4b06a,null));};exports[_0x851a('0x59')]=function(_0x8364fa,_0x4ec994){if(_0x8364fa['body']['id']){delete _0x8364fa[_0x851a('0x56')]['id'];}return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x8364fa[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x4ec994,null))[_0x851a('0x15')](function(_0x30ce3a){if(_0x30ce3a){_0x8364fa[_0x851a('0x56')][_0x851a('0x5a')]=_0x30ce3a['id'];return db[_0x851a('0x5b')][_0x851a('0x50')](_0x8364fa[_0x851a('0x56')]);}})[_0x851a('0x15')](respondWithResult(_0x4ec994,null))[_0x851a('0x20')](handleError(_0x4ec994,null));};exports[_0x851a('0x5c')]=function(_0x30945c,_0x3c1dce){var _0x15b3f9={'raw':![],'where':{}};var _0x280bb7={};var _0x4b8de9={'count':0x0,'rows':[]};return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x30945c[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x3c1dce,null))[_0x851a('0x15')](function(_0xe5f964){if(_0xe5f964){_0x280bb7[_0x851a('0x3c')]=_[_0x851a('0x39')](db[_0x851a('0x5b')]['rawAttributes']);_0x280bb7[_0x851a('0x3d')]=_[_0x851a('0x39')](_0x30945c['query']);_0x280bb7[_0x851a('0x3a')]=_['intersection'](_0x280bb7[_0x851a('0x3c')],_0x280bb7[_0x851a('0x3d')]);_0x15b3f9['attributes']=_[_0x851a('0x3b')](_0x280bb7['model'],qs[_0x851a('0x3e')](_0x30945c[_0x851a('0x3d')]['fields']));_0x15b3f9['attributes']=_0x15b3f9[_0x851a('0x3f')][_0x851a('0x4e')]?_0x15b3f9[_0x851a('0x3f')]:_0x280bb7['model'];if(!_0x30945c['query'][_0x851a('0x5e')](_0x851a('0x40'))){_0x15b3f9[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x30945c[_0x851a('0x3d')][_0x851a('0x27')]);_0x15b3f9[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x30945c[_0x851a('0x3d')]['offset']);}_0x15b3f9[_0x851a('0x41')]=qs['sort'](_0x30945c[_0x851a('0x3d')][_0x851a('0x42')]);_0x15b3f9[_0x851a('0x43')]=qs[_0x851a('0x3a')](_[_0x851a('0x5f')](_0x30945c[_0x851a('0x3d')],_0x280bb7[_0x851a('0x3a')]));_0x15b3f9[_0x851a('0x43')]['ChatWebsiteId']=_0xe5f964['id'];if(_0x30945c[_0x851a('0x3d')][_0x851a('0x47')]){_0x15b3f9[_0x851a('0x43')]=_['merge'](_0x15b3f9[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x15b3f9[_0x851a('0x3f')],function(_0x312cce){var _0x55aeba={};_0x55aeba[_0x312cce]={'$like':'%'+_0x30945c['query'][_0x851a('0x47')]+'%'};return _0x55aeba;})});}_0x15b3f9=_[_0x851a('0x44')]({},_0x15b3f9,_0x30945c['options']);return db[_0x851a('0x5b')][_0x851a('0x28')]({'where':_0x15b3f9['where']})[_0x851a('0x15')](function(_0x41be52){_0x4b8de9['count']=_0x41be52;if(_0x30945c[_0x851a('0x3d')]['includeAll']){_0x15b3f9[_0x851a('0x4a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x15b3f9);})[_0x851a('0x15')](function(_0x19ff3b){_0x4b8de9[_0x851a('0x4c')]=_0x19ff3b;return _0x4b8de9;});}})[_0x851a('0x15')](respondWithFilteredResult(_0x3c1dce,_0x15b3f9))[_0x851a('0x20')](handleError(_0x3c1dce,null));};exports[_0x851a('0x60')]=function(_0x3b00c7,_0x197ec4){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x3b00c7['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x197ec4,null))[_0x851a('0x15')](function(_0x5d0ecb){if(_0x5d0ecb){return _0x5d0ecb[_0x851a('0x60')](_0x3b00c7[_0x851a('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x197ec4,null))[_0x851a('0x20')](handleError(_0x197ec4,null));};exports['addAnswer']=function(_0x1c3c23,_0x2a4868){if(_0x1c3c23[_0x851a('0x56')]['id']){delete _0x1c3c23['body']['id'];}return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x1c3c23['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x2a4868,null))[_0x851a('0x15')](function(_0x3b7344){if(_0x3b7344){_0x1c3c23[_0x851a('0x56')][_0x851a('0x5a')]=_0x3b7344['id'];return db['CannedAnswer'][_0x851a('0x50')](_0x1c3c23[_0x851a('0x56')]);}})[_0x851a('0x15')](respondWithResult(_0x2a4868,null))[_0x851a('0x20')](handleError(_0x2a4868,null));};exports[_0x851a('0x61')]=function(_0x15501d,_0x32aa0e){var _0x23ad5f={'raw':![],'where':{}};var _0x2d0edf={};var _0xc510ff={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x15501d['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x32aa0e,null))[_0x851a('0x15')](function(_0x5bb466){if(_0x5bb466){_0x2d0edf[_0x851a('0x3c')]=_[_0x851a('0x39')](db[_0x851a('0x62')][_0x851a('0x34')]);_0x2d0edf[_0x851a('0x3d')]=_[_0x851a('0x39')](_0x15501d[_0x851a('0x3d')]);_0x2d0edf['filters']=_[_0x851a('0x3b')](_0x2d0edf[_0x851a('0x3c')],_0x2d0edf[_0x851a('0x3d')]);_0x23ad5f['attributes']=_[_0x851a('0x3b')](_0x2d0edf[_0x851a('0x3c')],qs[_0x851a('0x3e')](_0x15501d['query'][_0x851a('0x3e')]));_0x23ad5f[_0x851a('0x3f')]=_0x23ad5f[_0x851a('0x3f')][_0x851a('0x4e')]?_0x23ad5f[_0x851a('0x3f')]:_0x2d0edf['model'];if(!_0x15501d[_0x851a('0x3d')][_0x851a('0x5e')](_0x851a('0x40'))){_0x23ad5f[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x15501d['query'][_0x851a('0x27')]);_0x23ad5f['offset']=qs[_0x851a('0x25')](_0x15501d['query']['offset']);}_0x23ad5f[_0x851a('0x41')]=qs[_0x851a('0x42')](_0x15501d['query'][_0x851a('0x42')]);_0x23ad5f['where']=qs[_0x851a('0x3a')](_[_0x851a('0x5f')](_0x15501d[_0x851a('0x3d')],_0x2d0edf[_0x851a('0x3a')]));_0x23ad5f['where'][_0x851a('0x5a')]=_0x5bb466['id'];if(_0x15501d[_0x851a('0x3d')][_0x851a('0x47')]){_0x23ad5f[_0x851a('0x43')]=_[_0x851a('0x44')](_0x23ad5f[_0x851a('0x43')],{'$or':_['map'](_0x23ad5f[_0x851a('0x3f')],function(_0x303da2){var _0x87702c={};_0x87702c[_0x303da2]={'$like':'%'+_0x15501d[_0x851a('0x3d')][_0x851a('0x47')]+'%'};return _0x87702c;})});}_0x23ad5f=_[_0x851a('0x44')]({},_0x23ad5f,_0x15501d[_0x851a('0x48')]);return db[_0x851a('0x62')][_0x851a('0x28')]({'where':_0x23ad5f['where']})[_0x851a('0x15')](function(_0x42e99a){_0xc510ff['count']=_0x42e99a;if(_0x15501d['query'][_0x851a('0x63')]){_0x23ad5f[_0x851a('0x4a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x851a('0x4b')](_0x23ad5f);})[_0x851a('0x15')](function(_0x4f6a48){_0xc510ff[_0x851a('0x4c')]=_0x4f6a48;return _0xc510ff;});}})[_0x851a('0x15')](respondWithFilteredResult(_0x32aa0e,_0x23ad5f))[_0x851a('0x20')](handleError(_0x32aa0e,null));};exports[_0x851a('0x64')]=function(_0x4d2755,_0x10eded){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x4d2755[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x10eded,null))['then'](function(_0x528748){if(_0x528748){return _0x528748['removeAnswers'](_0x4d2755[_0x851a('0x3d')][_0x851a('0x65')]);}})[_0x851a('0x15')](respondWithStatusCode(_0x10eded,null))['catch'](handleError(_0x10eded,null));};exports[_0x851a('0x66')]=function(_0x38d369,_0x173ea1){_0x38d369[_0x851a('0x56')][_0x851a('0x67')]=_0x38d369[_0x851a('0x68')]['filename'];return db['ChatWebsite'][_0x851a('0x4f')]({'where':{'id':_0x38d369[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x173ea1,null))[_0x851a('0x15')](saveUpdates(_0x38d369['body'],null))[_0x851a('0x15')](respondWithResult(_0x173ea1,null))[_0x851a('0x20')](handleError(_0x173ea1,null));};exports[_0x851a('0x69')]=function(_0x26a89b,_0x283c08){_0x26a89b['body'][_0x851a('0x6a')]=_0x26a89b[_0x851a('0x68')][_0x851a('0x6b')];return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x26a89b[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x283c08,null))[_0x851a('0x15')](saveUpdates(_0x26a89b['body'],null))[_0x851a('0x15')](respondWithResult(_0x283c08,null))[_0x851a('0x20')](handleError(_0x283c08,null));};exports[_0x851a('0x6c')]=function(_0x59d614,_0x4acc17){_0x59d614['body'][_0x851a('0x6d')]=_0x59d614[_0x851a('0x68')][_0x851a('0x6b')];return db['ChatWebsite']['find']({'where':{'id':_0x59d614[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x4acc17,null))[_0x851a('0x15')](saveUpdates(_0x59d614[_0x851a('0x56')],null))[_0x851a('0x15')](respondWithResult(_0x4acc17,null))[_0x851a('0x20')](handleError(_0x4acc17,null));};exports[_0x851a('0x6e')]=function(_0x53d478,_0xde5079){_0x53d478[_0x851a('0x56')][_0x851a('0x6f')]=_0x53d478[_0x851a('0x68')][_0x851a('0x6b')];return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x53d478[_0x851a('0x57')]['id']}})['then'](handleEntityNotFound(_0xde5079,null))[_0x851a('0x15')](saveUpdates(_0x53d478[_0x851a('0x56')],null))[_0x851a('0x15')](respondWithResult(_0xde5079,null))[_0x851a('0x20')](handleError(_0xde5079,null));};exports['getLogo']=function(_0x141acd,_0x47fdb2){var _0x30d555=path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x72'));var _0x25be7b={'where':{'id':_0x141acd[_0x851a('0x57')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5e45b4=![];return require('../../config/license/util')[_0x851a('0x73')]()[_0x851a('0x15')](function(_0x3b0fcb){if(_0x3b0fcb){_0x5e45b4=_0x3b0fcb['custom'];}})[_0x851a('0x15')](function(){return db[_0x851a('0x49')]['find'](_0x25be7b);})['then'](handleEntityNotFound(_0x47fdb2,null))[_0x851a('0x15')](function(_0x56a309){if(_0x56a309){if(!_['isNil'](_0x56a309[_0x851a('0x67')])){if(fs[_0x851a('0x74')](path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x75'),_0x56a309[_0x851a('0x67')]))&&_0x5e45b4){_0x30d555=path[_0x851a('0x70')](config['root'],_0x851a('0x75'),_0x56a309[_0x851a('0x67')]);}}return _0x47fdb2['download'](_0x30d555);}})['catch'](handleError(_0x47fdb2,null));};exports[_0x851a('0x76')]=function(_0x4e32f5,_0x11405b){var _0x54c15b=path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x77'));var _0x298b9c={'where':{'id':_0x4e32f5[_0x851a('0x57')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x851a('0x49')][_0x851a('0x4f')](_0x298b9c)[_0x851a('0x15')](handleEntityNotFound(_0x11405b,null))['then'](function(_0x2dc29e){if(_0x2dc29e){if(!_[_0x851a('0x78')](_0x2dc29e[_0x851a('0x6a')])){if(fs['existsSync'](path[_0x851a('0x70')](config['root'],_0x851a('0x79'),_0x2dc29e['agentAvatar']))){_0x54c15b=path[_0x851a('0x70')](config[_0x851a('0x71')],'server/files/images/avatars/',_0x2dc29e[_0x851a('0x6a')]);}}return _0x11405b[_0x851a('0x7a')](_0x54c15b);}})[_0x851a('0x20')](handleError(_0x11405b,null));};exports['getCustomerAvatar']=function(_0x1692c7,_0x1664ac){var _0x5300fe=path[_0x851a('0x70')](config['root'],_0x851a('0x7b'));var _0xbbde0d={'where':{'id':_0x1692c7[_0x851a('0x57')]['id']},'attributes':['id',_0x851a('0x6d'),_0x851a('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x851a('0x4f')](_0xbbde0d)[_0x851a('0x15')](handleEntityNotFound(_0x1664ac,null))[_0x851a('0x15')](function(_0x4f6c53){if(_0x4f6c53){if(!_['isNil'](_0x4f6c53[_0x851a('0x6d')])){if(fs[_0x851a('0x74')](path['join'](config[_0x851a('0x71')],'server/files/images/avatars/',_0x4f6c53[_0x851a('0x6d')]))&&_0x4f6c53[_0x851a('0x7c')]){_0x5300fe=path['join'](config[_0x851a('0x71')],_0x851a('0x79'),_0x4f6c53[_0x851a('0x6d')]);}}return _0x1664ac[_0x851a('0x7a')](_0x5300fe);}})['catch'](handleError(_0x1664ac,null));};exports[_0x851a('0x7d')]=function(_0x5e6fa7,_0x270fe2){var _0x39fffd=path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x7e'));var _0x43e182={'where':{'id':_0x5e6fa7['params']['id']},'attributes':['id',_0x851a('0x6f')],'raw':!![]};return db[_0x851a('0x49')][_0x851a('0x4f')](_0x43e182)[_0x851a('0x15')](handleEntityNotFound(_0x270fe2,null))['then'](function(_0xe6dcd5){if(_0xe6dcd5){if(!_['isNil'](_0xe6dcd5[_0x851a('0x6f')])){if(fs['existsSync'](path['join'](config[_0x851a('0x71')],_0x851a('0x79'),_0xe6dcd5['systemAvatar']))){_0x39fffd=path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x79'),_0xe6dcd5[_0x851a('0x6f')]);}}return _0x270fe2[_0x851a('0x7a')](_0x39fffd);}})[_0x851a('0x20')](handleError(_0x270fe2,null));};exports[_0x851a('0x7f')]=function(_0x485022,_0x153b7c){var _0x47b390=require('user-agent-parser');var _0x1addad=new _0x47b390();var _0x2c088a=_0x1addad[_0x851a('0x80')](_0x485022['headers'][_0x851a('0x81')])[_0x851a('0x82')]();var _0x57b5f8={'body':_0x485022[_0x851a('0x56')],'channel':_0x851a('0x83')};var _0x266472=[];var _0x39e8a5=[];var _0x437c62={};var _0x4379c6=![];return db[_0x851a('0x84')][_0x851a('0x58')]()[_0x851a('0x15')](function(_0x207794){if(!_0x207794){throw new db['Sequelize']['ValidationError'](_0x851a('0x85'));}_0x266472=_[_0x851a('0x86')](_[_0x851a('0x39')](_0x207794),['createdAt',_0x851a('0x87')]);_0x39e8a5=_['difference'](_[_0x851a('0x39')](_0x207794),[_0x851a('0x88'),_0x851a('0x87'),_0x851a('0x89'),_0x851a('0x8a')]);if(_0x485022[_0x851a('0x56')]['id']){delete _0x485022[_0x851a('0x56')]['id'];}if(_['isNil'](_0x485022[_0x851a('0x56')][_0x851a('0x8b')])){throw new db[(_0x851a('0x8c'))]['ValidationError'](_0x851a('0x8d'));}if(_[_0x851a('0x78')](_0x485022[_0x851a('0x56')][_0x851a('0x56')])||_0x485022['body'][_0x851a('0x56')]===''){throw new db[(_0x851a('0x8c'))][(_0x851a('0x8e'))](_0x851a('0x8f'));}if(_[_0x851a('0x78')](_0x485022[_0x851a('0x56')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39e8a5);}if(!_[_0x851a('0x90')](_0x39e8a5,_0x485022[_0x851a('0x56')][_0x851a('0x91')])){throw new db[(_0x851a('0x8c'))][(_0x851a('0x8e'))](_0x851a('0x92')+_0x39e8a5);}_0x437c62[_0x485022[_0x851a('0x56')][_0x851a('0x91')]]=_0x485022['body'][_0x851a('0x8b')];})[_0x851a('0x15')](function(){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x485022[_0x851a('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x851a('0x84')],'as':_0x851a('0x93'),'where':_0x437c62,'limit':0x1,'order':[[_0x851a('0x87'),_0x851a('0x94')]]}]},{'model':db[_0x851a('0x95')],'as':_0x851a('0x96')}]});})[_0x851a('0x15')](handleEntityNotFound(_0x153b7c,null))[_0x851a('0x15')](function(_0xa1b06b){if(_0xa1b06b&&_0xa1b06b['List']){_0x57b5f8[_0x851a('0x97')]=_0xa1b06b;_0x57b5f8[_0x851a('0x98')]=_0xa1b06b[_0x851a('0x96')];_0x57b5f8[_0x851a('0x99')]=_0xa1b06b[_0x851a('0x9a')];_0x57b5f8[_0x851a('0x98')]=_[_0x851a('0x9b')](_0x57b5f8[_0x851a('0x98')],[_0x851a('0x9c')],['asc']);if(_0x57b5f8['account'][_0x851a('0x96')]){delete _0x57b5f8[_0x851a('0x97')][_0x851a('0x96')];}if(_0x57b5f8[_0x851a('0x97')][_0x851a('0x9a')]&&_0x57b5f8[_0x851a('0x97')]['List'][_0x851a('0x93')][_0x851a('0x4e')]){return _0x57b5f8[_0x851a('0x97')][_0x851a('0x9a')][_0x851a('0x93')][0x0];}var _0x3d4b3d=_[_0x851a('0xd')](_0x485022[_0x851a('0x56')],{'firstName':_0x485022['body']['from'],'ListId':_0xa1b06b[_0x851a('0x8a')]});_0x3d4b3d[_0x485022['body'][_0x851a('0x91')]]=_0x485022[_0x851a('0x56')][_0x851a('0x8b')];return db[_0x851a('0x84')]['create'](_0x3d4b3d,{'fields':_0x266472,'raw':!![]});}})[_0x851a('0x15')](handleEntityNotFound(_0x153b7c,null))[_0x851a('0x15')](function(_0x306de5){_0x57b5f8['contact']=_0x306de5;var _0x251cb1=_0x485022[_0x851a('0x56')]['customerIp'];if(_0x485022[_0x851a('0x9d')]['cf-connecting-ip']){_0x251cb1=_0x485022['headers'][_0x851a('0x9e')];}else if(_0x485022[_0x851a('0x9d')]['x-forwarded-for']){_0x251cb1=_[_0x851a('0x9f')](_0x485022[_0x851a('0x9d')]['x-forwarded-for'][_0x851a('0xa0')](','));}if(_0x306de5){var _0x1eecb9={'ContactId':_0x306de5['id'],'ChatWebsiteId':_0x485022[_0x851a('0x57')]['id'],'from':(_0x306de5[_0x851a('0xa1')]||'')+'\x20'+(_0x306de5[_0x851a('0xa2')]||''),'customerIp':_0x251cb1,'customerPort':_0x485022['headers'][_0x851a('0xa3')]?_0x485022['headers'][_0x851a('0xa3')]:null,'referer':_0x485022['body'][_0x851a('0xa4')],'browserName':_0x2c088a[_0x851a('0xa5')][_0x851a('0x38')]&&_0x2c088a[_0x851a('0xa5')][_0x851a('0xa6')]?util[_0x851a('0xa7')](_0x851a('0xa8'),_0x2c088a[_0x851a('0xa5')][_0x851a('0x38')],_0x2c088a[_0x851a('0xa5')]['version']):_0x851a('0xa9'),'browserVersion':_0x2c088a[_0x851a('0xa5')][_0x851a('0xa6')]||_0x851a('0xa9'),'osName':util['format'](_0x851a('0xa8'),_0x2c088a['os']['name'],_0x2c088a['os'][_0x851a('0xa6')]),'osVersion':_0x2c088a['os'][_0x851a('0xa6')],'deviceModel':_0x2c088a[_0x851a('0xaa')][_0x851a('0x3c')]&&_0x2c088a['device'][_0x851a('0xab')]?util[_0x851a('0xa7')]('%s\x20%s\x20%s',_0x2c088a[_0x851a('0xaa')][_0x851a('0x3c')],_0x2c088a['device'][_0x851a('0xab')],_0x2c088a[_0x851a('0xaa')]['type']):null,'deviceVendor':_0x2c088a['device'][_0x851a('0xab')],'deviceType':_0x2c088a[_0x851a('0xaa')]['type'],'formData':JSON[_0x851a('0x1b')](_0x485022[_0x851a('0x56')])};var _0x157781={'ChatWebsiteId':_0x485022[_0x851a('0x57')]['id'],'closed':![]};if(_0x485022[_0x851a('0x56')][_0x851a('0xac')]){_0x157781['threadId']=_0x485022[_0x851a('0x56')][_0x851a('0xac')];return db[_0x851a('0xad')][_0x851a('0x4f')]({'where':_0x157781})['then'](function(_0x4f5b34){if(_0x4f5b34){return[_0x4f5b34,![]];}_0x1eecb9[_0x851a('0xac')]=_0x485022[_0x851a('0x56')][_0x851a('0xac')];_0x1eecb9[_0x851a('0xae')]=_0x485022['body'][_0x851a('0xae')];return db['ChatInteraction'][_0x851a('0x50')](_0x1eecb9)[_0x851a('0x15')](function(_0x405a15){return[_0x405a15,!![]];});});}_0x157781[_0x851a('0xaf')]=_0x306de5['id'];if(_0x485022[_0x851a('0x56')][_0x851a('0xb0')]&&_0x485022['body'][_0x851a('0xb0')]['id']){_0x157781['id']=_0x485022[_0x851a('0x56')][_0x851a('0xb0')]['id'];return db[_0x851a('0xad')][_0x851a('0x4f')]({'where':_0x157781})[_0x851a('0x15')](function(_0x369a90){if(_0x369a90){return[_0x369a90,![]];}return db[_0x851a('0xad')][_0x851a('0x50')](_0x1eecb9)[_0x851a('0x15')](function(_0x36a9f3){return[_0x36a9f3,!![]];});});}return db[_0x851a('0xad')][_0x851a('0x50')](_0x1eecb9)[_0x851a('0x15')](function(_0x3f3317){return[_0x3f3317,!![]];});}})[_0x851a('0xb1')](function(_0x241ed0,_0x207718){if(_0x241ed0){_0x4379c6=_0x207718;if(!_0x207718){var _0x11c762={'from':(_0x57b5f8[_0x851a('0xb2')][_0x851a('0xa1')]||'')+'\x20'+(_0x57b5f8[_0x851a('0xb2')][_0x851a('0xa2')]||'')};if(_0x485022[_0x851a('0x56')][_0x851a('0xac')]&&_0x485022['body'][_0x851a('0xb3')]&&_0x485022[_0x851a('0x56')][_0x851a('0xac')]!=_0x485022[_0x851a('0x56')][_0x851a('0xb3')]){_0x11c762[_0x851a('0xac')]=_0x485022[_0x851a('0x56')][_0x851a('0xb3')];}return _0x241ed0['update'](_0x11c762);}else{return _0x241ed0;}}})['then'](function(_0x4ad7df){_0x57b5f8['interaction']=_0x4ad7df['get']({'plain':!![]});_0x57b5f8['interaction'][_0x851a('0xb4')]=_0x4379c6;if(_0x57b5f8['interaction'][_0x851a('0xb4')]){if(_0x57b5f8[_0x851a('0x97')][_0x851a('0xb5')]){_0x57b5f8[_0x851a('0x98')]['push']({'id':0x0,'priority':_0x57b5f8[_0x851a('0x98')][_0x851a('0x4e')]+0x1,'app':_0x851a('0xb6'),'appdata':'unmanaged','interval':_0x851a('0xb7')});}}return db['ChatMessage']['create']({'body':_0x485022['body']['body'],'ChatWebsiteId':_0x485022[_0x851a('0x57')]['id'],'ChatInteractionId':_0x4ad7df['id'],'direction':'in','ContactId':_0x57b5f8[_0x851a('0xb2')]['id'],'AttachmentId':_0x485022[_0x851a('0x56')][_0x851a('0xb8')]});})[_0x851a('0x15')](function(_0x5adf26){_0x57b5f8['message']=_0x5adf26;if(_0x57b5f8[_0x851a('0xb0')][_0x851a('0xb9')]){return db[_0x851a('0xba')][_0x851a('0x4f')]({'attributes':['id',_0x851a('0x38')],'where':{'id':_0x57b5f8[_0x851a('0xb0')][_0x851a('0xb9')]}})[_0x851a('0x15')](function(_0x3b944d){if(_0x3b944d){_0x57b5f8[_0x851a('0x98')][_0x851a('0xbb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3b944d['name']+','+(_0x57b5f8[_0x851a('0x97')][_0x851a('0xbc')]||0xa),'interval':_0x851a('0xb7')});_0x57b5f8[_0x851a('0xbd')]=!![];}return respondWithRpcPromise(_0x851a('0xbe'),_0x851a('0xbf'),_0x57b5f8);});}return respondWithRpcPromise('Start',_0x851a('0xbf'),_0x57b5f8);})[_0x851a('0x15')](function(_0x33171e){respondWithRpcPromise(_0x851a('0xc0'),_0x851a('0xc0'),{'event':'notify','message':_0x33171e},client9002);return _0x33171e;})[_0x851a('0x15')](respondWithResult(_0x153b7c,null))[_0x851a('0x20')](handleError(_0x153b7c,null));};exports[_0x851a('0xc1')]=function(_0x3540bc,_0x493f72){var _0x5c7ae0,_0x489175,_0x53cc62;var _0x28be31=[];var _0x2f283e={};var _0x1bf607=_0x3540bc[_0x851a('0xc2')]||[];var _0x2ee0dc=[];var _0x56f6aa;return db[_0x851a('0x84')][_0x851a('0x58')]()[_0x851a('0x15')](function(_0x434deb){if(!_0x434deb){throw new db[(_0x851a('0x8c'))]['ValidationError'](_0x851a('0x85'));}_0x28be31=_['difference'](_[_0x851a('0x39')](_0x434deb),['createdAt',_0x851a('0x87'),'CompanyId',_0x851a('0x8a')]);if(_0x3540bc['body']['id']){delete _0x3540bc[_0x851a('0x56')]['id'];}if(_[_0x851a('0x78')](_0x3540bc[_0x851a('0x56')]['from'])){throw _0x493f72[_0x851a('0x22')](0x1f4)[_0x851a('0x30')](new db[(_0x851a('0x8c'))][(_0x851a('0x8e'))]('from\x20is\x20mandatory'));}if(_[_0x851a('0x78')](_0x3540bc[_0x851a('0x56')][_0x851a('0x56')])||_0x3540bc[_0x851a('0x56')]['body']===''){throw _0x493f72[_0x851a('0x22')](0x1f4)[_0x851a('0x30')](new db['Sequelize'][(_0x851a('0x8e'))](_0x851a('0x8f')));}if(_[_0x851a('0x78')](_0x3540bc[_0x851a('0x56')]['mapKeyOffline'])){throw _0x493f72[_0x851a('0x22')](0x1f4)[_0x851a('0x30')](new db[(_0x851a('0x8c'))][(_0x851a('0x8e'))](_0x851a('0xc3')+_0x28be31));}if(!_[_0x851a('0x90')](_0x28be31,_0x3540bc[_0x851a('0x56')][_0x851a('0xc4')])){throw _0x493f72['status'](0x1f4)[_0x851a('0x30')](new db[(_0x851a('0x8c'))]['ValidationError'](_0x851a('0xc5')+_0x28be31));}_0x2f283e[_0x3540bc[_0x851a('0x56')][_0x851a('0xc4')]]=_0x3540bc[_0x851a('0x56')][_0x851a('0x8b')];})[_0x851a('0x15')](function(){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x3540bc[_0x851a('0x57')]['id']},'include':[{'model':db[_0x851a('0xc6')],'as':'List'},{'model':db[_0x851a('0xc7')],'as':'MailAccount'}]});})[_0x851a('0x15')](handleEntityNotFound(_0x493f72,null))['then'](function(_0x45900d){if(_0x45900d&&_0x45900d[_0x851a('0x9a')]){_0x489175=_0x45900d;var _0x5dca45=_[_0x851a('0xd')](_0x3540bc[_0x851a('0x56')],{'firstName':_0x3540bc['body'][_0x851a('0x8b')],'phone':_0x3540bc[_0x851a('0x56')][_0x851a('0x8b')],'ListId':_0x45900d[_0x851a('0x8a')]});_0x5dca45[_0x3540bc[_0x851a('0x56')][_0x851a('0xc4')]]=_0x3540bc['body']['from'];return db[_0x851a('0x84')][_0x851a('0xc8')]({'where':_0x2f283e,'defaults':_0x5dca45});}})['spread'](function(_0x6ec71a){if(_0x6ec71a){_0x53cc62=_0x6ec71a;var _0x1deee7=fs['readFileSync'](path[_0x851a('0x70')](config[_0x851a('0x71')],'server/files/templates/chatOfflineMessage.ejs'),_0x851a('0xc9'));var _0x413f22=ejs[_0x851a('0xca')](_0x1deee7,{'body':_[_0x851a('0xcb')](_0x3540bc['body'][_0x851a('0x56')]),'bodyTitle':_0x489175[_0x851a('0xcc')]});return db[_0x851a('0xcd')][_0x851a('0x50')]({'body':_0x413f22,'plainBody':htmlToText[_0x851a('0xce')](_0x413f22),'ContactId':_0x6ec71a['id'],'ChatWebsiteId':_0x489175['id']});}})[_0x851a('0x15')](function(_0x1fa089){_0x56f6aa=_0x1fa089;if(_0x1bf607['length']){var _0x4332cb=_0x1bf607[_0x851a('0x37')](function(_0x55d87f){return{'name':_0x55d87f[_0x851a('0xcf')],'basename':_0x55d87f[_0x851a('0x6b')],'type':_0x55d87f[_0x851a('0xd0')],'ChatOfflineMessageId':_0x1fa089['id']};});_0x2ee0dc=_0x4332cb['map'](_0x1c6da2=>{var _0x4278b2={'filename':_0x1c6da2[_0x851a('0x38')],'path':path[_0x851a('0x70')](config[_0x851a('0x71')],'server',_0x851a('0xc2'),_0x851a('0xd1'),_0x851a('0xd2'),_0x1c6da2[_0x851a('0xd3')])};return _0x4278b2;});if(!_0x489175[_0x851a('0xd4')]){return db[_0x851a('0xd5')]['transaction'](function(_0x5bfb02){return db[_0x851a('0xd6')][_0x851a('0xd7')](_0x4332cb,{'transaction':_0x5bfb02});});}}})[_0x851a('0x15')](function(){if(_0x56f6aa){_0x5c7ae0=_0x56f6aa;return db[_0x851a('0xc7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x851a('0xd8')],'as':_0x851a('0xd9'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0x851a('0x15')](function(_0x303bf1){if(_0x303bf1&&_0x303bf1['Smtp']&&_0x489175['forwardOffline']&&_0x489175[_0x851a('0xda')]){var _0x95ce8=_0x303bf1[_0x851a('0xdb')]();return respondWithRpcPromise('SendMail',_0x851a('0xdc'),{'account':_0x95ce8,'message':{'from':util[_0x851a('0xa7')](_0x851a('0xdd'),_0x303bf1[_0x851a('0x38')],_0x303bf1[_0x851a('0xde')]||_0x303bf1['Smtp'][_0x851a('0x51')]),'to':_0x489175['forwardOfflineAddress'],'subject':_0x489175['offlineMessageSubject'],'html':_0x5c7ae0[_0x851a('0x56')],'attachments':_0x2ee0dc}},client9003)[_0x851a('0x15')](function(){return _0x5c7ae0;})[_0x851a('0x20')](function(_0x3a01a1){logger[_0x851a('0x1c')](_0x3a01a1);});}})[_0x851a('0x15')](function(){if(_0x489175&&_0x489175[_0x851a('0xd4')]&&_0x489175[_0x851a('0xdf')]){var _0x41c958=[];if(_0x1bf607[_0x851a('0x4e')]){_0x41c958=_0x1bf607[_0x851a('0x37')](function(_0x49ca12){return{'name':_0x49ca12[_0x851a('0xcf')],'basename':_0x49ca12[_0x851a('0x6b')],'type':_0x49ca12['mimetype'],'ChatOfflineMessageId':_0x56f6aa['id']};});}var _0x3c453b;if(!_['isNil'](_0x489175[_0x851a('0xe0')])){var _0x7dece0=_[_0x851a('0x37')](_0x3540bc[_0x851a('0x56')],function(_0x137577){return _0x137577;});var _0x45884f=_[_0x851a('0xe1')](_0x7dece0)[0x0];var _0x3004ae=_[_0x851a('0xe2')](_0x45884f,function(_0x134142){return _0x134142;});_0x3c453b=_0x3004ae[0x1][_0x489175['subjectOffline']];}var _0x177eaf={'from':_0x53cc62[_0x851a('0xde')],'firstName':_0x53cc62['firstName'],'lastName':_0x53cc62[_0x851a('0xa2')],'mapKey':_0x851a('0xde'),'message':{'from':_0x53cc62[_0x851a('0xde')],'to':_0x489175[_0x851a('0xc7')][_0x851a('0xde')],'cc':'','subject':_[_0x851a('0x78')](_0x3c453b)?_0x489175[_0x851a('0xe3')]:_0x3c453b,'messageId':'','sentAt':new Date(),'attach':_0x41c958[_0x851a('0x4e')],'attachments':_0x41c958,'originChannel':_0x851a('0xe4'),'ChatWebsiteId':_0x489175['id'],'ChatOfflineMessageId':_0x5c7ae0['id'],'originTo':_0x489175[_0x851a('0xc7')]['email']},'body':_0x5c7ae0[_0x851a('0x56')]};var _0x3d2fac={'account':{'id':_0x489175['MailAccountId']},'body':_0x177eaf,'log':_0x851a('0xe5')};return respondWithRpcPromise(_0x851a('0xe5'),_0x851a('0xe6'),_0x3d2fac,client9001)[_0x851a('0x15')](function(){return _0x5c7ae0;})[_0x851a('0x20')](function(_0x35acdf){logger[_0x851a('0x1c')](_0x35acdf);});}return;})['then'](function(){if(_0x5c7ae0){return _0x5c7ae0;}})['then'](respondWithResult(_0x493f72,null))[_0x851a('0x20')](function(_0xa998d3){logger[_0x851a('0x1c')]('catch',_0xa998d3);for(var _0x578d87 of _0x1bf607){var _0x3a0919=path[_0x851a('0x70')](config['root'],_0x851a('0xe7'),_0x851a('0xc2'),_0x851a('0xd1'),'offline-chat',_0x578d87[_0x851a('0x6b')]);fs_extra[_0x851a('0xe8')](_0x3a0919)['catch'](function(_0x514e7c){logger[_0x851a('0x1c')](_0x851a('0xe9'),_0x3a0919,_0x514e7c);});}});};exports[_0x851a('0xea')]=function(_0x151492,_0x2607d3){return db[_0x851a('0xad')][_0x851a('0x4f')]({'where':{'id':_0x151492[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x2607d3,null))[_0x851a('0x15')](function(_0x50396a){if(_0x50396a){return _0x50396a[_0x851a('0xea')](_0x151492[_0x851a('0x56')]['ids'],_['omit'](_0x151492[_0x851a('0x56')],[_0x851a('0x65'),'id'])||{});}})[_0x851a('0x15')](respondWithResult(_0x2607d3,null))[_0x851a('0x20')](handleError(_0x2607d3,null));};exports[_0x851a('0xeb')]=function(_0x339004,_0x42e7e4){var _0x428df0={'raw':![],'where':{}};var _0x29b289={};var _0x4ddb16={'count':0x0,'rows':[]};return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x339004[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x42e7e4,null))['then'](function(_0x55ae16){if(_0x55ae16){_0x29b289[_0x851a('0x3c')]=_['keys'](db[_0x851a('0xad')][_0x851a('0x34')]);_0x29b289['query']=_[_0x851a('0x39')](_0x339004['query']);_0x29b289['filters']=_['intersection'](_0x29b289[_0x851a('0x3c')],_0x29b289[_0x851a('0x3d')]);_0x428df0[_0x851a('0x3f')]=_[_0x851a('0x3b')](_0x29b289['model'],qs['fields'](_0x339004[_0x851a('0x3d')][_0x851a('0x3e')]));_0x428df0[_0x851a('0x3f')]=_0x428df0[_0x851a('0x3f')][_0x851a('0x4e')]?_0x428df0['attributes']:_0x29b289[_0x851a('0x3c')];if(!_0x339004[_0x851a('0x3d')][_0x851a('0x5e')](_0x851a('0x40'))){_0x428df0[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x339004[_0x851a('0x3d')][_0x851a('0x27')]);_0x428df0['offset']=qs[_0x851a('0x25')](_0x339004['query']['offset']);}_0x428df0[_0x851a('0x41')]=qs['sort'](_0x339004[_0x851a('0x3d')][_0x851a('0x42')]);_0x428df0[_0x851a('0x43')]=qs[_0x851a('0x3a')](_[_0x851a('0x5f')](_0x339004['query'],_0x29b289[_0x851a('0x3a')]));_0x428df0[_0x851a('0x43')][_0x851a('0x5a')]=_0x55ae16['id'];if(_0x339004['query'][_0x851a('0x47')]){_0x428df0['where']=_['merge'](_0x428df0[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x428df0[_0x851a('0x3f')],function(_0x409ef3){var _0x1d7c71={};_0x1d7c71[_0x409ef3]={'$like':'%'+_0x339004[_0x851a('0x3d')][_0x851a('0x47')]+'%'};return _0x1d7c71;})});}_0x428df0=_[_0x851a('0x44')]({},_0x428df0,_0x339004[_0x851a('0x48')]);return db[_0x851a('0xad')][_0x851a('0x28')]({'where':_0x428df0[_0x851a('0x43')]})['then'](function(_0x59dd8f){_0x4ddb16['count']=_0x59dd8f;if(_0x339004[_0x851a('0x3d')][_0x851a('0x63')]){_0x428df0[_0x851a('0x4a')]=[{'model':db['CmContact'],'as':_0x851a('0xec'),'required':![]},{'model':db['User'],'as':_0x851a('0xed'),'attributes':[_0x851a('0x38'),'fullname',_0x851a('0xee')],'required':![]},{'model':db['Tag'],'as':_0x851a('0xef'),'attributes':['id','name',_0x851a('0xf0')],'where':_0x339004[_0x851a('0x3d')][_0x851a('0xf1')]?{'id':_0x339004['query']['tag']}:undefined,'required':_0x339004[_0x851a('0x3d')]['tag']?!![]:![]}];}return db[_0x851a('0xad')][_0x851a('0x4b')](_0x428df0);})[_0x851a('0x15')](function(_0x3ce82f){_0x4ddb16['rows']=_0x3ce82f;return _0x4ddb16;});}})['then'](respondWithFilteredResult(_0x42e7e4,_0x428df0))[_0x851a('0x20')](handleError(_0x42e7e4,null));};function iftimePromise(_0x2d91f2,_0x2044e8){return respondWithRpcPromise(_0x851a('0xf2'),_0x851a('0xf3'),{'command':_0x2044e8[_0x851a('0xf4')]?util['format'](_0x851a('0xf5'),_0x2d91f2[_0x851a('0xf6')],_0x2044e8['timezone']):util[_0x851a('0xa7')]('iftime\x20%s',_0x2d91f2[_0x851a('0xf6')])},client9002)[_0x851a('0x15')](function(_0x535150){var _0x5cedb2=_0x535150&&_0x535150[_0x851a('0xf7')](_0x851a('0xf8'))>=0x0?!![]:![];logger[_0x851a('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2044e8['id'],_0x2d91f2['id'],_0x2d91f2[_0x851a('0xf6')],_0x5cedb2?_0x851a('0xf9'):_0x851a('0xfa'),_0x2044e8[_0x851a('0xf4')]?_0x2044e8[_0x851a('0xf4')]:_0x851a('0xfb'));return _0x5cedb2;})[_0x851a('0x20')](function(_0x3c3e72){logger[_0x851a('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2044e8['id'],_0x2d91f2['id'],_0x2d91f2[_0x851a('0xf6')],util['inspect'](_0x3c3e72,{'showHidden':![],'depth':null}),_0x2044e8[_0x851a('0xf4')]?_0x2044e8[_0x851a('0xf4')]:_0x851a('0xfb'));return![];});}exports[_0x851a('0xf3')]=function(_0x7101ea,_0x3bd222){var _0x130c19=0x0;var _0x20d54a=0x0;var _0x52bb61=![];var _0x3142df;var _0x57d064;return db[_0x851a('0x49')]['find']({'where':{'id':_0x7101ea[_0x851a('0x57')]['id']},'include':[{'model':db[_0x851a('0xfc')],'as':'Interval','include':[{'model':db[_0x851a('0xfc')],'as':'Intervals','attributes':['id',_0x851a('0xf6')],'raw':!![]}]}]})[_0x851a('0x15')](handleEntityNotFound(_0x3bd222,null))[_0x851a('0x15')](function(_0x544878){if(_0x544878){_0x3142df=_0x544878;return _0x544878[_0x851a('0xfd')]({'raw':!![]});}})[_0x851a('0x15')](function(_0x3c7773){if(_0x3142df){if(_0x3c7773){_0x57d064=_0x3c7773;}}return require(_0x851a('0xfe'))[_0x851a('0x73')]();})[_0x851a('0x15')](function(_0x325a6){if(_0x325a6){_0x20d54a=_0x325a6[_0x851a('0xff')];_0x52bb61=_0x325a6[_0x851a('0x100')];}})[_0x851a('0x15')](function(){return db[_0x851a('0xad')][_0x851a('0x28')]({'where':{'closed':![]}});})['then'](function(_0x3d10fd){_0x130c19=_0x3d10fd;if(_0x20d54a&&_0x3d10fd>_0x20d54a){return db['License'][_0x851a('0x5d')]({'where':{'id':0x1}})['then'](function(_0x3c2f7){if(_0x3c2f7){_0x3c2f7['increment'](_0x851a('0x101'));}});}})[_0x851a('0x15')](function(){if(_0x3142df[_0x851a('0xfc')]&&_0x3142df[_0x851a('0xfc')][_0x851a('0x102')]){var _0x48dce4=[];for(var _0x5cc5ae=0x0;_0x5cc5ae<_0x3142df[_0x851a('0xfc')][_0x851a('0x102')]['length'];_0x5cc5ae++){var _0x3f06eb=_0x3142df[_0x851a('0xfc')]['Intervals'][_0x5cc5ae]['get']({'plain':!![]});_0x48dce4[_0x851a('0x103')](iftimePromise(_0x3f06eb,_0x3142df));}return BPromise[_0x851a('0x104')](_0x48dce4)[_0x851a('0x15')](function(_0x474daf){return _[_0x851a('0x105')](_0x474daf);});}else{return!![];}})[_0x851a('0x15')](function(_0x1179bf){var _0x14ea2b=fs[_0x851a('0x106')](path[_0x851a('0x70')](config[_0x851a('0x71')],_0x851a('0x107')),'utf8');var _0x28ac85=new url[(_0x851a('0x108'))](_0x3142df['address'])['origin'];var _0x2bd4cd=_0x851a('0x109');var _0x4a1ca7=![];var _0xac4d12={'chatVersion':_0x2bd4cd,'chatWebsiteAddressOrigin':_0x28ac85,'remote':_0x3142df['remote'],'query':querystring[_0x851a('0x1b')](_['merge'](_0x3142df[_0x851a('0x2b')]({'plain':!![]}),{'customerIp':_0x7101ea['headers'][_0x851a('0x10a')]||_0x7101ea['headers'][_0x851a('0x10b')]||_0x7101ea['connection']['remoteAddress']||_0x7101ea['ip'],'referer':_0x7101ea['headers'][_0x851a('0xa4')],'openedInteractions':_0x130c19,'maxInteractions':_0x20d54a,'virtual':_0x52bb61[_0x851a('0xff')],'online':_0x1179bf,'custom':_0x52bb61}))[_0x851a('0x10c')](/'/g,'\x5c\x27')};_0x3bd222['send'](ejs[_0x851a('0xca')](Mustache[_0x851a('0xca')](_0x14ea2b,_0xac4d12),{'proactiveActions':_0x57d064,'alignment':_0x3142df[_0x851a('0x10d')],'verticalAlignment':_0x3142df[_0x851a('0x10e')],'div_color':_0x3142df[_0x851a('0xf0')],'labelText':_0x3142df[_0x851a('0x10f')],'text_color':_0x3142df[_0x851a('0x110')],'text_button_color':_0x3142df[_0x851a('0x111')],'button_color':_0x3142df['color_button'],'background_color':_0x3142df['backgroundColor'],'hideWhenOffline':_0x3142df[_0x851a('0x112')],'intervalId':_0x3142df[_0x851a('0x113')],'isDevelopment':_0x4a1ca7,'chatVersion':_0x2bd4cd}));})[_0x851a('0x20')](handleError(_0x3bd222,null));};exports[_0x851a('0x114')]=function(_0x3917ba,_0xacdbb2){var _0x39456c=_0x3917ba[_0x851a('0x57')]['id'];var _0x2df645=_0x3917ba[_0x851a('0x56')];var _0x8d688f=0xc8;var _0x4f3dd5=null;return db[_0x851a('0xd5')][_0x851a('0x115')]({'isolationLevel':db[_0x851a('0xd5')][_0x851a('0x116')][_0x851a('0x117')][_0x851a('0x118')]},function(_0x52db77){return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x39456c},'transaction':_0x52db77})[_0x851a('0x15')](function(_0x27690f){if(_0x27690f){return db[_0x851a('0x95')]['destroy']({'where':{'ChatWebsiteId':_0x39456c},'transaction':_0x52db77})[_0x851a('0x15')](function(){var _0x326d43=_[_0x851a('0x37')](_0x2df645,function(_0x1321c9){_0x1321c9[_0x851a('0x5a')]=_0x39456c;return _0x1321c9;});return db[_0x851a('0x95')][_0x851a('0xd7')](_0x326d43,{'transaction':_0x52db77});});}else{_0x8d688f=0x194;_0x4f3dd5=[];}});})[_0x851a('0x15')](function(){if(_0x8d688f!==0x194){return db[_0x851a('0x95')][_0x851a('0x119')]({'where':{'ChatWebsiteId':_0x39456c},'order':_0x851a('0x9c')})[_0x851a('0x15')](function(_0x4e5758){_0x4f3dd5=_0x4e5758;});}})[_0x851a('0x20')](function(_0x1eaeb0){_0x8d688f=0x1f4;logger[_0x851a('0x1c')](_0x1eaeb0[_0x851a('0x2f')]);if(_0x1eaeb0[_0x851a('0x38')]){delete _0x1eaeb0[_0x851a('0x38')];}_0x4f3dd5=_0x1eaeb0;})[_0x851a('0x11a')](function(){if(_0x4f3dd5===null){_0xacdbb2[_0x851a('0x21')](_0x8d688f);}else{if(_0x8d688f===0x1f4){_0xacdbb2[_0x851a('0x22')](_0x8d688f)[_0x851a('0x30')](_0x4f3dd5);}else{_0xacdbb2[_0x851a('0x22')](_0x8d688f)['json'](_0x4f3dd5);}}});};exports[_0x851a('0x11b')]=function(_0x3f8bc7,_0x4e6468){var _0xea7707={};var _0x28f4d2={};var _0x271f28;var _0x41fedf;return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x3f8bc7[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x4e6468,null))[_0x851a('0x15')](function(_0x144777){if(_0x144777){_0x271f28=_0x144777;_0x28f4d2['model']=_[_0x851a('0x39')](db[_0x851a('0x95')][_0x851a('0x34')]);_0x28f4d2['query']=_[_0x851a('0x39')](_0x3f8bc7[_0x851a('0x3d')]);_0x28f4d2[_0x851a('0x3a')]=_[_0x851a('0x3b')](_0x28f4d2[_0x851a('0x3c')],_0x28f4d2[_0x851a('0x3d')]);_0xea7707[_0x851a('0x3f')]=_['intersection'](_0x28f4d2[_0x851a('0x3c')],qs[_0x851a('0x3e')](_0x3f8bc7[_0x851a('0x3d')][_0x851a('0x3e')]));_0xea7707[_0x851a('0x3f')]=_0xea7707['attributes'][_0x851a('0x4e')]?_0xea7707['attributes']:_0x28f4d2[_0x851a('0x3c')];_0xea7707[_0x851a('0x41')]=qs['sort'](_0x3f8bc7[_0x851a('0x3d')]['sort']);_0xea7707[_0x851a('0x43')]=qs['filters'](_[_0x851a('0x5f')](_0x3f8bc7[_0x851a('0x3d')],_0x28f4d2['filters']));if(_0x3f8bc7[_0x851a('0x3d')]['filter']){_0xea7707[_0x851a('0x43')]=_[_0x851a('0x44')](_0xea7707[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0xea7707[_0x851a('0x3f')],function(_0x26cd55){var _0x3c6de7={};_0x3c6de7[_0x26cd55]={'$like':'%'+_0x3f8bc7[_0x851a('0x3d')][_0x851a('0x47')]+'%'};return _0x3c6de7;})});}_0xea7707=_[_0x851a('0x44')]({},_0xea7707,_0x3f8bc7[_0x851a('0x48')]);return _0x271f28[_0x851a('0x11b')](_0xea7707);}})[_0x851a('0x15')](function(_0x1e393c){if(_0x1e393c){_0x41fedf=_0x1e393c[_0x851a('0x4e')];if(!_0x3f8bc7['query']['hasOwnProperty'](_0x851a('0x40'))){_0xea7707[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x3f8bc7['query'][_0x851a('0x27')]);_0xea7707[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x3f8bc7['query']['offset']);}return _0x271f28[_0x851a('0x11b')](_0xea7707);}})[_0x851a('0x15')](function(_0x34643a){if(_0x34643a){return _0x34643a?{'count':_0x41fedf,'rows':_0x34643a}:null;}})[_0x851a('0x15')](respondWithResult(_0x4e6468,null))[_0x851a('0x20')](handleError(_0x4e6468,null));};exports['addProactiveActions']=function(_0x46b996,_0x2b12c0){return db[_0x851a('0x11c')][_0x851a('0x4f')]({'where':{'id':_0x46b996[_0x851a('0x57')]['id']}})['then'](handleEntityNotFound(_0x2b12c0,null))[_0x851a('0x15')](function(_0x53a030){if(_0x53a030){return _0x53a030[_0x851a('0x11d')](_0x46b996[_0x851a('0x56')][_0x851a('0x65')],_[_0x851a('0x11e')](_0x46b996[_0x851a('0x56')],[_0x851a('0x65'),'id'])||{});}})[_0x851a('0x15')](respondWithResult(_0x2b12c0,null))[_0x851a('0x20')](handleError(_0x2b12c0,null));};exports['getProactiveActions']=function(_0x35d70a,_0xab74fb){var _0x324395={};var _0x18c479={};var _0x5b922b;var _0x2c22e5;return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x35d70a[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0xab74fb,null))[_0x851a('0x15')](function(_0x484a37){if(_0x484a37){_0x5b922b=_0x484a37;_0x18c479[_0x851a('0x3c')]=_[_0x851a('0x39')](db['ChatProactiveAction'][_0x851a('0x34')]);_0x18c479['query']=_[_0x851a('0x39')](_0x35d70a['query']);_0x18c479[_0x851a('0x3a')]=_[_0x851a('0x3b')](_0x18c479[_0x851a('0x3c')],_0x18c479[_0x851a('0x3d')]);_0x324395[_0x851a('0x3f')]=_['intersection'](_0x18c479['model'],qs[_0x851a('0x3e')](_0x35d70a[_0x851a('0x3d')][_0x851a('0x3e')]));_0x324395['attributes']=_0x324395[_0x851a('0x3f')][_0x851a('0x4e')]?_0x324395[_0x851a('0x3f')]:_0x18c479[_0x851a('0x3c')];_0x324395[_0x851a('0x41')]=qs[_0x851a('0x42')](_0x35d70a[_0x851a('0x3d')][_0x851a('0x42')]);_0x324395['where']=qs[_0x851a('0x3a')](_['pick'](_0x35d70a[_0x851a('0x3d')],_0x18c479[_0x851a('0x3a')]));if(_0x35d70a[_0x851a('0x3d')][_0x851a('0x47')]){_0x324395['where']=_[_0x851a('0x44')](_0x324395[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x324395[_0x851a('0x3f')],function(_0x5c3e02){var _0x4bdb71={};_0x4bdb71[_0x5c3e02]={'$like':'%'+_0x35d70a['query']['filter']+'%'};return _0x4bdb71;})});}_0x324395=_[_0x851a('0x44')]({},_0x324395,_0x35d70a[_0x851a('0x48')]);return _0x5b922b[_0x851a('0xfd')](_0x324395);}})[_0x851a('0x15')](function(_0x53851a){if(_0x53851a){_0x2c22e5=_0x53851a[_0x851a('0x4e')];if(!_0x35d70a[_0x851a('0x3d')][_0x851a('0x5e')](_0x851a('0x40'))){_0x324395[_0x851a('0x27')]=qs[_0x851a('0x27')](_0x35d70a['query']['limit']);_0x324395[_0x851a('0x25')]=qs['offset'](_0x35d70a[_0x851a('0x3d')][_0x851a('0x25')]);}return _0x5b922b[_0x851a('0xfd')](_0x324395);}})[_0x851a('0x15')](function(_0x1e9126){if(_0x1e9126){return _0x1e9126?{'count':_0x2c22e5,'rows':_0x1e9126}:null;}})[_0x851a('0x15')](respondWithResult(_0xab74fb,null))[_0x851a('0x20')](handleError(_0xab74fb,null));};exports[_0x851a('0x11f')]=function(_0x463123,_0x1dc255){var _0x28e51d=_0x463123[_0x851a('0x3d')]['online']===_0x851a('0x120')?_0x851a('0x121'):_0x851a('0x122');return db[_0x851a('0x49')][_0x851a('0x4f')]({'attributes':['id',_0x28e51d],'where':{'id':_0x463123[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x1dc255,null))['then'](function(_0x14abaf){if(_0x14abaf){var _0x76a32a=_0x14abaf[_0x28e51d];var _0x5afbec=_0x76a32a&&_0x76a32a[_0x851a('0x123')]?_0x76a32a[_0x851a('0x123')]:[];_0x1dc255[_0x851a('0x30')]({'fromKey':_[_0x851a('0x78')](_0x76a32a['fromKey'])?undefined:_0x76a32a[_0x851a('0x124')],'count':_0x5afbec[_0x851a('0x4e')],'rows':_0x5afbec});}})['catch'](handleError(_0x1dc255,null));};exports['getOfflineMessages']=function(_0x3368d6,_0x292391){var _0x330c86={'raw':![],'where':{}};var _0x781b29={};var _0x2350fb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x851a('0x5d')]({'where':{'id':_0x3368d6['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x292391,null))[_0x851a('0x15')](function(_0x98e3b3){if(_0x98e3b3){_0x781b29['model']=_[_0x851a('0x39')](db[_0x851a('0xcd')][_0x851a('0x34')]);_0x781b29['query']=_[_0x851a('0x39')](_0x3368d6[_0x851a('0x3d')]);_0x781b29[_0x851a('0x3a')]=_[_0x851a('0x3b')](_0x781b29[_0x851a('0x3c')],_0x781b29[_0x851a('0x3d')]);_0x330c86[_0x851a('0x3f')]=_[_0x851a('0x3b')](_0x781b29['model'],qs[_0x851a('0x3e')](_0x3368d6['query'][_0x851a('0x3e')]));_0x330c86['attributes']=_0x330c86['attributes'][_0x851a('0x4e')]?_0x330c86[_0x851a('0x3f')]:_0x781b29[_0x851a('0x3c')];if(!_0x3368d6[_0x851a('0x3d')][_0x851a('0x5e')]('nolimit')){_0x330c86['limit']=qs[_0x851a('0x27')](_0x3368d6['query'][_0x851a('0x27')]);_0x330c86[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x3368d6['query']['offset']);}_0x330c86['order']=qs['sort'](_0x3368d6[_0x851a('0x3d')][_0x851a('0x42')]);_0x330c86[_0x851a('0x43')]=qs[_0x851a('0x3a')](_[_0x851a('0x5f')](_0x3368d6[_0x851a('0x3d')],_0x781b29[_0x851a('0x3a')]));_0x330c86['where']['ChatWebsiteId']=_0x98e3b3['id'];if(_0x3368d6['query'][_0x851a('0x47')]){_0x330c86[_0x851a('0x43')]=_[_0x851a('0x44')](_0x330c86[_0x851a('0x43')],{'$or':_[_0x851a('0x37')](_0x330c86[_0x851a('0x3f')],function(_0x309d6d){var _0x3753fc={};_0x3753fc[_0x309d6d]={'$like':'%'+_0x3368d6[_0x851a('0x3d')][_0x851a('0x47')]+'%'};return _0x3753fc;})});}_0x330c86=_[_0x851a('0x44')]({},_0x330c86,_0x3368d6[_0x851a('0x48')]);return db['ChatOfflineMessage']['count']({'where':_0x330c86[_0x851a('0x43')]})[_0x851a('0x15')](function(_0x403225){_0x2350fb[_0x851a('0x28')]=_0x403225;if(_0x3368d6['query'][_0x851a('0x63')]){_0x330c86[_0x851a('0x4a')]=[{'all':!![]}];}else{_0x330c86['include']=[{'model':db['CmContact'],'as':_0x851a('0xec'),'required':![]},{'model':db[_0x851a('0xd6')],'as':_0x851a('0x125'),'required':![]}];}return db[_0x851a('0xcd')][_0x851a('0x4b')](_0x330c86);})[_0x851a('0x15')](function(_0x292154){_0x2350fb[_0x851a('0x4c')]=_0x292154;return _0x2350fb;});}})[_0x851a('0x15')](respondWithFilteredResult(_0x292391,_0x330c86))[_0x851a('0x20')](handleError(_0x292391,null));};exports['addAgents']=function(_0x4beedf,_0x541ab6){return db[_0x851a('0x49')][_0x851a('0x4f')]({'where':{'id':_0x4beedf[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x541ab6,null))[_0x851a('0x15')](function(_0x28c869){if(_0x28c869){return _0x28c869[_0x851a('0x126')](_0x4beedf[_0x851a('0x56')][_0x851a('0x65')],_[_0x851a('0x11e')](_0x4beedf[_0x851a('0x56')],[_0x851a('0x65'),'id'])||{})[_0x851a('0xb1')](function(_0x29f3e3){for(var _0x2ae8eb=0x0;_0x2ae8eb<_0x4beedf[_0x851a('0x56')][_0x851a('0x65')]['length'];_0x2ae8eb+=0x1){socket[_0x851a('0x127')](_0x851a('0x128'),{'UserId':Number(_0x4beedf['body'][_0x851a('0x65')][_0x2ae8eb]),'ChatWebsiteId':Number(_0x4beedf['params']['id'])});}return _0x29f3e3;});}})[_0x851a('0x15')](respondWithResult(_0x541ab6,null))['catch'](handleError(_0x541ab6,null));};exports[_0x851a('0x129')]=function(_0x441c98,_0x13765e){return db[_0x851a('0x49')]['find']({'where':{'id':_0x441c98[_0x851a('0x57')]['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x13765e,null))[_0x851a('0x15')](function(_0x43f5c7){if(_0x43f5c7){return _0x43f5c7['removeAgents'](_0x441c98['query'][_0x851a('0x65')])[_0x851a('0x15')](function(){if(_['isArray'](_0x441c98[_0x851a('0x3d')][_0x851a('0x65')])){for(var _0x19d809=0x0;_0x19d809<_0x441c98[_0x851a('0x3d')][_0x851a('0x65')][_0x851a('0x4e')];_0x19d809+=0x1){socket['emit'](_0x851a('0x12a'),{'UserId':Number(_0x441c98[_0x851a('0x3d')][_0x851a('0x65')][_0x19d809]),'ChatWebsiteId':Number(_0x441c98['params']['id'])});}}else{socket[_0x851a('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x441c98[_0x851a('0x3d')]['ids']),'ChatWebsiteId':Number(_0x441c98[_0x851a('0x57')]['id'])});}});}})[_0x851a('0x15')](respondWithStatusCode(_0x13765e,null))[_0x851a('0x20')](handleError(_0x13765e,null));};exports[_0x851a('0x12b')]=function(_0x2af7b8,_0x107a14){var _0x41a840={};var _0x5f064c={};var _0x190650;var _0x1c7ce3;return db[_0x851a('0x49')][_0x851a('0x5d')]({'where':{'id':_0x2af7b8['params']['id']}})[_0x851a('0x15')](handleEntityNotFound(_0x107a14,null))['then'](function(_0x3471d6){if(_0x3471d6){_0x190650=_0x3471d6;_0x5f064c[_0x851a('0x3c')]=_['keys'](db[_0x851a('0xba')]['rawAttributes']);_0x5f064c[_0x851a('0x3d')]=_['keys'](_0x2af7b8[_0x851a('0x3d')]);_0x5f064c['filters']=_['intersection'](_0x5f064c[_0x851a('0x3c')],_0x5f064c[_0x851a('0x3d')]);_0x41a840[_0x851a('0x3f')]=_[_0x851a('0x3b')](_0x5f064c[_0x851a('0x3c')],qs['fields'](_0x2af7b8['query'][_0x851a('0x3e')]));_0x41a840[_0x851a('0x3f')]=_0x41a840[_0x851a('0x3f')][_0x851a('0x4e')]?_0x41a840['attributes']:_0x5f064c[_0x851a('0x3c')];_0x41a840[_0x851a('0x41')]=qs[_0x851a('0x42')](_0x2af7b8[_0x851a('0x3d')]['sort']);_0x41a840['where']=qs['filters'](_[_0x851a('0x5f')](_0x2af7b8[_0x851a('0x3d')],_0x5f064c[_0x851a('0x3a')]));if(_0x2af7b8[_0x851a('0x3d')][_0x851a('0x47')]){_0x41a840[_0x851a('0x43')]=_[_0x851a('0x44')](_0x41a840['where'],{'$or':_[_0x851a('0x37')](_0x41a840[_0x851a('0x3f')],function(_0x246479){var _0x24e759={};_0x24e759[_0x246479]={'$like':'%'+_0x2af7b8[_0x851a('0x3d')]['filter']+'%'};return _0x24e759;})});}_0x41a840=_[_0x851a('0x44')]({},_0x41a840,_0x2af7b8['options']);return _0x190650[_0x851a('0x12b')](_0x41a840);}})[_0x851a('0x15')](function(_0x1b79c1){if(_0x1b79c1){_0x1c7ce3=_0x1b79c1[_0x851a('0x4e')];if(!_0x2af7b8['query']['hasOwnProperty'](_0x851a('0x40'))){_0x41a840['limit']=qs[_0x851a('0x27')](_0x2af7b8['query'][_0x851a('0x27')]);_0x41a840[_0x851a('0x25')]=qs[_0x851a('0x25')](_0x2af7b8['query']['offset']);}return _0x190650[_0x851a('0x12b')](_0x41a840);}})[_0x851a('0x15')](function(_0x2707cb){if(_0x2707cb){return _0x2707cb?{'count':_0x1c7ce3,'rows':_0x2707cb}:null;}})['then'](respondWithResult(_0x107a14,null))[_0x851a('0x20')](handleError(_0x107a14,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 2d9767d..77cfca9 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 _0x3937=['ChatWebsite','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5e27a9,_0x5b1ba9){var _0x19f5cd=function(_0x2b6dfd){while(--_0x2b6dfd){_0x5e27a9['push'](_0x5e27a9['shift']());}};_0x19f5cd(++_0x5b1ba9);}(_0x3937,0xbf));var _0x7393=function(_0x2d23a9,_0x4abd2a){_0x2d23a9=_0x2d23a9-0x0;var _0x305d43=_0x3937[_0x2d23a9];return _0x305d43;};'use strict';var EventEmitter=require(_0x7393('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7393('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7393('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7393('0x3'),'afterDestroy':'remove'};function emitEvent(_0x224468){return function(_0x4c9c71,_0x992b15,_0x2790e6){ChatWebsiteEvents[_0x7393('0x4')](_0x224468+':'+_0x4c9c71['id'],_0x4c9c71);ChatWebsiteEvents[_0x7393('0x4')](_0x224468,_0x4c9c71);_0x2790e6(null);};}for(var e in events){if(events[_0x7393('0x5')](e)){var event=events[e];ChatWebsite[_0x7393('0x6')](e,emitEvent(event));}}module[_0x7393('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x6631=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1a209f,_0x1b35e6){var _0x376b56=function(_0x5ed729){while(--_0x5ed729){_0x1a209f['push'](_0x1a209f['shift']());}};_0x376b56(++_0x1b35e6);}(_0x6631,0x134));var _0x1663=function(_0x4cf818,_0x3e74b2){_0x4cf818=_0x4cf818-0x0;var _0x414c5e=_0x6631[_0x4cf818];return _0x414c5e;};'use strict';var EventEmitter=require(_0x1663('0x0'));var ChatWebsite=require(_0x1663('0x1'))['db'][_0x1663('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1663('0x3')](0x0);var events={'afterCreate':_0x1663('0x4'),'afterUpdate':_0x1663('0x5'),'afterDestroy':'remove'};function emitEvent(_0x492d72){return function(_0x1e2fcc,_0x232bfe,_0x2b5af7){ChatWebsiteEvents[_0x1663('0x6')](_0x492d72+':'+_0x1e2fcc['id'],_0x1e2fcc);ChatWebsiteEvents[_0x1663('0x6')](_0x492d72,_0x1e2fcc);_0x2b5af7(null);};}for(var e in events){if(events[_0x1663('0x7')](e)){var event=events[e];ChatWebsite[_0x1663('0x8')](e,emitEvent(event));}}module[_0x1663('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index b06b2f0..2f989a0 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 _0x754c=['exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x5c814d,_0x4d81c7){var _0x89b71=function(_0x1068a4){while(--_0x1068a4){_0x5c814d['push'](_0x5c814d['shift']());}};_0x89b71(++_0x4d81c7);}(_0x754c,0x16c));var _0xc754=function(_0x17df31,_0x447094){_0x17df31=_0x17df31-0x0;var _0x2553ef=_0x754c[_0x17df31];return _0x2553ef;};'use strict';var _=require(_0xc754('0x0'));var util=require(_0xc754('0x1'));var logger=require(_0xc754('0x2'))(_0xc754('0x3'));var moment=require(_0xc754('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc754('0x5'));var rimraf=require(_0xc754('0x6'));var config=require(_0xc754('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xc754('0x8')]=function(_0x4383d2,_0x1db434){return _0x4383d2[_0xc754('0x9')](_0xc754('0xa'),attributes,{'tableName':_0xc754('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbba9=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','lodash'];(function(_0x5b135a,_0x5402b2){var _0x5dd0d8=function(_0x167bed){while(--_0x167bed){_0x5b135a['push'](_0x5b135a['shift']());}};_0x5dd0d8(++_0x5402b2);}(_0xbba9,0x121));var _0x9bba=function(_0xcd20e,_0xd4e78e){_0xcd20e=_0xcd20e-0x0;var _0x8e2f3c=_0xbba9[_0xcd20e];return _0x8e2f3c;};'use strict';var _=require(_0x9bba('0x0'));var util=require('util');var logger=require(_0x9bba('0x1'))('api');var moment=require(_0x9bba('0x2'));var BPromise=require(_0x9bba('0x3'));var rp=require(_0x9bba('0x4'));var fs=require('fs');var path=require(_0x9bba('0x5'));var rimraf=require('rimraf');var config=require(_0x9bba('0x6'));var attributes=require(_0x9bba('0x7'));module[_0x9bba('0x8')]=function(_0x5a720a,_0x60688a){return _0x5a720a['define'](_0x9bba('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 53eabcf..0391355 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 _0xd67e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x196645,_0x1eb82d){var _0x390133=function(_0x5d222e){while(--_0x5d222e){_0x196645['push'](_0x196645['shift']());}};_0x390133(++_0x1eb82d);}(_0xd67e,0x1ef));var _0xed67=function(_0x1b15dd,_0x375fd7){_0x1b15dd=_0x1b15dd-0x0;var _0x2334a4=_0xd67e[_0x1b15dd];return _0x2334a4;};'use strict';var _=require('lodash');var util=require(_0xed67('0x0'));var moment=require(_0xed67('0x1'));var BPromise=require(_0xed67('0x2'));var rs=require(_0xed67('0x3'));var fs=require('fs');var Redis=require(_0xed67('0x4'));var db=require(_0xed67('0x5'))['db'];var utils=require(_0xed67('0x6'));var logger=require(_0xed67('0x7'))(_0xed67('0x8'));var config=require(_0xed67('0x9'));var jayson=require(_0xed67('0xa'));var client=jayson[_0xed67('0xb')][_0xed67('0xc')]({'port':0x232a});config['redis']=_[_0xed67('0xd')](config[_0xed67('0xe')],{'host':_0xed67('0xf'),'port':0x18eb});var socket=require(_0xed67('0x10'))(new Redis(config['redis']));require(_0xed67('0x11'))[_0xed67('0x12')](socket);function respondWithRpcPromise(_0x1d741e,_0xbd694f,_0x2b08ac){return new BPromise(function(_0x2c0b61,_0x2dc93b){return client[_0xed67('0x13')](_0x1d741e,_0x2b08ac)[_0xed67('0x14')](function(_0x49671d){logger[_0xed67('0x15')](_0xed67('0x16'),_0xbd694f,_0xed67('0x17'));logger['debug'](_0xed67('0x18'),_0xbd694f,_0xed67('0x17'),JSON[_0xed67('0x19')](_0x49671d));if(_0x49671d[_0xed67('0x1a')]){if(_0x49671d['error'][_0xed67('0x1b')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xbd694f,_0x49671d[_0xed67('0x1a')][_0xed67('0x1c')]);return _0x2dc93b(_0x49671d['error'][_0xed67('0x1c')]);}logger[_0xed67('0x1a')](_0xed67('0x16'),_0xbd694f,_0x49671d['error'][_0xed67('0x1c')]);return _0x2c0b61(_0x49671d[_0xed67('0x1a')][_0xed67('0x1c')]);}else{logger['info'](_0xed67('0x16'),_0xbd694f,'request\x20sent');_0x2c0b61(_0x49671d[_0xed67('0x1d')][_0xed67('0x1c')]);}})[_0xed67('0x1e')](function(_0x50ba59){logger[_0xed67('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0xbd694f,_0x50ba59);_0x2dc93b(_0x50ba59);});});} \ No newline at end of file +var _0x3569=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x1af362,_0x3e13a8){var _0x278343=function(_0x27148a){while(--_0x27148a){_0x1af362['push'](_0x1af362['shift']());}};_0x278343(++_0x3e13a8);}(_0x3569,0x140));var _0x9356=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x3569[_0x45d1fd];return _0xd0e542;};'use strict';var _=require(_0x9356('0x0'));var util=require(_0x9356('0x1'));var moment=require(_0x9356('0x2'));var BPromise=require(_0x9356('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9356('0x4'))['db'];var utils=require(_0x9356('0x5'));var logger=require('../../config/logger')(_0x9356('0x6'));var config=require(_0x9356('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9356('0x8')][_0x9356('0x9')]({'port':0x232a});config[_0x9356('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9356('0xb'))(new Redis(config['redis']));require(_0x9356('0xc'))[_0x9356('0xd')](socket);function respondWithRpcPromise(_0x113d86,_0x32551f,_0x40ffdb){return new BPromise(function(_0x2e641a,_0x3edb6a){return client[_0x9356('0xe')](_0x113d86,_0x40ffdb)[_0x9356('0xf')](function(_0x3b7a7c){logger[_0x9356('0x10')](_0x9356('0x11'),_0x32551f,_0x9356('0x12'));logger[_0x9356('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x32551f,_0x9356('0x12'),JSON[_0x9356('0x14')](_0x3b7a7c));if(_0x3b7a7c[_0x9356('0x15')]){if(_0x3b7a7c[_0x9356('0x15')][_0x9356('0x16')]===0x1f4){logger['error'](_0x9356('0x11'),_0x32551f,_0x3b7a7c[_0x9356('0x15')][_0x9356('0x17')]);return _0x3edb6a(_0x3b7a7c[_0x9356('0x15')][_0x9356('0x17')]);}logger[_0x9356('0x15')](_0x9356('0x11'),_0x32551f,_0x3b7a7c['error'][_0x9356('0x17')]);return _0x2e641a(_0x3b7a7c[_0x9356('0x15')][_0x9356('0x17')]);}else{logger[_0x9356('0x10')](_0x9356('0x11'),_0x32551f,_0x9356('0x12'));_0x2e641a(_0x3b7a7c[_0x9356('0x18')][_0x9356('0x17')]);}})[_0x9356('0x19')](function(_0x4fd53f){logger[_0x9356('0x15')](_0x9356('0x11'),_0x32551f,_0x4fd53f);_0x3edb6a(_0x4fd53f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index eebe294..90487b0 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 _0x2b56=['save','remove','update','emit','register','length','chatWebsite:','./chatWebsite.events'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2b56,0x12f));var _0x62b5=function(_0x1e93a0,_0x5441ae){_0x1e93a0=_0x1e93a0-0x0;var _0x547dc7=_0x2b56[_0x1e93a0];return _0x547dc7;};'use strict';var ChatWebsiteEvents=require(_0x62b5('0x0'));var events=[_0x62b5('0x1'),_0x62b5('0x2'),_0x62b5('0x3')];function createListener(_0x3352ea,_0xaf2edf){return function(_0x501d51){_0xaf2edf[_0x62b5('0x4')](_0x3352ea,_0x501d51);};}function removeListener(_0x555139,_0x572911){return function(){ChatWebsiteEvents['removeListener'](_0x555139,_0x572911);};}exports[_0x62b5('0x5')]=function(_0x227ab3){for(var _0x3a0627=0x0,_0x2a2a0b=events[_0x62b5('0x6')];_0x3a0627<_0x2a2a0b;_0x3a0627++){var _0x4260b4=events[_0x3a0627];var _0xae9419=createListener(_0x62b5('0x7')+_0x4260b4,_0x227ab3);ChatWebsiteEvents['on'](_0x4260b4,_0xae9419);}}; \ No newline at end of file +var _0x204e=['register','length','chatWebsite:','save','remove','update','emit','removeListener'];(function(_0x1dbc31,_0x4c550c){var _0x256e5b=function(_0xc511bc){while(--_0xc511bc){_0x1dbc31['push'](_0x1dbc31['shift']());}};_0x256e5b(++_0x4c550c);}(_0x204e,0x10b));var _0xe204=function(_0x1f0ba3,_0xd0d300){_0x1f0ba3=_0x1f0ba3-0x0;var _0x370c4b=_0x204e[_0x1f0ba3];return _0x370c4b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xe204('0x0'),_0xe204('0x1'),_0xe204('0x2')];function createListener(_0x1cbab1,_0x54affd){return function(_0x2b20c0){_0x54affd[_0xe204('0x3')](_0x1cbab1,_0x2b20c0);};}function removeListener(_0x1d3f19,_0x5d6d99){return function(){ChatWebsiteEvents[_0xe204('0x4')](_0x1d3f19,_0x5d6d99);};}exports[_0xe204('0x5')]=function(_0x267a0e){for(var _0x5ae7d5=0x0,_0x39953c=events[_0xe204('0x6')];_0x5ae7d5<_0x39953c;_0x5ae7d5++){var _0x2f40f2=events[_0x5ae7d5];var _0x3b911b=createListener(_0xe204('0x7')+_0x2f40f2,_0x267a0e);ChatWebsiteEvents['on'](_0x2f40f2,_0x3b911b);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 4522f3e..0882dcc 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 _0xe241=['%s-%s','now','originalname','single','file','addLogo','diskStorage','root','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','offline','/:id/interactions','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','server/files/images/logos/'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xe241,0xb4));var _0x1e24=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xe241[_0x12f688];return _0x59c3de;};'use strict';var multer=require(_0x1e24('0x0'));var util=require(_0x1e24('0x1'));var path=require(_0x1e24('0x2'));var timeout=require(_0x1e24('0x3'));var express=require(_0x1e24('0x4'));var router=express['Router']();var fs_extra=require(_0x1e24('0x5'));var auth=require(_0x1e24('0x6'));var interaction=require(_0x1e24('0x7'));var config=require(_0x1e24('0x8'));var controller=require('./chatWebsite.controller');router[_0x1e24('0x9')]('/',auth[_0x1e24('0xa')](),controller['index']);router[_0x1e24('0x9')]('/describe',auth[_0x1e24('0xa')](),controller[_0x1e24('0xb')]);router[_0x1e24('0x9')](_0x1e24('0xc'),auth[_0x1e24('0xa')](),controller['show']);router[_0x1e24('0x9')](_0x1e24('0xd'),auth[_0x1e24('0xa')](),controller[_0x1e24('0xe')]);router[_0x1e24('0x9')](_0x1e24('0xf'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x10')]);router[_0x1e24('0x9')](_0x1e24('0x11'),controller[_0x1e24('0x12')]);router[_0x1e24('0x9')](_0x1e24('0x13'),controller[_0x1e24('0x14')]);router[_0x1e24('0x9')]('/:id/customer_avatar',controller[_0x1e24('0x15')]);router[_0x1e24('0x9')](_0x1e24('0x16'),controller[_0x1e24('0x17')]);router[_0x1e24('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x1e24('0x18')]);router[_0x1e24('0x9')](_0x1e24('0x19'),controller[_0x1e24('0x1a')]);router[_0x1e24('0x9')](_0x1e24('0x1b'),auth['isAuthenticated'](),controller[_0x1e24('0x1c')]);router['get']('/:id/proactive_actions',auth[_0x1e24('0xa')](),controller[_0x1e24('0x1d')]);router[_0x1e24('0x9')]('/:id/fields',controller['getFields']);router[_0x1e24('0x9')]('/:id/offline_messages',auth[_0x1e24('0xa')](),controller[_0x1e24('0x1e')]);router[_0x1e24('0x9')](_0x1e24('0x1f'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x20')]);router[_0x1e24('0x21')]('/',auth[_0x1e24('0xa')](),controller[_0x1e24('0x22')]);router[_0x1e24('0x21')](_0x1e24('0xd'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x23')]);router['post'](_0x1e24('0xf'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x7be99c,_0x468872,_0x5a4c91){_0x5a4c91(null,path[_0x1e24('0x25')](config['root'],_0x1e24('0x26')));},'filename':function(_0x13ef1e,_0x1eb2b9,_0x5abbe3){_0x5abbe3(null,util['format'](_0x1e24('0x27'),Date[_0x1e24('0x28')](),_0x1eb2b9[_0x1e24('0x29')]));}})});router[_0x1e24('0x21')]('/:id/logo',upload[_0x1e24('0x2a')](_0x1e24('0x2b')),controller[_0x1e24('0x2c')]);var upload=multer({'storage':multer[_0x1e24('0x2d')]({'destination':function(_0x5ddf04,_0x4bd746,_0x51472f){_0x51472f(null,path[_0x1e24('0x25')](config[_0x1e24('0x2e')],_0x1e24('0x2f')));},'filename':function(_0x227e75,_0x358ccc,_0x487ab2){_0x487ab2(null,util[_0x1e24('0x30')](_0x1e24('0x27'),Date[_0x1e24('0x28')](),_0x358ccc[_0x1e24('0x29')]));}})});router[_0x1e24('0x21')](_0x1e24('0x13'),upload[_0x1e24('0x2a')]('file'),controller[_0x1e24('0x31')]);var upload=multer({'storage':multer[_0x1e24('0x2d')]({'destination':function(_0xc039fc,_0x2ef0fe,_0x5a8520){_0x5a8520(null,path[_0x1e24('0x25')](config['root'],_0x1e24('0x2f')));},'filename':function(_0x1392c0,_0xd27bb1,_0x5cecf7){_0x5cecf7(null,util[_0x1e24('0x30')](_0x1e24('0x27'),Date[_0x1e24('0x28')](),_0xd27bb1[_0x1e24('0x29')]));}})});router[_0x1e24('0x21')](_0x1e24('0x32'),upload[_0x1e24('0x2a')](_0x1e24('0x2b')),controller[_0x1e24('0x33')]);var upload=multer({'storage':multer[_0x1e24('0x2d')]({'destination':function(_0x571a54,_0x9c8685,_0x3f2016){_0x3f2016(null,path[_0x1e24('0x25')](config[_0x1e24('0x2e')],_0x1e24('0x2f')));},'filename':function(_0x3901a3,_0x551397,_0x9f30f){_0x9f30f(null,util[_0x1e24('0x30')](_0x1e24('0x27'),Date['now'](),_0x551397[_0x1e24('0x29')]));}})});router[_0x1e24('0x21')](_0x1e24('0x16'),upload[_0x1e24('0x2a')](_0x1e24('0x2b')),controller[_0x1e24('0x34')]);router[_0x1e24('0x21')]('/:id/notify',controller[_0x1e24('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x1e24('0x2d')]({'destination':function(_0x340011,_0x152527,_0x4da43c){const _0x2cf3c8=path['join'](config['root'],_0x1e24('0x36'),_0x1e24('0x37'),_0x1e24('0x38'));fs_extra[_0x1e24('0x39')](_0x2cf3c8,function(){_0x4da43c(null,_0x2cf3c8);});},'filename':function(_0x2e5aea,_0x2ca00b,_0x5cd1a1){const _0x22ff42=_0x2ca00b[_0x1e24('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x253127=path[_0x1e24('0x3a')](_0x22ff42);const _0x34a8fd=Date[_0x1e24('0x28')]()+'-'+_0x22ff42[_0x1e24('0x3b')](_0x253127,'')+_0x253127;_0x5cd1a1(null,_0x34a8fd);}})});router[_0x1e24('0x21')](_0x1e24('0x3c'),offlineUploadMulter['any'](),controller[_0x1e24('0x3d')]);router[_0x1e24('0x21')](_0x1e24('0x3e'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x3f')]);router['post'](_0x1e24('0x1b'),auth[_0x1e24('0xa')](),controller['addApplications']);router['post'](_0x1e24('0x40'),auth['isAuthenticated'](),controller[_0x1e24('0x41')]);router[_0x1e24('0x21')](_0x1e24('0x1f'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x42')]);router['put'](_0x1e24('0xc'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x43')]);router[_0x1e24('0x44')](_0x1e24('0xc'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x45')]);router[_0x1e24('0x44')](_0x1e24('0xd'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x46')]);router[_0x1e24('0x44')](_0x1e24('0xf'),auth[_0x1e24('0xa')](),controller[_0x1e24('0x47')]);router['delete']('/:id/users',auth[_0x1e24('0xa')](),controller['removeAgents']);module[_0x1e24('0x48')]=router; \ No newline at end of file +var _0x4b98=['removeDispositions','removeAnswers','removeAgents','path','connect-timeout','express','../../config/environment','./chatWebsite.controller','isAuthenticated','/describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','create','post','addAnswer','diskStorage','join','format','%s-%s','now','originalname','single','file','addLogo','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','/:id','update','delete'];(function(_0x2ec40b,_0x59a29c){var _0x28ba77=function(_0x7e5046){while(--_0x7e5046){_0x2ec40b['push'](_0x2ec40b['shift']());}};_0x28ba77(++_0x59a29c);}(_0x4b98,0xcc));var _0x84b9=function(_0x136ed6,_0x1df16d){_0x136ed6=_0x136ed6-0x0;var _0x3bbfb9=_0x4b98[_0x136ed6];return _0x3bbfb9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x84b9('0x0'));var timeout=require(_0x84b9('0x1'));var express=require(_0x84b9('0x2'));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(_0x84b9('0x3'));var controller=require(_0x84b9('0x4'));router['get']('/',auth[_0x84b9('0x5')](),controller['index']);router['get'](_0x84b9('0x6'),auth[_0x84b9('0x5')](),controller['describe']);router[_0x84b9('0x7')]('/:id',auth[_0x84b9('0x5')](),controller[_0x84b9('0x8')]);router[_0x84b9('0x7')](_0x84b9('0x9'),auth[_0x84b9('0x5')](),controller[_0x84b9('0xa')]);router['get'](_0x84b9('0xb'),auth[_0x84b9('0x5')](),controller['getAnswers']);router['get'](_0x84b9('0xc'),controller[_0x84b9('0xd')]);router[_0x84b9('0x7')](_0x84b9('0xe'),controller[_0x84b9('0xf')]);router['get'](_0x84b9('0x10'),controller[_0x84b9('0x11')]);router[_0x84b9('0x7')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x84b9('0x7')](_0x84b9('0x12'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x13')]);router[_0x84b9('0x7')](_0x84b9('0x14'),controller[_0x84b9('0x15')]);router[_0x84b9('0x7')](_0x84b9('0x16'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x17')]);router[_0x84b9('0x7')](_0x84b9('0x18'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x19')]);router[_0x84b9('0x7')](_0x84b9('0x1a'),controller[_0x84b9('0x1b')]);router[_0x84b9('0x7')]('/:id/offline_messages',auth[_0x84b9('0x5')](),controller['getOfflineMessages']);router[_0x84b9('0x7')](_0x84b9('0x1c'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x1d')]);router['post']('/',auth[_0x84b9('0x5')](),controller[_0x84b9('0x1e')]);router[_0x84b9('0x1f')](_0x84b9('0x9'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x84b9('0x1f')](_0x84b9('0xb'),auth['isAuthenticated'](),controller[_0x84b9('0x20')]);var upload=multer({'storage':multer[_0x84b9('0x21')]({'destination':function(_0x24423a,_0x5ad94a,_0x11841d){_0x11841d(null,path[_0x84b9('0x22')](config['root'],'server/files/images/logos/'));},'filename':function(_0x23d6ca,_0x94cf27,_0x6bf1c){_0x6bf1c(null,util[_0x84b9('0x23')](_0x84b9('0x24'),Date[_0x84b9('0x25')](),_0x94cf27[_0x84b9('0x26')]));}})});router[_0x84b9('0x1f')](_0x84b9('0xc'),upload[_0x84b9('0x27')](_0x84b9('0x28')),controller[_0x84b9('0x29')]);var upload=multer({'storage':multer[_0x84b9('0x21')]({'destination':function(_0x42bc95,_0x583620,_0xeacb71){_0xeacb71(null,path[_0x84b9('0x22')](config[_0x84b9('0x2a')],_0x84b9('0x2b')));},'filename':function(_0x253d7f,_0xfa1cfe,_0x469855){_0x469855(null,util['format']('%s-%s',Date[_0x84b9('0x25')](),_0xfa1cfe['originalname']));}})});router[_0x84b9('0x1f')](_0x84b9('0xe'),upload[_0x84b9('0x27')](_0x84b9('0x28')),controller[_0x84b9('0x2c')]);var upload=multer({'storage':multer[_0x84b9('0x21')]({'destination':function(_0x31d400,_0x146733,_0x51ab53){_0x51ab53(null,path[_0x84b9('0x22')](config['root'],_0x84b9('0x2b')));},'filename':function(_0x566072,_0x57456c,_0x1199f6){_0x1199f6(null,util[_0x84b9('0x23')]('%s-%s',Date[_0x84b9('0x25')](),_0x57456c[_0x84b9('0x26')]));}})});router[_0x84b9('0x1f')](_0x84b9('0x10'),upload[_0x84b9('0x27')](_0x84b9('0x28')),controller[_0x84b9('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32387d,_0x4ae5ac,_0x2bdd98){_0x2bdd98(null,path['join'](config[_0x84b9('0x2a')],_0x84b9('0x2b')));},'filename':function(_0x3e7cbf,_0x3af292,_0x397a10){_0x397a10(null,util[_0x84b9('0x23')](_0x84b9('0x24'),Date[_0x84b9('0x25')](),_0x3af292[_0x84b9('0x26')]));}})});router['post']('/:id/system_avatar',upload[_0x84b9('0x27')](_0x84b9('0x28')),controller[_0x84b9('0x2e')]);router['post'](_0x84b9('0x2f'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x84b9('0x21')]({'destination':function(_0x8a4624,_0x313dbf,_0x1209c4){const _0x167054=path[_0x84b9('0x22')](config[_0x84b9('0x2a')],_0x84b9('0x30'),_0x84b9('0x31'),_0x84b9('0x32'));fs_extra[_0x84b9('0x33')](_0x167054,function(){_0x1209c4(null,_0x167054);});},'filename':function(_0xb850a1,_0x3fc44a,_0x1ad198){const _0x27c6bd=_0x3fc44a[_0x84b9('0x26')][_0x84b9('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x320587=path[_0x84b9('0x35')](_0x27c6bd);const _0x313a82=Date[_0x84b9('0x25')]()+'-'+_0x27c6bd[_0x84b9('0x34')](_0x320587,'')+_0x320587;_0x1ad198(null,_0x313a82);}})});router[_0x84b9('0x1f')](_0x84b9('0x36'),offlineUploadMulter[_0x84b9('0x37')](),controller[_0x84b9('0x38')]);router[_0x84b9('0x1f')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x84b9('0x39')]);router['post'](_0x84b9('0x16'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x3a')]);router[_0x84b9('0x1f')](_0x84b9('0x18'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x3b')]);router[_0x84b9('0x1f')](_0x84b9('0x1c'),auth['isAuthenticated'](),controller[_0x84b9('0x3c')]);router['put'](_0x84b9('0x3d'),auth['isAuthenticated'](),controller[_0x84b9('0x3e')]);router['delete']('/:id',auth[_0x84b9('0x5')](),controller['destroy']);router[_0x84b9('0x3f')](_0x84b9('0x9'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x40')]);router[_0x84b9('0x3f')](_0x84b9('0xb'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x41')]);router[_0x84b9('0x3f')](_0x84b9('0x1c'),auth[_0x84b9('0x5')](),controller[_0x84b9('0x42')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index f96171e..ee3c922 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 _0x33bb=['env','production','app','get','/client-logs','exports','express','../components/auth/service','../config/environment','Router'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x33bb,0x146));var _0xb33b=function(_0x3a37e9,_0x43a872){_0x3a37e9=_0x3a37e9-0x0;var _0x52c511=_0x33bb[_0x3a37e9];return _0x52c511;};var beaverLogger=require('beaver-logger/server');var express=require(_0xb33b('0x0'));var auth=require(_0xb33b('0x1'));var config=require(_0xb33b('0x2'));var router=express[_0xb33b('0x3')]();var isProduction=config[_0xb33b('0x4')]===_0xb33b('0x5')||![];function clientSideLogs(_0x14d7c2,_0xee7e07,_0x489c2b){var _0x5ee235=_0x14d7c2[_0xb33b('0x6')][_0xb33b('0x7')]('client-side-logger');if(!_0x5ee235){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0xb33b('0x8'),'logger':_0x5ee235,'enableCors':!isProduction})(_0x14d7c2,_0xee7e07,_0x489c2b);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xb33b('0x9')]=router; \ No newline at end of file +var _0x6a33=['client-side-logger','Client-Side\x20logger\x20not\x20found!','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','production','app','get'];(function(_0x45b858,_0x25b131){var _0x5304cd=function(_0x795c6c){while(--_0x795c6c){_0x45b858['push'](_0x45b858['shift']());}};_0x5304cd(++_0x25b131);}(_0x6a33,0x171));var _0x36a3=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x6a33[_0x87b0ff];return _0x3bc0b2;};var beaverLogger=require(_0x36a3('0x0'));var express=require(_0x36a3('0x1'));var auth=require(_0x36a3('0x2'));var config=require(_0x36a3('0x3'));var router=express[_0x36a3('0x4')]();var isProduction=config['env']===_0x36a3('0x5')||![];function clientSideLogs(_0x4f5fbf,_0x1b0a7b,_0x65d9a9){var _0x239233=_0x4f5fbf[_0x36a3('0x6')][_0x36a3('0x7')](_0x36a3('0x8'));if(!_0x239233){throw new Error(_0x36a3('0x9'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x239233,'enableCors':!isProduction})(_0x4f5fbf,_0x1b0a7b,_0x65d9a9);}router[_0x36a3('0xa')](auth[_0x36a3('0xb')](),clientSideLogs);module[_0x36a3('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 4d36d71..86f82b6 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 _0x57a9=['STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x165e31,_0x166578){var _0x125a6b=function(_0x2fc2b7){while(--_0x2fc2b7){_0x165e31['push'](_0x165e31['shift']());}};_0x125a6b(++_0x166578);}(_0x57a9,0xe8));var _0x957a=function(_0x3fb3a4,_0x3cdca7){_0x3fb3a4=_0x3fb3a4-0x0;var _0x269599=_0x57a9[_0x3fb3a4];return _0x269599;};'use strict';var Sequelize=require(_0x957a('0x0'));module[_0x957a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x957a('0x2')](_0x957a('0x3'),_0x957a('0x4'),_0x957a('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x957a('0x6'),_0x957a('0x7'))},'data1':{'type':Sequelize[_0x957a('0x8')],'comment':_0x957a('0x9')},'data2':{'type':Sequelize[_0x957a('0x8')],'comment':_0x957a('0xa')},'data3':{'type':Sequelize[_0x957a('0x8')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x957a('0x8')],'comment':_0x957a('0xb')},'data5':{'type':Sequelize[_0x957a('0xc')],'comment':_0x957a('0xd')},'data6':{'type':Sequelize[_0x957a('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x957a('0xc')],'comment':_0x957a('0xe')}}; \ No newline at end of file +var _0xff01=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x2fb6c7,_0xe46307){var _0x38b589=function(_0x53edf8){while(--_0x53edf8){_0x2fb6c7['push'](_0x2fb6c7['shift']());}};_0x38b589(++_0xe46307);}(_0xff01,0xa1));var _0x1ff0=function(_0x3a3538,_0x1e2c65){_0x3a3538=_0x3a3538-0x0;var _0x34fcf7=_0xff01[_0x3a3538];return _0x34fcf7;};'use strict';var Sequelize=require(_0x1ff0('0x0'));module[_0x1ff0('0x1')]={'name':{'type':Sequelize[_0x1ff0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1ff0('0x3')](_0x1ff0('0x4'),'Google',_0x1ff0('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1ff0('0x3')](_0x1ff0('0x6'),_0x1ff0('0x7'))},'data1':{'type':Sequelize[_0x1ff0('0x2')],'comment':_0x1ff0('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x1ff0('0x9')},'data4':{'type':Sequelize[_0x1ff0('0x2')],'comment':_0x1ff0('0xa')},'data5':{'type':Sequelize[_0x1ff0('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x1ff0('0xb')],'comment':_0x1ff0('0xc')},'data7':{'type':Sequelize[_0x1ff0('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 301b7b7..bd9df7f 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 _0xc2b1=['redis','defaults','localhost','socket.io-emitter','sendStatus','offset','undefined','limit','count','status','set','json','update','then','destroy','end','error','stack','name','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','MicrosoftAzure','decryptString','data3','catch','params','keys','length','options','find','service','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','state','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth'];(function(_0x3a1577,_0x57a6e5){var _0x492dc4=function(_0x320321){while(--_0x320321){_0x3a1577['push'](_0x3a1577['shift']());}};_0x492dc4(++_0x57a6e5);}(_0xc2b1,0xaf));var _0x1c2b=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xc2b1[_0x50e593];return _0x3821d0;};'use strict';var _=require(_0x1c2b('0x0'));var Redis=require(_0x1c2b('0x1'));var qs=require(_0x1c2b('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x1c2b('0x3'))(_0x1c2b('0x4'));var db=require(_0x1c2b('0x5'))['db'];var oauth=require(_0x1c2b('0x6'));config[_0x1c2b('0x7')]=_[_0x1c2b('0x8')](config['redis'],{'host':_0x1c2b('0x9'),'port':0x18eb});var socket=require(_0x1c2b('0xa'))(new Redis(config[_0x1c2b('0x7')]));var redis=new Redis(config[_0x1c2b('0x7')]);function respondWithStatusCode(_0x3866d9,_0x29c476){_0x29c476=_0x29c476||0xcc;return function(_0x2eaa30){if(_0x2eaa30){return _0x3866d9[_0x1c2b('0xb')](_0x29c476);}return _0x3866d9['status'](_0x29c476)['end']();};}function respondWithResult(_0x9996ba,_0x48cf24){_0x48cf24=_0x48cf24||0xc8;return function(_0x53699e){if(_0x53699e){return _0x9996ba['status'](_0x48cf24)['json'](_0x53699e);}};}function respondWithFilteredResult(_0x131c87,_0x3bdde4){return function(_0x1a0b9a){if(_0x1a0b9a){var _0x2c3f72=typeof _0x3bdde4[_0x1c2b('0xc')]===_0x1c2b('0xd')&&typeof _0x3bdde4[_0x1c2b('0xe')]==='undefined';var _0x2fd52b=_0x1a0b9a[_0x1c2b('0xf')];var _0x12b30f=_0x2c3f72?0x0:_0x3bdde4['offset'];var _0x3cc392=_0x2c3f72?_0x1a0b9a['count']:_0x3bdde4['offset']+_0x3bdde4[_0x1c2b('0xe')];var _0x3e01f8;if(_0x3cc392>=_0x2fd52b){_0x3cc392=_0x2fd52b;_0x3e01f8=0xc8;}else{_0x3e01f8=0xce;}_0x131c87[_0x1c2b('0x10')](_0x3e01f8);return _0x131c87[_0x1c2b('0x11')]('Content-Range',_0x12b30f+'-'+_0x3cc392+'/'+_0x2fd52b)[_0x1c2b('0x12')](_0x1a0b9a);}return null;};}function saveUpdates(_0x1cc5d1){return function(_0x3066ee){if(_0x3066ee){return _0x3066ee[_0x1c2b('0x13')](_0x1cc5d1)[_0x1c2b('0x14')](function(_0x20448f){return _0x20448f;});}return null;};}function removeEntity(_0x4969cd){return function(_0x3d2fb3){if(_0x3d2fb3){return _0x3d2fb3[_0x1c2b('0x15')]()[_0x1c2b('0x14')](function(){_0x4969cd[_0x1c2b('0x10')](0xcc)[_0x1c2b('0x16')]();});}};}function handleEntityNotFound(_0x407e28){return function(_0xba8610){if(!_0xba8610){_0x407e28[_0x1c2b('0xb')](0x194);}return _0xba8610;};}function handleError(_0x596f62,_0x4e760d){_0x4e760d=_0x4e760d||0x1f4;return function(_0x254457){logger[_0x1c2b('0x17')](_0x254457[_0x1c2b('0x18')]);if(_0x254457[_0x1c2b('0x19')]){delete _0x254457[_0x1c2b('0x19')];}_0x596f62['status'](_0x4e760d)['send'](_0x254457);};}function maskClientSecret(_0x2a78b1){return _[_0x1c2b('0x1a')](_0x2a78b1[_0x1c2b('0x1b')](0x0,0x3),0x14,'*');}exports[_0x1c2b('0x1c')]=function(_0x5cbf31,_0x33ccc1){var _0x5444a1={},_0x366059={},_0x4c15c6={'count':0x0,'rows':[]};var _0x4173be=_['map'](db[_0x1c2b('0x1d')][_0x1c2b('0x1e')],function(_0x3ddc1a){return{'name':_0x3ddc1a[_0x1c2b('0x1f')],'type':_0x3ddc1a[_0x1c2b('0x20')][_0x1c2b('0x21')]};});_0x366059[_0x1c2b('0x22')]=_[_0x1c2b('0x23')](_0x4173be,'name');_0x366059[_0x1c2b('0x24')]=_['keys'](_0x5cbf31[_0x1c2b('0x24')]);_0x366059[_0x1c2b('0x25')]=_['intersection'](_0x366059[_0x1c2b('0x22')],_0x366059['query']);_0x5444a1[_0x1c2b('0x26')]=_[_0x1c2b('0x27')](_0x366059[_0x1c2b('0x22')],qs[_0x1c2b('0x28')](_0x5cbf31['query']['fields']));_0x5444a1['attributes']=_0x5444a1[_0x1c2b('0x26')]['length']?_0x5444a1[_0x1c2b('0x26')]:_0x366059[_0x1c2b('0x22')];if(!_0x5cbf31[_0x1c2b('0x24')][_0x1c2b('0x29')]('nolimit')){_0x5444a1[_0x1c2b('0xe')]=qs[_0x1c2b('0xe')](_0x5cbf31[_0x1c2b('0x24')][_0x1c2b('0xe')]);_0x5444a1[_0x1c2b('0xc')]=qs['offset'](_0x5cbf31[_0x1c2b('0x24')]['offset']);}_0x5444a1['order']=qs[_0x1c2b('0x2a')](_0x5cbf31[_0x1c2b('0x24')]['sort']);_0x5444a1['where']=qs[_0x1c2b('0x25')](_[_0x1c2b('0x2b')](_0x5cbf31[_0x1c2b('0x24')],_0x366059[_0x1c2b('0x25')]),_0x4173be);if(_0x5cbf31[_0x1c2b('0x24')][_0x1c2b('0x2c')]){_0x5444a1[_0x1c2b('0x2d')]=_[_0x1c2b('0x2e')](_0x5444a1[_0x1c2b('0x2d')],{'$or':_['map'](_0x4173be,function(_0x2aa28b){if(_0x2aa28b['type']!==_0x1c2b('0x2f')){var _0x3003e5={};_0x3003e5[_0x2aa28b[_0x1c2b('0x19')]]={'$like':'%'+_0x5cbf31[_0x1c2b('0x24')]['filter']+'%'};return _0x3003e5;}})});}_0x5444a1=_[_0x1c2b('0x2e')]({},_0x5444a1,_0x5cbf31['options']);var _0x4c23bc={'where':_0x5444a1['where']};return db[_0x1c2b('0x1d')]['count'](_0x4c23bc)['then'](function(_0x25104c){_0x4c15c6[_0x1c2b('0xf')]=_0x25104c;if(_0x5cbf31[_0x1c2b('0x24')][_0x1c2b('0x30')]){_0x5444a1['include']=[{'all':!![]}];}return db[_0x1c2b('0x1d')]['findAll'](_0x5444a1);})[_0x1c2b('0x14')](function(_0x510cf2){_0x4c15c6['rows']=_[_0x1c2b('0x23')](_0x510cf2,function(_0x3c922c){if(_0x3c922c['service']===_0x1c2b('0x31')){var _0x4bf306=encryptor[_0x1c2b('0x32')](_0x3c922c[_0x1c2b('0x33')]);_0x3c922c['data3']=maskClientSecret(_0x4bf306);}return _0x3c922c;});return _0x4c15c6;})['then'](respondWithFilteredResult(_0x33ccc1,_0x5444a1))[_0x1c2b('0x34')](handleError(_0x33ccc1,null));};exports['show']=function(_0x2aea2a,_0x3166b8){var _0x5c9f58={'raw':!![],'where':{'id':_0x2aea2a[_0x1c2b('0x35')]['id']}},_0x4687f8={};_0x4687f8[_0x1c2b('0x22')]=_[_0x1c2b('0x36')](db['CloudProvider'][_0x1c2b('0x1e')]);_0x4687f8[_0x1c2b('0x24')]=_[_0x1c2b('0x36')](_0x2aea2a[_0x1c2b('0x24')]);_0x4687f8[_0x1c2b('0x25')]=_[_0x1c2b('0x27')](_0x4687f8[_0x1c2b('0x22')],_0x4687f8[_0x1c2b('0x24')]);_0x5c9f58['attributes']=_[_0x1c2b('0x27')](_0x4687f8[_0x1c2b('0x22')],qs[_0x1c2b('0x28')](_0x2aea2a[_0x1c2b('0x24')][_0x1c2b('0x28')]));_0x5c9f58['attributes']=_0x5c9f58[_0x1c2b('0x26')][_0x1c2b('0x37')]?_0x5c9f58[_0x1c2b('0x26')]:_0x4687f8['model'];if(_0x2aea2a[_0x1c2b('0x24')][_0x1c2b('0x30')]){_0x5c9f58['include']=[{'all':!![]}];}_0x5c9f58=_[_0x1c2b('0x2e')]({},_0x5c9f58,_0x2aea2a[_0x1c2b('0x38')]);return db[_0x1c2b('0x1d')][_0x1c2b('0x39')](_0x5c9f58)['then'](handleEntityNotFound(_0x3166b8,null))['then'](function(_0x4e32bf){if(_0x4e32bf[_0x1c2b('0x3a')]==='MicrosoftAzure'){var _0x4d8c17=encryptor[_0x1c2b('0x32')](_0x4e32bf['data3']);_0x4e32bf[_0x1c2b('0x33')]=maskClientSecret(_0x4d8c17);}return _0x4e32bf;})[_0x1c2b('0x14')](respondWithResult(_0x3166b8,null))[_0x1c2b('0x34')](handleError(_0x3166b8,null));};exports['create']=function(_0xd8df85,_0x149355){if(!_0xd8df85[_0x1c2b('0x3b')][_0x1c2b('0x19')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0xd8df85[_0x1c2b('0x3b')][_0x1c2b('0x3a')])throw new Error(_0x1c2b('0x3c'));var _0x440544=db[_0x1c2b('0x1d')][_0x1c2b('0x1e')][_0x1c2b('0x3a')][_0x1c2b('0x3d')];if(!_0x440544['includes'](_0xd8df85['body'][_0x1c2b('0x3a')]))throw new Error(_0x1c2b('0x3e')+_0x440544[_0x1c2b('0x3f')](',\x20'));if(_0xd8df85[_0x1c2b('0x3b')]['service']==='MicrosoftAzure'&&_0xd8df85['body'][_0x1c2b('0x33')]){_0xd8df85[_0x1c2b('0x3b')][_0x1c2b('0x33')]=encryptor[_0x1c2b('0x40')](_0xd8df85['body']['data3']);}return db[_0x1c2b('0x1d')][_0x1c2b('0x41')](_0xd8df85[_0x1c2b('0x3b')],{})['then'](respondWithResult(_0x149355,0xc9))[_0x1c2b('0x34')](handleError(_0x149355,null));};exports['update']=function(_0x3ce005,_0x5c64c0){if(_0x3ce005[_0x1c2b('0x3b')]['id']){delete _0x3ce005[_0x1c2b('0x3b')]['id'];}return db[_0x1c2b('0x1d')][_0x1c2b('0x39')]({'where':{'id':_0x3ce005[_0x1c2b('0x35')]['id']}})[_0x1c2b('0x14')](handleEntityNotFound(_0x5c64c0,null))['then'](function(_0x5646e9){if(_0x5646e9[_0x1c2b('0x3a')]===_0x1c2b('0x31')&&_0x3ce005[_0x1c2b('0x3b')][_0x1c2b('0x33')]){_0x3ce005['body'][_0x1c2b('0x33')]=encryptor[_0x1c2b('0x40')](_0x3ce005[_0x1c2b('0x3b')][_0x1c2b('0x33')]);}return _0x5646e9;})[_0x1c2b('0x14')](saveUpdates(_0x3ce005[_0x1c2b('0x3b')],null))[_0x1c2b('0x14')](respondWithResult(_0x5c64c0,null))[_0x1c2b('0x34')](handleError(_0x5c64c0,null));};exports[_0x1c2b('0x15')]=function(_0x87ea8,_0x1df049){return db['CloudProvider'][_0x1c2b('0x39')]({'where':{'id':_0x87ea8[_0x1c2b('0x35')]['id']}})[_0x1c2b('0x14')](handleEntityNotFound(_0x1df049,null))[_0x1c2b('0x14')](removeEntity(_0x1df049,null))[_0x1c2b('0x34')](handleError(_0x1df049,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1e822d,_0x5ba3a4){return db[_0x1c2b('0x1d')][_0x1c2b('0x42')]({'where':{'id':_0x1e822d['params']['id']},'raw':!![]})[_0x1c2b('0x14')](function(_0xf371ce){if(!_0xf371ce)return _0x5ba3a4[_0x1c2b('0xb')](0x194);return{'url':oauth[_0x1c2b('0x43')](_0xf371ce,_0x1e822d[_0x1c2b('0x44')]['id'])};})[_0x1c2b('0x14')](respondWithResult(_0x5ba3a4,null))['catch'](handleError(_0x5ba3a4,null));};exports[_0x1c2b('0x45')]=function(_0x13677d,_0x4ca0bc){var _0xae75f6=_0x13677d['body'];var _0x3ea433;var _0x706db3;if(_0xae75f6[_0x1c2b('0x17')])throw _0xae75f6;redis[_0x1c2b('0x46')](_0xae75f6['state'])['then'](function(_0x29c435){if(!_0x29c435)throw new Error(_0x1c2b('0x47'));_0x3ea433=JSON[_0x1c2b('0x48')](_0x29c435);var _0x5186cf=Buffer['from'](_0xae75f6[_0x1c2b('0x49')],_0x1c2b('0x4a'))[_0x1c2b('0x4b')](_0x1c2b('0x4c'));_0x706db3=JSON[_0x1c2b('0x48')](_0x5186cf);if(!oauth['isValidIdToken'](_0xae75f6[_0x1c2b('0x4d')],_0x3ea433[_0x1c2b('0x4e')]))throw new Error(_0x1c2b('0x4f'));redis[_0x1c2b('0x50')](_0xae75f6[_0x1c2b('0x49')]);return oauth[_0x1c2b('0x51')](_0xae75f6['code'],_0x3ea433);})['then'](function(_0x517c6f){_0x3ea433[_0x1c2b('0x52')]=_0x517c6f['access_token'];_0x3ea433['data6']=_0x517c6f['refresh_token'];return db[_0x1c2b('0x1d')][_0x1c2b('0x13')]({'data5':_0x3ea433[_0x1c2b('0x52')],'data6':_0x3ea433[_0x1c2b('0x53')]},{'where':{'id':_0x3ea433['id']}});})[_0x1c2b('0x14')](function(){oauth[_0x1c2b('0x54')](_0x3ea433);socket[_0x1c2b('0x55')](_0x1c2b('0x56'),{'id':_0x706db3['id']});return;})[_0x1c2b('0x14')](respondWithStatusCode(_0x4ca0bc,null))[_0x1c2b('0x34')](function(_0x3a531d){if(_0x706db3){socket[_0x1c2b('0x55')](_0x1c2b('0x57'),{'id':_0x706db3['id']});}if(!_0x3ea433){logger[_0x1c2b('0x17')](_0x1c2b('0x58'),_0x3a531d);return _0x4ca0bc[_0x1c2b('0x10')](0x1f4)['send'](_0x3a531d['message']);}logger[_0x1c2b('0x17')](_0x1c2b('0x59'),_0x3ea433['id'],JSON[_0x1c2b('0x5a')](_0x3a531d));});}; \ No newline at end of file +var _0x23fc=['redis','defaults','localhost','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','error','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','find','create','Name\x20parameter\x20not\x20specified','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data6','refresh_token','data5','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../mysqldb','./cloudProvider.oauth'];(function(_0x3b8e86,_0x31b2c2){var _0x3f18e5=function(_0x40fb98){while(--_0x40fb98){_0x3b8e86['push'](_0x3b8e86['shift']());}};_0x3f18e5(++_0x31b2c2);}(_0x23fc,0x1bd));var _0xc23f=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0x23fc[_0x2e6dbf];return _0x2680e5;};'use strict';var _=require(_0xc23f('0x0'));var Redis=require('ioredis');var qs=require(_0xc23f('0x1'));var encryptor=require(_0xc23f('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0xc23f('0x3'))['db'];var oauth=require(_0xc23f('0x4'));config[_0xc23f('0x5')]=_[_0xc23f('0x6')](config[_0xc23f('0x5')],{'host':_0xc23f('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0xc23f('0x5')]);function respondWithStatusCode(_0x1651d5,_0x441fc9){_0x441fc9=_0x441fc9||0xcc;return function(_0x128ba2){if(_0x128ba2){return _0x1651d5[_0xc23f('0x8')](_0x441fc9);}return _0x1651d5[_0xc23f('0x9')](_0x441fc9)[_0xc23f('0xa')]();};}function respondWithResult(_0x80d4b8,_0x49cedc){_0x49cedc=_0x49cedc||0xc8;return function(_0x26739f){if(_0x26739f){return _0x80d4b8[_0xc23f('0x9')](_0x49cedc)['json'](_0x26739f);}};}function respondWithFilteredResult(_0x5acc8e,_0x279412){return function(_0x29b086){if(_0x29b086){var _0x110266=typeof _0x279412[_0xc23f('0xb')]==='undefined'&&typeof _0x279412[_0xc23f('0xc')]===_0xc23f('0xd');var _0x2fb928=_0x29b086['count'];var _0x5c12da=_0x110266?0x0:_0x279412[_0xc23f('0xb')];var _0x548c06=_0x110266?_0x29b086[_0xc23f('0xe')]:_0x279412[_0xc23f('0xb')]+_0x279412[_0xc23f('0xc')];var _0x193b9f;if(_0x548c06>=_0x2fb928){_0x548c06=_0x2fb928;_0x193b9f=0xc8;}else{_0x193b9f=0xce;}_0x5acc8e[_0xc23f('0x9')](_0x193b9f);return _0x5acc8e[_0xc23f('0xf')](_0xc23f('0x10'),_0x5c12da+'-'+_0x548c06+'/'+_0x2fb928)[_0xc23f('0x11')](_0x29b086);}return null;};}function saveUpdates(_0x549f62){return function(_0x356189){if(_0x356189){return _0x356189[_0xc23f('0x12')](_0x549f62)[_0xc23f('0x13')](function(_0x24ef15){return _0x24ef15;});}return null;};}function removeEntity(_0x2d9b1f){return function(_0x635c42){if(_0x635c42){return _0x635c42[_0xc23f('0x14')]()[_0xc23f('0x13')](function(){_0x2d9b1f[_0xc23f('0x9')](0xcc)[_0xc23f('0xa')]();});}};}function handleEntityNotFound(_0x134586){return function(_0x347067){if(!_0x347067){_0x134586[_0xc23f('0x8')](0x194);}return _0x347067;};}function handleError(_0x1d0340,_0x1d2c0f){_0x1d2c0f=_0x1d2c0f||0x1f4;return function(_0x1b548b){logger[_0xc23f('0x15')](_0x1b548b['stack']);if(_0x1b548b[_0xc23f('0x16')]){delete _0x1b548b[_0xc23f('0x16')];}_0x1d0340['status'](_0x1d2c0f)[_0xc23f('0x17')](_0x1b548b);};}function maskClientSecret(_0x539a04){return _[_0xc23f('0x18')](_0x539a04[_0xc23f('0x19')](0x0,0x3),0x14,'*');}exports[_0xc23f('0x1a')]=function(_0x372ba1,_0x39fd05){var _0x2b23b9={},_0x151b15={},_0x487d97={'count':0x0,'rows':[]};var _0x2222f5=_['map'](db[_0xc23f('0x1b')][_0xc23f('0x1c')],function(_0x1ebb95){return{'name':_0x1ebb95[_0xc23f('0x1d')],'type':_0x1ebb95[_0xc23f('0x1e')]['key']};});_0x151b15[_0xc23f('0x1f')]=_[_0xc23f('0x20')](_0x2222f5,_0xc23f('0x16'));_0x151b15[_0xc23f('0x21')]=_[_0xc23f('0x22')](_0x372ba1[_0xc23f('0x21')]);_0x151b15[_0xc23f('0x23')]=_[_0xc23f('0x24')](_0x151b15[_0xc23f('0x1f')],_0x151b15[_0xc23f('0x21')]);_0x2b23b9['attributes']=_[_0xc23f('0x24')](_0x151b15[_0xc23f('0x1f')],qs[_0xc23f('0x25')](_0x372ba1[_0xc23f('0x21')][_0xc23f('0x25')]));_0x2b23b9[_0xc23f('0x26')]=_0x2b23b9[_0xc23f('0x26')][_0xc23f('0x27')]?_0x2b23b9[_0xc23f('0x26')]:_0x151b15[_0xc23f('0x1f')];if(!_0x372ba1[_0xc23f('0x21')]['hasOwnProperty'](_0xc23f('0x28'))){_0x2b23b9['limit']=qs[_0xc23f('0xc')](_0x372ba1[_0xc23f('0x21')][_0xc23f('0xc')]);_0x2b23b9[_0xc23f('0xb')]=qs[_0xc23f('0xb')](_0x372ba1[_0xc23f('0x21')]['offset']);}_0x2b23b9[_0xc23f('0x29')]=qs[_0xc23f('0x2a')](_0x372ba1[_0xc23f('0x21')][_0xc23f('0x2a')]);_0x2b23b9[_0xc23f('0x2b')]=qs[_0xc23f('0x23')](_[_0xc23f('0x2c')](_0x372ba1[_0xc23f('0x21')],_0x151b15['filters']),_0x2222f5);if(_0x372ba1[_0xc23f('0x21')][_0xc23f('0x2d')]){_0x2b23b9['where']=_[_0xc23f('0x2e')](_0x2b23b9[_0xc23f('0x2b')],{'$or':_['map'](_0x2222f5,function(_0x52b83f){if(_0x52b83f[_0xc23f('0x1e')]!==_0xc23f('0x2f')){var _0x23f9cb={};_0x23f9cb[_0x52b83f['name']]={'$like':'%'+_0x372ba1[_0xc23f('0x21')]['filter']+'%'};return _0x23f9cb;}})});}_0x2b23b9=_[_0xc23f('0x2e')]({},_0x2b23b9,_0x372ba1[_0xc23f('0x30')]);var _0x2e071f={'where':_0x2b23b9[_0xc23f('0x2b')]};return db[_0xc23f('0x1b')][_0xc23f('0xe')](_0x2e071f)[_0xc23f('0x13')](function(_0x286041){_0x487d97[_0xc23f('0xe')]=_0x286041;if(_0x372ba1['query'][_0xc23f('0x31')]){_0x2b23b9['include']=[{'all':!![]}];}return db[_0xc23f('0x1b')][_0xc23f('0x32')](_0x2b23b9);})[_0xc23f('0x13')](function(_0x3c26a8){_0x487d97[_0xc23f('0x33')]=_[_0xc23f('0x20')](_0x3c26a8,function(_0x5e541c){if(_0x5e541c[_0xc23f('0x34')]===_0xc23f('0x35')){var _0x4f7bad=encryptor['decryptString'](_0x5e541c[_0xc23f('0x36')]);_0x5e541c[_0xc23f('0x36')]=maskClientSecret(_0x4f7bad);}return _0x5e541c;});return _0x487d97;})['then'](respondWithFilteredResult(_0x39fd05,_0x2b23b9))[_0xc23f('0x37')](handleError(_0x39fd05,null));};exports[_0xc23f('0x38')]=function(_0x5da204,_0x1ec7cb){var _0x3825c5={'raw':!![],'where':{'id':_0x5da204[_0xc23f('0x39')]['id']}},_0x526e3d={};_0x526e3d['model']=_[_0xc23f('0x22')](db['CloudProvider']['rawAttributes']);_0x526e3d[_0xc23f('0x21')]=_[_0xc23f('0x22')](_0x5da204[_0xc23f('0x21')]);_0x526e3d[_0xc23f('0x23')]=_[_0xc23f('0x24')](_0x526e3d[_0xc23f('0x1f')],_0x526e3d[_0xc23f('0x21')]);_0x3825c5[_0xc23f('0x26')]=_[_0xc23f('0x24')](_0x526e3d['model'],qs[_0xc23f('0x25')](_0x5da204[_0xc23f('0x21')]['fields']));_0x3825c5[_0xc23f('0x26')]=_0x3825c5[_0xc23f('0x26')]['length']?_0x3825c5[_0xc23f('0x26')]:_0x526e3d[_0xc23f('0x1f')];if(_0x5da204[_0xc23f('0x21')]['includeAll']){_0x3825c5['include']=[{'all':!![]}];}_0x3825c5=_[_0xc23f('0x2e')]({},_0x3825c5,_0x5da204[_0xc23f('0x30')]);return db[_0xc23f('0x1b')][_0xc23f('0x3a')](_0x3825c5)[_0xc23f('0x13')](handleEntityNotFound(_0x1ec7cb,null))[_0xc23f('0x13')](function(_0x3695c1){if(_0x3695c1[_0xc23f('0x34')]===_0xc23f('0x35')){var _0x2c97f4=encryptor['decryptString'](_0x3695c1[_0xc23f('0x36')]);_0x3695c1[_0xc23f('0x36')]=maskClientSecret(_0x2c97f4);}return _0x3695c1;})[_0xc23f('0x13')](respondWithResult(_0x1ec7cb,null))[_0xc23f('0x37')](handleError(_0x1ec7cb,null));};exports[_0xc23f('0x3b')]=function(_0x1b6835,_0x5ccb1b){if(!_0x1b6835['body'][_0xc23f('0x16')])throw new Error(_0xc23f('0x3c'));if(!_0x1b6835['body'][_0xc23f('0x34')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x38cd9d=db[_0xc23f('0x1b')][_0xc23f('0x1c')][_0xc23f('0x34')]['values'];if(!_0x38cd9d[_0xc23f('0x3d')](_0x1b6835[_0xc23f('0x3e')][_0xc23f('0x34')]))throw new Error(_0xc23f('0x3f')+_0x38cd9d['join'](',\x20'));if(_0x1b6835['body'][_0xc23f('0x34')]===_0xc23f('0x35')&&_0x1b6835[_0xc23f('0x3e')][_0xc23f('0x36')]){_0x1b6835['body'][_0xc23f('0x36')]=encryptor[_0xc23f('0x40')](_0x1b6835[_0xc23f('0x3e')][_0xc23f('0x36')]);}return db[_0xc23f('0x1b')][_0xc23f('0x3b')](_0x1b6835[_0xc23f('0x3e')],{})[_0xc23f('0x13')](respondWithResult(_0x5ccb1b,0xc9))[_0xc23f('0x37')](handleError(_0x5ccb1b,null));};exports[_0xc23f('0x12')]=function(_0x1d973b,_0x50af21){if(_0x1d973b['body']['id']){delete _0x1d973b[_0xc23f('0x3e')]['id'];}return db[_0xc23f('0x1b')][_0xc23f('0x3a')]({'where':{'id':_0x1d973b[_0xc23f('0x39')]['id']}})[_0xc23f('0x13')](handleEntityNotFound(_0x50af21,null))[_0xc23f('0x13')](function(_0x358d51){if(_0x358d51[_0xc23f('0x34')]===_0xc23f('0x35')&&_0x1d973b['body']['data3']){_0x1d973b[_0xc23f('0x3e')]['data3']=encryptor[_0xc23f('0x40')](_0x1d973b['body']['data3']);}return _0x358d51;})['then'](saveUpdates(_0x1d973b[_0xc23f('0x3e')],null))[_0xc23f('0x13')](respondWithResult(_0x50af21,null))['catch'](handleError(_0x50af21,null));};exports[_0xc23f('0x14')]=function(_0x273357,_0x55eb41){return db[_0xc23f('0x1b')][_0xc23f('0x3a')]({'where':{'id':_0x273357[_0xc23f('0x39')]['id']}})[_0xc23f('0x13')](handleEntityNotFound(_0x55eb41,null))[_0xc23f('0x13')](removeEntity(_0x55eb41,null))[_0xc23f('0x37')](handleError(_0x55eb41,null));};exports[_0xc23f('0x41')]=function(_0x43ca2b,_0x3c0732){return db['CloudProvider'][_0xc23f('0x42')]({'where':{'id':_0x43ca2b['params']['id']},'raw':!![]})['then'](function(_0xdd4954){if(!_0xdd4954)return _0x3c0732[_0xc23f('0x8')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xdd4954,_0x43ca2b[_0xc23f('0x43')]['id'])};})[_0xc23f('0x13')](respondWithResult(_0x3c0732,null))[_0xc23f('0x37')](handleError(_0x3c0732,null));};exports[_0xc23f('0x44')]=function(_0x584ef9,_0x5eb7d9){var _0x213659=_0x584ef9[_0xc23f('0x3e')];var _0x10f60f;var _0x285989;if(_0x213659[_0xc23f('0x15')])throw _0x213659;redis[_0xc23f('0x45')](_0x213659['state'])[_0xc23f('0x13')](function(_0x224e0e){if(!_0x224e0e)throw new Error(_0xc23f('0x46'));_0x10f60f=JSON[_0xc23f('0x47')](_0x224e0e);var _0x47c9f6=Buffer[_0xc23f('0x48')](_0x213659[_0xc23f('0x49')],_0xc23f('0x4a'))['toString'](_0xc23f('0x4b'));_0x285989=JSON[_0xc23f('0x47')](_0x47c9f6);if(!oauth[_0xc23f('0x4c')](_0x213659[_0xc23f('0x4d')],_0x10f60f[_0xc23f('0x4e')]))throw new Error(_0xc23f('0x4f'));redis['del'](_0x213659['state']);return oauth[_0xc23f('0x50')](_0x213659[_0xc23f('0x51')],_0x10f60f);})[_0xc23f('0x13')](function(_0x160cf9){_0x10f60f['data5']=_0x160cf9['access_token'];_0x10f60f[_0xc23f('0x52')]=_0x160cf9[_0xc23f('0x53')];return db[_0xc23f('0x1b')][_0xc23f('0x12')]({'data5':_0x10f60f[_0xc23f('0x54')],'data6':_0x10f60f[_0xc23f('0x52')]},{'where':{'id':_0x10f60f['id']}});})[_0xc23f('0x13')](function(){oauth['startRefreshInterval'](_0x10f60f);socket[_0xc23f('0x55')](_0xc23f('0x56'),{'id':_0x285989['id']});return;})[_0xc23f('0x13')](respondWithStatusCode(_0x5eb7d9,null))[_0xc23f('0x37')](function(_0xe8d9dd){if(_0x285989){socket[_0xc23f('0x55')]('microsoftAuthorization:error',{'id':_0x285989['id']});}if(!_0x10f60f){logger[_0xc23f('0x15')](_0xc23f('0x57'),_0xe8d9dd);return _0x5eb7d9['status'](0x1f4)[_0xc23f('0x17')](_0xe8d9dd['message']);}logger[_0xc23f('0x15')](_0xc23f('0x58'),_0x10f60f['id'],JSON[_0xc23f('0x59')](_0xe8d9dd));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 1e13682..c5cba57 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 _0x5b2b=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','moment','bluebird','request-promise','path'];(function(_0x57e57d,_0x1d173c){var _0x413276=function(_0x228519){while(--_0x228519){_0x57e57d['push'](_0x57e57d['shift']());}};_0x413276(++_0x1d173c);}(_0x5b2b,0x89));var _0xb5b2=function(_0xa0c1e9,_0x2c75ff){_0xa0c1e9=_0xa0c1e9-0x0;var _0xcf62fe=_0x5b2b[_0xa0c1e9];return _0xcf62fe;};'use strict';var _=require(_0xb5b2('0x0'));var util=require(_0xb5b2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb5b2('0x2'));var BPromise=require(_0xb5b2('0x3'));var rp=require(_0xb5b2('0x4'));var fs=require('fs');var path=require(_0xb5b2('0x5'));var rimraf=require(_0xb5b2('0x6'));var config=require(_0xb5b2('0x7'));var attributes=require(_0xb5b2('0x8'));module[_0xb5b2('0x9')]=function(_0x3ae64d,_0x1a2b37){return _0x3ae64d[_0xb5b2('0xa')](_0xb5b2('0xb'),attributes,{'tableName':_0xb5b2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fd2=['lodash','../../config/logger','api','moment','bluebird','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x6f4e6e,_0x231a01){var _0x1167ff=function(_0xa2427b){while(--_0xa2427b){_0x6f4e6e['push'](_0x6f4e6e['shift']());}};_0x1167ff(++_0x231a01);}(_0x0fd2,0xf8));var _0x20fd=function(_0x5090cb,_0x3ce576){_0x5090cb=_0x5090cb-0x0;var _0x40f648=_0x0fd2[_0x5090cb];return _0x40f648;};'use strict';var _=require(_0x20fd('0x0'));var util=require('util');var logger=require(_0x20fd('0x1'))(_0x20fd('0x2'));var moment=require(_0x20fd('0x3'));var BPromise=require(_0x20fd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x20fd('0x5'));var attributes=require(_0x20fd('0x6'));module[_0x20fd('0x7')]=function(_0x1f9a39,_0x54dcf){return _0x1f9a39['define']('CloudProvider',attributes,{'tableName':'cloud_providers','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 48b2e04..8f8762d 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 _0x96c4=['error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','moment','ioredis','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','map','type','push','data7','/.default','join','Dynamics365','replace','data2','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','redirect_uri','response_mode','form_post','scope','prompt','login','key','value','oauth2Claims','oauth2/','data1','iss','issuer','aud','audience','nonce','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6','data4','decryptString','POST','{TENANT_ID}','data5','access_token','update','catch'];(function(_0x4991f6,_0x5b74f4){var _0x456e8b=function(_0x31b5f1){while(--_0x31b5f1){_0x4991f6['push'](_0x4991f6['shift']());}};_0x456e8b(++_0x5b74f4);}(_0x96c4,0x18a));var _0x496c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x96c4[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x496c('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0x496c('0x1'));var Redis=require(_0x496c('0x2'));var rp=require(_0x496c('0x3'));var util=require(_0x496c('0x4'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x496c('0x5'))(_0x496c('0x6'));var schedule=require(_0x496c('0x7'));var db=require(_0x496c('0x8'))['db'];config[_0x496c('0x9')]=_[_0x496c('0xa')](config[_0x496c('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x496c('0x9')]);var MICROSOFT_AUTH_URL=_0x496c('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x496c('0xc'),_0x496c('0xd'),_0x496c('0xe'),_0x496c('0xf'),_0x496c('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x496c('0x11'),_0x496c('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x496c('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xfebc6b){var _0x24900f=_[_0x496c('0x13')](AZURE_AUTH_SCOPES[_0xfebc6b['type']]);if(_0xfebc6b[_0x496c('0x14')]==='Dynamics365')_0x24900f[_0x496c('0x15')](_0xfebc6b[_0x496c('0x16')]+_0x496c('0x17'));return _0x24900f[_0x496c('0x18')]('\x20');}function getAccessTokenScope(_0x1270bd){if(_0x1270bd[_0x496c('0x14')]==='Outlook365')return _0x496c('0xf');if(_0x1270bd[_0x496c('0x14')]===_0x496c('0x19'))return _0x1270bd[_0x496c('0x16')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x513217,_0x5cecea){var _0x389292=MICROSOFT_AUTH_URL[_0x496c('0x1a')]('{TENANT_ID}',_0x513217[_0x496c('0x1b')]);var _0x525259=['code',_0x496c('0x1c')];var _0x2c1ff9=Buffer[_0x496c('0x1d')](JSON[_0x496c('0x1e')]({'id':_0x5cecea}))[_0x496c('0x1f')](_0x496c('0x20'));var _0x5f3d21=crypto[_0x496c('0x21')](0x10)[_0x496c('0x1f')](_0x496c('0x22'));var _0x557b1a=getAuthorizationScopes(_0x513217);var _0x35463a=[{'key':_0x496c('0x23'),'value':_0x513217['data1']},{'key':'response_type','value':encodeURIComponent(_0x525259['join']('\x20'))},{'key':_0x496c('0x24'),'value':_0x513217['data4']},{'key':_0x496c('0x25'),'value':_0x496c('0x26')},{'key':_0x496c('0x27'),'value':encodeURIComponent(_0x557b1a)},{'key':'state','value':_0x2c1ff9},{'key':'nonce','value':_0x5f3d21},{'key':_0x496c('0x28'),'value':_0x496c('0x29')}];var _0x1dad69=_0x389292+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x496c('0x13')](_0x35463a,function(_0x4fdc69){return _0x4fdc69[_0x496c('0x2a')]+'='+_0x4fdc69[_0x496c('0x2b')];})['join']('&');_0x513217[_0x496c('0x2c')]={'issuer':_0x389292['replace'](_0x496c('0x2d'),''),'audience':_0x513217[_0x496c('0x2e')],'state':_0x2c1ff9,'nonce':_0x5f3d21};redis['set'](_0x2c1ff9,JSON['stringify'](_0x513217));return _0x1dad69;}function isValidIdToken(_0x2344ed,_0x4f9960){try{var _0x919017=jwt['decode'](_0x2344ed,{'complete':!![]});var _0x570362=_0x919017['payload'];if(_0x570362[_0x496c('0x2f')]!==_0x4f9960[_0x496c('0x30')])return![];if(_0x570362[_0x496c('0x31')]!==_0x4f9960[_0x496c('0x32')])return![];if(_0x570362[_0x496c('0x33')]!==_0x4f9960[_0x496c('0x33')])return![];if(moment()['isAfter'](moment[_0x496c('0x34')](_0x570362[_0x496c('0x35')])))return![];return!![];}catch(_0x55e766){throw _0x55e766;}}function refreshOauth2MicrosoftAccessToken(_0xe48948){return Promise[_0x496c('0x36')]()[_0x496c('0x37')](function(){if(_0xe48948[_0x496c('0x38')])return _0xe48948;return db[_0x496c('0x39')]['findOne']({'where':{'id':_0xe48948['id']},'raw':!![]});})['then'](function(_0x51bfef){var _0x190422={'grant_type':_0x496c('0x3a'),'refresh_token':_0x51bfef[_0x496c('0x3b')],'scope':getAccessTokenScope(_0x51bfef),'redirect_uri':_0x51bfef[_0x496c('0x3c')],'client_id':_0x51bfef['data1'],'client_secret':encryptor[_0x496c('0x3d')](_0x51bfef[_0x496c('0x38')])};var _0x11a21b={'method':_0x496c('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0x496c('0x3f'),_0x51bfef[_0x496c('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x190422,'json':!![]};return rp(_0x11a21b);})[_0x496c('0x37')](function(_0x2c9dc6){_0xe48948[_0x496c('0x40')]=_0x2c9dc6[_0x496c('0x41')];_0xe48948[_0x496c('0x3b')]=_0x2c9dc6[_0x496c('0x3a')];return db[_0x496c('0x39')][_0x496c('0x42')]({'data5':_0xe48948[_0x496c('0x40')],'data6':_0xe48948[_0x496c('0x3b')]},{'where':{'id':_0xe48948['id']}});})['then'](function(){return _0xe48948;})[_0x496c('0x43')](function(_0x1b00db){logger[_0x496c('0x44')](_0x496c('0x45'),_0xe48948['id'],_0x1b00db);});}function getOauth2MicrosoftAccessToken(_0x1d17ec,_0x85e885){var _0x5cd9dd={'grant_type':_0x496c('0x46'),'code':_0x1d17ec,'scope':getAccessTokenScope(_0x85e885),'redirect_uri':_0x85e885[_0x496c('0x3c')],'client_id':_0x85e885[_0x496c('0x2e')],'client_secret':encryptor[_0x496c('0x3d')](_0x85e885[_0x496c('0x38')])};var _0x2125f3={'method':_0x496c('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0x496c('0x3f'),_0x85e885[_0x496c('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5cd9dd,'json':!![]};return rp(_0x2125f3);}function startRefreshInterval(_0x67b8c9){var _0x5c43f0=schedule[_0x496c('0x47')];if(_0x5c43f0[_0x67b8c9['id']])clearInterval(_0x5c43f0[_0x67b8c9['id']]);_0x5c43f0[_0x67b8c9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x496c('0x48')](this,{'id':_0x67b8c9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x496c('0x47')]=_0x5c43f0;}function startAllRefreshIntervals(){return db[_0x496c('0x39')][_0x496c('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x496c('0x37')](function(_0x2de4bb){var _0x17614f=_0x2de4bb[_0x496c('0x13')](function(_0x7fde70){return refreshOauth2MicrosoftAccessToken(_0x7fde70)[_0x496c('0x37')](function(_0x21a0ec){startRefreshInterval(_0x21a0ec);});});return Promise[_0x496c('0x4a')](_0x17614f);})[_0x496c('0x43')](function(_0x343327){var _0x5a845b=_0x343327?util[_0x496c('0x4b')](_0x343327,{'showHidden':![],'depth':null}):'';logger[_0x496c('0x44')](_0x496c('0x4c'),_0x5a845b);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xbe27=['client_id','data1','response_type','redirect_uri','data4','state','prompt','login','key','value','replace','set','iss','audience','nonce','isAfter','unix','exp','data3','refresh_token','data6','POST','then','access_token','CloudProvider','update','data5','catch','error','decryptString','bind','intervals','inspect','[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','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','randomBytes','hex'];(function(_0x283be8,_0xea1092){var _0x15e6db=function(_0x500fc8){while(--_0x500fc8){_0x283be8['push'](_0x283be8['shift']());}};_0x15e6db(++_0xea1092);}(_0xbe27,0xb5));var _0x7be2=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbe27[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7be2('0x0'));var crypto=require(_0x7be2('0x1'));var jwt=require(_0x7be2('0x2'));var moment=require(_0x7be2('0x3'));var Redis=require(_0x7be2('0x4'));var rp=require(_0x7be2('0x5'));var util=require(_0x7be2('0x6'));var encryptor=require(_0x7be2('0x7'));var config=require('../../config/environment');var logger=require(_0x7be2('0x8'))(_0x7be2('0x9'));var schedule=require(_0x7be2('0xa'));var db=require(_0x7be2('0xb'))['db'];config[_0x7be2('0xc')]=_[_0x7be2('0xd')](config['redis'],{'host':_0x7be2('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x7be2('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7be2('0x10'),_0x7be2('0x11'),'email','offline_access',_0x7be2('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x7be2('0x13')],'Dynamics365':['openid',_0x7be2('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0x7be2('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x7be2('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x23366a){var _0x38b8b6=_[_0x7be2('0x17')](AZURE_AUTH_SCOPES[_0x23366a[_0x7be2('0x18')]]);if(_0x23366a['type']===_0x7be2('0x19'))_0x38b8b6['push'](_0x23366a[_0x7be2('0x1a')]+_0x7be2('0x1b'));return _0x38b8b6[_0x7be2('0x1c')]('\x20');}function getAccessTokenScope(_0x28de9b){if(_0x28de9b[_0x7be2('0x18')]===_0x7be2('0x1d'))return _0x7be2('0x12');if(_0x28de9b['type']==='Dynamics365')return _0x28de9b['data7']+_0x7be2('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3773e4,_0x4c1546){var _0x2cdfd5=MICROSOFT_AUTH_URL['replace'](_0x7be2('0x1e'),_0x3773e4[_0x7be2('0x1f')]);var _0x56e82e=[_0x7be2('0x20'),_0x7be2('0x21')];var _0x1e4dc6=Buffer[_0x7be2('0x22')](JSON[_0x7be2('0x23')]({'id':_0x4c1546}))['toString']('base64');var _0x5c5220=crypto[_0x7be2('0x24')](0x10)['toString'](_0x7be2('0x25'));var _0x47e7aa=getAuthorizationScopes(_0x3773e4);var _0x5142e4=[{'key':_0x7be2('0x26'),'value':_0x3773e4[_0x7be2('0x27')]},{'key':_0x7be2('0x28'),'value':encodeURIComponent(_0x56e82e[_0x7be2('0x1c')]('\x20'))},{'key':_0x7be2('0x29'),'value':_0x3773e4[_0x7be2('0x2a')]},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x47e7aa)},{'key':_0x7be2('0x2b'),'value':_0x1e4dc6},{'key':'nonce','value':_0x5c5220},{'key':_0x7be2('0x2c'),'value':_0x7be2('0x2d')}];var _0x546553=_0x2cdfd5+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7be2('0x17')](_0x5142e4,function(_0x4e1f42){return _0x4e1f42[_0x7be2('0x2e')]+'='+_0x4e1f42[_0x7be2('0x2f')];})[_0x7be2('0x1c')]('&');_0x3773e4['oauth2Claims']={'issuer':_0x2cdfd5[_0x7be2('0x30')]('oauth2/',''),'audience':_0x3773e4[_0x7be2('0x27')],'state':_0x1e4dc6,'nonce':_0x5c5220};redis[_0x7be2('0x31')](_0x1e4dc6,JSON[_0x7be2('0x23')](_0x3773e4));return _0x546553;}function isValidIdToken(_0x2a7273,_0x1ddd4e){try{var _0xab8c17=jwt['decode'](_0x2a7273,{'complete':!![]});var _0x5bdd2c=_0xab8c17['payload'];if(_0x5bdd2c[_0x7be2('0x32')]!==_0x1ddd4e['issuer'])return![];if(_0x5bdd2c['aud']!==_0x1ddd4e[_0x7be2('0x33')])return![];if(_0x5bdd2c[_0x7be2('0x34')]!==_0x1ddd4e[_0x7be2('0x34')])return![];if(moment()[_0x7be2('0x35')](moment[_0x7be2('0x36')](_0x5bdd2c[_0x7be2('0x37')])))return![];return!![];}catch(_0x4d5203){throw _0x4d5203;}}function refreshOauth2MicrosoftAccessToken(_0x1ebbfc){return Promise['resolve']()['then'](function(){if(_0x1ebbfc[_0x7be2('0x38')])return _0x1ebbfc;return db['CloudProvider']['findOne']({'where':{'id':_0x1ebbfc['id']},'raw':!![]});})['then'](function(_0x6d057a){var _0x315353={'grant_type':_0x7be2('0x39'),'refresh_token':_0x6d057a[_0x7be2('0x3a')],'scope':getAccessTokenScope(_0x6d057a),'redirect_uri':_0x6d057a[_0x7be2('0x2a')],'client_id':_0x6d057a['data1'],'client_secret':encryptor['decryptString'](_0x6d057a[_0x7be2('0x38')])};var _0x408f76={'method':_0x7be2('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x7be2('0x30')](_0x7be2('0x1e'),_0x6d057a[_0x7be2('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x315353,'json':!![]};return rp(_0x408f76);})[_0x7be2('0x3c')](function(_0x734a13){_0x1ebbfc['data5']=_0x734a13[_0x7be2('0x3d')];_0x1ebbfc[_0x7be2('0x3a')]=_0x734a13[_0x7be2('0x39')];return db[_0x7be2('0x3e')][_0x7be2('0x3f')]({'data5':_0x1ebbfc[_0x7be2('0x40')],'data6':_0x1ebbfc[_0x7be2('0x3a')]},{'where':{'id':_0x1ebbfc['id']}});})[_0x7be2('0x3c')](function(){return _0x1ebbfc;})[_0x7be2('0x41')](function(_0x3e6e34){logger[_0x7be2('0x42')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x1ebbfc['id'],_0x3e6e34);});}function getOauth2MicrosoftAccessToken(_0x334212,_0x57e296){var _0x207368={'grant_type':'authorization_code','code':_0x334212,'scope':getAccessTokenScope(_0x57e296),'redirect_uri':_0x57e296['data4'],'client_id':_0x57e296['data1'],'client_secret':encryptor[_0x7be2('0x43')](_0x57e296[_0x7be2('0x38')])};var _0xb43ab7={'method':_0x7be2('0x3b'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7be2('0x1e'),_0x57e296['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x207368,'json':!![]};return rp(_0xb43ab7);}function startRefreshInterval(_0x11e585){var _0x6745cc=schedule['intervals'];if(_0x6745cc[_0x11e585['id']])clearInterval(_0x6745cc[_0x11e585['id']]);_0x6745cc[_0x11e585['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7be2('0x44')](this,{'id':_0x11e585['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7be2('0x45')]=_0x6745cc;}function startAllRefreshIntervals(){return db[_0x7be2('0x3e')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x41e00a){var _0x542c5b=_0x41e00a[_0x7be2('0x17')](function(_0x535844){return refreshOauth2MicrosoftAccessToken(_0x535844)[_0x7be2('0x3c')](function(_0x10db97){startRefreshInterval(_0x10db97);});});return Promise['all'](_0x542c5b);})[_0x7be2('0x41')](function(_0x1fddb5){var _0x362f1c=_0x1fddb5?util[_0x7be2('0x46')](_0x1fddb5,{'showHidden':![],'depth':null}):'';logger[_0x7be2('0x42')](_0x7be2('0x47'),_0x362f1c);});}module[_0x7be2('0x48')]={'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 b85619d..a0a97e3 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 _0xf08c=['jayson/promise','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x36a017,_0x2b889c){var _0x226857=function(_0x278756){while(--_0x278756){_0x36a017['push'](_0x36a017['shift']());}};_0x226857(++_0x2b889c);}(_0xf08c,0xb5));var _0xcf08=function(_0x1339df,_0x51aafb){_0x1339df=_0x1339df-0x0;var _0x2a10f2=_0xf08c[_0x1339df];return _0x2a10f2;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var moment=require(_0xcf08('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf08('0x3'));var fs=require('fs');var Redis=require(_0xcf08('0x4'));var db=require(_0xcf08('0x5'))['db'];var utils=require(_0xcf08('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf08('0x7'));var jayson=require(_0xcf08('0x8'));var client=jayson['client'][_0xcf08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37efab,_0x13b89c,_0x42c7b0){return new BPromise(function(_0x59d6d6,_0x5044bb){return client[_0xcf08('0xa')](_0x37efab,_0x42c7b0)['then'](function(_0x1ab45d){logger[_0xcf08('0xb')](_0xcf08('0xc'),_0x13b89c,_0xcf08('0xd'));logger['debug'](_0xcf08('0xe'),_0x13b89c,_0xcf08('0xd'),JSON[_0xcf08('0xf')](_0x1ab45d));if(_0x1ab45d[_0xcf08('0x10')]){if(_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x11')]===0x1f4){logger[_0xcf08('0x10')](_0xcf08('0xc'),_0x13b89c,_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x12')]);return _0x5044bb(_0x1ab45d[_0xcf08('0x10')]['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x13b89c,_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x12')]);return _0x59d6d6(_0x1ab45d['error'][_0xcf08('0x12')]);}else{logger[_0xcf08('0xb')](_0xcf08('0xc'),_0x13b89c,_0xcf08('0xd'));_0x59d6d6(_0x1ab45d[_0xcf08('0x13')]['message']);}})[_0xcf08('0x14')](function(_0x5d89a7){logger['error'](_0xcf08('0xc'),_0x13b89c,_0x5d89a7);_0x5044bb(_0x5d89a7);});});} \ No newline at end of file +var _0x97b2=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x141a71,_0x53016f){var _0xc615a3=function(_0x3122a9){while(--_0x3122a9){_0x141a71['push'](_0x141a71['shift']());}};_0xc615a3(++_0x53016f);}(_0x97b2,0x1b7));var _0x297b=function(_0x2fcf18,_0x10009a){_0x2fcf18=_0x2fcf18-0x0;var _0x4c68cc=_0x97b2[_0x2fcf18];return _0x4c68cc;};'use strict';var _=require(_0x297b('0x0'));var util=require(_0x297b('0x1'));var moment=require(_0x297b('0x2'));var BPromise=require(_0x297b('0x3'));var rs=require(_0x297b('0x4'));var fs=require('fs');var Redis=require(_0x297b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x297b('0x6'));var logger=require(_0x297b('0x7'))('rpc');var config=require(_0x297b('0x8'));var jayson=require(_0x297b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x541d7b,_0x2c5bf5,_0x18a663){return new BPromise(function(_0x520b38,_0x27a761){return client[_0x297b('0xa')](_0x541d7b,_0x18a663)['then'](function(_0x176f98){logger['info'](_0x297b('0xb'),_0x2c5bf5,'request\x20sent');logger[_0x297b('0xc')](_0x297b('0xd'),_0x2c5bf5,_0x297b('0xe'),JSON[_0x297b('0xf')](_0x176f98));if(_0x176f98[_0x297b('0x10')]){if(_0x176f98[_0x297b('0x10')][_0x297b('0x11')]===0x1f4){logger[_0x297b('0x10')](_0x297b('0xb'),_0x2c5bf5,_0x176f98[_0x297b('0x10')][_0x297b('0x12')]);return _0x27a761(_0x176f98[_0x297b('0x10')][_0x297b('0x12')]);}logger[_0x297b('0x10')](_0x297b('0xb'),_0x2c5bf5,_0x176f98['error'][_0x297b('0x12')]);return _0x520b38(_0x176f98[_0x297b('0x10')]['message']);}else{logger[_0x297b('0x13')](_0x297b('0xb'),_0x2c5bf5,_0x297b('0xe'));_0x520b38(_0x176f98[_0x297b('0x14')][_0x297b('0x12')]);}})[_0x297b('0x15')](function(_0x4882a4){logger[_0x297b('0x10')](_0x297b('0xb'),_0x2c5bf5,_0x4882a4);_0x27a761(_0x4882a4);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 1855308..f3f9a61 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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x31dcb4,_0x17ce15){var _0x417d0f=function(_0x21804d){while(--_0x21804d){_0x31dcb4['push'](_0x31dcb4['shift']());}};_0x417d0f(++_0x17ce15);}(_0xdb28,0x106));var _0x8db2=function(_0x2a70d3,_0x422658){_0x2a70d3=_0x2a70d3-0x0;var _0x1bb1bf=_0xdb28[_0x2a70d3];return _0x1bb1bf;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x7a54,0x106));var _0x47a5=function(_0x7379ff,_0x28e37b){_0x7379ff=_0x7379ff-0x0;var _0x261e71=_0x7a54[_0x7379ff];return _0x261e71;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 668217c..cb78472 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 _0x54bb=['sequelize','exports','STRING','name'];(function(_0x53b97f,_0x1e56bc){var _0xa3e0a8=function(_0x4ed799){while(--_0x4ed799){_0x53b97f['push'](_0x53b97f['shift']());}};_0xa3e0a8(++_0x1e56bc);}(_0x54bb,0xa0));var _0xb54b=function(_0x2d3711,_0x43d60d){_0x2d3711=_0x2d3711-0x0;var _0x477858=_0x54bb[_0x2d3711];return _0x477858;};'use strict';var Sequelize=require(_0xb54b('0x0'));module[_0xb54b('0x1')]={'name':{'type':Sequelize[_0xb54b('0x2')],'unique':_0xb54b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb54b('0x2')]},'companyId':{'type':Sequelize[_0xb54b('0x2')]},'website':{'type':Sequelize[_0xb54b('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xb54b('0x2')]},'city':{'type':Sequelize[_0xb54b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb54b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb54b('0x2')]},'sStreet':{'type':Sequelize[_0xb54b('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xb54b('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb54b('0x2')]}}; \ No newline at end of file +var _0x7e2b=['exports','STRING','name','sequelize'];(function(_0x4c953c,_0x2edbb8){var _0xfa0543=function(_0x2d2cb1){while(--_0x2d2cb1){_0x4c953c['push'](_0x4c953c['shift']());}};_0xfa0543(++_0x2edbb8);}(_0x7e2b,0x67));var _0xb7e2=function(_0x117913,_0x4fd262){_0x117913=_0x117913-0x0;var _0xb8eacb=_0x7e2b[_0x117913];return _0xb8eacb;};'use strict';var Sequelize=require(_0xb7e2('0x0'));module[_0xb7e2('0x1')]={'name':{'type':Sequelize[_0xb7e2('0x2')],'unique':_0xb7e2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb7e2('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb7e2('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb7e2('0x2')]},'street':{'type':Sequelize[_0xb7e2('0x2')]},'postalCode':{'type':Sequelize[_0xb7e2('0x2')]},'city':{'type':Sequelize[_0xb7e2('0x2')]},'country':{'type':Sequelize[_0xb7e2('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb7e2('0x2')]},'sStreet':{'type':Sequelize[_0xb7e2('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xb7e2('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb7e2('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 104ef12..d369e2b 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 _0xd815=['then','get','Companies','UserProfileResource','stack','name','send','index','describe','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','options','CmCompany','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','getContacts','order','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy'];(function(_0x4f288e,_0x37f8f1){var _0x27aa32=function(_0x4ab0fe){while(--_0x4ab0fe){_0x4f288e['push'](_0x4f288e['shift']());}};_0x27aa32(++_0x37f8f1);}(_0xd815,0x1ef));var _0x5d81=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd815[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5d81('0x0'));var rimraf=require(_0x5d81('0x1'));var zipdir=require(_0x5d81('0x2'));var jsonpatch=require(_0x5d81('0x3'));var rp=require('request-promise');var moment=require(_0x5d81('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5d81('0x5'));var util=require('util');var path=require(_0x5d81('0x6'));var sox=require(_0x5d81('0x7'));var csv=require('to-csv');var ejs=require(_0x5d81('0x8'));var fs=require('fs');var fs_extra=require(_0x5d81('0x9'));var _=require(_0x5d81('0xa'));var squel=require(_0x5d81('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5d81('0xc'));var toCsv=require(_0x5d81('0xd'));var querystring=require(_0x5d81('0xe'));var Papa=require('papaparse');var Redis=require(_0x5d81('0xf'));var authService=require(_0x5d81('0x10'));var qs=require(_0x5d81('0x11'));var as=require(_0x5d81('0x12'));var hardwareService=require(_0x5d81('0x13'));var logger=require('../../config/logger')(_0x5d81('0x14'));var utils=require(_0x5d81('0x15'));var config=require(_0x5d81('0x16'));var licenseUtil=require(_0x5d81('0x17'));var db=require(_0x5d81('0x18'))['db'];function respondWithStatusCode(_0x1dce12,_0x695f9c){_0x695f9c=_0x695f9c||0xcc;return function(_0x1c850c){if(_0x1c850c){return _0x1dce12[_0x5d81('0x19')](_0x695f9c);}return _0x1dce12[_0x5d81('0x1a')](_0x695f9c)[_0x5d81('0x1b')]();};}function respondWithResult(_0x5a6dec,_0x17ad22){_0x17ad22=_0x17ad22||0xc8;return function(_0x3c1106){if(_0x3c1106){return _0x5a6dec[_0x5d81('0x1a')](_0x17ad22)[_0x5d81('0x1c')](_0x3c1106);}};}function respondWithFilteredResult(_0x3b0971,_0xb0c4c1){return function(_0xc8e2d8){if(_0xc8e2d8){var _0x1e8b12=typeof _0xb0c4c1['offset']===_0x5d81('0x1d')&&typeof _0xb0c4c1[_0x5d81('0x1e')]==='undefined';var _0xe6487c=_0xc8e2d8[_0x5d81('0x1f')];var _0x129499=_0x1e8b12?0x0:_0xb0c4c1[_0x5d81('0x20')];var _0x5edbb4=_0x1e8b12?_0xc8e2d8[_0x5d81('0x1f')]:_0xb0c4c1['offset']+_0xb0c4c1[_0x5d81('0x1e')];var _0x308afb;if(_0x5edbb4>=_0xe6487c){_0x5edbb4=_0xe6487c;_0x308afb=0xc8;}else{_0x308afb=0xce;}_0x3b0971[_0x5d81('0x1a')](_0x308afb);return _0x3b0971[_0x5d81('0x21')]('Content-Range',_0x129499+'-'+_0x5edbb4+'/'+_0xe6487c)[_0x5d81('0x1c')](_0xc8e2d8);}return null;};}function patchUpdates(_0x46f03d){return function(_0x443500){try{jsonpatch[_0x5d81('0x22')](_0x443500,_0x46f03d,!![]);}catch(_0x41ae05){return BPromise[_0x5d81('0x23')](_0x41ae05);}return _0x443500[_0x5d81('0x24')]();};}function saveUpdates(_0x5ce5cd,_0x5ddee8){return function(_0x326160){if(_0x326160){return _0x326160[_0x5d81('0x25')](_0x5ce5cd)['then'](function(_0x2692ab){return _0x2692ab;});}return null;};}function removeEntity(_0x5b323c,_0x528885){return function(_0x1ab619){if(_0x1ab619){return _0x1ab619[_0x5d81('0x26')]()[_0x5d81('0x27')](function(){var _0x12587f=_0x1ab619[_0x5d81('0x28')]({'plain':!![]});var _0x8d6279=_0x5d81('0x29');return db[_0x5d81('0x2a')][_0x5d81('0x26')]({'where':{'type':_0x8d6279,'resourceId':_0x12587f['id']}})[_0x5d81('0x27')](function(){return _0x1ab619;});})[_0x5d81('0x27')](function(){_0x5b323c[_0x5d81('0x1a')](0xcc)[_0x5d81('0x1b')]();});}};}function handleEntityNotFound(_0xcf797d,_0x39e923){return function(_0x53bde5){if(!_0x53bde5){_0xcf797d[_0x5d81('0x19')](0x194);}return _0x53bde5;};}function handleError(_0x4a1228,_0x5f5b0a){_0x5f5b0a=_0x5f5b0a||0x1f4;return function(_0x3a7f69){logger['error'](_0x3a7f69[_0x5d81('0x2b')]);if(_0x3a7f69[_0x5d81('0x2c')]){delete _0x3a7f69[_0x5d81('0x2c')];}_0x4a1228[_0x5d81('0x1a')](_0x5f5b0a)[_0x5d81('0x2d')](_0x3a7f69);};}exports[_0x5d81('0x2e')]=function(_0x2a0298,_0x158851){var _0x25d829={},_0x37d50e={},_0x4a56d5={'count':0x0,'rows':[]};return db['CmCompany'][_0x5d81('0x2f')]()['then'](function(_0x25570b){_0x37d50e[_0x5d81('0x30')]=_[_0x5d81('0x31')](_0x25570b);_0x37d50e['query']=_[_0x5d81('0x31')](_0x2a0298['query']);_0x37d50e[_0x5d81('0x32')]=_[_0x5d81('0x33')](_0x37d50e[_0x5d81('0x30')],_0x37d50e[_0x5d81('0x34')]);_0x25d829[_0x5d81('0x35')]=_[_0x5d81('0x33')](_0x37d50e[_0x5d81('0x30')],qs[_0x5d81('0x36')](_0x2a0298[_0x5d81('0x34')][_0x5d81('0x36')]));_0x25d829[_0x5d81('0x35')]=_0x25d829[_0x5d81('0x35')]['length']?_0x25d829[_0x5d81('0x35')]:_0x37d50e[_0x5d81('0x30')];if(!_0x2a0298[_0x5d81('0x34')][_0x5d81('0x37')](_0x5d81('0x38'))){_0x25d829[_0x5d81('0x1e')]=qs['limit'](_0x2a0298[_0x5d81('0x34')][_0x5d81('0x1e')]);_0x25d829['offset']=qs[_0x5d81('0x20')](_0x2a0298[_0x5d81('0x34')][_0x5d81('0x20')]);}_0x25d829['order']=qs['sort'](_0x2a0298['query'][_0x5d81('0x39')]);_0x25d829['where']=qs[_0x5d81('0x32')](_[_0x5d81('0x3a')](_0x2a0298[_0x5d81('0x34')],_0x37d50e['filters']),_0x25570b);if(_0x2a0298[_0x5d81('0x34')][_0x5d81('0x3b')]){_0x25d829[_0x5d81('0x3c')]=_[_0x5d81('0x3d')](_0x25d829[_0x5d81('0x3c')],{'$or':_[_0x5d81('0x3e')](_0x25d829['attributes'],function(_0x1c9b22){var _0x386c43={};_0x386c43[_0x1c9b22]={'$like':'%'+_0x2a0298[_0x5d81('0x34')][_0x5d81('0x3b')]+'%'};return _0x386c43;})});}_0x25d829=_[_0x5d81('0x3d')]({},_0x25d829,_0x2a0298[_0x5d81('0x3f')]);var _0x43e21d={'where':_0x25d829[_0x5d81('0x3c')]};return db[_0x5d81('0x40')][_0x5d81('0x1f')](_0x43e21d)[_0x5d81('0x27')](function(_0x150a92){_0x4a56d5[_0x5d81('0x1f')]=_0x150a92;if(_0x2a0298[_0x5d81('0x34')][_0x5d81('0x41')]){_0x25d829['include']=[{'all':!![]}];}return db[_0x5d81('0x40')][_0x5d81('0x42')](_0x25d829);})['then'](function(_0x32b251){_0x4a56d5[_0x5d81('0x43')]=_0x32b251;return _0x4a56d5;})[_0x5d81('0x27')](respondWithFilteredResult(_0x158851,_0x25d829))['catch'](handleError(_0x158851,null));})[_0x5d81('0x44')](handleError(_0x158851,null));};exports[_0x5d81('0x45')]=function(_0x17d6c0,_0x1935e0){var _0x375999={'raw':![],'where':{'id':_0x17d6c0[_0x5d81('0x46')]['id']}},_0x976c88={};_0x976c88[_0x5d81('0x30')]=_['keys'](db[_0x5d81('0x40')]['rawAttributes']);_0x976c88[_0x5d81('0x34')]=_[_0x5d81('0x31')](_0x17d6c0['query']);_0x976c88[_0x5d81('0x32')]=_[_0x5d81('0x33')](_0x976c88['model'],_0x976c88['query']);_0x375999[_0x5d81('0x35')]=_[_0x5d81('0x33')](_0x976c88['model'],qs[_0x5d81('0x36')](_0x17d6c0['query'][_0x5d81('0x36')]));_0x375999[_0x5d81('0x35')]=_0x375999[_0x5d81('0x35')][_0x5d81('0x47')]?_0x375999[_0x5d81('0x35')]:_0x976c88[_0x5d81('0x30')];if(_0x17d6c0[_0x5d81('0x34')][_0x5d81('0x41')]){_0x375999[_0x5d81('0x48')]=[{'all':!![]}];}_0x375999=_[_0x5d81('0x3d')]({},_0x375999,_0x17d6c0['options']);return db['CmCompany'][_0x5d81('0x49')](_0x375999)[_0x5d81('0x27')](handleEntityNotFound(_0x1935e0,null))[_0x5d81('0x27')](respondWithResult(_0x1935e0,null))[_0x5d81('0x44')](handleError(_0x1935e0,null));};exports[_0x5d81('0x4a')]=function(_0x37f84c,_0x370966){return db[_0x5d81('0x40')][_0x5d81('0x4a')](_0x37f84c[_0x5d81('0x4b')],{})[_0x5d81('0x27')](function(_0x119284){var _0x504097=_0x37f84c[_0x5d81('0x4c')][_0x5d81('0x28')]({'plain':!![]});if(!_0x504097)throw new Error(_0x5d81('0x4d'));if(_0x504097[_0x5d81('0x4e')]==='user'){var _0x273968=_0x119284[_0x5d81('0x28')]({'plain':!![]});var _0x431c39=_0x5d81('0x29');return db[_0x5d81('0x4f')][_0x5d81('0x49')]({'where':{'name':_0x431c39,'userProfileId':_0x504097[_0x5d81('0x50')]},'raw':!![]})[_0x5d81('0x27')](function(_0x58ac45){if(_0x58ac45&&_0x58ac45[_0x5d81('0x51')]===0x0){return db[_0x5d81('0x2a')][_0x5d81('0x4a')]({'name':_0x273968[_0x5d81('0x2c')],'resourceId':_0x273968['id'],'type':_0x58ac45[_0x5d81('0x2c')],'sectionId':_0x58ac45['id']},{})[_0x5d81('0x27')](function(){return _0x119284;});}else{return _0x119284;}})[_0x5d81('0x44')](function(_0x520dc9){logger[_0x5d81('0x52')](_0x5d81('0x53'),_0x520dc9);throw _0x520dc9;});}return _0x119284;})[_0x5d81('0x27')](respondWithResult(_0x370966,0xc9))[_0x5d81('0x44')](handleError(_0x370966,null));};exports[_0x5d81('0x25')]=function(_0x2840e6,_0x11a3c6){if(_0x2840e6[_0x5d81('0x4b')]['id']){delete _0x2840e6['body']['id'];}return db['CmCompany'][_0x5d81('0x49')]({'where':{'id':_0x2840e6[_0x5d81('0x46')]['id']}})['then'](handleEntityNotFound(_0x11a3c6,null))[_0x5d81('0x27')](saveUpdates(_0x2840e6[_0x5d81('0x4b')],null))[_0x5d81('0x27')](respondWithResult(_0x11a3c6,null))[_0x5d81('0x44')](handleError(_0x11a3c6,null));};exports['destroy']=function(_0x47b4f7,_0x143b04){return db[_0x5d81('0x40')][_0x5d81('0x49')]({'where':{'id':_0x47b4f7[_0x5d81('0x46')]['id']}})['then'](handleEntityNotFound(_0x143b04,null))[_0x5d81('0x27')](removeEntity(_0x143b04,null))[_0x5d81('0x44')](handleError(_0x143b04,null));};exports['describe']=function(_0x321283,_0xacc048){return db['CmCompany']['describe']()[_0x5d81('0x27')](respondWithResult(_0xacc048,null))['catch'](handleError(_0xacc048,null));};exports['addContacts']=function(_0x4cca4b,_0x44fc93,_0x3eebfc){return db[_0x5d81('0x54')][_0x5d81('0x49')]({'where':{'id':_0x4cca4b[_0x5d81('0x46')]['id']}})[_0x5d81('0x27')](handleEntityNotFound(_0x44fc93,null))[_0x5d81('0x27')](function(_0x57e791){if(_0x57e791){return _0x57e791[_0x5d81('0x55')](_0x4cca4b[_0x5d81('0x4b')][_0x5d81('0x56')],_['omit'](_0x4cca4b[_0x5d81('0x4b')],[_0x5d81('0x56'),'id'])||{});}})[_0x5d81('0x27')](respondWithResult(_0x44fc93,null))[_0x5d81('0x44')](handleError(_0x44fc93,null));};exports[_0x5d81('0x57')]=function(_0x954245,_0x35fe92,_0xe3b91c){var _0x64f311={};var _0x2c17a7={};var _0x13d247;var _0x56f3ed;return db['CmCompany']['findOne']({'where':{'id':_0x954245[_0x5d81('0x46')]['id']}})[_0x5d81('0x27')](handleEntityNotFound(_0x35fe92,null))[_0x5d81('0x27')](function(_0x31ec53){if(_0x31ec53){_0x13d247=_0x31ec53;_0x2c17a7[_0x5d81('0x30')]=_[_0x5d81('0x31')](db[_0x5d81('0x54')]['rawAttributes']);_0x2c17a7[_0x5d81('0x34')]=_[_0x5d81('0x31')](_0x954245['query']);_0x2c17a7[_0x5d81('0x32')]=_[_0x5d81('0x33')](_0x2c17a7[_0x5d81('0x30')],_0x2c17a7[_0x5d81('0x34')]);_0x64f311[_0x5d81('0x35')]=_['intersection'](_0x2c17a7[_0x5d81('0x30')],qs[_0x5d81('0x36')](_0x954245[_0x5d81('0x34')][_0x5d81('0x36')]));_0x64f311[_0x5d81('0x35')]=_0x64f311[_0x5d81('0x35')][_0x5d81('0x47')]?_0x64f311[_0x5d81('0x35')]:_0x2c17a7['model'];_0x64f311[_0x5d81('0x58')]=qs[_0x5d81('0x39')](_0x954245[_0x5d81('0x34')][_0x5d81('0x39')]);_0x64f311['where']=qs['filters'](_[_0x5d81('0x3a')](_0x954245[_0x5d81('0x34')],_0x2c17a7[_0x5d81('0x32')]));if(_0x954245[_0x5d81('0x34')][_0x5d81('0x3b')]){_0x64f311['where']=_[_0x5d81('0x3d')](_0x64f311[_0x5d81('0x3c')],{'$or':_[_0x5d81('0x3e')](_0x64f311[_0x5d81('0x35')],function(_0x1237c5){var _0x49f520={};_0x49f520[_0x1237c5]={'$like':'%'+_0x954245['query']['filter']+'%'};return _0x49f520;})});}_0x64f311=_[_0x5d81('0x3d')]({},_0x64f311,_0x954245[_0x5d81('0x3f')]);return _0x13d247['getContacts'](_0x64f311);}})[_0x5d81('0x27')](function(_0x3c49e2){if(_0x3c49e2){_0x56f3ed=_0x3c49e2['length'];if(!_0x954245['query']['hasOwnProperty'](_0x5d81('0x38'))){_0x64f311[_0x5d81('0x1e')]=qs[_0x5d81('0x1e')](_0x954245['query'][_0x5d81('0x1e')]);_0x64f311[_0x5d81('0x20')]=qs[_0x5d81('0x20')](_0x954245[_0x5d81('0x34')]['offset']);}return _0x13d247['getContacts'](_0x64f311);}})[_0x5d81('0x27')](function(_0x592ab5){if(_0x592ab5){return _0x592ab5?{'count':_0x56f3ed,'rows':_0x592ab5}:null;}})[_0x5d81('0x27')](respondWithResult(_0x35fe92,null))[_0x5d81('0x44')](handleError(_0x35fe92,null));}; \ No newline at end of file +var _0xa0d1=['destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','describe','addContacts','ids','omit','getContacts','CmContact','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','save','update','then'];(function(_0xe05e88,_0x54cbaf){var _0x4dde32=function(_0x17deca){while(--_0x17deca){_0xe05e88['push'](_0xe05e88['shift']());}};_0x4dde32(++_0x54cbaf);}(_0xa0d1,0x131));var _0x1a0d=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xa0d1[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0x1a0d('0x0'));var rimraf=require(_0x1a0d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a0d('0x2'));var moment=require(_0x1a0d('0x3'));var BPromise=require(_0x1a0d('0x4'));var Mustache=require(_0x1a0d('0x5'));var util=require(_0x1a0d('0x6'));var path=require(_0x1a0d('0x7'));var sox=require(_0x1a0d('0x8'));var csv=require(_0x1a0d('0x9'));var ejs=require(_0x1a0d('0xa'));var fs=require('fs');var fs_extra=require(_0x1a0d('0xb'));var _=require('lodash');var squel=require(_0x1a0d('0xc'));var crypto=require(_0x1a0d('0xd'));var jsforce=require(_0x1a0d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1a0d('0x9'));var querystring=require(_0x1a0d('0xf'));var Papa=require(_0x1a0d('0x10'));var Redis=require(_0x1a0d('0x11'));var authService=require(_0x1a0d('0x12'));var qs=require(_0x1a0d('0x13'));var as=require(_0x1a0d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a0d('0x15'))(_0x1a0d('0x16'));var utils=require('../../config/utils');var config=require(_0x1a0d('0x17'));var licenseUtil=require(_0x1a0d('0x18'));var db=require(_0x1a0d('0x19'))['db'];function respondWithStatusCode(_0x18be62,_0x5f47b7){_0x5f47b7=_0x5f47b7||0xcc;return function(_0x5ddc78){if(_0x5ddc78){return _0x18be62[_0x1a0d('0x1a')](_0x5f47b7);}return _0x18be62['status'](_0x5f47b7)[_0x1a0d('0x1b')]();};}function respondWithResult(_0x111e0c,_0xad2c6c){_0xad2c6c=_0xad2c6c||0xc8;return function(_0x403050){if(_0x403050){return _0x111e0c[_0x1a0d('0x1c')](_0xad2c6c)[_0x1a0d('0x1d')](_0x403050);}};}function respondWithFilteredResult(_0x2e0329,_0x140820){return function(_0x369ca0){if(_0x369ca0){var _0x201a77=typeof _0x140820['offset']===_0x1a0d('0x1e')&&typeof _0x140820['limit']===_0x1a0d('0x1e');var _0x5d25d9=_0x369ca0['count'];var _0x4461ee=_0x201a77?0x0:_0x140820[_0x1a0d('0x1f')];var _0x55d881=_0x201a77?_0x369ca0['count']:_0x140820[_0x1a0d('0x1f')]+_0x140820[_0x1a0d('0x20')];var _0x1b7e38;if(_0x55d881>=_0x5d25d9){_0x55d881=_0x5d25d9;_0x1b7e38=0xc8;}else{_0x1b7e38=0xce;}_0x2e0329['status'](_0x1b7e38);return _0x2e0329[_0x1a0d('0x21')](_0x1a0d('0x22'),_0x4461ee+'-'+_0x55d881+'/'+_0x5d25d9)[_0x1a0d('0x1d')](_0x369ca0);}return null;};}function patchUpdates(_0x2e8848){return function(_0x185df4){try{jsonpatch[_0x1a0d('0x23')](_0x185df4,_0x2e8848,!![]);}catch(_0x15a0c1){return BPromise['reject'](_0x15a0c1);}return _0x185df4[_0x1a0d('0x24')]();};}function saveUpdates(_0x341c6c,_0x59e6e9){return function(_0x26e6f9){if(_0x26e6f9){return _0x26e6f9[_0x1a0d('0x25')](_0x341c6c)[_0x1a0d('0x26')](function(_0x3892b4){return _0x3892b4;});}return null;};}function removeEntity(_0x59e0a0,_0x53d740){return function(_0x47ea5d){if(_0x47ea5d){return _0x47ea5d[_0x1a0d('0x27')]()['then'](function(){var _0x408082=_0x47ea5d[_0x1a0d('0x28')]({'plain':!![]});var _0x5d0b13=_0x1a0d('0x29');return db[_0x1a0d('0x2a')][_0x1a0d('0x27')]({'where':{'type':_0x5d0b13,'resourceId':_0x408082['id']}})[_0x1a0d('0x26')](function(){return _0x47ea5d;});})[_0x1a0d('0x26')](function(){_0x59e0a0[_0x1a0d('0x1c')](0xcc)[_0x1a0d('0x1b')]();});}};}function handleEntityNotFound(_0x97e1fd,_0x12ae9e){return function(_0x196769){if(!_0x196769){_0x97e1fd[_0x1a0d('0x1a')](0x194);}return _0x196769;};}function handleError(_0x2f748b,_0x2981f8){_0x2981f8=_0x2981f8||0x1f4;return function(_0x522965){logger[_0x1a0d('0x2b')](_0x522965[_0x1a0d('0x2c')]);if(_0x522965['name']){delete _0x522965[_0x1a0d('0x2d')];}_0x2f748b['status'](_0x2981f8)['send'](_0x522965);};}exports[_0x1a0d('0x2e')]=function(_0x3063c2,_0x3ea4b3){var _0x1980ec={},_0x156e63={},_0x56a848={'count':0x0,'rows':[]};return db[_0x1a0d('0x2f')]['describe']()['then'](function(_0x3e7f90){_0x156e63[_0x1a0d('0x30')]=_[_0x1a0d('0x31')](_0x3e7f90);_0x156e63[_0x1a0d('0x32')]=_['keys'](_0x3063c2[_0x1a0d('0x32')]);_0x156e63[_0x1a0d('0x33')]=_[_0x1a0d('0x34')](_0x156e63[_0x1a0d('0x30')],_0x156e63[_0x1a0d('0x32')]);_0x1980ec[_0x1a0d('0x35')]=_[_0x1a0d('0x34')](_0x156e63[_0x1a0d('0x30')],qs[_0x1a0d('0x36')](_0x3063c2['query'][_0x1a0d('0x36')]));_0x1980ec['attributes']=_0x1980ec[_0x1a0d('0x35')][_0x1a0d('0x37')]?_0x1980ec[_0x1a0d('0x35')]:_0x156e63[_0x1a0d('0x30')];if(!_0x3063c2[_0x1a0d('0x32')][_0x1a0d('0x38')](_0x1a0d('0x39'))){_0x1980ec[_0x1a0d('0x20')]=qs['limit'](_0x3063c2['query']['limit']);_0x1980ec[_0x1a0d('0x1f')]=qs[_0x1a0d('0x1f')](_0x3063c2[_0x1a0d('0x32')][_0x1a0d('0x1f')]);}_0x1980ec[_0x1a0d('0x3a')]=qs[_0x1a0d('0x3b')](_0x3063c2[_0x1a0d('0x32')][_0x1a0d('0x3b')]);_0x1980ec[_0x1a0d('0x3c')]=qs['filters'](_['pick'](_0x3063c2[_0x1a0d('0x32')],_0x156e63[_0x1a0d('0x33')]),_0x3e7f90);if(_0x3063c2[_0x1a0d('0x32')][_0x1a0d('0x3d')]){_0x1980ec['where']=_[_0x1a0d('0x3e')](_0x1980ec[_0x1a0d('0x3c')],{'$or':_[_0x1a0d('0x3f')](_0x1980ec['attributes'],function(_0x1f7362){var _0x5ed23d={};_0x5ed23d[_0x1f7362]={'$like':'%'+_0x3063c2[_0x1a0d('0x32')]['filter']+'%'};return _0x5ed23d;})});}_0x1980ec=_[_0x1a0d('0x3e')]({},_0x1980ec,_0x3063c2[_0x1a0d('0x40')]);var _0x5914a1={'where':_0x1980ec[_0x1a0d('0x3c')]};return db[_0x1a0d('0x2f')][_0x1a0d('0x41')](_0x5914a1)[_0x1a0d('0x26')](function(_0x380dfc){_0x56a848[_0x1a0d('0x41')]=_0x380dfc;if(_0x3063c2['query'][_0x1a0d('0x42')]){_0x1980ec[_0x1a0d('0x43')]=[{'all':!![]}];}return db[_0x1a0d('0x2f')][_0x1a0d('0x44')](_0x1980ec);})[_0x1a0d('0x26')](function(_0xa22b45){_0x56a848[_0x1a0d('0x45')]=_0xa22b45;return _0x56a848;})[_0x1a0d('0x26')](respondWithFilteredResult(_0x3ea4b3,_0x1980ec))['catch'](handleError(_0x3ea4b3,null));})[_0x1a0d('0x46')](handleError(_0x3ea4b3,null));};exports[_0x1a0d('0x47')]=function(_0x2d1c0c,_0x1e52c3){var _0x1b5525={'raw':![],'where':{'id':_0x2d1c0c[_0x1a0d('0x48')]['id']}},_0x28c272={};_0x28c272[_0x1a0d('0x30')]=_[_0x1a0d('0x31')](db[_0x1a0d('0x2f')][_0x1a0d('0x49')]);_0x28c272[_0x1a0d('0x32')]=_[_0x1a0d('0x31')](_0x2d1c0c['query']);_0x28c272[_0x1a0d('0x33')]=_[_0x1a0d('0x34')](_0x28c272['model'],_0x28c272[_0x1a0d('0x32')]);_0x1b5525[_0x1a0d('0x35')]=_[_0x1a0d('0x34')](_0x28c272['model'],qs[_0x1a0d('0x36')](_0x2d1c0c[_0x1a0d('0x32')][_0x1a0d('0x36')]));_0x1b5525[_0x1a0d('0x35')]=_0x1b5525[_0x1a0d('0x35')][_0x1a0d('0x37')]?_0x1b5525[_0x1a0d('0x35')]:_0x28c272[_0x1a0d('0x30')];if(_0x2d1c0c[_0x1a0d('0x32')][_0x1a0d('0x42')]){_0x1b5525[_0x1a0d('0x43')]=[{'all':!![]}];}_0x1b5525=_[_0x1a0d('0x3e')]({},_0x1b5525,_0x2d1c0c['options']);return db[_0x1a0d('0x2f')][_0x1a0d('0x4a')](_0x1b5525)['then'](handleEntityNotFound(_0x1e52c3,null))['then'](respondWithResult(_0x1e52c3,null))[_0x1a0d('0x46')](handleError(_0x1e52c3,null));};exports[_0x1a0d('0x4b')]=function(_0x2cb276,_0x580c78){return db['CmCompany'][_0x1a0d('0x4b')](_0x2cb276[_0x1a0d('0x4c')],{})[_0x1a0d('0x26')](function(_0x2bf37e){var _0x5cb045=_0x2cb276[_0x1a0d('0x4d')][_0x1a0d('0x28')]({'plain':!![]});if(!_0x5cb045)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cb045[_0x1a0d('0x4e')]===_0x1a0d('0x4d')){var _0x3d3abd=_0x2bf37e[_0x1a0d('0x28')]({'plain':!![]});var _0x2b46d3=_0x1a0d('0x29');return db[_0x1a0d('0x4f')][_0x1a0d('0x4a')]({'where':{'name':_0x2b46d3,'userProfileId':_0x5cb045['userProfileId']},'raw':!![]})[_0x1a0d('0x26')](function(_0x554534){if(_0x554534&&_0x554534['autoAssociation']===0x0){return db[_0x1a0d('0x2a')][_0x1a0d('0x4b')]({'name':_0x3d3abd[_0x1a0d('0x2d')],'resourceId':_0x3d3abd['id'],'type':_0x554534[_0x1a0d('0x2d')],'sectionId':_0x554534['id']},{})[_0x1a0d('0x26')](function(){return _0x2bf37e;});}else{return _0x2bf37e;}})[_0x1a0d('0x46')](function(_0x501f80){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x501f80);throw _0x501f80;});}return _0x2bf37e;})[_0x1a0d('0x26')](respondWithResult(_0x580c78,0xc9))['catch'](handleError(_0x580c78,null));};exports[_0x1a0d('0x25')]=function(_0x31a0ab,_0x31923b){if(_0x31a0ab[_0x1a0d('0x4c')]['id']){delete _0x31a0ab[_0x1a0d('0x4c')]['id'];}return db[_0x1a0d('0x2f')][_0x1a0d('0x4a')]({'where':{'id':_0x31a0ab[_0x1a0d('0x48')]['id']}})[_0x1a0d('0x26')](handleEntityNotFound(_0x31923b,null))[_0x1a0d('0x26')](saveUpdates(_0x31a0ab[_0x1a0d('0x4c')],null))[_0x1a0d('0x26')](respondWithResult(_0x31923b,null))[_0x1a0d('0x46')](handleError(_0x31923b,null));};exports['destroy']=function(_0x5242d7,_0x585d79){return db[_0x1a0d('0x2f')][_0x1a0d('0x4a')]({'where':{'id':_0x5242d7['params']['id']}})[_0x1a0d('0x26')](handleEntityNotFound(_0x585d79,null))[_0x1a0d('0x26')](removeEntity(_0x585d79,null))[_0x1a0d('0x46')](handleError(_0x585d79,null));};exports[_0x1a0d('0x50')]=function(_0x1fb454,_0x443d6a){return db[_0x1a0d('0x2f')][_0x1a0d('0x50')]()[_0x1a0d('0x26')](respondWithResult(_0x443d6a,null))['catch'](handleError(_0x443d6a,null));};exports[_0x1a0d('0x51')]=function(_0x48a47a,_0x26a112,_0x1245c4){return db['CmContact'][_0x1a0d('0x4a')]({'where':{'id':_0x48a47a[_0x1a0d('0x48')]['id']}})[_0x1a0d('0x26')](handleEntityNotFound(_0x26a112,null))[_0x1a0d('0x26')](function(_0xce5c64){if(_0xce5c64){return _0xce5c64[_0x1a0d('0x51')](_0x48a47a[_0x1a0d('0x4c')][_0x1a0d('0x52')],_[_0x1a0d('0x53')](_0x48a47a[_0x1a0d('0x4c')],['ids','id'])||{});}})[_0x1a0d('0x26')](respondWithResult(_0x26a112,null))['catch'](handleError(_0x26a112,null));};exports[_0x1a0d('0x54')]=function(_0x257381,_0x28d4bf,_0x14548a){var _0x4707f8={};var _0x3fb6f7={};var _0x4b0ad8;var _0x260cd4;return db['CmCompany']['findOne']({'where':{'id':_0x257381[_0x1a0d('0x48')]['id']}})[_0x1a0d('0x26')](handleEntityNotFound(_0x28d4bf,null))['then'](function(_0x43f9d3){if(_0x43f9d3){_0x4b0ad8=_0x43f9d3;_0x3fb6f7[_0x1a0d('0x30')]=_[_0x1a0d('0x31')](db[_0x1a0d('0x55')][_0x1a0d('0x49')]);_0x3fb6f7[_0x1a0d('0x32')]=_['keys'](_0x257381['query']);_0x3fb6f7[_0x1a0d('0x33')]=_[_0x1a0d('0x34')](_0x3fb6f7[_0x1a0d('0x30')],_0x3fb6f7[_0x1a0d('0x32')]);_0x4707f8[_0x1a0d('0x35')]=_[_0x1a0d('0x34')](_0x3fb6f7[_0x1a0d('0x30')],qs[_0x1a0d('0x36')](_0x257381[_0x1a0d('0x32')][_0x1a0d('0x36')]));_0x4707f8[_0x1a0d('0x35')]=_0x4707f8[_0x1a0d('0x35')][_0x1a0d('0x37')]?_0x4707f8[_0x1a0d('0x35')]:_0x3fb6f7[_0x1a0d('0x30')];_0x4707f8[_0x1a0d('0x3a')]=qs[_0x1a0d('0x3b')](_0x257381[_0x1a0d('0x32')]['sort']);_0x4707f8[_0x1a0d('0x3c')]=qs[_0x1a0d('0x33')](_['pick'](_0x257381[_0x1a0d('0x32')],_0x3fb6f7[_0x1a0d('0x33')]));if(_0x257381[_0x1a0d('0x32')]['filter']){_0x4707f8[_0x1a0d('0x3c')]=_[_0x1a0d('0x3e')](_0x4707f8[_0x1a0d('0x3c')],{'$or':_[_0x1a0d('0x3f')](_0x4707f8['attributes'],function(_0x135c38){var _0x1d76a={};_0x1d76a[_0x135c38]={'$like':'%'+_0x257381[_0x1a0d('0x32')][_0x1a0d('0x3d')]+'%'};return _0x1d76a;})});}_0x4707f8=_[_0x1a0d('0x3e')]({},_0x4707f8,_0x257381[_0x1a0d('0x40')]);return _0x4b0ad8['getContacts'](_0x4707f8);}})[_0x1a0d('0x26')](function(_0x428cc9){if(_0x428cc9){_0x260cd4=_0x428cc9[_0x1a0d('0x37')];if(!_0x257381['query']['hasOwnProperty'](_0x1a0d('0x39'))){_0x4707f8[_0x1a0d('0x20')]=qs['limit'](_0x257381[_0x1a0d('0x32')][_0x1a0d('0x20')]);_0x4707f8[_0x1a0d('0x1f')]=qs[_0x1a0d('0x1f')](_0x257381[_0x1a0d('0x32')][_0x1a0d('0x1f')]);}return _0x4b0ad8[_0x1a0d('0x54')](_0x4707f8);}})[_0x1a0d('0x26')](function(_0x266c8a){if(_0x266c8a){return _0x266c8a?{'count':_0x260cd4,'rows':_0x266c8a}:null;}})[_0x1a0d('0x26')](respondWithResult(_0x28d4bf,null))[_0x1a0d('0x46')](handleError(_0x28d4bf,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5a06efe..590c98b 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 _0xba86=['define','CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmCompany.attributes','exports'];(function(_0x2316bf,_0x21b3fa){var _0x416c62=function(_0x23ebaa){while(--_0x23ebaa){_0x2316bf['push'](_0x2316bf['shift']());}};_0x416c62(++_0x21b3fa);}(_0xba86,0x13b));var _0x6ba8=function(_0x4e419e,_0x4f9ca5){_0x4e419e=_0x4e419e-0x0;var _0x3880e5=_0xba86[_0x4e419e];return _0x3880e5;};'use strict';var _=require('lodash');var util=require(_0x6ba8('0x0'));var logger=require(_0x6ba8('0x1'))(_0x6ba8('0x2'));var moment=require(_0x6ba8('0x3'));var BPromise=require(_0x6ba8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ba8('0x5'));var rimraf=require('rimraf');var config=require(_0x6ba8('0x6'));var attributes=require(_0x6ba8('0x7'));module[_0x6ba8('0x8')]=function(_0x533e15,_0x102191){return _0x533e15[_0x6ba8('0x9')](_0x6ba8('0xa'),attributes,{'tableName':_0x6ba8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f85=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5bcb6c,_0x4d9061){var _0x35f0da=function(_0x301ff6){while(--_0x301ff6){_0x5bcb6c['push'](_0x5bcb6c['shift']());}};_0x35f0da(++_0x4d9061);}(_0x0f85,0xa4));var _0x50f8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0f85[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x50f8('0x0'));var util=require(_0x50f8('0x1'));var logger=require(_0x50f8('0x2'))('api');var moment=require(_0x50f8('0x3'));var BPromise=require(_0x50f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x50f8('0x5'));var rimraf=require(_0x50f8('0x6'));var config=require(_0x50f8('0x7'));var attributes=require(_0x50f8('0x8'));module[_0x50f8('0x9')]=function(_0x3366bc,_0x463b7b){return _0x3366bc[_0x50f8('0xa')](_0x50f8('0xb'),attributes,{'tableName':_0x50f8('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 8e56b4f..0fde81e 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 _0x6b30=['jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger'];(function(_0x1c4d52,_0x4d95e4){var _0x38f9a4=function(_0x3655ba){while(--_0x3655ba){_0x1c4d52['push'](_0x1c4d52['shift']());}};_0x38f9a4(++_0x4d95e4);}(_0x6b30,0x78));var _0x06b3=function(_0x3731a7,_0x19e8ab){_0x3731a7=_0x3731a7-0x0;var _0x71cae6=_0x6b30[_0x3731a7];return _0x71cae6;};'use strict';var _=require(_0x06b3('0x0'));var util=require(_0x06b3('0x1'));var moment=require(_0x06b3('0x2'));var BPromise=require(_0x06b3('0x3'));var rs=require(_0x06b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06b3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x06b3('0x6'));var client=jayson[_0x06b3('0x7')][_0x06b3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ee092,_0x584d88,_0x5f3b4b){return new BPromise(function(_0x265d70,_0x1eec64){return client[_0x06b3('0x9')](_0x5ee092,_0x5f3b4b)[_0x06b3('0xa')](function(_0x183416){logger['info'](_0x06b3('0xb'),_0x584d88,_0x06b3('0xc'));logger[_0x06b3('0xd')](_0x06b3('0xe'),_0x584d88,_0x06b3('0xc'),JSON[_0x06b3('0xf')](_0x183416));if(_0x183416[_0x06b3('0x10')]){if(_0x183416[_0x06b3('0x10')]['code']===0x1f4){logger[_0x06b3('0x10')](_0x06b3('0xb'),_0x584d88,_0x183416[_0x06b3('0x10')][_0x06b3('0x11')]);return _0x1eec64(_0x183416['error'][_0x06b3('0x11')]);}logger[_0x06b3('0x10')](_0x06b3('0xb'),_0x584d88,_0x183416[_0x06b3('0x10')][_0x06b3('0x11')]);return _0x265d70(_0x183416[_0x06b3('0x10')][_0x06b3('0x11')]);}else{logger[_0x06b3('0x12')](_0x06b3('0xb'),_0x584d88,_0x06b3('0xc'));_0x265d70(_0x183416[_0x06b3('0x13')][_0x06b3('0x11')]);}})[_0x06b3('0x14')](function(_0xb3aba9){logger[_0x06b3('0x10')](_0x06b3('0xb'),_0x584d88,_0xb3aba9);_0x1eec64(_0xb3aba9);});});} \ No newline at end of file +var _0xe8d6=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x39f060,_0xe1b897){var _0x3593e5=function(_0xaa7d0d){while(--_0xaa7d0d){_0x39f060['push'](_0x39f060['shift']());}};_0x3593e5(++_0xe1b897);}(_0xe8d6,0x13b));var _0x6e8d=function(_0xcae260,_0x3bca42){_0xcae260=_0xcae260-0x0;var _0xbb65b8=_0xe8d6[_0xcae260];return _0xbb65b8;};'use strict';var _=require(_0x6e8d('0x0'));var util=require(_0x6e8d('0x1'));var moment=require(_0x6e8d('0x2'));var BPromise=require(_0x6e8d('0x3'));var rs=require(_0x6e8d('0x4'));var fs=require('fs');var Redis=require(_0x6e8d('0x5'));var db=require(_0x6e8d('0x6'))['db'];var utils=require(_0x6e8d('0x7'));var logger=require('../../config/logger')(_0x6e8d('0x8'));var config=require(_0x6e8d('0x9'));var jayson=require(_0x6e8d('0xa'));var client=jayson[_0x6e8d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5884e3,_0x3c09a9,_0x52b406){return new BPromise(function(_0x40fba6,_0x244ae2){return client[_0x6e8d('0xc')](_0x5884e3,_0x52b406)['then'](function(_0x4521a0){logger[_0x6e8d('0xd')](_0x6e8d('0xe'),_0x3c09a9,_0x6e8d('0xf'));logger[_0x6e8d('0x10')](_0x6e8d('0x11'),_0x3c09a9,'request\x20sent',JSON[_0x6e8d('0x12')](_0x4521a0));if(_0x4521a0[_0x6e8d('0x13')]){if(_0x4521a0[_0x6e8d('0x13')][_0x6e8d('0x14')]===0x1f4){logger[_0x6e8d('0x13')]('CmCompany,\x20%s,\x20%s',_0x3c09a9,_0x4521a0['error'][_0x6e8d('0x15')]);return _0x244ae2(_0x4521a0['error'][_0x6e8d('0x15')]);}logger['error'](_0x6e8d('0xe'),_0x3c09a9,_0x4521a0[_0x6e8d('0x13')]['message']);return _0x40fba6(_0x4521a0[_0x6e8d('0x13')]['message']);}else{logger[_0x6e8d('0xd')](_0x6e8d('0xe'),_0x3c09a9,_0x6e8d('0xf'));_0x40fba6(_0x4521a0[_0x6e8d('0x16')][_0x6e8d('0x15')]);}})['catch'](function(_0x395085){logger['error'](_0x6e8d('0xe'),_0x3c09a9,_0x395085);_0x244ae2(_0x395085);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 8b876d4..97e5433 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 _0x2a8e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x560286,_0x17d496){var _0x1418aa=function(_0x6e1c2d){while(--_0x6e1c2d){_0x560286['push'](_0x560286['shift']());}};_0x1418aa(++_0x17d496);}(_0x2a8e,0x132));var _0xe2a8=function(_0x582a26,_0x4f2763){_0x582a26=_0x582a26-0x0;var _0xf2a262=_0x2a8e[_0x582a26];return _0xf2a262;};'use strict';var multer=require(_0xe2a8('0x0'));var util=require('util');var path=require(_0xe2a8('0x1'));var timeout=require(_0xe2a8('0x2'));var express=require(_0xe2a8('0x3'));var router=express[_0xe2a8('0x4')]();var fs_extra=require(_0xe2a8('0x5'));var auth=require(_0xe2a8('0x6'));var interaction=require(_0xe2a8('0x7'));var config=require(_0xe2a8('0x8'));var controller=require(_0xe2a8('0x9'));router['get']('/',auth[_0xe2a8('0xa')](),controller[_0xe2a8('0xb')]);router[_0xe2a8('0xc')](_0xe2a8('0xd'),auth[_0xe2a8('0xa')](),controller[_0xe2a8('0xe')]);router[_0xe2a8('0xc')](_0xe2a8('0xf'),auth['isAuthenticated'](),controller[_0xe2a8('0x10')]);router[_0xe2a8('0xc')](_0xe2a8('0x11'),auth[_0xe2a8('0xa')](),controller[_0xe2a8('0x12')]);router['post']('/',auth[_0xe2a8('0xa')](),controller[_0xe2a8('0x13')]);router[_0xe2a8('0x14')](_0xe2a8('0x11'),auth[_0xe2a8('0xa')](),controller[_0xe2a8('0x15')]);router[_0xe2a8('0x16')]('/:id',auth[_0xe2a8('0xa')](),controller[_0xe2a8('0x17')]);router[_0xe2a8('0x18')](_0xe2a8('0xf'),auth['isAuthenticated'](),controller[_0xe2a8('0x19')]);module['exports']=router; \ No newline at end of file +var _0xefce=['addContacts','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','/:id/contacts','getContacts','create'];(function(_0xb47828,_0x8665e4){var _0x1f3315=function(_0x42f77a){while(--_0x42f77a){_0xb47828['push'](_0xb47828['shift']());}};_0x1f3315(++_0x8665e4);}(_0xefce,0x1e8));var _0xeefc=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0xefce[_0x3522c8];return _0x22f498;};'use strict';var multer=require('multer');var util=require(_0xeefc('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeefc('0x1'));var router=express[_0xeefc('0x2')]();var fs_extra=require(_0xeefc('0x3'));var auth=require(_0xeefc('0x4'));var interaction=require(_0xeefc('0x5'));var config=require(_0xeefc('0x6'));var controller=require(_0xeefc('0x7'));router[_0xeefc('0x8')]('/',auth[_0xeefc('0x9')](),controller[_0xeefc('0xa')]);router['get']('/describe',auth[_0xeefc('0x9')](),controller[_0xeefc('0xb')]);router[_0xeefc('0x8')](_0xeefc('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xeefc('0x8')](_0xeefc('0xd'),auth['isAuthenticated'](),controller[_0xeefc('0xe')]);router['post']('/',auth[_0xeefc('0x9')](),controller[_0xeefc('0xf')]);router['post'](_0xeefc('0xd'),auth[_0xeefc('0x9')](),controller[_0xeefc('0x10')]);router['put'](_0xeefc('0xc'),auth[_0xeefc('0x9')](),controller[_0xeefc('0x11')]);router[_0xeefc('0x12')](_0xeefc('0xc'),auth[_0xeefc('0x9')](),controller[_0xeefc('0x13')]);module[_0xeefc('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a4151d4..9dfa8eb 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 _0xceb0=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xceb0,0x1de));var _0x0ceb=function(_0x17132c,_0x19111e){_0x17132c=_0x17132c-0x0;var _0xdf68fc=_0xceb0[_0x17132c];return _0xdf68fc;};'use strict';var _=require(_0x0ceb('0x0'));var Sequelize=require(_0x0ceb('0x1'));module[_0x0ceb('0x2')]={'firstName':{'type':Sequelize[_0x0ceb('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0ceb('0x3')]},'street':{'type':Sequelize[_0x0ceb('0x3')]},'postalCode':{'type':Sequelize[_0x0ceb('0x3')]},'city':{'type':Sequelize[_0x0ceb('0x3')]},'country':{'type':Sequelize[_0x0ceb('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0ceb('0x3')]},'description':{'type':Sequelize[_0x0ceb('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0ceb('0x3')]},'fax':{'type':Sequelize[_0x0ceb('0x3')]},'email':{'type':Sequelize[_0x0ceb('0x3')]},'url':{'type':Sequelize[_0x0ceb('0x3')]},'facebook':{'type':Sequelize[_0x0ceb('0x3')]},'fb_data':{'type':Sequelize[_0x0ceb('0x3')]},'twitter':{'type':Sequelize[_0x0ceb('0x3')]},'skype':{'type':Sequelize[_0x0ceb('0x3')]},'teams':{'type':Sequelize[_0x0ceb('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x0ceb('0x3')]},'wechat':{'type':Sequelize[_0x0ceb('0x3')]},'telegram':{'type':Sequelize[_0x0ceb('0x3')]},'UserId':{'type':Sequelize[_0x0ceb('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x0ceb('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x0ceb('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0ceb('0x7')],'defaultValue':Sequelize[_0x0ceb('0x8')]},'dialTimezone':{'type':Sequelize[_0x0ceb('0x3')]},'utcOffset':{'type':Sequelize[_0x0ceb('0x5')]}}; \ No newline at end of file +var _0x2159=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x2159,0x1e0));var _0x9215=function(_0x4d5cac,_0x5bf7bd){_0x4d5cac=_0x4d5cac-0x0;var _0x513307=_0x2159[_0x4d5cac];return _0x513307;};'use strict';var _=require(_0x9215('0x0'));var Sequelize=require(_0x9215('0x1'));module[_0x9215('0x2')]={'firstName':{'type':Sequelize[_0x9215('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x9215('0x3')]},'postalCode':{'type':Sequelize[_0x9215('0x3')]},'city':{'type':Sequelize[_0x9215('0x3')]},'country':{'type':Sequelize[_0x9215('0x3')]},'dateOfBirth':{'type':Sequelize[_0x9215('0x3')]},'description':{'type':Sequelize[_0x9215('0x4')]},'phone':{'type':Sequelize[_0x9215('0x3')]},'mobile':{'type':Sequelize[_0x9215('0x3')]},'fax':{'type':Sequelize[_0x9215('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9215('0x3')]},'facebook':{'type':Sequelize[_0x9215('0x3')]},'fb_data':{'type':Sequelize[_0x9215('0x3')]},'twitter':{'type':Sequelize[_0x9215('0x3')]},'skype':{'type':Sequelize[_0x9215('0x3')]},'teams':{'type':Sequelize[_0x9215('0x3')]},'viber':{'type':Sequelize[_0x9215('0x3')]},'line':{'type':Sequelize[_0x9215('0x3')]},'wechat':{'type':Sequelize[_0x9215('0x3')]},'telegram':{'type':Sequelize[_0x9215('0x3')]},'UserId':{'type':Sequelize[_0x9215('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x9215('0x3')]},'priority':{'type':Sequelize[_0x9215('0x5')](0x2)[_0x9215('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9215('0x7')],'defaultValue':Sequelize[_0x9215('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a8c601f..93a457a 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0x88cc=['Tag','Tags','color','tag','CmContactHasItem','ItemType','sequelize','literal','$and','CmCustomField','map','format','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','filters','attributes','model','fields','order','sort','pick','filter','nolimit','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','intersection','ContactId','options','includeAll','rows','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','upload','parse','import','agent','binding','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','pid','importUpdates','User','../../components/import/cm/csvUpdates','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','UserId','fullname','DESC','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','customerIp','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','Interaction','findAndCountAll','flatten','sortBy','reverse','value','slice','path','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','describe','getOptions','query','catch','find','params','CmContact','keys','length','startsWith','cf_','columnName','displayName','analytics','findAll','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','FaxInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','spread','push','contact','all','show'];(function(_0x1b2c0e,_0x1fd9fa){var _0x480de=function(_0x47e816){while(--_0x47e816){_0x1b2c0e['push'](_0x1b2c0e['shift']());}};_0x480de(++_0x1fd9fa);}(_0x88cc,0x9b));var _0xc88c=function(_0x11de83,_0x49e1c1){_0x11de83=_0x11de83-0x0;var _0x45bdb0=_0x88cc[_0x11de83];return _0x45bdb0;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0xc88c('0x0'));var fs=require('fs');var _=require(_0xc88c('0x1'));var squel=require('squel');var Papa=require(_0xc88c('0x2'));var Redis=require(_0xc88c('0x3'));var contacts=require(_0xc88c('0x4'));var qs=require(_0xc88c('0x5'));var logger=require(_0xc88c('0x6'))(_0xc88c('0x7'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0xc88c('0x8')]=_[_0xc88c('0x9')](config[_0xc88c('0x8')],{'host':_0xc88c('0xa'),'port':0x18eb});var socket=require(_0xc88c('0xb'))(new Redis(config[_0xc88c('0x8')]));require(_0xc88c('0xc'))[_0xc88c('0xd')](socket);function respondWithResult(_0x247bc1,_0x50aec4){_0x50aec4=_0x50aec4||0xc8;return function(_0x35074b){if(_0x35074b){return _0x247bc1[_0xc88c('0xe')](_0x50aec4)[_0xc88c('0xf')](_0x35074b);}};}function respondWithFilteredResult(_0x43fc5e,_0x19082f){return function(_0x2011fb){if(_0x2011fb){var _0x12217f=typeof _0x19082f[_0xc88c('0x10')]===_0xc88c('0x11')&&typeof _0x19082f[_0xc88c('0x12')]==='undefined';var _0x4a39fe=_0x2011fb['count'];var _0x28b20d=_0x12217f?0x0:_0x19082f[_0xc88c('0x10')];var _0x155ba3=_0x12217f?_0x2011fb[_0xc88c('0x13')]:_0x19082f[_0xc88c('0x10')]+_0x19082f[_0xc88c('0x12')];var _0x269392;if(_0x155ba3>=_0x4a39fe){_0x155ba3=_0x4a39fe;_0x269392=0xc8;}else{_0x269392=0xce;}_0x43fc5e['status'](_0x269392);return _0x43fc5e[_0xc88c('0x14')](_0xc88c('0x15'),_0x28b20d+'-'+_0x155ba3+'/'+_0x4a39fe)[_0xc88c('0xf')](_0x2011fb);}return null;};}function saveUpdates(_0x10180a){return function(_0xc2ecc2){if(_0xc2ecc2){return _0xc2ecc2[_0xc88c('0x16')](_0x10180a)[_0xc88c('0x17')](function(_0x186da9){return _0x186da9;});}return null;};}function removeEntity(_0x155205){return function(_0x259d49){if(_0x259d49){return _0x259d49[_0xc88c('0x18')]()[_0xc88c('0x17')](function(){_0x155205['status'](0xcc)[_0xc88c('0x19')]();});}};}function handleEntityNotFound(_0x49dcd1){return function(_0x5af4ef){if(!_0x5af4ef){_0x49dcd1['sendStatus'](0x194);}return _0x5af4ef;};}function handleError(_0x52c99a,_0xd13209){_0xd13209=_0xd13209||0x1f4;return function(_0xcfa1ca){logger[_0xc88c('0x1a')](_0xcfa1ca[_0xc88c('0x1b')]);if(_0xcfa1ca[_0xc88c('0x1c')]){delete _0xcfa1ca[_0xc88c('0x1c')];}_0x52c99a[_0xc88c('0xe')](_0xd13209)[_0xc88c('0x1d')](_0xcfa1ca);};}exports[_0xc88c('0x1e')]=function(_0x873b5f,_0x3f544b){var _0x260487={};return contacts[_0xc88c('0x1f')]()[_0xc88c('0x17')](function(_0x3007d6){_0x260487=qs[_0xc88c('0x20')](_0x3007d6,_0x873b5f);return contacts['findAll'](_0x873b5f[_0xc88c('0x21')],_0x873b5f['user'],_0x260487,_0x3007d6);})[_0xc88c('0x17')](respondWithFilteredResult(_0x3f544b,_0x260487))[_0xc88c('0x22')](handleError(_0x3f544b,null));};exports[_0xc88c('0x18')]=function(_0x298b50,_0x20673b){return db['CmContact'][_0xc88c('0x23')]({'where':{'id':_0x298b50[_0xc88c('0x24')]['id']}})['then'](handleEntityNotFound(_0x20673b,null))[_0xc88c('0x17')](removeEntity(_0x20673b,null))[_0xc88c('0x22')](handleError(_0x20673b,null));};exports[_0xc88c('0x1f')]=function(_0x21cee4,_0xefe0ca){return db[_0xc88c('0x25')][_0xc88c('0x1f')]()['then'](function(_0x12623c){delete _0x12623c['tags'];for(var _0x9b5579=0x0;_0x9b55790x0){return new Promise(function(_0x52f9ec){var _0x4ddeb1=[];for(var _0x30437d=0x0;_0x30437d<_0x28ef89[_0xc88c('0x27')];_0x30437d++){_0x4ddeb1[_0xc88c('0x61')](insertAdditionalPhones(_0x28ef89[_0x30437d][_0xc88c('0x62')],_0x28ef89[_0x30437d][_0xc88c('0x59')]));}Promise[_0xc88c('0x63')](_0x4ddeb1)[_0xc88c('0x17')](function(){_0x52f9ec(0x1);});})[_0xc88c('0x17')](function(){return{'success':_0x584f25,'failure':_0x451faf,'duplicates':_0xa3438e};});}else{return{'success':_0x584f25,'failure':_0x451faf,'duplicates':_0xa3438e};}}})[_0xc88c('0x17')](respondWithResult(_0x44f6f3,0xc9))['catch'](handleError(_0x44f6f3,null));};exports[_0xc88c('0x64')]=function(_0x120b71,_0x4484a1){var _0x363609;return db[_0xc88c('0x25')][_0xc88c('0x1f')]()[_0xc88c('0x17')](function(_0xe32e57){return db[_0xc88c('0x25')][_0xc88c('0x23')]({'where':{'id':_0x120b71[_0xc88c('0x24')]['id']},'include':[{'model':db[_0xc88c('0x65')],'as':_0xc88c('0x66'),'attributes':['id',_0xc88c('0x1c'),_0xc88c('0x67')],'required':_0x120b71[_0xc88c('0x21')][_0xc88c('0x68')]?!![]:![]},{'model':db[_0xc88c('0x69')],'as':'Phones','where':{'CmContactId':_0x120b71[_0xc88c('0x24')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xc88c('0x6a')}]}],'order':[db[_0xc88c('0x6b')][_0xc88c('0x6c')]('Phones.OrderBy')],'attributes':_['keys'](_0xe32e57)});})[_0xc88c('0x17')](function(_0x26ad15){if(!_[_0xc88c('0x55')](_0x26ad15)){_0x363609=_0x26ad15['get']({'plain':!![]});var _0x2ad073={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x26ad15&&_0x26ad15[_0xc88c('0x5f')]){if(_0x26ad15[_0xc88c('0x5f')]){_0x2ad073[_0xc88c('0x5d')][_0xc88c('0x6d')][_0xc88c('0x61')]({'ListId':{'$ne':_0x26ad15[_0xc88c('0x5f')]}});}}return db[_0xc88c('0x6e')][_0xc88c('0x2d')](_0x2ad073);}})[_0xc88c('0x17')](function(_0x3cce16){if(!_[_0xc88c('0x55')](_0x3cce16)){return _['omit'](_0x363609,_[_0xc88c('0x6f')](_0x3cce16,function(_0x16e5ab){return util[_0xc88c('0x70')](_0xc88c('0x71'),_0x16e5ab['id']);}));}})['then'](handleEntityNotFound(_0x4484a1,null))['then'](respondWithResult(_0x4484a1,null))[_0xc88c('0x22')](handleError(_0x4484a1,null));};exports[_0xc88c('0x16')]=function(_0x56a442,_0x818a0c){var _0x4239f0;if(_0x56a442['body']['id']){delete _0x56a442['body']['id'];}if(!_['isNil'](_0x56a442[_0xc88c('0x37')][_0xc88c('0x56')])){var _0xdb69dc=_0x56a442['body']['dialTimezone'];if(!_['isNil'](shared[_0xc88c('0x57')][_0xdb69dc]))_0x56a442['body']['utcOffset']=shared[_0xc88c('0x57')][_0xdb69dc]['utcOffset'];}return db['CmContact'][_0xc88c('0x23')]({'where':{'id':_0x56a442[_0xc88c('0x24')]['id']}})[_0xc88c('0x17')](handleEntityNotFound(_0x818a0c,null))[_0xc88c('0x17')](saveUpdates(_0x56a442[_0xc88c('0x37')],null))[_0xc88c('0x17')](function(_0x51cff8){_0x4239f0=_0x51cff8;var _0x356f84={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x51cff8&&_0x51cff8[_0xc88c('0x5f')]){if(_0x51cff8[_0xc88c('0x5f')]){_0x356f84[_0xc88c('0x5d')][_0xc88c('0x6d')][_0xc88c('0x61')]({'ListId':{'$ne':_0x51cff8[_0xc88c('0x5f')]}});}}return db[_0xc88c('0x6e')]['findAll'](_0x356f84);})[_0xc88c('0x17')](function(_0x53dc49){if(_0x53dc49){return _[_0xc88c('0x72')](_[_0xc88c('0x73')](_0x56a442[_0xc88c('0x37')],function(_0xa8b4ee,_0x493bd7){return _[_0xc88c('0x28')](_0x493bd7,'cf_');}),_[_0xc88c('0x6f')](_0x53dc49,function(_0x3e90fa){return util[_0xc88c('0x70')]('cf_%d',_0x3e90fa['id']);}));}})[_0xc88c('0x17')](function(_0x36f08f){if(_0x36f08f&&!_[_0xc88c('0x74')](_0x36f08f)){var _0x5c6e44=squel[_0xc88c('0x16')]()[_0xc88c('0x75')](_0xc88c('0x76'))[_0xc88c('0x77')](_0x36f08f)[_0xc88c('0x5d')](_0xc88c('0x78'),_0x56a442[_0xc88c('0x24')]['id'])[_0xc88c('0x79')]();return db['sequelize'][_0xc88c('0x21')](_0x5c6e44[_0xc88c('0x7a')],{'replacements':_0x5c6e44[_0xc88c('0x31')]});}})[_0xc88c('0x17')](function(){if(_0x56a442['body'][_0xc88c('0x7b')]&&_0x4239f0){return db[_0xc88c('0x3f')][_0xc88c('0x16')]({'phone':_0x56a442[_0xc88c('0x37')][_0xc88c('0x7b')],'OrderBy':0x0},{'where':{'ContactId':_0x4239f0['id']}});}})[_0xc88c('0x17')](function(){return _0x4239f0;})[_0xc88c('0x17')](respondWithResult(_0x818a0c,null))[_0xc88c('0x22')](handleError(_0x818a0c,null));};exports[_0xc88c('0x7c')]=function(_0x363eb6,_0x29db42){var _0x525185={};var _0x3c7ddb={};var _0xf30b86;var _0x5881fe;return db[_0xc88c('0x25')][_0xc88c('0x7d')]({'where':{'id':_0x363eb6[_0xc88c('0x24')]['id']}})[_0xc88c('0x17')](handleEntityNotFound(_0x29db42,null))[_0xc88c('0x17')](function(_0x2c06ca){if(_0x2c06ca){_0xf30b86=_0x2c06ca;_0x3c7ddb['model']=_['keys'](db[_0xc88c('0x65')][_0xc88c('0x7e')]);_0x3c7ddb[_0xc88c('0x21')]=_[_0xc88c('0x26')](_0x363eb6[_0xc88c('0x21')]);_0x3c7ddb[_0xc88c('0x7f')]=_['intersection'](_0x3c7ddb['model'],_0x3c7ddb['query']);_0x525185[_0xc88c('0x80')]=_['intersection'](_0x3c7ddb[_0xc88c('0x81')],qs[_0xc88c('0x82')](_0x363eb6[_0xc88c('0x21')][_0xc88c('0x82')]));_0x525185[_0xc88c('0x80')]=_0x525185[_0xc88c('0x80')][_0xc88c('0x27')]?_0x525185[_0xc88c('0x80')]:_0x3c7ddb['model'];_0x525185[_0xc88c('0x83')]=qs['sort'](_0x363eb6[_0xc88c('0x21')][_0xc88c('0x84')]);_0x525185[_0xc88c('0x5d')]=qs[_0xc88c('0x7f')](_[_0xc88c('0x85')](_0x363eb6['query'],_0x3c7ddb[_0xc88c('0x7f')]));if(_0x363eb6['query'][_0xc88c('0x86')]){_0x525185[_0xc88c('0x5d')]=_[_0xc88c('0x36')](_0x525185[_0xc88c('0x5d')],{'$or':_[_0xc88c('0x6f')](_0x525185[_0xc88c('0x80')],function(_0x4193aa){var _0x1393a7={};_0x1393a7[_0x4193aa]={'$like':'%'+_0x363eb6['query'][_0xc88c('0x86')]+'%'};return _0x1393a7;})});}_0x525185=_[_0xc88c('0x36')]({},_0x525185,_0x363eb6['options']);return _0xf30b86[_0xc88c('0x7c')](_0x525185);}})[_0xc88c('0x17')](function(_0x311ac1){if(_0x311ac1){_0x5881fe=_0x311ac1['length'];if(!_0x363eb6[_0xc88c('0x21')][_0xc88c('0x35')](_0xc88c('0x87'))){_0x525185[_0xc88c('0x12')]=qs[_0xc88c('0x12')](_0x363eb6['query'][_0xc88c('0x12')]);_0x525185[_0xc88c('0x10')]=qs[_0xc88c('0x10')](_0x363eb6['query'][_0xc88c('0x10')]);}return _0xf30b86['getTags'](_0x525185);}})[_0xc88c('0x17')](function(_0x5e4bbd){if(_0x5e4bbd){return _0x5e4bbd?{'count':_0x5881fe,'rows':_0x5e4bbd}:null;}})[_0xc88c('0x17')](respondWithResult(_0x29db42,null))[_0xc88c('0x22')](handleError(_0x29db42,null));};exports[_0xc88c('0x88')]=function(_0x40b216,_0x46395d){if(_0x40b216[_0xc88c('0x37')]['id']){delete _0x40b216[_0xc88c('0x37')]['id'];}return db[_0xc88c('0x25')][_0xc88c('0x7d')]({'where':{'id':_0x40b216[_0xc88c('0x24')]['id']}})['then'](handleEntityNotFound(_0x46395d,null))[_0xc88c('0x17')](function(_0x2d69a3){if(_0x2d69a3){return _0x2d69a3[_0xc88c('0x88')](_0x40b216[_0xc88c('0x37')][_0xc88c('0x89')]||[]);}return null;})['then'](respondWithResult(_0x46395d,null))['catch'](handleError(_0x46395d,null));};exports[_0xc88c('0x8a')]=function(_0xaa9136,_0x3edf26){var _0x1ee518=[];_0x1ee518[_0xc88c('0x61')](addAdditionalPhones(_0xaa9136[_0xc88c('0x37')]));Promise[_0xc88c('0x63')](_0x1ee518)[_0xc88c('0x17')](function(){_0x1ee518=[];_0x1ee518['push'](deleteCmHopperPhones(_0xaa9136['body']['id']));_0x1ee518[_0xc88c('0x61')](addCmHopperPhones(_0xaa9136[_0xc88c('0x37')]['id']));Promise[_0xc88c('0x63')](_0x1ee518)[_0xc88c('0x17')](function(){return[0x1];})[_0xc88c('0x17')](respondWithResult(_0x3edf26,null));});};function addAdditionalPhones(_0x489fc6){var _0x34747f;return new Promise(function(_0x703778){return db[_0xc88c('0x69')]['destroy']({'where':{'CmContactId':_0x489fc6['id']}})['then'](function(){db[_0xc88c('0x8b')][_0xc88c('0x2d')]({'raw':!![],'attributes':['id',_0xc88c('0x8c')]})[_0xc88c('0x17')](function(_0x489bc4){var _0x1fce66=[];for(var _0x1e0e14=0x0;_0x1e0e14<_0x489fc6[_0xc88c('0x8d')][_0xc88c('0x27')];_0x1e0e14++){var _0x184065=_0x489fc6['item_types']?_[_0xc88c('0x55')](_0x489fc6[_0xc88c('0x8e')][_0x1e0e14])?'':_0x489fc6[_0xc88c('0x8e')][_0x1e0e14]:_0x489fc6[_0xc88c('0x8d')][_0x1e0e14][_0xc88c('0x8f')]?_0x489fc6[_0xc88c('0x8d')][_0x1e0e14][_0xc88c('0x8f')]:'';var _0x68ad74=_[_0xc88c('0x55')](_0x489fc6[_0xc88c('0x8d')][_0x1e0e14][_0xc88c('0x90')])?'':_0x489fc6['items'][_0x1e0e14]['description'];var _0x2e91ea=_0x184065+':'+_0x489fc6['items'][_0x1e0e14][_0xc88c('0x7b')]+'§'+_0x68ad74;if(_['isNil'](_0x34747f))_0x34747f=_0x2e91ea;else _0x34747f+=';'+_0x2e91ea;var _0x4dcefc=null;var _0x5a1abc=null;if(_0x489fc6['item_types']){if(!_[_0xc88c('0x55')](_0x489fc6[_0xc88c('0x8e')][_0x1e0e14])){_0x5a1abc=_[_0xc88c('0x23')](_0x489bc4,function(_0x1e78e3){return _0x1e78e3['id']===_0x489fc6[_0xc88c('0x8e')][_0x1e0e14];});if(!_[_0xc88c('0x55')](_0x5a1abc)){_0x4dcefc=_0x5a1abc[_0xc88c('0x8c')];}}}else{if(!_[_0xc88c('0x55')](_0x489fc6[_0xc88c('0x8d')][_0x1e0e14])){_0x5a1abc=_['find'](_0x489bc4,function(_0x438943){return _0x438943['id']===_0x489fc6[_0xc88c('0x8d')][_0x1e0e14]['ItemTypeId'];});if(!_[_0xc88c('0x55')](_0x5a1abc)){_0x4dcefc=_0x1e0e14;}}}if(_[_0xc88c('0x55')](_0x4dcefc)){_0x4dcefc=0x64;}_0x1fce66['push'](addAdditionalPhone(_0x489fc6['id'],_0x489fc6[_0xc88c('0x8d')][_0x1e0e14]['phone'],_0x489fc6[_0xc88c('0x8e')]?_[_0xc88c('0x55')](_0x489fc6[_0xc88c('0x8e')][_0x1e0e14])?null:_0x489fc6[_0xc88c('0x8e')][_0x1e0e14]:_0x489fc6[_0xc88c('0x8d')][_0x1e0e14][_0xc88c('0x8f')]?_0x489fc6[_0xc88c('0x8d')][_0x1e0e14][_0xc88c('0x8f')]:null,_0x4dcefc,_0x68ad74));}Promise[_0xc88c('0x63')](_0x1fce66)[_0xc88c('0x17')](function(){db[_0xc88c('0x25')][_0xc88c('0x16')]({'AdditionalPhones':_0x34747f},{'where':{'id':_0x489fc6['id']}})[_0xc88c('0x17')](function(){_0x703778(0x1);});});});});});}function addAdditionalPhone(_0x4ef7ea,_0x5be4ec,_0x556e18,_0x1839aa,_0x5903ff){return db[_0xc88c('0x69')][_0xc88c('0x23')]({'where':{'CmContactId':_0x4ef7ea,'item':_0x5be4ec}})['then'](function(_0x7c73ea){if(_0x7c73ea)logger['info'](_0xc88c('0x91'),_0x7c73ea);else{db[_0xc88c('0x69')][_0xc88c('0x43')]({'CmContactId':_0x4ef7ea,'item':_0x5be4ec,'ItemTypeId':_0x556e18,'OrderBy':_0x1839aa,'ItemClass':_0xc88c('0x92'),'description':_0x5903ff});}});}function deleteCmHopperPhones(_0x3ab4f7){return new Promise(function(_0x118f38){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3ab4f7}})[_0xc88c('0x17')](function(_0x5c8538){db[_0xc88c('0x93')][_0xc88c('0x18')]({'where':{'CmHopperId':{'$in':_['map'](_0x5c8538,'id')}}});})[_0xc88c('0x17')](function(){_0x118f38(0x1);});});}function addCmHopperPhones(_0x30cbc1){return new Promise(function(_0x1a83a6){return db[_0xc88c('0x3f')][_0xc88c('0x2d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x30cbc1}})[_0xc88c('0x17')](function(_0x48eaa6){var _0x2a88b3=[];_[_0xc88c('0x6f')](_0x48eaa6,function(_0x3abe86){_0x2a88b3[_0xc88c('0x61')](createCmHopperPhone(_0x30cbc1,_0x3abe86['id']));});Promise['all'](_0x2a88b3)[_0xc88c('0x17')](function(){_0x1a83a6(0x1);});});});}function createCmHopperPhone(_0x52e07b,_0x9425e1){return new Promise(function(_0x4008f8){db[_0xc88c('0x69')][_0xc88c('0x2d')]({'raw':!![],'attributes':[_0xc88c('0x94'),'OrderBy'],'where':{'CmContactId':_0x52e07b,'ItemClass':_0xc88c('0x92')},'include':[{'model':db[_0xc88c('0x8b')],'attributes':[_0xc88c('0x8c')],'as':_0xc88c('0x6a')}],'order':[_0xc88c('0x8c'),db[_0xc88c('0x6b')][_0xc88c('0x6c')]('`ItemType`.OrderBy')]})[_0xc88c('0x17')](function(_0x17bb11){var _0x443479=0x1;var _0x230198=_[_0xc88c('0x6f')](_0x17bb11,function(_0x7bc029){_0x7bc029['CmHopperId']=_0x9425e1;_0x7bc029[_0xc88c('0x7b')]=_0x7bc029[_0xc88c('0x94')];_0x7bc029['OrderBy']=_0x443479;delete _0x7bc029['ItemType.OrderBy'];_0x443479=_0x443479+0x1;return _0x7bc029;});return db[_0xc88c('0x93')][_0xc88c('0x5a')](_0x230198,{});})['then'](function(){_0x4008f8(0x1);});});}function insertAdditionalPhones(_0x23227a,_0x5716e4){return new Promise(function(_0x574fe1){var _0x15eaf5=[];for(var _0x1da09b=0x0;_0x1da09b<_0x5716e4[_0xc88c('0x27')];_0x1da09b++){var _0x51522c=_0x5716e4[_0x1da09b];_0x15eaf5['push'](parseContactItemType(_0x51522c));}Promise[_0xc88c('0x63')](_0x15eaf5)[_0xc88c('0x17')](function(){var _0x217500={'id':_0x23227a['id'],'items':_0x5716e4};return addAdditionalPhones(_0x217500)[_0xc88c('0x17')](function(){return addCmHopperPhones(_0x23227a['id']);});})[_0xc88c('0x17')](function(){_0x574fe1(_0x23227a);});});}function parseContactItemType(_0x4e0729){return new Promise(function(_0x95c043){if(_0x4e0729[_0xc88c('0x35')](_0xc88c('0x8f'))){_0x95c043(_0x4e0729);}else{return db['ContactItemType'][_0xc88c('0x23')]({'where':{'name':_0x4e0729[_0xc88c('0x6a')]}})[_0xc88c('0x17')](function(_0x1895af){if(_[_0xc88c('0x55')](_0x1895af))_0x4e0729['ItemTypeId']=null;else _0x4e0729[_0xc88c('0x8f')]=_0x1895af['id'];_0x95c043(_0x4e0729);});}});}exports[_0xc88c('0x95')]=function(_0x29801f,_0x72def2){return db[_0xc88c('0x69')][_0xc88c('0x2d')]({'raw':!![],'where':{'CmContactId':_0x29801f['params']['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xc88c('0x8b')],'as':'ItemType'}],'order':[['OrderBy'],[db[_0xc88c('0x6b')]['literal'](_0xc88c('0x96'))]]})[_0xc88c('0x17')](function(_0x5ea8e0){return _0x5ea8e0;})[_0xc88c('0x17')](respondWithResult(_0x72def2,null))[_0xc88c('0x22')](handleError(_0x72def2,null));};exports[_0xc88c('0x97')]=function(_0x4895a3,_0x3c1150){return db[_0xc88c('0x69')][_0xc88c('0x2d')]({'raw':!![],'where':{'CmContactId':_0x4895a3[_0xc88c('0x37')][_0xc88c('0x98')]}})['then'](function(_0x29d8db){var _0x294793=_[_0xc88c('0x6f')](_0x29d8db,function(_0xe30a02){_0xe30a02[_0xc88c('0x99')]=_0x4895a3[_0xc88c('0x37')][_0xc88c('0x9a')];return _0xe30a02;});return db[_0xc88c('0x69')][_0xc88c('0x5a')](_0x294793,{});})[_0xc88c('0x17')](function(){return addCmHopperPhones(_0x4895a3[_0xc88c('0x37')][_0xc88c('0x9a')]);})[_0xc88c('0x17')](function(){return['ok'];})[_0xc88c('0x17')](respondWithResult(_0x3c1150,null))[_0xc88c('0x22')](handleError(_0x3c1150,null));};exports[_0xc88c('0x9b')]=function(_0x384618,_0x23b76e){var _0x4d1aaa=[];_0x4d1aaa[_0xc88c('0x61')](createCmHopperPhone(_0x384618[_0xc88c('0x37')]['id'],_0x384618[_0xc88c('0x37')][_0xc88c('0x9c')]));Promise[_0xc88c('0x63')](_0x4d1aaa)[_0xc88c('0x17')](function(){return[0x1];})[_0xc88c('0x17')](respondWithResult(_0x23b76e,null));};exports['getHoppers']=function(_0x59f93c,_0x322b97){var _0x3e2855={'raw':![],'where':{}};var _0x18a6bc={};var _0x2d640d={'count':0x0,'rows':[]};return db[_0xc88c('0x25')][_0xc88c('0x7d')]({'where':{'id':_0x59f93c['params']['id']}})['then'](handleEntityNotFound(_0x322b97,null))[_0xc88c('0x17')](function(_0x70f238){if(_0x70f238){_0x18a6bc['model']=_['keys'](db[_0xc88c('0x3f')][_0xc88c('0x7e')]);_0x18a6bc['query']=_[_0xc88c('0x26')](_0x59f93c[_0xc88c('0x21')]);_0x18a6bc[_0xc88c('0x7f')]=_[_0xc88c('0x9d')](_0x18a6bc[_0xc88c('0x81')],_0x18a6bc[_0xc88c('0x21')]);_0x3e2855[_0xc88c('0x80')]=_['intersection'](_0x18a6bc[_0xc88c('0x81')],qs['fields'](_0x59f93c[_0xc88c('0x21')]['fields']));_0x3e2855[_0xc88c('0x80')]=_0x3e2855[_0xc88c('0x80')][_0xc88c('0x27')]?_0x3e2855[_0xc88c('0x80')]:_0x18a6bc[_0xc88c('0x81')];if(!_0x59f93c['query'][_0xc88c('0x35')](_0xc88c('0x87'))){_0x3e2855[_0xc88c('0x12')]=qs[_0xc88c('0x12')](_0x59f93c['query'][_0xc88c('0x12')]);_0x3e2855[_0xc88c('0x10')]=qs['offset'](_0x59f93c[_0xc88c('0x21')]['offset']);}_0x3e2855[_0xc88c('0x83')]=qs[_0xc88c('0x84')](_0x59f93c[_0xc88c('0x21')][_0xc88c('0x84')]);_0x3e2855[_0xc88c('0x5d')]=qs[_0xc88c('0x7f')](_['pick'](_0x59f93c[_0xc88c('0x21')],_0x18a6bc['filters']));_0x3e2855[_0xc88c('0x5d')][_0xc88c('0x9e')]=_0x70f238['id'];if(_0x59f93c[_0xc88c('0x21')][_0xc88c('0x86')]){_0x3e2855[_0xc88c('0x5d')]=_['merge'](_0x3e2855[_0xc88c('0x5d')],{'$or':_[_0xc88c('0x6f')](_0x3e2855['attributes'],function(_0x2b25a4){var _0x571cc3={};_0x571cc3[_0x2b25a4]={'$like':'%'+_0x59f93c[_0xc88c('0x21')]['filter']+'%'};return _0x571cc3;})});}_0x3e2855=_[_0xc88c('0x36')]({},_0x3e2855,_0x59f93c[_0xc88c('0x9f')]);return db[_0xc88c('0x3f')][_0xc88c('0x13')]({'where':_0x3e2855[_0xc88c('0x5d')]})['then'](function(_0x4bb84c){_0x2d640d[_0xc88c('0x13')]=_0x4bb84c;if(_0x59f93c[_0xc88c('0x21')][_0xc88c('0xa0')]){_0x3e2855['include']=[{'all':!![]}];}return db[_0xc88c('0x3f')][_0xc88c('0x2d')](_0x3e2855);})[_0xc88c('0x17')](function(_0x4b7da){_0x2d640d[_0xc88c('0xa1')]=_0x4b7da;return _0x2d640d;});}})[_0xc88c('0x17')](respondWithFilteredResult(_0x322b97,_0x3e2855))['catch'](handleError(_0x322b97,null));};exports[_0xc88c('0xa2')]=function(_0x1c7b51,_0x5c8c19){var _0x180305={'raw':!![],'where':{}};var _0x3ab2e3={};var _0x1253ba={'count':0x0,'rows':[]};return db['CmContact'][_0xc88c('0x7d')]({'where':{'id':_0x1c7b51['params']['id']}})[_0xc88c('0x17')](handleEntityNotFound(_0x5c8c19,null))[_0xc88c('0x17')](function(_0x554fc1){if(_0x554fc1){_0x3ab2e3[_0xc88c('0x81')]=_[_0xc88c('0x26')](db[_0xc88c('0x4c')][_0xc88c('0x7e')]);_0x3ab2e3[_0xc88c('0x21')]=_[_0xc88c('0x26')](_0x1c7b51['query']);_0x3ab2e3['filters']=_[_0xc88c('0x9d')](_0x3ab2e3[_0xc88c('0x81')],_0x3ab2e3[_0xc88c('0x21')]);_0x180305['attributes']=_[_0xc88c('0x9d')](_0x3ab2e3['model'],qs[_0xc88c('0x82')](_0x1c7b51[_0xc88c('0x21')][_0xc88c('0x82')]));_0x180305[_0xc88c('0x80')]=_0x180305['attributes'][_0xc88c('0x27')]?_0x180305[_0xc88c('0x80')]:_0x3ab2e3[_0xc88c('0x81')];if(!_0x1c7b51[_0xc88c('0x21')][_0xc88c('0x35')](_0xc88c('0x87'))){_0x180305[_0xc88c('0x12')]=qs[_0xc88c('0x12')](_0x1c7b51['query'][_0xc88c('0x12')]);_0x180305['offset']=qs['offset'](_0x1c7b51['query']['offset']);}_0x180305['order']=qs[_0xc88c('0x84')](_0x1c7b51['query'][_0xc88c('0x84')]);_0x180305['where']=qs[_0xc88c('0x7f')](_[_0xc88c('0x85')](_0x1c7b51[_0xc88c('0x21')],_0x3ab2e3['filters']));_0x180305[_0xc88c('0x5d')][_0xc88c('0x9e')]=_0x554fc1['id'];if(_0x1c7b51['query'][_0xc88c('0x86')]){_0x180305[_0xc88c('0x5d')]=_[_0xc88c('0x36')](_0x180305[_0xc88c('0x5d')],{'$or':_[_0xc88c('0x6f')](_0x180305['attributes'],function(_0x49ef7f){var _0x44ff59={};_0x44ff59[_0x49ef7f]={'$like':'%'+_0x1c7b51[_0xc88c('0x21')][_0xc88c('0x86')]+'%'};return _0x44ff59;})});}_0x180305=_['merge']({},_0x180305,_0x1c7b51[_0xc88c('0x9f')]);return db[_0xc88c('0x4c')][_0xc88c('0x13')]({'where':_0x180305['where']})['then'](function(_0x705d91){_0x1253ba[_0xc88c('0x13')]=_0x705d91;if(_0x1c7b51[_0xc88c('0x21')][_0xc88c('0xa0')]){_0x180305['include']=[{'all':!![]}];}return db[_0xc88c('0x4c')][_0xc88c('0x2d')](_0x180305);})[_0xc88c('0x17')](function(_0x3e4f61){_0x1253ba['rows']=_0x3e4f61;return _0x1253ba;});}})['then'](respondWithFilteredResult(_0x5c8c19,_0x180305))[_0xc88c('0x22')](handleError(_0x5c8c19,null));};exports[_0xc88c('0xa3')]=function(_0x393d22,_0x47d38c){var _0x3fd9c6={'raw':!![],'where':{}};var _0x2f46e2={};var _0xe935a2={'count':0x0,'rows':[]};return db[_0xc88c('0x25')][_0xc88c('0x7d')]({'where':{'id':_0x393d22[_0xc88c('0x24')]['id']}})[_0xc88c('0x17')](handleEntityNotFound(_0x47d38c,null))[_0xc88c('0x17')](function(_0x39e988){if(_0x39e988){_0x2f46e2[_0xc88c('0x81')]=_[_0xc88c('0x26')](db[_0xc88c('0x4b')][_0xc88c('0x7e')]);_0x2f46e2['query']=_[_0xc88c('0x26')](_0x393d22[_0xc88c('0x21')]);_0x2f46e2[_0xc88c('0x7f')]=_[_0xc88c('0x9d')](_0x2f46e2['model'],_0x2f46e2[_0xc88c('0x21')]);_0x3fd9c6['attributes']=_['intersection'](_0x2f46e2[_0xc88c('0x81')],qs[_0xc88c('0x82')](_0x393d22['query'][_0xc88c('0x82')]));_0x3fd9c6['attributes']=_0x3fd9c6[_0xc88c('0x80')][_0xc88c('0x27')]?_0x3fd9c6[_0xc88c('0x80')]:_0x2f46e2[_0xc88c('0x81')];if(!_0x393d22[_0xc88c('0x21')][_0xc88c('0x35')]('nolimit')){_0x3fd9c6[_0xc88c('0x12')]=qs[_0xc88c('0x12')](_0x393d22[_0xc88c('0x21')]['limit']);_0x3fd9c6[_0xc88c('0x10')]=qs[_0xc88c('0x10')](_0x393d22[_0xc88c('0x21')][_0xc88c('0x10')]);}_0x3fd9c6[_0xc88c('0x83')]=qs['sort'](_0x393d22['query']['sort']);_0x3fd9c6['where']=qs[_0xc88c('0x7f')](_['pick'](_0x393d22[_0xc88c('0x21')],_0x2f46e2[_0xc88c('0x7f')]));_0x3fd9c6[_0xc88c('0x5d')][_0xc88c('0x9e')]=_0x39e988['id'];if(_0x393d22['query'][_0xc88c('0x86')]){_0x3fd9c6[_0xc88c('0x5d')]=_[_0xc88c('0x36')](_0x3fd9c6[_0xc88c('0x5d')],{'$or':_['map'](_0x3fd9c6[_0xc88c('0x80')],function(_0x4edd32){var _0x55de63={};_0x55de63[_0x4edd32]={'$like':'%'+_0x393d22[_0xc88c('0x21')][_0xc88c('0x86')]+'%'};return _0x55de63;})});}_0x3fd9c6=_[_0xc88c('0x36')]({},_0x3fd9c6,_0x393d22[_0xc88c('0x9f')]);return db[_0xc88c('0x4b')]['count']({'where':_0x3fd9c6[_0xc88c('0x5d')]})['then'](function(_0x1fcf03){_0xe935a2[_0xc88c('0x13')]=_0x1fcf03;if(_0x393d22[_0xc88c('0x21')][_0xc88c('0xa0')]){_0x3fd9c6['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3fd9c6);})[_0xc88c('0x17')](function(_0x3bae12){_0xe935a2[_0xc88c('0xa1')]=_0x3bae12;return _0xe935a2;});}})[_0xc88c('0x17')](respondWithFilteredResult(_0x47d38c,_0x3fd9c6))[_0xc88c('0x22')](handleError(_0x47d38c,null));};exports[_0xc88c('0xa4')]=function(_0x10108a,_0x19e67f){var _0x2fb9b0={'raw':!![],'where':{}};var _0x5bb78c={};var _0x298215={'count':0x0,'rows':[]};return db[_0xc88c('0x25')][_0xc88c('0x7d')]({'where':{'id':_0x10108a[_0xc88c('0x24')]['id']}})[_0xc88c('0x17')](handleEntityNotFound(_0x19e67f,null))[_0xc88c('0x17')](function(_0x226537){if(_0x226537){_0x5bb78c['model']=_[_0xc88c('0x26')](db['JscriptySessionReport'][_0xc88c('0x7e')]);_0x5bb78c[_0xc88c('0x21')]=_[_0xc88c('0x26')](_0x10108a[_0xc88c('0x21')]);_0x5bb78c[_0xc88c('0x7f')]=_[_0xc88c('0x9d')](_0x5bb78c['model'],_0x5bb78c[_0xc88c('0x21')]);_0x2fb9b0[_0xc88c('0x80')]=_[_0xc88c('0x9d')](_0x5bb78c[_0xc88c('0x81')],qs[_0xc88c('0x82')](_0x10108a[_0xc88c('0x21')][_0xc88c('0x82')]));_0x2fb9b0[_0xc88c('0x80')]=_0x2fb9b0[_0xc88c('0x80')][_0xc88c('0x27')]?_0x2fb9b0[_0xc88c('0x80')]:_0x5bb78c[_0xc88c('0x81')];if(!_0x10108a[_0xc88c('0x21')][_0xc88c('0x35')]('nolimit')){_0x2fb9b0['limit']=qs[_0xc88c('0x12')](_0x10108a['query'][_0xc88c('0x12')]);_0x2fb9b0[_0xc88c('0x10')]=qs['offset'](_0x10108a[_0xc88c('0x21')][_0xc88c('0x10')]);}_0x2fb9b0['order']=qs[_0xc88c('0x84')](_0x10108a[_0xc88c('0x21')][_0xc88c('0x84')]);_0x2fb9b0[_0xc88c('0x5d')]=qs[_0xc88c('0x7f')](_['pick'](_0x10108a['query'],_0x5bb78c[_0xc88c('0x7f')]));_0x2fb9b0['where'][_0xc88c('0x9e')]=_0x226537['id'];if(_0x10108a['query'][_0xc88c('0x86')]){_0x2fb9b0[_0xc88c('0x5d')]=_[_0xc88c('0x36')](_0x2fb9b0[_0xc88c('0x5d')],{'$or':_[_0xc88c('0x6f')](_0x2fb9b0[_0xc88c('0x80')],function(_0xf31515){var _0x39028f={};_0x39028f[_0xf31515]={'$like':'%'+_0x10108a['query'][_0xc88c('0x86')]+'%'};return _0x39028f;})});}_0x2fb9b0=_['merge']({},_0x2fb9b0,_0x10108a[_0xc88c('0x9f')]);return db['JscriptySessionReport'][_0xc88c('0x13')]({'where':_0x2fb9b0[_0xc88c('0x5d')]})[_0xc88c('0x17')](function(_0x5023cc){_0x298215['count']=_0x5023cc;if(_0x10108a['query'][_0xc88c('0xa0')]){_0x2fb9b0['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xc88c('0x2d')](_0x2fb9b0);})[_0xc88c('0x17')](function(_0x3fd91d){_0x298215[_0xc88c('0xa1')]=_0x3fd91d;return _0x298215;});}})[_0xc88c('0x17')](respondWithFilteredResult(_0x19e67f,_0x2fb9b0))['catch'](handleError(_0x19e67f,null));};exports[_0xc88c('0xa5')]=function(_0x41da43,_0xc92ebb){try{if(!_0x41da43['body']['ListId']){throw new Error(_0xc88c('0xa6'));}if(!_0x41da43[_0xc88c('0x37')][_0xc88c('0xa7')]){throw new Error(_0xc88c('0xa8'));}if(!_0x41da43[_0xc88c('0x37')][_0xc88c('0xa9')]){throw new Error(_0xc88c('0xaa'));}if(!_0x41da43['body'][_0xc88c('0xab')]){throw new Error(_0xc88c('0xac'));}var _0x114162=_0x41da43['body']['binding_keys'][_0xc88c('0xad')](',');var _0x390547=_0x41da43[_0xc88c('0x37')]['binding_values']['split'](',');if(!_0x114162[_0xc88c('0x27')]||!_0x390547[_0xc88c('0x27')]||_0x114162[_0xc88c('0x27')]!==_0x390547[_0xc88c('0x27')]){throw new Error(_0xc88c('0xae'));}_0x41da43[_0xc88c('0x37')][_0xc88c('0x82')]=_[_0xc88c('0xaf')](_0x114162,_0x390547);if(!_0x41da43['body'][_0xc88c('0x82')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x41da43[_0xc88c('0x37')]['fields'][_0xc88c('0xb0')]){throw new Error(_0xc88c('0xb1'));}var _0x3b51be=path[_0xc88c('0x3d')](config[_0xc88c('0xb2')],_0xc88c('0xb3'),_0x41da43[_0xc88c('0xb4')][_0xc88c('0xb5')]);fs['chmodSync'](_0x3b51be,parseInt(_0xc88c('0xb6'),0x8));var _0x2cc013=require(_0xc88c('0xb7'))[_0xc88c('0xb8')](path[_0xc88c('0x3d')](__dirname,_0xc88c('0xb9')),[_0x3b51be,_0x41da43[_0xc88c('0x37')][_0xc88c('0xa7')],_0x41da43[_0xc88c('0x37')][_0xc88c('0xa9')],_0x41da43[_0xc88c('0x37')][_0xc88c('0x5f')],_0x41da43[_0xc88c('0x37')][_0xc88c('0xba')],_0x41da43[_0xc88c('0x37')][_0xc88c('0x5c')],_0x41da43['body'][_0xc88c('0xab')]]);return _0xc92ebb['status'](0xc8)['json']({'message':'File\x20uploaded\x20correctly!','pid':_0x2cc013['pid']});}catch(_0x14ed67){return _0xc92ebb['status'](0x1f4)[_0xc88c('0x1d')](_0x14ed67);}};exports[_0xc88c('0xbb')]=function(_0x229af4,_0x117ac2){var _0x3dd67e=fs['createReadStream'](_0x229af4['file'][_0xc88c('0x0')]);Papa[_0xc88c('0xbc')](_0x3dd67e,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3821f7){return _0x117ac2[_0xc88c('0xe')](0xc8)[_0xc88c('0xf')]({'file':_0x229af4[_0xc88c('0xb4')],'fields':_0x3821f7['meta'][_0xc88c('0x82')]});}});};exports[_0xc88c('0xbd')]=function(_0x2c7a6b,_0x4a1f6e){return db['User'][_0xc88c('0x2d')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc88c('0xbe')}})[_0xc88c('0x17')](function(_0x220883){var _0x1bce69=![];if(!_0x2c7a6b[_0xc88c('0x37')][_0xc88c('0x5f')]){throw new Error(_0xc88c('0xa6'));}if(!_0x2c7a6b[_0xc88c('0x37')][_0xc88c('0xbf')][_0xc88c('0x7b')]){throw new Error(_0xc88c('0xc0'));}if(!_0x2c7a6b[_0xc88c('0x37')][_0xc88c('0xbf')][_0xc88c('0xb0')]){throw new Error(_0xc88c('0xb1'));}if(!_0x2c7a6b['body'][_0xc88c('0xab')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4964e8=require(_0xc88c('0xb7'))[_0xc88c('0xb8')](path[_0xc88c('0x3d')](__dirname,_0xc88c('0xc1')),[_0x2c7a6b[_0xc88c('0x24')]['id'],JSON[_0xc88c('0xc2')](_0x2c7a6b[_0xc88c('0x37')]),JSON[_0xc88c('0xc2')](_0x220883)]);_0x4964e8['on'](_0xc88c('0xc3'),function(){_0x1bce69=!![];return _0x4a1f6e[_0xc88c('0xe')](0xc8)[_0xc88c('0xf')]({'message':_0xc88c('0xc4'),'pid':_0x4964e8['pid']});});_0x4964e8['on'](_0xc88c('0xc5'),function(_0x1a686c){if(_0x1a686c&&!_0x1bce69){return _0x4a1f6e[_0xc88c('0xe')](0x1f4)[_0xc88c('0xf')]({'message':'error\x20child\x20process','pid':_0x4964e8[_0xc88c('0xc6')]});}});})[_0xc88c('0x22')](handleError(_0x4a1f6e,null));};exports[_0xc88c('0xc7')]=function(_0x35ae35,_0x7b8df1){return db[_0xc88c('0xc8')][_0xc88c('0x2d')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc88c('0xbe')}})[_0xc88c('0x17')](function(_0x265496){var _0x47b5ce=![];if(!_0x35ae35['body'][_0xc88c('0x5f')]){throw new Error(_0xc88c('0xa6'));}if(!_0x35ae35[_0xc88c('0x37')][_0xc88c('0xbf')]['phone']){throw new Error(_0xc88c('0xc0'));}if(!_0x35ae35['body'][_0xc88c('0xbf')][_0xc88c('0xb0')]){throw new Error(_0xc88c('0xb1'));}if(!_0x35ae35[_0xc88c('0x37')][_0xc88c('0xab')]){throw new Error(_0xc88c('0xac'));}var _0x9184b3=require(_0xc88c('0xb7'))[_0xc88c('0xb8')](path[_0xc88c('0x3d')](__dirname,_0xc88c('0xc9')),[_0x35ae35[_0xc88c('0x24')]['id'],JSON['stringify'](_0x35ae35[_0xc88c('0x37')]),JSON['stringify'](_0x265496)]);_0x9184b3['on'](_0xc88c('0xc3'),function(){_0x47b5ce=!![];return _0x7b8df1[_0xc88c('0xe')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x9184b3[_0xc88c('0xc6')]});});_0x9184b3['on']('exit',function(_0x5b41e0){if(_0x5b41e0&&!_0x47b5ce){return _0x7b8df1[_0xc88c('0xe')](0x1f4)[_0xc88c('0xf')]({'message':_0xc88c('0xca'),'pid':_0x9184b3[_0xc88c('0xc6')]});}});})['catch'](handleError(_0x7b8df1,null));};exports[_0xc88c('0xcb')]=function(_0x134244,_0x3ecad8){var _0x47accc=['mail',_0xc88c('0xcc'),_0xc88c('0xcd'),_0xc88c('0xce'),_0xc88c('0xcf'),_0xc88c('0xd0'),_0xc88c('0xd1')];var _0x3ad5fb={'offset':0x0,'order':qs[_0xc88c('0x84')](_0xc88c('0xd2'))},_0x2f13db={'count':0x0,'rows':[]};Promise[_0xc88c('0xd3')]()[_0xc88c('0x17')](function(){if(_0x134244['query'][_0xc88c('0xd4')]){if(!_[_0xc88c('0xd5')](_0x47accc,_0x134244[_0xc88c('0x21')][_0xc88c('0xd4')][_0xc88c('0xd6')]())){throw new Error('Invalid\x20channel');}_0x47accc=[_0x134244['query'][_0xc88c('0xd4')][_0xc88c('0xd6')]()];}if(_0x134244[_0xc88c('0x21')][_0xc88c('0xd7')]){try{var _0x21801e=JSON[_0xc88c('0xbc')](_0x134244[_0xc88c('0x21')][_0xc88c('0xd7')]);if(!moment(_0x21801e['from'])['isValid']()){throw new Error(_0xc88c('0xd8'));}if(!moment(_0x21801e['to'])['isValid']()){throw new Error(_0xc88c('0xd9'));}}catch(_0x1095da){throw new Error(_0xc88c('0xda'));}}if(!_0x134244[_0xc88c('0x21')][_0xc88c('0x35')]('nolimit')){_0x3ad5fb['limit']=qs['limit'](_0x134244[_0xc88c('0x21')][_0xc88c('0x12')]||0xa);_0x3ad5fb['offset']=qs['offset'](_0x134244[_0xc88c('0x21')][_0xc88c('0x10')]);}var _0x251ca5=_0x47accc[_0xc88c('0x6f')](function(_0x466cf6){if(_0x466cf6===_0xc88c('0xd1')){var _0x53b9a8={'attributes':['id',_0xc88c('0xdb'),_0xc88c('0x30'),_0xc88c('0xdc'),_0xc88c('0xdd'),_0xc88c('0xde'),_0xc88c('0xdf'),'endtime',_0xc88c('0xe0'),_0xc88c('0xe1'),_0xc88c('0xe2'),_0xc88c('0xe3'),'userSecondDisposition','userThirdDisposition',_0xc88c('0xe4')],'where':{'ContactId':_0x134244['params']['id']},'include':[{'model':db[_0xc88c('0xc8')],'as':_0xc88c('0xc8'),'attributes':['id',_0xc88c('0x1c'),_0xc88c('0xe5'),_0xc88c('0x2e')]}],'order':[[_0xc88c('0xe2'),_0xc88c('0xe6')]]};if(_0x134244[_0xc88c('0x21')]['range']){_0x53b9a8[_0xc88c('0x5d')][_0xc88c('0xe2')]={'$gte':_0x21801e[_0xc88c('0x38')],'$lte':_0x21801e['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x53b9a8)[_0xc88c('0x17')](function(_0x3d090d){_0x2f13db[_0xc88c('0x13')]+=_0x3d090d['count'];return _[_0xc88c('0x6f')](_0x3d090d[_0xc88c('0xa1')],function(_0x1d4e6d){var _0x68945a=_0x1d4e6d[_0xc88c('0x39')]({'plain':!![]});_0x68945a[_0xc88c('0xd4')]=_0x466cf6;if(_0x68945a[_0xc88c('0xc8')]){_0x68945a[_0xc88c('0xc8')]={'id':_0x68945a[_0xc88c('0xc8')]['id'],'name':_0x68945a[_0xc88c('0xc8')]['name'],'fullname':_0x68945a[_0xc88c('0xc8')][_0xc88c('0xe5')],'alias':_0x68945a['User'][_0xc88c('0x2e')]};}return _0x68945a;});});}else{var _0x4628b2=_[_0xc88c('0xe7')](_0x466cf6)+(_0x466cf6===_0xc88c('0xcc')?_0xc88c('0xe8'):_0xc88c('0xe9'));var _0x259f38={'attributes':['id',_0xc88c('0xea'),_0xc88c('0xeb'),'createdAt',_0xc88c('0xe1'),_0xc88c('0xec'),_0xc88c('0xed'),_0xc88c('0xee'),_0xc88c('0xe4'),_0x4628b2+'Id'],'where':{'ContactId':_0x134244[_0xc88c('0x24')]['id']},'include':[{'model':db[_0x4628b2],'as':_0xc88c('0xe9'),'attributes':['id',_0xc88c('0x1c'),_0xc88c('0xef')]},{'model':db[_0xc88c('0xc8')],'as':_0xc88c('0xf0'),'attributes':['id',_0xc88c('0x1c'),_0xc88c('0xe5')]},{'model':db[_0xc88c('0x65')],'as':_0xc88c('0x66'),'attributes':['id','name',_0xc88c('0x67')],'through':{'attributes':[]}}],'order':[['createdAt',_0xc88c('0xe6')]]};if(_0x134244[_0xc88c('0x21')][_0xc88c('0xd7')]){_0x259f38[_0xc88c('0x5d')][_0xc88c('0xe2')]={'$gte':_0x21801e[_0xc88c('0x38')],'$lte':_0x21801e['to']};}switch(_0x466cf6){case _0xc88c('0xcc'):_0x259f38[_0xc88c('0x80')][_0xc88c('0x61')]('browserName',_0xc88c('0xf1'),'customerPort','deviceModel','osName',_0xc88c('0xf2'),_0xc88c('0xf3'),_0xc88c('0xf4'),_0xc88c('0xf5'));break;case _0xc88c('0xf6'):_0x259f38[_0xc88c('0x80')][_0xc88c('0x61')](_0xc88c('0xf7'),_0xc88c('0xf8'));break;case _0xc88c('0xce'):_0x259f38['attributes'][_0xc88c('0x61')]('externalUrl','threadId');break;}return db[_['startCase'](_0x466cf6)+_0xc88c('0xf9')][_0xc88c('0xfa')](_0x259f38)[_0xc88c('0x17')](function(_0x4c4d70){_0x2f13db[_0xc88c('0x13')]+=_0x4c4d70[_0xc88c('0x13')];return _[_0xc88c('0x6f')](_0x4c4d70['rows'],function(_0xb4fce6){var _0x472f3d=_0xb4fce6[_0xc88c('0x39')]({'plain':!![]});_0x472f3d[_0xc88c('0xd4')]=_0x466cf6;if(_0x472f3d[_0xc88c('0xf0')]){_0x472f3d[_0xc88c('0xf0')]={'id':_0x472f3d['Owner']['id'],'name':_0x472f3d[_0xc88c('0xf0')][_0xc88c('0x1c')],'fullname':_0x472f3d[_0xc88c('0xf0')]['fullname']};}return _0x472f3d;});});}});return Promise[_0xc88c('0x63')](_0x251ca5);})[_0xc88c('0x17')](function(_0x57bdce){return _(_0x57bdce)[_0xc88c('0xfb')]()[_0xc88c('0xfc')]('createdAt')[_0xc88c('0xfd')]()[_0xc88c('0xfe')]();})['then'](function(_0x20655a){_0x2f13db[_0xc88c('0xa1')]=_0x3ad5fb[_0xc88c('0x12')]?_0x20655a[_0xc88c('0xff')](_0x3ad5fb['offset'],_0x3ad5fb[_0xc88c('0x10')]+_0x3ad5fb['limit']):_0x20655a;return _0x2f13db;})[_0xc88c('0x17')](respondWithFilteredResult(_0x3ecad8,_0x3ad5fb))[_0xc88c('0x22')](handleError(_0x3ecad8,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 211349c..178793f 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 _0xaa1c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','CmContact'];(function(_0x98332a,_0x3665fa){var _0xcefab0=function(_0x5bab10){while(--_0x5bab10){_0x98332a['push'](_0x98332a['shift']());}};_0xcefab0(++_0x3665fa);}(_0xaa1c,0x94));var _0xcaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1c[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xcaa1('0x0'));var CmContact=require('../../mysqldb')['db'][_0xcaa1('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xcaa1('0x2')](0x0);var events={'afterCreate':_0xcaa1('0x3'),'afterUpdate':_0xcaa1('0x4'),'afterDestroy':_0xcaa1('0x5')};function emitEvent(_0x294bb8){return function(_0xa1681c,_0x3d0498,_0x2590fc){CmContactEvents[_0xcaa1('0x6')](_0x294bb8+':'+_0xa1681c['id'],_0xa1681c);CmContactEvents[_0xcaa1('0x6')](_0x294bb8,_0xa1681c);_0x2590fc(null);};}for(var e in events){if(events[_0xcaa1('0x7')](e)){var event=events[e];CmContact[_0xcaa1('0x8')](e,emitEvent(event));}}module[_0xcaa1('0x9')]=CmContactEvents; \ No newline at end of file +var _0x296a=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x296a,0x15a));var _0xa296=function(_0x5b3702,_0x55912d){_0x5b3702=_0x5b3702-0x0;var _0x4ba573=_0x296a[_0x5b3702];return _0x4ba573;};'use strict';var EventEmitter=require(_0xa296('0x0'));var CmContact=require(_0xa296('0x1'))['db'][_0xa296('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xa296('0x3')](0x0);var events={'afterCreate':_0xa296('0x4'),'afterUpdate':_0xa296('0x5'),'afterDestroy':_0xa296('0x6')};function emitEvent(_0x1cf8c7){return function(_0x223adb,_0x69001a,_0x4dc2c8){CmContactEvents['emit'](_0x1cf8c7+':'+_0x223adb['id'],_0x223adb);CmContactEvents[_0xa296('0x7')](_0x1cf8c7,_0x223adb);_0x4dc2c8(null);};}for(var e in events){if(events[_0xa296('0x8')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xa296('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 33db8f1..d7a2694 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 _0xd4de=['scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','isNil','timezones','utcOffset','add','minutes','then','CmHopper','cmContact,\x20afterCreate\x20','ListId','priority','callbackUniqueid','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','catch','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','CampaignId','push','[CmContact][afterDestroy][Error]','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','lastName','mobile','email','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate'];(function(_0x4e1a6b,_0x4d65c7){var _0x1ade0c=function(_0x378d8d){while(--_0x378d8d){_0x4e1a6b['push'](_0x4e1a6b['shift']());}};_0x1ade0c(++_0x4d65c7);}(_0xd4de,0x154));var _0xed4d=function(_0xd464bf,_0x4cf0e4){_0xd464bf=_0xd464bf-0x0;var _0xf4f72f=_0xd4de[_0xd464bf];return _0xf4f72f;};'use strict';var _=require('lodash');var util=require(_0xed4d('0x0'));var logger=require(_0xed4d('0x1'))(_0xed4d('0x2'));var moment=require('moment');var BPromise=require(_0xed4d('0x3'));var rp=require(_0xed4d('0x4'));var fs=require('fs');var path=require(_0xed4d('0x5'));var rimraf=require(_0xed4d('0x6'));var config=require(_0xed4d('0x7'));var shared=require(_0xed4d('0x8'));var attributes=require(_0xed4d('0x9'));module[_0xed4d('0xa')]=function(_0xa46716,_0x5bc47f){return _0xa46716[_0xed4d('0xb')]('CmContact',attributes,{'tableName':_0xed4d('0xc'),'paranoid':!![],'indexes':[{'name':_0xed4d('0xd'),'fields':[_0xed4d('0xd')]},{'name':_0xed4d('0xe'),'fields':['firstName',_0xed4d('0xf'),_0xed4d('0xd'),_0xed4d('0x10'),'fax',_0xed4d('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xed4d('0x12'),'collate':_0xed4d('0x13'),'hooks':{'afterCreate':function(_0x326b2e,_0xcf45c8,_0x3f29ac){var _0x41ef2c=_0xa46716[_0xed4d('0x14')];var _0x200064=_0x326b2e[_0xed4d('0x15')]({'plain':!![]});function _0x272dc6(){return function(_0x256b68){logger[_0xed4d('0x16')](_0xed4d('0x17'),_0xed4d('0x18'),util['inspect'](_0x256b68,{'showHidden':![],'depth':null}));};}function _0x2f3f67(_0x2653b4,_0x3a61ff){var _0x371d24=_0x3a61ff['scheduledat']?_0x3a61ff[_0xed4d('0x19')]:moment()[_0xed4d('0x1a')](_0xed4d('0x1b'));return new BPromise(function(_0x5c51d0,_0x4761e5){if(_['isNil'](_0x3a61ff[_0xed4d('0x1c')])){_0x5c51d0({'ret':_0x371d24});}else{_0x41ef2c[_0xed4d('0x1d')][_0xed4d('0x1e')]({'where':{'id':_0x2653b4['id']}})['then'](function(_0x13def2){if(!_[_0xed4d('0x1f')](_0x13def2)){var _0x3a49d5=_0x13def2[_0xed4d('0x1c')];if(!_[_0xed4d('0x1f')](_0x3a49d5)){var _0x485e08=shared[_0xed4d('0x20')];var _0x335549=_0x485e08[_0x3a49d5];var _0xe6fed8=_0x485e08[_0x3a61ff[_0xed4d('0x1c')]];if(!_[_0xed4d('0x1f')](_0x335549)&&!_['isNil'](_0xe6fed8)){var _0x4c1f5d=_0x335549[_0xed4d('0x21')]-_0xe6fed8[_0xed4d('0x21')];_0x371d24=_0x3a61ff[_0xed4d('0x19')]?_0x3a61ff[_0xed4d('0x19')]:moment();var _0x6de384=moment(_0x371d24)[_0xed4d('0x22')](_0x4c1f5d,_0xed4d('0x23'));_0x5c51d0({'ret':_0x6de384[_0xed4d('0x1a')](_0xed4d('0x1b'))});}else _0x5c51d0({'ret':_0x371d24});}else _0x5c51d0({'ret':_0x371d24});}else{_0x5c51d0({'ret':_0x371d24});}});}});return 0xa;}var _0x19c5e8=function(_0x1faabc){return new BPromise(function(_0x4e25d6,_0x19bd6c){_0x2f3f67(_0x1faabc,_0x200064)[_0xed4d('0x24')](function(_0xcbb01b){_0x200064['scheduledat']=_0xcbb01b['ret'];_0x41ef2c[_0xed4d('0x25')][_0xed4d('0x1e')]({'where':{'phone':_0x200064[_0xed4d('0xd')],'VoiceQueueId':_0x1faabc['id']}})['then'](function(_0x5d06bc){if(!_[_0xed4d('0x1f')](_0x5d06bc)){throw new Error(_0xed4d('0x26')+_0x200064[_0xed4d('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x1faabc['id']);}return _0x41ef2c[_0xed4d('0x25')]['create']({'phone':_0x200064[_0xed4d('0xd')],'ContactId':_0x200064['id'],'ListId':_0x200064[_0xed4d('0x27')],'priority':_0x200064[_0xed4d('0x28')]?_0x200064[_0xed4d('0x28')]:0x2,'scheduledat':_0x200064['scheduledat']?_0x200064['scheduledat']:moment()[_0xed4d('0x1a')](_0xed4d('0x1b')),'callback':_0x200064[_0xed4d('0x29')]?!![]:![],'callbackuniqueid':_0x200064['callbackUniqueid']?_0x200064[_0xed4d('0x29')]:undefined,'callbackat':_0x200064[_0xed4d('0x29')]?moment()[_0xed4d('0x1a')](_0xed4d('0x1b')):undefined,'VoiceQueueId':_0x1faabc['id']});})['catch'](function(_0x5a095b){_0x19bd6c(_0x5a095b);});});});};var _0x4b902e=function(_0x13c98f){return new BPromise(function(_0x3f10bd,_0x2092dd){_0x2f3f67(_0x13c98f,_0x200064)['then'](function(_0x9e57bf){_0x200064['scheduledat']=_0x9e57bf[_0xed4d('0x2a')];_0x41ef2c[_0xed4d('0x25')][_0xed4d('0x1e')]({'where':{'phone':_0x200064['phone'],'VoiceQueueId':_0x13c98f['id']}})[_0xed4d('0x24')](function(_0x40faf5){if(!_[_0xed4d('0x1f')](_0x40faf5)){throw new Error(_0xed4d('0x26')+_0x200064[_0xed4d('0xd')]+_0xed4d('0x2b')+_0x13c98f['id']);}return _0x41ef2c['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x200064[_0xed4d('0xd')],'VoiceQueueId':_0x13c98f['id']}});})['then'](function(_0x1cd627){if(!_[_0xed4d('0x1f')](_0x1cd627)){throw new Error(_0xed4d('0x2c')+_0x200064[_0xed4d('0xd')]+_0xed4d('0x2d')+_0x13c98f['id']);}return _0x41ef2c[_0xed4d('0x25')][_0xed4d('0x2e')]({'phone':_0x200064[_0xed4d('0xd')],'ContactId':_0x200064['id'],'ListId':_0x200064['ListId'],'priority':_0x200064['priority']?_0x200064[_0xed4d('0x28')]:0x2,'scheduledat':_0x200064['scheduledat']?_0x200064['scheduledat']:moment()[_0xed4d('0x1a')](_0xed4d('0x1b')),'callback':_0x200064[_0xed4d('0x29')]?!![]:![],'callbackuniqueid':_0x200064[_0xed4d('0x29')]?_0x200064['callbackUniqueid']:undefined,'callbackat':_0x200064[_0xed4d('0x29')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x13c98f['id']});})[_0xed4d('0x2f')](function(_0x4275da){_0x2092dd(_0x4275da);});});});};function _0x5105bb(){return function(_0x37684a){logger[_0xed4d('0x16')](_0xed4d('0x17'),_0xed4d('0x18'),util[_0xed4d('0x30')](_0x37684a,{'showHidden':![],'depth':null}));};}function _0x4ce3e0(_0x52e1f5,_0x561517){var _0x5d8347=_0x561517[_0xed4d('0x19')]?_0x561517['scheduledat']:moment()[_0xed4d('0x1a')](_0xed4d('0x1b'));return new BPromise(function(_0x32d4f2,_0x2e977b){if(_[_0xed4d('0x1f')](_0x561517[_0xed4d('0x1c')])){_0x32d4f2({'ret':_0x5d8347});}else{_0x41ef2c[_0xed4d('0x31')][_0xed4d('0x1e')]({'where':{'id':_0x52e1f5['id']}})[_0xed4d('0x24')](function(_0x57e94e){if(!_[_0xed4d('0x1f')](_0x57e94e)){var _0x4b59d1=_0x57e94e[_0xed4d('0x1c')];if(!_['isNil'](_0x4b59d1)){var _0x1daa72=shared['timezones'];var _0x3db6c7=_0x1daa72[_0x4b59d1];var _0x356d7c=_0x1daa72[_0x561517[_0xed4d('0x1c')]];if(!_[_0xed4d('0x1f')](_0x3db6c7)&&!_[_0xed4d('0x1f')](_0x356d7c)){var _0x1757df=_0x3db6c7[_0xed4d('0x21')]-_0x356d7c[_0xed4d('0x21')];_0x5d8347=_0x561517[_0xed4d('0x19')]?_0x561517[_0xed4d('0x19')]:moment();var _0x49ca34=moment(_0x5d8347)['add'](_0x1757df,'minutes');_0x32d4f2({'ret':_0x49ca34[_0xed4d('0x1a')](_0xed4d('0x1b'))});}else _0x32d4f2({'ret':_0x5d8347});}else _0x32d4f2({'ret':_0x5d8347});}else{_0x32d4f2({'ret':_0x5d8347});}});}});return 0xa;}var _0x3b6613=function(_0x5d6bd9){return new BPromise(function(_0x4f8f17,_0xddfc28){_0x4ce3e0(_0x5d6bd9,_0x200064)[_0xed4d('0x24')](function(_0x4b8147){_0x200064[_0xed4d('0x19')]=_0x4b8147['ret'];_0x41ef2c[_0xed4d('0x25')]['findOne']({'where':{'phone':_0x200064[_0xed4d('0xd')],'CampaignId':_0x5d6bd9['id']}})[_0xed4d('0x24')](function(_0x2b6256){if(!_[_0xed4d('0x1f')](_0x2b6256)){throw new Error('cmContact,\x20afterCreate\x20'+_0x200064[_0xed4d('0xd')]+_0xed4d('0x32')+_0x5d6bd9['id']);}return _0x41ef2c[_0xed4d('0x25')][_0xed4d('0x2e')]({'phone':_0x200064[_0xed4d('0xd')],'ContactId':_0x200064['id'],'ListId':_0x200064[_0xed4d('0x27')],'priority':_0x200064[_0xed4d('0x28')]?_0x200064['priority']:0x2,'scheduledat':_0x200064[_0xed4d('0x19')]?_0x200064[_0xed4d('0x19')]:moment()[_0xed4d('0x1a')](_0xed4d('0x1b')),'callback':_0x200064['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x200064[_0xed4d('0x29')]?_0x200064[_0xed4d('0x29')]:undefined,'callbackat':_0x200064['callbackUniqueid']?moment()[_0xed4d('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5d6bd9['id']});})[_0xed4d('0x2f')](function(_0xda1e41){_0xddfc28(_0xda1e41);});});});};var _0x56659d=function(_0xaeb1e2){return new BPromise(function(_0x32f830,_0xf1339e){_0x4ce3e0(_0xaeb1e2,_0x200064)[_0xed4d('0x24')](function(_0x5894f7){_0x200064[_0xed4d('0x19')]=_0x5894f7[_0xed4d('0x2a')];_0x41ef2c[_0xed4d('0x25')][_0xed4d('0x1e')]({'where':{'phone':_0x200064[_0xed4d('0xd')],'CampaignId':_0xaeb1e2['id']}})['then'](function(_0xf4e3ae){if(!_[_0xed4d('0x1f')](_0xf4e3ae)){throw new Error('cmContact,\x20afterCreate\x20'+_0x200064['phone']+_0xed4d('0x33')+_0xaeb1e2['id']);}return _0x41ef2c[_0xed4d('0x34')]['findOne']({'where':{'calleridnum':_0x200064[_0xed4d('0xd')],'CampaignId':_0xaeb1e2['id']}});})['then'](function(_0x46f48d){if(!_[_0xed4d('0x1f')](_0x46f48d)){throw new Error(_0xed4d('0x2c')+_0x200064['phone']+_0xed4d('0x35')+_0xaeb1e2['id']);}return _0x41ef2c[_0xed4d('0x25')][_0xed4d('0x2e')]({'phone':_0x200064[_0xed4d('0xd')],'ContactId':_0x200064['id'],'ListId':_0x200064[_0xed4d('0x27')],'priority':_0x200064['priority']?_0x200064['priority']:0x2,'scheduledat':_0x200064[_0xed4d('0x19')]?_0x200064[_0xed4d('0x19')]:moment()[_0xed4d('0x1a')](_0xed4d('0x1b')),'callback':_0x200064['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x200064[_0xed4d('0x29')]?_0x200064['callbackUniqueid']:undefined,'callbackat':_0x200064['callbackUniqueid']?moment()[_0xed4d('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xaeb1e2['id']});})['catch'](function(_0x496cb4){_0xf1339e(_0x496cb4);});});});};if(_0x200064[_0xed4d('0x27')]){_0x41ef2c[_0xed4d('0x1d')][_0xed4d('0x36')]({'where':{'type':_0xed4d('0x37')},'attributes':['id',_0xed4d('0x38'),_0xed4d('0x1c')],'include':[{'model':_0x41ef2c[_0xed4d('0x39')],'as':_0xed4d('0x3a'),'where':{'id':_0x200064['ListId']}}]})[_0xed4d('0x24')](function(_0x475fae){if(_0x475fae){var _0x5f0825=[];for(var _0x3b17ec=0x0,_0x54d747;_0x3b17ec<_0x475fae[_0xed4d('0x3b')];_0x3b17ec+=0x1){_0x54d747=_0x475fae[_0x3b17ec][_0xed4d('0x15')]({'plain':!![]});switch(_0x54d747['dialCheckDuplicateType']){case _0xed4d('0x3c'):_0x4b902e(_0x54d747)['catch'](_0x272dc6());break;case _0xed4d('0x3d'):_0x19c5e8(_0x54d747)[_0xed4d('0x2f')](_0x272dc6());break;default:_0x4ce3e0(_0x54d747,_0x200064)[_0xed4d('0x24')](function(_0x2d8e4e){_0x200064[_0xed4d('0x19')]=_0x2d8e4e[_0xed4d('0x2a')];_0x41ef2c[_0xed4d('0x25')]['create']({'phone':_0x200064['phone'],'ContactId':_0x200064['id'],'ListId':_0x200064[_0xed4d('0x27')],'scheduledat':_0x200064[_0xed4d('0x19')]?_0x200064[_0xed4d('0x19')]:moment()['format'](_0xed4d('0x1b')),'priority':_0x200064['priority']?_0x200064[_0xed4d('0x28')]:0x2,'callback':_0x200064[_0xed4d('0x29')]?!![]:![],'callbackuniqueid':_0x200064[_0xed4d('0x29')]?_0x200064[_0xed4d('0x29')]:undefined,'callbackat':_0x200064[_0xed4d('0x29')]?moment()[_0xed4d('0x1a')](_0xed4d('0x1b')):undefined,'VoiceQueueId':_0x54d747['id']})[_0xed4d('0x2f')](_0x272dc6());});}}}})[_0xed4d('0x24')](function(){return _0x41ef2c[_0xed4d('0x1d')][_0xed4d('0x36')]({'where':{'type':_0xed4d('0x37')},'attributes':['id'],'include':[{'model':_0x41ef2c[_0xed4d('0x39')],'as':_0xed4d('0x3e'),'where':{'id':_0x200064[_0xed4d('0x27')]}}]})[_0xed4d('0x24')](function(_0x3c556f){if(_0x3c556f){var _0x1b9237=[];for(var _0x333358=0x0,_0x384c42;_0x333358<_0x3c556f[_0xed4d('0x3b')];_0x333358+=0x1){_0x384c42=_0x3c556f[_0x333358][_0xed4d('0x15')]({'plain':!![]});_0x41ef2c[_0xed4d('0x3f')]['create']({'phone':_0x200064[_0xed4d('0xd')],'ContactId':_0x200064['id'],'ListId':_0x200064['ListId'],'VoiceQueueId':_0x384c42['id']})[_0xed4d('0x2f')](function(_0x413013){logger[_0xed4d('0x16')](_0xed4d('0x40'),_0xed4d('0x18'),_0x413013[_0xed4d('0x41')]);});}}});})[_0xed4d('0x24')](function(){return _0x41ef2c[_0xed4d('0x31')][_0xed4d('0x36')]({'attributes':['id',_0xed4d('0x38'),_0xed4d('0x1c')],'include':[{'model':_0x41ef2c[_0xed4d('0x39')],'as':_0xed4d('0x3a'),'where':{'id':_0x200064['ListId']}}]})['then'](function(_0x4aa90b){if(_0x4aa90b){var _0x7833fb=[];for(var _0x2b4fd1=0x0,_0x3b3f52;_0x2b4fd1<_0x4aa90b[_0xed4d('0x3b')];_0x2b4fd1+=0x1){_0x3b3f52=_0x4aa90b[_0x2b4fd1][_0xed4d('0x15')]({'plain':!![]});switch(_0x3b3f52[_0xed4d('0x38')]){case _0xed4d('0x3c'):_0x56659d(_0x3b3f52)['catch'](_0x5105bb());break;case'onlyIfOpen':_0x3b6613(_0x3b3f52)[_0xed4d('0x2f')](_0x5105bb());break;default:_0x41ef2c[_0xed4d('0x25')]['create']({'phone':_0x200064['phone'],'ContactId':_0x200064['id'],'ListId':_0x200064['ListId'],'scheduledat':_0x200064[_0xed4d('0x19')]?_0x200064[_0xed4d('0x19')]:moment()['format'](_0xed4d('0x1b')),'priority':_0x200064[_0xed4d('0x28')]?_0x200064[_0xed4d('0x28')]:0x2,'callback':_0x200064[_0xed4d('0x29')]?!![]:![],'callbackuniqueid':_0x200064[_0xed4d('0x29')]?_0x200064[_0xed4d('0x29')]:undefined,'callbackat':_0x200064[_0xed4d('0x29')]?moment()['format'](_0xed4d('0x1b')):undefined,'CampaignId':_0x3b3f52['id']})[_0xed4d('0x2f')](_0x5105bb());}}}});})[_0xed4d('0x24')](function(){return _0x41ef2c[_0xed4d('0x31')]['findAll']({'attributes':['id'],'include':[{'model':_0x41ef2c[_0xed4d('0x39')],'as':_0xed4d('0x3e'),'where':{'id':_0x200064[_0xed4d('0x27')]}}]})[_0xed4d('0x24')](function(_0x2a4317){if(_0x2a4317){var _0x595b29=[];for(var _0x38eb24=0x0,_0x11bbaf;_0x38eb24<_0x2a4317[_0xed4d('0x3b')];_0x38eb24+=0x1){_0x11bbaf=_0x2a4317[_0x38eb24][_0xed4d('0x15')]({'plain':!![]});_0x41ef2c[_0xed4d('0x3f')]['create']({'phone':_0x200064[_0xed4d('0xd')],'ContactId':_0x200064['id'],'ListId':_0x200064['ListId'],'CampaignId':_0x11bbaf['id']})[_0xed4d('0x2f')](function(_0xeccd26){logger[_0xed4d('0x16')]('cmContact,\x20%s,\x20%s',_0xed4d('0x18'),_0xeccd26[_0xed4d('0x41')]);});}}});})['then'](function(){_0x3f29ac();})[_0xed4d('0x2f')](function(_0x5dbf5a){logger[_0xed4d('0x16')](_0xed4d('0x40'),_0xed4d('0x18'),_0x5dbf5a[_0xed4d('0x41')]);_0x3f29ac(_0x5dbf5a);});}else{_0x3f29ac(new Error(_0xed4d('0x42')));}},'afterDestroy':function(_0x5cc61e,_0x5389f9,_0x55318a){var _0x21889c=_0xa46716[_0xed4d('0x14')];var _0xa7fd67=_0x5cc61e[_0xed4d('0x15')]({'plain':!![]});return _0x21889c[_0xed4d('0x25')][_0xed4d('0x36')]({'raw':!![],'where':{'ListId':_0xa7fd67[_0xed4d('0x27')],'ContactId':_0xa7fd67['id']}})['then'](function(_0x268316){if(!_[_0xed4d('0x43')](_0x268316)){var _0x9e19d1=[];for(var _0x17e102=0x0;_0x17e102<_0x268316[_0xed4d('0x3b')];_0x17e102+=0x1){var _0x12102b=_0x21889c[_0xed4d('0x25')]['destroy']({'where':{'ListId':_0x268316[_0x17e102][_0xed4d('0x27')],'ContactId':_0x268316[_0x17e102][_0xed4d('0x44')],'VoiceQueueId':_0x268316[_0x17e102][_0xed4d('0x45')],'CampaignId':_0x268316[_0x17e102][_0xed4d('0x46')]}});_0x9e19d1[_0xed4d('0x47')](_0x12102b);}return BPromise['all'](_0x9e19d1);}})[_0xed4d('0x24')](function(_0x222f6e){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0xed4d('0x30')](_0x222f6e,{'showHidden':![],'depth':null}));_0x55318a();})[_0xed4d('0x2f')](function(_0x2923ed){logger[_0xed4d('0x16')](_0xed4d('0x48'),util[_0xed4d('0x30')](_0x2923ed,{'showHidden':![],'depth':null}));_0x55318a(_0x2923ed);});}}});}; \ No newline at end of file +var _0x25c6=['Campaign','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','models','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','api','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','email','FULLTEXT','utf8mb4','get','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','minutes','format','ret','CmHopper','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','timezones','utcOffset','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','length','always','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25c6,0x12a));var _0x625c=function(_0x75b2a5,_0x43902a){_0x75b2a5=_0x75b2a5-0x0;var _0x28937a=_0x25c6[_0x75b2a5];return _0x28937a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x625c('0x0'));var moment=require(_0x625c('0x1'));var BPromise=require(_0x625c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x625c('0x3'));var rimraf=require(_0x625c('0x4'));var config=require(_0x625c('0x5'));var shared=require(_0x625c('0x6'));var attributes=require(_0x625c('0x7'));module[_0x625c('0x8')]=function(_0x19441e,_0x155d8b){return _0x19441e[_0x625c('0x9')](_0x625c('0xa'),attributes,{'tableName':_0x625c('0xb'),'paranoid':!![],'indexes':[{'name':_0x625c('0xc'),'fields':[_0x625c('0xc')]},{'name':_0x625c('0xd'),'fields':['firstName',_0x625c('0xe'),'phone','mobile','fax',_0x625c('0xf')],'type':_0x625c('0x10')}],'timestamps':!![],'charset':_0x625c('0x11'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x46285e,_0x5eda50,_0x9b3d99){var _0x49d650=_0x19441e['models'];var _0x4cdcc0=_0x46285e[_0x625c('0x12')]({'plain':!![]});function _0x193fd2(){return function(_0x71d726){logger[_0x625c('0x13')](_0x625c('0x14'),_0x625c('0x15'),util[_0x625c('0x16')](_0x71d726,{'showHidden':![],'depth':null}));};}function _0x1e6e88(_0x4a2647,_0x4ebaaf){var _0x4a02cb=_0x4ebaaf[_0x625c('0x17')]?_0x4ebaaf[_0x625c('0x17')]:moment()['format'](_0x625c('0x18'));return new BPromise(function(_0x432950,_0x59ed06){if(_[_0x625c('0x19')](_0x4ebaaf[_0x625c('0x1a')])){_0x432950({'ret':_0x4a02cb});}else{_0x49d650[_0x625c('0x1b')][_0x625c('0x1c')]({'where':{'id':_0x4a2647['id']}})['then'](function(_0x140d50){if(!_[_0x625c('0x19')](_0x140d50)){var _0x1d65b6=_0x140d50['dialTimezone'];if(!_[_0x625c('0x19')](_0x1d65b6)){var _0x17106e=shared['timezones'];var _0x190d21=_0x17106e[_0x1d65b6];var _0xb25cc1=_0x17106e[_0x4ebaaf['dialTimezone']];if(!_[_0x625c('0x19')](_0x190d21)&&!_[_0x625c('0x19')](_0xb25cc1)){var _0x3b0ddb=_0x190d21['utcOffset']-_0xb25cc1['utcOffset'];_0x4a02cb=_0x4ebaaf['scheduledat']?_0x4ebaaf[_0x625c('0x17')]:moment();var _0x452596=moment(_0x4a02cb)['add'](_0x3b0ddb,_0x625c('0x1d'));_0x432950({'ret':_0x452596[_0x625c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x432950({'ret':_0x4a02cb});}else _0x432950({'ret':_0x4a02cb});}else{_0x432950({'ret':_0x4a02cb});}});}});return 0xa;}var _0xdc127f=function(_0x266554){return new BPromise(function(_0x41cd0a,_0x3e66d9){_0x1e6e88(_0x266554,_0x4cdcc0)['then'](function(_0x5e7134){_0x4cdcc0[_0x625c('0x17')]=_0x5e7134[_0x625c('0x1f')];_0x49d650[_0x625c('0x20')][_0x625c('0x1c')]({'where':{'phone':_0x4cdcc0[_0x625c('0xc')],'VoiceQueueId':_0x266554['id']}})[_0x625c('0x21')](function(_0x31b7e5){if(!_['isNil'](_0x31b7e5)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4cdcc0[_0x625c('0xc')]+_0x625c('0x22')+_0x266554['id']);}return _0x49d650['CmHopper'][_0x625c('0x23')]({'phone':_0x4cdcc0['phone'],'ContactId':_0x4cdcc0['id'],'ListId':_0x4cdcc0[_0x625c('0x24')],'priority':_0x4cdcc0[_0x625c('0x25')]?_0x4cdcc0[_0x625c('0x25')]:0x2,'scheduledat':_0x4cdcc0['scheduledat']?_0x4cdcc0[_0x625c('0x17')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4cdcc0['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4cdcc0['callbackUniqueid']?_0x4cdcc0[_0x625c('0x26')]:undefined,'callbackat':_0x4cdcc0['callbackUniqueid']?moment()['format'](_0x625c('0x18')):undefined,'VoiceQueueId':_0x266554['id']});})[_0x625c('0x27')](function(_0xf06a35){_0x3e66d9(_0xf06a35);});});});};var _0x5be8d9=function(_0x3da187){return new BPromise(function(_0x13c197,_0x1edd76){_0x1e6e88(_0x3da187,_0x4cdcc0)[_0x625c('0x21')](function(_0x154b6c){_0x4cdcc0[_0x625c('0x17')]=_0x154b6c[_0x625c('0x1f')];_0x49d650['CmHopper']['findOne']({'where':{'phone':_0x4cdcc0[_0x625c('0xc')],'VoiceQueueId':_0x3da187['id']}})[_0x625c('0x21')](function(_0x50829a){if(!_[_0x625c('0x19')](_0x50829a)){throw new Error(_0x625c('0x28')+_0x4cdcc0[_0x625c('0xc')]+_0x625c('0x29')+_0x3da187['id']);}return _0x49d650[_0x625c('0x2a')][_0x625c('0x1c')]({'where':{'calleridnum':_0x4cdcc0[_0x625c('0xc')],'VoiceQueueId':_0x3da187['id']}});})[_0x625c('0x21')](function(_0x5ae4f4){if(!_['isNil'](_0x5ae4f4)){throw new Error(_0x625c('0x2b')+_0x4cdcc0[_0x625c('0xc')]+_0x625c('0x2c')+_0x3da187['id']);}return _0x49d650['CmHopper'][_0x625c('0x23')]({'phone':_0x4cdcc0[_0x625c('0xc')],'ContactId':_0x4cdcc0['id'],'ListId':_0x4cdcc0[_0x625c('0x24')],'priority':_0x4cdcc0[_0x625c('0x25')]?_0x4cdcc0['priority']:0x2,'scheduledat':_0x4cdcc0[_0x625c('0x17')]?_0x4cdcc0[_0x625c('0x17')]:moment()[_0x625c('0x1e')](_0x625c('0x18')),'callback':_0x4cdcc0['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4cdcc0[_0x625c('0x26')]?_0x4cdcc0[_0x625c('0x26')]:undefined,'callbackat':_0x4cdcc0[_0x625c('0x26')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x3da187['id']});})[_0x625c('0x27')](function(_0x55faf8){_0x1edd76(_0x55faf8);});});});};function _0x4f95b7(){return function(_0x42863e){logger[_0x625c('0x13')]('cmContact',_0x625c('0x15'),util[_0x625c('0x16')](_0x42863e,{'showHidden':![],'depth':null}));};}function _0x3169d4(_0x34c3fd,_0x439486){var _0x25fdcc=_0x439486[_0x625c('0x17')]?_0x439486['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1e0d09,_0x51074f){if(_['isNil'](_0x439486[_0x625c('0x1a')])){_0x1e0d09({'ret':_0x25fdcc});}else{_0x49d650['Campaign'][_0x625c('0x1c')]({'where':{'id':_0x34c3fd['id']}})['then'](function(_0x2ec25f){if(!_['isNil'](_0x2ec25f)){var _0x251dee=_0x2ec25f['dialTimezone'];if(!_[_0x625c('0x19')](_0x251dee)){var _0x5e5406=shared[_0x625c('0x2d')];var _0x441e3f=_0x5e5406[_0x251dee];var _0x256f41=_0x5e5406[_0x439486[_0x625c('0x1a')]];if(!_[_0x625c('0x19')](_0x441e3f)&&!_[_0x625c('0x19')](_0x256f41)){var _0x39e800=_0x441e3f[_0x625c('0x2e')]-_0x256f41[_0x625c('0x2e')];_0x25fdcc=_0x439486['scheduledat']?_0x439486['scheduledat']:moment();var _0x31057a=moment(_0x25fdcc)[_0x625c('0x2f')](_0x39e800,_0x625c('0x1d'));_0x1e0d09({'ret':_0x31057a[_0x625c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1e0d09({'ret':_0x25fdcc});}else _0x1e0d09({'ret':_0x25fdcc});}else{_0x1e0d09({'ret':_0x25fdcc});}});}});return 0xa;}var _0x11bbe0=function(_0x16c4e3){return new BPromise(function(_0x24ba34,_0x190c37){_0x3169d4(_0x16c4e3,_0x4cdcc0)['then'](function(_0x493486){_0x4cdcc0[_0x625c('0x17')]=_0x493486[_0x625c('0x1f')];_0x49d650[_0x625c('0x20')][_0x625c('0x1c')]({'where':{'phone':_0x4cdcc0[_0x625c('0xc')],'CampaignId':_0x16c4e3['id']}})[_0x625c('0x21')](function(_0x3b1968){if(!_[_0x625c('0x19')](_0x3b1968)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4cdcc0[_0x625c('0xc')]+_0x625c('0x30')+_0x16c4e3['id']);}return _0x49d650[_0x625c('0x20')]['create']({'phone':_0x4cdcc0[_0x625c('0xc')],'ContactId':_0x4cdcc0['id'],'ListId':_0x4cdcc0[_0x625c('0x24')],'priority':_0x4cdcc0[_0x625c('0x25')]?_0x4cdcc0[_0x625c('0x25')]:0x2,'scheduledat':_0x4cdcc0['scheduledat']?_0x4cdcc0[_0x625c('0x17')]:moment()['format'](_0x625c('0x18')),'callback':_0x4cdcc0[_0x625c('0x26')]?!![]:![],'callbackuniqueid':_0x4cdcc0['callbackUniqueid']?_0x4cdcc0['callbackUniqueid']:undefined,'callbackat':_0x4cdcc0[_0x625c('0x26')]?moment()[_0x625c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x16c4e3['id']});})['catch'](function(_0x4d28d7){_0x190c37(_0x4d28d7);});});});};var _0x267335=function(_0x2f8329){return new BPromise(function(_0x36c967,_0x20fe33){_0x3169d4(_0x2f8329,_0x4cdcc0)[_0x625c('0x21')](function(_0x1f6b50){_0x4cdcc0[_0x625c('0x17')]=_0x1f6b50[_0x625c('0x1f')];_0x49d650['CmHopper'][_0x625c('0x1c')]({'where':{'phone':_0x4cdcc0['phone'],'CampaignId':_0x2f8329['id']}})[_0x625c('0x21')](function(_0x40b1fa){if(!_[_0x625c('0x19')](_0x40b1fa)){throw new Error(_0x625c('0x28')+_0x4cdcc0[_0x625c('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x2f8329['id']);}return _0x49d650[_0x625c('0x2a')][_0x625c('0x1c')]({'where':{'calleridnum':_0x4cdcc0[_0x625c('0xc')],'CampaignId':_0x2f8329['id']}});})[_0x625c('0x21')](function(_0x3fed0a){if(!_[_0x625c('0x19')](_0x3fed0a)){throw new Error(_0x625c('0x2b')+_0x4cdcc0[_0x625c('0xc')]+_0x625c('0x31')+_0x2f8329['id']);}return _0x49d650['CmHopper'][_0x625c('0x23')]({'phone':_0x4cdcc0['phone'],'ContactId':_0x4cdcc0['id'],'ListId':_0x4cdcc0['ListId'],'priority':_0x4cdcc0[_0x625c('0x25')]?_0x4cdcc0[_0x625c('0x25')]:0x2,'scheduledat':_0x4cdcc0['scheduledat']?_0x4cdcc0[_0x625c('0x17')]:moment()['format'](_0x625c('0x18')),'callback':_0x4cdcc0[_0x625c('0x26')]?!![]:![],'callbackuniqueid':_0x4cdcc0['callbackUniqueid']?_0x4cdcc0[_0x625c('0x26')]:undefined,'callbackat':_0x4cdcc0[_0x625c('0x26')]?moment()[_0x625c('0x1e')](_0x625c('0x18')):undefined,'CampaignId':_0x2f8329['id']});})['catch'](function(_0xac650f){_0x20fe33(_0xac650f);});});});};if(_0x4cdcc0[_0x625c('0x24')]){_0x49d650['VoiceQueue'][_0x625c('0x32')]({'where':{'type':_0x625c('0x33')},'attributes':['id',_0x625c('0x34'),'dialTimezone'],'include':[{'model':_0x49d650[_0x625c('0x35')],'as':'Lists','where':{'id':_0x4cdcc0[_0x625c('0x24')]}}]})[_0x625c('0x21')](function(_0x3b1818){if(_0x3b1818){var _0x296fda=[];for(var _0x8a97b5=0x0,_0x2b8d09;_0x8a97b5<_0x3b1818[_0x625c('0x36')];_0x8a97b5+=0x1){_0x2b8d09=_0x3b1818[_0x8a97b5]['get']({'plain':!![]});switch(_0x2b8d09['dialCheckDuplicateType']){case _0x625c('0x37'):_0x5be8d9(_0x2b8d09)[_0x625c('0x27')](_0x193fd2());break;case'onlyIfOpen':_0xdc127f(_0x2b8d09)[_0x625c('0x27')](_0x193fd2());break;default:_0x3169d4(_0x2b8d09,_0x4cdcc0)[_0x625c('0x21')](function(_0x2c8433){_0x4cdcc0[_0x625c('0x17')]=_0x2c8433['ret'];_0x49d650[_0x625c('0x20')][_0x625c('0x23')]({'phone':_0x4cdcc0[_0x625c('0xc')],'ContactId':_0x4cdcc0['id'],'ListId':_0x4cdcc0['ListId'],'scheduledat':_0x4cdcc0[_0x625c('0x17')]?_0x4cdcc0['scheduledat']:moment()[_0x625c('0x1e')](_0x625c('0x18')),'priority':_0x4cdcc0[_0x625c('0x25')]?_0x4cdcc0['priority']:0x2,'callback':_0x4cdcc0[_0x625c('0x26')]?!![]:![],'callbackuniqueid':_0x4cdcc0['callbackUniqueid']?_0x4cdcc0[_0x625c('0x26')]:undefined,'callbackat':_0x4cdcc0[_0x625c('0x26')]?moment()[_0x625c('0x1e')](_0x625c('0x18')):undefined,'VoiceQueueId':_0x2b8d09['id']})[_0x625c('0x27')](_0x193fd2());});}}}})[_0x625c('0x21')](function(){return _0x49d650['VoiceQueue'][_0x625c('0x32')]({'where':{'type':_0x625c('0x33')},'attributes':['id'],'include':[{'model':_0x49d650[_0x625c('0x35')],'as':'BlackLists','where':{'id':_0x4cdcc0['ListId']}}]})[_0x625c('0x21')](function(_0x5384c2){if(_0x5384c2){var _0x50d891=[];for(var _0x2a3f6f=0x0,_0x292bce;_0x2a3f6f<_0x5384c2[_0x625c('0x36')];_0x2a3f6f+=0x1){_0x292bce=_0x5384c2[_0x2a3f6f][_0x625c('0x12')]({'plain':!![]});_0x49d650['CmHopperBlack'][_0x625c('0x23')]({'phone':_0x4cdcc0[_0x625c('0xc')],'ContactId':_0x4cdcc0['id'],'ListId':_0x4cdcc0[_0x625c('0x24')],'VoiceQueueId':_0x292bce['id']})[_0x625c('0x27')](function(_0x4dfd01){logger[_0x625c('0x13')]('cmContact,\x20%s,\x20%s',_0x625c('0x15'),_0x4dfd01[_0x625c('0x38')]);});}}});})['then'](function(){return _0x49d650[_0x625c('0x39')]['findAll']({'attributes':['id',_0x625c('0x34'),_0x625c('0x1a')],'include':[{'model':_0x49d650[_0x625c('0x35')],'as':'Lists','where':{'id':_0x4cdcc0[_0x625c('0x24')]}}]})[_0x625c('0x21')](function(_0xb84b6a){if(_0xb84b6a){var _0x4bfb8f=[];for(var _0x499b62=0x0,_0x3328c0;_0x499b62<_0xb84b6a[_0x625c('0x36')];_0x499b62+=0x1){_0x3328c0=_0xb84b6a[_0x499b62][_0x625c('0x12')]({'plain':!![]});switch(_0x3328c0[_0x625c('0x34')]){case _0x625c('0x37'):_0x267335(_0x3328c0)[_0x625c('0x27')](_0x4f95b7());break;case _0x625c('0x3a'):_0x11bbe0(_0x3328c0)[_0x625c('0x27')](_0x4f95b7());break;default:_0x49d650['CmHopper']['create']({'phone':_0x4cdcc0['phone'],'ContactId':_0x4cdcc0['id'],'ListId':_0x4cdcc0['ListId'],'scheduledat':_0x4cdcc0[_0x625c('0x17')]?_0x4cdcc0[_0x625c('0x17')]:moment()[_0x625c('0x1e')](_0x625c('0x18')),'priority':_0x4cdcc0[_0x625c('0x25')]?_0x4cdcc0[_0x625c('0x25')]:0x2,'callback':_0x4cdcc0[_0x625c('0x26')]?!![]:![],'callbackuniqueid':_0x4cdcc0[_0x625c('0x26')]?_0x4cdcc0[_0x625c('0x26')]:undefined,'callbackat':_0x4cdcc0[_0x625c('0x26')]?moment()[_0x625c('0x1e')](_0x625c('0x18')):undefined,'CampaignId':_0x3328c0['id']})['catch'](_0x4f95b7());}}}});})['then'](function(){return _0x49d650['Campaign'][_0x625c('0x32')]({'attributes':['id'],'include':[{'model':_0x49d650[_0x625c('0x35')],'as':_0x625c('0x3b'),'where':{'id':_0x4cdcc0[_0x625c('0x24')]}}]})['then'](function(_0x564fd7){if(_0x564fd7){var _0x4ba73b=[];for(var _0x51e99a=0x0,_0x30b77f;_0x51e99a<_0x564fd7['length'];_0x51e99a+=0x1){_0x30b77f=_0x564fd7[_0x51e99a][_0x625c('0x12')]({'plain':!![]});_0x49d650['CmHopperBlack']['create']({'phone':_0x4cdcc0[_0x625c('0xc')],'ContactId':_0x4cdcc0['id'],'ListId':_0x4cdcc0['ListId'],'CampaignId':_0x30b77f['id']})[_0x625c('0x27')](function(_0x2eda34){logger[_0x625c('0x13')]('cmContact,\x20%s,\x20%s',_0x625c('0x15'),_0x2eda34[_0x625c('0x38')]);});}}});})[_0x625c('0x21')](function(){_0x9b3d99();})[_0x625c('0x27')](function(_0x49728f){logger[_0x625c('0x13')](_0x625c('0x3c'),_0x625c('0x15'),_0x49728f['message']);_0x9b3d99(_0x49728f);});}else{_0x9b3d99(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x7bd06a,_0x378e96,_0x31dd59){var _0x4d7ce3=_0x19441e[_0x625c('0x3d')];var _0x18c0f1=_0x7bd06a[_0x625c('0x12')]({'plain':!![]});return _0x4d7ce3[_0x625c('0x20')][_0x625c('0x32')]({'raw':!![],'where':{'ListId':_0x18c0f1[_0x625c('0x24')],'ContactId':_0x18c0f1['id']}})[_0x625c('0x21')](function(_0x3f7971){if(!_[_0x625c('0x3e')](_0x3f7971)){var _0x456ac8=[];for(var _0x23653b=0x0;_0x23653b<_0x3f7971['length'];_0x23653b+=0x1){var _0x3bd8c3=_0x4d7ce3['CmHopper'][_0x625c('0x3f')]({'where':{'ListId':_0x3f7971[_0x23653b][_0x625c('0x24')],'ContactId':_0x3f7971[_0x23653b]['ContactId'],'VoiceQueueId':_0x3f7971[_0x23653b][_0x625c('0x40')],'CampaignId':_0x3f7971[_0x23653b][_0x625c('0x41')]}});_0x456ac8[_0x625c('0x42')](_0x3bd8c3);}return BPromise[_0x625c('0x43')](_0x456ac8);}})[_0x625c('0x21')](function(_0x4985f9){logger[_0x625c('0x44')](_0x625c('0x45'),util['inspect'](_0x4985f9,{'showHidden':![],'depth':null}));_0x31dd59();})[_0x625c('0x27')](function(_0x3f1f83){logger[_0x625c('0x13')](_0x625c('0x46'),util['inspect'](_0x3f1f83,{'showHidden':![],'depth':null}));_0x31dd59(_0x3f1f83);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 2bec286..964055f 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 _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x3d98b1,_0x542b14){var _0x554e8b=function(_0x49cc54){while(--_0x49cc54){_0x3d98b1['push'](_0x3d98b1['shift']());}};_0x554e8b(++_0x542b14);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\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(_0x1cec74,_0x2d9328){var _0x476b1c=function(_0x2ecfee){while(--_0x2ecfee){_0x1cec74['push'](_0x1cec74['shift']());}};_0x476b1c(++_0x2d9328);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 0ef7474..c372371 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 _0x720c=['STRING','sequelize','INTEGER'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x720c,0x154));var _0xc720=function(_0x1aa46a,_0x320caa){_0x1aa46a=_0x1aa46a-0x0;var _0x3cfaa2=_0x720c[_0x1aa46a];return _0x3cfaa2;};'use strict';var Sequelize=require(_0xc720('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xc720('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xc720('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xc720('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xc720('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xc720('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xc720('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x861c=['exports','INTEGER','STRING','PHONE','sequelize'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x861c,0xdb));var _0xc861=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x861c[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xc861('0x0'));module[_0xc861('0x1')]={'CmContactId':{'type':Sequelize[_0xc861('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xc861('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xc861('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xc861('0x3')],'defaultValue':_0xc861('0x4')},'OrderBy':{'type':Sequelize[_0xc861('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xc861('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 6367b47..2f08e60 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 _0xc5a8=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','UserProfileResource','destroy','end','error','stack','name','send','index','map','CmContactHasItem','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','body','get','role','user','CmContactHasItems','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xc5a8,0x192));var _0x8c5a=function(_0x32bd36,_0x3d41e8){_0x32bd36=_0x32bd36-0x0;var _0x3c6b72=_0xc5a8[_0x32bd36];return _0x3c6b72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c5a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c5a('0x1'));var moment=require(_0x8c5a('0x2'));var BPromise=require(_0x8c5a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c5a('0x4'));var sox=require(_0x8c5a('0x5'));var csv=require(_0x8c5a('0x6'));var ejs=require(_0x8c5a('0x7'));var fs=require('fs');var fs_extra=require(_0x8c5a('0x8'));var _=require(_0x8c5a('0x9'));var squel=require('squel');var crypto=require(_0x8c5a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8c5a('0xb'));var toCsv=require(_0x8c5a('0x6'));var querystring=require(_0x8c5a('0xc'));var Papa=require(_0x8c5a('0xd'));var Redis=require(_0x8c5a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8c5a('0xf'));var as=require(_0x8c5a('0x10'));var hardwareService=require(_0x8c5a('0x11'));var logger=require(_0x8c5a('0x12'))('api');var utils=require(_0x8c5a('0x13'));var config=require(_0x8c5a('0x14'));var licenseUtil=require(_0x8c5a('0x15'));var db=require(_0x8c5a('0x16'))['db'];function respondWithStatusCode(_0x56248f,_0x349bea){_0x349bea=_0x349bea||0xcc;return function(_0x558ef3){if(_0x558ef3){return _0x56248f[_0x8c5a('0x17')](_0x349bea);}return _0x56248f[_0x8c5a('0x18')](_0x349bea)['end']();};}function respondWithResult(_0x33c187,_0x527d2d){_0x527d2d=_0x527d2d||0xc8;return function(_0x30faf8){if(_0x30faf8){return _0x33c187[_0x8c5a('0x18')](_0x527d2d)['json'](_0x30faf8);}};}function respondWithFilteredResult(_0x107271,_0x1ea532){return function(_0x78dbb4){if(_0x78dbb4){var _0x42b795=typeof _0x1ea532[_0x8c5a('0x19')]===_0x8c5a('0x1a')&&typeof _0x1ea532['limit']===_0x8c5a('0x1a');var _0x3f9e7c=_0x78dbb4[_0x8c5a('0x1b')];var _0x4cfd64=_0x42b795?0x0:_0x1ea532['offset'];var _0x1ef727=_0x42b795?_0x78dbb4[_0x8c5a('0x1b')]:_0x1ea532[_0x8c5a('0x19')]+_0x1ea532[_0x8c5a('0x1c')];var _0x42a37f;if(_0x1ef727>=_0x3f9e7c){_0x1ef727=_0x3f9e7c;_0x42a37f=0xc8;}else{_0x42a37f=0xce;}_0x107271[_0x8c5a('0x18')](_0x42a37f);return _0x107271[_0x8c5a('0x1d')](_0x8c5a('0x1e'),_0x4cfd64+'-'+_0x1ef727+'/'+_0x3f9e7c)[_0x8c5a('0x1f')](_0x78dbb4);}return null;};}function patchUpdates(_0x4908e4){return function(_0x9e1973){try{jsonpatch['apply'](_0x9e1973,_0x4908e4,!![]);}catch(_0x27e2ed){return BPromise[_0x8c5a('0x20')](_0x27e2ed);}return _0x9e1973[_0x8c5a('0x21')]();};}function saveUpdates(_0x9efd43,_0x5c7633){return function(_0x369dfd){if(_0x369dfd){return _0x369dfd[_0x8c5a('0x22')](_0x9efd43)[_0x8c5a('0x23')](function(_0x35bcff){return _0x35bcff;});}return null;};}function removeEntity(_0x2ea65f,_0x45f401){return function(_0x3f973e){if(_0x3f973e){return _0x3f973e['destroy']()[_0x8c5a('0x23')](function(){var _0xefa9c=_0x3f973e['get']({'plain':!![]});var _0x50d7a9='CmContactHasItems';return db[_0x8c5a('0x24')][_0x8c5a('0x25')]({'where':{'type':_0x50d7a9,'resourceId':_0xefa9c['id']}})['then'](function(){return _0x3f973e;});})['then'](function(){_0x2ea65f[_0x8c5a('0x18')](0xcc)[_0x8c5a('0x26')]();});}};}function handleEntityNotFound(_0x3c052c,_0x2f6afb){return function(_0x525c50){if(!_0x525c50){_0x3c052c['sendStatus'](0x194);}return _0x525c50;};}function handleError(_0x1459aa,_0x22c5a5){_0x22c5a5=_0x22c5a5||0x1f4;return function(_0xb54cee){logger[_0x8c5a('0x27')](_0xb54cee[_0x8c5a('0x28')]);if(_0xb54cee['name']){delete _0xb54cee[_0x8c5a('0x29')];}_0x1459aa[_0x8c5a('0x18')](_0x22c5a5)[_0x8c5a('0x2a')](_0xb54cee);};}exports[_0x8c5a('0x2b')]=function(_0xa9f312,_0x3a786a){var _0x47cad9={},_0x6dff01={},_0x2aabf0={'count':0x0,'rows':[]};var _0x23bce2=_[_0x8c5a('0x2c')](db[_0x8c5a('0x2d')]['rawAttributes'],function(_0x4eeed3){return{'name':_0x4eeed3[_0x8c5a('0x2e')],'type':_0x4eeed3[_0x8c5a('0x2f')][_0x8c5a('0x30')]};});_0x6dff01[_0x8c5a('0x31')]=_['map'](_0x23bce2,_0x8c5a('0x29'));_0x6dff01[_0x8c5a('0x32')]=_[_0x8c5a('0x33')](_0xa9f312[_0x8c5a('0x32')]);_0x6dff01[_0x8c5a('0x34')]=_[_0x8c5a('0x35')](_0x6dff01[_0x8c5a('0x31')],_0x6dff01['query']);_0x47cad9[_0x8c5a('0x36')]=_[_0x8c5a('0x35')](_0x6dff01[_0x8c5a('0x31')],qs[_0x8c5a('0x37')](_0xa9f312[_0x8c5a('0x32')][_0x8c5a('0x37')]));_0x47cad9[_0x8c5a('0x36')]=_0x47cad9[_0x8c5a('0x36')][_0x8c5a('0x38')]?_0x47cad9['attributes']:_0x6dff01[_0x8c5a('0x31')];if(!_0xa9f312[_0x8c5a('0x32')][_0x8c5a('0x39')](_0x8c5a('0x3a'))){_0x47cad9['limit']=qs['limit'](_0xa9f312['query'][_0x8c5a('0x1c')]);_0x47cad9[_0x8c5a('0x19')]=qs[_0x8c5a('0x19')](_0xa9f312[_0x8c5a('0x32')]['offset']);}_0x47cad9[_0x8c5a('0x3b')]=qs[_0x8c5a('0x3c')](_0xa9f312[_0x8c5a('0x32')][_0x8c5a('0x3c')]);_0x47cad9[_0x8c5a('0x3d')]=qs[_0x8c5a('0x34')](_[_0x8c5a('0x3e')](_0xa9f312['query'],_0x6dff01[_0x8c5a('0x34')]),_0x23bce2);if(_0xa9f312[_0x8c5a('0x32')][_0x8c5a('0x3f')]){_0x47cad9[_0x8c5a('0x3d')]=_[_0x8c5a('0x40')](_0x47cad9[_0x8c5a('0x3d')],{'$or':_['map'](_0x23bce2,function(_0x4166a1){if(_0x4166a1[_0x8c5a('0x2f')]!==_0x8c5a('0x41')){var _0x1f3671={};_0x1f3671[_0x4166a1[_0x8c5a('0x29')]]={'$like':'%'+_0xa9f312[_0x8c5a('0x32')][_0x8c5a('0x3f')]+'%'};return _0x1f3671;}})});}_0x47cad9=_[_0x8c5a('0x40')]({},_0x47cad9,_0xa9f312[_0x8c5a('0x42')]);var _0x531364={'where':_0x47cad9[_0x8c5a('0x3d')]};return db[_0x8c5a('0x2d')][_0x8c5a('0x1b')](_0x531364)[_0x8c5a('0x23')](function(_0x4c65f7){_0x2aabf0['count']=_0x4c65f7;if(_0xa9f312[_0x8c5a('0x32')][_0x8c5a('0x43')]){_0x47cad9['include']=[{'all':!![]}];}return db[_0x8c5a('0x2d')]['findAll'](_0x47cad9);})[_0x8c5a('0x23')](function(_0x2b1a58){_0x2aabf0[_0x8c5a('0x44')]=_0x2b1a58;return _0x2aabf0;})[_0x8c5a('0x23')](respondWithFilteredResult(_0x3a786a,_0x47cad9))['catch'](handleError(_0x3a786a,null));};exports[_0x8c5a('0x45')]=function(_0xfbfcc0,_0x1fd6d0){var _0x576754={'raw':!![],'where':{'id':_0xfbfcc0[_0x8c5a('0x46')]['id']}},_0xb626ac={};_0xb626ac['model']=_[_0x8c5a('0x33')](db[_0x8c5a('0x2d')]['rawAttributes']);_0xb626ac[_0x8c5a('0x32')]=_['keys'](_0xfbfcc0[_0x8c5a('0x32')]);_0xb626ac[_0x8c5a('0x34')]=_[_0x8c5a('0x35')](_0xb626ac[_0x8c5a('0x31')],_0xb626ac['query']);_0x576754[_0x8c5a('0x36')]=_[_0x8c5a('0x35')](_0xb626ac[_0x8c5a('0x31')],qs[_0x8c5a('0x37')](_0xfbfcc0[_0x8c5a('0x32')][_0x8c5a('0x37')]));_0x576754['attributes']=_0x576754[_0x8c5a('0x36')]['length']?_0x576754[_0x8c5a('0x36')]:_0xb626ac[_0x8c5a('0x31')];if(_0xfbfcc0[_0x8c5a('0x32')][_0x8c5a('0x43')]){_0x576754[_0x8c5a('0x47')]=[{'all':!![]}];}_0x576754=_[_0x8c5a('0x40')]({},_0x576754,_0xfbfcc0[_0x8c5a('0x42')]);return db[_0x8c5a('0x2d')][_0x8c5a('0x48')](_0x576754)[_0x8c5a('0x23')](handleEntityNotFound(_0x1fd6d0,null))[_0x8c5a('0x23')](respondWithResult(_0x1fd6d0,null))[_0x8c5a('0x49')](handleError(_0x1fd6d0,null));};exports['create']=function(_0x41392f,_0x3751cb){return db[_0x8c5a('0x2d')]['create'](_0x41392f[_0x8c5a('0x4a')],{})[_0x8c5a('0x23')](function(_0x31438e){var _0x136dd6=_0x41392f['user'][_0x8c5a('0x4b')]({'plain':!![]});if(!_0x136dd6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x136dd6[_0x8c5a('0x4c')]===_0x8c5a('0x4d')){var _0x42cc57=_0x31438e[_0x8c5a('0x4b')]({'plain':!![]});var _0x245212=_0x8c5a('0x4e');return db[_0x8c5a('0x4f')][_0x8c5a('0x48')]({'where':{'name':_0x245212,'userProfileId':_0x136dd6[_0x8c5a('0x50')]},'raw':!![]})[_0x8c5a('0x23')](function(_0x81113a){if(_0x81113a&&_0x81113a['autoAssociation']===0x0){return db[_0x8c5a('0x24')][_0x8c5a('0x51')]({'name':_0x42cc57[_0x8c5a('0x29')],'resourceId':_0x42cc57['id'],'type':_0x81113a[_0x8c5a('0x29')],'sectionId':_0x81113a['id']},{})[_0x8c5a('0x23')](function(){return _0x31438e;});}else{return _0x31438e;}})[_0x8c5a('0x49')](function(_0x204dc8){logger[_0x8c5a('0x27')](_0x8c5a('0x52'),_0x204dc8);throw _0x204dc8;});}return _0x31438e;})['then'](respondWithResult(_0x3751cb,0xc9))['catch'](handleError(_0x3751cb,null));};exports[_0x8c5a('0x22')]=function(_0x134c81,_0x3f9333){if(_0x134c81[_0x8c5a('0x4a')]['id']){delete _0x134c81[_0x8c5a('0x4a')]['id'];}return db[_0x8c5a('0x2d')]['find']({'where':{'id':_0x134c81[_0x8c5a('0x46')]['id']}})[_0x8c5a('0x23')](handleEntityNotFound(_0x3f9333,null))[_0x8c5a('0x23')](saveUpdates(_0x134c81['body'],null))[_0x8c5a('0x23')](respondWithResult(_0x3f9333,null))[_0x8c5a('0x49')](handleError(_0x3f9333,null));};exports[_0x8c5a('0x25')]=function(_0x552d75,_0x39b171){return db[_0x8c5a('0x2d')][_0x8c5a('0x48')]({'where':{'id':_0x552d75['params']['id']}})[_0x8c5a('0x23')](handleEntityNotFound(_0x39b171,null))[_0x8c5a('0x23')](removeEntity(_0x39b171,null))[_0x8c5a('0x49')](handleError(_0x39b171,null));}; \ No newline at end of file +var _0x3741=['fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','UserProfileResource','end','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','findAll','rows','show','params','includeAll','include','merge','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x48f76a,_0x261992){var _0x3ad48c=function(_0x5790e3){while(--_0x5790e3){_0x48f76a['push'](_0x48f76a['shift']());}};_0x3ad48c(++_0x261992);}(_0x3741,0x1b2));var _0x1374=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x3741[_0x1bb58c];return _0x277586;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1374('0x0'));var zipdir=require(_0x1374('0x1'));var jsonpatch=require(_0x1374('0x2'));var rp=require(_0x1374('0x3'));var moment=require(_0x1374('0x4'));var BPromise=require(_0x1374('0x5'));var Mustache=require(_0x1374('0x6'));var util=require(_0x1374('0x7'));var path=require('path');var sox=require(_0x1374('0x8'));var csv=require(_0x1374('0x9'));var ejs=require(_0x1374('0xa'));var fs=require('fs');var fs_extra=require(_0x1374('0xb'));var _=require(_0x1374('0xc'));var squel=require('squel');var crypto=require(_0x1374('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1374('0xe'));var toCsv=require(_0x1374('0x9'));var querystring=require(_0x1374('0xf'));var Papa=require(_0x1374('0x10'));var Redis=require(_0x1374('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1374('0x12'));var as=require(_0x1374('0x13'));var hardwareService=require(_0x1374('0x14'));var logger=require(_0x1374('0x15'))(_0x1374('0x16'));var utils=require(_0x1374('0x17'));var config=require(_0x1374('0x18'));var licenseUtil=require(_0x1374('0x19'));var db=require(_0x1374('0x1a'))['db'];function respondWithStatusCode(_0x2522f9,_0x555a49){_0x555a49=_0x555a49||0xcc;return function(_0x2fb117){if(_0x2fb117){return _0x2522f9[_0x1374('0x1b')](_0x555a49);}return _0x2522f9[_0x1374('0x1c')](_0x555a49)['end']();};}function respondWithResult(_0x579938,_0x1bce6e){_0x1bce6e=_0x1bce6e||0xc8;return function(_0x345067){if(_0x345067){return _0x579938[_0x1374('0x1c')](_0x1bce6e)[_0x1374('0x1d')](_0x345067);}};}function respondWithFilteredResult(_0x253dd5,_0x13f7e0){return function(_0x2c6167){if(_0x2c6167){var _0x5c49b5=typeof _0x13f7e0[_0x1374('0x1e')]===_0x1374('0x1f')&&typeof _0x13f7e0[_0x1374('0x20')]===_0x1374('0x1f');var _0x1973c3=_0x2c6167[_0x1374('0x21')];var _0x4218df=_0x5c49b5?0x0:_0x13f7e0['offset'];var _0x3b8a38=_0x5c49b5?_0x2c6167[_0x1374('0x21')]:_0x13f7e0['offset']+_0x13f7e0[_0x1374('0x20')];var _0x3afff3;if(_0x3b8a38>=_0x1973c3){_0x3b8a38=_0x1973c3;_0x3afff3=0xc8;}else{_0x3afff3=0xce;}_0x253dd5[_0x1374('0x1c')](_0x3afff3);return _0x253dd5[_0x1374('0x22')](_0x1374('0x23'),_0x4218df+'-'+_0x3b8a38+'/'+_0x1973c3)[_0x1374('0x1d')](_0x2c6167);}return null;};}function patchUpdates(_0x33b17d){return function(_0x422878){try{jsonpatch[_0x1374('0x24')](_0x422878,_0x33b17d,!![]);}catch(_0x1616a6){return BPromise['reject'](_0x1616a6);}return _0x422878[_0x1374('0x25')]();};}function saveUpdates(_0x58bfd2,_0x3fad86){return function(_0x298e01){if(_0x298e01){return _0x298e01[_0x1374('0x26')](_0x58bfd2)['then'](function(_0x2e70b5){return _0x2e70b5;});}return null;};}function removeEntity(_0xf9c34f,_0x213d7c){return function(_0x596580){if(_0x596580){return _0x596580[_0x1374('0x27')]()[_0x1374('0x28')](function(){var _0x53caea=_0x596580['get']({'plain':!![]});var _0x38d873='CmContactHasItems';return db[_0x1374('0x29')]['destroy']({'where':{'type':_0x38d873,'resourceId':_0x53caea['id']}})[_0x1374('0x28')](function(){return _0x596580;});})['then'](function(){_0xf9c34f['status'](0xcc)[_0x1374('0x2a')]();});}};}function handleEntityNotFound(_0xc838dd,_0x2906b6){return function(_0x544ed1){if(!_0x544ed1){_0xc838dd[_0x1374('0x1b')](0x194);}return _0x544ed1;};}function handleError(_0x157afb,_0x2176fc){_0x2176fc=_0x2176fc||0x1f4;return function(_0x257b90){logger[_0x1374('0x2b')](_0x257b90[_0x1374('0x2c')]);if(_0x257b90['name']){delete _0x257b90[_0x1374('0x2d')];}_0x157afb['status'](_0x2176fc)[_0x1374('0x2e')](_0x257b90);};}exports[_0x1374('0x2f')]=function(_0x22e90f,_0x1ca46d){var _0x122dbe={},_0x370e10={},_0x3b97ed={'count':0x0,'rows':[]};var _0x2272a2=_[_0x1374('0x30')](db[_0x1374('0x31')][_0x1374('0x32')],function(_0x22233a){return{'name':_0x22233a[_0x1374('0x33')],'type':_0x22233a[_0x1374('0x34')][_0x1374('0x35')]};});_0x370e10[_0x1374('0x36')]=_[_0x1374('0x30')](_0x2272a2,'name');_0x370e10['query']=_[_0x1374('0x37')](_0x22e90f[_0x1374('0x38')]);_0x370e10['filters']=_[_0x1374('0x39')](_0x370e10[_0x1374('0x36')],_0x370e10['query']);_0x122dbe[_0x1374('0x3a')]=_[_0x1374('0x39')](_0x370e10[_0x1374('0x36')],qs['fields'](_0x22e90f[_0x1374('0x38')][_0x1374('0x3b')]));_0x122dbe[_0x1374('0x3a')]=_0x122dbe['attributes'][_0x1374('0x3c')]?_0x122dbe['attributes']:_0x370e10[_0x1374('0x36')];if(!_0x22e90f['query'][_0x1374('0x3d')]('nolimit')){_0x122dbe[_0x1374('0x20')]=qs[_0x1374('0x20')](_0x22e90f[_0x1374('0x38')][_0x1374('0x20')]);_0x122dbe[_0x1374('0x1e')]=qs[_0x1374('0x1e')](_0x22e90f[_0x1374('0x38')][_0x1374('0x1e')]);}_0x122dbe[_0x1374('0x3e')]=qs[_0x1374('0x3f')](_0x22e90f[_0x1374('0x38')][_0x1374('0x3f')]);_0x122dbe[_0x1374('0x40')]=qs[_0x1374('0x41')](_[_0x1374('0x42')](_0x22e90f[_0x1374('0x38')],_0x370e10['filters']),_0x2272a2);if(_0x22e90f[_0x1374('0x38')][_0x1374('0x43')]){_0x122dbe[_0x1374('0x40')]=_['merge'](_0x122dbe[_0x1374('0x40')],{'$or':_[_0x1374('0x30')](_0x2272a2,function(_0x280cf4){if(_0x280cf4[_0x1374('0x34')]!==_0x1374('0x44')){var _0x1905e1={};_0x1905e1[_0x280cf4['name']]={'$like':'%'+_0x22e90f['query'][_0x1374('0x43')]+'%'};return _0x1905e1;}})});}_0x122dbe=_['merge']({},_0x122dbe,_0x22e90f[_0x1374('0x45')]);var _0x4c402f={'where':_0x122dbe[_0x1374('0x40')]};return db[_0x1374('0x31')][_0x1374('0x21')](_0x4c402f)['then'](function(_0x138ad4){_0x3b97ed[_0x1374('0x21')]=_0x138ad4;if(_0x22e90f[_0x1374('0x38')]['includeAll']){_0x122dbe['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0x1374('0x46')](_0x122dbe);})[_0x1374('0x28')](function(_0x3f6931){_0x3b97ed[_0x1374('0x47')]=_0x3f6931;return _0x3b97ed;})[_0x1374('0x28')](respondWithFilteredResult(_0x1ca46d,_0x122dbe))['catch'](handleError(_0x1ca46d,null));};exports[_0x1374('0x48')]=function(_0x1a77c5,_0x3da77c){var _0xf67de5={'raw':!![],'where':{'id':_0x1a77c5[_0x1374('0x49')]['id']}},_0x19fc2b={};_0x19fc2b[_0x1374('0x36')]=_[_0x1374('0x37')](db[_0x1374('0x31')][_0x1374('0x32')]);_0x19fc2b[_0x1374('0x38')]=_[_0x1374('0x37')](_0x1a77c5['query']);_0x19fc2b['filters']=_[_0x1374('0x39')](_0x19fc2b[_0x1374('0x36')],_0x19fc2b[_0x1374('0x38')]);_0xf67de5[_0x1374('0x3a')]=_[_0x1374('0x39')](_0x19fc2b[_0x1374('0x36')],qs[_0x1374('0x3b')](_0x1a77c5[_0x1374('0x38')][_0x1374('0x3b')]));_0xf67de5[_0x1374('0x3a')]=_0xf67de5['attributes'][_0x1374('0x3c')]?_0xf67de5[_0x1374('0x3a')]:_0x19fc2b['model'];if(_0x1a77c5[_0x1374('0x38')][_0x1374('0x4a')]){_0xf67de5[_0x1374('0x4b')]=[{'all':!![]}];}_0xf67de5=_[_0x1374('0x4c')]({},_0xf67de5,_0x1a77c5['options']);return db[_0x1374('0x31')][_0x1374('0x4d')](_0xf67de5)[_0x1374('0x28')](handleEntityNotFound(_0x3da77c,null))[_0x1374('0x28')](respondWithResult(_0x3da77c,null))[_0x1374('0x4e')](handleError(_0x3da77c,null));};exports[_0x1374('0x4f')]=function(_0x1a3af2,_0xb71361){return db[_0x1374('0x31')]['create'](_0x1a3af2[_0x1374('0x50')],{})[_0x1374('0x28')](function(_0x245d3d){var _0x3202de=_0x1a3af2[_0x1374('0x51')][_0x1374('0x52')]({'plain':!![]});if(!_0x3202de)throw new Error(_0x1374('0x53'));if(_0x3202de[_0x1374('0x54')]==='user'){var _0x4ba7ea=_0x245d3d[_0x1374('0x52')]({'plain':!![]});var _0x18f79f=_0x1374('0x55');return db[_0x1374('0x56')][_0x1374('0x4d')]({'where':{'name':_0x18f79f,'userProfileId':_0x3202de[_0x1374('0x57')]},'raw':!![]})[_0x1374('0x28')](function(_0x1349b1){if(_0x1349b1&&_0x1349b1['autoAssociation']===0x0){return db[_0x1374('0x29')]['create']({'name':_0x4ba7ea['name'],'resourceId':_0x4ba7ea['id'],'type':_0x1349b1['name'],'sectionId':_0x1349b1['id']},{})[_0x1374('0x28')](function(){return _0x245d3d;});}else{return _0x245d3d;}})[_0x1374('0x4e')](function(_0x1f4172){logger[_0x1374('0x2b')](_0x1374('0x58'),_0x1f4172);throw _0x1f4172;});}return _0x245d3d;})[_0x1374('0x28')](respondWithResult(_0xb71361,0xc9))['catch'](handleError(_0xb71361,null));};exports['update']=function(_0x27e714,_0x3346f2){if(_0x27e714[_0x1374('0x50')]['id']){delete _0x27e714[_0x1374('0x50')]['id'];}return db[_0x1374('0x31')]['find']({'where':{'id':_0x27e714[_0x1374('0x49')]['id']}})[_0x1374('0x28')](handleEntityNotFound(_0x3346f2,null))[_0x1374('0x28')](saveUpdates(_0x27e714[_0x1374('0x50')],null))[_0x1374('0x28')](respondWithResult(_0x3346f2,null))[_0x1374('0x4e')](handleError(_0x3346f2,null));};exports['destroy']=function(_0x5d27c7,_0x6e9a4a){return db['CmContactHasItem'][_0x1374('0x4d')]({'where':{'id':_0x5d27c7[_0x1374('0x49')]['id']}})[_0x1374('0x28')](handleEntityNotFound(_0x6e9a4a,null))[_0x1374('0x28')](removeEntity(_0x6e9a4a,null))[_0x1374('0x4e')](handleError(_0x6e9a4a,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 5dc0f95..39f85ea 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 _0x408d=['exports','define','CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x4563f1,_0x54111e){var _0x247a5e=function(_0x3219ac){while(--_0x3219ac){_0x4563f1['push'](_0x4563f1['shift']());}};_0x247a5e(++_0x54111e);}(_0x408d,0xd5));var _0xd408=function(_0x519de3,_0xe7c04e){_0x519de3=_0x519de3-0x0;var _0x3e21d9=_0x408d[_0x519de3];return _0x3e21d9;};'use strict';var _=require(_0xd408('0x0'));var util=require('util');var logger=require(_0xd408('0x1'))(_0xd408('0x2'));var moment=require(_0xd408('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd408('0x4'));var config=require(_0xd408('0x5'));var attributes=require(_0xd408('0x6'));module[_0xd408('0x7')]=function(_0x22e810,_0x38d548){return _0x22e810[_0xd408('0x8')](_0xd408('0x9'),attributes,{'tableName':_0xd408('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b21=['rimraf','../../config/environment','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','request-promise'];(function(_0x562cdc,_0x45b977){var _0x3d44df=function(_0x440505){while(--_0x440505){_0x562cdc['push'](_0x562cdc['shift']());}};_0x3d44df(++_0x45b977);}(_0x5b21,0x7f));var _0x15b2=function(_0x245bde,_0x266e9b){_0x245bde=_0x245bde-0x0;var _0x1e7a61=_0x5b21[_0x245bde];return _0x1e7a61;};'use strict';var _=require(_0x15b2('0x0'));var util=require(_0x15b2('0x1'));var logger=require(_0x15b2('0x2'))(_0x15b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x15b2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15b2('0x5'));var config=require(_0x15b2('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0x15b2('0x7')]=function(_0x334337,_0x144230){return _0x334337[_0x15b2('0x8')](_0x15b2('0x9'),attributes,{'tableName':_0x15b2('0xa'),'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 4f9e0c3..99a67ed 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 _0x3715=['rpc','../../config/environment','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x179b7b,_0x57b44d){var _0x5eea20=function(_0x5582aa){while(--_0x5582aa){_0x179b7b['push'](_0x179b7b['shift']());}};_0x5eea20(++_0x57b44d);}(_0x3715,0xa9));var _0x5371=function(_0x4f3075,_0x39bd1a){_0x4f3075=_0x4f3075-0x0;var _0xc56f77=_0x3715[_0x4f3075];return _0xc56f77;};'use strict';var _=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5371('0x2'));var fs=require('fs');var Redis=require(_0x5371('0x3'));var db=require(_0x5371('0x4'))['db'];var utils=require(_0x5371('0x5'));var logger=require(_0x5371('0x6'))(_0x5371('0x7'));var config=require(_0x5371('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5371('0x9')][_0x5371('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x332cec,_0x3b76b4,_0xfb7899){return new BPromise(function(_0x43c7bc,_0x261ee0){return client[_0x5371('0xb')](_0x332cec,_0xfb7899)[_0x5371('0xc')](function(_0x45fe6d){logger[_0x5371('0xd')](_0x5371('0xe'),_0x3b76b4,_0x5371('0xf'));logger[_0x5371('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x3b76b4,'request\x20sent',JSON['stringify'](_0x45fe6d));if(_0x45fe6d[_0x5371('0x11')]){if(_0x45fe6d[_0x5371('0x11')][_0x5371('0x12')]===0x1f4){logger[_0x5371('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x3b76b4,_0x45fe6d[_0x5371('0x11')]['message']);return _0x261ee0(_0x45fe6d['error'][_0x5371('0x13')]);}logger[_0x5371('0x11')](_0x5371('0xe'),_0x3b76b4,_0x45fe6d[_0x5371('0x11')][_0x5371('0x13')]);return _0x43c7bc(_0x45fe6d[_0x5371('0x11')][_0x5371('0x13')]);}else{logger[_0x5371('0xd')](_0x5371('0xe'),_0x3b76b4,_0x5371('0xf'));_0x43c7bc(_0x45fe6d[_0x5371('0x14')][_0x5371('0x13')]);}})[_0x5371('0x15')](function(_0x1297fb){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x3b76b4,_0x1297fb);_0x261ee0(_0x1297fb);});});} \ No newline at end of file +var _0xef5d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','CmContactHasItem,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0x5c7f5e,_0x362da0){var _0x150446=function(_0x165196){while(--_0x165196){_0x5c7f5e['push'](_0x5c7f5e['shift']());}};_0x150446(++_0x362da0);}(_0xef5d,0xdc));var _0xdef5=function(_0x3cb616,_0x166419){_0x3cb616=_0x3cb616-0x0;var _0x37f4cc=_0xef5d[_0x3cb616];return _0x37f4cc;};'use strict';var _=require(_0xdef5('0x0'));var util=require(_0xdef5('0x1'));var moment=require(_0xdef5('0x2'));var BPromise=require(_0xdef5('0x3'));var rs=require(_0xdef5('0x4'));var fs=require('fs');var Redis=require(_0xdef5('0x5'));var db=require(_0xdef5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdef5('0x7'))('rpc');var config=require(_0xdef5('0x8'));var jayson=require(_0xdef5('0x9'));var client=jayson[_0xdef5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5162c2,_0x41d4de,_0x17b287){return new BPromise(function(_0x4ff4d2,_0x17e5e7){return client['request'](_0x5162c2,_0x17b287)[_0xdef5('0xb')](function(_0x112762){logger['info'](_0xdef5('0xc'),_0x41d4de,'request\x20sent');logger[_0xdef5('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x41d4de,'request\x20sent',JSON[_0xdef5('0xe')](_0x112762));if(_0x112762[_0xdef5('0xf')]){if(_0x112762[_0xdef5('0xf')][_0xdef5('0x10')]===0x1f4){logger[_0xdef5('0xf')](_0xdef5('0xc'),_0x41d4de,_0x112762['error'][_0xdef5('0x11')]);return _0x17e5e7(_0x112762[_0xdef5('0xf')][_0xdef5('0x11')]);}logger[_0xdef5('0xf')](_0xdef5('0xc'),_0x41d4de,_0x112762['error']['message']);return _0x4ff4d2(_0x112762['error']['message']);}else{logger[_0xdef5('0x12')](_0xdef5('0xc'),_0x41d4de,_0xdef5('0x13'));_0x4ff4d2(_0x112762[_0xdef5('0x14')][_0xdef5('0x11')]);}})[_0xdef5('0x15')](function(_0x152952){logger[_0xdef5('0xf')](_0xdef5('0xc'),_0x41d4de,_0x152952);_0x17e5e7(_0x152952);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index cbac69d..dca718c 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 _0x8e65=['show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x388eea,_0x340518){var _0x4a175b=function(_0x595f94){while(--_0x595f94){_0x388eea['push'](_0x388eea['shift']());}};_0x4a175b(++_0x340518);}(_0x8e65,0x1ac));var _0x58e6=function(_0x4cbf36,_0x2827b1){_0x4cbf36=_0x4cbf36-0x0;var _0x512917=_0x8e65[_0x4cbf36];return _0x512917;};'use strict';var multer=require(_0x58e6('0x0'));var util=require(_0x58e6('0x1'));var path=require(_0x58e6('0x2'));var timeout=require(_0x58e6('0x3'));var express=require('express');var router=express[_0x58e6('0x4')]();var fs_extra=require(_0x58e6('0x5'));var auth=require(_0x58e6('0x6'));var interaction=require(_0x58e6('0x7'));var config=require(_0x58e6('0x8'));var controller=require('./cmContactHasItem.controller');router[_0x58e6('0x9')]('/',auth[_0x58e6('0xa')](),controller[_0x58e6('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x58e6('0xc')]);router['post']('/',auth[_0x58e6('0xa')](),controller[_0x58e6('0xd')]);router[_0x58e6('0xe')](_0x58e6('0xf'),auth[_0x58e6('0xa')](),controller[_0x58e6('0x10')]);router[_0x58e6('0x11')](_0x58e6('0xf'),auth[_0x58e6('0xa')](),controller[_0x58e6('0x12')]);module[_0x58e6('0x13')]=router; \ No newline at end of file +var _0xb870=['delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','post','create','update'];(function(_0x10c16d,_0x2b3e14){var _0x5896f4=function(_0x4306b9){while(--_0x4306b9){_0x10c16d['push'](_0x10c16d['shift']());}};_0x5896f4(++_0x2b3e14);}(_0xb870,0xac));var _0x0b87=function(_0x4abc8f,_0xef597d){_0x4abc8f=_0x4abc8f-0x0;var _0x5d7939=_0xb870[_0x4abc8f];return _0x5d7939;};'use strict';var multer=require(_0x0b87('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0b87('0x1'));var express=require(_0x0b87('0x2'));var router=express[_0x0b87('0x3')]();var fs_extra=require(_0x0b87('0x4'));var auth=require(_0x0b87('0x5'));var interaction=require(_0x0b87('0x6'));var config=require('../../config/environment');var controller=require(_0x0b87('0x7'));router[_0x0b87('0x8')]('/',auth['isAuthenticated'](),controller[_0x0b87('0x9')]);router[_0x0b87('0x8')](_0x0b87('0xa'),auth[_0x0b87('0xb')](),controller['show']);router[_0x0b87('0xc')]('/',auth['isAuthenticated'](),controller[_0x0b87('0xd')]);router['put'](_0x0b87('0xa'),auth['isAuthenticated'](),controller[_0x0b87('0xe')]);router[_0x0b87('0xf')]('/:id',auth[_0x0b87('0xb')](),controller[_0x0b87('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index ad78faa..381833f 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 _0x2837=['long','select','parse','values','isArray','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL','STRING','setDataValue','alias','getDataValue','name','TEXT'];(function(_0x393739,_0x3c8ee1){var _0x34a505=function(_0x17a9d7){while(--_0x17a9d7){_0x393739['push'](_0x393739['shift']());}};_0x34a505(++_0x3c8ee1);}(_0x2837,0x7e));var _0x7283=function(_0x519c7f,_0x1f9739){_0x519c7f=_0x519c7f-0x0;var _0x4b9c33=_0x2837[_0x519c7f];return _0x4b9c33;};'use strict';var Sequelize=require(_0x7283('0x0'));var _=require(_0x7283('0x1'));module[_0x7283('0x2')]={'name':{'type':Sequelize[_0x7283('0x3')],'get':function(_0x2a8b44){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x7283('0x4')],'allowNull':![],'set':function(_0x2f6972){this[_0x7283('0x5')](_0x7283('0x6'),_0x2f6972?_0x2f6972:this[_0x7283('0x7')](_0x7283('0x8')));}},'type':{'type':Sequelize[_0x7283('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x7283('0x9')](_0x7283('0xa')),'get':function(){if(this['getDataValue']('type')===_0x7283('0xb')){return JSON[_0x7283('0xc')](this['getDataValue'](_0x7283('0xd')));}else{return this[_0x7283('0x7')]('values');}},'set':function(_0x4a07da){if(Array[_0x7283('0xe')](_0x4a07da)){this[_0x7283('0x5')]('values',JSON['stringify'](_0x4a07da));}else{this[_0x7283('0x5')]('values',_0x4a07da);}}},'required':{'type':Sequelize[_0x7283('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7283('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7283('0x10')]('voice')}}; \ No newline at end of file +var _0x336c=['name','TEXT','getDataValue','type','select','parse','values','isArray','setDataValue','BOOLEAN','voice','sequelize','exports','VIRTUAL','alias','STRING'];(function(_0xc69530,_0x57c174){var _0x148a92=function(_0x409d97){while(--_0x409d97){_0xc69530['push'](_0xc69530['shift']());}};_0x148a92(++_0x57c174);}(_0x336c,0x1bb));var _0xc336=function(_0x48132a,_0x41ebbf){_0x48132a=_0x48132a-0x0;var _0x1fd9c7=_0x336c[_0x48132a];return _0x1fd9c7;};'use strict';var Sequelize=require(_0xc336('0x0'));var _=require('lodash');module[_0xc336('0x1')]={'name':{'type':Sequelize[_0xc336('0x2')],'get':function(_0x929b54){return this['getDataValue'](_0xc336('0x3'));}},'alias':{'type':Sequelize[_0xc336('0x4')],'allowNull':![],'set':function(_0x276ed2){this['setDataValue'](_0xc336('0x3'),_0x276ed2?_0x276ed2:this['getDataValue'](_0xc336('0x5')));}},'type':{'type':Sequelize[_0xc336('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xc336('0x6')]('long'),'get':function(){if(this[_0xc336('0x7')](_0xc336('0x8'))===_0xc336('0x9')){return JSON[_0xc336('0xa')](this['getDataValue'](_0xc336('0xb')));}else{return this[_0xc336('0x7')](_0xc336('0xb'));}},'set':function(_0x41fb88){if(Array[_0xc336('0xc')](_0x41fb88)){this[_0xc336('0xd')](_0xc336('0xb'),JSON['stringify'](_0x41fb88));}else{this[_0xc336('0xd')](_0xc336('0xb'),_0x41fb88);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc336('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xc336('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 220348f..3473216 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 _0xf96f=['count','offset','set','reject','save','then','destroy','end','sendStatus','error','stack','name','send','map','CmCustomField','fieldName','type','key','differenceBy','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','find','sequelize','transaction','create','Sequelize','text','TEXT','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit'];(function(_0x1ef10c,_0x3b36bb){var _0x1735f4=function(_0x5ad826){while(--_0x5ad826){_0x1ef10c['push'](_0x1ef10c['shift']());}};_0x1735f4(++_0x3b36bb);}(_0xf96f,0xf0));var _0xff96=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf96f[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xff96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff96('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff96('0x2'));var moment=require(_0xff96('0x3'));var BPromise=require(_0xff96('0x4'));var Mustache=require(_0xff96('0x5'));var util=require(_0xff96('0x6'));var path=require(_0xff96('0x7'));var sox=require(_0xff96('0x8'));var csv=require(_0xff96('0x9'));var ejs=require(_0xff96('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xff96('0xb'));var crypto=require(_0xff96('0xc'));var jsforce=require(_0xff96('0xd'));var deskjs=require(_0xff96('0xe'));var toCsv=require(_0xff96('0x9'));var querystring=require(_0xff96('0xf'));var Papa=require(_0xff96('0x10'));var Redis=require(_0xff96('0x11'));var authService=require(_0xff96('0x12'));var qs=require(_0xff96('0x13'));var as=require(_0xff96('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xff96('0x15'));var utils=require(_0xff96('0x16'));var config=require(_0xff96('0x17'));var licenseUtil=require(_0xff96('0x18'));var db=require(_0xff96('0x19'))['db'];function respondWithStatusCode(_0x2e9957,_0x39adf1){_0x39adf1=_0x39adf1||0xcc;return function(_0x15f86d){if(_0x15f86d){return _0x2e9957['sendStatus'](_0x39adf1);}return _0x2e9957[_0xff96('0x1a')](_0x39adf1)['end']();};}function respondWithResult(_0xd436ab,_0x7d4d4){_0x7d4d4=_0x7d4d4||0xc8;return function(_0x14fa51){if(_0x14fa51){return _0xd436ab[_0xff96('0x1a')](_0x7d4d4)[_0xff96('0x1b')](_0x14fa51);}};}function respondWithFilteredResult(_0x48b888,_0xe7c39b){return function(_0x45c4f8){if(_0x45c4f8){var _0x3f9c59=typeof _0xe7c39b['offset']===_0xff96('0x1c')&&typeof _0xe7c39b[_0xff96('0x1d')]===_0xff96('0x1c');var _0x59691c=_0x45c4f8[_0xff96('0x1e')];var _0x2ac81f=_0x3f9c59?0x0:_0xe7c39b['offset'];var _0x3260b9=_0x3f9c59?_0x45c4f8['count']:_0xe7c39b[_0xff96('0x1f')]+_0xe7c39b[_0xff96('0x1d')];var _0x524b12;if(_0x3260b9>=_0x59691c){_0x3260b9=_0x59691c;_0x524b12=0xc8;}else{_0x524b12=0xce;}_0x48b888[_0xff96('0x1a')](_0x524b12);return _0x48b888[_0xff96('0x20')]('Content-Range',_0x2ac81f+'-'+_0x3260b9+'/'+_0x59691c)['json'](_0x45c4f8);}return null;};}function patchUpdates(_0x18cdae){return function(_0x54dffd){try{jsonpatch['apply'](_0x54dffd,_0x18cdae,!![]);}catch(_0x225e3c){return BPromise[_0xff96('0x21')](_0x225e3c);}return _0x54dffd[_0xff96('0x22')]();};}function saveUpdates(_0x251a5c,_0x5af6d2){return function(_0x14393b){if(_0x14393b){return _0x14393b['update'](_0x251a5c)[_0xff96('0x23')](function(_0x31b072){return _0x31b072;});}return null;};}function removeEntity(_0x117471,_0x48877c){return function(_0x4457fb){if(_0x4457fb){return _0x4457fb[_0xff96('0x24')]()['then'](function(){_0x117471[_0xff96('0x1a')](0xcc)[_0xff96('0x25')]();});}};}function handleEntityNotFound(_0x4da7b8,_0x231a09){return function(_0xb56781){if(!_0xb56781){_0x4da7b8[_0xff96('0x26')](0x194);}return _0xb56781;};}function handleError(_0x551312,_0x2dd54c){_0x2dd54c=_0x2dd54c||0x1f4;return function(_0x1324d8){logger[_0xff96('0x27')](_0x1324d8[_0xff96('0x28')]);if(_0x1324d8[_0xff96('0x29')]){delete _0x1324d8[_0xff96('0x29')];}_0x551312[_0xff96('0x1a')](_0x2dd54c)[_0xff96('0x2a')](_0x1324d8);};}exports['index']=function(_0x447b80,_0x5a956d){var _0xaa502d={},_0x416743={},_0x1bccb6={'count':0x0,'rows':[]};var _0x2a3141=_[_0xff96('0x2b')](db[_0xff96('0x2c')]['rawAttributes'],function(_0x4d3570){return{'name':_0x4d3570[_0xff96('0x2d')],'type':_0x4d3570[_0xff96('0x2e')][_0xff96('0x2f')]};});_0x416743['model']=_[_0xff96('0x30')](_[_0xff96('0x2b')](_0x2a3141,_0xff96('0x29')),[_0xff96('0x29')]);_0x416743['query']=_[_0xff96('0x31')](_0x447b80[_0xff96('0x32')]);_0x416743[_0xff96('0x33')]=_[_0xff96('0x34')](_0x416743['model'],_0x416743[_0xff96('0x32')]);_0xaa502d[_0xff96('0x35')]=_[_0xff96('0x34')](_0x416743['model'],qs[_0xff96('0x36')](_0x447b80[_0xff96('0x32')][_0xff96('0x36')]));_0xaa502d['attributes']=_0xaa502d['attributes'][_0xff96('0x37')]?_0xaa502d[_0xff96('0x35')]:_0x416743[_0xff96('0x38')];if(!_0x447b80[_0xff96('0x32')][_0xff96('0x39')](_0xff96('0x3a'))){_0xaa502d[_0xff96('0x1d')]=qs['limit'](_0x447b80['query'][_0xff96('0x1d')]);_0xaa502d[_0xff96('0x1f')]=qs[_0xff96('0x1f')](_0x447b80[_0xff96('0x32')][_0xff96('0x1f')]);}_0xaa502d[_0xff96('0x3b')]=qs['sort'](_0x447b80[_0xff96('0x32')][_0xff96('0x3c')]);_0xaa502d[_0xff96('0x3d')]=qs[_0xff96('0x33')](_[_0xff96('0x3e')](_0x447b80[_0xff96('0x32')],_0x416743[_0xff96('0x33')]),_0x2a3141);if(_0x447b80[_0xff96('0x32')][_0xff96('0x3f')]){_0xaa502d[_0xff96('0x3d')]=_[_0xff96('0x40')](_0xaa502d[_0xff96('0x3d')],{'$or':_[_0xff96('0x2b')](_0x2a3141,function(_0x2a4648){if(_0x2a4648[_0xff96('0x2e')]!==_0xff96('0x41')){var _0xd3bf3a={};_0xd3bf3a[_0x2a4648[_0xff96('0x29')]]={'$like':'%'+_0x447b80[_0xff96('0x32')]['filter']+'%'};return _0xd3bf3a;}})});}_0xaa502d=_[_0xff96('0x40')]({},_0xaa502d,_0x447b80['options']);var _0x4cc90f={'where':_0xaa502d['where']};return db[_0xff96('0x2c')][_0xff96('0x1e')](_0x4cc90f)[_0xff96('0x23')](function(_0x552ef0){_0x1bccb6['count']=_0x552ef0;if(_0x447b80[_0xff96('0x32')][_0xff96('0x42')]){_0xaa502d[_0xff96('0x43')]=[{'all':!![]}];}return db[_0xff96('0x2c')][_0xff96('0x44')](_0xaa502d);})[_0xff96('0x23')](function(_0x496705){_0x1bccb6[_0xff96('0x45')]=_0x496705;return _0x1bccb6;})[_0xff96('0x23')](respondWithFilteredResult(_0x5a956d,_0xaa502d))[_0xff96('0x46')](handleError(_0x5a956d,null));};exports[_0xff96('0x47')]=function(_0x3fcd99,_0x29289f){var _0x340b4a={'raw':!![],'where':{'id':_0x3fcd99[_0xff96('0x48')]['id']}},_0x29ae2b={};_0x29ae2b[_0xff96('0x38')]=_[_0xff96('0x31')](db[_0xff96('0x2c')][_0xff96('0x49')]);_0x29ae2b[_0xff96('0x32')]=_['keys'](_0x3fcd99['query']);_0x29ae2b[_0xff96('0x33')]=_['intersection'](_0x29ae2b[_0xff96('0x38')],_0x29ae2b[_0xff96('0x32')]);_0x340b4a[_0xff96('0x35')]=_[_0xff96('0x34')](_0x29ae2b[_0xff96('0x38')],qs[_0xff96('0x36')](_0x3fcd99[_0xff96('0x32')][_0xff96('0x36')]));_0x340b4a[_0xff96('0x35')]=_0x340b4a[_0xff96('0x35')][_0xff96('0x37')]?_0x340b4a[_0xff96('0x35')]:_0x29ae2b[_0xff96('0x38')];if(_0x3fcd99[_0xff96('0x32')]['includeAll']){_0x340b4a['include']=[{'all':!![]}];}_0x340b4a=_['merge']({},_0x340b4a,_0x3fcd99['options']);return db['CmCustomField']['find'](_0x340b4a)[_0xff96('0x23')](handleEntityNotFound(_0x29289f,null))[_0xff96('0x23')](respondWithResult(_0x29289f,null))[_0xff96('0x46')](handleError(_0x29289f,null));};exports['update']=function(_0x55fd20,_0x90a733){if(_0x55fd20[_0xff96('0x4a')]['id']){delete _0x55fd20['body']['id'];}return db[_0xff96('0x2c')][_0xff96('0x4b')]({'where':{'id':_0x55fd20['params']['id']}})['then'](handleEntityNotFound(_0x90a733,null))[_0xff96('0x23')](saveUpdates(_0x55fd20[_0xff96('0x4a')],null))['then'](respondWithResult(_0x90a733,null))[_0xff96('0x46')](handleError(_0x90a733,null));};exports[_0xff96('0x24')]=function(_0x428443,_0x265531){return db[_0xff96('0x2c')][_0xff96('0x4b')]({'where':{'id':_0x428443[_0xff96('0x48')]['id']}})[_0xff96('0x23')](handleEntityNotFound(_0x265531,null))[_0xff96('0x23')](removeEntity(_0x265531,null))[_0xff96('0x46')](handleError(_0x265531,null));};exports['create']=function(_0x114591,_0xca3eab){var _0x1c6820;return db[_0xff96('0x4c')][_0xff96('0x4d')](function(_0x4cbdbe){return db['CmCustomField'][_0xff96('0x4e')](_0x114591[_0xff96('0x4a')],{'transaction':_0x4cbdbe})[_0xff96('0x23')](function(_0x29f456){_0x1c6820=_0x29f456;var _0x3cf48f={'type':db[_0xff96('0x4f')]['TEXT'],'transaction':_0x4cbdbe};switch(_0x114591['body'][_0xff96('0x2e')]){case _0xff96('0x50'):_0x3cf48f[_0xff96('0x2e')]=db[_0xff96('0x4f')][_0xff96('0x51')];break;case _0xff96('0x52'):_0x3cf48f[_0xff96('0x2e')]=db[_0xff96('0x4f')][_0xff96('0x53')];break;case'switch':_0x3cf48f[_0xff96('0x2e')]=db['Sequelize']['BOOLEAN'];_0x3cf48f[_0xff96('0x54')]=![];break;default:}return db[_0xff96('0x4c')][_0xff96('0x55')][_0xff96('0x56')](_0xff96('0x57'),util[_0xff96('0x58')](_0xff96('0x59'),_0x1c6820['id']),_0x3cf48f);})[_0xff96('0x23')](function(){return _0x1c6820;});})[_0xff96('0x23')](respondWithResult(_0xca3eab,0xc9))[_0xff96('0x46')](handleError(_0xca3eab,null));}; \ No newline at end of file +var _0xd9d7=['offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','sendStatus','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','update','params','create','sequelize','transaction','body','TEXT','type','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd9d7,0xf2));var _0x7d9d=function(_0x76b00b,_0x26e939){_0x76b00b=_0x76b00b-0x0;var _0xc8e4a=_0xd9d7[_0x76b00b];return _0xc8e4a;};'use strict';var emlformat=require(_0x7d9d('0x0'));var rimraf=require(_0x7d9d('0x1'));var zipdir=require(_0x7d9d('0x2'));var jsonpatch=require(_0x7d9d('0x3'));var rp=require(_0x7d9d('0x4'));var moment=require(_0x7d9d('0x5'));var BPromise=require(_0x7d9d('0x6'));var Mustache=require(_0x7d9d('0x7'));var util=require(_0x7d9d('0x8'));var path=require(_0x7d9d('0x9'));var sox=require('sox');var csv=require(_0x7d9d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d9d('0xb'));var _=require('lodash');var squel=require(_0x7d9d('0xc'));var crypto=require(_0x7d9d('0xd'));var jsforce=require(_0x7d9d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7d9d('0xa'));var querystring=require(_0x7d9d('0xf'));var Papa=require(_0x7d9d('0x10'));var Redis=require(_0x7d9d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7d9d('0x12'));var hardwareService=require(_0x7d9d('0x13'));var logger=require(_0x7d9d('0x14'))(_0x7d9d('0x15'));var utils=require(_0x7d9d('0x16'));var config=require(_0x7d9d('0x17'));var licenseUtil=require(_0x7d9d('0x18'));var db=require(_0x7d9d('0x19'))['db'];function respondWithStatusCode(_0x26c052,_0x21ab30){_0x21ab30=_0x21ab30||0xcc;return function(_0x280595){if(_0x280595){return _0x26c052['sendStatus'](_0x21ab30);}return _0x26c052[_0x7d9d('0x1a')](_0x21ab30)['end']();};}function respondWithResult(_0x3cb2c4,_0x2dc960){_0x2dc960=_0x2dc960||0xc8;return function(_0x283643){if(_0x283643){return _0x3cb2c4[_0x7d9d('0x1a')](_0x2dc960)[_0x7d9d('0x1b')](_0x283643);}};}function respondWithFilteredResult(_0x20d1d7,_0x1ecb48){return function(_0x3a7e69){if(_0x3a7e69){var _0x267483=typeof _0x1ecb48[_0x7d9d('0x1c')]===_0x7d9d('0x1d')&&typeof _0x1ecb48[_0x7d9d('0x1e')]==='undefined';var _0x5c0120=_0x3a7e69[_0x7d9d('0x1f')];var _0x38f4e5=_0x267483?0x0:_0x1ecb48[_0x7d9d('0x1c')];var _0x2e227d=_0x267483?_0x3a7e69['count']:_0x1ecb48[_0x7d9d('0x1c')]+_0x1ecb48[_0x7d9d('0x1e')];var _0x394dae;if(_0x2e227d>=_0x5c0120){_0x2e227d=_0x5c0120;_0x394dae=0xc8;}else{_0x394dae=0xce;}_0x20d1d7['status'](_0x394dae);return _0x20d1d7[_0x7d9d('0x20')](_0x7d9d('0x21'),_0x38f4e5+'-'+_0x2e227d+'/'+_0x5c0120)[_0x7d9d('0x1b')](_0x3a7e69);}return null;};}function patchUpdates(_0x10c243){return function(_0x2c0065){try{jsonpatch[_0x7d9d('0x22')](_0x2c0065,_0x10c243,!![]);}catch(_0x2bc9e9){return BPromise[_0x7d9d('0x23')](_0x2bc9e9);}return _0x2c0065['save']();};}function saveUpdates(_0x5c811e,_0x275afa){return function(_0x4c6247){if(_0x4c6247){return _0x4c6247['update'](_0x5c811e)[_0x7d9d('0x24')](function(_0x2197e7){return _0x2197e7;});}return null;};}function removeEntity(_0x5a8db8,_0x12fe6a){return function(_0x6f464f){if(_0x6f464f){return _0x6f464f[_0x7d9d('0x25')]()[_0x7d9d('0x24')](function(){_0x5a8db8[_0x7d9d('0x1a')](0xcc)[_0x7d9d('0x26')]();});}};}function handleEntityNotFound(_0x1e61e0,_0x7c39f1){return function(_0x46324a){if(!_0x46324a){_0x1e61e0[_0x7d9d('0x27')](0x194);}return _0x46324a;};}function handleError(_0x9de690,_0x37dd8a){_0x37dd8a=_0x37dd8a||0x1f4;return function(_0x509130){logger[_0x7d9d('0x28')](_0x509130['stack']);if(_0x509130[_0x7d9d('0x29')]){delete _0x509130['name'];}_0x9de690[_0x7d9d('0x1a')](_0x37dd8a)[_0x7d9d('0x2a')](_0x509130);};}exports[_0x7d9d('0x2b')]=function(_0x11f940,_0xa7cdda){var _0x2ca21a={},_0x39eab3={},_0x3937e3={'count':0x0,'rows':[]};var _0x405705=_[_0x7d9d('0x2c')](db[_0x7d9d('0x2d')][_0x7d9d('0x2e')],function(_0x11fe4f){return{'name':_0x11fe4f[_0x7d9d('0x2f')],'type':_0x11fe4f['type'][_0x7d9d('0x30')]};});_0x39eab3[_0x7d9d('0x31')]=_[_0x7d9d('0x32')](_[_0x7d9d('0x2c')](_0x405705,_0x7d9d('0x29')),['name']);_0x39eab3['query']=_['keys'](_0x11f940[_0x7d9d('0x33')]);_0x39eab3[_0x7d9d('0x34')]=_[_0x7d9d('0x35')](_0x39eab3[_0x7d9d('0x31')],_0x39eab3[_0x7d9d('0x33')]);_0x2ca21a['attributes']=_[_0x7d9d('0x35')](_0x39eab3['model'],qs[_0x7d9d('0x36')](_0x11f940[_0x7d9d('0x33')]['fields']));_0x2ca21a[_0x7d9d('0x37')]=_0x2ca21a[_0x7d9d('0x37')]['length']?_0x2ca21a[_0x7d9d('0x37')]:_0x39eab3[_0x7d9d('0x31')];if(!_0x11f940[_0x7d9d('0x33')][_0x7d9d('0x38')](_0x7d9d('0x39'))){_0x2ca21a[_0x7d9d('0x1e')]=qs['limit'](_0x11f940[_0x7d9d('0x33')][_0x7d9d('0x1e')]);_0x2ca21a[_0x7d9d('0x1c')]=qs[_0x7d9d('0x1c')](_0x11f940[_0x7d9d('0x33')][_0x7d9d('0x1c')]);}_0x2ca21a[_0x7d9d('0x3a')]=qs[_0x7d9d('0x3b')](_0x11f940[_0x7d9d('0x33')][_0x7d9d('0x3b')]);_0x2ca21a[_0x7d9d('0x3c')]=qs[_0x7d9d('0x34')](_['pick'](_0x11f940[_0x7d9d('0x33')],_0x39eab3[_0x7d9d('0x34')]),_0x405705);if(_0x11f940[_0x7d9d('0x33')]['filter']){_0x2ca21a[_0x7d9d('0x3c')]=_[_0x7d9d('0x3d')](_0x2ca21a[_0x7d9d('0x3c')],{'$or':_[_0x7d9d('0x2c')](_0x405705,function(_0xf7b2da){if(_0xf7b2da['type']!==_0x7d9d('0x3e')){var _0x1ba27a={};_0x1ba27a[_0xf7b2da[_0x7d9d('0x29')]]={'$like':'%'+_0x11f940[_0x7d9d('0x33')]['filter']+'%'};return _0x1ba27a;}})});}_0x2ca21a=_[_0x7d9d('0x3d')]({},_0x2ca21a,_0x11f940[_0x7d9d('0x3f')]);var _0x1c9efe={'where':_0x2ca21a[_0x7d9d('0x3c')]};return db['CmCustomField'][_0x7d9d('0x1f')](_0x1c9efe)[_0x7d9d('0x24')](function(_0x39e9d2){_0x3937e3[_0x7d9d('0x1f')]=_0x39e9d2;if(_0x11f940[_0x7d9d('0x33')][_0x7d9d('0x40')]){_0x2ca21a[_0x7d9d('0x41')]=[{'all':!![]}];}return db['CmCustomField'][_0x7d9d('0x42')](_0x2ca21a);})[_0x7d9d('0x24')](function(_0x4641ab){_0x3937e3[_0x7d9d('0x43')]=_0x4641ab;return _0x3937e3;})[_0x7d9d('0x24')](respondWithFilteredResult(_0xa7cdda,_0x2ca21a))[_0x7d9d('0x44')](handleError(_0xa7cdda,null));};exports[_0x7d9d('0x45')]=function(_0x1a5653,_0x56f74f){var _0x52428e={'raw':!![],'where':{'id':_0x1a5653['params']['id']}},_0x673de5={};_0x673de5[_0x7d9d('0x31')]=_['keys'](db['CmCustomField'][_0x7d9d('0x2e')]);_0x673de5[_0x7d9d('0x33')]=_['keys'](_0x1a5653[_0x7d9d('0x33')]);_0x673de5[_0x7d9d('0x34')]=_[_0x7d9d('0x35')](_0x673de5[_0x7d9d('0x31')],_0x673de5[_0x7d9d('0x33')]);_0x52428e['attributes']=_[_0x7d9d('0x35')](_0x673de5[_0x7d9d('0x31')],qs['fields'](_0x1a5653[_0x7d9d('0x33')][_0x7d9d('0x36')]));_0x52428e[_0x7d9d('0x37')]=_0x52428e[_0x7d9d('0x37')][_0x7d9d('0x46')]?_0x52428e[_0x7d9d('0x37')]:_0x673de5[_0x7d9d('0x31')];if(_0x1a5653[_0x7d9d('0x33')][_0x7d9d('0x40')]){_0x52428e[_0x7d9d('0x41')]=[{'all':!![]}];}_0x52428e=_[_0x7d9d('0x3d')]({},_0x52428e,_0x1a5653[_0x7d9d('0x3f')]);return db[_0x7d9d('0x2d')][_0x7d9d('0x47')](_0x52428e)['then'](handleEntityNotFound(_0x56f74f,null))['then'](respondWithResult(_0x56f74f,null))['catch'](handleError(_0x56f74f,null));};exports[_0x7d9d('0x48')]=function(_0x3dd77f,_0xfdcda2){if(_0x3dd77f['body']['id']){delete _0x3dd77f['body']['id'];}return db[_0x7d9d('0x2d')][_0x7d9d('0x47')]({'where':{'id':_0x3dd77f['params']['id']}})['then'](handleEntityNotFound(_0xfdcda2,null))[_0x7d9d('0x24')](saveUpdates(_0x3dd77f['body'],null))[_0x7d9d('0x24')](respondWithResult(_0xfdcda2,null))[_0x7d9d('0x44')](handleError(_0xfdcda2,null));};exports[_0x7d9d('0x25')]=function(_0x15ae06,_0x319fdc){return db['CmCustomField'][_0x7d9d('0x47')]({'where':{'id':_0x15ae06[_0x7d9d('0x49')]['id']}})[_0x7d9d('0x24')](handleEntityNotFound(_0x319fdc,null))[_0x7d9d('0x24')](removeEntity(_0x319fdc,null))[_0x7d9d('0x44')](handleError(_0x319fdc,null));};exports[_0x7d9d('0x4a')]=function(_0x569d10,_0x53e6f5){var _0x2b1185;return db[_0x7d9d('0x4b')][_0x7d9d('0x4c')](function(_0x33a591){return db[_0x7d9d('0x2d')][_0x7d9d('0x4a')](_0x569d10[_0x7d9d('0x4d')],{'transaction':_0x33a591})[_0x7d9d('0x24')](function(_0x1be5e1){_0x2b1185=_0x1be5e1;var _0x2d5903={'type':db['Sequelize'][_0x7d9d('0x4e')],'transaction':_0x33a591};switch(_0x569d10['body'][_0x7d9d('0x4f')]){case'text':_0x2d5903[_0x7d9d('0x4f')]=db[_0x7d9d('0x50')][_0x7d9d('0x4e')];break;case _0x7d9d('0x51'):_0x2d5903['type']=db[_0x7d9d('0x50')][_0x7d9d('0x52')];break;case'switch':_0x2d5903[_0x7d9d('0x4f')]=db[_0x7d9d('0x50')][_0x7d9d('0x53')];_0x2d5903[_0x7d9d('0x54')]=![];break;default:}return db[_0x7d9d('0x4b')][_0x7d9d('0x55')][_0x7d9d('0x56')](_0x7d9d('0x57'),util[_0x7d9d('0x58')](_0x7d9d('0x59'),_0x2b1185['id']),_0x2d5903);})[_0x7d9d('0x24')](function(){return _0x2b1185;});})[_0x7d9d('0x24')](respondWithResult(_0x53e6f5,0xc9))[_0x7d9d('0x44')](handleError(_0x53e6f5,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index db486f1..9aaf96b 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 _0xf16e=['cm_custom_fields','../../config/logger','moment','request-promise','rimraf','./cmCustomField.attributes','exports','define','CmCustomField'];(function(_0x2bf14b,_0x409fc8){var _0x32f2d4=function(_0x1f5602){while(--_0x1f5602){_0x2bf14b['push'](_0x2bf14b['shift']());}};_0x32f2d4(++_0x409fc8);}(_0xf16e,0x18d));var _0xef16=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xf16e[_0x5834bc];return _0x3e183a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xef16('0x0'))('api');var moment=require(_0xef16('0x1'));var BPromise=require('bluebird');var rp=require(_0xef16('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef16('0x3'));var config=require('../../config/environment');var attributes=require(_0xef16('0x4'));module[_0xef16('0x5')]=function(_0x46a831,_0xeefc06){return _0x46a831[_0xef16('0x6')](_0xef16('0x7'),attributes,{'tableName':_0xef16('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x161e=['path','rimraf','../../config/environment','exports','CmCustomField','cm_custom_fields','util','../../config/logger','moment','request-promise'];(function(_0x49fa45,_0x59ff71){var _0x488180=function(_0x50779f){while(--_0x50779f){_0x49fa45['push'](_0x49fa45['shift']());}};_0x488180(++_0x59ff71);}(_0x161e,0x196));var _0xe161=function(_0x4aa307,_0x30e045){_0x4aa307=_0x4aa307-0x0;var _0x4be9e9=_0x161e[_0x4aa307];return _0x4be9e9;};'use strict';var _=require('lodash');var util=require(_0xe161('0x0'));var logger=require(_0xe161('0x1'))('api');var moment=require(_0xe161('0x2'));var BPromise=require('bluebird');var rp=require(_0xe161('0x3'));var fs=require('fs');var path=require(_0xe161('0x4'));var rimraf=require(_0xe161('0x5'));var config=require(_0xe161('0x6'));var attributes=require('./cmCustomField.attributes');module[_0xe161('0x7')]=function(_0x3c5c16,_0x59e712){return _0x3c5c16['define'](_0xe161('0x8'),attributes,{'tableName':_0xe161('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 4c3baca..03dbd1b 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 _0x09d4=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2a4fe2,_0x3ec53a){var _0x225c4a=function(_0x1eccfa){while(--_0x1eccfa){_0x2a4fe2['push'](_0x2a4fe2['shift']());}};_0x225c4a(++_0x3ec53a);}(_0x09d4,0x133));var _0x409d=function(_0x416043,_0x3d11f8){_0x416043=_0x416043-0x0;var _0x70044=_0x09d4[_0x416043];return _0x70044;};'use strict';var _=require('lodash');var util=require(_0x409d('0x0'));var moment=require(_0x409d('0x1'));var BPromise=require(_0x409d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x409d('0x3'));var db=require(_0x409d('0x4'))['db'];var utils=require(_0x409d('0x5'));var logger=require(_0x409d('0x6'))(_0x409d('0x7'));var config=require(_0x409d('0x8'));var jayson=require(_0x409d('0x9'));var client=jayson[_0x409d('0xa')][_0x409d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x917851,_0x5763d4,_0x3bda92){return new BPromise(function(_0x3dba01,_0x3651ff){return client[_0x409d('0xc')](_0x917851,_0x3bda92)[_0x409d('0xd')](function(_0x492ce8){logger[_0x409d('0xe')](_0x409d('0xf'),_0x5763d4,_0x409d('0x10'));logger[_0x409d('0x11')](_0x409d('0x12'),_0x5763d4,_0x409d('0x10'),JSON[_0x409d('0x13')](_0x492ce8));if(_0x492ce8[_0x409d('0x14')]){if(_0x492ce8[_0x409d('0x14')][_0x409d('0x15')]===0x1f4){logger['error'](_0x409d('0xf'),_0x5763d4,_0x492ce8['error'][_0x409d('0x16')]);return _0x3651ff(_0x492ce8['error'][_0x409d('0x16')]);}logger[_0x409d('0x14')](_0x409d('0xf'),_0x5763d4,_0x492ce8[_0x409d('0x14')][_0x409d('0x16')]);return _0x3dba01(_0x492ce8['error'][_0x409d('0x16')]);}else{logger[_0x409d('0xe')](_0x409d('0xf'),_0x5763d4,_0x409d('0x10'));_0x3dba01(_0x492ce8[_0x409d('0x17')][_0x409d('0x16')]);}})[_0x409d('0x18')](function(_0x2e3290){logger[_0x409d('0x14')]('CmCustomField,\x20%s,\x20%s',_0x5763d4,_0x2e3290);_0x3651ff(_0x2e3290);});});} \ No newline at end of file +var _0xe25c=['CmCustomField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x48cb3b,_0x770492){var _0x2414f0=function(_0x125c23){while(--_0x125c23){_0x48cb3b['push'](_0x48cb3b['shift']());}};_0x2414f0(++_0x770492);}(_0xe25c,0x75));var _0xce25=function(_0x2a7688,_0xe708d2){_0x2a7688=_0x2a7688-0x0;var _0x3962da=_0xe25c[_0x2a7688];return _0x3962da;};'use strict';var _=require(_0xce25('0x0'));var util=require(_0xce25('0x1'));var moment=require(_0xce25('0x2'));var BPromise=require(_0xce25('0x3'));var rs=require(_0xce25('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce25('0x5'))['db'];var utils=require(_0xce25('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xce25('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xce25('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1583e3,_0xb14a4e,_0x417557){return new BPromise(function(_0x11ae6a,_0x580ac7){return client[_0xce25('0x9')](_0x1583e3,_0x417557)['then'](function(_0x83fc4e){logger[_0xce25('0xa')]('CmCustomField,\x20%s,\x20%s',_0xb14a4e,_0xce25('0xb'));logger[_0xce25('0xc')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xb14a4e,_0xce25('0xb'),JSON[_0xce25('0xd')](_0x83fc4e));if(_0x83fc4e['error']){if(_0x83fc4e[_0xce25('0xe')][_0xce25('0xf')]===0x1f4){logger['error'](_0xce25('0x10'),_0xb14a4e,_0x83fc4e['error'][_0xce25('0x11')]);return _0x580ac7(_0x83fc4e['error'][_0xce25('0x11')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0xb14a4e,_0x83fc4e[_0xce25('0xe')]['message']);return _0x11ae6a(_0x83fc4e['error'][_0xce25('0x11')]);}else{logger[_0xce25('0xa')](_0xce25('0x10'),_0xb14a4e,_0xce25('0xb'));_0x11ae6a(_0x83fc4e[_0xce25('0x12')][_0xce25('0x11')]);}})['catch'](function(_0x35ed7e){logger['error'](_0xce25('0x10'),_0xb14a4e,_0x35ed7e);_0x580ac7(_0x35ed7e);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 2f0a28b..15bb533 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 _0xed1f=['/:id','show','create','put','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xed1f,0x170));var _0xfed1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xed1f[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfed1('0x2'));var router=express['Router']();var fs_extra=require(_0xfed1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfed1('0x4'));var config=require(_0xfed1('0x5'));var controller=require(_0xfed1('0x6'));router[_0xfed1('0x7')]('/',auth[_0xfed1('0x8')](),controller[_0xfed1('0x9')]);router[_0xfed1('0x7')](_0xfed1('0xa'),auth[_0xfed1('0x8')](),controller[_0xfed1('0xb')]);router['post']('/',auth[_0xfed1('0x8')](),controller[_0xfed1('0xc')]);router[_0xfed1('0xd')]('/:id',auth[_0xfed1('0x8')](),controller['update']);router['delete'](_0xfed1('0xa'),auth[_0xfed1('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfafb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x3a0ff1,_0x157397){var _0x7092ba=function(_0x5282f9){while(--_0x5282f9){_0x3a0ff1['push'](_0x3a0ff1['shift']());}};_0x7092ba(++_0x157397);}(_0xfafb,0xf2));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbfaf('0x0'));var util=require('util');var path=require(_0xbfaf('0x1'));var timeout=require(_0xbfaf('0x2'));var express=require(_0xbfaf('0x3'));var router=express[_0xbfaf('0x4')]();var fs_extra=require(_0xbfaf('0x5'));var auth=require(_0xbfaf('0x6'));var interaction=require(_0xbfaf('0x7'));var config=require(_0xbfaf('0x8'));var controller=require(_0xbfaf('0x9'));router[_0xbfaf('0xa')]('/',auth[_0xbfaf('0xb')](),controller['index']);router[_0xbfaf('0xa')]('/:id',auth[_0xbfaf('0xb')](),controller[_0xbfaf('0xc')]);router[_0xbfaf('0xd')]('/',auth[_0xbfaf('0xb')](),controller[_0xbfaf('0xe')]);router[_0xbfaf('0xf')]('/:id',auth[_0xbfaf('0xb')](),controller['update']);router[_0xbfaf('0x10')]('/:id',auth[_0xbfaf('0xb')](),controller[_0xbfaf('0x11')]);module[_0xbfaf('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index aa632a1..7f529a5 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 _0x3a42=['DATE','format','INTEGER','UNSIGNED','contactListQueue','sequelize','STRING','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3a42,0xdd));var _0x23a4=function(_0x5c7be1,_0x30291a){_0x5c7be1=_0x5c7be1-0x0;var _0x1bbf3c=_0x3a42[_0x5c7be1];return _0x1bbf3c;};'use strict';var moment=require('moment');var Sequelize=require(_0x23a4('0x0'));module['exports']={'phone':{'type':Sequelize[_0x23a4('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x23a4('0x3')],'defaultValue':moment()[_0x23a4('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x23a4('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x23a4('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x23a4('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x23a4('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x23a4('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x23a4('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x23a4('0x7')},'ListId':{'type':Sequelize[_0x23a4('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x23a4('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x23a4('0x5')],'unique':_0x23a4('0x7')},'CampaignId':{'type':Sequelize[_0x23a4('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x23a4('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x23a4('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x23a4('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x23a4('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x23a4('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x23a4('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x23a4('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x23a4('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x3e51=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize','exports','STRING'];(function(_0x570f9e,_0x136096){var _0x1c4620=function(_0x25c4d){while(--_0x25c4d){_0x570f9e['push'](_0x570f9e['shift']());}};_0x1c4620(++_0x136096);}(_0x3e51,0x1d3));var _0x13e5=function(_0x277ad0,_0x35306c){_0x277ad0=_0x277ad0-0x0;var _0x3d1b66=_0x3e51[_0x277ad0];return _0x3d1b66;};'use strict';var moment=require('moment');var Sequelize=require(_0x13e5('0x0'));module[_0x13e5('0x1')]={'phone':{'type':Sequelize[_0x13e5('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x13e5('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x13e5('0x4')],'defaultValue':moment()[_0x13e5('0x5')](_0x13e5('0x6'))},'countbusyretry':{'type':Sequelize[_0x13e5('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x13e5('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x13e5('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x13e5('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x13e5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x13e5('0x4')]},'priority':{'type':Sequelize[_0x13e5('0x7')](0x2)[_0x13e5('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x13e5('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x13e5('0x7')],'unique':_0x13e5('0x9')},'ListId':{'type':Sequelize[_0x13e5('0x7')],'unique':_0x13e5('0x9')},'UserId':{'type':Sequelize[_0x13e5('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x13e5('0x7')],'unique':_0x13e5('0x9')},'CampaignId':{'type':Sequelize[_0x13e5('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x13e5('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x13e5('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x13e5('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x13e5('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x13e5('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 20a960e..f2de2a7 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 _0x1dcc=['destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','direction','hopperIds','priority','ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','List','VoiceQueue','findOne','Company','CmList','Queue','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','offset','undefined','count','limit','status','set','Content-Range','then','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x49b780,_0x3e3290){_0x49b780=_0x49b780-0x0;var _0x48d107=_0x1dcc[_0x49b780];return _0x48d107;};'use strict';var moment=require(_0xc1dc('0x0'));var _=require(_0xc1dc('0x1'));var qs=require(_0xc1dc('0x2'));var logger=require(_0xc1dc('0x3'))('api');var shared=require(_0xc1dc('0x4'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x20abc9,_0x3eb139){_0x3eb139=_0x3eb139||0xc8;return function(_0x2a8ff9){if(_0x2a8ff9){return _0x20abc9['status'](_0x3eb139)['json'](_0x2a8ff9);}};}function respondWithFilteredResult(_0x1e57ba,_0x381ab6){return function(_0x41b667){if(_0x41b667){var _0x4dab41=typeof _0x381ab6[_0xc1dc('0x5')]===_0xc1dc('0x6')&&typeof _0x381ab6['limit']===_0xc1dc('0x6');var _0x51c02b=_0x41b667[_0xc1dc('0x7')];var _0x49ef48=_0x4dab41?0x0:_0x381ab6[_0xc1dc('0x5')];var _0x16520d=_0x4dab41?_0x41b667[_0xc1dc('0x7')]:_0x381ab6[_0xc1dc('0x5')]+_0x381ab6[_0xc1dc('0x8')];var _0x616175;if(_0x16520d>=_0x51c02b){_0x16520d=_0x51c02b;_0x616175=0xc8;}else{_0x616175=0xce;}_0x1e57ba[_0xc1dc('0x9')](_0x616175);return _0x1e57ba[_0xc1dc('0xa')](_0xc1dc('0xb'),_0x49ef48+'-'+_0x16520d+'/'+_0x51c02b)['json'](_0x41b667);}return null;};}function saveUpdates(_0x226ba3,_0x2c5f41){return function(_0xb7e667){if(_0xb7e667){return _0xb7e667['update'](_0x226ba3)[_0xc1dc('0xc')](function(_0x7d7257){return _0x7d7257;});}return null;};}function handleEntityNotFound(_0x299520,_0xd51b1e){return function(_0x145708){if(!_0x145708){_0x299520[_0xc1dc('0xd')](0x194);}return _0x145708;};}function handleError(_0x188182,_0x21aed1){_0x21aed1=_0x21aed1||0x1f4;return function(_0x265929){logger[_0xc1dc('0xe')](_0x265929[_0xc1dc('0xf')]);if(_0x265929['name']){delete _0x265929[_0xc1dc('0x10')];}_0x188182[_0xc1dc('0x9')](_0x21aed1)[_0xc1dc('0x11')](_0x265929);};}exports[_0xc1dc('0x12')]=function(_0x47c72e,_0x332400){var _0xc01137={},_0x499a42={},_0x484f6c={'count':0x0,'rows':[]};var _0x3f96d3=_[_0xc1dc('0x13')](db[_0xc1dc('0x14')][_0xc1dc('0x15')],function(_0x1707dc){return{'name':_0x1707dc[_0xc1dc('0x16')],'type':_0x1707dc[_0xc1dc('0x17')][_0xc1dc('0x18')]};});_0x499a42['model']=_['map'](_0x3f96d3,'name');_0x499a42[_0xc1dc('0x19')]=_[_0xc1dc('0x1a')](_0x47c72e['query']);_0x499a42[_0xc1dc('0x1b')]=_[_0xc1dc('0x1c')](_0x499a42[_0xc1dc('0x1d')],_0x499a42[_0xc1dc('0x19')]);_0x499a42[_0xc1dc('0x1b')]=_[_0xc1dc('0x1e')](_0x499a42[_0xc1dc('0x1b')],[_0xc1dc('0x1f'),_0xc1dc('0x20'),_0xc1dc('0x21'),'$gte',_0xc1dc('0x22'),_0xc1dc('0x23'),_0xc1dc('0x24'),_0xc1dc('0x25'),'$not',_0xc1dc('0x26'),_0xc1dc('0x27'),_0xc1dc('0x28'),_0xc1dc('0x29'),_0xc1dc('0x2a'),_0xc1dc('0x2b'),_0xc1dc('0x2c'),_0xc1dc('0x2d'),_0xc1dc('0x2a'),'$overlap',_0xc1dc('0x2e'),_0xc1dc('0x2f'),_0xc1dc('0x30')]);_0xc01137[_0xc1dc('0x31')]=_[_0xc1dc('0x1c')](_0x499a42[_0xc1dc('0x1d')],qs[_0xc1dc('0x32')](_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x32')]));_0xc01137[_0xc1dc('0x31')]=_0xc01137[_0xc1dc('0x31')]['length']?_0xc01137[_0xc1dc('0x31')]:_0x499a42[_0xc1dc('0x1d')];if(!_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x33')](_0xc1dc('0x34'))){_0xc01137[_0xc1dc('0x8')]=qs[_0xc1dc('0x8')](_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x8')]);_0xc01137['offset']=qs['offset'](_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x5')]);}_0xc01137[_0xc1dc('0x35')]=qs[_0xc1dc('0x36')](_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x36')]);_0xc01137['where']=qs[_0xc1dc('0x1b')](_[_0xc1dc('0x37')](_0x47c72e['query'],_0x499a42[_0xc1dc('0x1b')]),_0x3f96d3);if(_0x47c72e[_0xc1dc('0x19')]['filter']){_0xc01137[_0xc1dc('0x38')]=_[_0xc1dc('0x39')](_0xc01137[_0xc1dc('0x38')],{'$or':_['map'](_0x3f96d3,function(_0x1ee0ba){if(_0x1ee0ba[_0xc1dc('0x17')]!==_0xc1dc('0x3a')){var _0x341bb3={};_0x341bb3[_0x1ee0ba[_0xc1dc('0x10')]]={'$like':'%'+_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x3b')]+'%'};return _0x341bb3;}})});}_0xc01137=_[_0xc1dc('0x39')]({},_0xc01137,_0x47c72e[_0xc1dc('0x3c')]);var _0x4e3051={'where':_0xc01137[_0xc1dc('0x38')]};return db[_0xc1dc('0x14')][_0xc1dc('0x7')](_0x4e3051)['then'](function(_0x19bde9){_0x484f6c[_0xc1dc('0x7')]=_0x19bde9;if(_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x3d')]){_0xc01137[_0xc1dc('0x3e')]=[{'all':!![]}];}return db[_0xc1dc('0x14')][_0xc1dc('0x3f')](_0xc01137);})[_0xc1dc('0xc')](function(_0x5967b2){_0x484f6c[_0xc1dc('0x40')]=_0x5967b2;return _0x484f6c;})[_0xc1dc('0xc')](respondWithFilteredResult(_0x332400,_0xc01137))[_0xc1dc('0x41')](handleError(_0x332400,null));};exports[_0xc1dc('0x42')]=function(_0x1d8107,_0x1fbdb8){var _0x503ec8={'raw':!![],'where':{'id':_0x1d8107[_0xc1dc('0x43')]['id']}},_0x12a92d={};_0x12a92d[_0xc1dc('0x1d')]=_[_0xc1dc('0x1a')](db[_0xc1dc('0x14')]['rawAttributes']);_0x12a92d['query']=_[_0xc1dc('0x1a')](_0x1d8107[_0xc1dc('0x19')]);_0x12a92d[_0xc1dc('0x1b')]=_[_0xc1dc('0x1c')](_0x12a92d[_0xc1dc('0x1d')],_0x12a92d[_0xc1dc('0x19')]);_0x503ec8[_0xc1dc('0x31')]=_['intersection'](_0x12a92d[_0xc1dc('0x1d')],qs[_0xc1dc('0x32')](_0x1d8107[_0xc1dc('0x19')]['fields']));_0x503ec8[_0xc1dc('0x31')]=_0x503ec8[_0xc1dc('0x31')][_0xc1dc('0x44')]?_0x503ec8[_0xc1dc('0x31')]:_0x12a92d['model'];if(_0x1d8107['query'][_0xc1dc('0x3d')]){_0x503ec8[_0xc1dc('0x3e')]=[{'all':!![]}];}_0x503ec8=_['merge']({},_0x503ec8,_0x1d8107[_0xc1dc('0x3c')]);return db[_0xc1dc('0x14')][_0xc1dc('0x45')](_0x503ec8)[_0xc1dc('0xc')](handleEntityNotFound(_0x1fbdb8,null))[_0xc1dc('0xc')](respondWithResult(_0x1fbdb8,null))[_0xc1dc('0x41')](handleError(_0x1fbdb8,null));};exports[_0xc1dc('0x46')]=function(_0x54bb1f,_0x5a74a0){return db[_0xc1dc('0x14')]['create'](_0x54bb1f[_0xc1dc('0x47')],{})[_0xc1dc('0xc')](respondWithResult(_0x5a74a0,0xc9))[_0xc1dc('0x41')](handleError(_0x5a74a0,null));};exports[_0xc1dc('0x48')]=function(_0x452303,_0x40eb12){if(_0x452303[_0xc1dc('0x47')]['id']){delete _0x452303[_0xc1dc('0x47')]['id'];}return db['CmHopper'][_0xc1dc('0x45')]({'where':{'id':_0x452303[_0xc1dc('0x43')]['id']}})[_0xc1dc('0xc')](handleEntityNotFound(_0x40eb12,null))[_0xc1dc('0xc')](saveUpdates(_0x452303[_0xc1dc('0x47')],null))[_0xc1dc('0xc')](respondWithResult(_0x40eb12,null))[_0xc1dc('0x41')](handleError(_0x40eb12,null));};exports[_0xc1dc('0x49')]=function(_0x2ca7f1,_0x29417d){return db['CmHopper']['describe']()['then'](respondWithResult(_0x29417d,null))[_0xc1dc('0x41')](handleError(_0x29417d,null));};exports[_0xc1dc('0x4a')]=function(_0x57b792,_0x129e23){var _0x6ab7fc;var _0x505272=_0x57b792[_0xc1dc('0x43')]['id'];return db['CmHopper'][_0xc1dc('0x45')]({'where':{'id':_0x57b792[_0xc1dc('0x43')]['id']}})[_0xc1dc('0xc')](handleEntityNotFound(_0x129e23,null))[_0xc1dc('0xc')](function(_0x331d24){if(_0x331d24){return _0x331d24[_0xc1dc('0x4a')]()[_0xc1dc('0xc')](function(_0x34667b){return _0x34667b;});}})['then'](function(_0x21b385){_0x6ab7fc=_0x21b385;if(_0x21b385){if(_0x21b385[_0xc1dc('0x4b')]||_0x21b385[_0xc1dc('0x4c')]){return db[_0x21b385[_0xc1dc('0x4b')]?'VoiceQueue':_0xc1dc('0x4d')][_0xc1dc('0x45')]({'where':{'id':_0x21b385[_0xc1dc('0x4b')]?_0x21b385[_0xc1dc('0x4b')]:_0x21b385[_0xc1dc('0x4c')]},'attributes':['id',_0xc1dc('0x10')],'raw':!![]});}}})[_0xc1dc('0xc')](function(_0x17d80f){var _0x512ec1={};if(_0x17d80f){_[_0xc1dc('0x39')](_0x512ec1,_[_0xc1dc('0x4e')](_0x6ab7fc[_0xc1dc('0x4f')],[_0xc1dc('0x50'),_0xc1dc('0x51'),'id']));_0x512ec1[_0xc1dc('0x52')]=0x15;_0x512ec1[_0xc1dc('0x53')]='deleted';_0x512ec1[_0xc1dc('0x54')]=_0x17d80f[_0xc1dc('0x10')];_0x512ec1[_0xc1dc('0x55')]=_0x57b792[_0xc1dc('0x56')][_0xc1dc('0x10')];_0x512ec1[_0xc1dc('0x57')]=_0x57b792[_0xc1dc('0x56')]['id'];_0x512ec1[_0xc1dc('0x58')]=!![];_0x512ec1[_0xc1dc('0x59')]=moment()['format'](_0xc1dc('0x5a'));_0x512ec1['calleridnum']=_0x6ab7fc[_0xc1dc('0x5b')];_0x512ec1[_0xc1dc('0x5c')]=_0x6ab7fc[_0xc1dc('0x4b')]?_0xc1dc('0x5d'):_0xc1dc('0x5e');return db[_0xc1dc('0x5f')][_0xc1dc('0x45')]({'where':{'id':_0x512ec1['ContactId']},'attributes':[_0xc1dc('0x60'),_0xc1dc('0x61')]})['then'](function(_0x5635a6){if(!_[_0xc1dc('0x62')](_0x129e23)&&!_[_0xc1dc('0x62')](_0x5635a6[_0xc1dc('0x60')])){_0x512ec1[_0xc1dc('0x63')]=_0x5635a6['firstName'];if(!_['isNil'](_0x5635a6[_0xc1dc('0x61')])){_0x512ec1[_0xc1dc('0x63')]+='\x20'+_0x5635a6[_0xc1dc('0x61')];}}})['finally'](function(){return db[_0xc1dc('0x64')][_0xc1dc('0x46')](_0x512ec1);});}})[_0xc1dc('0xc')](function(_0x4476eb){return db[_0xc1dc('0x65')]['destroy']({'where':{'CmHopperId':_0x505272}});})[_0xc1dc('0xc')](function(){return _0x129e23[_0xc1dc('0x9')](0xcc)[_0xc1dc('0x66')]();})[_0xc1dc('0x41')](handleError(_0x129e23,null));};exports[_0xc1dc('0x67')]=function(_0x2a1a44,_0x166d59){var _0x145b62=[];return db[_0xc1dc('0x5f')]['describe']()['then'](function(_0x3c1bf8){_0x145b62=_[_0xc1dc('0x1a')](_0x3c1bf8);return _0x2a1a44[_0xc1dc('0x56')][_0xc1dc('0x68')]({'where':{'type':_0xc1dc('0x69'),'dialActive':!![],'dialMethod':_0xc1dc('0x6a')},'attributes':['id',_0xc1dc('0x6b'),_0xc1dc('0x6c')],'raw':!![]});})[_0xc1dc('0xc')](function(_0x4de18d){if(_0x4de18d&&_0x4de18d[_0xc1dc('0x44')]){return db[_0xc1dc('0x6d')][_0xc1dc('0x6e')](function(_0x20a96b){var _0x45ff61={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xc1dc('0x6f')](_0xc1dc('0x5a'))},'VoiceQueueId':{'$in':_[_0xc1dc('0x13')](_0x4de18d,'id')},'$or':[{'UserId':null},{'UserId':_0x2a1a44[_0xc1dc('0x56')]['id']}]};var _0x5c2942={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4de18d)[_0xc1dc('0x3b')]([_0xc1dc('0x6c'),0x0])[_0xc1dc('0x13')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x2a1a44['user']['id']}]};var _0x32038f={'$or':[_0x45ff61,_0x5c2942]};var _0x5dd75b=[];if(_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x70')]&&_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x70')]==='prev'){if(!_['isEmpty'](_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x71')])){_0x32038f['id']={'$in':_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x71')]};}_0x5dd75b=[[_0xc1dc('0x72'),_0xc1dc('0x73')],[_0xc1dc('0x74'),_0x4de18d[0x0]['dialOrderByScheduledAt']===_0xc1dc('0x73')?'DESC':_0xc1dc('0x73')],db[_0xc1dc('0x6d')]['literal'](_0xc1dc('0x75')),['id',_0xc1dc('0x76')]];}else{if(!_['isEmpty'](_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x71')])){_0x32038f['id']={'$notIn':_0x2a1a44['body'][_0xc1dc('0x71')]};}_0x5dd75b=[[_0xc1dc('0x72'),_0xc1dc('0x76')],[_0xc1dc('0x74'),_0x4de18d[0x0][_0xc1dc('0x6b')]],db[_0xc1dc('0x6d')][_0xc1dc('0x77')](_0xc1dc('0x78')),['id','ASC']];}return db[_0xc1dc('0x14')]['findOne']({'attributes':['id',_0xc1dc('0x79'),'phone',_0xc1dc('0x7a')],'where':_0x32038f,'order':_0x5dd75b,'transaction':_0x20a96b,'lock':_0x20a96b[_0xc1dc('0x7b')][_0xc1dc('0x7c')],'include':[{'model':db[_0xc1dc('0x5f')],'as':_0xc1dc('0x7d'),'attributes':_0x145b62,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xc1dc('0x10')]}]},{'model':db['CmList'],'as':_0xc1dc('0x7e'),'attributes':['id',_0xc1dc('0x10')]},{'model':db[_0xc1dc('0x7f')],'as':'Queue','attributes':['id',_0xc1dc('0x10'),'dialActive']}]})[_0xc1dc('0xc')](function(_0x320441){if(_0x320441){return _0x320441[_0xc1dc('0x48')]({'UserId':_0x2a1a44['user']['id']},{'transaction':_0x20a96b});}});});}})[_0xc1dc('0xc')](handleEntityNotFound(_0x166d59,null))[_0xc1dc('0xc')](respondWithResult(_0x166d59,null))[_0xc1dc('0x41')](handleError(_0x166d59,null));};exports['getPreviewRecall']=function(_0x51d4ce,_0x2c6f8b,_0x2ab121){var _0x5d07dc=[];var _0x3a3e3e=_0x51d4ce[_0xc1dc('0x43')]['id'];var _0x813307=_0x51d4ce[_0xc1dc('0x56')]['id'];return db['CmContact'][_0xc1dc('0x49')]()[_0xc1dc('0xc')](function(_0x12c155){_0x5d07dc=_[_0xc1dc('0x1a')](_0x12c155);return db[_0xc1dc('0x6d')][_0xc1dc('0x6e')](function(_0x33e810){const _0x42d1fb={'id':_0x3a3e3e};return db[_0xc1dc('0x14')][_0xc1dc('0x80')]({'attributes':['id',_0xc1dc('0x79'),_0xc1dc('0x7a')],'where':_0x42d1fb,'transaction':_0x33e810,'lock':_0x33e810['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x5d07dc,'include':[{'model':db['CmCompany'],'as':_0xc1dc('0x81'),'attributes':['id','name']}]},{'model':db[_0xc1dc('0x82')],'as':_0xc1dc('0x7e'),'attributes':['id',_0xc1dc('0x10')]},{'model':db[_0xc1dc('0x7f')],'as':_0xc1dc('0x83'),'attributes':['id','name','dialActive']}]})[_0xc1dc('0xc')](function(_0x264989){if(_0x264989){return _0x264989['update']({'UserId':_0x813307},{'transaction':_0x33e810});}});});})[_0xc1dc('0xc')](handleEntityNotFound(_0x2c6f8b,null))['then'](respondWithResult(_0x2c6f8b,null))['catch'](handleError(_0x2c6f8b,null));};exports['getOpenContacts']=function(_0x4e3bf2,_0x43634f){return _0x4e3bf2['user'][_0xc1dc('0x68')]({'where':{'type':_0xc1dc('0x69'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xc1dc('0xc')](function(_0x31f9bc){if(_0x31f9bc&&_0x31f9bc[_0xc1dc('0x44')]){return db[_0xc1dc('0x14')][_0xc1dc('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xc1dc('0x5a'))},'VoiceQueueId':{'$in':_['map'](_0x31f9bc,'id')},'$or':[{'UserId':null},{'UserId':_0x4e3bf2['user']['id']}]}});}return 0x0;})['then'](function(_0x2c22a7){if(!_[_0xc1dc('0x62')](_0x2c22a7)&&_[_0xc1dc('0x84')](_0x2c22a7)){return _0x43634f[_0xc1dc('0x9')](0xc8)[_0xc1dc('0x85')]({'contacts':_0x2c22a7});}else{logger[_0xc1dc('0xe')](_0xc1dc('0x86'),'getOpenContacts',0x194,_0xc1dc('0x87'));_0x43634f[_0xc1dc('0xd')](0x194);}})[_0xc1dc('0x41')](handleError(_0x43634f,null));};exports[_0xc1dc('0x88')]=function(_0x413c40,_0x247cc1){var _0x4bca30=shared[_0xc1dc('0x89')];var _0x1d9dfb=[];_['map'](_0x4bca30,function(_0x5d3625){_0x1d9dfb[_0xc1dc('0x8a')]({'id':_0x5d3625[_0xc1dc('0x10')],'name':_0x5d3625[_0xc1dc('0x10')],'utcOffset':_0x5d3625[_0xc1dc('0x8b')]});});return _0x247cc1[_0xc1dc('0x9')](0xc8)[_0xc1dc('0x85')]({'tz':_0x1d9dfb});};exports[_0xc1dc('0x8c')]=function(_0x48d6a7,_0x551195){var _0x3750d4=shared['timezones'];var _0x24efce={};if(!_[_0xc1dc('0x62')](_0x3750d4[_0x48d6a7[_0xc1dc('0x47')]['id']]))_0x24efce=_0x3750d4[_0x48d6a7['body']['id']];return _0x551195[_0xc1dc('0x9')](0xc8)[_0xc1dc('0x85')](_0x24efce);}; \ No newline at end of file +var _0x4006=['options','find','create','body','catch','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','DESC','literal','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','getPreviewRecall','Company','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','timezones','lodash','../../components/parsers/qs','../../config/logger','api','offset','undefined','count','limit','status','Content-Range','json','update','then','sendStatus','error','name','send','CmHopper','rawAttributes','type','key','model','map','query','keys','filters','intersection','$and','$or','$gt','$lt','$ne','$not','$between','$in','$notIn','$like','$iLike','$overlap','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','params','includeAll'];(function(_0x2fd232,_0x5983f0){var _0x338b88=function(_0x2eadfc){while(--_0x2eadfc){_0x2fd232['push'](_0x2fd232['shift']());}};_0x338b88(++_0x5983f0);}(_0x4006,0x1c7));var _0x6400=function(_0x596332,_0x47c9d4){_0x596332=_0x596332-0x0;var _0x44f15e=_0x4006[_0x596332];return _0x44f15e;};'use strict';var moment=require('moment');var _=require(_0x6400('0x0'));var qs=require(_0x6400('0x1'));var logger=require(_0x6400('0x2'))(_0x6400('0x3'));var shared=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithResult(_0xee0578,_0x4b0418){_0x4b0418=_0x4b0418||0xc8;return function(_0xd858df){if(_0xd858df){return _0xee0578['status'](_0x4b0418)['json'](_0xd858df);}};}function respondWithFilteredResult(_0x2dbd03,_0x599e6f){return function(_0x32c0db){if(_0x32c0db){var _0x2d365b=typeof _0x599e6f[_0x6400('0x4')]===_0x6400('0x5')&&typeof _0x599e6f['limit']===_0x6400('0x5');var _0x46819e=_0x32c0db[_0x6400('0x6')];var _0x356982=_0x2d365b?0x0:_0x599e6f[_0x6400('0x4')];var _0x1c59d0=_0x2d365b?_0x32c0db[_0x6400('0x6')]:_0x599e6f[_0x6400('0x4')]+_0x599e6f[_0x6400('0x7')];var _0xc510dc;if(_0x1c59d0>=_0x46819e){_0x1c59d0=_0x46819e;_0xc510dc=0xc8;}else{_0xc510dc=0xce;}_0x2dbd03[_0x6400('0x8')](_0xc510dc);return _0x2dbd03['set'](_0x6400('0x9'),_0x356982+'-'+_0x1c59d0+'/'+_0x46819e)[_0x6400('0xa')](_0x32c0db);}return null;};}function saveUpdates(_0x230c94,_0x36bf00){return function(_0x5a6d31){if(_0x5a6d31){return _0x5a6d31[_0x6400('0xb')](_0x230c94)[_0x6400('0xc')](function(_0x4ed062){return _0x4ed062;});}return null;};}function handleEntityNotFound(_0x4f8133,_0x559312){return function(_0x268f93){if(!_0x268f93){_0x4f8133[_0x6400('0xd')](0x194);}return _0x268f93;};}function handleError(_0x5b0492,_0x191696){_0x191696=_0x191696||0x1f4;return function(_0x4ae3ea){logger[_0x6400('0xe')](_0x4ae3ea['stack']);if(_0x4ae3ea[_0x6400('0xf')]){delete _0x4ae3ea[_0x6400('0xf')];}_0x5b0492[_0x6400('0x8')](_0x191696)[_0x6400('0x10')](_0x4ae3ea);};}exports['index']=function(_0x444bce,_0x14c036){var _0xce9fd1={},_0x50524f={},_0x73c470={'count':0x0,'rows':[]};var _0x205f8b=_['map'](db[_0x6400('0x11')][_0x6400('0x12')],function(_0xb4d0ca){return{'name':_0xb4d0ca['fieldName'],'type':_0xb4d0ca[_0x6400('0x13')][_0x6400('0x14')]};});_0x50524f[_0x6400('0x15')]=_[_0x6400('0x16')](_0x205f8b,_0x6400('0xf'));_0x50524f[_0x6400('0x17')]=_[_0x6400('0x18')](_0x444bce[_0x6400('0x17')]);_0x50524f[_0x6400('0x19')]=_[_0x6400('0x1a')](_0x50524f['model'],_0x50524f[_0x6400('0x17')]);_0x50524f['filters']=_['concat'](_0x50524f[_0x6400('0x19')],[_0x6400('0x1b'),_0x6400('0x1c'),_0x6400('0x1d'),'$gte',_0x6400('0x1e'),'$lte',_0x6400('0x1f'),'$eq',_0x6400('0x20'),_0x6400('0x21'),'$notBetween',_0x6400('0x22'),_0x6400('0x23'),_0x6400('0x24'),'$notLike',_0x6400('0x25'),'$notILike','$like',_0x6400('0x26'),'$contains',_0x6400('0x27'),_0x6400('0x28')]);_0xce9fd1['attributes']=_[_0x6400('0x1a')](_0x50524f['model'],qs['fields'](_0x444bce[_0x6400('0x17')][_0x6400('0x29')]));_0xce9fd1[_0x6400('0x2a')]=_0xce9fd1[_0x6400('0x2a')][_0x6400('0x2b')]?_0xce9fd1['attributes']:_0x50524f[_0x6400('0x15')];if(!_0x444bce[_0x6400('0x17')][_0x6400('0x2c')](_0x6400('0x2d'))){_0xce9fd1['limit']=qs[_0x6400('0x7')](_0x444bce[_0x6400('0x17')][_0x6400('0x7')]);_0xce9fd1['offset']=qs[_0x6400('0x4')](_0x444bce[_0x6400('0x17')][_0x6400('0x4')]);}_0xce9fd1[_0x6400('0x2e')]=qs['sort'](_0x444bce[_0x6400('0x17')][_0x6400('0x2f')]);_0xce9fd1['where']=qs[_0x6400('0x19')](_[_0x6400('0x30')](_0x444bce['query'],_0x50524f['filters']),_0x205f8b);if(_0x444bce[_0x6400('0x17')][_0x6400('0x31')]){_0xce9fd1[_0x6400('0x32')]=_['merge'](_0xce9fd1['where'],{'$or':_['map'](_0x205f8b,function(_0x1a6f4e){if(_0x1a6f4e[_0x6400('0x13')]!==_0x6400('0x33')){var _0x1a9e17={};_0x1a9e17[_0x1a6f4e[_0x6400('0xf')]]={'$like':'%'+_0x444bce['query'][_0x6400('0x31')]+'%'};return _0x1a9e17;}})});}_0xce9fd1=_[_0x6400('0x34')]({},_0xce9fd1,_0x444bce['options']);var _0x51425c={'where':_0xce9fd1[_0x6400('0x32')]};return db[_0x6400('0x11')][_0x6400('0x6')](_0x51425c)['then'](function(_0x2693a5){_0x73c470[_0x6400('0x6')]=_0x2693a5;if(_0x444bce[_0x6400('0x17')]['includeAll']){_0xce9fd1[_0x6400('0x35')]=[{'all':!![]}];}return db[_0x6400('0x11')][_0x6400('0x36')](_0xce9fd1);})['then'](function(_0x4df55d){_0x73c470['rows']=_0x4df55d;return _0x73c470;})[_0x6400('0xc')](respondWithFilteredResult(_0x14c036,_0xce9fd1))['catch'](handleError(_0x14c036,null));};exports['show']=function(_0x473cef,_0x139145){var _0x565942={'raw':!![],'where':{'id':_0x473cef[_0x6400('0x37')]['id']}},_0x150158={};_0x150158[_0x6400('0x15')]=_['keys'](db[_0x6400('0x11')][_0x6400('0x12')]);_0x150158[_0x6400('0x17')]=_[_0x6400('0x18')](_0x473cef['query']);_0x150158['filters']=_[_0x6400('0x1a')](_0x150158[_0x6400('0x15')],_0x150158[_0x6400('0x17')]);_0x565942['attributes']=_[_0x6400('0x1a')](_0x150158[_0x6400('0x15')],qs[_0x6400('0x29')](_0x473cef[_0x6400('0x17')][_0x6400('0x29')]));_0x565942['attributes']=_0x565942[_0x6400('0x2a')]['length']?_0x565942[_0x6400('0x2a')]:_0x150158[_0x6400('0x15')];if(_0x473cef[_0x6400('0x17')][_0x6400('0x38')]){_0x565942['include']=[{'all':!![]}];}_0x565942=_[_0x6400('0x34')]({},_0x565942,_0x473cef[_0x6400('0x39')]);return db[_0x6400('0x11')][_0x6400('0x3a')](_0x565942)['then'](handleEntityNotFound(_0x139145,null))[_0x6400('0xc')](respondWithResult(_0x139145,null))['catch'](handleError(_0x139145,null));};exports[_0x6400('0x3b')]=function(_0x52cc77,_0x416307){return db[_0x6400('0x11')][_0x6400('0x3b')](_0x52cc77['body'],{})[_0x6400('0xc')](respondWithResult(_0x416307,0xc9))['catch'](handleError(_0x416307,null));};exports[_0x6400('0xb')]=function(_0x146358,_0x3f444d){if(_0x146358[_0x6400('0x3c')]['id']){delete _0x146358[_0x6400('0x3c')]['id'];}return db[_0x6400('0x11')][_0x6400('0x3a')]({'where':{'id':_0x146358[_0x6400('0x37')]['id']}})[_0x6400('0xc')](handleEntityNotFound(_0x3f444d,null))[_0x6400('0xc')](saveUpdates(_0x146358[_0x6400('0x3c')],null))['then'](respondWithResult(_0x3f444d,null))[_0x6400('0x3d')](handleError(_0x3f444d,null));};exports[_0x6400('0x3e')]=function(_0x59a8f2,_0x50df2e){return db[_0x6400('0x11')][_0x6400('0x3e')]()[_0x6400('0xc')](respondWithResult(_0x50df2e,null))['catch'](handleError(_0x50df2e,null));};exports[_0x6400('0x3f')]=function(_0x54cbfb,_0x518ee4){var _0x539a5f;var _0x32c3d0=_0x54cbfb[_0x6400('0x37')]['id'];return db['CmHopper'][_0x6400('0x3a')]({'where':{'id':_0x54cbfb[_0x6400('0x37')]['id']}})['then'](handleEntityNotFound(_0x518ee4,null))['then'](function(_0x35cd68){if(_0x35cd68){return _0x35cd68[_0x6400('0x3f')]()['then'](function(_0x3421b5){return _0x3421b5;});}})[_0x6400('0xc')](function(_0xfd8d19){_0x539a5f=_0xfd8d19;if(_0xfd8d19){if(_0xfd8d19[_0x6400('0x40')]||_0xfd8d19[_0x6400('0x41')]){return db[_0xfd8d19[_0x6400('0x40')]?_0x6400('0x42'):'Campaign'][_0x6400('0x3a')]({'where':{'id':_0xfd8d19[_0x6400('0x40')]?_0xfd8d19[_0x6400('0x40')]:_0xfd8d19[_0x6400('0x41')]},'attributes':['id',_0x6400('0xf')],'raw':!![]});}}})[_0x6400('0xc')](function(_0x6a3a2d){var _0x49adde={};if(_0x6a3a2d){_[_0x6400('0x34')](_0x49adde,_['omit'](_0x539a5f['dataValues'],[_0x6400('0x43'),_0x6400('0x44'),'id']));_0x49adde[_0x6400('0x45')]=0x15;_0x49adde['statedesc']=_0x6400('0x46');_0x49adde[_0x6400('0x47')]=_0x6a3a2d[_0x6400('0xf')];_0x49adde[_0x6400('0x48')]=_0x54cbfb[_0x6400('0x49')]['name'];_0x49adde[_0x6400('0x4a')]=_0x54cbfb[_0x6400('0x49')]['id'];_0x49adde['deleted']=!![];_0x49adde[_0x6400('0x4b')]=moment()[_0x6400('0x4c')](_0x6400('0x4d'));_0x49adde['calleridnum']=_0x539a5f[_0x6400('0x4e')];_0x49adde['campaigntype']=_0x539a5f[_0x6400('0x40')]?_0x6400('0x4f'):_0x6400('0x50');return db[_0x6400('0x51')][_0x6400('0x3a')]({'where':{'id':_0x49adde[_0x6400('0x52')]},'attributes':['firstName',_0x6400('0x53')]})[_0x6400('0xc')](function(_0x5cbd3c){if(!_[_0x6400('0x54')](_0x518ee4)&&!_[_0x6400('0x54')](_0x5cbd3c[_0x6400('0x55')])){_0x49adde[_0x6400('0x56')]=_0x5cbd3c['firstName'];if(!_[_0x6400('0x54')](_0x5cbd3c[_0x6400('0x53')])){_0x49adde[_0x6400('0x56')]+='\x20'+_0x5cbd3c[_0x6400('0x53')];}}})[_0x6400('0x57')](function(){return db[_0x6400('0x58')][_0x6400('0x3b')](_0x49adde);});}})[_0x6400('0xc')](function(_0x252751){return db[_0x6400('0x59')][_0x6400('0x3f')]({'where':{'CmHopperId':_0x32c3d0}});})[_0x6400('0xc')](function(){return _0x518ee4['status'](0xcc)[_0x6400('0x5a')]();})[_0x6400('0x3d')](handleError(_0x518ee4,null));};exports['getPreview']=function(_0x283ea6,_0x5057ba){var _0x2ab58f=[];return db[_0x6400('0x51')]['describe']()[_0x6400('0xc')](function(_0x4b3d37){_0x2ab58f=_[_0x6400('0x18')](_0x4b3d37);return _0x283ea6['user'][_0x6400('0x5b')]({'where':{'type':_0x6400('0x5c'),'dialActive':!![],'dialMethod':_0x6400('0x5d')},'attributes':['id',_0x6400('0x5e'),_0x6400('0x5f')],'raw':!![]});})[_0x6400('0xc')](function(_0x4c8f71){if(_0x4c8f71&&_0x4c8f71['length']){return db[_0x6400('0x60')][_0x6400('0x61')](function(_0x49b7df){var _0x10d6a8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x6400('0x16')](_0x4c8f71,'id')},'$or':[{'UserId':null},{'UserId':_0x283ea6[_0x6400('0x49')]['id']}]};var _0x39285e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4c8f71)[_0x6400('0x31')]([_0x6400('0x5f'),0x0])[_0x6400('0x16')]('id')[_0x6400('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x283ea6['user']['id']}]};var _0x3be82e={'$or':[_0x10d6a8,_0x39285e]};var _0xafff1b=[];if(_0x283ea6[_0x6400('0x3c')]['direction']&&_0x283ea6['body'][_0x6400('0x63')]===_0x6400('0x64')){if(!_[_0x6400('0x65')](_0x283ea6['body'][_0x6400('0x66')])){_0x3be82e['id']={'$in':_0x283ea6['body'][_0x6400('0x66')]};}_0xafff1b=[[_0x6400('0x67'),'ASC'],[_0x6400('0x68'),_0x4c8f71[0x0][_0x6400('0x5e')]===_0x6400('0x69')?_0x6400('0x6a'):_0x6400('0x69')],db[_0x6400('0x60')][_0x6400('0x6b')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x6400('0x6a')]];}else{if(!_[_0x6400('0x65')](_0x283ea6[_0x6400('0x3c')][_0x6400('0x66')])){_0x3be82e['id']={'$notIn':_0x283ea6[_0x6400('0x3c')][_0x6400('0x66')]};}_0xafff1b=[['priority',_0x6400('0x6a')],[_0x6400('0x68'),_0x4c8f71[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x6400('0x69')]];}return db[_0x6400('0x11')][_0x6400('0x6c')]({'attributes':['id',_0x6400('0x6d'),'phone',_0x6400('0x6e')],'where':_0x3be82e,'order':_0xafff1b,'transaction':_0x49b7df,'lock':_0x49b7df[_0x6400('0x6f')][_0x6400('0x70')],'include':[{'model':db[_0x6400('0x51')],'as':_0x6400('0x71'),'attributes':_0x2ab58f,'include':[{'model':db[_0x6400('0x72')],'as':'Company','attributes':['id',_0x6400('0xf')]}]},{'model':db[_0x6400('0x73')],'as':_0x6400('0x74'),'attributes':['id',_0x6400('0xf')]},{'model':db[_0x6400('0x42')],'as':_0x6400('0x75'),'attributes':['id',_0x6400('0xf'),'dialActive']}]})[_0x6400('0xc')](function(_0x240600){if(_0x240600){return _0x240600[_0x6400('0xb')]({'UserId':_0x283ea6[_0x6400('0x49')]['id']},{'transaction':_0x49b7df});}});});}})[_0x6400('0xc')](handleEntityNotFound(_0x5057ba,null))[_0x6400('0xc')](respondWithResult(_0x5057ba,null))[_0x6400('0x3d')](handleError(_0x5057ba,null));};exports[_0x6400('0x76')]=function(_0x3c2c95,_0x423abd,_0x1bf9f3){var _0x5eacb8=[];var _0x532e27=_0x3c2c95[_0x6400('0x37')]['id'];var _0x4bf10a=_0x3c2c95['user']['id'];return db[_0x6400('0x51')][_0x6400('0x3e')]()[_0x6400('0xc')](function(_0x433a32){_0x5eacb8=_['keys'](_0x433a32);return db[_0x6400('0x60')]['transaction'](function(_0x11d006){const _0x2fe63f={'id':_0x532e27};return db[_0x6400('0x11')]['findOne']({'attributes':['id',_0x6400('0x6d'),_0x6400('0x6e')],'where':_0x2fe63f,'transaction':_0x11d006,'lock':_0x11d006[_0x6400('0x6f')]['UPDATE'],'include':[{'model':db[_0x6400('0x51')],'as':_0x6400('0x71'),'attributes':_0x5eacb8,'include':[{'model':db['CmCompany'],'as':_0x6400('0x77'),'attributes':['id',_0x6400('0xf')]}]},{'model':db[_0x6400('0x73')],'as':_0x6400('0x74'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x6400('0xf'),_0x6400('0x78')]}]})[_0x6400('0xc')](function(_0xb598f5){if(_0xb598f5){return _0xb598f5['update']({'UserId':_0x4bf10a},{'transaction':_0x11d006});}});});})[_0x6400('0xc')](handleEntityNotFound(_0x423abd,null))[_0x6400('0xc')](respondWithResult(_0x423abd,null))[_0x6400('0x3d')](handleError(_0x423abd,null));};exports[_0x6400('0x79')]=function(_0x43c2c6,_0x59d472){return _0x43c2c6['user'][_0x6400('0x5b')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x6400('0x5d')},'attributes':['id'],'raw':!![]})[_0x6400('0xc')](function(_0x36a773){if(_0x36a773&&_0x36a773['length']){return db[_0x6400('0x11')][_0x6400('0x6')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6400('0x4c')](_0x6400('0x4d'))},'VoiceQueueId':{'$in':_[_0x6400('0x16')](_0x36a773,'id')},'$or':[{'UserId':null},{'UserId':_0x43c2c6[_0x6400('0x49')]['id']}]}});}return 0x0;})[_0x6400('0xc')](function(_0x283345){if(!_[_0x6400('0x54')](_0x283345)&&_[_0x6400('0x7a')](_0x283345)){return _0x59d472['status'](0xc8)[_0x6400('0xa')]({'contacts':_0x283345});}else{logger['error'](_0x6400('0x7b'),_0x6400('0x79'),0x194,_0x6400('0x7c'));_0x59d472[_0x6400('0xd')](0x194);}})[_0x6400('0x3d')](handleError(_0x59d472,null));};exports[_0x6400('0x7d')]=function(_0x43a887,_0x35bbd4){var _0x41797e=shared['timezones'];var _0x30904b=[];_[_0x6400('0x16')](_0x41797e,function(_0x2665af){_0x30904b[_0x6400('0x7e')]({'id':_0x2665af[_0x6400('0xf')],'name':_0x2665af[_0x6400('0xf')],'utcOffset':_0x2665af['utcOffset']});});return _0x35bbd4[_0x6400('0x8')](0xc8)['json']({'tz':_0x30904b});};exports['getTimezone']=function(_0x26d79a,_0x229ddd){var _0x109d99=shared[_0x6400('0x7f')];var _0x59f24b={};if(!_['isNil'](_0x109d99[_0x26d79a[_0x6400('0x3c')]['id']]))_0x59f24b=_0x109d99[_0x26d79a['body']['id']];return _0x229ddd[_0x6400('0x8')](0xc8)['json'](_0x59f24b);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index b605de2..b6f69cf 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 _0x5496=['request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0xcd9b37,_0x4816f6){var _0x4e1006=function(_0x4e535c){while(--_0x4e535c){_0xcd9b37['push'](_0xcd9b37['shift']());}};_0x4e1006(++_0x4816f6);}(_0x5496,0x175));var _0x6549=function(_0x381be1,_0xedd685){_0x381be1=_0x381be1-0x0;var _0x2bdd1f=_0x5496[_0x381be1];return _0x2bdd1f;};'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')]('CmHopper',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'phone','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xacf4=['define','CmHopper','cm_hopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports'];(function(_0x2b571a,_0x57e8f3){var _0x554531=function(_0x318204){while(--_0x318204){_0x2b571a['push'](_0x2b571a['shift']());}};_0x554531(++_0x57e8f3);}(_0xacf4,0xe7));var _0x4acf=function(_0x524e23,_0x1e2aa7){_0x524e23=_0x524e23-0x0;var _0x231413=_0xacf4[_0x524e23];return _0x231413;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x4acf('0xd')]},{'name':'priority','fields':[_0x4acf('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 bb6160f..8472195 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 _0x0c4f=['MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','GetContactRecallMe','describe','LOCK','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','User','CmList','List','NOW()','lodash','util','moment','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','catch','error','message','ShowCmHopper','find','create','body','CreateCmHopper','stringify','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','order','UPDATE','Contact','keys','Agent','name','voicePause','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer'];(function(_0x1b695e,_0x52ddf2){var _0x375b3c=function(_0x119bf4){while(--_0x119bf4){_0x1b695e['push'](_0x1b695e['shift']());}};_0x375b3c(++_0x52ddf2);}(_0x0c4f,0x199));var _0xf0c4=function(_0x53f04f,_0x419aa8){_0x53f04f=_0x53f04f-0x0;var _0x16a824=_0x0c4f[_0x53f04f];return _0x16a824;};'use strict';var _=require(_0xf0c4('0x0'));var util=require(_0xf0c4('0x1'));var moment=require(_0xf0c4('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xf0c4('0x3'))(_0xf0c4('0x4'));exports[_0xf0c4('0x5')]=function(_0x300a51){var _0x4b3deb=this;return new Promise(function(_0x172e21,_0x29fab7){return db[_0xf0c4('0x6')][_0xf0c4('0x7')]({'raw':_0x300a51[_0xf0c4('0x8')]?_0x300a51[_0xf0c4('0x8')][_0xf0c4('0x9')]===undefined?!![]:![]:!![],'where':_0x300a51['options']?_0x300a51[_0xf0c4('0x8')][_0xf0c4('0xa')]||null:null,'attributes':_0x300a51['options']?_0x300a51[_0xf0c4('0x8')]['attributes']||null:null,'limit':_0x300a51[_0xf0c4('0x8')]?_0x300a51[_0xf0c4('0x8')][_0xf0c4('0xb')]||null:null,'include':_0x300a51[_0xf0c4('0x8')]?_0x300a51[_0xf0c4('0x8')][_0xf0c4('0xc')]?_[_0xf0c4('0xd')](_0x300a51['options'][_0xf0c4('0xc')],function(_0x4d612f){return{'model':db[_0x4d612f[_0xf0c4('0xe')]],'as':_0x4d612f['as'],'attributes':_0x4d612f[_0xf0c4('0xf')],'include':_0x4d612f[_0xf0c4('0xc')]?_[_0xf0c4('0xd')](_0x4d612f[_0xf0c4('0xc')],function(_0x331b3f){return{'model':db[_0x331b3f[_0xf0c4('0xe')]],'as':_0x331b3f['as'],'attributes':_0x331b3f[_0xf0c4('0xf')],'include':_0x331b3f[_0xf0c4('0xc')]?_['map'](_0x331b3f[_0xf0c4('0xc')],function(_0x2103e4){return{'model':db[_0x2103e4['model']],'as':_0x2103e4['as'],'attributes':_0x2103e4[_0xf0c4('0xf')]};}):[]};}):[]};}):[]:[]})[_0xf0c4('0x10')](function(_0x4e70dc){logger[_0xf0c4('0x11')]('GetCmHopper',_0x300a51);logger[_0xf0c4('0x12')](_0xf0c4('0x5'),_0x300a51,JSON['stringify'](_0x4e70dc));_0x172e21(_0x4e70dc);})[_0xf0c4('0x13')](function(_0x2e1188){logger[_0xf0c4('0x14')](_0xf0c4('0x5'),_0x2e1188['message'],_0x300a51);_0x29fab7(_0x4b3deb[_0xf0c4('0x14')](0x1f4,_0x2e1188[_0xf0c4('0x15')]));});});};exports[_0xf0c4('0x16')]=function(_0x1c0806){var _0x12d248=this;return new Promise(function(_0x3b76cf,_0x4fd6f0){return db['CmHopper'][_0xf0c4('0x17')]({'raw':_0x1c0806[_0xf0c4('0x8')]?_0x1c0806[_0xf0c4('0x8')][_0xf0c4('0x9')]===undefined?!![]:![]:!![],'where':_0x1c0806['options']?_0x1c0806['options'][_0xf0c4('0xa')]||null:null,'attributes':_0x1c0806['options']?_0x1c0806[_0xf0c4('0x8')][_0xf0c4('0xf')]||null:null,'include':_0x1c0806[_0xf0c4('0x8')]?_0x1c0806['options'][_0xf0c4('0xc')]?_[_0xf0c4('0xd')](_0x1c0806[_0xf0c4('0x8')][_0xf0c4('0xc')],function(_0x382e5e){return{'model':db[_0x382e5e[_0xf0c4('0xe')]],'as':_0x382e5e['as'],'attributes':_0x382e5e[_0xf0c4('0xf')],'include':_0x382e5e['include']?_[_0xf0c4('0xd')](_0x382e5e[_0xf0c4('0xc')],function(_0x560c75){return{'model':db[_0x560c75[_0xf0c4('0xe')]],'as':_0x560c75['as'],'attributes':_0x560c75[_0xf0c4('0xf')],'include':_0x560c75['include']?_[_0xf0c4('0xd')](_0x560c75[_0xf0c4('0xc')],function(_0x38f70b){return{'model':db[_0x38f70b[_0xf0c4('0xe')]],'as':_0x38f70b['as'],'attributes':_0x38f70b[_0xf0c4('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13e4df){logger['info'](_0xf0c4('0x16'),_0x1c0806);logger[_0xf0c4('0x12')](_0xf0c4('0x16'),_0x1c0806,JSON['stringify'](_0x13e4df));_0x3b76cf(_0x13e4df);})[_0xf0c4('0x13')](function(_0x5609dd){logger[_0xf0c4('0x14')](_0xf0c4('0x16'),_0x5609dd[_0xf0c4('0x15')],_0x1c0806);_0x4fd6f0(_0x12d248[_0xf0c4('0x14')](0x1f4,_0x5609dd[_0xf0c4('0x15')]));});});};exports['CreateCmHopper']=function(_0x3eb34d){var _0x4d254e=this;return new Promise(function(_0x3872a5,_0x57dbc3){return db[_0xf0c4('0x6')][_0xf0c4('0x18')](_0x3eb34d[_0xf0c4('0x19')],{'raw':_0x3eb34d[_0xf0c4('0x8')]?_0x3eb34d[_0xf0c4('0x8')][_0xf0c4('0x9')]===undefined?!![]:![]:!![]})[_0xf0c4('0x10')](function(_0x481961){logger[_0xf0c4('0x11')](_0xf0c4('0x1a'),_0x3eb34d);logger['debug'](_0xf0c4('0x1a'),_0x3eb34d,JSON[_0xf0c4('0x1b')](_0x481961));_0x3872a5(_0x481961);})[_0xf0c4('0x13')](function(_0x2efcaf){logger[_0xf0c4('0x14')](_0xf0c4('0x1a'),_0x2efcaf[_0xf0c4('0x15')],_0x3eb34d);_0x57dbc3(_0x4d254e[_0xf0c4('0x14')](0x1f4,_0x2efcaf[_0xf0c4('0x15')]));});});};exports[_0xf0c4('0x1c')]=function(_0x1763d4){var _0x2e37a4=this;return new Promise(function(_0x385c9d,_0x4658a9){return db['CmHopper'][_0xf0c4('0x1d')](_0x1763d4[_0xf0c4('0x19')],{'raw':_0x1763d4[_0xf0c4('0x8')]?_0x1763d4[_0xf0c4('0x8')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1763d4[_0xf0c4('0x8')]?_0x1763d4[_0xf0c4('0x8')]['where']||null:null,'attributes':_0x1763d4['options']?_0x1763d4[_0xf0c4('0x8')]['attributes']||null:null,'limit':_0x1763d4[_0xf0c4('0x8')]?_0x1763d4[_0xf0c4('0x8')][_0xf0c4('0xb')]||null:null})[_0xf0c4('0x10')](function(_0x5af0de){logger['info'](_0xf0c4('0x1c'),_0x1763d4);logger[_0xf0c4('0x11')](_0xf0c4('0x1e'),JSON['stringify'](_0x1763d4[_0xf0c4('0x8')][_0xf0c4('0xa')]),_0x1763d4[_0xf0c4('0x19')][_0xf0c4('0x1f')]);logger[_0xf0c4('0x12')]('UpdateCmHopper',_0x1763d4,JSON[_0xf0c4('0x1b')](_0x5af0de));_0x385c9d(_0x5af0de);})['catch'](function(_0x5691da){logger[_0xf0c4('0x14')]('UpdateCmHopper',_0x5691da[_0xf0c4('0x15')],_0x1763d4);_0x4658a9(_0x2e37a4[_0xf0c4('0x14')](0x1f4,_0x5691da[_0xf0c4('0x15')]));});});};exports[_0xf0c4('0x20')]=function(_0x3b273f){var _0x22cdd=this;return new Promise(function(_0x4aea92,_0x1f6961){return db[_0xf0c4('0x6')][_0xf0c4('0x21')]({'where':_0x3b273f[_0xf0c4('0x8')]?_0x3b273f[_0xf0c4('0x8')][_0xf0c4('0xa')]||null:null})[_0xf0c4('0x10')](function(_0x4ac8ec){logger[_0xf0c4('0x11')](_0xf0c4('0x20'),_0x3b273f);logger[_0xf0c4('0x12')]('DestroyCmHopper',_0x3b273f,JSON[_0xf0c4('0x1b')](_0x4ac8ec));_0x4aea92(_0x4ac8ec);})['catch'](function(_0xc4b288){logger[_0xf0c4('0x14')](_0xf0c4('0x20'),_0xc4b288[_0xf0c4('0x15')],_0x3b273f);_0x1f6961(_0x22cdd[_0xf0c4('0x14')](0x1f4,_0xc4b288[_0xf0c4('0x15')]));});});};exports[_0xf0c4('0x22')]=function(_0x48fecc){var _0x63fdc3=this;return new Promise(function(_0x161904,_0x9371d4){return db[_0xf0c4('0x23')]['describe']()[_0xf0c4('0x10')](function(_0x3527e9){return db[_0xf0c4('0x24')][_0xf0c4('0x25')](function(_0x4c8ad3){return db[_0xf0c4('0x6')][_0xf0c4('0x7')]({'where':_0x48fecc['options']?_0x48fecc[_0xf0c4('0x8')][_0xf0c4('0xa')]||null:null,'attributes':_0x48fecc[_0xf0c4('0x8')]?_0x48fecc['options']['attributes']||null:null,'limit':_0x48fecc['options']?_0x48fecc['options'][_0xf0c4('0xb')]||null:null,'order':_0x48fecc[_0xf0c4('0x8')]?_0x48fecc['options'][_0xf0c4('0x26')]||null:null,'transaction':_0x4c8ad3,'lock':_0x4c8ad3['LOCK'][_0xf0c4('0x27')],'include':[{'model':db[_0xf0c4('0x23')],'as':_0xf0c4('0x28'),'attributes':_[_0xf0c4('0x29')](_0x3527e9)},{'model':db['User'],'as':_0xf0c4('0x2a'),'attributes':['id',_0xf0c4('0x2b'),_0xf0c4('0x2c')]}]})[_0xf0c4('0x10')](function(_0x2045e1){var _0x6f28c3=[];var _0x43148c=[];for(var _0x2a78bb=0x0;_0x2a78bb<_0x2045e1[_0xf0c4('0x2d')];_0x2a78bb+=0x1){var _0x2dc24f=_0x2045e1[_0x2a78bb][_0xf0c4('0x2e')];if(_0x2dc24f===null){_0x6f28c3[_0xf0c4('0x2f')](_0x2045e1[_0x2a78bb]['update'](_0x48fecc[_0xf0c4('0x19')],{'transaction':_0x4c8ad3}));}else if(!_0x43148c['includes'](_0x2dc24f)){_0x43148c[_0xf0c4('0x2f')](_0x2dc24f);_0x6f28c3[_0xf0c4('0x2f')](_0x2045e1[_0x2a78bb][_0xf0c4('0x1d')](_0x48fecc['body'],{'transaction':_0x4c8ad3}));}}return BPromise[_0xf0c4('0x30')](_0x6f28c3);});})['then'](function(_0x13d0a0){logger['info']('GetContactDialer',_0x48fecc);if(_0x13d0a0[_0xf0c4('0x2d')]>0x0){logger[_0xf0c4('0x11')](_0xf0c4('0x31'),_0x13d0a0[0x0]['dataValues']['id'],_0x13d0a0[0x0][_0xf0c4('0x32')][_0xf0c4('0x33')],_0x13d0a0[0x0][_0xf0c4('0x32')][_0xf0c4('0x1f')]);}logger[_0xf0c4('0x12')]('GetContactDialer',_0x48fecc,JSON[_0xf0c4('0x1b')](_0x13d0a0));_0x161904(_0x13d0a0);})[_0xf0c4('0x13')](function(_0x23b3b5){logger[_0xf0c4('0x14')](_0xf0c4('0x22'),_0x23b3b5[_0xf0c4('0x15')],_0x48fecc);_0x9371d4(_0x63fdc3[_0xf0c4('0x14')](0x1f4,_0x23b3b5[_0xf0c4('0x15')]));});});});};exports[_0xf0c4('0x34')]=function(_0x3e159a){var _0x24839a=this;return new Promise(function(_0x4ad0c5,_0x3d8a0d){return db[_0xf0c4('0x24')][_0xf0c4('0x25')](function(_0x90b7e4){return db['CmHopperFinal'][_0xf0c4('0x18')](_0x3e159a[_0xf0c4('0x19')],{'raw':_0x3e159a[_0xf0c4('0x8')]?_0x3e159a[_0xf0c4('0x8')][_0xf0c4('0x9')]===undefined?!![]:![]:!![],'transaction':_0x90b7e4})[_0xf0c4('0x10')](function(){logger['info'](_0xf0c4('0x35'),JSON[_0xf0c4('0x1b')](_0x3e159a[_0xf0c4('0x8')]['where']),_0x3e159a['options'][_0xf0c4('0xa')][_0xf0c4('0x1f')]);return db[_0xf0c4('0x6')][_0xf0c4('0x21')]({'where':_0x3e159a[_0xf0c4('0x8')]?_0x3e159a['options'][_0xf0c4('0xa')]||null:null,'transaction':_0x90b7e4});});})['then'](function(_0x29f6d4){logger[_0xf0c4('0x11')](_0xf0c4('0x34'),_0x3e159a);logger['debug'](_0xf0c4('0x34'),_0x3e159a,JSON[_0xf0c4('0x1b')](_0x29f6d4));_0x4ad0c5(_0x29f6d4);})['catch'](function(_0x373f08){logger[_0xf0c4('0x14')](_0xf0c4('0x34'),_0x373f08['message'],_0x3e159a);_0x3d8a0d(_0x24839a[_0xf0c4('0x14')](0x1f4,_0x373f08[_0xf0c4('0x15')]));});});};exports[_0xf0c4('0x36')]=function(_0x331fd2){var _0x20b456=this;return new Promise(function(_0x5d1cbe,_0x3320f4){return db['CmHopper'][_0xf0c4('0x7')]({'raw':_0x331fd2['options']?_0x331fd2[_0xf0c4('0x8')][_0xf0c4('0x9')]===undefined?!![]:![]:!![],'where':_0x331fd2[_0xf0c4('0x8')]?_0x331fd2['options'][_0xf0c4('0xa')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf0c4('0x37'),db[_0xf0c4('0x24')]['fn']('IF',db[_0xf0c4('0x24')][_0xf0c4('0x38')](_0xf0c4('0x39')+util[_0xf0c4('0x3a')](_0xf0c4('0x3b'),moment()[_0xf0c4('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xf0c4('0x3c')))),'contactsRescheduled']]})[_0xf0c4('0x10')](function(_0x33c7a5){logger[_0xf0c4('0x11')](_0xf0c4('0x36'),_0x331fd2);logger['debug'](_0xf0c4('0x36'),_0x331fd2,JSON[_0xf0c4('0x1b')](_0x33c7a5));_0x5d1cbe(_0x33c7a5);})['catch'](function(_0x482316){logger[_0xf0c4('0x14')](_0xf0c4('0x36'),_0x482316[_0xf0c4('0x15')],_0x331fd2);_0x3320f4(_0x20b456[_0xf0c4('0x14')](0x1f4,_0x482316[_0xf0c4('0x15')]));});});};exports[_0xf0c4('0x3d')]=function(_0x313924){var _0x20af80=this;return new Promise(function(_0x3d7c75,_0x4adfff){return db[_0xf0c4('0x23')][_0xf0c4('0x3e')]()[_0xf0c4('0x10')](function(){return db[_0xf0c4('0x24')][_0xf0c4('0x25')](function(_0x172c06){return db[_0xf0c4('0x6')][_0xf0c4('0x7')]({'where':_0x313924[_0xf0c4('0x8')]?_0x313924[_0xf0c4('0x8')]['where']||null:null,'attributes':_0x313924[_0xf0c4('0x8')]?_0x313924[_0xf0c4('0x8')][_0xf0c4('0xf')]||null:null,'limit':0x1,'order':_0x313924[_0xf0c4('0x8')]?_0x313924['options'][_0xf0c4('0x26')]||null:null,'group':db[_0xf0c4('0x6')]['UserId'],'transaction':_0x172c06,'lock':_0x172c06[_0xf0c4('0x3f')]['UPDATE'],'include':_0x313924['options']?_0x313924[_0xf0c4('0x8')][_0xf0c4('0xc')]?_['map'](_0x313924['options']['include'],function(_0x1c2a35){return{'model':db[_0x1c2a35[_0xf0c4('0xe')]],'as':_0x1c2a35['as'],'attributes':_0x1c2a35[_0xf0c4('0xf')],'include':_0x1c2a35[_0xf0c4('0xc')]?_['map'](_0x1c2a35['include'],function(_0x202622){return{'model':db[_0x202622[_0xf0c4('0xe')]],'as':_0x202622['as'],'attributes':_0x202622[_0xf0c4('0xf')],'include':_0x202622[_0xf0c4('0xc')]?_[_0xf0c4('0xd')](_0x202622['include'],function(_0x33cd1b){return{'model':db[_0x33cd1b[_0xf0c4('0xe')]],'as':_0x33cd1b['as'],'attributes':_0x33cd1b[_0xf0c4('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x409982){var _0x403dac=[];for(var _0x49685b=0x0;_0x49685b<_0x409982['length'];_0x49685b+=0x1){_0x403dac[_0xf0c4('0x2f')](_0x409982[_0x49685b][_0xf0c4('0x1d')](_0x313924[_0xf0c4('0x19')],{'transaction':_0x172c06}));}return BPromise[_0xf0c4('0x30')](_0x403dac);});})[_0xf0c4('0x10')](function(_0x16da00){logger[_0xf0c4('0x11')](_0xf0c4('0x3d'),_0x313924);logger[_0xf0c4('0x12')]('GetContactRecallMe',_0x313924,JSON['stringify'](_0x16da00));_0x3d7c75(_0x16da00);})[_0xf0c4('0x13')](function(_0x3e1d4d){logger['error'](_0xf0c4('0x3d'),_0x3e1d4d[_0xf0c4('0x15')],_0x313924);_0x4adfff(_0x20af80['error'](0x1f4,_0x3e1d4d[_0xf0c4('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x25ab1e){var _0x5a9f7d=this;return new Promise(function(_0x128690,_0x2856d2){db[_0xf0c4('0x23')][_0xf0c4('0x3e')]()[_0xf0c4('0x10')](function(_0x5de13a){return db[_0xf0c4('0x6')][_0xf0c4('0x7')]({'raw':_0x25ab1e[_0xf0c4('0x8')]?_0x25ab1e[_0xf0c4('0x8')][_0xf0c4('0x9')]===undefined?!![]:![]:!![],'where':_0x25ab1e[_0xf0c4('0x8')]?_0x25ab1e[_0xf0c4('0x8')][_0xf0c4('0xa')]||null:null,'attributes':_0x25ab1e['options']?_0x25ab1e[_0xf0c4('0x8')][_0xf0c4('0xf')]||null:null,'limit':_0x25ab1e[_0xf0c4('0x8')]?_0x25ab1e[_0xf0c4('0x8')][_0xf0c4('0xb')]||null:null,'include':_0x25ab1e[_0xf0c4('0x8')]?_0x25ab1e['options'][_0xf0c4('0xc')]?_[_0xf0c4('0xd')](_0x25ab1e[_0xf0c4('0x8')][_0xf0c4('0xc')],function(_0x5016ae){return{'model':db[_0x5016ae[_0xf0c4('0xe')]],'as':_0x5016ae['as'],'attributes':_0x5016ae['as']===_0xf0c4('0x28')?_[_0xf0c4('0x29')](_0x5de13a):_0x5016ae[_0xf0c4('0xf')],'include':_0x5016ae['include']?_['map'](_0x5016ae[_0xf0c4('0xc')],function(_0x2f2df3){return{'model':db[_0x2f2df3['model']],'as':_0x2f2df3['as'],'attributes':_0x2f2df3[_0xf0c4('0xf')],'include':_0x2f2df3[_0xf0c4('0xc')]?_['map'](_0x2f2df3[_0xf0c4('0xc')],function(_0x2f6698){return{'model':db[_0x2f6698[_0xf0c4('0xe')]],'as':_0x2f6698['as'],'attributes':_0x2f6698['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0c4('0x10')](function(_0x4d37fa){logger[_0xf0c4('0x11')](_0xf0c4('0x5'),_0x25ab1e);logger['debug'](_0xf0c4('0x5'),_0x25ab1e,JSON[_0xf0c4('0x1b')](_0x4d37fa));_0x128690(_0x4d37fa);})[_0xf0c4('0x13')](function(_0x356a95){logger[_0xf0c4('0x14')](_0xf0c4('0x5'),_0x356a95[_0xf0c4('0x15')],_0x25ab1e);_0x2856d2(_0x5a9f7d[_0xf0c4('0x14')](0x1f4,_0x356a95[_0xf0c4('0x15')]));});});});};exports['GetContactByPhone']=function(_0x5da410){var _0x2e064f=this;return new Promise(function(_0x4df1e2,_0x406262){return db['CmContact'][_0xf0c4('0x40')]({'raw':!![],'where':{'phone':_0x5da410['options'][_0xf0c4('0xa')][_0xf0c4('0x41')]},'attributes':['id',_0xf0c4('0x42')],'order':[['id','DESC']]})[_0xf0c4('0x10')](function(_0x8efcbc){logger[_0xf0c4('0x11')](_0xf0c4('0x43'),_0x5da410);logger[_0xf0c4('0x12')](_0xf0c4('0x43'),_0x5da410,JSON[_0xf0c4('0x1b')](_0x8efcbc));_0x4df1e2(_0x8efcbc);})['catch'](function(_0x746efe){logger[_0xf0c4('0x14')]('getContactByPhone',_0x746efe[_0xf0c4('0x15')],_0x5da410);_0x406262(_0x2e064f[_0xf0c4('0x14')](0x1f4,_0x746efe[_0xf0c4('0x15')]));});});};exports['ResetActiveCalls']=function(_0x31efb9){var _0x430e3d=this;return new Promise(function(_0x1f5b38,_0x474ab2){return db['sequelize'][_0xf0c4('0x25')](function(_0x1ff1d9){var _0x11a20c=_0x31efb9[_0xf0c4('0x8')]&&_0x31efb9[_0xf0c4('0x8')][_0xf0c4('0xa')]?_0x31efb9['options']['where']:{};return db[_0xf0c4('0x6')][_0xf0c4('0x1d')](_0x31efb9[_0xf0c4('0x19')],{'where':_0x11a20c,'transaction':_0x1ff1d9})[_0xf0c4('0x10')](function(_0x599e02){logger['info'](_0xf0c4('0x44'),_0x31efb9);logger[_0xf0c4('0x12')](_0xf0c4('0x44'),_0x31efb9,JSON[_0xf0c4('0x1b')](_0x599e02));_0x1f5b38(_0x599e02);})[_0xf0c4('0x13')](function(_0x1e8530){logger[_0xf0c4('0x14')](_0xf0c4('0x44'),_0x1e8530[_0xf0c4('0x15')],_0x31efb9);_0x474ab2(_0x430e3d[_0xf0c4('0x14')](0x1f4,_0x1e8530[_0xf0c4('0x15')]));});});});};exports[_0xf0c4('0x45')]=function(_0x1a89e9){var _0x423504=this;var _0x37e13c=_0x1a89e9[_0xf0c4('0x19')][_0xf0c4('0xa')][_0xf0c4('0x46')];var _0x18557a=_0x1a89e9[_0xf0c4('0x19')][_0xf0c4('0xa')][_0xf0c4('0x47')];var _0x2a3be7=_0x1a89e9[_0xf0c4('0x19')][_0xf0c4('0xa')]['availableAgentsIds'];return new Promise(function(_0x163e75,_0x326b61){return db[_0xf0c4('0x6')][_0xf0c4('0x7')]({'where':{'voiceQueueId':{'$in':_0x37e13c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf0c4('0x24')]['literal'](_0xf0c4('0x48')+_0x18557a+'\x20MINUTE'),'$gt':db[_0xf0c4('0x24')][_0xf0c4('0x38')]('NOW()')}},'UserId':{'$in':_0x2a3be7}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db[_0xf0c4('0x49')],'as':_0xf0c4('0x2a'),'attributes':['id',_0xf0c4('0x2b'),'voicePause']},{'model':db[_0xf0c4('0x4a')],'as':_0xf0c4('0x4b')}]})[_0xf0c4('0x10')](function(_0x544063){if(_0x544063['length']>0x0){return db[_0xf0c4('0x24')][_0xf0c4('0x25')](function(_0x197010){return db['CmHopper'][_0xf0c4('0x1d')]({'recallmeNotifiedDate':db['sequelize'][_0xf0c4('0x38')](_0xf0c4('0x4c'))},{'where':{'id':{'$in':_[_0xf0c4('0xd')](_0x544063,'id')}},'transaction':_0x197010})[_0xf0c4('0x10')](function(){_0x163e75(_0x544063);})[_0xf0c4('0x13')](function(_0x1b21a5){logger[_0xf0c4('0x14')](_0xf0c4('0x45'),_0x1b21a5[_0xf0c4('0x15')],_0x1a89e9);_0x326b61(_0x423504[_0xf0c4('0x14')](0x1f4,_0x1b21a5[_0xf0c4('0x15')]));});})[_0xf0c4('0x13')](function(_0x273895){logger['error'](_0xf0c4('0x45'),_0x273895[_0xf0c4('0x15')],_0x1a89e9);_0x326b61(_0x423504['error'](0x1f4,_0x273895[_0xf0c4('0x15')]));});}else{_0x163e75(_0x544063);}});});}; \ No newline at end of file +var _0xf318=['Agent','name','voicePause','length','update','includes','push','all','dataValues','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','sequelize','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','UserId','GetCmHopperPreview','GetContactByPhone','phone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','literal','\x20MINUTE','NOW()','CmList','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','where','attributes','include','map','model','then','info','debug','stringify','catch','message','error','ShowCmHopper','CmHopper','find','raw','create','body','CreateCmHopper','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','keys','User'];(function(_0x39050f,_0x2c6fd5){var _0x11ad67=function(_0x540779){while(--_0x540779){_0x39050f['push'](_0x39050f['shift']());}};_0x11ad67(++_0x2c6fd5);}(_0xf318,0x155));var _0x8f31=function(_0xcdbcda,_0x3ec427){_0xcdbcda=_0xcdbcda-0x0;var _0x4474ad=_0xf318[_0xcdbcda];return _0x4474ad;};'use strict';var _=require(_0x8f31('0x0'));var util=require(_0x8f31('0x1'));var moment=require(_0x8f31('0x2'));var BPromise=require(_0x8f31('0x3'));var db=require(_0x8f31('0x4'))['db'];var logger=require(_0x8f31('0x5'))(_0x8f31('0x6'));exports[_0x8f31('0x7')]=function(_0x187fff){var _0x28422b=this;return new Promise(function(_0x2a6fd6,_0x3b5bd7){return db['CmHopper'][_0x8f31('0x8')]({'raw':_0x187fff['options']?_0x187fff['options']['raw']===undefined?!![]:![]:!![],'where':_0x187fff[_0x8f31('0x9')]?_0x187fff[_0x8f31('0x9')][_0x8f31('0xa')]||null:null,'attributes':_0x187fff[_0x8f31('0x9')]?_0x187fff['options'][_0x8f31('0xb')]||null:null,'limit':_0x187fff[_0x8f31('0x9')]?_0x187fff[_0x8f31('0x9')]['limit']||null:null,'include':_0x187fff[_0x8f31('0x9')]?_0x187fff[_0x8f31('0x9')][_0x8f31('0xc')]?_['map'](_0x187fff[_0x8f31('0x9')][_0x8f31('0xc')],function(_0x46987d){return{'model':db[_0x46987d['model']],'as':_0x46987d['as'],'attributes':_0x46987d[_0x8f31('0xb')],'include':_0x46987d[_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x46987d[_0x8f31('0xc')],function(_0x534026){return{'model':db[_0x534026['model']],'as':_0x534026['as'],'attributes':_0x534026['attributes'],'include':_0x534026[_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x534026['include'],function(_0x55b8c3){return{'model':db[_0x55b8c3[_0x8f31('0xe')]],'as':_0x55b8c3['as'],'attributes':_0x55b8c3[_0x8f31('0xb')]};}):[]};}):[]};}):[]:[]})[_0x8f31('0xf')](function(_0x3a9a9c){logger[_0x8f31('0x10')](_0x8f31('0x7'),_0x187fff);logger[_0x8f31('0x11')](_0x8f31('0x7'),_0x187fff,JSON[_0x8f31('0x12')](_0x3a9a9c));_0x2a6fd6(_0x3a9a9c);})[_0x8f31('0x13')](function(_0x35a853){logger['error'](_0x8f31('0x7'),_0x35a853[_0x8f31('0x14')],_0x187fff);_0x3b5bd7(_0x28422b[_0x8f31('0x15')](0x1f4,_0x35a853['message']));});});};exports[_0x8f31('0x16')]=function(_0x57e528){var _0x3d2eea=this;return new Promise(function(_0x2a3e1b,_0x34b17d){return db[_0x8f31('0x17')][_0x8f31('0x18')]({'raw':_0x57e528['options']?_0x57e528[_0x8f31('0x9')][_0x8f31('0x19')]===undefined?!![]:![]:!![],'where':_0x57e528[_0x8f31('0x9')]?_0x57e528['options'][_0x8f31('0xa')]||null:null,'attributes':_0x57e528[_0x8f31('0x9')]?_0x57e528[_0x8f31('0x9')][_0x8f31('0xb')]||null:null,'include':_0x57e528[_0x8f31('0x9')]?_0x57e528['options']['include']?_[_0x8f31('0xd')](_0x57e528[_0x8f31('0x9')][_0x8f31('0xc')],function(_0x5cddbb){return{'model':db[_0x5cddbb['model']],'as':_0x5cddbb['as'],'attributes':_0x5cddbb[_0x8f31('0xb')],'include':_0x5cddbb[_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x5cddbb['include'],function(_0x2e39da){return{'model':db[_0x2e39da[_0x8f31('0xe')]],'as':_0x2e39da['as'],'attributes':_0x2e39da[_0x8f31('0xb')],'include':_0x2e39da[_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x2e39da[_0x8f31('0xc')],function(_0x1941d6){return{'model':db[_0x1941d6[_0x8f31('0xe')]],'as':_0x1941d6['as'],'attributes':_0x1941d6[_0x8f31('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x364d4c){logger[_0x8f31('0x10')]('ShowCmHopper',_0x57e528);logger[_0x8f31('0x11')](_0x8f31('0x16'),_0x57e528,JSON[_0x8f31('0x12')](_0x364d4c));_0x2a3e1b(_0x364d4c);})[_0x8f31('0x13')](function(_0x44c87f){logger['error'](_0x8f31('0x16'),_0x44c87f[_0x8f31('0x14')],_0x57e528);_0x34b17d(_0x3d2eea[_0x8f31('0x15')](0x1f4,_0x44c87f[_0x8f31('0x14')]));});});};exports['CreateCmHopper']=function(_0xf1a47c){var _0x451844=this;return new Promise(function(_0x4f4132,_0x4ae7c7){return db[_0x8f31('0x17')][_0x8f31('0x1a')](_0xf1a47c[_0x8f31('0x1b')],{'raw':_0xf1a47c['options']?_0xf1a47c[_0x8f31('0x9')]['raw']===undefined?!![]:![]:!![]})[_0x8f31('0xf')](function(_0x1e4a97){logger[_0x8f31('0x10')]('CreateCmHopper',_0xf1a47c);logger['debug'](_0x8f31('0x1c'),_0xf1a47c,JSON[_0x8f31('0x12')](_0x1e4a97));_0x4f4132(_0x1e4a97);})[_0x8f31('0x13')](function(_0xea36d9){logger['error']('CreateCmHopper',_0xea36d9[_0x8f31('0x14')],_0xf1a47c);_0x4ae7c7(_0x451844[_0x8f31('0x15')](0x1f4,_0xea36d9[_0x8f31('0x14')]));});});};exports[_0x8f31('0x1d')]=function(_0x3d58d7){var _0x939f42=this;return new Promise(function(_0x168fec,_0x2afc66){return db[_0x8f31('0x17')]['update'](_0x3d58d7['body'],{'raw':_0x3d58d7['options']?_0x3d58d7[_0x8f31('0x9')][_0x8f31('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d58d7['options']?_0x3d58d7[_0x8f31('0x9')][_0x8f31('0xa')]||null:null,'attributes':_0x3d58d7[_0x8f31('0x9')]?_0x3d58d7[_0x8f31('0x9')][_0x8f31('0xb')]||null:null,'limit':_0x3d58d7[_0x8f31('0x9')]?_0x3d58d7[_0x8f31('0x9')][_0x8f31('0x1e')]||null:null})['then'](function(_0xff24d){logger['info'](_0x8f31('0x1d'),_0x3d58d7);logger['info'](_0x8f31('0x1f'),JSON[_0x8f31('0x12')](_0x3d58d7[_0x8f31('0x9')]['where']),_0x3d58d7[_0x8f31('0x1b')][_0x8f31('0x20')]);logger[_0x8f31('0x11')](_0x8f31('0x1d'),_0x3d58d7,JSON['stringify'](_0xff24d));_0x168fec(_0xff24d);})[_0x8f31('0x13')](function(_0xdc30a2){logger[_0x8f31('0x15')](_0x8f31('0x1d'),_0xdc30a2[_0x8f31('0x14')],_0x3d58d7);_0x2afc66(_0x939f42[_0x8f31('0x15')](0x1f4,_0xdc30a2[_0x8f31('0x14')]));});});};exports['DestroyCmHopper']=function(_0x48aada){var _0x59ce0=this;return new Promise(function(_0x212d70,_0xab3d13){return db[_0x8f31('0x17')][_0x8f31('0x21')]({'where':_0x48aada[_0x8f31('0x9')]?_0x48aada[_0x8f31('0x9')][_0x8f31('0xa')]||null:null})[_0x8f31('0xf')](function(_0x4bb0b3){logger['info'](_0x8f31('0x22'),_0x48aada);logger[_0x8f31('0x11')](_0x8f31('0x22'),_0x48aada,JSON['stringify'](_0x4bb0b3));_0x212d70(_0x4bb0b3);})['catch'](function(_0x2e2e66){logger[_0x8f31('0x15')]('DestroyCmHopper',_0x2e2e66[_0x8f31('0x14')],_0x48aada);_0xab3d13(_0x59ce0['error'](0x1f4,_0x2e2e66[_0x8f31('0x14')]));});});};exports['GetContactDialer']=function(_0x3e7e89){var _0x730752=this;return new Promise(function(_0xa333ad,_0x534fe5){return db[_0x8f31('0x23')][_0x8f31('0x24')]()[_0x8f31('0xf')](function(_0x17b2ce){return db['sequelize'][_0x8f31('0x25')](function(_0x250bed){return db['CmHopper']['findAll']({'where':_0x3e7e89[_0x8f31('0x9')]?_0x3e7e89['options'][_0x8f31('0xa')]||null:null,'attributes':_0x3e7e89[_0x8f31('0x9')]?_0x3e7e89[_0x8f31('0x9')][_0x8f31('0xb')]||null:null,'limit':_0x3e7e89['options']?_0x3e7e89['options'][_0x8f31('0x1e')]||null:null,'order':_0x3e7e89[_0x8f31('0x9')]?_0x3e7e89[_0x8f31('0x9')][_0x8f31('0x26')]||null:null,'transaction':_0x250bed,'lock':_0x250bed[_0x8f31('0x27')][_0x8f31('0x28')],'include':[{'model':db[_0x8f31('0x23')],'as':_0x8f31('0x29'),'attributes':_[_0x8f31('0x2a')](_0x17b2ce)},{'model':db[_0x8f31('0x2b')],'as':_0x8f31('0x2c'),'attributes':['id',_0x8f31('0x2d'),_0x8f31('0x2e')]}]})[_0x8f31('0xf')](function(_0x184d9b){var _0x2eed3c=[];var _0x339f72=[];for(var _0x3444b8=0x0;_0x3444b8<_0x184d9b[_0x8f31('0x2f')];_0x3444b8+=0x1){var _0x4728ed=_0x184d9b[_0x3444b8]['UserId'];if(_0x4728ed===null){_0x2eed3c['push'](_0x184d9b[_0x3444b8][_0x8f31('0x30')](_0x3e7e89['body'],{'transaction':_0x250bed}));}else if(!_0x339f72[_0x8f31('0x31')](_0x4728ed)){_0x339f72[_0x8f31('0x32')](_0x4728ed);_0x2eed3c[_0x8f31('0x32')](_0x184d9b[_0x3444b8][_0x8f31('0x30')](_0x3e7e89['body'],{'transaction':_0x250bed}));}}return BPromise[_0x8f31('0x33')](_0x2eed3c);});})[_0x8f31('0xf')](function(_0x5def7b){logger[_0x8f31('0x10')]('GetContactDialer',_0x3e7e89);if(_0x5def7b['length']>0x0){logger[_0x8f31('0x10')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x5def7b[0x0][_0x8f31('0x34')]['id'],_0x5def7b[0x0]['dataValues']['ContactId'],_0x5def7b[0x0]['dataValues'][_0x8f31('0x20')]);}logger[_0x8f31('0x11')](_0x8f31('0x35'),_0x3e7e89,JSON[_0x8f31('0x12')](_0x5def7b));_0xa333ad(_0x5def7b);})[_0x8f31('0x13')](function(_0x509039){logger[_0x8f31('0x15')](_0x8f31('0x35'),_0x509039['message'],_0x3e7e89);_0x534fe5(_0x730752[_0x8f31('0x15')](0x1f4,_0x509039[_0x8f31('0x14')]));});});});};exports[_0x8f31('0x36')]=function(_0x3b3682){var _0x4a3584=this;return new Promise(function(_0x23da25,_0x42d61e){return db['sequelize']['transaction'](function(_0x1bf26f){return db[_0x8f31('0x37')]['create'](_0x3b3682['body'],{'raw':_0x3b3682[_0x8f31('0x9')]?_0x3b3682[_0x8f31('0x9')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1bf26f})[_0x8f31('0xf')](function(){logger[_0x8f31('0x10')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x8f31('0x12')](_0x3b3682[_0x8f31('0x9')][_0x8f31('0xa')]),_0x3b3682['options']['where']['active']);return db[_0x8f31('0x17')][_0x8f31('0x21')]({'where':_0x3b3682[_0x8f31('0x9')]?_0x3b3682[_0x8f31('0x9')][_0x8f31('0xa')]||null:null,'transaction':_0x1bf26f});});})['then'](function(_0x5a353b){logger[_0x8f31('0x10')](_0x8f31('0x36'),_0x3b3682);logger[_0x8f31('0x11')](_0x8f31('0x36'),_0x3b3682,JSON[_0x8f31('0x12')](_0x5a353b));_0x23da25(_0x5a353b);})[_0x8f31('0x13')](function(_0x3660e4){logger[_0x8f31('0x15')](_0x8f31('0x36'),_0x3660e4[_0x8f31('0x14')],_0x3b3682);_0x42d61e(_0x4a3584['error'](0x1f4,_0x3660e4[_0x8f31('0x14')]));});});};exports[_0x8f31('0x38')]=function(_0x4163d0){var _0x4cd268=this;return new Promise(function(_0x2bc5e8,_0x23a785){return db[_0x8f31('0x17')][_0x8f31('0x8')]({'raw':_0x4163d0[_0x8f31('0x9')]?_0x4163d0[_0x8f31('0x9')][_0x8f31('0x19')]===undefined?!![]:![]:!![],'where':_0x4163d0[_0x8f31('0x9')]?_0x4163d0[_0x8f31('0x9')][_0x8f31('0xa')]||null:null,'attributes':[[db[_0x8f31('0x39')]['fn']('COUNT',db[_0x8f31('0x39')]['fn']('IF',db[_0x8f31('0x39')]['literal'](_0x8f31('0x3a')+util['format']('\x22%s\x22',moment()[_0x8f31('0x3b')](_0x8f31('0x3c')))+'\x20,\x201,\x20null'))),_0x8f31('0x3d')]]})[_0x8f31('0xf')](function(_0x5260cf){logger[_0x8f31('0x10')](_0x8f31('0x38'),_0x4163d0);logger[_0x8f31('0x11')](_0x8f31('0x38'),_0x4163d0,JSON[_0x8f31('0x12')](_0x5260cf));_0x2bc5e8(_0x5260cf);})[_0x8f31('0x13')](function(_0x120a8a){logger[_0x8f31('0x15')]('CountReScheduled',_0x120a8a[_0x8f31('0x14')],_0x4163d0);_0x23a785(_0x4cd268[_0x8f31('0x15')](0x1f4,_0x120a8a['message']));});});};exports[_0x8f31('0x3e')]=function(_0x14f69d){var _0x47378e=this;return new Promise(function(_0x2e3f74,_0x537c42){return db[_0x8f31('0x23')][_0x8f31('0x24')]()['then'](function(){return db['sequelize']['transaction'](function(_0x5ac835){return db[_0x8f31('0x17')][_0x8f31('0x8')]({'where':_0x14f69d[_0x8f31('0x9')]?_0x14f69d[_0x8f31('0x9')][_0x8f31('0xa')]||null:null,'attributes':_0x14f69d[_0x8f31('0x9')]?_0x14f69d[_0x8f31('0x9')]['attributes']||null:null,'limit':0x1,'order':_0x14f69d[_0x8f31('0x9')]?_0x14f69d['options'][_0x8f31('0x26')]||null:null,'group':db[_0x8f31('0x17')][_0x8f31('0x3f')],'transaction':_0x5ac835,'lock':_0x5ac835[_0x8f31('0x27')][_0x8f31('0x28')],'include':_0x14f69d[_0x8f31('0x9')]?_0x14f69d['options'][_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x14f69d[_0x8f31('0x9')][_0x8f31('0xc')],function(_0x5e2584){return{'model':db[_0x5e2584[_0x8f31('0xe')]],'as':_0x5e2584['as'],'attributes':_0x5e2584['attributes'],'include':_0x5e2584[_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x5e2584[_0x8f31('0xc')],function(_0x38c6ea){return{'model':db[_0x38c6ea['model']],'as':_0x38c6ea['as'],'attributes':_0x38c6ea[_0x8f31('0xb')],'include':_0x38c6ea[_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x38c6ea[_0x8f31('0xc')],function(_0x46d146){return{'model':db[_0x46d146[_0x8f31('0xe')]],'as':_0x46d146['as'],'attributes':_0x46d146[_0x8f31('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x100794){var _0x17f653=[];for(var _0x23f05a=0x0;_0x23f05a<_0x100794[_0x8f31('0x2f')];_0x23f05a+=0x1){_0x17f653['push'](_0x100794[_0x23f05a][_0x8f31('0x30')](_0x14f69d[_0x8f31('0x1b')],{'transaction':_0x5ac835}));}return BPromise[_0x8f31('0x33')](_0x17f653);});})[_0x8f31('0xf')](function(_0x1dc640){logger[_0x8f31('0x10')](_0x8f31('0x3e'),_0x14f69d);logger[_0x8f31('0x11')](_0x8f31('0x3e'),_0x14f69d,JSON[_0x8f31('0x12')](_0x1dc640));_0x2e3f74(_0x1dc640);})['catch'](function(_0x1264db){logger['error']('GetContactRecallMe',_0x1264db['message'],_0x14f69d);_0x537c42(_0x47378e['error'](0x1f4,_0x1264db[_0x8f31('0x14')]));});});});};exports[_0x8f31('0x40')]=function(_0x240116){var _0x50e109=this;return new Promise(function(_0x392551,_0x3ae768){db[_0x8f31('0x23')][_0x8f31('0x24')]()[_0x8f31('0xf')](function(_0x27fd75){return db[_0x8f31('0x17')][_0x8f31('0x8')]({'raw':_0x240116[_0x8f31('0x9')]?_0x240116[_0x8f31('0x9')][_0x8f31('0x19')]===undefined?!![]:![]:!![],'where':_0x240116['options']?_0x240116['options'][_0x8f31('0xa')]||null:null,'attributes':_0x240116[_0x8f31('0x9')]?_0x240116[_0x8f31('0x9')]['attributes']||null:null,'limit':_0x240116[_0x8f31('0x9')]?_0x240116[_0x8f31('0x9')]['limit']||null:null,'include':_0x240116['options']?_0x240116[_0x8f31('0x9')][_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x240116[_0x8f31('0x9')][_0x8f31('0xc')],function(_0x36d620){return{'model':db[_0x36d620[_0x8f31('0xe')]],'as':_0x36d620['as'],'attributes':_0x36d620['as']===_0x8f31('0x29')?_[_0x8f31('0x2a')](_0x27fd75):_0x36d620['attributes'],'include':_0x36d620[_0x8f31('0xc')]?_[_0x8f31('0xd')](_0x36d620[_0x8f31('0xc')],function(_0x4cfd9b){return{'model':db[_0x4cfd9b[_0x8f31('0xe')]],'as':_0x4cfd9b['as'],'attributes':_0x4cfd9b['attributes'],'include':_0x4cfd9b[_0x8f31('0xc')]?_['map'](_0x4cfd9b[_0x8f31('0xc')],function(_0x21bf53){return{'model':db[_0x21bf53[_0x8f31('0xe')]],'as':_0x21bf53['as'],'attributes':_0x21bf53[_0x8f31('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3477eb){logger[_0x8f31('0x10')](_0x8f31('0x7'),_0x240116);logger['debug'](_0x8f31('0x7'),_0x240116,JSON['stringify'](_0x3477eb));_0x392551(_0x3477eb);})['catch'](function(_0x89fcba){logger[_0x8f31('0x15')](_0x8f31('0x7'),_0x89fcba[_0x8f31('0x14')],_0x240116);_0x3ae768(_0x50e109[_0x8f31('0x15')](0x1f4,_0x89fcba[_0x8f31('0x14')]));});});});};exports[_0x8f31('0x41')]=function(_0x24ecc4){var _0x49a418=this;return new Promise(function(_0x5a57c2,_0xba7df5){return db[_0x8f31('0x23')]['findOne']({'raw':!![],'where':{'phone':_0x24ecc4[_0x8f31('0x9')][_0x8f31('0xa')][_0x8f31('0x42')]},'attributes':['id','dialTimezone'],'order':[['id',_0x8f31('0x43')]]})[_0x8f31('0xf')](function(_0x3a278c){logger[_0x8f31('0x10')](_0x8f31('0x44'),_0x24ecc4);logger[_0x8f31('0x11')](_0x8f31('0x44'),_0x24ecc4,JSON[_0x8f31('0x12')](_0x3a278c));_0x5a57c2(_0x3a278c);})['catch'](function(_0x37b312){logger[_0x8f31('0x15')](_0x8f31('0x44'),_0x37b312[_0x8f31('0x14')],_0x24ecc4);_0xba7df5(_0x49a418['error'](0x1f4,_0x37b312[_0x8f31('0x14')]));});});};exports[_0x8f31('0x45')]=function(_0x15af13){var _0x4490cb=this;return new Promise(function(_0x59e086,_0xc70fab){return db[_0x8f31('0x39')][_0x8f31('0x25')](function(_0x1a2c09){var _0x51ef41=_0x15af13[_0x8f31('0x9')]&&_0x15af13[_0x8f31('0x9')][_0x8f31('0xa')]?_0x15af13['options'][_0x8f31('0xa')]:{};return db[_0x8f31('0x17')]['update'](_0x15af13[_0x8f31('0x1b')],{'where':_0x51ef41,'transaction':_0x1a2c09})[_0x8f31('0xf')](function(_0x58d0b8){logger[_0x8f31('0x10')](_0x8f31('0x45'),_0x15af13);logger[_0x8f31('0x11')](_0x8f31('0x45'),_0x15af13,JSON[_0x8f31('0x12')](_0x58d0b8));_0x59e086(_0x58d0b8);})[_0x8f31('0x13')](function(_0x175206){logger['error'](_0x8f31('0x45'),_0x175206[_0x8f31('0x14')],_0x15af13);_0xc70fab(_0x4490cb['error'](0x1f4,_0x175206[_0x8f31('0x14')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x20bb5e){var _0x2cd980=this;var _0x290d92=_0x20bb5e[_0x8f31('0x1b')]['where'][_0x8f31('0x46')];var _0x158c62=_0x20bb5e['body']['where'][_0x8f31('0x47')];var _0xb281eb=_0x20bb5e[_0x8f31('0x1b')]['where']['availableAgentsIds'];return new Promise(function(_0x4e7649,_0x2c5d5a){return db['CmHopper'][_0x8f31('0x8')]({'where':{'voiceQueueId':{'$in':_0x290d92},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x8f31('0x48')]('NOW()\x20+\x20INTERVAL\x20'+_0x158c62+_0x8f31('0x49')),'$gt':db[_0x8f31('0x39')]['literal'](_0x8f31('0x4a'))}},'UserId':{'$in':_0xb281eb}},'include':[{'model':db[_0x8f31('0x23')],'as':_0x8f31('0x29')},{'model':db[_0x8f31('0x2b')],'as':_0x8f31('0x2c'),'attributes':['id',_0x8f31('0x2d'),_0x8f31('0x2e')]},{'model':db[_0x8f31('0x4b')],'as':'List'}]})[_0x8f31('0xf')](function(_0xbfa67c){if(_0xbfa67c[_0x8f31('0x2f')]>0x0){return db[_0x8f31('0x39')][_0x8f31('0x25')](function(_0x240fb0){return db[_0x8f31('0x17')][_0x8f31('0x30')]({'recallmeNotifiedDate':db['sequelize'][_0x8f31('0x48')](_0x8f31('0x4a'))},{'where':{'id':{'$in':_[_0x8f31('0xd')](_0xbfa67c,'id')}},'transaction':_0x240fb0})[_0x8f31('0xf')](function(){_0x4e7649(_0xbfa67c);})[_0x8f31('0x13')](function(_0x63e918){logger[_0x8f31('0x15')](_0x8f31('0x4c'),_0x63e918[_0x8f31('0x14')],_0x20bb5e);_0x2c5d5a(_0x2cd980[_0x8f31('0x15')](0x1f4,_0x63e918['message']));});})[_0x8f31('0x13')](function(_0x5cfef4){logger[_0x8f31('0x15')]('CmHopperHandlePreviewRecallNotifications',_0x5cfef4[_0x8f31('0x14')],_0x20bb5e);_0x2c5d5a(_0x2cd980[_0x8f31('0x15')](0x1f4,_0x5cfef4['message']));});}else{_0x4e7649(_0xbfa67c);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index d0f8021..87e6e8d 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 _0x0eb6=['Router','get','isAuthenticated','/describe','describe','/opencontacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','/:id','delete','exports','express'];(function(_0x441b74,_0x4984a9){var _0x1b3ea0=function(_0x2a78d6){while(--_0x2a78d6){_0x441b74['push'](_0x441b74['shift']());}};_0x1b3ea0(++_0x4984a9);}(_0x0eb6,0x110));var _0x60eb=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0x0eb6[_0x214a25];return _0x405988;};'use strict';var express=require(_0x60eb('0x0'));var router=express[_0x60eb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0x60eb('0x2')]('/',auth[_0x60eb('0x3')](),controller['index']);router[_0x60eb('0x2')](_0x60eb('0x4'),auth[_0x60eb('0x3')](),controller[_0x60eb('0x5')]);router['get'](_0x60eb('0x6'),auth[_0x60eb('0x3')](),controller['getOpenContacts']);router[_0x60eb('0x2')](_0x60eb('0x7'),auth[_0x60eb('0x3')](),controller[_0x60eb('0x8')]);router[_0x60eb('0x2')]('/:id',auth[_0x60eb('0x3')](),controller[_0x60eb('0x9')]);router['get'](_0x60eb('0xa'),auth[_0x60eb('0x3')](),controller[_0x60eb('0xb')]);router[_0x60eb('0xc')]('/',auth['isAuthenticated'](),controller[_0x60eb('0xd')]);router[_0x60eb('0xc')](_0x60eb('0xe'),auth[_0x60eb('0x3')](),controller[_0x60eb('0xf')]);router[_0x60eb('0xc')]('/timezone',auth[_0x60eb('0x3')](),controller[_0x60eb('0x10')]);router[_0x60eb('0x11')](_0x60eb('0x12'),auth[_0x60eb('0x3')](),controller['update']);router[_0x60eb('0x13')](_0x60eb('0x12'),auth[_0x60eb('0x3')](),controller['destroy']);module[_0x60eb('0x14')]=router; \ No newline at end of file +var _0xbf26=['get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','getPreview','/timezone','update','delete','destroy','Router','../../components/auth/service','./cmHopper.controller'];(function(_0xc15e30,_0x231639){var _0x5a2d88=function(_0x36893e){while(--_0x36893e){_0xc15e30['push'](_0xc15e30['shift']());}};_0x5a2d88(++_0x231639);}(_0xbf26,0xcf));var _0x6bf2=function(_0x405359,_0x1e86ea){_0x405359=_0x405359-0x0;var _0x2bded1=_0xbf26[_0x405359];return _0x2bded1;};'use strict';var express=require('express');var router=express[_0x6bf2('0x0')]();var auth=require(_0x6bf2('0x1'));var controller=require(_0x6bf2('0x2'));router[_0x6bf2('0x3')]('/',auth[_0x6bf2('0x4')](),controller['index']);router['get'](_0x6bf2('0x5'),auth[_0x6bf2('0x4')](),controller[_0x6bf2('0x6')]);router['get'](_0x6bf2('0x7'),auth[_0x6bf2('0x4')](),controller[_0x6bf2('0x8')]);router[_0x6bf2('0x3')]('/timezones',auth['isAuthenticated'](),controller[_0x6bf2('0x9')]);router['get'](_0x6bf2('0xa'),auth['isAuthenticated'](),controller[_0x6bf2('0xb')]);router['get'](_0x6bf2('0xc'),auth[_0x6bf2('0x4')](),controller[_0x6bf2('0xd')]);router[_0x6bf2('0xe')]('/',auth[_0x6bf2('0x4')](),controller[_0x6bf2('0xf')]);router[_0x6bf2('0xe')]('/preview',auth[_0x6bf2('0x4')](),controller[_0x6bf2('0x10')]);router['post'](_0x6bf2('0x11'),auth[_0x6bf2('0x4')](),controller['getTimezone']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6bf2('0x12')]);router[_0x6bf2('0x13')](_0x6bf2('0xa'),auth[_0x6bf2('0x4')](),controller[_0x6bf2('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 7e2fd08..1b1508c 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 _0xce05=['INTEGER','STRING','DATE','format','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xce05,0x12b));var _0x5ce0=function(_0x257080,_0x1bb2ac){_0x257080=_0x257080-0x0;var _0x279d24=_0xce05[_0x257080];return _0x279d24;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5ce0('0x0')]={'CmHopperId':{'type':Sequelize[_0x5ce0('0x1')]},'phone':{'type':Sequelize[_0x5ce0('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x5ce0('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x5ce0('0x3')],'defaultValue':moment()[_0x5ce0('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x5ce0('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5ce0('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x5ce0('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5ce0('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5ce0('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5ce0('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5ce0('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc2f2=['exports','INTEGER','STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc2f2,0xb9));var _0x2c2f=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xc2f2[_0x13ea00];return _0x1f7347;};'use strict';var moment=require(_0x2c2f('0x0'));var Sequelize=require('sequelize');module[_0x2c2f('0x1')]={'CmHopperId':{'type':Sequelize[_0x2c2f('0x2')]},'phone':{'type':Sequelize[_0x2c2f('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x2c2f('0x4')](_0x2c2f('0x5'))},'countbusyretry':{'type':Sequelize[_0x2c2f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2c2f('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x2c2f('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2c2f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2c2f('0x2')],'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 b4bdad3..5bb8b4d 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 _0xe8d7=['crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','name','index','map','CmHopperAdditionalPhone','fieldName','key','model','keys','query','filters','intersection','attributes','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','rows','catch','show','params','rawAttributes','fields','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','squel'];(function(_0x3105fc,_0x2ed1fc){var _0xaabd9e=function(_0x43ee41){while(--_0x43ee41){_0x3105fc['push'](_0x3105fc['shift']());}};_0xaabd9e(++_0x2ed1fc);}(_0xe8d7,0x1b9));var _0x7e8d=function(_0x3b0106,_0x52ae95){_0x3b0106=_0x3b0106-0x0;var _0xb11bb9=_0xe8d7[_0x3b0106];return _0xb11bb9;};'use strict';var emlformat=require(_0x7e8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e8d('0x1'));var jsonpatch=require(_0x7e8d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7e8d('0x3'));var path=require(_0x7e8d('0x4'));var sox=require(_0x7e8d('0x5'));var csv=require(_0x7e8d('0x6'));var ejs=require(_0x7e8d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7e8d('0x8'));var crypto=require(_0x7e8d('0x9'));var jsforce=require(_0x7e8d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7e8d('0x6'));var querystring=require(_0x7e8d('0xb'));var Papa=require(_0x7e8d('0xc'));var Redis=require(_0x7e8d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7e8d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e8d('0xf'))(_0x7e8d('0x10'));var utils=require(_0x7e8d('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14320c,_0x38d102){_0x38d102=_0x38d102||0xcc;return function(_0x5c01af){if(_0x5c01af){return _0x14320c['sendStatus'](_0x38d102);}return _0x14320c[_0x7e8d('0x12')](_0x38d102)['end']();};}function respondWithResult(_0x2750d0,_0xfb2ea4){_0xfb2ea4=_0xfb2ea4||0xc8;return function(_0x58e88b){if(_0x58e88b){return _0x2750d0[_0x7e8d('0x12')](_0xfb2ea4)[_0x7e8d('0x13')](_0x58e88b);}};}function respondWithFilteredResult(_0x788eb5,_0xb83df8){return function(_0x364b33){if(_0x364b33){var _0x473fb6=typeof _0xb83df8[_0x7e8d('0x14')]===_0x7e8d('0x15')&&typeof _0xb83df8[_0x7e8d('0x16')]==='undefined';var _0x2930f7=_0x364b33[_0x7e8d('0x17')];var _0x1c14a7=_0x473fb6?0x0:_0xb83df8['offset'];var _0x469e53=_0x473fb6?_0x364b33[_0x7e8d('0x17')]:_0xb83df8[_0x7e8d('0x14')]+_0xb83df8[_0x7e8d('0x16')];var _0x30eef7;if(_0x469e53>=_0x2930f7){_0x469e53=_0x2930f7;_0x30eef7=0xc8;}else{_0x30eef7=0xce;}_0x788eb5[_0x7e8d('0x12')](_0x30eef7);return _0x788eb5[_0x7e8d('0x18')](_0x7e8d('0x19'),_0x1c14a7+'-'+_0x469e53+'/'+_0x2930f7)[_0x7e8d('0x13')](_0x364b33);}return null;};}function patchUpdates(_0x109c60){return function(_0x6263f0){try{jsonpatch[_0x7e8d('0x1a')](_0x6263f0,_0x109c60,!![]);}catch(_0x899178){return BPromise[_0x7e8d('0x1b')](_0x899178);}return _0x6263f0[_0x7e8d('0x1c')]();};}function saveUpdates(_0x101a45,_0x2368cc){return function(_0x1e64d5){if(_0x1e64d5){return _0x1e64d5[_0x7e8d('0x1d')](_0x101a45)[_0x7e8d('0x1e')](function(_0x13f182){return _0x13f182;});}return null;};}function removeEntity(_0x1e1e75,_0x4da0f8){return function(_0x499f6c){if(_0x499f6c){return _0x499f6c[_0x7e8d('0x1f')]()[_0x7e8d('0x1e')](function(){var _0x424c76=_0x499f6c[_0x7e8d('0x20')]({'plain':!![]});var _0x4106ff='CmHopperAdditionalPhones';return db[_0x7e8d('0x21')][_0x7e8d('0x1f')]({'where':{'type':_0x4106ff,'resourceId':_0x424c76['id']}})[_0x7e8d('0x1e')](function(){return _0x499f6c;});})[_0x7e8d('0x1e')](function(){_0x1e1e75['status'](0xcc)[_0x7e8d('0x22')]();});}};}function handleEntityNotFound(_0x3a146c,_0x5a8e02){return function(_0x34f67c){if(!_0x34f67c){_0x3a146c[_0x7e8d('0x23')](0x194);}return _0x34f67c;};}function handleError(_0x5b2e7a,_0xd27ae1){_0xd27ae1=_0xd27ae1||0x1f4;return function(_0x3c81f0){logger[_0x7e8d('0x24')](_0x3c81f0['stack']);if(_0x3c81f0[_0x7e8d('0x25')]){delete _0x3c81f0['name'];}_0x5b2e7a[_0x7e8d('0x12')](_0xd27ae1)['send'](_0x3c81f0);};}exports[_0x7e8d('0x26')]=function(_0x2335fd,_0x5cad9c){var _0x8c7afd={},_0x975c23={},_0x47cde2={'count':0x0,'rows':[]};var _0x36eda0=_[_0x7e8d('0x27')](db[_0x7e8d('0x28')]['rawAttributes'],function(_0x1005c9){return{'name':_0x1005c9[_0x7e8d('0x29')],'type':_0x1005c9['type'][_0x7e8d('0x2a')]};});_0x975c23[_0x7e8d('0x2b')]=_[_0x7e8d('0x27')](_0x36eda0,_0x7e8d('0x25'));_0x975c23['query']=_[_0x7e8d('0x2c')](_0x2335fd[_0x7e8d('0x2d')]);_0x975c23[_0x7e8d('0x2e')]=_[_0x7e8d('0x2f')](_0x975c23[_0x7e8d('0x2b')],_0x975c23[_0x7e8d('0x2d')]);_0x8c7afd[_0x7e8d('0x30')]=_['intersection'](_0x975c23['model'],qs['fields'](_0x2335fd[_0x7e8d('0x2d')]['fields']));_0x8c7afd[_0x7e8d('0x30')]=_0x8c7afd[_0x7e8d('0x30')]['length']?_0x8c7afd['attributes']:_0x975c23[_0x7e8d('0x2b')];if(!_0x2335fd[_0x7e8d('0x2d')]['hasOwnProperty'](_0x7e8d('0x31'))){_0x8c7afd[_0x7e8d('0x16')]=qs[_0x7e8d('0x16')](_0x2335fd[_0x7e8d('0x2d')][_0x7e8d('0x16')]);_0x8c7afd[_0x7e8d('0x14')]=qs[_0x7e8d('0x14')](_0x2335fd['query'][_0x7e8d('0x14')]);}_0x8c7afd[_0x7e8d('0x32')]=qs[_0x7e8d('0x33')](_0x2335fd[_0x7e8d('0x2d')][_0x7e8d('0x33')]);_0x8c7afd['where']=qs[_0x7e8d('0x2e')](_[_0x7e8d('0x34')](_0x2335fd[_0x7e8d('0x2d')],_0x975c23[_0x7e8d('0x2e')]),_0x36eda0);if(_0x2335fd[_0x7e8d('0x2d')]['filter']){_0x8c7afd[_0x7e8d('0x35')]=_['merge'](_0x8c7afd[_0x7e8d('0x35')],{'$or':_[_0x7e8d('0x27')](_0x36eda0,function(_0x427894){if(_0x427894['type']!==_0x7e8d('0x36')){var _0x584ac4={};_0x584ac4[_0x427894[_0x7e8d('0x25')]]={'$like':'%'+_0x2335fd['query'][_0x7e8d('0x37')]+'%'};return _0x584ac4;}})});}_0x8c7afd=_[_0x7e8d('0x38')]({},_0x8c7afd,_0x2335fd['options']);var _0x40e702={'where':_0x8c7afd[_0x7e8d('0x35')]};return db[_0x7e8d('0x28')]['count'](_0x40e702)[_0x7e8d('0x1e')](function(_0xab1dd6){_0x47cde2['count']=_0xab1dd6;if(_0x2335fd['query'][_0x7e8d('0x39')]){_0x8c7afd[_0x7e8d('0x3a')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x8c7afd);})[_0x7e8d('0x1e')](function(_0x349f9a){_0x47cde2[_0x7e8d('0x3b')]=_0x349f9a;return _0x47cde2;})['then'](respondWithFilteredResult(_0x5cad9c,_0x8c7afd))[_0x7e8d('0x3c')](handleError(_0x5cad9c,null));};exports[_0x7e8d('0x3d')]=function(_0xb87445,_0x3498bf){var _0x12563f={'raw':!![],'where':{'id':_0xb87445[_0x7e8d('0x3e')]['id']}},_0x3915ad={};_0x3915ad[_0x7e8d('0x2b')]=_[_0x7e8d('0x2c')](db[_0x7e8d('0x28')][_0x7e8d('0x3f')]);_0x3915ad[_0x7e8d('0x2d')]=_[_0x7e8d('0x2c')](_0xb87445[_0x7e8d('0x2d')]);_0x3915ad[_0x7e8d('0x2e')]=_[_0x7e8d('0x2f')](_0x3915ad[_0x7e8d('0x2b')],_0x3915ad[_0x7e8d('0x2d')]);_0x12563f[_0x7e8d('0x30')]=_[_0x7e8d('0x2f')](_0x3915ad[_0x7e8d('0x2b')],qs['fields'](_0xb87445[_0x7e8d('0x2d')][_0x7e8d('0x40')]));_0x12563f[_0x7e8d('0x30')]=_0x12563f['attributes']['length']?_0x12563f[_0x7e8d('0x30')]:_0x3915ad['model'];if(_0xb87445[_0x7e8d('0x2d')]['includeAll']){_0x12563f['include']=[{'all':!![]}];}_0x12563f=_['merge']({},_0x12563f,_0xb87445[_0x7e8d('0x41')]);return db[_0x7e8d('0x28')][_0x7e8d('0x42')](_0x12563f)[_0x7e8d('0x1e')](handleEntityNotFound(_0x3498bf,null))[_0x7e8d('0x1e')](respondWithResult(_0x3498bf,null))[_0x7e8d('0x3c')](handleError(_0x3498bf,null));};exports[_0x7e8d('0x43')]=function(_0x256814,_0x51bf2b){return db[_0x7e8d('0x28')][_0x7e8d('0x43')](_0x256814[_0x7e8d('0x44')],{})[_0x7e8d('0x1e')](function(_0x2593a5){var _0x17f7e1=_0x256814['user'][_0x7e8d('0x20')]({'plain':!![]});if(!_0x17f7e1)throw new Error(_0x7e8d('0x45'));if(_0x17f7e1['role']===_0x7e8d('0x46')){var _0x30077f=_0x2593a5[_0x7e8d('0x20')]({'plain':!![]});var _0x34f56d=_0x7e8d('0x47');return db[_0x7e8d('0x48')][_0x7e8d('0x42')]({'where':{'name':_0x34f56d,'userProfileId':_0x17f7e1[_0x7e8d('0x49')]},'raw':!![]})[_0x7e8d('0x1e')](function(_0x4061f2){if(_0x4061f2&&_0x4061f2['autoAssociation']===0x0){return db[_0x7e8d('0x21')][_0x7e8d('0x43')]({'name':_0x30077f[_0x7e8d('0x25')],'resourceId':_0x30077f['id'],'type':_0x4061f2['name'],'sectionId':_0x4061f2['id']},{})[_0x7e8d('0x1e')](function(){return _0x2593a5;});}else{return _0x2593a5;}})[_0x7e8d('0x3c')](function(_0x2d6014){logger[_0x7e8d('0x24')](_0x7e8d('0x4a'),_0x2d6014);throw _0x2d6014;});}return _0x2593a5;})[_0x7e8d('0x1e')](respondWithResult(_0x51bf2b,0xc9))['catch'](handleError(_0x51bf2b,null));};exports[_0x7e8d('0x1d')]=function(_0x1fae90,_0x2e143a){if(_0x1fae90[_0x7e8d('0x44')]['id']){delete _0x1fae90[_0x7e8d('0x44')]['id'];}return db[_0x7e8d('0x28')][_0x7e8d('0x42')]({'where':{'id':_0x1fae90[_0x7e8d('0x3e')]['id']}})[_0x7e8d('0x1e')](handleEntityNotFound(_0x2e143a,null))[_0x7e8d('0x1e')](saveUpdates(_0x1fae90[_0x7e8d('0x44')],null))[_0x7e8d('0x1e')](respondWithResult(_0x2e143a,null))[_0x7e8d('0x3c')](handleError(_0x2e143a,null));};exports[_0x7e8d('0x1f')]=function(_0x1c57d3,_0x347f74){return db[_0x7e8d('0x28')]['find']({'where':{'id':_0x1c57d3[_0x7e8d('0x3e')]['id']}})[_0x7e8d('0x1e')](handleEntityNotFound(_0x347f74,null))[_0x7e8d('0x1e')](removeEntity(_0x347f74,null))[_0x7e8d('0x3c')](handleError(_0x347f74,null));}; \ No newline at end of file +var _0x5c57=['filter','VIRTUAL','merge','options','CmHopperAdditionalPhone','includeAll','include','rows','catch','show','params','keys','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x580d1b,_0x492f8d){var _0x4c2e49=function(_0x452f8b){while(--_0x452f8b){_0x580d1b['push'](_0x580d1b['shift']());}};_0x4c2e49(++_0x492f8d);}(_0x5c57,0x11b));var _0x75c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c57[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x75c5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75c5('0x1'));var moment=require(_0x75c5('0x2'));var BPromise=require(_0x75c5('0x3'));var Mustache=require(_0x75c5('0x4'));var util=require(_0x75c5('0x5'));var path=require(_0x75c5('0x6'));var sox=require(_0x75c5('0x7'));var csv=require(_0x75c5('0x8'));var ejs=require(_0x75c5('0x9'));var fs=require('fs');var fs_extra=require(_0x75c5('0xa'));var _=require(_0x75c5('0xb'));var squel=require(_0x75c5('0xc'));var crypto=require(_0x75c5('0xd'));var jsforce=require(_0x75c5('0xe'));var deskjs=require(_0x75c5('0xf'));var toCsv=require(_0x75c5('0x8'));var querystring=require(_0x75c5('0x10'));var Papa=require('papaparse');var Redis=require(_0x75c5('0x11'));var authService=require(_0x75c5('0x12'));var qs=require(_0x75c5('0x13'));var as=require(_0x75c5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75c5('0x15'))(_0x75c5('0x16'));var utils=require(_0x75c5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x75c5('0x18'));var db=require(_0x75c5('0x19'))['db'];function respondWithStatusCode(_0x8ea5da,_0x2e7e77){_0x2e7e77=_0x2e7e77||0xcc;return function(_0x344ad9){if(_0x344ad9){return _0x8ea5da[_0x75c5('0x1a')](_0x2e7e77);}return _0x8ea5da[_0x75c5('0x1b')](_0x2e7e77)['end']();};}function respondWithResult(_0xccf87d,_0xec155c){_0xec155c=_0xec155c||0xc8;return function(_0x5a74bc){if(_0x5a74bc){return _0xccf87d[_0x75c5('0x1b')](_0xec155c)[_0x75c5('0x1c')](_0x5a74bc);}};}function respondWithFilteredResult(_0x75338e,_0x5aa513){return function(_0x33ae6d){if(_0x33ae6d){var _0x4be303=typeof _0x5aa513[_0x75c5('0x1d')]===_0x75c5('0x1e')&&typeof _0x5aa513[_0x75c5('0x1f')]==='undefined';var _0x219eab=_0x33ae6d[_0x75c5('0x20')];var _0x1cf60e=_0x4be303?0x0:_0x5aa513[_0x75c5('0x1d')];var _0x302aff=_0x4be303?_0x33ae6d[_0x75c5('0x20')]:_0x5aa513[_0x75c5('0x1d')]+_0x5aa513[_0x75c5('0x1f')];var _0xea0b74;if(_0x302aff>=_0x219eab){_0x302aff=_0x219eab;_0xea0b74=0xc8;}else{_0xea0b74=0xce;}_0x75338e[_0x75c5('0x1b')](_0xea0b74);return _0x75338e[_0x75c5('0x21')]('Content-Range',_0x1cf60e+'-'+_0x302aff+'/'+_0x219eab)['json'](_0x33ae6d);}return null;};}function patchUpdates(_0x7e431a){return function(_0x22e9da){try{jsonpatch[_0x75c5('0x22')](_0x22e9da,_0x7e431a,!![]);}catch(_0x27119a){return BPromise[_0x75c5('0x23')](_0x27119a);}return _0x22e9da[_0x75c5('0x24')]();};}function saveUpdates(_0x419db4,_0x411617){return function(_0xfc7ec5){if(_0xfc7ec5){return _0xfc7ec5['update'](_0x419db4)[_0x75c5('0x25')](function(_0x1ec58a){return _0x1ec58a;});}return null;};}function removeEntity(_0x3974f0,_0x1240d4){return function(_0x30ad3e){if(_0x30ad3e){return _0x30ad3e[_0x75c5('0x26')]()[_0x75c5('0x25')](function(){var _0x159300=_0x30ad3e[_0x75c5('0x27')]({'plain':!![]});var _0x3e431d=_0x75c5('0x28');return db[_0x75c5('0x29')][_0x75c5('0x26')]({'where':{'type':_0x3e431d,'resourceId':_0x159300['id']}})[_0x75c5('0x25')](function(){return _0x30ad3e;});})['then'](function(){_0x3974f0[_0x75c5('0x1b')](0xcc)[_0x75c5('0x2a')]();});}};}function handleEntityNotFound(_0x3aa965,_0x1b00cf){return function(_0x28ef1e){if(!_0x28ef1e){_0x3aa965['sendStatus'](0x194);}return _0x28ef1e;};}function handleError(_0x177058,_0x15ac66){_0x15ac66=_0x15ac66||0x1f4;return function(_0x257a9a){logger[_0x75c5('0x2b')](_0x257a9a[_0x75c5('0x2c')]);if(_0x257a9a[_0x75c5('0x2d')]){delete _0x257a9a['name'];}_0x177058['status'](_0x15ac66)[_0x75c5('0x2e')](_0x257a9a);};}exports[_0x75c5('0x2f')]=function(_0x5d23ec,_0x4b8f02){var _0x18eed7={},_0x4c67a0={},_0x1e71d5={'count':0x0,'rows':[]};var _0x190faa=_[_0x75c5('0x30')](db['CmHopperAdditionalPhone'][_0x75c5('0x31')],function(_0x3ebbd1){return{'name':_0x3ebbd1[_0x75c5('0x32')],'type':_0x3ebbd1[_0x75c5('0x33')][_0x75c5('0x34')]};});_0x4c67a0[_0x75c5('0x35')]=_[_0x75c5('0x30')](_0x190faa,_0x75c5('0x2d'));_0x4c67a0[_0x75c5('0x36')]=_['keys'](_0x5d23ec[_0x75c5('0x36')]);_0x4c67a0[_0x75c5('0x37')]=_['intersection'](_0x4c67a0[_0x75c5('0x35')],_0x4c67a0['query']);_0x18eed7[_0x75c5('0x38')]=_[_0x75c5('0x39')](_0x4c67a0[_0x75c5('0x35')],qs[_0x75c5('0x3a')](_0x5d23ec[_0x75c5('0x36')]['fields']));_0x18eed7[_0x75c5('0x38')]=_0x18eed7[_0x75c5('0x38')]['length']?_0x18eed7[_0x75c5('0x38')]:_0x4c67a0['model'];if(!_0x5d23ec[_0x75c5('0x36')][_0x75c5('0x3b')](_0x75c5('0x3c'))){_0x18eed7[_0x75c5('0x1f')]=qs['limit'](_0x5d23ec[_0x75c5('0x36')][_0x75c5('0x1f')]);_0x18eed7['offset']=qs[_0x75c5('0x1d')](_0x5d23ec[_0x75c5('0x36')]['offset']);}_0x18eed7[_0x75c5('0x3d')]=qs[_0x75c5('0x3e')](_0x5d23ec[_0x75c5('0x36')][_0x75c5('0x3e')]);_0x18eed7[_0x75c5('0x3f')]=qs[_0x75c5('0x37')](_[_0x75c5('0x40')](_0x5d23ec[_0x75c5('0x36')],_0x4c67a0[_0x75c5('0x37')]),_0x190faa);if(_0x5d23ec[_0x75c5('0x36')][_0x75c5('0x41')]){_0x18eed7['where']=_['merge'](_0x18eed7[_0x75c5('0x3f')],{'$or':_[_0x75c5('0x30')](_0x190faa,function(_0x2af4c8){if(_0x2af4c8[_0x75c5('0x33')]!==_0x75c5('0x42')){var _0x5d2c04={};_0x5d2c04[_0x2af4c8['name']]={'$like':'%'+_0x5d23ec['query'][_0x75c5('0x41')]+'%'};return _0x5d2c04;}})});}_0x18eed7=_[_0x75c5('0x43')]({},_0x18eed7,_0x5d23ec[_0x75c5('0x44')]);var _0x8a83d9={'where':_0x18eed7['where']};return db[_0x75c5('0x45')][_0x75c5('0x20')](_0x8a83d9)['then'](function(_0x33a891){_0x1e71d5[_0x75c5('0x20')]=_0x33a891;if(_0x5d23ec[_0x75c5('0x36')][_0x75c5('0x46')]){_0x18eed7[_0x75c5('0x47')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x18eed7);})[_0x75c5('0x25')](function(_0x5aff57){_0x1e71d5[_0x75c5('0x48')]=_0x5aff57;return _0x1e71d5;})['then'](respondWithFilteredResult(_0x4b8f02,_0x18eed7))[_0x75c5('0x49')](handleError(_0x4b8f02,null));};exports[_0x75c5('0x4a')]=function(_0x16182e,_0x47f9da){var _0x4ff83c={'raw':!![],'where':{'id':_0x16182e[_0x75c5('0x4b')]['id']}},_0x8f0601={};_0x8f0601[_0x75c5('0x35')]=_['keys'](db[_0x75c5('0x45')][_0x75c5('0x31')]);_0x8f0601['query']=_[_0x75c5('0x4c')](_0x16182e[_0x75c5('0x36')]);_0x8f0601[_0x75c5('0x37')]=_[_0x75c5('0x39')](_0x8f0601[_0x75c5('0x35')],_0x8f0601['query']);_0x4ff83c[_0x75c5('0x38')]=_[_0x75c5('0x39')](_0x8f0601['model'],qs['fields'](_0x16182e[_0x75c5('0x36')][_0x75c5('0x3a')]));_0x4ff83c['attributes']=_0x4ff83c[_0x75c5('0x38')]['length']?_0x4ff83c['attributes']:_0x8f0601[_0x75c5('0x35')];if(_0x16182e[_0x75c5('0x36')][_0x75c5('0x46')]){_0x4ff83c['include']=[{'all':!![]}];}_0x4ff83c=_[_0x75c5('0x43')]({},_0x4ff83c,_0x16182e['options']);return db[_0x75c5('0x45')]['find'](_0x4ff83c)[_0x75c5('0x25')](handleEntityNotFound(_0x47f9da,null))[_0x75c5('0x25')](respondWithResult(_0x47f9da,null))[_0x75c5('0x49')](handleError(_0x47f9da,null));};exports['create']=function(_0x39de8a,_0x25c0d){return db[_0x75c5('0x45')][_0x75c5('0x4d')](_0x39de8a[_0x75c5('0x4e')],{})[_0x75c5('0x25')](function(_0x59b875){var _0x395cf4=_0x39de8a['user'][_0x75c5('0x27')]({'plain':!![]});if(!_0x395cf4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x395cf4[_0x75c5('0x4f')]===_0x75c5('0x50')){var _0x1cfed0=_0x59b875['get']({'plain':!![]});var _0x46c7b5=_0x75c5('0x28');return db[_0x75c5('0x51')][_0x75c5('0x52')]({'where':{'name':_0x46c7b5,'userProfileId':_0x395cf4[_0x75c5('0x53')]},'raw':!![]})['then'](function(_0x27e597){if(_0x27e597&&_0x27e597[_0x75c5('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x1cfed0[_0x75c5('0x2d')],'resourceId':_0x1cfed0['id'],'type':_0x27e597[_0x75c5('0x2d')],'sectionId':_0x27e597['id']},{})['then'](function(){return _0x59b875;});}else{return _0x59b875;}})['catch'](function(_0x354b79){logger['error'](_0x75c5('0x55'),_0x354b79);throw _0x354b79;});}return _0x59b875;})[_0x75c5('0x25')](respondWithResult(_0x25c0d,0xc9))['catch'](handleError(_0x25c0d,null));};exports[_0x75c5('0x56')]=function(_0x3b7c34,_0x3e8753){if(_0x3b7c34[_0x75c5('0x4e')]['id']){delete _0x3b7c34[_0x75c5('0x4e')]['id'];}return db[_0x75c5('0x45')]['find']({'where':{'id':_0x3b7c34['params']['id']}})[_0x75c5('0x25')](handleEntityNotFound(_0x3e8753,null))[_0x75c5('0x25')](saveUpdates(_0x3b7c34[_0x75c5('0x4e')],null))[_0x75c5('0x25')](respondWithResult(_0x3e8753,null))['catch'](handleError(_0x3e8753,null));};exports['destroy']=function(_0x4bc720,_0x72f514){return db[_0x75c5('0x45')][_0x75c5('0x52')]({'where':{'id':_0x4bc720[_0x75c5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x72f514,null))[_0x75c5('0x25')](removeEntity(_0x72f514,null))[_0x75c5('0x49')](handleError(_0x72f514,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 5dd1895..2dd1c67 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 _0x148e=['path','../../config/environment','./cmHopperAdditionalPhone.attributes','CmHopperAdditionalPhone','lodash','../../config/logger','moment','bluebird'];(function(_0x45c895,_0x5f3708){var _0x37e8cd=function(_0x508db0){while(--_0x508db0){_0x45c895['push'](_0x45c895['shift']());}};_0x37e8cd(++_0x5f3708);}(_0x148e,0xfc));var _0xe148=function(_0x2967c1,_0x202a72){_0x2967c1=_0x2967c1-0x0;var _0x103397=_0x148e[_0x2967c1];return _0x103397;};'use strict';var _=require(_0xe148('0x0'));var util=require('util');var logger=require(_0xe148('0x1'))('api');var moment=require(_0xe148('0x2'));var BPromise=require(_0xe148('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe148('0x4'));var rimraf=require('rimraf');var config=require(_0xe148('0x5'));var attributes=require(_0xe148('0x6'));module['exports']=function(_0x928d37,_0x3a2dac){return _0x928d37['define'](_0xe148('0x7'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1dda=['cm_hopper_additional_phones','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x557f5f,_0x31d8e7){var _0x196eba=function(_0x433d89){while(--_0x433d89){_0x557f5f['push'](_0x557f5f['shift']());}};_0x196eba(++_0x31d8e7);}(_0x1dda,0xa3));var _0xa1dd=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x1dda[_0x7ad6cb];return _0x22a0ba;};'use strict';var _=require('lodash');var util=require(_0xa1dd('0x0'));var logger=require(_0xa1dd('0x1'))(_0xa1dd('0x2'));var moment=require('moment');var BPromise=require(_0xa1dd('0x3'));var rp=require(_0xa1dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1dd('0x5'));var config=require(_0xa1dd('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xa1dd('0x7')]=function(_0x5a6660,_0x23c597){return _0x5a6660['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0xa1dd('0x8'),'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 0cc6011..e2b7861 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 _0x1678=['VoiceQueueId','CampaignId','findOne','ASC','countbusyretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','OrderBy','countnosuchnumberretry','countagentrejectretry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','countcongestionretry','createdAt','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId'];(function(_0x513683,_0x56bd88){var _0x6028e=function(_0x595044){while(--_0x595044){_0x513683['push'](_0x513683['shift']());}};_0x6028e(++_0x56bd88);}(_0x1678,0x17b));var _0x8167=function(_0x32648c,_0x54e6e1){_0x32648c=_0x32648c-0x0;var _0x566685=_0x1678[_0x32648c];return _0x566685;};'use strict';var _=require(_0x8167('0x0'));var util=require(_0x8167('0x1'));var moment=require(_0x8167('0x2'));var BPromise=require(_0x8167('0x3'));var rs=require(_0x8167('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8167('0x5'));var logger=require(_0x8167('0x6'))(_0x8167('0x7'));var config=require(_0x8167('0x8'));var jayson=require(_0x8167('0x9'));var client=jayson[_0x8167('0xa')][_0x8167('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce075,_0x34768e,_0x267746){return new BPromise(function(_0x1aab13,_0x58b220){return client['request'](_0x4ce075,_0x267746)[_0x8167('0xc')](function(_0x381a87){logger['info'](_0x8167('0xd'),_0x34768e,_0x8167('0xe'));logger[_0x8167('0xf')](_0x8167('0x10'),_0x34768e,_0x8167('0xe'),JSON[_0x8167('0x11')](_0x381a87));if(_0x381a87[_0x8167('0x12')]){if(_0x381a87['error']['code']===0x1f4){logger[_0x8167('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x34768e,_0x381a87[_0x8167('0x12')][_0x8167('0x13')]);return _0x58b220(_0x381a87[_0x8167('0x12')][_0x8167('0x13')]);}logger[_0x8167('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x34768e,_0x381a87[_0x8167('0x12')]['message']);return _0x1aab13(_0x381a87['error']['message']);}else{logger['info'](_0x8167('0xd'),_0x34768e,_0x8167('0xe'));_0x1aab13(_0x381a87[_0x8167('0x14')][_0x8167('0x13')]);}})[_0x8167('0x15')](function(_0x3927ad){logger[_0x8167('0x12')](_0x8167('0xd'),_0x34768e,_0x3927ad);_0x58b220(_0x3927ad);});});}exports[_0x8167('0x16')]=function(_0x138504){var _0x5f4569=this;return new Promise(function(_0x2994b7,_0x4a4918){return db[_0x8167('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x138504[_0x8167('0x18')][_0x8167('0x19')],'ListId':_0x138504['body'][_0x8167('0x1a')],'VoiceQueueId':_0x138504[_0x8167('0x18')][_0x8167('0x1b')]===undefined?null:_0x138504[_0x8167('0x18')][_0x8167('0x1b')],'CampaignId':_0x138504[_0x8167('0x18')][_0x8167('0x1c')]===undefined?null:_0x138504[_0x8167('0x18')]['CampaignId']}})[_0x8167('0xc')](function(_0x51e7bc){if(_0x51e7bc!=null){return db['CmHopperAdditionalPhone'][_0x8167('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x51e7bc['id'],'OrderBy':{'$gt':_0x51e7bc['OrderBy']}},'order':[['OrderBy',_0x8167('0x1e')]]})[_0x8167('0xc')](function(_0xbf60c3){var _0x4edb8a=0x0;if(_0xbf60c3){if(_0xbf60c3[_0x8167('0x1f')]+_0xbf60c3['countcongestionretry']+_0xbf60c3[_0x8167('0x20')]+_0xbf60c3['countnosuchnumberretry']+_0xbf60c3[_0x8167('0x21')]+_0xbf60c3[_0x8167('0x22')]+_0xbf60c3[_0x8167('0x23')]+_0xbf60c3['countagentrejectretry']<_0x138504[_0x8167('0x24')][_0x8167('0x25')])_0x4edb8a=0x1;_0x2994b7({'additional':_0x4edb8a});}else{return db[_0x8167('0x26')][_0x8167('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x51e7bc['id']},'order':[[_0x8167('0x27'),_0x8167('0x1e')]]})[_0x8167('0xc')](function(_0x4ee50e){var _0x2ff3b3=0x0;if(_0x4ee50e){if(_0x4ee50e[_0x8167('0x1f')]+_0x4ee50e['countcongestionretry']+_0x4ee50e[_0x8167('0x20')]+_0x4ee50e[_0x8167('0x28')]+_0x4ee50e[_0x8167('0x21')]+_0x4ee50e[_0x8167('0x22')]+_0x4ee50e[_0x8167('0x23')]+_0x4ee50e[_0x8167('0x29')]<_0x138504[_0x8167('0x24')]['dialGlobalMaxRetry'])_0x2ff3b3=0x1;_0x2994b7({'additional':_0x2ff3b3});}else{_0x2994b7({'additional':0x0});}})[_0x8167('0x15')](function(_0x2f5871){logger['error'](_0x8167('0x16'),_0x2f5871[_0x8167('0x13')]);_0x4a4918(_0x5f4569[_0x8167('0x12')](0x1f4,_0x2f5871[_0x8167('0x13')]));});}})[_0x8167('0x15')](function(_0x4850ad){logger[_0x8167('0x12')]('VerifyAdditionalPhones',_0x4850ad[_0x8167('0x13')]);_0x4a4918(_0x5f4569[_0x8167('0x12')](0x1f4,_0x4850ad[_0x8167('0x13')]));});}else _0x2994b7({'additional':0x0});});});};exports[_0x8167('0x2a')]=function(_0x423edb){var _0x55e74a=this;return new Promise(function(_0x5a3bc6,_0x4c5475){return db['CmHopper'][_0x8167('0x1d')]({'raw':!![],'where':{'ContactId':_0x423edb[_0x8167('0x18')][_0x8167('0x19')],'ListId':_0x423edb[_0x8167('0x18')][_0x8167('0x1a')],'VoiceQueueId':_0x423edb[_0x8167('0x18')]['VoiceQueueId']===undefined?null:_0x423edb[_0x8167('0x18')]['VoiceQueueId'],'CampaignId':_0x423edb[_0x8167('0x18')][_0x8167('0x1c')]===undefined?null:_0x423edb['body']['CampaignId']}})[_0x8167('0xc')](function(_0x336a66){if(_0x336a66!=null){return db[_0x8167('0x26')][_0x8167('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x336a66['id'],'OrderBy':{'$gte':_0x336a66[_0x8167('0x27')]}},'order':[['OrderBy','ASC']]})[_0x8167('0xc')](function(_0x580698){if(_0x580698)return activateAdditionalPhone(_0x336a66,_0x423edb[_0x8167('0x18')],_0x580698,_0x423edb[_0x8167('0x2b')],_0x423edb['waitTime'])[_0x8167('0xc')](function(_0x1c01d0){_0x5a3bc6(_0x1c01d0);});else{return db[_0x8167('0x26')][_0x8167('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x336a66['id']},'order':[[_0x8167('0x27'),_0x8167('0x1e')]]})[_0x8167('0xc')](function(_0xee5e58){if(_0xee5e58)return activateAdditionalPhone(_0x336a66,_0x423edb[_0x8167('0x18')],_0xee5e58,_0x423edb[_0x8167('0x2b')],_0x423edb[_0x8167('0x2c')])[_0x8167('0xc')](function(_0x11e3e1){_0x5a3bc6(_0x11e3e1);});else{_0x5a3bc6({'id':_0x336a66['id'],'phone':''});}})[_0x8167('0x15')](function(_0x25a538){logger['error'](_0x8167('0x16'),_0x25a538['message']);_0x4c5475(_0x55e74a[_0x8167('0x12')](0x1f4,_0x25a538['message']));});}})[_0x8167('0x15')](function(_0xbbcfd2){logger['error'](_0x8167('0x16'),_0xbbcfd2['message']);_0x4c5475(_0x55e74a['error'](0x1f4,_0xbbcfd2[_0x8167('0x13')]));});}else _0x5a3bc6(0x1);});});};function activateAdditionalPhone(_0x54cc38,_0x129b66,_0x578bfb,_0x3ed87e,_0xa9b1e7){return new Promise(function(_0x5eb774,_0x23408a){var _0xfb3781;if(_[_0x8167('0x2d')](_0x578bfb[_0x8167('0x2e')])){_0x578bfb[_0x8167('0x2e')]=moment();}if(moment()>moment(_0x578bfb[_0x8167('0x2e')])){_0xfb3781=moment()[_0x8167('0x2f')](_0xa9b1e7||0x3,_0x8167('0x30'));}else{if(_0x578bfb[_0x8167('0x27')]==0x0){_0xfb3781=moment(_0x578bfb[_0x8167('0x2e')]);}else{_0xfb3781=moment()[_0x8167('0x2f')](_0xa9b1e7||0x3,_0x8167('0x30'));}}if(_[_0x8167('0x2d')](_0xfb3781)){_0xfb3781=moment()[_0x8167('0x2f')](_0xa9b1e7||0x3,'minutes');}var _0x120d5d={'phone':_0x54cc38[_0x8167('0x31')],'active':0x0,'OrderBy':_[_0x8167('0x2d')](_0x54cc38['OrderBy'])?0x0:_0x54cc38[_0x8167('0x27')],'scheduledat':moment()[_0x8167('0x2f')](_0x3ed87e||0x1,_0x8167('0x30')),'countbusyretry':_0x129b66[_0x8167('0x1f')],'countcongestionretry':_0x129b66[_0x8167('0x32')],'countnoanswerretry':_0x129b66[_0x8167('0x20')],'countnosuchnumberretry':_0x129b66[_0x8167('0x28')],'countdropretry':_0x129b66[_0x8167('0x21')],'countabandonedretry':_0x129b66[_0x8167('0x22')],'countmachineretry':_0x129b66[_0x8167('0x23')],'countagentrejectretry':_0x129b66[_0x8167('0x29')],'createdAt':_0x129b66[_0x8167('0x33')],'updatedAt':_0x129b66[_0x8167('0x34')]};var _0x543fef={'CmHopperId':_0x54cc38['id'],'phone':_0x578bfb[_0x8167('0x31')],'active':0x0,'OrderBy':_[_0x8167('0x2d')](_0x578bfb[_0x8167('0x27')])?0x0:_0x578bfb[_0x8167('0x27')],'scheduledat':_0xfb3781,'countbusyretry':_0x578bfb[_0x8167('0x1f')],'countcongestionretry':_0x578bfb[_0x8167('0x32')],'countnoanswerretry':_0x578bfb[_0x8167('0x20')],'countnosuchnumberretry':_0x578bfb['countnosuchnumberretry'],'countdropretry':_0x578bfb[_0x8167('0x21')],'countabandonedretry':_0x578bfb['countabandonedretry'],'countmachineretry':_0x578bfb[_0x8167('0x23')],'countagentrejectretry':_0x578bfb[_0x8167('0x29')],'createdAt':_0x578bfb[_0x8167('0x33')],'updatedAt':_0x578bfb[_0x8167('0x34')]};return db[_0x8167('0x35')]['transaction'](function(_0x374e43){return db[_0x8167('0x26')][_0x8167('0x36')](_0x120d5d,{'where':{'id':_0x578bfb['id']}},{'transaction':_0x374e43})[_0x8167('0xc')](function(){return db[_0x8167('0x17')]['update'](_0x543fef,{'where':{'id':_0x54cc38['id']}},{'transaction':_0x374e43});});})[_0x8167('0xc')](function(_0x2950ac){_0x5eb774({'id':_0x54cc38['id'],'phone':_0x578bfb[_0x8167('0x31')]});})[_0x8167('0x15')](function(_0x9c5fc){logger[_0x8167('0x12')](_0x8167('0x37'),_0x9c5fc[_0x8167('0x13')]);_0x23408a({'error':_0x9c5fc[_0x8167('0x13')]});});});}exports[_0x8167('0x38')]=function(_0x2a38ef){var _0x5b9f7d=this;return new Promise(function(_0x34473b,_0x288def){return db[_0x8167('0x17')][_0x8167('0x36')](_0x2a38ef['body'][_0x8167('0x39')],{'where':{'id':_0x2a38ef[_0x8167('0x18')]['id']}})[_0x8167('0xc')](function(_0x46d1d9){_0x34473b(_0x46d1d9);})[_0x8167('0x15')](function(_0x8b09cb){logger[_0x8167('0x12')](_0x8167('0x38'),_0x8b09cb[_0x8167('0x13')]);_0x288def(_0x5b9f7d['error'](0x1f4,_0x8b09cb[_0x8167('0x13')]));});});}; \ No newline at end of file +var _0x4122=['../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countbusyretry','countdropretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','CmHopper','duration','waitTime','scheduledat','add','minutes','isNil','createdAt','updatedAt','sequelize','transaction','update','phone','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','randomstring','ioredis'];(function(_0x1a5486,_0x26eb12){var _0x432d61=function(_0x2338a1){while(--_0x2338a1){_0x1a5486['push'](_0x1a5486['shift']());}};_0x432d61(++_0x26eb12);}(_0x4122,0x158));var _0x2412=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4122[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2412('0x0'));var util=require(_0x2412('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2412('0x2'));var fs=require('fs');var Redis=require(_0x2412('0x3'));var db=require(_0x2412('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2412('0x5'))('rpc');var config=require(_0x2412('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2412('0x7')][_0x2412('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10f8f0,_0x1efcbc,_0xf160c4){return new BPromise(function(_0x5835af,_0x51dbfa){return client[_0x2412('0x9')](_0x10f8f0,_0xf160c4)['then'](function(_0x244e20){logger[_0x2412('0xa')](_0x2412('0xb'),_0x1efcbc,_0x2412('0xc'));logger[_0x2412('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x1efcbc,_0x2412('0xc'),JSON[_0x2412('0xe')](_0x244e20));if(_0x244e20[_0x2412('0xf')]){if(_0x244e20[_0x2412('0xf')][_0x2412('0x10')]===0x1f4){logger[_0x2412('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1efcbc,_0x244e20[_0x2412('0xf')][_0x2412('0x11')]);return _0x51dbfa(_0x244e20[_0x2412('0xf')][_0x2412('0x11')]);}logger[_0x2412('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1efcbc,_0x244e20[_0x2412('0xf')][_0x2412('0x11')]);return _0x5835af(_0x244e20[_0x2412('0xf')][_0x2412('0x11')]);}else{logger['info'](_0x2412('0xb'),_0x1efcbc,_0x2412('0xc'));_0x5835af(_0x244e20[_0x2412('0x12')][_0x2412('0x11')]);}})[_0x2412('0x13')](function(_0x3f0a64){logger[_0x2412('0xf')](_0x2412('0xb'),_0x1efcbc,_0x3f0a64);_0x51dbfa(_0x3f0a64);});});}exports['VerifyAdditionalPhones']=function(_0x2629b2){var _0xae8ba8=this;return new Promise(function(_0x594fa5,_0x4576f7){return db['CmHopper'][_0x2412('0x14')]({'raw':!![],'where':{'ContactId':_0x2629b2[_0x2412('0x15')][_0x2412('0x16')],'ListId':_0x2629b2[_0x2412('0x15')][_0x2412('0x17')],'VoiceQueueId':_0x2629b2[_0x2412('0x15')][_0x2412('0x18')]===undefined?null:_0x2629b2['body'][_0x2412('0x18')],'CampaignId':_0x2629b2['body'][_0x2412('0x19')]===undefined?null:_0x2629b2['body'][_0x2412('0x19')]}})['then'](function(_0x29ff3e){if(_0x29ff3e!=null){return db[_0x2412('0x1a')][_0x2412('0x14')]({'raw':!![],'where':{'CmHopperId':_0x29ff3e['id'],'OrderBy':{'$gt':_0x29ff3e[_0x2412('0x1b')]}},'order':[[_0x2412('0x1b'),_0x2412('0x1c')]]})[_0x2412('0x1d')](function(_0x459f42){var _0x445880=0x0;if(_0x459f42){if(_0x459f42['countbusyretry']+_0x459f42[_0x2412('0x1e')]+_0x459f42[_0x2412('0x1f')]+_0x459f42[_0x2412('0x20')]+_0x459f42['countdropretry']+_0x459f42[_0x2412('0x21')]+_0x459f42[_0x2412('0x22')]+_0x459f42[_0x2412('0x23')]<_0x2629b2[_0x2412('0x24')]['dialGlobalMaxRetry'])_0x445880=0x1;_0x594fa5({'additional':_0x445880});}else{return db['CmHopperAdditionalPhone'][_0x2412('0x14')]({'raw':!![],'where':{'CmHopperId':_0x29ff3e['id']},'order':[[_0x2412('0x1b'),_0x2412('0x1c')]]})[_0x2412('0x1d')](function(_0x205cfb){var _0x4b144f=0x0;if(_0x205cfb){if(_0x205cfb[_0x2412('0x25')]+_0x205cfb[_0x2412('0x1e')]+_0x205cfb[_0x2412('0x1f')]+_0x205cfb[_0x2412('0x20')]+_0x205cfb[_0x2412('0x26')]+_0x205cfb[_0x2412('0x21')]+_0x205cfb['countmachineretry']+_0x205cfb['countagentrejectretry']<_0x2629b2[_0x2412('0x24')][_0x2412('0x27')])_0x4b144f=0x1;_0x594fa5({'additional':_0x4b144f});}else{_0x594fa5({'additional':0x0});}})[_0x2412('0x13')](function(_0x2c0c5f){logger[_0x2412('0xf')](_0x2412('0x28'),_0x2c0c5f[_0x2412('0x11')]);_0x4576f7(_0xae8ba8[_0x2412('0xf')](0x1f4,_0x2c0c5f[_0x2412('0x11')]));});}})['catch'](function(_0x530f99){logger[_0x2412('0xf')](_0x2412('0x28'),_0x530f99[_0x2412('0x11')]);_0x4576f7(_0xae8ba8[_0x2412('0xf')](0x1f4,_0x530f99[_0x2412('0x11')]));});}else _0x594fa5({'additional':0x0});});});};exports[_0x2412('0x29')]=function(_0x4770a8){var _0x28f14=this;return new Promise(function(_0x26365a,_0x77e8dc){return db[_0x2412('0x2a')]['findOne']({'raw':!![],'where':{'ContactId':_0x4770a8['body']['ContactId'],'ListId':_0x4770a8[_0x2412('0x15')][_0x2412('0x17')],'VoiceQueueId':_0x4770a8[_0x2412('0x15')][_0x2412('0x18')]===undefined?null:_0x4770a8['body']['VoiceQueueId'],'CampaignId':_0x4770a8[_0x2412('0x15')][_0x2412('0x19')]===undefined?null:_0x4770a8['body'][_0x2412('0x19')]}})['then'](function(_0x295165){if(_0x295165!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x295165['id'],'OrderBy':{'$gte':_0x295165[_0x2412('0x1b')]}},'order':[[_0x2412('0x1b'),'ASC']]})[_0x2412('0x1d')](function(_0x4a3633){if(_0x4a3633)return activateAdditionalPhone(_0x295165,_0x4770a8[_0x2412('0x15')],_0x4a3633,_0x4770a8[_0x2412('0x2b')],_0x4770a8[_0x2412('0x2c')])[_0x2412('0x1d')](function(_0x29a018){_0x26365a(_0x29a018);});else{return db['CmHopperAdditionalPhone'][_0x2412('0x14')]({'raw':!![],'where':{'CmHopperId':_0x295165['id']},'order':[[_0x2412('0x1b'),_0x2412('0x1c')]]})[_0x2412('0x1d')](function(_0x4b2080){if(_0x4b2080)return activateAdditionalPhone(_0x295165,_0x4770a8[_0x2412('0x15')],_0x4b2080,_0x4770a8[_0x2412('0x2b')],_0x4770a8[_0x2412('0x2c')])['then'](function(_0x426b8f){_0x26365a(_0x426b8f);});else{_0x26365a({'id':_0x295165['id'],'phone':''});}})['catch'](function(_0x22c841){logger['error'](_0x2412('0x28'),_0x22c841['message']);_0x77e8dc(_0x28f14[_0x2412('0xf')](0x1f4,_0x22c841[_0x2412('0x11')]));});}})[_0x2412('0x13')](function(_0x1f1581){logger[_0x2412('0xf')]('VerifyAdditionalPhones',_0x1f1581[_0x2412('0x11')]);_0x77e8dc(_0x28f14[_0x2412('0xf')](0x1f4,_0x1f1581[_0x2412('0x11')]));});}else _0x26365a(0x1);});});};function activateAdditionalPhone(_0x1ddf9d,_0x419cb8,_0x1aad8a,_0x343083,_0x242971){return new Promise(function(_0x22c044,_0x132ff1){var _0x5c3441;if(_['isNil'](_0x1aad8a[_0x2412('0x2d')])){_0x1aad8a[_0x2412('0x2d')]=moment();}if(moment()>moment(_0x1aad8a[_0x2412('0x2d')])){_0x5c3441=moment()[_0x2412('0x2e')](_0x242971||0x3,_0x2412('0x2f'));}else{if(_0x1aad8a['OrderBy']==0x0){_0x5c3441=moment(_0x1aad8a[_0x2412('0x2d')]);}else{_0x5c3441=moment()[_0x2412('0x2e')](_0x242971||0x3,_0x2412('0x2f'));}}if(_[_0x2412('0x30')](_0x5c3441)){_0x5c3441=moment()[_0x2412('0x2e')](_0x242971||0x3,_0x2412('0x2f'));}var _0x557eea={'phone':_0x1ddf9d['phone'],'active':0x0,'OrderBy':_['isNil'](_0x1ddf9d['OrderBy'])?0x0:_0x1ddf9d[_0x2412('0x1b')],'scheduledat':moment()[_0x2412('0x2e')](_0x343083||0x1,_0x2412('0x2f')),'countbusyretry':_0x419cb8[_0x2412('0x25')],'countcongestionretry':_0x419cb8[_0x2412('0x1e')],'countnoanswerretry':_0x419cb8[_0x2412('0x1f')],'countnosuchnumberretry':_0x419cb8[_0x2412('0x20')],'countdropretry':_0x419cb8[_0x2412('0x26')],'countabandonedretry':_0x419cb8['countabandonedretry'],'countmachineretry':_0x419cb8['countmachineretry'],'countagentrejectretry':_0x419cb8[_0x2412('0x23')],'createdAt':_0x419cb8[_0x2412('0x31')],'updatedAt':_0x419cb8[_0x2412('0x32')]};var _0x4d36db={'CmHopperId':_0x1ddf9d['id'],'phone':_0x1aad8a['phone'],'active':0x0,'OrderBy':_[_0x2412('0x30')](_0x1aad8a[_0x2412('0x1b')])?0x0:_0x1aad8a[_0x2412('0x1b')],'scheduledat':_0x5c3441,'countbusyretry':_0x1aad8a[_0x2412('0x25')],'countcongestionretry':_0x1aad8a['countcongestionretry'],'countnoanswerretry':_0x1aad8a[_0x2412('0x1f')],'countnosuchnumberretry':_0x1aad8a[_0x2412('0x20')],'countdropretry':_0x1aad8a[_0x2412('0x26')],'countabandonedretry':_0x1aad8a[_0x2412('0x21')],'countmachineretry':_0x1aad8a[_0x2412('0x22')],'countagentrejectretry':_0x1aad8a[_0x2412('0x23')],'createdAt':_0x1aad8a['createdAt'],'updatedAt':_0x1aad8a['updatedAt']};return db[_0x2412('0x33')][_0x2412('0x34')](function(_0xb51ede){return db[_0x2412('0x1a')][_0x2412('0x35')](_0x557eea,{'where':{'id':_0x1aad8a['id']}},{'transaction':_0xb51ede})[_0x2412('0x1d')](function(){return db[_0x2412('0x2a')][_0x2412('0x35')](_0x4d36db,{'where':{'id':_0x1ddf9d['id']}},{'transaction':_0xb51ede});});})['then'](function(_0x50e1d5){_0x22c044({'id':_0x1ddf9d['id'],'phone':_0x1aad8a[_0x2412('0x36')]});})['catch'](function(_0x139f92){logger[_0x2412('0xf')](_0x2412('0x37'),_0x139f92[_0x2412('0x11')]);_0x132ff1({'error':_0x139f92[_0x2412('0x11')]});});});}exports[_0x2412('0x38')]=function(_0xbe1728){var _0x3d3596=this;return new Promise(function(_0x15744c,_0x2618c9){return db[_0x2412('0x2a')][_0x2412('0x35')](_0xbe1728['body'][_0x2412('0x39')],{'where':{'id':_0xbe1728[_0x2412('0x15')]['id']}})[_0x2412('0x1d')](function(_0x55521b){_0x15744c(_0x55521b);})[_0x2412('0x13')](function(_0x2c550c){logger['error'](_0x2412('0x38'),_0x2c550c[_0x2412('0x11')]);_0x2618c9(_0x3d3596[_0x2412('0xf')](0x1f4,_0x2c550c[_0x2412('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index bd8b6f1..e69aa92 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 _0x96f1=['../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','express','Router'];(function(_0x130f2a,_0x503c18){var _0x148be8=function(_0x12d811){while(--_0x12d811){_0x130f2a['push'](_0x130f2a['shift']());}};_0x148be8(++_0x503c18);}(_0x96f1,0x10a));var _0x196f=function(_0xb3772,_0xc48a98){_0xb3772=_0xb3772-0x0;var _0x450e4e=_0x96f1[_0xb3772];return _0x450e4e;};'use strict';var multer=require('multer');var util=require(_0x196f('0x0'));var path=require(_0x196f('0x1'));var timeout=require('connect-timeout');var express=require(_0x196f('0x2'));var router=express[_0x196f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x196f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x196f('0x5'));var controller=require(_0x196f('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x196f('0x7')](_0x196f('0x8'),auth[_0x196f('0x9')](),controller[_0x196f('0xa')]);router[_0x196f('0xb')]('/',auth[_0x196f('0x9')](),controller[_0x196f('0xc')]);router[_0x196f('0xd')](_0x196f('0x8'),auth['isAuthenticated'](),controller[_0x196f('0xe')]);router[_0x196f('0xf')](_0x196f('0x8'),auth['isAuthenticated'](),controller[_0x196f('0x10')]);module[_0x196f('0x11')]=router; \ No newline at end of file +var _0xea85=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x484a1f,_0x5312ea){var _0xf2f1e1=function(_0x1c36ee){while(--_0x1c36ee){_0x484a1f['push'](_0x484a1f['shift']());}};_0xf2f1e1(++_0x5312ea);}(_0xea85,0x1cd));var _0x5ea8=function(_0x538f13,_0x3518e4){_0x538f13=_0x538f13-0x0;var _0x5b4db2=_0xea85[_0x538f13];return _0x5b4db2;};'use strict';var multer=require(_0x5ea8('0x0'));var util=require('util');var path=require(_0x5ea8('0x1'));var timeout=require(_0x5ea8('0x2'));var express=require(_0x5ea8('0x3'));var router=express[_0x5ea8('0x4')]();var fs_extra=require(_0x5ea8('0x5'));var auth=require(_0x5ea8('0x6'));var interaction=require(_0x5ea8('0x7'));var config=require(_0x5ea8('0x8'));var controller=require(_0x5ea8('0x9'));router[_0x5ea8('0xa')]('/',auth[_0x5ea8('0xb')](),controller[_0x5ea8('0xc')]);router[_0x5ea8('0xa')](_0x5ea8('0xd'),auth[_0x5ea8('0xb')](),controller['show']);router[_0x5ea8('0xe')]('/',auth[_0x5ea8('0xb')](),controller[_0x5ea8('0xf')]);router[_0x5ea8('0x10')]('/:id',auth[_0x5ea8('0xb')](),controller[_0x5ea8('0x11')]);router[_0x5ea8('0x12')](_0x5ea8('0xd'),auth[_0x5ea8('0xb')](),controller[_0x5ea8('0x13')]);module[_0x5ea8('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 4da433d..9ffc21b 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 _0x2409=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x58275e,_0x4617e0){var _0x1feb65=function(_0x250061){while(--_0x250061){_0x58275e['push'](_0x58275e['shift']());}};_0x1feb65(++_0x4617e0);}(_0x2409,0x128));var _0x9240=function(_0x12f736,_0x12f36c){_0x12f736=_0x12f736-0x0;var _0x277d84=_0x2409[_0x12f736];return _0x277d84;};'use strict';var moment=require(_0x9240('0x0'));var Sequelize=require(_0x9240('0x1'));module[_0x9240('0x2')]={'phone':{'type':Sequelize[_0x9240('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9240('0x4')],'unique':_0x9240('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x9240('0x5')},'VoiceQueueId':{'type':Sequelize[_0x9240('0x4')],'unique':_0x9240('0x5')}}; \ No newline at end of file +var _0xc903=['moment','exports','contactListQueue'];(function(_0x2f5a33,_0x5d0aa5){var _0x15cfe9=function(_0x34c4b8){while(--_0x34c4b8){_0x2f5a33['push'](_0x2f5a33['shift']());}};_0x15cfe9(++_0x5d0aa5);}(_0xc903,0x177));var _0x3c90=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xc903[_0x4c440b];return _0x2d48cf;};'use strict';var moment=require(_0x3c90('0x0'));var Sequelize=require('sequelize');module[_0x3c90('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x3c90('0x2')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x3c90('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x3c90('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index f6a8bd4..7afddac 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 _0x4c95=['filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','find','update','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','save','then','destroy','end','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where'];(function(_0x4cb231,_0x3d3c5b){var _0x4d5063=function(_0x4af9d0){while(--_0x4af9d0){_0x4cb231['push'](_0x4cb231['shift']());}};_0x4d5063(++_0x3d3c5b);}(_0x4c95,0xed));var _0x54c9=function(_0x10403c,_0x391bc7){_0x10403c=_0x10403c-0x0;var _0x15423b=_0x4c95[_0x10403c];return _0x15423b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54c9('0x0'));var zipdir=require(_0x54c9('0x1'));var jsonpatch=require(_0x54c9('0x2'));var rp=require(_0x54c9('0x3'));var moment=require('moment');var BPromise=require(_0x54c9('0x4'));var Mustache=require('mustache');var util=require(_0x54c9('0x5'));var path=require(_0x54c9('0x6'));var sox=require(_0x54c9('0x7'));var csv=require(_0x54c9('0x8'));var ejs=require(_0x54c9('0x9'));var fs=require('fs');var fs_extra=require(_0x54c9('0xa'));var _=require(_0x54c9('0xb'));var squel=require('squel');var crypto=require(_0x54c9('0xc'));var jsforce=require(_0x54c9('0xd'));var deskjs=require(_0x54c9('0xe'));var toCsv=require(_0x54c9('0x8'));var querystring=require(_0x54c9('0xf'));var Papa=require('papaparse');var Redis=require(_0x54c9('0x10'));var authService=require(_0x54c9('0x11'));var qs=require(_0x54c9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54c9('0x13'));var logger=require(_0x54c9('0x14'))(_0x54c9('0x15'));var utils=require(_0x54c9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x54c9('0x17'));var db=require(_0x54c9('0x18'))['db'];function respondWithStatusCode(_0x405657,_0x44bb62){_0x44bb62=_0x44bb62||0xcc;return function(_0x189832){if(_0x189832){return _0x405657[_0x54c9('0x19')](_0x44bb62);}return _0x405657[_0x54c9('0x1a')](_0x44bb62)['end']();};}function respondWithResult(_0x54ab59,_0x4d4cc9){_0x4d4cc9=_0x4d4cc9||0xc8;return function(_0x39f68f){if(_0x39f68f){return _0x54ab59[_0x54c9('0x1a')](_0x4d4cc9)[_0x54c9('0x1b')](_0x39f68f);}};}function respondWithFilteredResult(_0x9e462,_0x5008a3){return function(_0x990624){if(_0x990624){var _0x528fd1=typeof _0x5008a3[_0x54c9('0x1c')]===_0x54c9('0x1d')&&typeof _0x5008a3[_0x54c9('0x1e')]===_0x54c9('0x1d');var _0x43a0bb=_0x990624[_0x54c9('0x1f')];var _0x32fd50=_0x528fd1?0x0:_0x5008a3[_0x54c9('0x1c')];var _0x1c0683=_0x528fd1?_0x990624[_0x54c9('0x1f')]:_0x5008a3[_0x54c9('0x1c')]+_0x5008a3[_0x54c9('0x1e')];var _0xa4df21;if(_0x1c0683>=_0x43a0bb){_0x1c0683=_0x43a0bb;_0xa4df21=0xc8;}else{_0xa4df21=0xce;}_0x9e462[_0x54c9('0x1a')](_0xa4df21);return _0x9e462['set']('Content-Range',_0x32fd50+'-'+_0x1c0683+'/'+_0x43a0bb)[_0x54c9('0x1b')](_0x990624);}return null;};}function patchUpdates(_0x15aa05){return function(_0x7d7989){try{jsonpatch[_0x54c9('0x20')](_0x7d7989,_0x15aa05,!![]);}catch(_0x28b222){return BPromise['reject'](_0x28b222);}return _0x7d7989[_0x54c9('0x21')]();};}function saveUpdates(_0x1180f2,_0x1c7642){return function(_0x2d10a7){if(_0x2d10a7){return _0x2d10a7['update'](_0x1180f2)[_0x54c9('0x22')](function(_0x14d070){return _0x14d070;});}return null;};}function removeEntity(_0x2a3e7b,_0x519918){return function(_0x5a3c80){if(_0x5a3c80){return _0x5a3c80[_0x54c9('0x23')]()[_0x54c9('0x22')](function(){_0x2a3e7b['status'](0xcc)[_0x54c9('0x24')]();});}};}function handleEntityNotFound(_0x4fbaa2,_0x3a492f){return function(_0x245e70){if(!_0x245e70){_0x4fbaa2[_0x54c9('0x19')](0x194);}return _0x245e70;};}function handleError(_0x1e6d94,_0x121126){_0x121126=_0x121126||0x1f4;return function(_0x121332){logger[_0x54c9('0x25')](_0x121332[_0x54c9('0x26')]);if(_0x121332[_0x54c9('0x27')]){delete _0x121332[_0x54c9('0x27')];}_0x1e6d94[_0x54c9('0x1a')](_0x121126)[_0x54c9('0x28')](_0x121332);};}exports[_0x54c9('0x29')]=function(_0x5e13b2,_0x2885d4){var _0xb1916b={},_0x2845a8={},_0xc7d704={'count':0x0,'rows':[]};var _0x50bc12=_[_0x54c9('0x2a')](db[_0x54c9('0x2b')][_0x54c9('0x2c')],function(_0x42c85c){return{'name':_0x42c85c[_0x54c9('0x2d')],'type':_0x42c85c[_0x54c9('0x2e')][_0x54c9('0x2f')]};});_0x2845a8['model']=_[_0x54c9('0x2a')](_0x50bc12,_0x54c9('0x27'));_0x2845a8[_0x54c9('0x30')]=_[_0x54c9('0x31')](_0x5e13b2['query']);_0x2845a8['filters']=_[_0x54c9('0x32')](_0x2845a8['model'],_0x2845a8['query']);_0xb1916b['attributes']=_['intersection'](_0x2845a8[_0x54c9('0x33')],qs['fields'](_0x5e13b2[_0x54c9('0x30')][_0x54c9('0x34')]));_0xb1916b[_0x54c9('0x35')]=_0xb1916b['attributes'][_0x54c9('0x36')]?_0xb1916b[_0x54c9('0x35')]:_0x2845a8['model'];if(!_0x5e13b2[_0x54c9('0x30')][_0x54c9('0x37')](_0x54c9('0x38'))){_0xb1916b[_0x54c9('0x1e')]=qs[_0x54c9('0x1e')](_0x5e13b2['query']['limit']);_0xb1916b[_0x54c9('0x1c')]=qs[_0x54c9('0x1c')](_0x5e13b2[_0x54c9('0x30')][_0x54c9('0x1c')]);}_0xb1916b['order']=qs['sort'](_0x5e13b2[_0x54c9('0x30')][_0x54c9('0x39')]);_0xb1916b[_0x54c9('0x3a')]=qs[_0x54c9('0x3b')](_[_0x54c9('0x3c')](_0x5e13b2[_0x54c9('0x30')],_0x2845a8[_0x54c9('0x3b')]),_0x50bc12);if(_0x5e13b2['query']['filter']){_0xb1916b[_0x54c9('0x3a')]=_[_0x54c9('0x3d')](_0xb1916b[_0x54c9('0x3a')],{'$or':_[_0x54c9('0x2a')](_0x50bc12,function(_0x342d94){if(_0x342d94[_0x54c9('0x2e')]!==_0x54c9('0x3e')){var _0x444a27={};_0x444a27[_0x342d94[_0x54c9('0x27')]]={'$like':'%'+_0x5e13b2[_0x54c9('0x30')][_0x54c9('0x3f')]+'%'};return _0x444a27;}})});}_0xb1916b=_['merge']({},_0xb1916b,_0x5e13b2[_0x54c9('0x40')]);var _0xa5286e={'where':_0xb1916b['where']};return db['CmHopperBlack'][_0x54c9('0x1f')](_0xa5286e)[_0x54c9('0x22')](function(_0x47ceee){_0xc7d704[_0x54c9('0x1f')]=_0x47ceee;if(_0x5e13b2['query'][_0x54c9('0x41')]){_0xb1916b['include']=[{'all':!![]}];}return db[_0x54c9('0x2b')][_0x54c9('0x42')](_0xb1916b);})[_0x54c9('0x22')](function(_0x327694){_0xc7d704[_0x54c9('0x43')]=_0x327694;return _0xc7d704;})[_0x54c9('0x22')](respondWithFilteredResult(_0x2885d4,_0xb1916b))[_0x54c9('0x44')](handleError(_0x2885d4,null));};exports['show']=function(_0x1d3645,_0x89979){var _0x5c729b={'raw':!![],'where':{'id':_0x1d3645['params']['id']}},_0x119621={};_0x119621['model']=_[_0x54c9('0x31')](db[_0x54c9('0x2b')][_0x54c9('0x2c')]);_0x119621['query']=_[_0x54c9('0x31')](_0x1d3645[_0x54c9('0x30')]);_0x119621[_0x54c9('0x3b')]=_['intersection'](_0x119621['model'],_0x119621[_0x54c9('0x30')]);_0x5c729b[_0x54c9('0x35')]=_[_0x54c9('0x32')](_0x119621['model'],qs[_0x54c9('0x34')](_0x1d3645[_0x54c9('0x30')][_0x54c9('0x34')]));_0x5c729b[_0x54c9('0x35')]=_0x5c729b['attributes'][_0x54c9('0x36')]?_0x5c729b[_0x54c9('0x35')]:_0x119621[_0x54c9('0x33')];if(_0x1d3645['query'][_0x54c9('0x41')]){_0x5c729b['include']=[{'all':!![]}];}_0x5c729b=_[_0x54c9('0x3d')]({},_0x5c729b,_0x1d3645[_0x54c9('0x40')]);return db[_0x54c9('0x2b')][_0x54c9('0x45')](_0x5c729b)[_0x54c9('0x22')](handleEntityNotFound(_0x89979,null))['then'](respondWithResult(_0x89979,null))[_0x54c9('0x44')](handleError(_0x89979,null));};exports[_0x54c9('0x46')]=function(_0x4125b0,_0x5ba791){if(_0x4125b0[_0x54c9('0x47')]['id']){delete _0x4125b0[_0x54c9('0x47')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x4125b0[_0x54c9('0x48')]['id']}})[_0x54c9('0x22')](handleEntityNotFound(_0x5ba791,null))[_0x54c9('0x22')](saveUpdates(_0x4125b0['body'],null))['then'](respondWithResult(_0x5ba791,null))[_0x54c9('0x44')](handleError(_0x5ba791,null));};exports[_0x54c9('0x23')]=function(_0x321d75,_0x19f527){return db[_0x54c9('0x2b')][_0x54c9('0x45')]({'where':{'id':_0x321d75['params']['id']}})['then'](handleEntityNotFound(_0x19f527,null))[_0x54c9('0x22')](removeEntity(_0x19f527,null))[_0x54c9('0x44')](handleError(_0x19f527,null));};exports[_0x54c9('0x49')]=function(_0x2c7be5,_0x4bc124){return db['CmHopperBlack']['describe']()[_0x54c9('0x22')](respondWithResult(_0x4bc124,null))[_0x54c9('0x44')](handleError(_0x4bc124,null));}; \ No newline at end of file +var _0x8ad6=['sort','pick','where','VIRTUAL','merge','options','CmHopperBlack','includeAll','include','findAll','rows','show','params','keys','length','find','body','catch','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x5db82f,_0x1d9186){var _0x27d541=function(_0x2ebce4){while(--_0x2ebce4){_0x5db82f['push'](_0x5db82f['shift']());}};_0x27d541(++_0x1d9186);}(_0x8ad6,0xfd));var _0x68ad=function(_0x5f45f8,_0x67710f){_0x5f45f8=_0x5f45f8-0x0;var _0x4910ed=_0x8ad6[_0x5f45f8];return _0x4910ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68ad('0x0'));var zipdir=require(_0x68ad('0x1'));var jsonpatch=require(_0x68ad('0x2'));var rp=require('request-promise');var moment=require(_0x68ad('0x3'));var BPromise=require(_0x68ad('0x4'));var Mustache=require(_0x68ad('0x5'));var util=require(_0x68ad('0x6'));var path=require(_0x68ad('0x7'));var sox=require(_0x68ad('0x8'));var csv=require(_0x68ad('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68ad('0xa'));var _=require(_0x68ad('0xb'));var squel=require(_0x68ad('0xc'));var crypto=require(_0x68ad('0xd'));var jsforce=require(_0x68ad('0xe'));var deskjs=require(_0x68ad('0xf'));var toCsv=require(_0x68ad('0x9'));var querystring=require(_0x68ad('0x10'));var Papa=require('papaparse');var Redis=require(_0x68ad('0x11'));var authService=require(_0x68ad('0x12'));var qs=require(_0x68ad('0x13'));var as=require(_0x68ad('0x14'));var hardwareService=require(_0x68ad('0x15'));var logger=require(_0x68ad('0x16'))(_0x68ad('0x17'));var utils=require(_0x68ad('0x18'));var config=require(_0x68ad('0x19'));var licenseUtil=require(_0x68ad('0x1a'));var db=require(_0x68ad('0x1b'))['db'];function respondWithStatusCode(_0x2874e7,_0x1d019e){_0x1d019e=_0x1d019e||0xcc;return function(_0x1690e4){if(_0x1690e4){return _0x2874e7['sendStatus'](_0x1d019e);}return _0x2874e7[_0x68ad('0x1c')](_0x1d019e)['end']();};}function respondWithResult(_0x40b97d,_0x45babc){_0x45babc=_0x45babc||0xc8;return function(_0x31bed4){if(_0x31bed4){return _0x40b97d[_0x68ad('0x1c')](_0x45babc)[_0x68ad('0x1d')](_0x31bed4);}};}function respondWithFilteredResult(_0x16bc56,_0xfed0da){return function(_0x172b52){if(_0x172b52){var _0x2bdf67=typeof _0xfed0da[_0x68ad('0x1e')]==='undefined'&&typeof _0xfed0da['limit']===_0x68ad('0x1f');var _0x59942e=_0x172b52[_0x68ad('0x20')];var _0x48cf0f=_0x2bdf67?0x0:_0xfed0da[_0x68ad('0x1e')];var _0x288a8d=_0x2bdf67?_0x172b52[_0x68ad('0x20')]:_0xfed0da[_0x68ad('0x1e')]+_0xfed0da[_0x68ad('0x21')];var _0x2ab285;if(_0x288a8d>=_0x59942e){_0x288a8d=_0x59942e;_0x2ab285=0xc8;}else{_0x2ab285=0xce;}_0x16bc56[_0x68ad('0x1c')](_0x2ab285);return _0x16bc56[_0x68ad('0x22')](_0x68ad('0x23'),_0x48cf0f+'-'+_0x288a8d+'/'+_0x59942e)[_0x68ad('0x1d')](_0x172b52);}return null;};}function patchUpdates(_0x285a78){return function(_0x408951){try{jsonpatch['apply'](_0x408951,_0x285a78,!![]);}catch(_0x90a629){return BPromise[_0x68ad('0x24')](_0x90a629);}return _0x408951[_0x68ad('0x25')]();};}function saveUpdates(_0xe2e946,_0x571618){return function(_0x307d28){if(_0x307d28){return _0x307d28[_0x68ad('0x26')](_0xe2e946)[_0x68ad('0x27')](function(_0x50b30f){return _0x50b30f;});}return null;};}function removeEntity(_0x3904de,_0x5cf841){return function(_0x51ad0d){if(_0x51ad0d){return _0x51ad0d['destroy']()[_0x68ad('0x27')](function(){_0x3904de['status'](0xcc)[_0x68ad('0x28')]();});}};}function handleEntityNotFound(_0x14cc21,_0x35bd51){return function(_0x528a2b){if(!_0x528a2b){_0x14cc21['sendStatus'](0x194);}return _0x528a2b;};}function handleError(_0x3f62a1,_0x52027a){_0x52027a=_0x52027a||0x1f4;return function(_0x2a17be){logger[_0x68ad('0x29')](_0x2a17be[_0x68ad('0x2a')]);if(_0x2a17be[_0x68ad('0x2b')]){delete _0x2a17be[_0x68ad('0x2b')];}_0x3f62a1[_0x68ad('0x1c')](_0x52027a)['send'](_0x2a17be);};}exports[_0x68ad('0x2c')]=function(_0x33ac8d,_0x2d53a0){var _0x19b64a={},_0x49f6f5={},_0x3e760a={'count':0x0,'rows':[]};var _0x189511=_[_0x68ad('0x2d')](db['CmHopperBlack'][_0x68ad('0x2e')],function(_0x332d8b){return{'name':_0x332d8b[_0x68ad('0x2f')],'type':_0x332d8b[_0x68ad('0x30')][_0x68ad('0x31')]};});_0x49f6f5['model']=_['map'](_0x189511,_0x68ad('0x2b'));_0x49f6f5[_0x68ad('0x32')]=_['keys'](_0x33ac8d[_0x68ad('0x32')]);_0x49f6f5[_0x68ad('0x33')]=_['intersection'](_0x49f6f5[_0x68ad('0x34')],_0x49f6f5[_0x68ad('0x32')]);_0x19b64a['attributes']=_[_0x68ad('0x35')](_0x49f6f5['model'],qs[_0x68ad('0x36')](_0x33ac8d['query'][_0x68ad('0x36')]));_0x19b64a['attributes']=_0x19b64a[_0x68ad('0x37')]['length']?_0x19b64a['attributes']:_0x49f6f5[_0x68ad('0x34')];if(!_0x33ac8d[_0x68ad('0x32')][_0x68ad('0x38')](_0x68ad('0x39'))){_0x19b64a[_0x68ad('0x21')]=qs['limit'](_0x33ac8d[_0x68ad('0x32')]['limit']);_0x19b64a['offset']=qs[_0x68ad('0x1e')](_0x33ac8d[_0x68ad('0x32')][_0x68ad('0x1e')]);}_0x19b64a[_0x68ad('0x3a')]=qs[_0x68ad('0x3b')](_0x33ac8d[_0x68ad('0x32')][_0x68ad('0x3b')]);_0x19b64a['where']=qs[_0x68ad('0x33')](_[_0x68ad('0x3c')](_0x33ac8d['query'],_0x49f6f5['filters']),_0x189511);if(_0x33ac8d[_0x68ad('0x32')]['filter']){_0x19b64a[_0x68ad('0x3d')]=_['merge'](_0x19b64a[_0x68ad('0x3d')],{'$or':_[_0x68ad('0x2d')](_0x189511,function(_0x253f87){if(_0x253f87[_0x68ad('0x30')]!==_0x68ad('0x3e')){var _0x1b0d7b={};_0x1b0d7b[_0x253f87[_0x68ad('0x2b')]]={'$like':'%'+_0x33ac8d[_0x68ad('0x32')]['filter']+'%'};return _0x1b0d7b;}})});}_0x19b64a=_[_0x68ad('0x3f')]({},_0x19b64a,_0x33ac8d[_0x68ad('0x40')]);var _0x3ef551={'where':_0x19b64a[_0x68ad('0x3d')]};return db[_0x68ad('0x41')][_0x68ad('0x20')](_0x3ef551)['then'](function(_0xee45d){_0x3e760a[_0x68ad('0x20')]=_0xee45d;if(_0x33ac8d[_0x68ad('0x32')][_0x68ad('0x42')]){_0x19b64a[_0x68ad('0x43')]=[{'all':!![]}];}return db[_0x68ad('0x41')][_0x68ad('0x44')](_0x19b64a);})[_0x68ad('0x27')](function(_0x3d2e40){_0x3e760a[_0x68ad('0x45')]=_0x3d2e40;return _0x3e760a;})[_0x68ad('0x27')](respondWithFilteredResult(_0x2d53a0,_0x19b64a))['catch'](handleError(_0x2d53a0,null));};exports[_0x68ad('0x46')]=function(_0x366725,_0x1dd2ae){var _0x3ceb47={'raw':!![],'where':{'id':_0x366725[_0x68ad('0x47')]['id']}},_0xe4a9ef={};_0xe4a9ef[_0x68ad('0x34')]=_[_0x68ad('0x48')](db[_0x68ad('0x41')][_0x68ad('0x2e')]);_0xe4a9ef[_0x68ad('0x32')]=_['keys'](_0x366725[_0x68ad('0x32')]);_0xe4a9ef['filters']=_[_0x68ad('0x35')](_0xe4a9ef['model'],_0xe4a9ef[_0x68ad('0x32')]);_0x3ceb47[_0x68ad('0x37')]=_[_0x68ad('0x35')](_0xe4a9ef['model'],qs[_0x68ad('0x36')](_0x366725[_0x68ad('0x32')][_0x68ad('0x36')]));_0x3ceb47['attributes']=_0x3ceb47[_0x68ad('0x37')][_0x68ad('0x49')]?_0x3ceb47[_0x68ad('0x37')]:_0xe4a9ef[_0x68ad('0x34')];if(_0x366725['query'][_0x68ad('0x42')]){_0x3ceb47['include']=[{'all':!![]}];}_0x3ceb47=_[_0x68ad('0x3f')]({},_0x3ceb47,_0x366725['options']);return db[_0x68ad('0x41')][_0x68ad('0x4a')](_0x3ceb47)[_0x68ad('0x27')](handleEntityNotFound(_0x1dd2ae,null))[_0x68ad('0x27')](respondWithResult(_0x1dd2ae,null))['catch'](handleError(_0x1dd2ae,null));};exports[_0x68ad('0x26')]=function(_0x3490f4,_0x4379ee){if(_0x3490f4[_0x68ad('0x4b')]['id']){delete _0x3490f4[_0x68ad('0x4b')]['id'];}return db[_0x68ad('0x41')][_0x68ad('0x4a')]({'where':{'id':_0x3490f4['params']['id']}})['then'](handleEntityNotFound(_0x4379ee,null))[_0x68ad('0x27')](saveUpdates(_0x3490f4[_0x68ad('0x4b')],null))[_0x68ad('0x27')](respondWithResult(_0x4379ee,null))['catch'](handleError(_0x4379ee,null));};exports['destroy']=function(_0x5ef40e,_0x5e65c7){return db['CmHopperBlack'][_0x68ad('0x4a')]({'where':{'id':_0x5ef40e['params']['id']}})[_0x68ad('0x27')](handleEntityNotFound(_0x5e65c7,null))[_0x68ad('0x27')](removeEntity(_0x5e65c7,null))[_0x68ad('0x4c')](handleError(_0x5e65c7,null));};exports['describe']=function(_0x49c26c,_0x11799c){return db[_0x68ad('0x41')][_0x68ad('0x4d')]()['then'](respondWithResult(_0x11799c,null))[_0x68ad('0x4c')](handleError(_0x11799c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index c50b241..129d579 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 _0xce2d=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0xce2d,0x11f));var _0xdce2=function(_0x3d51dc,_0x120822){_0x3d51dc=_0x3d51dc-0x0;var _0x5de48b=_0xce2d[_0x3d51dc];return _0x5de48b;};'use strict';var _=require(_0xdce2('0x0'));var util=require('util');var logger=require(_0xdce2('0x1'))('api');var moment=require(_0xdce2('0x2'));var BPromise=require(_0xdce2('0x3'));var rp=require(_0xdce2('0x4'));var fs=require('fs');var path=require(_0xdce2('0x5'));var rimraf=require('rimraf');var config=require(_0xdce2('0x6'));var attributes=require(_0xdce2('0x7'));module[_0xdce2('0x8')]=function(_0x3c126e,_0x25d841){return _0x3c126e[_0xdce2('0x9')](_0xdce2('0xa'),attributes,{'tableName':_0xdce2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a1e=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x314b37,_0x1c6986){var _0x17fd1b=function(_0x34e0b0){while(--_0x34e0b0){_0x314b37['push'](_0x314b37['shift']());}};_0x17fd1b(++_0x1c6986);}(_0x3a1e,0x1d8));var _0xe3a1=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0x3a1e[_0xe0b81f];return _0x290e5e;};'use strict';var _=require(_0xe3a1('0x0'));var util=require('util');var logger=require(_0xe3a1('0x1'))(_0xe3a1('0x2'));var moment=require(_0xe3a1('0x3'));var BPromise=require('bluebird');var rp=require(_0xe3a1('0x4'));var fs=require('fs');var path=require(_0xe3a1('0x5'));var rimraf=require(_0xe3a1('0x6'));var config=require(_0xe3a1('0x7'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0xad3fb4,_0x1d2f2d){return _0xad3fb4[_0xe3a1('0x8')](_0xe3a1('0x9'),attributes,{'tableName':_0xe3a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index d10082b..56f16d3 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 _0x460c=['message','result','catch','CmHopperBlack','findAll','options','raw','where','limit','include','map','attributes','GetCmHopperBlack','stringify','update','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x15678a,_0x5bd4e7){var _0x47200c=function(_0x525309){while(--_0x525309){_0x15678a['push'](_0x15678a['shift']());}};_0x47200c(++_0x5bd4e7);}(_0x460c,0x1f3));var _0xc460=function(_0x5af85c,_0x2a77e4){_0x5af85c=_0x5af85c-0x0;var _0x4767c1=_0x460c[_0x5af85c];return _0x4767c1;};'use strict';var _=require('lodash');var util=require(_0xc460('0x0'));var moment=require(_0xc460('0x1'));var BPromise=require(_0xc460('0x2'));var rs=require(_0xc460('0x3'));var fs=require('fs');var Redis=require(_0xc460('0x4'));var db=require(_0xc460('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc460('0x6'))('rpc');var config=require(_0xc460('0x7'));var jayson=require(_0xc460('0x8'));var client=jayson[_0xc460('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32d594,_0x38c56e,_0x3d103d){return new BPromise(function(_0x1eddae,_0x2c0f00){return client[_0xc460('0xa')](_0x32d594,_0x3d103d)[_0xc460('0xb')](function(_0x424435){logger[_0xc460('0xc')](_0xc460('0xd'),_0x38c56e,'request\x20sent');logger[_0xc460('0xe')](_0xc460('0xf'),_0x38c56e,_0xc460('0x10'),JSON['stringify'](_0x424435));if(_0x424435[_0xc460('0x11')]){if(_0x424435[_0xc460('0x11')][_0xc460('0x12')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x38c56e,_0x424435[_0xc460('0x11')][_0xc460('0x13')]);return _0x2c0f00(_0x424435[_0xc460('0x11')][_0xc460('0x13')]);}logger['error'](_0xc460('0xd'),_0x38c56e,_0x424435[_0xc460('0x11')]['message']);return _0x1eddae(_0x424435[_0xc460('0x11')]['message']);}else{logger[_0xc460('0xc')](_0xc460('0xd'),_0x38c56e,_0xc460('0x10'));_0x1eddae(_0x424435[_0xc460('0x14')][_0xc460('0x13')]);}})[_0xc460('0x15')](function(_0x370b1f){logger[_0xc460('0x11')](_0xc460('0xd'),_0x38c56e,_0x370b1f);_0x2c0f00(_0x370b1f);});});}exports['GetCmHopperBlack']=function(_0x3cb90d){var _0x425bae=this;return new Promise(function(_0x2b6b53,_0x5e3679){return db[_0xc460('0x16')][_0xc460('0x17')]({'raw':_0x3cb90d[_0xc460('0x18')]?_0x3cb90d[_0xc460('0x18')][_0xc460('0x19')]===undefined?!![]:![]:!![],'where':_0x3cb90d[_0xc460('0x18')]?_0x3cb90d[_0xc460('0x18')][_0xc460('0x1a')]||null:null,'attributes':_0x3cb90d[_0xc460('0x18')]?_0x3cb90d['options']['attributes']||null:null,'limit':_0x3cb90d[_0xc460('0x18')]?_0x3cb90d[_0xc460('0x18')][_0xc460('0x1b')]||null:null,'include':_0x3cb90d[_0xc460('0x18')]?_0x3cb90d[_0xc460('0x18')][_0xc460('0x1c')]?_[_0xc460('0x1d')](_0x3cb90d[_0xc460('0x18')][_0xc460('0x1c')],function(_0x41131d){return{'model':db[_0x41131d['model']],'as':_0x41131d['as'],'attributes':_0x41131d[_0xc460('0x1e')],'include':_0x41131d[_0xc460('0x1c')]?_[_0xc460('0x1d')](_0x41131d[_0xc460('0x1c')],function(_0x4a6353){return{'model':db[_0x4a6353['model']],'as':_0x4a6353['as'],'attributes':_0x4a6353[_0xc460('0x1e')],'include':_0x4a6353[_0xc460('0x1c')]?_[_0xc460('0x1d')](_0x4a6353['include'],function(_0xfc17f6){return{'model':db[_0xfc17f6['model']],'as':_0xfc17f6['as'],'attributes':_0xfc17f6[_0xc460('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc460('0xb')](function(_0x30a069){logger['info'](_0xc460('0x1f'),_0x3cb90d);logger[_0xc460('0xe')]('GetCmHopperBlack',_0x3cb90d,JSON[_0xc460('0x20')](_0x30a069));_0x2b6b53(_0x30a069);})[_0xc460('0x15')](function(_0x3636f1){logger['error'](_0xc460('0x1f'),_0x3636f1[_0xc460('0x13')],_0x3cb90d);_0x5e3679(_0x425bae[_0xc460('0x11')](0x1f4,_0x3636f1['message']));});});};exports['UpdateCmHopperBlack']=function(_0x294267){var _0x31e1e1=this;return new Promise(function(_0x1ab052,_0x3ab888){return db['CmHopperBlack'][_0xc460('0x21')](_0x294267['body'],{'raw':_0x294267[_0xc460('0x18')]?_0x294267['options'][_0xc460('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x294267[_0xc460('0x18')]?_0x294267['options']['where']||null:null,'attributes':_0x294267[_0xc460('0x18')]?_0x294267['options'][_0xc460('0x1e')]||null:null,'limit':_0x294267[_0xc460('0x18')]?_0x294267[_0xc460('0x18')][_0xc460('0x1b')]||null:null})[_0xc460('0xb')](function(_0x279c34){logger[_0xc460('0xc')](_0xc460('0x22'),_0x294267);logger[_0xc460('0xe')](_0xc460('0x22'),_0x294267,JSON['stringify'](_0x279c34));_0x1ab052(_0x279c34);})['catch'](function(_0x595b43){logger[_0xc460('0x11')](_0xc460('0x22'),_0x595b43[_0xc460('0x13')],_0x294267);_0x3ab888(_0x31e1e1[_0xc460('0x11')](0x1f4,_0x595b43[_0xc460('0x13')]));});});};exports[_0xc460('0x23')]=function(_0x39209a){var _0x12c803=this;return new Promise(function(_0x34772a,_0xaac306){return db[_0xc460('0x16')][_0xc460('0x24')]({'where':_0x39209a[_0xc460('0x18')]?_0x39209a[_0xc460('0x18')]['where']||null:null})[_0xc460('0xb')](function(_0xb69892){logger[_0xc460('0xc')](_0xc460('0x23'),_0x39209a);logger[_0xc460('0xe')](_0xc460('0x23'),_0x39209a,JSON[_0xc460('0x20')](_0xb69892));_0x34772a(_0xb69892);})[_0xc460('0x15')](function(_0x464423){logger[_0xc460('0x11')](_0xc460('0x23'),_0x464423[_0xc460('0x13')],_0x39209a);_0xaac306(_0x12c803[_0xc460('0x11')](0x1f4,_0x464423[_0xc460('0x13')]));});});}; \ No newline at end of file +var _0x4fe9=['CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCmHopperBlack','CmHopperBlack','options','where','attributes','limit','include','map','catch','UpdateCmHopperBlack','body','raw','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0x4fe9,0x161));var _0x94fe=function(_0x447170,_0x587db3){_0x447170=_0x447170-0x0;var _0x17553f=_0x4fe9[_0x447170];return _0x17553f;};'use strict';var _=require(_0x94fe('0x0'));var util=require(_0x94fe('0x1'));var moment=require(_0x94fe('0x2'));var BPromise=require(_0x94fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94fe('0x4'));var db=require(_0x94fe('0x5'))['db'];var utils=require(_0x94fe('0x6'));var logger=require(_0x94fe('0x7'))(_0x94fe('0x8'));var config=require(_0x94fe('0x9'));var jayson=require(_0x94fe('0xa'));var client=jayson[_0x94fe('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cb7fd,_0x9118d1,_0x1ebd4d){return new BPromise(function(_0x3058c1,_0x8ab4a4){return client[_0x94fe('0xc')](_0x3cb7fd,_0x1ebd4d)[_0x94fe('0xd')](function(_0x42469e){logger[_0x94fe('0xe')](_0x94fe('0xf'),_0x9118d1,'request\x20sent');logger[_0x94fe('0x10')](_0x94fe('0x11'),_0x9118d1,_0x94fe('0x12'),JSON[_0x94fe('0x13')](_0x42469e));if(_0x42469e['error']){if(_0x42469e[_0x94fe('0x14')][_0x94fe('0x15')]===0x1f4){logger['error'](_0x94fe('0xf'),_0x9118d1,_0x42469e[_0x94fe('0x14')][_0x94fe('0x16')]);return _0x8ab4a4(_0x42469e[_0x94fe('0x14')][_0x94fe('0x16')]);}logger['error'](_0x94fe('0xf'),_0x9118d1,_0x42469e['error'][_0x94fe('0x16')]);return _0x3058c1(_0x42469e[_0x94fe('0x14')]['message']);}else{logger[_0x94fe('0xe')](_0x94fe('0xf'),_0x9118d1,_0x94fe('0x12'));_0x3058c1(_0x42469e[_0x94fe('0x17')][_0x94fe('0x16')]);}})['catch'](function(_0x3b93ee){logger[_0x94fe('0x14')](_0x94fe('0xf'),_0x9118d1,_0x3b93ee);_0x8ab4a4(_0x3b93ee);});});}exports[_0x94fe('0x18')]=function(_0x52a5c4){var _0xa83b5b=this;return new Promise(function(_0x3271b6,_0x1dc492){return db[_0x94fe('0x19')]['findAll']({'raw':_0x52a5c4['options']?_0x52a5c4[_0x94fe('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x52a5c4[_0x94fe('0x1a')]?_0x52a5c4['options'][_0x94fe('0x1b')]||null:null,'attributes':_0x52a5c4['options']?_0x52a5c4[_0x94fe('0x1a')][_0x94fe('0x1c')]||null:null,'limit':_0x52a5c4[_0x94fe('0x1a')]?_0x52a5c4['options'][_0x94fe('0x1d')]||null:null,'include':_0x52a5c4['options']?_0x52a5c4[_0x94fe('0x1a')][_0x94fe('0x1e')]?_[_0x94fe('0x1f')](_0x52a5c4[_0x94fe('0x1a')][_0x94fe('0x1e')],function(_0xdb51e6){return{'model':db[_0xdb51e6['model']],'as':_0xdb51e6['as'],'attributes':_0xdb51e6['attributes'],'include':_0xdb51e6[_0x94fe('0x1e')]?_['map'](_0xdb51e6[_0x94fe('0x1e')],function(_0x106aa3){return{'model':db[_0x106aa3['model']],'as':_0x106aa3['as'],'attributes':_0x106aa3[_0x94fe('0x1c')],'include':_0x106aa3[_0x94fe('0x1e')]?_[_0x94fe('0x1f')](_0x106aa3[_0x94fe('0x1e')],function(_0x6e516b){return{'model':db[_0x6e516b['model']],'as':_0x6e516b['as'],'attributes':_0x6e516b[_0x94fe('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x94fe('0xd')](function(_0x4b256b){logger[_0x94fe('0xe')](_0x94fe('0x18'),_0x52a5c4);logger[_0x94fe('0x10')](_0x94fe('0x18'),_0x52a5c4,JSON[_0x94fe('0x13')](_0x4b256b));_0x3271b6(_0x4b256b);})[_0x94fe('0x20')](function(_0x4f50fa){logger[_0x94fe('0x14')](_0x94fe('0x18'),_0x4f50fa[_0x94fe('0x16')],_0x52a5c4);_0x1dc492(_0xa83b5b['error'](0x1f4,_0x4f50fa[_0x94fe('0x16')]));});});};exports[_0x94fe('0x21')]=function(_0x30975e){var _0x18bee5=this;return new Promise(function(_0x5f5bad,_0x1514e2){return db[_0x94fe('0x19')]['update'](_0x30975e[_0x94fe('0x22')],{'raw':_0x30975e[_0x94fe('0x1a')]?_0x30975e['options'][_0x94fe('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30975e[_0x94fe('0x1a')]?_0x30975e['options'][_0x94fe('0x1b')]||null:null,'attributes':_0x30975e[_0x94fe('0x1a')]?_0x30975e[_0x94fe('0x1a')][_0x94fe('0x1c')]||null:null,'limit':_0x30975e[_0x94fe('0x1a')]?_0x30975e['options'][_0x94fe('0x1d')]||null:null})['then'](function(_0x463123){logger[_0x94fe('0xe')]('UpdateCmHopperBlack',_0x30975e);logger['debug']('UpdateCmHopperBlack',_0x30975e,JSON[_0x94fe('0x13')](_0x463123));_0x5f5bad(_0x463123);})[_0x94fe('0x20')](function(_0x5850c2){logger[_0x94fe('0x14')](_0x94fe('0x21'),_0x5850c2[_0x94fe('0x16')],_0x30975e);_0x1514e2(_0x18bee5['error'](0x1f4,_0x5850c2[_0x94fe('0x16')]));});});};exports['DestroyCmHopperBlack']=function(_0x4b72cf){var _0x4242a3=this;return new Promise(function(_0x23f61c,_0x204e6d){return db[_0x94fe('0x19')]['destroy']({'where':_0x4b72cf[_0x94fe('0x1a')]?_0x4b72cf[_0x94fe('0x1a')][_0x94fe('0x1b')]||null:null})[_0x94fe('0xd')](function(_0x2cf377){logger[_0x94fe('0xe')](_0x94fe('0x24'),_0x4b72cf);logger[_0x94fe('0x10')](_0x94fe('0x24'),_0x4b72cf,JSON[_0x94fe('0x13')](_0x2cf377));_0x23f61c(_0x2cf377);})[_0x94fe('0x20')](function(_0x5e1f9d){logger[_0x94fe('0x14')]('DestroyCmHopperBlack',_0x5e1f9d[_0x94fe('0x16')],_0x4b72cf);_0x204e6d(_0x4242a3[_0x94fe('0x14')](0x1f4,_0x5e1f9d[_0x94fe('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 43410c4..f5eaf4b 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 _0x430c=['exports','multer','connect-timeout','express','Router','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete'];(function(_0x5006ef,_0x2908ec){var _0x321cba=function(_0xf0be06){while(--_0xf0be06){_0x5006ef['push'](_0x5006ef['shift']());}};_0x321cba(++_0x2908ec);}(_0x430c,0x1a1));var _0xc430=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x430c[_0x19b3f9];return _0x18c3f6;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('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(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0xc')](_0xc430('0xa'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0xe')]('/:id',auth[_0xc430('0x8')](),controller['destroy']);module[_0xc430('0xf')]=router; \ No newline at end of file +var _0x7c09=['describe','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated'];(function(_0x13f597,_0x44ecc1){var _0x5e723f=function(_0x59cbb3){while(--_0x59cbb3){_0x13f597['push'](_0x13f597['shift']());}};_0x5e723f(++_0x44ecc1);}(_0x7c09,0x102));var _0x97c0=function(_0x5cca6d,_0x4638f2){_0x5cca6d=_0x5cca6d-0x0;var _0x5b3283=_0x7c09[_0x5cca6d];return _0x5b3283;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0x9')]('/:id',auth[_0x97c0('0xb')](),controller['show']);router[_0x97c0('0xd')](_0x97c0('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x97c0('0xf')](_0x97c0('0xe'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x10')]);module[_0x97c0('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 4bcfd0e..4b83a8f 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 _0xee29=['BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','diff'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee29,0x1e5));var _0x9ee2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee29[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9ee2('0x0'));var moment=require(_0x9ee2('0x1'));module[_0x9ee2('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9ee2('0x3')]},'scheduledat':{'type':Sequelize[_0x9ee2('0x4')]},'countbusyretry':{'type':Sequelize[_0x9ee2('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9ee2('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9ee2('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9ee2('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x9ee2('0x3')]},'calleridnum':{'type':Sequelize[_0x9ee2('0x3')]},'calleridname':{'type':Sequelize[_0x9ee2('0x3')]},'starttime':{'type':Sequelize[_0x9ee2('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x9ee2('0x4')]},'endtime':{'type':Sequelize[_0x9ee2('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9ee2('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9ee2('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9ee2('0x3')]},'campaign':{'type':Sequelize[_0x9ee2('0x3')]},'campaigntype':{'type':Sequelize[_0x9ee2('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x9ee2('0x3')]},'disposition':{'type':Sequelize[_0x9ee2('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9ee2('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x12987f){var _0x197c3c=this[_0x9ee2('0x6')](_0x9ee2('0x7'));if(_0x197c3c&&_0x12987f){this[_0x9ee2('0x8')]('followuptime',moment(_0x12987f)[_0x9ee2('0x9')](moment(_0x197c3c),'seconds'));}}},'amd':{'type':Sequelize[_0x9ee2('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9ee2('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9ee2('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9ee2('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9ee2('0x4')]},'callback':{'type':Sequelize[_0x9ee2('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9ee2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9ee2('0x4')]},'deleted':{'type':Sequelize[_0x9ee2('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x9ee2('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x9ee2('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9ee2('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9ee2('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6df4=['STRING','DATE','getDataValue','endtime','diff','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0x6df4,0x1f0));var _0x46df=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x6df4[_0x4ae829];return _0x256b31;};'use strict';var Sequelize=require(_0x46df('0x0'));var moment=require(_0x46df('0x1'));module[_0x46df('0x2')]={'state':{'type':Sequelize[_0x46df('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x46df('0x4')]},'scheduledat':{'type':Sequelize[_0x46df('0x5')]},'countbusyretry':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x46df('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x46df('0x4')]},'calleridnum':{'type':Sequelize[_0x46df('0x4')]},'calleridname':{'type':Sequelize[_0x46df('0x4')]},'starttime':{'type':Sequelize[_0x46df('0x5')]},'responsetime':{'type':Sequelize[_0x46df('0x5')]},'answertime':{'type':Sequelize[_0x46df('0x5')]},'droptime':{'type':Sequelize[_0x46df('0x5')]},'endtime':{'type':Sequelize[_0x46df('0x5')]},'ringtime':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x46df('0x4')]},'campaign':{'type':Sequelize[_0x46df('0x4')]},'campaigntype':{'type':Sequelize[_0x46df('0x4')]},'membername':{'type':Sequelize[_0x46df('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x46df('0x4')]},'secondDisposition':{'type':Sequelize[_0x46df('0x4')]},'thirdDisposition':{'type':Sequelize[_0x46df('0x4')]},'dispositionat':{'type':Sequelize[_0x46df('0x5')],'set':function(_0x17f2c9){var _0x2613e3=this[_0x46df('0x6')](_0x46df('0x7'));if(_0x2613e3&&_0x17f2c9){this['setDataValue']('followuptime',moment(_0x17f2c9)[_0x46df('0x8')](moment(_0x2613e3),'seconds'));}}},'amd':{'type':Sequelize[_0x46df('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x46df('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x46df('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x46df('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x46df('0x5')]},'callback':{'type':Sequelize[_0x46df('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x46df('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x46df('0x5')]},'deleted':{'type':Sequelize[_0x46df('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x46df('0x5')]},'recallme':{'type':Sequelize[_0x46df('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x46df('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x46df('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x46df('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 451c264..2d8e8dd 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 _0x53ec=['ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','name','send','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','noSuchContacts','`state`\x20=\x203,\x201,\x20null','dropContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','ContactId','VoiceQueueId','updatedAt','select','ANY_VALUE(calleridnum)','scheduledAt','field','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(ContactId)'];(function(_0x328165,_0x4cd951){var _0x17b7ca=function(_0x59136d){while(--_0x59136d){_0x328165['push'](_0x328165['shift']());}};_0x17b7ca(++_0x4cd951);}(_0x53ec,0x192));var _0xc53e=function(_0x208af9,_0x428504){_0x208af9=_0x208af9-0x0;var _0x34e94b=_0x53ec[_0x208af9];return _0x34e94b;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}exports['index']=function(_0x24a77e,_0x5112d2){var _0x5ce216={},_0x8f0ee6={},_0x6a62b0={'count':0x0,'rows':[]};var _0x42dec1=_[_0xc53e('0x28')](db[_0xc53e('0x29')][_0xc53e('0x2a')],function(_0x3280fe){return{'name':_0x3280fe[_0xc53e('0x2b')],'type':_0x3280fe['type'][_0xc53e('0x2c')]};});_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x28')](_0x42dec1,'name');_0x8f0ee6[_0xc53e('0x2e')]=_['keys'](_0x24a77e[_0xc53e('0x2e')]);_0x8f0ee6[_0xc53e('0x2f')]=_['intersection'](_0x8f0ee6['model'],_0x8f0ee6[_0xc53e('0x2e')]);_0x5ce216[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x8f0ee6[_0xc53e('0x2d')],qs[_0xc53e('0x32')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x5ce216[_0xc53e('0x30')]=_0x5ce216['attributes'][_0xc53e('0x33')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x2d')];if(!_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5ce216[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x24a77e[_0xc53e('0x2e')]['limit']);_0x5ce216[_0xc53e('0x1b')]=qs['offset'](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x1b')]);}_0x5ce216['order']=qs[_0xc53e('0x36')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x36')]);_0x5ce216['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x37')](_0x24a77e[_0xc53e('0x2e')],_0x8f0ee6[_0xc53e('0x2f')]),_0x42dec1);if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]){_0x5ce216[_0xc53e('0x39')]=_['merge'](_0x5ce216[_0xc53e('0x39')],{'$or':_[_0xc53e('0x28')](_0x42dec1,function(_0x2db711){if(_0x2db711['type']!==_0xc53e('0x3a')){var _0x5e8ab7={};_0x5e8ab7[_0x2db711[_0xc53e('0x26')]]={'$like':'%'+_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]+'%'};return _0x5e8ab7;}})});}_0x5ce216=_[_0xc53e('0x3b')]({},_0x5ce216,_0x24a77e[_0xc53e('0x3c')]);var _0x5507d0={'where':_0x5ce216[_0xc53e('0x39')]};return db[_0xc53e('0x29')]['count'](_0x5507d0)['then'](function(_0x5e9e15){_0x6a62b0['count']=_0x5e9e15;if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x5ce216['include']=[{'all':!![]}];}return db[_0xc53e('0x29')]['findAll'](_0x5ce216);})['then'](function(_0x53447e){_0x6a62b0[_0xc53e('0x3e')]=_0x53447e;return _0x6a62b0;})['then'](respondWithFilteredResult(_0x5112d2,_0x5ce216))['catch'](handleError(_0x5112d2,null));};exports[_0xc53e('0x3f')]=function(_0x53a82f,_0x422088){var _0x360af9={'raw':!![],'where':{'id':_0x53a82f[_0xc53e('0x40')]['id']}},_0x49f204={};_0x49f204[_0xc53e('0x2d')]=_['keys'](db[_0xc53e('0x29')]['rawAttributes']);_0x49f204['query']=_['keys'](_0x53a82f['query']);_0x49f204[_0xc53e('0x2f')]=_[_0xc53e('0x31')](_0x49f204[_0xc53e('0x2d')],_0x49f204['query']);_0x360af9[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x49f204['model'],qs['fields'](_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x360af9[_0xc53e('0x30')]=_0x360af9['attributes'][_0xc53e('0x33')]?_0x360af9[_0xc53e('0x30')]:_0x49f204[_0xc53e('0x2d')];if(_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x360af9[_0xc53e('0x41')]=[{'all':!![]}];}_0x360af9=_[_0xc53e('0x3b')]({},_0x360af9,_0x53a82f['options']);return db[_0xc53e('0x29')][_0xc53e('0x42')](_0x360af9)[_0xc53e('0x24')](handleEntityNotFound(_0x422088,null))['then'](respondWithResult(_0x422088,null))[_0xc53e('0x43')](handleError(_0x422088,null));};exports[_0xc53e('0x44')]=function(_0x4458c8,_0x15e744){return db[_0xc53e('0x29')][_0xc53e('0x44')]()['then'](respondWithResult(_0x15e744,null))[_0xc53e('0x43')](handleError(_0x15e744,null));};exports[_0xc53e('0x45')]=function(_0x39feea,_0x5a6e41){if(_0x39feea[_0xc53e('0x46')][_0xc53e('0x47')]){delete _0x39feea[_0xc53e('0x46')][_0xc53e('0x47')];}return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'uniqueid':_0x39feea[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x5a6e41,null))[_0xc53e('0x24')](saveUpdates(_0x39feea[_0xc53e('0x46')],null))['then'](respondWithResult(_0x5a6e41,null))[_0xc53e('0x43')](handleError(_0x5a6e41,null));};exports[_0xc53e('0x48')]=function(_0x38520c,_0x3d74ac,_0x136544){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x38520c[_0xc53e('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x4c')))),'noSuchContacts'],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db['sequelize'][_0xc53e('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0xc53e('0x4d')],[db[_0xc53e('0x4a')]['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')]['literal'](_0xc53e('0x4e')))),_0xc53e('0x4f')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x50')))),_0xc53e('0x51')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db[_0xc53e('0x4a')]['literal'](_0xc53e('0x52')))),'dropContacts'],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x53')))),_0xc53e('0x54')],[db['sequelize']['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db['sequelize']['literal'](_0xc53e('0x55')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db['sequelize'][_0xc53e('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0xc53e('0x56')]]})[_0xc53e('0x24')](handleEntityNotFound(_0x3d74ac,null))[_0xc53e('0x24')](respondWithResult(_0x3d74ac,null))[_0xc53e('0x43')](handleError(_0x3d74ac,null));};exports[_0xc53e('0x57')]=function(_0x4caf5f,_0x55e068,_0x4655b7){return db[_0xc53e('0x29')][_0xc53e('0x58')]({'raw':![],'where':{'CampaignId':_0x4caf5f[_0xc53e('0x40')]['id']},'attributes':[[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x4c')))),_0xc53e('0x59')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db[_0xc53e('0x4a')]['literal'](_0xc53e('0x5a')))),_0xc53e('0x4d')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x4e')))),'busyContacts'],[db['sequelize']['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x50')))),_0xc53e('0x51')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xc53e('0x52')))),_0xc53e('0x5b')],[db['sequelize']['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x53')))),_0xc53e('0x54')],[db['sequelize']['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x55')))),_0xc53e('0x5c')],[db[_0xc53e('0x4a')]['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x5d')))),'answeringMachine']]})[_0xc53e('0x24')](handleEntityNotFound(_0x55e068,null))[_0xc53e('0x24')](respondWithResult(_0x55e068,null))[_0xc53e('0x43')](handleError(_0x55e068,null));};exports[_0xc53e('0x5e')]=function(_0x32f954,_0x2d9803,_0x51638a){return db[_0xc53e('0x5f')][_0xc53e('0x42')]({'where':{'id':_0x32f954[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x2d9803,null))['then'](function(_0x5e1f4a){var _0x57edb;if(_0x5e1f4a){_0x57edb=squel[_0xc53e('0x60')]()[_0xc53e('0x61')](_0xc53e('0x62'))['fromQuery']([_0xc53e('0x63'),'scheduledAt',_0xc53e('0x64'),'ListId',_0xc53e('0x65'),'createdAt',_0xc53e('0x66')],squel[_0xc53e('0x67')]()['field'](_0xc53e('0x68'),_0xc53e('0x63'))['field']('NOW()',_0xc53e('0x69'))[_0xc53e('0x6a')]('ANY_VALUE(ContactId)','ContactId')[_0xc53e('0x6a')]('ANY_VALUE(ListId)',_0xc53e('0x6b'))['field'](_0xc53e('0x6c'),_0xc53e('0x65'))[_0xc53e('0x6a')](_0xc53e('0x6d'),_0xc53e('0x6e'))[_0xc53e('0x6a')](_0xc53e('0x6d'),_0xc53e('0x66'))[_0xc53e('0x6f')](_0xc53e('0x70'))['where'](_0xc53e('0x71'),_0x32f954['params']['id'][_0xc53e('0x72')]())[_0xc53e('0x39')](_0xc53e('0x73'),_0x32f954[_0xc53e('0x46')][_0xc53e('0x74')][_0xc53e('0x72')]())[_0xc53e('0x39')](_0xc53e('0x75'))[_0xc53e('0x39')](_0xc53e('0x76'),squel['select']()[_0xc53e('0x6a')]('phone')[_0xc53e('0x6f')](_0xc53e('0x62'))[_0xc53e('0x39')]('VoiceQueueId\x20=\x20?',_0x32f954[_0xc53e('0x40')]['id'][_0xc53e('0x72')]()))[_0xc53e('0x39')](_0xc53e('0x76'),squel[_0xc53e('0x67')]()['field'](_0xc53e('0x77'))[_0xc53e('0x6f')]('cm_hopper_final')[_0xc53e('0x39')](_0xc53e('0x71'),_0x32f954[_0xc53e('0x40')]['id']['toString']())[_0xc53e('0x39')](_0xc53e('0x78')))['group'](_0xc53e('0x64')))[_0xc53e('0x72')]();return db['sequelize']['query'](_0x57edb);}return[];})[_0xc53e('0x24')](respondWithResult(_0x2d9803,null))['catch'](handleError(_0x2d9803,null));};exports[_0xc53e('0x79')]=function(_0x3d2636,_0x263d97,_0x58684c){return db[_0xc53e('0x7a')][_0xc53e('0x42')]({'where':{'id':_0x3d2636[_0xc53e('0x40')]['id']}})['then'](handleEntityNotFound(_0x263d97,null))[_0xc53e('0x24')](function(_0x2e048a){var _0x1c24e6;if(_0x2e048a){_0x1c24e6=squel[_0xc53e('0x60')]()[_0xc53e('0x61')]('cm_hopper')[_0xc53e('0x7b')]([_0xc53e('0x63'),_0xc53e('0x69'),_0xc53e('0x64'),_0xc53e('0x6b'),_0xc53e('0x7c'),_0xc53e('0x6e'),_0xc53e('0x66')],squel[_0xc53e('0x67')]()['field'](_0xc53e('0x68'),_0xc53e('0x63'))[_0xc53e('0x6a')](_0xc53e('0x6d'),_0xc53e('0x69'))[_0xc53e('0x6a')](_0xc53e('0x7d'),_0xc53e('0x64'))[_0xc53e('0x6a')]('ANY_VALUE(ListId)',_0xc53e('0x6b'))[_0xc53e('0x6a')](_0xc53e('0x7e'),_0xc53e('0x7c'))['field'](_0xc53e('0x6d'),_0xc53e('0x6e'))[_0xc53e('0x6a')](_0xc53e('0x6d'),'updatedAt')[_0xc53e('0x6f')](_0xc53e('0x70'))[_0xc53e('0x39')](_0xc53e('0x7f'),_0x3d2636[_0xc53e('0x40')]['id'][_0xc53e('0x72')]())[_0xc53e('0x39')]('state\x20=\x20?',_0x3d2636[_0xc53e('0x46')]['state'][_0xc53e('0x72')]())[_0xc53e('0x39')](_0xc53e('0x75'))['where'](_0xc53e('0x76'),squel[_0xc53e('0x67')]()[_0xc53e('0x6a')]('phone')[_0xc53e('0x6f')](_0xc53e('0x62'))[_0xc53e('0x39')]('CampaignId\x20=\x20?',_0x3d2636[_0xc53e('0x40')]['id'][_0xc53e('0x72')]()))[_0xc53e('0x39')](_0xc53e('0x76'),squel[_0xc53e('0x67')]()['field']('calleridnum')['from'](_0xc53e('0x70'))[_0xc53e('0x39')](_0xc53e('0x7f'),_0x3d2636[_0xc53e('0x40')]['id']['toString']())[_0xc53e('0x39')]('state\x20=\x204'))[_0xc53e('0x80')](_0xc53e('0x64')))[_0xc53e('0x72')]();return db[_0xc53e('0x4a')]['query'](_0x1c24e6);}return[];})[_0xc53e('0x24')](respondWithResult(_0x263d97,null))[_0xc53e('0x43')](handleError(_0x263d97,null));};exports[_0xc53e('0x81')]=function(_0x352bc6,_0x67be18,_0x306343){return db[_0xc53e('0x82')][_0xc53e('0x83')]({'where':{'VoiceQueueId':_0x352bc6[_0xc53e('0x46')][_0xc53e('0x65')],'CampaignId':_0x352bc6[_0xc53e('0x46')][_0xc53e('0x7c')],'ContactId':_0x352bc6[_0xc53e('0x46')][_0xc53e('0x64')]}})[_0xc53e('0x24')](handleEntityNotFound(_0x67be18,null))[_0xc53e('0x24')](function(_0x3dc1be){if(_0x3dc1be){return _0x3dc1be;}return null;})[_0xc53e('0x24')](respondWithResult(_0x67be18,null))[_0xc53e('0x43')](handleError(_0x67be18,null));}; \ No newline at end of file +var _0x7a54=['calleridnum\x20NOT\x20IN\x20(?)','calleridnum','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','group','checkContactHopper','findOne','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','CmHopperFinal','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','uniqueid','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL'];(function(_0x473544,_0x43977b){var _0x1fab25=function(_0x563c15){while(--_0x563c15){_0x473544['push'](_0x473544['shift']());}};_0x1fab25(++_0x43977b);}(_0x7a54,0x106));var _0x47a5=function(_0x37e133,_0x30002b){_0x37e133=_0x37e133-0x0;var _0x2e792a=_0x7a54[_0x37e133];return _0x2e792a;};'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['CmHopperFinal'][_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['CmHopperFinal']['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['describe']=function(_0x2d38de,_0x23bb04){return db['CmHopperFinal']['describe']()[_0x47a5('0x23')](respondWithResult(_0x23bb04,null))['catch'](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0xd93e37,_0x54c35f){if(_0xd93e37['body'][_0x47a5('0x47')]){delete _0xd93e37['body'][_0x47a5('0x47')];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'uniqueid':_0xd93e37[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x54c35f,null))[_0x47a5('0x23')](saveUpdates(_0xd93e37[_0x47a5('0x48')],null))['then'](respondWithResult(_0x54c35f,null))['catch'](handleError(_0x54c35f,null));};exports[_0x47a5('0x49')]=function(_0x411230,_0x1163e3,_0x9ea93e){return db[_0x47a5('0x2a')][_0x47a5('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x411230[_0x47a5('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x4c')))),'noSuchContacts'],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x4d')))),_0x47a5('0x4e')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x47a5('0x50')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),_0x47a5('0x51')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x52')))),'dropContacts'],[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x47a5('0x53')))),'abandonedContacts'],[db[_0x47a5('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x2022,\x201,\x20null'))),_0x47a5('0x54')],[db[_0x47a5('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x55')))),_0x47a5('0x56')]]})['then'](handleEntityNotFound(_0x1163e3,null))[_0x47a5('0x23')](respondWithResult(_0x1163e3,null))[_0x47a5('0x46')](handleError(_0x1163e3,null));};exports[_0x47a5('0x57')]=function(_0x5a33b8,_0x30ea7a,_0x4db625){return db[_0x47a5('0x2a')][_0x47a5('0x3e')]({'raw':![],'where':{'CampaignId':_0x5a33b8[_0x47a5('0x41')]['id']},'attributes':[[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x47a5('0x4e')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x58')))),'busyContacts'],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x59')))),_0x47a5('0x51')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x52')))),_0x47a5('0x5a')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db['sequelize'][_0x47a5('0x4f')](_0x47a5('0x53')))),_0x47a5('0x5b')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x5c')))),_0x47a5('0x54')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x47a5('0x56')]]})[_0x47a5('0x23')](handleEntityNotFound(_0x30ea7a,null))[_0x47a5('0x23')](respondWithResult(_0x30ea7a,null))['catch'](handleError(_0x30ea7a,null));};exports[_0x47a5('0x5d')]=function(_0x2e46af,_0x36c67,_0x26f1ac){return db['VoiceQueue'][_0x47a5('0x45')]({'where':{'id':_0x2e46af['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x36c67,null))['then'](function(_0x43f649){var _0x4cf7c5;if(_0x43f649){_0x4cf7c5=squel[_0x47a5('0x5e')]()[_0x47a5('0x5f')](_0x47a5('0x60'))['fromQuery'](['phone','scheduledAt',_0x47a5('0x61'),_0x47a5('0x62'),_0x47a5('0x63'),_0x47a5('0x64'),'updatedAt'],squel[_0x47a5('0x65')]()[_0x47a5('0x66')](_0x47a5('0x67'),_0x47a5('0x68'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x6a'))[_0x47a5('0x66')](_0x47a5('0x6b'),_0x47a5('0x61'))[_0x47a5('0x66')](_0x47a5('0x6c'),'ListId')[_0x47a5('0x66')]('ANY_VALUE(VoiceQueueId)',_0x47a5('0x63'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x64'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x6d'))[_0x47a5('0x6e')](_0x47a5('0x6f'))[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id'][_0x47a5('0x71')]())[_0x47a5('0x38')](_0x47a5('0x72'),_0x2e46af['body']['state']['toString']())['where'](_0x47a5('0x73'))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x47a5('0x65')]()[_0x47a5('0x66')](_0x47a5('0x68'))[_0x47a5('0x6e')](_0x47a5('0x60'))[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id'][_0x47a5('0x71')]()))[_0x47a5('0x38')](_0x47a5('0x74'),squel['select']()[_0x47a5('0x66')](_0x47a5('0x75'))[_0x47a5('0x6e')]('cm_hopper_final')[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id']['toString']())[_0x47a5('0x38')]('state\x20=\x204'))['group'](_0x47a5('0x61')))[_0x47a5('0x71')]();return db[_0x47a5('0x4b')][_0x47a5('0x2f')](_0x4cf7c5);}return[];})[_0x47a5('0x23')](respondWithResult(_0x36c67,null))[_0x47a5('0x46')](handleError(_0x36c67,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x592322,_0x3e0dbd,_0x4f2361){return db[_0x47a5('0x76')][_0x47a5('0x45')]({'where':{'id':_0x592322[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x3e0dbd,null))['then'](function(_0x3c66e3){var _0x550bde;if(_0x3c66e3){_0x550bde=squel['insert']()[_0x47a5('0x5f')](_0x47a5('0x60'))['fromQuery']([_0x47a5('0x68'),_0x47a5('0x6a'),_0x47a5('0x61'),'ListId',_0x47a5('0x77'),'createdAt',_0x47a5('0x6d')],squel[_0x47a5('0x65')]()[_0x47a5('0x66')]('ANY_VALUE(calleridnum)',_0x47a5('0x68'))[_0x47a5('0x66')](_0x47a5('0x69'),'scheduledAt')[_0x47a5('0x66')]('ANY_VALUE(ContactId)',_0x47a5('0x61'))['field'](_0x47a5('0x6c'),_0x47a5('0x62'))[_0x47a5('0x66')](_0x47a5('0x78'),'CampaignId')[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x64'))[_0x47a5('0x66')](_0x47a5('0x69'),'updatedAt')['from'](_0x47a5('0x6f'))['where'](_0x47a5('0x79'),_0x592322[_0x47a5('0x41')]['id'][_0x47a5('0x71')]())['where'](_0x47a5('0x72'),_0x592322[_0x47a5('0x48')]['state'][_0x47a5('0x71')]())[_0x47a5('0x38')](_0x47a5('0x73'))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x47a5('0x66')](_0x47a5('0x68'))['from'](_0x47a5('0x60'))[_0x47a5('0x38')]('CampaignId\x20=\x20?',_0x592322[_0x47a5('0x41')]['id'][_0x47a5('0x71')]()))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x47a5('0x65')]()['field'](_0x47a5('0x75'))['from'](_0x47a5('0x6f'))[_0x47a5('0x38')]('CampaignId\x20=\x20?',_0x592322[_0x47a5('0x41')]['id']['toString']())[_0x47a5('0x38')](_0x47a5('0x7a')))[_0x47a5('0x7b')](_0x47a5('0x61')))['toString']();return db[_0x47a5('0x4b')]['query'](_0x550bde);}return[];})['then'](respondWithResult(_0x3e0dbd,null))[_0x47a5('0x46')](handleError(_0x3e0dbd,null));};exports[_0x47a5('0x7c')]=function(_0x352238,_0x96fb22,_0x380c8b){return db['CmHopper'][_0x47a5('0x7d')]({'where':{'VoiceQueueId':_0x352238[_0x47a5('0x48')][_0x47a5('0x63')],'CampaignId':_0x352238[_0x47a5('0x48')]['CampaignId'],'ContactId':_0x352238[_0x47a5('0x48')]['ContactId']}})[_0x47a5('0x23')](handleEntityNotFound(_0x96fb22,null))[_0x47a5('0x23')](function(_0x3f93f0){if(_0x3f93f0){return _0x3f93f0;}return null;})[_0x47a5('0x23')](respondWithResult(_0x96fb22,null))[_0x47a5('0x46')](handleError(_0x96fb22,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 0a0cfeb..0faea05 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 _0x0408=['CmHopperFinal','calleridnum','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x0408,0x115));var _0x8040=function(_0x3aa13e,_0x4c5367){_0x3aa13e=_0x3aa13e-0x0;var _0x490e7b=_0x0408[_0x3aa13e];return _0x490e7b;};'use strict';var _=require(_0x8040('0x0'));var util=require(_0x8040('0x1'));var logger=require(_0x8040('0x2'))('api');var moment=require(_0x8040('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8040('0x4'));var rimraf=require(_0x8040('0x5'));var config=require(_0x8040('0x6'));var attributes=require(_0x8040('0x7'));module[_0x8040('0x8')]=function(_0xd73734,_0x1aaead){return _0xd73734['define'](_0x8040('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x8040('0xa'),'fields':[_0x8040('0xa')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd74a=['../../config/logger','api','moment','bluebird','rimraf','./cmHopperFinal.attributes','exports','define','calleridnum','uniqueid','lodash','util'];(function(_0x5eba91,_0x765977){var _0x52d038=function(_0x15e1e9){while(--_0x15e1e9){_0x5eba91['push'](_0x5eba91['shift']());}};_0x52d038(++_0x765977);}(_0xd74a,0x1d2));var _0xad74=function(_0x5a02a3,_0x5c346b){_0x5a02a3=_0x5a02a3-0x0;var _0x2ec097=_0xd74a[_0x5a02a3];return _0x2ec097;};'use strict';var _=require(_0xad74('0x0'));var util=require(_0xad74('0x1'));var logger=require(_0xad74('0x2'))(_0xad74('0x3'));var moment=require(_0xad74('0x4'));var BPromise=require(_0xad74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xad74('0x6'));var config=require('../../config/environment');var attributes=require(_0xad74('0x7'));module[_0xad74('0x8')]=function(_0x3dc7d7,_0x37ec4c){return _0x3dc7d7[_0xad74('0x9')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xad74('0xa'),'fields':[_0xad74('0xa')]},{'name':'uniqueid','fields':[_0xad74('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index ba851e0..59d31f2 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x47893f,_0x23ef19){var _0x6aa5fb=function(_0x344d98){while(--_0x344d98){_0x47893f['push'](_0x47893f['shift']());}};_0x6aa5fb(++_0x23ef19);}(_0x7a54,0x106));var _0x47a5=function(_0x4a1638,_0x182d15){_0x4a1638=_0x4a1638-0x0;var _0x2b2696=_0x7a54[_0x4a1638];return _0x2b2696;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x11e127,_0x371404){var _0x268b66=function(_0x53ccd7){while(--_0x53ccd7){_0x11e127['push'](_0x11e127['shift']());}};_0x268b66(++_0x371404);}(_0x7a54,0x106));var _0x47a5=function(_0x425943,_0x3068a8){_0x425943=_0x425943-0x0;var _0x5c13af=_0x7a54[_0x425943];return _0x5c13af;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 68e468d..ed13f29 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 _0xf712=['/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','/:id','update','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe','show','countContactsQueueCampaignHopperFinal'];(function(_0x5e5690,_0x307b61){var _0xd61930=function(_0x15fb08){while(--_0x15fb08){_0x5e5690['push'](_0x5e5690['shift']());}};_0xd61930(++_0x307b61);}(_0xf712,0x195));var _0x2f71=function(_0x146fbe,_0x14fb2a){_0x146fbe=_0x146fbe-0x0;var _0x5eb5db=_0xf712[_0x146fbe];return _0x5eb5db;};'use strict';var multer=require(_0x2f71('0x0'));var util=require(_0x2f71('0x1'));var path=require(_0x2f71('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2f71('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2f71('0x4'));var config=require(_0x2f71('0x5'));var controller=require(_0x2f71('0x6'));router[_0x2f71('0x7')]('/',auth[_0x2f71('0x8')](),controller[_0x2f71('0x9')]);router[_0x2f71('0x7')]('/describe',auth[_0x2f71('0x8')](),controller[_0x2f71('0xa')]);router[_0x2f71('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2f71('0xb')]);router['get']('/voice/queue/countAttributes/:id',auth[_0x2f71('0x8')](),controller[_0x2f71('0xc')]);router[_0x2f71('0x7')](_0x2f71('0xd'),auth[_0x2f71('0x8')](),controller[_0x2f71('0xe')]);router[_0x2f71('0xf')](_0x2f71('0x10'),auth[_0x2f71('0x8')](),controller[_0x2f71('0x11')]);router[_0x2f71('0xf')]('/voice/campaign/moveContacts/:id',auth[_0x2f71('0x8')](),controller[_0x2f71('0x12')]);router[_0x2f71('0xf')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x2f71('0x13')]);router['put'](_0x2f71('0x14'),auth[_0x2f71('0x8')](),controller[_0x2f71('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5e3b=['fs-extra','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','multer','util','path','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5e3b,0x79));var _0xb5e3=function(_0x3c66b7,_0x4abef0){_0x3c66b7=_0x3c66b7-0x0;var _0xb32821=_0x5e3b[_0x3c66b7];return _0xb32821;};'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('0x7')](_0xb5e3('0xd'),auth[_0xb5e3('0x8')](),controller[_0xb5e3('0xe')]);router[_0xb5e3('0x7')](_0xb5e3('0xf'),auth['isAuthenticated'](),controller[_0xb5e3('0x10')]);router[_0xb5e3('0x11')](_0xb5e3('0x12'),auth[_0xb5e3('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0xb5e3('0x13'),auth[_0xb5e3('0x8')](),controller[_0xb5e3('0x14')]);router[_0xb5e3('0x11')](_0xb5e3('0x15'),auth[_0xb5e3('0x8')](),controller[_0xb5e3('0x16')]);router[_0xb5e3('0x17')](_0xb5e3('0xc'),auth['isAuthenticated'](),controller['update']);module[_0xb5e3('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 405c77f..b8b28fd 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 _0x7948=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x2b3fd2,_0x50d5b4){var _0x12c68f=function(_0x428f82){while(--_0x428f82){_0x2b3fd2['push'](_0x2b3fd2['shift']());}};_0x12c68f(++_0x50d5b4);}(_0x7948,0x144));var _0x8794=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0x7948[_0x4d7379];return _0x46d7cf;};'use strict';var Sequelize=require(_0x8794('0x0'));module[_0x8794('0x1')]={'state':{'type':Sequelize[_0x8794('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8794('0x3')]},'scheduledat':{'type':Sequelize[_0x8794('0x4')]},'countbusyretry':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x8794('0x3')]},'calleridnum':{'type':Sequelize[_0x8794('0x3')]},'calleridname':{'type':Sequelize[_0x8794('0x3')]},'starttime':{'type':Sequelize[_0x8794('0x4')]},'responsetime':{'type':Sequelize[_0x8794('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x8794('0x4')]},'ringtime':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8794('0x3')]},'campaign':{'type':Sequelize[_0x8794('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8794('0x3')]},'reason':{'type':Sequelize[_0x8794('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x8794('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x8794('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8794('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8794('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x8794('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8794('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8794('0x3')]}}; \ No newline at end of file +var _0x4d45=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4d45,0x19a));var _0x54d4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4d45[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x54d4('0x0'));module[_0x54d4('0x1')]={'state':{'type':Sequelize[_0x54d4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x54d4('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x54d4('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x54d4('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x54d4('0x3')]},'calleridname':{'type':Sequelize[_0x54d4('0x3')]},'starttime':{'type':Sequelize[_0x54d4('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x54d4('0x4')]},'endtime':{'type':Sequelize[_0x54d4('0x4')]},'ringtime':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x54d4('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x54d4('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x54d4('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x54d4('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x54d4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x54d4('0x4')]},'recallme':{'type':Sequelize[_0x54d4('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x54d4('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x54d4('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x54d4('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 2649ee6..0387620 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 _0x6a26=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','length','includeAll','find','create','describe','body','uniqueid','params','rimraf','zip-dir'];(function(_0x54fbcb,_0x21a10f){var _0x58e047=function(_0x479960){while(--_0x479960){_0x54fbcb['push'](_0x54fbcb['shift']());}};_0x58e047(++_0x21a10f);}(_0x6a26,0xdf));var _0x66a2=function(_0x25476c,_0x47bb86){_0x25476c=_0x25476c-0x0;var _0x4df1f4=_0x6a26[_0x25476c];return _0x4df1f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x66a2('0x0'));var zipdir=require(_0x66a2('0x1'));var jsonpatch=require(_0x66a2('0x2'));var rp=require(_0x66a2('0x3'));var moment=require(_0x66a2('0x4'));var BPromise=require(_0x66a2('0x5'));var Mustache=require(_0x66a2('0x6'));var util=require(_0x66a2('0x7'));var path=require(_0x66a2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x66a2('0x9'));var fs=require('fs');var fs_extra=require(_0x66a2('0xa'));var _=require(_0x66a2('0xb'));var squel=require(_0x66a2('0xc'));var crypto=require(_0x66a2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x66a2('0xe'));var toCsv=require(_0x66a2('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x66a2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x66a2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x66a2('0x12'));var config=require(_0x66a2('0x13'));var licenseUtil=require(_0x66a2('0x14'));var db=require(_0x66a2('0x15'))['db'];function respondWithStatusCode(_0x23696e,_0x23ac73){_0x23ac73=_0x23ac73||0xcc;return function(_0x254efe){if(_0x254efe){return _0x23696e[_0x66a2('0x16')](_0x23ac73);}return _0x23696e[_0x66a2('0x17')](_0x23ac73)[_0x66a2('0x18')]();};}function respondWithResult(_0x352b9a,_0x4b5651){_0x4b5651=_0x4b5651||0xc8;return function(_0x510881){if(_0x510881){return _0x352b9a[_0x66a2('0x17')](_0x4b5651)[_0x66a2('0x19')](_0x510881);}};}function respondWithFilteredResult(_0xb6998,_0x1f0cc5){return function(_0x8ed0c2){if(_0x8ed0c2){var _0x52b98a=typeof _0x1f0cc5[_0x66a2('0x1a')]===_0x66a2('0x1b')&&typeof _0x1f0cc5[_0x66a2('0x1c')]===_0x66a2('0x1b');var _0x567abd=_0x8ed0c2[_0x66a2('0x1d')];var _0x2c7009=_0x52b98a?0x0:_0x1f0cc5[_0x66a2('0x1a')];var _0x328acf=_0x52b98a?_0x8ed0c2[_0x66a2('0x1d')]:_0x1f0cc5[_0x66a2('0x1a')]+_0x1f0cc5['limit'];var _0x350491;if(_0x328acf>=_0x567abd){_0x328acf=_0x567abd;_0x350491=0xc8;}else{_0x350491=0xce;}_0xb6998['status'](_0x350491);return _0xb6998[_0x66a2('0x1e')](_0x66a2('0x1f'),_0x2c7009+'-'+_0x328acf+'/'+_0x567abd)[_0x66a2('0x19')](_0x8ed0c2);}return null;};}function patchUpdates(_0x8d3062){return function(_0x34a70e){try{jsonpatch[_0x66a2('0x20')](_0x34a70e,_0x8d3062,!![]);}catch(_0x2567b8){return BPromise[_0x66a2('0x21')](_0x2567b8);}return _0x34a70e['save']();};}function saveUpdates(_0x4a4848,_0x212355){return function(_0x5a339e){if(_0x5a339e){return _0x5a339e[_0x66a2('0x22')](_0x4a4848)['then'](function(_0xe1a431){return _0xe1a431;});}return null;};}function removeEntity(_0x56a378,_0x2c89ee){return function(_0x2d7013){if(_0x2d7013){return _0x2d7013[_0x66a2('0x23')]()[_0x66a2('0x24')](function(){_0x56a378['status'](0xcc)[_0x66a2('0x18')]();});}};}function handleEntityNotFound(_0x25cfac,_0x557ac6){return function(_0x2f2cdb){if(!_0x2f2cdb){_0x25cfac[_0x66a2('0x16')](0x194);}return _0x2f2cdb;};}function handleError(_0x466167,_0x44c9af){_0x44c9af=_0x44c9af||0x1f4;return function(_0x3cb7fa){logger[_0x66a2('0x25')](_0x3cb7fa[_0x66a2('0x26')]);if(_0x3cb7fa[_0x66a2('0x27')]){delete _0x3cb7fa['name'];}_0x466167[_0x66a2('0x17')](_0x44c9af)['send'](_0x3cb7fa);};}exports[_0x66a2('0x28')]=function(_0x485ec6,_0xb66fa9){var _0x434529={},_0x426e78={},_0xf405fd={'count':0x0,'rows':[]};var _0x4a706e=_[_0x66a2('0x29')](db[_0x66a2('0x2a')][_0x66a2('0x2b')],function(_0x42dd29){return{'name':_0x42dd29[_0x66a2('0x2c')],'type':_0x42dd29[_0x66a2('0x2d')]['key']};});_0x426e78[_0x66a2('0x2e')]=_[_0x66a2('0x29')](_0x4a706e,'name');_0x426e78[_0x66a2('0x2f')]=_[_0x66a2('0x30')](_0x485ec6[_0x66a2('0x2f')]);_0x426e78[_0x66a2('0x31')]=_[_0x66a2('0x32')](_0x426e78['model'],_0x426e78[_0x66a2('0x2f')]);_0x434529[_0x66a2('0x33')]=_['intersection'](_0x426e78[_0x66a2('0x2e')],qs[_0x66a2('0x34')](_0x485ec6[_0x66a2('0x2f')][_0x66a2('0x34')]));_0x434529[_0x66a2('0x33')]=_0x434529['attributes']['length']?_0x434529[_0x66a2('0x33')]:_0x426e78[_0x66a2('0x2e')];if(!_0x485ec6['query'][_0x66a2('0x35')](_0x66a2('0x36'))){_0x434529[_0x66a2('0x1c')]=qs['limit'](_0x485ec6[_0x66a2('0x2f')][_0x66a2('0x1c')]);_0x434529['offset']=qs[_0x66a2('0x1a')](_0x485ec6[_0x66a2('0x2f')]['offset']);}_0x434529[_0x66a2('0x37')]=qs[_0x66a2('0x38')](_0x485ec6[_0x66a2('0x2f')]['sort']);_0x434529[_0x66a2('0x39')]=qs[_0x66a2('0x31')](_[_0x66a2('0x3a')](_0x485ec6[_0x66a2('0x2f')],_0x426e78['filters']),_0x4a706e);if(_0x485ec6['query'][_0x66a2('0x3b')]){_0x434529['where']=_[_0x66a2('0x3c')](_0x434529[_0x66a2('0x39')],{'$or':_['map'](_0x4a706e,function(_0x23e5c5){if(_0x23e5c5[_0x66a2('0x2d')]!==_0x66a2('0x3d')){var _0x3cf233={};_0x3cf233[_0x23e5c5['name']]={'$like':'%'+_0x485ec6[_0x66a2('0x2f')]['filter']+'%'};return _0x3cf233;}})});}_0x434529=_[_0x66a2('0x3c')]({},_0x434529,_0x485ec6[_0x66a2('0x3e')]);var _0x4cc824={'where':_0x434529[_0x66a2('0x39')]};return db[_0x66a2('0x2a')]['count'](_0x4cc824)[_0x66a2('0x24')](function(_0x3df98c){_0xf405fd[_0x66a2('0x1d')]=_0x3df98c;if(_0x485ec6[_0x66a2('0x2f')]['includeAll']){_0x434529[_0x66a2('0x3f')]=[{'all':!![]}];}return db[_0x66a2('0x2a')][_0x66a2('0x40')](_0x434529);})[_0x66a2('0x24')](function(_0x461ac2){_0xf405fd['rows']=_0x461ac2;return _0xf405fd;})[_0x66a2('0x24')](respondWithFilteredResult(_0xb66fa9,_0x434529))[_0x66a2('0x41')](handleError(_0xb66fa9,null));};exports[_0x66a2('0x42')]=function(_0x3a789f,_0x12d6ef){var _0x55d7df={'raw':!![],'where':{'id':_0x3a789f['params']['id']}},_0x564f92={};_0x564f92[_0x66a2('0x2e')]=_[_0x66a2('0x30')](db[_0x66a2('0x2a')][_0x66a2('0x2b')]);_0x564f92[_0x66a2('0x2f')]=_['keys'](_0x3a789f['query']);_0x564f92[_0x66a2('0x31')]=_['intersection'](_0x564f92[_0x66a2('0x2e')],_0x564f92['query']);_0x55d7df['attributes']=_[_0x66a2('0x32')](_0x564f92['model'],qs['fields'](_0x3a789f[_0x66a2('0x2f')][_0x66a2('0x34')]));_0x55d7df[_0x66a2('0x33')]=_0x55d7df[_0x66a2('0x33')][_0x66a2('0x43')]?_0x55d7df[_0x66a2('0x33')]:_0x564f92[_0x66a2('0x2e')];if(_0x3a789f[_0x66a2('0x2f')][_0x66a2('0x44')]){_0x55d7df[_0x66a2('0x3f')]=[{'all':!![]}];}_0x55d7df=_['merge']({},_0x55d7df,_0x3a789f[_0x66a2('0x3e')]);return db[_0x66a2('0x2a')][_0x66a2('0x45')](_0x55d7df)[_0x66a2('0x24')](handleEntityNotFound(_0x12d6ef,null))[_0x66a2('0x24')](respondWithResult(_0x12d6ef,null))['catch'](handleError(_0x12d6ef,null));};exports[_0x66a2('0x46')]=function(_0x551472,_0x457a18){return db[_0x66a2('0x2a')][_0x66a2('0x46')](_0x551472['body'],{})['then'](respondWithResult(_0x457a18,0xc9))[_0x66a2('0x41')](handleError(_0x457a18,null));};exports[_0x66a2('0x47')]=function(_0x1c31c0,_0x401052){return db[_0x66a2('0x2a')][_0x66a2('0x47')]()[_0x66a2('0x24')](respondWithResult(_0x401052,null))[_0x66a2('0x41')](handleError(_0x401052,null));};exports['update']=function(_0x4d9472,_0x1acfad){if(_0x4d9472[_0x66a2('0x48')]['uniqueid']){delete _0x4d9472[_0x66a2('0x48')][_0x66a2('0x49')];}return db[_0x66a2('0x2a')][_0x66a2('0x45')]({'where':{'uniqueid':_0x4d9472[_0x66a2('0x4a')]['id']}})[_0x66a2('0x24')](handleEntityNotFound(_0x1acfad,null))[_0x66a2('0x24')](saveUpdates(_0x4d9472[_0x66a2('0x48')],null))['then'](respondWithResult(_0x1acfad,null))['catch'](handleError(_0x1acfad,null));}; \ No newline at end of file +var _0xc151=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','find','create','describe','update','body','uniqueid','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0xc151,0x91));var _0x1c15=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc151[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x1c15('0x0'));var rimraf=require(_0x1c15('0x1'));var zipdir=require(_0x1c15('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c15('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1c15('0x4'));var path=require(_0x1c15('0x5'));var sox=require(_0x1c15('0x6'));var csv=require(_0x1c15('0x7'));var ejs=require(_0x1c15('0x8'));var fs=require('fs');var fs_extra=require(_0x1c15('0x9'));var _=require(_0x1c15('0xa'));var squel=require(_0x1c15('0xb'));var crypto=require(_0x1c15('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1c15('0xd'));var toCsv=require(_0x1c15('0x7'));var querystring=require(_0x1c15('0xe'));var Papa=require(_0x1c15('0xf'));var Redis=require(_0x1c15('0x10'));var authService=require(_0x1c15('0x11'));var qs=require(_0x1c15('0x12'));var as=require(_0x1c15('0x13'));var hardwareService=require(_0x1c15('0x14'));var logger=require(_0x1c15('0x15'))(_0x1c15('0x16'));var utils=require(_0x1c15('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1c15('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23707b,_0x27c412){_0x27c412=_0x27c412||0xcc;return function(_0x8efe3a){if(_0x8efe3a){return _0x23707b[_0x1c15('0x19')](_0x27c412);}return _0x23707b['status'](_0x27c412)['end']();};}function respondWithResult(_0x2716a2,_0x42eb14){_0x42eb14=_0x42eb14||0xc8;return function(_0x376f45){if(_0x376f45){return _0x2716a2[_0x1c15('0x1a')](_0x42eb14)[_0x1c15('0x1b')](_0x376f45);}};}function respondWithFilteredResult(_0x4676ec,_0x3ee0ff){return function(_0x320b41){if(_0x320b41){var _0x5a3e14=typeof _0x3ee0ff[_0x1c15('0x1c')]==='undefined'&&typeof _0x3ee0ff[_0x1c15('0x1d')]===_0x1c15('0x1e');var _0x4f0a3e=_0x320b41[_0x1c15('0x1f')];var _0x4fd75a=_0x5a3e14?0x0:_0x3ee0ff[_0x1c15('0x1c')];var _0x473eaf=_0x5a3e14?_0x320b41[_0x1c15('0x1f')]:_0x3ee0ff[_0x1c15('0x1c')]+_0x3ee0ff[_0x1c15('0x1d')];var _0x1bb3d5;if(_0x473eaf>=_0x4f0a3e){_0x473eaf=_0x4f0a3e;_0x1bb3d5=0xc8;}else{_0x1bb3d5=0xce;}_0x4676ec[_0x1c15('0x1a')](_0x1bb3d5);return _0x4676ec[_0x1c15('0x20')](_0x1c15('0x21'),_0x4fd75a+'-'+_0x473eaf+'/'+_0x4f0a3e)[_0x1c15('0x1b')](_0x320b41);}return null;};}function patchUpdates(_0x2fdc10){return function(_0x87ec28){try{jsonpatch[_0x1c15('0x22')](_0x87ec28,_0x2fdc10,!![]);}catch(_0x39a574){return BPromise['reject'](_0x39a574);}return _0x87ec28[_0x1c15('0x23')]();};}function saveUpdates(_0x512a70,_0x438977){return function(_0x5bb079){if(_0x5bb079){return _0x5bb079['update'](_0x512a70)['then'](function(_0x28ea6e){return _0x28ea6e;});}return null;};}function removeEntity(_0x507d70,_0x366b64){return function(_0x33a0be){if(_0x33a0be){return _0x33a0be['destroy']()[_0x1c15('0x24')](function(){_0x507d70[_0x1c15('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x352af1,_0x5d56ae){return function(_0x5f0080){if(!_0x5f0080){_0x352af1[_0x1c15('0x19')](0x194);}return _0x5f0080;};}function handleError(_0x59b9de,_0x52c391){_0x52c391=_0x52c391||0x1f4;return function(_0x14e8de){logger[_0x1c15('0x25')](_0x14e8de[_0x1c15('0x26')]);if(_0x14e8de[_0x1c15('0x27')]){delete _0x14e8de['name'];}_0x59b9de['status'](_0x52c391)[_0x1c15('0x28')](_0x14e8de);};}exports[_0x1c15('0x29')]=function(_0x4d6be0,_0x16c81a){var _0x1521b7={},_0x12c35e={},_0x405161={'count':0x0,'rows':[]};var _0x2fb73a=_[_0x1c15('0x2a')](db['CmHopperHistory']['rawAttributes'],function(_0x4b3bbd){return{'name':_0x4b3bbd[_0x1c15('0x2b')],'type':_0x4b3bbd[_0x1c15('0x2c')]['key']};});_0x12c35e['model']=_[_0x1c15('0x2a')](_0x2fb73a,_0x1c15('0x27'));_0x12c35e[_0x1c15('0x2d')]=_[_0x1c15('0x2e')](_0x4d6be0[_0x1c15('0x2d')]);_0x12c35e[_0x1c15('0x2f')]=_[_0x1c15('0x30')](_0x12c35e[_0x1c15('0x31')],_0x12c35e['query']);_0x1521b7[_0x1c15('0x32')]=_[_0x1c15('0x30')](_0x12c35e[_0x1c15('0x31')],qs[_0x1c15('0x33')](_0x4d6be0[_0x1c15('0x2d')]['fields']));_0x1521b7[_0x1c15('0x32')]=_0x1521b7[_0x1c15('0x32')][_0x1c15('0x34')]?_0x1521b7[_0x1c15('0x32')]:_0x12c35e[_0x1c15('0x31')];if(!_0x4d6be0[_0x1c15('0x2d')][_0x1c15('0x35')](_0x1c15('0x36'))){_0x1521b7[_0x1c15('0x1d')]=qs[_0x1c15('0x1d')](_0x4d6be0[_0x1c15('0x2d')][_0x1c15('0x1d')]);_0x1521b7[_0x1c15('0x1c')]=qs['offset'](_0x4d6be0[_0x1c15('0x2d')][_0x1c15('0x1c')]);}_0x1521b7[_0x1c15('0x37')]=qs['sort'](_0x4d6be0['query'][_0x1c15('0x38')]);_0x1521b7['where']=qs['filters'](_[_0x1c15('0x39')](_0x4d6be0[_0x1c15('0x2d')],_0x12c35e['filters']),_0x2fb73a);if(_0x4d6be0[_0x1c15('0x2d')][_0x1c15('0x3a')]){_0x1521b7[_0x1c15('0x3b')]=_['merge'](_0x1521b7[_0x1c15('0x3b')],{'$or':_['map'](_0x2fb73a,function(_0x18bc6d){if(_0x18bc6d[_0x1c15('0x2c')]!==_0x1c15('0x3c')){var _0x4892f4={};_0x4892f4[_0x18bc6d[_0x1c15('0x27')]]={'$like':'%'+_0x4d6be0[_0x1c15('0x2d')][_0x1c15('0x3a')]+'%'};return _0x4892f4;}})});}_0x1521b7=_['merge']({},_0x1521b7,_0x4d6be0[_0x1c15('0x3d')]);var _0x17c952={'where':_0x1521b7[_0x1c15('0x3b')]};return db[_0x1c15('0x3e')][_0x1c15('0x1f')](_0x17c952)[_0x1c15('0x24')](function(_0x4a15d5){_0x405161['count']=_0x4a15d5;if(_0x4d6be0[_0x1c15('0x2d')][_0x1c15('0x3f')]){_0x1521b7[_0x1c15('0x40')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x1c15('0x41')](_0x1521b7);})['then'](function(_0x4c1ffd){_0x405161[_0x1c15('0x42')]=_0x4c1ffd;return _0x405161;})[_0x1c15('0x24')](respondWithFilteredResult(_0x16c81a,_0x1521b7))[_0x1c15('0x43')](handleError(_0x16c81a,null));};exports['show']=function(_0x495444,_0x4dbaf5){var _0x4bf321={'raw':!![],'where':{'id':_0x495444[_0x1c15('0x44')]['id']}},_0x317425={};_0x317425[_0x1c15('0x31')]=_[_0x1c15('0x2e')](db[_0x1c15('0x3e')][_0x1c15('0x45')]);_0x317425[_0x1c15('0x2d')]=_[_0x1c15('0x2e')](_0x495444[_0x1c15('0x2d')]);_0x317425['filters']=_[_0x1c15('0x30')](_0x317425[_0x1c15('0x31')],_0x317425[_0x1c15('0x2d')]);_0x4bf321[_0x1c15('0x32')]=_[_0x1c15('0x30')](_0x317425['model'],qs[_0x1c15('0x33')](_0x495444[_0x1c15('0x2d')][_0x1c15('0x33')]));_0x4bf321[_0x1c15('0x32')]=_0x4bf321['attributes'][_0x1c15('0x34')]?_0x4bf321[_0x1c15('0x32')]:_0x317425['model'];if(_0x495444[_0x1c15('0x2d')][_0x1c15('0x3f')]){_0x4bf321[_0x1c15('0x40')]=[{'all':!![]}];}_0x4bf321=_[_0x1c15('0x46')]({},_0x4bf321,_0x495444[_0x1c15('0x3d')]);return db[_0x1c15('0x3e')][_0x1c15('0x47')](_0x4bf321)['then'](handleEntityNotFound(_0x4dbaf5,null))['then'](respondWithResult(_0x4dbaf5,null))['catch'](handleError(_0x4dbaf5,null));};exports['create']=function(_0x141fb3,_0x25c6cc){return db['CmHopperHistory'][_0x1c15('0x48')](_0x141fb3['body'],{})['then'](respondWithResult(_0x25c6cc,0xc9))[_0x1c15('0x43')](handleError(_0x25c6cc,null));};exports[_0x1c15('0x49')]=function(_0x365596,_0x31a347){return db[_0x1c15('0x3e')][_0x1c15('0x49')]()[_0x1c15('0x24')](respondWithResult(_0x31a347,null))[_0x1c15('0x43')](handleError(_0x31a347,null));};exports[_0x1c15('0x4a')]=function(_0x51cf0c,_0x2808a1){if(_0x51cf0c[_0x1c15('0x4b')][_0x1c15('0x4c')]){delete _0x51cf0c['body']['uniqueid'];}return db[_0x1c15('0x3e')][_0x1c15('0x47')]({'where':{'uniqueid':_0x51cf0c[_0x1c15('0x44')]['id']}})[_0x1c15('0x24')](handleEntityNotFound(_0x2808a1,null))[_0x1c15('0x24')](saveUpdates(_0x51cf0c[_0x1c15('0x4b')],null))['then'](respondWithResult(_0x2808a1,null))[_0x1c15('0x43')](handleError(_0x2808a1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 1450d0c..e9957d8 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 _0x082a=['endtime','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_hopper_history'];(function(_0x4e170e,_0x207e58){var _0x338291=function(_0x4cb198){while(--_0x4cb198){_0x4e170e['push'](_0x4e170e['shift']());}};_0x338291(++_0x207e58);}(_0x082a,0x154));var _0xa082=function(_0x3b93fe,_0x26b8d2){_0x3b93fe=_0x3b93fe-0x0;var _0x5de13c=_0x082a[_0x3b93fe];return _0x5de13c;};'use strict';var _=require('lodash');var util=require(_0xa082('0x0'));var logger=require(_0xa082('0x1'))(_0xa082('0x2'));var moment=require('moment');var BPromise=require(_0xa082('0x3'));var rp=require(_0xa082('0x4'));var fs=require('fs');var path=require(_0xa082('0x5'));var rimraf=require(_0xa082('0x6'));var config=require(_0xa082('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0xa082('0x8')]=function(_0x59b4a8,_0x1ada27){return _0x59b4a8[_0xa082('0x9')]('CmHopperHistory',attributes,{'tableName':_0xa082('0xa'),'paranoid':![],'indexes':[{'name':_0xa082('0xb'),'fields':[_0xa082('0xb')]},{'name':'uniqueid','fields':[_0xa082('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c99=['path','../../config/environment','./cmHopperHistory.attributes','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','request-promise'];(function(_0x4dd992,_0x34844c){var _0x22e05d=function(_0x18af86){while(--_0x18af86){_0x4dd992['push'](_0x4dd992['shift']());}};_0x22e05d(++_0x34844c);}(_0x4c99,0x1ec));var _0x94c9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x4c99[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var logger=require(_0x94c9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x94c9('0x2'));var fs=require('fs');var path=require(_0x94c9('0x3'));var rimraf=require('rimraf');var config=require(_0x94c9('0x4'));var attributes=require(_0x94c9('0x5'));module['exports']=function(_0x42d25e,_0x4e4ffd){return _0x42d25e['define']('CmHopperHistory',attributes,{'tableName':_0x94c9('0x6'),'paranoid':![],'indexes':[{'name':_0x94c9('0x7'),'fields':[_0x94c9('0x7')]},{'name':_0x94c9('0x8'),'fields':[_0x94c9('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 2797df3..9fe5e06 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 _0x87ae=['catch','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CmHopperHistory','body','options','raw','info','CreateCmHopperHistory','findAll','where','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','COUNT','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory'];(function(_0x3f3c8e,_0x8d2c70){var _0x313f01=function(_0x4e8ebc){while(--_0x4e8ebc){_0x3f3c8e['push'](_0x3f3c8e['shift']());}};_0x313f01(++_0x8d2c70);}(_0x87ae,0xf5));var _0xe87a=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x87ae[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe87a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe87a('0x1'));var db=require(_0xe87a('0x2'))['db'];var utils=require(_0xe87a('0x3'));var logger=require('../../config/logger')(_0xe87a('0x4'));var config=require(_0xe87a('0x5'));var jayson=require(_0xe87a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x125dd3,_0x2fbd6b,_0x5dff22){return new BPromise(function(_0x379db4,_0x455b3a){return client['request'](_0x125dd3,_0x5dff22)[_0xe87a('0x7')](function(_0x278d7c){logger['info'](_0xe87a('0x8'),_0x2fbd6b,_0xe87a('0x9'));logger[_0xe87a('0xa')](_0xe87a('0xb'),_0x2fbd6b,_0xe87a('0x9'),JSON[_0xe87a('0xc')](_0x278d7c));if(_0x278d7c['error']){if(_0x278d7c['error'][_0xe87a('0xd')]===0x1f4){logger[_0xe87a('0xe')](_0xe87a('0x8'),_0x2fbd6b,_0x278d7c['error'][_0xe87a('0xf')]);return _0x455b3a(_0x278d7c[_0xe87a('0xe')]['message']);}logger[_0xe87a('0xe')](_0xe87a('0x8'),_0x2fbd6b,_0x278d7c[_0xe87a('0xe')]['message']);return _0x379db4(_0x278d7c['error']['message']);}else{logger['info'](_0xe87a('0x8'),_0x2fbd6b,_0xe87a('0x9'));_0x379db4(_0x278d7c[_0xe87a('0x10')][_0xe87a('0xf')]);}})['catch'](function(_0x415147){logger[_0xe87a('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x2fbd6b,_0x415147);_0x455b3a(_0x415147);});});}exports['CreateCmHopperHistory']=function(_0x4160e2){var _0x5c9acf=this;return new Promise(function(_0x182e6f,_0xac5b46){return db[_0xe87a('0x11')]['create'](_0x4160e2[_0xe87a('0x12')],{'raw':_0x4160e2['options']?_0x4160e2[_0xe87a('0x13')][_0xe87a('0x14')]===undefined?!![]:![]:!![]})[_0xe87a('0x7')](function(_0x4059e1){logger[_0xe87a('0x15')](_0xe87a('0x16'),_0x4160e2);logger[_0xe87a('0xa')](_0xe87a('0x16'),_0x4160e2,JSON['stringify'](_0x4059e1));_0x182e6f(_0x4059e1);})['catch'](function(_0x42ba03){logger[_0xe87a('0xe')](_0xe87a('0x16'),_0x42ba03[_0xe87a('0xf')],_0x4160e2);_0xac5b46(_0x5c9acf[_0xe87a('0xe')](0x1f4,_0x42ba03[_0xe87a('0xf')]));});});};exports['AvgHandleTime']=function(_0x59d9f7){var _0x54e386=this;return new Promise(function(_0x524869,_0x328921){return db['CmHopperHistory'][_0xe87a('0x17')]({'raw':_0x59d9f7['options']?_0x59d9f7[_0xe87a('0x13')][_0xe87a('0x14')]===undefined?!![]:![]:!![],'where':_0x59d9f7[_0xe87a('0x13')]?_0x59d9f7[_0xe87a('0x13')][_0xe87a('0x18')]||null:null,'attributes':[[db[_0xe87a('0x19')]['fn']('COUNT',db[_0xe87a('0x19')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0xe87a('0x19')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe87a('0x1a')](_0xe87a('0x1b')))),_0xe87a('0x1c')],[db['sequelize']['fn']('COUNT',db[_0xe87a('0x19')]['fn']('IF',db['sequelize']['literal'](_0xe87a('0x1d')))),_0xe87a('0x1e')],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db['sequelize'][_0xe87a('0x1a')]('`state`\x20=\x2011,\x201,\x20null'))),_0xe87a('0x20')],[db['sequelize']['fn'](_0xe87a('0x21'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x22')))),_0xe87a('0x23')],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x21'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0xe87a('0x7')](function(_0x51e952){logger[_0xe87a('0x15')](_0xe87a('0x24'),_0x59d9f7);logger['debug'](_0xe87a('0x24'),_0x59d9f7,JSON['stringify'](_0x51e952));_0x524869(_0x51e952);})['catch'](function(_0x57e702){logger[_0xe87a('0xe')](_0xe87a('0x24'),_0x57e702[_0xe87a('0xf')],_0x59d9f7);_0x328921(_0x54e386['error'](0x1f4,_0x57e702[_0xe87a('0xf')]));});});};exports[_0xe87a('0x25')]=function(_0x51e0d9){var _0x14f8a5=this;return new Promise(function(_0x227a1c,_0x596b28){return db[_0xe87a('0x11')][_0xe87a('0x17')]({'raw':_0x51e0d9[_0xe87a('0x13')]?_0x51e0d9[_0xe87a('0x13')][_0xe87a('0x14')]===undefined?!![]:![]:!![],'where':_0x51e0d9['options']?_0x51e0d9[_0xe87a('0x13')]['where']||null:null,'attributes':[[_0xe87a('0x26'),'name'],[db['sequelize']['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x27')))),_0xe87a('0x28')],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x29')))),_0xe87a('0x2a')],[db[_0xe87a('0x19')]['fn']('COUNT',db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x1b')))),'outboundAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xe87a('0x19')]['fn']('IF',db['sequelize']['literal'](_0xe87a('0x2b')))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db['sequelize'][_0xe87a('0x1a')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db['sequelize'][_0xe87a('0x1a')](_0xe87a('0x2c')))),_0xe87a('0x2d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe87a('0x1a')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xe87a('0x2e')],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db['sequelize'][_0xe87a('0x1a')](_0xe87a('0x2f')))),'outboundUnknownCallsDay'],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x30')))),_0xe87a('0x31')],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x1f'),db['sequelize']['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x32')))),_0xe87a('0x33')],[db['sequelize']['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x34')))),_0xe87a('0x35')],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x1f'),db['sequelize']['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x36')))),'outboundAnswerAgiCallsDay'],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x37')))),_0xe87a('0x35')],[db[_0xe87a('0x19')]['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xe87a('0x38')]],'group':[_0xe87a('0x26')]})[_0xe87a('0x7')](function(_0x1bbd2e){logger[_0xe87a('0x15')](_0xe87a('0x25'),_0x51e0d9);logger[_0xe87a('0xa')](_0xe87a('0x25'),_0x51e0d9,JSON[_0xe87a('0xc')](_0x1bbd2e));_0x227a1c(_0x1bbd2e);})['catch'](function(_0x553df2){logger[_0xe87a('0xe')](_0xe87a('0x25'),_0x553df2['message'],_0x51e0d9);_0x596b28(_0x14f8a5[_0xe87a('0xe')](0x1f4,_0x553df2[_0xe87a('0xf')]));});});};exports['GetCampaignHopperHistory']=function(_0x24e13e){var _0x429955=this;return new Promise(function(_0x4d86f2,_0x2a5b79){return db[_0xe87a('0x11')][_0xe87a('0x17')]({'raw':_0x24e13e[_0xe87a('0x13')]?_0x24e13e['options']['raw']===undefined?!![]:![]:!![],'where':_0x24e13e[_0xe87a('0x13')]?_0x24e13e[_0xe87a('0x13')]['where']||null:null,'attributes':[[_0xe87a('0x26'),'name'],[db[_0xe87a('0x19')]['fn']('COUNT',db[_0xe87a('0x19')]['col']('id')),_0xe87a('0x39')],[db['sequelize']['fn'](_0xe87a('0x1f'),db[_0xe87a('0x19')]['fn']('IF',db[_0xe87a('0x19')][_0xe87a('0x1a')](_0xe87a('0x1b')))),_0xe87a('0x3a')]],'group':[_0xe87a('0x26')]})[_0xe87a('0x7')](function(_0x3941f9){logger[_0xe87a('0x15')](_0xe87a('0x3b'),_0x24e13e);logger['debug'](_0xe87a('0x3b'),_0x24e13e,JSON[_0xe87a('0xc')](_0x3941f9));_0x4d86f2(_0x3941f9);})[_0xe87a('0x3c')](function(_0x2dd500){logger[_0xe87a('0xe')](_0xe87a('0x3b'),_0x2dd500[_0xe87a('0xf')],_0x24e13e);_0x2a5b79(_0x429955[_0xe87a('0xe')](0x1f4,_0x2dd500[_0xe87a('0xf')]));});});}; \ No newline at end of file +var _0x03f5=['AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','AvgHandleTime','findAll','where','sequelize','predictiveIntervalTotalCalls','COUNT','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit'];(function(_0x553bb0,_0x52e291){var _0x4cfcad=function(_0x1d37f5){while(--_0x1d37f5){_0x553bb0['push'](_0x553bb0['shift']());}};_0x4cfcad(++_0x52e291);}(_0x03f5,0x6c));var _0x503f=function(_0x54ff8b,_0x5c45c4){_0x54ff8b=_0x54ff8b-0x0;var _0x5c6e2d=_0x03f5[_0x54ff8b];return _0x5c6e2d;};'use strict';var _=require(_0x503f('0x0'));var util=require(_0x503f('0x1'));var moment=require(_0x503f('0x2'));var BPromise=require(_0x503f('0x3'));var rs=require(_0x503f('0x4'));var fs=require('fs');var Redis=require(_0x503f('0x5'));var db=require(_0x503f('0x6'))['db'];var utils=require(_0x503f('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x503f('0x8'));var jayson=require(_0x503f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x364db5,_0x10ed48,_0x1cea02){return new BPromise(function(_0x284993,_0x87aec4){return client[_0x503f('0xa')](_0x364db5,_0x1cea02)[_0x503f('0xb')](function(_0x137ac8){logger[_0x503f('0xc')](_0x503f('0xd'),_0x10ed48,_0x503f('0xe'));logger['debug'](_0x503f('0xf'),_0x10ed48,'request\x20sent',JSON[_0x503f('0x10')](_0x137ac8));if(_0x137ac8[_0x503f('0x11')]){if(_0x137ac8[_0x503f('0x11')][_0x503f('0x12')]===0x1f4){logger['error'](_0x503f('0xd'),_0x10ed48,_0x137ac8[_0x503f('0x11')]['message']);return _0x87aec4(_0x137ac8[_0x503f('0x11')]['message']);}logger[_0x503f('0x11')](_0x503f('0xd'),_0x10ed48,_0x137ac8[_0x503f('0x11')][_0x503f('0x13')]);return _0x284993(_0x137ac8[_0x503f('0x11')][_0x503f('0x13')]);}else{logger[_0x503f('0xc')](_0x503f('0xd'),_0x10ed48,_0x503f('0xe'));_0x284993(_0x137ac8[_0x503f('0x14')]['message']);}})['catch'](function(_0x303765){logger[_0x503f('0x11')](_0x503f('0xd'),_0x10ed48,_0x303765);_0x87aec4(_0x303765);});});}exports[_0x503f('0x15')]=function(_0x4bfe19){var _0x19acf3=this;return new Promise(function(_0xfc2688,_0x1aaa66){return db[_0x503f('0x16')][_0x503f('0x17')](_0x4bfe19[_0x503f('0x18')],{'raw':_0x4bfe19[_0x503f('0x19')]?_0x4bfe19[_0x503f('0x19')][_0x503f('0x1a')]===undefined?!![]:![]:!![]})[_0x503f('0xb')](function(_0x27bb18){logger[_0x503f('0xc')](_0x503f('0x15'),_0x4bfe19);logger[_0x503f('0x1b')](_0x503f('0x15'),_0x4bfe19,JSON[_0x503f('0x10')](_0x27bb18));_0xfc2688(_0x27bb18);})['catch'](function(_0x9ae361){logger[_0x503f('0x11')](_0x503f('0x15'),_0x9ae361[_0x503f('0x13')],_0x4bfe19);_0x1aaa66(_0x19acf3[_0x503f('0x11')](0x1f4,_0x9ae361[_0x503f('0x13')]));});});};exports[_0x503f('0x1c')]=function(_0x59fc8f){var _0x4564a0=this;return new Promise(function(_0x3187c8,_0x1084b6){return db['CmHopperHistory'][_0x503f('0x1d')]({'raw':_0x59fc8f[_0x503f('0x19')]?_0x59fc8f['options'][_0x503f('0x1a')]===undefined?!![]:![]:!![],'where':_0x59fc8f[_0x503f('0x19')]?_0x59fc8f['options'][_0x503f('0x1e')]||null:null,'attributes':[[db[_0x503f('0x1f')]['fn']('COUNT',db[_0x503f('0x1f')]['col']('id')),_0x503f('0x20')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x503f('0x22')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')][_0x503f('0x23')](_0x503f('0x24')))),_0x503f('0x25')],[db[_0x503f('0x1f')]['fn']('COUNT',db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')]['literal'](_0x503f('0x26')))),_0x503f('0x27')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x28'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')][_0x503f('0x23')](_0x503f('0x29')))),_0x503f('0x2a')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x28'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x503f('0x2b')]]})[_0x503f('0xb')](function(_0x2dcdaf){logger[_0x503f('0xc')](_0x503f('0x1c'),_0x59fc8f);logger[_0x503f('0x1b')](_0x503f('0x1c'),_0x59fc8f,JSON['stringify'](_0x2dcdaf));_0x3187c8(_0x2dcdaf);})[_0x503f('0x2c')](function(_0x1333a7){logger['error'](_0x503f('0x1c'),_0x1333a7[_0x503f('0x13')],_0x59fc8f);_0x1084b6(_0x4564a0['error'](0x1f4,_0x1333a7[_0x503f('0x13')]));});});};exports[_0x503f('0x2d')]=function(_0x57fdd6){var _0x3eb3fa=this;return new Promise(function(_0x358a68,_0x4ff69d){return db[_0x503f('0x16')]['findAll']({'raw':_0x57fdd6[_0x503f('0x19')]?_0x57fdd6[_0x503f('0x19')][_0x503f('0x1a')]===undefined?!![]:![]:!![],'where':_0x57fdd6[_0x503f('0x19')]?_0x57fdd6[_0x503f('0x19')][_0x503f('0x1e')]||null:null,'attributes':[['campaign',_0x503f('0x2e')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db['sequelize']['fn']('IF',db[_0x503f('0x1f')][_0x503f('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0x503f('0x2f')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x503f('0x23')](_0x503f('0x30')))),'outboundNoAnswerCallsDay'],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')]['literal'](_0x503f('0x31')))),_0x503f('0x32')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')][_0x503f('0x23')](_0x503f('0x33')))),_0x503f('0x34')],[db['sequelize']['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')]['literal'](_0x503f('0x35')))),'outboundCongestionCallsDay'],[db[_0x503f('0x1f')]['fn']('COUNT',db[_0x503f('0x1f')]['fn']('IF',db['sequelize'][_0x503f('0x23')](_0x503f('0x36')))),_0x503f('0x37')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x503f('0x1f')]['literal'](_0x503f('0x38')))),_0x503f('0x39')],[db[_0x503f('0x1f')]['fn']('COUNT',db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')][_0x503f('0x23')](_0x503f('0x3a')))),_0x503f('0x3b')],[db[_0x503f('0x1f')]['fn']('COUNT',db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')]['literal'](_0x503f('0x3c')))),_0x503f('0x3d')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')][_0x503f('0x23')](_0x503f('0x3e')))),'outboundOriginateFailureCallsDay'],[db[_0x503f('0x1f')]['fn']('COUNT',db[_0x503f('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x503f('0x3f')))),_0x503f('0x40')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x503f('0x41')))),_0x503f('0x42')],[db['sequelize']['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x503f('0x43')))),_0x503f('0x40')],[db['sequelize']['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x503f('0x44')]],'group':[_0x503f('0x45')]})[_0x503f('0xb')](function(_0x5e1664){logger['info'](_0x503f('0x2d'),_0x57fdd6);logger[_0x503f('0x1b')](_0x503f('0x2d'),_0x57fdd6,JSON[_0x503f('0x10')](_0x5e1664));_0x358a68(_0x5e1664);})['catch'](function(_0x5b1ee5){logger[_0x503f('0x11')](_0x503f('0x2d'),_0x5b1ee5[_0x503f('0x13')],_0x57fdd6);_0x4ff69d(_0x3eb3fa[_0x503f('0x11')](0x1f4,_0x5b1ee5[_0x503f('0x13')]));});});};exports[_0x503f('0x46')]=function(_0xc18b27){var _0x110d74=this;return new Promise(function(_0x1b684c,_0x551459){return db[_0x503f('0x16')][_0x503f('0x1d')]({'raw':_0xc18b27[_0x503f('0x19')]?_0xc18b27[_0x503f('0x19')][_0x503f('0x1a')]===undefined?!![]:![]:!![],'where':_0xc18b27['options']?_0xc18b27[_0x503f('0x19')][_0x503f('0x1e')]||null:null,'attributes':[['campaign',_0x503f('0x2e')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db[_0x503f('0x1f')][_0x503f('0x47')]('id')),_0x503f('0x48')],[db[_0x503f('0x1f')]['fn'](_0x503f('0x21'),db[_0x503f('0x1f')]['fn']('IF',db[_0x503f('0x1f')][_0x503f('0x23')](_0x503f('0x31')))),_0x503f('0x49')]],'group':[_0x503f('0x45')]})[_0x503f('0xb')](function(_0xc4ca1){logger[_0x503f('0xc')](_0x503f('0x46'),_0xc18b27);logger[_0x503f('0x1b')]('GetCampaignHopperHistory',_0xc18b27,JSON[_0x503f('0x10')](_0xc4ca1));_0x1b684c(_0xc4ca1);})[_0x503f('0x2c')](function(_0x845ea7){logger[_0x503f('0x11')]('GetCampaignHopperHistory',_0x845ea7[_0x503f('0x13')],_0xc18b27);_0x551459(_0x110d74[_0x503f('0x11')](0x1f4,_0x845ea7[_0x503f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index a3cb191..22bd315 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 _0x2271=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','post','create','put','multer'];(function(_0x403726,_0x2654c7){var _0x39d467=function(_0x14fe14){while(--_0x14fe14){_0x403726['push'](_0x403726['shift']());}};_0x39d467(++_0x2654c7);}(_0x2271,0x6f));var _0x1227=function(_0x3ceca1,_0x31adbe){_0x3ceca1=_0x3ceca1-0x0;var _0x28d598=_0x2271[_0x3ceca1];return _0x28d598;};'use strict';var multer=require(_0x1227('0x0'));var util=require(_0x1227('0x1'));var path=require(_0x1227('0x2'));var timeout=require(_0x1227('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1227('0x4'));var auth=require(_0x1227('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1227('0x6'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x1227('0x7')](),controller[_0x1227('0x8')]);router[_0x1227('0x9')](_0x1227('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x1227('0x9')](_0x1227('0xb'),auth['isAuthenticated'](),controller[_0x1227('0xc')]);router[_0x1227('0xd')]('/',auth[_0x1227('0x7')](),controller[_0x1227('0xe')]);router[_0x1227('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x24ee=['show','post','create','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x24ee,0x9d));var _0xe24e=function(_0x5d572c,_0x53581f){_0x5d572c=_0x5d572c-0x0;var _0x5797cf=_0x24ee[_0x5d572c];return _0x5797cf;};'use strict';var multer=require(_0xe24e('0x0'));var util=require(_0xe24e('0x1'));var path=require(_0xe24e('0x2'));var timeout=require(_0xe24e('0x3'));var express=require('express');var router=express[_0xe24e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe24e('0x5'));var interaction=require(_0xe24e('0x6'));var config=require(_0xe24e('0x7'));var controller=require('./cmHopperHistory.controller');router[_0xe24e('0x8')]('/',auth[_0xe24e('0x9')](),controller[_0xe24e('0xa')]);router[_0xe24e('0x8')](_0xe24e('0xb'),auth['isAuthenticated'](),controller[_0xe24e('0xc')]);router[_0xe24e('0x8')](_0xe24e('0xd'),auth[_0xe24e('0x9')](),controller[_0xe24e('0xe')]);router[_0xe24e('0xf')]('/',auth[_0xe24e('0x9')](),controller[_0xe24e('0x10')]);router[_0xe24e('0x11')](_0xe24e('0xd'),auth[_0xe24e('0x9')](),controller[_0xe24e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 04c1f3d..103b40c 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 _0xac95=['sequelize','exports','STRING','name'];(function(_0x3d84ce,_0x331a65){var _0x418f33=function(_0x1fa51c){while(--_0x1fa51c){_0x3d84ce['push'](_0x3d84ce['shift']());}};_0x418f33(++_0x331a65);}(_0xac95,0xa8));var _0x5ac9=function(_0x3b2e5f,_0x2e45e6){_0x3b2e5f=_0x3b2e5f-0x0;var _0x682cfa=_0xac95[_0x3b2e5f];return _0x682cfa;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'name':{'type':Sequelize[_0x5ac9('0x2')],'unique':_0x5ac9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x303a=['STRING','name','sequelize'];(function(_0x5ea989,_0x549115){var _0x9e78cf=function(_0xe3f709){while(--_0xe3f709){_0x5ea989['push'](_0x5ea989['shift']());}};_0x9e78cf(++_0x549115);}(_0x303a,0x1a0));var _0xa303=function(_0x54597a,_0x4ea42f){_0x54597a=_0x54597a-0x0;var _0x5a764f=_0x303a[_0x54597a];return _0x5a764f;};'use strict';var Sequelize=require(_0xa303('0x0'));module['exports']={'name':{'type':Sequelize[_0xa303('0x1')],'unique':_0xa303('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa303('0x1')]},'dialPrefix':{'type':Sequelize[_0xa303('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 215102b..83c1e03 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 _0xe1a0=['addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','Lists','UserProfileResource','error','name','send','index','CmList','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ListId','getDispositions','findOne','pick','Disposition','findAll','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','success','dataValues','errors','message','json','Malformed\x20request\x20syntax','getContacts','CmCustomField','cf_%d','raw','OrderBy','alias','select','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','item','CmContactId\x20=\x20c.id','additionalPhone_','cm_contact_has_items','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll'];(function(_0x1d4807,_0x12ee6b){var _0x8ad9f8=function(_0x599530){while(--_0x599530){_0x1d4807['push'](_0x1d4807['shift']());}};_0x8ad9f8(++_0x12ee6b);}(_0xe1a0,0x1f3));var _0x0e1a=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xe1a0[_0x1fd675];return _0x16b554;};'use strict';var emlformat=require(_0x0e1a('0x0'));var rimraf=require(_0x0e1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e1a('0x2'));var rp=require(_0x0e1a('0x3'));var moment=require(_0x0e1a('0x4'));var BPromise=require(_0x0e1a('0x5'));var Mustache=require(_0x0e1a('0x6'));var util=require(_0x0e1a('0x7'));var path=require(_0x0e1a('0x8'));var sox=require(_0x0e1a('0x9'));var csv=require('to-csv');var ejs=require(_0x0e1a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0e1a('0xb'));var jsforce=require(_0x0e1a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0e1a('0xd'));var querystring=require(_0x0e1a('0xe'));var Papa=require(_0x0e1a('0xf'));var Redis=require(_0x0e1a('0x10'));var authService=require(_0x0e1a('0x11'));var qs=require(_0x0e1a('0x12'));var as=require(_0x0e1a('0x13'));var hardwareService=require(_0x0e1a('0x14'));var logger=require(_0x0e1a('0x15'))(_0x0e1a('0x16'));var utils=require('../../config/utils');var config=require(_0x0e1a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var csv_results;config[_0x0e1a('0x18')]=_['defaults'](config[_0x0e1a('0x18')],{'host':_0x0e1a('0x19'),'port':0x18eb});var socket=require(_0x0e1a('0x1a'))(new Redis(config['redis']));require(_0x0e1a('0x1b'))[_0x0e1a('0x1c')](socket);function respondWithStatusCode(_0x34cb15,_0x58faea){_0x58faea=_0x58faea||0xcc;return function(_0x5d4c0e){if(_0x5d4c0e){return _0x34cb15[_0x0e1a('0x1d')](_0x58faea);}return _0x34cb15[_0x0e1a('0x1e')](_0x58faea)['end']();};}function respondWithResult(_0x1a6c17,_0x4aa356){_0x4aa356=_0x4aa356||0xc8;return function(_0x44dcad){if(_0x44dcad){return _0x1a6c17[_0x0e1a('0x1e')](_0x4aa356)['json'](_0x44dcad);}};}function respondWithFilteredResult(_0x11efb1,_0x290051){return function(_0x1e3c17){if(_0x1e3c17){var _0x45f469=typeof _0x290051[_0x0e1a('0x1f')]==='undefined'&&typeof _0x290051[_0x0e1a('0x20')]===_0x0e1a('0x21');var _0x4aad0f=_0x1e3c17[_0x0e1a('0x22')];var _0x2bf09c=_0x45f469?0x0:_0x290051[_0x0e1a('0x1f')];var _0x186d8f=_0x45f469?_0x1e3c17[_0x0e1a('0x22')]:_0x290051[_0x0e1a('0x1f')]+_0x290051[_0x0e1a('0x20')];var _0x2b6442;if(_0x186d8f>=_0x4aad0f){_0x186d8f=_0x4aad0f;_0x2b6442=0xc8;}else{_0x2b6442=0xce;}_0x11efb1[_0x0e1a('0x1e')](_0x2b6442);return _0x11efb1[_0x0e1a('0x23')](_0x0e1a('0x24'),_0x2bf09c+'-'+_0x186d8f+'/'+_0x4aad0f)['json'](_0x1e3c17);}return null;};}function patchUpdates(_0x1bac40){return function(_0x43ce25){try{jsonpatch[_0x0e1a('0x25')](_0x43ce25,_0x1bac40,!![]);}catch(_0x118b51){return BPromise[_0x0e1a('0x26')](_0x118b51);}return _0x43ce25[_0x0e1a('0x27')]();};}function saveUpdates(_0xce659f,_0x4fbf88){return function(_0x4a820e){if(_0x4a820e){return _0x4a820e['update'](_0xce659f)['then'](function(_0x5ecfb8){return _0x5ecfb8;});}return null;};}function removeEntity(_0x26ee8b,_0x24e2fb){return function(_0x47fedf){if(_0x47fedf){return _0x47fedf[_0x0e1a('0x28')]()[_0x0e1a('0x29')](function(){var _0x1ab653=_0x47fedf[_0x0e1a('0x2a')]({'plain':!![]});var _0x5272f5=_0x0e1a('0x2b');return db[_0x0e1a('0x2c')][_0x0e1a('0x28')]({'where':{'type':_0x5272f5,'resourceId':_0x1ab653['id']}})[_0x0e1a('0x29')](function(){return _0x47fedf;});})[_0x0e1a('0x29')](function(){_0x26ee8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24abe0,_0x5d95fa){return function(_0x5e4d0b){if(!_0x5e4d0b){_0x24abe0[_0x0e1a('0x1d')](0x194);}return _0x5e4d0b;};}function handleError(_0x56d5db,_0x276269){_0x276269=_0x276269||0x1f4;return function(_0x1f2771){logger[_0x0e1a('0x2d')](_0x1f2771['stack']);if(_0x1f2771[_0x0e1a('0x2e')]){delete _0x1f2771['name'];}_0x56d5db['status'](_0x276269)[_0x0e1a('0x2f')](_0x1f2771);};}exports[_0x0e1a('0x30')]=function(_0x52548f,_0x3486d7){var _0x57d250={},_0x5d8ad4={},_0x4bf365={'count':0x0,'rows':[]};var _0x4df045=_['map'](db[_0x0e1a('0x31')][_0x0e1a('0x32')],function(_0x3d461a){return{'name':_0x3d461a['fieldName'],'type':_0x3d461a[_0x0e1a('0x33')]['key']};});_0x5d8ad4[_0x0e1a('0x34')]=_[_0x0e1a('0x35')](_0x4df045,'name');_0x5d8ad4[_0x0e1a('0x36')]=_[_0x0e1a('0x37')](_0x52548f[_0x0e1a('0x36')]);_0x5d8ad4[_0x0e1a('0x38')]=_['intersection'](_0x5d8ad4[_0x0e1a('0x34')],_0x5d8ad4[_0x0e1a('0x36')]);_0x57d250[_0x0e1a('0x39')]=_[_0x0e1a('0x3a')](_0x5d8ad4[_0x0e1a('0x34')],qs['fields'](_0x52548f['query']['fields']));_0x57d250[_0x0e1a('0x39')]=_0x57d250[_0x0e1a('0x39')][_0x0e1a('0x3b')]?_0x57d250[_0x0e1a('0x39')]:_0x5d8ad4[_0x0e1a('0x34')];if(!_0x52548f[_0x0e1a('0x36')][_0x0e1a('0x3c')](_0x0e1a('0x3d'))){_0x57d250[_0x0e1a('0x20')]=qs[_0x0e1a('0x20')](_0x52548f[_0x0e1a('0x36')][_0x0e1a('0x20')]);_0x57d250[_0x0e1a('0x1f')]=qs[_0x0e1a('0x1f')](_0x52548f['query']['offset']);}_0x57d250[_0x0e1a('0x3e')]=qs[_0x0e1a('0x3f')](_0x52548f['query'][_0x0e1a('0x3f')]);_0x57d250[_0x0e1a('0x40')]=qs[_0x0e1a('0x38')](_['pick'](_0x52548f[_0x0e1a('0x36')],_0x5d8ad4[_0x0e1a('0x38')]),_0x4df045);if(_0x52548f[_0x0e1a('0x36')][_0x0e1a('0x41')]){_0x57d250[_0x0e1a('0x40')]=_[_0x0e1a('0x42')](_0x57d250['where'],{'$or':_[_0x0e1a('0x35')](_0x4df045,function(_0x4c1246){if(_0x4c1246[_0x0e1a('0x33')]!=='VIRTUAL'){var _0x470c43={};_0x470c43[_0x4c1246[_0x0e1a('0x2e')]]={'$like':'%'+_0x52548f[_0x0e1a('0x36')][_0x0e1a('0x41')]+'%'};return _0x470c43;}})});}_0x57d250=_[_0x0e1a('0x42')]({},_0x57d250,_0x52548f[_0x0e1a('0x43')]);var _0x5723ac={'where':_0x57d250[_0x0e1a('0x40')]};return db[_0x0e1a('0x31')]['count'](_0x5723ac)[_0x0e1a('0x29')](function(_0x53d17b){_0x4bf365['count']=_0x53d17b;if(_0x52548f['query'][_0x0e1a('0x44')]){_0x57d250[_0x0e1a('0x45')]=[{'all':!![]}];}return db[_0x0e1a('0x31')]['findAll'](_0x57d250);})[_0x0e1a('0x29')](function(_0x1d6626){_0x4bf365[_0x0e1a('0x46')]=_0x1d6626;return _0x4bf365;})[_0x0e1a('0x29')](respondWithFilteredResult(_0x3486d7,_0x57d250))[_0x0e1a('0x47')](handleError(_0x3486d7,null));};exports[_0x0e1a('0x48')]=function(_0x278169,_0xdbc6b5){var _0x119504={'raw':![],'where':{'id':_0x278169['params']['id']}},_0x3c084f={};_0x3c084f[_0x0e1a('0x34')]=_[_0x0e1a('0x37')](db[_0x0e1a('0x31')][_0x0e1a('0x32')]);_0x3c084f[_0x0e1a('0x36')]=_[_0x0e1a('0x37')](_0x278169[_0x0e1a('0x36')]);_0x3c084f[_0x0e1a('0x38')]=_[_0x0e1a('0x3a')](_0x3c084f[_0x0e1a('0x34')],_0x3c084f[_0x0e1a('0x36')]);_0x119504[_0x0e1a('0x39')]=_[_0x0e1a('0x3a')](_0x3c084f[_0x0e1a('0x34')],qs[_0x0e1a('0x49')](_0x278169[_0x0e1a('0x36')][_0x0e1a('0x49')]));_0x119504[_0x0e1a('0x39')]=_0x119504[_0x0e1a('0x39')][_0x0e1a('0x3b')]?_0x119504['attributes']:_0x3c084f[_0x0e1a('0x34')];if(_0x278169[_0x0e1a('0x36')][_0x0e1a('0x44')]){_0x119504[_0x0e1a('0x45')]=[{'all':!![]}];}_0x119504=_[_0x0e1a('0x42')]({},_0x119504,_0x278169['options']);return db['CmList']['find'](_0x119504)['then'](handleEntityNotFound(_0xdbc6b5,null))['then'](respondWithResult(_0xdbc6b5,null))['catch'](handleError(_0xdbc6b5,null));};exports[_0x0e1a('0x4a')]=function(_0x402f98,_0x29fb6d){return db[_0x0e1a('0x31')]['create'](_0x402f98[_0x0e1a('0x4b')],{})[_0x0e1a('0x29')](function(_0x38bb88){var _0x57f789=_0x402f98[_0x0e1a('0x4c')][_0x0e1a('0x2a')]({'plain':!![]});if(!_0x57f789)throw new Error(_0x0e1a('0x4d'));if(_0x57f789['role']==='user'){var _0xd1e121=_0x38bb88['get']({'plain':!![]});var _0x12c55e='Lists';return db[_0x0e1a('0x4e')][_0x0e1a('0x4f')]({'where':{'name':_0x12c55e,'userProfileId':_0x57f789[_0x0e1a('0x50')]},'raw':!![]})[_0x0e1a('0x29')](function(_0x7ba0ea){if(_0x7ba0ea&&_0x7ba0ea[_0x0e1a('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0xd1e121[_0x0e1a('0x2e')],'resourceId':_0xd1e121['id'],'type':_0x7ba0ea['name'],'sectionId':_0x7ba0ea['id']},{})['then'](function(){return _0x38bb88;});}else{return _0x38bb88;}})[_0x0e1a('0x47')](function(_0x121dc6){logger[_0x0e1a('0x2d')](_0x0e1a('0x52'),_0x121dc6);throw _0x121dc6;});}return _0x38bb88;})[_0x0e1a('0x29')](respondWithResult(_0x29fb6d,0xc9))['catch'](handleError(_0x29fb6d,null));};exports[_0x0e1a('0x53')]=function(_0x47095c,_0x18ad7d){if(_0x47095c[_0x0e1a('0x4b')]['id']){delete _0x47095c[_0x0e1a('0x4b')]['id'];}return db[_0x0e1a('0x31')][_0x0e1a('0x4f')]({'where':{'id':_0x47095c['params']['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x18ad7d,null))[_0x0e1a('0x29')](saveUpdates(_0x47095c['body'],null))[_0x0e1a('0x29')](respondWithResult(_0x18ad7d,null))[_0x0e1a('0x47')](handleError(_0x18ad7d,null));};exports['destroy']=function(_0x10cce1,_0x39b08d){return db[_0x0e1a('0x31')][_0x0e1a('0x4f')]({'where':{'id':_0x10cce1[_0x0e1a('0x54')]['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x39b08d,null))['then'](removeEntity(_0x39b08d,null))[_0x0e1a('0x47')](handleError(_0x39b08d,null));};exports[_0x0e1a('0x55')]=function(_0x1c08f5,_0x1c0919){return db['CmList'][_0x0e1a('0x55')]()[_0x0e1a('0x29')](respondWithResult(_0x1c0919,null))[_0x0e1a('0x47')](handleError(_0x1c0919,null));};exports[_0x0e1a('0x56')]=function(_0x2dc805,_0x569e5d,_0x5e4542){if(_0x2dc805[_0x0e1a('0x4b')]['id']){delete _0x2dc805[_0x0e1a('0x4b')]['id'];}return db['CmList'][_0x0e1a('0x4f')]({'where':{'id':_0x2dc805[_0x0e1a('0x54')]['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x569e5d,null))[_0x0e1a('0x29')](function(_0x6b455a){if(_0x6b455a){_0x2dc805['body'][_0x0e1a('0x57')]=_0x6b455a['id'];return db['Disposition'][_0x0e1a('0x4a')](_0x2dc805[_0x0e1a('0x4b')]);}})[_0x0e1a('0x29')](respondWithResult(_0x569e5d,null))[_0x0e1a('0x47')](handleError(_0x569e5d,null));};exports[_0x0e1a('0x58')]=function(_0x47924c,_0x59a8f5,_0x3b40e9){var _0x53f342={'raw':![],'where':{}};var _0x5863e4={};var _0x598bc5={'count':0x0,'rows':[]};return db['CmList'][_0x0e1a('0x59')]({'where':{'id':_0x47924c[_0x0e1a('0x54')]['id']}})['then'](handleEntityNotFound(_0x59a8f5,null))[_0x0e1a('0x29')](function(_0x9b01fe){if(_0x9b01fe){_0x5863e4[_0x0e1a('0x34')]=_[_0x0e1a('0x37')](db['Disposition'][_0x0e1a('0x32')]);_0x5863e4[_0x0e1a('0x36')]=_[_0x0e1a('0x37')](_0x47924c['query']);_0x5863e4[_0x0e1a('0x38')]=_[_0x0e1a('0x3a')](_0x5863e4[_0x0e1a('0x34')],_0x5863e4[_0x0e1a('0x36')]);_0x53f342[_0x0e1a('0x39')]=_[_0x0e1a('0x3a')](_0x5863e4[_0x0e1a('0x34')],qs[_0x0e1a('0x49')](_0x47924c[_0x0e1a('0x36')]['fields']));_0x53f342['attributes']=_0x53f342['attributes'][_0x0e1a('0x3b')]?_0x53f342[_0x0e1a('0x39')]:_0x5863e4[_0x0e1a('0x34')];if(!_0x47924c[_0x0e1a('0x36')][_0x0e1a('0x3c')]('nolimit')){_0x53f342[_0x0e1a('0x20')]=qs[_0x0e1a('0x20')](_0x47924c[_0x0e1a('0x36')][_0x0e1a('0x20')]);_0x53f342['offset']=qs[_0x0e1a('0x1f')](_0x47924c[_0x0e1a('0x36')][_0x0e1a('0x1f')]);}_0x53f342[_0x0e1a('0x3e')]=qs[_0x0e1a('0x3f')](_0x47924c[_0x0e1a('0x36')][_0x0e1a('0x3f')]);_0x53f342['where']=qs[_0x0e1a('0x38')](_[_0x0e1a('0x5a')](_0x47924c[_0x0e1a('0x36')],_0x5863e4[_0x0e1a('0x38')]));_0x53f342[_0x0e1a('0x40')][_0x0e1a('0x57')]=_0x9b01fe['id'];if(_0x47924c['query'][_0x0e1a('0x41')]){_0x53f342[_0x0e1a('0x40')]=_[_0x0e1a('0x42')](_0x53f342['where'],{'$or':_[_0x0e1a('0x35')](_0x53f342[_0x0e1a('0x39')],function(_0x4ad603){var _0xfc2767={};_0xfc2767[_0x4ad603]={'$like':'%'+_0x47924c[_0x0e1a('0x36')][_0x0e1a('0x41')]+'%'};return _0xfc2767;})});}_0x53f342=_[_0x0e1a('0x42')]({},_0x53f342,_0x47924c[_0x0e1a('0x43')]);return db['Disposition'][_0x0e1a('0x22')]({'where':_0x53f342[_0x0e1a('0x40')]})[_0x0e1a('0x29')](function(_0x2bc22f){_0x598bc5['count']=_0x2bc22f;if(_0x47924c['query']['includeAll']){_0x53f342[_0x0e1a('0x45')]=[{'all':!![]}];}return db[_0x0e1a('0x5b')][_0x0e1a('0x5c')](_0x53f342);})[_0x0e1a('0x29')](function(_0x537f8d){_0x598bc5[_0x0e1a('0x46')]=_0x537f8d;return _0x598bc5;});}})[_0x0e1a('0x29')](respondWithFilteredResult(_0x59a8f5,_0x53f342))['catch'](handleError(_0x59a8f5,null));};exports[_0x0e1a('0x5d')]=function(_0x35f682,_0x4eb876,_0x557a97){return db[_0x0e1a('0x31')][_0x0e1a('0x4f')]({'where':{'id':_0x35f682[_0x0e1a('0x54')]['id']}})['then'](handleEntityNotFound(_0x4eb876,null))[_0x0e1a('0x29')](function(_0x35b18e){if(_0x35b18e){return _0x35b18e[_0x0e1a('0x5d')](_0x35f682[_0x0e1a('0x36')][_0x0e1a('0x5e')]);}})['then'](respondWithStatusCode(_0x4eb876,null))[_0x0e1a('0x47')](handleError(_0x4eb876,null));};exports[_0x0e1a('0x5f')]=function(_0x538a91,_0x3d51dc,_0x5cc22f){return db[_0x0e1a('0x31')][_0x0e1a('0x4f')]({'where':{'id':_0x538a91[_0x0e1a('0x54')]['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x3d51dc,null))[_0x0e1a('0x29')](function(_0x5daf0d){if(_0x5daf0d){var _0x2e1c90=[];var _0x21eb3f={'success':[],'errors':[]};return db[_0x0e1a('0x60')][_0x0e1a('0x55')]()[_0x0e1a('0x29')](function(_0x486f41){if(_0x538a91['body'][_0x0e1a('0x61')]&&_['isArray'](_0x538a91[_0x0e1a('0x4b')][_0x0e1a('0x61')])){if(_0x538a91[_0x0e1a('0x4b')][_0x0e1a('0x61')]['length']){_0x538a91[_0x0e1a('0x4b')][_0x0e1a('0x61')]=_0x538a91['body'][_0x0e1a('0x61')][_0x0e1a('0x62')](';')+';';}else{_0x538a91['body'][_0x0e1a('0x61')]=null;}}else{_0x538a91[_0x0e1a('0x4b')]['tags']=null;}if(_0x538a91['body']&&_[_0x0e1a('0x63')](_0x538a91['body'])){for(var _0x3e50cf=0x0;_0x3e50cf<_0x538a91[_0x0e1a('0x4b')][_0x0e1a('0x3b')];_0x3e50cf+=0x1){_0x538a91[_0x0e1a('0x4b')][_0x3e50cf][_0x0e1a('0x57')]=_0x538a91['params']['id'];_0x2e1c90[_0x0e1a('0x64')](_0x538a91[_0x0e1a('0x4b')][_0x3e50cf]);}return BPromise[_0x0e1a('0x65')](_0x2e1c90,function(_0x13fc82){return db[_0x0e1a('0x60')][_0x0e1a('0x4a')](_['omit'](_0x13fc82,[_0x0e1a('0x5e'),'id'])||{},{'fields':_['keys'](_0x486f41),'raw':!![]})[_0x0e1a('0x29')](function(_0x399ecf){_0x21eb3f[_0x0e1a('0x66')][_0x0e1a('0x64')](_0x399ecf[_0x0e1a('0x67')]);})[_0x0e1a('0x47')](function(_0x654806){_0x21eb3f[_0x0e1a('0x68')][_0x0e1a('0x64')]({'data':_0x13fc82,'error':_0x654806[_0x0e1a('0x69')]});});})[_0x0e1a('0x29')](function(_0x50f29e){return _0x21eb3f;})['catch'](function(_0x179217){return _0x179217;});}else{_0x3d51dc[_0x0e1a('0x1e')](0x190)[_0x0e1a('0x6a')]({'message':_0x0e1a('0x6b')});}});}})[_0x0e1a('0x29')](respondWithResult(_0x3d51dc,null))[_0x0e1a('0x47')](handleError(_0x3d51dc,null));};exports[_0x0e1a('0x6c')]=function(_0x2bc3c2,_0x50007a,_0x1c3189){var _0xf7c3ed;return db[_0x0e1a('0x31')][_0x0e1a('0x4f')]({'where':{'id':_0x2bc3c2['params']['id']},'include':[{'model':db[_0x0e1a('0x6d')],'as':'CustomFields'}]})[_0x0e1a('0x29')](handleEntityNotFound(_0x50007a,null))[_0x0e1a('0x29')](function(_0x1f1be8){if(_0x1f1be8){_0xf7c3ed=_0x1f1be8;return db['CmContact'][_0x0e1a('0x32')];}})[_0x0e1a('0x29')](function(_0x3c3fd9){if(_0x3c3fd9){var _0x569f15={};var _0x1df5b8={};_0x1df5b8[_0x0e1a('0x34')]=_['concat'](_[_0x0e1a('0x37')](_0x3c3fd9),_['map'](_0xf7c3ed['CustomFields'],function(_0x46250d){return util['format'](_0x0e1a('0x6e'),_0x46250d['id']);}));_0x1df5b8[_0x0e1a('0x36')]=_[_0x0e1a('0x37')](_0x2bc3c2[_0x0e1a('0x36')]);_0x1df5b8[_0x0e1a('0x38')]=_[_0x0e1a('0x3a')](_0x1df5b8[_0x0e1a('0x34')],_0x1df5b8[_0x0e1a('0x36')]);_0x569f15[_0x0e1a('0x39')]=_[_0x0e1a('0x3a')](_0x1df5b8['model'],qs[_0x0e1a('0x49')](_0x2bc3c2[_0x0e1a('0x36')][_0x0e1a('0x49')]));_0x569f15['attributes']=_0x569f15['attributes'][_0x0e1a('0x3b')]?_0x569f15[_0x0e1a('0x39')]:_0x1df5b8[_0x0e1a('0x34')];if(!_0x2bc3c2['query']['hasOwnProperty']('nolimit')){_0x569f15[_0x0e1a('0x20')]=qs[_0x0e1a('0x20')](_0x2bc3c2[_0x0e1a('0x36')]['limit']);_0x569f15[_0x0e1a('0x1f')]=qs[_0x0e1a('0x1f')](_0x2bc3c2[_0x0e1a('0x36')][_0x0e1a('0x1f')]);}_0x569f15[_0x0e1a('0x3e')]=qs['sort'](_0x2bc3c2[_0x0e1a('0x36')]['sort']);_0x569f15[_0x0e1a('0x40')]=qs['filters'](_['pick'](_0x2bc3c2['query'],_0x1df5b8['filters']));_0x569f15[_0x0e1a('0x6f')]=!![];if(_0x2bc3c2[_0x0e1a('0x36')]['filter']){_0x569f15[_0x0e1a('0x40')]=_['merge'](_0x569f15[_0x0e1a('0x40')],{'$or':_[_0x0e1a('0x35')](_0x569f15[_0x0e1a('0x39')],function(_0x38dfe1){var _0x5b7778={};_0x5b7778[_0x38dfe1]={'$like':'%'+_0x2bc3c2[_0x0e1a('0x36')]['filter']+'%'};return _0x5b7778;})});}_0x569f15=_[_0x0e1a('0x42')]({},_0x569f15,_0x2bc3c2['options']);return _0xf7c3ed[_0x0e1a('0x6c')](_0x569f15);}})['then'](respondWithResult(_0x50007a,null))[_0x0e1a('0x47')](handleError(_0x50007a,null));};exports['getContactsCsv']=function(_0x328a44,_0x153277,_0xff628e){var _0x1afce3;var _0x2a1c5d;var _0x36f053;var _0x528e10=_0x328a44[_0x0e1a('0x54')]['id'];csv_results=[];return db['ContactItemType'][_0x0e1a('0x5c')]({'attributes':['id',_0x0e1a('0x2e')],'raw':!![],'order':[_0x0e1a('0x70')]})['then'](function(_0x23ad1f){_0x1afce3=_0x23ad1f;var _0x30522b=_['keys'](db[_0x0e1a('0x60')]['rawAttributes']);return db[_0x0e1a('0x6d')][_0x0e1a('0x5c')]({'raw':!![],'attributes':['id',_0x0e1a('0x71')]})['then'](function(_0x519d35){_0x2a1c5d=_0x519d35;var _0x1a0dd3=squel[_0x0e1a('0x72')]()[_0x0e1a('0x49')](_0x30522b)['from'](_0x0e1a('0x73'),'c')[_0x0e1a('0x40')]('c.ListId\x20=\x20?',_0x528e10)[_0x0e1a('0x40')](_0x0e1a('0x74'))['distinct']();for(var _0x40e354=0x0;_0x40e354<_0x2a1c5d['length'];_0x40e354++){_0x1a0dd3[_0x0e1a('0x75')](_0x0e1a('0x76')+_0x2a1c5d[_0x40e354]['id'],'customField_'+_0x2a1c5d[_0x40e354]['alias']);}for(var _0x40e354=0x0;_0x40e354<_0x1afce3[_0x0e1a('0x3b')];_0x40e354++){_0x1a0dd3[_0x0e1a('0x75')](squel[_0x0e1a('0x72')]()['field'](_0x0e1a('0x77'))['from']('cm_contact_has_items')[_0x0e1a('0x40')]('ItemTypeId\x20=\x20?',_0x1afce3[_0x40e354]['id'])['where'](_0x0e1a('0x78')),_0x0e1a('0x79')+_0x1afce3[_0x40e354][_0x0e1a('0x2e')]);_0x1a0dd3[_0x0e1a('0x75')](squel['select']()[_0x0e1a('0x75')]('description')['from'](_0x0e1a('0x7a'))['where'](_0x0e1a('0x7b'),_0x1afce3[_0x40e354]['id'])[_0x0e1a('0x40')](_0x0e1a('0x78')),_0x0e1a('0x7c')+_0x1afce3[_0x40e354]['name']);}var _0x5d625a=[];_0x5d625a[_0x0e1a('0x64')](_0x1a0dd3['toString']());BPromise[_0x0e1a('0x65')](_0x5d625a,handleQuery)[_0x0e1a('0x29')](function(_0x3a3ac4){handleQuery(_0x1a0dd3[_0x0e1a('0x7d')]());var _0x30621b=csv_results[0x0];if(!_[_0x0e1a('0x7e')](_0x30621b)){var _0x5dcbd1=toCsv(_0x30621b);var _0x49cc69=Date[_0x0e1a('0x7f')]();fs[_0x0e1a('0x80')](util[_0x0e1a('0x81')](_0x0e1a('0x82'),_0x528e10,_0x49cc69),_0x5dcbd1);_0x153277[_0x0e1a('0x83')]('Content-disposition',_0x0e1a('0x84')+util[_0x0e1a('0x81')](_0x0e1a('0x85'),_0x528e10,_0x49cc69));_0x153277[_0x0e1a('0x83')](_0x0e1a('0x86'),_0x0e1a('0x87'));return _0x153277[_0x0e1a('0x88')](util[_0x0e1a('0x81')]('/tmp/list_%d_%s.csv',_0x528e10,_0x49cc69));}else{return _0x153277[_0x0e1a('0x1d')](0xcc);}});});});};exports[_0x0e1a('0x89')]=function(_0x279080,_0x3beabd,_0x517dc6){var _0x15e2ce;delete _0x279080[_0x0e1a('0x4b')]['id'];return db['CmList'][_0x0e1a('0x59')]({'where':{'id':_0x279080[_0x0e1a('0x54')]['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x3beabd,null))[_0x0e1a('0x29')](function(_0x5470d4){if(_0x5470d4){return db[_0x0e1a('0x8a')][_0x0e1a('0x8b')](function(_0x59dbb7){return db['CmCustomField']['create'](_0x279080[_0x0e1a('0x4b')],{'transaction':_0x59dbb7})[_0x0e1a('0x29')](function(_0x2947b3){_0x15e2ce=_0x2947b3;return _0x5470d4[_0x0e1a('0x8c')](_0x2947b3,{'transaction':_0x59dbb7});})[_0x0e1a('0x29')](function(){var _0x543934={'type':db[_0x0e1a('0x8d')][_0x0e1a('0x8e')],'transaction':_0x59dbb7};switch(_0x279080[_0x0e1a('0x4b')]['type']){case _0x0e1a('0x8f'):_0x543934[_0x0e1a('0x33')]=db[_0x0e1a('0x8d')][_0x0e1a('0x8e')];break;case _0x0e1a('0x90'):_0x543934[_0x0e1a('0x33')]=db[_0x0e1a('0x8d')][_0x0e1a('0x91')];break;case _0x0e1a('0x92'):_0x543934[_0x0e1a('0x33')]=db['Sequelize'][_0x0e1a('0x93')];_0x543934['defaultValue']=![];break;default:}return db[_0x0e1a('0x8a')][_0x0e1a('0x94')][_0x0e1a('0x95')](_0x0e1a('0x73'),util[_0x0e1a('0x81')](_0x0e1a('0x96'),_0x15e2ce['id']),_0x543934);})[_0x0e1a('0x29')](function(){return _0x15e2ce;});});}})[_0x0e1a('0x29')](respondWithResult(_0x3beabd,null))[_0x0e1a('0x47')](handleError(_0x3beabd,null));};exports[_0x0e1a('0x97')]=function(_0x4e2e9c,_0x41c610,_0x588af9){var _0x28bafa={};var _0x2a43fd={};var _0x28218a;var _0x20120a;return db['CmList'][_0x0e1a('0x59')]({'where':{'id':_0x4e2e9c[_0x0e1a('0x54')]['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x41c610,null))['then'](function(_0x24ff0f){if(_0x24ff0f){_0x28218a=_0x24ff0f;_0x2a43fd[_0x0e1a('0x34')]=_[_0x0e1a('0x37')](db[_0x0e1a('0x6d')]['rawAttributes']);_0x2a43fd[_0x0e1a('0x36')]=_['keys'](_0x4e2e9c[_0x0e1a('0x36')]);_0x2a43fd['filters']=_[_0x0e1a('0x3a')](_0x2a43fd[_0x0e1a('0x34')],_0x2a43fd[_0x0e1a('0x36')]);_0x28bafa[_0x0e1a('0x39')]=_[_0x0e1a('0x3a')](_0x2a43fd[_0x0e1a('0x34')],qs[_0x0e1a('0x49')](_0x4e2e9c[_0x0e1a('0x36')]['fields']));_0x28bafa['attributes']=_0x28bafa[_0x0e1a('0x39')][_0x0e1a('0x3b')]?_0x28bafa[_0x0e1a('0x39')]:_0x2a43fd[_0x0e1a('0x34')];_0x28bafa[_0x0e1a('0x3e')]=qs['sort'](_0x4e2e9c['query']['sort']);_0x28bafa[_0x0e1a('0x40')]=qs[_0x0e1a('0x38')](_[_0x0e1a('0x5a')](_0x4e2e9c[_0x0e1a('0x36')],_0x2a43fd[_0x0e1a('0x38')]));_0x28bafa[_0x0e1a('0x40')]=_[_0x0e1a('0x42')](_0x28bafa[_0x0e1a('0x40')],{'$or':[{'ListId':_0x24ff0f['id']},{'ListId':null}]});if(_0x4e2e9c[_0x0e1a('0x36')][_0x0e1a('0x41')]){_0x28bafa['where']=_[_0x0e1a('0x42')](_0x28bafa[_0x0e1a('0x40')],{'$or':_[_0x0e1a('0x35')](_0x28bafa['attributes'],function(_0x1b1177){var _0x52a15d={};_0x52a15d[_0x1b1177]={'$like':'%'+_0x4e2e9c[_0x0e1a('0x36')][_0x0e1a('0x41')]+'%'};return _0x52a15d;})});}_0x28bafa=_['merge']({},_0x28bafa,_0x4e2e9c[_0x0e1a('0x43')]);return db['CmCustomField'][_0x0e1a('0x98')](_0x28bafa);}})[_0x0e1a('0x29')](respondWithResult(_0x41c610,null))['catch'](handleError(_0x41c610,null));};exports['getGlobalCustomFields']=function(_0x4741b7,_0x351c56){return db[_0x0e1a('0x6d')][_0x0e1a('0x98')]({'where':{'ListId':null}})[_0x0e1a('0x29')](handleEntityNotFound(_0x351c56,null))['then'](function(_0x24bbe1){return _0x24bbe1;})[_0x0e1a('0x29')](respondWithResult(_0x351c56,null))[_0x0e1a('0x47')](handleError(_0x351c56,null));};exports[_0x0e1a('0x99')]=function(_0x2ad2f3,_0x1d2463,_0x32b4ef){return db[_0x0e1a('0x31')][_0x0e1a('0x4f')]({'where':{'id':_0x2ad2f3[_0x0e1a('0x54')]['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x1d2463,null))[_0x0e1a('0x29')](function(_0x5681c9){if(_0x5681c9){return _0x5681c9[_0x0e1a('0x99')](_0x2ad2f3[_0x0e1a('0x4b')]['ids'],_[_0x0e1a('0x9a')](_0x2ad2f3[_0x0e1a('0x4b')],[_0x0e1a('0x5e'),'id'])||{})[_0x0e1a('0x9b')](function(_0x4fd8cb){for(var _0x504a21=0x0;_0x504a21<_0x2ad2f3[_0x0e1a('0x4b')][_0x0e1a('0x5e')][_0x0e1a('0x3b')];_0x504a21+=0x1){socket[_0x0e1a('0x9c')](_0x0e1a('0x9d'),{'UserId':Number(_0x2ad2f3[_0x0e1a('0x4b')][_0x0e1a('0x5e')][_0x504a21]),'CmListId':Number(_0x2ad2f3[_0x0e1a('0x54')]['id'])});}return _0x4fd8cb;});}})['then'](respondWithResult(_0x1d2463,null))[_0x0e1a('0x47')](handleError(_0x1d2463,null));};exports[_0x0e1a('0x9e')]=function(_0x40bbc8,_0x5e502a,_0x502291){return db[_0x0e1a('0x31')]['find']({'where':{'id':_0x40bbc8[_0x0e1a('0x54')]['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x5e502a,null))[_0x0e1a('0x29')](function(_0xee314b){if(_0xee314b){return _0xee314b[_0x0e1a('0x9e')](_0x40bbc8[_0x0e1a('0x36')]['ids'])[_0x0e1a('0x29')](function(){if(_['isArray'](_0x40bbc8['query'][_0x0e1a('0x5e')])){for(var _0x2a808d=0x0;_0x2a808d<_0x40bbc8[_0x0e1a('0x36')][_0x0e1a('0x5e')][_0x0e1a('0x3b')];_0x2a808d+=0x1){socket[_0x0e1a('0x9c')]('userCmList:remove',{'UserId':Number(_0x40bbc8[_0x0e1a('0x36')][_0x0e1a('0x5e')][_0x2a808d]),'CmListId':Number(_0x40bbc8[_0x0e1a('0x54')]['id'])});}}else{socket[_0x0e1a('0x9c')](_0x0e1a('0x9f'),{'UserId':Number(_0x40bbc8[_0x0e1a('0x36')][_0x0e1a('0x5e')]),'CmListId':Number(_0x40bbc8['params']['id'])});}});}})[_0x0e1a('0x29')](respondWithStatusCode(_0x5e502a,null))[_0x0e1a('0x47')](handleError(_0x5e502a,null));};exports['getAgents']=function(_0x17823d,_0x5ea285,_0x155925){var _0x28194e={};var _0x497659={};var _0x2d68b9;var _0x8a0601;return db[_0x0e1a('0x31')][_0x0e1a('0x59')]({'where':{'id':_0x17823d['params']['id']}})[_0x0e1a('0x29')](handleEntityNotFound(_0x5ea285,null))[_0x0e1a('0x29')](function(_0x268094){if(_0x268094){_0x2d68b9=_0x268094;_0x497659[_0x0e1a('0x34')]=_['keys'](db[_0x0e1a('0xa0')][_0x0e1a('0x32')]);_0x497659[_0x0e1a('0x36')]=_[_0x0e1a('0x37')](_0x17823d[_0x0e1a('0x36')]);_0x497659[_0x0e1a('0x38')]=_['intersection'](_0x497659[_0x0e1a('0x34')],_0x497659[_0x0e1a('0x36')]);_0x28194e[_0x0e1a('0x39')]=_[_0x0e1a('0x3a')](_0x497659[_0x0e1a('0x34')],qs[_0x0e1a('0x49')](_0x17823d[_0x0e1a('0x36')][_0x0e1a('0x49')]));_0x28194e[_0x0e1a('0x39')]=_0x28194e[_0x0e1a('0x39')][_0x0e1a('0x3b')]?_0x28194e['attributes']:_0x497659[_0x0e1a('0x34')];_0x28194e[_0x0e1a('0x3e')]=qs[_0x0e1a('0x3f')](_0x17823d[_0x0e1a('0x36')]['sort']);_0x28194e['where']=qs[_0x0e1a('0x38')](_[_0x0e1a('0x5a')](_0x17823d[_0x0e1a('0x36')],_0x497659[_0x0e1a('0x38')]));if(_0x17823d['query']['filter']){_0x28194e[_0x0e1a('0x40')]=_[_0x0e1a('0x42')](_0x28194e[_0x0e1a('0x40')],{'$or':_['map'](_0x28194e[_0x0e1a('0x39')],function(_0x49c281){var _0x58764e={};_0x58764e[_0x49c281]={'$like':'%'+_0x17823d[_0x0e1a('0x36')][_0x0e1a('0x41')]+'%'};return _0x58764e;})});}_0x28194e=_[_0x0e1a('0x42')]({},_0x28194e,_0x17823d[_0x0e1a('0x43')]);return _0x2d68b9[_0x0e1a('0xa1')](_0x28194e);}})[_0x0e1a('0x29')](function(_0x5105d0){if(_0x5105d0){_0x8a0601=_0x5105d0[_0x0e1a('0x3b')];if(!_0x17823d[_0x0e1a('0x36')][_0x0e1a('0x3c')]('nolimit')){_0x28194e['limit']=qs[_0x0e1a('0x20')](_0x17823d['query'][_0x0e1a('0x20')]);_0x28194e['offset']=qs[_0x0e1a('0x1f')](_0x17823d[_0x0e1a('0x36')][_0x0e1a('0x1f')]);}return _0x2d68b9[_0x0e1a('0xa1')](_0x28194e);}})[_0x0e1a('0x29')](function(_0x1c1074){if(_0x1c1074){return _0x1c1074?{'count':_0x8a0601,'rows':_0x1c1074}:null;}})[_0x0e1a('0x29')](respondWithResult(_0x5ea285,null))[_0x0e1a('0x47')](handleError(_0x5ea285,null));};function handleQuery(_0x158d70){logger[_0x0e1a('0xa2')](_0x158d70);return db['sequelize'][_0x0e1a('0x36')](_0x158d70)[_0x0e1a('0x9b')](function(_0x10afd4){csv_results['push'](_0x10afd4);})[_0x0e1a('0x47')](function(_0x13eb52){logger[_0x0e1a('0x2d')](_0x13eb52['message']);});} \ No newline at end of file +var _0x5da0=['order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','success','dataValues','errors','message','Malformed\x20request\x20syntax','CustomFields','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','OrderBy','CmCustomField','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','c.cf_','customField_','alias','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','isEmpty','writeFileSync','format','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./cmList.socket','register','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x5da0,0x10e));var _0x05da=function(_0x4dd34e,_0x1c94f6){_0x4dd34e=_0x4dd34e-0x0;var _0x7339d=_0x5da0[_0x4dd34e];return _0x7339d;};'use strict';var emlformat=require(_0x05da('0x0'));var rimraf=require(_0x05da('0x1'));var zipdir=require(_0x05da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x05da('0x3'));var BPromise=require(_0x05da('0x4'));var Mustache=require(_0x05da('0x5'));var util=require(_0x05da('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x05da('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05da('0x8'));var squel=require(_0x05da('0x9'));var crypto=require(_0x05da('0xa'));var jsforce=require(_0x05da('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x05da('0xc'));var Papa=require(_0x05da('0xd'));var Redis=require(_0x05da('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x05da('0xf'));var as=require(_0x05da('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x05da('0x11'))('api');var utils=require(_0x05da('0x12'));var config=require(_0x05da('0x13'));var licenseUtil=require(_0x05da('0x14'));var db=require(_0x05da('0x15'))['db'];var csv_results;config[_0x05da('0x16')]=_[_0x05da('0x17')](config[_0x05da('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x05da('0x18'))[_0x05da('0x19')](socket);function respondWithStatusCode(_0x4356f1,_0x53728e){_0x53728e=_0x53728e||0xcc;return function(_0x4baef1){if(_0x4baef1){return _0x4356f1['sendStatus'](_0x53728e);}return _0x4356f1['status'](_0x53728e)[_0x05da('0x1a')]();};}function respondWithResult(_0x56689c,_0x31bf27){_0x31bf27=_0x31bf27||0xc8;return function(_0x586112){if(_0x586112){return _0x56689c[_0x05da('0x1b')](_0x31bf27)[_0x05da('0x1c')](_0x586112);}};}function respondWithFilteredResult(_0x5adc73,_0x47743f){return function(_0x60cb4){if(_0x60cb4){var _0x2c6936=typeof _0x47743f[_0x05da('0x1d')]===_0x05da('0x1e')&&typeof _0x47743f[_0x05da('0x1f')]===_0x05da('0x1e');var _0x130125=_0x60cb4['count'];var _0x528a9f=_0x2c6936?0x0:_0x47743f[_0x05da('0x1d')];var _0x4892e3=_0x2c6936?_0x60cb4[_0x05da('0x20')]:_0x47743f[_0x05da('0x1d')]+_0x47743f[_0x05da('0x1f')];var _0x3d15d2;if(_0x4892e3>=_0x130125){_0x4892e3=_0x130125;_0x3d15d2=0xc8;}else{_0x3d15d2=0xce;}_0x5adc73[_0x05da('0x1b')](_0x3d15d2);return _0x5adc73['set'](_0x05da('0x21'),_0x528a9f+'-'+_0x4892e3+'/'+_0x130125)[_0x05da('0x1c')](_0x60cb4);}return null;};}function patchUpdates(_0x1729d7){return function(_0x3a6719){try{jsonpatch['apply'](_0x3a6719,_0x1729d7,!![]);}catch(_0x1bfd5c){return BPromise[_0x05da('0x22')](_0x1bfd5c);}return _0x3a6719[_0x05da('0x23')]();};}function saveUpdates(_0x299199,_0x109804){return function(_0x155937){if(_0x155937){return _0x155937['update'](_0x299199)[_0x05da('0x24')](function(_0x86c5aa){return _0x86c5aa;});}return null;};}function removeEntity(_0x24af41,_0x6f85de){return function(_0xe8cf3b){if(_0xe8cf3b){return _0xe8cf3b[_0x05da('0x25')]()[_0x05da('0x24')](function(){var _0x4b07fa=_0xe8cf3b[_0x05da('0x26')]({'plain':!![]});var _0x4aa9a0=_0x05da('0x27');return db[_0x05da('0x28')]['destroy']({'where':{'type':_0x4aa9a0,'resourceId':_0x4b07fa['id']}})[_0x05da('0x24')](function(){return _0xe8cf3b;});})[_0x05da('0x24')](function(){_0x24af41[_0x05da('0x1b')](0xcc)[_0x05da('0x1a')]();});}};}function handleEntityNotFound(_0x989e46,_0x16b29b){return function(_0x652af5){if(!_0x652af5){_0x989e46['sendStatus'](0x194);}return _0x652af5;};}function handleError(_0x31a273,_0x4e9beb){_0x4e9beb=_0x4e9beb||0x1f4;return function(_0x491a6b){logger[_0x05da('0x29')](_0x491a6b[_0x05da('0x2a')]);if(_0x491a6b[_0x05da('0x2b')]){delete _0x491a6b['name'];}_0x31a273['status'](_0x4e9beb)[_0x05da('0x2c')](_0x491a6b);};}exports[_0x05da('0x2d')]=function(_0x563fca,_0x10d948){var _0x371a54={},_0x558eb6={},_0x39924b={'count':0x0,'rows':[]};var _0x10be6c=_[_0x05da('0x2e')](db[_0x05da('0x2f')][_0x05da('0x30')],function(_0x206ffb){return{'name':_0x206ffb[_0x05da('0x31')],'type':_0x206ffb[_0x05da('0x32')][_0x05da('0x33')]};});_0x558eb6[_0x05da('0x34')]=_[_0x05da('0x2e')](_0x10be6c,_0x05da('0x2b'));_0x558eb6[_0x05da('0x35')]=_[_0x05da('0x36')](_0x563fca[_0x05da('0x35')]);_0x558eb6[_0x05da('0x37')]=_[_0x05da('0x38')](_0x558eb6[_0x05da('0x34')],_0x558eb6[_0x05da('0x35')]);_0x371a54[_0x05da('0x39')]=_[_0x05da('0x38')](_0x558eb6[_0x05da('0x34')],qs[_0x05da('0x3a')](_0x563fca[_0x05da('0x35')]['fields']));_0x371a54[_0x05da('0x39')]=_0x371a54[_0x05da('0x39')][_0x05da('0x3b')]?_0x371a54[_0x05da('0x39')]:_0x558eb6[_0x05da('0x34')];if(!_0x563fca[_0x05da('0x35')][_0x05da('0x3c')](_0x05da('0x3d'))){_0x371a54[_0x05da('0x1f')]=qs[_0x05da('0x1f')](_0x563fca[_0x05da('0x35')][_0x05da('0x1f')]);_0x371a54[_0x05da('0x1d')]=qs[_0x05da('0x1d')](_0x563fca[_0x05da('0x35')]['offset']);}_0x371a54[_0x05da('0x3e')]=qs[_0x05da('0x3f')](_0x563fca['query'][_0x05da('0x3f')]);_0x371a54[_0x05da('0x40')]=qs[_0x05da('0x37')](_[_0x05da('0x41')](_0x563fca['query'],_0x558eb6[_0x05da('0x37')]),_0x10be6c);if(_0x563fca[_0x05da('0x35')][_0x05da('0x42')]){_0x371a54[_0x05da('0x40')]=_[_0x05da('0x43')](_0x371a54[_0x05da('0x40')],{'$or':_[_0x05da('0x2e')](_0x10be6c,function(_0x5ae4a8){if(_0x5ae4a8[_0x05da('0x32')]!=='VIRTUAL'){var _0x24a81f={};_0x24a81f[_0x5ae4a8[_0x05da('0x2b')]]={'$like':'%'+_0x563fca['query'][_0x05da('0x42')]+'%'};return _0x24a81f;}})});}_0x371a54=_[_0x05da('0x43')]({},_0x371a54,_0x563fca[_0x05da('0x44')]);var _0x287932={'where':_0x371a54['where']};return db[_0x05da('0x2f')][_0x05da('0x20')](_0x287932)['then'](function(_0x55f8c8){_0x39924b[_0x05da('0x20')]=_0x55f8c8;if(_0x563fca[_0x05da('0x35')][_0x05da('0x45')]){_0x371a54['include']=[{'all':!![]}];}return db[_0x05da('0x2f')]['findAll'](_0x371a54);})['then'](function(_0x39a23c){_0x39924b[_0x05da('0x46')]=_0x39a23c;return _0x39924b;})['then'](respondWithFilteredResult(_0x10d948,_0x371a54))[_0x05da('0x47')](handleError(_0x10d948,null));};exports[_0x05da('0x48')]=function(_0x1150fd,_0x33f7ae){var _0x53d5ac={'raw':![],'where':{'id':_0x1150fd['params']['id']}},_0x33972e={};_0x33972e[_0x05da('0x34')]=_[_0x05da('0x36')](db['CmList'][_0x05da('0x30')]);_0x33972e[_0x05da('0x35')]=_['keys'](_0x1150fd['query']);_0x33972e['filters']=_['intersection'](_0x33972e[_0x05da('0x34')],_0x33972e['query']);_0x53d5ac[_0x05da('0x39')]=_[_0x05da('0x38')](_0x33972e['model'],qs[_0x05da('0x3a')](_0x1150fd[_0x05da('0x35')]['fields']));_0x53d5ac[_0x05da('0x39')]=_0x53d5ac['attributes']['length']?_0x53d5ac[_0x05da('0x39')]:_0x33972e[_0x05da('0x34')];if(_0x1150fd[_0x05da('0x35')][_0x05da('0x45')]){_0x53d5ac[_0x05da('0x49')]=[{'all':!![]}];}_0x53d5ac=_[_0x05da('0x43')]({},_0x53d5ac,_0x1150fd[_0x05da('0x44')]);return db[_0x05da('0x2f')][_0x05da('0x4a')](_0x53d5ac)[_0x05da('0x24')](handleEntityNotFound(_0x33f7ae,null))[_0x05da('0x24')](respondWithResult(_0x33f7ae,null))[_0x05da('0x47')](handleError(_0x33f7ae,null));};exports[_0x05da('0x4b')]=function(_0x4084e2,_0x12b1f1){return db['CmList'][_0x05da('0x4b')](_0x4084e2[_0x05da('0x4c')],{})[_0x05da('0x24')](function(_0x5d89af){var _0xa52d7=_0x4084e2[_0x05da('0x4d')][_0x05da('0x26')]({'plain':!![]});if(!_0xa52d7)throw new Error(_0x05da('0x4e'));if(_0xa52d7[_0x05da('0x4f')]===_0x05da('0x4d')){var _0x53e02f=_0x5d89af[_0x05da('0x26')]({'plain':!![]});var _0x58f33e=_0x05da('0x27');return db[_0x05da('0x50')]['find']({'where':{'name':_0x58f33e,'userProfileId':_0xa52d7[_0x05da('0x51')]},'raw':!![]})[_0x05da('0x24')](function(_0x4c7fdf){if(_0x4c7fdf&&_0x4c7fdf[_0x05da('0x52')]===0x0){return db[_0x05da('0x28')][_0x05da('0x4b')]({'name':_0x53e02f[_0x05da('0x2b')],'resourceId':_0x53e02f['id'],'type':_0x4c7fdf['name'],'sectionId':_0x4c7fdf['id']},{})[_0x05da('0x24')](function(){return _0x5d89af;});}else{return _0x5d89af;}})['catch'](function(_0x3aea5c){logger[_0x05da('0x29')](_0x05da('0x53'),_0x3aea5c);throw _0x3aea5c;});}return _0x5d89af;})['then'](respondWithResult(_0x12b1f1,0xc9))[_0x05da('0x47')](handleError(_0x12b1f1,null));};exports[_0x05da('0x54')]=function(_0x5f1034,_0x5d0b33){if(_0x5f1034[_0x05da('0x4c')]['id']){delete _0x5f1034[_0x05da('0x4c')]['id'];}return db[_0x05da('0x2f')][_0x05da('0x4a')]({'where':{'id':_0x5f1034[_0x05da('0x55')]['id']}})[_0x05da('0x24')](handleEntityNotFound(_0x5d0b33,null))[_0x05da('0x24')](saveUpdates(_0x5f1034[_0x05da('0x4c')],null))[_0x05da('0x24')](respondWithResult(_0x5d0b33,null))[_0x05da('0x47')](handleError(_0x5d0b33,null));};exports[_0x05da('0x25')]=function(_0x41d7d8,_0x2aade8){return db[_0x05da('0x2f')][_0x05da('0x4a')]({'where':{'id':_0x41d7d8['params']['id']}})[_0x05da('0x24')](handleEntityNotFound(_0x2aade8,null))[_0x05da('0x24')](removeEntity(_0x2aade8,null))['catch'](handleError(_0x2aade8,null));};exports[_0x05da('0x56')]=function(_0x375852,_0x4c18c4){return db['CmList'][_0x05da('0x56')]()[_0x05da('0x24')](respondWithResult(_0x4c18c4,null))[_0x05da('0x47')](handleError(_0x4c18c4,null));};exports[_0x05da('0x57')]=function(_0x128473,_0x422f99,_0x4e692c){if(_0x128473[_0x05da('0x4c')]['id']){delete _0x128473[_0x05da('0x4c')]['id'];}return db['CmList'][_0x05da('0x4a')]({'where':{'id':_0x128473[_0x05da('0x55')]['id']}})[_0x05da('0x24')](handleEntityNotFound(_0x422f99,null))['then'](function(_0x39a621){if(_0x39a621){_0x128473[_0x05da('0x4c')][_0x05da('0x58')]=_0x39a621['id'];return db[_0x05da('0x59')][_0x05da('0x4b')](_0x128473['body']);}})[_0x05da('0x24')](respondWithResult(_0x422f99,null))[_0x05da('0x47')](handleError(_0x422f99,null));};exports[_0x05da('0x5a')]=function(_0x37a409,_0x48bc3d,_0x1c19ff){var _0x111f01={'raw':![],'where':{}};var _0xe02c38={};var _0xaeb98b={'count':0x0,'rows':[]};return db[_0x05da('0x2f')][_0x05da('0x5b')]({'where':{'id':_0x37a409[_0x05da('0x55')]['id']}})[_0x05da('0x24')](handleEntityNotFound(_0x48bc3d,null))['then'](function(_0xeb0fd4){if(_0xeb0fd4){_0xe02c38[_0x05da('0x34')]=_['keys'](db[_0x05da('0x59')][_0x05da('0x30')]);_0xe02c38[_0x05da('0x35')]=_[_0x05da('0x36')](_0x37a409[_0x05da('0x35')]);_0xe02c38[_0x05da('0x37')]=_[_0x05da('0x38')](_0xe02c38[_0x05da('0x34')],_0xe02c38[_0x05da('0x35')]);_0x111f01[_0x05da('0x39')]=_[_0x05da('0x38')](_0xe02c38[_0x05da('0x34')],qs[_0x05da('0x3a')](_0x37a409[_0x05da('0x35')]['fields']));_0x111f01[_0x05da('0x39')]=_0x111f01[_0x05da('0x39')][_0x05da('0x3b')]?_0x111f01['attributes']:_0xe02c38[_0x05da('0x34')];if(!_0x37a409[_0x05da('0x35')][_0x05da('0x3c')](_0x05da('0x3d'))){_0x111f01['limit']=qs[_0x05da('0x1f')](_0x37a409[_0x05da('0x35')][_0x05da('0x1f')]);_0x111f01[_0x05da('0x1d')]=qs[_0x05da('0x1d')](_0x37a409['query'][_0x05da('0x1d')]);}_0x111f01[_0x05da('0x3e')]=qs[_0x05da('0x3f')](_0x37a409[_0x05da('0x35')]['sort']);_0x111f01['where']=qs[_0x05da('0x37')](_[_0x05da('0x41')](_0x37a409[_0x05da('0x35')],_0xe02c38['filters']));_0x111f01['where']['ListId']=_0xeb0fd4['id'];if(_0x37a409[_0x05da('0x35')]['filter']){_0x111f01[_0x05da('0x40')]=_[_0x05da('0x43')](_0x111f01[_0x05da('0x40')],{'$or':_[_0x05da('0x2e')](_0x111f01[_0x05da('0x39')],function(_0x5dfe91){var _0xa44d5f={};_0xa44d5f[_0x5dfe91]={'$like':'%'+_0x37a409[_0x05da('0x35')]['filter']+'%'};return _0xa44d5f;})});}_0x111f01=_[_0x05da('0x43')]({},_0x111f01,_0x37a409[_0x05da('0x44')]);return db['Disposition'][_0x05da('0x20')]({'where':_0x111f01[_0x05da('0x40')]})[_0x05da('0x24')](function(_0x3662da){_0xaeb98b[_0x05da('0x20')]=_0x3662da;if(_0x37a409[_0x05da('0x35')][_0x05da('0x45')]){_0x111f01[_0x05da('0x49')]=[{'all':!![]}];}return db[_0x05da('0x59')][_0x05da('0x5c')](_0x111f01);})['then'](function(_0x58b0a5){_0xaeb98b[_0x05da('0x46')]=_0x58b0a5;return _0xaeb98b;});}})[_0x05da('0x24')](respondWithFilteredResult(_0x48bc3d,_0x111f01))[_0x05da('0x47')](handleError(_0x48bc3d,null));};exports[_0x05da('0x5d')]=function(_0x35d5bc,_0x59a9ad,_0x313be9){return db[_0x05da('0x2f')][_0x05da('0x4a')]({'where':{'id':_0x35d5bc[_0x05da('0x55')]['id']}})[_0x05da('0x24')](handleEntityNotFound(_0x59a9ad,null))[_0x05da('0x24')](function(_0x3809c3){if(_0x3809c3){return _0x3809c3[_0x05da('0x5d')](_0x35d5bc[_0x05da('0x35')][_0x05da('0x5e')]);}})[_0x05da('0x24')](respondWithStatusCode(_0x59a9ad,null))[_0x05da('0x47')](handleError(_0x59a9ad,null));};exports[_0x05da('0x5f')]=function(_0x41990e,_0x18b814,_0x4cfa78){return db[_0x05da('0x2f')][_0x05da('0x4a')]({'where':{'id':_0x41990e[_0x05da('0x55')]['id']}})['then'](handleEntityNotFound(_0x18b814,null))['then'](function(_0x607ef2){if(_0x607ef2){var _0x2986a4=[];var _0x1420b0={'success':[],'errors':[]};return db[_0x05da('0x60')][_0x05da('0x56')]()[_0x05da('0x24')](function(_0x57555e){if(_0x41990e[_0x05da('0x4c')]['tags']&&_[_0x05da('0x61')](_0x41990e[_0x05da('0x4c')]['tags'])){if(_0x41990e[_0x05da('0x4c')][_0x05da('0x62')][_0x05da('0x3b')]){_0x41990e[_0x05da('0x4c')][_0x05da('0x62')]=_0x41990e[_0x05da('0x4c')][_0x05da('0x62')]['join'](';')+';';}else{_0x41990e[_0x05da('0x4c')][_0x05da('0x62')]=null;}}else{_0x41990e['body'][_0x05da('0x62')]=null;}if(_0x41990e[_0x05da('0x4c')]&&_['isArray'](_0x41990e[_0x05da('0x4c')])){for(var _0x2297af=0x0;_0x2297af<_0x41990e['body'][_0x05da('0x3b')];_0x2297af+=0x1){_0x41990e[_0x05da('0x4c')][_0x2297af][_0x05da('0x58')]=_0x41990e[_0x05da('0x55')]['id'];_0x2986a4[_0x05da('0x63')](_0x41990e[_0x05da('0x4c')][_0x2297af]);}return BPromise[_0x05da('0x64')](_0x2986a4,function(_0x110f88){return db[_0x05da('0x60')][_0x05da('0x4b')](_['omit'](_0x110f88,[_0x05da('0x5e'),'id'])||{},{'fields':_['keys'](_0x57555e),'raw':!![]})[_0x05da('0x24')](function(_0x549cee){_0x1420b0[_0x05da('0x65')][_0x05da('0x63')](_0x549cee[_0x05da('0x66')]);})[_0x05da('0x47')](function(_0x25acbc){_0x1420b0[_0x05da('0x67')][_0x05da('0x63')]({'data':_0x110f88,'error':_0x25acbc[_0x05da('0x68')]});});})['then'](function(_0x1604e7){return _0x1420b0;})[_0x05da('0x47')](function(_0x43047b){return _0x43047b;});}else{_0x18b814[_0x05da('0x1b')](0x190)[_0x05da('0x1c')]({'message':_0x05da('0x69')});}});}})['then'](respondWithResult(_0x18b814,null))[_0x05da('0x47')](handleError(_0x18b814,null));};exports['getContacts']=function(_0x300826,_0x488e3d,_0xed7aa0){var _0x3b6d67;return db[_0x05da('0x2f')][_0x05da('0x4a')]({'where':{'id':_0x300826[_0x05da('0x55')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x05da('0x6a')}]})['then'](handleEntityNotFound(_0x488e3d,null))['then'](function(_0x566ecf){if(_0x566ecf){_0x3b6d67=_0x566ecf;return db['CmContact'][_0x05da('0x30')];}})[_0x05da('0x24')](function(_0x471fc4){if(_0x471fc4){var _0x3f99f7={};var _0x5a13e9={};_0x5a13e9['model']=_['concat'](_['keys'](_0x471fc4),_['map'](_0x3b6d67[_0x05da('0x6a')],function(_0x3caa1b){return util['format'](_0x05da('0x6b'),_0x3caa1b['id']);}));_0x5a13e9[_0x05da('0x35')]=_[_0x05da('0x36')](_0x300826[_0x05da('0x35')]);_0x5a13e9[_0x05da('0x37')]=_[_0x05da('0x38')](_0x5a13e9[_0x05da('0x34')],_0x5a13e9[_0x05da('0x35')]);_0x3f99f7[_0x05da('0x39')]=_[_0x05da('0x38')](_0x5a13e9['model'],qs['fields'](_0x300826['query'][_0x05da('0x3a')]));_0x3f99f7[_0x05da('0x39')]=_0x3f99f7[_0x05da('0x39')]['length']?_0x3f99f7[_0x05da('0x39')]:_0x5a13e9[_0x05da('0x34')];if(!_0x300826[_0x05da('0x35')]['hasOwnProperty'](_0x05da('0x3d'))){_0x3f99f7[_0x05da('0x1f')]=qs[_0x05da('0x1f')](_0x300826['query'][_0x05da('0x1f')]);_0x3f99f7['offset']=qs[_0x05da('0x1d')](_0x300826[_0x05da('0x35')][_0x05da('0x1d')]);}_0x3f99f7[_0x05da('0x3e')]=qs[_0x05da('0x3f')](_0x300826[_0x05da('0x35')][_0x05da('0x3f')]);_0x3f99f7[_0x05da('0x40')]=qs[_0x05da('0x37')](_[_0x05da('0x41')](_0x300826[_0x05da('0x35')],_0x5a13e9[_0x05da('0x37')]));_0x3f99f7[_0x05da('0x6c')]=!![];if(_0x300826['query'][_0x05da('0x42')]){_0x3f99f7['where']=_[_0x05da('0x43')](_0x3f99f7[_0x05da('0x40')],{'$or':_[_0x05da('0x2e')](_0x3f99f7[_0x05da('0x39')],function(_0x5951a4){var _0x2a1507={};_0x2a1507[_0x5951a4]={'$like':'%'+_0x300826[_0x05da('0x35')][_0x05da('0x42')]+'%'};return _0x2a1507;})});}_0x3f99f7=_[_0x05da('0x43')]({},_0x3f99f7,_0x300826['options']);return _0x3b6d67[_0x05da('0x6d')](_0x3f99f7);}})[_0x05da('0x24')](respondWithResult(_0x488e3d,null))['catch'](handleError(_0x488e3d,null));};exports[_0x05da('0x6e')]=function(_0x39ff63,_0x1f4f13,_0x865916){var _0x423e88;var _0x1c6996;var _0x5d0a71;var _0x327927=_0x39ff63[_0x05da('0x55')]['id'];csv_results=[];return db[_0x05da('0x6f')][_0x05da('0x5c')]({'attributes':['id',_0x05da('0x2b')],'raw':!![],'order':[_0x05da('0x70')]})['then'](function(_0x42ae49){_0x423e88=_0x42ae49;var _0x12d7b6=_[_0x05da('0x36')](db[_0x05da('0x60')][_0x05da('0x30')]);return db[_0x05da('0x71')]['findAll']({'raw':!![],'attributes':['id','alias']})[_0x05da('0x24')](function(_0x37a2ef){_0x1c6996=_0x37a2ef;var _0x43a961=squel[_0x05da('0x72')]()['fields'](_0x12d7b6)[_0x05da('0x73')](_0x05da('0x74'),'c')[_0x05da('0x40')](_0x05da('0x75'),_0x327927)[_0x05da('0x40')](_0x05da('0x76'))['distinct']();for(var _0x3a6871=0x0;_0x3a6871<_0x1c6996[_0x05da('0x3b')];_0x3a6871++){_0x43a961['field'](_0x05da('0x77')+_0x1c6996[_0x3a6871]['id'],_0x05da('0x78')+_0x1c6996[_0x3a6871][_0x05da('0x79')]);}for(var _0x3a6871=0x0;_0x3a6871<_0x423e88[_0x05da('0x3b')];_0x3a6871++){_0x43a961[_0x05da('0x7a')](squel[_0x05da('0x72')]()[_0x05da('0x7a')](_0x05da('0x7b'))[_0x05da('0x73')](_0x05da('0x7c'))[_0x05da('0x40')](_0x05da('0x7d'),_0x423e88[_0x3a6871]['id'])[_0x05da('0x40')](_0x05da('0x7e')),_0x05da('0x7f')+_0x423e88[_0x3a6871][_0x05da('0x2b')]);_0x43a961['field'](squel['select']()[_0x05da('0x7a')]('description')[_0x05da('0x73')](_0x05da('0x7c'))[_0x05da('0x40')]('ItemTypeId\x20=\x20?',_0x423e88[_0x3a6871]['id'])['where']('CmContactId\x20=\x20c.id'),_0x05da('0x80')+_0x423e88[_0x3a6871][_0x05da('0x2b')]);}var _0x31a40a=[];_0x31a40a[_0x05da('0x63')](_0x43a961['toString']());BPromise['each'](_0x31a40a,handleQuery)['then'](function(_0x3787bd){handleQuery(_0x43a961[_0x05da('0x81')]());var _0x48fcee=csv_results[0x0];if(!_[_0x05da('0x82')](_0x48fcee)){var _0x4f4986=toCsv(_0x48fcee);var _0x1581b2=Date['now']();fs[_0x05da('0x83')](util[_0x05da('0x84')](_0x05da('0x85'),_0x327927,_0x1581b2),_0x4f4986);_0x1f4f13['setHeader'](_0x05da('0x86'),_0x05da('0x87')+util[_0x05da('0x84')](_0x05da('0x88'),_0x327927,_0x1581b2));_0x1f4f13[_0x05da('0x89')](_0x05da('0x8a'),_0x05da('0x8b'));return _0x1f4f13[_0x05da('0x8c')](util['format']('/tmp/list_%d_%s.csv',_0x327927,_0x1581b2));}else{return _0x1f4f13[_0x05da('0x8d')](0xcc);}});});});};exports[_0x05da('0x8e')]=function(_0x1c967e,_0x58d9ca,_0x174335){var _0x17acfa;delete _0x1c967e[_0x05da('0x4c')]['id'];return db[_0x05da('0x2f')]['findOne']({'where':{'id':_0x1c967e[_0x05da('0x55')]['id']}})[_0x05da('0x24')](handleEntityNotFound(_0x58d9ca,null))[_0x05da('0x24')](function(_0x2a4385){if(_0x2a4385){return db[_0x05da('0x8f')][_0x05da('0x90')](function(_0x24e773){return db[_0x05da('0x71')][_0x05da('0x4b')](_0x1c967e[_0x05da('0x4c')],{'transaction':_0x24e773})[_0x05da('0x24')](function(_0x56c8e8){_0x17acfa=_0x56c8e8;return _0x2a4385['addCustomFields'](_0x56c8e8,{'transaction':_0x24e773});})[_0x05da('0x24')](function(){var _0x31b96c={'type':db['Sequelize'][_0x05da('0x91')],'transaction':_0x24e773};switch(_0x1c967e[_0x05da('0x4c')][_0x05da('0x32')]){case _0x05da('0x92'):_0x31b96c[_0x05da('0x32')]=db[_0x05da('0x93')][_0x05da('0x91')];break;case _0x05da('0x94'):_0x31b96c[_0x05da('0x32')]=db[_0x05da('0x93')][_0x05da('0x95')];break;case _0x05da('0x96'):_0x31b96c[_0x05da('0x32')]=db[_0x05da('0x93')][_0x05da('0x97')];_0x31b96c[_0x05da('0x98')]=![];break;default:}return db['sequelize'][_0x05da('0x99')][_0x05da('0x9a')]('cm_contacts',util[_0x05da('0x84')]('cf_%s',_0x17acfa['id']),_0x31b96c);})['then'](function(){return _0x17acfa;});});}})['then'](respondWithResult(_0x58d9ca,null))[_0x05da('0x47')](handleError(_0x58d9ca,null));};exports[_0x05da('0x9b')]=function(_0x10b883,_0x335475,_0x586fea){var _0x5ae5c1={};var _0x37387d={};var _0x429eff;var _0x389763;return db[_0x05da('0x2f')][_0x05da('0x5b')]({'where':{'id':_0x10b883[_0x05da('0x55')]['id']}})['then'](handleEntityNotFound(_0x335475,null))[_0x05da('0x24')](function(_0x27a6d8){if(_0x27a6d8){_0x429eff=_0x27a6d8;_0x37387d[_0x05da('0x34')]=_[_0x05da('0x36')](db['CmCustomField'][_0x05da('0x30')]);_0x37387d['query']=_[_0x05da('0x36')](_0x10b883['query']);_0x37387d['filters']=_['intersection'](_0x37387d[_0x05da('0x34')],_0x37387d[_0x05da('0x35')]);_0x5ae5c1[_0x05da('0x39')]=_[_0x05da('0x38')](_0x37387d['model'],qs[_0x05da('0x3a')](_0x10b883[_0x05da('0x35')][_0x05da('0x3a')]));_0x5ae5c1['attributes']=_0x5ae5c1[_0x05da('0x39')]['length']?_0x5ae5c1['attributes']:_0x37387d[_0x05da('0x34')];_0x5ae5c1['order']=qs[_0x05da('0x3f')](_0x10b883[_0x05da('0x35')][_0x05da('0x3f')]);_0x5ae5c1['where']=qs[_0x05da('0x37')](_[_0x05da('0x41')](_0x10b883[_0x05da('0x35')],_0x37387d[_0x05da('0x37')]));_0x5ae5c1[_0x05da('0x40')]=_[_0x05da('0x43')](_0x5ae5c1['where'],{'$or':[{'ListId':_0x27a6d8['id']},{'ListId':null}]});if(_0x10b883['query'][_0x05da('0x42')]){_0x5ae5c1[_0x05da('0x40')]=_[_0x05da('0x43')](_0x5ae5c1[_0x05da('0x40')],{'$or':_[_0x05da('0x2e')](_0x5ae5c1[_0x05da('0x39')],function(_0x55400b){var _0x3f1a0c={};_0x3f1a0c[_0x55400b]={'$like':'%'+_0x10b883[_0x05da('0x35')][_0x05da('0x42')]+'%'};return _0x3f1a0c;})});}_0x5ae5c1=_[_0x05da('0x43')]({},_0x5ae5c1,_0x10b883['options']);return db[_0x05da('0x71')][_0x05da('0x9c')](_0x5ae5c1);}})[_0x05da('0x24')](respondWithResult(_0x335475,null))['catch'](handleError(_0x335475,null));};exports[_0x05da('0x9d')]=function(_0x375d6,_0x4689c5){return db[_0x05da('0x71')]['findAndCountAll']({'where':{'ListId':null}})[_0x05da('0x24')](handleEntityNotFound(_0x4689c5,null))[_0x05da('0x24')](function(_0x1a7ad2){return _0x1a7ad2;})[_0x05da('0x24')](respondWithResult(_0x4689c5,null))[_0x05da('0x47')](handleError(_0x4689c5,null));};exports[_0x05da('0x9e')]=function(_0xd394b4,_0xea792b,_0x213746){return db['CmList'][_0x05da('0x4a')]({'where':{'id':_0xd394b4['params']['id']}})[_0x05da('0x24')](handleEntityNotFound(_0xea792b,null))[_0x05da('0x24')](function(_0x365147){if(_0x365147){return _0x365147[_0x05da('0x9e')](_0xd394b4[_0x05da('0x4c')]['ids'],_[_0x05da('0x9f')](_0xd394b4[_0x05da('0x4c')],['ids','id'])||{})[_0x05da('0xa0')](function(_0x379fa2){for(var _0x59c949=0x0;_0x59c949<_0xd394b4[_0x05da('0x4c')][_0x05da('0x5e')][_0x05da('0x3b')];_0x59c949+=0x1){socket[_0x05da('0xa1')]('userCmList:save',{'UserId':Number(_0xd394b4['body'][_0x05da('0x5e')][_0x59c949]),'CmListId':Number(_0xd394b4[_0x05da('0x55')]['id'])});}return _0x379fa2;});}})[_0x05da('0x24')](respondWithResult(_0xea792b,null))[_0x05da('0x47')](handleError(_0xea792b,null));};exports[_0x05da('0xa2')]=function(_0x2d41d8,_0x112116,_0x545c79){return db[_0x05da('0x2f')][_0x05da('0x4a')]({'where':{'id':_0x2d41d8[_0x05da('0x55')]['id']}})[_0x05da('0x24')](handleEntityNotFound(_0x112116,null))[_0x05da('0x24')](function(_0x3a2168){if(_0x3a2168){return _0x3a2168['removeAgents'](_0x2d41d8['query'][_0x05da('0x5e')])[_0x05da('0x24')](function(){if(_['isArray'](_0x2d41d8[_0x05da('0x35')]['ids'])){for(var _0x29936a=0x0;_0x29936a<_0x2d41d8[_0x05da('0x35')]['ids'][_0x05da('0x3b')];_0x29936a+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x2d41d8[_0x05da('0x35')][_0x05da('0x5e')][_0x29936a]),'CmListId':Number(_0x2d41d8[_0x05da('0x55')]['id'])});}}else{socket[_0x05da('0xa1')](_0x05da('0xa3'),{'UserId':Number(_0x2d41d8['query']['ids']),'CmListId':Number(_0x2d41d8[_0x05da('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x112116,null))[_0x05da('0x47')](handleError(_0x112116,null));};exports[_0x05da('0xa4')]=function(_0x482541,_0x42c2ac,_0x460406){var _0x50d10f={};var _0x195094={};var _0x76abfc;var _0x3c43cc;return db[_0x05da('0x2f')][_0x05da('0x5b')]({'where':{'id':_0x482541[_0x05da('0x55')]['id']}})[_0x05da('0x24')](handleEntityNotFound(_0x42c2ac,null))['then'](function(_0x2c61d3){if(_0x2c61d3){_0x76abfc=_0x2c61d3;_0x195094[_0x05da('0x34')]=_['keys'](db[_0x05da('0xa5')][_0x05da('0x30')]);_0x195094[_0x05da('0x35')]=_[_0x05da('0x36')](_0x482541[_0x05da('0x35')]);_0x195094[_0x05da('0x37')]=_[_0x05da('0x38')](_0x195094[_0x05da('0x34')],_0x195094['query']);_0x50d10f[_0x05da('0x39')]=_[_0x05da('0x38')](_0x195094[_0x05da('0x34')],qs[_0x05da('0x3a')](_0x482541[_0x05da('0x35')][_0x05da('0x3a')]));_0x50d10f[_0x05da('0x39')]=_0x50d10f[_0x05da('0x39')]['length']?_0x50d10f[_0x05da('0x39')]:_0x195094[_0x05da('0x34')];_0x50d10f[_0x05da('0x3e')]=qs[_0x05da('0x3f')](_0x482541[_0x05da('0x35')]['sort']);_0x50d10f[_0x05da('0x40')]=qs[_0x05da('0x37')](_[_0x05da('0x41')](_0x482541[_0x05da('0x35')],_0x195094[_0x05da('0x37')]));if(_0x482541[_0x05da('0x35')][_0x05da('0x42')]){_0x50d10f[_0x05da('0x40')]=_[_0x05da('0x43')](_0x50d10f[_0x05da('0x40')],{'$or':_[_0x05da('0x2e')](_0x50d10f[_0x05da('0x39')],function(_0x27d0e1){var _0x5cba5f={};_0x5cba5f[_0x27d0e1]={'$like':'%'+_0x482541['query']['filter']+'%'};return _0x5cba5f;})});}_0x50d10f=_[_0x05da('0x43')]({},_0x50d10f,_0x482541['options']);return _0x76abfc[_0x05da('0xa4')](_0x50d10f);}})['then'](function(_0x4fc9cf){if(_0x4fc9cf){_0x3c43cc=_0x4fc9cf[_0x05da('0x3b')];if(!_0x482541[_0x05da('0x35')][_0x05da('0x3c')](_0x05da('0x3d'))){_0x50d10f[_0x05da('0x1f')]=qs[_0x05da('0x1f')](_0x482541['query']['limit']);_0x50d10f[_0x05da('0x1d')]=qs[_0x05da('0x1d')](_0x482541['query'][_0x05da('0x1d')]);}return _0x76abfc[_0x05da('0xa4')](_0x50d10f);}})[_0x05da('0x24')](function(_0x510cea){if(_0x510cea){return _0x510cea?{'count':_0x3c43cc,'rows':_0x510cea}:null;}})['then'](respondWithResult(_0x42c2ac,null))[_0x05da('0x47')](handleError(_0x42c2ac,null));};function handleQuery(_0x5424fc){logger['info'](_0x5424fc);return db['sequelize'][_0x05da('0x35')](_0x5424fc)[_0x05da('0xa0')](function(_0x409d01){csv_results[_0x05da('0x63')](_0x409d01);})['catch'](function(_0x5c06d0){logger['error'](_0x5c06d0[_0x05da('0x68')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 2f6601d..2a7bdbd 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(_0x37ea15,_0x5a0470){var _0x453798=function(_0x47b5f9){while(--_0x47b5f9){_0x37ea15['push'](_0x37ea15['shift']());}};_0x453798(++_0x5a0470);}(_0x814b,0x1a2));var _0xb814=function(_0x1c3b41,_0x50f776){_0x1c3b41=_0x1c3b41-0x0;var _0x41e3fe=_0x814b[_0x1c3b41];return _0x41e3fe;};'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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x358c6e,_0x3bddb6){_0x358c6e=_0x358c6e-0x0;var _0x172cbe=_0x3e74[_0x358c6e];return _0x172cbe;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 6fe5e5a..4b93332 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 _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x294c20,_0x343311){var _0x5386e4=function(_0x5612ac){while(--_0x5612ac){_0x294c20['push'](_0x294c20['shift']());}};_0x5386e4(++_0x343311);}(_0x22fb,0x192));var _0xb22f=function(_0x306cd8,_0x676ad6){_0x306cd8=_0x306cd8-0x0;var _0xd9c604=_0x22fb[_0x306cd8];return _0xd9c604;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0xa75b,0x170));var _0xba75=function(_0x218398,_0x32a8ae){_0x218398=_0x218398-0x0;var _0x333283=_0xa75b[_0x218398];return _0x333283;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 80e6bb4..b3380ec 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 _0x8500=['info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','./cmList.socket','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8500,0x14f));var _0x0850=function(_0x59c52f,_0xe37076){_0x59c52f=_0x59c52f-0x0;var _0x2d5be3=_0x8500[_0x59c52f];return _0x2d5be3;};'use strict';var _=require(_0x0850('0x0'));var util=require(_0x0850('0x1'));var moment=require(_0x0850('0x2'));var BPromise=require('bluebird');var rs=require(_0x0850('0x3'));var fs=require('fs');var Redis=require(_0x0850('0x4'));var db=require(_0x0850('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0850('0x6'))('rpc');var config=require(_0x0850('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0850('0x8')]['http']({'port':0x232a});config[_0x0850('0x9')]=_[_0x0850('0xa')](config[_0x0850('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0850('0xb'))(new Redis(config[_0x0850('0x9')]));require(_0x0850('0xc'))['register'](socket);function respondWithRpcPromise(_0x415dc5,_0x1d3bc8,_0xc689a){return new BPromise(function(_0x46d385,_0x5c3021){return client[_0x0850('0xd')](_0x415dc5,_0xc689a)[_0x0850('0xe')](function(_0x5610f4){logger[_0x0850('0xf')](_0x0850('0x10'),_0x1d3bc8,_0x0850('0x11'));logger[_0x0850('0x12')](_0x0850('0x13'),_0x1d3bc8,_0x0850('0x11'),JSON[_0x0850('0x14')](_0x5610f4));if(_0x5610f4[_0x0850('0x15')]){if(_0x5610f4[_0x0850('0x15')][_0x0850('0x16')]===0x1f4){logger[_0x0850('0x15')](_0x0850('0x10'),_0x1d3bc8,_0x5610f4[_0x0850('0x15')][_0x0850('0x17')]);return _0x5c3021(_0x5610f4[_0x0850('0x15')][_0x0850('0x17')]);}logger['error'](_0x0850('0x10'),_0x1d3bc8,_0x5610f4[_0x0850('0x15')]['message']);return _0x46d385(_0x5610f4['error']['message']);}else{logger[_0x0850('0xf')]('CmList,\x20%s,\x20%s',_0x1d3bc8,'request\x20sent');_0x46d385(_0x5610f4['result'][_0x0850('0x17')]);}})[_0x0850('0x18')](function(_0x47d676){logger[_0x0850('0x15')](_0x0850('0x10'),_0x1d3bc8,_0x47d676);_0x5c3021(_0x47d676);});});} \ No newline at end of file +var _0xe0b0=['./cmList.socket','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x42a6c8,_0x329a0b){var _0x175da3=function(_0x261163){while(--_0x261163){_0x42a6c8['push'](_0x42a6c8['shift']());}};_0x175da3(++_0x329a0b);}(_0xe0b0,0xfb));var _0x0e0b=function(_0x16a395,_0x3b5670){_0x16a395=_0x16a395-0x0;var _0x7b6261=_0xe0b0[_0x16a395];return _0x7b6261;};'use strict';var _=require('lodash');var util=require(_0x0e0b('0x0'));var moment=require(_0x0e0b('0x1'));var BPromise=require(_0x0e0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e0b('0x3'))['db'];var utils=require(_0x0e0b('0x4'));var logger=require('../../config/logger')(_0x0e0b('0x5'));var config=require(_0x0e0b('0x6'));var jayson=require(_0x0e0b('0x7'));var client=jayson[_0x0e0b('0x8')][_0x0e0b('0x9')]({'port':0x232a});config['redis']=_[_0x0e0b('0xa')](config[_0x0e0b('0xb')],{'host':_0x0e0b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0e0b('0xd'))['register'](socket);function respondWithRpcPromise(_0x55bc44,_0x593f83,_0x12107b){return new BPromise(function(_0x3f7a5f,_0x2983cf){return client['request'](_0x55bc44,_0x12107b)[_0x0e0b('0xe')](function(_0x4b028b){logger['info'](_0x0e0b('0xf'),_0x593f83,_0x0e0b('0x10'));logger['debug'](_0x0e0b('0x11'),_0x593f83,_0x0e0b('0x10'),JSON[_0x0e0b('0x12')](_0x4b028b));if(_0x4b028b[_0x0e0b('0x13')]){if(_0x4b028b[_0x0e0b('0x13')][_0x0e0b('0x14')]===0x1f4){logger['error'](_0x0e0b('0xf'),_0x593f83,_0x4b028b[_0x0e0b('0x13')][_0x0e0b('0x15')]);return _0x2983cf(_0x4b028b[_0x0e0b('0x13')][_0x0e0b('0x15')]);}logger[_0x0e0b('0x13')](_0x0e0b('0xf'),_0x593f83,_0x4b028b[_0x0e0b('0x13')][_0x0e0b('0x15')]);return _0x3f7a5f(_0x4b028b[_0x0e0b('0x13')][_0x0e0b('0x15')]);}else{logger[_0x0e0b('0x16')](_0x0e0b('0xf'),_0x593f83,_0x0e0b('0x10'));_0x3f7a5f(_0x4b028b['result'][_0x0e0b('0x15')]);}})[_0x0e0b('0x17')](function(_0x107d54){logger[_0x0e0b('0x13')](_0x0e0b('0xf'),_0x593f83,_0x107d54);_0x2983cf(_0x107d54);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index fb4238e..236877e 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 _0x4e58=['./cmList.events','save','update','emit','removeListener','cmList:'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0x4e58,0xa8));var _0x84e5=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x4e58[_0x4063a4];return _0x17908d;};'use strict';var CmListEvents=require(_0x84e5('0x0'));var events=[_0x84e5('0x1'),'remove',_0x84e5('0x2')];function createListener(_0x4d18c0,_0x34484f){return function(_0x2286d2){_0x34484f[_0x84e5('0x3')](_0x4d18c0,_0x2286d2);};}function removeListener(_0x2a5083,_0x9f9291){return function(){CmListEvents[_0x84e5('0x4')](_0x2a5083,_0x9f9291);};}exports['register']=function(_0x4f65ee){for(var _0x3f0e92=0x0,_0x45d877=events['length'];_0x3f0e92<_0x45d877;_0x3f0e92++){var _0x39e5c8=events[_0x3f0e92];var _0x24d581=createListener(_0x84e5('0x5')+_0x39e5c8,_0x4f65ee);CmListEvents['on'](_0x39e5c8,_0x24d581);}}; \ No newline at end of file +var _0xf50b=['removeListener','register','length','cmList:','./cmList.events','save','update'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf50b,0xc8));var _0xbf50=function(_0x1905b8,_0x165883){_0x1905b8=_0x1905b8-0x0;var _0x35bd1a=_0xf50b[_0x1905b8];return _0x35bd1a;};'use strict';var CmListEvents=require(_0xbf50('0x0'));var events=[_0xbf50('0x1'),'remove',_0xbf50('0x2')];function createListener(_0x18c2f1,_0x3336bb){return function(_0x443bf8){_0x3336bb['emit'](_0x18c2f1,_0x443bf8);};}function removeListener(_0x32217d,_0x4f5ba8){return function(){CmListEvents[_0xbf50('0x3')](_0x32217d,_0x4f5ba8);};}exports[_0xbf50('0x4')]=function(_0x1ecb62){for(var _0x117cc8=0x0,_0x3dd305=events[_0xbf50('0x5')];_0x117cc8<_0x3dd305;_0x117cc8++){var _0xce290=events[_0x117cc8];var _0x497c4c=createListener(_0xbf50('0x6')+_0xce290,_0x1ecb62);CmListEvents['on'](_0xce290,_0x497c4c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index cdc6ecf..8a069e2 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 _0x4e4d=['/:id/fields','addCustomField','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','/global_fields','show','getDispositions','/:id/contacts','getContacts','getContactsCsv','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts'];(function(_0x4942e7,_0x5d3007){var _0x39ced3=function(_0x33493f){while(--_0x33493f){_0x4942e7['push'](_0x4942e7['shift']());}};_0x39ced3(++_0x5d3007);}(_0x4e4d,0x1c6));var _0xd4e4=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x4e4d[_0x2c1dcd];return _0x158ce5;};'use strict';var multer=require(_0xd4e4('0x0'));var util=require(_0xd4e4('0x1'));var path=require(_0xd4e4('0x2'));var timeout=require(_0xd4e4('0x3'));var express=require(_0xd4e4('0x4'));var router=express[_0xd4e4('0x5')]();var fs_extra=require(_0xd4e4('0x6'));var auth=require(_0xd4e4('0x7'));var interaction=require(_0xd4e4('0x8'));var config=require(_0xd4e4('0x9'));var controller=require(_0xd4e4('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd4e4('0xb')](_0xd4e4('0xc'),auth[_0xd4e4('0xd')](),controller['describe']);router[_0xd4e4('0xb')](_0xd4e4('0xe'),auth[_0xd4e4('0xd')](),controller['getGlobalCustomFields']);router[_0xd4e4('0xb')]('/:id',auth[_0xd4e4('0xd')](),controller[_0xd4e4('0xf')]);router[_0xd4e4('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd4e4('0x10')]);router[_0xd4e4('0xb')](_0xd4e4('0x11'),auth[_0xd4e4('0xd')](),controller[_0xd4e4('0x12')]);router[_0xd4e4('0xb')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xd4e4('0x13')]);router[_0xd4e4('0xb')]('/:id/fields',auth[_0xd4e4('0xd')](),controller[_0xd4e4('0x14')]);router['get'](_0xd4e4('0x15'),auth[_0xd4e4('0xd')](),controller['getAgents']);router[_0xd4e4('0x16')]('/',auth[_0xd4e4('0xd')](),controller[_0xd4e4('0x17')]);router['post'](_0xd4e4('0x18'),auth[_0xd4e4('0xd')](),controller[_0xd4e4('0x19')]);router[_0xd4e4('0x16')](_0xd4e4('0x11'),auth['isAuthenticated'](),controller[_0xd4e4('0x1a')]);router[_0xd4e4('0x16')](_0xd4e4('0x1b'),auth['isAuthenticated'](),controller[_0xd4e4('0x1c')]);router[_0xd4e4('0x16')](_0xd4e4('0x15'),auth[_0xd4e4('0xd')](),controller[_0xd4e4('0x1d')]);router[_0xd4e4('0x1e')](_0xd4e4('0x1f'),auth[_0xd4e4('0xd')](),controller[_0xd4e4('0x20')]);router[_0xd4e4('0x21')](_0xd4e4('0x1f'),auth[_0xd4e4('0xd')](),controller[_0xd4e4('0x22')]);router[_0xd4e4('0x21')](_0xd4e4('0x18'),auth[_0xd4e4('0xd')](),controller['removeDispositions']);router['delete'](_0xd4e4('0x15'),auth[_0xd4e4('0xd')](),controller[_0xd4e4('0x23')]);module[_0xd4e4('0x24')]=router; \ No newline at end of file +var _0x5044=['/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','post','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','destroy','delete','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/global_fields','show'];(function(_0x4a7b2b,_0x3366e1){var _0x35e381=function(_0x4409db){while(--_0x4409db){_0x4a7b2b['push'](_0x4a7b2b['shift']());}};_0x35e381(++_0x3366e1);}(_0x5044,0xc8));var _0x4504=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0x5044[_0x2211ed];return _0x4d78cc;};'use strict';var multer=require('multer');var util=require(_0x4504('0x0'));var path=require('path');var timeout=require(_0x4504('0x1'));var express=require(_0x4504('0x2'));var router=express[_0x4504('0x3')]();var fs_extra=require(_0x4504('0x4'));var auth=require(_0x4504('0x5'));var interaction=require(_0x4504('0x6'));var config=require(_0x4504('0x7'));var controller=require(_0x4504('0x8'));router['get']('/',auth[_0x4504('0x9')](),controller[_0x4504('0xa')]);router[_0x4504('0xb')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0xd')]);router[_0x4504('0xb')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller['getGlobalCustomFields']);router[_0x4504('0xb')]('/:id',auth[_0x4504('0x9')](),controller[_0x4504('0xf')]);router[_0x4504('0xb')](_0x4504('0x10'),auth[_0x4504('0x9')](),controller[_0x4504('0x11')]);router[_0x4504('0xb')](_0x4504('0x12'),auth[_0x4504('0x9')](),controller[_0x4504('0x13')]);router[_0x4504('0xb')](_0x4504('0x14'),auth[_0x4504('0x9')](),controller['getContactsCsv']);router[_0x4504('0xb')](_0x4504('0x15'),auth['isAuthenticated'](),controller[_0x4504('0x16')]);router[_0x4504('0xb')](_0x4504('0x17'),auth[_0x4504('0x9')](),controller['getAgents']);router['post']('/',auth[_0x4504('0x9')](),controller['create']);router[_0x4504('0x18')]('/:id/dispositions',auth[_0x4504('0x9')](),controller[_0x4504('0x19')]);router[_0x4504('0x18')]('/:id/contacts',auth[_0x4504('0x9')](),controller[_0x4504('0x1a')]);router[_0x4504('0x18')](_0x4504('0x15'),auth[_0x4504('0x9')](),controller[_0x4504('0x1b')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x4504('0x1c')]);router[_0x4504('0x1d')](_0x4504('0x1e'),auth[_0x4504('0x9')](),controller[_0x4504('0x1f')]);router['delete'](_0x4504('0x1e'),auth[_0x4504('0x9')](),controller[_0x4504('0x20')]);router[_0x4504('0x21')](_0x4504('0x10'),auth[_0x4504('0x9')](),controller['removeDispositions']);router[_0x4504('0x21')](_0x4504('0x17'),auth['isAuthenticated'](),controller[_0x4504('0x22')]);module[_0x4504('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index f247972..fce0a37 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 _0x4949=['getDataValue','field','STRING','sequelize','exports','VIRTUAL'];(function(_0x498bf5,_0x3a375f){var _0x558a8d=function(_0x3a6da7){while(--_0x3a6da7){_0x498bf5['push'](_0x498bf5['shift']());}};_0x558a8d(++_0x3a375f);}(_0x4949,0x111));var _0x9494=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4949[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x9494('0x0'));module[_0x9494('0x1')]={'name':{'type':Sequelize[_0x9494('0x2')],'get':function(_0x1543b4){return this[_0x9494('0x3')](_0x9494('0x4'));}},'field':{'type':Sequelize[_0x9494('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x9494('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x9494('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0xe377=['sequelize','exports','VIRTUAL','getDataValue'];(function(_0x2b086d,_0x1ac1ed){var _0x19372b=function(_0x33be8e){while(--_0x33be8e){_0x2b086d['push'](_0x2b086d['shift']());}};_0x19372b(++_0x1ac1ed);}(_0xe377,0x148));var _0x7e37=function(_0x101df2,_0x4fbbf5){_0x101df2=_0x101df2-0x0;var _0x33da37=_0xe377[_0x101df2];return _0x33da37;};'use strict';var Sequelize=require(_0x7e37('0x0'));module[_0x7e37('0x1')]={'name':{'type':Sequelize[_0x7e37('0x2')],'get':function(_0x4bbde2){return this[_0x7e37('0x3')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 239fbd2..ae6d601 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(_0x55d580,_0x669161){var _0x3236c8=function(_0x38f5e9){while(--_0x38f5e9){_0x55d580['push'](_0x55d580['shift']());}};_0x3236c8(++_0x669161);}(_0x7a54,0x106));var _0x47a5=function(_0x77cfc8,_0x44b02e){_0x77cfc8=_0x77cfc8-0x0;var _0x26012d=_0x7a54[_0x77cfc8];return _0x26012d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4b0e06,_0x3f01a0){var _0x152ef9=function(_0x784b3b){while(--_0x784b3b){_0x4b0e06['push'](_0x4b0e06['shift']());}};_0x152ef9(++_0x3f01a0);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 953a808..d768967 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 _0xb63d=['./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x550c5f,_0x5297b2){var _0x4cae9a=function(_0xe93c1d){while(--_0xe93c1d){_0x550c5f['push'](_0x550c5f['shift']());}};_0x4cae9a(++_0x5297b2);}(_0xb63d,0x91));var _0xdb63=function(_0x184077,_0x231988){_0x184077=_0x184077-0x0;var _0x34988c=_0xb63d[_0x184077];return _0x34988c;};'use strict';var _=require('lodash');var util=require(_0xdb63('0x0'));var logger=require(_0xdb63('0x1'))(_0xdb63('0x2'));var moment=require(_0xdb63('0x3'));var BPromise=require(_0xdb63('0x4'));var rp=require(_0xdb63('0x5'));var fs=require('fs');var path=require(_0xdb63('0x6'));var rimraf=require(_0xdb63('0x7'));var config=require(_0xdb63('0x8'));var attributes=require(_0xdb63('0x9'));module[_0xdb63('0xa')]=function(_0x28700b,_0x546a73){return _0x28700b[_0xdb63('0xb')](_0xdb63('0xc'),attributes,{'tableName':_0xdb63('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b90=['moment','request-promise','./condition.attributes','exports','define','tools_conditions','util','api'];(function(_0x4a76d7,_0x1dc4ed){var _0x368d2b=function(_0x4fa986){while(--_0x4fa986){_0x4a76d7['push'](_0x4a76d7['shift']());}};_0x368d2b(++_0x1dc4ed);}(_0x8b90,0x126));var _0x08b9=function(_0x12ad5d,_0x2e63ed){_0x12ad5d=_0x12ad5d-0x0;var _0x45a98b=_0x8b90[_0x12ad5d];return _0x45a98b;};'use strict';var _=require('lodash');var util=require(_0x08b9('0x0'));var logger=require('../../config/logger')(_0x08b9('0x1'));var moment=require(_0x08b9('0x2'));var BPromise=require('bluebird');var rp=require(_0x08b9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x08b9('0x4'));module[_0x08b9('0x5')]=function(_0x57c6bd,_0xe60384){return _0x57c6bd[_0x08b9('0x6')]('Condition',attributes,{'tableName':_0x08b9('0x7'),'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 52ee265..de51c08 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 _0x0fbd=['request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x41775d,_0x33ce2b){var _0x35ef31=function(_0x13bdde){while(--_0x13bdde){_0x41775d['push'](_0x41775d['shift']());}};_0x35ef31(++_0x33ce2b);}(_0x0fbd,0x7e));var _0xd0fb=function(_0x2ca332,_0x46ab8d){_0x2ca332=_0x2ca332-0x0;var _0x500071=_0x0fbd[_0x2ca332];return _0x500071;};'use strict';var _=require('lodash');var util=require(_0xd0fb('0x0'));var moment=require(_0xd0fb('0x1'));var BPromise=require(_0xd0fb('0x2'));var rs=require(_0xd0fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0fb('0x5'))(_0xd0fb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0fb('0x7')][_0xd0fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa0de19,_0x1fe248,_0x20baad){return new BPromise(function(_0x303b4d,_0x35813e){return client['request'](_0xa0de19,_0x20baad)[_0xd0fb('0x9')](function(_0x216b0d){logger[_0xd0fb('0xa')](_0xd0fb('0xb'),_0x1fe248,'request\x20sent');logger[_0xd0fb('0xc')](_0xd0fb('0xd'),_0x1fe248,_0xd0fb('0xe'),JSON['stringify'](_0x216b0d));if(_0x216b0d['error']){if(_0x216b0d[_0xd0fb('0xf')][_0xd0fb('0x10')]===0x1f4){logger[_0xd0fb('0xf')](_0xd0fb('0xb'),_0x1fe248,_0x216b0d[_0xd0fb('0xf')]['message']);return _0x35813e(_0x216b0d[_0xd0fb('0xf')][_0xd0fb('0x11')]);}logger[_0xd0fb('0xf')](_0xd0fb('0xb'),_0x1fe248,_0x216b0d[_0xd0fb('0xf')]['message']);return _0x303b4d(_0x216b0d[_0xd0fb('0xf')][_0xd0fb('0x11')]);}else{logger[_0xd0fb('0xa')](_0xd0fb('0xb'),_0x1fe248,_0xd0fb('0xe'));_0x303b4d(_0x216b0d[_0xd0fb('0x12')]['message']);}})[_0xd0fb('0x13')](function(_0x406878){logger[_0xd0fb('0xf')](_0xd0fb('0xb'),_0x1fe248,_0x406878);_0x35813e(_0x406878);});});} \ No newline at end of file +var _0xdc41=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring'];(function(_0x2d8845,_0x452764){var _0x4ff1a6=function(_0x376251){while(--_0x376251){_0x2d8845['push'](_0x2d8845['shift']());}};_0x4ff1a6(++_0x452764);}(_0xdc41,0x1c8));var _0x1dc4=function(_0x5e8fc3,_0x37ef41){_0x5e8fc3=_0x5e8fc3-0x0;var _0x2d224a=_0xdc41[_0x5e8fc3];return _0x2d224a;};'use strict';var _=require(_0x1dc4('0x0'));var util=require(_0x1dc4('0x1'));var moment=require('moment');var BPromise=require(_0x1dc4('0x2'));var rs=require(_0x1dc4('0x3'));var fs=require('fs');var Redis=require(_0x1dc4('0x4'));var db=require(_0x1dc4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dc4('0x6'))('rpc');var config=require(_0x1dc4('0x7'));var jayson=require(_0x1dc4('0x8'));var client=jayson[_0x1dc4('0x9')][_0x1dc4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15dc20,_0x21d22b,_0x34d053){return new BPromise(function(_0x2b38bb,_0x561d22){return client[_0x1dc4('0xb')](_0x15dc20,_0x34d053)[_0x1dc4('0xc')](function(_0x374d94){logger[_0x1dc4('0xd')]('Condition,\x20%s,\x20%s',_0x21d22b,_0x1dc4('0xe'));logger[_0x1dc4('0xf')](_0x1dc4('0x10'),_0x21d22b,_0x1dc4('0xe'),JSON[_0x1dc4('0x11')](_0x374d94));if(_0x374d94['error']){if(_0x374d94[_0x1dc4('0x12')][_0x1dc4('0x13')]===0x1f4){logger['error'](_0x1dc4('0x14'),_0x21d22b,_0x374d94['error'][_0x1dc4('0x15')]);return _0x561d22(_0x374d94[_0x1dc4('0x12')][_0x1dc4('0x15')]);}logger['error'](_0x1dc4('0x14'),_0x21d22b,_0x374d94[_0x1dc4('0x12')][_0x1dc4('0x15')]);return _0x2b38bb(_0x374d94['error'][_0x1dc4('0x15')]);}else{logger[_0x1dc4('0xd')](_0x1dc4('0x14'),_0x21d22b,'request\x20sent');_0x2b38bb(_0x374d94[_0x1dc4('0x16')][_0x1dc4('0x15')]);}})['catch'](function(_0x18a9c7){logger[_0x1dc4('0x12')]('Condition,\x20%s,\x20%s',_0x21d22b,_0x18a9c7);_0x561d22(_0x18a9c7);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 2eaf998..028da23 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 _0x530a=['/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0x530a,0xed));var _0xa530=function(_0x39d247,_0x5afe){_0x39d247=_0x39d247-0x0;var _0x4a7a5b=_0x530a[_0x39d247];return _0x4a7a5b;};'use strict';var multer=require(_0xa530('0x0'));var util=require(_0xa530('0x1'));var path=require(_0xa530('0x2'));var timeout=require(_0xa530('0x3'));var express=require('express');var router=express[_0xa530('0x4')]();var fs_extra=require(_0xa530('0x5'));var auth=require(_0xa530('0x6'));var interaction=require(_0xa530('0x7'));var config=require(_0xa530('0x8'));var controller=require('./condition.controller');router['put']('/:id',auth[_0xa530('0x9')](),controller['update']);router['delete'](_0xa530('0xa'),auth[_0xa530('0x9')](),controller[_0xa530('0xb')]);module[_0xa530('0xc')]=router; \ No newline at end of file +var _0x6d66=['express','Router','../../components/interaction/service','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x36af1d,_0x57d190){var _0x29acde=function(_0x6586bc){while(--_0x6586bc){_0x36af1d['push'](_0x36af1d['shift']());}};_0x29acde(++_0x57d190);}(_0x6d66,0x1c4));var _0x66d6=function(_0x3ad49a,_0x5ea7c7){_0x3ad49a=_0x3ad49a-0x0;var _0x531237=_0x6d66[_0x3ad49a];return _0x531237;};'use strict';var multer=require(_0x66d6('0x0'));var util=require('util');var path=require(_0x66d6('0x1'));var timeout=require(_0x66d6('0x2'));var express=require(_0x66d6('0x3'));var router=express[_0x66d6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66d6('0x5'));var config=require('../../config/environment');var controller=require(_0x66d6('0x6'));router['put'](_0x66d6('0x7'),auth[_0x66d6('0x8')](),controller[_0x66d6('0x9')]);router[_0x66d6('0xa')](_0x66d6('0x7'),auth[_0x66d6('0x8')](),controller[_0x66d6('0xb')]);module[_0x66d6('0xc')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index b68ea1b..da99e2b 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 _0xaf67=['INTEGER','sequelize','exports','STRING'];(function(_0x36f86f,_0x5987bc){var _0x3d61ab=function(_0x282e9f){while(--_0x282e9f){_0x36f86f['push'](_0x36f86f['shift']());}};_0x3d61ab(++_0x5987bc);}(_0xaf67,0x195));var _0x7af6=function(_0x3bd87f,_0x42cf10){_0x3bd87f=_0x3bd87f-0x0;var _0x5609bb=_0xaf67[_0x3bd87f];return _0x5609bb;};'use strict';var Sequelize=require(_0x7af6('0x0'));module[_0x7af6('0x1')]={'name':{'type':Sequelize[_0x7af6('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x7af6('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x7af6('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x3cc5=['exports','STRING'];(function(_0x2c4a6b,_0x29a928){var _0xe67f09=function(_0x3cbdaf){while(--_0x3cbdaf){_0x2c4a6b['push'](_0x2c4a6b['shift']());}};_0xe67f09(++_0x29a928);}(_0x3cc5,0xd8));var _0x53cc=function(_0xb40ca1,_0x246809){_0xb40ca1=_0xb40ca1-0x0;var _0x26eb7e=_0x3cc5[_0xb40ca1];return _0x26eb7e;};'use strict';var Sequelize=require('sequelize');module[_0x53cc('0x0')]={'name':{'type':Sequelize[_0x53cc('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x53cc('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index cb50aaf..f38d28c 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 _0x9f0e=['index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','intersection','attributes','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','keys','filters','fields','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','ContactItemTypes','UserProfileResource','end','error','stack','name','send'];(function(_0xc576dd,_0x120766){var _0x104887=function(_0x3b3611){while(--_0x3b3611){_0xc576dd['push'](_0xc576dd['shift']());}};_0x104887(++_0x120766);}(_0x9f0e,0x116));var _0xe9f0=function(_0x2844c4,_0x2d55d8){_0x2844c4=_0x2844c4-0x0;var _0x36adf8=_0x9f0e[_0x2844c4];return _0x36adf8;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){var _0x372ffd=_0x437d43[_0xe9f0('0x26')]({'plain':!![]});var _0x1321bb=_0xe9f0('0x27');return db[_0xe9f0('0x28')]['destroy']({'where':{'type':_0x1321bb,'resourceId':_0x372ffd['id']}})[_0xe9f0('0x24')](function(){return _0x437d43;});})[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x29')]();});}};}function handleEntityNotFound(_0x4cf1b1,_0x212a38){return function(_0x2613fd){if(!_0x2613fd){_0x4cf1b1[_0xe9f0('0x19')](0x194);}return _0x2613fd;};}function handleError(_0x1f98a7,_0x4335c6){_0x4335c6=_0x4335c6||0x1f4;return function(_0x5457f6){logger[_0xe9f0('0x2a')](_0x5457f6[_0xe9f0('0x2b')]);if(_0x5457f6[_0xe9f0('0x2c')]){delete _0x5457f6[_0xe9f0('0x2c')];}_0x1f98a7[_0xe9f0('0x1a')](_0x4335c6)[_0xe9f0('0x2d')](_0x5457f6);};}exports[_0xe9f0('0x2e')]=function(_0x2efd33,_0x2b6503){var _0x3dbe49={},_0x22806c={},_0x617ad3={'count':0x0,'rows':[]};var _0x445ad0=_[_0xe9f0('0x2f')](db[_0xe9f0('0x30')][_0xe9f0('0x31')],function(_0x80e3ac){return{'name':_0x80e3ac[_0xe9f0('0x32')],'type':_0x80e3ac[_0xe9f0('0x33')][_0xe9f0('0x34')]};});_0x22806c[_0xe9f0('0x35')]=_[_0xe9f0('0x2f')](_0x445ad0,_0xe9f0('0x2c'));_0x22806c[_0xe9f0('0x36')]=_['keys'](_0x2efd33['query']);_0x22806c['filters']=_[_0xe9f0('0x37')](_0x22806c['model'],_0x22806c[_0xe9f0('0x36')]);_0x3dbe49[_0xe9f0('0x38')]=_['intersection'](_0x22806c[_0xe9f0('0x35')],qs['fields'](_0x2efd33['query']['fields']));_0x3dbe49[_0xe9f0('0x38')]=_0x3dbe49[_0xe9f0('0x38')]['length']?_0x3dbe49[_0xe9f0('0x38')]:_0x22806c[_0xe9f0('0x35')];if(!_0x2efd33[_0xe9f0('0x36')]['hasOwnProperty']('nolimit')){_0x3dbe49[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x2efd33[_0xe9f0('0x36')]['limit']);_0x3dbe49[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x1f')]);}_0x3dbe49[_0xe9f0('0x39')]=qs['sort'](_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x3a')]);_0x3dbe49[_0xe9f0('0x3b')]=qs['filters'](_[_0xe9f0('0x3c')](_0x2efd33[_0xe9f0('0x36')],_0x22806c['filters']),_0x445ad0);if(_0x2efd33[_0xe9f0('0x36')]['filter']){_0x3dbe49[_0xe9f0('0x3b')]=_['merge'](_0x3dbe49['where'],{'$or':_['map'](_0x445ad0,function(_0x5bddcc){if(_0x5bddcc['type']!==_0xe9f0('0x3d')){var _0x2d4115={};_0x2d4115[_0x5bddcc[_0xe9f0('0x2c')]]={'$like':'%'+_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x3e')]+'%'};return _0x2d4115;}})});}_0x3dbe49=_[_0xe9f0('0x3f')]({},_0x3dbe49,_0x2efd33[_0xe9f0('0x40')]);var _0x3e79c1={'where':_0x3dbe49[_0xe9f0('0x3b')]};return db['ContactItemType'][_0xe9f0('0x1e')](_0x3e79c1)[_0xe9f0('0x24')](function(_0x36b00a){_0x617ad3['count']=_0x36b00a;if(_0x2efd33['query'][_0xe9f0('0x41')]){_0x3dbe49['include']=[{'all':!![]}];}return db[_0xe9f0('0x30')][_0xe9f0('0x42')](_0x3dbe49);})[_0xe9f0('0x24')](function(_0x42d9d2){_0x617ad3['rows']=_0x42d9d2;return _0x617ad3;})[_0xe9f0('0x24')](respondWithFilteredResult(_0x2b6503,_0x3dbe49))[_0xe9f0('0x43')](handleError(_0x2b6503,null));};exports[_0xe9f0('0x44')]=function(_0x18faaf,_0x37a2ac){var _0x59378a={'raw':!![],'where':{'id':_0x18faaf[_0xe9f0('0x45')]['id']}},_0x60a40d={};_0x60a40d[_0xe9f0('0x35')]=_[_0xe9f0('0x46')](db[_0xe9f0('0x30')]['rawAttributes']);_0x60a40d[_0xe9f0('0x36')]=_['keys'](_0x18faaf['query']);_0x60a40d[_0xe9f0('0x47')]=_[_0xe9f0('0x37')](_0x60a40d['model'],_0x60a40d[_0xe9f0('0x36')]);_0x59378a[_0xe9f0('0x38')]=_[_0xe9f0('0x37')](_0x60a40d[_0xe9f0('0x35')],qs[_0xe9f0('0x48')](_0x18faaf[_0xe9f0('0x36')][_0xe9f0('0x48')]));_0x59378a['attributes']=_0x59378a[_0xe9f0('0x38')]['length']?_0x59378a[_0xe9f0('0x38')]:_0x60a40d['model'];if(_0x18faaf[_0xe9f0('0x36')]['includeAll']){_0x59378a[_0xe9f0('0x49')]=[{'all':!![]}];}_0x59378a=_[_0xe9f0('0x3f')]({},_0x59378a,_0x18faaf[_0xe9f0('0x40')]);return db['ContactItemType'][_0xe9f0('0x4a')](_0x59378a)[_0xe9f0('0x24')](handleEntityNotFound(_0x37a2ac,null))[_0xe9f0('0x24')](respondWithResult(_0x37a2ac,null))[_0xe9f0('0x43')](handleError(_0x37a2ac,null));};exports[_0xe9f0('0x4b')]=function(_0x135175,_0x6ece3f){return db[_0xe9f0('0x30')][_0xe9f0('0x4b')](_0x135175[_0xe9f0('0x4c')],{})[_0xe9f0('0x24')](function(_0x1325a2){var _0x57beee=_0x135175['user'][_0xe9f0('0x26')]({'plain':!![]});if(!_0x57beee)throw new Error(_0xe9f0('0x4d'));if(_0x57beee[_0xe9f0('0x4e')]==='user'){var _0x1ac381=_0x1325a2['get']({'plain':!![]});var _0x323e1e=_0xe9f0('0x27');return db[_0xe9f0('0x4f')][_0xe9f0('0x4a')]({'where':{'name':_0x323e1e,'userProfileId':_0x57beee['userProfileId']},'raw':!![]})[_0xe9f0('0x24')](function(_0x3fa271){if(_0x3fa271&&_0x3fa271['autoAssociation']===0x0){return db[_0xe9f0('0x28')][_0xe9f0('0x4b')]({'name':_0x1ac381[_0xe9f0('0x2c')],'resourceId':_0x1ac381['id'],'type':_0x3fa271[_0xe9f0('0x2c')],'sectionId':_0x3fa271['id']},{})['then'](function(){return _0x1325a2;});}else{return _0x1325a2;}})[_0xe9f0('0x43')](function(_0x3a5d19){logger[_0xe9f0('0x2a')](_0xe9f0('0x50'),_0x3a5d19);throw _0x3a5d19;});}return _0x1325a2;})[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,0xc9))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports[_0xe9f0('0x23')]=function(_0x12d9be,_0x4da78f){if(_0x12d9be[_0xe9f0('0x4c')]['id']){delete _0x12d9be[_0xe9f0('0x4c')]['id'];}return db[_0xe9f0('0x30')][_0xe9f0('0x4a')]({'where':{'id':_0x12d9be[_0xe9f0('0x45')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4da78f,null))[_0xe9f0('0x24')](saveUpdates(_0x12d9be[_0xe9f0('0x4c')],null))[_0xe9f0('0x24')](respondWithResult(_0x4da78f,null))[_0xe9f0('0x43')](handleError(_0x4da78f,null));};exports[_0xe9f0('0x25')]=function(_0x3c26ac,_0x4f1c25){return db[_0xe9f0('0x30')]['find']({'where':{'id':_0x3c26ac[_0xe9f0('0x45')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4f1c25,null))[_0xe9f0('0x24')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3c26ac[_0xe9f0('0x45')]['id']}}))['then'](removeEntity(_0x4f1c25,null))[_0xe9f0('0x43')](handleError(_0x4f1c25,null));}; \ No newline at end of file +var _0x6a95=['get','ContactItemTypes','error','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','keys','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','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','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x233340,_0x30e76c){var _0x6e4908=function(_0x297299){while(--_0x297299){_0x233340['push'](_0x233340['shift']());}};_0x6e4908(++_0x30e76c);}(_0x6a95,0x1db));var _0x56a9=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x6a95[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x56a9('0x0'));var rimraf=require(_0x56a9('0x1'));var zipdir=require(_0x56a9('0x2'));var jsonpatch=require(_0x56a9('0x3'));var rp=require(_0x56a9('0x4'));var moment=require(_0x56a9('0x5'));var BPromise=require(_0x56a9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56a9('0x7'));var sox=require(_0x56a9('0x8'));var csv=require(_0x56a9('0x9'));var ejs=require(_0x56a9('0xa'));var fs=require('fs');var fs_extra=require(_0x56a9('0xb'));var _=require(_0x56a9('0xc'));var squel=require(_0x56a9('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x56a9('0xe'));var toCsv=require(_0x56a9('0x9'));var querystring=require('querystring');var Papa=require(_0x56a9('0xf'));var Redis=require(_0x56a9('0x10'));var authService=require(_0x56a9('0x11'));var qs=require(_0x56a9('0x12'));var as=require(_0x56a9('0x13'));var hardwareService=require(_0x56a9('0x14'));var logger=require(_0x56a9('0x15'))(_0x56a9('0x16'));var utils=require(_0x56a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56a9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b2c7f,_0x4552ce){_0x4552ce=_0x4552ce||0xcc;return function(_0x420667){if(_0x420667){return _0x2b2c7f[_0x56a9('0x19')](_0x4552ce);}return _0x2b2c7f[_0x56a9('0x1a')](_0x4552ce)[_0x56a9('0x1b')]();};}function respondWithResult(_0x124ab8,_0x1a2eb4){_0x1a2eb4=_0x1a2eb4||0xc8;return function(_0x40b2cb){if(_0x40b2cb){return _0x124ab8['status'](_0x1a2eb4)['json'](_0x40b2cb);}};}function respondWithFilteredResult(_0x2e0dfd,_0x2a0714){return function(_0x42007b){if(_0x42007b){var _0x46f854=typeof _0x2a0714['offset']===_0x56a9('0x1c')&&typeof _0x2a0714['limit']==='undefined';var _0x4e292f=_0x42007b[_0x56a9('0x1d')];var _0x576bdf=_0x46f854?0x0:_0x2a0714[_0x56a9('0x1e')];var _0x105fe5=_0x46f854?_0x42007b[_0x56a9('0x1d')]:_0x2a0714[_0x56a9('0x1e')]+_0x2a0714[_0x56a9('0x1f')];var _0xbfeb1a;if(_0x105fe5>=_0x4e292f){_0x105fe5=_0x4e292f;_0xbfeb1a=0xc8;}else{_0xbfeb1a=0xce;}_0x2e0dfd[_0x56a9('0x1a')](_0xbfeb1a);return _0x2e0dfd[_0x56a9('0x20')](_0x56a9('0x21'),_0x576bdf+'-'+_0x105fe5+'/'+_0x4e292f)[_0x56a9('0x22')](_0x42007b);}return null;};}function patchUpdates(_0x5f145f){return function(_0x5bc03a){try{jsonpatch[_0x56a9('0x23')](_0x5bc03a,_0x5f145f,!![]);}catch(_0x16f9de){return BPromise[_0x56a9('0x24')](_0x16f9de);}return _0x5bc03a[_0x56a9('0x25')]();};}function saveUpdates(_0x4a09e5,_0x6100fe){return function(_0x3355c4){if(_0x3355c4){return _0x3355c4[_0x56a9('0x26')](_0x4a09e5)[_0x56a9('0x27')](function(_0x5a82e0){return _0x5a82e0;});}return null;};}function removeEntity(_0x44762e,_0x32839b){return function(_0x21ab38){if(_0x21ab38){return _0x21ab38[_0x56a9('0x28')]()[_0x56a9('0x27')](function(){var _0x52016c=_0x21ab38[_0x56a9('0x29')]({'plain':!![]});var _0x217bda=_0x56a9('0x2a');return db['UserProfileResource'][_0x56a9('0x28')]({'where':{'type':_0x217bda,'resourceId':_0x52016c['id']}})['then'](function(){return _0x21ab38;});})[_0x56a9('0x27')](function(){_0x44762e[_0x56a9('0x1a')](0xcc)[_0x56a9('0x1b')]();});}};}function handleEntityNotFound(_0x20432a,_0x45f38c){return function(_0x1afe8a){if(!_0x1afe8a){_0x20432a[_0x56a9('0x19')](0x194);}return _0x1afe8a;};}function handleError(_0xff5f55,_0x51fd64){_0x51fd64=_0x51fd64||0x1f4;return function(_0x437ccf){logger[_0x56a9('0x2b')](_0x437ccf['stack']);if(_0x437ccf[_0x56a9('0x2c')]){delete _0x437ccf['name'];}_0xff5f55['status'](_0x51fd64)[_0x56a9('0x2d')](_0x437ccf);};}exports['index']=function(_0x2f933a,_0x11002a){var _0x2fbd5d={},_0x2c1c3d={},_0x5879db={'count':0x0,'rows':[]};var _0x332707=_[_0x56a9('0x2e')](db[_0x56a9('0x2f')][_0x56a9('0x30')],function(_0xbbb47d){return{'name':_0xbbb47d[_0x56a9('0x31')],'type':_0xbbb47d[_0x56a9('0x32')][_0x56a9('0x33')]};});_0x2c1c3d[_0x56a9('0x34')]=_[_0x56a9('0x2e')](_0x332707,_0x56a9('0x2c'));_0x2c1c3d[_0x56a9('0x35')]=_['keys'](_0x2f933a[_0x56a9('0x35')]);_0x2c1c3d[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x2c1c3d['model'],_0x2c1c3d[_0x56a9('0x35')]);_0x2fbd5d['attributes']=_['intersection'](_0x2c1c3d['model'],qs[_0x56a9('0x38')](_0x2f933a[_0x56a9('0x35')]['fields']));_0x2fbd5d['attributes']=_0x2fbd5d[_0x56a9('0x39')][_0x56a9('0x3a')]?_0x2fbd5d[_0x56a9('0x39')]:_0x2c1c3d[_0x56a9('0x34')];if(!_0x2f933a[_0x56a9('0x35')][_0x56a9('0x3b')](_0x56a9('0x3c'))){_0x2fbd5d[_0x56a9('0x1f')]=qs[_0x56a9('0x1f')](_0x2f933a[_0x56a9('0x35')]['limit']);_0x2fbd5d['offset']=qs['offset'](_0x2f933a['query'][_0x56a9('0x1e')]);}_0x2fbd5d[_0x56a9('0x3d')]=qs['sort'](_0x2f933a[_0x56a9('0x35')][_0x56a9('0x3e')]);_0x2fbd5d[_0x56a9('0x3f')]=qs[_0x56a9('0x36')](_[_0x56a9('0x40')](_0x2f933a[_0x56a9('0x35')],_0x2c1c3d[_0x56a9('0x36')]),_0x332707);if(_0x2f933a['query'][_0x56a9('0x41')]){_0x2fbd5d[_0x56a9('0x3f')]=_['merge'](_0x2fbd5d['where'],{'$or':_[_0x56a9('0x2e')](_0x332707,function(_0x1180c6){if(_0x1180c6[_0x56a9('0x32')]!==_0x56a9('0x42')){var _0x158504={};_0x158504[_0x1180c6[_0x56a9('0x2c')]]={'$like':'%'+_0x2f933a[_0x56a9('0x35')][_0x56a9('0x41')]+'%'};return _0x158504;}})});}_0x2fbd5d=_[_0x56a9('0x43')]({},_0x2fbd5d,_0x2f933a[_0x56a9('0x44')]);var _0x9f24ea={'where':_0x2fbd5d[_0x56a9('0x3f')]};return db[_0x56a9('0x2f')][_0x56a9('0x1d')](_0x9f24ea)[_0x56a9('0x27')](function(_0xe57cfb){_0x5879db[_0x56a9('0x1d')]=_0xe57cfb;if(_0x2f933a[_0x56a9('0x35')]['includeAll']){_0x2fbd5d[_0x56a9('0x45')]=[{'all':!![]}];}return db[_0x56a9('0x2f')][_0x56a9('0x46')](_0x2fbd5d);})['then'](function(_0x1f8b30){_0x5879db['rows']=_0x1f8b30;return _0x5879db;})[_0x56a9('0x27')](respondWithFilteredResult(_0x11002a,_0x2fbd5d))['catch'](handleError(_0x11002a,null));};exports[_0x56a9('0x47')]=function(_0x39c445,_0x3998f1){var _0x49286b={'raw':!![],'where':{'id':_0x39c445['params']['id']}},_0x5192d8={};_0x5192d8['model']=_[_0x56a9('0x48')](db[_0x56a9('0x2f')][_0x56a9('0x30')]);_0x5192d8[_0x56a9('0x35')]=_[_0x56a9('0x48')](_0x39c445[_0x56a9('0x35')]);_0x5192d8[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x5192d8[_0x56a9('0x34')],_0x5192d8[_0x56a9('0x35')]);_0x49286b[_0x56a9('0x39')]=_[_0x56a9('0x37')](_0x5192d8[_0x56a9('0x34')],qs[_0x56a9('0x38')](_0x39c445['query'][_0x56a9('0x38')]));_0x49286b[_0x56a9('0x39')]=_0x49286b[_0x56a9('0x39')]['length']?_0x49286b[_0x56a9('0x39')]:_0x5192d8[_0x56a9('0x34')];if(_0x39c445['query'][_0x56a9('0x49')]){_0x49286b[_0x56a9('0x45')]=[{'all':!![]}];}_0x49286b=_[_0x56a9('0x43')]({},_0x49286b,_0x39c445[_0x56a9('0x44')]);return db['ContactItemType'][_0x56a9('0x4a')](_0x49286b)[_0x56a9('0x27')](handleEntityNotFound(_0x3998f1,null))[_0x56a9('0x27')](respondWithResult(_0x3998f1,null))[_0x56a9('0x4b')](handleError(_0x3998f1,null));};exports[_0x56a9('0x4c')]=function(_0x3942d8,_0x31aaf5){return db[_0x56a9('0x2f')][_0x56a9('0x4c')](_0x3942d8[_0x56a9('0x4d')],{})[_0x56a9('0x27')](function(_0x500656){var _0x58d370=_0x3942d8[_0x56a9('0x4e')][_0x56a9('0x29')]({'plain':!![]});if(!_0x58d370)throw new Error(_0x56a9('0x4f'));if(_0x58d370[_0x56a9('0x50')]==='user'){var _0x1986f2=_0x500656[_0x56a9('0x29')]({'plain':!![]});var _0x26ad3e=_0x56a9('0x2a');return db['UserProfileSection'][_0x56a9('0x4a')]({'where':{'name':_0x26ad3e,'userProfileId':_0x58d370[_0x56a9('0x51')]},'raw':!![]})['then'](function(_0x1ff42f){if(_0x1ff42f&&_0x1ff42f[_0x56a9('0x52')]===0x0){return db['UserProfileResource'][_0x56a9('0x4c')]({'name':_0x1986f2[_0x56a9('0x2c')],'resourceId':_0x1986f2['id'],'type':_0x1ff42f[_0x56a9('0x2c')],'sectionId':_0x1ff42f['id']},{})[_0x56a9('0x27')](function(){return _0x500656;});}else{return _0x500656;}})['catch'](function(_0x4938d6){logger[_0x56a9('0x2b')](_0x56a9('0x53'),_0x4938d6);throw _0x4938d6;});}return _0x500656;})[_0x56a9('0x27')](respondWithResult(_0x31aaf5,0xc9))[_0x56a9('0x4b')](handleError(_0x31aaf5,null));};exports[_0x56a9('0x26')]=function(_0xce9dc0,_0x798b4e){if(_0xce9dc0[_0x56a9('0x4d')]['id']){delete _0xce9dc0[_0x56a9('0x4d')]['id'];}return db[_0x56a9('0x2f')]['find']({'where':{'id':_0xce9dc0[_0x56a9('0x54')]['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x798b4e,null))[_0x56a9('0x27')](saveUpdates(_0xce9dc0[_0x56a9('0x4d')],null))[_0x56a9('0x27')](respondWithResult(_0x798b4e,null))[_0x56a9('0x4b')](handleError(_0x798b4e,null));};exports[_0x56a9('0x28')]=function(_0x488577,_0x870aa5){return db[_0x56a9('0x2f')][_0x56a9('0x4a')]({'where':{'id':_0x488577[_0x56a9('0x54')]['id']}})[_0x56a9('0x27')](handleEntityNotFound(_0x870aa5,null))[_0x56a9('0x27')](db[_0x56a9('0x55')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x488577[_0x56a9('0x54')]['id']}}))['then'](removeEntity(_0x870aa5,null))['catch'](handleError(_0x870aa5,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 54acc36..7e5ed1d 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 _0x508a=['api','moment','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x508a,0x65));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa508('0x0'));var util=require(_0xa508('0x1'));var logger=require(_0xa508('0x2'))(_0xa508('0x3'));var moment=require(_0xa508('0x4'));var BPromise=require('bluebird');var rp=require(_0xa508('0x5'));var fs=require('fs');var path=require(_0xa508('0x6'));var rimraf=require(_0xa508('0x7'));var config=require(_0xa508('0x8'));var attributes=require(_0xa508('0x9'));module['exports']=function(_0x435cfd,_0x51aaf6){return _0x435cfd[_0xa508('0xa')](_0xa508('0xb'),attributes,{'tableName':_0xa508('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dca=['../../config/logger','moment','bluebird','request-promise','path','tools_contact_item_types','util'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x6dca,0x1d4));var _0xa6dc=function(_0x218d8a,_0x39bd04){_0x218d8a=_0x218d8a-0x0;var _0x3ffaca=_0x6dca[_0x218d8a];return _0x3ffaca;};'use strict';var _=require('lodash');var util=require(_0xa6dc('0x0'));var logger=require(_0xa6dc('0x1'))('api');var moment=require(_0xa6dc('0x2'));var BPromise=require(_0xa6dc('0x3'));var rp=require(_0xa6dc('0x4'));var fs=require('fs');var path=require(_0xa6dc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module['exports']=function(_0x6da517,_0x261877){return _0x6da517['define']('ContactItemType',attributes,{'tableName':_0xa6dc('0x6'),'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 6752ff2..f53050d 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 _0x7497=['request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','ContactItemType,\x20%s,\x20%s'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var moment=require(_0x7749('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7749('0x3'))['db'];var utils=require(_0x7749('0x4'));var logger=require('../../config/logger')(_0x7749('0x5'));var config=require(_0x7749('0x6'));var jayson=require(_0x7749('0x7'));var client=jayson[_0x7749('0x8')][_0x7749('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29f84f,_0x37d7b9,_0x344fa8){return new BPromise(function(_0x38dd37,_0x3efd35){return client[_0x7749('0xa')](_0x29f84f,_0x344fa8)['then'](function(_0xb58b29){logger['info'](_0x7749('0xb'),_0x37d7b9,_0x7749('0xc'));logger[_0x7749('0xd')](_0x7749('0xe'),_0x37d7b9,_0x7749('0xc'),JSON[_0x7749('0xf')](_0xb58b29));if(_0xb58b29[_0x7749('0x10')]){if(_0xb58b29[_0x7749('0x10')][_0x7749('0x11')]===0x1f4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x37d7b9,_0xb58b29[_0x7749('0x10')]['message']);return _0x3efd35(_0xb58b29['error'][_0x7749('0x12')]);}logger[_0x7749('0x10')](_0x7749('0xb'),_0x37d7b9,_0xb58b29[_0x7749('0x10')][_0x7749('0x12')]);return _0x38dd37(_0xb58b29[_0x7749('0x10')]['message']);}else{logger['info'](_0x7749('0xb'),_0x37d7b9,_0x7749('0xc'));_0x38dd37(_0xb58b29['result'][_0x7749('0x12')]);}})[_0x7749('0x13')](function(_0x42c942){logger[_0x7749('0x10')](_0x7749('0xb'),_0x37d7b9,_0x42c942);_0x3efd35(_0x42c942);});});} \ No newline at end of file +var _0x382a=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x96b744,_0x4a1732){var _0x5539a4=function(_0x45e8e5){while(--_0x45e8e5){_0x96b744['push'](_0x96b744['shift']());}};_0x5539a4(++_0x4a1732);}(_0x382a,0x120));var _0xa382=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x382a[_0x3e531a];return _0x3c2574;};'use strict';var _=require(_0xa382('0x0'));var util=require(_0xa382('0x1'));var moment=require('moment');var BPromise=require(_0xa382('0x2'));var rs=require(_0xa382('0x3'));var fs=require('fs');var Redis=require(_0xa382('0x4'));var db=require(_0xa382('0x5'))['db'];var utils=require(_0xa382('0x6'));var logger=require(_0xa382('0x7'))(_0xa382('0x8'));var config=require(_0xa382('0x9'));var jayson=require(_0xa382('0xa'));var client=jayson['client'][_0xa382('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7008e5,_0x5a34ea,_0x333d5a){return new BPromise(function(_0x17ed0f,_0x1b0813){return client[_0xa382('0xc')](_0x7008e5,_0x333d5a)[_0xa382('0xd')](function(_0x41a904){logger[_0xa382('0xe')](_0xa382('0xf'),_0x5a34ea,'request\x20sent');logger['debug'](_0xa382('0x10'),_0x5a34ea,_0xa382('0x11'),JSON[_0xa382('0x12')](_0x41a904));if(_0x41a904[_0xa382('0x13')]){if(_0x41a904[_0xa382('0x13')]['code']===0x1f4){logger[_0xa382('0x13')](_0xa382('0xf'),_0x5a34ea,_0x41a904[_0xa382('0x13')][_0xa382('0x14')]);return _0x1b0813(_0x41a904['error']['message']);}logger[_0xa382('0x13')](_0xa382('0xf'),_0x5a34ea,_0x41a904['error']['message']);return _0x17ed0f(_0x41a904['error'][_0xa382('0x14')]);}else{logger[_0xa382('0xe')]('ContactItemType,\x20%s,\x20%s',_0x5a34ea,_0xa382('0x11'));_0x17ed0f(_0x41a904[_0xa382('0x15')][_0xa382('0x14')]);}})['catch'](function(_0x420f55){logger[_0xa382('0x13')](_0xa382('0xf'),_0x5a34ea,_0x420f55);_0x1b0813(_0x420f55);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 43f2cac..40849db 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 _0xd3b8=['post','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id'];(function(_0x518b8f,_0x476de4){var _0x51cece=function(_0x13e53e){while(--_0x13e53e){_0x518b8f['push'](_0x518b8f['shift']());}};_0x51cece(++_0x476de4);}(_0xd3b8,0x84));var _0x8d3b=function(_0x3cffb3,_0x284b2d){_0x3cffb3=_0x3cffb3-0x0;var _0x57a846=_0xd3b8[_0x3cffb3];return _0x57a846;};'use strict';var multer=require(_0x8d3b('0x0'));var util=require('util');var path=require(_0x8d3b('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d3b('0x2'));var router=express[_0x8d3b('0x3')]();var fs_extra=require(_0x8d3b('0x4'));var auth=require(_0x8d3b('0x5'));var interaction=require(_0x8d3b('0x6'));var config=require('../../config/environment');var controller=require(_0x8d3b('0x7'));router[_0x8d3b('0x8')]('/',auth[_0x8d3b('0x9')](),controller[_0x8d3b('0xa')]);router[_0x8d3b('0x8')](_0x8d3b('0xb'),auth[_0x8d3b('0x9')](),controller['show']);router[_0x8d3b('0xc')]('/',auth[_0x8d3b('0x9')](),controller['create']);router[_0x8d3b('0xd')](_0x8d3b('0xb'),auth['isAuthenticated'](),controller[_0x8d3b('0xe')]);router['delete'](_0x8d3b('0xb'),auth[_0x8d3b('0x9')](),controller[_0x8d3b('0xf')]);module['exports']=router; \ No newline at end of file +var _0x13a3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','show','post','put','update','delete','multer','util','path'];(function(_0x7113ee,_0x50595d){var _0x18a64d=function(_0x4d8548){while(--_0x4d8548){_0x7113ee['push'](_0x7113ee['shift']());}};_0x18a64d(++_0x50595d);}(_0x13a3,0x162));var _0x313a=function(_0x266eec,_0x1244d4){_0x266eec=_0x266eec-0x0;var _0x51f1a6=_0x13a3[_0x266eec];return _0x51f1a6;};'use strict';var multer=require(_0x313a('0x0'));var util=require(_0x313a('0x1'));var path=require(_0x313a('0x2'));var timeout=require('connect-timeout');var express=require(_0x313a('0x3'));var router=express[_0x313a('0x4')]();var fs_extra=require(_0x313a('0x5'));var auth=require(_0x313a('0x6'));var interaction=require(_0x313a('0x7'));var config=require(_0x313a('0x8'));var controller=require(_0x313a('0x9'));router[_0x313a('0xa')]('/',auth[_0x313a('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x313a('0xc')]);router[_0x313a('0xd')]('/',auth[_0x313a('0xb')](),controller['create']);router[_0x313a('0xe')]('/:id',auth[_0x313a('0xb')](),controller[_0x313a('0xf')]);router[_0x313a('0x10')]('/:id',auth[_0x313a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9083b7a..7939281 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 _0xd8b0=['exports','sequelize'];(function(_0x137538,_0x8e33cd){var _0x337a1c=function(_0x5de5cb){while(--_0x5de5cb){_0x137538['push'](_0x137538['shift']());}};_0x337a1c(++_0x8e33cd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 51f93aa..3df426a 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 _0xaecf=['send','index','map','Dashboard','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','get','omit','createdAt','body','updatedAt','userProfileId','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','total','attrSerie2','attrSerie3','attrChannel','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','CustomDashboards','UserProfileResource','then','error','stack','name'];(function(_0x58f88d,_0x566383){var _0x493798=function(_0x51cdcd){while(--_0x51cdcd){_0x58f88d['push'](_0x58f88d['shift']());}};_0x493798(++_0x566383);}(_0xaecf,0xd6));var _0xfaec=function(_0x38c63c,_0x4bb51b){_0x38c63c=_0x38c63c-0x0;var _0x4fc020=_0xaecf[_0x38c63c];return _0x4fc020;};'use strict';var emlformat=require(_0xfaec('0x0'));var rimraf=require(_0xfaec('0x1'));var zipdir=require(_0xfaec('0x2'));var jsonpatch=require(_0xfaec('0x3'));var rp=require(_0xfaec('0x4'));var moment=require('moment');var BPromise=require(_0xfaec('0x5'));var Mustache=require(_0xfaec('0x6'));var util=require(_0xfaec('0x7'));var path=require(_0xfaec('0x8'));var sox=require(_0xfaec('0x9'));var csv=require(_0xfaec('0xa'));var ejs=require(_0xfaec('0xb'));var fs=require('fs');var fs_extra=require(_0xfaec('0xc'));var _=require(_0xfaec('0xd'));var squel=require(_0xfaec('0xe'));var crypto=require(_0xfaec('0xf'));var jsforce=require(_0xfaec('0x10'));var deskjs=require(_0xfaec('0x11'));var toCsv=require(_0xfaec('0xa'));var querystring=require(_0xfaec('0x12'));var Papa=require(_0xfaec('0x13'));var Redis=require(_0xfaec('0x14'));var authService=require(_0xfaec('0x15'));var qs=require(_0xfaec('0x16'));var as=require(_0xfaec('0x17'));var hardwareService=require(_0xfaec('0x18'));var logger=require(_0xfaec('0x19'))(_0xfaec('0x1a'));var utils=require(_0xfaec('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xfaec('0x1c'));var db=require('../../mysqldb')['db'];config[_0xfaec('0x1d')]=_[_0xfaec('0x1e')](config[_0xfaec('0x1d')],{'host':_0xfaec('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaec('0x1d')]));require(_0xfaec('0x20'))[_0xfaec('0x21')](socket);function respondWithStatusCode(_0x11d0fa,_0x20269f){_0x20269f=_0x20269f||0xcc;return function(_0x34f163){if(_0x34f163){return _0x11d0fa[_0xfaec('0x22')](_0x20269f);}return _0x11d0fa[_0xfaec('0x23')](_0x20269f)[_0xfaec('0x24')]();};}function respondWithResult(_0x1f2016,_0x45e3f2){_0x45e3f2=_0x45e3f2||0xc8;return function(_0x15f30d){if(_0x15f30d){return _0x1f2016['status'](_0x45e3f2)[_0xfaec('0x25')](_0x15f30d);}};}function respondWithFilteredResult(_0x2ca0d6,_0x530b51){return function(_0x316f78){if(_0x316f78){var _0x3a7b44=typeof _0x530b51[_0xfaec('0x26')]===_0xfaec('0x27')&&typeof _0x530b51['limit']===_0xfaec('0x27');var _0x2d88a6=_0x316f78[_0xfaec('0x28')];var _0x4ef9ac=_0x3a7b44?0x0:_0x530b51['offset'];var _0xb2bd5f=_0x3a7b44?_0x316f78['count']:_0x530b51[_0xfaec('0x26')]+_0x530b51[_0xfaec('0x29')];var _0x556e0e;if(_0xb2bd5f>=_0x2d88a6){_0xb2bd5f=_0x2d88a6;_0x556e0e=0xc8;}else{_0x556e0e=0xce;}_0x2ca0d6['status'](_0x556e0e);return _0x2ca0d6[_0xfaec('0x2a')]('Content-Range',_0x4ef9ac+'-'+_0xb2bd5f+'/'+_0x2d88a6)['json'](_0x316f78);}return null;};}function patchUpdates(_0x39f13f){return function(_0x3a5df6){try{jsonpatch[_0xfaec('0x2b')](_0x3a5df6,_0x39f13f,!![]);}catch(_0x1ca360){return BPromise[_0xfaec('0x2c')](_0x1ca360);}return _0x3a5df6[_0xfaec('0x2d')]();};}function saveUpdates(_0x15d39f,_0x15e7a0){return function(_0x3cac61){if(_0x3cac61){return _0x3cac61[_0xfaec('0x2e')](_0x15d39f)['then'](function(_0x9c873a){return _0x9c873a;});}return null;};}function removeEntity(_0x5e5083,_0x2d2ab7){return function(_0x22a818){if(_0x22a818){return _0x22a818[_0xfaec('0x2f')]()['then'](function(){var _0x28f9cb=_0x22a818['get']({'plain':!![]});var _0x579f59=_0xfaec('0x30');return db[_0xfaec('0x31')][_0xfaec('0x2f')]({'where':{'type':_0x579f59,'resourceId':_0x28f9cb['id']}})[_0xfaec('0x32')](function(){return _0x22a818;});})[_0xfaec('0x32')](function(){_0x5e5083['status'](0xcc)[_0xfaec('0x24')]();});}};}function handleEntityNotFound(_0x357c49,_0x474472){return function(_0x165138){if(!_0x165138){_0x357c49['sendStatus'](0x194);}return _0x165138;};}function handleError(_0x5539aa,_0x522d83){_0x522d83=_0x522d83||0x1f4;return function(_0x37aa29){logger[_0xfaec('0x33')](_0x37aa29[_0xfaec('0x34')]);if(_0x37aa29[_0xfaec('0x35')]){delete _0x37aa29[_0xfaec('0x35')];}_0x5539aa[_0xfaec('0x23')](_0x522d83)[_0xfaec('0x36')](_0x37aa29);};}exports[_0xfaec('0x37')]=function(_0x192f02,_0x40a027){var _0x254d9e={},_0x27799b={},_0x504986={'count':0x0,'rows':[]};var _0x37dc03=_[_0xfaec('0x38')](db[_0xfaec('0x39')][_0xfaec('0x3a')],function(_0x4fdea2){return{'name':_0x4fdea2['fieldName'],'type':_0x4fdea2[_0xfaec('0x3b')][_0xfaec('0x3c')]};});_0x27799b[_0xfaec('0x3d')]=_[_0xfaec('0x38')](_0x37dc03,'name');_0x27799b[_0xfaec('0x3e')]=_[_0xfaec('0x3f')](_0x192f02[_0xfaec('0x3e')]);_0x27799b['filters']=_['intersection'](_0x27799b['model'],_0x27799b['query']);_0x254d9e[_0xfaec('0x40')]=_[_0xfaec('0x41')](_0x27799b[_0xfaec('0x3d')],qs[_0xfaec('0x42')](_0x192f02[_0xfaec('0x3e')][_0xfaec('0x42')]));_0x254d9e[_0xfaec('0x40')]=_0x254d9e[_0xfaec('0x40')][_0xfaec('0x43')]?_0x254d9e[_0xfaec('0x40')]:_0x27799b[_0xfaec('0x3d')];if(!_0x192f02['query'][_0xfaec('0x44')](_0xfaec('0x45'))){_0x254d9e['limit']=qs[_0xfaec('0x29')](_0x192f02[_0xfaec('0x3e')][_0xfaec('0x29')]);_0x254d9e[_0xfaec('0x26')]=qs['offset'](_0x192f02[_0xfaec('0x3e')][_0xfaec('0x26')]);}_0x254d9e[_0xfaec('0x46')]=qs[_0xfaec('0x47')](_0x192f02[_0xfaec('0x3e')][_0xfaec('0x47')]);_0x254d9e[_0xfaec('0x48')]=qs['filters'](_[_0xfaec('0x49')](_0x192f02[_0xfaec('0x3e')],_0x27799b[_0xfaec('0x4a')]),_0x37dc03);if(_0x192f02[_0xfaec('0x3e')][_0xfaec('0x4b')]){_0x254d9e[_0xfaec('0x48')]=_[_0xfaec('0x4c')](_0x254d9e[_0xfaec('0x48')],{'$or':_[_0xfaec('0x38')](_0x37dc03,function(_0x44d4e1){if(_0x44d4e1[_0xfaec('0x3b')]!==_0xfaec('0x4d')){var _0x3655d5={};_0x3655d5[_0x44d4e1[_0xfaec('0x35')]]={'$like':'%'+_0x192f02[_0xfaec('0x3e')]['filter']+'%'};return _0x3655d5;}})});}_0x254d9e=_[_0xfaec('0x4c')]({},_0x254d9e,_0x192f02[_0xfaec('0x4e')]);var _0x961d3e={'where':_0x254d9e[_0xfaec('0x48')]};return db[_0xfaec('0x39')][_0xfaec('0x28')](_0x961d3e)[_0xfaec('0x32')](function(_0x494e71){_0x504986[_0xfaec('0x28')]=_0x494e71;if(_0x192f02[_0xfaec('0x3e')][_0xfaec('0x4f')]){_0x254d9e[_0xfaec('0x50')]=[{'all':!![]}];}return db[_0xfaec('0x39')][_0xfaec('0x51')](_0x254d9e);})[_0xfaec('0x32')](function(_0x14fc66){_0x504986['rows']=_0x14fc66;return _0x504986;})[_0xfaec('0x32')](respondWithFilteredResult(_0x40a027,_0x254d9e))[_0xfaec('0x52')](handleError(_0x40a027,null));};exports[_0xfaec('0x53')]=function(_0x2e4a2f,_0x27e410){var _0x511ac4={'raw':![],'where':{'id':_0x2e4a2f[_0xfaec('0x54')]['id']}},_0x347131={};_0x347131['model']=_[_0xfaec('0x3f')](db[_0xfaec('0x39')][_0xfaec('0x3a')]);_0x347131[_0xfaec('0x3e')]=_[_0xfaec('0x3f')](_0x2e4a2f['query']);_0x347131[_0xfaec('0x4a')]=_[_0xfaec('0x41')](_0x347131[_0xfaec('0x3d')],_0x347131[_0xfaec('0x3e')]);_0x511ac4[_0xfaec('0x40')]=_[_0xfaec('0x41')](_0x347131['model'],qs[_0xfaec('0x42')](_0x2e4a2f[_0xfaec('0x3e')]['fields']));_0x511ac4[_0xfaec('0x40')]=_0x511ac4['attributes'][_0xfaec('0x43')]?_0x511ac4[_0xfaec('0x40')]:_0x347131[_0xfaec('0x3d')];if(_0x2e4a2f['query'][_0xfaec('0x4f')]){_0x511ac4['include']=[{'all':!![]}];}_0x511ac4=_[_0xfaec('0x4c')]({},_0x511ac4,_0x2e4a2f[_0xfaec('0x4e')]);return db[_0xfaec('0x39')][_0xfaec('0x55')](_0x511ac4)[_0xfaec('0x32')](handleEntityNotFound(_0x27e410,null))[_0xfaec('0x32')](respondWithResult(_0x27e410,null))[_0xfaec('0x52')](handleError(_0x27e410,null));};exports[_0xfaec('0x56')]=function(_0x4f0859,_0x4dde7c){return db['Dashboard']['create'](_0x4f0859['body'],{})[_0xfaec('0x32')](function(_0x140cf3){var _0xafc33=_0x4f0859[_0xfaec('0x57')]['get']({'plain':!![]});if(!_0xafc33)throw new Error(_0xfaec('0x58'));if(_0xafc33[_0xfaec('0x59')]==='user'){var _0x3b4ba4=_0x140cf3['get']({'plain':!![]});var _0x5d4061=_0xfaec('0x30');return db[_0xfaec('0x5a')][_0xfaec('0x55')]({'where':{'name':_0x5d4061,'userProfileId':_0xafc33['userProfileId']},'raw':!![]})[_0xfaec('0x32')](function(_0x1ff3bb){if(_0x1ff3bb&&_0x1ff3bb['autoAssociation']===0x0){return db[_0xfaec('0x31')][_0xfaec('0x56')]({'name':_0x3b4ba4[_0xfaec('0x35')],'resourceId':_0x3b4ba4['id'],'type':_0x1ff3bb[_0xfaec('0x35')],'sectionId':_0x1ff3bb['id']},{})[_0xfaec('0x32')](function(){return _0x140cf3;});}else{return _0x140cf3;}})[_0xfaec('0x52')](function(_0x4cb98d){logger[_0xfaec('0x33')](_0xfaec('0x5b'),_0x4cb98d);throw _0x4cb98d;});}return _0x140cf3;})['then'](respondWithResult(_0x4dde7c,0xc9))['catch'](handleError(_0x4dde7c,null));};exports[_0xfaec('0x5c')]=function(_0x386d99,_0x13db49){var _0x355987={'where':{'id':_0x386d99['params']['id']}},_0x549e36={};_0x549e36['model']=_[_0xfaec('0x3f')](db[_0xfaec('0x39')]['rawAttributes']);_0x355987[_0xfaec('0x40')]=_[_0xfaec('0x41')](_0x549e36['model'],qs['fields'](_0x386d99[_0xfaec('0x3e')]['fields']));_0x355987[_0xfaec('0x40')]=_0x355987[_0xfaec('0x40')][_0xfaec('0x43')]?_0x355987[_0xfaec('0x40')]:_0x549e36[_0xfaec('0x3d')];if(_0x386d99[_0xfaec('0x3e')][_0xfaec('0x4f')]){_0x355987[_0xfaec('0x50')]=[{'all':!![]}];}_0x355987=_[_0xfaec('0x4c')]({},_0x355987,_0x386d99[_0xfaec('0x4e')]);return db[_0xfaec('0x39')][_0xfaec('0x55')](_0x355987)['then'](handleEntityNotFound(_0x13db49,null))[_0xfaec('0x32')](function(_0x4906ab){if(_0x4906ab){var _0x1b960b=_0x4906ab[_0xfaec('0x5d')]({'plain':!![]});_0x1b960b=qs[_0xfaec('0x5e')](_0x1b960b,['id',_0xfaec('0x5f'),'updatedAt']);_0x386d99[_0xfaec('0x60')]=_['omit'](_0x386d99[_0xfaec('0x60')],['id',_0xfaec('0x5f'),_0xfaec('0x61')]);return db[_0xfaec('0x39')][_0xfaec('0x56')](_[_0xfaec('0x4c')](_0x1b960b,_0x386d99['body']),{'include':_0x386d99['query']['includeAll']?[{'all':!![]}]:undefined})[_0xfaec('0x32')](function(_0x2d9e10){var _0x634587=_0x386d99[_0xfaec('0x57')][_0xfaec('0x5d')]({'plain':!![]});if(!_0x634587)throw new Error(_0xfaec('0x58'));if(_0x634587[_0xfaec('0x59')]===_0xfaec('0x57')){var _0x5d2a81=_0x2d9e10['get']({'plain':!![]});var _0x247e70=_0xfaec('0x30');return db['UserProfileSection']['find']({'where':{'name':_0x247e70,'userProfileId':_0x634587[_0xfaec('0x62')]},'raw':!![]})[_0xfaec('0x32')](function(_0x10d00a){if(_0x10d00a&&_0x10d00a['autoAssociation']===0x0){return db[_0xfaec('0x31')][_0xfaec('0x56')]({'name':_0x5d2a81[_0xfaec('0x35')],'resourceId':_0x5d2a81['id'],'type':_0x10d00a[_0xfaec('0x35')],'sectionId':_0x10d00a['id']},{})[_0xfaec('0x32')](function(){return _0x2d9e10;});}else{return _0x2d9e10;}})['catch'](function(_0xf67b10){logger[_0xfaec('0x33')](_0xfaec('0x5b'),_0xf67b10);throw _0xf67b10;});}return _0x2d9e10;});}})[_0xfaec('0x32')](respondWithResult(_0x13db49,0xc9))['catch'](handleError(_0x13db49,null));};exports['update']=function(_0x368e5f,_0x34a193){if(_0x368e5f['body']['id']){delete _0x368e5f['body']['id'];}return db[_0xfaec('0x39')][_0xfaec('0x55')]({'where':{'id':_0x368e5f[_0xfaec('0x54')]['id']}})[_0xfaec('0x32')](handleEntityNotFound(_0x34a193,null))[_0xfaec('0x32')](saveUpdates(_0x368e5f[_0xfaec('0x60')],null))['then'](respondWithResult(_0x34a193,null))[_0xfaec('0x52')](handleError(_0x34a193,null));};exports['destroy']=function(_0x5c7e68,_0x2131c3){return db[_0xfaec('0x39')]['find']({'where':{'id':_0x5c7e68[_0xfaec('0x54')]['id']}})[_0xfaec('0x32')](handleEntityNotFound(_0x2131c3,null))['then'](removeEntity(_0x2131c3,null))[_0xfaec('0x52')](handleError(_0x2131c3,null));};function widgetAttributes(_0x5d966b){try{switch(_0x5d966b['type']){case _0xfaec('0x63'):return[{'name':'attrUrl','value':_0x5d966b[_0xfaec('0x64')]||(_0x5d966b['attrs']&&_0x5d966b['attrs'][0x0]?_0x5d966b[_0xfaec('0x65')][0x0][_0xfaec('0x66')]:undefined)||_0xfaec('0x67')}];case'custom':return[{'name':'attrPath','value':_0x5d966b[_0xfaec('0x68')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x0]?_0x5d966b[_0xfaec('0x65')][0x0][_0xfaec('0x66')]:undefined)||''}];case _0xfaec('0x69'):return[{'name':_0xfaec('0x6a'),'value':_0x5d966b[_0xfaec('0x6a')]||(_0x5d966b['attrs']&&_0x5d966b[_0xfaec('0x65')][0x0]?_0x5d966b['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xfaec('0x6b'),'value':_0x5d966b[_0xfaec('0x6b')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x1]?_0x5d966b[_0xfaec('0x65')][0x1][_0xfaec('0x66')]:undefined)||_0xfaec('0x6c')},{'name':_0xfaec('0x6d'),'value':_0x5d966b['attrFontSize']||(_0x5d966b['attrs']&&_0x5d966b[_0xfaec('0x65')][0x2]?_0x5d966b['attrs'][0x2][_0xfaec('0x66')]:undefined)||0xc}];case _0xfaec('0x6e'):return[{'name':_0xfaec('0x6f'),'value':_0x5d966b[_0xfaec('0x6f')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x0]?_0x5d966b[_0xfaec('0x65')][0x0]['value']:undefined)||'total'},{'name':_0xfaec('0x70'),'value':_0x5d966b[_0xfaec('0x70')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b['attrs'][0x1]?_0x5d966b[_0xfaec('0x65')][0x1][_0xfaec('0x66')]:undefined)||[]},{'name':'attrFontSize','value':_0x5d966b[_0xfaec('0x6d')]||(_0x5d966b['attrs']&&_0x5d966b[_0xfaec('0x65')][0x2]?_0x5d966b[_0xfaec('0x65')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x5d966b['attrChannel']||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x3]?_0x5d966b[_0xfaec('0x65')][0x3][_0xfaec('0x66')]:undefined)||_0xfaec('0x71')},{'name':_0xfaec('0x72'),'value':_0x5d966b['attrEmailAccounts']||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x4]?_0x5d966b[_0xfaec('0x65')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x5d966b[_0xfaec('0x73')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b['attrs'][0x5]?_0x5d966b[_0xfaec('0x65')][0x5][_0xfaec('0x66')]:undefined)||''},{'name':_0xfaec('0x74'),'value':_0x5d966b[_0xfaec('0x74')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x6]?_0x5d966b[_0xfaec('0x65')][0x6]['value']:undefined)||''},{'name':_0xfaec('0x75'),'value':_0x5d966b[_0xfaec('0x75')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x7]?_0x5d966b[_0xfaec('0x65')][0x7][_0xfaec('0x66')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5d966b[_0xfaec('0x76')]||(_0x5d966b['attrs']&&_0x5d966b[_0xfaec('0x65')][0x8]?_0x5d966b[_0xfaec('0x65')][0x8][_0xfaec('0x66')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5d966b[_0xfaec('0x77')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x9]?_0x5d966b[_0xfaec('0x65')][0x9]['value']:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0xfaec('0x78'),'value':_0x5d966b[_0xfaec('0x78')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x0]?_0x5d966b[_0xfaec('0x65')][0x0][_0xfaec('0x66')]:undefined)||_0xfaec('0x79')},{'name':_0xfaec('0x7a'),'value':_0x5d966b[_0xfaec('0x7a')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x1]?_0x5d966b[_0xfaec('0x65')][0x1][_0xfaec('0x66')]:undefined)||null},{'name':_0xfaec('0x7b'),'value':_0x5d966b[_0xfaec('0x7b')]||(_0x5d966b['attrs']&&_0x5d966b[_0xfaec('0x65')][0x2]?_0x5d966b['attrs'][0x2]['value']:undefined)||null},{'name':_0xfaec('0x70'),'value':_0x5d966b['attrVoiceQueues']||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x3]?_0x5d966b[_0xfaec('0x65')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x5d966b[_0xfaec('0x7c')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x4]?_0x5d966b[_0xfaec('0x65')][0x4][_0xfaec('0x66')]:undefined)||'voice'},{'name':_0xfaec('0x72'),'value':_0x5d966b[_0xfaec('0x72')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x5]?_0x5d966b[_0xfaec('0x65')][0x5][_0xfaec('0x66')]:undefined)||''},{'name':_0xfaec('0x73'),'value':_0x5d966b[_0xfaec('0x73')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x6]?_0x5d966b['attrs'][0x6][_0xfaec('0x66')]:undefined)||''},{'name':_0xfaec('0x74'),'value':_0x5d966b[_0xfaec('0x74')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x7]?_0x5d966b['attrs'][0x7][_0xfaec('0x66')]:undefined)||''},{'name':_0xfaec('0x75'),'value':_0x5d966b[_0xfaec('0x75')]||(_0x5d966b['attrs']&&_0x5d966b[_0xfaec('0x65')][0x8]?_0x5d966b[_0xfaec('0x65')][0x8][_0xfaec('0x66')]:undefined)||''},{'name':_0xfaec('0x76'),'value':_0x5d966b['attrWhatsappAccounts']||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x9]?_0x5d966b[_0xfaec('0x65')][0x9][_0xfaec('0x66')]:undefined)||''},{'name':_0xfaec('0x77'),'value':_0x5d966b[_0xfaec('0x77')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b['attrs'][0xa]?_0x5d966b[_0xfaec('0x65')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x5d966b[_0xfaec('0x7d')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x0]?_0x5d966b[_0xfaec('0x65')][0x0][_0xfaec('0x3b')]:undefined)||null,'value':_0x5d966b[_0xfaec('0x7e')]||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x0]?_0x5d966b[_0xfaec('0x65')][0x0][_0xfaec('0x66')]:undefined)||null},{'name':_0xfaec('0x7f'),'value':_0x5d966b['attrRefresh']||(_0x5d966b[_0xfaec('0x65')]&&_0x5d966b[_0xfaec('0x65')][0x1]?_0x5d966b['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xa850ee){logger[_0xfaec('0x33')](_0xfaec('0x80'),JSON[_0xfaec('0x81')](_0xa850ee));return[];}}exports[_0xfaec('0x82')]=function(_0x5c1e7e,_0x51c6fa,_0x416031){if(_0x5c1e7e[_0xfaec('0x60')]['id']){delete _0x5c1e7e['body']['id'];}return db[_0xfaec('0x39')][_0xfaec('0x55')]({'where':{'id':_0x5c1e7e[_0xfaec('0x54')]['id']}})[_0xfaec('0x32')](handleEntityNotFound(_0x51c6fa,null))[_0xfaec('0x32')](function(_0xa40224){if(_0xa40224){_0x5c1e7e[_0xfaec('0x60')]['DashboardId']=_0xa40224['id'];_0x5c1e7e[_0xfaec('0x60')]['attrs']=widgetAttributes(_0x5c1e7e[_0xfaec('0x60')]);return db[_0xfaec('0x83')][_0xfaec('0x56')](_0x5c1e7e[_0xfaec('0x60')]);}})['then'](respondWithResult(_0x51c6fa,null))[_0xfaec('0x52')](handleError(_0x51c6fa,null));};exports[_0xfaec('0x84')]=function(_0x125c6e,_0x3925dc,_0xa581bb){var _0x30e7d6={};var _0xf1f3ba={};var _0x17b7fe;var _0x5d4a39;return db['Dashboard'][_0xfaec('0x85')]({'where':{'id':_0x125c6e[_0xfaec('0x54')]['id']}})[_0xfaec('0x32')](handleEntityNotFound(_0x3925dc,null))[_0xfaec('0x32')](function(_0x1d2a6e){if(_0x1d2a6e){_0x17b7fe=_0x1d2a6e;_0xf1f3ba[_0xfaec('0x3d')]=_['keys'](db[_0xfaec('0x83')]['rawAttributes']);_0xf1f3ba['query']=_[_0xfaec('0x3f')](_0x125c6e[_0xfaec('0x3e')]);_0xf1f3ba['filters']=_[_0xfaec('0x41')](_0xf1f3ba[_0xfaec('0x3d')],_0xf1f3ba[_0xfaec('0x3e')]);_0x30e7d6[_0xfaec('0x40')]=_[_0xfaec('0x41')](_0xf1f3ba['model'],qs[_0xfaec('0x42')](_0x125c6e[_0xfaec('0x3e')]['fields']));_0x30e7d6[_0xfaec('0x40')]=_0x30e7d6[_0xfaec('0x40')][_0xfaec('0x43')]?_0x30e7d6['attributes']:_0xf1f3ba['model'];_0x30e7d6[_0xfaec('0x46')]=qs[_0xfaec('0x47')](_0x125c6e['query'][_0xfaec('0x47')]);_0x30e7d6[_0xfaec('0x48')]=qs['filters'](_['pick'](_0x125c6e[_0xfaec('0x3e')],_0xf1f3ba[_0xfaec('0x4a')]));if(_0x125c6e[_0xfaec('0x3e')][_0xfaec('0x4b')]){_0x30e7d6[_0xfaec('0x48')]=_['merge'](_0x30e7d6[_0xfaec('0x48')],{'$or':_[_0xfaec('0x38')](_0x30e7d6[_0xfaec('0x40')],function(_0x3c7bc8){var _0x1272dd={};_0x1272dd[_0x3c7bc8]={'$like':'%'+_0x125c6e['query'][_0xfaec('0x4b')]+'%'};return _0x1272dd;})});}_0x30e7d6=_[_0xfaec('0x4c')]({},_0x30e7d6,_0x125c6e[_0xfaec('0x4e')]);return _0x17b7fe[_0xfaec('0x84')](_0x30e7d6);}})[_0xfaec('0x32')](function(_0x260c29){if(_0x260c29){_0x5d4a39=_0x260c29[_0xfaec('0x43')];if(!_0x125c6e[_0xfaec('0x3e')][_0xfaec('0x44')]('nolimit')){_0x30e7d6[_0xfaec('0x29')]=qs[_0xfaec('0x29')](_0x125c6e[_0xfaec('0x3e')][_0xfaec('0x29')]);_0x30e7d6[_0xfaec('0x26')]=qs[_0xfaec('0x26')](_0x125c6e[_0xfaec('0x3e')][_0xfaec('0x26')]);}return _0x17b7fe[_0xfaec('0x84')](_0x30e7d6);}})[_0xfaec('0x32')](function(_0x98d785){if(_0x98d785){return _0x98d785?{'count':_0x5d4a39,'rows':_0x98d785}:null;}})[_0xfaec('0x32')](respondWithResult(_0x3925dc,null))[_0xfaec('0x52')](handleError(_0x3925dc,null));}; \ No newline at end of file +var _0x13ed=['updatedAt','iframe','attrUrl','attrs','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','DashboardId','DashboardItem','hasOwnProperty','getItems','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','CustomDashboards','UserProfileResource','end','sendStatus','error','name','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt'];(function(_0x490a3d,_0x54983e){var _0xb4575d=function(_0x4b67f8){while(--_0x4b67f8){_0x490a3d['push'](_0x490a3d['shift']());}};_0xb4575d(++_0x54983e);}(_0x13ed,0xa2));var _0xd13e=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0x13ed[_0x210603];return _0x1bcb7d;};'use strict';var emlformat=require(_0xd13e('0x0'));var rimraf=require(_0xd13e('0x1'));var zipdir=require(_0xd13e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd13e('0x3'));var moment=require('moment');var BPromise=require(_0xd13e('0x4'));var Mustache=require(_0xd13e('0x5'));var util=require(_0xd13e('0x6'));var path=require('path');var sox=require(_0xd13e('0x7'));var csv=require('to-csv');var ejs=require(_0xd13e('0x8'));var fs=require('fs');var fs_extra=require(_0xd13e('0x9'));var _=require(_0xd13e('0xa'));var squel=require(_0xd13e('0xb'));var crypto=require(_0xd13e('0xc'));var jsforce=require(_0xd13e('0xd'));var deskjs=require(_0xd13e('0xe'));var toCsv=require(_0xd13e('0xf'));var querystring=require(_0xd13e('0x10'));var Papa=require(_0xd13e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd13e('0x12'));var hardwareService=require(_0xd13e('0x13'));var logger=require(_0xd13e('0x14'))(_0xd13e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd13e('0x16'));var db=require(_0xd13e('0x17'))['db'];config[_0xd13e('0x18')]=_[_0xd13e('0x19')](config['redis'],{'host':_0xd13e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0xd13e('0x1b')](socket);function respondWithStatusCode(_0x1ee1d2,_0x779b92){_0x779b92=_0x779b92||0xcc;return function(_0x53d326){if(_0x53d326){return _0x1ee1d2['sendStatus'](_0x779b92);}return _0x1ee1d2[_0xd13e('0x1c')](_0x779b92)['end']();};}function respondWithResult(_0x4c171e,_0x190ae5){_0x190ae5=_0x190ae5||0xc8;return function(_0x174a13){if(_0x174a13){return _0x4c171e[_0xd13e('0x1c')](_0x190ae5)['json'](_0x174a13);}};}function respondWithFilteredResult(_0x241a52,_0x2e5ae2){return function(_0x1a4fc0){if(_0x1a4fc0){var _0x83da2f=typeof _0x2e5ae2['offset']===_0xd13e('0x1d')&&typeof _0x2e5ae2[_0xd13e('0x1e')]===_0xd13e('0x1d');var _0x591bf6=_0x1a4fc0[_0xd13e('0x1f')];var _0xfe1f26=_0x83da2f?0x0:_0x2e5ae2['offset'];var _0x59baa5=_0x83da2f?_0x1a4fc0[_0xd13e('0x1f')]:_0x2e5ae2[_0xd13e('0x20')]+_0x2e5ae2[_0xd13e('0x1e')];var _0x17505a;if(_0x59baa5>=_0x591bf6){_0x59baa5=_0x591bf6;_0x17505a=0xc8;}else{_0x17505a=0xce;}_0x241a52['status'](_0x17505a);return _0x241a52[_0xd13e('0x21')](_0xd13e('0x22'),_0xfe1f26+'-'+_0x59baa5+'/'+_0x591bf6)['json'](_0x1a4fc0);}return null;};}function patchUpdates(_0x5d157e){return function(_0x31218c){try{jsonpatch['apply'](_0x31218c,_0x5d157e,!![]);}catch(_0xd9e4de){return BPromise[_0xd13e('0x23')](_0xd9e4de);}return _0x31218c[_0xd13e('0x24')]();};}function saveUpdates(_0xb4bb80,_0x448f30){return function(_0x306348){if(_0x306348){return _0x306348[_0xd13e('0x25')](_0xb4bb80)['then'](function(_0x485ef0){return _0x485ef0;});}return null;};}function removeEntity(_0x29eb74,_0x3d07ed){return function(_0x2e6fcc){if(_0x2e6fcc){return _0x2e6fcc[_0xd13e('0x26')]()[_0xd13e('0x27')](function(){var _0x518777=_0x2e6fcc['get']({'plain':!![]});var _0x1665f5=_0xd13e('0x28');return db[_0xd13e('0x29')]['destroy']({'where':{'type':_0x1665f5,'resourceId':_0x518777['id']}})['then'](function(){return _0x2e6fcc;});})[_0xd13e('0x27')](function(){_0x29eb74[_0xd13e('0x1c')](0xcc)[_0xd13e('0x2a')]();});}};}function handleEntityNotFound(_0x244d59,_0x23587b){return function(_0x568ed8){if(!_0x568ed8){_0x244d59[_0xd13e('0x2b')](0x194);}return _0x568ed8;};}function handleError(_0x3bbf4a,_0x3553b9){_0x3553b9=_0x3553b9||0x1f4;return function(_0x4fb8c4){logger[_0xd13e('0x2c')](_0x4fb8c4['stack']);if(_0x4fb8c4[_0xd13e('0x2d')]){delete _0x4fb8c4[_0xd13e('0x2d')];}_0x3bbf4a[_0xd13e('0x1c')](_0x3553b9)['send'](_0x4fb8c4);};}exports[_0xd13e('0x2e')]=function(_0x299e34,_0x4af537){var _0x383a55={},_0x18509b={},_0x29ada8={'count':0x0,'rows':[]};var _0x327a18=_['map'](db[_0xd13e('0x2f')][_0xd13e('0x30')],function(_0x2e7ec1){return{'name':_0x2e7ec1[_0xd13e('0x31')],'type':_0x2e7ec1[_0xd13e('0x32')][_0xd13e('0x33')]};});_0x18509b[_0xd13e('0x34')]=_[_0xd13e('0x35')](_0x327a18,_0xd13e('0x2d'));_0x18509b[_0xd13e('0x36')]=_[_0xd13e('0x37')](_0x299e34['query']);_0x18509b[_0xd13e('0x38')]=_[_0xd13e('0x39')](_0x18509b['model'],_0x18509b[_0xd13e('0x36')]);_0x383a55[_0xd13e('0x3a')]=_[_0xd13e('0x39')](_0x18509b['model'],qs[_0xd13e('0x3b')](_0x299e34[_0xd13e('0x36')][_0xd13e('0x3b')]));_0x383a55[_0xd13e('0x3a')]=_0x383a55[_0xd13e('0x3a')][_0xd13e('0x3c')]?_0x383a55[_0xd13e('0x3a')]:_0x18509b[_0xd13e('0x34')];if(!_0x299e34[_0xd13e('0x36')]['hasOwnProperty'](_0xd13e('0x3d'))){_0x383a55[_0xd13e('0x1e')]=qs[_0xd13e('0x1e')](_0x299e34[_0xd13e('0x36')][_0xd13e('0x1e')]);_0x383a55[_0xd13e('0x20')]=qs[_0xd13e('0x20')](_0x299e34['query']['offset']);}_0x383a55[_0xd13e('0x3e')]=qs[_0xd13e('0x3f')](_0x299e34[_0xd13e('0x36')][_0xd13e('0x3f')]);_0x383a55['where']=qs[_0xd13e('0x38')](_[_0xd13e('0x40')](_0x299e34['query'],_0x18509b[_0xd13e('0x38')]),_0x327a18);if(_0x299e34['query'][_0xd13e('0x41')]){_0x383a55['where']=_[_0xd13e('0x42')](_0x383a55[_0xd13e('0x43')],{'$or':_['map'](_0x327a18,function(_0x307c6a){if(_0x307c6a[_0xd13e('0x32')]!==_0xd13e('0x44')){var _0x1fac17={};_0x1fac17[_0x307c6a[_0xd13e('0x2d')]]={'$like':'%'+_0x299e34[_0xd13e('0x36')]['filter']+'%'};return _0x1fac17;}})});}_0x383a55=_[_0xd13e('0x42')]({},_0x383a55,_0x299e34[_0xd13e('0x45')]);var _0x35b0cc={'where':_0x383a55[_0xd13e('0x43')]};return db['Dashboard'][_0xd13e('0x1f')](_0x35b0cc)[_0xd13e('0x27')](function(_0x1b8c12){_0x29ada8[_0xd13e('0x1f')]=_0x1b8c12;if(_0x299e34['query'][_0xd13e('0x46')]){_0x383a55[_0xd13e('0x47')]=[{'all':!![]}];}return db[_0xd13e('0x2f')][_0xd13e('0x48')](_0x383a55);})[_0xd13e('0x27')](function(_0x316b34){_0x29ada8[_0xd13e('0x49')]=_0x316b34;return _0x29ada8;})['then'](respondWithFilteredResult(_0x4af537,_0x383a55))['catch'](handleError(_0x4af537,null));};exports['show']=function(_0x216940,_0x34cffa){var _0x400680={'raw':![],'where':{'id':_0x216940[_0xd13e('0x4a')]['id']}},_0x3629f6={};_0x3629f6[_0xd13e('0x34')]=_[_0xd13e('0x37')](db['Dashboard']['rawAttributes']);_0x3629f6[_0xd13e('0x36')]=_[_0xd13e('0x37')](_0x216940['query']);_0x3629f6['filters']=_[_0xd13e('0x39')](_0x3629f6[_0xd13e('0x34')],_0x3629f6[_0xd13e('0x36')]);_0x400680[_0xd13e('0x3a')]=_[_0xd13e('0x39')](_0x3629f6[_0xd13e('0x34')],qs[_0xd13e('0x3b')](_0x216940['query'][_0xd13e('0x3b')]));_0x400680[_0xd13e('0x3a')]=_0x400680[_0xd13e('0x3a')][_0xd13e('0x3c')]?_0x400680['attributes']:_0x3629f6[_0xd13e('0x34')];if(_0x216940[_0xd13e('0x36')]['includeAll']){_0x400680[_0xd13e('0x47')]=[{'all':!![]}];}_0x400680=_[_0xd13e('0x42')]({},_0x400680,_0x216940['options']);return db['Dashboard'][_0xd13e('0x4b')](_0x400680)[_0xd13e('0x27')](handleEntityNotFound(_0x34cffa,null))[_0xd13e('0x27')](respondWithResult(_0x34cffa,null))['catch'](handleError(_0x34cffa,null));};exports[_0xd13e('0x4c')]=function(_0x4fb400,_0x1a70f9){return db[_0xd13e('0x2f')][_0xd13e('0x4c')](_0x4fb400[_0xd13e('0x4d')],{})[_0xd13e('0x27')](function(_0x16084d){var _0x44d36c=_0x4fb400[_0xd13e('0x4e')][_0xd13e('0x4f')]({'plain':!![]});if(!_0x44d36c)throw new Error(_0xd13e('0x50'));if(_0x44d36c[_0xd13e('0x51')]===_0xd13e('0x4e')){var _0x3300a6=_0x16084d[_0xd13e('0x4f')]({'plain':!![]});var _0x1a67c1=_0xd13e('0x28');return db[_0xd13e('0x52')]['find']({'where':{'name':_0x1a67c1,'userProfileId':_0x44d36c[_0xd13e('0x53')]},'raw':!![]})[_0xd13e('0x27')](function(_0x81283d){if(_0x81283d&&_0x81283d[_0xd13e('0x54')]===0x0){return db['UserProfileResource'][_0xd13e('0x4c')]({'name':_0x3300a6['name'],'resourceId':_0x3300a6['id'],'type':_0x81283d[_0xd13e('0x2d')],'sectionId':_0x81283d['id']},{})[_0xd13e('0x27')](function(){return _0x16084d;});}else{return _0x16084d;}})[_0xd13e('0x55')](function(_0x26e64f){logger['error'](_0xd13e('0x56'),_0x26e64f);throw _0x26e64f;});}return _0x16084d;})[_0xd13e('0x27')](respondWithResult(_0x1a70f9,0xc9))[_0xd13e('0x55')](handleError(_0x1a70f9,null));};exports[_0xd13e('0x57')]=function(_0x412fb2,_0x203240){var _0x5225f6={'where':{'id':_0x412fb2[_0xd13e('0x4a')]['id']}},_0x300bef={};_0x300bef['model']=_[_0xd13e('0x37')](db[_0xd13e('0x2f')][_0xd13e('0x30')]);_0x5225f6[_0xd13e('0x3a')]=_[_0xd13e('0x39')](_0x300bef[_0xd13e('0x34')],qs['fields'](_0x412fb2[_0xd13e('0x36')][_0xd13e('0x3b')]));_0x5225f6[_0xd13e('0x3a')]=_0x5225f6[_0xd13e('0x3a')]['length']?_0x5225f6['attributes']:_0x300bef[_0xd13e('0x34')];if(_0x412fb2[_0xd13e('0x36')][_0xd13e('0x46')]){_0x5225f6[_0xd13e('0x47')]=[{'all':!![]}];}_0x5225f6=_[_0xd13e('0x42')]({},_0x5225f6,_0x412fb2[_0xd13e('0x45')]);return db[_0xd13e('0x2f')]['find'](_0x5225f6)[_0xd13e('0x27')](handleEntityNotFound(_0x203240,null))[_0xd13e('0x27')](function(_0x5c16c7){if(_0x5c16c7){var _0x383742=_0x5c16c7[_0xd13e('0x4f')]({'plain':!![]});_0x383742=qs[_0xd13e('0x58')](_0x383742,['id',_0xd13e('0x59'),_0xd13e('0x5a')]);_0x412fb2['body']=_['omit'](_0x412fb2[_0xd13e('0x4d')],['id','createdAt',_0xd13e('0x5a')]);return db[_0xd13e('0x2f')][_0xd13e('0x4c')](_[_0xd13e('0x42')](_0x383742,_0x412fb2[_0xd13e('0x4d')]),{'include':_0x412fb2[_0xd13e('0x36')][_0xd13e('0x46')]?[{'all':!![]}]:undefined})[_0xd13e('0x27')](function(_0x416c1e){var _0x40619e=_0x412fb2['user']['get']({'plain':!![]});if(!_0x40619e)throw new Error(_0xd13e('0x50'));if(_0x40619e['role']==='user'){var _0x13e771=_0x416c1e['get']({'plain':!![]});var _0xc6c6ce=_0xd13e('0x28');return db[_0xd13e('0x52')]['find']({'where':{'name':_0xc6c6ce,'userProfileId':_0x40619e[_0xd13e('0x53')]},'raw':!![]})['then'](function(_0x112f2e){if(_0x112f2e&&_0x112f2e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x13e771[_0xd13e('0x2d')],'resourceId':_0x13e771['id'],'type':_0x112f2e[_0xd13e('0x2d')],'sectionId':_0x112f2e['id']},{})[_0xd13e('0x27')](function(){return _0x416c1e;});}else{return _0x416c1e;}})['catch'](function(_0x27998b){logger[_0xd13e('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27998b);throw _0x27998b;});}return _0x416c1e;});}})[_0xd13e('0x27')](respondWithResult(_0x203240,0xc9))[_0xd13e('0x55')](handleError(_0x203240,null));};exports['update']=function(_0x5edb3f,_0x171d15){if(_0x5edb3f[_0xd13e('0x4d')]['id']){delete _0x5edb3f['body']['id'];}return db[_0xd13e('0x2f')]['find']({'where':{'id':_0x5edb3f['params']['id']}})['then'](handleEntityNotFound(_0x171d15,null))[_0xd13e('0x27')](saveUpdates(_0x5edb3f['body'],null))['then'](respondWithResult(_0x171d15,null))[_0xd13e('0x55')](handleError(_0x171d15,null));};exports[_0xd13e('0x26')]=function(_0x5f42ea,_0x5cbe43){return db['Dashboard'][_0xd13e('0x4b')]({'where':{'id':_0x5f42ea['params']['id']}})['then'](handleEntityNotFound(_0x5cbe43,null))[_0xd13e('0x27')](removeEntity(_0x5cbe43,null))[_0xd13e('0x55')](handleError(_0x5cbe43,null));};function widgetAttributes(_0x1d6cc4){try{switch(_0x1d6cc4[_0xd13e('0x32')]){case _0xd13e('0x5b'):return[{'name':_0xd13e('0x5c'),'value':_0x1d6cc4['attrUrl']||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x0]?_0x1d6cc4['attrs'][0x0]['value']:undefined)||'https://'}];case _0xd13e('0x5e'):return[{'name':'attrPath','value':_0x1d6cc4[_0xd13e('0x5f')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x0]?_0x1d6cc4[_0xd13e('0x5d')][0x0]['value']:undefined)||''}];case _0xd13e('0x60'):return[{'name':_0xd13e('0x61'),'value':_0x1d6cc4['attrHourFormat']||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4['attrs'][0x0]?_0x1d6cc4[_0xd13e('0x5d')][0x0][_0xd13e('0x62')]:undefined)||_0xd13e('0x63')},{'name':_0xd13e('0x64'),'value':_0x1d6cc4['attrTimezone']||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x1]?_0x1d6cc4[_0xd13e('0x5d')][0x1][_0xd13e('0x62')]:undefined)||'0.00'},{'name':_0xd13e('0x65'),'value':_0x1d6cc4[_0xd13e('0x65')]||(_0x1d6cc4['attrs']&&_0x1d6cc4[_0xd13e('0x5d')][0x2]?_0x1d6cc4[_0xd13e('0x5d')][0x2][_0xd13e('0x62')]:undefined)||0xc}];case _0xd13e('0x66'):return[{'name':_0xd13e('0x67'),'value':_0x1d6cc4[_0xd13e('0x67')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x0]?_0x1d6cc4[_0xd13e('0x5d')][0x0][_0xd13e('0x62')]:undefined)||'total'},{'name':_0xd13e('0x68'),'value':_0x1d6cc4[_0xd13e('0x68')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x1]?_0x1d6cc4['attrs'][0x1][_0xd13e('0x62')]:undefined)||[]},{'name':_0xd13e('0x65'),'value':_0x1d6cc4[_0xd13e('0x65')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x2]?_0x1d6cc4[_0xd13e('0x5d')][0x2]['value']:undefined)||0x14},{'name':_0xd13e('0x69'),'value':_0x1d6cc4[_0xd13e('0x69')]||(_0x1d6cc4['attrs']&&_0x1d6cc4['attrs'][0x3]?_0x1d6cc4['attrs'][0x3]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x1d6cc4[_0xd13e('0x6a')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x4]?_0x1d6cc4['attrs'][0x4]['value']:undefined)||''},{'name':_0xd13e('0x6b'),'value':_0x1d6cc4['attrFaxAccounts']||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x5]?_0x1d6cc4[_0xd13e('0x5d')][0x5][_0xd13e('0x62')]:undefined)||''},{'name':_0xd13e('0x6c'),'value':_0x1d6cc4[_0xd13e('0x6c')]||(_0x1d6cc4['attrs']&&_0x1d6cc4['attrs'][0x6]?_0x1d6cc4[_0xd13e('0x5d')][0x6][_0xd13e('0x62')]:undefined)||''},{'name':_0xd13e('0x6d'),'value':_0x1d6cc4[_0xd13e('0x6d')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x7]?_0x1d6cc4[_0xd13e('0x5d')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1d6cc4[_0xd13e('0x6e')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4['attrs'][0x8]?_0x1d6cc4['attrs'][0x8][_0xd13e('0x62')]:undefined)||''},{'name':_0xd13e('0x6f'),'value':_0x1d6cc4[_0xd13e('0x6f')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x9]?_0x1d6cc4['attrs'][0x9][_0xd13e('0x62')]:undefined)||''}];case _0xd13e('0x70'):case _0xd13e('0x71'):return[{'name':_0xd13e('0x72'),'value':_0x1d6cc4['attrSerie1']||(_0x1d6cc4['attrs']&&_0x1d6cc4[_0xd13e('0x5d')][0x0]?_0x1d6cc4['attrs'][0x0][_0xd13e('0x62')]:undefined)||'total'},{'name':_0xd13e('0x73'),'value':_0x1d6cc4['attrSerie2']||(_0x1d6cc4['attrs']&&_0x1d6cc4[_0xd13e('0x5d')][0x1]?_0x1d6cc4[_0xd13e('0x5d')][0x1]['value']:undefined)||null},{'name':_0xd13e('0x74'),'value':_0x1d6cc4[_0xd13e('0x74')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x2]?_0x1d6cc4[_0xd13e('0x5d')][0x2][_0xd13e('0x62')]:undefined)||null},{'name':_0xd13e('0x68'),'value':_0x1d6cc4['attrVoiceQueues']||(_0x1d6cc4['attrs']&&_0x1d6cc4[_0xd13e('0x5d')][0x3]?_0x1d6cc4['attrs'][0x3][_0xd13e('0x62')]:undefined)||[]},{'name':_0xd13e('0x69'),'value':_0x1d6cc4[_0xd13e('0x69')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x4]?_0x1d6cc4[_0xd13e('0x5d')][0x4][_0xd13e('0x62')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x1d6cc4[_0xd13e('0x6a')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x5]?_0x1d6cc4[_0xd13e('0x5d')][0x5][_0xd13e('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1d6cc4[_0xd13e('0x6b')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x6]?_0x1d6cc4[_0xd13e('0x5d')][0x6][_0xd13e('0x62')]:undefined)||''},{'name':_0xd13e('0x6c'),'value':_0x1d6cc4['attrSmsAccounts']||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x7]?_0x1d6cc4[_0xd13e('0x5d')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1d6cc4[_0xd13e('0x6d')]||(_0x1d6cc4['attrs']&&_0x1d6cc4[_0xd13e('0x5d')][0x8]?_0x1d6cc4['attrs'][0x8][_0xd13e('0x62')]:undefined)||''},{'name':_0xd13e('0x6e'),'value':_0x1d6cc4[_0xd13e('0x6e')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x9]?_0x1d6cc4[_0xd13e('0x5d')][0x9][_0xd13e('0x62')]:undefined)||''},{'name':_0xd13e('0x6f'),'value':_0x1d6cc4[_0xd13e('0x6f')]||(_0x1d6cc4['attrs']&&_0x1d6cc4['attrs'][0xa]?_0x1d6cc4['attrs'][0xa]['value']:undefined)||''}];case _0xd13e('0x75'):return[{'name':_0xd13e('0x76'),'type':_0x1d6cc4[_0xd13e('0x77')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4['attrs'][0x0]?_0x1d6cc4[_0xd13e('0x5d')][0x0][_0xd13e('0x32')]:undefined)||null,'value':_0x1d6cc4[_0xd13e('0x76')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x0]?_0x1d6cc4[_0xd13e('0x5d')][0x0][_0xd13e('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0x1d6cc4[_0xd13e('0x78')]||(_0x1d6cc4[_0xd13e('0x5d')]&&_0x1d6cc4[_0xd13e('0x5d')][0x1]?_0x1d6cc4[_0xd13e('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2a7e76){logger[_0xd13e('0x2c')]('widgetAttributes:\x20%s',JSON[_0xd13e('0x79')](_0x2a7e76));return[];}}exports['addItem']=function(_0x2630dc,_0x1061ab,_0x4782be){if(_0x2630dc['body']['id']){delete _0x2630dc['body']['id'];}return db[_0xd13e('0x2f')][_0xd13e('0x4b')]({'where':{'id':_0x2630dc[_0xd13e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1061ab,null))[_0xd13e('0x27')](function(_0x16c393){if(_0x16c393){_0x2630dc[_0xd13e('0x4d')][_0xd13e('0x7a')]=_0x16c393['id'];_0x2630dc[_0xd13e('0x4d')][_0xd13e('0x5d')]=widgetAttributes(_0x2630dc[_0xd13e('0x4d')]);return db[_0xd13e('0x7b')][_0xd13e('0x4c')](_0x2630dc[_0xd13e('0x4d')]);}})[_0xd13e('0x27')](respondWithResult(_0x1061ab,null))[_0xd13e('0x55')](handleError(_0x1061ab,null));};exports['getItems']=function(_0x3d744c,_0x59ac93,_0x2d6df6){var _0x5183e7={};var _0x1a2caf={};var _0x1577de;var _0x272110;return db[_0xd13e('0x2f')]['findOne']({'where':{'id':_0x3d744c['params']['id']}})[_0xd13e('0x27')](handleEntityNotFound(_0x59ac93,null))['then'](function(_0x19e47e){if(_0x19e47e){_0x1577de=_0x19e47e;_0x1a2caf['model']=_['keys'](db['DashboardItem']['rawAttributes']);_0x1a2caf['query']=_[_0xd13e('0x37')](_0x3d744c[_0xd13e('0x36')]);_0x1a2caf[_0xd13e('0x38')]=_['intersection'](_0x1a2caf['model'],_0x1a2caf[_0xd13e('0x36')]);_0x5183e7[_0xd13e('0x3a')]=_[_0xd13e('0x39')](_0x1a2caf['model'],qs['fields'](_0x3d744c[_0xd13e('0x36')][_0xd13e('0x3b')]));_0x5183e7[_0xd13e('0x3a')]=_0x5183e7['attributes'][_0xd13e('0x3c')]?_0x5183e7[_0xd13e('0x3a')]:_0x1a2caf[_0xd13e('0x34')];_0x5183e7['order']=qs[_0xd13e('0x3f')](_0x3d744c[_0xd13e('0x36')][_0xd13e('0x3f')]);_0x5183e7[_0xd13e('0x43')]=qs[_0xd13e('0x38')](_['pick'](_0x3d744c[_0xd13e('0x36')],_0x1a2caf['filters']));if(_0x3d744c['query'][_0xd13e('0x41')]){_0x5183e7[_0xd13e('0x43')]=_[_0xd13e('0x42')](_0x5183e7[_0xd13e('0x43')],{'$or':_[_0xd13e('0x35')](_0x5183e7[_0xd13e('0x3a')],function(_0x4ab22a){var _0x95d5ca={};_0x95d5ca[_0x4ab22a]={'$like':'%'+_0x3d744c['query'][_0xd13e('0x41')]+'%'};return _0x95d5ca;})});}_0x5183e7=_[_0xd13e('0x42')]({},_0x5183e7,_0x3d744c[_0xd13e('0x45')]);return _0x1577de['getItems'](_0x5183e7);}})[_0xd13e('0x27')](function(_0x3208fb){if(_0x3208fb){_0x272110=_0x3208fb[_0xd13e('0x3c')];if(!_0x3d744c[_0xd13e('0x36')][_0xd13e('0x7c')](_0xd13e('0x3d'))){_0x5183e7[_0xd13e('0x1e')]=qs[_0xd13e('0x1e')](_0x3d744c['query'][_0xd13e('0x1e')]);_0x5183e7['offset']=qs[_0xd13e('0x20')](_0x3d744c['query'][_0xd13e('0x20')]);}return _0x1577de[_0xd13e('0x7d')](_0x5183e7);}})[_0xd13e('0x27')](function(_0x37b4e0){if(_0x37b4e0){return _0x37b4e0?{'count':_0x272110,'rows':_0x37b4e0}:null;}})['then'](respondWithResult(_0x59ac93,null))[_0xd13e('0x55')](handleError(_0x59ac93,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index cf8bb86..bfc9c08 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 _0x0f3d=['../../mysqldb','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0xa7aeb3,_0x26af96){var _0x213f51=function(_0x277ea1){while(--_0x277ea1){_0xa7aeb3['push'](_0xa7aeb3['shift']());}};_0x213f51(++_0x26af96);}(_0x0f3d,0x160));var _0xd0f3=function(_0x48cec3,_0xcd5bb){_0x48cec3=_0x48cec3-0x0;var _0x59a099=_0x0f3d[_0x48cec3];return _0x59a099;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xd0f3('0x0'))['db'][_0xd0f3('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd0f3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd0f3('0x3'),'afterDestroy':_0xd0f3('0x4')};function emitEvent(_0x275441){return function(_0x26cddb,_0x4a2a3c,_0x53cca1){DashboardEvents[_0xd0f3('0x5')](_0x275441+':'+_0x26cddb['id'],_0x26cddb);DashboardEvents[_0xd0f3('0x5')](_0x275441,_0x26cddb);_0x53cca1(null);};}for(var e in events){if(events[_0xd0f3('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xd0f3('0x7')]=DashboardEvents; \ No newline at end of file +var _0xd1d8=['emit','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xd1d8,0x1e3));var _0x8d1d=function(_0x454bd3,_0x3e4d94){_0x454bd3=_0x454bd3-0x0;var _0x4eb066=_0xd1d8[_0x454bd3];return _0x4eb066;};'use strict';var EventEmitter=require(_0x8d1d('0x0'));var Dashboard=require(_0x8d1d('0x1'))['db'][_0x8d1d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8d1d('0x3')](0x0);var events={'afterCreate':_0x8d1d('0x4'),'afterUpdate':_0x8d1d('0x5'),'afterDestroy':_0x8d1d('0x6')};function emitEvent(_0x3b974f){return function(_0x35b6d8,_0x498f5c,_0x23bfb6){DashboardEvents[_0x8d1d('0x7')](_0x3b974f+':'+_0x35b6d8['id'],_0x35b6d8);DashboardEvents[_0x8d1d('0x7')](_0x3b974f,_0x35b6d8);_0x23bfb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8d1d('0x8')](e,emitEvent(event));}}module[_0x8d1d('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index be9fdc8..12396a0 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 _0x97a2=['exports','define','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x37f2f9,_0x662e94){var _0x1b3e97=function(_0x2a1ac3){while(--_0x2a1ac3){_0x37f2f9['push'](_0x37f2f9['shift']());}};_0x1b3e97(++_0x662e94);}(_0x97a2,0x1b1));var _0x297a=function(_0x586093,_0x34289f){_0x586093=_0x586093-0x0;var _0x2eca6f=_0x97a2[_0x586093];return _0x2eca6f;};'use strict';var _=require(_0x297a('0x0'));var util=require('util');var logger=require(_0x297a('0x1'))(_0x297a('0x2'));var moment=require(_0x297a('0x3'));var BPromise=require(_0x297a('0x4'));var rp=require(_0x297a('0x5'));var fs=require('fs');var path=require(_0x297a('0x6'));var rimraf=require(_0x297a('0x7'));var config=require(_0x297a('0x8'));var attributes=require('./dashboard.attributes');module[_0x297a('0x9')]=function(_0x2a420b,_0x2c1f41){return _0x2a420b[_0x297a('0xa')](_0x297a('0xb'),attributes,{'tableName':_0x297a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbc=['dashboards','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0xfdbc,0x153));var _0xcfdb=function(_0x680c44,_0x554c90){_0x680c44=_0x680c44-0x0;var _0x214396=_0xfdbc[_0x680c44];return _0x214396;};'use strict';var _=require(_0xcfdb('0x0'));var util=require(_0xcfdb('0x1'));var logger=require(_0xcfdb('0x2'))(_0xcfdb('0x3'));var moment=require('moment');var BPromise=require(_0xcfdb('0x4'));var rp=require(_0xcfdb('0x5'));var fs=require('fs');var path=require(_0xcfdb('0x6'));var rimraf=require(_0xcfdb('0x7'));var config=require(_0xcfdb('0x8'));var attributes=require(_0xcfdb('0x9'));module['exports']=function(_0x39e904,_0x22b381){return _0x39e904[_0xcfdb('0xa')](_0xcfdb('0xb'),attributes,{'tableName':_0xcfdb('0xc'),'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 f99b0db..40fc08e 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 _0x03d3=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','util','moment','ioredis','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then'];(function(_0x14747e,_0x107c55){var _0xce1252=function(_0x49de7b){while(--_0x49de7b){_0x14747e['push'](_0x14747e['shift']());}};_0xce1252(++_0x107c55);}(_0x03d3,0x6e));var _0x303d=function(_0x14a97a,_0x39b146){_0x14a97a=_0x14a97a-0x0;var _0x23e5e5=_0x03d3[_0x14a97a];return _0x23e5e5;};'use strict';var _=require('lodash');var util=require(_0x303d('0x0'));var moment=require(_0x303d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x303d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x303d('0x3'));var logger=require('../../config/logger')(_0x303d('0x4'));var config=require(_0x303d('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x303d('0x6')]({'port':0x232a});config[_0x303d('0x7')]=_[_0x303d('0x8')](config[_0x303d('0x7')],{'host':_0x303d('0x9'),'port':0x18eb});var socket=require(_0x303d('0xa'))(new Redis(config[_0x303d('0x7')]));require(_0x303d('0xb'))[_0x303d('0xc')](socket);function respondWithRpcPromise(_0x336e1d,_0x4371ac,_0xf16b9){return new BPromise(function(_0x4bfecb,_0x156f6a){return client[_0x303d('0xd')](_0x336e1d,_0xf16b9)[_0x303d('0xe')](function(_0x204624){logger[_0x303d('0xf')](_0x303d('0x10'),_0x4371ac,_0x303d('0x11'));logger[_0x303d('0x12')](_0x303d('0x13'),_0x4371ac,_0x303d('0x11'),JSON[_0x303d('0x14')](_0x204624));if(_0x204624['error']){if(_0x204624['error'][_0x303d('0x15')]===0x1f4){logger[_0x303d('0x16')](_0x303d('0x10'),_0x4371ac,_0x204624[_0x303d('0x16')][_0x303d('0x17')]);return _0x156f6a(_0x204624[_0x303d('0x16')][_0x303d('0x17')]);}logger[_0x303d('0x16')]('Dashboard,\x20%s,\x20%s',_0x4371ac,_0x204624[_0x303d('0x16')][_0x303d('0x17')]);return _0x4bfecb(_0x204624['error'][_0x303d('0x17')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x4371ac,_0x303d('0x11'));_0x4bfecb(_0x204624['result']['message']);}})[_0x303d('0x18')](function(_0x1dcbd8){logger[_0x303d('0x16')](_0x303d('0x10'),_0x4371ac,_0x1dcbd8);_0x156f6a(_0x1dcbd8);});});} \ No newline at end of file +var _0xa91a=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0xa91a,0x111));var _0xaa91=function(_0x5146eb,_0x332eee){_0x5146eb=_0x5146eb-0x0;var _0xcac9e0=_0xa91a[_0x5146eb];return _0xcac9e0;};'use strict';var _=require('lodash');var util=require(_0xaa91('0x0'));var moment=require(_0xaa91('0x1'));var BPromise=require(_0xaa91('0x2'));var rs=require(_0xaa91('0x3'));var fs=require('fs');var Redis=require(_0xaa91('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa91('0x5'));var logger=require(_0xaa91('0x6'))(_0xaa91('0x7'));var config=require(_0xaa91('0x8'));var jayson=require(_0xaa91('0x9'));var client=jayson[_0xaa91('0xa')][_0xaa91('0xb')]({'port':0x232a});config['redis']=_[_0xaa91('0xc')](config['redis'],{'host':_0xaa91('0xd'),'port':0x18eb});var socket=require(_0xaa91('0xe'))(new Redis(config[_0xaa91('0xf')]));require(_0xaa91('0x10'))[_0xaa91('0x11')](socket);function respondWithRpcPromise(_0x3acfea,_0x5386d0,_0x406afc){return new BPromise(function(_0x5c5701,_0xec62cf){return client[_0xaa91('0x12')](_0x3acfea,_0x406afc)[_0xaa91('0x13')](function(_0x582349){logger[_0xaa91('0x14')](_0xaa91('0x15'),_0x5386d0,'request\x20sent');logger[_0xaa91('0x16')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5386d0,_0xaa91('0x17'),JSON[_0xaa91('0x18')](_0x582349));if(_0x582349[_0xaa91('0x19')]){if(_0x582349[_0xaa91('0x19')][_0xaa91('0x1a')]===0x1f4){logger[_0xaa91('0x19')](_0xaa91('0x15'),_0x5386d0,_0x582349[_0xaa91('0x19')]['message']);return _0xec62cf(_0x582349[_0xaa91('0x19')]['message']);}logger[_0xaa91('0x19')](_0xaa91('0x15'),_0x5386d0,_0x582349[_0xaa91('0x19')][_0xaa91('0x1b')]);return _0x5c5701(_0x582349[_0xaa91('0x19')][_0xaa91('0x1b')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x5386d0,_0xaa91('0x17'));_0x5c5701(_0x582349[_0xaa91('0x1c')][_0xaa91('0x1b')]);}})[_0xaa91('0x1d')](function(_0x2a2b6d){logger[_0xaa91('0x19')](_0xaa91('0x15'),_0x5386d0,_0x2a2b6d);_0xec62cf(_0x2a2b6d);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index da05311..911b130 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 _0x2c9f=['dashboard:','./dashboard.events','remove','update','emit','removeListener','register','length'];(function(_0x5d3222,_0x3f7153){var _0xe0b6a2=function(_0x31e41e){while(--_0x31e41e){_0x5d3222['push'](_0x5d3222['shift']());}};_0xe0b6a2(++_0x3f7153);}(_0x2c9f,0x199));var _0xf2c9=function(_0x4c4b26,_0x29cb50){_0x4c4b26=_0x4c4b26-0x0;var _0x283191=_0x2c9f[_0x4c4b26];return _0x283191;};'use strict';var DashboardEvents=require(_0xf2c9('0x0'));var events=['save',_0xf2c9('0x1'),_0xf2c9('0x2')];function createListener(_0x26d2a2,_0x60898b){return function(_0x1eded4){_0x60898b[_0xf2c9('0x3')](_0x26d2a2,_0x1eded4);};}function removeListener(_0xd440e4,_0x36bf4e){return function(){DashboardEvents[_0xf2c9('0x4')](_0xd440e4,_0x36bf4e);};}exports[_0xf2c9('0x5')]=function(_0x42920a){for(var _0x4d765b=0x0,_0x56d34c=events[_0xf2c9('0x6')];_0x4d765b<_0x56d34c;_0x4d765b++){var _0x313474=events[_0x4d765b];var _0x17b2a1=createListener(_0xf2c9('0x7')+_0x313474,_0x42920a);DashboardEvents['on'](_0x313474,_0x17b2a1);}}; \ No newline at end of file +var _0xfcbc=['dashboard:','save','update','emit','register','length'];(function(_0x52fc79,_0x16f421){var _0x11db56=function(_0x33c7a3){while(--_0x33c7a3){_0x52fc79['push'](_0x52fc79['shift']());}};_0x11db56(++_0x16f421);}(_0xfcbc,0xeb));var _0xcfcb=function(_0x15f724,_0x2794ef){_0x15f724=_0x15f724-0x0;var _0x49b152=_0xfcbc[_0x15f724];return _0x49b152;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xcfcb('0x0'),'remove',_0xcfcb('0x1')];function createListener(_0x35c1ed,_0x40f048){return function(_0x226fe5){_0x40f048[_0xcfcb('0x2')](_0x35c1ed,_0x226fe5);};}function removeListener(_0x11e81f,_0x565c3e){return function(){DashboardEvents['removeListener'](_0x11e81f,_0x565c3e);};}exports[_0xcfcb('0x3')]=function(_0x5e8ea){for(var _0x14ccee=0x0,_0x4bc560=events[_0xcfcb('0x4')];_0x14ccee<_0x4bc560;_0x14ccee++){var _0x2ac608=events[_0x14ccee];var _0x269141=createListener(_0xcfcb('0x5')+_0x2ac608,_0x5e8ea);DashboardEvents['on'](_0x2ac608,_0x269141);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 88e788a..5609876 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 _0x4a12=['clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone'];(function(_0x5d2df6,_0x321cbe){var _0x3ea033=function(_0xfb1217){while(--_0xfb1217){_0x5d2df6['push'](_0x5d2df6['shift']());}};_0x3ea033(++_0x321cbe);}(_0x4a12,0x1b7));var _0x24a1=function(_0x426706,_0x5a7138){_0x426706=_0x426706-0x0;var _0x2288d1=_0x4a12[_0x426706];return _0x2288d1;};'use strict';var multer=require(_0x24a1('0x0'));var util=require(_0x24a1('0x1'));var path=require(_0x24a1('0x2'));var timeout=require(_0x24a1('0x3'));var express=require('express');var router=express[_0x24a1('0x4')]();var fs_extra=require(_0x24a1('0x5'));var auth=require(_0x24a1('0x6'));var interaction=require(_0x24a1('0x7'));var config=require(_0x24a1('0x8'));var controller=require(_0x24a1('0x9'));router[_0x24a1('0xa')]('/',auth[_0x24a1('0xb')](),controller[_0x24a1('0xc')]);router['get'](_0x24a1('0xd'),auth[_0x24a1('0xb')](),controller[_0x24a1('0xe')]);router[_0x24a1('0xa')](_0x24a1('0xf'),auth[_0x24a1('0xb')](),controller[_0x24a1('0x10')]);router['post']('/',auth[_0x24a1('0xb')](),controller[_0x24a1('0x11')]);router[_0x24a1('0x12')](_0x24a1('0x13'),auth[_0x24a1('0xb')](),controller[_0x24a1('0x14')]);router[_0x24a1('0x12')](_0x24a1('0xf'),auth[_0x24a1('0xb')](),controller[_0x24a1('0x15')]);router[_0x24a1('0x16')](_0x24a1('0xd'),auth[_0x24a1('0xb')](),controller[_0x24a1('0x17')]);router[_0x24a1('0x18')]('/:id',auth[_0x24a1('0xb')](),controller[_0x24a1('0x19')]);module[_0x24a1('0x1a')]=router; \ No newline at end of file +var _0x7586=['clone','addItem','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','create'];(function(_0x3e7a33,_0xc77695){var _0x25a05b=function(_0x2ed5c8){while(--_0x2ed5c8){_0x3e7a33['push'](_0x3e7a33['shift']());}};_0x25a05b(++_0xc77695);}(_0x7586,0x18d));var _0x6758=function(_0x27227e,_0x38898c){_0x27227e=_0x27227e-0x0;var _0x54f517=_0x7586[_0x27227e];return _0x54f517;};'use strict';var multer=require(_0x6758('0x0'));var util=require(_0x6758('0x1'));var path=require(_0x6758('0x2'));var timeout=require('connect-timeout');var express=require(_0x6758('0x3'));var router=express[_0x6758('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6758('0x5'));var interaction=require(_0x6758('0x6'));var config=require('../../config/environment');var controller=require(_0x6758('0x7'));router[_0x6758('0x8')]('/',auth['isAuthenticated'](),controller[_0x6758('0x9')]);router['get'](_0x6758('0xa'),auth[_0x6758('0xb')](),controller[_0x6758('0xc')]);router[_0x6758('0x8')](_0x6758('0xd'),auth[_0x6758('0xb')](),controller[_0x6758('0xe')]);router[_0x6758('0xf')]('/',auth[_0x6758('0xb')](),controller[_0x6758('0x10')]);router['post']('/:id/clone',auth[_0x6758('0xb')](),controller[_0x6758('0x11')]);router[_0x6758('0xf')](_0x6758('0xd'),auth['isAuthenticated'](),controller[_0x6758('0x12')]);router[_0x6758('0x13')](_0x6758('0xa'),auth[_0x6758('0xb')](),controller[_0x6758('0x14')]);router['delete'](_0x6758('0xa'),auth[_0x6758('0xb')](),controller[_0x6758('0x15')]);module[_0x6758('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index b526bb5..e8e5331 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 _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x1a5864,_0x2de182){var _0x3fa3bb=function(_0x95b5d0){while(--_0x95b5d0){_0x1a5864['push'](_0x1a5864['shift']());}};_0x3fa3bb(++_0x2de182);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4814f6,_0x419f64){_0x4814f6=_0x4814f6-0x0;var _0x18cb5f=_0xc1c6[_0x4814f6];return _0x18cb5f;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xbd51=['setDataValue','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','attrs','stringify'];(function(_0x16d263,_0x42d6ea){var _0x50cc18=function(_0x1e999e){while(--_0x1e999e){_0x16d263['push'](_0x16d263['shift']());}};_0x50cc18(++_0x42d6ea);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x4ee1a1,_0x4bb2b8){_0x4ee1a1=_0x4ee1a1-0x0;var _0x54175e=_0xbd51[_0x4ee1a1];return _0x54175e;};'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 750f2a4..4c348c7 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 _0xc838=['to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','type','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xc838,0xbd));var _0x8c83=function(_0x1d43d6,_0x4d2998){_0x1d43d6=_0x1d43d6-0x0;var _0x5451e2=_0xc838[_0x1d43d6];return _0x5451e2;};'use strict';var emlformat=require(_0x8c83('0x0'));var rimraf=require(_0x8c83('0x1'));var zipdir=require(_0x8c83('0x2'));var jsonpatch=require(_0x8c83('0x3'));var rp=require(_0x8c83('0x4'));var moment=require(_0x8c83('0x5'));var BPromise=require(_0x8c83('0x6'));var Mustache=require(_0x8c83('0x7'));var util=require(_0x8c83('0x8'));var path=require(_0x8c83('0x9'));var sox=require(_0x8c83('0xa'));var csv=require(_0x8c83('0xb'));var ejs=require(_0x8c83('0xc'));var fs=require('fs');var fs_extra=require(_0x8c83('0xd'));var _=require(_0x8c83('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8c83('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8c83('0xb'));var querystring=require(_0x8c83('0x10'));var Papa=require(_0x8c83('0x11'));var Redis=require(_0x8c83('0x12'));var authService=require(_0x8c83('0x13'));var qs=require(_0x8c83('0x14'));var as=require(_0x8c83('0x15'));var hardwareService=require(_0x8c83('0x16'));var logger=require(_0x8c83('0x17'))(_0x8c83('0x18'));var utils=require(_0x8c83('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8c83('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8c83('0x1b')](config['redis'],{'host':_0x8c83('0x1c'),'port':0x18eb});var socket=require(_0x8c83('0x1d'))(new Redis(config[_0x8c83('0x1e')]));require(_0x8c83('0x1f'))[_0x8c83('0x20')](socket);function respondWithStatusCode(_0x1aaac5,_0x325468){_0x325468=_0x325468||0xcc;return function(_0x295c28){if(_0x295c28){return _0x1aaac5[_0x8c83('0x21')](_0x325468);}return _0x1aaac5[_0x8c83('0x22')](_0x325468)['end']();};}function respondWithResult(_0x2b4027,_0x3d82ca){_0x3d82ca=_0x3d82ca||0xc8;return function(_0x52d916){if(_0x52d916){return _0x2b4027['status'](_0x3d82ca)[_0x8c83('0x23')](_0x52d916);}};}function respondWithFilteredResult(_0x4e3da8,_0x3eada5){return function(_0x535962){if(_0x535962){var _0x47d076=typeof _0x3eada5[_0x8c83('0x24')]==='undefined'&&typeof _0x3eada5[_0x8c83('0x25')]===_0x8c83('0x26');var _0x505c0c=_0x535962['count'];var _0x406faf=_0x47d076?0x0:_0x3eada5[_0x8c83('0x24')];var _0x5f51f8=_0x47d076?_0x535962[_0x8c83('0x27')]:_0x3eada5[_0x8c83('0x24')]+_0x3eada5['limit'];var _0x34825d;if(_0x5f51f8>=_0x505c0c){_0x5f51f8=_0x505c0c;_0x34825d=0xc8;}else{_0x34825d=0xce;}_0x4e3da8['status'](_0x34825d);return _0x4e3da8[_0x8c83('0x28')](_0x8c83('0x29'),_0x406faf+'-'+_0x5f51f8+'/'+_0x505c0c)[_0x8c83('0x23')](_0x535962);}return null;};}function patchUpdates(_0xf7b089){return function(_0x9e56){try{jsonpatch['apply'](_0x9e56,_0xf7b089,!![]);}catch(_0x4faecd){return BPromise[_0x8c83('0x2a')](_0x4faecd);}return _0x9e56[_0x8c83('0x2b')]();};}function saveUpdates(_0x59e6f9,_0x583a89){return function(_0x42b1ad){if(_0x42b1ad){return _0x42b1ad[_0x8c83('0x2c')](_0x59e6f9)[_0x8c83('0x2d')](function(_0x5034e1){return _0x5034e1;});}return null;};}function removeEntity(_0x1bd922,_0x4f7088){return function(_0x7fb65e){if(_0x7fb65e){return _0x7fb65e[_0x8c83('0x2e')]()[_0x8c83('0x2d')](function(){_0x1bd922[_0x8c83('0x22')](0xcc)[_0x8c83('0x2f')]();});}};}function handleEntityNotFound(_0x5445b9,_0x4d8ff8){return function(_0x4d728e){if(!_0x4d728e){_0x5445b9[_0x8c83('0x21')](0x194);}return _0x4d728e;};}function handleError(_0x14c964,_0x54aab9){_0x54aab9=_0x54aab9||0x1f4;return function(_0x106f71){logger[_0x8c83('0x30')](_0x106f71[_0x8c83('0x31')]);if(_0x106f71['name']){delete _0x106f71['name'];}_0x14c964[_0x8c83('0x22')](_0x54aab9)['send'](_0x106f71);};}exports[_0x8c83('0x32')]=function(_0x126a65,_0x290af8){var _0x178056={'raw':![],'where':{'id':_0x126a65[_0x8c83('0x33')]['id']}},_0x232ce4={};_0x232ce4['model']=_[_0x8c83('0x34')](db[_0x8c83('0x35')][_0x8c83('0x36')]);_0x232ce4[_0x8c83('0x37')]=_[_0x8c83('0x34')](_0x126a65[_0x8c83('0x37')]);_0x232ce4[_0x8c83('0x38')]=_[_0x8c83('0x39')](_0x232ce4[_0x8c83('0x3a')],_0x232ce4[_0x8c83('0x37')]);_0x178056['attributes']=_[_0x8c83('0x39')](_0x232ce4[_0x8c83('0x3a')],qs[_0x8c83('0x3b')](_0x126a65['query'][_0x8c83('0x3b')]));_0x178056[_0x8c83('0x3c')]=_0x178056['attributes'][_0x8c83('0x3d')]?_0x178056[_0x8c83('0x3c')]:_0x232ce4[_0x8c83('0x3a')];if(_0x126a65[_0x8c83('0x37')][_0x8c83('0x3e')]){_0x178056[_0x8c83('0x3f')]=[{'all':!![]}];}_0x178056=_[_0x8c83('0x40')]({},_0x178056,_0x126a65[_0x8c83('0x41')]);return db[_0x8c83('0x35')][_0x8c83('0x42')](_0x178056)[_0x8c83('0x2d')](handleEntityNotFound(_0x290af8,null))[_0x8c83('0x2d')](respondWithResult(_0x290af8,null))['catch'](handleError(_0x290af8,null));};exports['destroy']=function(_0x196650,_0x36653a){return db[_0x8c83('0x35')][_0x8c83('0x42')]({'where':{'id':_0x196650[_0x8c83('0x33')]['id']}})['then'](handleEntityNotFound(_0x36653a,null))['then'](removeEntity(_0x36653a,null))[_0x8c83('0x43')](handleError(_0x36653a,null));};function widgetAttributes(_0x4347d6){try{switch(_0x4347d6[_0x8c83('0x44')]){case'iframe':return[{'name':'attrUrl','value':_0x4347d6['attrUrl']||(_0x4347d6['attrs']&&_0x4347d6[_0x8c83('0x45')][0x0]?_0x4347d6[_0x8c83('0x45')][0x0][_0x8c83('0x46')]:undefined)||_0x8c83('0x47')}];case _0x8c83('0x48'):return[{'name':_0x8c83('0x49'),'value':_0x4347d6[_0x8c83('0x49')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6['attrs'][0x0]?_0x4347d6['attrs'][0x0][_0x8c83('0x46')]:undefined)||''}];case _0x8c83('0x4a'):return[{'name':_0x8c83('0x4b'),'value':_0x4347d6['attrHourFormat']||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6['attrs'][0x0]?_0x4347d6[_0x8c83('0x45')][0x0][_0x8c83('0x46')]:undefined)||'HH:mm:ss'},{'name':_0x8c83('0x4c'),'value':_0x4347d6['attrTimezone']||(_0x4347d6['attrs']&&_0x4347d6['attrs'][0x1]?_0x4347d6[_0x8c83('0x45')][0x1][_0x8c83('0x46')]:undefined)||_0x8c83('0x4d')},{'name':_0x8c83('0x4e'),'value':_0x4347d6[_0x8c83('0x4e')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x2]?_0x4347d6['attrs'][0x2]['value']:undefined)||0xc}];case _0x8c83('0x4f'):return[{'name':_0x8c83('0x50'),'value':_0x4347d6[_0x8c83('0x50')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x0]?_0x4347d6[_0x8c83('0x45')][0x0][_0x8c83('0x46')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x4347d6[_0x8c83('0x51')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x1]?_0x4347d6[_0x8c83('0x45')][0x1][_0x8c83('0x46')]:undefined)||[]},{'name':_0x8c83('0x4e'),'value':_0x4347d6[_0x8c83('0x4e')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x2]?_0x4347d6[_0x8c83('0x45')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x4347d6[_0x8c83('0x52')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x3]?_0x4347d6['attrs'][0x3][_0x8c83('0x46')]:undefined)||_0x8c83('0x53')},{'name':_0x8c83('0x54'),'value':_0x4347d6['attrEmailAccounts']||(_0x4347d6['attrs']&&_0x4347d6['attrs'][0x4]?_0x4347d6[_0x8c83('0x45')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x4347d6[_0x8c83('0x55')]||(_0x4347d6['attrs']&&_0x4347d6[_0x8c83('0x45')][0x5]?_0x4347d6[_0x8c83('0x45')][0x5][_0x8c83('0x46')]:undefined)||''},{'name':_0x8c83('0x56'),'value':_0x4347d6['attrSmsAccounts']||(_0x4347d6['attrs']&&_0x4347d6[_0x8c83('0x45')][0x6]?_0x4347d6[_0x8c83('0x45')][0x6][_0x8c83('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4347d6[_0x8c83('0x57')]||(_0x4347d6['attrs']&&_0x4347d6[_0x8c83('0x45')][0x7]?_0x4347d6[_0x8c83('0x45')][0x7][_0x8c83('0x46')]:undefined)||''},{'name':_0x8c83('0x58'),'value':_0x4347d6['attrWhatsappAccounts']||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6['attrs'][0x8]?_0x4347d6['attrs'][0x8][_0x8c83('0x46')]:undefined)||''},{'name':_0x8c83('0x59'),'value':_0x4347d6[_0x8c83('0x59')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6['attrs'][0x9]?_0x4347d6[_0x8c83('0x45')][0x9][_0x8c83('0x46')]:undefined)||''}];case _0x8c83('0x5a'):case _0x8c83('0x5b'):return[{'name':_0x8c83('0x5c'),'value':_0x4347d6[_0x8c83('0x5c')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x0]?_0x4347d6['attrs'][0x0][_0x8c83('0x46')]:undefined)||'total'},{'name':_0x8c83('0x5d'),'value':_0x4347d6[_0x8c83('0x5d')]||(_0x4347d6['attrs']&&_0x4347d6['attrs'][0x1]?_0x4347d6[_0x8c83('0x45')][0x1][_0x8c83('0x46')]:undefined)||null},{'name':'attrSerie3','value':_0x4347d6['attrSerie3']||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x2]?_0x4347d6['attrs'][0x2][_0x8c83('0x46')]:undefined)||null},{'name':_0x8c83('0x51'),'value':_0x4347d6[_0x8c83('0x51')]||(_0x4347d6['attrs']&&_0x4347d6[_0x8c83('0x45')][0x3]?_0x4347d6[_0x8c83('0x45')][0x3][_0x8c83('0x46')]:undefined)||[]},{'name':'attrChannel','value':_0x4347d6[_0x8c83('0x52')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x4]?_0x4347d6[_0x8c83('0x45')][0x4][_0x8c83('0x46')]:undefined)||_0x8c83('0x53')},{'name':'attrEmailAccounts','value':_0x4347d6['attrEmailAccounts']||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x5]?_0x4347d6[_0x8c83('0x45')][0x5][_0x8c83('0x46')]:undefined)||''},{'name':_0x8c83('0x55'),'value':_0x4347d6[_0x8c83('0x55')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x6]?_0x4347d6[_0x8c83('0x45')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x4347d6[_0x8c83('0x56')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x7]?_0x4347d6[_0x8c83('0x45')][0x7][_0x8c83('0x46')]:undefined)||''},{'name':_0x8c83('0x57'),'value':_0x4347d6[_0x8c83('0x57')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x8]?_0x4347d6[_0x8c83('0x45')][0x8]['value']:undefined)||''},{'name':_0x8c83('0x58'),'value':_0x4347d6[_0x8c83('0x58')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0x9]?_0x4347d6[_0x8c83('0x45')][0x9][_0x8c83('0x46')]:undefined)||''},{'name':_0x8c83('0x59'),'value':_0x4347d6[_0x8c83('0x59')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6[_0x8c83('0x45')][0xa]?_0x4347d6['attrs'][0xa][_0x8c83('0x46')]:undefined)||''}];case'web-report':return[{'name':_0x8c83('0x5e'),'type':_0x4347d6[_0x8c83('0x5f')]||(_0x4347d6[_0x8c83('0x45')]&&_0x4347d6['attrs'][0x0]?_0x4347d6[_0x8c83('0x45')][0x0][_0x8c83('0x44')]:undefined)||null,'value':_0x4347d6['attrReport']||(_0x4347d6['attrs']&&_0x4347d6['attrs'][0x0]?_0x4347d6[_0x8c83('0x45')][0x0]['value']:undefined)||null},{'name':_0x8c83('0x60'),'value':_0x4347d6[_0x8c83('0x60')]||(_0x4347d6['attrs']&&_0x4347d6['attrs'][0x1]?_0x4347d6['attrs'][0x1][_0x8c83('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x1d3ada){logger['error']('widgetAttributes:\x20%s',JSON[_0x8c83('0x61')](_0x1d3ada));return[];}}exports[_0x8c83('0x62')]=function(_0x4b25b7,_0x3e1008){if(_0x4b25b7[_0x8c83('0x63')]){_0x4b25b7[_0x8c83('0x63')]['attrs']=widgetAttributes(_0x4b25b7[_0x8c83('0x63')]);}return db[_0x8c83('0x35')][_0x8c83('0x62')](_0x4b25b7['body'],{})[_0x8c83('0x2d')](respondWithResult(_0x3e1008,0xc9))['catch'](handleError(_0x3e1008,null));};exports[_0x8c83('0x2c')]=function(_0xee286,_0x2e4237){if(_0xee286[_0x8c83('0x63')]['id']){delete _0xee286['body']['id'];}_0xee286['body'][_0x8c83('0x45')]=widgetAttributes(_0xee286[_0x8c83('0x63')]);return db[_0x8c83('0x35')]['find']({'where':{'id':_0xee286[_0x8c83('0x33')]['id']}})['then'](handleEntityNotFound(_0x2e4237,null))[_0x8c83('0x2d')](saveUpdates(_0xee286[_0x8c83('0x63')],null))[_0x8c83('0x2d')](respondWithResult(_0x2e4237,null))[_0x8c83('0x43')](handleError(_0x2e4237,null));}; \ No newline at end of file +var _0xa992=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','stack','name','send','show','model','keys','DashboardItem','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrOpenchannelAccounts','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x90ec08,_0x46b5d5){var _0x52409e=function(_0xaa9b6b){while(--_0xaa9b6b){_0x90ec08['push'](_0x90ec08['shift']());}};_0x52409e(++_0x46b5d5);}(_0xa992,0x18c));var _0x2a99=function(_0x2754cd,_0xaf73dd){_0x2754cd=_0x2754cd-0x0;var _0x71b5a4=_0xa992[_0x2754cd];return _0x71b5a4;};'use strict';var emlformat=require(_0x2a99('0x0'));var rimraf=require(_0x2a99('0x1'));var zipdir=require(_0x2a99('0x2'));var jsonpatch=require(_0x2a99('0x3'));var rp=require('request-promise');var moment=require(_0x2a99('0x4'));var BPromise=require(_0x2a99('0x5'));var Mustache=require(_0x2a99('0x6'));var util=require(_0x2a99('0x7'));var path=require(_0x2a99('0x8'));var sox=require(_0x2a99('0x9'));var csv=require(_0x2a99('0xa'));var ejs=require(_0x2a99('0xb'));var fs=require('fs');var fs_extra=require(_0x2a99('0xc'));var _=require(_0x2a99('0xd'));var squel=require('squel');var crypto=require(_0x2a99('0xe'));var jsforce=require(_0x2a99('0xf'));var deskjs=require(_0x2a99('0x10'));var toCsv=require(_0x2a99('0xa'));var querystring=require(_0x2a99('0x11'));var Papa=require(_0x2a99('0x12'));var Redis=require(_0x2a99('0x13'));var authService=require(_0x2a99('0x14'));var qs=require(_0x2a99('0x15'));var as=require(_0x2a99('0x16'));var hardwareService=require(_0x2a99('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x2a99('0x18'));var config=require(_0x2a99('0x19'));var licenseUtil=require(_0x2a99('0x1a'));var db=require(_0x2a99('0x1b'))['db'];config[_0x2a99('0x1c')]=_[_0x2a99('0x1d')](config['redis'],{'host':_0x2a99('0x1e'),'port':0x18eb});var socket=require(_0x2a99('0x1f'))(new Redis(config[_0x2a99('0x1c')]));require(_0x2a99('0x20'))[_0x2a99('0x21')](socket);function respondWithStatusCode(_0x5f2cfa,_0x2ad1c9){_0x2ad1c9=_0x2ad1c9||0xcc;return function(_0x47f5d7){if(_0x47f5d7){return _0x5f2cfa['sendStatus'](_0x2ad1c9);}return _0x5f2cfa[_0x2a99('0x22')](_0x2ad1c9)[_0x2a99('0x23')]();};}function respondWithResult(_0x343ba4,_0x4aa37c){_0x4aa37c=_0x4aa37c||0xc8;return function(_0x5bf701){if(_0x5bf701){return _0x343ba4['status'](_0x4aa37c)[_0x2a99('0x24')](_0x5bf701);}};}function respondWithFilteredResult(_0x4346c4,_0x59f0f0){return function(_0x1819fd){if(_0x1819fd){var _0x44ac46=typeof _0x59f0f0[_0x2a99('0x25')]===_0x2a99('0x26')&&typeof _0x59f0f0['limit']===_0x2a99('0x26');var _0x410ea7=_0x1819fd[_0x2a99('0x27')];var _0x620ca5=_0x44ac46?0x0:_0x59f0f0[_0x2a99('0x25')];var _0x56860d=_0x44ac46?_0x1819fd[_0x2a99('0x27')]:_0x59f0f0[_0x2a99('0x25')]+_0x59f0f0[_0x2a99('0x28')];var _0x35fddf;if(_0x56860d>=_0x410ea7){_0x56860d=_0x410ea7;_0x35fddf=0xc8;}else{_0x35fddf=0xce;}_0x4346c4[_0x2a99('0x22')](_0x35fddf);return _0x4346c4[_0x2a99('0x29')](_0x2a99('0x2a'),_0x620ca5+'-'+_0x56860d+'/'+_0x410ea7)[_0x2a99('0x24')](_0x1819fd);}return null;};}function patchUpdates(_0x3541fc){return function(_0x457a85){try{jsonpatch['apply'](_0x457a85,_0x3541fc,!![]);}catch(_0x1109cd){return BPromise['reject'](_0x1109cd);}return _0x457a85['save']();};}function saveUpdates(_0x48c611,_0x5527f0){return function(_0x5e13e9){if(_0x5e13e9){return _0x5e13e9['update'](_0x48c611)[_0x2a99('0x2b')](function(_0x5ec334){return _0x5ec334;});}return null;};}function removeEntity(_0x324a1c,_0x228737){return function(_0x274707){if(_0x274707){return _0x274707[_0x2a99('0x2c')]()[_0x2a99('0x2b')](function(){_0x324a1c[_0x2a99('0x22')](0xcc)[_0x2a99('0x23')]();});}};}function handleEntityNotFound(_0x3485c8,_0x2b5d97){return function(_0x2f0bf0){if(!_0x2f0bf0){_0x3485c8['sendStatus'](0x194);}return _0x2f0bf0;};}function handleError(_0x47736f,_0x4271b4){_0x4271b4=_0x4271b4||0x1f4;return function(_0x5ad092){logger[_0x2a99('0x2d')](_0x5ad092[_0x2a99('0x2e')]);if(_0x5ad092[_0x2a99('0x2f')]){delete _0x5ad092['name'];}_0x47736f[_0x2a99('0x22')](_0x4271b4)[_0x2a99('0x30')](_0x5ad092);};}exports[_0x2a99('0x31')]=function(_0x30f087,_0x5ea029){var _0x24dc9f={'raw':![],'where':{'id':_0x30f087['params']['id']}},_0x1dbffa={};_0x1dbffa[_0x2a99('0x32')]=_[_0x2a99('0x33')](db[_0x2a99('0x34')]['rawAttributes']);_0x1dbffa[_0x2a99('0x35')]=_[_0x2a99('0x33')](_0x30f087[_0x2a99('0x35')]);_0x1dbffa[_0x2a99('0x36')]=_[_0x2a99('0x37')](_0x1dbffa['model'],_0x1dbffa[_0x2a99('0x35')]);_0x24dc9f['attributes']=_[_0x2a99('0x37')](_0x1dbffa[_0x2a99('0x32')],qs[_0x2a99('0x38')](_0x30f087[_0x2a99('0x35')][_0x2a99('0x38')]));_0x24dc9f[_0x2a99('0x39')]=_0x24dc9f[_0x2a99('0x39')][_0x2a99('0x3a')]?_0x24dc9f[_0x2a99('0x39')]:_0x1dbffa[_0x2a99('0x32')];if(_0x30f087[_0x2a99('0x35')]['includeAll']){_0x24dc9f[_0x2a99('0x3b')]=[{'all':!![]}];}_0x24dc9f=_[_0x2a99('0x3c')]({},_0x24dc9f,_0x30f087[_0x2a99('0x3d')]);return db[_0x2a99('0x34')][_0x2a99('0x3e')](_0x24dc9f)[_0x2a99('0x2b')](handleEntityNotFound(_0x5ea029,null))[_0x2a99('0x2b')](respondWithResult(_0x5ea029,null))[_0x2a99('0x3f')](handleError(_0x5ea029,null));};exports[_0x2a99('0x2c')]=function(_0xbeca9f,_0x5a7b82){return db['DashboardItem']['find']({'where':{'id':_0xbeca9f[_0x2a99('0x40')]['id']}})[_0x2a99('0x2b')](handleEntityNotFound(_0x5a7b82,null))[_0x2a99('0x2b')](removeEntity(_0x5a7b82,null))[_0x2a99('0x3f')](handleError(_0x5a7b82,null));};function widgetAttributes(_0x2f7fb9){try{switch(_0x2f7fb9[_0x2a99('0x41')]){case _0x2a99('0x42'):return[{'name':'attrUrl','value':_0x2f7fb9[_0x2a99('0x43')]||(_0x2f7fb9['attrs']&&_0x2f7fb9['attrs'][0x0]?_0x2f7fb9[_0x2a99('0x44')][0x0][_0x2a99('0x45')]:undefined)||_0x2a99('0x46')}];case _0x2a99('0x47'):return[{'name':_0x2a99('0x48'),'value':_0x2f7fb9[_0x2a99('0x48')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x0]?_0x2f7fb9[_0x2a99('0x44')][0x0][_0x2a99('0x45')]:undefined)||''}];case _0x2a99('0x49'):return[{'name':_0x2a99('0x4a'),'value':_0x2f7fb9[_0x2a99('0x4a')]||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0x0]?_0x2f7fb9[_0x2a99('0x44')][0x0]['value']:undefined)||_0x2a99('0x4b')},{'name':_0x2a99('0x4c'),'value':_0x2f7fb9[_0x2a99('0x4c')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x1]?_0x2f7fb9['attrs'][0x1][_0x2a99('0x45')]:undefined)||_0x2a99('0x4d')},{'name':_0x2a99('0x4e'),'value':_0x2f7fb9[_0x2a99('0x4e')]||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0x2]?_0x2f7fb9[_0x2a99('0x44')][0x2][_0x2a99('0x45')]:undefined)||0xc}];case _0x2a99('0x4f'):return[{'name':'attrMetric','value':_0x2f7fb9['attrMetric']||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0x0]?_0x2f7fb9['attrs'][0x0][_0x2a99('0x45')]:undefined)||_0x2a99('0x50')},{'name':'attrVoiceQueues','value':_0x2f7fb9[_0x2a99('0x51')]||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0x1]?_0x2f7fb9[_0x2a99('0x44')][0x1][_0x2a99('0x45')]:undefined)||[]},{'name':'attrFontSize','value':_0x2f7fb9[_0x2a99('0x4e')]||(_0x2f7fb9['attrs']&&_0x2f7fb9['attrs'][0x2]?_0x2f7fb9[_0x2a99('0x44')][0x2][_0x2a99('0x45')]:undefined)||0x14},{'name':_0x2a99('0x52'),'value':_0x2f7fb9[_0x2a99('0x52')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x3]?_0x2f7fb9['attrs'][0x3][_0x2a99('0x45')]:undefined)||_0x2a99('0x53')},{'name':_0x2a99('0x54'),'value':_0x2f7fb9[_0x2a99('0x54')]||(_0x2f7fb9['attrs']&&_0x2f7fb9['attrs'][0x4]?_0x2f7fb9[_0x2a99('0x44')][0x4][_0x2a99('0x45')]:undefined)||''},{'name':_0x2a99('0x55'),'value':_0x2f7fb9[_0x2a99('0x55')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9['attrs'][0x5]?_0x2f7fb9[_0x2a99('0x44')][0x5][_0x2a99('0x45')]:undefined)||''},{'name':_0x2a99('0x56'),'value':_0x2f7fb9[_0x2a99('0x56')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x6]?_0x2f7fb9[_0x2a99('0x44')][0x6][_0x2a99('0x45')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2f7fb9['attrOpenchannelAccounts']||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x7]?_0x2f7fb9[_0x2a99('0x44')][0x7][_0x2a99('0x45')]:undefined)||''},{'name':_0x2a99('0x57'),'value':_0x2f7fb9[_0x2a99('0x57')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9['attrs'][0x8]?_0x2f7fb9[_0x2a99('0x44')][0x8]['value']:undefined)||''},{'name':_0x2a99('0x58'),'value':_0x2f7fb9[_0x2a99('0x58')]||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0x9]?_0x2f7fb9['attrs'][0x9]['value']:undefined)||''}];case _0x2a99('0x59'):case'pie-chart':return[{'name':_0x2a99('0x5a'),'value':_0x2f7fb9['attrSerie1']||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9['attrs'][0x0]?_0x2f7fb9[_0x2a99('0x44')][0x0][_0x2a99('0x45')]:undefined)||_0x2a99('0x50')},{'name':_0x2a99('0x5b'),'value':_0x2f7fb9[_0x2a99('0x5b')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9['attrs'][0x1]?_0x2f7fb9[_0x2a99('0x44')][0x1][_0x2a99('0x45')]:undefined)||null},{'name':'attrSerie3','value':_0x2f7fb9['attrSerie3']||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0x2]?_0x2f7fb9['attrs'][0x2][_0x2a99('0x45')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2f7fb9[_0x2a99('0x51')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x3]?_0x2f7fb9[_0x2a99('0x44')][0x3][_0x2a99('0x45')]:undefined)||[]},{'name':_0x2a99('0x52'),'value':_0x2f7fb9['attrChannel']||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0x4]?_0x2f7fb9[_0x2a99('0x44')][0x4][_0x2a99('0x45')]:undefined)||_0x2a99('0x53')},{'name':'attrEmailAccounts','value':_0x2f7fb9[_0x2a99('0x54')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x5]?_0x2f7fb9[_0x2a99('0x44')][0x5]['value']:undefined)||''},{'name':_0x2a99('0x55'),'value':_0x2f7fb9[_0x2a99('0x55')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x6]?_0x2f7fb9[_0x2a99('0x44')][0x6][_0x2a99('0x45')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2f7fb9[_0x2a99('0x56')]||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0x7]?_0x2f7fb9[_0x2a99('0x44')][0x7][_0x2a99('0x45')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2f7fb9[_0x2a99('0x5c')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x8]?_0x2f7fb9['attrs'][0x8][_0x2a99('0x45')]:undefined)||''},{'name':_0x2a99('0x57'),'value':_0x2f7fb9['attrWhatsappAccounts']||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x9]?_0x2f7fb9[_0x2a99('0x44')][0x9][_0x2a99('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2f7fb9[_0x2a99('0x58')]||(_0x2f7fb9['attrs']&&_0x2f7fb9[_0x2a99('0x44')][0xa]?_0x2f7fb9['attrs'][0xa][_0x2a99('0x45')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x2f7fb9[_0x2a99('0x5d')]||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9['attrs'][0x0]?_0x2f7fb9[_0x2a99('0x44')][0x0][_0x2a99('0x41')]:undefined)||null,'value':_0x2f7fb9['attrReport']||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9[_0x2a99('0x44')][0x0]?_0x2f7fb9[_0x2a99('0x44')][0x0][_0x2a99('0x45')]:undefined)||null},{'name':_0x2a99('0x5e'),'value':_0x2f7fb9['attrRefresh']||(_0x2f7fb9[_0x2a99('0x44')]&&_0x2f7fb9['attrs'][0x1]?_0x2f7fb9[_0x2a99('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x357f27){logger[_0x2a99('0x2d')](_0x2a99('0x5f'),JSON[_0x2a99('0x60')](_0x357f27));return[];}}exports[_0x2a99('0x61')]=function(_0x5c7ee2,_0x2ceceb){if(_0x5c7ee2[_0x2a99('0x62')]){_0x5c7ee2[_0x2a99('0x62')][_0x2a99('0x44')]=widgetAttributes(_0x5c7ee2['body']);}return db[_0x2a99('0x34')]['create'](_0x5c7ee2[_0x2a99('0x62')],{})[_0x2a99('0x2b')](respondWithResult(_0x2ceceb,0xc9))['catch'](handleError(_0x2ceceb,null));};exports[_0x2a99('0x63')]=function(_0x5c34d1,_0x3b81f0){if(_0x5c34d1[_0x2a99('0x62')]['id']){delete _0x5c34d1[_0x2a99('0x62')]['id'];}_0x5c34d1[_0x2a99('0x62')][_0x2a99('0x44')]=widgetAttributes(_0x5c34d1['body']);return db['DashboardItem'][_0x2a99('0x3e')]({'where':{'id':_0x5c34d1[_0x2a99('0x40')]['id']}})[_0x2a99('0x2b')](handleEntityNotFound(_0x3b81f0,null))[_0x2a99('0x2b')](saveUpdates(_0x5c34d1[_0x2a99('0x62')],null))['then'](respondWithResult(_0x3b81f0,null))[_0x2a99('0x3f')](handleError(_0x3b81f0,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 9c0954e..191fe76 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 _0xbd33=['update','remove','emit','hook','exports','events','DashboardItem','save'];(function(_0x654ce9,_0x4bff1e){var _0x266b00=function(_0x583d5e){while(--_0x583d5e){_0x654ce9['push'](_0x654ce9['shift']());}};_0x266b00(++_0x4bff1e);}(_0xbd33,0x155));var _0x3bd3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd33[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x3bd3('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x3bd3('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3bd3('0x2'),'afterUpdate':_0x3bd3('0x3'),'afterDestroy':_0x3bd3('0x4')};function emitEvent(_0x45a801){return function(_0x5af1d1,_0x2b1184,_0x46edfe){DashboardItemEvents[_0x3bd3('0x5')](_0x45a801+':'+_0x5af1d1['id'],_0x5af1d1);DashboardItemEvents['emit'](_0x45a801,_0x5af1d1);_0x46edfe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x3bd3('0x6')](e,emitEvent(event));}}module[_0x3bd3('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x5ceb=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','emit'];(function(_0x1bcf27,_0x2de1ee){var _0x351cec=function(_0x10468a){while(--_0x10468a){_0x1bcf27['push'](_0x1bcf27['shift']());}};_0x351cec(++_0x2de1ee);}(_0x5ceb,0x1d3));var _0xb5ce=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x5ceb[_0x5519a9];return _0x32f2cc;};'use strict';var EventEmitter=require(_0xb5ce('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xb5ce('0x1')](0x0);var events={'afterCreate':_0xb5ce('0x2'),'afterUpdate':_0xb5ce('0x3'),'afterDestroy':'remove'};function emitEvent(_0x93f46a){return function(_0x37e804,_0x787474,_0x40b879){DashboardItemEvents[_0xb5ce('0x4')](_0x93f46a+':'+_0x37e804['id'],_0x37e804);DashboardItemEvents[_0xb5ce('0x4')](_0x93f46a,_0x37e804);_0x40b879(null);};}for(var e in events){if(events[_0xb5ce('0x5')](e)){var event=events[e];DashboardItem[_0xb5ce('0x6')](e,emitEvent(event));}}module[_0xb5ce('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 056e696..880c0c6 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 _0x23d3=['../../config/environment','exports','define','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x23d3,0xe8));var _0x323d=function(_0x3acd9a,_0x3ebaa6){_0x3acd9a=_0x3acd9a-0x0;var _0xb53d64=_0x23d3[_0x3acd9a];return _0xb53d64;};'use strict';var _=require(_0x323d('0x0'));var util=require(_0x323d('0x1'));var logger=require(_0x323d('0x2'))('api');var moment=require(_0x323d('0x3'));var BPromise=require(_0x323d('0x4'));var rp=require(_0x323d('0x5'));var fs=require('fs');var path=require(_0x323d('0x6'));var rimraf=require(_0x323d('0x7'));var config=require(_0x323d('0x8'));var attributes=require('./dashboardItem.attributes');module[_0x323d('0x9')]=function(_0x34f513,_0x160a18){return _0x34f513[_0x323d('0xa')]('DashboardItem',attributes,{'tableName':_0x323d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabd8=['define','DashboardItem','dashboard_items','api','moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x14ebb6,_0x2ad771){var _0x3862d3=function(_0x2fd7c3){while(--_0x2fd7c3){_0x14ebb6['push'](_0x14ebb6['shift']());}};_0x3862d3(++_0x2ad771);}(_0xabd8,0x142));var _0x8abd=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xabd8[_0x40dd56];return _0x4f850f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8abd('0x0'));var moment=require(_0x8abd('0x1'));var BPromise=require(_0x8abd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8abd('0x3'));var rimraf=require(_0x8abd('0x4'));var config=require(_0x8abd('0x5'));var attributes=require(_0x8abd('0x6'));module[_0x8abd('0x7')]=function(_0x840926,_0x2907b1){return _0x840926[_0x8abd('0x8')](_0x8abd('0x9'),attributes,{'tableName':_0x8abd('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 76016de..bf44ead 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 _0xd5db=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x4a6f18,_0x35251){var _0x41f395=function(_0x5a9a14){while(--_0x5a9a14){_0x4a6f18['push'](_0x4a6f18['shift']());}};_0x41f395(++_0x35251);}(_0xd5db,0x10e));var _0xbd5d=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xd5db[_0x381589];return _0x2a075d;};'use strict';var _=require(_0xbd5d('0x0'));var util=require('util');var moment=require(_0xbd5d('0x1'));var BPromise=require(_0xbd5d('0x2'));var rs=require(_0xbd5d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd5d('0x4'));var logger=require(_0xbd5d('0x5'))(_0xbd5d('0x6'));var config=require(_0xbd5d('0x7'));var jayson=require(_0xbd5d('0x8'));var client=jayson['client'][_0xbd5d('0x9')]({'port':0x232a});config[_0xbd5d('0xa')]=_['defaults'](config[_0xbd5d('0xa')],{'host':_0xbd5d('0xb'),'port':0x18eb});var socket=require(_0xbd5d('0xc'))(new Redis(config[_0xbd5d('0xa')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x153c95,_0x36765c,_0x5ac27b){return new BPromise(function(_0x1137d5,_0x59e1c3){return client[_0xbd5d('0xd')](_0x153c95,_0x5ac27b)[_0xbd5d('0xe')](function(_0x1d5573){logger[_0xbd5d('0xf')](_0xbd5d('0x10'),_0x36765c,_0xbd5d('0x11'));logger[_0xbd5d('0x12')](_0xbd5d('0x13'),_0x36765c,_0xbd5d('0x11'),JSON[_0xbd5d('0x14')](_0x1d5573));if(_0x1d5573['error']){if(_0x1d5573[_0xbd5d('0x15')][_0xbd5d('0x16')]===0x1f4){logger[_0xbd5d('0x15')]('DashboardItem,\x20%s,\x20%s',_0x36765c,_0x1d5573[_0xbd5d('0x15')][_0xbd5d('0x17')]);return _0x59e1c3(_0x1d5573[_0xbd5d('0x15')]['message']);}logger[_0xbd5d('0x15')](_0xbd5d('0x10'),_0x36765c,_0x1d5573[_0xbd5d('0x15')][_0xbd5d('0x17')]);return _0x1137d5(_0x1d5573[_0xbd5d('0x15')]['message']);}else{logger[_0xbd5d('0xf')]('DashboardItem,\x20%s,\x20%s',_0x36765c,'request\x20sent');_0x1137d5(_0x1d5573[_0xbd5d('0x18')][_0xbd5d('0x17')]);}})['catch'](function(_0xc5e3af){logger[_0xbd5d('0x15')]('DashboardItem,\x20%s,\x20%s',_0x36765c,_0xc5e3af);_0x59e1c3(_0xc5e3af);});});} \ No newline at end of file +var _0x2624=['result','catch','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x2624,0x1e6));var _0x4262=function(_0x1d5a18,_0x11100b){_0x1d5a18=_0x1d5a18-0x0;var _0xaf1dca=_0x2624[_0x1d5a18];return _0xaf1dca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4262('0x0'));var BPromise=require(_0x4262('0x1'));var rs=require(_0x4262('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4262('0x3'));var logger=require('../../config/logger')(_0x4262('0x4'));var config=require(_0x4262('0x5'));var jayson=require(_0x4262('0x6'));var client=jayson['client'][_0x4262('0x7')]({'port':0x232a});config[_0x4262('0x8')]=_['defaults'](config[_0x4262('0x8')],{'host':_0x4262('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4262('0x8')]));require(_0x4262('0xa'))[_0x4262('0xb')](socket);function respondWithRpcPromise(_0x1d7ae3,_0x18c013,_0x3e7268){return new BPromise(function(_0x514eb8,_0x141c15){return client['request'](_0x1d7ae3,_0x3e7268)[_0x4262('0xc')](function(_0x381655){logger[_0x4262('0xd')](_0x4262('0xe'),_0x18c013,_0x4262('0xf'));logger['debug'](_0x4262('0x10'),_0x18c013,'request\x20sent',JSON[_0x4262('0x11')](_0x381655));if(_0x381655['error']){if(_0x381655[_0x4262('0x12')]['code']===0x1f4){logger[_0x4262('0x12')]('DashboardItem,\x20%s,\x20%s',_0x18c013,_0x381655[_0x4262('0x12')][_0x4262('0x13')]);return _0x141c15(_0x381655[_0x4262('0x12')][_0x4262('0x13')]);}logger[_0x4262('0x12')](_0x4262('0xe'),_0x18c013,_0x381655[_0x4262('0x12')]['message']);return _0x514eb8(_0x381655[_0x4262('0x12')][_0x4262('0x13')]);}else{logger['info'](_0x4262('0xe'),_0x18c013,'request\x20sent');_0x514eb8(_0x381655[_0x4262('0x14')]['message']);}})[_0x4262('0x15')](function(_0x2021be){logger[_0x4262('0x12')](_0x4262('0xe'),_0x18c013,_0x2021be);_0x141c15(_0x2021be);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 8a07a2f..17d0201 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 _0x0a4b=['emit','register','length','./dashboardItem.events','remove','update'];(function(_0x14d2f9,_0x1c364c){var _0x1efb3f=function(_0x3f04c8){while(--_0x3f04c8){_0x14d2f9['push'](_0x14d2f9['shift']());}};_0x1efb3f(++_0x1c364c);}(_0x0a4b,0x99));var _0xb0a4=function(_0x27cad1,_0x48e218){_0x27cad1=_0x27cad1-0x0;var _0x5fcac7=_0x0a4b[_0x27cad1];return _0x5fcac7;};'use strict';var DashboardItemEvents=require(_0xb0a4('0x0'));var events=['save',_0xb0a4('0x1'),_0xb0a4('0x2')];function createListener(_0x3b5f89,_0x6d8cc5){return function(_0x197063){_0x6d8cc5[_0xb0a4('0x3')](_0x3b5f89,_0x197063);};}function removeListener(_0x2e9705,_0x24b0c4){return function(){DashboardItemEvents['removeListener'](_0x2e9705,_0x24b0c4);};}exports[_0xb0a4('0x4')]=function(_0x2cdc83){for(var _0x1061ca=0x0,_0x14fde0=events[_0xb0a4('0x5')];_0x1061ca<_0x14fde0;_0x1061ca++){var _0x599381=events[_0x1061ca];var _0x23dd6e=createListener('dashboardItem:'+_0x599381,_0x2cdc83);DashboardItemEvents['on'](_0x599381,_0x23dd6e);}}; \ No newline at end of file +var _0x00c6=['register','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x63755c,_0x5638e4){var _0x3c43ce=function(_0x2bf93c){while(--_0x2bf93c){_0x63755c['push'](_0x63755c['shift']());}};_0x3c43ce(++_0x5638e4);}(_0x00c6,0x1c2));var _0x600c=function(_0x309abd,_0x5e28f9){_0x309abd=_0x309abd-0x0;var _0x20e4c0=_0x00c6[_0x309abd];return _0x20e4c0;};'use strict';var DashboardItemEvents=require(_0x600c('0x0'));var events=[_0x600c('0x1'),_0x600c('0x2'),_0x600c('0x3')];function createListener(_0x31afcd,_0x1ee820){return function(_0x22e1ea){_0x1ee820[_0x600c('0x4')](_0x31afcd,_0x22e1ea);};}function removeListener(_0x2dd2f2,_0x48a2bd){return function(){DashboardItemEvents[_0x600c('0x5')](_0x2dd2f2,_0x48a2bd);};}exports[_0x600c('0x6')]=function(_0x4ed980){for(var _0x5e8af1=0x0,_0x1a69ad=events['length'];_0x5e8af1<_0x1a69ad;_0x5e8af1++){var _0x462196=events[_0x5e8af1];var _0x428095=createListener(_0x600c('0x7')+_0x462196,_0x4ed980);DashboardItemEvents['on'](_0x462196,_0x428095);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 217c2fa..a84b311 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 _0xb4cf=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./dashboardItem.controller'];(function(_0x1f345a,_0x341b14){var _0x93c6d5=function(_0x292f88){while(--_0x292f88){_0x1f345a['push'](_0x1f345a['shift']());}};_0x93c6d5(++_0x341b14);}(_0xb4cf,0xb4));var _0xfb4c=function(_0x2187ed,_0x4102b1){_0x2187ed=_0x2187ed-0x0;var _0x2693e3=_0xb4cf[_0x2187ed];return _0x2693e3;};'use strict';var multer=require('multer');var util=require(_0xfb4c('0x0'));var path=require(_0xfb4c('0x1'));var timeout=require('connect-timeout');var express=require(_0xfb4c('0x2'));var router=express[_0xfb4c('0x3')]();var fs_extra=require(_0xfb4c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb4c('0x5'));var controller=require(_0xfb4c('0x6'));router['get'](_0xfb4c('0x7'),auth['isAuthenticated'](),controller[_0xfb4c('0x8')]);router[_0xfb4c('0x9')]('/',auth[_0xfb4c('0xa')](),controller[_0xfb4c('0xb')]);router[_0xfb4c('0xc')]('/:id',auth[_0xfb4c('0xa')](),controller[_0xfb4c('0xd')]);router[_0xfb4c('0xe')](_0xfb4c('0x7'),auth[_0xfb4c('0xa')](),controller[_0xfb4c('0xf')]);module[_0xfb4c('0x10')]=router; \ No newline at end of file +var _0xb0f3=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','update'];(function(_0xc23b5d,_0x4709f6){var _0x46a0e4=function(_0x3451a8){while(--_0x3451a8){_0xc23b5d['push'](_0xc23b5d['shift']());}};_0x46a0e4(++_0x4709f6);}(_0xb0f3,0xb7));var _0x3b0f=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xb0f3[_0x33c9f8];return _0x2d7004;};'use strict';var multer=require(_0x3b0f('0x0'));var util=require(_0x3b0f('0x1'));var path=require(_0x3b0f('0x2'));var timeout=require(_0x3b0f('0x3'));var express=require(_0x3b0f('0x4'));var router=express['Router']();var fs_extra=require(_0x3b0f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3b0f('0x6'));var config=require('../../config/environment');var controller=require(_0x3b0f('0x7'));router[_0x3b0f('0x8')](_0x3b0f('0x9'),auth[_0x3b0f('0xa')](),controller[_0x3b0f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3b0f('0xc')]);router[_0x3b0f('0xd')](_0x3b0f('0x9'),auth['isAuthenticated'](),controller[_0x3b0f('0xe')]);router[_0x3b0f('0xf')]('/:id',auth[_0x3b0f('0xa')](),controller[_0x3b0f('0x10')]);module[_0x3b0f('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 8050e6a..c2b8526 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 _0xfaf1=['third','first','sequelize','exports','STRING','ENUM','second'];(function(_0x28e5bb,_0x4446b9){var _0x2b1296=function(_0x3077dc){while(--_0x3077dc){_0x28e5bb['push'](_0x28e5bb['shift']());}};_0x2b1296(++_0x4446b9);}(_0xfaf1,0x1d0));var _0x1faf=function(_0x87a22,_0x3f086f){_0x87a22=_0x87a22-0x0;var _0x39a603=_0xfaf1[_0x87a22];return _0x39a603;};'use strict';var Sequelize=require(_0x1faf('0x0'));module[_0x1faf('0x1')]={'name':{'type':Sequelize[_0x1faf('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x1faf('0x3')]('first',_0x1faf('0x4'),_0x1faf('0x5')),'allowNull':![],'defaultValue':_0x1faf('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x53fd=['STRING','ENUM','first','third','sequelize','exports'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x53fd,0x112));var _0xd53f=function(_0x2ac255,_0x62dd05){_0x2ac255=_0x2ac255-0x0;var _0x8f79c=_0x53fd[_0x2ac255];return _0x8f79c;};'use strict';var Sequelize=require(_0xd53f('0x0'));module[_0xd53f('0x1')]={'name':{'type':Sequelize[_0xd53f('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xd53f('0x3')](_0xd53f('0x4'),'second',_0xd53f('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 18513d7..4af781b 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 _0x850a=['limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','index','Disposition','rawAttributes','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','params','filters','includeAll','find','catch','create','user','get','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','offset','undefined','count'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x850a,0x123));var _0xa850=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x850a[_0x9d14e3];return _0x19bf32;};'use strict';var emlformat=require(_0xa850('0x0'));var rimraf=require(_0xa850('0x1'));var zipdir=require(_0xa850('0x2'));var jsonpatch=require(_0xa850('0x3'));var rp=require(_0xa850('0x4'));var moment=require('moment');var BPromise=require(_0xa850('0x5'));var Mustache=require(_0xa850('0x6'));var util=require(_0xa850('0x7'));var path=require(_0xa850('0x8'));var sox=require(_0xa850('0x9'));var csv=require(_0xa850('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa850('0xb'));var squel=require(_0xa850('0xc'));var crypto=require(_0xa850('0xd'));var jsforce=require(_0xa850('0xe'));var deskjs=require(_0xa850('0xf'));var toCsv=require(_0xa850('0xa'));var querystring=require(_0xa850('0x10'));var Papa=require(_0xa850('0x11'));var Redis=require(_0xa850('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa850('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa850('0x14'));var logger=require(_0xa850('0x15'))('api');var utils=require(_0xa850('0x16'));var config=require(_0xa850('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3da5d3,_0x3866a2){_0x3866a2=_0x3866a2||0xcc;return function(_0x26be2f){if(_0x26be2f){return _0x3da5d3['sendStatus'](_0x3866a2);}return _0x3da5d3[_0xa850('0x18')](_0x3866a2)[_0xa850('0x19')]();};}function respondWithResult(_0xba239,_0x156a00){_0x156a00=_0x156a00||0xc8;return function(_0x33cb64){if(_0x33cb64){return _0xba239['status'](_0x156a00)['json'](_0x33cb64);}};}function respondWithFilteredResult(_0x2b5ba4,_0x3591d3){return function(_0x2fedb2){if(_0x2fedb2){var _0x4831d5=typeof _0x3591d3[_0xa850('0x1a')]===_0xa850('0x1b')&&typeof _0x3591d3['limit']===_0xa850('0x1b');var _0x4f5612=_0x2fedb2[_0xa850('0x1c')];var _0x2b6672=_0x4831d5?0x0:_0x3591d3[_0xa850('0x1a')];var _0x16514f=_0x4831d5?_0x2fedb2[_0xa850('0x1c')]:_0x3591d3[_0xa850('0x1a')]+_0x3591d3[_0xa850('0x1d')];var _0x5ec1e3;if(_0x16514f>=_0x4f5612){_0x16514f=_0x4f5612;_0x5ec1e3=0xc8;}else{_0x5ec1e3=0xce;}_0x2b5ba4['status'](_0x5ec1e3);return _0x2b5ba4[_0xa850('0x1e')](_0xa850('0x1f'),_0x2b6672+'-'+_0x16514f+'/'+_0x4f5612)['json'](_0x2fedb2);}return null;};}function patchUpdates(_0x28cbe2){return function(_0x4f87e3){try{jsonpatch['apply'](_0x4f87e3,_0x28cbe2,!![]);}catch(_0x374f76){return BPromise[_0xa850('0x20')](_0x374f76);}return _0x4f87e3[_0xa850('0x21')]();};}function saveUpdates(_0x2d3b57,_0x9d1858){return function(_0xf4107a){if(_0xf4107a){return _0xf4107a[_0xa850('0x22')](_0x2d3b57)[_0xa850('0x23')](function(_0xc72a){return _0xc72a;});}return null;};}function removeEntity(_0x526639,_0x38c790){return function(_0x22b3ca){if(_0x22b3ca){return _0x22b3ca['destroy']()[_0xa850('0x23')](function(){var _0x3b3d82=_0x22b3ca['get']({'plain':!![]});var _0x8e8745='Dispositions';return db['UserProfileResource']['destroy']({'where':{'type':_0x8e8745,'resourceId':_0x3b3d82['id']}})[_0xa850('0x23')](function(){return _0x22b3ca;});})['then'](function(){_0x526639[_0xa850('0x18')](0xcc)[_0xa850('0x19')]();});}};}function handleEntityNotFound(_0x30b3c0,_0x534467){return function(_0x390869){if(!_0x390869){_0x30b3c0[_0xa850('0x24')](0x194);}return _0x390869;};}function handleError(_0x5aa31d,_0x3dac9b){_0x3dac9b=_0x3dac9b||0x1f4;return function(_0x248121){logger[_0xa850('0x25')](_0x248121[_0xa850('0x26')]);if(_0x248121['name']){delete _0x248121['name'];}_0x5aa31d[_0xa850('0x18')](_0x3dac9b)['send'](_0x248121);};}exports[_0xa850('0x27')]=function(_0x11f76b,_0x3f74bd){var _0x3e270c={},_0x5196bb={},_0x5ee797={'count':0x0,'rows':[]};var _0x297cc4=_['map'](db[_0xa850('0x28')][_0xa850('0x29')],function(_0x27a54e){return{'name':_0x27a54e['fieldName'],'type':_0x27a54e['type']['key']};});_0x5196bb[_0xa850('0x2a')]=_['map'](_0x297cc4,_0xa850('0x2b'));_0x5196bb[_0xa850('0x2c')]=_[_0xa850('0x2d')](_0x11f76b[_0xa850('0x2c')]);_0x5196bb['filters']=_[_0xa850('0x2e')](_0x5196bb[_0xa850('0x2a')],_0x5196bb[_0xa850('0x2c')]);_0x3e270c['attributes']=_[_0xa850('0x2e')](_0x5196bb[_0xa850('0x2a')],qs[_0xa850('0x2f')](_0x11f76b[_0xa850('0x2c')]['fields']));_0x3e270c[_0xa850('0x30')]=_0x3e270c[_0xa850('0x30')][_0xa850('0x31')]?_0x3e270c[_0xa850('0x30')]:_0x5196bb[_0xa850('0x2a')];if(!_0x11f76b[_0xa850('0x2c')][_0xa850('0x32')](_0xa850('0x33'))){_0x3e270c[_0xa850('0x1d')]=qs[_0xa850('0x1d')](_0x11f76b[_0xa850('0x2c')]['limit']);_0x3e270c['offset']=qs[_0xa850('0x1a')](_0x11f76b[_0xa850('0x2c')][_0xa850('0x1a')]);}_0x3e270c['order']=qs[_0xa850('0x34')](_0x11f76b[_0xa850('0x2c')][_0xa850('0x34')]);_0x3e270c[_0xa850('0x35')]=qs['filters'](_[_0xa850('0x36')](_0x11f76b[_0xa850('0x2c')],_0x5196bb['filters']),_0x297cc4);if(_0x11f76b[_0xa850('0x2c')][_0xa850('0x37')]){_0x3e270c[_0xa850('0x35')]=_[_0xa850('0x38')](_0x3e270c['where'],{'$or':_[_0xa850('0x39')](_0x297cc4,function(_0x3c52bf){if(_0x3c52bf['type']!==_0xa850('0x3a')){var _0x324767={};_0x324767[_0x3c52bf[_0xa850('0x2b')]]={'$like':'%'+_0x11f76b[_0xa850('0x2c')][_0xa850('0x37')]+'%'};return _0x324767;}})});}_0x3e270c=_[_0xa850('0x38')]({},_0x3e270c,_0x11f76b[_0xa850('0x3b')]);var _0x1d9fae={'where':_0x3e270c[_0xa850('0x35')]};return db[_0xa850('0x28')][_0xa850('0x1c')](_0x1d9fae)[_0xa850('0x23')](function(_0x4fde88){_0x5ee797[_0xa850('0x1c')]=_0x4fde88;if(_0x11f76b[_0xa850('0x2c')]['includeAll']){_0x3e270c[_0xa850('0x3c')]=[{'all':!![]}];}return db[_0xa850('0x28')][_0xa850('0x3d')](_0x3e270c);})[_0xa850('0x23')](function(_0x587858){_0x5ee797[_0xa850('0x3e')]=_0x587858;return _0x5ee797;})[_0xa850('0x23')](respondWithFilteredResult(_0x3f74bd,_0x3e270c))['catch'](handleError(_0x3f74bd,null));};exports['show']=function(_0x134ec2,_0x196666){var _0x2263b0={'raw':!![],'where':{'id':_0x134ec2[_0xa850('0x3f')]['id']}},_0x1d9ef0={};_0x1d9ef0['model']=_[_0xa850('0x2d')](db['Disposition']['rawAttributes']);_0x1d9ef0[_0xa850('0x2c')]=_[_0xa850('0x2d')](_0x134ec2[_0xa850('0x2c')]);_0x1d9ef0[_0xa850('0x40')]=_[_0xa850('0x2e')](_0x1d9ef0[_0xa850('0x2a')],_0x1d9ef0[_0xa850('0x2c')]);_0x2263b0['attributes']=_['intersection'](_0x1d9ef0[_0xa850('0x2a')],qs[_0xa850('0x2f')](_0x134ec2[_0xa850('0x2c')][_0xa850('0x2f')]));_0x2263b0['attributes']=_0x2263b0[_0xa850('0x30')][_0xa850('0x31')]?_0x2263b0[_0xa850('0x30')]:_0x1d9ef0['model'];if(_0x134ec2[_0xa850('0x2c')][_0xa850('0x41')]){_0x2263b0['include']=[{'all':!![]}];}_0x2263b0=_[_0xa850('0x38')]({},_0x2263b0,_0x134ec2[_0xa850('0x3b')]);return db['Disposition'][_0xa850('0x42')](_0x2263b0)[_0xa850('0x23')](handleEntityNotFound(_0x196666,null))[_0xa850('0x23')](respondWithResult(_0x196666,null))[_0xa850('0x43')](handleError(_0x196666,null));};exports[_0xa850('0x44')]=function(_0x4a1303,_0x389fc2){return db['Disposition'][_0xa850('0x44')](_0x4a1303['body'],{})[_0xa850('0x23')](function(_0x2e77e0){var _0xfd1331=_0x4a1303[_0xa850('0x45')][_0xa850('0x46')]({'plain':!![]});if(!_0xfd1331)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfd1331[_0xa850('0x47')]===_0xa850('0x45')){var _0x38e872=_0x2e77e0[_0xa850('0x46')]({'plain':!![]});var _0x3aed07=_0xa850('0x48');return db[_0xa850('0x49')][_0xa850('0x42')]({'where':{'name':_0x3aed07,'userProfileId':_0xfd1331[_0xa850('0x4a')]},'raw':!![]})[_0xa850('0x23')](function(_0x20c657){if(_0x20c657&&_0x20c657[_0xa850('0x4b')]===0x0){return db[_0xa850('0x4c')][_0xa850('0x44')]({'name':_0x38e872[_0xa850('0x2b')],'resourceId':_0x38e872['id'],'type':_0x20c657[_0xa850('0x2b')],'sectionId':_0x20c657['id']},{})['then'](function(){return _0x2e77e0;});}else{return _0x2e77e0;}})['catch'](function(_0x1bf1e4){logger['error'](_0xa850('0x4d'),_0x1bf1e4);throw _0x1bf1e4;});}return _0x2e77e0;})['then'](respondWithResult(_0x389fc2,0xc9))[_0xa850('0x43')](handleError(_0x389fc2,null));};exports[_0xa850('0x22')]=function(_0x5d1081,_0x3cbc6c){if(_0x5d1081[_0xa850('0x4e')]['id']){delete _0x5d1081['body']['id'];}return db[_0xa850('0x28')][_0xa850('0x42')]({'where':{'id':_0x5d1081[_0xa850('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3cbc6c,null))[_0xa850('0x23')](saveUpdates(_0x5d1081['body'],null))[_0xa850('0x23')](respondWithResult(_0x3cbc6c,null))[_0xa850('0x43')](handleError(_0x3cbc6c,null));};exports[_0xa850('0x4f')]=function(_0x32c2c6,_0x3e882a){return db['Disposition'][_0xa850('0x42')]({'where':{'id':_0x32c2c6['params']['id']}})[_0xa850('0x23')](handleEntityNotFound(_0x3e882a,null))[_0xa850('0x23')](removeEntity(_0x3e882a,null))['catch'](handleError(_0x3e882a,null));}; \ No newline at end of file +var _0xf2f7=['zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','error','name','send','map','Disposition','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','length','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0xf2f7,0xa3));var _0x7f2f=function(_0x5b4480,_0x2be168){_0x5b4480=_0x5b4480-0x0;var _0x4ac110=_0xf2f7[_0x5b4480];return _0x4ac110;};'use strict';var emlformat=require(_0x7f2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f2f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7f2f('0x2'));var BPromise=require(_0x7f2f('0x3'));var Mustache=require(_0x7f2f('0x4'));var util=require(_0x7f2f('0x5'));var path=require(_0x7f2f('0x6'));var sox=require(_0x7f2f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f2f('0x8'));var _=require(_0x7f2f('0x9'));var squel=require(_0x7f2f('0xa'));var crypto=require('crypto');var jsforce=require(_0x7f2f('0xb'));var deskjs=require(_0x7f2f('0xc'));var toCsv=require(_0x7f2f('0xd'));var querystring=require(_0x7f2f('0xe'));var Papa=require('papaparse');var Redis=require(_0x7f2f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7f2f('0x10'));var as=require(_0x7f2f('0x11'));var hardwareService=require(_0x7f2f('0x12'));var logger=require('../../config/logger')(_0x7f2f('0x13'));var utils=require(_0x7f2f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7f2f('0x15'));var db=require(_0x7f2f('0x16'))['db'];function respondWithStatusCode(_0x56e266,_0x34c24e){_0x34c24e=_0x34c24e||0xcc;return function(_0x4fca23){if(_0x4fca23){return _0x56e266[_0x7f2f('0x17')](_0x34c24e);}return _0x56e266[_0x7f2f('0x18')](_0x34c24e)[_0x7f2f('0x19')]();};}function respondWithResult(_0x1f6552,_0x2b0be5){_0x2b0be5=_0x2b0be5||0xc8;return function(_0x2cf126){if(_0x2cf126){return _0x1f6552[_0x7f2f('0x18')](_0x2b0be5)[_0x7f2f('0x1a')](_0x2cf126);}};}function respondWithFilteredResult(_0x2edb2c,_0x5aa33c){return function(_0x4a14f5){if(_0x4a14f5){var _0x264999=typeof _0x5aa33c[_0x7f2f('0x1b')]===_0x7f2f('0x1c')&&typeof _0x5aa33c[_0x7f2f('0x1d')]==='undefined';var _0x1aea47=_0x4a14f5[_0x7f2f('0x1e')];var _0x3a77a4=_0x264999?0x0:_0x5aa33c[_0x7f2f('0x1b')];var _0x21462e=_0x264999?_0x4a14f5[_0x7f2f('0x1e')]:_0x5aa33c[_0x7f2f('0x1b')]+_0x5aa33c['limit'];var _0xd6187e;if(_0x21462e>=_0x1aea47){_0x21462e=_0x1aea47;_0xd6187e=0xc8;}else{_0xd6187e=0xce;}_0x2edb2c[_0x7f2f('0x18')](_0xd6187e);return _0x2edb2c[_0x7f2f('0x1f')]('Content-Range',_0x3a77a4+'-'+_0x21462e+'/'+_0x1aea47)[_0x7f2f('0x1a')](_0x4a14f5);}return null;};}function patchUpdates(_0x1ca790){return function(_0x462154){try{jsonpatch[_0x7f2f('0x20')](_0x462154,_0x1ca790,!![]);}catch(_0x335876){return BPromise['reject'](_0x335876);}return _0x462154[_0x7f2f('0x21')]();};}function saveUpdates(_0x295aad,_0x13d5a3){return function(_0x49025f){if(_0x49025f){return _0x49025f[_0x7f2f('0x22')](_0x295aad)[_0x7f2f('0x23')](function(_0x5250f2){return _0x5250f2;});}return null;};}function removeEntity(_0x20710d,_0x5e428b){return function(_0x1c046d){if(_0x1c046d){return _0x1c046d[_0x7f2f('0x24')]()[_0x7f2f('0x23')](function(){var _0x26ae2c=_0x1c046d[_0x7f2f('0x25')]({'plain':!![]});var _0x2a0ae1=_0x7f2f('0x26');return db[_0x7f2f('0x27')]['destroy']({'where':{'type':_0x2a0ae1,'resourceId':_0x26ae2c['id']}})[_0x7f2f('0x23')](function(){return _0x1c046d;});})[_0x7f2f('0x23')](function(){_0x20710d[_0x7f2f('0x18')](0xcc)[_0x7f2f('0x19')]();});}};}function handleEntityNotFound(_0x2ee922,_0x25f89b){return function(_0x412b9a){if(!_0x412b9a){_0x2ee922[_0x7f2f('0x17')](0x194);}return _0x412b9a;};}function handleError(_0x1d4380,_0x58c4df){_0x58c4df=_0x58c4df||0x1f4;return function(_0x259451){logger[_0x7f2f('0x28')](_0x259451['stack']);if(_0x259451[_0x7f2f('0x29')]){delete _0x259451[_0x7f2f('0x29')];}_0x1d4380[_0x7f2f('0x18')](_0x58c4df)[_0x7f2f('0x2a')](_0x259451);};}exports['index']=function(_0x1adf9d,_0x37b4c8){var _0x5b6f0c={},_0x442395={},_0x12c139={'count':0x0,'rows':[]};var _0x21d779=_[_0x7f2f('0x2b')](db[_0x7f2f('0x2c')][_0x7f2f('0x2d')],function(_0x52459a){return{'name':_0x52459a[_0x7f2f('0x2e')],'type':_0x52459a['type'][_0x7f2f('0x2f')]};});_0x442395[_0x7f2f('0x30')]=_[_0x7f2f('0x2b')](_0x21d779,_0x7f2f('0x29'));_0x442395[_0x7f2f('0x31')]=_[_0x7f2f('0x32')](_0x1adf9d['query']);_0x442395['filters']=_[_0x7f2f('0x33')](_0x442395[_0x7f2f('0x30')],_0x442395['query']);_0x5b6f0c[_0x7f2f('0x34')]=_[_0x7f2f('0x33')](_0x442395['model'],qs['fields'](_0x1adf9d['query'][_0x7f2f('0x35')]));_0x5b6f0c[_0x7f2f('0x34')]=_0x5b6f0c[_0x7f2f('0x34')]['length']?_0x5b6f0c['attributes']:_0x442395[_0x7f2f('0x30')];if(!_0x1adf9d[_0x7f2f('0x31')]['hasOwnProperty'](_0x7f2f('0x36'))){_0x5b6f0c[_0x7f2f('0x1d')]=qs[_0x7f2f('0x1d')](_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x1d')]);_0x5b6f0c[_0x7f2f('0x1b')]=qs[_0x7f2f('0x1b')](_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x1b')]);}_0x5b6f0c[_0x7f2f('0x37')]=qs['sort'](_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x38')]);_0x5b6f0c['where']=qs[_0x7f2f('0x39')](_[_0x7f2f('0x3a')](_0x1adf9d[_0x7f2f('0x31')],_0x442395[_0x7f2f('0x39')]),_0x21d779);if(_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x3b')]){_0x5b6f0c['where']=_['merge'](_0x5b6f0c[_0x7f2f('0x3c')],{'$or':_[_0x7f2f('0x2b')](_0x21d779,function(_0x201226){if(_0x201226['type']!==_0x7f2f('0x3d')){var _0x4a1855={};_0x4a1855[_0x201226[_0x7f2f('0x29')]]={'$like':'%'+_0x1adf9d['query'][_0x7f2f('0x3b')]+'%'};return _0x4a1855;}})});}_0x5b6f0c=_[_0x7f2f('0x3e')]({},_0x5b6f0c,_0x1adf9d[_0x7f2f('0x3f')]);var _0x18217f={'where':_0x5b6f0c[_0x7f2f('0x3c')]};return db['Disposition'][_0x7f2f('0x1e')](_0x18217f)['then'](function(_0x204a7d){_0x12c139[_0x7f2f('0x1e')]=_0x204a7d;if(_0x1adf9d[_0x7f2f('0x31')][_0x7f2f('0x40')]){_0x5b6f0c[_0x7f2f('0x41')]=[{'all':!![]}];}return db[_0x7f2f('0x2c')][_0x7f2f('0x42')](_0x5b6f0c);})[_0x7f2f('0x23')](function(_0x3dbcf4){_0x12c139[_0x7f2f('0x43')]=_0x3dbcf4;return _0x12c139;})[_0x7f2f('0x23')](respondWithFilteredResult(_0x37b4c8,_0x5b6f0c))['catch'](handleError(_0x37b4c8,null));};exports[_0x7f2f('0x44')]=function(_0x42eaf0,_0x31337e){var _0xc4bee0={'raw':!![],'where':{'id':_0x42eaf0['params']['id']}},_0x204020={};_0x204020[_0x7f2f('0x30')]=_[_0x7f2f('0x32')](db[_0x7f2f('0x2c')]['rawAttributes']);_0x204020[_0x7f2f('0x31')]=_[_0x7f2f('0x32')](_0x42eaf0['query']);_0x204020[_0x7f2f('0x39')]=_[_0x7f2f('0x33')](_0x204020[_0x7f2f('0x30')],_0x204020['query']);_0xc4bee0['attributes']=_[_0x7f2f('0x33')](_0x204020[_0x7f2f('0x30')],qs[_0x7f2f('0x35')](_0x42eaf0['query'][_0x7f2f('0x35')]));_0xc4bee0[_0x7f2f('0x34')]=_0xc4bee0[_0x7f2f('0x34')][_0x7f2f('0x45')]?_0xc4bee0[_0x7f2f('0x34')]:_0x204020[_0x7f2f('0x30')];if(_0x42eaf0[_0x7f2f('0x31')][_0x7f2f('0x40')]){_0xc4bee0[_0x7f2f('0x41')]=[{'all':!![]}];}_0xc4bee0=_[_0x7f2f('0x3e')]({},_0xc4bee0,_0x42eaf0['options']);return db[_0x7f2f('0x2c')][_0x7f2f('0x46')](_0xc4bee0)['then'](handleEntityNotFound(_0x31337e,null))[_0x7f2f('0x23')](respondWithResult(_0x31337e,null))[_0x7f2f('0x47')](handleError(_0x31337e,null));};exports[_0x7f2f('0x48')]=function(_0x155453,_0x5eae7e){return db[_0x7f2f('0x2c')]['create'](_0x155453['body'],{})[_0x7f2f('0x23')](function(_0x4de409){var _0x29efce=_0x155453['user'][_0x7f2f('0x25')]({'plain':!![]});if(!_0x29efce)throw new Error(_0x7f2f('0x49'));if(_0x29efce[_0x7f2f('0x4a')]===_0x7f2f('0x4b')){var _0x12537a=_0x4de409[_0x7f2f('0x25')]({'plain':!![]});var _0x11ef5e=_0x7f2f('0x26');return db[_0x7f2f('0x4c')][_0x7f2f('0x46')]({'where':{'name':_0x11ef5e,'userProfileId':_0x29efce[_0x7f2f('0x4d')]},'raw':!![]})[_0x7f2f('0x23')](function(_0x15d725){if(_0x15d725&&_0x15d725[_0x7f2f('0x4e')]===0x0){return db[_0x7f2f('0x27')][_0x7f2f('0x48')]({'name':_0x12537a[_0x7f2f('0x29')],'resourceId':_0x12537a['id'],'type':_0x15d725[_0x7f2f('0x29')],'sectionId':_0x15d725['id']},{})['then'](function(){return _0x4de409;});}else{return _0x4de409;}})[_0x7f2f('0x47')](function(_0x3cf50c){logger['error'](_0x7f2f('0x4f'),_0x3cf50c);throw _0x3cf50c;});}return _0x4de409;})[_0x7f2f('0x23')](respondWithResult(_0x5eae7e,0xc9))[_0x7f2f('0x47')](handleError(_0x5eae7e,null));};exports[_0x7f2f('0x22')]=function(_0x5b9f44,_0x478ff0){if(_0x5b9f44[_0x7f2f('0x50')]['id']){delete _0x5b9f44[_0x7f2f('0x50')]['id'];}return db[_0x7f2f('0x2c')][_0x7f2f('0x46')]({'where':{'id':_0x5b9f44[_0x7f2f('0x51')]['id']}})[_0x7f2f('0x23')](handleEntityNotFound(_0x478ff0,null))[_0x7f2f('0x23')](saveUpdates(_0x5b9f44['body'],null))['then'](respondWithResult(_0x478ff0,null))['catch'](handleError(_0x478ff0,null));};exports[_0x7f2f('0x24')]=function(_0x61a033,_0x3d1715){return db[_0x7f2f('0x2c')][_0x7f2f('0x46')]({'where':{'id':_0x61a033[_0x7f2f('0x51')]['id']}})[_0x7f2f('0x23')](handleEntityNotFound(_0x3d1715,null))[_0x7f2f('0x23')](removeEntity(_0x3d1715,null))['catch'](handleError(_0x3d1715,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 15aed93..a4db00d 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 _0x1597=['./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xb5f82b,_0x18b88a){var _0x5acaeb=function(_0x49be77){while(--_0x49be77){_0xb5f82b['push'](_0xb5f82b['shift']());}};_0x5acaeb(++_0x18b88a);}(_0x1597,0x13b));var _0x7159=function(_0x2253ea,_0x6320e){_0x2253ea=_0x2253ea-0x0;var _0x2d046c=_0x1597[_0x2253ea];return _0x2d046c;};'use strict';var _=require(_0x7159('0x0'));var util=require(_0x7159('0x1'));var logger=require(_0x7159('0x2'))(_0x7159('0x3'));var moment=require(_0x7159('0x4'));var BPromise=require(_0x7159('0x5'));var rp=require(_0x7159('0x6'));var fs=require('fs');var path=require(_0x7159('0x7'));var rimraf=require(_0x7159('0x8'));var config=require('../../config/environment');var attributes=require(_0x7159('0x9'));module[_0x7159('0xa')]=function(_0x1e0393,_0xfe08bf){return _0x1e0393[_0x7159('0xb')](_0x7159('0xc'),attributes,{'tableName':_0x7159('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7159('0xe'),'fields':[_0x7159('0xf'),_0x7159('0x10')]},{'unique':!![],'name':_0x7159('0x11'),'fields':[_0x7159('0xf'),_0x7159('0x12')]},{'unique':!![],'name':_0x7159('0x13'),'fields':['name',_0x7159('0x14')]},{'unique':!![],'name':_0x7159('0x15'),'fields':[_0x7159('0xf'),'SmsAccountId']},{'unique':!![],'name':_0x7159('0x16'),'fields':['name',_0x7159('0x17')]},{'unique':!![],'name':_0x7159('0x18'),'fields':[_0x7159('0xf'),'OpenchannelAccountId']},{'unique':!![],'name':_0x7159('0x19'),'fields':[_0x7159('0xf'),_0x7159('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee4c=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','Disposition','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee4c,0x1cc));var _0xcee4=function(_0x3c26cc,_0xc3aa5f){_0x3c26cc=_0x3c26cc-0x0;var _0x3d918f=_0xee4c[_0x3c26cc];return _0x3d918f;};'use strict';var _=require(_0xcee4('0x0'));var util=require(_0xcee4('0x1'));var logger=require('../../config/logger')(_0xcee4('0x2'));var moment=require(_0xcee4('0x3'));var BPromise=require(_0xcee4('0x4'));var rp=require(_0xcee4('0x5'));var fs=require('fs');var path=require(_0xcee4('0x6'));var rimraf=require(_0xcee4('0x7'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xcee4('0x8')]=function(_0x5ec5b8,_0x470f9f){return _0x5ec5b8[_0xcee4('0x9')](_0xcee4('0xa'),attributes,{'tableName':_0xcee4('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xcee4('0xc'),'fields':[_0xcee4('0xd'),'ListId']},{'unique':!![],'name':_0xcee4('0xe'),'fields':['name',_0xcee4('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0xcee4('0xd'),'MailAccountId']},{'unique':!![],'name':_0xcee4('0x10'),'fields':[_0xcee4('0xd'),_0xcee4('0x11')]},{'unique':!![],'name':_0xcee4('0x12'),'fields':[_0xcee4('0xd'),'FaxAccountId']},{'unique':!![],'name':_0xcee4('0x13'),'fields':[_0xcee4('0xd'),_0xcee4('0x14')]},{'unique':!![],'name':_0xcee4('0x15'),'fields':[_0xcee4('0xd'),_0xcee4('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 ffbf706..0792eff 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(_0x3cd94f,_0x440360){var _0x3d93fd=function(_0x2efcbd){while(--_0x2efcbd){_0x3cd94f['push'](_0x3cd94f['shift']());}};_0x3d93fd(++_0x440360);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','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(_0x4fe872,_0xe248c2){var _0x45aabd=function(_0x2c873a){while(--_0x2c873a){_0x4fe872['push'](_0x4fe872['shift']());}};_0x45aabd(++_0xe248c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index ced693c..e8dd7f7 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 _0x3493=['post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','show'];(function(_0x2faac9,_0x51a440){var _0x533f10=function(_0x21048e){while(--_0x21048e){_0x2faac9['push'](_0x2faac9['shift']());}};_0x533f10(++_0x51a440);}(_0x3493,0x1ab));var _0x3349=function(_0x45016e,_0x9517fb){_0x45016e=_0x45016e-0x0;var _0x260948=_0x3493[_0x45016e];return _0x260948;};'use strict';var multer=require(_0x3349('0x0'));var util=require(_0x3349('0x1'));var path=require('path');var timeout=require(_0x3349('0x2'));var express=require(_0x3349('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3349('0x4'));var interaction=require(_0x3349('0x5'));var config=require('../../config/environment');var controller=require('./disposition.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x3349('0x6')](),controller[_0x3349('0x7')]);router[_0x3349('0x8')]('/',auth[_0x3349('0x6')](),controller[_0x3349('0x9')]);router[_0x3349('0xa')](_0x3349('0xb'),auth['isAuthenticated'](),controller[_0x3349('0xc')]);router['delete'](_0x3349('0xb'),auth[_0x3349('0x6')](),controller[_0x3349('0xd')]);module[_0x3349('0xe')]=router; \ No newline at end of file +var _0x3f35=['index','/:id','show','post','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x18b9a8,_0x1770b6){var _0x4a0a8f=function(_0x80ea93){while(--_0x80ea93){_0x18b9a8['push'](_0x18b9a8['shift']());}};_0x4a0a8f(++_0x1770b6);}(_0x3f35,0x90));var _0x53f3=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x3f35[_0x26b80e];return _0x84a8a8;};'use strict';var multer=require(_0x53f3('0x0'));var util=require(_0x53f3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x53f3('0x2'));var router=express[_0x53f3('0x3')]();var fs_extra=require(_0x53f3('0x4'));var auth=require(_0x53f3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x53f3('0x6'));var controller=require('./disposition.controller');router[_0x53f3('0x7')]('/',auth[_0x53f3('0x8')](),controller[_0x53f3('0x9')]);router['get'](_0x53f3('0xa'),auth[_0x53f3('0x8')](),controller[_0x53f3('0xb')]);router[_0x53f3('0xc')]('/',auth[_0x53f3('0x8')](),controller['create']);router[_0x53f3('0xd')](_0x53f3('0xa'),auth[_0x53f3('0x8')](),controller[_0x53f3('0xe')]);router['delete'](_0x53f3('0xa'),auth[_0x53f3('0x8')](),controller[_0x53f3('0xf')]);module[_0x53f3('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 18c6a9e..53cb6db 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 _0x1b00=['mandatoryDispositionPauseId','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','7200','9600','12000','14400','4800','SIP','IAX','DADHI','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'];(function(_0x1a1e8c,_0x3d2df3){var _0x29b0c9=function(_0xb4f77e){while(--_0xb4f77e){_0x1a1e8c['push'](_0x1a1e8c['shift']());}};_0x29b0c9(++_0x3d2df3);}(_0x1b00,0xc7));var _0x01b0=function(_0x369395,_0x247081){_0x369395=_0x369395-0x0;var _0x41748e=_0x1b00[_0x369395];return _0x41748e;};'use strict';var Sequelize=require(_0x01b0('0x0'));module['exports']={'name':{'type':Sequelize[_0x01b0('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x01b0('0x2')](_0x01b0('0x3'),'no'),'defaultValue':_0x01b0('0x3')},'headerinfo':{'type':Sequelize[_0x01b0('0x1')],'defaultValue':_0x01b0('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x01b0('0x2')](_0x01b0('0x5'),'4800',_0x01b0('0x6'),_0x01b0('0x7'),_0x01b0('0x8'),_0x01b0('0x9')),'defaultValue':_0x01b0('0xa')},'maxrate':{'type':Sequelize[_0x01b0('0x2')](_0x01b0('0x5'),_0x01b0('0xa'),_0x01b0('0x6'),_0x01b0('0x7'),_0x01b0('0x8'),_0x01b0('0x9')),'defaultValue':_0x01b0('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x01b0('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x01b0('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x01b0('0x2')](_0x01b0('0xb'),_0x01b0('0xc'),_0x01b0('0xd'),'KHOMP'),'defaultValue':_0x01b0('0xb')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x01b0('0xe')],'defaultValue':function(){return _0x01b0('0xf');}},'notificationSound':{'type':Sequelize[_0x01b0('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x01b0('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x01b0('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x01b0('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x01b0('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x01b0('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0x01b0('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x01b0('0x13'),'set':function(_0xfe10b0){if(!_0xfe10b0)this[_0x01b0('0x14')](_0x01b0('0x15'),null);this['setDataValue']('mandatoryDisposition',_0xfe10b0);}}}; \ No newline at end of file +var _0x3a3d=['SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDisposition','sequelize','STRING','yes','localstationid','ENUM','2400','4800','9600','12000','14400','v17,v27,v29','INTEGER'];(function(_0x3e59c2,_0x4c6d36){var _0x16cc92=function(_0x494973){while(--_0x494973){_0x3e59c2['push'](_0x3e59c2['shift']());}};_0x16cc92(++_0x4c6d36);}(_0x3a3d,0xb1));var _0xd3a3=function(_0x5ccfa7,_0x54d55f){_0x5ccfa7=_0x5ccfa7-0x0;var _0x456801=_0x3a3d[_0x5ccfa7];return _0x456801;};'use strict';var Sequelize=require(_0xd3a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3a3('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xd3a3('0x2')},'headerinfo':{'type':Sequelize[_0xd3a3('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xd3a3('0x1')],'unique':_0xd3a3('0x3')},'minrate':{'type':Sequelize[_0xd3a3('0x4')](_0xd3a3('0x5'),_0xd3a3('0x6'),'7200',_0xd3a3('0x7'),_0xd3a3('0x8'),_0xd3a3('0x9')),'defaultValue':_0xd3a3('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400','4800','7200',_0xd3a3('0x7'),_0xd3a3('0x8'),_0xd3a3('0x9')),'defaultValue':_0xd3a3('0x9')},'modem':{'type':Sequelize[_0xd3a3('0x1')],'defaultValue':_0xd3a3('0xa')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd3a3('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd3a3('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd3a3('0x4')](_0xd3a3('0xc'),_0xd3a3('0xd'),_0xd3a3('0xe'),_0xd3a3('0xf')),'defaultValue':_0xd3a3('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd3a3('0x10')],'defaultValue':function(){return _0xd3a3('0x11');}},'notificationSound':{'type':Sequelize[_0xd3a3('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd3a3('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd3a3('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd3a3('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd3a3('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd3a3('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd3a3('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1c18d5){if(!_0x1c18d5)this[_0xd3a3('0x13')]('mandatoryDispositionPauseId',null);this[_0xd3a3('0x13')](_0xd3a3('0x14'),_0x1c18d5);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 8b9b393..80449d5 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 _0x7b0d=['system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','info','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./faxAccount.socket','register','jayson/promise','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','show','rawAttributes','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','findOne','length','findAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','FaxInteraction','CmContact','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','exten','localstationid','app'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7b0d,0x103));var _0xd7b0=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7b0d[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xd7b0('0x0'));var rimraf=require(_0xd7b0('0x1'));var zipdir=require(_0xd7b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7b0('0x3'));var moment=require(_0xd7b0('0x4'));var BPromise=require(_0xd7b0('0x5'));var Mustache=require('mustache');var util=require(_0xd7b0('0x6'));var path=require(_0xd7b0('0x7'));var sox=require(_0xd7b0('0x8'));var csv=require(_0xd7b0('0x9'));var ejs=require(_0xd7b0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7b0('0xb'));var squel=require(_0xd7b0('0xc'));var crypto=require('crypto');var jsforce=require(_0xd7b0('0xd'));var deskjs=require(_0xd7b0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd7b0('0xf'));var Papa=require(_0xd7b0('0x10'));var Redis=require('ioredis');var authService=require(_0xd7b0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7b0('0x12'));var logger=require(_0xd7b0('0x13'))(_0xd7b0('0x14'));var utils=require(_0xd7b0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd7b0('0x16'));var db=require(_0xd7b0('0x17'))['db'];config[_0xd7b0('0x18')]=_[_0xd7b0('0x19')](config[_0xd7b0('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd7b0('0x18')]));require(_0xd7b0('0x1a'))[_0xd7b0('0x1b')](socket);var jayson=require(_0xd7b0('0x1c'));var client=jayson[_0xd7b0('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xd7b0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3953ee,_0x10d36b,_0x358a09,_0x5a9b95){return new BPromise(function(_0x12f0ca,_0x4cf30b){var _0x3c1210=_0x5a9b95||client;return _0x3c1210[_0xd7b0('0x1e')](_0x3953ee,_0x358a09)[_0xd7b0('0x1f')](function(_0x13b9d6){logger['info'](_0xd7b0('0x20'),_0x10d36b,_0xd7b0('0x21'));logger[_0xd7b0('0x22')](_0xd7b0('0x23'),_0x10d36b,_0xd7b0('0x21'),JSON[_0xd7b0('0x24')](_0x13b9d6));if(_0x13b9d6[_0xd7b0('0x25')]){if(_0x13b9d6[_0xd7b0('0x25')]['code']===0x1f4){logger[_0xd7b0('0x25')](_0xd7b0('0x20'),_0x10d36b,_0x13b9d6[_0xd7b0('0x25')][_0xd7b0('0x26')]);return _0x4cf30b(_0x13b9d6[_0xd7b0('0x25')][_0xd7b0('0x26')]);}logger[_0xd7b0('0x25')](_0xd7b0('0x20'),_0x10d36b,_0x13b9d6[_0xd7b0('0x25')][_0xd7b0('0x26')]);return _0x12f0ca(_0x13b9d6['error'][_0xd7b0('0x26')]);}else{logger['info'](_0xd7b0('0x20'),_0x10d36b,_0xd7b0('0x21'));_0x12f0ca(_0x13b9d6[_0xd7b0('0x27')][_0xd7b0('0x26')]);}})['catch'](function(_0x177819){logger[_0xd7b0('0x25')](_0xd7b0('0x20'),_0x10d36b,_0x177819);_0x4cf30b(_0x177819);});});}function respondWithStatusCode(_0x3df4d2,_0x586353){_0x586353=_0x586353||0xcc;return function(_0x7bf7ca){if(_0x7bf7ca){return _0x3df4d2[_0xd7b0('0x28')](_0x586353);}return _0x3df4d2[_0xd7b0('0x29')](_0x586353)[_0xd7b0('0x2a')]();};}function respondWithResult(_0x538109,_0xa394d){_0xa394d=_0xa394d||0xc8;return function(_0x52b81a){if(_0x52b81a){return _0x538109[_0xd7b0('0x29')](_0xa394d)[_0xd7b0('0x2b')](_0x52b81a);}};}function respondWithFilteredResult(_0x1126ef,_0x52819a){return function(_0x1b92f8){if(_0x1b92f8){var _0x5e5044=typeof _0x52819a[_0xd7b0('0x2c')]===_0xd7b0('0x2d')&&typeof _0x52819a[_0xd7b0('0x2e')]==='undefined';var _0x266779=_0x1b92f8['count'];var _0x2efef8=_0x5e5044?0x0:_0x52819a[_0xd7b0('0x2c')];var _0x36bdb6=_0x5e5044?_0x1b92f8[_0xd7b0('0x2f')]:_0x52819a['offset']+_0x52819a[_0xd7b0('0x2e')];var _0x5c1e7a;if(_0x36bdb6>=_0x266779){_0x36bdb6=_0x266779;_0x5c1e7a=0xc8;}else{_0x5c1e7a=0xce;}_0x1126ef[_0xd7b0('0x29')](_0x5c1e7a);return _0x1126ef[_0xd7b0('0x30')](_0xd7b0('0x31'),_0x2efef8+'-'+_0x36bdb6+'/'+_0x266779)[_0xd7b0('0x2b')](_0x1b92f8);}return null;};}function patchUpdates(_0x4285a3){return function(_0x597885){try{jsonpatch[_0xd7b0('0x32')](_0x597885,_0x4285a3,!![]);}catch(_0x3295a4){return BPromise['reject'](_0x3295a4);}return _0x597885[_0xd7b0('0x33')]();};}function saveUpdates(_0x310ef5,_0x118299){return function(_0x4de8a2){if(_0x4de8a2){return _0x4de8a2[_0xd7b0('0x34')](_0x310ef5)[_0xd7b0('0x1f')](function(_0x5998b7){return _0x5998b7;});}return null;};}function removeEntity(_0x5c8a2e,_0x3a89ce){return function(_0x2951e6){if(_0x2951e6){return _0x2951e6[_0xd7b0('0x35')]()[_0xd7b0('0x1f')](function(){var _0x4ba251=_0x2951e6[_0xd7b0('0x36')]({'plain':!![]});var _0x548715='FaxAccounts';return db[_0xd7b0('0x37')][_0xd7b0('0x35')]({'where':{'type':_0x548715,'resourceId':_0x4ba251['id']}})[_0xd7b0('0x1f')](function(){return _0x2951e6;});})[_0xd7b0('0x1f')](function(){_0x5c8a2e[_0xd7b0('0x29')](0xcc)[_0xd7b0('0x2a')]();});}};}function handleEntityNotFound(_0x3535a2,_0x21281a){return function(_0x156ff1){if(!_0x156ff1){_0x3535a2[_0xd7b0('0x28')](0x194);}return _0x156ff1;};}function handleError(_0x5e3817,_0x2b1bde){_0x2b1bde=_0x2b1bde||0x1f4;return function(_0x19dafc){logger['error'](_0x19dafc[_0xd7b0('0x38')]);if(_0x19dafc[_0xd7b0('0x39')]){delete _0x19dafc[_0xd7b0('0x39')];}_0x5e3817[_0xd7b0('0x29')](_0x2b1bde)[_0xd7b0('0x3a')](_0x19dafc);};}exports['index']=function(_0xa6864b,_0x33aee4){var _0x4e0c3a={'include':[{'model':db[_0xd7b0('0x3b')],'as':_0xd7b0('0x3c')}]},_0x185b15={},_0x2223b4={'count':0x0,'rows':[]};var _0x34c3cc=_[_0xd7b0('0x3d')](db[_0xd7b0('0x3e')]['rawAttributes'],function(_0x253793){return{'name':_0x253793[_0xd7b0('0x3f')],'type':_0x253793[_0xd7b0('0x40')][_0xd7b0('0x41')]};});_0x185b15['model']=_[_0xd7b0('0x3d')](_0x34c3cc,'name');_0x185b15[_0xd7b0('0x42')]=_[_0xd7b0('0x43')](_0xa6864b['query']);_0x185b15['filters']=_[_0xd7b0('0x44')](_0x185b15[_0xd7b0('0x45')],_0x185b15[_0xd7b0('0x42')]);_0x4e0c3a[_0xd7b0('0x46')]=_['intersection'](_0x185b15[_0xd7b0('0x45')],qs[_0xd7b0('0x47')](_0xa6864b[_0xd7b0('0x42')]['fields']));_0x4e0c3a[_0xd7b0('0x46')]=_0x4e0c3a[_0xd7b0('0x46')]['length']?_0x4e0c3a[_0xd7b0('0x46')]:_0x185b15[_0xd7b0('0x45')];if(!_0xa6864b[_0xd7b0('0x42')][_0xd7b0('0x48')](_0xd7b0('0x49'))){_0x4e0c3a[_0xd7b0('0x2e')]=qs[_0xd7b0('0x2e')](_0xa6864b['query']['limit']);_0x4e0c3a[_0xd7b0('0x2c')]=qs['offset'](_0xa6864b[_0xd7b0('0x42')][_0xd7b0('0x2c')]);}_0x4e0c3a[_0xd7b0('0x4a')]=qs[_0xd7b0('0x4b')](_0xa6864b[_0xd7b0('0x42')]['sort']);_0x4e0c3a['where']=qs[_0xd7b0('0x4c')](_[_0xd7b0('0x4d')](_0xa6864b[_0xd7b0('0x42')],_0x185b15[_0xd7b0('0x4c')]),_0x34c3cc);if(_0xa6864b[_0xd7b0('0x42')][_0xd7b0('0x4e')]){_0x4e0c3a[_0xd7b0('0x4f')]=_['merge'](_0x4e0c3a[_0xd7b0('0x4f')],{'$or':_[_0xd7b0('0x3d')](_0x34c3cc,function(_0x1bea1f){if(_0x1bea1f[_0xd7b0('0x40')]!==_0xd7b0('0x50')){var _0x53735f={};_0x53735f[_0x1bea1f[_0xd7b0('0x39')]]={'$like':'%'+_0xa6864b[_0xd7b0('0x42')]['filter']+'%'};return _0x53735f;}})});}_0x4e0c3a=_[_0xd7b0('0x51')]({},_0x4e0c3a,_0xa6864b['options']);var _0x155c11={'where':_0x4e0c3a[_0xd7b0('0x4f')]};return db[_0xd7b0('0x3e')][_0xd7b0('0x2f')](_0x155c11)['then'](function(_0x3ff036){_0x2223b4[_0xd7b0('0x2f')]=_0x3ff036;if(_0xa6864b[_0xd7b0('0x42')][_0xd7b0('0x52')]){_0x4e0c3a[_0xd7b0('0x53')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x4e0c3a);})[_0xd7b0('0x1f')](function(_0x1cd16d){_0x2223b4['rows']=_0x1cd16d;return _0x2223b4;})['then'](respondWithFilteredResult(_0x33aee4,_0x4e0c3a))['catch'](handleError(_0x33aee4,null));};exports[_0xd7b0('0x54')]=function(_0x7a44d1,_0x5e2296){var _0x562223={'raw':![],'where':{'id':_0x7a44d1['params']['id']},'include':[{'model':db['Pause'],'as':_0xd7b0('0x3c')}]},_0x1e466b={};_0x1e466b[_0xd7b0('0x45')]=_[_0xd7b0('0x43')](db[_0xd7b0('0x3e')][_0xd7b0('0x55')]);_0x1e466b[_0xd7b0('0x42')]=_[_0xd7b0('0x43')](_0x7a44d1['query']);_0x1e466b[_0xd7b0('0x4c')]=_[_0xd7b0('0x44')](_0x1e466b[_0xd7b0('0x45')],_0x1e466b[_0xd7b0('0x42')]);_0x562223[_0xd7b0('0x46')]=_[_0xd7b0('0x44')](_0x1e466b[_0xd7b0('0x45')],qs[_0xd7b0('0x47')](_0x7a44d1[_0xd7b0('0x42')][_0xd7b0('0x47')]));_0x562223[_0xd7b0('0x46')]=_0x562223['attributes']['length']?_0x562223[_0xd7b0('0x46')]:_0x1e466b[_0xd7b0('0x45')];if(_0x7a44d1[_0xd7b0('0x42')][_0xd7b0('0x52')]){_0x562223['include']=[{'all':!![]}];}_0x562223=_[_0xd7b0('0x51')]({},_0x562223,_0x7a44d1[_0xd7b0('0x56')]);return db[_0xd7b0('0x3e')]['find'](_0x562223)[_0xd7b0('0x1f')](handleEntityNotFound(_0x5e2296,null))[_0xd7b0('0x1f')](respondWithResult(_0x5e2296,null))['catch'](handleError(_0x5e2296,null));};exports[_0xd7b0('0x57')]=function(_0x210a67,_0x41b3aa){return db[_0xd7b0('0x3e')][_0xd7b0('0x57')](_0x210a67[_0xd7b0('0x58')],{})[_0xd7b0('0x1f')](function(_0x147e58){var _0xf83570=_0x210a67['user'][_0xd7b0('0x36')]({'plain':!![]});if(!_0xf83570)throw new Error(_0xd7b0('0x59'));if(_0xf83570[_0xd7b0('0x5a')]===_0xd7b0('0x5b')){var _0x1e12e1=_0x147e58[_0xd7b0('0x36')]({'plain':!![]});var _0xdbe87a='FaxAccounts';return db['UserProfileSection'][_0xd7b0('0x5c')]({'where':{'name':_0xdbe87a,'userProfileId':_0xf83570[_0xd7b0('0x5d')]},'raw':!![]})[_0xd7b0('0x1f')](function(_0x18828b){if(_0x18828b&&_0x18828b['autoAssociation']===0x0){return db[_0xd7b0('0x37')][_0xd7b0('0x57')]({'name':_0x1e12e1[_0xd7b0('0x39')],'resourceId':_0x1e12e1['id'],'type':_0x18828b[_0xd7b0('0x39')],'sectionId':_0x18828b['id']},{})[_0xd7b0('0x1f')](function(){return _0x147e58;});}else{return _0x147e58;}})[_0xd7b0('0x5e')](function(_0x4b53d3){logger[_0xd7b0('0x25')](_0xd7b0('0x5f'),_0x4b53d3);throw _0x4b53d3;});}return _0x147e58;})[_0xd7b0('0x1f')](respondWithResult(_0x41b3aa,0xc9))[_0xd7b0('0x5e')](handleError(_0x41b3aa,null));};exports['update']=function(_0x296b92,_0x2afdbc){if(_0x296b92[_0xd7b0('0x58')]['id']){delete _0x296b92[_0xd7b0('0x58')]['id'];}return db[_0xd7b0('0x3e')][_0xd7b0('0x5c')]({'where':{'id':_0x296b92[_0xd7b0('0x60')]['id']},'include':[{'model':db[_0xd7b0('0x3b')],'as':_0xd7b0('0x3c')}]})['then'](handleEntityNotFound(_0x2afdbc,null))[_0xd7b0('0x1f')](saveUpdates(_0x296b92[_0xd7b0('0x58')],null))[_0xd7b0('0x1f')](respondWithResult(_0x2afdbc,null))['catch'](handleError(_0x2afdbc,null));};exports[_0xd7b0('0x35')]=function(_0x35aa5d,_0x11a80a){return db[_0xd7b0('0x3e')][_0xd7b0('0x5c')]({'where':{'id':_0x35aa5d['params']['id']}})['then'](handleEntityNotFound(_0x11a80a,null))[_0xd7b0('0x1f')](removeEntity(_0x11a80a,null))[_0xd7b0('0x5e')](handleError(_0x11a80a,null));};exports['describe']=function(_0x1034a7,_0x51aaeb){return db['FaxAccount'][_0xd7b0('0x61')]()['then'](respondWithResult(_0x51aaeb,null))['catch'](handleError(_0x51aaeb,null));};exports[_0xd7b0('0x62')]=function(_0x464d00,_0x2988ca,_0x3238ad){if(_0x464d00[_0xd7b0('0x58')]['id']){delete _0x464d00[_0xd7b0('0x58')]['id'];}return db[_0xd7b0('0x3e')][_0xd7b0('0x5c')]({'where':{'id':_0x464d00[_0xd7b0('0x60')]['id']}})['then'](handleEntityNotFound(_0x2988ca,null))[_0xd7b0('0x1f')](function(_0x1d6efe){if(_0x1d6efe){_0x464d00[_0xd7b0('0x58')][_0xd7b0('0x63')]=_0x1d6efe['id'];return db[_0xd7b0('0x64')][_0xd7b0('0x57')](_0x464d00[_0xd7b0('0x58')]);}})['then'](respondWithResult(_0x2988ca,null))[_0xd7b0('0x5e')](handleError(_0x2988ca,null));};exports['getDispositions']=function(_0x548d48,_0x414403,_0x45becf){var _0x131ce3={'raw':![],'where':{}};var _0x514e0c={};var _0x570a57={'count':0x0,'rows':[]};return db[_0xd7b0('0x3e')][_0xd7b0('0x65')]({'where':{'id':_0x548d48[_0xd7b0('0x60')]['id']}})[_0xd7b0('0x1f')](handleEntityNotFound(_0x414403,null))[_0xd7b0('0x1f')](function(_0x36b6d3){if(_0x36b6d3){_0x514e0c[_0xd7b0('0x45')]=_[_0xd7b0('0x43')](db[_0xd7b0('0x64')][_0xd7b0('0x55')]);_0x514e0c[_0xd7b0('0x42')]=_[_0xd7b0('0x43')](_0x548d48[_0xd7b0('0x42')]);_0x514e0c[_0xd7b0('0x4c')]=_[_0xd7b0('0x44')](_0x514e0c['model'],_0x514e0c[_0xd7b0('0x42')]);_0x131ce3[_0xd7b0('0x46')]=_[_0xd7b0('0x44')](_0x514e0c[_0xd7b0('0x45')],qs[_0xd7b0('0x47')](_0x548d48[_0xd7b0('0x42')][_0xd7b0('0x47')]));_0x131ce3[_0xd7b0('0x46')]=_0x131ce3[_0xd7b0('0x46')][_0xd7b0('0x66')]?_0x131ce3[_0xd7b0('0x46')]:_0x514e0c[_0xd7b0('0x45')];if(!_0x548d48[_0xd7b0('0x42')][_0xd7b0('0x48')](_0xd7b0('0x49'))){_0x131ce3[_0xd7b0('0x2e')]=qs[_0xd7b0('0x2e')](_0x548d48[_0xd7b0('0x42')][_0xd7b0('0x2e')]);_0x131ce3['offset']=qs[_0xd7b0('0x2c')](_0x548d48[_0xd7b0('0x42')][_0xd7b0('0x2c')]);}_0x131ce3[_0xd7b0('0x4a')]=qs[_0xd7b0('0x4b')](_0x548d48[_0xd7b0('0x42')]['sort']);_0x131ce3[_0xd7b0('0x4f')]=qs[_0xd7b0('0x4c')](_[_0xd7b0('0x4d')](_0x548d48[_0xd7b0('0x42')],_0x514e0c[_0xd7b0('0x4c')]));_0x131ce3['where'][_0xd7b0('0x63')]=_0x36b6d3['id'];if(_0x548d48[_0xd7b0('0x42')]['filter']){_0x131ce3[_0xd7b0('0x4f')]=_[_0xd7b0('0x51')](_0x131ce3[_0xd7b0('0x4f')],{'$or':_[_0xd7b0('0x3d')](_0x131ce3[_0xd7b0('0x46')],function(_0x4172fb){var _0x163927={};_0x163927[_0x4172fb]={'$like':'%'+_0x548d48[_0xd7b0('0x42')][_0xd7b0('0x4e')]+'%'};return _0x163927;})});}_0x131ce3=_[_0xd7b0('0x51')]({},_0x131ce3,_0x548d48[_0xd7b0('0x56')]);return db[_0xd7b0('0x64')][_0xd7b0('0x2f')]({'where':_0x131ce3[_0xd7b0('0x4f')]})[_0xd7b0('0x1f')](function(_0x5dc611){_0x570a57[_0xd7b0('0x2f')]=_0x5dc611;if(_0x548d48[_0xd7b0('0x42')]['includeAll']){_0x131ce3[_0xd7b0('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xd7b0('0x67')](_0x131ce3);})['then'](function(_0x112df0){_0x570a57[_0xd7b0('0x68')]=_0x112df0;return _0x570a57;});}})[_0xd7b0('0x1f')](respondWithFilteredResult(_0x414403,_0x131ce3))[_0xd7b0('0x5e')](handleError(_0x414403,null));};exports[_0xd7b0('0x69')]=function(_0x7d47d4,_0x2b5ebe,_0x29d0ea){return db[_0xd7b0('0x3e')][_0xd7b0('0x5c')]({'where':{'id':_0x7d47d4[_0xd7b0('0x60')]['id']}})[_0xd7b0('0x1f')](handleEntityNotFound(_0x2b5ebe,null))[_0xd7b0('0x1f')](function(_0x7bf97e){if(_0x7bf97e){return _0x7bf97e[_0xd7b0('0x69')](_0x7d47d4[_0xd7b0('0x42')][_0xd7b0('0x6a')]);}})[_0xd7b0('0x1f')](respondWithStatusCode(_0x2b5ebe,null))['catch'](handleError(_0x2b5ebe,null));};exports['addAnswer']=function(_0x3529ad,_0x3558d3,_0x1f9c18){if(_0x3529ad['body']['id']){delete _0x3529ad['body']['id'];}return db[_0xd7b0('0x3e')][_0xd7b0('0x5c')]({'where':{'id':_0x3529ad[_0xd7b0('0x60')]['id']}})['then'](handleEntityNotFound(_0x3558d3,null))[_0xd7b0('0x1f')](function(_0x1f0b0f){if(_0x1f0b0f){_0x3529ad['body']['FaxAccountId']=_0x1f0b0f['id'];return db[_0xd7b0('0x6b')][_0xd7b0('0x57')](_0x3529ad[_0xd7b0('0x58')]);}})[_0xd7b0('0x1f')](respondWithResult(_0x3558d3,null))[_0xd7b0('0x5e')](handleError(_0x3558d3,null));};exports[_0xd7b0('0x6c')]=function(_0x5ece29,_0x460d0f,_0x3129f6){var _0x1f0e93={'raw':![],'where':{}};var _0x329823={};var _0x52bd18={'count':0x0,'rows':[]};return db[_0xd7b0('0x3e')][_0xd7b0('0x65')]({'where':{'id':_0x5ece29[_0xd7b0('0x60')]['id']}})[_0xd7b0('0x1f')](handleEntityNotFound(_0x460d0f,null))['then'](function(_0x2db741){if(_0x2db741){_0x329823[_0xd7b0('0x45')]=_[_0xd7b0('0x43')](db[_0xd7b0('0x6b')][_0xd7b0('0x55')]);_0x329823[_0xd7b0('0x42')]=_[_0xd7b0('0x43')](_0x5ece29[_0xd7b0('0x42')]);_0x329823['filters']=_[_0xd7b0('0x44')](_0x329823[_0xd7b0('0x45')],_0x329823[_0xd7b0('0x42')]);_0x1f0e93[_0xd7b0('0x46')]=_[_0xd7b0('0x44')](_0x329823[_0xd7b0('0x45')],qs[_0xd7b0('0x47')](_0x5ece29[_0xd7b0('0x42')][_0xd7b0('0x47')]));_0x1f0e93[_0xd7b0('0x46')]=_0x1f0e93[_0xd7b0('0x46')][_0xd7b0('0x66')]?_0x1f0e93['attributes']:_0x329823[_0xd7b0('0x45')];if(!_0x5ece29[_0xd7b0('0x42')][_0xd7b0('0x48')](_0xd7b0('0x49'))){_0x1f0e93['limit']=qs[_0xd7b0('0x2e')](_0x5ece29[_0xd7b0('0x42')][_0xd7b0('0x2e')]);_0x1f0e93[_0xd7b0('0x2c')]=qs[_0xd7b0('0x2c')](_0x5ece29[_0xd7b0('0x42')][_0xd7b0('0x2c')]);}_0x1f0e93[_0xd7b0('0x4a')]=qs['sort'](_0x5ece29[_0xd7b0('0x42')][_0xd7b0('0x4b')]);_0x1f0e93[_0xd7b0('0x4f')]=qs['filters'](_[_0xd7b0('0x4d')](_0x5ece29[_0xd7b0('0x42')],_0x329823['filters']));_0x1f0e93[_0xd7b0('0x4f')][_0xd7b0('0x63')]=_0x2db741['id'];if(_0x5ece29[_0xd7b0('0x42')][_0xd7b0('0x4e')]){_0x1f0e93[_0xd7b0('0x4f')]=_[_0xd7b0('0x51')](_0x1f0e93['where'],{'$or':_[_0xd7b0('0x3d')](_0x1f0e93[_0xd7b0('0x46')],function(_0x42e27b){var _0x3667d6={};_0x3667d6[_0x42e27b]={'$like':'%'+_0x5ece29[_0xd7b0('0x42')][_0xd7b0('0x4e')]+'%'};return _0x3667d6;})});}_0x1f0e93=_[_0xd7b0('0x51')]({},_0x1f0e93,_0x5ece29[_0xd7b0('0x56')]);return db[_0xd7b0('0x6b')]['count']({'where':_0x1f0e93[_0xd7b0('0x4f')]})[_0xd7b0('0x1f')](function(_0x480b5a){_0x52bd18[_0xd7b0('0x2f')]=_0x480b5a;if(_0x5ece29[_0xd7b0('0x42')][_0xd7b0('0x52')]){_0x1f0e93[_0xd7b0('0x53')]=[{'all':!![]}];}return db[_0xd7b0('0x6b')][_0xd7b0('0x67')](_0x1f0e93);})[_0xd7b0('0x1f')](function(_0x236869){_0x52bd18['rows']=_0x236869;return _0x52bd18;});}})[_0xd7b0('0x1f')](respondWithFilteredResult(_0x460d0f,_0x1f0e93))[_0xd7b0('0x5e')](handleError(_0x460d0f,null));};exports[_0xd7b0('0x6d')]=function(_0x372675,_0x11832d,_0x54837b){return db[_0xd7b0('0x3e')][_0xd7b0('0x5c')]({'where':{'id':_0x372675['params']['id']}})['then'](handleEntityNotFound(_0x11832d,null))[_0xd7b0('0x1f')](function(_0x50cf19){if(_0x50cf19){return _0x50cf19[_0xd7b0('0x6d')](_0x372675[_0xd7b0('0x42')][_0xd7b0('0x6a')]);}})[_0xd7b0('0x1f')](respondWithStatusCode(_0x11832d,null))[_0xd7b0('0x5e')](handleError(_0x11832d,null));};exports[_0xd7b0('0x6e')]=function(_0x79fab0,_0x258ad1,_0x7cd225){return db['FaxInteraction']['find']({'where':{'id':_0x79fab0[_0xd7b0('0x60')]['id']}})[_0xd7b0('0x1f')](handleEntityNotFound(_0x258ad1,null))[_0xd7b0('0x1f')](function(_0x413219){if(_0x413219){return _0x413219[_0xd7b0('0x6e')](_0x79fab0['body'][_0xd7b0('0x6a')],_[_0xd7b0('0x6f')](_0x79fab0[_0xd7b0('0x58')],[_0xd7b0('0x6a'),'id'])||{});}})[_0xd7b0('0x1f')](respondWithResult(_0x258ad1,null))[_0xd7b0('0x5e')](handleError(_0x258ad1,null));};exports['getInteractions']=function(_0x189922,_0x3e2cae,_0x375b11){var _0x242e94={'raw':![],'where':{}};var _0x1f58d1={};var _0xbbc3d1={'count':0x0,'rows':[]};return db[_0xd7b0('0x3e')][_0xd7b0('0x65')]({'where':{'id':_0x189922['params']['id']}})[_0xd7b0('0x1f')](handleEntityNotFound(_0x3e2cae,null))[_0xd7b0('0x1f')](function(_0x109106){if(_0x109106){_0x1f58d1['model']=_[_0xd7b0('0x43')](db[_0xd7b0('0x70')][_0xd7b0('0x55')]);_0x1f58d1['query']=_[_0xd7b0('0x43')](_0x189922[_0xd7b0('0x42')]);_0x1f58d1[_0xd7b0('0x4c')]=_['intersection'](_0x1f58d1['model'],_0x1f58d1[_0xd7b0('0x42')]);_0x242e94[_0xd7b0('0x46')]=_[_0xd7b0('0x44')](_0x1f58d1[_0xd7b0('0x45')],qs[_0xd7b0('0x47')](_0x189922[_0xd7b0('0x42')]['fields']));_0x242e94['attributes']=_0x242e94['attributes'][_0xd7b0('0x66')]?_0x242e94[_0xd7b0('0x46')]:_0x1f58d1[_0xd7b0('0x45')];if(!_0x189922[_0xd7b0('0x42')]['hasOwnProperty']('nolimit')){_0x242e94[_0xd7b0('0x2e')]=qs[_0xd7b0('0x2e')](_0x189922[_0xd7b0('0x42')][_0xd7b0('0x2e')]);_0x242e94[_0xd7b0('0x2c')]=qs[_0xd7b0('0x2c')](_0x189922['query'][_0xd7b0('0x2c')]);}_0x242e94[_0xd7b0('0x4a')]=qs[_0xd7b0('0x4b')](_0x189922[_0xd7b0('0x42')]['sort']);_0x242e94[_0xd7b0('0x4f')]=qs[_0xd7b0('0x4c')](_[_0xd7b0('0x4d')](_0x189922['query'],_0x1f58d1[_0xd7b0('0x4c')]));_0x242e94['where'][_0xd7b0('0x63')]=_0x109106['id'];if(_0x189922[_0xd7b0('0x42')][_0xd7b0('0x4e')]){_0x242e94[_0xd7b0('0x4f')]=_[_0xd7b0('0x51')](_0x242e94[_0xd7b0('0x4f')],{'$or':_[_0xd7b0('0x3d')](_0x242e94[_0xd7b0('0x46')],function(_0x42f669){var _0x18598a={};_0x18598a[_0x42f669]={'$like':'%'+_0x189922[_0xd7b0('0x42')]['filter']+'%'};return _0x18598a;})});}_0x242e94=_[_0xd7b0('0x51')]({},_0x242e94,_0x189922[_0xd7b0('0x56')]);return db[_0xd7b0('0x70')][_0xd7b0('0x2f')]({'where':_0x242e94[_0xd7b0('0x4f')]})[_0xd7b0('0x1f')](function(_0x39cbf9){_0xbbc3d1['count']=_0x39cbf9;if(_0x189922['query'][_0xd7b0('0x52')]){_0x242e94[_0xd7b0('0x53')]=[{'model':db[_0xd7b0('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xd7b0('0x72'),'attributes':[_0xd7b0('0x39'),_0xd7b0('0x73'),_0xd7b0('0x74')],'required':![]},{'model':db['Tag'],'as':_0xd7b0('0x75'),'attributes':['id',_0xd7b0('0x39'),_0xd7b0('0x76')],'where':_0x189922[_0xd7b0('0x42')][_0xd7b0('0x77')]?{'id':_0x189922[_0xd7b0('0x42')][_0xd7b0('0x77')]}:undefined,'required':_0x189922[_0xd7b0('0x42')][_0xd7b0('0x77')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x242e94);})[_0xd7b0('0x1f')](function(_0x18f7f1){_0xbbc3d1[_0xd7b0('0x68')]=_0x18f7f1;return _0xbbc3d1;});}})[_0xd7b0('0x1f')](respondWithFilteredResult(_0x3e2cae,_0x242e94))[_0xd7b0('0x5e')](handleError(_0x3e2cae,null));};exports[_0xd7b0('0x78')]=function(_0x165977,_0x30325f){var _0x4f0aca=_0x165977['params']['id'];var _0x20f1f2=_0x165977['body'];var _0x1c6b61=0xc8;var _0x32a253=null;return db[_0xd7b0('0x79')][_0xd7b0('0x7a')]({'isolationLevel':db[_0xd7b0('0x79')][_0xd7b0('0x7b')][_0xd7b0('0x7c')][_0xd7b0('0x7d')]},function(_0x30d29d){return db[_0xd7b0('0x3e')][_0xd7b0('0x65')]({'where':{'id':_0x4f0aca},'transaction':_0x30d29d})['then'](function(_0x2a4817){if(_0x2a4817){return db[_0xd7b0('0x7e')][_0xd7b0('0x35')]({'where':{'FaxAccountId':_0x4f0aca},'transaction':_0x30d29d})[_0xd7b0('0x1f')](function(){var _0x4e397e=_[_0xd7b0('0x3d')](_0x20f1f2,function(_0x51e833){_0x51e833[_0xd7b0('0x63')]=_0x4f0aca;return _0x51e833;});return db['FaxApplication'][_0xd7b0('0x7f')](_0x4e397e,{'transaction':_0x30d29d});});}else{_0x1c6b61=0x194;_0x32a253=[];}});})['then'](function(){if(_0x1c6b61!==0x194){return db['FaxApplication'][_0xd7b0('0x80')]({'where':{'FaxAccountId':_0x4f0aca},'order':_0xd7b0('0x81')})[_0xd7b0('0x1f')](function(_0x16747d){_0x32a253=_0x16747d;});}})[_0xd7b0('0x5e')](function(_0x16215f){_0x1c6b61=0x1f4;logger[_0xd7b0('0x25')](_0x16215f['stack']);if(_0x16215f['name']){delete _0x16215f['name'];}_0x32a253=_0x16215f;})[_0xd7b0('0x82')](function(){if(_0x32a253===null){_0x30325f[_0xd7b0('0x28')](_0x1c6b61);}else{if(_0x1c6b61===0x1f4){_0x30325f['status'](_0x1c6b61)[_0xd7b0('0x3a')](_0x32a253);}else{_0x30325f[_0xd7b0('0x29')](_0x1c6b61)['json'](_0x32a253);}}});};exports['getApplications']=function(_0x5efea4,_0x3c6c6e,_0x3e7030){var _0x53564c={};var _0x18f23c={};var _0x58eeef;var _0x519707;return db[_0xd7b0('0x3e')][_0xd7b0('0x65')]({'where':{'id':_0x5efea4[_0xd7b0('0x60')]['id']}})[_0xd7b0('0x1f')](handleEntityNotFound(_0x3c6c6e,null))[_0xd7b0('0x1f')](function(_0x1a96fb){if(_0x1a96fb){_0x58eeef=_0x1a96fb;_0x18f23c[_0xd7b0('0x45')]=_[_0xd7b0('0x43')](db[_0xd7b0('0x7e')][_0xd7b0('0x55')]);_0x18f23c['query']=_[_0xd7b0('0x43')](_0x5efea4['query']);_0x18f23c[_0xd7b0('0x4c')]=_['intersection'](_0x18f23c[_0xd7b0('0x45')],_0x18f23c[_0xd7b0('0x42')]);_0x53564c[_0xd7b0('0x46')]=_['intersection'](_0x18f23c[_0xd7b0('0x45')],qs[_0xd7b0('0x47')](_0x5efea4[_0xd7b0('0x42')][_0xd7b0('0x47')]));_0x53564c['attributes']=_0x53564c[_0xd7b0('0x46')]['length']?_0x53564c[_0xd7b0('0x46')]:_0x18f23c['model'];_0x53564c['order']=qs[_0xd7b0('0x4b')](_0x5efea4['query']['sort']);_0x53564c[_0xd7b0('0x4f')]=qs['filters'](_[_0xd7b0('0x4d')](_0x5efea4[_0xd7b0('0x42')],_0x18f23c['filters']));if(_0x5efea4['query']['filter']){_0x53564c[_0xd7b0('0x4f')]=_[_0xd7b0('0x51')](_0x53564c[_0xd7b0('0x4f')],{'$or':_[_0xd7b0('0x3d')](_0x53564c[_0xd7b0('0x46')],function(_0xc0658a){var _0x22612c={};_0x22612c[_0xc0658a]={'$like':'%'+_0x5efea4[_0xd7b0('0x42')]['filter']+'%'};return _0x22612c;})});}_0x53564c=_[_0xd7b0('0x51')]({},_0x53564c,_0x5efea4['options']);return _0x58eeef[_0xd7b0('0x83')](_0x53564c);}})[_0xd7b0('0x1f')](function(_0xaf6eee){if(_0xaf6eee){_0x519707=_0xaf6eee[_0xd7b0('0x66')];if(!_0x5efea4[_0xd7b0('0x42')][_0xd7b0('0x48')](_0xd7b0('0x49'))){_0x53564c[_0xd7b0('0x2e')]=qs[_0xd7b0('0x2e')](_0x5efea4[_0xd7b0('0x42')][_0xd7b0('0x2e')]);_0x53564c['offset']=qs[_0xd7b0('0x2c')](_0x5efea4[_0xd7b0('0x42')][_0xd7b0('0x2c')]);}return _0x58eeef['getApplications'](_0x53564c);}})[_0xd7b0('0x1f')](function(_0x413a26){if(_0x413a26){return _0x413a26?{'count':_0x519707,'rows':_0x413a26}:null;}})[_0xd7b0('0x1f')](respondWithResult(_0x3c6c6e,null))[_0xd7b0('0x5e')](handleError(_0x3c6c6e,null));};function Extension(_0x145783,_0x33a947,_0x769eb6,_0x4fa497){this['context']='from-voip-provider';this[_0xd7b0('0x84')]=_0x145783[_0xd7b0('0x85')];this[_0xd7b0('0x86')]=_0x4fa497;this[_0xd7b0('0x40')]=_0xd7b0('0x87');this[_0xd7b0('0x88')]=_0xd7b0('0x89');this['FaxAccountId']=_0x145783['id'];this[_0xd7b0('0x81')]=_0x33a947;this[_0xd7b0('0x8a')]=_0x769eb6;}function createExtensionsReciveFax(_0x563132){var _0x5490db=0x1;var _0x17a238=[];_0x17a238[_0xd7b0('0x8b')](new Extension(_0x563132,_0x5490db,'',_0xd7b0('0x8c')));_0x5490db+=0x1;_0x17a238['push'](new Extension(_0x563132,_0x5490db,_0xd7b0('0x8d'),_0xd7b0('0x8e')));_0x5490db+=0x1;for(var _0x190e57 in _0x563132){if(_0x563132[_0xd7b0('0x48')](_0x190e57)&&(_0x190e57===_0xd7b0('0x8f')||_0x190e57==='localstationid'||_0x190e57===_0xd7b0('0x90')||_0x190e57==='faxdetect'||_0x190e57===_0xd7b0('0x91')||_0x190e57===_0xd7b0('0x92')||_0x190e57===_0xd7b0('0x93')||_0x190e57===_0xd7b0('0x94')||_0x190e57===_0xd7b0('0x95'))){_0x17a238[_0xd7b0('0x8b')](new Extension(_0x563132,_0x5490db,'FAXOPT('+_0x190e57+')='+_0x563132[_0x190e57],_0xd7b0('0x8e')));_0x5490db+=0x1;}}_0x17a238[_0xd7b0('0x8b')](new Extension(_0x563132,_0x5490db,'6',_0xd7b0('0x96')));_0x5490db+=0x1;_0x17a238[_0xd7b0('0x8b')](new Extension(_0x563132,_0x5490db,_0xd7b0('0x97'),_0xd7b0('0x98')));_0x5490db=0x0;return _0x17a238;}exports[_0xd7b0('0x99')]=function(_0xeb68f2,_0x5dbd5e,_0x439de1){var _0x208f3c;return db['sequelize'][_0xd7b0('0x7a')](function(_0x12269d){return db[_0xd7b0('0x3e')][_0xd7b0('0x57')](_0xeb68f2[_0xd7b0('0x58')],{'transaction':_0x12269d})[_0xd7b0('0x1f')](function(_0x408cf5){_0x208f3c=_0x408cf5[_0xd7b0('0x36')]({'plain':!![]});return db[_0xd7b0('0x9a')][_0xd7b0('0x7f')](createExtensionsReciveFax(_0x208f3c),{'transaction':_0x12269d});});})[_0xd7b0('0x1f')](function(){return _0x208f3c;})[_0xd7b0('0x1f')](respondWithResult(_0x5dbd5e,null))[_0xd7b0('0x5e')](handleError(_0x5dbd5e,null));};exports[_0xd7b0('0x9b')]=function(_0x632af3,_0x4b6820,_0x579651){var _0x312d35;return db['sequelize'][_0xd7b0('0x7a')](function(_0x62b8d6){return db[_0xd7b0('0x3e')][_0xd7b0('0x34')](_0x632af3[_0xd7b0('0x58')],{'where':{'id':_0x632af3[_0xd7b0('0x58')]['id']},'transaction':_0x62b8d6})[_0xd7b0('0x1f')](function(_0x389cbc){return db[_0xd7b0('0x9a')]['destroy']({'where':{'FaxAccountId':_0x632af3['body']['id']},'transaction':_0x62b8d6})[_0xd7b0('0x1f')](function(_0x52f8b3){return db[_0xd7b0('0x9a')]['bulkCreate'](createExtensionsReciveFax(_[_0xd7b0('0x6f')](_0x632af3['body'],['tech',_0xd7b0('0x41'),'createdAt','updatedAt',_0xd7b0('0x9c'),_0xd7b0('0x9d')])),{'transaction':_0x62b8d6});});});})[_0xd7b0('0x1f')](function(){return db[_0xd7b0('0x3e')][_0xd7b0('0x9e')](_0x632af3[_0xd7b0('0x58')]['id']);})[_0xd7b0('0x1f')](respondWithResult(_0x4b6820,null))['catch'](handleError(_0x4b6820,null));};exports[_0xd7b0('0x9f')]=function(_0x35b3cb,_0x3f6396,_0x62d40a){var _0x1f304e={'raw':!![],'where':{}};var _0x31be79={};var _0x494367={'count':0x0,'rows':[]};return db[_0xd7b0('0x3e')][_0xd7b0('0x65')]({'where':{'id':_0x35b3cb[_0xd7b0('0x60')]['id']}})[_0xd7b0('0x1f')](handleEntityNotFound(_0x3f6396,null))['then'](function(_0x2b455d){if(_0x2b455d){_0x31be79[_0xd7b0('0x45')]=_[_0xd7b0('0x43')](db[_0xd7b0('0xa0')][_0xd7b0('0x55')]);_0x31be79[_0xd7b0('0x42')]=_[_0xd7b0('0x43')](_0x35b3cb[_0xd7b0('0x42')]);_0x31be79[_0xd7b0('0x4c')]=_[_0xd7b0('0x44')](_0x31be79[_0xd7b0('0x45')],_0x31be79['query']);_0x1f304e[_0xd7b0('0x46')]=_[_0xd7b0('0x44')](_0x31be79[_0xd7b0('0x45')],qs[_0xd7b0('0x47')](_0x35b3cb['query'][_0xd7b0('0x47')]));_0x1f304e['attributes']=_0x1f304e['attributes'][_0xd7b0('0x66')]?_0x1f304e['attributes']:_0x31be79['model'];if(!_0x35b3cb[_0xd7b0('0x42')][_0xd7b0('0x48')](_0xd7b0('0x49'))){_0x1f304e[_0xd7b0('0x2e')]=qs[_0xd7b0('0x2e')](_0x35b3cb[_0xd7b0('0x42')][_0xd7b0('0x2e')]);_0x1f304e[_0xd7b0('0x2c')]=qs[_0xd7b0('0x2c')](_0x35b3cb[_0xd7b0('0x42')][_0xd7b0('0x2c')]);}_0x1f304e['order']=qs['sort'](_0x35b3cb[_0xd7b0('0x42')]['sort']);_0x1f304e[_0xd7b0('0x4f')]=qs['filters'](_[_0xd7b0('0x4d')](_0x35b3cb[_0xd7b0('0x42')],_0x31be79['filters']));_0x1f304e[_0xd7b0('0x4f')]['FaxAccountId']=_0x2b455d['id'];if(_0x35b3cb[_0xd7b0('0x42')]['filter']){_0x1f304e[_0xd7b0('0x4f')]=_[_0xd7b0('0x51')](_0x1f304e[_0xd7b0('0x4f')],{'$or':_[_0xd7b0('0x3d')](_0x1f304e[_0xd7b0('0x46')],function(_0x40a955){var _0x2cdfaf={};_0x2cdfaf[_0x40a955]={'$like':'%'+_0x35b3cb[_0xd7b0('0x42')]['filter']+'%'};return _0x2cdfaf;})});}if(_0x35b3cb[_0xd7b0('0x42')][_0xd7b0('0xa1')]){var _0x5e4115=_0x35b3cb[_0xd7b0('0x42')][_0xd7b0('0xa1')][_0xd7b0('0xa2')](',');var _0x21646f={};_0x21646f[_0x5e4115[0x0]]={'$gte':moment(_0x5e4115[0x1])[_0xd7b0('0xa3')](_0xd7b0('0xa4'))};_0x1f304e[_0xd7b0('0x4f')]=_[_0xd7b0('0x51')](_0x1f304e['where'],_0x21646f);}_0x1f304e=_[_0xd7b0('0x51')]({},_0x1f304e,_0x35b3cb[_0xd7b0('0x56')]);return db[_0xd7b0('0xa0')][_0xd7b0('0x2f')]({'where':_0x1f304e[_0xd7b0('0x4f')]})['then'](function(_0x15e727){_0x494367[_0xd7b0('0x2f')]=_0x15e727;if(_0x35b3cb[_0xd7b0('0x42')]['includeAll']){_0x1f304e[_0xd7b0('0x53')]=[{'all':!![]}];}return db[_0xd7b0('0xa0')][_0xd7b0('0x67')](_0x1f304e);})[_0xd7b0('0x1f')](function(_0x2a5046){_0x494367[_0xd7b0('0x68')]=_0x2a5046;return _0x494367;});}})['then'](respondWithFilteredResult(_0x3f6396,_0x1f304e))['catch'](handleError(_0x3f6396,null));};exports[_0xd7b0('0x3a')]=function(_0x3a2599,_0x182fd5,_0x259a9c){var _0x5ca604,_0x354adb={},_0x3db140;if(_0x3a2599[_0xd7b0('0x58')]['to']){_0x3db140=_0x3a2599[_0xd7b0('0x58')]['to'][0x0];}return db[_0xd7b0('0x3e')]['find']({'where':{'id':_0x3a2599['params']['id']},'include':[{'model':db[_0xd7b0('0xa5')],'as':_0xd7b0('0xa6'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x3db140},'limit':0x1,'order':[[_0xd7b0('0xa7'),'DESC']]}]}]})[_0xd7b0('0x1f')](handleEntityNotFound(_0x182fd5,null))[_0xd7b0('0x1f')](function(_0x55fa11){_0x5ca604=_0x55fa11;if(_0x3a2599['body'][_0xd7b0('0xa8')]&&_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xa8')][_0xd7b0('0x66')]){for(var _0x3760bf=0x0;_0x3760bf<_0x3a2599['body'][_0xd7b0('0xa8')][_0xd7b0('0x66')];_0x3760bf+=0x1){_0x3a2599['body'][_0xd7b0('0xa8')][_0x3760bf]={'filename':_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xa8')][_0x3760bf][_0xd7b0('0x39')],'id':_0x3a2599['body'][_0xd7b0('0xa8')][_0x3760bf]['id'],'path':path[_0xd7b0('0xa9')](config[_0xd7b0('0xaa')],_0xd7b0('0xab'),_0x3a2599[_0xd7b0('0x58')]['attachments'][_0x3760bf][_0xd7b0('0xac')])};}}return respondWithRpcPromise(_0xd7b0('0xad'),_0xd7b0('0xad'),{'FaxAccountId':_[_0xd7b0('0xae')](_0x3a2599[_0xd7b0('0x60')]['id'])?undefined:_0x3a2599[_0xd7b0('0x60')]['id'],'path':_['isNil'](_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xa8')][0x0][_0xd7b0('0x7')])?undefined:_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xa8')][0x0][_0xd7b0('0x7')],'fax':_[_0xd7b0('0xae')](_0x3a2599[_0xd7b0('0x58')]['to'][0x0])?undefined:_0x3a2599['body']['to'][0x0]},client9002);})[_0xd7b0('0x1f')](function(){if(_0x5ca604){if(_[_0xd7b0('0xae')](_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xaf')])){_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xaf')]=util[_0xd7b0('0xa3')](_0xd7b0('0xb0'),_0x5ca604[_0xd7b0('0x39')],_0x5ca604[_0xd7b0('0xb1')]);}if(_0x5ca604['List']){if(_0x5ca604[_0xd7b0('0xa6')][_0xd7b0('0xb2')][_0xd7b0('0x66')]){return _0x5ca604[_0xd7b0('0xa6')][_0xd7b0('0xb2')][0x0];}else{return db[_0xd7b0('0x71')][_0xd7b0('0x57')](_[_0xd7b0('0x19')](_0x3a2599[_0xd7b0('0x58')],{'firstName':_0x3a2599[_0xd7b0('0x58')]['to'][0x0],'phone':_0x3a2599[_0xd7b0('0x58')]['to'][0x0],'fax':_0x3a2599[_0xd7b0('0x58')]['to'][0x0],'ListId':_0x5ca604[_0xd7b0('0x9d')]}));}}else{throw new Error(_0xd7b0('0xb3'));}}else{throw new Error(_0xd7b0('0xb4'));}})[_0xd7b0('0x1f')](function(_0x4e5906){if(_0x4e5906){return db[_0xd7b0('0x70')]['find']({'where':{'ContactId':_0x4e5906['id'],'closed':![],'FaxAccountId':_0x5ca604['id']}})[_0xd7b0('0x1f')](function(_0x356d7b){if(_0x356d7b){return[_0x356d7b,![]];}return db[_0xd7b0('0x70')][_0xd7b0('0x57')]({'UserId':_0x3a2599[_0xd7b0('0x5b')]['id'],'ContactId':_0x4e5906['id'],'FaxAccountId':_0x5ca604['id'],'fax':_0x3a2599['body']['to'][0x0],'firstMsgDirection':_0xd7b0('0xb5'),'Messages':[_['merge'](_0x3a2599['body'],{'read':![],'body':_0x3a2599['body'][_0xd7b0('0xa8')][0x0][_0xd7b0('0xb6')],'FaxAccountId':_0x5ca604['id'],'UserId':_0x3a2599['user']['id'],'ContactId':_0x4e5906['id'],'AttachmentId':_0x3a2599[_0xd7b0('0x58')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xd7b0('0x1f')](function(_0x4e5aba){return[_0x4e5aba,!![]];});});}else{throw new Error(_0xd7b0('0xb7'));}})[_0xd7b0('0xb8')](function(_0x12f253,_0xdf84de){if(_0xdf84de){return _0x12f253;}return db[_0xd7b0('0xa0')]['create']({'direction':_0xd7b0('0xb5'),'read':![],'body':_0x3a2599[_0xd7b0('0x58')]['attachments'][0x0][_0xd7b0('0xb6')],'FaxAccountId':_0x5ca604['id'],'FaxInteractionId':_0x12f253['id'],'UserId':_0x3a2599[_0xd7b0('0x5b')]['id'],'ContactId':_0x12f253['ContactId'],'AttachmentId':_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xa8')][0x0]['id']})[_0xd7b0('0x1f')](function(_0x51bcdd){_0x12f253[_0xd7b0('0xb9')][_0xd7b0('0xba')]=[];_0x12f253['dataValues'][_0xd7b0('0xba')][_0xd7b0('0x8b')](_0x51bcdd[_0xd7b0('0xb9')]);return _0x12f253;});})[_0xd7b0('0x1f')](function(_0x51d056){respondWithRpcPromise(_0xd7b0('0xbb'),_0xd7b0('0xbb'),{'FaxAccountId':_[_0xd7b0('0xae')](_0x3a2599[_0xd7b0('0x60')]['id'])?undefined:_0x3a2599[_0xd7b0('0x60')]['id'],'path':_['isNil'](_0x3a2599[_0xd7b0('0x58')]['attachments'][0x0]['path'])?undefined:_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xa8')][0x0][_0xd7b0('0x7')],'fax':_['isNil'](_0x3a2599[_0xd7b0('0x58')]['to'][0x0])?undefined:_0x3a2599[_0xd7b0('0x58')]['to'][0x0],'AttachmentId':_0x3a2599[_0xd7b0('0x58')][_0xd7b0('0xa8')][0x0]['id']},client9002)[_0xd7b0('0x1f')](function(_0x3fdf81){logger[_0xd7b0('0xbc')](_0xd7b0('0xbd'),_0x3fdf81);})['catch'](function(_0x55898a){logger[_0xd7b0('0xbc')](_0xd7b0('0xbd'),_0x55898a);});return _0x51d056;})['then'](respondWithResult(_0x182fd5,null))[_0xd7b0('0x5e')](handleError(_0x182fd5,null));};exports[_0xd7b0('0xbe')]=function(_0x168fcf,_0x19526d,_0x1eca0e){return db[_0xd7b0('0x3e')][_0xd7b0('0x5c')]({'where':{'id':_0x168fcf[_0xd7b0('0x60')]['id']}})['then'](handleEntityNotFound(_0x19526d,null))[_0xd7b0('0x1f')](function(_0x107082){if(_0x107082){return _0x107082['addAgents'](_0x168fcf['body'][_0xd7b0('0x6a')],_[_0xd7b0('0x6f')](_0x168fcf['body'],[_0xd7b0('0x6a'),'id'])||{})[_0xd7b0('0xb8')](function(_0x38722a){for(var _0x57b506=0x0;_0x57b506<_0x168fcf[_0xd7b0('0x58')][_0xd7b0('0x6a')][_0xd7b0('0x66')];_0x57b506+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x168fcf[_0xd7b0('0x58')][_0xd7b0('0x6a')][_0x57b506]),'FaxAccountId':Number(_0x168fcf[_0xd7b0('0x60')]['id'])});}return _0x38722a;});}})['then'](respondWithResult(_0x19526d,null))[_0xd7b0('0x5e')](handleError(_0x19526d,null));};exports['removeAgents']=function(_0x15ec82,_0x335ea3,_0x1f81a5){return db[_0xd7b0('0x3e')][_0xd7b0('0x5c')]({'where':{'id':_0x15ec82[_0xd7b0('0x60')]['id']}})['then'](handleEntityNotFound(_0x335ea3,null))[_0xd7b0('0x1f')](function(_0x92ffc4){if(_0x92ffc4){return _0x92ffc4[_0xd7b0('0xbf')](_0x15ec82['query'][_0xd7b0('0x6a')])[_0xd7b0('0x1f')](function(){if(_[_0xd7b0('0xc0')](_0x15ec82['query']['ids'])){for(var _0x5037c5=0x0;_0x5037c5<_0x15ec82['query'][_0xd7b0('0x6a')]['length'];_0x5037c5+=0x1){socket['emit'](_0xd7b0('0xc1'),{'UserId':Number(_0x15ec82['query'][_0xd7b0('0x6a')][_0x5037c5]),'FaxAccountId':Number(_0x15ec82[_0xd7b0('0x60')]['id'])});}}else{socket[_0xd7b0('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x15ec82[_0xd7b0('0x42')][_0xd7b0('0x6a')]),'FaxAccountId':Number(_0x15ec82[_0xd7b0('0x60')]['id'])});}});}})[_0xd7b0('0x1f')](respondWithStatusCode(_0x335ea3,null))['catch'](handleError(_0x335ea3,null));};exports[_0xd7b0('0xc3')]=function(_0x455d60,_0x480a3a,_0x2236f9){var _0x7100a={};var _0x5b62a2={};var _0x4fed80;var _0x31276f;return db[_0xd7b0('0x3e')]['findOne']({'where':{'id':_0x455d60[_0xd7b0('0x60')]['id']}})[_0xd7b0('0x1f')](handleEntityNotFound(_0x480a3a,null))['then'](function(_0x3a7579){if(_0x3a7579){_0x4fed80=_0x3a7579;_0x5b62a2[_0xd7b0('0x45')]=_[_0xd7b0('0x43')](db[_0xd7b0('0xc4')]['rawAttributes']);_0x5b62a2[_0xd7b0('0x42')]=_['keys'](_0x455d60['query']);_0x5b62a2[_0xd7b0('0x4c')]=_[_0xd7b0('0x44')](_0x5b62a2['model'],_0x5b62a2['query']);_0x7100a[_0xd7b0('0x46')]=_['intersection'](_0x5b62a2[_0xd7b0('0x45')],qs[_0xd7b0('0x47')](_0x455d60['query'][_0xd7b0('0x47')]));_0x7100a[_0xd7b0('0x46')]=_0x7100a[_0xd7b0('0x46')][_0xd7b0('0x66')]?_0x7100a[_0xd7b0('0x46')]:_0x5b62a2[_0xd7b0('0x45')];_0x7100a[_0xd7b0('0x4a')]=qs['sort'](_0x455d60[_0xd7b0('0x42')][_0xd7b0('0x4b')]);_0x7100a[_0xd7b0('0x4f')]=qs['filters'](_[_0xd7b0('0x4d')](_0x455d60['query'],_0x5b62a2[_0xd7b0('0x4c')]));if(_0x455d60[_0xd7b0('0x42')][_0xd7b0('0x4e')]){_0x7100a['where']=_['merge'](_0x7100a[_0xd7b0('0x4f')],{'$or':_[_0xd7b0('0x3d')](_0x7100a[_0xd7b0('0x46')],function(_0x388df5){var _0x3d7537={};_0x3d7537[_0x388df5]={'$like':'%'+_0x455d60['query'][_0xd7b0('0x4e')]+'%'};return _0x3d7537;})});}_0x7100a=_['merge']({},_0x7100a,_0x455d60[_0xd7b0('0x56')]);return _0x4fed80[_0xd7b0('0xc3')](_0x7100a);}})[_0xd7b0('0x1f')](function(_0x37a1ed){if(_0x37a1ed){_0x31276f=_0x37a1ed[_0xd7b0('0x66')];if(!_0x455d60['query'][_0xd7b0('0x48')](_0xd7b0('0x49'))){_0x7100a[_0xd7b0('0x2e')]=qs[_0xd7b0('0x2e')](_0x455d60[_0xd7b0('0x42')][_0xd7b0('0x2e')]);_0x7100a[_0xd7b0('0x2c')]=qs['offset'](_0x455d60[_0xd7b0('0x42')][_0xd7b0('0x2c')]);}return _0x4fed80[_0xd7b0('0xc3')](_0x7100a);}})['then'](function(_0x1b67e9){if(_0x1b67e9){return _0x1b67e9?{'count':_0x31276f,'rows':_0x1b67e9}:null;}})[_0xd7b0('0x1f')](respondWithResult(_0x480a3a,null))[_0xd7b0('0x5e')](handleError(_0x480a3a,null));}; \ No newline at end of file +var _0x77af=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','FaxAccounts','UserProfileResource','status','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','rows','show','params','include','catch','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','findAll','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addInteraction','getInteractions','FaxInteraction','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','json','getApplications','context','from-voip-provider','app','appdata','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','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','VoiceExtension','bulkCreate','updateAccountApplications','omit','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','root','basename','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','CmContact','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x279ce4,_0x13a3c8){var _0x3e8bcd=function(_0x122463){while(--_0x122463){_0x279ce4['push'](_0x279ce4['shift']());}};_0x3e8bcd(++_0x13a3c8);}(_0x77af,0xb3));var _0xf77a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x77af[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xf77a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf77a('0x1'));var jsonpatch=require(_0xf77a('0x2'));var rp=require(_0xf77a('0x3'));var moment=require(_0xf77a('0x4'));var BPromise=require(_0xf77a('0x5'));var Mustache=require(_0xf77a('0x6'));var util=require(_0xf77a('0x7'));var path=require('path');var sox=require(_0xf77a('0x8'));var csv=require('to-csv');var ejs=require(_0xf77a('0x9'));var fs=require('fs');var fs_extra=require(_0xf77a('0xa'));var _=require(_0xf77a('0xb'));var squel=require('squel');var crypto=require(_0xf77a('0xc'));var jsforce=require(_0xf77a('0xd'));var deskjs=require(_0xf77a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf77a('0xf'));var Papa=require(_0xf77a('0x10'));var Redis=require(_0xf77a('0x11'));var authService=require(_0xf77a('0x12'));var qs=require(_0xf77a('0x13'));var as=require(_0xf77a('0x14'));var hardwareService=require(_0xf77a('0x15'));var logger=require(_0xf77a('0x16'))(_0xf77a('0x17'));var utils=require(_0xf77a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf77a('0x19'));var db=require(_0xf77a('0x1a'))['db'];config[_0xf77a('0x1b')]=_[_0xf77a('0x1c')](config[_0xf77a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xf77a('0x1d'))(new Redis(config['redis']));require(_0xf77a('0x1e'))[_0xf77a('0x1f')](socket);var jayson=require(_0xf77a('0x20'));var client=jayson[_0xf77a('0x21')][_0xf77a('0x22')]({'port':0x232c});var client9002=jayson[_0xf77a('0x21')][_0xf77a('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x575d6f,_0x5be08e,_0x135934,_0x393205){return new BPromise(function(_0x156efb,_0x266d95){var _0x247606=_0x393205||client;return _0x247606['request'](_0x575d6f,_0x135934)[_0xf77a('0x23')](function(_0xf2e605){logger[_0xf77a('0x24')](_0xf77a('0x25'),_0x5be08e,_0xf77a('0x26'));logger['debug'](_0xf77a('0x27'),_0x5be08e,_0xf77a('0x26'),JSON[_0xf77a('0x28')](_0xf2e605));if(_0xf2e605[_0xf77a('0x29')]){if(_0xf2e605[_0xf77a('0x29')][_0xf77a('0x2a')]===0x1f4){logger[_0xf77a('0x29')](_0xf77a('0x25'),_0x5be08e,_0xf2e605[_0xf77a('0x29')][_0xf77a('0x2b')]);return _0x266d95(_0xf2e605['error'][_0xf77a('0x2b')]);}logger[_0xf77a('0x29')](_0xf77a('0x25'),_0x5be08e,_0xf2e605[_0xf77a('0x29')]['message']);return _0x156efb(_0xf2e605['error'][_0xf77a('0x2b')]);}else{logger[_0xf77a('0x24')]('FaxAccount,\x20%s,\x20%s',_0x5be08e,_0xf77a('0x26'));_0x156efb(_0xf2e605[_0xf77a('0x2c')][_0xf77a('0x2b')]);}})['catch'](function(_0xb5af82){logger[_0xf77a('0x29')](_0xf77a('0x25'),_0x5be08e,_0xb5af82);_0x266d95(_0xb5af82);});});}function respondWithStatusCode(_0x555cda,_0x4d3a97){_0x4d3a97=_0x4d3a97||0xcc;return function(_0x2e4751){if(_0x2e4751){return _0x555cda[_0xf77a('0x2d')](_0x4d3a97);}return _0x555cda['status'](_0x4d3a97)[_0xf77a('0x2e')]();};}function respondWithResult(_0x357bae,_0x41ecca){_0x41ecca=_0x41ecca||0xc8;return function(_0x58051d){if(_0x58051d){return _0x357bae['status'](_0x41ecca)['json'](_0x58051d);}};}function respondWithFilteredResult(_0x1aa83e,_0x5b942a){return function(_0x2f58fa){if(_0x2f58fa){var _0x320094=typeof _0x5b942a['offset']===_0xf77a('0x2f')&&typeof _0x5b942a[_0xf77a('0x30')]==='undefined';var _0x4d9244=_0x2f58fa[_0xf77a('0x31')];var _0x1ec1bf=_0x320094?0x0:_0x5b942a[_0xf77a('0x32')];var _0x528748=_0x320094?_0x2f58fa[_0xf77a('0x31')]:_0x5b942a[_0xf77a('0x32')]+_0x5b942a[_0xf77a('0x30')];var _0x21b71a;if(_0x528748>=_0x4d9244){_0x528748=_0x4d9244;_0x21b71a=0xc8;}else{_0x21b71a=0xce;}_0x1aa83e['status'](_0x21b71a);return _0x1aa83e[_0xf77a('0x33')](_0xf77a('0x34'),_0x1ec1bf+'-'+_0x528748+'/'+_0x4d9244)['json'](_0x2f58fa);}return null;};}function patchUpdates(_0x5d73b7){return function(_0x23f85d){try{jsonpatch['apply'](_0x23f85d,_0x5d73b7,!![]);}catch(_0x5abd0f){return BPromise[_0xf77a('0x35')](_0x5abd0f);}return _0x23f85d['save']();};}function saveUpdates(_0x1e7ee0,_0x4e223f){return function(_0x19a004){if(_0x19a004){return _0x19a004[_0xf77a('0x36')](_0x1e7ee0)[_0xf77a('0x23')](function(_0x323907){return _0x323907;});}return null;};}function removeEntity(_0x50fd07,_0x3251da){return function(_0x14620b){if(_0x14620b){return _0x14620b[_0xf77a('0x37')]()['then'](function(){var _0x21a017=_0x14620b['get']({'plain':!![]});var _0x4d083c=_0xf77a('0x38');return db[_0xf77a('0x39')][_0xf77a('0x37')]({'where':{'type':_0x4d083c,'resourceId':_0x21a017['id']}})[_0xf77a('0x23')](function(){return _0x14620b;});})[_0xf77a('0x23')](function(){_0x50fd07[_0xf77a('0x3a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd2af16,_0x423f82){return function(_0x119007){if(!_0x119007){_0xd2af16[_0xf77a('0x2d')](0x194);}return _0x119007;};}function handleError(_0x5464ba,_0x196737){_0x196737=_0x196737||0x1f4;return function(_0x1d7a45){logger[_0xf77a('0x29')](_0x1d7a45[_0xf77a('0x3b')]);if(_0x1d7a45['name']){delete _0x1d7a45[_0xf77a('0x3c')];}_0x5464ba[_0xf77a('0x3a')](_0x196737)[_0xf77a('0x3d')](_0x1d7a45);};}exports[_0xf77a('0x3e')]=function(_0xee30fb,_0x250e39){var _0x1ad5d1={'include':[{'model':db[_0xf77a('0x3f')],'as':_0xf77a('0x40')}]},_0x250f5d={},_0x4b5cb7={'count':0x0,'rows':[]};var _0x59a5b7=_[_0xf77a('0x41')](db[_0xf77a('0x42')][_0xf77a('0x43')],function(_0x396a45){return{'name':_0x396a45[_0xf77a('0x44')],'type':_0x396a45[_0xf77a('0x45')][_0xf77a('0x46')]};});_0x250f5d[_0xf77a('0x47')]=_['map'](_0x59a5b7,'name');_0x250f5d['query']=_[_0xf77a('0x48')](_0xee30fb[_0xf77a('0x49')]);_0x250f5d[_0xf77a('0x4a')]=_[_0xf77a('0x4b')](_0x250f5d[_0xf77a('0x47')],_0x250f5d[_0xf77a('0x49')]);_0x1ad5d1['attributes']=_[_0xf77a('0x4b')](_0x250f5d[_0xf77a('0x47')],qs[_0xf77a('0x4c')](_0xee30fb[_0xf77a('0x49')][_0xf77a('0x4c')]));_0x1ad5d1[_0xf77a('0x4d')]=_0x1ad5d1['attributes'][_0xf77a('0x4e')]?_0x1ad5d1['attributes']:_0x250f5d[_0xf77a('0x47')];if(!_0xee30fb[_0xf77a('0x49')][_0xf77a('0x4f')](_0xf77a('0x50'))){_0x1ad5d1[_0xf77a('0x30')]=qs[_0xf77a('0x30')](_0xee30fb[_0xf77a('0x49')][_0xf77a('0x30')]);_0x1ad5d1['offset']=qs[_0xf77a('0x32')](_0xee30fb[_0xf77a('0x49')]['offset']);}_0x1ad5d1[_0xf77a('0x51')]=qs[_0xf77a('0x52')](_0xee30fb['query'][_0xf77a('0x52')]);_0x1ad5d1['where']=qs[_0xf77a('0x4a')](_[_0xf77a('0x53')](_0xee30fb['query'],_0x250f5d[_0xf77a('0x4a')]),_0x59a5b7);if(_0xee30fb[_0xf77a('0x49')][_0xf77a('0x54')]){_0x1ad5d1[_0xf77a('0x55')]=_[_0xf77a('0x56')](_0x1ad5d1[_0xf77a('0x55')],{'$or':_[_0xf77a('0x41')](_0x59a5b7,function(_0x3fcda8){if(_0x3fcda8[_0xf77a('0x45')]!=='VIRTUAL'){var _0x469fca={};_0x469fca[_0x3fcda8[_0xf77a('0x3c')]]={'$like':'%'+_0xee30fb[_0xf77a('0x49')]['filter']+'%'};return _0x469fca;}})});}_0x1ad5d1=_[_0xf77a('0x56')]({},_0x1ad5d1,_0xee30fb[_0xf77a('0x57')]);var _0x3d3c76={'where':_0x1ad5d1[_0xf77a('0x55')]};return db[_0xf77a('0x42')]['count'](_0x3d3c76)['then'](function(_0x175e98){_0x4b5cb7[_0xf77a('0x31')]=_0x175e98;if(_0xee30fb[_0xf77a('0x49')][_0xf77a('0x58')]){_0x1ad5d1['include']=[{'all':!![]}];}return db[_0xf77a('0x42')]['findAll'](_0x1ad5d1);})[_0xf77a('0x23')](function(_0x209a91){_0x4b5cb7[_0xf77a('0x59')]=_0x209a91;return _0x4b5cb7;})[_0xf77a('0x23')](respondWithFilteredResult(_0x250e39,_0x1ad5d1))['catch'](handleError(_0x250e39,null));};exports[_0xf77a('0x5a')]=function(_0x5bf2f5,_0x529b91){var _0x599d54={'raw':![],'where':{'id':_0x5bf2f5[_0xf77a('0x5b')]['id']},'include':[{'model':db[_0xf77a('0x3f')],'as':_0xf77a('0x40')}]},_0x2e2361={};_0x2e2361['model']=_[_0xf77a('0x48')](db[_0xf77a('0x42')][_0xf77a('0x43')]);_0x2e2361['query']=_[_0xf77a('0x48')](_0x5bf2f5[_0xf77a('0x49')]);_0x2e2361[_0xf77a('0x4a')]=_[_0xf77a('0x4b')](_0x2e2361[_0xf77a('0x47')],_0x2e2361[_0xf77a('0x49')]);_0x599d54['attributes']=_['intersection'](_0x2e2361[_0xf77a('0x47')],qs[_0xf77a('0x4c')](_0x5bf2f5[_0xf77a('0x49')][_0xf77a('0x4c')]));_0x599d54[_0xf77a('0x4d')]=_0x599d54[_0xf77a('0x4d')]['length']?_0x599d54[_0xf77a('0x4d')]:_0x2e2361[_0xf77a('0x47')];if(_0x5bf2f5[_0xf77a('0x49')][_0xf77a('0x58')]){_0x599d54[_0xf77a('0x5c')]=[{'all':!![]}];}_0x599d54=_[_0xf77a('0x56')]({},_0x599d54,_0x5bf2f5[_0xf77a('0x57')]);return db['FaxAccount']['find'](_0x599d54)['then'](handleEntityNotFound(_0x529b91,null))[_0xf77a('0x23')](respondWithResult(_0x529b91,null))[_0xf77a('0x5d')](handleError(_0x529b91,null));};exports[_0xf77a('0x5e')]=function(_0x321e23,_0x42730e){return db[_0xf77a('0x42')][_0xf77a('0x5e')](_0x321e23['body'],{})[_0xf77a('0x23')](function(_0x4eb36c){var _0x162934=_0x321e23[_0xf77a('0x5f')][_0xf77a('0x60')]({'plain':!![]});if(!_0x162934)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x162934[_0xf77a('0x61')]===_0xf77a('0x5f')){var _0x317256=_0x4eb36c['get']({'plain':!![]});var _0x18bdb9=_0xf77a('0x38');return db[_0xf77a('0x62')][_0xf77a('0x63')]({'where':{'name':_0x18bdb9,'userProfileId':_0x162934[_0xf77a('0x64')]},'raw':!![]})[_0xf77a('0x23')](function(_0x2642ba){if(_0x2642ba&&_0x2642ba[_0xf77a('0x65')]===0x0){return db[_0xf77a('0x39')][_0xf77a('0x5e')]({'name':_0x317256[_0xf77a('0x3c')],'resourceId':_0x317256['id'],'type':_0x2642ba['name'],'sectionId':_0x2642ba['id']},{})[_0xf77a('0x23')](function(){return _0x4eb36c;});}else{return _0x4eb36c;}})[_0xf77a('0x5d')](function(_0x3926a5){logger[_0xf77a('0x29')](_0xf77a('0x66'),_0x3926a5);throw _0x3926a5;});}return _0x4eb36c;})[_0xf77a('0x23')](respondWithResult(_0x42730e,0xc9))[_0xf77a('0x5d')](handleError(_0x42730e,null));};exports[_0xf77a('0x36')]=function(_0x4e4091,_0x2531ff){if(_0x4e4091[_0xf77a('0x67')]['id']){delete _0x4e4091[_0xf77a('0x67')]['id'];}return db[_0xf77a('0x42')]['find']({'where':{'id':_0x4e4091[_0xf77a('0x5b')]['id']},'include':[{'model':db[_0xf77a('0x3f')],'as':_0xf77a('0x40')}]})[_0xf77a('0x23')](handleEntityNotFound(_0x2531ff,null))['then'](saveUpdates(_0x4e4091[_0xf77a('0x67')],null))[_0xf77a('0x23')](respondWithResult(_0x2531ff,null))['catch'](handleError(_0x2531ff,null));};exports['destroy']=function(_0x2a0178,_0x5481be){return db['FaxAccount'][_0xf77a('0x63')]({'where':{'id':_0x2a0178['params']['id']}})['then'](handleEntityNotFound(_0x5481be,null))[_0xf77a('0x23')](removeEntity(_0x5481be,null))[_0xf77a('0x5d')](handleError(_0x5481be,null));};exports[_0xf77a('0x68')]=function(_0x3c48d5,_0x26861f){return db[_0xf77a('0x42')][_0xf77a('0x68')]()['then'](respondWithResult(_0x26861f,null))[_0xf77a('0x5d')](handleError(_0x26861f,null));};exports[_0xf77a('0x69')]=function(_0x15ca9a,_0x42de85,_0x3b9ced){if(_0x15ca9a[_0xf77a('0x67')]['id']){delete _0x15ca9a[_0xf77a('0x67')]['id'];}return db[_0xf77a('0x42')][_0xf77a('0x63')]({'where':{'id':_0x15ca9a['params']['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0x42de85,null))[_0xf77a('0x23')](function(_0x17b812){if(_0x17b812){_0x15ca9a[_0xf77a('0x67')][_0xf77a('0x6a')]=_0x17b812['id'];return db['Disposition']['create'](_0x15ca9a[_0xf77a('0x67')]);}})['then'](respondWithResult(_0x42de85,null))[_0xf77a('0x5d')](handleError(_0x42de85,null));};exports[_0xf77a('0x6b')]=function(_0xe78ba7,_0x150e9d,_0x1473f9){var _0x560cca={'raw':![],'where':{}};var _0x45dec0={};var _0xc1a6ed={'count':0x0,'rows':[]};return db[_0xf77a('0x42')][_0xf77a('0x6c')]({'where':{'id':_0xe78ba7[_0xf77a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x150e9d,null))['then'](function(_0x5b00dd){if(_0x5b00dd){_0x45dec0[_0xf77a('0x47')]=_[_0xf77a('0x48')](db[_0xf77a('0x6d')][_0xf77a('0x43')]);_0x45dec0['query']=_[_0xf77a('0x48')](_0xe78ba7[_0xf77a('0x49')]);_0x45dec0['filters']=_['intersection'](_0x45dec0[_0xf77a('0x47')],_0x45dec0[_0xf77a('0x49')]);_0x560cca[_0xf77a('0x4d')]=_[_0xf77a('0x4b')](_0x45dec0[_0xf77a('0x47')],qs[_0xf77a('0x4c')](_0xe78ba7[_0xf77a('0x49')][_0xf77a('0x4c')]));_0x560cca[_0xf77a('0x4d')]=_0x560cca[_0xf77a('0x4d')][_0xf77a('0x4e')]?_0x560cca[_0xf77a('0x4d')]:_0x45dec0['model'];if(!_0xe78ba7[_0xf77a('0x49')][_0xf77a('0x4f')]('nolimit')){_0x560cca[_0xf77a('0x30')]=qs[_0xf77a('0x30')](_0xe78ba7[_0xf77a('0x49')]['limit']);_0x560cca['offset']=qs[_0xf77a('0x32')](_0xe78ba7['query'][_0xf77a('0x32')]);}_0x560cca[_0xf77a('0x51')]=qs[_0xf77a('0x52')](_0xe78ba7[_0xf77a('0x49')][_0xf77a('0x52')]);_0x560cca[_0xf77a('0x55')]=qs[_0xf77a('0x4a')](_[_0xf77a('0x53')](_0xe78ba7[_0xf77a('0x49')],_0x45dec0['filters']));_0x560cca[_0xf77a('0x55')][_0xf77a('0x6a')]=_0x5b00dd['id'];if(_0xe78ba7[_0xf77a('0x49')][_0xf77a('0x54')]){_0x560cca[_0xf77a('0x55')]=_['merge'](_0x560cca[_0xf77a('0x55')],{'$or':_[_0xf77a('0x41')](_0x560cca[_0xf77a('0x4d')],function(_0x45a7a1){var _0xee1f8={};_0xee1f8[_0x45a7a1]={'$like':'%'+_0xe78ba7[_0xf77a('0x49')]['filter']+'%'};return _0xee1f8;})});}_0x560cca=_[_0xf77a('0x56')]({},_0x560cca,_0xe78ba7[_0xf77a('0x57')]);return db[_0xf77a('0x6d')]['count']({'where':_0x560cca['where']})[_0xf77a('0x23')](function(_0x2d1c5b){_0xc1a6ed[_0xf77a('0x31')]=_0x2d1c5b;if(_0xe78ba7['query']['includeAll']){_0x560cca[_0xf77a('0x5c')]=[{'all':!![]}];}return db[_0xf77a('0x6d')][_0xf77a('0x6e')](_0x560cca);})['then'](function(_0x27450a){_0xc1a6ed[_0xf77a('0x59')]=_0x27450a;return _0xc1a6ed;});}})[_0xf77a('0x23')](respondWithFilteredResult(_0x150e9d,_0x560cca))[_0xf77a('0x5d')](handleError(_0x150e9d,null));};exports[_0xf77a('0x6f')]=function(_0x4a9794,_0x5f79c8,_0x2b6de9){return db['FaxAccount'][_0xf77a('0x63')]({'where':{'id':_0x4a9794[_0xf77a('0x5b')]['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0x5f79c8,null))[_0xf77a('0x23')](function(_0x40da22){if(_0x40da22){return _0x40da22[_0xf77a('0x6f')](_0x4a9794[_0xf77a('0x49')]['ids']);}})[_0xf77a('0x23')](respondWithStatusCode(_0x5f79c8,null))['catch'](handleError(_0x5f79c8,null));};exports[_0xf77a('0x70')]=function(_0x1050cd,_0x5dc49a,_0x487a98){if(_0x1050cd[_0xf77a('0x67')]['id']){delete _0x1050cd[_0xf77a('0x67')]['id'];}return db[_0xf77a('0x42')]['find']({'where':{'id':_0x1050cd['params']['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0x5dc49a,null))['then'](function(_0x64cc5c){if(_0x64cc5c){_0x1050cd[_0xf77a('0x67')][_0xf77a('0x6a')]=_0x64cc5c['id'];return db[_0xf77a('0x71')][_0xf77a('0x5e')](_0x1050cd[_0xf77a('0x67')]);}})[_0xf77a('0x23')](respondWithResult(_0x5dc49a,null))[_0xf77a('0x5d')](handleError(_0x5dc49a,null));};exports['getAnswers']=function(_0x84399a,_0x5daf35,_0xa30b4f){var _0x1467f6={'raw':![],'where':{}};var _0x58e940={};var _0x4e2b90={'count':0x0,'rows':[]};return db[_0xf77a('0x42')]['findOne']({'where':{'id':_0x84399a['params']['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0x5daf35,null))[_0xf77a('0x23')](function(_0x218d54){if(_0x218d54){_0x58e940['model']=_[_0xf77a('0x48')](db[_0xf77a('0x71')][_0xf77a('0x43')]);_0x58e940[_0xf77a('0x49')]=_[_0xf77a('0x48')](_0x84399a['query']);_0x58e940['filters']=_[_0xf77a('0x4b')](_0x58e940[_0xf77a('0x47')],_0x58e940[_0xf77a('0x49')]);_0x1467f6['attributes']=_[_0xf77a('0x4b')](_0x58e940['model'],qs['fields'](_0x84399a['query'][_0xf77a('0x4c')]));_0x1467f6['attributes']=_0x1467f6[_0xf77a('0x4d')][_0xf77a('0x4e')]?_0x1467f6[_0xf77a('0x4d')]:_0x58e940[_0xf77a('0x47')];if(!_0x84399a['query'][_0xf77a('0x4f')](_0xf77a('0x50'))){_0x1467f6[_0xf77a('0x30')]=qs[_0xf77a('0x30')](_0x84399a['query']['limit']);_0x1467f6[_0xf77a('0x32')]=qs['offset'](_0x84399a[_0xf77a('0x49')]['offset']);}_0x1467f6[_0xf77a('0x51')]=qs[_0xf77a('0x52')](_0x84399a[_0xf77a('0x49')]['sort']);_0x1467f6[_0xf77a('0x55')]=qs[_0xf77a('0x4a')](_[_0xf77a('0x53')](_0x84399a[_0xf77a('0x49')],_0x58e940[_0xf77a('0x4a')]));_0x1467f6['where'][_0xf77a('0x6a')]=_0x218d54['id'];if(_0x84399a[_0xf77a('0x49')]['filter']){_0x1467f6['where']=_[_0xf77a('0x56')](_0x1467f6['where'],{'$or':_['map'](_0x1467f6[_0xf77a('0x4d')],function(_0x4a3d43){var _0x1bdf02={};_0x1bdf02[_0x4a3d43]={'$like':'%'+_0x84399a[_0xf77a('0x49')][_0xf77a('0x54')]+'%'};return _0x1bdf02;})});}_0x1467f6=_[_0xf77a('0x56')]({},_0x1467f6,_0x84399a['options']);return db[_0xf77a('0x71')][_0xf77a('0x31')]({'where':_0x1467f6[_0xf77a('0x55')]})[_0xf77a('0x23')](function(_0x40a822){_0x4e2b90['count']=_0x40a822;if(_0x84399a[_0xf77a('0x49')]['includeAll']){_0x1467f6[_0xf77a('0x5c')]=[{'all':!![]}];}return db[_0xf77a('0x71')][_0xf77a('0x6e')](_0x1467f6);})[_0xf77a('0x23')](function(_0x445643){_0x4e2b90[_0xf77a('0x59')]=_0x445643;return _0x4e2b90;});}})[_0xf77a('0x23')](respondWithFilteredResult(_0x5daf35,_0x1467f6))[_0xf77a('0x5d')](handleError(_0x5daf35,null));};exports[_0xf77a('0x72')]=function(_0x30f011,_0x923b09,_0xa469a){return db['FaxAccount'][_0xf77a('0x63')]({'where':{'id':_0x30f011['params']['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0x923b09,null))[_0xf77a('0x23')](function(_0x2bd642){if(_0x2bd642){return _0x2bd642['removeAnswers'](_0x30f011['query'][_0xf77a('0x73')]);}})['then'](respondWithStatusCode(_0x923b09,null))[_0xf77a('0x5d')](handleError(_0x923b09,null));};exports['addInteraction']=function(_0x5dd80b,_0x48d6ff,_0x3773dd){return db['FaxInteraction'][_0xf77a('0x63')]({'where':{'id':_0x5dd80b[_0xf77a('0x5b')]['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0x48d6ff,null))[_0xf77a('0x23')](function(_0x2205cb){if(_0x2205cb){return _0x2205cb[_0xf77a('0x74')](_0x5dd80b[_0xf77a('0x67')][_0xf77a('0x73')],_['omit'](_0x5dd80b['body'],[_0xf77a('0x73'),'id'])||{});}})['then'](respondWithResult(_0x48d6ff,null))[_0xf77a('0x5d')](handleError(_0x48d6ff,null));};exports[_0xf77a('0x75')]=function(_0x5e4253,_0xa6877,_0x227e96){var _0x365e0c={'raw':![],'where':{}};var _0x22ead6={};var _0x38fd51={'count':0x0,'rows':[]};return db[_0xf77a('0x42')][_0xf77a('0x6c')]({'where':{'id':_0x5e4253['params']['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0xa6877,null))[_0xf77a('0x23')](function(_0x1558ef){if(_0x1558ef){_0x22ead6[_0xf77a('0x47')]=_[_0xf77a('0x48')](db[_0xf77a('0x76')][_0xf77a('0x43')]);_0x22ead6[_0xf77a('0x49')]=_[_0xf77a('0x48')](_0x5e4253[_0xf77a('0x49')]);_0x22ead6[_0xf77a('0x4a')]=_['intersection'](_0x22ead6[_0xf77a('0x47')],_0x22ead6['query']);_0x365e0c['attributes']=_[_0xf77a('0x4b')](_0x22ead6[_0xf77a('0x47')],qs[_0xf77a('0x4c')](_0x5e4253[_0xf77a('0x49')]['fields']));_0x365e0c[_0xf77a('0x4d')]=_0x365e0c[_0xf77a('0x4d')][_0xf77a('0x4e')]?_0x365e0c[_0xf77a('0x4d')]:_0x22ead6['model'];if(!_0x5e4253['query'][_0xf77a('0x4f')](_0xf77a('0x50'))){_0x365e0c[_0xf77a('0x30')]=qs[_0xf77a('0x30')](_0x5e4253[_0xf77a('0x49')]['limit']);_0x365e0c[_0xf77a('0x32')]=qs['offset'](_0x5e4253[_0xf77a('0x49')]['offset']);}_0x365e0c['order']=qs[_0xf77a('0x52')](_0x5e4253['query'][_0xf77a('0x52')]);_0x365e0c[_0xf77a('0x55')]=qs[_0xf77a('0x4a')](_[_0xf77a('0x53')](_0x5e4253['query'],_0x22ead6[_0xf77a('0x4a')]));_0x365e0c[_0xf77a('0x55')][_0xf77a('0x6a')]=_0x1558ef['id'];if(_0x5e4253[_0xf77a('0x49')][_0xf77a('0x54')]){_0x365e0c[_0xf77a('0x55')]=_['merge'](_0x365e0c[_0xf77a('0x55')],{'$or':_[_0xf77a('0x41')](_0x365e0c['attributes'],function(_0x44ed7d){var _0x163553={};_0x163553[_0x44ed7d]={'$like':'%'+_0x5e4253[_0xf77a('0x49')][_0xf77a('0x54')]+'%'};return _0x163553;})});}_0x365e0c=_[_0xf77a('0x56')]({},_0x365e0c,_0x5e4253[_0xf77a('0x57')]);return db[_0xf77a('0x76')][_0xf77a('0x31')]({'where':_0x365e0c[_0xf77a('0x55')]})[_0xf77a('0x23')](function(_0x3bb9f5){_0x38fd51[_0xf77a('0x31')]=_0x3bb9f5;if(_0x5e4253[_0xf77a('0x49')][_0xf77a('0x58')]){_0x365e0c['include']=[{'model':db['CmContact'],'as':_0xf77a('0x77'),'required':![]},{'model':db[_0xf77a('0x78')],'as':_0xf77a('0x79'),'attributes':['name',_0xf77a('0x7a'),'internal'],'required':![]},{'model':db[_0xf77a('0x7b')],'as':_0xf77a('0x7c'),'attributes':['id',_0xf77a('0x3c'),_0xf77a('0x7d')],'where':_0x5e4253[_0xf77a('0x49')][_0xf77a('0x7e')]?{'id':_0x5e4253['query'][_0xf77a('0x7e')]}:undefined,'required':_0x5e4253[_0xf77a('0x49')]['tag']?!![]:![]}];}return db[_0xf77a('0x76')]['findAll'](_0x365e0c);})[_0xf77a('0x23')](function(_0x303979){_0x38fd51[_0xf77a('0x59')]=_0x303979;return _0x38fd51;});}})['then'](respondWithFilteredResult(_0xa6877,_0x365e0c))[_0xf77a('0x5d')](handleError(_0xa6877,null));};exports[_0xf77a('0x7f')]=function(_0xa8b36,_0x3a080b){var _0x384d58=_0xa8b36[_0xf77a('0x5b')]['id'];var _0x2866d0=_0xa8b36[_0xf77a('0x67')];var _0x3ef1fc=0xc8;var _0x146c32=null;return db['sequelize'][_0xf77a('0x80')]({'isolationLevel':db[_0xf77a('0x81')][_0xf77a('0x82')][_0xf77a('0x83')][_0xf77a('0x84')]},function(_0x5ba50b){return db[_0xf77a('0x42')][_0xf77a('0x6c')]({'where':{'id':_0x384d58},'transaction':_0x5ba50b})[_0xf77a('0x23')](function(_0x56ccf3){if(_0x56ccf3){return db[_0xf77a('0x85')]['destroy']({'where':{'FaxAccountId':_0x384d58},'transaction':_0x5ba50b})[_0xf77a('0x23')](function(){var _0x2ef689=_[_0xf77a('0x41')](_0x2866d0,function(_0x43abf5){_0x43abf5[_0xf77a('0x6a')]=_0x384d58;return _0x43abf5;});return db[_0xf77a('0x85')]['bulkCreate'](_0x2ef689,{'transaction':_0x5ba50b});});}else{_0x3ef1fc=0x194;_0x146c32=[];}});})[_0xf77a('0x23')](function(){if(_0x3ef1fc!==0x194){return db[_0xf77a('0x85')][_0xf77a('0x86')]({'where':{'FaxAccountId':_0x384d58},'order':_0xf77a('0x87')})[_0xf77a('0x23')](function(_0x532c70){_0x146c32=_0x532c70;});}})[_0xf77a('0x5d')](function(_0x5706ce){_0x3ef1fc=0x1f4;logger[_0xf77a('0x29')](_0x5706ce[_0xf77a('0x3b')]);if(_0x5706ce[_0xf77a('0x3c')]){delete _0x5706ce[_0xf77a('0x3c')];}_0x146c32=_0x5706ce;})['finally'](function(){if(_0x146c32===null){_0x3a080b[_0xf77a('0x2d')](_0x3ef1fc);}else{if(_0x3ef1fc===0x1f4){_0x3a080b[_0xf77a('0x3a')](_0x3ef1fc)['send'](_0x146c32);}else{_0x3a080b[_0xf77a('0x3a')](_0x3ef1fc)[_0xf77a('0x88')](_0x146c32);}}});};exports['getApplications']=function(_0x6742d4,_0x1a6627,_0x52a0b3){var _0x556ffc={};var _0x4b766c={};var _0x41881e;var _0x39dfd6;return db[_0xf77a('0x42')][_0xf77a('0x6c')]({'where':{'id':_0x6742d4[_0xf77a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1a6627,null))[_0xf77a('0x23')](function(_0x210a6b){if(_0x210a6b){_0x41881e=_0x210a6b;_0x4b766c[_0xf77a('0x47')]=_['keys'](db[_0xf77a('0x85')]['rawAttributes']);_0x4b766c[_0xf77a('0x49')]=_['keys'](_0x6742d4[_0xf77a('0x49')]);_0x4b766c['filters']=_[_0xf77a('0x4b')](_0x4b766c['model'],_0x4b766c[_0xf77a('0x49')]);_0x556ffc['attributes']=_[_0xf77a('0x4b')](_0x4b766c[_0xf77a('0x47')],qs[_0xf77a('0x4c')](_0x6742d4['query']['fields']));_0x556ffc['attributes']=_0x556ffc[_0xf77a('0x4d')][_0xf77a('0x4e')]?_0x556ffc[_0xf77a('0x4d')]:_0x4b766c['model'];_0x556ffc['order']=qs[_0xf77a('0x52')](_0x6742d4[_0xf77a('0x49')][_0xf77a('0x52')]);_0x556ffc[_0xf77a('0x55')]=qs['filters'](_['pick'](_0x6742d4[_0xf77a('0x49')],_0x4b766c[_0xf77a('0x4a')]));if(_0x6742d4[_0xf77a('0x49')]['filter']){_0x556ffc[_0xf77a('0x55')]=_[_0xf77a('0x56')](_0x556ffc['where'],{'$or':_[_0xf77a('0x41')](_0x556ffc[_0xf77a('0x4d')],function(_0xedb333){var _0x214793={};_0x214793[_0xedb333]={'$like':'%'+_0x6742d4[_0xf77a('0x49')]['filter']+'%'};return _0x214793;})});}_0x556ffc=_[_0xf77a('0x56')]({},_0x556ffc,_0x6742d4[_0xf77a('0x57')]);return _0x41881e[_0xf77a('0x89')](_0x556ffc);}})['then'](function(_0x26ab7b){if(_0x26ab7b){_0x39dfd6=_0x26ab7b[_0xf77a('0x4e')];if(!_0x6742d4[_0xf77a('0x49')][_0xf77a('0x4f')]('nolimit')){_0x556ffc['limit']=qs[_0xf77a('0x30')](_0x6742d4[_0xf77a('0x49')][_0xf77a('0x30')]);_0x556ffc['offset']=qs[_0xf77a('0x32')](_0x6742d4[_0xf77a('0x49')]['offset']);}return _0x41881e[_0xf77a('0x89')](_0x556ffc);}})[_0xf77a('0x23')](function(_0x4381d5){if(_0x4381d5){return _0x4381d5?{'count':_0x39dfd6,'rows':_0x4381d5}:null;}})[_0xf77a('0x23')](respondWithResult(_0x1a6627,null))[_0xf77a('0x5d')](handleError(_0x1a6627,null));};function Extension(_0x3a1b4f,_0x155683,_0x49dc99,_0x4eae0a){this[_0xf77a('0x8a')]=_0xf77a('0x8b');this['exten']=_0x3a1b4f['localstationid'];this[_0xf77a('0x8c')]=_0x4eae0a;this[_0xf77a('0x45')]='system';this['description']='Fax\x20Extension';this[_0xf77a('0x6a')]=_0x3a1b4f['id'];this[_0xf77a('0x87')]=_0x155683;this[_0xf77a('0x8d')]=_0x49dc99;}function createExtensionsReciveFax(_0x3ad8e2){var _0x93e699=0x1;var _0x53b95e=[];_0x53b95e[_0xf77a('0x8e')](new Extension(_0x3ad8e2,_0x93e699,'','Answer'));_0x93e699+=0x1;_0x53b95e[_0xf77a('0x8e')](new Extension(_0x3ad8e2,_0x93e699,_0xf77a('0x8f'),_0xf77a('0x90')));_0x93e699+=0x1;for(var _0x3b88e4 in _0x3ad8e2){if(_0x3ad8e2[_0xf77a('0x4f')](_0x3b88e4)&&(_0x3b88e4===_0xf77a('0x91')||_0x3b88e4===_0xf77a('0x92')||_0x3b88e4===_0xf77a('0x93')||_0x3b88e4===_0xf77a('0x94')||_0x3b88e4===_0xf77a('0x95')||_0x3b88e4===_0xf77a('0x96')||_0x3b88e4===_0xf77a('0x97')||_0x3b88e4==='modem'||_0x3b88e4===_0xf77a('0x98'))){_0x53b95e['push'](new Extension(_0x3ad8e2,_0x93e699,'FAXOPT('+_0x3b88e4+')='+_0x3ad8e2[_0x3b88e4],_0xf77a('0x90')));_0x93e699+=0x1;}}_0x53b95e[_0xf77a('0x8e')](new Extension(_0x3ad8e2,_0x93e699,'6',_0xf77a('0x99')));_0x93e699+=0x1;_0x53b95e['push'](new Extension(_0x3ad8e2,_0x93e699,_0xf77a('0x9a'),_0xf77a('0x9b')));_0x93e699=0x0;return _0x53b95e;}exports['addAccountApplications']=function(_0x2eb3bd,_0x54fbc7,_0x47ffdf){var _0x20a841;return db[_0xf77a('0x81')][_0xf77a('0x80')](function(_0x3590a8){return db[_0xf77a('0x42')][_0xf77a('0x5e')](_0x2eb3bd[_0xf77a('0x67')],{'transaction':_0x3590a8})[_0xf77a('0x23')](function(_0x411754){_0x20a841=_0x411754[_0xf77a('0x60')]({'plain':!![]});return db[_0xf77a('0x9c')][_0xf77a('0x9d')](createExtensionsReciveFax(_0x20a841),{'transaction':_0x3590a8});});})[_0xf77a('0x23')](function(){return _0x20a841;})['then'](respondWithResult(_0x54fbc7,null))[_0xf77a('0x5d')](handleError(_0x54fbc7,null));};exports[_0xf77a('0x9e')]=function(_0x352b7b,_0x141206,_0x18cd63){var _0xb6cf03;return db[_0xf77a('0x81')][_0xf77a('0x80')](function(_0x244fb1){return db[_0xf77a('0x42')][_0xf77a('0x36')](_0x352b7b['body'],{'where':{'id':_0x352b7b[_0xf77a('0x67')]['id']},'transaction':_0x244fb1})[_0xf77a('0x23')](function(_0x33866d){return db[_0xf77a('0x9c')]['destroy']({'where':{'FaxAccountId':_0x352b7b[_0xf77a('0x67')]['id']},'transaction':_0x244fb1})[_0xf77a('0x23')](function(_0xf8714c){return db[_0xf77a('0x9c')][_0xf77a('0x9d')](createExtensionsReciveFax(_[_0xf77a('0x9f')](_0x352b7b[_0xf77a('0x67')],['tech',_0xf77a('0x46'),_0xf77a('0xa0'),_0xf77a('0xa1'),_0xf77a('0xa2'),'ListId'])),{'transaction':_0x244fb1});});});})[_0xf77a('0x23')](function(){return db[_0xf77a('0x42')]['findById'](_0x352b7b[_0xf77a('0x67')]['id']);})[_0xf77a('0x23')](respondWithResult(_0x141206,null))[_0xf77a('0x5d')](handleError(_0x141206,null));};exports[_0xf77a('0xa3')]=function(_0x39c162,_0x3493a8,_0x2a7400){var _0x12f203={'raw':!![],'where':{}};var _0x18b804={};var _0x163c80={'count':0x0,'rows':[]};return db[_0xf77a('0x42')][_0xf77a('0x6c')]({'where':{'id':_0x39c162[_0xf77a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3493a8,null))['then'](function(_0x5386fb){if(_0x5386fb){_0x18b804['model']=_[_0xf77a('0x48')](db[_0xf77a('0xa4')][_0xf77a('0x43')]);_0x18b804[_0xf77a('0x49')]=_['keys'](_0x39c162[_0xf77a('0x49')]);_0x18b804[_0xf77a('0x4a')]=_[_0xf77a('0x4b')](_0x18b804[_0xf77a('0x47')],_0x18b804[_0xf77a('0x49')]);_0x12f203['attributes']=_[_0xf77a('0x4b')](_0x18b804[_0xf77a('0x47')],qs[_0xf77a('0x4c')](_0x39c162[_0xf77a('0x49')][_0xf77a('0x4c')]));_0x12f203[_0xf77a('0x4d')]=_0x12f203['attributes'][_0xf77a('0x4e')]?_0x12f203[_0xf77a('0x4d')]:_0x18b804[_0xf77a('0x47')];if(!_0x39c162['query'][_0xf77a('0x4f')](_0xf77a('0x50'))){_0x12f203[_0xf77a('0x30')]=qs['limit'](_0x39c162[_0xf77a('0x49')][_0xf77a('0x30')]);_0x12f203[_0xf77a('0x32')]=qs['offset'](_0x39c162[_0xf77a('0x49')][_0xf77a('0x32')]);}_0x12f203['order']=qs[_0xf77a('0x52')](_0x39c162[_0xf77a('0x49')][_0xf77a('0x52')]);_0x12f203[_0xf77a('0x55')]=qs[_0xf77a('0x4a')](_['pick'](_0x39c162[_0xf77a('0x49')],_0x18b804[_0xf77a('0x4a')]));_0x12f203[_0xf77a('0x55')]['FaxAccountId']=_0x5386fb['id'];if(_0x39c162[_0xf77a('0x49')][_0xf77a('0x54')]){_0x12f203[_0xf77a('0x55')]=_[_0xf77a('0x56')](_0x12f203[_0xf77a('0x55')],{'$or':_['map'](_0x12f203[_0xf77a('0x4d')],function(_0x1c2989){var _0x537d48={};_0x537d48[_0x1c2989]={'$like':'%'+_0x39c162[_0xf77a('0x49')][_0xf77a('0x54')]+'%'};return _0x537d48;})});}if(_0x39c162[_0xf77a('0x49')][_0xf77a('0xa5')]){var _0x246989=_0x39c162[_0xf77a('0x49')]['$gte'][_0xf77a('0xa6')](',');var _0x3764a6={};_0x3764a6[_0x246989[0x0]]={'$gte':moment(_0x246989[0x1])[_0xf77a('0xa7')](_0xf77a('0xa8'))};_0x12f203['where']=_[_0xf77a('0x56')](_0x12f203[_0xf77a('0x55')],_0x3764a6);}_0x12f203=_[_0xf77a('0x56')]({},_0x12f203,_0x39c162[_0xf77a('0x57')]);return db[_0xf77a('0xa4')][_0xf77a('0x31')]({'where':_0x12f203[_0xf77a('0x55')]})[_0xf77a('0x23')](function(_0xc5d7f7){_0x163c80[_0xf77a('0x31')]=_0xc5d7f7;if(_0x39c162[_0xf77a('0x49')][_0xf77a('0x58')]){_0x12f203[_0xf77a('0x5c')]=[{'all':!![]}];}return db[_0xf77a('0xa4')][_0xf77a('0x6e')](_0x12f203);})[_0xf77a('0x23')](function(_0x55694c){_0x163c80['rows']=_0x55694c;return _0x163c80;});}})['then'](respondWithFilteredResult(_0x3493a8,_0x12f203))[_0xf77a('0x5d')](handleError(_0x3493a8,null));};exports[_0xf77a('0x3d')]=function(_0x2a1025,_0x499fd1,_0x48e7bf){var _0x2f6698,_0x570168={},_0x5c6708;if(_0x2a1025[_0xf77a('0x67')]['to']){_0x5c6708=_0x2a1025[_0xf77a('0x67')]['to'][0x0];}return db[_0xf77a('0x42')][_0xf77a('0x63')]({'where':{'id':_0x2a1025[_0xf77a('0x5b')]['id']},'include':[{'model':db[_0xf77a('0xa9')],'as':'List','include':[{'model':db['CmContact'],'as':_0xf77a('0xaa'),'where':{'fax':_0x5c6708},'limit':0x1,'order':[[_0xf77a('0xa1'),_0xf77a('0xab')]]}]}]})[_0xf77a('0x23')](handleEntityNotFound(_0x499fd1,null))[_0xf77a('0x23')](function(_0x134c80){_0x2f6698=_0x134c80;if(_0x2a1025[_0xf77a('0x67')]['attachments']&&_0x2a1025[_0xf77a('0x67')]['attachments'][_0xf77a('0x4e')]){for(var _0x41f9bc=0x0;_0x41f9bc<_0x2a1025[_0xf77a('0x67')][_0xf77a('0xac')][_0xf77a('0x4e')];_0x41f9bc+=0x1){_0x2a1025[_0xf77a('0x67')][_0xf77a('0xac')][_0x41f9bc]={'filename':_0x2a1025['body'][_0xf77a('0xac')][_0x41f9bc][_0xf77a('0x3c')],'id':_0x2a1025[_0xf77a('0x67')][_0xf77a('0xac')][_0x41f9bc]['id'],'path':path['join'](config[_0xf77a('0xad')],'server/files/attachments',_0x2a1025[_0xf77a('0x67')]['attachments'][_0x41f9bc][_0xf77a('0xae')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0xf77a('0xaf')](_0x2a1025[_0xf77a('0x5b')]['id'])?undefined:_0x2a1025[_0xf77a('0x5b')]['id'],'path':_[_0xf77a('0xaf')](_0x2a1025['body'][_0xf77a('0xac')][0x0]['path'])?undefined:_0x2a1025[_0xf77a('0x67')][_0xf77a('0xac')][0x0][_0xf77a('0xb0')],'fax':_[_0xf77a('0xaf')](_0x2a1025[_0xf77a('0x67')]['to'][0x0])?undefined:_0x2a1025['body']['to'][0x0]},client9002);})[_0xf77a('0x23')](function(){if(_0x2f6698){if(_[_0xf77a('0xaf')](_0x2a1025[_0xf77a('0x67')][_0xf77a('0xb1')])){_0x2a1025[_0xf77a('0x67')][_0xf77a('0xb1')]=util[_0xf77a('0xa7')](_0xf77a('0xb2'),_0x2f6698['name'],_0x2f6698[_0xf77a('0xb3')]);}if(_0x2f6698[_0xf77a('0xb4')]){if(_0x2f6698[_0xf77a('0xb4')][_0xf77a('0xaa')][_0xf77a('0x4e')]){return _0x2f6698[_0xf77a('0xb4')][_0xf77a('0xaa')][0x0];}else{return db[_0xf77a('0xb5')][_0xf77a('0x5e')](_[_0xf77a('0x1c')](_0x2a1025[_0xf77a('0x67')],{'firstName':_0x2a1025[_0xf77a('0x67')]['to'][0x0],'phone':_0x2a1025['body']['to'][0x0],'fax':_0x2a1025[_0xf77a('0x67')]['to'][0x0],'ListId':_0x2f6698[_0xf77a('0xb6')]}));}}else{throw new Error(_0xf77a('0xb7'));}}else{throw new Error(_0xf77a('0xb8'));}})[_0xf77a('0x23')](function(_0x5afeb0){if(_0x5afeb0){return db[_0xf77a('0x76')][_0xf77a('0x63')]({'where':{'ContactId':_0x5afeb0['id'],'closed':![],'FaxAccountId':_0x2f6698['id']}})[_0xf77a('0x23')](function(_0x4e7c72){if(_0x4e7c72){return[_0x4e7c72,![]];}return db['FaxInteraction'][_0xf77a('0x5e')]({'UserId':_0x2a1025[_0xf77a('0x5f')]['id'],'ContactId':_0x5afeb0['id'],'FaxAccountId':_0x2f6698['id'],'fax':_0x2a1025[_0xf77a('0x67')]['to'][0x0],'firstMsgDirection':_0xf77a('0xb9'),'Messages':[_[_0xf77a('0x56')](_0x2a1025[_0xf77a('0x67')],{'read':![],'body':_0x2a1025[_0xf77a('0x67')]['attachments'][0x0][_0xf77a('0xba')],'FaxAccountId':_0x2f6698['id'],'UserId':_0x2a1025['user']['id'],'ContactId':_0x5afeb0['id'],'AttachmentId':_0x2a1025[_0xf77a('0x67')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xf77a('0xa4')],'as':_0xf77a('0xbb')}]})['then'](function(_0x1657ee){return[_0x1657ee,!![]];});});}else{throw new Error(_0xf77a('0xbc'));}})[_0xf77a('0xbd')](function(_0x3b382f,_0x355cd5){if(_0x355cd5){return _0x3b382f;}return db[_0xf77a('0xa4')][_0xf77a('0x5e')]({'direction':_0xf77a('0xb9'),'read':![],'body':_0x2a1025[_0xf77a('0x67')]['attachments'][0x0]['filename'],'FaxAccountId':_0x2f6698['id'],'FaxInteractionId':_0x3b382f['id'],'UserId':_0x2a1025[_0xf77a('0x5f')]['id'],'ContactId':_0x3b382f[_0xf77a('0xbe')],'AttachmentId':_0x2a1025[_0xf77a('0x67')]['attachments'][0x0]['id']})[_0xf77a('0x23')](function(_0x45b30c){_0x3b382f[_0xf77a('0xbf')][_0xf77a('0xbb')]=[];_0x3b382f['dataValues'][_0xf77a('0xbb')][_0xf77a('0x8e')](_0x45b30c[_0xf77a('0xbf')]);return _0x3b382f;});})[_0xf77a('0x23')](function(_0x26310c){respondWithRpcPromise('SendFax',_0xf77a('0xc0'),{'FaxAccountId':_[_0xf77a('0xaf')](_0x2a1025[_0xf77a('0x5b')]['id'])?undefined:_0x2a1025[_0xf77a('0x5b')]['id'],'path':_[_0xf77a('0xaf')](_0x2a1025[_0xf77a('0x67')][_0xf77a('0xac')][0x0][_0xf77a('0xb0')])?undefined:_0x2a1025['body'][_0xf77a('0xac')][0x0]['path'],'fax':_[_0xf77a('0xaf')](_0x2a1025['body']['to'][0x0])?undefined:_0x2a1025['body']['to'][0x0],'AttachmentId':_0x2a1025[_0xf77a('0x67')]['attachments'][0x0]['id']},client9002)[_0xf77a('0x23')](function(_0x38621c){logger[_0xf77a('0x24')](_0xf77a('0xc1'),_0x38621c);})[_0xf77a('0x5d')](function(_0x516a98){logger[_0xf77a('0x24')](_0xf77a('0xc1'),_0x516a98);});return _0x26310c;})[_0xf77a('0x23')](respondWithResult(_0x499fd1,null))[_0xf77a('0x5d')](handleError(_0x499fd1,null));};exports['addAgents']=function(_0xa2ea8b,_0xf799d,_0x10095c){return db[_0xf77a('0x42')][_0xf77a('0x63')]({'where':{'id':_0xa2ea8b[_0xf77a('0x5b')]['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0xf799d,null))[_0xf77a('0x23')](function(_0x39cb24){if(_0x39cb24){return _0x39cb24['addAgents'](_0xa2ea8b['body'][_0xf77a('0x73')],_[_0xf77a('0x9f')](_0xa2ea8b['body'],[_0xf77a('0x73'),'id'])||{})[_0xf77a('0xbd')](function(_0x597d92){for(var _0x514707=0x0;_0x514707<_0xa2ea8b['body']['ids'][_0xf77a('0x4e')];_0x514707+=0x1){socket[_0xf77a('0xc2')](_0xf77a('0xc3'),{'UserId':Number(_0xa2ea8b[_0xf77a('0x67')][_0xf77a('0x73')][_0x514707]),'FaxAccountId':Number(_0xa2ea8b[_0xf77a('0x5b')]['id'])});}return _0x597d92;});}})[_0xf77a('0x23')](respondWithResult(_0xf799d,null))[_0xf77a('0x5d')](handleError(_0xf799d,null));};exports[_0xf77a('0xc4')]=function(_0x122948,_0x248d58,_0x50b597){return db[_0xf77a('0x42')][_0xf77a('0x63')]({'where':{'id':_0x122948[_0xf77a('0x5b')]['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0x248d58,null))[_0xf77a('0x23')](function(_0x551f5d){if(_0x551f5d){return _0x551f5d['removeAgents'](_0x122948[_0xf77a('0x49')][_0xf77a('0x73')])['then'](function(){if(_[_0xf77a('0xc5')](_0x122948['query'][_0xf77a('0x73')])){for(var _0x268152=0x0;_0x268152<_0x122948[_0xf77a('0x49')]['ids'][_0xf77a('0x4e')];_0x268152+=0x1){socket[_0xf77a('0xc2')](_0xf77a('0xc6'),{'UserId':Number(_0x122948[_0xf77a('0x49')][_0xf77a('0x73')][_0x268152]),'FaxAccountId':Number(_0x122948[_0xf77a('0x5b')]['id'])});}}else{socket[_0xf77a('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x122948[_0xf77a('0x49')][_0xf77a('0x73')]),'FaxAccountId':Number(_0x122948['params']['id'])});}});}})['then'](respondWithStatusCode(_0x248d58,null))[_0xf77a('0x5d')](handleError(_0x248d58,null));};exports[_0xf77a('0xc7')]=function(_0x2d9089,_0x2221ed,_0x56b400){var _0x170dbb={};var _0x1efa70={};var _0x20f537;var _0x3dc91f;return db['FaxAccount']['findOne']({'where':{'id':_0x2d9089[_0xf77a('0x5b')]['id']}})[_0xf77a('0x23')](handleEntityNotFound(_0x2221ed,null))['then'](function(_0x57b891){if(_0x57b891){_0x20f537=_0x57b891;_0x1efa70['model']=_['keys'](db[_0xf77a('0x78')]['rawAttributes']);_0x1efa70['query']=_[_0xf77a('0x48')](_0x2d9089[_0xf77a('0x49')]);_0x1efa70['filters']=_[_0xf77a('0x4b')](_0x1efa70[_0xf77a('0x47')],_0x1efa70[_0xf77a('0x49')]);_0x170dbb[_0xf77a('0x4d')]=_['intersection'](_0x1efa70[_0xf77a('0x47')],qs[_0xf77a('0x4c')](_0x2d9089[_0xf77a('0x49')][_0xf77a('0x4c')]));_0x170dbb['attributes']=_0x170dbb[_0xf77a('0x4d')][_0xf77a('0x4e')]?_0x170dbb[_0xf77a('0x4d')]:_0x1efa70[_0xf77a('0x47')];_0x170dbb[_0xf77a('0x51')]=qs[_0xf77a('0x52')](_0x2d9089[_0xf77a('0x49')]['sort']);_0x170dbb[_0xf77a('0x55')]=qs['filters'](_[_0xf77a('0x53')](_0x2d9089['query'],_0x1efa70['filters']));if(_0x2d9089['query'][_0xf77a('0x54')]){_0x170dbb[_0xf77a('0x55')]=_['merge'](_0x170dbb['where'],{'$or':_[_0xf77a('0x41')](_0x170dbb[_0xf77a('0x4d')],function(_0x33e281){var _0x23ab9c={};_0x23ab9c[_0x33e281]={'$like':'%'+_0x2d9089['query'][_0xf77a('0x54')]+'%'};return _0x23ab9c;})});}_0x170dbb=_[_0xf77a('0x56')]({},_0x170dbb,_0x2d9089[_0xf77a('0x57')]);return _0x20f537['getAgents'](_0x170dbb);}})[_0xf77a('0x23')](function(_0xd15745){if(_0xd15745){_0x3dc91f=_0xd15745[_0xf77a('0x4e')];if(!_0x2d9089[_0xf77a('0x49')]['hasOwnProperty'](_0xf77a('0x50'))){_0x170dbb['limit']=qs[_0xf77a('0x30')](_0x2d9089['query'][_0xf77a('0x30')]);_0x170dbb['offset']=qs['offset'](_0x2d9089[_0xf77a('0x49')]['offset']);}return _0x20f537['getAgents'](_0x170dbb);}})[_0xf77a('0x23')](function(_0x1d2b45){if(_0x1d2b45){return _0x1d2b45?{'count':_0x3dc91f,'rows':_0x1d2b45}:null;}})[_0xf77a('0x23')](respondWithResult(_0x2221ed,null))[_0xf77a('0x5d')](handleError(_0x2221ed,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 256c2c5..ccad29c 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 _0x7533=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x7533,0xce));var _0x3753=function(_0xc4379f,_0x32d435){_0xc4379f=_0xc4379f-0x0;var _0x184a96=_0x7533[_0xc4379f];return _0x184a96;};'use strict';var EventEmitter=require(_0x3753('0x0'));var FaxAccount=require(_0x3753('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3753('0x2')](0x0);var events={'afterCreate':_0x3753('0x3'),'afterUpdate':_0x3753('0x4'),'afterDestroy':_0x3753('0x5')};function emitEvent(_0xa286b0){return function(_0x1e62bb,_0x360ed7,_0x5719bd){FaxAccountEvents['emit'](_0xa286b0+':'+_0x1e62bb['id'],_0x1e62bb);FaxAccountEvents[_0x3753('0x6')](_0xa286b0,_0x1e62bb);_0x5719bd(null);};}for(var e in events){if(events[_0x3753('0x7')](e)){var event=events[e];FaxAccount[_0x3753('0x8')](e,emitEvent(event));}}module[_0x3753('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xa0d5=['exports','../../mysqldb','remove','emit','hasOwnProperty'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xa0d5,0xab));var _0x5a0d=function(_0x97d4b6,_0x1b8eab){_0x97d4b6=_0x97d4b6-0x0;var _0x364238=_0xa0d5[_0x97d4b6];return _0x364238;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x5a0d('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5a0d('0x1')};function emitEvent(_0x1f3f70){return function(_0x1ad6b3,_0x206b98,_0x14ed29){FaxAccountEvents[_0x5a0d('0x2')](_0x1f3f70+':'+_0x1ad6b3['id'],_0x1ad6b3);FaxAccountEvents['emit'](_0x1f3f70,_0x1ad6b3);_0x14ed29(null);};}for(var e in events){if(events[_0x5a0d('0x3')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x5a0d('0x4')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index be3ec64..6cf1452 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 _0x4106=['../../config/environment','./faxAccount.attributes','exports','fax_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3421a4,_0x572086){var _0xba94fb=function(_0x19781d){while(--_0x19781d){_0x3421a4['push'](_0x3421a4['shift']());}};_0xba94fb(++_0x572086);}(_0x4106,0xa9));var _0x6410=function(_0x2ce801,_0x2178f7){_0x2ce801=_0x2ce801-0x0;var _0x29f2b1=_0x4106[_0x2ce801];return _0x29f2b1;};'use strict';var _=require(_0x6410('0x0'));var util=require(_0x6410('0x1'));var logger=require(_0x6410('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6410('0x3'));var rp=require(_0x6410('0x4'));var fs=require('fs');var path=require(_0x6410('0x5'));var rimraf=require(_0x6410('0x6'));var config=require(_0x6410('0x7'));var attributes=require(_0x6410('0x8'));module[_0x6410('0x9')]=function(_0x41eb69,_0xffcb0){return _0x41eb69['define']('FaxAccount',attributes,{'tableName':_0x6410('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x708b=['request-promise','rimraf','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash','util','api','moment','bluebird'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x708b,0x69));var _0xb708=function(_0x3db003,_0x3b9ffa){_0x3db003=_0x3db003-0x0;var _0x46e823=_0x708b[_0x3db003];return _0x46e823;};'use strict';var _=require(_0xb708('0x0'));var util=require(_0xb708('0x1'));var logger=require('../../config/logger')(_0xb708('0x2'));var moment=require(_0xb708('0x3'));var BPromise=require(_0xb708('0x4'));var rp=require(_0xb708('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb708('0x6'));var config=require('../../config/environment');var attributes=require(_0xb708('0x7'));module[_0xb708('0x8')]=function(_0x2d7272,_0x3e3ae6){return _0x2d7272['define'](_0xb708('0x9'),attributes,{'tableName':_0xb708('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 6184118..50b525f 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 _0xfb7c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','findAll','options','raw','include','model','attributes','map','GetFaxAccount','stringify','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','CmList','Contacts','DESC','FaxApplication','Applications','List','account','applications','list','orderBy','priority','asc','length','defaults','create','contact','fax','spread','get','autoclose','push','unmanaged','*,*,*,*','created','FaxMessage','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','catch','lodash'];(function(_0x1ecee0,_0x24b169){var _0x317202=function(_0xc43592){while(--_0xc43592){_0x1ecee0['push'](_0x1ecee0['shift']());}};_0x317202(++_0x24b169);}(_0xfb7c,0x163));var _0xcfb7=function(_0x1ce393,_0x162bde){_0x1ce393=_0x1ce393-0x0;var _0x54151b=_0xfb7c[_0x1ce393];return _0x54151b;};'use strict';var _=require(_0xcfb7('0x0'));var util=require('util');var moment=require(_0xcfb7('0x1'));var BPromise=require(_0xcfb7('0x2'));var rs=require(_0xcfb7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfb7('0x4'))['db'];var utils=require(_0xcfb7('0x5'));var logger=require(_0xcfb7('0x6'))('rpc');var config=require(_0xcfb7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfb7('0x8')]({'port':0x232c});config[_0xcfb7('0x9')]=_['defaults'](config[_0xcfb7('0x9')],{'host':_0xcfb7('0xa'),'port':0x18eb});var socket=require(_0xcfb7('0xb'))(new Redis(config[_0xcfb7('0x9')]));require(_0xcfb7('0xc'))[_0xcfb7('0xd')](socket);function respondWithRpcPromise(_0x2b3173,_0x1ffa37,_0x37a83c){return new BPromise(function(_0x4dab0d,_0x2bd1a4){return client[_0xcfb7('0xe')](_0x2b3173,_0x37a83c)[_0xcfb7('0xf')](function(_0xdf2fbf){logger['info'](_0xcfb7('0x10'),_0x1ffa37,'request\x20sent');logger[_0xcfb7('0x11')](_0xcfb7('0x12'),_0x1ffa37,_0xcfb7('0x13'),JSON['stringify'](_0xdf2fbf));if(_0xdf2fbf[_0xcfb7('0x14')]){if(_0xdf2fbf[_0xcfb7('0x14')]['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x1ffa37,_0xdf2fbf[_0xcfb7('0x14')]['message']);return _0x2bd1a4(_0xdf2fbf[_0xcfb7('0x14')][_0xcfb7('0x15')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x1ffa37,_0xdf2fbf['error'][_0xcfb7('0x15')]);return _0x4dab0d(_0xdf2fbf[_0xcfb7('0x14')][_0xcfb7('0x15')]);}else{logger[_0xcfb7('0x16')](_0xcfb7('0x10'),_0x1ffa37,_0xcfb7('0x13'));_0x4dab0d(_0xdf2fbf[_0xcfb7('0x17')][_0xcfb7('0x15')]);}})['catch'](function(_0x25b999){logger[_0xcfb7('0x14')](_0xcfb7('0x10'),_0x1ffa37,_0x25b999);_0x2bd1a4(_0x25b999);});});}exports['GetFaxAccount']=function(_0x177f06){var _0x316b77=this;return new Promise(function(_0x460eb3,_0x54af62){return db['FaxAccount'][_0xcfb7('0x18')]({'raw':_0x177f06[_0xcfb7('0x19')]?_0x177f06[_0xcfb7('0x19')][_0xcfb7('0x1a')]===undefined?!![]:![]:!![],'where':_0x177f06['options']?_0x177f06['options']['where']||null:null,'attributes':_0x177f06['options']?_0x177f06[_0xcfb7('0x19')]['attributes']||null:null,'limit':_0x177f06[_0xcfb7('0x19')]?_0x177f06['options']['limit']||null:null,'include':_0x177f06[_0xcfb7('0x19')]?_0x177f06['options'][_0xcfb7('0x1b')]?_['map'](_0x177f06[_0xcfb7('0x19')]['include'],function(_0x4a1d7f){return{'model':db[_0x4a1d7f[_0xcfb7('0x1c')]],'as':_0x4a1d7f['as'],'attributes':_0x4a1d7f[_0xcfb7('0x1d')],'include':_0x4a1d7f[_0xcfb7('0x1b')]?_[_0xcfb7('0x1e')](_0x4a1d7f['include'],function(_0x496720){return{'model':db[_0x496720['model']],'as':_0x496720['as'],'attributes':_0x496720[_0xcfb7('0x1d')],'include':_0x496720[_0xcfb7('0x1b')]?_[_0xcfb7('0x1e')](_0x496720['include'],function(_0x42acf9){return{'model':db[_0x42acf9['model']],'as':_0x42acf9['as'],'attributes':_0x42acf9[_0xcfb7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcfb7('0xf')](function(_0x2cbb21){logger['info'](_0xcfb7('0x1f'),_0x177f06);logger[_0xcfb7('0x11')](_0xcfb7('0x1f'),_0x177f06,JSON[_0xcfb7('0x20')](_0x2cbb21));_0x460eb3(_0x2cbb21);})['catch'](function(_0x9558c6){logger[_0xcfb7('0x14')]('GetFaxAccount',_0x9558c6[_0xcfb7('0x15')],_0x177f06);_0x54af62(_0x316b77[_0xcfb7('0x14')](0x1f4,_0x9558c6[_0xcfb7('0x15')]));});});};exports['NotifyFaxAccount']=function(_0x28803a,_0xac0372,_0x1c682a){var _0x4a982c=this;return new Promise(function(_0x4bd5c6,_0x1ace1e){var _0x2d0490={'body':_0x28803a['body'],'channel':'fax'};var _0x505e96=[];var _0x1c432f=[];var _0x247a8a={};return db[_0xcfb7('0x21')][_0xcfb7('0x22')]()['then'](function(_0x2ced8b){if(!_0x2ced8b){throw new db[(_0xcfb7('0x23'))][(_0xcfb7('0x24'))](_0xcfb7('0x25'));}_0x505e96=_[_0xcfb7('0x26')](_[_0xcfb7('0x27')](_0x2ced8b),[_0xcfb7('0x28'),_0xcfb7('0x29')]);_0x1c432f=_[_0xcfb7('0x26')](_['keys'](_0x2ced8b),[_0xcfb7('0x28'),_0xcfb7('0x29'),_0xcfb7('0x2a'),_0xcfb7('0x2b')]);if(_0x28803a[_0xcfb7('0x2c')]['id']){delete _0x28803a[_0xcfb7('0x2c')]['id'];}if(_[_0xcfb7('0x2d')](_0x28803a['body'][_0xcfb7('0x2e')])){throw new db[(_0xcfb7('0x23'))][(_0xcfb7('0x24'))](_0xcfb7('0x2f'));}if(_[_0xcfb7('0x2d')](_0x28803a[_0xcfb7('0x2c')][_0xcfb7('0x2c')])||_0x28803a[_0xcfb7('0x2c')][_0xcfb7('0x2c')]===''){throw new db[(_0xcfb7('0x23'))][(_0xcfb7('0x24'))](_0xcfb7('0x30'));}if(_[_0xcfb7('0x2d')](_0x28803a[_0xcfb7('0x2c')]['mapKey'])){throw new db[(_0xcfb7('0x23'))][(_0xcfb7('0x24'))](_0xcfb7('0x31')+_0x1c432f);}if(!_['includes'](_0x1c432f,_0x28803a[_0xcfb7('0x2c')]['mapKey'])){throw new db[(_0xcfb7('0x23'))][(_0xcfb7('0x24'))](_0xcfb7('0x32')+_0x1c432f);}_0x247a8a[_0x28803a[_0xcfb7('0x2c')][_0xcfb7('0x33')]]=_0x28803a[_0xcfb7('0x2c')]['from'];})[_0xcfb7('0xf')](function(){return db['FaxAccount'][_0xcfb7('0x34')]({'where':{'id':_0x28803a['account']['id']},'include':[{'model':db[_0xcfb7('0x35')],'as':'List','include':[{'model':db[_0xcfb7('0x21')],'as':_0xcfb7('0x36'),'where':_0x247a8a,'limit':0x1,'order':[[_0xcfb7('0x29'),_0xcfb7('0x37')]]}]},{'model':db[_0xcfb7('0x38')],'as':_0xcfb7('0x39')}]});})[_0xcfb7('0xf')](function(_0x568792){if(_0x568792&&_0x568792[_0xcfb7('0x3a')]){var _0x289b2f=_0x568792['get']({'plain':!![]});_0x2d0490[_0xcfb7('0x3b')]=_0x289b2f;_0x2d0490[_0xcfb7('0x3c')]=_0x289b2f['Applications'];_0x2d0490[_0xcfb7('0x3d')]=_0x289b2f[_0xcfb7('0x3a')];_0x2d0490[_0xcfb7('0x3c')]=_[_0xcfb7('0x3e')](_0x2d0490['applications'],[_0xcfb7('0x3f')],[_0xcfb7('0x40')]);if(_0x2d0490[_0xcfb7('0x3b')][_0xcfb7('0x39')]){delete _0x2d0490[_0xcfb7('0x3b')]['Applications'];}if(_0x2d0490[_0xcfb7('0x3b')][_0xcfb7('0x3a')]&&_0x2d0490[_0xcfb7('0x3b')][_0xcfb7('0x3a')][_0xcfb7('0x36')][_0xcfb7('0x41')]){return _0x2d0490[_0xcfb7('0x3b')][_0xcfb7('0x3a')][_0xcfb7('0x36')][0x0];}var _0x1816e0=_[_0xcfb7('0x42')](_0x28803a['body'],{'firstName':_0x28803a['body'][_0xcfb7('0x2e')],'ListId':_0x289b2f[_0xcfb7('0x2b')]});_0x1816e0[_0x28803a['body'][_0xcfb7('0x33')]]=_0x28803a[_0xcfb7('0x2c')][_0xcfb7('0x2e')];return db['CmContact'][_0xcfb7('0x43')](_0x1816e0,{'fields':_0x505e96,'raw':!![]});}})[_0xcfb7('0xf')](function(_0x1109c5){_0x2d0490[_0xcfb7('0x44')]=_0x1109c5;if(_0x1109c5){var _0x1ae863={'ContactId':_0x1109c5['id'],'FaxAccountId':_0x28803a[_0xcfb7('0x3b')]['id'],'fax':_0x1109c5[_0xcfb7('0x45')]};return db['FaxInteraction'][_0xcfb7('0x34')]({'where':{'ContactId':_0x1109c5['id'],'closed':![],'FaxAccountId':_0x28803a[_0xcfb7('0x3b')]['id']}})[_0xcfb7('0xf')](function(_0x3fbade){if(_0x3fbade){return[_0x3fbade,![]];}return db['FaxInteraction'][_0xcfb7('0x43')](_0x1ae863)[_0xcfb7('0xf')](function(_0x36f18a){return[_0x36f18a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xcfb7('0x46')](function(_0x37e2de,_0x3b9e13){var _0x52b3de=_0x37e2de[_0xcfb7('0x47')]({'plain':!![]});if(_0x3b9e13){if(_0x2d0490[_0xcfb7('0x3b')][_0xcfb7('0x48')]){_0x2d0490[_0xcfb7('0x3c')][_0xcfb7('0x49')]({'id':0x0,'priority':_0x2d0490[_0xcfb7('0x3c')][_0xcfb7('0x41')]+0x1,'app':'close','appdata':_0xcfb7('0x4a'),'interval':_0xcfb7('0x4b')});}_0x52b3de[_0xcfb7('0x4c')]=!![];}else{_0x52b3de['created']=![];}_0x2d0490['interaction']=_0x52b3de;return db[_0xcfb7('0x4d')][_0xcfb7('0x43')]({'body':_0x28803a[_0xcfb7('0x2c')]['body'],'FaxAccountId':_0x28803a['account']['id'],'FaxInteractionId':_0x37e2de['id'],'direction':'in','ContactId':_0x37e2de['ContactId'],'AttachmentId':_0x28803a[_0xcfb7('0x2c')][_0xcfb7('0x4e')]});})['then'](function(_0x20aecd){_0x2d0490[_0xcfb7('0x15')]=_0x20aecd;if(_0x2d0490[_0xcfb7('0x4f')][_0xcfb7('0x50')]){return db[_0xcfb7('0x51')][_0xcfb7('0x34')]({'attributes':['id',_0xcfb7('0x52')],'where':{'id':_0x2d0490[_0xcfb7('0x4f')][_0xcfb7('0x50')]}})[_0xcfb7('0xf')](function(_0x3fb746){if(_0x3fb746){_0x2d0490[_0xcfb7('0x3c')][_0xcfb7('0x53')]({'id':0x0,'priority':0x0,'app':_0xcfb7('0x54'),'appdata':_0x3fb746[_0xcfb7('0x52')]+','+(_0x2d0490[_0xcfb7('0x3b')][_0xcfb7('0x55')]||0xa),'interval':_0xcfb7('0x4b')});}return respondWithRpcPromise(_0xcfb7('0x56'),_0xcfb7('0x57'),_0x2d0490);});}return respondWithRpcPromise(_0xcfb7('0x56'),_0xcfb7('0x57'),_0x2d0490);})[_0xcfb7('0xf')](function(_0x152267){_0x4bd5c6(_0x152267);})[_0xcfb7('0x58')](function(_0x3f3ca1){_0x1ace1e(_0x4a982c[_0xcfb7('0x14')](0x1f4,_0x3f3ca1['message']));});});}; \ No newline at end of file +var _0xfa21=['model','attributes','NotifyFaxAccount','body','fax','CmContact','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','length','create','FaxInteraction','Contact\x20not\x20found','spread','close','unmanaged','interaction','FaxMessage','ContactId','UserId','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','where','map','include'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xfa21,0xdc));var _0x1fa2=function(_0x59e5e8,_0x3bfa2a){_0x59e5e8=_0x59e5e8-0x0;var _0x1ebb02=_0xfa21[_0x59e5e8];return _0x1ebb02;};'use strict';var _=require('lodash');var util=require(_0x1fa2('0x0'));var moment=require(_0x1fa2('0x1'));var BPromise=require(_0x1fa2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fa2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1fa2('0x4'))(_0x1fa2('0x5'));var config=require(_0x1fa2('0x6'));var jayson=require(_0x1fa2('0x7'));var client=jayson[_0x1fa2('0x8')][_0x1fa2('0x9')]({'port':0x232c});config[_0x1fa2('0xa')]=_[_0x1fa2('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1fa2('0xc'))(new Redis(config[_0x1fa2('0xa')]));require(_0x1fa2('0xd'))[_0x1fa2('0xe')](socket);function respondWithRpcPromise(_0x168ecb,_0x53f3fb,_0x2b1323){return new BPromise(function(_0x18566c,_0x281a3e){return client[_0x1fa2('0xf')](_0x168ecb,_0x2b1323)[_0x1fa2('0x10')](function(_0x4d32f3){logger[_0x1fa2('0x11')](_0x1fa2('0x12'),_0x53f3fb,_0x1fa2('0x13'));logger[_0x1fa2('0x14')](_0x1fa2('0x15'),_0x53f3fb,'request\x20sent',JSON[_0x1fa2('0x16')](_0x4d32f3));if(_0x4d32f3[_0x1fa2('0x17')]){if(_0x4d32f3[_0x1fa2('0x17')][_0x1fa2('0x18')]===0x1f4){logger[_0x1fa2('0x17')](_0x1fa2('0x12'),_0x53f3fb,_0x4d32f3['error']['message']);return _0x281a3e(_0x4d32f3['error'][_0x1fa2('0x19')]);}logger['error'](_0x1fa2('0x12'),_0x53f3fb,_0x4d32f3[_0x1fa2('0x17')][_0x1fa2('0x19')]);return _0x18566c(_0x4d32f3[_0x1fa2('0x17')][_0x1fa2('0x19')]);}else{logger[_0x1fa2('0x11')]('FaxAccount,\x20%s,\x20%s',_0x53f3fb,_0x1fa2('0x13'));_0x18566c(_0x4d32f3[_0x1fa2('0x1a')][_0x1fa2('0x19')]);}})[_0x1fa2('0x1b')](function(_0x5136dd){logger[_0x1fa2('0x17')](_0x1fa2('0x12'),_0x53f3fb,_0x5136dd);_0x281a3e(_0x5136dd);});});}exports[_0x1fa2('0x1c')]=function(_0x4a504e){var _0x473aea=this;return new Promise(function(_0xec6595,_0x267cb5){return db[_0x1fa2('0x1d')][_0x1fa2('0x1e')]({'raw':_0x4a504e[_0x1fa2('0x1f')]?_0x4a504e[_0x1fa2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4a504e[_0x1fa2('0x1f')]?_0x4a504e['options'][_0x1fa2('0x20')]||null:null,'attributes':_0x4a504e['options']?_0x4a504e[_0x1fa2('0x1f')]['attributes']||null:null,'limit':_0x4a504e['options']?_0x4a504e[_0x1fa2('0x1f')]['limit']||null:null,'include':_0x4a504e[_0x1fa2('0x1f')]?_0x4a504e[_0x1fa2('0x1f')]['include']?_[_0x1fa2('0x21')](_0x4a504e[_0x1fa2('0x1f')][_0x1fa2('0x22')],function(_0x148e5d){return{'model':db[_0x148e5d[_0x1fa2('0x23')]],'as':_0x148e5d['as'],'attributes':_0x148e5d[_0x1fa2('0x24')],'include':_0x148e5d[_0x1fa2('0x22')]?_['map'](_0x148e5d[_0x1fa2('0x22')],function(_0x3d1e93){return{'model':db[_0x3d1e93['model']],'as':_0x3d1e93['as'],'attributes':_0x3d1e93[_0x1fa2('0x24')],'include':_0x3d1e93[_0x1fa2('0x22')]?_[_0x1fa2('0x21')](_0x3d1e93[_0x1fa2('0x22')],function(_0x1347e1){return{'model':db[_0x1347e1[_0x1fa2('0x23')]],'as':_0x1347e1['as'],'attributes':_0x1347e1[_0x1fa2('0x24')]};}):[]};}):[]};}):[]:[]})[_0x1fa2('0x10')](function(_0x5a6980){logger[_0x1fa2('0x11')](_0x1fa2('0x1c'),_0x4a504e);logger[_0x1fa2('0x14')]('GetFaxAccount',_0x4a504e,JSON[_0x1fa2('0x16')](_0x5a6980));_0xec6595(_0x5a6980);})[_0x1fa2('0x1b')](function(_0x54d02b){logger[_0x1fa2('0x17')](_0x1fa2('0x1c'),_0x54d02b[_0x1fa2('0x19')],_0x4a504e);_0x267cb5(_0x473aea[_0x1fa2('0x17')](0x1f4,_0x54d02b[_0x1fa2('0x19')]));});});};exports[_0x1fa2('0x25')]=function(_0x5c9a85,_0xadf679,_0x31067b){var _0x588e0a=this;return new Promise(function(_0x29c55b,_0xe75b74){var _0x221c46={'body':_0x5c9a85[_0x1fa2('0x26')],'channel':_0x1fa2('0x27')};var _0x4c232a=[];var _0x5dcd71=[];var _0x8b2062={};return db[_0x1fa2('0x28')]['describe']()['then'](function(_0x18ceb7){if(!_0x18ceb7){throw new db['Sequelize'][(_0x1fa2('0x29'))]('no\x20available\x20attributes');}_0x4c232a=_[_0x1fa2('0x2a')](_[_0x1fa2('0x2b')](_0x18ceb7),['createdAt','updatedAt']);_0x5dcd71=_[_0x1fa2('0x2a')](_[_0x1fa2('0x2b')](_0x18ceb7),[_0x1fa2('0x2c'),_0x1fa2('0x2d'),_0x1fa2('0x2e'),_0x1fa2('0x2f')]);if(_0x5c9a85['body']['id']){delete _0x5c9a85[_0x1fa2('0x26')]['id'];}if(_['isNil'](_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x30')])){throw new db[(_0x1fa2('0x31'))][(_0x1fa2('0x29'))](_0x1fa2('0x32'));}if(_[_0x1fa2('0x33')](_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x26')])||_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x26')]===''){throw new db[(_0x1fa2('0x31'))][(_0x1fa2('0x29'))](_0x1fa2('0x34'));}if(_[_0x1fa2('0x33')](_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x35')])){throw new db[(_0x1fa2('0x31'))][(_0x1fa2('0x29'))](_0x1fa2('0x36')+_0x5dcd71);}if(!_['includes'](_0x5dcd71,_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x35')])){throw new db[(_0x1fa2('0x31'))][(_0x1fa2('0x29'))](_0x1fa2('0x37')+_0x5dcd71);}_0x8b2062[_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x35')]]=_0x5c9a85[_0x1fa2('0x26')]['from'];})['then'](function(){return db[_0x1fa2('0x1d')][_0x1fa2('0x38')]({'where':{'id':_0x5c9a85[_0x1fa2('0x39')]['id']},'include':[{'model':db[_0x1fa2('0x3a')],'as':_0x1fa2('0x3b'),'include':[{'model':db[_0x1fa2('0x28')],'as':_0x1fa2('0x3c'),'where':_0x8b2062,'limit':0x1,'order':[[_0x1fa2('0x2d'),_0x1fa2('0x3d')]]}]},{'model':db[_0x1fa2('0x3e')],'as':_0x1fa2('0x3f')}]});})[_0x1fa2('0x10')](function(_0x23b648){if(_0x23b648&&_0x23b648[_0x1fa2('0x3b')]){var _0x5d5362=_0x23b648[_0x1fa2('0x40')]({'plain':!![]});_0x221c46[_0x1fa2('0x39')]=_0x5d5362;_0x221c46[_0x1fa2('0x41')]=_0x5d5362[_0x1fa2('0x3f')];_0x221c46['list']=_0x5d5362[_0x1fa2('0x3b')];_0x221c46[_0x1fa2('0x41')]=_[_0x1fa2('0x42')](_0x221c46[_0x1fa2('0x41')],['priority'],['asc']);if(_0x221c46[_0x1fa2('0x39')][_0x1fa2('0x3f')]){delete _0x221c46['account'][_0x1fa2('0x3f')];}if(_0x221c46['account'][_0x1fa2('0x3b')]&&_0x221c46[_0x1fa2('0x39')][_0x1fa2('0x3b')][_0x1fa2('0x3c')][_0x1fa2('0x43')]){return _0x221c46[_0x1fa2('0x39')][_0x1fa2('0x3b')][_0x1fa2('0x3c')][0x0];}var _0x55e84a=_[_0x1fa2('0xb')](_0x5c9a85[_0x1fa2('0x26')],{'firstName':_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x30')],'ListId':_0x5d5362['ListId']});_0x55e84a[_0x5c9a85['body'][_0x1fa2('0x35')]]=_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x30')];return db[_0x1fa2('0x28')][_0x1fa2('0x44')](_0x55e84a,{'fields':_0x4c232a,'raw':!![]});}})['then'](function(_0x23d13a){_0x221c46['contact']=_0x23d13a;if(_0x23d13a){var _0x3be43a={'ContactId':_0x23d13a['id'],'FaxAccountId':_0x5c9a85[_0x1fa2('0x39')]['id'],'fax':_0x23d13a[_0x1fa2('0x27')]};return db[_0x1fa2('0x45')]['find']({'where':{'ContactId':_0x23d13a['id'],'closed':![],'FaxAccountId':_0x5c9a85[_0x1fa2('0x39')]['id']}})[_0x1fa2('0x10')](function(_0x5bf090){if(_0x5bf090){return[_0x5bf090,![]];}return db[_0x1fa2('0x45')][_0x1fa2('0x44')](_0x3be43a)[_0x1fa2('0x10')](function(_0x44014f){return[_0x44014f,!![]];});});}else{throw new Error(_0x1fa2('0x46'));}})[_0x1fa2('0x47')](function(_0x567c14,_0x1b2248){var _0x27fba5=_0x567c14[_0x1fa2('0x40')]({'plain':!![]});if(_0x1b2248){if(_0x221c46[_0x1fa2('0x39')]['autoclose']){_0x221c46[_0x1fa2('0x41')]['push']({'id':0x0,'priority':_0x221c46['applications'][_0x1fa2('0x43')]+0x1,'app':_0x1fa2('0x48'),'appdata':_0x1fa2('0x49'),'interval':'*,*,*,*'});}_0x27fba5['created']=!![];}else{_0x27fba5['created']=![];}_0x221c46[_0x1fa2('0x4a')]=_0x27fba5;return db[_0x1fa2('0x4b')][_0x1fa2('0x44')]({'body':_0x5c9a85[_0x1fa2('0x26')][_0x1fa2('0x26')],'FaxAccountId':_0x5c9a85[_0x1fa2('0x39')]['id'],'FaxInteractionId':_0x567c14['id'],'direction':'in','ContactId':_0x567c14[_0x1fa2('0x4c')],'AttachmentId':_0x5c9a85[_0x1fa2('0x26')]['AttachmentId']});})[_0x1fa2('0x10')](function(_0xd6388b){_0x221c46[_0x1fa2('0x19')]=_0xd6388b;if(_0x221c46[_0x1fa2('0x4a')][_0x1fa2('0x4d')]){return db['User'][_0x1fa2('0x38')]({'attributes':['id','name'],'where':{'id':_0x221c46[_0x1fa2('0x4a')]['UserId']}})['then'](function(_0x2aa4e0){if(_0x2aa4e0){_0x221c46[_0x1fa2('0x41')][_0x1fa2('0x4e')]({'id':0x0,'priority':0x0,'app':_0x1fa2('0x4f'),'appdata':_0x2aa4e0[_0x1fa2('0x50')]+','+(_0x221c46[_0x1fa2('0x39')][_0x1fa2('0x51')]||0xa),'interval':_0x1fa2('0x52')});}return respondWithRpcPromise('Start',_0x1fa2('0x53'),_0x221c46);});}return respondWithRpcPromise(_0x1fa2('0x54'),_0x1fa2('0x53'),_0x221c46);})[_0x1fa2('0x10')](function(_0x21a6a6){_0x29c55b(_0x21a6a6);})[_0x1fa2('0x1b')](function(_0x11655a){_0xe75b74(_0x588e0a[_0x1fa2('0x17')](0x1f4,_0x11655a[_0x1fa2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 77ca421..d443555 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 _0xd13a=['remove','emit','removeListener','register','length','faxAccount:','save'];(function(_0x2ec282,_0x25a614){var _0x126b20=function(_0x26df9f){while(--_0x26df9f){_0x2ec282['push'](_0x2ec282['shift']());}};_0x126b20(++_0x25a614);}(_0xd13a,0x1db));var _0xad13=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xd13a[_0x263a74];return _0x2aa86c;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xad13('0x0'),_0xad13('0x1'),'update'];function createListener(_0x4ceb7b,_0x24e1a0){return function(_0x3f8204){_0x24e1a0[_0xad13('0x2')](_0x4ceb7b,_0x3f8204);};}function removeListener(_0x40e599,_0x320215){return function(){FaxAccountEvents[_0xad13('0x3')](_0x40e599,_0x320215);};}exports[_0xad13('0x4')]=function(_0x22b4a3){for(var _0x33ed5a=0x0,_0x34f821=events[_0xad13('0x5')];_0x33ed5a<_0x34f821;_0x33ed5a++){var _0x48d698=events[_0x33ed5a];var _0x145d10=createListener(_0xad13('0x6')+_0x48d698,_0x22b4a3);FaxAccountEvents['on'](_0x48d698,_0x145d10);}}; \ No newline at end of file +var _0xa926=['register','length','save','update','removeListener'];(function(_0x238049,_0x43e7f7){var _0x5a942c=function(_0x4fcdad){while(--_0x4fcdad){_0x238049['push'](_0x238049['shift']());}};_0x5a942c(++_0x43e7f7);}(_0xa926,0x124));var _0x6a92=function(_0x312b4d,_0x1199ed){_0x312b4d=_0x312b4d-0x0;var _0x3809d6=_0xa926[_0x312b4d];return _0x3809d6;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x6a92('0x0'),'remove',_0x6a92('0x1')];function createListener(_0x168dea,_0x152878){return function(_0x39e0d0){_0x152878['emit'](_0x168dea,_0x39e0d0);};}function removeListener(_0x11c608,_0x147e56){return function(){FaxAccountEvents[_0x6a92('0x2')](_0x11c608,_0x147e56);};}exports[_0x6a92('0x3')]=function(_0x286673){for(var _0x4d2924=0x0,_0x3f1b49=events[_0x6a92('0x4')];_0x4d2924<_0x3f1b49;_0x4d2924++){var _0x4e5354=events[_0x4d2924];var _0x29e6e4=createListener('faxAccount:'+_0x4e5354,_0x286673);FaxAccountEvents['on'](_0x4e5354,_0x29e6e4);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 8e50b32..cf3b04e 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x30cf9e,_0xf2c7fc){var _0x23539e=function(_0x45e7a2){while(--_0x45e7a2){_0x30cf9e['push'](_0x30cf9e['shift']());}};_0x23539e(++_0xf2c7fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x3fdc21,_0xfa0b17){var _0x4dfc52=function(_0x2e25ce){while(--_0x2e25ce){_0x3fdc21['push'](_0x3fdc21['shift']());}};_0x4dfc52(++_0xfa0b17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 047b78a..3741ca8 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 _0x79a5=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x52f178,_0x22de16){var _0x3e4cba=function(_0x1a6e4a){while(--_0x1a6e4a){_0x52f178['push'](_0x52f178['shift']());}};_0x3e4cba(++_0x22de16);}(_0x79a5,0x1ea));var _0x579a=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x79a5[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0x579a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x579a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x579a('0x2')],'allowNull':![],'defaultValue':_0x579a('0x3')},'appdata':{'type':Sequelize[_0x579a('0x4')]()},'description':{'type':Sequelize[_0x579a('0x2')]},'interval':{'type':Sequelize[_0x579a('0x2')],'defaultValue':_0x579a('0x5')}}; \ No newline at end of file +var _0x3de8=['noop','TEXT','INTEGER','STRING'];(function(_0x416707,_0xe2e6e7){var _0xd6170e=function(_0x54a21a){while(--_0x54a21a){_0x416707['push'](_0x416707['shift']());}};_0xd6170e(++_0xe2e6e7);}(_0x3de8,0xea));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x83de('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x83de('0x1')],'allowNull':![],'defaultValue':_0x83de('0x2')},'appdata':{'type':Sequelize[_0x83de('0x3')]()},'description':{'type':Sequelize[_0x83de('0x1')]},'interval':{'type':Sequelize[_0x83de('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 35ec70f..c546e33 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 _0xe4ec=['destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','params','find','catch','create','body'];(function(_0x414d78,_0x8b5fca){var _0x56b128=function(_0x2643f2){while(--_0x2643f2){_0x414d78['push'](_0x414d78['shift']());}};_0x56b128(++_0x8b5fca);}(_0xe4ec,0x1c3));var _0xce4e=function(_0x208bf7,_0x37f7d3){_0x208bf7=_0x208bf7-0x0;var _0x44f01d=_0xe4ec[_0x208bf7];return _0x44f01d;};'use strict';var emlformat=require(_0xce4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce4e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce4e('0x2'));var moment=require(_0xce4e('0x3'));var BPromise=require(_0xce4e('0x4'));var Mustache=require(_0xce4e('0x5'));var util=require(_0xce4e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xce4e('0x7'));var ejs=require(_0xce4e('0x8'));var fs=require('fs');var fs_extra=require(_0xce4e('0x9'));var _=require('lodash');var squel=require(_0xce4e('0xa'));var crypto=require(_0xce4e('0xb'));var jsforce=require(_0xce4e('0xc'));var deskjs=require(_0xce4e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xce4e('0xe'));var Papa=require(_0xce4e('0xf'));var Redis=require(_0xce4e('0x10'));var authService=require(_0xce4e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce4e('0x12'));var hardwareService=require(_0xce4e('0x13'));var logger=require('../../config/logger')(_0xce4e('0x14'));var utils=require(_0xce4e('0x15'));var config=require(_0xce4e('0x16'));var licenseUtil=require(_0xce4e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f5797,_0x36f6bf){_0x36f6bf=_0x36f6bf||0xcc;return function(_0x4bbf82){if(_0x4bbf82){return _0x4f5797[_0xce4e('0x18')](_0x36f6bf);}return _0x4f5797[_0xce4e('0x19')](_0x36f6bf)[_0xce4e('0x1a')]();};}function respondWithResult(_0x1bdf41,_0x5e29eb){_0x5e29eb=_0x5e29eb||0xc8;return function(_0x4207e7){if(_0x4207e7){return _0x1bdf41[_0xce4e('0x19')](_0x5e29eb)[_0xce4e('0x1b')](_0x4207e7);}};}function respondWithFilteredResult(_0x356169,_0x5bac08){return function(_0x52fe1){if(_0x52fe1){var _0x367893=typeof _0x5bac08[_0xce4e('0x1c')]==='undefined'&&typeof _0x5bac08[_0xce4e('0x1d')]===_0xce4e('0x1e');var _0x4d79b7=_0x52fe1['count'];var _0x5e4aae=_0x367893?0x0:_0x5bac08[_0xce4e('0x1c')];var _0x25216c=_0x367893?_0x52fe1[_0xce4e('0x1f')]:_0x5bac08[_0xce4e('0x1c')]+_0x5bac08[_0xce4e('0x1d')];var _0x4a76b3;if(_0x25216c>=_0x4d79b7){_0x25216c=_0x4d79b7;_0x4a76b3=0xc8;}else{_0x4a76b3=0xce;}_0x356169['status'](_0x4a76b3);return _0x356169[_0xce4e('0x20')](_0xce4e('0x21'),_0x5e4aae+'-'+_0x25216c+'/'+_0x4d79b7)[_0xce4e('0x1b')](_0x52fe1);}return null;};}function patchUpdates(_0x231325){return function(_0x4ad5cf){try{jsonpatch['apply'](_0x4ad5cf,_0x231325,!![]);}catch(_0x5df7c6){return BPromise[_0xce4e('0x22')](_0x5df7c6);}return _0x4ad5cf[_0xce4e('0x23')]();};}function saveUpdates(_0xab5d2b,_0x589809){return function(_0x57660b){if(_0x57660b){return _0x57660b[_0xce4e('0x24')](_0xab5d2b)[_0xce4e('0x25')](function(_0x557609){return _0x557609;});}return null;};}function removeEntity(_0x44ce8e,_0x4b9cd5){return function(_0x45ff64){if(_0x45ff64){return _0x45ff64['destroy']()['then'](function(){_0x44ce8e['status'](0xcc)[_0xce4e('0x1a')]();});}};}function handleEntityNotFound(_0x521d64,_0x3aa3da){return function(_0x5a4b0a){if(!_0x5a4b0a){_0x521d64['sendStatus'](0x194);}return _0x5a4b0a;};}function handleError(_0x5dca44,_0x489ac7){_0x489ac7=_0x489ac7||0x1f4;return function(_0xb1af3b){logger[_0xce4e('0x26')](_0xb1af3b[_0xce4e('0x27')]);if(_0xb1af3b[_0xce4e('0x28')]){delete _0xb1af3b['name'];}_0x5dca44[_0xce4e('0x19')](_0x489ac7)[_0xce4e('0x29')](_0xb1af3b);};}exports[_0xce4e('0x2a')]=function(_0x51b30f,_0x240315){var _0x2047f3={},_0x41e151={},_0xc1bfc2={'count':0x0,'rows':[]};var _0x3a598c=_['map'](db[_0xce4e('0x2b')][_0xce4e('0x2c')],function(_0x368db5){return{'name':_0x368db5[_0xce4e('0x2d')],'type':_0x368db5[_0xce4e('0x2e')][_0xce4e('0x2f')]};});_0x41e151[_0xce4e('0x30')]=_[_0xce4e('0x31')](_0x3a598c,_0xce4e('0x28'));_0x41e151[_0xce4e('0x32')]=_[_0xce4e('0x33')](_0x51b30f[_0xce4e('0x32')]);_0x41e151['filters']=_[_0xce4e('0x34')](_0x41e151[_0xce4e('0x30')],_0x41e151[_0xce4e('0x32')]);_0x2047f3[_0xce4e('0x35')]=_[_0xce4e('0x34')](_0x41e151[_0xce4e('0x30')],qs[_0xce4e('0x36')](_0x51b30f[_0xce4e('0x32')][_0xce4e('0x36')]));_0x2047f3[_0xce4e('0x35')]=_0x2047f3[_0xce4e('0x35')][_0xce4e('0x37')]?_0x2047f3[_0xce4e('0x35')]:_0x41e151[_0xce4e('0x30')];if(!_0x51b30f[_0xce4e('0x32')][_0xce4e('0x38')](_0xce4e('0x39'))){_0x2047f3[_0xce4e('0x1d')]=qs[_0xce4e('0x1d')](_0x51b30f['query'][_0xce4e('0x1d')]);_0x2047f3[_0xce4e('0x1c')]=qs['offset'](_0x51b30f['query'][_0xce4e('0x1c')]);}_0x2047f3[_0xce4e('0x3a')]=qs[_0xce4e('0x3b')](_0x51b30f['query'][_0xce4e('0x3b')]);_0x2047f3[_0xce4e('0x3c')]=qs[_0xce4e('0x3d')](_[_0xce4e('0x3e')](_0x51b30f[_0xce4e('0x32')],_0x41e151[_0xce4e('0x3d')]),_0x3a598c);if(_0x51b30f[_0xce4e('0x32')][_0xce4e('0x3f')]){_0x2047f3[_0xce4e('0x3c')]=_[_0xce4e('0x40')](_0x2047f3['where'],{'$or':_[_0xce4e('0x31')](_0x3a598c,function(_0x4e28ac){if(_0x4e28ac[_0xce4e('0x2e')]!==_0xce4e('0x41')){var _0x5bf126={};_0x5bf126[_0x4e28ac[_0xce4e('0x28')]]={'$like':'%'+_0x51b30f[_0xce4e('0x32')]['filter']+'%'};return _0x5bf126;}})});}_0x2047f3=_[_0xce4e('0x40')]({},_0x2047f3,_0x51b30f['options']);var _0x1648fd={'where':_0x2047f3[_0xce4e('0x3c')]};return db['FaxApplication'][_0xce4e('0x1f')](_0x1648fd)[_0xce4e('0x25')](function(_0x1d5026){_0xc1bfc2[_0xce4e('0x1f')]=_0x1d5026;if(_0x51b30f[_0xce4e('0x32')][_0xce4e('0x42')]){_0x2047f3[_0xce4e('0x43')]=[{'all':!![]}];}return db[_0xce4e('0x2b')]['findAll'](_0x2047f3);})[_0xce4e('0x25')](function(_0x4c6333){_0xc1bfc2[_0xce4e('0x44')]=_0x4c6333;return _0xc1bfc2;})[_0xce4e('0x25')](respondWithFilteredResult(_0x240315,_0x2047f3))['catch'](handleError(_0x240315,null));};exports['show']=function(_0x1c06dc,_0x5dc8c8){var _0x197205={'raw':!![],'where':{'id':_0x1c06dc[_0xce4e('0x45')]['id']}},_0x5c76eb={};_0x5c76eb[_0xce4e('0x30')]=_['keys'](db[_0xce4e('0x2b')][_0xce4e('0x2c')]);_0x5c76eb[_0xce4e('0x32')]=_[_0xce4e('0x33')](_0x1c06dc[_0xce4e('0x32')]);_0x5c76eb[_0xce4e('0x3d')]=_[_0xce4e('0x34')](_0x5c76eb[_0xce4e('0x30')],_0x5c76eb[_0xce4e('0x32')]);_0x197205[_0xce4e('0x35')]=_[_0xce4e('0x34')](_0x5c76eb[_0xce4e('0x30')],qs[_0xce4e('0x36')](_0x1c06dc['query'][_0xce4e('0x36')]));_0x197205[_0xce4e('0x35')]=_0x197205[_0xce4e('0x35')]['length']?_0x197205[_0xce4e('0x35')]:_0x5c76eb[_0xce4e('0x30')];if(_0x1c06dc[_0xce4e('0x32')][_0xce4e('0x42')]){_0x197205[_0xce4e('0x43')]=[{'all':!![]}];}_0x197205=_[_0xce4e('0x40')]({},_0x197205,_0x1c06dc['options']);return db[_0xce4e('0x2b')][_0xce4e('0x46')](_0x197205)[_0xce4e('0x25')](handleEntityNotFound(_0x5dc8c8,null))['then'](respondWithResult(_0x5dc8c8,null))[_0xce4e('0x47')](handleError(_0x5dc8c8,null));};exports[_0xce4e('0x48')]=function(_0x572e86,_0x4ea14c){return db[_0xce4e('0x2b')]['create'](_0x572e86[_0xce4e('0x49')],{})['then'](respondWithResult(_0x4ea14c,0xc9))[_0xce4e('0x47')](handleError(_0x4ea14c,null));};exports['update']=function(_0x68ccb3,_0x126037){if(_0x68ccb3[_0xce4e('0x49')]['id']){delete _0x68ccb3['body']['id'];}return db[_0xce4e('0x2b')][_0xce4e('0x46')]({'where':{'id':_0x68ccb3[_0xce4e('0x45')]['id']}})[_0xce4e('0x25')](handleEntityNotFound(_0x126037,null))[_0xce4e('0x25')](saveUpdates(_0x68ccb3[_0xce4e('0x49')],null))[_0xce4e('0x25')](respondWithResult(_0x126037,null))[_0xce4e('0x47')](handleError(_0x126037,null));};exports[_0xce4e('0x4a')]=function(_0x94e8de,_0x190906){return db['FaxApplication'][_0xce4e('0x46')]({'where':{'id':_0x94e8de['params']['id']}})[_0xce4e('0x25')](handleEntityNotFound(_0x190906,null))[_0xce4e('0x25')](removeEntity(_0x190906,null))[_0xce4e('0x47')](handleError(_0x190906,null));}; \ No newline at end of file +var _0x3289=['attributes','length','order','sort','where','pick','merge','filter','options','include','rows','catch','show','params','FaxApplication','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../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','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields'];(function(_0x2904a1,_0x330878){var _0x56afe2=function(_0x4b0b59){while(--_0x4b0b59){_0x2904a1['push'](_0x2904a1['shift']());}};_0x56afe2(++_0x330878);}(_0x3289,0xe7));var _0x9328=function(_0x47d7a8,_0x5f4e8d){_0x47d7a8=_0x47d7a8-0x0;var _0x439015=_0x3289[_0x47d7a8];return _0x439015;};'use strict';var emlformat=require(_0x9328('0x0'));var rimraf=require(_0x9328('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9328('0x2'));var rp=require(_0x9328('0x3'));var moment=require(_0x9328('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9328('0x5'));var util=require(_0x9328('0x6'));var path=require('path');var sox=require(_0x9328('0x7'));var csv=require(_0x9328('0x8'));var ejs=require(_0x9328('0x9'));var fs=require('fs');var fs_extra=require(_0x9328('0xa'));var _=require(_0x9328('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9328('0xc'));var toCsv=require(_0x9328('0x8'));var querystring=require(_0x9328('0xd'));var Papa=require(_0x9328('0xe'));var Redis=require(_0x9328('0xf'));var authService=require(_0x9328('0x10'));var qs=require(_0x9328('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9328('0x12'));var logger=require(_0x9328('0x13'))('api');var utils=require(_0x9328('0x14'));var config=require(_0x9328('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9328('0x16'))['db'];function respondWithStatusCode(_0x4c0b62,_0x2d7c23){_0x2d7c23=_0x2d7c23||0xcc;return function(_0x4e4f5b){if(_0x4e4f5b){return _0x4c0b62[_0x9328('0x17')](_0x2d7c23);}return _0x4c0b62[_0x9328('0x18')](_0x2d7c23)[_0x9328('0x19')]();};}function respondWithResult(_0x13814a,_0x12b2a1){_0x12b2a1=_0x12b2a1||0xc8;return function(_0x180ca5){if(_0x180ca5){return _0x13814a['status'](_0x12b2a1)[_0x9328('0x1a')](_0x180ca5);}};}function respondWithFilteredResult(_0x3f9c07,_0xed3422){return function(_0x42624e){if(_0x42624e){var _0x5ab41e=typeof _0xed3422[_0x9328('0x1b')]===_0x9328('0x1c')&&typeof _0xed3422[_0x9328('0x1d')]===_0x9328('0x1c');var _0xe1765=_0x42624e[_0x9328('0x1e')];var _0x4740c6=_0x5ab41e?0x0:_0xed3422[_0x9328('0x1b')];var _0x4897c5=_0x5ab41e?_0x42624e[_0x9328('0x1e')]:_0xed3422['offset']+_0xed3422[_0x9328('0x1d')];var _0x9c916a;if(_0x4897c5>=_0xe1765){_0x4897c5=_0xe1765;_0x9c916a=0xc8;}else{_0x9c916a=0xce;}_0x3f9c07[_0x9328('0x18')](_0x9c916a);return _0x3f9c07[_0x9328('0x1f')](_0x9328('0x20'),_0x4740c6+'-'+_0x4897c5+'/'+_0xe1765)['json'](_0x42624e);}return null;};}function patchUpdates(_0x1ede69){return function(_0x11fdac){try{jsonpatch[_0x9328('0x21')](_0x11fdac,_0x1ede69,!![]);}catch(_0x50658f){return BPromise['reject'](_0x50658f);}return _0x11fdac[_0x9328('0x22')]();};}function saveUpdates(_0x4842bb,_0x26c703){return function(_0x4b4b0e){if(_0x4b4b0e){return _0x4b4b0e[_0x9328('0x23')](_0x4842bb)[_0x9328('0x24')](function(_0x321d5b){return _0x321d5b;});}return null;};}function removeEntity(_0x263a7e,_0x5e1c7a){return function(_0x3a6b59){if(_0x3a6b59){return _0x3a6b59[_0x9328('0x25')]()[_0x9328('0x24')](function(){_0x263a7e['status'](0xcc)[_0x9328('0x19')]();});}};}function handleEntityNotFound(_0x46abef,_0x3c05aa){return function(_0x4fab2f){if(!_0x4fab2f){_0x46abef[_0x9328('0x17')](0x194);}return _0x4fab2f;};}function handleError(_0xca6308,_0x56e604){_0x56e604=_0x56e604||0x1f4;return function(_0x50209e){logger[_0x9328('0x26')](_0x50209e[_0x9328('0x27')]);if(_0x50209e['name']){delete _0x50209e[_0x9328('0x28')];}_0xca6308['status'](_0x56e604)[_0x9328('0x29')](_0x50209e);};}exports['index']=function(_0x30bcfd,_0x2403c3){var _0xc8428={},_0x512537={},_0x2b64e1={'count':0x0,'rows':[]};var _0x2f75fc=_[_0x9328('0x2a')](db['FaxApplication'][_0x9328('0x2b')],function(_0x5d0b51){return{'name':_0x5d0b51[_0x9328('0x2c')],'type':_0x5d0b51[_0x9328('0x2d')][_0x9328('0x2e')]};});_0x512537['model']=_['map'](_0x2f75fc,_0x9328('0x28'));_0x512537[_0x9328('0x2f')]=_[_0x9328('0x30')](_0x30bcfd[_0x9328('0x2f')]);_0x512537[_0x9328('0x31')]=_[_0x9328('0x32')](_0x512537[_0x9328('0x33')],_0x512537[_0x9328('0x2f')]);_0xc8428['attributes']=_['intersection'](_0x512537[_0x9328('0x33')],qs[_0x9328('0x34')](_0x30bcfd[_0x9328('0x2f')][_0x9328('0x34')]));_0xc8428[_0x9328('0x35')]=_0xc8428[_0x9328('0x35')][_0x9328('0x36')]?_0xc8428[_0x9328('0x35')]:_0x512537[_0x9328('0x33')];if(!_0x30bcfd[_0x9328('0x2f')]['hasOwnProperty']('nolimit')){_0xc8428[_0x9328('0x1d')]=qs[_0x9328('0x1d')](_0x30bcfd['query'][_0x9328('0x1d')]);_0xc8428[_0x9328('0x1b')]=qs[_0x9328('0x1b')](_0x30bcfd['query']['offset']);}_0xc8428[_0x9328('0x37')]=qs[_0x9328('0x38')](_0x30bcfd[_0x9328('0x2f')][_0x9328('0x38')]);_0xc8428[_0x9328('0x39')]=qs[_0x9328('0x31')](_[_0x9328('0x3a')](_0x30bcfd[_0x9328('0x2f')],_0x512537[_0x9328('0x31')]),_0x2f75fc);if(_0x30bcfd[_0x9328('0x2f')]['filter']){_0xc8428['where']=_[_0x9328('0x3b')](_0xc8428[_0x9328('0x39')],{'$or':_[_0x9328('0x2a')](_0x2f75fc,function(_0x5a1579){if(_0x5a1579['type']!=='VIRTUAL'){var _0x3a123e={};_0x3a123e[_0x5a1579[_0x9328('0x28')]]={'$like':'%'+_0x30bcfd[_0x9328('0x2f')][_0x9328('0x3c')]+'%'};return _0x3a123e;}})});}_0xc8428=_['merge']({},_0xc8428,_0x30bcfd[_0x9328('0x3d')]);var _0x3eb26a={'where':_0xc8428['where']};return db['FaxApplication']['count'](_0x3eb26a)[_0x9328('0x24')](function(_0x2ca223){_0x2b64e1['count']=_0x2ca223;if(_0x30bcfd['query']['includeAll']){_0xc8428[_0x9328('0x3e')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0xc8428);})[_0x9328('0x24')](function(_0x2cfce6){_0x2b64e1[_0x9328('0x3f')]=_0x2cfce6;return _0x2b64e1;})['then'](respondWithFilteredResult(_0x2403c3,_0xc8428))[_0x9328('0x40')](handleError(_0x2403c3,null));};exports[_0x9328('0x41')]=function(_0x2b390a,_0xc906b3){var _0x226ba8={'raw':!![],'where':{'id':_0x2b390a[_0x9328('0x42')]['id']}},_0x321fbd={};_0x321fbd[_0x9328('0x33')]=_[_0x9328('0x30')](db[_0x9328('0x43')]['rawAttributes']);_0x321fbd[_0x9328('0x2f')]=_[_0x9328('0x30')](_0x2b390a['query']);_0x321fbd[_0x9328('0x31')]=_['intersection'](_0x321fbd[_0x9328('0x33')],_0x321fbd[_0x9328('0x2f')]);_0x226ba8[_0x9328('0x35')]=_[_0x9328('0x32')](_0x321fbd[_0x9328('0x33')],qs[_0x9328('0x34')](_0x2b390a[_0x9328('0x2f')]['fields']));_0x226ba8['attributes']=_0x226ba8['attributes']['length']?_0x226ba8[_0x9328('0x35')]:_0x321fbd[_0x9328('0x33')];if(_0x2b390a[_0x9328('0x2f')]['includeAll']){_0x226ba8[_0x9328('0x3e')]=[{'all':!![]}];}_0x226ba8=_[_0x9328('0x3b')]({},_0x226ba8,_0x2b390a['options']);return db[_0x9328('0x43')]['find'](_0x226ba8)['then'](handleEntityNotFound(_0xc906b3,null))[_0x9328('0x24')](respondWithResult(_0xc906b3,null))[_0x9328('0x40')](handleError(_0xc906b3,null));};exports[_0x9328('0x44')]=function(_0x4b7533,_0x140cf9){return db[_0x9328('0x43')]['create'](_0x4b7533[_0x9328('0x45')],{})[_0x9328('0x24')](respondWithResult(_0x140cf9,0xc9))['catch'](handleError(_0x140cf9,null));};exports[_0x9328('0x23')]=function(_0x2b7555,_0x3e2cdf){if(_0x2b7555[_0x9328('0x45')]['id']){delete _0x2b7555[_0x9328('0x45')]['id'];}return db[_0x9328('0x43')][_0x9328('0x46')]({'where':{'id':_0x2b7555['params']['id']}})[_0x9328('0x24')](handleEntityNotFound(_0x3e2cdf,null))[_0x9328('0x24')](saveUpdates(_0x2b7555[_0x9328('0x45')],null))['then'](respondWithResult(_0x3e2cdf,null))[_0x9328('0x40')](handleError(_0x3e2cdf,null));};exports[_0x9328('0x25')]=function(_0x555030,_0x1a6370){return db['FaxApplication']['find']({'where':{'id':_0x555030[_0x9328('0x42')]['id']}})[_0x9328('0x24')](handleEntityNotFound(_0x1a6370,null))[_0x9328('0x24')](removeEntity(_0x1a6370,null))['catch'](handleError(_0x1a6370,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index b25e77b..c3084b6 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 _0x4dbb=['rimraf','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3a779c,_0x56d698){var _0x5785aa=function(_0x542e8e){while(--_0x542e8e){_0x3a779c['push'](_0x3a779c['shift']());}};_0x5785aa(++_0x56d698);}(_0x4dbb,0x1f3));var _0xb4db=function(_0x3c98c1,_0x524e3c){_0x3c98c1=_0x3c98c1-0x0;var _0x45c21b=_0x4dbb[_0x3c98c1];return _0x45c21b;};'use strict';var _=require(_0xb4db('0x0'));var util=require('util');var logger=require(_0xb4db('0x1'))(_0xb4db('0x2'));var moment=require(_0xb4db('0x3'));var BPromise=require(_0xb4db('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb4db('0x5'));var config=require('../../config/environment');var attributes=require(_0xb4db('0x6'));module[_0xb4db('0x7')]=function(_0x825884,_0x1f3f15){return _0x825884['define'](_0xb4db('0x8'),attributes,{'tableName':_0xb4db('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4db('0xa'),'collate':_0xb4db('0xb')});}; \ No newline at end of file +var _0x8428=['fax_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication'];(function(_0x167bb0,_0x26b77d){var _0x4d3531=function(_0x9405b8){while(--_0x9405b8){_0x167bb0['push'](_0x167bb0['shift']());}};_0x4d3531(++_0x26b77d);}(_0x8428,0x152));var _0x8842=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8428[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8842('0x0'));var util=require('util');var logger=require(_0x8842('0x1'))(_0x8842('0x2'));var moment=require(_0x8842('0x3'));var BPromise=require(_0x8842('0x4'));var rp=require(_0x8842('0x5'));var fs=require('fs');var path=require(_0x8842('0x6'));var rimraf=require(_0x8842('0x7'));var config=require(_0x8842('0x8'));var attributes=require(_0x8842('0x9'));module[_0x8842('0xa')]=function(_0x5a3584,_0x46ff1e){return _0x5a3584['define'](_0x8842('0xb'),attributes,{'tableName':_0x8842('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8842('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 350c5df..076e505 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 _0x4bf4=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','lodash'];(function(_0x45ee92,_0x3e04aa){var _0x4fdaff=function(_0x5ac20b){while(--_0x5ac20b){_0x45ee92['push'](_0x45ee92['shift']());}};_0x4fdaff(++_0x3e04aa);}(_0x4bf4,0xef));var _0x44bf=function(_0x5c3f7c,_0x35db9f){_0x5c3f7c=_0x5c3f7c-0x0;var _0x410420=_0x4bf4[_0x5c3f7c];return _0x410420;};'use strict';var _=require(_0x44bf('0x0'));var util=require('util');var moment=require(_0x44bf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44bf('0x2'));var db=require(_0x44bf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x44bf('0x4'))(_0x44bf('0x5'));var config=require(_0x44bf('0x6'));var jayson=require(_0x44bf('0x7'));var client=jayson['client'][_0x44bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x157957,_0x197ccf,_0x537e4b){return new BPromise(function(_0x520849,_0x59de57){return client[_0x44bf('0x9')](_0x157957,_0x537e4b)[_0x44bf('0xa')](function(_0x5b555c){logger[_0x44bf('0xb')](_0x44bf('0xc'),_0x197ccf,'request\x20sent');logger[_0x44bf('0xd')](_0x44bf('0xe'),_0x197ccf,'request\x20sent',JSON[_0x44bf('0xf')](_0x5b555c));if(_0x5b555c[_0x44bf('0x10')]){if(_0x5b555c[_0x44bf('0x10')][_0x44bf('0x11')]===0x1f4){logger[_0x44bf('0x10')](_0x44bf('0xc'),_0x197ccf,_0x5b555c[_0x44bf('0x10')]['message']);return _0x59de57(_0x5b555c['error'][_0x44bf('0x12')]);}logger[_0x44bf('0x10')](_0x44bf('0xc'),_0x197ccf,_0x5b555c[_0x44bf('0x10')][_0x44bf('0x12')]);return _0x520849(_0x5b555c[_0x44bf('0x10')][_0x44bf('0x12')]);}else{logger[_0x44bf('0xb')](_0x44bf('0xc'),_0x197ccf,_0x44bf('0x13'));_0x520849(_0x5b555c[_0x44bf('0x14')][_0x44bf('0x12')]);}})[_0x44bf('0x15')](function(_0xae966a){logger[_0x44bf('0x10')]('FaxApplication,\x20%s,\x20%s',_0x197ccf,_0xae966a);_0x59de57(_0xae966a);});});}exports['UpdateFaxApplication']=function(_0x13f35f){var _0x4cdff7=this;return new Promise(function(_0x196b10,_0x47a35f){return db['FaxApplication'][_0x44bf('0x16')](_0x13f35f[_0x44bf('0x17')],{'raw':_0x13f35f[_0x44bf('0x18')]?_0x13f35f[_0x44bf('0x18')][_0x44bf('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13f35f[_0x44bf('0x18')]?_0x13f35f[_0x44bf('0x18')][_0x44bf('0x1a')]||null:null,'attributes':_0x13f35f['options']?_0x13f35f[_0x44bf('0x18')][_0x44bf('0x1b')]||null:null,'limit':_0x13f35f['options']?_0x13f35f[_0x44bf('0x18')][_0x44bf('0x1c')]||null:null})[_0x44bf('0xa')](function(_0x4cd947){logger[_0x44bf('0xb')](_0x44bf('0x1d'),_0x13f35f);logger['debug'](_0x44bf('0x1d'),_0x13f35f,JSON['stringify'](_0x4cd947));_0x196b10(_0x4cd947);})[_0x44bf('0x15')](function(_0x5d3e07){logger[_0x44bf('0x10')]('UpdateFaxApplication',_0x5d3e07['message'],_0x13f35f);_0x47a35f(_0x4cdff7[_0x44bf('0x10')](0x1f4,_0x5d3e07[_0x44bf('0x12')]));});});}; \ No newline at end of file +var _0x2b18=['error','code','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','where','attributes','lodash','util','moment','ioredis','rpc','jayson/promise','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b18,0x11e));var _0x82b1=function(_0x8654fd,_0x3c0e71){_0x8654fd=_0x8654fd-0x0;var _0x3dcc0b=_0x2b18[_0x8654fd];return _0x3dcc0b;};'use strict';var _=require(_0x82b1('0x0'));var util=require(_0x82b1('0x1'));var moment=require(_0x82b1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x82b1('0x4'));var config=require('../../config/environment');var jayson=require(_0x82b1('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x554d75,_0x38f426,_0x26e87c){return new BPromise(function(_0x4f4646,_0x4af5ab){return client[_0x82b1('0x6')](_0x554d75,_0x26e87c)[_0x82b1('0x7')](function(_0x3cc818){logger[_0x82b1('0x8')](_0x82b1('0x9'),_0x38f426,_0x82b1('0xa'));logger[_0x82b1('0xb')](_0x82b1('0xc'),_0x38f426,_0x82b1('0xa'),JSON[_0x82b1('0xd')](_0x3cc818));if(_0x3cc818[_0x82b1('0xe')]){if(_0x3cc818[_0x82b1('0xe')][_0x82b1('0xf')]===0x1f4){logger[_0x82b1('0xe')]('FaxApplication,\x20%s,\x20%s',_0x38f426,_0x3cc818[_0x82b1('0xe')][_0x82b1('0x10')]);return _0x4af5ab(_0x3cc818[_0x82b1('0xe')]['message']);}logger['error'](_0x82b1('0x9'),_0x38f426,_0x3cc818[_0x82b1('0xe')][_0x82b1('0x10')]);return _0x4f4646(_0x3cc818[_0x82b1('0xe')][_0x82b1('0x10')]);}else{logger[_0x82b1('0x8')]('FaxApplication,\x20%s,\x20%s',_0x38f426,_0x82b1('0xa'));_0x4f4646(_0x3cc818[_0x82b1('0x11')][_0x82b1('0x10')]);}})[_0x82b1('0x12')](function(_0xb29ae){logger[_0x82b1('0xe')](_0x82b1('0x9'),_0x38f426,_0xb29ae);_0x4af5ab(_0xb29ae);});});}exports[_0x82b1('0x13')]=function(_0x49f748){var _0x5ebdfd=this;return new Promise(function(_0x5182dd,_0x5dc5d3){return db[_0x82b1('0x14')]['update'](_0x49f748[_0x82b1('0x15')],{'raw':_0x49f748[_0x82b1('0x16')]?_0x49f748[_0x82b1('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49f748[_0x82b1('0x16')]?_0x49f748[_0x82b1('0x16')][_0x82b1('0x17')]||null:null,'attributes':_0x49f748[_0x82b1('0x16')]?_0x49f748[_0x82b1('0x16')][_0x82b1('0x18')]||null:null,'limit':_0x49f748['options']?_0x49f748[_0x82b1('0x16')]['limit']||null:null})['then'](function(_0x272457){logger['info'](_0x82b1('0x13'),_0x49f748);logger[_0x82b1('0xb')](_0x82b1('0x13'),_0x49f748,JSON['stringify'](_0x272457));_0x5182dd(_0x272457);})[_0x82b1('0x12')](function(_0x5c9eb2){logger[_0x82b1('0xe')]('UpdateFaxApplication',_0x5c9eb2['message'],_0x49f748);_0x5dc5d3(_0x5ebdfd[_0x82b1('0xe')](0x1f4,_0x5c9eb2['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 1819864..a3ed9fd 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 _0xe511=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','show','post','put'];(function(_0x282270,_0x1c9730){var _0x41bc56=function(_0x2a0318){while(--_0x2a0318){_0x282270['push'](_0x282270['shift']());}};_0x41bc56(++_0x1c9730);}(_0xe511,0x16f));var _0x1e51=function(_0xbacbef,_0x4f0636){_0xbacbef=_0xbacbef-0x0;var _0x30e757=_0xe511[_0xbacbef];return _0x30e757;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e51('0xc')](_0x1e51('0xd'),auth[_0x1e51('0xe')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')](_0x1e51('0xd'),auth['isAuthenticated'](),controller[_0x1e51('0x11')]);module[_0x1e51('0x12')]=router; \ No newline at end of file +var _0xb03e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x4c3550,_0x171432){var _0x2dc5f7=function(_0x388dce){while(--_0x388dce){_0x4c3550['push'](_0x4c3550['shift']());}};_0x2dc5f7(++_0x171432);}(_0xb03e,0x1eb));var _0xeb03=function(_0xe1efe2,_0x596cb1){_0xe1efe2=_0xe1efe2-0x0;var _0x1133c7=_0xb03e[_0xe1efe2];return _0x1133c7;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var fs_extra=require(_0xeb03('0x5'));var auth=require(_0xeb03('0x6'));var interaction=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var controller=require(_0xeb03('0x9'));router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xe')]('/',auth[_0xeb03('0xb')](),controller['create']);router[_0xeb03('0xf')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller['update']);router[_0xeb03('0x10')]('/:id',auth[_0xeb03('0xb')](),controller[_0xeb03('0x11')]);module[_0xeb03('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 4a01b61..1c5e062 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 _0x84d1=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x84d1,0xdc));var _0x184d=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x84d1[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x184d('0x0'));module[_0x184d('0x1')]={'closed':{'type':Sequelize[_0x184d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x184d('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x184d('0x4')]},'read1stAt':{'type':Sequelize[_0x184d('0x3')]},'fax':{'type':Sequelize[_0x184d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x184d('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x184d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x184d('0x5')]('in',_0x184d('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x95d3=['exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x3852df,_0x299709){var _0xa162a3=function(_0x10416f){while(--_0x10416f){_0x3852df['push'](_0x3852df['shift']());}};_0xa162a3(++_0x299709);}(_0x95d3,0x89));var _0x395d=function(_0xfc316b,_0x3bec1a){_0xfc316b=_0xfc316b-0x0;var _0x359fc7=_0x95d3[_0xfc316b];return _0x359fc7;};'use strict';var Sequelize=require(_0x395d('0x0'));module[_0x395d('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x395d('0x2')]},'disposition':{'type':Sequelize[_0x395d('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x395d('0x3')]},'read1stAt':{'type':Sequelize[_0x395d('0x2')]},'fax':{'type':Sequelize[_0x395d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x395d('0x4')]('in',_0x395d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x395d('0x4')]('in',_0x395d('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index f799a08..c7a8367 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 _0xeb75=['unlinkSync','rimraf','zip-dir','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','error','send','index','FaxInteraction','rawAttributes','type','getOptions','findAll','fax','catch','params','model','keys','query','intersection','fields','length','attributes','include','create','body','update','destroy','find','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','order','pick','where','FaxInteractionId','map','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','merge','options','includeAll','setTags','spread','Tag','name','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','tmp','attachments','push','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','err'];(function(_0x216137,_0x18e6a7){var _0x38f6ba=function(_0x1e435e){while(--_0x1e435e){_0x216137['push'](_0x216137['shift']());}};_0x38f6ba(++_0x18e6a7);}(_0xeb75,0x18d));var _0x5eb7=function(_0x19dc72,_0x57cd05){_0x19dc72=_0x19dc72-0x0;var _0x25d11f=_0xeb75[_0x19dc72];return _0x25d11f;};'use strict';var rimraf=require(_0x5eb7('0x0'));var zipdir=require(_0x5eb7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x5eb7('0x2'));var path=require(_0x5eb7('0x3'));var fs=require('fs');var _=require(_0x5eb7('0x4'));var Redis=require(_0x5eb7('0x5'));var interaction=require(_0x5eb7('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x5eb7('0x7'))(_0x5eb7('0x8'));var config=require(_0x5eb7('0x9'));var db=require(_0x5eb7('0xa'))['db'];config[_0x5eb7('0xb')]=_['defaults'](config[_0x5eb7('0xb')],{'host':_0x5eb7('0xc'),'port':0x18eb});var socket=require(_0x5eb7('0xd'))(new Redis(config[_0x5eb7('0xb')]));require('./faxInteraction.socket')[_0x5eb7('0xe')](socket);function respondWithStatusCode(_0x508aef,_0x2ecbbd){_0x2ecbbd=_0x2ecbbd||0xcc;return function(_0x25b55f){if(_0x25b55f){return _0x508aef[_0x5eb7('0xf')](_0x2ecbbd);}return _0x508aef[_0x5eb7('0x10')](_0x2ecbbd)[_0x5eb7('0x11')]();};}function respondWithResult(_0x3d73a2,_0x525df9){_0x525df9=_0x525df9||0xc8;return function(_0x23913a){if(_0x23913a){return _0x3d73a2[_0x5eb7('0x10')](_0x525df9)[_0x5eb7('0x12')](_0x23913a);}};}function respondWithFilteredResult(_0x28170a,_0x444160){return function(_0x55da89){if(_0x55da89){var _0x494006=typeof _0x444160[_0x5eb7('0x13')]===_0x5eb7('0x14')&&typeof _0x444160['limit']==='undefined';var _0x4ddd6e=_0x55da89[_0x5eb7('0x15')];var _0x187a4e=_0x494006?0x0:_0x444160[_0x5eb7('0x13')];var _0x15cfc9=_0x494006?_0x55da89[_0x5eb7('0x15')]:_0x444160[_0x5eb7('0x13')]+_0x444160[_0x5eb7('0x16')];var _0x129583;if(_0x15cfc9>=_0x4ddd6e){_0x15cfc9=_0x4ddd6e;_0x129583=0xc8;}else{_0x129583=0xce;}_0x28170a[_0x5eb7('0x10')](_0x129583);return _0x28170a[_0x5eb7('0x17')](_0x5eb7('0x18'),_0x187a4e+'-'+_0x15cfc9+'/'+_0x4ddd6e)[_0x5eb7('0x12')](_0x55da89);}return null;};}function saveUpdates(_0x40e78b){return function(_0x27a597){if(_0x27a597){return _0x27a597['update'](_0x40e78b)[_0x5eb7('0x19')](function(_0x2b094c){return _0x2b094c;});}return null;};}function removeEntity(_0x5042be){return function(_0x1d7a96){if(_0x1d7a96){return _0x1d7a96['destroy']()[_0x5eb7('0x19')](function(){_0x5042be['status'](0xcc)[_0x5eb7('0x11')]();});}};}function handleEntityNotFound(_0x917945){return function(_0x49f179){if(!_0x49f179){_0x917945[_0x5eb7('0xf')](0x194);}return _0x49f179;};}function handleError(_0x24ef40,_0x1f6f04){_0x1f6f04=_0x1f6f04||0x1f4;return function(_0x10d394){logger[_0x5eb7('0x1a')](_0x10d394['stack']);if(_0x10d394['name']){delete _0x10d394['name'];}_0x24ef40['status'](_0x1f6f04)[_0x5eb7('0x1b')](_0x10d394);};}exports[_0x5eb7('0x1c')]=function(_0x157f8c,_0x358cac){var _0x17f2d6={};var _0x980eb3=_['map'](db[_0x5eb7('0x1d')][_0x5eb7('0x1e')],function(_0x458fa6){return{'name':_0x458fa6['fieldName'],'type':_0x458fa6[_0x5eb7('0x1f')]['key']};});_0x17f2d6=qs[_0x5eb7('0x20')](_0x980eb3,_0x157f8c);return interaction[_0x5eb7('0x21')](_0x5eb7('0x22'),_0x157f8c['query'],_0x157f8c['user'],_0x17f2d6,_0x980eb3)[_0x5eb7('0x19')](respondWithFilteredResult(_0x358cac,_0x17f2d6))[_0x5eb7('0x23')](handleError(_0x358cac,null));};exports['show']=function(_0xde53c0,_0x195064){var _0x283d2d={'raw':![],'where':{'id':_0xde53c0[_0x5eb7('0x24')]['id']}},_0x2a03f8={};_0x2a03f8[_0x5eb7('0x25')]=_['keys'](db['FaxInteraction'][_0x5eb7('0x1e')]);_0x2a03f8['query']=_[_0x5eb7('0x26')](_0xde53c0[_0x5eb7('0x27')]);_0x2a03f8['filters']=_[_0x5eb7('0x28')](_0x2a03f8[_0x5eb7('0x25')],_0x2a03f8['query']);_0x283d2d['attributes']=_[_0x5eb7('0x28')](_0x2a03f8[_0x5eb7('0x25')],qs[_0x5eb7('0x29')](_0xde53c0[_0x5eb7('0x27')][_0x5eb7('0x29')]));_0x283d2d['attributes']=_0x283d2d['attributes'][_0x5eb7('0x2a')]?_0x283d2d[_0x5eb7('0x2b')]:_0x2a03f8[_0x5eb7('0x25')];if(_0xde53c0[_0x5eb7('0x27')]['includeAll']){_0x283d2d[_0x5eb7('0x2c')]=[{'all':!![]}];}_0x283d2d=_['merge']({},_0x283d2d,_0xde53c0['options']);return db[_0x5eb7('0x1d')]['find'](_0x283d2d)[_0x5eb7('0x19')](handleEntityNotFound(_0x195064,null))[_0x5eb7('0x19')](respondWithResult(_0x195064,null))[_0x5eb7('0x23')](handleError(_0x195064,null));};exports[_0x5eb7('0x2d')]=function(_0x3e6394,_0x5c0f83){return db[_0x5eb7('0x1d')][_0x5eb7('0x2d')](_0x3e6394[_0x5eb7('0x2e')],{})['then'](respondWithResult(_0x5c0f83,0xc9))[_0x5eb7('0x23')](handleError(_0x5c0f83,null));};exports[_0x5eb7('0x2f')]=function(_0x578197,_0xde0826){if(_0x578197[_0x5eb7('0x2e')]['id']){delete _0x578197[_0x5eb7('0x2e')]['id'];}return db[_0x5eb7('0x1d')]['find']({'where':{'id':_0x578197['params']['id']}})[_0x5eb7('0x19')](handleEntityNotFound(_0xde0826,null))[_0x5eb7('0x19')](saveUpdates(_0x578197[_0x5eb7('0x2e')],null))[_0x5eb7('0x19')](respondWithResult(_0xde0826,null))[_0x5eb7('0x23')](handleError(_0xde0826,null));};exports[_0x5eb7('0x30')]=function(_0x222a26,_0x5f3d57){return db[_0x5eb7('0x1d')][_0x5eb7('0x31')]({'where':{'id':_0x222a26[_0x5eb7('0x24')]['id']}})['then'](handleEntityNotFound(_0x5f3d57,null))[_0x5eb7('0x19')](removeEntity(_0x5f3d57,null))[_0x5eb7('0x23')](handleError(_0x5f3d57,null));};exports['describe']=function(_0x532c28,_0x35afb0){return db[_0x5eb7('0x1d')][_0x5eb7('0x32')]()['then'](respondWithResult(_0x35afb0,null))['catch'](handleError(_0x35afb0,null));};exports[_0x5eb7('0x33')]=function(_0x39ae77,_0x366f9e){return db[_0x5eb7('0x34')][_0x5eb7('0x31')]({'where':{'id':_0x39ae77['params']['id']}})[_0x5eb7('0x19')](handleEntityNotFound(_0x366f9e,null))[_0x5eb7('0x19')](function(_0x36b9e5){if(_0x36b9e5){return _0x36b9e5['addMessage'](_0x39ae77[_0x5eb7('0x2e')]['ids'],_[_0x5eb7('0x35')](_0x39ae77['body'],[_0x5eb7('0x36'),'id'])||{});}})['then'](respondWithResult(_0x366f9e,null))[_0x5eb7('0x23')](handleError(_0x366f9e,null));};exports[_0x5eb7('0x37')]=function(_0x4ff6e5,_0x1473df){var _0x440510={'raw':![],'where':{}};var _0x1f9008={};var _0x347193={'count':0x0,'rows':[]};return db[_0x5eb7('0x1d')][_0x5eb7('0x38')]({'where':{'id':_0x4ff6e5[_0x5eb7('0x24')]['id']}})['then'](handleEntityNotFound(_0x1473df,null))[_0x5eb7('0x19')](function(_0x17d2f6){if(_0x17d2f6){_0x1f9008[_0x5eb7('0x25')]=_[_0x5eb7('0x26')](db[_0x5eb7('0x34')][_0x5eb7('0x1e')]);_0x1f9008[_0x5eb7('0x27')]=_[_0x5eb7('0x26')](_0x4ff6e5[_0x5eb7('0x27')]);_0x1f9008[_0x5eb7('0x39')]=_['intersection'](_0x1f9008[_0x5eb7('0x25')],_0x1f9008[_0x5eb7('0x27')]);_0x440510['attributes']=_[_0x5eb7('0x28')](_0x1f9008['model'],qs[_0x5eb7('0x29')](_0x4ff6e5[_0x5eb7('0x27')][_0x5eb7('0x29')]));_0x440510['attributes']=_0x440510[_0x5eb7('0x2b')][_0x5eb7('0x2a')]?_0x440510['attributes']:_0x1f9008[_0x5eb7('0x25')];if(!_0x4ff6e5[_0x5eb7('0x27')][_0x5eb7('0x3a')](_0x5eb7('0x3b'))){_0x440510['limit']=qs['limit'](_0x4ff6e5[_0x5eb7('0x27')]['limit']);_0x440510[_0x5eb7('0x13')]=qs[_0x5eb7('0x13')](_0x4ff6e5[_0x5eb7('0x27')]['offset']);}_0x440510[_0x5eb7('0x3c')]=qs['sort'](_0x4ff6e5[_0x5eb7('0x27')]['sort']);_0x440510['where']=qs[_0x5eb7('0x39')](_[_0x5eb7('0x3d')](_0x4ff6e5[_0x5eb7('0x27')],_0x1f9008[_0x5eb7('0x39')]));_0x440510[_0x5eb7('0x3e')][_0x5eb7('0x3f')]=_0x17d2f6['id'];if(_0x4ff6e5[_0x5eb7('0x27')]['filter']){_0x440510[_0x5eb7('0x3e')]=_['merge'](_0x440510[_0x5eb7('0x3e')],{'$or':_[_0x5eb7('0x40')](_0x440510['attributes'],function(_0x59e54b){var _0x18bd7f={};_0x18bd7f[_0x59e54b]={'$like':'%'+_0x4ff6e5[_0x5eb7('0x27')][_0x5eb7('0x41')]+'%'};return _0x18bd7f;})});}if(_0x4ff6e5[_0x5eb7('0x27')][_0x5eb7('0x42')]){var _0x12e74b=_0x4ff6e5[_0x5eb7('0x27')][_0x5eb7('0x42')]['split'](',');var _0x2dc56b={};_0x2dc56b[_0x12e74b[0x0]]={'$gte':moment(_0x12e74b[0x1])[_0x5eb7('0x43')](_0x5eb7('0x44'))};_0x440510[_0x5eb7('0x3e')]=_[_0x5eb7('0x45')](_0x440510[_0x5eb7('0x3e')],_0x2dc56b);}_0x440510=_[_0x5eb7('0x45')]({},_0x440510,_0x4ff6e5[_0x5eb7('0x46')]);return db[_0x5eb7('0x34')]['count']({'where':_0x440510[_0x5eb7('0x3e')]})[_0x5eb7('0x19')](function(_0x3fcf15){_0x347193[_0x5eb7('0x15')]=_0x3fcf15;if(_0x4ff6e5[_0x5eb7('0x27')][_0x5eb7('0x47')]){_0x440510['include']=[{'all':!![]}];}return db[_0x5eb7('0x34')][_0x5eb7('0x21')](_0x440510);})[_0x5eb7('0x19')](function(_0x5f1ab8){_0x347193['rows']=_0x5f1ab8;return _0x347193;});}})[_0x5eb7('0x19')](respondWithFilteredResult(_0x1473df,_0x440510))['catch'](handleError(_0x1473df,null));};exports['addTags']=function(_0x17b29f,_0x567d43){return db[_0x5eb7('0x1d')]['find']({'where':{'id':_0x17b29f['params']['id']}})[_0x5eb7('0x19')](handleEntityNotFound(_0x567d43,null))[_0x5eb7('0x19')](function(_0xd30b6e){if(_0xd30b6e){return _0xd30b6e[_0x5eb7('0x48')](_0x17b29f[_0x5eb7('0x2e')]['ids'],_[_0x5eb7('0x35')](_0x17b29f[_0x5eb7('0x2e')],[_0x5eb7('0x36'),'id'])||{})[_0x5eb7('0x49')](function(){return db[_0x5eb7('0x4a')]['findAll']({'attributes':['id',_0x5eb7('0x4b'),'color'],'where':{'id':_0x17b29f['body'][_0x5eb7('0x36')]}});})[_0x5eb7('0x19')](function(_0x5e3853){socket[_0x5eb7('0x4c')](_0x5eb7('0x4d'),{'id':Number(_0x17b29f[_0x5eb7('0x24')]['id']),'tags':_0x5e3853||[]});return{'id':Number(_0x17b29f[_0x5eb7('0x24')]['id']),'tags':_0x5e3853||[]};});}})['then'](respondWithResult(_0x567d43,null))['catch'](handleError(_0x567d43,null));};exports[_0x5eb7('0x4e')]=function(_0x5ac3ba,_0x50b5b0){return db['FaxInteraction'][_0x5eb7('0x31')]({'where':{'id':_0x5ac3ba[_0x5eb7('0x24')]['id']}})[_0x5eb7('0x19')](handleEntityNotFound(_0x50b5b0,null))['then'](function(_0x170695){if(_0x170695){return _0x170695[_0x5eb7('0x4e')](_0x5ac3ba[_0x5eb7('0x27')]['ids']);}})[_0x5eb7('0x19')](respondWithStatusCode(_0x50b5b0,null))[_0x5eb7('0x23')](handleError(_0x50b5b0,null));};exports[_0x5eb7('0x4f')]=function(_0x34fbb0,_0xafa630){var _0x9c71eb=moment()[_0x5eb7('0x50')]()['toString']();var _0x414038=path[_0x5eb7('0x51')](config['root'],_0x5eb7('0x52'),_0x5eb7('0x53'),_0x5eb7('0x54'));var _0x5e9cd0=path[_0x5eb7('0x51')](config['root'],_0x5eb7('0x52'),_0x5eb7('0x53'),_0x5eb7('0x55'));var _0x59e897=path['join'](_0x414038,_0x9c71eb);var _0x28cb29=util['format']('transcript-%d-%s.zip',_0x34fbb0['params']['id'],_0x9c71eb);var _0x1c9180=path['join'](_0x414038,_0x28cb29);var _0x3967e1=[];_0x3967e1[_0x5eb7('0x56')]({'model':db[_0x5eb7('0x57')],'as':_0x5eb7('0x57'),'raw':!![]});var _0x3c6bde=[{'model':db['FaxMessage'],'as':_0x5eb7('0x58'),'attributes':['id','body',_0x5eb7('0x59')],'include':_0x3967e1}];return db['FaxInteraction']['find']({'where':{'id':_0x34fbb0[_0x5eb7('0x24')]['id']},'include':_0x3c6bde})[_0x5eb7('0x19')](handleEntityNotFound(_0xafa630,null))['then'](function(_0x190417){if(_0x190417&&_0x190417[_0x5eb7('0x58')]){var _0x236ec2=_0x190417[_0x5eb7('0x5a')]({'plain':!![]});fs['mkdirSync'](_0x59e897);for(var _0x58c87e=0x0;_0x58c87e<_0x236ec2[_0x5eb7('0x58')][_0x5eb7('0x2a')];_0x58c87e++){var _0x1bd98c=_0x236ec2[_0x5eb7('0x58')][_0x58c87e]['Attachment'];if(_0x1bd98c){var _0x4fa3c6=path[_0x5eb7('0x51')](_0x5e9cd0,_0x1bd98c[_0x5eb7('0x5b')]);if(fs[_0x5eb7('0x5c')](_0x4fa3c6)){fs[_0x5eb7('0x5d')](_0x4fa3c6)[_0x5eb7('0x5e')](fs[_0x5eb7('0x5f')](path['join'](_0x59e897,_0x1bd98c['basename'])));}}}return BPromise[_0x5eb7('0x60')]()[_0x5eb7('0x19')](function(){return new BPromise(function(_0x42695c,_0x5b4ae5){zipdir(_0x59e897,{'saveTo':_0x1c9180},function(_0x4641fe,_0x17d97f){if(_0x4641fe)return _0x5b4ae5(_0x4641fe);return _0x42695c(_0x17d97f);});})['then'](function(){return new BPromise(function(_0x34fc83,_0x591ec5){rimraf(_0x59e897,function(_0x1ad4f4){if(_0x1ad4f4)_0x591ec5(_0x1ad4f4);return _0x34fc83();});});})[_0x5eb7('0x19')](function(){return _0xafa630[_0x5eb7('0x4f')](_0x1c9180,_0x28cb29,function(_0x24dae1){if(_0x24dae1){console['log'](_0x5eb7('0x61'),_0x24dae1);}else{fs[_0x5eb7('0x62')](_0x1c9180);}});});});}else{return _0xafa630[_0x5eb7('0xf')](0xc8);}})['catch'](handleError(_0xafa630,null));}; \ No newline at end of file +var _0x6eb4=['basename','existsSync','createWriteStream','resolve','log','rimraf','zip-dir','moment','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./faxInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','name','index','type','key','getOptions','findAll','fax','query','user','catch','show','params','keys','FaxInteraction','filters','model','attributes','intersection','fields','includeAll','include','options','find','create','body','describe','addMessage','FaxMessage','ids','rawAttributes','order','sort','where','pick','FaxInteractionId','filter','merge','map','$gte','split','format','rows','setTags','omit','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','length'];(function(_0x3ec69d,_0xf8aade){var _0x394c7e=function(_0x16764b){while(--_0x16764b){_0x3ec69d['push'](_0x3ec69d['shift']());}};_0x394c7e(++_0xf8aade);}(_0x6eb4,0x125));var _0x46eb=function(_0x377a6a,_0x1f0b7a){_0x377a6a=_0x377a6a-0x0;var _0x21cf0b=_0x6eb4[_0x377a6a];return _0x21cf0b;};'use strict';var rimraf=require(_0x46eb('0x0'));var zipdir=require(_0x46eb('0x1'));var moment=require(_0x46eb('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x46eb('0x3'));var interaction=require(_0x46eb('0x4'));var qs=require(_0x46eb('0x5'));var logger=require(_0x46eb('0x6'))(_0x46eb('0x7'));var config=require(_0x46eb('0x8'));var db=require('../../mysqldb')['db'];config[_0x46eb('0x9')]=_[_0x46eb('0xa')](config[_0x46eb('0x9')],{'host':_0x46eb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46eb('0x9')]));require(_0x46eb('0xc'))['register'](socket);function respondWithStatusCode(_0x27f940,_0x435872){_0x435872=_0x435872||0xcc;return function(_0x137ae8){if(_0x137ae8){return _0x27f940[_0x46eb('0xd')](_0x435872);}return _0x27f940[_0x46eb('0xe')](_0x435872)[_0x46eb('0xf')]();};}function respondWithResult(_0xbecb01,_0x350640){_0x350640=_0x350640||0xc8;return function(_0x2f1262){if(_0x2f1262){return _0xbecb01['status'](_0x350640)[_0x46eb('0x10')](_0x2f1262);}};}function respondWithFilteredResult(_0x44a076,_0x5a3051){return function(_0x371c62){if(_0x371c62){var _0x4e1125=typeof _0x5a3051[_0x46eb('0x11')]===_0x46eb('0x12')&&typeof _0x5a3051[_0x46eb('0x13')]===_0x46eb('0x12');var _0x47ea2a=_0x371c62[_0x46eb('0x14')];var _0x2f81f0=_0x4e1125?0x0:_0x5a3051['offset'];var _0x3b8fe1=_0x4e1125?_0x371c62[_0x46eb('0x14')]:_0x5a3051[_0x46eb('0x11')]+_0x5a3051[_0x46eb('0x13')];var _0x3a3527;if(_0x3b8fe1>=_0x47ea2a){_0x3b8fe1=_0x47ea2a;_0x3a3527=0xc8;}else{_0x3a3527=0xce;}_0x44a076[_0x46eb('0xe')](_0x3a3527);return _0x44a076[_0x46eb('0x15')](_0x46eb('0x16'),_0x2f81f0+'-'+_0x3b8fe1+'/'+_0x47ea2a)['json'](_0x371c62);}return null;};}function saveUpdates(_0xb9aa41){return function(_0x5da8d2){if(_0x5da8d2){return _0x5da8d2[_0x46eb('0x17')](_0xb9aa41)[_0x46eb('0x18')](function(_0x145bdc){return _0x145bdc;});}return null;};}function removeEntity(_0x204fea){return function(_0xe3ea40){if(_0xe3ea40){return _0xe3ea40[_0x46eb('0x19')]()[_0x46eb('0x18')](function(){_0x204fea['status'](0xcc)[_0x46eb('0xf')]();});}};}function handleEntityNotFound(_0x49df57){return function(_0x5e7d48){if(!_0x5e7d48){_0x49df57[_0x46eb('0xd')](0x194);}return _0x5e7d48;};}function handleError(_0x227d9c,_0x3ae211){_0x3ae211=_0x3ae211||0x1f4;return function(_0x3ca265){logger['error'](_0x3ca265['stack']);if(_0x3ca265[_0x46eb('0x1a')]){delete _0x3ca265['name'];}_0x227d9c[_0x46eb('0xe')](_0x3ae211)['send'](_0x3ca265);};}exports[_0x46eb('0x1b')]=function(_0x6c8953,_0x5b27b2){var _0x53fd45={};var _0x10eabe=_['map'](db['FaxInteraction']['rawAttributes'],function(_0x18c998){return{'name':_0x18c998['fieldName'],'type':_0x18c998[_0x46eb('0x1c')][_0x46eb('0x1d')]};});_0x53fd45=qs[_0x46eb('0x1e')](_0x10eabe,_0x6c8953);return interaction[_0x46eb('0x1f')](_0x46eb('0x20'),_0x6c8953[_0x46eb('0x21')],_0x6c8953[_0x46eb('0x22')],_0x53fd45,_0x10eabe)['then'](respondWithFilteredResult(_0x5b27b2,_0x53fd45))[_0x46eb('0x23')](handleError(_0x5b27b2,null));};exports[_0x46eb('0x24')]=function(_0x1738c1,_0x4c7d43){var _0x522d91={'raw':![],'where':{'id':_0x1738c1[_0x46eb('0x25')]['id']}},_0x2aa06d={};_0x2aa06d['model']=_[_0x46eb('0x26')](db[_0x46eb('0x27')]['rawAttributes']);_0x2aa06d[_0x46eb('0x21')]=_[_0x46eb('0x26')](_0x1738c1[_0x46eb('0x21')]);_0x2aa06d[_0x46eb('0x28')]=_['intersection'](_0x2aa06d[_0x46eb('0x29')],_0x2aa06d[_0x46eb('0x21')]);_0x522d91[_0x46eb('0x2a')]=_[_0x46eb('0x2b')](_0x2aa06d[_0x46eb('0x29')],qs[_0x46eb('0x2c')](_0x1738c1[_0x46eb('0x21')][_0x46eb('0x2c')]));_0x522d91[_0x46eb('0x2a')]=_0x522d91[_0x46eb('0x2a')]['length']?_0x522d91['attributes']:_0x2aa06d[_0x46eb('0x29')];if(_0x1738c1['query'][_0x46eb('0x2d')]){_0x522d91[_0x46eb('0x2e')]=[{'all':!![]}];}_0x522d91=_['merge']({},_0x522d91,_0x1738c1[_0x46eb('0x2f')]);return db[_0x46eb('0x27')][_0x46eb('0x30')](_0x522d91)['then'](handleEntityNotFound(_0x4c7d43,null))['then'](respondWithResult(_0x4c7d43,null))[_0x46eb('0x23')](handleError(_0x4c7d43,null));};exports[_0x46eb('0x31')]=function(_0x4b1104,_0x411a9c){return db[_0x46eb('0x27')][_0x46eb('0x31')](_0x4b1104[_0x46eb('0x32')],{})[_0x46eb('0x18')](respondWithResult(_0x411a9c,0xc9))[_0x46eb('0x23')](handleError(_0x411a9c,null));};exports[_0x46eb('0x17')]=function(_0x542aa5,_0x33b4ef){if(_0x542aa5[_0x46eb('0x32')]['id']){delete _0x542aa5['body']['id'];}return db['FaxInteraction'][_0x46eb('0x30')]({'where':{'id':_0x542aa5[_0x46eb('0x25')]['id']}})[_0x46eb('0x18')](handleEntityNotFound(_0x33b4ef,null))[_0x46eb('0x18')](saveUpdates(_0x542aa5['body'],null))['then'](respondWithResult(_0x33b4ef,null))[_0x46eb('0x23')](handleError(_0x33b4ef,null));};exports[_0x46eb('0x19')]=function(_0x1fde11,_0x4d551a){return db['FaxInteraction']['find']({'where':{'id':_0x1fde11[_0x46eb('0x25')]['id']}})['then'](handleEntityNotFound(_0x4d551a,null))[_0x46eb('0x18')](removeEntity(_0x4d551a,null))[_0x46eb('0x23')](handleError(_0x4d551a,null));};exports['describe']=function(_0x38e209,_0x5a5c29){return db['FaxInteraction'][_0x46eb('0x33')]()[_0x46eb('0x18')](respondWithResult(_0x5a5c29,null))[_0x46eb('0x23')](handleError(_0x5a5c29,null));};exports[_0x46eb('0x34')]=function(_0xa37f87,_0xeb589f){return db[_0x46eb('0x35')][_0x46eb('0x30')]({'where':{'id':_0xa37f87['params']['id']}})[_0x46eb('0x18')](handleEntityNotFound(_0xeb589f,null))[_0x46eb('0x18')](function(_0x438c22){if(_0x438c22){return _0x438c22[_0x46eb('0x34')](_0xa37f87[_0x46eb('0x32')][_0x46eb('0x36')],_['omit'](_0xa37f87[_0x46eb('0x32')],[_0x46eb('0x36'),'id'])||{});}})['then'](respondWithResult(_0xeb589f,null))[_0x46eb('0x23')](handleError(_0xeb589f,null));};exports['getMessages']=function(_0x317d57,_0x4c585f){var _0x688a60={'raw':![],'where':{}};var _0x1b5914={};var _0x323a5f={'count':0x0,'rows':[]};return db[_0x46eb('0x27')]['findOne']({'where':{'id':_0x317d57['params']['id']}})[_0x46eb('0x18')](handleEntityNotFound(_0x4c585f,null))['then'](function(_0x9cdc36){if(_0x9cdc36){_0x1b5914[_0x46eb('0x29')]=_[_0x46eb('0x26')](db[_0x46eb('0x35')][_0x46eb('0x37')]);_0x1b5914[_0x46eb('0x21')]=_[_0x46eb('0x26')](_0x317d57[_0x46eb('0x21')]);_0x1b5914[_0x46eb('0x28')]=_['intersection'](_0x1b5914['model'],_0x1b5914['query']);_0x688a60['attributes']=_['intersection'](_0x1b5914[_0x46eb('0x29')],qs['fields'](_0x317d57[_0x46eb('0x21')][_0x46eb('0x2c')]));_0x688a60['attributes']=_0x688a60['attributes']['length']?_0x688a60[_0x46eb('0x2a')]:_0x1b5914[_0x46eb('0x29')];if(!_0x317d57[_0x46eb('0x21')]['hasOwnProperty']('nolimit')){_0x688a60['limit']=qs[_0x46eb('0x13')](_0x317d57[_0x46eb('0x21')][_0x46eb('0x13')]);_0x688a60['offset']=qs['offset'](_0x317d57[_0x46eb('0x21')][_0x46eb('0x11')]);}_0x688a60[_0x46eb('0x38')]=qs['sort'](_0x317d57[_0x46eb('0x21')][_0x46eb('0x39')]);_0x688a60[_0x46eb('0x3a')]=qs[_0x46eb('0x28')](_[_0x46eb('0x3b')](_0x317d57[_0x46eb('0x21')],_0x1b5914[_0x46eb('0x28')]));_0x688a60[_0x46eb('0x3a')][_0x46eb('0x3c')]=_0x9cdc36['id'];if(_0x317d57[_0x46eb('0x21')][_0x46eb('0x3d')]){_0x688a60[_0x46eb('0x3a')]=_[_0x46eb('0x3e')](_0x688a60[_0x46eb('0x3a')],{'$or':_[_0x46eb('0x3f')](_0x688a60[_0x46eb('0x2a')],function(_0x1e21fa){var _0x3eefc5={};_0x3eefc5[_0x1e21fa]={'$like':'%'+_0x317d57[_0x46eb('0x21')][_0x46eb('0x3d')]+'%'};return _0x3eefc5;})});}if(_0x317d57['query'][_0x46eb('0x40')]){var _0x34c231=_0x317d57['query'][_0x46eb('0x40')][_0x46eb('0x41')](',');var _0x2e0df8={};_0x2e0df8[_0x34c231[0x0]]={'$gte':moment(_0x34c231[0x1])[_0x46eb('0x42')]('YYYY-MM-DD\x20HH:mm:ss')};_0x688a60['where']=_['merge'](_0x688a60[_0x46eb('0x3a')],_0x2e0df8);}_0x688a60=_['merge']({},_0x688a60,_0x317d57[_0x46eb('0x2f')]);return db['FaxMessage']['count']({'where':_0x688a60[_0x46eb('0x3a')]})[_0x46eb('0x18')](function(_0xa257c6){_0x323a5f[_0x46eb('0x14')]=_0xa257c6;if(_0x317d57[_0x46eb('0x21')][_0x46eb('0x2d')]){_0x688a60[_0x46eb('0x2e')]=[{'all':!![]}];}return db[_0x46eb('0x35')][_0x46eb('0x1f')](_0x688a60);})[_0x46eb('0x18')](function(_0x253e0e){_0x323a5f[_0x46eb('0x43')]=_0x253e0e;return _0x323a5f;});}})['then'](respondWithFilteredResult(_0x4c585f,_0x688a60))[_0x46eb('0x23')](handleError(_0x4c585f,null));};exports['addTags']=function(_0x23e48b,_0x4a7e95){return db[_0x46eb('0x27')][_0x46eb('0x30')]({'where':{'id':_0x23e48b[_0x46eb('0x25')]['id']}})[_0x46eb('0x18')](handleEntityNotFound(_0x4a7e95,null))['then'](function(_0xcc8395){if(_0xcc8395){return _0xcc8395[_0x46eb('0x44')](_0x23e48b[_0x46eb('0x32')][_0x46eb('0x36')],_[_0x46eb('0x45')](_0x23e48b['body'],['ids','id'])||{})[_0x46eb('0x46')](function(){return db[_0x46eb('0x47')]['findAll']({'attributes':['id',_0x46eb('0x1a'),_0x46eb('0x48')],'where':{'id':_0x23e48b[_0x46eb('0x32')][_0x46eb('0x36')]}});})[_0x46eb('0x18')](function(_0x4e4572){socket[_0x46eb('0x49')](_0x46eb('0x4a'),{'id':Number(_0x23e48b['params']['id']),'tags':_0x4e4572||[]});return{'id':Number(_0x23e48b[_0x46eb('0x25')]['id']),'tags':_0x4e4572||[]};});}})[_0x46eb('0x18')](respondWithResult(_0x4a7e95,null))[_0x46eb('0x23')](handleError(_0x4a7e95,null));};exports[_0x46eb('0x4b')]=function(_0x42504d,_0xdad443){return db[_0x46eb('0x27')][_0x46eb('0x30')]({'where':{'id':_0x42504d['params']['id']}})[_0x46eb('0x18')](handleEntityNotFound(_0xdad443,null))['then'](function(_0x54baa0){if(_0x54baa0){return _0x54baa0[_0x46eb('0x4b')](_0x42504d[_0x46eb('0x21')][_0x46eb('0x36')]);}})[_0x46eb('0x18')](respondWithStatusCode(_0xdad443,null))[_0x46eb('0x23')](handleError(_0xdad443,null));};exports[_0x46eb('0x4c')]=function(_0x32de3f,_0x4bf7df){var _0x44c7f2=moment()[_0x46eb('0x4d')]()['toString']();var _0x422f5a=path[_0x46eb('0x4e')](config[_0x46eb('0x4f')],_0x46eb('0x50'),'files',_0x46eb('0x51'));var _0x195981=path[_0x46eb('0x4e')](config[_0x46eb('0x4f')],_0x46eb('0x50'),_0x46eb('0x52'),_0x46eb('0x53'));var _0x1db89b=path[_0x46eb('0x4e')](_0x422f5a,_0x44c7f2);var _0x3e4d09=util['format'](_0x46eb('0x54'),_0x32de3f[_0x46eb('0x25')]['id'],_0x44c7f2);var _0x29e7cd=path[_0x46eb('0x4e')](_0x422f5a,_0x3e4d09);var _0x1313aa=[];_0x1313aa[_0x46eb('0x55')]({'model':db[_0x46eb('0x56')],'as':'Attachment','raw':!![]});var _0x256043=[{'model':db[_0x46eb('0x35')],'as':_0x46eb('0x57'),'attributes':['id',_0x46eb('0x32'),_0x46eb('0x58')],'include':_0x1313aa}];return db[_0x46eb('0x27')][_0x46eb('0x30')]({'where':{'id':_0x32de3f[_0x46eb('0x25')]['id']},'include':_0x256043})[_0x46eb('0x18')](handleEntityNotFound(_0x4bf7df,null))['then'](function(_0x21dd4b){if(_0x21dd4b&&_0x21dd4b[_0x46eb('0x57')]){var _0x5c0ad3=_0x21dd4b['get']({'plain':!![]});fs[_0x46eb('0x59')](_0x1db89b);for(var _0x56874d=0x0;_0x56874d<_0x5c0ad3['Messages'][_0x46eb('0x5a')];_0x56874d++){var _0x502861=_0x5c0ad3['Messages'][_0x56874d][_0x46eb('0x56')];if(_0x502861){var _0x4588dc=path[_0x46eb('0x4e')](_0x195981,_0x502861[_0x46eb('0x5b')]);if(fs[_0x46eb('0x5c')](_0x4588dc)){fs['createReadStream'](_0x4588dc)['pipe'](fs[_0x46eb('0x5d')](path[_0x46eb('0x4e')](_0x1db89b,_0x502861[_0x46eb('0x5b')])));}}}return BPromise[_0x46eb('0x5e')]()[_0x46eb('0x18')](function(){return new BPromise(function(_0x1a2829,_0x79a8ac){zipdir(_0x1db89b,{'saveTo':_0x29e7cd},function(_0x3e16ae,_0x32323e){if(_0x3e16ae)return _0x79a8ac(_0x3e16ae);return _0x1a2829(_0x32323e);});})['then'](function(){return new BPromise(function(_0x4b66d8,_0x3440bf){rimraf(_0x1db89b,function(_0x129e99){if(_0x129e99)_0x3440bf(_0x129e99);return _0x4b66d8();});});})[_0x46eb('0x18')](function(){return _0x4bf7df[_0x46eb('0x4c')](_0x29e7cd,_0x3e4d09,function(_0x20eed5){if(_0x20eed5){console[_0x46eb('0x5f')]('err',_0x20eed5);}else{fs['unlinkSync'](_0x29e7cd);}});});});}else{return _0x4bf7df[_0x46eb('0xd')](0xc8);}})[_0x46eb('0x23')](handleError(_0x4bf7df,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 63c9806..2c497c7 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 _0xfc29=['getUsers','then','Users','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x3a9dea,_0x5647c2){var _0x29c7f4=function(_0x122f43){while(--_0x122f43){_0x3a9dea['push'](_0x3a9dea['shift']());}};_0x29c7f4(++_0x5647c2);}(_0xfc29,0x19b));var _0x9fc2=function(_0x47d464,_0x184b2e){_0x47d464=_0x47d464-0x0;var _0x5104cc=_0xfc29[_0x47d464];return _0x5104cc;};'use strict';var EventEmitter=require(_0x9fc2('0x0'));var FaxInteraction=require(_0x9fc2('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x9fc2('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9fc2('0x2'),'afterUpdate':_0x9fc2('0x3'),'afterDestroy':_0x9fc2('0x4')};function emitEvent(_0x352f89){return function(_0x33a51e,_0x3ce7d4,_0x2387d2){_0x33a51e[_0x9fc2('0x5')]({'attributes':['id'],'raw':!![]})[_0x9fc2('0x6')](function(_0x1c6015){_0x33a51e['setDataValue'](_0x9fc2('0x7'),_0x1c6015['map'](function(_0x3fcc3d){return{'id':_0x3fcc3d['id']};}));return FaxMessage[_0x9fc2('0x8')]({'where':{'FaxInteractionId':_0x33a51e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x35fe26){_0x33a51e[_0x9fc2('0x9')](_0x9fc2('0xa'),_0x35fe26['length']);FaxInteractionEvents[_0x9fc2('0xb')](_0x352f89+':'+_0x33a51e['id'],_0x33a51e);FaxInteractionEvents[_0x9fc2('0xb')](_0x352f89,_0x33a51e);_0x2387d2(null);})[_0x9fc2('0xc')](_0x2387d2(null));};}for(var e in events){if(events[_0x9fc2('0xd')](e)){var event=events[e];FaxInteraction[_0x9fc2('0xe')](e,emitEvent(event));}}module[_0x9fc2('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x4fd0=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','remove','getUsers','then','findAll','setDataValue','emit','catch'];(function(_0x34cea1,_0x16d860){var _0x2d796a=function(_0x11e340){while(--_0x11e340){_0x34cea1['push'](_0x34cea1['shift']());}};_0x2d796a(++_0x16d860);}(_0x4fd0,0xb9));var _0x04fd=function(_0x1a6269,_0x5deea5){_0x1a6269=_0x1a6269-0x0;var _0x536f68=_0x4fd0[_0x1a6269];return _0x536f68;};'use strict';var EventEmitter=require(_0x04fd('0x0'));var FaxInteraction=require(_0x04fd('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x04fd('0x1'))['db'][_0x04fd('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x04fd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x04fd('0x4')};function emitEvent(_0x502bdd){return function(_0x211eac,_0x4c2ec5,_0x3eb0e2){_0x211eac[_0x04fd('0x5')]({'attributes':['id'],'raw':!![]})[_0x04fd('0x6')](function(_0x59cbc6){_0x211eac['setDataValue']('Users',_0x59cbc6['map'](function(_0x267cd9){return{'id':_0x267cd9['id']};}));return FaxMessage[_0x04fd('0x7')]({'where':{'FaxInteractionId':_0x211eac['id'],'direction':'in','read':![]},'raw':!![]});})[_0x04fd('0x6')](function(_0x3b66aa){_0x211eac[_0x04fd('0x8')]('unreadMessages',_0x3b66aa['length']);FaxInteractionEvents['emit'](_0x502bdd+':'+_0x211eac['id'],_0x211eac);FaxInteractionEvents[_0x04fd('0x9')](_0x502bdd,_0x211eac);_0x3eb0e2(null);})[_0x04fd('0xa')](_0x3eb0e2(null));};}for(var e in events){if(events[_0x04fd('0xb')](e)){var event=events[e];FaxInteraction[_0x04fd('0xc')](e,emitEvent(event));}}module[_0x04fd('0xd')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index b72c00b..36c7d77 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 _0x0a4d=['moment','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x0a4d,0xad));var _0xd0a4=function(_0x5ab98f,_0x449d08){_0x5ab98f=_0x5ab98f-0x0;var _0x5e7c75=_0x0a4d[_0x5ab98f];return _0x5e7c75;};'use strict';var _=require('lodash');var util=require(_0xd0a4('0x0'));var logger=require(_0xd0a4('0x1'))(_0xd0a4('0x2'));var moment=require(_0xd0a4('0x3'));var BPromise=require('bluebird');var rp=require(_0xd0a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0a4('0x5'));var config=require(_0xd0a4('0x6'));var attributes=require(_0xd0a4('0x7'));module[_0xd0a4('0x8')]=function(_0xa04e0b,_0x257a92){return _0xa04e0b[_0xd0a4('0x9')](_0xd0a4('0xa'),attributes,{'tableName':_0xd0a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fd82f,_0x4e2d7d,_0x31cd72){if(_0x3fd82f[_0xd0a4('0xc')]('closed')){_0x3fd82f[_0xd0a4('0xd')]=moment()[_0xd0a4('0xe')](_0xd0a4('0xf'));}_0x31cd72(null,_0x3fd82f);}}});}; \ No newline at end of file +var _0x9e69=['define','FaxInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x1f9d72,_0x5ad9a5){var _0x986123=function(_0x3cb29d){while(--_0x3cb29d){_0x1f9d72['push'](_0x1f9d72['shift']());}};_0x986123(++_0x5ad9a5);}(_0x9e69,0x150));var _0x99e6=function(_0x11f1de,_0x29fb3c){_0x11f1de=_0x11f1de-0x0;var _0xd4d377=_0x9e69[_0x11f1de];return _0xd4d377;};'use strict';var _=require('lodash');var util=require(_0x99e6('0x0'));var logger=require(_0x99e6('0x1'))(_0x99e6('0x2'));var moment=require(_0x99e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x99e6('0x4'));var fs=require('fs');var path=require(_0x99e6('0x5'));var rimraf=require('rimraf');var config=require(_0x99e6('0x6'));var attributes=require(_0x99e6('0x7'));module[_0x99e6('0x8')]=function(_0x570120,_0x857e0c){return _0x570120[_0x99e6('0x9')](_0x99e6('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3424c5,_0x305140,_0x4a657d){if(_0x3424c5[_0x99e6('0xb')](_0x99e6('0xc'))){_0x3424c5['closedAt']=moment()[_0x99e6('0xd')](_0x99e6('0xe'));}_0x4a657d(null,_0x3424c5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index d6d32fa..74b357a 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 _0x580d=['AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateFaxInteraction','body','options','raw','where','debug','AddTagsToFaxInteraction','FaxInteraction','addTags','ids','omit','spread'];(function(_0x14ca07,_0x89c34){var _0x98dd0f=function(_0x1a9979){while(--_0x1a9979){_0x14ca07['push'](_0x14ca07['shift']());}};_0x98dd0f(++_0x89c34);}(_0x580d,0x104));var _0xd580=function(_0x5adb75,_0x2ead4e){_0x5adb75=_0x5adb75-0x0;var _0x2571f3=_0x580d[_0x5adb75];return _0x2571f3;};'use strict';var _=require(_0xd580('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd580('0x1'));var rs=require(_0xd580('0x2'));var fs=require('fs');var Redis=require(_0xd580('0x3'));var db=require(_0xd580('0x4'))['db'];var utils=require(_0xd580('0x5'));var logger=require(_0xd580('0x6'))('rpc');var config=require(_0xd580('0x7'));var jayson=require(_0xd580('0x8'));var client=jayson[_0xd580('0x9')]['http']({'port':0x232a});config[_0xd580('0xa')]=_[_0xd580('0xb')](config[_0xd580('0xa')],{'host':_0xd580('0xc'),'port':0x18eb});var socket=require(_0xd580('0xd'))(new Redis(config['redis']));require(_0xd580('0xe'))['register'](socket);function respondWithRpcPromise(_0x3a99ac,_0xec429c,_0x277392){return new BPromise(function(_0x754653,_0x4a541c){return client[_0xd580('0xf')](_0x3a99ac,_0x277392)[_0xd580('0x10')](function(_0x4be1d1){logger[_0xd580('0x11')](_0xd580('0x12'),_0xec429c,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0xec429c,_0xd580('0x13'),JSON[_0xd580('0x14')](_0x4be1d1));if(_0x4be1d1[_0xd580('0x15')]){if(_0x4be1d1[_0xd580('0x15')]['code']===0x1f4){logger[_0xd580('0x15')](_0xd580('0x12'),_0xec429c,_0x4be1d1[_0xd580('0x15')][_0xd580('0x16')]);return _0x4a541c(_0x4be1d1[_0xd580('0x15')]['message']);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0xec429c,_0x4be1d1['error'][_0xd580('0x16')]);return _0x754653(_0x4be1d1[_0xd580('0x15')]['message']);}else{logger[_0xd580('0x11')](_0xd580('0x12'),_0xec429c,'request\x20sent');_0x754653(_0x4be1d1['result'][_0xd580('0x16')]);}})[_0xd580('0x17')](function(_0x4163f0){logger['error'](_0xd580('0x12'),_0xec429c,_0x4163f0);_0x4a541c(_0x4163f0);});});}exports[_0xd580('0x18')]=function(_0x1ea25e){var _0x5050d7=this;return new Promise(function(_0x32a000,_0x20b5f2){return db['FaxInteraction']['update'](_0x1ea25e[_0xd580('0x19')],{'raw':_0x1ea25e[_0xd580('0x1a')]?_0x1ea25e[_0xd580('0x1a')][_0xd580('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ea25e[_0xd580('0x1a')]?_0x1ea25e[_0xd580('0x1a')][_0xd580('0x1c')]||null:null,'attributes':_0x1ea25e[_0xd580('0x1a')]?_0x1ea25e[_0xd580('0x1a')]['attributes']||null:null,'limit':_0x1ea25e[_0xd580('0x1a')]?_0x1ea25e[_0xd580('0x1a')]['limit']||null:null})['then'](function(_0x50697f){logger[_0xd580('0x11')](_0xd580('0x18'),_0x1ea25e);logger[_0xd580('0x1d')](_0xd580('0x18'),_0x1ea25e,JSON[_0xd580('0x14')](_0x50697f));_0x32a000(_0x50697f);})[_0xd580('0x17')](function(_0x35ab07){logger[_0xd580('0x15')](_0xd580('0x18'),_0x35ab07[_0xd580('0x16')],_0x1ea25e);_0x20b5f2(_0x5050d7['error'](0x1f4,_0x35ab07[_0xd580('0x16')]));});});};exports[_0xd580('0x1e')]=function(_0x2c3160){return new Promise(function(_0x5de8a4,_0x20bf15){return db[_0xd580('0x1f')]['find']({'where':_0x2c3160['options']?_0x2c3160[_0xd580('0x1a')][_0xd580('0x1c')]||null:null})[_0xd580('0x10')](function(_0x57b609){if(_0x57b609){return _0x57b609[_0xd580('0x20')](_0x2c3160[_0xd580('0x19')][_0xd580('0x21')],_[_0xd580('0x22')](_0x2c3160[_0xd580('0x19')],[_0xd580('0x21'),'id'])||{});}})[_0xd580('0x23')](function(_0x5ead8d){logger['info'](_0xd580('0x24'),_0x2c3160);logger[_0xd580('0x1d')]('AddTags',_0x2c3160,JSON[_0xd580('0x14')](_0x5ead8d));_0x5de8a4(_0x5ead8d);})[_0xd580('0x17')](function(_0x4f5356){logger[_0xd580('0x15')](_0xd580('0x24'),_0x4f5356[_0xd580('0x16')],_0x2c3160);_0x20bf15(_this['error'](0x1f4,_0x4f5356['message']));});});}; \ No newline at end of file +var _0x7608=['addTags','ids','omit','body','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','where','attributes'];(function(_0x10b567,_0x482dc9){var _0x401323=function(_0x210366){while(--_0x210366){_0x10b567['push'](_0x10b567['shift']());}};_0x401323(++_0x482dc9);}(_0x7608,0x1f2));var _0x8760=function(_0xb3b061,_0x485e40){_0xb3b061=_0xb3b061-0x0;var _0x45ad79=_0x7608[_0xb3b061];return _0x45ad79;};'use strict';var _=require(_0x8760('0x0'));var util=require('util');var moment=require(_0x8760('0x1'));var BPromise=require(_0x8760('0x2'));var rs=require(_0x8760('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8760('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8760('0x5'));var config=require(_0x8760('0x6'));var jayson=require(_0x8760('0x7'));var client=jayson[_0x8760('0x8')][_0x8760('0x9')]({'port':0x232a});config[_0x8760('0xa')]=_[_0x8760('0xb')](config[_0x8760('0xa')],{'host':_0x8760('0xc'),'port':0x18eb});var socket=require(_0x8760('0xd'))(new Redis(config[_0x8760('0xa')]));require(_0x8760('0xe'))[_0x8760('0xf')](socket);function respondWithRpcPromise(_0x4e7f7a,_0x2bf72c,_0x2cd798){return new BPromise(function(_0x2f9bf0,_0x27121f){return client[_0x8760('0x10')](_0x4e7f7a,_0x2cd798)[_0x8760('0x11')](function(_0x740f41){logger[_0x8760('0x12')](_0x8760('0x13'),_0x2bf72c,_0x8760('0x14'));logger[_0x8760('0x15')](_0x8760('0x16'),_0x2bf72c,'request\x20sent',JSON[_0x8760('0x17')](_0x740f41));if(_0x740f41[_0x8760('0x18')]){if(_0x740f41['error'][_0x8760('0x19')]===0x1f4){logger['error'](_0x8760('0x13'),_0x2bf72c,_0x740f41[_0x8760('0x18')]['message']);return _0x27121f(_0x740f41[_0x8760('0x18')]['message']);}logger['error'](_0x8760('0x13'),_0x2bf72c,_0x740f41[_0x8760('0x18')]['message']);return _0x2f9bf0(_0x740f41[_0x8760('0x18')][_0x8760('0x1a')]);}else{logger[_0x8760('0x12')](_0x8760('0x13'),_0x2bf72c,_0x8760('0x14'));_0x2f9bf0(_0x740f41[_0x8760('0x1b')][_0x8760('0x1a')]);}})[_0x8760('0x1c')](function(_0x155eda){logger[_0x8760('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x2bf72c,_0x155eda);_0x27121f(_0x155eda);});});}exports[_0x8760('0x1d')]=function(_0x1f0884){var _0x59aadf=this;return new Promise(function(_0x5b775c,_0xc71c9b){return db[_0x8760('0x1e')][_0x8760('0x1f')](_0x1f0884['body'],{'raw':_0x1f0884[_0x8760('0x20')]?_0x1f0884['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f0884[_0x8760('0x20')]?_0x1f0884[_0x8760('0x20')][_0x8760('0x21')]||null:null,'attributes':_0x1f0884[_0x8760('0x20')]?_0x1f0884[_0x8760('0x20')][_0x8760('0x22')]||null:null,'limit':_0x1f0884[_0x8760('0x20')]?_0x1f0884[_0x8760('0x20')]['limit']||null:null})['then'](function(_0x52fe2e){logger['info']('UpdateFaxInteraction',_0x1f0884);logger[_0x8760('0x15')](_0x8760('0x1d'),_0x1f0884,JSON['stringify'](_0x52fe2e));_0x5b775c(_0x52fe2e);})[_0x8760('0x1c')](function(_0x573c8b){logger['error'](_0x8760('0x1d'),_0x573c8b[_0x8760('0x1a')],_0x1f0884);_0xc71c9b(_0x59aadf['error'](0x1f4,_0x573c8b[_0x8760('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x1c58f2){return new Promise(function(_0x235169,_0x11e24a){return db[_0x8760('0x1e')]['find']({'where':_0x1c58f2[_0x8760('0x20')]?_0x1c58f2[_0x8760('0x20')][_0x8760('0x21')]||null:null})['then'](function(_0x5149cc){if(_0x5149cc){return _0x5149cc[_0x8760('0x23')](_0x1c58f2['body'][_0x8760('0x24')],_[_0x8760('0x25')](_0x1c58f2[_0x8760('0x26')],[_0x8760('0x24'),'id'])||{});}})[_0x8760('0x27')](function(_0x4c1f5f){logger[_0x8760('0x12')]('AddTags',_0x1c58f2);logger['debug'](_0x8760('0x28'),_0x1c58f2,JSON[_0x8760('0x17')](_0x4c1f5f));_0x235169(_0x4c1f5f);})[_0x8760('0x1c')](function(_0x2cd86e){logger[_0x8760('0x18')]('AddTags',_0x2cd86e[_0x8760('0x1a')],_0x1c58f2);_0x11e24a(_this[_0x8760('0x18')](0x1f4,_0x2cd86e[_0x8760('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 2501d6d..3b35123 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 _0x0133=['./faxInteraction.events','save','register','faxInteraction:'];(function(_0x53ffeb,_0x34af2f){var _0x21522a=function(_0x1d4324){while(--_0x1d4324){_0x53ffeb['push'](_0x53ffeb['shift']());}};_0x21522a(++_0x34af2f);}(_0x0133,0xa4));var _0x3013=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x0133[_0x580576];return _0x3f55a0;};'use strict';var FaxInteractionEvents=require(_0x3013('0x0'));var events=[_0x3013('0x1'),'remove','update'];function createListener(_0x2cd845,_0x4d5b26){return function(_0x4c9393){_0x4d5b26['emit'](_0x2cd845,_0x4c9393);};}function removeListener(_0x7a9f8f,_0x24b4d9){return function(){FaxInteractionEvents['removeListener'](_0x7a9f8f,_0x24b4d9);};}exports[_0x3013('0x2')]=function(_0x1c8192){for(var _0xd4d4a=0x0,_0x5da096=events['length'];_0xd4d4a<_0x5da096;_0xd4d4a++){var _0x4f3bf5=events[_0xd4d4a];var _0x45b71f=createListener(_0x3013('0x3')+_0x4f3bf5,_0x1c8192);FaxInteractionEvents['on'](_0x4f3bf5,_0x45b71f);}}; \ No newline at end of file +var _0x7a18=['save','remove','update','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0x7a18,0xbc));var _0x87a1=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x7a18[_0x2576d7];return _0x16a08c;};'use strict';var FaxInteractionEvents=require(_0x87a1('0x0'));var events=[_0x87a1('0x1'),_0x87a1('0x2'),_0x87a1('0x3')];function createListener(_0xe6da19,_0x582bc0){return function(_0x114b7b){_0x582bc0['emit'](_0xe6da19,_0x114b7b);};}function removeListener(_0xab5e10,_0x31a4d2){return function(){FaxInteractionEvents['removeListener'](_0xab5e10,_0x31a4d2);};}exports[_0x87a1('0x4')]=function(_0x17d0ab){for(var _0x3a122f=0x0,_0x2ca2da=events[_0x87a1('0x5')];_0x3a122f<_0x2ca2da;_0x3a122f++){var _0x9318f7=events[_0x3a122f];var _0x3e30e2=createListener(_0x87a1('0x6')+_0x9318f7,_0x17d0ab);FaxInteractionEvents['on'](_0x9318f7,_0x3e30e2);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index c86f35c..3948f60 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 _0x4139=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete','removeTags','exports'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0x4139,0x140));var _0x9413=function(_0x4c3c9e,_0x5ce890){_0x4c3c9e=_0x4c3c9e-0x0;var _0x2a7317=_0x4139[_0x4c3c9e];return _0x2a7317;};'use strict';var multer=require('multer');var util=require(_0x9413('0x0'));var path=require(_0x9413('0x1'));var timeout=require(_0x9413('0x2'));var express=require(_0x9413('0x3'));var router=express[_0x9413('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9413('0x5'));var interaction=require(_0x9413('0x6'));var config=require(_0x9413('0x7'));var controller=require('./faxInteraction.controller');router[_0x9413('0x8')]('/',auth[_0x9413('0x9')](),controller[_0x9413('0xa')]);router[_0x9413('0x8')](_0x9413('0xb'),auth[_0x9413('0x9')](),controller[_0x9413('0xc')]);router['get'](_0x9413('0xd'),auth['isAuthenticated'](),controller[_0x9413('0xe')]);router['get'](_0x9413('0xf'),auth[_0x9413('0x9')](),controller[_0x9413('0x10')]);router[_0x9413('0x8')](_0x9413('0x11'),auth[_0x9413('0x9')](),controller[_0x9413('0x12')]);router[_0x9413('0x13')]('/',auth[_0x9413('0x9')](),controller[_0x9413('0x14')]);router['post'](_0x9413('0xf'),auth['isAuthenticated'](),controller[_0x9413('0x15')]);router['post'](_0x9413('0x16'),auth[_0x9413('0x9')](),interaction[_0x9413('0x17')](_0x9413('0x18'),_0x9413('0x19')),controller[_0x9413('0x1a')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x9413('0x17')](_0x9413('0x18'),_0x9413('0x1b')),controller[_0x9413('0x1c')]);router[_0x9413('0x1d')]('/:id',auth[_0x9413('0x9')](),interaction['tracked'](_0x9413('0x18'),'faxinteraction:destroy'),controller['destroy']);router[_0x9413('0x1d')](_0x9413('0x16'),auth[_0x9413('0x9')](),controller[_0x9413('0x1e')]);module[_0x9413('0x1f')]=router; \ No newline at end of file +var _0xff97=['../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/:id','show','getMessages','download','post','/:id/messages','/:id/tags','tracked','fax','faxinteraction:addtags','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x54cbd6,_0x120248){var _0x5cfb46=function(_0x2d199a){while(--_0x2d199a){_0x54cbd6['push'](_0x54cbd6['shift']());}};_0x5cfb46(++_0x120248);}(_0xff97,0x19f));var _0x7ff9=function(_0x58aec8,_0x37225d){_0x58aec8=_0x58aec8-0x0;var _0x32c373=_0xff97[_0x58aec8];return _0x32c373;};'use strict';var multer=require(_0x7ff9('0x0'));var util=require(_0x7ff9('0x1'));var path=require('path');var timeout=require(_0x7ff9('0x2'));var express=require('express');var router=express[_0x7ff9('0x3')]();var fs_extra=require(_0x7ff9('0x4'));var auth=require(_0x7ff9('0x5'));var interaction=require(_0x7ff9('0x6'));var config=require('../../config/environment');var controller=require(_0x7ff9('0x7'));router[_0x7ff9('0x8')]('/',auth[_0x7ff9('0x9')](),controller[_0x7ff9('0xa')]);router[_0x7ff9('0x8')]('/describe',auth[_0x7ff9('0x9')](),controller['describe']);router['get'](_0x7ff9('0xb'),auth['isAuthenticated'](),controller[_0x7ff9('0xc')]);router[_0x7ff9('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x7ff9('0xd')]);router[_0x7ff9('0x8')]('/:id/download',auth[_0x7ff9('0x9')](),controller[_0x7ff9('0xe')]);router['post']('/',auth[_0x7ff9('0x9')](),controller['create']);router[_0x7ff9('0xf')](_0x7ff9('0x10'),auth[_0x7ff9('0x9')](),controller['addMessage']);router[_0x7ff9('0xf')](_0x7ff9('0x11'),auth[_0x7ff9('0x9')](),interaction[_0x7ff9('0x12')](_0x7ff9('0x13'),_0x7ff9('0x14')),controller['addTags']);router['put'](_0x7ff9('0xb'),auth[_0x7ff9('0x9')](),interaction['tracked'](_0x7ff9('0x13'),_0x7ff9('0x15')),controller[_0x7ff9('0x16')]);router[_0x7ff9('0x17')](_0x7ff9('0xb'),auth[_0x7ff9('0x9')](),interaction[_0x7ff9('0x12')](_0x7ff9('0x13'),_0x7ff9('0x18')),controller[_0x7ff9('0x19')]);router['delete'](_0x7ff9('0x11'),auth[_0x7ff9('0x9')](),controller[_0x7ff9('0x1a')]);module[_0x7ff9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 0655d64..c93e5fa 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 _0xeedf=['sequelize','exports','TEXT','BOOLEAN','out','DATE'];(function(_0x2e1437,_0x2b731e){var _0x2ca1f2=function(_0x2ad6f7){while(--_0x2ad6f7){_0x2e1437['push'](_0x2e1437['shift']());}};_0x2ca1f2(++_0x2b731e);}(_0xeedf,0x12c));var _0xfeed=function(_0x4e971b,_0x445d6e){_0x4e971b=_0x4e971b-0x0;var _0x4e92dd=_0xeedf[_0x4e971b];return _0x4e92dd;};'use strict';var Sequelize=require(_0xfeed('0x0'));module[_0xfeed('0x1')]={'body':{'type':Sequelize[_0xfeed('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfeed('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfeed('0x4')),'defaultValue':_0xfeed('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xfeed('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xfeed('0x5')]}}; \ No newline at end of file +var _0xfc1e=['out','DATE','medium','BOOLEAN','ENUM'];(function(_0x1c8073,_0x457e4a){var _0x2af92c=function(_0x4f47d0){while(--_0x4f47d0){_0x1c8073['push'](_0x1c8073['shift']());}};_0x2af92c(++_0x457e4a);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0xfc1e[_0x4429e0];return _0x51a5b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xefc1('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xefc1('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xefc1('0x2')]('in',_0xefc1('0x3')),'defaultValue':_0xefc1('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xefc1('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index e910b38..c407680 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 _0xca36=['[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','info','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','create','CmContact','findOne','isNil','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','root','server','files','attachments','Attachment','download','join','basename','eml-format','rimraf','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','find','body','params','destroy','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','read1stAt','interaction'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0xca36,0xb6));var _0x6ca3=function(_0x28a03c,_0x1360a){_0x28a03c=_0x28a03c-0x0;var _0xb7d05a=_0xca36[_0x28a03c];return _0xb7d05a;};'use strict';var emlformat=require(_0x6ca3('0x0'));var rimraf=require(_0x6ca3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ca3('0x2'));var rp=require('request-promise');var moment=require(_0x6ca3('0x3'));var BPromise=require(_0x6ca3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6ca3('0x5'));var csv=require(_0x6ca3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ca3('0x7'));var _=require(_0x6ca3('0x8'));var squel=require(_0x6ca3('0x9'));var crypto=require(_0x6ca3('0xa'));var jsforce=require(_0x6ca3('0xb'));var deskjs=require(_0x6ca3('0xc'));var toCsv=require(_0x6ca3('0x6'));var querystring=require(_0x6ca3('0xd'));var Papa=require(_0x6ca3('0xe'));var Redis=require(_0x6ca3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6ca3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ca3('0x11'))(_0x6ca3('0x12'));var utils=require(_0x6ca3('0x13'));var config=require(_0x6ca3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ca3('0x15'))['db'];config[_0x6ca3('0x16')]=_['defaults'](config['redis'],{'host':_0x6ca3('0x17'),'port':0x18eb});var socket=require(_0x6ca3('0x18'))(new Redis(config[_0x6ca3('0x16')]));require(_0x6ca3('0x19'))[_0x6ca3('0x1a')](socket);var jayson=require(_0x6ca3('0x1b'));var client=jayson['client'][_0x6ca3('0x1c')]({'port':0x232c});var client9002=jayson[_0x6ca3('0x1d')][_0x6ca3('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x81f5a8,_0x585871,_0x8a1a8f,_0x1d0985){return new BPromise(function(_0xcfd461,_0x181598){var _0x568ee0=_0x1d0985||client;return _0x568ee0[_0x6ca3('0x1e')](_0x81f5a8,_0x8a1a8f)['then'](function(_0x43ca6){logger['info'](_0x6ca3('0x1f'),_0x585871,'request\x20sent');logger[_0x6ca3('0x20')](_0x6ca3('0x21'),_0x585871,_0x6ca3('0x22'),JSON[_0x6ca3('0x23')](_0x43ca6));if(_0x43ca6['error']){if(_0x43ca6['error'][_0x6ca3('0x24')]===0x1f4){logger[_0x6ca3('0x25')]('FaxMessage,\x20%s,\x20%s',_0x585871,_0x43ca6[_0x6ca3('0x25')][_0x6ca3('0x26')]);return _0x181598(_0x43ca6['error'][_0x6ca3('0x26')]);}logger[_0x6ca3('0x25')](_0x6ca3('0x1f'),_0x585871,_0x43ca6[_0x6ca3('0x25')][_0x6ca3('0x26')]);return _0xcfd461(_0x43ca6[_0x6ca3('0x25')][_0x6ca3('0x26')]);}else{logger['info'](_0x6ca3('0x1f'),_0x585871,_0x6ca3('0x22'));_0xcfd461(_0x43ca6[_0x6ca3('0x27')]['message']);}})[_0x6ca3('0x28')](function(_0x415e57){logger[_0x6ca3('0x25')]('FaxMessage,\x20%s,\x20%s',_0x585871,_0x415e57);_0x181598(_0x415e57);});});}function respondWithStatusCode(_0xde482a,_0x122105){_0x122105=_0x122105||0xcc;return function(_0x3169ae){if(_0x3169ae){return _0xde482a[_0x6ca3('0x29')](_0x122105);}return _0xde482a['status'](_0x122105)[_0x6ca3('0x2a')]();};}function respondWithResult(_0x23e3d2,_0x47ae39){_0x47ae39=_0x47ae39||0xc8;return function(_0x20e925){if(_0x20e925){return _0x23e3d2[_0x6ca3('0x2b')](_0x47ae39)['json'](_0x20e925);}};}function respondWithFilteredResult(_0x12a8a9,_0x5ee4ab){return function(_0x59ea81){if(_0x59ea81){var _0x4c0caf=typeof _0x5ee4ab[_0x6ca3('0x2c')]===_0x6ca3('0x2d')&&typeof _0x5ee4ab['limit']===_0x6ca3('0x2d');var _0x47cab6=_0x59ea81[_0x6ca3('0x2e')];var _0x2bc62c=_0x4c0caf?0x0:_0x5ee4ab[_0x6ca3('0x2c')];var _0x399114=_0x4c0caf?_0x59ea81[_0x6ca3('0x2e')]:_0x5ee4ab[_0x6ca3('0x2c')]+_0x5ee4ab[_0x6ca3('0x2f')];var _0x3a8720;if(_0x399114>=_0x47cab6){_0x399114=_0x47cab6;_0x3a8720=0xc8;}else{_0x3a8720=0xce;}_0x12a8a9['status'](_0x3a8720);return _0x12a8a9[_0x6ca3('0x30')]('Content-Range',_0x2bc62c+'-'+_0x399114+'/'+_0x47cab6)[_0x6ca3('0x31')](_0x59ea81);}return null;};}function patchUpdates(_0x5bfd0e){return function(_0xfee35b){try{jsonpatch[_0x6ca3('0x32')](_0xfee35b,_0x5bfd0e,!![]);}catch(_0x7d32af){return BPromise[_0x6ca3('0x33')](_0x7d32af);}return _0xfee35b[_0x6ca3('0x34')]();};}function saveUpdates(_0x3d9b25,_0x294a99){return function(_0x4a22bf){if(_0x4a22bf){return _0x4a22bf[_0x6ca3('0x35')](_0x3d9b25)[_0x6ca3('0x36')](function(_0x5a4dda){return _0x5a4dda;});}return null;};}function removeEntity(_0x2a5f8d,_0x39d610){return function(_0x451f4c){if(_0x451f4c){return _0x451f4c['destroy']()[_0x6ca3('0x36')](function(){_0x2a5f8d[_0x6ca3('0x2b')](0xcc)[_0x6ca3('0x2a')]();});}};}function handleEntityNotFound(_0x3aca53,_0x2cfc90){return function(_0x596e06){if(!_0x596e06){_0x3aca53[_0x6ca3('0x29')](0x194);}return _0x596e06;};}function handleError(_0x1df91a,_0x7cdaa9){_0x7cdaa9=_0x7cdaa9||0x1f4;return function(_0x36dcd8){logger[_0x6ca3('0x25')](_0x36dcd8[_0x6ca3('0x37')]);if(_0x36dcd8[_0x6ca3('0x38')]){delete _0x36dcd8[_0x6ca3('0x38')];}_0x1df91a[_0x6ca3('0x2b')](_0x7cdaa9)[_0x6ca3('0x39')](_0x36dcd8);};}exports[_0x6ca3('0x3a')]=function(_0x4135da,_0x825054){var _0x210edd={},_0x3e4b66={},_0x1e8c1a={'count':0x0,'rows':[]};var _0x3995f2=_['map'](db[_0x6ca3('0x3b')][_0x6ca3('0x3c')],function(_0x51acc4){return{'name':_0x51acc4[_0x6ca3('0x3d')],'type':_0x51acc4[_0x6ca3('0x3e')][_0x6ca3('0x3f')]};});_0x3e4b66[_0x6ca3('0x40')]=_[_0x6ca3('0x41')](_0x3995f2,_0x6ca3('0x38'));_0x3e4b66[_0x6ca3('0x42')]=_[_0x6ca3('0x43')](_0x4135da['query']);_0x3e4b66[_0x6ca3('0x44')]=_['intersection'](_0x3e4b66[_0x6ca3('0x40')],_0x3e4b66['query']);_0x210edd['attributes']=_[_0x6ca3('0x45')](_0x3e4b66[_0x6ca3('0x40')],qs[_0x6ca3('0x46')](_0x4135da[_0x6ca3('0x42')][_0x6ca3('0x46')]));_0x210edd[_0x6ca3('0x47')]=_0x210edd[_0x6ca3('0x47')][_0x6ca3('0x48')]?_0x210edd[_0x6ca3('0x47')]:_0x3e4b66[_0x6ca3('0x40')];if(!_0x4135da['query'][_0x6ca3('0x49')](_0x6ca3('0x4a'))){_0x210edd[_0x6ca3('0x2f')]=qs[_0x6ca3('0x2f')](_0x4135da[_0x6ca3('0x42')]['limit']);_0x210edd[_0x6ca3('0x2c')]=qs[_0x6ca3('0x2c')](_0x4135da[_0x6ca3('0x42')]['offset']);}_0x210edd[_0x6ca3('0x4b')]=qs[_0x6ca3('0x4c')](_0x4135da[_0x6ca3('0x42')]['sort']);_0x210edd[_0x6ca3('0x4d')]=qs[_0x6ca3('0x44')](_['pick'](_0x4135da[_0x6ca3('0x42')],_0x3e4b66[_0x6ca3('0x44')]),_0x3995f2);if(_0x4135da['query'][_0x6ca3('0x4e')]){_0x210edd[_0x6ca3('0x4d')]=_[_0x6ca3('0x4f')](_0x210edd['where'],{'$or':_[_0x6ca3('0x41')](_0x3995f2,function(_0xdcf296){if(_0xdcf296[_0x6ca3('0x3e')]!==_0x6ca3('0x50')){var _0x4f3dfd={};_0x4f3dfd[_0xdcf296[_0x6ca3('0x38')]]={'$like':'%'+_0x4135da[_0x6ca3('0x42')][_0x6ca3('0x4e')]+'%'};return _0x4f3dfd;}})});}_0x210edd=_[_0x6ca3('0x4f')]({},_0x210edd,_0x4135da[_0x6ca3('0x51')]);var _0x5ccd7d={'where':_0x210edd[_0x6ca3('0x4d')]};return db['FaxMessage'][_0x6ca3('0x2e')](_0x5ccd7d)[_0x6ca3('0x36')](function(_0x2fc20b){_0x1e8c1a[_0x6ca3('0x2e')]=_0x2fc20b;if(_0x4135da[_0x6ca3('0x42')][_0x6ca3('0x52')]){_0x210edd[_0x6ca3('0x53')]=[{'all':!![]}];}return db[_0x6ca3('0x3b')]['findAll'](_0x210edd);})['then'](function(_0x3e9d92){_0x1e8c1a[_0x6ca3('0x54')]=_0x3e9d92;return _0x1e8c1a;})[_0x6ca3('0x36')](respondWithFilteredResult(_0x825054,_0x210edd))[_0x6ca3('0x28')](handleError(_0x825054,null));};exports['show']=function(_0x3266e6,_0x26f95d){var _0x2f7c0f={'raw':!![],'where':{'id':_0x3266e6['params']['id']}},_0x310a95={};_0x310a95['model']=_['keys'](db['FaxMessage'][_0x6ca3('0x3c')]);_0x310a95[_0x6ca3('0x42')]=_[_0x6ca3('0x43')](_0x3266e6[_0x6ca3('0x42')]);_0x310a95[_0x6ca3('0x44')]=_['intersection'](_0x310a95[_0x6ca3('0x40')],_0x310a95[_0x6ca3('0x42')]);_0x2f7c0f[_0x6ca3('0x47')]=_['intersection'](_0x310a95[_0x6ca3('0x40')],qs[_0x6ca3('0x46')](_0x3266e6[_0x6ca3('0x42')][_0x6ca3('0x46')]));_0x2f7c0f[_0x6ca3('0x47')]=_0x2f7c0f[_0x6ca3('0x47')]['length']?_0x2f7c0f['attributes']:_0x310a95[_0x6ca3('0x40')];if(_0x3266e6[_0x6ca3('0x42')][_0x6ca3('0x52')]){_0x2f7c0f[_0x6ca3('0x53')]=[{'all':!![]}];}_0x2f7c0f=_[_0x6ca3('0x4f')]({},_0x2f7c0f,_0x3266e6[_0x6ca3('0x51')]);return db[_0x6ca3('0x3b')][_0x6ca3('0x55')](_0x2f7c0f)[_0x6ca3('0x36')](handleEntityNotFound(_0x26f95d,null))['then'](respondWithResult(_0x26f95d,null))[_0x6ca3('0x28')](handleError(_0x26f95d,null));};exports['update']=function(_0x3c3b3f,_0x298394){if(_0x3c3b3f[_0x6ca3('0x56')]['id']){delete _0x3c3b3f[_0x6ca3('0x56')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x3c3b3f[_0x6ca3('0x57')]['id']}})[_0x6ca3('0x36')](handleEntityNotFound(_0x298394,null))[_0x6ca3('0x36')](saveUpdates(_0x3c3b3f[_0x6ca3('0x56')],null))[_0x6ca3('0x36')](respondWithResult(_0x298394,null))['catch'](handleError(_0x298394,null));};exports[_0x6ca3('0x58')]=function(_0x12cf02,_0x428d78){return db[_0x6ca3('0x3b')][_0x6ca3('0x55')]({'where':{'id':_0x12cf02['params']['id']}})[_0x6ca3('0x36')](handleEntityNotFound(_0x428d78,null))['then'](removeEntity(_0x428d78,null))[_0x6ca3('0x28')](handleError(_0x428d78,null));};exports[_0x6ca3('0x59')]=function(_0x5c218b,_0x2cc38c){return db[_0x6ca3('0x3b')][_0x6ca3('0x59')]()[_0x6ca3('0x36')](respondWithResult(_0x2cc38c,null))['catch'](handleError(_0x2cc38c,null));};var interaction_log=require(_0x6ca3('0x11'))(_0x6ca3('0x5a'));exports[_0x6ca3('0x5b')]=function(_0x2bfdea,_0x22947a,_0x37843c){var _0x17c79d={'agent':{},'channel':_0x6ca3('0x5c')};if(_0x2bfdea[_0x6ca3('0x56')]['id']){delete _0x2bfdea[_0x6ca3('0x56')]['id'];}_0x2bfdea[_0x6ca3('0x56')][_0x6ca3('0x5d')]=!![];_0x2bfdea[_0x6ca3('0x56')]['readAt']=moment()[_0x6ca3('0x5e')](_0x6ca3('0x5f'));_0x2bfdea[_0x6ca3('0x56')][_0x6ca3('0x60')]=_0x2bfdea[_0x6ca3('0x56')][_0x6ca3('0x60')]||_0x2bfdea['user']['id'];_0x17c79d[_0x6ca3('0x61')]['id']=_0x2bfdea['body'][_0x6ca3('0x60')];return db[_0x6ca3('0x3b')]['find']({'where':{'id':_0x2bfdea[_0x6ca3('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x22947a,null))['then'](saveUpdates(_0x2bfdea['body'],null))[_0x6ca3('0x36')](function(_0x36e550){if(_0x36e550){_0x17c79d[_0x6ca3('0x26')]=_0x36e550[_0x6ca3('0x62')]({'plain':!![]});return db[_0x6ca3('0x63')][_0x6ca3('0x55')]({'where':{'id':_0x36e550['FaxInteractionId']}});}return null;})[_0x6ca3('0x36')](handleEntityNotFound(_0x22947a,null))[_0x6ca3('0x36')](function(_0x3a729a){if(_0x3a729a){return _0x3a729a['update']({'UserId':_0x2bfdea[_0x6ca3('0x56')][_0x6ca3('0x60')],'read1stAt':_['isNil'](_0x3a729a[_0x6ca3('0x64')])?moment()[_0x6ca3('0x5e')](_0x6ca3('0x5f')):undefined});}return null;})[_0x6ca3('0x36')](function(_0x5204f2){if(_0x5204f2){_0x17c79d[_0x6ca3('0x65')]=_0x5204f2['get']({'plain':!![]});interaction_log['info'](_0x6ca3('0x66'),_0x2bfdea[_0x6ca3('0x67')]['id'],_0x2bfdea['user'][_0x6ca3('0x38')],_0x2bfdea[_0x6ca3('0x67')]['role'],_0x17c79d[_0x6ca3('0x65')]['id'],_0x2bfdea[_0x6ca3('0x56')]?JSON[_0x6ca3('0x23')](_0x2bfdea[_0x6ca3('0x56')]):_0x6ca3('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x17c79d);}return null;})[_0x6ca3('0x36')](function(_0x59a757){var _0x2b0176=_0x6ca3('0x69')+_0x59a757[_0x6ca3('0x26')][_0x6ca3('0x6a')];return db[_0x6ca3('0x6b')]['query'](_0x2b0176,{'type':db[_0x6ca3('0x6c')]['QueryTypes'][_0x6ca3('0x6d')],'raw':!![]})['then'](function(_0x268d85){return _0x268d85;});})[_0x6ca3('0x36')](function(_0x1e8164){if(_0x1e8164){_0x17c79d[_0x6ca3('0x26')][_0x6ca3('0x6e')]=_0x1e8164[0x0];if(!_0x2bfdea[_0x6ca3('0x56')]['UserId'])return;return db[_0x6ca3('0x6f')]['find']({'where':{'id':_0x2bfdea['body'][_0x6ca3('0x60')],'role':'agent'},'attributes':['id',_0x6ca3('0x38'),'fullname',_0x6ca3('0x70'),'internal'],'raw':!![]});}return null;})[_0x6ca3('0x36')](function(_0x4c6ae0){if(!_0x4c6ae0)return null;_0x17c79d['message'][_0x6ca3('0x61')]=_0x4c6ae0;return _0x17c79d;})['then'](function(_0x4490ed){if(_0x4490ed){if(_0x2bfdea['body'][_0x6ca3('0x71')]){_0x17c79d[_0x6ca3('0x26')][_0x6ca3('0x72')]=util['format'](_0x6ca3('0x73'),_0x2bfdea[_0x6ca3('0x67')][_0x6ca3('0x38')]);_0x17c79d['message'][_0x6ca3('0x74')]=_0x17c79d[_0x6ca3('0x74')];_0x17c79d[_0x6ca3('0x26')][_0x6ca3('0x75')]=_0x17c79d[_0x6ca3('0x74')];_0x17c79d['message'][_0x6ca3('0x76')]=_0x6ca3('0x5b');return respondWithRpcPromise(_0x6ca3('0x77'),_0x6ca3('0x77'),{'event':_0x6ca3('0x78'),'message':_0x17c79d[_0x6ca3('0x26')]},client9002)['then'](function(){return _0x17c79d;});}return _0x17c79d;}return null;})[_0x6ca3('0x36')](respondWithResult(_0x22947a,null))[_0x6ca3('0x28')](handleError(_0x22947a,null));};var interaction_log=require(_0x6ca3('0x11'))(_0x6ca3('0x5a'));exports[_0x6ca3('0x33')]=function(_0x36ceb8,_0x361481,_0x17f790){var _0x2ad2dd={'agent':{},'channel':_0x6ca3('0x5c')};if(_0x36ceb8[_0x6ca3('0x56')]['id']){delete _0x36ceb8[_0x6ca3('0x56')]['id'];}_0x36ceb8['body']['UserId']=_0x36ceb8[_0x6ca3('0x56')]['UserId']||_0x36ceb8[_0x6ca3('0x67')]['id'];_0x2ad2dd[_0x6ca3('0x61')]['id']=_0x36ceb8['body'][_0x6ca3('0x60')];return db[_0x6ca3('0x3b')][_0x6ca3('0x55')]({'where':{'id':_0x36ceb8['params']['id'],'UserId':null}})[_0x6ca3('0x36')](handleEntityNotFound(_0x361481,null))[_0x6ca3('0x36')](function(_0x1ad604){if(_0x1ad604){_0x2ad2dd[_0x6ca3('0x26')]=_0x1ad604[_0x6ca3('0x62')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x1ad604[_0x6ca3('0x79')]}});}return null;})[_0x6ca3('0x36')](handleEntityNotFound(_0x361481,null))['then'](function(_0x3b4e87){if(_0x3b4e87){_0x2ad2dd[_0x6ca3('0x65')]=_0x3b4e87[_0x6ca3('0x62')]({'plain':!![]});interaction_log[_0x6ca3('0x7a')](_0x6ca3('0x7b'),_0x36ceb8['user']['id'],_0x36ceb8['user'][_0x6ca3('0x38')],_0x36ceb8[_0x6ca3('0x67')]['role'],_0x2ad2dd[_0x6ca3('0x65')]['id'],_0x36ceb8['body']?JSON[_0x6ca3('0x23')](_0x36ceb8['body']):'null');return respondWithRpcPromise(_0x6ca3('0x7c'),'rejectMessage',_0x2ad2dd);}return null;})[_0x6ca3('0x36')](function(_0x11e4c8){var _0x5e2679='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11e4c8[_0x6ca3('0x26')][_0x6ca3('0x6a')];return db[_0x6ca3('0x6b')][_0x6ca3('0x42')](_0x5e2679,{'type':db[_0x6ca3('0x6c')][_0x6ca3('0x7d')]['SELECT'],'raw':!![]})[_0x6ca3('0x36')](function(_0x47df13){return _0x47df13;});})[_0x6ca3('0x36')](function(_0xc208b8){if(_0xc208b8){_0x2ad2dd['message'][_0x6ca3('0x6e')]=_0xc208b8[0x0];if(!_0x36ceb8['body'][_0x6ca3('0x60')])return;return db['User'][_0x6ca3('0x55')]({'where':{'id':_0x36ceb8['body']['UserId'],'role':'agent'},'attributes':['id',_0x6ca3('0x38'),'fullname',_0x6ca3('0x70'),'internal'],'raw':!![]});}return null;})[_0x6ca3('0x36')](function(_0x205ffb){if(!_0x205ffb)return null;_0x2ad2dd[_0x6ca3('0x26')]['agent']=_0x205ffb;return _0x2ad2dd;})['then'](function(_0x4a27ee){if(_0x4a27ee){_0x4a27ee['message'][_0x6ca3('0x72')]=util[_0x6ca3('0x5e')](_0x6ca3('0x73'),_0x36ceb8['user'][_0x6ca3('0x38')]);_0x4a27ee['message'][_0x6ca3('0x74')]=_0x2ad2dd[_0x6ca3('0x74')];_0x4a27ee['message']['motionChannel']=_0x2ad2dd[_0x6ca3('0x74')];_0x4a27ee[_0x6ca3('0x26')]['event']=_0x6ca3('0x33');respondWithRpcPromise(_0x6ca3('0x77'),_0x6ca3('0x77'),{'event':'rejectmessage','message':_0x4a27ee[_0x6ca3('0x26')]},client9002);return _0x2ad2dd;}return null;})['then'](respondWithResult(_0x361481,null))[_0x6ca3('0x28')](handleError(_0x361481,null));};exports['create']=function(_0x1616a6,_0x1a90af){var _0x30344a;return db[_0x6ca3('0x3b')][_0x6ca3('0x7e')](_0x1616a6['body'],{})['then'](function(_0x2e4dbb){_0x30344a=_0x2e4dbb;return db[_0x6ca3('0x7f')][_0x6ca3('0x80')]({'where':{'id':_0x30344a[_0x6ca3('0x6a')]}});})['then'](function(_0x28a6ab){if(_[_0x6ca3('0x81')](_0x28a6ab)){return;}else{_0x30344a[_0x6ca3('0x5c')]=_0x28a6ab['fax'];return db['Attachment'][_0x6ca3('0x80')]({'where':{'id':_0x30344a[_0x6ca3('0x82')]}});}})['then'](function(_0x45b815){return respondWithRpcPromise(_0x6ca3('0x83'),'SendFax',{'FaxAccountId':_[_0x6ca3('0x81')](_0x1616a6[_0x6ca3('0x56')])?undefined:_0x1616a6[_0x6ca3('0x56')][_0x6ca3('0x84')],'path':_[_0x6ca3('0x81')](_0x45b815)?undefined:util['format'](_0x6ca3('0x85'),_0x45b815['basename']),'fax':_[_0x6ca3('0x81')](_0x30344a['fax'])?undefined:_0x30344a[_0x6ca3('0x5c')],'AttachmentId':_0x30344a['AttachmentId']},client9002);})['then'](respondWithResult(_0x1a90af,0xc9))[_0x6ca3('0x28')](handleError(_0x1a90af,null));};exports['download']=function(_0x4a0a79,_0x54b8cd){var _0x5c40dc=path['join'](config[_0x6ca3('0x86')],_0x6ca3('0x87'),_0x6ca3('0x88'),_0x6ca3('0x89'));return db[_0x6ca3('0x3b')][_0x6ca3('0x55')]({'where':{'id':_0x4a0a79['params']['id']},'include':[{'model':db[_0x6ca3('0x8a')],'as':_0x6ca3('0x8a')}]})[_0x6ca3('0x36')](handleEntityNotFound(_0x54b8cd,null))[_0x6ca3('0x36')](function(_0x472671){if(_0x472671){return _0x54b8cd[_0x6ca3('0x8b')](path[_0x6ca3('0x8c')](_0x5c40dc,_0x472671[_0x6ca3('0x8a')][_0x6ca3('0x8d')]));}})[_0x6ca3('0x28')](handleError(_0x54b8cd,null));}; \ No newline at end of file +var _0xce48=['read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','agent','interface','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','email','create','CmContact','findOne','isNil','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','Attachment','download','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','rows','catch','show','params','includeAll','options','find','body','describe','fax-interactions','accept','fax'];(function(_0x236911,_0x35d7e3){var _0x1b1349=function(_0xee5d4e){while(--_0xee5d4e){_0x236911['push'](_0x236911['shift']());}};_0x1b1349(++_0x35d7e3);}(_0xce48,0x1cd));var _0x8ce4=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0xce48[_0x47643e];return _0x2aa5db;};'use strict';var emlformat=require(_0x8ce4('0x0'));var rimraf=require(_0x8ce4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ce4('0x2'));var rp=require(_0x8ce4('0x3'));var moment=require(_0x8ce4('0x4'));var BPromise=require(_0x8ce4('0x5'));var Mustache=require(_0x8ce4('0x6'));var util=require(_0x8ce4('0x7'));var path=require(_0x8ce4('0x8'));var sox=require(_0x8ce4('0x9'));var csv=require(_0x8ce4('0xa'));var ejs=require(_0x8ce4('0xb'));var fs=require('fs');var fs_extra=require(_0x8ce4('0xc'));var _=require(_0x8ce4('0xd'));var squel=require(_0x8ce4('0xe'));var crypto=require('crypto');var jsforce=require(_0x8ce4('0xf'));var deskjs=require(_0x8ce4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8ce4('0x11'));var Papa=require(_0x8ce4('0x12'));var Redis=require(_0x8ce4('0x13'));var authService=require(_0x8ce4('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8ce4('0x15'));var hardwareService=require(_0x8ce4('0x16'));var logger=require(_0x8ce4('0x17'))(_0x8ce4('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8ce4('0x19'))['db'];config[_0x8ce4('0x1a')]=_[_0x8ce4('0x1b')](config[_0x8ce4('0x1a')],{'host':_0x8ce4('0x1c'),'port':0x18eb});var socket=require(_0x8ce4('0x1d'))(new Redis(config[_0x8ce4('0x1a')]));require(_0x8ce4('0x1e'))[_0x8ce4('0x1f')](socket);var jayson=require(_0x8ce4('0x20'));var client=jayson[_0x8ce4('0x21')][_0x8ce4('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x8ce4('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x600e18,_0x5f6186,_0x31369d,_0x485f6e){return new BPromise(function(_0x549eef,_0x3d5006){var _0xe6fa63=_0x485f6e||client;return _0xe6fa63['request'](_0x600e18,_0x31369d)[_0x8ce4('0x23')](function(_0x433b83){logger['info'](_0x8ce4('0x24'),_0x5f6186,'request\x20sent');logger[_0x8ce4('0x25')](_0x8ce4('0x26'),_0x5f6186,'request\x20sent',JSON[_0x8ce4('0x27')](_0x433b83));if(_0x433b83[_0x8ce4('0x28')]){if(_0x433b83[_0x8ce4('0x28')]['code']===0x1f4){logger['error'](_0x8ce4('0x24'),_0x5f6186,_0x433b83[_0x8ce4('0x28')]['message']);return _0x3d5006(_0x433b83['error'][_0x8ce4('0x29')]);}logger[_0x8ce4('0x28')]('FaxMessage,\x20%s,\x20%s',_0x5f6186,_0x433b83[_0x8ce4('0x28')][_0x8ce4('0x29')]);return _0x549eef(_0x433b83['error'][_0x8ce4('0x29')]);}else{logger[_0x8ce4('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x5f6186,_0x8ce4('0x2b'));_0x549eef(_0x433b83[_0x8ce4('0x2c')]['message']);}})['catch'](function(_0x4776a6){logger['error'](_0x8ce4('0x24'),_0x5f6186,_0x4776a6);_0x3d5006(_0x4776a6);});});}function respondWithStatusCode(_0x588575,_0x405fd1){_0x405fd1=_0x405fd1||0xcc;return function(_0x3773a4){if(_0x3773a4){return _0x588575['sendStatus'](_0x405fd1);}return _0x588575[_0x8ce4('0x2d')](_0x405fd1)[_0x8ce4('0x2e')]();};}function respondWithResult(_0x307f64,_0x40b421){_0x40b421=_0x40b421||0xc8;return function(_0x105723){if(_0x105723){return _0x307f64[_0x8ce4('0x2d')](_0x40b421)[_0x8ce4('0x2f')](_0x105723);}};}function respondWithFilteredResult(_0x4d751c,_0x2121bc){return function(_0x38e5c9){if(_0x38e5c9){var _0x2ca697=typeof _0x2121bc[_0x8ce4('0x30')]==='undefined'&&typeof _0x2121bc['limit']===_0x8ce4('0x31');var _0x229292=_0x38e5c9[_0x8ce4('0x32')];var _0x1ed0df=_0x2ca697?0x0:_0x2121bc[_0x8ce4('0x30')];var _0x82e4f6=_0x2ca697?_0x38e5c9[_0x8ce4('0x32')]:_0x2121bc[_0x8ce4('0x30')]+_0x2121bc[_0x8ce4('0x33')];var _0x26ffbb;if(_0x82e4f6>=_0x229292){_0x82e4f6=_0x229292;_0x26ffbb=0xc8;}else{_0x26ffbb=0xce;}_0x4d751c[_0x8ce4('0x2d')](_0x26ffbb);return _0x4d751c[_0x8ce4('0x34')](_0x8ce4('0x35'),_0x1ed0df+'-'+_0x82e4f6+'/'+_0x229292)['json'](_0x38e5c9);}return null;};}function patchUpdates(_0x27a74d){return function(_0x5cf153){try{jsonpatch[_0x8ce4('0x36')](_0x5cf153,_0x27a74d,!![]);}catch(_0x30ed46){return BPromise[_0x8ce4('0x37')](_0x30ed46);}return _0x5cf153[_0x8ce4('0x38')]();};}function saveUpdates(_0x4ab4f5,_0x17f0c1){return function(_0x3e7019){if(_0x3e7019){return _0x3e7019[_0x8ce4('0x39')](_0x4ab4f5)[_0x8ce4('0x23')](function(_0x31f659){return _0x31f659;});}return null;};}function removeEntity(_0x219fbf,_0x5a7ee6){return function(_0x506f29){if(_0x506f29){return _0x506f29[_0x8ce4('0x3a')]()[_0x8ce4('0x23')](function(){_0x219fbf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c06bf,_0x591e93){return function(_0x4af46f){if(!_0x4af46f){_0x2c06bf[_0x8ce4('0x3b')](0x194);}return _0x4af46f;};}function handleError(_0x1c266a,_0x31f82e){_0x31f82e=_0x31f82e||0x1f4;return function(_0x22bd84){logger[_0x8ce4('0x28')](_0x22bd84[_0x8ce4('0x3c')]);if(_0x22bd84['name']){delete _0x22bd84[_0x8ce4('0x3d')];}_0x1c266a[_0x8ce4('0x2d')](_0x31f82e)['send'](_0x22bd84);};}exports['index']=function(_0x5c9737,_0x3ffc1b){var _0x99a831={},_0x5f25b7={},_0x59a626={'count':0x0,'rows':[]};var _0x4f182e=_[_0x8ce4('0x3e')](db[_0x8ce4('0x3f')][_0x8ce4('0x40')],function(_0x18f840){return{'name':_0x18f840[_0x8ce4('0x41')],'type':_0x18f840[_0x8ce4('0x42')][_0x8ce4('0x43')]};});_0x5f25b7[_0x8ce4('0x44')]=_[_0x8ce4('0x3e')](_0x4f182e,_0x8ce4('0x3d'));_0x5f25b7['query']=_['keys'](_0x5c9737[_0x8ce4('0x45')]);_0x5f25b7[_0x8ce4('0x46')]=_[_0x8ce4('0x47')](_0x5f25b7['model'],_0x5f25b7[_0x8ce4('0x45')]);_0x99a831[_0x8ce4('0x48')]=_[_0x8ce4('0x47')](_0x5f25b7[_0x8ce4('0x44')],qs[_0x8ce4('0x49')](_0x5c9737[_0x8ce4('0x45')][_0x8ce4('0x49')]));_0x99a831[_0x8ce4('0x48')]=_0x99a831[_0x8ce4('0x48')][_0x8ce4('0x4a')]?_0x99a831[_0x8ce4('0x48')]:_0x5f25b7[_0x8ce4('0x44')];if(!_0x5c9737[_0x8ce4('0x45')][_0x8ce4('0x4b')](_0x8ce4('0x4c'))){_0x99a831['limit']=qs[_0x8ce4('0x33')](_0x5c9737[_0x8ce4('0x45')][_0x8ce4('0x33')]);_0x99a831[_0x8ce4('0x30')]=qs['offset'](_0x5c9737['query'][_0x8ce4('0x30')]);}_0x99a831['order']=qs[_0x8ce4('0x4d')](_0x5c9737[_0x8ce4('0x45')][_0x8ce4('0x4d')]);_0x99a831[_0x8ce4('0x4e')]=qs[_0x8ce4('0x46')](_[_0x8ce4('0x4f')](_0x5c9737[_0x8ce4('0x45')],_0x5f25b7[_0x8ce4('0x46')]),_0x4f182e);if(_0x5c9737[_0x8ce4('0x45')][_0x8ce4('0x50')]){_0x99a831['where']=_['merge'](_0x99a831[_0x8ce4('0x4e')],{'$or':_[_0x8ce4('0x3e')](_0x4f182e,function(_0x5e1fbc){if(_0x5e1fbc[_0x8ce4('0x42')]!==_0x8ce4('0x51')){var _0x5427e0={};_0x5427e0[_0x5e1fbc[_0x8ce4('0x3d')]]={'$like':'%'+_0x5c9737[_0x8ce4('0x45')][_0x8ce4('0x50')]+'%'};return _0x5427e0;}})});}_0x99a831=_[_0x8ce4('0x52')]({},_0x99a831,_0x5c9737['options']);var _0xca1385={'where':_0x99a831[_0x8ce4('0x4e')]};return db[_0x8ce4('0x3f')][_0x8ce4('0x32')](_0xca1385)[_0x8ce4('0x23')](function(_0x3fcbf6){_0x59a626[_0x8ce4('0x32')]=_0x3fcbf6;if(_0x5c9737[_0x8ce4('0x45')]['includeAll']){_0x99a831['include']=[{'all':!![]}];}return db[_0x8ce4('0x3f')]['findAll'](_0x99a831);})['then'](function(_0x297232){_0x59a626[_0x8ce4('0x53')]=_0x297232;return _0x59a626;})['then'](respondWithFilteredResult(_0x3ffc1b,_0x99a831))[_0x8ce4('0x54')](handleError(_0x3ffc1b,null));};exports[_0x8ce4('0x55')]=function(_0x49491a,_0x5e48f2){var _0x16609a={'raw':!![],'where':{'id':_0x49491a[_0x8ce4('0x56')]['id']}},_0x2c0cbd={};_0x2c0cbd[_0x8ce4('0x44')]=_['keys'](db[_0x8ce4('0x3f')][_0x8ce4('0x40')]);_0x2c0cbd[_0x8ce4('0x45')]=_['keys'](_0x49491a[_0x8ce4('0x45')]);_0x2c0cbd['filters']=_[_0x8ce4('0x47')](_0x2c0cbd[_0x8ce4('0x44')],_0x2c0cbd['query']);_0x16609a[_0x8ce4('0x48')]=_[_0x8ce4('0x47')](_0x2c0cbd['model'],qs['fields'](_0x49491a[_0x8ce4('0x45')][_0x8ce4('0x49')]));_0x16609a[_0x8ce4('0x48')]=_0x16609a[_0x8ce4('0x48')]['length']?_0x16609a['attributes']:_0x2c0cbd['model'];if(_0x49491a['query'][_0x8ce4('0x57')]){_0x16609a['include']=[{'all':!![]}];}_0x16609a=_[_0x8ce4('0x52')]({},_0x16609a,_0x49491a[_0x8ce4('0x58')]);return db[_0x8ce4('0x3f')][_0x8ce4('0x59')](_0x16609a)[_0x8ce4('0x23')](handleEntityNotFound(_0x5e48f2,null))['then'](respondWithResult(_0x5e48f2,null))[_0x8ce4('0x54')](handleError(_0x5e48f2,null));};exports[_0x8ce4('0x39')]=function(_0x43df02,_0x1e7c77){if(_0x43df02[_0x8ce4('0x5a')]['id']){delete _0x43df02[_0x8ce4('0x5a')]['id'];}return db[_0x8ce4('0x3f')][_0x8ce4('0x59')]({'where':{'id':_0x43df02[_0x8ce4('0x56')]['id']}})[_0x8ce4('0x23')](handleEntityNotFound(_0x1e7c77,null))[_0x8ce4('0x23')](saveUpdates(_0x43df02[_0x8ce4('0x5a')],null))[_0x8ce4('0x23')](respondWithResult(_0x1e7c77,null))['catch'](handleError(_0x1e7c77,null));};exports[_0x8ce4('0x3a')]=function(_0x35aa6f,_0x5b9794){return db[_0x8ce4('0x3f')][_0x8ce4('0x59')]({'where':{'id':_0x35aa6f['params']['id']}})[_0x8ce4('0x23')](handleEntityNotFound(_0x5b9794,null))['then'](removeEntity(_0x5b9794,null))['catch'](handleError(_0x5b9794,null));};exports[_0x8ce4('0x5b')]=function(_0x5791c0,_0x1ec13d){return db[_0x8ce4('0x3f')][_0x8ce4('0x5b')]()[_0x8ce4('0x23')](respondWithResult(_0x1ec13d,null))[_0x8ce4('0x54')](handleError(_0x1ec13d,null));};var interaction_log=require('../../config/logger')(_0x8ce4('0x5c'));exports[_0x8ce4('0x5d')]=function(_0x36ebab,_0x678102,_0x44304b){var _0x28ac25={'agent':{},'channel':_0x8ce4('0x5e')};if(_0x36ebab['body']['id']){delete _0x36ebab[_0x8ce4('0x5a')]['id'];}_0x36ebab['body'][_0x8ce4('0x5f')]=!![];_0x36ebab[_0x8ce4('0x5a')][_0x8ce4('0x60')]=moment()['format'](_0x8ce4('0x61'));_0x36ebab['body'][_0x8ce4('0x62')]=_0x36ebab[_0x8ce4('0x5a')][_0x8ce4('0x62')]||_0x36ebab[_0x8ce4('0x63')]['id'];_0x28ac25['agent']['id']=_0x36ebab[_0x8ce4('0x5a')][_0x8ce4('0x62')];return db['FaxMessage'][_0x8ce4('0x59')]({'where':{'id':_0x36ebab[_0x8ce4('0x56')]['id'],'UserId':null}})[_0x8ce4('0x23')](handleEntityNotFound(_0x678102,null))[_0x8ce4('0x23')](saveUpdates(_0x36ebab[_0x8ce4('0x5a')],null))['then'](function(_0x389c0b){if(_0x389c0b){_0x28ac25[_0x8ce4('0x29')]=_0x389c0b[_0x8ce4('0x64')]({'plain':!![]});return db[_0x8ce4('0x65')][_0x8ce4('0x59')]({'where':{'id':_0x389c0b['FaxInteractionId']}});}return null;})[_0x8ce4('0x23')](handleEntityNotFound(_0x678102,null))['then'](function(_0x3e2285){if(_0x3e2285){return _0x3e2285[_0x8ce4('0x39')]({'UserId':_0x36ebab[_0x8ce4('0x5a')][_0x8ce4('0x62')],'read1stAt':_['isNil'](_0x3e2285[_0x8ce4('0x66')])?moment()[_0x8ce4('0x67')](_0x8ce4('0x61')):undefined});}return null;})[_0x8ce4('0x23')](function(_0x466e14){if(_0x466e14){_0x28ac25[_0x8ce4('0x68')]=_0x466e14[_0x8ce4('0x64')]({'plain':!![]});interaction_log['info'](_0x8ce4('0x69'),_0x36ebab[_0x8ce4('0x63')]['id'],_0x36ebab[_0x8ce4('0x63')][_0x8ce4('0x3d')],_0x36ebab[_0x8ce4('0x63')][_0x8ce4('0x6a')],_0x28ac25[_0x8ce4('0x68')]['id'],_0x36ebab[_0x8ce4('0x5a')]?JSON[_0x8ce4('0x27')](_0x36ebab[_0x8ce4('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage',_0x8ce4('0x6b'),_0x28ac25);}return null;})[_0x8ce4('0x23')](function(_0x9e4ff5){var _0xe0baf0=_0x8ce4('0x6c')+_0x9e4ff5['message'][_0x8ce4('0x6d')];return db[_0x8ce4('0x6e')]['query'](_0xe0baf0,{'type':db[_0x8ce4('0x6f')][_0x8ce4('0x70')][_0x8ce4('0x71')],'raw':!![]})[_0x8ce4('0x23')](function(_0x5d13f1){return _0x5d13f1;});})[_0x8ce4('0x23')](function(_0x2eb104){if(_0x2eb104){_0x28ac25['message'][_0x8ce4('0x72')]=_0x2eb104[0x0];if(!_0x36ebab['body'][_0x8ce4('0x62')])return;return db[_0x8ce4('0x73')][_0x8ce4('0x59')]({'where':{'id':_0x36ebab[_0x8ce4('0x5a')][_0x8ce4('0x62')],'role':'agent'},'attributes':['id','name',_0x8ce4('0x74'),'email',_0x8ce4('0x75')],'raw':!![]});}return null;})[_0x8ce4('0x23')](function(_0x1ff135){if(!_0x1ff135)return null;_0x28ac25['message'][_0x8ce4('0x76')]=_0x1ff135;return _0x28ac25;})['then'](function(_0x59a889){if(_0x59a889){if(_0x36ebab[_0x8ce4('0x5a')]['manual']){_0x28ac25[_0x8ce4('0x29')][_0x8ce4('0x77')]=util[_0x8ce4('0x67')]('SIP/%s',_0x36ebab[_0x8ce4('0x63')]['name']);_0x28ac25[_0x8ce4('0x29')][_0x8ce4('0x78')]=_0x28ac25['channel'];_0x28ac25[_0x8ce4('0x29')][_0x8ce4('0x79')]=_0x28ac25[_0x8ce4('0x78')];_0x28ac25['message'][_0x8ce4('0x7a')]=_0x8ce4('0x5d');return respondWithRpcPromise(_0x8ce4('0x7b'),_0x8ce4('0x7b'),{'event':_0x8ce4('0x7c'),'message':_0x28ac25[_0x8ce4('0x29')]},client9002)[_0x8ce4('0x23')](function(){return _0x28ac25;});}return _0x28ac25;}return null;})[_0x8ce4('0x23')](respondWithResult(_0x678102,null))[_0x8ce4('0x54')](handleError(_0x678102,null));};var interaction_log=require(_0x8ce4('0x17'))('fax-interactions');exports[_0x8ce4('0x37')]=function(_0x59dd32,_0x11382f,_0x3333e2){var _0x85a2a3={'agent':{},'channel':_0x8ce4('0x5e')};if(_0x59dd32[_0x8ce4('0x5a')]['id']){delete _0x59dd32[_0x8ce4('0x5a')]['id'];}_0x59dd32[_0x8ce4('0x5a')][_0x8ce4('0x62')]=_0x59dd32[_0x8ce4('0x5a')][_0x8ce4('0x62')]||_0x59dd32[_0x8ce4('0x63')]['id'];_0x85a2a3[_0x8ce4('0x76')]['id']=_0x59dd32[_0x8ce4('0x5a')][_0x8ce4('0x62')];return db[_0x8ce4('0x3f')]['find']({'where':{'id':_0x59dd32[_0x8ce4('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x11382f,null))['then'](function(_0x957f7d){if(_0x957f7d){_0x85a2a3[_0x8ce4('0x29')]=_0x957f7d[_0x8ce4('0x64')]({'plain':!![]});return db['FaxInteraction'][_0x8ce4('0x59')]({'where':{'id':_0x957f7d[_0x8ce4('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x11382f,null))['then'](function(_0x509a16){if(_0x509a16){_0x85a2a3[_0x8ce4('0x68')]=_0x509a16[_0x8ce4('0x64')]({'plain':!![]});interaction_log[_0x8ce4('0x2a')](_0x8ce4('0x7e'),_0x59dd32['user']['id'],_0x59dd32['user'][_0x8ce4('0x3d')],_0x59dd32['user'][_0x8ce4('0x6a')],_0x85a2a3[_0x8ce4('0x68')]['id'],_0x59dd32[_0x8ce4('0x5a')]?JSON['stringify'](_0x59dd32['body']):'null');return respondWithRpcPromise('RejectMessage',_0x8ce4('0x7f'),_0x85a2a3);}return null;})[_0x8ce4('0x23')](function(_0x26e8c0){var _0x43fa2f=_0x8ce4('0x6c')+_0x26e8c0[_0x8ce4('0x29')]['ContactId'];return db[_0x8ce4('0x6e')][_0x8ce4('0x45')](_0x43fa2f,{'type':db[_0x8ce4('0x6f')][_0x8ce4('0x70')][_0x8ce4('0x71')],'raw':!![]})['then'](function(_0x325f39){return _0x325f39;});})['then'](function(_0x3aabbd){if(_0x3aabbd){_0x85a2a3[_0x8ce4('0x29')]['contact']=_0x3aabbd[0x0];if(!_0x59dd32[_0x8ce4('0x5a')][_0x8ce4('0x62')])return;return db['User'][_0x8ce4('0x59')]({'where':{'id':_0x59dd32[_0x8ce4('0x5a')]['UserId'],'role':_0x8ce4('0x76')},'attributes':['id','name',_0x8ce4('0x74'),_0x8ce4('0x80'),_0x8ce4('0x75')],'raw':!![]});}return null;})['then'](function(_0x3419d1){if(!_0x3419d1)return null;_0x85a2a3[_0x8ce4('0x29')][_0x8ce4('0x76')]=_0x3419d1;return _0x85a2a3;})[_0x8ce4('0x23')](function(_0x1b2e26){if(_0x1b2e26){_0x1b2e26['message']['interface']=util[_0x8ce4('0x67')]('SIP/%s',_0x59dd32[_0x8ce4('0x63')][_0x8ce4('0x3d')]);_0x1b2e26[_0x8ce4('0x29')]['channel']=_0x85a2a3['channel'];_0x1b2e26[_0x8ce4('0x29')][_0x8ce4('0x79')]=_0x85a2a3['channel'];_0x1b2e26[_0x8ce4('0x29')][_0x8ce4('0x7a')]=_0x8ce4('0x37');respondWithRpcPromise(_0x8ce4('0x7b'),_0x8ce4('0x7b'),{'event':'rejectmessage','message':_0x1b2e26[_0x8ce4('0x29')]},client9002);return _0x85a2a3;}return null;})[_0x8ce4('0x23')](respondWithResult(_0x11382f,null))[_0x8ce4('0x54')](handleError(_0x11382f,null));};exports[_0x8ce4('0x81')]=function(_0x118f49,_0x1a5480){var _0x16df0e;return db[_0x8ce4('0x3f')][_0x8ce4('0x81')](_0x118f49[_0x8ce4('0x5a')],{})[_0x8ce4('0x23')](function(_0x4caf72){_0x16df0e=_0x4caf72;return db[_0x8ce4('0x82')][_0x8ce4('0x83')]({'where':{'id':_0x16df0e[_0x8ce4('0x6d')]}});})[_0x8ce4('0x23')](function(_0x25c2c8){if(_[_0x8ce4('0x84')](_0x25c2c8)){return;}else{_0x16df0e['fax']=_0x25c2c8[_0x8ce4('0x5e')];return db['Attachment'][_0x8ce4('0x83')]({'where':{'id':_0x16df0e[_0x8ce4('0x85')]}});}})[_0x8ce4('0x23')](function(_0x440ebe){return respondWithRpcPromise(_0x8ce4('0x86'),_0x8ce4('0x86'),{'FaxAccountId':_[_0x8ce4('0x84')](_0x118f49['body'])?undefined:_0x118f49[_0x8ce4('0x5a')]['FaxAccountId'],'path':_[_0x8ce4('0x84')](_0x440ebe)?undefined:util[_0x8ce4('0x67')](_0x8ce4('0x87'),_0x440ebe['basename']),'fax':_[_0x8ce4('0x84')](_0x16df0e[_0x8ce4('0x5e')])?undefined:_0x16df0e['fax'],'AttachmentId':_0x16df0e['AttachmentId']},client9002);})['then'](respondWithResult(_0x1a5480,0xc9))[_0x8ce4('0x54')](handleError(_0x1a5480,null));};exports['download']=function(_0x33f401,_0x406d92){var _0x432d6c=path['join'](config['root'],'server','files','attachments');return db[_0x8ce4('0x3f')]['find']({'where':{'id':_0x33f401[_0x8ce4('0x56')]['id']},'include':[{'model':db['Attachment'],'as':_0x8ce4('0x88')}]})[_0x8ce4('0x23')](handleEntityNotFound(_0x406d92,null))[_0x8ce4('0x23')](function(_0xb3610a){if(_0xb3610a){return _0x406d92[_0x8ce4('0x89')](path['join'](_0x432d6c,_0xb3610a[_0x8ce4('0x88')][_0x8ce4('0x8a')]));}})[_0x8ce4('0x54')](handleError(_0x406d92,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index ab9e2de..62f8a18 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 _0x573a=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x19f60d,_0x1e2d04){var _0x21d18d=function(_0x4cdea3){while(--_0x4cdea3){_0x19f60d['push'](_0x19f60d['shift']());}};_0x21d18d(++_0x1e2d04);}(_0x573a,0x124));var _0xa573=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0x573a[_0x22bdd3];return _0x44d9d9;};'use strict';var EventEmitter=require(_0xa573('0x0'));var FaxMessage=require(_0xa573('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa573('0x2')](0x0);var events={'afterCreate':_0xa573('0x3'),'afterUpdate':_0xa573('0x4'),'afterDestroy':_0xa573('0x5')};function emitEvent(_0x19bca6){return function(_0x59a1d5,_0x41fbd3,_0x4b7f7c){FaxMessageEvents[_0xa573('0x6')](_0x19bca6+':'+_0x59a1d5['id'],_0x59a1d5);FaxMessageEvents[_0xa573('0x6')](_0x19bca6,_0x59a1d5);_0x4b7f7c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xa573('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xd5f9=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove','hook'];(function(_0xd61232,_0x3d4293){var _0x40456c=function(_0x511130){while(--_0x511130){_0xd61232['push'](_0xd61232['shift']());}};_0x40456c(++_0x3d4293);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x42bfc9,_0x92ccf5){_0x42bfc9=_0x42bfc9-0x0;var _0x645e2b=_0xd5f9[_0x42bfc9];return _0x645e2b;};'use strict';var EventEmitter=require(_0x9d5f('0x0'));var FaxMessage=require(_0x9d5f('0x1'))['db'][_0x9d5f('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9d5f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9d5f('0x4'),'afterDestroy':_0x9d5f('0x5')};function emitEvent(_0x15cf45){return function(_0x42d201,_0x216344,_0x338e53){FaxMessageEvents['emit'](_0x15cf45+':'+_0x42d201['id'],_0x42d201);FaxMessageEvents['emit'](_0x15cf45,_0x42d201);_0x338e53(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x9d5f('0x6')](e,emitEvent(event));}}module[_0x9d5f('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 06a1f90..edbbb54 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 _0xcfaf=['api','moment','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','FaxInteraction','findOne','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xcfaf,0x1b7));var _0xfcfa=function(_0x329a98,_0x29ff1e){_0x329a98=_0x329a98-0x0;var _0x12399d=_0xcfaf[_0x329a98];return _0x12399d;};'use strict';var _=require(_0xfcfa('0x0'));var util=require(_0xfcfa('0x1'));var logger=require(_0xfcfa('0x2'))(_0xfcfa('0x3'));var moment=require(_0xfcfa('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcfa('0x5'));var fs=require('fs');var path=require(_0xfcfa('0x6'));var rimraf=require('rimraf');var config=require(_0xfcfa('0x7'));var attributes=require(_0xfcfa('0x8'));module[_0xfcfa('0x9')]=function(_0x5c6cb3,_0x35993f){return _0x5c6cb3[_0xfcfa('0xa')](_0xfcfa('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0xfcfa('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21d396,_0x5296e7,_0x37257b){var _0x151cb4=_0x5c6cb3[_0xfcfa('0xd')];var _0x47b167=_0x21d396[_0xfcfa('0xe')]({'plain':!![]});if(_0x47b167['direction'][_0xfcfa('0xf')]()==='in'||_0x47b167[_0xfcfa('0x10')][_0xfcfa('0xf')]()==='out'&&!_0x47b167[_0xfcfa('0x11')]&&!_[_0xfcfa('0x12')](_0x47b167['UserId'])){_0x151cb4[_0xfcfa('0x13')][_0xfcfa('0x14')]({'where':{'id':_0x47b167['FaxInteractionId']}})['then'](function(_0x28568d){if(_0x28568d){_0x28568d['update']({'lastMsgAt':_0x47b167[_0xfcfa('0x15')],'lastMsgDirection':_0x47b167[_0xfcfa('0x10')][_0xfcfa('0xf')]()});}})[_0xfcfa('0x16')](function(_0x4f9d1e){console[_0xfcfa('0x17')](_0x4f9d1e);});}_0x37257b();}},'charset':_0xfcfa('0x18'),'collate':_0xfcfa('0x19')});}; \ No newline at end of file +var _0x953e=['get','toLowerCase','out','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','path','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages','fti_fax_messages','body','models'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x953e,0x1ae));var _0xe953=function(_0x21bbec,_0x56f7aa){_0x21bbec=_0x21bbec-0x0;var _0xbaa7af=_0x953e[_0x21bbec];return _0xbaa7af;};'use strict';var _=require('lodash');var util=require(_0xe953('0x0'));var logger=require('../../config/logger')(_0xe953('0x1'));var moment=require(_0xe953('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe953('0x3'));var rimraf=require(_0xe953('0x4'));var config=require(_0xe953('0x5'));var attributes=require(_0xe953('0x6'));module['exports']=function(_0x35f780,_0x58deae){return _0x35f780[_0xe953('0x7')]('FaxMessage',attributes,{'tableName':_0xe953('0x8'),'paranoid':![],'indexes':[{'name':_0xe953('0x9'),'fields':[_0xe953('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1af675,_0x574222,_0x20fce9){var _0x4a3cd0=_0x35f780[_0xe953('0xb')];var _0x255ab9=_0x1af675[_0xe953('0xc')]({'plain':!![]});if(_0x255ab9['direction'][_0xe953('0xd')]()==='in'||_0x255ab9['direction'][_0xe953('0xd')]()===_0xe953('0xe')&&!_0x255ab9['secret']&&!_['isNil'](_0x255ab9[_0xe953('0xf')])){_0x4a3cd0[_0xe953('0x10')][_0xe953('0x11')]({'where':{'id':_0x255ab9[_0xe953('0x12')]}})['then'](function(_0x45705c){if(_0x45705c){_0x45705c[_0xe953('0x13')]({'lastMsgAt':_0x255ab9[_0xe953('0x14')],'lastMsgDirection':_0x255ab9[_0xe953('0x15')][_0xe953('0xd')]()});}})[_0xe953('0x16')](function(_0x2d2503){console[_0xe953('0x17')](_0x2d2503);});}_0x20fce9();}},'charset':_0xe953('0x18'),'collate':_0xe953('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index fc8a781..e595df6 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 _0x70e0=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','stringify','catch','update','raw','where','limit','UpdateFaxMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x336410,_0x336763){var _0x39a54e=function(_0x48b1f1){while(--_0x48b1f1){_0x336410['push'](_0x336410['shift']());}};_0x39a54e(++_0x336763);}(_0x70e0,0x17b));var _0x070e=function(_0x16fb68,_0x5401a3){_0x16fb68=_0x16fb68-0x0;var _0x2ec5dc=_0x70e0[_0x16fb68];return _0x2ec5dc;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x070e('0x9')],{'host':_0x070e('0xa'),'port':0x18eb});var socket=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x9')]));require(_0x070e('0xc'))[_0x070e('0xd')](socket);function respondWithRpcPromise(_0x11ffa8,_0x4e99e6,_0x49b2fb){return new BPromise(function(_0x50f4eb,_0x2e3e5e){return client[_0x070e('0xe')](_0x11ffa8,_0x49b2fb)[_0x070e('0xf')](function(_0xa927a2){logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));logger[_0x070e('0x13')](_0x070e('0x14'),_0x4e99e6,_0x070e('0x12'),JSON['stringify'](_0xa927a2));if(_0xa927a2['error']){if(_0xa927a2[_0x070e('0x15')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x2e3e5e(_0xa927a2['error']['message']);}logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x50f4eb(_0xa927a2['error']['message']);}else{logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));_0x50f4eb(_0xa927a2[_0x070e('0x17')][_0x070e('0x16')]);}})['catch'](function(_0x3938b5){logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0x3938b5);_0x2e3e5e(_0x3938b5);});});}exports[_0x070e('0x18')]=function(_0x259893){var _0x5c16fd=this;return new Promise(function(_0x5b2f48,_0x4e958f){return db[_0x070e('0x19')][_0x070e('0x1a')](_0x259893[_0x070e('0x1b')],{'raw':_0x259893['options']?_0x259893[_0x070e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x070e('0xf')](function(_0x3f6985){logger[_0x070e('0x10')](_0x070e('0x18'),_0x259893);logger[_0x070e('0x13')](_0x070e('0x18'),_0x259893,JSON[_0x070e('0x1d')](_0x3f6985));_0x5b2f48(_0x3f6985);})[_0x070e('0x1e')](function(_0x595c7e){logger[_0x070e('0x15')](_0x070e('0x18'),_0x595c7e[_0x070e('0x16')],_0x259893);_0x4e958f(_0x5c16fd['error'](0x1f4,_0x595c7e[_0x070e('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x4a2dbd){var _0x2ccbd7=this;return new Promise(function(_0x25f6e,_0x41deb1){return db[_0x070e('0x19')][_0x070e('0x1f')](_0x4a2dbd['body'],{'raw':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x21')]||null:null,'attributes':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')]['attributes']||null:null,'limit':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x22')]||null:null})['then'](function(_0x5c5f0d){logger[_0x070e('0x10')](_0x070e('0x23'),_0x4a2dbd);logger[_0x070e('0x13')]('UpdateFaxMessage',_0x4a2dbd,JSON[_0x070e('0x1d')](_0x5c5f0d));_0x25f6e(_0x5c5f0d);})[_0x070e('0x1e')](function(_0x3a9425){logger[_0x070e('0x15')]('UpdateFaxMessage',_0x3a9425['message'],_0x4a2dbd);_0x41deb1(_0x2ccbd7['error'](0x1f4,_0x3a9425['message']));});});}; \ No newline at end of file +var _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x47449c,_0x3c445e){var _0x3186cc=function(_0x23828e){while(--_0x23828e){_0x47449c['push'](_0x47449c['shift']());}};_0x3186cc(++_0x3c445e);}(_0xac31,0xca));var _0x1ac3=function(_0x3d186b,_0x137e12){_0x3d186b=_0x3d186b-0x0;var _0x14554f=_0xac31[_0x3d186b];return _0x14554f;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b6456fa..9ec3e75 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 _0x6a9e=['save','remove','update','emit','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x45b044,_0x1a3000){var _0x39eed2=function(_0x2e019e){while(--_0x2e019e){_0x45b044['push'](_0x45b044['shift']());}};_0x39eed2(++_0x1a3000);}(_0x6a9e,0x194));var _0xe6a9=function(_0x56e808,_0x1c8714){_0x56e808=_0x56e808-0x0;var _0x169b8f=_0x6a9e[_0x56e808];return _0x169b8f;};'use strict';var FaxMessageEvents=require(_0xe6a9('0x0'));var events=[_0xe6a9('0x1'),_0xe6a9('0x2'),_0xe6a9('0x3')];function createListener(_0x513617,_0xe53492){return function(_0x188a6b){_0xe53492[_0xe6a9('0x4')](_0x513617,_0x188a6b);};}function removeListener(_0x4d1592,_0x2d4089){return function(){FaxMessageEvents[_0xe6a9('0x5')](_0x4d1592,_0x2d4089);};}exports[_0xe6a9('0x6')]=function(_0x51b666){for(var _0x4a7f3d=0x0,_0x142abb=events[_0xe6a9('0x7')];_0x4a7f3d<_0x142abb;_0x4a7f3d++){var _0x6fa48a=events[_0x4a7f3d];var _0x512bdc=createListener(_0xe6a9('0x8')+_0x6fa48a,_0x51b666);FaxMessageEvents['on'](_0x6fa48a,_0x512bdc);}}; \ No newline at end of file +var _0xed0b=['removeListener','faxMessage:','./faxMessage.events','save','remove'];(function(_0x2c366f,_0x1bd4f8){var _0x180634=function(_0x5dcd2c){while(--_0x5dcd2c){_0x2c366f['push'](_0x2c366f['shift']());}};_0x180634(++_0x1bd4f8);}(_0xed0b,0xb1));var _0xbed0=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0xed0b[_0x254b22];return _0x1279db;};'use strict';var FaxMessageEvents=require(_0xbed0('0x0'));var events=[_0xbed0('0x1'),_0xbed0('0x2'),'update'];function createListener(_0x38e015,_0x43a15){return function(_0xbaa4d1){_0x43a15['emit'](_0x38e015,_0xbaa4d1);};}function removeListener(_0x56bf32,_0x267a90){return function(){FaxMessageEvents[_0xbed0('0x3')](_0x56bf32,_0x267a90);};}exports['register']=function(_0x1d390d){for(var _0x5e3422=0x0,_0x2feb26=events['length'];_0x5e3422<_0x2feb26;_0x5e3422++){var _0x2aa678=events[_0x5e3422];var _0x510e81=createListener(_0xbed0('0x4')+_0x2aa678,_0x1d390d);FaxMessageEvents['on'](_0x2aa678,_0x510e81);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d3bca75..87bf645 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 _0x91a7=['isAuthenticated','/:id','show','download','tracked','fax','faxmessage:create','create','put','update','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','./faxMessage.controller','get','index','/describe'];(function(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0x91a7,0xe7));var _0x791a=function(_0x317576,_0x3eb5ac){_0x317576=_0x317576-0x0;var _0x119760=_0x91a7[_0x317576];return _0x119760;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/download',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['post']('/',auth[_0x791a('0x9')](),interaction[_0x791a('0xd')](_0x791a('0xe'),_0x791a('0xf')),controller[_0x791a('0x10')]);router[_0x791a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x791a('0x12')]);router[_0x791a('0x11')]('/:id/accept',auth[_0x791a('0x9')](),controller[_0x791a('0x13')]);router['put'](_0x791a('0x14'),auth[_0x791a('0x9')](),controller[_0x791a('0x15')]);router[_0x791a('0x16')]('/:id',auth[_0x791a('0x9')](),controller['destroy']);module[_0x791a('0x17')]=router; \ No newline at end of file +var _0x4e81=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','download','post','tracked','fax','faxmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','fs-extra'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x4e81,0x1bc));var _0x14e8=function(_0x587693,_0x27fe90){_0x587693=_0x587693-0x0;var _0x510a1a=_0x4e81[_0x587693];return _0x510a1a;};'use strict';var multer=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x14e8('0x3'));var auth=require(_0x14e8('0x4'));var interaction=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var controller=require(_0x14e8('0x7'));router[_0x14e8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14e8('0x8')](_0x14e8('0x9'),auth[_0x14e8('0xa')](),controller[_0x14e8('0xb')]);router[_0x14e8('0x8')](_0x14e8('0xc'),auth[_0x14e8('0xa')](),controller[_0x14e8('0xd')]);router[_0x14e8('0x8')]('/:id/download',auth[_0x14e8('0xa')](),controller[_0x14e8('0xe')]);router[_0x14e8('0xf')]('/',auth[_0x14e8('0xa')](),interaction[_0x14e8('0x10')](_0x14e8('0x11'),_0x14e8('0x12')),controller[_0x14e8('0x13')]);router['put'](_0x14e8('0xc'),auth['isAuthenticated'](),controller[_0x14e8('0x14')]);router[_0x14e8('0x15')](_0x14e8('0x16'),auth['isAuthenticated'](),controller[_0x14e8('0x17')]);router['put'](_0x14e8('0x18'),auth['isAuthenticated'](),controller[_0x14e8('0x19')]);router[_0x14e8('0x1a')](_0x14e8('0xc'),auth[_0x14e8('0xa')](),controller['destroy']);module[_0x14e8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index c1fd0e9..d2df581 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 _0x5776=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x5897c3,_0x5a134b){var _0xd180a6=function(_0x19fc65){while(--_0x19fc65){_0x5897c3['push'](_0x5897c3['shift']());}};_0xd180a6(++_0x5a134b);}(_0x5776,0x17d));var _0x6577=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5776[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x6577('0x0'));module[_0x6577('0x1')]={'name':{'type':Sequelize[_0x6577('0x2')],'unique':_0x6577('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6577('0x2')]},'timeout':{'type':Sequelize[_0x6577('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6577('0x5')](_0x6577('0x6'),_0x6577('0x7'),_0x6577('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6577('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xae32=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x2ac25e,_0x2c8fe9){var _0x5c56f0=function(_0x574dc2){while(--_0x574dc2){_0x2ac25e['push'](_0x2ac25e['shift']());}};_0x5c56f0(++_0x2c8fe9);}(_0xae32,0x157));var _0x2ae3=function(_0x111b6e,_0x2b4b0c){_0x111b6e=_0x111b6e-0x0;var _0x3ab48d=_0xae32[_0x111b6e];return _0x3ab48d;};'use strict';var Sequelize=require(_0x2ae3('0x0'));module[_0x2ae3('0x1')]={'name':{'type':Sequelize[_0x2ae3('0x2')],'unique':_0x2ae3('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2ae3('0x2')]},'timeout':{'type':Sequelize[_0x2ae3('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2ae3('0x5')](_0x2ae3('0x6'),_0x2ae3('0x7'),_0x2ae3('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2ae3('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 5483640..3a8ce35 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 _0xdcd0=['FaxQueueId','UserFaxQueue','findAll','User','UserId','agent','faxPause','updatedAt','format','%s/%s','getTeams','addTeams','ids','Team','Agents','voicePause','flatMap','sequelize','each','findOrCreate','forEach','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','emit','userFaxQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','FaxQueues','UserProfileResource','sendStatus','stack','name','send','map','FaxQueue','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','nolimit'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xdcd0,0x1cf));var _0x0dcd=function(_0x2f3d14,_0x20a3eb){_0x2f3d14=_0x2f3d14-0x0;var _0x1c571b=_0xdcd0[_0x2f3d14];return _0x1c571b;};'use strict';var emlformat=require(_0x0dcd('0x0'));var rimraf=require(_0x0dcd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0dcd('0x2'));var rp=require('request-promise');var moment=require(_0x0dcd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0dcd('0x4'));var path=require(_0x0dcd('0x5'));var sox=require(_0x0dcd('0x6'));var csv=require(_0x0dcd('0x7'));var ejs=require(_0x0dcd('0x8'));var fs=require('fs');var fs_extra=require(_0x0dcd('0x9'));var _=require(_0x0dcd('0xa'));var squel=require(_0x0dcd('0xb'));var crypto=require(_0x0dcd('0xc'));var jsforce=require(_0x0dcd('0xd'));var deskjs=require(_0x0dcd('0xe'));var toCsv=require(_0x0dcd('0x7'));var querystring=require(_0x0dcd('0xf'));var Papa=require(_0x0dcd('0x10'));var Redis=require(_0x0dcd('0x11'));var authService=require(_0x0dcd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0dcd('0x13'));var hardwareService=require(_0x0dcd('0x14'));var logger=require(_0x0dcd('0x15'))(_0x0dcd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0dcd('0x17'))['db'];config[_0x0dcd('0x18')]=_[_0x0dcd('0x19')](config[_0x0dcd('0x18')],{'host':_0x0dcd('0x1a'),'port':0x18eb});var socket=require(_0x0dcd('0x1b'))(new Redis(config[_0x0dcd('0x18')]));require(_0x0dcd('0x1c'))['register'](socket);function respondWithStatusCode(_0x54c12e,_0x2985cc){_0x2985cc=_0x2985cc||0xcc;return function(_0x3440eb){if(_0x3440eb){return _0x54c12e['sendStatus'](_0x2985cc);}return _0x54c12e['status'](_0x2985cc)[_0x0dcd('0x1d')]();};}function respondWithResult(_0x5e5c13,_0x5c2064){_0x5c2064=_0x5c2064||0xc8;return function(_0x201b5b){if(_0x201b5b){return _0x5e5c13[_0x0dcd('0x1e')](_0x5c2064)[_0x0dcd('0x1f')](_0x201b5b);}};}function respondWithFilteredResult(_0x406375,_0x226cd0){return function(_0x450089){if(_0x450089){var _0x17c6d7=typeof _0x226cd0[_0x0dcd('0x20')]===_0x0dcd('0x21')&&typeof _0x226cd0[_0x0dcd('0x22')]==='undefined';var _0x1c8a93=_0x450089[_0x0dcd('0x23')];var _0x2d46e4=_0x17c6d7?0x0:_0x226cd0[_0x0dcd('0x20')];var _0x1c729d=_0x17c6d7?_0x450089[_0x0dcd('0x23')]:_0x226cd0[_0x0dcd('0x20')]+_0x226cd0['limit'];var _0x39e337;if(_0x1c729d>=_0x1c8a93){_0x1c729d=_0x1c8a93;_0x39e337=0xc8;}else{_0x39e337=0xce;}_0x406375[_0x0dcd('0x1e')](_0x39e337);return _0x406375[_0x0dcd('0x24')](_0x0dcd('0x25'),_0x2d46e4+'-'+_0x1c729d+'/'+_0x1c8a93)[_0x0dcd('0x1f')](_0x450089);}return null;};}function patchUpdates(_0x4388f1){return function(_0x11f94b){try{jsonpatch['apply'](_0x11f94b,_0x4388f1,!![]);}catch(_0x1d9bcb){return BPromise[_0x0dcd('0x26')](_0x1d9bcb);}return _0x11f94b[_0x0dcd('0x27')]();};}function saveUpdates(_0x4fd6e4,_0x4c883f){return function(_0x45bb35){if(_0x45bb35){return _0x45bb35[_0x0dcd('0x28')](_0x4fd6e4)[_0x0dcd('0x29')](function(_0x514ca1){return _0x514ca1;});}return null;};}function removeEntity(_0x1da03c,_0x5e3811){return function(_0x23f2c0){if(_0x23f2c0){return _0x23f2c0[_0x0dcd('0x2a')]()[_0x0dcd('0x29')](function(){var _0x3481d1=_0x23f2c0['get']({'plain':!![]});var _0x4b2f0b=_0x0dcd('0x2b');return db[_0x0dcd('0x2c')]['destroy']({'where':{'type':_0x4b2f0b,'resourceId':_0x3481d1['id']}})[_0x0dcd('0x29')](function(){return _0x23f2c0;});})[_0x0dcd('0x29')](function(){_0x1da03c[_0x0dcd('0x1e')](0xcc)[_0x0dcd('0x1d')]();});}};}function handleEntityNotFound(_0x342549,_0xa78c3d){return function(_0x5666eb){if(!_0x5666eb){_0x342549[_0x0dcd('0x2d')](0x194);}return _0x5666eb;};}function handleError(_0x2b022d,_0x32e993){_0x32e993=_0x32e993||0x1f4;return function(_0x38bb38){logger['error'](_0x38bb38[_0x0dcd('0x2e')]);if(_0x38bb38['name']){delete _0x38bb38[_0x0dcd('0x2f')];}_0x2b022d[_0x0dcd('0x1e')](_0x32e993)[_0x0dcd('0x30')](_0x38bb38);};}exports['index']=function(_0x913391,_0xb46685){var _0x2f5e08={},_0x102dd5={},_0x2087b2={'count':0x0,'rows':[]};var _0x4ffb76=_[_0x0dcd('0x31')](db[_0x0dcd('0x32')][_0x0dcd('0x33')],function(_0x6b48e6){return{'name':_0x6b48e6['fieldName'],'type':_0x6b48e6[_0x0dcd('0x34')][_0x0dcd('0x35')]};});_0x102dd5[_0x0dcd('0x36')]=_[_0x0dcd('0x31')](_0x4ffb76,_0x0dcd('0x2f'));_0x102dd5[_0x0dcd('0x37')]=_[_0x0dcd('0x38')](_0x913391[_0x0dcd('0x37')]);_0x102dd5[_0x0dcd('0x39')]=_['intersection'](_0x102dd5[_0x0dcd('0x36')],_0x102dd5[_0x0dcd('0x37')]);_0x2f5e08[_0x0dcd('0x3a')]=_[_0x0dcd('0x3b')](_0x102dd5[_0x0dcd('0x36')],qs['fields'](_0x913391[_0x0dcd('0x37')][_0x0dcd('0x3c')]));_0x2f5e08[_0x0dcd('0x3a')]=_0x2f5e08[_0x0dcd('0x3a')]['length']?_0x2f5e08['attributes']:_0x102dd5[_0x0dcd('0x36')];if(!_0x913391['query']['hasOwnProperty']('nolimit')){_0x2f5e08[_0x0dcd('0x22')]=qs[_0x0dcd('0x22')](_0x913391['query'][_0x0dcd('0x22')]);_0x2f5e08['offset']=qs[_0x0dcd('0x20')](_0x913391[_0x0dcd('0x37')]['offset']);}_0x2f5e08[_0x0dcd('0x3d')]=qs[_0x0dcd('0x3e')](_0x913391[_0x0dcd('0x37')][_0x0dcd('0x3e')]);_0x2f5e08[_0x0dcd('0x3f')]=qs[_0x0dcd('0x39')](_[_0x0dcd('0x40')](_0x913391['query'],_0x102dd5[_0x0dcd('0x39')]),_0x4ffb76);if(_0x913391[_0x0dcd('0x37')][_0x0dcd('0x41')]){_0x2f5e08[_0x0dcd('0x3f')]=_[_0x0dcd('0x42')](_0x2f5e08['where'],{'$or':_[_0x0dcd('0x31')](_0x4ffb76,function(_0x3d476d){if(_0x3d476d['type']!==_0x0dcd('0x43')){var _0x3a73bc={};_0x3a73bc[_0x3d476d[_0x0dcd('0x2f')]]={'$like':'%'+_0x913391['query'][_0x0dcd('0x41')]+'%'};return _0x3a73bc;}})});}_0x2f5e08=_[_0x0dcd('0x42')]({},_0x2f5e08,_0x913391[_0x0dcd('0x44')]);var _0x9a92d8={'where':_0x2f5e08[_0x0dcd('0x3f')]};return db[_0x0dcd('0x32')][_0x0dcd('0x23')](_0x9a92d8)['then'](function(_0x47c17b){_0x2087b2[_0x0dcd('0x23')]=_0x47c17b;if(_0x913391[_0x0dcd('0x37')]['includeAll']){_0x2f5e08[_0x0dcd('0x45')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x2f5e08);})[_0x0dcd('0x29')](function(_0x30f48f){_0x2087b2[_0x0dcd('0x46')]=_0x30f48f;return _0x2087b2;})['then'](respondWithFilteredResult(_0xb46685,_0x2f5e08))['catch'](handleError(_0xb46685,null));};exports[_0x0dcd('0x47')]=function(_0x293b01,_0x4daaa5){var _0x2e7d93={'raw':!![],'where':{'id':_0x293b01[_0x0dcd('0x48')]['id']}},_0x358f1e={};_0x358f1e['model']=_['keys'](db[_0x0dcd('0x32')]['rawAttributes']);_0x358f1e[_0x0dcd('0x37')]=_[_0x0dcd('0x38')](_0x293b01[_0x0dcd('0x37')]);_0x358f1e[_0x0dcd('0x39')]=_[_0x0dcd('0x3b')](_0x358f1e['model'],_0x358f1e[_0x0dcd('0x37')]);_0x2e7d93[_0x0dcd('0x3a')]=_[_0x0dcd('0x3b')](_0x358f1e[_0x0dcd('0x36')],qs[_0x0dcd('0x3c')](_0x293b01[_0x0dcd('0x37')]['fields']));_0x2e7d93[_0x0dcd('0x3a')]=_0x2e7d93[_0x0dcd('0x3a')][_0x0dcd('0x49')]?_0x2e7d93['attributes']:_0x358f1e['model'];if(_0x293b01['query'][_0x0dcd('0x4a')]){_0x2e7d93[_0x0dcd('0x45')]=[{'all':!![]}];}_0x2e7d93=_[_0x0dcd('0x42')]({},_0x2e7d93,_0x293b01['options']);return db[_0x0dcd('0x32')][_0x0dcd('0x4b')](_0x2e7d93)['then'](handleEntityNotFound(_0x4daaa5,null))[_0x0dcd('0x29')](respondWithResult(_0x4daaa5,null))['catch'](handleError(_0x4daaa5,null));};exports[_0x0dcd('0x4c')]=function(_0xd9e3bc,_0x517da0){return db[_0x0dcd('0x32')][_0x0dcd('0x4c')](_0xd9e3bc[_0x0dcd('0x4d')],{})[_0x0dcd('0x29')](function(_0x357394){var _0x2f929e=_0xd9e3bc['user'][_0x0dcd('0x4e')]({'plain':!![]});if(!_0x2f929e)throw new Error(_0x0dcd('0x4f'));if(_0x2f929e['role']===_0x0dcd('0x50')){var _0x14364c=_0x357394[_0x0dcd('0x4e')]({'plain':!![]});var _0x3b8dba='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x3b8dba,'userProfileId':_0x2f929e[_0x0dcd('0x51')]},'raw':!![]})[_0x0dcd('0x29')](function(_0x50ae84){if(_0x50ae84&&_0x50ae84['autoAssociation']===0x0){return db['UserProfileResource'][_0x0dcd('0x4c')]({'name':_0x14364c[_0x0dcd('0x2f')],'resourceId':_0x14364c['id'],'type':_0x50ae84[_0x0dcd('0x2f')],'sectionId':_0x50ae84['id']},{})[_0x0dcd('0x29')](function(){return _0x357394;});}else{return _0x357394;}})[_0x0dcd('0x52')](function(_0x2e0295){logger['error'](_0x0dcd('0x53'),_0x2e0295);throw _0x2e0295;});}return _0x357394;})[_0x0dcd('0x29')](respondWithResult(_0x517da0,0xc9))['catch'](handleError(_0x517da0,null));};exports[_0x0dcd('0x28')]=function(_0x5c8692,_0x1252f4){if(_0x5c8692[_0x0dcd('0x4d')]['id']){delete _0x5c8692['body']['id'];}return db['FaxQueue'][_0x0dcd('0x4b')]({'where':{'id':_0x5c8692['params']['id']}})[_0x0dcd('0x29')](handleEntityNotFound(_0x1252f4,null))[_0x0dcd('0x29')](saveUpdates(_0x5c8692[_0x0dcd('0x4d')],null))[_0x0dcd('0x29')](respondWithResult(_0x1252f4,null))['catch'](handleError(_0x1252f4,null));};exports[_0x0dcd('0x2a')]=function(_0x7e377a,_0x32b760){return db[_0x0dcd('0x32')][_0x0dcd('0x4b')]({'where':{'id':_0x7e377a[_0x0dcd('0x48')]['id']}})['then'](handleEntityNotFound(_0x32b760,null))[_0x0dcd('0x29')](removeEntity(_0x32b760,null))['catch'](handleError(_0x32b760,null));};exports[_0x0dcd('0x54')]=function(_0x17c356,_0x1531c9){return db[_0x0dcd('0x32')]['describe']()['then'](respondWithResult(_0x1531c9,null))[_0x0dcd('0x52')](handleError(_0x1531c9,null));};exports[_0x0dcd('0x55')]=function(_0xdaee04,_0xbda67a,_0x33aa6c){var _0x577997={'raw':!![],'where':{}},_0x33a29b={},_0x14cbc0;return db[_0x0dcd('0x32')][_0x0dcd('0x56')]({'where':{'id':_0xdaee04[_0x0dcd('0x48')]['id']}})[_0x0dcd('0x29')](handleEntityNotFound(_0xbda67a,null))[_0x0dcd('0x29')](function(_0xaa964a){if(_0xaa964a){_0x14cbc0=_0xaa964a['get']({'plain':!![]});_0x33a29b[_0x0dcd('0x36')]=_['keys'](db['UserFaxQueue']['rawAttributes']);_0x33a29b[_0x0dcd('0x37')]=_[_0x0dcd('0x38')](_0xdaee04[_0x0dcd('0x37')]);_0x33a29b['filters']=_['intersection'](_0x33a29b[_0x0dcd('0x36')],_0x33a29b[_0x0dcd('0x37')]);_0x577997[_0x0dcd('0x3a')]=_[_0x0dcd('0x3b')](_0x33a29b[_0x0dcd('0x36')],qs[_0x0dcd('0x3c')](_0xdaee04[_0x0dcd('0x37')][_0x0dcd('0x3c')]));_0x577997[_0x0dcd('0x3a')]=_0x577997['attributes'][_0x0dcd('0x49')]?_0x577997[_0x0dcd('0x3a')]:_0x33a29b['model'];if(!_0xdaee04['query'][_0x0dcd('0x57')](_0x0dcd('0x58'))){_0x577997[_0x0dcd('0x22')]=qs[_0x0dcd('0x22')](_0xdaee04[_0x0dcd('0x37')]['limit']);_0x577997['offset']=qs[_0x0dcd('0x20')](_0xdaee04[_0x0dcd('0x37')][_0x0dcd('0x20')]);}_0x577997[_0x0dcd('0x3d')]=qs[_0x0dcd('0x3e')](_0xdaee04[_0x0dcd('0x37')][_0x0dcd('0x3e')]);_0x577997[_0x0dcd('0x3f')]=qs[_0x0dcd('0x39')](_['pick'](_0xdaee04[_0x0dcd('0x37')],_0x33a29b[_0x0dcd('0x39')]));_0x577997['where'][_0x0dcd('0x59')]=_0xaa964a['id'];if(_0xdaee04[_0x0dcd('0x37')][_0x0dcd('0x41')]){_0x577997['where']=_[_0x0dcd('0x42')](_0x577997['where'],{'$or':_[_0x0dcd('0x31')](_0x577997[_0x0dcd('0x3a')],function(_0x1ff075){var _0x4a11b1={};_0x4a11b1[_0x1ff075]={'$like':'%'+_0xdaee04['query'][_0x0dcd('0x41')]+'%'};return _0x4a11b1;})});}_0x577997=_[_0x0dcd('0x42')]({},_0x577997,_0xdaee04['options']);return db[_0x0dcd('0x5a')][_0x0dcd('0x5b')](_0x577997);}})[_0x0dcd('0x29')](function(_0x1c6846){if(_0x1c6846){return db[_0x0dcd('0x5c')]['findAndCountAll']({'where':{'id':_[_0x0dcd('0x31')](_0x1c6846,_0x0dcd('0x5d')),'role':_0x0dcd('0x5e')},'attributes':['id','name',_0x0dcd('0x5f'),_0x0dcd('0x60'),'createdAt']});}})[_0x0dcd('0x29')](function(_0x102720){if(_0x102720){return{'count':_0x102720[_0x0dcd('0x23')],'rows':_[_0x0dcd('0x31')](_0x102720[_0x0dcd('0x46')],function(_0x51fb3a){return{'membername':_0x51fb3a[_0x0dcd('0x2f')],'UserId':_0x51fb3a['id'],'queue_name':_0x14cbc0[_0x0dcd('0x2f')],'FaxQueueId':_0x14cbc0['id'],'interface':util[_0x0dcd('0x61')](_0x0dcd('0x62'),'SIP',_0x51fb3a[_0x0dcd('0x2f')]),'penalty':0x0,'paused':_0x51fb3a[_0x0dcd('0x5f')],'createdAt':_0x51fb3a['createdAt'],'updatedAt':_0x51fb3a[_0x0dcd('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0dcd('0x29')](respondWithFilteredResult(_0xbda67a,_0x577997))['catch'](handleError(_0xbda67a,null));};exports[_0x0dcd('0x63')]=function(_0x541248,_0x2d02de,_0x35b15c){var _0x2b113b={};var _0x3d9061={};var _0x25ec78;var _0x473f15;return db['FaxQueue'][_0x0dcd('0x56')]({'where':{'id':_0x541248[_0x0dcd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d02de,null))[_0x0dcd('0x29')](function(_0x15a87e){if(_0x15a87e){_0x25ec78=_0x15a87e;_0x3d9061[_0x0dcd('0x36')]=_[_0x0dcd('0x38')](db['Team'][_0x0dcd('0x33')]);_0x3d9061['query']=_['keys'](_0x541248['query']);_0x3d9061[_0x0dcd('0x39')]=_[_0x0dcd('0x3b')](_0x3d9061[_0x0dcd('0x36')],_0x3d9061[_0x0dcd('0x37')]);_0x2b113b['attributes']=_[_0x0dcd('0x3b')](_0x3d9061[_0x0dcd('0x36')],qs[_0x0dcd('0x3c')](_0x541248[_0x0dcd('0x37')][_0x0dcd('0x3c')]));_0x2b113b['attributes']=_0x2b113b[_0x0dcd('0x3a')]['length']?_0x2b113b[_0x0dcd('0x3a')]:_0x3d9061[_0x0dcd('0x36')];_0x2b113b[_0x0dcd('0x3d')]=qs['sort'](_0x541248['query'][_0x0dcd('0x3e')]);_0x2b113b[_0x0dcd('0x3f')]=qs[_0x0dcd('0x39')](_[_0x0dcd('0x40')](_0x541248['query'],_0x3d9061['filters']));if(_0x541248[_0x0dcd('0x37')][_0x0dcd('0x41')]){_0x2b113b[_0x0dcd('0x3f')]=_[_0x0dcd('0x42')](_0x2b113b[_0x0dcd('0x3f')],{'$or':_[_0x0dcd('0x31')](_0x2b113b['attributes'],function(_0x5dbdda){var _0x4b19da={};_0x4b19da[_0x5dbdda]={'$like':'%'+_0x541248[_0x0dcd('0x37')][_0x0dcd('0x41')]+'%'};return _0x4b19da;})});}_0x2b113b=_[_0x0dcd('0x42')]({},_0x2b113b,_0x541248[_0x0dcd('0x44')]);return _0x25ec78['getTeams'](_0x2b113b);}})['then'](function(_0x52c972){if(_0x52c972){_0x473f15=_0x52c972['length'];if(!_0x541248['query'][_0x0dcd('0x57')](_0x0dcd('0x58'))){_0x2b113b[_0x0dcd('0x22')]=qs[_0x0dcd('0x22')](_0x541248['query'][_0x0dcd('0x22')]);_0x2b113b[_0x0dcd('0x20')]=qs[_0x0dcd('0x20')](_0x541248[_0x0dcd('0x37')][_0x0dcd('0x20')]);}return _0x25ec78[_0x0dcd('0x63')](_0x2b113b);}})['then'](function(_0x5f032d){if(_0x5f032d){return _0x5f032d?{'count':_0x473f15,'rows':_0x5f032d}:null;}})[_0x0dcd('0x29')](respondWithResult(_0x2d02de,null))['catch'](handleError(_0x2d02de,null));};exports[_0x0dcd('0x64')]=function(_0x5b3e93,_0x2816e3,_0x333165){var _0x4af763=_0x5b3e93[_0x0dcd('0x4d')][_0x0dcd('0x65')];return db[_0x0dcd('0x66')][_0x0dcd('0x5b')]({'where':{'id':_0x4af763},'attributes':['id'],'include':[{'model':db[_0x0dcd('0x5c')],'as':_0x0dcd('0x67'),'attributes':['id','name','online',_0x0dcd('0x68'),'interface'],'raw':!![]}]})[_0x0dcd('0x29')](function(_0x403502){if(_0x403502){var _0x5f0959=_[_0x0dcd('0x69')](_0x403502,function(_0x4985f8){var _0xbdbce7=_0x4985f8['get']({'plain':!![]});return _0xbdbce7[_0x0dcd('0x67')];});return db[_0x0dcd('0x32')][_0x0dcd('0x4b')]({'where':{'id':_0x5b3e93['params']['id']}})['then'](function(_0x173def){return db[_0x0dcd('0x6a')]['transaction'](function(_0x59342f){return _0x173def['addTeams'](_0x4af763,{'transaction':_0x59342f})[_0x0dcd('0x29')](function(){return BPromise[_0x0dcd('0x6b')](_0x5f0959,function(_0x4369a4){return db['UserFaxQueue'][_0x0dcd('0x6c')]({'where':{'UserId':_0x4369a4['id'],'FaxQueueId':_0x5b3e93['params']['id']},'transaction':_0x59342f});});})['then'](function(){_0x5f0959[_0x0dcd('0x6d')](function(_0x4dcb09){socket['emit'](_0x0dcd('0x6e'),{'UserId':_0x4dcb09['id'],'FaxQueueId':_0x173def['id']});});});});});}})[_0x0dcd('0x29')](respondWithStatusCode(_0x2816e3,null))[_0x0dcd('0x52')](handleError(_0x2816e3,null));};exports['removeTeams']=function(_0x5373f7,_0x537f49,_0x385ed3){return db[_0x0dcd('0x66')]['findAll']({'where':{'id':_0x5373f7[_0x0dcd('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0dcd('0x5c')],'as':_0x0dcd('0x67'),'attributes':['id'],'raw':!![]}]})[_0x0dcd('0x29')](handleEntityNotFound(_0x537f49,null))[_0x0dcd('0x29')](function(_0x229456){var _0x15f87d=_[_0x0dcd('0x31')](_0x229456,'id');var _0x5a1f2c=[];var _0x52fb20=[];var _0x27bb35=squel[_0x0dcd('0x6f')]();_0x27bb35[_0x0dcd('0x70')](_0x0dcd('0x71'))[_0x0dcd('0x72')](_0x0dcd('0x73'),'tq')[_0x0dcd('0x74')](_0x0dcd('0x75'),'ut',_0x0dcd('0x76'))[_0x0dcd('0x3f')]('FaxQueueId\x20=\x20?',_0x5373f7[_0x0dcd('0x48')]['id']);for(var _0x18d381=0x0;_0x18d381<_0x229456[_0x0dcd('0x49')];_0x18d381+=0x1){let _0x59fdff=_0x229456[_0x18d381];for(var _0x1268b5=0x0;_0x1268b5<_0x59fdff[_0x0dcd('0x67')]['length'];_0x1268b5+=0x1){let _0x5d1add=_0x59fdff[_0x0dcd('0x67')][_0x1268b5];var _0x1254e7=_0x27bb35['clone']();_0x1254e7[_0x0dcd('0x3f')](_0x0dcd('0x77'),_0x5d1add['id']);_0x52fb20[_0x0dcd('0x78')](db[_0x0dcd('0x6a')][_0x0dcd('0x37')](_0x1254e7[_0x0dcd('0x79')](),{'type':db[_0x0dcd('0x6a')][_0x0dcd('0x7a')]['SELECT']})[_0x0dcd('0x29')](function(_0x5f0356){if(_0x5f0356[_0x0dcd('0x49')]===0x1){return _0x5d1add['id'];}else{var _0x5c6a44=_[_0x0dcd('0x7b')](_[_0x0dcd('0x31')](_0x5f0356,_0x0dcd('0x7c')),function(_0x45111f){return _[_0x0dcd('0x7d')](_0x15f87d,_0x45111f);});if(_0x5c6a44){return _0x5d1add['id'];}}}));}}return BPromise[_0x0dcd('0x7e')](_0x52fb20)['then'](function(_0x1276d2){_0x5a1f2c=_(_0x5a1f2c)[_0x0dcd('0x7f')](_0x1276d2)[_0x0dcd('0x80')]()[_0x0dcd('0x81')]();return db[_0x0dcd('0x32')]['find']({'where':{'id':_0x5373f7[_0x0dcd('0x48')]['id']}})[_0x0dcd('0x29')](function(_0x3ae3c2){return db[_0x0dcd('0x6a')]['transaction'](function(_0x1191c3){return _0x3ae3c2[_0x0dcd('0x82')](_0x5373f7[_0x0dcd('0x37')][_0x0dcd('0x65')],{'transaction':_0x1191c3})[_0x0dcd('0x29')](function(){if(!_['isEmpty'](_0x5a1f2c)){return _0x3ae3c2['removeAgents'](_0x5a1f2c,{'transaction':_0x1191c3});}})[_0x0dcd('0x29')](function(){_0x5a1f2c[_0x0dcd('0x6d')](function(_0x48edd5){socket[_0x0dcd('0x83')](_0x0dcd('0x84'),{'UserId':_0x48edd5,'FaxQueueId':_0x3ae3c2['id']});});});});});});})['then'](respondWithStatusCode(_0x537f49,null))['catch'](handleError(_0x537f49,null));};exports[_0x0dcd('0x85')]=function(_0x573073,_0x54baed,_0x319f27){return db['FaxQueue']['find']({'where':{'id':_0x573073[_0x0dcd('0x48')]['id']}})[_0x0dcd('0x29')](handleEntityNotFound(_0x54baed,null))[_0x0dcd('0x29')](function(_0x213a77){if(_0x213a77){return _0x213a77[_0x0dcd('0x85')](_0x573073[_0x0dcd('0x4d')][_0x0dcd('0x65')],_['omit'](_0x573073[_0x0dcd('0x4d')],[_0x0dcd('0x65'),'id'])||{})[_0x0dcd('0x86')](function(_0x6a9382){for(var _0x13ed2d=0x0;_0x13ed2d<_0x573073['body'][_0x0dcd('0x65')][_0x0dcd('0x49')];_0x13ed2d+=0x1){socket[_0x0dcd('0x83')]('userFaxQueue:save',{'UserId':Number(_0x573073[_0x0dcd('0x4d')][_0x0dcd('0x65')][_0x13ed2d]),'FaxQueueId':Number(_0x573073[_0x0dcd('0x48')]['id'])});}return _0x6a9382;});}})[_0x0dcd('0x29')](respondWithResult(_0x54baed,null))['catch'](handleError(_0x54baed,null));};exports[_0x0dcd('0x87')]=function(_0x276d3f,_0x401886,_0x112c88){return db[_0x0dcd('0x32')][_0x0dcd('0x4b')]({'where':{'id':_0x276d3f[_0x0dcd('0x48')]['id']}})[_0x0dcd('0x29')](handleEntityNotFound(_0x401886,null))[_0x0dcd('0x29')](function(_0x234d53){if(_0x234d53){return _0x234d53[_0x0dcd('0x87')](_0x276d3f[_0x0dcd('0x37')]['ids'])[_0x0dcd('0x29')](function(){if(_[_0x0dcd('0x88')](_0x276d3f['query'][_0x0dcd('0x65')])){for(var _0x4d6e4e=0x0;_0x4d6e4e<_0x276d3f[_0x0dcd('0x37')][_0x0dcd('0x65')][_0x0dcd('0x49')];_0x4d6e4e+=0x1){socket[_0x0dcd('0x83')](_0x0dcd('0x84'),{'UserId':Number(_0x276d3f['query'][_0x0dcd('0x65')][_0x4d6e4e]),'FaxQueueId':Number(_0x276d3f['params']['id'])});}}else{socket[_0x0dcd('0x83')](_0x0dcd('0x84'),{'UserId':Number(_0x276d3f[_0x0dcd('0x37')][_0x0dcd('0x65')]),'FaxQueueId':Number(_0x276d3f[_0x0dcd('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x401886,null))[_0x0dcd('0x52')](handleError(_0x401886,null));};exports[_0x0dcd('0x89')]=function(_0x252961,_0x14b662,_0x2bd52c){var _0x5b1a4d={};var _0x28d041={};var _0x2e9432;var _0x544f1b;return db['FaxQueue'][_0x0dcd('0x56')]({'where':{'id':_0x252961[_0x0dcd('0x48')]['id']}})[_0x0dcd('0x29')](handleEntityNotFound(_0x14b662,null))[_0x0dcd('0x29')](function(_0x215126){if(_0x215126){_0x2e9432=_0x215126;_0x28d041[_0x0dcd('0x36')]=_[_0x0dcd('0x38')](db[_0x0dcd('0x5c')][_0x0dcd('0x33')]);_0x28d041['query']=_[_0x0dcd('0x38')](_0x252961[_0x0dcd('0x37')]);_0x28d041['filters']=_['intersection'](_0x28d041[_0x0dcd('0x36')],_0x28d041[_0x0dcd('0x37')]);_0x5b1a4d[_0x0dcd('0x3a')]=_[_0x0dcd('0x3b')](_0x28d041[_0x0dcd('0x36')],qs[_0x0dcd('0x3c')](_0x252961[_0x0dcd('0x37')]['fields']));_0x5b1a4d[_0x0dcd('0x3a')]=_0x5b1a4d[_0x0dcd('0x3a')]['length']?_0x5b1a4d[_0x0dcd('0x3a')]:_0x28d041[_0x0dcd('0x36')];_0x5b1a4d['order']=qs[_0x0dcd('0x3e')](_0x252961['query'][_0x0dcd('0x3e')]);_0x5b1a4d['where']=qs[_0x0dcd('0x39')](_[_0x0dcd('0x40')](_0x252961[_0x0dcd('0x37')],_0x28d041[_0x0dcd('0x39')]));if(_0x252961[_0x0dcd('0x37')]['filter']){_0x5b1a4d[_0x0dcd('0x3f')]=_['merge'](_0x5b1a4d[_0x0dcd('0x3f')],{'$or':_['map'](_0x5b1a4d[_0x0dcd('0x3a')],function(_0x37d564){var _0x2ac08b={};_0x2ac08b[_0x37d564]={'$like':'%'+_0x252961[_0x0dcd('0x37')][_0x0dcd('0x41')]+'%'};return _0x2ac08b;})});}_0x5b1a4d=_['merge']({},_0x5b1a4d,_0x252961[_0x0dcd('0x44')]);return _0x2e9432[_0x0dcd('0x89')](_0x5b1a4d);}})[_0x0dcd('0x29')](function(_0x39eda0){if(_0x39eda0){_0x544f1b=_0x39eda0['length'];if(!_0x252961[_0x0dcd('0x37')]['hasOwnProperty'](_0x0dcd('0x58'))){_0x5b1a4d[_0x0dcd('0x22')]=qs['limit'](_0x252961[_0x0dcd('0x37')][_0x0dcd('0x22')]);_0x5b1a4d['offset']=qs[_0x0dcd('0x20')](_0x252961[_0x0dcd('0x37')][_0x0dcd('0x20')]);}return _0x2e9432[_0x0dcd('0x89')](_0x5b1a4d);}})[_0x0dcd('0x29')](function(_0x5085d1){if(_0x5085d1){return _0x5085d1?{'count':_0x544f1b,'rows':_0x5085d1}:null;}})['then'](respondWithResult(_0x14b662,null))['catch'](handleError(_0x14b662,null));}; \ No newline at end of file +var _0x3c49=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','FaxQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','findAll','catch','show','params','keys','fields','include','create','body','user','FaxQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','rows','SIP','getTeams','ids','Team','online','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','join','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x5c6d14,_0x484e06){var _0x5b3bfe=function(_0x250890){while(--_0x250890){_0x5c6d14['push'](_0x5c6d14['shift']());}};_0x5b3bfe(++_0x484e06);}(_0x3c49,0x185));var _0x93c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x3c49[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require(_0x93c4('0x0'));var rimraf=require(_0x93c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93c4('0x2'));var rp=require(_0x93c4('0x3'));var moment=require(_0x93c4('0x4'));var BPromise=require(_0x93c4('0x5'));var Mustache=require('mustache');var util=require(_0x93c4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x93c4('0x7'));var ejs=require(_0x93c4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93c4('0x9'));var squel=require(_0x93c4('0xa'));var crypto=require('crypto');var jsforce=require(_0x93c4('0xb'));var deskjs=require(_0x93c4('0xc'));var toCsv=require(_0x93c4('0x7'));var querystring=require(_0x93c4('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x93c4('0xe'));var qs=require(_0x93c4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93c4('0x10'));var logger=require(_0x93c4('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x93c4('0x12'));var db=require(_0x93c4('0x13'))['db'];config[_0x93c4('0x14')]=_[_0x93c4('0x15')](config[_0x93c4('0x14')],{'host':_0x93c4('0x16'),'port':0x18eb});var socket=require(_0x93c4('0x17'))(new Redis(config[_0x93c4('0x14')]));require(_0x93c4('0x18'))['register'](socket);function respondWithStatusCode(_0x587e45,_0x55f1e8){_0x55f1e8=_0x55f1e8||0xcc;return function(_0xa5342f){if(_0xa5342f){return _0x587e45[_0x93c4('0x19')](_0x55f1e8);}return _0x587e45[_0x93c4('0x1a')](_0x55f1e8)[_0x93c4('0x1b')]();};}function respondWithResult(_0x5192cb,_0x241153){_0x241153=_0x241153||0xc8;return function(_0x207c7c){if(_0x207c7c){return _0x5192cb[_0x93c4('0x1a')](_0x241153)[_0x93c4('0x1c')](_0x207c7c);}};}function respondWithFilteredResult(_0x4a008b,_0x29c908){return function(_0x118797){if(_0x118797){var _0x9c4a98=typeof _0x29c908[_0x93c4('0x1d')]===_0x93c4('0x1e')&&typeof _0x29c908[_0x93c4('0x1f')]==='undefined';var _0x2e95f9=_0x118797[_0x93c4('0x20')];var _0x8fb687=_0x9c4a98?0x0:_0x29c908[_0x93c4('0x1d')];var _0x2a45ab=_0x9c4a98?_0x118797['count']:_0x29c908['offset']+_0x29c908[_0x93c4('0x1f')];var _0x516807;if(_0x2a45ab>=_0x2e95f9){_0x2a45ab=_0x2e95f9;_0x516807=0xc8;}else{_0x516807=0xce;}_0x4a008b[_0x93c4('0x1a')](_0x516807);return _0x4a008b['set'](_0x93c4('0x21'),_0x8fb687+'-'+_0x2a45ab+'/'+_0x2e95f9)[_0x93c4('0x1c')](_0x118797);}return null;};}function patchUpdates(_0xedfdbd){return function(_0x1a558c){try{jsonpatch['apply'](_0x1a558c,_0xedfdbd,!![]);}catch(_0x3ba877){return BPromise[_0x93c4('0x22')](_0x3ba877);}return _0x1a558c[_0x93c4('0x23')]();};}function saveUpdates(_0x528693,_0x2d40d6){return function(_0x32983d){if(_0x32983d){return _0x32983d[_0x93c4('0x24')](_0x528693)[_0x93c4('0x25')](function(_0x568d26){return _0x568d26;});}return null;};}function removeEntity(_0x54212b,_0x25908c){return function(_0x101cfc){if(_0x101cfc){return _0x101cfc[_0x93c4('0x26')]()[_0x93c4('0x25')](function(){var _0x4f2f0f=_0x101cfc[_0x93c4('0x27')]({'plain':!![]});var _0x1504a6='FaxQueues';return db[_0x93c4('0x28')][_0x93c4('0x26')]({'where':{'type':_0x1504a6,'resourceId':_0x4f2f0f['id']}})[_0x93c4('0x25')](function(){return _0x101cfc;});})[_0x93c4('0x25')](function(){_0x54212b['status'](0xcc)[_0x93c4('0x1b')]();});}};}function handleEntityNotFound(_0x143ccc,_0x3f1983){return function(_0xed4aef){if(!_0xed4aef){_0x143ccc[_0x93c4('0x19')](0x194);}return _0xed4aef;};}function handleError(_0x1f97de,_0x200136){_0x200136=_0x200136||0x1f4;return function(_0x3e2e87){logger[_0x93c4('0x29')](_0x3e2e87[_0x93c4('0x2a')]);if(_0x3e2e87[_0x93c4('0x2b')]){delete _0x3e2e87[_0x93c4('0x2b')];}_0x1f97de['status'](_0x200136)['send'](_0x3e2e87);};}exports['index']=function(_0x21bf10,_0x2d3555){var _0x140cab={},_0x480f40={},_0x36e241={'count':0x0,'rows':[]};var _0x4f7830=_[_0x93c4('0x2c')](db[_0x93c4('0x2d')][_0x93c4('0x2e')],function(_0x300cde){return{'name':_0x300cde[_0x93c4('0x2f')],'type':_0x300cde['type'][_0x93c4('0x30')]};});_0x480f40[_0x93c4('0x31')]=_[_0x93c4('0x2c')](_0x4f7830,_0x93c4('0x2b'));_0x480f40[_0x93c4('0x32')]=_['keys'](_0x21bf10[_0x93c4('0x32')]);_0x480f40[_0x93c4('0x33')]=_[_0x93c4('0x34')](_0x480f40[_0x93c4('0x31')],_0x480f40[_0x93c4('0x32')]);_0x140cab[_0x93c4('0x35')]=_['intersection'](_0x480f40['model'],qs['fields'](_0x21bf10[_0x93c4('0x32')]['fields']));_0x140cab[_0x93c4('0x35')]=_0x140cab[_0x93c4('0x35')][_0x93c4('0x36')]?_0x140cab['attributes']:_0x480f40[_0x93c4('0x31')];if(!_0x21bf10[_0x93c4('0x32')]['hasOwnProperty'](_0x93c4('0x37'))){_0x140cab[_0x93c4('0x1f')]=qs['limit'](_0x21bf10['query'][_0x93c4('0x1f')]);_0x140cab[_0x93c4('0x1d')]=qs['offset'](_0x21bf10[_0x93c4('0x32')]['offset']);}_0x140cab[_0x93c4('0x38')]=qs[_0x93c4('0x39')](_0x21bf10[_0x93c4('0x32')]['sort']);_0x140cab['where']=qs[_0x93c4('0x33')](_[_0x93c4('0x3a')](_0x21bf10[_0x93c4('0x32')],_0x480f40[_0x93c4('0x33')]),_0x4f7830);if(_0x21bf10[_0x93c4('0x32')]['filter']){_0x140cab[_0x93c4('0x3b')]=_[_0x93c4('0x3c')](_0x140cab['where'],{'$or':_[_0x93c4('0x2c')](_0x4f7830,function(_0x16af81){if(_0x16af81[_0x93c4('0x3d')]!=='VIRTUAL'){var _0x5b3673={};_0x5b3673[_0x16af81['name']]={'$like':'%'+_0x21bf10[_0x93c4('0x32')][_0x93c4('0x3e')]+'%'};return _0x5b3673;}})});}_0x140cab=_[_0x93c4('0x3c')]({},_0x140cab,_0x21bf10[_0x93c4('0x3f')]);var _0x57e067={'where':_0x140cab[_0x93c4('0x3b')]};return db[_0x93c4('0x2d')][_0x93c4('0x20')](_0x57e067)[_0x93c4('0x25')](function(_0x173088){_0x36e241['count']=_0x173088;if(_0x21bf10[_0x93c4('0x32')][_0x93c4('0x40')]){_0x140cab['include']=[{'all':!![]}];}return db[_0x93c4('0x2d')][_0x93c4('0x41')](_0x140cab);})[_0x93c4('0x25')](function(_0x5f0260){_0x36e241['rows']=_0x5f0260;return _0x36e241;})[_0x93c4('0x25')](respondWithFilteredResult(_0x2d3555,_0x140cab))[_0x93c4('0x42')](handleError(_0x2d3555,null));};exports[_0x93c4('0x43')]=function(_0x3245e1,_0x43a830){var _0x5b025e={'raw':!![],'where':{'id':_0x3245e1[_0x93c4('0x44')]['id']}},_0x497575={};_0x497575['model']=_[_0x93c4('0x45')](db[_0x93c4('0x2d')][_0x93c4('0x2e')]);_0x497575[_0x93c4('0x32')]=_[_0x93c4('0x45')](_0x3245e1['query']);_0x497575[_0x93c4('0x33')]=_[_0x93c4('0x34')](_0x497575[_0x93c4('0x31')],_0x497575[_0x93c4('0x32')]);_0x5b025e[_0x93c4('0x35')]=_[_0x93c4('0x34')](_0x497575['model'],qs[_0x93c4('0x46')](_0x3245e1[_0x93c4('0x32')][_0x93c4('0x46')]));_0x5b025e[_0x93c4('0x35')]=_0x5b025e[_0x93c4('0x35')][_0x93c4('0x36')]?_0x5b025e['attributes']:_0x497575[_0x93c4('0x31')];if(_0x3245e1['query'][_0x93c4('0x40')]){_0x5b025e[_0x93c4('0x47')]=[{'all':!![]}];}_0x5b025e=_['merge']({},_0x5b025e,_0x3245e1[_0x93c4('0x3f')]);return db[_0x93c4('0x2d')]['find'](_0x5b025e)['then'](handleEntityNotFound(_0x43a830,null))[_0x93c4('0x25')](respondWithResult(_0x43a830,null))[_0x93c4('0x42')](handleError(_0x43a830,null));};exports[_0x93c4('0x48')]=function(_0xe227b1,_0x55dcf6){return db['FaxQueue'][_0x93c4('0x48')](_0xe227b1[_0x93c4('0x49')],{})[_0x93c4('0x25')](function(_0x5ccddb){var _0x3e4943=_0xe227b1[_0x93c4('0x4a')][_0x93c4('0x27')]({'plain':!![]});if(!_0x3e4943)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e4943['role']===_0x93c4('0x4a')){var _0x2a507d=_0x5ccddb[_0x93c4('0x27')]({'plain':!![]});var _0x132869=_0x93c4('0x4b');return db[_0x93c4('0x4c')][_0x93c4('0x4d')]({'where':{'name':_0x132869,'userProfileId':_0x3e4943[_0x93c4('0x4e')]},'raw':!![]})[_0x93c4('0x25')](function(_0x4b4f93){if(_0x4b4f93&&_0x4b4f93[_0x93c4('0x4f')]===0x0){return db[_0x93c4('0x28')]['create']({'name':_0x2a507d[_0x93c4('0x2b')],'resourceId':_0x2a507d['id'],'type':_0x4b4f93[_0x93c4('0x2b')],'sectionId':_0x4b4f93['id']},{})[_0x93c4('0x25')](function(){return _0x5ccddb;});}else{return _0x5ccddb;}})['catch'](function(_0x9fcff5){logger['error'](_0x93c4('0x50'),_0x9fcff5);throw _0x9fcff5;});}return _0x5ccddb;})[_0x93c4('0x25')](respondWithResult(_0x55dcf6,0xc9))[_0x93c4('0x42')](handleError(_0x55dcf6,null));};exports[_0x93c4('0x24')]=function(_0x220715,_0x2082eb){if(_0x220715['body']['id']){delete _0x220715[_0x93c4('0x49')]['id'];}return db[_0x93c4('0x2d')]['find']({'where':{'id':_0x220715['params']['id']}})[_0x93c4('0x25')](handleEntityNotFound(_0x2082eb,null))['then'](saveUpdates(_0x220715[_0x93c4('0x49')],null))[_0x93c4('0x25')](respondWithResult(_0x2082eb,null))[_0x93c4('0x42')](handleError(_0x2082eb,null));};exports[_0x93c4('0x26')]=function(_0x2be166,_0x1679a6){return db[_0x93c4('0x2d')][_0x93c4('0x4d')]({'where':{'id':_0x2be166[_0x93c4('0x44')]['id']}})[_0x93c4('0x25')](handleEntityNotFound(_0x1679a6,null))[_0x93c4('0x25')](removeEntity(_0x1679a6,null))[_0x93c4('0x42')](handleError(_0x1679a6,null));};exports[_0x93c4('0x51')]=function(_0x506df7,_0x35ce4a){return db[_0x93c4('0x2d')][_0x93c4('0x51')]()[_0x93c4('0x25')](respondWithResult(_0x35ce4a,null))['catch'](handleError(_0x35ce4a,null));};exports[_0x93c4('0x52')]=function(_0x5184b7,_0x1e7cdf,_0x4ac1fd){var _0x456d16={'raw':!![],'where':{}},_0x1652b6={},_0x1e9d52;return db[_0x93c4('0x2d')][_0x93c4('0x53')]({'where':{'id':_0x5184b7['params']['id']}})[_0x93c4('0x25')](handleEntityNotFound(_0x1e7cdf,null))[_0x93c4('0x25')](function(_0x28758a){if(_0x28758a){_0x1e9d52=_0x28758a[_0x93c4('0x27')]({'plain':!![]});_0x1652b6[_0x93c4('0x31')]=_['keys'](db['UserFaxQueue'][_0x93c4('0x2e')]);_0x1652b6[_0x93c4('0x32')]=_[_0x93c4('0x45')](_0x5184b7[_0x93c4('0x32')]);_0x1652b6['filters']=_[_0x93c4('0x34')](_0x1652b6[_0x93c4('0x31')],_0x1652b6['query']);_0x456d16[_0x93c4('0x35')]=_['intersection'](_0x1652b6[_0x93c4('0x31')],qs['fields'](_0x5184b7[_0x93c4('0x32')]['fields']));_0x456d16['attributes']=_0x456d16[_0x93c4('0x35')][_0x93c4('0x36')]?_0x456d16[_0x93c4('0x35')]:_0x1652b6[_0x93c4('0x31')];if(!_0x5184b7[_0x93c4('0x32')][_0x93c4('0x54')](_0x93c4('0x37'))){_0x456d16[_0x93c4('0x1f')]=qs[_0x93c4('0x1f')](_0x5184b7['query'][_0x93c4('0x1f')]);_0x456d16[_0x93c4('0x1d')]=qs['offset'](_0x5184b7[_0x93c4('0x32')]['offset']);}_0x456d16[_0x93c4('0x38')]=qs[_0x93c4('0x39')](_0x5184b7['query'][_0x93c4('0x39')]);_0x456d16[_0x93c4('0x3b')]=qs[_0x93c4('0x33')](_['pick'](_0x5184b7[_0x93c4('0x32')],_0x1652b6[_0x93c4('0x33')]));_0x456d16[_0x93c4('0x3b')][_0x93c4('0x55')]=_0x28758a['id'];if(_0x5184b7[_0x93c4('0x32')][_0x93c4('0x3e')]){_0x456d16[_0x93c4('0x3b')]=_[_0x93c4('0x3c')](_0x456d16[_0x93c4('0x3b')],{'$or':_['map'](_0x456d16[_0x93c4('0x35')],function(_0x1dc24a){var _0x3dbf7e={};_0x3dbf7e[_0x1dc24a]={'$like':'%'+_0x5184b7[_0x93c4('0x32')][_0x93c4('0x3e')]+'%'};return _0x3dbf7e;})});}_0x456d16=_[_0x93c4('0x3c')]({},_0x456d16,_0x5184b7['options']);return db[_0x93c4('0x56')]['findAll'](_0x456d16);}})[_0x93c4('0x25')](function(_0x228c40){if(_0x228c40){return db[_0x93c4('0x57')][_0x93c4('0x58')]({'where':{'id':_[_0x93c4('0x2c')](_0x228c40,_0x93c4('0x59')),'role':'agent'},'attributes':['id','name',_0x93c4('0x5a'),_0x93c4('0x5b'),_0x93c4('0x5c')]});}})[_0x93c4('0x25')](function(_0x5b1991){if(_0x5b1991){return{'count':_0x5b1991[_0x93c4('0x20')],'rows':_[_0x93c4('0x2c')](_0x5b1991[_0x93c4('0x5d')],function(_0x2efc3d){return{'membername':_0x2efc3d['name'],'UserId':_0x2efc3d['id'],'queue_name':_0x1e9d52[_0x93c4('0x2b')],'FaxQueueId':_0x1e9d52['id'],'interface':util['format']('%s/%s',_0x93c4('0x5e'),_0x2efc3d['name']),'penalty':0x0,'paused':_0x2efc3d[_0x93c4('0x5a')],'createdAt':_0x2efc3d[_0x93c4('0x5c')],'updatedAt':_0x2efc3d[_0x93c4('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x93c4('0x25')](respondWithFilteredResult(_0x1e7cdf,_0x456d16))[_0x93c4('0x42')](handleError(_0x1e7cdf,null));};exports[_0x93c4('0x5f')]=function(_0x297816,_0x53c300,_0x4e2aba){var _0x5a8888={};var _0x163b29={};var _0x3c5709;var _0x323884;return db[_0x93c4('0x2d')]['findOne']({'where':{'id':_0x297816[_0x93c4('0x44')]['id']}})[_0x93c4('0x25')](handleEntityNotFound(_0x53c300,null))[_0x93c4('0x25')](function(_0x236050){if(_0x236050){_0x3c5709=_0x236050;_0x163b29['model']=_['keys'](db['Team'][_0x93c4('0x2e')]);_0x163b29[_0x93c4('0x32')]=_['keys'](_0x297816[_0x93c4('0x32')]);_0x163b29[_0x93c4('0x33')]=_[_0x93c4('0x34')](_0x163b29['model'],_0x163b29[_0x93c4('0x32')]);_0x5a8888[_0x93c4('0x35')]=_[_0x93c4('0x34')](_0x163b29[_0x93c4('0x31')],qs[_0x93c4('0x46')](_0x297816[_0x93c4('0x32')][_0x93c4('0x46')]));_0x5a8888[_0x93c4('0x35')]=_0x5a8888[_0x93c4('0x35')][_0x93c4('0x36')]?_0x5a8888[_0x93c4('0x35')]:_0x163b29[_0x93c4('0x31')];_0x5a8888['order']=qs['sort'](_0x297816[_0x93c4('0x32')][_0x93c4('0x39')]);_0x5a8888[_0x93c4('0x3b')]=qs[_0x93c4('0x33')](_[_0x93c4('0x3a')](_0x297816[_0x93c4('0x32')],_0x163b29[_0x93c4('0x33')]));if(_0x297816['query']['filter']){_0x5a8888[_0x93c4('0x3b')]=_['merge'](_0x5a8888[_0x93c4('0x3b')],{'$or':_[_0x93c4('0x2c')](_0x5a8888[_0x93c4('0x35')],function(_0x266d43){var _0x15dc3b={};_0x15dc3b[_0x266d43]={'$like':'%'+_0x297816[_0x93c4('0x32')][_0x93c4('0x3e')]+'%'};return _0x15dc3b;})});}_0x5a8888=_[_0x93c4('0x3c')]({},_0x5a8888,_0x297816[_0x93c4('0x3f')]);return _0x3c5709[_0x93c4('0x5f')](_0x5a8888);}})[_0x93c4('0x25')](function(_0x88cc87){if(_0x88cc87){_0x323884=_0x88cc87['length'];if(!_0x297816[_0x93c4('0x32')][_0x93c4('0x54')]('nolimit')){_0x5a8888[_0x93c4('0x1f')]=qs['limit'](_0x297816[_0x93c4('0x32')][_0x93c4('0x1f')]);_0x5a8888['offset']=qs[_0x93c4('0x1d')](_0x297816[_0x93c4('0x32')]['offset']);}return _0x3c5709[_0x93c4('0x5f')](_0x5a8888);}})[_0x93c4('0x25')](function(_0x5af51d){if(_0x5af51d){return _0x5af51d?{'count':_0x323884,'rows':_0x5af51d}:null;}})[_0x93c4('0x25')](respondWithResult(_0x53c300,null))[_0x93c4('0x42')](handleError(_0x53c300,null));};exports['addTeams']=function(_0x37e72d,_0x5572de,_0x5d74ea){var _0x4aef66=_0x37e72d['body'][_0x93c4('0x60')];return db[_0x93c4('0x61')][_0x93c4('0x41')]({'where':{'id':_0x4aef66},'attributes':['id'],'include':[{'model':db[_0x93c4('0x57')],'as':'Agents','attributes':['id',_0x93c4('0x2b'),_0x93c4('0x62'),_0x93c4('0x63'),_0x93c4('0x64')],'raw':!![]}]})[_0x93c4('0x25')](function(_0x5501cf){if(_0x5501cf){var _0x24a46c=_['flatMap'](_0x5501cf,function(_0x1b8e19){var _0xf04943=_0x1b8e19[_0x93c4('0x27')]({'plain':!![]});return _0xf04943['Agents'];});return db[_0x93c4('0x2d')][_0x93c4('0x4d')]({'where':{'id':_0x37e72d[_0x93c4('0x44')]['id']}})[_0x93c4('0x25')](function(_0x1dca19){return db[_0x93c4('0x65')][_0x93c4('0x66')](function(_0x1eee99){return _0x1dca19['addTeams'](_0x4aef66,{'transaction':_0x1eee99})[_0x93c4('0x25')](function(){return BPromise[_0x93c4('0x67')](_0x24a46c,function(_0x570fd5){return db[_0x93c4('0x56')][_0x93c4('0x68')]({'where':{'UserId':_0x570fd5['id'],'FaxQueueId':_0x37e72d[_0x93c4('0x44')]['id']},'transaction':_0x1eee99});});})['then'](function(){_0x24a46c['forEach'](function(_0x267c3c){socket[_0x93c4('0x69')](_0x93c4('0x6a'),{'UserId':_0x267c3c['id'],'FaxQueueId':_0x1dca19['id']});});});});});}})[_0x93c4('0x25')](respondWithStatusCode(_0x5572de,null))[_0x93c4('0x42')](handleError(_0x5572de,null));};exports[_0x93c4('0x6b')]=function(_0x5c61df,_0x57bc2d,_0x43cfdd){return db['Team'][_0x93c4('0x41')]({'where':{'id':_0x5c61df[_0x93c4('0x32')][_0x93c4('0x60')]},'attributes':['id'],'include':[{'model':db[_0x93c4('0x57')],'as':_0x93c4('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x93c4('0x25')](handleEntityNotFound(_0x57bc2d,null))[_0x93c4('0x25')](function(_0x54a3b0){var _0x41d4df=_[_0x93c4('0x2c')](_0x54a3b0,'id');var _0x87e9d7=[];var _0x586140=[];var _0x53180b=squel[_0x93c4('0x6d')]();_0x53180b[_0x93c4('0x6e')](_0x93c4('0x6f'))[_0x93c4('0x70')]('team_has_fax_queues','tq')[_0x93c4('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x93c4('0x3b')]('FaxQueueId\x20=\x20?',_0x5c61df[_0x93c4('0x44')]['id']);for(var _0x88cb79=0x0;_0x88cb79<_0x54a3b0[_0x93c4('0x36')];_0x88cb79+=0x1){let _0x568288=_0x54a3b0[_0x88cb79];for(var _0x13af04=0x0;_0x13af04<_0x568288[_0x93c4('0x6c')][_0x93c4('0x36')];_0x13af04+=0x1){let _0x1f3fc4=_0x568288['Agents'][_0x13af04];var _0x585b84=_0x53180b['clone']();_0x585b84['where'](_0x93c4('0x72'),_0x1f3fc4['id']);_0x586140[_0x93c4('0x73')](db[_0x93c4('0x65')][_0x93c4('0x32')](_0x585b84[_0x93c4('0x74')](),{'type':db[_0x93c4('0x65')][_0x93c4('0x75')][_0x93c4('0x76')]})[_0x93c4('0x25')](function(_0x40259f){if(_0x40259f[_0x93c4('0x36')]===0x1){return _0x1f3fc4['id'];}else{var _0xda3717=_[_0x93c4('0x77')](_[_0x93c4('0x2c')](_0x40259f,'TeamId'),function(_0x1840e0){return _[_0x93c4('0x78')](_0x41d4df,_0x1840e0);});if(_0xda3717){return _0x1f3fc4['id'];}}}));}}return BPromise[_0x93c4('0x79')](_0x586140)[_0x93c4('0x25')](function(_0x1eeccc){_0x87e9d7=_(_0x87e9d7)['union'](_0x1eeccc)[_0x93c4('0x7a')]()[_0x93c4('0x7b')]();return db[_0x93c4('0x2d')]['find']({'where':{'id':_0x5c61df[_0x93c4('0x44')]['id']}})['then'](function(_0x2c6056){return db[_0x93c4('0x65')][_0x93c4('0x66')](function(_0x39a6a0){return _0x2c6056[_0x93c4('0x6b')](_0x5c61df['query'][_0x93c4('0x60')],{'transaction':_0x39a6a0})[_0x93c4('0x25')](function(){if(!_[_0x93c4('0x7c')](_0x87e9d7)){return _0x2c6056[_0x93c4('0x7d')](_0x87e9d7,{'transaction':_0x39a6a0});}})[_0x93c4('0x25')](function(){_0x87e9d7[_0x93c4('0x7e')](function(_0x4cb6b8){socket[_0x93c4('0x69')](_0x93c4('0x7f'),{'UserId':_0x4cb6b8,'FaxQueueId':_0x2c6056['id']});});});});});});})['then'](respondWithStatusCode(_0x57bc2d,null))[_0x93c4('0x42')](handleError(_0x57bc2d,null));};exports[_0x93c4('0x80')]=function(_0x2e52b3,_0xa99abe,_0x40e56e){return db[_0x93c4('0x2d')][_0x93c4('0x4d')]({'where':{'id':_0x2e52b3[_0x93c4('0x44')]['id']}})[_0x93c4('0x25')](handleEntityNotFound(_0xa99abe,null))[_0x93c4('0x25')](function(_0x276422){if(_0x276422){return _0x276422['addAgents'](_0x2e52b3[_0x93c4('0x49')][_0x93c4('0x60')],_['omit'](_0x2e52b3[_0x93c4('0x49')],[_0x93c4('0x60'),'id'])||{})[_0x93c4('0x81')](function(_0x3e4cbb){for(var _0x5f18e5=0x0;_0x5f18e5<_0x2e52b3[_0x93c4('0x49')][_0x93c4('0x60')][_0x93c4('0x36')];_0x5f18e5+=0x1){socket[_0x93c4('0x69')](_0x93c4('0x6a'),{'UserId':Number(_0x2e52b3['body'][_0x93c4('0x60')][_0x5f18e5]),'FaxQueueId':Number(_0x2e52b3[_0x93c4('0x44')]['id'])});}return _0x3e4cbb;});}})[_0x93c4('0x25')](respondWithResult(_0xa99abe,null))[_0x93c4('0x42')](handleError(_0xa99abe,null));};exports[_0x93c4('0x7d')]=function(_0x2c0ee9,_0x1d12d7,_0x3e3536){return db[_0x93c4('0x2d')][_0x93c4('0x4d')]({'where':{'id':_0x2c0ee9['params']['id']}})[_0x93c4('0x25')](handleEntityNotFound(_0x1d12d7,null))[_0x93c4('0x25')](function(_0x4aba13){if(_0x4aba13){return _0x4aba13[_0x93c4('0x7d')](_0x2c0ee9[_0x93c4('0x32')][_0x93c4('0x60')])[_0x93c4('0x25')](function(){if(_[_0x93c4('0x82')](_0x2c0ee9[_0x93c4('0x32')][_0x93c4('0x60')])){for(var _0x242ec9=0x0;_0x242ec9<_0x2c0ee9[_0x93c4('0x32')][_0x93c4('0x60')][_0x93c4('0x36')];_0x242ec9+=0x1){socket[_0x93c4('0x69')](_0x93c4('0x7f'),{'UserId':Number(_0x2c0ee9[_0x93c4('0x32')]['ids'][_0x242ec9]),'FaxQueueId':Number(_0x2c0ee9[_0x93c4('0x44')]['id'])});}}else{socket[_0x93c4('0x69')]('userFaxQueue:remove',{'UserId':Number(_0x2c0ee9[_0x93c4('0x32')][_0x93c4('0x60')]),'FaxQueueId':Number(_0x2c0ee9[_0x93c4('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x1d12d7,null))[_0x93c4('0x42')](handleError(_0x1d12d7,null));};exports[_0x93c4('0x83')]=function(_0x100911,_0x35d0e3,_0x2ae0e7){var _0x420e51={};var _0x2b4a3b={};var _0xcc21b5;var _0x356d87;return db[_0x93c4('0x2d')]['findOne']({'where':{'id':_0x100911[_0x93c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x35d0e3,null))['then'](function(_0x56b1ba){if(_0x56b1ba){_0xcc21b5=_0x56b1ba;_0x2b4a3b[_0x93c4('0x31')]=_[_0x93c4('0x45')](db['User'][_0x93c4('0x2e')]);_0x2b4a3b[_0x93c4('0x32')]=_[_0x93c4('0x45')](_0x100911[_0x93c4('0x32')]);_0x2b4a3b[_0x93c4('0x33')]=_[_0x93c4('0x34')](_0x2b4a3b[_0x93c4('0x31')],_0x2b4a3b[_0x93c4('0x32')]);_0x420e51[_0x93c4('0x35')]=_[_0x93c4('0x34')](_0x2b4a3b['model'],qs[_0x93c4('0x46')](_0x100911['query']['fields']));_0x420e51['attributes']=_0x420e51[_0x93c4('0x35')][_0x93c4('0x36')]?_0x420e51[_0x93c4('0x35')]:_0x2b4a3b[_0x93c4('0x31')];_0x420e51[_0x93c4('0x38')]=qs[_0x93c4('0x39')](_0x100911[_0x93c4('0x32')][_0x93c4('0x39')]);_0x420e51['where']=qs[_0x93c4('0x33')](_[_0x93c4('0x3a')](_0x100911[_0x93c4('0x32')],_0x2b4a3b[_0x93c4('0x33')]));if(_0x100911[_0x93c4('0x32')][_0x93c4('0x3e')]){_0x420e51[_0x93c4('0x3b')]=_[_0x93c4('0x3c')](_0x420e51['where'],{'$or':_[_0x93c4('0x2c')](_0x420e51[_0x93c4('0x35')],function(_0x41edc4){var _0x3e69d6={};_0x3e69d6[_0x41edc4]={'$like':'%'+_0x100911[_0x93c4('0x32')][_0x93c4('0x3e')]+'%'};return _0x3e69d6;})});}_0x420e51=_[_0x93c4('0x3c')]({},_0x420e51,_0x100911['options']);return _0xcc21b5['getAgents'](_0x420e51);}})[_0x93c4('0x25')](function(_0x39d093){if(_0x39d093){_0x356d87=_0x39d093[_0x93c4('0x36')];if(!_0x100911[_0x93c4('0x32')][_0x93c4('0x54')](_0x93c4('0x37'))){_0x420e51[_0x93c4('0x1f')]=qs['limit'](_0x100911[_0x93c4('0x32')][_0x93c4('0x1f')]);_0x420e51[_0x93c4('0x1d')]=qs[_0x93c4('0x1d')](_0x100911[_0x93c4('0x32')][_0x93c4('0x1d')]);}return _0xcc21b5['getAgents'](_0x420e51);}})[_0x93c4('0x25')](function(_0x31c646){if(_0x31c646){return _0x31c646?{'count':_0x356d87,'rows':_0x31c646}:null;}})['then'](respondWithResult(_0x35d0e3,null))[_0x93c4('0x42')](handleError(_0x35d0e3,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 9adf905..297d7b0 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 _0x1cde=['../../mysqldb','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0x1cde,0x84));var _0xe1cd=function(_0x45cd35,_0x41147c){_0x45cd35=_0x45cd35-0x0;var _0x16db84=_0x1cde[_0x45cd35];return _0x16db84;};'use strict';var EventEmitter=require(_0xe1cd('0x0'));var FaxQueue=require(_0xe1cd('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe1cd('0x2')};function emitEvent(_0x75b3ca){return function(_0x1cffad,_0x2a1d18,_0x42bef8){FaxQueueEvents[_0xe1cd('0x3')](_0x75b3ca+':'+_0x1cffad['id'],_0x1cffad);FaxQueueEvents[_0xe1cd('0x3')](_0x75b3ca,_0x1cffad);_0x42bef8(null);};}for(var e in events){if(events[_0xe1cd('0x4')](e)){var event=events[e];FaxQueue[_0xe1cd('0x5')](e,emitEvent(event));}}module[_0xe1cd('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0x9193=['update','remove','emit','hasOwnProperty','exports','events','FaxQueue','setMaxListeners','save'];(function(_0x2ca346,_0x1878fd){var _0x2c1691=function(_0x4d7129){while(--_0x4d7129){_0x2ca346['push'](_0x2ca346['shift']());}};_0x2c1691(++_0x1878fd);}(_0x9193,0xb0));var _0x3919=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x9193[_0x10dbf6];return _0x452147;};'use strict';var EventEmitter=require(_0x3919('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x3919('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3919('0x2')](0x0);var events={'afterCreate':_0x3919('0x3'),'afterUpdate':_0x3919('0x4'),'afterDestroy':_0x3919('0x5')};function emitEvent(_0x147fa1){return function(_0x1c0cea,_0x475e7b,_0x3f273a){FaxQueueEvents[_0x3919('0x6')](_0x147fa1+':'+_0x1c0cea['id'],_0x1c0cea);FaxQueueEvents[_0x3919('0x6')](_0x147fa1,_0x1c0cea);_0x3f273a(null);};}for(var e in events){if(events[_0x3919('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x3919('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index d74c125..8141db5 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 _0x141c=['util','../../config/logger','moment','request-promise','path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash'];(function(_0x4f4c98,_0x5be02d){var _0x4e2ea5=function(_0x244b78){while(--_0x244b78){_0x4f4c98['push'](_0x4f4c98['shift']());}};_0x4e2ea5(++_0x5be02d);}(_0x141c,0x1df));var _0xc141=function(_0x470ccc,_0x35847d){_0x470ccc=_0x470ccc-0x0;var _0x5e07df=_0x141c[_0x470ccc];return _0x5e07df;};'use strict';var _=require(_0xc141('0x0'));var util=require(_0xc141('0x1'));var logger=require(_0xc141('0x2'))('api');var moment=require(_0xc141('0x3'));var BPromise=require('bluebird');var rp=require(_0xc141('0x4'));var fs=require('fs');var path=require(_0xc141('0x5'));var rimraf=require(_0xc141('0x6'));var config=require('../../config/environment');var attributes=require(_0xc141('0x7'));module[_0xc141('0x8')]=function(_0x2d83af,_0x1d708a){return _0x2d83af[_0xc141('0x9')](_0xc141('0xa'),attributes,{'tableName':_0xc141('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde90=['path','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1c7c31,_0x47d8f6){var _0x594e81=function(_0x587ab8){while(--_0x587ab8){_0x1c7c31['push'](_0x1c7c31['shift']());}};_0x594e81(++_0x47d8f6);}(_0xde90,0x1a9));var _0x0de9=function(_0x29cb9b,_0x247dd1){_0x29cb9b=_0x29cb9b-0x0;var _0x544ff3=_0xde90[_0x29cb9b];return _0x544ff3;};'use strict';var _=require(_0x0de9('0x0'));var util=require(_0x0de9('0x1'));var logger=require(_0x0de9('0x2'))(_0x0de9('0x3'));var moment=require(_0x0de9('0x4'));var BPromise=require(_0x0de9('0x5'));var rp=require(_0x0de9('0x6'));var fs=require('fs');var path=require(_0x0de9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x0de9('0x8')]=function(_0x2ae912,_0x214849){return _0x2ae912[_0x0de9('0x9')](_0x0de9('0xa'),attributes,{'tableName':_0x0de9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index c9c4bb8..113c7de 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 _0x0c96=['defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','map','include','model','find','ShowFaxQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2c2ad1,_0x30a1d1){var _0x4a855e=function(_0x2ee1ff){while(--_0x2ee1ff){_0x2c2ad1['push'](_0x2c2ad1['shift']());}};_0x4a855e(++_0x30a1d1);}(_0x0c96,0xb3));var _0x60c9=function(_0x182a0a,_0x5269bc){_0x182a0a=_0x182a0a-0x0;var _0x22b991=_0x0c96[_0x182a0a];return _0x22b991;};'use strict';var _=require(_0x60c9('0x0'));var util=require(_0x60c9('0x1'));var moment=require(_0x60c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x60c9('0x3'));var fs=require('fs');var Redis=require(_0x60c9('0x4'));var db=require(_0x60c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x60c9('0x6'));var jayson=require(_0x60c9('0x7'));var client=jayson[_0x60c9('0x8')][_0x60c9('0x9')]({'port':0x232a});config[_0x60c9('0xa')]=_[_0x60c9('0xb')](config[_0x60c9('0xa')],{'host':_0x60c9('0xc'),'port':0x18eb});var socket=require(_0x60c9('0xd'))(new Redis(config[_0x60c9('0xa')]));require(_0x60c9('0xe'))['register'](socket);function respondWithRpcPromise(_0x1bfbf2,_0xde226,_0x4ab605){return new BPromise(function(_0x5b1e7b,_0x5960c1){return client[_0x60c9('0xf')](_0x1bfbf2,_0x4ab605)[_0x60c9('0x10')](function(_0x186816){logger[_0x60c9('0x11')](_0x60c9('0x12'),_0xde226,_0x60c9('0x13'));logger[_0x60c9('0x14')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0xde226,'request\x20sent',JSON[_0x60c9('0x15')](_0x186816));if(_0x186816['error']){if(_0x186816[_0x60c9('0x16')][_0x60c9('0x17')]===0x1f4){logger[_0x60c9('0x16')]('FaxQueue,\x20%s,\x20%s',_0xde226,_0x186816['error']['message']);return _0x5960c1(_0x186816[_0x60c9('0x16')][_0x60c9('0x18')]);}logger['error'](_0x60c9('0x12'),_0xde226,_0x186816[_0x60c9('0x16')]['message']);return _0x5b1e7b(_0x186816[_0x60c9('0x16')][_0x60c9('0x18')]);}else{logger[_0x60c9('0x11')](_0x60c9('0x12'),_0xde226,_0x60c9('0x13'));_0x5b1e7b(_0x186816[_0x60c9('0x19')][_0x60c9('0x18')]);}})[_0x60c9('0x1a')](function(_0x102230){logger[_0x60c9('0x16')]('FaxQueue,\x20%s,\x20%s',_0xde226,_0x102230);_0x5960c1(_0x102230);});});}exports[_0x60c9('0x1b')]=function(_0x518e12){var _0x1d56bc=this;return new Promise(function(_0x2d544c,_0x2f385f){return db[_0x60c9('0x1c')]['findAll']({'raw':_0x518e12[_0x60c9('0x1d')]?_0x518e12[_0x60c9('0x1d')][_0x60c9('0x1e')]===undefined?!![]:![]:!![],'where':_0x518e12[_0x60c9('0x1d')]?_0x518e12[_0x60c9('0x1d')][_0x60c9('0x1f')]||null:null,'attributes':_0x518e12[_0x60c9('0x1d')]?_0x518e12[_0x60c9('0x1d')][_0x60c9('0x20')]||null:null,'limit':_0x518e12[_0x60c9('0x1d')]?_0x518e12[_0x60c9('0x1d')]['limit']||null:null,'include':_0x518e12[_0x60c9('0x1d')]?_0x518e12[_0x60c9('0x1d')]['include']?_[_0x60c9('0x21')](_0x518e12[_0x60c9('0x1d')][_0x60c9('0x22')],function(_0x13bd3a){return{'model':db[_0x13bd3a[_0x60c9('0x23')]],'as':_0x13bd3a['as'],'attributes':_0x13bd3a['attributes'],'include':_0x13bd3a['include']?_[_0x60c9('0x21')](_0x13bd3a['include'],function(_0x4de83e){return{'model':db[_0x4de83e[_0x60c9('0x23')]],'as':_0x4de83e['as'],'attributes':_0x4de83e[_0x60c9('0x20')],'include':_0x4de83e[_0x60c9('0x22')]?_[_0x60c9('0x21')](_0x4de83e[_0x60c9('0x22')],function(_0x1ee0be){return{'model':db[_0x1ee0be['model']],'as':_0x1ee0be['as'],'attributes':_0x1ee0be[_0x60c9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x60c9('0x10')](function(_0x52e074){logger[_0x60c9('0x11')]('GetFaxQueue',_0x518e12);logger[_0x60c9('0x14')](_0x60c9('0x1b'),_0x518e12,JSON[_0x60c9('0x15')](_0x52e074));_0x2d544c(_0x52e074);})['catch'](function(_0x28b7bc){logger['error']('GetFaxQueue',_0x28b7bc[_0x60c9('0x18')],_0x518e12);_0x2f385f(_0x1d56bc[_0x60c9('0x16')](0x1f4,_0x28b7bc[_0x60c9('0x18')]));});});};exports['ShowFaxQueue']=function(_0x80d86a){var _0x47458b=this;return new Promise(function(_0x38c78b,_0x314725){return db[_0x60c9('0x1c')][_0x60c9('0x24')]({'raw':_0x80d86a[_0x60c9('0x1d')]?_0x80d86a[_0x60c9('0x1d')][_0x60c9('0x1e')]===undefined?!![]:![]:!![],'where':_0x80d86a[_0x60c9('0x1d')]?_0x80d86a[_0x60c9('0x1d')][_0x60c9('0x1f')]||null:null,'attributes':_0x80d86a[_0x60c9('0x1d')]?_0x80d86a[_0x60c9('0x1d')][_0x60c9('0x20')]||null:null,'include':_0x80d86a['options']?_0x80d86a[_0x60c9('0x1d')]['include']?_[_0x60c9('0x21')](_0x80d86a['options'][_0x60c9('0x22')],function(_0x929934){return{'model':db[_0x929934[_0x60c9('0x23')]],'as':_0x929934['as'],'attributes':_0x929934['attributes'],'include':_0x929934[_0x60c9('0x22')]?_[_0x60c9('0x21')](_0x929934[_0x60c9('0x22')],function(_0x2aedbc){return{'model':db[_0x2aedbc[_0x60c9('0x23')]],'as':_0x2aedbc['as'],'attributes':_0x2aedbc['attributes'],'include':_0x2aedbc[_0x60c9('0x22')]?_[_0x60c9('0x21')](_0x2aedbc[_0x60c9('0x22')],function(_0x64ed02){return{'model':db[_0x64ed02[_0x60c9('0x23')]],'as':_0x64ed02['as'],'attributes':_0x64ed02['attributes']};}):[]};}):[]};}):[]:[]})[_0x60c9('0x10')](function(_0x4a2103){logger[_0x60c9('0x11')](_0x60c9('0x25'),_0x80d86a);logger[_0x60c9('0x14')](_0x60c9('0x25'),_0x80d86a,JSON[_0x60c9('0x15')](_0x4a2103));_0x38c78b(_0x4a2103);})['catch'](function(_0x579dd6){logger[_0x60c9('0x16')](_0x60c9('0x25'),_0x579dd6[_0x60c9('0x18')],_0x80d86a);_0x314725(_0x47458b[_0x60c9('0x16')](0x1f4,_0x579dd6[_0x60c9('0x18')]));});});}; \ No newline at end of file +var _0xb9cc=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','map','include','model','catch','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb9cc,0x132));var _0xcb9c=function(_0x3976ff,_0x13e902){_0x3976ff=_0x3976ff-0x0;var _0x5da2bd=_0xb9cc[_0x3976ff];return _0x5da2bd;};'use strict';var _=require(_0xcb9c('0x0'));var util=require(_0xcb9c('0x1'));var moment=require(_0xcb9c('0x2'));var BPromise=require(_0xcb9c('0x3'));var rs=require(_0xcb9c('0x4'));var fs=require('fs');var Redis=require(_0xcb9c('0x5'));var db=require(_0xcb9c('0x6'))['db'];var utils=require(_0xcb9c('0x7'));var logger=require('../../config/logger')(_0xcb9c('0x8'));var config=require(_0xcb9c('0x9'));var jayson=require(_0xcb9c('0xa'));var client=jayson[_0xcb9c('0xb')]['http']({'port':0x232a});config[_0xcb9c('0xc')]=_[_0xcb9c('0xd')](config[_0xcb9c('0xc')],{'host':_0xcb9c('0xe'),'port':0x18eb});var socket=require(_0xcb9c('0xf'))(new Redis(config[_0xcb9c('0xc')]));require(_0xcb9c('0x10'))['register'](socket);function respondWithRpcPromise(_0x3a37ad,_0x58a549,_0x5f1de9){return new BPromise(function(_0x8c30d4,_0x76eb3f){return client[_0xcb9c('0x11')](_0x3a37ad,_0x5f1de9)[_0xcb9c('0x12')](function(_0x28b76a){logger[_0xcb9c('0x13')](_0xcb9c('0x14'),_0x58a549,_0xcb9c('0x15'));logger[_0xcb9c('0x16')](_0xcb9c('0x17'),_0x58a549,'request\x20sent',JSON[_0xcb9c('0x18')](_0x28b76a));if(_0x28b76a[_0xcb9c('0x19')]){if(_0x28b76a['error']['code']===0x1f4){logger['error'](_0xcb9c('0x14'),_0x58a549,_0x28b76a[_0xcb9c('0x19')][_0xcb9c('0x1a')]);return _0x76eb3f(_0x28b76a[_0xcb9c('0x19')]['message']);}logger[_0xcb9c('0x19')]('FaxQueue,\x20%s,\x20%s',_0x58a549,_0x28b76a[_0xcb9c('0x19')][_0xcb9c('0x1a')]);return _0x8c30d4(_0x28b76a[_0xcb9c('0x19')][_0xcb9c('0x1a')]);}else{logger[_0xcb9c('0x13')](_0xcb9c('0x14'),_0x58a549,'request\x20sent');_0x8c30d4(_0x28b76a[_0xcb9c('0x1b')]['message']);}})['catch'](function(_0x11922b){logger['error'](_0xcb9c('0x14'),_0x58a549,_0x11922b);_0x76eb3f(_0x11922b);});});}exports[_0xcb9c('0x1c')]=function(_0x4414ad){var _0x71e54f=this;return new Promise(function(_0x4ccb8e,_0x2b0ac7){return db[_0xcb9c('0x1d')]['findAll']({'raw':_0x4414ad[_0xcb9c('0x1e')]?_0x4414ad['options'][_0xcb9c('0x1f')]===undefined?!![]:![]:!![],'where':_0x4414ad[_0xcb9c('0x1e')]?_0x4414ad[_0xcb9c('0x1e')][_0xcb9c('0x20')]||null:null,'attributes':_0x4414ad[_0xcb9c('0x1e')]?_0x4414ad[_0xcb9c('0x1e')][_0xcb9c('0x21')]||null:null,'limit':_0x4414ad['options']?_0x4414ad[_0xcb9c('0x1e')][_0xcb9c('0x22')]||null:null,'include':_0x4414ad[_0xcb9c('0x1e')]?_0x4414ad['options']['include']?_[_0xcb9c('0x23')](_0x4414ad[_0xcb9c('0x1e')][_0xcb9c('0x24')],function(_0x5e0a97){return{'model':db[_0x5e0a97[_0xcb9c('0x25')]],'as':_0x5e0a97['as'],'attributes':_0x5e0a97['attributes'],'include':_0x5e0a97[_0xcb9c('0x24')]?_[_0xcb9c('0x23')](_0x5e0a97[_0xcb9c('0x24')],function(_0x1bace7){return{'model':db[_0x1bace7[_0xcb9c('0x25')]],'as':_0x1bace7['as'],'attributes':_0x1bace7[_0xcb9c('0x21')],'include':_0x1bace7[_0xcb9c('0x24')]?_[_0xcb9c('0x23')](_0x1bace7[_0xcb9c('0x24')],function(_0x41dd02){return{'model':db[_0x41dd02[_0xcb9c('0x25')]],'as':_0x41dd02['as'],'attributes':_0x41dd02[_0xcb9c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcb9c('0x12')](function(_0x227e8a){logger['info'](_0xcb9c('0x1c'),_0x4414ad);logger[_0xcb9c('0x16')](_0xcb9c('0x1c'),_0x4414ad,JSON[_0xcb9c('0x18')](_0x227e8a));_0x4ccb8e(_0x227e8a);})[_0xcb9c('0x26')](function(_0x210fb3){logger[_0xcb9c('0x19')](_0xcb9c('0x1c'),_0x210fb3['message'],_0x4414ad);_0x2b0ac7(_0x71e54f[_0xcb9c('0x19')](0x1f4,_0x210fb3[_0xcb9c('0x1a')]));});});};exports[_0xcb9c('0x27')]=function(_0x5a7543){var _0xba6d62=this;return new Promise(function(_0x522650,_0x345325){return db[_0xcb9c('0x1d')][_0xcb9c('0x28')]({'raw':_0x5a7543[_0xcb9c('0x1e')]?_0x5a7543[_0xcb9c('0x1e')][_0xcb9c('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a7543['options']?_0x5a7543[_0xcb9c('0x1e')][_0xcb9c('0x20')]||null:null,'attributes':_0x5a7543[_0xcb9c('0x1e')]?_0x5a7543[_0xcb9c('0x1e')][_0xcb9c('0x21')]||null:null,'include':_0x5a7543[_0xcb9c('0x1e')]?_0x5a7543['options'][_0xcb9c('0x24')]?_['map'](_0x5a7543[_0xcb9c('0x1e')][_0xcb9c('0x24')],function(_0x40d199){return{'model':db[_0x40d199[_0xcb9c('0x25')]],'as':_0x40d199['as'],'attributes':_0x40d199[_0xcb9c('0x21')],'include':_0x40d199[_0xcb9c('0x24')]?_[_0xcb9c('0x23')](_0x40d199[_0xcb9c('0x24')],function(_0x31bd76){return{'model':db[_0x31bd76[_0xcb9c('0x25')]],'as':_0x31bd76['as'],'attributes':_0x31bd76[_0xcb9c('0x21')],'include':_0x31bd76[_0xcb9c('0x24')]?_[_0xcb9c('0x23')](_0x31bd76[_0xcb9c('0x24')],function(_0x1fdf68){return{'model':db[_0x1fdf68[_0xcb9c('0x25')]],'as':_0x1fdf68['as'],'attributes':_0x1fdf68[_0xcb9c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcb9c('0x12')](function(_0x1bd1f9){logger[_0xcb9c('0x13')](_0xcb9c('0x27'),_0x5a7543);logger['debug'](_0xcb9c('0x27'),_0x5a7543,JSON['stringify'](_0x1bd1f9));_0x522650(_0x1bd1f9);})[_0xcb9c('0x26')](function(_0x5d8758){logger['error'](_0xcb9c('0x27'),_0x5d8758[_0xcb9c('0x1a')],_0x5a7543);_0x345325(_0xba6d62['error'](0x1f4,_0x5d8758[_0xcb9c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 355beff..50b42d8 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 _0xb14b=['register','length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x490145,_0x559f99){var _0x5106c8=function(_0x501731){while(--_0x501731){_0x490145['push'](_0x490145['shift']());}};_0x5106c8(++_0x559f99);}(_0xb14b,0xff));var _0xbb14=function(_0x2e5748,_0x42261f){_0x2e5748=_0x2e5748-0x0;var _0x35f8fd=_0xb14b[_0x2e5748];return _0x35f8fd;};'use strict';var FaxQueueEvents=require(_0xbb14('0x0'));var events=[_0xbb14('0x1'),_0xbb14('0x2'),_0xbb14('0x3')];function createListener(_0x1e9b22,_0x37a57b){return function(_0x38fecb){_0x37a57b[_0xbb14('0x4')](_0x1e9b22,_0x38fecb);};}function removeListener(_0x4bc782,_0x1d9422){return function(){FaxQueueEvents[_0xbb14('0x5')](_0x4bc782,_0x1d9422);};}exports[_0xbb14('0x6')]=function(_0x5d48de){for(var _0x163c49=0x0,_0x31ece8=events[_0xbb14('0x7')];_0x163c49<_0x31ece8;_0x163c49++){var _0x19a3c7=events[_0x163c49];var _0x553bf4=createListener(_0xbb14('0x8')+_0x19a3c7,_0x5d48de);FaxQueueEvents['on'](_0x19a3c7,_0x553bf4);}}; \ No newline at end of file +var _0x0869=['./faxQueue.events','save','remove','update','emit','removeListener','faxQueue:'];(function(_0x39bdfc,_0x246044){var _0x15c434=function(_0x489a16){while(--_0x489a16){_0x39bdfc['push'](_0x39bdfc['shift']());}};_0x15c434(++_0x246044);}(_0x0869,0xaf));var _0x9086=function(_0x3094db,_0x1a7940){_0x3094db=_0x3094db-0x0;var _0x2a8acc=_0x0869[_0x3094db];return _0x2a8acc;};'use strict';var FaxQueueEvents=require(_0x9086('0x0'));var events=[_0x9086('0x1'),_0x9086('0x2'),_0x9086('0x3')];function createListener(_0x4fbbfd,_0x3f31d1){return function(_0x12f93d){_0x3f31d1[_0x9086('0x4')](_0x4fbbfd,_0x12f93d);};}function removeListener(_0x37489e,_0x3d48f7){return function(){FaxQueueEvents[_0x9086('0x5')](_0x37489e,_0x3d48f7);};}exports['register']=function(_0x330294){for(var _0x3bd9f3=0x0,_0xa40833=events['length'];_0x3bd9f3<_0xa40833;_0x3bd9f3++){var _0x232e7f=events[_0x3bd9f3];var _0x50abce=createListener(_0x9086('0x6')+_0x232e7f,_0x330294);FaxQueueEvents['on'](_0x232e7f,_0x50abce);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7719d92..741bf3b 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 _0x292c=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','put','update','destroy','delete','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x548f04,_0x3f6e95){var _0x14ad6b=function(_0x2f7139){while(--_0x2f7139){_0x548f04['push'](_0x548f04['shift']());}};_0x14ad6b(++_0x3f6e95);}(_0x292c,0x66));var _0xc292=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x292c[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0xc292('0x0'));var util=require('util');var path=require(_0xc292('0x1'));var timeout=require(_0xc292('0x2'));var express=require(_0xc292('0x3'));var router=express[_0xc292('0x4')]();var fs_extra=require(_0xc292('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc292('0x6'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xc292('0x7')]('/',auth[_0xc292('0x8')](),controller[_0xc292('0x9')]);router[_0xc292('0x7')](_0xc292('0xa'),auth[_0xc292('0x8')](),controller[_0xc292('0xb')]);router[_0xc292('0x7')](_0xc292('0xc'),auth[_0xc292('0x8')](),controller['show']);router[_0xc292('0x7')](_0xc292('0xd'),auth[_0xc292('0x8')](),controller[_0xc292('0xe')]);router[_0xc292('0x7')]('/:id/teams',auth[_0xc292('0x8')](),controller[_0xc292('0xf')]);router[_0xc292('0x7')](_0xc292('0x10'),auth[_0xc292('0x8')](),controller[_0xc292('0x11')]);router['post']('/',auth[_0xc292('0x8')](),controller[_0xc292('0x12')]);router[_0xc292('0x13')](_0xc292('0x14'),auth[_0xc292('0x8')](),controller['addTeams']);router['post'](_0xc292('0x10'),auth[_0xc292('0x8')](),controller['addAgents']);router[_0xc292('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc292('0x16')]);router['delete'](_0xc292('0xc'),auth[_0xc292('0x8')](),controller[_0xc292('0x17')]);router['delete'](_0xc292('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xc292('0x18')](_0xc292('0x10'),auth['isAuthenticated'](),controller[_0xc292('0x19')]);module[_0xc292('0x1a')]=router; \ No newline at end of file +var _0x9b0d=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','removeTeams'];(function(_0x3dde31,_0x2a5a03){var _0x421e58=function(_0x2b763d){while(--_0x2b763d){_0x3dde31['push'](_0x3dde31['shift']());}};_0x421e58(++_0x2a5a03);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x5eec96,_0x4f8849){_0x5eec96=_0x5eec96-0x0;var _0x19930e=_0x9b0d[_0x5eec96];return _0x19930e;};'use strict';var multer=require('multer');var util=require(_0xd9b0('0x0'));var path=require(_0xd9b0('0x1'));var timeout=require(_0xd9b0('0x2'));var express=require(_0xd9b0('0x3'));var router=express['Router']();var fs_extra=require(_0xd9b0('0x4'));var auth=require(_0xd9b0('0x5'));var interaction=require(_0xd9b0('0x6'));var config=require(_0xd9b0('0x7'));var controller=require('./faxQueue.controller');router[_0xd9b0('0x8')]('/',auth[_0xd9b0('0x9')](),controller[_0xd9b0('0xa')]);router[_0xd9b0('0x8')](_0xd9b0('0xb'),auth[_0xd9b0('0x9')](),controller[_0xd9b0('0xc')]);router['get'](_0xd9b0('0xd'),auth[_0xd9b0('0x9')](),controller['show']);router[_0xd9b0('0x8')]('/:id/members',auth[_0xd9b0('0x9')](),controller['getMembers']);router[_0xd9b0('0x8')](_0xd9b0('0xe'),auth[_0xd9b0('0x9')](),controller[_0xd9b0('0xf')]);router[_0xd9b0('0x8')](_0xd9b0('0x10'),auth['isAuthenticated'](),controller[_0xd9b0('0x11')]);router[_0xd9b0('0x12')]('/',auth['isAuthenticated'](),controller[_0xd9b0('0x13')]);router[_0xd9b0('0x12')](_0xd9b0('0xe'),auth[_0xd9b0('0x9')](),controller[_0xd9b0('0x14')]);router[_0xd9b0('0x12')]('/:id/users',auth[_0xd9b0('0x9')](),controller['addAgents']);router[_0xd9b0('0x15')](_0xd9b0('0xd'),auth[_0xd9b0('0x9')](),controller[_0xd9b0('0x16')]);router[_0xd9b0('0x17')](_0xd9b0('0xd'),auth[_0xd9b0('0x9')](),controller['destroy']);router[_0xd9b0('0x17')](_0xd9b0('0xe'),auth[_0xd9b0('0x9')](),controller[_0xd9b0('0x18')]);router[_0xd9b0('0x17')](_0xd9b0('0x10'),auth[_0xd9b0('0x9')](),controller['removeAgents']);module[_0xd9b0('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index d7e78c5..4248bd2 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 _0x6012=['moment','sequelize','exports','STRING','DATE'];(function(_0x77fd25,_0x226ea2){var _0xe14528=function(_0x1551d5){while(--_0x1551d5){_0x77fd25['push'](_0x77fd25['shift']());}};_0xe14528(++_0x226ea2);}(_0x6012,0xeb));var _0x2601=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0x6012[_0x1f7996];return _0x584609;};'use strict';var moment=require(_0x2601('0x0'));var Sequelize=require(_0x2601('0x1'));module[_0x2601('0x2')]={'uniqueid':{'type':Sequelize[_0x2601('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2601('0x3')]},'joinAt':{'type':Sequelize[_0x2601('0x4')]},'leaveAt':{'type':Sequelize[_0x2601('0x4')]},'acceptAt':{'type':Sequelize[_0x2601('0x4')]},'exitAt':{'type':Sequelize[_0x2601('0x4')]},'reason':{'type':Sequelize[_0x2601('0x3')]}}; \ No newline at end of file +var _0x757a=['STRING','DATE','moment','sequelize','exports'];(function(_0xc5cada,_0x3a89f9){var _0x1ed4f2=function(_0x3ce1b7){while(--_0x3ce1b7){_0xc5cada['push'](_0xc5cada['shift']());}};_0x1ed4f2(++_0x3a89f9);}(_0x757a,0x110));var _0xa757=function(_0x30df28,_0x311588){_0x30df28=_0x30df28-0x0;var _0x395f66=_0x757a[_0x30df28];return _0x395f66;};'use strict';var moment=require(_0xa757('0x0'));var Sequelize=require(_0xa757('0x1'));module[_0xa757('0x2')]={'uniqueid':{'type':Sequelize[_0xa757('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa757('0x3')]},'joinAt':{'type':Sequelize[_0xa757('0x4')]},'leaveAt':{'type':Sequelize[_0xa757('0x4')]},'acceptAt':{'type':Sequelize[_0xa757('0x4')]},'exitAt':{'type':Sequelize[_0xa757('0x4')]},'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 4c0eee7..16f34f8 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 _0x0bb5=['attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','merge','where','VIRTUAL','options','findAll','show','params','rawAttributes','includeAll','include','find','catch','create','body','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','map','FaxQueueReport','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x50d195,_0x2e1724){var _0x39fc0=function(_0x25ed2d){while(--_0x25ed2d){_0x50d195['push'](_0x50d195['shift']());}};_0x39fc0(++_0x2e1724);}(_0x0bb5,0x148));var _0x50bb=function(_0xf01535,_0xba5a8c){_0xf01535=_0xf01535-0x0;var _0x1738d3=_0x0bb5[_0xf01535];return _0x1738d3;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226370,_0x58837d){_0x58837d=_0x58837d||0xcc;return function(_0x283f04){if(_0x283f04){return _0x226370[_0x50bb('0x19')](_0x58837d);}return _0x226370[_0x50bb('0x1a')](_0x58837d)['end']();};}function respondWithResult(_0x17007f,_0x309986){_0x309986=_0x309986||0xc8;return function(_0x3094f2){if(_0x3094f2){return _0x17007f['status'](_0x309986)[_0x50bb('0x1b')](_0x3094f2);}};}function respondWithFilteredResult(_0x5e8478,_0x21befa){return function(_0x3e1a51){if(_0x3e1a51){var _0x253073=typeof _0x21befa[_0x50bb('0x1c')]===_0x50bb('0x1d')&&typeof _0x21befa['limit']===_0x50bb('0x1d');var _0x174065=_0x3e1a51['count'];var _0x24ba19=_0x253073?0x0:_0x21befa['offset'];var _0x301f61=_0x253073?_0x3e1a51[_0x50bb('0x1e')]:_0x21befa['offset']+_0x21befa['limit'];var _0x43465b;if(_0x301f61>=_0x174065){_0x301f61=_0x174065;_0x43465b=0xc8;}else{_0x43465b=0xce;}_0x5e8478[_0x50bb('0x1a')](_0x43465b);return _0x5e8478[_0x50bb('0x1f')](_0x50bb('0x20'),_0x24ba19+'-'+_0x301f61+'/'+_0x174065)['json'](_0x3e1a51);}return null;};}function patchUpdates(_0x19dc5d){return function(_0x32bfc3){try{jsonpatch[_0x50bb('0x21')](_0x32bfc3,_0x19dc5d,!![]);}catch(_0x597e95){return BPromise[_0x50bb('0x22')](_0x597e95);}return _0x32bfc3[_0x50bb('0x23')]();};}function saveUpdates(_0x1344ec,_0x4825f8){return function(_0x1dbba2){if(_0x1dbba2){return _0x1dbba2['update'](_0x1344ec)[_0x50bb('0x24')](function(_0x3391da){return _0x3391da;});}return null;};}function removeEntity(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(_0x846311){return _0x846311[_0x50bb('0x25')]()['then'](function(){_0x1a2a0b[_0x50bb('0x1a')](0xcc)[_0x50bb('0x26')]();});}};}function handleEntityNotFound(_0x284a76,_0x3462c1){return function(_0x5234d7){if(!_0x5234d7){_0x284a76[_0x50bb('0x19')](0x194);}return _0x5234d7;};}function handleError(_0x4d38f7,_0x55e87b){_0x55e87b=_0x55e87b||0x1f4;return function(_0x2befd9){logger['error'](_0x2befd9['stack']);if(_0x2befd9[_0x50bb('0x27')]){delete _0x2befd9[_0x50bb('0x27')];}_0x4d38f7[_0x50bb('0x1a')](_0x55e87b)[_0x50bb('0x28')](_0x2befd9);};}exports[_0x50bb('0x29')]=function(_0x269479,_0x41a8ad){var _0x41d479={},_0x4f7514={},_0x44ce86={'count':0x0,'rows':[]};var _0x461cf3=_[_0x50bb('0x2a')](db[_0x50bb('0x2b')]['rawAttributes'],function(_0x13dc3c){return{'name':_0x13dc3c[_0x50bb('0x2c')],'type':_0x13dc3c[_0x50bb('0x2d')][_0x50bb('0x2e')]};});_0x4f7514[_0x50bb('0x2f')]=_[_0x50bb('0x2a')](_0x461cf3,_0x50bb('0x27'));_0x4f7514[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x269479[_0x50bb('0x30')]);_0x4f7514[_0x50bb('0x32')]=_[_0x50bb('0x33')](_0x4f7514['model'],_0x4f7514[_0x50bb('0x30')]);_0x41d479[_0x50bb('0x34')]=_[_0x50bb('0x33')](_0x4f7514[_0x50bb('0x2f')],qs[_0x50bb('0x35')](_0x269479[_0x50bb('0x30')][_0x50bb('0x35')]));_0x41d479[_0x50bb('0x34')]=_0x41d479[_0x50bb('0x34')][_0x50bb('0x36')]?_0x41d479[_0x50bb('0x34')]:_0x4f7514['model'];if(!_0x269479[_0x50bb('0x30')][_0x50bb('0x37')](_0x50bb('0x38'))){_0x41d479[_0x50bb('0x39')]=qs[_0x50bb('0x39')](_0x269479[_0x50bb('0x30')]['limit']);_0x41d479['offset']=qs[_0x50bb('0x1c')](_0x269479['query'][_0x50bb('0x1c')]);}_0x41d479[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x269479[_0x50bb('0x30')][_0x50bb('0x3b')]);_0x41d479['where']=qs[_0x50bb('0x32')](_['pick'](_0x269479[_0x50bb('0x30')],_0x4f7514[_0x50bb('0x32')]),_0x461cf3);if(_0x269479[_0x50bb('0x30')]['filter']){_0x41d479['where']=_[_0x50bb('0x3c')](_0x41d479[_0x50bb('0x3d')],{'$or':_[_0x50bb('0x2a')](_0x461cf3,function(_0x21a180){if(_0x21a180['type']!==_0x50bb('0x3e')){var _0x4b75dc={};_0x4b75dc[_0x21a180['name']]={'$like':'%'+_0x269479[_0x50bb('0x30')]['filter']+'%'};return _0x4b75dc;}})});}_0x41d479=_[_0x50bb('0x3c')]({},_0x41d479,_0x269479[_0x50bb('0x3f')]);var _0x1ef231={'where':_0x41d479[_0x50bb('0x3d')]};return db[_0x50bb('0x2b')][_0x50bb('0x1e')](_0x1ef231)[_0x50bb('0x24')](function(_0x1cf782){_0x44ce86[_0x50bb('0x1e')]=_0x1cf782;if(_0x269479[_0x50bb('0x30')]['includeAll']){_0x41d479['include']=[{'all':!![]}];}return db[_0x50bb('0x2b')][_0x50bb('0x40')](_0x41d479);})[_0x50bb('0x24')](function(_0x1d929d){_0x44ce86['rows']=_0x1d929d;return _0x44ce86;})[_0x50bb('0x24')](respondWithFilteredResult(_0x41a8ad,_0x41d479))['catch'](handleError(_0x41a8ad,null));};exports[_0x50bb('0x41')]=function(_0x473a4c,_0x379944){var _0x40748d={'raw':!![],'where':{'id':_0x473a4c[_0x50bb('0x42')]['id']}},_0x1c438b={};_0x1c438b[_0x50bb('0x2f')]=_[_0x50bb('0x31')](db[_0x50bb('0x2b')][_0x50bb('0x43')]);_0x1c438b[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x473a4c[_0x50bb('0x30')]);_0x1c438b[_0x50bb('0x32')]=_[_0x50bb('0x33')](_0x1c438b[_0x50bb('0x2f')],_0x1c438b['query']);_0x40748d[_0x50bb('0x34')]=_['intersection'](_0x1c438b[_0x50bb('0x2f')],qs[_0x50bb('0x35')](_0x473a4c[_0x50bb('0x30')][_0x50bb('0x35')]));_0x40748d[_0x50bb('0x34')]=_0x40748d[_0x50bb('0x34')][_0x50bb('0x36')]?_0x40748d[_0x50bb('0x34')]:_0x1c438b[_0x50bb('0x2f')];if(_0x473a4c[_0x50bb('0x30')][_0x50bb('0x44')]){_0x40748d[_0x50bb('0x45')]=[{'all':!![]}];}_0x40748d=_[_0x50bb('0x3c')]({},_0x40748d,_0x473a4c[_0x50bb('0x3f')]);return db['FaxQueueReport'][_0x50bb('0x46')](_0x40748d)['then'](handleEntityNotFound(_0x379944,null))[_0x50bb('0x24')](respondWithResult(_0x379944,null))[_0x50bb('0x47')](handleError(_0x379944,null));};exports[_0x50bb('0x48')]=function(_0x35b440,_0x650e91){return db[_0x50bb('0x2b')][_0x50bb('0x48')](_0x35b440[_0x50bb('0x49')],{})['then'](respondWithResult(_0x650e91,0xc9))[_0x50bb('0x47')](handleError(_0x650e91,null));};exports[_0x50bb('0x4a')]=function(_0xf52a22,_0x13afe2){if(_0xf52a22[_0x50bb('0x49')]['id']){delete _0xf52a22['body']['id'];}return db[_0x50bb('0x2b')][_0x50bb('0x46')]({'where':{'id':_0xf52a22[_0x50bb('0x42')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x13afe2,null))[_0x50bb('0x24')](saveUpdates(_0xf52a22['body'],null))['then'](respondWithResult(_0x13afe2,null))[_0x50bb('0x47')](handleError(_0x13afe2,null));};exports['destroy']=function(_0x357d08,_0x57ee0e){return db[_0x50bb('0x2b')][_0x50bb('0x46')]({'where':{'id':_0x357d08[_0x50bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x57ee0e,null))[_0x50bb('0x24')](removeEntity(_0x57ee0e,null))[_0x50bb('0x47')](handleError(_0x57ee0e,null));};exports['describe']=function(_0x184147,_0x1dff6a){return db[_0x50bb('0x2b')][_0x50bb('0x4b')]()['then'](respondWithResult(_0x1dff6a,null))[_0x50bb('0x47')](handleError(_0x1dff6a,null));}; \ No newline at end of file +var _0x9b87=['ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','type','options','FaxQueueReport','includeAll','include','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3b5d45,_0x597509){var _0x3cbc78=function(_0x667d99){while(--_0x667d99){_0x3b5d45['push'](_0x3b5d45['shift']());}};_0x3cbc78(++_0x597509);}(_0x9b87,0x8e));var _0x79b8=function(_0x3fb6f6,_0xd598d5){_0x3fb6f6=_0x3fb6f6-0x0;var _0xd7ba73=_0x9b87[_0x3fb6f6];return _0xd7ba73;};'use strict';var emlformat=require(_0x79b8('0x0'));var rimraf=require(_0x79b8('0x1'));var zipdir=require(_0x79b8('0x2'));var jsonpatch=require(_0x79b8('0x3'));var rp=require(_0x79b8('0x4'));var moment=require(_0x79b8('0x5'));var BPromise=require(_0x79b8('0x6'));var Mustache=require(_0x79b8('0x7'));var util=require(_0x79b8('0x8'));var path=require(_0x79b8('0x9'));var sox=require(_0x79b8('0xa'));var csv=require(_0x79b8('0xb'));var ejs=require(_0x79b8('0xc'));var fs=require('fs');var fs_extra=require(_0x79b8('0xd'));var _=require(_0x79b8('0xe'));var squel=require(_0x79b8('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x79b8('0x10'));var Papa=require(_0x79b8('0x11'));var Redis=require(_0x79b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x79b8('0x13'));var as=require(_0x79b8('0x14'));var hardwareService=require(_0x79b8('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x79b8('0x16'));var config=require(_0x79b8('0x17'));var licenseUtil=require(_0x79b8('0x18'));var db=require(_0x79b8('0x19'))['db'];function respondWithStatusCode(_0x21ad20,_0x33227b){_0x33227b=_0x33227b||0xcc;return function(_0x41095c){if(_0x41095c){return _0x21ad20[_0x79b8('0x1a')](_0x33227b);}return _0x21ad20[_0x79b8('0x1b')](_0x33227b)[_0x79b8('0x1c')]();};}function respondWithResult(_0x43ec09,_0x59e229){_0x59e229=_0x59e229||0xc8;return function(_0x150fb7){if(_0x150fb7){return _0x43ec09['status'](_0x59e229)['json'](_0x150fb7);}};}function respondWithFilteredResult(_0x3142e9,_0x21aae0){return function(_0x57a248){if(_0x57a248){var _0x5ddab5=typeof _0x21aae0[_0x79b8('0x1d')]==='undefined'&&typeof _0x21aae0['limit']===_0x79b8('0x1e');var _0x24c02f=_0x57a248[_0x79b8('0x1f')];var _0x2ae2d5=_0x5ddab5?0x0:_0x21aae0[_0x79b8('0x1d')];var _0x23d771=_0x5ddab5?_0x57a248['count']:_0x21aae0[_0x79b8('0x1d')]+_0x21aae0['limit'];var _0x53d386;if(_0x23d771>=_0x24c02f){_0x23d771=_0x24c02f;_0x53d386=0xc8;}else{_0x53d386=0xce;}_0x3142e9[_0x79b8('0x1b')](_0x53d386);return _0x3142e9[_0x79b8('0x20')](_0x79b8('0x21'),_0x2ae2d5+'-'+_0x23d771+'/'+_0x24c02f)[_0x79b8('0x22')](_0x57a248);}return null;};}function patchUpdates(_0x1e24cf){return function(_0x1e7507){try{jsonpatch[_0x79b8('0x23')](_0x1e7507,_0x1e24cf,!![]);}catch(_0x261c48){return BPromise[_0x79b8('0x24')](_0x261c48);}return _0x1e7507['save']();};}function saveUpdates(_0x3e9d83,_0x255207){return function(_0x4dbfcf){if(_0x4dbfcf){return _0x4dbfcf[_0x79b8('0x25')](_0x3e9d83)[_0x79b8('0x26')](function(_0x54c605){return _0x54c605;});}return null;};}function removeEntity(_0x28be4b,_0x4f543f){return function(_0x5e8228){if(_0x5e8228){return _0x5e8228[_0x79b8('0x27')]()[_0x79b8('0x26')](function(){_0x28be4b[_0x79b8('0x1b')](0xcc)[_0x79b8('0x1c')]();});}};}function handleEntityNotFound(_0x9deb6c,_0x4cd38b){return function(_0x35db24){if(!_0x35db24){_0x9deb6c[_0x79b8('0x1a')](0x194);}return _0x35db24;};}function handleError(_0x1e84f3,_0x3ba5ac){_0x3ba5ac=_0x3ba5ac||0x1f4;return function(_0x4bbbf8){logger[_0x79b8('0x28')](_0x4bbbf8[_0x79b8('0x29')]);if(_0x4bbbf8[_0x79b8('0x2a')]){delete _0x4bbbf8['name'];}_0x1e84f3[_0x79b8('0x1b')](_0x3ba5ac)[_0x79b8('0x2b')](_0x4bbbf8);};}exports[_0x79b8('0x2c')]=function(_0x2942e9,_0x3662aa){var _0x23483f={},_0x4f51d1={},_0x434ecd={'count':0x0,'rows':[]};var _0x5a24fd=_[_0x79b8('0x2d')](db['FaxQueueReport'][_0x79b8('0x2e')],function(_0x1090d2){return{'name':_0x1090d2[_0x79b8('0x2f')],'type':_0x1090d2['type'][_0x79b8('0x30')]};});_0x4f51d1[_0x79b8('0x31')]=_[_0x79b8('0x2d')](_0x5a24fd,_0x79b8('0x2a'));_0x4f51d1['query']=_[_0x79b8('0x32')](_0x2942e9['query']);_0x4f51d1['filters']=_[_0x79b8('0x33')](_0x4f51d1[_0x79b8('0x31')],_0x4f51d1['query']);_0x23483f[_0x79b8('0x34')]=_['intersection'](_0x4f51d1['model'],qs[_0x79b8('0x35')](_0x2942e9['query'][_0x79b8('0x35')]));_0x23483f[_0x79b8('0x34')]=_0x23483f['attributes'][_0x79b8('0x36')]?_0x23483f[_0x79b8('0x34')]:_0x4f51d1[_0x79b8('0x31')];if(!_0x2942e9[_0x79b8('0x37')][_0x79b8('0x38')](_0x79b8('0x39'))){_0x23483f['limit']=qs[_0x79b8('0x3a')](_0x2942e9[_0x79b8('0x37')][_0x79b8('0x3a')]);_0x23483f[_0x79b8('0x1d')]=qs[_0x79b8('0x1d')](_0x2942e9[_0x79b8('0x37')][_0x79b8('0x1d')]);}_0x23483f[_0x79b8('0x3b')]=qs[_0x79b8('0x3c')](_0x2942e9[_0x79b8('0x37')][_0x79b8('0x3c')]);_0x23483f['where']=qs[_0x79b8('0x3d')](_[_0x79b8('0x3e')](_0x2942e9[_0x79b8('0x37')],_0x4f51d1['filters']),_0x5a24fd);if(_0x2942e9[_0x79b8('0x37')][_0x79b8('0x3f')]){_0x23483f[_0x79b8('0x40')]=_[_0x79b8('0x41')](_0x23483f[_0x79b8('0x40')],{'$or':_[_0x79b8('0x2d')](_0x5a24fd,function(_0x4b6248){if(_0x4b6248[_0x79b8('0x42')]!=='VIRTUAL'){var _0x512d04={};_0x512d04[_0x4b6248[_0x79b8('0x2a')]]={'$like':'%'+_0x2942e9['query']['filter']+'%'};return _0x512d04;}})});}_0x23483f=_[_0x79b8('0x41')]({},_0x23483f,_0x2942e9[_0x79b8('0x43')]);var _0x422c56={'where':_0x23483f[_0x79b8('0x40')]};return db[_0x79b8('0x44')][_0x79b8('0x1f')](_0x422c56)[_0x79b8('0x26')](function(_0x2aac60){_0x434ecd[_0x79b8('0x1f')]=_0x2aac60;if(_0x2942e9[_0x79b8('0x37')][_0x79b8('0x45')]){_0x23483f[_0x79b8('0x46')]=[{'all':!![]}];}return db[_0x79b8('0x44')]['findAll'](_0x23483f);})[_0x79b8('0x26')](function(_0x13b041){_0x434ecd['rows']=_0x13b041;return _0x434ecd;})[_0x79b8('0x26')](respondWithFilteredResult(_0x3662aa,_0x23483f))[_0x79b8('0x47')](handleError(_0x3662aa,null));};exports['show']=function(_0x17dd9e,_0x62a011){var _0x2ddad8={'raw':!![],'where':{'id':_0x17dd9e[_0x79b8('0x48')]['id']}},_0x28d4e4={};_0x28d4e4[_0x79b8('0x31')]=_[_0x79b8('0x32')](db[_0x79b8('0x44')][_0x79b8('0x2e')]);_0x28d4e4[_0x79b8('0x37')]=_[_0x79b8('0x32')](_0x17dd9e[_0x79b8('0x37')]);_0x28d4e4['filters']=_['intersection'](_0x28d4e4[_0x79b8('0x31')],_0x28d4e4[_0x79b8('0x37')]);_0x2ddad8[_0x79b8('0x34')]=_[_0x79b8('0x33')](_0x28d4e4['model'],qs[_0x79b8('0x35')](_0x17dd9e[_0x79b8('0x37')][_0x79b8('0x35')]));_0x2ddad8[_0x79b8('0x34')]=_0x2ddad8['attributes'][_0x79b8('0x36')]?_0x2ddad8[_0x79b8('0x34')]:_0x28d4e4[_0x79b8('0x31')];if(_0x17dd9e[_0x79b8('0x37')]['includeAll']){_0x2ddad8[_0x79b8('0x46')]=[{'all':!![]}];}_0x2ddad8=_[_0x79b8('0x41')]({},_0x2ddad8,_0x17dd9e[_0x79b8('0x43')]);return db[_0x79b8('0x44')][_0x79b8('0x49')](_0x2ddad8)[_0x79b8('0x26')](handleEntityNotFound(_0x62a011,null))['then'](respondWithResult(_0x62a011,null))[_0x79b8('0x47')](handleError(_0x62a011,null));};exports[_0x79b8('0x4a')]=function(_0x330051,_0xc89e93){return db['FaxQueueReport']['create'](_0x330051[_0x79b8('0x4b')],{})[_0x79b8('0x26')](respondWithResult(_0xc89e93,0xc9))[_0x79b8('0x47')](handleError(_0xc89e93,null));};exports[_0x79b8('0x25')]=function(_0x32e7ea,_0x19272d){if(_0x32e7ea[_0x79b8('0x4b')]['id']){delete _0x32e7ea[_0x79b8('0x4b')]['id'];}return db[_0x79b8('0x44')]['find']({'where':{'id':_0x32e7ea[_0x79b8('0x48')]['id']}})[_0x79b8('0x26')](handleEntityNotFound(_0x19272d,null))[_0x79b8('0x26')](saveUpdates(_0x32e7ea['body'],null))[_0x79b8('0x26')](respondWithResult(_0x19272d,null))['catch'](handleError(_0x19272d,null));};exports['destroy']=function(_0x24ebb2,_0x252c2c){return db[_0x79b8('0x44')][_0x79b8('0x49')]({'where':{'id':_0x24ebb2['params']['id']}})['then'](handleEntityNotFound(_0x252c2c,null))[_0x79b8('0x26')](removeEntity(_0x252c2c,null))[_0x79b8('0x47')](handleError(_0x252c2c,null));};exports[_0x79b8('0x4c')]=function(_0x43f401,_0x2ff973){return db[_0x79b8('0x44')][_0x79b8('0x4c')]()[_0x79b8('0x26')](respondWithResult(_0x2ff973,null))[_0x79b8('0x47')](handleError(_0x2ff973,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index fd82ee4..2b7ce42 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 _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x29b3b3,_0x51f818){var _0xd055d0=function(_0x4ef2c4){while(--_0x4ef2c4){_0x29b3b3['push'](_0x29b3b3['shift']());}};_0xd055d0(++_0x51f818);}(_0x4975,0x86));var _0x5497=function(_0x40848d,_0x38a0ef){_0x40848d=_0x40848d-0x0;var _0x4e486a=_0x4975[_0x40848d];return _0x4e486a;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x42bdbc,_0x1a8d14){var _0x404ab6=function(_0x15ce6a){while(--_0x15ce6a){_0x42bdbc['push'](_0x42bdbc['shift']());}};_0x404ab6(++_0x1a8d14);}(_0xf494,0x1c6));var _0x4f49=function(_0x57efa6,_0x4f6d2d){_0x57efa6=_0x57efa6-0x0;var _0x1e18d0=_0xf494[_0x57efa6];return _0x1e18d0;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 0257227..6866634 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 _0x7471=['code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','debug','UpdateFaxQueueReport','where','attributes','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FaxQueueReport,\x20%s,\x20%s','request\x20sent','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7471,0xbb));var _0x1747=function(_0x2faeae,_0x2f7aa4){_0x2faeae=_0x2faeae-0x0;var _0xf0b909=_0x7471[_0x2faeae];return _0xf0b909;};'use strict';var _=require(_0x1747('0x0'));var util=require(_0x1747('0x1'));var moment=require(_0x1747('0x2'));var BPromise=require(_0x1747('0x3'));var rs=require(_0x1747('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1747('0x5'))['db'];var utils=require(_0x1747('0x6'));var logger=require(_0x1747('0x7'))(_0x1747('0x8'));var config=require(_0x1747('0x9'));var jayson=require(_0x1747('0xa'));var client=jayson[_0x1747('0xb')][_0x1747('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c6f67,_0x4d57ef,_0xa28510){return new BPromise(function(_0x45647d,_0x602df1){return client[_0x1747('0xd')](_0x3c6f67,_0xa28510)['then'](function(_0x5a44f5){logger['info'](_0x1747('0xe'),_0x4d57ef,_0x1747('0xf'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x4d57ef,_0x1747('0xf'),JSON['stringify'](_0x5a44f5));if(_0x5a44f5[_0x1747('0x10')]){if(_0x5a44f5[_0x1747('0x10')][_0x1747('0x11')]===0x1f4){logger[_0x1747('0x10')](_0x1747('0xe'),_0x4d57ef,_0x5a44f5[_0x1747('0x10')][_0x1747('0x12')]);return _0x602df1(_0x5a44f5[_0x1747('0x10')][_0x1747('0x12')]);}logger[_0x1747('0x10')](_0x1747('0xe'),_0x4d57ef,_0x5a44f5[_0x1747('0x10')][_0x1747('0x12')]);return _0x45647d(_0x5a44f5[_0x1747('0x10')][_0x1747('0x12')]);}else{logger[_0x1747('0x13')](_0x1747('0xe'),_0x4d57ef,_0x1747('0xf'));_0x45647d(_0x5a44f5[_0x1747('0x14')][_0x1747('0x12')]);}})[_0x1747('0x15')](function(_0x193436){logger[_0x1747('0x10')](_0x1747('0xe'),_0x4d57ef,_0x193436);_0x602df1(_0x193436);});});}exports[_0x1747('0x16')]=function(_0x59793f){var _0x315292=this;return new Promise(function(_0x3906c7,_0x352070){return db[_0x1747('0x17')][_0x1747('0x18')](_0x59793f[_0x1747('0x19')],{'raw':_0x59793f['options']?_0x59793f[_0x1747('0x1a')][_0x1747('0x1b')]===undefined?!![]:![]:!![]})[_0x1747('0x1c')](function(_0x4eec27){logger[_0x1747('0x13')](_0x1747('0x16'),_0x59793f);logger[_0x1747('0x1d')](_0x1747('0x16'),_0x59793f,JSON['stringify'](_0x4eec27));_0x3906c7(_0x4eec27);})[_0x1747('0x15')](function(_0x1e4c30){logger[_0x1747('0x10')](_0x1747('0x16'),_0x1e4c30['message'],_0x59793f);_0x352070(_0x315292['error'](0x1f4,_0x1e4c30[_0x1747('0x12')]));});});};exports[_0x1747('0x1e')]=function(_0xde55d6){var _0x3f4350=this;return new Promise(function(_0x21de9f,_0x37dc33){return db['FaxQueueReport']['update'](_0xde55d6['body'],{'raw':_0xde55d6['options']?_0xde55d6['options'][_0x1747('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xde55d6[_0x1747('0x1a')]?_0xde55d6[_0x1747('0x1a')][_0x1747('0x1f')]||null:null,'attributes':_0xde55d6[_0x1747('0x1a')]?_0xde55d6[_0x1747('0x1a')][_0x1747('0x20')]||null:null,'limit':_0xde55d6[_0x1747('0x1a')]?_0xde55d6['options']['limit']||null:null})[_0x1747('0x1c')](function(_0x5bfffd){logger[_0x1747('0x13')](_0x1747('0x1e'),_0xde55d6);logger[_0x1747('0x1d')](_0x1747('0x1e'),_0xde55d6,JSON[_0x1747('0x21')](_0x5bfffd));_0x21de9f(_0x5bfffd);})['catch'](function(_0x36792a){logger[_0x1747('0x10')](_0x1747('0x1e'),_0x36792a[_0x1747('0x12')],_0xde55d6);_0x37dc33(_0x3f4350[_0x1747('0x10')](0x1f4,_0x36792a[_0x1747('0x12')]));});});}; \ No newline at end of file +var _0x7783=['FaxQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x56f187,_0x2eec20){var _0x1b8b67=function(_0x29d013){while(--_0x29d013){_0x56f187['push'](_0x56f187['shift']());}};_0x1b8b67(++_0x2eec20);}(_0x7783,0x1e8));var _0x3778=function(_0x3c6668,_0x386066){_0x3c6668=_0x3c6668-0x0;var _0x1d82e7=_0x7783[_0x3c6668];return _0x1d82e7;};'use strict';var _=require(_0x3778('0x0'));var util=require(_0x3778('0x1'));var moment=require(_0x3778('0x2'));var BPromise=require(_0x3778('0x3'));var rs=require(_0x3778('0x4'));var fs=require('fs');var Redis=require(_0x3778('0x5'));var db=require(_0x3778('0x6'))['db'];var utils=require(_0x3778('0x7'));var logger=require(_0x3778('0x8'))(_0x3778('0x9'));var config=require(_0x3778('0xa'));var jayson=require(_0x3778('0xb'));var client=jayson[_0x3778('0xc')][_0x3778('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3ddeb5,_0x14c3f0,_0x37df1a){return new BPromise(function(_0x9a0655,_0x496358){return client[_0x3778('0xe')](_0x3ddeb5,_0x37df1a)['then'](function(_0x27e773){logger[_0x3778('0xf')](_0x3778('0x10'),_0x14c3f0,'request\x20sent');logger[_0x3778('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x14c3f0,'request\x20sent',JSON[_0x3778('0x12')](_0x27e773));if(_0x27e773[_0x3778('0x13')]){if(_0x27e773[_0x3778('0x13')][_0x3778('0x14')]===0x1f4){logger[_0x3778('0x13')](_0x3778('0x10'),_0x14c3f0,_0x27e773[_0x3778('0x13')]['message']);return _0x496358(_0x27e773[_0x3778('0x13')][_0x3778('0x15')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x14c3f0,_0x27e773['error'][_0x3778('0x15')]);return _0x9a0655(_0x27e773['error'][_0x3778('0x15')]);}else{logger[_0x3778('0xf')](_0x3778('0x10'),_0x14c3f0,_0x3778('0x16'));_0x9a0655(_0x27e773[_0x3778('0x17')][_0x3778('0x15')]);}})[_0x3778('0x18')](function(_0x457efd){logger['error'](_0x3778('0x10'),_0x14c3f0,_0x457efd);_0x496358(_0x457efd);});});}exports[_0x3778('0x19')]=function(_0x5a4064){var _0xc10743=this;return new Promise(function(_0x145868,_0x349f90){return db[_0x3778('0x1a')][_0x3778('0x1b')](_0x5a4064[_0x3778('0x1c')],{'raw':_0x5a4064[_0x3778('0x1d')]?_0x5a4064[_0x3778('0x1d')][_0x3778('0x1e')]===undefined?!![]:![]:!![]})[_0x3778('0x1f')](function(_0x3927d2){logger[_0x3778('0xf')]('CreateFaxQueueReport',_0x5a4064);logger['debug'](_0x3778('0x19'),_0x5a4064,JSON[_0x3778('0x12')](_0x3927d2));_0x145868(_0x3927d2);})['catch'](function(_0x27c7ac){logger[_0x3778('0x13')](_0x3778('0x19'),_0x27c7ac[_0x3778('0x15')],_0x5a4064);_0x349f90(_0xc10743[_0x3778('0x13')](0x1f4,_0x27c7ac[_0x3778('0x15')]));});});};exports[_0x3778('0x20')]=function(_0x180d1d){var _0x30b5a1=this;return new Promise(function(_0x3b51f3,_0x1c3bd8){return db[_0x3778('0x1a')][_0x3778('0x21')](_0x180d1d[_0x3778('0x1c')],{'raw':_0x180d1d[_0x3778('0x1d')]?_0x180d1d[_0x3778('0x1d')][_0x3778('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x180d1d[_0x3778('0x1d')]?_0x180d1d[_0x3778('0x1d')]['where']||null:null,'attributes':_0x180d1d['options']?_0x180d1d[_0x3778('0x1d')][_0x3778('0x22')]||null:null,'limit':_0x180d1d[_0x3778('0x1d')]?_0x180d1d[_0x3778('0x1d')][_0x3778('0x23')]||null:null})[_0x3778('0x1f')](function(_0x2017b0){logger[_0x3778('0xf')]('UpdateFaxQueueReport',_0x180d1d);logger[_0x3778('0x11')](_0x3778('0x20'),_0x180d1d,JSON[_0x3778('0x12')](_0x2017b0));_0x3b51f3(_0x2017b0);})[_0x3778('0x18')](function(_0x157074){logger['error'](_0x3778('0x20'),_0x157074['message'],_0x180d1d);_0x1c3bd8(_0x30b5a1[_0x3778('0x13')](0x1f4,_0x157074[_0x3778('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 26bd968..ded88e9 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 _0x2e2f=['index','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x2fb7ef,_0x4533ac){var _0x4f642b=function(_0x1c787f){while(--_0x1c787f){_0x2fb7ef['push'](_0x2fb7ef['shift']());}};_0x4f642b(++_0x4533ac);}(_0x2e2f,0xc7));var _0xf2e2=function(_0x30a204,_0x48370f){_0x30a204=_0x30a204-0x0;var _0x1a1350=_0x2e2f[_0x30a204];return _0x1a1350;};'use strict';var multer=require(_0xf2e2('0x0'));var util=require('util');var path=require(_0xf2e2('0x1'));var timeout=require(_0xf2e2('0x2'));var express=require(_0xf2e2('0x3'));var router=express[_0xf2e2('0x4')]();var fs_extra=require(_0xf2e2('0x5'));var auth=require(_0xf2e2('0x6'));var interaction=require(_0xf2e2('0x7'));var config=require('../../config/environment');var controller=require(_0xf2e2('0x8'));router[_0xf2e2('0x9')]('/',auth[_0xf2e2('0xa')](),controller[_0xf2e2('0xb')]);router[_0xf2e2('0x9')](_0xf2e2('0xc'),auth[_0xf2e2('0xa')](),controller['describe']);router['get'](_0xf2e2('0xd'),auth['isAuthenticated'](),controller[_0xf2e2('0xe')]);router[_0xf2e2('0xf')]('/',auth[_0xf2e2('0xa')](),controller[_0xf2e2('0x10')]);router[_0xf2e2('0x11')](_0xf2e2('0xd'),auth[_0xf2e2('0xa')](),controller['update']);router[_0xf2e2('0x12')](_0xf2e2('0xd'),auth[_0xf2e2('0xa')](),controller[_0xf2e2('0x13')]);module[_0xf2e2('0x14')]=router; \ No newline at end of file +var _0xe3e4=['index','/describe','describe','create','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x43c0f9,_0x2084f2){var _0x392fbe=function(_0x4913e3){while(--_0x4913e3){_0x43c0f9['push'](_0x43c0f9['shift']());}};_0x392fbe(++_0x2084f2);}(_0xe3e4,0x113));var _0x4e3e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe3e4[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4e3e('0x0'));var util=require(_0x4e3e('0x1'));var path=require(_0x4e3e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e3e('0x3')]();var fs_extra=require(_0x4e3e('0x4'));var auth=require(_0x4e3e('0x5'));var interaction=require(_0x4e3e('0x6'));var config=require('../../config/environment');var controller=require(_0x4e3e('0x7'));router[_0x4e3e('0x8')]('/',auth[_0x4e3e('0x9')](),controller[_0x4e3e('0xa')]);router[_0x4e3e('0x8')](_0x4e3e('0xb'),auth['isAuthenticated'](),controller[_0x4e3e('0xc')]);router['get']('/:id',auth[_0x4e3e('0x9')](),controller['show']);router['post']('/',auth[_0x4e3e('0x9')](),controller[_0x4e3e('0xd')]);router['put'](_0x4e3e('0xe'),auth['isAuthenticated'](),controller[_0x4e3e('0xf')]);router[_0x4e3e('0x10')](_0x4e3e('0xe'),auth['isAuthenticated'](),controller[_0x4e3e('0x11')]);module[_0x4e3e('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 5d4af42..368a0f4 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3b187a,_0xfc59af){var _0x1eb538=function(_0x8317ff){while(--_0x8317ff){_0x3b187a['push'](_0x3b187a['shift']());}};_0x1eb538(++_0xfc59af);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xcb91[_0x3712e2];return _0x1faff4;};'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 +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x55418e,_0x3fe1fc){var _0x634190=function(_0x221b38){while(--_0x221b38){_0x55418e['push'](_0x55418e['shift']());}};_0x634190(++_0x3fe1fc);}(_0x008c,0x188));var _0xc008=function(_0x2b18c9,_0x49659f){_0x2b18c9=_0x2b18c9-0x0;var _0x8b913c=_0x008c[_0x2b18c9];return _0x8b913c;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 1d4884d..d6da235 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 _0xd885=['pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','length','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FaxTransferReport','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','limit','offset','order','sort'];(function(_0x2e61f2,_0x11e6dd){var _0x286372=function(_0x18ce0c){while(--_0x18ce0c){_0x2e61f2['push'](_0x2e61f2['shift']());}};_0x286372(++_0x11e6dd);}(_0xd885,0x145));var _0x5d88=function(_0x152ff3,_0x4207ef){_0x152ff3=_0x152ff3-0x0;var _0x12a4c0=_0xd885[_0x152ff3];return _0x12a4c0;};'use strict';var emlformat=require(_0x5d88('0x0'));var rimraf=require(_0x5d88('0x1'));var zipdir=require(_0x5d88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5d88('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5d88('0x4'));var util=require(_0x5d88('0x5'));var path=require(_0x5d88('0x6'));var sox=require(_0x5d88('0x7'));var csv=require(_0x5d88('0x8'));var ejs=require(_0x5d88('0x9'));var fs=require('fs');var fs_extra=require(_0x5d88('0xa'));var _=require(_0x5d88('0xb'));var squel=require(_0x5d88('0xc'));var crypto=require('crypto');var jsforce=require(_0x5d88('0xd'));var deskjs=require(_0x5d88('0xe'));var toCsv=require(_0x5d88('0x8'));var querystring=require('querystring');var Papa=require(_0x5d88('0xf'));var Redis=require(_0x5d88('0x10'));var authService=require(_0x5d88('0x11'));var qs=require(_0x5d88('0x12'));var as=require(_0x5d88('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d88('0x14'))(_0x5d88('0x15'));var utils=require(_0x5d88('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5d88('0x17'));var db=require(_0x5d88('0x18'))['db'];function respondWithStatusCode(_0xc147a2,_0x54b848){_0x54b848=_0x54b848||0xcc;return function(_0x1b6730){if(_0x1b6730){return _0xc147a2[_0x5d88('0x19')](_0x54b848);}return _0xc147a2[_0x5d88('0x1a')](_0x54b848)[_0x5d88('0x1b')]();};}function respondWithResult(_0x11e1b6,_0x8162a0){_0x8162a0=_0x8162a0||0xc8;return function(_0x4d8a31){if(_0x4d8a31){return _0x11e1b6['status'](_0x8162a0)[_0x5d88('0x1c')](_0x4d8a31);}};}function respondWithFilteredResult(_0x30ded3,_0x494940){return function(_0xdc822a){if(_0xdc822a){var _0x1dc50b=typeof _0x494940['offset']===_0x5d88('0x1d')&&typeof _0x494940['limit']===_0x5d88('0x1d');var _0x1eea4a=_0xdc822a[_0x5d88('0x1e')];var _0x2978fc=_0x1dc50b?0x0:_0x494940['offset'];var _0x3e41f7=_0x1dc50b?_0xdc822a['count']:_0x494940['offset']+_0x494940['limit'];var _0x400a0b;if(_0x3e41f7>=_0x1eea4a){_0x3e41f7=_0x1eea4a;_0x400a0b=0xc8;}else{_0x400a0b=0xce;}_0x30ded3['status'](_0x400a0b);return _0x30ded3[_0x5d88('0x1f')](_0x5d88('0x20'),_0x2978fc+'-'+_0x3e41f7+'/'+_0x1eea4a)['json'](_0xdc822a);}return null;};}function patchUpdates(_0x2ce8d0){return function(_0x1f6df2){try{jsonpatch[_0x5d88('0x21')](_0x1f6df2,_0x2ce8d0,!![]);}catch(_0x15175e){return BPromise[_0x5d88('0x22')](_0x15175e);}return _0x1f6df2[_0x5d88('0x23')]();};}function saveUpdates(_0x31bc88,_0x560f3f){return function(_0x344f7d){if(_0x344f7d){return _0x344f7d['update'](_0x31bc88)[_0x5d88('0x24')](function(_0xf34f81){return _0xf34f81;});}return null;};}function removeEntity(_0x10c208,_0x5ecc12){return function(_0x5d1cdb){if(_0x5d1cdb){return _0x5d1cdb[_0x5d88('0x25')]()['then'](function(){_0x10c208['status'](0xcc)[_0x5d88('0x1b')]();});}};}function handleEntityNotFound(_0x47e17d,_0x59d730){return function(_0x59e271){if(!_0x59e271){_0x47e17d[_0x5d88('0x19')](0x194);}return _0x59e271;};}function handleError(_0xd6a5f,_0x2b8863){_0x2b8863=_0x2b8863||0x1f4;return function(_0x2e65be){logger[_0x5d88('0x26')](_0x2e65be[_0x5d88('0x27')]);if(_0x2e65be[_0x5d88('0x28')]){delete _0x2e65be[_0x5d88('0x28')];}_0xd6a5f[_0x5d88('0x1a')](_0x2b8863)[_0x5d88('0x29')](_0x2e65be);};}exports[_0x5d88('0x2a')]=function(_0x49af7c,_0x3a2bfd){var _0x4be172={},_0x17eaa5={},_0x398d2b={'count':0x0,'rows':[]};var _0x56488a=_[_0x5d88('0x2b')](db[_0x5d88('0x2c')]['rawAttributes'],function(_0x6aff07){return{'name':_0x6aff07[_0x5d88('0x2d')],'type':_0x6aff07[_0x5d88('0x2e')][_0x5d88('0x2f')]};});_0x17eaa5['model']=_['map'](_0x56488a,'name');_0x17eaa5['query']=_[_0x5d88('0x30')](_0x49af7c['query']);_0x17eaa5[_0x5d88('0x31')]=_[_0x5d88('0x32')](_0x17eaa5[_0x5d88('0x33')],_0x17eaa5[_0x5d88('0x34')]);_0x4be172[_0x5d88('0x35')]=_[_0x5d88('0x32')](_0x17eaa5['model'],qs[_0x5d88('0x36')](_0x49af7c[_0x5d88('0x34')][_0x5d88('0x36')]));_0x4be172[_0x5d88('0x35')]=_0x4be172[_0x5d88('0x35')]['length']?_0x4be172[_0x5d88('0x35')]:_0x17eaa5['model'];if(!_0x49af7c[_0x5d88('0x34')][_0x5d88('0x37')]('nolimit')){_0x4be172[_0x5d88('0x38')]=qs['limit'](_0x49af7c[_0x5d88('0x34')]['limit']);_0x4be172[_0x5d88('0x39')]=qs[_0x5d88('0x39')](_0x49af7c[_0x5d88('0x34')][_0x5d88('0x39')]);}_0x4be172[_0x5d88('0x3a')]=qs['sort'](_0x49af7c[_0x5d88('0x34')][_0x5d88('0x3b')]);_0x4be172['where']=qs[_0x5d88('0x31')](_[_0x5d88('0x3c')](_0x49af7c[_0x5d88('0x34')],_0x17eaa5['filters']),_0x56488a);if(_0x49af7c[_0x5d88('0x34')]['filter']){_0x4be172[_0x5d88('0x3d')]=_[_0x5d88('0x3e')](_0x4be172[_0x5d88('0x3d')],{'$or':_[_0x5d88('0x2b')](_0x56488a,function(_0x5b90e0){if(_0x5b90e0[_0x5d88('0x2e')]!==_0x5d88('0x3f')){var _0x27b3c8={};_0x27b3c8[_0x5b90e0['name']]={'$like':'%'+_0x49af7c['query'][_0x5d88('0x40')]+'%'};return _0x27b3c8;}})});}_0x4be172=_[_0x5d88('0x3e')]({},_0x4be172,_0x49af7c['options']);var _0x409fe9={'where':_0x4be172['where']};return db[_0x5d88('0x2c')][_0x5d88('0x1e')](_0x409fe9)[_0x5d88('0x24')](function(_0x334cef){_0x398d2b[_0x5d88('0x1e')]=_0x334cef;if(_0x49af7c[_0x5d88('0x34')][_0x5d88('0x41')]){_0x4be172[_0x5d88('0x42')]=[{'all':!![]}];}return db[_0x5d88('0x2c')][_0x5d88('0x43')](_0x4be172);})[_0x5d88('0x24')](function(_0x248cef){_0x398d2b[_0x5d88('0x44')]=_0x248cef;return _0x398d2b;})[_0x5d88('0x24')](respondWithFilteredResult(_0x3a2bfd,_0x4be172))['catch'](handleError(_0x3a2bfd,null));};exports['show']=function(_0x2a659d,_0x52b308){var _0x1f3655={'raw':!![],'where':{'id':_0x2a659d[_0x5d88('0x45')]['id']}},_0x4dec78={};_0x4dec78[_0x5d88('0x33')]=_['keys'](db[_0x5d88('0x2c')]['rawAttributes']);_0x4dec78[_0x5d88('0x34')]=_[_0x5d88('0x30')](_0x2a659d[_0x5d88('0x34')]);_0x4dec78[_0x5d88('0x31')]=_['intersection'](_0x4dec78['model'],_0x4dec78[_0x5d88('0x34')]);_0x1f3655[_0x5d88('0x35')]=_[_0x5d88('0x32')](_0x4dec78['model'],qs[_0x5d88('0x36')](_0x2a659d[_0x5d88('0x34')]['fields']));_0x1f3655[_0x5d88('0x35')]=_0x1f3655[_0x5d88('0x35')][_0x5d88('0x46')]?_0x1f3655[_0x5d88('0x35')]:_0x4dec78[_0x5d88('0x33')];if(_0x2a659d[_0x5d88('0x34')]['includeAll']){_0x1f3655[_0x5d88('0x42')]=[{'all':!![]}];}_0x1f3655=_[_0x5d88('0x3e')]({},_0x1f3655,_0x2a659d['options']);return db[_0x5d88('0x2c')][_0x5d88('0x47')](_0x1f3655)[_0x5d88('0x24')](handleEntityNotFound(_0x52b308,null))[_0x5d88('0x24')](respondWithResult(_0x52b308,null))[_0x5d88('0x48')](handleError(_0x52b308,null));};exports['create']=function(_0x2f2781,_0x3ce297){return db['FaxTransferReport'][_0x5d88('0x49')](_0x2f2781[_0x5d88('0x4a')],{})[_0x5d88('0x24')](respondWithResult(_0x3ce297,0xc9))[_0x5d88('0x48')](handleError(_0x3ce297,null));};exports[_0x5d88('0x4b')]=function(_0x2db7d0,_0x1c3343){if(_0x2db7d0['body']['id']){delete _0x2db7d0[_0x5d88('0x4a')]['id'];}return db[_0x5d88('0x2c')][_0x5d88('0x47')]({'where':{'id':_0x2db7d0[_0x5d88('0x45')]['id']}})[_0x5d88('0x24')](handleEntityNotFound(_0x1c3343,null))[_0x5d88('0x24')](saveUpdates(_0x2db7d0[_0x5d88('0x4a')],null))['then'](respondWithResult(_0x1c3343,null))[_0x5d88('0x48')](handleError(_0x1c3343,null));};exports[_0x5d88('0x25')]=function(_0x16e2f6,_0x3842a6){return db[_0x5d88('0x2c')][_0x5d88('0x47')]({'where':{'id':_0x16e2f6[_0x5d88('0x45')]['id']}})[_0x5d88('0x24')](handleEntityNotFound(_0x3842a6,null))[_0x5d88('0x24')](removeEntity(_0x3842a6,null))[_0x5d88('0x48')](handleError(_0x3842a6,null));};exports['describe']=function(_0x387d24,_0x2a5613){return db[_0x5d88('0x2c')][_0x5d88('0x4c')]()[_0x5d88('0x24')](respondWithResult(_0x2a5613,null))['catch'](handleError(_0x2a5613,null));}; \ No newline at end of file +var _0xef9b=['count','set','Content-Range','json','apply','reject','then','destroy','sendStatus','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','update','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','undefined','limit'];(function(_0x350776,_0x3843ba){var _0x309e08=function(_0x1c49e7){while(--_0x1c49e7){_0x350776['push'](_0x350776['shift']());}};_0x309e08(++_0x3843ba);}(_0xef9b,0x1dd));var _0xbef9=function(_0x1dd449,_0x1cf7dd){_0x1dd449=_0x1dd449-0x0;var _0x120ad7=_0xef9b[_0x1dd449];return _0x120ad7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbef9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbef9('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbef9('0x2'));var Mustache=require(_0xbef9('0x3'));var util=require('util');var path=require(_0xbef9('0x4'));var sox=require(_0xbef9('0x5'));var csv=require(_0xbef9('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbef9('0x7'));var _=require(_0xbef9('0x8'));var squel=require(_0xbef9('0x9'));var crypto=require(_0xbef9('0xa'));var jsforce=require(_0xbef9('0xb'));var deskjs=require(_0xbef9('0xc'));var toCsv=require(_0xbef9('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbef9('0xd'));var authService=require(_0xbef9('0xe'));var qs=require(_0xbef9('0xf'));var as=require(_0xbef9('0x10'));var hardwareService=require(_0xbef9('0x11'));var logger=require(_0xbef9('0x12'))(_0xbef9('0x13'));var utils=require(_0xbef9('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbef9('0x15'))['db'];function respondWithStatusCode(_0x497d7d,_0xaad011){_0xaad011=_0xaad011||0xcc;return function(_0x37e809){if(_0x37e809){return _0x497d7d['sendStatus'](_0xaad011);}return _0x497d7d['status'](_0xaad011)[_0xbef9('0x16')]();};}function respondWithResult(_0x118c0d,_0x2b9544){_0x2b9544=_0x2b9544||0xc8;return function(_0x12d282){if(_0x12d282){return _0x118c0d[_0xbef9('0x17')](_0x2b9544)['json'](_0x12d282);}};}function respondWithFilteredResult(_0x1a9659,_0x2624fa){return function(_0xad696f){if(_0xad696f){var _0x1ea875=typeof _0x2624fa[_0xbef9('0x18')]===_0xbef9('0x19')&&typeof _0x2624fa[_0xbef9('0x1a')]==='undefined';var _0x209e2f=_0xad696f[_0xbef9('0x1b')];var _0x3a1440=_0x1ea875?0x0:_0x2624fa[_0xbef9('0x18')];var _0x48cb46=_0x1ea875?_0xad696f[_0xbef9('0x1b')]:_0x2624fa[_0xbef9('0x18')]+_0x2624fa[_0xbef9('0x1a')];var _0x359d65;if(_0x48cb46>=_0x209e2f){_0x48cb46=_0x209e2f;_0x359d65=0xc8;}else{_0x359d65=0xce;}_0x1a9659['status'](_0x359d65);return _0x1a9659[_0xbef9('0x1c')](_0xbef9('0x1d'),_0x3a1440+'-'+_0x48cb46+'/'+_0x209e2f)[_0xbef9('0x1e')](_0xad696f);}return null;};}function patchUpdates(_0x4e7943){return function(_0x4a0f13){try{jsonpatch[_0xbef9('0x1f')](_0x4a0f13,_0x4e7943,!![]);}catch(_0x2fbcb0){return BPromise[_0xbef9('0x20')](_0x2fbcb0);}return _0x4a0f13['save']();};}function saveUpdates(_0x424e49,_0x2ca8cb){return function(_0x1e177d){if(_0x1e177d){return _0x1e177d['update'](_0x424e49)[_0xbef9('0x21')](function(_0xdb2b71){return _0xdb2b71;});}return null;};}function removeEntity(_0x34b271,_0x3228ef){return function(_0x1d78f1){if(_0x1d78f1){return _0x1d78f1[_0xbef9('0x22')]()[_0xbef9('0x21')](function(){_0x34b271[_0xbef9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f057f,_0x305798){return function(_0x1d1e20){if(!_0x1d1e20){_0x2f057f[_0xbef9('0x23')](0x194);}return _0x1d1e20;};}function handleError(_0x23c1b4,_0x499d61){_0x499d61=_0x499d61||0x1f4;return function(_0x40a0a7){logger['error'](_0x40a0a7[_0xbef9('0x24')]);if(_0x40a0a7[_0xbef9('0x25')]){delete _0x40a0a7[_0xbef9('0x25')];}_0x23c1b4['status'](_0x499d61)[_0xbef9('0x26')](_0x40a0a7);};}exports[_0xbef9('0x27')]=function(_0x430878,_0x27cdb0){var _0x529823={},_0x4ec4d5={},_0x47123b={'count':0x0,'rows':[]};var _0x14021f=_[_0xbef9('0x28')](db[_0xbef9('0x29')][_0xbef9('0x2a')],function(_0x41336f){return{'name':_0x41336f[_0xbef9('0x2b')],'type':_0x41336f[_0xbef9('0x2c')]['key']};});_0x4ec4d5['model']=_[_0xbef9('0x28')](_0x14021f,_0xbef9('0x25'));_0x4ec4d5[_0xbef9('0x2d')]=_['keys'](_0x430878[_0xbef9('0x2d')]);_0x4ec4d5[_0xbef9('0x2e')]=_[_0xbef9('0x2f')](_0x4ec4d5['model'],_0x4ec4d5['query']);_0x529823[_0xbef9('0x30')]=_[_0xbef9('0x2f')](_0x4ec4d5[_0xbef9('0x31')],qs['fields'](_0x430878[_0xbef9('0x2d')][_0xbef9('0x32')]));_0x529823[_0xbef9('0x30')]=_0x529823[_0xbef9('0x30')]['length']?_0x529823[_0xbef9('0x30')]:_0x4ec4d5['model'];if(!_0x430878['query'][_0xbef9('0x33')]('nolimit')){_0x529823['limit']=qs['limit'](_0x430878[_0xbef9('0x2d')][_0xbef9('0x1a')]);_0x529823['offset']=qs[_0xbef9('0x18')](_0x430878[_0xbef9('0x2d')][_0xbef9('0x18')]);}_0x529823[_0xbef9('0x34')]=qs[_0xbef9('0x35')](_0x430878[_0xbef9('0x2d')][_0xbef9('0x35')]);_0x529823[_0xbef9('0x36')]=qs[_0xbef9('0x2e')](_[_0xbef9('0x37')](_0x430878[_0xbef9('0x2d')],_0x4ec4d5[_0xbef9('0x2e')]),_0x14021f);if(_0x430878[_0xbef9('0x2d')][_0xbef9('0x38')]){_0x529823[_0xbef9('0x36')]=_[_0xbef9('0x39')](_0x529823['where'],{'$or':_[_0xbef9('0x28')](_0x14021f,function(_0x270cbd){if(_0x270cbd['type']!==_0xbef9('0x3a')){var _0x5bb446={};_0x5bb446[_0x270cbd['name']]={'$like':'%'+_0x430878[_0xbef9('0x2d')]['filter']+'%'};return _0x5bb446;}})});}_0x529823=_[_0xbef9('0x39')]({},_0x529823,_0x430878[_0xbef9('0x3b')]);var _0x5355b7={'where':_0x529823['where']};return db[_0xbef9('0x29')][_0xbef9('0x1b')](_0x5355b7)['then'](function(_0xc17d33){_0x47123b['count']=_0xc17d33;if(_0x430878[_0xbef9('0x2d')][_0xbef9('0x3c')]){_0x529823[_0xbef9('0x3d')]=[{'all':!![]}];}return db[_0xbef9('0x29')][_0xbef9('0x3e')](_0x529823);})[_0xbef9('0x21')](function(_0x3a0578){_0x47123b['rows']=_0x3a0578;return _0x47123b;})['then'](respondWithFilteredResult(_0x27cdb0,_0x529823))[_0xbef9('0x3f')](handleError(_0x27cdb0,null));};exports[_0xbef9('0x40')]=function(_0x612179,_0x3df5de){var _0x2d009a={'raw':!![],'where':{'id':_0x612179[_0xbef9('0x41')]['id']}},_0x51af21={};_0x51af21[_0xbef9('0x31')]=_[_0xbef9('0x42')](db['FaxTransferReport'][_0xbef9('0x2a')]);_0x51af21['query']=_[_0xbef9('0x42')](_0x612179[_0xbef9('0x2d')]);_0x51af21['filters']=_[_0xbef9('0x2f')](_0x51af21[_0xbef9('0x31')],_0x51af21[_0xbef9('0x2d')]);_0x2d009a[_0xbef9('0x30')]=_[_0xbef9('0x2f')](_0x51af21[_0xbef9('0x31')],qs['fields'](_0x612179['query'][_0xbef9('0x32')]));_0x2d009a[_0xbef9('0x30')]=_0x2d009a[_0xbef9('0x30')][_0xbef9('0x43')]?_0x2d009a[_0xbef9('0x30')]:_0x51af21['model'];if(_0x612179[_0xbef9('0x2d')][_0xbef9('0x3c')]){_0x2d009a[_0xbef9('0x3d')]=[{'all':!![]}];}_0x2d009a=_[_0xbef9('0x39')]({},_0x2d009a,_0x612179[_0xbef9('0x3b')]);return db[_0xbef9('0x29')][_0xbef9('0x44')](_0x2d009a)['then'](handleEntityNotFound(_0x3df5de,null))[_0xbef9('0x21')](respondWithResult(_0x3df5de,null))[_0xbef9('0x3f')](handleError(_0x3df5de,null));};exports['create']=function(_0x3d056d,_0x3149de){return db['FaxTransferReport']['create'](_0x3d056d['body'],{})[_0xbef9('0x21')](respondWithResult(_0x3149de,0xc9))['catch'](handleError(_0x3149de,null));};exports[_0xbef9('0x45')]=function(_0x498924,_0x34d038){if(_0x498924[_0xbef9('0x46')]['id']){delete _0x498924[_0xbef9('0x46')]['id'];}return db[_0xbef9('0x29')][_0xbef9('0x44')]({'where':{'id':_0x498924['params']['id']}})[_0xbef9('0x21')](handleEntityNotFound(_0x34d038,null))['then'](saveUpdates(_0x498924[_0xbef9('0x46')],null))[_0xbef9('0x21')](respondWithResult(_0x34d038,null))[_0xbef9('0x3f')](handleError(_0x34d038,null));};exports['destroy']=function(_0x1f816a,_0x2554b0){return db[_0xbef9('0x29')][_0xbef9('0x44')]({'where':{'id':_0x1f816a[_0xbef9('0x41')]['id']}})['then'](handleEntityNotFound(_0x2554b0,null))[_0xbef9('0x21')](removeEntity(_0x2554b0,null))['catch'](handleError(_0x2554b0,null));};exports[_0xbef9('0x47')]=function(_0xb5b4b3,_0x4997d6){return db[_0xbef9('0x29')]['describe']()['then'](respondWithResult(_0x4997d6,null))['catch'](handleError(_0x4997d6,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index f17180c..e4da8e8 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 _0xb581=['exports','define','FaxTransferReport','report_fax_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0x14a791,_0xee32e9){var _0x2150f3=function(_0xed859e){while(--_0xed859e){_0x14a791['push'](_0x14a791['shift']());}};_0x2150f3(++_0xee32e9);}(_0xb581,0x17b));var _0x1b58=function(_0x57df40,_0x4a8748){_0x57df40=_0x57df40-0x0;var _0x5a0ac5=_0xb581[_0x57df40];return _0x5a0ac5;};'use strict';var _=require(_0x1b58('0x0'));var util=require(_0x1b58('0x1'));var logger=require(_0x1b58('0x2'))(_0x1b58('0x3'));var moment=require(_0x1b58('0x4'));var BPromise=require(_0x1b58('0x5'));var rp=require(_0x1b58('0x6'));var fs=require('fs');var path=require(_0x1b58('0x7'));var rimraf=require(_0x1b58('0x8'));var config=require(_0x1b58('0x9'));var attributes=require(_0x1b58('0xa'));module[_0x1b58('0xb')]=function(_0x32afbe,_0x24870a){return _0x32afbe[_0x1b58('0xc')](_0x1b58('0xd'),attributes,{'tableName':_0x1b58('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8dd1=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x209824,_0x1a54a2){var _0xe4ba63=function(_0x5efcfc){while(--_0x5efcfc){_0x209824['push'](_0x209824['shift']());}};_0xe4ba63(++_0x1a54a2);}(_0x8dd1,0x1e5));var _0x18dd=function(_0x457ad6,_0x40c3b3){_0x457ad6=_0x457ad6-0x0;var _0x6df1ed=_0x8dd1[_0x457ad6];return _0x6df1ed;};'use strict';var _=require(_0x18dd('0x0'));var util=require(_0x18dd('0x1'));var logger=require(_0x18dd('0x2'))('api');var moment=require(_0x18dd('0x3'));var BPromise=require('bluebird');var rp=require(_0x18dd('0x4'));var fs=require('fs');var path=require(_0x18dd('0x5'));var rimraf=require(_0x18dd('0x6'));var config=require(_0x18dd('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x18dd('0x8')]=function(_0x2cb51e,_0x43c5b5){return _0x2cb51e[_0x18dd('0x9')](_0x18dd('0xa'),attributes,{'tableName':_0x18dd('0xb'),'paranoid':![],'indexes':[{'name':_0x18dd('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 05b910e..00770b1 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 _0xb931=['message','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x351b46,_0x26b265){var _0x1515df=function(_0x22896a){while(--_0x22896a){_0x351b46['push'](_0x351b46['shift']());}};_0x1515df(++_0x26b265);}(_0xb931,0x17c));var _0x1b93=function(_0x59d415,_0x3313f5){_0x59d415=_0x59d415-0x0;var _0x256cc1=_0xb931[_0x59d415];return _0x256cc1;};'use strict';var _=require(_0x1b93('0x0'));var util=require(_0x1b93('0x1'));var moment=require(_0x1b93('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b93('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b93('0x4'));var logger=require(_0x1b93('0x5'))('rpc');var config=require(_0x1b93('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1b93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x573239,_0x13356d,_0x4d3d3d){return new BPromise(function(_0xa12649,_0x507d73){return client['request'](_0x573239,_0x4d3d3d)[_0x1b93('0x8')](function(_0x336e6a){logger[_0x1b93('0x9')](_0x1b93('0xa'),_0x13356d,_0x1b93('0xb'));logger['debug'](_0x1b93('0xc'),_0x13356d,'request\x20sent',JSON[_0x1b93('0xd')](_0x336e6a));if(_0x336e6a[_0x1b93('0xe')]){if(_0x336e6a[_0x1b93('0xe')][_0x1b93('0xf')]===0x1f4){logger[_0x1b93('0xe')](_0x1b93('0xa'),_0x13356d,_0x336e6a[_0x1b93('0xe')]['message']);return _0x507d73(_0x336e6a[_0x1b93('0xe')]['message']);}logger[_0x1b93('0xe')](_0x1b93('0xa'),_0x13356d,_0x336e6a[_0x1b93('0xe')][_0x1b93('0x10')]);return _0xa12649(_0x336e6a[_0x1b93('0xe')][_0x1b93('0x10')]);}else{logger['info'](_0x1b93('0xa'),_0x13356d,_0x1b93('0xb'));_0xa12649(_0x336e6a['result'][_0x1b93('0x10')]);}})[_0x1b93('0x11')](function(_0x38f3cc){logger[_0x1b93('0xe')](_0x1b93('0xa'),_0x13356d,_0x38f3cc);_0x507d73(_0x38f3cc);});});} \ No newline at end of file +var _0xa74a=['../../config/environment','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0xa74a,0x76));var _0xaa74=function(_0x5b463d,_0x4c0149){_0x5b463d=_0x5b463d-0x0;var _0x342661=_0xa74a[_0x5b463d];return _0x342661;};'use strict';var _=require('lodash');var util=require(_0xaa74('0x0'));var moment=require(_0xaa74('0x1'));var BPromise=require(_0xaa74('0x2'));var rs=require(_0xaa74('0x3'));var fs=require('fs');var Redis=require(_0xaa74('0x4'));var db=require(_0xaa74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa74('0x6'))(_0xaa74('0x7'));var config=require(_0xaa74('0x8'));var jayson=require(_0xaa74('0x9'));var client=jayson[_0xaa74('0xa')][_0xaa74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4335eb,_0x256bf7,_0x2ea19a){return new BPromise(function(_0x4ebdf4,_0x4485aa){return client['request'](_0x4335eb,_0x2ea19a)[_0xaa74('0xc')](function(_0x4a700c){logger['info'](_0xaa74('0xd'),_0x256bf7,_0xaa74('0xe'));logger['debug'](_0xaa74('0xf'),_0x256bf7,'request\x20sent',JSON[_0xaa74('0x10')](_0x4a700c));if(_0x4a700c['error']){if(_0x4a700c['error'][_0xaa74('0x11')]===0x1f4){logger[_0xaa74('0x12')](_0xaa74('0xd'),_0x256bf7,_0x4a700c[_0xaa74('0x12')][_0xaa74('0x13')]);return _0x4485aa(_0x4a700c['error']['message']);}logger[_0xaa74('0x12')](_0xaa74('0xd'),_0x256bf7,_0x4a700c[_0xaa74('0x12')][_0xaa74('0x13')]);return _0x4ebdf4(_0x4a700c[_0xaa74('0x12')][_0xaa74('0x13')]);}else{logger[_0xaa74('0x14')](_0xaa74('0xd'),_0x256bf7,_0xaa74('0xe'));_0x4ebdf4(_0x4a700c['result'][_0xaa74('0x13')]);}})['catch'](function(_0x1ed53e){logger[_0xaa74('0x12')](_0xaa74('0xd'),_0x256bf7,_0x1ed53e);_0x4485aa(_0x1ed53e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c242fd3..6c42abd 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 _0xae11=['create','put','update','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','isAuthenticated','/:id','show','post'];(function(_0x85b55d,_0x1b997f){var _0x51c458=function(_0x740f0c){while(--_0x740f0c){_0x85b55d['push'](_0x85b55d['shift']());}};_0x51c458(++_0x1b997f);}(_0xae11,0x149));var _0x1ae1=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xae11[_0x434783];return _0x13efcf;};'use strict';var multer=require('multer');var util=require(_0x1ae1('0x0'));var path=require(_0x1ae1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ae1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1ae1('0x3'));var interaction=require(_0x1ae1('0x4'));var config=require(_0x1ae1('0x5'));var controller=require(_0x1ae1('0x6'));router[_0x1ae1('0x7')]('/',auth['isAuthenticated'](),controller[_0x1ae1('0x8')]);router[_0x1ae1('0x7')]('/describe',auth[_0x1ae1('0x9')](),controller['describe']);router[_0x1ae1('0x7')](_0x1ae1('0xa'),auth[_0x1ae1('0x9')](),controller[_0x1ae1('0xb')]);router[_0x1ae1('0xc')]('/',auth[_0x1ae1('0x9')](),controller[_0x1ae1('0xd')]);router[_0x1ae1('0xe')]('/:id',auth[_0x1ae1('0x9')](),controller[_0x1ae1('0xf')]);router['delete'](_0x1ae1('0xa'),auth[_0x1ae1('0x9')](),controller[_0x1ae1('0x10')]);module[_0x1ae1('0x11')]=router; \ No newline at end of file +var _0xcfe1=['destroy','path','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update'];(function(_0x3cb167,_0x189a77){var _0x3801d4=function(_0x56c2fb){while(--_0x56c2fb){_0x3cb167['push'](_0x3cb167['shift']());}};_0x3801d4(++_0x189a77);}(_0xcfe1,0xc1));var _0x1cfe=function(_0x4420a6,_0x35086b){_0x4420a6=_0x4420a6-0x0;var _0x660c81=_0xcfe1[_0x4420a6];return _0x660c81;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cfe('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1cfe('0x1'));var auth=require(_0x1cfe('0x2'));var interaction=require(_0x1cfe('0x3'));var config=require('../../config/environment');var controller=require(_0x1cfe('0x4'));router[_0x1cfe('0x5')]('/',auth[_0x1cfe('0x6')](),controller[_0x1cfe('0x7')]);router[_0x1cfe('0x5')](_0x1cfe('0x8'),auth['isAuthenticated'](),controller[_0x1cfe('0x9')]);router[_0x1cfe('0x5')](_0x1cfe('0xa'),auth[_0x1cfe('0x6')](),controller[_0x1cfe('0xb')]);router['post']('/',auth[_0x1cfe('0x6')](),controller[_0x1cfe('0xc')]);router[_0x1cfe('0xd')](_0x1cfe('0xa'),auth['isAuthenticated'](),controller[_0x1cfe('0xe')]);router['delete'](_0x1cfe('0xa'),auth[_0x1cfe('0x6')](),controller[_0x1cfe('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 1bfba52..f83077c 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 _0xe8c4=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','/:id'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xe8c4,0x184));var _0x4e8c=function(_0x331f11,_0x13decb){_0x331f11=_0x331f11-0x0;var _0x3090f0=_0xe8c4[_0x331f11];return _0x3090f0;};'use strict';var multer=require(_0x4e8c('0x0'));var util=require(_0x4e8c('0x1'));var path=require(_0x4e8c('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e8c('0x3'));var router=express['Router']();var fs_extra=require(_0x4e8c('0x4'));var auth=require(_0x4e8c('0x5'));var interaction=require(_0x4e8c('0x6'));var config=require(_0x4e8c('0x7'));var controller=require(_0x4e8c('0x8'));router[_0x4e8c('0x9')]('/',auth[_0x4e8c('0xa')](),controller[_0x4e8c('0xb')]);router[_0x4e8c('0x9')]('/:id',auth[_0x4e8c('0xa')](),controller[_0x4e8c('0xc')]);router[_0x4e8c('0x9')](_0x4e8c('0xd'),auth['isAuthenticated'](),controller[_0x4e8c('0xe')]);router['get'](_0x4e8c('0xf'),auth['isAuthenticated'](),controller[_0x4e8c('0x10')]);router[_0x4e8c('0x11')]('/',auth[_0x4e8c('0xa')](),controller['create']);router[_0x4e8c('0x11')](_0x4e8c('0xd'),auth[_0x4e8c('0xa')](),controller[_0x4e8c('0x12')]);router['put'](_0x4e8c('0x13'),auth['isAuthenticated'](),controller[_0x4e8c('0x14')]);router[_0x4e8c('0x15')](_0x4e8c('0x13'),auth[_0x4e8c('0xa')](),controller[_0x4e8c('0x16')]);module[_0x4e8c('0x17')]=router; \ No newline at end of file +var _0x0942=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','/:id'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x0942,0x124));var _0x2094=function(_0x381631,_0x59ea51){_0x381631=_0x381631-0x0;var _0x7471bb=_0x0942[_0x381631];return _0x7471bb;};'use strict';var multer=require(_0x2094('0x0'));var util=require(_0x2094('0x1'));var path=require(_0x2094('0x2'));var timeout=require(_0x2094('0x3'));var express=require(_0x2094('0x4'));var router=express[_0x2094('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2094('0x6'));var config=require('../../config/environment');var controller=require(_0x2094('0x7'));router[_0x2094('0x8')]('/',auth[_0x2094('0x9')](),controller['index']);router[_0x2094('0x8')]('/:id',auth[_0x2094('0x9')](),controller[_0x2094('0xa')]);router['get']('/:id/configurations',auth[_0x2094('0x9')](),controller[_0x2094('0xb')]);router[_0x2094('0x8')](_0x2094('0xc'),auth['isAuthenticated'](),controller[_0x2094('0xd')]);router['post']('/',auth[_0x2094('0x9')](),controller[_0x2094('0xe')]);router[_0x2094('0xf')](_0x2094('0x10'),auth[_0x2094('0x9')](),controller[_0x2094('0x11')]);router[_0x2094('0x12')](_0x2094('0x13'),auth[_0x2094('0x9')](),controller[_0x2094('0x14')]);router[_0x2094('0x15')](_0x2094('0x13'),auth['isAuthenticated'](),controller[_0x2094('0x16')]);module[_0x2094('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d9692b4..895a168 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 _0x7cef=['STRING','basic','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cef,0x116));var _0xf7ce=function(_0x59899f,_0x354307){_0x59899f=_0x59899f-0x0;var _0x1199b3=_0x7cef[_0x59899f];return _0x1199b3;};'use strict';var Sequelize=require(_0xf7ce('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf7ce('0x1')]},'username':{'type':Sequelize[_0xf7ce('0x1')]},'remoteUri':{'type':Sequelize[_0xf7ce('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xf7ce('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xf7ce('0x1')]},'consumerKey':{'type':Sequelize[_0xf7ce('0x1')]},'consumerSecret':{'type':Sequelize[_0xf7ce('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xf7ce('0x1')]},'serverUrl':{'type':Sequelize[_0xf7ce('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x4aa2=['STRING','ENUM','basic','newTab','integrationTab','sequelize','exports'];(function(_0x5a4257,_0x3ae34d){var _0x3746a7=function(_0x31fff0){while(--_0x31fff0){_0x5a4257['push'](_0x5a4257['shift']());}};_0x3746a7(++_0x3ae34d);}(_0x4aa2,0xad));var _0x24aa=function(_0x35281b,_0xf4ee9e){_0x35281b=_0x35281b-0x0;var _0x16868c=_0x4aa2[_0x35281b];return _0x16868c;};'use strict';var Sequelize=require(_0x24aa('0x0'));module[_0x24aa('0x1')]={'name':{'type':Sequelize[_0x24aa('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x24aa('0x2')]},'remoteUri':{'type':Sequelize[_0x24aa('0x2')]},'authType':{'type':Sequelize[_0x24aa('0x3')]('basic'),'defaultValue':_0x24aa('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x24aa('0x2')]},'consumerSecret':{'type':Sequelize[_0x24aa('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x24aa('0x2')]},'serverUrl':{'type':Sequelize[_0x24aa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x24aa('0x3')]('integrationTab',_0x24aa('0x5')),'defaultValue':_0x24aa('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index afcb20a..699e023 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 _0x40ae=['consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','options','rows','catch','show','params','include','find','create','body','destroy','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','DeskField','Subjects','Descriptions','getFields','username','password'];(function(_0x174f9c,_0x320fdd){var _0x58101b=function(_0x132056){while(--_0x132056){_0x174f9c['push'](_0x174f9c['shift']());}};_0x58101b(++_0x320fdd);}(_0x40ae,0x91));var _0xe40a=function(_0x528372,_0xf76c54){_0x528372=_0x528372-0x0;var _0x24fdf4=_0x40ae[_0x528372];return _0x24fdf4;};'use strict';var emlformat=require(_0xe40a('0x0'));var rimraf=require(_0xe40a('0x1'));var zipdir=require(_0xe40a('0x2'));var jsonpatch=require(_0xe40a('0x3'));var rp=require(_0xe40a('0x4'));var moment=require(_0xe40a('0x5'));var BPromise=require(_0xe40a('0x6'));var Mustache=require('mustache');var util=require(_0xe40a('0x7'));var path=require('path');var sox=require(_0xe40a('0x8'));var csv=require(_0xe40a('0x9'));var ejs=require(_0xe40a('0xa'));var fs=require('fs');var fs_extra=require(_0xe40a('0xb'));var _=require('lodash');var squel=require(_0xe40a('0xc'));var crypto=require(_0xe40a('0xd'));var jsforce=require(_0xe40a('0xe'));var deskjs=require(_0xe40a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe40a('0x10'));var Papa=require(_0xe40a('0x11'));var Redis=require(_0xe40a('0x12'));var authService=require(_0xe40a('0x13'));var qs=require(_0xe40a('0x14'));var as=require(_0xe40a('0x15'));var hardwareService=require(_0xe40a('0x16'));var logger=require(_0xe40a('0x17'))('api');var utils=require(_0xe40a('0x18'));var config=require(_0xe40a('0x19'));var licenseUtil=require(_0xe40a('0x1a'));var db=require(_0xe40a('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x424f3f,_0x4f800a){_0x4f800a=_0x4f800a||0xcc;return function(_0x3febdc){if(_0x3febdc){return _0x424f3f[_0xe40a('0x1c')](_0x4f800a);}return _0x424f3f[_0xe40a('0x1d')](_0x4f800a)[_0xe40a('0x1e')]();};}function respondWithResult(_0x123f60,_0x5870aa){_0x5870aa=_0x5870aa||0xc8;return function(_0x28ef3a){if(_0x28ef3a){return _0x123f60[_0xe40a('0x1d')](_0x5870aa)[_0xe40a('0x1f')](_0x28ef3a);}};}function respondWithFilteredResult(_0x2a049d,_0x480aa2){return function(_0x2be697){if(_0x2be697){var _0xa68db4=typeof _0x480aa2['offset']==='undefined'&&typeof _0x480aa2[_0xe40a('0x20')]==='undefined';var _0x224ee1=_0x2be697[_0xe40a('0x21')];var _0x25ad19=_0xa68db4?0x0:_0x480aa2[_0xe40a('0x22')];var _0x24d274=_0xa68db4?_0x2be697[_0xe40a('0x21')]:_0x480aa2[_0xe40a('0x22')]+_0x480aa2[_0xe40a('0x20')];var _0x108690;if(_0x24d274>=_0x224ee1){_0x24d274=_0x224ee1;_0x108690=0xc8;}else{_0x108690=0xce;}_0x2a049d[_0xe40a('0x1d')](_0x108690);return _0x2a049d[_0xe40a('0x23')](_0xe40a('0x24'),_0x25ad19+'-'+_0x24d274+'/'+_0x224ee1)['json'](_0x2be697);}return null;};}function patchUpdates(_0x27488e){return function(_0x3d13d9){try{jsonpatch[_0xe40a('0x25')](_0x3d13d9,_0x27488e,!![]);}catch(_0x19a698){return BPromise[_0xe40a('0x26')](_0x19a698);}return _0x3d13d9[_0xe40a('0x27')]();};}function saveUpdates(_0x3bde34,_0x5919d7){return function(_0x10ea3f){if(_0x10ea3f){return _0x10ea3f['update'](_0x3bde34)[_0xe40a('0x28')](function(_0x19d118){return _0x19d118;});}return null;};}function removeEntity(_0x4d1ad3,_0x514a6c){return function(_0x57da27){if(_0x57da27){return _0x57da27['destroy']()[_0xe40a('0x28')](function(){_0x4d1ad3[_0xe40a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x151933,_0x43e783){return function(_0x37058b){if(!_0x37058b){_0x151933[_0xe40a('0x1c')](0x194);}return _0x37058b;};}function handleError(_0x3e6f8d,_0x198322){_0x198322=_0x198322||0x1f4;return function(_0x41e58f){logger['error'](_0x41e58f[_0xe40a('0x29')]);if(_0x41e58f[_0xe40a('0x2a')]){delete _0x41e58f[_0xe40a('0x2a')];}_0x3e6f8d['status'](_0x198322)[_0xe40a('0x2b')](_0x41e58f);};}exports[_0xe40a('0x2c')]=function(_0x1a26b2,_0xf909aa){var _0x2e0b2c={},_0x42c063={},_0x4e1c0a={'count':0x0,'rows':[]};var _0x369672=_[_0xe40a('0x2d')](db[_0xe40a('0x2e')][_0xe40a('0x2f')],function(_0xa277d5){return{'name':_0xa277d5[_0xe40a('0x30')],'type':_0xa277d5[_0xe40a('0x31')]['key']};});_0x42c063[_0xe40a('0x32')]=_[_0xe40a('0x2d')](_0x369672,_0xe40a('0x2a'));_0x42c063[_0xe40a('0x33')]=_[_0xe40a('0x34')](_0x1a26b2[_0xe40a('0x33')]);_0x42c063['filters']=_[_0xe40a('0x35')](_0x42c063[_0xe40a('0x32')],_0x42c063[_0xe40a('0x33')]);_0x2e0b2c['attributes']=_['intersection'](_0x42c063[_0xe40a('0x32')],qs[_0xe40a('0x36')](_0x1a26b2[_0xe40a('0x33')][_0xe40a('0x36')]));_0x2e0b2c[_0xe40a('0x37')]=_0x2e0b2c[_0xe40a('0x37')][_0xe40a('0x38')]?_0x2e0b2c[_0xe40a('0x37')]:_0x42c063[_0xe40a('0x32')];if(!_0x1a26b2['query'][_0xe40a('0x39')](_0xe40a('0x3a'))){_0x2e0b2c['limit']=qs[_0xe40a('0x20')](_0x1a26b2[_0xe40a('0x33')]['limit']);_0x2e0b2c['offset']=qs[_0xe40a('0x22')](_0x1a26b2[_0xe40a('0x33')][_0xe40a('0x22')]);}_0x2e0b2c[_0xe40a('0x3b')]=qs[_0xe40a('0x3c')](_0x1a26b2[_0xe40a('0x33')][_0xe40a('0x3c')]);_0x2e0b2c['where']=qs['filters'](_[_0xe40a('0x3d')](_0x1a26b2[_0xe40a('0x33')],_0x42c063[_0xe40a('0x3e')]),_0x369672);if(_0x1a26b2[_0xe40a('0x33')][_0xe40a('0x3f')]){_0x2e0b2c[_0xe40a('0x40')]=_['merge'](_0x2e0b2c[_0xe40a('0x40')],{'$or':_[_0xe40a('0x2d')](_0x369672,function(_0x38f794){if(_0x38f794[_0xe40a('0x31')]!=='VIRTUAL'){var _0x16c513={};_0x16c513[_0x38f794[_0xe40a('0x2a')]]={'$like':'%'+_0x1a26b2[_0xe40a('0x33')][_0xe40a('0x3f')]+'%'};return _0x16c513;}})});}_0x2e0b2c=_[_0xe40a('0x41')]({},_0x2e0b2c,_0x1a26b2[_0xe40a('0x42')]);var _0x4c6508={'where':_0x2e0b2c[_0xe40a('0x40')]};return db[_0xe40a('0x2e')]['count'](_0x4c6508)[_0xe40a('0x28')](function(_0x1d6b70){_0x4e1c0a['count']=_0x1d6b70;if(_0x1a26b2[_0xe40a('0x33')]['includeAll']){_0x2e0b2c['include']=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x2e0b2c);})[_0xe40a('0x28')](function(_0x5829f0){_0x4e1c0a[_0xe40a('0x43')]=_0x5829f0;return _0x4e1c0a;})[_0xe40a('0x28')](respondWithFilteredResult(_0xf909aa,_0x2e0b2c))[_0xe40a('0x44')](handleError(_0xf909aa,null));};exports[_0xe40a('0x45')]=function(_0x52c207,_0x1048b6){var _0x72e6a5={'raw':![],'where':{'id':_0x52c207[_0xe40a('0x46')]['id']}},_0x188dfe={};_0x188dfe[_0xe40a('0x32')]=_[_0xe40a('0x34')](db[_0xe40a('0x2e')][_0xe40a('0x2f')]);_0x188dfe[_0xe40a('0x33')]=_[_0xe40a('0x34')](_0x52c207[_0xe40a('0x33')]);_0x188dfe['filters']=_[_0xe40a('0x35')](_0x188dfe[_0xe40a('0x32')],_0x188dfe['query']);_0x72e6a5[_0xe40a('0x37')]=_[_0xe40a('0x35')](_0x188dfe[_0xe40a('0x32')],qs[_0xe40a('0x36')](_0x52c207[_0xe40a('0x33')]['fields']));_0x72e6a5['attributes']=_0x72e6a5[_0xe40a('0x37')][_0xe40a('0x38')]?_0x72e6a5[_0xe40a('0x37')]:_0x188dfe[_0xe40a('0x32')];if(_0x52c207[_0xe40a('0x33')]['includeAll']){_0x72e6a5[_0xe40a('0x47')]=[{'all':!![]}];}_0x72e6a5=_[_0xe40a('0x41')]({},_0x72e6a5,_0x52c207[_0xe40a('0x42')]);return db['DeskAccount'][_0xe40a('0x48')](_0x72e6a5)[_0xe40a('0x28')](handleEntityNotFound(_0x1048b6,null))[_0xe40a('0x28')](respondWithResult(_0x1048b6,null))[_0xe40a('0x44')](handleError(_0x1048b6,null));};exports[_0xe40a('0x49')]=function(_0x450f3c,_0x4a7311){return db['DeskAccount'][_0xe40a('0x49')](_0x450f3c[_0xe40a('0x4a')],{})[_0xe40a('0x28')](respondWithResult(_0x4a7311,0xc9))[_0xe40a('0x44')](handleError(_0x4a7311,null));};exports['update']=function(_0x53ed65,_0x190e9c){if(_0x53ed65[_0xe40a('0x4a')]['id']){delete _0x53ed65[_0xe40a('0x4a')]['id'];}return db['DeskAccount'][_0xe40a('0x48')]({'where':{'id':_0x53ed65['params']['id']}})[_0xe40a('0x28')](handleEntityNotFound(_0x190e9c,null))['then'](saveUpdates(_0x53ed65[_0xe40a('0x4a')],null))['then'](respondWithResult(_0x190e9c,null))['catch'](handleError(_0x190e9c,null));};exports[_0xe40a('0x4b')]=function(_0x2059e0,_0x578ca7){return db[_0xe40a('0x2e')]['find']({'where':{'id':_0x2059e0[_0xe40a('0x46')]['id']}})[_0xe40a('0x28')](handleEntityNotFound(_0x578ca7,null))[_0xe40a('0x28')](removeEntity(_0x578ca7,null))[_0xe40a('0x44')](handleError(_0x578ca7,null));};exports['getConfigurations']=function(_0xd71de4,_0x26e32f,_0x24071c){var _0x217260={};var _0x5f2be5={};var _0x5190c7;var _0x4915b0;return db['DeskAccount'][_0xe40a('0x4c')]({'where':{'id':_0xd71de4['params']['id']}})['then'](handleEntityNotFound(_0x26e32f,null))['then'](function(_0x18de1a){if(_0x18de1a){_0x5190c7=_0x18de1a;_0x5f2be5['model']=_[_0xe40a('0x34')](db[_0xe40a('0x4d')][_0xe40a('0x2f')]);_0x5f2be5[_0xe40a('0x33')]=_[_0xe40a('0x34')](_0xd71de4[_0xe40a('0x33')]);_0x5f2be5[_0xe40a('0x3e')]=_[_0xe40a('0x35')](_0x5f2be5[_0xe40a('0x32')],_0x5f2be5[_0xe40a('0x33')]);_0x217260[_0xe40a('0x37')]=_[_0xe40a('0x35')](_0x5f2be5[_0xe40a('0x32')],qs[_0xe40a('0x36')](_0xd71de4['query'][_0xe40a('0x36')]));_0x217260[_0xe40a('0x37')]=_0x217260[_0xe40a('0x37')][_0xe40a('0x38')]?_0x217260[_0xe40a('0x37')]:_0x5f2be5['model'];_0x217260[_0xe40a('0x3b')]=qs['sort'](_0xd71de4[_0xe40a('0x33')]['sort']);_0x217260[_0xe40a('0x40')]=qs[_0xe40a('0x3e')](_[_0xe40a('0x3d')](_0xd71de4[_0xe40a('0x33')],_0x5f2be5[_0xe40a('0x3e')]));if(_0xd71de4['query'][_0xe40a('0x3f')]){_0x217260[_0xe40a('0x40')]=_[_0xe40a('0x41')](_0x217260['where'],{'$or':_[_0xe40a('0x2d')](_0x217260[_0xe40a('0x37')],function(_0x19bb7c){var _0x2d8add={};_0x2d8add[_0x19bb7c]={'$like':'%'+_0xd71de4['query']['filter']+'%'};return _0x2d8add;})});}_0x217260=_[_0xe40a('0x41')]({},_0x217260,_0xd71de4['options']);return _0x5190c7[_0xe40a('0x4e')](_0x217260);}})[_0xe40a('0x28')](function(_0x25524c){if(_0x25524c){_0x4915b0=_0x25524c[_0xe40a('0x38')];if(!_0xd71de4[_0xe40a('0x33')]['hasOwnProperty']('nolimit')){_0x217260['limit']=qs[_0xe40a('0x20')](_0xd71de4['query'][_0xe40a('0x20')]);_0x217260['offset']=qs[_0xe40a('0x22')](_0xd71de4['query'][_0xe40a('0x22')]);}return _0x5190c7[_0xe40a('0x4e')](_0x217260);}})[_0xe40a('0x28')](function(_0x32d167){if(_0x32d167){return _0x32d167?{'count':_0x4915b0,'rows':_0x32d167}:null;}})[_0xe40a('0x28')](respondWithResult(_0x26e32f,null))[_0xe40a('0x44')](handleError(_0x26e32f,null));};exports[_0xe40a('0x4f')]=function(_0x294664,_0x1274ef,_0x120974){if(_0x294664['body']['id']){delete _0x294664[_0xe40a('0x4a')]['id'];}return db[_0xe40a('0x2e')]['findOne']({'where':{'id':_0x294664[_0xe40a('0x46')]['id']}})['then'](handleEntityNotFound(_0x1274ef,null))[_0xe40a('0x28')](function(_0x2a6e0d){if(_0x2a6e0d){_0x294664[_0xe40a('0x4a')][_0xe40a('0x50')]=_0x2a6e0d['id'];_0x294664['body']['Subjects']=integrations[_0xe40a('0x51')](_0x294664['body']['channel'],_0x294664[_0xe40a('0x4a')]['type']);_0x294664[_0xe40a('0x4a')]['Descriptions']=integrations[_0xe40a('0x52')](_0x294664['body']['channel'],_0x294664[_0xe40a('0x4a')][_0xe40a('0x31')]);return db[_0xe40a('0x4d')]['create'](_0x294664[_0xe40a('0x4a')],{'include':[{'model':db[_0xe40a('0x53')],'as':_0xe40a('0x54')},{'model':db[_0xe40a('0x53')],'as':_0xe40a('0x55')}]});}return null;})[_0xe40a('0x28')](respondWithResult(_0x1274ef,null))['catch'](handleError(_0x1274ef,null));};exports[_0xe40a('0x56')]=function(_0x314630,_0x1912c0,_0x4e652e){var _0x3a140a=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1134b5='';return db[_0xe40a('0x2e')][_0xe40a('0x4c')]({'where':{'id':_0x314630['params']['id']},'attributes':['id','remoteUri','authType',_0xe40a('0x57'),_0xe40a('0x58'),_0xe40a('0x59'),_0xe40a('0x5a'),_0xe40a('0x5b'),_0xe40a('0x5c')]})['then'](handleEntityNotFound(_0x1912c0,null))[_0xe40a('0x28')](function(_0x916b5e){if(_0x916b5e){_0x1134b5=_0x916b5e[_0xe40a('0x5d')];var _0xf7c52c=_0x1134b5[_0xe40a('0x5e')](-0x1);if(_0xf7c52c==='/'){_0x1134b5=_0x1134b5[_0xe40a('0x5f')](0x0,_0x1134b5[_0xe40a('0x60')](_0xf7c52c));}var _0x2da287={'method':_0xe40a('0x61'),'uri':util[_0xe40a('0x62')](_0xe40a('0x63'),_0x1134b5),'headers':{'Content-Type':'application/json','Accept':_0xe40a('0x64')},'json':!![]};if(_0x916b5e[_0xe40a('0x65')]==='basic'){_0x2da287[_0xe40a('0x66')][_0xe40a('0x67')]=util[_0xe40a('0x62')](_0xe40a('0x68'),new Buffer(util[_0xe40a('0x62')](_0xe40a('0x69'),_0x916b5e[_0xe40a('0x57')],_0x916b5e['password']))[_0xe40a('0x6a')](_0xe40a('0x6b')));}return rp(_0x2da287)[_0xe40a('0x28')](function(_0x1a7143){return _0x3a140a[_0xe40a('0x6c')](_[_0xe40a('0x2d')](_0x1a7143[_0xe40a('0x6d')][_0xe40a('0x6e')],function(_0x5e1644){return{'id':_0x5e1644[_0xe40a('0x2a')],'name':_0x5e1644[_0xe40a('0x2a')],'type':_0x5e1644[_0xe40a('0x31')],'active':_0x5e1644[_0xe40a('0x6f')],'label':_0x5e1644['label'],'custom':!![]};}));});}})[_0xe40a('0x28')](function(_0x1aad91){return{'count':_0x1aad91[_0xe40a('0x38')],'rows':_0x1aad91};})[_0xe40a('0x28')](respondWithResult(_0x1912c0,null))['catch'](function(_0x16e7d1){var _0x472654=_0x314630[_0xe40a('0x33')][_0xe40a('0x70')]?0x1f4:_0x16e7d1[_0xe40a('0x71')]||0x1f4;logger['error'](_0xe40a('0x72'),_0xe40a('0x56'),_0x472654,JSON[_0xe40a('0x73')](_0x16e7d1));delete _0x16e7d1[_0xe40a('0x2a')];if(_0x472654===0x191){_0x472654=0x190;}_0x1912c0[_0xe40a('0x1d')](_0x472654)['send'](_0x314630[_0xe40a('0x33')]['test']?{'message':_0xe40a('0x74'),'statusCode':_0x16e7d1[_0xe40a('0x71')]}:_0x16e7d1);});}; \ No newline at end of file +var _0x0cb4=['params','attributes','find','catch','create','body','DeskConfiguration','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','slice','substring','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','toString','base64','concat','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','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','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','index','DeskAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show'];(function(_0x1f7428,_0x4efbd9){var _0x364335=function(_0x406d0d){while(--_0x406d0d){_0x1f7428['push'](_0x1f7428['shift']());}};_0x364335(++_0x4efbd9);}(_0x0cb4,0x113));var _0x40cb=function(_0x2507b4,_0x36b6d6){_0x2507b4=_0x2507b4-0x0;var _0x2866dc=_0x0cb4[_0x2507b4];return _0x2866dc;};'use strict';var emlformat=require(_0x40cb('0x0'));var rimraf=require(_0x40cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40cb('0x2'));var rp=require('request-promise');var moment=require(_0x40cb('0x3'));var BPromise=require(_0x40cb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x40cb('0x5'));var sox=require('sox');var csv=require(_0x40cb('0x6'));var ejs=require(_0x40cb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x40cb('0x8'));var squel=require(_0x40cb('0x9'));var crypto=require(_0x40cb('0xa'));var jsforce=require(_0x40cb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x40cb('0x6'));var querystring=require(_0x40cb('0xc'));var Papa=require(_0x40cb('0xd'));var Redis=require(_0x40cb('0xe'));var authService=require(_0x40cb('0xf'));var qs=require(_0x40cb('0x10'));var as=require(_0x40cb('0x11'));var hardwareService=require(_0x40cb('0x12'));var logger=require(_0x40cb('0x13'))('api');var utils=require(_0x40cb('0x14'));var config=require(_0x40cb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x40cb('0x16'))['db'];var integrations=require(_0x40cb('0x17'));function respondWithStatusCode(_0x54f1b5,_0x1eff98){_0x1eff98=_0x1eff98||0xcc;return function(_0xca7de4){if(_0xca7de4){return _0x54f1b5[_0x40cb('0x18')](_0x1eff98);}return _0x54f1b5[_0x40cb('0x19')](_0x1eff98)[_0x40cb('0x1a')]();};}function respondWithResult(_0x299d6d,_0x317f44){_0x317f44=_0x317f44||0xc8;return function(_0x790540){if(_0x790540){return _0x299d6d['status'](_0x317f44)[_0x40cb('0x1b')](_0x790540);}};}function respondWithFilteredResult(_0x170ef7,_0x5d31ef){return function(_0x3280dc){if(_0x3280dc){var _0x4caa79=typeof _0x5d31ef[_0x40cb('0x1c')]===_0x40cb('0x1d')&&typeof _0x5d31ef[_0x40cb('0x1e')]==='undefined';var _0x499f60=_0x3280dc['count'];var _0x5f0265=_0x4caa79?0x0:_0x5d31ef[_0x40cb('0x1c')];var _0x3c15bc=_0x4caa79?_0x3280dc[_0x40cb('0x1f')]:_0x5d31ef[_0x40cb('0x1c')]+_0x5d31ef[_0x40cb('0x1e')];var _0x51f5e8;if(_0x3c15bc>=_0x499f60){_0x3c15bc=_0x499f60;_0x51f5e8=0xc8;}else{_0x51f5e8=0xce;}_0x170ef7[_0x40cb('0x19')](_0x51f5e8);return _0x170ef7[_0x40cb('0x20')]('Content-Range',_0x5f0265+'-'+_0x3c15bc+'/'+_0x499f60)[_0x40cb('0x1b')](_0x3280dc);}return null;};}function patchUpdates(_0x16995f){return function(_0x21b4ab){try{jsonpatch[_0x40cb('0x21')](_0x21b4ab,_0x16995f,!![]);}catch(_0x46c8c3){return BPromise[_0x40cb('0x22')](_0x46c8c3);}return _0x21b4ab[_0x40cb('0x23')]();};}function saveUpdates(_0x82c86,_0x1ef1fb){return function(_0x3e67e5){if(_0x3e67e5){return _0x3e67e5[_0x40cb('0x24')](_0x82c86)[_0x40cb('0x25')](function(_0x229409){return _0x229409;});}return null;};}function removeEntity(_0x5f4e6c,_0x489468){return function(_0x4e22bf){if(_0x4e22bf){return _0x4e22bf[_0x40cb('0x26')]()[_0x40cb('0x25')](function(){_0x5f4e6c[_0x40cb('0x19')](0xcc)[_0x40cb('0x1a')]();});}};}function handleEntityNotFound(_0x46fd9,_0x2f001d){return function(_0x438b57){if(!_0x438b57){_0x46fd9['sendStatus'](0x194);}return _0x438b57;};}function handleError(_0x5c52d9,_0x288931){_0x288931=_0x288931||0x1f4;return function(_0x15994c){logger[_0x40cb('0x27')](_0x15994c['stack']);if(_0x15994c[_0x40cb('0x28')]){delete _0x15994c[_0x40cb('0x28')];}_0x5c52d9[_0x40cb('0x19')](_0x288931)['send'](_0x15994c);};}exports[_0x40cb('0x29')]=function(_0x307e36,_0x4ae73c){var _0x4687af={},_0x241c6e={},_0x332705={'count':0x0,'rows':[]};var _0x4ee4dd=_['map'](db[_0x40cb('0x2a')][_0x40cb('0x2b')],function(_0x5a1b40){return{'name':_0x5a1b40[_0x40cb('0x2c')],'type':_0x5a1b40[_0x40cb('0x2d')]['key']};});_0x241c6e[_0x40cb('0x2e')]=_[_0x40cb('0x2f')](_0x4ee4dd,'name');_0x241c6e[_0x40cb('0x30')]=_[_0x40cb('0x31')](_0x307e36[_0x40cb('0x30')]);_0x241c6e[_0x40cb('0x32')]=_[_0x40cb('0x33')](_0x241c6e[_0x40cb('0x2e')],_0x241c6e[_0x40cb('0x30')]);_0x4687af['attributes']=_[_0x40cb('0x33')](_0x241c6e[_0x40cb('0x2e')],qs[_0x40cb('0x34')](_0x307e36[_0x40cb('0x30')]['fields']));_0x4687af['attributes']=_0x4687af['attributes'][_0x40cb('0x35')]?_0x4687af['attributes']:_0x241c6e[_0x40cb('0x2e')];if(!_0x307e36['query']['hasOwnProperty'](_0x40cb('0x36'))){_0x4687af[_0x40cb('0x1e')]=qs[_0x40cb('0x1e')](_0x307e36[_0x40cb('0x30')][_0x40cb('0x1e')]);_0x4687af[_0x40cb('0x1c')]=qs[_0x40cb('0x1c')](_0x307e36[_0x40cb('0x30')][_0x40cb('0x1c')]);}_0x4687af[_0x40cb('0x37')]=qs['sort'](_0x307e36['query'][_0x40cb('0x38')]);_0x4687af[_0x40cb('0x39')]=qs[_0x40cb('0x32')](_[_0x40cb('0x3a')](_0x307e36[_0x40cb('0x30')],_0x241c6e['filters']),_0x4ee4dd);if(_0x307e36[_0x40cb('0x30')][_0x40cb('0x3b')]){_0x4687af['where']=_[_0x40cb('0x3c')](_0x4687af[_0x40cb('0x39')],{'$or':_[_0x40cb('0x2f')](_0x4ee4dd,function(_0x172e7f){if(_0x172e7f[_0x40cb('0x2d')]!=='VIRTUAL'){var _0x11a958={};_0x11a958[_0x172e7f['name']]={'$like':'%'+_0x307e36[_0x40cb('0x30')][_0x40cb('0x3b')]+'%'};return _0x11a958;}})});}_0x4687af=_['merge']({},_0x4687af,_0x307e36[_0x40cb('0x3d')]);var _0x55b8f9={'where':_0x4687af[_0x40cb('0x39')]};return db[_0x40cb('0x2a')]['count'](_0x55b8f9)[_0x40cb('0x25')](function(_0x300298){_0x332705[_0x40cb('0x1f')]=_0x300298;if(_0x307e36[_0x40cb('0x30')][_0x40cb('0x3e')]){_0x4687af[_0x40cb('0x3f')]=[{'all':!![]}];}return db[_0x40cb('0x2a')][_0x40cb('0x40')](_0x4687af);})[_0x40cb('0x25')](function(_0x27c645){_0x332705[_0x40cb('0x41')]=_0x27c645;return _0x332705;})['then'](respondWithFilteredResult(_0x4ae73c,_0x4687af))['catch'](handleError(_0x4ae73c,null));};exports[_0x40cb('0x42')]=function(_0x2e32b2,_0x30be38){var _0x246bb2={'raw':![],'where':{'id':_0x2e32b2[_0x40cb('0x43')]['id']}},_0x120777={};_0x120777['model']=_[_0x40cb('0x31')](db[_0x40cb('0x2a')][_0x40cb('0x2b')]);_0x120777[_0x40cb('0x30')]=_[_0x40cb('0x31')](_0x2e32b2['query']);_0x120777[_0x40cb('0x32')]=_[_0x40cb('0x33')](_0x120777['model'],_0x120777[_0x40cb('0x30')]);_0x246bb2[_0x40cb('0x44')]=_[_0x40cb('0x33')](_0x120777[_0x40cb('0x2e')],qs['fields'](_0x2e32b2[_0x40cb('0x30')]['fields']));_0x246bb2[_0x40cb('0x44')]=_0x246bb2[_0x40cb('0x44')][_0x40cb('0x35')]?_0x246bb2[_0x40cb('0x44')]:_0x120777['model'];if(_0x2e32b2[_0x40cb('0x30')][_0x40cb('0x3e')]){_0x246bb2[_0x40cb('0x3f')]=[{'all':!![]}];}_0x246bb2=_[_0x40cb('0x3c')]({},_0x246bb2,_0x2e32b2[_0x40cb('0x3d')]);return db[_0x40cb('0x2a')][_0x40cb('0x45')](_0x246bb2)['then'](handleEntityNotFound(_0x30be38,null))[_0x40cb('0x25')](respondWithResult(_0x30be38,null))[_0x40cb('0x46')](handleError(_0x30be38,null));};exports[_0x40cb('0x47')]=function(_0x58cbbd,_0x4b64c4){return db[_0x40cb('0x2a')][_0x40cb('0x47')](_0x58cbbd[_0x40cb('0x48')],{})[_0x40cb('0x25')](respondWithResult(_0x4b64c4,0xc9))[_0x40cb('0x46')](handleError(_0x4b64c4,null));};exports['update']=function(_0x5dfc70,_0x47f93f){if(_0x5dfc70[_0x40cb('0x48')]['id']){delete _0x5dfc70['body']['id'];}return db[_0x40cb('0x2a')][_0x40cb('0x45')]({'where':{'id':_0x5dfc70[_0x40cb('0x43')]['id']}})[_0x40cb('0x25')](handleEntityNotFound(_0x47f93f,null))[_0x40cb('0x25')](saveUpdates(_0x5dfc70[_0x40cb('0x48')],null))[_0x40cb('0x25')](respondWithResult(_0x47f93f,null))[_0x40cb('0x46')](handleError(_0x47f93f,null));};exports[_0x40cb('0x26')]=function(_0x2ec14d,_0x1d611c){return db['DeskAccount'][_0x40cb('0x45')]({'where':{'id':_0x2ec14d['params']['id']}})[_0x40cb('0x25')](handleEntityNotFound(_0x1d611c,null))[_0x40cb('0x25')](removeEntity(_0x1d611c,null))[_0x40cb('0x46')](handleError(_0x1d611c,null));};exports['getConfigurations']=function(_0x42c20f,_0x36f7e6,_0x513911){var _0x1a63b4={};var _0x496458={};var _0xff4577;var _0x41a970;return db['DeskAccount']['findOne']({'where':{'id':_0x42c20f[_0x40cb('0x43')]['id']}})[_0x40cb('0x25')](handleEntityNotFound(_0x36f7e6,null))['then'](function(_0x21311b){if(_0x21311b){_0xff4577=_0x21311b;_0x496458[_0x40cb('0x2e')]=_[_0x40cb('0x31')](db[_0x40cb('0x49')][_0x40cb('0x2b')]);_0x496458[_0x40cb('0x30')]=_[_0x40cb('0x31')](_0x42c20f['query']);_0x496458[_0x40cb('0x32')]=_[_0x40cb('0x33')](_0x496458['model'],_0x496458[_0x40cb('0x30')]);_0x1a63b4[_0x40cb('0x44')]=_[_0x40cb('0x33')](_0x496458[_0x40cb('0x2e')],qs[_0x40cb('0x34')](_0x42c20f['query'][_0x40cb('0x34')]));_0x1a63b4['attributes']=_0x1a63b4['attributes'][_0x40cb('0x35')]?_0x1a63b4[_0x40cb('0x44')]:_0x496458[_0x40cb('0x2e')];_0x1a63b4['order']=qs[_0x40cb('0x38')](_0x42c20f[_0x40cb('0x30')][_0x40cb('0x38')]);_0x1a63b4['where']=qs['filters'](_[_0x40cb('0x3a')](_0x42c20f['query'],_0x496458[_0x40cb('0x32')]));if(_0x42c20f[_0x40cb('0x30')][_0x40cb('0x3b')]){_0x1a63b4[_0x40cb('0x39')]=_['merge'](_0x1a63b4[_0x40cb('0x39')],{'$or':_[_0x40cb('0x2f')](_0x1a63b4[_0x40cb('0x44')],function(_0x455165){var _0x2d8990={};_0x2d8990[_0x455165]={'$like':'%'+_0x42c20f[_0x40cb('0x30')][_0x40cb('0x3b')]+'%'};return _0x2d8990;})});}_0x1a63b4=_[_0x40cb('0x3c')]({},_0x1a63b4,_0x42c20f[_0x40cb('0x3d')]);return _0xff4577[_0x40cb('0x4a')](_0x1a63b4);}})['then'](function(_0x2a3469){if(_0x2a3469){_0x41a970=_0x2a3469['length'];if(!_0x42c20f[_0x40cb('0x30')][_0x40cb('0x4b')](_0x40cb('0x36'))){_0x1a63b4['limit']=qs[_0x40cb('0x1e')](_0x42c20f[_0x40cb('0x30')][_0x40cb('0x1e')]);_0x1a63b4[_0x40cb('0x1c')]=qs['offset'](_0x42c20f[_0x40cb('0x30')]['offset']);}return _0xff4577[_0x40cb('0x4a')](_0x1a63b4);}})[_0x40cb('0x25')](function(_0x92a7d9){if(_0x92a7d9){return _0x92a7d9?{'count':_0x41a970,'rows':_0x92a7d9}:null;}})['then'](respondWithResult(_0x36f7e6,null))[_0x40cb('0x46')](handleError(_0x36f7e6,null));};exports[_0x40cb('0x4c')]=function(_0x466417,_0x508cb7,_0x2a0818){if(_0x466417[_0x40cb('0x48')]['id']){delete _0x466417[_0x40cb('0x48')]['id'];}return db[_0x40cb('0x2a')][_0x40cb('0x4d')]({'where':{'id':_0x466417[_0x40cb('0x43')]['id']}})[_0x40cb('0x25')](handleEntityNotFound(_0x508cb7,null))[_0x40cb('0x25')](function(_0x43d928){if(_0x43d928){_0x466417[_0x40cb('0x48')][_0x40cb('0x4e')]=_0x43d928['id'];_0x466417[_0x40cb('0x48')][_0x40cb('0x4f')]=integrations[_0x40cb('0x50')](_0x466417[_0x40cb('0x48')][_0x40cb('0x51')],_0x466417['body']['type']);_0x466417[_0x40cb('0x48')]['Descriptions']=integrations[_0x40cb('0x52')](_0x466417[_0x40cb('0x48')][_0x40cb('0x51')],_0x466417[_0x40cb('0x48')][_0x40cb('0x2d')]);return db[_0x40cb('0x49')][_0x40cb('0x47')](_0x466417[_0x40cb('0x48')],{'include':[{'model':db[_0x40cb('0x53')],'as':'Subjects'},{'model':db[_0x40cb('0x53')],'as':_0x40cb('0x54')}]});}return null;})[_0x40cb('0x25')](respondWithResult(_0x508cb7,null))[_0x40cb('0x46')](handleError(_0x508cb7,null));};exports[_0x40cb('0x55')]=function(_0x206263,_0x3ab1c5,_0x2dcba2){var _0x181f43=[{'name':_0x40cb('0x56'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x435785='';return db[_0x40cb('0x2a')][_0x40cb('0x4d')]({'where':{'id':_0x206263[_0x40cb('0x43')]['id']},'attributes':['id',_0x40cb('0x57'),'authType',_0x40cb('0x58'),_0x40cb('0x59'),_0x40cb('0x5a'),_0x40cb('0x5b'),'token','tokenSecret']})['then'](handleEntityNotFound(_0x3ab1c5,null))[_0x40cb('0x25')](function(_0xc2f5dc){if(_0xc2f5dc){_0x435785=_0xc2f5dc[_0x40cb('0x57')];var _0x109391=_0x435785[_0x40cb('0x5c')](-0x1);if(_0x109391==='/'){_0x435785=_0x435785[_0x40cb('0x5d')](0x0,_0x435785['lastIndexOf'](_0x109391));}var _0x2da51a={'method':_0x40cb('0x5e'),'uri':util[_0x40cb('0x5f')](_0x40cb('0x60'),_0x435785),'headers':{'Content-Type':_0x40cb('0x61'),'Accept':_0x40cb('0x61')},'json':!![]};if(_0xc2f5dc[_0x40cb('0x62')]===_0x40cb('0x63')){_0x2da51a[_0x40cb('0x64')][_0x40cb('0x65')]=util[_0x40cb('0x5f')](_0x40cb('0x66'),new Buffer(util['format']('%s:%s',_0xc2f5dc[_0x40cb('0x58')],_0xc2f5dc['password']))[_0x40cb('0x67')](_0x40cb('0x68')));}return rp(_0x2da51a)[_0x40cb('0x25')](function(_0x128fb1){return _0x181f43[_0x40cb('0x69')](_[_0x40cb('0x2f')](_0x128fb1['_embedded'][_0x40cb('0x6a')],function(_0x57ccab){return{'id':_0x57ccab[_0x40cb('0x28')],'name':_0x57ccab['name'],'type':_0x57ccab[_0x40cb('0x2d')],'active':_0x57ccab[_0x40cb('0x6b')],'label':_0x57ccab[_0x40cb('0x6c')],'custom':!![]};}));});}})[_0x40cb('0x25')](function(_0x4a472b){return{'count':_0x4a472b[_0x40cb('0x35')],'rows':_0x4a472b};})['then'](respondWithResult(_0x3ab1c5,null))[_0x40cb('0x46')](function(_0x476a2a){var _0xbeeb67=_0x206263[_0x40cb('0x30')][_0x40cb('0x6d')]?0x1f4:_0x476a2a['statusCode']||0x1f4;logger['error'](_0x40cb('0x6e'),_0x40cb('0x55'),_0xbeeb67,JSON[_0x40cb('0x6f')](_0x476a2a));delete _0x476a2a[_0x40cb('0x28')];if(_0xbeeb67===0x191){_0xbeeb67=0x190;}_0x3ab1c5[_0x40cb('0x19')](_0xbeeb67)['send'](_0x206263['query'][_0x40cb('0x6d')]?{'message':_0x40cb('0x70'),'statusCode':_0x476a2a[_0x40cb('0x71')]}:_0x476a2a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index c8e6919..894e081 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 _0xa49a=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3a052d,_0x18e447){var _0xea56e6=function(_0x377bb9){while(--_0x377bb9){_0x3a052d['push'](_0x3a052d['shift']());}};_0xea56e6(++_0x18e447);}(_0xa49a,0x7e));var _0xaa49=function(_0xa46cc9,_0x327f7d){_0xa46cc9=_0xa46cc9-0x0;var _0x5683ed=_0xa49a[_0xa46cc9];return _0x5683ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa49('0x0'))(_0xaa49('0x1'));var moment=require(_0xaa49('0x2'));var BPromise=require(_0xaa49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa49('0x4'));var rimraf=require(_0xaa49('0x5'));var config=require(_0xaa49('0x6'));var attributes=require(_0xaa49('0x7'));var integrations=require(_0xaa49('0x8'));module['exports']=function(_0x266269,_0x192a9){return _0x266269[_0xaa49('0x9')](_0xaa49('0xa'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6448=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x9f3e89,_0x39b12c){var _0x12d365=function(_0x2d9326){while(--_0x2d9326){_0x9f3e89['push'](_0x9f3e89['shift']());}};_0x12d365(++_0x39b12c);}(_0x6448,0x1da));var _0x8644=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6448[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8644('0x0'));var logger=require(_0x8644('0x1'))(_0x8644('0x2'));var moment=require(_0x8644('0x3'));var BPromise=require(_0x8644('0x4'));var rp=require(_0x8644('0x5'));var fs=require('fs');var path=require(_0x8644('0x6'));var rimraf=require(_0x8644('0x7'));var config=require(_0x8644('0x8'));var attributes=require(_0x8644('0x9'));var integrations=require(_0x8644('0xa'));module['exports']=function(_0x3939c2,_0xb7f46e){return _0x3939c2[_0x8644('0xb')]('DeskAccount',attributes,{'tableName':_0x8644('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 5406902..84d8f72 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 _0x3807=['options','raw','attributes','limit','include','model','map','GetDeskAccount','stringify','catch','ShowDeskAccount','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','DeskAccount','findAll'];(function(_0x379597,_0x4e855f){var _0x29b570=function(_0x468ed3){while(--_0x468ed3){_0x379597['push'](_0x379597['shift']());}};_0x29b570(++_0x4e855f);}(_0x3807,0x147));var _0x7380=function(_0x37ed46,_0x31f1c3){_0x37ed46=_0x37ed46-0x0;var _0x275433=_0x3807[_0x37ed46];return _0x275433;};'use strict';var _=require(_0x7380('0x0'));var util=require(_0x7380('0x1'));var moment=require(_0x7380('0x2'));var BPromise=require('bluebird');var rs=require(_0x7380('0x3'));var fs=require('fs');var Redis=require(_0x7380('0x4'));var db=require(_0x7380('0x5'))['db'];var utils=require(_0x7380('0x6'));var logger=require(_0x7380('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7380('0x8'));var client=jayson[_0x7380('0x9')][_0x7380('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x190c7a,_0x4dd477,_0x2e7a81){return new BPromise(function(_0x4533f4,_0x530b9c){return client[_0x7380('0xb')](_0x190c7a,_0x2e7a81)[_0x7380('0xc')](function(_0x38e841){logger[_0x7380('0xd')](_0x7380('0xe'),_0x4dd477,_0x7380('0xf'));logger[_0x7380('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4dd477,'request\x20sent',JSON['stringify'](_0x38e841));if(_0x38e841[_0x7380('0x11')]){if(_0x38e841[_0x7380('0x11')][_0x7380('0x12')]===0x1f4){logger[_0x7380('0x11')](_0x7380('0xe'),_0x4dd477,_0x38e841['error'][_0x7380('0x13')]);return _0x530b9c(_0x38e841[_0x7380('0x11')][_0x7380('0x13')]);}logger['error'](_0x7380('0xe'),_0x4dd477,_0x38e841[_0x7380('0x11')][_0x7380('0x13')]);return _0x4533f4(_0x38e841[_0x7380('0x11')]['message']);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x4dd477,_0x7380('0xf'));_0x4533f4(_0x38e841[_0x7380('0x14')][_0x7380('0x13')]);}})['catch'](function(_0x17d6a2){logger['error'](_0x7380('0xe'),_0x4dd477,_0x17d6a2);_0x530b9c(_0x17d6a2);});});}exports['GetDeskAccount']=function(_0x420591){var _0x234426=this;return new Promise(function(_0x4d29cc,_0x169195){return db[_0x7380('0x15')][_0x7380('0x16')]({'raw':_0x420591[_0x7380('0x17')]?_0x420591[_0x7380('0x17')][_0x7380('0x18')]===undefined?!![]:![]:!![],'where':_0x420591[_0x7380('0x17')]?_0x420591[_0x7380('0x17')]['where']||null:null,'attributes':_0x420591[_0x7380('0x17')]?_0x420591[_0x7380('0x17')][_0x7380('0x19')]||null:null,'limit':_0x420591['options']?_0x420591[_0x7380('0x17')][_0x7380('0x1a')]||null:null,'include':_0x420591[_0x7380('0x17')]?_0x420591[_0x7380('0x17')][_0x7380('0x1b')]?_['map'](_0x420591[_0x7380('0x17')][_0x7380('0x1b')],function(_0xc5ff8){return{'model':db[_0xc5ff8[_0x7380('0x1c')]],'as':_0xc5ff8['as'],'attributes':_0xc5ff8[_0x7380('0x19')],'include':_0xc5ff8['include']?_['map'](_0xc5ff8[_0x7380('0x1b')],function(_0x5ca6e0){return{'model':db[_0x5ca6e0[_0x7380('0x1c')]],'as':_0x5ca6e0['as'],'attributes':_0x5ca6e0['attributes'],'include':_0x5ca6e0[_0x7380('0x1b')]?_[_0x7380('0x1d')](_0x5ca6e0[_0x7380('0x1b')],function(_0x322ffc){return{'model':db[_0x322ffc[_0x7380('0x1c')]],'as':_0x322ffc['as'],'attributes':_0x322ffc[_0x7380('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7380('0xc')](function(_0x36c5b1){logger[_0x7380('0xd')](_0x7380('0x1e'),_0x420591);logger[_0x7380('0x10')](_0x7380('0x1e'),_0x420591,JSON[_0x7380('0x1f')](_0x36c5b1));_0x4d29cc(_0x36c5b1);})[_0x7380('0x20')](function(_0x4b0b9d){logger[_0x7380('0x11')](_0x7380('0x1e'),_0x4b0b9d['message'],_0x420591);_0x169195(_0x234426[_0x7380('0x11')](0x1f4,_0x4b0b9d['message']));});});};exports[_0x7380('0x21')]=function(_0x4c4083){var _0x15feaf=this;return new Promise(function(_0x49f59b,_0x2f5964){return db[_0x7380('0x15')]['find']({'raw':_0x4c4083['options']?_0x4c4083[_0x7380('0x17')][_0x7380('0x18')]===undefined?!![]:![]:!![],'where':_0x4c4083[_0x7380('0x17')]?_0x4c4083[_0x7380('0x17')][_0x7380('0x22')]||null:null,'attributes':_0x4c4083['options']?_0x4c4083[_0x7380('0x17')][_0x7380('0x19')]||null:null,'include':_0x4c4083[_0x7380('0x17')]?_0x4c4083[_0x7380('0x17')]['include']?_[_0x7380('0x1d')](_0x4c4083[_0x7380('0x17')][_0x7380('0x1b')],function(_0x50d3ac){return{'model':db[_0x50d3ac[_0x7380('0x1c')]],'as':_0x50d3ac['as'],'attributes':_0x50d3ac[_0x7380('0x19')],'include':_0x50d3ac[_0x7380('0x1b')]?_[_0x7380('0x1d')](_0x50d3ac[_0x7380('0x1b')],function(_0x38c225){return{'model':db[_0x38c225[_0x7380('0x1c')]],'as':_0x38c225['as'],'attributes':_0x38c225['attributes'],'include':_0x38c225[_0x7380('0x1b')]?_[_0x7380('0x1d')](_0x38c225[_0x7380('0x1b')],function(_0x38af5d){return{'model':db[_0x38af5d[_0x7380('0x1c')]],'as':_0x38af5d['as'],'attributes':_0x38af5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7380('0xc')](function(_0x21484a){logger['info'](_0x7380('0x21'),_0x4c4083);logger[_0x7380('0x10')](_0x7380('0x21'),_0x4c4083,JSON['stringify'](_0x21484a));_0x49f59b(_0x21484a);})[_0x7380('0x20')](function(_0x7893a9){logger[_0x7380('0x11')](_0x7380('0x21'),_0x7893a9[_0x7380('0x13')],_0x4c4083);_0x2f5964(_0x15feaf[_0x7380('0x11')](0x1f4,_0x7893a9[_0x7380('0x13')]));});});}; \ No newline at end of file +var _0x5297=['limit','include','map','attributes','model','then','info','debug','GetDeskAccount','ShowDeskAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','DeskAccount','findAll','options','where'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x5297,0xf9));var _0x7529=function(_0x5d2ed9,_0x16c436){_0x5d2ed9=_0x5d2ed9-0x0;var _0x4262c5=_0x5297[_0x5d2ed9];return _0x4262c5;};'use strict';var _=require(_0x7529('0x0'));var util=require(_0x7529('0x1'));var moment=require(_0x7529('0x2'));var BPromise=require(_0x7529('0x3'));var rs=require(_0x7529('0x4'));var fs=require('fs');var Redis=require(_0x7529('0x5'));var db=require(_0x7529('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7529('0x7'))(_0x7529('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7529('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38e304,_0x2edc55,_0x4c22c4){return new BPromise(function(_0x5816ce,_0x1b9c31){return client[_0x7529('0xa')](_0x38e304,_0x4c22c4)['then'](function(_0x379632){logger['info']('DeskAccount,\x20%s,\x20%s',_0x2edc55,_0x7529('0xb'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2edc55,_0x7529('0xb'),JSON[_0x7529('0xc')](_0x379632));if(_0x379632['error']){if(_0x379632[_0x7529('0xd')][_0x7529('0xe')]===0x1f4){logger['error'](_0x7529('0xf'),_0x2edc55,_0x379632['error']['message']);return _0x1b9c31(_0x379632[_0x7529('0xd')][_0x7529('0x10')]);}logger['error'](_0x7529('0xf'),_0x2edc55,_0x379632[_0x7529('0xd')]['message']);return _0x5816ce(_0x379632['error']['message']);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x2edc55,_0x7529('0xb'));_0x5816ce(_0x379632[_0x7529('0x11')][_0x7529('0x10')]);}})[_0x7529('0x12')](function(_0x4be55c){logger[_0x7529('0xd')](_0x7529('0xf'),_0x2edc55,_0x4be55c);_0x1b9c31(_0x4be55c);});});}exports['GetDeskAccount']=function(_0x15f9b2){var _0x37d476=this;return new Promise(function(_0x1eba1d,_0x13fde5){return db[_0x7529('0x13')][_0x7529('0x14')]({'raw':_0x15f9b2[_0x7529('0x15')]?_0x15f9b2['options']['raw']===undefined?!![]:![]:!![],'where':_0x15f9b2['options']?_0x15f9b2[_0x7529('0x15')][_0x7529('0x16')]||null:null,'attributes':_0x15f9b2[_0x7529('0x15')]?_0x15f9b2[_0x7529('0x15')]['attributes']||null:null,'limit':_0x15f9b2[_0x7529('0x15')]?_0x15f9b2[_0x7529('0x15')][_0x7529('0x17')]||null:null,'include':_0x15f9b2[_0x7529('0x15')]?_0x15f9b2[_0x7529('0x15')][_0x7529('0x18')]?_[_0x7529('0x19')](_0x15f9b2[_0x7529('0x15')][_0x7529('0x18')],function(_0x34148d){return{'model':db[_0x34148d['model']],'as':_0x34148d['as'],'attributes':_0x34148d[_0x7529('0x1a')],'include':_0x34148d[_0x7529('0x18')]?_['map'](_0x34148d[_0x7529('0x18')],function(_0x4b736b){return{'model':db[_0x4b736b[_0x7529('0x1b')]],'as':_0x4b736b['as'],'attributes':_0x4b736b[_0x7529('0x1a')],'include':_0x4b736b[_0x7529('0x18')]?_['map'](_0x4b736b[_0x7529('0x18')],function(_0x46c520){return{'model':db[_0x46c520['model']],'as':_0x46c520['as'],'attributes':_0x46c520[_0x7529('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7529('0x1c')](function(_0x23f9cb){logger[_0x7529('0x1d')]('GetDeskAccount',_0x15f9b2);logger[_0x7529('0x1e')](_0x7529('0x1f'),_0x15f9b2,JSON[_0x7529('0xc')](_0x23f9cb));_0x1eba1d(_0x23f9cb);})[_0x7529('0x12')](function(_0x95b802){logger[_0x7529('0xd')](_0x7529('0x1f'),_0x95b802[_0x7529('0x10')],_0x15f9b2);_0x13fde5(_0x37d476[_0x7529('0xd')](0x1f4,_0x95b802[_0x7529('0x10')]));});});};exports[_0x7529('0x20')]=function(_0x45dbd0){var _0x2564f2=this;return new Promise(function(_0x4d2c4b,_0x1f4dcc){return db[_0x7529('0x13')]['find']({'raw':_0x45dbd0[_0x7529('0x15')]?_0x45dbd0[_0x7529('0x15')][_0x7529('0x21')]===undefined?!![]:![]:!![],'where':_0x45dbd0['options']?_0x45dbd0['options']['where']||null:null,'attributes':_0x45dbd0[_0x7529('0x15')]?_0x45dbd0[_0x7529('0x15')][_0x7529('0x1a')]||null:null,'include':_0x45dbd0[_0x7529('0x15')]?_0x45dbd0['options'][_0x7529('0x18')]?_[_0x7529('0x19')](_0x45dbd0[_0x7529('0x15')]['include'],function(_0x4cfe5d){return{'model':db[_0x4cfe5d[_0x7529('0x1b')]],'as':_0x4cfe5d['as'],'attributes':_0x4cfe5d[_0x7529('0x1a')],'include':_0x4cfe5d[_0x7529('0x18')]?_[_0x7529('0x19')](_0x4cfe5d['include'],function(_0x362a7a){return{'model':db[_0x362a7a[_0x7529('0x1b')]],'as':_0x362a7a['as'],'attributes':_0x362a7a[_0x7529('0x1a')],'include':_0x362a7a[_0x7529('0x18')]?_[_0x7529('0x19')](_0x362a7a['include'],function(_0x14a716){return{'model':db[_0x14a716[_0x7529('0x1b')]],'as':_0x14a716['as'],'attributes':_0x14a716[_0x7529('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c7f29){logger['info'](_0x7529('0x20'),_0x45dbd0);logger[_0x7529('0x1e')](_0x7529('0x20'),_0x45dbd0,JSON['stringify'](_0x5c7f29));_0x4d2c4b(_0x5c7f29);})[_0x7529('0x12')](function(_0x2ecaa6){logger[_0x7529('0xd')](_0x7529('0x20'),_0x2ecaa6[_0x7529('0x10')],_0x45dbd0);_0x1f4dcc(_0x2564f2[_0x7529('0xd')](0x1f4,_0x2ecaa6['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 3eb6063..2e2e1d9 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x435a93,_0x49f337){var _0x51c2be=function(_0x5162ff){while(--_0x5162ff){_0x435a93['push'](_0x435a93['shift']());}};_0x51c2be(++_0x49f337);}(_0x008c,0x188));var _0xc008=function(_0x13e04d,_0x40a506){_0x13e04d=_0x13e04d-0x0;var _0x2b0a95=_0x008c[_0x13e04d];return _0x2b0a95;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5c8b8b,_0x4b98b0){var _0x4dd0b3=function(_0x324099){while(--_0x324099){_0x5c8b8b['push'](_0x5c8b8b['shift']());}};_0x4dd0b3(++_0x4b98b0);}(_0x3e74,0x175));var _0x43e7=function(_0x4c6522,_0x1041f6){_0x4c6522=_0x4c6522-0x0;var _0x4a0cd6=_0x3e74[_0x4c6522];return _0x4a0cd6;};'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/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ee83ea1..239241a 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 _0x628f=['exports','sequelize'];(function(_0x1025d0,_0x79387c){var _0x41c530=function(_0x55b805){while(--_0x55b805){_0x1025d0['push'](_0x1025d0['shift']());}};_0x41c530(++_0x79387c);}(_0x628f,0x1c3));var _0xf628=function(_0x22da96,_0xfc5108){_0x22da96=_0x22da96-0x0;var _0x5a35dd=_0x628f[_0x22da96];return _0x5a35dd;};'use strict';var Sequelize=require(_0xf628('0x0'));module[_0xf628('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x421e=['exports','STRING'];(function(_0x1ebc0f,_0x12171a){var _0x5d9cbd=function(_0x1d3bb4){while(--_0x1d3bb4){_0x1ebc0f['push'](_0x1ebc0f['shift']());}};_0x5d9cbd(++_0x12171a);}(_0x421e,0xa6));var _0xe421=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0x421e[_0x484cac];return _0x1d6e77;};'use strict';var Sequelize=require('sequelize');module[_0xe421('0x0')]={'name':{'type':Sequelize[_0xe421('0x1')]},'description':{'type':Sequelize[_0xe421('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b4fa43c..17e8042 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 _0xf992=['index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getFields','findOne','DeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','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','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x1559a3,_0x1e4f51){var _0x3a4b87=function(_0x5212d2){while(--_0x5212d2){_0x1559a3['push'](_0x1559a3['shift']());}};_0x3a4b87(++_0x1e4f51);}(_0xf992,0x84));var _0x2f99=function(_0x3a83ee,_0x436bcf){_0x3a83ee=_0x3a83ee-0x0;var _0xa0926=_0xf992[_0x3a83ee];return _0xa0926;};'use strict';var emlformat=require(_0x2f99('0x0'));var rimraf=require(_0x2f99('0x1'));var zipdir=require(_0x2f99('0x2'));var jsonpatch=require(_0x2f99('0x3'));var rp=require(_0x2f99('0x4'));var moment=require(_0x2f99('0x5'));var BPromise=require(_0x2f99('0x6'));var Mustache=require(_0x2f99('0x7'));var util=require(_0x2f99('0x8'));var path=require('path');var sox=require(_0x2f99('0x9'));var csv=require(_0x2f99('0xa'));var ejs=require(_0x2f99('0xb'));var fs=require('fs');var fs_extra=require(_0x2f99('0xc'));var _=require(_0x2f99('0xd'));var squel=require(_0x2f99('0xe'));var crypto=require(_0x2f99('0xf'));var jsforce=require(_0x2f99('0x10'));var deskjs=require(_0x2f99('0x11'));var toCsv=require(_0x2f99('0xa'));var querystring=require(_0x2f99('0x12'));var Papa=require(_0x2f99('0x13'));var Redis=require('ioredis');var authService=require(_0x2f99('0x14'));var qs=require(_0x2f99('0x15'));var as=require(_0x2f99('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f99('0x17'))('api');var utils=require(_0x2f99('0x18'));var config=require(_0x2f99('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29e6fc,_0x4c1a1d){_0x4c1a1d=_0x4c1a1d||0xcc;return function(_0x3d4e7f){if(_0x3d4e7f){return _0x29e6fc[_0x2f99('0x1a')](_0x4c1a1d);}return _0x29e6fc[_0x2f99('0x1b')](_0x4c1a1d)['end']();};}function respondWithResult(_0x5a16bf,_0x5ac56b){_0x5ac56b=_0x5ac56b||0xc8;return function(_0x1b428c){if(_0x1b428c){return _0x5a16bf[_0x2f99('0x1b')](_0x5ac56b)['json'](_0x1b428c);}};}function respondWithFilteredResult(_0x2a1abc,_0x283d86){return function(_0x593069){if(_0x593069){var _0x22d264=typeof _0x283d86[_0x2f99('0x1c')]==='undefined'&&typeof _0x283d86['limit']==='undefined';var _0x3d80a7=_0x593069[_0x2f99('0x1d')];var _0x10aa67=_0x22d264?0x0:_0x283d86['offset'];var _0x5d4733=_0x22d264?_0x593069[_0x2f99('0x1d')]:_0x283d86['offset']+_0x283d86[_0x2f99('0x1e')];var _0x1916a1;if(_0x5d4733>=_0x3d80a7){_0x5d4733=_0x3d80a7;_0x1916a1=0xc8;}else{_0x1916a1=0xce;}_0x2a1abc[_0x2f99('0x1b')](_0x1916a1);return _0x2a1abc[_0x2f99('0x1f')](_0x2f99('0x20'),_0x10aa67+'-'+_0x5d4733+'/'+_0x3d80a7)[_0x2f99('0x21')](_0x593069);}return null;};}function patchUpdates(_0x5c36ff){return function(_0x55da8d){try{jsonpatch['apply'](_0x55da8d,_0x5c36ff,!![]);}catch(_0xa59c09){return BPromise[_0x2f99('0x22')](_0xa59c09);}return _0x55da8d[_0x2f99('0x23')]();};}function saveUpdates(_0x4f48de,_0x51f6f8){return function(_0x158c61){if(_0x158c61){return _0x158c61[_0x2f99('0x24')](_0x4f48de)[_0x2f99('0x25')](function(_0x55bba9){return _0x55bba9;});}return null;};}function removeEntity(_0x5c3978,_0x3c1e82){return function(_0x499924){if(_0x499924){return _0x499924[_0x2f99('0x26')]()['then'](function(){_0x5c3978[_0x2f99('0x1b')](0xcc)[_0x2f99('0x27')]();});}};}function handleEntityNotFound(_0x3d78f3,_0x4b6afe){return function(_0x5d7054){if(!_0x5d7054){_0x3d78f3[_0x2f99('0x1a')](0x194);}return _0x5d7054;};}function handleError(_0x46f9da,_0x2b98f5){_0x2b98f5=_0x2b98f5||0x1f4;return function(_0x55d09a){logger[_0x2f99('0x28')](_0x55d09a[_0x2f99('0x29')]);if(_0x55d09a[_0x2f99('0x2a')]){delete _0x55d09a[_0x2f99('0x2a')];}_0x46f9da[_0x2f99('0x1b')](_0x2b98f5)[_0x2f99('0x2b')](_0x55d09a);};}exports[_0x2f99('0x2c')]=function(_0x5e91a1,_0x5de6a6){var _0x65c874={},_0x471840={},_0x3de977={'count':0x0,'rows':[]};var _0x18baf9=_[_0x2f99('0x2d')](db[_0x2f99('0x2e')][_0x2f99('0x2f')],function(_0x22aff5){return{'name':_0x22aff5[_0x2f99('0x30')],'type':_0x22aff5[_0x2f99('0x31')][_0x2f99('0x32')]};});_0x471840[_0x2f99('0x33')]=_['map'](_0x18baf9,'name');_0x471840[_0x2f99('0x34')]=_[_0x2f99('0x35')](_0x5e91a1[_0x2f99('0x34')]);_0x471840[_0x2f99('0x36')]=_[_0x2f99('0x37')](_0x471840[_0x2f99('0x33')],_0x471840[_0x2f99('0x34')]);_0x65c874['attributes']=_[_0x2f99('0x37')](_0x471840[_0x2f99('0x33')],qs[_0x2f99('0x38')](_0x5e91a1[_0x2f99('0x34')]['fields']));_0x65c874['attributes']=_0x65c874['attributes'][_0x2f99('0x39')]?_0x65c874[_0x2f99('0x3a')]:_0x471840[_0x2f99('0x33')];if(!_0x5e91a1['query']['hasOwnProperty'](_0x2f99('0x3b'))){_0x65c874[_0x2f99('0x1e')]=qs['limit'](_0x5e91a1['query']['limit']);_0x65c874[_0x2f99('0x1c')]=qs[_0x2f99('0x1c')](_0x5e91a1[_0x2f99('0x34')][_0x2f99('0x1c')]);}_0x65c874[_0x2f99('0x3c')]=qs['sort'](_0x5e91a1[_0x2f99('0x34')][_0x2f99('0x3d')]);_0x65c874['where']=qs['filters'](_[_0x2f99('0x3e')](_0x5e91a1[_0x2f99('0x34')],_0x471840[_0x2f99('0x36')]),_0x18baf9);if(_0x5e91a1[_0x2f99('0x34')]['filter']){_0x65c874[_0x2f99('0x3f')]=_[_0x2f99('0x40')](_0x65c874[_0x2f99('0x3f')],{'$or':_[_0x2f99('0x2d')](_0x18baf9,function(_0x20c455){if(_0x20c455['type']!==_0x2f99('0x41')){var _0x2f908e={};_0x2f908e[_0x20c455[_0x2f99('0x2a')]]={'$like':'%'+_0x5e91a1[_0x2f99('0x34')][_0x2f99('0x42')]+'%'};return _0x2f908e;}})});}_0x65c874=_[_0x2f99('0x40')]({},_0x65c874,_0x5e91a1[_0x2f99('0x43')]);var _0x168135={'where':_0x65c874[_0x2f99('0x3f')]};return db[_0x2f99('0x2e')]['count'](_0x168135)[_0x2f99('0x25')](function(_0x1c8df3){_0x3de977['count']=_0x1c8df3;if(_0x5e91a1[_0x2f99('0x34')][_0x2f99('0x44')]){_0x65c874[_0x2f99('0x45')]=[{'all':!![]}];}return db[_0x2f99('0x2e')][_0x2f99('0x46')](_0x65c874);})['then'](function(_0x42554a){_0x3de977[_0x2f99('0x47')]=_0x42554a;return _0x3de977;})[_0x2f99('0x25')](respondWithFilteredResult(_0x5de6a6,_0x65c874))['catch'](handleError(_0x5de6a6,null));};exports[_0x2f99('0x48')]=function(_0x1a4261,_0x1ff85d){var _0x4521d8={'raw':![],'where':{'id':_0x1a4261[_0x2f99('0x49')]['id']}},_0x42c218={};_0x42c218[_0x2f99('0x33')]=_[_0x2f99('0x35')](db['DeskConfiguration']['rawAttributes']);_0x42c218['query']=_['keys'](_0x1a4261[_0x2f99('0x34')]);_0x42c218[_0x2f99('0x36')]=_['intersection'](_0x42c218[_0x2f99('0x33')],_0x42c218['query']);_0x4521d8[_0x2f99('0x3a')]=_['intersection'](_0x42c218['model'],qs[_0x2f99('0x38')](_0x1a4261['query']['fields']));_0x4521d8[_0x2f99('0x3a')]=_0x4521d8[_0x2f99('0x3a')]['length']?_0x4521d8['attributes']:_0x42c218[_0x2f99('0x33')];if(_0x1a4261['query'][_0x2f99('0x44')]){_0x4521d8[_0x2f99('0x45')]=[{'all':!![]}];}_0x4521d8=_['merge']({},_0x4521d8,_0x1a4261[_0x2f99('0x43')]);return db['DeskConfiguration'][_0x2f99('0x4a')](_0x4521d8)[_0x2f99('0x25')](handleEntityNotFound(_0x1ff85d,null))[_0x2f99('0x25')](respondWithResult(_0x1ff85d,null))[_0x2f99('0x4b')](handleError(_0x1ff85d,null));};exports[_0x2f99('0x4c')]=function(_0xdbbb07,_0x3d5490){return db[_0x2f99('0x2e')][_0x2f99('0x4c')](_0xdbbb07['body'],{})[_0x2f99('0x25')](respondWithResult(_0x3d5490,0xc9))[_0x2f99('0x4b')](handleError(_0x3d5490,null));};exports[_0x2f99('0x24')]=function(_0x3a47b0,_0xcc7e12){if(_0x3a47b0[_0x2f99('0x4d')]['id']){delete _0x3a47b0[_0x2f99('0x4d')]['id'];}return db[_0x2f99('0x2e')][_0x2f99('0x4a')]({'where':{'id':_0x3a47b0['params']['id']}})['then'](handleEntityNotFound(_0xcc7e12,null))[_0x2f99('0x25')](saveUpdates(_0x3a47b0[_0x2f99('0x4d')],null))[_0x2f99('0x25')](respondWithResult(_0xcc7e12,null))[_0x2f99('0x4b')](handleError(_0xcc7e12,null));};exports[_0x2f99('0x26')]=function(_0x3e6d76,_0x12019d){return db[_0x2f99('0x2e')][_0x2f99('0x4a')]({'where':{'id':_0x3e6d76[_0x2f99('0x49')]['id']}})[_0x2f99('0x25')](handleEntityNotFound(_0x12019d,null))[_0x2f99('0x25')](removeEntity(_0x12019d,null))['catch'](handleError(_0x12019d,null));};exports[_0x2f99('0x4e')]=function(_0x5914b6,_0x41f491,_0x442bac){var _0x33a41d={};var _0x212b2c={};var _0x35d478;var _0x3d831b;return db[_0x2f99('0x2e')][_0x2f99('0x4f')]({'where':{'id':_0x5914b6[_0x2f99('0x49')]['id']}})['then'](handleEntityNotFound(_0x41f491,null))[_0x2f99('0x25')](function(_0x3b40bd){if(_0x3b40bd){_0x35d478=_0x3b40bd;_0x212b2c[_0x2f99('0x33')]=_[_0x2f99('0x35')](db[_0x2f99('0x50')][_0x2f99('0x2f')]);_0x212b2c['query']=_[_0x2f99('0x35')](_0x5914b6[_0x2f99('0x34')]);_0x212b2c[_0x2f99('0x36')]=_[_0x2f99('0x37')](_0x212b2c[_0x2f99('0x33')],_0x212b2c[_0x2f99('0x34')]);_0x33a41d[_0x2f99('0x3a')]=_['intersection'](_0x212b2c['model'],qs[_0x2f99('0x38')](_0x5914b6['query'][_0x2f99('0x38')]));_0x33a41d[_0x2f99('0x3a')]=_0x33a41d[_0x2f99('0x3a')][_0x2f99('0x39')]?_0x33a41d['attributes']:_0x212b2c[_0x2f99('0x33')];_0x33a41d[_0x2f99('0x3c')]=qs[_0x2f99('0x3d')](_0x5914b6[_0x2f99('0x34')]['sort']);_0x33a41d[_0x2f99('0x3f')]=qs[_0x2f99('0x36')](_[_0x2f99('0x3e')](_0x5914b6[_0x2f99('0x34')],_0x212b2c[_0x2f99('0x36')]));if(_0x5914b6[_0x2f99('0x34')][_0x2f99('0x42')]){_0x33a41d[_0x2f99('0x3f')]=_['merge'](_0x33a41d[_0x2f99('0x3f')],{'$or':_['map'](_0x33a41d['attributes'],function(_0x2fb53a){var _0xc24191={};_0xc24191[_0x2fb53a]={'$like':'%'+_0x5914b6[_0x2f99('0x34')][_0x2f99('0x42')]+'%'};return _0xc24191;})});}_0x33a41d=_['merge']({},_0x33a41d,_0x5914b6[_0x2f99('0x43')]);return _0x35d478[_0x2f99('0x4e')](_0x33a41d);}})[_0x2f99('0x25')](function(_0x30af9d){if(_0x30af9d){_0x3d831b=_0x30af9d[_0x2f99('0x39')];if(!_0x5914b6[_0x2f99('0x34')][_0x2f99('0x51')](_0x2f99('0x3b'))){_0x33a41d[_0x2f99('0x1e')]=qs['limit'](_0x5914b6[_0x2f99('0x34')]['limit']);_0x33a41d['offset']=qs['offset'](_0x5914b6['query'][_0x2f99('0x1c')]);}return _0x35d478[_0x2f99('0x4e')](_0x33a41d);}})[_0x2f99('0x25')](function(_0x47d50d){if(_0x47d50d){return _0x47d50d?{'count':_0x3d831b,'rows':_0x47d50d}:null;}})[_0x2f99('0x25')](respondWithResult(_0x41f491,null))[_0x2f99('0x4b')](handleError(_0x41f491,null));};exports[_0x2f99('0x52')]=function(_0x3f9c7c,_0x122afa,_0x5e7bdb){var _0x1ce3bd={};var _0x147dd1={};var _0x4b3bdb;var _0x5988af;return db[_0x2f99('0x2e')][_0x2f99('0x4f')]({'where':{'id':_0x3f9c7c[_0x2f99('0x49')]['id']}})[_0x2f99('0x25')](handleEntityNotFound(_0x122afa,null))[_0x2f99('0x25')](function(_0x19085c){if(_0x19085c){_0x4b3bdb=_0x19085c;_0x147dd1[_0x2f99('0x33')]=_[_0x2f99('0x35')](db[_0x2f99('0x50')][_0x2f99('0x2f')]);_0x147dd1[_0x2f99('0x34')]=_['keys'](_0x3f9c7c[_0x2f99('0x34')]);_0x147dd1['filters']=_['intersection'](_0x147dd1[_0x2f99('0x33')],_0x147dd1[_0x2f99('0x34')]);_0x1ce3bd[_0x2f99('0x3a')]=_['intersection'](_0x147dd1[_0x2f99('0x33')],qs['fields'](_0x3f9c7c[_0x2f99('0x34')][_0x2f99('0x38')]));_0x1ce3bd[_0x2f99('0x3a')]=_0x1ce3bd[_0x2f99('0x3a')][_0x2f99('0x39')]?_0x1ce3bd[_0x2f99('0x3a')]:_0x147dd1[_0x2f99('0x33')];_0x1ce3bd[_0x2f99('0x3c')]=qs[_0x2f99('0x3d')](_0x3f9c7c[_0x2f99('0x34')][_0x2f99('0x3d')]);_0x1ce3bd['where']=qs[_0x2f99('0x36')](_[_0x2f99('0x3e')](_0x3f9c7c[_0x2f99('0x34')],_0x147dd1['filters']));if(_0x3f9c7c[_0x2f99('0x34')][_0x2f99('0x42')]){_0x1ce3bd['where']=_['merge'](_0x1ce3bd[_0x2f99('0x3f')],{'$or':_[_0x2f99('0x2d')](_0x1ce3bd[_0x2f99('0x3a')],function(_0x5c2ca3){var _0x310f40={};_0x310f40[_0x5c2ca3]={'$like':'%'+_0x3f9c7c[_0x2f99('0x34')]['filter']+'%'};return _0x310f40;})});}_0x1ce3bd=_[_0x2f99('0x40')]({},_0x1ce3bd,_0x3f9c7c[_0x2f99('0x43')]);return _0x4b3bdb[_0x2f99('0x52')](_0x1ce3bd);}})[_0x2f99('0x25')](function(_0x47eaa0){if(_0x47eaa0){_0x5988af=_0x47eaa0[_0x2f99('0x39')];if(!_0x3f9c7c[_0x2f99('0x34')]['hasOwnProperty'](_0x2f99('0x3b'))){_0x1ce3bd['limit']=qs[_0x2f99('0x1e')](_0x3f9c7c[_0x2f99('0x34')][_0x2f99('0x1e')]);_0x1ce3bd[_0x2f99('0x1c')]=qs[_0x2f99('0x1c')](_0x3f9c7c[_0x2f99('0x34')]['offset']);}return _0x4b3bdb[_0x2f99('0x52')](_0x1ce3bd);}})[_0x2f99('0x25')](function(_0x2e2941){if(_0x2e2941){return _0x2e2941?{'count':_0x5988af,'rows':_0x2e2941}:null;}})['then'](respondWithResult(_0x122afa,null))[_0x2f99('0x4b')](handleError(_0x122afa,null));};exports[_0x2f99('0x53')]=function(_0x2be763,_0x1a6f76,_0x1aedc5){var _0x44f562={};var _0x4fa411={};var _0x58c34d;var _0x5597b6;return db[_0x2f99('0x2e')]['findOne']({'where':{'id':_0x2be763[_0x2f99('0x49')]['id']}})[_0x2f99('0x25')](handleEntityNotFound(_0x1a6f76,null))[_0x2f99('0x25')](function(_0x564217){if(_0x564217){_0x58c34d=_0x564217;_0x4fa411['model']=_['keys'](db[_0x2f99('0x50')][_0x2f99('0x2f')]);_0x4fa411['query']=_[_0x2f99('0x35')](_0x2be763[_0x2f99('0x34')]);_0x4fa411[_0x2f99('0x36')]=_['intersection'](_0x4fa411[_0x2f99('0x33')],_0x4fa411[_0x2f99('0x34')]);_0x44f562[_0x2f99('0x3a')]=_[_0x2f99('0x37')](_0x4fa411[_0x2f99('0x33')],qs['fields'](_0x2be763[_0x2f99('0x34')][_0x2f99('0x38')]));_0x44f562['attributes']=_0x44f562[_0x2f99('0x3a')][_0x2f99('0x39')]?_0x44f562[_0x2f99('0x3a')]:_0x4fa411[_0x2f99('0x33')];_0x44f562[_0x2f99('0x3c')]=qs['sort'](_0x2be763[_0x2f99('0x34')]['sort']);_0x44f562['where']=qs[_0x2f99('0x36')](_[_0x2f99('0x3e')](_0x2be763[_0x2f99('0x34')],_0x4fa411[_0x2f99('0x36')]));if(_0x2be763[_0x2f99('0x34')][_0x2f99('0x42')]){_0x44f562['where']=_[_0x2f99('0x40')](_0x44f562[_0x2f99('0x3f')],{'$or':_['map'](_0x44f562[_0x2f99('0x3a')],function(_0x1c6084){var _0x1f99f6={};_0x1f99f6[_0x1c6084]={'$like':'%'+_0x2be763['query'][_0x2f99('0x42')]+'%'};return _0x1f99f6;})});}_0x44f562=_['merge']({},_0x44f562,_0x2be763[_0x2f99('0x43')]);return _0x58c34d[_0x2f99('0x53')](_0x44f562);}})['then'](function(_0x101244){if(_0x101244){_0x5597b6=_0x101244[_0x2f99('0x39')];if(!_0x2be763['query']['hasOwnProperty'](_0x2f99('0x3b'))){_0x44f562[_0x2f99('0x1e')]=qs[_0x2f99('0x1e')](_0x2be763[_0x2f99('0x34')][_0x2f99('0x1e')]);_0x44f562['offset']=qs[_0x2f99('0x1c')](_0x2be763[_0x2f99('0x34')][_0x2f99('0x1c')]);}return _0x58c34d[_0x2f99('0x53')](_0x44f562);}})[_0x2f99('0x25')](function(_0x5ae985){if(_0x5ae985){return _0x5ae985?{'count':_0x5597b6,'rows':_0x5ae985}:null;}})[_0x2f99('0x25')](respondWithResult(_0x1a6f76,null))[_0x2f99('0x4b')](handleError(_0x1a6f76,null));};exports[_0x2f99('0x54')]=function(_0x40a7a2,_0x1ce19,_0x43d7af){var _0x1e755f={};var _0x378fc1={};var _0x4583aa;var _0x2ebb5a;return db[_0x2f99('0x2e')][_0x2f99('0x4f')]({'where':{'id':_0x40a7a2[_0x2f99('0x49')]['id']}})[_0x2f99('0x25')](handleEntityNotFound(_0x1ce19,null))[_0x2f99('0x25')](function(_0x448752){if(_0x448752){_0x4583aa=_0x448752;_0x378fc1[_0x2f99('0x33')]=_[_0x2f99('0x35')](db[_0x2f99('0x55')][_0x2f99('0x2f')]);_0x378fc1['query']=_['keys'](_0x40a7a2['query']);_0x378fc1[_0x2f99('0x36')]=_[_0x2f99('0x37')](_0x378fc1[_0x2f99('0x33')],_0x378fc1[_0x2f99('0x34')]);_0x1e755f[_0x2f99('0x3a')]=_[_0x2f99('0x37')](_0x378fc1['model'],qs[_0x2f99('0x38')](_0x40a7a2[_0x2f99('0x34')][_0x2f99('0x38')]));_0x1e755f[_0x2f99('0x3a')]=_0x1e755f[_0x2f99('0x3a')][_0x2f99('0x39')]?_0x1e755f[_0x2f99('0x3a')]:_0x378fc1[_0x2f99('0x33')];_0x1e755f[_0x2f99('0x3c')]=qs[_0x2f99('0x3d')](_0x40a7a2[_0x2f99('0x34')]['sort']);_0x1e755f[_0x2f99('0x3f')]=qs[_0x2f99('0x36')](_[_0x2f99('0x3e')](_0x40a7a2['query'],_0x378fc1[_0x2f99('0x36')]));if(_0x40a7a2[_0x2f99('0x34')][_0x2f99('0x42')]){_0x1e755f['where']=_[_0x2f99('0x40')](_0x1e755f[_0x2f99('0x3f')],{'$or':_[_0x2f99('0x2d')](_0x1e755f['attributes'],function(_0x300fa1){var _0x408445={};_0x408445[_0x300fa1]={'$like':'%'+_0x40a7a2['query'][_0x2f99('0x42')]+'%'};return _0x408445;})});}_0x1e755f=_[_0x2f99('0x40')]({},_0x1e755f,_0x40a7a2[_0x2f99('0x43')]);return _0x4583aa[_0x2f99('0x54')](_0x1e755f);}})[_0x2f99('0x25')](function(_0x1568ad){if(_0x1568ad){_0x2ebb5a=_0x1568ad[_0x2f99('0x39')];if(!_0x40a7a2[_0x2f99('0x34')][_0x2f99('0x51')](_0x2f99('0x3b'))){_0x1e755f[_0x2f99('0x1e')]=qs[_0x2f99('0x1e')](_0x40a7a2[_0x2f99('0x34')]['limit']);_0x1e755f['offset']=qs[_0x2f99('0x1c')](_0x40a7a2[_0x2f99('0x34')][_0x2f99('0x1c')]);}return _0x4583aa[_0x2f99('0x54')](_0x1e755f);}})['then'](function(_0x35582f){if(_0x35582f){return _0x35582f?{'count':_0x2ebb5a,'rows':_0x35582f}:null;}})[_0x2f99('0x25')](respondWithResult(_0x1ce19,null))[_0x2f99('0x4b')](handleError(_0x1ce19,null));};exports[_0x2f99('0x56')]=function(_0x125b70,_0x4c8ca6,_0x3b284a){if(_0x125b70['body']['id']){delete _0x125b70[_0x2f99('0x4d')]['id'];}return db[_0x2f99('0x2e')][_0x2f99('0x4f')]({'where':{'id':_0x125b70[_0x2f99('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c8ca6,null))['then'](function(_0x3794a8){if(_0x3794a8){return _0x3794a8[_0x2f99('0x56')](_0x125b70[_0x2f99('0x4d')][_0x2f99('0x57')]||[]);}return null;})[_0x2f99('0x25')](respondWithResult(_0x4c8ca6,null))[_0x2f99('0x4b')](handleError(_0x4c8ca6,null));}; \ No newline at end of file +var _0x6f01=['reject','save','update','then','destroy','error','name','send','index','DeskConfiguration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','keys','create','body','find','getFields','findOne','DeskField','getSubjects','map','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x420d6a,_0x5f3df8){var _0x1f5f2c=function(_0x1d5b76){while(--_0x1d5b76){_0x420d6a['push'](_0x420d6a['shift']());}};_0x1f5f2c(++_0x5f3df8);}(_0x6f01,0x1bf));var _0x16f0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6f01[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x16f0('0x0'));var rimraf=require(_0x16f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16f0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x16f0('0x3'));var path=require('path');var sox=require(_0x16f0('0x4'));var csv=require(_0x16f0('0x5'));var ejs=require(_0x16f0('0x6'));var fs=require('fs');var fs_extra=require(_0x16f0('0x7'));var _=require(_0x16f0('0x8'));var squel=require(_0x16f0('0x9'));var crypto=require(_0x16f0('0xa'));var jsforce=require(_0x16f0('0xb'));var deskjs=require(_0x16f0('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x16f0('0xd'));var authService=require(_0x16f0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x16f0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16f0('0x10'))(_0x16f0('0x11'));var utils=require(_0x16f0('0x12'));var config=require(_0x16f0('0x13'));var licenseUtil=require(_0x16f0('0x14'));var db=require(_0x16f0('0x15'))['db'];function respondWithStatusCode(_0x207ef6,_0x35eeb9){_0x35eeb9=_0x35eeb9||0xcc;return function(_0x220bbb){if(_0x220bbb){return _0x207ef6[_0x16f0('0x16')](_0x35eeb9);}return _0x207ef6['status'](_0x35eeb9)[_0x16f0('0x17')]();};}function respondWithResult(_0x22330b,_0x5d6763){_0x5d6763=_0x5d6763||0xc8;return function(_0x577c6e){if(_0x577c6e){return _0x22330b[_0x16f0('0x18')](_0x5d6763)[_0x16f0('0x19')](_0x577c6e);}};}function respondWithFilteredResult(_0x43e94b,_0x23791a){return function(_0x10de55){if(_0x10de55){var _0x5e0bbb=typeof _0x23791a[_0x16f0('0x1a')]===_0x16f0('0x1b')&&typeof _0x23791a[_0x16f0('0x1c')]===_0x16f0('0x1b');var _0x1c85c6=_0x10de55[_0x16f0('0x1d')];var _0x554fe1=_0x5e0bbb?0x0:_0x23791a['offset'];var _0x380dec=_0x5e0bbb?_0x10de55[_0x16f0('0x1d')]:_0x23791a[_0x16f0('0x1a')]+_0x23791a[_0x16f0('0x1c')];var _0x3002c3;if(_0x380dec>=_0x1c85c6){_0x380dec=_0x1c85c6;_0x3002c3=0xc8;}else{_0x3002c3=0xce;}_0x43e94b['status'](_0x3002c3);return _0x43e94b[_0x16f0('0x1e')](_0x16f0('0x1f'),_0x554fe1+'-'+_0x380dec+'/'+_0x1c85c6)[_0x16f0('0x19')](_0x10de55);}return null;};}function patchUpdates(_0x391b36){return function(_0x4f9e30){try{jsonpatch[_0x16f0('0x20')](_0x4f9e30,_0x391b36,!![]);}catch(_0x2e0fc0){return BPromise[_0x16f0('0x21')](_0x2e0fc0);}return _0x4f9e30[_0x16f0('0x22')]();};}function saveUpdates(_0xc5ceb0,_0x1e1b4b){return function(_0x3afcc4){if(_0x3afcc4){return _0x3afcc4[_0x16f0('0x23')](_0xc5ceb0)[_0x16f0('0x24')](function(_0xd25b3){return _0xd25b3;});}return null;};}function removeEntity(_0x5d2313,_0x32eede){return function(_0x12c520){if(_0x12c520){return _0x12c520[_0x16f0('0x25')]()[_0x16f0('0x24')](function(){_0x5d2313[_0x16f0('0x18')](0xcc)[_0x16f0('0x17')]();});}};}function handleEntityNotFound(_0x1a326a,_0x2d5fc1){return function(_0x36989d){if(!_0x36989d){_0x1a326a[_0x16f0('0x16')](0x194);}return _0x36989d;};}function handleError(_0x302a36,_0x3c3716){_0x3c3716=_0x3c3716||0x1f4;return function(_0x440847){logger[_0x16f0('0x26')](_0x440847['stack']);if(_0x440847[_0x16f0('0x27')]){delete _0x440847[_0x16f0('0x27')];}_0x302a36[_0x16f0('0x18')](_0x3c3716)[_0x16f0('0x28')](_0x440847);};}exports[_0x16f0('0x29')]=function(_0x50d8a3,_0x278cf3){var _0x482fff={},_0x14b775={},_0x6a5ea3={'count':0x0,'rows':[]};var _0x474651=_['map'](db[_0x16f0('0x2a')][_0x16f0('0x2b')],function(_0x478cec){return{'name':_0x478cec[_0x16f0('0x2c')],'type':_0x478cec['type'][_0x16f0('0x2d')]};});_0x14b775[_0x16f0('0x2e')]=_['map'](_0x474651,'name');_0x14b775[_0x16f0('0x2f')]=_['keys'](_0x50d8a3[_0x16f0('0x2f')]);_0x14b775[_0x16f0('0x30')]=_['intersection'](_0x14b775['model'],_0x14b775[_0x16f0('0x2f')]);_0x482fff[_0x16f0('0x31')]=_[_0x16f0('0x32')](_0x14b775[_0x16f0('0x2e')],qs[_0x16f0('0x33')](_0x50d8a3[_0x16f0('0x2f')]['fields']));_0x482fff[_0x16f0('0x31')]=_0x482fff['attributes'][_0x16f0('0x34')]?_0x482fff[_0x16f0('0x31')]:_0x14b775['model'];if(!_0x50d8a3[_0x16f0('0x2f')][_0x16f0('0x35')](_0x16f0('0x36'))){_0x482fff['limit']=qs[_0x16f0('0x1c')](_0x50d8a3[_0x16f0('0x2f')][_0x16f0('0x1c')]);_0x482fff[_0x16f0('0x1a')]=qs[_0x16f0('0x1a')](_0x50d8a3[_0x16f0('0x2f')][_0x16f0('0x1a')]);}_0x482fff[_0x16f0('0x37')]=qs['sort'](_0x50d8a3[_0x16f0('0x2f')][_0x16f0('0x38')]);_0x482fff[_0x16f0('0x39')]=qs['filters'](_[_0x16f0('0x3a')](_0x50d8a3[_0x16f0('0x2f')],_0x14b775[_0x16f0('0x30')]),_0x474651);if(_0x50d8a3[_0x16f0('0x2f')][_0x16f0('0x3b')]){_0x482fff[_0x16f0('0x39')]=_['merge'](_0x482fff[_0x16f0('0x39')],{'$or':_['map'](_0x474651,function(_0x25418f){if(_0x25418f['type']!=='VIRTUAL'){var _0x544977={};_0x544977[_0x25418f[_0x16f0('0x27')]]={'$like':'%'+_0x50d8a3[_0x16f0('0x2f')][_0x16f0('0x3b')]+'%'};return _0x544977;}})});}_0x482fff=_[_0x16f0('0x3c')]({},_0x482fff,_0x50d8a3[_0x16f0('0x3d')]);var _0x492788={'where':_0x482fff['where']};return db[_0x16f0('0x2a')][_0x16f0('0x1d')](_0x492788)[_0x16f0('0x24')](function(_0x3c2bd8){_0x6a5ea3[_0x16f0('0x1d')]=_0x3c2bd8;if(_0x50d8a3[_0x16f0('0x2f')][_0x16f0('0x3e')]){_0x482fff[_0x16f0('0x3f')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x482fff);})[_0x16f0('0x24')](function(_0x4f0fb3){_0x6a5ea3['rows']=_0x4f0fb3;return _0x6a5ea3;})[_0x16f0('0x24')](respondWithFilteredResult(_0x278cf3,_0x482fff))[_0x16f0('0x40')](handleError(_0x278cf3,null));};exports[_0x16f0('0x41')]=function(_0x1fd878,_0x921290){var _0x2b1a25={'raw':![],'where':{'id':_0x1fd878[_0x16f0('0x42')]['id']}},_0x356d7c={};_0x356d7c[_0x16f0('0x2e')]=_[_0x16f0('0x43')](db[_0x16f0('0x2a')][_0x16f0('0x2b')]);_0x356d7c['query']=_[_0x16f0('0x43')](_0x1fd878[_0x16f0('0x2f')]);_0x356d7c[_0x16f0('0x30')]=_[_0x16f0('0x32')](_0x356d7c[_0x16f0('0x2e')],_0x356d7c[_0x16f0('0x2f')]);_0x2b1a25[_0x16f0('0x31')]=_[_0x16f0('0x32')](_0x356d7c[_0x16f0('0x2e')],qs[_0x16f0('0x33')](_0x1fd878['query']['fields']));_0x2b1a25['attributes']=_0x2b1a25[_0x16f0('0x31')][_0x16f0('0x34')]?_0x2b1a25[_0x16f0('0x31')]:_0x356d7c['model'];if(_0x1fd878[_0x16f0('0x2f')][_0x16f0('0x3e')]){_0x2b1a25['include']=[{'all':!![]}];}_0x2b1a25=_[_0x16f0('0x3c')]({},_0x2b1a25,_0x1fd878['options']);return db[_0x16f0('0x2a')]['find'](_0x2b1a25)[_0x16f0('0x24')](handleEntityNotFound(_0x921290,null))[_0x16f0('0x24')](respondWithResult(_0x921290,null))['catch'](handleError(_0x921290,null));};exports[_0x16f0('0x44')]=function(_0x329e9d,_0x7c8c89){return db['DeskConfiguration']['create'](_0x329e9d[_0x16f0('0x45')],{})[_0x16f0('0x24')](respondWithResult(_0x7c8c89,0xc9))[_0x16f0('0x40')](handleError(_0x7c8c89,null));};exports[_0x16f0('0x23')]=function(_0x4c1d55,_0x5ae3d){if(_0x4c1d55[_0x16f0('0x45')]['id']){delete _0x4c1d55['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x4c1d55['params']['id']}})['then'](handleEntityNotFound(_0x5ae3d,null))[_0x16f0('0x24')](saveUpdates(_0x4c1d55['body'],null))[_0x16f0('0x24')](respondWithResult(_0x5ae3d,null))[_0x16f0('0x40')](handleError(_0x5ae3d,null));};exports[_0x16f0('0x25')]=function(_0x1dda85,_0x200ae8){return db[_0x16f0('0x2a')][_0x16f0('0x46')]({'where':{'id':_0x1dda85[_0x16f0('0x42')]['id']}})[_0x16f0('0x24')](handleEntityNotFound(_0x200ae8,null))[_0x16f0('0x24')](removeEntity(_0x200ae8,null))[_0x16f0('0x40')](handleError(_0x200ae8,null));};exports[_0x16f0('0x47')]=function(_0x41f11f,_0x44ddb3,_0x15a9a6){var _0x98e591={};var _0x525175={};var _0x37c12d;var _0x15a326;return db[_0x16f0('0x2a')][_0x16f0('0x48')]({'where':{'id':_0x41f11f[_0x16f0('0x42')]['id']}})[_0x16f0('0x24')](handleEntityNotFound(_0x44ddb3,null))['then'](function(_0x25c320){if(_0x25c320){_0x37c12d=_0x25c320;_0x525175[_0x16f0('0x2e')]=_[_0x16f0('0x43')](db[_0x16f0('0x49')][_0x16f0('0x2b')]);_0x525175[_0x16f0('0x2f')]=_[_0x16f0('0x43')](_0x41f11f[_0x16f0('0x2f')]);_0x525175[_0x16f0('0x30')]=_[_0x16f0('0x32')](_0x525175[_0x16f0('0x2e')],_0x525175[_0x16f0('0x2f')]);_0x98e591[_0x16f0('0x31')]=_[_0x16f0('0x32')](_0x525175[_0x16f0('0x2e')],qs[_0x16f0('0x33')](_0x41f11f[_0x16f0('0x2f')][_0x16f0('0x33')]));_0x98e591[_0x16f0('0x31')]=_0x98e591[_0x16f0('0x31')][_0x16f0('0x34')]?_0x98e591['attributes']:_0x525175[_0x16f0('0x2e')];_0x98e591[_0x16f0('0x37')]=qs[_0x16f0('0x38')](_0x41f11f['query'][_0x16f0('0x38')]);_0x98e591[_0x16f0('0x39')]=qs[_0x16f0('0x30')](_[_0x16f0('0x3a')](_0x41f11f[_0x16f0('0x2f')],_0x525175[_0x16f0('0x30')]));if(_0x41f11f[_0x16f0('0x2f')]['filter']){_0x98e591[_0x16f0('0x39')]=_[_0x16f0('0x3c')](_0x98e591[_0x16f0('0x39')],{'$or':_['map'](_0x98e591['attributes'],function(_0x2ad013){var _0x58193={};_0x58193[_0x2ad013]={'$like':'%'+_0x41f11f[_0x16f0('0x2f')]['filter']+'%'};return _0x58193;})});}_0x98e591=_[_0x16f0('0x3c')]({},_0x98e591,_0x41f11f[_0x16f0('0x3d')]);return _0x37c12d[_0x16f0('0x47')](_0x98e591);}})[_0x16f0('0x24')](function(_0x489e2f){if(_0x489e2f){_0x15a326=_0x489e2f['length'];if(!_0x41f11f[_0x16f0('0x2f')][_0x16f0('0x35')](_0x16f0('0x36'))){_0x98e591['limit']=qs[_0x16f0('0x1c')](_0x41f11f[_0x16f0('0x2f')][_0x16f0('0x1c')]);_0x98e591[_0x16f0('0x1a')]=qs[_0x16f0('0x1a')](_0x41f11f[_0x16f0('0x2f')][_0x16f0('0x1a')]);}return _0x37c12d[_0x16f0('0x47')](_0x98e591);}})[_0x16f0('0x24')](function(_0x1f9d7d){if(_0x1f9d7d){return _0x1f9d7d?{'count':_0x15a326,'rows':_0x1f9d7d}:null;}})[_0x16f0('0x24')](respondWithResult(_0x44ddb3,null))[_0x16f0('0x40')](handleError(_0x44ddb3,null));};exports[_0x16f0('0x4a')]=function(_0x4cb393,_0x3b2acd,_0x32c795){var _0x779e9c={};var _0x18e8fd={};var _0x452b83;var _0x5aafc1;return db[_0x16f0('0x2a')][_0x16f0('0x48')]({'where':{'id':_0x4cb393[_0x16f0('0x42')]['id']}})[_0x16f0('0x24')](handleEntityNotFound(_0x3b2acd,null))['then'](function(_0x5c4cc6){if(_0x5c4cc6){_0x452b83=_0x5c4cc6;_0x18e8fd[_0x16f0('0x2e')]=_[_0x16f0('0x43')](db[_0x16f0('0x49')][_0x16f0('0x2b')]);_0x18e8fd[_0x16f0('0x2f')]=_[_0x16f0('0x43')](_0x4cb393[_0x16f0('0x2f')]);_0x18e8fd[_0x16f0('0x30')]=_['intersection'](_0x18e8fd[_0x16f0('0x2e')],_0x18e8fd['query']);_0x779e9c[_0x16f0('0x31')]=_[_0x16f0('0x32')](_0x18e8fd[_0x16f0('0x2e')],qs[_0x16f0('0x33')](_0x4cb393['query'][_0x16f0('0x33')]));_0x779e9c[_0x16f0('0x31')]=_0x779e9c[_0x16f0('0x31')][_0x16f0('0x34')]?_0x779e9c[_0x16f0('0x31')]:_0x18e8fd[_0x16f0('0x2e')];_0x779e9c[_0x16f0('0x37')]=qs[_0x16f0('0x38')](_0x4cb393[_0x16f0('0x2f')][_0x16f0('0x38')]);_0x779e9c[_0x16f0('0x39')]=qs['filters'](_[_0x16f0('0x3a')](_0x4cb393[_0x16f0('0x2f')],_0x18e8fd[_0x16f0('0x30')]));if(_0x4cb393['query'][_0x16f0('0x3b')]){_0x779e9c[_0x16f0('0x39')]=_[_0x16f0('0x3c')](_0x779e9c[_0x16f0('0x39')],{'$or':_[_0x16f0('0x4b')](_0x779e9c[_0x16f0('0x31')],function(_0x468b02){var _0x14c248={};_0x14c248[_0x468b02]={'$like':'%'+_0x4cb393['query']['filter']+'%'};return _0x14c248;})});}_0x779e9c=_['merge']({},_0x779e9c,_0x4cb393[_0x16f0('0x3d')]);return _0x452b83[_0x16f0('0x4a')](_0x779e9c);}})[_0x16f0('0x24')](function(_0x42e5f6){if(_0x42e5f6){_0x5aafc1=_0x42e5f6[_0x16f0('0x34')];if(!_0x4cb393[_0x16f0('0x2f')][_0x16f0('0x35')](_0x16f0('0x36'))){_0x779e9c[_0x16f0('0x1c')]=qs[_0x16f0('0x1c')](_0x4cb393[_0x16f0('0x2f')][_0x16f0('0x1c')]);_0x779e9c['offset']=qs[_0x16f0('0x1a')](_0x4cb393[_0x16f0('0x2f')][_0x16f0('0x1a')]);}return _0x452b83[_0x16f0('0x4a')](_0x779e9c);}})[_0x16f0('0x24')](function(_0x11b9cd){if(_0x11b9cd){return _0x11b9cd?{'count':_0x5aafc1,'rows':_0x11b9cd}:null;}})[_0x16f0('0x24')](respondWithResult(_0x3b2acd,null))['catch'](handleError(_0x3b2acd,null));};exports[_0x16f0('0x4c')]=function(_0x4342eb,_0x2a5ae2,_0x1adf28){var _0x3f37d6={};var _0x2c68ef={};var _0x258279;var _0x38793e;return db[_0x16f0('0x2a')][_0x16f0('0x48')]({'where':{'id':_0x4342eb[_0x16f0('0x42')]['id']}})[_0x16f0('0x24')](handleEntityNotFound(_0x2a5ae2,null))[_0x16f0('0x24')](function(_0x39f615){if(_0x39f615){_0x258279=_0x39f615;_0x2c68ef[_0x16f0('0x2e')]=_['keys'](db[_0x16f0('0x49')][_0x16f0('0x2b')]);_0x2c68ef['query']=_['keys'](_0x4342eb['query']);_0x2c68ef[_0x16f0('0x30')]=_['intersection'](_0x2c68ef[_0x16f0('0x2e')],_0x2c68ef['query']);_0x3f37d6['attributes']=_[_0x16f0('0x32')](_0x2c68ef['model'],qs['fields'](_0x4342eb[_0x16f0('0x2f')][_0x16f0('0x33')]));_0x3f37d6[_0x16f0('0x31')]=_0x3f37d6[_0x16f0('0x31')][_0x16f0('0x34')]?_0x3f37d6[_0x16f0('0x31')]:_0x2c68ef[_0x16f0('0x2e')];_0x3f37d6[_0x16f0('0x37')]=qs[_0x16f0('0x38')](_0x4342eb[_0x16f0('0x2f')][_0x16f0('0x38')]);_0x3f37d6['where']=qs['filters'](_[_0x16f0('0x3a')](_0x4342eb[_0x16f0('0x2f')],_0x2c68ef[_0x16f0('0x30')]));if(_0x4342eb[_0x16f0('0x2f')]['filter']){_0x3f37d6[_0x16f0('0x39')]=_[_0x16f0('0x3c')](_0x3f37d6[_0x16f0('0x39')],{'$or':_[_0x16f0('0x4b')](_0x3f37d6[_0x16f0('0x31')],function(_0x4c32c6){var _0x1d2e39={};_0x1d2e39[_0x4c32c6]={'$like':'%'+_0x4342eb[_0x16f0('0x2f')]['filter']+'%'};return _0x1d2e39;})});}_0x3f37d6=_['merge']({},_0x3f37d6,_0x4342eb[_0x16f0('0x3d')]);return _0x258279[_0x16f0('0x4c')](_0x3f37d6);}})[_0x16f0('0x24')](function(_0x3fc890){if(_0x3fc890){_0x38793e=_0x3fc890[_0x16f0('0x34')];if(!_0x4342eb['query']['hasOwnProperty'](_0x16f0('0x36'))){_0x3f37d6['limit']=qs[_0x16f0('0x1c')](_0x4342eb[_0x16f0('0x2f')]['limit']);_0x3f37d6['offset']=qs[_0x16f0('0x1a')](_0x4342eb[_0x16f0('0x2f')][_0x16f0('0x1a')]);}return _0x258279['getDescriptions'](_0x3f37d6);}})[_0x16f0('0x24')](function(_0x564a4b){if(_0x564a4b){return _0x564a4b?{'count':_0x38793e,'rows':_0x564a4b}:null;}})['then'](respondWithResult(_0x2a5ae2,null))[_0x16f0('0x40')](handleError(_0x2a5ae2,null));};exports[_0x16f0('0x4d')]=function(_0x3d7a16,_0xa89276,_0x2de040){var _0x25bbd4={};var _0x2ad18e={};var _0x57a307;var _0x59fa1a;return db['DeskConfiguration'][_0x16f0('0x48')]({'where':{'id':_0x3d7a16[_0x16f0('0x42')]['id']}})[_0x16f0('0x24')](handleEntityNotFound(_0xa89276,null))[_0x16f0('0x24')](function(_0x5986e0){if(_0x5986e0){_0x57a307=_0x5986e0;_0x2ad18e[_0x16f0('0x2e')]=_[_0x16f0('0x43')](db[_0x16f0('0x4e')][_0x16f0('0x2b')]);_0x2ad18e[_0x16f0('0x2f')]=_[_0x16f0('0x43')](_0x3d7a16[_0x16f0('0x2f')]);_0x2ad18e[_0x16f0('0x30')]=_[_0x16f0('0x32')](_0x2ad18e[_0x16f0('0x2e')],_0x2ad18e[_0x16f0('0x2f')]);_0x25bbd4[_0x16f0('0x31')]=_[_0x16f0('0x32')](_0x2ad18e[_0x16f0('0x2e')],qs[_0x16f0('0x33')](_0x3d7a16[_0x16f0('0x2f')][_0x16f0('0x33')]));_0x25bbd4['attributes']=_0x25bbd4['attributes'][_0x16f0('0x34')]?_0x25bbd4[_0x16f0('0x31')]:_0x2ad18e[_0x16f0('0x2e')];_0x25bbd4[_0x16f0('0x37')]=qs[_0x16f0('0x38')](_0x3d7a16[_0x16f0('0x2f')][_0x16f0('0x38')]);_0x25bbd4[_0x16f0('0x39')]=qs['filters'](_[_0x16f0('0x3a')](_0x3d7a16[_0x16f0('0x2f')],_0x2ad18e[_0x16f0('0x30')]));if(_0x3d7a16[_0x16f0('0x2f')][_0x16f0('0x3b')]){_0x25bbd4['where']=_['merge'](_0x25bbd4['where'],{'$or':_['map'](_0x25bbd4[_0x16f0('0x31')],function(_0x102780){var _0x3615b1={};_0x3615b1[_0x102780]={'$like':'%'+_0x3d7a16[_0x16f0('0x2f')][_0x16f0('0x3b')]+'%'};return _0x3615b1;})});}_0x25bbd4=_[_0x16f0('0x3c')]({},_0x25bbd4,_0x3d7a16[_0x16f0('0x3d')]);return _0x57a307[_0x16f0('0x4d')](_0x25bbd4);}})['then'](function(_0x194f88){if(_0x194f88){_0x59fa1a=_0x194f88[_0x16f0('0x34')];if(!_0x3d7a16[_0x16f0('0x2f')][_0x16f0('0x35')](_0x16f0('0x36'))){_0x25bbd4[_0x16f0('0x1c')]=qs[_0x16f0('0x1c')](_0x3d7a16['query'][_0x16f0('0x1c')]);_0x25bbd4[_0x16f0('0x1a')]=qs[_0x16f0('0x1a')](_0x3d7a16[_0x16f0('0x2f')][_0x16f0('0x1a')]);}return _0x57a307[_0x16f0('0x4d')](_0x25bbd4);}})['then'](function(_0x4d5ef3){if(_0x4d5ef3){return _0x4d5ef3?{'count':_0x59fa1a,'rows':_0x4d5ef3}:null;}})['then'](respondWithResult(_0xa89276,null))[_0x16f0('0x40')](handleError(_0xa89276,null));};exports[_0x16f0('0x4f')]=function(_0x2c625c,_0x1f6510,_0x52c11c){if(_0x2c625c['body']['id']){delete _0x2c625c[_0x16f0('0x45')]['id'];}return db[_0x16f0('0x2a')][_0x16f0('0x48')]({'where':{'id':_0x2c625c[_0x16f0('0x42')]['id']}})[_0x16f0('0x24')](handleEntityNotFound(_0x1f6510,null))['then'](function(_0x24ec50){if(_0x24ec50){return _0x24ec50[_0x16f0('0x4f')](_0x2c625c['body']['ids']||[]);}return null;})[_0x16f0('0x24')](respondWithResult(_0x1f6510,null))['catch'](handleError(_0x1f6510,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index b9bf42b..23f0e77 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 _0xb28c=['path','rimraf','../../config/environment','define','DeskConfiguration','int_desk_configurations','util','api','moment','bluebird'];(function(_0x4b81cf,_0x19ab7d){var _0xade941=function(_0x49fe8b){while(--_0x49fe8b){_0x4b81cf['push'](_0x4b81cf['shift']());}};_0xade941(++_0x19ab7d);}(_0xb28c,0x6a));var _0xcb28=function(_0x5ae137,_0x552993){_0x5ae137=_0x5ae137-0x0;var _0x255253=_0xb28c[_0x5ae137];return _0x255253;};'use strict';var _=require('lodash');var util=require(_0xcb28('0x0'));var logger=require('../../config/logger')(_0xcb28('0x1'));var moment=require(_0xcb28('0x2'));var BPromise=require(_0xcb28('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb28('0x4'));var rimraf=require(_0xcb28('0x5'));var config=require(_0xcb28('0x6'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x361549,_0x56aae4){return _0x361549[_0xcb28('0x7')](_0xcb28('0x8'),attributes,{'tableName':_0xcb28('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4c1=['api','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','../../config/logger'];(function(_0x26df73,_0x2fadd6){var _0x3d5d0e=function(_0x33ba4a){while(--_0x33ba4a){_0x26df73['push'](_0x26df73['shift']());}};_0x3d5d0e(++_0x2fadd6);}(_0xc4c1,0x175));var _0x1c4c=function(_0x5ccce8,_0xb6ac66){_0x5ccce8=_0x5ccce8-0x0;var _0xaf68af=_0xc4c1[_0x5ccce8];return _0xaf68af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c4c('0x0'))(_0x1c4c('0x1'));var moment=require(_0x1c4c('0x2'));var BPromise=require(_0x1c4c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c4c('0x4'));var rimraf=require(_0x1c4c('0x5'));var config=require(_0x1c4c('0x6'));var attributes=require(_0x1c4c('0x7'));module[_0x1c4c('0x8')]=function(_0x13eb4d,_0x347a88){return _0x13eb4d[_0x1c4c('0x9')](_0x1c4c('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 ae332e9..506ef1c 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 _0x29a6=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2398e3,_0x51a107){var _0x466f57=function(_0x261d47){while(--_0x261d47){_0x2398e3['push'](_0x2398e3['shift']());}};_0x466f57(++_0x51a107);}(_0x29a6,0xd9));var _0x629a=function(_0x51a9e7,_0x5f1283){_0x51a9e7=_0x51a9e7-0x0;var _0x509cf2=_0x29a6[_0x51a9e7];return _0x509cf2;};'use strict';var _=require(_0x629a('0x0'));var util=require('util');var moment=require(_0x629a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x629a('0x2'));var db=require(_0x629a('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x629a('0x4'));var jayson=require(_0x629a('0x5'));var client=jayson[_0x629a('0x6')][_0x629a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa5a8b1,_0x5ad892,_0x36ef14){return new BPromise(function(_0x19fbb7,_0x5aa0bb){return client[_0x629a('0x8')](_0xa5a8b1,_0x36ef14)[_0x629a('0x9')](function(_0x2e52fc){logger[_0x629a('0xa')](_0x629a('0xb'),_0x5ad892,_0x629a('0xc'));logger[_0x629a('0xd')](_0x629a('0xe'),_0x5ad892,_0x629a('0xc'),JSON[_0x629a('0xf')](_0x2e52fc));if(_0x2e52fc['error']){if(_0x2e52fc['error'][_0x629a('0x10')]===0x1f4){logger[_0x629a('0x11')](_0x629a('0xb'),_0x5ad892,_0x2e52fc[_0x629a('0x11')]['message']);return _0x5aa0bb(_0x2e52fc[_0x629a('0x11')][_0x629a('0x12')]);}logger[_0x629a('0x11')](_0x629a('0xb'),_0x5ad892,_0x2e52fc[_0x629a('0x11')][_0x629a('0x12')]);return _0x19fbb7(_0x2e52fc[_0x629a('0x11')][_0x629a('0x12')]);}else{logger['info'](_0x629a('0xb'),_0x5ad892,_0x629a('0xc'));_0x19fbb7(_0x2e52fc[_0x629a('0x13')][_0x629a('0x12')]);}})[_0x629a('0x14')](function(_0x2d905f){logger[_0x629a('0x11')](_0x629a('0xb'),_0x5ad892,_0x2d905f);_0x5aa0bb(_0x2d905f);});});} \ No newline at end of file +var _0x34a5=['stringify','error','message','info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x34a5,0xc2));var _0x534a=function(_0x2903f9,_0x3c9d3b){_0x2903f9=_0x2903f9-0x0;var _0x54f545=_0x34a5[_0x2903f9];return _0x54f545;};'use strict';var _=require(_0x534a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x534a('0x1'));var fs=require('fs');var Redis=require(_0x534a('0x2'));var db=require(_0x534a('0x3'))['db'];var utils=require(_0x534a('0x4'));var logger=require(_0x534a('0x5'))(_0x534a('0x6'));var config=require(_0x534a('0x7'));var jayson=require(_0x534a('0x8'));var client=jayson[_0x534a('0x9')][_0x534a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27b2cd,_0x31a4e7,_0x167ea5){return new BPromise(function(_0x3c85e8,_0x10ebcc){return client['request'](_0x27b2cd,_0x167ea5)[_0x534a('0xb')](function(_0x3d86ff){logger['info'](_0x534a('0xc'),_0x31a4e7,_0x534a('0xd'));logger[_0x534a('0xe')](_0x534a('0xf'),_0x31a4e7,_0x534a('0xd'),JSON[_0x534a('0x10')](_0x3d86ff));if(_0x3d86ff[_0x534a('0x11')]){if(_0x3d86ff[_0x534a('0x11')]['code']===0x1f4){logger[_0x534a('0x11')](_0x534a('0xc'),_0x31a4e7,_0x3d86ff['error'][_0x534a('0x12')]);return _0x10ebcc(_0x3d86ff[_0x534a('0x11')][_0x534a('0x12')]);}logger[_0x534a('0x11')](_0x534a('0xc'),_0x31a4e7,_0x3d86ff['error'][_0x534a('0x12')]);return _0x3c85e8(_0x3d86ff[_0x534a('0x11')][_0x534a('0x12')]);}else{logger[_0x534a('0x13')](_0x534a('0xc'),_0x31a4e7,_0x534a('0xd'));_0x3c85e8(_0x3d86ff[_0x534a('0x14')][_0x534a('0x12')]);}})['catch'](function(_0x4f2a7d){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x31a4e7,_0x4f2a7d);_0x10ebcc(_0x4f2a7d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 281f74d..278dbc3 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 _0x7e3b=['/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index'];(function(_0x33f7cd,_0x1f0157){var _0x31ab2a=function(_0x69ef1d){while(--_0x69ef1d){_0x33f7cd['push'](_0x33f7cd['shift']());}};_0x31ab2a(++_0x1f0157);}(_0x7e3b,0xd8));var _0xb7e3=function(_0x58ab89,_0x41719f){_0x58ab89=_0x58ab89-0x0;var _0x530677=_0x7e3b[_0x58ab89];return _0x530677;};'use strict';var multer=require('multer');var util=require(_0xb7e3('0x0'));var path=require(_0xb7e3('0x1'));var timeout=require(_0xb7e3('0x2'));var express=require(_0xb7e3('0x3'));var router=express[_0xb7e3('0x4')]();var fs_extra=require(_0xb7e3('0x5'));var auth=require(_0xb7e3('0x6'));var interaction=require(_0xb7e3('0x7'));var config=require(_0xb7e3('0x8'));var controller=require(_0xb7e3('0x9'));router['get']('/',auth[_0xb7e3('0xa')](),controller[_0xb7e3('0xb')]);router['get'](_0xb7e3('0xc'),auth['isAuthenticated'](),controller[_0xb7e3('0xd')]);router[_0xb7e3('0xe')]('/',auth['isAuthenticated'](),controller[_0xb7e3('0xf')]);router['put'](_0xb7e3('0xc'),auth[_0xb7e3('0xa')](),controller[_0xb7e3('0x10')]);router[_0xb7e3('0x11')](_0xb7e3('0xc'),auth[_0xb7e3('0xa')](),controller[_0xb7e3('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9672=['index','get','/:id','isAuthenticated','show','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x31b957,_0x5de2ec){var _0x44415f=function(_0x320f66){while(--_0x320f66){_0x31b957['push'](_0x31b957['shift']());}};_0x44415f(++_0x5de2ec);}(_0x9672,0xee));var _0x2967=function(_0x5e0102,_0x1ab296){_0x5e0102=_0x5e0102-0x0;var _0x5bbeb4=_0x9672[_0x5e0102];return _0x5bbeb4;};'use strict';var multer=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var path=require('path');var timeout=require(_0x2967('0x2'));var express=require(_0x2967('0x3'));var router=express[_0x2967('0x4')]();var fs_extra=require(_0x2967('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2967('0x6'));var config=require(_0x2967('0x7'));var controller=require(_0x2967('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2967('0x9')]);router[_0x2967('0xa')](_0x2967('0xb'),auth[_0x2967('0xc')](),controller[_0x2967('0xd')]);router[_0x2967('0xe')]('/',auth[_0x2967('0xc')](),controller[_0x2967('0xf')]);router['put'](_0x2967('0xb'),auth[_0x2967('0xc')](),controller[_0x2967('0x10')]);router[_0x2967('0x11')](_0x2967('0xb'),auth[_0x2967('0xc')](),controller['destroy']);module[_0x2967('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index ab00f99..751ecb3 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 _0x1cda=['customVariable','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x384c23,_0x30cd65){var _0x1fdf67=function(_0x21d205){while(--_0x21d205){_0x384c23['push'](_0x384c23['shift']());}};_0x1fdf67(++_0x30cd65);}(_0x1cda,0x153));var _0xa1cd=function(_0x8a23ee,_0xe73ead){_0x8a23ee=_0x8a23ee-0x0;var _0x15fc4d=_0x1cda[_0x8a23ee];return _0x15fc4d;};'use strict';var Sequelize=require(_0xa1cd('0x0'));module['exports']={'type':{'type':Sequelize[_0xa1cd('0x1')](_0xa1cd('0x2'),_0xa1cd('0x3'),_0xa1cd('0x4'),'keyValue',_0xa1cd('0x5')),'defaultValue':_0xa1cd('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa1cd('0x6')]},'keyType':{'type':Sequelize[_0xa1cd('0x1')](_0xa1cd('0x2'),_0xa1cd('0x3'),_0xa1cd('0x4'))},'keyContent':{'type':Sequelize[_0xa1cd('0x6')]},'idField':{'type':Sequelize[_0xa1cd('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa1cd('0x6')]}}; \ No newline at end of file +var _0xdeed=['keyValue','picklist','string','STRING','BOOLEAN','ENUM','customVariable'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0xdeed,0x155));var _0xddee=function(_0x43665e,_0x5751f3){_0x43665e=_0x43665e-0x0;var _0x1b3f10=_0xdeed[_0x43665e];return _0x1b3f10;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xddee('0x0')]('string','variable',_0xddee('0x1'),_0xddee('0x2'),_0xddee('0x3')),'defaultValue':_0xddee('0x4')},'content':{'type':Sequelize[_0xddee('0x5')]},'key':{'type':Sequelize[_0xddee('0x5')]},'keyType':{'type':Sequelize[_0xddee('0x0')](_0xddee('0x4'),'variable',_0xddee('0x1'))},'keyContent':{'type':Sequelize[_0xddee('0x5')]},'idField':{'type':Sequelize[_0xddee('0x5')]},'nameField':{'type':Sequelize[_0xddee('0x5')]},'customField':{'type':Sequelize[_0xddee('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xddee('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index ad93cd5..717f614 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 _0x5581=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','DeskField','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','filter','where','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x3b9f23,_0x42c5f6){var _0x38ae27=function(_0x599d24){while(--_0x599d24){_0x3b9f23['push'](_0x3b9f23['shift']());}};_0x38ae27(++_0x42c5f6);}(_0x5581,0x115));var _0x1558=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x5581[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require(_0x1558('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1558('0x1'));var jsonpatch=require(_0x1558('0x2'));var rp=require(_0x1558('0x3'));var moment=require(_0x1558('0x4'));var BPromise=require(_0x1558('0x5'));var Mustache=require(_0x1558('0x6'));var util=require('util');var path=require(_0x1558('0x7'));var sox=require(_0x1558('0x8'));var csv=require('to-csv');var ejs=require(_0x1558('0x9'));var fs=require('fs');var fs_extra=require(_0x1558('0xa'));var _=require('lodash');var squel=require(_0x1558('0xb'));var crypto=require(_0x1558('0xc'));var jsforce=require(_0x1558('0xd'));var deskjs=require(_0x1558('0xe'));var toCsv=require(_0x1558('0xf'));var querystring=require('querystring');var Papa=require(_0x1558('0x10'));var Redis=require(_0x1558('0x11'));var authService=require(_0x1558('0x12'));var qs=require(_0x1558('0x13'));var as=require(_0x1558('0x14'));var hardwareService=require(_0x1558('0x15'));var logger=require(_0x1558('0x16'))(_0x1558('0x17'));var utils=require(_0x1558('0x18'));var config=require(_0x1558('0x19'));var licenseUtil=require(_0x1558('0x1a'));var db=require(_0x1558('0x1b'))['db'];function respondWithStatusCode(_0x2044d1,_0x5ba878){_0x5ba878=_0x5ba878||0xcc;return function(_0x22ab0){if(_0x22ab0){return _0x2044d1[_0x1558('0x1c')](_0x5ba878);}return _0x2044d1[_0x1558('0x1d')](_0x5ba878)[_0x1558('0x1e')]();};}function respondWithResult(_0x27e978,_0x284608){_0x284608=_0x284608||0xc8;return function(_0x2a376c){if(_0x2a376c){return _0x27e978[_0x1558('0x1d')](_0x284608)[_0x1558('0x1f')](_0x2a376c);}};}function respondWithFilteredResult(_0x5ae8ce,_0x47347c){return function(_0xba47ba){if(_0xba47ba){var _0x1b781=typeof _0x47347c['offset']===_0x1558('0x20')&&typeof _0x47347c[_0x1558('0x21')]===_0x1558('0x20');var _0x2e3e05=_0xba47ba[_0x1558('0x22')];var _0x54cbb3=_0x1b781?0x0:_0x47347c['offset'];var _0x451547=_0x1b781?_0xba47ba[_0x1558('0x22')]:_0x47347c[_0x1558('0x23')]+_0x47347c[_0x1558('0x21')];var _0x1a46ae;if(_0x451547>=_0x2e3e05){_0x451547=_0x2e3e05;_0x1a46ae=0xc8;}else{_0x1a46ae=0xce;}_0x5ae8ce[_0x1558('0x1d')](_0x1a46ae);return _0x5ae8ce[_0x1558('0x24')](_0x1558('0x25'),_0x54cbb3+'-'+_0x451547+'/'+_0x2e3e05)['json'](_0xba47ba);}return null;};}function patchUpdates(_0x5bb8b3){return function(_0x56118b){try{jsonpatch[_0x1558('0x26')](_0x56118b,_0x5bb8b3,!![]);}catch(_0xc00fd0){return BPromise[_0x1558('0x27')](_0xc00fd0);}return _0x56118b[_0x1558('0x28')]();};}function saveUpdates(_0x37f448,_0x1646b7){return function(_0x251aa9){if(_0x251aa9){return _0x251aa9[_0x1558('0x29')](_0x37f448)['then'](function(_0x4107a5){return _0x4107a5;});}return null;};}function removeEntity(_0x487c0c,_0x2d64aa){return function(_0x10928c){if(_0x10928c){return _0x10928c[_0x1558('0x2a')]()[_0x1558('0x2b')](function(){_0x487c0c[_0x1558('0x1d')](0xcc)[_0x1558('0x1e')]();});}};}function handleEntityNotFound(_0x2ba561,_0x4dff68){return function(_0x46cbd5){if(!_0x46cbd5){_0x2ba561[_0x1558('0x1c')](0x194);}return _0x46cbd5;};}function handleError(_0x460156,_0x1ae7c4){_0x1ae7c4=_0x1ae7c4||0x1f4;return function(_0xca0eac){logger['error'](_0xca0eac[_0x1558('0x2c')]);if(_0xca0eac[_0x1558('0x2d')]){delete _0xca0eac[_0x1558('0x2d')];}_0x460156['status'](_0x1ae7c4)[_0x1558('0x2e')](_0xca0eac);};}exports[_0x1558('0x2f')]=function(_0x417678,_0x56edc3){var _0x2d0f08={},_0x53b11a={},_0x2bf88d={'count':0x0,'rows':[]};var _0x2a7637=_['map'](db[_0x1558('0x30')]['rawAttributes'],function(_0x516a89){return{'name':_0x516a89[_0x1558('0x31')],'type':_0x516a89[_0x1558('0x32')][_0x1558('0x33')]};});_0x53b11a[_0x1558('0x34')]=_[_0x1558('0x35')](_0x2a7637,'name');_0x53b11a['query']=_[_0x1558('0x36')](_0x417678[_0x1558('0x37')]);_0x53b11a[_0x1558('0x38')]=_[_0x1558('0x39')](_0x53b11a[_0x1558('0x34')],_0x53b11a[_0x1558('0x37')]);_0x2d0f08['attributes']=_[_0x1558('0x39')](_0x53b11a['model'],qs[_0x1558('0x3a')](_0x417678[_0x1558('0x37')][_0x1558('0x3a')]));_0x2d0f08[_0x1558('0x3b')]=_0x2d0f08[_0x1558('0x3b')][_0x1558('0x3c')]?_0x2d0f08[_0x1558('0x3b')]:_0x53b11a[_0x1558('0x34')];if(!_0x417678['query']['hasOwnProperty'](_0x1558('0x3d'))){_0x2d0f08[_0x1558('0x21')]=qs['limit'](_0x417678['query']['limit']);_0x2d0f08[_0x1558('0x23')]=qs['offset'](_0x417678[_0x1558('0x37')][_0x1558('0x23')]);}_0x2d0f08['order']=qs[_0x1558('0x3e')](_0x417678['query'][_0x1558('0x3e')]);_0x2d0f08['where']=qs[_0x1558('0x38')](_['pick'](_0x417678[_0x1558('0x37')],_0x53b11a[_0x1558('0x38')]),_0x2a7637);if(_0x417678[_0x1558('0x37')][_0x1558('0x3f')]){_0x2d0f08[_0x1558('0x40')]=_[_0x1558('0x41')](_0x2d0f08[_0x1558('0x40')],{'$or':_[_0x1558('0x35')](_0x2a7637,function(_0x32158b){if(_0x32158b['type']!=='VIRTUAL'){var _0x31d0ef={};_0x31d0ef[_0x32158b[_0x1558('0x2d')]]={'$like':'%'+_0x417678[_0x1558('0x37')][_0x1558('0x3f')]+'%'};return _0x31d0ef;}})});}_0x2d0f08=_[_0x1558('0x41')]({},_0x2d0f08,_0x417678[_0x1558('0x42')]);var _0x422e58={'where':_0x2d0f08['where']};return db[_0x1558('0x30')]['count'](_0x422e58)[_0x1558('0x2b')](function(_0x598371){_0x2bf88d[_0x1558('0x22')]=_0x598371;if(_0x417678[_0x1558('0x37')][_0x1558('0x43')]){_0x2d0f08[_0x1558('0x44')]=[{'all':!![]}];}return db[_0x1558('0x30')]['findAll'](_0x2d0f08);})[_0x1558('0x2b')](function(_0x48bd37){_0x2bf88d[_0x1558('0x45')]=_0x48bd37;return _0x2bf88d;})[_0x1558('0x2b')](respondWithFilteredResult(_0x56edc3,_0x2d0f08))[_0x1558('0x46')](handleError(_0x56edc3,null));};exports[_0x1558('0x47')]=function(_0x3e060f,_0xdf63cb){var _0x70e2d7={'raw':!![],'where':{'id':_0x3e060f[_0x1558('0x48')]['id']}},_0x5da544={};_0x5da544['model']=_['keys'](db[_0x1558('0x30')][_0x1558('0x49')]);_0x5da544['query']=_[_0x1558('0x36')](_0x3e060f[_0x1558('0x37')]);_0x5da544[_0x1558('0x38')]=_['intersection'](_0x5da544[_0x1558('0x34')],_0x5da544[_0x1558('0x37')]);_0x70e2d7['attributes']=_[_0x1558('0x39')](_0x5da544[_0x1558('0x34')],qs[_0x1558('0x3a')](_0x3e060f['query'][_0x1558('0x3a')]));_0x70e2d7['attributes']=_0x70e2d7[_0x1558('0x3b')][_0x1558('0x3c')]?_0x70e2d7[_0x1558('0x3b')]:_0x5da544[_0x1558('0x34')];if(_0x3e060f[_0x1558('0x37')][_0x1558('0x43')]){_0x70e2d7[_0x1558('0x44')]=[{'all':!![]}];}_0x70e2d7=_['merge']({},_0x70e2d7,_0x3e060f[_0x1558('0x42')]);return db['DeskField'][_0x1558('0x4a')](_0x70e2d7)['then'](handleEntityNotFound(_0xdf63cb,null))['then'](respondWithResult(_0xdf63cb,null))[_0x1558('0x46')](handleError(_0xdf63cb,null));};exports['create']=function(_0x4a2869,_0x2c34bd){return db[_0x1558('0x30')][_0x1558('0x4b')](_0x4a2869['body'],{})[_0x1558('0x2b')](respondWithResult(_0x2c34bd,0xc9))[_0x1558('0x46')](handleError(_0x2c34bd,null));};exports[_0x1558('0x29')]=function(_0x7e2bd7,_0x22ff42){if(_0x7e2bd7[_0x1558('0x4c')]['id']){delete _0x7e2bd7['body']['id'];}return db[_0x1558('0x30')][_0x1558('0x4a')]({'where':{'id':_0x7e2bd7[_0x1558('0x48')]['id']}})[_0x1558('0x2b')](handleEntityNotFound(_0x22ff42,null))[_0x1558('0x2b')](saveUpdates(_0x7e2bd7['body'],null))[_0x1558('0x2b')](respondWithResult(_0x22ff42,null))[_0x1558('0x46')](handleError(_0x22ff42,null));};exports['destroy']=function(_0x58b1cf,_0x21fbc8){return db['DeskField'][_0x1558('0x4a')]({'where':{'id':_0x58b1cf['params']['id']}})[_0x1558('0x2b')](handleEntityNotFound(_0x21fbc8,null))[_0x1558('0x2b')](removeEntity(_0x21fbc8,null))[_0x1558('0x46')](handleError(_0x21fbc8,null));}; \ No newline at end of file +var _0xdf55=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','DeskField','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3c79ee,_0x5483e7){var _0x312e55=function(_0x20e88e){while(--_0x20e88e){_0x3c79ee['push'](_0x3c79ee['shift']());}};_0x312e55(++_0x5483e7);}(_0xdf55,0x83));var _0x5df5=function(_0x30eb5b,_0x234476){_0x30eb5b=_0x30eb5b-0x0;var _0x559d73=_0xdf55[_0x30eb5b];return _0x559d73;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5df5('0x2'));var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require(_0x5df5('0xc'));var crypto=require(_0x5df5('0xd'));var jsforce=require(_0x5df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xf'));var Papa=require(_0x5df5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5df5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5df5('0x14'));var licenseUtil=require(_0x5df5('0x15'));var db=require(_0x5df5('0x16'))['db'];function respondWithStatusCode(_0x4c3d6f,_0xe8bcd8){_0xe8bcd8=_0xe8bcd8||0xcc;return function(_0xb4a4fe){if(_0xb4a4fe){return _0x4c3d6f[_0x5df5('0x17')](_0xe8bcd8);}return _0x4c3d6f[_0x5df5('0x18')](_0xe8bcd8)[_0x5df5('0x19')]();};}function respondWithResult(_0x956317,_0x555d3f){_0x555d3f=_0x555d3f||0xc8;return function(_0x30fd32){if(_0x30fd32){return _0x956317['status'](_0x555d3f)[_0x5df5('0x1a')](_0x30fd32);}};}function respondWithFilteredResult(_0x33f818,_0x5b0ad9){return function(_0x3657c8){if(_0x3657c8){var _0x282d53=typeof _0x5b0ad9['offset']===_0x5df5('0x1b')&&typeof _0x5b0ad9[_0x5df5('0x1c')]==='undefined';var _0x9a52c9=_0x3657c8[_0x5df5('0x1d')];var _0xb7e1c2=_0x282d53?0x0:_0x5b0ad9[_0x5df5('0x1e')];var _0x215d59=_0x282d53?_0x3657c8['count']:_0x5b0ad9['offset']+_0x5b0ad9[_0x5df5('0x1c')];var _0x5d8dfd;if(_0x215d59>=_0x9a52c9){_0x215d59=_0x9a52c9;_0x5d8dfd=0xc8;}else{_0x5d8dfd=0xce;}_0x33f818[_0x5df5('0x18')](_0x5d8dfd);return _0x33f818[_0x5df5('0x1f')](_0x5df5('0x20'),_0xb7e1c2+'-'+_0x215d59+'/'+_0x9a52c9)[_0x5df5('0x1a')](_0x3657c8);}return null;};}function patchUpdates(_0x1deae7){return function(_0x4b4b57){try{jsonpatch[_0x5df5('0x21')](_0x4b4b57,_0x1deae7,!![]);}catch(_0x39d8a1){return BPromise[_0x5df5('0x22')](_0x39d8a1);}return _0x4b4b57[_0x5df5('0x23')]();};}function saveUpdates(_0x28efc8,_0x382999){return function(_0x59ff67){if(_0x59ff67){return _0x59ff67[_0x5df5('0x24')](_0x28efc8)[_0x5df5('0x25')](function(_0x8742a7){return _0x8742a7;});}return null;};}function removeEntity(_0x446bba,_0x5ca542){return function(_0x4358ba){if(_0x4358ba){return _0x4358ba[_0x5df5('0x26')]()[_0x5df5('0x25')](function(){_0x446bba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x532923,_0x357fb0){return function(_0x3ff82e){if(!_0x3ff82e){_0x532923[_0x5df5('0x17')](0x194);}return _0x3ff82e;};}function handleError(_0xa7f4b3,_0x1baf52){_0x1baf52=_0x1baf52||0x1f4;return function(_0x1fd83c){logger[_0x5df5('0x27')](_0x1fd83c[_0x5df5('0x28')]);if(_0x1fd83c['name']){delete _0x1fd83c[_0x5df5('0x29')];}_0xa7f4b3['status'](_0x1baf52)[_0x5df5('0x2a')](_0x1fd83c);};}exports[_0x5df5('0x2b')]=function(_0x5bc181,_0x3854d0){var _0x4945c6={},_0xd2b213={},_0x4cccf1={'count':0x0,'rows':[]};var _0x2e1885=_['map'](db[_0x5df5('0x2c')]['rawAttributes'],function(_0x2f91e3){return{'name':_0x2f91e3[_0x5df5('0x2d')],'type':_0x2f91e3[_0x5df5('0x2e')]['key']};});_0xd2b213[_0x5df5('0x2f')]=_[_0x5df5('0x30')](_0x2e1885,_0x5df5('0x29'));_0xd2b213[_0x5df5('0x31')]=_[_0x5df5('0x32')](_0x5bc181[_0x5df5('0x31')]);_0xd2b213[_0x5df5('0x33')]=_['intersection'](_0xd2b213['model'],_0xd2b213[_0x5df5('0x31')]);_0x4945c6[_0x5df5('0x34')]=_[_0x5df5('0x35')](_0xd2b213[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x5bc181[_0x5df5('0x31')]['fields']));_0x4945c6[_0x5df5('0x34')]=_0x4945c6[_0x5df5('0x34')][_0x5df5('0x37')]?_0x4945c6[_0x5df5('0x34')]:_0xd2b213['model'];if(!_0x5bc181[_0x5df5('0x31')]['hasOwnProperty'](_0x5df5('0x38'))){_0x4945c6[_0x5df5('0x1c')]=qs['limit'](_0x5bc181[_0x5df5('0x31')]['limit']);_0x4945c6[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x1e')]);}_0x4945c6['order']=qs[_0x5df5('0x39')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x39')]);_0x4945c6[_0x5df5('0x3a')]=qs['filters'](_[_0x5df5('0x3b')](_0x5bc181[_0x5df5('0x31')],_0xd2b213[_0x5df5('0x33')]),_0x2e1885);if(_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x4945c6[_0x5df5('0x3a')]=_[_0x5df5('0x3d')](_0x4945c6['where'],{'$or':_[_0x5df5('0x30')](_0x2e1885,function(_0x3102c7){if(_0x3102c7['type']!==_0x5df5('0x3e')){var _0x217844={};_0x217844[_0x3102c7['name']]={'$like':'%'+_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]+'%'};return _0x217844;}})});}_0x4945c6=_[_0x5df5('0x3d')]({},_0x4945c6,_0x5bc181[_0x5df5('0x3f')]);var _0x235f3e={'where':_0x4945c6[_0x5df5('0x3a')]};return db[_0x5df5('0x2c')][_0x5df5('0x1d')](_0x235f3e)['then'](function(_0x5e6c93){_0x4cccf1[_0x5df5('0x1d')]=_0x5e6c93;if(_0x5bc181['query'][_0x5df5('0x40')]){_0x4945c6[_0x5df5('0x41')]=[{'all':!![]}];}return db['DeskField'][_0x5df5('0x42')](_0x4945c6);})[_0x5df5('0x25')](function(_0x23e592){_0x4cccf1[_0x5df5('0x43')]=_0x23e592;return _0x4cccf1;})[_0x5df5('0x25')](respondWithFilteredResult(_0x3854d0,_0x4945c6))[_0x5df5('0x44')](handleError(_0x3854d0,null));};exports[_0x5df5('0x45')]=function(_0x3902a1,_0x5824c3){var _0x42b562={'raw':!![],'where':{'id':_0x3902a1[_0x5df5('0x46')]['id']}},_0x4a4057={};_0x4a4057[_0x5df5('0x2f')]=_[_0x5df5('0x32')](db[_0x5df5('0x2c')][_0x5df5('0x47')]);_0x4a4057['query']=_[_0x5df5('0x32')](_0x3902a1[_0x5df5('0x31')]);_0x4a4057[_0x5df5('0x33')]=_['intersection'](_0x4a4057[_0x5df5('0x2f')],_0x4a4057[_0x5df5('0x31')]);_0x42b562['attributes']=_[_0x5df5('0x35')](_0x4a4057[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x3902a1[_0x5df5('0x31')]['fields']));_0x42b562[_0x5df5('0x34')]=_0x42b562[_0x5df5('0x34')]['length']?_0x42b562[_0x5df5('0x34')]:_0x4a4057[_0x5df5('0x2f')];if(_0x3902a1[_0x5df5('0x31')]['includeAll']){_0x42b562[_0x5df5('0x41')]=[{'all':!![]}];}_0x42b562=_[_0x5df5('0x3d')]({},_0x42b562,_0x3902a1[_0x5df5('0x3f')]);return db[_0x5df5('0x2c')]['find'](_0x42b562)[_0x5df5('0x25')](handleEntityNotFound(_0x5824c3,null))[_0x5df5('0x25')](respondWithResult(_0x5824c3,null))[_0x5df5('0x44')](handleError(_0x5824c3,null));};exports[_0x5df5('0x48')]=function(_0x14f9ca,_0x5f44cb){return db['DeskField'][_0x5df5('0x48')](_0x14f9ca['body'],{})[_0x5df5('0x25')](respondWithResult(_0x5f44cb,0xc9))[_0x5df5('0x44')](handleError(_0x5f44cb,null));};exports[_0x5df5('0x24')]=function(_0x28108e,_0x48462e){if(_0x28108e[_0x5df5('0x49')]['id']){delete _0x28108e[_0x5df5('0x49')]['id'];}return db[_0x5df5('0x2c')][_0x5df5('0x4a')]({'where':{'id':_0x28108e[_0x5df5('0x46')]['id']}})[_0x5df5('0x25')](handleEntityNotFound(_0x48462e,null))['then'](saveUpdates(_0x28108e[_0x5df5('0x49')],null))['then'](respondWithResult(_0x48462e,null))[_0x5df5('0x44')](handleError(_0x48462e,null));};exports[_0x5df5('0x26')]=function(_0x17288f,_0x4d1ebd){return db[_0x5df5('0x2c')]['find']({'where':{'id':_0x17288f[_0x5df5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d1ebd,null))[_0x5df5('0x25')](removeEntity(_0x4d1ebd,null))[_0x5df5('0x44')](handleError(_0x4d1ebd,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 7b9b635..daad663 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 _0x3813=['desk_unique_index','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields'];(function(_0x291139,_0x7f30de){var _0x3c42c0=function(_0x5832e3){while(--_0x5832e3){_0x291139['push'](_0x291139['shift']());}};_0x3c42c0(++_0x7f30de);}(_0x3813,0x12c));var _0x3381=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3813[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3381('0x0'));var util=require(_0x3381('0x1'));var logger=require(_0x3381('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3381('0x3'));var rp=require(_0x3381('0x4'));var fs=require('fs');var path=require(_0x3381('0x5'));var rimraf=require(_0x3381('0x6'));var config=require(_0x3381('0x7'));var attributes=require(_0x3381('0x8'));module['exports']=function(_0x24936b,_0x4e2ad5){return _0x24936b[_0x3381('0x9')](_0x3381('0xa'),attributes,{'tableName':_0x3381('0xb'),'paranoid':![],'indexes':[{'name':_0x3381('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a9a=['desk_unique_index','lodash','util','api','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','DeskField'];(function(_0x41dda8,_0xdec0ff){var _0x3bb74f=function(_0x14441a){while(--_0x14441a){_0x41dda8['push'](_0x41dda8['shift']());}};_0x3bb74f(++_0xdec0ff);}(_0x1a9a,0xbc));var _0xa1a9=function(_0x301907,_0x254d69){_0x301907=_0x301907-0x0;var _0x598053=_0x1a9a[_0x301907];return _0x598053;};'use strict';var _=require(_0xa1a9('0x0'));var util=require(_0xa1a9('0x1'));var logger=require('../../config/logger')(_0xa1a9('0x2'));var moment=require('moment');var BPromise=require(_0xa1a9('0x3'));var rp=require(_0xa1a9('0x4'));var fs=require('fs');var path=require(_0xa1a9('0x5'));var rimraf=require('rimraf');var config=require(_0xa1a9('0x6'));var attributes=require(_0xa1a9('0x7'));module[_0xa1a9('0x8')]=function(_0x114b57,_0x4aefb1){return _0x114b57['define'](_0xa1a9('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xa1a9('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index b251e2b..63e688c 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 _0x37cc=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x4315c0,_0x1c9d77){var _0x58526a=function(_0x302131){while(--_0x302131){_0x4315c0['push'](_0x4315c0['shift']());}};_0x58526a(++_0x1c9d77);}(_0x37cc,0x1b3));var _0xc37c=function(_0x4daf19,_0x15cd91){_0x4daf19=_0x4daf19-0x0;var _0x32b495=_0x37cc[_0x4daf19];return _0x32b495;};'use strict';var _=require(_0xc37c('0x0'));var util=require('util');var moment=require(_0xc37c('0x1'));var BPromise=require(_0xc37c('0x2'));var rs=require(_0xc37c('0x3'));var fs=require('fs');var Redis=require(_0xc37c('0x4'));var db=require(_0xc37c('0x5'))['db'];var utils=require(_0xc37c('0x6'));var logger=require('../../config/logger')(_0xc37c('0x7'));var config=require(_0xc37c('0x8'));var jayson=require(_0xc37c('0x9'));var client=jayson[_0xc37c('0xa')][_0xc37c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44f0ec,_0x2650e1,_0x1b4f28){return new BPromise(function(_0x5416e2,_0xf4ddd1){return client['request'](_0x44f0ec,_0x1b4f28)[_0xc37c('0xc')](function(_0xb6c8d0){logger[_0xc37c('0xd')](_0xc37c('0xe'),_0x2650e1,'request\x20sent');logger[_0xc37c('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2650e1,_0xc37c('0x10'),JSON[_0xc37c('0x11')](_0xb6c8d0));if(_0xb6c8d0[_0xc37c('0x12')]){if(_0xb6c8d0[_0xc37c('0x12')][_0xc37c('0x13')]===0x1f4){logger[_0xc37c('0x12')](_0xc37c('0xe'),_0x2650e1,_0xb6c8d0[_0xc37c('0x12')][_0xc37c('0x14')]);return _0xf4ddd1(_0xb6c8d0[_0xc37c('0x12')][_0xc37c('0x14')]);}logger[_0xc37c('0x12')](_0xc37c('0xe'),_0x2650e1,_0xb6c8d0[_0xc37c('0x12')][_0xc37c('0x14')]);return _0x5416e2(_0xb6c8d0[_0xc37c('0x12')][_0xc37c('0x14')]);}else{logger[_0xc37c('0xd')](_0xc37c('0xe'),_0x2650e1,_0xc37c('0x10'));_0x5416e2(_0xb6c8d0[_0xc37c('0x15')][_0xc37c('0x14')]);}})['catch'](function(_0x249d4f){logger['error'](_0xc37c('0xe'),_0x2650e1,_0x249d4f);_0xf4ddd1(_0x249d4f);});});} \ No newline at end of file +var _0x8d68=['DeskField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x51c463,_0x1313c2){var _0x4666a7=function(_0x437a77){while(--_0x437a77){_0x51c463['push'](_0x51c463['shift']());}};_0x4666a7(++_0x1313c2);}(_0x8d68,0x138));var _0x88d6=function(_0x14e4f7,_0x4d62c6){_0x14e4f7=_0x14e4f7-0x0;var _0x55ea7f=_0x8d68[_0x14e4f7];return _0x55ea7f;};'use strict';var _=require(_0x88d6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x88d6('0x1'));var rs=require(_0x88d6('0x2'));var fs=require('fs');var Redis=require(_0x88d6('0x3'));var db=require(_0x88d6('0x4'))['db'];var utils=require(_0x88d6('0x5'));var logger=require(_0x88d6('0x6'))(_0x88d6('0x7'));var config=require('../../config/environment');var jayson=require(_0x88d6('0x8'));var client=jayson[_0x88d6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x470280,_0x5010a5,_0xb960c1){return new BPromise(function(_0x49e7c2,_0x2b2911){return client[_0x88d6('0xa')](_0x470280,_0xb960c1)[_0x88d6('0xb')](function(_0x2f1833){logger[_0x88d6('0xc')]('DeskField,\x20%s,\x20%s',_0x5010a5,_0x88d6('0xd'));logger[_0x88d6('0xe')](_0x88d6('0xf'),_0x5010a5,_0x88d6('0xd'),JSON['stringify'](_0x2f1833));if(_0x2f1833[_0x88d6('0x10')]){if(_0x2f1833['error'][_0x88d6('0x11')]===0x1f4){logger['error'](_0x88d6('0x12'),_0x5010a5,_0x2f1833[_0x88d6('0x10')][_0x88d6('0x13')]);return _0x2b2911(_0x2f1833[_0x88d6('0x10')][_0x88d6('0x13')]);}logger[_0x88d6('0x10')](_0x88d6('0x12'),_0x5010a5,_0x2f1833[_0x88d6('0x10')][_0x88d6('0x13')]);return _0x49e7c2(_0x2f1833['error']['message']);}else{logger[_0x88d6('0xc')](_0x88d6('0x12'),_0x5010a5,_0x88d6('0xd'));_0x49e7c2(_0x2f1833[_0x88d6('0x14')][_0x88d6('0x13')]);}})[_0x88d6('0x15')](function(_0x3228cb){logger['error'](_0x88d6('0x12'),_0x5010a5,_0x3228cb);_0x2b2911(_0x3228cb);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 67c94a2..1cdfc16 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 _0xd4a3=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','create','post','put','update','exports','multer','util','path'];(function(_0xf778ac,_0x3e42e2){var _0x5e17c0=function(_0x326c24){while(--_0x326c24){_0xf778ac['push'](_0xf778ac['shift']());}};_0x5e17c0(++_0x3e42e2);}(_0xd4a3,0x18c));var _0x3d4a=function(_0x53e0a9,_0x309b37){_0x53e0a9=_0x53e0a9-0x0;var _0xca6597=_0xd4a3[_0x53e0a9];return _0xca6597;};'use strict';var multer=require(_0x3d4a('0x0'));var util=require(_0x3d4a('0x1'));var path=require(_0x3d4a('0x2'));var timeout=require(_0x3d4a('0x3'));var express=require(_0x3d4a('0x4'));var router=express['Router']();var fs_extra=require(_0x3d4a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3d4a('0x6'));var config=require(_0x3d4a('0x7'));var controller=require(_0x3d4a('0x8'));router[_0x3d4a('0x9')]('/',auth[_0x3d4a('0xa')](),controller[_0x3d4a('0xb')]);router['get'](_0x3d4a('0xc'),auth[_0x3d4a('0xa')](),controller[_0x3d4a('0xd')]);router[_0x3d4a('0x9')]('/:id/configurations',auth[_0x3d4a('0xa')](),controller[_0x3d4a('0xe')]);router['get'](_0x3d4a('0xf'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x3d4a('0x10')]);router[_0x3d4a('0x11')]('/:id/configurations',auth[_0x3d4a('0xa')](),controller['addConfiguration']);router[_0x3d4a('0x12')](_0x3d4a('0xc'),auth[_0x3d4a('0xa')](),controller[_0x3d4a('0x13')]);router['delete']('/:id',auth[_0x3d4a('0xa')](),controller['destroy']);module[_0x3d4a('0x14')]=router; \ No newline at end of file +var _0xa1c0=['./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x330698,_0x5e4f86){var _0x5bbdd0=function(_0x547634){while(--_0x547634){_0x330698['push'](_0x330698['shift']());}};_0x5bbdd0(++_0x5e4f86);}(_0xa1c0,0x12c));var _0x0a1c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa1c0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0a1c('0x0'));var util=require(_0x0a1c('0x1'));var path=require(_0x0a1c('0x2'));var timeout=require(_0x0a1c('0x3'));var express=require(_0x0a1c('0x4'));var router=express[_0x0a1c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a1c('0x6'));var interaction=require(_0x0a1c('0x7'));var config=require('../../config/environment');var controller=require(_0x0a1c('0x8'));router[_0x0a1c('0x9')]('/',auth[_0x0a1c('0xa')](),controller[_0x0a1c('0xb')]);router[_0x0a1c('0x9')](_0x0a1c('0xc'),auth[_0x0a1c('0xa')](),controller[_0x0a1c('0xd')]);router['get'](_0x0a1c('0xe'),auth[_0x0a1c('0xa')](),controller['getConfigurations']);router[_0x0a1c('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0a1c('0xf')]);router[_0x0a1c('0x10')]('/',auth[_0x0a1c('0xa')](),controller[_0x0a1c('0x11')]);router['post'](_0x0a1c('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x0a1c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0a1c('0x13')]);router[_0x0a1c('0x14')](_0x0a1c('0xc'),auth[_0x0a1c('0xa')](),controller[_0x0a1c('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e5c154a..6ab86c5 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 _0x4453=['sequelize','exports','STRING','BOOLEAN'];(function(_0x45b190,_0x6297da){var _0x46234d=function(_0x41f5ad){while(--_0x41f5ad){_0x45b190['push'](_0x45b190['shift']());}};_0x46234d(++_0x6297da);}(_0x4453,0x9c));var _0x3445=function(_0x51674e,_0x8e7df0){_0x51674e=_0x51674e-0x0;var _0x309136=_0x4453[_0x51674e];return _0x309136;};'use strict';var Sequelize=require(_0x3445('0x0'));module[_0x3445('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3445('0x2')]},'password':{'type':Sequelize[_0x3445('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x3445('0x2')]},'clientId':{'type':Sequelize[_0x3445('0x2')]},'clientSecret':{'type':Sequelize[_0x3445('0x2')]},'serverUrl':{'type':Sequelize[_0x3445('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3445('0x2')]},'modernAuthentication':{'type':Sequelize[_0x3445('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x15c6=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1cb55d,_0xd9537){var _0xa553ca=function(_0x3188ee){while(--_0x3188ee){_0x1cb55d['push'](_0x1cb55d['shift']());}};_0xa553ca(++_0xd9537);}(_0x15c6,0x1cd));var _0x615c=function(_0x9a3d47,_0x1953a0){_0x9a3d47=_0x9a3d47-0x0;var _0xf60b78=_0x15c6[_0x9a3d47];return _0xf60b78;};'use strict';var Sequelize=require(_0x615c('0x0'));module[_0x615c('0x1')]={'name':{'type':Sequelize[_0x615c('0x2')]},'username':{'type':Sequelize[_0x615c('0x2')]},'password':{'type':Sequelize[_0x615c('0x2')]},'remoteUri':{'type':Sequelize[_0x615c('0x2')]},'tenantId':{'type':Sequelize[_0x615c('0x2')]},'clientId':{'type':Sequelize[_0x615c('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x615c('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 c4dbed0..a475434 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 _0x1827=['getFields','Incident','PhoneCall','title','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','https://login.microsoftonline.com/','/oauth2/token','clientId','username','password','access_token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','Label','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','../../components/integrations/configuration','status','json','limit','count','offset','then','destroy','sendStatus','error','stack','send','index','map','Dynamics365Account','type','key','model','query','filters','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','name','filter','merge','options','includeAll','rows','catch','show','params','keys','rawAttributes','intersection','fields','length','create','body','update','find','getConfigurations','Dynamics365Configuration','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','lastIndexOf','format'];(function(_0x265c78,_0x4253a7){var _0x362a12=function(_0x2ef389){while(--_0x2ef389){_0x265c78['push'](_0x265c78['shift']());}};_0x362a12(++_0x4253a7);}(_0x1827,0x1dc));var _0x7182=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1827[_0x3ab51d];return _0x29a04e;};'use strict';var rp=require('request-promise');var util=require(_0x7182('0x0'));var _=require(_0x7182('0x1'));var qs=require(_0x7182('0x2'));var logger=require(_0x7182('0x3'))('api');var db=require('../../mysqldb')['db'];var integrations=require(_0x7182('0x4'));function respondWithResult(_0xbefc50,_0x1022b3){_0x1022b3=_0x1022b3||0xc8;return function(_0x269ab0){if(_0x269ab0){return _0xbefc50[_0x7182('0x5')](_0x1022b3)[_0x7182('0x6')](_0x269ab0);}};}function respondWithFilteredResult(_0x20da1e,_0x211c87){return function(_0x26383e){if(_0x26383e){var _0x3abd6f=typeof _0x211c87['offset']==='undefined'&&typeof _0x211c87[_0x7182('0x7')]==='undefined';var _0x479ab8=_0x26383e['count'];var _0x1eae83=_0x3abd6f?0x0:_0x211c87['offset'];var _0x373b01=_0x3abd6f?_0x26383e[_0x7182('0x8')]:_0x211c87[_0x7182('0x9')]+_0x211c87[_0x7182('0x7')];var _0x45a141;if(_0x373b01>=_0x479ab8){_0x373b01=_0x479ab8;_0x45a141=0xc8;}else{_0x45a141=0xce;}_0x20da1e[_0x7182('0x5')](_0x45a141);return _0x20da1e['set']('Content-Range',_0x1eae83+'-'+_0x373b01+'/'+_0x479ab8)[_0x7182('0x6')](_0x26383e);}return null;};}function saveUpdates(_0x3c38bc){return function(_0x4bcf88){if(_0x4bcf88){return _0x4bcf88['update'](_0x3c38bc)[_0x7182('0xa')](function(_0x17fe2c){return _0x17fe2c;});}return null;};}function removeEntity(_0x4e3ac6){return function(_0x3e485c){if(_0x3e485c){return _0x3e485c[_0x7182('0xb')]()[_0x7182('0xa')](function(){_0x4e3ac6[_0x7182('0x5')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5565ba){return function(_0x204c9c){if(!_0x204c9c){_0x5565ba[_0x7182('0xc')](0x194);}return _0x204c9c;};}function handleError(_0x51a471,_0x3eb84a){_0x3eb84a=_0x3eb84a||0x1f4;return function(_0x53d1ce){logger[_0x7182('0xd')](_0x53d1ce[_0x7182('0xe')]);if(_0x53d1ce['name']){delete _0x53d1ce['name'];}_0x51a471[_0x7182('0x5')](_0x3eb84a)[_0x7182('0xf')](_0x53d1ce);};}exports[_0x7182('0x10')]=function(_0x37dca2,_0x3950c3){var _0x306151={},_0x5e9e15={},_0x184863={'count':0x0,'rows':[]};var _0x3536c3=_[_0x7182('0x11')](db[_0x7182('0x12')]['rawAttributes'],function(_0x75612){return{'name':_0x75612['fieldName'],'type':_0x75612[_0x7182('0x13')][_0x7182('0x14')]};});_0x5e9e15[_0x7182('0x15')]=_[_0x7182('0x11')](_0x3536c3,'name');_0x5e9e15[_0x7182('0x16')]=_['keys'](_0x37dca2[_0x7182('0x16')]);_0x5e9e15[_0x7182('0x17')]=_['intersection'](_0x5e9e15[_0x7182('0x15')],_0x5e9e15[_0x7182('0x16')]);_0x306151['attributes']=_['intersection'](_0x5e9e15[_0x7182('0x15')],qs['fields'](_0x37dca2[_0x7182('0x16')]['fields']));_0x306151[_0x7182('0x18')]=_0x306151[_0x7182('0x18')]['length']?_0x306151['attributes']:_0x5e9e15['model'];if(!_0x37dca2[_0x7182('0x16')][_0x7182('0x19')](_0x7182('0x1a'))){_0x306151[_0x7182('0x7')]=qs[_0x7182('0x7')](_0x37dca2['query']['limit']);_0x306151['offset']=qs[_0x7182('0x9')](_0x37dca2['query'][_0x7182('0x9')]);}_0x306151[_0x7182('0x1b')]=qs['sort'](_0x37dca2['query'][_0x7182('0x1c')]);_0x306151[_0x7182('0x1d')]=qs[_0x7182('0x17')](_[_0x7182('0x1e')](_0x37dca2[_0x7182('0x16')],_0x5e9e15[_0x7182('0x17')]),_0x3536c3);if(_0x37dca2['query']['filter']){_0x306151[_0x7182('0x1d')]=_['merge'](_0x306151[_0x7182('0x1d')],{'$or':_['map'](_0x3536c3,function(_0x397cfc){if(_0x397cfc[_0x7182('0x13')]!==_0x7182('0x1f')){var _0x460820={};_0x460820[_0x397cfc[_0x7182('0x20')]]={'$like':'%'+_0x37dca2['query'][_0x7182('0x21')]+'%'};return _0x460820;}})});}_0x306151=_[_0x7182('0x22')]({},_0x306151,_0x37dca2[_0x7182('0x23')]);var _0x12e44d={'where':_0x306151[_0x7182('0x1d')]};return db['Dynamics365Account']['count'](_0x12e44d)[_0x7182('0xa')](function(_0x3da167){_0x184863['count']=_0x3da167;if(_0x37dca2['query'][_0x7182('0x24')]){_0x306151['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x306151);})[_0x7182('0xa')](function(_0x4eb5a0){_0x184863[_0x7182('0x25')]=_0x4eb5a0;return _0x184863;})['then'](respondWithFilteredResult(_0x3950c3,_0x306151))[_0x7182('0x26')](handleError(_0x3950c3,null));};exports[_0x7182('0x27')]=function(_0x2f306a,_0x25cdb3){var _0x4ce300={'raw':![],'where':{'id':_0x2f306a[_0x7182('0x28')]['id']}},_0x5dd7a7={};_0x5dd7a7[_0x7182('0x15')]=_[_0x7182('0x29')](db[_0x7182('0x12')][_0x7182('0x2a')]);_0x5dd7a7['query']=_[_0x7182('0x29')](_0x2f306a[_0x7182('0x16')]);_0x5dd7a7[_0x7182('0x17')]=_[_0x7182('0x2b')](_0x5dd7a7['model'],_0x5dd7a7[_0x7182('0x16')]);_0x4ce300[_0x7182('0x18')]=_[_0x7182('0x2b')](_0x5dd7a7[_0x7182('0x15')],qs[_0x7182('0x2c')](_0x2f306a[_0x7182('0x16')][_0x7182('0x2c')]));_0x4ce300['attributes']=_0x4ce300[_0x7182('0x18')][_0x7182('0x2d')]?_0x4ce300[_0x7182('0x18')]:_0x5dd7a7[_0x7182('0x15')];if(_0x2f306a['query'][_0x7182('0x24')]){_0x4ce300['include']=[{'all':!![]}];}_0x4ce300=_[_0x7182('0x22')]({},_0x4ce300,_0x2f306a[_0x7182('0x23')]);return db[_0x7182('0x12')]['find'](_0x4ce300)[_0x7182('0xa')](handleEntityNotFound(_0x25cdb3,null))[_0x7182('0xa')](respondWithResult(_0x25cdb3,null))['catch'](handleError(_0x25cdb3,null));};exports[_0x7182('0x2e')]=function(_0x91bacd,_0xa4e51){return db['Dynamics365Account'][_0x7182('0x2e')](_0x91bacd[_0x7182('0x2f')],{})['then'](respondWithResult(_0xa4e51,0xc9))[_0x7182('0x26')](handleError(_0xa4e51,null));};exports[_0x7182('0x30')]=function(_0x4354f1,_0xcc89e2){if(_0x4354f1['body']['id']){delete _0x4354f1[_0x7182('0x2f')]['id'];}return db[_0x7182('0x12')]['find']({'where':{'id':_0x4354f1[_0x7182('0x28')]['id']}})[_0x7182('0xa')](handleEntityNotFound(_0xcc89e2,null))[_0x7182('0xa')](saveUpdates(_0x4354f1[_0x7182('0x2f')],null))[_0x7182('0xa')](respondWithResult(_0xcc89e2,null))[_0x7182('0x26')](handleError(_0xcc89e2,null));};exports[_0x7182('0xb')]=function(_0x1529b4,_0x12655f){return db[_0x7182('0x12')][_0x7182('0x31')]({'where':{'id':_0x1529b4['params']['id']}})['then'](handleEntityNotFound(_0x12655f,null))[_0x7182('0xa')](removeEntity(_0x12655f,null))[_0x7182('0x26')](handleError(_0x12655f,null));};exports[_0x7182('0x32')]=function(_0x59595c,_0x19d7bf){var _0x7c8c00={};var _0x5ce8ee={};var _0x556f1d;var _0x5545a1;return db['Dynamics365Account']['findOne']({'where':{'id':_0x59595c[_0x7182('0x28')]['id']}})[_0x7182('0xa')](handleEntityNotFound(_0x19d7bf,null))[_0x7182('0xa')](function(_0x365804){if(_0x365804){_0x556f1d=_0x365804;_0x5ce8ee[_0x7182('0x15')]=_[_0x7182('0x29')](db[_0x7182('0x33')][_0x7182('0x2a')]);_0x5ce8ee[_0x7182('0x16')]=_['keys'](_0x59595c['query']);_0x5ce8ee[_0x7182('0x17')]=_['intersection'](_0x5ce8ee[_0x7182('0x15')],_0x5ce8ee[_0x7182('0x16')]);_0x7c8c00[_0x7182('0x18')]=_[_0x7182('0x2b')](_0x5ce8ee[_0x7182('0x15')],qs[_0x7182('0x2c')](_0x59595c['query'][_0x7182('0x2c')]));_0x7c8c00[_0x7182('0x18')]=_0x7c8c00['attributes']['length']?_0x7c8c00['attributes']:_0x5ce8ee['model'];_0x7c8c00[_0x7182('0x1b')]=qs[_0x7182('0x1c')](_0x59595c[_0x7182('0x16')]['sort']);_0x7c8c00[_0x7182('0x1d')]=qs['filters'](_[_0x7182('0x1e')](_0x59595c[_0x7182('0x16')],_0x5ce8ee[_0x7182('0x17')]));if(_0x59595c[_0x7182('0x16')][_0x7182('0x21')]){_0x7c8c00[_0x7182('0x1d')]=_[_0x7182('0x22')](_0x7c8c00[_0x7182('0x1d')],{'$or':_[_0x7182('0x11')](_0x7c8c00['attributes'],function(_0x96e256){var _0x3cf441={};_0x3cf441[_0x96e256]={'$like':'%'+_0x59595c['query']['filter']+'%'};return _0x3cf441;})});}_0x7c8c00=_['merge']({},_0x7c8c00,_0x59595c[_0x7182('0x23')]);return _0x556f1d['getConfigurations'](_0x7c8c00);}})[_0x7182('0xa')](function(_0x5d59bf){if(_0x5d59bf){_0x5545a1=_0x5d59bf['length'];if(!_0x59595c['query'][_0x7182('0x19')]('nolimit')){_0x7c8c00[_0x7182('0x7')]=qs[_0x7182('0x7')](_0x59595c[_0x7182('0x16')][_0x7182('0x7')]);_0x7c8c00[_0x7182('0x9')]=qs[_0x7182('0x9')](_0x59595c[_0x7182('0x16')][_0x7182('0x9')]);}return _0x556f1d[_0x7182('0x32')](_0x7c8c00);}})[_0x7182('0xa')](function(_0x386404){if(_0x386404){return _0x386404?{'count':_0x5545a1,'rows':_0x386404}:null;}})[_0x7182('0xa')](respondWithResult(_0x19d7bf,null))[_0x7182('0x26')](handleError(_0x19d7bf,null));};exports[_0x7182('0x34')]=function(_0x41e8ea,_0xe7148f){if(_0x41e8ea[_0x7182('0x2f')]['id']){delete _0x41e8ea['body']['id'];}return db[_0x7182('0x12')][_0x7182('0x35')]({'where':{'id':_0x41e8ea['params']['id']}})['then'](handleEntityNotFound(_0xe7148f,null))['then'](function(_0x26ff67){if(_0x26ff67){_0x41e8ea['body']['AccountId']=_0x26ff67['id'];_0x41e8ea['body'][_0x7182('0x36')]=integrations[_0x7182('0x37')](_0x41e8ea[_0x7182('0x2f')]['channel'],_0x41e8ea[_0x7182('0x2f')][_0x7182('0x13')]);_0x41e8ea[_0x7182('0x2f')][_0x7182('0x38')]=integrations[_0x7182('0x39')](_0x41e8ea['body'][_0x7182('0x3a')],_0x41e8ea[_0x7182('0x2f')]['type']);return db['Dynamics365Configuration'][_0x7182('0x2e')](_0x41e8ea['body'],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x7182('0x3b')],'as':_0x7182('0x38')}]});}return null;})[_0x7182('0xa')](respondWithResult(_0xe7148f,null))['catch'](handleError(_0xe7148f,null));};function sanitizeRemoteUri(_0x3b73df){var _0x31af91=_0x3b73df[_0x7182('0x3c')](-0x1);if(_0x31af91==='/')return _0x3b73df[_0x7182('0x3d')](0x0,_0x3b73df[_0x7182('0x3e')](_0x31af91));return _0x3b73df;}function getWebApiUrl(_0x3dd33b){return util[_0x7182('0x3f')]('%s/api/data/v9.0/',_0x3dd33b);}exports[_0x7182('0x40')]=function(_0x397193,_0x54fdb2){var _0x381512=_0x397193['query']['ticketType'];var _0x39d688=_0x381512==='incident'?_0x7182('0x41'):_0x7182('0x42');var _0xa2bb5d='';var _0x40a7f1='';var _0x325ab5='';var _0x3091ee='';var _0x198007='';var _0x3bb1d2='';var _0x41c4c6='';var _0x31a479='';var _0x163b34=[_0x7182('0x43'),_0x7182('0x44'),_0x7182('0x45'),'ownerid',_0x7182('0x46'),_0x7182('0x47'),'phonenumber',_0x7182('0x48'),_0x7182('0x49'),_0x7182('0x4a')];var _0x3a7449=[_0x7182('0x4b'),_0x7182('0x4c'),_0x7182('0x4d'),'billedserviceunits',_0x7182('0x4e'),'contactidyominame',_0x7182('0x4f'),'contractidname',_0x7182('0x50'),_0x7182('0x51'),_0x7182('0x52'),_0x7182('0x53'),_0x7182('0x54'),_0x7182('0x55'),_0x7182('0x56'),'customeridname','customeridtype',_0x7182('0x57'),_0x7182('0x58'),'entitlementidname',_0x7182('0x59'),_0x7182('0x5a'),_0x7182('0x5b'),_0x7182('0x5c'),_0x7182('0x5d'),_0x7182('0x5e'),_0x7182('0x5f'),'influencescore','kbarticleidname',_0x7182('0x60'),'masteridname',_0x7182('0x61'),_0x7182('0x62'),_0x7182('0x63'),_0x7182('0x64'),_0x7182('0x65'),_0x7182('0x66'),_0x7182('0x67'),_0x7182('0x68'),_0x7182('0x69'),_0x7182('0x6a'),_0x7182('0x6b'),'overriddencreatedon','owneridname','owneridtype',_0x7182('0x6c'),_0x7182('0x6d'),_0x7182('0x6e'),'primarycontactidyominame','prioritycodename',_0x7182('0x6f'),_0x7182('0x70'),'resolveby',_0x7182('0x71'),'responseby',_0x7182('0x72'),'responsiblecontactidyominame',_0x7182('0x73'),_0x7182('0x74'),_0x7182('0x75'),_0x7182('0x76'),'statecode',_0x7182('0x77'),'subjectidname',_0x7182('0x78'),'timezoneruleversionnumber',_0x7182('0x79'),_0x7182('0x7a'),_0x7182('0x7b'),'versionnumber'];var _0x519108=_0x163b34[_0x7182('0x7c')](_0x3a7449);return db['Dynamics365Account'][_0x7182('0x35')]({'where':{'id':_0x397193[_0x7182('0x28')]['id']},'attributes':['id','username','password',_0x7182('0x7d'),_0x7182('0x7e'),'clientId',_0x7182('0x7f'),_0x7182('0x80')],'include':[{'model':db[_0x7182('0x81')],'as':_0x7182('0x81'),'attributes':['id',_0x7182('0x82'),_0x7182('0x83')]}]})['then'](handleEntityNotFound(_0x54fdb2,null))[_0x7182('0xa')](function(_0x332f74){if(_0x332f74){if(_0x332f74[_0x7182('0x80')]){_0x332f74['access_token']=_0x332f74['CloudProvider'][_0x7182('0x82')];_0x31a479=sanitizeRemoteUri(_0x332f74[_0x7182('0x81')][_0x7182('0x83')]);_0x41c4c6=getWebApiUrl(_0x31a479);return _0x332f74;}_0x31a479=sanitizeRemoteUri(_0x332f74[_0x7182('0x7d')]);_0x41c4c6=getWebApiUrl(_0x31a479);var _0x29ef25={'method':'POST','uri':_0x7182('0x84')+_0x332f74[_0x7182('0x7e')]+_0x7182('0x85'),'form':{'client_id':_0x332f74[_0x7182('0x86')],'resource':_0x31a479,'username':_0x332f74[_0x7182('0x87')],'password':_0x332f74[_0x7182('0x88')],'grant_type':_0x7182('0x88'),'client_secret':_0x332f74[_0x7182('0x7f')]},'json':!![]};return rp(_0x29ef25);}})['then'](function(_0x27da4c){_0x3bb1d2=_0x27da4c[_0x7182('0x89')];var _0x12bfd5={'method':_0x7182('0x8a'),'uri':encodeURI(_0x41c4c6+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x39d688+'\x27'),'headers':{'Authorization':_0x7182('0x8b')+_0x3bb1d2,'If-None-Match':null,'OData-Version':_0x7182('0x8c')},'json':!![]};return rp(_0x12bfd5);})[_0x7182('0xa')](function(_0x5304ea){var _0x131f69=_0x5304ea[_0x7182('0x8d')][0x0];var _0x311004=_0x131f69[_0x7182('0x8e')];var _0xe0d374={'method':'GET','uri':_0x41c4c6+_0x7182('0x8f')+_0x311004+_0x7182('0x90'),'headers':{'Authorization':_0x7182('0x8b')+_0x3bb1d2,'If-None-Match':null,'OData-Version':_0x7182('0x8c')},'json':!![]};return rp(_0xe0d374);})[_0x7182('0xa')](function(_0x3cc910){_0xa2bb5d=_0x3cc910;_0x40a7f1=_0xa2bb5d['Attributes'];_0x40a7f1=_[_0x7182('0x91')](_0x40a7f1,function(_0x4185ac){return!_0x519108[_0x7182('0x92')](_0x4185ac[_0x7182('0x93')]);});var _0x49dec1=[];var _0x1e5507=[];_0x40a7f1[_0x7182('0x94')](function(_0x66b0b7){if(_0x66b0b7[_0x7182('0x95')]){var _0x13e2b5=_0x66b0b7['@odata.type'][_0x7182('0x3d')](_0x66b0b7[_0x7182('0x95')][_0x7182('0x3e')]('.')+0x1);if(_0x13e2b5===_0x7182('0x96')){_0x49dec1[_0x7182('0x97')](getSelectList(_0x41c4c6,_0x381512,_0x1e5507,_0xa2bb5d['MetadataId'],_0x66b0b7[_0x7182('0x8e')],_0x3bb1d2));}}});return Promise['all'](_0x49dec1);})['then'](function(_0x16056c){_0x325ab5=_0x16056c[0x0];var _0x2926fd=[];var _0x5199ef=[];_0x40a7f1[_0x7182('0x94')](function(_0x59c7db){if(!_[_0x7182('0x98')](_0x59c7db['@odata.type'])){var _0x3da3b4=_0x59c7db[_0x7182('0x95')]['substring'](_0x59c7db[_0x7182('0x95')][_0x7182('0x3e')]('.')+0x1);if(_0x3da3b4===_0x7182('0x99')){_0x2926fd[_0x7182('0x97')](getBooleanList(_0x41c4c6,_0x381512,_0x5199ef,_0xa2bb5d[_0x7182('0x8e')],_0x59c7db[_0x7182('0x8e')],_0x3bb1d2));}}});return Promise[_0x7182('0x9a')](_0x2926fd);})['then'](function(_0x1b8f02){_0x3091ee=_0x1b8f02[0x0];var _0x4d86e8=[];var _0x5cbc57=[];_0x40a7f1[_0x7182('0x94')](function(_0x1c999c){if(_0x1c999c['@odata.type']){var _0x3d500b=_0x1c999c[_0x7182('0x95')]['substring'](_0x1c999c[_0x7182('0x95')]['lastIndexOf']('.')+0x1);if(_0x3d500b===_0x7182('0x9b')||_0x3d500b==='DoubleAttributeMetadata'||_0x3d500b===_0x7182('0x9c')||_0x3d500b===_0x7182('0x9d')||_0x3d500b===_0x7182('0x9e')||_0x3d500b===_0x7182('0x9f')||_0x3d500b===_0x7182('0xa0')||_0x3d500b===_0x7182('0xa1')||_0x3d500b===_0x7182('0xa2')||_0x3d500b===_0x7182('0xa3')){_0x4d86e8['push'](getInputList(_0x41c4c6,_0x381512,_0x3d500b,_0x5cbc57,_0xa2bb5d[_0x7182('0x8e')],_0x1c999c[_0x7182('0x8e')],_0x3bb1d2));}}});return Promise[_0x7182('0x9a')](_0x4d86e8);})[_0x7182('0xa')](function(_0x555f96){_0x198007=_0x555f96[0x0];var _0x3b59a5=_0x325ab5[_0x7182('0x7c')](_0x3091ee)[_0x7182('0x7c')](_0x198007);var _0x13ac41={'count':_0x3b59a5[_0x7182('0x2d')],'rows':_0x3b59a5};return _0x13ac41;})[_0x7182('0xa')](respondWithResult(_0x54fdb2,null))[_0x7182('0x26')](function(_0x4f22e1){var _0x1c5131=_0x397193['query'][_0x7182('0xa4')]?0x1f4:_0x4f22e1[_0x7182('0xa5')]||0x1f4;logger['error'](_0x4f22e1[_0x7182('0xe')]);delete _0x4f22e1['name'];if(_0x1c5131===0x191){_0x1c5131=0x190;}_0x54fdb2[_0x7182('0x5')](_0x1c5131)[_0x7182('0xf')](_0x397193[_0x7182('0x16')][_0x7182('0xa4')]?{'message':_0x7182('0xa6'),'statusCode':_0x4f22e1['statusCode']}:_0x4f22e1);});};function getSelectList(_0x5d30bf,_0x3a34da,_0xa479bf,_0x1b8bd2,_0x3900ad,_0x47542d){var _0xdb5849={'method':_0x7182('0x8a'),'uri':_0x5d30bf+'EntityDefinitions('+_0x1b8bd2+_0x7182('0xa7')+_0x3900ad+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x7182('0xa8'),'headers':{'Authorization':_0x7182('0x8b')+_0x47542d,'If-None-Match':null,'OData-Version':_0x7182('0x8c')},'json':!![]};return rp(_0xdb5849)[_0x7182('0xa')](function(_0xa22a2e){var _0x3c4e3c=[];var _0x558ee2=_0xa22a2e[_0x7182('0xa9')]['Options'];_0x558ee2[_0x7182('0x94')](function(_0x42ba86){_0x3c4e3c[_0x7182('0x97')]({'name':_0x42ba86['Label'][_0x7182('0xaa')]['Label'],'value':String(_0x42ba86['Value'])});});var _0x4dbdf8={'id':_0x3a34da+'_'+_0xa22a2e[_0x7182('0x93')],'name':_0xa22a2e[_0x7182('0xab')][_0x7182('0xaa')]['Label'],'custom':![],'options':_0x3c4e3c};_0xa479bf['push'](_0x4dbdf8);return _0xa479bf;});}function getBooleanList(_0x2ec993,_0x4bbfd8,_0x24a785,_0xf2a463,_0x1e292e,_0x6cc6d6){var _0x389aea={'method':_0x7182('0x8a'),'uri':_0x2ec993+_0x7182('0x8f')+_0xf2a463+')/Attributes('+_0x1e292e+_0x7182('0xac'),'headers':{'Authorization':_0x7182('0x8b')+_0x6cc6d6,'If-None-Match':null,'OData-Version':_0x7182('0x8c')},'json':!![]};return rp(_0x389aea)[_0x7182('0xa')](function(_0x42a0bf){var _0x4fc305=[];_0x4fc305['push']({'name':_0x42a0bf[_0x7182('0xa9')][_0x7182('0xad')][_0x7182('0xae')][_0x7182('0xaa')][_0x7182('0xae')],'value':_0x7182('0xaf')},{'name':_0x42a0bf[_0x7182('0xa9')][_0x7182('0xb0')]['Label'][_0x7182('0xaa')][_0x7182('0xae')],'value':_0x7182('0xb1')});var _0x46adb7={'id':_0x4bbfd8+'_'+_0x42a0bf[_0x7182('0x93')],'name':_0x42a0bf['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x4fc305};_0x24a785[_0x7182('0x97')](_0x46adb7);return _0x24a785;});}function getInputList(_0x52d83d,_0x5a120c,_0x400105,_0x472466,_0x5f12e3,_0x534f8a,_0x458120){var _0x1e9222={'method':'GET','uri':_0x52d83d+'EntityDefinitions('+_0x5f12e3+_0x7182('0xa7')+_0x534f8a+_0x7182('0xb2')+_0x400105+_0x7182('0xb3'),'headers':{'Authorization':_0x7182('0x8b')+_0x458120,'If-None-Match':null,'OData-Version':_0x7182('0x8c')},'json':!![]};return rp(_0x1e9222)['then'](function(_0x4385c0){var _0xe0c27c={'id':_0x5a120c+'_'+_0x4385c0[_0x7182('0x93')],'name':_0x4385c0[_0x7182('0xab')][_0x7182('0xaa')]?_0x4385c0[_0x7182('0xab')][_0x7182('0xaa')][_0x7182('0xae')]:_0x4385c0[_0x7182('0x93')],'custom':![],'options':[]};_0x472466[_0x7182('0x97')](_0xe0c27c);return _0x472466;});} \ No newline at end of file +var _0xb7aa=['channel','getDescriptions','Dynamics365Field','Subjects','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','exchangerate','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','remoteUri','tenantId','clientId','CloudProvider','data5','data7','modernAuthentication','POST','/oauth2/token','username','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','Attributes','includes','LogicalName','@odata.type','push','all','isNil','BooleanAttributeMetadata','forEach','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','stack','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','status','offset','undefined','count','Content-Range','json','then','destroy','end','sendStatus','name','send','index','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','type','options','where','Dynamics365Account','includeAll','include','params','rawAttributes','find','catch','create','body','update','getConfigurations','Dynamics365Configuration','addConfiguration','findOne','AccountId'];(function(_0x2416b2,_0x134439){var _0x159c30=function(_0x2e335c){while(--_0x2e335c){_0x2416b2['push'](_0x2416b2['shift']());}};_0x159c30(++_0x134439);}(_0xb7aa,0x13b));var _0xab7a=function(_0x29eac6,_0x48f3c4){_0x29eac6=_0x29eac6-0x0;var _0x5c9d17=_0xb7aa[_0x29eac6];return _0x5c9d17;};'use strict';var rp=require(_0xab7a('0x0'));var util=require(_0xab7a('0x1'));var _=require(_0xab7a('0x2'));var qs=require(_0xab7a('0x3'));var logger=require('../../config/logger')(_0xab7a('0x4'));var db=require(_0xab7a('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x49382a,_0x25751a){_0x25751a=_0x25751a||0xc8;return function(_0x43b1fc){if(_0x43b1fc){return _0x49382a[_0xab7a('0x6')](_0x25751a)['json'](_0x43b1fc);}};}function respondWithFilteredResult(_0x260100,_0x2c4dd4){return function(_0xa63800){if(_0xa63800){var _0x1fdfb1=typeof _0x2c4dd4[_0xab7a('0x7')]===_0xab7a('0x8')&&typeof _0x2c4dd4['limit']===_0xab7a('0x8');var _0x18b260=_0xa63800[_0xab7a('0x9')];var _0x10fdb0=_0x1fdfb1?0x0:_0x2c4dd4[_0xab7a('0x7')];var _0x18d4a3=_0x1fdfb1?_0xa63800[_0xab7a('0x9')]:_0x2c4dd4['offset']+_0x2c4dd4['limit'];var _0x2852ee;if(_0x18d4a3>=_0x18b260){_0x18d4a3=_0x18b260;_0x2852ee=0xc8;}else{_0x2852ee=0xce;}_0x260100[_0xab7a('0x6')](_0x2852ee);return _0x260100['set'](_0xab7a('0xa'),_0x10fdb0+'-'+_0x18d4a3+'/'+_0x18b260)[_0xab7a('0xb')](_0xa63800);}return null;};}function saveUpdates(_0x8f9edb){return function(_0x2c7c0f){if(_0x2c7c0f){return _0x2c7c0f['update'](_0x8f9edb)[_0xab7a('0xc')](function(_0x362d29){return _0x362d29;});}return null;};}function removeEntity(_0x1e2c6f){return function(_0xbe892b){if(_0xbe892b){return _0xbe892b[_0xab7a('0xd')]()['then'](function(){_0x1e2c6f['status'](0xcc)[_0xab7a('0xe')]();});}};}function handleEntityNotFound(_0x463ec1){return function(_0x183555){if(!_0x183555){_0x463ec1[_0xab7a('0xf')](0x194);}return _0x183555;};}function handleError(_0x2d397a,_0x59b270){_0x59b270=_0x59b270||0x1f4;return function(_0x10e39c){logger['error'](_0x10e39c['stack']);if(_0x10e39c[_0xab7a('0x10')]){delete _0x10e39c['name'];}_0x2d397a['status'](_0x59b270)[_0xab7a('0x11')](_0x10e39c);};}exports[_0xab7a('0x12')]=function(_0x45f605,_0x228afc){var _0x235035={},_0x591a55={},_0x22cc03={'count':0x0,'rows':[]};var _0x54c076=_['map'](db['Dynamics365Account']['rawAttributes'],function(_0x204efe){return{'name':_0x204efe['fieldName'],'type':_0x204efe['type'][_0xab7a('0x13')]};});_0x591a55[_0xab7a('0x14')]=_[_0xab7a('0x15')](_0x54c076,_0xab7a('0x10'));_0x591a55[_0xab7a('0x16')]=_[_0xab7a('0x17')](_0x45f605[_0xab7a('0x16')]);_0x591a55[_0xab7a('0x18')]=_[_0xab7a('0x19')](_0x591a55[_0xab7a('0x14')],_0x591a55[_0xab7a('0x16')]);_0x235035[_0xab7a('0x1a')]=_['intersection'](_0x591a55[_0xab7a('0x14')],qs[_0xab7a('0x1b')](_0x45f605[_0xab7a('0x16')][_0xab7a('0x1b')]));_0x235035[_0xab7a('0x1a')]=_0x235035[_0xab7a('0x1a')][_0xab7a('0x1c')]?_0x235035[_0xab7a('0x1a')]:_0x591a55[_0xab7a('0x14')];if(!_0x45f605[_0xab7a('0x16')][_0xab7a('0x1d')](_0xab7a('0x1e'))){_0x235035[_0xab7a('0x1f')]=qs[_0xab7a('0x1f')](_0x45f605[_0xab7a('0x16')]['limit']);_0x235035[_0xab7a('0x7')]=qs[_0xab7a('0x7')](_0x45f605[_0xab7a('0x16')][_0xab7a('0x7')]);}_0x235035[_0xab7a('0x20')]=qs[_0xab7a('0x21')](_0x45f605[_0xab7a('0x16')][_0xab7a('0x21')]);_0x235035['where']=qs[_0xab7a('0x18')](_[_0xab7a('0x22')](_0x45f605[_0xab7a('0x16')],_0x591a55['filters']),_0x54c076);if(_0x45f605[_0xab7a('0x16')][_0xab7a('0x23')]){_0x235035['where']=_[_0xab7a('0x24')](_0x235035['where'],{'$or':_[_0xab7a('0x15')](_0x54c076,function(_0x24bce7){if(_0x24bce7[_0xab7a('0x25')]!=='VIRTUAL'){var _0x2294f5={};_0x2294f5[_0x24bce7[_0xab7a('0x10')]]={'$like':'%'+_0x45f605[_0xab7a('0x16')]['filter']+'%'};return _0x2294f5;}})});}_0x235035=_[_0xab7a('0x24')]({},_0x235035,_0x45f605[_0xab7a('0x26')]);var _0x70a4b5={'where':_0x235035[_0xab7a('0x27')]};return db[_0xab7a('0x28')][_0xab7a('0x9')](_0x70a4b5)[_0xab7a('0xc')](function(_0x127863){_0x22cc03['count']=_0x127863;if(_0x45f605[_0xab7a('0x16')][_0xab7a('0x29')]){_0x235035[_0xab7a('0x2a')]=[{'all':!![]}];}return db[_0xab7a('0x28')]['findAll'](_0x235035);})[_0xab7a('0xc')](function(_0x267a54){_0x22cc03['rows']=_0x267a54;return _0x22cc03;})['then'](respondWithFilteredResult(_0x228afc,_0x235035))['catch'](handleError(_0x228afc,null));};exports['show']=function(_0x3429da,_0x1eeb1){var _0x153f3a={'raw':![],'where':{'id':_0x3429da[_0xab7a('0x2b')]['id']}},_0x376033={};_0x376033[_0xab7a('0x14')]=_[_0xab7a('0x17')](db[_0xab7a('0x28')][_0xab7a('0x2c')]);_0x376033['query']=_[_0xab7a('0x17')](_0x3429da[_0xab7a('0x16')]);_0x376033['filters']=_[_0xab7a('0x19')](_0x376033['model'],_0x376033[_0xab7a('0x16')]);_0x153f3a[_0xab7a('0x1a')]=_[_0xab7a('0x19')](_0x376033[_0xab7a('0x14')],qs[_0xab7a('0x1b')](_0x3429da[_0xab7a('0x16')]['fields']));_0x153f3a[_0xab7a('0x1a')]=_0x153f3a['attributes'][_0xab7a('0x1c')]?_0x153f3a[_0xab7a('0x1a')]:_0x376033['model'];if(_0x3429da['query'][_0xab7a('0x29')]){_0x153f3a[_0xab7a('0x2a')]=[{'all':!![]}];}_0x153f3a=_[_0xab7a('0x24')]({},_0x153f3a,_0x3429da[_0xab7a('0x26')]);return db['Dynamics365Account'][_0xab7a('0x2d')](_0x153f3a)['then'](handleEntityNotFound(_0x1eeb1,null))[_0xab7a('0xc')](respondWithResult(_0x1eeb1,null))[_0xab7a('0x2e')](handleError(_0x1eeb1,null));};exports[_0xab7a('0x2f')]=function(_0x5cbed6,_0x5d19d3){return db[_0xab7a('0x28')][_0xab7a('0x2f')](_0x5cbed6[_0xab7a('0x30')],{})[_0xab7a('0xc')](respondWithResult(_0x5d19d3,0xc9))[_0xab7a('0x2e')](handleError(_0x5d19d3,null));};exports[_0xab7a('0x31')]=function(_0x32d8ed,_0x57a292){if(_0x32d8ed[_0xab7a('0x30')]['id']){delete _0x32d8ed[_0xab7a('0x30')]['id'];}return db['Dynamics365Account'][_0xab7a('0x2d')]({'where':{'id':_0x32d8ed[_0xab7a('0x2b')]['id']}})[_0xab7a('0xc')](handleEntityNotFound(_0x57a292,null))[_0xab7a('0xc')](saveUpdates(_0x32d8ed[_0xab7a('0x30')],null))[_0xab7a('0xc')](respondWithResult(_0x57a292,null))[_0xab7a('0x2e')](handleError(_0x57a292,null));};exports['destroy']=function(_0x5518b6,_0x52bd92){return db[_0xab7a('0x28')][_0xab7a('0x2d')]({'where':{'id':_0x5518b6['params']['id']}})[_0xab7a('0xc')](handleEntityNotFound(_0x52bd92,null))[_0xab7a('0xc')](removeEntity(_0x52bd92,null))[_0xab7a('0x2e')](handleError(_0x52bd92,null));};exports[_0xab7a('0x32')]=function(_0x56ad1b,_0x5f21a4){var _0x47c019={};var _0x43d900={};var _0x3274d6;var _0x4b33d8;return db[_0xab7a('0x28')]['findOne']({'where':{'id':_0x56ad1b[_0xab7a('0x2b')]['id']}})[_0xab7a('0xc')](handleEntityNotFound(_0x5f21a4,null))[_0xab7a('0xc')](function(_0x5c1092){if(_0x5c1092){_0x3274d6=_0x5c1092;_0x43d900[_0xab7a('0x14')]=_[_0xab7a('0x17')](db[_0xab7a('0x33')][_0xab7a('0x2c')]);_0x43d900[_0xab7a('0x16')]=_[_0xab7a('0x17')](_0x56ad1b['query']);_0x43d900[_0xab7a('0x18')]=_[_0xab7a('0x19')](_0x43d900[_0xab7a('0x14')],_0x43d900[_0xab7a('0x16')]);_0x47c019[_0xab7a('0x1a')]=_[_0xab7a('0x19')](_0x43d900['model'],qs['fields'](_0x56ad1b['query'][_0xab7a('0x1b')]));_0x47c019['attributes']=_0x47c019[_0xab7a('0x1a')][_0xab7a('0x1c')]?_0x47c019[_0xab7a('0x1a')]:_0x43d900[_0xab7a('0x14')];_0x47c019[_0xab7a('0x20')]=qs['sort'](_0x56ad1b[_0xab7a('0x16')][_0xab7a('0x21')]);_0x47c019[_0xab7a('0x27')]=qs[_0xab7a('0x18')](_[_0xab7a('0x22')](_0x56ad1b[_0xab7a('0x16')],_0x43d900[_0xab7a('0x18')]));if(_0x56ad1b[_0xab7a('0x16')][_0xab7a('0x23')]){_0x47c019[_0xab7a('0x27')]=_['merge'](_0x47c019[_0xab7a('0x27')],{'$or':_[_0xab7a('0x15')](_0x47c019[_0xab7a('0x1a')],function(_0x4a5758){var _0x26e32a={};_0x26e32a[_0x4a5758]={'$like':'%'+_0x56ad1b[_0xab7a('0x16')]['filter']+'%'};return _0x26e32a;})});}_0x47c019=_[_0xab7a('0x24')]({},_0x47c019,_0x56ad1b['options']);return _0x3274d6[_0xab7a('0x32')](_0x47c019);}})[_0xab7a('0xc')](function(_0x38812f){if(_0x38812f){_0x4b33d8=_0x38812f[_0xab7a('0x1c')];if(!_0x56ad1b[_0xab7a('0x16')][_0xab7a('0x1d')](_0xab7a('0x1e'))){_0x47c019[_0xab7a('0x1f')]=qs[_0xab7a('0x1f')](_0x56ad1b['query'][_0xab7a('0x1f')]);_0x47c019['offset']=qs[_0xab7a('0x7')](_0x56ad1b[_0xab7a('0x16')]['offset']);}return _0x3274d6['getConfigurations'](_0x47c019);}})['then'](function(_0x3bc74c){if(_0x3bc74c){return _0x3bc74c?{'count':_0x4b33d8,'rows':_0x3bc74c}:null;}})['then'](respondWithResult(_0x5f21a4,null))[_0xab7a('0x2e')](handleError(_0x5f21a4,null));};exports[_0xab7a('0x34')]=function(_0x2f685f,_0x2d9a67){if(_0x2f685f['body']['id']){delete _0x2f685f[_0xab7a('0x30')]['id'];}return db['Dynamics365Account'][_0xab7a('0x35')]({'where':{'id':_0x2f685f[_0xab7a('0x2b')]['id']}})[_0xab7a('0xc')](handleEntityNotFound(_0x2d9a67,null))[_0xab7a('0xc')](function(_0x36d638){if(_0x36d638){_0x2f685f[_0xab7a('0x30')][_0xab7a('0x36')]=_0x36d638['id'];_0x2f685f[_0xab7a('0x30')]['Subjects']=integrations['getSubjects'](_0x2f685f[_0xab7a('0x30')][_0xab7a('0x37')],_0x2f685f[_0xab7a('0x30')]['type']);_0x2f685f[_0xab7a('0x30')]['Descriptions']=integrations[_0xab7a('0x38')](_0x2f685f[_0xab7a('0x30')][_0xab7a('0x37')],_0x2f685f[_0xab7a('0x30')][_0xab7a('0x25')]);return db[_0xab7a('0x33')]['create'](_0x2f685f[_0xab7a('0x30')],{'include':[{'model':db[_0xab7a('0x39')],'as':_0xab7a('0x3a')},{'model':db[_0xab7a('0x39')],'as':_0xab7a('0x3b')}]});}return null;})['then'](respondWithResult(_0x2d9a67,null))[_0xab7a('0x2e')](handleError(_0x2d9a67,null));};function sanitizeRemoteUri(_0x163881){var _0x46a074=_0x163881[_0xab7a('0x3c')](-0x1);if(_0x46a074==='/')return _0x163881[_0xab7a('0x3d')](0x0,_0x163881[_0xab7a('0x3e')](_0x46a074));return _0x163881;}function getWebApiUrl(_0x49b180){return util[_0xab7a('0x3f')](_0xab7a('0x40'),_0x49b180);}exports['getFields']=function(_0x485709,_0x4b8d1d){var _0xfb2c68=_0x485709[_0xab7a('0x16')][_0xab7a('0x41')];var _0x37d894=_0xfb2c68===_0xab7a('0x42')?_0xab7a('0x43'):_0xab7a('0x44');var _0x39725f='';var _0x510f97='';var _0x1ce6ce='';var _0x25262d='';var _0x4f2f0c='';var _0x6c8bb2='';var _0x3c0fc5='';var _0xd12348='';var _0x2754af=[_0xab7a('0x45'),_0xab7a('0x46'),_0xab7a('0x47'),'ownerid',_0xab7a('0x48'),_0xab7a('0x49'),_0xab7a('0x4a'),_0xab7a('0x4b'),_0xab7a('0x4c'),_0xab7a('0x4d')];var _0x9a5b07=[_0xab7a('0x4e'),_0xab7a('0x4f'),_0xab7a('0x50'),_0xab7a('0x51'),_0xab7a('0x52'),_0xab7a('0x53'),_0xab7a('0x54'),_0xab7a('0x55'),_0xab7a('0x56'),_0xab7a('0x57'),_0xab7a('0x58'),_0xab7a('0x59'),_0xab7a('0x5a'),_0xab7a('0x5b'),_0xab7a('0x5c'),_0xab7a('0x5d'),_0xab7a('0x5e'),_0xab7a('0x5f'),'emailaddress',_0xab7a('0x60'),_0xab7a('0x61'),'entityimage_url','escalatedon',_0xab7a('0x62'),'firstresponsebykpiidname',_0xab7a('0x63'),_0xab7a('0x64'),_0xab7a('0x65'),'kbarticleidname',_0xab7a('0x66'),_0xab7a('0x67'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0xab7a('0x68'),_0xab7a('0x69'),_0xab7a('0x6a'),_0xab7a('0x6b'),_0xab7a('0x6c'),_0xab7a('0x6d'),_0xab7a('0x6e'),_0xab7a('0x6f'),_0xab7a('0x70'),_0xab7a('0x71'),'owneridname','owneridtype',_0xab7a('0x72'),_0xab7a('0x73'),_0xab7a('0x74'),'primarycontactidyominame',_0xab7a('0x75'),'productidname','productserialnumber',_0xab7a('0x76'),_0xab7a('0x77'),_0xab7a('0x78'),_0xab7a('0x79'),_0xab7a('0x7a'),'sentimentvalue',_0xab7a('0x7b'),'slaname',_0xab7a('0x7c'),_0xab7a('0x7d'),'statuscode',_0xab7a('0x7e'),_0xab7a('0x7f'),_0xab7a('0x80'),_0xab7a('0x81'),_0xab7a('0x82'),'utcconversiontimezonecode',_0xab7a('0x83')];var _0x327cc4=_0x2754af[_0xab7a('0x84')](_0x9a5b07);return db[_0xab7a('0x28')][_0xab7a('0x35')]({'where':{'id':_0x485709[_0xab7a('0x2b')]['id']},'attributes':['id','username',_0xab7a('0x85'),_0xab7a('0x86'),_0xab7a('0x87'),_0xab7a('0x88'),'clientSecret','modernAuthentication'],'include':[{'model':db[_0xab7a('0x89')],'as':'CloudProvider','attributes':['id',_0xab7a('0x8a'),_0xab7a('0x8b')]}]})[_0xab7a('0xc')](handleEntityNotFound(_0x4b8d1d,null))['then'](function(_0x5e84eb){if(_0x5e84eb){if(_0x5e84eb[_0xab7a('0x8c')]){_0x5e84eb['access_token']=_0x5e84eb[_0xab7a('0x89')]['data5'];_0xd12348=sanitizeRemoteUri(_0x5e84eb[_0xab7a('0x89')][_0xab7a('0x8b')]);_0x3c0fc5=getWebApiUrl(_0xd12348);return _0x5e84eb;}_0xd12348=sanitizeRemoteUri(_0x5e84eb[_0xab7a('0x86')]);_0x3c0fc5=getWebApiUrl(_0xd12348);var _0x41fdfd={'method':_0xab7a('0x8d'),'uri':'https://login.microsoftonline.com/'+_0x5e84eb[_0xab7a('0x87')]+_0xab7a('0x8e'),'form':{'client_id':_0x5e84eb[_0xab7a('0x88')],'resource':_0xd12348,'username':_0x5e84eb[_0xab7a('0x8f')],'password':_0x5e84eb['password'],'grant_type':_0xab7a('0x85'),'client_secret':_0x5e84eb[_0xab7a('0x90')]},'json':!![]};return rp(_0x41fdfd);}})[_0xab7a('0xc')](function(_0x250656){_0x6c8bb2=_0x250656[_0xab7a('0x91')];var _0xf7552a={'method':_0xab7a('0x92'),'uri':encodeURI(_0x3c0fc5+_0xab7a('0x93')+_0x37d894+'\x27'),'headers':{'Authorization':_0xab7a('0x94')+_0x6c8bb2,'If-None-Match':null,'OData-Version':_0xab7a('0x95')},'json':!![]};return rp(_0xf7552a);})[_0xab7a('0xc')](function(_0x9baac3){var _0x3c67f5=_0x9baac3['value'][0x0];var _0x49a7ea=_0x3c67f5[_0xab7a('0x96')];var _0x58b3ab={'method':_0xab7a('0x92'),'uri':_0x3c0fc5+'EntityDefinitions('+_0x49a7ea+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xab7a('0x94')+_0x6c8bb2,'If-None-Match':null,'OData-Version':_0xab7a('0x95')},'json':!![]};return rp(_0x58b3ab);})[_0xab7a('0xc')](function(_0x2e8c2f){_0x39725f=_0x2e8c2f;_0x510f97=_0x39725f[_0xab7a('0x97')];_0x510f97=_['remove'](_0x510f97,function(_0x56a6d2){return!_0x327cc4[_0xab7a('0x98')](_0x56a6d2[_0xab7a('0x99')]);});var _0x144fb6=[];var _0xda1bf2=[];_0x510f97['forEach'](function(_0x1ff075){if(_0x1ff075[_0xab7a('0x9a')]){var _0xf1645e=_0x1ff075['@odata.type'][_0xab7a('0x3d')](_0x1ff075[_0xab7a('0x9a')][_0xab7a('0x3e')]('.')+0x1);if(_0xf1645e==='PicklistAttributeMetadata'){_0x144fb6[_0xab7a('0x9b')](getSelectList(_0x3c0fc5,_0xfb2c68,_0xda1bf2,_0x39725f[_0xab7a('0x96')],_0x1ff075['MetadataId'],_0x6c8bb2));}}});return Promise[_0xab7a('0x9c')](_0x144fb6);})[_0xab7a('0xc')](function(_0x57e590){_0x1ce6ce=_0x57e590[0x0];var _0x5aab62=[];var _0x5b9ada=[];_0x510f97['forEach'](function(_0x3f4f0d){if(!_[_0xab7a('0x9d')](_0x3f4f0d[_0xab7a('0x9a')])){var _0x16828f=_0x3f4f0d['@odata.type'][_0xab7a('0x3d')](_0x3f4f0d['@odata.type'][_0xab7a('0x3e')]('.')+0x1);if(_0x16828f===_0xab7a('0x9e')){_0x5aab62[_0xab7a('0x9b')](getBooleanList(_0x3c0fc5,_0xfb2c68,_0x5b9ada,_0x39725f[_0xab7a('0x96')],_0x3f4f0d['MetadataId'],_0x6c8bb2));}}});return Promise[_0xab7a('0x9c')](_0x5aab62);})[_0xab7a('0xc')](function(_0x572cdd){_0x25262d=_0x572cdd[0x0];var _0x14115d=[];var _0x16b146=[];_0x510f97[_0xab7a('0x9f')](function(_0x12ab41){if(_0x12ab41[_0xab7a('0x9a')]){var _0x419631=_0x12ab41[_0xab7a('0x9a')][_0xab7a('0x3d')](_0x12ab41[_0xab7a('0x9a')][_0xab7a('0x3e')]('.')+0x1);if(_0x419631===_0xab7a('0xa0')||_0x419631==='DoubleAttributeMetadata'||_0x419631===_0xab7a('0xa1')||_0x419631==='IntegerAttributeMetadata'||_0x419631===_0xab7a('0xa2')||_0x419631===_0xab7a('0xa3')||_0x419631==='StatusAttributeMetadata'||_0x419631===_0xab7a('0xa4')||_0x419631===_0xab7a('0xa5')||_0x419631==='DecimalAttributeMetadata'){_0x14115d['push'](getInputList(_0x3c0fc5,_0xfb2c68,_0x419631,_0x16b146,_0x39725f[_0xab7a('0x96')],_0x12ab41[_0xab7a('0x96')],_0x6c8bb2));}}});return Promise[_0xab7a('0x9c')](_0x14115d);})[_0xab7a('0xc')](function(_0x428eb4){_0x4f2f0c=_0x428eb4[0x0];var _0x38af3a=_0x1ce6ce[_0xab7a('0x84')](_0x25262d)[_0xab7a('0x84')](_0x4f2f0c);var _0x8c1ca0={'count':_0x38af3a['length'],'rows':_0x38af3a};return _0x8c1ca0;})[_0xab7a('0xc')](respondWithResult(_0x4b8d1d,null))[_0xab7a('0x2e')](function(_0x26e9f1){var _0x1035f6=_0x485709[_0xab7a('0x16')][_0xab7a('0xa6')]?0x1f4:_0x26e9f1['statusCode']||0x1f4;logger['error'](_0x26e9f1[_0xab7a('0xa7')]);delete _0x26e9f1[_0xab7a('0x10')];if(_0x1035f6===0x191){_0x1035f6=0x190;}_0x4b8d1d['status'](_0x1035f6)[_0xab7a('0x11')](_0x485709[_0xab7a('0x16')][_0xab7a('0xa6')]?{'message':'Wrong\x20credentials','statusCode':_0x26e9f1[_0xab7a('0xa8')]}:_0x26e9f1);});};function getSelectList(_0x174011,_0x362612,_0x46a708,_0x591693,_0x41d4a5,_0x1a643e){var _0x40e85c={'method':_0xab7a('0x92'),'uri':_0x174011+_0xab7a('0xa9')+_0x591693+_0xab7a('0xaa')+_0x41d4a5+_0xab7a('0xab')+_0xab7a('0xac'),'headers':{'Authorization':'Bearer\x20'+_0x1a643e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x40e85c)['then'](function(_0x4792be){var _0x12f6b0=[];var _0x174b16=_0x4792be[_0xab7a('0xad')][_0xab7a('0xae')];_0x174b16[_0xab7a('0x9f')](function(_0x20b46e){_0x12f6b0[_0xab7a('0x9b')]({'name':_0x20b46e[_0xab7a('0xaf')][_0xab7a('0xb0')][_0xab7a('0xaf')],'value':String(_0x20b46e[_0xab7a('0xb1')])});});var _0x54906d={'id':_0x362612+'_'+_0x4792be['LogicalName'],'name':_0x4792be['DisplayName'][_0xab7a('0xb0')][_0xab7a('0xaf')],'custom':![],'options':_0x12f6b0};_0x46a708['push'](_0x54906d);return _0x46a708;});}function getBooleanList(_0x5ca78c,_0x6dd808,_0x57f06b,_0x1ba914,_0x4285be,_0x3643d2){var _0x2d244a={'method':'GET','uri':_0x5ca78c+'EntityDefinitions('+_0x1ba914+')/Attributes('+_0x4285be+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xab7a('0x94')+_0x3643d2,'If-None-Match':null,'OData-Version':_0xab7a('0x95')},'json':!![]};return rp(_0x2d244a)[_0xab7a('0xc')](function(_0x3c659f){var _0x2f623a=[];_0x2f623a[_0xab7a('0x9b')]({'name':_0x3c659f['OptionSet'][_0xab7a('0xb2')]['Label'][_0xab7a('0xb0')][_0xab7a('0xaf')],'value':_0xab7a('0xb3')},{'name':_0x3c659f[_0xab7a('0xad')][_0xab7a('0xb4')][_0xab7a('0xaf')][_0xab7a('0xb0')][_0xab7a('0xaf')],'value':_0xab7a('0xb5')});var _0x5e5882={'id':_0x6dd808+'_'+_0x3c659f[_0xab7a('0x99')],'name':_0x3c659f['DisplayName'][_0xab7a('0xb0')]['Label'],'custom':![],'options':_0x2f623a};_0x57f06b[_0xab7a('0x9b')](_0x5e5882);return _0x57f06b;});}function getInputList(_0x3f12a0,_0x48d3e4,_0x476f6e,_0x3a9cd0,_0x2ac3d3,_0x4eaa30,_0x3aa651){var _0x369be6={'method':_0xab7a('0x92'),'uri':_0x3f12a0+_0xab7a('0xa9')+_0x2ac3d3+_0xab7a('0xaa')+_0x4eaa30+_0xab7a('0xb6')+_0x476f6e+_0xab7a('0xb7'),'headers':{'Authorization':_0xab7a('0x94')+_0x3aa651,'If-None-Match':null,'OData-Version':_0xab7a('0x95')},'json':!![]};return rp(_0x369be6)['then'](function(_0x2a2964){var _0x51978b={'id':_0x48d3e4+'_'+_0x2a2964['LogicalName'],'name':_0x2a2964['DisplayName'][_0xab7a('0xb0')]?_0x2a2964[_0xab7a('0xb8')][_0xab7a('0xb0')]['Label']:_0x2a2964[_0xab7a('0x99')],'custom':![],'options':[]};_0x3a9cd0[_0xab7a('0x9b')](_0x51978b);return _0x3a9cd0;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 18f3eef..7797032 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 _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x53039c,_0x48a7cb){var _0x3ede96=function(_0x333fd1){while(--_0x333fd1){_0x53039c['push'](_0x53039c['shift']());}};_0x3ede96(++_0x48a7cb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb7e7[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x392832,_0x24b780){var _0x24bc39=function(_0x3c2f82){while(--_0x3c2f82){_0x392832['push'](_0x392832['shift']());}};_0x24bc39(++_0x24b780);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb7e7[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index bd64425..6804e27 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 _0xce36=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','include','map','model','catch','raw','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent'];(function(_0x23eabd,_0x2b2cad){var _0x5ef53e=function(_0x7c323e){while(--_0x7c323e){_0x23eabd['push'](_0x23eabd['shift']());}};_0x5ef53e(++_0x2b2cad);}(_0xce36,0x9f));var _0x6ce3=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xce36[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x6ce3('0x0'));var util=require(_0x6ce3('0x1'));var moment=require(_0x6ce3('0x2'));var BPromise=require(_0x6ce3('0x3'));var rs=require(_0x6ce3('0x4'));var fs=require('fs');var Redis=require(_0x6ce3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ce3('0x6'))('rpc');var config=require(_0x6ce3('0x7'));var jayson=require(_0x6ce3('0x8'));var client=jayson[_0x6ce3('0x9')][_0x6ce3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21faaf,_0x537a63,_0x42384e){return new BPromise(function(_0x121762,_0x54e325){return client[_0x6ce3('0xb')](_0x21faaf,_0x42384e)[_0x6ce3('0xc')](function(_0x1e913c){logger[_0x6ce3('0xd')](_0x6ce3('0xe'),_0x537a63,_0x6ce3('0xf'));logger[_0x6ce3('0x10')](_0x6ce3('0x11'),_0x537a63,_0x6ce3('0xf'),JSON[_0x6ce3('0x12')](_0x1e913c));if(_0x1e913c[_0x6ce3('0x13')]){if(_0x1e913c[_0x6ce3('0x13')][_0x6ce3('0x14')]===0x1f4){logger['error'](_0x6ce3('0xe'),_0x537a63,_0x1e913c[_0x6ce3('0x13')][_0x6ce3('0x15')]);return _0x54e325(_0x1e913c[_0x6ce3('0x13')]['message']);}logger[_0x6ce3('0x13')](_0x6ce3('0xe'),_0x537a63,_0x1e913c[_0x6ce3('0x13')][_0x6ce3('0x15')]);return _0x121762(_0x1e913c[_0x6ce3('0x13')][_0x6ce3('0x15')]);}else{logger[_0x6ce3('0xd')](_0x6ce3('0xe'),_0x537a63,'request\x20sent');_0x121762(_0x1e913c['result'][_0x6ce3('0x15')]);}})['catch'](function(_0x2c24a){logger['error'](_0x6ce3('0xe'),_0x537a63,_0x2c24a);_0x54e325(_0x2c24a);});});}exports[_0x6ce3('0x16')]=function(_0x159352){var _0x561d51=this;return new Promise(function(_0x230a1f,_0x1006e7){return db[_0x6ce3('0x17')][_0x6ce3('0x18')]({'raw':_0x159352[_0x6ce3('0x19')]?_0x159352[_0x6ce3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x159352[_0x6ce3('0x19')]?_0x159352[_0x6ce3('0x19')][_0x6ce3('0x1a')]||null:null,'attributes':_0x159352[_0x6ce3('0x19')]?_0x159352[_0x6ce3('0x19')][_0x6ce3('0x1b')]||null:null,'limit':_0x159352['options']?_0x159352['options'][_0x6ce3('0x1c')]||null:null,'include':_0x159352[_0x6ce3('0x19')]?_0x159352[_0x6ce3('0x19')][_0x6ce3('0x1d')]?_[_0x6ce3('0x1e')](_0x159352[_0x6ce3('0x19')][_0x6ce3('0x1d')],function(_0x7f34b7){return{'model':db[_0x7f34b7[_0x6ce3('0x1f')]],'as':_0x7f34b7['as'],'attributes':_0x7f34b7[_0x6ce3('0x1b')],'include':_0x7f34b7[_0x6ce3('0x1d')]?_[_0x6ce3('0x1e')](_0x7f34b7[_0x6ce3('0x1d')],function(_0x508de2){return{'model':db[_0x508de2['model']],'as':_0x508de2['as'],'attributes':_0x508de2['attributes'],'include':_0x508de2[_0x6ce3('0x1d')]?_[_0x6ce3('0x1e')](_0x508de2[_0x6ce3('0x1d')],function(_0xdd4eed){return{'model':db[_0xdd4eed[_0x6ce3('0x1f')]],'as':_0xdd4eed['as'],'attributes':_0xdd4eed[_0x6ce3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6ce3('0xc')](function(_0x4f08e4){logger[_0x6ce3('0xd')]('GetDynamics365Account',_0x159352);logger[_0x6ce3('0x10')](_0x6ce3('0x16'),_0x159352,JSON[_0x6ce3('0x12')](_0x4f08e4));_0x230a1f(_0x4f08e4);})[_0x6ce3('0x20')](function(_0x215bca){logger[_0x6ce3('0x13')](_0x6ce3('0x16'),_0x215bca[_0x6ce3('0x15')],_0x159352);_0x1006e7(_0x561d51['error'](0x1f4,_0x215bca[_0x6ce3('0x15')]));});});};exports['ShowDynamics365Account']=function(_0x149c1a){var _0x1ef38e=this;return new Promise(function(_0x47a052,_0x3aa070){return db[_0x6ce3('0x17')]['find']({'raw':_0x149c1a['options']?_0x149c1a['options'][_0x6ce3('0x21')]===undefined?!![]:![]:!![],'where':_0x149c1a['options']?_0x149c1a[_0x6ce3('0x19')]['where']||null:null,'attributes':_0x149c1a[_0x6ce3('0x19')]?_0x149c1a[_0x6ce3('0x19')][_0x6ce3('0x1b')]||null:null,'include':_0x149c1a[_0x6ce3('0x19')]?_0x149c1a['options']['include']?_[_0x6ce3('0x1e')](_0x149c1a[_0x6ce3('0x19')]['include'],function(_0x24ea64){return{'model':db[_0x24ea64[_0x6ce3('0x1f')]],'as':_0x24ea64['as'],'attributes':_0x24ea64[_0x6ce3('0x1b')],'include':_0x24ea64[_0x6ce3('0x1d')]?_[_0x6ce3('0x1e')](_0x24ea64[_0x6ce3('0x1d')],function(_0x196e3b){return{'model':db[_0x196e3b[_0x6ce3('0x1f')]],'as':_0x196e3b['as'],'attributes':_0x196e3b[_0x6ce3('0x1b')],'include':_0x196e3b[_0x6ce3('0x1d')]?_['map'](_0x196e3b['include'],function(_0x2b43ed){return{'model':db[_0x2b43ed[_0x6ce3('0x1f')]],'as':_0x2b43ed['as'],'attributes':_0x2b43ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ce3('0xc')](function(_0x1b3282){logger[_0x6ce3('0xd')]('ShowDynamics365Account',_0x149c1a);logger['debug'](_0x6ce3('0x22'),_0x149c1a,JSON[_0x6ce3('0x12')](_0x1b3282));_0x47a052(_0x1b3282);})[_0x6ce3('0x20')](function(_0x2d14dc){logger[_0x6ce3('0x13')](_0x6ce3('0x22'),_0x2d14dc[_0x6ce3('0x15')],_0x149c1a);_0x3aa070(_0x1ef38e[_0x6ce3('0x13')](0x1f4,_0x2d14dc['message']));});});}; \ No newline at end of file +var _0x40e0=['findAll','options','attributes','include','model','map','debug','GetDynamics365Account','ShowDynamics365Account','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Account,\x20%s,\x20%s','info','catch','Dynamics365Account'];(function(_0x4e202d,_0x221567){var _0x24c04f=function(_0x19727f){while(--_0x19727f){_0x4e202d['push'](_0x4e202d['shift']());}};_0x24c04f(++_0x221567);}(_0x40e0,0x155));var _0x040e=function(_0x18e35d,_0x38c8e7){_0x18e35d=_0x18e35d-0x0;var _0x3cd646=_0x40e0[_0x18e35d];return _0x3cd646;};'use strict';var _=require(_0x040e('0x0'));var util=require(_0x040e('0x1'));var moment=require('moment');var BPromise=require(_0x040e('0x2'));var rs=require(_0x040e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x040e('0x4'))['db'];var utils=require(_0x040e('0x5'));var logger=require('../../config/logger')(_0x040e('0x6'));var config=require(_0x040e('0x7'));var jayson=require(_0x040e('0x8'));var client=jayson[_0x040e('0x9')][_0x040e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b93dc,_0x2dbfaa,_0x3658ea){return new BPromise(function(_0x16ebe9,_0x1dd963){return client[_0x040e('0xb')](_0x3b93dc,_0x3658ea)[_0x040e('0xc')](function(_0x34b2c9){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x2dbfaa,_0x040e('0xd'));logger['debug'](_0x040e('0xe'),_0x2dbfaa,_0x040e('0xd'),JSON[_0x040e('0xf')](_0x34b2c9));if(_0x34b2c9[_0x040e('0x10')]){if(_0x34b2c9['error']['code']===0x1f4){logger[_0x040e('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x2dbfaa,_0x34b2c9[_0x040e('0x10')][_0x040e('0x11')]);return _0x1dd963(_0x34b2c9[_0x040e('0x10')][_0x040e('0x11')]);}logger[_0x040e('0x10')](_0x040e('0x12'),_0x2dbfaa,_0x34b2c9[_0x040e('0x10')][_0x040e('0x11')]);return _0x16ebe9(_0x34b2c9[_0x040e('0x10')]['message']);}else{logger[_0x040e('0x13')](_0x040e('0x12'),_0x2dbfaa,_0x040e('0xd'));_0x16ebe9(_0x34b2c9['result'][_0x040e('0x11')]);}})[_0x040e('0x14')](function(_0x1b5d9b){logger[_0x040e('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x2dbfaa,_0x1b5d9b);_0x1dd963(_0x1b5d9b);});});}exports['GetDynamics365Account']=function(_0x30c50c){var _0x45c297=this;return new Promise(function(_0x56879a,_0x2c61d0){return db[_0x040e('0x15')][_0x040e('0x16')]({'raw':_0x30c50c[_0x040e('0x17')]?_0x30c50c['options']['raw']===undefined?!![]:![]:!![],'where':_0x30c50c[_0x040e('0x17')]?_0x30c50c[_0x040e('0x17')]['where']||null:null,'attributes':_0x30c50c[_0x040e('0x17')]?_0x30c50c[_0x040e('0x17')][_0x040e('0x18')]||null:null,'limit':_0x30c50c[_0x040e('0x17')]?_0x30c50c[_0x040e('0x17')]['limit']||null:null,'include':_0x30c50c['options']?_0x30c50c['options'][_0x040e('0x19')]?_['map'](_0x30c50c[_0x040e('0x17')][_0x040e('0x19')],function(_0x432ba4){return{'model':db[_0x432ba4[_0x040e('0x1a')]],'as':_0x432ba4['as'],'attributes':_0x432ba4[_0x040e('0x18')],'include':_0x432ba4[_0x040e('0x19')]?_[_0x040e('0x1b')](_0x432ba4[_0x040e('0x19')],function(_0xc42567){return{'model':db[_0xc42567[_0x040e('0x1a')]],'as':_0xc42567['as'],'attributes':_0xc42567[_0x040e('0x18')],'include':_0xc42567[_0x040e('0x19')]?_['map'](_0xc42567[_0x040e('0x19')],function(_0x1f7100){return{'model':db[_0x1f7100[_0x040e('0x1a')]],'as':_0x1f7100['as'],'attributes':_0x1f7100['attributes']};}):[]};}):[]};}):[]:[]})[_0x040e('0xc')](function(_0x51f04e){logger[_0x040e('0x13')]('GetDynamics365Account',_0x30c50c);logger[_0x040e('0x1c')](_0x040e('0x1d'),_0x30c50c,JSON['stringify'](_0x51f04e));_0x56879a(_0x51f04e);})['catch'](function(_0x46a2aa){logger['error'](_0x040e('0x1d'),_0x46a2aa[_0x040e('0x11')],_0x30c50c);_0x2c61d0(_0x45c297[_0x040e('0x10')](0x1f4,_0x46a2aa['message']));});});};exports[_0x040e('0x1e')]=function(_0x12405c){var _0x24653b=this;return new Promise(function(_0x2be4ea,_0x4d7b61){return db['Dynamics365Account'][_0x040e('0x1f')]({'raw':_0x12405c[_0x040e('0x17')]?_0x12405c['options']['raw']===undefined?!![]:![]:!![],'where':_0x12405c['options']?_0x12405c[_0x040e('0x17')][_0x040e('0x20')]||null:null,'attributes':_0x12405c['options']?_0x12405c[_0x040e('0x17')][_0x040e('0x18')]||null:null,'include':_0x12405c['options']?_0x12405c[_0x040e('0x17')][_0x040e('0x19')]?_[_0x040e('0x1b')](_0x12405c[_0x040e('0x17')]['include'],function(_0x45dc5f){return{'model':db[_0x45dc5f['model']],'as':_0x45dc5f['as'],'attributes':_0x45dc5f[_0x040e('0x18')],'include':_0x45dc5f['include']?_[_0x040e('0x1b')](_0x45dc5f[_0x040e('0x19')],function(_0x3927cc){return{'model':db[_0x3927cc[_0x040e('0x1a')]],'as':_0x3927cc['as'],'attributes':_0x3927cc[_0x040e('0x18')],'include':_0x3927cc[_0x040e('0x19')]?_[_0x040e('0x1b')](_0x3927cc[_0x040e('0x19')],function(_0x125acd){return{'model':db[_0x125acd[_0x040e('0x1a')]],'as':_0x125acd['as'],'attributes':_0x125acd[_0x040e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ab43a){logger[_0x040e('0x13')](_0x040e('0x1e'),_0x12405c);logger['debug']('ShowDynamics365Account',_0x12405c,JSON[_0x040e('0xf')](_0x5ab43a));_0x2be4ea(_0x5ab43a);})[_0x040e('0x14')](function(_0x1b1cf5){logger[_0x040e('0x10')](_0x040e('0x1e'),_0x1b1cf5[_0x040e('0x11')],_0x12405c);_0x4d7b61(_0x24653b['error'](0x1f4,_0x1b1cf5[_0x040e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index e8bd67e..11bc1b6 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 _0xccc2=['delete','destroy','multer','connect-timeout','fs-extra','../../components/interaction/service','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x31ac6d,_0x34788b){var _0x592869=function(_0x1ff224){while(--_0x1ff224){_0x31ac6d['push'](_0x31ac6d['shift']());}};_0x592869(++_0x34788b);}(_0xccc2,0xa2));var _0x2ccc=function(_0x3cbb14,_0x3c95a7){_0x3cbb14=_0x3cbb14-0x0;var _0x2bfb35=_0xccc2[_0x3cbb14];return _0x2bfb35;};'use strict';var multer=require(_0x2ccc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2ccc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ccc('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2ccc('0x3'));var config=require('../../config/environment');var controller=require(_0x2ccc('0x4'));router[_0x2ccc('0x5')]('/',auth['isAuthenticated'](),controller[_0x2ccc('0x6')]);router[_0x2ccc('0x5')](_0x2ccc('0x7'),auth[_0x2ccc('0x8')](),controller[_0x2ccc('0x9')]);router[_0x2ccc('0x5')](_0x2ccc('0xa'),auth[_0x2ccc('0x8')](),controller['getFields']);router['get'](_0x2ccc('0xb'),auth['isAuthenticated'](),controller[_0x2ccc('0xc')]);router[_0x2ccc('0x5')](_0x2ccc('0xd'),auth[_0x2ccc('0x8')](),controller[_0x2ccc('0xe')]);router[_0x2ccc('0xf')]('/',auth[_0x2ccc('0x8')](),controller[_0x2ccc('0x10')]);router[_0x2ccc('0x11')](_0x2ccc('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x2ccc('0x12')](_0x2ccc('0x7'),auth[_0x2ccc('0x8')](),controller[_0x2ccc('0x13')]);module['exports']=router; \ No newline at end of file +var _0x70e9=['post','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','/:id','/:id/fields','getFields','get','/:id/subjects','getSubjects','getDescriptions'];(function(_0x51a086,_0x3b6858){var _0x5ca5fc=function(_0x52bc41){while(--_0x52bc41){_0x51a086['push'](_0x51a086['shift']());}};_0x5ca5fc(++_0x3b6858);}(_0x70e9,0x1d2));var _0x970e=function(_0x32076b,_0x2c69ad){_0x32076b=_0x32076b-0x0;var _0x68ad26=_0x70e9[_0x32076b];return _0x68ad26;};'use strict';var multer=require(_0x970e('0x0'));var util=require(_0x970e('0x1'));var path=require(_0x970e('0x2'));var timeout=require(_0x970e('0x3'));var express=require(_0x970e('0x4'));var router=express[_0x970e('0x5')]();var fs_extra=require(_0x970e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x970e('0x7'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x970e('0x8')](),controller[_0x970e('0x9')]);router['get'](_0x970e('0xa'),auth[_0x970e('0x8')](),controller['show']);router['get'](_0x970e('0xb'),auth[_0x970e('0x8')](),controller[_0x970e('0xc')]);router[_0x970e('0xd')](_0x970e('0xe'),auth[_0x970e('0x8')](),controller[_0x970e('0xf')]);router[_0x970e('0xd')]('/:id/descriptions',auth[_0x970e('0x8')](),controller[_0x970e('0x10')]);router[_0x970e('0x11')]('/',auth[_0x970e('0x8')](),controller['create']);router[_0x970e('0x12')](_0x970e('0xa'),auth[_0x970e('0x8')](),controller['update']);router[_0x970e('0x13')](_0x970e('0xa'),auth[_0x970e('0x8')](),controller[_0x970e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 712b249..0c03899 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 _0x37b5=['STRING','ENUM','incident','contact','BOOLEAN','sequelize','exports'];(function(_0x18e672,_0x3ff686){var _0x30dbdb=function(_0x4e9854){while(--_0x4e9854){_0x18e672['push'](_0x18e672['shift']());}};_0x30dbdb(++_0x3ff686);}(_0x37b5,0x1da));var _0x537b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x37b5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x537b('0x0'));module[_0x537b('0x1')]={'name':{'type':Sequelize[_0x537b('0x2')]},'description':{'type':Sequelize[_0x537b('0x2')]},'ticketType':{'type':Sequelize[_0x537b('0x3')](_0x537b('0x4'),'phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x537b('0x3')](_0x537b('0x5'),'nothing'),'defaultValue':_0x537b('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x537b('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbe42=['sequelize','exports','STRING','ENUM','incident','phonecall','contact','nothing','BOOLEAN'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xbe42,0x87));var _0x2be4=function(_0x1a0c59,_0x3b4dcc){_0x1a0c59=_0x1a0c59-0x0;var _0xed67c9=_0xbe42[_0x1a0c59];return _0xed67c9;};'use strict';var Sequelize=require(_0x2be4('0x0'));module[_0x2be4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2be4('0x2')]},'ticketType':{'type':Sequelize[_0x2be4('0x3')](_0x2be4('0x4'),_0x2be4('0x5')),'defaultValue':_0x2be4('0x4')},'moduleCreate':{'type':Sequelize[_0x2be4('0x3')](_0x2be4('0x6'),_0x2be4('0x7')),'defaultValue':_0x2be4('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x2be4('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x2be4('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 40f2d12..49ff4d3 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 _0x7cfb=['sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x435d49,_0xe63b56){var _0x40a43d=function(_0x427d95){while(--_0x427d95){_0x435d49['push'](_0x435d49['shift']());}};_0x40a43d(++_0xe63b56);}(_0x7cfb,0x1be));var _0xb7cf=function(_0x34ddd3,_0x4c9e35){_0x34ddd3=_0x34ddd3-0x0;var _0x1c2792=_0x7cfb[_0x34ddd3];return _0x1c2792;};'use strict';var emlformat=require(_0xb7cf('0x0'));var rimraf=require(_0xb7cf('0x1'));var zipdir=require(_0xb7cf('0x2'));var jsonpatch=require(_0xb7cf('0x3'));var rp=require(_0xb7cf('0x4'));var moment=require(_0xb7cf('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb7cf('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb7cf('0x7'));var ejs=require(_0xb7cf('0x8'));var fs=require('fs');var fs_extra=require(_0xb7cf('0x9'));var _=require(_0xb7cf('0xa'));var squel=require(_0xb7cf('0xb'));var crypto=require(_0xb7cf('0xc'));var jsforce=require(_0xb7cf('0xd'));var deskjs=require(_0xb7cf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb7cf('0xf'));var Redis=require(_0xb7cf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb7cf('0x11'));var as=require(_0xb7cf('0x12'));var hardwareService=require(_0xb7cf('0x13'));var logger=require('../../config/logger')(_0xb7cf('0x14'));var utils=require('../../config/utils');var config=require(_0xb7cf('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x296f6d,_0x21c032){_0x21c032=_0x21c032||0xcc;return function(_0x3fe7ae){if(_0x3fe7ae){return _0x296f6d[_0xb7cf('0x16')](_0x21c032);}return _0x296f6d[_0xb7cf('0x17')](_0x21c032)[_0xb7cf('0x18')]();};}function respondWithResult(_0x26d7b2,_0x2a4a56){_0x2a4a56=_0x2a4a56||0xc8;return function(_0x30e449){if(_0x30e449){return _0x26d7b2['status'](_0x2a4a56)['json'](_0x30e449);}};}function respondWithFilteredResult(_0x1800d6,_0x5a0e7c){return function(_0x55ac84){if(_0x55ac84){var _0x29c5ad=typeof _0x5a0e7c['offset']===_0xb7cf('0x19')&&typeof _0x5a0e7c['limit']===_0xb7cf('0x19');var _0x122f86=_0x55ac84[_0xb7cf('0x1a')];var _0x3be0c1=_0x29c5ad?0x0:_0x5a0e7c[_0xb7cf('0x1b')];var _0x281cb6=_0x29c5ad?_0x55ac84['count']:_0x5a0e7c[_0xb7cf('0x1b')]+_0x5a0e7c[_0xb7cf('0x1c')];var _0x374ac4;if(_0x281cb6>=_0x122f86){_0x281cb6=_0x122f86;_0x374ac4=0xc8;}else{_0x374ac4=0xce;}_0x1800d6[_0xb7cf('0x17')](_0x374ac4);return _0x1800d6[_0xb7cf('0x1d')]('Content-Range',_0x3be0c1+'-'+_0x281cb6+'/'+_0x122f86)[_0xb7cf('0x1e')](_0x55ac84);}return null;};}function patchUpdates(_0x524e99){return function(_0xd8a122){try{jsonpatch[_0xb7cf('0x1f')](_0xd8a122,_0x524e99,!![]);}catch(_0xeaee){return BPromise[_0xb7cf('0x20')](_0xeaee);}return _0xd8a122[_0xb7cf('0x21')]();};}function saveUpdates(_0x197285,_0x4a3fd5){return function(_0x473577){if(_0x473577){return _0x473577[_0xb7cf('0x22')](_0x197285)[_0xb7cf('0x23')](function(_0x421ee0){return _0x421ee0;});}return null;};}function removeEntity(_0x1397c0,_0x535808){return function(_0x177518){if(_0x177518){return _0x177518[_0xb7cf('0x24')]()[_0xb7cf('0x23')](function(){_0x1397c0['status'](0xcc)[_0xb7cf('0x18')]();});}};}function handleEntityNotFound(_0x2c9925,_0x37d606){return function(_0x201ee4){if(!_0x201ee4){_0x2c9925[_0xb7cf('0x16')](0x194);}return _0x201ee4;};}function handleError(_0x1b7f88,_0x211498){_0x211498=_0x211498||0x1f4;return function(_0x4233d6){logger[_0xb7cf('0x25')](_0x4233d6['stack']);if(_0x4233d6['name']){delete _0x4233d6['name'];}_0x1b7f88['status'](_0x211498)['send'](_0x4233d6);};}exports[_0xb7cf('0x26')]=function(_0x57460b,_0x147b8c){var _0x18a40a={},_0x19b090={},_0x283271={'count':0x0,'rows':[]};var _0x382096=_['map'](db[_0xb7cf('0x27')][_0xb7cf('0x28')],function(_0x57c902){return{'name':_0x57c902[_0xb7cf('0x29')],'type':_0x57c902[_0xb7cf('0x2a')][_0xb7cf('0x2b')]};});_0x19b090[_0xb7cf('0x2c')]=_[_0xb7cf('0x2d')](_0x382096,_0xb7cf('0x2e'));_0x19b090[_0xb7cf('0x2f')]=_[_0xb7cf('0x30')](_0x57460b['query']);_0x19b090['filters']=_[_0xb7cf('0x31')](_0x19b090['model'],_0x19b090[_0xb7cf('0x2f')]);_0x18a40a[_0xb7cf('0x32')]=_[_0xb7cf('0x31')](_0x19b090[_0xb7cf('0x2c')],qs[_0xb7cf('0x33')](_0x57460b[_0xb7cf('0x2f')][_0xb7cf('0x33')]));_0x18a40a[_0xb7cf('0x32')]=_0x18a40a[_0xb7cf('0x32')]['length']?_0x18a40a[_0xb7cf('0x32')]:_0x19b090[_0xb7cf('0x2c')];if(!_0x57460b['query'][_0xb7cf('0x34')](_0xb7cf('0x35'))){_0x18a40a['limit']=qs[_0xb7cf('0x1c')](_0x57460b['query'][_0xb7cf('0x1c')]);_0x18a40a[_0xb7cf('0x1b')]=qs['offset'](_0x57460b[_0xb7cf('0x2f')][_0xb7cf('0x1b')]);}_0x18a40a[_0xb7cf('0x36')]=qs[_0xb7cf('0x37')](_0x57460b[_0xb7cf('0x2f')][_0xb7cf('0x37')]);_0x18a40a['where']=qs[_0xb7cf('0x38')](_['pick'](_0x57460b[_0xb7cf('0x2f')],_0x19b090['filters']),_0x382096);if(_0x57460b[_0xb7cf('0x2f')][_0xb7cf('0x39')]){_0x18a40a[_0xb7cf('0x3a')]=_[_0xb7cf('0x3b')](_0x18a40a[_0xb7cf('0x3a')],{'$or':_[_0xb7cf('0x2d')](_0x382096,function(_0xec1a05){if(_0xec1a05['type']!=='VIRTUAL'){var _0x423bba={};_0x423bba[_0xec1a05[_0xb7cf('0x2e')]]={'$like':'%'+_0x57460b[_0xb7cf('0x2f')][_0xb7cf('0x39')]+'%'};return _0x423bba;}})});}_0x18a40a=_[_0xb7cf('0x3b')]({},_0x18a40a,_0x57460b[_0xb7cf('0x3c')]);var _0x470db8={'where':_0x18a40a[_0xb7cf('0x3a')]};return db[_0xb7cf('0x27')][_0xb7cf('0x1a')](_0x470db8)[_0xb7cf('0x23')](function(_0x342e12){_0x283271['count']=_0x342e12;if(_0x57460b[_0xb7cf('0x2f')][_0xb7cf('0x3d')]){_0x18a40a[_0xb7cf('0x3e')]=[{'all':!![]}];}return db[_0xb7cf('0x27')][_0xb7cf('0x3f')](_0x18a40a);})[_0xb7cf('0x23')](function(_0x4e125c){_0x283271[_0xb7cf('0x40')]=_0x4e125c;return _0x283271;})[_0xb7cf('0x23')](respondWithFilteredResult(_0x147b8c,_0x18a40a))[_0xb7cf('0x41')](handleError(_0x147b8c,null));};exports[_0xb7cf('0x42')]=function(_0x2f3f74,_0x4bc36b){var _0x3cdc2b={'raw':![],'where':{'id':_0x2f3f74['params']['id']}},_0x33e0c0={};_0x33e0c0[_0xb7cf('0x2c')]=_['keys'](db[_0xb7cf('0x27')][_0xb7cf('0x28')]);_0x33e0c0[_0xb7cf('0x2f')]=_[_0xb7cf('0x30')](_0x2f3f74['query']);_0x33e0c0['filters']=_[_0xb7cf('0x31')](_0x33e0c0[_0xb7cf('0x2c')],_0x33e0c0[_0xb7cf('0x2f')]);_0x3cdc2b[_0xb7cf('0x32')]=_[_0xb7cf('0x31')](_0x33e0c0['model'],qs[_0xb7cf('0x33')](_0x2f3f74[_0xb7cf('0x2f')][_0xb7cf('0x33')]));_0x3cdc2b[_0xb7cf('0x32')]=_0x3cdc2b[_0xb7cf('0x32')][_0xb7cf('0x43')]?_0x3cdc2b['attributes']:_0x33e0c0[_0xb7cf('0x2c')];if(_0x2f3f74[_0xb7cf('0x2f')][_0xb7cf('0x3d')]){_0x3cdc2b[_0xb7cf('0x3e')]=[{'all':!![]}];}_0x3cdc2b=_[_0xb7cf('0x3b')]({},_0x3cdc2b,_0x2f3f74[_0xb7cf('0x3c')]);return db[_0xb7cf('0x27')]['find'](_0x3cdc2b)[_0xb7cf('0x23')](handleEntityNotFound(_0x4bc36b,null))[_0xb7cf('0x23')](respondWithResult(_0x4bc36b,null))[_0xb7cf('0x41')](handleError(_0x4bc36b,null));};exports[_0xb7cf('0x44')]=function(_0x579311,_0x38b9d9){return db[_0xb7cf('0x27')]['create'](_0x579311['body'],{})['then'](respondWithResult(_0x38b9d9,0xc9))[_0xb7cf('0x41')](handleError(_0x38b9d9,null));};exports[_0xb7cf('0x22')]=function(_0xe41ebc,_0x3b1535){if(_0xe41ebc[_0xb7cf('0x45')]['id']){delete _0xe41ebc[_0xb7cf('0x45')]['id'];}return db['Dynamics365Configuration'][_0xb7cf('0x46')]({'where':{'id':_0xe41ebc[_0xb7cf('0x47')]['id']}})[_0xb7cf('0x23')](handleEntityNotFound(_0x3b1535,null))[_0xb7cf('0x23')](saveUpdates(_0xe41ebc['body'],null))['then'](respondWithResult(_0x3b1535,null))[_0xb7cf('0x41')](handleError(_0x3b1535,null));};exports['destroy']=function(_0x52e089,_0x4dc19e){return db[_0xb7cf('0x27')]['find']({'where':{'id':_0x52e089[_0xb7cf('0x47')]['id']}})[_0xb7cf('0x23')](handleEntityNotFound(_0x4dc19e,null))[_0xb7cf('0x23')](removeEntity(_0x4dc19e,null))[_0xb7cf('0x41')](handleError(_0x4dc19e,null));};exports[_0xb7cf('0x48')]=function(_0xad49a1,_0x50c562,_0x22c737){var _0x664999={};var _0x1b533c={};var _0x1d9d83;var _0x2dd632;return db[_0xb7cf('0x27')][_0xb7cf('0x49')]({'where':{'id':_0xad49a1[_0xb7cf('0x47')]['id']}})['then'](handleEntityNotFound(_0x50c562,null))[_0xb7cf('0x23')](function(_0x46e34e){if(_0x46e34e){_0x1d9d83=_0x46e34e;_0x1b533c[_0xb7cf('0x2c')]=_['keys'](db[_0xb7cf('0x4a')][_0xb7cf('0x28')]);_0x1b533c[_0xb7cf('0x2f')]=_['keys'](_0xad49a1[_0xb7cf('0x2f')]);_0x1b533c[_0xb7cf('0x38')]=_[_0xb7cf('0x31')](_0x1b533c[_0xb7cf('0x2c')],_0x1b533c[_0xb7cf('0x2f')]);_0x664999[_0xb7cf('0x32')]=_['intersection'](_0x1b533c[_0xb7cf('0x2c')],qs[_0xb7cf('0x33')](_0xad49a1[_0xb7cf('0x2f')][_0xb7cf('0x33')]));_0x664999[_0xb7cf('0x32')]=_0x664999[_0xb7cf('0x32')][_0xb7cf('0x43')]?_0x664999[_0xb7cf('0x32')]:_0x1b533c[_0xb7cf('0x2c')];_0x664999['order']=qs[_0xb7cf('0x37')](_0xad49a1[_0xb7cf('0x2f')]['sort']);_0x664999[_0xb7cf('0x3a')]=qs[_0xb7cf('0x38')](_[_0xb7cf('0x4b')](_0xad49a1[_0xb7cf('0x2f')],_0x1b533c[_0xb7cf('0x38')]));if(_0xad49a1['query'][_0xb7cf('0x39')]){_0x664999[_0xb7cf('0x3a')]=_[_0xb7cf('0x3b')](_0x664999[_0xb7cf('0x3a')],{'$or':_[_0xb7cf('0x2d')](_0x664999[_0xb7cf('0x32')],function(_0x5b96d4){var _0x3b6486={};_0x3b6486[_0x5b96d4]={'$like':'%'+_0xad49a1['query'][_0xb7cf('0x39')]+'%'};return _0x3b6486;})});}_0x664999=_[_0xb7cf('0x3b')]({},_0x664999,_0xad49a1[_0xb7cf('0x3c')]);return _0x1d9d83['getFields'](_0x664999);}})[_0xb7cf('0x23')](function(_0x1a889b){if(_0x1a889b){_0x2dd632=_0x1a889b['length'];if(!_0xad49a1['query']['hasOwnProperty'](_0xb7cf('0x35'))){_0x664999[_0xb7cf('0x1c')]=qs[_0xb7cf('0x1c')](_0xad49a1[_0xb7cf('0x2f')][_0xb7cf('0x1c')]);_0x664999['offset']=qs[_0xb7cf('0x1b')](_0xad49a1[_0xb7cf('0x2f')]['offset']);}return _0x1d9d83[_0xb7cf('0x48')](_0x664999);}})[_0xb7cf('0x23')](function(_0x44788d){if(_0x44788d){return _0x44788d?{'count':_0x2dd632,'rows':_0x44788d}:null;}})[_0xb7cf('0x23')](respondWithResult(_0x50c562,null))[_0xb7cf('0x41')](handleError(_0x50c562,null));};exports[_0xb7cf('0x4c')]=function(_0x49335f,_0x4ac9e6,_0x21fe00){var _0x461b03={};var _0x4ba381={};var _0x38e3c5;var _0x12c1cd;return db['Dynamics365Configuration'][_0xb7cf('0x49')]({'where':{'id':_0x49335f['params']['id']}})[_0xb7cf('0x23')](handleEntityNotFound(_0x4ac9e6,null))['then'](function(_0x3b5294){if(_0x3b5294){_0x38e3c5=_0x3b5294;_0x4ba381[_0xb7cf('0x2c')]=_[_0xb7cf('0x30')](db[_0xb7cf('0x4a')][_0xb7cf('0x28')]);_0x4ba381['query']=_[_0xb7cf('0x30')](_0x49335f[_0xb7cf('0x2f')]);_0x4ba381['filters']=_[_0xb7cf('0x31')](_0x4ba381['model'],_0x4ba381[_0xb7cf('0x2f')]);_0x461b03['attributes']=_[_0xb7cf('0x31')](_0x4ba381['model'],qs[_0xb7cf('0x33')](_0x49335f[_0xb7cf('0x2f')][_0xb7cf('0x33')]));_0x461b03['attributes']=_0x461b03['attributes']['length']?_0x461b03['attributes']:_0x4ba381['model'];_0x461b03[_0xb7cf('0x36')]=qs[_0xb7cf('0x37')](_0x49335f[_0xb7cf('0x2f')][_0xb7cf('0x37')]);_0x461b03[_0xb7cf('0x3a')]=qs[_0xb7cf('0x38')](_[_0xb7cf('0x4b')](_0x49335f[_0xb7cf('0x2f')],_0x4ba381[_0xb7cf('0x38')]));if(_0x49335f[_0xb7cf('0x2f')]['filter']){_0x461b03[_0xb7cf('0x3a')]=_[_0xb7cf('0x3b')](_0x461b03[_0xb7cf('0x3a')],{'$or':_[_0xb7cf('0x2d')](_0x461b03[_0xb7cf('0x32')],function(_0x2afd74){var _0x1f484f={};_0x1f484f[_0x2afd74]={'$like':'%'+_0x49335f[_0xb7cf('0x2f')][_0xb7cf('0x39')]+'%'};return _0x1f484f;})});}_0x461b03=_['merge']({},_0x461b03,_0x49335f['options']);return _0x38e3c5[_0xb7cf('0x4c')](_0x461b03);}})['then'](function(_0x1a4f18){if(_0x1a4f18){_0x12c1cd=_0x1a4f18[_0xb7cf('0x43')];if(!_0x49335f[_0xb7cf('0x2f')][_0xb7cf('0x34')](_0xb7cf('0x35'))){_0x461b03[_0xb7cf('0x1c')]=qs[_0xb7cf('0x1c')](_0x49335f['query'][_0xb7cf('0x1c')]);_0x461b03[_0xb7cf('0x1b')]=qs['offset'](_0x49335f[_0xb7cf('0x2f')][_0xb7cf('0x1b')]);}return _0x38e3c5[_0xb7cf('0x4c')](_0x461b03);}})[_0xb7cf('0x23')](function(_0x1b9d24){if(_0x1b9d24){return _0x1b9d24?{'count':_0x12c1cd,'rows':_0x1b9d24}:null;}})[_0xb7cf('0x23')](respondWithResult(_0x4ac9e6,null))[_0xb7cf('0x41')](handleError(_0x4ac9e6,null));};exports[_0xb7cf('0x4d')]=function(_0x52c8e6,_0x1f7791,_0x51b32b){var _0x2386c0={};var _0x1f51b2={};var _0x3255ab;var _0x98e1c5;return db[_0xb7cf('0x27')][_0xb7cf('0x49')]({'where':{'id':_0x52c8e6[_0xb7cf('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f7791,null))['then'](function(_0x593c64){if(_0x593c64){_0x3255ab=_0x593c64;_0x1f51b2[_0xb7cf('0x2c')]=_[_0xb7cf('0x30')](db[_0xb7cf('0x4a')][_0xb7cf('0x28')]);_0x1f51b2[_0xb7cf('0x2f')]=_['keys'](_0x52c8e6[_0xb7cf('0x2f')]);_0x1f51b2[_0xb7cf('0x38')]=_['intersection'](_0x1f51b2['model'],_0x1f51b2[_0xb7cf('0x2f')]);_0x2386c0[_0xb7cf('0x32')]=_['intersection'](_0x1f51b2['model'],qs[_0xb7cf('0x33')](_0x52c8e6[_0xb7cf('0x2f')]['fields']));_0x2386c0[_0xb7cf('0x32')]=_0x2386c0[_0xb7cf('0x32')]['length']?_0x2386c0[_0xb7cf('0x32')]:_0x1f51b2[_0xb7cf('0x2c')];_0x2386c0['order']=qs[_0xb7cf('0x37')](_0x52c8e6[_0xb7cf('0x2f')]['sort']);_0x2386c0[_0xb7cf('0x3a')]=qs['filters'](_['pick'](_0x52c8e6['query'],_0x1f51b2[_0xb7cf('0x38')]));if(_0x52c8e6['query'][_0xb7cf('0x39')]){_0x2386c0[_0xb7cf('0x3a')]=_[_0xb7cf('0x3b')](_0x2386c0['where'],{'$or':_['map'](_0x2386c0[_0xb7cf('0x32')],function(_0x48b7cf){var _0x49084e={};_0x49084e[_0x48b7cf]={'$like':'%'+_0x52c8e6[_0xb7cf('0x2f')][_0xb7cf('0x39')]+'%'};return _0x49084e;})});}_0x2386c0=_[_0xb7cf('0x3b')]({},_0x2386c0,_0x52c8e6['options']);return _0x3255ab[_0xb7cf('0x4d')](_0x2386c0);}})[_0xb7cf('0x23')](function(_0x144cc5){if(_0x144cc5){_0x98e1c5=_0x144cc5[_0xb7cf('0x43')];if(!_0x52c8e6[_0xb7cf('0x2f')][_0xb7cf('0x34')](_0xb7cf('0x35'))){_0x2386c0[_0xb7cf('0x1c')]=qs[_0xb7cf('0x1c')](_0x52c8e6[_0xb7cf('0x2f')]['limit']);_0x2386c0[_0xb7cf('0x1b')]=qs[_0xb7cf('0x1b')](_0x52c8e6[_0xb7cf('0x2f')]['offset']);}return _0x3255ab['getDescriptions'](_0x2386c0);}})['then'](function(_0x2ed0ed){if(_0x2ed0ed){return _0x2ed0ed?{'count':_0x98e1c5,'rows':_0x2ed0ed}:null;}})['then'](respondWithResult(_0x1f7791,null))[_0xb7cf('0x41')](handleError(_0x1f7791,null));}; \ No newline at end of file +var _0xbf0d=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','getFields','hasOwnProperty','getSubjects','findOne','Dynamics365Field','getDescriptions','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x180a3b,_0x234e53){var _0x55806a=function(_0x4a6766){while(--_0x4a6766){_0x180a3b['push'](_0x180a3b['shift']());}};_0x55806a(++_0x234e53);}(_0xbf0d,0x1df));var _0xdbf0=function(_0x424e44,_0x402be9){_0x424e44=_0x424e44-0x0;var _0x49b69f=_0xbf0d[_0x424e44];return _0x49b69f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdbf0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbf0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdbf0('0x2'));var util=require('util');var path=require(_0xdbf0('0x3'));var sox=require(_0xdbf0('0x4'));var csv=require(_0xdbf0('0x5'));var ejs=require(_0xdbf0('0x6'));var fs=require('fs');var fs_extra=require(_0xdbf0('0x7'));var _=require(_0xdbf0('0x8'));var squel=require(_0xdbf0('0x9'));var crypto=require(_0xdbf0('0xa'));var jsforce=require(_0xdbf0('0xb'));var deskjs=require(_0xdbf0('0xc'));var toCsv=require(_0xdbf0('0x5'));var querystring=require(_0xdbf0('0xd'));var Papa=require(_0xdbf0('0xe'));var Redis=require(_0xdbf0('0xf'));var authService=require(_0xdbf0('0x10'));var qs=require(_0xdbf0('0x11'));var as=require(_0xdbf0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdbf0('0x13'))(_0xdbf0('0x14'));var utils=require(_0xdbf0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdbf0('0x16'));var db=require(_0xdbf0('0x17'))['db'];function respondWithStatusCode(_0x402807,_0x5a03cb){_0x5a03cb=_0x5a03cb||0xcc;return function(_0x512c5b){if(_0x512c5b){return _0x402807['sendStatus'](_0x5a03cb);}return _0x402807[_0xdbf0('0x18')](_0x5a03cb)[_0xdbf0('0x19')]();};}function respondWithResult(_0x315d44,_0x129810){_0x129810=_0x129810||0xc8;return function(_0x2198f2){if(_0x2198f2){return _0x315d44[_0xdbf0('0x18')](_0x129810)[_0xdbf0('0x1a')](_0x2198f2);}};}function respondWithFilteredResult(_0x35dd89,_0x2f8f68){return function(_0x48677c){if(_0x48677c){var _0x4f4040=typeof _0x2f8f68[_0xdbf0('0x1b')]===_0xdbf0('0x1c')&&typeof _0x2f8f68[_0xdbf0('0x1d')]==='undefined';var _0x5e469b=_0x48677c[_0xdbf0('0x1e')];var _0x56e45e=_0x4f4040?0x0:_0x2f8f68[_0xdbf0('0x1b')];var _0x5c9776=_0x4f4040?_0x48677c[_0xdbf0('0x1e')]:_0x2f8f68[_0xdbf0('0x1b')]+_0x2f8f68[_0xdbf0('0x1d')];var _0x13309a;if(_0x5c9776>=_0x5e469b){_0x5c9776=_0x5e469b;_0x13309a=0xc8;}else{_0x13309a=0xce;}_0x35dd89[_0xdbf0('0x18')](_0x13309a);return _0x35dd89['set'](_0xdbf0('0x1f'),_0x56e45e+'-'+_0x5c9776+'/'+_0x5e469b)[_0xdbf0('0x1a')](_0x48677c);}return null;};}function patchUpdates(_0x209b14){return function(_0x51c4e9){try{jsonpatch[_0xdbf0('0x20')](_0x51c4e9,_0x209b14,!![]);}catch(_0x21da06){return BPromise[_0xdbf0('0x21')](_0x21da06);}return _0x51c4e9[_0xdbf0('0x22')]();};}function saveUpdates(_0x35da11,_0xad4e06){return function(_0x1e56b3){if(_0x1e56b3){return _0x1e56b3[_0xdbf0('0x23')](_0x35da11)['then'](function(_0x476f8a){return _0x476f8a;});}return null;};}function removeEntity(_0x5409ed,_0x5dc02e){return function(_0x4e5c67){if(_0x4e5c67){return _0x4e5c67[_0xdbf0('0x24')]()[_0xdbf0('0x25')](function(){_0x5409ed['status'](0xcc)[_0xdbf0('0x19')]();});}};}function handleEntityNotFound(_0x1c5de7,_0x323518){return function(_0x5097b6){if(!_0x5097b6){_0x1c5de7[_0xdbf0('0x26')](0x194);}return _0x5097b6;};}function handleError(_0x5a571b,_0x34baf2){_0x34baf2=_0x34baf2||0x1f4;return function(_0x3a66d0){logger[_0xdbf0('0x27')](_0x3a66d0[_0xdbf0('0x28')]);if(_0x3a66d0['name']){delete _0x3a66d0[_0xdbf0('0x29')];}_0x5a571b[_0xdbf0('0x18')](_0x34baf2)[_0xdbf0('0x2a')](_0x3a66d0);};}exports[_0xdbf0('0x2b')]=function(_0x15ebef,_0xead7da){var _0x4fa4d3={},_0x4f9fdd={},_0x34be3f={'count':0x0,'rows':[]};var _0x5b1842=_['map'](db[_0xdbf0('0x2c')][_0xdbf0('0x2d')],function(_0x3b9dbc){return{'name':_0x3b9dbc['fieldName'],'type':_0x3b9dbc[_0xdbf0('0x2e')][_0xdbf0('0x2f')]};});_0x4f9fdd[_0xdbf0('0x30')]=_[_0xdbf0('0x31')](_0x5b1842,_0xdbf0('0x29'));_0x4f9fdd['query']=_[_0xdbf0('0x32')](_0x15ebef[_0xdbf0('0x33')]);_0x4f9fdd[_0xdbf0('0x34')]=_[_0xdbf0('0x35')](_0x4f9fdd[_0xdbf0('0x30')],_0x4f9fdd[_0xdbf0('0x33')]);_0x4fa4d3[_0xdbf0('0x36')]=_[_0xdbf0('0x35')](_0x4f9fdd[_0xdbf0('0x30')],qs['fields'](_0x15ebef[_0xdbf0('0x33')]['fields']));_0x4fa4d3[_0xdbf0('0x36')]=_0x4fa4d3[_0xdbf0('0x36')][_0xdbf0('0x37')]?_0x4fa4d3['attributes']:_0x4f9fdd[_0xdbf0('0x30')];if(!_0x15ebef[_0xdbf0('0x33')]['hasOwnProperty'](_0xdbf0('0x38'))){_0x4fa4d3['limit']=qs[_0xdbf0('0x1d')](_0x15ebef[_0xdbf0('0x33')][_0xdbf0('0x1d')]);_0x4fa4d3[_0xdbf0('0x1b')]=qs[_0xdbf0('0x1b')](_0x15ebef[_0xdbf0('0x33')]['offset']);}_0x4fa4d3[_0xdbf0('0x39')]=qs[_0xdbf0('0x3a')](_0x15ebef[_0xdbf0('0x33')][_0xdbf0('0x3a')]);_0x4fa4d3[_0xdbf0('0x3b')]=qs[_0xdbf0('0x34')](_[_0xdbf0('0x3c')](_0x15ebef[_0xdbf0('0x33')],_0x4f9fdd[_0xdbf0('0x34')]),_0x5b1842);if(_0x15ebef[_0xdbf0('0x33')][_0xdbf0('0x3d')]){_0x4fa4d3[_0xdbf0('0x3b')]=_[_0xdbf0('0x3e')](_0x4fa4d3[_0xdbf0('0x3b')],{'$or':_[_0xdbf0('0x31')](_0x5b1842,function(_0x21d23e){if(_0x21d23e['type']!==_0xdbf0('0x3f')){var _0x5d7ad3={};_0x5d7ad3[_0x21d23e[_0xdbf0('0x29')]]={'$like':'%'+_0x15ebef[_0xdbf0('0x33')]['filter']+'%'};return _0x5d7ad3;}})});}_0x4fa4d3=_['merge']({},_0x4fa4d3,_0x15ebef['options']);var _0x56db82={'where':_0x4fa4d3[_0xdbf0('0x3b')]};return db['Dynamics365Configuration']['count'](_0x56db82)[_0xdbf0('0x25')](function(_0x260533){_0x34be3f['count']=_0x260533;if(_0x15ebef[_0xdbf0('0x33')][_0xdbf0('0x40')]){_0x4fa4d3[_0xdbf0('0x41')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xdbf0('0x42')](_0x4fa4d3);})['then'](function(_0x53fc46){_0x34be3f[_0xdbf0('0x43')]=_0x53fc46;return _0x34be3f;})[_0xdbf0('0x25')](respondWithFilteredResult(_0xead7da,_0x4fa4d3))[_0xdbf0('0x44')](handleError(_0xead7da,null));};exports[_0xdbf0('0x45')]=function(_0x37b008,_0x3592e0){var _0x1db4c2={'raw':![],'where':{'id':_0x37b008[_0xdbf0('0x46')]['id']}},_0x2c0166={};_0x2c0166[_0xdbf0('0x30')]=_[_0xdbf0('0x32')](db[_0xdbf0('0x2c')][_0xdbf0('0x2d')]);_0x2c0166[_0xdbf0('0x33')]=_[_0xdbf0('0x32')](_0x37b008['query']);_0x2c0166['filters']=_[_0xdbf0('0x35')](_0x2c0166[_0xdbf0('0x30')],_0x2c0166[_0xdbf0('0x33')]);_0x1db4c2[_0xdbf0('0x36')]=_[_0xdbf0('0x35')](_0x2c0166['model'],qs[_0xdbf0('0x47')](_0x37b008['query']['fields']));_0x1db4c2[_0xdbf0('0x36')]=_0x1db4c2['attributes']['length']?_0x1db4c2[_0xdbf0('0x36')]:_0x2c0166[_0xdbf0('0x30')];if(_0x37b008[_0xdbf0('0x33')][_0xdbf0('0x40')]){_0x1db4c2[_0xdbf0('0x41')]=[{'all':!![]}];}_0x1db4c2=_[_0xdbf0('0x3e')]({},_0x1db4c2,_0x37b008[_0xdbf0('0x48')]);return db[_0xdbf0('0x2c')][_0xdbf0('0x49')](_0x1db4c2)[_0xdbf0('0x25')](handleEntityNotFound(_0x3592e0,null))[_0xdbf0('0x25')](respondWithResult(_0x3592e0,null))['catch'](handleError(_0x3592e0,null));};exports[_0xdbf0('0x4a')]=function(_0x322f08,_0x468826){return db[_0xdbf0('0x2c')][_0xdbf0('0x4a')](_0x322f08[_0xdbf0('0x4b')],{})[_0xdbf0('0x25')](respondWithResult(_0x468826,0xc9))[_0xdbf0('0x44')](handleError(_0x468826,null));};exports[_0xdbf0('0x23')]=function(_0x5bffbb,_0x218191){if(_0x5bffbb[_0xdbf0('0x4b')]['id']){delete _0x5bffbb[_0xdbf0('0x4b')]['id'];}return db[_0xdbf0('0x2c')][_0xdbf0('0x49')]({'where':{'id':_0x5bffbb[_0xdbf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x218191,null))['then'](saveUpdates(_0x5bffbb[_0xdbf0('0x4b')],null))[_0xdbf0('0x25')](respondWithResult(_0x218191,null))[_0xdbf0('0x44')](handleError(_0x218191,null));};exports['destroy']=function(_0x2f7d1f,_0x5910fa){return db['Dynamics365Configuration'][_0xdbf0('0x49')]({'where':{'id':_0x2f7d1f[_0xdbf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x5910fa,null))['then'](removeEntity(_0x5910fa,null))['catch'](handleError(_0x5910fa,null));};exports[_0xdbf0('0x4c')]=function(_0x4d14df,_0x1fe754,_0x12204c){var _0x20434d={};var _0x53cf39={};var _0x44e5a0;var _0x247e96;return db[_0xdbf0('0x2c')]['findOne']({'where':{'id':_0x4d14df[_0xdbf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fe754,null))['then'](function(_0x5ab396){if(_0x5ab396){_0x44e5a0=_0x5ab396;_0x53cf39[_0xdbf0('0x30')]=_['keys'](db['Dynamics365Field'][_0xdbf0('0x2d')]);_0x53cf39[_0xdbf0('0x33')]=_[_0xdbf0('0x32')](_0x4d14df[_0xdbf0('0x33')]);_0x53cf39[_0xdbf0('0x34')]=_['intersection'](_0x53cf39[_0xdbf0('0x30')],_0x53cf39[_0xdbf0('0x33')]);_0x20434d[_0xdbf0('0x36')]=_[_0xdbf0('0x35')](_0x53cf39[_0xdbf0('0x30')],qs[_0xdbf0('0x47')](_0x4d14df['query'][_0xdbf0('0x47')]));_0x20434d[_0xdbf0('0x36')]=_0x20434d['attributes'][_0xdbf0('0x37')]?_0x20434d[_0xdbf0('0x36')]:_0x53cf39['model'];_0x20434d[_0xdbf0('0x39')]=qs[_0xdbf0('0x3a')](_0x4d14df[_0xdbf0('0x33')][_0xdbf0('0x3a')]);_0x20434d[_0xdbf0('0x3b')]=qs[_0xdbf0('0x34')](_[_0xdbf0('0x3c')](_0x4d14df[_0xdbf0('0x33')],_0x53cf39['filters']));if(_0x4d14df[_0xdbf0('0x33')][_0xdbf0('0x3d')]){_0x20434d['where']=_[_0xdbf0('0x3e')](_0x20434d[_0xdbf0('0x3b')],{'$or':_[_0xdbf0('0x31')](_0x20434d['attributes'],function(_0x39fa74){var _0x35aa94={};_0x35aa94[_0x39fa74]={'$like':'%'+_0x4d14df[_0xdbf0('0x33')][_0xdbf0('0x3d')]+'%'};return _0x35aa94;})});}_0x20434d=_[_0xdbf0('0x3e')]({},_0x20434d,_0x4d14df['options']);return _0x44e5a0[_0xdbf0('0x4c')](_0x20434d);}})[_0xdbf0('0x25')](function(_0x498cf3){if(_0x498cf3){_0x247e96=_0x498cf3[_0xdbf0('0x37')];if(!_0x4d14df['query'][_0xdbf0('0x4d')]('nolimit')){_0x20434d[_0xdbf0('0x1d')]=qs[_0xdbf0('0x1d')](_0x4d14df['query']['limit']);_0x20434d[_0xdbf0('0x1b')]=qs[_0xdbf0('0x1b')](_0x4d14df[_0xdbf0('0x33')]['offset']);}return _0x44e5a0['getFields'](_0x20434d);}})[_0xdbf0('0x25')](function(_0x42c164){if(_0x42c164){return _0x42c164?{'count':_0x247e96,'rows':_0x42c164}:null;}})[_0xdbf0('0x25')](respondWithResult(_0x1fe754,null))[_0xdbf0('0x44')](handleError(_0x1fe754,null));};exports[_0xdbf0('0x4e')]=function(_0x4410cb,_0x504d08,_0x5e5cb3){var _0x204286={};var _0x1cef43={};var _0x5231ac;var _0x4d992e;return db[_0xdbf0('0x2c')][_0xdbf0('0x4f')]({'where':{'id':_0x4410cb[_0xdbf0('0x46')]['id']}})[_0xdbf0('0x25')](handleEntityNotFound(_0x504d08,null))[_0xdbf0('0x25')](function(_0xa8dd41){if(_0xa8dd41){_0x5231ac=_0xa8dd41;_0x1cef43[_0xdbf0('0x30')]=_['keys'](db[_0xdbf0('0x50')][_0xdbf0('0x2d')]);_0x1cef43['query']=_[_0xdbf0('0x32')](_0x4410cb[_0xdbf0('0x33')]);_0x1cef43[_0xdbf0('0x34')]=_[_0xdbf0('0x35')](_0x1cef43[_0xdbf0('0x30')],_0x1cef43[_0xdbf0('0x33')]);_0x204286[_0xdbf0('0x36')]=_[_0xdbf0('0x35')](_0x1cef43['model'],qs['fields'](_0x4410cb['query']['fields']));_0x204286[_0xdbf0('0x36')]=_0x204286[_0xdbf0('0x36')][_0xdbf0('0x37')]?_0x204286[_0xdbf0('0x36')]:_0x1cef43[_0xdbf0('0x30')];_0x204286[_0xdbf0('0x39')]=qs['sort'](_0x4410cb[_0xdbf0('0x33')][_0xdbf0('0x3a')]);_0x204286[_0xdbf0('0x3b')]=qs[_0xdbf0('0x34')](_['pick'](_0x4410cb[_0xdbf0('0x33')],_0x1cef43[_0xdbf0('0x34')]));if(_0x4410cb['query']['filter']){_0x204286['where']=_['merge'](_0x204286[_0xdbf0('0x3b')],{'$or':_[_0xdbf0('0x31')](_0x204286[_0xdbf0('0x36')],function(_0x5a6ce8){var _0x2482ea={};_0x2482ea[_0x5a6ce8]={'$like':'%'+_0x4410cb[_0xdbf0('0x33')][_0xdbf0('0x3d')]+'%'};return _0x2482ea;})});}_0x204286=_[_0xdbf0('0x3e')]({},_0x204286,_0x4410cb[_0xdbf0('0x48')]);return _0x5231ac['getSubjects'](_0x204286);}})[_0xdbf0('0x25')](function(_0x3bb762){if(_0x3bb762){_0x4d992e=_0x3bb762[_0xdbf0('0x37')];if(!_0x4410cb[_0xdbf0('0x33')][_0xdbf0('0x4d')](_0xdbf0('0x38'))){_0x204286[_0xdbf0('0x1d')]=qs[_0xdbf0('0x1d')](_0x4410cb[_0xdbf0('0x33')][_0xdbf0('0x1d')]);_0x204286[_0xdbf0('0x1b')]=qs[_0xdbf0('0x1b')](_0x4410cb[_0xdbf0('0x33')][_0xdbf0('0x1b')]);}return _0x5231ac['getSubjects'](_0x204286);}})[_0xdbf0('0x25')](function(_0x8ec086){if(_0x8ec086){return _0x8ec086?{'count':_0x4d992e,'rows':_0x8ec086}:null;}})[_0xdbf0('0x25')](respondWithResult(_0x504d08,null))[_0xdbf0('0x44')](handleError(_0x504d08,null));};exports['getDescriptions']=function(_0x1a9015,_0x1688d7,_0x53625e){var _0x40ed6c={};var _0x21bc38={};var _0x20f40d;var _0x5367c7;return db[_0xdbf0('0x2c')][_0xdbf0('0x4f')]({'where':{'id':_0x1a9015[_0xdbf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x1688d7,null))[_0xdbf0('0x25')](function(_0xed65ca){if(_0xed65ca){_0x20f40d=_0xed65ca;_0x21bc38[_0xdbf0('0x30')]=_['keys'](db['Dynamics365Field'][_0xdbf0('0x2d')]);_0x21bc38[_0xdbf0('0x33')]=_['keys'](_0x1a9015[_0xdbf0('0x33')]);_0x21bc38[_0xdbf0('0x34')]=_['intersection'](_0x21bc38[_0xdbf0('0x30')],_0x21bc38['query']);_0x40ed6c[_0xdbf0('0x36')]=_[_0xdbf0('0x35')](_0x21bc38[_0xdbf0('0x30')],qs[_0xdbf0('0x47')](_0x1a9015['query'][_0xdbf0('0x47')]));_0x40ed6c[_0xdbf0('0x36')]=_0x40ed6c[_0xdbf0('0x36')][_0xdbf0('0x37')]?_0x40ed6c['attributes']:_0x21bc38['model'];_0x40ed6c[_0xdbf0('0x39')]=qs['sort'](_0x1a9015[_0xdbf0('0x33')]['sort']);_0x40ed6c[_0xdbf0('0x3b')]=qs[_0xdbf0('0x34')](_['pick'](_0x1a9015[_0xdbf0('0x33')],_0x21bc38[_0xdbf0('0x34')]));if(_0x1a9015[_0xdbf0('0x33')][_0xdbf0('0x3d')]){_0x40ed6c['where']=_[_0xdbf0('0x3e')](_0x40ed6c['where'],{'$or':_[_0xdbf0('0x31')](_0x40ed6c[_0xdbf0('0x36')],function(_0x4b2af0){var _0x36a4e7={};_0x36a4e7[_0x4b2af0]={'$like':'%'+_0x1a9015[_0xdbf0('0x33')][_0xdbf0('0x3d')]+'%'};return _0x36a4e7;})});}_0x40ed6c=_['merge']({},_0x40ed6c,_0x1a9015[_0xdbf0('0x48')]);return _0x20f40d[_0xdbf0('0x51')](_0x40ed6c);}})[_0xdbf0('0x25')](function(_0x1a4d78){if(_0x1a4d78){_0x5367c7=_0x1a4d78[_0xdbf0('0x37')];if(!_0x1a9015[_0xdbf0('0x33')][_0xdbf0('0x4d')]('nolimit')){_0x40ed6c[_0xdbf0('0x1d')]=qs[_0xdbf0('0x1d')](_0x1a9015['query'][_0xdbf0('0x1d')]);_0x40ed6c[_0xdbf0('0x1b')]=qs['offset'](_0x1a9015['query'][_0xdbf0('0x1b')]);}return _0x20f40d['getDescriptions'](_0x40ed6c);}})[_0xdbf0('0x25')](function(_0x2a732d){if(_0x2a732d){return _0x2a732d?{'count':_0x5367c7,'rows':_0x2a732d}:null;}})[_0xdbf0('0x25')](respondWithResult(_0x1688d7,null))['catch'](handleError(_0x1688d7,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index e734ef5..0606334 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 _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x9a19,0x114));var _0x99a1=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x9a19[_0xdd2bfa];return _0x55397e;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0xfadce2,_0x4c8951){var _0x4642d0=function(_0x130799){while(--_0x130799){_0xfadce2['push'](_0xfadce2['shift']());}};_0x4642d0(++_0x4c8951);}(_0x9f62,0x154));var _0x29f6=function(_0x4c8733,_0x485e84){_0x4c8733=_0x4c8733-0x0;var _0xb71c7d=_0x9f62[_0x4c8733];return _0xb71c7d;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 009840a..81e19fe 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 _0xc3af=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x51ecbd,_0x407543){var _0x2fe819=function(_0x297fee){while(--_0x297fee){_0x51ecbd['push'](_0x51ecbd['shift']());}};_0x2fe819(++_0x407543);}(_0xc3af,0xc6));var _0xfc3a=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0xc3af[_0x4fa0ea];return _0x51d027;};'use strict';var _=require(_0xfc3a('0x0'));var util=require(_0xfc3a('0x1'));var moment=require('moment');var BPromise=require(_0xfc3a('0x2'));var rs=require(_0xfc3a('0x3'));var fs=require('fs');var Redis=require(_0xfc3a('0x4'));var db=require(_0xfc3a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc3a('0x6'))(_0xfc3a('0x7'));var config=require('../../config/environment');var jayson=require(_0xfc3a('0x8'));var client=jayson[_0xfc3a('0x9')][_0xfc3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36c644,_0x45d6b7,_0x588722){return new BPromise(function(_0x44b997,_0x58fdc9){return client[_0xfc3a('0xb')](_0x36c644,_0x588722)[_0xfc3a('0xc')](function(_0x20883f){logger[_0xfc3a('0xd')](_0xfc3a('0xe'),_0x45d6b7,_0xfc3a('0xf'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x45d6b7,_0xfc3a('0xf'),JSON[_0xfc3a('0x10')](_0x20883f));if(_0x20883f[_0xfc3a('0x11')]){if(_0x20883f['error'][_0xfc3a('0x12')]===0x1f4){logger[_0xfc3a('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x45d6b7,_0x20883f['error']['message']);return _0x58fdc9(_0x20883f[_0xfc3a('0x11')][_0xfc3a('0x13')]);}logger['error'](_0xfc3a('0xe'),_0x45d6b7,_0x20883f[_0xfc3a('0x11')][_0xfc3a('0x13')]);return _0x44b997(_0x20883f[_0xfc3a('0x11')][_0xfc3a('0x13')]);}else{logger[_0xfc3a('0xd')](_0xfc3a('0xe'),_0x45d6b7,_0xfc3a('0xf'));_0x44b997(_0x20883f[_0xfc3a('0x14')][_0xfc3a('0x13')]);}})[_0xfc3a('0x15')](function(_0x37b4c1){logger[_0xfc3a('0x11')](_0xfc3a('0xe'),_0x45d6b7,_0x37b4c1);_0x58fdc9(_0x37b4c1);});});} \ No newline at end of file +var _0x1dfa=['code','message','Dynamics365Configuration,\x20%s,\x20%s','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x1c862e,_0x2e378a){var _0x5a4b11=function(_0x3c95a9){while(--_0x3c95a9){_0x1c862e['push'](_0x1c862e['shift']());}};_0x5a4b11(++_0x2e378a);}(_0x1dfa,0xea));var _0xa1df=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x1dfa[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0xa1df('0x0'));var util=require(_0xa1df('0x1'));var moment=require('moment');var BPromise=require(_0xa1df('0x2'));var rs=require(_0xa1df('0x3'));var fs=require('fs');var Redis=require(_0xa1df('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa1df('0x5'))(_0xa1df('0x6'));var config=require(_0xa1df('0x7'));var jayson=require(_0xa1df('0x8'));var client=jayson[_0xa1df('0x9')][_0xa1df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ca2c9,_0x4e551d,_0x5c80f5){return new BPromise(function(_0x32adb1,_0x2f4633){return client[_0xa1df('0xb')](_0x5ca2c9,_0x5c80f5)[_0xa1df('0xc')](function(_0x16a301){logger[_0xa1df('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4e551d,_0xa1df('0xe'));logger[_0xa1df('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4e551d,_0xa1df('0xe'),JSON[_0xa1df('0x10')](_0x16a301));if(_0x16a301['error']){if(_0x16a301[_0xa1df('0x11')][_0xa1df('0x12')]===0x1f4){logger[_0xa1df('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4e551d,_0x16a301[_0xa1df('0x11')][_0xa1df('0x13')]);return _0x2f4633(_0x16a301[_0xa1df('0x11')]['message']);}logger[_0xa1df('0x11')](_0xa1df('0x14'),_0x4e551d,_0x16a301[_0xa1df('0x11')][_0xa1df('0x13')]);return _0x32adb1(_0x16a301[_0xa1df('0x11')]['message']);}else{logger[_0xa1df('0xd')](_0xa1df('0x14'),_0x4e551d,_0xa1df('0xe'));_0x32adb1(_0x16a301['result'][_0xa1df('0x13')]);}})['catch'](function(_0x431bb1){logger[_0xa1df('0x11')](_0xa1df('0x14'),_0x4e551d,_0x431bb1);_0x2f4633(_0x431bb1);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 101025d..0fc600b 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 _0x4d7c=['/:id','post','create','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d7c,0x137));var _0xc4d7=function(_0x12d243,_0xa1c7ca){_0x12d243=_0x12d243-0x0;var _0x2a9095=_0x4d7c[_0x12d243];return _0x2a9095;};'use strict';var multer=require(_0xc4d7('0x0'));var util=require('util');var path=require(_0xc4d7('0x1'));var timeout=require(_0xc4d7('0x2'));var express=require(_0xc4d7('0x3'));var router=express[_0xc4d7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc4d7('0x5'));var interaction=require(_0xc4d7('0x6'));var config=require(_0xc4d7('0x7'));var controller=require(_0xc4d7('0x8'));router[_0xc4d7('0x9')]('/',auth[_0xc4d7('0xa')](),controller[_0xc4d7('0xb')]);router[_0xc4d7('0x9')](_0xc4d7('0xc'),auth[_0xc4d7('0xa')](),controller['show']);router[_0xc4d7('0xd')]('/',auth['isAuthenticated'](),controller[_0xc4d7('0xe')]);router['put'](_0xc4d7('0xc'),auth[_0xc4d7('0xa')](),controller['update']);router[_0xc4d7('0xf')](_0xc4d7('0xc'),auth[_0xc4d7('0xa')](),controller['destroy']);module[_0xc4d7('0x10')]=router; \ No newline at end of file +var _0x1b90=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','index','get','/:id'];(function(_0x166cf1,_0x565c65){var _0x538ba7=function(_0x383eef){while(--_0x383eef){_0x166cf1['push'](_0x166cf1['shift']());}};_0x538ba7(++_0x565c65);}(_0x1b90,0xb2));var _0x01b9=function(_0x3a2cd9,_0x56d294){_0x3a2cd9=_0x3a2cd9-0x0;var _0x44845a=_0x1b90[_0x3a2cd9];return _0x44845a;};'use strict';var multer=require(_0x01b9('0x0'));var util=require(_0x01b9('0x1'));var path=require(_0x01b9('0x2'));var timeout=require(_0x01b9('0x3'));var express=require(_0x01b9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x01b9('0x5'));var interaction=require(_0x01b9('0x6'));var config=require('../../config/environment');var controller=require(_0x01b9('0x7'));router['get']('/',auth[_0x01b9('0x8')](),controller[_0x01b9('0x9')]);router[_0x01b9('0xa')](_0x01b9('0xb'),auth['isAuthenticated'](),controller[_0x01b9('0xc')]);router[_0x01b9('0xd')]('/',auth[_0x01b9('0x8')](),controller[_0x01b9('0xe')]);router['put']('/:id',auth[_0x01b9('0x8')](),controller[_0x01b9('0xf')]);router[_0x01b9('0x10')](_0x01b9('0xb'),auth[_0x01b9('0x8')](),controller[_0x01b9('0x11')]);module[_0x01b9('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 727cf8b..38413ee 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 _0x26e1=['sequelize','exports','ENUM','string','variable','customVariable','STRING','BOOLEAN'];(function(_0x1474fd,_0x30b9aa){var _0x1b76e3=function(_0x380cd9){while(--_0x380cd9){_0x1474fd['push'](_0x1474fd['shift']());}};_0x1b76e3(++_0x30b9aa);}(_0x26e1,0x168));var _0x126e=function(_0x3f74cc,_0x4a4fde){_0x3f74cc=_0x3f74cc-0x0;var _0x6a341d=_0x26e1[_0x3f74cc];return _0x6a341d;};'use strict';var Sequelize=require(_0x126e('0x0'));module[_0x126e('0x1')]={'type':{'type':Sequelize[_0x126e('0x2')](_0x126e('0x3'),_0x126e('0x4'),_0x126e('0x5'),'keyValue','picklist'),'defaultValue':_0x126e('0x3')},'content':{'type':Sequelize[_0x126e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x126e('0x2')]('string','variable',_0x126e('0x5'))},'keyContent':{'type':Sequelize[_0x126e('0x6')]},'idField':{'type':Sequelize[_0x126e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x126e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7aa4=['variable','customVariable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x5a99f7,_0x143d95){var _0x3d1c7a=function(_0x2ea915){while(--_0x2ea915){_0x5a99f7['push'](_0x5a99f7['shift']());}};_0x3d1c7a(++_0x143d95);}(_0x7aa4,0x134));var _0x47aa=function(_0x5c40d1,_0x5aeb8d){_0x5c40d1=_0x5c40d1-0x0;var _0x4ead16=_0x7aa4[_0x5c40d1];return _0x4ead16;};'use strict';var Sequelize=require(_0x47aa('0x0'));module[_0x47aa('0x1')]={'type':{'type':Sequelize[_0x47aa('0x2')](_0x47aa('0x3'),_0x47aa('0x4'),_0x47aa('0x5'),_0x47aa('0x6'),'picklist'),'defaultValue':_0x47aa('0x3')},'content':{'type':Sequelize[_0x47aa('0x7')]},'key':{'type':Sequelize[_0x47aa('0x7')]},'keyType':{'type':Sequelize[_0x47aa('0x2')](_0x47aa('0x3'),_0x47aa('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x47aa('0x7')]},'idField':{'type':Sequelize[_0x47aa('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index af2740d..0faeac8 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 _0xd947=['update','then','destroy','error','stack','send','index','map','Dynamics365Field','fieldName','type','model','name','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd947,0xc8));var _0x7d94=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd947[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7d94('0x0'));var rimraf=require(_0x7d94('0x1'));var zipdir=require(_0x7d94('0x2'));var jsonpatch=require(_0x7d94('0x3'));var rp=require('request-promise');var moment=require(_0x7d94('0x4'));var BPromise=require(_0x7d94('0x5'));var Mustache=require(_0x7d94('0x6'));var util=require('util');var path=require(_0x7d94('0x7'));var sox=require(_0x7d94('0x8'));var csv=require(_0x7d94('0x9'));var ejs=require(_0x7d94('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d94('0xb'));var squel=require(_0x7d94('0xc'));var crypto=require(_0x7d94('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7d94('0xe'));var toCsv=require(_0x7d94('0x9'));var querystring=require(_0x7d94('0xf'));var Papa=require(_0x7d94('0x10'));var Redis=require(_0x7d94('0x11'));var authService=require(_0x7d94('0x12'));var qs=require(_0x7d94('0x13'));var as=require(_0x7d94('0x14'));var hardwareService=require(_0x7d94('0x15'));var logger=require(_0x7d94('0x16'))(_0x7d94('0x17'));var utils=require('../../config/utils');var config=require(_0x7d94('0x18'));var licenseUtil=require(_0x7d94('0x19'));var db=require(_0x7d94('0x1a'))['db'];function respondWithStatusCode(_0x5b8101,_0x3ea797){_0x3ea797=_0x3ea797||0xcc;return function(_0x927473){if(_0x927473){return _0x5b8101[_0x7d94('0x1b')](_0x3ea797);}return _0x5b8101[_0x7d94('0x1c')](_0x3ea797)[_0x7d94('0x1d')]();};}function respondWithResult(_0x510fb3,_0x2e193e){_0x2e193e=_0x2e193e||0xc8;return function(_0x5a64f6){if(_0x5a64f6){return _0x510fb3[_0x7d94('0x1c')](_0x2e193e)[_0x7d94('0x1e')](_0x5a64f6);}};}function respondWithFilteredResult(_0x1bdad9,_0x13cfa7){return function(_0x5640fb){if(_0x5640fb){var _0x4eb32b=typeof _0x13cfa7[_0x7d94('0x1f')]==='undefined'&&typeof _0x13cfa7[_0x7d94('0x20')]===_0x7d94('0x21');var _0x504666=_0x5640fb[_0x7d94('0x22')];var _0x335b4a=_0x4eb32b?0x0:_0x13cfa7[_0x7d94('0x1f')];var _0xa815ca=_0x4eb32b?_0x5640fb['count']:_0x13cfa7[_0x7d94('0x1f')]+_0x13cfa7[_0x7d94('0x20')];var _0x337c66;if(_0xa815ca>=_0x504666){_0xa815ca=_0x504666;_0x337c66=0xc8;}else{_0x337c66=0xce;}_0x1bdad9[_0x7d94('0x1c')](_0x337c66);return _0x1bdad9[_0x7d94('0x23')](_0x7d94('0x24'),_0x335b4a+'-'+_0xa815ca+'/'+_0x504666)[_0x7d94('0x1e')](_0x5640fb);}return null;};}function patchUpdates(_0x57379d){return function(_0x276399){try{jsonpatch[_0x7d94('0x25')](_0x276399,_0x57379d,!![]);}catch(_0x1c0c8d){return BPromise[_0x7d94('0x26')](_0x1c0c8d);}return _0x276399[_0x7d94('0x27')]();};}function saveUpdates(_0x286e57,_0x362e23){return function(_0x8aa01d){if(_0x8aa01d){return _0x8aa01d[_0x7d94('0x28')](_0x286e57)[_0x7d94('0x29')](function(_0x159908){return _0x159908;});}return null;};}function removeEntity(_0x2967c6,_0x3862f5){return function(_0x563aea){if(_0x563aea){return _0x563aea[_0x7d94('0x2a')]()[_0x7d94('0x29')](function(){_0x2967c6[_0x7d94('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49c673,_0x55e6ab){return function(_0x1d4980){if(!_0x1d4980){_0x49c673['sendStatus'](0x194);}return _0x1d4980;};}function handleError(_0xc73e2e,_0x5d5381){_0x5d5381=_0x5d5381||0x1f4;return function(_0x19fb50){logger[_0x7d94('0x2b')](_0x19fb50[_0x7d94('0x2c')]);if(_0x19fb50['name']){delete _0x19fb50['name'];}_0xc73e2e[_0x7d94('0x1c')](_0x5d5381)[_0x7d94('0x2d')](_0x19fb50);};}exports[_0x7d94('0x2e')]=function(_0x1e636c,_0x3108d0){var _0x447bf1={},_0x1c3f34={},_0x24861a={'count':0x0,'rows':[]};var _0x456822=_[_0x7d94('0x2f')](db[_0x7d94('0x30')]['rawAttributes'],function(_0x478ae2){return{'name':_0x478ae2[_0x7d94('0x31')],'type':_0x478ae2[_0x7d94('0x32')]['key']};});_0x1c3f34[_0x7d94('0x33')]=_[_0x7d94('0x2f')](_0x456822,_0x7d94('0x34'));_0x1c3f34['query']=_[_0x7d94('0x35')](_0x1e636c[_0x7d94('0x36')]);_0x1c3f34[_0x7d94('0x37')]=_['intersection'](_0x1c3f34[_0x7d94('0x33')],_0x1c3f34['query']);_0x447bf1[_0x7d94('0x38')]=_[_0x7d94('0x39')](_0x1c3f34[_0x7d94('0x33')],qs[_0x7d94('0x3a')](_0x1e636c['query'][_0x7d94('0x3a')]));_0x447bf1[_0x7d94('0x38')]=_0x447bf1[_0x7d94('0x38')][_0x7d94('0x3b')]?_0x447bf1[_0x7d94('0x38')]:_0x1c3f34[_0x7d94('0x33')];if(!_0x1e636c[_0x7d94('0x36')][_0x7d94('0x3c')](_0x7d94('0x3d'))){_0x447bf1[_0x7d94('0x20')]=qs[_0x7d94('0x20')](_0x1e636c[_0x7d94('0x36')]['limit']);_0x447bf1[_0x7d94('0x1f')]=qs[_0x7d94('0x1f')](_0x1e636c[_0x7d94('0x36')][_0x7d94('0x1f')]);}_0x447bf1[_0x7d94('0x3e')]=qs['sort'](_0x1e636c[_0x7d94('0x36')]['sort']);_0x447bf1[_0x7d94('0x3f')]=qs['filters'](_[_0x7d94('0x40')](_0x1e636c[_0x7d94('0x36')],_0x1c3f34['filters']),_0x456822);if(_0x1e636c[_0x7d94('0x36')][_0x7d94('0x41')]){_0x447bf1[_0x7d94('0x3f')]=_[_0x7d94('0x42')](_0x447bf1[_0x7d94('0x3f')],{'$or':_[_0x7d94('0x2f')](_0x456822,function(_0x22bde9){if(_0x22bde9['type']!==_0x7d94('0x43')){var _0x3e04b4={};_0x3e04b4[_0x22bde9[_0x7d94('0x34')]]={'$like':'%'+_0x1e636c[_0x7d94('0x36')]['filter']+'%'};return _0x3e04b4;}})});}_0x447bf1=_[_0x7d94('0x42')]({},_0x447bf1,_0x1e636c[_0x7d94('0x44')]);var _0x94b598={'where':_0x447bf1[_0x7d94('0x3f')]};return db[_0x7d94('0x30')][_0x7d94('0x22')](_0x94b598)[_0x7d94('0x29')](function(_0x275833){_0x24861a[_0x7d94('0x22')]=_0x275833;if(_0x1e636c['query'][_0x7d94('0x45')]){_0x447bf1[_0x7d94('0x46')]=[{'all':!![]}];}return db[_0x7d94('0x30')][_0x7d94('0x47')](_0x447bf1);})['then'](function(_0x384b42){_0x24861a[_0x7d94('0x48')]=_0x384b42;return _0x24861a;})[_0x7d94('0x29')](respondWithFilteredResult(_0x3108d0,_0x447bf1))[_0x7d94('0x49')](handleError(_0x3108d0,null));};exports[_0x7d94('0x4a')]=function(_0x31a65a,_0x5402a4){var _0x3cc804={'raw':!![],'where':{'id':_0x31a65a[_0x7d94('0x4b')]['id']}},_0x4250f3={};_0x4250f3['model']=_[_0x7d94('0x35')](db[_0x7d94('0x30')][_0x7d94('0x4c')]);_0x4250f3[_0x7d94('0x36')]=_[_0x7d94('0x35')](_0x31a65a[_0x7d94('0x36')]);_0x4250f3[_0x7d94('0x37')]=_[_0x7d94('0x39')](_0x4250f3['model'],_0x4250f3[_0x7d94('0x36')]);_0x3cc804[_0x7d94('0x38')]=_['intersection'](_0x4250f3[_0x7d94('0x33')],qs[_0x7d94('0x3a')](_0x31a65a['query'][_0x7d94('0x3a')]));_0x3cc804[_0x7d94('0x38')]=_0x3cc804[_0x7d94('0x38')][_0x7d94('0x3b')]?_0x3cc804[_0x7d94('0x38')]:_0x4250f3[_0x7d94('0x33')];if(_0x31a65a[_0x7d94('0x36')][_0x7d94('0x45')]){_0x3cc804[_0x7d94('0x46')]=[{'all':!![]}];}_0x3cc804=_[_0x7d94('0x42')]({},_0x3cc804,_0x31a65a[_0x7d94('0x44')]);return db['Dynamics365Field'][_0x7d94('0x4d')](_0x3cc804)[_0x7d94('0x29')](handleEntityNotFound(_0x5402a4,null))[_0x7d94('0x29')](respondWithResult(_0x5402a4,null))['catch'](handleError(_0x5402a4,null));};exports[_0x7d94('0x4e')]=function(_0x481f39,_0x218932){return db[_0x7d94('0x30')][_0x7d94('0x4e')](_0x481f39[_0x7d94('0x4f')],{})['then'](respondWithResult(_0x218932,0xc9))[_0x7d94('0x49')](handleError(_0x218932,null));};exports[_0x7d94('0x28')]=function(_0x3574e0,_0x4cccb5){if(_0x3574e0[_0x7d94('0x4f')]['id']){delete _0x3574e0[_0x7d94('0x4f')]['id'];}return db['Dynamics365Field'][_0x7d94('0x4d')]({'where':{'id':_0x3574e0[_0x7d94('0x4b')]['id']}})[_0x7d94('0x29')](handleEntityNotFound(_0x4cccb5,null))[_0x7d94('0x29')](saveUpdates(_0x3574e0['body'],null))[_0x7d94('0x29')](respondWithResult(_0x4cccb5,null))[_0x7d94('0x49')](handleError(_0x4cccb5,null));};exports[_0x7d94('0x2a')]=function(_0x5a61d9,_0x1e6f00){return db[_0x7d94('0x30')][_0x7d94('0x4d')]({'where':{'id':_0x5a61d9[_0x7d94('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e6f00,null))[_0x7d94('0x29')](removeEntity(_0x1e6f00,null))['catch'](handleError(_0x1e6f00,null));}; \ No newline at end of file +var _0x4d91=['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','end','status','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','Dynamics365Field','findAll','rows','show','params','keys','find','catch','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x4d91,0x1d6));var _0x14d9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4d91[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x14d9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x14d9('0x1'));var rp=require(_0x14d9('0x2'));var moment=require(_0x14d9('0x3'));var BPromise=require(_0x14d9('0x4'));var Mustache=require('mustache');var util=require(_0x14d9('0x5'));var path=require(_0x14d9('0x6'));var sox=require(_0x14d9('0x7'));var csv=require(_0x14d9('0x8'));var ejs=require(_0x14d9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14d9('0xa'));var squel=require(_0x14d9('0xb'));var crypto=require(_0x14d9('0xc'));var jsforce=require(_0x14d9('0xd'));var deskjs=require(_0x14d9('0xe'));var toCsv=require(_0x14d9('0x8'));var querystring=require(_0x14d9('0xf'));var Papa=require(_0x14d9('0x10'));var Redis=require(_0x14d9('0x11'));var authService=require(_0x14d9('0x12'));var qs=require(_0x14d9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14d9('0x14'));var logger=require(_0x14d9('0x15'))(_0x14d9('0x16'));var utils=require(_0x14d9('0x17'));var config=require(_0x14d9('0x18'));var licenseUtil=require(_0x14d9('0x19'));var db=require(_0x14d9('0x1a'))['db'];function respondWithStatusCode(_0x293a77,_0x59ed48){_0x59ed48=_0x59ed48||0xcc;return function(_0xddf41f){if(_0xddf41f){return _0x293a77['sendStatus'](_0x59ed48);}return _0x293a77['status'](_0x59ed48)[_0x14d9('0x1b')]();};}function respondWithResult(_0x516ae0,_0x5d2951){_0x5d2951=_0x5d2951||0xc8;return function(_0x20fb5d){if(_0x20fb5d){return _0x516ae0[_0x14d9('0x1c')](_0x5d2951)['json'](_0x20fb5d);}};}function respondWithFilteredResult(_0x11fd31,_0xa6f31e){return function(_0x42819c){if(_0x42819c){var _0x2640e2=typeof _0xa6f31e['offset']==='undefined'&&typeof _0xa6f31e[_0x14d9('0x1d')]==='undefined';var _0x20da00=_0x42819c[_0x14d9('0x1e')];var _0x5f1d2b=_0x2640e2?0x0:_0xa6f31e[_0x14d9('0x1f')];var _0x2ae7a6=_0x2640e2?_0x42819c['count']:_0xa6f31e[_0x14d9('0x1f')]+_0xa6f31e['limit'];var _0xbf348b;if(_0x2ae7a6>=_0x20da00){_0x2ae7a6=_0x20da00;_0xbf348b=0xc8;}else{_0xbf348b=0xce;}_0x11fd31[_0x14d9('0x1c')](_0xbf348b);return _0x11fd31[_0x14d9('0x20')](_0x14d9('0x21'),_0x5f1d2b+'-'+_0x2ae7a6+'/'+_0x20da00)[_0x14d9('0x22')](_0x42819c);}return null;};}function patchUpdates(_0x460ba3){return function(_0x3b5811){try{jsonpatch[_0x14d9('0x23')](_0x3b5811,_0x460ba3,!![]);}catch(_0x1a2e36){return BPromise['reject'](_0x1a2e36);}return _0x3b5811[_0x14d9('0x24')]();};}function saveUpdates(_0x3dfade,_0x3104ae){return function(_0x12a09e){if(_0x12a09e){return _0x12a09e[_0x14d9('0x25')](_0x3dfade)[_0x14d9('0x26')](function(_0x2ccb71){return _0x2ccb71;});}return null;};}function removeEntity(_0x2ea790,_0x5bfb83){return function(_0x330259){if(_0x330259){return _0x330259[_0x14d9('0x27')]()[_0x14d9('0x26')](function(){_0x2ea790[_0x14d9('0x1c')](0xcc)[_0x14d9('0x1b')]();});}};}function handleEntityNotFound(_0x2bc036,_0x4623e6){return function(_0x4faa7d){if(!_0x4faa7d){_0x2bc036[_0x14d9('0x28')](0x194);}return _0x4faa7d;};}function handleError(_0x3c681b,_0x58fe46){_0x58fe46=_0x58fe46||0x1f4;return function(_0xeb8eab){logger[_0x14d9('0x29')](_0xeb8eab[_0x14d9('0x2a')]);if(_0xeb8eab[_0x14d9('0x2b')]){delete _0xeb8eab['name'];}_0x3c681b['status'](_0x58fe46)[_0x14d9('0x2c')](_0xeb8eab);};}exports[_0x14d9('0x2d')]=function(_0x551ef5,_0x4bce3b){var _0x4eaaf5={},_0x1acf4f={},_0x5b2417={'count':0x0,'rows':[]};var _0x412c95=_[_0x14d9('0x2e')](db['Dynamics365Field'][_0x14d9('0x2f')],function(_0x3adc5d){return{'name':_0x3adc5d[_0x14d9('0x30')],'type':_0x3adc5d[_0x14d9('0x31')][_0x14d9('0x32')]};});_0x1acf4f[_0x14d9('0x33')]=_[_0x14d9('0x2e')](_0x412c95,_0x14d9('0x2b'));_0x1acf4f['query']=_['keys'](_0x551ef5['query']);_0x1acf4f['filters']=_[_0x14d9('0x34')](_0x1acf4f[_0x14d9('0x33')],_0x1acf4f[_0x14d9('0x35')]);_0x4eaaf5['attributes']=_[_0x14d9('0x34')](_0x1acf4f[_0x14d9('0x33')],qs[_0x14d9('0x36')](_0x551ef5['query'][_0x14d9('0x36')]));_0x4eaaf5[_0x14d9('0x37')]=_0x4eaaf5[_0x14d9('0x37')][_0x14d9('0x38')]?_0x4eaaf5[_0x14d9('0x37')]:_0x1acf4f[_0x14d9('0x33')];if(!_0x551ef5['query'][_0x14d9('0x39')](_0x14d9('0x3a'))){_0x4eaaf5['limit']=qs[_0x14d9('0x1d')](_0x551ef5[_0x14d9('0x35')]['limit']);_0x4eaaf5[_0x14d9('0x1f')]=qs[_0x14d9('0x1f')](_0x551ef5[_0x14d9('0x35')][_0x14d9('0x1f')]);}_0x4eaaf5[_0x14d9('0x3b')]=qs[_0x14d9('0x3c')](_0x551ef5[_0x14d9('0x35')][_0x14d9('0x3c')]);_0x4eaaf5['where']=qs[_0x14d9('0x3d')](_[_0x14d9('0x3e')](_0x551ef5[_0x14d9('0x35')],_0x1acf4f['filters']),_0x412c95);if(_0x551ef5[_0x14d9('0x35')]['filter']){_0x4eaaf5[_0x14d9('0x3f')]=_[_0x14d9('0x40')](_0x4eaaf5[_0x14d9('0x3f')],{'$or':_[_0x14d9('0x2e')](_0x412c95,function(_0x22f261){if(_0x22f261[_0x14d9('0x31')]!==_0x14d9('0x41')){var _0x5b4367={};_0x5b4367[_0x22f261[_0x14d9('0x2b')]]={'$like':'%'+_0x551ef5[_0x14d9('0x35')][_0x14d9('0x42')]+'%'};return _0x5b4367;}})});}_0x4eaaf5=_[_0x14d9('0x40')]({},_0x4eaaf5,_0x551ef5[_0x14d9('0x43')]);var _0x4ade15={'where':_0x4eaaf5[_0x14d9('0x3f')]};return db['Dynamics365Field'][_0x14d9('0x1e')](_0x4ade15)[_0x14d9('0x26')](function(_0x93898b){_0x5b2417[_0x14d9('0x1e')]=_0x93898b;if(_0x551ef5[_0x14d9('0x35')][_0x14d9('0x44')]){_0x4eaaf5[_0x14d9('0x45')]=[{'all':!![]}];}return db[_0x14d9('0x46')][_0x14d9('0x47')](_0x4eaaf5);})[_0x14d9('0x26')](function(_0x4a6ca0){_0x5b2417[_0x14d9('0x48')]=_0x4a6ca0;return _0x5b2417;})[_0x14d9('0x26')](respondWithFilteredResult(_0x4bce3b,_0x4eaaf5))['catch'](handleError(_0x4bce3b,null));};exports[_0x14d9('0x49')]=function(_0x449dad,_0x2eb3d8){var _0x1ba0e3={'raw':!![],'where':{'id':_0x449dad[_0x14d9('0x4a')]['id']}},_0x34bcfb={};_0x34bcfb[_0x14d9('0x33')]=_[_0x14d9('0x4b')](db[_0x14d9('0x46')][_0x14d9('0x2f')]);_0x34bcfb[_0x14d9('0x35')]=_[_0x14d9('0x4b')](_0x449dad[_0x14d9('0x35')]);_0x34bcfb['filters']=_[_0x14d9('0x34')](_0x34bcfb[_0x14d9('0x33')],_0x34bcfb[_0x14d9('0x35')]);_0x1ba0e3[_0x14d9('0x37')]=_[_0x14d9('0x34')](_0x34bcfb['model'],qs[_0x14d9('0x36')](_0x449dad['query'][_0x14d9('0x36')]));_0x1ba0e3['attributes']=_0x1ba0e3['attributes'][_0x14d9('0x38')]?_0x1ba0e3['attributes']:_0x34bcfb[_0x14d9('0x33')];if(_0x449dad[_0x14d9('0x35')][_0x14d9('0x44')]){_0x1ba0e3['include']=[{'all':!![]}];}_0x1ba0e3=_[_0x14d9('0x40')]({},_0x1ba0e3,_0x449dad['options']);return db[_0x14d9('0x46')][_0x14d9('0x4c')](_0x1ba0e3)[_0x14d9('0x26')](handleEntityNotFound(_0x2eb3d8,null))[_0x14d9('0x26')](respondWithResult(_0x2eb3d8,null))[_0x14d9('0x4d')](handleError(_0x2eb3d8,null));};exports[_0x14d9('0x4e')]=function(_0x475780,_0x36529f){return db[_0x14d9('0x46')][_0x14d9('0x4e')](_0x475780['body'],{})[_0x14d9('0x26')](respondWithResult(_0x36529f,0xc9))['catch'](handleError(_0x36529f,null));};exports[_0x14d9('0x25')]=function(_0x159854,_0x30b9a9){if(_0x159854['body']['id']){delete _0x159854[_0x14d9('0x4f')]['id'];}return db[_0x14d9('0x46')]['find']({'where':{'id':_0x159854['params']['id']}})['then'](handleEntityNotFound(_0x30b9a9,null))[_0x14d9('0x26')](saveUpdates(_0x159854[_0x14d9('0x4f')],null))[_0x14d9('0x26')](respondWithResult(_0x30b9a9,null))['catch'](handleError(_0x30b9a9,null));};exports[_0x14d9('0x27')]=function(_0x6b045a,_0x336891){return db['Dynamics365Field'][_0x14d9('0x4c')]({'where':{'id':_0x6b045a[_0x14d9('0x4a')]['id']}})[_0x14d9('0x26')](handleEntityNotFound(_0x336891,null))[_0x14d9('0x26')](removeEntity(_0x336891,null))[_0x14d9('0x4d')](handleError(_0x336891,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index a619b09..b2d4734 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 _0xce08=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x4e1d12,_0x27aeaa){var _0x59c11a=function(_0x5ed860){while(--_0x5ed860){_0x4e1d12['push'](_0x4e1d12['shift']());}};_0x59c11a(++_0x27aeaa);}(_0xce08,0xd3));var _0x8ce0=function(_0x544c07,_0x1fb267){_0x544c07=_0x544c07-0x0;var _0x4cbeae=_0xce08[_0x544c07];return _0x4cbeae;};'use strict';var _=require(_0x8ce0('0x0'));var util=require(_0x8ce0('0x1'));var logger=require(_0x8ce0('0x2'))(_0x8ce0('0x3'));var moment=require(_0x8ce0('0x4'));var BPromise=require(_0x8ce0('0x5'));var rp=require(_0x8ce0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ce0('0x7'));var config=require(_0x8ce0('0x8'));var attributes=require(_0x8ce0('0x9'));module['exports']=function(_0x5981a8,_0x1f5f3c){return _0x5981a8[_0x8ce0('0xa')]('Dynamics365Field',attributes,{'tableName':_0x8ce0('0xb'),'paranoid':![],'indexes':[{'name':_0x8ce0('0xc'),'fields':[_0x8ce0('0xd'),_0x8ce0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8fb5=['./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xf35d3c,_0x161bbc){var _0x569b8c=function(_0x4d9cdc){while(--_0x4d9cdc){_0xf35d3c['push'](_0xf35d3c['shift']());}};_0x569b8c(++_0x161bbc);}(_0x8fb5,0x1da));var _0x58fb=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x8fb5[_0x173452];return _0xee3fd0;};'use strict';var _=require(_0x58fb('0x0'));var util=require(_0x58fb('0x1'));var logger=require(_0x58fb('0x2'))(_0x58fb('0x3'));var moment=require(_0x58fb('0x4'));var BPromise=require(_0x58fb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x58fb('0x6'));module['exports']=function(_0x1126ea,_0x41b7a8){return _0x1126ea[_0x58fb('0x7')]('Dynamics365Field',attributes,{'tableName':_0x58fb('0x8'),'paranoid':![],'indexes':[{'name':_0x58fb('0x9'),'fields':[_0x58fb('0xa'),_0x58fb('0xb')],'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 fca5899..72d62cd 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 _0xda24=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xda24,0x1b2));var _0x4da2=function(_0x4a7b2b,_0x3366e1){_0x4a7b2b=_0x4a7b2b-0x0;var _0x35e381=_0xda24[_0x4a7b2b];return _0x35e381;};'use strict';var _=require(_0x4da2('0x0'));var util=require(_0x4da2('0x1'));var moment=require(_0x4da2('0x2'));var BPromise=require(_0x4da2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4da2('0x4'));var db=require(_0x4da2('0x5'))['db'];var utils=require(_0x4da2('0x6'));var logger=require(_0x4da2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4da2('0x8'));var client=jayson[_0x4da2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10bf9e,_0x232b17,_0x226e34){return new BPromise(function(_0x517d79,_0x308797){return client[_0x4da2('0xa')](_0x10bf9e,_0x226e34)[_0x4da2('0xb')](function(_0x148382){logger[_0x4da2('0xc')](_0x4da2('0xd'),_0x232b17,'request\x20sent');logger[_0x4da2('0xe')](_0x4da2('0xf'),_0x232b17,_0x4da2('0x10'),JSON[_0x4da2('0x11')](_0x148382));if(_0x148382['error']){if(_0x148382[_0x4da2('0x12')]['code']===0x1f4){logger[_0x4da2('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x232b17,_0x148382[_0x4da2('0x12')]['message']);return _0x308797(_0x148382[_0x4da2('0x12')]['message']);}logger[_0x4da2('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x232b17,_0x148382['error'][_0x4da2('0x13')]);return _0x517d79(_0x148382[_0x4da2('0x12')][_0x4da2('0x13')]);}else{logger[_0x4da2('0xc')](_0x4da2('0xd'),_0x232b17,_0x4da2('0x10'));_0x517d79(_0x148382[_0x4da2('0x14')][_0x4da2('0x13')]);}})[_0x4da2('0x15')](function(_0x4098b0){logger[_0x4da2('0x12')](_0x4da2('0xd'),_0x232b17,_0x4098b0);_0x308797(_0x4098b0);});});} \ No newline at end of file +var _0xae0b=['Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x15b3b3,_0x12b9f6){var _0x49108b=function(_0x4451a5){while(--_0x4451a5){_0x15b3b3['push'](_0x15b3b3['shift']());}};_0x49108b(++_0x12b9f6);}(_0xae0b,0x66));var _0xbae0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae0b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbae0('0x0'));var util=require('util');var moment=require(_0xbae0('0x1'));var BPromise=require(_0xbae0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbae0('0x3'));var logger=require('../../config/logger')(_0xbae0('0x4'));var config=require(_0xbae0('0x5'));var jayson=require(_0xbae0('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ee3d0,_0x298a06,_0x2cbcaa){return new BPromise(function(_0x2d725d,_0x3f61f2){return client['request'](_0x5ee3d0,_0x2cbcaa)[_0xbae0('0x7')](function(_0x289359){logger['info'](_0xbae0('0x8'),_0x298a06,_0xbae0('0x9'));logger['debug'](_0xbae0('0xa'),_0x298a06,'request\x20sent',JSON['stringify'](_0x289359));if(_0x289359[_0xbae0('0xb')]){if(_0x289359[_0xbae0('0xb')][_0xbae0('0xc')]===0x1f4){logger[_0xbae0('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x298a06,_0x289359[_0xbae0('0xb')][_0xbae0('0xd')]);return _0x3f61f2(_0x289359[_0xbae0('0xb')][_0xbae0('0xd')]);}logger[_0xbae0('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x298a06,_0x289359[_0xbae0('0xb')][_0xbae0('0xd')]);return _0x2d725d(_0x289359[_0xbae0('0xb')]['message']);}else{logger[_0xbae0('0xe')](_0xbae0('0x8'),_0x298a06,_0xbae0('0x9'));_0x2d725d(_0x289359['result'][_0xbae0('0xd')]);}})[_0xbae0('0xf')](function(_0x243977){logger[_0xbae0('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x298a06,_0x243977);_0x3f61f2(_0x243977);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 89e0d05..c815fd5 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 _0x456e=['getFields','create','post','addConfiguration','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x456e,0x13b));var _0xe456=function(_0x28b0eb,_0x43f6bd){_0x28b0eb=_0x28b0eb-0x0;var _0x3c1bce=_0x456e[_0x28b0eb];return _0x3c1bce;};'use strict';var multer=require('multer');var util=require(_0xe456('0x0'));var path=require(_0xe456('0x1'));var timeout=require(_0xe456('0x2'));var express=require(_0xe456('0x3'));var router=express[_0xe456('0x4')]();var fs_extra=require(_0xe456('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe456('0x6'));var config=require(_0xe456('0x7'));var controller=require(_0xe456('0x8'));router[_0xe456('0x9')]('/',auth[_0xe456('0xa')](),controller['index']);router[_0xe456('0x9')](_0xe456('0xb'),auth[_0xe456('0xa')](),controller['show']);router['get'](_0xe456('0xc'),auth[_0xe456('0xa')](),controller[_0xe456('0xd')]);router[_0xe456('0x9')](_0xe456('0xe'),auth[_0xe456('0xa')](),controller[_0xe456('0xf')]);router['post']('/',auth[_0xe456('0xa')](),controller[_0xe456('0x10')]);router[_0xe456('0x11')](_0xe456('0xc'),auth[_0xe456('0xa')](),controller[_0xe456('0x12')]);router['put'](_0xe456('0xb'),auth[_0xe456('0xa')](),controller[_0xe456('0x13')]);router[_0xe456('0x14')]('/:id',auth[_0xe456('0xa')](),controller['destroy']);module[_0xe456('0x15')]=router; \ No newline at end of file +var _0x40d0=['put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post'];(function(_0x27b187,_0x2b576f){var _0x37f8f9=function(_0x253599){while(--_0x253599){_0x27b187['push'](_0x27b187['shift']());}};_0x37f8f9(++_0x2b576f);}(_0x40d0,0x139));var _0x040d=function(_0x110197,_0x4e546b){_0x110197=_0x110197-0x0;var _0x3b8623=_0x40d0[_0x110197];return _0x3b8623;};'use strict';var multer=require('multer');var util=require(_0x040d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x040d('0x1'));var router=express[_0x040d('0x2')]();var fs_extra=require(_0x040d('0x3'));var auth=require(_0x040d('0x4'));var interaction=require(_0x040d('0x5'));var config=require('../../config/environment');var controller=require(_0x040d('0x6'));router[_0x040d('0x7')]('/',auth[_0x040d('0x8')](),controller[_0x040d('0x9')]);router[_0x040d('0x7')](_0x040d('0xa'),auth[_0x040d('0x8')](),controller[_0x040d('0xb')]);router['get'](_0x040d('0xc'),auth[_0x040d('0x8')](),controller[_0x040d('0xd')]);router['get'](_0x040d('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x040d('0x8')](),controller[_0x040d('0xf')]);router[_0x040d('0x10')](_0x040d('0xc'),auth[_0x040d('0x8')](),controller['addConfiguration']);router[_0x040d('0x11')](_0x040d('0xa'),auth[_0x040d('0x8')](),controller[_0x040d('0x12')]);router[_0x040d('0x13')](_0x040d('0xa'),auth['isAuthenticated'](),controller[_0x040d('0x14')]);module[_0x040d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index a1e19f1..d9f5af0 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 _0x8603=['remoteUri','exports','STRING'];(function(_0x3dce5c,_0x41c09c){var _0x169d28=function(_0x1898d6){while(--_0x1898d6){_0x3dce5c['push'](_0x3dce5c['shift']());}};_0x169d28(++_0x41c09c);}(_0x8603,0x190));var _0x3860=function(_0x53208e,_0x4a1eb8){_0x53208e=_0x53208e-0x0;var _0xa97d9b=_0x8603[_0x53208e];return _0xa97d9b;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xda2d=['exports','STRING','username'];(function(_0x4de63c,_0x104832){var _0x592333=function(_0x267310){while(--_0x267310){_0x4de63c['push'](_0x4de63c['shift']());}};_0x592333(++_0x104832);}(_0xda2d,0x102));var _0xdda2=function(_0x181782,_0x5a8920){_0x181782=_0x181782-0x0;var _0x14d8ff=_0xda2d[_0x181782];return _0x14d8ff;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xdda2('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 76c7c68..342c5f9 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 _0xa1aa=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','FreshdeskAccount','catch','params','includeAll','find','create','body','update','findOne','FreshdeskConfiguration','getConfigurations','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','capitalize','test','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x232db0,_0x31f501){_0x232db0=_0x232db0-0x0;var _0x332f96=_0xa1aa[_0x232db0];return _0x332f96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa1a('0x0'));var zipdir=require(_0xaa1a('0x1'));var jsonpatch=require(_0xaa1a('0x2'));var rp=require(_0xaa1a('0x3'));var moment=require(_0xaa1a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa1a('0x5'));var path=require(_0xaa1a('0x6'));var sox=require('sox');var csv=require(_0xaa1a('0x7'));var ejs=require(_0xaa1a('0x8'));var fs=require('fs');var fs_extra=require(_0xaa1a('0x9'));var _=require('lodash');var squel=require(_0xaa1a('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa1a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaa1a('0x7'));var querystring=require(_0xaa1a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa1a('0xd'));var qs=require(_0xaa1a('0xe'));var as=require(_0xaa1a('0xf'));var hardwareService=require(_0xaa1a('0x10'));var logger=require('../../config/logger')(_0xaa1a('0x11'));var utils=require(_0xaa1a('0x12'));var config=require(_0xaa1a('0x13'));var licenseUtil=require(_0xaa1a('0x14'));var db=require(_0xaa1a('0x15'))['db'];var integrations=require(_0xaa1a('0x16'));function respondWithStatusCode(_0x25ae41,_0x2f018d){_0x2f018d=_0x2f018d||0xcc;return function(_0x25aea6){if(_0x25aea6){return _0x25ae41[_0xaa1a('0x17')](_0x2f018d);}return _0x25ae41['status'](_0x2f018d)['end']();};}function respondWithResult(_0x38715a,_0x3a577f){_0x3a577f=_0x3a577f||0xc8;return function(_0x268f91){if(_0x268f91){return _0x38715a[_0xaa1a('0x18')](_0x3a577f)[_0xaa1a('0x19')](_0x268f91);}};}function respondWithFilteredResult(_0x5da087,_0x90ef70){return function(_0x480a27){if(_0x480a27){var _0x12153c=typeof _0x90ef70[_0xaa1a('0x1a')]===_0xaa1a('0x1b')&&typeof _0x90ef70[_0xaa1a('0x1c')]==='undefined';var _0x521a8e=_0x480a27[_0xaa1a('0x1d')];var _0xcb3609=_0x12153c?0x0:_0x90ef70['offset'];var _0x33f564=_0x12153c?_0x480a27[_0xaa1a('0x1d')]:_0x90ef70[_0xaa1a('0x1a')]+_0x90ef70[_0xaa1a('0x1c')];var _0x2fe366;if(_0x33f564>=_0x521a8e){_0x33f564=_0x521a8e;_0x2fe366=0xc8;}else{_0x2fe366=0xce;}_0x5da087[_0xaa1a('0x18')](_0x2fe366);return _0x5da087['set'](_0xaa1a('0x1e'),_0xcb3609+'-'+_0x33f564+'/'+_0x521a8e)[_0xaa1a('0x19')](_0x480a27);}return null;};}function patchUpdates(_0x8586aa){return function(_0x3298ed){try{jsonpatch[_0xaa1a('0x1f')](_0x3298ed,_0x8586aa,!![]);}catch(_0x436f94){return BPromise[_0xaa1a('0x20')](_0x436f94);}return _0x3298ed['save']();};}function saveUpdates(_0xa32c54,_0x282f07){return function(_0x1ac174){if(_0x1ac174){return _0x1ac174['update'](_0xa32c54)[_0xaa1a('0x21')](function(_0x15b366){return _0x15b366;});}return null;};}function removeEntity(_0x583c90,_0x4accdf){return function(_0x64fc15){if(_0x64fc15){return _0x64fc15[_0xaa1a('0x22')]()[_0xaa1a('0x21')](function(){_0x583c90[_0xaa1a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a30d0,_0x32f406){return function(_0x5c326e){if(!_0x5c326e){_0x2a30d0[_0xaa1a('0x17')](0x194);}return _0x5c326e;};}function handleError(_0x21144c,_0x29e219){_0x29e219=_0x29e219||0x1f4;return function(_0x5d7191){logger[_0xaa1a('0x23')](_0x5d7191[_0xaa1a('0x24')]);if(_0x5d7191[_0xaa1a('0x25')]){delete _0x5d7191[_0xaa1a('0x25')];}_0x21144c[_0xaa1a('0x18')](_0x29e219)[_0xaa1a('0x26')](_0x5d7191);};}exports[_0xaa1a('0x27')]=function(_0x5291be,_0x4c495f){var _0x5c42d2={},_0xea95b0={},_0x37be5c={'count':0x0,'rows':[]};var _0x29271b=_[_0xaa1a('0x28')](db['FreshdeskAccount'][_0xaa1a('0x29')],function(_0x22ba1d){return{'name':_0x22ba1d[_0xaa1a('0x2a')],'type':_0x22ba1d[_0xaa1a('0x2b')][_0xaa1a('0x2c')]};});_0xea95b0[_0xaa1a('0x2d')]=_[_0xaa1a('0x28')](_0x29271b,_0xaa1a('0x25'));_0xea95b0[_0xaa1a('0x2e')]=_[_0xaa1a('0x2f')](_0x5291be[_0xaa1a('0x2e')]);_0xea95b0[_0xaa1a('0x30')]=_[_0xaa1a('0x31')](_0xea95b0[_0xaa1a('0x2d')],_0xea95b0[_0xaa1a('0x2e')]);_0x5c42d2['attributes']=_['intersection'](_0xea95b0[_0xaa1a('0x2d')],qs['fields'](_0x5291be[_0xaa1a('0x2e')][_0xaa1a('0x32')]));_0x5c42d2[_0xaa1a('0x33')]=_0x5c42d2[_0xaa1a('0x33')][_0xaa1a('0x34')]?_0x5c42d2[_0xaa1a('0x33')]:_0xea95b0['model'];if(!_0x5291be[_0xaa1a('0x2e')][_0xaa1a('0x35')](_0xaa1a('0x36'))){_0x5c42d2[_0xaa1a('0x1c')]=qs[_0xaa1a('0x1c')](_0x5291be[_0xaa1a('0x2e')][_0xaa1a('0x1c')]);_0x5c42d2[_0xaa1a('0x1a')]=qs['offset'](_0x5291be[_0xaa1a('0x2e')][_0xaa1a('0x1a')]);}_0x5c42d2[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x5291be[_0xaa1a('0x2e')][_0xaa1a('0x38')]);_0x5c42d2[_0xaa1a('0x39')]=qs[_0xaa1a('0x30')](_[_0xaa1a('0x3a')](_0x5291be[_0xaa1a('0x2e')],_0xea95b0[_0xaa1a('0x30')]),_0x29271b);if(_0x5291be[_0xaa1a('0x2e')][_0xaa1a('0x3b')]){_0x5c42d2[_0xaa1a('0x39')]=_[_0xaa1a('0x3c')](_0x5c42d2[_0xaa1a('0x39')],{'$or':_['map'](_0x29271b,function(_0x578325){if(_0x578325[_0xaa1a('0x2b')]!==_0xaa1a('0x3d')){var _0x395044={};_0x395044[_0x578325[_0xaa1a('0x25')]]={'$like':'%'+_0x5291be[_0xaa1a('0x2e')][_0xaa1a('0x3b')]+'%'};return _0x395044;}})});}_0x5c42d2=_['merge']({},_0x5c42d2,_0x5291be[_0xaa1a('0x3e')]);var _0x529e82={'where':_0x5c42d2[_0xaa1a('0x39')]};return db['FreshdeskAccount'][_0xaa1a('0x1d')](_0x529e82)[_0xaa1a('0x21')](function(_0x838e30){_0x37be5c[_0xaa1a('0x1d')]=_0x838e30;if(_0x5291be['query']['includeAll']){_0x5c42d2[_0xaa1a('0x3f')]=[{'all':!![]}];}return db[_0xaa1a('0x40')]['findAll'](_0x5c42d2);})[_0xaa1a('0x21')](function(_0xe3a924){_0x37be5c['rows']=_0xe3a924;return _0x37be5c;})['then'](respondWithFilteredResult(_0x4c495f,_0x5c42d2))[_0xaa1a('0x41')](handleError(_0x4c495f,null));};exports['show']=function(_0x27f0ff,_0x252b32){var _0x30011d={'raw':![],'where':{'id':_0x27f0ff[_0xaa1a('0x42')]['id']}},_0x10d387={};_0x10d387[_0xaa1a('0x2d')]=_['keys'](db['FreshdeskAccount']['rawAttributes']);_0x10d387['query']=_[_0xaa1a('0x2f')](_0x27f0ff['query']);_0x10d387[_0xaa1a('0x30')]=_[_0xaa1a('0x31')](_0x10d387[_0xaa1a('0x2d')],_0x10d387[_0xaa1a('0x2e')]);_0x30011d[_0xaa1a('0x33')]=_[_0xaa1a('0x31')](_0x10d387[_0xaa1a('0x2d')],qs[_0xaa1a('0x32')](_0x27f0ff[_0xaa1a('0x2e')][_0xaa1a('0x32')]));_0x30011d[_0xaa1a('0x33')]=_0x30011d['attributes'][_0xaa1a('0x34')]?_0x30011d[_0xaa1a('0x33')]:_0x10d387[_0xaa1a('0x2d')];if(_0x27f0ff['query'][_0xaa1a('0x43')]){_0x30011d['include']=[{'all':!![]}];}_0x30011d=_[_0xaa1a('0x3c')]({},_0x30011d,_0x27f0ff[_0xaa1a('0x3e')]);return db[_0xaa1a('0x40')][_0xaa1a('0x44')](_0x30011d)['then'](handleEntityNotFound(_0x252b32,null))[_0xaa1a('0x21')](respondWithResult(_0x252b32,null))[_0xaa1a('0x41')](handleError(_0x252b32,null));};exports[_0xaa1a('0x45')]=function(_0x37eea0,_0x265c37){return db[_0xaa1a('0x40')][_0xaa1a('0x45')](_0x37eea0[_0xaa1a('0x46')],{})[_0xaa1a('0x21')](respondWithResult(_0x265c37,0xc9))['catch'](handleError(_0x265c37,null));};exports[_0xaa1a('0x47')]=function(_0x4327b9,_0x13f32e){if(_0x4327b9[_0xaa1a('0x46')]['id']){delete _0x4327b9[_0xaa1a('0x46')]['id'];}return db[_0xaa1a('0x40')][_0xaa1a('0x44')]({'where':{'id':_0x4327b9[_0xaa1a('0x42')]['id']}})[_0xaa1a('0x21')](handleEntityNotFound(_0x13f32e,null))[_0xaa1a('0x21')](saveUpdates(_0x4327b9[_0xaa1a('0x46')],null))[_0xaa1a('0x21')](respondWithResult(_0x13f32e,null))[_0xaa1a('0x41')](handleError(_0x13f32e,null));};exports[_0xaa1a('0x22')]=function(_0x4556de,_0x42c5e5){return db[_0xaa1a('0x40')][_0xaa1a('0x44')]({'where':{'id':_0x4556de['params']['id']}})[_0xaa1a('0x21')](handleEntityNotFound(_0x42c5e5,null))[_0xaa1a('0x21')](removeEntity(_0x42c5e5,null))[_0xaa1a('0x41')](handleError(_0x42c5e5,null));};exports['getConfigurations']=function(_0x56a465,_0x6cb05d,_0x5a2aa2){var _0xe34753={};var _0x509774={};var _0x9d5c46;var _0x5bad29;return db[_0xaa1a('0x40')][_0xaa1a('0x48')]({'where':{'id':_0x56a465[_0xaa1a('0x42')]['id']}})[_0xaa1a('0x21')](handleEntityNotFound(_0x6cb05d,null))[_0xaa1a('0x21')](function(_0x4fc334){if(_0x4fc334){_0x9d5c46=_0x4fc334;_0x509774['model']=_['keys'](db[_0xaa1a('0x49')][_0xaa1a('0x29')]);_0x509774[_0xaa1a('0x2e')]=_['keys'](_0x56a465[_0xaa1a('0x2e')]);_0x509774[_0xaa1a('0x30')]=_['intersection'](_0x509774['model'],_0x509774[_0xaa1a('0x2e')]);_0xe34753[_0xaa1a('0x33')]=_[_0xaa1a('0x31')](_0x509774[_0xaa1a('0x2d')],qs[_0xaa1a('0x32')](_0x56a465[_0xaa1a('0x2e')][_0xaa1a('0x32')]));_0xe34753[_0xaa1a('0x33')]=_0xe34753[_0xaa1a('0x33')][_0xaa1a('0x34')]?_0xe34753[_0xaa1a('0x33')]:_0x509774[_0xaa1a('0x2d')];_0xe34753['order']=qs[_0xaa1a('0x38')](_0x56a465['query'][_0xaa1a('0x38')]);_0xe34753[_0xaa1a('0x39')]=qs['filters'](_['pick'](_0x56a465[_0xaa1a('0x2e')],_0x509774['filters']));if(_0x56a465[_0xaa1a('0x2e')][_0xaa1a('0x3b')]){_0xe34753[_0xaa1a('0x39')]=_[_0xaa1a('0x3c')](_0xe34753[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x28')](_0xe34753[_0xaa1a('0x33')],function(_0x37c8fd){var _0x544727={};_0x544727[_0x37c8fd]={'$like':'%'+_0x56a465[_0xaa1a('0x2e')][_0xaa1a('0x3b')]+'%'};return _0x544727;})});}_0xe34753=_['merge']({},_0xe34753,_0x56a465[_0xaa1a('0x3e')]);return _0x9d5c46[_0xaa1a('0x4a')](_0xe34753);}})[_0xaa1a('0x21')](function(_0x27aa45){if(_0x27aa45){_0x5bad29=_0x27aa45[_0xaa1a('0x34')];if(!_0x56a465[_0xaa1a('0x2e')]['hasOwnProperty'](_0xaa1a('0x36'))){_0xe34753[_0xaa1a('0x1c')]=qs[_0xaa1a('0x1c')](_0x56a465['query']['limit']);_0xe34753[_0xaa1a('0x1a')]=qs[_0xaa1a('0x1a')](_0x56a465[_0xaa1a('0x2e')]['offset']);}return _0x9d5c46['getConfigurations'](_0xe34753);}})[_0xaa1a('0x21')](function(_0x37f941){if(_0x37f941){return _0x37f941?{'count':_0x5bad29,'rows':_0x37f941}:null;}})['then'](respondWithResult(_0x6cb05d,null))[_0xaa1a('0x41')](handleError(_0x6cb05d,null));};exports[_0xaa1a('0x4b')]=function(_0x3053ae,_0x1a053e,_0x2b4d8e){if(_0x3053ae[_0xaa1a('0x46')]['id']){delete _0x3053ae['body']['id'];}return db[_0xaa1a('0x40')][_0xaa1a('0x48')]({'where':{'id':_0x3053ae[_0xaa1a('0x42')]['id']}})[_0xaa1a('0x21')](handleEntityNotFound(_0x1a053e,null))[_0xaa1a('0x21')](function(_0x40d6a9){if(_0x40d6a9){_0x3053ae[_0xaa1a('0x46')]['AccountId']=_0x40d6a9['id'];_0x3053ae[_0xaa1a('0x46')]['Subjects']=integrations[_0xaa1a('0x4c')](_0x3053ae[_0xaa1a('0x46')]['channel'],_0x3053ae[_0xaa1a('0x46')][_0xaa1a('0x2b')]);_0x3053ae[_0xaa1a('0x46')][_0xaa1a('0x4d')]=integrations[_0xaa1a('0x4e')](_0x3053ae[_0xaa1a('0x46')][_0xaa1a('0x4f')],_0x3053ae[_0xaa1a('0x46')][_0xaa1a('0x2b')]);return db[_0xaa1a('0x49')][_0xaa1a('0x45')](_0x3053ae[_0xaa1a('0x46')],{'include':[{'model':db[_0xaa1a('0x50')],'as':_0xaa1a('0x51')},{'model':db[_0xaa1a('0x50')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1a053e,null))[_0xaa1a('0x41')](handleError(_0x1a053e,null));};exports[_0xaa1a('0x52')]=function(_0x2d038c,_0x3f48b2,_0xc8ec8c){var _0x17378b='';return db[_0xaa1a('0x40')][_0xaa1a('0x48')]({'where':{'id':_0x2d038c['params']['id']},'attributes':['id',_0xaa1a('0x53'),_0xaa1a('0x54')]})['then'](handleEntityNotFound(_0x3f48b2,null))['then'](function(_0x2dbc56){if(_0x2dbc56){_0x17378b=_0x2dbc56[_0xaa1a('0x53')];var _0x424ec8=_0x17378b[_0xaa1a('0x55')](-0x1);if(_0x424ec8==='/'){_0x17378b=_0x17378b[_0xaa1a('0x56')](0x0,_0x17378b[_0xaa1a('0x57')](_0x424ec8));}return rp({'method':_0xaa1a('0x58'),'uri':util[_0xaa1a('0x59')](_0xaa1a('0x5a'),_0x17378b,_0xaa1a('0x5b')),'headers':{'Authorization':util[_0xaa1a('0x59')](_0xaa1a('0x5c'),new Buffer(util[_0xaa1a('0x59')](_0xaa1a('0x5d'),_0x2dbc56[_0xaa1a('0x54')]))[_0xaa1a('0x5e')](_0xaa1a('0x5f')))},'json':!![]});}})[_0xaa1a('0x21')](function(_0x1ae2c3){if(_0x1ae2c3){var _0x5ef63e=[_0xaa1a('0x60'),_0xaa1a('0x61'),_0xaa1a('0x62'),_0xaa1a('0x63'),'status',_0xaa1a('0x64'),_0xaa1a('0x65'),_0xaa1a('0x66'),_0xaa1a('0x67'),_0xaa1a('0x65'),_0xaa1a('0x68')];_[_0xaa1a('0x69')](_0x1ae2c3,function(_0x3a1de4){return _0x5ef63e[_0xaa1a('0x6a')](_0x3a1de4['name'])||!_0x3a1de4[_0xaa1a('0x6b')]&&_0x3a1de4[_0xaa1a('0x2b')]!=='custom_text'&&_0x3a1de4['type']!==_0xaa1a('0x6c');});return{'count':_0x1ae2c3[_0xaa1a('0x34')],'rows':_[_0xaa1a('0x28')](_0x1ae2c3,function(_0x3dfdfd){return{'id':_0x3dfdfd[_0xaa1a('0x25')],'name':_0x3dfdfd[_0xaa1a('0x6d')],'custom':!_0x3dfdfd[_0xaa1a('0x6b')],'options':_0x3dfdfd['choices']?_[_0xaa1a('0x28')](_0x3dfdfd['choices'],function(_0x1c7fbb){return{'name':_[_0xaa1a('0x6e')](_0x1c7fbb),'value':_0x1c7fbb};}):[]};})};}})['then'](respondWithResult(_0x3f48b2,null))['catch'](function(_0x508d8e){var _0x1c2286=_0x2d038c['query'][_0xaa1a('0x6f')]?0x1f4:_0x508d8e['statusCode']||0x1f4;logger[_0xaa1a('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xaa1a('0x52'),_0x1c2286,JSON[_0xaa1a('0x70')](_0x508d8e));delete _0x508d8e[_0xaa1a('0x25')];if(_0x1c2286===0x191){_0x1c2286=0x190;}_0x3f48b2['status'](_0x1c2286)['send'](_0x2d038c[_0xaa1a('0x2e')][_0xaa1a('0x6f')]?{'message':_0xaa1a('0x71'),'statusCode':_0x508d8e[_0xaa1a('0x72')]}:_0x508d8e);});}; \ No newline at end of file +var _0x0f73=['ticket_type','remove','includes','custom_dropdown','label','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','destroy','then','end','error','name','send','map','FreshdeskAccount','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','update','params','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','GET','format','%s/%s','Basic\x20%s','toString','base64','subject','agent','description','priority','group'];(function(_0x463943,_0xdf7201){var _0x27a3dd=function(_0x33426e){while(--_0x33426e){_0x463943['push'](_0x463943['shift']());}};_0x27a3dd(++_0xdf7201);}(_0x0f73,0x146));var _0x30f7=function(_0x7a3fff,_0x19e65d){_0x7a3fff=_0x7a3fff-0x0;var _0x1edfa7=_0x0f73[_0x7a3fff];return _0x1edfa7;};'use strict';var emlformat=require(_0x30f7('0x0'));var rimraf=require(_0x30f7('0x1'));var zipdir=require(_0x30f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x30f7('0x3'));var BPromise=require(_0x30f7('0x4'));var Mustache=require(_0x30f7('0x5'));var util=require(_0x30f7('0x6'));var path=require(_0x30f7('0x7'));var sox=require('sox');var csv=require(_0x30f7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30f7('0x9'));var squel=require(_0x30f7('0xa'));var crypto=require(_0x30f7('0xb'));var jsforce=require(_0x30f7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x30f7('0x8'));var querystring=require(_0x30f7('0xd'));var Papa=require('papaparse');var Redis=require(_0x30f7('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x30f7('0xf'));var hardwareService=require(_0x30f7('0x10'));var logger=require(_0x30f7('0x11'))(_0x30f7('0x12'));var utils=require('../../config/utils');var config=require(_0x30f7('0x13'));var licenseUtil=require(_0x30f7('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x30f7('0x15'));function respondWithStatusCode(_0x7b4cd1,_0xb9752c){_0xb9752c=_0xb9752c||0xcc;return function(_0x5a2223){if(_0x5a2223){return _0x7b4cd1[_0x30f7('0x16')](_0xb9752c);}return _0x7b4cd1[_0x30f7('0x17')](_0xb9752c)['end']();};}function respondWithResult(_0x1ad086,_0xfc31c5){_0xfc31c5=_0xfc31c5||0xc8;return function(_0x383a7f){if(_0x383a7f){return _0x1ad086[_0x30f7('0x17')](_0xfc31c5)[_0x30f7('0x18')](_0x383a7f);}};}function respondWithFilteredResult(_0x579e7a,_0x49fccb){return function(_0x401f9e){if(_0x401f9e){var _0x9861c3=typeof _0x49fccb[_0x30f7('0x19')]===_0x30f7('0x1a')&&typeof _0x49fccb['limit']===_0x30f7('0x1a');var _0x5210cc=_0x401f9e[_0x30f7('0x1b')];var _0x1083e3=_0x9861c3?0x0:_0x49fccb[_0x30f7('0x19')];var _0x21f3d1=_0x9861c3?_0x401f9e[_0x30f7('0x1b')]:_0x49fccb[_0x30f7('0x19')]+_0x49fccb[_0x30f7('0x1c')];var _0x4d2d8d;if(_0x21f3d1>=_0x5210cc){_0x21f3d1=_0x5210cc;_0x4d2d8d=0xc8;}else{_0x4d2d8d=0xce;}_0x579e7a[_0x30f7('0x17')](_0x4d2d8d);return _0x579e7a[_0x30f7('0x1d')](_0x30f7('0x1e'),_0x1083e3+'-'+_0x21f3d1+'/'+_0x5210cc)[_0x30f7('0x18')](_0x401f9e);}return null;};}function patchUpdates(_0x37d7d5){return function(_0x3380e1){try{jsonpatch['apply'](_0x3380e1,_0x37d7d5,!![]);}catch(_0x9dfa89){return BPromise[_0x30f7('0x1f')](_0x9dfa89);}return _0x3380e1['save']();};}function saveUpdates(_0x570d52,_0x12d3f2){return function(_0x57d2ee){if(_0x57d2ee){return _0x57d2ee['update'](_0x570d52)['then'](function(_0x1bfc45){return _0x1bfc45;});}return null;};}function removeEntity(_0x261116,_0x4c686d){return function(_0x4b77ec){if(_0x4b77ec){return _0x4b77ec[_0x30f7('0x20')]()[_0x30f7('0x21')](function(){_0x261116['status'](0xcc)[_0x30f7('0x22')]();});}};}function handleEntityNotFound(_0x3bb297,_0x14429e){return function(_0x583496){if(!_0x583496){_0x3bb297[_0x30f7('0x16')](0x194);}return _0x583496;};}function handleError(_0x4407ed,_0x540caf){_0x540caf=_0x540caf||0x1f4;return function(_0x2f6443){logger[_0x30f7('0x23')](_0x2f6443['stack']);if(_0x2f6443[_0x30f7('0x24')]){delete _0x2f6443[_0x30f7('0x24')];}_0x4407ed['status'](_0x540caf)[_0x30f7('0x25')](_0x2f6443);};}exports['index']=function(_0x2ec3b9,_0x371258){var _0x21bb2a={},_0x1e2b16={},_0xbd53d={'count':0x0,'rows':[]};var _0x518e02=_[_0x30f7('0x26')](db[_0x30f7('0x27')][_0x30f7('0x28')],function(_0x3e26f3){return{'name':_0x3e26f3['fieldName'],'type':_0x3e26f3[_0x30f7('0x29')]['key']};});_0x1e2b16[_0x30f7('0x2a')]=_['map'](_0x518e02,_0x30f7('0x24'));_0x1e2b16[_0x30f7('0x2b')]=_[_0x30f7('0x2c')](_0x2ec3b9[_0x30f7('0x2b')]);_0x1e2b16['filters']=_['intersection'](_0x1e2b16[_0x30f7('0x2a')],_0x1e2b16[_0x30f7('0x2b')]);_0x21bb2a[_0x30f7('0x2d')]=_[_0x30f7('0x2e')](_0x1e2b16['model'],qs[_0x30f7('0x2f')](_0x2ec3b9[_0x30f7('0x2b')][_0x30f7('0x2f')]));_0x21bb2a[_0x30f7('0x2d')]=_0x21bb2a[_0x30f7('0x2d')][_0x30f7('0x30')]?_0x21bb2a[_0x30f7('0x2d')]:_0x1e2b16[_0x30f7('0x2a')];if(!_0x2ec3b9[_0x30f7('0x2b')]['hasOwnProperty'](_0x30f7('0x31'))){_0x21bb2a[_0x30f7('0x1c')]=qs[_0x30f7('0x1c')](_0x2ec3b9[_0x30f7('0x2b')]['limit']);_0x21bb2a[_0x30f7('0x19')]=qs[_0x30f7('0x19')](_0x2ec3b9[_0x30f7('0x2b')]['offset']);}_0x21bb2a[_0x30f7('0x32')]=qs[_0x30f7('0x33')](_0x2ec3b9[_0x30f7('0x2b')][_0x30f7('0x33')]);_0x21bb2a[_0x30f7('0x34')]=qs[_0x30f7('0x35')](_[_0x30f7('0x36')](_0x2ec3b9[_0x30f7('0x2b')],_0x1e2b16['filters']),_0x518e02);if(_0x2ec3b9[_0x30f7('0x2b')][_0x30f7('0x37')]){_0x21bb2a['where']=_[_0x30f7('0x38')](_0x21bb2a[_0x30f7('0x34')],{'$or':_[_0x30f7('0x26')](_0x518e02,function(_0x36700d){if(_0x36700d[_0x30f7('0x29')]!==_0x30f7('0x39')){var _0x416718={};_0x416718[_0x36700d[_0x30f7('0x24')]]={'$like':'%'+_0x2ec3b9[_0x30f7('0x2b')][_0x30f7('0x37')]+'%'};return _0x416718;}})});}_0x21bb2a=_[_0x30f7('0x38')]({},_0x21bb2a,_0x2ec3b9[_0x30f7('0x3a')]);var _0x440103={'where':_0x21bb2a[_0x30f7('0x34')]};return db[_0x30f7('0x27')]['count'](_0x440103)[_0x30f7('0x21')](function(_0x4ac209){_0xbd53d['count']=_0x4ac209;if(_0x2ec3b9['query'][_0x30f7('0x3b')]){_0x21bb2a[_0x30f7('0x3c')]=[{'all':!![]}];}return db[_0x30f7('0x27')][_0x30f7('0x3d')](_0x21bb2a);})[_0x30f7('0x21')](function(_0x2f581b){_0xbd53d['rows']=_0x2f581b;return _0xbd53d;})[_0x30f7('0x21')](respondWithFilteredResult(_0x371258,_0x21bb2a))[_0x30f7('0x3e')](handleError(_0x371258,null));};exports['show']=function(_0x480a8f,_0x4ac14f){var _0x5194c7={'raw':![],'where':{'id':_0x480a8f['params']['id']}},_0x43f19a={};_0x43f19a[_0x30f7('0x2a')]=_[_0x30f7('0x2c')](db[_0x30f7('0x27')]['rawAttributes']);_0x43f19a[_0x30f7('0x2b')]=_[_0x30f7('0x2c')](_0x480a8f[_0x30f7('0x2b')]);_0x43f19a[_0x30f7('0x35')]=_[_0x30f7('0x2e')](_0x43f19a[_0x30f7('0x2a')],_0x43f19a['query']);_0x5194c7['attributes']=_[_0x30f7('0x2e')](_0x43f19a[_0x30f7('0x2a')],qs[_0x30f7('0x2f')](_0x480a8f[_0x30f7('0x2b')]['fields']));_0x5194c7[_0x30f7('0x2d')]=_0x5194c7[_0x30f7('0x2d')][_0x30f7('0x30')]?_0x5194c7['attributes']:_0x43f19a['model'];if(_0x480a8f[_0x30f7('0x2b')][_0x30f7('0x3b')]){_0x5194c7['include']=[{'all':!![]}];}_0x5194c7=_[_0x30f7('0x38')]({},_0x5194c7,_0x480a8f['options']);return db[_0x30f7('0x27')][_0x30f7('0x3f')](_0x5194c7)[_0x30f7('0x21')](handleEntityNotFound(_0x4ac14f,null))[_0x30f7('0x21')](respondWithResult(_0x4ac14f,null))[_0x30f7('0x3e')](handleError(_0x4ac14f,null));};exports[_0x30f7('0x40')]=function(_0x107c72,_0x267583){return db[_0x30f7('0x27')][_0x30f7('0x40')](_0x107c72[_0x30f7('0x41')],{})[_0x30f7('0x21')](respondWithResult(_0x267583,0xc9))[_0x30f7('0x3e')](handleError(_0x267583,null));};exports[_0x30f7('0x42')]=function(_0x1c18af,_0x44b0d2){if(_0x1c18af[_0x30f7('0x41')]['id']){delete _0x1c18af[_0x30f7('0x41')]['id'];}return db[_0x30f7('0x27')][_0x30f7('0x3f')]({'where':{'id':_0x1c18af[_0x30f7('0x43')]['id']}})['then'](handleEntityNotFound(_0x44b0d2,null))[_0x30f7('0x21')](saveUpdates(_0x1c18af[_0x30f7('0x41')],null))[_0x30f7('0x21')](respondWithResult(_0x44b0d2,null))[_0x30f7('0x3e')](handleError(_0x44b0d2,null));};exports[_0x30f7('0x20')]=function(_0x1908b8,_0x26377e){return db[_0x30f7('0x27')][_0x30f7('0x3f')]({'where':{'id':_0x1908b8[_0x30f7('0x43')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x26377e,null))[_0x30f7('0x21')](removeEntity(_0x26377e,null))['catch'](handleError(_0x26377e,null));};exports[_0x30f7('0x44')]=function(_0x4bd1d1,_0x288048,_0x213d9b){var _0x9aa62b={};var _0x557854={};var _0x155fbc;var _0x9fc9f;return db[_0x30f7('0x27')]['findOne']({'where':{'id':_0x4bd1d1['params']['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x288048,null))[_0x30f7('0x21')](function(_0x5d023f){if(_0x5d023f){_0x155fbc=_0x5d023f;_0x557854['model']=_[_0x30f7('0x2c')](db[_0x30f7('0x45')]['rawAttributes']);_0x557854[_0x30f7('0x2b')]=_[_0x30f7('0x2c')](_0x4bd1d1[_0x30f7('0x2b')]);_0x557854[_0x30f7('0x35')]=_[_0x30f7('0x2e')](_0x557854[_0x30f7('0x2a')],_0x557854[_0x30f7('0x2b')]);_0x9aa62b[_0x30f7('0x2d')]=_[_0x30f7('0x2e')](_0x557854[_0x30f7('0x2a')],qs['fields'](_0x4bd1d1[_0x30f7('0x2b')]['fields']));_0x9aa62b[_0x30f7('0x2d')]=_0x9aa62b[_0x30f7('0x2d')][_0x30f7('0x30')]?_0x9aa62b[_0x30f7('0x2d')]:_0x557854[_0x30f7('0x2a')];_0x9aa62b[_0x30f7('0x32')]=qs['sort'](_0x4bd1d1[_0x30f7('0x2b')][_0x30f7('0x33')]);_0x9aa62b['where']=qs['filters'](_[_0x30f7('0x36')](_0x4bd1d1[_0x30f7('0x2b')],_0x557854[_0x30f7('0x35')]));if(_0x4bd1d1[_0x30f7('0x2b')][_0x30f7('0x37')]){_0x9aa62b[_0x30f7('0x34')]=_[_0x30f7('0x38')](_0x9aa62b[_0x30f7('0x34')],{'$or':_[_0x30f7('0x26')](_0x9aa62b[_0x30f7('0x2d')],function(_0x371de8){var _0x7d6056={};_0x7d6056[_0x371de8]={'$like':'%'+_0x4bd1d1[_0x30f7('0x2b')][_0x30f7('0x37')]+'%'};return _0x7d6056;})});}_0x9aa62b=_[_0x30f7('0x38')]({},_0x9aa62b,_0x4bd1d1[_0x30f7('0x3a')]);return _0x155fbc[_0x30f7('0x44')](_0x9aa62b);}})[_0x30f7('0x21')](function(_0x72f8e){if(_0x72f8e){_0x9fc9f=_0x72f8e[_0x30f7('0x30')];if(!_0x4bd1d1['query'][_0x30f7('0x46')](_0x30f7('0x31'))){_0x9aa62b[_0x30f7('0x1c')]=qs[_0x30f7('0x1c')](_0x4bd1d1['query']['limit']);_0x9aa62b[_0x30f7('0x19')]=qs['offset'](_0x4bd1d1[_0x30f7('0x2b')][_0x30f7('0x19')]);}return _0x155fbc[_0x30f7('0x44')](_0x9aa62b);}})['then'](function(_0x371d8c){if(_0x371d8c){return _0x371d8c?{'count':_0x9fc9f,'rows':_0x371d8c}:null;}})['then'](respondWithResult(_0x288048,null))[_0x30f7('0x3e')](handleError(_0x288048,null));};exports[_0x30f7('0x47')]=function(_0x25f7cb,_0x58e161,_0x2608b4){if(_0x25f7cb[_0x30f7('0x41')]['id']){delete _0x25f7cb[_0x30f7('0x41')]['id'];}return db[_0x30f7('0x27')][_0x30f7('0x48')]({'where':{'id':_0x25f7cb[_0x30f7('0x43')]['id']}})['then'](handleEntityNotFound(_0x58e161,null))[_0x30f7('0x21')](function(_0x2cd21a){if(_0x2cd21a){_0x25f7cb['body'][_0x30f7('0x49')]=_0x2cd21a['id'];_0x25f7cb[_0x30f7('0x41')][_0x30f7('0x4a')]=integrations[_0x30f7('0x4b')](_0x25f7cb[_0x30f7('0x41')]['channel'],_0x25f7cb[_0x30f7('0x41')][_0x30f7('0x29')]);_0x25f7cb['body'][_0x30f7('0x4c')]=integrations[_0x30f7('0x4d')](_0x25f7cb[_0x30f7('0x41')]['channel'],_0x25f7cb[_0x30f7('0x41')][_0x30f7('0x29')]);return db[_0x30f7('0x45')]['create'](_0x25f7cb[_0x30f7('0x41')],{'include':[{'model':db[_0x30f7('0x4e')],'as':_0x30f7('0x4a')},{'model':db['FreshdeskField'],'as':_0x30f7('0x4c')}]});}return null;})[_0x30f7('0x21')](respondWithResult(_0x58e161,null))[_0x30f7('0x3e')](handleError(_0x58e161,null));};exports['getFields']=function(_0x49d879,_0x1bd8dd,_0x38eb7d){var _0x381499='';return db[_0x30f7('0x27')][_0x30f7('0x48')]({'where':{'id':_0x49d879[_0x30f7('0x43')]['id']},'attributes':['id',_0x30f7('0x4f'),_0x30f7('0x50')]})[_0x30f7('0x21')](handleEntityNotFound(_0x1bd8dd,null))[_0x30f7('0x21')](function(_0x4933d6){if(_0x4933d6){_0x381499=_0x4933d6['remoteUri'];var _0x41ab6f=_0x381499[_0x30f7('0x51')](-0x1);if(_0x41ab6f==='/'){_0x381499=_0x381499[_0x30f7('0x52')](0x0,_0x381499['lastIndexOf'](_0x41ab6f));}return rp({'method':_0x30f7('0x53'),'uri':util[_0x30f7('0x54')](_0x30f7('0x55'),_0x381499,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x30f7('0x54')](_0x30f7('0x56'),new Buffer(util['format']('%s:X',_0x4933d6[_0x30f7('0x50')]))[_0x30f7('0x57')](_0x30f7('0x58')))},'json':!![]});}})[_0x30f7('0x21')](function(_0x521657){if(_0x521657){var _0x3a52d5=['requester',_0x30f7('0x59'),_0x30f7('0x5a'),_0x30f7('0x5b'),'status',_0x30f7('0x5c'),_0x30f7('0x5d'),'source',_0x30f7('0x5e'),'group','company'];_[_0x30f7('0x5f')](_0x521657,function(_0x65c52e){return _0x3a52d5[_0x30f7('0x60')](_0x65c52e[_0x30f7('0x24')])||!_0x65c52e['default']&&_0x65c52e['type']!=='custom_text'&&_0x65c52e[_0x30f7('0x29')]!==_0x30f7('0x61');});return{'count':_0x521657[_0x30f7('0x30')],'rows':_[_0x30f7('0x26')](_0x521657,function(_0x503578){return{'id':_0x503578[_0x30f7('0x24')],'name':_0x503578[_0x30f7('0x62')],'custom':!_0x503578['default'],'options':_0x503578[_0x30f7('0x63')]?_['map'](_0x503578['choices'],function(_0xb9a70f){return{'name':_[_0x30f7('0x64')](_0xb9a70f),'value':_0xb9a70f};}):[]};})};}})[_0x30f7('0x21')](respondWithResult(_0x1bd8dd,null))[_0x30f7('0x3e')](function(_0x3b9706){var _0x5cf0f6=_0x49d879['query'][_0x30f7('0x65')]?0x1f4:_0x3b9706['statusCode']||0x1f4;logger[_0x30f7('0x23')](_0x30f7('0x66'),'getFields',_0x5cf0f6,JSON[_0x30f7('0x67')](_0x3b9706));delete _0x3b9706['name'];if(_0x5cf0f6===0x191){_0x5cf0f6=0x190;}_0x1bd8dd[_0x30f7('0x17')](_0x5cf0f6)[_0x30f7('0x25')](_0x49d879[_0x30f7('0x2b')][_0x30f7('0x65')]?{'message':'Wrong\x20credentials','statusCode':_0x3b9706[_0x30f7('0x68')]}:_0x3b9706);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index bdca0e6..ff7e792 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 _0x3b0d=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x1e2ad5,_0x338ccd){var _0x1772a7=function(_0x7737b7){while(--_0x7737b7){_0x1e2ad5['push'](_0x1e2ad5['shift']());}};_0x1772a7(++_0x338ccd);}(_0x3b0d,0xff));var _0xd3b0=function(_0x2b76dc,_0x3ddb93){_0x2b76dc=_0x2b76dc-0x0;var _0x4ee7eb=_0x3b0d[_0x2b76dc];return _0x4ee7eb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd3b0('0x0'))('api');var moment=require(_0xd3b0('0x1'));var BPromise=require('bluebird');var rp=require(_0xd3b0('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3b0('0x3'));var config=require(_0xd3b0('0x4'));var attributes=require(_0xd3b0('0x5'));var integrations=require(_0xd3b0('0x6'));module[_0xd3b0('0x7')]=function(_0x5eae32,_0x4d3bcd){return _0x5eae32[_0xd3b0('0x8')](_0xd3b0('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1dcf=['int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount'];(function(_0x36e9a8,_0x3b48e7){var _0x5a85a7=function(_0x35ba12){while(--_0x35ba12){_0x36e9a8['push'](_0x36e9a8['shift']());}};_0x5a85a7(++_0x3b48e7);}(_0x1dcf,0x83));var _0xf1dc=function(_0x547a87,_0x4d4e24){_0x547a87=_0x547a87-0x0;var _0x11fde1=_0x1dcf[_0x547a87];return _0x11fde1;};'use strict';var _=require(_0xf1dc('0x0'));var util=require('util');var logger=require(_0xf1dc('0x1'))(_0xf1dc('0x2'));var moment=require(_0xf1dc('0x3'));var BPromise=require(_0xf1dc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1dc('0x5'));var rimraf=require(_0xf1dc('0x6'));var config=require(_0xf1dc('0x7'));var attributes=require(_0xf1dc('0x8'));var integrations=require(_0xf1dc('0x9'));module['exports']=function(_0x5db781,_0x30f6d0){return _0x5db781[_0xf1dc('0xa')](_0xf1dc('0xb'),attributes,{'tableName':_0xf1dc('0xc'),'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 0d36928..d9480e6 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 _0xaba6=['attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','raw','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FreshdeskAccount','options','where'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0xaba6,0xe2));var _0x6aba=function(_0x3231ee,_0x44e1ef){_0x3231ee=_0x3231ee-0x0;var _0x2092f1=_0xaba6[_0x3231ee];return _0x2092f1;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6aba('0x2'))['db'];var utils=require(_0x6aba('0x3'));var logger=require('../../config/logger')(_0x6aba('0x4'));var config=require(_0x6aba('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39c32a,_0x54416a,_0x3766d4){return new BPromise(function(_0x1a4fbc,_0x508dff){return client[_0x6aba('0x6')](_0x39c32a,_0x3766d4)[_0x6aba('0x7')](function(_0x4ea8eb){logger[_0x6aba('0x8')](_0x6aba('0x9'),_0x54416a,_0x6aba('0xa'));logger[_0x6aba('0xb')](_0x6aba('0xc'),_0x54416a,_0x6aba('0xa'),JSON[_0x6aba('0xd')](_0x4ea8eb));if(_0x4ea8eb['error']){if(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0xf')]===0x1f4){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb['error'][_0x6aba('0x10')]);return _0x508dff(_0x4ea8eb[_0x6aba('0xe')]['message']);}logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb[_0x6aba('0xe')]['message']);return _0x1a4fbc(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0x10')]);}else{logger[_0x6aba('0x8')]('FreshdeskAccount,\x20%s,\x20%s',_0x54416a,_0x6aba('0xa'));_0x1a4fbc(_0x4ea8eb[_0x6aba('0x11')][_0x6aba('0x10')]);}})[_0x6aba('0x12')](function(_0x379b17){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x379b17);_0x508dff(_0x379b17);});});}exports['GetFreshdeskAccount']=function(_0x2291d7){var _0x448f29=this;return new Promise(function(_0x1c2efe,_0x5ca5b2){return db[_0x6aba('0x13')]['findAll']({'raw':_0x2291d7['options']?_0x2291d7[_0x6aba('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2291d7[_0x6aba('0x14')]?_0x2291d7[_0x6aba('0x14')][_0x6aba('0x15')]||null:null,'attributes':_0x2291d7[_0x6aba('0x14')]?_0x2291d7[_0x6aba('0x14')][_0x6aba('0x16')]||null:null,'limit':_0x2291d7[_0x6aba('0x14')]?_0x2291d7['options'][_0x6aba('0x17')]||null:null,'include':_0x2291d7[_0x6aba('0x14')]?_0x2291d7[_0x6aba('0x14')][_0x6aba('0x18')]?_[_0x6aba('0x19')](_0x2291d7[_0x6aba('0x14')][_0x6aba('0x18')],function(_0x67ba6e){return{'model':db[_0x67ba6e[_0x6aba('0x1a')]],'as':_0x67ba6e['as'],'attributes':_0x67ba6e[_0x6aba('0x16')],'include':_0x67ba6e[_0x6aba('0x18')]?_[_0x6aba('0x19')](_0x67ba6e[_0x6aba('0x18')],function(_0x3aafa3){return{'model':db[_0x3aafa3[_0x6aba('0x1a')]],'as':_0x3aafa3['as'],'attributes':_0x3aafa3[_0x6aba('0x16')],'include':_0x3aafa3[_0x6aba('0x18')]?_[_0x6aba('0x19')](_0x3aafa3[_0x6aba('0x18')],function(_0x5dc72b){return{'model':db[_0x5dc72b['model']],'as':_0x5dc72b['as'],'attributes':_0x5dc72b[_0x6aba('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30ecf9){logger[_0x6aba('0x8')](_0x6aba('0x1b'),_0x2291d7);logger[_0x6aba('0xb')]('GetFreshdeskAccount',_0x2291d7,JSON[_0x6aba('0xd')](_0x30ecf9));_0x1c2efe(_0x30ecf9);})[_0x6aba('0x12')](function(_0x338702){logger[_0x6aba('0xe')](_0x6aba('0x1b'),_0x338702['message'],_0x2291d7);_0x5ca5b2(_0x448f29[_0x6aba('0xe')](0x1f4,_0x338702['message']));});});};exports[_0x6aba('0x1c')]=function(_0x3fd125){var _0x54e780=this;return new Promise(function(_0x4d601a,_0x202a81){return db[_0x6aba('0x13')][_0x6aba('0x1d')]({'raw':_0x3fd125[_0x6aba('0x14')]?_0x3fd125[_0x6aba('0x14')][_0x6aba('0x1e')]===undefined?!![]:![]:!![],'where':_0x3fd125[_0x6aba('0x14')]?_0x3fd125['options'][_0x6aba('0x15')]||null:null,'attributes':_0x3fd125[_0x6aba('0x14')]?_0x3fd125[_0x6aba('0x14')]['attributes']||null:null,'include':_0x3fd125[_0x6aba('0x14')]?_0x3fd125[_0x6aba('0x14')][_0x6aba('0x18')]?_['map'](_0x3fd125[_0x6aba('0x14')][_0x6aba('0x18')],function(_0x5a2594){return{'model':db[_0x5a2594[_0x6aba('0x1a')]],'as':_0x5a2594['as'],'attributes':_0x5a2594['attributes'],'include':_0x5a2594[_0x6aba('0x18')]?_['map'](_0x5a2594[_0x6aba('0x18')],function(_0x28c62a){return{'model':db[_0x28c62a['model']],'as':_0x28c62a['as'],'attributes':_0x28c62a['attributes'],'include':_0x28c62a[_0x6aba('0x18')]?_['map'](_0x28c62a[_0x6aba('0x18')],function(_0x11c9f6){return{'model':db[_0x11c9f6['model']],'as':_0x11c9f6['as'],'attributes':_0x11c9f6[_0x6aba('0x16')]};}):[]};}):[]};}):[]:[]})[_0x6aba('0x7')](function(_0x23d34a){logger[_0x6aba('0x8')](_0x6aba('0x1c'),_0x3fd125);logger[_0x6aba('0xb')](_0x6aba('0x1c'),_0x3fd125,JSON['stringify'](_0x23d34a));_0x4d601a(_0x23d34a);})['catch'](function(_0x3250a5){logger['error'](_0x6aba('0x1c'),_0x3250a5[_0x6aba('0x10')],_0x3fd125);_0x202a81(_0x54e780[_0x6aba('0xe')](0x1f4,_0x3250a5['message']));});});}; \ No newline at end of file +var _0xe8cf=['result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','FreshdeskAccount','ShowFreshdeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3bee3d,_0x55d61d){var _0x2c4287=function(_0x47cb08){while(--_0x47cb08){_0x3bee3d['push'](_0x3bee3d['shift']());}};_0x2c4287(++_0x55d61d);}(_0xe8cf,0x16e));var _0xfe8c=function(_0x4670df,_0x433288){_0x4670df=_0x4670df-0x0;var _0x326082=_0xe8cf[_0x4670df];return _0x326082;};'use strict';var _=require('lodash');var util=require(_0xfe8c('0x0'));var moment=require(_0xfe8c('0x1'));var BPromise=require(_0xfe8c('0x2'));var rs=require(_0xfe8c('0x3'));var fs=require('fs');var Redis=require(_0xfe8c('0x4'));var db=require(_0xfe8c('0x5'))['db'];var utils=require(_0xfe8c('0x6'));var logger=require(_0xfe8c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe8c('0x8'));var client=jayson['client'][_0xfe8c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f726,_0x37fd04,_0x4c490e){return new BPromise(function(_0x5c9007,_0x135035){return client[_0xfe8c('0xa')](_0x26f726,_0x4c490e)['then'](function(_0x598691){logger[_0xfe8c('0xb')](_0xfe8c('0xc'),_0x37fd04,'request\x20sent');logger['debug'](_0xfe8c('0xd'),_0x37fd04,_0xfe8c('0xe'),JSON[_0xfe8c('0xf')](_0x598691));if(_0x598691[_0xfe8c('0x10')]){if(_0x598691['error'][_0xfe8c('0x11')]===0x1f4){logger[_0xfe8c('0x10')](_0xfe8c('0xc'),_0x37fd04,_0x598691[_0xfe8c('0x10')][_0xfe8c('0x12')]);return _0x135035(_0x598691['error'][_0xfe8c('0x12')]);}logger[_0xfe8c('0x10')](_0xfe8c('0xc'),_0x37fd04,_0x598691[_0xfe8c('0x10')][_0xfe8c('0x12')]);return _0x5c9007(_0x598691[_0xfe8c('0x10')][_0xfe8c('0x12')]);}else{logger[_0xfe8c('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x37fd04,_0xfe8c('0xe'));_0x5c9007(_0x598691[_0xfe8c('0x13')]['message']);}})[_0xfe8c('0x14')](function(_0x169952){logger[_0xfe8c('0x10')](_0xfe8c('0xc'),_0x37fd04,_0x169952);_0x135035(_0x169952);});});}exports[_0xfe8c('0x15')]=function(_0x45dea0){var _0x483cc5=this;return new Promise(function(_0xae3043,_0x35d0ed){return db['FreshdeskAccount'][_0xfe8c('0x16')]({'raw':_0x45dea0[_0xfe8c('0x17')]?_0x45dea0[_0xfe8c('0x17')][_0xfe8c('0x18')]===undefined?!![]:![]:!![],'where':_0x45dea0[_0xfe8c('0x17')]?_0x45dea0[_0xfe8c('0x17')][_0xfe8c('0x19')]||null:null,'attributes':_0x45dea0[_0xfe8c('0x17')]?_0x45dea0[_0xfe8c('0x17')][_0xfe8c('0x1a')]||null:null,'limit':_0x45dea0[_0xfe8c('0x17')]?_0x45dea0[_0xfe8c('0x17')][_0xfe8c('0x1b')]||null:null,'include':_0x45dea0[_0xfe8c('0x17')]?_0x45dea0['options'][_0xfe8c('0x1c')]?_[_0xfe8c('0x1d')](_0x45dea0['options']['include'],function(_0x27987e){return{'model':db[_0x27987e['model']],'as':_0x27987e['as'],'attributes':_0x27987e[_0xfe8c('0x1a')],'include':_0x27987e[_0xfe8c('0x1c')]?_[_0xfe8c('0x1d')](_0x27987e['include'],function(_0x1e35fe){return{'model':db[_0x1e35fe[_0xfe8c('0x1e')]],'as':_0x1e35fe['as'],'attributes':_0x1e35fe['attributes'],'include':_0x1e35fe[_0xfe8c('0x1c')]?_['map'](_0x1e35fe['include'],function(_0x25d898){return{'model':db[_0x25d898[_0xfe8c('0x1e')]],'as':_0x25d898['as'],'attributes':_0x25d898[_0xfe8c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfe8c('0x1f')](function(_0x2bf732){logger[_0xfe8c('0xb')](_0xfe8c('0x15'),_0x45dea0);logger[_0xfe8c('0x20')](_0xfe8c('0x15'),_0x45dea0,JSON[_0xfe8c('0xf')](_0x2bf732));_0xae3043(_0x2bf732);})['catch'](function(_0x118032){logger[_0xfe8c('0x10')]('GetFreshdeskAccount',_0x118032['message'],_0x45dea0);_0x35d0ed(_0x483cc5['error'](0x1f4,_0x118032[_0xfe8c('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0xd588c8){var _0x27b7cb=this;return new Promise(function(_0x3575dd,_0xdd9c9a){return db[_0xfe8c('0x21')]['find']({'raw':_0xd588c8[_0xfe8c('0x17')]?_0xd588c8['options']['raw']===undefined?!![]:![]:!![],'where':_0xd588c8[_0xfe8c('0x17')]?_0xd588c8[_0xfe8c('0x17')][_0xfe8c('0x19')]||null:null,'attributes':_0xd588c8[_0xfe8c('0x17')]?_0xd588c8[_0xfe8c('0x17')]['attributes']||null:null,'include':_0xd588c8['options']?_0xd588c8[_0xfe8c('0x17')][_0xfe8c('0x1c')]?_[_0xfe8c('0x1d')](_0xd588c8[_0xfe8c('0x17')][_0xfe8c('0x1c')],function(_0x440f19){return{'model':db[_0x440f19['model']],'as':_0x440f19['as'],'attributes':_0x440f19['attributes'],'include':_0x440f19[_0xfe8c('0x1c')]?_[_0xfe8c('0x1d')](_0x440f19[_0xfe8c('0x1c')],function(_0x4936b3){return{'model':db[_0x4936b3['model']],'as':_0x4936b3['as'],'attributes':_0x4936b3[_0xfe8c('0x1a')],'include':_0x4936b3[_0xfe8c('0x1c')]?_[_0xfe8c('0x1d')](_0x4936b3[_0xfe8c('0x1c')],function(_0x2a4b8c){return{'model':db[_0x2a4b8c['model']],'as':_0x2a4b8c['as'],'attributes':_0x2a4b8c['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe8c('0x1f')](function(_0x53b346){logger[_0xfe8c('0xb')](_0xfe8c('0x22'),_0xd588c8);logger[_0xfe8c('0x20')](_0xfe8c('0x22'),_0xd588c8,JSON[_0xfe8c('0xf')](_0x53b346));_0x3575dd(_0x53b346);})['catch'](function(_0x5736b7){logger[_0xfe8c('0x10')]('ShowFreshdeskAccount',_0x5736b7[_0xfe8c('0x12')],_0xd588c8);_0xdd9c9a(_0x27b7cb[_0xfe8c('0x10')](0x1f4,_0x5736b7[_0xfe8c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index f00e076..4b8ee29 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 _0x919c=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','update','destroy','exports'];(function(_0xa40e2c,_0x43921b){var _0xaa7b25=function(_0x1d99b7){while(--_0x1d99b7){_0xa40e2c['push'](_0xa40e2c['shift']());}};_0xaa7b25(++_0x43921b);}(_0x919c,0x159));var _0xc919=function(_0x5acfcf,_0x148f5c){_0x5acfcf=_0x5acfcf-0x0;var _0x5c932c=_0x919c[_0x5acfcf];return _0x5c932c;};'use strict';var multer=require(_0xc919('0x0'));var util=require(_0xc919('0x1'));var path=require('path');var timeout=require(_0xc919('0x2'));var express=require(_0xc919('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc919('0x4'));var interaction=require(_0xc919('0x5'));var config=require('../../config/environment');var controller=require(_0xc919('0x6'));router[_0xc919('0x7')]('/',auth[_0xc919('0x8')](),controller[_0xc919('0x9')]);router['get'](_0xc919('0xa'),auth[_0xc919('0x8')](),controller[_0xc919('0xb')]);router['get'](_0xc919('0xc'),auth['isAuthenticated'](),controller[_0xc919('0xd')]);router[_0xc919('0x7')](_0xc919('0xe'),auth[_0xc919('0x8')](),controller['getSubjects']);router[_0xc919('0x7')](_0xc919('0xf'),auth[_0xc919('0x8')](),controller[_0xc919('0x10')]);router[_0xc919('0x7')](_0xc919('0x11'),auth[_0xc919('0x8')](),controller['getTags']);router[_0xc919('0x12')]('/',auth[_0xc919('0x8')](),controller['create']);router[_0xc919('0x12')]('/:id/tags',auth[_0xc919('0x8')](),controller[_0xc919('0x13')]);router['put'](_0xc919('0xa'),auth[_0xc919('0x8')](),controller[_0xc919('0x14')]);router['delete']('/:id',auth[_0xc919('0x8')](),controller[_0xc919('0x15')]);module[_0xc919('0x16')]=router; \ No newline at end of file +var _0xe429=['/:id/tags','getTags','post','create','setTags','put','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xe429,0x1ec));var _0x9e42=function(_0x3a0abf,_0x395ab0){_0x3a0abf=_0x3a0abf-0x0;var _0x294b54=_0xe429[_0x3a0abf];return _0x294b54;};'use strict';var multer=require('multer');var util=require(_0x9e42('0x0'));var path=require(_0x9e42('0x1'));var timeout=require(_0x9e42('0x2'));var express=require('express');var router=express[_0x9e42('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9e42('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9e42('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x9e42('0x6')]('/',auth[_0x9e42('0x7')](),controller[_0x9e42('0x8')]);router['get'](_0x9e42('0x9'),auth[_0x9e42('0x7')](),controller[_0x9e42('0xa')]);router[_0x9e42('0x6')](_0x9e42('0xb'),auth[_0x9e42('0x7')](),controller[_0x9e42('0xc')]);router[_0x9e42('0x6')](_0x9e42('0xd'),auth[_0x9e42('0x7')](),controller['getSubjects']);router[_0x9e42('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0x9e42('0xe'),auth[_0x9e42('0x7')](),controller[_0x9e42('0xf')]);router[_0x9e42('0x10')]('/',auth['isAuthenticated'](),controller[_0x9e42('0x11')]);router['post'](_0x9e42('0xe'),auth[_0x9e42('0x7')](),controller[_0x9e42('0x12')]);router[_0x9e42('0x13')](_0x9e42('0x9'),auth[_0x9e42('0x7')](),controller['update']);router[_0x9e42('0x14')]('/:id',auth[_0x9e42('0x7')](),controller['destroy']);module[_0x9e42('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 29e330d..7713d26 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 _0x8226=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8226,0x65));var _0x6822=function(_0x2695ab,_0x3f4b39){_0x2695ab=_0x2695ab-0x0;var _0x3eaf50=_0x8226[_0x2695ab];return _0x3eaf50;};'use strict';var Sequelize=require('sequelize');module[_0x6822('0x0')]={'name':{'type':Sequelize[_0x6822('0x1')]},'description':{'type':Sequelize[_0x6822('0x1')]}}; \ No newline at end of file +var _0x83f1=['exports','STRING','sequelize'];(function(_0x245aae,_0x227cc5){var _0x1b3ad9=function(_0x32a99f){while(--_0x32a99f){_0x245aae['push'](_0x245aae['shift']());}};_0x1b3ad9(++_0x227cc5);}(_0x83f1,0x74));var _0x183f=function(_0x48c1cd,_0x1c95b9){_0x48c1cd=_0x48c1cd-0x0;var _0x3908dc=_0x83f1[_0x48c1cd];return _0x3908dc;};'use strict';var Sequelize=require(_0x183f('0x0'));module[_0x183f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x183f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index c7c2bd9..06e2b7f 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 _0x85b9=['getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','limit','set','apply','reject','update','then','error','stack','send','index','map','FreshdeskConfiguration','fieldName','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','FreshdeskField','rawAttributes','getSubjects','getDescriptions'];(function(_0x25333f,_0x1ac8d9){var _0x31c71a=function(_0x44fe20){while(--_0x44fe20){_0x25333f['push'](_0x25333f['shift']());}};_0x31c71a(++_0x1ac8d9);}(_0x85b9,0x1a2));var _0x985b=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x85b9[_0x47fd36];return _0x21a0fc;};'use strict';var emlformat=require(_0x985b('0x0'));var rimraf=require(_0x985b('0x1'));var zipdir=require(_0x985b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x985b('0x3'));var moment=require(_0x985b('0x4'));var BPromise=require(_0x985b('0x5'));var Mustache=require('mustache');var util=require(_0x985b('0x6'));var path=require(_0x985b('0x7'));var sox=require(_0x985b('0x8'));var csv=require(_0x985b('0x9'));var ejs=require(_0x985b('0xa'));var fs=require('fs');var fs_extra=require(_0x985b('0xb'));var _=require(_0x985b('0xc'));var squel=require(_0x985b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x985b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x985b('0xf'));var Redis=require('ioredis');var authService=require(_0x985b('0x10'));var qs=require(_0x985b('0x11'));var as=require(_0x985b('0x12'));var hardwareService=require(_0x985b('0x13'));var logger=require(_0x985b('0x14'))(_0x985b('0x15'));var utils=require(_0x985b('0x16'));var config=require(_0x985b('0x17'));var licenseUtil=require(_0x985b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x66a58f,_0x560c53){_0x560c53=_0x560c53||0xcc;return function(_0x433d73){if(_0x433d73){return _0x66a58f[_0x985b('0x19')](_0x560c53);}return _0x66a58f[_0x985b('0x1a')](_0x560c53)[_0x985b('0x1b')]();};}function respondWithResult(_0x24539a,_0x43ad63){_0x43ad63=_0x43ad63||0xc8;return function(_0x305d56){if(_0x305d56){return _0x24539a[_0x985b('0x1a')](_0x43ad63)[_0x985b('0x1c')](_0x305d56);}};}function respondWithFilteredResult(_0x52f844,_0x39f170){return function(_0x3ed219){if(_0x3ed219){var _0x1db6ad=typeof _0x39f170[_0x985b('0x1d')]==='undefined'&&typeof _0x39f170[_0x985b('0x1e')]==='undefined';var _0x3ac9e4=_0x3ed219['count'];var _0x27c48f=_0x1db6ad?0x0:_0x39f170[_0x985b('0x1d')];var _0x397892=_0x1db6ad?_0x3ed219['count']:_0x39f170['offset']+_0x39f170[_0x985b('0x1e')];var _0x426d11;if(_0x397892>=_0x3ac9e4){_0x397892=_0x3ac9e4;_0x426d11=0xc8;}else{_0x426d11=0xce;}_0x52f844['status'](_0x426d11);return _0x52f844[_0x985b('0x1f')]('Content-Range',_0x27c48f+'-'+_0x397892+'/'+_0x3ac9e4)[_0x985b('0x1c')](_0x3ed219);}return null;};}function patchUpdates(_0x47de92){return function(_0x3340c4){try{jsonpatch[_0x985b('0x20')](_0x3340c4,_0x47de92,!![]);}catch(_0x5c1d4e){return BPromise[_0x985b('0x21')](_0x5c1d4e);}return _0x3340c4['save']();};}function saveUpdates(_0x56cdd5,_0x18b609){return function(_0x5c90c5){if(_0x5c90c5){return _0x5c90c5[_0x985b('0x22')](_0x56cdd5)[_0x985b('0x23')](function(_0x51c653){return _0x51c653;});}return null;};}function removeEntity(_0xaffb2,_0x4871be){return function(_0x1a3ad0){if(_0x1a3ad0){return _0x1a3ad0['destroy']()[_0x985b('0x23')](function(){_0xaffb2[_0x985b('0x1a')](0xcc)[_0x985b('0x1b')]();});}};}function handleEntityNotFound(_0x1003a5,_0x61723b){return function(_0x28a149){if(!_0x28a149){_0x1003a5[_0x985b('0x19')](0x194);}return _0x28a149;};}function handleError(_0x3aae04,_0x5c5cd6){_0x5c5cd6=_0x5c5cd6||0x1f4;return function(_0x465bcf){logger[_0x985b('0x24')](_0x465bcf[_0x985b('0x25')]);if(_0x465bcf['name']){delete _0x465bcf['name'];}_0x3aae04[_0x985b('0x1a')](_0x5c5cd6)[_0x985b('0x26')](_0x465bcf);};}exports[_0x985b('0x27')]=function(_0x14cef2,_0x3af90e){var _0x4fda49={},_0x165441={},_0x5027d7={'count':0x0,'rows':[]};var _0x3c6df0=_[_0x985b('0x28')](db[_0x985b('0x29')]['rawAttributes'],function(_0xa60d66){return{'name':_0xa60d66[_0x985b('0x2a')],'type':_0xa60d66['type'][_0x985b('0x2b')]};});_0x165441[_0x985b('0x2c')]=_[_0x985b('0x28')](_0x3c6df0,_0x985b('0x2d'));_0x165441[_0x985b('0x2e')]=_[_0x985b('0x2f')](_0x14cef2[_0x985b('0x2e')]);_0x165441[_0x985b('0x30')]=_['intersection'](_0x165441[_0x985b('0x2c')],_0x165441[_0x985b('0x2e')]);_0x4fda49[_0x985b('0x31')]=_[_0x985b('0x32')](_0x165441[_0x985b('0x2c')],qs[_0x985b('0x33')](_0x14cef2[_0x985b('0x2e')][_0x985b('0x33')]));_0x4fda49[_0x985b('0x31')]=_0x4fda49[_0x985b('0x31')][_0x985b('0x34')]?_0x4fda49[_0x985b('0x31')]:_0x165441[_0x985b('0x2c')];if(!_0x14cef2[_0x985b('0x2e')][_0x985b('0x35')](_0x985b('0x36'))){_0x4fda49[_0x985b('0x1e')]=qs[_0x985b('0x1e')](_0x14cef2['query']['limit']);_0x4fda49[_0x985b('0x1d')]=qs[_0x985b('0x1d')](_0x14cef2[_0x985b('0x2e')]['offset']);}_0x4fda49[_0x985b('0x37')]=qs[_0x985b('0x38')](_0x14cef2[_0x985b('0x2e')][_0x985b('0x38')]);_0x4fda49[_0x985b('0x39')]=qs[_0x985b('0x30')](_[_0x985b('0x3a')](_0x14cef2['query'],_0x165441[_0x985b('0x30')]),_0x3c6df0);if(_0x14cef2[_0x985b('0x2e')][_0x985b('0x3b')]){_0x4fda49['where']=_[_0x985b('0x3c')](_0x4fda49['where'],{'$or':_['map'](_0x3c6df0,function(_0x2a479a){if(_0x2a479a[_0x985b('0x3d')]!==_0x985b('0x3e')){var _0x105835={};_0x105835[_0x2a479a[_0x985b('0x2d')]]={'$like':'%'+_0x14cef2['query']['filter']+'%'};return _0x105835;}})});}_0x4fda49=_[_0x985b('0x3c')]({},_0x4fda49,_0x14cef2[_0x985b('0x3f')]);var _0x1a6225={'where':_0x4fda49['where']};return db[_0x985b('0x29')][_0x985b('0x40')](_0x1a6225)[_0x985b('0x23')](function(_0x27144e){_0x5027d7[_0x985b('0x40')]=_0x27144e;if(_0x14cef2[_0x985b('0x2e')]['includeAll']){_0x4fda49[_0x985b('0x41')]=[{'all':!![]}];}return db[_0x985b('0x29')][_0x985b('0x42')](_0x4fda49);})[_0x985b('0x23')](function(_0x209c65){_0x5027d7[_0x985b('0x43')]=_0x209c65;return _0x5027d7;})[_0x985b('0x23')](respondWithFilteredResult(_0x3af90e,_0x4fda49))[_0x985b('0x44')](handleError(_0x3af90e,null));};exports[_0x985b('0x45')]=function(_0x14709f,_0x58c06d){var _0x4bd9ca={'raw':![],'where':{'id':_0x14709f[_0x985b('0x46')]['id']}},_0x17d95f={};_0x17d95f[_0x985b('0x2c')]=_[_0x985b('0x2f')](db[_0x985b('0x29')]['rawAttributes']);_0x17d95f[_0x985b('0x2e')]=_['keys'](_0x14709f[_0x985b('0x2e')]);_0x17d95f[_0x985b('0x30')]=_['intersection'](_0x17d95f['model'],_0x17d95f[_0x985b('0x2e')]);_0x4bd9ca[_0x985b('0x31')]=_[_0x985b('0x32')](_0x17d95f[_0x985b('0x2c')],qs[_0x985b('0x33')](_0x14709f[_0x985b('0x2e')][_0x985b('0x33')]));_0x4bd9ca[_0x985b('0x31')]=_0x4bd9ca[_0x985b('0x31')]['length']?_0x4bd9ca['attributes']:_0x17d95f[_0x985b('0x2c')];if(_0x14709f['query']['includeAll']){_0x4bd9ca[_0x985b('0x41')]=[{'all':!![]}];}_0x4bd9ca=_[_0x985b('0x3c')]({},_0x4bd9ca,_0x14709f['options']);return db['FreshdeskConfiguration']['find'](_0x4bd9ca)['then'](handleEntityNotFound(_0x58c06d,null))[_0x985b('0x23')](respondWithResult(_0x58c06d,null))[_0x985b('0x44')](handleError(_0x58c06d,null));};exports[_0x985b('0x47')]=function(_0x179a9e,_0xc804ee){return db[_0x985b('0x29')][_0x985b('0x47')](_0x179a9e[_0x985b('0x48')],{})[_0x985b('0x23')](respondWithResult(_0xc804ee,0xc9))[_0x985b('0x44')](handleError(_0xc804ee,null));};exports[_0x985b('0x22')]=function(_0x992255,_0x5bf0cf){if(_0x992255['body']['id']){delete _0x992255[_0x985b('0x48')]['id'];}return db[_0x985b('0x29')]['find']({'where':{'id':_0x992255[_0x985b('0x46')]['id']}})[_0x985b('0x23')](handleEntityNotFound(_0x5bf0cf,null))[_0x985b('0x23')](saveUpdates(_0x992255[_0x985b('0x48')],null))[_0x985b('0x23')](respondWithResult(_0x5bf0cf,null))[_0x985b('0x44')](handleError(_0x5bf0cf,null));};exports['destroy']=function(_0x545a74,_0xc2fa45){return db[_0x985b('0x29')][_0x985b('0x49')]({'where':{'id':_0x545a74['params']['id']}})[_0x985b('0x23')](handleEntityNotFound(_0xc2fa45,null))[_0x985b('0x23')](removeEntity(_0xc2fa45,null))[_0x985b('0x44')](handleError(_0xc2fa45,null));};exports[_0x985b('0x4a')]=function(_0x4eabc1,_0x17b245,_0x156840){var _0x37a119={};var _0x43c25={};var _0x1a2cb8;var _0x1a1b0d;return db[_0x985b('0x29')][_0x985b('0x4b')]({'where':{'id':_0x4eabc1[_0x985b('0x46')]['id']}})[_0x985b('0x23')](handleEntityNotFound(_0x17b245,null))[_0x985b('0x23')](function(_0x1a37da){if(_0x1a37da){_0x1a2cb8=_0x1a37da;_0x43c25['model']=_['keys'](db[_0x985b('0x4c')][_0x985b('0x4d')]);_0x43c25['query']=_[_0x985b('0x2f')](_0x4eabc1[_0x985b('0x2e')]);_0x43c25[_0x985b('0x30')]=_['intersection'](_0x43c25[_0x985b('0x2c')],_0x43c25[_0x985b('0x2e')]);_0x37a119[_0x985b('0x31')]=_['intersection'](_0x43c25[_0x985b('0x2c')],qs['fields'](_0x4eabc1[_0x985b('0x2e')][_0x985b('0x33')]));_0x37a119[_0x985b('0x31')]=_0x37a119[_0x985b('0x31')][_0x985b('0x34')]?_0x37a119[_0x985b('0x31')]:_0x43c25[_0x985b('0x2c')];_0x37a119[_0x985b('0x37')]=qs[_0x985b('0x38')](_0x4eabc1['query'][_0x985b('0x38')]);_0x37a119[_0x985b('0x39')]=qs[_0x985b('0x30')](_['pick'](_0x4eabc1[_0x985b('0x2e')],_0x43c25[_0x985b('0x30')]));if(_0x4eabc1['query']['filter']){_0x37a119[_0x985b('0x39')]=_[_0x985b('0x3c')](_0x37a119[_0x985b('0x39')],{'$or':_[_0x985b('0x28')](_0x37a119[_0x985b('0x31')],function(_0x340aed){var _0xc9a0c3={};_0xc9a0c3[_0x340aed]={'$like':'%'+_0x4eabc1[_0x985b('0x2e')][_0x985b('0x3b')]+'%'};return _0xc9a0c3;})});}_0x37a119=_[_0x985b('0x3c')]({},_0x37a119,_0x4eabc1[_0x985b('0x3f')]);return _0x1a2cb8[_0x985b('0x4a')](_0x37a119);}})[_0x985b('0x23')](function(_0x2e4273){if(_0x2e4273){_0x1a1b0d=_0x2e4273['length'];if(!_0x4eabc1[_0x985b('0x2e')]['hasOwnProperty'](_0x985b('0x36'))){_0x37a119[_0x985b('0x1e')]=qs[_0x985b('0x1e')](_0x4eabc1['query'][_0x985b('0x1e')]);_0x37a119[_0x985b('0x1d')]=qs[_0x985b('0x1d')](_0x4eabc1[_0x985b('0x2e')][_0x985b('0x1d')]);}return _0x1a2cb8['getFields'](_0x37a119);}})[_0x985b('0x23')](function(_0x25bf44){if(_0x25bf44){return _0x25bf44?{'count':_0x1a1b0d,'rows':_0x25bf44}:null;}})['then'](respondWithResult(_0x17b245,null))[_0x985b('0x44')](handleError(_0x17b245,null));};exports[_0x985b('0x4e')]=function(_0x354123,_0x28a9a6,_0x5f4587){var _0x5a68cb={};var _0x28ee3d={};var _0x359306;var _0x546e22;return db[_0x985b('0x29')]['findOne']({'where':{'id':_0x354123[_0x985b('0x46')]['id']}})['then'](handleEntityNotFound(_0x28a9a6,null))['then'](function(_0x37f3dd){if(_0x37f3dd){_0x359306=_0x37f3dd;_0x28ee3d[_0x985b('0x2c')]=_['keys'](db[_0x985b('0x4c')]['rawAttributes']);_0x28ee3d[_0x985b('0x2e')]=_[_0x985b('0x2f')](_0x354123[_0x985b('0x2e')]);_0x28ee3d[_0x985b('0x30')]=_[_0x985b('0x32')](_0x28ee3d['model'],_0x28ee3d[_0x985b('0x2e')]);_0x5a68cb[_0x985b('0x31')]=_[_0x985b('0x32')](_0x28ee3d[_0x985b('0x2c')],qs[_0x985b('0x33')](_0x354123['query'][_0x985b('0x33')]));_0x5a68cb[_0x985b('0x31')]=_0x5a68cb[_0x985b('0x31')]['length']?_0x5a68cb[_0x985b('0x31')]:_0x28ee3d['model'];_0x5a68cb['order']=qs[_0x985b('0x38')](_0x354123[_0x985b('0x2e')]['sort']);_0x5a68cb[_0x985b('0x39')]=qs[_0x985b('0x30')](_[_0x985b('0x3a')](_0x354123[_0x985b('0x2e')],_0x28ee3d[_0x985b('0x30')]));if(_0x354123[_0x985b('0x2e')]['filter']){_0x5a68cb['where']=_['merge'](_0x5a68cb[_0x985b('0x39')],{'$or':_['map'](_0x5a68cb['attributes'],function(_0x45a7b5){var _0x5e1620={};_0x5e1620[_0x45a7b5]={'$like':'%'+_0x354123['query']['filter']+'%'};return _0x5e1620;})});}_0x5a68cb=_[_0x985b('0x3c')]({},_0x5a68cb,_0x354123[_0x985b('0x3f')]);return _0x359306[_0x985b('0x4e')](_0x5a68cb);}})[_0x985b('0x23')](function(_0x42ac6b){if(_0x42ac6b){_0x546e22=_0x42ac6b[_0x985b('0x34')];if(!_0x354123[_0x985b('0x2e')][_0x985b('0x35')](_0x985b('0x36'))){_0x5a68cb[_0x985b('0x1e')]=qs[_0x985b('0x1e')](_0x354123['query']['limit']);_0x5a68cb[_0x985b('0x1d')]=qs[_0x985b('0x1d')](_0x354123[_0x985b('0x2e')][_0x985b('0x1d')]);}return _0x359306[_0x985b('0x4e')](_0x5a68cb);}})[_0x985b('0x23')](function(_0x26c68a){if(_0x26c68a){return _0x26c68a?{'count':_0x546e22,'rows':_0x26c68a}:null;}})['then'](respondWithResult(_0x28a9a6,null))[_0x985b('0x44')](handleError(_0x28a9a6,null));};exports[_0x985b('0x4f')]=function(_0x20a664,_0x5cffeb,_0x7b5f90){var _0x4e6d6e={};var _0x4629eb={};var _0xdced10;var _0x5c184b;return db[_0x985b('0x29')][_0x985b('0x4b')]({'where':{'id':_0x20a664[_0x985b('0x46')]['id']}})[_0x985b('0x23')](handleEntityNotFound(_0x5cffeb,null))['then'](function(_0x550762){if(_0x550762){_0xdced10=_0x550762;_0x4629eb[_0x985b('0x2c')]=_[_0x985b('0x2f')](db[_0x985b('0x4c')][_0x985b('0x4d')]);_0x4629eb['query']=_['keys'](_0x20a664['query']);_0x4629eb[_0x985b('0x30')]=_['intersection'](_0x4629eb[_0x985b('0x2c')],_0x4629eb[_0x985b('0x2e')]);_0x4e6d6e[_0x985b('0x31')]=_[_0x985b('0x32')](_0x4629eb['model'],qs[_0x985b('0x33')](_0x20a664[_0x985b('0x2e')][_0x985b('0x33')]));_0x4e6d6e[_0x985b('0x31')]=_0x4e6d6e[_0x985b('0x31')][_0x985b('0x34')]?_0x4e6d6e[_0x985b('0x31')]:_0x4629eb[_0x985b('0x2c')];_0x4e6d6e['order']=qs[_0x985b('0x38')](_0x20a664[_0x985b('0x2e')][_0x985b('0x38')]);_0x4e6d6e['where']=qs[_0x985b('0x30')](_[_0x985b('0x3a')](_0x20a664[_0x985b('0x2e')],_0x4629eb[_0x985b('0x30')]));if(_0x20a664[_0x985b('0x2e')][_0x985b('0x3b')]){_0x4e6d6e[_0x985b('0x39')]=_[_0x985b('0x3c')](_0x4e6d6e[_0x985b('0x39')],{'$or':_[_0x985b('0x28')](_0x4e6d6e[_0x985b('0x31')],function(_0x3efd05){var _0xc9c2e6={};_0xc9c2e6[_0x3efd05]={'$like':'%'+_0x20a664[_0x985b('0x2e')][_0x985b('0x3b')]+'%'};return _0xc9c2e6;})});}_0x4e6d6e=_[_0x985b('0x3c')]({},_0x4e6d6e,_0x20a664[_0x985b('0x3f')]);return _0xdced10['getDescriptions'](_0x4e6d6e);}})[_0x985b('0x23')](function(_0x280de0){if(_0x280de0){_0x5c184b=_0x280de0[_0x985b('0x34')];if(!_0x20a664[_0x985b('0x2e')][_0x985b('0x35')]('nolimit')){_0x4e6d6e[_0x985b('0x1e')]=qs['limit'](_0x20a664[_0x985b('0x2e')][_0x985b('0x1e')]);_0x4e6d6e[_0x985b('0x1d')]=qs['offset'](_0x20a664['query'][_0x985b('0x1d')]);}return _0xdced10[_0x985b('0x4f')](_0x4e6d6e);}})['then'](function(_0x4df913){if(_0x4df913){return _0x4df913?{'count':_0x5c184b,'rows':_0x4df913}:null;}})[_0x985b('0x23')](respondWithResult(_0x5cffeb,null))['catch'](handleError(_0x5cffeb,null));};exports[_0x985b('0x50')]=function(_0x1d9524,_0x1a0c12,_0x530d5b){var _0x5dd9db={};var _0x58542b={};var _0x18f3e1;var _0x3fec57;return db[_0x985b('0x29')][_0x985b('0x4b')]({'where':{'id':_0x1d9524['params']['id']}})[_0x985b('0x23')](handleEntityNotFound(_0x1a0c12,null))[_0x985b('0x23')](function(_0x3a5054){if(_0x3a5054){_0x18f3e1=_0x3a5054;_0x58542b['model']=_[_0x985b('0x2f')](db['Tag'][_0x985b('0x4d')]);_0x58542b[_0x985b('0x2e')]=_[_0x985b('0x2f')](_0x1d9524[_0x985b('0x2e')]);_0x58542b['filters']=_[_0x985b('0x32')](_0x58542b[_0x985b('0x2c')],_0x58542b[_0x985b('0x2e')]);_0x5dd9db[_0x985b('0x31')]=_[_0x985b('0x32')](_0x58542b[_0x985b('0x2c')],qs['fields'](_0x1d9524[_0x985b('0x2e')]['fields']));_0x5dd9db[_0x985b('0x31')]=_0x5dd9db['attributes'][_0x985b('0x34')]?_0x5dd9db[_0x985b('0x31')]:_0x58542b[_0x985b('0x2c')];_0x5dd9db['order']=qs['sort'](_0x1d9524['query'][_0x985b('0x38')]);_0x5dd9db['where']=qs[_0x985b('0x30')](_[_0x985b('0x3a')](_0x1d9524[_0x985b('0x2e')],_0x58542b[_0x985b('0x30')]));if(_0x1d9524[_0x985b('0x2e')][_0x985b('0x3b')]){_0x5dd9db[_0x985b('0x39')]=_[_0x985b('0x3c')](_0x5dd9db['where'],{'$or':_[_0x985b('0x28')](_0x5dd9db[_0x985b('0x31')],function(_0x49efc1){var _0x4faf81={};_0x4faf81[_0x49efc1]={'$like':'%'+_0x1d9524[_0x985b('0x2e')]['filter']+'%'};return _0x4faf81;})});}_0x5dd9db=_[_0x985b('0x3c')]({},_0x5dd9db,_0x1d9524[_0x985b('0x3f')]);return _0x18f3e1[_0x985b('0x50')](_0x5dd9db);}})[_0x985b('0x23')](function(_0xfb4327){if(_0xfb4327){_0x3fec57=_0xfb4327[_0x985b('0x34')];if(!_0x1d9524[_0x985b('0x2e')]['hasOwnProperty'](_0x985b('0x36'))){_0x5dd9db[_0x985b('0x1e')]=qs['limit'](_0x1d9524[_0x985b('0x2e')][_0x985b('0x1e')]);_0x5dd9db[_0x985b('0x1d')]=qs[_0x985b('0x1d')](_0x1d9524['query'][_0x985b('0x1d')]);}return _0x18f3e1[_0x985b('0x50')](_0x5dd9db);}})[_0x985b('0x23')](function(_0x45391a){if(_0x45391a){return _0x45391a?{'count':_0x3fec57,'rows':_0x45391a}:null;}})[_0x985b('0x23')](respondWithResult(_0x1a0c12,null))[_0x985b('0x44')](handleError(_0x1a0c12,null));};exports[_0x985b('0x51')]=function(_0x29dba0,_0x17c35d,_0x2982a){if(_0x29dba0[_0x985b('0x48')]['id']){delete _0x29dba0['body']['id'];}return db['FreshdeskConfiguration'][_0x985b('0x4b')]({'where':{'id':_0x29dba0[_0x985b('0x46')]['id']}})[_0x985b('0x23')](handleEntityNotFound(_0x17c35d,null))[_0x985b('0x23')](function(_0x379f44){if(_0x379f44){return _0x379f44[_0x985b('0x51')](_0x29dba0['body'][_0x985b('0x52')]||[]);}return null;})[_0x985b('0x23')](respondWithResult(_0x17c35d,null))[_0x985b('0x44')](handleError(_0x17c35d,null));}; \ No newline at end of file +var _0x03d1=['getSubjects','getDescriptions','getTags','rawAttributes','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','map','FreshdeskConfiguration','fieldName','type','key','model','query','keys','filters','attributes','fields','length','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','getFields','findOne','FreshdeskField','order','filter','hasOwnProperty','nolimit'];(function(_0x45a738,_0x10f0da){var _0xd8a4fd=function(_0x589903){while(--_0x589903){_0x45a738['push'](_0x45a738['shift']());}};_0xd8a4fd(++_0x10f0da);}(_0x03d1,0xa7));var _0x103d=function(_0x4fb0d6,_0x3f54fe){_0x4fb0d6=_0x4fb0d6-0x0;var _0x5c44ac=_0x03d1[_0x4fb0d6];return _0x5c44ac;};'use strict';var emlformat=require(_0x103d('0x0'));var rimraf=require(_0x103d('0x1'));var zipdir=require(_0x103d('0x2'));var jsonpatch=require(_0x103d('0x3'));var rp=require(_0x103d('0x4'));var moment=require('moment');var BPromise=require(_0x103d('0x5'));var Mustache=require(_0x103d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x103d('0x7'));var csv=require(_0x103d('0x8'));var ejs=require(_0x103d('0x9'));var fs=require('fs');var fs_extra=require(_0x103d('0xa'));var _=require(_0x103d('0xb'));var squel=require(_0x103d('0xc'));var crypto=require('crypto');var jsforce=require(_0x103d('0xd'));var deskjs=require(_0x103d('0xe'));var toCsv=require(_0x103d('0x8'));var querystring=require(_0x103d('0xf'));var Papa=require(_0x103d('0x10'));var Redis=require(_0x103d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x103d('0x12'));var as=require(_0x103d('0x13'));var hardwareService=require(_0x103d('0x14'));var logger=require('../../config/logger')(_0x103d('0x15'));var utils=require('../../config/utils');var config=require(_0x103d('0x16'));var licenseUtil=require(_0x103d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27cd49,_0x3caa5c){_0x3caa5c=_0x3caa5c||0xcc;return function(_0x12ea61){if(_0x12ea61){return _0x27cd49['sendStatus'](_0x3caa5c);}return _0x27cd49[_0x103d('0x18')](_0x3caa5c)[_0x103d('0x19')]();};}function respondWithResult(_0x38ca73,_0x136bfa){_0x136bfa=_0x136bfa||0xc8;return function(_0xa6109d){if(_0xa6109d){return _0x38ca73['status'](_0x136bfa)[_0x103d('0x1a')](_0xa6109d);}};}function respondWithFilteredResult(_0x44dac1,_0x3a316f){return function(_0x5c016c){if(_0x5c016c){var _0x324721=typeof _0x3a316f[_0x103d('0x1b')]==='undefined'&&typeof _0x3a316f[_0x103d('0x1c')]===_0x103d('0x1d');var _0xcafc78=_0x5c016c[_0x103d('0x1e')];var _0x483759=_0x324721?0x0:_0x3a316f[_0x103d('0x1b')];var _0x2b8700=_0x324721?_0x5c016c[_0x103d('0x1e')]:_0x3a316f[_0x103d('0x1b')]+_0x3a316f[_0x103d('0x1c')];var _0x4d361e;if(_0x2b8700>=_0xcafc78){_0x2b8700=_0xcafc78;_0x4d361e=0xc8;}else{_0x4d361e=0xce;}_0x44dac1[_0x103d('0x18')](_0x4d361e);return _0x44dac1[_0x103d('0x1f')](_0x103d('0x20'),_0x483759+'-'+_0x2b8700+'/'+_0xcafc78)[_0x103d('0x1a')](_0x5c016c);}return null;};}function patchUpdates(_0x289fe1){return function(_0x5c64c5){try{jsonpatch[_0x103d('0x21')](_0x5c64c5,_0x289fe1,!![]);}catch(_0x7730f1){return BPromise[_0x103d('0x22')](_0x7730f1);}return _0x5c64c5['save']();};}function saveUpdates(_0x322500,_0x76e171){return function(_0x25802d){if(_0x25802d){return _0x25802d[_0x103d('0x23')](_0x322500)[_0x103d('0x24')](function(_0x5c734a){return _0x5c734a;});}return null;};}function removeEntity(_0x5e6d17,_0x66b144){return function(_0x37b588){if(_0x37b588){return _0x37b588[_0x103d('0x25')]()[_0x103d('0x24')](function(){_0x5e6d17[_0x103d('0x18')](0xcc)[_0x103d('0x19')]();});}};}function handleEntityNotFound(_0x4826e3,_0x1b4014){return function(_0x23010c){if(!_0x23010c){_0x4826e3[_0x103d('0x26')](0x194);}return _0x23010c;};}function handleError(_0x2a112f,_0x1af3e8){_0x1af3e8=_0x1af3e8||0x1f4;return function(_0x546329){logger[_0x103d('0x27')](_0x546329['stack']);if(_0x546329[_0x103d('0x28')]){delete _0x546329[_0x103d('0x28')];}_0x2a112f[_0x103d('0x18')](_0x1af3e8)[_0x103d('0x29')](_0x546329);};}exports['index']=function(_0xc24ce2,_0x53a1e2){var _0x2b07fc={},_0x5e7c86={},_0x4435d4={'count':0x0,'rows':[]};var _0x53a615=_[_0x103d('0x2a')](db[_0x103d('0x2b')]['rawAttributes'],function(_0x14b224){return{'name':_0x14b224[_0x103d('0x2c')],'type':_0x14b224[_0x103d('0x2d')][_0x103d('0x2e')]};});_0x5e7c86[_0x103d('0x2f')]=_['map'](_0x53a615,_0x103d('0x28'));_0x5e7c86[_0x103d('0x30')]=_[_0x103d('0x31')](_0xc24ce2[_0x103d('0x30')]);_0x5e7c86[_0x103d('0x32')]=_['intersection'](_0x5e7c86[_0x103d('0x2f')],_0x5e7c86[_0x103d('0x30')]);_0x2b07fc[_0x103d('0x33')]=_['intersection'](_0x5e7c86['model'],qs[_0x103d('0x34')](_0xc24ce2[_0x103d('0x30')]['fields']));_0x2b07fc[_0x103d('0x33')]=_0x2b07fc[_0x103d('0x33')][_0x103d('0x35')]?_0x2b07fc[_0x103d('0x33')]:_0x5e7c86[_0x103d('0x2f')];if(!_0xc24ce2[_0x103d('0x30')]['hasOwnProperty']('nolimit')){_0x2b07fc[_0x103d('0x1c')]=qs[_0x103d('0x1c')](_0xc24ce2[_0x103d('0x30')][_0x103d('0x1c')]);_0x2b07fc[_0x103d('0x1b')]=qs['offset'](_0xc24ce2[_0x103d('0x30')][_0x103d('0x1b')]);}_0x2b07fc['order']=qs[_0x103d('0x36')](_0xc24ce2['query'][_0x103d('0x36')]);_0x2b07fc[_0x103d('0x37')]=qs[_0x103d('0x32')](_[_0x103d('0x38')](_0xc24ce2[_0x103d('0x30')],_0x5e7c86[_0x103d('0x32')]),_0x53a615);if(_0xc24ce2[_0x103d('0x30')]['filter']){_0x2b07fc[_0x103d('0x37')]=_[_0x103d('0x39')](_0x2b07fc[_0x103d('0x37')],{'$or':_[_0x103d('0x2a')](_0x53a615,function(_0x57dd7d){if(_0x57dd7d[_0x103d('0x2d')]!=='VIRTUAL'){var _0x1bd7cc={};_0x1bd7cc[_0x57dd7d[_0x103d('0x28')]]={'$like':'%'+_0xc24ce2[_0x103d('0x30')]['filter']+'%'};return _0x1bd7cc;}})});}_0x2b07fc=_[_0x103d('0x39')]({},_0x2b07fc,_0xc24ce2[_0x103d('0x3a')]);var _0x1bf5dc={'where':_0x2b07fc['where']};return db[_0x103d('0x2b')][_0x103d('0x1e')](_0x1bf5dc)[_0x103d('0x24')](function(_0x32439a){_0x4435d4[_0x103d('0x1e')]=_0x32439a;if(_0xc24ce2['query'][_0x103d('0x3b')]){_0x2b07fc[_0x103d('0x3c')]=[{'all':!![]}];}return db[_0x103d('0x2b')][_0x103d('0x3d')](_0x2b07fc);})[_0x103d('0x24')](function(_0xab4016){_0x4435d4[_0x103d('0x3e')]=_0xab4016;return _0x4435d4;})[_0x103d('0x24')](respondWithFilteredResult(_0x53a1e2,_0x2b07fc))[_0x103d('0x3f')](handleError(_0x53a1e2,null));};exports['show']=function(_0x6714b0,_0x2180cf){var _0xd1263c={'raw':![],'where':{'id':_0x6714b0[_0x103d('0x40')]['id']}},_0x42864e={};_0x42864e[_0x103d('0x2f')]=_[_0x103d('0x31')](db['FreshdeskConfiguration']['rawAttributes']);_0x42864e[_0x103d('0x30')]=_[_0x103d('0x31')](_0x6714b0[_0x103d('0x30')]);_0x42864e[_0x103d('0x32')]=_[_0x103d('0x41')](_0x42864e[_0x103d('0x2f')],_0x42864e[_0x103d('0x30')]);_0xd1263c[_0x103d('0x33')]=_[_0x103d('0x41')](_0x42864e[_0x103d('0x2f')],qs['fields'](_0x6714b0[_0x103d('0x30')][_0x103d('0x34')]));_0xd1263c[_0x103d('0x33')]=_0xd1263c[_0x103d('0x33')][_0x103d('0x35')]?_0xd1263c['attributes']:_0x42864e[_0x103d('0x2f')];if(_0x6714b0[_0x103d('0x30')][_0x103d('0x3b')]){_0xd1263c[_0x103d('0x3c')]=[{'all':!![]}];}_0xd1263c=_[_0x103d('0x39')]({},_0xd1263c,_0x6714b0[_0x103d('0x3a')]);return db['FreshdeskConfiguration'][_0x103d('0x42')](_0xd1263c)[_0x103d('0x24')](handleEntityNotFound(_0x2180cf,null))[_0x103d('0x24')](respondWithResult(_0x2180cf,null))[_0x103d('0x3f')](handleError(_0x2180cf,null));};exports['create']=function(_0xeb6e50,_0x5e204a){return db[_0x103d('0x2b')][_0x103d('0x43')](_0xeb6e50[_0x103d('0x44')],{})[_0x103d('0x24')](respondWithResult(_0x5e204a,0xc9))[_0x103d('0x3f')](handleError(_0x5e204a,null));};exports[_0x103d('0x23')]=function(_0x31e4f9,_0x2efd61){if(_0x31e4f9[_0x103d('0x44')]['id']){delete _0x31e4f9['body']['id'];}return db['FreshdeskConfiguration'][_0x103d('0x42')]({'where':{'id':_0x31e4f9[_0x103d('0x40')]['id']}})[_0x103d('0x24')](handleEntityNotFound(_0x2efd61,null))[_0x103d('0x24')](saveUpdates(_0x31e4f9[_0x103d('0x44')],null))[_0x103d('0x24')](respondWithResult(_0x2efd61,null))[_0x103d('0x3f')](handleError(_0x2efd61,null));};exports[_0x103d('0x25')]=function(_0x1a79a5,_0x20ee69){return db[_0x103d('0x2b')][_0x103d('0x42')]({'where':{'id':_0x1a79a5[_0x103d('0x40')]['id']}})[_0x103d('0x24')](handleEntityNotFound(_0x20ee69,null))[_0x103d('0x24')](removeEntity(_0x20ee69,null))['catch'](handleError(_0x20ee69,null));};exports[_0x103d('0x45')]=function(_0x29515c,_0x134ac9,_0x158163){var _0x327c85={};var _0x5584d9={};var _0x2a22d9;var _0x4cf6d1;return db[_0x103d('0x2b')][_0x103d('0x46')]({'where':{'id':_0x29515c['params']['id']}})['then'](handleEntityNotFound(_0x134ac9,null))['then'](function(_0x1ff3e2){if(_0x1ff3e2){_0x2a22d9=_0x1ff3e2;_0x5584d9[_0x103d('0x2f')]=_[_0x103d('0x31')](db[_0x103d('0x47')]['rawAttributes']);_0x5584d9[_0x103d('0x30')]=_[_0x103d('0x31')](_0x29515c[_0x103d('0x30')]);_0x5584d9['filters']=_['intersection'](_0x5584d9[_0x103d('0x2f')],_0x5584d9[_0x103d('0x30')]);_0x327c85[_0x103d('0x33')]=_[_0x103d('0x41')](_0x5584d9[_0x103d('0x2f')],qs[_0x103d('0x34')](_0x29515c[_0x103d('0x30')][_0x103d('0x34')]));_0x327c85['attributes']=_0x327c85['attributes'][_0x103d('0x35')]?_0x327c85[_0x103d('0x33')]:_0x5584d9['model'];_0x327c85[_0x103d('0x48')]=qs[_0x103d('0x36')](_0x29515c[_0x103d('0x30')][_0x103d('0x36')]);_0x327c85['where']=qs[_0x103d('0x32')](_['pick'](_0x29515c['query'],_0x5584d9[_0x103d('0x32')]));if(_0x29515c[_0x103d('0x30')][_0x103d('0x49')]){_0x327c85[_0x103d('0x37')]=_[_0x103d('0x39')](_0x327c85[_0x103d('0x37')],{'$or':_['map'](_0x327c85[_0x103d('0x33')],function(_0x473079){var _0x1e77c1={};_0x1e77c1[_0x473079]={'$like':'%'+_0x29515c[_0x103d('0x30')][_0x103d('0x49')]+'%'};return _0x1e77c1;})});}_0x327c85=_[_0x103d('0x39')]({},_0x327c85,_0x29515c[_0x103d('0x3a')]);return _0x2a22d9[_0x103d('0x45')](_0x327c85);}})[_0x103d('0x24')](function(_0x5d265b){if(_0x5d265b){_0x4cf6d1=_0x5d265b[_0x103d('0x35')];if(!_0x29515c['query'][_0x103d('0x4a')](_0x103d('0x4b'))){_0x327c85[_0x103d('0x1c')]=qs[_0x103d('0x1c')](_0x29515c[_0x103d('0x30')][_0x103d('0x1c')]);_0x327c85[_0x103d('0x1b')]=qs[_0x103d('0x1b')](_0x29515c[_0x103d('0x30')]['offset']);}return _0x2a22d9[_0x103d('0x45')](_0x327c85);}})[_0x103d('0x24')](function(_0x2b457a){if(_0x2b457a){return _0x2b457a?{'count':_0x4cf6d1,'rows':_0x2b457a}:null;}})[_0x103d('0x24')](respondWithResult(_0x134ac9,null))[_0x103d('0x3f')](handleError(_0x134ac9,null));};exports[_0x103d('0x4c')]=function(_0x245d11,_0x2c9ea1,_0x37c94b){var _0x53a4d7={};var _0x5753eb={};var _0x959129;var _0x3c039a;return db['FreshdeskConfiguration'][_0x103d('0x46')]({'where':{'id':_0x245d11['params']['id']}})['then'](handleEntityNotFound(_0x2c9ea1,null))[_0x103d('0x24')](function(_0x3b591b){if(_0x3b591b){_0x959129=_0x3b591b;_0x5753eb[_0x103d('0x2f')]=_[_0x103d('0x31')](db['FreshdeskField']['rawAttributes']);_0x5753eb[_0x103d('0x30')]=_[_0x103d('0x31')](_0x245d11['query']);_0x5753eb[_0x103d('0x32')]=_['intersection'](_0x5753eb[_0x103d('0x2f')],_0x5753eb[_0x103d('0x30')]);_0x53a4d7[_0x103d('0x33')]=_['intersection'](_0x5753eb[_0x103d('0x2f')],qs['fields'](_0x245d11['query'][_0x103d('0x34')]));_0x53a4d7[_0x103d('0x33')]=_0x53a4d7[_0x103d('0x33')]['length']?_0x53a4d7['attributes']:_0x5753eb[_0x103d('0x2f')];_0x53a4d7[_0x103d('0x48')]=qs[_0x103d('0x36')](_0x245d11['query']['sort']);_0x53a4d7[_0x103d('0x37')]=qs[_0x103d('0x32')](_['pick'](_0x245d11[_0x103d('0x30')],_0x5753eb[_0x103d('0x32')]));if(_0x245d11[_0x103d('0x30')][_0x103d('0x49')]){_0x53a4d7[_0x103d('0x37')]=_['merge'](_0x53a4d7[_0x103d('0x37')],{'$or':_['map'](_0x53a4d7[_0x103d('0x33')],function(_0x26bba8){var _0x16d0fb={};_0x16d0fb[_0x26bba8]={'$like':'%'+_0x245d11[_0x103d('0x30')][_0x103d('0x49')]+'%'};return _0x16d0fb;})});}_0x53a4d7=_[_0x103d('0x39')]({},_0x53a4d7,_0x245d11['options']);return _0x959129[_0x103d('0x4c')](_0x53a4d7);}})[_0x103d('0x24')](function(_0x40b71d){if(_0x40b71d){_0x3c039a=_0x40b71d[_0x103d('0x35')];if(!_0x245d11[_0x103d('0x30')][_0x103d('0x4a')](_0x103d('0x4b'))){_0x53a4d7['limit']=qs['limit'](_0x245d11[_0x103d('0x30')][_0x103d('0x1c')]);_0x53a4d7[_0x103d('0x1b')]=qs['offset'](_0x245d11[_0x103d('0x30')][_0x103d('0x1b')]);}return _0x959129[_0x103d('0x4c')](_0x53a4d7);}})[_0x103d('0x24')](function(_0x4a2e3a){if(_0x4a2e3a){return _0x4a2e3a?{'count':_0x3c039a,'rows':_0x4a2e3a}:null;}})['then'](respondWithResult(_0x2c9ea1,null))['catch'](handleError(_0x2c9ea1,null));};exports[_0x103d('0x4d')]=function(_0xabcb81,_0x1bc0dc,_0x7dd497){var _0x27cb6e={};var _0x68c27e={};var _0xdc8a85;var _0x454676;return db['FreshdeskConfiguration'][_0x103d('0x46')]({'where':{'id':_0xabcb81[_0x103d('0x40')]['id']}})['then'](handleEntityNotFound(_0x1bc0dc,null))[_0x103d('0x24')](function(_0x2b2a61){if(_0x2b2a61){_0xdc8a85=_0x2b2a61;_0x68c27e['model']=_[_0x103d('0x31')](db[_0x103d('0x47')]['rawAttributes']);_0x68c27e[_0x103d('0x30')]=_['keys'](_0xabcb81[_0x103d('0x30')]);_0x68c27e['filters']=_[_0x103d('0x41')](_0x68c27e[_0x103d('0x2f')],_0x68c27e[_0x103d('0x30')]);_0x27cb6e[_0x103d('0x33')]=_[_0x103d('0x41')](_0x68c27e[_0x103d('0x2f')],qs['fields'](_0xabcb81['query'][_0x103d('0x34')]));_0x27cb6e[_0x103d('0x33')]=_0x27cb6e[_0x103d('0x33')]['length']?_0x27cb6e['attributes']:_0x68c27e['model'];_0x27cb6e[_0x103d('0x48')]=qs[_0x103d('0x36')](_0xabcb81['query'][_0x103d('0x36')]);_0x27cb6e[_0x103d('0x37')]=qs[_0x103d('0x32')](_['pick'](_0xabcb81[_0x103d('0x30')],_0x68c27e['filters']));if(_0xabcb81[_0x103d('0x30')][_0x103d('0x49')]){_0x27cb6e[_0x103d('0x37')]=_[_0x103d('0x39')](_0x27cb6e[_0x103d('0x37')],{'$or':_[_0x103d('0x2a')](_0x27cb6e['attributes'],function(_0x4ea2d5){var _0x360623={};_0x360623[_0x4ea2d5]={'$like':'%'+_0xabcb81['query']['filter']+'%'};return _0x360623;})});}_0x27cb6e=_[_0x103d('0x39')]({},_0x27cb6e,_0xabcb81[_0x103d('0x3a')]);return _0xdc8a85[_0x103d('0x4d')](_0x27cb6e);}})[_0x103d('0x24')](function(_0x338c07){if(_0x338c07){_0x454676=_0x338c07[_0x103d('0x35')];if(!_0xabcb81[_0x103d('0x30')][_0x103d('0x4a')](_0x103d('0x4b'))){_0x27cb6e[_0x103d('0x1c')]=qs[_0x103d('0x1c')](_0xabcb81[_0x103d('0x30')]['limit']);_0x27cb6e[_0x103d('0x1b')]=qs[_0x103d('0x1b')](_0xabcb81[_0x103d('0x30')][_0x103d('0x1b')]);}return _0xdc8a85[_0x103d('0x4d')](_0x27cb6e);}})[_0x103d('0x24')](function(_0x30bd2a){if(_0x30bd2a){return _0x30bd2a?{'count':_0x454676,'rows':_0x30bd2a}:null;}})[_0x103d('0x24')](respondWithResult(_0x1bc0dc,null))[_0x103d('0x3f')](handleError(_0x1bc0dc,null));};exports[_0x103d('0x4e')]=function(_0x4e9b48,_0x4fd258,_0x2a9fa7){var _0x3c7389={};var _0x5e0c8e={};var _0x3089d4;var _0x33f2be;return db[_0x103d('0x2b')][_0x103d('0x46')]({'where':{'id':_0x4e9b48[_0x103d('0x40')]['id']}})[_0x103d('0x24')](handleEntityNotFound(_0x4fd258,null))[_0x103d('0x24')](function(_0x22f0e4){if(_0x22f0e4){_0x3089d4=_0x22f0e4;_0x5e0c8e[_0x103d('0x2f')]=_[_0x103d('0x31')](db['Tag'][_0x103d('0x4f')]);_0x5e0c8e[_0x103d('0x30')]=_['keys'](_0x4e9b48['query']);_0x5e0c8e['filters']=_[_0x103d('0x41')](_0x5e0c8e[_0x103d('0x2f')],_0x5e0c8e['query']);_0x3c7389[_0x103d('0x33')]=_[_0x103d('0x41')](_0x5e0c8e[_0x103d('0x2f')],qs[_0x103d('0x34')](_0x4e9b48['query'][_0x103d('0x34')]));_0x3c7389[_0x103d('0x33')]=_0x3c7389['attributes']['length']?_0x3c7389[_0x103d('0x33')]:_0x5e0c8e['model'];_0x3c7389[_0x103d('0x48')]=qs[_0x103d('0x36')](_0x4e9b48[_0x103d('0x30')][_0x103d('0x36')]);_0x3c7389['where']=qs['filters'](_[_0x103d('0x38')](_0x4e9b48[_0x103d('0x30')],_0x5e0c8e['filters']));if(_0x4e9b48[_0x103d('0x30')]['filter']){_0x3c7389[_0x103d('0x37')]=_[_0x103d('0x39')](_0x3c7389[_0x103d('0x37')],{'$or':_[_0x103d('0x2a')](_0x3c7389[_0x103d('0x33')],function(_0x3958c6){var _0x4d11b8={};_0x4d11b8[_0x3958c6]={'$like':'%'+_0x4e9b48[_0x103d('0x30')][_0x103d('0x49')]+'%'};return _0x4d11b8;})});}_0x3c7389=_['merge']({},_0x3c7389,_0x4e9b48[_0x103d('0x3a')]);return _0x3089d4[_0x103d('0x4e')](_0x3c7389);}})[_0x103d('0x24')](function(_0x59a396){if(_0x59a396){_0x33f2be=_0x59a396['length'];if(!_0x4e9b48['query'][_0x103d('0x4a')]('nolimit')){_0x3c7389['limit']=qs[_0x103d('0x1c')](_0x4e9b48[_0x103d('0x30')][_0x103d('0x1c')]);_0x3c7389[_0x103d('0x1b')]=qs['offset'](_0x4e9b48[_0x103d('0x30')][_0x103d('0x1b')]);}return _0x3089d4[_0x103d('0x4e')](_0x3c7389);}})['then'](function(_0xdd39af){if(_0xdd39af){return _0xdd39af?{'count':_0x33f2be,'rows':_0xdd39af}:null;}})['then'](respondWithResult(_0x4fd258,null))[_0x103d('0x3f')](handleError(_0x4fd258,null));};exports[_0x103d('0x50')]=function(_0xe73de3,_0x4a5df9,_0x25edc3){if(_0xe73de3[_0x103d('0x44')]['id']){delete _0xe73de3[_0x103d('0x44')]['id'];}return db[_0x103d('0x2b')][_0x103d('0x46')]({'where':{'id':_0xe73de3[_0x103d('0x40')]['id']}})[_0x103d('0x24')](handleEntityNotFound(_0x4a5df9,null))['then'](function(_0x5ebee8){if(_0x5ebee8){return _0x5ebee8[_0x103d('0x50')](_0xe73de3[_0x103d('0x44')]['ids']||[]);}return null;})[_0x103d('0x24')](respondWithResult(_0x4a5df9,null))[_0x103d('0x3f')](handleError(_0x4a5df9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 8e26c41..a3cf661 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 _0x0401=['rimraf','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird','path'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x0401,0xd7));var _0x1040=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0401[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x1040('0x0'));var util=require('util');var logger=require(_0x1040('0x1'))('api');var moment=require(_0x1040('0x2'));var BPromise=require(_0x1040('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1040('0x4'));var rimraf=require(_0x1040('0x5'));var config=require('../../config/environment');var attributes=require(_0x1040('0x6'));module[_0x1040('0x7')]=function(_0x4a1bb3,_0x4dd0a9){return _0x4a1bb3[_0x1040('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0x1040('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58da=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x58da,0xd4));var _0xa58d=function(_0x36210b,_0x3bdebd){_0x36210b=_0x36210b-0x0;var _0x573fb4=_0x58da[_0x36210b];return _0x573fb4;};'use strict';var _=require(_0xa58d('0x0'));var util=require(_0xa58d('0x1'));var logger=require(_0xa58d('0x2'))(_0xa58d('0x3'));var moment=require(_0xa58d('0x4'));var BPromise=require(_0xa58d('0x5'));var rp=require(_0xa58d('0x6'));var fs=require('fs');var path=require(_0xa58d('0x7'));var rimraf=require(_0xa58d('0x8'));var config=require(_0xa58d('0x9'));var attributes=require(_0xa58d('0xa'));module['exports']=function(_0x2e86e2,_0x2a4441){return _0x2e86e2[_0xa58d('0xb')](_0xa58d('0xc'),attributes,{'tableName':_0xa58d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 9fe1f5d..e42e0da 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 _0xfba2=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x8d2df5,_0x594016){var _0x48109d=function(_0x151278){while(--_0x151278){_0x8d2df5['push'](_0x8d2df5['shift']());}};_0x48109d(++_0x594016);}(_0xfba2,0x15c));var _0x2fba=function(_0xeea9b7,_0x3e988e){_0xeea9b7=_0xeea9b7-0x0;var _0x421b09=_0xfba2[_0xeea9b7];return _0x421b09;};'use strict';var _=require(_0x2fba('0x0'));var util=require(_0x2fba('0x1'));var moment=require('moment');var BPromise=require(_0x2fba('0x2'));var rs=require(_0x2fba('0x3'));var fs=require('fs');var Redis=require(_0x2fba('0x4'));var db=require(_0x2fba('0x5'))['db'];var utils=require(_0x2fba('0x6'));var logger=require(_0x2fba('0x7'))(_0x2fba('0x8'));var config=require('../../config/environment');var jayson=require(_0x2fba('0x9'));var client=jayson[_0x2fba('0xa')][_0x2fba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435c03,_0x50a5b0,_0x432d91){return new BPromise(function(_0xc71454,_0x3e1a9f){return client[_0x2fba('0xc')](_0x435c03,_0x432d91)[_0x2fba('0xd')](function(_0x161343){logger[_0x2fba('0xe')](_0x2fba('0xf'),_0x50a5b0,_0x2fba('0x10'));logger[_0x2fba('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x50a5b0,_0x2fba('0x10'),JSON[_0x2fba('0x12')](_0x161343));if(_0x161343[_0x2fba('0x13')]){if(_0x161343[_0x2fba('0x13')][_0x2fba('0x14')]===0x1f4){logger[_0x2fba('0x13')](_0x2fba('0xf'),_0x50a5b0,_0x161343[_0x2fba('0x13')][_0x2fba('0x15')]);return _0x3e1a9f(_0x161343['error'][_0x2fba('0x15')]);}logger[_0x2fba('0x13')](_0x2fba('0xf'),_0x50a5b0,_0x161343[_0x2fba('0x13')]['message']);return _0xc71454(_0x161343['error'][_0x2fba('0x15')]);}else{logger[_0x2fba('0xe')](_0x2fba('0xf'),_0x50a5b0,_0x2fba('0x10'));_0xc71454(_0x161343['result'][_0x2fba('0x15')]);}})[_0x2fba('0x16')](function(_0x2f2ac6){logger[_0x2fba('0x13')](_0x2fba('0xf'),_0x50a5b0,_0x2f2ac6);_0x3e1a9f(_0x2f2ac6);});});} \ No newline at end of file +var _0xc6c0=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0xd2e2ab,_0x2440cf){var _0x1703a2=function(_0x23deba){while(--_0x23deba){_0xd2e2ab['push'](_0xd2e2ab['shift']());}};_0x1703a2(++_0x2440cf);}(_0xc6c0,0x108));var _0x0c6c=function(_0x33c637,_0x597c26){_0x33c637=_0x33c637-0x0;var _0x14aa20=_0xc6c0[_0x33c637];return _0x14aa20;};'use strict';var _=require(_0x0c6c('0x0'));var util=require(_0x0c6c('0x1'));var moment=require(_0x0c6c('0x2'));var BPromise=require(_0x0c6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0c6c('0x4'));var logger=require(_0x0c6c('0x5'))(_0x0c6c('0x6'));var config=require(_0x0c6c('0x7'));var jayson=require(_0x0c6c('0x8'));var client=jayson[_0x0c6c('0x9')][_0x0c6c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54635b,_0x386652,_0x896938){return new BPromise(function(_0x354440,_0x2a565d){return client[_0x0c6c('0xb')](_0x54635b,_0x896938)['then'](function(_0x2f4101){logger[_0x0c6c('0xc')](_0x0c6c('0xd'),_0x386652,_0x0c6c('0xe'));logger[_0x0c6c('0xf')](_0x0c6c('0x10'),_0x386652,'request\x20sent',JSON['stringify'](_0x2f4101));if(_0x2f4101[_0x0c6c('0x11')]){if(_0x2f4101[_0x0c6c('0x11')][_0x0c6c('0x12')]===0x1f4){logger['error'](_0x0c6c('0xd'),_0x386652,_0x2f4101[_0x0c6c('0x11')][_0x0c6c('0x13')]);return _0x2a565d(_0x2f4101[_0x0c6c('0x11')][_0x0c6c('0x13')]);}logger['error'](_0x0c6c('0xd'),_0x386652,_0x2f4101[_0x0c6c('0x11')]['message']);return _0x354440(_0x2f4101[_0x0c6c('0x11')][_0x0c6c('0x13')]);}else{logger[_0x0c6c('0xc')](_0x0c6c('0xd'),_0x386652,_0x0c6c('0xe'));_0x354440(_0x2f4101[_0x0c6c('0x14')][_0x0c6c('0x13')]);}})[_0x0c6c('0x15')](function(_0x2096e3){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x386652,_0x2096e3);_0x2a565d(_0x2096e3);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index ecddc2a..fdd788a 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 _0xef55=['isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x564f60,_0x179495){var _0x4e11c4=function(_0x565a2e){while(--_0x565a2e){_0x564f60['push'](_0x564f60['shift']());}};_0x4e11c4(++_0x179495);}(_0xef55,0x7b));var _0x5ef5=function(_0x2e42ec,_0x16377c){_0x2e42ec=_0x2e42ec-0x0;var _0x47be02=_0xef55[_0x2e42ec];return _0x47be02;};'use strict';var multer=require(_0x5ef5('0x0'));var util=require(_0x5ef5('0x1'));var path=require(_0x5ef5('0x2'));var timeout=require(_0x5ef5('0x3'));var express=require('express');var router=express[_0x5ef5('0x4')]();var fs_extra=require(_0x5ef5('0x5'));var auth=require(_0x5ef5('0x6'));var interaction=require(_0x5ef5('0x7'));var config=require(_0x5ef5('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x5ef5('0x9')]('/',auth[_0x5ef5('0xa')](),controller[_0x5ef5('0xb')]);router[_0x5ef5('0x9')](_0x5ef5('0xc'),auth[_0x5ef5('0xa')](),controller[_0x5ef5('0xd')]);router[_0x5ef5('0xe')]('/',auth['isAuthenticated'](),controller[_0x5ef5('0xf')]);router[_0x5ef5('0x10')](_0x5ef5('0xc'),auth[_0x5ef5('0xa')](),controller[_0x5ef5('0x11')]);router[_0x5ef5('0x12')](_0x5ef5('0xc'),auth[_0x5ef5('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x760e=['post','create','put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x3d2e15,_0x1128d3){var _0x1f814e=function(_0x2a70e3){while(--_0x2a70e3){_0x3d2e15['push'](_0x3d2e15['shift']());}};_0x1f814e(++_0x1128d3);}(_0x760e,0x148));var _0xe760=function(_0x5aaa78,_0x48e277){_0x5aaa78=_0x5aaa78-0x0;var _0x14cd91=_0x760e[_0x5aaa78];return _0x14cd91;};'use strict';var multer=require('multer');var util=require(_0xe760('0x0'));var path=require(_0xe760('0x1'));var timeout=require(_0xe760('0x2'));var express=require(_0xe760('0x3'));var router=express['Router']();var fs_extra=require(_0xe760('0x4'));var auth=require(_0xe760('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe760('0x6'));router['get']('/',auth[_0xe760('0x7')](),controller[_0xe760('0x8')]);router[_0xe760('0x9')](_0xe760('0xa'),auth[_0xe760('0x7')](),controller[_0xe760('0xb')]);router[_0xe760('0xc')]('/',auth[_0xe760('0x7')](),controller[_0xe760('0xd')]);router[_0xe760('0xe')](_0xe760('0xa'),auth[_0xe760('0x7')](),controller['update']);router[_0xe760('0xf')](_0xe760('0xa'),auth[_0xe760('0x7')](),controller[_0xe760('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 021518e..1756128 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 _0x141d=['string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','ENUM'];(function(_0x273502,_0x1c173c){var _0x379e87=function(_0x563348){while(--_0x563348){_0x273502['push'](_0x273502['shift']());}};_0x379e87(++_0x1c173c);}(_0x141d,0x196));var _0xd141=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x141d[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xd141('0x0'));module['exports']={'type':{'type':Sequelize[_0xd141('0x1')](_0xd141('0x2'),'variable',_0xd141('0x3'),_0xd141('0x4'),'picklist'),'defaultValue':_0xd141('0x2')},'content':{'type':Sequelize[_0xd141('0x5')]},'key':{'type':Sequelize[_0xd141('0x5')]},'keyType':{'type':Sequelize[_0xd141('0x1')](_0xd141('0x2'),_0xd141('0x6'),_0xd141('0x3'))},'keyContent':{'type':Sequelize[_0xd141('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd141('0x5')]},'customField':{'type':Sequelize[_0xd141('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd141('0x5')]}}; \ No newline at end of file +var _0x8f51=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3f8b99,_0x498c90){var _0xa3feac=function(_0x396390){while(--_0x396390){_0x3f8b99['push'](_0x3f8b99['shift']());}};_0xa3feac(++_0x498c90);}(_0x8f51,0xdd));var _0x18f5=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x8f51[_0x5e6cb8];return _0x3faeb3;};'use strict';var Sequelize=require(_0x18f5('0x0'));module[_0x18f5('0x1')]={'type':{'type':Sequelize[_0x18f5('0x2')](_0x18f5('0x3'),_0x18f5('0x4'),_0x18f5('0x5'),_0x18f5('0x6'),_0x18f5('0x7')),'defaultValue':_0x18f5('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x18f5('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x18f5('0x3'),_0x18f5('0x4'),_0x18f5('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x18f5('0x8')]},'nameField':{'type':Sequelize[_0x18f5('0x8')]},'customField':{'type':Sequelize[_0x18f5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x18f5('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 24d70f6..114b6a1 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 _0x4483=['offset','undefined','limit','count','set','apply','reject','update','destroy','then','stack','name','send','index','FreshdeskField','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','catch','show','params','filters','options','find','create','body','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x1db09c,_0x5768e4){var _0x5721e5=function(_0x734930){while(--_0x734930){_0x1db09c['push'](_0x1db09c['shift']());}};_0x5721e5(++_0x5768e4);}(_0x4483,0x1a3));var _0x3448=function(_0x248fea,_0x340bf9){_0x248fea=_0x248fea-0x0;var _0x3674fb=_0x4483[_0x248fea];return _0x3674fb;};'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(){_0x2dcd40['status'](0xcc)[_0x3448('0x1d')]();});}};}function handleEntityNotFound(_0x1b5c49,_0x114244){return function(_0x2088de){if(!_0x2088de){_0x1b5c49[_0x3448('0x1b')](0x194);}return _0x2088de;};}function handleError(_0x56b3ff,_0x329947){_0x329947=_0x329947||0x1f4;return function(_0x393081){logger['error'](_0x393081[_0x3448('0x29')]);if(_0x393081[_0x3448('0x2a')]){delete _0x393081[_0x3448('0x2a')];}_0x56b3ff[_0x3448('0x1c')](_0x329947)[_0x3448('0x2b')](_0x393081);};}exports[_0x3448('0x2c')]=function(_0x31be64,_0x95714e){var _0x5911b8={},_0x3307dc={},_0x450704={'count':0x0,'rows':[]};var _0xcfdc5=_['map'](db[_0x3448('0x2d')]['rawAttributes'],function(_0x486f2c){return{'name':_0x486f2c['fieldName'],'type':_0x486f2c[_0x3448('0x2e')][_0x3448('0x2f')]};});_0x3307dc['model']=_['map'](_0xcfdc5,_0x3448('0x2a'));_0x3307dc[_0x3448('0x30')]=_[_0x3448('0x31')](_0x31be64[_0x3448('0x30')]);_0x3307dc['filters']=_[_0x3448('0x32')](_0x3307dc[_0x3448('0x33')],_0x3307dc[_0x3448('0x30')]);_0x5911b8['attributes']=_[_0x3448('0x32')](_0x3307dc[_0x3448('0x33')],qs['fields'](_0x31be64['query'][_0x3448('0x34')]));_0x5911b8[_0x3448('0x35')]=_0x5911b8[_0x3448('0x35')][_0x3448('0x36')]?_0x5911b8['attributes']:_0x3307dc[_0x3448('0x33')];if(!_0x31be64[_0x3448('0x30')][_0x3448('0x37')](_0x3448('0x38'))){_0x5911b8['limit']=qs[_0x3448('0x21')](_0x31be64[_0x3448('0x30')]['limit']);_0x5911b8[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x31be64[_0x3448('0x30')][_0x3448('0x1f')]);}_0x5911b8[_0x3448('0x39')]=qs[_0x3448('0x3a')](_0x31be64[_0x3448('0x30')][_0x3448('0x3a')]);_0x5911b8[_0x3448('0x3b')]=qs['filters'](_['pick'](_0x31be64[_0x3448('0x30')],_0x3307dc['filters']),_0xcfdc5);if(_0x31be64[_0x3448('0x30')][_0x3448('0x3c')]){_0x5911b8[_0x3448('0x3b')]=_[_0x3448('0x3d')](_0x5911b8['where'],{'$or':_[_0x3448('0x3e')](_0xcfdc5,function(_0x18fc16){if(_0x18fc16[_0x3448('0x2e')]!==_0x3448('0x3f')){var _0x2e83c6={};_0x2e83c6[_0x18fc16[_0x3448('0x2a')]]={'$like':'%'+_0x31be64[_0x3448('0x30')][_0x3448('0x3c')]+'%'};return _0x2e83c6;}})});}_0x5911b8=_[_0x3448('0x3d')]({},_0x5911b8,_0x31be64['options']);var _0x39b22e={'where':_0x5911b8[_0x3448('0x3b')]};return db[_0x3448('0x2d')][_0x3448('0x22')](_0x39b22e)[_0x3448('0x28')](function(_0x58963d){_0x450704[_0x3448('0x22')]=_0x58963d;if(_0x31be64[_0x3448('0x30')][_0x3448('0x40')]){_0x5911b8[_0x3448('0x41')]=[{'all':!![]}];}return db[_0x3448('0x2d')][_0x3448('0x42')](_0x5911b8);})[_0x3448('0x28')](function(_0x3db5f1){_0x450704['rows']=_0x3db5f1;return _0x450704;})[_0x3448('0x28')](respondWithFilteredResult(_0x95714e,_0x5911b8))[_0x3448('0x43')](handleError(_0x95714e,null));};exports[_0x3448('0x44')]=function(_0x4a04d0,_0x2465ff){var _0x1d2a7c={'raw':!![],'where':{'id':_0x4a04d0[_0x3448('0x45')]['id']}},_0x21f989={};_0x21f989[_0x3448('0x33')]=_[_0x3448('0x31')](db[_0x3448('0x2d')]['rawAttributes']);_0x21f989[_0x3448('0x30')]=_[_0x3448('0x31')](_0x4a04d0[_0x3448('0x30')]);_0x21f989[_0x3448('0x46')]=_[_0x3448('0x32')](_0x21f989[_0x3448('0x33')],_0x21f989['query']);_0x1d2a7c[_0x3448('0x35')]=_['intersection'](_0x21f989['model'],qs[_0x3448('0x34')](_0x4a04d0[_0x3448('0x30')]['fields']));_0x1d2a7c[_0x3448('0x35')]=_0x1d2a7c[_0x3448('0x35')]['length']?_0x1d2a7c[_0x3448('0x35')]:_0x21f989[_0x3448('0x33')];if(_0x4a04d0['query'][_0x3448('0x40')]){_0x1d2a7c[_0x3448('0x41')]=[{'all':!![]}];}_0x1d2a7c=_[_0x3448('0x3d')]({},_0x1d2a7c,_0x4a04d0[_0x3448('0x47')]);return db[_0x3448('0x2d')][_0x3448('0x48')](_0x1d2a7c)[_0x3448('0x28')](handleEntityNotFound(_0x2465ff,null))['then'](respondWithResult(_0x2465ff,null))['catch'](handleError(_0x2465ff,null));};exports[_0x3448('0x49')]=function(_0x3c9b82,_0x1b82e7){return db[_0x3448('0x2d')]['create'](_0x3c9b82[_0x3448('0x4a')],{})[_0x3448('0x28')](respondWithResult(_0x1b82e7,0xc9))[_0x3448('0x43')](handleError(_0x1b82e7,null));};exports[_0x3448('0x26')]=function(_0x363374,_0x5d942b){if(_0x363374[_0x3448('0x4a')]['id']){delete _0x363374['body']['id'];}return db[_0x3448('0x2d')][_0x3448('0x48')]({'where':{'id':_0x363374['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x5d942b,null))[_0x3448('0x28')](saveUpdates(_0x363374[_0x3448('0x4a')],null))[_0x3448('0x28')](respondWithResult(_0x5d942b,null))[_0x3448('0x43')](handleError(_0x5d942b,null));};exports[_0x3448('0x27')]=function(_0xc769e1,_0x53236c){return db[_0x3448('0x2d')][_0x3448('0x48')]({'where':{'id':_0xc769e1['params']['id']}})['then'](handleEntityNotFound(_0x53236c,null))[_0x3448('0x28')](removeEntity(_0x53236c,null))[_0x3448('0x43')](handleError(_0x53236c,null));}; \ No newline at end of file +var _0xf109=['crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','FreshdeskField','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x3e5425,_0x39ca9c){var _0x14fcd3=function(_0x14f14d){while(--_0x14f14d){_0x3e5425['push'](_0x3e5425['shift']());}};_0x14fcd3(++_0x39ca9c);}(_0xf109,0xce));var _0x9f10=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xf109[_0x19b3f9];return _0x18c3f6;};'use strict';var emlformat=require(_0x9f10('0x0'));var rimraf=require(_0x9f10('0x1'));var zipdir=require(_0x9f10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f10('0x3'));var Mustache=require(_0x9f10('0x4'));var util=require(_0x9f10('0x5'));var path=require(_0x9f10('0x6'));var sox=require(_0x9f10('0x7'));var csv=require(_0x9f10('0x8'));var ejs=require(_0x9f10('0x9'));var fs=require('fs');var fs_extra=require(_0x9f10('0xa'));var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x8'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var as=require(_0x9f10('0x13'));var hardwareService=require(_0x9f10('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9f10('0x15'));var config=require(_0x9f10('0x16'));var licenseUtil=require(_0x9f10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289164,_0x260606){_0x260606=_0x260606||0xcc;return function(_0x35c529){if(_0x35c529){return _0x289164['sendStatus'](_0x260606);}return _0x289164[_0x9f10('0x18')](_0x260606)[_0x9f10('0x19')]();};}function respondWithResult(_0x5be443,_0x40a48a){_0x40a48a=_0x40a48a||0xc8;return function(_0x236e28){if(_0x236e28){return _0x5be443['status'](_0x40a48a)['json'](_0x236e28);}};}function respondWithFilteredResult(_0x2b6c4c,_0x177918){return function(_0x549217){if(_0x549217){var _0x11154b=typeof _0x177918['offset']===_0x9f10('0x1a')&&typeof _0x177918[_0x9f10('0x1b')]==='undefined';var _0x11cc56=_0x549217[_0x9f10('0x1c')];var _0x509fba=_0x11154b?0x0:_0x177918[_0x9f10('0x1d')];var _0x53bfbd=_0x11154b?_0x549217[_0x9f10('0x1c')]:_0x177918['offset']+_0x177918[_0x9f10('0x1b')];var _0x56fb44;if(_0x53bfbd>=_0x11cc56){_0x53bfbd=_0x11cc56;_0x56fb44=0xc8;}else{_0x56fb44=0xce;}_0x2b6c4c['status'](_0x56fb44);return _0x2b6c4c[_0x9f10('0x1e')](_0x9f10('0x1f'),_0x509fba+'-'+_0x53bfbd+'/'+_0x11cc56)[_0x9f10('0x20')](_0x549217);}return null;};}function patchUpdates(_0x3a78be){return function(_0xa810c){try{jsonpatch[_0x9f10('0x21')](_0xa810c,_0x3a78be,!![]);}catch(_0x27843d){return BPromise['reject'](_0x27843d);}return _0xa810c[_0x9f10('0x22')]();};}function saveUpdates(_0x58e6ba,_0x293990){return function(_0x36ace4){if(_0x36ace4){return _0x36ace4[_0x9f10('0x23')](_0x58e6ba)['then'](function(_0x2f31fb){return _0x2f31fb;});}return null;};}function removeEntity(_0x3dde2e,_0x213567){return function(_0x4d21c5){if(_0x4d21c5){return _0x4d21c5[_0x9f10('0x24')]()[_0x9f10('0x25')](function(){_0x3dde2e[_0x9f10('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec07d,_0x23c2e7){return function(_0x11cae7){if(!_0x11cae7){_0x2ec07d[_0x9f10('0x26')](0x194);}return _0x11cae7;};}function handleError(_0x5e80de,_0x57539b){_0x57539b=_0x57539b||0x1f4;return function(_0x5c1800){logger[_0x9f10('0x27')](_0x5c1800['stack']);if(_0x5c1800[_0x9f10('0x28')]){delete _0x5c1800[_0x9f10('0x28')];}_0x5e80de[_0x9f10('0x18')](_0x57539b)[_0x9f10('0x29')](_0x5c1800);};}exports[_0x9f10('0x2a')]=function(_0x4f6b0c,_0x522805){var _0x22814f={},_0x40f96b={},_0xfbb37f={'count':0x0,'rows':[]};var _0x181aec=_[_0x9f10('0x2b')](db['FreshdeskField'][_0x9f10('0x2c')],function(_0x501ee){return{'name':_0x501ee[_0x9f10('0x2d')],'type':_0x501ee[_0x9f10('0x2e')]['key']};});_0x40f96b[_0x9f10('0x2f')]=_[_0x9f10('0x2b')](_0x181aec,_0x9f10('0x28'));_0x40f96b['query']=_[_0x9f10('0x30')](_0x4f6b0c['query']);_0x40f96b[_0x9f10('0x31')]=_[_0x9f10('0x32')](_0x40f96b[_0x9f10('0x2f')],_0x40f96b['query']);_0x22814f[_0x9f10('0x33')]=_[_0x9f10('0x32')](_0x40f96b[_0x9f10('0x2f')],qs[_0x9f10('0x34')](_0x4f6b0c[_0x9f10('0x35')]['fields']));_0x22814f[_0x9f10('0x33')]=_0x22814f['attributes'][_0x9f10('0x36')]?_0x22814f[_0x9f10('0x33')]:_0x40f96b[_0x9f10('0x2f')];if(!_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x37')](_0x9f10('0x38'))){_0x22814f['limit']=qs[_0x9f10('0x1b')](_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x1b')]);_0x22814f['offset']=qs[_0x9f10('0x1d')](_0x4f6b0c[_0x9f10('0x35')]['offset']);}_0x22814f[_0x9f10('0x39')]=qs['sort'](_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x3a')]);_0x22814f[_0x9f10('0x3b')]=qs[_0x9f10('0x31')](_[_0x9f10('0x3c')](_0x4f6b0c[_0x9f10('0x35')],_0x40f96b[_0x9f10('0x31')]),_0x181aec);if(_0x4f6b0c[_0x9f10('0x35')]['filter']){_0x22814f[_0x9f10('0x3b')]=_[_0x9f10('0x3d')](_0x22814f[_0x9f10('0x3b')],{'$or':_['map'](_0x181aec,function(_0x233bab){if(_0x233bab[_0x9f10('0x2e')]!=='VIRTUAL'){var _0x30b04b={};_0x30b04b[_0x233bab[_0x9f10('0x28')]]={'$like':'%'+_0x4f6b0c[_0x9f10('0x35')]['filter']+'%'};return _0x30b04b;}})});}_0x22814f=_['merge']({},_0x22814f,_0x4f6b0c[_0x9f10('0x3e')]);var _0x2ff98d={'where':_0x22814f[_0x9f10('0x3b')]};return db[_0x9f10('0x3f')][_0x9f10('0x1c')](_0x2ff98d)[_0x9f10('0x25')](function(_0x15929f){_0xfbb37f[_0x9f10('0x1c')]=_0x15929f;if(_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x40')]){_0x22814f[_0x9f10('0x41')]=[{'all':!![]}];}return db[_0x9f10('0x3f')]['findAll'](_0x22814f);})['then'](function(_0x4bb805){_0xfbb37f[_0x9f10('0x42')]=_0x4bb805;return _0xfbb37f;})['then'](respondWithFilteredResult(_0x522805,_0x22814f))[_0x9f10('0x43')](handleError(_0x522805,null));};exports[_0x9f10('0x44')]=function(_0x426d30,_0x47d25c){var _0x3cfce6={'raw':!![],'where':{'id':_0x426d30[_0x9f10('0x45')]['id']}},_0xf1164={};_0xf1164[_0x9f10('0x2f')]=_[_0x9f10('0x30')](db['FreshdeskField']['rawAttributes']);_0xf1164['query']=_[_0x9f10('0x30')](_0x426d30['query']);_0xf1164[_0x9f10('0x31')]=_['intersection'](_0xf1164[_0x9f10('0x2f')],_0xf1164[_0x9f10('0x35')]);_0x3cfce6[_0x9f10('0x33')]=_[_0x9f10('0x32')](_0xf1164['model'],qs[_0x9f10('0x34')](_0x426d30[_0x9f10('0x35')]['fields']));_0x3cfce6[_0x9f10('0x33')]=_0x3cfce6[_0x9f10('0x33')][_0x9f10('0x36')]?_0x3cfce6[_0x9f10('0x33')]:_0xf1164[_0x9f10('0x2f')];if(_0x426d30[_0x9f10('0x35')][_0x9f10('0x40')]){_0x3cfce6[_0x9f10('0x41')]=[{'all':!![]}];}_0x3cfce6=_[_0x9f10('0x3d')]({},_0x3cfce6,_0x426d30[_0x9f10('0x3e')]);return db['FreshdeskField'][_0x9f10('0x46')](_0x3cfce6)[_0x9f10('0x25')](handleEntityNotFound(_0x47d25c,null))['then'](respondWithResult(_0x47d25c,null))[_0x9f10('0x43')](handleError(_0x47d25c,null));};exports[_0x9f10('0x47')]=function(_0x1cf3eb,_0x1807b3){return db['FreshdeskField'][_0x9f10('0x47')](_0x1cf3eb[_0x9f10('0x48')],{})[_0x9f10('0x25')](respondWithResult(_0x1807b3,0xc9))[_0x9f10('0x43')](handleError(_0x1807b3,null));};exports[_0x9f10('0x23')]=function(_0x43cb31,_0x479b46){if(_0x43cb31[_0x9f10('0x48')]['id']){delete _0x43cb31[_0x9f10('0x48')]['id'];}return db[_0x9f10('0x3f')][_0x9f10('0x46')]({'where':{'id':_0x43cb31[_0x9f10('0x45')]['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x479b46,null))['then'](saveUpdates(_0x43cb31[_0x9f10('0x48')],null))[_0x9f10('0x25')](respondWithResult(_0x479b46,null))[_0x9f10('0x43')](handleError(_0x479b46,null));};exports[_0x9f10('0x24')]=function(_0x39dae3,_0x15d676){return db[_0x9f10('0x3f')][_0x9f10('0x46')]({'where':{'id':_0x39dae3['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x15d676,null))['then'](removeEntity(_0x15d676,null))[_0x9f10('0x43')](handleError(_0x15d676,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2085166..1943829 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 _0x0296=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','define'];(function(_0x476e24,_0x33a5d7){var _0x4ff712=function(_0xdb5f0b){while(--_0xdb5f0b){_0x476e24['push'](_0x476e24['shift']());}};_0x4ff712(++_0x33a5d7);}(_0x0296,0x1bf));var _0x6029=function(_0x3a0f3e,_0x52601f){_0x3a0f3e=_0x3a0f3e-0x0;var _0x300e5a=_0x0296[_0x3a0f3e];return _0x300e5a;};'use strict';var _=require(_0x6029('0x0'));var util=require('util');var logger=require(_0x6029('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6029('0x2'));var fs=require('fs');var path=require(_0x6029('0x3'));var rimraf=require('rimraf');var config=require(_0x6029('0x4'));var attributes=require(_0x6029('0x5'));module[_0x6029('0x6')]=function(_0x5701a5,_0x5419a9){return _0x5701a5[_0x6029('0x7')](_0x6029('0x8'),attributes,{'tableName':_0x6029('0x9'),'paranoid':![],'indexes':[{'name':_0x6029('0xa'),'fields':[_0x6029('0xb'),_0x6029('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e7c=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x3d5cd7,_0x3cb6d8){var _0x275da4=function(_0x92dbc1){while(--_0x92dbc1){_0x3d5cd7['push'](_0x3d5cd7['shift']());}};_0x275da4(++_0x3cb6d8);}(_0x3e7c,0x136));var _0xc3e7=function(_0x70b1d3,_0x26c29f){_0x70b1d3=_0x70b1d3-0x0;var _0x5d23a0=_0x3e7c[_0x70b1d3];return _0x5d23a0;};'use strict';var _=require(_0xc3e7('0x0'));var util=require(_0xc3e7('0x1'));var logger=require(_0xc3e7('0x2'))('api');var moment=require(_0xc3e7('0x3'));var BPromise=require(_0xc3e7('0x4'));var rp=require(_0xc3e7('0x5'));var fs=require('fs');var path=require(_0xc3e7('0x6'));var rimraf=require(_0xc3e7('0x7'));var config=require(_0xc3e7('0x8'));var attributes=require(_0xc3e7('0x9'));module['exports']=function(_0x462d29,_0x1faf3f){return _0x462d29[_0xc3e7('0xa')](_0xc3e7('0xb'),attributes,{'tableName':_0xc3e7('0xc'),'paranoid':![],'indexes':[{'name':_0xc3e7('0xd'),'fields':[_0xc3e7('0xe'),_0xc3e7('0xf')],'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 e2b76d8..7ef421c 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 _0x588c=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1882d9,_0x27c74a){var _0x54baac=function(_0x50b4ac){while(--_0x50b4ac){_0x1882d9['push'](_0x1882d9['shift']());}};_0x54baac(++_0x27c74a);}(_0x588c,0x1eb));var _0xc588=function(_0x3307ee,_0xd9c30d){_0x3307ee=_0x3307ee-0x0;var _0x24cb41=_0x588c[_0x3307ee];return _0x24cb41;};'use strict';var _=require('lodash');var util=require(_0xc588('0x0'));var moment=require(_0xc588('0x1'));var BPromise=require('bluebird');var rs=require(_0xc588('0x2'));var fs=require('fs');var Redis=require(_0xc588('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc588('0x4'));var logger=require(_0xc588('0x5'))(_0xc588('0x6'));var config=require(_0xc588('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc588('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2712a3,_0x3baf7c,_0x49b33d){return new BPromise(function(_0x137494,_0x4b1c19){return client[_0xc588('0x9')](_0x2712a3,_0x49b33d)['then'](function(_0x3d10e1){logger['info'](_0xc588('0xa'),_0x3baf7c,_0xc588('0xb'));logger[_0xc588('0xc')](_0xc588('0xd'),_0x3baf7c,_0xc588('0xb'),JSON[_0xc588('0xe')](_0x3d10e1));if(_0x3d10e1['error']){if(_0x3d10e1[_0xc588('0xf')][_0xc588('0x10')]===0x1f4){logger[_0xc588('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x3baf7c,_0x3d10e1[_0xc588('0xf')]['message']);return _0x4b1c19(_0x3d10e1[_0xc588('0xf')][_0xc588('0x11')]);}logger[_0xc588('0xf')](_0xc588('0xa'),_0x3baf7c,_0x3d10e1['error'][_0xc588('0x11')]);return _0x137494(_0x3d10e1[_0xc588('0xf')][_0xc588('0x11')]);}else{logger[_0xc588('0x12')](_0xc588('0xa'),_0x3baf7c,'request\x20sent');_0x137494(_0x3d10e1[_0xc588('0x13')]['message']);}})[_0xc588('0x14')](function(_0x559993){logger['error'](_0xc588('0xa'),_0x3baf7c,_0x559993);_0x4b1c19(_0x559993);});});} \ No newline at end of file +var _0xb87f=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment'];(function(_0x2e7c81,_0x2df2b5){var _0x5e351c=function(_0x65600e){while(--_0x65600e){_0x2e7c81['push'](_0x2e7c81['shift']());}};_0x5e351c(++_0x2df2b5);}(_0xb87f,0xa7));var _0xfb87=function(_0x174fae,_0x5d7bad){_0x174fae=_0x174fae-0x0;var _0x5d8970=_0xb87f[_0x174fae];return _0x5d8970;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfb87('0x0'));var BPromise=require(_0xfb87('0x1'));var rs=require(_0xfb87('0x2'));var fs=require('fs');var Redis=require(_0xfb87('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb87('0x4'));var logger=require(_0xfb87('0x5'))(_0xfb87('0x6'));var config=require(_0xfb87('0x7'));var jayson=require(_0xfb87('0x8'));var client=jayson[_0xfb87('0x9')][_0xfb87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x349425,_0x19710e,_0x314712){return new BPromise(function(_0x453410,_0x1842b1){return client[_0xfb87('0xb')](_0x349425,_0x314712)['then'](function(_0x11051a){logger[_0xfb87('0xc')](_0xfb87('0xd'),_0x19710e,_0xfb87('0xe'));logger[_0xfb87('0xf')](_0xfb87('0x10'),_0x19710e,_0xfb87('0xe'),JSON['stringify'](_0x11051a));if(_0x11051a[_0xfb87('0x11')]){if(_0x11051a[_0xfb87('0x11')][_0xfb87('0x12')]===0x1f4){logger['error'](_0xfb87('0xd'),_0x19710e,_0x11051a[_0xfb87('0x11')][_0xfb87('0x13')]);return _0x1842b1(_0x11051a[_0xfb87('0x11')][_0xfb87('0x13')]);}logger[_0xfb87('0x11')](_0xfb87('0xd'),_0x19710e,_0x11051a[_0xfb87('0x11')][_0xfb87('0x13')]);return _0x453410(_0x11051a['error'][_0xfb87('0x13')]);}else{logger[_0xfb87('0xc')](_0xfb87('0xd'),_0x19710e,_0xfb87('0xe'));_0x453410(_0x11051a['result'][_0xfb87('0x13')]);}})[_0xfb87('0x14')](function(_0x5de776){logger[_0xfb87('0x11')](_0xfb87('0xd'),_0x19710e,_0x5de776);_0x1842b1(_0x5de776);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2528613..9a08d6d 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 _0x3c81=['connect-timeout','express','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','multer','util'];(function(_0x3c1617,_0x5b2782){var _0x29dd37=function(_0x282dcc){while(--_0x282dcc){_0x3c1617['push'](_0x3c1617['shift']());}};_0x29dd37(++_0x5b2782);}(_0x3c81,0x102));var _0x13c8=function(_0x4b6792,_0x276b66){_0x4b6792=_0x4b6792-0x0;var _0x150de8=_0x3c81[_0x4b6792];return _0x150de8;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0xf')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x11')]);router['put'](_0x13c8('0x9'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router[_0x13c8('0x13')]('/:id',auth[_0x13c8('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9ffd=['../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x49ccd0,_0x314233){_0x49ccd0=_0x49ccd0-0x0;var _0x38ef4a=_0x9ffd[_0x49ccd0];return _0x38ef4a;};'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['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x10')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x12')]);router['put']('/:id',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller['destroy']);module[_0xd9ff('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 51ff17c..9fa90fa 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 _0x4bd3=['sequelize','STRING','remoteUri'];(function(_0x2eec7e,_0x8c4a6a){var _0x266083=function(_0x372bc7){while(--_0x372bc7){_0x2eec7e['push'](_0x2eec7e['shift']());}};_0x266083(++_0x8c4a6a);}(_0x4bd3,0x174));var _0x34bd=function(_0xe4a1a8,_0x412e8e){_0xe4a1a8=_0xe4a1a8-0x0;var _0x17eeeb=_0x4bd3[_0xe4a1a8];return _0x17eeeb;};'use strict';var Sequelize=require(_0x34bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x34bd('0x1')]},'description':{'type':Sequelize[_0x34bd('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x34bd('0x1')],'unique':_0x34bd('0x2')},'serverUrl':{'type':Sequelize[_0x34bd('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2542=['remoteUri','sequelize','exports','STRING','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2542,0x169));var _0x2254=function(_0x45900c,_0xa38510){_0x45900c=_0x45900c-0x0;var _0x28d6c8=_0x2542[_0x45900c];return _0x28d6c8;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')]},'description':{'type':Sequelize[_0x2254('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2254('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2254('0x2')],'unique':_0x2254('0x4')},'serverUrl':{'type':Sequelize[_0x2254('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 680bbc2..9da9ebd 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 _0x9811=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','limit','undefined','count','offset','apply','reject','update','destroy','then','end','error','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','find','params','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Subjects','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x232197,_0x1386ae){var _0x35fa89=function(_0x1491ab){while(--_0x1491ab){_0x232197['push'](_0x232197['shift']());}};_0x35fa89(++_0x1386ae);}(_0x9811,0x126));var _0x1981=function(_0x39d44a,_0x220893){_0x39d44a=_0x39d44a-0x0;var _0x47ce17=_0x9811[_0x39d44a];return _0x47ce17;};'use strict';var emlformat=require(_0x1981('0x0'));var rimraf=require(_0x1981('0x1'));var zipdir=require(_0x1981('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1981('0x3'));var BPromise=require(_0x1981('0x4'));var Mustache=require(_0x1981('0x5'));var util=require(_0x1981('0x6'));var path=require('path');var sox=require(_0x1981('0x7'));var csv=require(_0x1981('0x8'));var ejs=require(_0x1981('0x9'));var fs=require('fs');var fs_extra=require(_0x1981('0xa'));var _=require(_0x1981('0xb'));var squel=require('squel');var crypto=require(_0x1981('0xc'));var jsforce=require(_0x1981('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1981('0x8'));var querystring=require(_0x1981('0xe'));var Papa=require(_0x1981('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1981('0x10'));var as=require(_0x1981('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1981('0x12'))('api');var utils=require(_0x1981('0x13'));var config=require(_0x1981('0x14'));var licenseUtil=require(_0x1981('0x15'));var db=require(_0x1981('0x16'))['db'];var integrations=require(_0x1981('0x17'));function respondWithStatusCode(_0x170448,_0x4c827b){_0x4c827b=_0x4c827b||0xcc;return function(_0x13d367){if(_0x13d367){return _0x170448[_0x1981('0x18')](_0x4c827b);}return _0x170448[_0x1981('0x19')](_0x4c827b)['end']();};}function respondWithResult(_0x4fa2e7,_0x3eccc8){_0x3eccc8=_0x3eccc8||0xc8;return function(_0x5a1300){if(_0x5a1300){return _0x4fa2e7[_0x1981('0x19')](_0x3eccc8)['json'](_0x5a1300);}};}function respondWithFilteredResult(_0x5837b3,_0x383aa2){return function(_0x3e533d){if(_0x3e533d){var _0x15f22c=typeof _0x383aa2['offset']==='undefined'&&typeof _0x383aa2[_0x1981('0x1a')]===_0x1981('0x1b');var _0xa1e498=_0x3e533d[_0x1981('0x1c')];var _0x152b0d=_0x15f22c?0x0:_0x383aa2[_0x1981('0x1d')];var _0x579da1=_0x15f22c?_0x3e533d[_0x1981('0x1c')]:_0x383aa2[_0x1981('0x1d')]+_0x383aa2['limit'];var _0x5468a9;if(_0x579da1>=_0xa1e498){_0x579da1=_0xa1e498;_0x5468a9=0xc8;}else{_0x5468a9=0xce;}_0x5837b3['status'](_0x5468a9);return _0x5837b3['set']('Content-Range',_0x152b0d+'-'+_0x579da1+'/'+_0xa1e498)['json'](_0x3e533d);}return null;};}function patchUpdates(_0xc79273){return function(_0x3cbe6b){try{jsonpatch[_0x1981('0x1e')](_0x3cbe6b,_0xc79273,!![]);}catch(_0x4fa6d4){return BPromise[_0x1981('0x1f')](_0x4fa6d4);}return _0x3cbe6b['save']();};}function saveUpdates(_0x220bfa,_0x38be7f){return function(_0x56679c){if(_0x56679c){return _0x56679c[_0x1981('0x20')](_0x220bfa)['then'](function(_0x566ae2){return _0x566ae2;});}return null;};}function removeEntity(_0x1ee028,_0x341c2e){return function(_0x2b9a0c){if(_0x2b9a0c){return _0x2b9a0c[_0x1981('0x21')]()[_0x1981('0x22')](function(){_0x1ee028[_0x1981('0x19')](0xcc)[_0x1981('0x23')]();});}};}function handleEntityNotFound(_0x49138a,_0x2c2a25){return function(_0x314629){if(!_0x314629){_0x49138a[_0x1981('0x18')](0x194);}return _0x314629;};}function handleError(_0x1163ca,_0xb8c41e){_0xb8c41e=_0xb8c41e||0x1f4;return function(_0x27efd9){logger[_0x1981('0x24')](_0x27efd9['stack']);if(_0x27efd9['name']){delete _0x27efd9[_0x1981('0x25')];}_0x1163ca['status'](_0xb8c41e)[_0x1981('0x26')](_0x27efd9);};}exports['index']=function(_0x111a3a,_0x42d82c){var _0x2aa5a1={},_0x593c4c={},_0x18baa0={'count':0x0,'rows':[]};var _0x474455=_[_0x1981('0x27')](db[_0x1981('0x28')][_0x1981('0x29')],function(_0x420741){return{'name':_0x420741[_0x1981('0x2a')],'type':_0x420741[_0x1981('0x2b')][_0x1981('0x2c')]};});_0x593c4c[_0x1981('0x2d')]=_[_0x1981('0x27')](_0x474455,'name');_0x593c4c[_0x1981('0x2e')]=_[_0x1981('0x2f')](_0x111a3a[_0x1981('0x2e')]);_0x593c4c[_0x1981('0x30')]=_[_0x1981('0x31')](_0x593c4c[_0x1981('0x2d')],_0x593c4c['query']);_0x2aa5a1[_0x1981('0x32')]=_[_0x1981('0x31')](_0x593c4c[_0x1981('0x2d')],qs[_0x1981('0x33')](_0x111a3a[_0x1981('0x2e')][_0x1981('0x33')]));_0x2aa5a1[_0x1981('0x32')]=_0x2aa5a1[_0x1981('0x32')][_0x1981('0x34')]?_0x2aa5a1[_0x1981('0x32')]:_0x593c4c[_0x1981('0x2d')];if(!_0x111a3a[_0x1981('0x2e')]['hasOwnProperty']('nolimit')){_0x2aa5a1[_0x1981('0x1a')]=qs['limit'](_0x111a3a['query'][_0x1981('0x1a')]);_0x2aa5a1['offset']=qs['offset'](_0x111a3a[_0x1981('0x2e')][_0x1981('0x1d')]);}_0x2aa5a1['order']=qs[_0x1981('0x35')](_0x111a3a['query'][_0x1981('0x35')]);_0x2aa5a1[_0x1981('0x36')]=qs[_0x1981('0x30')](_['pick'](_0x111a3a[_0x1981('0x2e')],_0x593c4c[_0x1981('0x30')]),_0x474455);if(_0x111a3a[_0x1981('0x2e')][_0x1981('0x37')]){_0x2aa5a1[_0x1981('0x36')]=_[_0x1981('0x38')](_0x2aa5a1[_0x1981('0x36')],{'$or':_['map'](_0x474455,function(_0x13b7b3){if(_0x13b7b3[_0x1981('0x2b')]!==_0x1981('0x39')){var _0x338ab1={};_0x338ab1[_0x13b7b3[_0x1981('0x25')]]={'$like':'%'+_0x111a3a[_0x1981('0x2e')][_0x1981('0x37')]+'%'};return _0x338ab1;}})});}_0x2aa5a1=_[_0x1981('0x38')]({},_0x2aa5a1,_0x111a3a[_0x1981('0x3a')]);var _0x14550c={'where':_0x2aa5a1[_0x1981('0x36')]};return db[_0x1981('0x28')][_0x1981('0x1c')](_0x14550c)[_0x1981('0x22')](function(_0x245511){_0x18baa0[_0x1981('0x1c')]=_0x245511;if(_0x111a3a['query'][_0x1981('0x3b')]){_0x2aa5a1['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x1981('0x3c')](_0x2aa5a1);})[_0x1981('0x22')](function(_0x31256b){_0x18baa0[_0x1981('0x3d')]=_0x31256b;return _0x18baa0;})[_0x1981('0x22')](respondWithFilteredResult(_0x42d82c,_0x2aa5a1))[_0x1981('0x3e')](handleError(_0x42d82c,null));};exports[_0x1981('0x3f')]=function(_0x2f2e7d,_0x13b081){var _0xd6a52f={'raw':![],'where':{'id':_0x2f2e7d['params']['id']}},_0x5b8bd9={};_0x5b8bd9[_0x1981('0x2d')]=_['keys'](db[_0x1981('0x28')][_0x1981('0x29')]);_0x5b8bd9[_0x1981('0x2e')]=_[_0x1981('0x2f')](_0x2f2e7d[_0x1981('0x2e')]);_0x5b8bd9[_0x1981('0x30')]=_['intersection'](_0x5b8bd9[_0x1981('0x2d')],_0x5b8bd9['query']);_0xd6a52f[_0x1981('0x32')]=_[_0x1981('0x31')](_0x5b8bd9[_0x1981('0x2d')],qs['fields'](_0x2f2e7d[_0x1981('0x2e')][_0x1981('0x33')]));_0xd6a52f['attributes']=_0xd6a52f[_0x1981('0x32')][_0x1981('0x34')]?_0xd6a52f['attributes']:_0x5b8bd9[_0x1981('0x2d')];if(_0x2f2e7d[_0x1981('0x2e')][_0x1981('0x3b')]){_0xd6a52f[_0x1981('0x40')]=[{'all':!![]}];}_0xd6a52f=_[_0x1981('0x38')]({},_0xd6a52f,_0x2f2e7d['options']);return db[_0x1981('0x28')]['find'](_0xd6a52f)['then'](handleEntityNotFound(_0x13b081,null))['then'](respondWithResult(_0x13b081,null))[_0x1981('0x3e')](handleError(_0x13b081,null));};exports['create']=function(_0x21e2fb,_0x518faf){return db[_0x1981('0x28')][_0x1981('0x41')](_0x21e2fb[_0x1981('0x42')],{})[_0x1981('0x22')](respondWithResult(_0x518faf,0xc9))['catch'](handleError(_0x518faf,null));};exports[_0x1981('0x20')]=function(_0x396fb3,_0x30facf){if(_0x396fb3[_0x1981('0x42')]['id']){delete _0x396fb3[_0x1981('0x42')]['id'];}return db[_0x1981('0x28')][_0x1981('0x43')]({'where':{'id':_0x396fb3[_0x1981('0x44')]['id']}})[_0x1981('0x22')](handleEntityNotFound(_0x30facf,null))['then'](saveUpdates(_0x396fb3[_0x1981('0x42')],null))[_0x1981('0x22')](respondWithResult(_0x30facf,null))[_0x1981('0x3e')](handleError(_0x30facf,null));};exports[_0x1981('0x21')]=function(_0x572124,_0x1ac5bd){return db[_0x1981('0x28')][_0x1981('0x43')]({'where':{'id':_0x572124['params']['id']}})[_0x1981('0x22')](handleEntityNotFound(_0x1ac5bd,null))[_0x1981('0x22')](removeEntity(_0x1ac5bd,null))[_0x1981('0x3e')](handleError(_0x1ac5bd,null));};exports[_0x1981('0x45')]=function(_0x30a412,_0x5280b1,_0x191d81){var _0x33a686={};var _0x3dffbb={};var _0xa56475;var _0x14144d;return db[_0x1981('0x28')][_0x1981('0x46')]({'where':{'id':_0x30a412[_0x1981('0x44')]['id']}})[_0x1981('0x22')](handleEntityNotFound(_0x5280b1,null))[_0x1981('0x22')](function(_0x1e12c5){if(_0x1e12c5){_0xa56475=_0x1e12c5;_0x3dffbb['model']=_[_0x1981('0x2f')](db['FreshsalesConfiguration']['rawAttributes']);_0x3dffbb[_0x1981('0x2e')]=_[_0x1981('0x2f')](_0x30a412[_0x1981('0x2e')]);_0x3dffbb[_0x1981('0x30')]=_[_0x1981('0x31')](_0x3dffbb['model'],_0x3dffbb[_0x1981('0x2e')]);_0x33a686[_0x1981('0x32')]=_[_0x1981('0x31')](_0x3dffbb['model'],qs[_0x1981('0x33')](_0x30a412['query']['fields']));_0x33a686['attributes']=_0x33a686['attributes'][_0x1981('0x34')]?_0x33a686[_0x1981('0x32')]:_0x3dffbb[_0x1981('0x2d')];_0x33a686[_0x1981('0x47')]=qs[_0x1981('0x35')](_0x30a412[_0x1981('0x2e')][_0x1981('0x35')]);_0x33a686[_0x1981('0x36')]=qs[_0x1981('0x30')](_[_0x1981('0x48')](_0x30a412[_0x1981('0x2e')],_0x3dffbb[_0x1981('0x30')]));if(_0x30a412[_0x1981('0x2e')][_0x1981('0x37')]){_0x33a686[_0x1981('0x36')]=_['merge'](_0x33a686[_0x1981('0x36')],{'$or':_[_0x1981('0x27')](_0x33a686[_0x1981('0x32')],function(_0x5e3421){var _0x9ae294={};_0x9ae294[_0x5e3421]={'$like':'%'+_0x30a412[_0x1981('0x2e')][_0x1981('0x37')]+'%'};return _0x9ae294;})});}_0x33a686=_[_0x1981('0x38')]({},_0x33a686,_0x30a412[_0x1981('0x3a')]);return _0xa56475[_0x1981('0x45')](_0x33a686);}})[_0x1981('0x22')](function(_0x375b9d){if(_0x375b9d){_0x14144d=_0x375b9d[_0x1981('0x34')];if(!_0x30a412['query']['hasOwnProperty']('nolimit')){_0x33a686[_0x1981('0x1a')]=qs[_0x1981('0x1a')](_0x30a412[_0x1981('0x2e')][_0x1981('0x1a')]);_0x33a686[_0x1981('0x1d')]=qs[_0x1981('0x1d')](_0x30a412[_0x1981('0x2e')][_0x1981('0x1d')]);}return _0xa56475[_0x1981('0x45')](_0x33a686);}})[_0x1981('0x22')](function(_0x11d5a2){if(_0x11d5a2){return _0x11d5a2?{'count':_0x14144d,'rows':_0x11d5a2}:null;}})[_0x1981('0x22')](respondWithResult(_0x5280b1,null))[_0x1981('0x3e')](handleError(_0x5280b1,null));};exports[_0x1981('0x49')]=function(_0x1dbd4b,_0x4d21ec,_0x33ede8){if(_0x1dbd4b['body']['id']){delete _0x1dbd4b['body']['id'];}return db['FreshsalesAccount'][_0x1981('0x46')]({'where':{'id':_0x1dbd4b[_0x1981('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d21ec,null))['then'](function(_0x3d40f){if(_0x3d40f){_0x1dbd4b[_0x1981('0x42')][_0x1981('0x4a')]=_0x3d40f['id'];_0x1dbd4b['body'][_0x1981('0x4b')]=integrations['getSubjects'](_0x1dbd4b[_0x1981('0x42')]['channel'],_0x1dbd4b[_0x1981('0x42')][_0x1981('0x2b')]);_0x1dbd4b[_0x1981('0x42')]['Descriptions']=integrations[_0x1981('0x4c')](_0x1dbd4b[_0x1981('0x42')][_0x1981('0x4d')],_0x1dbd4b[_0x1981('0x42')][_0x1981('0x2b')]);return db[_0x1981('0x4e')][_0x1981('0x41')](_0x1dbd4b[_0x1981('0x42')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x1981('0x4f')],'as':_0x1981('0x50')}]});}return null;})[_0x1981('0x22')](respondWithResult(_0x4d21ec,null))[_0x1981('0x3e')](handleError(_0x4d21ec,null));};exports[_0x1981('0x51')]=function(_0x17a64e,_0x11045a,_0x48a3c3){var _0x3bb6de='';var _0x448522='';return db[_0x1981('0x28')][_0x1981('0x46')]({'where':{'id':_0x17a64e[_0x1981('0x44')]['id']},'attributes':['id',_0x1981('0x52'),_0x1981('0x53'),_0x1981('0x54')]})[_0x1981('0x22')](handleEntityNotFound(_0x11045a,null))[_0x1981('0x22')](function(_0x41f0bc){if(_0x41f0bc){_0x448522=_0x41f0bc[_0x1981('0x52')];_0x3bb6de=_0x41f0bc['remoteUri'];var _0x5244bb=_0x41f0bc[_0x1981('0x53')][_0x1981('0x55')](-0x1);if(_0x5244bb==='/'){_0x3bb6de=_0x3bb6de['substring'](0x0,_0x3bb6de[_0x1981('0x56')](_0x5244bb));}return rp({'method':_0x1981('0x57'),'uri':util[_0x1981('0x58')](_0x1981('0x59'),_0x3bb6de,_0x1981('0x5a')),'headers':{'Authorization':_0x1981('0x5b')+_0x41f0bc['apiKey']},'json':!![]});}})['then'](function(_0x577007){if(_0x577007){var _0x48bab8=_0x577007[_0x1981('0x5c')];var _0x5da816=![];var _0x459a52=null;for(_0x459a52=0x0;_0x459a52<_0x48bab8[_0x1981('0x34')];_0x459a52++){if(_0x48bab8[_0x459a52][_0x1981('0x5d')]===_0x448522){_0x5da816=!![];}}if(_0x5da816){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x1981('0x22')](respondWithResult(_0x11045a,null))[_0x1981('0x3e')](function(_0x260308){var _0x1b7d3d=_0x17a64e[_0x1981('0x2e')][_0x1981('0x5e')]?0x1f4:_0x260308[_0x1981('0x5f')]||0x1f4;logger[_0x1981('0x24')](_0x1981('0x60'),_0x1981('0x51'),_0x1b7d3d,JSON[_0x1981('0x61')](_0x260308));delete _0x260308[_0x1981('0x25')];if(_0x1b7d3d===0x191){_0x1b7d3d=0x190;}_0x11045a['status'](_0x1b7d3d)[_0x1981('0x26')](_0x17a64e['query']['test']?{'message':_0x1981('0x62'),'statusCode':_0x260308['statusCode']}:_0x260308);});}; \ No newline at end of file +var _0xc3b4=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','show','params','length','merge','find','create','body','FreshsalesConfiguration','rawAttributes','order','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshsalesField','Descriptions','getFields','findOne','username','remoteUri','apiKey','slice','substring','/api/selector/owners','users','Requested\x20Resource\x20not\x20Found','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x536f83,_0x41978f){var _0x5853b9=function(_0xa8d445){while(--_0xa8d445){_0x536f83['push'](_0x536f83['shift']());}};_0x5853b9(++_0x41978f);}(_0xc3b4,0x113));var _0x4c3b=function(_0x34c027,_0x123688){_0x34c027=_0x34c027-0x0;var _0x47bff0=_0xc3b4[_0x34c027];return _0x47bff0;};'use strict';var emlformat=require(_0x4c3b('0x0'));var rimraf=require(_0x4c3b('0x1'));var zipdir=require(_0x4c3b('0x2'));var jsonpatch=require(_0x4c3b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4c3b('0x4'));var Mustache=require(_0x4c3b('0x5'));var util=require(_0x4c3b('0x6'));var path=require(_0x4c3b('0x7'));var sox=require(_0x4c3b('0x8'));var csv=require(_0x4c3b('0x9'));var ejs=require(_0x4c3b('0xa'));var fs=require('fs');var fs_extra=require(_0x4c3b('0xb'));var _=require(_0x4c3b('0xc'));var squel=require(_0x4c3b('0xd'));var crypto=require(_0x4c3b('0xe'));var jsforce=require(_0x4c3b('0xf'));var deskjs=require(_0x4c3b('0x10'));var toCsv=require(_0x4c3b('0x9'));var querystring=require(_0x4c3b('0x11'));var Papa=require(_0x4c3b('0x12'));var Redis=require(_0x4c3b('0x13'));var authService=require(_0x4c3b('0x14'));var qs=require(_0x4c3b('0x15'));var as=require(_0x4c3b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c3b('0x17'))(_0x4c3b('0x18'));var utils=require(_0x4c3b('0x19'));var config=require(_0x4c3b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c3b('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x298573,_0x2fe83c){_0x2fe83c=_0x2fe83c||0xcc;return function(_0x1c251f){if(_0x1c251f){return _0x298573[_0x4c3b('0x1c')](_0x2fe83c);}return _0x298573[_0x4c3b('0x1d')](_0x2fe83c)['end']();};}function respondWithResult(_0x33355c,_0xb27a5d){_0xb27a5d=_0xb27a5d||0xc8;return function(_0x19aac4){if(_0x19aac4){return _0x33355c['status'](_0xb27a5d)[_0x4c3b('0x1e')](_0x19aac4);}};}function respondWithFilteredResult(_0x2ffc68,_0x53709c){return function(_0x5ea98f){if(_0x5ea98f){var _0x31be29=typeof _0x53709c[_0x4c3b('0x1f')]===_0x4c3b('0x20')&&typeof _0x53709c['limit']==='undefined';var _0x3b5477=_0x5ea98f[_0x4c3b('0x21')];var _0x1f3a64=_0x31be29?0x0:_0x53709c[_0x4c3b('0x1f')];var _0x4a4f56=_0x31be29?_0x5ea98f[_0x4c3b('0x21')]:_0x53709c[_0x4c3b('0x1f')]+_0x53709c[_0x4c3b('0x22')];var _0x6aa0f2;if(_0x4a4f56>=_0x3b5477){_0x4a4f56=_0x3b5477;_0x6aa0f2=0xc8;}else{_0x6aa0f2=0xce;}_0x2ffc68[_0x4c3b('0x1d')](_0x6aa0f2);return _0x2ffc68[_0x4c3b('0x23')](_0x4c3b('0x24'),_0x1f3a64+'-'+_0x4a4f56+'/'+_0x3b5477)[_0x4c3b('0x1e')](_0x5ea98f);}return null;};}function patchUpdates(_0x5462ff){return function(_0x1dc6ba){try{jsonpatch[_0x4c3b('0x25')](_0x1dc6ba,_0x5462ff,!![]);}catch(_0xf2cea0){return BPromise[_0x4c3b('0x26')](_0xf2cea0);}return _0x1dc6ba['save']();};}function saveUpdates(_0x591214,_0x5f01d2){return function(_0x45b6b5){if(_0x45b6b5){return _0x45b6b5[_0x4c3b('0x27')](_0x591214)[_0x4c3b('0x28')](function(_0x1cb49e){return _0x1cb49e;});}return null;};}function removeEntity(_0x5698c4,_0x1af8b5){return function(_0x4b4846){if(_0x4b4846){return _0x4b4846[_0x4c3b('0x29')]()['then'](function(){_0x5698c4[_0x4c3b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a27de,_0x12fe08){return function(_0x517345){if(!_0x517345){_0x2a27de[_0x4c3b('0x1c')](0x194);}return _0x517345;};}function handleError(_0x2ddaa8,_0x443f80){_0x443f80=_0x443f80||0x1f4;return function(_0x11a6fe){logger[_0x4c3b('0x2a')](_0x11a6fe[_0x4c3b('0x2b')]);if(_0x11a6fe[_0x4c3b('0x2c')]){delete _0x11a6fe[_0x4c3b('0x2c')];}_0x2ddaa8[_0x4c3b('0x1d')](_0x443f80)[_0x4c3b('0x2d')](_0x11a6fe);};}exports[_0x4c3b('0x2e')]=function(_0x2a9294,_0x401434){var _0x50c2cd={},_0x50e351={},_0x31e7e4={'count':0x0,'rows':[]};var _0x1f4e95=_[_0x4c3b('0x2f')](db[_0x4c3b('0x30')]['rawAttributes'],function(_0x86dddf){return{'name':_0x86dddf['fieldName'],'type':_0x86dddf[_0x4c3b('0x31')][_0x4c3b('0x32')]};});_0x50e351[_0x4c3b('0x33')]=_['map'](_0x1f4e95,_0x4c3b('0x2c'));_0x50e351[_0x4c3b('0x34')]=_[_0x4c3b('0x35')](_0x2a9294[_0x4c3b('0x34')]);_0x50e351[_0x4c3b('0x36')]=_[_0x4c3b('0x37')](_0x50e351[_0x4c3b('0x33')],_0x50e351[_0x4c3b('0x34')]);_0x50c2cd[_0x4c3b('0x38')]=_[_0x4c3b('0x37')](_0x50e351[_0x4c3b('0x33')],qs[_0x4c3b('0x39')](_0x2a9294[_0x4c3b('0x34')]['fields']));_0x50c2cd[_0x4c3b('0x38')]=_0x50c2cd[_0x4c3b('0x38')]['length']?_0x50c2cd[_0x4c3b('0x38')]:_0x50e351[_0x4c3b('0x33')];if(!_0x2a9294[_0x4c3b('0x34')][_0x4c3b('0x3a')]('nolimit')){_0x50c2cd[_0x4c3b('0x22')]=qs[_0x4c3b('0x22')](_0x2a9294[_0x4c3b('0x34')][_0x4c3b('0x22')]);_0x50c2cd[_0x4c3b('0x1f')]=qs[_0x4c3b('0x1f')](_0x2a9294[_0x4c3b('0x34')][_0x4c3b('0x1f')]);}_0x50c2cd['order']=qs[_0x4c3b('0x3b')](_0x2a9294[_0x4c3b('0x34')][_0x4c3b('0x3b')]);_0x50c2cd[_0x4c3b('0x3c')]=qs[_0x4c3b('0x36')](_[_0x4c3b('0x3d')](_0x2a9294[_0x4c3b('0x34')],_0x50e351[_0x4c3b('0x36')]),_0x1f4e95);if(_0x2a9294[_0x4c3b('0x34')][_0x4c3b('0x3e')]){_0x50c2cd['where']=_['merge'](_0x50c2cd['where'],{'$or':_[_0x4c3b('0x2f')](_0x1f4e95,function(_0x24771d){if(_0x24771d[_0x4c3b('0x31')]!==_0x4c3b('0x3f')){var _0x29ee78={};_0x29ee78[_0x24771d[_0x4c3b('0x2c')]]={'$like':'%'+_0x2a9294['query'][_0x4c3b('0x3e')]+'%'};return _0x29ee78;}})});}_0x50c2cd=_['merge']({},_0x50c2cd,_0x2a9294[_0x4c3b('0x40')]);var _0x24d1f2={'where':_0x50c2cd['where']};return db[_0x4c3b('0x30')]['count'](_0x24d1f2)[_0x4c3b('0x28')](function(_0x5d4d10){_0x31e7e4['count']=_0x5d4d10;if(_0x2a9294['query']['includeAll']){_0x50c2cd[_0x4c3b('0x41')]=[{'all':!![]}];}return db[_0x4c3b('0x30')][_0x4c3b('0x42')](_0x50c2cd);})['then'](function(_0x55f20e){_0x31e7e4['rows']=_0x55f20e;return _0x31e7e4;})['then'](respondWithFilteredResult(_0x401434,_0x50c2cd))[_0x4c3b('0x43')](handleError(_0x401434,null));};exports[_0x4c3b('0x44')]=function(_0x3fb483,_0xdb285c){var _0xe5d94b={'raw':![],'where':{'id':_0x3fb483[_0x4c3b('0x45')]['id']}},_0x5ab940={};_0x5ab940[_0x4c3b('0x33')]=_[_0x4c3b('0x35')](db[_0x4c3b('0x30')]['rawAttributes']);_0x5ab940[_0x4c3b('0x34')]=_[_0x4c3b('0x35')](_0x3fb483['query']);_0x5ab940[_0x4c3b('0x36')]=_[_0x4c3b('0x37')](_0x5ab940['model'],_0x5ab940[_0x4c3b('0x34')]);_0xe5d94b[_0x4c3b('0x38')]=_[_0x4c3b('0x37')](_0x5ab940[_0x4c3b('0x33')],qs[_0x4c3b('0x39')](_0x3fb483[_0x4c3b('0x34')][_0x4c3b('0x39')]));_0xe5d94b[_0x4c3b('0x38')]=_0xe5d94b[_0x4c3b('0x38')][_0x4c3b('0x46')]?_0xe5d94b['attributes']:_0x5ab940[_0x4c3b('0x33')];if(_0x3fb483['query']['includeAll']){_0xe5d94b[_0x4c3b('0x41')]=[{'all':!![]}];}_0xe5d94b=_[_0x4c3b('0x47')]({},_0xe5d94b,_0x3fb483[_0x4c3b('0x40')]);return db[_0x4c3b('0x30')][_0x4c3b('0x48')](_0xe5d94b)[_0x4c3b('0x28')](handleEntityNotFound(_0xdb285c,null))[_0x4c3b('0x28')](respondWithResult(_0xdb285c,null))['catch'](handleError(_0xdb285c,null));};exports[_0x4c3b('0x49')]=function(_0x55c527,_0x46d97f){return db[_0x4c3b('0x30')]['create'](_0x55c527[_0x4c3b('0x4a')],{})[_0x4c3b('0x28')](respondWithResult(_0x46d97f,0xc9))['catch'](handleError(_0x46d97f,null));};exports[_0x4c3b('0x27')]=function(_0x345d29,_0x3dec3b){if(_0x345d29['body']['id']){delete _0x345d29[_0x4c3b('0x4a')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x345d29[_0x4c3b('0x45')]['id']}})[_0x4c3b('0x28')](handleEntityNotFound(_0x3dec3b,null))[_0x4c3b('0x28')](saveUpdates(_0x345d29[_0x4c3b('0x4a')],null))[_0x4c3b('0x28')](respondWithResult(_0x3dec3b,null))['catch'](handleError(_0x3dec3b,null));};exports[_0x4c3b('0x29')]=function(_0x360acf,_0x5db4c5){return db[_0x4c3b('0x30')][_0x4c3b('0x48')]({'where':{'id':_0x360acf[_0x4c3b('0x45')]['id']}})[_0x4c3b('0x28')](handleEntityNotFound(_0x5db4c5,null))[_0x4c3b('0x28')](removeEntity(_0x5db4c5,null))[_0x4c3b('0x43')](handleError(_0x5db4c5,null));};exports['getConfigurations']=function(_0x5270c6,_0x5b7744,_0xd47828){var _0xb59f62={};var _0x2d353f={};var _0x3cf7e7;var _0x58cc87;return db[_0x4c3b('0x30')]['findOne']({'where':{'id':_0x5270c6[_0x4c3b('0x45')]['id']}})[_0x4c3b('0x28')](handleEntityNotFound(_0x5b7744,null))[_0x4c3b('0x28')](function(_0x2cb966){if(_0x2cb966){_0x3cf7e7=_0x2cb966;_0x2d353f[_0x4c3b('0x33')]=_['keys'](db[_0x4c3b('0x4b')][_0x4c3b('0x4c')]);_0x2d353f[_0x4c3b('0x34')]=_[_0x4c3b('0x35')](_0x5270c6['query']);_0x2d353f[_0x4c3b('0x36')]=_[_0x4c3b('0x37')](_0x2d353f['model'],_0x2d353f[_0x4c3b('0x34')]);_0xb59f62[_0x4c3b('0x38')]=_['intersection'](_0x2d353f['model'],qs['fields'](_0x5270c6[_0x4c3b('0x34')][_0x4c3b('0x39')]));_0xb59f62[_0x4c3b('0x38')]=_0xb59f62[_0x4c3b('0x38')][_0x4c3b('0x46')]?_0xb59f62[_0x4c3b('0x38')]:_0x2d353f[_0x4c3b('0x33')];_0xb59f62[_0x4c3b('0x4d')]=qs[_0x4c3b('0x3b')](_0x5270c6['query'][_0x4c3b('0x3b')]);_0xb59f62[_0x4c3b('0x3c')]=qs['filters'](_[_0x4c3b('0x3d')](_0x5270c6[_0x4c3b('0x34')],_0x2d353f[_0x4c3b('0x36')]));if(_0x5270c6[_0x4c3b('0x34')]['filter']){_0xb59f62['where']=_[_0x4c3b('0x47')](_0xb59f62['where'],{'$or':_['map'](_0xb59f62[_0x4c3b('0x38')],function(_0x2b416a){var _0x17a4de={};_0x17a4de[_0x2b416a]={'$like':'%'+_0x5270c6[_0x4c3b('0x34')][_0x4c3b('0x3e')]+'%'};return _0x17a4de;})});}_0xb59f62=_['merge']({},_0xb59f62,_0x5270c6[_0x4c3b('0x40')]);return _0x3cf7e7[_0x4c3b('0x4e')](_0xb59f62);}})[_0x4c3b('0x28')](function(_0x23dbb0){if(_0x23dbb0){_0x58cc87=_0x23dbb0[_0x4c3b('0x46')];if(!_0x5270c6[_0x4c3b('0x34')][_0x4c3b('0x3a')](_0x4c3b('0x4f'))){_0xb59f62[_0x4c3b('0x22')]=qs[_0x4c3b('0x22')](_0x5270c6[_0x4c3b('0x34')]['limit']);_0xb59f62[_0x4c3b('0x1f')]=qs[_0x4c3b('0x1f')](_0x5270c6[_0x4c3b('0x34')][_0x4c3b('0x1f')]);}return _0x3cf7e7[_0x4c3b('0x4e')](_0xb59f62);}})[_0x4c3b('0x28')](function(_0x2cd72d){if(_0x2cd72d){return _0x2cd72d?{'count':_0x58cc87,'rows':_0x2cd72d}:null;}})[_0x4c3b('0x28')](respondWithResult(_0x5b7744,null))[_0x4c3b('0x43')](handleError(_0x5b7744,null));};exports[_0x4c3b('0x50')]=function(_0x50fcdc,_0x4fe677,_0x45382c){if(_0x50fcdc[_0x4c3b('0x4a')]['id']){delete _0x50fcdc[_0x4c3b('0x4a')]['id'];}return db[_0x4c3b('0x30')]['findOne']({'where':{'id':_0x50fcdc[_0x4c3b('0x45')]['id']}})['then'](handleEntityNotFound(_0x4fe677,null))[_0x4c3b('0x28')](function(_0x215325){if(_0x215325){_0x50fcdc[_0x4c3b('0x4a')][_0x4c3b('0x51')]=_0x215325['id'];_0x50fcdc['body'][_0x4c3b('0x52')]=integrations[_0x4c3b('0x53')](_0x50fcdc[_0x4c3b('0x4a')][_0x4c3b('0x54')],_0x50fcdc[_0x4c3b('0x4a')][_0x4c3b('0x31')]);_0x50fcdc[_0x4c3b('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x50fcdc[_0x4c3b('0x4a')][_0x4c3b('0x54')],_0x50fcdc[_0x4c3b('0x4a')][_0x4c3b('0x31')]);return db[_0x4c3b('0x4b')][_0x4c3b('0x49')](_0x50fcdc['body'],{'include':[{'model':db[_0x4c3b('0x55')],'as':'Subjects'},{'model':db[_0x4c3b('0x55')],'as':_0x4c3b('0x56')}]});}return null;})['then'](respondWithResult(_0x4fe677,null))[_0x4c3b('0x43')](handleError(_0x4fe677,null));};exports[_0x4c3b('0x57')]=function(_0x4a8115,_0x278f29,_0x5a5a62){var _0x210c10='';var _0x252866='';return db[_0x4c3b('0x30')][_0x4c3b('0x58')]({'where':{'id':_0x4a8115[_0x4c3b('0x45')]['id']},'attributes':['id',_0x4c3b('0x59'),_0x4c3b('0x5a'),_0x4c3b('0x5b')]})[_0x4c3b('0x28')](handleEntityNotFound(_0x278f29,null))['then'](function(_0x58edee){if(_0x58edee){_0x252866=_0x58edee['username'];_0x210c10=_0x58edee['remoteUri'];var _0x569e9b=_0x58edee[_0x4c3b('0x5a')][_0x4c3b('0x5c')](-0x1);if(_0x569e9b==='/'){_0x210c10=_0x210c10[_0x4c3b('0x5d')](0x0,_0x210c10['lastIndexOf'](_0x569e9b));}return rp({'method':'GET','uri':util['format']('%s%s',_0x210c10,_0x4c3b('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x58edee[_0x4c3b('0x5b')]},'json':!![]});}})[_0x4c3b('0x28')](function(_0x574178){if(_0x574178){var _0x45dc91=_0x574178[_0x4c3b('0x5f')];var _0x5017a6=![];var _0x19e583=null;for(_0x19e583=0x0;_0x19e583<_0x45dc91[_0x4c3b('0x46')];_0x19e583++){if(_0x45dc91[_0x19e583]['email']===_0x252866){_0x5017a6=!![];}}if(_0x5017a6){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4c3b('0x60')});}}})['then'](respondWithResult(_0x278f29,null))[_0x4c3b('0x43')](function(_0x410f60){var _0x4220b2=_0x4a8115[_0x4c3b('0x34')][_0x4c3b('0x61')]?0x1f4:_0x410f60[_0x4c3b('0x62')]||0x1f4;logger[_0x4c3b('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x4c3b('0x57'),_0x4220b2,JSON['stringify'](_0x410f60));delete _0x410f60[_0x4c3b('0x2c')];if(_0x4220b2===0x191){_0x4220b2=0x190;}_0x278f29['status'](_0x4220b2)[_0x4c3b('0x2d')](_0x4a8115[_0x4c3b('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x410f60['statusCode']}:_0x410f60);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index af03c42..cbc62cc 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 _0xfb11=['lodash','../../config/logger','api','bluebird','path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x276cd6,_0x33a00c){var _0x220578=function(_0x25aad1){while(--_0x25aad1){_0x276cd6['push'](_0x276cd6['shift']());}};_0x220578(++_0x33a00c);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xfb11[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x1fb1('0x7')]=function(_0x133727,_0x4c098d){return _0x133727[_0x1fb1('0x8')](_0x1fb1('0x9'),attributes,{'tableName':_0x1fb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4137=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util','../../config/logger','api'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));var integrations=require(_0x7413('0xb'));module['exports']=function(_0xc808cd,_0x188d89){return _0xc808cd[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 2024a4d..e141a1e 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 _0x1a85=['info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','include','model','map','attributes','then','ShowFreshsalesAccount','find','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x1a85,0x178));var _0x51a8=function(_0x260d17,_0x41db16){_0x260d17=_0x260d17-0x0;var _0x11dc8d=_0x1a85[_0x260d17];return _0x11dc8d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['findAll']({'raw':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x16')]===undefined?!![]:![]:!![],'where':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x17')]||null:null,'attributes':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')]['attributes']||null:null,'limit':_0x45a433[_0x51a8('0x15')]?_0x45a433['options'][_0x51a8('0x18')]||null:null,'include':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x19')]?_['map'](_0x45a433[_0x51a8('0x15')]['include'],function(_0x47f063){return{'model':db[_0x47f063[_0x51a8('0x1a')]],'as':_0x47f063['as'],'attributes':_0x47f063['attributes'],'include':_0x47f063[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x47f063[_0x51a8('0x19')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1a')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1a')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x1c150d){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger[_0x51a8('0xb')](_0x51a8('0x13'),_0x45a433,JSON[_0x51a8('0xd')](_0x1c150d));_0x23539e(_0x1c150d);})[_0x51a8('0x12')](function(_0x347a02){logger['error'](_0x51a8('0x13'),_0x347a02['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x347a02[_0x51a8('0x10')]));});});};exports[_0x51a8('0x1e')]=function(_0x41df56){var _0x2136b4=this;return new Promise(function(_0x4ea271,_0x10c19b){return db['FreshsalesAccount'][_0x51a8('0x1f')]({'raw':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x17')]||null:null,'attributes':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')][_0x51a8('0x1c')]||null:null,'include':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x19')]?_['map'](_0x41df56[_0x51a8('0x15')][_0x51a8('0x19')],function(_0x41561a){return{'model':db[_0x41561a['model']],'as':_0x41561a['as'],'attributes':_0x41561a[_0x51a8('0x1c')],'include':_0x41561a[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x41561a[_0x51a8('0x19')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1b')](_0x41c020[_0x51a8('0x19')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1a')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes']};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x38aa25){logger[_0x51a8('0x8')](_0x51a8('0x1e'),_0x41df56);logger[_0x51a8('0xb')](_0x51a8('0x1e'),_0x41df56,JSON['stringify'](_0x38aa25));_0x4ea271(_0x38aa25);})['catch'](function(_0x377b4c){logger['error']('ShowFreshsalesAccount',_0x377b4c['message'],_0x41df56);_0x10c19b(_0x2136b4[_0x51a8('0xe')](0x1f4,_0x377b4c[_0x51a8('0x10')]));});});}; \ No newline at end of file +var _0xb145=['stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetFreshsalesAccount','where','ShowFreshsalesAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb145,0xa3));var _0x5b14=function(_0x129fe9,_0x1f5b80){_0x129fe9=_0x129fe9-0x0;var _0x2fe9fc=_0xb145[_0x129fe9];return _0x2fe9fc;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});}exports['GetFreshsalesAccount']=function(_0x48d395){var _0x58bf3c=this;return new Promise(function(_0x3f397d,_0x3035b5){return db[_0x5b14('0x17')][_0x5b14('0x18')]({'raw':_0x48d395[_0x5b14('0x19')]?_0x48d395[_0x5b14('0x19')][_0x5b14('0x1a')]===undefined?!![]:![]:!![],'where':_0x48d395['options']?_0x48d395['options']['where']||null:null,'attributes':_0x48d395[_0x5b14('0x19')]?_0x48d395[_0x5b14('0x19')][_0x5b14('0x1b')]||null:null,'limit':_0x48d395[_0x5b14('0x19')]?_0x48d395['options'][_0x5b14('0x1c')]||null:null,'include':_0x48d395[_0x5b14('0x19')]?_0x48d395['options'][_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x48d395['options'][_0x5b14('0x1d')],function(_0x54073f){return{'model':db[_0x54073f['model']],'as':_0x54073f['as'],'attributes':_0x54073f['attributes'],'include':_0x54073f['include']?_[_0x5b14('0x1e')](_0x54073f[_0x5b14('0x1d')],function(_0x153a25){return{'model':db[_0x153a25['model']],'as':_0x153a25['as'],'attributes':_0x153a25[_0x5b14('0x1b')],'include':_0x153a25[_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x153a25[_0x5b14('0x1d')],function(_0xe6851b){return{'model':db[_0xe6851b[_0x5b14('0x1f')]],'as':_0xe6851b['as'],'attributes':_0xe6851b[_0x5b14('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b14('0x20')](function(_0x296d65){logger[_0x5b14('0xd')](_0x5b14('0x21'),_0x48d395);logger[_0x5b14('0xf')](_0x5b14('0x21'),_0x48d395,JSON[_0x5b14('0x11')](_0x296d65));_0x3f397d(_0x296d65);})['catch'](function(_0x370fcd){logger[_0x5b14('0x12')]('GetFreshsalesAccount',_0x370fcd['message'],_0x48d395);_0x3035b5(_0x58bf3c[_0x5b14('0x12')](0x1f4,_0x370fcd[_0x5b14('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x4c1f0e){var _0x21b43b=this;return new Promise(function(_0x4d3905,_0x38c665){return db[_0x5b14('0x17')]['find']({'raw':_0x4c1f0e['options']?_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c1f0e[_0x5b14('0x19')]?_0x4c1f0e['options'][_0x5b14('0x22')]||null:null,'attributes':_0x4c1f0e['options']?_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1b')]||null:null,'include':_0x4c1f0e[_0x5b14('0x19')]?_0x4c1f0e[_0x5b14('0x19')]['include']?_[_0x5b14('0x1e')](_0x4c1f0e[_0x5b14('0x19')][_0x5b14('0x1d')],function(_0x37f62c){return{'model':db[_0x37f62c['model']],'as':_0x37f62c['as'],'attributes':_0x37f62c[_0x5b14('0x1b')],'include':_0x37f62c[_0x5b14('0x1d')]?_[_0x5b14('0x1e')](_0x37f62c['include'],function(_0x2fe74d){return{'model':db[_0x2fe74d['model']],'as':_0x2fe74d['as'],'attributes':_0x2fe74d[_0x5b14('0x1b')],'include':_0x2fe74d[_0x5b14('0x1d')]?_['map'](_0x2fe74d[_0x5b14('0x1d')],function(_0x2a83d4){return{'model':db[_0x2a83d4['model']],'as':_0x2a83d4['as'],'attributes':_0x2a83d4[_0x5b14('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ce6bb){logger[_0x5b14('0xd')](_0x5b14('0x23'),_0x4c1f0e);logger[_0x5b14('0xf')]('ShowFreshsalesAccount',_0x4c1f0e,JSON[_0x5b14('0x11')](_0x1ce6bb));_0x4d3905(_0x1ce6bb);})[_0x5b14('0x16')](function(_0x15d4c4){logger[_0x5b14('0x12')](_0x5b14('0x23'),_0x15d4c4[_0x5b14('0x14')],_0x4c1f0e);_0x38c665(_0x21b43b[_0x5b14('0x12')](0x1f4,_0x15d4c4[_0x5b14('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 7aa46f0..c081f87 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 _0x7a75=['/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','put','update','delete','multer','express','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x392fb0,_0xe5ad08){var _0x16a1f5=function(_0x385484){while(--_0x385484){_0x392fb0['push'](_0x392fb0['shift']());}};_0x16a1f5(++_0xe5ad08);}(_0x7a75,0xd1));var _0x57a7=function(_0x123fb2,_0x10ebc7){_0x123fb2=_0x123fb2-0x0;var _0x35d94b=_0x7a75[_0x123fb2];return _0x35d94b;};'use strict';var multer=require(_0x57a7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x57a7('0x1'));var router=express[_0x57a7('0x2')]();var fs_extra=require(_0x57a7('0x3'));var auth=require(_0x57a7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x57a7('0x5'));router[_0x57a7('0x6')]('/',auth[_0x57a7('0x7')](),controller[_0x57a7('0x8')]);router[_0x57a7('0x6')](_0x57a7('0x9'),auth['isAuthenticated'](),controller[_0x57a7('0xa')]);router[_0x57a7('0x6')](_0x57a7('0xb'),auth[_0x57a7('0x7')](),controller['getSubjects']);router['get'](_0x57a7('0xc'),auth[_0x57a7('0x7')](),controller[_0x57a7('0xd')]);router[_0x57a7('0x6')](_0x57a7('0xe'),auth[_0x57a7('0x7')](),controller[_0x57a7('0xf')]);router[_0x57a7('0x10')]('/',auth[_0x57a7('0x7')](),controller['create']);router[_0x57a7('0x11')](_0x57a7('0x9'),auth[_0x57a7('0x7')](),controller[_0x57a7('0x12')]);router[_0x57a7('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1d6c=['isAuthenticated','index','/:id','show','/:id/subjects','getDescriptions','/:id/fields','getFields','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get'];(function(_0x28c97e,_0x5a8a12){var _0x32ab68=function(_0x2ac366){while(--_0x2ac366){_0x28c97e['push'](_0x28c97e['shift']());}};_0x32ab68(++_0x5a8a12);}(_0x1d6c,0xad));var _0xc1d6=function(_0x4c7a57,_0x2f26f9){_0x4c7a57=_0x4c7a57-0x0;var _0x11cff6=_0x1d6c[_0x4c7a57];return _0x11cff6;};'use strict';var multer=require(_0xc1d6('0x0'));var util=require(_0xc1d6('0x1'));var path=require(_0xc1d6('0x2'));var timeout=require(_0xc1d6('0x3'));var express=require(_0xc1d6('0x4'));var router=express['Router']();var fs_extra=require(_0xc1d6('0x5'));var auth=require(_0xc1d6('0x6'));var interaction=require(_0xc1d6('0x7'));var config=require(_0xc1d6('0x8'));var controller=require(_0xc1d6('0x9'));router[_0xc1d6('0xa')]('/',auth[_0xc1d6('0xb')](),controller[_0xc1d6('0xc')]);router[_0xc1d6('0xa')](_0xc1d6('0xd'),auth[_0xc1d6('0xb')](),controller[_0xc1d6('0xe')]);router[_0xc1d6('0xa')](_0xc1d6('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xc1d6('0xa')]('/:id/descriptions',auth[_0xc1d6('0xb')](),controller[_0xc1d6('0x10')]);router[_0xc1d6('0xa')](_0xc1d6('0x11'),auth['isAuthenticated'](),controller[_0xc1d6('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc1d6('0xd'),auth['isAuthenticated'](),controller[_0xc1d6('0x13')]);router[_0xc1d6('0x14')]('/:id',auth[_0xc1d6('0xb')](),controller[_0xc1d6('0x15')]);module[_0xc1d6('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 241a4c6..89e075d 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 _0x25f5=['sequelize','exports','STRING'];(function(_0x3a3afe,_0x15da25){var _0x262dab=function(_0x364a7f){while(--_0x364a7f){_0x3a3afe['push'](_0x3a3afe['shift']());}};_0x262dab(++_0x15da25);}(_0x25f5,0xa5));var _0x525f=function(_0x301efe,_0x338d14){_0x301efe=_0x301efe-0x0;var _0x5d44c3=_0x25f5[_0x301efe];return _0x5d44c3;};'use strict';var Sequelize=require(_0x525f('0x0'));module[_0x525f('0x1')]={'name':{'type':Sequelize[_0x525f('0x2')]},'description':{'type':Sequelize[_0x525f('0x2')]}}; \ No newline at end of file +var _0x739c=['STRING','sequelize','exports'];(function(_0x4041ca,_0x38690a){var _0x48543b=function(_0x54e1be){while(--_0x54e1be){_0x4041ca['push'](_0x4041ca['shift']());}};_0x48543b(++_0x38690a);}(_0x739c,0xca));var _0xc739=function(_0x48c8dd,_0x195db1){_0x48c8dd=_0x48c8dd-0x0;var _0x721b3d=_0x739c[_0x48c8dd];return _0x721b3d;};'use strict';var Sequelize=require(_0xc739('0x0'));module[_0xc739('0x1')]={'name':{'type':Sequelize[_0xc739('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index de35743..638eb47 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 _0xd6d5=['rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','name','index','fieldName','type','key','map','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','eml-format'];(function(_0x39bf57,_0x3cbdaf){var _0xf5ee77=function(_0x5cd6e6){while(--_0x5cd6e6){_0x39bf57['push'](_0x39bf57['shift']());}};_0xf5ee77(++_0x3cbdaf);}(_0xd6d5,0xe0));var _0x5d6d=function(_0x90a39a,_0x32020d){_0x90a39a=_0x90a39a-0x0;var _0x2b62f7=_0xd6d5[_0x90a39a];return _0x2b62f7;};'use strict';var emlformat=require(_0x5d6d('0x0'));var rimraf=require(_0x5d6d('0x1'));var zipdir=require(_0x5d6d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d6d('0x3'));var moment=require(_0x5d6d('0x4'));var BPromise=require(_0x5d6d('0x5'));var Mustache=require('mustache');var util=require(_0x5d6d('0x6'));var path=require('path');var sox=require(_0x5d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x5d6d('0x8'));var fs=require('fs');var fs_extra=require(_0x5d6d('0x9'));var _=require(_0x5d6d('0xa'));var squel=require(_0x5d6d('0xb'));var crypto=require(_0x5d6d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d6d('0xd'));var Papa=require(_0x5d6d('0xe'));var Redis=require(_0x5d6d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5d6d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d6d('0x11'));var logger=require(_0x5d6d('0x12'))('api');var utils=require(_0x5d6d('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5d6d('0x14'))['db'];function respondWithStatusCode(_0x4b9e6e,_0x5389b8){_0x5389b8=_0x5389b8||0xcc;return function(_0x13f5fc){if(_0x13f5fc){return _0x4b9e6e[_0x5d6d('0x15')](_0x5389b8);}return _0x4b9e6e[_0x5d6d('0x16')](_0x5389b8)[_0x5d6d('0x17')]();};}function respondWithResult(_0x32a0ed,_0x5103fb){_0x5103fb=_0x5103fb||0xc8;return function(_0x2649f0){if(_0x2649f0){return _0x32a0ed[_0x5d6d('0x16')](_0x5103fb)[_0x5d6d('0x18')](_0x2649f0);}};}function respondWithFilteredResult(_0x5ddf5b,_0x9893c3){return function(_0x4aa5db){if(_0x4aa5db){var _0x49676e=typeof _0x9893c3[_0x5d6d('0x19')]==='undefined'&&typeof _0x9893c3['limit']===_0x5d6d('0x1a');var _0x26f1fb=_0x4aa5db[_0x5d6d('0x1b')];var _0x777549=_0x49676e?0x0:_0x9893c3[_0x5d6d('0x19')];var _0x736c20=_0x49676e?_0x4aa5db[_0x5d6d('0x1b')]:_0x9893c3[_0x5d6d('0x19')]+_0x9893c3[_0x5d6d('0x1c')];var _0x37f86e;if(_0x736c20>=_0x26f1fb){_0x736c20=_0x26f1fb;_0x37f86e=0xc8;}else{_0x37f86e=0xce;}_0x5ddf5b[_0x5d6d('0x16')](_0x37f86e);return _0x5ddf5b['set']('Content-Range',_0x777549+'-'+_0x736c20+'/'+_0x26f1fb)['json'](_0x4aa5db);}return null;};}function patchUpdates(_0x5ab164){return function(_0x3fde6f){try{jsonpatch[_0x5d6d('0x1d')](_0x3fde6f,_0x5ab164,!![]);}catch(_0x159bf6){return BPromise[_0x5d6d('0x1e')](_0x159bf6);}return _0x3fde6f[_0x5d6d('0x1f')]();};}function saveUpdates(_0x2c024a,_0x38e98a){return function(_0x2124cd){if(_0x2124cd){return _0x2124cd[_0x5d6d('0x20')](_0x2c024a)[_0x5d6d('0x21')](function(_0x1187c5){return _0x1187c5;});}return null;};}function removeEntity(_0x2bb8fe,_0x2b90d1){return function(_0x36e398){if(_0x36e398){return _0x36e398['destroy']()[_0x5d6d('0x21')](function(){_0x2bb8fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6095,_0x210e32){return function(_0x30c92b){if(!_0x30c92b){_0x2c6095[_0x5d6d('0x15')](0x194);}return _0x30c92b;};}function handleError(_0x17d1d6,_0x2569f8){_0x2569f8=_0x2569f8||0x1f4;return function(_0x4b3138){logger['error'](_0x4b3138['stack']);if(_0x4b3138[_0x5d6d('0x22')]){delete _0x4b3138['name'];}_0x17d1d6[_0x5d6d('0x16')](_0x2569f8)['send'](_0x4b3138);};}exports[_0x5d6d('0x23')]=function(_0x4117bc,_0x397c31){var _0x4e3487={},_0x38d5a1={},_0x6a47f1={'count':0x0,'rows':[]};var _0x17d885=_['map'](db['FreshsalesConfiguration']['rawAttributes'],function(_0x47b222){return{'name':_0x47b222[_0x5d6d('0x24')],'type':_0x47b222[_0x5d6d('0x25')][_0x5d6d('0x26')]};});_0x38d5a1['model']=_[_0x5d6d('0x27')](_0x17d885,_0x5d6d('0x22'));_0x38d5a1[_0x5d6d('0x28')]=_['keys'](_0x4117bc[_0x5d6d('0x28')]);_0x38d5a1[_0x5d6d('0x29')]=_['intersection'](_0x38d5a1['model'],_0x38d5a1[_0x5d6d('0x28')]);_0x4e3487[_0x5d6d('0x2a')]=_[_0x5d6d('0x2b')](_0x38d5a1['model'],qs[_0x5d6d('0x2c')](_0x4117bc['query'][_0x5d6d('0x2c')]));_0x4e3487[_0x5d6d('0x2a')]=_0x4e3487[_0x5d6d('0x2a')][_0x5d6d('0x2d')]?_0x4e3487['attributes']:_0x38d5a1[_0x5d6d('0x2e')];if(!_0x4117bc[_0x5d6d('0x28')][_0x5d6d('0x2f')](_0x5d6d('0x30'))){_0x4e3487[_0x5d6d('0x1c')]=qs[_0x5d6d('0x1c')](_0x4117bc[_0x5d6d('0x28')]['limit']);_0x4e3487[_0x5d6d('0x19')]=qs[_0x5d6d('0x19')](_0x4117bc[_0x5d6d('0x28')]['offset']);}_0x4e3487[_0x5d6d('0x31')]=qs[_0x5d6d('0x32')](_0x4117bc[_0x5d6d('0x28')]['sort']);_0x4e3487['where']=qs[_0x5d6d('0x29')](_[_0x5d6d('0x33')](_0x4117bc[_0x5d6d('0x28')],_0x38d5a1[_0x5d6d('0x29')]),_0x17d885);if(_0x4117bc[_0x5d6d('0x28')][_0x5d6d('0x34')]){_0x4e3487[_0x5d6d('0x35')]=_['merge'](_0x4e3487[_0x5d6d('0x35')],{'$or':_[_0x5d6d('0x27')](_0x17d885,function(_0x8d06f0){if(_0x8d06f0[_0x5d6d('0x25')]!==_0x5d6d('0x36')){var _0x379a34={};_0x379a34[_0x8d06f0[_0x5d6d('0x22')]]={'$like':'%'+_0x4117bc[_0x5d6d('0x28')]['filter']+'%'};return _0x379a34;}})});}_0x4e3487=_[_0x5d6d('0x37')]({},_0x4e3487,_0x4117bc[_0x5d6d('0x38')]);var _0x4e6505={'where':_0x4e3487[_0x5d6d('0x35')]};return db[_0x5d6d('0x39')][_0x5d6d('0x1b')](_0x4e6505)['then'](function(_0x478978){_0x6a47f1[_0x5d6d('0x1b')]=_0x478978;if(_0x4117bc['query'][_0x5d6d('0x3a')]){_0x4e3487[_0x5d6d('0x3b')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x5d6d('0x3c')](_0x4e3487);})[_0x5d6d('0x21')](function(_0x36df0c){_0x6a47f1[_0x5d6d('0x3d')]=_0x36df0c;return _0x6a47f1;})['then'](respondWithFilteredResult(_0x397c31,_0x4e3487))[_0x5d6d('0x3e')](handleError(_0x397c31,null));};exports[_0x5d6d('0x3f')]=function(_0x557dfb,_0x2ff289){var _0x10d09f={'raw':![],'where':{'id':_0x557dfb[_0x5d6d('0x40')]['id']}},_0x358309={};_0x358309[_0x5d6d('0x2e')]=_[_0x5d6d('0x41')](db[_0x5d6d('0x39')][_0x5d6d('0x42')]);_0x358309[_0x5d6d('0x28')]=_['keys'](_0x557dfb[_0x5d6d('0x28')]);_0x358309['filters']=_[_0x5d6d('0x2b')](_0x358309[_0x5d6d('0x2e')],_0x358309['query']);_0x10d09f[_0x5d6d('0x2a')]=_['intersection'](_0x358309[_0x5d6d('0x2e')],qs[_0x5d6d('0x2c')](_0x557dfb[_0x5d6d('0x28')][_0x5d6d('0x2c')]));_0x10d09f[_0x5d6d('0x2a')]=_0x10d09f[_0x5d6d('0x2a')][_0x5d6d('0x2d')]?_0x10d09f['attributes']:_0x358309[_0x5d6d('0x2e')];if(_0x557dfb[_0x5d6d('0x28')][_0x5d6d('0x3a')]){_0x10d09f['include']=[{'all':!![]}];}_0x10d09f=_[_0x5d6d('0x37')]({},_0x10d09f,_0x557dfb[_0x5d6d('0x38')]);return db[_0x5d6d('0x39')][_0x5d6d('0x43')](_0x10d09f)['then'](handleEntityNotFound(_0x2ff289,null))[_0x5d6d('0x21')](respondWithResult(_0x2ff289,null))['catch'](handleError(_0x2ff289,null));};exports['create']=function(_0x1133d2,_0x1e348d){return db[_0x5d6d('0x39')][_0x5d6d('0x44')](_0x1133d2['body'],{})['then'](respondWithResult(_0x1e348d,0xc9))['catch'](handleError(_0x1e348d,null));};exports[_0x5d6d('0x20')]=function(_0xbd47ac,_0x32b15a){if(_0xbd47ac['body']['id']){delete _0xbd47ac[_0x5d6d('0x45')]['id'];}return db[_0x5d6d('0x39')][_0x5d6d('0x43')]({'where':{'id':_0xbd47ac['params']['id']}})[_0x5d6d('0x21')](handleEntityNotFound(_0x32b15a,null))[_0x5d6d('0x21')](saveUpdates(_0xbd47ac['body'],null))[_0x5d6d('0x21')](respondWithResult(_0x32b15a,null))[_0x5d6d('0x3e')](handleError(_0x32b15a,null));};exports['destroy']=function(_0x2301a8,_0x546077){return db[_0x5d6d('0x39')][_0x5d6d('0x43')]({'where':{'id':_0x2301a8[_0x5d6d('0x40')]['id']}})[_0x5d6d('0x21')](handleEntityNotFound(_0x546077,null))[_0x5d6d('0x21')](removeEntity(_0x546077,null))[_0x5d6d('0x3e')](handleError(_0x546077,null));};exports['getSubjects']=function(_0xd32284,_0x706e50,_0x3a374d){var _0x2cf8be={};var _0x4bc5be={};var _0x500edb;var _0x327184;return db[_0x5d6d('0x39')][_0x5d6d('0x46')]({'where':{'id':_0xd32284[_0x5d6d('0x40')]['id']}})['then'](handleEntityNotFound(_0x706e50,null))[_0x5d6d('0x21')](function(_0x3a76d7){if(_0x3a76d7){_0x500edb=_0x3a76d7;_0x4bc5be[_0x5d6d('0x2e')]=_[_0x5d6d('0x41')](db[_0x5d6d('0x47')][_0x5d6d('0x42')]);_0x4bc5be[_0x5d6d('0x28')]=_['keys'](_0xd32284[_0x5d6d('0x28')]);_0x4bc5be[_0x5d6d('0x29')]=_['intersection'](_0x4bc5be[_0x5d6d('0x2e')],_0x4bc5be[_0x5d6d('0x28')]);_0x2cf8be[_0x5d6d('0x2a')]=_[_0x5d6d('0x2b')](_0x4bc5be[_0x5d6d('0x2e')],qs[_0x5d6d('0x2c')](_0xd32284[_0x5d6d('0x28')]['fields']));_0x2cf8be['attributes']=_0x2cf8be[_0x5d6d('0x2a')]['length']?_0x2cf8be[_0x5d6d('0x2a')]:_0x4bc5be[_0x5d6d('0x2e')];_0x2cf8be['order']=qs['sort'](_0xd32284['query'][_0x5d6d('0x32')]);_0x2cf8be[_0x5d6d('0x35')]=qs[_0x5d6d('0x29')](_['pick'](_0xd32284[_0x5d6d('0x28')],_0x4bc5be[_0x5d6d('0x29')]));if(_0xd32284[_0x5d6d('0x28')]['filter']){_0x2cf8be['where']=_[_0x5d6d('0x37')](_0x2cf8be[_0x5d6d('0x35')],{'$or':_[_0x5d6d('0x27')](_0x2cf8be[_0x5d6d('0x2a')],function(_0x3df09a){var _0x108650={};_0x108650[_0x3df09a]={'$like':'%'+_0xd32284[_0x5d6d('0x28')][_0x5d6d('0x34')]+'%'};return _0x108650;})});}_0x2cf8be=_[_0x5d6d('0x37')]({},_0x2cf8be,_0xd32284[_0x5d6d('0x38')]);return _0x500edb['getSubjects'](_0x2cf8be);}})[_0x5d6d('0x21')](function(_0x551bf8){if(_0x551bf8){_0x327184=_0x551bf8['length'];if(!_0xd32284['query'][_0x5d6d('0x2f')](_0x5d6d('0x30'))){_0x2cf8be[_0x5d6d('0x1c')]=qs[_0x5d6d('0x1c')](_0xd32284[_0x5d6d('0x28')]['limit']);_0x2cf8be['offset']=qs[_0x5d6d('0x19')](_0xd32284['query']['offset']);}return _0x500edb[_0x5d6d('0x48')](_0x2cf8be);}})[_0x5d6d('0x21')](function(_0x3c51fd){if(_0x3c51fd){return _0x3c51fd?{'count':_0x327184,'rows':_0x3c51fd}:null;}})[_0x5d6d('0x21')](respondWithResult(_0x706e50,null))[_0x5d6d('0x3e')](handleError(_0x706e50,null));};exports[_0x5d6d('0x49')]=function(_0xacaf63,_0x4c8d06,_0xc05ea3){var _0x2bab78={};var _0x1966b0={};var _0x1aabd7;var _0x11b98c;return db[_0x5d6d('0x39')][_0x5d6d('0x46')]({'where':{'id':_0xacaf63['params']['id']}})['then'](handleEntityNotFound(_0x4c8d06,null))[_0x5d6d('0x21')](function(_0x464214){if(_0x464214){_0x1aabd7=_0x464214;_0x1966b0['model']=_['keys'](db[_0x5d6d('0x47')]['rawAttributes']);_0x1966b0['query']=_[_0x5d6d('0x41')](_0xacaf63[_0x5d6d('0x28')]);_0x1966b0[_0x5d6d('0x29')]=_[_0x5d6d('0x2b')](_0x1966b0['model'],_0x1966b0['query']);_0x2bab78[_0x5d6d('0x2a')]=_[_0x5d6d('0x2b')](_0x1966b0['model'],qs[_0x5d6d('0x2c')](_0xacaf63['query'][_0x5d6d('0x2c')]));_0x2bab78[_0x5d6d('0x2a')]=_0x2bab78[_0x5d6d('0x2a')]['length']?_0x2bab78[_0x5d6d('0x2a')]:_0x1966b0['model'];_0x2bab78[_0x5d6d('0x31')]=qs[_0x5d6d('0x32')](_0xacaf63[_0x5d6d('0x28')][_0x5d6d('0x32')]);_0x2bab78[_0x5d6d('0x35')]=qs[_0x5d6d('0x29')](_[_0x5d6d('0x33')](_0xacaf63[_0x5d6d('0x28')],_0x1966b0[_0x5d6d('0x29')]));if(_0xacaf63[_0x5d6d('0x28')]['filter']){_0x2bab78['where']=_[_0x5d6d('0x37')](_0x2bab78[_0x5d6d('0x35')],{'$or':_['map'](_0x2bab78[_0x5d6d('0x2a')],function(_0x294e81){var _0x3bbc9b={};_0x3bbc9b[_0x294e81]={'$like':'%'+_0xacaf63['query'][_0x5d6d('0x34')]+'%'};return _0x3bbc9b;})});}_0x2bab78=_[_0x5d6d('0x37')]({},_0x2bab78,_0xacaf63[_0x5d6d('0x38')]);return _0x1aabd7[_0x5d6d('0x49')](_0x2bab78);}})[_0x5d6d('0x21')](function(_0x390bac){if(_0x390bac){_0x11b98c=_0x390bac[_0x5d6d('0x2d')];if(!_0xacaf63[_0x5d6d('0x28')][_0x5d6d('0x2f')]('nolimit')){_0x2bab78[_0x5d6d('0x1c')]=qs[_0x5d6d('0x1c')](_0xacaf63[_0x5d6d('0x28')]['limit']);_0x2bab78[_0x5d6d('0x19')]=qs[_0x5d6d('0x19')](_0xacaf63[_0x5d6d('0x28')][_0x5d6d('0x19')]);}return _0x1aabd7[_0x5d6d('0x49')](_0x2bab78);}})[_0x5d6d('0x21')](function(_0x4c9451){if(_0x4c9451){return _0x4c9451?{'count':_0x11b98c,'rows':_0x4c9451}:null;}})['then'](respondWithResult(_0x4c8d06,null))[_0x5d6d('0x3e')](handleError(_0x4c8d06,null));};exports[_0x5d6d('0x4a')]=function(_0x2e2f46,_0x2210a9,_0x5d2b9f){var _0x29692c={};var _0x5f1604={};var _0x3c7c31;var _0x50b2f0;return db[_0x5d6d('0x39')][_0x5d6d('0x46')]({'where':{'id':_0x2e2f46[_0x5d6d('0x40')]['id']}})[_0x5d6d('0x21')](handleEntityNotFound(_0x2210a9,null))[_0x5d6d('0x21')](function(_0x4579db){if(_0x4579db){_0x3c7c31=_0x4579db;_0x5f1604[_0x5d6d('0x2e')]=_[_0x5d6d('0x41')](db[_0x5d6d('0x47')][_0x5d6d('0x42')]);_0x5f1604[_0x5d6d('0x28')]=_[_0x5d6d('0x41')](_0x2e2f46['query']);_0x5f1604['filters']=_[_0x5d6d('0x2b')](_0x5f1604[_0x5d6d('0x2e')],_0x5f1604[_0x5d6d('0x28')]);_0x29692c['attributes']=_[_0x5d6d('0x2b')](_0x5f1604[_0x5d6d('0x2e')],qs['fields'](_0x2e2f46[_0x5d6d('0x28')][_0x5d6d('0x2c')]));_0x29692c[_0x5d6d('0x2a')]=_0x29692c[_0x5d6d('0x2a')][_0x5d6d('0x2d')]?_0x29692c[_0x5d6d('0x2a')]:_0x5f1604[_0x5d6d('0x2e')];_0x29692c[_0x5d6d('0x31')]=qs['sort'](_0x2e2f46[_0x5d6d('0x28')]['sort']);_0x29692c[_0x5d6d('0x35')]=qs[_0x5d6d('0x29')](_[_0x5d6d('0x33')](_0x2e2f46[_0x5d6d('0x28')],_0x5f1604['filters']));if(_0x2e2f46[_0x5d6d('0x28')][_0x5d6d('0x34')]){_0x29692c[_0x5d6d('0x35')]=_['merge'](_0x29692c[_0x5d6d('0x35')],{'$or':_[_0x5d6d('0x27')](_0x29692c[_0x5d6d('0x2a')],function(_0x2ca150){var _0x3a961f={};_0x3a961f[_0x2ca150]={'$like':'%'+_0x2e2f46[_0x5d6d('0x28')][_0x5d6d('0x34')]+'%'};return _0x3a961f;})});}_0x29692c=_['merge']({},_0x29692c,_0x2e2f46[_0x5d6d('0x38')]);return _0x3c7c31[_0x5d6d('0x4a')](_0x29692c);}})[_0x5d6d('0x21')](function(_0x5d8ede){if(_0x5d8ede){_0x50b2f0=_0x5d8ede[_0x5d6d('0x2d')];if(!_0x2e2f46[_0x5d6d('0x28')][_0x5d6d('0x2f')](_0x5d6d('0x30'))){_0x29692c[_0x5d6d('0x1c')]=qs[_0x5d6d('0x1c')](_0x2e2f46[_0x5d6d('0x28')][_0x5d6d('0x1c')]);_0x29692c['offset']=qs['offset'](_0x2e2f46[_0x5d6d('0x28')][_0x5d6d('0x19')]);}return _0x3c7c31['getFields'](_0x29692c);}})['then'](function(_0x1a9e9a){if(_0x1a9e9a){return _0x1a9e9a?{'count':_0x50b2f0,'rows':_0x1a9e9a}:null;}})[_0x5d6d('0x21')](respondWithResult(_0x2210a9,null))[_0x5d6d('0x3e')](handleError(_0x2210a9,null));}; \ No newline at end of file +var _0xca7f=['filter','options','include','rows','show','params','includeAll','find','catch','create','body','getSubjects','FreshsalesField','order','findOne','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xca7f,0x1a1));var _0xfca7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xca7f[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xfca7('0x0'));var rimraf=require(_0xfca7('0x1'));var zipdir=require(_0xfca7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfca7('0x3'));var moment=require(_0xfca7('0x4'));var BPromise=require(_0xfca7('0x5'));var Mustache=require(_0xfca7('0x6'));var util=require(_0xfca7('0x7'));var path=require('path');var sox=require(_0xfca7('0x8'));var csv=require(_0xfca7('0x9'));var ejs=require(_0xfca7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfca7('0xb'));var crypto=require(_0xfca7('0xc'));var jsforce=require(_0xfca7('0xd'));var deskjs=require(_0xfca7('0xe'));var toCsv=require(_0xfca7('0x9'));var querystring=require('querystring');var Papa=require(_0xfca7('0xf'));var Redis=require('ioredis');var authService=require(_0xfca7('0x10'));var qs=require(_0xfca7('0x11'));var as=require(_0xfca7('0x12'));var hardwareService=require(_0xfca7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xfca7('0x14'));var config=require(_0xfca7('0x15'));var licenseUtil=require(_0xfca7('0x16'));var db=require(_0xfca7('0x17'))['db'];function respondWithStatusCode(_0x205d44,_0x5062e){_0x5062e=_0x5062e||0xcc;return function(_0x52d62){if(_0x52d62){return _0x205d44[_0xfca7('0x18')](_0x5062e);}return _0x205d44[_0xfca7('0x19')](_0x5062e)[_0xfca7('0x1a')]();};}function respondWithResult(_0x12d47a,_0x197946){_0x197946=_0x197946||0xc8;return function(_0x14df69){if(_0x14df69){return _0x12d47a[_0xfca7('0x19')](_0x197946)['json'](_0x14df69);}};}function respondWithFilteredResult(_0x50a976,_0x565265){return function(_0x1f1401){if(_0x1f1401){var _0x499ef9=typeof _0x565265['offset']===_0xfca7('0x1b')&&typeof _0x565265[_0xfca7('0x1c')]===_0xfca7('0x1b');var _0xed5262=_0x1f1401[_0xfca7('0x1d')];var _0x585758=_0x499ef9?0x0:_0x565265['offset'];var _0x82fd58=_0x499ef9?_0x1f1401['count']:_0x565265[_0xfca7('0x1e')]+_0x565265[_0xfca7('0x1c')];var _0x48088c;if(_0x82fd58>=_0xed5262){_0x82fd58=_0xed5262;_0x48088c=0xc8;}else{_0x48088c=0xce;}_0x50a976[_0xfca7('0x19')](_0x48088c);return _0x50a976[_0xfca7('0x1f')](_0xfca7('0x20'),_0x585758+'-'+_0x82fd58+'/'+_0xed5262)[_0xfca7('0x21')](_0x1f1401);}return null;};}function patchUpdates(_0x291cd8){return function(_0x5a34ee){try{jsonpatch[_0xfca7('0x22')](_0x5a34ee,_0x291cd8,!![]);}catch(_0x33f8a7){return BPromise[_0xfca7('0x23')](_0x33f8a7);}return _0x5a34ee[_0xfca7('0x24')]();};}function saveUpdates(_0x4beecf,_0x5b0406){return function(_0x3331a2){if(_0x3331a2){return _0x3331a2['update'](_0x4beecf)[_0xfca7('0x25')](function(_0x4ce2aa){return _0x4ce2aa;});}return null;};}function removeEntity(_0x16389d,_0x48dba9){return function(_0x2bb76c){if(_0x2bb76c){return _0x2bb76c[_0xfca7('0x26')]()[_0xfca7('0x25')](function(){_0x16389d[_0xfca7('0x19')](0xcc)[_0xfca7('0x1a')]();});}};}function handleEntityNotFound(_0x3c7ba5,_0x2271da){return function(_0x4efa0a){if(!_0x4efa0a){_0x3c7ba5[_0xfca7('0x18')](0x194);}return _0x4efa0a;};}function handleError(_0x557f97,_0x27bf55){_0x27bf55=_0x27bf55||0x1f4;return function(_0x28af41){logger['error'](_0x28af41[_0xfca7('0x27')]);if(_0x28af41[_0xfca7('0x28')]){delete _0x28af41[_0xfca7('0x28')];}_0x557f97['status'](_0x27bf55)[_0xfca7('0x29')](_0x28af41);};}exports[_0xfca7('0x2a')]=function(_0x5a0c86,_0x3ccd5f){var _0x5d776a={},_0x56c1b4={},_0x11964e={'count':0x0,'rows':[]};var _0xcd4dc8=_[_0xfca7('0x2b')](db[_0xfca7('0x2c')][_0xfca7('0x2d')],function(_0x5787aa){return{'name':_0x5787aa['fieldName'],'type':_0x5787aa[_0xfca7('0x2e')][_0xfca7('0x2f')]};});_0x56c1b4[_0xfca7('0x30')]=_[_0xfca7('0x2b')](_0xcd4dc8,_0xfca7('0x28'));_0x56c1b4[_0xfca7('0x31')]=_[_0xfca7('0x32')](_0x5a0c86[_0xfca7('0x31')]);_0x56c1b4[_0xfca7('0x33')]=_[_0xfca7('0x34')](_0x56c1b4['model'],_0x56c1b4[_0xfca7('0x31')]);_0x5d776a['attributes']=_[_0xfca7('0x34')](_0x56c1b4[_0xfca7('0x30')],qs['fields'](_0x5a0c86[_0xfca7('0x31')][_0xfca7('0x35')]));_0x5d776a[_0xfca7('0x36')]=_0x5d776a[_0xfca7('0x36')][_0xfca7('0x37')]?_0x5d776a[_0xfca7('0x36')]:_0x56c1b4[_0xfca7('0x30')];if(!_0x5a0c86[_0xfca7('0x31')][_0xfca7('0x38')](_0xfca7('0x39'))){_0x5d776a['limit']=qs[_0xfca7('0x1c')](_0x5a0c86[_0xfca7('0x31')][_0xfca7('0x1c')]);_0x5d776a[_0xfca7('0x1e')]=qs[_0xfca7('0x1e')](_0x5a0c86[_0xfca7('0x31')][_0xfca7('0x1e')]);}_0x5d776a['order']=qs[_0xfca7('0x3a')](_0x5a0c86['query'][_0xfca7('0x3a')]);_0x5d776a[_0xfca7('0x3b')]=qs[_0xfca7('0x33')](_[_0xfca7('0x3c')](_0x5a0c86[_0xfca7('0x31')],_0x56c1b4['filters']),_0xcd4dc8);if(_0x5a0c86[_0xfca7('0x31')]['filter']){_0x5d776a['where']=_[_0xfca7('0x3d')](_0x5d776a[_0xfca7('0x3b')],{'$or':_[_0xfca7('0x2b')](_0xcd4dc8,function(_0x4227af){if(_0x4227af[_0xfca7('0x2e')]!==_0xfca7('0x3e')){var _0x396ac2={};_0x396ac2[_0x4227af[_0xfca7('0x28')]]={'$like':'%'+_0x5a0c86[_0xfca7('0x31')][_0xfca7('0x3f')]+'%'};return _0x396ac2;}})});}_0x5d776a=_['merge']({},_0x5d776a,_0x5a0c86[_0xfca7('0x40')]);var _0x531baf={'where':_0x5d776a[_0xfca7('0x3b')]};return db['FreshsalesConfiguration'][_0xfca7('0x1d')](_0x531baf)['then'](function(_0x471f66){_0x11964e['count']=_0x471f66;if(_0x5a0c86[_0xfca7('0x31')]['includeAll']){_0x5d776a[_0xfca7('0x41')]=[{'all':!![]}];}return db[_0xfca7('0x2c')]['findAll'](_0x5d776a);})['then'](function(_0x4a1157){_0x11964e[_0xfca7('0x42')]=_0x4a1157;return _0x11964e;})[_0xfca7('0x25')](respondWithFilteredResult(_0x3ccd5f,_0x5d776a))['catch'](handleError(_0x3ccd5f,null));};exports[_0xfca7('0x43')]=function(_0xb796dd,_0x58f72b){var _0x17cb67={'raw':![],'where':{'id':_0xb796dd[_0xfca7('0x44')]['id']}},_0x1c77b8={};_0x1c77b8[_0xfca7('0x30')]=_[_0xfca7('0x32')](db[_0xfca7('0x2c')][_0xfca7('0x2d')]);_0x1c77b8[_0xfca7('0x31')]=_[_0xfca7('0x32')](_0xb796dd['query']);_0x1c77b8[_0xfca7('0x33')]=_[_0xfca7('0x34')](_0x1c77b8[_0xfca7('0x30')],_0x1c77b8[_0xfca7('0x31')]);_0x17cb67[_0xfca7('0x36')]=_[_0xfca7('0x34')](_0x1c77b8[_0xfca7('0x30')],qs[_0xfca7('0x35')](_0xb796dd[_0xfca7('0x31')][_0xfca7('0x35')]));_0x17cb67['attributes']=_0x17cb67[_0xfca7('0x36')]['length']?_0x17cb67[_0xfca7('0x36')]:_0x1c77b8[_0xfca7('0x30')];if(_0xb796dd['query'][_0xfca7('0x45')]){_0x17cb67[_0xfca7('0x41')]=[{'all':!![]}];}_0x17cb67=_[_0xfca7('0x3d')]({},_0x17cb67,_0xb796dd[_0xfca7('0x40')]);return db[_0xfca7('0x2c')][_0xfca7('0x46')](_0x17cb67)[_0xfca7('0x25')](handleEntityNotFound(_0x58f72b,null))['then'](respondWithResult(_0x58f72b,null))[_0xfca7('0x47')](handleError(_0x58f72b,null));};exports[_0xfca7('0x48')]=function(_0x105893,_0x35a31c){return db[_0xfca7('0x2c')][_0xfca7('0x48')](_0x105893[_0xfca7('0x49')],{})[_0xfca7('0x25')](respondWithResult(_0x35a31c,0xc9))[_0xfca7('0x47')](handleError(_0x35a31c,null));};exports['update']=function(_0x18ab4a,_0xe64d8e){if(_0x18ab4a[_0xfca7('0x49')]['id']){delete _0x18ab4a[_0xfca7('0x49')]['id'];}return db[_0xfca7('0x2c')][_0xfca7('0x46')]({'where':{'id':_0x18ab4a[_0xfca7('0x44')]['id']}})['then'](handleEntityNotFound(_0xe64d8e,null))['then'](saveUpdates(_0x18ab4a[_0xfca7('0x49')],null))['then'](respondWithResult(_0xe64d8e,null))[_0xfca7('0x47')](handleError(_0xe64d8e,null));};exports['destroy']=function(_0x59490e,_0x4aecde){return db[_0xfca7('0x2c')][_0xfca7('0x46')]({'where':{'id':_0x59490e[_0xfca7('0x44')]['id']}})['then'](handleEntityNotFound(_0x4aecde,null))[_0xfca7('0x25')](removeEntity(_0x4aecde,null))[_0xfca7('0x47')](handleError(_0x4aecde,null));};exports[_0xfca7('0x4a')]=function(_0x37cfbd,_0x47fed6,_0x33a7de){var _0x4b2150={};var _0x1140fc={};var _0x2ebd3e;var _0x55b4e8;return db[_0xfca7('0x2c')]['findOne']({'where':{'id':_0x37cfbd['params']['id']}})[_0xfca7('0x25')](handleEntityNotFound(_0x47fed6,null))[_0xfca7('0x25')](function(_0x5275ac){if(_0x5275ac){_0x2ebd3e=_0x5275ac;_0x1140fc['model']=_[_0xfca7('0x32')](db[_0xfca7('0x4b')]['rawAttributes']);_0x1140fc[_0xfca7('0x31')]=_[_0xfca7('0x32')](_0x37cfbd[_0xfca7('0x31')]);_0x1140fc[_0xfca7('0x33')]=_[_0xfca7('0x34')](_0x1140fc['model'],_0x1140fc['query']);_0x4b2150[_0xfca7('0x36')]=_[_0xfca7('0x34')](_0x1140fc[_0xfca7('0x30')],qs[_0xfca7('0x35')](_0x37cfbd['query'][_0xfca7('0x35')]));_0x4b2150[_0xfca7('0x36')]=_0x4b2150[_0xfca7('0x36')]['length']?_0x4b2150[_0xfca7('0x36')]:_0x1140fc['model'];_0x4b2150[_0xfca7('0x4c')]=qs[_0xfca7('0x3a')](_0x37cfbd[_0xfca7('0x31')][_0xfca7('0x3a')]);_0x4b2150[_0xfca7('0x3b')]=qs[_0xfca7('0x33')](_[_0xfca7('0x3c')](_0x37cfbd['query'],_0x1140fc['filters']));if(_0x37cfbd['query'][_0xfca7('0x3f')]){_0x4b2150['where']=_[_0xfca7('0x3d')](_0x4b2150['where'],{'$or':_[_0xfca7('0x2b')](_0x4b2150[_0xfca7('0x36')],function(_0x2ff5ea){var _0x5f321b={};_0x5f321b[_0x2ff5ea]={'$like':'%'+_0x37cfbd[_0xfca7('0x31')][_0xfca7('0x3f')]+'%'};return _0x5f321b;})});}_0x4b2150=_[_0xfca7('0x3d')]({},_0x4b2150,_0x37cfbd[_0xfca7('0x40')]);return _0x2ebd3e[_0xfca7('0x4a')](_0x4b2150);}})[_0xfca7('0x25')](function(_0x3a3312){if(_0x3a3312){_0x55b4e8=_0x3a3312[_0xfca7('0x37')];if(!_0x37cfbd[_0xfca7('0x31')][_0xfca7('0x38')](_0xfca7('0x39'))){_0x4b2150[_0xfca7('0x1c')]=qs[_0xfca7('0x1c')](_0x37cfbd[_0xfca7('0x31')][_0xfca7('0x1c')]);_0x4b2150[_0xfca7('0x1e')]=qs[_0xfca7('0x1e')](_0x37cfbd[_0xfca7('0x31')]['offset']);}return _0x2ebd3e[_0xfca7('0x4a')](_0x4b2150);}})[_0xfca7('0x25')](function(_0x5c29c0){if(_0x5c29c0){return _0x5c29c0?{'count':_0x55b4e8,'rows':_0x5c29c0}:null;}})[_0xfca7('0x25')](respondWithResult(_0x47fed6,null))['catch'](handleError(_0x47fed6,null));};exports['getDescriptions']=function(_0x3b62d1,_0x2207ec,_0xc94627){var _0x45fbc9={};var _0x34adb5={};var _0x46cbee;var _0xc5b8cd;return db[_0xfca7('0x2c')][_0xfca7('0x4d')]({'where':{'id':_0x3b62d1[_0xfca7('0x44')]['id']}})[_0xfca7('0x25')](handleEntityNotFound(_0x2207ec,null))[_0xfca7('0x25')](function(_0x1bc546){if(_0x1bc546){_0x46cbee=_0x1bc546;_0x34adb5['model']=_['keys'](db[_0xfca7('0x4b')]['rawAttributes']);_0x34adb5[_0xfca7('0x31')]=_[_0xfca7('0x32')](_0x3b62d1[_0xfca7('0x31')]);_0x34adb5['filters']=_['intersection'](_0x34adb5[_0xfca7('0x30')],_0x34adb5[_0xfca7('0x31')]);_0x45fbc9[_0xfca7('0x36')]=_[_0xfca7('0x34')](_0x34adb5[_0xfca7('0x30')],qs[_0xfca7('0x35')](_0x3b62d1['query'][_0xfca7('0x35')]));_0x45fbc9[_0xfca7('0x36')]=_0x45fbc9[_0xfca7('0x36')]['length']?_0x45fbc9[_0xfca7('0x36')]:_0x34adb5['model'];_0x45fbc9['order']=qs[_0xfca7('0x3a')](_0x3b62d1[_0xfca7('0x31')][_0xfca7('0x3a')]);_0x45fbc9[_0xfca7('0x3b')]=qs[_0xfca7('0x33')](_[_0xfca7('0x3c')](_0x3b62d1[_0xfca7('0x31')],_0x34adb5[_0xfca7('0x33')]));if(_0x3b62d1['query'][_0xfca7('0x3f')]){_0x45fbc9[_0xfca7('0x3b')]=_[_0xfca7('0x3d')](_0x45fbc9[_0xfca7('0x3b')],{'$or':_[_0xfca7('0x2b')](_0x45fbc9[_0xfca7('0x36')],function(_0x13e978){var _0x186f78={};_0x186f78[_0x13e978]={'$like':'%'+_0x3b62d1[_0xfca7('0x31')][_0xfca7('0x3f')]+'%'};return _0x186f78;})});}_0x45fbc9=_['merge']({},_0x45fbc9,_0x3b62d1[_0xfca7('0x40')]);return _0x46cbee[_0xfca7('0x4e')](_0x45fbc9);}})[_0xfca7('0x25')](function(_0x17dd30){if(_0x17dd30){_0xc5b8cd=_0x17dd30[_0xfca7('0x37')];if(!_0x3b62d1['query'][_0xfca7('0x38')](_0xfca7('0x39'))){_0x45fbc9[_0xfca7('0x1c')]=qs['limit'](_0x3b62d1[_0xfca7('0x31')][_0xfca7('0x1c')]);_0x45fbc9[_0xfca7('0x1e')]=qs[_0xfca7('0x1e')](_0x3b62d1[_0xfca7('0x31')][_0xfca7('0x1e')]);}return _0x46cbee[_0xfca7('0x4e')](_0x45fbc9);}})[_0xfca7('0x25')](function(_0x45d044){if(_0x45d044){return _0x45d044?{'count':_0xc5b8cd,'rows':_0x45d044}:null;}})[_0xfca7('0x25')](respondWithResult(_0x2207ec,null))[_0xfca7('0x47')](handleError(_0x2207ec,null));};exports[_0xfca7('0x4f')]=function(_0x4e9348,_0x1eb8b8,_0x2ac728){var _0x307250={};var _0x3cf660={};var _0x1baefb;var _0xf2e75;return db[_0xfca7('0x2c')][_0xfca7('0x4d')]({'where':{'id':_0x4e9348[_0xfca7('0x44')]['id']}})[_0xfca7('0x25')](handleEntityNotFound(_0x1eb8b8,null))[_0xfca7('0x25')](function(_0x59423a){if(_0x59423a){_0x1baefb=_0x59423a;_0x3cf660[_0xfca7('0x30')]=_[_0xfca7('0x32')](db[_0xfca7('0x4b')][_0xfca7('0x2d')]);_0x3cf660[_0xfca7('0x31')]=_[_0xfca7('0x32')](_0x4e9348[_0xfca7('0x31')]);_0x3cf660['filters']=_[_0xfca7('0x34')](_0x3cf660[_0xfca7('0x30')],_0x3cf660['query']);_0x307250[_0xfca7('0x36')]=_['intersection'](_0x3cf660['model'],qs[_0xfca7('0x35')](_0x4e9348['query'][_0xfca7('0x35')]));_0x307250[_0xfca7('0x36')]=_0x307250[_0xfca7('0x36')][_0xfca7('0x37')]?_0x307250['attributes']:_0x3cf660[_0xfca7('0x30')];_0x307250[_0xfca7('0x4c')]=qs['sort'](_0x4e9348[_0xfca7('0x31')][_0xfca7('0x3a')]);_0x307250[_0xfca7('0x3b')]=qs[_0xfca7('0x33')](_[_0xfca7('0x3c')](_0x4e9348[_0xfca7('0x31')],_0x3cf660['filters']));if(_0x4e9348[_0xfca7('0x31')][_0xfca7('0x3f')]){_0x307250[_0xfca7('0x3b')]=_[_0xfca7('0x3d')](_0x307250['where'],{'$or':_['map'](_0x307250[_0xfca7('0x36')],function(_0x206b95){var _0x185356={};_0x185356[_0x206b95]={'$like':'%'+_0x4e9348['query'][_0xfca7('0x3f')]+'%'};return _0x185356;})});}_0x307250=_[_0xfca7('0x3d')]({},_0x307250,_0x4e9348[_0xfca7('0x40')]);return _0x1baefb[_0xfca7('0x4f')](_0x307250);}})[_0xfca7('0x25')](function(_0x46ea9e){if(_0x46ea9e){_0xf2e75=_0x46ea9e['length'];if(!_0x4e9348[_0xfca7('0x31')]['hasOwnProperty'](_0xfca7('0x39'))){_0x307250[_0xfca7('0x1c')]=qs[_0xfca7('0x1c')](_0x4e9348[_0xfca7('0x31')][_0xfca7('0x1c')]);_0x307250['offset']=qs[_0xfca7('0x1e')](_0x4e9348['query'][_0xfca7('0x1e')]);}return _0x1baefb['getFields'](_0x307250);}})[_0xfca7('0x25')](function(_0x3e851b){if(_0x3e851b){return _0x3e851b?{'count':_0xf2e75,'rows':_0x3e851b}:null;}})[_0xfca7('0x25')](respondWithResult(_0x1eb8b8,null))[_0xfca7('0x47')](handleError(_0x1eb8b8,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 10866e9..873c895 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 _0x51eb=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api'];(function(_0x7968c3,_0x519ba8){var _0x48270f=function(_0x25f6be){while(--_0x25f6be){_0x7968c3['push'](_0x7968c3['shift']());}};_0x48270f(++_0x519ba8);}(_0x51eb,0xea));var _0xb51e=function(_0x2a0ded,_0x6376a1){_0x2a0ded=_0x2a0ded-0x0;var _0x38accc=_0x51eb[_0x2a0ded];return _0x38accc;};'use strict';var _=require(_0xb51e('0x0'));var util=require(_0xb51e('0x1'));var logger=require(_0xb51e('0x2'))(_0xb51e('0x3'));var moment=require('moment');var BPromise=require(_0xb51e('0x4'));var rp=require(_0xb51e('0x5'));var fs=require('fs');var path=require(_0xb51e('0x6'));var rimraf=require(_0xb51e('0x7'));var config=require(_0xb51e('0x8'));var attributes=require(_0xb51e('0x9'));module[_0xb51e('0xa')]=function(_0x17e249,_0xf8971d){return _0x17e249[_0xb51e('0xb')](_0xb51e('0xc'),attributes,{'tableName':_0xb51e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x251c=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x251c,0x186));var _0xc251=function(_0x5bb6bb,_0x366538){_0x5bb6bb=_0x5bb6bb-0x0;var _0x41bfb1=_0x251c[_0x5bb6bb];return _0x41bfb1;};'use strict';var _=require(_0xc251('0x0'));var util=require(_0xc251('0x1'));var logger=require('../../config/logger')(_0xc251('0x2'));var moment=require(_0xc251('0x3'));var BPromise=require(_0xc251('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc251('0x5'));var rimraf=require(_0xc251('0x6'));var config=require(_0xc251('0x7'));var attributes=require(_0xc251('0x8'));module['exports']=function(_0x4082e5,_0x372c5e){return _0x4082e5[_0xc251('0x9')](_0xc251('0xa'),attributes,{'tableName':_0xc251('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 3b435d8..a62c932 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 _0x9af2=['code','FreshsalesConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1411b6,_0x659fc7){var _0x209300=function(_0x16e274){while(--_0x16e274){_0x1411b6['push'](_0x1411b6['shift']());}};_0x209300(++_0x659fc7);}(_0x9af2,0x117));var _0x29af=function(_0xc12b08,_0x53a081){_0xc12b08=_0xc12b08-0x0;var _0xde87bb=_0x9af2[_0xc12b08];return _0xde87bb;};'use strict';var _=require('lodash');var util=require(_0x29af('0x0'));var moment=require(_0x29af('0x1'));var BPromise=require('bluebird');var rs=require(_0x29af('0x2'));var fs=require('fs');var Redis=require(_0x29af('0x3'));var db=require(_0x29af('0x4'))['db'];var utils=require(_0x29af('0x5'));var logger=require('../../config/logger')(_0x29af('0x6'));var config=require(_0x29af('0x7'));var jayson=require(_0x29af('0x8'));var client=jayson['client'][_0x29af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c2340,_0x57250a,_0x7eb89c){return new BPromise(function(_0x1de96d,_0x1f60b9){return client[_0x29af('0xa')](_0x3c2340,_0x7eb89c)['then'](function(_0x5955dc){logger[_0x29af('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x57250a,'request\x20sent');logger['debug'](_0x29af('0xc'),_0x57250a,'request\x20sent',JSON[_0x29af('0xd')](_0x5955dc));if(_0x5955dc[_0x29af('0xe')]){if(_0x5955dc[_0x29af('0xe')][_0x29af('0xf')]===0x1f4){logger[_0x29af('0xe')](_0x29af('0x10'),_0x57250a,_0x5955dc['error'][_0x29af('0x11')]);return _0x1f60b9(_0x5955dc[_0x29af('0xe')][_0x29af('0x11')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x57250a,_0x5955dc[_0x29af('0xe')][_0x29af('0x11')]);return _0x1de96d(_0x5955dc[_0x29af('0xe')]['message']);}else{logger['info'](_0x29af('0x10'),_0x57250a,_0x29af('0x12'));_0x1de96d(_0x5955dc[_0x29af('0x13')][_0x29af('0x11')]);}})[_0x29af('0x14')](function(_0x204046){logger[_0x29af('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x57250a,_0x204046);_0x1f60b9(_0x204046);});});} \ No newline at end of file +var _0x0807=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x0807,0xdb));var _0x7080=function(_0x189ddb,_0x5519ee){_0x189ddb=_0x189ddb-0x0;var _0x52f283=_0x0807[_0x189ddb];return _0x52f283;};'use strict';var _=require(_0x7080('0x0'));var util=require(_0x7080('0x1'));var moment=require('moment');var BPromise=require(_0x7080('0x2'));var rs=require(_0x7080('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7080('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7080('0x5'))(_0x7080('0x6'));var config=require(_0x7080('0x7'));var jayson=require(_0x7080('0x8'));var client=jayson[_0x7080('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4028dd,_0x312345,_0x2b2c3f){return new BPromise(function(_0xeb3e6d,_0xdd6bc7){return client[_0x7080('0xa')](_0x4028dd,_0x2b2c3f)['then'](function(_0x5d3b29){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x312345,_0x7080('0xb'));logger[_0x7080('0xc')](_0x7080('0xd'),_0x312345,'request\x20sent',JSON[_0x7080('0xe')](_0x5d3b29));if(_0x5d3b29[_0x7080('0xf')]){if(_0x5d3b29[_0x7080('0xf')][_0x7080('0x10')]===0x1f4){logger[_0x7080('0xf')](_0x7080('0x11'),_0x312345,_0x5d3b29['error'][_0x7080('0x12')]);return _0xdd6bc7(_0x5d3b29[_0x7080('0xf')][_0x7080('0x12')]);}logger['error'](_0x7080('0x11'),_0x312345,_0x5d3b29[_0x7080('0xf')]['message']);return _0xeb3e6d(_0x5d3b29[_0x7080('0xf')][_0x7080('0x12')]);}else{logger[_0x7080('0x13')](_0x7080('0x11'),_0x312345,'request\x20sent');_0xeb3e6d(_0x5d3b29[_0x7080('0x14')][_0x7080('0x12')]);}})['catch'](function(_0xb22dcb){logger[_0x7080('0xf')](_0x7080('0x11'),_0x312345,_0xb22dcb);_0xdd6bc7(_0xb22dcb);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index adda21e..68b8145 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 _0x28a2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','util'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var path=require(_0x228a('0x2'));var timeout=require(_0x228a('0x3'));var express=require(_0x228a('0x4'));var router=express[_0x228a('0x5')]();var fs_extra=require(_0x228a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x228a('0x7'));var config=require('../../config/environment');var controller=require(_0x228a('0x8'));router[_0x228a('0x9')]('/',auth[_0x228a('0xa')](),controller[_0x228a('0xb')]);router[_0x228a('0x9')]('/:id',auth[_0x228a('0xa')](),controller[_0x228a('0xc')]);router[_0x228a('0xd')]('/',auth[_0x228a('0xa')](),controller['create']);router[_0x228a('0xe')](_0x228a('0xf'),auth[_0x228a('0xa')](),controller[_0x228a('0x10')]);router[_0x228a('0x11')](_0x228a('0xf'),auth[_0x228a('0xa')](),controller[_0x228a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xad95=['isAuthenticated','show','post','create','update','delete','destroy','multer','util','path','Router','fs-extra','../../config/environment','get','/:id'];(function(_0x3e3f27,_0x2c2ecf){var _0x15c868=function(_0x4b348d){while(--_0x4b348d){_0x3e3f27['push'](_0x3e3f27['shift']());}};_0x15c868(++_0x2c2ecf);}(_0xad95,0x70));var _0x5ad9=function(_0x4be2c6,_0x5b9ac1){_0x4be2c6=_0x4be2c6-0x0;var _0x4fc8a9=_0xad95[_0x4be2c6];return _0x4fc8a9;};'use strict';var multer=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var path=require(_0x5ad9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5ad9('0x3')]();var fs_extra=require(_0x5ad9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5ad9('0x5'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5ad9('0x6')](_0x5ad9('0x7'),auth[_0x5ad9('0x8')](),controller[_0x5ad9('0x9')]);router[_0x5ad9('0xa')]('/',auth['isAuthenticated'](),controller[_0x5ad9('0xb')]);router['put']('/:id',auth[_0x5ad9('0x8')](),controller[_0x5ad9('0xc')]);router[_0x5ad9('0xd')]('/:id',auth[_0x5ad9('0x8')](),controller[_0x5ad9('0xe')]);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 2ab72cb..ed87324 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 _0xa039=['variable','keyValue','picklist','STRING','ENUM','customVariable','exports','string'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa039,0x1e6));var _0x9a03=function(_0x13ce30,_0x2d903f){_0x13ce30=_0x13ce30-0x0;var _0x3c7631=_0xa039[_0x13ce30];return _0x3c7631;};'use strict';var Sequelize=require('sequelize');module[_0x9a03('0x0')]={'type':{'type':Sequelize['ENUM'](_0x9a03('0x1'),_0x9a03('0x2'),'customVariable',_0x9a03('0x3'),_0x9a03('0x4')),'defaultValue':_0x9a03('0x1')},'content':{'type':Sequelize[_0x9a03('0x5')]},'key':{'type':Sequelize[_0x9a03('0x5')]},'keyType':{'type':Sequelize[_0x9a03('0x6')]('string','variable',_0x9a03('0x7'))},'keyContent':{'type':Sequelize[_0x9a03('0x5')]},'idField':{'type':Sequelize[_0x9a03('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcb95=['sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x16b8fe,_0x2b4075){var _0x456919=function(_0x49ac45){while(--_0x49ac45){_0x16b8fe['push'](_0x16b8fe['shift']());}};_0x456919(++_0x2b4075);}(_0xcb95,0x156));var _0x5cb9=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xcb95[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x5cb9('0x0'));module['exports']={'type':{'type':Sequelize[_0x5cb9('0x1')](_0x5cb9('0x2'),_0x5cb9('0x3'),_0x5cb9('0x4'),_0x5cb9('0x5'),_0x5cb9('0x6')),'defaultValue':_0x5cb9('0x2')},'content':{'type':Sequelize[_0x5cb9('0x7')]},'key':{'type':Sequelize[_0x5cb9('0x7')]},'keyType':{'type':Sequelize[_0x5cb9('0x1')](_0x5cb9('0x2'),_0x5cb9('0x3'),_0x5cb9('0x4'))},'keyContent':{'type':Sequelize[_0x5cb9('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5cb9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5cb9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 32009e3..ae22577 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 _0xdb03=['rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','FreshsalesField'];(function(_0x4f4b72,_0x218fb7){var _0x4fac1b=function(_0x423dca){while(--_0x423dca){_0x4f4b72['push'](_0x4f4b72['shift']());}};_0x4fac1b(++_0x218fb7);}(_0xdb03,0xf7));var _0x3db0=function(_0x39cc77,_0xaaf40){_0x39cc77=_0x39cc77-0x0;var _0x4943b9=_0xdb03[_0x39cc77];return _0x4943b9;};'use strict';var emlformat=require(_0x3db0('0x0'));var rimraf=require(_0x3db0('0x1'));var zipdir=require(_0x3db0('0x2'));var jsonpatch=require(_0x3db0('0x3'));var rp=require(_0x3db0('0x4'));var moment=require(_0x3db0('0x5'));var BPromise=require(_0x3db0('0x6'));var Mustache=require(_0x3db0('0x7'));var util=require('util');var path=require(_0x3db0('0x8'));var sox=require(_0x3db0('0x9'));var csv=require('to-csv');var ejs=require(_0x3db0('0xa'));var fs=require('fs');var fs_extra=require(_0x3db0('0xb'));var _=require(_0x3db0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3db0('0xd'));var deskjs=require(_0x3db0('0xe'));var toCsv=require(_0x3db0('0xf'));var querystring=require(_0x3db0('0x10'));var Papa=require(_0x3db0('0x11'));var Redis=require('ioredis');var authService=require(_0x3db0('0x12'));var qs=require(_0x3db0('0x13'));var as=require(_0x3db0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3db0('0x15'))('api');var utils=require(_0x3db0('0x16'));var config=require(_0x3db0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3db0('0x18'))['db'];function respondWithStatusCode(_0x10b307,_0x453172){_0x453172=_0x453172||0xcc;return function(_0x5accfb){if(_0x5accfb){return _0x10b307[_0x3db0('0x19')](_0x453172);}return _0x10b307[_0x3db0('0x1a')](_0x453172)[_0x3db0('0x1b')]();};}function respondWithResult(_0x14a6d2,_0x3ca61d){_0x3ca61d=_0x3ca61d||0xc8;return function(_0xb168ed){if(_0xb168ed){return _0x14a6d2[_0x3db0('0x1a')](_0x3ca61d)[_0x3db0('0x1c')](_0xb168ed);}};}function respondWithFilteredResult(_0x47cd3f,_0x29a1e2){return function(_0x2d1671){if(_0x2d1671){var _0x49795f=typeof _0x29a1e2[_0x3db0('0x1d')]===_0x3db0('0x1e')&&typeof _0x29a1e2[_0x3db0('0x1f')]===_0x3db0('0x1e');var _0x133583=_0x2d1671[_0x3db0('0x20')];var _0x20c198=_0x49795f?0x0:_0x29a1e2[_0x3db0('0x1d')];var _0x1e732d=_0x49795f?_0x2d1671['count']:_0x29a1e2['offset']+_0x29a1e2['limit'];var _0x522a96;if(_0x1e732d>=_0x133583){_0x1e732d=_0x133583;_0x522a96=0xc8;}else{_0x522a96=0xce;}_0x47cd3f[_0x3db0('0x1a')](_0x522a96);return _0x47cd3f[_0x3db0('0x21')](_0x3db0('0x22'),_0x20c198+'-'+_0x1e732d+'/'+_0x133583)[_0x3db0('0x1c')](_0x2d1671);}return null;};}function patchUpdates(_0x5297f8){return function(_0x1b0802){try{jsonpatch[_0x3db0('0x23')](_0x1b0802,_0x5297f8,!![]);}catch(_0x9bd10a){return BPromise['reject'](_0x9bd10a);}return _0x1b0802[_0x3db0('0x24')]();};}function saveUpdates(_0x52fd8b,_0x271a72){return function(_0x1dd669){if(_0x1dd669){return _0x1dd669['update'](_0x52fd8b)[_0x3db0('0x25')](function(_0x24a568){return _0x24a568;});}return null;};}function removeEntity(_0x5c94a5,_0x40ff96){return function(_0x536315){if(_0x536315){return _0x536315[_0x3db0('0x26')]()[_0x3db0('0x25')](function(){_0x5c94a5[_0x3db0('0x1a')](0xcc)[_0x3db0('0x1b')]();});}};}function handleEntityNotFound(_0x5968bb,_0x339f25){return function(_0xe78579){if(!_0xe78579){_0x5968bb[_0x3db0('0x19')](0x194);}return _0xe78579;};}function handleError(_0x112f15,_0x153b6b){_0x153b6b=_0x153b6b||0x1f4;return function(_0x19ab50){logger[_0x3db0('0x27')](_0x19ab50['stack']);if(_0x19ab50[_0x3db0('0x28')]){delete _0x19ab50['name'];}_0x112f15[_0x3db0('0x1a')](_0x153b6b)[_0x3db0('0x29')](_0x19ab50);};}exports[_0x3db0('0x2a')]=function(_0x74dde9,_0x46e817){var _0x2b1771={},_0x4da477={},_0x4f5245={'count':0x0,'rows':[]};var _0x850711=_[_0x3db0('0x2b')](db[_0x3db0('0x2c')][_0x3db0('0x2d')],function(_0x42cbb0){return{'name':_0x42cbb0[_0x3db0('0x2e')],'type':_0x42cbb0[_0x3db0('0x2f')]['key']};});_0x4da477[_0x3db0('0x30')]=_[_0x3db0('0x2b')](_0x850711,_0x3db0('0x28'));_0x4da477[_0x3db0('0x31')]=_['keys'](_0x74dde9[_0x3db0('0x31')]);_0x4da477[_0x3db0('0x32')]=_[_0x3db0('0x33')](_0x4da477[_0x3db0('0x30')],_0x4da477[_0x3db0('0x31')]);_0x2b1771[_0x3db0('0x34')]=_[_0x3db0('0x33')](_0x4da477[_0x3db0('0x30')],qs[_0x3db0('0x35')](_0x74dde9[_0x3db0('0x31')]['fields']));_0x2b1771[_0x3db0('0x34')]=_0x2b1771[_0x3db0('0x34')][_0x3db0('0x36')]?_0x2b1771[_0x3db0('0x34')]:_0x4da477[_0x3db0('0x30')];if(!_0x74dde9['query']['hasOwnProperty']('nolimit')){_0x2b1771[_0x3db0('0x1f')]=qs['limit'](_0x74dde9[_0x3db0('0x31')][_0x3db0('0x1f')]);_0x2b1771[_0x3db0('0x1d')]=qs[_0x3db0('0x1d')](_0x74dde9[_0x3db0('0x31')][_0x3db0('0x1d')]);}_0x2b1771[_0x3db0('0x37')]=qs['sort'](_0x74dde9[_0x3db0('0x31')][_0x3db0('0x38')]);_0x2b1771[_0x3db0('0x39')]=qs[_0x3db0('0x32')](_[_0x3db0('0x3a')](_0x74dde9['query'],_0x4da477[_0x3db0('0x32')]),_0x850711);if(_0x74dde9[_0x3db0('0x31')][_0x3db0('0x3b')]){_0x2b1771[_0x3db0('0x39')]=_[_0x3db0('0x3c')](_0x2b1771['where'],{'$or':_[_0x3db0('0x2b')](_0x850711,function(_0x41afb2){if(_0x41afb2[_0x3db0('0x2f')]!==_0x3db0('0x3d')){var _0x1165f7={};_0x1165f7[_0x41afb2['name']]={'$like':'%'+_0x74dde9[_0x3db0('0x31')][_0x3db0('0x3b')]+'%'};return _0x1165f7;}})});}_0x2b1771=_[_0x3db0('0x3c')]({},_0x2b1771,_0x74dde9[_0x3db0('0x3e')]);var _0x1f5d12={'where':_0x2b1771[_0x3db0('0x39')]};return db['FreshsalesField'][_0x3db0('0x20')](_0x1f5d12)[_0x3db0('0x25')](function(_0x2be3ae){_0x4f5245[_0x3db0('0x20')]=_0x2be3ae;if(_0x74dde9['query'][_0x3db0('0x3f')]){_0x2b1771[_0x3db0('0x40')]=[{'all':!![]}];}return db[_0x3db0('0x2c')][_0x3db0('0x41')](_0x2b1771);})['then'](function(_0x2f318a){_0x4f5245[_0x3db0('0x42')]=_0x2f318a;return _0x4f5245;})['then'](respondWithFilteredResult(_0x46e817,_0x2b1771))['catch'](handleError(_0x46e817,null));};exports['show']=function(_0x3b5eb9,_0x5f550f){var _0x9e0126={'raw':!![],'where':{'id':_0x3b5eb9[_0x3db0('0x43')]['id']}},_0x3c3c3d={};_0x3c3c3d[_0x3db0('0x30')]=_['keys'](db[_0x3db0('0x2c')][_0x3db0('0x2d')]);_0x3c3c3d['query']=_[_0x3db0('0x44')](_0x3b5eb9[_0x3db0('0x31')]);_0x3c3c3d[_0x3db0('0x32')]=_[_0x3db0('0x33')](_0x3c3c3d[_0x3db0('0x30')],_0x3c3c3d['query']);_0x9e0126[_0x3db0('0x34')]=_[_0x3db0('0x33')](_0x3c3c3d['model'],qs['fields'](_0x3b5eb9[_0x3db0('0x31')][_0x3db0('0x35')]));_0x9e0126[_0x3db0('0x34')]=_0x9e0126[_0x3db0('0x34')][_0x3db0('0x36')]?_0x9e0126[_0x3db0('0x34')]:_0x3c3c3d[_0x3db0('0x30')];if(_0x3b5eb9[_0x3db0('0x31')][_0x3db0('0x3f')]){_0x9e0126[_0x3db0('0x40')]=[{'all':!![]}];}_0x9e0126=_[_0x3db0('0x3c')]({},_0x9e0126,_0x3b5eb9['options']);return db[_0x3db0('0x2c')]['find'](_0x9e0126)[_0x3db0('0x25')](handleEntityNotFound(_0x5f550f,null))[_0x3db0('0x25')](respondWithResult(_0x5f550f,null))[_0x3db0('0x45')](handleError(_0x5f550f,null));};exports[_0x3db0('0x46')]=function(_0x4aa688,_0x5cb2db){return db[_0x3db0('0x2c')]['create'](_0x4aa688[_0x3db0('0x47')],{})[_0x3db0('0x25')](respondWithResult(_0x5cb2db,0xc9))[_0x3db0('0x45')](handleError(_0x5cb2db,null));};exports['update']=function(_0x54dbe8,_0x428139){if(_0x54dbe8[_0x3db0('0x47')]['id']){delete _0x54dbe8[_0x3db0('0x47')]['id'];}return db[_0x3db0('0x2c')][_0x3db0('0x48')]({'where':{'id':_0x54dbe8[_0x3db0('0x43')]['id']}})[_0x3db0('0x25')](handleEntityNotFound(_0x428139,null))['then'](saveUpdates(_0x54dbe8[_0x3db0('0x47')],null))['then'](respondWithResult(_0x428139,null))['catch'](handleError(_0x428139,null));};exports[_0x3db0('0x26')]=function(_0x493bcd,_0x28a3da){return db[_0x3db0('0x2c')][_0x3db0('0x48')]({'where':{'id':_0x493bcd[_0x3db0('0x43')]['id']}})[_0x3db0('0x25')](handleEntityNotFound(_0x28a3da,null))['then'](removeEntity(_0x28a3da,null))[_0x3db0('0x45')](handleError(_0x28a3da,null));}; \ No newline at end of file +var _0xcbae=['undefined','count','limit','status','set','apply','reject','save','destroy','then','end','error','stack','name','send','index','map','FreshsalesField','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset'];(function(_0xcc3c91,_0x3ec8a3){var _0x178bf3=function(_0xf64238){while(--_0xf64238){_0xcc3c91['push'](_0xcc3c91['shift']());}};_0x178bf3(++_0x3ec8a3);}(_0xcbae,0xc3));var _0xecba=function(_0x375ab3,_0x3c1f43){_0x375ab3=_0x375ab3-0x0;var _0x6c649f=_0xcbae[_0x375ab3];return _0x6c649f;};'use strict';var emlformat=require(_0xecba('0x0'));var rimraf=require(_0xecba('0x1'));var zipdir=require(_0xecba('0x2'));var jsonpatch=require(_0xecba('0x3'));var rp=require(_0xecba('0x4'));var moment=require(_0xecba('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xecba('0x6'));var path=require(_0xecba('0x7'));var sox=require(_0xecba('0x8'));var csv=require(_0xecba('0x9'));var ejs=require(_0xecba('0xa'));var fs=require('fs');var fs_extra=require(_0xecba('0xb'));var _=require('lodash');var squel=require(_0xecba('0xc'));var crypto=require(_0xecba('0xd'));var jsforce=require(_0xecba('0xe'));var deskjs=require(_0xecba('0xf'));var toCsv=require(_0xecba('0x9'));var querystring=require('querystring');var Papa=require(_0xecba('0x10'));var Redis=require('ioredis');var authService=require(_0xecba('0x11'));var qs=require(_0xecba('0x12'));var as=require(_0xecba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xecba('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xecba('0x15'));var licenseUtil=require(_0xecba('0x16'));var db=require(_0xecba('0x17'))['db'];function respondWithStatusCode(_0x31f3d5,_0x4c7fba){_0x4c7fba=_0x4c7fba||0xcc;return function(_0x3ba3c0){if(_0x3ba3c0){return _0x31f3d5[_0xecba('0x18')](_0x4c7fba);}return _0x31f3d5['status'](_0x4c7fba)['end']();};}function respondWithResult(_0x1662b6,_0x59c73c){_0x59c73c=_0x59c73c||0xc8;return function(_0x3f688c){if(_0x3f688c){return _0x1662b6['status'](_0x59c73c)[_0xecba('0x19')](_0x3f688c);}};}function respondWithFilteredResult(_0x871a1b,_0x1abe52){return function(_0x5bc410){if(_0x5bc410){var _0x2c7f57=typeof _0x1abe52[_0xecba('0x1a')]===_0xecba('0x1b')&&typeof _0x1abe52['limit']===_0xecba('0x1b');var _0x7b5b91=_0x5bc410['count'];var _0x46b261=_0x2c7f57?0x0:_0x1abe52[_0xecba('0x1a')];var _0x167650=_0x2c7f57?_0x5bc410[_0xecba('0x1c')]:_0x1abe52[_0xecba('0x1a')]+_0x1abe52[_0xecba('0x1d')];var _0xb8de8b;if(_0x167650>=_0x7b5b91){_0x167650=_0x7b5b91;_0xb8de8b=0xc8;}else{_0xb8de8b=0xce;}_0x871a1b[_0xecba('0x1e')](_0xb8de8b);return _0x871a1b[_0xecba('0x1f')]('Content-Range',_0x46b261+'-'+_0x167650+'/'+_0x7b5b91)['json'](_0x5bc410);}return null;};}function patchUpdates(_0x22641c){return function(_0x70aa8d){try{jsonpatch[_0xecba('0x20')](_0x70aa8d,_0x22641c,!![]);}catch(_0x154218){return BPromise[_0xecba('0x21')](_0x154218);}return _0x70aa8d[_0xecba('0x22')]();};}function saveUpdates(_0x516c62,_0x8a3f29){return function(_0x83ad65){if(_0x83ad65){return _0x83ad65['update'](_0x516c62)['then'](function(_0x203608){return _0x203608;});}return null;};}function removeEntity(_0x202cbb,_0x72c1cd){return function(_0x2c40ab){if(_0x2c40ab){return _0x2c40ab[_0xecba('0x23')]()[_0xecba('0x24')](function(){_0x202cbb[_0xecba('0x1e')](0xcc)[_0xecba('0x25')]();});}};}function handleEntityNotFound(_0x3608af,_0x25812b){return function(_0x4b7c97){if(!_0x4b7c97){_0x3608af[_0xecba('0x18')](0x194);}return _0x4b7c97;};}function handleError(_0x5566d1,_0x5c326a){_0x5c326a=_0x5c326a||0x1f4;return function(_0xd88751){logger[_0xecba('0x26')](_0xd88751[_0xecba('0x27')]);if(_0xd88751[_0xecba('0x28')]){delete _0xd88751[_0xecba('0x28')];}_0x5566d1[_0xecba('0x1e')](_0x5c326a)[_0xecba('0x29')](_0xd88751);};}exports[_0xecba('0x2a')]=function(_0x43ac16,_0x545773){var _0x1e7d8e={},_0x349987={},_0x368541={'count':0x0,'rows':[]};var _0x143628=_[_0xecba('0x2b')](db[_0xecba('0x2c')]['rawAttributes'],function(_0x3b24ab){return{'name':_0x3b24ab['fieldName'],'type':_0x3b24ab['type']['key']};});_0x349987['model']=_[_0xecba('0x2b')](_0x143628,_0xecba('0x28'));_0x349987['query']=_[_0xecba('0x2d')](_0x43ac16[_0xecba('0x2e')]);_0x349987[_0xecba('0x2f')]=_[_0xecba('0x30')](_0x349987[_0xecba('0x31')],_0x349987[_0xecba('0x2e')]);_0x1e7d8e[_0xecba('0x32')]=_['intersection'](_0x349987['model'],qs[_0xecba('0x33')](_0x43ac16[_0xecba('0x2e')]['fields']));_0x1e7d8e[_0xecba('0x32')]=_0x1e7d8e[_0xecba('0x32')][_0xecba('0x34')]?_0x1e7d8e[_0xecba('0x32')]:_0x349987[_0xecba('0x31')];if(!_0x43ac16[_0xecba('0x2e')][_0xecba('0x35')](_0xecba('0x36'))){_0x1e7d8e[_0xecba('0x1d')]=qs[_0xecba('0x1d')](_0x43ac16[_0xecba('0x2e')][_0xecba('0x1d')]);_0x1e7d8e[_0xecba('0x1a')]=qs['offset'](_0x43ac16['query'][_0xecba('0x1a')]);}_0x1e7d8e[_0xecba('0x37')]=qs['sort'](_0x43ac16[_0xecba('0x2e')][_0xecba('0x38')]);_0x1e7d8e[_0xecba('0x39')]=qs['filters'](_[_0xecba('0x3a')](_0x43ac16[_0xecba('0x2e')],_0x349987['filters']),_0x143628);if(_0x43ac16['query'][_0xecba('0x3b')]){_0x1e7d8e[_0xecba('0x39')]=_['merge'](_0x1e7d8e['where'],{'$or':_[_0xecba('0x2b')](_0x143628,function(_0x37e735){if(_0x37e735[_0xecba('0x3c')]!=='VIRTUAL'){var _0x4e7974={};_0x4e7974[_0x37e735[_0xecba('0x28')]]={'$like':'%'+_0x43ac16[_0xecba('0x2e')][_0xecba('0x3b')]+'%'};return _0x4e7974;}})});}_0x1e7d8e=_[_0xecba('0x3d')]({},_0x1e7d8e,_0x43ac16[_0xecba('0x3e')]);var _0x592545={'where':_0x1e7d8e[_0xecba('0x39')]};return db[_0xecba('0x2c')]['count'](_0x592545)[_0xecba('0x24')](function(_0x11fc30){_0x368541['count']=_0x11fc30;if(_0x43ac16[_0xecba('0x2e')]['includeAll']){_0x1e7d8e['include']=[{'all':!![]}];}return db['FreshsalesField'][_0xecba('0x3f')](_0x1e7d8e);})[_0xecba('0x24')](function(_0x57bdc4){_0x368541[_0xecba('0x40')]=_0x57bdc4;return _0x368541;})[_0xecba('0x24')](respondWithFilteredResult(_0x545773,_0x1e7d8e))[_0xecba('0x41')](handleError(_0x545773,null));};exports[_0xecba('0x42')]=function(_0x41d44b,_0x5e0c79){var _0x4dd3cc={'raw':!![],'where':{'id':_0x41d44b[_0xecba('0x43')]['id']}},_0xc11d4c={};_0xc11d4c[_0xecba('0x31')]=_[_0xecba('0x2d')](db['FreshsalesField'][_0xecba('0x44')]);_0xc11d4c[_0xecba('0x2e')]=_[_0xecba('0x2d')](_0x41d44b['query']);_0xc11d4c[_0xecba('0x2f')]=_[_0xecba('0x30')](_0xc11d4c[_0xecba('0x31')],_0xc11d4c[_0xecba('0x2e')]);_0x4dd3cc[_0xecba('0x32')]=_[_0xecba('0x30')](_0xc11d4c['model'],qs[_0xecba('0x33')](_0x41d44b[_0xecba('0x2e')][_0xecba('0x33')]));_0x4dd3cc[_0xecba('0x32')]=_0x4dd3cc[_0xecba('0x32')][_0xecba('0x34')]?_0x4dd3cc[_0xecba('0x32')]:_0xc11d4c[_0xecba('0x31')];if(_0x41d44b['query'][_0xecba('0x45')]){_0x4dd3cc[_0xecba('0x46')]=[{'all':!![]}];}_0x4dd3cc=_[_0xecba('0x3d')]({},_0x4dd3cc,_0x41d44b[_0xecba('0x3e')]);return db[_0xecba('0x2c')][_0xecba('0x47')](_0x4dd3cc)['then'](handleEntityNotFound(_0x5e0c79,null))[_0xecba('0x24')](respondWithResult(_0x5e0c79,null))[_0xecba('0x41')](handleError(_0x5e0c79,null));};exports[_0xecba('0x48')]=function(_0x387fd8,_0x59da3d){return db[_0xecba('0x2c')]['create'](_0x387fd8[_0xecba('0x49')],{})[_0xecba('0x24')](respondWithResult(_0x59da3d,0xc9))['catch'](handleError(_0x59da3d,null));};exports['update']=function(_0x1c1f1b,_0x224096){if(_0x1c1f1b['body']['id']){delete _0x1c1f1b[_0xecba('0x49')]['id'];}return db[_0xecba('0x2c')]['find']({'where':{'id':_0x1c1f1b[_0xecba('0x43')]['id']}})[_0xecba('0x24')](handleEntityNotFound(_0x224096,null))[_0xecba('0x24')](saveUpdates(_0x1c1f1b[_0xecba('0x49')],null))[_0xecba('0x24')](respondWithResult(_0x224096,null))[_0xecba('0x41')](handleError(_0x224096,null));};exports['destroy']=function(_0x38d0b3,_0x4459ae){return db[_0xecba('0x2c')]['find']({'where':{'id':_0x38d0b3['params']['id']}})[_0xecba('0x24')](handleEntityNotFound(_0x4459ae,null))[_0xecba('0x24')](removeEntity(_0x4459ae,null))['catch'](handleError(_0x4459ae,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 4791203..6b04ed5 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 _0xf69c=['./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x1daa5e,_0x1fd8c9){var _0x42e259=function(_0x3022bb){while(--_0x3022bb){_0x1daa5e['push'](_0x1daa5e['shift']());}};_0x42e259(++_0x1fd8c9);}(_0xf69c,0x1e2));var _0xcf69=function(_0x104c7a,_0x219911){_0x104c7a=_0x104c7a-0x0;var _0x2a7492=_0xf69c[_0x104c7a];return _0x2a7492;};'use strict';var _=require(_0xcf69('0x0'));var util=require(_0xcf69('0x1'));var logger=require(_0xcf69('0x2'))(_0xcf69('0x3'));var moment=require('moment');var BPromise=require(_0xcf69('0x4'));var rp=require(_0xcf69('0x5'));var fs=require('fs');var path=require(_0xcf69('0x6'));var rimraf=require('rimraf');var config=require(_0xcf69('0x7'));var attributes=require(_0xcf69('0x8'));module[_0xcf69('0x9')]=function(_0x2e8d3,_0x2ec528){return _0x2e8d3[_0xcf69('0xa')](_0xcf69('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xcf69('0xc'),'fields':[_0xcf69('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3b3=['freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x117d37,_0x3740dd){_0x117d37=_0x117d37-0x0;var _0x5ce28f=_0xe3b3[_0x117d37];return _0x5ce28f;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var logger=require(_0x3e3b('0x2'))(_0x3e3b('0x3'));var moment=require(_0x3e3b('0x4'));var BPromise=require(_0x3e3b('0x5'));var rp=require(_0x3e3b('0x6'));var fs=require('fs');var path=require(_0x3e3b('0x7'));var rimraf=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var attributes=require('./intFreshsalesField.attributes');module[_0x3e3b('0xa')]=function(_0x3fd79a,_0x410458){return _0x3fd79a['define'](_0x3e3b('0xb'),attributes,{'tableName':_0x3e3b('0xc'),'paranoid':![],'indexes':[{'name':_0x3e3b('0xd'),'fields':[_0x3e3b('0xe'),_0x3e3b('0xf')],'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 0d8e6f0..919053b 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 _0xc6ac=['http','request','then','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5095d9,_0x30489c){var _0x55d065=function(_0x5ca58c){while(--_0x5ca58c){_0x5095d9['push'](_0x5095d9['shift']());}};_0x55d065(++_0x30489c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x457074,_0x41a1a0){_0x457074=_0x457074-0x0;var _0x5843ac=_0xc6ac[_0x457074];return _0x5843ac;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0xf494,0x1c6));var _0x4f49=function(_0xf69c37,_0x35fd40){_0xf69c37=_0xf69c37-0x0;var _0x1f4eaf=_0xf494[_0xf69c37];return _0x1f4eaf;};'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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 3c951a2..c70900f 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2640c4,_0x6b8ab4){var _0x2b5b85=function(_0x4f45e6){while(--_0x4f45e6){_0x2640c4['push'](_0x2640c4['shift']());}};_0x2b5b85(++_0x6b8ab4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x132441,_0xe37b7){var _0x216a93=function(_0x3437b3){while(--_0x3437b3){_0x132441['push'](_0x132441['shift']());}};_0x216a93(++_0xe37b7);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0a24ec1..52a8793 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 _0xf0f1=['newTab','integrationTab','exports','STRING','ENUM'];(function(_0x3b60b7,_0x2204cb){var _0x22f5a2=function(_0x3050fd){while(--_0x3050fd){_0x3b60b7['push'](_0x3b60b7['shift']());}};_0x22f5a2(++_0x2204cb);}(_0xf0f1,0x110));var _0x1f0f=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xf0f1[_0x529296];return _0x1796bf;};'use strict';var Sequelize=require('sequelize');module[_0x1f0f('0x0')]={'name':{'type':Sequelize[_0x1f0f('0x1')]},'description':{'type':Sequelize[_0x1f0f('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x1f0f('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x1f0f('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x1f0f('0x1')]},'serverUrl':{'type':Sequelize[_0x1f0f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1f0f('0x2')]('integrationTab',_0x1f0f('0x3')),'defaultValue':_0x1f0f('0x4')}}; \ No newline at end of file +var _0xcefd=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x4cd2a2,_0x2acc49){var _0xfeb181=function(_0x11c960){while(--_0x11c960){_0x4cd2a2['push'](_0x4cd2a2['shift']());}};_0xfeb181(++_0x2acc49);}(_0xcefd,0x126));var _0xdcef=function(_0xa650d8,_0x6d01ef){_0xa650d8=_0xa650d8-0x0;var _0x79ce97=_0xcefd[_0xa650d8];return _0x79ce97;};'use strict';var Sequelize=require(_0xdcef('0x0'));module[_0xdcef('0x1')]={'name':{'type':Sequelize[_0xdcef('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xdcef('0x2')],'unique':_0xdcef('0x3')},'remoteUri':{'type':Sequelize[_0xdcef('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xdcef('0x2')]},'clientSecret':{'type':Sequelize[_0xdcef('0x2')]},'securityToken':{'type':Sequelize[_0xdcef('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xdcef('0x4')](_0xdcef('0x5'),_0xdcef('0x6')),'defaultValue':_0xdcef('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index dcfd60f..9ccd14b 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 _0x4e3b=['getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','count','offset','limit','set','json','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','show','rawAttributes','length','find','catch','create','body','getConfigurations','findOne','params','SalesforceConfiguration','order','hasOwnProperty','getSubjects','getDescriptions','channel','SalesforceField','Subjects','Descriptions','getFields','Task','remoteUri','clientSecret','username','securityToken','slice','substring','lastIndexOf','clientId','password','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Description','int','picklist','boolean','email','phone','remove','includes','label','custom','picklistValues','False','false'];(function(_0x2163f0,_0x4a1893){var _0x1a3ba5=function(_0x4785f3){while(--_0x4785f3){_0x2163f0['push'](_0x2163f0['shift']());}};_0x1a3ba5(++_0x4a1893);}(_0x4e3b,0x1e0));var _0xb4e3=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0x4e3b[_0x1ebb10];return _0x20d709;};'use strict';var emlformat=require(_0xb4e3('0x0'));var rimraf=require(_0xb4e3('0x1'));var zipdir=require(_0xb4e3('0x2'));var jsonpatch=require(_0xb4e3('0x3'));var rp=require('request-promise');var moment=require(_0xb4e3('0x4'));var BPromise=require(_0xb4e3('0x5'));var Mustache=require(_0xb4e3('0x6'));var util=require(_0xb4e3('0x7'));var path=require('path');var sox=require(_0xb4e3('0x8'));var csv=require(_0xb4e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4e3('0xa'));var _=require('lodash');var squel=require(_0xb4e3('0xb'));var crypto=require(_0xb4e3('0xc'));var jsforce=require(_0xb4e3('0xd'));var deskjs=require(_0xb4e3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb4e3('0xf'));var Papa=require(_0xb4e3('0x10'));var Redis=require(_0xb4e3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb4e3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4e3('0x13'));var logger=require(_0xb4e3('0x14'))(_0xb4e3('0x15'));var utils=require('../../config/utils');var config=require(_0xb4e3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4e3('0x17'))['db'];var integrations=require(_0xb4e3('0x18'));function respondWithStatusCode(_0x4086d8,_0x25fdd6){_0x25fdd6=_0x25fdd6||0xcc;return function(_0x126cfa){if(_0x126cfa){return _0x4086d8[_0xb4e3('0x19')](_0x25fdd6);}return _0x4086d8['status'](_0x25fdd6)[_0xb4e3('0x1a')]();};}function respondWithResult(_0x5c25c0,_0x3f4071){_0x3f4071=_0x3f4071||0xc8;return function(_0x1950cf){if(_0x1950cf){return _0x5c25c0[_0xb4e3('0x1b')](_0x3f4071)['json'](_0x1950cf);}};}function respondWithFilteredResult(_0x519d28,_0x543ed1){return function(_0x29a1b2){if(_0x29a1b2){var _0xf33ce7=typeof _0x543ed1['offset']===_0xb4e3('0x1c')&&typeof _0x543ed1['limit']===_0xb4e3('0x1c');var _0x37e3b9=_0x29a1b2[_0xb4e3('0x1d')];var _0x278320=_0xf33ce7?0x0:_0x543ed1[_0xb4e3('0x1e')];var _0x7ce9a=_0xf33ce7?_0x29a1b2['count']:_0x543ed1[_0xb4e3('0x1e')]+_0x543ed1[_0xb4e3('0x1f')];var _0x440d10;if(_0x7ce9a>=_0x37e3b9){_0x7ce9a=_0x37e3b9;_0x440d10=0xc8;}else{_0x440d10=0xce;}_0x519d28[_0xb4e3('0x1b')](_0x440d10);return _0x519d28[_0xb4e3('0x20')]('Content-Range',_0x278320+'-'+_0x7ce9a+'/'+_0x37e3b9)[_0xb4e3('0x21')](_0x29a1b2);}return null;};}function patchUpdates(_0x557e56){return function(_0x4568f4){try{jsonpatch['apply'](_0x4568f4,_0x557e56,!![]);}catch(_0x4e9f7f){return BPromise['reject'](_0x4e9f7f);}return _0x4568f4[_0xb4e3('0x22')]();};}function saveUpdates(_0x897fb2,_0xe7297e){return function(_0x4579ca){if(_0x4579ca){return _0x4579ca[_0xb4e3('0x23')](_0x897fb2)[_0xb4e3('0x24')](function(_0x2a77b5){return _0x2a77b5;});}return null;};}function removeEntity(_0x5e400a,_0x41684a){return function(_0x46a480){if(_0x46a480){return _0x46a480[_0xb4e3('0x25')]()[_0xb4e3('0x24')](function(){_0x5e400a[_0xb4e3('0x1b')](0xcc)[_0xb4e3('0x1a')]();});}};}function handleEntityNotFound(_0x12ad37,_0x389f30){return function(_0x55b15d){if(!_0x55b15d){_0x12ad37['sendStatus'](0x194);}return _0x55b15d;};}function handleError(_0x4f0501,_0x2273bd){_0x2273bd=_0x2273bd||0x1f4;return function(_0xb2016b){logger[_0xb4e3('0x26')](_0xb2016b[_0xb4e3('0x27')]);if(_0xb2016b['name']){delete _0xb2016b[_0xb4e3('0x28')];}_0x4f0501[_0xb4e3('0x1b')](_0x2273bd)[_0xb4e3('0x29')](_0xb2016b);};}exports[_0xb4e3('0x2a')]=function(_0x23f3e1,_0x7fd365){var _0x3e0a7d={},_0x4c90ba={},_0x398baa={'count':0x0,'rows':[]};var _0xe91567=_[_0xb4e3('0x2b')](db[_0xb4e3('0x2c')]['rawAttributes'],function(_0xd71617){return{'name':_0xd71617[_0xb4e3('0x2d')],'type':_0xd71617[_0xb4e3('0x2e')][_0xb4e3('0x2f')]};});_0x4c90ba[_0xb4e3('0x30')]=_[_0xb4e3('0x2b')](_0xe91567,'name');_0x4c90ba[_0xb4e3('0x31')]=_[_0xb4e3('0x32')](_0x23f3e1['query']);_0x4c90ba[_0xb4e3('0x33')]=_[_0xb4e3('0x34')](_0x4c90ba[_0xb4e3('0x30')],_0x4c90ba[_0xb4e3('0x31')]);_0x3e0a7d['attributes']=_[_0xb4e3('0x34')](_0x4c90ba[_0xb4e3('0x30')],qs['fields'](_0x23f3e1['query'][_0xb4e3('0x35')]));_0x3e0a7d[_0xb4e3('0x36')]=_0x3e0a7d[_0xb4e3('0x36')]['length']?_0x3e0a7d['attributes']:_0x4c90ba[_0xb4e3('0x30')];if(!_0x23f3e1[_0xb4e3('0x31')]['hasOwnProperty']('nolimit')){_0x3e0a7d[_0xb4e3('0x1f')]=qs[_0xb4e3('0x1f')](_0x23f3e1['query'][_0xb4e3('0x1f')]);_0x3e0a7d[_0xb4e3('0x1e')]=qs['offset'](_0x23f3e1['query']['offset']);}_0x3e0a7d['order']=qs[_0xb4e3('0x37')](_0x23f3e1[_0xb4e3('0x31')][_0xb4e3('0x37')]);_0x3e0a7d[_0xb4e3('0x38')]=qs[_0xb4e3('0x33')](_[_0xb4e3('0x39')](_0x23f3e1[_0xb4e3('0x31')],_0x4c90ba[_0xb4e3('0x33')]),_0xe91567);if(_0x23f3e1[_0xb4e3('0x31')][_0xb4e3('0x3a')]){_0x3e0a7d[_0xb4e3('0x38')]=_['merge'](_0x3e0a7d['where'],{'$or':_['map'](_0xe91567,function(_0x51ac8a){if(_0x51ac8a[_0xb4e3('0x2e')]!==_0xb4e3('0x3b')){var _0x32127f={};_0x32127f[_0x51ac8a[_0xb4e3('0x28')]]={'$like':'%'+_0x23f3e1['query'][_0xb4e3('0x3a')]+'%'};return _0x32127f;}})});}_0x3e0a7d=_[_0xb4e3('0x3c')]({},_0x3e0a7d,_0x23f3e1[_0xb4e3('0x3d')]);var _0x42d961={'where':_0x3e0a7d['where']};return db['SalesforceAccount'][_0xb4e3('0x1d')](_0x42d961)[_0xb4e3('0x24')](function(_0x195878){_0x398baa[_0xb4e3('0x1d')]=_0x195878;if(_0x23f3e1['query'][_0xb4e3('0x3e')]){_0x3e0a7d[_0xb4e3('0x3f')]=[{'all':!![]}];}return db[_0xb4e3('0x2c')]['findAll'](_0x3e0a7d);})['then'](function(_0x2fa6b6){_0x398baa['rows']=_0x2fa6b6;return _0x398baa;})['then'](respondWithFilteredResult(_0x7fd365,_0x3e0a7d))['catch'](handleError(_0x7fd365,null));};exports[_0xb4e3('0x40')]=function(_0x2e4522,_0x449b22){var _0x6d6270={'raw':![],'where':{'id':_0x2e4522['params']['id']}},_0x169508={};_0x169508[_0xb4e3('0x30')]=_[_0xb4e3('0x32')](db['SalesforceAccount'][_0xb4e3('0x41')]);_0x169508[_0xb4e3('0x31')]=_['keys'](_0x2e4522[_0xb4e3('0x31')]);_0x169508[_0xb4e3('0x33')]=_[_0xb4e3('0x34')](_0x169508[_0xb4e3('0x30')],_0x169508[_0xb4e3('0x31')]);_0x6d6270['attributes']=_[_0xb4e3('0x34')](_0x169508[_0xb4e3('0x30')],qs[_0xb4e3('0x35')](_0x2e4522[_0xb4e3('0x31')][_0xb4e3('0x35')]));_0x6d6270[_0xb4e3('0x36')]=_0x6d6270[_0xb4e3('0x36')][_0xb4e3('0x42')]?_0x6d6270['attributes']:_0x169508[_0xb4e3('0x30')];if(_0x2e4522[_0xb4e3('0x31')][_0xb4e3('0x3e')]){_0x6d6270[_0xb4e3('0x3f')]=[{'all':!![]}];}_0x6d6270=_[_0xb4e3('0x3c')]({},_0x6d6270,_0x2e4522[_0xb4e3('0x3d')]);return db['SalesforceAccount'][_0xb4e3('0x43')](_0x6d6270)[_0xb4e3('0x24')](handleEntityNotFound(_0x449b22,null))[_0xb4e3('0x24')](respondWithResult(_0x449b22,null))[_0xb4e3('0x44')](handleError(_0x449b22,null));};exports[_0xb4e3('0x45')]=function(_0x34985e,_0x78e32e){return db[_0xb4e3('0x2c')][_0xb4e3('0x45')](_0x34985e[_0xb4e3('0x46')],{})[_0xb4e3('0x24')](respondWithResult(_0x78e32e,0xc9))[_0xb4e3('0x44')](handleError(_0x78e32e,null));};exports['update']=function(_0x513045,_0x47d486){if(_0x513045[_0xb4e3('0x46')]['id']){delete _0x513045[_0xb4e3('0x46')]['id'];}return db[_0xb4e3('0x2c')][_0xb4e3('0x43')]({'where':{'id':_0x513045['params']['id']}})[_0xb4e3('0x24')](handleEntityNotFound(_0x47d486,null))[_0xb4e3('0x24')](saveUpdates(_0x513045[_0xb4e3('0x46')],null))[_0xb4e3('0x24')](respondWithResult(_0x47d486,null))[_0xb4e3('0x44')](handleError(_0x47d486,null));};exports[_0xb4e3('0x25')]=function(_0x4b3bb2,_0x2c98a5){return db[_0xb4e3('0x2c')][_0xb4e3('0x43')]({'where':{'id':_0x4b3bb2['params']['id']}})['then'](handleEntityNotFound(_0x2c98a5,null))[_0xb4e3('0x24')](removeEntity(_0x2c98a5,null))[_0xb4e3('0x44')](handleError(_0x2c98a5,null));};exports[_0xb4e3('0x47')]=function(_0x1467b1,_0x579b11,_0x2b9cdf){var _0x57fadd={};var _0x218382={};var _0x54f5d1;var _0x559ddd;return db[_0xb4e3('0x2c')][_0xb4e3('0x48')]({'where':{'id':_0x1467b1[_0xb4e3('0x49')]['id']}})[_0xb4e3('0x24')](handleEntityNotFound(_0x579b11,null))[_0xb4e3('0x24')](function(_0x480e16){if(_0x480e16){_0x54f5d1=_0x480e16;_0x218382[_0xb4e3('0x30')]=_[_0xb4e3('0x32')](db[_0xb4e3('0x4a')][_0xb4e3('0x41')]);_0x218382['query']=_['keys'](_0x1467b1[_0xb4e3('0x31')]);_0x218382[_0xb4e3('0x33')]=_['intersection'](_0x218382['model'],_0x218382[_0xb4e3('0x31')]);_0x57fadd['attributes']=_[_0xb4e3('0x34')](_0x218382[_0xb4e3('0x30')],qs[_0xb4e3('0x35')](_0x1467b1[_0xb4e3('0x31')][_0xb4e3('0x35')]));_0x57fadd[_0xb4e3('0x36')]=_0x57fadd['attributes'][_0xb4e3('0x42')]?_0x57fadd[_0xb4e3('0x36')]:_0x218382['model'];_0x57fadd[_0xb4e3('0x4b')]=qs[_0xb4e3('0x37')](_0x1467b1[_0xb4e3('0x31')][_0xb4e3('0x37')]);_0x57fadd['where']=qs['filters'](_[_0xb4e3('0x39')](_0x1467b1[_0xb4e3('0x31')],_0x218382['filters']));if(_0x1467b1[_0xb4e3('0x31')]['filter']){_0x57fadd[_0xb4e3('0x38')]=_[_0xb4e3('0x3c')](_0x57fadd[_0xb4e3('0x38')],{'$or':_[_0xb4e3('0x2b')](_0x57fadd[_0xb4e3('0x36')],function(_0x1d7bb0){var _0x4ae5a5={};_0x4ae5a5[_0x1d7bb0]={'$like':'%'+_0x1467b1[_0xb4e3('0x31')][_0xb4e3('0x3a')]+'%'};return _0x4ae5a5;})});}_0x57fadd=_[_0xb4e3('0x3c')]({},_0x57fadd,_0x1467b1['options']);return _0x54f5d1[_0xb4e3('0x47')](_0x57fadd);}})[_0xb4e3('0x24')](function(_0x3d043d){if(_0x3d043d){_0x559ddd=_0x3d043d[_0xb4e3('0x42')];if(!_0x1467b1[_0xb4e3('0x31')][_0xb4e3('0x4c')]('nolimit')){_0x57fadd[_0xb4e3('0x1f')]=qs[_0xb4e3('0x1f')](_0x1467b1['query'][_0xb4e3('0x1f')]);_0x57fadd[_0xb4e3('0x1e')]=qs['offset'](_0x1467b1['query'][_0xb4e3('0x1e')]);}return _0x54f5d1[_0xb4e3('0x47')](_0x57fadd);}})[_0xb4e3('0x24')](function(_0x51ea53){if(_0x51ea53){return _0x51ea53?{'count':_0x559ddd,'rows':_0x51ea53}:null;}})[_0xb4e3('0x24')](respondWithResult(_0x579b11,null))['catch'](handleError(_0x579b11,null));};exports['addConfiguration']=function(_0x11ca7a,_0x5a9f8e,_0x2e4b9b){if(_0x11ca7a[_0xb4e3('0x46')]['id']){delete _0x11ca7a[_0xb4e3('0x46')]['id'];}return db[_0xb4e3('0x2c')]['findOne']({'where':{'id':_0x11ca7a[_0xb4e3('0x49')]['id']}})[_0xb4e3('0x24')](handleEntityNotFound(_0x5a9f8e,null))[_0xb4e3('0x24')](function(_0x532ac4){if(_0x532ac4){_0x11ca7a[_0xb4e3('0x46')]['AccountId']=_0x532ac4['id'];_0x11ca7a[_0xb4e3('0x46')]['Subjects']=integrations[_0xb4e3('0x4d')](_0x11ca7a[_0xb4e3('0x46')]['channel'],_0x11ca7a[_0xb4e3('0x46')][_0xb4e3('0x2e')]);_0x11ca7a[_0xb4e3('0x46')]['Descriptions']=integrations[_0xb4e3('0x4e')](_0x11ca7a[_0xb4e3('0x46')][_0xb4e3('0x4f')],_0x11ca7a[_0xb4e3('0x46')]['type']);return db[_0xb4e3('0x4a')]['create'](_0x11ca7a[_0xb4e3('0x46')],{'include':[{'model':db[_0xb4e3('0x50')],'as':_0xb4e3('0x51')},{'model':db[_0xb4e3('0x50')],'as':_0xb4e3('0x52')}]});}return null;})[_0xb4e3('0x24')](respondWithResult(_0x5a9f8e,null))['catch'](handleError(_0x5a9f8e,null));};exports[_0xb4e3('0x53')]=function(_0x475b50,_0xf822ef,_0x1d8d4e){var _0x1ddfd8;var _0x3ed5fb='';var _0x324c9f=_0xb4e3('0x54');return db['SalesforceAccount'][_0xb4e3('0x48')]({'where':{'id':_0x475b50['params']['id']},'attributes':['id',_0xb4e3('0x55'),'clientId',_0xb4e3('0x56'),_0xb4e3('0x57'),'password',_0xb4e3('0x58')]})[_0xb4e3('0x24')](handleEntityNotFound(_0xf822ef,null))[_0xb4e3('0x24')](function(_0x1268df){if(_0x1268df){_0x3ed5fb=_0x1268df[_0xb4e3('0x55')];var _0xc29d25=_0x3ed5fb[_0xb4e3('0x59')](-0x1);if(_0xc29d25==='/'){_0x3ed5fb=_0x3ed5fb[_0xb4e3('0x5a')](0x0,_0x3ed5fb[_0xb4e3('0x5b')](_0xc29d25));}_0x1ddfd8=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3ed5fb,'clientId':_0x1268df[_0xb4e3('0x5c')],'clientSecret':_0x1268df[_0xb4e3('0x56')]}});return _0x1ddfd8['login'](_0x1268df['username'],_0x1268df[_0xb4e3('0x5d')][_0xb4e3('0x5e')](_0x1268df[_0xb4e3('0x58')]));}})[_0xb4e3('0x24')](function(_0x7e92da){if(_0x7e92da){if(!_[_0xb4e3('0x5f')](_0x475b50['query'][_0xb4e3('0x60')])){_0x324c9f=_0x475b50[_0xb4e3('0x31')][_0xb4e3('0x60')];}return _0x1ddfd8[_0xb4e3('0x61')](_0x324c9f)[_0xb4e3('0x62')]();}})[_0xb4e3('0x24')](function(_0x58d0be){var _0x2d56b4=[_0xb4e3('0x63'),_0xb4e3('0x64'),'IsReminderSet',_0xb4e3('0x65'),'Subject',_0xb4e3('0x66')];var _0x2a6301=['string',_0xb4e3('0x67'),_0xb4e3('0x68'),_0xb4e3('0x69'),_0xb4e3('0x6a'),'textarea',_0xb4e3('0x6b')];if(_0x58d0be){_[_0xb4e3('0x6c')](_0x58d0be[_0xb4e3('0x35')],function(_0x1e21e4){return _0x2d56b4[_0xb4e3('0x6d')](_0x1e21e4[_0xb4e3('0x28')])||!_0x2a6301[_0xb4e3('0x6d')](_0x1e21e4['type']);});return{'count':_0x58d0be['fields'][_0xb4e3('0x42')],'rows':_[_0xb4e3('0x2b')](_0x58d0be[_0xb4e3('0x35')],function(_0x500dd0){return{'id':_0x500dd0['name'],'name':_0x500dd0[_0xb4e3('0x6e')],'custom':_0x500dd0[_0xb4e3('0x6f')],'options':_0x500dd0[_0xb4e3('0x70')][_0xb4e3('0x42')]>0x0?_['map'](_0x500dd0['picklistValues'],function(_0x2a22b1){return{'name':_0x2a22b1[_0xb4e3('0x6e')],'value':_0x2a22b1['value']};}):_0x500dd0[_0xb4e3('0x2e')]==_0xb4e3('0x69')?[{'name':'True','value':'true'},{'name':_0xb4e3('0x71'),'value':_0xb4e3('0x72')}]:[]};})};}})[_0xb4e3('0x24')](respondWithResult(_0xf822ef,null))[_0xb4e3('0x44')](function(_0x5cea21){var _0x4bc0be=_0x475b50[_0xb4e3('0x31')]['test']?0x1f4:_0x5cea21['statusCode']||0x1f4;logger[_0xb4e3('0x26')](_0xb4e3('0x73'),'getFields',_0x4bc0be,JSON['stringify'](_0x5cea21));delete _0x5cea21['name'];if(_0x4bc0be===0x191){_0x4bc0be=0x190;}_0xf822ef[_0xb4e3('0x1b')](_0x4bc0be)['send'](_0x475b50[_0xb4e3('0x31')][_0xb4e3('0x74')]?{'message':_0xb4e3('0x75'),'statusCode':_0x5cea21[_0xb4e3('0x76')]}:_0x5cea21);});}; \ No newline at end of file +var _0x51f7=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','name','merge','includeAll','include','findAll','rows','params','rawAttributes','catch','create','body','find','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','clientSecret','username','password','securityToken','remoteUri','slice','lastIndexOf','Connection','clientId','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsRecurrence','Subject','string','int','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','SalesforceAccount'];(function(_0xa4a3f1,_0x30775b){var _0x37a952=function(_0x477cc1){while(--_0x477cc1){_0xa4a3f1['push'](_0xa4a3f1['shift']());}};_0x37a952(++_0x30775b);}(_0x51f7,0xd2));var _0x751f=function(_0x4ebb5d,_0x1e92b6){_0x4ebb5d=_0x4ebb5d-0x0;var _0x5abafd=_0x51f7[_0x4ebb5d];return _0x5abafd;};'use strict';var emlformat=require(_0x751f('0x0'));var rimraf=require(_0x751f('0x1'));var zipdir=require(_0x751f('0x2'));var jsonpatch=require(_0x751f('0x3'));var rp=require(_0x751f('0x4'));var moment=require(_0x751f('0x5'));var BPromise=require(_0x751f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x751f('0x7'));var sox=require(_0x751f('0x8'));var csv=require('to-csv');var ejs=require(_0x751f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x751f('0xa'));var squel=require(_0x751f('0xb'));var crypto=require(_0x751f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x751f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x751f('0xe'));var Papa=require(_0x751f('0xf'));var Redis=require(_0x751f('0x10'));var authService=require(_0x751f('0x11'));var qs=require(_0x751f('0x12'));var as=require(_0x751f('0x13'));var hardwareService=require(_0x751f('0x14'));var logger=require(_0x751f('0x15'))(_0x751f('0x16'));var utils=require(_0x751f('0x17'));var config=require(_0x751f('0x18'));var licenseUtil=require(_0x751f('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1bf57f,_0x1542dd){_0x1542dd=_0x1542dd||0xcc;return function(_0x2f915c){if(_0x2f915c){return _0x1bf57f[_0x751f('0x1a')](_0x1542dd);}return _0x1bf57f[_0x751f('0x1b')](_0x1542dd)[_0x751f('0x1c')]();};}function respondWithResult(_0x2c93d8,_0x46979c){_0x46979c=_0x46979c||0xc8;return function(_0x51cbf0){if(_0x51cbf0){return _0x2c93d8[_0x751f('0x1b')](_0x46979c)['json'](_0x51cbf0);}};}function respondWithFilteredResult(_0x54100f,_0x18b4fa){return function(_0x5c5516){if(_0x5c5516){var _0x5d7a84=typeof _0x18b4fa[_0x751f('0x1d')]===_0x751f('0x1e')&&typeof _0x18b4fa[_0x751f('0x1f')]==='undefined';var _0x47fe9e=_0x5c5516['count'];var _0x2d339f=_0x5d7a84?0x0:_0x18b4fa[_0x751f('0x1d')];var _0x685c75=_0x5d7a84?_0x5c5516[_0x751f('0x20')]:_0x18b4fa[_0x751f('0x1d')]+_0x18b4fa[_0x751f('0x1f')];var _0x212fa7;if(_0x685c75>=_0x47fe9e){_0x685c75=_0x47fe9e;_0x212fa7=0xc8;}else{_0x212fa7=0xce;}_0x54100f['status'](_0x212fa7);return _0x54100f[_0x751f('0x21')](_0x751f('0x22'),_0x2d339f+'-'+_0x685c75+'/'+_0x47fe9e)[_0x751f('0x23')](_0x5c5516);}return null;};}function patchUpdates(_0x3565f1){return function(_0x27a167){try{jsonpatch[_0x751f('0x24')](_0x27a167,_0x3565f1,!![]);}catch(_0xb95eec){return BPromise[_0x751f('0x25')](_0xb95eec);}return _0x27a167[_0x751f('0x26')]();};}function saveUpdates(_0x51ecbe,_0x4c27ba){return function(_0x16fff4){if(_0x16fff4){return _0x16fff4[_0x751f('0x27')](_0x51ecbe)[_0x751f('0x28')](function(_0x4c3d8d){return _0x4c3d8d;});}return null;};}function removeEntity(_0x14a58c,_0x286501){return function(_0x21e3fa){if(_0x21e3fa){return _0x21e3fa[_0x751f('0x29')]()[_0x751f('0x28')](function(){_0x14a58c[_0x751f('0x1b')](0xcc)[_0x751f('0x1c')]();});}};}function handleEntityNotFound(_0x359e75,_0x575793){return function(_0x321786){if(!_0x321786){_0x359e75['sendStatus'](0x194);}return _0x321786;};}function handleError(_0x3fa57a,_0x57a4f1){_0x57a4f1=_0x57a4f1||0x1f4;return function(_0x50f13f){logger[_0x751f('0x2a')](_0x50f13f[_0x751f('0x2b')]);if(_0x50f13f['name']){delete _0x50f13f['name'];}_0x3fa57a[_0x751f('0x1b')](_0x57a4f1)['send'](_0x50f13f);};}exports[_0x751f('0x2c')]=function(_0x17efa2,_0x1c005f){var _0x3aedbd={},_0xdfd16d={},_0x42afb1={'count':0x0,'rows':[]};var _0x26905d=_['map'](db[_0x751f('0x2d')]['rawAttributes'],function(_0x4914d2){return{'name':_0x4914d2[_0x751f('0x2e')],'type':_0x4914d2[_0x751f('0x2f')][_0x751f('0x30')]};});_0xdfd16d[_0x751f('0x31')]=_[_0x751f('0x32')](_0x26905d,'name');_0xdfd16d[_0x751f('0x33')]=_[_0x751f('0x34')](_0x17efa2[_0x751f('0x33')]);_0xdfd16d[_0x751f('0x35')]=_[_0x751f('0x36')](_0xdfd16d[_0x751f('0x31')],_0xdfd16d[_0x751f('0x33')]);_0x3aedbd[_0x751f('0x37')]=_[_0x751f('0x36')](_0xdfd16d[_0x751f('0x31')],qs[_0x751f('0x38')](_0x17efa2[_0x751f('0x33')][_0x751f('0x38')]));_0x3aedbd[_0x751f('0x37')]=_0x3aedbd['attributes'][_0x751f('0x39')]?_0x3aedbd['attributes']:_0xdfd16d[_0x751f('0x31')];if(!_0x17efa2[_0x751f('0x33')][_0x751f('0x3a')](_0x751f('0x3b'))){_0x3aedbd[_0x751f('0x1f')]=qs['limit'](_0x17efa2[_0x751f('0x33')][_0x751f('0x1f')]);_0x3aedbd[_0x751f('0x1d')]=qs[_0x751f('0x1d')](_0x17efa2['query'][_0x751f('0x1d')]);}_0x3aedbd['order']=qs[_0x751f('0x3c')](_0x17efa2[_0x751f('0x33')][_0x751f('0x3c')]);_0x3aedbd['where']=qs[_0x751f('0x35')](_[_0x751f('0x3d')](_0x17efa2[_0x751f('0x33')],_0xdfd16d[_0x751f('0x35')]),_0x26905d);if(_0x17efa2[_0x751f('0x33')][_0x751f('0x3e')]){_0x3aedbd[_0x751f('0x3f')]=_['merge'](_0x3aedbd[_0x751f('0x3f')],{'$or':_['map'](_0x26905d,function(_0x3759ca){if(_0x3759ca[_0x751f('0x2f')]!==_0x751f('0x40')){var _0x5bedef={};_0x5bedef[_0x3759ca[_0x751f('0x41')]]={'$like':'%'+_0x17efa2[_0x751f('0x33')][_0x751f('0x3e')]+'%'};return _0x5bedef;}})});}_0x3aedbd=_[_0x751f('0x42')]({},_0x3aedbd,_0x17efa2['options']);var _0x4b8392={'where':_0x3aedbd['where']};return db[_0x751f('0x2d')][_0x751f('0x20')](_0x4b8392)[_0x751f('0x28')](function(_0x1b580d){_0x42afb1[_0x751f('0x20')]=_0x1b580d;if(_0x17efa2['query'][_0x751f('0x43')]){_0x3aedbd[_0x751f('0x44')]=[{'all':!![]}];}return db[_0x751f('0x2d')][_0x751f('0x45')](_0x3aedbd);})['then'](function(_0x2b30c1){_0x42afb1[_0x751f('0x46')]=_0x2b30c1;return _0x42afb1;})[_0x751f('0x28')](respondWithFilteredResult(_0x1c005f,_0x3aedbd))['catch'](handleError(_0x1c005f,null));};exports['show']=function(_0xfa2d88,_0x32319d){var _0x36a57b={'raw':![],'where':{'id':_0xfa2d88[_0x751f('0x47')]['id']}},_0x2e92c2={};_0x2e92c2[_0x751f('0x31')]=_[_0x751f('0x34')](db[_0x751f('0x2d')][_0x751f('0x48')]);_0x2e92c2[_0x751f('0x33')]=_[_0x751f('0x34')](_0xfa2d88['query']);_0x2e92c2[_0x751f('0x35')]=_['intersection'](_0x2e92c2[_0x751f('0x31')],_0x2e92c2[_0x751f('0x33')]);_0x36a57b[_0x751f('0x37')]=_['intersection'](_0x2e92c2[_0x751f('0x31')],qs[_0x751f('0x38')](_0xfa2d88['query']['fields']));_0x36a57b[_0x751f('0x37')]=_0x36a57b[_0x751f('0x37')]['length']?_0x36a57b[_0x751f('0x37')]:_0x2e92c2[_0x751f('0x31')];if(_0xfa2d88[_0x751f('0x33')][_0x751f('0x43')]){_0x36a57b[_0x751f('0x44')]=[{'all':!![]}];}_0x36a57b=_[_0x751f('0x42')]({},_0x36a57b,_0xfa2d88['options']);return db[_0x751f('0x2d')]['find'](_0x36a57b)[_0x751f('0x28')](handleEntityNotFound(_0x32319d,null))[_0x751f('0x28')](respondWithResult(_0x32319d,null))[_0x751f('0x49')](handleError(_0x32319d,null));};exports[_0x751f('0x4a')]=function(_0x4becc7,_0x2f21a3){return db[_0x751f('0x2d')]['create'](_0x4becc7[_0x751f('0x4b')],{})['then'](respondWithResult(_0x2f21a3,0xc9))[_0x751f('0x49')](handleError(_0x2f21a3,null));};exports[_0x751f('0x27')]=function(_0x565cea,_0x5483fd){if(_0x565cea['body']['id']){delete _0x565cea['body']['id'];}return db[_0x751f('0x2d')][_0x751f('0x4c')]({'where':{'id':_0x565cea[_0x751f('0x47')]['id']}})[_0x751f('0x28')](handleEntityNotFound(_0x5483fd,null))[_0x751f('0x28')](saveUpdates(_0x565cea['body'],null))[_0x751f('0x28')](respondWithResult(_0x5483fd,null))[_0x751f('0x49')](handleError(_0x5483fd,null));};exports['destroy']=function(_0x27b77a,_0x40445c){return db[_0x751f('0x2d')][_0x751f('0x4c')]({'where':{'id':_0x27b77a[_0x751f('0x47')]['id']}})[_0x751f('0x28')](handleEntityNotFound(_0x40445c,null))[_0x751f('0x28')](removeEntity(_0x40445c,null))[_0x751f('0x49')](handleError(_0x40445c,null));};exports[_0x751f('0x4d')]=function(_0x35da0a,_0x4af1fa,_0x4e2ae3){var _0x41b50e={};var _0x2c23ff={};var _0x41131d;var _0x10ff7e;return db[_0x751f('0x2d')][_0x751f('0x4e')]({'where':{'id':_0x35da0a[_0x751f('0x47')]['id']}})[_0x751f('0x28')](handleEntityNotFound(_0x4af1fa,null))[_0x751f('0x28')](function(_0x13a406){if(_0x13a406){_0x41131d=_0x13a406;_0x2c23ff[_0x751f('0x31')]=_[_0x751f('0x34')](db[_0x751f('0x4f')][_0x751f('0x48')]);_0x2c23ff[_0x751f('0x33')]=_[_0x751f('0x34')](_0x35da0a['query']);_0x2c23ff['filters']=_[_0x751f('0x36')](_0x2c23ff[_0x751f('0x31')],_0x2c23ff['query']);_0x41b50e[_0x751f('0x37')]=_[_0x751f('0x36')](_0x2c23ff[_0x751f('0x31')],qs[_0x751f('0x38')](_0x35da0a[_0x751f('0x33')][_0x751f('0x38')]));_0x41b50e[_0x751f('0x37')]=_0x41b50e[_0x751f('0x37')][_0x751f('0x39')]?_0x41b50e['attributes']:_0x2c23ff['model'];_0x41b50e['order']=qs[_0x751f('0x3c')](_0x35da0a[_0x751f('0x33')]['sort']);_0x41b50e[_0x751f('0x3f')]=qs[_0x751f('0x35')](_['pick'](_0x35da0a['query'],_0x2c23ff[_0x751f('0x35')]));if(_0x35da0a['query'][_0x751f('0x3e')]){_0x41b50e['where']=_[_0x751f('0x42')](_0x41b50e[_0x751f('0x3f')],{'$or':_['map'](_0x41b50e[_0x751f('0x37')],function(_0x2fd532){var _0x3e9486={};_0x3e9486[_0x2fd532]={'$like':'%'+_0x35da0a[_0x751f('0x33')]['filter']+'%'};return _0x3e9486;})});}_0x41b50e=_['merge']({},_0x41b50e,_0x35da0a['options']);return _0x41131d[_0x751f('0x4d')](_0x41b50e);}})[_0x751f('0x28')](function(_0x4a1190){if(_0x4a1190){_0x10ff7e=_0x4a1190[_0x751f('0x39')];if(!_0x35da0a[_0x751f('0x33')][_0x751f('0x3a')](_0x751f('0x3b'))){_0x41b50e['limit']=qs['limit'](_0x35da0a[_0x751f('0x33')][_0x751f('0x1f')]);_0x41b50e[_0x751f('0x1d')]=qs[_0x751f('0x1d')](_0x35da0a[_0x751f('0x33')][_0x751f('0x1d')]);}return _0x41131d['getConfigurations'](_0x41b50e);}})[_0x751f('0x28')](function(_0xc2ec61){if(_0xc2ec61){return _0xc2ec61?{'count':_0x10ff7e,'rows':_0xc2ec61}:null;}})[_0x751f('0x28')](respondWithResult(_0x4af1fa,null))[_0x751f('0x49')](handleError(_0x4af1fa,null));};exports[_0x751f('0x50')]=function(_0x461b0f,_0x821e8a,_0x5ec215){if(_0x461b0f[_0x751f('0x4b')]['id']){delete _0x461b0f[_0x751f('0x4b')]['id'];}return db[_0x751f('0x2d')][_0x751f('0x4e')]({'where':{'id':_0x461b0f[_0x751f('0x47')]['id']}})[_0x751f('0x28')](handleEntityNotFound(_0x821e8a,null))['then'](function(_0x1b13fe){if(_0x1b13fe){_0x461b0f['body']['AccountId']=_0x1b13fe['id'];_0x461b0f['body'][_0x751f('0x51')]=integrations[_0x751f('0x52')](_0x461b0f[_0x751f('0x4b')][_0x751f('0x53')],_0x461b0f[_0x751f('0x4b')][_0x751f('0x2f')]);_0x461b0f['body'][_0x751f('0x54')]=integrations[_0x751f('0x55')](_0x461b0f[_0x751f('0x4b')]['channel'],_0x461b0f[_0x751f('0x4b')][_0x751f('0x2f')]);return db[_0x751f('0x4f')][_0x751f('0x4a')](_0x461b0f[_0x751f('0x4b')],{'include':[{'model':db[_0x751f('0x56')],'as':'Subjects'},{'model':db[_0x751f('0x56')],'as':_0x751f('0x54')}]});}return null;})[_0x751f('0x28')](respondWithResult(_0x821e8a,null))['catch'](handleError(_0x821e8a,null));};exports[_0x751f('0x57')]=function(_0x457679,_0x47b8a8,_0x3ebf3a){var _0x5769cf;var _0x3435ce='';var _0x135b30=_0x751f('0x58');return db[_0x751f('0x2d')][_0x751f('0x4e')]({'where':{'id':_0x457679['params']['id']},'attributes':['id','remoteUri','clientId',_0x751f('0x59'),_0x751f('0x5a'),_0x751f('0x5b'),_0x751f('0x5c')]})[_0x751f('0x28')](handleEntityNotFound(_0x47b8a8,null))[_0x751f('0x28')](function(_0x4a44b4){if(_0x4a44b4){_0x3435ce=_0x4a44b4[_0x751f('0x5d')];var _0x49fe85=_0x3435ce[_0x751f('0x5e')](-0x1);if(_0x49fe85==='/'){_0x3435ce=_0x3435ce['substring'](0x0,_0x3435ce[_0x751f('0x5f')](_0x49fe85));}_0x5769cf=new jsforce[(_0x751f('0x60'))]({'oauth2':{'loginUrl':_0x3435ce,'clientId':_0x4a44b4[_0x751f('0x61')],'clientSecret':_0x4a44b4['clientSecret']}});return _0x5769cf[_0x751f('0x62')](_0x4a44b4[_0x751f('0x5a')],_0x4a44b4[_0x751f('0x5b')][_0x751f('0x63')](_0x4a44b4[_0x751f('0x5c')]));}})[_0x751f('0x28')](function(_0x227809){if(_0x227809){if(!_[_0x751f('0x64')](_0x457679[_0x751f('0x33')]['ticketType'])){_0x135b30=_0x457679[_0x751f('0x33')][_0x751f('0x65')];}return _0x5769cf['sobject'](_0x135b30)[_0x751f('0x66')]();}})[_0x751f('0x28')](function(_0x5d6c44){var _0x2eee3a=[_0x751f('0x67'),_0x751f('0x68'),'IsReminderSet',_0x751f('0x69'),_0x751f('0x6a'),'Description'];var _0x1996ed=[_0x751f('0x6b'),_0x751f('0x6c'),'picklist',_0x751f('0x6d'),_0x751f('0x6e'),_0x751f('0x6f'),_0x751f('0x70')];if(_0x5d6c44){_[_0x751f('0x71')](_0x5d6c44[_0x751f('0x38')],function(_0x2b7180){return _0x2eee3a[_0x751f('0x72')](_0x2b7180[_0x751f('0x41')])||!_0x1996ed[_0x751f('0x72')](_0x2b7180['type']);});return{'count':_0x5d6c44[_0x751f('0x38')][_0x751f('0x39')],'rows':_[_0x751f('0x32')](_0x5d6c44[_0x751f('0x38')],function(_0x50059b){return{'id':_0x50059b[_0x751f('0x41')],'name':_0x50059b[_0x751f('0x73')],'custom':_0x50059b[_0x751f('0x74')],'options':_0x50059b['picklistValues'][_0x751f('0x39')]>0x0?_['map'](_0x50059b[_0x751f('0x75')],function(_0xcdc200){return{'name':_0xcdc200[_0x751f('0x73')],'value':_0xcdc200[_0x751f('0x76')]};}):_0x50059b[_0x751f('0x2f')]==_0x751f('0x6d')?[{'name':_0x751f('0x77'),'value':_0x751f('0x78')},{'name':_0x751f('0x79'),'value':_0x751f('0x7a')}]:[]};})};}})[_0x751f('0x28')](respondWithResult(_0x47b8a8,null))[_0x751f('0x49')](function(_0x5b6341){var _0xd392d1=_0x457679[_0x751f('0x33')][_0x751f('0x7b')]?0x1f4:_0x5b6341['statusCode']||0x1f4;logger[_0x751f('0x2a')](_0x751f('0x7c'),_0x751f('0x57'),_0xd392d1,JSON[_0x751f('0x7d')](_0x5b6341));delete _0x5b6341[_0x751f('0x41')];if(_0xd392d1===0x191){_0xd392d1=0x190;}_0x47b8a8[_0x751f('0x1b')](_0xd392d1)[_0x751f('0x7e')](_0x457679['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x5b6341[_0x751f('0x7f')]}:_0x5b6341);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 4ad6e29..4acb56a 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 _0x1e46=['exports','define','SalesforceAccount','lodash','util','api','bluebird','path','../../config/environment','../../components/integrations/configuration'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x1e46,0x1bb));var _0x61e4=function(_0x553efd,_0x2d2c07){_0x553efd=_0x553efd-0x0;var _0x475f66=_0x1e46[_0x553efd];return _0x475f66;};'use strict';var _=require(_0x61e4('0x0'));var util=require(_0x61e4('0x1'));var logger=require('../../config/logger')(_0x61e4('0x2'));var moment=require('moment');var BPromise=require(_0x61e4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61e4('0x4'));var rimraf=require('rimraf');var config=require(_0x61e4('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x61e4('0x6'));module[_0x61e4('0x7')]=function(_0x4a8dff,_0x3c4691){return _0x4a8dff[_0x61e4('0x8')](_0x61e4('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4aa=['../../config/environment','./intSalesforceAccount.attributes','define','SalesforceAccount','int_salesforce_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xb4aa,0xdd));var _0xab4a=function(_0x5924c9,_0x4afb52){_0x5924c9=_0x5924c9-0x0;var _0x3e0e94=_0xb4aa[_0x5924c9];return _0x3e0e94;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab4a('0x0'))(_0xab4a('0x1'));var moment=require(_0xab4a('0x2'));var BPromise=require(_0xab4a('0x3'));var rp=require(_0xab4a('0x4'));var fs=require('fs');var path=require(_0xab4a('0x5'));var rimraf=require(_0xab4a('0x6'));var config=require(_0xab4a('0x7'));var attributes=require(_0xab4a('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3a0292,_0x12a79d){return _0x3a0292[_0xab4a('0x9')](_0xab4a('0xa'),attributes,{'tableName':_0xab4a('0xb'),'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 661ad90..291aa4c 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 _0x0803=['include','map','model','GetSalesforceAccount','where','ShowSalesforceAccount','stringify','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','SalesforceAccount','options','attributes','limit'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0803,0x107));var _0x3080=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0803[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3080('0x0'));var util=require('util');var moment=require(_0x3080('0x1'));var BPromise=require('bluebird');var rs=require(_0x3080('0x2'));var fs=require('fs');var Redis=require(_0x3080('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3080('0x4'));var logger=require(_0x3080('0x5'))('rpc');var config=require(_0x3080('0x6'));var jayson=require(_0x3080('0x7'));var client=jayson['client'][_0x3080('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe2441a,_0x151a7d,_0x32e2d9){return new BPromise(function(_0x2b52f8,_0x573c1f){return client[_0x3080('0x9')](_0xe2441a,_0x32e2d9)[_0x3080('0xa')](function(_0x2d9a0e){logger[_0x3080('0xb')](_0x3080('0xc'),_0x151a7d,'request\x20sent');logger[_0x3080('0xd')](_0x3080('0xe'),_0x151a7d,_0x3080('0xf'),JSON['stringify'](_0x2d9a0e));if(_0x2d9a0e[_0x3080('0x10')]){if(_0x2d9a0e[_0x3080('0x10')][_0x3080('0x11')]===0x1f4){logger[_0x3080('0x10')](_0x3080('0xc'),_0x151a7d,_0x2d9a0e[_0x3080('0x10')][_0x3080('0x12')]);return _0x573c1f(_0x2d9a0e[_0x3080('0x10')][_0x3080('0x12')]);}logger[_0x3080('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x151a7d,_0x2d9a0e[_0x3080('0x10')][_0x3080('0x12')]);return _0x2b52f8(_0x2d9a0e[_0x3080('0x10')]['message']);}else{logger[_0x3080('0xb')](_0x3080('0xc'),_0x151a7d,_0x3080('0xf'));_0x2b52f8(_0x2d9a0e[_0x3080('0x13')][_0x3080('0x12')]);}})[_0x3080('0x14')](function(_0x56eabf){logger[_0x3080('0x10')](_0x3080('0xc'),_0x151a7d,_0x56eabf);_0x573c1f(_0x56eabf);});});}exports['GetSalesforceAccount']=function(_0xb87a4b){var _0x17dda3=this;return new Promise(function(_0x198bbf,_0x7289ea){return db[_0x3080('0x15')]['findAll']({'raw':_0xb87a4b[_0x3080('0x16')]?_0xb87a4b[_0x3080('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xb87a4b[_0x3080('0x16')]?_0xb87a4b['options']['where']||null:null,'attributes':_0xb87a4b[_0x3080('0x16')]?_0xb87a4b[_0x3080('0x16')][_0x3080('0x17')]||null:null,'limit':_0xb87a4b[_0x3080('0x16')]?_0xb87a4b[_0x3080('0x16')][_0x3080('0x18')]||null:null,'include':_0xb87a4b[_0x3080('0x16')]?_0xb87a4b[_0x3080('0x16')][_0x3080('0x19')]?_[_0x3080('0x1a')](_0xb87a4b[_0x3080('0x16')][_0x3080('0x19')],function(_0x46a50c){return{'model':db[_0x46a50c['model']],'as':_0x46a50c['as'],'attributes':_0x46a50c[_0x3080('0x17')],'include':_0x46a50c['include']?_[_0x3080('0x1a')](_0x46a50c[_0x3080('0x19')],function(_0x14c28e){return{'model':db[_0x14c28e[_0x3080('0x1b')]],'as':_0x14c28e['as'],'attributes':_0x14c28e[_0x3080('0x17')],'include':_0x14c28e[_0x3080('0x19')]?_[_0x3080('0x1a')](_0x14c28e[_0x3080('0x19')],function(_0x2efe97){return{'model':db[_0x2efe97[_0x3080('0x1b')]],'as':_0x2efe97['as'],'attributes':_0x2efe97[_0x3080('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3080('0xa')](function(_0x26623e){logger[_0x3080('0xb')](_0x3080('0x1c'),_0xb87a4b);logger[_0x3080('0xd')]('GetSalesforceAccount',_0xb87a4b,JSON['stringify'](_0x26623e));_0x198bbf(_0x26623e);})['catch'](function(_0x4293ba){logger[_0x3080('0x10')](_0x3080('0x1c'),_0x4293ba[_0x3080('0x12')],_0xb87a4b);_0x7289ea(_0x17dda3[_0x3080('0x10')](0x1f4,_0x4293ba[_0x3080('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x250805){var _0x41d758=this;return new Promise(function(_0x296071,_0x113aa9){return db[_0x3080('0x15')]['find']({'raw':_0x250805[_0x3080('0x16')]?_0x250805[_0x3080('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x250805['options']?_0x250805[_0x3080('0x16')][_0x3080('0x1d')]||null:null,'attributes':_0x250805['options']?_0x250805[_0x3080('0x16')][_0x3080('0x17')]||null:null,'include':_0x250805['options']?_0x250805[_0x3080('0x16')][_0x3080('0x19')]?_['map'](_0x250805[_0x3080('0x16')][_0x3080('0x19')],function(_0x2446f0){return{'model':db[_0x2446f0[_0x3080('0x1b')]],'as':_0x2446f0['as'],'attributes':_0x2446f0[_0x3080('0x17')],'include':_0x2446f0[_0x3080('0x19')]?_[_0x3080('0x1a')](_0x2446f0[_0x3080('0x19')],function(_0x164e88){return{'model':db[_0x164e88[_0x3080('0x1b')]],'as':_0x164e88['as'],'attributes':_0x164e88['attributes'],'include':_0x164e88[_0x3080('0x19')]?_[_0x3080('0x1a')](_0x164e88[_0x3080('0x19')],function(_0x5c8643){return{'model':db[_0x5c8643[_0x3080('0x1b')]],'as':_0x5c8643['as'],'attributes':_0x5c8643[_0x3080('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4184bb){logger[_0x3080('0xb')](_0x3080('0x1e'),_0x250805);logger['debug'](_0x3080('0x1e'),_0x250805,JSON[_0x3080('0x1f')](_0x4184bb));_0x296071(_0x4184bb);})[_0x3080('0x14')](function(_0x2233d9){logger[_0x3080('0x10')](_0x3080('0x1e'),_0x2233d9[_0x3080('0x12')],_0x250805);_0x113aa9(_0x41d758[_0x3080('0x10')](0x1f4,_0x2233d9[_0x3080('0x12')]));});});}; \ No newline at end of file +var _0x0aaa=['catch','GetSalesforceAccount','findAll','options','where','limit','include','model','attributes','find','map','ShowSalesforceAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3b44b0,_0x4458f3){var _0x39b561=function(_0x534b02){while(--_0x534b02){_0x3b44b0['push'](_0x3b44b0['shift']());}};_0x39b561(++_0x4458f3);}(_0x0aaa,0x160));var _0xa0aa=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x0aaa[_0x5c6244];return _0x5800ce;};'use strict';var _=require(_0xa0aa('0x0'));var util=require(_0xa0aa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0aa('0x2'));var fs=require('fs');var Redis=require(_0xa0aa('0x3'));var db=require(_0xa0aa('0x4'))['db'];var utils=require(_0xa0aa('0x5'));var logger=require(_0xa0aa('0x6'))(_0xa0aa('0x7'));var config=require(_0xa0aa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa0aa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7f514b,_0x500e1c,_0x14136c){return new BPromise(function(_0x4e523c,_0x258bbf){return client[_0xa0aa('0xa')](_0x7f514b,_0x14136c)[_0xa0aa('0xb')](function(_0x35a132){logger[_0xa0aa('0xc')](_0xa0aa('0xd'),_0x500e1c,_0xa0aa('0xe'));logger[_0xa0aa('0xf')](_0xa0aa('0x10'),_0x500e1c,'request\x20sent',JSON[_0xa0aa('0x11')](_0x35a132));if(_0x35a132[_0xa0aa('0x12')]){if(_0x35a132[_0xa0aa('0x12')][_0xa0aa('0x13')]===0x1f4){logger[_0xa0aa('0x12')](_0xa0aa('0xd'),_0x500e1c,_0x35a132[_0xa0aa('0x12')][_0xa0aa('0x14')]);return _0x258bbf(_0x35a132['error'][_0xa0aa('0x14')]);}logger[_0xa0aa('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x500e1c,_0x35a132[_0xa0aa('0x12')][_0xa0aa('0x14')]);return _0x4e523c(_0x35a132[_0xa0aa('0x12')][_0xa0aa('0x14')]);}else{logger[_0xa0aa('0xc')](_0xa0aa('0xd'),_0x500e1c,_0xa0aa('0xe'));_0x4e523c(_0x35a132[_0xa0aa('0x15')][_0xa0aa('0x14')]);}})[_0xa0aa('0x16')](function(_0x4af031){logger[_0xa0aa('0x12')](_0xa0aa('0xd'),_0x500e1c,_0x4af031);_0x258bbf(_0x4af031);});});}exports[_0xa0aa('0x17')]=function(_0x1e64fe){var _0x17f120=this;return new Promise(function(_0x1f9546,_0x5e2ff8){return db['SalesforceAccount'][_0xa0aa('0x18')]({'raw':_0x1e64fe[_0xa0aa('0x19')]?_0x1e64fe['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e64fe[_0xa0aa('0x19')]?_0x1e64fe[_0xa0aa('0x19')][_0xa0aa('0x1a')]||null:null,'attributes':_0x1e64fe[_0xa0aa('0x19')]?_0x1e64fe['options']['attributes']||null:null,'limit':_0x1e64fe['options']?_0x1e64fe[_0xa0aa('0x19')][_0xa0aa('0x1b')]||null:null,'include':_0x1e64fe['options']?_0x1e64fe[_0xa0aa('0x19')][_0xa0aa('0x1c')]?_['map'](_0x1e64fe['options'][_0xa0aa('0x1c')],function(_0x201e73){return{'model':db[_0x201e73[_0xa0aa('0x1d')]],'as':_0x201e73['as'],'attributes':_0x201e73[_0xa0aa('0x1e')],'include':_0x201e73['include']?_['map'](_0x201e73['include'],function(_0xd91b75){return{'model':db[_0xd91b75[_0xa0aa('0x1d')]],'as':_0xd91b75['as'],'attributes':_0xd91b75[_0xa0aa('0x1e')],'include':_0xd91b75[_0xa0aa('0x1c')]?_['map'](_0xd91b75[_0xa0aa('0x1c')],function(_0x2a4737){return{'model':db[_0x2a4737[_0xa0aa('0x1d')]],'as':_0x2a4737['as'],'attributes':_0x2a4737[_0xa0aa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa0aa('0xb')](function(_0x188645){logger['info'](_0xa0aa('0x17'),_0x1e64fe);logger[_0xa0aa('0xf')]('GetSalesforceAccount',_0x1e64fe,JSON[_0xa0aa('0x11')](_0x188645));_0x1f9546(_0x188645);})[_0xa0aa('0x16')](function(_0x31923e){logger['error'](_0xa0aa('0x17'),_0x31923e[_0xa0aa('0x14')],_0x1e64fe);_0x5e2ff8(_0x17f120[_0xa0aa('0x12')](0x1f4,_0x31923e[_0xa0aa('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0x893477){var _0x5ddeac=this;return new Promise(function(_0x3a1db6,_0x59c32a){return db['SalesforceAccount'][_0xa0aa('0x1f')]({'raw':_0x893477['options']?_0x893477[_0xa0aa('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x893477[_0xa0aa('0x19')]?_0x893477[_0xa0aa('0x19')][_0xa0aa('0x1a')]||null:null,'attributes':_0x893477[_0xa0aa('0x19')]?_0x893477[_0xa0aa('0x19')]['attributes']||null:null,'include':_0x893477[_0xa0aa('0x19')]?_0x893477['options']['include']?_[_0xa0aa('0x20')](_0x893477[_0xa0aa('0x19')][_0xa0aa('0x1c')],function(_0x244773){return{'model':db[_0x244773[_0xa0aa('0x1d')]],'as':_0x244773['as'],'attributes':_0x244773[_0xa0aa('0x1e')],'include':_0x244773[_0xa0aa('0x1c')]?_[_0xa0aa('0x20')](_0x244773[_0xa0aa('0x1c')],function(_0x4afe26){return{'model':db[_0x4afe26[_0xa0aa('0x1d')]],'as':_0x4afe26['as'],'attributes':_0x4afe26[_0xa0aa('0x1e')],'include':_0x4afe26[_0xa0aa('0x1c')]?_[_0xa0aa('0x20')](_0x4afe26['include'],function(_0x12706a){return{'model':db[_0x12706a[_0xa0aa('0x1d')]],'as':_0x12706a['as'],'attributes':_0x12706a[_0xa0aa('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41765b){logger[_0xa0aa('0xc')](_0xa0aa('0x21'),_0x893477);logger[_0xa0aa('0xf')]('ShowSalesforceAccount',_0x893477,JSON[_0xa0aa('0x11')](_0x41765b));_0x3a1db6(_0x41765b);})[_0xa0aa('0x16')](function(_0x3c2d67){logger[_0xa0aa('0x12')](_0xa0aa('0x21'),_0x3c2d67['message'],_0x893477);_0x59c32a(_0x5ddeac['error'](0x1f4,_0x3c2d67[_0xa0aa('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index c39ed37..54829ad 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(_0x2dc702,_0x15ded9){var _0x306961=function(_0x1888c9){while(--_0x1888c9){_0x2dc702['push'](_0x2dc702['shift']());}};_0x306961(++_0x15ded9);}(_0x7a54,0x106));var _0x47a5=function(_0x5dba05,_0x10e465){_0x5dba05=_0x5dba05-0x0;var _0x44157d=_0x7a54[_0x5dba05];return _0x44157d;};'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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0b0e,0x187));var _0xe0b0=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x0b0e[_0x622035];return _0x326cf2;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 47caaa5..09f1a2d 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 _0xe965=['contact_lead','contact','lead','account','nothing','STRING','sequelize','exports','ENUM','Task','Case'];(function(_0x433c57,_0x404714){var _0x4e3709=function(_0x2f9180){while(--_0x2f9180){_0x433c57['push'](_0x433c57['shift']());}};_0x4e3709(++_0x404714);}(_0xe965,0x13a));var _0x5e96=function(_0xf9549b,_0x13d8e3){_0xf9549b=_0xf9549b-0x0;var _0x1e84a2=_0xe965[_0xf9549b];return _0x1e84a2;};'use strict';var Sequelize=require(_0x5e96('0x0'));module[_0x5e96('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x5e96('0x2')](_0x5e96('0x3'),_0x5e96('0x4')),'defaultValue':_0x5e96('0x3')},'moduleSearch':{'type':Sequelize[_0x5e96('0x2')](_0x5e96('0x5'),_0x5e96('0x6'),_0x5e96('0x7'),'account_contact_lead',_0x5e96('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x5e96('0x2')](_0x5e96('0x9'),_0x5e96('0x6'),_0x5e96('0x7'),'account'),'defaultValue':_0x5e96('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x5e96('0xa')]},'additionalSearchContact':{'type':Sequelize[_0x5e96('0xa')]},'additionalSearchLead':{'type':Sequelize[_0x5e96('0xa')]}}; \ No newline at end of file +var _0xce03=['sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x1235f7,_0x4a3374){var _0x3cdaac=function(_0x46d733){while(--_0x46d733){_0x1235f7['push'](_0x1235f7['shift']());}};_0x3cdaac(++_0x4a3374);}(_0xce03,0x114));var _0x3ce0=function(_0x2ee8fd,_0x40320c){_0x2ee8fd=_0x2ee8fd-0x0;var _0x33f810=_0xce03[_0x2ee8fd];return _0x33f810;};'use strict';var Sequelize=require(_0x3ce0('0x0'));module[_0x3ce0('0x1')]={'name':{'type':Sequelize[_0x3ce0('0x2')]},'description':{'type':Sequelize[_0x3ce0('0x2')]},'ticketType':{'type':Sequelize[_0x3ce0('0x3')](_0x3ce0('0x4'),_0x3ce0('0x5')),'defaultValue':_0x3ce0('0x4')},'moduleSearch':{'type':Sequelize[_0x3ce0('0x3')](_0x3ce0('0x6'),_0x3ce0('0x7'),_0x3ce0('0x8'),_0x3ce0('0x9'),_0x3ce0('0xa')),'defaultValue':_0x3ce0('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x3ce0('0xb'),_0x3ce0('0x7'),'lead',_0x3ce0('0xa')),'defaultValue':_0x3ce0('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x3ce0('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x3ce0('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index d6e9512..32bb138 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 _0xfa91=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','update','then','error','name','SalesforceConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','getFields','findOne','SalesforceField','length','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x4ddd5d,_0x279206){var _0x544f59=function(_0x5e296c){while(--_0x5e296c){_0x4ddd5d['push'](_0x4ddd5d['shift']());}};_0x544f59(++_0x279206);}(_0xfa91,0x1df));var _0x1fa9=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xfa91[_0xd0b415];return _0x2bdf2c;};'use strict';var emlformat=require(_0x1fa9('0x0'));var rimraf=require(_0x1fa9('0x1'));var zipdir=require(_0x1fa9('0x2'));var jsonpatch=require(_0x1fa9('0x3'));var rp=require(_0x1fa9('0x4'));var moment=require(_0x1fa9('0x5'));var BPromise=require(_0x1fa9('0x6'));var Mustache=require(_0x1fa9('0x7'));var util=require(_0x1fa9('0x8'));var path=require(_0x1fa9('0x9'));var sox=require(_0x1fa9('0xa'));var csv=require('to-csv');var ejs=require(_0x1fa9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1fa9('0xc'));var squel=require(_0x1fa9('0xd'));var crypto=require('crypto');var jsforce=require(_0x1fa9('0xe'));var deskjs=require(_0x1fa9('0xf'));var toCsv=require(_0x1fa9('0x10'));var querystring=require(_0x1fa9('0x11'));var Papa=require(_0x1fa9('0x12'));var Redis=require(_0x1fa9('0x13'));var authService=require(_0x1fa9('0x14'));var qs=require(_0x1fa9('0x15'));var as=require(_0x1fa9('0x16'));var hardwareService=require(_0x1fa9('0x17'));var logger=require(_0x1fa9('0x18'))(_0x1fa9('0x19'));var utils=require(_0x1fa9('0x1a'));var config=require(_0x1fa9('0x1b'));var licenseUtil=require(_0x1fa9('0x1c'));var db=require(_0x1fa9('0x1d'))['db'];function respondWithStatusCode(_0x155f1a,_0x1c856e){_0x1c856e=_0x1c856e||0xcc;return function(_0x137cb7){if(_0x137cb7){return _0x155f1a[_0x1fa9('0x1e')](_0x1c856e);}return _0x155f1a[_0x1fa9('0x1f')](_0x1c856e)[_0x1fa9('0x20')]();};}function respondWithResult(_0x2c5fde,_0x4b7579){_0x4b7579=_0x4b7579||0xc8;return function(_0xa75d93){if(_0xa75d93){return _0x2c5fde[_0x1fa9('0x1f')](_0x4b7579)['json'](_0xa75d93);}};}function respondWithFilteredResult(_0x268b8e,_0x2fe26d){return function(_0x35c9ab){if(_0x35c9ab){var _0x4597f3=typeof _0x2fe26d[_0x1fa9('0x21')]==='undefined'&&typeof _0x2fe26d[_0x1fa9('0x22')]==='undefined';var _0x4d5a5d=_0x35c9ab['count'];var _0x1497df=_0x4597f3?0x0:_0x2fe26d[_0x1fa9('0x21')];var _0x43d307=_0x4597f3?_0x35c9ab[_0x1fa9('0x23')]:_0x2fe26d[_0x1fa9('0x21')]+_0x2fe26d[_0x1fa9('0x22')];var _0x1aa49a;if(_0x43d307>=_0x4d5a5d){_0x43d307=_0x4d5a5d;_0x1aa49a=0xc8;}else{_0x1aa49a=0xce;}_0x268b8e[_0x1fa9('0x1f')](_0x1aa49a);return _0x268b8e[_0x1fa9('0x24')]('Content-Range',_0x1497df+'-'+_0x43d307+'/'+_0x4d5a5d)[_0x1fa9('0x25')](_0x35c9ab);}return null;};}function patchUpdates(_0x438033){return function(_0x2f7064){try{jsonpatch[_0x1fa9('0x26')](_0x2f7064,_0x438033,!![]);}catch(_0x3bf0d2){return BPromise[_0x1fa9('0x27')](_0x3bf0d2);}return _0x2f7064['save']();};}function saveUpdates(_0x5e28ac,_0x33b471){return function(_0x3f8450){if(_0x3f8450){return _0x3f8450[_0x1fa9('0x28')](_0x5e28ac)['then'](function(_0x1aad59){return _0x1aad59;});}return null;};}function removeEntity(_0x2a09a7,_0x48e0c9){return function(_0x21b288){if(_0x21b288){return _0x21b288['destroy']()[_0x1fa9('0x29')](function(){_0x2a09a7[_0x1fa9('0x1f')](0xcc)[_0x1fa9('0x20')]();});}};}function handleEntityNotFound(_0x59edf8,_0x8b3f3a){return function(_0x3481ee){if(!_0x3481ee){_0x59edf8['sendStatus'](0x194);}return _0x3481ee;};}function handleError(_0x2e626d,_0x5b45b1){_0x5b45b1=_0x5b45b1||0x1f4;return function(_0x368d2c){logger[_0x1fa9('0x2a')](_0x368d2c['stack']);if(_0x368d2c[_0x1fa9('0x2b')]){delete _0x368d2c['name'];}_0x2e626d[_0x1fa9('0x1f')](_0x5b45b1)['send'](_0x368d2c);};}exports['index']=function(_0x43cc0e,_0x5e978c){var _0x579e2b={},_0xbfb3a2={},_0x96a064={'count':0x0,'rows':[]};var _0x512124=_['map'](db[_0x1fa9('0x2c')][_0x1fa9('0x2d')],function(_0x8f4f81){return{'name':_0x8f4f81[_0x1fa9('0x2e')],'type':_0x8f4f81[_0x1fa9('0x2f')][_0x1fa9('0x30')]};});_0xbfb3a2['model']=_[_0x1fa9('0x31')](_0x512124,_0x1fa9('0x2b'));_0xbfb3a2[_0x1fa9('0x32')]=_[_0x1fa9('0x33')](_0x43cc0e[_0x1fa9('0x32')]);_0xbfb3a2[_0x1fa9('0x34')]=_[_0x1fa9('0x35')](_0xbfb3a2[_0x1fa9('0x36')],_0xbfb3a2[_0x1fa9('0x32')]);_0x579e2b['attributes']=_['intersection'](_0xbfb3a2[_0x1fa9('0x36')],qs[_0x1fa9('0x37')](_0x43cc0e[_0x1fa9('0x32')]['fields']));_0x579e2b[_0x1fa9('0x38')]=_0x579e2b[_0x1fa9('0x38')]['length']?_0x579e2b[_0x1fa9('0x38')]:_0xbfb3a2[_0x1fa9('0x36')];if(!_0x43cc0e['query'][_0x1fa9('0x39')]('nolimit')){_0x579e2b[_0x1fa9('0x22')]=qs['limit'](_0x43cc0e[_0x1fa9('0x32')][_0x1fa9('0x22')]);_0x579e2b[_0x1fa9('0x21')]=qs[_0x1fa9('0x21')](_0x43cc0e[_0x1fa9('0x32')][_0x1fa9('0x21')]);}_0x579e2b[_0x1fa9('0x3a')]=qs[_0x1fa9('0x3b')](_0x43cc0e[_0x1fa9('0x32')]['sort']);_0x579e2b[_0x1fa9('0x3c')]=qs['filters'](_[_0x1fa9('0x3d')](_0x43cc0e['query'],_0xbfb3a2[_0x1fa9('0x34')]),_0x512124);if(_0x43cc0e[_0x1fa9('0x32')][_0x1fa9('0x3e')]){_0x579e2b['where']=_['merge'](_0x579e2b[_0x1fa9('0x3c')],{'$or':_['map'](_0x512124,function(_0x2fc1ef){if(_0x2fc1ef[_0x1fa9('0x2f')]!=='VIRTUAL'){var _0x20dc63={};_0x20dc63[_0x2fc1ef[_0x1fa9('0x2b')]]={'$like':'%'+_0x43cc0e['query']['filter']+'%'};return _0x20dc63;}})});}_0x579e2b=_[_0x1fa9('0x3f')]({},_0x579e2b,_0x43cc0e[_0x1fa9('0x40')]);var _0x291673={'where':_0x579e2b[_0x1fa9('0x3c')]};return db[_0x1fa9('0x2c')][_0x1fa9('0x23')](_0x291673)[_0x1fa9('0x29')](function(_0x5b65e4){_0x96a064['count']=_0x5b65e4;if(_0x43cc0e['query']['includeAll']){_0x579e2b[_0x1fa9('0x41')]=[{'all':!![]}];}return db[_0x1fa9('0x2c')][_0x1fa9('0x42')](_0x579e2b);})['then'](function(_0x4fa90b){_0x96a064[_0x1fa9('0x43')]=_0x4fa90b;return _0x96a064;})[_0x1fa9('0x29')](respondWithFilteredResult(_0x5e978c,_0x579e2b))['catch'](handleError(_0x5e978c,null));};exports[_0x1fa9('0x44')]=function(_0x384f37,_0x502db2){var _0x206296={'raw':![],'where':{'id':_0x384f37[_0x1fa9('0x45')]['id']}},_0x193b47={};_0x193b47[_0x1fa9('0x36')]=_[_0x1fa9('0x33')](db[_0x1fa9('0x2c')][_0x1fa9('0x2d')]);_0x193b47['query']=_[_0x1fa9('0x33')](_0x384f37['query']);_0x193b47[_0x1fa9('0x34')]=_[_0x1fa9('0x35')](_0x193b47[_0x1fa9('0x36')],_0x193b47['query']);_0x206296[_0x1fa9('0x38')]=_[_0x1fa9('0x35')](_0x193b47[_0x1fa9('0x36')],qs[_0x1fa9('0x37')](_0x384f37['query'][_0x1fa9('0x37')]));_0x206296[_0x1fa9('0x38')]=_0x206296['attributes']['length']?_0x206296['attributes']:_0x193b47['model'];if(_0x384f37[_0x1fa9('0x32')][_0x1fa9('0x46')]){_0x206296[_0x1fa9('0x41')]=[{'all':!![]}];}_0x206296=_['merge']({},_0x206296,_0x384f37['options']);return db[_0x1fa9('0x2c')][_0x1fa9('0x47')](_0x206296)[_0x1fa9('0x29')](handleEntityNotFound(_0x502db2,null))[_0x1fa9('0x29')](respondWithResult(_0x502db2,null))[_0x1fa9('0x48')](handleError(_0x502db2,null));};exports[_0x1fa9('0x49')]=function(_0x526db8,_0x12e17e){return db[_0x1fa9('0x2c')][_0x1fa9('0x49')](_0x526db8[_0x1fa9('0x4a')],{})[_0x1fa9('0x29')](respondWithResult(_0x12e17e,0xc9))['catch'](handleError(_0x12e17e,null));};exports[_0x1fa9('0x28')]=function(_0x31bcf1,_0x3fb261){if(_0x31bcf1[_0x1fa9('0x4a')]['id']){delete _0x31bcf1['body']['id'];}return db[_0x1fa9('0x2c')][_0x1fa9('0x47')]({'where':{'id':_0x31bcf1['params']['id']}})[_0x1fa9('0x29')](handleEntityNotFound(_0x3fb261,null))[_0x1fa9('0x29')](saveUpdates(_0x31bcf1[_0x1fa9('0x4a')],null))[_0x1fa9('0x29')](respondWithResult(_0x3fb261,null))[_0x1fa9('0x48')](handleError(_0x3fb261,null));};exports[_0x1fa9('0x4b')]=function(_0x445237,_0x33683c){return db[_0x1fa9('0x2c')]['find']({'where':{'id':_0x445237['params']['id']}})[_0x1fa9('0x29')](handleEntityNotFound(_0x33683c,null))[_0x1fa9('0x29')](removeEntity(_0x33683c,null))[_0x1fa9('0x48')](handleError(_0x33683c,null));};exports[_0x1fa9('0x4c')]=function(_0x29047d,_0x5e557b,_0x1f6109){var _0xa8cefe={};var _0x8bbb1b={};var _0x47eea1;var _0x3bc37c;return db[_0x1fa9('0x2c')][_0x1fa9('0x4d')]({'where':{'id':_0x29047d[_0x1fa9('0x45')]['id']}})[_0x1fa9('0x29')](handleEntityNotFound(_0x5e557b,null))['then'](function(_0x25b165){if(_0x25b165){_0x47eea1=_0x25b165;_0x8bbb1b[_0x1fa9('0x36')]=_[_0x1fa9('0x33')](db[_0x1fa9('0x4e')][_0x1fa9('0x2d')]);_0x8bbb1b[_0x1fa9('0x32')]=_['keys'](_0x29047d[_0x1fa9('0x32')]);_0x8bbb1b['filters']=_['intersection'](_0x8bbb1b[_0x1fa9('0x36')],_0x8bbb1b['query']);_0xa8cefe[_0x1fa9('0x38')]=_[_0x1fa9('0x35')](_0x8bbb1b['model'],qs[_0x1fa9('0x37')](_0x29047d[_0x1fa9('0x32')][_0x1fa9('0x37')]));_0xa8cefe['attributes']=_0xa8cefe[_0x1fa9('0x38')][_0x1fa9('0x4f')]?_0xa8cefe['attributes']:_0x8bbb1b[_0x1fa9('0x36')];_0xa8cefe['order']=qs[_0x1fa9('0x3b')](_0x29047d['query'][_0x1fa9('0x3b')]);_0xa8cefe['where']=qs[_0x1fa9('0x34')](_[_0x1fa9('0x3d')](_0x29047d['query'],_0x8bbb1b[_0x1fa9('0x34')]));if(_0x29047d[_0x1fa9('0x32')][_0x1fa9('0x3e')]){_0xa8cefe[_0x1fa9('0x3c')]=_[_0x1fa9('0x3f')](_0xa8cefe[_0x1fa9('0x3c')],{'$or':_[_0x1fa9('0x31')](_0xa8cefe['attributes'],function(_0x2deebe){var _0x2d10d8={};_0x2d10d8[_0x2deebe]={'$like':'%'+_0x29047d[_0x1fa9('0x32')][_0x1fa9('0x3e')]+'%'};return _0x2d10d8;})});}_0xa8cefe=_[_0x1fa9('0x3f')]({},_0xa8cefe,_0x29047d[_0x1fa9('0x40')]);return _0x47eea1[_0x1fa9('0x4c')](_0xa8cefe);}})['then'](function(_0x481509){if(_0x481509){_0x3bc37c=_0x481509[_0x1fa9('0x4f')];if(!_0x29047d[_0x1fa9('0x32')][_0x1fa9('0x39')]('nolimit')){_0xa8cefe[_0x1fa9('0x22')]=qs[_0x1fa9('0x22')](_0x29047d['query'][_0x1fa9('0x22')]);_0xa8cefe['offset']=qs[_0x1fa9('0x21')](_0x29047d[_0x1fa9('0x32')][_0x1fa9('0x21')]);}return _0x47eea1[_0x1fa9('0x4c')](_0xa8cefe);}})[_0x1fa9('0x29')](function(_0x49168b){if(_0x49168b){return _0x49168b?{'count':_0x3bc37c,'rows':_0x49168b}:null;}})[_0x1fa9('0x29')](respondWithResult(_0x5e557b,null))['catch'](handleError(_0x5e557b,null));};exports['getSubjects']=function(_0x58ed47,_0x256ccf,_0x29790e){var _0x2390d2={};var _0x456580={};var _0xe8208a;var _0x2644e9;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x58ed47[_0x1fa9('0x45')]['id']}})[_0x1fa9('0x29')](handleEntityNotFound(_0x256ccf,null))[_0x1fa9('0x29')](function(_0x21e6eb){if(_0x21e6eb){_0xe8208a=_0x21e6eb;_0x456580[_0x1fa9('0x36')]=_[_0x1fa9('0x33')](db[_0x1fa9('0x4e')][_0x1fa9('0x2d')]);_0x456580[_0x1fa9('0x32')]=_[_0x1fa9('0x33')](_0x58ed47[_0x1fa9('0x32')]);_0x456580[_0x1fa9('0x34')]=_[_0x1fa9('0x35')](_0x456580[_0x1fa9('0x36')],_0x456580[_0x1fa9('0x32')]);_0x2390d2[_0x1fa9('0x38')]=_[_0x1fa9('0x35')](_0x456580[_0x1fa9('0x36')],qs[_0x1fa9('0x37')](_0x58ed47[_0x1fa9('0x32')]['fields']));_0x2390d2[_0x1fa9('0x38')]=_0x2390d2[_0x1fa9('0x38')]['length']?_0x2390d2[_0x1fa9('0x38')]:_0x456580['model'];_0x2390d2[_0x1fa9('0x3a')]=qs[_0x1fa9('0x3b')](_0x58ed47[_0x1fa9('0x32')]['sort']);_0x2390d2['where']=qs[_0x1fa9('0x34')](_[_0x1fa9('0x3d')](_0x58ed47[_0x1fa9('0x32')],_0x456580[_0x1fa9('0x34')]));if(_0x58ed47[_0x1fa9('0x32')][_0x1fa9('0x3e')]){_0x2390d2['where']=_['merge'](_0x2390d2[_0x1fa9('0x3c')],{'$or':_[_0x1fa9('0x31')](_0x2390d2[_0x1fa9('0x38')],function(_0x5cb6df){var _0x117146={};_0x117146[_0x5cb6df]={'$like':'%'+_0x58ed47[_0x1fa9('0x32')][_0x1fa9('0x3e')]+'%'};return _0x117146;})});}_0x2390d2=_['merge']({},_0x2390d2,_0x58ed47[_0x1fa9('0x40')]);return _0xe8208a[_0x1fa9('0x50')](_0x2390d2);}})[_0x1fa9('0x29')](function(_0x1ce6ee){if(_0x1ce6ee){_0x2644e9=_0x1ce6ee[_0x1fa9('0x4f')];if(!_0x58ed47[_0x1fa9('0x32')][_0x1fa9('0x39')](_0x1fa9('0x51'))){_0x2390d2['limit']=qs[_0x1fa9('0x22')](_0x58ed47[_0x1fa9('0x32')][_0x1fa9('0x22')]);_0x2390d2[_0x1fa9('0x21')]=qs[_0x1fa9('0x21')](_0x58ed47[_0x1fa9('0x32')][_0x1fa9('0x21')]);}return _0xe8208a[_0x1fa9('0x50')](_0x2390d2);}})[_0x1fa9('0x29')](function(_0x2ae9b7){if(_0x2ae9b7){return _0x2ae9b7?{'count':_0x2644e9,'rows':_0x2ae9b7}:null;}})[_0x1fa9('0x29')](respondWithResult(_0x256ccf,null))[_0x1fa9('0x48')](handleError(_0x256ccf,null));};exports[_0x1fa9('0x52')]=function(_0x4274a9,_0x1235da,_0x3f03fc){var _0x458707={};var _0x3f60fd={};var _0x449a6f;var _0x403011;return db[_0x1fa9('0x2c')][_0x1fa9('0x4d')]({'where':{'id':_0x4274a9[_0x1fa9('0x45')]['id']}})['then'](handleEntityNotFound(_0x1235da,null))[_0x1fa9('0x29')](function(_0x51a029){if(_0x51a029){_0x449a6f=_0x51a029;_0x3f60fd[_0x1fa9('0x36')]=_[_0x1fa9('0x33')](db[_0x1fa9('0x4e')]['rawAttributes']);_0x3f60fd['query']=_[_0x1fa9('0x33')](_0x4274a9['query']);_0x3f60fd[_0x1fa9('0x34')]=_[_0x1fa9('0x35')](_0x3f60fd['model'],_0x3f60fd[_0x1fa9('0x32')]);_0x458707[_0x1fa9('0x38')]=_[_0x1fa9('0x35')](_0x3f60fd['model'],qs[_0x1fa9('0x37')](_0x4274a9[_0x1fa9('0x32')][_0x1fa9('0x37')]));_0x458707[_0x1fa9('0x38')]=_0x458707[_0x1fa9('0x38')][_0x1fa9('0x4f')]?_0x458707[_0x1fa9('0x38')]:_0x3f60fd['model'];_0x458707['order']=qs[_0x1fa9('0x3b')](_0x4274a9[_0x1fa9('0x32')][_0x1fa9('0x3b')]);_0x458707[_0x1fa9('0x3c')]=qs[_0x1fa9('0x34')](_['pick'](_0x4274a9[_0x1fa9('0x32')],_0x3f60fd[_0x1fa9('0x34')]));if(_0x4274a9['query'][_0x1fa9('0x3e')]){_0x458707[_0x1fa9('0x3c')]=_[_0x1fa9('0x3f')](_0x458707[_0x1fa9('0x3c')],{'$or':_[_0x1fa9('0x31')](_0x458707['attributes'],function(_0x7a00a0){var _0x214c33={};_0x214c33[_0x7a00a0]={'$like':'%'+_0x4274a9[_0x1fa9('0x32')][_0x1fa9('0x3e')]+'%'};return _0x214c33;})});}_0x458707=_[_0x1fa9('0x3f')]({},_0x458707,_0x4274a9[_0x1fa9('0x40')]);return _0x449a6f[_0x1fa9('0x52')](_0x458707);}})[_0x1fa9('0x29')](function(_0x2eac34){if(_0x2eac34){_0x403011=_0x2eac34[_0x1fa9('0x4f')];if(!_0x4274a9[_0x1fa9('0x32')][_0x1fa9('0x39')](_0x1fa9('0x51'))){_0x458707[_0x1fa9('0x22')]=qs[_0x1fa9('0x22')](_0x4274a9[_0x1fa9('0x32')][_0x1fa9('0x22')]);_0x458707[_0x1fa9('0x21')]=qs[_0x1fa9('0x21')](_0x4274a9[_0x1fa9('0x32')][_0x1fa9('0x21')]);}return _0x449a6f['getDescriptions'](_0x458707);}})[_0x1fa9('0x29')](function(_0x141db2){if(_0x141db2){return _0x141db2?{'count':_0x403011,'rows':_0x141db2}:null;}})[_0x1fa9('0x29')](respondWithResult(_0x1235da,null))[_0x1fa9('0x48')](handleError(_0x1235da,null));}; \ No newline at end of file +var _0xf5a7=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','SalesforceConfiguration','fieldName','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','type','VIRTUAL','merge','where','then','findAll','rows','catch','show','params','rawAttributes','intersection','include','options','create','body','find','getFields','order','filter','getSubjects','findOne','getDescriptions','SalesforceField','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x4cedc0,_0x240022){var _0x12bd4a=function(_0x3171df){while(--_0x3171df){_0x4cedc0['push'](_0x4cedc0['shift']());}};_0x12bd4a(++_0x240022);}(_0xf5a7,0x133));var _0x7f5a=function(_0x8a8386,_0x1b2f20){_0x8a8386=_0x8a8386-0x0;var _0x2c2d20=_0xf5a7[_0x8a8386];return _0x2c2d20;};'use strict';var emlformat=require(_0x7f5a('0x0'));var rimraf=require(_0x7f5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f5a('0x2'));var rp=require(_0x7f5a('0x3'));var moment=require(_0x7f5a('0x4'));var BPromise=require(_0x7f5a('0x5'));var Mustache=require(_0x7f5a('0x6'));var util=require(_0x7f5a('0x7'));var path=require(_0x7f5a('0x8'));var sox=require(_0x7f5a('0x9'));var csv=require(_0x7f5a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f5a('0xb'));var _=require(_0x7f5a('0xc'));var squel=require('squel');var crypto=require(_0x7f5a('0xd'));var jsforce=require(_0x7f5a('0xe'));var deskjs=require(_0x7f5a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7f5a('0x10'));var Redis=require(_0x7f5a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7f5a('0x12'));var hardwareService=require(_0x7f5a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7f5a('0x14'));var config=require(_0x7f5a('0x15'));var licenseUtil=require(_0x7f5a('0x16'));var db=require(_0x7f5a('0x17'))['db'];function respondWithStatusCode(_0x169701,_0x325fda){_0x325fda=_0x325fda||0xcc;return function(_0x55ca4b){if(_0x55ca4b){return _0x169701[_0x7f5a('0x18')](_0x325fda);}return _0x169701[_0x7f5a('0x19')](_0x325fda)[_0x7f5a('0x1a')]();};}function respondWithResult(_0x112311,_0x1f1c17){_0x1f1c17=_0x1f1c17||0xc8;return function(_0x2a25ab){if(_0x2a25ab){return _0x112311[_0x7f5a('0x19')](_0x1f1c17)[_0x7f5a('0x1b')](_0x2a25ab);}};}function respondWithFilteredResult(_0x4ce5c2,_0x2ed7d3){return function(_0x3c6d7c){if(_0x3c6d7c){var _0x5c6810=typeof _0x2ed7d3[_0x7f5a('0x1c')]===_0x7f5a('0x1d')&&typeof _0x2ed7d3[_0x7f5a('0x1e')]===_0x7f5a('0x1d');var _0x568857=_0x3c6d7c[_0x7f5a('0x1f')];var _0xce9655=_0x5c6810?0x0:_0x2ed7d3[_0x7f5a('0x1c')];var _0x3e168e=_0x5c6810?_0x3c6d7c['count']:_0x2ed7d3[_0x7f5a('0x1c')]+_0x2ed7d3[_0x7f5a('0x1e')];var _0x557b16;if(_0x3e168e>=_0x568857){_0x3e168e=_0x568857;_0x557b16=0xc8;}else{_0x557b16=0xce;}_0x4ce5c2['status'](_0x557b16);return _0x4ce5c2[_0x7f5a('0x20')](_0x7f5a('0x21'),_0xce9655+'-'+_0x3e168e+'/'+_0x568857)[_0x7f5a('0x1b')](_0x3c6d7c);}return null;};}function patchUpdates(_0x90c080){return function(_0x208a6e){try{jsonpatch[_0x7f5a('0x22')](_0x208a6e,_0x90c080,!![]);}catch(_0x2942f9){return BPromise[_0x7f5a('0x23')](_0x2942f9);}return _0x208a6e['save']();};}function saveUpdates(_0x4b8d6b,_0x3d5f19){return function(_0x57019e){if(_0x57019e){return _0x57019e[_0x7f5a('0x24')](_0x4b8d6b)['then'](function(_0x3fda96){return _0x3fda96;});}return null;};}function removeEntity(_0x1c43bb,_0xf52b51){return function(_0xb65c0){if(_0xb65c0){return _0xb65c0[_0x7f5a('0x25')]()['then'](function(){_0x1c43bb[_0x7f5a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280a55,_0x31f206){return function(_0x49902a){if(!_0x49902a){_0x280a55[_0x7f5a('0x18')](0x194);}return _0x49902a;};}function handleError(_0x5d53cc,_0x35c43b){_0x35c43b=_0x35c43b||0x1f4;return function(_0x2bfbfe){logger[_0x7f5a('0x26')](_0x2bfbfe[_0x7f5a('0x27')]);if(_0x2bfbfe['name']){delete _0x2bfbfe[_0x7f5a('0x28')];}_0x5d53cc[_0x7f5a('0x19')](_0x35c43b)[_0x7f5a('0x29')](_0x2bfbfe);};}exports[_0x7f5a('0x2a')]=function(_0x49327f,_0x4ee1ca){var _0x550e81={},_0x30c290={},_0x2f8113={'count':0x0,'rows':[]};var _0x332baa=_['map'](db[_0x7f5a('0x2b')]['rawAttributes'],function(_0x347d5c){return{'name':_0x347d5c[_0x7f5a('0x2c')],'type':_0x347d5c['type'][_0x7f5a('0x2d')]};});_0x30c290[_0x7f5a('0x2e')]=_[_0x7f5a('0x2f')](_0x332baa,_0x7f5a('0x28'));_0x30c290[_0x7f5a('0x30')]=_[_0x7f5a('0x31')](_0x49327f[_0x7f5a('0x30')]);_0x30c290[_0x7f5a('0x32')]=_['intersection'](_0x30c290[_0x7f5a('0x2e')],_0x30c290['query']);_0x550e81['attributes']=_['intersection'](_0x30c290[_0x7f5a('0x2e')],qs[_0x7f5a('0x33')](_0x49327f[_0x7f5a('0x30')][_0x7f5a('0x33')]));_0x550e81[_0x7f5a('0x34')]=_0x550e81['attributes'][_0x7f5a('0x35')]?_0x550e81['attributes']:_0x30c290[_0x7f5a('0x2e')];if(!_0x49327f['query'][_0x7f5a('0x36')](_0x7f5a('0x37'))){_0x550e81[_0x7f5a('0x1e')]=qs['limit'](_0x49327f['query'][_0x7f5a('0x1e')]);_0x550e81[_0x7f5a('0x1c')]=qs[_0x7f5a('0x1c')](_0x49327f['query'][_0x7f5a('0x1c')]);}_0x550e81['order']=qs['sort'](_0x49327f[_0x7f5a('0x30')][_0x7f5a('0x38')]);_0x550e81['where']=qs[_0x7f5a('0x32')](_[_0x7f5a('0x39')](_0x49327f[_0x7f5a('0x30')],_0x30c290[_0x7f5a('0x32')]),_0x332baa);if(_0x49327f[_0x7f5a('0x30')]['filter']){_0x550e81['where']=_['merge'](_0x550e81['where'],{'$or':_[_0x7f5a('0x2f')](_0x332baa,function(_0x5f194b){if(_0x5f194b[_0x7f5a('0x3a')]!==_0x7f5a('0x3b')){var _0x3e06c6={};_0x3e06c6[_0x5f194b[_0x7f5a('0x28')]]={'$like':'%'+_0x49327f[_0x7f5a('0x30')]['filter']+'%'};return _0x3e06c6;}})});}_0x550e81=_[_0x7f5a('0x3c')]({},_0x550e81,_0x49327f['options']);var _0x367be8={'where':_0x550e81[_0x7f5a('0x3d')]};return db[_0x7f5a('0x2b')]['count'](_0x367be8)[_0x7f5a('0x3e')](function(_0x5219e8){_0x2f8113[_0x7f5a('0x1f')]=_0x5219e8;if(_0x49327f[_0x7f5a('0x30')]['includeAll']){_0x550e81['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x7f5a('0x3f')](_0x550e81);})['then'](function(_0x4d65c0){_0x2f8113[_0x7f5a('0x40')]=_0x4d65c0;return _0x2f8113;})[_0x7f5a('0x3e')](respondWithFilteredResult(_0x4ee1ca,_0x550e81))[_0x7f5a('0x41')](handleError(_0x4ee1ca,null));};exports[_0x7f5a('0x42')]=function(_0x1fa1cc,_0x185db9){var _0x121fdf={'raw':![],'where':{'id':_0x1fa1cc[_0x7f5a('0x43')]['id']}},_0x29b022={};_0x29b022[_0x7f5a('0x2e')]=_[_0x7f5a('0x31')](db['SalesforceConfiguration'][_0x7f5a('0x44')]);_0x29b022['query']=_[_0x7f5a('0x31')](_0x1fa1cc[_0x7f5a('0x30')]);_0x29b022[_0x7f5a('0x32')]=_['intersection'](_0x29b022[_0x7f5a('0x2e')],_0x29b022[_0x7f5a('0x30')]);_0x121fdf[_0x7f5a('0x34')]=_[_0x7f5a('0x45')](_0x29b022[_0x7f5a('0x2e')],qs[_0x7f5a('0x33')](_0x1fa1cc[_0x7f5a('0x30')]['fields']));_0x121fdf[_0x7f5a('0x34')]=_0x121fdf[_0x7f5a('0x34')][_0x7f5a('0x35')]?_0x121fdf[_0x7f5a('0x34')]:_0x29b022[_0x7f5a('0x2e')];if(_0x1fa1cc[_0x7f5a('0x30')]['includeAll']){_0x121fdf[_0x7f5a('0x46')]=[{'all':!![]}];}_0x121fdf=_[_0x7f5a('0x3c')]({},_0x121fdf,_0x1fa1cc[_0x7f5a('0x47')]);return db[_0x7f5a('0x2b')]['find'](_0x121fdf)[_0x7f5a('0x3e')](handleEntityNotFound(_0x185db9,null))[_0x7f5a('0x3e')](respondWithResult(_0x185db9,null))[_0x7f5a('0x41')](handleError(_0x185db9,null));};exports[_0x7f5a('0x48')]=function(_0x10457b,_0x21c7f6){return db[_0x7f5a('0x2b')][_0x7f5a('0x48')](_0x10457b[_0x7f5a('0x49')],{})[_0x7f5a('0x3e')](respondWithResult(_0x21c7f6,0xc9))[_0x7f5a('0x41')](handleError(_0x21c7f6,null));};exports[_0x7f5a('0x24')]=function(_0xaabf0f,_0x163b97){if(_0xaabf0f['body']['id']){delete _0xaabf0f[_0x7f5a('0x49')]['id'];}return db['SalesforceConfiguration'][_0x7f5a('0x4a')]({'where':{'id':_0xaabf0f[_0x7f5a('0x43')]['id']}})[_0x7f5a('0x3e')](handleEntityNotFound(_0x163b97,null))['then'](saveUpdates(_0xaabf0f['body'],null))[_0x7f5a('0x3e')](respondWithResult(_0x163b97,null))[_0x7f5a('0x41')](handleError(_0x163b97,null));};exports[_0x7f5a('0x25')]=function(_0x3ad069,_0x5731d0){return db[_0x7f5a('0x2b')][_0x7f5a('0x4a')]({'where':{'id':_0x3ad069['params']['id']}})['then'](handleEntityNotFound(_0x5731d0,null))[_0x7f5a('0x3e')](removeEntity(_0x5731d0,null))[_0x7f5a('0x41')](handleError(_0x5731d0,null));};exports[_0x7f5a('0x4b')]=function(_0x225019,_0x361c56,_0x519834){var _0x11cb05={};var _0x2e8c81={};var _0x5eceb9;var _0x49a596;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x225019[_0x7f5a('0x43')]['id']}})[_0x7f5a('0x3e')](handleEntityNotFound(_0x361c56,null))['then'](function(_0x312ec1){if(_0x312ec1){_0x5eceb9=_0x312ec1;_0x2e8c81['model']=_['keys'](db['SalesforceField'][_0x7f5a('0x44')]);_0x2e8c81[_0x7f5a('0x30')]=_[_0x7f5a('0x31')](_0x225019[_0x7f5a('0x30')]);_0x2e8c81[_0x7f5a('0x32')]=_['intersection'](_0x2e8c81[_0x7f5a('0x2e')],_0x2e8c81[_0x7f5a('0x30')]);_0x11cb05['attributes']=_[_0x7f5a('0x45')](_0x2e8c81[_0x7f5a('0x2e')],qs[_0x7f5a('0x33')](_0x225019[_0x7f5a('0x30')][_0x7f5a('0x33')]));_0x11cb05['attributes']=_0x11cb05[_0x7f5a('0x34')][_0x7f5a('0x35')]?_0x11cb05[_0x7f5a('0x34')]:_0x2e8c81['model'];_0x11cb05[_0x7f5a('0x4c')]=qs['sort'](_0x225019[_0x7f5a('0x30')]['sort']);_0x11cb05[_0x7f5a('0x3d')]=qs[_0x7f5a('0x32')](_[_0x7f5a('0x39')](_0x225019[_0x7f5a('0x30')],_0x2e8c81[_0x7f5a('0x32')]));if(_0x225019[_0x7f5a('0x30')][_0x7f5a('0x4d')]){_0x11cb05[_0x7f5a('0x3d')]=_[_0x7f5a('0x3c')](_0x11cb05[_0x7f5a('0x3d')],{'$or':_[_0x7f5a('0x2f')](_0x11cb05[_0x7f5a('0x34')],function(_0x113715){var _0x21c6e5={};_0x21c6e5[_0x113715]={'$like':'%'+_0x225019[_0x7f5a('0x30')][_0x7f5a('0x4d')]+'%'};return _0x21c6e5;})});}_0x11cb05=_[_0x7f5a('0x3c')]({},_0x11cb05,_0x225019[_0x7f5a('0x47')]);return _0x5eceb9[_0x7f5a('0x4b')](_0x11cb05);}})['then'](function(_0x556a5f){if(_0x556a5f){_0x49a596=_0x556a5f[_0x7f5a('0x35')];if(!_0x225019['query']['hasOwnProperty'](_0x7f5a('0x37'))){_0x11cb05[_0x7f5a('0x1e')]=qs[_0x7f5a('0x1e')](_0x225019[_0x7f5a('0x30')][_0x7f5a('0x1e')]);_0x11cb05[_0x7f5a('0x1c')]=qs[_0x7f5a('0x1c')](_0x225019['query']['offset']);}return _0x5eceb9[_0x7f5a('0x4b')](_0x11cb05);}})['then'](function(_0x3184e0){if(_0x3184e0){return _0x3184e0?{'count':_0x49a596,'rows':_0x3184e0}:null;}})[_0x7f5a('0x3e')](respondWithResult(_0x361c56,null))[_0x7f5a('0x41')](handleError(_0x361c56,null));};exports[_0x7f5a('0x4e')]=function(_0x3b2963,_0x421f66,_0x2fac37){var _0x29d409={};var _0x3b7bf1={};var _0xda3aee;var _0x193b22;return db[_0x7f5a('0x2b')][_0x7f5a('0x4f')]({'where':{'id':_0x3b2963['params']['id']}})[_0x7f5a('0x3e')](handleEntityNotFound(_0x421f66,null))[_0x7f5a('0x3e')](function(_0x334b1f){if(_0x334b1f){_0xda3aee=_0x334b1f;_0x3b7bf1[_0x7f5a('0x2e')]=_[_0x7f5a('0x31')](db['SalesforceField']['rawAttributes']);_0x3b7bf1[_0x7f5a('0x30')]=_[_0x7f5a('0x31')](_0x3b2963[_0x7f5a('0x30')]);_0x3b7bf1['filters']=_[_0x7f5a('0x45')](_0x3b7bf1[_0x7f5a('0x2e')],_0x3b7bf1[_0x7f5a('0x30')]);_0x29d409['attributes']=_[_0x7f5a('0x45')](_0x3b7bf1[_0x7f5a('0x2e')],qs[_0x7f5a('0x33')](_0x3b2963[_0x7f5a('0x30')]['fields']));_0x29d409[_0x7f5a('0x34')]=_0x29d409['attributes']['length']?_0x29d409[_0x7f5a('0x34')]:_0x3b7bf1[_0x7f5a('0x2e')];_0x29d409[_0x7f5a('0x4c')]=qs[_0x7f5a('0x38')](_0x3b2963[_0x7f5a('0x30')][_0x7f5a('0x38')]);_0x29d409[_0x7f5a('0x3d')]=qs[_0x7f5a('0x32')](_['pick'](_0x3b2963[_0x7f5a('0x30')],_0x3b7bf1[_0x7f5a('0x32')]));if(_0x3b2963[_0x7f5a('0x30')][_0x7f5a('0x4d')]){_0x29d409[_0x7f5a('0x3d')]=_['merge'](_0x29d409[_0x7f5a('0x3d')],{'$or':_[_0x7f5a('0x2f')](_0x29d409[_0x7f5a('0x34')],function(_0x4d0f09){var _0x52a0dd={};_0x52a0dd[_0x4d0f09]={'$like':'%'+_0x3b2963[_0x7f5a('0x30')][_0x7f5a('0x4d')]+'%'};return _0x52a0dd;})});}_0x29d409=_[_0x7f5a('0x3c')]({},_0x29d409,_0x3b2963[_0x7f5a('0x47')]);return _0xda3aee['getSubjects'](_0x29d409);}})['then'](function(_0x3183b9){if(_0x3183b9){_0x193b22=_0x3183b9[_0x7f5a('0x35')];if(!_0x3b2963['query'][_0x7f5a('0x36')]('nolimit')){_0x29d409[_0x7f5a('0x1e')]=qs[_0x7f5a('0x1e')](_0x3b2963['query']['limit']);_0x29d409[_0x7f5a('0x1c')]=qs[_0x7f5a('0x1c')](_0x3b2963['query'][_0x7f5a('0x1c')]);}return _0xda3aee['getSubjects'](_0x29d409);}})[_0x7f5a('0x3e')](function(_0x15368e){if(_0x15368e){return _0x15368e?{'count':_0x193b22,'rows':_0x15368e}:null;}})[_0x7f5a('0x3e')](respondWithResult(_0x421f66,null))[_0x7f5a('0x41')](handleError(_0x421f66,null));};exports[_0x7f5a('0x50')]=function(_0x181e12,_0x1a9d82,_0x9b186e){var _0x24034b={};var _0x47369a={};var _0x2ee329;var _0x2bd572;return db[_0x7f5a('0x2b')]['findOne']({'where':{'id':_0x181e12[_0x7f5a('0x43')]['id']}})[_0x7f5a('0x3e')](handleEntityNotFound(_0x1a9d82,null))[_0x7f5a('0x3e')](function(_0x4cc688){if(_0x4cc688){_0x2ee329=_0x4cc688;_0x47369a[_0x7f5a('0x2e')]=_['keys'](db[_0x7f5a('0x51')][_0x7f5a('0x44')]);_0x47369a['query']=_[_0x7f5a('0x31')](_0x181e12[_0x7f5a('0x30')]);_0x47369a[_0x7f5a('0x32')]=_[_0x7f5a('0x45')](_0x47369a['model'],_0x47369a['query']);_0x24034b[_0x7f5a('0x34')]=_[_0x7f5a('0x45')](_0x47369a[_0x7f5a('0x2e')],qs['fields'](_0x181e12[_0x7f5a('0x30')][_0x7f5a('0x33')]));_0x24034b[_0x7f5a('0x34')]=_0x24034b[_0x7f5a('0x34')]['length']?_0x24034b[_0x7f5a('0x34')]:_0x47369a['model'];_0x24034b[_0x7f5a('0x4c')]=qs[_0x7f5a('0x38')](_0x181e12[_0x7f5a('0x30')]['sort']);_0x24034b[_0x7f5a('0x3d')]=qs[_0x7f5a('0x32')](_['pick'](_0x181e12[_0x7f5a('0x30')],_0x47369a[_0x7f5a('0x32')]));if(_0x181e12[_0x7f5a('0x30')][_0x7f5a('0x4d')]){_0x24034b[_0x7f5a('0x3d')]=_[_0x7f5a('0x3c')](_0x24034b[_0x7f5a('0x3d')],{'$or':_[_0x7f5a('0x2f')](_0x24034b['attributes'],function(_0x367bea){var _0x4069b7={};_0x4069b7[_0x367bea]={'$like':'%'+_0x181e12[_0x7f5a('0x30')]['filter']+'%'};return _0x4069b7;})});}_0x24034b=_[_0x7f5a('0x3c')]({},_0x24034b,_0x181e12[_0x7f5a('0x47')]);return _0x2ee329[_0x7f5a('0x50')](_0x24034b);}})[_0x7f5a('0x3e')](function(_0x5b3e58){if(_0x5b3e58){_0x2bd572=_0x5b3e58[_0x7f5a('0x35')];if(!_0x181e12[_0x7f5a('0x30')][_0x7f5a('0x36')](_0x7f5a('0x37'))){_0x24034b[_0x7f5a('0x1e')]=qs[_0x7f5a('0x1e')](_0x181e12['query'][_0x7f5a('0x1e')]);_0x24034b['offset']=qs[_0x7f5a('0x1c')](_0x181e12['query'][_0x7f5a('0x1c')]);}return _0x2ee329[_0x7f5a('0x50')](_0x24034b);}})['then'](function(_0x56bac5){if(_0x56bac5){return _0x56bac5?{'count':_0x2bd572,'rows':_0x56bac5}:null;}})[_0x7f5a('0x3e')](respondWithResult(_0x1a9d82,null))['catch'](handleError(_0x1a9d82,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 108fd0e..f311aa9 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 _0x86c4=['path','../../config/environment','SalesforceConfiguration','../../config/logger','bluebird','request-promise'];(function(_0x53d210,_0x4874c7){var _0x4ea418=function(_0x43326e){while(--_0x43326e){_0x53d210['push'](_0x53d210['shift']());}};_0x4ea418(++_0x4874c7);}(_0x86c4,0xd5));var _0x486c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x86c4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x486c('0x0'))('api');var moment=require('moment');var BPromise=require(_0x486c('0x1'));var rp=require(_0x486c('0x2'));var fs=require('fs');var path=require(_0x486c('0x3'));var rimraf=require('rimraf');var config=require(_0x486c('0x4'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x515c77,_0x284dac){return _0x515c77['define'](_0x486c('0x5'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc98d=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1d7037,_0xb6cea9){var _0xd410a2=function(_0x480d39){while(--_0x480d39){_0x1d7037['push'](_0x1d7037['shift']());}};_0xd410a2(++_0xb6cea9);}(_0xc98d,0xbe));var _0xdc98=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0xc98d[_0x59befa];return _0x1dd63d;};'use strict';var _=require(_0xdc98('0x0'));var util=require(_0xdc98('0x1'));var logger=require(_0xdc98('0x2'))(_0xdc98('0x3'));var moment=require(_0xdc98('0x4'));var BPromise=require(_0xdc98('0x5'));var rp=require(_0xdc98('0x6'));var fs=require('fs');var path=require(_0xdc98('0x7'));var rimraf=require(_0xdc98('0x8'));var config=require(_0xdc98('0x9'));var attributes=require(_0xdc98('0xa'));module[_0xdc98('0xb')]=function(_0x4e95ee,_0x3092a0){return _0x4e95ee[_0xdc98('0xc')]('SalesforceConfiguration',attributes,{'tableName':_0xdc98('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index eef0b35..bfa859a 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 _0x23a5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x59d259,_0x4188eb){var _0x1dd2ed=function(_0x276a58){while(--_0x276a58){_0x59d259['push'](_0x59d259['shift']());}};_0x1dd2ed(++_0x4188eb);}(_0x23a5,0xba));var _0x523a=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x23a5[_0x5c1345];return _0x1c070d;};'use strict';var _=require(_0x523a('0x0'));var util=require(_0x523a('0x1'));var moment=require(_0x523a('0x2'));var BPromise=require(_0x523a('0x3'));var rs=require(_0x523a('0x4'));var fs=require('fs');var Redis=require(_0x523a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x523a('0x6'));var logger=require(_0x523a('0x7'))(_0x523a('0x8'));var config=require(_0x523a('0x9'));var jayson=require(_0x523a('0xa'));var client=jayson[_0x523a('0xb')][_0x523a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cb60,_0x4799ac,_0x1c09dc){return new BPromise(function(_0xc5a9c2,_0x543d09){return client[_0x523a('0xd')](_0x14cb60,_0x1c09dc)[_0x523a('0xe')](function(_0x86f191){logger[_0x523a('0xf')](_0x523a('0x10'),_0x4799ac,'request\x20sent');logger[_0x523a('0x11')](_0x523a('0x12'),_0x4799ac,'request\x20sent',JSON[_0x523a('0x13')](_0x86f191));if(_0x86f191[_0x523a('0x14')]){if(_0x86f191['error'][_0x523a('0x15')]===0x1f4){logger[_0x523a('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4799ac,_0x86f191[_0x523a('0x14')][_0x523a('0x16')]);return _0x543d09(_0x86f191[_0x523a('0x14')][_0x523a('0x16')]);}logger[_0x523a('0x14')](_0x523a('0x10'),_0x4799ac,_0x86f191[_0x523a('0x14')][_0x523a('0x16')]);return _0xc5a9c2(_0x86f191[_0x523a('0x14')][_0x523a('0x16')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x4799ac,'request\x20sent');_0xc5a9c2(_0x86f191['result'][_0x523a('0x16')]);}})[_0x523a('0x17')](function(_0x125652){logger[_0x523a('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4799ac,_0x125652);_0x543d09(_0x125652);});});} \ No newline at end of file +var _0xd635=['then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4df280,_0x40468a){var _0x156023=function(_0x28585c){while(--_0x28585c){_0x4df280['push'](_0x4df280['shift']());}};_0x156023(++_0x40468a);}(_0xd635,0x186));var _0x5d63=function(_0x7a242a,_0x423353){_0x7a242a=_0x7a242a-0x0;var _0x3b20c3=_0xd635[_0x7a242a];return _0x3b20c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d63('0x0'));var BPromise=require(_0x5d63('0x1'));var rs=require(_0x5d63('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d63('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d63('0x4'))(_0x5d63('0x5'));var config=require(_0x5d63('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5d63('0x7')][_0x5d63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x432e15,_0x25262b,_0x10e0c3){return new BPromise(function(_0xad1086,_0x34686d){return client['request'](_0x432e15,_0x10e0c3)[_0x5d63('0x9')](function(_0x539ba0){logger[_0x5d63('0xa')](_0x5d63('0xb'),_0x25262b,'request\x20sent');logger[_0x5d63('0xc')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x25262b,_0x5d63('0xd'),JSON[_0x5d63('0xe')](_0x539ba0));if(_0x539ba0[_0x5d63('0xf')]){if(_0x539ba0[_0x5d63('0xf')]['code']===0x1f4){logger[_0x5d63('0xf')](_0x5d63('0xb'),_0x25262b,_0x539ba0[_0x5d63('0xf')][_0x5d63('0x10')]);return _0x34686d(_0x539ba0['error'][_0x5d63('0x10')]);}logger['error'](_0x5d63('0xb'),_0x25262b,_0x539ba0['error'][_0x5d63('0x10')]);return _0xad1086(_0x539ba0[_0x5d63('0xf')][_0x5d63('0x10')]);}else{logger[_0x5d63('0xa')](_0x5d63('0xb'),_0x25262b,_0x5d63('0xd'));_0xad1086(_0x539ba0[_0x5d63('0x11')][_0x5d63('0x10')]);}})[_0x5d63('0x12')](function(_0x196689){logger[_0x5d63('0xf')](_0x5d63('0xb'),_0x25262b,_0x196689);_0x34686d(_0x196689);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 47d9d0f..ceb090b 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 _0xca62=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','put','delete','destroy'];(function(_0xfb6ab3,_0x6fbabd){var _0x4b08ee=function(_0x2c3493){while(--_0x2c3493){_0xfb6ab3['push'](_0xfb6ab3['shift']());}};_0x4b08ee(++_0x6fbabd);}(_0xca62,0xb0));var _0x2ca6=function(_0x5bb8d0,_0x58e264){_0x5bb8d0=_0x5bb8d0-0x0;var _0x467b71=_0xca62[_0x5bb8d0];return _0x467b71;};'use strict';var multer=require(_0x2ca6('0x0'));var util=require(_0x2ca6('0x1'));var path=require(_0x2ca6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2ca6('0x3')]();var fs_extra=require(_0x2ca6('0x4'));var auth=require(_0x2ca6('0x5'));var interaction=require(_0x2ca6('0x6'));var config=require('../../config/environment');var controller=require(_0x2ca6('0x7'));router[_0x2ca6('0x8')]('/',auth[_0x2ca6('0x9')](),controller[_0x2ca6('0xa')]);router[_0x2ca6('0x8')](_0x2ca6('0xb'),auth[_0x2ca6('0x9')](),controller['show']);router[_0x2ca6('0xc')]('/',auth[_0x2ca6('0x9')](),controller['create']);router[_0x2ca6('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2ca6('0xe')](_0x2ca6('0xb'),auth[_0x2ca6('0x9')](),controller[_0x2ca6('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb1cf=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x14792f,_0x32f1be){var _0x38f852=function(_0x313df2){while(--_0x313df2){_0x14792f['push'](_0x14792f['shift']());}};_0x38f852(++_0x32f1be);}(_0xb1cf,0xc7));var _0xfb1c=function(_0x46a635,_0x3cf6f0){_0x46a635=_0x46a635-0x0;var _0xff72f1=_0xb1cf[_0x46a635];return _0xff72f1;};'use strict';var multer=require(_0xfb1c('0x0'));var util=require(_0xfb1c('0x1'));var path=require(_0xfb1c('0x2'));var timeout=require(_0xfb1c('0x3'));var express=require(_0xfb1c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfb1c('0x5'));var config=require(_0xfb1c('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0xfb1c('0x7')](),controller[_0xfb1c('0x8')]);router[_0xfb1c('0x9')](_0xfb1c('0xa'),auth['isAuthenticated'](),controller[_0xfb1c('0xb')]);router[_0xfb1c('0xc')]('/',auth[_0xfb1c('0x7')](),controller[_0xfb1c('0xd')]);router[_0xfb1c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfb1c('0xf')]);router[_0xfb1c('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfb1c('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 b4b1c10..6611f7d 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 _0xc97f=['keyValue','picklist','STRING','ENUM','customVariable','exports','string','variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc97f,0x16d));var _0xfc97=function(_0x1cafa7,_0x558708){_0x1cafa7=_0x1cafa7-0x0;var _0x350120=_0xc97f[_0x1cafa7];return _0x350120;};'use strict';var Sequelize=require('sequelize');module[_0xfc97('0x0')]={'type':{'type':Sequelize['ENUM'](_0xfc97('0x1'),_0xfc97('0x2'),'customVariable',_0xfc97('0x3'),_0xfc97('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfc97('0x5')]},'key':{'type':Sequelize[_0xfc97('0x5')]},'keyType':{'type':Sequelize[_0xfc97('0x6')](_0xfc97('0x1'),'variable',_0xfc97('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfc97('0x5')]},'variableName':{'type':Sequelize[_0xfc97('0x5')]}}; \ No newline at end of file +var _0xbd10=['ENUM','string','customVariable','picklist','STRING','variable','sequelize','exports'];(function(_0x434cd0,_0x5644ed){var _0x590669=function(_0x20d3dd){while(--_0x20d3dd){_0x434cd0['push'](_0x434cd0['shift']());}};_0x590669(++_0x5644ed);}(_0xbd10,0x1d6));var _0x0bd1=function(_0x541049,_0x1d54af){_0x541049=_0x541049-0x0;var _0x16bcfe=_0xbd10[_0x541049];return _0x16bcfe;};'use strict';var Sequelize=require(_0x0bd1('0x0'));module[_0x0bd1('0x1')]={'type':{'type':Sequelize[_0x0bd1('0x2')](_0x0bd1('0x3'),'variable',_0x0bd1('0x4'),'keyValue',_0x0bd1('0x5')),'defaultValue':_0x0bd1('0x3')},'content':{'type':Sequelize[_0x0bd1('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0bd1('0x2')](_0x0bd1('0x3'),_0x0bd1('0x7'),_0x0bd1('0x4'))},'keyContent':{'type':Sequelize[_0x0bd1('0x6')]},'idField':{'type':Sequelize[_0x0bd1('0x6')]},'variableName':{'type':Sequelize[_0x0bd1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f7d47f0..570e1b6 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 _0x8d87=['fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','SalesforceField','rawAttributes','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map'];(function(_0x96bf55,_0x184b21){var _0x44c688=function(_0x2ac499){while(--_0x2ac499){_0x96bf55['push'](_0x96bf55['shift']());}};_0x44c688(++_0x184b21);}(_0x8d87,0xfe));var _0x78d8=function(_0x3d6b5b,_0x163153){_0x3d6b5b=_0x3d6b5b-0x0;var _0x3f8935=_0x8d87[_0x3d6b5b];return _0x3f8935;};'use strict';var emlformat=require(_0x78d8('0x0'));var rimraf=require(_0x78d8('0x1'));var zipdir=require(_0x78d8('0x2'));var jsonpatch=require(_0x78d8('0x3'));var rp=require(_0x78d8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x78d8('0x5'));var util=require(_0x78d8('0x6'));var path=require(_0x78d8('0x7'));var sox=require('sox');var csv=require(_0x78d8('0x8'));var ejs=require(_0x78d8('0x9'));var fs=require('fs');var fs_extra=require(_0x78d8('0xa'));var _=require('lodash');var squel=require(_0x78d8('0xb'));var crypto=require(_0x78d8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x78d8('0x8'));var querystring=require(_0x78d8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78d8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x78d8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78d8('0x10'))(_0x78d8('0x11'));var utils=require(_0x78d8('0x12'));var config=require(_0x78d8('0x13'));var licenseUtil=require(_0x78d8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f844b,_0x3a0935){_0x3a0935=_0x3a0935||0xcc;return function(_0x262188){if(_0x262188){return _0x3f844b[_0x78d8('0x15')](_0x3a0935);}return _0x3f844b['status'](_0x3a0935)[_0x78d8('0x16')]();};}function respondWithResult(_0x19b62b,_0x3aa449){_0x3aa449=_0x3aa449||0xc8;return function(_0x5373d1){if(_0x5373d1){return _0x19b62b['status'](_0x3aa449)[_0x78d8('0x17')](_0x5373d1);}};}function respondWithFilteredResult(_0x45d571,_0x46366d){return function(_0x57c490){if(_0x57c490){var _0x38026c=typeof _0x46366d[_0x78d8('0x18')]===_0x78d8('0x19')&&typeof _0x46366d[_0x78d8('0x1a')]===_0x78d8('0x19');var _0x270af4=_0x57c490[_0x78d8('0x1b')];var _0x555c8d=_0x38026c?0x0:_0x46366d[_0x78d8('0x18')];var _0x54c81c=_0x38026c?_0x57c490['count']:_0x46366d[_0x78d8('0x18')]+_0x46366d[_0x78d8('0x1a')];var _0x26db9c;if(_0x54c81c>=_0x270af4){_0x54c81c=_0x270af4;_0x26db9c=0xc8;}else{_0x26db9c=0xce;}_0x45d571[_0x78d8('0x1c')](_0x26db9c);return _0x45d571[_0x78d8('0x1d')](_0x78d8('0x1e'),_0x555c8d+'-'+_0x54c81c+'/'+_0x270af4)['json'](_0x57c490);}return null;};}function patchUpdates(_0x2507cc){return function(_0x55fe4f){try{jsonpatch[_0x78d8('0x1f')](_0x55fe4f,_0x2507cc,!![]);}catch(_0x20776b){return BPromise[_0x78d8('0x20')](_0x20776b);}return _0x55fe4f['save']();};}function saveUpdates(_0x4585a2,_0x4db4c6){return function(_0x56dbb8){if(_0x56dbb8){return _0x56dbb8[_0x78d8('0x21')](_0x4585a2)[_0x78d8('0x22')](function(_0x3bd085){return _0x3bd085;});}return null;};}function removeEntity(_0x58a6b0,_0x1b5950){return function(_0x4c5979){if(_0x4c5979){return _0x4c5979[_0x78d8('0x23')]()[_0x78d8('0x22')](function(){_0x58a6b0[_0x78d8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37f74f,_0x19bb60){return function(_0x140b3d){if(!_0x140b3d){_0x37f74f[_0x78d8('0x15')](0x194);}return _0x140b3d;};}function handleError(_0x8f91bb,_0x706ea8){_0x706ea8=_0x706ea8||0x1f4;return function(_0x515298){logger[_0x78d8('0x24')](_0x515298[_0x78d8('0x25')]);if(_0x515298[_0x78d8('0x26')]){delete _0x515298[_0x78d8('0x26')];}_0x8f91bb[_0x78d8('0x1c')](_0x706ea8)[_0x78d8('0x27')](_0x515298);};}exports[_0x78d8('0x28')]=function(_0x7f283,_0x452c9a){var _0x365fba={},_0x428680={},_0x84f1ad={'count':0x0,'rows':[]};var _0xa2402d=_[_0x78d8('0x29')](db['SalesforceField']['rawAttributes'],function(_0x21c80b){return{'name':_0x21c80b[_0x78d8('0x2a')],'type':_0x21c80b[_0x78d8('0x2b')][_0x78d8('0x2c')]};});_0x428680[_0x78d8('0x2d')]=_[_0x78d8('0x29')](_0xa2402d,'name');_0x428680['query']=_[_0x78d8('0x2e')](_0x7f283[_0x78d8('0x2f')]);_0x428680[_0x78d8('0x30')]=_[_0x78d8('0x31')](_0x428680[_0x78d8('0x2d')],_0x428680[_0x78d8('0x2f')]);_0x365fba[_0x78d8('0x32')]=_[_0x78d8('0x31')](_0x428680['model'],qs[_0x78d8('0x33')](_0x7f283[_0x78d8('0x2f')][_0x78d8('0x33')]));_0x365fba[_0x78d8('0x32')]=_0x365fba[_0x78d8('0x32')][_0x78d8('0x34')]?_0x365fba['attributes']:_0x428680[_0x78d8('0x2d')];if(!_0x7f283[_0x78d8('0x2f')][_0x78d8('0x35')](_0x78d8('0x36'))){_0x365fba[_0x78d8('0x1a')]=qs[_0x78d8('0x1a')](_0x7f283[_0x78d8('0x2f')][_0x78d8('0x1a')]);_0x365fba[_0x78d8('0x18')]=qs[_0x78d8('0x18')](_0x7f283[_0x78d8('0x2f')][_0x78d8('0x18')]);}_0x365fba[_0x78d8('0x37')]=qs[_0x78d8('0x38')](_0x7f283['query'][_0x78d8('0x38')]);_0x365fba[_0x78d8('0x39')]=qs[_0x78d8('0x30')](_[_0x78d8('0x3a')](_0x7f283[_0x78d8('0x2f')],_0x428680[_0x78d8('0x30')]),_0xa2402d);if(_0x7f283[_0x78d8('0x2f')][_0x78d8('0x3b')]){_0x365fba[_0x78d8('0x39')]=_[_0x78d8('0x3c')](_0x365fba[_0x78d8('0x39')],{'$or':_[_0x78d8('0x29')](_0xa2402d,function(_0x34bea7){if(_0x34bea7['type']!==_0x78d8('0x3d')){var _0x47fb36={};_0x47fb36[_0x34bea7[_0x78d8('0x26')]]={'$like':'%'+_0x7f283[_0x78d8('0x2f')][_0x78d8('0x3b')]+'%'};return _0x47fb36;}})});}_0x365fba=_[_0x78d8('0x3c')]({},_0x365fba,_0x7f283[_0x78d8('0x3e')]);var _0x5118ab={'where':_0x365fba[_0x78d8('0x39')]};return db['SalesforceField']['count'](_0x5118ab)[_0x78d8('0x22')](function(_0x4ecb88){_0x84f1ad[_0x78d8('0x1b')]=_0x4ecb88;if(_0x7f283['query'][_0x78d8('0x3f')]){_0x365fba['include']=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x365fba);})[_0x78d8('0x22')](function(_0x3210d1){_0x84f1ad[_0x78d8('0x40')]=_0x3210d1;return _0x84f1ad;})[_0x78d8('0x22')](respondWithFilteredResult(_0x452c9a,_0x365fba))[_0x78d8('0x41')](handleError(_0x452c9a,null));};exports[_0x78d8('0x42')]=function(_0x475547,_0x5cee8e){var _0x54a626={'raw':!![],'where':{'id':_0x475547[_0x78d8('0x43')]['id']}},_0x439dca={};_0x439dca[_0x78d8('0x2d')]=_[_0x78d8('0x2e')](db[_0x78d8('0x44')][_0x78d8('0x45')]);_0x439dca[_0x78d8('0x2f')]=_[_0x78d8('0x2e')](_0x475547[_0x78d8('0x2f')]);_0x439dca[_0x78d8('0x30')]=_[_0x78d8('0x31')](_0x439dca['model'],_0x439dca['query']);_0x54a626[_0x78d8('0x32')]=_[_0x78d8('0x31')](_0x439dca[_0x78d8('0x2d')],qs['fields'](_0x475547[_0x78d8('0x2f')][_0x78d8('0x33')]));_0x54a626[_0x78d8('0x32')]=_0x54a626['attributes'][_0x78d8('0x34')]?_0x54a626[_0x78d8('0x32')]:_0x439dca[_0x78d8('0x2d')];if(_0x475547[_0x78d8('0x2f')][_0x78d8('0x3f')]){_0x54a626[_0x78d8('0x46')]=[{'all':!![]}];}_0x54a626=_[_0x78d8('0x3c')]({},_0x54a626,_0x475547[_0x78d8('0x3e')]);return db[_0x78d8('0x44')][_0x78d8('0x47')](_0x54a626)[_0x78d8('0x22')](handleEntityNotFound(_0x5cee8e,null))[_0x78d8('0x22')](respondWithResult(_0x5cee8e,null))[_0x78d8('0x41')](handleError(_0x5cee8e,null));};exports[_0x78d8('0x48')]=function(_0x684eff,_0x342e50){return db[_0x78d8('0x44')]['create'](_0x684eff[_0x78d8('0x49')],{})[_0x78d8('0x22')](respondWithResult(_0x342e50,0xc9))['catch'](handleError(_0x342e50,null));};exports[_0x78d8('0x21')]=function(_0x5bfdfa,_0x26ea47){if(_0x5bfdfa['body']['id']){delete _0x5bfdfa[_0x78d8('0x49')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x5bfdfa[_0x78d8('0x43')]['id']}})[_0x78d8('0x22')](handleEntityNotFound(_0x26ea47,null))[_0x78d8('0x22')](saveUpdates(_0x5bfdfa[_0x78d8('0x49')],null))['then'](respondWithResult(_0x26ea47,null))[_0x78d8('0x41')](handleError(_0x26ea47,null));};exports['destroy']=function(_0xa232c2,_0x3a031b){return db['SalesforceField'][_0x78d8('0x47')]({'where':{'id':_0xa232c2[_0x78d8('0x43')]['id']}})[_0x78d8('0x22')](handleEntityNotFound(_0x3a031b,null))[_0x78d8('0x22')](removeEntity(_0x3a031b,null))['catch'](handleError(_0x3a031b,null));}; \ No newline at end of file +var _0xf3cb=['fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','SalesforceField','rawAttributes'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xf3cb,0x152));var _0xbf3c=function(_0x420fb0,_0x350024){_0x420fb0=_0x420fb0-0x0;var _0x2572b4=_0xf3cb[_0x420fb0];return _0x2572b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf3c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf3c('0x1'));var rp=require(_0xbf3c('0x2'));var moment=require(_0xbf3c('0x3'));var BPromise=require(_0xbf3c('0x4'));var Mustache=require(_0xbf3c('0x5'));var util=require(_0xbf3c('0x6'));var path=require(_0xbf3c('0x7'));var sox=require(_0xbf3c('0x8'));var csv=require(_0xbf3c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf3c('0xa'));var _=require(_0xbf3c('0xb'));var squel=require(_0xbf3c('0xc'));var crypto=require(_0xbf3c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbf3c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbf3c('0xf'));var Papa=require(_0xbf3c('0x10'));var Redis=require(_0xbf3c('0x11'));var authService=require(_0xbf3c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbf3c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf3c('0x14'))(_0xbf3c('0x15'));var utils=require(_0xbf3c('0x16'));var config=require(_0xbf3c('0x17'));var licenseUtil=require(_0xbf3c('0x18'));var db=require(_0xbf3c('0x19'))['db'];function respondWithStatusCode(_0x5a20a1,_0x2d003e){_0x2d003e=_0x2d003e||0xcc;return function(_0x218a11){if(_0x218a11){return _0x5a20a1['sendStatus'](_0x2d003e);}return _0x5a20a1[_0xbf3c('0x1a')](_0x2d003e)[_0xbf3c('0x1b')]();};}function respondWithResult(_0xb7dfb3,_0x40ba0f){_0x40ba0f=_0x40ba0f||0xc8;return function(_0x58845b){if(_0x58845b){return _0xb7dfb3[_0xbf3c('0x1a')](_0x40ba0f)[_0xbf3c('0x1c')](_0x58845b);}};}function respondWithFilteredResult(_0x5357c9,_0x45f8de){return function(_0x1feaea){if(_0x1feaea){var _0x5e2278=typeof _0x45f8de['offset']===_0xbf3c('0x1d')&&typeof _0x45f8de[_0xbf3c('0x1e')]===_0xbf3c('0x1d');var _0x5a1198=_0x1feaea[_0xbf3c('0x1f')];var _0xb82579=_0x5e2278?0x0:_0x45f8de[_0xbf3c('0x20')];var _0x22874d=_0x5e2278?_0x1feaea[_0xbf3c('0x1f')]:_0x45f8de[_0xbf3c('0x20')]+_0x45f8de['limit'];var _0x4b0ff0;if(_0x22874d>=_0x5a1198){_0x22874d=_0x5a1198;_0x4b0ff0=0xc8;}else{_0x4b0ff0=0xce;}_0x5357c9[_0xbf3c('0x1a')](_0x4b0ff0);return _0x5357c9[_0xbf3c('0x21')](_0xbf3c('0x22'),_0xb82579+'-'+_0x22874d+'/'+_0x5a1198)['json'](_0x1feaea);}return null;};}function patchUpdates(_0x187156){return function(_0xfd4ec4){try{jsonpatch[_0xbf3c('0x23')](_0xfd4ec4,_0x187156,!![]);}catch(_0x266600){return BPromise[_0xbf3c('0x24')](_0x266600);}return _0xfd4ec4[_0xbf3c('0x25')]();};}function saveUpdates(_0x201b68,_0x57830d){return function(_0x1ef70b){if(_0x1ef70b){return _0x1ef70b[_0xbf3c('0x26')](_0x201b68)[_0xbf3c('0x27')](function(_0x1508c4){return _0x1508c4;});}return null;};}function removeEntity(_0x1b96ba,_0x12b997){return function(_0x426297){if(_0x426297){return _0x426297[_0xbf3c('0x28')]()[_0xbf3c('0x27')](function(){_0x1b96ba[_0xbf3c('0x1a')](0xcc)[_0xbf3c('0x1b')]();});}};}function handleEntityNotFound(_0x45fd88,_0x3702aa){return function(_0x2d8453){if(!_0x2d8453){_0x45fd88['sendStatus'](0x194);}return _0x2d8453;};}function handleError(_0x5976d5,_0x456963){_0x456963=_0x456963||0x1f4;return function(_0x12fa2c){logger[_0xbf3c('0x29')](_0x12fa2c[_0xbf3c('0x2a')]);if(_0x12fa2c[_0xbf3c('0x2b')]){delete _0x12fa2c[_0xbf3c('0x2b')];}_0x5976d5[_0xbf3c('0x1a')](_0x456963)['send'](_0x12fa2c);};}exports['index']=function(_0x54a293,_0x1b15cb){var _0x8da7fc={},_0x576f61={},_0x14017e={'count':0x0,'rows':[]};var _0x295b8c=_[_0xbf3c('0x2c')](db[_0xbf3c('0x2d')][_0xbf3c('0x2e')],function(_0x277d25){return{'name':_0x277d25[_0xbf3c('0x2f')],'type':_0x277d25['type'][_0xbf3c('0x30')]};});_0x576f61[_0xbf3c('0x31')]=_['map'](_0x295b8c,'name');_0x576f61[_0xbf3c('0x32')]=_[_0xbf3c('0x33')](_0x54a293[_0xbf3c('0x32')]);_0x576f61[_0xbf3c('0x34')]=_['intersection'](_0x576f61['model'],_0x576f61[_0xbf3c('0x32')]);_0x8da7fc[_0xbf3c('0x35')]=_[_0xbf3c('0x36')](_0x576f61['model'],qs[_0xbf3c('0x37')](_0x54a293[_0xbf3c('0x32')][_0xbf3c('0x37')]));_0x8da7fc[_0xbf3c('0x35')]=_0x8da7fc['attributes']['length']?_0x8da7fc[_0xbf3c('0x35')]:_0x576f61['model'];if(!_0x54a293[_0xbf3c('0x32')][_0xbf3c('0x38')](_0xbf3c('0x39'))){_0x8da7fc[_0xbf3c('0x1e')]=qs[_0xbf3c('0x1e')](_0x54a293[_0xbf3c('0x32')]['limit']);_0x8da7fc[_0xbf3c('0x20')]=qs[_0xbf3c('0x20')](_0x54a293[_0xbf3c('0x32')][_0xbf3c('0x20')]);}_0x8da7fc[_0xbf3c('0x3a')]=qs['sort'](_0x54a293[_0xbf3c('0x32')][_0xbf3c('0x3b')]);_0x8da7fc[_0xbf3c('0x3c')]=qs[_0xbf3c('0x34')](_[_0xbf3c('0x3d')](_0x54a293[_0xbf3c('0x32')],_0x576f61[_0xbf3c('0x34')]),_0x295b8c);if(_0x54a293[_0xbf3c('0x32')][_0xbf3c('0x3e')]){_0x8da7fc[_0xbf3c('0x3c')]=_['merge'](_0x8da7fc[_0xbf3c('0x3c')],{'$or':_[_0xbf3c('0x2c')](_0x295b8c,function(_0x4f6764){if(_0x4f6764[_0xbf3c('0x3f')]!==_0xbf3c('0x40')){var _0x5121e0={};_0x5121e0[_0x4f6764[_0xbf3c('0x2b')]]={'$like':'%'+_0x54a293['query'][_0xbf3c('0x3e')]+'%'};return _0x5121e0;}})});}_0x8da7fc=_[_0xbf3c('0x41')]({},_0x8da7fc,_0x54a293[_0xbf3c('0x42')]);var _0x5ea06c={'where':_0x8da7fc[_0xbf3c('0x3c')]};return db['SalesforceField'][_0xbf3c('0x1f')](_0x5ea06c)['then'](function(_0x4eb9dd){_0x14017e[_0xbf3c('0x1f')]=_0x4eb9dd;if(_0x54a293[_0xbf3c('0x32')][_0xbf3c('0x43')]){_0x8da7fc[_0xbf3c('0x44')]=[{'all':!![]}];}return db[_0xbf3c('0x2d')]['findAll'](_0x8da7fc);})[_0xbf3c('0x27')](function(_0x442217){_0x14017e[_0xbf3c('0x45')]=_0x442217;return _0x14017e;})[_0xbf3c('0x27')](respondWithFilteredResult(_0x1b15cb,_0x8da7fc))[_0xbf3c('0x46')](handleError(_0x1b15cb,null));};exports[_0xbf3c('0x47')]=function(_0x28ff5d,_0x9ffd04){var _0x3f8734={'raw':!![],'where':{'id':_0x28ff5d[_0xbf3c('0x48')]['id']}},_0x48db17={};_0x48db17[_0xbf3c('0x31')]=_[_0xbf3c('0x33')](db[_0xbf3c('0x2d')][_0xbf3c('0x2e')]);_0x48db17[_0xbf3c('0x32')]=_['keys'](_0x28ff5d[_0xbf3c('0x32')]);_0x48db17[_0xbf3c('0x34')]=_[_0xbf3c('0x36')](_0x48db17[_0xbf3c('0x31')],_0x48db17[_0xbf3c('0x32')]);_0x3f8734[_0xbf3c('0x35')]=_['intersection'](_0x48db17['model'],qs[_0xbf3c('0x37')](_0x28ff5d[_0xbf3c('0x32')][_0xbf3c('0x37')]));_0x3f8734['attributes']=_0x3f8734[_0xbf3c('0x35')][_0xbf3c('0x49')]?_0x3f8734[_0xbf3c('0x35')]:_0x48db17[_0xbf3c('0x31')];if(_0x28ff5d['query'][_0xbf3c('0x43')]){_0x3f8734[_0xbf3c('0x44')]=[{'all':!![]}];}_0x3f8734=_[_0xbf3c('0x41')]({},_0x3f8734,_0x28ff5d[_0xbf3c('0x42')]);return db[_0xbf3c('0x2d')][_0xbf3c('0x4a')](_0x3f8734)[_0xbf3c('0x27')](handleEntityNotFound(_0x9ffd04,null))['then'](respondWithResult(_0x9ffd04,null))[_0xbf3c('0x46')](handleError(_0x9ffd04,null));};exports[_0xbf3c('0x4b')]=function(_0x412d97,_0x5850c0){return db[_0xbf3c('0x2d')][_0xbf3c('0x4b')](_0x412d97[_0xbf3c('0x4c')],{})['then'](respondWithResult(_0x5850c0,0xc9))['catch'](handleError(_0x5850c0,null));};exports[_0xbf3c('0x26')]=function(_0x157fcd,_0xbba293){if(_0x157fcd[_0xbf3c('0x4c')]['id']){delete _0x157fcd[_0xbf3c('0x4c')]['id'];}return db['SalesforceField'][_0xbf3c('0x4a')]({'where':{'id':_0x157fcd[_0xbf3c('0x48')]['id']}})[_0xbf3c('0x27')](handleEntityNotFound(_0xbba293,null))[_0xbf3c('0x27')](saveUpdates(_0x157fcd['body'],null))[_0xbf3c('0x27')](respondWithResult(_0xbba293,null))[_0xbf3c('0x46')](handleError(_0xbba293,null));};exports[_0xbf3c('0x28')]=function(_0x5c7099,_0x4a19e6){return db[_0xbf3c('0x2d')][_0xbf3c('0x4a')]({'where':{'id':_0x5c7099[_0xbf3c('0x48')]['id']}})[_0xbf3c('0x27')](handleEntityNotFound(_0x4a19e6,null))[_0xbf3c('0x27')](removeEntity(_0x4a19e6,null))[_0xbf3c('0x46')](handleError(_0x4a19e6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 8717944..187e2c7 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 _0x17ae=['request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','util','api','moment','bluebird'];(function(_0x39cf8d,_0x3b829c){var _0x339810=function(_0x482b4c){while(--_0x482b4c){_0x39cf8d['push'](_0x39cf8d['shift']());}};_0x339810(++_0x3b829c);}(_0x17ae,0xdc));var _0xe17a=function(_0x581119,_0x2b1f7a){_0x581119=_0x581119-0x0;var _0x3273c0=_0x17ae[_0x581119];return _0x3273c0;};'use strict';var _=require('lodash');var util=require(_0xe17a('0x0'));var logger=require('../../config/logger')(_0xe17a('0x1'));var moment=require(_0xe17a('0x2'));var BPromise=require(_0xe17a('0x3'));var rp=require(_0xe17a('0x4'));var fs=require('fs');var path=require(_0xe17a('0x5'));var rimraf=require(_0xe17a('0x6'));var config=require(_0xe17a('0x7'));var attributes=require(_0xe17a('0x8'));module['exports']=function(_0x681312,_0x10abe7){return _0x681312[_0xe17a('0x9')](_0xe17a('0xa'),attributes,{'tableName':_0xe17a('0xb'),'paranoid':![],'indexes':[{'name':_0xe17a('0xc'),'fields':['idField',_0xe17a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x45d0=['api','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x1a58b3,_0x2e191e){var _0xc153b3=function(_0x2fd92e){while(--_0x2fd92e){_0x1a58b3['push'](_0x1a58b3['shift']());}};_0xc153b3(++_0x2e191e);}(_0x45d0,0x193));var _0x045d=function(_0x5016c9,_0x51ad68){_0x5016c9=_0x5016c9-0x0;var _0x2cad2b=_0x45d0[_0x5016c9];return _0x2cad2b;};'use strict';var _=require(_0x045d('0x0'));var util=require('util');var logger=require(_0x045d('0x1'))(_0x045d('0x2'));var moment=require('moment');var BPromise=require(_0x045d('0x3'));var rp=require(_0x045d('0x4'));var fs=require('fs');var path=require(_0x045d('0x5'));var rimraf=require('rimraf');var config=require(_0x045d('0x6'));var attributes=require(_0x045d('0x7'));module[_0x045d('0x8')]=function(_0x2113fc,_0x3e0560){return _0x2113fc[_0x045d('0x9')](_0x045d('0xa'),attributes,{'tableName':_0x045d('0xb'),'paranoid':![],'indexes':[{'name':_0x045d('0xc'),'fields':[_0x045d('0xd'),_0x045d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 6cdb89f..1808368 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 _0x5d96=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xbf84e7,_0x3bc128){var _0x35ee32=function(_0x484641){while(--_0x484641){_0xbf84e7['push'](_0xbf84e7['shift']());}};_0x35ee32(++_0x3bc128);}(_0x5d96,0x179));var _0x65d9=function(_0x3fa1fb,_0x981176){_0x3fa1fb=_0x3fa1fb-0x0;var _0x4b96e8=_0x5d96[_0x3fa1fb];return _0x4b96e8;};'use strict';var _=require(_0x65d9('0x0'));var util=require(_0x65d9('0x1'));var moment=require(_0x65d9('0x2'));var BPromise=require(_0x65d9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65d9('0x4'));var db=require(_0x65d9('0x5'))['db'];var utils=require(_0x65d9('0x6'));var logger=require(_0x65d9('0x7'))('rpc');var config=require(_0x65d9('0x8'));var jayson=require(_0x65d9('0x9'));var client=jayson[_0x65d9('0xa')][_0x65d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x267fb8,_0x20034d,_0x505cf6){return new BPromise(function(_0x1b8f76,_0x15d7dd){return client[_0x65d9('0xc')](_0x267fb8,_0x505cf6)[_0x65d9('0xd')](function(_0xfa4ea0){logger['info'](_0x65d9('0xe'),_0x20034d,_0x65d9('0xf'));logger[_0x65d9('0x10')](_0x65d9('0x11'),_0x20034d,'request\x20sent',JSON['stringify'](_0xfa4ea0));if(_0xfa4ea0[_0x65d9('0x12')]){if(_0xfa4ea0[_0x65d9('0x12')]['code']===0x1f4){logger[_0x65d9('0x12')]('SalesforceField,\x20%s,\x20%s',_0x20034d,_0xfa4ea0[_0x65d9('0x12')][_0x65d9('0x13')]);return _0x15d7dd(_0xfa4ea0[_0x65d9('0x12')][_0x65d9('0x13')]);}logger[_0x65d9('0x12')](_0x65d9('0xe'),_0x20034d,_0xfa4ea0[_0x65d9('0x12')][_0x65d9('0x13')]);return _0x1b8f76(_0xfa4ea0[_0x65d9('0x12')][_0x65d9('0x13')]);}else{logger[_0x65d9('0x14')](_0x65d9('0xe'),_0x20034d,'request\x20sent');_0x1b8f76(_0xfa4ea0[_0x65d9('0x15')][_0x65d9('0x13')]);}})[_0x65d9('0x16')](function(_0x527270){logger[_0x65d9('0x12')](_0x65d9('0xe'),_0x20034d,_0x527270);_0x15d7dd(_0x527270);});});} \ No newline at end of file +var _0x9d93=['result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x399b95,_0x4fafc8){var _0x3e3c12=function(_0x1d9ff6){while(--_0x1d9ff6){_0x399b95['push'](_0x399b95['shift']());}};_0x3e3c12(++_0x4fafc8);}(_0x9d93,0xc0));var _0x39d9=function(_0x26784a,_0x6c2717){_0x26784a=_0x26784a-0x0;var _0x53ffb6=_0x9d93[_0x26784a];return _0x53ffb6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x39d9('0x0'));var BPromise=require(_0x39d9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39d9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x39d9('0x3'));var logger=require(_0x39d9('0x4'))(_0x39d9('0x5'));var config=require(_0x39d9('0x6'));var jayson=require(_0x39d9('0x7'));var client=jayson[_0x39d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10fe59,_0x3b54c3,_0x584b60){return new BPromise(function(_0x2fae1b,_0x4cd36a){return client['request'](_0x10fe59,_0x584b60)[_0x39d9('0x9')](function(_0x5a427f){logger['info'](_0x39d9('0xa'),_0x3b54c3,_0x39d9('0xb'));logger[_0x39d9('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3b54c3,'request\x20sent',JSON['stringify'](_0x5a427f));if(_0x5a427f[_0x39d9('0xd')]){if(_0x5a427f[_0x39d9('0xd')][_0x39d9('0xe')]===0x1f4){logger[_0x39d9('0xd')](_0x39d9('0xa'),_0x3b54c3,_0x5a427f[_0x39d9('0xd')][_0x39d9('0xf')]);return _0x4cd36a(_0x5a427f[_0x39d9('0xd')][_0x39d9('0xf')]);}logger[_0x39d9('0xd')]('SalesforceField,\x20%s,\x20%s',_0x3b54c3,_0x5a427f[_0x39d9('0xd')][_0x39d9('0xf')]);return _0x2fae1b(_0x5a427f[_0x39d9('0xd')][_0x39d9('0xf')]);}else{logger[_0x39d9('0x10')](_0x39d9('0xa'),_0x3b54c3,_0x39d9('0xb'));_0x2fae1b(_0x5a427f[_0x39d9('0x11')]['message']);}})[_0x39d9('0x12')](function(_0x447172){logger[_0x39d9('0xd')](_0x39d9('0xa'),_0x3b54c3,_0x447172);_0x4cd36a(_0x447172);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 856489d..f1aeeb7 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 _0x8bc9=['fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x542d5f,_0x34e17e){var _0x4b92d5=function(_0x14aa42){while(--_0x14aa42){_0x542d5f['push'](_0x542d5f['shift']());}};_0x4b92d5(++_0x34e17e);}(_0x8bc9,0x1c3));var _0x98bc=function(_0x51dc0f,_0x36612f){_0x51dc0f=_0x51dc0f-0x0;var _0x3c9aae=_0x8bc9[_0x51dc0f];return _0x3c9aae;};'use strict';var multer=require(_0x98bc('0x0'));var util=require(_0x98bc('0x1'));var path=require('path');var timeout=require(_0x98bc('0x2'));var express=require(_0x98bc('0x3'));var router=express[_0x98bc('0x4')]();var fs_extra=require(_0x98bc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x98bc('0x6'));var config=require(_0x98bc('0x7'));var controller=require(_0x98bc('0x8'));router[_0x98bc('0x9')]('/',auth[_0x98bc('0xa')](),controller[_0x98bc('0xb')]);router[_0x98bc('0x9')](_0x98bc('0xc'),auth[_0x98bc('0xa')](),controller[_0x98bc('0xd')]);router[_0x98bc('0x9')](_0x98bc('0xe'),auth[_0x98bc('0xa')](),controller[_0x98bc('0xf')]);router[_0x98bc('0x9')](_0x98bc('0x10'),auth[_0x98bc('0xa')](),controller[_0x98bc('0x11')]);router[_0x98bc('0x12')]('/',auth[_0x98bc('0xa')](),controller['create']);router[_0x98bc('0x12')](_0x98bc('0xe'),auth[_0x98bc('0xa')](),controller[_0x98bc('0x13')]);router[_0x98bc('0x14')](_0x98bc('0xc'),auth[_0x98bc('0xa')](),controller[_0x98bc('0x15')]);router[_0x98bc('0x16')]('/:id',auth[_0x98bc('0xa')](),controller[_0x98bc('0x17')]);module['exports']=router; \ No newline at end of file +var _0x9c2c=['post','create','addConfiguration','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x25b298,_0x5d4fc6){var _0x2bc16c=function(_0x3516f7){while(--_0x3516f7){_0x25b298['push'](_0x25b298['shift']());}};_0x2bc16c(++_0x5d4fc6);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc9c2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc9c2('0x3'));var interaction=require(_0xc9c2('0x4'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xc9c2('0x5')]('/',auth['isAuthenticated'](),controller[_0xc9c2('0x6')]);router[_0xc9c2('0x5')](_0xc9c2('0x7'),auth[_0xc9c2('0x8')](),controller[_0xc9c2('0x9')]);router[_0xc9c2('0x5')](_0xc9c2('0xa'),auth[_0xc9c2('0x8')](),controller[_0xc9c2('0xb')]);router['get'](_0xc9c2('0xc'),auth['isAuthenticated'](),controller[_0xc9c2('0xd')]);router[_0xc9c2('0xe')]('/',auth[_0xc9c2('0x8')](),controller[_0xc9c2('0xf')]);router['post']('/:id/configurations',auth[_0xc9c2('0x8')](),controller[_0xc9c2('0x10')]);router['put'](_0xc9c2('0x7'),auth[_0xc9c2('0x8')](),controller[_0xc9c2('0x11')]);router[_0xc9c2('0x12')](_0xc9c2('0x7'),auth[_0xc9c2('0x8')](),controller[_0xc9c2('0x13')]);module[_0xc9c2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 74814dc..00c99cd 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 _0xe6e9=['sequelize','exports','STRING','username','remoteUri'];(function(_0x19774f,_0x102c86){var _0x76cc9a=function(_0x38feb6){while(--_0x38feb6){_0x19774f['push'](_0x19774f['shift']());}};_0x76cc9a(++_0x102c86);}(_0xe6e9,0x7d));var _0x9e6e=function(_0x4bb5db,_0x3ed1f2){_0x4bb5db=_0x4bb5db-0x0;var _0x2d9201=_0xe6e9[_0x4bb5db];return _0x2d9201;};'use strict';var Sequelize=require(_0x9e6e('0x0'));module[_0x9e6e('0x1')]={'name':{'type':Sequelize[_0x9e6e('0x2')]},'description':{'type':Sequelize[_0x9e6e('0x2')]},'username':{'type':Sequelize[_0x9e6e('0x2')],'unique':_0x9e6e('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9e6e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9e6e('0x4')},'serverUrl':{'type':Sequelize[_0x9e6e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x835b=['STRING'];(function(_0x3c73d1,_0x2c5b98){var _0x200bba=function(_0x23c557){while(--_0x23c557){_0x3c73d1['push'](_0x3c73d1['shift']());}};_0x200bba(++_0x2c5b98);}(_0x835b,0x11d));var _0xb835=function(_0x5aada8,_0x460a35){_0x5aada8=_0x5aada8-0x0;var _0xf5247e=_0x835b[_0x5aada8];return _0xf5247e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb835('0x0')]},'username':{'type':Sequelize[_0xb835('0x0')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb835('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 8088299..5201a35 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 _0x8181=['stack','name','send','index','ServicenowAccount','type','key','model','map','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','params','rawAttributes','keys','includeAll','find','create','body','update','getConfigurations','findOne','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','hold_reason','close_code','notify','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','resolved_at','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','problem_id','company','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','internalType','label','push','all','assign','forEach','concat','ServiceNow\x20error:\x20','error','test','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','destroy','sendStatus'];(function(_0x3ce4ae,_0x21f6aa){var _0x5bd51a=function(_0x35ea57){while(--_0x35ea57){_0x3ce4ae['push'](_0x3ce4ae['shift']());}};_0x5bd51a(++_0x21f6aa);}(_0x8181,0x96));var _0x1818=function(_0x22edc9,_0x3e3c75){_0x22edc9=_0x22edc9-0x0;var _0x4a2c0f=_0x8181[_0x22edc9];return _0x4a2c0f;};'use strict';var emlformat=require(_0x1818('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1818('0x1'));var BPromise=require(_0x1818('0x2'));var Mustache=require('mustache');var util=require(_0x1818('0x3'));var path=require(_0x1818('0x4'));var sox=require(_0x1818('0x5'));var csv=require(_0x1818('0x6'));var ejs=require(_0x1818('0x7'));var fs=require('fs');var fs_extra=require(_0x1818('0x8'));var _=require(_0x1818('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1818('0xa'));var deskjs=require(_0x1818('0xb'));var toCsv=require(_0x1818('0x6'));var querystring=require(_0x1818('0xc'));var Papa=require(_0x1818('0xd'));var Redis=require('ioredis');var authService=require(_0x1818('0xe'));var qs=require(_0x1818('0xf'));var as=require(_0x1818('0x10'));var hardwareService=require(_0x1818('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x1818('0x12'));var config=require(_0x1818('0x13'));var licenseUtil=require(_0x1818('0x14'));var db=require(_0x1818('0x15'))['db'];var integrations=require(_0x1818('0x16'));function respondWithStatusCode(_0x426b9c,_0x2069be){_0x2069be=_0x2069be||0xcc;return function(_0xeae04f){if(_0xeae04f){return _0x426b9c['sendStatus'](_0x2069be);}return _0x426b9c[_0x1818('0x17')](_0x2069be)[_0x1818('0x18')]();};}function respondWithResult(_0x5277e2,_0x354f4c){_0x354f4c=_0x354f4c||0xc8;return function(_0x50d5ae){if(_0x50d5ae){return _0x5277e2['status'](_0x354f4c)[_0x1818('0x19')](_0x50d5ae);}};}function respondWithFilteredResult(_0x202d1e,_0x2f6697){return function(_0x4d4b7a){if(_0x4d4b7a){var _0x49c8c0=typeof _0x2f6697[_0x1818('0x1a')]==='undefined'&&typeof _0x2f6697[_0x1818('0x1b')]===_0x1818('0x1c');var _0x218659=_0x4d4b7a[_0x1818('0x1d')];var _0x3c99a0=_0x49c8c0?0x0:_0x2f6697[_0x1818('0x1a')];var _0x351204=_0x49c8c0?_0x4d4b7a[_0x1818('0x1d')]:_0x2f6697[_0x1818('0x1a')]+_0x2f6697['limit'];var _0x284cae;if(_0x351204>=_0x218659){_0x351204=_0x218659;_0x284cae=0xc8;}else{_0x284cae=0xce;}_0x202d1e[_0x1818('0x17')](_0x284cae);return _0x202d1e[_0x1818('0x1e')](_0x1818('0x1f'),_0x3c99a0+'-'+_0x351204+'/'+_0x218659)[_0x1818('0x19')](_0x4d4b7a);}return null;};}function patchUpdates(_0x5dd1a2){return function(_0x16c27b){try{jsonpatch['apply'](_0x16c27b,_0x5dd1a2,!![]);}catch(_0xd3e949){return BPromise['reject'](_0xd3e949);}return _0x16c27b[_0x1818('0x20')]();};}function saveUpdates(_0x2e65cd,_0x40bef9){return function(_0x16283d){if(_0x16283d){return _0x16283d['update'](_0x2e65cd)[_0x1818('0x21')](function(_0x4fdc82){return _0x4fdc82;});}return null;};}function removeEntity(_0x3c8672,_0x5aab44){return function(_0x483f58){if(_0x483f58){return _0x483f58[_0x1818('0x22')]()[_0x1818('0x21')](function(){_0x3c8672[_0x1818('0x17')](0xcc)[_0x1818('0x18')]();});}};}function handleEntityNotFound(_0x2aa4ec,_0xb0947a){return function(_0x363e8a){if(!_0x363e8a){_0x2aa4ec[_0x1818('0x23')](0x194);}return _0x363e8a;};}function handleError(_0x1631af,_0x2b250d){_0x2b250d=_0x2b250d||0x1f4;return function(_0x2bf3f7){logger['error'](_0x2bf3f7[_0x1818('0x24')]);if(_0x2bf3f7[_0x1818('0x25')]){delete _0x2bf3f7['name'];}_0x1631af['status'](_0x2b250d)[_0x1818('0x26')](_0x2bf3f7);};}exports[_0x1818('0x27')]=function(_0x4c942b,_0x2fc972){var _0xbdb4dc={},_0x5b9132={},_0x44c667={'count':0x0,'rows':[]};var _0x2becfd=_['map'](db[_0x1818('0x28')]['rawAttributes'],function(_0x3c094d){return{'name':_0x3c094d['fieldName'],'type':_0x3c094d[_0x1818('0x29')][_0x1818('0x2a')]};});_0x5b9132[_0x1818('0x2b')]=_[_0x1818('0x2c')](_0x2becfd,_0x1818('0x25'));_0x5b9132[_0x1818('0x2d')]=_['keys'](_0x4c942b[_0x1818('0x2d')]);_0x5b9132[_0x1818('0x2e')]=_[_0x1818('0x2f')](_0x5b9132[_0x1818('0x2b')],_0x5b9132[_0x1818('0x2d')]);_0xbdb4dc['attributes']=_[_0x1818('0x2f')](_0x5b9132[_0x1818('0x2b')],qs['fields'](_0x4c942b[_0x1818('0x2d')][_0x1818('0x30')]));_0xbdb4dc['attributes']=_0xbdb4dc['attributes'][_0x1818('0x31')]?_0xbdb4dc[_0x1818('0x32')]:_0x5b9132[_0x1818('0x2b')];if(!_0x4c942b[_0x1818('0x2d')][_0x1818('0x33')](_0x1818('0x34'))){_0xbdb4dc['limit']=qs[_0x1818('0x1b')](_0x4c942b[_0x1818('0x2d')][_0x1818('0x1b')]);_0xbdb4dc[_0x1818('0x1a')]=qs[_0x1818('0x1a')](_0x4c942b['query']['offset']);}_0xbdb4dc[_0x1818('0x35')]=qs[_0x1818('0x36')](_0x4c942b[_0x1818('0x2d')][_0x1818('0x36')]);_0xbdb4dc['where']=qs['filters'](_[_0x1818('0x37')](_0x4c942b[_0x1818('0x2d')],_0x5b9132[_0x1818('0x2e')]),_0x2becfd);if(_0x4c942b[_0x1818('0x2d')][_0x1818('0x38')]){_0xbdb4dc[_0x1818('0x39')]=_[_0x1818('0x3a')](_0xbdb4dc['where'],{'$or':_['map'](_0x2becfd,function(_0x1ccbb5){if(_0x1ccbb5[_0x1818('0x29')]!=='VIRTUAL'){var _0x3ab616={};_0x3ab616[_0x1ccbb5[_0x1818('0x25')]]={'$like':'%'+_0x4c942b[_0x1818('0x2d')][_0x1818('0x38')]+'%'};return _0x3ab616;}})});}_0xbdb4dc=_[_0x1818('0x3a')]({},_0xbdb4dc,_0x4c942b[_0x1818('0x3b')]);var _0xb4dea4={'where':_0xbdb4dc[_0x1818('0x39')]};return db[_0x1818('0x28')][_0x1818('0x1d')](_0xb4dea4)[_0x1818('0x21')](function(_0x5d2670){_0x44c667[_0x1818('0x1d')]=_0x5d2670;if(_0x4c942b[_0x1818('0x2d')]['includeAll']){_0xbdb4dc[_0x1818('0x3c')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x1818('0x3d')](_0xbdb4dc);})[_0x1818('0x21')](function(_0x3c6724){_0x44c667[_0x1818('0x3e')]=_0x3c6724;return _0x44c667;})[_0x1818('0x21')](respondWithFilteredResult(_0x2fc972,_0xbdb4dc))[_0x1818('0x3f')](handleError(_0x2fc972,null));};exports['show']=function(_0x53f337,_0x377400){var _0x38be6c={'raw':![],'where':{'id':_0x53f337[_0x1818('0x40')]['id']}},_0x31ea11={};_0x31ea11['model']=_['keys'](db['ServicenowAccount'][_0x1818('0x41')]);_0x31ea11[_0x1818('0x2d')]=_[_0x1818('0x42')](_0x53f337[_0x1818('0x2d')]);_0x31ea11[_0x1818('0x2e')]=_[_0x1818('0x2f')](_0x31ea11[_0x1818('0x2b')],_0x31ea11[_0x1818('0x2d')]);_0x38be6c[_0x1818('0x32')]=_[_0x1818('0x2f')](_0x31ea11[_0x1818('0x2b')],qs[_0x1818('0x30')](_0x53f337[_0x1818('0x2d')][_0x1818('0x30')]));_0x38be6c[_0x1818('0x32')]=_0x38be6c[_0x1818('0x32')][_0x1818('0x31')]?_0x38be6c[_0x1818('0x32')]:_0x31ea11['model'];if(_0x53f337[_0x1818('0x2d')][_0x1818('0x43')]){_0x38be6c[_0x1818('0x3c')]=[{'all':!![]}];}_0x38be6c=_[_0x1818('0x3a')]({},_0x38be6c,_0x53f337['options']);return db[_0x1818('0x28')][_0x1818('0x44')](_0x38be6c)[_0x1818('0x21')](handleEntityNotFound(_0x377400,null))[_0x1818('0x21')](respondWithResult(_0x377400,null))[_0x1818('0x3f')](handleError(_0x377400,null));};exports[_0x1818('0x45')]=function(_0x246997,_0x270046){return db[_0x1818('0x28')][_0x1818('0x45')](_0x246997[_0x1818('0x46')],{})[_0x1818('0x21')](respondWithResult(_0x270046,0xc9))[_0x1818('0x3f')](handleError(_0x270046,null));};exports[_0x1818('0x47')]=function(_0x353ca1,_0x5e5dae){if(_0x353ca1[_0x1818('0x46')]['id']){delete _0x353ca1['body']['id'];}return db[_0x1818('0x28')]['find']({'where':{'id':_0x353ca1[_0x1818('0x40')]['id']}})[_0x1818('0x21')](handleEntityNotFound(_0x5e5dae,null))[_0x1818('0x21')](saveUpdates(_0x353ca1[_0x1818('0x46')],null))['then'](respondWithResult(_0x5e5dae,null))[_0x1818('0x3f')](handleError(_0x5e5dae,null));};exports[_0x1818('0x22')]=function(_0x2a679d,_0x3a05e0){return db[_0x1818('0x28')][_0x1818('0x44')]({'where':{'id':_0x2a679d['params']['id']}})[_0x1818('0x21')](handleEntityNotFound(_0x3a05e0,null))[_0x1818('0x21')](removeEntity(_0x3a05e0,null))[_0x1818('0x3f')](handleError(_0x3a05e0,null));};exports[_0x1818('0x48')]=function(_0x51c038,_0x3aca28,_0x12388){var _0x4fc2a9={};var _0x498f1f={};var _0x3ff6a6;var _0xc7bb6d;return db[_0x1818('0x28')][_0x1818('0x49')]({'where':{'id':_0x51c038['params']['id']}})[_0x1818('0x21')](handleEntityNotFound(_0x3aca28,null))[_0x1818('0x21')](function(_0x2bea10){if(_0x2bea10){_0x3ff6a6=_0x2bea10;_0x498f1f[_0x1818('0x2b')]=_['keys'](db['ServicenowConfiguration']['rawAttributes']);_0x498f1f[_0x1818('0x2d')]=_[_0x1818('0x42')](_0x51c038['query']);_0x498f1f['filters']=_[_0x1818('0x2f')](_0x498f1f[_0x1818('0x2b')],_0x498f1f[_0x1818('0x2d')]);_0x4fc2a9['attributes']=_[_0x1818('0x2f')](_0x498f1f[_0x1818('0x2b')],qs[_0x1818('0x30')](_0x51c038['query']['fields']));_0x4fc2a9[_0x1818('0x32')]=_0x4fc2a9[_0x1818('0x32')][_0x1818('0x31')]?_0x4fc2a9[_0x1818('0x32')]:_0x498f1f[_0x1818('0x2b')];_0x4fc2a9['order']=qs[_0x1818('0x36')](_0x51c038[_0x1818('0x2d')][_0x1818('0x36')]);_0x4fc2a9[_0x1818('0x39')]=qs[_0x1818('0x2e')](_[_0x1818('0x37')](_0x51c038[_0x1818('0x2d')],_0x498f1f[_0x1818('0x2e')]));if(_0x51c038[_0x1818('0x2d')][_0x1818('0x38')]){_0x4fc2a9['where']=_['merge'](_0x4fc2a9['where'],{'$or':_['map'](_0x4fc2a9[_0x1818('0x32')],function(_0x44c3d8){var _0x449a05={};_0x449a05[_0x44c3d8]={'$like':'%'+_0x51c038[_0x1818('0x2d')][_0x1818('0x38')]+'%'};return _0x449a05;})});}_0x4fc2a9=_[_0x1818('0x3a')]({},_0x4fc2a9,_0x51c038['options']);return _0x3ff6a6[_0x1818('0x48')](_0x4fc2a9);}})[_0x1818('0x21')](function(_0x3f7d61){if(_0x3f7d61){_0xc7bb6d=_0x3f7d61['length'];if(!_0x51c038[_0x1818('0x2d')][_0x1818('0x33')](_0x1818('0x34'))){_0x4fc2a9[_0x1818('0x1b')]=qs[_0x1818('0x1b')](_0x51c038[_0x1818('0x2d')][_0x1818('0x1b')]);_0x4fc2a9[_0x1818('0x1a')]=qs[_0x1818('0x1a')](_0x51c038[_0x1818('0x2d')][_0x1818('0x1a')]);}return _0x3ff6a6[_0x1818('0x48')](_0x4fc2a9);}})['then'](function(_0x1f91f8){if(_0x1f91f8){return _0x1f91f8?{'count':_0xc7bb6d,'rows':_0x1f91f8}:null;}})[_0x1818('0x21')](respondWithResult(_0x3aca28,null))[_0x1818('0x3f')](handleError(_0x3aca28,null));};exports[_0x1818('0x4a')]=function(_0x40e9b8,_0x43fa92,_0x316097){if(_0x40e9b8[_0x1818('0x46')]['id']){delete _0x40e9b8['body']['id'];}return db[_0x1818('0x28')]['findOne']({'where':{'id':_0x40e9b8['params']['id']}})[_0x1818('0x21')](handleEntityNotFound(_0x43fa92,null))[_0x1818('0x21')](function(_0x169334){if(_0x169334){_0x40e9b8[_0x1818('0x46')][_0x1818('0x4b')]=_0x169334['id'];_0x40e9b8['body']['Subjects']=integrations[_0x1818('0x4c')](_0x40e9b8[_0x1818('0x46')][_0x1818('0x4d')],_0x40e9b8[_0x1818('0x46')][_0x1818('0x29')]);_0x40e9b8['body'][_0x1818('0x4e')]=integrations[_0x1818('0x4f')](_0x40e9b8[_0x1818('0x46')][_0x1818('0x4d')],_0x40e9b8[_0x1818('0x46')]['type']);return db['ServicenowConfiguration'][_0x1818('0x45')](_0x40e9b8['body'],{'include':[{'model':db[_0x1818('0x50')],'as':_0x1818('0x51')},{'model':db[_0x1818('0x50')],'as':_0x1818('0x4e')}]});}return null;})[_0x1818('0x21')](respondWithResult(_0x43fa92,null))[_0x1818('0x3f')](handleError(_0x43fa92,null));};exports['getFields']=function(_0x1c0c2b,_0x42e232,_0x311a2f){var _0x2a2dae=['made_sla',_0x1818('0x52'),'knowledge','subcategory',_0x1818('0x53'),_0x1818('0x54'),_0x1818('0x55'),_0x1818('0x56'),_0x1818('0x57')];var _0x20355e=[_0x1818('0x58'),_0x1818('0x59'),_0x1818('0x5a'),_0x1818('0x5b'),_0x1818('0x5c'),_0x1818('0x5d'),_0x1818('0x5e'),_0x1818('0x52'),_0x1818('0x5f'),_0x1818('0x60'),_0x1818('0x61'),_0x1818('0x62'),_0x1818('0x63'),_0x1818('0x64'),_0x1818('0x65'),_0x1818('0x66'),_0x1818('0x67'),_0x1818('0x68'),'knowledge',_0x1818('0x35'),_0x1818('0x69'),_0x1818('0x6a'),_0x1818('0x6b'),'delivery_plan',_0x1818('0x6c'),_0x1818('0x6d'),'work_notes_list',_0x1818('0x6e'),_0x1818('0x6f'),_0x1818('0x70'),_0x1818('0x71'),_0x1818('0x72'),_0x1818('0x73'),_0x1818('0x74'),'business_duration',_0x1818('0x75'),_0x1818('0x76'),'reopened_time',_0x1818('0x77'),'caller_id',_0x1818('0x78'),_0x1818('0x79'),_0x1818('0x7a'),_0x1818('0x7b'),'close_code',_0x1818('0x7c'),_0x1818('0x7d'),_0x1818('0x7e'),_0x1818('0x7f'),'business_stc',_0x1818('0x80'),_0x1818('0x81'),_0x1818('0x82'),_0x1818('0x54'),_0x1818('0x83'),_0x1818('0x84'),_0x1818('0x85'),_0x1818('0x86'),_0x1818('0x87'),_0x1818('0x88'),'contact_type',_0x1818('0x89'),_0x1818('0x55'),'urgency',_0x1818('0x8a'),_0x1818('0x8b'),'reassignment_count',_0x1818('0x8c'),'assigned_to','severity',_0x1818('0x8d'),_0x1818('0x8e'),_0x1818('0x8f'),_0x1818('0x90'),'due_date',_0x1818('0x91'),_0x1818('0x92'),_0x1818('0x93'),_0x1818('0x94'),_0x1818('0x95'),_0x1818('0x96'),_0x1818('0x97'),_0x1818('0x57')];var _0x47e07c='';var _0x2ca5fb='';var _0x4a5996=[];var _0x484ff1='';var _0x52d2a4='';var _0x560823=[];var _0x5541da='';var _0x441f90='';var _0x398dc7={};var _0x43a065='';return db[_0x1818('0x28')]['findOne']({'where':{'id':_0x1c0c2b[_0x1818('0x40')]['id']},'attributes':['id',_0x1818('0x98'),_0x1818('0x99'),'email','remoteUri',_0x1818('0x9a')]})[_0x1818('0x21')](handleEntityNotFound(_0x42e232,null))[_0x1818('0x21')](function(_0x26543b){if(_0x26543b){_0x43a065=_0x26543b['remoteUri'];var _0x13845e=_0x43a065[_0x1818('0x9b')](-0x1);if(_0x13845e==='/'){_0x43a065=_0x43a065[_0x1818('0x9c')](0x0,_0x43a065[_0x1818('0x9d')](_0x13845e));}_0x441f90=util[_0x1818('0x9e')]('%s/api/now/doc/table/schema/',_0x43a065);_0x5541da=util[_0x1818('0x9e')](_0x1818('0x9f'),_0x43a065);_0x398dc7={'user':_0x26543b[_0x1818('0x98')],'pass':_0x26543b['password']};var _0x51bd2b={'method':_0x1818('0xa0'),'uri':_0x441f90+_0x1818('0xa1'),'auth':_0x398dc7,'json':!![]};return rp(_0x51bd2b);}})[_0x1818('0x21')](function(_0x327e38){if(_0x327e38[_0x1818('0xa2')][_0x1818('0x31')]>0x0){_0x47e07c=_0x327e38[_0x1818('0xa2')];}console[_0x1818('0xa3')](_0x1818('0xa4'),_0x47e07c);_0x560823=[];_0x2ca5fb=Object['assign']([],_0x47e07c);_[_0x1818('0xa5')](_0x2ca5fb,function(_0x1ba7e5){return!_0x2a2dae[_0x1818('0xa6')](_0x1ba7e5['name']);});_0x2ca5fb['forEach'](function(_0x38195a){var _0x516efd=createFieldObject(_0x5541da,_0x398dc7,_0x38195a[_0x1818('0xa7')],_0x38195a[_0x1818('0x25')],_0x38195a[_0x1818('0xa8')],![]);_0x560823[_0x1818('0xa9')](_0x516efd);});return Promise[_0x1818('0xaa')](_0x560823);})['then'](function(_0x3d7cba){_0x4a5996=_0x3d7cba;_0x484ff1=Object[_0x1818('0xab')]([],_0x47e07c);console[_0x1818('0xa3')]('TCL:\x20_object',_0x47e07c);_[_0x1818('0xa5')](_0x484ff1,function(_0x3d4fed){return _0x20355e[_0x1818('0xa6')](_0x3d4fed[_0x1818('0x25')]);});console[_0x1818('0xa3')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x484ff1);_0x560823=[];_0x484ff1[_0x1818('0xac')](function(_0x417138){var _0x3cec93=createFieldObject(_0x5541da,_0x398dc7,_0x417138['internalType'],_0x417138[_0x1818('0x25')],_0x417138[_0x1818('0xa8')],!![]);_0x560823[_0x1818('0xa9')](_0x3cec93);});return Promise[_0x1818('0xaa')](_0x560823);})[_0x1818('0x21')](function(_0xdf62ab){_0x52d2a4=_0xdf62ab;var _0x24b98d=_0x4a5996[_0x1818('0xad')](_0x52d2a4);return{'count':_0x24b98d['length'],'rows':_0x24b98d};})[_0x1818('0x21')](respondWithResult(_0x42e232,null))[_0x1818('0x3f')](function(_0x438cca){console[_0x1818('0xa3')](_0x1818('0xae')+_0x438cca);var _0x908db9=_0x1c0c2b[_0x1818('0x2d')]['test']?0x1f4:_0x438cca['statusCode']||0x1f4;logger[_0x1818('0xaf')](_0x438cca[_0x1818('0x24')]);delete _0x438cca[_0x1818('0x25')];if(_0x908db9===0x191){_0x908db9=0x190;}_0x42e232[_0x1818('0x17')](_0x908db9)['send'](_0x1c0c2b[_0x1818('0x2d')][_0x1818('0xb0')]?{'message':'Wrong\x20credentials','statusCode':_0x438cca[_0x1818('0xb1')]}:_0x438cca);});};function createFieldObject(_0x15df72,_0x25d21a,_0x4edd57,_0x562582,_0x3b0002,_0x61b642){return new Promise(function(_0x4890e2,_0x5a3b30){var _0x2aeb9f={'id':_0x562582,'name':_0x3b0002,'custom':_0x61b642};if(_0x4edd57===_0x1818('0xb2')){_0x2aeb9f[_0x1818('0x3b')]=[{'name':_0x1818('0xb3'),'value':_0x1818('0xb4')},{'name':_0x1818('0xb5'),'value':'false'}];_0x4890e2(_0x2aeb9f);}else{var _0x1267c2={'method':'GET','uri':_0x15df72+_0x1818('0xb6')+_0x562582,'auth':_0x25d21a,'json':!![]};return rp(_0x1267c2)[_0x1818('0x21')](function(_0x3130f1){var _0x2f5cfe=[];if(_0x3130f1['result']['length']>0x0){_0x3130f1['result'][_0x1818('0xac')](function(_0x58f226){if(_0x58f226[_0x1818('0xb7')]===_0x1818('0xb8')){var _0x41d93f={'name':_0x58f226['label'],'value':_0x58f226[_0x1818('0xb9')]};_0x2f5cfe[_0x1818('0xa9')](_0x41d93f);}});}_0x2aeb9f[_0x1818('0x3b')]=_0x2f5cfe;if(_0x2aeb9f[_0x1818('0x3b')]['length']>0x0){_0x4890e2(_0x2aeb9f);}else{if(_0x61b642==![]){_0x4890e2();}else{_0x4890e2(_0x2aeb9f);}}});}});} \ No newline at end of file +var _0x8e5d=['order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','child_incidents','number','resolved_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','priority','sys_domain_path','rfc','expected_start','opened_at','group_list','reopened_time','resolved_at','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','urgency','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','password','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','forEach','label','all','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','test','statusCode','Wrong\x20credentials','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','Content-Range','reject','save','update','then','error','stack','index','ServicenowAccount','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','find','getConfigurations','findOne','ServicenowConfiguration'];(function(_0x84fe32,_0xe5937c){var _0x1df670=function(_0x13f146){while(--_0x13f146){_0x84fe32['push'](_0x84fe32['shift']());}};_0x1df670(++_0xe5937c);}(_0x8e5d,0x119));var _0xd8e5=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0x8e5d[_0x2b0bc2];return _0x56e5b9;};'use strict';var emlformat=require(_0xd8e5('0x0'));var rimraf=require(_0xd8e5('0x1'));var zipdir=require(_0xd8e5('0x2'));var jsonpatch=require(_0xd8e5('0x3'));var rp=require(_0xd8e5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd8e5('0x5'));var util=require(_0xd8e5('0x6'));var path=require(_0xd8e5('0x7'));var sox=require(_0xd8e5('0x8'));var csv=require(_0xd8e5('0x9'));var ejs=require(_0xd8e5('0xa'));var fs=require('fs');var fs_extra=require(_0xd8e5('0xb'));var _=require(_0xd8e5('0xc'));var squel=require(_0xd8e5('0xd'));var crypto=require(_0xd8e5('0xe'));var jsforce=require(_0xd8e5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd8e5('0x9'));var querystring=require(_0xd8e5('0x10'));var Papa=require('papaparse');var Redis=require(_0xd8e5('0x11'));var authService=require(_0xd8e5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd8e5('0x13'));var hardwareService=require(_0xd8e5('0x14'));var logger=require(_0xd8e5('0x15'))(_0xd8e5('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd8e5('0x17'));var db=require(_0xd8e5('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x24bde8,_0x3c6f30){_0x3c6f30=_0x3c6f30||0xcc;return function(_0x1b7773){if(_0x1b7773){return _0x24bde8[_0xd8e5('0x19')](_0x3c6f30);}return _0x24bde8['status'](_0x3c6f30)[_0xd8e5('0x1a')]();};}function respondWithResult(_0x4db899,_0x5736d3){_0x5736d3=_0x5736d3||0xc8;return function(_0x4d78c9){if(_0x4d78c9){return _0x4db899[_0xd8e5('0x1b')](_0x5736d3)[_0xd8e5('0x1c')](_0x4d78c9);}};}function respondWithFilteredResult(_0x3b4987,_0x3c16b0){return function(_0x10ce17){if(_0x10ce17){var _0x33d56c=typeof _0x3c16b0['offset']==='undefined'&&typeof _0x3c16b0['limit']===_0xd8e5('0x1d');var _0x5217cb=_0x10ce17['count'];var _0x4423dd=_0x33d56c?0x0:_0x3c16b0[_0xd8e5('0x1e')];var _0x2dad39=_0x33d56c?_0x10ce17[_0xd8e5('0x1f')]:_0x3c16b0[_0xd8e5('0x1e')]+_0x3c16b0[_0xd8e5('0x20')];var _0x45a006;if(_0x2dad39>=_0x5217cb){_0x2dad39=_0x5217cb;_0x45a006=0xc8;}else{_0x45a006=0xce;}_0x3b4987[_0xd8e5('0x1b')](_0x45a006);return _0x3b4987['set'](_0xd8e5('0x21'),_0x4423dd+'-'+_0x2dad39+'/'+_0x5217cb)['json'](_0x10ce17);}return null;};}function patchUpdates(_0x1529b2){return function(_0x3e256b){try{jsonpatch['apply'](_0x3e256b,_0x1529b2,!![]);}catch(_0x586a20){return BPromise[_0xd8e5('0x22')](_0x586a20);}return _0x3e256b[_0xd8e5('0x23')]();};}function saveUpdates(_0x29ac14,_0xf8baa9){return function(_0x2b5d61){if(_0x2b5d61){return _0x2b5d61[_0xd8e5('0x24')](_0x29ac14)[_0xd8e5('0x25')](function(_0x2b63ab){return _0x2b63ab;});}return null;};}function removeEntity(_0x1f0af2,_0x5c0297){return function(_0x2ef019){if(_0x2ef019){return _0x2ef019['destroy']()[_0xd8e5('0x25')](function(){_0x1f0af2[_0xd8e5('0x1b')](0xcc)[_0xd8e5('0x1a')]();});}};}function handleEntityNotFound(_0x5892cd,_0x2a6035){return function(_0x210775){if(!_0x210775){_0x5892cd[_0xd8e5('0x19')](0x194);}return _0x210775;};}function handleError(_0x48e532,_0x2c6d1a){_0x2c6d1a=_0x2c6d1a||0x1f4;return function(_0x63d75c){logger[_0xd8e5('0x26')](_0x63d75c[_0xd8e5('0x27')]);if(_0x63d75c['name']){delete _0x63d75c['name'];}_0x48e532[_0xd8e5('0x1b')](_0x2c6d1a)['send'](_0x63d75c);};}exports[_0xd8e5('0x28')]=function(_0x3b5127,_0x4c23e9){var _0x3a4a32={},_0xbf2af2={},_0xef0e96={'count':0x0,'rows':[]};var _0x189b96=_['map'](db[_0xd8e5('0x29')][_0xd8e5('0x2a')],function(_0x5072b2){return{'name':_0x5072b2['fieldName'],'type':_0x5072b2[_0xd8e5('0x2b')][_0xd8e5('0x2c')]};});_0xbf2af2[_0xd8e5('0x2d')]=_['map'](_0x189b96,_0xd8e5('0x2e'));_0xbf2af2[_0xd8e5('0x2f')]=_[_0xd8e5('0x30')](_0x3b5127[_0xd8e5('0x2f')]);_0xbf2af2[_0xd8e5('0x31')]=_[_0xd8e5('0x32')](_0xbf2af2[_0xd8e5('0x2d')],_0xbf2af2['query']);_0x3a4a32[_0xd8e5('0x33')]=_[_0xd8e5('0x32')](_0xbf2af2['model'],qs[_0xd8e5('0x34')](_0x3b5127[_0xd8e5('0x2f')][_0xd8e5('0x34')]));_0x3a4a32[_0xd8e5('0x33')]=_0x3a4a32[_0xd8e5('0x33')][_0xd8e5('0x35')]?_0x3a4a32[_0xd8e5('0x33')]:_0xbf2af2[_0xd8e5('0x2d')];if(!_0x3b5127['query'][_0xd8e5('0x36')]('nolimit')){_0x3a4a32[_0xd8e5('0x20')]=qs[_0xd8e5('0x20')](_0x3b5127[_0xd8e5('0x2f')]['limit']);_0x3a4a32['offset']=qs[_0xd8e5('0x1e')](_0x3b5127[_0xd8e5('0x2f')][_0xd8e5('0x1e')]);}_0x3a4a32['order']=qs['sort'](_0x3b5127[_0xd8e5('0x2f')][_0xd8e5('0x37')]);_0x3a4a32[_0xd8e5('0x38')]=qs[_0xd8e5('0x31')](_[_0xd8e5('0x39')](_0x3b5127[_0xd8e5('0x2f')],_0xbf2af2[_0xd8e5('0x31')]),_0x189b96);if(_0x3b5127[_0xd8e5('0x2f')]['filter']){_0x3a4a32[_0xd8e5('0x38')]=_['merge'](_0x3a4a32[_0xd8e5('0x38')],{'$or':_[_0xd8e5('0x3a')](_0x189b96,function(_0x329aab){if(_0x329aab[_0xd8e5('0x2b')]!==_0xd8e5('0x3b')){var _0x4869df={};_0x4869df[_0x329aab['name']]={'$like':'%'+_0x3b5127['query'][_0xd8e5('0x3c')]+'%'};return _0x4869df;}})});}_0x3a4a32=_[_0xd8e5('0x3d')]({},_0x3a4a32,_0x3b5127[_0xd8e5('0x3e')]);var _0x111fb1={'where':_0x3a4a32[_0xd8e5('0x38')]};return db[_0xd8e5('0x29')]['count'](_0x111fb1)[_0xd8e5('0x25')](function(_0x37d00c){_0xef0e96[_0xd8e5('0x1f')]=_0x37d00c;if(_0x3b5127[_0xd8e5('0x2f')][_0xd8e5('0x3f')]){_0x3a4a32[_0xd8e5('0x40')]=[{'all':!![]}];}return db[_0xd8e5('0x29')][_0xd8e5('0x41')](_0x3a4a32);})[_0xd8e5('0x25')](function(_0x2682b1){_0xef0e96['rows']=_0x2682b1;return _0xef0e96;})['then'](respondWithFilteredResult(_0x4c23e9,_0x3a4a32))[_0xd8e5('0x42')](handleError(_0x4c23e9,null));};exports[_0xd8e5('0x43')]=function(_0x495e9c,_0x2642c9){var _0x4ab1e3={'raw':![],'where':{'id':_0x495e9c[_0xd8e5('0x44')]['id']}},_0x11908c={};_0x11908c[_0xd8e5('0x2d')]=_[_0xd8e5('0x30')](db[_0xd8e5('0x29')][_0xd8e5('0x2a')]);_0x11908c['query']=_[_0xd8e5('0x30')](_0x495e9c[_0xd8e5('0x2f')]);_0x11908c['filters']=_[_0xd8e5('0x32')](_0x11908c[_0xd8e5('0x2d')],_0x11908c[_0xd8e5('0x2f')]);_0x4ab1e3[_0xd8e5('0x33')]=_['intersection'](_0x11908c['model'],qs[_0xd8e5('0x34')](_0x495e9c[_0xd8e5('0x2f')][_0xd8e5('0x34')]));_0x4ab1e3[_0xd8e5('0x33')]=_0x4ab1e3[_0xd8e5('0x33')][_0xd8e5('0x35')]?_0x4ab1e3[_0xd8e5('0x33')]:_0x11908c[_0xd8e5('0x2d')];if(_0x495e9c['query'][_0xd8e5('0x3f')]){_0x4ab1e3['include']=[{'all':!![]}];}_0x4ab1e3=_[_0xd8e5('0x3d')]({},_0x4ab1e3,_0x495e9c[_0xd8e5('0x3e')]);return db['ServicenowAccount']['find'](_0x4ab1e3)[_0xd8e5('0x25')](handleEntityNotFound(_0x2642c9,null))['then'](respondWithResult(_0x2642c9,null))[_0xd8e5('0x42')](handleError(_0x2642c9,null));};exports[_0xd8e5('0x45')]=function(_0x1c4ba2,_0x22e427){return db[_0xd8e5('0x29')]['create'](_0x1c4ba2[_0xd8e5('0x46')],{})[_0xd8e5('0x25')](respondWithResult(_0x22e427,0xc9))['catch'](handleError(_0x22e427,null));};exports[_0xd8e5('0x24')]=function(_0x5a5ff1,_0x6abf43){if(_0x5a5ff1[_0xd8e5('0x46')]['id']){delete _0x5a5ff1[_0xd8e5('0x46')]['id'];}return db[_0xd8e5('0x29')][_0xd8e5('0x47')]({'where':{'id':_0x5a5ff1[_0xd8e5('0x44')]['id']}})[_0xd8e5('0x25')](handleEntityNotFound(_0x6abf43,null))[_0xd8e5('0x25')](saveUpdates(_0x5a5ff1['body'],null))[_0xd8e5('0x25')](respondWithResult(_0x6abf43,null))[_0xd8e5('0x42')](handleError(_0x6abf43,null));};exports['destroy']=function(_0x49835e,_0x5cd7ab){return db[_0xd8e5('0x29')][_0xd8e5('0x47')]({'where':{'id':_0x49835e[_0xd8e5('0x44')]['id']}})[_0xd8e5('0x25')](handleEntityNotFound(_0x5cd7ab,null))[_0xd8e5('0x25')](removeEntity(_0x5cd7ab,null))['catch'](handleError(_0x5cd7ab,null));};exports[_0xd8e5('0x48')]=function(_0x502c87,_0x51617d,_0x40c3df){var _0x25d972={};var _0x2f9126={};var _0x99c4cb;var _0x38b647;return db[_0xd8e5('0x29')][_0xd8e5('0x49')]({'where':{'id':_0x502c87['params']['id']}})['then'](handleEntityNotFound(_0x51617d,null))[_0xd8e5('0x25')](function(_0x5d1268){if(_0x5d1268){_0x99c4cb=_0x5d1268;_0x2f9126[_0xd8e5('0x2d')]=_[_0xd8e5('0x30')](db[_0xd8e5('0x4a')][_0xd8e5('0x2a')]);_0x2f9126['query']=_[_0xd8e5('0x30')](_0x502c87[_0xd8e5('0x2f')]);_0x2f9126['filters']=_[_0xd8e5('0x32')](_0x2f9126['model'],_0x2f9126[_0xd8e5('0x2f')]);_0x25d972[_0xd8e5('0x33')]=_[_0xd8e5('0x32')](_0x2f9126[_0xd8e5('0x2d')],qs['fields'](_0x502c87['query'][_0xd8e5('0x34')]));_0x25d972[_0xd8e5('0x33')]=_0x25d972[_0xd8e5('0x33')]['length']?_0x25d972[_0xd8e5('0x33')]:_0x2f9126['model'];_0x25d972[_0xd8e5('0x4b')]=qs[_0xd8e5('0x37')](_0x502c87[_0xd8e5('0x2f')][_0xd8e5('0x37')]);_0x25d972[_0xd8e5('0x38')]=qs[_0xd8e5('0x31')](_[_0xd8e5('0x39')](_0x502c87[_0xd8e5('0x2f')],_0x2f9126[_0xd8e5('0x31')]));if(_0x502c87[_0xd8e5('0x2f')][_0xd8e5('0x3c')]){_0x25d972['where']=_[_0xd8e5('0x3d')](_0x25d972['where'],{'$or':_[_0xd8e5('0x3a')](_0x25d972[_0xd8e5('0x33')],function(_0x2215cd){var _0x3c3941={};_0x3c3941[_0x2215cd]={'$like':'%'+_0x502c87[_0xd8e5('0x2f')][_0xd8e5('0x3c')]+'%'};return _0x3c3941;})});}_0x25d972=_[_0xd8e5('0x3d')]({},_0x25d972,_0x502c87[_0xd8e5('0x3e')]);return _0x99c4cb[_0xd8e5('0x48')](_0x25d972);}})['then'](function(_0x134d63){if(_0x134d63){_0x38b647=_0x134d63[_0xd8e5('0x35')];if(!_0x502c87[_0xd8e5('0x2f')][_0xd8e5('0x36')](_0xd8e5('0x4c'))){_0x25d972[_0xd8e5('0x20')]=qs['limit'](_0x502c87[_0xd8e5('0x2f')][_0xd8e5('0x20')]);_0x25d972[_0xd8e5('0x1e')]=qs[_0xd8e5('0x1e')](_0x502c87[_0xd8e5('0x2f')]['offset']);}return _0x99c4cb[_0xd8e5('0x48')](_0x25d972);}})[_0xd8e5('0x25')](function(_0x5472a8){if(_0x5472a8){return _0x5472a8?{'count':_0x38b647,'rows':_0x5472a8}:null;}})[_0xd8e5('0x25')](respondWithResult(_0x51617d,null))[_0xd8e5('0x42')](handleError(_0x51617d,null));};exports[_0xd8e5('0x4d')]=function(_0x322187,_0xdd1332,_0x58bf11){if(_0x322187[_0xd8e5('0x46')]['id']){delete _0x322187[_0xd8e5('0x46')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x322187[_0xd8e5('0x44')]['id']}})[_0xd8e5('0x25')](handleEntityNotFound(_0xdd1332,null))['then'](function(_0x54f926){if(_0x54f926){_0x322187[_0xd8e5('0x46')][_0xd8e5('0x4e')]=_0x54f926['id'];_0x322187[_0xd8e5('0x46')][_0xd8e5('0x4f')]=integrations[_0xd8e5('0x50')](_0x322187['body']['channel'],_0x322187[_0xd8e5('0x46')][_0xd8e5('0x2b')]);_0x322187[_0xd8e5('0x46')][_0xd8e5('0x51')]=integrations[_0xd8e5('0x52')](_0x322187[_0xd8e5('0x46')][_0xd8e5('0x53')],_0x322187['body']['type']);return db[_0xd8e5('0x4a')][_0xd8e5('0x45')](_0x322187[_0xd8e5('0x46')],{'include':[{'model':db[_0xd8e5('0x54')],'as':_0xd8e5('0x4f')},{'model':db[_0xd8e5('0x54')],'as':_0xd8e5('0x51')}]});}return null;})[_0xd8e5('0x25')](respondWithResult(_0xdd1332,null))['catch'](handleError(_0xdd1332,null));};exports[_0xd8e5('0x55')]=function(_0x35b718,_0x1275f3,_0x2c29ff){var _0x491cca=[_0xd8e5('0x56'),_0xd8e5('0x57'),_0xd8e5('0x58'),_0xd8e5('0x59'),_0xd8e5('0x5a'),_0xd8e5('0x5b'),_0xd8e5('0x5c'),'severity',_0xd8e5('0x5d')];var _0x160148=[_0xd8e5('0x5e'),_0xd8e5('0x56'),_0xd8e5('0x5f'),_0xd8e5('0x60'),_0xd8e5('0x61'),'sys_updated_on',_0xd8e5('0x62'),_0xd8e5('0x57'),'approval_history',_0xd8e5('0x63'),_0xd8e5('0x64'),'sys_updated_by',_0xd8e5('0x65'),'user_input',_0xd8e5('0x66'),_0xd8e5('0x67'),_0xd8e5('0x68'),_0xd8e5('0x69'),_0xd8e5('0x58'),_0xd8e5('0x4b'),_0xd8e5('0x6a'),_0xd8e5('0x6b'),_0xd8e5('0x6c'),'delivery_plan',_0xd8e5('0x6d'),_0xd8e5('0x6e'),'work_notes_list','business_service',_0xd8e5('0x6f'),_0xd8e5('0x70'),_0xd8e5('0x71'),'time_worked',_0xd8e5('0x72'),_0xd8e5('0x73'),'business_duration',_0xd8e5('0x74'),'work_end',_0xd8e5('0x75'),_0xd8e5('0x76'),'caller_id','approval_set',_0xd8e5('0x59'),_0xd8e5('0x77'),_0xd8e5('0x78'),'close_code',_0xd8e5('0x79'),_0xd8e5('0x7a'),_0xd8e5('0x7b'),'assignment_group',_0xd8e5('0x7c'),_0xd8e5('0x7d'),_0xd8e5('0x7e'),'calendar_duration',_0xd8e5('0x5b'),_0xd8e5('0x7f'),_0xd8e5('0x80'),_0xd8e5('0x81'),_0xd8e5('0x82'),_0xd8e5('0x83'),_0xd8e5('0x84'),'contact_type','reopened_by','incident_state',_0xd8e5('0x85'),'problem_id',_0xd8e5('0x86'),_0xd8e5('0x87'),_0xd8e5('0x88'),'assigned_to','severity',_0xd8e5('0x89'),_0xd8e5('0x8a'),_0xd8e5('0x8b'),_0xd8e5('0x8c'),_0xd8e5('0x8d'),_0xd8e5('0x8e'),_0xd8e5('0x8f'),_0xd8e5('0x90'),'escalation',_0xd8e5('0x91'),_0xd8e5('0x92'),_0xd8e5('0x93'),'category'];var _0x209e11='';var _0x47977e='';var _0x3e635d=[];var _0x20fe5a='';var _0x43ecf5='';var _0x4df08f=[];var _0x20438b='';var _0x520032='';var _0x114f19={};var _0x24b1e7='';return db[_0xd8e5('0x29')][_0xd8e5('0x49')]({'where':{'id':_0x35b718[_0xd8e5('0x44')]['id']},'attributes':['id','username',_0xd8e5('0x94'),'email','remoteUri','serverUrl']})[_0xd8e5('0x25')](handleEntityNotFound(_0x1275f3,null))[_0xd8e5('0x25')](function(_0x497f35){if(_0x497f35){_0x24b1e7=_0x497f35['remoteUri'];var _0x4cfc20=_0x24b1e7[_0xd8e5('0x95')](-0x1);if(_0x4cfc20==='/'){_0x24b1e7=_0x24b1e7['substring'](0x0,_0x24b1e7[_0xd8e5('0x96')](_0x4cfc20));}_0x520032=util['format'](_0xd8e5('0x97'),_0x24b1e7);_0x20438b=util[_0xd8e5('0x98')](_0xd8e5('0x99'),_0x24b1e7);_0x114f19={'user':_0x497f35[_0xd8e5('0x9a')],'pass':_0x497f35['password']};var _0x6fce1b={'method':_0xd8e5('0x9b'),'uri':_0x520032+_0xd8e5('0x9c'),'auth':_0x114f19,'json':!![]};return rp(_0x6fce1b);}})[_0xd8e5('0x25')](function(_0x14f4ec){if(_0x14f4ec[_0xd8e5('0x9d')][_0xd8e5('0x35')]>0x0){_0x209e11=_0x14f4ec[_0xd8e5('0x9d')];}console[_0xd8e5('0x9e')](_0xd8e5('0x9f'),_0x209e11);_0x4df08f=[];_0x47977e=Object[_0xd8e5('0xa0')]([],_0x209e11);_['remove'](_0x47977e,function(_0xdf730a){return!_0x491cca['includes'](_0xdf730a[_0xd8e5('0x2e')]);});_0x47977e[_0xd8e5('0xa1')](function(_0x52a459){var _0x1022aa=createFieldObject(_0x20438b,_0x114f19,_0x52a459['internalType'],_0x52a459[_0xd8e5('0x2e')],_0x52a459[_0xd8e5('0xa2')],![]);_0x4df08f['push'](_0x1022aa);});return Promise[_0xd8e5('0xa3')](_0x4df08f);})[_0xd8e5('0x25')](function(_0x4bc9bd){_0x3e635d=_0x4bc9bd;_0x20fe5a=Object[_0xd8e5('0xa0')]([],_0x209e11);console['log']('TCL:\x20_object',_0x209e11);_['remove'](_0x20fe5a,function(_0x1d4ef5){return _0x160148[_0xd8e5('0xa4')](_0x1d4ef5[_0xd8e5('0x2e')]);});console['log'](_0xd8e5('0xa5'),_0x20fe5a);_0x4df08f=[];_0x20fe5a['forEach'](function(_0x398462){var _0x3d9037=createFieldObject(_0x20438b,_0x114f19,_0x398462[_0xd8e5('0xa6')],_0x398462['name'],_0x398462[_0xd8e5('0xa2')],!![]);_0x4df08f['push'](_0x3d9037);});return Promise[_0xd8e5('0xa3')](_0x4df08f);})['then'](function(_0x28c7fb){_0x43ecf5=_0x28c7fb;var _0x4bfc8f=_0x3e635d[_0xd8e5('0xa7')](_0x43ecf5);return{'count':_0x4bfc8f[_0xd8e5('0x35')],'rows':_0x4bfc8f};})[_0xd8e5('0x25')](respondWithResult(_0x1275f3,null))['catch'](function(_0x2816c5){console[_0xd8e5('0x9e')]('ServiceNow\x20error:\x20'+_0x2816c5);var _0x573a02=_0x35b718[_0xd8e5('0x2f')][_0xd8e5('0xa8')]?0x1f4:_0x2816c5[_0xd8e5('0xa9')]||0x1f4;logger[_0xd8e5('0x26')](_0x2816c5[_0xd8e5('0x27')]);delete _0x2816c5[_0xd8e5('0x2e')];if(_0x573a02===0x191){_0x573a02=0x190;}_0x1275f3[_0xd8e5('0x1b')](_0x573a02)['send'](_0x35b718[_0xd8e5('0x2f')]['test']?{'message':_0xd8e5('0xaa'),'statusCode':_0x2816c5[_0xd8e5('0xa9')]}:_0x2816c5);});};function createFieldObject(_0x42287b,_0x3adfb9,_0x2b4976,_0x349cb9,_0x5e8c3c,_0x22eb2c){return new Promise(function(_0x4bbdde,_0x2a97df){var _0x2954a7={'id':_0x349cb9,'name':_0x5e8c3c,'custom':_0x22eb2c};if(_0x2b4976==='boolean'){_0x2954a7[_0xd8e5('0x3e')]=[{'name':_0xd8e5('0xab'),'value':_0xd8e5('0xac')},{'name':'False','value':_0xd8e5('0xad')}];_0x4bbdde(_0x2954a7);}else{var _0x430612={'method':'GET','uri':_0x42287b+_0xd8e5('0xae')+_0x349cb9,'auth':_0x3adfb9,'json':!![]};return rp(_0x430612)[_0xd8e5('0x25')](function(_0x33a538){var _0x352430=[];if(_0x33a538[_0xd8e5('0x9d')]['length']>0x0){_0x33a538[_0xd8e5('0x9d')]['forEach'](function(_0xe050c5){if(_0xe050c5[_0xd8e5('0xaf')]==='false'){var _0x146636={'name':_0xe050c5[_0xd8e5('0xa2')],'value':_0xe050c5[_0xd8e5('0xb0')]};_0x352430[_0xd8e5('0xb1')](_0x146636);}});}_0x2954a7['options']=_0x352430;if(_0x2954a7[_0xd8e5('0x3e')][_0xd8e5('0x35')]>0x0){_0x4bbdde(_0x2954a7);}else{if(_0x22eb2c==![]){_0x4bbdde();}else{_0x4bbdde(_0x2954a7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index e9d16d6..6f7e420 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 _0xe14b=['bluebird','path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','moment'];(function(_0x12b56e,_0x327ef9){var _0xab2d43=function(_0x28dec2){while(--_0x28dec2){_0x12b56e['push'](_0x12b56e['shift']());}};_0xab2d43(++_0x327ef9);}(_0xe14b,0x93));var _0xbe14=function(_0x111266,_0x5cfa7c){_0x111266=_0x111266-0x0;var _0x23c5eb=_0xe14b[_0x111266];return _0x23c5eb;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));var integrations=require(_0xbe14('0x6'));module[_0xbe14('0x7')]=function(_0x1ff100,_0x1d9ade){return _0x1ff100[_0xbe14('0x8')](_0xbe14('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x326f,0xd1));var _0xf326=function(_0x3cced9,_0x761591){_0x3cced9=_0x3cced9-0x0;var _0x5700e1=_0x326f[_0x3cced9];return _0x5700e1;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));var integrations=require(_0xf326('0x9'));module[_0xf326('0xa')]=function(_0x4c2249,_0x3c254d){return _0x4c2249[_0xf326('0xb')](_0xf326('0xc'),attributes,{'tableName':_0xf326('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 03b1556..cc3efe7 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 _0x9956=['include','model','map','ShowServicenowAccount','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9956,0x115));var _0x6995=function(_0x48d166,_0x1203e8){_0x48d166=_0x48d166-0x0;var _0x56dfb5=_0x9956[_0x48d166];return _0x56dfb5;};'use strict';var _=require(_0x6995('0x0'));var util=require(_0x6995('0x1'));var moment=require(_0x6995('0x2'));var BPromise=require('bluebird');var rs=require(_0x6995('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6995('0x4'))['db'];var utils=require(_0x6995('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6995('0x6'));var jayson=require(_0x6995('0x7'));var client=jayson[_0x6995('0x8')][_0x6995('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x549910,_0x2e0a40,_0x4e4cf3){return new BPromise(function(_0x26d702,_0x5d819d){return client[_0x6995('0xa')](_0x549910,_0x4e4cf3)[_0x6995('0xb')](function(_0x10db3b){logger[_0x6995('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x2e0a40,_0x6995('0xd'));logger['debug'](_0x6995('0xe'),_0x2e0a40,'request\x20sent',JSON[_0x6995('0xf')](_0x10db3b));if(_0x10db3b[_0x6995('0x10')]){if(_0x10db3b[_0x6995('0x10')][_0x6995('0x11')]===0x1f4){logger[_0x6995('0x10')](_0x6995('0x12'),_0x2e0a40,_0x10db3b[_0x6995('0x10')][_0x6995('0x13')]);return _0x5d819d(_0x10db3b[_0x6995('0x10')][_0x6995('0x13')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2e0a40,_0x10db3b[_0x6995('0x10')][_0x6995('0x13')]);return _0x26d702(_0x10db3b[_0x6995('0x10')][_0x6995('0x13')]);}else{logger[_0x6995('0xc')](_0x6995('0x12'),_0x2e0a40,'request\x20sent');_0x26d702(_0x10db3b[_0x6995('0x14')][_0x6995('0x13')]);}})[_0x6995('0x15')](function(_0x2d4a83){logger[_0x6995('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x2e0a40,_0x2d4a83);_0x5d819d(_0x2d4a83);});});}exports[_0x6995('0x16')]=function(_0x20cdab){var _0xc56aaa=this;return new Promise(function(_0x3c3cfd,_0x57d208){return db[_0x6995('0x17')]['findAll']({'raw':_0x20cdab[_0x6995('0x18')]?_0x20cdab[_0x6995('0x18')][_0x6995('0x19')]===undefined?!![]:![]:!![],'where':_0x20cdab['options']?_0x20cdab[_0x6995('0x18')][_0x6995('0x1a')]||null:null,'attributes':_0x20cdab[_0x6995('0x18')]?_0x20cdab[_0x6995('0x18')][_0x6995('0x1b')]||null:null,'limit':_0x20cdab['options']?_0x20cdab['options'][_0x6995('0x1c')]||null:null,'include':_0x20cdab[_0x6995('0x18')]?_0x20cdab['options'][_0x6995('0x1d')]?_['map'](_0x20cdab[_0x6995('0x18')]['include'],function(_0x45c4e0){return{'model':db[_0x45c4e0[_0x6995('0x1e')]],'as':_0x45c4e0['as'],'attributes':_0x45c4e0['attributes'],'include':_0x45c4e0[_0x6995('0x1d')]?_[_0x6995('0x1f')](_0x45c4e0[_0x6995('0x1d')],function(_0x57f125){return{'model':db[_0x57f125[_0x6995('0x1e')]],'as':_0x57f125['as'],'attributes':_0x57f125['attributes'],'include':_0x57f125['include']?_[_0x6995('0x1f')](_0x57f125[_0x6995('0x1d')],function(_0x1f41b0){return{'model':db[_0x1f41b0['model']],'as':_0x1f41b0['as'],'attributes':_0x1f41b0['attributes']};}):[]};}):[]};}):[]:[]})[_0x6995('0xb')](function(_0x4d646d){logger['info'](_0x6995('0x16'),_0x20cdab);logger['debug'](_0x6995('0x16'),_0x20cdab,JSON[_0x6995('0xf')](_0x4d646d));_0x3c3cfd(_0x4d646d);})['catch'](function(_0x4dbeec){logger[_0x6995('0x10')]('GetServicenowAccount',_0x4dbeec['message'],_0x20cdab);_0x57d208(_0xc56aaa[_0x6995('0x10')](0x1f4,_0x4dbeec[_0x6995('0x13')]));});});};exports[_0x6995('0x20')]=function(_0x545714){var _0x4fd489=this;return new Promise(function(_0x3966af,_0x235b3c){return db[_0x6995('0x17')]['find']({'raw':_0x545714[_0x6995('0x18')]?_0x545714['options'][_0x6995('0x19')]===undefined?!![]:![]:!![],'where':_0x545714[_0x6995('0x18')]?_0x545714[_0x6995('0x18')][_0x6995('0x1a')]||null:null,'attributes':_0x545714[_0x6995('0x18')]?_0x545714[_0x6995('0x18')]['attributes']||null:null,'include':_0x545714[_0x6995('0x18')]?_0x545714['options']['include']?_[_0x6995('0x1f')](_0x545714[_0x6995('0x18')][_0x6995('0x1d')],function(_0x1b36fd){return{'model':db[_0x1b36fd['model']],'as':_0x1b36fd['as'],'attributes':_0x1b36fd['attributes'],'include':_0x1b36fd[_0x6995('0x1d')]?_[_0x6995('0x1f')](_0x1b36fd[_0x6995('0x1d')],function(_0x324323){return{'model':db[_0x324323[_0x6995('0x1e')]],'as':_0x324323['as'],'attributes':_0x324323[_0x6995('0x1b')],'include':_0x324323[_0x6995('0x1d')]?_[_0x6995('0x1f')](_0x324323[_0x6995('0x1d')],function(_0x4cb48a){return{'model':db[_0x4cb48a['model']],'as':_0x4cb48a['as'],'attributes':_0x4cb48a[_0x6995('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x410438){logger['info'](_0x6995('0x20'),_0x545714);logger[_0x6995('0x21')](_0x6995('0x20'),_0x545714,JSON[_0x6995('0xf')](_0x410438));_0x3966af(_0x410438);})[_0x6995('0x15')](function(_0x20c781){logger['error'](_0x6995('0x20'),_0x20c781[_0x6995('0x13')],_0x545714);_0x235b3c(_0x4fd489[_0x6995('0x10')](0x1f4,_0x20c781['message']));});});}; \ No newline at end of file +var _0x2a25=['ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','ShowServicenowAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x2a25,0x89));var _0x52a2=function(_0x37d38a,_0x88dfe7){_0x37d38a=_0x37d38a-0x0;var _0x15e5b4=_0x2a25[_0x37d38a];return _0x15e5b4;};'use strict';var _=require(_0x52a2('0x0'));var util=require(_0x52a2('0x1'));var moment=require(_0x52a2('0x2'));var BPromise=require(_0x52a2('0x3'));var rs=require(_0x52a2('0x4'));var fs=require('fs');var Redis=require(_0x52a2('0x5'));var db=require(_0x52a2('0x6'))['db'];var utils=require(_0x52a2('0x7'));var logger=require('../../config/logger')(_0x52a2('0x8'));var config=require(_0x52a2('0x9'));var jayson=require(_0x52a2('0xa'));var client=jayson[_0x52a2('0xb')][_0x52a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58d607,_0x20369b,_0x10e1fe){return new BPromise(function(_0x500149,_0x41c75b){return client[_0x52a2('0xd')](_0x58d607,_0x10e1fe)['then'](function(_0x261460){logger[_0x52a2('0xe')](_0x52a2('0xf'),_0x20369b,'request\x20sent');logger[_0x52a2('0x10')](_0x52a2('0x11'),_0x20369b,_0x52a2('0x12'),JSON[_0x52a2('0x13')](_0x261460));if(_0x261460[_0x52a2('0x14')]){if(_0x261460[_0x52a2('0x14')][_0x52a2('0x15')]===0x1f4){logger[_0x52a2('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x20369b,_0x261460[_0x52a2('0x14')][_0x52a2('0x16')]);return _0x41c75b(_0x261460[_0x52a2('0x14')][_0x52a2('0x16')]);}logger['error'](_0x52a2('0xf'),_0x20369b,_0x261460[_0x52a2('0x14')]['message']);return _0x500149(_0x261460[_0x52a2('0x14')][_0x52a2('0x16')]);}else{logger[_0x52a2('0xe')](_0x52a2('0xf'),_0x20369b,_0x52a2('0x12'));_0x500149(_0x261460[_0x52a2('0x17')][_0x52a2('0x16')]);}})[_0x52a2('0x18')](function(_0x19110c){logger['error'](_0x52a2('0xf'),_0x20369b,_0x19110c);_0x41c75b(_0x19110c);});});}exports[_0x52a2('0x19')]=function(_0xad0737){var _0x433ad8=this;return new Promise(function(_0x3e91c8,_0x1923dc){return db[_0x52a2('0x1a')][_0x52a2('0x1b')]({'raw':_0xad0737['options']?_0xad0737[_0x52a2('0x1c')][_0x52a2('0x1d')]===undefined?!![]:![]:!![],'where':_0xad0737['options']?_0xad0737[_0x52a2('0x1c')][_0x52a2('0x1e')]||null:null,'attributes':_0xad0737[_0x52a2('0x1c')]?_0xad0737[_0x52a2('0x1c')][_0x52a2('0x1f')]||null:null,'limit':_0xad0737[_0x52a2('0x1c')]?_0xad0737[_0x52a2('0x1c')]['limit']||null:null,'include':_0xad0737[_0x52a2('0x1c')]?_0xad0737[_0x52a2('0x1c')][_0x52a2('0x20')]?_[_0x52a2('0x21')](_0xad0737[_0x52a2('0x1c')][_0x52a2('0x20')],function(_0x1e215b){return{'model':db[_0x1e215b[_0x52a2('0x22')]],'as':_0x1e215b['as'],'attributes':_0x1e215b['attributes'],'include':_0x1e215b[_0x52a2('0x20')]?_[_0x52a2('0x21')](_0x1e215b[_0x52a2('0x20')],function(_0x24cb72){return{'model':db[_0x24cb72[_0x52a2('0x22')]],'as':_0x24cb72['as'],'attributes':_0x24cb72[_0x52a2('0x1f')],'include':_0x24cb72[_0x52a2('0x20')]?_[_0x52a2('0x21')](_0x24cb72[_0x52a2('0x20')],function(_0x572a07){return{'model':db[_0x572a07[_0x52a2('0x22')]],'as':_0x572a07['as'],'attributes':_0x572a07['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x514dc0){logger['info'](_0x52a2('0x19'),_0xad0737);logger['debug'](_0x52a2('0x19'),_0xad0737,JSON[_0x52a2('0x13')](_0x514dc0));_0x3e91c8(_0x514dc0);})['catch'](function(_0x152ebe){logger[_0x52a2('0x14')](_0x52a2('0x19'),_0x152ebe[_0x52a2('0x16')],_0xad0737);_0x1923dc(_0x433ad8[_0x52a2('0x14')](0x1f4,_0x152ebe[_0x52a2('0x16')]));});});};exports[_0x52a2('0x23')]=function(_0x2c0fbc){var _0x456603=this;return new Promise(function(_0x73a3d6,_0xc9cb8d){return db['ServicenowAccount'][_0x52a2('0x24')]({'raw':_0x2c0fbc[_0x52a2('0x1c')]?_0x2c0fbc[_0x52a2('0x1c')][_0x52a2('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c0fbc['options']?_0x2c0fbc[_0x52a2('0x1c')]['where']||null:null,'attributes':_0x2c0fbc[_0x52a2('0x1c')]?_0x2c0fbc[_0x52a2('0x1c')]['attributes']||null:null,'include':_0x2c0fbc['options']?_0x2c0fbc[_0x52a2('0x1c')][_0x52a2('0x20')]?_[_0x52a2('0x21')](_0x2c0fbc[_0x52a2('0x1c')][_0x52a2('0x20')],function(_0x54f926){return{'model':db[_0x54f926[_0x52a2('0x22')]],'as':_0x54f926['as'],'attributes':_0x54f926[_0x52a2('0x1f')],'include':_0x54f926[_0x52a2('0x20')]?_[_0x52a2('0x21')](_0x54f926[_0x52a2('0x20')],function(_0xe99a97){return{'model':db[_0xe99a97[_0x52a2('0x22')]],'as':_0xe99a97['as'],'attributes':_0xe99a97[_0x52a2('0x1f')],'include':_0xe99a97[_0x52a2('0x20')]?_[_0x52a2('0x21')](_0xe99a97[_0x52a2('0x20')],function(_0x2f35b8){return{'model':db[_0x2f35b8[_0x52a2('0x22')]],'as':_0x2f35b8['as'],'attributes':_0x2f35b8[_0x52a2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x52a2('0x25')](function(_0x440d18){logger['info'](_0x52a2('0x23'),_0x2c0fbc);logger['debug'](_0x52a2('0x23'),_0x2c0fbc,JSON[_0x52a2('0x13')](_0x440d18));_0x73a3d6(_0x440d18);})[_0x52a2('0x18')](function(_0x4bb03a){logger['error'](_0x52a2('0x23'),_0x4bb03a[_0x52a2('0x16')],_0x2c0fbc);_0xc9cb8d(_0x456603['error'](0x1f4,_0x4bb03a[_0x52a2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 552f76f..1ed1a42 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 _0x5cda=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','util'];(function(_0x309ef8,_0x21bf2a){var _0x2ad36b=function(_0x52aaad){while(--_0x52aaad){_0x309ef8['push'](_0x309ef8['shift']());}};_0x2ad36b(++_0x21bf2a);}(_0x5cda,0xbe));var _0xa5cd=function(_0x27a99c,_0x1639e2){_0x27a99c=_0x27a99c-0x0;var _0x359c7f=_0x5cda[_0x27a99c];return _0x359c7f;};'use strict';var multer=require(_0xa5cd('0x0'));var util=require(_0xa5cd('0x1'));var path=require(_0xa5cd('0x2'));var timeout=require('connect-timeout');var express=require(_0xa5cd('0x3'));var router=express[_0xa5cd('0x4')]();var fs_extra=require(_0xa5cd('0x5'));var auth=require(_0xa5cd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa5cd('0x7'));var controller=require(_0xa5cd('0x8'));router['get']('/',auth[_0xa5cd('0x9')](),controller[_0xa5cd('0xa')]);router['get'](_0xa5cd('0xb'),auth[_0xa5cd('0x9')](),controller[_0xa5cd('0xc')]);router[_0xa5cd('0xd')](_0xa5cd('0xe'),auth[_0xa5cd('0x9')](),controller['getFields']);router[_0xa5cd('0xd')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xa5cd('0xf')]);router[_0xa5cd('0xd')](_0xa5cd('0x10'),auth[_0xa5cd('0x9')](),controller[_0xa5cd('0x11')]);router[_0xa5cd('0x12')]('/',auth[_0xa5cd('0x9')](),controller[_0xa5cd('0x13')]);router[_0xa5cd('0x14')](_0xa5cd('0xb'),auth[_0xa5cd('0x9')](),controller[_0xa5cd('0x15')]);router[_0xa5cd('0x16')](_0xa5cd('0xb'),auth[_0xa5cd('0x9')](),controller[_0xa5cd('0x17')]);module['exports']=router; \ No newline at end of file +var _0xc9a5=['show','/:id/fields','isAuthenticated','getFields','/:id/subjects','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xc9a5,0x1da));var _0x5c9a=function(_0x3a592f,_0x1a9441){_0x3a592f=_0x3a592f-0x0;var _0x28d6f8=_0xc9a5[_0x3a592f];return _0x28d6f8;};'use strict';var multer=require(_0x5c9a('0x0'));var util=require(_0x5c9a('0x1'));var path=require(_0x5c9a('0x2'));var timeout=require(_0x5c9a('0x3'));var express=require('express');var router=express[_0x5c9a('0x4')]();var fs_extra=require(_0x5c9a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5c9a('0x6'));var controller=require(_0x5c9a('0x7'));router[_0x5c9a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5c9a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5c9a('0x9')]);router[_0x5c9a('0x8')](_0x5c9a('0xa'),auth[_0x5c9a('0xb')](),controller[_0x5c9a('0xc')]);router[_0x5c9a('0x8')](_0x5c9a('0xd'),auth[_0x5c9a('0xb')](),controller['getSubjects']);router[_0x5c9a('0x8')]('/:id/descriptions',auth[_0x5c9a('0xb')](),controller['getDescriptions']);router[_0x5c9a('0xe')]('/',auth[_0x5c9a('0xb')](),controller[_0x5c9a('0xf')]);router[_0x5c9a('0x10')](_0x5c9a('0x11'),auth[_0x5c9a('0xb')](),controller[_0x5c9a('0x12')]);router['delete'](_0x5c9a('0x11'),auth[_0x5c9a('0xb')](),controller[_0x5c9a('0x13')]);module[_0x5c9a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a3614d6..12c446c 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 _0x9251=['STRING','exports'];(function(_0x2d639b,_0x11116d){var _0x39a0b0=function(_0x47f46e){while(--_0x47f46e){_0x2d639b['push'](_0x2d639b['shift']());}};_0x39a0b0(++_0x11116d);}(_0x9251,0x79));var _0x1925=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0x9251[_0x3b87f4];return _0x63d16e;};'use strict';var Sequelize=require('sequelize');module[_0x1925('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1925('0x1')]}}; \ No newline at end of file +var _0xbd35=['sequelize','STRING'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xbd35,0x19a));var _0x5bd3=function(_0x48ce59,_0x2b0620){_0x48ce59=_0x48ce59-0x0;var _0x32d4a1=_0xbd35[_0x48ce59];return _0x32d4a1;};'use strict';var Sequelize=require(_0x5bd3('0x0'));module['exports']={'name':{'type':Sequelize[_0x5bd3('0x1')]},'description':{'type':Sequelize[_0x5bd3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 1993f5a..8938a95 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 _0xd888=['find','create','body','getFields','ServicenowField','order','findOne','filter','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','map','rawAttributes','fieldName','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','type','name','merge','includeAll','ServicenowConfiguration','findAll','rows','catch','show','params','include','options'];(function(_0x4e18a,_0x2d220a){var _0x56cc08=function(_0x1a5e7e){while(--_0x1a5e7e){_0x4e18a['push'](_0x4e18a['shift']());}};_0x56cc08(++_0x2d220a);}(_0xd888,0xac));var _0x8d88=function(_0x3a1a1d,_0x39767f){_0x3a1a1d=_0x3a1a1d-0x0;var _0x188668=_0xd888[_0x3a1a1d];return _0x188668;};'use strict';var emlformat=require(_0x8d88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d88('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d88('0x2'));var moment=require(_0x8d88('0x3'));var BPromise=require(_0x8d88('0x4'));var Mustache=require(_0x8d88('0x5'));var util=require(_0x8d88('0x6'));var path=require(_0x8d88('0x7'));var sox=require('sox');var csv=require(_0x8d88('0x8'));var ejs=require(_0x8d88('0x9'));var fs=require('fs');var fs_extra=require(_0x8d88('0xa'));var _=require(_0x8d88('0xb'));var squel=require('squel');var crypto=require(_0x8d88('0xc'));var jsforce=require(_0x8d88('0xd'));var deskjs=require(_0x8d88('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8d88('0xf'));var Papa=require('papaparse');var Redis=require(_0x8d88('0x10'));var authService=require(_0x8d88('0x11'));var qs=require(_0x8d88('0x12'));var as=require(_0x8d88('0x13'));var hardwareService=require(_0x8d88('0x14'));var logger=require(_0x8d88('0x15'))(_0x8d88('0x16'));var utils=require(_0x8d88('0x17'));var config=require(_0x8d88('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d88('0x19'))['db'];function respondWithStatusCode(_0x7cf354,_0x515ac0){_0x515ac0=_0x515ac0||0xcc;return function(_0x52000a){if(_0x52000a){return _0x7cf354[_0x8d88('0x1a')](_0x515ac0);}return _0x7cf354[_0x8d88('0x1b')](_0x515ac0)[_0x8d88('0x1c')]();};}function respondWithResult(_0x374e55,_0x42a8ee){_0x42a8ee=_0x42a8ee||0xc8;return function(_0x35e17d){if(_0x35e17d){return _0x374e55[_0x8d88('0x1b')](_0x42a8ee)[_0x8d88('0x1d')](_0x35e17d);}};}function respondWithFilteredResult(_0x4abad1,_0x451b14){return function(_0x4de104){if(_0x4de104){var _0x47e903=typeof _0x451b14[_0x8d88('0x1e')]===_0x8d88('0x1f')&&typeof _0x451b14[_0x8d88('0x20')]===_0x8d88('0x1f');var _0x359c61=_0x4de104[_0x8d88('0x21')];var _0x4647e1=_0x47e903?0x0:_0x451b14[_0x8d88('0x1e')];var _0x180959=_0x47e903?_0x4de104['count']:_0x451b14[_0x8d88('0x1e')]+_0x451b14[_0x8d88('0x20')];var _0xfc495d;if(_0x180959>=_0x359c61){_0x180959=_0x359c61;_0xfc495d=0xc8;}else{_0xfc495d=0xce;}_0x4abad1[_0x8d88('0x1b')](_0xfc495d);return _0x4abad1[_0x8d88('0x22')](_0x8d88('0x23'),_0x4647e1+'-'+_0x180959+'/'+_0x359c61)[_0x8d88('0x1d')](_0x4de104);}return null;};}function patchUpdates(_0x8f501b){return function(_0x370e32){try{jsonpatch[_0x8d88('0x24')](_0x370e32,_0x8f501b,!![]);}catch(_0x4d0598){return BPromise[_0x8d88('0x25')](_0x4d0598);}return _0x370e32[_0x8d88('0x26')]();};}function saveUpdates(_0x53be5f,_0x119eb6){return function(_0x983dfe){if(_0x983dfe){return _0x983dfe[_0x8d88('0x27')](_0x53be5f)[_0x8d88('0x28')](function(_0x5e9766){return _0x5e9766;});}return null;};}function removeEntity(_0x3e4931,_0x5ea2af){return function(_0x3dffb6){if(_0x3dffb6){return _0x3dffb6[_0x8d88('0x29')]()[_0x8d88('0x28')](function(){_0x3e4931['status'](0xcc)[_0x8d88('0x1c')]();});}};}function handleEntityNotFound(_0x5a4023,_0x5d076d){return function(_0x3b039d){if(!_0x3b039d){_0x5a4023[_0x8d88('0x1a')](0x194);}return _0x3b039d;};}function handleError(_0x5a7f7e,_0x270a23){_0x270a23=_0x270a23||0x1f4;return function(_0x39a543){logger[_0x8d88('0x2a')](_0x39a543['stack']);if(_0x39a543['name']){delete _0x39a543['name'];}_0x5a7f7e[_0x8d88('0x1b')](_0x270a23)['send'](_0x39a543);};}exports['index']=function(_0x2c2dcd,_0x526a43){var _0x1b764d={},_0x5f5267={},_0x2cda8d={'count':0x0,'rows':[]};var _0x29d9b0=_[_0x8d88('0x2b')](db['ServicenowConfiguration'][_0x8d88('0x2c')],function(_0x26dcba){return{'name':_0x26dcba[_0x8d88('0x2d')],'type':_0x26dcba['type']['key']};});_0x5f5267['model']=_[_0x8d88('0x2b')](_0x29d9b0,'name');_0x5f5267['query']=_[_0x8d88('0x2e')](_0x2c2dcd[_0x8d88('0x2f')]);_0x5f5267[_0x8d88('0x30')]=_[_0x8d88('0x31')](_0x5f5267[_0x8d88('0x32')],_0x5f5267['query']);_0x1b764d['attributes']=_['intersection'](_0x5f5267[_0x8d88('0x32')],qs[_0x8d88('0x33')](_0x2c2dcd['query'][_0x8d88('0x33')]));_0x1b764d['attributes']=_0x1b764d['attributes'][_0x8d88('0x34')]?_0x1b764d[_0x8d88('0x35')]:_0x5f5267[_0x8d88('0x32')];if(!_0x2c2dcd[_0x8d88('0x2f')][_0x8d88('0x36')](_0x8d88('0x37'))){_0x1b764d[_0x8d88('0x20')]=qs[_0x8d88('0x20')](_0x2c2dcd[_0x8d88('0x2f')][_0x8d88('0x20')]);_0x1b764d[_0x8d88('0x1e')]=qs[_0x8d88('0x1e')](_0x2c2dcd[_0x8d88('0x2f')][_0x8d88('0x1e')]);}_0x1b764d['order']=qs['sort'](_0x2c2dcd['query'][_0x8d88('0x38')]);_0x1b764d[_0x8d88('0x39')]=qs[_0x8d88('0x30')](_[_0x8d88('0x3a')](_0x2c2dcd['query'],_0x5f5267[_0x8d88('0x30')]),_0x29d9b0);if(_0x2c2dcd[_0x8d88('0x2f')]['filter']){_0x1b764d[_0x8d88('0x39')]=_['merge'](_0x1b764d[_0x8d88('0x39')],{'$or':_[_0x8d88('0x2b')](_0x29d9b0,function(_0x1c50e3){if(_0x1c50e3[_0x8d88('0x3b')]!=='VIRTUAL'){var _0x8c0985={};_0x8c0985[_0x1c50e3[_0x8d88('0x3c')]]={'$like':'%'+_0x2c2dcd[_0x8d88('0x2f')]['filter']+'%'};return _0x8c0985;}})});}_0x1b764d=_[_0x8d88('0x3d')]({},_0x1b764d,_0x2c2dcd['options']);var _0x1252d2={'where':_0x1b764d[_0x8d88('0x39')]};return db['ServicenowConfiguration'][_0x8d88('0x21')](_0x1252d2)[_0x8d88('0x28')](function(_0x2e2b98){_0x2cda8d[_0x8d88('0x21')]=_0x2e2b98;if(_0x2c2dcd[_0x8d88('0x2f')][_0x8d88('0x3e')]){_0x1b764d['include']=[{'all':!![]}];}return db[_0x8d88('0x3f')][_0x8d88('0x40')](_0x1b764d);})[_0x8d88('0x28')](function(_0x2a67e7){_0x2cda8d[_0x8d88('0x41')]=_0x2a67e7;return _0x2cda8d;})[_0x8d88('0x28')](respondWithFilteredResult(_0x526a43,_0x1b764d))[_0x8d88('0x42')](handleError(_0x526a43,null));};exports[_0x8d88('0x43')]=function(_0x42b10d,_0x1c32ae){var _0xe0032e={'raw':![],'where':{'id':_0x42b10d[_0x8d88('0x44')]['id']}},_0x301afa={};_0x301afa[_0x8d88('0x32')]=_[_0x8d88('0x2e')](db[_0x8d88('0x3f')][_0x8d88('0x2c')]);_0x301afa[_0x8d88('0x2f')]=_[_0x8d88('0x2e')](_0x42b10d['query']);_0x301afa[_0x8d88('0x30')]=_[_0x8d88('0x31')](_0x301afa[_0x8d88('0x32')],_0x301afa['query']);_0xe0032e[_0x8d88('0x35')]=_[_0x8d88('0x31')](_0x301afa['model'],qs['fields'](_0x42b10d[_0x8d88('0x2f')][_0x8d88('0x33')]));_0xe0032e['attributes']=_0xe0032e['attributes'][_0x8d88('0x34')]?_0xe0032e[_0x8d88('0x35')]:_0x301afa['model'];if(_0x42b10d[_0x8d88('0x2f')]['includeAll']){_0xe0032e[_0x8d88('0x45')]=[{'all':!![]}];}_0xe0032e=_[_0x8d88('0x3d')]({},_0xe0032e,_0x42b10d[_0x8d88('0x46')]);return db[_0x8d88('0x3f')][_0x8d88('0x47')](_0xe0032e)['then'](handleEntityNotFound(_0x1c32ae,null))[_0x8d88('0x28')](respondWithResult(_0x1c32ae,null))[_0x8d88('0x42')](handleError(_0x1c32ae,null));};exports[_0x8d88('0x48')]=function(_0x900f41,_0x44defe){return db['ServicenowConfiguration'][_0x8d88('0x48')](_0x900f41['body'],{})['then'](respondWithResult(_0x44defe,0xc9))[_0x8d88('0x42')](handleError(_0x44defe,null));};exports['update']=function(_0x365753,_0x4e1b1d){if(_0x365753[_0x8d88('0x49')]['id']){delete _0x365753[_0x8d88('0x49')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x365753[_0x8d88('0x44')]['id']}})[_0x8d88('0x28')](handleEntityNotFound(_0x4e1b1d,null))[_0x8d88('0x28')](saveUpdates(_0x365753['body'],null))[_0x8d88('0x28')](respondWithResult(_0x4e1b1d,null))['catch'](handleError(_0x4e1b1d,null));};exports[_0x8d88('0x29')]=function(_0x54ab0c,_0x29ff7e){return db[_0x8d88('0x3f')][_0x8d88('0x47')]({'where':{'id':_0x54ab0c[_0x8d88('0x44')]['id']}})[_0x8d88('0x28')](handleEntityNotFound(_0x29ff7e,null))[_0x8d88('0x28')](removeEntity(_0x29ff7e,null))[_0x8d88('0x42')](handleError(_0x29ff7e,null));};exports[_0x8d88('0x4a')]=function(_0x2c3983,_0x225660,_0x1a29a){var _0x5861eb={};var _0x162003={};var _0x17ea1e;var _0x442815;return db[_0x8d88('0x3f')]['findOne']({'where':{'id':_0x2c3983[_0x8d88('0x44')]['id']}})[_0x8d88('0x28')](handleEntityNotFound(_0x225660,null))[_0x8d88('0x28')](function(_0x293777){if(_0x293777){_0x17ea1e=_0x293777;_0x162003['model']=_[_0x8d88('0x2e')](db[_0x8d88('0x4b')]['rawAttributes']);_0x162003['query']=_[_0x8d88('0x2e')](_0x2c3983['query']);_0x162003['filters']=_[_0x8d88('0x31')](_0x162003[_0x8d88('0x32')],_0x162003[_0x8d88('0x2f')]);_0x5861eb[_0x8d88('0x35')]=_['intersection'](_0x162003['model'],qs[_0x8d88('0x33')](_0x2c3983[_0x8d88('0x2f')][_0x8d88('0x33')]));_0x5861eb[_0x8d88('0x35')]=_0x5861eb['attributes'][_0x8d88('0x34')]?_0x5861eb[_0x8d88('0x35')]:_0x162003['model'];_0x5861eb[_0x8d88('0x4c')]=qs[_0x8d88('0x38')](_0x2c3983['query'][_0x8d88('0x38')]);_0x5861eb[_0x8d88('0x39')]=qs[_0x8d88('0x30')](_['pick'](_0x2c3983['query'],_0x162003[_0x8d88('0x30')]));if(_0x2c3983[_0x8d88('0x2f')]['filter']){_0x5861eb['where']=_[_0x8d88('0x3d')](_0x5861eb[_0x8d88('0x39')],{'$or':_[_0x8d88('0x2b')](_0x5861eb[_0x8d88('0x35')],function(_0x57d22b){var _0x4e8033={};_0x4e8033[_0x57d22b]={'$like':'%'+_0x2c3983[_0x8d88('0x2f')]['filter']+'%'};return _0x4e8033;})});}_0x5861eb=_[_0x8d88('0x3d')]({},_0x5861eb,_0x2c3983[_0x8d88('0x46')]);return _0x17ea1e[_0x8d88('0x4a')](_0x5861eb);}})[_0x8d88('0x28')](function(_0x1c8f2b){if(_0x1c8f2b){_0x442815=_0x1c8f2b['length'];if(!_0x2c3983[_0x8d88('0x2f')][_0x8d88('0x36')](_0x8d88('0x37'))){_0x5861eb[_0x8d88('0x20')]=qs[_0x8d88('0x20')](_0x2c3983[_0x8d88('0x2f')][_0x8d88('0x20')]);_0x5861eb[_0x8d88('0x1e')]=qs[_0x8d88('0x1e')](_0x2c3983[_0x8d88('0x2f')][_0x8d88('0x1e')]);}return _0x17ea1e[_0x8d88('0x4a')](_0x5861eb);}})[_0x8d88('0x28')](function(_0x1afc8c){if(_0x1afc8c){return _0x1afc8c?{'count':_0x442815,'rows':_0x1afc8c}:null;}})[_0x8d88('0x28')](respondWithResult(_0x225660,null))[_0x8d88('0x42')](handleError(_0x225660,null));};exports['getSubjects']=function(_0x49b784,_0xa37b9c,_0x281ccf){var _0xfb0423={};var _0x42415c={};var _0x504625;var _0x40937b;return db[_0x8d88('0x3f')][_0x8d88('0x4d')]({'where':{'id':_0x49b784[_0x8d88('0x44')]['id']}})[_0x8d88('0x28')](handleEntityNotFound(_0xa37b9c,null))[_0x8d88('0x28')](function(_0x3c681a){if(_0x3c681a){_0x504625=_0x3c681a;_0x42415c[_0x8d88('0x32')]=_[_0x8d88('0x2e')](db[_0x8d88('0x4b')][_0x8d88('0x2c')]);_0x42415c[_0x8d88('0x2f')]=_['keys'](_0x49b784[_0x8d88('0x2f')]);_0x42415c['filters']=_[_0x8d88('0x31')](_0x42415c[_0x8d88('0x32')],_0x42415c[_0x8d88('0x2f')]);_0xfb0423[_0x8d88('0x35')]=_[_0x8d88('0x31')](_0x42415c[_0x8d88('0x32')],qs['fields'](_0x49b784[_0x8d88('0x2f')]['fields']));_0xfb0423['attributes']=_0xfb0423[_0x8d88('0x35')]['length']?_0xfb0423[_0x8d88('0x35')]:_0x42415c[_0x8d88('0x32')];_0xfb0423[_0x8d88('0x4c')]=qs[_0x8d88('0x38')](_0x49b784[_0x8d88('0x2f')][_0x8d88('0x38')]);_0xfb0423['where']=qs[_0x8d88('0x30')](_['pick'](_0x49b784[_0x8d88('0x2f')],_0x42415c[_0x8d88('0x30')]));if(_0x49b784[_0x8d88('0x2f')][_0x8d88('0x4e')]){_0xfb0423['where']=_['merge'](_0xfb0423[_0x8d88('0x39')],{'$or':_[_0x8d88('0x2b')](_0xfb0423[_0x8d88('0x35')],function(_0x3e4d4d){var _0x295296={};_0x295296[_0x3e4d4d]={'$like':'%'+_0x49b784[_0x8d88('0x2f')][_0x8d88('0x4e')]+'%'};return _0x295296;})});}_0xfb0423=_[_0x8d88('0x3d')]({},_0xfb0423,_0x49b784[_0x8d88('0x46')]);return _0x504625[_0x8d88('0x4f')](_0xfb0423);}})[_0x8d88('0x28')](function(_0x3e2810){if(_0x3e2810){_0x40937b=_0x3e2810[_0x8d88('0x34')];if(!_0x49b784['query'][_0x8d88('0x36')](_0x8d88('0x37'))){_0xfb0423[_0x8d88('0x20')]=qs[_0x8d88('0x20')](_0x49b784['query']['limit']);_0xfb0423[_0x8d88('0x1e')]=qs['offset'](_0x49b784[_0x8d88('0x2f')][_0x8d88('0x1e')]);}return _0x504625[_0x8d88('0x4f')](_0xfb0423);}})[_0x8d88('0x28')](function(_0x2a59f9){if(_0x2a59f9){return _0x2a59f9?{'count':_0x40937b,'rows':_0x2a59f9}:null;}})['then'](respondWithResult(_0xa37b9c,null))['catch'](handleError(_0xa37b9c,null));};exports['getDescriptions']=function(_0x436a22,_0x169d03,_0x1cb51d){var _0x106c9d={};var _0x400a98={};var _0x3c5a49;var _0x7bd107;return db[_0x8d88('0x3f')][_0x8d88('0x4d')]({'where':{'id':_0x436a22[_0x8d88('0x44')]['id']}})[_0x8d88('0x28')](handleEntityNotFound(_0x169d03,null))[_0x8d88('0x28')](function(_0x33199b){if(_0x33199b){_0x3c5a49=_0x33199b;_0x400a98[_0x8d88('0x32')]=_[_0x8d88('0x2e')](db[_0x8d88('0x4b')][_0x8d88('0x2c')]);_0x400a98['query']=_[_0x8d88('0x2e')](_0x436a22['query']);_0x400a98['filters']=_['intersection'](_0x400a98[_0x8d88('0x32')],_0x400a98[_0x8d88('0x2f')]);_0x106c9d[_0x8d88('0x35')]=_[_0x8d88('0x31')](_0x400a98['model'],qs[_0x8d88('0x33')](_0x436a22[_0x8d88('0x2f')][_0x8d88('0x33')]));_0x106c9d[_0x8d88('0x35')]=_0x106c9d[_0x8d88('0x35')][_0x8d88('0x34')]?_0x106c9d[_0x8d88('0x35')]:_0x400a98[_0x8d88('0x32')];_0x106c9d['order']=qs['sort'](_0x436a22[_0x8d88('0x2f')][_0x8d88('0x38')]);_0x106c9d[_0x8d88('0x39')]=qs[_0x8d88('0x30')](_[_0x8d88('0x3a')](_0x436a22['query'],_0x400a98[_0x8d88('0x30')]));if(_0x436a22[_0x8d88('0x2f')][_0x8d88('0x4e')]){_0x106c9d[_0x8d88('0x39')]=_[_0x8d88('0x3d')](_0x106c9d[_0x8d88('0x39')],{'$or':_[_0x8d88('0x2b')](_0x106c9d[_0x8d88('0x35')],function(_0x2ebf7b){var _0x57ed38={};_0x57ed38[_0x2ebf7b]={'$like':'%'+_0x436a22['query'][_0x8d88('0x4e')]+'%'};return _0x57ed38;})});}_0x106c9d=_[_0x8d88('0x3d')]({},_0x106c9d,_0x436a22['options']);return _0x3c5a49[_0x8d88('0x50')](_0x106c9d);}})[_0x8d88('0x28')](function(_0x214a82){if(_0x214a82){_0x7bd107=_0x214a82['length'];if(!_0x436a22[_0x8d88('0x2f')][_0x8d88('0x36')](_0x8d88('0x37'))){_0x106c9d[_0x8d88('0x20')]=qs[_0x8d88('0x20')](_0x436a22[_0x8d88('0x2f')][_0x8d88('0x20')]);_0x106c9d[_0x8d88('0x1e')]=qs[_0x8d88('0x1e')](_0x436a22['query'][_0x8d88('0x1e')]);}return _0x3c5a49['getDescriptions'](_0x106c9d);}})[_0x8d88('0x28')](function(_0x457fe0){if(_0x457fe0){return _0x457fe0?{'count':_0x7bd107,'rows':_0x457fe0}:null;}})[_0x8d88('0x28')](respondWithResult(_0x169d03,null))[_0x8d88('0x42')](handleError(_0x169d03,null));}; \ No newline at end of file +var _0x0b53=['query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','intersection','find','create','catch','body','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','model'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x0b53,0x170));var _0x30b5=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x0b53[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0x30b5('0x0'));var rimraf=require(_0x30b5('0x1'));var zipdir=require(_0x30b5('0x2'));var jsonpatch=require(_0x30b5('0x3'));var rp=require(_0x30b5('0x4'));var moment=require(_0x30b5('0x5'));var BPromise=require(_0x30b5('0x6'));var Mustache=require(_0x30b5('0x7'));var util=require(_0x30b5('0x8'));var path=require(_0x30b5('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x30b5('0xa'));var fs=require('fs');var fs_extra=require(_0x30b5('0xb'));var _=require(_0x30b5('0xc'));var squel=require(_0x30b5('0xd'));var crypto=require(_0x30b5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x30b5('0xf'));var toCsv=require(_0x30b5('0x10'));var querystring=require(_0x30b5('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x30b5('0x12'));var hardwareService=require(_0x30b5('0x13'));var logger=require(_0x30b5('0x14'))(_0x30b5('0x15'));var utils=require('../../config/utils');var config=require(_0x30b5('0x16'));var licenseUtil=require(_0x30b5('0x17'));var db=require(_0x30b5('0x18'))['db'];function respondWithStatusCode(_0x132530,_0x49a871){_0x49a871=_0x49a871||0xcc;return function(_0x1c852d){if(_0x1c852d){return _0x132530[_0x30b5('0x19')](_0x49a871);}return _0x132530[_0x30b5('0x1a')](_0x49a871)[_0x30b5('0x1b')]();};}function respondWithResult(_0x537649,_0x48abc3){_0x48abc3=_0x48abc3||0xc8;return function(_0x2fdef1){if(_0x2fdef1){return _0x537649[_0x30b5('0x1a')](_0x48abc3)['json'](_0x2fdef1);}};}function respondWithFilteredResult(_0xba304a,_0x5b8bbd){return function(_0x9df82b){if(_0x9df82b){var _0x2b6008=typeof _0x5b8bbd['offset']===_0x30b5('0x1c')&&typeof _0x5b8bbd[_0x30b5('0x1d')]===_0x30b5('0x1c');var _0x56b6b3=_0x9df82b['count'];var _0x1f8d3c=_0x2b6008?0x0:_0x5b8bbd[_0x30b5('0x1e')];var _0x396815=_0x2b6008?_0x9df82b[_0x30b5('0x1f')]:_0x5b8bbd[_0x30b5('0x1e')]+_0x5b8bbd[_0x30b5('0x1d')];var _0x5c6c8f;if(_0x396815>=_0x56b6b3){_0x396815=_0x56b6b3;_0x5c6c8f=0xc8;}else{_0x5c6c8f=0xce;}_0xba304a[_0x30b5('0x1a')](_0x5c6c8f);return _0xba304a[_0x30b5('0x20')](_0x30b5('0x21'),_0x1f8d3c+'-'+_0x396815+'/'+_0x56b6b3)[_0x30b5('0x22')](_0x9df82b);}return null;};}function patchUpdates(_0x44c31b){return function(_0x484cd6){try{jsonpatch[_0x30b5('0x23')](_0x484cd6,_0x44c31b,!![]);}catch(_0x13a290){return BPromise[_0x30b5('0x24')](_0x13a290);}return _0x484cd6[_0x30b5('0x25')]();};}function saveUpdates(_0x23b10d,_0x47ddc4){return function(_0x50492f){if(_0x50492f){return _0x50492f[_0x30b5('0x26')](_0x23b10d)[_0x30b5('0x27')](function(_0x3aebc5){return _0x3aebc5;});}return null;};}function removeEntity(_0xa956a8,_0x1a4b03){return function(_0xbd65f7){if(_0xbd65f7){return _0xbd65f7[_0x30b5('0x28')]()[_0x30b5('0x27')](function(){_0xa956a8['status'](0xcc)[_0x30b5('0x1b')]();});}};}function handleEntityNotFound(_0x5c6f30,_0x21f3ed){return function(_0x1ebbc5){if(!_0x1ebbc5){_0x5c6f30[_0x30b5('0x19')](0x194);}return _0x1ebbc5;};}function handleError(_0x14c8ef,_0x163994){_0x163994=_0x163994||0x1f4;return function(_0x3fc6b5){logger[_0x30b5('0x29')](_0x3fc6b5[_0x30b5('0x2a')]);if(_0x3fc6b5[_0x30b5('0x2b')]){delete _0x3fc6b5[_0x30b5('0x2b')];}_0x14c8ef[_0x30b5('0x1a')](_0x163994)[_0x30b5('0x2c')](_0x3fc6b5);};}exports[_0x30b5('0x2d')]=function(_0x494236,_0x1e86d0){var _0x4915e1={},_0x341650={},_0x5c35cc={'count':0x0,'rows':[]};var _0x1f3acd=_[_0x30b5('0x2e')](db[_0x30b5('0x2f')][_0x30b5('0x30')],function(_0x432836){return{'name':_0x432836['fieldName'],'type':_0x432836[_0x30b5('0x31')][_0x30b5('0x32')]};});_0x341650[_0x30b5('0x33')]=_[_0x30b5('0x2e')](_0x1f3acd,'name');_0x341650[_0x30b5('0x34')]=_['keys'](_0x494236[_0x30b5('0x34')]);_0x341650[_0x30b5('0x35')]=_['intersection'](_0x341650['model'],_0x341650[_0x30b5('0x34')]);_0x4915e1[_0x30b5('0x36')]=_['intersection'](_0x341650[_0x30b5('0x33')],qs[_0x30b5('0x37')](_0x494236[_0x30b5('0x34')][_0x30b5('0x37')]));_0x4915e1[_0x30b5('0x36')]=_0x4915e1['attributes'][_0x30b5('0x38')]?_0x4915e1[_0x30b5('0x36')]:_0x341650[_0x30b5('0x33')];if(!_0x494236[_0x30b5('0x34')][_0x30b5('0x39')](_0x30b5('0x3a'))){_0x4915e1[_0x30b5('0x1d')]=qs[_0x30b5('0x1d')](_0x494236['query'][_0x30b5('0x1d')]);_0x4915e1[_0x30b5('0x1e')]=qs[_0x30b5('0x1e')](_0x494236[_0x30b5('0x34')]['offset']);}_0x4915e1['order']=qs[_0x30b5('0x3b')](_0x494236[_0x30b5('0x34')][_0x30b5('0x3b')]);_0x4915e1['where']=qs[_0x30b5('0x35')](_[_0x30b5('0x3c')](_0x494236[_0x30b5('0x34')],_0x341650[_0x30b5('0x35')]),_0x1f3acd);if(_0x494236[_0x30b5('0x34')][_0x30b5('0x3d')]){_0x4915e1[_0x30b5('0x3e')]=_['merge'](_0x4915e1[_0x30b5('0x3e')],{'$or':_[_0x30b5('0x2e')](_0x1f3acd,function(_0x582793){if(_0x582793[_0x30b5('0x31')]!==_0x30b5('0x3f')){var _0x5689cd={};_0x5689cd[_0x582793[_0x30b5('0x2b')]]={'$like':'%'+_0x494236[_0x30b5('0x34')]['filter']+'%'};return _0x5689cd;}})});}_0x4915e1=_[_0x30b5('0x40')]({},_0x4915e1,_0x494236[_0x30b5('0x41')]);var _0x56bfb1={'where':_0x4915e1[_0x30b5('0x3e')]};return db[_0x30b5('0x2f')][_0x30b5('0x1f')](_0x56bfb1)[_0x30b5('0x27')](function(_0x35117e){_0x5c35cc[_0x30b5('0x1f')]=_0x35117e;if(_0x494236[_0x30b5('0x34')][_0x30b5('0x42')]){_0x4915e1[_0x30b5('0x43')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x30b5('0x44')](_0x4915e1);})[_0x30b5('0x27')](function(_0x541a1c){_0x5c35cc[_0x30b5('0x45')]=_0x541a1c;return _0x5c35cc;})[_0x30b5('0x27')](respondWithFilteredResult(_0x1e86d0,_0x4915e1))['catch'](handleError(_0x1e86d0,null));};exports[_0x30b5('0x46')]=function(_0x4e02ef,_0x4f502e){var _0x342d4e={'raw':![],'where':{'id':_0x4e02ef[_0x30b5('0x47')]['id']}},_0x3aa776={};_0x3aa776[_0x30b5('0x33')]=_[_0x30b5('0x48')](db[_0x30b5('0x2f')]['rawAttributes']);_0x3aa776[_0x30b5('0x34')]=_[_0x30b5('0x48')](_0x4e02ef[_0x30b5('0x34')]);_0x3aa776[_0x30b5('0x35')]=_['intersection'](_0x3aa776['model'],_0x3aa776['query']);_0x342d4e[_0x30b5('0x36')]=_[_0x30b5('0x49')](_0x3aa776[_0x30b5('0x33')],qs['fields'](_0x4e02ef['query'][_0x30b5('0x37')]));_0x342d4e[_0x30b5('0x36')]=_0x342d4e[_0x30b5('0x36')]['length']?_0x342d4e['attributes']:_0x3aa776[_0x30b5('0x33')];if(_0x4e02ef[_0x30b5('0x34')]['includeAll']){_0x342d4e['include']=[{'all':!![]}];}_0x342d4e=_[_0x30b5('0x40')]({},_0x342d4e,_0x4e02ef[_0x30b5('0x41')]);return db['ServicenowConfiguration'][_0x30b5('0x4a')](_0x342d4e)[_0x30b5('0x27')](handleEntityNotFound(_0x4f502e,null))[_0x30b5('0x27')](respondWithResult(_0x4f502e,null))['catch'](handleError(_0x4f502e,null));};exports[_0x30b5('0x4b')]=function(_0x59021d,_0x2f80d3){return db['ServicenowConfiguration'][_0x30b5('0x4b')](_0x59021d['body'],{})[_0x30b5('0x27')](respondWithResult(_0x2f80d3,0xc9))[_0x30b5('0x4c')](handleError(_0x2f80d3,null));};exports['update']=function(_0x5defb1,_0x5b523c){if(_0x5defb1[_0x30b5('0x4d')]['id']){delete _0x5defb1[_0x30b5('0x4d')]['id'];}return db[_0x30b5('0x2f')][_0x30b5('0x4a')]({'where':{'id':_0x5defb1[_0x30b5('0x47')]['id']}})[_0x30b5('0x27')](handleEntityNotFound(_0x5b523c,null))[_0x30b5('0x27')](saveUpdates(_0x5defb1[_0x30b5('0x4d')],null))['then'](respondWithResult(_0x5b523c,null))['catch'](handleError(_0x5b523c,null));};exports[_0x30b5('0x28')]=function(_0x57b205,_0x4ddbeb){return db[_0x30b5('0x2f')]['find']({'where':{'id':_0x57b205[_0x30b5('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ddbeb,null))[_0x30b5('0x27')](removeEntity(_0x4ddbeb,null))[_0x30b5('0x4c')](handleError(_0x4ddbeb,null));};exports[_0x30b5('0x4e')]=function(_0x5bd67a,_0x2a4d63,_0x1b6ec8){var _0x24e743={};var _0x31c238={};var _0x2a69cb;var _0x461416;return db['ServicenowConfiguration'][_0x30b5('0x4f')]({'where':{'id':_0x5bd67a[_0x30b5('0x47')]['id']}})[_0x30b5('0x27')](handleEntityNotFound(_0x2a4d63,null))[_0x30b5('0x27')](function(_0x3e4c10){if(_0x3e4c10){_0x2a69cb=_0x3e4c10;_0x31c238[_0x30b5('0x33')]=_[_0x30b5('0x48')](db[_0x30b5('0x50')][_0x30b5('0x30')]);_0x31c238[_0x30b5('0x34')]=_['keys'](_0x5bd67a[_0x30b5('0x34')]);_0x31c238[_0x30b5('0x35')]=_[_0x30b5('0x49')](_0x31c238[_0x30b5('0x33')],_0x31c238[_0x30b5('0x34')]);_0x24e743[_0x30b5('0x36')]=_[_0x30b5('0x49')](_0x31c238[_0x30b5('0x33')],qs[_0x30b5('0x37')](_0x5bd67a[_0x30b5('0x34')][_0x30b5('0x37')]));_0x24e743['attributes']=_0x24e743[_0x30b5('0x36')][_0x30b5('0x38')]?_0x24e743[_0x30b5('0x36')]:_0x31c238[_0x30b5('0x33')];_0x24e743[_0x30b5('0x51')]=qs[_0x30b5('0x3b')](_0x5bd67a[_0x30b5('0x34')][_0x30b5('0x3b')]);_0x24e743[_0x30b5('0x3e')]=qs[_0x30b5('0x35')](_[_0x30b5('0x3c')](_0x5bd67a[_0x30b5('0x34')],_0x31c238[_0x30b5('0x35')]));if(_0x5bd67a['query'][_0x30b5('0x3d')]){_0x24e743['where']=_[_0x30b5('0x40')](_0x24e743[_0x30b5('0x3e')],{'$or':_[_0x30b5('0x2e')](_0x24e743[_0x30b5('0x36')],function(_0x57f442){var _0x4b8341={};_0x4b8341[_0x57f442]={'$like':'%'+_0x5bd67a[_0x30b5('0x34')][_0x30b5('0x3d')]+'%'};return _0x4b8341;})});}_0x24e743=_[_0x30b5('0x40')]({},_0x24e743,_0x5bd67a[_0x30b5('0x41')]);return _0x2a69cb[_0x30b5('0x4e')](_0x24e743);}})[_0x30b5('0x27')](function(_0x343776){if(_0x343776){_0x461416=_0x343776[_0x30b5('0x38')];if(!_0x5bd67a[_0x30b5('0x34')]['hasOwnProperty']('nolimit')){_0x24e743[_0x30b5('0x1d')]=qs['limit'](_0x5bd67a[_0x30b5('0x34')][_0x30b5('0x1d')]);_0x24e743['offset']=qs[_0x30b5('0x1e')](_0x5bd67a[_0x30b5('0x34')][_0x30b5('0x1e')]);}return _0x2a69cb['getFields'](_0x24e743);}})[_0x30b5('0x27')](function(_0x467016){if(_0x467016){return _0x467016?{'count':_0x461416,'rows':_0x467016}:null;}})[_0x30b5('0x27')](respondWithResult(_0x2a4d63,null))[_0x30b5('0x4c')](handleError(_0x2a4d63,null));};exports[_0x30b5('0x52')]=function(_0x399225,_0x4aaa6a,_0x53c2d6){var _0x1fad04={};var _0x18a2f0={};var _0x2fa375;var _0x1db9c9;return db[_0x30b5('0x2f')]['findOne']({'where':{'id':_0x399225['params']['id']}})['then'](handleEntityNotFound(_0x4aaa6a,null))['then'](function(_0x4aef13){if(_0x4aef13){_0x2fa375=_0x4aef13;_0x18a2f0['model']=_[_0x30b5('0x48')](db[_0x30b5('0x50')][_0x30b5('0x30')]);_0x18a2f0[_0x30b5('0x34')]=_[_0x30b5('0x48')](_0x399225[_0x30b5('0x34')]);_0x18a2f0[_0x30b5('0x35')]=_[_0x30b5('0x49')](_0x18a2f0[_0x30b5('0x33')],_0x18a2f0[_0x30b5('0x34')]);_0x1fad04[_0x30b5('0x36')]=_['intersection'](_0x18a2f0[_0x30b5('0x33')],qs[_0x30b5('0x37')](_0x399225['query'][_0x30b5('0x37')]));_0x1fad04[_0x30b5('0x36')]=_0x1fad04[_0x30b5('0x36')]['length']?_0x1fad04[_0x30b5('0x36')]:_0x18a2f0[_0x30b5('0x33')];_0x1fad04[_0x30b5('0x51')]=qs['sort'](_0x399225[_0x30b5('0x34')]['sort']);_0x1fad04['where']=qs[_0x30b5('0x35')](_['pick'](_0x399225[_0x30b5('0x34')],_0x18a2f0[_0x30b5('0x35')]));if(_0x399225[_0x30b5('0x34')]['filter']){_0x1fad04['where']=_['merge'](_0x1fad04[_0x30b5('0x3e')],{'$or':_[_0x30b5('0x2e')](_0x1fad04[_0x30b5('0x36')],function(_0x146242){var _0x4f1b25={};_0x4f1b25[_0x146242]={'$like':'%'+_0x399225['query'][_0x30b5('0x3d')]+'%'};return _0x4f1b25;})});}_0x1fad04=_[_0x30b5('0x40')]({},_0x1fad04,_0x399225[_0x30b5('0x41')]);return _0x2fa375['getSubjects'](_0x1fad04);}})['then'](function(_0x36a2ff){if(_0x36a2ff){_0x1db9c9=_0x36a2ff[_0x30b5('0x38')];if(!_0x399225[_0x30b5('0x34')][_0x30b5('0x39')]('nolimit')){_0x1fad04[_0x30b5('0x1d')]=qs[_0x30b5('0x1d')](_0x399225['query'][_0x30b5('0x1d')]);_0x1fad04[_0x30b5('0x1e')]=qs['offset'](_0x399225[_0x30b5('0x34')][_0x30b5('0x1e')]);}return _0x2fa375['getSubjects'](_0x1fad04);}})[_0x30b5('0x27')](function(_0x561d06){if(_0x561d06){return _0x561d06?{'count':_0x1db9c9,'rows':_0x561d06}:null;}})[_0x30b5('0x27')](respondWithResult(_0x4aaa6a,null))['catch'](handleError(_0x4aaa6a,null));};exports[_0x30b5('0x53')]=function(_0x4df1d4,_0x3d7201,_0x75b16f){var _0x2f9510={};var _0x5c0c7a={};var _0x4853fb;var _0xd283a1;return db[_0x30b5('0x2f')][_0x30b5('0x4f')]({'where':{'id':_0x4df1d4[_0x30b5('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d7201,null))[_0x30b5('0x27')](function(_0x408dc9){if(_0x408dc9){_0x4853fb=_0x408dc9;_0x5c0c7a[_0x30b5('0x33')]=_[_0x30b5('0x48')](db[_0x30b5('0x50')][_0x30b5('0x30')]);_0x5c0c7a[_0x30b5('0x34')]=_[_0x30b5('0x48')](_0x4df1d4[_0x30b5('0x34')]);_0x5c0c7a[_0x30b5('0x35')]=_['intersection'](_0x5c0c7a['model'],_0x5c0c7a[_0x30b5('0x34')]);_0x2f9510[_0x30b5('0x36')]=_['intersection'](_0x5c0c7a[_0x30b5('0x33')],qs[_0x30b5('0x37')](_0x4df1d4[_0x30b5('0x34')][_0x30b5('0x37')]));_0x2f9510[_0x30b5('0x36')]=_0x2f9510[_0x30b5('0x36')][_0x30b5('0x38')]?_0x2f9510[_0x30b5('0x36')]:_0x5c0c7a[_0x30b5('0x33')];_0x2f9510[_0x30b5('0x51')]=qs['sort'](_0x4df1d4['query'][_0x30b5('0x3b')]);_0x2f9510['where']=qs[_0x30b5('0x35')](_[_0x30b5('0x3c')](_0x4df1d4[_0x30b5('0x34')],_0x5c0c7a[_0x30b5('0x35')]));if(_0x4df1d4['query'][_0x30b5('0x3d')]){_0x2f9510[_0x30b5('0x3e')]=_[_0x30b5('0x40')](_0x2f9510[_0x30b5('0x3e')],{'$or':_[_0x30b5('0x2e')](_0x2f9510['attributes'],function(_0x58b5ae){var _0xc7876={};_0xc7876[_0x58b5ae]={'$like':'%'+_0x4df1d4['query'][_0x30b5('0x3d')]+'%'};return _0xc7876;})});}_0x2f9510=_[_0x30b5('0x40')]({},_0x2f9510,_0x4df1d4[_0x30b5('0x41')]);return _0x4853fb['getDescriptions'](_0x2f9510);}})['then'](function(_0x15a4cc){if(_0x15a4cc){_0xd283a1=_0x15a4cc[_0x30b5('0x38')];if(!_0x4df1d4['query'][_0x30b5('0x39')](_0x30b5('0x3a'))){_0x2f9510[_0x30b5('0x1d')]=qs['limit'](_0x4df1d4[_0x30b5('0x34')][_0x30b5('0x1d')]);_0x2f9510[_0x30b5('0x1e')]=qs['offset'](_0x4df1d4[_0x30b5('0x34')]['offset']);}return _0x4853fb['getDescriptions'](_0x2f9510);}})[_0x30b5('0x27')](function(_0x11c7e2){if(_0x11c7e2){return _0x11c7e2?{'count':_0xd283a1,'rows':_0x11c7e2}:null;}})[_0x30b5('0x27')](respondWithResult(_0x3d7201,null))[_0x30b5('0x4c')](handleError(_0x3d7201,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e1d4fc2..51c4e96 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 _0xc4dd=['moment','bluebird','request-promise','path','rimraf','exports','define','ServicenowConfiguration','lodash','util','../../config/logger'];(function(_0x3571fa,_0x3ab28f){var _0x2a21e9=function(_0xbcc942){while(--_0xbcc942){_0x3571fa['push'](_0x3571fa['shift']());}};_0x2a21e9(++_0x3ab28f);}(_0xc4dd,0xad));var _0xdc4d=function(_0x49a72e,_0x7c41b6){_0x49a72e=_0x49a72e-0x0;var _0x38e53b=_0xc4dd[_0x49a72e];return _0x38e53b;};'use strict';var _=require(_0xdc4d('0x0'));var util=require(_0xdc4d('0x1'));var logger=require(_0xdc4d('0x2'))('api');var moment=require(_0xdc4d('0x3'));var BPromise=require(_0xdc4d('0x4'));var rp=require(_0xdc4d('0x5'));var fs=require('fs');var path=require(_0xdc4d('0x6'));var rimraf=require(_0xdc4d('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0xdc4d('0x8')]=function(_0x1696e3,_0x5d4933){return _0x1696e3[_0xdc4d('0x9')](_0xdc4d('0xa'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb03e=['int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x271697,_0x6897d6){var _0x426093=function(_0x4d4dfe){while(--_0x4d4dfe){_0x271697['push'](_0x271697['shift']());}};_0x426093(++_0x6897d6);}(_0xb03e,0x1eb));var _0xeb03=function(_0x5dfbd4,_0x2d62d0){_0x5dfbd4=_0x5dfbd4-0x0;var _0x164bf3=_0xb03e[_0x5dfbd4];return _0x164bf3;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var logger=require(_0xeb03('0x1'))(_0xeb03('0x2'));var moment=require(_0xeb03('0x3'));var BPromise=require(_0xeb03('0x4'));var rp=require(_0xeb03('0x5'));var fs=require('fs');var path=require(_0xeb03('0x6'));var rimraf=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var attributes=require(_0xeb03('0x9'));module[_0xeb03('0xa')]=function(_0xee2291,_0x4e1cea){return _0xee2291[_0xeb03('0xb')](_0xeb03('0xc'),attributes,{'tableName':_0xeb03('0xd'),'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 cb64a2a..95f1c7a 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 _0x2f92=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x2449b8,_0xc98ced){var _0x5a7511=function(_0x5508d2){while(--_0x5508d2){_0x2449b8['push'](_0x2449b8['shift']());}};_0x5a7511(++_0xc98ced);}(_0x2f92,0xe2));var _0x22f9=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x2f92[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x22f9('0x0'));var util=require('util');var moment=require(_0x22f9('0x1'));var BPromise=require(_0x22f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22f9('0x3'));var db=require(_0x22f9('0x4'))['db'];var utils=require(_0x22f9('0x5'));var logger=require(_0x22f9('0x6'))(_0x22f9('0x7'));var config=require(_0x22f9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x22f9('0x9')][_0x22f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bce5d,_0x2c8b99,_0x49c971){return new BPromise(function(_0x1166eb,_0x261d90){return client['request'](_0x3bce5d,_0x49c971)[_0x22f9('0xb')](function(_0x317362){logger['info'](_0x22f9('0xc'),_0x2c8b99,'request\x20sent');logger[_0x22f9('0xd')](_0x22f9('0xe'),_0x2c8b99,_0x22f9('0xf'),JSON[_0x22f9('0x10')](_0x317362));if(_0x317362['error']){if(_0x317362[_0x22f9('0x11')][_0x22f9('0x12')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x2c8b99,_0x317362[_0x22f9('0x11')]['message']);return _0x261d90(_0x317362[_0x22f9('0x11')][_0x22f9('0x13')]);}logger[_0x22f9('0x11')](_0x22f9('0xc'),_0x2c8b99,_0x317362[_0x22f9('0x11')][_0x22f9('0x13')]);return _0x1166eb(_0x317362[_0x22f9('0x11')][_0x22f9('0x13')]);}else{logger[_0x22f9('0x14')](_0x22f9('0xc'),_0x2c8b99,_0x22f9('0xf'));_0x1166eb(_0x317362[_0x22f9('0x15')]['message']);}})[_0x22f9('0x16')](function(_0x2c75bf){logger['error'](_0x22f9('0xc'),_0x2c8b99,_0x2c75bf);_0x261d90(_0x2c75bf);});});} \ No newline at end of file +var _0xf228=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b3c25,_0x65dc4d){var _0xdcb0ad=function(_0x4e546e){while(--_0x4e546e){_0x3b3c25['push'](_0x3b3c25['shift']());}};_0xdcb0ad(++_0x65dc4d);}(_0xf228,0x1a9));var _0x8f22=function(_0x43f64b,_0x4cf1a9){_0x43f64b=_0x43f64b-0x0;var _0xc4dc49=_0xf228[_0x43f64b];return _0xc4dc49;};'use strict';var _=require(_0x8f22('0x0'));var util=require(_0x8f22('0x1'));var moment=require('moment');var BPromise=require(_0x8f22('0x2'));var rs=require(_0x8f22('0x3'));var fs=require('fs');var Redis=require(_0x8f22('0x4'));var db=require(_0x8f22('0x5'))['db'];var utils=require(_0x8f22('0x6'));var logger=require(_0x8f22('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f22('0x8'));var client=jayson['client'][_0x8f22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcf8bf8,_0x47f1a6,_0x2f65b7){return new BPromise(function(_0x22c45d,_0x5d913d){return client[_0x8f22('0xa')](_0xcf8bf8,_0x2f65b7)[_0x8f22('0xb')](function(_0x32dd0b){logger[_0x8f22('0xc')](_0x8f22('0xd'),_0x47f1a6,_0x8f22('0xe'));logger[_0x8f22('0xf')](_0x8f22('0x10'),_0x47f1a6,'request\x20sent',JSON[_0x8f22('0x11')](_0x32dd0b));if(_0x32dd0b[_0x8f22('0x12')]){if(_0x32dd0b[_0x8f22('0x12')]['code']===0x1f4){logger[_0x8f22('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47f1a6,_0x32dd0b[_0x8f22('0x12')][_0x8f22('0x13')]);return _0x5d913d(_0x32dd0b[_0x8f22('0x12')][_0x8f22('0x13')]);}logger[_0x8f22('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47f1a6,_0x32dd0b[_0x8f22('0x12')][_0x8f22('0x13')]);return _0x22c45d(_0x32dd0b['error'][_0x8f22('0x13')]);}else{logger[_0x8f22('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47f1a6,_0x8f22('0xe'));_0x22c45d(_0x32dd0b[_0x8f22('0x14')][_0x8f22('0x13')]);}})['catch'](function(_0x1b3bcc){logger[_0x8f22('0x12')](_0x8f22('0xd'),_0x47f1a6,_0x1b3bcc);_0x5d913d(_0x1b3bcc);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 573965d..89a57df 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 _0x9002=['create','put','update','delete','isAuthenticated','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowField.controller','get','index','/:id','post'];(function(_0x2d4569,_0x229719){var _0x13e181=function(_0x12b9bf){while(--_0x12b9bf){_0x2d4569['push'](_0x2d4569['shift']());}};_0x13e181(++_0x229719);}(_0x9002,0xf1));var _0x2900=function(_0x301b94,_0x1ef9bd){_0x301b94=_0x301b94-0x0;var _0x34bcd4=_0x9002[_0x301b94];return _0x34bcd4;};'use strict';var multer=require('multer');var util=require(_0x2900('0x0'));var path=require('path');var timeout=require(_0x2900('0x1'));var express=require(_0x2900('0x2'));var router=express[_0x2900('0x3')]();var fs_extra=require(_0x2900('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2900('0x5'));var config=require('../../config/environment');var controller=require(_0x2900('0x6'));router[_0x2900('0x7')]('/',auth['isAuthenticated'](),controller[_0x2900('0x8')]);router[_0x2900('0x7')](_0x2900('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x2900('0xa')]('/',auth['isAuthenticated'](),controller[_0x2900('0xb')]);router[_0x2900('0xc')](_0x2900('0x9'),auth['isAuthenticated'](),controller[_0x2900('0xd')]);router[_0x2900('0xe')](_0x2900('0x9'),auth[_0x2900('0xf')](),controller[_0x2900('0x10')]);module[_0x2900('0x11')]=router; \ No newline at end of file +var _0x7845=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','/:id'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7845,0xbe));var _0x5784=function(_0x3d6a0c,_0x2a6199){_0x3d6a0c=_0x3d6a0c-0x0;var _0x1e95a2=_0x7845[_0x3d6a0c];return _0x1e95a2;};'use strict';var multer=require(_0x5784('0x0'));var util=require(_0x5784('0x1'));var path=require(_0x5784('0x2'));var timeout=require(_0x5784('0x3'));var express=require(_0x5784('0x4'));var router=express[_0x5784('0x5')]();var fs_extra=require(_0x5784('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5784('0x7'));var config=require(_0x5784('0x8'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x5784('0x9')](),controller[_0x5784('0xa')]);router['get']('/:id',auth[_0x5784('0x9')](),controller[_0x5784('0xb')]);router[_0x5784('0xc')]('/',auth[_0x5784('0x9')](),controller['create']);router['put'](_0x5784('0xd'),auth[_0x5784('0x9')](),controller[_0x5784('0xe')]);router[_0x5784('0xf')](_0x5784('0xd'),auth[_0x5784('0x9')](),controller[_0x5784('0x10')]);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 8fdf305..e77bce0 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 _0x433e=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x411498,_0x3a294b){var _0x329eec=function(_0x1ffd4d){while(--_0x1ffd4d){_0x411498['push'](_0x411498['shift']());}};_0x329eec(++_0x3a294b);}(_0x433e,0xce));var _0xe433=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x433e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe433('0x0'));module[_0xe433('0x1')]={'type':{'type':Sequelize[_0xe433('0x2')](_0xe433('0x3'),'variable',_0xe433('0x4'),_0xe433('0x5'),_0xe433('0x6')),'defaultValue':_0xe433('0x3')},'content':{'type':Sequelize[_0xe433('0x7')]},'key':{'type':Sequelize[_0xe433('0x7')]},'keyType':{'type':Sequelize[_0xe433('0x2')]('string',_0xe433('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xe433('0x7')]},'idField':{'type':Sequelize[_0xe433('0x7')]},'nameField':{'type':Sequelize[_0xe433('0x7')]},'customField':{'type':Sequelize[_0xe433('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe433('0x7')]}}; \ No newline at end of file +var _0xcdb0=['sequelize','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN'];(function(_0x54d00d,_0x3a4bd1){var _0x227c26=function(_0x5cfb89){while(--_0x5cfb89){_0x54d00d['push'](_0x54d00d['shift']());}};_0x227c26(++_0x3a4bd1);}(_0xcdb0,0x1f0));var _0x0cdb=function(_0x1db22e,_0x3af678){_0x1db22e=_0x1db22e-0x0;var _0x552045=_0xcdb0[_0x1db22e];return _0x552045;};'use strict';var Sequelize=require(_0x0cdb('0x0'));module['exports']={'type':{'type':Sequelize[_0x0cdb('0x1')](_0x0cdb('0x2'),_0x0cdb('0x3'),'customVariable','keyValue',_0x0cdb('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0cdb('0x5')]},'key':{'type':Sequelize[_0x0cdb('0x5')]},'keyType':{'type':Sequelize[_0x0cdb('0x1')]('string',_0x0cdb('0x3'),_0x0cdb('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0cdb('0x5')]},'customField':{'type':Sequelize[_0x0cdb('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0cdb('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 90ed299..b2490ad 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 _0x8986=['fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','include','rows','show','includeAll','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','error','stack','name','index','map','ServicenowField','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x1bec21,_0x1c0ba6){var _0x1ff185=function(_0x584200){while(--_0x584200){_0x1bec21['push'](_0x1bec21['shift']());}};_0x1ff185(++_0x1c0ba6);}(_0x8986,0x132));var _0x6898=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8986[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6898('0x0'));var zipdir=require(_0x6898('0x1'));var jsonpatch=require(_0x6898('0x2'));var rp=require(_0x6898('0x3'));var moment=require(_0x6898('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6898('0x5'));var path=require(_0x6898('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6898('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6898('0x8'));var squel=require(_0x6898('0x9'));var crypto=require(_0x6898('0xa'));var jsforce=require(_0x6898('0xb'));var deskjs=require(_0x6898('0xc'));var toCsv=require(_0x6898('0xd'));var querystring=require(_0x6898('0xe'));var Papa=require('papaparse');var Redis=require(_0x6898('0xf'));var authService=require(_0x6898('0x10'));var qs=require(_0x6898('0x11'));var as=require(_0x6898('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6898('0x13'));var utils=require(_0x6898('0x14'));var config=require(_0x6898('0x15'));var licenseUtil=require(_0x6898('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x365c37,_0x1225a0){_0x1225a0=_0x1225a0||0xcc;return function(_0x3fff8e){if(_0x3fff8e){return _0x365c37[_0x6898('0x17')](_0x1225a0);}return _0x365c37[_0x6898('0x18')](_0x1225a0)[_0x6898('0x19')]();};}function respondWithResult(_0x4f25a4,_0x176756){_0x176756=_0x176756||0xc8;return function(_0x3fb9b7){if(_0x3fb9b7){return _0x4f25a4[_0x6898('0x18')](_0x176756)[_0x6898('0x1a')](_0x3fb9b7);}};}function respondWithFilteredResult(_0x157fdd,_0x4b45c5){return function(_0x3ec4f1){if(_0x3ec4f1){var _0x2db1b3=typeof _0x4b45c5['offset']===_0x6898('0x1b')&&typeof _0x4b45c5[_0x6898('0x1c')]===_0x6898('0x1b');var _0x59e0c0=_0x3ec4f1[_0x6898('0x1d')];var _0x20e546=_0x2db1b3?0x0:_0x4b45c5[_0x6898('0x1e')];var _0x4c3d57=_0x2db1b3?_0x3ec4f1[_0x6898('0x1d')]:_0x4b45c5[_0x6898('0x1e')]+_0x4b45c5[_0x6898('0x1c')];var _0x2d43bb;if(_0x4c3d57>=_0x59e0c0){_0x4c3d57=_0x59e0c0;_0x2d43bb=0xc8;}else{_0x2d43bb=0xce;}_0x157fdd['status'](_0x2d43bb);return _0x157fdd[_0x6898('0x1f')](_0x6898('0x20'),_0x20e546+'-'+_0x4c3d57+'/'+_0x59e0c0)[_0x6898('0x1a')](_0x3ec4f1);}return null;};}function patchUpdates(_0x655417){return function(_0x50c7a7){try{jsonpatch[_0x6898('0x21')](_0x50c7a7,_0x655417,!![]);}catch(_0x48a996){return BPromise['reject'](_0x48a996);}return _0x50c7a7['save']();};}function saveUpdates(_0x4f4838,_0x21b036){return function(_0x1c03f4){if(_0x1c03f4){return _0x1c03f4[_0x6898('0x22')](_0x4f4838)[_0x6898('0x23')](function(_0x5e52bf){return _0x5e52bf;});}return null;};}function removeEntity(_0x2ddab7,_0x10db7f){return function(_0x57c0e5){if(_0x57c0e5){return _0x57c0e5['destroy']()[_0x6898('0x23')](function(){_0x2ddab7[_0x6898('0x18')](0xcc)[_0x6898('0x19')]();});}};}function handleEntityNotFound(_0x279611,_0x29b9af){return function(_0x53e795){if(!_0x53e795){_0x279611[_0x6898('0x17')](0x194);}return _0x53e795;};}function handleError(_0x49eb7d,_0x1cd8eb){_0x1cd8eb=_0x1cd8eb||0x1f4;return function(_0x485fc5){logger[_0x6898('0x24')](_0x485fc5[_0x6898('0x25')]);if(_0x485fc5[_0x6898('0x26')]){delete _0x485fc5[_0x6898('0x26')];}_0x49eb7d[_0x6898('0x18')](_0x1cd8eb)['send'](_0x485fc5);};}exports[_0x6898('0x27')]=function(_0x3b2135,_0x34d33e){var _0x25b69a={},_0x4e75f2={},_0x176c4b={'count':0x0,'rows':[]};var _0x2c397a=_[_0x6898('0x28')](db[_0x6898('0x29')][_0x6898('0x2a')],function(_0x18ec3f){return{'name':_0x18ec3f[_0x6898('0x2b')],'type':_0x18ec3f['type'][_0x6898('0x2c')]};});_0x4e75f2[_0x6898('0x2d')]=_[_0x6898('0x28')](_0x2c397a,_0x6898('0x26'));_0x4e75f2[_0x6898('0x2e')]=_[_0x6898('0x2f')](_0x3b2135[_0x6898('0x2e')]);_0x4e75f2['filters']=_['intersection'](_0x4e75f2[_0x6898('0x2d')],_0x4e75f2[_0x6898('0x2e')]);_0x25b69a['attributes']=_[_0x6898('0x30')](_0x4e75f2[_0x6898('0x2d')],qs[_0x6898('0x31')](_0x3b2135[_0x6898('0x2e')][_0x6898('0x31')]));_0x25b69a[_0x6898('0x32')]=_0x25b69a[_0x6898('0x32')][_0x6898('0x33')]?_0x25b69a['attributes']:_0x4e75f2['model'];if(!_0x3b2135[_0x6898('0x2e')][_0x6898('0x34')]('nolimit')){_0x25b69a[_0x6898('0x1c')]=qs['limit'](_0x3b2135[_0x6898('0x2e')][_0x6898('0x1c')]);_0x25b69a[_0x6898('0x1e')]=qs[_0x6898('0x1e')](_0x3b2135['query'][_0x6898('0x1e')]);}_0x25b69a[_0x6898('0x35')]=qs['sort'](_0x3b2135['query'][_0x6898('0x36')]);_0x25b69a[_0x6898('0x37')]=qs[_0x6898('0x38')](_[_0x6898('0x39')](_0x3b2135[_0x6898('0x2e')],_0x4e75f2[_0x6898('0x38')]),_0x2c397a);if(_0x3b2135['query'][_0x6898('0x3a')]){_0x25b69a[_0x6898('0x37')]=_[_0x6898('0x3b')](_0x25b69a[_0x6898('0x37')],{'$or':_[_0x6898('0x28')](_0x2c397a,function(_0x524f2b){if(_0x524f2b[_0x6898('0x3c')]!=='VIRTUAL'){var _0x11c555={};_0x11c555[_0x524f2b[_0x6898('0x26')]]={'$like':'%'+_0x3b2135[_0x6898('0x2e')][_0x6898('0x3a')]+'%'};return _0x11c555;}})});}_0x25b69a=_[_0x6898('0x3b')]({},_0x25b69a,_0x3b2135[_0x6898('0x3d')]);var _0x33d7f5={'where':_0x25b69a[_0x6898('0x37')]};return db[_0x6898('0x29')]['count'](_0x33d7f5)[_0x6898('0x23')](function(_0x46bf0f){_0x176c4b[_0x6898('0x1d')]=_0x46bf0f;if(_0x3b2135[_0x6898('0x2e')]['includeAll']){_0x25b69a[_0x6898('0x3e')]=[{'all':!![]}];}return db[_0x6898('0x29')]['findAll'](_0x25b69a);})[_0x6898('0x23')](function(_0x16cd35){_0x176c4b[_0x6898('0x3f')]=_0x16cd35;return _0x176c4b;})['then'](respondWithFilteredResult(_0x34d33e,_0x25b69a))['catch'](handleError(_0x34d33e,null));};exports[_0x6898('0x40')]=function(_0x5972bf,_0x5b2b15){var _0x2fa659={'raw':!![],'where':{'id':_0x5972bf['params']['id']}},_0x4be5e1={};_0x4be5e1['model']=_[_0x6898('0x2f')](db['ServicenowField'][_0x6898('0x2a')]);_0x4be5e1[_0x6898('0x2e')]=_[_0x6898('0x2f')](_0x5972bf[_0x6898('0x2e')]);_0x4be5e1['filters']=_[_0x6898('0x30')](_0x4be5e1[_0x6898('0x2d')],_0x4be5e1[_0x6898('0x2e')]);_0x2fa659[_0x6898('0x32')]=_[_0x6898('0x30')](_0x4be5e1[_0x6898('0x2d')],qs[_0x6898('0x31')](_0x5972bf[_0x6898('0x2e')]['fields']));_0x2fa659[_0x6898('0x32')]=_0x2fa659[_0x6898('0x32')][_0x6898('0x33')]?_0x2fa659['attributes']:_0x4be5e1['model'];if(_0x5972bf[_0x6898('0x2e')][_0x6898('0x41')]){_0x2fa659[_0x6898('0x3e')]=[{'all':!![]}];}_0x2fa659=_['merge']({},_0x2fa659,_0x5972bf[_0x6898('0x3d')]);return db[_0x6898('0x29')][_0x6898('0x42')](_0x2fa659)[_0x6898('0x23')](handleEntityNotFound(_0x5b2b15,null))['then'](respondWithResult(_0x5b2b15,null))[_0x6898('0x43')](handleError(_0x5b2b15,null));};exports[_0x6898('0x44')]=function(_0x1dab83,_0x417b89){return db[_0x6898('0x29')][_0x6898('0x44')](_0x1dab83[_0x6898('0x45')],{})['then'](respondWithResult(_0x417b89,0xc9))[_0x6898('0x43')](handleError(_0x417b89,null));};exports[_0x6898('0x22')]=function(_0x379569,_0x2406ff){if(_0x379569[_0x6898('0x45')]['id']){delete _0x379569['body']['id'];}return db[_0x6898('0x29')]['find']({'where':{'id':_0x379569[_0x6898('0x46')]['id']}})[_0x6898('0x23')](handleEntityNotFound(_0x2406ff,null))['then'](saveUpdates(_0x379569['body'],null))[_0x6898('0x23')](respondWithResult(_0x2406ff,null))[_0x6898('0x43')](handleError(_0x2406ff,null));};exports['destroy']=function(_0x25355c,_0x2c75a3){return db[_0x6898('0x29')][_0x6898('0x42')]({'where':{'id':_0x25355c[_0x6898('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c75a3,null))[_0x6898('0x23')](removeEntity(_0x2c75a3,null))['catch'](handleError(_0x2c75a3,null));}; \ No newline at end of file +var _0x0ee6=['save','then','destroy','error','name','send','index','ServicenowField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','include','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply'];(function(_0x42dfc7,_0x1f6121){var _0x3214cb=function(_0x28d7cf){while(--_0x28d7cf){_0x42dfc7['push'](_0x42dfc7['shift']());}};_0x3214cb(++_0x1f6121);}(_0x0ee6,0xf3));var _0x60ee=function(_0x31dc55,_0x3c9b04){_0x31dc55=_0x31dc55-0x0;var _0x392a87=_0x0ee6[_0x31dc55];return _0x392a87;};'use strict';var emlformat=require(_0x60ee('0x0'));var rimraf=require(_0x60ee('0x1'));var zipdir=require(_0x60ee('0x2'));var jsonpatch=require(_0x60ee('0x3'));var rp=require(_0x60ee('0x4'));var moment=require('moment');var BPromise=require(_0x60ee('0x5'));var Mustache=require('mustache');var util=require(_0x60ee('0x6'));var path=require(_0x60ee('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x60ee('0x8'));var fs=require('fs');var fs_extra=require(_0x60ee('0x9'));var _=require(_0x60ee('0xa'));var squel=require(_0x60ee('0xb'));var crypto=require(_0x60ee('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x60ee('0xd'));var querystring=require(_0x60ee('0xe'));var Papa=require(_0x60ee('0xf'));var Redis=require(_0x60ee('0x10'));var authService=require(_0x60ee('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x60ee('0x12'));var hardwareService=require(_0x60ee('0x13'));var logger=require('../../config/logger')(_0x60ee('0x14'));var utils=require(_0x60ee('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x60ee('0x16'))['db'];function respondWithStatusCode(_0x53df31,_0x508999){_0x508999=_0x508999||0xcc;return function(_0x8700c1){if(_0x8700c1){return _0x53df31[_0x60ee('0x17')](_0x508999);}return _0x53df31[_0x60ee('0x18')](_0x508999)[_0x60ee('0x19')]();};}function respondWithResult(_0x50bfd7,_0x3588ff){_0x3588ff=_0x3588ff||0xc8;return function(_0x308886){if(_0x308886){return _0x50bfd7['status'](_0x3588ff)['json'](_0x308886);}};}function respondWithFilteredResult(_0x2f94a7,_0x58e699){return function(_0x4bb7d3){if(_0x4bb7d3){var _0x3fbfd1=typeof _0x58e699[_0x60ee('0x1a')]===_0x60ee('0x1b')&&typeof _0x58e699['limit']===_0x60ee('0x1b');var _0x65d3f3=_0x4bb7d3[_0x60ee('0x1c')];var _0x440b75=_0x3fbfd1?0x0:_0x58e699[_0x60ee('0x1a')];var _0x13ae5b=_0x3fbfd1?_0x4bb7d3[_0x60ee('0x1c')]:_0x58e699[_0x60ee('0x1a')]+_0x58e699[_0x60ee('0x1d')];var _0x647f0e;if(_0x13ae5b>=_0x65d3f3){_0x13ae5b=_0x65d3f3;_0x647f0e=0xc8;}else{_0x647f0e=0xce;}_0x2f94a7[_0x60ee('0x18')](_0x647f0e);return _0x2f94a7[_0x60ee('0x1e')]('Content-Range',_0x440b75+'-'+_0x13ae5b+'/'+_0x65d3f3)[_0x60ee('0x1f')](_0x4bb7d3);}return null;};}function patchUpdates(_0x106eb0){return function(_0x2183e7){try{jsonpatch[_0x60ee('0x20')](_0x2183e7,_0x106eb0,!![]);}catch(_0x2bc3e0){return BPromise['reject'](_0x2bc3e0);}return _0x2183e7[_0x60ee('0x21')]();};}function saveUpdates(_0x178960,_0x126112){return function(_0x403676){if(_0x403676){return _0x403676['update'](_0x178960)[_0x60ee('0x22')](function(_0x20571e){return _0x20571e;});}return null;};}function removeEntity(_0x31ea3f,_0x330904){return function(_0x294f76){if(_0x294f76){return _0x294f76[_0x60ee('0x23')]()[_0x60ee('0x22')](function(){_0x31ea3f[_0x60ee('0x18')](0xcc)[_0x60ee('0x19')]();});}};}function handleEntityNotFound(_0x51d2dc,_0x56de34){return function(_0x4d6aa3){if(!_0x4d6aa3){_0x51d2dc[_0x60ee('0x17')](0x194);}return _0x4d6aa3;};}function handleError(_0x5a9a0a,_0x391a2d){_0x391a2d=_0x391a2d||0x1f4;return function(_0x1affb5){logger[_0x60ee('0x24')](_0x1affb5['stack']);if(_0x1affb5[_0x60ee('0x25')]){delete _0x1affb5['name'];}_0x5a9a0a[_0x60ee('0x18')](_0x391a2d)[_0x60ee('0x26')](_0x1affb5);};}exports[_0x60ee('0x27')]=function(_0x1d6b30,_0x40b29e){var _0x330af0={},_0x497aee={},_0x500e72={'count':0x0,'rows':[]};var _0x49a72d=_['map'](db[_0x60ee('0x28')][_0x60ee('0x29')],function(_0x1aaefa){return{'name':_0x1aaefa['fieldName'],'type':_0x1aaefa[_0x60ee('0x2a')][_0x60ee('0x2b')]};});_0x497aee[_0x60ee('0x2c')]=_[_0x60ee('0x2d')](_0x49a72d,_0x60ee('0x25'));_0x497aee[_0x60ee('0x2e')]=_[_0x60ee('0x2f')](_0x1d6b30[_0x60ee('0x2e')]);_0x497aee[_0x60ee('0x30')]=_[_0x60ee('0x31')](_0x497aee['model'],_0x497aee[_0x60ee('0x2e')]);_0x330af0[_0x60ee('0x32')]=_[_0x60ee('0x31')](_0x497aee['model'],qs[_0x60ee('0x33')](_0x1d6b30[_0x60ee('0x2e')][_0x60ee('0x33')]));_0x330af0[_0x60ee('0x32')]=_0x330af0['attributes'][_0x60ee('0x34')]?_0x330af0[_0x60ee('0x32')]:_0x497aee[_0x60ee('0x2c')];if(!_0x1d6b30['query'][_0x60ee('0x35')]('nolimit')){_0x330af0['limit']=qs['limit'](_0x1d6b30[_0x60ee('0x2e')][_0x60ee('0x1d')]);_0x330af0[_0x60ee('0x1a')]=qs['offset'](_0x1d6b30[_0x60ee('0x2e')][_0x60ee('0x1a')]);}_0x330af0['order']=qs[_0x60ee('0x36')](_0x1d6b30[_0x60ee('0x2e')][_0x60ee('0x36')]);_0x330af0[_0x60ee('0x37')]=qs[_0x60ee('0x30')](_[_0x60ee('0x38')](_0x1d6b30[_0x60ee('0x2e')],_0x497aee[_0x60ee('0x30')]),_0x49a72d);if(_0x1d6b30[_0x60ee('0x2e')][_0x60ee('0x39')]){_0x330af0[_0x60ee('0x37')]=_[_0x60ee('0x3a')](_0x330af0[_0x60ee('0x37')],{'$or':_[_0x60ee('0x2d')](_0x49a72d,function(_0x4616f2){if(_0x4616f2[_0x60ee('0x2a')]!=='VIRTUAL'){var _0x5926af={};_0x5926af[_0x4616f2['name']]={'$like':'%'+_0x1d6b30['query'][_0x60ee('0x39')]+'%'};return _0x5926af;}})});}_0x330af0=_['merge']({},_0x330af0,_0x1d6b30[_0x60ee('0x3b')]);var _0x4c6ed8={'where':_0x330af0['where']};return db[_0x60ee('0x28')][_0x60ee('0x1c')](_0x4c6ed8)[_0x60ee('0x22')](function(_0x372235){_0x500e72[_0x60ee('0x1c')]=_0x372235;if(_0x1d6b30[_0x60ee('0x2e')][_0x60ee('0x3c')]){_0x330af0['include']=[{'all':!![]}];}return db[_0x60ee('0x28')]['findAll'](_0x330af0);})[_0x60ee('0x22')](function(_0x4fbd59){_0x500e72['rows']=_0x4fbd59;return _0x500e72;})[_0x60ee('0x22')](respondWithFilteredResult(_0x40b29e,_0x330af0))[_0x60ee('0x3d')](handleError(_0x40b29e,null));};exports[_0x60ee('0x3e')]=function(_0x11efee,_0x490dfe){var _0x4ebf09={'raw':!![],'where':{'id':_0x11efee['params']['id']}},_0x4fdf02={};_0x4fdf02[_0x60ee('0x2c')]=_['keys'](db[_0x60ee('0x28')]['rawAttributes']);_0x4fdf02['query']=_[_0x60ee('0x2f')](_0x11efee['query']);_0x4fdf02['filters']=_[_0x60ee('0x31')](_0x4fdf02[_0x60ee('0x2c')],_0x4fdf02[_0x60ee('0x2e')]);_0x4ebf09['attributes']=_[_0x60ee('0x31')](_0x4fdf02[_0x60ee('0x2c')],qs['fields'](_0x11efee[_0x60ee('0x2e')][_0x60ee('0x33')]));_0x4ebf09[_0x60ee('0x32')]=_0x4ebf09[_0x60ee('0x32')][_0x60ee('0x34')]?_0x4ebf09['attributes']:_0x4fdf02[_0x60ee('0x2c')];if(_0x11efee[_0x60ee('0x2e')][_0x60ee('0x3c')]){_0x4ebf09[_0x60ee('0x3f')]=[{'all':!![]}];}_0x4ebf09=_['merge']({},_0x4ebf09,_0x11efee[_0x60ee('0x3b')]);return db[_0x60ee('0x28')][_0x60ee('0x40')](_0x4ebf09)[_0x60ee('0x22')](handleEntityNotFound(_0x490dfe,null))[_0x60ee('0x22')](respondWithResult(_0x490dfe,null))['catch'](handleError(_0x490dfe,null));};exports[_0x60ee('0x41')]=function(_0x531adb,_0x17e3cc){return db[_0x60ee('0x28')][_0x60ee('0x41')](_0x531adb[_0x60ee('0x42')],{})[_0x60ee('0x22')](respondWithResult(_0x17e3cc,0xc9))['catch'](handleError(_0x17e3cc,null));};exports[_0x60ee('0x43')]=function(_0x534453,_0x43ea6e){if(_0x534453[_0x60ee('0x42')]['id']){delete _0x534453['body']['id'];}return db['ServicenowField'][_0x60ee('0x40')]({'where':{'id':_0x534453['params']['id']}})[_0x60ee('0x22')](handleEntityNotFound(_0x43ea6e,null))[_0x60ee('0x22')](saveUpdates(_0x534453['body'],null))[_0x60ee('0x22')](respondWithResult(_0x43ea6e,null))['catch'](handleError(_0x43ea6e,null));};exports[_0x60ee('0x23')]=function(_0x2802bb,_0x836c64){return db['ServicenowField']['find']({'where':{'id':_0x2802bb[_0x60ee('0x44')]['id']}})['then'](handleEntityNotFound(_0x836c64,null))['then'](removeEntity(_0x836c64,null))[_0x60ee('0x3d')](handleError(_0x836c64,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8af10fb..f321bb0 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 _0x86fb=['rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x86fb,0x179));var _0xb86f=function(_0x318f7f,_0x392591){_0x318f7f=_0x318f7f-0x0;var _0x5a38a3=_0x86fb[_0x318f7f];return _0x5a38a3;};'use strict';var _=require(_0xb86f('0x0'));var util=require(_0xb86f('0x1'));var logger=require(_0xb86f('0x2'))(_0xb86f('0x3'));var moment=require(_0xb86f('0x4'));var BPromise=require(_0xb86f('0x5'));var rp=require(_0xb86f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb86f('0x7'));var config=require(_0xb86f('0x8'));var attributes=require(_0xb86f('0x9'));module[_0xb86f('0xa')]=function(_0x56103d,_0x2dee98){return _0x56103d[_0xb86f('0xb')]('ServicenowField',attributes,{'tableName':_0xb86f('0xc'),'paranoid':![],'indexes':[{'name':_0xb86f('0xd'),'fields':[_0xb86f('0xe'),_0xb86f('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe9c6=['util','api','bluebird','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0x467c2e,_0x4eceb2){var _0x4c785b=function(_0x1a573c){while(--_0x1a573c){_0x467c2e['push'](_0x467c2e['shift']());}};_0x4c785b(++_0x4eceb2);}(_0xe9c6,0xa9));var _0x6e9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe9c6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x6e9c('0x0'));var logger=require('../../config/logger')(_0x6e9c('0x1'));var moment=require('moment');var BPromise=require(_0x6e9c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e9c('0x3'));var rimraf=require('rimraf');var config=require(_0x6e9c('0x4'));var attributes=require(_0x6e9c('0x5'));module[_0x6e9c('0x6')]=function(_0x1f3e36,_0x10f69a){return _0x1f3e36[_0x6e9c('0x7')](_0x6e9c('0x8'),attributes,{'tableName':_0x6e9c('0x9'),'paranoid':![],'indexes':[{'name':_0x6e9c('0xa'),'fields':[_0x6e9c('0xb'),_0x6e9c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 4f1e214..c090193 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 _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x4364bf,_0x266759){_0x4364bf=_0x4364bf-0x0;var _0x13b177=_0xac4a[_0x4364bf];return _0x13b177;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x197c43,_0x57f99e){var _0x2e722a=function(_0xced4b9){while(--_0xced4b9){_0x197c43['push'](_0x197c43['shift']());}};_0x2e722a(++_0x57f99e);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x526a2b,_0x4726bb){_0x526a2b=_0x526a2b-0x0;var _0x27df6c=_0x9ffd[_0x526a2b];return _0x27df6c;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 2c4d16c..fd9aefe 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(_0x1f03d8,_0x4fed6a){var _0x537c20=function(_0x42ffa3){while(--_0x42ffa3){_0x1f03d8['push'](_0x1f03d8['shift']());}};_0x537c20(++_0x4fed6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x10b194,_0x5c9d14){var _0x1780b6=function(_0x13167d){while(--_0x13167d){_0x10b194['push'](_0x10b194['shift']());}};_0x1780b6(++_0x5c9d14);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 eb94366..a9b79ca 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(_0x1f5e64,_0x3313f5){var _0x50a7d1=function(_0xd79f99){while(--_0xd79f99){_0x1f5e64['push'](_0x1f5e64['shift']());}};_0x50a7d1(++_0x3313f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x5bfe3b,_0x28fa57){var _0x1029c2=function(_0x473abe){while(--_0x473abe){_0x5bfe3b['push'](_0x5bfe3b['shift']());}};_0x1029c2(++_0x28fa57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 f49173d..2bdbd06 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 _0xc3ed=['includes','label','endsWith','value','test','statusCode','error','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','name','send','map','SugarcrmAccount','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','catch','filters','length','find','create','body','params','getConfigurations','findOne','keys','SugarcrmConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','module_fields'];(function(_0x452bc1,_0x398edb){var _0x449fd0=function(_0x9f1b38){while(--_0x9f1b38){_0x452bc1['push'](_0x452bc1['shift']());}};_0x449fd0(++_0x398edb);}(_0xc3ed,0x7e));var _0xdc3e=function(_0x559fb6,_0x29408b){_0x559fb6=_0x559fb6-0x0;var _0x270b89=_0xc3ed[_0x559fb6];return _0x270b89;};'use strict';var emlformat=require(_0xdc3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc3e('0x1'));var jsonpatch=require(_0xdc3e('0x2'));var rp=require('request-promise');var moment=require(_0xdc3e('0x3'));var BPromise=require(_0xdc3e('0x4'));var Mustache=require(_0xdc3e('0x5'));var util=require(_0xdc3e('0x6'));var path=require(_0xdc3e('0x7'));var sox=require('sox');var csv=require(_0xdc3e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc3e('0x9'));var _=require(_0xdc3e('0xa'));var squel=require(_0xdc3e('0xb'));var crypto=require(_0xdc3e('0xc'));var jsforce=require(_0xdc3e('0xd'));var deskjs=require(_0xdc3e('0xe'));var toCsv=require(_0xdc3e('0x8'));var querystring=require(_0xdc3e('0xf'));var Papa=require(_0xdc3e('0x10'));var Redis=require(_0xdc3e('0x11'));var authService=require(_0xdc3e('0x12'));var qs=require(_0xdc3e('0x13'));var as=require(_0xdc3e('0x14'));var hardwareService=require(_0xdc3e('0x15'));var logger=require(_0xdc3e('0x16'))('api');var utils=require(_0xdc3e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdc3e('0x18'));var db=require(_0xdc3e('0x19'))['db'];var integrations=require(_0xdc3e('0x1a'));function respondWithStatusCode(_0x57fd75,_0x457ea5){_0x457ea5=_0x457ea5||0xcc;return function(_0x2b65fe){if(_0x2b65fe){return _0x57fd75[_0xdc3e('0x1b')](_0x457ea5);}return _0x57fd75[_0xdc3e('0x1c')](_0x457ea5)[_0xdc3e('0x1d')]();};}function respondWithResult(_0x18e402,_0x30fc45){_0x30fc45=_0x30fc45||0xc8;return function(_0x5a2412){if(_0x5a2412){return _0x18e402[_0xdc3e('0x1c')](_0x30fc45)[_0xdc3e('0x1e')](_0x5a2412);}};}function respondWithFilteredResult(_0x49210d,_0x4ff6ef){return function(_0x424b86){if(_0x424b86){var _0x27450d=typeof _0x4ff6ef[_0xdc3e('0x1f')]===_0xdc3e('0x20')&&typeof _0x4ff6ef[_0xdc3e('0x21')]===_0xdc3e('0x20');var _0x5dbde7=_0x424b86[_0xdc3e('0x22')];var _0x41d7ed=_0x27450d?0x0:_0x4ff6ef[_0xdc3e('0x1f')];var _0x29570c=_0x27450d?_0x424b86[_0xdc3e('0x22')]:_0x4ff6ef[_0xdc3e('0x1f')]+_0x4ff6ef[_0xdc3e('0x21')];var _0x589e91;if(_0x29570c>=_0x5dbde7){_0x29570c=_0x5dbde7;_0x589e91=0xc8;}else{_0x589e91=0xce;}_0x49210d[_0xdc3e('0x1c')](_0x589e91);return _0x49210d[_0xdc3e('0x23')]('Content-Range',_0x41d7ed+'-'+_0x29570c+'/'+_0x5dbde7)[_0xdc3e('0x1e')](_0x424b86);}return null;};}function patchUpdates(_0x1c6505){return function(_0xf5350e){try{jsonpatch[_0xdc3e('0x24')](_0xf5350e,_0x1c6505,!![]);}catch(_0x359fa8){return BPromise['reject'](_0x359fa8);}return _0xf5350e[_0xdc3e('0x25')]();};}function saveUpdates(_0x2bdbd5,_0x53756e){return function(_0x3133ac){if(_0x3133ac){return _0x3133ac[_0xdc3e('0x26')](_0x2bdbd5)[_0xdc3e('0x27')](function(_0x22cf72){return _0x22cf72;});}return null;};}function removeEntity(_0x248051,_0x1fecca){return function(_0x119722){if(_0x119722){return _0x119722[_0xdc3e('0x28')]()[_0xdc3e('0x27')](function(){_0x248051['status'](0xcc)[_0xdc3e('0x1d')]();});}};}function handleEntityNotFound(_0x34e52b,_0x36ea57){return function(_0xb27b37){if(!_0xb27b37){_0x34e52b['sendStatus'](0x194);}return _0xb27b37;};}function handleError(_0x22bd18,_0x353f05){_0x353f05=_0x353f05||0x1f4;return function(_0x44d920){logger['error'](_0x44d920['stack']);if(_0x44d920[_0xdc3e('0x29')]){delete _0x44d920[_0xdc3e('0x29')];}_0x22bd18[_0xdc3e('0x1c')](_0x353f05)[_0xdc3e('0x2a')](_0x44d920);};}exports['index']=function(_0x1b1508,_0x157ac3){var _0x4d1423={},_0x1ee30e={},_0x3c1f3f={'count':0x0,'rows':[]};var _0x57afc9=_[_0xdc3e('0x2b')](db[_0xdc3e('0x2c')]['rawAttributes'],function(_0x33bbcb){return{'name':_0x33bbcb[_0xdc3e('0x2d')],'type':_0x33bbcb[_0xdc3e('0x2e')]['key']};});_0x1ee30e[_0xdc3e('0x2f')]=_['map'](_0x57afc9,_0xdc3e('0x29'));_0x1ee30e['query']=_['keys'](_0x1b1508[_0xdc3e('0x30')]);_0x1ee30e['filters']=_[_0xdc3e('0x31')](_0x1ee30e['model'],_0x1ee30e['query']);_0x4d1423[_0xdc3e('0x32')]=_[_0xdc3e('0x31')](_0x1ee30e[_0xdc3e('0x2f')],qs[_0xdc3e('0x33')](_0x1b1508[_0xdc3e('0x30')][_0xdc3e('0x33')]));_0x4d1423[_0xdc3e('0x32')]=_0x4d1423[_0xdc3e('0x32')]['length']?_0x4d1423[_0xdc3e('0x32')]:_0x1ee30e[_0xdc3e('0x2f')];if(!_0x1b1508[_0xdc3e('0x30')][_0xdc3e('0x34')](_0xdc3e('0x35'))){_0x4d1423[_0xdc3e('0x21')]=qs[_0xdc3e('0x21')](_0x1b1508[_0xdc3e('0x30')]['limit']);_0x4d1423[_0xdc3e('0x1f')]=qs[_0xdc3e('0x1f')](_0x1b1508[_0xdc3e('0x30')][_0xdc3e('0x1f')]);}_0x4d1423[_0xdc3e('0x36')]=qs[_0xdc3e('0x37')](_0x1b1508['query'][_0xdc3e('0x37')]);_0x4d1423[_0xdc3e('0x38')]=qs['filters'](_[_0xdc3e('0x39')](_0x1b1508[_0xdc3e('0x30')],_0x1ee30e['filters']),_0x57afc9);if(_0x1b1508[_0xdc3e('0x30')]['filter']){_0x4d1423[_0xdc3e('0x38')]=_[_0xdc3e('0x3a')](_0x4d1423['where'],{'$or':_[_0xdc3e('0x2b')](_0x57afc9,function(_0x237dcd){if(_0x237dcd[_0xdc3e('0x2e')]!=='VIRTUAL'){var _0x2c0073={};_0x2c0073[_0x237dcd[_0xdc3e('0x29')]]={'$like':'%'+_0x1b1508[_0xdc3e('0x30')][_0xdc3e('0x3b')]+'%'};return _0x2c0073;}})});}_0x4d1423=_[_0xdc3e('0x3a')]({},_0x4d1423,_0x1b1508[_0xdc3e('0x3c')]);var _0x3c67bd={'where':_0x4d1423[_0xdc3e('0x38')]};return db[_0xdc3e('0x2c')][_0xdc3e('0x22')](_0x3c67bd)[_0xdc3e('0x27')](function(_0x3d7b3b){_0x3c1f3f[_0xdc3e('0x22')]=_0x3d7b3b;if(_0x1b1508[_0xdc3e('0x30')][_0xdc3e('0x3d')]){_0x4d1423[_0xdc3e('0x3e')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x4d1423);})[_0xdc3e('0x27')](function(_0x18c966){_0x3c1f3f['rows']=_0x18c966;return _0x3c1f3f;})['then'](respondWithFilteredResult(_0x157ac3,_0x4d1423))[_0xdc3e('0x3f')](handleError(_0x157ac3,null));};exports['show']=function(_0x59ee48,_0x49f207){var _0x88a664={'raw':![],'where':{'id':_0x59ee48['params']['id']}},_0x2a90c1={};_0x2a90c1[_0xdc3e('0x2f')]=_['keys'](db[_0xdc3e('0x2c')]['rawAttributes']);_0x2a90c1['query']=_['keys'](_0x59ee48[_0xdc3e('0x30')]);_0x2a90c1[_0xdc3e('0x40')]=_[_0xdc3e('0x31')](_0x2a90c1[_0xdc3e('0x2f')],_0x2a90c1[_0xdc3e('0x30')]);_0x88a664[_0xdc3e('0x32')]=_[_0xdc3e('0x31')](_0x2a90c1[_0xdc3e('0x2f')],qs[_0xdc3e('0x33')](_0x59ee48[_0xdc3e('0x30')][_0xdc3e('0x33')]));_0x88a664[_0xdc3e('0x32')]=_0x88a664[_0xdc3e('0x32')][_0xdc3e('0x41')]?_0x88a664['attributes']:_0x2a90c1[_0xdc3e('0x2f')];if(_0x59ee48[_0xdc3e('0x30')]['includeAll']){_0x88a664[_0xdc3e('0x3e')]=[{'all':!![]}];}_0x88a664=_['merge']({},_0x88a664,_0x59ee48[_0xdc3e('0x3c')]);return db[_0xdc3e('0x2c')][_0xdc3e('0x42')](_0x88a664)[_0xdc3e('0x27')](handleEntityNotFound(_0x49f207,null))[_0xdc3e('0x27')](respondWithResult(_0x49f207,null))[_0xdc3e('0x3f')](handleError(_0x49f207,null));};exports['create']=function(_0x49acab,_0x264653){return db['SugarcrmAccount'][_0xdc3e('0x43')](_0x49acab[_0xdc3e('0x44')],{})[_0xdc3e('0x27')](respondWithResult(_0x264653,0xc9))[_0xdc3e('0x3f')](handleError(_0x264653,null));};exports[_0xdc3e('0x26')]=function(_0x529a1c,_0x3b9432){if(_0x529a1c[_0xdc3e('0x44')]['id']){delete _0x529a1c['body']['id'];}return db[_0xdc3e('0x2c')][_0xdc3e('0x42')]({'where':{'id':_0x529a1c[_0xdc3e('0x45')]['id']}})[_0xdc3e('0x27')](handleEntityNotFound(_0x3b9432,null))[_0xdc3e('0x27')](saveUpdates(_0x529a1c[_0xdc3e('0x44')],null))[_0xdc3e('0x27')](respondWithResult(_0x3b9432,null))[_0xdc3e('0x3f')](handleError(_0x3b9432,null));};exports['destroy']=function(_0xaca3c4,_0x529287){return db[_0xdc3e('0x2c')]['find']({'where':{'id':_0xaca3c4[_0xdc3e('0x45')]['id']}})[_0xdc3e('0x27')](handleEntityNotFound(_0x529287,null))['then'](removeEntity(_0x529287,null))[_0xdc3e('0x3f')](handleError(_0x529287,null));};exports[_0xdc3e('0x46')]=function(_0x2bdcb2,_0x35ba85,_0x230c78){var _0x105270={};var _0x10dd8a={};var _0x511401;var _0x55c968;return db[_0xdc3e('0x2c')][_0xdc3e('0x47')]({'where':{'id':_0x2bdcb2[_0xdc3e('0x45')]['id']}})[_0xdc3e('0x27')](handleEntityNotFound(_0x35ba85,null))['then'](function(_0x55aaea){if(_0x55aaea){_0x511401=_0x55aaea;_0x10dd8a[_0xdc3e('0x2f')]=_[_0xdc3e('0x48')](db[_0xdc3e('0x49')]['rawAttributes']);_0x10dd8a[_0xdc3e('0x30')]=_[_0xdc3e('0x48')](_0x2bdcb2[_0xdc3e('0x30')]);_0x10dd8a['filters']=_[_0xdc3e('0x31')](_0x10dd8a[_0xdc3e('0x2f')],_0x10dd8a[_0xdc3e('0x30')]);_0x105270[_0xdc3e('0x32')]=_[_0xdc3e('0x31')](_0x10dd8a[_0xdc3e('0x2f')],qs[_0xdc3e('0x33')](_0x2bdcb2[_0xdc3e('0x30')]['fields']));_0x105270[_0xdc3e('0x32')]=_0x105270[_0xdc3e('0x32')][_0xdc3e('0x41')]?_0x105270[_0xdc3e('0x32')]:_0x10dd8a['model'];_0x105270[_0xdc3e('0x36')]=qs[_0xdc3e('0x37')](_0x2bdcb2['query'][_0xdc3e('0x37')]);_0x105270[_0xdc3e('0x38')]=qs[_0xdc3e('0x40')](_['pick'](_0x2bdcb2[_0xdc3e('0x30')],_0x10dd8a[_0xdc3e('0x40')]));if(_0x2bdcb2[_0xdc3e('0x30')][_0xdc3e('0x3b')]){_0x105270['where']=_[_0xdc3e('0x3a')](_0x105270[_0xdc3e('0x38')],{'$or':_[_0xdc3e('0x2b')](_0x105270[_0xdc3e('0x32')],function(_0x360b3f){var _0xf48e04={};_0xf48e04[_0x360b3f]={'$like':'%'+_0x2bdcb2[_0xdc3e('0x30')][_0xdc3e('0x3b')]+'%'};return _0xf48e04;})});}_0x105270=_[_0xdc3e('0x3a')]({},_0x105270,_0x2bdcb2[_0xdc3e('0x3c')]);return _0x511401[_0xdc3e('0x46')](_0x105270);}})['then'](function(_0x173693){if(_0x173693){_0x55c968=_0x173693[_0xdc3e('0x41')];if(!_0x2bdcb2[_0xdc3e('0x30')][_0xdc3e('0x34')](_0xdc3e('0x35'))){_0x105270[_0xdc3e('0x21')]=qs[_0xdc3e('0x21')](_0x2bdcb2['query'][_0xdc3e('0x21')]);_0x105270[_0xdc3e('0x1f')]=qs[_0xdc3e('0x1f')](_0x2bdcb2[_0xdc3e('0x30')][_0xdc3e('0x1f')]);}return _0x511401[_0xdc3e('0x46')](_0x105270);}})[_0xdc3e('0x27')](function(_0x50d8c3){if(_0x50d8c3){return _0x50d8c3?{'count':_0x55c968,'rows':_0x50d8c3}:null;}})['then'](respondWithResult(_0x35ba85,null))[_0xdc3e('0x3f')](handleError(_0x35ba85,null));};exports['addConfiguration']=function(_0x3ed464,_0x3a7c4c,_0x3b2790){if(_0x3ed464[_0xdc3e('0x44')]['id']){delete _0x3ed464[_0xdc3e('0x44')]['id'];}return db[_0xdc3e('0x2c')][_0xdc3e('0x47')]({'where':{'id':_0x3ed464[_0xdc3e('0x45')]['id']}})[_0xdc3e('0x27')](handleEntityNotFound(_0x3a7c4c,null))[_0xdc3e('0x27')](function(_0x470a64){if(_0x470a64){_0x3ed464[_0xdc3e('0x44')][_0xdc3e('0x4a')]=_0x470a64['id'];_0x3ed464[_0xdc3e('0x44')][_0xdc3e('0x4b')]=integrations[_0xdc3e('0x4c')](_0x3ed464['body']['channel'],_0x3ed464['body'][_0xdc3e('0x2e')]);_0x3ed464[_0xdc3e('0x44')]['Descriptions']=integrations['getDescriptions'](_0x3ed464['body'][_0xdc3e('0x4d')],_0x3ed464[_0xdc3e('0x44')][_0xdc3e('0x2e')]);return db['SugarcrmConfiguration'][_0xdc3e('0x43')](_0x3ed464['body'],{'include':[{'model':db[_0xdc3e('0x4e')],'as':_0xdc3e('0x4b')},{'model':db[_0xdc3e('0x4e')],'as':_0xdc3e('0x4f')}]});}return null;})['then'](respondWithResult(_0x3a7c4c,null))[_0xdc3e('0x3f')](handleError(_0x3a7c4c,null));};exports[_0xdc3e('0x50')]=function(_0x459c4,_0x314048,_0x373ad2){var _0x462ada='';var _0x153b4b=['id',_0xdc3e('0x29'),_0xdc3e('0x51'),_0xdc3e('0x52'),'description',_0xdc3e('0x53'),_0xdc3e('0x54'),_0xdc3e('0x55'),_0xdc3e('0x56'),_0xdc3e('0x57'),_0xdc3e('0x58'),_0xdc3e('0x59')];return db['SugarcrmAccount'][_0xdc3e('0x47')]({'where':{'id':_0x459c4[_0xdc3e('0x45')]['id']},'attributes':['id','username','password',_0xdc3e('0x5a')]})['then'](handleEntityNotFound(_0x314048,null))[_0xdc3e('0x27')](function(_0x1dffa9){if(_0x1dffa9){_0x462ada=_0x1dffa9[_0xdc3e('0x5a')];var _0x2bbd5d=_0x462ada[_0xdc3e('0x5b')](-0x1);if(_0x2bbd5d==='/'){_0x462ada=_0x462ada[_0xdc3e('0x5c')](0x0,_0x462ada[_0xdc3e('0x5d')](_0x2bbd5d));}return rp({'method':_0xdc3e('0x5e'),'uri':util['format'](_0xdc3e('0x5f'),_0x462ada,_0xdc3e('0x60')),'json':!![],'form':{'method':_0xdc3e('0x61'),'input_type':'JSON','response_type':_0xdc3e('0x62'),'rest_data':JSON[_0xdc3e('0x63')]({'user_auth':{'user_name':_0x1dffa9[_0xdc3e('0x64')],'password':_0x1dffa9['password'],'encryption':_0xdc3e('0x65')},'application':_0xdc3e('0x66')})}});}})[_0xdc3e('0x27')](function(_0x2cede2){if(_0x2cede2&&_0x2cede2[_0xdc3e('0x29')]!==_0xdc3e('0x67')&&_0x2cede2[_0xdc3e('0x29')]!==_0xdc3e('0x68')){return rp({'method':'POST','uri':util[_0xdc3e('0x69')](_0xdc3e('0x5f'),_0x462ada,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xdc3e('0x6a'),'input_type':_0xdc3e('0x62'),'response_type':_0xdc3e('0x62'),'rest_data':JSON[_0xdc3e('0x63')]({'session':_0x2cede2['id'],'module_name':_0xdc3e('0x6b')})}})['then'](function(_0x57a8a9){if(_0x57a8a9){var _0x421b93=_[_0xdc3e('0x6c')](_0x57a8a9[_0xdc3e('0x6d')]);_['remove'](_0x421b93,function(_0x29361d){return _0x153b4b[_0xdc3e('0x6e')](_0x29361d[_0xdc3e('0x29')]);});return{'count':_0x421b93['length'],'rows':_[_0xdc3e('0x2b')](_0x421b93,function(_0x4eca91){return{'id':_0x4eca91['name'],'name':_0x4eca91[_0xdc3e('0x6f')],'custom':_[_0xdc3e('0x70')](_0x4eca91[_0xdc3e('0x29')],'_c')?!![]:![],'options':_0x4eca91[_0xdc3e('0x3c')]?_[_0xdc3e('0x2b')](_[_0xdc3e('0x6c')](_0x4eca91['options']),function(_0x58b7b6){return{'name':_0x58b7b6[_0xdc3e('0x71')],'value':_0x58b7b6[_0xdc3e('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x314048,null))[_0xdc3e('0x3f')](function(_0x492dd9){var _0x1f6629=_0x459c4[_0xdc3e('0x30')][_0xdc3e('0x72')]?0x1f4:_0x492dd9[_0xdc3e('0x73')]||0x1f4;logger[_0xdc3e('0x74')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1f6629,JSON[_0xdc3e('0x63')](_0x492dd9));delete _0x492dd9[_0xdc3e('0x29')];if(_0x1f6629===0x191){_0x1f6629=0x190;}_0x314048['status'](_0x1f6629)['send'](_0x459c4[_0xdc3e('0x30')][_0xdc3e('0x72')]?{'message':_0xdc3e('0x75'),'statusCode':_0x492dd9[_0xdc3e('0x73')]}:_0x492dd9);});}else{var _0x1b7899=0x1f4;_0x314048[_0xdc3e('0x1c')](_0x1b7899)[_0xdc3e('0x2a')]({'message':_0xdc3e('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x4e46=['jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','catch','params','keys','include','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','date_start','duration_minutes','parent_type','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','values','module_fields','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x11407c,_0x1d4209){var _0x5326b0=function(_0x423be8){while(--_0x423be8){_0x11407c['push'](_0x11407c['shift']());}};_0x5326b0(++_0x1d4209);}(_0x4e46,0x19e));var _0x64e4=function(_0xe3e114,_0x59c8be){_0xe3e114=_0xe3e114-0x0;var _0x44c032=_0x4e46[_0xe3e114];return _0x44c032;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x64e4('0x0'));var BPromise=require(_0x64e4('0x1'));var Mustache=require(_0x64e4('0x2'));var util=require('util');var path=require(_0x64e4('0x3'));var sox=require(_0x64e4('0x4'));var csv=require(_0x64e4('0x5'));var ejs=require(_0x64e4('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64e4('0x7'));var squel=require(_0x64e4('0x8'));var crypto=require(_0x64e4('0x9'));var jsforce=require(_0x64e4('0xa'));var deskjs=require(_0x64e4('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x64e4('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x64e4('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64e4('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x64e4('0xf'));var licenseUtil=require(_0x64e4('0x10'));var db=require(_0x64e4('0x11'))['db'];var integrations=require(_0x64e4('0x12'));function respondWithStatusCode(_0x2612fa,_0x4f91f2){_0x4f91f2=_0x4f91f2||0xcc;return function(_0x3754bb){if(_0x3754bb){return _0x2612fa[_0x64e4('0x13')](_0x4f91f2);}return _0x2612fa[_0x64e4('0x14')](_0x4f91f2)[_0x64e4('0x15')]();};}function respondWithResult(_0x5aa52c,_0x1455f1){_0x1455f1=_0x1455f1||0xc8;return function(_0x442aba){if(_0x442aba){return _0x5aa52c[_0x64e4('0x14')](_0x1455f1)['json'](_0x442aba);}};}function respondWithFilteredResult(_0x31897a,_0x43191a){return function(_0x17fb4d){if(_0x17fb4d){var _0x3144f4=typeof _0x43191a[_0x64e4('0x16')]===_0x64e4('0x17')&&typeof _0x43191a[_0x64e4('0x18')]==='undefined';var _0x1e0bec=_0x17fb4d['count'];var _0x4227e6=_0x3144f4?0x0:_0x43191a[_0x64e4('0x16')];var _0xf8733a=_0x3144f4?_0x17fb4d['count']:_0x43191a[_0x64e4('0x16')]+_0x43191a[_0x64e4('0x18')];var _0x3b87e9;if(_0xf8733a>=_0x1e0bec){_0xf8733a=_0x1e0bec;_0x3b87e9=0xc8;}else{_0x3b87e9=0xce;}_0x31897a[_0x64e4('0x14')](_0x3b87e9);return _0x31897a[_0x64e4('0x19')](_0x64e4('0x1a'),_0x4227e6+'-'+_0xf8733a+'/'+_0x1e0bec)[_0x64e4('0x1b')](_0x17fb4d);}return null;};}function patchUpdates(_0x105033){return function(_0xf8bc22){try{jsonpatch[_0x64e4('0x1c')](_0xf8bc22,_0x105033,!![]);}catch(_0x2fe0e3){return BPromise[_0x64e4('0x1d')](_0x2fe0e3);}return _0xf8bc22['save']();};}function saveUpdates(_0x3c1cfe,_0x1a9d64){return function(_0x77026){if(_0x77026){return _0x77026[_0x64e4('0x1e')](_0x3c1cfe)['then'](function(_0x26e133){return _0x26e133;});}return null;};}function removeEntity(_0x4232c8,_0x464798){return function(_0x2c4d61){if(_0x2c4d61){return _0x2c4d61['destroy']()[_0x64e4('0x1f')](function(){_0x4232c8[_0x64e4('0x14')](0xcc)[_0x64e4('0x15')]();});}};}function handleEntityNotFound(_0x19e013,_0x1081cf){return function(_0x23a3d3){if(!_0x23a3d3){_0x19e013['sendStatus'](0x194);}return _0x23a3d3;};}function handleError(_0x2ef801,_0x22109b){_0x22109b=_0x22109b||0x1f4;return function(_0x2a37cd){logger[_0x64e4('0x20')](_0x2a37cd[_0x64e4('0x21')]);if(_0x2a37cd[_0x64e4('0x22')]){delete _0x2a37cd['name'];}_0x2ef801[_0x64e4('0x14')](_0x22109b)[_0x64e4('0x23')](_0x2a37cd);};}exports[_0x64e4('0x24')]=function(_0x26b79e,_0x136163){var _0x58eebc={},_0x2605af={},_0x2ab8a5={'count':0x0,'rows':[]};var _0x65a9e2=_[_0x64e4('0x25')](db[_0x64e4('0x26')]['rawAttributes'],function(_0x31d2f3){return{'name':_0x31d2f3[_0x64e4('0x27')],'type':_0x31d2f3[_0x64e4('0x28')]['key']};});_0x2605af[_0x64e4('0x29')]=_[_0x64e4('0x25')](_0x65a9e2,_0x64e4('0x22'));_0x2605af[_0x64e4('0x2a')]=_['keys'](_0x26b79e[_0x64e4('0x2a')]);_0x2605af[_0x64e4('0x2b')]=_['intersection'](_0x2605af[_0x64e4('0x29')],_0x2605af[_0x64e4('0x2a')]);_0x58eebc[_0x64e4('0x2c')]=_[_0x64e4('0x2d')](_0x2605af[_0x64e4('0x29')],qs[_0x64e4('0x2e')](_0x26b79e[_0x64e4('0x2a')][_0x64e4('0x2e')]));_0x58eebc[_0x64e4('0x2c')]=_0x58eebc[_0x64e4('0x2c')][_0x64e4('0x2f')]?_0x58eebc['attributes']:_0x2605af[_0x64e4('0x29')];if(!_0x26b79e[_0x64e4('0x2a')][_0x64e4('0x30')](_0x64e4('0x31'))){_0x58eebc[_0x64e4('0x18')]=qs[_0x64e4('0x18')](_0x26b79e['query'][_0x64e4('0x18')]);_0x58eebc[_0x64e4('0x16')]=qs[_0x64e4('0x16')](_0x26b79e[_0x64e4('0x2a')][_0x64e4('0x16')]);}_0x58eebc[_0x64e4('0x32')]=qs[_0x64e4('0x33')](_0x26b79e[_0x64e4('0x2a')][_0x64e4('0x33')]);_0x58eebc[_0x64e4('0x34')]=qs[_0x64e4('0x2b')](_[_0x64e4('0x35')](_0x26b79e[_0x64e4('0x2a')],_0x2605af[_0x64e4('0x2b')]),_0x65a9e2);if(_0x26b79e['query'][_0x64e4('0x36')]){_0x58eebc[_0x64e4('0x34')]=_[_0x64e4('0x37')](_0x58eebc[_0x64e4('0x34')],{'$or':_[_0x64e4('0x25')](_0x65a9e2,function(_0x3d7ba1){if(_0x3d7ba1['type']!==_0x64e4('0x38')){var _0x1b5e20={};_0x1b5e20[_0x3d7ba1[_0x64e4('0x22')]]={'$like':'%'+_0x26b79e[_0x64e4('0x2a')]['filter']+'%'};return _0x1b5e20;}})});}_0x58eebc=_[_0x64e4('0x37')]({},_0x58eebc,_0x26b79e[_0x64e4('0x39')]);var _0x3dbdca={'where':_0x58eebc['where']};return db[_0x64e4('0x26')][_0x64e4('0x3a')](_0x3dbdca)[_0x64e4('0x1f')](function(_0x142b07){_0x2ab8a5[_0x64e4('0x3a')]=_0x142b07;if(_0x26b79e[_0x64e4('0x2a')][_0x64e4('0x3b')]){_0x58eebc['include']=[{'all':!![]}];}return db[_0x64e4('0x26')]['findAll'](_0x58eebc);})[_0x64e4('0x1f')](function(_0x423b78){_0x2ab8a5['rows']=_0x423b78;return _0x2ab8a5;})[_0x64e4('0x1f')](respondWithFilteredResult(_0x136163,_0x58eebc))[_0x64e4('0x3c')](handleError(_0x136163,null));};exports['show']=function(_0x3af32d,_0x7dffa8){var _0x134e22={'raw':![],'where':{'id':_0x3af32d[_0x64e4('0x3d')]['id']}},_0x36ac00={};_0x36ac00[_0x64e4('0x29')]=_['keys'](db[_0x64e4('0x26')]['rawAttributes']);_0x36ac00[_0x64e4('0x2a')]=_[_0x64e4('0x3e')](_0x3af32d[_0x64e4('0x2a')]);_0x36ac00[_0x64e4('0x2b')]=_[_0x64e4('0x2d')](_0x36ac00[_0x64e4('0x29')],_0x36ac00[_0x64e4('0x2a')]);_0x134e22[_0x64e4('0x2c')]=_[_0x64e4('0x2d')](_0x36ac00['model'],qs[_0x64e4('0x2e')](_0x3af32d[_0x64e4('0x2a')][_0x64e4('0x2e')]));_0x134e22[_0x64e4('0x2c')]=_0x134e22[_0x64e4('0x2c')][_0x64e4('0x2f')]?_0x134e22[_0x64e4('0x2c')]:_0x36ac00['model'];if(_0x3af32d[_0x64e4('0x2a')][_0x64e4('0x3b')]){_0x134e22[_0x64e4('0x3f')]=[{'all':!![]}];}_0x134e22=_[_0x64e4('0x37')]({},_0x134e22,_0x3af32d['options']);return db[_0x64e4('0x26')][_0x64e4('0x40')](_0x134e22)[_0x64e4('0x1f')](handleEntityNotFound(_0x7dffa8,null))['then'](respondWithResult(_0x7dffa8,null))[_0x64e4('0x3c')](handleError(_0x7dffa8,null));};exports[_0x64e4('0x41')]=function(_0x3f4189,_0x14614c){return db[_0x64e4('0x26')]['create'](_0x3f4189[_0x64e4('0x42')],{})[_0x64e4('0x1f')](respondWithResult(_0x14614c,0xc9))['catch'](handleError(_0x14614c,null));};exports[_0x64e4('0x1e')]=function(_0x393512,_0x4ff112){if(_0x393512[_0x64e4('0x42')]['id']){delete _0x393512['body']['id'];}return db[_0x64e4('0x26')]['find']({'where':{'id':_0x393512[_0x64e4('0x3d')]['id']}})[_0x64e4('0x1f')](handleEntityNotFound(_0x4ff112,null))['then'](saveUpdates(_0x393512['body'],null))['then'](respondWithResult(_0x4ff112,null))[_0x64e4('0x3c')](handleError(_0x4ff112,null));};exports['destroy']=function(_0x21413a,_0x119d94){return db[_0x64e4('0x26')][_0x64e4('0x40')]({'where':{'id':_0x21413a[_0x64e4('0x3d')]['id']}})[_0x64e4('0x1f')](handleEntityNotFound(_0x119d94,null))[_0x64e4('0x1f')](removeEntity(_0x119d94,null))[_0x64e4('0x3c')](handleError(_0x119d94,null));};exports[_0x64e4('0x43')]=function(_0x5c1ffc,_0x2e76be,_0x252132){var _0x24f912={};var _0x23040d={};var _0x351fd1;var _0x5afa22;return db[_0x64e4('0x26')]['findOne']({'where':{'id':_0x5c1ffc[_0x64e4('0x3d')]['id']}})[_0x64e4('0x1f')](handleEntityNotFound(_0x2e76be,null))[_0x64e4('0x1f')](function(_0x519ff1){if(_0x519ff1){_0x351fd1=_0x519ff1;_0x23040d['model']=_[_0x64e4('0x3e')](db['SugarcrmConfiguration']['rawAttributes']);_0x23040d[_0x64e4('0x2a')]=_[_0x64e4('0x3e')](_0x5c1ffc[_0x64e4('0x2a')]);_0x23040d['filters']=_[_0x64e4('0x2d')](_0x23040d[_0x64e4('0x29')],_0x23040d[_0x64e4('0x2a')]);_0x24f912[_0x64e4('0x2c')]=_['intersection'](_0x23040d['model'],qs[_0x64e4('0x2e')](_0x5c1ffc['query'][_0x64e4('0x2e')]));_0x24f912[_0x64e4('0x2c')]=_0x24f912[_0x64e4('0x2c')][_0x64e4('0x2f')]?_0x24f912['attributes']:_0x23040d[_0x64e4('0x29')];_0x24f912['order']=qs['sort'](_0x5c1ffc['query']['sort']);_0x24f912[_0x64e4('0x34')]=qs['filters'](_[_0x64e4('0x35')](_0x5c1ffc['query'],_0x23040d[_0x64e4('0x2b')]));if(_0x5c1ffc[_0x64e4('0x2a')][_0x64e4('0x36')]){_0x24f912[_0x64e4('0x34')]=_[_0x64e4('0x37')](_0x24f912[_0x64e4('0x34')],{'$or':_['map'](_0x24f912[_0x64e4('0x2c')],function(_0x2aa309){var _0x42cc00={};_0x42cc00[_0x2aa309]={'$like':'%'+_0x5c1ffc[_0x64e4('0x2a')]['filter']+'%'};return _0x42cc00;})});}_0x24f912=_['merge']({},_0x24f912,_0x5c1ffc[_0x64e4('0x39')]);return _0x351fd1[_0x64e4('0x43')](_0x24f912);}})[_0x64e4('0x1f')](function(_0x531ada){if(_0x531ada){_0x5afa22=_0x531ada[_0x64e4('0x2f')];if(!_0x5c1ffc[_0x64e4('0x2a')][_0x64e4('0x30')](_0x64e4('0x31'))){_0x24f912['limit']=qs[_0x64e4('0x18')](_0x5c1ffc[_0x64e4('0x2a')][_0x64e4('0x18')]);_0x24f912[_0x64e4('0x16')]=qs[_0x64e4('0x16')](_0x5c1ffc[_0x64e4('0x2a')][_0x64e4('0x16')]);}return _0x351fd1[_0x64e4('0x43')](_0x24f912);}})[_0x64e4('0x1f')](function(_0x437bbd){if(_0x437bbd){return _0x437bbd?{'count':_0x5afa22,'rows':_0x437bbd}:null;}})['then'](respondWithResult(_0x2e76be,null))[_0x64e4('0x3c')](handleError(_0x2e76be,null));};exports[_0x64e4('0x44')]=function(_0x30b9c2,_0x459d23,_0x1a2cca){if(_0x30b9c2['body']['id']){delete _0x30b9c2[_0x64e4('0x42')]['id'];}return db[_0x64e4('0x26')][_0x64e4('0x45')]({'where':{'id':_0x30b9c2[_0x64e4('0x3d')]['id']}})['then'](handleEntityNotFound(_0x459d23,null))['then'](function(_0x58f677){if(_0x58f677){_0x30b9c2[_0x64e4('0x42')][_0x64e4('0x46')]=_0x58f677['id'];_0x30b9c2[_0x64e4('0x42')][_0x64e4('0x47')]=integrations[_0x64e4('0x48')](_0x30b9c2[_0x64e4('0x42')][_0x64e4('0x49')],_0x30b9c2[_0x64e4('0x42')][_0x64e4('0x28')]);_0x30b9c2['body']['Descriptions']=integrations['getDescriptions'](_0x30b9c2[_0x64e4('0x42')][_0x64e4('0x49')],_0x30b9c2[_0x64e4('0x42')][_0x64e4('0x28')]);return db[_0x64e4('0x4a')]['create'](_0x30b9c2[_0x64e4('0x42')],{'include':[{'model':db['SugarcrmField'],'as':_0x64e4('0x47')},{'model':db[_0x64e4('0x4b')],'as':_0x64e4('0x4c')}]});}return null;})[_0x64e4('0x1f')](respondWithResult(_0x459d23,null))[_0x64e4('0x3c')](handleError(_0x459d23,null));};exports[_0x64e4('0x4d')]=function(_0x1b78d1,_0x4d6fdc,_0x3e2795){var _0x5a0d34='';var _0x3070fc=['id','name',_0x64e4('0x4e'),'created_by','description',_0x64e4('0x4f'),'duration_hours',_0x64e4('0x50'),'parent_id',_0x64e4('0x51'),'parent_name',_0x64e4('0x52')];return db[_0x64e4('0x26')]['findOne']({'where':{'id':_0x1b78d1[_0x64e4('0x3d')]['id']},'attributes':['id','username',_0x64e4('0x53'),_0x64e4('0x54')]})[_0x64e4('0x1f')](handleEntityNotFound(_0x4d6fdc,null))[_0x64e4('0x1f')](function(_0x127647){if(_0x127647){_0x5a0d34=_0x127647['remoteUri'];var _0x3bd422=_0x5a0d34[_0x64e4('0x55')](-0x1);if(_0x3bd422==='/'){_0x5a0d34=_0x5a0d34[_0x64e4('0x56')](0x0,_0x5a0d34[_0x64e4('0x57')](_0x3bd422));}return rp({'method':_0x64e4('0x58'),'uri':util[_0x64e4('0x59')](_0x64e4('0x5a'),_0x5a0d34,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x64e4('0x5b'),'input_type':_0x64e4('0x5c'),'response_type':_0x64e4('0x5c'),'rest_data':JSON[_0x64e4('0x5d')]({'user_auth':{'user_name':_0x127647['username'],'password':_0x127647[_0x64e4('0x53')],'encryption':'PLAIN'},'application':_0x64e4('0x5e')})}});}})['then'](function(_0x4a9d4c){if(_0x4a9d4c&&_0x4a9d4c[_0x64e4('0x22')]!==_0x64e4('0x5f')&&_0x4a9d4c[_0x64e4('0x22')]!==_0x64e4('0x60')){return rp({'method':_0x64e4('0x58'),'uri':util['format'](_0x64e4('0x5a'),_0x5a0d34,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0x64e4('0x5c'),'rest_data':JSON[_0x64e4('0x5d')]({'session':_0x4a9d4c['id'],'module_name':'Calls'})}})[_0x64e4('0x1f')](function(_0x510939){if(_0x510939){var _0x2ccf9e=_[_0x64e4('0x61')](_0x510939[_0x64e4('0x62')]);_['remove'](_0x2ccf9e,function(_0x2838a3){return _0x3070fc[_0x64e4('0x63')](_0x2838a3[_0x64e4('0x22')]);});return{'count':_0x2ccf9e[_0x64e4('0x2f')],'rows':_['map'](_0x2ccf9e,function(_0x147af0){return{'id':_0x147af0[_0x64e4('0x22')],'name':_0x147af0[_0x64e4('0x64')],'custom':_[_0x64e4('0x65')](_0x147af0[_0x64e4('0x22')],'_c')?!![]:![],'options':_0x147af0[_0x64e4('0x39')]?_[_0x64e4('0x25')](_['values'](_0x147af0[_0x64e4('0x39')]),function(_0x2745d2){return{'name':_0x2745d2['value'],'value':_0x2745d2[_0x64e4('0x22')]};}):[]};})};}})[_0x64e4('0x1f')](respondWithResult(_0x4d6fdc,null))[_0x64e4('0x3c')](function(_0x51cf40){var _0x13c923=_0x1b78d1[_0x64e4('0x2a')][_0x64e4('0x66')]?0x1f4:_0x51cf40[_0x64e4('0x67')]||0x1f4;logger[_0x64e4('0x20')](_0x64e4('0x68'),_0x64e4('0x4d'),_0x13c923,JSON[_0x64e4('0x5d')](_0x51cf40));delete _0x51cf40[_0x64e4('0x22')];if(_0x13c923===0x191){_0x13c923=0x190;}_0x4d6fdc[_0x64e4('0x14')](_0x13c923)[_0x64e4('0x23')](_0x1b78d1['query'][_0x64e4('0x66')]?{'message':_0x64e4('0x69'),'statusCode':_0x51cf40['statusCode']}:_0x51cf40);});}else{var _0x9fea15=0x1f4;_0x4d6fdc[_0x64e4('0x14')](_0x9fea15)[_0x64e4('0x23')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index cfbe9b3..fc11e0b 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 _0x894b=['request-promise','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','util','../../config/logger','moment'];(function(_0x5c7bb0,_0x425ca8){var _0x261abd=function(_0x4e9c7d){while(--_0x4e9c7d){_0x5c7bb0['push'](_0x5c7bb0['shift']());}};_0x261abd(++_0x425ca8);}(_0x894b,0x104));var _0xb894=function(_0x58c01a,_0xe9438b){_0x58c01a=_0x58c01a-0x0;var _0x292126=_0x894b[_0x58c01a];return _0x292126;};'use strict';var _=require(_0xb894('0x0'));var util=require(_0xb894('0x1'));var logger=require(_0xb894('0x2'))('api');var moment=require(_0xb894('0x3'));var BPromise=require('bluebird');var rp=require(_0xb894('0x4'));var fs=require('fs');var path=require(_0xb894('0x5'));var rimraf=require(_0xb894('0x6'));var config=require('../../config/environment');var attributes=require(_0xb894('0x7'));var integrations=require(_0xb894('0x8'));module['exports']=function(_0x3227ab,_0x281d60){return _0x3227ab[_0xb894('0x9')]('SugarcrmAccount',attributes,{'tableName':_0xb894('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0ee=['util','api','moment','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount'];(function(_0xf94257,_0x28a889){var _0x3af135=function(_0x3a5883){while(--_0x3a5883){_0xf94257['push'](_0xf94257['shift']());}};_0x3af135(++_0x28a889);}(_0xd0ee,0x19a));var _0xed0e=function(_0x7f5b4,_0x4e551f){_0x7f5b4=_0x7f5b4-0x0;var _0x17777c=_0xd0ee[_0x7f5b4];return _0x17777c;};'use strict';var _=require('lodash');var util=require(_0xed0e('0x0'));var logger=require('../../config/logger')(_0xed0e('0x1'));var moment=require(_0xed0e('0x2'));var BPromise=require('bluebird');var rp=require(_0xed0e('0x3'));var fs=require('fs');var path=require(_0xed0e('0x4'));var rimraf=require('rimraf');var config=require(_0xed0e('0x5'));var attributes=require(_0xed0e('0x6'));var integrations=require(_0xed0e('0x7'));module[_0xed0e('0x8')]=function(_0x53dfad,_0x5adddb){return _0x53dfad['define'](_0xed0e('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 8e5c769..d52d472 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 _0xb383=['findAll','options','raw','limit','model','attributes','include','map','ShowSugarcrmAccount','find','where','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x339db5,_0x441041){var _0x142ff8=function(_0x4c8ac0){while(--_0x4c8ac0){_0x339db5['push'](_0x339db5['shift']());}};_0x142ff8(++_0x441041);}(_0xb383,0xd7));var _0x3b38=function(_0x65804e,_0x2c7c56){_0x65804e=_0x65804e-0x0;var _0x1b3281=_0xb383[_0x65804e];return _0x1b3281;};'use strict';var _=require(_0x3b38('0x0'));var util=require('util');var moment=require(_0x3b38('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b38('0x2'))['db'];var utils=require(_0x3b38('0x3'));var logger=require(_0x3b38('0x4'))(_0x3b38('0x5'));var config=require(_0x3b38('0x6'));var jayson=require(_0x3b38('0x7'));var client=jayson[_0x3b38('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3324cf,_0x1ccbff,_0x552915){return new BPromise(function(_0xad4147,_0x41b161){return client[_0x3b38('0x9')](_0x3324cf,_0x552915)[_0x3b38('0xa')](function(_0x4ce8bb){logger[_0x3b38('0xb')](_0x3b38('0xc'),_0x1ccbff,_0x3b38('0xd'));logger[_0x3b38('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1ccbff,_0x3b38('0xd'),JSON[_0x3b38('0xf')](_0x4ce8bb));if(_0x4ce8bb[_0x3b38('0x10')]){if(_0x4ce8bb[_0x3b38('0x10')][_0x3b38('0x11')]===0x1f4){logger[_0x3b38('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ccbff,_0x4ce8bb['error'][_0x3b38('0x12')]);return _0x41b161(_0x4ce8bb[_0x3b38('0x10')]['message']);}logger[_0x3b38('0x10')](_0x3b38('0xc'),_0x1ccbff,_0x4ce8bb[_0x3b38('0x10')][_0x3b38('0x12')]);return _0xad4147(_0x4ce8bb[_0x3b38('0x10')]['message']);}else{logger[_0x3b38('0xb')](_0x3b38('0xc'),_0x1ccbff,'request\x20sent');_0xad4147(_0x4ce8bb[_0x3b38('0x13')][_0x3b38('0x12')]);}})[_0x3b38('0x14')](function(_0x559a8f){logger[_0x3b38('0x10')](_0x3b38('0xc'),_0x1ccbff,_0x559a8f);_0x41b161(_0x559a8f);});});}exports[_0x3b38('0x15')]=function(_0xe6e169){var _0x241632=this;return new Promise(function(_0x3f4099,_0x54d90f){return db[_0x3b38('0x16')][_0x3b38('0x17')]({'raw':_0xe6e169[_0x3b38('0x18')]?_0xe6e169[_0x3b38('0x18')][_0x3b38('0x19')]===undefined?!![]:![]:!![],'where':_0xe6e169[_0x3b38('0x18')]?_0xe6e169['options']['where']||null:null,'attributes':_0xe6e169['options']?_0xe6e169[_0x3b38('0x18')]['attributes']||null:null,'limit':_0xe6e169[_0x3b38('0x18')]?_0xe6e169['options'][_0x3b38('0x1a')]||null:null,'include':_0xe6e169[_0x3b38('0x18')]?_0xe6e169[_0x3b38('0x18')]['include']?_['map'](_0xe6e169['options']['include'],function(_0x3c4249){return{'model':db[_0x3c4249[_0x3b38('0x1b')]],'as':_0x3c4249['as'],'attributes':_0x3c4249[_0x3b38('0x1c')],'include':_0x3c4249[_0x3b38('0x1d')]?_[_0x3b38('0x1e')](_0x3c4249[_0x3b38('0x1d')],function(_0x4b6248){return{'model':db[_0x4b6248[_0x3b38('0x1b')]],'as':_0x4b6248['as'],'attributes':_0x4b6248[_0x3b38('0x1c')],'include':_0x4b6248[_0x3b38('0x1d')]?_[_0x3b38('0x1e')](_0x4b6248['include'],function(_0x35d142){return{'model':db[_0x35d142[_0x3b38('0x1b')]],'as':_0x35d142['as'],'attributes':_0x35d142[_0x3b38('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3b38('0xa')](function(_0x540445){logger[_0x3b38('0xb')]('GetSugarcrmAccount',_0xe6e169);logger['debug'](_0x3b38('0x15'),_0xe6e169,JSON[_0x3b38('0xf')](_0x540445));_0x3f4099(_0x540445);})[_0x3b38('0x14')](function(_0x79c036){logger[_0x3b38('0x10')](_0x3b38('0x15'),_0x79c036[_0x3b38('0x12')],_0xe6e169);_0x54d90f(_0x241632[_0x3b38('0x10')](0x1f4,_0x79c036[_0x3b38('0x12')]));});});};exports[_0x3b38('0x1f')]=function(_0x18ec49){var _0xfaa8c8=this;return new Promise(function(_0x2ee166,_0x357cf3){return db['SugarcrmAccount'][_0x3b38('0x20')]({'raw':_0x18ec49[_0x3b38('0x18')]?_0x18ec49[_0x3b38('0x18')][_0x3b38('0x19')]===undefined?!![]:![]:!![],'where':_0x18ec49[_0x3b38('0x18')]?_0x18ec49[_0x3b38('0x18')][_0x3b38('0x21')]||null:null,'attributes':_0x18ec49[_0x3b38('0x18')]?_0x18ec49[_0x3b38('0x18')]['attributes']||null:null,'include':_0x18ec49[_0x3b38('0x18')]?_0x18ec49['options'][_0x3b38('0x1d')]?_['map'](_0x18ec49['options']['include'],function(_0x3ddbc4){return{'model':db[_0x3ddbc4['model']],'as':_0x3ddbc4['as'],'attributes':_0x3ddbc4[_0x3b38('0x1c')],'include':_0x3ddbc4[_0x3b38('0x1d')]?_[_0x3b38('0x1e')](_0x3ddbc4[_0x3b38('0x1d')],function(_0x491de0){return{'model':db[_0x491de0[_0x3b38('0x1b')]],'as':_0x491de0['as'],'attributes':_0x491de0[_0x3b38('0x1c')],'include':_0x491de0[_0x3b38('0x1d')]?_[_0x3b38('0x1e')](_0x491de0[_0x3b38('0x1d')],function(_0x5d9413){return{'model':db[_0x5d9413[_0x3b38('0x1b')]],'as':_0x5d9413['as'],'attributes':_0x5d9413[_0x3b38('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b4433){logger[_0x3b38('0xb')](_0x3b38('0x1f'),_0x18ec49);logger['debug'](_0x3b38('0x1f'),_0x18ec49,JSON[_0x3b38('0xf')](_0x4b4433));_0x2ee166(_0x4b4433);})['catch'](function(_0x24b661){logger[_0x3b38('0x10')]('ShowSugarcrmAccount',_0x24b661['message'],_0x18ec49);_0x357cf3(_0xfaa8c8[_0x3b38('0x10')](0x1f4,_0x24b661[_0x3b38('0x12')]));});});}; \ No newline at end of file +var _0xcff7=['ShowSugarcrmAccount','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','map','include','model','catch','then','info'];(function(_0x47cc69,_0x43a080){var _0x18aacc=function(_0x47b427){while(--_0x47b427){_0x47cc69['push'](_0x47cc69['shift']());}};_0x18aacc(++_0x43a080);}(_0xcff7,0x89));var _0x7cff=function(_0x11c2f4,_0x1588e3){_0x11c2f4=_0x11c2f4-0x0;var _0xc8e948=_0xcff7[_0x11c2f4];return _0xc8e948;};'use strict';var _=require('lodash');var util=require(_0x7cff('0x0'));var moment=require(_0x7cff('0x1'));var BPromise=require('bluebird');var rs=require(_0x7cff('0x2'));var fs=require('fs');var Redis=require(_0x7cff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cff('0x4'));var logger=require(_0x7cff('0x5'))(_0x7cff('0x6'));var config=require(_0x7cff('0x7'));var jayson=require(_0x7cff('0x8'));var client=jayson['client'][_0x7cff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6fda17,_0x44bd88,_0x496ee5){return new BPromise(function(_0x591918,_0x3af3c1){return client[_0x7cff('0xa')](_0x6fda17,_0x496ee5)['then'](function(_0x6a92bf){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x44bd88,_0x7cff('0xb'));logger[_0x7cff('0xc')](_0x7cff('0xd'),_0x44bd88,_0x7cff('0xb'),JSON[_0x7cff('0xe')](_0x6a92bf));if(_0x6a92bf[_0x7cff('0xf')]){if(_0x6a92bf[_0x7cff('0xf')][_0x7cff('0x10')]===0x1f4){logger[_0x7cff('0xf')](_0x7cff('0x11'),_0x44bd88,_0x6a92bf[_0x7cff('0xf')]['message']);return _0x3af3c1(_0x6a92bf[_0x7cff('0xf')][_0x7cff('0x12')]);}logger[_0x7cff('0xf')](_0x7cff('0x11'),_0x44bd88,_0x6a92bf[_0x7cff('0xf')][_0x7cff('0x12')]);return _0x591918(_0x6a92bf[_0x7cff('0xf')][_0x7cff('0x12')]);}else{logger['info'](_0x7cff('0x11'),_0x44bd88,_0x7cff('0xb'));_0x591918(_0x6a92bf[_0x7cff('0x13')]['message']);}})['catch'](function(_0x51eceb){logger[_0x7cff('0xf')](_0x7cff('0x11'),_0x44bd88,_0x51eceb);_0x3af3c1(_0x51eceb);});});}exports[_0x7cff('0x14')]=function(_0x337381){var _0x24e645=this;return new Promise(function(_0x2d2ecd,_0x814a01){return db[_0x7cff('0x15')][_0x7cff('0x16')]({'raw':_0x337381['options']?_0x337381[_0x7cff('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x337381[_0x7cff('0x17')]?_0x337381[_0x7cff('0x17')][_0x7cff('0x18')]||null:null,'attributes':_0x337381[_0x7cff('0x17')]?_0x337381[_0x7cff('0x17')][_0x7cff('0x19')]||null:null,'limit':_0x337381[_0x7cff('0x17')]?_0x337381[_0x7cff('0x17')][_0x7cff('0x1a')]||null:null,'include':_0x337381['options']?_0x337381[_0x7cff('0x17')]['include']?_[_0x7cff('0x1b')](_0x337381[_0x7cff('0x17')][_0x7cff('0x1c')],function(_0x40998a){return{'model':db[_0x40998a[_0x7cff('0x1d')]],'as':_0x40998a['as'],'attributes':_0x40998a['attributes'],'include':_0x40998a['include']?_[_0x7cff('0x1b')](_0x40998a[_0x7cff('0x1c')],function(_0x408442){return{'model':db[_0x408442[_0x7cff('0x1d')]],'as':_0x408442['as'],'attributes':_0x408442[_0x7cff('0x19')],'include':_0x408442[_0x7cff('0x1c')]?_[_0x7cff('0x1b')](_0x408442[_0x7cff('0x1c')],function(_0x4ab8f9){return{'model':db[_0x4ab8f9['model']],'as':_0x4ab8f9['as'],'attributes':_0x4ab8f9[_0x7cff('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x209117){logger['info'](_0x7cff('0x14'),_0x337381);logger[_0x7cff('0xc')](_0x7cff('0x14'),_0x337381,JSON[_0x7cff('0xe')](_0x209117));_0x2d2ecd(_0x209117);})[_0x7cff('0x1e')](function(_0x3ae814){logger[_0x7cff('0xf')](_0x7cff('0x14'),_0x3ae814[_0x7cff('0x12')],_0x337381);_0x814a01(_0x24e645[_0x7cff('0xf')](0x1f4,_0x3ae814['message']));});});};exports['ShowSugarcrmAccount']=function(_0x506561){var _0x504486=this;return new Promise(function(_0x3da15b,_0x5176f4){return db[_0x7cff('0x15')]['find']({'raw':_0x506561['options']?_0x506561[_0x7cff('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x506561[_0x7cff('0x17')]?_0x506561['options'][_0x7cff('0x18')]||null:null,'attributes':_0x506561[_0x7cff('0x17')]?_0x506561[_0x7cff('0x17')][_0x7cff('0x19')]||null:null,'include':_0x506561[_0x7cff('0x17')]?_0x506561[_0x7cff('0x17')][_0x7cff('0x1c')]?_['map'](_0x506561[_0x7cff('0x17')]['include'],function(_0xa2e77b){return{'model':db[_0xa2e77b[_0x7cff('0x1d')]],'as':_0xa2e77b['as'],'attributes':_0xa2e77b['attributes'],'include':_0xa2e77b[_0x7cff('0x1c')]?_[_0x7cff('0x1b')](_0xa2e77b[_0x7cff('0x1c')],function(_0x59244b){return{'model':db[_0x59244b[_0x7cff('0x1d')]],'as':_0x59244b['as'],'attributes':_0x59244b[_0x7cff('0x19')],'include':_0x59244b[_0x7cff('0x1c')]?_['map'](_0x59244b[_0x7cff('0x1c')],function(_0x149978){return{'model':db[_0x149978[_0x7cff('0x1d')]],'as':_0x149978['as'],'attributes':_0x149978['attributes']};}):[]};}):[]};}):[]:[]})[_0x7cff('0x1f')](function(_0x3c5697){logger[_0x7cff('0x20')](_0x7cff('0x21'),_0x506561);logger['debug'](_0x7cff('0x21'),_0x506561,JSON[_0x7cff('0xe')](_0x3c5697));_0x3da15b(_0x3c5697);})[_0x7cff('0x1e')](function(_0x309393){logger[_0x7cff('0xf')]('ShowSugarcrmAccount',_0x309393[_0x7cff('0x12')],_0x506561);_0x5176f4(_0x504486[_0x7cff('0xf')](0x1f4,_0x309393[_0x7cff('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 100c6e5..4106f9a 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 _0x3156=['connect-timeout','Router','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3156,0x9d));var _0x6315=function(_0x41283e,_0x1c23b5){_0x41283e=_0x41283e-0x0;var _0x57d22c=_0x3156[_0x41283e];return _0x57d22c;};'use strict';var multer=require(_0x6315('0x0'));var util=require(_0x6315('0x1'));var path=require(_0x6315('0x2'));var timeout=require(_0x6315('0x3'));var express=require('express');var router=express[_0x6315('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6315('0x5'));var controller=require(_0x6315('0x6'));router[_0x6315('0x7')]('/',auth[_0x6315('0x8')](),controller['index']);router[_0x6315('0x7')](_0x6315('0x9'),auth[_0x6315('0x8')](),controller[_0x6315('0xa')]);router[_0x6315('0x7')](_0x6315('0xb'),auth[_0x6315('0x8')](),controller[_0x6315('0xc')]);router[_0x6315('0x7')]('/:id/subjects',auth[_0x6315('0x8')](),controller[_0x6315('0xd')]);router[_0x6315('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6315('0xe')]('/',auth['isAuthenticated'](),controller[_0x6315('0xf')]);router[_0x6315('0x10')]('/:id',auth[_0x6315('0x8')](),controller[_0x6315('0x11')]);router[_0x6315('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x6315('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc24e=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','create','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x47242c,_0x42ffd9){var _0x560b61=function(_0xf22893){while(--_0xf22893){_0x47242c['push'](_0x47242c['shift']());}};_0x560b61(++_0x42ffd9);}(_0xc24e,0x1d9));var _0xec24=function(_0x2f5598,_0x3fc452){_0x2f5598=_0x2f5598-0x0;var _0x525191=_0xc24e[_0x2f5598];return _0x525191;};'use strict';var multer=require(_0xec24('0x0'));var util=require(_0xec24('0x1'));var path=require(_0xec24('0x2'));var timeout=require('connect-timeout');var express=require(_0xec24('0x3'));var router=express[_0xec24('0x4')]();var fs_extra=require(_0xec24('0x5'));var auth=require(_0xec24('0x6'));var interaction=require(_0xec24('0x7'));var config=require(_0xec24('0x8'));var controller=require(_0xec24('0x9'));router[_0xec24('0xa')]('/',auth[_0xec24('0xb')](),controller['index']);router[_0xec24('0xa')](_0xec24('0xc'),auth[_0xec24('0xb')](),controller[_0xec24('0xd')]);router[_0xec24('0xa')](_0xec24('0xe'),auth[_0xec24('0xb')](),controller[_0xec24('0xf')]);router[_0xec24('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xec24('0x10')]);router['get']('/:id/descriptions',auth[_0xec24('0xb')](),controller[_0xec24('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xec24('0x12')]);router['put'](_0xec24('0xc'),auth[_0xec24('0xb')](),controller['update']);router[_0xec24('0x13')]('/:id',auth[_0xec24('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 8f53eac..75ec34b 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 _0xd47e=['STRING','sequelize'];(function(_0x15185f,_0x2003a5){var _0x3c9c47=function(_0x2862f7){while(--_0x2862f7){_0x15185f['push'](_0x15185f['shift']());}};_0x3c9c47(++_0x2003a5);}(_0xd47e,0xc3));var _0xed47=function(_0x5c20c7,_0x58e924){_0x5c20c7=_0x5c20c7-0x0;var _0x46bfa8=_0xd47e[_0x5c20c7];return _0x46bfa8;};'use strict';var Sequelize=require(_0xed47('0x0'));module['exports']={'name':{'type':Sequelize[_0xed47('0x1')]},'description':{'type':Sequelize[_0xed47('0x1')]}}; \ No newline at end of file +var _0xe90d=['STRING','sequelize','exports'];(function(_0x5b3a82,_0x5675e3){var _0x154dba=function(_0x4313f5){while(--_0x4313f5){_0x5b3a82['push'](_0x5b3a82['shift']());}};_0x154dba(++_0x5675e3);}(_0xe90d,0x145));var _0xde90=function(_0x572683,_0x435e01){_0x572683=_0x572683-0x0;var _0x16dcbb=_0xe90d[_0x572683];return _0x16dcbb;};'use strict';var Sequelize=require(_0xde90('0x0'));module[_0xde90('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde90('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 96336ed..dd726b7 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 _0xf4a8=['util','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','filter','merge','where','options','SugarcrmConfiguration','includeAll','include','show','params','length','find','create','body','catch','getFields','findOne','SugarcrmField','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0xc916a3,_0x2b600c){var _0x15ae95=function(_0x5bd2b4){while(--_0x5bd2b4){_0xc916a3['push'](_0xc916a3['shift']());}};_0x15ae95(++_0x2b600c);}(_0xf4a8,0x1df));var _0x8f4a=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xf4a8[_0x4de586];return _0x46baf5;};'use strict';var emlformat=require(_0x8f4a('0x0'));var rimraf=require(_0x8f4a('0x1'));var zipdir=require(_0x8f4a('0x2'));var jsonpatch=require(_0x8f4a('0x3'));var rp=require(_0x8f4a('0x4'));var moment=require(_0x8f4a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8f4a('0x6'));var util=require(_0x8f4a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8f4a('0x8'));var ejs=require(_0x8f4a('0x9'));var fs=require('fs');var fs_extra=require(_0x8f4a('0xa'));var _=require('lodash');var squel=require(_0x8f4a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8f4a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8f4a('0xd'));var Papa=require(_0x8f4a('0xe'));var Redis=require(_0x8f4a('0xf'));var authService=require(_0x8f4a('0x10'));var qs=require(_0x8f4a('0x11'));var as=require(_0x8f4a('0x12'));var hardwareService=require(_0x8f4a('0x13'));var logger=require(_0x8f4a('0x14'))(_0x8f4a('0x15'));var utils=require(_0x8f4a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8f4a('0x17'));var db=require(_0x8f4a('0x18'))['db'];function respondWithStatusCode(_0x4e4003,_0x529741){_0x529741=_0x529741||0xcc;return function(_0x307f07){if(_0x307f07){return _0x4e4003['sendStatus'](_0x529741);}return _0x4e4003[_0x8f4a('0x19')](_0x529741)[_0x8f4a('0x1a')]();};}function respondWithResult(_0x16bfcd,_0x3e3551){_0x3e3551=_0x3e3551||0xc8;return function(_0x4a335e){if(_0x4a335e){return _0x16bfcd[_0x8f4a('0x19')](_0x3e3551)[_0x8f4a('0x1b')](_0x4a335e);}};}function respondWithFilteredResult(_0x490429,_0x1b51ba){return function(_0xbe8dea){if(_0xbe8dea){var _0x25571d=typeof _0x1b51ba[_0x8f4a('0x1c')]==='undefined'&&typeof _0x1b51ba[_0x8f4a('0x1d')]===_0x8f4a('0x1e');var _0x52d890=_0xbe8dea[_0x8f4a('0x1f')];var _0x3c8f76=_0x25571d?0x0:_0x1b51ba[_0x8f4a('0x1c')];var _0x1fec27=_0x25571d?_0xbe8dea[_0x8f4a('0x1f')]:_0x1b51ba[_0x8f4a('0x1c')]+_0x1b51ba[_0x8f4a('0x1d')];var _0x168343;if(_0x1fec27>=_0x52d890){_0x1fec27=_0x52d890;_0x168343=0xc8;}else{_0x168343=0xce;}_0x490429[_0x8f4a('0x19')](_0x168343);return _0x490429[_0x8f4a('0x20')](_0x8f4a('0x21'),_0x3c8f76+'-'+_0x1fec27+'/'+_0x52d890)['json'](_0xbe8dea);}return null;};}function patchUpdates(_0x432e3c){return function(_0x52cf96){try{jsonpatch[_0x8f4a('0x22')](_0x52cf96,_0x432e3c,!![]);}catch(_0x503744){return BPromise[_0x8f4a('0x23')](_0x503744);}return _0x52cf96[_0x8f4a('0x24')]();};}function saveUpdates(_0x1e3642,_0x22d248){return function(_0x1ebadd){if(_0x1ebadd){return _0x1ebadd[_0x8f4a('0x25')](_0x1e3642)[_0x8f4a('0x26')](function(_0x280866){return _0x280866;});}return null;};}function removeEntity(_0x3d717d,_0x35f78d){return function(_0x16d1ea){if(_0x16d1ea){return _0x16d1ea[_0x8f4a('0x27')]()[_0x8f4a('0x26')](function(){_0x3d717d['status'](0xcc)[_0x8f4a('0x1a')]();});}};}function handleEntityNotFound(_0x5a5d45,_0x3d8a1f){return function(_0x5f51d0){if(!_0x5f51d0){_0x5a5d45[_0x8f4a('0x28')](0x194);}return _0x5f51d0;};}function handleError(_0x130a61,_0x1df9f8){_0x1df9f8=_0x1df9f8||0x1f4;return function(_0x101a35){logger[_0x8f4a('0x29')](_0x101a35[_0x8f4a('0x2a')]);if(_0x101a35[_0x8f4a('0x2b')]){delete _0x101a35['name'];}_0x130a61[_0x8f4a('0x19')](_0x1df9f8)[_0x8f4a('0x2c')](_0x101a35);};}exports[_0x8f4a('0x2d')]=function(_0x5baf43,_0x1cc341){var _0x4db7ca={},_0x12bb08={},_0x3e5314={'count':0x0,'rows':[]};var _0x688fdb=_[_0x8f4a('0x2e')](db['SugarcrmConfiguration'][_0x8f4a('0x2f')],function(_0x1ff231){return{'name':_0x1ff231['fieldName'],'type':_0x1ff231[_0x8f4a('0x30')][_0x8f4a('0x31')]};});_0x12bb08[_0x8f4a('0x32')]=_[_0x8f4a('0x2e')](_0x688fdb,_0x8f4a('0x2b'));_0x12bb08[_0x8f4a('0x33')]=_[_0x8f4a('0x34')](_0x5baf43[_0x8f4a('0x33')]);_0x12bb08[_0x8f4a('0x35')]=_[_0x8f4a('0x36')](_0x12bb08[_0x8f4a('0x32')],_0x12bb08['query']);_0x4db7ca[_0x8f4a('0x37')]=_['intersection'](_0x12bb08[_0x8f4a('0x32')],qs['fields'](_0x5baf43[_0x8f4a('0x33')][_0x8f4a('0x38')]));_0x4db7ca[_0x8f4a('0x37')]=_0x4db7ca[_0x8f4a('0x37')]['length']?_0x4db7ca[_0x8f4a('0x37')]:_0x12bb08['model'];if(!_0x5baf43[_0x8f4a('0x33')]['hasOwnProperty']('nolimit')){_0x4db7ca['limit']=qs['limit'](_0x5baf43[_0x8f4a('0x33')][_0x8f4a('0x1d')]);_0x4db7ca[_0x8f4a('0x1c')]=qs['offset'](_0x5baf43[_0x8f4a('0x33')][_0x8f4a('0x1c')]);}_0x4db7ca[_0x8f4a('0x39')]=qs[_0x8f4a('0x3a')](_0x5baf43[_0x8f4a('0x33')][_0x8f4a('0x3a')]);_0x4db7ca['where']=qs['filters'](_['pick'](_0x5baf43[_0x8f4a('0x33')],_0x12bb08[_0x8f4a('0x35')]),_0x688fdb);if(_0x5baf43[_0x8f4a('0x33')][_0x8f4a('0x3b')]){_0x4db7ca['where']=_[_0x8f4a('0x3c')](_0x4db7ca[_0x8f4a('0x3d')],{'$or':_[_0x8f4a('0x2e')](_0x688fdb,function(_0x56bea5){if(_0x56bea5[_0x8f4a('0x30')]!=='VIRTUAL'){var _0x1fdcd7={};_0x1fdcd7[_0x56bea5[_0x8f4a('0x2b')]]={'$like':'%'+_0x5baf43['query'][_0x8f4a('0x3b')]+'%'};return _0x1fdcd7;}})});}_0x4db7ca=_[_0x8f4a('0x3c')]({},_0x4db7ca,_0x5baf43[_0x8f4a('0x3e')]);var _0x1f6f3c={'where':_0x4db7ca[_0x8f4a('0x3d')]};return db[_0x8f4a('0x3f')][_0x8f4a('0x1f')](_0x1f6f3c)[_0x8f4a('0x26')](function(_0x46a709){_0x3e5314['count']=_0x46a709;if(_0x5baf43['query'][_0x8f4a('0x40')]){_0x4db7ca[_0x8f4a('0x41')]=[{'all':!![]}];}return db[_0x8f4a('0x3f')]['findAll'](_0x4db7ca);})[_0x8f4a('0x26')](function(_0x1e4539){_0x3e5314['rows']=_0x1e4539;return _0x3e5314;})['then'](respondWithFilteredResult(_0x1cc341,_0x4db7ca))['catch'](handleError(_0x1cc341,null));};exports[_0x8f4a('0x42')]=function(_0x15477c,_0x5e5029){var _0x16c2d8={'raw':![],'where':{'id':_0x15477c[_0x8f4a('0x43')]['id']}},_0x34671f={};_0x34671f[_0x8f4a('0x32')]=_['keys'](db[_0x8f4a('0x3f')][_0x8f4a('0x2f')]);_0x34671f['query']=_[_0x8f4a('0x34')](_0x15477c[_0x8f4a('0x33')]);_0x34671f[_0x8f4a('0x35')]=_[_0x8f4a('0x36')](_0x34671f[_0x8f4a('0x32')],_0x34671f['query']);_0x16c2d8[_0x8f4a('0x37')]=_[_0x8f4a('0x36')](_0x34671f[_0x8f4a('0x32')],qs['fields'](_0x15477c['query'][_0x8f4a('0x38')]));_0x16c2d8[_0x8f4a('0x37')]=_0x16c2d8[_0x8f4a('0x37')][_0x8f4a('0x44')]?_0x16c2d8[_0x8f4a('0x37')]:_0x34671f['model'];if(_0x15477c[_0x8f4a('0x33')][_0x8f4a('0x40')]){_0x16c2d8['include']=[{'all':!![]}];}_0x16c2d8=_['merge']({},_0x16c2d8,_0x15477c['options']);return db['SugarcrmConfiguration'][_0x8f4a('0x45')](_0x16c2d8)[_0x8f4a('0x26')](handleEntityNotFound(_0x5e5029,null))[_0x8f4a('0x26')](respondWithResult(_0x5e5029,null))['catch'](handleError(_0x5e5029,null));};exports[_0x8f4a('0x46')]=function(_0x386ef3,_0x4f8179){return db[_0x8f4a('0x3f')][_0x8f4a('0x46')](_0x386ef3[_0x8f4a('0x47')],{})[_0x8f4a('0x26')](respondWithResult(_0x4f8179,0xc9))[_0x8f4a('0x48')](handleError(_0x4f8179,null));};exports[_0x8f4a('0x25')]=function(_0x106637,_0x5502db){if(_0x106637[_0x8f4a('0x47')]['id']){delete _0x106637['body']['id'];}return db[_0x8f4a('0x3f')][_0x8f4a('0x45')]({'where':{'id':_0x106637['params']['id']}})[_0x8f4a('0x26')](handleEntityNotFound(_0x5502db,null))[_0x8f4a('0x26')](saveUpdates(_0x106637[_0x8f4a('0x47')],null))[_0x8f4a('0x26')](respondWithResult(_0x5502db,null))['catch'](handleError(_0x5502db,null));};exports[_0x8f4a('0x27')]=function(_0x1601c1,_0xb31226){return db['SugarcrmConfiguration'][_0x8f4a('0x45')]({'where':{'id':_0x1601c1[_0x8f4a('0x43')]['id']}})[_0x8f4a('0x26')](handleEntityNotFound(_0xb31226,null))[_0x8f4a('0x26')](removeEntity(_0xb31226,null))[_0x8f4a('0x48')](handleError(_0xb31226,null));};exports[_0x8f4a('0x49')]=function(_0x39608d,_0x500551,_0x226a36){var _0x205ad7={};var _0x287876={};var _0x25f0e5;var _0x5467c9;return db[_0x8f4a('0x3f')][_0x8f4a('0x4a')]({'where':{'id':_0x39608d[_0x8f4a('0x43')]['id']}})[_0x8f4a('0x26')](handleEntityNotFound(_0x500551,null))['then'](function(_0x5768fd){if(_0x5768fd){_0x25f0e5=_0x5768fd;_0x287876[_0x8f4a('0x32')]=_[_0x8f4a('0x34')](db[_0x8f4a('0x4b')]['rawAttributes']);_0x287876[_0x8f4a('0x33')]=_['keys'](_0x39608d[_0x8f4a('0x33')]);_0x287876['filters']=_[_0x8f4a('0x36')](_0x287876['model'],_0x287876[_0x8f4a('0x33')]);_0x205ad7['attributes']=_[_0x8f4a('0x36')](_0x287876['model'],qs[_0x8f4a('0x38')](_0x39608d[_0x8f4a('0x33')]['fields']));_0x205ad7[_0x8f4a('0x37')]=_0x205ad7[_0x8f4a('0x37')][_0x8f4a('0x44')]?_0x205ad7[_0x8f4a('0x37')]:_0x287876[_0x8f4a('0x32')];_0x205ad7[_0x8f4a('0x39')]=qs[_0x8f4a('0x3a')](_0x39608d[_0x8f4a('0x33')][_0x8f4a('0x3a')]);_0x205ad7[_0x8f4a('0x3d')]=qs[_0x8f4a('0x35')](_[_0x8f4a('0x4c')](_0x39608d[_0x8f4a('0x33')],_0x287876[_0x8f4a('0x35')]));if(_0x39608d[_0x8f4a('0x33')][_0x8f4a('0x3b')]){_0x205ad7[_0x8f4a('0x3d')]=_[_0x8f4a('0x3c')](_0x205ad7['where'],{'$or':_['map'](_0x205ad7[_0x8f4a('0x37')],function(_0x440ffe){var _0x27e36e={};_0x27e36e[_0x440ffe]={'$like':'%'+_0x39608d[_0x8f4a('0x33')]['filter']+'%'};return _0x27e36e;})});}_0x205ad7=_['merge']({},_0x205ad7,_0x39608d[_0x8f4a('0x3e')]);return _0x25f0e5['getFields'](_0x205ad7);}})[_0x8f4a('0x26')](function(_0x559df5){if(_0x559df5){_0x5467c9=_0x559df5[_0x8f4a('0x44')];if(!_0x39608d[_0x8f4a('0x33')][_0x8f4a('0x4d')](_0x8f4a('0x4e'))){_0x205ad7['limit']=qs[_0x8f4a('0x1d')](_0x39608d[_0x8f4a('0x33')][_0x8f4a('0x1d')]);_0x205ad7['offset']=qs[_0x8f4a('0x1c')](_0x39608d[_0x8f4a('0x33')][_0x8f4a('0x1c')]);}return _0x25f0e5[_0x8f4a('0x49')](_0x205ad7);}})['then'](function(_0x18ac8d){if(_0x18ac8d){return _0x18ac8d?{'count':_0x5467c9,'rows':_0x18ac8d}:null;}})[_0x8f4a('0x26')](respondWithResult(_0x500551,null))[_0x8f4a('0x48')](handleError(_0x500551,null));};exports[_0x8f4a('0x4f')]=function(_0x29bb64,_0x2c706d,_0x503e92){var _0x49107d={};var _0x1415ed={};var _0x2876b3;var _0x5a015d;return db['SugarcrmConfiguration'][_0x8f4a('0x4a')]({'where':{'id':_0x29bb64['params']['id']}})[_0x8f4a('0x26')](handleEntityNotFound(_0x2c706d,null))[_0x8f4a('0x26')](function(_0x26ce69){if(_0x26ce69){_0x2876b3=_0x26ce69;_0x1415ed[_0x8f4a('0x32')]=_['keys'](db[_0x8f4a('0x4b')][_0x8f4a('0x2f')]);_0x1415ed[_0x8f4a('0x33')]=_['keys'](_0x29bb64['query']);_0x1415ed[_0x8f4a('0x35')]=_['intersection'](_0x1415ed[_0x8f4a('0x32')],_0x1415ed['query']);_0x49107d[_0x8f4a('0x37')]=_['intersection'](_0x1415ed[_0x8f4a('0x32')],qs[_0x8f4a('0x38')](_0x29bb64['query'][_0x8f4a('0x38')]));_0x49107d[_0x8f4a('0x37')]=_0x49107d[_0x8f4a('0x37')][_0x8f4a('0x44')]?_0x49107d[_0x8f4a('0x37')]:_0x1415ed[_0x8f4a('0x32')];_0x49107d['order']=qs[_0x8f4a('0x3a')](_0x29bb64['query'][_0x8f4a('0x3a')]);_0x49107d[_0x8f4a('0x3d')]=qs['filters'](_[_0x8f4a('0x4c')](_0x29bb64[_0x8f4a('0x33')],_0x1415ed[_0x8f4a('0x35')]));if(_0x29bb64['query'][_0x8f4a('0x3b')]){_0x49107d[_0x8f4a('0x3d')]=_[_0x8f4a('0x3c')](_0x49107d[_0x8f4a('0x3d')],{'$or':_[_0x8f4a('0x2e')](_0x49107d[_0x8f4a('0x37')],function(_0x12d8c0){var _0x1e7f9a={};_0x1e7f9a[_0x12d8c0]={'$like':'%'+_0x29bb64[_0x8f4a('0x33')]['filter']+'%'};return _0x1e7f9a;})});}_0x49107d=_['merge']({},_0x49107d,_0x29bb64[_0x8f4a('0x3e')]);return _0x2876b3[_0x8f4a('0x4f')](_0x49107d);}})[_0x8f4a('0x26')](function(_0x2a7263){if(_0x2a7263){_0x5a015d=_0x2a7263[_0x8f4a('0x44')];if(!_0x29bb64[_0x8f4a('0x33')][_0x8f4a('0x4d')](_0x8f4a('0x4e'))){_0x49107d[_0x8f4a('0x1d')]=qs['limit'](_0x29bb64[_0x8f4a('0x33')][_0x8f4a('0x1d')]);_0x49107d[_0x8f4a('0x1c')]=qs[_0x8f4a('0x1c')](_0x29bb64[_0x8f4a('0x33')][_0x8f4a('0x1c')]);}return _0x2876b3[_0x8f4a('0x4f')](_0x49107d);}})['then'](function(_0x3d75c8){if(_0x3d75c8){return _0x3d75c8?{'count':_0x5a015d,'rows':_0x3d75c8}:null;}})[_0x8f4a('0x26')](respondWithResult(_0x2c706d,null))[_0x8f4a('0x48')](handleError(_0x2c706d,null));};exports[_0x8f4a('0x50')]=function(_0x4f35f3,_0x2e05b4,_0xd18ccd){var _0x2f67b0={};var _0xf53aa2={};var _0x2a3dc4;var _0x4c50d8;return db['SugarcrmConfiguration'][_0x8f4a('0x4a')]({'where':{'id':_0x4f35f3['params']['id']}})['then'](handleEntityNotFound(_0x2e05b4,null))[_0x8f4a('0x26')](function(_0x3d2419){if(_0x3d2419){_0x2a3dc4=_0x3d2419;_0xf53aa2['model']=_[_0x8f4a('0x34')](db[_0x8f4a('0x4b')][_0x8f4a('0x2f')]);_0xf53aa2[_0x8f4a('0x33')]=_['keys'](_0x4f35f3[_0x8f4a('0x33')]);_0xf53aa2[_0x8f4a('0x35')]=_['intersection'](_0xf53aa2['model'],_0xf53aa2[_0x8f4a('0x33')]);_0x2f67b0[_0x8f4a('0x37')]=_[_0x8f4a('0x36')](_0xf53aa2[_0x8f4a('0x32')],qs[_0x8f4a('0x38')](_0x4f35f3['query'][_0x8f4a('0x38')]));_0x2f67b0[_0x8f4a('0x37')]=_0x2f67b0['attributes']['length']?_0x2f67b0[_0x8f4a('0x37')]:_0xf53aa2[_0x8f4a('0x32')];_0x2f67b0[_0x8f4a('0x39')]=qs[_0x8f4a('0x3a')](_0x4f35f3[_0x8f4a('0x33')][_0x8f4a('0x3a')]);_0x2f67b0['where']=qs['filters'](_[_0x8f4a('0x4c')](_0x4f35f3['query'],_0xf53aa2[_0x8f4a('0x35')]));if(_0x4f35f3[_0x8f4a('0x33')][_0x8f4a('0x3b')]){_0x2f67b0[_0x8f4a('0x3d')]=_[_0x8f4a('0x3c')](_0x2f67b0[_0x8f4a('0x3d')],{'$or':_[_0x8f4a('0x2e')](_0x2f67b0[_0x8f4a('0x37')],function(_0x49026e){var _0x4746c4={};_0x4746c4[_0x49026e]={'$like':'%'+_0x4f35f3[_0x8f4a('0x33')][_0x8f4a('0x3b')]+'%'};return _0x4746c4;})});}_0x2f67b0=_[_0x8f4a('0x3c')]({},_0x2f67b0,_0x4f35f3[_0x8f4a('0x3e')]);return _0x2a3dc4[_0x8f4a('0x50')](_0x2f67b0);}})[_0x8f4a('0x26')](function(_0x3362f8){if(_0x3362f8){_0x4c50d8=_0x3362f8[_0x8f4a('0x44')];if(!_0x4f35f3[_0x8f4a('0x33')][_0x8f4a('0x4d')](_0x8f4a('0x4e'))){_0x2f67b0[_0x8f4a('0x1d')]=qs[_0x8f4a('0x1d')](_0x4f35f3['query'][_0x8f4a('0x1d')]);_0x2f67b0[_0x8f4a('0x1c')]=qs[_0x8f4a('0x1c')](_0x4f35f3[_0x8f4a('0x33')][_0x8f4a('0x1c')]);}return _0x2a3dc4[_0x8f4a('0x50')](_0x2f67b0);}})[_0x8f4a('0x26')](function(_0x1a49a9){if(_0x1a49a9){return _0x1a49a9?{'count':_0x4c50d8,'rows':_0x1a49a9}:null;}})[_0x8f4a('0x26')](respondWithResult(_0x2e05b4,null))[_0x8f4a('0x48')](handleError(_0x2e05b4,null));}; \ No newline at end of file +var _0x4b31=['VIRTUAL','options','include','findAll','rows','show','includeAll','find','create','body','catch','params','destroy','getFields','findOne','SugarcrmField','order','getSubjects','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x52e920,_0xea93bb){var _0x819cc3=function(_0x2b1330){while(--_0x2b1330){_0x52e920['push'](_0x52e920['shift']());}};_0x819cc3(++_0xea93bb);}(_0x4b31,0x142));var _0x14b3=function(_0x19beab,_0x2c9e3e){_0x19beab=_0x19beab-0x0;var _0x14d7fe=_0x4b31[_0x19beab];return _0x14d7fe;};'use strict';var emlformat=require(_0x14b3('0x0'));var rimraf=require(_0x14b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14b3('0x2'));var rp=require('request-promise');var moment=require(_0x14b3('0x3'));var BPromise=require(_0x14b3('0x4'));var Mustache=require(_0x14b3('0x5'));var util=require(_0x14b3('0x6'));var path=require('path');var sox=require(_0x14b3('0x7'));var csv=require(_0x14b3('0x8'));var ejs=require(_0x14b3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x14b3('0xa'));var crypto=require(_0x14b3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x14b3('0xc'));var toCsv=require(_0x14b3('0x8'));var querystring=require(_0x14b3('0xd'));var Papa=require(_0x14b3('0xe'));var Redis=require(_0x14b3('0xf'));var authService=require(_0x14b3('0x10'));var qs=require(_0x14b3('0x11'));var as=require(_0x14b3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x14b3('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1be116,_0x34426e){_0x34426e=_0x34426e||0xcc;return function(_0x53ba42){if(_0x53ba42){return _0x1be116['sendStatus'](_0x34426e);}return _0x1be116['status'](_0x34426e)[_0x14b3('0x14')]();};}function respondWithResult(_0x277da7,_0x167c3b){_0x167c3b=_0x167c3b||0xc8;return function(_0x53683d){if(_0x53683d){return _0x277da7[_0x14b3('0x15')](_0x167c3b)[_0x14b3('0x16')](_0x53683d);}};}function respondWithFilteredResult(_0x3f81da,_0x54eb30){return function(_0x43b4bd){if(_0x43b4bd){var _0x356949=typeof _0x54eb30['offset']===_0x14b3('0x17')&&typeof _0x54eb30[_0x14b3('0x18')]===_0x14b3('0x17');var _0x145919=_0x43b4bd[_0x14b3('0x19')];var _0x1ba560=_0x356949?0x0:_0x54eb30[_0x14b3('0x1a')];var _0x2bbe87=_0x356949?_0x43b4bd[_0x14b3('0x19')]:_0x54eb30['offset']+_0x54eb30[_0x14b3('0x18')];var _0x4e74f6;if(_0x2bbe87>=_0x145919){_0x2bbe87=_0x145919;_0x4e74f6=0xc8;}else{_0x4e74f6=0xce;}_0x3f81da[_0x14b3('0x15')](_0x4e74f6);return _0x3f81da[_0x14b3('0x1b')](_0x14b3('0x1c'),_0x1ba560+'-'+_0x2bbe87+'/'+_0x145919)[_0x14b3('0x16')](_0x43b4bd);}return null;};}function patchUpdates(_0x326430){return function(_0x4347b6){try{jsonpatch[_0x14b3('0x1d')](_0x4347b6,_0x326430,!![]);}catch(_0x514906){return BPromise[_0x14b3('0x1e')](_0x514906);}return _0x4347b6[_0x14b3('0x1f')]();};}function saveUpdates(_0x105e04,_0x29d771){return function(_0x3ba79d){if(_0x3ba79d){return _0x3ba79d[_0x14b3('0x20')](_0x105e04)[_0x14b3('0x21')](function(_0x32ca99){return _0x32ca99;});}return null;};}function removeEntity(_0x306f1e,_0x236817){return function(_0x7976e8){if(_0x7976e8){return _0x7976e8['destroy']()[_0x14b3('0x21')](function(){_0x306f1e[_0x14b3('0x15')](0xcc)[_0x14b3('0x14')]();});}};}function handleEntityNotFound(_0x3672c1,_0x4b3543){return function(_0x30f15e){if(!_0x30f15e){_0x3672c1['sendStatus'](0x194);}return _0x30f15e;};}function handleError(_0x32a594,_0x1ff5a1){_0x1ff5a1=_0x1ff5a1||0x1f4;return function(_0x1f5e91){logger['error'](_0x1f5e91[_0x14b3('0x22')]);if(_0x1f5e91[_0x14b3('0x23')]){delete _0x1f5e91[_0x14b3('0x23')];}_0x32a594[_0x14b3('0x15')](_0x1ff5a1)[_0x14b3('0x24')](_0x1f5e91);};}exports[_0x14b3('0x25')]=function(_0x3faecd,_0x3135ef){var _0x199528={},_0x3469cb={},_0x3b61f0={'count':0x0,'rows':[]};var _0x2e42ed=_['map'](db[_0x14b3('0x26')][_0x14b3('0x27')],function(_0x159d59){return{'name':_0x159d59[_0x14b3('0x28')],'type':_0x159d59[_0x14b3('0x29')][_0x14b3('0x2a')]};});_0x3469cb['model']=_[_0x14b3('0x2b')](_0x2e42ed,_0x14b3('0x23'));_0x3469cb['query']=_[_0x14b3('0x2c')](_0x3faecd[_0x14b3('0x2d')]);_0x3469cb[_0x14b3('0x2e')]=_['intersection'](_0x3469cb[_0x14b3('0x2f')],_0x3469cb[_0x14b3('0x2d')]);_0x199528['attributes']=_[_0x14b3('0x30')](_0x3469cb[_0x14b3('0x2f')],qs[_0x14b3('0x31')](_0x3faecd['query'][_0x14b3('0x31')]));_0x199528[_0x14b3('0x32')]=_0x199528['attributes'][_0x14b3('0x33')]?_0x199528['attributes']:_0x3469cb['model'];if(!_0x3faecd['query'][_0x14b3('0x34')](_0x14b3('0x35'))){_0x199528[_0x14b3('0x18')]=qs[_0x14b3('0x18')](_0x3faecd['query']['limit']);_0x199528[_0x14b3('0x1a')]=qs['offset'](_0x3faecd['query'][_0x14b3('0x1a')]);}_0x199528['order']=qs['sort'](_0x3faecd['query'][_0x14b3('0x36')]);_0x199528[_0x14b3('0x37')]=qs[_0x14b3('0x2e')](_['pick'](_0x3faecd[_0x14b3('0x2d')],_0x3469cb[_0x14b3('0x2e')]),_0x2e42ed);if(_0x3faecd[_0x14b3('0x2d')][_0x14b3('0x38')]){_0x199528[_0x14b3('0x37')]=_[_0x14b3('0x39')](_0x199528[_0x14b3('0x37')],{'$or':_[_0x14b3('0x2b')](_0x2e42ed,function(_0x174876){if(_0x174876[_0x14b3('0x29')]!==_0x14b3('0x3a')){var _0x3efa4e={};_0x3efa4e[_0x174876[_0x14b3('0x23')]]={'$like':'%'+_0x3faecd[_0x14b3('0x2d')]['filter']+'%'};return _0x3efa4e;}})});}_0x199528=_['merge']({},_0x199528,_0x3faecd[_0x14b3('0x3b')]);var _0x49d01a={'where':_0x199528[_0x14b3('0x37')]};return db[_0x14b3('0x26')]['count'](_0x49d01a)[_0x14b3('0x21')](function(_0x3df2d7){_0x3b61f0[_0x14b3('0x19')]=_0x3df2d7;if(_0x3faecd[_0x14b3('0x2d')]['includeAll']){_0x199528[_0x14b3('0x3c')]=[{'all':!![]}];}return db[_0x14b3('0x26')][_0x14b3('0x3d')](_0x199528);})[_0x14b3('0x21')](function(_0x667d5e){_0x3b61f0[_0x14b3('0x3e')]=_0x667d5e;return _0x3b61f0;})[_0x14b3('0x21')](respondWithFilteredResult(_0x3135ef,_0x199528))['catch'](handleError(_0x3135ef,null));};exports[_0x14b3('0x3f')]=function(_0x39e108,_0x46cdea){var _0x46ecd3={'raw':![],'where':{'id':_0x39e108['params']['id']}},_0x108d4b={};_0x108d4b[_0x14b3('0x2f')]=_['keys'](db['SugarcrmConfiguration'][_0x14b3('0x27')]);_0x108d4b['query']=_[_0x14b3('0x2c')](_0x39e108[_0x14b3('0x2d')]);_0x108d4b[_0x14b3('0x2e')]=_[_0x14b3('0x30')](_0x108d4b[_0x14b3('0x2f')],_0x108d4b[_0x14b3('0x2d')]);_0x46ecd3[_0x14b3('0x32')]=_[_0x14b3('0x30')](_0x108d4b[_0x14b3('0x2f')],qs[_0x14b3('0x31')](_0x39e108['query'][_0x14b3('0x31')]));_0x46ecd3[_0x14b3('0x32')]=_0x46ecd3[_0x14b3('0x32')][_0x14b3('0x33')]?_0x46ecd3[_0x14b3('0x32')]:_0x108d4b[_0x14b3('0x2f')];if(_0x39e108['query'][_0x14b3('0x40')]){_0x46ecd3['include']=[{'all':!![]}];}_0x46ecd3=_[_0x14b3('0x39')]({},_0x46ecd3,_0x39e108['options']);return db['SugarcrmConfiguration'][_0x14b3('0x41')](_0x46ecd3)[_0x14b3('0x21')](handleEntityNotFound(_0x46cdea,null))[_0x14b3('0x21')](respondWithResult(_0x46cdea,null))['catch'](handleError(_0x46cdea,null));};exports[_0x14b3('0x42')]=function(_0x33eed4,_0x1df713){return db['SugarcrmConfiguration'][_0x14b3('0x42')](_0x33eed4[_0x14b3('0x43')],{})[_0x14b3('0x21')](respondWithResult(_0x1df713,0xc9))[_0x14b3('0x44')](handleError(_0x1df713,null));};exports[_0x14b3('0x20')]=function(_0x26a8b3,_0x2330f0){if(_0x26a8b3[_0x14b3('0x43')]['id']){delete _0x26a8b3[_0x14b3('0x43')]['id'];}return db['SugarcrmConfiguration'][_0x14b3('0x41')]({'where':{'id':_0x26a8b3[_0x14b3('0x45')]['id']}})[_0x14b3('0x21')](handleEntityNotFound(_0x2330f0,null))['then'](saveUpdates(_0x26a8b3['body'],null))[_0x14b3('0x21')](respondWithResult(_0x2330f0,null))[_0x14b3('0x44')](handleError(_0x2330f0,null));};exports[_0x14b3('0x46')]=function(_0x317cad,_0x44f391){return db[_0x14b3('0x26')][_0x14b3('0x41')]({'where':{'id':_0x317cad['params']['id']}})[_0x14b3('0x21')](handleEntityNotFound(_0x44f391,null))[_0x14b3('0x21')](removeEntity(_0x44f391,null))[_0x14b3('0x44')](handleError(_0x44f391,null));};exports[_0x14b3('0x47')]=function(_0x19ba3b,_0x38c1ca,_0x2a41fc){var _0x229288={};var _0x8ddc41={};var _0x45697d;var _0x45f5b7;return db[_0x14b3('0x26')][_0x14b3('0x48')]({'where':{'id':_0x19ba3b[_0x14b3('0x45')]['id']}})['then'](handleEntityNotFound(_0x38c1ca,null))[_0x14b3('0x21')](function(_0x2476d2){if(_0x2476d2){_0x45697d=_0x2476d2;_0x8ddc41['model']=_['keys'](db[_0x14b3('0x49')][_0x14b3('0x27')]);_0x8ddc41['query']=_[_0x14b3('0x2c')](_0x19ba3b[_0x14b3('0x2d')]);_0x8ddc41[_0x14b3('0x2e')]=_['intersection'](_0x8ddc41[_0x14b3('0x2f')],_0x8ddc41[_0x14b3('0x2d')]);_0x229288[_0x14b3('0x32')]=_[_0x14b3('0x30')](_0x8ddc41[_0x14b3('0x2f')],qs['fields'](_0x19ba3b['query'][_0x14b3('0x31')]));_0x229288[_0x14b3('0x32')]=_0x229288[_0x14b3('0x32')][_0x14b3('0x33')]?_0x229288[_0x14b3('0x32')]:_0x8ddc41[_0x14b3('0x2f')];_0x229288[_0x14b3('0x4a')]=qs[_0x14b3('0x36')](_0x19ba3b[_0x14b3('0x2d')][_0x14b3('0x36')]);_0x229288[_0x14b3('0x37')]=qs[_0x14b3('0x2e')](_['pick'](_0x19ba3b[_0x14b3('0x2d')],_0x8ddc41[_0x14b3('0x2e')]));if(_0x19ba3b[_0x14b3('0x2d')][_0x14b3('0x38')]){_0x229288[_0x14b3('0x37')]=_[_0x14b3('0x39')](_0x229288[_0x14b3('0x37')],{'$or':_['map'](_0x229288[_0x14b3('0x32')],function(_0x4ff145){var _0x360e2d={};_0x360e2d[_0x4ff145]={'$like':'%'+_0x19ba3b[_0x14b3('0x2d')]['filter']+'%'};return _0x360e2d;})});}_0x229288=_[_0x14b3('0x39')]({},_0x229288,_0x19ba3b['options']);return _0x45697d[_0x14b3('0x47')](_0x229288);}})['then'](function(_0x117c9f){if(_0x117c9f){_0x45f5b7=_0x117c9f[_0x14b3('0x33')];if(!_0x19ba3b[_0x14b3('0x2d')][_0x14b3('0x34')]('nolimit')){_0x229288[_0x14b3('0x18')]=qs['limit'](_0x19ba3b[_0x14b3('0x2d')][_0x14b3('0x18')]);_0x229288['offset']=qs[_0x14b3('0x1a')](_0x19ba3b[_0x14b3('0x2d')][_0x14b3('0x1a')]);}return _0x45697d['getFields'](_0x229288);}})[_0x14b3('0x21')](function(_0x1b1c1d){if(_0x1b1c1d){return _0x1b1c1d?{'count':_0x45f5b7,'rows':_0x1b1c1d}:null;}})[_0x14b3('0x21')](respondWithResult(_0x38c1ca,null))[_0x14b3('0x44')](handleError(_0x38c1ca,null));};exports['getSubjects']=function(_0x445b6d,_0x26208f,_0x591c85){var _0x313b15={};var _0x372eb2={};var _0x1baf68;var _0x5d9b8f;return db['SugarcrmConfiguration'][_0x14b3('0x48')]({'where':{'id':_0x445b6d[_0x14b3('0x45')]['id']}})[_0x14b3('0x21')](handleEntityNotFound(_0x26208f,null))[_0x14b3('0x21')](function(_0x228aff){if(_0x228aff){_0x1baf68=_0x228aff;_0x372eb2[_0x14b3('0x2f')]=_[_0x14b3('0x2c')](db['SugarcrmField'][_0x14b3('0x27')]);_0x372eb2[_0x14b3('0x2d')]=_[_0x14b3('0x2c')](_0x445b6d['query']);_0x372eb2[_0x14b3('0x2e')]=_['intersection'](_0x372eb2[_0x14b3('0x2f')],_0x372eb2[_0x14b3('0x2d')]);_0x313b15['attributes']=_[_0x14b3('0x30')](_0x372eb2[_0x14b3('0x2f')],qs[_0x14b3('0x31')](_0x445b6d[_0x14b3('0x2d')][_0x14b3('0x31')]));_0x313b15[_0x14b3('0x32')]=_0x313b15[_0x14b3('0x32')]['length']?_0x313b15['attributes']:_0x372eb2[_0x14b3('0x2f')];_0x313b15[_0x14b3('0x4a')]=qs[_0x14b3('0x36')](_0x445b6d[_0x14b3('0x2d')][_0x14b3('0x36')]);_0x313b15['where']=qs[_0x14b3('0x2e')](_['pick'](_0x445b6d[_0x14b3('0x2d')],_0x372eb2[_0x14b3('0x2e')]));if(_0x445b6d[_0x14b3('0x2d')][_0x14b3('0x38')]){_0x313b15[_0x14b3('0x37')]=_[_0x14b3('0x39')](_0x313b15[_0x14b3('0x37')],{'$or':_[_0x14b3('0x2b')](_0x313b15[_0x14b3('0x32')],function(_0x9dfca1){var _0x356778={};_0x356778[_0x9dfca1]={'$like':'%'+_0x445b6d[_0x14b3('0x2d')]['filter']+'%'};return _0x356778;})});}_0x313b15=_[_0x14b3('0x39')]({},_0x313b15,_0x445b6d[_0x14b3('0x3b')]);return _0x1baf68['getSubjects'](_0x313b15);}})['then'](function(_0x29090f){if(_0x29090f){_0x5d9b8f=_0x29090f[_0x14b3('0x33')];if(!_0x445b6d[_0x14b3('0x2d')][_0x14b3('0x34')]('nolimit')){_0x313b15['limit']=qs[_0x14b3('0x18')](_0x445b6d[_0x14b3('0x2d')][_0x14b3('0x18')]);_0x313b15[_0x14b3('0x1a')]=qs['offset'](_0x445b6d[_0x14b3('0x2d')]['offset']);}return _0x1baf68[_0x14b3('0x4b')](_0x313b15);}})[_0x14b3('0x21')](function(_0x360b19){if(_0x360b19){return _0x360b19?{'count':_0x5d9b8f,'rows':_0x360b19}:null;}})[_0x14b3('0x21')](respondWithResult(_0x26208f,null))[_0x14b3('0x44')](handleError(_0x26208f,null));};exports['getDescriptions']=function(_0x4298de,_0x4c11cd,_0x1ec950){var _0x183814={};var _0x2f46aa={};var _0x412575;var _0x1f8cca;return db[_0x14b3('0x26')][_0x14b3('0x48')]({'where':{'id':_0x4298de[_0x14b3('0x45')]['id']}})[_0x14b3('0x21')](handleEntityNotFound(_0x4c11cd,null))['then'](function(_0xf92fa6){if(_0xf92fa6){_0x412575=_0xf92fa6;_0x2f46aa[_0x14b3('0x2f')]=_[_0x14b3('0x2c')](db[_0x14b3('0x49')]['rawAttributes']);_0x2f46aa['query']=_[_0x14b3('0x2c')](_0x4298de[_0x14b3('0x2d')]);_0x2f46aa[_0x14b3('0x2e')]=_[_0x14b3('0x30')](_0x2f46aa[_0x14b3('0x2f')],_0x2f46aa['query']);_0x183814[_0x14b3('0x32')]=_['intersection'](_0x2f46aa[_0x14b3('0x2f')],qs[_0x14b3('0x31')](_0x4298de[_0x14b3('0x2d')][_0x14b3('0x31')]));_0x183814[_0x14b3('0x32')]=_0x183814[_0x14b3('0x32')][_0x14b3('0x33')]?_0x183814[_0x14b3('0x32')]:_0x2f46aa[_0x14b3('0x2f')];_0x183814[_0x14b3('0x4a')]=qs[_0x14b3('0x36')](_0x4298de['query'][_0x14b3('0x36')]);_0x183814['where']=qs[_0x14b3('0x2e')](_['pick'](_0x4298de[_0x14b3('0x2d')],_0x2f46aa[_0x14b3('0x2e')]));if(_0x4298de[_0x14b3('0x2d')][_0x14b3('0x38')]){_0x183814[_0x14b3('0x37')]=_['merge'](_0x183814[_0x14b3('0x37')],{'$or':_[_0x14b3('0x2b')](_0x183814['attributes'],function(_0x13fac8){var _0x18580a={};_0x18580a[_0x13fac8]={'$like':'%'+_0x4298de[_0x14b3('0x2d')][_0x14b3('0x38')]+'%'};return _0x18580a;})});}_0x183814=_[_0x14b3('0x39')]({},_0x183814,_0x4298de[_0x14b3('0x3b')]);return _0x412575['getDescriptions'](_0x183814);}})['then'](function(_0x4b2fb5){if(_0x4b2fb5){_0x1f8cca=_0x4b2fb5[_0x14b3('0x33')];if(!_0x4298de['query']['hasOwnProperty'](_0x14b3('0x35'))){_0x183814[_0x14b3('0x18')]=qs['limit'](_0x4298de[_0x14b3('0x2d')][_0x14b3('0x18')]);_0x183814['offset']=qs[_0x14b3('0x1a')](_0x4298de[_0x14b3('0x2d')]['offset']);}return _0x412575['getDescriptions'](_0x183814);}})['then'](function(_0x5d65a0){if(_0x5d65a0){return _0x5d65a0?{'count':_0x1f8cca,'rows':_0x5d65a0}:null;}})[_0x14b3('0x21')](respondWithResult(_0x4c11cd,null))[_0x14b3('0x44')](handleError(_0x4c11cd,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 708db32..c7b9719 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 _0x2c9e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','util'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x2c9e,0x175));var _0xe2c9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2c9e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xe2c9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe2c9('0x1'));var BPromise=require(_0xe2c9('0x2'));var rp=require(_0xe2c9('0x3'));var fs=require('fs');var path=require(_0xe2c9('0x4'));var rimraf=require(_0xe2c9('0x5'));var config=require(_0xe2c9('0x6'));var attributes=require(_0xe2c9('0x7'));module[_0xe2c9('0x8')]=function(_0x42d71b,_0xe6f6a1){return _0x42d71b[_0xe2c9('0x9')](_0xe2c9('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe697=['moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','../../config/logger'];(function(_0x3154e1,_0x5d484e){var _0x5ebffe=function(_0x3546d6){while(--_0x3546d6){_0x3154e1['push'](_0x3154e1['shift']());}};_0x5ebffe(++_0x5d484e);}(_0xe697,0xf2));var _0x7e69=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0xe697[_0xfb42e6];return _0x27265b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7e69('0x0'))('api');var moment=require(_0x7e69('0x1'));var BPromise=require(_0x7e69('0x2'));var rp=require(_0x7e69('0x3'));var fs=require('fs');var path=require(_0x7e69('0x4'));var rimraf=require(_0x7e69('0x5'));var config=require('../../config/environment');var attributes=require(_0x7e69('0x6'));module['exports']=function(_0x3a2d10,_0xcc3cf1){return _0x3a2d10[_0x7e69('0x7')](_0x7e69('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 8a6d536..55ba98d 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 _0xc724=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then'];(function(_0x139701,_0x171296){var _0x2289c0=function(_0x5bbf96){while(--_0x5bbf96){_0x139701['push'](_0x139701['shift']());}};_0x2289c0(++_0x171296);}(_0xc724,0xac));var _0x4c72=function(_0x42f5ef,_0x3dec9a){_0x42f5ef=_0x42f5ef-0x0;var _0xf30565=_0xc724[_0x42f5ef];return _0xf30565;};'use strict';var _=require(_0x4c72('0x0'));var util=require('util');var moment=require(_0x4c72('0x1'));var BPromise=require(_0x4c72('0x2'));var rs=require(_0x4c72('0x3'));var fs=require('fs');var Redis=require(_0x4c72('0x4'));var db=require(_0x4c72('0x5'))['db'];var utils=require(_0x4c72('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c72('0x7'));var jayson=require(_0x4c72('0x8'));var client=jayson['client'][_0x4c72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8950a0,_0x48fa03,_0x3ca37d){return new BPromise(function(_0x59dbcd,_0x30f23a){return client[_0x4c72('0xa')](_0x8950a0,_0x3ca37d)[_0x4c72('0xb')](function(_0x2169da){logger[_0x4c72('0xc')](_0x4c72('0xd'),_0x48fa03,_0x4c72('0xe'));logger[_0x4c72('0xf')](_0x4c72('0x10'),_0x48fa03,_0x4c72('0xe'),JSON[_0x4c72('0x11')](_0x2169da));if(_0x2169da[_0x4c72('0x12')]){if(_0x2169da[_0x4c72('0x12')][_0x4c72('0x13')]===0x1f4){logger[_0x4c72('0x12')](_0x4c72('0xd'),_0x48fa03,_0x2169da[_0x4c72('0x12')][_0x4c72('0x14')]);return _0x30f23a(_0x2169da[_0x4c72('0x12')][_0x4c72('0x14')]);}logger[_0x4c72('0x12')](_0x4c72('0xd'),_0x48fa03,_0x2169da['error'][_0x4c72('0x14')]);return _0x59dbcd(_0x2169da[_0x4c72('0x12')][_0x4c72('0x14')]);}else{logger['info'](_0x4c72('0xd'),_0x48fa03,_0x4c72('0xe'));_0x59dbcd(_0x2169da[_0x4c72('0x15')]['message']);}})[_0x4c72('0x16')](function(_0x57c4ec){logger[_0x4c72('0x12')](_0x4c72('0xd'),_0x48fa03,_0x57c4ec);_0x30f23a(_0x57c4ec);});});} \ No newline at end of file +var _0x5750=['code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error'];(function(_0x45e3cb,_0x35c413){var _0x1649ae=function(_0x3eb074){while(--_0x3eb074){_0x45e3cb['push'](_0x45e3cb['shift']());}};_0x1649ae(++_0x35c413);}(_0x5750,0x194));var _0x0575=function(_0xb0469e,_0x57edb5){_0xb0469e=_0xb0469e-0x0;var _0x3a8da5=_0x5750[_0xb0469e];return _0x3a8da5;};'use strict';var _=require(_0x0575('0x0'));var util=require('util');var moment=require(_0x0575('0x1'));var BPromise=require(_0x0575('0x2'));var rs=require(_0x0575('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0575('0x4'))['db'];var utils=require(_0x0575('0x5'));var logger=require('../../config/logger')(_0x0575('0x6'));var config=require(_0x0575('0x7'));var jayson=require(_0x0575('0x8'));var client=jayson['client'][_0x0575('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4055f3,_0xc25b3f,_0x58675d){return new BPromise(function(_0x4871b5,_0x3ba292){return client['request'](_0x4055f3,_0x58675d)[_0x0575('0xa')](function(_0xa02d7e){logger[_0x0575('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc25b3f,_0x0575('0xc'));logger[_0x0575('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xc25b3f,_0x0575('0xc'),JSON[_0x0575('0xe')](_0xa02d7e));if(_0xa02d7e['error']){if(_0xa02d7e[_0x0575('0xf')][_0x0575('0x10')]===0x1f4){logger[_0x0575('0xf')](_0x0575('0x11'),_0xc25b3f,_0xa02d7e[_0x0575('0xf')][_0x0575('0x12')]);return _0x3ba292(_0xa02d7e[_0x0575('0xf')]['message']);}logger[_0x0575('0xf')](_0x0575('0x11'),_0xc25b3f,_0xa02d7e['error'][_0x0575('0x12')]);return _0x4871b5(_0xa02d7e['error'][_0x0575('0x12')]);}else{logger[_0x0575('0xb')](_0x0575('0x11'),_0xc25b3f,_0x0575('0xc'));_0x4871b5(_0xa02d7e[_0x0575('0x13')][_0x0575('0x12')]);}})[_0x0575('0x14')](function(_0x287744){logger[_0x0575('0xf')](_0x0575('0x11'),_0xc25b3f,_0x287744);_0x3ba292(_0x287744);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index df947ed..2be0982 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 _0xa651=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa651,0xb6));var _0x1a65=function(_0x2610b3,_0x5dd9a6){_0x2610b3=_0x2610b3-0x0;var _0xbaa921=_0xa651[_0x2610b3];return _0xbaa921;};'use strict';var multer=require(_0x1a65('0x0'));var util=require(_0x1a65('0x1'));var path=require(_0x1a65('0x2'));var timeout=require(_0x1a65('0x3'));var express=require(_0x1a65('0x4'));var router=express['Router']();var fs_extra=require(_0x1a65('0x5'));var auth=require(_0x1a65('0x6'));var interaction=require(_0x1a65('0x7'));var config=require(_0x1a65('0x8'));var controller=require(_0x1a65('0x9'));router[_0x1a65('0xa')]('/',auth[_0x1a65('0xb')](),controller['index']);router[_0x1a65('0xa')](_0x1a65('0xc'),auth[_0x1a65('0xb')](),controller['show']);router[_0x1a65('0xd')]('/',auth[_0x1a65('0xb')](),controller[_0x1a65('0xe')]);router[_0x1a65('0xf')](_0x1a65('0xc'),auth[_0x1a65('0xb')](),controller['update']);router[_0x1a65('0x10')](_0x1a65('0xc'),auth[_0x1a65('0xb')](),controller[_0x1a65('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd023=['../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x58a364,_0x3439f6){var _0x409b74=function(_0xff5c15){while(--_0xff5c15){_0x58a364['push'](_0x58a364['shift']());}};_0x409b74(++_0x3439f6);}(_0xd023,0x162));var _0x3d02=function(_0x34cea1,_0x16d860){_0x34cea1=_0x34cea1-0x0;var _0x2d796a=_0xd023[_0x34cea1];return _0x2d796a;};'use strict';var multer=require('multer');var util=require(_0x3d02('0x0'));var path=require('path');var timeout=require(_0x3d02('0x1'));var express=require(_0x3d02('0x2'));var router=express[_0x3d02('0x3')]();var fs_extra=require(_0x3d02('0x4'));var auth=require(_0x3d02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3d02('0x6'));var controller=require(_0x3d02('0x7'));router[_0x3d02('0x8')]('/',auth[_0x3d02('0x9')](),controller[_0x3d02('0xa')]);router[_0x3d02('0x8')](_0x3d02('0xb'),auth['isAuthenticated'](),controller[_0x3d02('0xc')]);router[_0x3d02('0xd')]('/',auth[_0x3d02('0x9')](),controller[_0x3d02('0xe')]);router['put'](_0x3d02('0xb'),auth['isAuthenticated'](),controller[_0x3d02('0xf')]);router[_0x3d02('0x10')](_0x3d02('0xb'),auth[_0x3d02('0x9')](),controller[_0x3d02('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 2a2f93d..6fd6d34 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 _0x6662=['customVariable','sequelize','ENUM','string','variable','picklist','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6662,0x12e));var _0x2666=function(_0x144f18,_0x39c0ae){_0x144f18=_0x144f18-0x0;var _0x49ef67=_0x6662[_0x144f18];return _0x49ef67;};'use strict';var Sequelize=require(_0x2666('0x0'));module['exports']={'type':{'type':Sequelize[_0x2666('0x1')](_0x2666('0x2'),_0x2666('0x3'),'customVariable','keyValue',_0x2666('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2666('0x5')]},'key':{'type':Sequelize[_0x2666('0x5')]},'keyType':{'type':Sequelize[_0x2666('0x1')](_0x2666('0x2'),_0x2666('0x3'),_0x2666('0x6'))},'keyContent':{'type':Sequelize[_0x2666('0x5')]},'idField':{'type':Sequelize[_0x2666('0x5')]},'nameField':{'type':Sequelize[_0x2666('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2666('0x5')]}}; \ No newline at end of file +var _0x4812=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x8c8762,_0x10c0ab){var _0x24e27b=function(_0x483e40){while(--_0x483e40){_0x8c8762['push'](_0x8c8762['shift']());}};_0x24e27b(++_0x10c0ab);}(_0x4812,0x1c8));var _0x2481=function(_0x3b014d,_0x516fdf){_0x3b014d=_0x3b014d-0x0;var _0x2789ea=_0x4812[_0x3b014d];return _0x2789ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2481('0x0')](_0x2481('0x1'),_0x2481('0x2'),_0x2481('0x3'),_0x2481('0x4'),_0x2481('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2481('0x6')]},'key':{'type':Sequelize[_0x2481('0x6')]},'keyType':{'type':Sequelize[_0x2481('0x0')](_0x2481('0x1'),_0x2481('0x2'),_0x2481('0x3'))},'keyContent':{'type':Sequelize[_0x2481('0x6')]},'idField':{'type':Sequelize[_0x2481('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2481('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2481('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index de05860..1d51a37 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 _0x974f=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','end','sendStatus','error','stack','send','map','SugarcrmField','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','name','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x3e3064,_0x3dd6f5){var _0x4547e1=function(_0x785d07){while(--_0x785d07){_0x3e3064['push'](_0x3e3064['shift']());}};_0x4547e1(++_0x3dd6f5);}(_0x974f,0x19e));var _0xf974=function(_0x154a24,_0x85d1a1){_0x154a24=_0x154a24-0x0;var _0x5559d6=_0x974f[_0x154a24];return _0x5559d6;};'use strict';var emlformat=require(_0xf974('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf974('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf974('0x2'));var moment=require(_0xf974('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf974('0x4'));var util=require('util');var path=require(_0xf974('0x5'));var sox=require('sox');var csv=require(_0xf974('0x6'));var ejs=require(_0xf974('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf974('0x8'));var squel=require('squel');var crypto=require(_0xf974('0x9'));var jsforce=require(_0xf974('0xa'));var deskjs=require(_0xf974('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf974('0xc'));var Redis=require(_0xf974('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf974('0xe'));var as=require(_0xf974('0xf'));var hardwareService=require(_0xf974('0x10'));var logger=require(_0xf974('0x11'))(_0xf974('0x12'));var utils=require(_0xf974('0x13'));var config=require(_0xf974('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf974('0x15'))['db'];function respondWithStatusCode(_0x553f67,_0x5c0d41){_0x5c0d41=_0x5c0d41||0xcc;return function(_0x3a4863){if(_0x3a4863){return _0x553f67['sendStatus'](_0x5c0d41);}return _0x553f67[_0xf974('0x16')](_0x5c0d41)['end']();};}function respondWithResult(_0x1da50d,_0x33800d){_0x33800d=_0x33800d||0xc8;return function(_0x2ac92a){if(_0x2ac92a){return _0x1da50d[_0xf974('0x16')](_0x33800d)[_0xf974('0x17')](_0x2ac92a);}};}function respondWithFilteredResult(_0x563326,_0xee027f){return function(_0x5d4ccc){if(_0x5d4ccc){var _0x15bfd7=typeof _0xee027f['offset']===_0xf974('0x18')&&typeof _0xee027f['limit']===_0xf974('0x18');var _0x4b1749=_0x5d4ccc[_0xf974('0x19')];var _0x28fac6=_0x15bfd7?0x0:_0xee027f[_0xf974('0x1a')];var _0x34ae40=_0x15bfd7?_0x5d4ccc[_0xf974('0x19')]:_0xee027f['offset']+_0xee027f[_0xf974('0x1b')];var _0x58c3a5;if(_0x34ae40>=_0x4b1749){_0x34ae40=_0x4b1749;_0x58c3a5=0xc8;}else{_0x58c3a5=0xce;}_0x563326[_0xf974('0x16')](_0x58c3a5);return _0x563326[_0xf974('0x1c')](_0xf974('0x1d'),_0x28fac6+'-'+_0x34ae40+'/'+_0x4b1749)[_0xf974('0x17')](_0x5d4ccc);}return null;};}function patchUpdates(_0x4c88d6){return function(_0x11d925){try{jsonpatch[_0xf974('0x1e')](_0x11d925,_0x4c88d6,!![]);}catch(_0x39339d){return BPromise['reject'](_0x39339d);}return _0x11d925[_0xf974('0x1f')]();};}function saveUpdates(_0x42c1be,_0x203958){return function(_0x2d2cec){if(_0x2d2cec){return _0x2d2cec[_0xf974('0x20')](_0x42c1be)[_0xf974('0x21')](function(_0xa50f74){return _0xa50f74;});}return null;};}function removeEntity(_0x399a60,_0x58e95b){return function(_0x4e176f){if(_0x4e176f){return _0x4e176f['destroy']()[_0xf974('0x21')](function(){_0x399a60['status'](0xcc)[_0xf974('0x22')]();});}};}function handleEntityNotFound(_0x37536d,_0x513ec1){return function(_0x92b8e9){if(!_0x92b8e9){_0x37536d[_0xf974('0x23')](0x194);}return _0x92b8e9;};}function handleError(_0x3689cf,_0x5eace){_0x5eace=_0x5eace||0x1f4;return function(_0xe0537c){logger[_0xf974('0x24')](_0xe0537c[_0xf974('0x25')]);if(_0xe0537c['name']){delete _0xe0537c['name'];}_0x3689cf['status'](_0x5eace)[_0xf974('0x26')](_0xe0537c);};}exports['index']=function(_0x4b2349,_0x37a33b){var _0x15cd20={},_0x2f645b={},_0x425b44={'count':0x0,'rows':[]};var _0x4a4869=_[_0xf974('0x27')](db[_0xf974('0x28')][_0xf974('0x29')],function(_0x37ff4d){return{'name':_0x37ff4d[_0xf974('0x2a')],'type':_0x37ff4d[_0xf974('0x2b')]['key']};});_0x2f645b['model']=_[_0xf974('0x27')](_0x4a4869,'name');_0x2f645b['query']=_[_0xf974('0x2c')](_0x4b2349[_0xf974('0x2d')]);_0x2f645b[_0xf974('0x2e')]=_['intersection'](_0x2f645b[_0xf974('0x2f')],_0x2f645b[_0xf974('0x2d')]);_0x15cd20[_0xf974('0x30')]=_[_0xf974('0x31')](_0x2f645b[_0xf974('0x2f')],qs[_0xf974('0x32')](_0x4b2349[_0xf974('0x2d')][_0xf974('0x32')]));_0x15cd20['attributes']=_0x15cd20[_0xf974('0x30')][_0xf974('0x33')]?_0x15cd20[_0xf974('0x30')]:_0x2f645b[_0xf974('0x2f')];if(!_0x4b2349[_0xf974('0x2d')][_0xf974('0x34')](_0xf974('0x35'))){_0x15cd20[_0xf974('0x1b')]=qs['limit'](_0x4b2349[_0xf974('0x2d')][_0xf974('0x1b')]);_0x15cd20[_0xf974('0x1a')]=qs[_0xf974('0x1a')](_0x4b2349[_0xf974('0x2d')]['offset']);}_0x15cd20[_0xf974('0x36')]=qs['sort'](_0x4b2349[_0xf974('0x2d')]['sort']);_0x15cd20[_0xf974('0x37')]=qs['filters'](_['pick'](_0x4b2349[_0xf974('0x2d')],_0x2f645b[_0xf974('0x2e')]),_0x4a4869);if(_0x4b2349[_0xf974('0x2d')][_0xf974('0x38')]){_0x15cd20[_0xf974('0x37')]=_['merge'](_0x15cd20['where'],{'$or':_['map'](_0x4a4869,function(_0xa88523){if(_0xa88523[_0xf974('0x2b')]!==_0xf974('0x39')){var _0x56ef07={};_0x56ef07[_0xa88523[_0xf974('0x3a')]]={'$like':'%'+_0x4b2349['query']['filter']+'%'};return _0x56ef07;}})});}_0x15cd20=_['merge']({},_0x15cd20,_0x4b2349[_0xf974('0x3b')]);var _0x242fc8={'where':_0x15cd20[_0xf974('0x37')]};return db[_0xf974('0x28')][_0xf974('0x19')](_0x242fc8)[_0xf974('0x21')](function(_0x312d48){_0x425b44[_0xf974('0x19')]=_0x312d48;if(_0x4b2349[_0xf974('0x2d')][_0xf974('0x3c')]){_0x15cd20[_0xf974('0x3d')]=[{'all':!![]}];}return db[_0xf974('0x28')][_0xf974('0x3e')](_0x15cd20);})[_0xf974('0x21')](function(_0x5119af){_0x425b44[_0xf974('0x3f')]=_0x5119af;return _0x425b44;})[_0xf974('0x21')](respondWithFilteredResult(_0x37a33b,_0x15cd20))['catch'](handleError(_0x37a33b,null));};exports[_0xf974('0x40')]=function(_0x3d5425,_0x165495){var _0xf2b83c={'raw':!![],'where':{'id':_0x3d5425[_0xf974('0x41')]['id']}},_0x55f10a={};_0x55f10a[_0xf974('0x2f')]=_[_0xf974('0x2c')](db[_0xf974('0x28')][_0xf974('0x29')]);_0x55f10a[_0xf974('0x2d')]=_[_0xf974('0x2c')](_0x3d5425[_0xf974('0x2d')]);_0x55f10a[_0xf974('0x2e')]=_[_0xf974('0x31')](_0x55f10a['model'],_0x55f10a[_0xf974('0x2d')]);_0xf2b83c[_0xf974('0x30')]=_[_0xf974('0x31')](_0x55f10a[_0xf974('0x2f')],qs['fields'](_0x3d5425[_0xf974('0x2d')][_0xf974('0x32')]));_0xf2b83c[_0xf974('0x30')]=_0xf2b83c[_0xf974('0x30')][_0xf974('0x33')]?_0xf2b83c[_0xf974('0x30')]:_0x55f10a['model'];if(_0x3d5425[_0xf974('0x2d')][_0xf974('0x3c')]){_0xf2b83c[_0xf974('0x3d')]=[{'all':!![]}];}_0xf2b83c=_['merge']({},_0xf2b83c,_0x3d5425[_0xf974('0x3b')]);return db[_0xf974('0x28')][_0xf974('0x42')](_0xf2b83c)[_0xf974('0x21')](handleEntityNotFound(_0x165495,null))[_0xf974('0x21')](respondWithResult(_0x165495,null))['catch'](handleError(_0x165495,null));};exports[_0xf974('0x43')]=function(_0x486023,_0x3f8d08){return db[_0xf974('0x28')][_0xf974('0x43')](_0x486023[_0xf974('0x44')],{})[_0xf974('0x21')](respondWithResult(_0x3f8d08,0xc9))[_0xf974('0x45')](handleError(_0x3f8d08,null));};exports[_0xf974('0x20')]=function(_0x20fcd6,_0x13184b){if(_0x20fcd6[_0xf974('0x44')]['id']){delete _0x20fcd6[_0xf974('0x44')]['id'];}return db[_0xf974('0x28')][_0xf974('0x42')]({'where':{'id':_0x20fcd6[_0xf974('0x41')]['id']}})['then'](handleEntityNotFound(_0x13184b,null))['then'](saveUpdates(_0x20fcd6[_0xf974('0x44')],null))[_0xf974('0x21')](respondWithResult(_0x13184b,null))[_0xf974('0x45')](handleError(_0x13184b,null));};exports[_0xf974('0x46')]=function(_0x40abf4,_0x5e63e6){return db[_0xf974('0x28')][_0xf974('0x42')]({'where':{'id':_0x40abf4[_0xf974('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e63e6,null))[_0xf974('0x21')](removeEntity(_0x5e63e6,null))['catch'](handleError(_0x5e63e6,null));}; \ No newline at end of file +var _0x2f4f=['reject','save','update','then','destroy','stack','name','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','options','where','includeAll','include','rows','catch','show','params','length','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x1f3c56,_0x598757){var _0x569524=function(_0x345301){while(--_0x345301){_0x1f3c56['push'](_0x1f3c56['shift']());}};_0x569524(++_0x598757);}(_0x2f4f,0x1ca));var _0xf2f4=function(_0xa7e110,_0x10bed0){_0xa7e110=_0xa7e110-0x0;var _0x7f1aec=_0x2f4f[_0xa7e110];return _0x7f1aec;};'use strict';var emlformat=require(_0xf2f4('0x0'));var rimraf=require(_0xf2f4('0x1'));var zipdir=require(_0xf2f4('0x2'));var jsonpatch=require(_0xf2f4('0x3'));var rp=require(_0xf2f4('0x4'));var moment=require('moment');var BPromise=require(_0xf2f4('0x5'));var Mustache=require(_0xf2f4('0x6'));var util=require(_0xf2f4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf2f4('0x8'));var ejs=require(_0xf2f4('0x9'));var fs=require('fs');var fs_extra=require(_0xf2f4('0xa'));var _=require(_0xf2f4('0xb'));var squel=require(_0xf2f4('0xc'));var crypto=require('crypto');var jsforce=require(_0xf2f4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf2f4('0x8'));var querystring=require(_0xf2f4('0xe'));var Papa=require('papaparse');var Redis=require(_0xf2f4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf2f4('0x10'));var hardwareService=require(_0xf2f4('0x11'));var logger=require(_0xf2f4('0x12'))(_0xf2f4('0x13'));var utils=require(_0xf2f4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf2f4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58bf70,_0x6c7d4e){_0x6c7d4e=_0x6c7d4e||0xcc;return function(_0x346c6d){if(_0x346c6d){return _0x58bf70[_0xf2f4('0x16')](_0x6c7d4e);}return _0x58bf70[_0xf2f4('0x17')](_0x6c7d4e)[_0xf2f4('0x18')]();};}function respondWithResult(_0x49bd1c,_0x58a9cc){_0x58a9cc=_0x58a9cc||0xc8;return function(_0x1940cd){if(_0x1940cd){return _0x49bd1c[_0xf2f4('0x17')](_0x58a9cc)[_0xf2f4('0x19')](_0x1940cd);}};}function respondWithFilteredResult(_0x43560a,_0x1c463c){return function(_0x1a8c37){if(_0x1a8c37){var _0xaccfad=typeof _0x1c463c['offset']===_0xf2f4('0x1a')&&typeof _0x1c463c[_0xf2f4('0x1b')]===_0xf2f4('0x1a');var _0x5a8841=_0x1a8c37[_0xf2f4('0x1c')];var _0x18c526=_0xaccfad?0x0:_0x1c463c[_0xf2f4('0x1d')];var _0x475fba=_0xaccfad?_0x1a8c37[_0xf2f4('0x1c')]:_0x1c463c[_0xf2f4('0x1d')]+_0x1c463c['limit'];var _0x53cef4;if(_0x475fba>=_0x5a8841){_0x475fba=_0x5a8841;_0x53cef4=0xc8;}else{_0x53cef4=0xce;}_0x43560a[_0xf2f4('0x17')](_0x53cef4);return _0x43560a['set'](_0xf2f4('0x1e'),_0x18c526+'-'+_0x475fba+'/'+_0x5a8841)[_0xf2f4('0x19')](_0x1a8c37);}return null;};}function patchUpdates(_0x5d7b7a){return function(_0x488382){try{jsonpatch[_0xf2f4('0x1f')](_0x488382,_0x5d7b7a,!![]);}catch(_0x314c28){return BPromise[_0xf2f4('0x20')](_0x314c28);}return _0x488382[_0xf2f4('0x21')]();};}function saveUpdates(_0x39453b,_0x47564d){return function(_0x1a958b){if(_0x1a958b){return _0x1a958b[_0xf2f4('0x22')](_0x39453b)[_0xf2f4('0x23')](function(_0x2eb869){return _0x2eb869;});}return null;};}function removeEntity(_0x58f89b,_0x3c9158){return function(_0x117571){if(_0x117571){return _0x117571[_0xf2f4('0x24')]()['then'](function(){_0x58f89b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27f1ca,_0x594f9b){return function(_0x26234c){if(!_0x26234c){_0x27f1ca[_0xf2f4('0x16')](0x194);}return _0x26234c;};}function handleError(_0x3853fc,_0x3d2412){_0x3d2412=_0x3d2412||0x1f4;return function(_0x5b0d5d){logger['error'](_0x5b0d5d[_0xf2f4('0x25')]);if(_0x5b0d5d['name']){delete _0x5b0d5d[_0xf2f4('0x26')];}_0x3853fc['status'](_0x3d2412)['send'](_0x5b0d5d);};}exports[_0xf2f4('0x27')]=function(_0x4e24ac,_0x3c9561){var _0x437240={},_0x17caed={},_0x200054={'count':0x0,'rows':[]};var _0x41eda6=_['map'](db[_0xf2f4('0x28')][_0xf2f4('0x29')],function(_0x2b79f1){return{'name':_0x2b79f1[_0xf2f4('0x2a')],'type':_0x2b79f1[_0xf2f4('0x2b')][_0xf2f4('0x2c')]};});_0x17caed[_0xf2f4('0x2d')]=_[_0xf2f4('0x2e')](_0x41eda6,_0xf2f4('0x26'));_0x17caed[_0xf2f4('0x2f')]=_[_0xf2f4('0x30')](_0x4e24ac[_0xf2f4('0x2f')]);_0x17caed[_0xf2f4('0x31')]=_[_0xf2f4('0x32')](_0x17caed[_0xf2f4('0x2d')],_0x17caed[_0xf2f4('0x2f')]);_0x437240[_0xf2f4('0x33')]=_[_0xf2f4('0x32')](_0x17caed[_0xf2f4('0x2d')],qs[_0xf2f4('0x34')](_0x4e24ac['query'][_0xf2f4('0x34')]));_0x437240[_0xf2f4('0x33')]=_0x437240[_0xf2f4('0x33')]['length']?_0x437240['attributes']:_0x17caed[_0xf2f4('0x2d')];if(!_0x4e24ac[_0xf2f4('0x2f')][_0xf2f4('0x35')]('nolimit')){_0x437240[_0xf2f4('0x1b')]=qs['limit'](_0x4e24ac[_0xf2f4('0x2f')][_0xf2f4('0x1b')]);_0x437240[_0xf2f4('0x1d')]=qs[_0xf2f4('0x1d')](_0x4e24ac[_0xf2f4('0x2f')]['offset']);}_0x437240[_0xf2f4('0x36')]=qs[_0xf2f4('0x37')](_0x4e24ac[_0xf2f4('0x2f')]['sort']);_0x437240['where']=qs[_0xf2f4('0x31')](_['pick'](_0x4e24ac['query'],_0x17caed[_0xf2f4('0x31')]),_0x41eda6);if(_0x4e24ac[_0xf2f4('0x2f')][_0xf2f4('0x38')]){_0x437240['where']=_['merge'](_0x437240['where'],{'$or':_[_0xf2f4('0x2e')](_0x41eda6,function(_0x7f4a30){if(_0x7f4a30[_0xf2f4('0x2b')]!=='VIRTUAL'){var _0x1e8123={};_0x1e8123[_0x7f4a30[_0xf2f4('0x26')]]={'$like':'%'+_0x4e24ac[_0xf2f4('0x2f')][_0xf2f4('0x38')]+'%'};return _0x1e8123;}})});}_0x437240=_['merge']({},_0x437240,_0x4e24ac[_0xf2f4('0x39')]);var _0xe9cfac={'where':_0x437240[_0xf2f4('0x3a')]};return db[_0xf2f4('0x28')][_0xf2f4('0x1c')](_0xe9cfac)[_0xf2f4('0x23')](function(_0x601cbe){_0x200054[_0xf2f4('0x1c')]=_0x601cbe;if(_0x4e24ac[_0xf2f4('0x2f')][_0xf2f4('0x3b')]){_0x437240[_0xf2f4('0x3c')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x437240);})[_0xf2f4('0x23')](function(_0x595666){_0x200054[_0xf2f4('0x3d')]=_0x595666;return _0x200054;})[_0xf2f4('0x23')](respondWithFilteredResult(_0x3c9561,_0x437240))[_0xf2f4('0x3e')](handleError(_0x3c9561,null));};exports[_0xf2f4('0x3f')]=function(_0x392224,_0x21dc27){var _0x1ab921={'raw':!![],'where':{'id':_0x392224[_0xf2f4('0x40')]['id']}},_0x2851c2={};_0x2851c2[_0xf2f4('0x2d')]=_[_0xf2f4('0x30')](db[_0xf2f4('0x28')][_0xf2f4('0x29')]);_0x2851c2[_0xf2f4('0x2f')]=_[_0xf2f4('0x30')](_0x392224[_0xf2f4('0x2f')]);_0x2851c2[_0xf2f4('0x31')]=_['intersection'](_0x2851c2[_0xf2f4('0x2d')],_0x2851c2['query']);_0x1ab921['attributes']=_[_0xf2f4('0x32')](_0x2851c2[_0xf2f4('0x2d')],qs[_0xf2f4('0x34')](_0x392224['query'][_0xf2f4('0x34')]));_0x1ab921[_0xf2f4('0x33')]=_0x1ab921[_0xf2f4('0x33')][_0xf2f4('0x41')]?_0x1ab921[_0xf2f4('0x33')]:_0x2851c2[_0xf2f4('0x2d')];if(_0x392224[_0xf2f4('0x2f')][_0xf2f4('0x3b')]){_0x1ab921[_0xf2f4('0x3c')]=[{'all':!![]}];}_0x1ab921=_[_0xf2f4('0x42')]({},_0x1ab921,_0x392224[_0xf2f4('0x39')]);return db[_0xf2f4('0x28')][_0xf2f4('0x43')](_0x1ab921)['then'](handleEntityNotFound(_0x21dc27,null))[_0xf2f4('0x23')](respondWithResult(_0x21dc27,null))['catch'](handleError(_0x21dc27,null));};exports['create']=function(_0x66f3d5,_0x7beaa8){return db[_0xf2f4('0x28')][_0xf2f4('0x44')](_0x66f3d5[_0xf2f4('0x45')],{})['then'](respondWithResult(_0x7beaa8,0xc9))[_0xf2f4('0x3e')](handleError(_0x7beaa8,null));};exports['update']=function(_0x295492,_0xb3044d){if(_0x295492['body']['id']){delete _0x295492[_0xf2f4('0x45')]['id'];}return db[_0xf2f4('0x28')][_0xf2f4('0x43')]({'where':{'id':_0x295492[_0xf2f4('0x40')]['id']}})[_0xf2f4('0x23')](handleEntityNotFound(_0xb3044d,null))[_0xf2f4('0x23')](saveUpdates(_0x295492[_0xf2f4('0x45')],null))['then'](respondWithResult(_0xb3044d,null))[_0xf2f4('0x3e')](handleError(_0xb3044d,null));};exports[_0xf2f4('0x24')]=function(_0x5743dc,_0x584178){return db[_0xf2f4('0x28')][_0xf2f4('0x43')]({'where':{'id':_0x5743dc[_0xf2f4('0x40')]['id']}})[_0xf2f4('0x23')](handleEntityNotFound(_0x584178,null))['then'](removeEntity(_0x584178,null))[_0xf2f4('0x3e')](handleError(_0x584178,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index c02f15c..989e34a 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 _0x22ea=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x22ea,0xd1));var _0xa22e=function(_0x55490d,_0x7b7bdb){_0x55490d=_0x55490d-0x0;var _0x2fb353=_0x22ea[_0x55490d];return _0x2fb353;};'use strict';var _=require(_0xa22e('0x0'));var util=require(_0xa22e('0x1'));var logger=require(_0xa22e('0x2'))(_0xa22e('0x3'));var moment=require('moment');var BPromise=require(_0xa22e('0x4'));var rp=require(_0xa22e('0x5'));var fs=require('fs');var path=require(_0xa22e('0x6'));var rimraf=require(_0xa22e('0x7'));var config=require(_0xa22e('0x8'));var attributes=require(_0xa22e('0x9'));module[_0xa22e('0xa')]=function(_0x625e34,_0x5aaf59){return _0x625e34[_0xa22e('0xb')](_0xa22e('0xc'),attributes,{'tableName':_0xa22e('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xa22e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc7fa=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x472a90,_0x449707){var _0xe59f8a=function(_0xef66ff){while(--_0xef66ff){_0x472a90['push'](_0x472a90['shift']());}};_0xe59f8a(++_0x449707);}(_0xc7fa,0x140));var _0xac7f=function(_0x2aefc6,_0x2e52be){_0x2aefc6=_0x2aefc6-0x0;var _0x17705c=_0xc7fa[_0x2aefc6];return _0x17705c;};'use strict';var _=require(_0xac7f('0x0'));var util=require(_0xac7f('0x1'));var logger=require(_0xac7f('0x2'))(_0xac7f('0x3'));var moment=require(_0xac7f('0x4'));var BPromise=require(_0xac7f('0x5'));var rp=require(_0xac7f('0x6'));var fs=require('fs');var path=require(_0xac7f('0x7'));var rimraf=require(_0xac7f('0x8'));var config=require(_0xac7f('0x9'));var attributes=require(_0xac7f('0xa'));module[_0xac7f('0xb')]=function(_0x2d45bd,_0x13f2ee){return _0x2d45bd[_0xac7f('0xc')](_0xac7f('0xd'),attributes,{'tableName':_0xac7f('0xe'),'paranoid':![],'indexes':[{'name':_0xac7f('0xf'),'fields':[_0xac7f('0x10'),_0xac7f('0x11')],'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 6ff667f..49e2216 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 _0x2436=['request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2a9162,_0x3c4c6f){var _0x3f235f=function(_0x4f6008){while(--_0x4f6008){_0x2a9162['push'](_0x2a9162['shift']());}};_0x3f235f(++_0x3c4c6f);}(_0x2436,0x156));var _0x6243=function(_0x4373af,_0x2666f9){_0x4373af=_0x4373af-0x0;var _0x353f2d=_0x2436[_0x4373af];return _0x353f2d;};'use strict';var _=require(_0x6243('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6243('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6243('0x2'));var db=require(_0x6243('0x3'))['db'];var utils=require(_0x6243('0x4'));var logger=require(_0x6243('0x5'))(_0x6243('0x6'));var config=require(_0x6243('0x7'));var jayson=require(_0x6243('0x8'));var client=jayson[_0x6243('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15a79c,_0x2b31a1,_0x328df1){return new BPromise(function(_0x567b5d,_0x2ff297){return client[_0x6243('0xa')](_0x15a79c,_0x328df1)[_0x6243('0xb')](function(_0x3ba01a){logger['info'](_0x6243('0xc'),_0x2b31a1,_0x6243('0xd'));logger[_0x6243('0xe')](_0x6243('0xf'),_0x2b31a1,_0x6243('0xd'),JSON[_0x6243('0x10')](_0x3ba01a));if(_0x3ba01a[_0x6243('0x11')]){if(_0x3ba01a[_0x6243('0x11')][_0x6243('0x12')]===0x1f4){logger[_0x6243('0x11')](_0x6243('0xc'),_0x2b31a1,_0x3ba01a[_0x6243('0x11')][_0x6243('0x13')]);return _0x2ff297(_0x3ba01a[_0x6243('0x11')][_0x6243('0x13')]);}logger[_0x6243('0x11')](_0x6243('0xc'),_0x2b31a1,_0x3ba01a[_0x6243('0x11')]['message']);return _0x567b5d(_0x3ba01a[_0x6243('0x11')]['message']);}else{logger[_0x6243('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x2b31a1,_0x6243('0xd'));_0x567b5d(_0x3ba01a['result'][_0x6243('0x13')]);}})[_0x6243('0x15')](function(_0x5cd552){logger[_0x6243('0x11')](_0x6243('0xc'),_0x2b31a1,_0x5cd552);_0x2ff297(_0x5cd552);});});} \ No newline at end of file +var _0xf11c=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x211d57,_0x55020d){var _0x3cbb1f=function(_0x280d0b){while(--_0x280d0b){_0x211d57['push'](_0x211d57['shift']());}};_0x3cbb1f(++_0x55020d);}(_0xf11c,0x1cf));var _0xcf11=function(_0x179ca0,_0x8c6c2f){_0x179ca0=_0x179ca0-0x0;var _0x2a5094=_0xf11c[_0x179ca0];return _0x2a5094;};'use strict';var _=require(_0xcf11('0x0'));var util=require(_0xcf11('0x1'));var moment=require(_0xcf11('0x2'));var BPromise=require(_0xcf11('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf11('0x4'));var db=require(_0xcf11('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf11('0x6'))('rpc');var config=require(_0xcf11('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf11('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e115a,_0x5429e5,_0x16dec9){return new BPromise(function(_0x40c5c6,_0x29b3ed){return client[_0xcf11('0x9')](_0x2e115a,_0x16dec9)[_0xcf11('0xa')](function(_0xa49623){logger[_0xcf11('0xb')](_0xcf11('0xc'),_0x5429e5,_0xcf11('0xd'));logger[_0xcf11('0xe')](_0xcf11('0xf'),_0x5429e5,'request\x20sent',JSON[_0xcf11('0x10')](_0xa49623));if(_0xa49623['error']){if(_0xa49623['error'][_0xcf11('0x11')]===0x1f4){logger[_0xcf11('0x12')](_0xcf11('0xc'),_0x5429e5,_0xa49623[_0xcf11('0x12')]['message']);return _0x29b3ed(_0xa49623[_0xcf11('0x12')][_0xcf11('0x13')]);}logger[_0xcf11('0x12')](_0xcf11('0xc'),_0x5429e5,_0xa49623[_0xcf11('0x12')][_0xcf11('0x13')]);return _0x40c5c6(_0xa49623['error'][_0xcf11('0x13')]);}else{logger[_0xcf11('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x5429e5,_0xcf11('0xd'));_0x40c5c6(_0xa49623['result'][_0xcf11('0x13')]);}})[_0xcf11('0x14')](function(_0x23e9c8){logger[_0xcf11('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x5429e5,_0x23e9c8);_0x29b3ed(_0x23e9c8);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index d0a5a92..e0f18a8 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 _0xb8ca=['/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','create','post','addConfiguration','put'];(function(_0x1d0989,_0x19a800){var _0x4c6587=function(_0x2ab718){while(--_0x2ab718){_0x1d0989['push'](_0x1d0989['shift']());}};_0x4c6587(++_0x19a800);}(_0xb8ca,0x89));var _0xab8c=function(_0x581b96,_0x4bab04){_0x581b96=_0x581b96-0x0;var _0xac5bc8=_0xb8ca[_0x581b96];return _0xac5bc8;};'use strict';var multer=require(_0xab8c('0x0'));var util=require(_0xab8c('0x1'));var path=require(_0xab8c('0x2'));var timeout=require('connect-timeout');var express=require(_0xab8c('0x3'));var router=express[_0xab8c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab8c('0x5'));var config=require(_0xab8c('0x6'));var controller=require(_0xab8c('0x7'));router[_0xab8c('0x8')]('/',auth[_0xab8c('0x9')](),controller[_0xab8c('0xa')]);router[_0xab8c('0x8')]('/:id',auth[_0xab8c('0x9')](),controller['show']);router[_0xab8c('0x8')](_0xab8c('0xb'),auth[_0xab8c('0x9')](),controller[_0xab8c('0xc')]);router[_0xab8c('0x8')]('/:id/fields',auth[_0xab8c('0x9')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xab8c('0xd')]);router[_0xab8c('0xe')](_0xab8c('0xb'),auth[_0xab8c('0x9')](),controller[_0xab8c('0xf')]);router[_0xab8c('0x10')](_0xab8c('0x11'),auth[_0xab8c('0x9')](),controller[_0xab8c('0x12')]);router[_0xab8c('0x13')](_0xab8c('0x11'),auth[_0xab8c('0x9')](),controller[_0xab8c('0x14')]);module[_0xab8c('0x15')]=router; \ No newline at end of file +var _0x2029=['/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x57f07a,_0x59d056){var _0x579df0=function(_0x498181){while(--_0x498181){_0x57f07a['push'](_0x57f07a['shift']());}};_0x579df0(++_0x59d056);}(_0x2029,0x171));var _0x9202=function(_0x42d4f6,_0x2b04c8){_0x42d4f6=_0x42d4f6-0x0;var _0x8f8c08=_0x2029[_0x42d4f6];return _0x8f8c08;};'use strict';var multer=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var path=require('path');var timeout=require(_0x9202('0x2'));var express=require(_0x9202('0x3'));var router=express[_0x9202('0x4')]();var fs_extra=require(_0x9202('0x5'));var auth=require(_0x9202('0x6'));var interaction=require(_0x9202('0x7'));var config=require(_0x9202('0x8'));var controller=require(_0x9202('0x9'));router[_0x9202('0xa')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0xc')]);router[_0x9202('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9202('0xd')]);router['get'](_0x9202('0xe'),auth[_0x9202('0xb')](),controller['getConfigurations']);router[_0x9202('0xa')](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x10')]);router[_0x9202('0x11')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0x12')]);router[_0x9202('0x11')](_0x9202('0xe'),auth[_0x9202('0xb')](),controller[_0x9202('0x13')]);router[_0x9202('0x14')](_0x9202('0x15'),auth[_0x9202('0xb')](),controller[_0x9202('0x16')]);router[_0x9202('0x17')](_0x9202('0x15'),auth['isAuthenticated'](),controller[_0x9202('0x18')]);module[_0x9202('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 484c80b..c842328 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 _0x5850=['HelpDesk','sequelize','exports','STRING'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0x5850,0x11d));var _0x0585=function(_0x3a1e37,_0x42a27){_0x3a1e37=_0x3a1e37-0x0;var _0x1d754c=_0x5850[_0x3a1e37];return _0x1d754c;};'use strict';var Sequelize=require(_0x0585('0x0'));module[_0x0585('0x1')]={'name':{'type':Sequelize[_0x0585('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0585('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0585('0x2')],'allowNull':![],'defaultValue':_0x0585('0x3')},'remoteUri':{'type':Sequelize[_0x0585('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0585('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0585('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6c78=['sequelize','exports','STRING','HelpDesk'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x6c78,0xf8));var _0x86c7=function(_0x67bf3a,_0x4237ac){_0x67bf3a=_0x67bf3a-0x0;var _0x2f28b5=_0x6c78[_0x67bf3a];return _0x2f28b5;};'use strict';var Sequelize=require(_0x86c7('0x0'));module[_0x86c7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x86c7('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x86c7('0x2')],'allowNull':![],'defaultValue':_0x86c7('0x3')},'remoteUri':{'type':Sequelize[_0x86c7('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x86c7('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x86c7('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 f22614c..679fefc 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 _0x71ba=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','update','destroy','error','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','then','create','body','find','params','getConfigurations','findOne','VtigerConfiguration','order','pick','nolimit','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','username','moduleName','serverUrl','accessKey','remoteUri','slice','substring','format','getchallenge','login','result','success','GET','describe','sessionName','autogenerated','reference','remove','includes','editable','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','mustache','util'];(function(_0x3acfae,_0x34b400){var _0x135afd=function(_0x4890c8){while(--_0x4890c8){_0x3acfae['push'](_0x3acfae['shift']());}};_0x135afd(++_0x34b400);}(_0x71ba,0x6e));var _0xa71b=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x71ba[_0x137d1d];return _0x485108;};'use strict';var emlformat=require(_0xa71b('0x0'));var rimraf=require(_0xa71b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa71b('0x2'));var rp=require(_0xa71b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa71b('0x4'));var util=require(_0xa71b('0x5'));var path=require(_0xa71b('0x6'));var sox=require(_0xa71b('0x7'));var csv=require(_0xa71b('0x8'));var ejs=require(_0xa71b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa71b('0xa'));var squel=require(_0xa71b('0xb'));var crypto=require(_0xa71b('0xc'));var jsforce=require(_0xa71b('0xd'));var deskjs=require(_0xa71b('0xe'));var toCsv=require(_0xa71b('0x8'));var querystring=require(_0xa71b('0xf'));var Papa=require(_0xa71b('0x10'));var Redis=require(_0xa71b('0x11'));var authService=require(_0xa71b('0x12'));var qs=require(_0xa71b('0x13'));var as=require(_0xa71b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa71b('0x15'));var utils=require('../../config/utils');var config=require(_0xa71b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa71b('0x17'));function respondWithStatusCode(_0x45acb1,_0x286961){_0x286961=_0x286961||0xcc;return function(_0x2432d0){if(_0x2432d0){return _0x45acb1[_0xa71b('0x18')](_0x286961);}return _0x45acb1[_0xa71b('0x19')](_0x286961)[_0xa71b('0x1a')]();};}function respondWithResult(_0x21f5eb,_0x417149){_0x417149=_0x417149||0xc8;return function(_0x47a70d){if(_0x47a70d){return _0x21f5eb[_0xa71b('0x19')](_0x417149)['json'](_0x47a70d);}};}function respondWithFilteredResult(_0x2c17ad,_0x4e9e9a){return function(_0x5b6e58){if(_0x5b6e58){var _0x451716=typeof _0x4e9e9a['offset']===_0xa71b('0x1b')&&typeof _0x4e9e9a[_0xa71b('0x1c')]===_0xa71b('0x1b');var _0x5b039b=_0x5b6e58[_0xa71b('0x1d')];var _0x8af843=_0x451716?0x0:_0x4e9e9a[_0xa71b('0x1e')];var _0x36426a=_0x451716?_0x5b6e58['count']:_0x4e9e9a['offset']+_0x4e9e9a[_0xa71b('0x1c')];var _0x400ced;if(_0x36426a>=_0x5b039b){_0x36426a=_0x5b039b;_0x400ced=0xc8;}else{_0x400ced=0xce;}_0x2c17ad[_0xa71b('0x19')](_0x400ced);return _0x2c17ad['set'](_0xa71b('0x1f'),_0x8af843+'-'+_0x36426a+'/'+_0x5b039b)[_0xa71b('0x20')](_0x5b6e58);}return null;};}function patchUpdates(_0x31e2b6){return function(_0x2e9b80){try{jsonpatch[_0xa71b('0x21')](_0x2e9b80,_0x31e2b6,!![]);}catch(_0x439974){return BPromise[_0xa71b('0x22')](_0x439974);}return _0x2e9b80['save']();};}function saveUpdates(_0x4e9e56,_0x2e0b09){return function(_0x3b3b7d){if(_0x3b3b7d){return _0x3b3b7d[_0xa71b('0x23')](_0x4e9e56)['then'](function(_0x10f114){return _0x10f114;});}return null;};}function removeEntity(_0x2568dd,_0x289fd8){return function(_0x1c70ff){if(_0x1c70ff){return _0x1c70ff[_0xa71b('0x24')]()['then'](function(){_0x2568dd[_0xa71b('0x19')](0xcc)[_0xa71b('0x1a')]();});}};}function handleEntityNotFound(_0x1bc793,_0x22f234){return function(_0xfef6cc){if(!_0xfef6cc){_0x1bc793[_0xa71b('0x18')](0x194);}return _0xfef6cc;};}function handleError(_0x28d9f3,_0x1004eb){_0x1004eb=_0x1004eb||0x1f4;return function(_0x1ac901){logger[_0xa71b('0x25')](_0x1ac901[_0xa71b('0x26')]);if(_0x1ac901[_0xa71b('0x27')]){delete _0x1ac901['name'];}_0x28d9f3['status'](_0x1004eb)[_0xa71b('0x28')](_0x1ac901);};}exports['index']=function(_0x11462e,_0x3d92bb){var _0x1d56a0={},_0x3c5e55={},_0x4b55b3={'count':0x0,'rows':[]};var _0x1199cc=_[_0xa71b('0x29')](db[_0xa71b('0x2a')][_0xa71b('0x2b')],function(_0x468d02){return{'name':_0x468d02[_0xa71b('0x2c')],'type':_0x468d02['type'][_0xa71b('0x2d')]};});_0x3c5e55[_0xa71b('0x2e')]=_['map'](_0x1199cc,_0xa71b('0x27'));_0x3c5e55[_0xa71b('0x2f')]=_['keys'](_0x11462e['query']);_0x3c5e55[_0xa71b('0x30')]=_[_0xa71b('0x31')](_0x3c5e55[_0xa71b('0x2e')],_0x3c5e55[_0xa71b('0x2f')]);_0x1d56a0[_0xa71b('0x32')]=_['intersection'](_0x3c5e55[_0xa71b('0x2e')],qs[_0xa71b('0x33')](_0x11462e[_0xa71b('0x2f')]['fields']));_0x1d56a0[_0xa71b('0x32')]=_0x1d56a0[_0xa71b('0x32')][_0xa71b('0x34')]?_0x1d56a0['attributes']:_0x3c5e55['model'];if(!_0x11462e['query'][_0xa71b('0x35')]('nolimit')){_0x1d56a0['limit']=qs['limit'](_0x11462e['query'][_0xa71b('0x1c')]);_0x1d56a0['offset']=qs[_0xa71b('0x1e')](_0x11462e[_0xa71b('0x2f')]['offset']);}_0x1d56a0['order']=qs['sort'](_0x11462e['query'][_0xa71b('0x36')]);_0x1d56a0[_0xa71b('0x37')]=qs[_0xa71b('0x30')](_['pick'](_0x11462e[_0xa71b('0x2f')],_0x3c5e55[_0xa71b('0x30')]),_0x1199cc);if(_0x11462e[_0xa71b('0x2f')][_0xa71b('0x38')]){_0x1d56a0[_0xa71b('0x37')]=_[_0xa71b('0x39')](_0x1d56a0[_0xa71b('0x37')],{'$or':_[_0xa71b('0x29')](_0x1199cc,function(_0x4344ce){if(_0x4344ce[_0xa71b('0x3a')]!==_0xa71b('0x3b')){var _0x3e7256={};_0x3e7256[_0x4344ce[_0xa71b('0x27')]]={'$like':'%'+_0x11462e[_0xa71b('0x2f')][_0xa71b('0x38')]+'%'};return _0x3e7256;}})});}_0x1d56a0=_[_0xa71b('0x39')]({},_0x1d56a0,_0x11462e[_0xa71b('0x3c')]);var _0x299532={'where':_0x1d56a0['where']};return db[_0xa71b('0x2a')]['count'](_0x299532)['then'](function(_0x14a3ed){_0x4b55b3[_0xa71b('0x1d')]=_0x14a3ed;if(_0x11462e['query'][_0xa71b('0x3d')]){_0x1d56a0[_0xa71b('0x3e')]=[{'all':!![]}];}return db[_0xa71b('0x2a')][_0xa71b('0x3f')](_0x1d56a0);})['then'](function(_0x41ec06){_0x4b55b3[_0xa71b('0x40')]=_0x41ec06;return _0x4b55b3;})['then'](respondWithFilteredResult(_0x3d92bb,_0x1d56a0))[_0xa71b('0x41')](handleError(_0x3d92bb,null));};exports[_0xa71b('0x42')]=function(_0x47d7dc,_0x5c188e){var _0x4933b6={'raw':![],'where':{'id':_0x47d7dc['params']['id']}},_0x225dcc={};_0x225dcc[_0xa71b('0x2e')]=_[_0xa71b('0x43')](db[_0xa71b('0x2a')]['rawAttributes']);_0x225dcc[_0xa71b('0x2f')]=_['keys'](_0x47d7dc[_0xa71b('0x2f')]);_0x225dcc[_0xa71b('0x30')]=_[_0xa71b('0x31')](_0x225dcc[_0xa71b('0x2e')],_0x225dcc[_0xa71b('0x2f')]);_0x4933b6['attributes']=_[_0xa71b('0x31')](_0x225dcc['model'],qs[_0xa71b('0x33')](_0x47d7dc['query'][_0xa71b('0x33')]));_0x4933b6[_0xa71b('0x32')]=_0x4933b6[_0xa71b('0x32')]['length']?_0x4933b6['attributes']:_0x225dcc[_0xa71b('0x2e')];if(_0x47d7dc[_0xa71b('0x2f')][_0xa71b('0x3d')]){_0x4933b6[_0xa71b('0x3e')]=[{'all':!![]}];}_0x4933b6=_['merge']({},_0x4933b6,_0x47d7dc['options']);return db[_0xa71b('0x2a')]['find'](_0x4933b6)[_0xa71b('0x44')](handleEntityNotFound(_0x5c188e,null))[_0xa71b('0x44')](respondWithResult(_0x5c188e,null))[_0xa71b('0x41')](handleError(_0x5c188e,null));};exports['create']=function(_0x205d90,_0x425f70){return db['VtigerAccount'][_0xa71b('0x45')](_0x205d90[_0xa71b('0x46')],{})['then'](respondWithResult(_0x425f70,0xc9))['catch'](handleError(_0x425f70,null));};exports[_0xa71b('0x23')]=function(_0x12a900,_0x48219f){if(_0x12a900['body']['id']){delete _0x12a900[_0xa71b('0x46')]['id'];}return db['VtigerAccount'][_0xa71b('0x47')]({'where':{'id':_0x12a900[_0xa71b('0x48')]['id']}})['then'](handleEntityNotFound(_0x48219f,null))[_0xa71b('0x44')](saveUpdates(_0x12a900[_0xa71b('0x46')],null))['then'](respondWithResult(_0x48219f,null))['catch'](handleError(_0x48219f,null));};exports['destroy']=function(_0xe3cf22,_0xcf0a8f){return db['VtigerAccount'][_0xa71b('0x47')]({'where':{'id':_0xe3cf22[_0xa71b('0x48')]['id']}})[_0xa71b('0x44')](handleEntityNotFound(_0xcf0a8f,null))[_0xa71b('0x44')](removeEntity(_0xcf0a8f,null))[_0xa71b('0x41')](handleError(_0xcf0a8f,null));};exports[_0xa71b('0x49')]=function(_0x5ebd99,_0x4f0b52,_0x5da32c){var _0x2ac5e3={};var _0xcd65c6={};var _0x346969;var _0x245f83;return db[_0xa71b('0x2a')][_0xa71b('0x4a')]({'where':{'id':_0x5ebd99[_0xa71b('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f0b52,null))[_0xa71b('0x44')](function(_0x285969){if(_0x285969){_0x346969=_0x285969;_0xcd65c6[_0xa71b('0x2e')]=_['keys'](db[_0xa71b('0x4b')][_0xa71b('0x2b')]);_0xcd65c6[_0xa71b('0x2f')]=_[_0xa71b('0x43')](_0x5ebd99[_0xa71b('0x2f')]);_0xcd65c6[_0xa71b('0x30')]=_['intersection'](_0xcd65c6[_0xa71b('0x2e')],_0xcd65c6['query']);_0x2ac5e3[_0xa71b('0x32')]=_['intersection'](_0xcd65c6[_0xa71b('0x2e')],qs[_0xa71b('0x33')](_0x5ebd99['query'][_0xa71b('0x33')]));_0x2ac5e3[_0xa71b('0x32')]=_0x2ac5e3['attributes'][_0xa71b('0x34')]?_0x2ac5e3[_0xa71b('0x32')]:_0xcd65c6['model'];_0x2ac5e3[_0xa71b('0x4c')]=qs['sort'](_0x5ebd99['query']['sort']);_0x2ac5e3[_0xa71b('0x37')]=qs[_0xa71b('0x30')](_[_0xa71b('0x4d')](_0x5ebd99[_0xa71b('0x2f')],_0xcd65c6[_0xa71b('0x30')]));if(_0x5ebd99['query']['filter']){_0x2ac5e3[_0xa71b('0x37')]=_[_0xa71b('0x39')](_0x2ac5e3[_0xa71b('0x37')],{'$or':_[_0xa71b('0x29')](_0x2ac5e3['attributes'],function(_0x23a13e){var _0x41bbbd={};_0x41bbbd[_0x23a13e]={'$like':'%'+_0x5ebd99[_0xa71b('0x2f')][_0xa71b('0x38')]+'%'};return _0x41bbbd;})});}_0x2ac5e3=_[_0xa71b('0x39')]({},_0x2ac5e3,_0x5ebd99[_0xa71b('0x3c')]);return _0x346969['getConfigurations'](_0x2ac5e3);}})['then'](function(_0x3a6e47){if(_0x3a6e47){_0x245f83=_0x3a6e47[_0xa71b('0x34')];if(!_0x5ebd99[_0xa71b('0x2f')][_0xa71b('0x35')](_0xa71b('0x4e'))){_0x2ac5e3[_0xa71b('0x1c')]=qs[_0xa71b('0x1c')](_0x5ebd99['query'][_0xa71b('0x1c')]);_0x2ac5e3[_0xa71b('0x1e')]=qs[_0xa71b('0x1e')](_0x5ebd99['query'][_0xa71b('0x1e')]);}return _0x346969[_0xa71b('0x49')](_0x2ac5e3);}})[_0xa71b('0x44')](function(_0x3f1132){if(_0x3f1132){return _0x3f1132?{'count':_0x245f83,'rows':_0x3f1132}:null;}})[_0xa71b('0x44')](respondWithResult(_0x4f0b52,null))['catch'](handleError(_0x4f0b52,null));};exports['addConfiguration']=function(_0x34becd,_0x56dccb,_0x4ab38b){if(_0x34becd[_0xa71b('0x46')]['id']){delete _0x34becd[_0xa71b('0x46')]['id'];}return db[_0xa71b('0x2a')]['findOne']({'where':{'id':_0x34becd[_0xa71b('0x48')]['id']}})[_0xa71b('0x44')](handleEntityNotFound(_0x56dccb,null))[_0xa71b('0x44')](function(_0x12b990){if(_0x12b990){_0x34becd['body'][_0xa71b('0x4f')]=_0x12b990['id'];_0x34becd[_0xa71b('0x46')]['Subjects']=integrations[_0xa71b('0x50')](_0x34becd[_0xa71b('0x46')][_0xa71b('0x51')],_0x34becd['body'][_0xa71b('0x3a')]);_0x34becd[_0xa71b('0x46')][_0xa71b('0x52')]=integrations[_0xa71b('0x53')](_0x34becd[_0xa71b('0x46')][_0xa71b('0x51')],_0x34becd['body'][_0xa71b('0x3a')]);return db[_0xa71b('0x4b')]['create'](_0x34becd[_0xa71b('0x46')],{'include':[{'model':db['VtigerField'],'as':_0xa71b('0x54')},{'model':db['VtigerField'],'as':_0xa71b('0x52')}]});}return null;})[_0xa71b('0x44')](respondWithResult(_0x56dccb,null))[_0xa71b('0x41')](handleError(_0x56dccb,null));};var md5=require('md5');exports['getFields']=function(_0x237537,_0x13b7e2,_0x4c83df){var _0x1b8d30=null;var _0x46fb54=null;var _0x729190=null;var _0x12dc2b=null;var _0x52ed66='';return db[_0xa71b('0x2a')]['findOne']({'where':{'id':_0x237537[_0xa71b('0x48')]['id']},'attributes':['id',_0xa71b('0x27'),_0xa71b('0x55'),'description',_0xa71b('0x56'),'remoteUri',_0xa71b('0x57'),_0xa71b('0x58')]})[_0xa71b('0x44')](handleEntityNotFound(_0x13b7e2,null))[_0xa71b('0x44')](function(_0x36095f){if(_0x36095f){_0x1b8d30=_0x36095f[_0xa71b('0x55')];_0x46fb54=_0x36095f[_0xa71b('0x58')];_0x729190=_0x36095f['moduleName'];_0x52ed66=_0x36095f[_0xa71b('0x59')];var _0x3efbc1=_0x52ed66[_0xa71b('0x5a')](-0x1);if(_0x3efbc1==='/'){_0x52ed66=_0x52ed66[_0xa71b('0x5b')](0x0,_0x52ed66['lastIndexOf'](_0x3efbc1));}_0x12dc2b=util[_0xa71b('0x5c')]('%s/webservice.php',_0x52ed66);var _0x307d14={'method':'GET','uri':_0x12dc2b,'qs':{'operation':_0xa71b('0x5d'),'username':_0x36095f[_0xa71b('0x55')]},'json':!![]};return rp(_0x307d14);}})['then'](function(_0x5ee888){if(_0x5ee888['success']){var _0x1f1df0={'method':'POST','uri':_0x12dc2b,'form':{'operation':_0xa71b('0x5e'),'username':_0x1b8d30,'accessKey':md5(_0x5ee888[_0xa71b('0x5f')]['token']+_0x46fb54)},'json':!![]};return rp(_0x1f1df0);}})[_0xa71b('0x44')](function(_0x4b5391){if(_0x4b5391[_0xa71b('0x60')]){var _0x506dc5={'method':_0xa71b('0x61'),'uri':_0x12dc2b,'qs':{'operation':_0xa71b('0x62'),'username':_0x1b8d30,'sessionName':_0x4b5391['result'][_0xa71b('0x63')],'elementType':_0x729190},'json':!![]};return rp(_0x506dc5);}})[_0xa71b('0x44')](function(_0x1f146e){if(_0x1f146e[_0xa71b('0x60')]){var _0x493ce9=[_0xa71b('0x64'),_0xa71b('0x65'),'owner'];_[_0xa71b('0x66')](_0x1f146e['result']['fields'],function(_0x57bc35){return _0x493ce9[_0xa71b('0x67')](_0x57bc35[_0xa71b('0x3a')][_0xa71b('0x27')]);});_[_0xa71b('0x66')](_0x1f146e[_0xa71b('0x5f')][_0xa71b('0x33')],function(_0x3e1bcc){return _0x3e1bcc[_0xa71b('0x68')]==='false';});return{'count':_0x1f146e[_0xa71b('0x5f')][_0xa71b('0x33')][_0xa71b('0x34')],'rows':_[_0xa71b('0x29')](_0x1f146e['result']['fields'],function(_0x342309){return{'id':_0x342309[_0xa71b('0x27')],'name':_0x342309[_0xa71b('0x69')],'custom':_[_0xa71b('0x6a')](_0x342309[_0xa71b('0x27')],'cf_')?!![]:![],'options':_0x342309[_0xa71b('0x3a')]['name']==='picklist'&&_0x342309[_0xa71b('0x3a')][_0xa71b('0x6b')]['length']>0x0?_[_0xa71b('0x29')](_0x342309[_0xa71b('0x3a')][_0xa71b('0x6b')],function(_0x52664a){return{'name':_0x52664a[_0xa71b('0x69')],'value':_0x52664a[_0xa71b('0x6c')]};}):[]};})};}})[_0xa71b('0x44')](respondWithResult(_0x13b7e2,null))[_0xa71b('0x41')](function(_0xa76195){console[_0xa71b('0x6d')](_0xa71b('0x6e')+_0xa76195);var _0x43eee4=_0x237537[_0xa71b('0x2f')][_0xa71b('0x6f')]?0x1f4:_0xa76195[_0xa71b('0x70')]||0x1f4;logger[_0xa71b('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xa71b('0x71'),_0x43eee4,JSON[_0xa71b('0x72')](_0xa76195));delete _0xa76195[_0xa71b('0x27')];if(_0x43eee4===0x191){_0x43eee4=0x190;}_0x13b7e2[_0xa71b('0x19')](_0x43eee4)['send'](_0x237537['query'][_0xa71b('0x6f')]?{'message':_0xa71b('0x73'),'statusCode':_0xa76195['statusCode']}:_0xa76195);});}; \ No newline at end of file +var _0x1151=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','send','index','VtigerAccount','fieldName','type','key','model','map','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','destroy','findOne','rawAttributes','getConfigurations','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerConfiguration','VtigerField','md5','getFields','description','moduleName','remoteUri','accessKey','username','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','result','token','sessionName','autogenerated','reference','owner','remove','includes','false','label','cf_','picklist','picklistValues','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3040ba,_0x5876d0){var _0x21539b=function(_0x4e2ee2){while(--_0x4e2ee2){_0x3040ba['push'](_0x3040ba['shift']());}};_0x21539b(++_0x5876d0);}(_0x1151,0x65));var _0x1115=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x1151[_0x207a02];return _0xd995c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1115('0x0'));var zipdir=require(_0x1115('0x1'));var jsonpatch=require(_0x1115('0x2'));var rp=require(_0x1115('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1115('0x4'));var util=require(_0x1115('0x5'));var path=require(_0x1115('0x6'));var sox=require(_0x1115('0x7'));var csv=require(_0x1115('0x8'));var ejs=require(_0x1115('0x9'));var fs=require('fs');var fs_extra=require(_0x1115('0xa'));var _=require(_0x1115('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1115('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1115('0x8'));var querystring=require(_0x1115('0xd'));var Papa=require(_0x1115('0xe'));var Redis=require(_0x1115('0xf'));var authService=require(_0x1115('0x10'));var qs=require(_0x1115('0x11'));var as=require(_0x1115('0x12'));var hardwareService=require(_0x1115('0x13'));var logger=require(_0x1115('0x14'))(_0x1115('0x15'));var utils=require('../../config/utils');var config=require(_0x1115('0x16'));var licenseUtil=require(_0x1115('0x17'));var db=require(_0x1115('0x18'))['db'];var integrations=require(_0x1115('0x19'));function respondWithStatusCode(_0x28cdb1,_0x39d20b){_0x39d20b=_0x39d20b||0xcc;return function(_0x5025e9){if(_0x5025e9){return _0x28cdb1[_0x1115('0x1a')](_0x39d20b);}return _0x28cdb1['status'](_0x39d20b)[_0x1115('0x1b')]();};}function respondWithResult(_0x170475,_0x58fd86){_0x58fd86=_0x58fd86||0xc8;return function(_0x50843b){if(_0x50843b){return _0x170475[_0x1115('0x1c')](_0x58fd86)[_0x1115('0x1d')](_0x50843b);}};}function respondWithFilteredResult(_0x1028e6,_0x564672){return function(_0x4d34be){if(_0x4d34be){var _0x4f2833=typeof _0x564672[_0x1115('0x1e')]===_0x1115('0x1f')&&typeof _0x564672[_0x1115('0x20')]===_0x1115('0x1f');var _0x221f35=_0x4d34be[_0x1115('0x21')];var _0x1c74d9=_0x4f2833?0x0:_0x564672[_0x1115('0x1e')];var _0x249b35=_0x4f2833?_0x4d34be[_0x1115('0x21')]:_0x564672[_0x1115('0x1e')]+_0x564672[_0x1115('0x20')];var _0x367367;if(_0x249b35>=_0x221f35){_0x249b35=_0x221f35;_0x367367=0xc8;}else{_0x367367=0xce;}_0x1028e6['status'](_0x367367);return _0x1028e6[_0x1115('0x22')]('Content-Range',_0x1c74d9+'-'+_0x249b35+'/'+_0x221f35)[_0x1115('0x1d')](_0x4d34be);}return null;};}function patchUpdates(_0x300499){return function(_0x2c68db){try{jsonpatch[_0x1115('0x23')](_0x2c68db,_0x300499,!![]);}catch(_0x2fa5da){return BPromise[_0x1115('0x24')](_0x2fa5da);}return _0x2c68db['save']();};}function saveUpdates(_0x563d73,_0x56866c){return function(_0x1f2ba3){if(_0x1f2ba3){return _0x1f2ba3[_0x1115('0x25')](_0x563d73)[_0x1115('0x26')](function(_0x3dd44f){return _0x3dd44f;});}return null;};}function removeEntity(_0x3a3cc5,_0x3d88ef){return function(_0x318885){if(_0x318885){return _0x318885['destroy']()['then'](function(){_0x3a3cc5['status'](0xcc)[_0x1115('0x1b')]();});}};}function handleEntityNotFound(_0x876c5d,_0x1d4f6b){return function(_0x294904){if(!_0x294904){_0x876c5d['sendStatus'](0x194);}return _0x294904;};}function handleError(_0x33a768,_0x551407){_0x551407=_0x551407||0x1f4;return function(_0x18a716){logger[_0x1115('0x27')](_0x18a716[_0x1115('0x28')]);if(_0x18a716[_0x1115('0x29')]){delete _0x18a716[_0x1115('0x29')];}_0x33a768[_0x1115('0x1c')](_0x551407)[_0x1115('0x2a')](_0x18a716);};}exports[_0x1115('0x2b')]=function(_0x350ea0,_0x24f830){var _0x5ceeae={},_0x54ecd6={},_0x19ee5a={'count':0x0,'rows':[]};var _0x48c5ee=_['map'](db[_0x1115('0x2c')]['rawAttributes'],function(_0x2d90e5){return{'name':_0x2d90e5[_0x1115('0x2d')],'type':_0x2d90e5[_0x1115('0x2e')][_0x1115('0x2f')]};});_0x54ecd6[_0x1115('0x30')]=_[_0x1115('0x31')](_0x48c5ee,_0x1115('0x29'));_0x54ecd6[_0x1115('0x32')]=_['keys'](_0x350ea0[_0x1115('0x32')]);_0x54ecd6['filters']=_[_0x1115('0x33')](_0x54ecd6[_0x1115('0x30')],_0x54ecd6[_0x1115('0x32')]);_0x5ceeae[_0x1115('0x34')]=_[_0x1115('0x33')](_0x54ecd6[_0x1115('0x30')],qs[_0x1115('0x35')](_0x350ea0[_0x1115('0x32')]['fields']));_0x5ceeae[_0x1115('0x34')]=_0x5ceeae[_0x1115('0x34')][_0x1115('0x36')]?_0x5ceeae[_0x1115('0x34')]:_0x54ecd6[_0x1115('0x30')];if(!_0x350ea0[_0x1115('0x32')]['hasOwnProperty']('nolimit')){_0x5ceeae[_0x1115('0x20')]=qs[_0x1115('0x20')](_0x350ea0[_0x1115('0x32')]['limit']);_0x5ceeae[_0x1115('0x1e')]=qs[_0x1115('0x1e')](_0x350ea0[_0x1115('0x32')][_0x1115('0x1e')]);}_0x5ceeae[_0x1115('0x37')]=qs[_0x1115('0x38')](_0x350ea0['query'][_0x1115('0x38')]);_0x5ceeae[_0x1115('0x39')]=qs[_0x1115('0x3a')](_[_0x1115('0x3b')](_0x350ea0[_0x1115('0x32')],_0x54ecd6[_0x1115('0x3a')]),_0x48c5ee);if(_0x350ea0['query'][_0x1115('0x3c')]){_0x5ceeae[_0x1115('0x39')]=_[_0x1115('0x3d')](_0x5ceeae['where'],{'$or':_[_0x1115('0x31')](_0x48c5ee,function(_0x392632){if(_0x392632['type']!=='VIRTUAL'){var _0x44763d={};_0x44763d[_0x392632[_0x1115('0x29')]]={'$like':'%'+_0x350ea0['query']['filter']+'%'};return _0x44763d;}})});}_0x5ceeae=_[_0x1115('0x3d')]({},_0x5ceeae,_0x350ea0['options']);var _0xbfe7a8={'where':_0x5ceeae[_0x1115('0x39')]};return db['VtigerAccount']['count'](_0xbfe7a8)['then'](function(_0x16e4ee){_0x19ee5a[_0x1115('0x21')]=_0x16e4ee;if(_0x350ea0[_0x1115('0x32')]['includeAll']){_0x5ceeae[_0x1115('0x3e')]=[{'all':!![]}];}return db['VtigerAccount'][_0x1115('0x3f')](_0x5ceeae);})['then'](function(_0x261838){_0x19ee5a[_0x1115('0x40')]=_0x261838;return _0x19ee5a;})[_0x1115('0x26')](respondWithFilteredResult(_0x24f830,_0x5ceeae))[_0x1115('0x41')](handleError(_0x24f830,null));};exports[_0x1115('0x42')]=function(_0x1ae78a,_0x417a17){var _0x51d5a5={'raw':![],'where':{'id':_0x1ae78a[_0x1115('0x43')]['id']}},_0x14e09c={};_0x14e09c['model']=_['keys'](db['VtigerAccount']['rawAttributes']);_0x14e09c['query']=_[_0x1115('0x44')](_0x1ae78a[_0x1115('0x32')]);_0x14e09c[_0x1115('0x3a')]=_[_0x1115('0x33')](_0x14e09c[_0x1115('0x30')],_0x14e09c[_0x1115('0x32')]);_0x51d5a5[_0x1115('0x34')]=_[_0x1115('0x33')](_0x14e09c[_0x1115('0x30')],qs[_0x1115('0x35')](_0x1ae78a[_0x1115('0x32')][_0x1115('0x35')]));_0x51d5a5[_0x1115('0x34')]=_0x51d5a5[_0x1115('0x34')][_0x1115('0x36')]?_0x51d5a5[_0x1115('0x34')]:_0x14e09c[_0x1115('0x30')];if(_0x1ae78a[_0x1115('0x32')][_0x1115('0x45')]){_0x51d5a5['include']=[{'all':!![]}];}_0x51d5a5=_['merge']({},_0x51d5a5,_0x1ae78a[_0x1115('0x46')]);return db[_0x1115('0x2c')][_0x1115('0x47')](_0x51d5a5)[_0x1115('0x26')](handleEntityNotFound(_0x417a17,null))[_0x1115('0x26')](respondWithResult(_0x417a17,null))['catch'](handleError(_0x417a17,null));};exports[_0x1115('0x48')]=function(_0x26dfb7,_0xd22859){return db[_0x1115('0x2c')][_0x1115('0x48')](_0x26dfb7[_0x1115('0x49')],{})[_0x1115('0x26')](respondWithResult(_0xd22859,0xc9))[_0x1115('0x41')](handleError(_0xd22859,null));};exports[_0x1115('0x25')]=function(_0x1cc619,_0x3a6827){if(_0x1cc619['body']['id']){delete _0x1cc619[_0x1115('0x49')]['id'];}return db[_0x1115('0x2c')][_0x1115('0x47')]({'where':{'id':_0x1cc619[_0x1115('0x43')]['id']}})[_0x1115('0x26')](handleEntityNotFound(_0x3a6827,null))[_0x1115('0x26')](saveUpdates(_0x1cc619[_0x1115('0x49')],null))[_0x1115('0x26')](respondWithResult(_0x3a6827,null))[_0x1115('0x41')](handleError(_0x3a6827,null));};exports[_0x1115('0x4a')]=function(_0x48e859,_0x2f88ff){return db[_0x1115('0x2c')][_0x1115('0x47')]({'where':{'id':_0x48e859[_0x1115('0x43')]['id']}})[_0x1115('0x26')](handleEntityNotFound(_0x2f88ff,null))[_0x1115('0x26')](removeEntity(_0x2f88ff,null))[_0x1115('0x41')](handleError(_0x2f88ff,null));};exports['getConfigurations']=function(_0x37173c,_0x288994,_0x129aae){var _0x53d808={};var _0x374914={};var _0x35985f;var _0x2ab181;return db[_0x1115('0x2c')][_0x1115('0x4b')]({'where':{'id':_0x37173c[_0x1115('0x43')]['id']}})[_0x1115('0x26')](handleEntityNotFound(_0x288994,null))[_0x1115('0x26')](function(_0x1e36a4){if(_0x1e36a4){_0x35985f=_0x1e36a4;_0x374914[_0x1115('0x30')]=_[_0x1115('0x44')](db['VtigerConfiguration'][_0x1115('0x4c')]);_0x374914['query']=_[_0x1115('0x44')](_0x37173c[_0x1115('0x32')]);_0x374914['filters']=_[_0x1115('0x33')](_0x374914[_0x1115('0x30')],_0x374914[_0x1115('0x32')]);_0x53d808[_0x1115('0x34')]=_['intersection'](_0x374914['model'],qs['fields'](_0x37173c[_0x1115('0x32')][_0x1115('0x35')]));_0x53d808[_0x1115('0x34')]=_0x53d808[_0x1115('0x34')][_0x1115('0x36')]?_0x53d808[_0x1115('0x34')]:_0x374914['model'];_0x53d808[_0x1115('0x37')]=qs[_0x1115('0x38')](_0x37173c[_0x1115('0x32')][_0x1115('0x38')]);_0x53d808[_0x1115('0x39')]=qs[_0x1115('0x3a')](_['pick'](_0x37173c[_0x1115('0x32')],_0x374914[_0x1115('0x3a')]));if(_0x37173c[_0x1115('0x32')]['filter']){_0x53d808['where']=_['merge'](_0x53d808[_0x1115('0x39')],{'$or':_[_0x1115('0x31')](_0x53d808[_0x1115('0x34')],function(_0x192407){var _0x35db89={};_0x35db89[_0x192407]={'$like':'%'+_0x37173c[_0x1115('0x32')][_0x1115('0x3c')]+'%'};return _0x35db89;})});}_0x53d808=_[_0x1115('0x3d')]({},_0x53d808,_0x37173c[_0x1115('0x46')]);return _0x35985f[_0x1115('0x4d')](_0x53d808);}})[_0x1115('0x26')](function(_0x5a9317){if(_0x5a9317){_0x2ab181=_0x5a9317[_0x1115('0x36')];if(!_0x37173c['query'][_0x1115('0x4e')](_0x1115('0x4f'))){_0x53d808[_0x1115('0x20')]=qs[_0x1115('0x20')](_0x37173c[_0x1115('0x32')]['limit']);_0x53d808[_0x1115('0x1e')]=qs['offset'](_0x37173c['query'][_0x1115('0x1e')]);}return _0x35985f[_0x1115('0x4d')](_0x53d808);}})['then'](function(_0x3b096c){if(_0x3b096c){return _0x3b096c?{'count':_0x2ab181,'rows':_0x3b096c}:null;}})[_0x1115('0x26')](respondWithResult(_0x288994,null))[_0x1115('0x41')](handleError(_0x288994,null));};exports[_0x1115('0x50')]=function(_0x44e17b,_0xb4cce1,_0x378fac){if(_0x44e17b[_0x1115('0x49')]['id']){delete _0x44e17b['body']['id'];}return db[_0x1115('0x2c')][_0x1115('0x4b')]({'where':{'id':_0x44e17b[_0x1115('0x43')]['id']}})[_0x1115('0x26')](handleEntityNotFound(_0xb4cce1,null))[_0x1115('0x26')](function(_0x26d7bf){if(_0x26d7bf){_0x44e17b['body'][_0x1115('0x51')]=_0x26d7bf['id'];_0x44e17b['body'][_0x1115('0x52')]=integrations[_0x1115('0x53')](_0x44e17b[_0x1115('0x49')][_0x1115('0x54')],_0x44e17b['body'][_0x1115('0x2e')]);_0x44e17b[_0x1115('0x49')][_0x1115('0x55')]=integrations['getDescriptions'](_0x44e17b['body'][_0x1115('0x54')],_0x44e17b[_0x1115('0x49')]['type']);return db[_0x1115('0x56')][_0x1115('0x48')](_0x44e17b[_0x1115('0x49')],{'include':[{'model':db[_0x1115('0x57')],'as':_0x1115('0x52')},{'model':db[_0x1115('0x57')],'as':_0x1115('0x55')}]});}return null;})['then'](respondWithResult(_0xb4cce1,null))[_0x1115('0x41')](handleError(_0xb4cce1,null));};var md5=require(_0x1115('0x58'));exports[_0x1115('0x59')]=function(_0xfd9236,_0x4034dd,_0xeec935){var _0x328cb9=null;var _0x9c7e85=null;var _0x3bacff=null;var _0x3d320d=null;var _0x5060d5='';return db[_0x1115('0x2c')][_0x1115('0x4b')]({'where':{'id':_0xfd9236[_0x1115('0x43')]['id']},'attributes':['id',_0x1115('0x29'),'username',_0x1115('0x5a'),_0x1115('0x5b'),_0x1115('0x5c'),'serverUrl',_0x1115('0x5d')]})[_0x1115('0x26')](handleEntityNotFound(_0x4034dd,null))[_0x1115('0x26')](function(_0x1919ce){if(_0x1919ce){_0x328cb9=_0x1919ce[_0x1115('0x5e')];_0x9c7e85=_0x1919ce[_0x1115('0x5d')];_0x3bacff=_0x1919ce[_0x1115('0x5b')];_0x5060d5=_0x1919ce[_0x1115('0x5c')];var _0x4fa40f=_0x5060d5['slice'](-0x1);if(_0x4fa40f==='/'){_0x5060d5=_0x5060d5[_0x1115('0x5f')](0x0,_0x5060d5[_0x1115('0x60')](_0x4fa40f));}_0x3d320d=util['format'](_0x1115('0x61'),_0x5060d5);var _0x1513a8={'method':_0x1115('0x62'),'uri':_0x3d320d,'qs':{'operation':_0x1115('0x63'),'username':_0x1919ce[_0x1115('0x5e')]},'json':!![]};return rp(_0x1513a8);}})['then'](function(_0x3ef197){if(_0x3ef197[_0x1115('0x64')]){var _0x2ff13e={'method':_0x1115('0x65'),'uri':_0x3d320d,'form':{'operation':'login','username':_0x328cb9,'accessKey':md5(_0x3ef197[_0x1115('0x66')][_0x1115('0x67')]+_0x9c7e85)},'json':!![]};return rp(_0x2ff13e);}})[_0x1115('0x26')](function(_0x280ccb){if(_0x280ccb[_0x1115('0x64')]){var _0x3e5615={'method':_0x1115('0x62'),'uri':_0x3d320d,'qs':{'operation':'describe','username':_0x328cb9,'sessionName':_0x280ccb[_0x1115('0x66')][_0x1115('0x68')],'elementType':_0x3bacff},'json':!![]};return rp(_0x3e5615);}})[_0x1115('0x26')](function(_0x2376e7){if(_0x2376e7[_0x1115('0x64')]){var _0x41bc82=[_0x1115('0x69'),_0x1115('0x6a'),_0x1115('0x6b')];_[_0x1115('0x6c')](_0x2376e7[_0x1115('0x66')][_0x1115('0x35')],function(_0x5084e1){return _0x41bc82[_0x1115('0x6d')](_0x5084e1[_0x1115('0x2e')][_0x1115('0x29')]);});_[_0x1115('0x6c')](_0x2376e7[_0x1115('0x66')][_0x1115('0x35')],function(_0x28f7aa){return _0x28f7aa['editable']===_0x1115('0x6e');});return{'count':_0x2376e7[_0x1115('0x66')][_0x1115('0x35')][_0x1115('0x36')],'rows':_[_0x1115('0x31')](_0x2376e7[_0x1115('0x66')]['fields'],function(_0x567c9e){return{'id':_0x567c9e['name'],'name':_0x567c9e[_0x1115('0x6f')],'custom':_['startsWith'](_0x567c9e['name'],_0x1115('0x70'))?!![]:![],'options':_0x567c9e[_0x1115('0x2e')][_0x1115('0x29')]===_0x1115('0x71')&&_0x567c9e[_0x1115('0x2e')]['picklistValues'][_0x1115('0x36')]>0x0?_[_0x1115('0x31')](_0x567c9e[_0x1115('0x2e')][_0x1115('0x72')],function(_0x1ed6a7){return{'name':_0x1ed6a7[_0x1115('0x6f')],'value':_0x1ed6a7[_0x1115('0x73')]};}):[]};})};}})[_0x1115('0x26')](respondWithResult(_0x4034dd,null))['catch'](function(_0x6b3375){console['log']('vTiger\x20error:\x20'+_0x6b3375);var _0x2f5d2b=_0xfd9236[_0x1115('0x32')]['test']?0x1f4:_0x6b3375[_0x1115('0x74')]||0x1f4;logger['error'](_0x1115('0x75'),_0x1115('0x59'),_0x2f5d2b,JSON[_0x1115('0x76')](_0x6b3375));delete _0x6b3375[_0x1115('0x29')];if(_0x2f5d2b===0x191){_0x2f5d2b=0x190;}_0x4034dd[_0x1115('0x1c')](_0x2f5d2b)['send'](_0xfd9236['query'][_0x1115('0x77')]?{'message':_0x1115('0x78'),'statusCode':_0x6b3375[_0x1115('0x74')]}:_0x6b3375);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 7e80a89..97ce58d 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 _0xf41e=['../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x37924e,_0x28921c){var _0x5282d0=function(_0x1706bc){while(--_0x1706bc){_0x37924e['push'](_0x37924e['shift']());}};_0x5282d0(++_0x28921c);}(_0xf41e,0x88));var _0xef41=function(_0x537cdf,_0x48cf50){_0x537cdf=_0x537cdf-0x0;var _0x15ccaa=_0xf41e[_0x537cdf];return _0x15ccaa;};'use strict';var _=require(_0xef41('0x0'));var util=require('util');var logger=require(_0xef41('0x1'))('api');var moment=require('moment');var BPromise=require(_0xef41('0x2'));var rp=require(_0xef41('0x3'));var fs=require('fs');var path=require(_0xef41('0x4'));var rimraf=require(_0xef41('0x5'));var config=require(_0xef41('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xef41('0x7'));module[_0xef41('0x8')]=function(_0x2dcf67,_0x586f6e){return _0x2dcf67[_0xef41('0x9')]('VtigerAccount',attributes,{'tableName':_0xef41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x291f=['request-promise','rimraf','../../components/integrations/configuration','exports','int_vtiger_accounts','../../config/logger','moment'];(function(_0x32cadf,_0x3de1c6){var _0x3b6a30=function(_0x4ea9bb){while(--_0x4ea9bb){_0x32cadf['push'](_0x32cadf['shift']());}};_0x3b6a30(++_0x3de1c6);}(_0x291f,0xa6));var _0xf291=function(_0x3fc3af,_0xd1fe0c){_0x3fc3af=_0x3fc3af-0x0;var _0x2f8d47=_0x291f[_0x3fc3af];return _0x2f8d47;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf291('0x0'))('api');var moment=require(_0xf291('0x1'));var BPromise=require('bluebird');var rp=require(_0xf291('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf291('0x3'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xf291('0x4'));module[_0xf291('0x5')]=function(_0x1915e1,_0x9ba697){return _0x1915e1['define']('VtigerAccount',attributes,{'tableName':_0xf291('0x6'),'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 734ebd8..3fbb186 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 _0xb58b=['model','map','debug','catch','ShowVtigerAccount','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include'];(function(_0x161ac3,_0x142e49){var _0x3bb837=function(_0x269c7c){while(--_0x269c7c){_0x161ac3['push'](_0x161ac3['shift']());}};_0x3bb837(++_0x142e49);}(_0xb58b,0x1f1));var _0xbb58=function(_0x21a00b,_0x3192b7){_0x21a00b=_0x21a00b-0x0;var _0x160995=_0xb58b[_0x21a00b];return _0x160995;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cbda,_0x323066,_0xe874f2){return new BPromise(function(_0x5d7fe8,_0xd94f1){return client[_0xbb58('0x9')](_0x27cbda,_0xe874f2)[_0xbb58('0xa')](function(_0x36ca50){logger[_0xbb58('0xb')](_0xbb58('0xc'),_0x323066,_0xbb58('0xd'));logger['debug'](_0xbb58('0xe'),_0x323066,'request\x20sent',JSON[_0xbb58('0xf')](_0x36ca50));if(_0x36ca50[_0xbb58('0x10')]){if(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x11')]===0x1f4){logger['error'](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0xd94f1(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}logger[_0xbb58('0x10')](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0x5d7fe8(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x323066,_0xbb58('0xd'));_0x5d7fe8(_0x36ca50[_0xbb58('0x13')][_0xbb58('0x12')]);}})['catch'](function(_0x5edc97){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x323066,_0x5edc97);_0xd94f1(_0x5edc97);});});}exports[_0xbb58('0x14')]=function(_0x3134ea){var _0x48f3e0=this;return new Promise(function(_0xbee66,_0x497653){return db[_0xbb58('0x15')][_0xbb58('0x16')]({'raw':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x18')]===undefined?!![]:![]:!![],'where':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')]['where']||null:null,'attributes':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x19')]||null:null,'limit':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x1a')]||null:null,'include':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x1b')]?_['map'](_0x3134ea[_0xbb58('0x17')]['include'],function(_0x21964d){return{'model':db[_0x21964d[_0xbb58('0x1c')]],'as':_0x21964d['as'],'attributes':_0x21964d[_0xbb58('0x19')],'include':_0x21964d[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x21964d[_0xbb58('0x1b')],function(_0x2d556a){return{'model':db[_0x2d556a[_0xbb58('0x1c')]],'as':_0x2d556a['as'],'attributes':_0x2d556a['attributes'],'include':_0x2d556a[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x2d556a[_0xbb58('0x1b')],function(_0x129094){return{'model':db[_0x129094[_0xbb58('0x1c')]],'as':_0x129094['as'],'attributes':_0x129094[_0xbb58('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbb58('0xa')](function(_0x2ce7c3){logger[_0xbb58('0xb')](_0xbb58('0x14'),_0x3134ea);logger[_0xbb58('0x1e')](_0xbb58('0x14'),_0x3134ea,JSON[_0xbb58('0xf')](_0x2ce7c3));_0xbee66(_0x2ce7c3);})[_0xbb58('0x1f')](function(_0x3559b6){logger['error'](_0xbb58('0x14'),_0x3559b6[_0xbb58('0x12')],_0x3134ea);_0x497653(_0x48f3e0[_0xbb58('0x10')](0x1f4,_0x3559b6[_0xbb58('0x12')]));});});};exports[_0xbb58('0x20')]=function(_0x9d379f){var _0x1ba526=this;return new Promise(function(_0x643e0e,_0x3f8db3){return db['VtigerAccount'][_0xbb58('0x21')]({'raw':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x18')]===undefined?!![]:![]:!![],'where':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x22')]||null:null,'attributes':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x19')]||null:null,'include':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x1b')]?_['map'](_0x9d379f['options']['include'],function(_0x1def9f){return{'model':db[_0x1def9f[_0xbb58('0x1c')]],'as':_0x1def9f['as'],'attributes':_0x1def9f[_0xbb58('0x19')],'include':_0x1def9f[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x1def9f[_0xbb58('0x1b')],function(_0x3093bf){return{'model':db[_0x3093bf[_0xbb58('0x1c')]],'as':_0x3093bf['as'],'attributes':_0x3093bf['attributes'],'include':_0x3093bf[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x3093bf['include'],function(_0x33ec68){return{'model':db[_0x33ec68['model']],'as':_0x33ec68['as'],'attributes':_0x33ec68[_0xbb58('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x86372e){logger[_0xbb58('0xb')]('ShowVtigerAccount',_0x9d379f);logger[_0xbb58('0x1e')](_0xbb58('0x20'),_0x9d379f,JSON[_0xbb58('0xf')](_0x86372e));_0x643e0e(_0x86372e);})[_0xbb58('0x1f')](function(_0x1b86a6){logger[_0xbb58('0x10')](_0xbb58('0x20'),_0x1b86a6[_0xbb58('0x12')],_0x9d379f);_0x3f8db3(_0x1ba526['error'](0x1f4,_0x1b86a6[_0xbb58('0x12')]));});});}; \ No newline at end of file +var _0xd4f4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x321472,_0x1f27e3){var _0x8a561c=function(_0x285860){while(--_0x285860){_0x321472['push'](_0x321472['shift']());}};_0x8a561c(++_0x1f27e3);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x3d68d8,_0x59732d){_0x3d68d8=_0x3d68d8-0x0;var _0x6fb1f7=_0xd4f4[_0x3d68d8];return _0x6fb1f7;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7aa8,_0xecc103,_0x150bd6){return new BPromise(function(_0xea29b,_0x40be66){return client[_0x4d4f('0xb')](_0x1d7aa8,_0x150bd6)[_0x4d4f('0xc')](function(_0x226837){logger[_0x4d4f('0xd')](_0x4d4f('0xe'),_0xecc103,_0x4d4f('0xf'));logger[_0x4d4f('0x10')](_0x4d4f('0x11'),_0xecc103,_0x4d4f('0xf'),JSON[_0x4d4f('0x12')](_0x226837));if(_0x226837[_0x4d4f('0x13')]){if(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0xecc103,_0x226837['error'][_0x4d4f('0x15')]);return _0x40be66(_0x226837[_0x4d4f('0x13')]['message']);}logger[_0x4d4f('0x13')](_0x4d4f('0xe'),_0xecc103,_0x226837[_0x4d4f('0x13')]['message']);return _0xea29b(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x15')]);}else{logger[_0x4d4f('0xd')]('VtigerAccount,\x20%s,\x20%s',_0xecc103,_0x4d4f('0xf'));_0xea29b(_0x226837['result'][_0x4d4f('0x15')]);}})[_0x4d4f('0x16')](function(_0x4170ca){logger['error'](_0x4d4f('0xe'),_0xecc103,_0x4170ca);_0x40be66(_0x4170ca);});});}exports[_0x4d4f('0x17')]=function(_0x51dcf1){var _0x5dbbeb=this;return new Promise(function(_0x519501,_0x5a58af){return db['VtigerAccount'][_0x4d4f('0x18')]({'raw':_0x51dcf1[_0x4d4f('0x19')]?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1a')]===undefined?!![]:![]:!![],'where':_0x51dcf1['options']?_0x51dcf1['options'][_0x4d4f('0x1b')]||null:null,'attributes':_0x51dcf1['options']?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1c')]||null:null,'limit':_0x51dcf1[_0x4d4f('0x19')]?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1d')]||null:null,'include':_0x51dcf1['options']?_0x51dcf1['options'][_0x4d4f('0x1e')]?_['map'](_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1e')],function(_0x2d2fb3){return{'model':db[_0x2d2fb3[_0x4d4f('0x1f')]],'as':_0x2d2fb3['as'],'attributes':_0x2d2fb3[_0x4d4f('0x1c')],'include':_0x2d2fb3['include']?_[_0x4d4f('0x20')](_0x2d2fb3[_0x4d4f('0x1e')],function(_0x1cf365){return{'model':db[_0x1cf365[_0x4d4f('0x1f')]],'as':_0x1cf365['as'],'attributes':_0x1cf365['attributes'],'include':_0x1cf365['include']?_[_0x4d4f('0x20')](_0x1cf365[_0x4d4f('0x1e')],function(_0xa2492c){return{'model':db[_0xa2492c[_0x4d4f('0x1f')]],'as':_0xa2492c['as'],'attributes':_0xa2492c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d4f('0xc')](function(_0x380ebf){logger[_0x4d4f('0xd')](_0x4d4f('0x17'),_0x51dcf1);logger['debug'](_0x4d4f('0x17'),_0x51dcf1,JSON['stringify'](_0x380ebf));_0x519501(_0x380ebf);})[_0x4d4f('0x16')](function(_0x333a40){logger['error'](_0x4d4f('0x17'),_0x333a40[_0x4d4f('0x15')],_0x51dcf1);_0x5a58af(_0x5dbbeb[_0x4d4f('0x13')](0x1f4,_0x333a40[_0x4d4f('0x15')]));});});};exports[_0x4d4f('0x21')]=function(_0x43a704){var _0x4c69cb=this;return new Promise(function(_0x36eede,_0x4578b6){return db[_0x4d4f('0x22')][_0x4d4f('0x23')]({'raw':_0x43a704[_0x4d4f('0x19')]?_0x43a704['options'][_0x4d4f('0x1a')]===undefined?!![]:![]:!![],'where':_0x43a704['options']?_0x43a704[_0x4d4f('0x19')]['where']||null:null,'attributes':_0x43a704['options']?_0x43a704['options'][_0x4d4f('0x1c')]||null:null,'include':_0x43a704['options']?_0x43a704[_0x4d4f('0x19')][_0x4d4f('0x1e')]?_[_0x4d4f('0x20')](_0x43a704['options'][_0x4d4f('0x1e')],function(_0x1ab7c4){return{'model':db[_0x1ab7c4[_0x4d4f('0x1f')]],'as':_0x1ab7c4['as'],'attributes':_0x1ab7c4['attributes'],'include':_0x1ab7c4[_0x4d4f('0x1e')]?_['map'](_0x1ab7c4[_0x4d4f('0x1e')],function(_0x2f18df){return{'model':db[_0x2f18df[_0x4d4f('0x1f')]],'as':_0x2f18df['as'],'attributes':_0x2f18df[_0x4d4f('0x1c')],'include':_0x2f18df[_0x4d4f('0x1e')]?_[_0x4d4f('0x20')](_0x2f18df[_0x4d4f('0x1e')],function(_0x461900){return{'model':db[_0x461900['model']],'as':_0x461900['as'],'attributes':_0x461900['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d4f('0xc')](function(_0x559441){logger['info'](_0x4d4f('0x21'),_0x43a704);logger[_0x4d4f('0x10')](_0x4d4f('0x21'),_0x43a704,JSON[_0x4d4f('0x12')](_0x559441));_0x36eede(_0x559441);})[_0x4d4f('0x16')](function(_0x56eed8){logger[_0x4d4f('0x13')](_0x4d4f('0x21'),_0x56eed8['message'],_0x43a704);_0x4578b6(_0x4c69cb[_0x4d4f('0x13')](0x1f4,_0x56eed8[_0x4d4f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 38f326d..0998304 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 _0x73cf=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x73cf,0x180));var _0xf73c=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x73cf[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0xf73c('0x0'));var util=require(_0xf73c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf73c('0x2'));var router=express[_0xf73c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf73c('0x4'));var interaction=require(_0xf73c('0x5'));var config=require(_0xf73c('0x6'));var controller=require(_0xf73c('0x7'));router['get']('/',auth[_0xf73c('0x8')](),controller['index']);router['get'](_0xf73c('0x9'),auth['isAuthenticated'](),controller[_0xf73c('0xa')]);router[_0xf73c('0xb')](_0xf73c('0xc'),auth[_0xf73c('0x8')](),controller[_0xf73c('0xd')]);router[_0xf73c('0xb')](_0xf73c('0xe'),auth[_0xf73c('0x8')](),controller[_0xf73c('0xf')]);router[_0xf73c('0xb')](_0xf73c('0x10'),auth[_0xf73c('0x8')](),controller[_0xf73c('0x11')]);router[_0xf73c('0x12')]('/',auth['isAuthenticated'](),controller[_0xf73c('0x13')]);router[_0xf73c('0x14')](_0xf73c('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xf73c('0x15')](_0xf73c('0x9'),auth[_0xf73c('0x8')](),controller[_0xf73c('0x16')]);module[_0xf73c('0x17')]=router; \ No newline at end of file +var _0xbe38=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects'];(function(_0x4817c9,_0x513943){var _0x42c186=function(_0x463b28){while(--_0x463b28){_0x4817c9['push'](_0x4817c9['shift']());}};_0x42c186(++_0x513943);}(_0xbe38,0x99));var _0x8be3=function(_0x35644c,_0x3c80a0){_0x35644c=_0x35644c-0x0;var _0xc2e514=_0xbe38[_0x35644c];return _0xc2e514;};'use strict';var multer=require('multer');var util=require(_0x8be3('0x0'));var path=require(_0x8be3('0x1'));var timeout=require(_0x8be3('0x2'));var express=require(_0x8be3('0x3'));var router=express[_0x8be3('0x4')]();var fs_extra=require(_0x8be3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8be3('0x6'));var config=require('../../config/environment');var controller=require(_0x8be3('0x7'));router['get']('/',auth[_0x8be3('0x8')](),controller[_0x8be3('0x9')]);router[_0x8be3('0xa')](_0x8be3('0xb'),auth[_0x8be3('0x8')](),controller[_0x8be3('0xc')]);router[_0x8be3('0xa')](_0x8be3('0xd'),auth[_0x8be3('0x8')](),controller['getFields']);router[_0x8be3('0xa')](_0x8be3('0xe'),auth['isAuthenticated'](),controller[_0x8be3('0xf')]);router[_0x8be3('0xa')](_0x8be3('0x10'),auth[_0x8be3('0x8')](),controller[_0x8be3('0x11')]);router[_0x8be3('0x12')]('/',auth['isAuthenticated'](),controller[_0x8be3('0x13')]);router[_0x8be3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8be3('0x15')]);router[_0x8be3('0x16')](_0x8be3('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8be3('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 420534a..58f98d4 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 _0xad0a=['exports','STRING','sequelize'];(function(_0x51896f,_0x6cc04e){var _0x4d334c=function(_0x2c85d7){while(--_0x2c85d7){_0x51896f['push'](_0x51896f['shift']());}};_0x4d334c(++_0x6cc04e);}(_0xad0a,0x11f));var _0xaad0=function(_0x1dfce9,_0x335946){_0x1dfce9=_0x1dfce9-0x0;var _0x525238=_0xad0a[_0x1dfce9];return _0x525238;};'use strict';var Sequelize=require(_0xaad0('0x0'));module[_0xaad0('0x1')]={'name':{'type':Sequelize[_0xaad0('0x2')]},'description':{'type':Sequelize[_0xaad0('0x2')]}}; \ No newline at end of file +var _0x40e1=['STRING','sequelize'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x40e1,0x111));var _0x140e=function(_0xcbc7d0,_0x4ad63c){_0xcbc7d0=_0xcbc7d0-0x0;var _0x37b8c6=_0x40e1[_0xcbc7d0];return _0x37b8c6;};'use strict';var Sequelize=require(_0x140e('0x0'));module['exports']={'name':{'type':Sequelize[_0x140e('0x1')]},'description':{'type':Sequelize[_0x140e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2a6ac00..fb0f7d5 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 _0xbe17=['rawAttributes','length','create','body','find','getFields','findOne','VtigerField','getSubjects','order','nolimit','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','error','name','send','index','map','VtigerConfiguration','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x4b1be9,_0x42a5af){var _0x1cecce=function(_0x381001){while(--_0x381001){_0x4b1be9['push'](_0x4b1be9['shift']());}};_0x1cecce(++_0x42a5af);}(_0xbe17,0x1a1));var _0x7be1=function(_0x4e3814,_0x1f2ea0){_0x4e3814=_0x4e3814-0x0;var _0x58e24d=_0xbe17[_0x4e3814];return _0x58e24d;};'use strict';var emlformat=require(_0x7be1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7be1('0x1'));var jsonpatch=require(_0x7be1('0x2'));var rp=require(_0x7be1('0x3'));var moment=require(_0x7be1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7be1('0x5'));var util=require('util');var path=require(_0x7be1('0x6'));var sox=require(_0x7be1('0x7'));var csv=require(_0x7be1('0x8'));var ejs=require(_0x7be1('0x9'));var fs=require('fs');var fs_extra=require(_0x7be1('0xa'));var _=require('lodash');var squel=require(_0x7be1('0xb'));var crypto=require(_0x7be1('0xc'));var jsforce=require(_0x7be1('0xd'));var deskjs=require(_0x7be1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7be1('0xf'));var Papa=require(_0x7be1('0x10'));var Redis=require('ioredis');var authService=require(_0x7be1('0x11'));var qs=require(_0x7be1('0x12'));var as=require(_0x7be1('0x13'));var hardwareService=require(_0x7be1('0x14'));var logger=require('../../config/logger')(_0x7be1('0x15'));var utils=require(_0x7be1('0x16'));var config=require(_0x7be1('0x17'));var licenseUtil=require(_0x7be1('0x18'));var db=require(_0x7be1('0x19'))['db'];function respondWithStatusCode(_0x49b8d7,_0x5cae09){_0x5cae09=_0x5cae09||0xcc;return function(_0x5a4f58){if(_0x5a4f58){return _0x49b8d7[_0x7be1('0x1a')](_0x5cae09);}return _0x49b8d7[_0x7be1('0x1b')](_0x5cae09)[_0x7be1('0x1c')]();};}function respondWithResult(_0x9b6e2b,_0x5e53af){_0x5e53af=_0x5e53af||0xc8;return function(_0x25ee11){if(_0x25ee11){return _0x9b6e2b[_0x7be1('0x1b')](_0x5e53af)['json'](_0x25ee11);}};}function respondWithFilteredResult(_0x356ab3,_0x18ca36){return function(_0x4919b9){if(_0x4919b9){var _0x5019c3=typeof _0x18ca36[_0x7be1('0x1d')]===_0x7be1('0x1e')&&typeof _0x18ca36[_0x7be1('0x1f')]===_0x7be1('0x1e');var _0x406224=_0x4919b9['count'];var _0x548d55=_0x5019c3?0x0:_0x18ca36['offset'];var _0xa4f29f=_0x5019c3?_0x4919b9[_0x7be1('0x20')]:_0x18ca36[_0x7be1('0x1d')]+_0x18ca36[_0x7be1('0x1f')];var _0x3a362c;if(_0xa4f29f>=_0x406224){_0xa4f29f=_0x406224;_0x3a362c=0xc8;}else{_0x3a362c=0xce;}_0x356ab3[_0x7be1('0x1b')](_0x3a362c);return _0x356ab3['set'](_0x7be1('0x21'),_0x548d55+'-'+_0xa4f29f+'/'+_0x406224)[_0x7be1('0x22')](_0x4919b9);}return null;};}function patchUpdates(_0x44f07d){return function(_0x45b83f){try{jsonpatch[_0x7be1('0x23')](_0x45b83f,_0x44f07d,!![]);}catch(_0x1480c3){return BPromise['reject'](_0x1480c3);}return _0x45b83f['save']();};}function saveUpdates(_0x39399d,_0x544ce8){return function(_0x4af880){if(_0x4af880){return _0x4af880[_0x7be1('0x24')](_0x39399d)[_0x7be1('0x25')](function(_0x2c4a13){return _0x2c4a13;});}return null;};}function removeEntity(_0x109aca,_0x2c7a1b){return function(_0x2631bd){if(_0x2631bd){return _0x2631bd[_0x7be1('0x26')]()['then'](function(){_0x109aca[_0x7be1('0x1b')](0xcc)[_0x7be1('0x1c')]();});}};}function handleEntityNotFound(_0x571de4,_0xf35380){return function(_0x384522){if(!_0x384522){_0x571de4[_0x7be1('0x1a')](0x194);}return _0x384522;};}function handleError(_0x145d87,_0x2d344b){_0x2d344b=_0x2d344b||0x1f4;return function(_0x549dbc){logger[_0x7be1('0x27')](_0x549dbc['stack']);if(_0x549dbc[_0x7be1('0x28')]){delete _0x549dbc[_0x7be1('0x28')];}_0x145d87[_0x7be1('0x1b')](_0x2d344b)[_0x7be1('0x29')](_0x549dbc);};}exports[_0x7be1('0x2a')]=function(_0x20beaf,_0x1f79da){var _0x1c8f8c={},_0x4510ae={},_0x2a2045={'count':0x0,'rows':[]};var _0x23b104=_[_0x7be1('0x2b')](db[_0x7be1('0x2c')]['rawAttributes'],function(_0x5c9152){return{'name':_0x5c9152[_0x7be1('0x2d')],'type':_0x5c9152[_0x7be1('0x2e')][_0x7be1('0x2f')]};});_0x4510ae['model']=_['map'](_0x23b104,_0x7be1('0x28'));_0x4510ae[_0x7be1('0x30')]=_[_0x7be1('0x31')](_0x20beaf['query']);_0x4510ae['filters']=_['intersection'](_0x4510ae[_0x7be1('0x32')],_0x4510ae[_0x7be1('0x30')]);_0x1c8f8c[_0x7be1('0x33')]=_[_0x7be1('0x34')](_0x4510ae[_0x7be1('0x32')],qs[_0x7be1('0x35')](_0x20beaf[_0x7be1('0x30')][_0x7be1('0x35')]));_0x1c8f8c[_0x7be1('0x33')]=_0x1c8f8c[_0x7be1('0x33')]['length']?_0x1c8f8c[_0x7be1('0x33')]:_0x4510ae[_0x7be1('0x32')];if(!_0x20beaf[_0x7be1('0x30')][_0x7be1('0x36')]('nolimit')){_0x1c8f8c[_0x7be1('0x1f')]=qs[_0x7be1('0x1f')](_0x20beaf['query'][_0x7be1('0x1f')]);_0x1c8f8c['offset']=qs[_0x7be1('0x1d')](_0x20beaf[_0x7be1('0x30')][_0x7be1('0x1d')]);}_0x1c8f8c['order']=qs[_0x7be1('0x37')](_0x20beaf[_0x7be1('0x30')][_0x7be1('0x37')]);_0x1c8f8c[_0x7be1('0x38')]=qs[_0x7be1('0x39')](_[_0x7be1('0x3a')](_0x20beaf['query'],_0x4510ae[_0x7be1('0x39')]),_0x23b104);if(_0x20beaf[_0x7be1('0x30')][_0x7be1('0x3b')]){_0x1c8f8c[_0x7be1('0x38')]=_[_0x7be1('0x3c')](_0x1c8f8c[_0x7be1('0x38')],{'$or':_[_0x7be1('0x2b')](_0x23b104,function(_0x1fd5f6){if(_0x1fd5f6[_0x7be1('0x2e')]!==_0x7be1('0x3d')){var _0x2b1a2c={};_0x2b1a2c[_0x1fd5f6[_0x7be1('0x28')]]={'$like':'%'+_0x20beaf[_0x7be1('0x30')][_0x7be1('0x3b')]+'%'};return _0x2b1a2c;}})});}_0x1c8f8c=_[_0x7be1('0x3c')]({},_0x1c8f8c,_0x20beaf[_0x7be1('0x3e')]);var _0x4d5a8a={'where':_0x1c8f8c[_0x7be1('0x38')]};return db['VtigerConfiguration'][_0x7be1('0x20')](_0x4d5a8a)['then'](function(_0x3a55b1){_0x2a2045[_0x7be1('0x20')]=_0x3a55b1;if(_0x20beaf[_0x7be1('0x30')][_0x7be1('0x3f')]){_0x1c8f8c[_0x7be1('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x7be1('0x41')](_0x1c8f8c);})[_0x7be1('0x25')](function(_0x569022){_0x2a2045[_0x7be1('0x42')]=_0x569022;return _0x2a2045;})[_0x7be1('0x25')](respondWithFilteredResult(_0x1f79da,_0x1c8f8c))[_0x7be1('0x43')](handleError(_0x1f79da,null));};exports['show']=function(_0x14d297,_0x4eda6c){var _0x1003a5={'raw':![],'where':{'id':_0x14d297[_0x7be1('0x44')]['id']}},_0x15ebdf={};_0x15ebdf[_0x7be1('0x32')]=_[_0x7be1('0x31')](db[_0x7be1('0x2c')][_0x7be1('0x45')]);_0x15ebdf[_0x7be1('0x30')]=_[_0x7be1('0x31')](_0x14d297[_0x7be1('0x30')]);_0x15ebdf['filters']=_[_0x7be1('0x34')](_0x15ebdf[_0x7be1('0x32')],_0x15ebdf[_0x7be1('0x30')]);_0x1003a5[_0x7be1('0x33')]=_[_0x7be1('0x34')](_0x15ebdf[_0x7be1('0x32')],qs[_0x7be1('0x35')](_0x14d297[_0x7be1('0x30')][_0x7be1('0x35')]));_0x1003a5[_0x7be1('0x33')]=_0x1003a5['attributes'][_0x7be1('0x46')]?_0x1003a5[_0x7be1('0x33')]:_0x15ebdf[_0x7be1('0x32')];if(_0x14d297[_0x7be1('0x30')][_0x7be1('0x3f')]){_0x1003a5[_0x7be1('0x40')]=[{'all':!![]}];}_0x1003a5=_['merge']({},_0x1003a5,_0x14d297[_0x7be1('0x3e')]);return db['VtigerConfiguration']['find'](_0x1003a5)[_0x7be1('0x25')](handleEntityNotFound(_0x4eda6c,null))[_0x7be1('0x25')](respondWithResult(_0x4eda6c,null))[_0x7be1('0x43')](handleError(_0x4eda6c,null));};exports['create']=function(_0xd01400,_0x397d64){return db[_0x7be1('0x2c')][_0x7be1('0x47')](_0xd01400[_0x7be1('0x48')],{})['then'](respondWithResult(_0x397d64,0xc9))[_0x7be1('0x43')](handleError(_0x397d64,null));};exports[_0x7be1('0x24')]=function(_0x27cee2,_0x355738){if(_0x27cee2['body']['id']){delete _0x27cee2[_0x7be1('0x48')]['id'];}return db['VtigerConfiguration'][_0x7be1('0x49')]({'where':{'id':_0x27cee2['params']['id']}})[_0x7be1('0x25')](handleEntityNotFound(_0x355738,null))[_0x7be1('0x25')](saveUpdates(_0x27cee2['body'],null))[_0x7be1('0x25')](respondWithResult(_0x355738,null))['catch'](handleError(_0x355738,null));};exports[_0x7be1('0x26')]=function(_0x2dd811,_0x29e3dd){return db[_0x7be1('0x2c')][_0x7be1('0x49')]({'where':{'id':_0x2dd811[_0x7be1('0x44')]['id']}})['then'](handleEntityNotFound(_0x29e3dd,null))[_0x7be1('0x25')](removeEntity(_0x29e3dd,null))['catch'](handleError(_0x29e3dd,null));};exports[_0x7be1('0x4a')]=function(_0x1c4651,_0x31142b,_0x82f5a3){var _0x359163={};var _0x2e2e9c={};var _0x515fab;var _0x5cadf4;return db[_0x7be1('0x2c')][_0x7be1('0x4b')]({'where':{'id':_0x1c4651[_0x7be1('0x44')]['id']}})['then'](handleEntityNotFound(_0x31142b,null))[_0x7be1('0x25')](function(_0x34f966){if(_0x34f966){_0x515fab=_0x34f966;_0x2e2e9c[_0x7be1('0x32')]=_[_0x7be1('0x31')](db[_0x7be1('0x4c')][_0x7be1('0x45')]);_0x2e2e9c[_0x7be1('0x30')]=_[_0x7be1('0x31')](_0x1c4651['query']);_0x2e2e9c[_0x7be1('0x39')]=_['intersection'](_0x2e2e9c[_0x7be1('0x32')],_0x2e2e9c[_0x7be1('0x30')]);_0x359163['attributes']=_[_0x7be1('0x34')](_0x2e2e9c[_0x7be1('0x32')],qs[_0x7be1('0x35')](_0x1c4651[_0x7be1('0x30')]['fields']));_0x359163[_0x7be1('0x33')]=_0x359163['attributes'][_0x7be1('0x46')]?_0x359163[_0x7be1('0x33')]:_0x2e2e9c[_0x7be1('0x32')];_0x359163['order']=qs[_0x7be1('0x37')](_0x1c4651['query'][_0x7be1('0x37')]);_0x359163[_0x7be1('0x38')]=qs['filters'](_[_0x7be1('0x3a')](_0x1c4651[_0x7be1('0x30')],_0x2e2e9c[_0x7be1('0x39')]));if(_0x1c4651['query'][_0x7be1('0x3b')]){_0x359163['where']=_['merge'](_0x359163['where'],{'$or':_[_0x7be1('0x2b')](_0x359163[_0x7be1('0x33')],function(_0x5a876c){var _0xc8019a={};_0xc8019a[_0x5a876c]={'$like':'%'+_0x1c4651[_0x7be1('0x30')][_0x7be1('0x3b')]+'%'};return _0xc8019a;})});}_0x359163=_[_0x7be1('0x3c')]({},_0x359163,_0x1c4651['options']);return _0x515fab[_0x7be1('0x4a')](_0x359163);}})[_0x7be1('0x25')](function(_0x58653d){if(_0x58653d){_0x5cadf4=_0x58653d[_0x7be1('0x46')];if(!_0x1c4651[_0x7be1('0x30')][_0x7be1('0x36')]('nolimit')){_0x359163[_0x7be1('0x1f')]=qs['limit'](_0x1c4651[_0x7be1('0x30')][_0x7be1('0x1f')]);_0x359163['offset']=qs['offset'](_0x1c4651[_0x7be1('0x30')][_0x7be1('0x1d')]);}return _0x515fab[_0x7be1('0x4a')](_0x359163);}})['then'](function(_0x559d49){if(_0x559d49){return _0x559d49?{'count':_0x5cadf4,'rows':_0x559d49}:null;}})[_0x7be1('0x25')](respondWithResult(_0x31142b,null))['catch'](handleError(_0x31142b,null));};exports[_0x7be1('0x4d')]=function(_0x48b070,_0x70609e,_0x388de3){var _0x2033d5={};var _0x2e79d1={};var _0x230e2c;var _0x5accb1;return db[_0x7be1('0x2c')][_0x7be1('0x4b')]({'where':{'id':_0x48b070[_0x7be1('0x44')]['id']}})['then'](handleEntityNotFound(_0x70609e,null))[_0x7be1('0x25')](function(_0x289dbb){if(_0x289dbb){_0x230e2c=_0x289dbb;_0x2e79d1['model']=_[_0x7be1('0x31')](db[_0x7be1('0x4c')][_0x7be1('0x45')]);_0x2e79d1['query']=_[_0x7be1('0x31')](_0x48b070[_0x7be1('0x30')]);_0x2e79d1['filters']=_['intersection'](_0x2e79d1['model'],_0x2e79d1[_0x7be1('0x30')]);_0x2033d5[_0x7be1('0x33')]=_[_0x7be1('0x34')](_0x2e79d1['model'],qs[_0x7be1('0x35')](_0x48b070[_0x7be1('0x30')][_0x7be1('0x35')]));_0x2033d5[_0x7be1('0x33')]=_0x2033d5[_0x7be1('0x33')][_0x7be1('0x46')]?_0x2033d5[_0x7be1('0x33')]:_0x2e79d1[_0x7be1('0x32')];_0x2033d5[_0x7be1('0x4e')]=qs['sort'](_0x48b070[_0x7be1('0x30')][_0x7be1('0x37')]);_0x2033d5[_0x7be1('0x38')]=qs['filters'](_[_0x7be1('0x3a')](_0x48b070['query'],_0x2e79d1[_0x7be1('0x39')]));if(_0x48b070[_0x7be1('0x30')][_0x7be1('0x3b')]){_0x2033d5[_0x7be1('0x38')]=_[_0x7be1('0x3c')](_0x2033d5[_0x7be1('0x38')],{'$or':_[_0x7be1('0x2b')](_0x2033d5[_0x7be1('0x33')],function(_0x18ac3b){var _0x5b2c2d={};_0x5b2c2d[_0x18ac3b]={'$like':'%'+_0x48b070['query'][_0x7be1('0x3b')]+'%'};return _0x5b2c2d;})});}_0x2033d5=_['merge']({},_0x2033d5,_0x48b070[_0x7be1('0x3e')]);return _0x230e2c[_0x7be1('0x4d')](_0x2033d5);}})['then'](function(_0x15d1fe){if(_0x15d1fe){_0x5accb1=_0x15d1fe['length'];if(!_0x48b070[_0x7be1('0x30')][_0x7be1('0x36')](_0x7be1('0x4f'))){_0x2033d5['limit']=qs[_0x7be1('0x1f')](_0x48b070[_0x7be1('0x30')][_0x7be1('0x1f')]);_0x2033d5[_0x7be1('0x1d')]=qs[_0x7be1('0x1d')](_0x48b070[_0x7be1('0x30')][_0x7be1('0x1d')]);}return _0x230e2c[_0x7be1('0x4d')](_0x2033d5);}})[_0x7be1('0x25')](function(_0x1f31e6){if(_0x1f31e6){return _0x1f31e6?{'count':_0x5accb1,'rows':_0x1f31e6}:null;}})[_0x7be1('0x25')](respondWithResult(_0x70609e,null))[_0x7be1('0x43')](handleError(_0x70609e,null));};exports['getDescriptions']=function(_0x938015,_0x47e6f1,_0x48bd0d){var _0xa5c810={};var _0x533f96={};var _0xca56a3;var _0x3612ae;return db[_0x7be1('0x2c')]['findOne']({'where':{'id':_0x938015[_0x7be1('0x44')]['id']}})[_0x7be1('0x25')](handleEntityNotFound(_0x47e6f1,null))[_0x7be1('0x25')](function(_0x432a0f){if(_0x432a0f){_0xca56a3=_0x432a0f;_0x533f96['model']=_[_0x7be1('0x31')](db[_0x7be1('0x4c')][_0x7be1('0x45')]);_0x533f96[_0x7be1('0x30')]=_[_0x7be1('0x31')](_0x938015['query']);_0x533f96[_0x7be1('0x39')]=_[_0x7be1('0x34')](_0x533f96[_0x7be1('0x32')],_0x533f96['query']);_0xa5c810[_0x7be1('0x33')]=_['intersection'](_0x533f96[_0x7be1('0x32')],qs[_0x7be1('0x35')](_0x938015[_0x7be1('0x30')][_0x7be1('0x35')]));_0xa5c810[_0x7be1('0x33')]=_0xa5c810[_0x7be1('0x33')][_0x7be1('0x46')]?_0xa5c810[_0x7be1('0x33')]:_0x533f96[_0x7be1('0x32')];_0xa5c810[_0x7be1('0x4e')]=qs[_0x7be1('0x37')](_0x938015[_0x7be1('0x30')][_0x7be1('0x37')]);_0xa5c810[_0x7be1('0x38')]=qs[_0x7be1('0x39')](_[_0x7be1('0x3a')](_0x938015[_0x7be1('0x30')],_0x533f96[_0x7be1('0x39')]));if(_0x938015['query']['filter']){_0xa5c810['where']=_[_0x7be1('0x3c')](_0xa5c810[_0x7be1('0x38')],{'$or':_[_0x7be1('0x2b')](_0xa5c810[_0x7be1('0x33')],function(_0x2665a7){var _0xe57612={};_0xe57612[_0x2665a7]={'$like':'%'+_0x938015[_0x7be1('0x30')]['filter']+'%'};return _0xe57612;})});}_0xa5c810=_[_0x7be1('0x3c')]({},_0xa5c810,_0x938015[_0x7be1('0x3e')]);return _0xca56a3['getDescriptions'](_0xa5c810);}})[_0x7be1('0x25')](function(_0x14aca2){if(_0x14aca2){_0x3612ae=_0x14aca2['length'];if(!_0x938015['query'][_0x7be1('0x36')](_0x7be1('0x4f'))){_0xa5c810[_0x7be1('0x1f')]=qs[_0x7be1('0x1f')](_0x938015[_0x7be1('0x30')]['limit']);_0xa5c810['offset']=qs[_0x7be1('0x1d')](_0x938015[_0x7be1('0x30')][_0x7be1('0x1d')]);}return _0xca56a3[_0x7be1('0x50')](_0xa5c810);}})[_0x7be1('0x25')](function(_0x3f8462){if(_0x3f8462){return _0x3f8462?{'count':_0x3612ae,'rows':_0x3f8462}:null;}})['then'](respondWithResult(_0x47e6f1,null))['catch'](handleError(_0x47e6f1,null));}; \ No newline at end of file +var _0x422f=['jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','VtigerConfiguration','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','type','VIRTUAL','findAll','rows','show','params','rawAttributes','length','includeAll','include','merge','options','find','body','catch','getFields','filter','hasOwnProperty','findOne','VtigerField','pick','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x59c3f6,_0x4889b0){var _0x51b314=function(_0x535e9a){while(--_0x535e9a){_0x59c3f6['push'](_0x59c3f6['shift']());}};_0x51b314(++_0x4889b0);}(_0x422f,0x1c7));var _0xf422=function(_0x1098c8,_0x28ba87){_0x1098c8=_0x1098c8-0x0;var _0x5cc1b3=_0x422f[_0x1098c8];return _0x5cc1b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf422('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf422('0x1'));var rp=require(_0xf422('0x2'));var moment=require('moment');var BPromise=require(_0xf422('0x3'));var Mustache=require(_0xf422('0x4'));var util=require(_0xf422('0x5'));var path=require(_0xf422('0x6'));var sox=require(_0xf422('0x7'));var csv=require(_0xf422('0x8'));var ejs=require(_0xf422('0x9'));var fs=require('fs');var fs_extra=require(_0xf422('0xa'));var _=require(_0xf422('0xb'));var squel=require('squel');var crypto=require(_0xf422('0xc'));var jsforce=require(_0xf422('0xd'));var deskjs=require(_0xf422('0xe'));var toCsv=require(_0xf422('0x8'));var querystring=require(_0xf422('0xf'));var Papa=require('papaparse');var Redis=require(_0xf422('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf422('0x11'));var hardwareService=require(_0xf422('0x12'));var logger=require(_0xf422('0x13'))(_0xf422('0x14'));var utils=require(_0xf422('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf422('0x16'));var db=require(_0xf422('0x17'))['db'];function respondWithStatusCode(_0x4d56d1,_0x133a6a){_0x133a6a=_0x133a6a||0xcc;return function(_0x8aa9cc){if(_0x8aa9cc){return _0x4d56d1[_0xf422('0x18')](_0x133a6a);}return _0x4d56d1[_0xf422('0x19')](_0x133a6a)[_0xf422('0x1a')]();};}function respondWithResult(_0x28a6a8,_0x223b21){_0x223b21=_0x223b21||0xc8;return function(_0x272430){if(_0x272430){return _0x28a6a8[_0xf422('0x19')](_0x223b21)['json'](_0x272430);}};}function respondWithFilteredResult(_0x54bb9c,_0x52f96b){return function(_0x1c81e1){if(_0x1c81e1){var _0x30b70a=typeof _0x52f96b[_0xf422('0x1b')]===_0xf422('0x1c')&&typeof _0x52f96b['limit']===_0xf422('0x1c');var _0x264964=_0x1c81e1[_0xf422('0x1d')];var _0x2ae133=_0x30b70a?0x0:_0x52f96b[_0xf422('0x1b')];var _0x29b0b1=_0x30b70a?_0x1c81e1['count']:_0x52f96b['offset']+_0x52f96b[_0xf422('0x1e')];var _0x4b657;if(_0x29b0b1>=_0x264964){_0x29b0b1=_0x264964;_0x4b657=0xc8;}else{_0x4b657=0xce;}_0x54bb9c[_0xf422('0x19')](_0x4b657);return _0x54bb9c['set'](_0xf422('0x1f'),_0x2ae133+'-'+_0x29b0b1+'/'+_0x264964)['json'](_0x1c81e1);}return null;};}function patchUpdates(_0x22afe7){return function(_0x15833b){try{jsonpatch[_0xf422('0x20')](_0x15833b,_0x22afe7,!![]);}catch(_0x4d6717){return BPromise[_0xf422('0x21')](_0x4d6717);}return _0x15833b[_0xf422('0x22')]();};}function saveUpdates(_0x511529,_0x4b80a0){return function(_0x268575){if(_0x268575){return _0x268575[_0xf422('0x23')](_0x511529)['then'](function(_0x25b6a5){return _0x25b6a5;});}return null;};}function removeEntity(_0x570ea2,_0x3b21a5){return function(_0x32ceee){if(_0x32ceee){return _0x32ceee[_0xf422('0x24')]()[_0xf422('0x25')](function(){_0x570ea2[_0xf422('0x19')](0xcc)[_0xf422('0x1a')]();});}};}function handleEntityNotFound(_0xd8d70f,_0x11d10b){return function(_0x5dcab4){if(!_0x5dcab4){_0xd8d70f[_0xf422('0x18')](0x194);}return _0x5dcab4;};}function handleError(_0x59d03d,_0x2f0f9f){_0x2f0f9f=_0x2f0f9f||0x1f4;return function(_0x7d36e7){logger[_0xf422('0x26')](_0x7d36e7[_0xf422('0x27')]);if(_0x7d36e7[_0xf422('0x28')]){delete _0x7d36e7[_0xf422('0x28')];}_0x59d03d[_0xf422('0x19')](_0x2f0f9f)['send'](_0x7d36e7);};}exports['index']=function(_0x35d1fa,_0x10d51b){var _0x266fb8={},_0x33ef63={},_0xefb99e={'count':0x0,'rows':[]};var _0x48e0c7=_[_0xf422('0x29')](db[_0xf422('0x2a')]['rawAttributes'],function(_0x5f0186){return{'name':_0x5f0186[_0xf422('0x2b')],'type':_0x5f0186['type']['key']};});_0x33ef63[_0xf422('0x2c')]=_[_0xf422('0x29')](_0x48e0c7,'name');_0x33ef63[_0xf422('0x2d')]=_[_0xf422('0x2e')](_0x35d1fa[_0xf422('0x2d')]);_0x33ef63[_0xf422('0x2f')]=_[_0xf422('0x30')](_0x33ef63['model'],_0x33ef63[_0xf422('0x2d')]);_0x266fb8['attributes']=_[_0xf422('0x30')](_0x33ef63[_0xf422('0x2c')],qs[_0xf422('0x31')](_0x35d1fa[_0xf422('0x2d')][_0xf422('0x31')]));_0x266fb8[_0xf422('0x32')]=_0x266fb8[_0xf422('0x32')]['length']?_0x266fb8['attributes']:_0x33ef63[_0xf422('0x2c')];if(!_0x35d1fa[_0xf422('0x2d')]['hasOwnProperty'](_0xf422('0x33'))){_0x266fb8[_0xf422('0x1e')]=qs[_0xf422('0x1e')](_0x35d1fa[_0xf422('0x2d')][_0xf422('0x1e')]);_0x266fb8[_0xf422('0x1b')]=qs[_0xf422('0x1b')](_0x35d1fa[_0xf422('0x2d')][_0xf422('0x1b')]);}_0x266fb8[_0xf422('0x34')]=qs[_0xf422('0x35')](_0x35d1fa[_0xf422('0x2d')][_0xf422('0x35')]);_0x266fb8[_0xf422('0x36')]=qs['filters'](_['pick'](_0x35d1fa['query'],_0x33ef63[_0xf422('0x2f')]),_0x48e0c7);if(_0x35d1fa[_0xf422('0x2d')]['filter']){_0x266fb8[_0xf422('0x36')]=_['merge'](_0x266fb8[_0xf422('0x36')],{'$or':_[_0xf422('0x29')](_0x48e0c7,function(_0x55ac68){if(_0x55ac68[_0xf422('0x37')]!==_0xf422('0x38')){var _0x174f6f={};_0x174f6f[_0x55ac68['name']]={'$like':'%'+_0x35d1fa[_0xf422('0x2d')]['filter']+'%'};return _0x174f6f;}})});}_0x266fb8=_['merge']({},_0x266fb8,_0x35d1fa['options']);var _0x112bce={'where':_0x266fb8[_0xf422('0x36')]};return db[_0xf422('0x2a')][_0xf422('0x1d')](_0x112bce)[_0xf422('0x25')](function(_0x2f82a0){_0xefb99e[_0xf422('0x1d')]=_0x2f82a0;if(_0x35d1fa[_0xf422('0x2d')]['includeAll']){_0x266fb8['include']=[{'all':!![]}];}return db[_0xf422('0x2a')][_0xf422('0x39')](_0x266fb8);})[_0xf422('0x25')](function(_0xb3955){_0xefb99e[_0xf422('0x3a')]=_0xb3955;return _0xefb99e;})[_0xf422('0x25')](respondWithFilteredResult(_0x10d51b,_0x266fb8))['catch'](handleError(_0x10d51b,null));};exports[_0xf422('0x3b')]=function(_0x4f453a,_0x17c1f2){var _0x391e3c={'raw':![],'where':{'id':_0x4f453a[_0xf422('0x3c')]['id']}},_0x564041={};_0x564041[_0xf422('0x2c')]=_[_0xf422('0x2e')](db[_0xf422('0x2a')][_0xf422('0x3d')]);_0x564041['query']=_[_0xf422('0x2e')](_0x4f453a[_0xf422('0x2d')]);_0x564041[_0xf422('0x2f')]=_[_0xf422('0x30')](_0x564041[_0xf422('0x2c')],_0x564041['query']);_0x391e3c[_0xf422('0x32')]=_[_0xf422('0x30')](_0x564041['model'],qs[_0xf422('0x31')](_0x4f453a['query'][_0xf422('0x31')]));_0x391e3c[_0xf422('0x32')]=_0x391e3c[_0xf422('0x32')][_0xf422('0x3e')]?_0x391e3c[_0xf422('0x32')]:_0x564041[_0xf422('0x2c')];if(_0x4f453a[_0xf422('0x2d')][_0xf422('0x3f')]){_0x391e3c[_0xf422('0x40')]=[{'all':!![]}];}_0x391e3c=_[_0xf422('0x41')]({},_0x391e3c,_0x4f453a[_0xf422('0x42')]);return db[_0xf422('0x2a')][_0xf422('0x43')](_0x391e3c)[_0xf422('0x25')](handleEntityNotFound(_0x17c1f2,null))[_0xf422('0x25')](respondWithResult(_0x17c1f2,null))['catch'](handleError(_0x17c1f2,null));};exports['create']=function(_0x3c59dd,_0x2c2ce9){return db[_0xf422('0x2a')]['create'](_0x3c59dd[_0xf422('0x44')],{})[_0xf422('0x25')](respondWithResult(_0x2c2ce9,0xc9))[_0xf422('0x45')](handleError(_0x2c2ce9,null));};exports[_0xf422('0x23')]=function(_0x1f3a30,_0x259e24){if(_0x1f3a30[_0xf422('0x44')]['id']){delete _0x1f3a30['body']['id'];}return db[_0xf422('0x2a')]['find']({'where':{'id':_0x1f3a30[_0xf422('0x3c')]['id']}})[_0xf422('0x25')](handleEntityNotFound(_0x259e24,null))['then'](saveUpdates(_0x1f3a30[_0xf422('0x44')],null))[_0xf422('0x25')](respondWithResult(_0x259e24,null))[_0xf422('0x45')](handleError(_0x259e24,null));};exports[_0xf422('0x24')]=function(_0x2df71a,_0x5c3cb8){return db['VtigerConfiguration'][_0xf422('0x43')]({'where':{'id':_0x2df71a['params']['id']}})[_0xf422('0x25')](handleEntityNotFound(_0x5c3cb8,null))[_0xf422('0x25')](removeEntity(_0x5c3cb8,null))[_0xf422('0x45')](handleError(_0x5c3cb8,null));};exports[_0xf422('0x46')]=function(_0x4b4de4,_0x4b8b1f,_0x44448c){var _0xe333b8={};var _0x46a200={};var _0xddcd6c;var _0x2b640a;return db[_0xf422('0x2a')]['findOne']({'where':{'id':_0x4b4de4[_0xf422('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4b8b1f,null))[_0xf422('0x25')](function(_0x39f21b){if(_0x39f21b){_0xddcd6c=_0x39f21b;_0x46a200[_0xf422('0x2c')]=_[_0xf422('0x2e')](db['VtigerField']['rawAttributes']);_0x46a200[_0xf422('0x2d')]=_[_0xf422('0x2e')](_0x4b4de4[_0xf422('0x2d')]);_0x46a200[_0xf422('0x2f')]=_[_0xf422('0x30')](_0x46a200[_0xf422('0x2c')],_0x46a200[_0xf422('0x2d')]);_0xe333b8['attributes']=_[_0xf422('0x30')](_0x46a200[_0xf422('0x2c')],qs[_0xf422('0x31')](_0x4b4de4[_0xf422('0x2d')][_0xf422('0x31')]));_0xe333b8[_0xf422('0x32')]=_0xe333b8[_0xf422('0x32')][_0xf422('0x3e')]?_0xe333b8[_0xf422('0x32')]:_0x46a200[_0xf422('0x2c')];_0xe333b8['order']=qs[_0xf422('0x35')](_0x4b4de4[_0xf422('0x2d')][_0xf422('0x35')]);_0xe333b8[_0xf422('0x36')]=qs[_0xf422('0x2f')](_['pick'](_0x4b4de4[_0xf422('0x2d')],_0x46a200[_0xf422('0x2f')]));if(_0x4b4de4['query'][_0xf422('0x47')]){_0xe333b8[_0xf422('0x36')]=_[_0xf422('0x41')](_0xe333b8[_0xf422('0x36')],{'$or':_[_0xf422('0x29')](_0xe333b8[_0xf422('0x32')],function(_0x3d73de){var _0x5997bc={};_0x5997bc[_0x3d73de]={'$like':'%'+_0x4b4de4[_0xf422('0x2d')][_0xf422('0x47')]+'%'};return _0x5997bc;})});}_0xe333b8=_[_0xf422('0x41')]({},_0xe333b8,_0x4b4de4['options']);return _0xddcd6c[_0xf422('0x46')](_0xe333b8);}})[_0xf422('0x25')](function(_0x3d9946){if(_0x3d9946){_0x2b640a=_0x3d9946[_0xf422('0x3e')];if(!_0x4b4de4[_0xf422('0x2d')][_0xf422('0x48')](_0xf422('0x33'))){_0xe333b8[_0xf422('0x1e')]=qs[_0xf422('0x1e')](_0x4b4de4[_0xf422('0x2d')][_0xf422('0x1e')]);_0xe333b8[_0xf422('0x1b')]=qs[_0xf422('0x1b')](_0x4b4de4[_0xf422('0x2d')][_0xf422('0x1b')]);}return _0xddcd6c[_0xf422('0x46')](_0xe333b8);}})[_0xf422('0x25')](function(_0x42d94f){if(_0x42d94f){return _0x42d94f?{'count':_0x2b640a,'rows':_0x42d94f}:null;}})[_0xf422('0x25')](respondWithResult(_0x4b8b1f,null))['catch'](handleError(_0x4b8b1f,null));};exports['getSubjects']=function(_0x7ddb3,_0x5ec3a5,_0xd9e138){var _0x3345dd={};var _0x416e40={};var _0x14904a;var _0x59efc6;return db[_0xf422('0x2a')][_0xf422('0x49')]({'where':{'id':_0x7ddb3[_0xf422('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5ec3a5,null))['then'](function(_0x31012e){if(_0x31012e){_0x14904a=_0x31012e;_0x416e40[_0xf422('0x2c')]=_[_0xf422('0x2e')](db[_0xf422('0x4a')]['rawAttributes']);_0x416e40['query']=_['keys'](_0x7ddb3[_0xf422('0x2d')]);_0x416e40[_0xf422('0x2f')]=_[_0xf422('0x30')](_0x416e40[_0xf422('0x2c')],_0x416e40[_0xf422('0x2d')]);_0x3345dd[_0xf422('0x32')]=_[_0xf422('0x30')](_0x416e40['model'],qs['fields'](_0x7ddb3['query'][_0xf422('0x31')]));_0x3345dd['attributes']=_0x3345dd[_0xf422('0x32')][_0xf422('0x3e')]?_0x3345dd['attributes']:_0x416e40[_0xf422('0x2c')];_0x3345dd[_0xf422('0x34')]=qs[_0xf422('0x35')](_0x7ddb3['query'][_0xf422('0x35')]);_0x3345dd[_0xf422('0x36')]=qs['filters'](_[_0xf422('0x4b')](_0x7ddb3[_0xf422('0x2d')],_0x416e40[_0xf422('0x2f')]));if(_0x7ddb3[_0xf422('0x2d')][_0xf422('0x47')]){_0x3345dd[_0xf422('0x36')]=_[_0xf422('0x41')](_0x3345dd['where'],{'$or':_[_0xf422('0x29')](_0x3345dd[_0xf422('0x32')],function(_0x33c2df){var _0x503660={};_0x503660[_0x33c2df]={'$like':'%'+_0x7ddb3['query'][_0xf422('0x47')]+'%'};return _0x503660;})});}_0x3345dd=_[_0xf422('0x41')]({},_0x3345dd,_0x7ddb3[_0xf422('0x42')]);return _0x14904a[_0xf422('0x4c')](_0x3345dd);}})[_0xf422('0x25')](function(_0x3b1d2d){if(_0x3b1d2d){_0x59efc6=_0x3b1d2d['length'];if(!_0x7ddb3[_0xf422('0x2d')][_0xf422('0x48')](_0xf422('0x33'))){_0x3345dd['limit']=qs[_0xf422('0x1e')](_0x7ddb3['query']['limit']);_0x3345dd[_0xf422('0x1b')]=qs['offset'](_0x7ddb3[_0xf422('0x2d')][_0xf422('0x1b')]);}return _0x14904a[_0xf422('0x4c')](_0x3345dd);}})[_0xf422('0x25')](function(_0x185bba){if(_0x185bba){return _0x185bba?{'count':_0x59efc6,'rows':_0x185bba}:null;}})['then'](respondWithResult(_0x5ec3a5,null))[_0xf422('0x45')](handleError(_0x5ec3a5,null));};exports[_0xf422('0x4d')]=function(_0xa5c30b,_0x53d89c,_0x535814){var _0x3bc35a={};var _0x54841a={};var _0xeabbf5;var _0x5c5b61;return db[_0xf422('0x2a')][_0xf422('0x49')]({'where':{'id':_0xa5c30b['params']['id']}})[_0xf422('0x25')](handleEntityNotFound(_0x53d89c,null))[_0xf422('0x25')](function(_0x5a9b09){if(_0x5a9b09){_0xeabbf5=_0x5a9b09;_0x54841a[_0xf422('0x2c')]=_[_0xf422('0x2e')](db[_0xf422('0x4a')][_0xf422('0x3d')]);_0x54841a['query']=_[_0xf422('0x2e')](_0xa5c30b['query']);_0x54841a[_0xf422('0x2f')]=_[_0xf422('0x30')](_0x54841a[_0xf422('0x2c')],_0x54841a['query']);_0x3bc35a['attributes']=_[_0xf422('0x30')](_0x54841a[_0xf422('0x2c')],qs['fields'](_0xa5c30b[_0xf422('0x2d')]['fields']));_0x3bc35a[_0xf422('0x32')]=_0x3bc35a['attributes']['length']?_0x3bc35a[_0xf422('0x32')]:_0x54841a[_0xf422('0x2c')];_0x3bc35a[_0xf422('0x34')]=qs[_0xf422('0x35')](_0xa5c30b[_0xf422('0x2d')][_0xf422('0x35')]);_0x3bc35a[_0xf422('0x36')]=qs[_0xf422('0x2f')](_['pick'](_0xa5c30b[_0xf422('0x2d')],_0x54841a[_0xf422('0x2f')]));if(_0xa5c30b[_0xf422('0x2d')][_0xf422('0x47')]){_0x3bc35a[_0xf422('0x36')]=_['merge'](_0x3bc35a[_0xf422('0x36')],{'$or':_[_0xf422('0x29')](_0x3bc35a[_0xf422('0x32')],function(_0x365b38){var _0x282e5b={};_0x282e5b[_0x365b38]={'$like':'%'+_0xa5c30b['query'][_0xf422('0x47')]+'%'};return _0x282e5b;})});}_0x3bc35a=_['merge']({},_0x3bc35a,_0xa5c30b[_0xf422('0x42')]);return _0xeabbf5[_0xf422('0x4d')](_0x3bc35a);}})[_0xf422('0x25')](function(_0x53d7ca){if(_0x53d7ca){_0x5c5b61=_0x53d7ca[_0xf422('0x3e')];if(!_0xa5c30b[_0xf422('0x2d')][_0xf422('0x48')](_0xf422('0x33'))){_0x3bc35a['limit']=qs['limit'](_0xa5c30b['query']['limit']);_0x3bc35a[_0xf422('0x1b')]=qs[_0xf422('0x1b')](_0xa5c30b['query'][_0xf422('0x1b')]);}return _0xeabbf5[_0xf422('0x4d')](_0x3bc35a);}})[_0xf422('0x25')](function(_0x1949af){if(_0x1949af){return _0x1949af?{'count':_0x5c5b61,'rows':_0x1949af}:null;}})[_0xf422('0x25')](respondWithResult(_0x53d89c,null))[_0xf422('0x45')](handleError(_0x53d89c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index f47f395..e166c60 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 _0xd708=['define','VtigerConfiguration','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x240707,_0x1e41eb){var _0x27c15c=function(_0x2c4fa0){while(--_0x2c4fa0){_0x240707['push'](_0x240707['shift']());}};_0x27c15c(++_0x1e41eb);}(_0xd708,0x19a));var _0x8d70=function(_0x93605b,_0x28b07b){_0x93605b=_0x93605b-0x0;var _0x544d29=_0xd708[_0x93605b];return _0x544d29;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8d70('0x0'));var moment=require(_0x8d70('0x1'));var BPromise=require(_0x8d70('0x2'));var rp=require(_0x8d70('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8d70('0x4'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x8d70('0x5')]=function(_0x3ee43f,_0x44cea6){return _0x3ee43f[_0x8d70('0x6')](_0x8d70('0x7'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4fb=['request-promise','path','rimraf','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2547c3,_0x2df02f){var _0x551191=function(_0x292db4){while(--_0x292db4){_0x2547c3['push'](_0x2547c3['shift']());}};_0x551191(++_0x2df02f);}(_0xd4fb,0xca));var _0xbd4f=function(_0x2950fb,_0x474110){_0x2950fb=_0x2950fb-0x0;var _0x53c9f1=_0xd4fb[_0x2950fb];return _0x53c9f1;};'use strict';var _=require(_0xbd4f('0x0'));var util=require(_0xbd4f('0x1'));var logger=require(_0xbd4f('0x2'))(_0xbd4f('0x3'));var moment=require(_0xbd4f('0x4'));var BPromise=require(_0xbd4f('0x5'));var rp=require(_0xbd4f('0x6'));var fs=require('fs');var path=require(_0xbd4f('0x7'));var rimraf=require(_0xbd4f('0x8'));var config=require('../../config/environment');var attributes=require(_0xbd4f('0x9'));module['exports']=function(_0x44cfc1,_0xba9d02){return _0x44cfc1[_0xbd4f('0xa')](_0xbd4f('0xb'),attributes,{'tableName':_0xbd4f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 090b74d..8b4e061 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 _0xabe8=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x24e3c6,_0x8c43f1){var _0x1dd344=function(_0x4bd6a7){while(--_0x4bd6a7){_0x24e3c6['push'](_0x24e3c6['shift']());}};_0x1dd344(++_0x8c43f1);}(_0xabe8,0x12d));var _0x8abe=function(_0x544b69,_0x3d28fe){_0x544b69=_0x544b69-0x0;var _0x57c8fb=_0xabe8[_0x544b69];return _0x57c8fb;};'use strict';var _=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var moment=require('moment');var BPromise=require(_0x8abe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8abe('0x3'));var db=require(_0x8abe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8abe('0x5'))(_0x8abe('0x6'));var config=require(_0x8abe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8abe('0x8')][_0x8abe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32cecc,_0xee7c5f,_0x5a87c8){return new BPromise(function(_0x3b3b73,_0x3692b2){return client['request'](_0x32cecc,_0x5a87c8)[_0x8abe('0xa')](function(_0x426c79){logger['info'](_0x8abe('0xb'),_0xee7c5f,_0x8abe('0xc'));logger[_0x8abe('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xee7c5f,'request\x20sent',JSON[_0x8abe('0xe')](_0x426c79));if(_0x426c79[_0x8abe('0xf')]){if(_0x426c79[_0x8abe('0xf')][_0x8abe('0x10')]===0x1f4){logger[_0x8abe('0xf')](_0x8abe('0xb'),_0xee7c5f,_0x426c79[_0x8abe('0xf')][_0x8abe('0x11')]);return _0x3692b2(_0x426c79['error'][_0x8abe('0x11')]);}logger[_0x8abe('0xf')](_0x8abe('0xb'),_0xee7c5f,_0x426c79[_0x8abe('0xf')][_0x8abe('0x11')]);return _0x3b3b73(_0x426c79[_0x8abe('0xf')][_0x8abe('0x11')]);}else{logger['info'](_0x8abe('0xb'),_0xee7c5f,_0x8abe('0xc'));_0x3b3b73(_0x426c79['result'][_0x8abe('0x11')]);}})[_0x8abe('0x12')](function(_0x2f49b4){logger[_0x8abe('0xf')](_0x8abe('0xb'),_0xee7c5f,_0x2f49b4);_0x3692b2(_0x2f49b4);});});} \ No newline at end of file +var _0xe32d=['request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','VtigerConfiguration,\x20%s,\x20%s','message','result','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xe32d,0x186));var _0xde32=function(_0xabbc3e,_0x2982fa){_0xabbc3e=_0xabbc3e-0x0;var _0x5d0673=_0xe32d[_0xabbc3e];return _0x5d0673;};'use strict';var _=require('lodash');var util=require(_0xde32('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xde32('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde32('0x2'))['db'];var utils=require(_0xde32('0x3'));var logger=require('../../config/logger')(_0xde32('0x4'));var config=require(_0xde32('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xde32('0x6')][_0xde32('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3419a3,_0x22fa34,_0x2975b7){return new BPromise(function(_0x440b32,_0x527e5d){return client[_0xde32('0x8')](_0x3419a3,_0x2975b7)[_0xde32('0x9')](function(_0x3685d1){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x22fa34,_0xde32('0xa'));logger['debug'](_0xde32('0xb'),_0x22fa34,_0xde32('0xa'),JSON['stringify'](_0x3685d1));if(_0x3685d1[_0xde32('0xc')]){if(_0x3685d1[_0xde32('0xc')]['code']===0x1f4){logger[_0xde32('0xc')](_0xde32('0xd'),_0x22fa34,_0x3685d1[_0xde32('0xc')][_0xde32('0xe')]);return _0x527e5d(_0x3685d1[_0xde32('0xc')][_0xde32('0xe')]);}logger[_0xde32('0xc')](_0xde32('0xd'),_0x22fa34,_0x3685d1[_0xde32('0xc')][_0xde32('0xe')]);return _0x440b32(_0x3685d1[_0xde32('0xc')][_0xde32('0xe')]);}else{logger['info'](_0xde32('0xd'),_0x22fa34,'request\x20sent');_0x440b32(_0x3685d1[_0xde32('0xf')][_0xde32('0xe')]);}})['catch'](function(_0x2c0448){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x22fa34,_0x2c0448);_0x527e5d(_0x2c0448);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index c587dc2..5d585db 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 _0xd2a8=['update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','post','create','put','/:id'];(function(_0x24a0cd,_0x18ace3){var _0x3f51a8=function(_0x3ea9bf){while(--_0x3ea9bf){_0x24a0cd['push'](_0x24a0cd['shift']());}};_0x3f51a8(++_0x18ace3);}(_0xd2a8,0xf2));var _0x8d2a=function(_0x4374d2,_0x9133db){_0x4374d2=_0x4374d2-0x0;var _0xbd521=_0xd2a8[_0x4374d2];return _0xbd521;};'use strict';var multer=require('multer');var util=require(_0x8d2a('0x0'));var path=require('path');var timeout=require(_0x8d2a('0x1'));var express=require('express');var router=express[_0x8d2a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8d2a('0x3'));var interaction=require(_0x8d2a('0x4'));var config=require(_0x8d2a('0x5'));var controller=require(_0x8d2a('0x6'));router[_0x8d2a('0x7')]('/',auth[_0x8d2a('0x8')](),controller['index']);router[_0x8d2a('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8d2a('0x9')]('/',auth[_0x8d2a('0x8')](),controller[_0x8d2a('0xa')]);router[_0x8d2a('0xb')](_0x8d2a('0xc'),auth[_0x8d2a('0x8')](),controller[_0x8d2a('0xd')]);router[_0x8d2a('0xe')](_0x8d2a('0xc'),auth['isAuthenticated'](),controller[_0x8d2a('0xf')]);module[_0x8d2a('0x10')]=router; \ No newline at end of file +var _0x9f93=['fs-extra','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0x5154ce,_0x3275d0){var _0x5bceab=function(_0x7dd73){while(--_0x7dd73){_0x5154ce['push'](_0x5154ce['shift']());}};_0x5bceab(++_0x3275d0);}(_0x9f93,0x95));var _0x39f9=function(_0xb95ed5,_0x960508){_0xb95ed5=_0xb95ed5-0x0;var _0x48bb0d=_0x9f93[_0xb95ed5];return _0x48bb0d;};'use strict';var multer=require(_0x39f9('0x0'));var util=require(_0x39f9('0x1'));var path=require(_0x39f9('0x2'));var timeout=require(_0x39f9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x39f9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x39f9('0x5'));var config=require('../../config/environment');var controller=require(_0x39f9('0x6'));router[_0x39f9('0x7')]('/',auth[_0x39f9('0x8')](),controller[_0x39f9('0x9')]);router['get']('/:id',auth[_0x39f9('0x8')](),controller[_0x39f9('0xa')]);router['post']('/',auth[_0x39f9('0x8')](),controller[_0x39f9('0xb')]);router[_0x39f9('0xc')]('/:id',auth[_0x39f9('0x8')](),controller[_0x39f9('0xd')]);router[_0x39f9('0xe')](_0x39f9('0xf'),auth[_0x39f9('0x8')](),controller['destroy']);module[_0x39f9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e5be2ac..50ff6c2 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 _0xac4d=['variable','customVariable','STRING','sequelize','exports','ENUM','string'];(function(_0x4badd8,_0x57f369){var _0x4fb702=function(_0x4739ff){while(--_0x4739ff){_0x4badd8['push'](_0x4badd8['shift']());}};_0x4fb702(++_0x57f369);}(_0xac4d,0x13e));var _0xdac4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xac4d[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xdac4('0x0'));module[_0xdac4('0x1')]={'type':{'type':Sequelize[_0xdac4('0x2')](_0xdac4('0x3'),_0xdac4('0x4'),_0xdac4('0x5'),'keyValue','picklist'),'defaultValue':_0xdac4('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdac4('0x6')]},'keyType':{'type':Sequelize[_0xdac4('0x2')](_0xdac4('0x3'),_0xdac4('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdac4('0x6')]},'nameField':{'type':Sequelize[_0xdac4('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdac4('0x6')]}}; \ No newline at end of file +var _0x1342=['ENUM','keyValue','picklist','STRING','string','sequelize','exports'];(function(_0x4cdc78,_0x5e168b){var _0x1cbfd0=function(_0x1c3267){while(--_0x1c3267){_0x4cdc78['push'](_0x4cdc78['shift']());}};_0x1cbfd0(++_0x5e168b);}(_0x1342,0x11d));var _0x2134=function(_0x4ae39d,_0x5c3787){_0x4ae39d=_0x4ae39d-0x0;var _0x1015a7=_0x1342[_0x4ae39d];return _0x1015a7;};'use strict';var Sequelize=require(_0x2134('0x0'));module[_0x2134('0x1')]={'type':{'type':Sequelize[_0x2134('0x2')]('string','variable','customVariable',_0x2134('0x3'),_0x2134('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2134('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2134('0x2')](_0x2134('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2134('0x5')]},'idField':{'type':Sequelize[_0x2134('0x5')]},'nameField':{'type':Sequelize[_0x2134('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2134('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 6203e02..f61b900 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 _0x9e74=['merge','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','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','limit','undefined','offset','count','Content-Range','apply','save','destroy','then','error','map','rawAttributes','fieldName','type','key','name','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','options','VtigerField','includeAll','include','rows','catch','show','params'];(function(_0x3ede11,_0x544838){var _0x50bb30=function(_0x4c7bda){while(--_0x4c7bda){_0x3ede11['push'](_0x3ede11['shift']());}};_0x50bb30(++_0x544838);}(_0x9e74,0x95));var _0x49e7=function(_0x38f587,_0x790227){_0x38f587=_0x38f587-0x0;var _0x4b0b3b=_0x9e74[_0x38f587];return _0x4b0b3b;};'use strict';var emlformat=require(_0x49e7('0x0'));var rimraf=require(_0x49e7('0x1'));var zipdir=require(_0x49e7('0x2'));var jsonpatch=require(_0x49e7('0x3'));var rp=require(_0x49e7('0x4'));var moment=require(_0x49e7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x49e7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x49e7('0x7'));var csv=require(_0x49e7('0x8'));var ejs=require(_0x49e7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x49e7('0xa'));var squel=require(_0x49e7('0xb'));var crypto=require(_0x49e7('0xc'));var jsforce=require(_0x49e7('0xd'));var deskjs=require(_0x49e7('0xe'));var toCsv=require(_0x49e7('0x8'));var querystring=require('querystring');var Papa=require(_0x49e7('0xf'));var Redis=require(_0x49e7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x49e7('0x11'));var as=require(_0x49e7('0x12'));var hardwareService=require(_0x49e7('0x13'));var logger=require(_0x49e7('0x14'))(_0x49e7('0x15'));var utils=require('../../config/utils');var config=require(_0x49e7('0x16'));var licenseUtil=require(_0x49e7('0x17'));var db=require(_0x49e7('0x18'))['db'];function respondWithStatusCode(_0x54698d,_0x56e8c0){_0x56e8c0=_0x56e8c0||0xcc;return function(_0x2005b4){if(_0x2005b4){return _0x54698d[_0x49e7('0x19')](_0x56e8c0);}return _0x54698d[_0x49e7('0x1a')](_0x56e8c0)[_0x49e7('0x1b')]();};}function respondWithResult(_0x17355b,_0x47ebf0){_0x47ebf0=_0x47ebf0||0xc8;return function(_0x1db714){if(_0x1db714){return _0x17355b['status'](_0x47ebf0)[_0x49e7('0x1c')](_0x1db714);}};}function respondWithFilteredResult(_0x66336b,_0x51595b){return function(_0x2217d2){if(_0x2217d2){var _0x5a09a3=typeof _0x51595b['offset']==='undefined'&&typeof _0x51595b[_0x49e7('0x1d')]===_0x49e7('0x1e');var _0x33d11c=_0x2217d2['count'];var _0x414086=_0x5a09a3?0x0:_0x51595b[_0x49e7('0x1f')];var _0x57dda3=_0x5a09a3?_0x2217d2[_0x49e7('0x20')]:_0x51595b[_0x49e7('0x1f')]+_0x51595b[_0x49e7('0x1d')];var _0x2a3d36;if(_0x57dda3>=_0x33d11c){_0x57dda3=_0x33d11c;_0x2a3d36=0xc8;}else{_0x2a3d36=0xce;}_0x66336b['status'](_0x2a3d36);return _0x66336b['set'](_0x49e7('0x21'),_0x414086+'-'+_0x57dda3+'/'+_0x33d11c)[_0x49e7('0x1c')](_0x2217d2);}return null;};}function patchUpdates(_0x10e81f){return function(_0x2c50a8){try{jsonpatch[_0x49e7('0x22')](_0x2c50a8,_0x10e81f,!![]);}catch(_0x7d0e92){return BPromise['reject'](_0x7d0e92);}return _0x2c50a8[_0x49e7('0x23')]();};}function saveUpdates(_0x448a1b,_0x3214f4){return function(_0x4e6e65){if(_0x4e6e65){return _0x4e6e65['update'](_0x448a1b)['then'](function(_0x24a338){return _0x24a338;});}return null;};}function removeEntity(_0x3e6139,_0x56ed9a){return function(_0x38d86b){if(_0x38d86b){return _0x38d86b[_0x49e7('0x24')]()[_0x49e7('0x25')](function(){_0x3e6139[_0x49e7('0x1a')](0xcc)[_0x49e7('0x1b')]();});}};}function handleEntityNotFound(_0x32c399,_0x25e91a){return function(_0x3175a2){if(!_0x3175a2){_0x32c399[_0x49e7('0x19')](0x194);}return _0x3175a2;};}function handleError(_0x39b4e1,_0x516370){_0x516370=_0x516370||0x1f4;return function(_0x382705){logger[_0x49e7('0x26')](_0x382705['stack']);if(_0x382705['name']){delete _0x382705['name'];}_0x39b4e1['status'](_0x516370)['send'](_0x382705);};}exports['index']=function(_0x2749ed,_0x498ba3){var _0x1bf85e={},_0x58ee75={},_0x4d2469={'count':0x0,'rows':[]};var _0x3e90f8=_[_0x49e7('0x27')](db['VtigerField'][_0x49e7('0x28')],function(_0x33a89d){return{'name':_0x33a89d[_0x49e7('0x29')],'type':_0x33a89d[_0x49e7('0x2a')][_0x49e7('0x2b')]};});_0x58ee75['model']=_[_0x49e7('0x27')](_0x3e90f8,_0x49e7('0x2c'));_0x58ee75[_0x49e7('0x2d')]=_[_0x49e7('0x2e')](_0x2749ed['query']);_0x58ee75[_0x49e7('0x2f')]=_['intersection'](_0x58ee75[_0x49e7('0x30')],_0x58ee75[_0x49e7('0x2d')]);_0x1bf85e['attributes']=_[_0x49e7('0x31')](_0x58ee75[_0x49e7('0x30')],qs['fields'](_0x2749ed[_0x49e7('0x2d')][_0x49e7('0x32')]));_0x1bf85e[_0x49e7('0x33')]=_0x1bf85e[_0x49e7('0x33')][_0x49e7('0x34')]?_0x1bf85e['attributes']:_0x58ee75[_0x49e7('0x30')];if(!_0x2749ed[_0x49e7('0x2d')][_0x49e7('0x35')](_0x49e7('0x36'))){_0x1bf85e['limit']=qs['limit'](_0x2749ed[_0x49e7('0x2d')]['limit']);_0x1bf85e['offset']=qs[_0x49e7('0x1f')](_0x2749ed[_0x49e7('0x2d')][_0x49e7('0x1f')]);}_0x1bf85e[_0x49e7('0x37')]=qs['sort'](_0x2749ed[_0x49e7('0x2d')]['sort']);_0x1bf85e[_0x49e7('0x38')]=qs[_0x49e7('0x2f')](_[_0x49e7('0x39')](_0x2749ed[_0x49e7('0x2d')],_0x58ee75[_0x49e7('0x2f')]),_0x3e90f8);if(_0x2749ed[_0x49e7('0x2d')][_0x49e7('0x3a')]){_0x1bf85e['where']=_['merge'](_0x1bf85e[_0x49e7('0x38')],{'$or':_[_0x49e7('0x27')](_0x3e90f8,function(_0x3bd693){if(_0x3bd693[_0x49e7('0x2a')]!=='VIRTUAL'){var _0x1da0a5={};_0x1da0a5[_0x3bd693[_0x49e7('0x2c')]]={'$like':'%'+_0x2749ed[_0x49e7('0x2d')]['filter']+'%'};return _0x1da0a5;}})});}_0x1bf85e=_['merge']({},_0x1bf85e,_0x2749ed[_0x49e7('0x3b')]);var _0x5c7d63={'where':_0x1bf85e[_0x49e7('0x38')]};return db[_0x49e7('0x3c')][_0x49e7('0x20')](_0x5c7d63)[_0x49e7('0x25')](function(_0x43de27){_0x4d2469['count']=_0x43de27;if(_0x2749ed[_0x49e7('0x2d')][_0x49e7('0x3d')]){_0x1bf85e[_0x49e7('0x3e')]=[{'all':!![]}];}return db[_0x49e7('0x3c')]['findAll'](_0x1bf85e);})[_0x49e7('0x25')](function(_0x82f778){_0x4d2469[_0x49e7('0x3f')]=_0x82f778;return _0x4d2469;})[_0x49e7('0x25')](respondWithFilteredResult(_0x498ba3,_0x1bf85e))[_0x49e7('0x40')](handleError(_0x498ba3,null));};exports[_0x49e7('0x41')]=function(_0x33a1fb,_0x1371cd){var _0x16e052={'raw':!![],'where':{'id':_0x33a1fb[_0x49e7('0x42')]['id']}},_0xba1971={};_0xba1971[_0x49e7('0x30')]=_[_0x49e7('0x2e')](db[_0x49e7('0x3c')]['rawAttributes']);_0xba1971[_0x49e7('0x2d')]=_[_0x49e7('0x2e')](_0x33a1fb[_0x49e7('0x2d')]);_0xba1971[_0x49e7('0x2f')]=_[_0x49e7('0x31')](_0xba1971[_0x49e7('0x30')],_0xba1971[_0x49e7('0x2d')]);_0x16e052['attributes']=_[_0x49e7('0x31')](_0xba1971['model'],qs[_0x49e7('0x32')](_0x33a1fb[_0x49e7('0x2d')][_0x49e7('0x32')]));_0x16e052[_0x49e7('0x33')]=_0x16e052[_0x49e7('0x33')][_0x49e7('0x34')]?_0x16e052[_0x49e7('0x33')]:_0xba1971[_0x49e7('0x30')];if(_0x33a1fb[_0x49e7('0x2d')][_0x49e7('0x3d')]){_0x16e052[_0x49e7('0x3e')]=[{'all':!![]}];}_0x16e052=_[_0x49e7('0x43')]({},_0x16e052,_0x33a1fb[_0x49e7('0x3b')]);return db[_0x49e7('0x3c')]['find'](_0x16e052)['then'](handleEntityNotFound(_0x1371cd,null))[_0x49e7('0x25')](respondWithResult(_0x1371cd,null))[_0x49e7('0x40')](handleError(_0x1371cd,null));};exports[_0x49e7('0x44')]=function(_0x2d019c,_0x5cab79){return db[_0x49e7('0x3c')]['create'](_0x2d019c[_0x49e7('0x45')],{})['then'](respondWithResult(_0x5cab79,0xc9))[_0x49e7('0x40')](handleError(_0x5cab79,null));};exports[_0x49e7('0x46')]=function(_0xd6bfe,_0x54303b){if(_0xd6bfe[_0x49e7('0x45')]['id']){delete _0xd6bfe[_0x49e7('0x45')]['id'];}return db[_0x49e7('0x3c')][_0x49e7('0x47')]({'where':{'id':_0xd6bfe[_0x49e7('0x42')]['id']}})[_0x49e7('0x25')](handleEntityNotFound(_0x54303b,null))['then'](saveUpdates(_0xd6bfe['body'],null))['then'](respondWithResult(_0x54303b,null))[_0x49e7('0x40')](handleError(_0x54303b,null));};exports[_0x49e7('0x24')]=function(_0x4520e1,_0x4a3ee4){return db[_0x49e7('0x3c')][_0x49e7('0x47')]({'where':{'id':_0x4520e1['params']['id']}})['then'](handleEntityNotFound(_0x4a3ee4,null))[_0x49e7('0x25')](removeEntity(_0x4a3ee4,null))[_0x49e7('0x40')](handleError(_0x4a3ee4,null));}; \ No newline at end of file +var _0xfb2b=['limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xbaf87a,_0x4982ef){var _0x166be4=function(_0x21d1fc){while(--_0x21d1fc){_0xbaf87a['push'](_0xbaf87a['shift']());}};_0x166be4(++_0x4982ef);}(_0xfb2b,0x154));var _0xbfb2=function(_0x5ae070,_0x23c722){_0x5ae070=_0x5ae070-0x0;var _0x29d88a=_0xfb2b[_0x5ae070];return _0x29d88a;};'use strict';var emlformat=require(_0xbfb2('0x0'));var rimraf=require(_0xbfb2('0x1'));var zipdir=require(_0xbfb2('0x2'));var jsonpatch=require(_0xbfb2('0x3'));var rp=require('request-promise');var moment=require(_0xbfb2('0x4'));var BPromise=require(_0xbfb2('0x5'));var Mustache=require(_0xbfb2('0x6'));var util=require('util');var path=require(_0xbfb2('0x7'));var sox=require('sox');var csv=require(_0xbfb2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfb2('0x9'));var _=require(_0xbfb2('0xa'));var squel=require(_0xbfb2('0xb'));var crypto=require(_0xbfb2('0xc'));var jsforce=require(_0xbfb2('0xd'));var deskjs=require(_0xbfb2('0xe'));var toCsv=require(_0xbfb2('0x8'));var querystring=require(_0xbfb2('0xf'));var Papa=require(_0xbfb2('0x10'));var Redis=require(_0xbfb2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfb2('0x12'));var as=require(_0xbfb2('0x13'));var hardwareService=require(_0xbfb2('0x14'));var logger=require('../../config/logger')(_0xbfb2('0x15'));var utils=require(_0xbfb2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbfb2('0x17'))['db'];function respondWithStatusCode(_0xdc1e85,_0x2800ed){_0x2800ed=_0x2800ed||0xcc;return function(_0x42a7d0){if(_0x42a7d0){return _0xdc1e85[_0xbfb2('0x18')](_0x2800ed);}return _0xdc1e85[_0xbfb2('0x19')](_0x2800ed)[_0xbfb2('0x1a')]();};}function respondWithResult(_0x46cbad,_0x17ac8f){_0x17ac8f=_0x17ac8f||0xc8;return function(_0x261695){if(_0x261695){return _0x46cbad['status'](_0x17ac8f)[_0xbfb2('0x1b')](_0x261695);}};}function respondWithFilteredResult(_0x218ce9,_0x51c8ce){return function(_0x3c0bd4){if(_0x3c0bd4){var _0x4441b8=typeof _0x51c8ce[_0xbfb2('0x1c')]===_0xbfb2('0x1d')&&typeof _0x51c8ce[_0xbfb2('0x1e')]===_0xbfb2('0x1d');var _0x37e022=_0x3c0bd4[_0xbfb2('0x1f')];var _0x57a01a=_0x4441b8?0x0:_0x51c8ce[_0xbfb2('0x1c')];var _0x1b45f0=_0x4441b8?_0x3c0bd4['count']:_0x51c8ce[_0xbfb2('0x1c')]+_0x51c8ce['limit'];var _0x47a99c;if(_0x1b45f0>=_0x37e022){_0x1b45f0=_0x37e022;_0x47a99c=0xc8;}else{_0x47a99c=0xce;}_0x218ce9[_0xbfb2('0x19')](_0x47a99c);return _0x218ce9['set'](_0xbfb2('0x20'),_0x57a01a+'-'+_0x1b45f0+'/'+_0x37e022)[_0xbfb2('0x1b')](_0x3c0bd4);}return null;};}function patchUpdates(_0x19624f){return function(_0x39e6aa){try{jsonpatch[_0xbfb2('0x21')](_0x39e6aa,_0x19624f,!![]);}catch(_0x325168){return BPromise['reject'](_0x325168);}return _0x39e6aa[_0xbfb2('0x22')]();};}function saveUpdates(_0x23c93c,_0x32a979){return function(_0x45fe5d){if(_0x45fe5d){return _0x45fe5d[_0xbfb2('0x23')](_0x23c93c)['then'](function(_0x6027be){return _0x6027be;});}return null;};}function removeEntity(_0x4745f8,_0x380183){return function(_0x74a8f5){if(_0x74a8f5){return _0x74a8f5[_0xbfb2('0x24')]()[_0xbfb2('0x25')](function(){_0x4745f8[_0xbfb2('0x19')](0xcc)[_0xbfb2('0x1a')]();});}};}function handleEntityNotFound(_0x5a2ec9,_0x4bf02e){return function(_0x3d8094){if(!_0x3d8094){_0x5a2ec9['sendStatus'](0x194);}return _0x3d8094;};}function handleError(_0x410091,_0x1f4cdb){_0x1f4cdb=_0x1f4cdb||0x1f4;return function(_0x528ca2){logger[_0xbfb2('0x26')](_0x528ca2[_0xbfb2('0x27')]);if(_0x528ca2[_0xbfb2('0x28')]){delete _0x528ca2['name'];}_0x410091[_0xbfb2('0x19')](_0x1f4cdb)[_0xbfb2('0x29')](_0x528ca2);};}exports[_0xbfb2('0x2a')]=function(_0x23de3a,_0x587d7e){var _0x760541={},_0x4f9fe8={},_0x45e405={'count':0x0,'rows':[]};var _0x1d6792=_[_0xbfb2('0x2b')](db[_0xbfb2('0x2c')][_0xbfb2('0x2d')],function(_0x5a26fc){return{'name':_0x5a26fc[_0xbfb2('0x2e')],'type':_0x5a26fc['type'][_0xbfb2('0x2f')]};});_0x4f9fe8[_0xbfb2('0x30')]=_[_0xbfb2('0x2b')](_0x1d6792,_0xbfb2('0x28'));_0x4f9fe8[_0xbfb2('0x31')]=_[_0xbfb2('0x32')](_0x23de3a['query']);_0x4f9fe8['filters']=_[_0xbfb2('0x33')](_0x4f9fe8[_0xbfb2('0x30')],_0x4f9fe8[_0xbfb2('0x31')]);_0x760541['attributes']=_[_0xbfb2('0x33')](_0x4f9fe8[_0xbfb2('0x30')],qs['fields'](_0x23de3a['query'][_0xbfb2('0x34')]));_0x760541[_0xbfb2('0x35')]=_0x760541[_0xbfb2('0x35')]['length']?_0x760541[_0xbfb2('0x35')]:_0x4f9fe8[_0xbfb2('0x30')];if(!_0x23de3a['query'][_0xbfb2('0x36')](_0xbfb2('0x37'))){_0x760541[_0xbfb2('0x1e')]=qs[_0xbfb2('0x1e')](_0x23de3a[_0xbfb2('0x31')]['limit']);_0x760541[_0xbfb2('0x1c')]=qs[_0xbfb2('0x1c')](_0x23de3a[_0xbfb2('0x31')][_0xbfb2('0x1c')]);}_0x760541[_0xbfb2('0x38')]=qs[_0xbfb2('0x39')](_0x23de3a[_0xbfb2('0x31')][_0xbfb2('0x39')]);_0x760541[_0xbfb2('0x3a')]=qs[_0xbfb2('0x3b')](_[_0xbfb2('0x3c')](_0x23de3a[_0xbfb2('0x31')],_0x4f9fe8[_0xbfb2('0x3b')]),_0x1d6792);if(_0x23de3a[_0xbfb2('0x31')][_0xbfb2('0x3d')]){_0x760541[_0xbfb2('0x3a')]=_[_0xbfb2('0x3e')](_0x760541[_0xbfb2('0x3a')],{'$or':_[_0xbfb2('0x2b')](_0x1d6792,function(_0x51e20f){if(_0x51e20f['type']!=='VIRTUAL'){var _0x36f384={};_0x36f384[_0x51e20f['name']]={'$like':'%'+_0x23de3a[_0xbfb2('0x31')][_0xbfb2('0x3d')]+'%'};return _0x36f384;}})});}_0x760541=_[_0xbfb2('0x3e')]({},_0x760541,_0x23de3a[_0xbfb2('0x3f')]);var _0x1b4e92={'where':_0x760541[_0xbfb2('0x3a')]};return db['VtigerField'][_0xbfb2('0x1f')](_0x1b4e92)[_0xbfb2('0x25')](function(_0x1dfc8e){_0x45e405[_0xbfb2('0x1f')]=_0x1dfc8e;if(_0x23de3a[_0xbfb2('0x31')][_0xbfb2('0x40')]){_0x760541[_0xbfb2('0x41')]=[{'all':!![]}];}return db[_0xbfb2('0x2c')]['findAll'](_0x760541);})[_0xbfb2('0x25')](function(_0x4c2339){_0x45e405[_0xbfb2('0x42')]=_0x4c2339;return _0x45e405;})[_0xbfb2('0x25')](respondWithFilteredResult(_0x587d7e,_0x760541))['catch'](handleError(_0x587d7e,null));};exports[_0xbfb2('0x43')]=function(_0x5371e3,_0x358dd7){var _0x34ee7c={'raw':!![],'where':{'id':_0x5371e3[_0xbfb2('0x44')]['id']}},_0x29bbd5={};_0x29bbd5[_0xbfb2('0x30')]=_['keys'](db[_0xbfb2('0x2c')]['rawAttributes']);_0x29bbd5[_0xbfb2('0x31')]=_[_0xbfb2('0x32')](_0x5371e3[_0xbfb2('0x31')]);_0x29bbd5[_0xbfb2('0x3b')]=_[_0xbfb2('0x33')](_0x29bbd5[_0xbfb2('0x30')],_0x29bbd5[_0xbfb2('0x31')]);_0x34ee7c['attributes']=_[_0xbfb2('0x33')](_0x29bbd5[_0xbfb2('0x30')],qs['fields'](_0x5371e3[_0xbfb2('0x31')][_0xbfb2('0x34')]));_0x34ee7c[_0xbfb2('0x35')]=_0x34ee7c[_0xbfb2('0x35')][_0xbfb2('0x45')]?_0x34ee7c[_0xbfb2('0x35')]:_0x29bbd5[_0xbfb2('0x30')];if(_0x5371e3[_0xbfb2('0x31')]['includeAll']){_0x34ee7c['include']=[{'all':!![]}];}_0x34ee7c=_[_0xbfb2('0x3e')]({},_0x34ee7c,_0x5371e3['options']);return db[_0xbfb2('0x2c')][_0xbfb2('0x46')](_0x34ee7c)[_0xbfb2('0x25')](handleEntityNotFound(_0x358dd7,null))['then'](respondWithResult(_0x358dd7,null))[_0xbfb2('0x47')](handleError(_0x358dd7,null));};exports[_0xbfb2('0x48')]=function(_0x23f7ea,_0x54069f){return db[_0xbfb2('0x2c')][_0xbfb2('0x48')](_0x23f7ea[_0xbfb2('0x49')],{})[_0xbfb2('0x25')](respondWithResult(_0x54069f,0xc9))[_0xbfb2('0x47')](handleError(_0x54069f,null));};exports['update']=function(_0x30a1d7,_0x3595dd){if(_0x30a1d7[_0xbfb2('0x49')]['id']){delete _0x30a1d7[_0xbfb2('0x49')]['id'];}return db['VtigerField'][_0xbfb2('0x46')]({'where':{'id':_0x30a1d7[_0xbfb2('0x44')]['id']}})[_0xbfb2('0x25')](handleEntityNotFound(_0x3595dd,null))[_0xbfb2('0x25')](saveUpdates(_0x30a1d7[_0xbfb2('0x49')],null))[_0xbfb2('0x25')](respondWithResult(_0x3595dd,null))['catch'](handleError(_0x3595dd,null));};exports[_0xbfb2('0x24')]=function(_0x754726,_0x3f663a){return db[_0xbfb2('0x2c')][_0xbfb2('0x46')]({'where':{'id':_0x754726[_0xbfb2('0x44')]['id']}})[_0xbfb2('0x25')](handleEntityNotFound(_0x3f663a,null))[_0xbfb2('0x25')](removeEntity(_0x3f663a,null))[_0xbfb2('0x47')](handleError(_0x3f663a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index dbcdbca..e2980f9 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 _0xe397=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x447a39,_0x3c007f){var _0x2254df=function(_0x1fe91e){while(--_0x1fe91e){_0x447a39['push'](_0x447a39['shift']());}};_0x2254df(++_0x3c007f);}(_0xe397,0xec));var _0x7e39=function(_0x4f7e4b,_0x5bbdb2){_0x4f7e4b=_0x4f7e4b-0x0;var _0x55a507=_0xe397[_0x4f7e4b];return _0x55a507;};'use strict';var _=require(_0x7e39('0x0'));var util=require(_0x7e39('0x1'));var logger=require(_0x7e39('0x2'))(_0x7e39('0x3'));var moment=require(_0x7e39('0x4'));var BPromise=require(_0x7e39('0x5'));var rp=require(_0x7e39('0x6'));var fs=require('fs');var path=require(_0x7e39('0x7'));var rimraf=require(_0x7e39('0x8'));var config=require(_0x7e39('0x9'));var attributes=require(_0x7e39('0xa'));module[_0x7e39('0xb')]=function(_0x5d5610,_0x3cdbb3){return _0x5d5610['define'](_0x7e39('0xc'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7e39('0xd'),'fields':[_0x7e39('0xe'),_0x7e39('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8689=['./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x3bbb2c,_0x184320){var _0x59211d=function(_0x2eb2f5){while(--_0x2eb2f5){_0x3bbb2c['push'](_0x3bbb2c['shift']());}};_0x59211d(++_0x184320);}(_0x8689,0x143));var _0x9868=function(_0x307f62,_0x59bc89){_0x307f62=_0x307f62-0x0;var _0x547caf=_0x8689[_0x307f62];return _0x547caf;};'use strict';var _=require(_0x9868('0x0'));var util=require(_0x9868('0x1'));var logger=require(_0x9868('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9868('0x3'));var fs=require('fs');var path=require(_0x9868('0x4'));var rimraf=require(_0x9868('0x5'));var config=require(_0x9868('0x6'));var attributes=require(_0x9868('0x7'));module[_0x9868('0x8')]=function(_0x1256b7,_0xba4be5){return _0x1256b7[_0x9868('0x9')](_0x9868('0xa'),attributes,{'tableName':_0x9868('0xb'),'paranoid':![],'indexes':[{'name':_0x9868('0xc'),'fields':[_0x9868('0xd'),_0x9868('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 5d90c5a..74f1b94 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 _0x03db=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0xf68524,_0x25aae9){var _0x25b3d8=function(_0x4abf9d){while(--_0x4abf9d){_0xf68524['push'](_0xf68524['shift']());}};_0x25b3d8(++_0x25aae9);}(_0x03db,0x6a));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb03d('0x0'));var util=require('util');var moment=require(_0xb03d('0x1'));var BPromise=require('bluebird');var rs=require(_0xb03d('0x2'));var fs=require('fs');var Redis=require(_0xb03d('0x3'));var db=require(_0xb03d('0x4'))['db'];var utils=require(_0xb03d('0x5'));var logger=require(_0xb03d('0x6'))(_0xb03d('0x7'));var config=require(_0xb03d('0x8'));var jayson=require(_0xb03d('0x9'));var client=jayson[_0xb03d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a40f3,_0x638aa,_0x4be062){return new BPromise(function(_0x19ce97,_0x3b43df){return client['request'](_0x3a40f3,_0x4be062)[_0xb03d('0xb')](function(_0x2382f7){logger[_0xb03d('0xc')](_0xb03d('0xd'),_0x638aa,_0xb03d('0xe'));logger[_0xb03d('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x638aa,_0xb03d('0xe'),JSON['stringify'](_0x2382f7));if(_0x2382f7[_0xb03d('0x10')]){if(_0x2382f7[_0xb03d('0x10')][_0xb03d('0x11')]===0x1f4){logger['error'](_0xb03d('0xd'),_0x638aa,_0x2382f7[_0xb03d('0x10')][_0xb03d('0x12')]);return _0x3b43df(_0x2382f7[_0xb03d('0x10')][_0xb03d('0x12')]);}logger[_0xb03d('0x10')](_0xb03d('0xd'),_0x638aa,_0x2382f7[_0xb03d('0x10')]['message']);return _0x19ce97(_0x2382f7['error'][_0xb03d('0x12')]);}else{logger[_0xb03d('0xc')](_0xb03d('0xd'),_0x638aa,_0xb03d('0xe'));_0x19ce97(_0x2382f7[_0xb03d('0x13')][_0xb03d('0x12')]);}})[_0xb03d('0x14')](function(_0x24c828){logger[_0xb03d('0x10')](_0xb03d('0xd'),_0x638aa,_0x24c828);_0x3b43df(_0x24c828);});});} \ No newline at end of file +var _0xdd3f=['debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x5c5502,_0x47cf47){var _0x359546=function(_0x5b0561){while(--_0x5b0561){_0x5c5502['push'](_0x5c5502['shift']());}};_0x359546(++_0x47cf47);}(_0xdd3f,0xdf));var _0xfdd3=function(_0x156972,_0x5e6bc9){_0x156972=_0x156972-0x0;var _0x5e6b56=_0xdd3f[_0x156972];return _0x5e6b56;};'use strict';var _=require(_0xfdd3('0x0'));var util=require(_0xfdd3('0x1'));var moment=require(_0xfdd3('0x2'));var BPromise=require(_0xfdd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfdd3('0x4'));var db=require(_0xfdd3('0x5'))['db'];var utils=require(_0xfdd3('0x6'));var logger=require(_0xfdd3('0x7'))(_0xfdd3('0x8'));var config=require(_0xfdd3('0x9'));var jayson=require(_0xfdd3('0xa'));var client=jayson[_0xfdd3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dba59,_0x1c4b1b,_0x4e8ca6){return new BPromise(function(_0x3ed2d8,_0x332d6a){return client[_0xfdd3('0xc')](_0x4dba59,_0x4e8ca6)[_0xfdd3('0xd')](function(_0x544eb5){logger[_0xfdd3('0xe')](_0xfdd3('0xf'),_0x1c4b1b,_0xfdd3('0x10'));logger[_0xfdd3('0x11')](_0xfdd3('0x12'),_0x1c4b1b,'request\x20sent',JSON['stringify'](_0x544eb5));if(_0x544eb5[_0xfdd3('0x13')]){if(_0x544eb5['error'][_0xfdd3('0x14')]===0x1f4){logger[_0xfdd3('0x13')](_0xfdd3('0xf'),_0x1c4b1b,_0x544eb5[_0xfdd3('0x13')][_0xfdd3('0x15')]);return _0x332d6a(_0x544eb5[_0xfdd3('0x13')]['message']);}logger[_0xfdd3('0x13')]('VtigerField,\x20%s,\x20%s',_0x1c4b1b,_0x544eb5[_0xfdd3('0x13')]['message']);return _0x3ed2d8(_0x544eb5[_0xfdd3('0x13')]['message']);}else{logger['info'](_0xfdd3('0xf'),_0x1c4b1b,_0xfdd3('0x10'));_0x3ed2d8(_0x544eb5[_0xfdd3('0x16')][_0xfdd3('0x15')]);}})[_0xfdd3('0x17')](function(_0x32bcce){logger['error']('VtigerField,\x20%s,\x20%s',_0x1c4b1b,_0x32bcce);_0x332d6a(_0x32bcce);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index e593267..b9c91b1 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 _0x2bb6=['post','addConfiguration','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2bb6,0x146));var _0x62bb=function(_0x43148e,_0xa81910){_0x43148e=_0x43148e-0x0;var _0x4880a7=_0x2bb6[_0x43148e];return _0x4880a7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x62bb('0x0'));var timeout=require('connect-timeout');var express=require(_0x62bb('0x1'));var router=express[_0x62bb('0x2')]();var fs_extra=require(_0x62bb('0x3'));var auth=require(_0x62bb('0x4'));var interaction=require(_0x62bb('0x5'));var config=require(_0x62bb('0x6'));var controller=require(_0x62bb('0x7'));router[_0x62bb('0x8')]('/',auth['isAuthenticated'](),controller[_0x62bb('0x9')]);router['get'](_0x62bb('0xa'),auth[_0x62bb('0xb')](),controller[_0x62bb('0xc')]);router[_0x62bb('0x8')]('/:id/configurations',auth[_0x62bb('0xb')](),controller[_0x62bb('0xd')]);router['get'](_0x62bb('0xe'),auth[_0x62bb('0xb')](),controller[_0x62bb('0xf')]);router[_0x62bb('0x10')]('/',auth[_0x62bb('0xb')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x62bb('0x11')]);router[_0x62bb('0x12')](_0x62bb('0xa'),auth[_0x62bb('0xb')](),controller['update']);router['delete'](_0x62bb('0xa'),auth[_0x62bb('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5965=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5965,0x8d));var _0x5596=function(_0x57da49,_0x4c705b){_0x57da49=_0x57da49-0x0;var _0x3c5fef=_0x5965[_0x57da49];return _0x3c5fef;};'use strict';var multer=require(_0x5596('0x0'));var util=require('util');var path=require(_0x5596('0x1'));var timeout=require(_0x5596('0x2'));var express=require(_0x5596('0x3'));var router=express[_0x5596('0x4')]();var fs_extra=require(_0x5596('0x5'));var auth=require(_0x5596('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5596('0x7'));var controller=require(_0x5596('0x8'));router[_0x5596('0x9')]('/',auth[_0x5596('0xa')](),controller['index']);router[_0x5596('0x9')]('/:id',auth[_0x5596('0xa')](),controller['show']);router[_0x5596('0x9')](_0x5596('0xb'),auth[_0x5596('0xa')](),controller[_0x5596('0xc')]);router['get'](_0x5596('0xd'),auth[_0x5596('0xa')](),controller[_0x5596('0xe')]);router[_0x5596('0xf')]('/',auth[_0x5596('0xa')](),controller[_0x5596('0x10')]);router['post'](_0x5596('0xb'),auth[_0x5596('0xa')](),controller[_0x5596('0x11')]);router[_0x5596('0x12')]('/:id',auth[_0x5596('0xa')](),controller[_0x5596('0x13')]);router[_0x5596('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5596('0x15')]);module[_0x5596('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8cc0292..361492b 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 _0xf963=['ENUM','token','integrationTab','sequelize','STRING','remoteUri'];(function(_0x13209e,_0x332964){var _0x3c8be0=function(_0x60bdb8){while(--_0x60bdb8){_0x13209e['push'](_0x13209e['shift']());}};_0x3c8be0(++_0x332964);}(_0xf963,0x11d));var _0x3f96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf963[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3f96('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f96('0x1')]},'username':{'type':Sequelize[_0x3f96('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x3f96('0x1')]},'remoteUri':{'type':Sequelize[_0x3f96('0x1')],'unique':_0x3f96('0x2')},'authType':{'type':Sequelize[_0x3f96('0x3')]('password',_0x3f96('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x3f96('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3f96('0x3')](_0x3f96('0x5'),'newTab'),'defaultValue':_0x3f96('0x5')}}; \ No newline at end of file +var _0x5bc1=['remoteUri','ENUM','password','integrationTab','newTab','exports','STRING','username'];(function(_0x581543,_0x5d08cf){var _0x2845f5=function(_0x59aec4){while(--_0x59aec4){_0x581543['push'](_0x581543['shift']());}};_0x2845f5(++_0x5d08cf);}(_0x5bc1,0xb5));var _0x15bc=function(_0x4ae506,_0x5a97ed){_0x4ae506=_0x4ae506-0x0;var _0x18e3a1=_0x5bc1[_0x4ae506];return _0x18e3a1;};'use strict';var Sequelize=require('sequelize');module[_0x15bc('0x0')]={'name':{'type':Sequelize[_0x15bc('0x1')]},'description':{'type':Sequelize[_0x15bc('0x1')]},'username':{'type':Sequelize[_0x15bc('0x1')],'unique':_0x15bc('0x2')},'password':{'type':Sequelize[_0x15bc('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x15bc('0x3')},'authType':{'type':Sequelize[_0x15bc('0x4')](_0x15bc('0x5'),'token'),'defaultValue':_0x15bc('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x15bc('0x4')](_0x15bc('0x6'),_0x15bc('0x7')),'defaultValue':_0x15bc('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 3b5056d..3ce50a4 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 _0xb58b=['headers','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','findOne','token','authType','remoteUri','substring','GET','format','%s/%s','password'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xb58b,0x1f1));var _0xbb58=function(_0xf6f061,_0x4b39e7){_0xf6f061=_0xf6f061-0x0;var _0x44eb07=_0xb58b[_0xf6f061];return _0x44eb07;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbb58('0x18'));function respondWithStatusCode(_0x18810f,_0x4cda21){_0x4cda21=_0x4cda21||0xcc;return function(_0x132511){if(_0x132511){return _0x18810f[_0xbb58('0x19')](_0x4cda21);}return _0x18810f[_0xbb58('0x1a')](_0x4cda21)[_0xbb58('0x1b')]();};}function respondWithResult(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xc8;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1a')](_0x58245f)['json'](_0x110944);}};}function respondWithFilteredResult(_0x4ba30e,_0x33c20f){return function(_0x445b1f){if(_0x445b1f){var _0x38d69a=typeof _0x33c20f['offset']==='undefined'&&typeof _0x33c20f['limit']==='undefined';var _0x28637b=_0x445b1f[_0xbb58('0x1c')];var _0x48f3e0=_0x38d69a?0x0:_0x33c20f[_0xbb58('0x1d')];var _0x497653=_0x38d69a?_0x445b1f[_0xbb58('0x1c')]:_0x33c20f[_0xbb58('0x1d')]+_0x33c20f[_0xbb58('0x1e')];var _0xb8f982;if(_0x497653>=_0x28637b){_0x497653=_0x28637b;_0xb8f982=0xc8;}else{_0xb8f982=0xce;}_0x4ba30e[_0xbb58('0x1a')](_0xb8f982);return _0x4ba30e[_0xbb58('0x1f')](_0xbb58('0x20'),_0x48f3e0+'-'+_0x497653+'/'+_0x28637b)['json'](_0x445b1f);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x21')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x22')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x23')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x24')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x25')]()[_0xbb58('0x24')](function(){_0x21964d[_0xbb58('0x1a')](0xcc)[_0xbb58('0x1b')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x19')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x26')](_0x8e9ed9[_0xbb58('0x27')]);if(_0x8e9ed9[_0xbb58('0x28')]){delete _0x8e9ed9[_0xbb58('0x28')];}_0x1be0ae[_0xbb58('0x1a')](_0x129094)[_0xbb58('0x29')](_0x8e9ed9);};}exports[_0xbb58('0x2a')]=function(_0x2a0481,_0x4157c4){var _0x3559b6={},_0x573cca={},_0x2b0f73={'count':0x0,'rows':[]};var _0xe46bc1=_[_0xbb58('0x2b')](db[_0xbb58('0x2c')][_0xbb58('0x2d')],function(_0x9d379f){return{'name':_0x9d379f[_0xbb58('0x2e')],'type':_0x9d379f[_0xbb58('0x2f')][_0xbb58('0x30')]};});_0x573cca['model']=_[_0xbb58('0x2b')](_0xe46bc1,_0xbb58('0x28'));_0x573cca[_0xbb58('0x31')]=_[_0xbb58('0x32')](_0x2a0481[_0xbb58('0x31')]);_0x573cca[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],_0x573cca[_0xbb58('0x31')]);_0x3559b6[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x2a0481['query']['fields']));_0x3559b6['attributes']=_0x3559b6[_0xbb58('0x36')][_0xbb58('0x38')]?_0x3559b6[_0xbb58('0x36')]:_0x573cca[_0xbb58('0x35')];if(!_0x2a0481[_0xbb58('0x31')][_0xbb58('0x39')](_0xbb58('0x3a'))){_0x3559b6[_0xbb58('0x1e')]=qs['limit'](_0x2a0481[_0xbb58('0x31')][_0xbb58('0x1e')]);_0x3559b6['offset']=qs[_0xbb58('0x1d')](_0x2a0481['query'][_0xbb58('0x1d')]);}_0x3559b6['order']=qs[_0xbb58('0x3b')](_0x2a0481[_0xbb58('0x31')]['sort']);_0x3559b6[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x2a0481[_0xbb58('0x31')],_0x573cca[_0xbb58('0x33')]),_0xe46bc1);if(_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]){_0x3559b6[_0xbb58('0x3c')]=_['merge'](_0x3559b6[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0xe46bc1,function(_0x2da5ff){if(_0x2da5ff['type']!=='VIRTUAL'){var _0x133d56={};_0x133d56[_0x2da5ff['name']]={'$like':'%'+_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x133d56;}})});}_0x3559b6=_[_0xbb58('0x3f')]({},_0x3559b6,_0x2a0481['options']);var _0x485830={'where':_0x3559b6[_0xbb58('0x3c')]};return db[_0xbb58('0x2c')][_0xbb58('0x1c')](_0x485830)[_0xbb58('0x24')](function(_0x34a745){_0x2b0f73[_0xbb58('0x1c')]=_0x34a745;if(_0x2a0481['query'][_0xbb58('0x40')]){_0x3559b6[_0xbb58('0x41')]=[{'all':!![]}];}return db[_0xbb58('0x2c')][_0xbb58('0x42')](_0x3559b6);})[_0xbb58('0x24')](function(_0x301e15){_0x2b0f73['rows']=_0x301e15;return _0x2b0f73;})[_0xbb58('0x24')](respondWithFilteredResult(_0x4157c4,_0x3559b6))['catch'](handleError(_0x4157c4,null));};exports[_0xbb58('0x43')]=function(_0x285ad4,_0x29fb1c){var _0x45817f={'raw':![],'where':{'id':_0x285ad4[_0xbb58('0x44')]['id']}},_0x54099f={};_0x54099f[_0xbb58('0x35')]=_[_0xbb58('0x32')](db[_0xbb58('0x2c')]['rawAttributes']);_0x54099f[_0xbb58('0x31')]=_['keys'](_0x285ad4[_0xbb58('0x31')]);_0x54099f[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],_0x54099f[_0xbb58('0x31')]);_0x45817f[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x285ad4[_0xbb58('0x31')][_0xbb58('0x37')]));_0x45817f[_0xbb58('0x36')]=_0x45817f[_0xbb58('0x36')]['length']?_0x45817f[_0xbb58('0x36')]:_0x54099f['model'];if(_0x285ad4['query'][_0xbb58('0x40')]){_0x45817f[_0xbb58('0x41')]=[{'all':!![]}];}_0x45817f=_[_0xbb58('0x3f')]({},_0x45817f,_0x285ad4[_0xbb58('0x45')]);return db[_0xbb58('0x2c')][_0xbb58('0x46')](_0x45817f)[_0xbb58('0x24')](handleEntityNotFound(_0x29fb1c,null))[_0xbb58('0x24')](respondWithResult(_0x29fb1c,null))[_0xbb58('0x47')](handleError(_0x29fb1c,null));};exports[_0xbb58('0x48')]=function(_0x440fb3,_0x59a8cf){return db[_0xbb58('0x2c')][_0xbb58('0x48')](_0x440fb3['body'],{})[_0xbb58('0x24')](respondWithResult(_0x59a8cf,0xc9))[_0xbb58('0x47')](handleError(_0x59a8cf,null));};exports[_0xbb58('0x49')]=function(_0xdb0ff7,_0x5de68e){if(_0xdb0ff7[_0xbb58('0x4a')]['id']){delete _0xdb0ff7['body']['id'];}return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0xdb0ff7[_0xbb58('0x44')]['id']}})['then'](handleEntityNotFound(_0x5de68e,null))[_0xbb58('0x24')](saveUpdates(_0xdb0ff7[_0xbb58('0x4a')],null))['then'](respondWithResult(_0x5de68e,null))[_0xbb58('0x47')](handleError(_0x5de68e,null));};exports['destroy']=function(_0x28301d,_0x2d81e0){return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0x28301d[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x2d81e0,null))[_0xbb58('0x24')](removeEntity(_0x2d81e0,null))['catch'](handleError(_0x2d81e0,null));};exports[_0xbb58('0x4b')]=function(_0x1fd892,_0x592da8,_0x3efbc6){var _0x98157={};var _0x5c19b7={};var _0x22802c;var _0x44636b;return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x1fd892[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x592da8,null))[_0xbb58('0x24')](function(_0x592879){if(_0x592879){_0x22802c=_0x592879;_0x5c19b7[_0xbb58('0x35')]=_['keys'](db[_0xbb58('0x4c')][_0xbb58('0x2d')]);_0x5c19b7[_0xbb58('0x31')]=_['keys'](_0x1fd892['query']);_0x5c19b7[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x5c19b7[_0xbb58('0x35')],_0x5c19b7[_0xbb58('0x31')]);_0x98157[_0xbb58('0x36')]=_['intersection'](_0x5c19b7[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x1fd892[_0xbb58('0x31')]['fields']));_0x98157[_0xbb58('0x36')]=_0x98157[_0xbb58('0x36')][_0xbb58('0x38')]?_0x98157[_0xbb58('0x36')]:_0x5c19b7[_0xbb58('0x35')];_0x98157['order']=qs[_0xbb58('0x3b')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3b')]);_0x98157[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x1fd892[_0xbb58('0x31')],_0x5c19b7[_0xbb58('0x33')]));if(_0x1fd892['query'][_0xbb58('0x3e')]){_0x98157['where']=_[_0xbb58('0x3f')](_0x98157[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0x98157[_0xbb58('0x36')],function(_0x3d6fba){var _0x1dbbd9={};_0x1dbbd9[_0x3d6fba]={'$like':'%'+_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x1dbbd9;})});}_0x98157=_[_0xbb58('0x3f')]({},_0x98157,_0x1fd892[_0xbb58('0x45')]);return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x3933f0){if(_0x3933f0){_0x44636b=_0x3933f0[_0xbb58('0x38')];if(!_0x1fd892[_0xbb58('0x31')]['hasOwnProperty'](_0xbb58('0x3a'))){_0x98157['limit']=qs[_0xbb58('0x1e')](_0x1fd892[_0xbb58('0x31')]['limit']);_0x98157[_0xbb58('0x1d')]=qs[_0xbb58('0x1d')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x1d')]);}return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x54bf2e){if(_0x54bf2e){return _0x54bf2e?{'count':_0x44636b,'rows':_0x54bf2e}:null;}})[_0xbb58('0x24')](respondWithResult(_0x592da8,null))[_0xbb58('0x47')](handleError(_0x592da8,null));};exports[_0xbb58('0x4d')]=function(_0x4bbccf,_0x11d41e,_0x419215){if(_0x4bbccf['body']['id']){delete _0x4bbccf[_0xbb58('0x4a')]['id'];}return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x4bbccf[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x11d41e,null))[_0xbb58('0x24')](function(_0x3c932e){if(_0x3c932e){_0x4bbccf[_0xbb58('0x4a')]['AccountId']=_0x3c932e['id'];_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x4e')]=integrations[_0xbb58('0x4f')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf['body']['type']);_0x4bbccf[_0xbb58('0x4a')]['Descriptions']=integrations[_0xbb58('0x51')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x2f')]);return db[_0xbb58('0x4c')][_0xbb58('0x48')](_0x4bbccf[_0xbb58('0x4a')],{'include':[{'model':db[_0xbb58('0x52')],'as':_0xbb58('0x4e')},{'model':db['ZendeskField'],'as':_0xbb58('0x53')}]});}return null;})[_0xbb58('0x24')](respondWithResult(_0x11d41e,null))[_0xbb58('0x47')](handleError(_0x11d41e,null));};exports['getFields']=function(_0x50bf24,_0x4bdc30,_0x5e9319){var _0x1e315e='';return db[_0xbb58('0x2c')][_0xbb58('0x54')]({'where':{'id':_0x50bf24[_0xbb58('0x44')]['id']},'attributes':['id','username','password',_0xbb58('0x55'),_0xbb58('0x56'),'remoteUri']})[_0xbb58('0x24')](handleEntityNotFound(_0x4bdc30,null))[_0xbb58('0x24')](function(_0x3cd96a){if(_0x3cd96a){_0x1e315e=_0x3cd96a[_0xbb58('0x57')];var _0x382d16=_0x1e315e['slice'](-0x1);if(_0x382d16==='/'){_0x1e315e=_0x1e315e[_0xbb58('0x58')](0x0,_0x1e315e['lastIndexOf'](_0x382d16));}var _0x52cf79={'method':_0xbb58('0x59'),'uri':util[_0xbb58('0x5a')](_0xbb58('0x5b'),_0x1e315e,'ticket_fields'),'json':!![]};switch(_0x3cd96a[_0xbb58('0x56')]){case _0xbb58('0x5c'):_0x52cf79[_0xbb58('0x5d')]={'Authorization':util[_0xbb58('0x5a')]('Basic\x20%s',new Buffer(util[_0xbb58('0x5a')]('%s:%s',_0x3cd96a['username'],_0x3cd96a[_0xbb58('0x5c')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;case'token':_0x52cf79['headers']={'Authorization':util[_0xbb58('0x5a')](_0xbb58('0x60'),new Buffer(util[_0xbb58('0x5a')](_0xbb58('0x61'),_0x3cd96a[_0xbb58('0x62')],_0x3cd96a[_0xbb58('0x55')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;default:throw new db[(_0xbb58('0x63'))][(_0xbb58('0x64'))](_0xbb58('0x65'));}return rp(_0x52cf79);}})['then'](function(_0x502f55){if(_0x502f55){var _0x36e2eb=[_0xbb58('0x66'),_0xbb58('0x67'),'group',_0xbb58('0x68')];_[_0xbb58('0x69')](_0x502f55[_0xbb58('0x6a')],function(_0x494c33){return _0x36e2eb[_0xbb58('0x6b')](_0x494c33['type']);});return{'count':_0x502f55[_0xbb58('0x6a')]['length'],'rows':_[_0xbb58('0x2b')](_0x502f55[_0xbb58('0x6a')],function(_0xaf9d6){return{'id':_0xaf9d6['id'],'name':_0xaf9d6[_0xbb58('0x6c')]>0x7?_0xaf9d6[_0xbb58('0x6d')]:_0xaf9d6[_0xbb58('0x2f')],'custom':_0xaf9d6['position']>0x7?!![]:![],'options':_0xaf9d6['system_field_options']?_0xaf9d6[_0xbb58('0x6e')]:_0xaf9d6[_0xbb58('0x6f')]?_0xaf9d6['custom_field_options']:[]};})};}})[_0xbb58('0x24')](respondWithResult(_0x4bdc30,null))[_0xbb58('0x47')](function(_0x43eb15){var _0x5604d1=_0x50bf24[_0xbb58('0x31')]['test']?0x1f4:_0x43eb15[_0xbb58('0x70')]||0x1f4;logger[_0xbb58('0x26')](_0xbb58('0x71'),_0xbb58('0x72'),_0x5604d1,JSON[_0xbb58('0x73')](_0x43eb15));delete _0x43eb15[_0xbb58('0x28')];if(_0x5604d1===0x191){_0x5604d1=0x190;}_0x4bdc30[_0xbb58('0x1a')](_0x5604d1)['send'](_0x50bf24[_0xbb58('0x31')][_0xbb58('0x74')]?{'message':_0xbb58('0x75'),'statusCode':_0x43eb15['statusCode']}:_0x43eb15);});}; \ No newline at end of file +var _0x757a=['rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','name','ZendeskAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','getConfigurations','findOne','ZendeskConfiguration','nolimit','AccountId','getSubjects','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','username','password','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials'];(function(_0x3d6b5b,_0x163153){var _0x3f8935=function(_0x2e29ef){while(--_0x2e29ef){_0x3d6b5b['push'](_0x3d6b5b['shift']());}};_0x3f8935(++_0x163153);}(_0x757a,0xde));var _0xa757=function(_0x32ea53,_0x5ce025){_0x32ea53=_0x32ea53-0x0;var _0x31565d=_0x757a[_0x32ea53];return _0x31565d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x421040,_0x544b45){_0x544b45=_0x544b45||0xcc;return function(_0x564187){if(_0x564187){return _0x421040[_0xa757('0x15')](_0x544b45);}return _0x421040['status'](_0x544b45)['end']();};}function respondWithResult(_0x32112b,_0x1b670e){_0x1b670e=_0x1b670e||0xc8;return function(_0x355f0a){if(_0x355f0a){return _0x32112b[_0xa757('0x16')](_0x1b670e)[_0xa757('0x17')](_0x355f0a);}};}function respondWithFilteredResult(_0x31cfd2,_0xf12b68){return function(_0x2f7947){if(_0x2f7947){var _0x185011=typeof _0xf12b68[_0xa757('0x18')]==='undefined'&&typeof _0xf12b68[_0xa757('0x19')]===_0xa757('0x1a');var _0xde8248=_0x2f7947['count'];var _0x54b305=_0x185011?0x0:_0xf12b68[_0xa757('0x18')];var _0x468d45=_0x185011?_0x2f7947[_0xa757('0x1b')]:_0xf12b68[_0xa757('0x18')]+_0xf12b68[_0xa757('0x19')];var _0xe2d567;if(_0x468d45>=_0xde8248){_0x468d45=_0xde8248;_0xe2d567=0xc8;}else{_0xe2d567=0xce;}_0x31cfd2['status'](_0xe2d567);return _0x31cfd2[_0xa757('0x1c')]('Content-Range',_0x54b305+'-'+_0x468d45+'/'+_0xde8248)[_0xa757('0x17')](_0x2f7947);}return null;};}function patchUpdates(_0x167640){return function(_0x14014c){try{jsonpatch[_0xa757('0x1d')](_0x14014c,_0x167640,!![]);}catch(_0x4d598c){return BPromise['reject'](_0x4d598c);}return _0x14014c[_0xa757('0x1e')]();};}function saveUpdates(_0x2159cf,_0x2ba923){return function(_0x8d121f){if(_0x8d121f){return _0x8d121f[_0xa757('0x1f')](_0x2159cf)[_0xa757('0x20')](function(_0x2ca10d){return _0x2ca10d;});}return null;};}function removeEntity(_0x21f1af,_0x2bf276){return function(_0x59fae6){if(_0x59fae6){return _0x59fae6[_0xa757('0x21')]()['then'](function(){_0x21f1af[_0xa757('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40551d,_0x3859ce){return function(_0x37c7e6){if(!_0x37c7e6){_0x40551d['sendStatus'](0x194);}return _0x37c7e6;};}function handleError(_0x2b19d5,_0xcd98bd){_0xcd98bd=_0xcd98bd||0x1f4;return function(_0x471e84){logger[_0xa757('0x22')](_0x471e84['stack']);if(_0x471e84[_0xa757('0x23')]){delete _0x471e84['name'];}_0x2b19d5['status'](_0xcd98bd)['send'](_0x471e84);};}exports['index']=function(_0xfdf69d,_0x596ae2){var _0x2208f9={},_0x3bc24c={},_0x55c5f8={'count':0x0,'rows':[]};var _0x2a0c9a=_['map'](db[_0xa757('0x24')][_0xa757('0x25')],function(_0x5307c3){return{'name':_0x5307c3[_0xa757('0x26')],'type':_0x5307c3['type'][_0xa757('0x27')]};});_0x3bc24c[_0xa757('0x28')]=_[_0xa757('0x29')](_0x2a0c9a,_0xa757('0x23'));_0x3bc24c[_0xa757('0x2a')]=_[_0xa757('0x2b')](_0xfdf69d[_0xa757('0x2a')]);_0x3bc24c[_0xa757('0x2c')]=_[_0xa757('0x2d')](_0x3bc24c[_0xa757('0x28')],_0x3bc24c[_0xa757('0x2a')]);_0x2208f9[_0xa757('0x2e')]=_[_0xa757('0x2d')](_0x3bc24c[_0xa757('0x28')],qs[_0xa757('0x2f')](_0xfdf69d[_0xa757('0x2a')][_0xa757('0x2f')]));_0x2208f9[_0xa757('0x2e')]=_0x2208f9[_0xa757('0x2e')][_0xa757('0x30')]?_0x2208f9[_0xa757('0x2e')]:_0x3bc24c[_0xa757('0x28')];if(!_0xfdf69d[_0xa757('0x2a')][_0xa757('0x31')]('nolimit')){_0x2208f9[_0xa757('0x19')]=qs[_0xa757('0x19')](_0xfdf69d[_0xa757('0x2a')][_0xa757('0x19')]);_0x2208f9[_0xa757('0x18')]=qs['offset'](_0xfdf69d[_0xa757('0x2a')][_0xa757('0x18')]);}_0x2208f9[_0xa757('0x32')]=qs[_0xa757('0x33')](_0xfdf69d[_0xa757('0x2a')][_0xa757('0x33')]);_0x2208f9['where']=qs[_0xa757('0x2c')](_[_0xa757('0x34')](_0xfdf69d[_0xa757('0x2a')],_0x3bc24c[_0xa757('0x2c')]),_0x2a0c9a);if(_0xfdf69d[_0xa757('0x2a')][_0xa757('0x35')]){_0x2208f9[_0xa757('0x36')]=_[_0xa757('0x37')](_0x2208f9[_0xa757('0x36')],{'$or':_['map'](_0x2a0c9a,function(_0x300be4){if(_0x300be4[_0xa757('0x38')]!==_0xa757('0x39')){var _0x35c15a={};_0x35c15a[_0x300be4[_0xa757('0x23')]]={'$like':'%'+_0xfdf69d[_0xa757('0x2a')]['filter']+'%'};return _0x35c15a;}})});}_0x2208f9=_[_0xa757('0x37')]({},_0x2208f9,_0xfdf69d[_0xa757('0x3a')]);var _0x48cde9={'where':_0x2208f9['where']};return db[_0xa757('0x24')][_0xa757('0x1b')](_0x48cde9)['then'](function(_0x51c3d1){_0x55c5f8[_0xa757('0x1b')]=_0x51c3d1;if(_0xfdf69d[_0xa757('0x2a')][_0xa757('0x3b')]){_0x2208f9['include']=[{'all':!![]}];}return db[_0xa757('0x24')][_0xa757('0x3c')](_0x2208f9);})[_0xa757('0x20')](function(_0x1ba399){_0x55c5f8[_0xa757('0x3d')]=_0x1ba399;return _0x55c5f8;})['then'](respondWithFilteredResult(_0x596ae2,_0x2208f9))[_0xa757('0x3e')](handleError(_0x596ae2,null));};exports['show']=function(_0x564d40,_0x43329c){var _0x57298b={'raw':![],'where':{'id':_0x564d40[_0xa757('0x3f')]['id']}},_0x373747={};_0x373747[_0xa757('0x28')]=_['keys'](db['ZendeskAccount'][_0xa757('0x25')]);_0x373747[_0xa757('0x2a')]=_[_0xa757('0x2b')](_0x564d40[_0xa757('0x2a')]);_0x373747[_0xa757('0x2c')]=_[_0xa757('0x2d')](_0x373747['model'],_0x373747[_0xa757('0x2a')]);_0x57298b[_0xa757('0x2e')]=_['intersection'](_0x373747[_0xa757('0x28')],qs['fields'](_0x564d40[_0xa757('0x2a')][_0xa757('0x2f')]));_0x57298b['attributes']=_0x57298b[_0xa757('0x2e')][_0xa757('0x30')]?_0x57298b['attributes']:_0x373747[_0xa757('0x28')];if(_0x564d40[_0xa757('0x2a')][_0xa757('0x3b')]){_0x57298b[_0xa757('0x40')]=[{'all':!![]}];}_0x57298b=_['merge']({},_0x57298b,_0x564d40[_0xa757('0x3a')]);return db[_0xa757('0x24')][_0xa757('0x41')](_0x57298b)[_0xa757('0x20')](handleEntityNotFound(_0x43329c,null))['then'](respondWithResult(_0x43329c,null))[_0xa757('0x3e')](handleError(_0x43329c,null));};exports['create']=function(_0x50c131,_0x2acf88){return db[_0xa757('0x24')][_0xa757('0x42')](_0x50c131['body'],{})[_0xa757('0x20')](respondWithResult(_0x2acf88,0xc9))['catch'](handleError(_0x2acf88,null));};exports[_0xa757('0x1f')]=function(_0x151cc3,_0x265793){if(_0x151cc3[_0xa757('0x43')]['id']){delete _0x151cc3[_0xa757('0x43')]['id'];}return db[_0xa757('0x24')][_0xa757('0x41')]({'where':{'id':_0x151cc3[_0xa757('0x3f')]['id']}})['then'](handleEntityNotFound(_0x265793,null))[_0xa757('0x20')](saveUpdates(_0x151cc3[_0xa757('0x43')],null))[_0xa757('0x20')](respondWithResult(_0x265793,null))[_0xa757('0x3e')](handleError(_0x265793,null));};exports[_0xa757('0x21')]=function(_0x1f10cf,_0x15bad7){return db[_0xa757('0x24')][_0xa757('0x41')]({'where':{'id':_0x1f10cf[_0xa757('0x3f')]['id']}})[_0xa757('0x20')](handleEntityNotFound(_0x15bad7,null))[_0xa757('0x20')](removeEntity(_0x15bad7,null))[_0xa757('0x3e')](handleError(_0x15bad7,null));};exports[_0xa757('0x44')]=function(_0x388573,_0x23caca,_0x492e7e){var _0x3b5116={};var _0x51157e={};var _0x48af6e;var _0x311c25;return db[_0xa757('0x24')][_0xa757('0x45')]({'where':{'id':_0x388573['params']['id']}})[_0xa757('0x20')](handleEntityNotFound(_0x23caca,null))[_0xa757('0x20')](function(_0x8614f9){if(_0x8614f9){_0x48af6e=_0x8614f9;_0x51157e[_0xa757('0x28')]=_['keys'](db[_0xa757('0x46')][_0xa757('0x25')]);_0x51157e[_0xa757('0x2a')]=_[_0xa757('0x2b')](_0x388573[_0xa757('0x2a')]);_0x51157e[_0xa757('0x2c')]=_['intersection'](_0x51157e['model'],_0x51157e['query']);_0x3b5116['attributes']=_[_0xa757('0x2d')](_0x51157e[_0xa757('0x28')],qs[_0xa757('0x2f')](_0x388573[_0xa757('0x2a')][_0xa757('0x2f')]));_0x3b5116[_0xa757('0x2e')]=_0x3b5116['attributes'][_0xa757('0x30')]?_0x3b5116[_0xa757('0x2e')]:_0x51157e[_0xa757('0x28')];_0x3b5116[_0xa757('0x32')]=qs['sort'](_0x388573[_0xa757('0x2a')][_0xa757('0x33')]);_0x3b5116['where']=qs[_0xa757('0x2c')](_['pick'](_0x388573[_0xa757('0x2a')],_0x51157e['filters']));if(_0x388573[_0xa757('0x2a')]['filter']){_0x3b5116['where']=_[_0xa757('0x37')](_0x3b5116[_0xa757('0x36')],{'$or':_[_0xa757('0x29')](_0x3b5116[_0xa757('0x2e')],function(_0x14e226){var _0xc5ae37={};_0xc5ae37[_0x14e226]={'$like':'%'+_0x388573['query']['filter']+'%'};return _0xc5ae37;})});}_0x3b5116=_[_0xa757('0x37')]({},_0x3b5116,_0x388573[_0xa757('0x3a')]);return _0x48af6e[_0xa757('0x44')](_0x3b5116);}})['then'](function(_0x55a7d2){if(_0x55a7d2){_0x311c25=_0x55a7d2[_0xa757('0x30')];if(!_0x388573[_0xa757('0x2a')][_0xa757('0x31')](_0xa757('0x47'))){_0x3b5116[_0xa757('0x19')]=qs[_0xa757('0x19')](_0x388573['query'][_0xa757('0x19')]);_0x3b5116[_0xa757('0x18')]=qs[_0xa757('0x18')](_0x388573[_0xa757('0x2a')][_0xa757('0x18')]);}return _0x48af6e[_0xa757('0x44')](_0x3b5116);}})[_0xa757('0x20')](function(_0x13dd81){if(_0x13dd81){return _0x13dd81?{'count':_0x311c25,'rows':_0x13dd81}:null;}})[_0xa757('0x20')](respondWithResult(_0x23caca,null))[_0xa757('0x3e')](handleError(_0x23caca,null));};exports['addConfiguration']=function(_0x9e96e6,_0x5c803a,_0x5851fd){if(_0x9e96e6[_0xa757('0x43')]['id']){delete _0x9e96e6[_0xa757('0x43')]['id'];}return db[_0xa757('0x24')][_0xa757('0x45')]({'where':{'id':_0x9e96e6[_0xa757('0x3f')]['id']}})[_0xa757('0x20')](handleEntityNotFound(_0x5c803a,null))[_0xa757('0x20')](function(_0x32e0b9){if(_0x32e0b9){_0x9e96e6[_0xa757('0x43')][_0xa757('0x48')]=_0x32e0b9['id'];_0x9e96e6[_0xa757('0x43')]['Subjects']=integrations[_0xa757('0x49')](_0x9e96e6[_0xa757('0x43')]['channel'],_0x9e96e6[_0xa757('0x43')][_0xa757('0x38')]);_0x9e96e6[_0xa757('0x43')][_0xa757('0x4a')]=integrations[_0xa757('0x4b')](_0x9e96e6[_0xa757('0x43')]['channel'],_0x9e96e6[_0xa757('0x43')]['type']);return db[_0xa757('0x46')][_0xa757('0x42')](_0x9e96e6[_0xa757('0x43')],{'include':[{'model':db[_0xa757('0x4c')],'as':_0xa757('0x4d')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xa757('0x20')](respondWithResult(_0x5c803a,null))[_0xa757('0x3e')](handleError(_0x5c803a,null));};exports[_0xa757('0x4e')]=function(_0x5f450f,_0x115a94,_0x55bc0f){var _0x34982a='';return db[_0xa757('0x24')][_0xa757('0x45')]({'where':{'id':_0x5f450f[_0xa757('0x3f')]['id']},'attributes':['id',_0xa757('0x4f'),_0xa757('0x50'),'token',_0xa757('0x51'),_0xa757('0x52')]})[_0xa757('0x20')](handleEntityNotFound(_0x115a94,null))[_0xa757('0x20')](function(_0x1c35bc){if(_0x1c35bc){_0x34982a=_0x1c35bc['remoteUri'];var _0x2586f9=_0x34982a[_0xa757('0x53')](-0x1);if(_0x2586f9==='/'){_0x34982a=_0x34982a[_0xa757('0x54')](0x0,_0x34982a[_0xa757('0x55')](_0x2586f9));}var _0x43cc0a={'method':'GET','uri':util[_0xa757('0x56')](_0xa757('0x57'),_0x34982a,_0xa757('0x58')),'json':!![]};switch(_0x1c35bc['authType']){case _0xa757('0x50'):_0x43cc0a[_0xa757('0x59')]={'Authorization':util[_0xa757('0x56')](_0xa757('0x5a'),new Buffer(util[_0xa757('0x56')](_0xa757('0x5b'),_0x1c35bc[_0xa757('0x4f')],_0x1c35bc[_0xa757('0x50')]))[_0xa757('0x5c')](_0xa757('0x5d')))};break;case _0xa757('0x5e'):_0x43cc0a[_0xa757('0x59')]={'Authorization':util[_0xa757('0x56')](_0xa757('0x5a'),new Buffer(util['format'](_0xa757('0x5f'),_0x1c35bc[_0xa757('0x4f')],_0x1c35bc['token']))[_0xa757('0x5c')](_0xa757('0x5d')))};break;default:throw new db['Sequelize'][(_0xa757('0x60'))](_0xa757('0x61'));}return rp(_0x43cc0a);}})[_0xa757('0x20')](function(_0x2e1198){if(_0x2e1198){var _0x3a00ef=[_0xa757('0x62'),_0xa757('0x63'),_0xa757('0x64'),_0xa757('0x65')];_[_0xa757('0x66')](_0x2e1198[_0xa757('0x58')],function(_0x189195){return _0x3a00ef[_0xa757('0x67')](_0x189195[_0xa757('0x38')]);});return{'count':_0x2e1198[_0xa757('0x58')][_0xa757('0x30')],'rows':_['map'](_0x2e1198[_0xa757('0x58')],function(_0x56ba75){return{'id':_0x56ba75['id'],'name':_0x56ba75[_0xa757('0x68')]>0x7?_0x56ba75[_0xa757('0x69')]:_0x56ba75[_0xa757('0x38')],'custom':_0x56ba75[_0xa757('0x68')]>0x7?!![]:![],'options':_0x56ba75[_0xa757('0x6a')]?_0x56ba75['system_field_options']:_0x56ba75[_0xa757('0x6b')]?_0x56ba75[_0xa757('0x6b')]:[]};})};}})[_0xa757('0x20')](respondWithResult(_0x115a94,null))['catch'](function(_0x3317d8){var _0x3619ec=_0x5f450f[_0xa757('0x2a')]['test']?0x1f4:_0x3317d8['statusCode']||0x1f4;logger[_0xa757('0x22')](_0xa757('0x6c'),_0xa757('0x4e'),_0x3619ec,JSON['stringify'](_0x3317d8));delete _0x3317d8[_0xa757('0x23')];if(_0x3619ec===0x191){_0x3619ec=0x190;}_0x115a94['status'](_0x3619ec)['send'](_0x5f450f[_0xa757('0x2a')][_0xa757('0x6d')]?{'message':_0xa757('0x6e'),'statusCode':_0x3317d8['statusCode']}:_0x3317d8);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 3c5e335..f3ddfb3 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 _0x189a=['exports','ZendeskAccount','lodash','util','api','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x30c8b8,_0x4d7163){var _0x2d758e=function(_0x3268f9){while(--_0x3268f9){_0x30c8b8['push'](_0x30c8b8['shift']());}};_0x2d758e(++_0x4d7163);}(_0x189a,0x1ec));var _0xa189=function(_0x46a000,_0x49c350){_0x46a000=_0x46a000-0x0;var _0x494439=_0x189a[_0x46a000];return _0x494439;};'use strict';var _=require(_0xa189('0x0'));var util=require(_0xa189('0x1'));var logger=require('../../config/logger')(_0xa189('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa189('0x3'));var fs=require('fs');var path=require(_0xa189('0x4'));var rimraf=require('rimraf');var config=require(_0xa189('0x5'));var attributes=require(_0xa189('0x6'));var integrations=require(_0xa189('0x7'));module[_0xa189('0x8')]=function(_0x2285a4,_0x3d9082){return _0x2285a4['define'](_0xa189('0x9'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x114a=['request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x59ec12,_0x5690e4){var _0x1a40b4=function(_0x2ed01b){while(--_0x2ed01b){_0x59ec12['push'](_0x59ec12['shift']());}};_0x1a40b4(++_0x5690e4);}(_0x114a,0xb1));var _0xa114=function(_0x1a2600,_0x3795b7){_0x1a2600=_0x1a2600-0x0;var _0x44ae14=_0x114a[_0x1a2600];return _0x44ae14;};'use strict';var _=require(_0xa114('0x0'));var util=require('util');var logger=require(_0xa114('0x1'))(_0xa114('0x2'));var moment=require(_0xa114('0x3'));var BPromise=require(_0xa114('0x4'));var rp=require(_0xa114('0x5'));var fs=require('fs');var path=require(_0xa114('0x6'));var rimraf=require('rimraf');var config=require(_0xa114('0x7'));var attributes=require(_0xa114('0x8'));var integrations=require(_0xa114('0x9'));module[_0xa114('0xa')]=function(_0x1742fb,_0x3eef95){return _0x1742fb[_0xa114('0xb')](_0xa114('0xc'),attributes,{'tableName':_0xa114('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 8ae0001..3de8a8d 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 _0xd662=['info','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xd662,0x85));var _0x2d66=function(_0x1f8e0c,_0x4de1c1){_0x1f8e0c=_0x1f8e0c-0x0;var _0x2e06ea=_0xd662[_0x1f8e0c];return _0x2e06ea;};'use strict';var _=require(_0x2d66('0x0'));var util=require(_0x2d66('0x1'));var moment=require(_0x2d66('0x2'));var BPromise=require(_0x2d66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d66('0x4'));var db=require(_0x2d66('0x5'))['db'];var utils=require(_0x2d66('0x6'));var logger=require(_0x2d66('0x7'))(_0x2d66('0x8'));var config=require(_0x2d66('0x9'));var jayson=require(_0x2d66('0xa'));var client=jayson[_0x2d66('0xb')][_0x2d66('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55eb0e,_0x2a6fc9,_0x11e5f2){return new BPromise(function(_0x50483e,_0x3b1799){return client[_0x2d66('0xd')](_0x55eb0e,_0x11e5f2)[_0x2d66('0xe')](function(_0x564095){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x2a6fc9,_0x2d66('0xf'));logger[_0x2d66('0x10')](_0x2d66('0x11'),_0x2a6fc9,_0x2d66('0xf'),JSON[_0x2d66('0x12')](_0x564095));if(_0x564095[_0x2d66('0x13')]){if(_0x564095[_0x2d66('0x13')][_0x2d66('0x14')]===0x1f4){logger['error'](_0x2d66('0x15'),_0x2a6fc9,_0x564095[_0x2d66('0x13')][_0x2d66('0x16')]);return _0x3b1799(_0x564095[_0x2d66('0x13')][_0x2d66('0x16')]);}logger[_0x2d66('0x13')](_0x2d66('0x15'),_0x2a6fc9,_0x564095['error']['message']);return _0x50483e(_0x564095[_0x2d66('0x13')][_0x2d66('0x16')]);}else{logger[_0x2d66('0x17')](_0x2d66('0x15'),_0x2a6fc9,_0x2d66('0xf'));_0x50483e(_0x564095[_0x2d66('0x18')][_0x2d66('0x16')]);}})[_0x2d66('0x19')](function(_0x446012){logger[_0x2d66('0x13')](_0x2d66('0x15'),_0x2a6fc9,_0x446012);_0x3b1799(_0x446012);});});}exports['GetZendeskAccount']=function(_0x260040){var _0x879e30=this;return new Promise(function(_0xabcef9,_0x50cb2a){return db[_0x2d66('0x1a')][_0x2d66('0x1b')]({'raw':_0x260040[_0x2d66('0x1c')]?_0x260040[_0x2d66('0x1c')][_0x2d66('0x1d')]===undefined?!![]:![]:!![],'where':_0x260040[_0x2d66('0x1c')]?_0x260040[_0x2d66('0x1c')][_0x2d66('0x1e')]||null:null,'attributes':_0x260040['options']?_0x260040[_0x2d66('0x1c')][_0x2d66('0x1f')]||null:null,'limit':_0x260040[_0x2d66('0x1c')]?_0x260040[_0x2d66('0x1c')][_0x2d66('0x20')]||null:null,'include':_0x260040[_0x2d66('0x1c')]?_0x260040[_0x2d66('0x1c')][_0x2d66('0x21')]?_[_0x2d66('0x22')](_0x260040[_0x2d66('0x1c')]['include'],function(_0x2bbfe3){return{'model':db[_0x2bbfe3['model']],'as':_0x2bbfe3['as'],'attributes':_0x2bbfe3[_0x2d66('0x1f')],'include':_0x2bbfe3[_0x2d66('0x21')]?_['map'](_0x2bbfe3['include'],function(_0x141c72){return{'model':db[_0x141c72[_0x2d66('0x23')]],'as':_0x141c72['as'],'attributes':_0x141c72[_0x2d66('0x1f')],'include':_0x141c72['include']?_[_0x2d66('0x22')](_0x141c72[_0x2d66('0x21')],function(_0x198084){return{'model':db[_0x198084[_0x2d66('0x23')]],'as':_0x198084['as'],'attributes':_0x198084[_0x2d66('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2d66('0xe')](function(_0x441075){logger[_0x2d66('0x17')](_0x2d66('0x24'),_0x260040);logger['debug'](_0x2d66('0x24'),_0x260040,JSON[_0x2d66('0x12')](_0x441075));_0xabcef9(_0x441075);})[_0x2d66('0x19')](function(_0x45704f){logger[_0x2d66('0x13')](_0x2d66('0x24'),_0x45704f[_0x2d66('0x16')],_0x260040);_0x50cb2a(_0x879e30[_0x2d66('0x13')](0x1f4,_0x45704f[_0x2d66('0x16')]));});});};exports[_0x2d66('0x25')]=function(_0x429ce0){var _0x3ce6aa=this;return new Promise(function(_0x59b7b3,_0x594f1d){return db[_0x2d66('0x1a')][_0x2d66('0x26')]({'raw':_0x429ce0[_0x2d66('0x1c')]?_0x429ce0['options']['raw']===undefined?!![]:![]:!![],'where':_0x429ce0['options']?_0x429ce0[_0x2d66('0x1c')][_0x2d66('0x1e')]||null:null,'attributes':_0x429ce0['options']?_0x429ce0[_0x2d66('0x1c')][_0x2d66('0x1f')]||null:null,'include':_0x429ce0[_0x2d66('0x1c')]?_0x429ce0[_0x2d66('0x1c')][_0x2d66('0x21')]?_[_0x2d66('0x22')](_0x429ce0[_0x2d66('0x1c')][_0x2d66('0x21')],function(_0x21f4ba){return{'model':db[_0x21f4ba[_0x2d66('0x23')]],'as':_0x21f4ba['as'],'attributes':_0x21f4ba[_0x2d66('0x1f')],'include':_0x21f4ba['include']?_[_0x2d66('0x22')](_0x21f4ba['include'],function(_0x302c9e){return{'model':db[_0x302c9e['model']],'as':_0x302c9e['as'],'attributes':_0x302c9e[_0x2d66('0x1f')],'include':_0x302c9e[_0x2d66('0x21')]?_['map'](_0x302c9e[_0x2d66('0x21')],function(_0x33a974){return{'model':db[_0x33a974[_0x2d66('0x23')]],'as':_0x33a974['as'],'attributes':_0x33a974[_0x2d66('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2d66('0xe')](function(_0x577457){logger[_0x2d66('0x17')](_0x2d66('0x25'),_0x429ce0);logger[_0x2d66('0x10')](_0x2d66('0x25'),_0x429ce0,JSON[_0x2d66('0x12')](_0x577457));_0x59b7b3(_0x577457);})[_0x2d66('0x19')](function(_0x1d8515){logger['error']('ShowZendeskAccount',_0x1d8515[_0x2d66('0x16')],_0x429ce0);_0x594f1d(_0x3ce6aa[_0x2d66('0x13')](0x1f4,_0x1d8515[_0x2d66('0x16')]));});});}; \ No newline at end of file +var _0x6ac7=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskAccount,\x20%s,\x20%s','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','info','debug','catch','find','ShowZendeskAccount','lodash'];(function(_0x19328b,_0x4a5802){var _0x4216ee=function(_0x5aad41){while(--_0x5aad41){_0x19328b['push'](_0x19328b['shift']());}};_0x4216ee(++_0x4a5802);}(_0x6ac7,0x1e0));var _0x76ac=function(_0x365e4b,_0x3673a9){_0x365e4b=_0x365e4b-0x0;var _0x452017=_0x6ac7[_0x365e4b];return _0x452017;};'use strict';var _=require(_0x76ac('0x0'));var util=require(_0x76ac('0x1'));var moment=require(_0x76ac('0x2'));var BPromise=require(_0x76ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76ac('0x4'));var db=require(_0x76ac('0x5'))['db'];var utils=require(_0x76ac('0x6'));var logger=require(_0x76ac('0x7'))(_0x76ac('0x8'));var config=require(_0x76ac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x76ac('0xa')][_0x76ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f4282,_0x22ba65,_0x159cbb){return new BPromise(function(_0x31d9bc,_0x26884d){return client[_0x76ac('0xc')](_0x5f4282,_0x159cbb)[_0x76ac('0xd')](function(_0x38ef11){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x22ba65,_0x76ac('0xe'));logger['debug'](_0x76ac('0xf'),_0x22ba65,_0x76ac('0xe'),JSON[_0x76ac('0x10')](_0x38ef11));if(_0x38ef11[_0x76ac('0x11')]){if(_0x38ef11[_0x76ac('0x11')]['code']===0x1f4){logger[_0x76ac('0x11')](_0x76ac('0x12'),_0x22ba65,_0x38ef11[_0x76ac('0x11')]['message']);return _0x26884d(_0x38ef11[_0x76ac('0x11')][_0x76ac('0x13')]);}logger['error'](_0x76ac('0x12'),_0x22ba65,_0x38ef11[_0x76ac('0x11')][_0x76ac('0x13')]);return _0x31d9bc(_0x38ef11[_0x76ac('0x11')]['message']);}else{logger['info'](_0x76ac('0x12'),_0x22ba65,_0x76ac('0xe'));_0x31d9bc(_0x38ef11[_0x76ac('0x14')][_0x76ac('0x13')]);}})['catch'](function(_0x104c7e){logger[_0x76ac('0x11')](_0x76ac('0x12'),_0x22ba65,_0x104c7e);_0x26884d(_0x104c7e);});});}exports[_0x76ac('0x15')]=function(_0x471b94){var _0x54a968=this;return new Promise(function(_0x44b9b0,_0x560549){return db[_0x76ac('0x16')][_0x76ac('0x17')]({'raw':_0x471b94['options']?_0x471b94[_0x76ac('0x18')][_0x76ac('0x19')]===undefined?!![]:![]:!![],'where':_0x471b94['options']?_0x471b94['options'][_0x76ac('0x1a')]||null:null,'attributes':_0x471b94['options']?_0x471b94[_0x76ac('0x18')][_0x76ac('0x1b')]||null:null,'limit':_0x471b94[_0x76ac('0x18')]?_0x471b94[_0x76ac('0x18')][_0x76ac('0x1c')]||null:null,'include':_0x471b94[_0x76ac('0x18')]?_0x471b94[_0x76ac('0x18')]['include']?_[_0x76ac('0x1d')](_0x471b94[_0x76ac('0x18')][_0x76ac('0x1e')],function(_0x314a87){return{'model':db[_0x314a87[_0x76ac('0x1f')]],'as':_0x314a87['as'],'attributes':_0x314a87[_0x76ac('0x1b')],'include':_0x314a87[_0x76ac('0x1e')]?_[_0x76ac('0x1d')](_0x314a87[_0x76ac('0x1e')],function(_0x488001){return{'model':db[_0x488001[_0x76ac('0x1f')]],'as':_0x488001['as'],'attributes':_0x488001[_0x76ac('0x1b')],'include':_0x488001['include']?_[_0x76ac('0x1d')](_0x488001[_0x76ac('0x1e')],function(_0x5f38a5){return{'model':db[_0x5f38a5[_0x76ac('0x1f')]],'as':_0x5f38a5['as'],'attributes':_0x5f38a5[_0x76ac('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x76ac('0xd')](function(_0x341ec6){logger[_0x76ac('0x20')](_0x76ac('0x15'),_0x471b94);logger[_0x76ac('0x21')]('GetZendeskAccount',_0x471b94,JSON[_0x76ac('0x10')](_0x341ec6));_0x44b9b0(_0x341ec6);})[_0x76ac('0x22')](function(_0x1863e4){logger['error']('GetZendeskAccount',_0x1863e4[_0x76ac('0x13')],_0x471b94);_0x560549(_0x54a968[_0x76ac('0x11')](0x1f4,_0x1863e4['message']));});});};exports['ShowZendeskAccount']=function(_0x1903ab){var _0x58dc63=this;return new Promise(function(_0x4c8260,_0x25d5df){return db[_0x76ac('0x16')][_0x76ac('0x23')]({'raw':_0x1903ab[_0x76ac('0x18')]?_0x1903ab['options'][_0x76ac('0x19')]===undefined?!![]:![]:!![],'where':_0x1903ab[_0x76ac('0x18')]?_0x1903ab[_0x76ac('0x18')][_0x76ac('0x1a')]||null:null,'attributes':_0x1903ab['options']?_0x1903ab['options'][_0x76ac('0x1b')]||null:null,'include':_0x1903ab[_0x76ac('0x18')]?_0x1903ab['options'][_0x76ac('0x1e')]?_[_0x76ac('0x1d')](_0x1903ab[_0x76ac('0x18')][_0x76ac('0x1e')],function(_0x556c0f){return{'model':db[_0x556c0f[_0x76ac('0x1f')]],'as':_0x556c0f['as'],'attributes':_0x556c0f[_0x76ac('0x1b')],'include':_0x556c0f['include']?_['map'](_0x556c0f[_0x76ac('0x1e')],function(_0xcbadc){return{'model':db[_0xcbadc[_0x76ac('0x1f')]],'as':_0xcbadc['as'],'attributes':_0xcbadc['attributes'],'include':_0xcbadc['include']?_['map'](_0xcbadc[_0x76ac('0x1e')],function(_0x1c8766){return{'model':db[_0x1c8766[_0x76ac('0x1f')]],'as':_0x1c8766['as'],'attributes':_0x1c8766['attributes']};}):[]};}):[]};}):[]:[]})[_0x76ac('0xd')](function(_0x4f6349){logger[_0x76ac('0x20')](_0x76ac('0x24'),_0x1903ab);logger[_0x76ac('0x21')]('ShowZendeskAccount',_0x1903ab,JSON[_0x76ac('0x10')](_0x4f6349));_0x4c8260(_0x4f6349);})[_0x76ac('0x22')](function(_0xe72c0c){logger[_0x76ac('0x11')](_0x76ac('0x24'),_0xe72c0c['message'],_0x1903ab);_0x25d5df(_0x58dc63[_0x76ac('0x11')](0x1f4,_0xe72c0c[_0x76ac('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 2a6840f..ccabf99 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 _0x5c00=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x18daa9,_0x3c9c9c){var _0x9a5494=function(_0x5a31c5){while(--_0x5a31c5){_0x18daa9['push'](_0x18daa9['shift']());}};_0x9a5494(++_0x3c9c9c);}(_0x5c00,0x17e));var _0x05c0=function(_0x211530,_0x3ea767){_0x211530=_0x211530-0x0;var _0x3b5427=_0x5c00[_0x211530];return _0x3b5427;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/fields',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/descriptions',auth[_0x05c0('0x9')](),controller['getDescriptions']);router[_0x05c0('0x8')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller['getTags']);router[_0x05c0('0x10')]('/',auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0x10')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller['update']);router[_0x05c0('0x15')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x16')]);module[_0x05c0('0x17')]=router; \ No newline at end of file +var _0xbaf0=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x5f0b3a,_0x355c0b){var _0x2ba0f2=function(_0x14a672){while(--_0x14a672){_0x5f0b3a['push'](_0x5f0b3a['shift']());}};_0x2ba0f2(++_0x355c0b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0x9')]('/:id/fields',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0x14')]);router['post'](_0x0baf('0x15'),auth['isAuthenticated'](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);module[_0x0baf('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index cde36e3..bafafe8 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 _0x9707=['sequelize','exports','STRING'];(function(_0x405209,_0x3b8c7e){var _0x142098=function(_0x275f04){while(--_0x275f04){_0x405209['push'](_0x405209['shift']());}};_0x142098(++_0x3b8c7e);}(_0x9707,0x150));var _0x7970=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9707[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7970('0x0'));module[_0x7970('0x1')]={'name':{'type':Sequelize[_0x7970('0x2')]},'description':{'type':Sequelize[_0x7970('0x2')]}}; \ No newline at end of file +var _0x2bef=['exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2bef,0x179));var _0xf2be=function(_0x5db96a,_0x60039){_0x5db96a=_0x5db96a-0x0;var _0x13fdb0=_0x2bef[_0x5db96a];return _0x13fdb0;};'use strict';var Sequelize=require('sequelize');module[_0xf2be('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 156c6fa..9720828 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 _0x76d9=['sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','end','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','create','body','find','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5c06be,_0xe63b40){var _0x4fd5b7=function(_0x4c906b){while(--_0x4c906b){_0x5c06be['push'](_0x5c06be['shift']());}};_0x4fd5b7(++_0xe63b40);}(_0x76d9,0x129));var _0x976d=function(_0x170eb7,_0x1ac59b){_0x170eb7=_0x170eb7-0x0;var _0x4dfeac=_0x76d9[_0x170eb7];return _0x4dfeac;};'use strict';var emlformat=require(_0x976d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x976d('0x1'));var jsonpatch=require(_0x976d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x976d('0x3'));var Mustache=require(_0x976d('0x4'));var util=require(_0x976d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x976d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x976d('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x976d('0x8'));var jsforce=require(_0x976d('0x9'));var deskjs=require(_0x976d('0xa'));var toCsv=require(_0x976d('0x6'));var querystring=require('querystring');var Papa=require(_0x976d('0xb'));var Redis=require(_0x976d('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x976d('0xd'));var hardwareService=require(_0x976d('0xe'));var logger=require(_0x976d('0xf'))('api');var utils=require(_0x976d('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x976d('0x11'));var db=require(_0x976d('0x12'))['db'];function respondWithStatusCode(_0x427eee,_0x49411e){_0x49411e=_0x49411e||0xcc;return function(_0x4ef836){if(_0x4ef836){return _0x427eee[_0x976d('0x13')](_0x49411e);}return _0x427eee[_0x976d('0x14')](_0x49411e)['end']();};}function respondWithResult(_0x47e73a,_0x20012f){_0x20012f=_0x20012f||0xc8;return function(_0x1405e9){if(_0x1405e9){return _0x47e73a[_0x976d('0x14')](_0x20012f)[_0x976d('0x15')](_0x1405e9);}};}function respondWithFilteredResult(_0x46f60e,_0xf3829d){return function(_0x2bb885){if(_0x2bb885){var _0x4a263c=typeof _0xf3829d['offset']===_0x976d('0x16')&&typeof _0xf3829d[_0x976d('0x17')]==='undefined';var _0x1b5199=_0x2bb885[_0x976d('0x18')];var _0x31d32c=_0x4a263c?0x0:_0xf3829d[_0x976d('0x19')];var _0x42482d=_0x4a263c?_0x2bb885[_0x976d('0x18')]:_0xf3829d[_0x976d('0x19')]+_0xf3829d[_0x976d('0x17')];var _0x2cf8a3;if(_0x42482d>=_0x1b5199){_0x42482d=_0x1b5199;_0x2cf8a3=0xc8;}else{_0x2cf8a3=0xce;}_0x46f60e[_0x976d('0x14')](_0x2cf8a3);return _0x46f60e[_0x976d('0x1a')](_0x976d('0x1b'),_0x31d32c+'-'+_0x42482d+'/'+_0x1b5199)[_0x976d('0x15')](_0x2bb885);}return null;};}function patchUpdates(_0x26739c){return function(_0x3be024){try{jsonpatch[_0x976d('0x1c')](_0x3be024,_0x26739c,!![]);}catch(_0x49ce98){return BPromise['reject'](_0x49ce98);}return _0x3be024['save']();};}function saveUpdates(_0x24a398,_0x4d1f1b){return function(_0x13027b){if(_0x13027b){return _0x13027b[_0x976d('0x1d')](_0x24a398)['then'](function(_0x299155){return _0x299155;});}return null;};}function removeEntity(_0x532a98,_0xa73d8a){return function(_0x5b18f5){if(_0x5b18f5){return _0x5b18f5[_0x976d('0x1e')]()[_0x976d('0x1f')](function(){_0x532a98[_0x976d('0x14')](0xcc)[_0x976d('0x20')]();});}};}function handleEntityNotFound(_0x4fee09,_0x5a4567){return function(_0x1eed36){if(!_0x1eed36){_0x4fee09[_0x976d('0x13')](0x194);}return _0x1eed36;};}function handleError(_0x2b1944,_0xdfd149){_0xdfd149=_0xdfd149||0x1f4;return function(_0x3e07c3){logger[_0x976d('0x21')](_0x3e07c3[_0x976d('0x22')]);if(_0x3e07c3[_0x976d('0x23')]){delete _0x3e07c3[_0x976d('0x23')];}_0x2b1944['status'](_0xdfd149)['send'](_0x3e07c3);};}exports[_0x976d('0x24')]=function(_0x71a634,_0x3e10dc){var _0xb6b9b6={},_0x3e9f3e={},_0x1b0db6={'count':0x0,'rows':[]};var _0x3e3cf5=_[_0x976d('0x25')](db[_0x976d('0x26')][_0x976d('0x27')],function(_0x2dbdd6){return{'name':_0x2dbdd6[_0x976d('0x28')],'type':_0x2dbdd6['type'][_0x976d('0x29')]};});_0x3e9f3e[_0x976d('0x2a')]=_[_0x976d('0x25')](_0x3e3cf5,'name');_0x3e9f3e[_0x976d('0x2b')]=_[_0x976d('0x2c')](_0x71a634[_0x976d('0x2b')]);_0x3e9f3e[_0x976d('0x2d')]=_[_0x976d('0x2e')](_0x3e9f3e[_0x976d('0x2a')],_0x3e9f3e['query']);_0xb6b9b6[_0x976d('0x2f')]=_['intersection'](_0x3e9f3e['model'],qs[_0x976d('0x30')](_0x71a634[_0x976d('0x2b')][_0x976d('0x30')]));_0xb6b9b6['attributes']=_0xb6b9b6[_0x976d('0x2f')][_0x976d('0x31')]?_0xb6b9b6[_0x976d('0x2f')]:_0x3e9f3e[_0x976d('0x2a')];if(!_0x71a634[_0x976d('0x2b')][_0x976d('0x32')](_0x976d('0x33'))){_0xb6b9b6['limit']=qs['limit'](_0x71a634[_0x976d('0x2b')][_0x976d('0x17')]);_0xb6b9b6['offset']=qs['offset'](_0x71a634[_0x976d('0x2b')][_0x976d('0x19')]);}_0xb6b9b6[_0x976d('0x34')]=qs[_0x976d('0x35')](_0x71a634['query'][_0x976d('0x35')]);_0xb6b9b6[_0x976d('0x36')]=qs['filters'](_[_0x976d('0x37')](_0x71a634['query'],_0x3e9f3e[_0x976d('0x2d')]),_0x3e3cf5);if(_0x71a634['query'][_0x976d('0x38')]){_0xb6b9b6[_0x976d('0x36')]=_['merge'](_0xb6b9b6[_0x976d('0x36')],{'$or':_['map'](_0x3e3cf5,function(_0x3d1f7e){if(_0x3d1f7e[_0x976d('0x39')]!==_0x976d('0x3a')){var _0x204390={};_0x204390[_0x3d1f7e[_0x976d('0x23')]]={'$like':'%'+_0x71a634['query']['filter']+'%'};return _0x204390;}})});}_0xb6b9b6=_['merge']({},_0xb6b9b6,_0x71a634[_0x976d('0x3b')]);var _0x5aaefc={'where':_0xb6b9b6[_0x976d('0x36')]};return db[_0x976d('0x26')][_0x976d('0x18')](_0x5aaefc)[_0x976d('0x1f')](function(_0x2e8814){_0x1b0db6['count']=_0x2e8814;if(_0x71a634[_0x976d('0x2b')][_0x976d('0x3c')]){_0xb6b9b6[_0x976d('0x3d')]=[{'all':!![]}];}return db[_0x976d('0x26')]['findAll'](_0xb6b9b6);})[_0x976d('0x1f')](function(_0x1f60bb){_0x1b0db6[_0x976d('0x3e')]=_0x1f60bb;return _0x1b0db6;})[_0x976d('0x1f')](respondWithFilteredResult(_0x3e10dc,_0xb6b9b6))[_0x976d('0x3f')](handleError(_0x3e10dc,null));};exports[_0x976d('0x40')]=function(_0x5688b2,_0x2bdef6){var _0x4b62b5={'raw':![],'where':{'id':_0x5688b2[_0x976d('0x41')]['id']}},_0x3856c0={};_0x3856c0['model']=_[_0x976d('0x2c')](db['ZendeskConfiguration'][_0x976d('0x27')]);_0x3856c0['query']=_[_0x976d('0x2c')](_0x5688b2[_0x976d('0x2b')]);_0x3856c0[_0x976d('0x2d')]=_[_0x976d('0x2e')](_0x3856c0[_0x976d('0x2a')],_0x3856c0[_0x976d('0x2b')]);_0x4b62b5[_0x976d('0x2f')]=_[_0x976d('0x2e')](_0x3856c0[_0x976d('0x2a')],qs[_0x976d('0x30')](_0x5688b2[_0x976d('0x2b')][_0x976d('0x30')]));_0x4b62b5[_0x976d('0x2f')]=_0x4b62b5[_0x976d('0x2f')][_0x976d('0x31')]?_0x4b62b5[_0x976d('0x2f')]:_0x3856c0['model'];if(_0x5688b2[_0x976d('0x2b')]['includeAll']){_0x4b62b5[_0x976d('0x3d')]=[{'all':!![]}];}_0x4b62b5=_[_0x976d('0x42')]({},_0x4b62b5,_0x5688b2['options']);return db[_0x976d('0x26')]['find'](_0x4b62b5)[_0x976d('0x1f')](handleEntityNotFound(_0x2bdef6,null))[_0x976d('0x1f')](respondWithResult(_0x2bdef6,null))['catch'](handleError(_0x2bdef6,null));};exports[_0x976d('0x43')]=function(_0xc9469b,_0x33571d){return db['ZendeskConfiguration'][_0x976d('0x43')](_0xc9469b[_0x976d('0x44')],{})[_0x976d('0x1f')](respondWithResult(_0x33571d,0xc9))[_0x976d('0x3f')](handleError(_0x33571d,null));};exports[_0x976d('0x1d')]=function(_0x86725d,_0x2f10fa){if(_0x86725d['body']['id']){delete _0x86725d[_0x976d('0x44')]['id'];}return db[_0x976d('0x26')][_0x976d('0x45')]({'where':{'id':_0x86725d[_0x976d('0x41')]['id']}})[_0x976d('0x1f')](handleEntityNotFound(_0x2f10fa,null))[_0x976d('0x1f')](saveUpdates(_0x86725d[_0x976d('0x44')],null))[_0x976d('0x1f')](respondWithResult(_0x2f10fa,null))['catch'](handleError(_0x2f10fa,null));};exports[_0x976d('0x1e')]=function(_0x893352,_0x5c106c){return db[_0x976d('0x26')][_0x976d('0x45')]({'where':{'id':_0x893352[_0x976d('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c106c,null))[_0x976d('0x1f')](removeEntity(_0x5c106c,null))[_0x976d('0x3f')](handleError(_0x5c106c,null));};exports['getFields']=function(_0x148b8e,_0x5b8293,_0x45521d){var _0x2a2b04={};var _0x23dd55={};var _0x2c3414;var _0x57cca3;return db[_0x976d('0x26')][_0x976d('0x46')]({'where':{'id':_0x148b8e[_0x976d('0x41')]['id']}})['then'](handleEntityNotFound(_0x5b8293,null))['then'](function(_0x5dc959){if(_0x5dc959){_0x2c3414=_0x5dc959;_0x23dd55[_0x976d('0x2a')]=_[_0x976d('0x2c')](db[_0x976d('0x47')][_0x976d('0x27')]);_0x23dd55[_0x976d('0x2b')]=_[_0x976d('0x2c')](_0x148b8e['query']);_0x23dd55[_0x976d('0x2d')]=_[_0x976d('0x2e')](_0x23dd55[_0x976d('0x2a')],_0x23dd55['query']);_0x2a2b04['attributes']=_[_0x976d('0x2e')](_0x23dd55[_0x976d('0x2a')],qs[_0x976d('0x30')](_0x148b8e[_0x976d('0x2b')][_0x976d('0x30')]));_0x2a2b04[_0x976d('0x2f')]=_0x2a2b04['attributes']['length']?_0x2a2b04[_0x976d('0x2f')]:_0x23dd55['model'];_0x2a2b04[_0x976d('0x34')]=qs[_0x976d('0x35')](_0x148b8e[_0x976d('0x2b')][_0x976d('0x35')]);_0x2a2b04[_0x976d('0x36')]=qs[_0x976d('0x2d')](_[_0x976d('0x37')](_0x148b8e[_0x976d('0x2b')],_0x23dd55[_0x976d('0x2d')]));if(_0x148b8e[_0x976d('0x2b')][_0x976d('0x38')]){_0x2a2b04[_0x976d('0x36')]=_[_0x976d('0x42')](_0x2a2b04['where'],{'$or':_['map'](_0x2a2b04[_0x976d('0x2f')],function(_0x39402f){var _0x3e6aa3={};_0x3e6aa3[_0x39402f]={'$like':'%'+_0x148b8e[_0x976d('0x2b')][_0x976d('0x38')]+'%'};return _0x3e6aa3;})});}_0x2a2b04=_[_0x976d('0x42')]({},_0x2a2b04,_0x148b8e[_0x976d('0x3b')]);return _0x2c3414[_0x976d('0x48')](_0x2a2b04);}})[_0x976d('0x1f')](function(_0xcfbabf){if(_0xcfbabf){_0x57cca3=_0xcfbabf[_0x976d('0x31')];if(!_0x148b8e[_0x976d('0x2b')][_0x976d('0x32')]('nolimit')){_0x2a2b04[_0x976d('0x17')]=qs[_0x976d('0x17')](_0x148b8e[_0x976d('0x2b')]['limit']);_0x2a2b04[_0x976d('0x19')]=qs['offset'](_0x148b8e[_0x976d('0x2b')][_0x976d('0x19')]);}return _0x2c3414[_0x976d('0x48')](_0x2a2b04);}})[_0x976d('0x1f')](function(_0x4c174c){if(_0x4c174c){return _0x4c174c?{'count':_0x57cca3,'rows':_0x4c174c}:null;}})['then'](respondWithResult(_0x5b8293,null))[_0x976d('0x3f')](handleError(_0x5b8293,null));};exports[_0x976d('0x49')]=function(_0x58c530,_0x533f73,_0x3ee58d){var _0x57181c={};var _0x3a653b={};var _0xcf38a9;var _0x4ae828;return db[_0x976d('0x26')][_0x976d('0x46')]({'where':{'id':_0x58c530[_0x976d('0x41')]['id']}})[_0x976d('0x1f')](handleEntityNotFound(_0x533f73,null))['then'](function(_0x33d50a){if(_0x33d50a){_0xcf38a9=_0x33d50a;_0x3a653b[_0x976d('0x2a')]=_['keys'](db[_0x976d('0x47')][_0x976d('0x27')]);_0x3a653b[_0x976d('0x2b')]=_[_0x976d('0x2c')](_0x58c530[_0x976d('0x2b')]);_0x3a653b[_0x976d('0x2d')]=_[_0x976d('0x2e')](_0x3a653b[_0x976d('0x2a')],_0x3a653b[_0x976d('0x2b')]);_0x57181c[_0x976d('0x2f')]=_[_0x976d('0x2e')](_0x3a653b[_0x976d('0x2a')],qs[_0x976d('0x30')](_0x58c530[_0x976d('0x2b')]['fields']));_0x57181c[_0x976d('0x2f')]=_0x57181c[_0x976d('0x2f')][_0x976d('0x31')]?_0x57181c[_0x976d('0x2f')]:_0x3a653b[_0x976d('0x2a')];_0x57181c['order']=qs[_0x976d('0x35')](_0x58c530[_0x976d('0x2b')]['sort']);_0x57181c[_0x976d('0x36')]=qs[_0x976d('0x2d')](_['pick'](_0x58c530['query'],_0x3a653b['filters']));if(_0x58c530[_0x976d('0x2b')][_0x976d('0x38')]){_0x57181c[_0x976d('0x36')]=_[_0x976d('0x42')](_0x57181c['where'],{'$or':_['map'](_0x57181c[_0x976d('0x2f')],function(_0x2a63b9){var _0x5455f0={};_0x5455f0[_0x2a63b9]={'$like':'%'+_0x58c530[_0x976d('0x2b')][_0x976d('0x38')]+'%'};return _0x5455f0;})});}_0x57181c=_[_0x976d('0x42')]({},_0x57181c,_0x58c530[_0x976d('0x3b')]);return _0xcf38a9[_0x976d('0x49')](_0x57181c);}})[_0x976d('0x1f')](function(_0xaaea7d){if(_0xaaea7d){_0x4ae828=_0xaaea7d[_0x976d('0x31')];if(!_0x58c530[_0x976d('0x2b')][_0x976d('0x32')]('nolimit')){_0x57181c[_0x976d('0x17')]=qs[_0x976d('0x17')](_0x58c530['query'][_0x976d('0x17')]);_0x57181c[_0x976d('0x19')]=qs[_0x976d('0x19')](_0x58c530[_0x976d('0x2b')][_0x976d('0x19')]);}return _0xcf38a9[_0x976d('0x49')](_0x57181c);}})['then'](function(_0x29a2fe){if(_0x29a2fe){return _0x29a2fe?{'count':_0x4ae828,'rows':_0x29a2fe}:null;}})[_0x976d('0x1f')](respondWithResult(_0x533f73,null))[_0x976d('0x3f')](handleError(_0x533f73,null));};exports[_0x976d('0x4a')]=function(_0x365d52,_0x192951,_0xe7b5a2){var _0x57e145={};var _0x3040f9={};var _0x4023ed;var _0x4f7397;return db['ZendeskConfiguration'][_0x976d('0x46')]({'where':{'id':_0x365d52[_0x976d('0x41')]['id']}})[_0x976d('0x1f')](handleEntityNotFound(_0x192951,null))[_0x976d('0x1f')](function(_0x4ee75b){if(_0x4ee75b){_0x4023ed=_0x4ee75b;_0x3040f9[_0x976d('0x2a')]=_[_0x976d('0x2c')](db[_0x976d('0x47')][_0x976d('0x27')]);_0x3040f9['query']=_[_0x976d('0x2c')](_0x365d52[_0x976d('0x2b')]);_0x3040f9[_0x976d('0x2d')]=_['intersection'](_0x3040f9['model'],_0x3040f9['query']);_0x57e145['attributes']=_[_0x976d('0x2e')](_0x3040f9[_0x976d('0x2a')],qs['fields'](_0x365d52[_0x976d('0x2b')][_0x976d('0x30')]));_0x57e145[_0x976d('0x2f')]=_0x57e145['attributes']['length']?_0x57e145[_0x976d('0x2f')]:_0x3040f9[_0x976d('0x2a')];_0x57e145['order']=qs[_0x976d('0x35')](_0x365d52[_0x976d('0x2b')][_0x976d('0x35')]);_0x57e145[_0x976d('0x36')]=qs[_0x976d('0x2d')](_[_0x976d('0x37')](_0x365d52[_0x976d('0x2b')],_0x3040f9[_0x976d('0x2d')]));if(_0x365d52[_0x976d('0x2b')][_0x976d('0x38')]){_0x57e145['where']=_[_0x976d('0x42')](_0x57e145[_0x976d('0x36')],{'$or':_['map'](_0x57e145[_0x976d('0x2f')],function(_0x4acf0a){var _0x48ac15={};_0x48ac15[_0x4acf0a]={'$like':'%'+_0x365d52['query'][_0x976d('0x38')]+'%'};return _0x48ac15;})});}_0x57e145=_['merge']({},_0x57e145,_0x365d52['options']);return _0x4023ed[_0x976d('0x4a')](_0x57e145);}})[_0x976d('0x1f')](function(_0x5cdd44){if(_0x5cdd44){_0x4f7397=_0x5cdd44['length'];if(!_0x365d52[_0x976d('0x2b')]['hasOwnProperty']('nolimit')){_0x57e145[_0x976d('0x17')]=qs[_0x976d('0x17')](_0x365d52['query'][_0x976d('0x17')]);_0x57e145['offset']=qs[_0x976d('0x19')](_0x365d52[_0x976d('0x2b')]['offset']);}return _0x4023ed[_0x976d('0x4a')](_0x57e145);}})[_0x976d('0x1f')](function(_0x87fbed){if(_0x87fbed){return _0x87fbed?{'count':_0x4f7397,'rows':_0x87fbed}:null;}})['then'](respondWithResult(_0x192951,null))['catch'](handleError(_0x192951,null));};exports[_0x976d('0x4b')]=function(_0x13979c,_0x37e34d,_0x582e91){var _0x442e4b={};var _0x12f514={};var _0x63e494;var _0x583116;return db[_0x976d('0x26')][_0x976d('0x46')]({'where':{'id':_0x13979c[_0x976d('0x41')]['id']}})[_0x976d('0x1f')](handleEntityNotFound(_0x37e34d,null))[_0x976d('0x1f')](function(_0x4d0c94){if(_0x4d0c94){_0x63e494=_0x4d0c94;_0x12f514[_0x976d('0x2a')]=_[_0x976d('0x2c')](db[_0x976d('0x4c')][_0x976d('0x27')]);_0x12f514[_0x976d('0x2b')]=_[_0x976d('0x2c')](_0x13979c[_0x976d('0x2b')]);_0x12f514[_0x976d('0x2d')]=_[_0x976d('0x2e')](_0x12f514[_0x976d('0x2a')],_0x12f514['query']);_0x442e4b[_0x976d('0x2f')]=_['intersection'](_0x12f514['model'],qs[_0x976d('0x30')](_0x13979c['query'][_0x976d('0x30')]));_0x442e4b[_0x976d('0x2f')]=_0x442e4b[_0x976d('0x2f')][_0x976d('0x31')]?_0x442e4b[_0x976d('0x2f')]:_0x12f514[_0x976d('0x2a')];_0x442e4b[_0x976d('0x34')]=qs[_0x976d('0x35')](_0x13979c['query']['sort']);_0x442e4b[_0x976d('0x36')]=qs[_0x976d('0x2d')](_[_0x976d('0x37')](_0x13979c[_0x976d('0x2b')],_0x12f514[_0x976d('0x2d')]));if(_0x13979c[_0x976d('0x2b')][_0x976d('0x38')]){_0x442e4b[_0x976d('0x36')]=_[_0x976d('0x42')](_0x442e4b['where'],{'$or':_[_0x976d('0x25')](_0x442e4b[_0x976d('0x2f')],function(_0x336248){var _0x3fd674={};_0x3fd674[_0x336248]={'$like':'%'+_0x13979c[_0x976d('0x2b')]['filter']+'%'};return _0x3fd674;})});}_0x442e4b=_[_0x976d('0x42')]({},_0x442e4b,_0x13979c[_0x976d('0x3b')]);return _0x63e494['getTags'](_0x442e4b);}})[_0x976d('0x1f')](function(_0x3d291b){if(_0x3d291b){_0x583116=_0x3d291b[_0x976d('0x31')];if(!_0x13979c['query']['hasOwnProperty'](_0x976d('0x33'))){_0x442e4b[_0x976d('0x17')]=qs['limit'](_0x13979c[_0x976d('0x2b')][_0x976d('0x17')]);_0x442e4b[_0x976d('0x19')]=qs[_0x976d('0x19')](_0x13979c[_0x976d('0x2b')][_0x976d('0x19')]);}return _0x63e494[_0x976d('0x4b')](_0x442e4b);}})[_0x976d('0x1f')](function(_0x48c872){if(_0x48c872){return _0x48c872?{'count':_0x583116,'rows':_0x48c872}:null;}})[_0x976d('0x1f')](respondWithResult(_0x37e34d,null))['catch'](handleError(_0x37e34d,null));};exports[_0x976d('0x4d')]=function(_0x3d456b,_0x55692c,_0x3916ed){if(_0x3d456b[_0x976d('0x44')]['id']){delete _0x3d456b[_0x976d('0x44')]['id'];}return db[_0x976d('0x26')][_0x976d('0x46')]({'where':{'id':_0x3d456b[_0x976d('0x41')]['id']}})[_0x976d('0x1f')](handleEntityNotFound(_0x55692c,null))[_0x976d('0x1f')](function(_0x25fabb){if(_0x25fabb){return _0x25fabb[_0x976d('0x4d')](_0x3d456b[_0x976d('0x44')][_0x976d('0x4e')]||[]);}return null;})[_0x976d('0x1f')](respondWithResult(_0x55692c,null))['catch'](handleError(_0x55692c,null));}; \ No newline at end of file +var _0x703c=['VIRTUAL','options','ZendeskConfiguration','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','includeAll','find','create','body','findOne','sort','getFields','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','rimraf','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','map'];(function(_0x5d38f9,_0x4bbdd8){var _0x21c1f7=function(_0x48c786){while(--_0x48c786){_0x5d38f9['push'](_0x5d38f9['shift']());}};_0x21c1f7(++_0x4bbdd8);}(_0x703c,0xbd));var _0xc703=function(_0x11f264,_0x1c1a0d){_0x11f264=_0x11f264-0x0;var _0x99c74f=_0x703c[_0x11f264];return _0x99c74f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc703('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc703('0x1'));var rp=require('request-promise');var moment=require(_0xc703('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc703('0x3'));var path=require(_0xc703('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc703('0x5'));var fs=require('fs');var fs_extra=require(_0xc703('0x6'));var _=require(_0xc703('0x7'));var squel=require(_0xc703('0x8'));var crypto=require('crypto');var jsforce=require(_0xc703('0x9'));var deskjs=require(_0xc703('0xa'));var toCsv=require(_0xc703('0xb'));var querystring=require(_0xc703('0xc'));var Papa=require('papaparse');var Redis=require(_0xc703('0xd'));var authService=require(_0xc703('0xe'));var qs=require(_0xc703('0xf'));var as=require(_0xc703('0x10'));var hardwareService=require(_0xc703('0x11'));var logger=require(_0xc703('0x12'))(_0xc703('0x13'));var utils=require('../../config/utils');var config=require(_0xc703('0x14'));var licenseUtil=require(_0xc703('0x15'));var db=require(_0xc703('0x16'))['db'];function respondWithStatusCode(_0x48780b,_0x194a6c){_0x194a6c=_0x194a6c||0xcc;return function(_0x584131){if(_0x584131){return _0x48780b[_0xc703('0x17')](_0x194a6c);}return _0x48780b[_0xc703('0x18')](_0x194a6c)[_0xc703('0x19')]();};}function respondWithResult(_0x404596,_0x2cd2f2){_0x2cd2f2=_0x2cd2f2||0xc8;return function(_0x41a4ed){if(_0x41a4ed){return _0x404596[_0xc703('0x18')](_0x2cd2f2)[_0xc703('0x1a')](_0x41a4ed);}};}function respondWithFilteredResult(_0x4c7c0a,_0x1a981a){return function(_0x59a986){if(_0x59a986){var _0x1c8249=typeof _0x1a981a[_0xc703('0x1b')]===_0xc703('0x1c')&&typeof _0x1a981a[_0xc703('0x1d')]===_0xc703('0x1c');var _0x22c444=_0x59a986['count'];var _0x1503d2=_0x1c8249?0x0:_0x1a981a[_0xc703('0x1b')];var _0x130539=_0x1c8249?_0x59a986[_0xc703('0x1e')]:_0x1a981a[_0xc703('0x1b')]+_0x1a981a['limit'];var _0x4a0cc8;if(_0x130539>=_0x22c444){_0x130539=_0x22c444;_0x4a0cc8=0xc8;}else{_0x4a0cc8=0xce;}_0x4c7c0a['status'](_0x4a0cc8);return _0x4c7c0a['set'](_0xc703('0x1f'),_0x1503d2+'-'+_0x130539+'/'+_0x22c444)[_0xc703('0x1a')](_0x59a986);}return null;};}function patchUpdates(_0x284566){return function(_0x4c8e15){try{jsonpatch[_0xc703('0x20')](_0x4c8e15,_0x284566,!![]);}catch(_0xad11b7){return BPromise[_0xc703('0x21')](_0xad11b7);}return _0x4c8e15['save']();};}function saveUpdates(_0x4b5d8f,_0x460577){return function(_0x47a724){if(_0x47a724){return _0x47a724[_0xc703('0x22')](_0x4b5d8f)[_0xc703('0x23')](function(_0x56f266){return _0x56f266;});}return null;};}function removeEntity(_0x302017,_0x339204){return function(_0x27a06b){if(_0x27a06b){return _0x27a06b[_0xc703('0x24')]()['then'](function(){_0x302017[_0xc703('0x18')](0xcc)[_0xc703('0x19')]();});}};}function handleEntityNotFound(_0x1fbcde,_0x3f43ab){return function(_0x10ac62){if(!_0x10ac62){_0x1fbcde['sendStatus'](0x194);}return _0x10ac62;};}function handleError(_0x41a6c1,_0x6b347e){_0x6b347e=_0x6b347e||0x1f4;return function(_0x57b65a){logger[_0xc703('0x25')](_0x57b65a['stack']);if(_0x57b65a[_0xc703('0x26')]){delete _0x57b65a['name'];}_0x41a6c1[_0xc703('0x18')](_0x6b347e)[_0xc703('0x27')](_0x57b65a);};}exports[_0xc703('0x28')]=function(_0x55d0bb,_0x5cf6b4){var _0x5ee10c={},_0x31a743={},_0x4556c9={'count':0x0,'rows':[]};var _0x593cbf=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0x312ac7){return{'name':_0x312ac7[_0xc703('0x29')],'type':_0x312ac7[_0xc703('0x2a')]['key']};});_0x31a743[_0xc703('0x2b')]=_['map'](_0x593cbf,_0xc703('0x26'));_0x31a743[_0xc703('0x2c')]=_[_0xc703('0x2d')](_0x55d0bb[_0xc703('0x2c')]);_0x31a743[_0xc703('0x2e')]=_['intersection'](_0x31a743['model'],_0x31a743[_0xc703('0x2c')]);_0x5ee10c[_0xc703('0x2f')]=_['intersection'](_0x31a743[_0xc703('0x2b')],qs[_0xc703('0x30')](_0x55d0bb[_0xc703('0x2c')][_0xc703('0x30')]));_0x5ee10c[_0xc703('0x2f')]=_0x5ee10c['attributes']['length']?_0x5ee10c['attributes']:_0x31a743['model'];if(!_0x55d0bb['query'][_0xc703('0x31')](_0xc703('0x32'))){_0x5ee10c[_0xc703('0x1d')]=qs[_0xc703('0x1d')](_0x55d0bb['query'][_0xc703('0x1d')]);_0x5ee10c[_0xc703('0x1b')]=qs['offset'](_0x55d0bb[_0xc703('0x2c')][_0xc703('0x1b')]);}_0x5ee10c[_0xc703('0x33')]=qs['sort'](_0x55d0bb['query']['sort']);_0x5ee10c[_0xc703('0x34')]=qs[_0xc703('0x2e')](_[_0xc703('0x35')](_0x55d0bb['query'],_0x31a743['filters']),_0x593cbf);if(_0x55d0bb[_0xc703('0x2c')][_0xc703('0x36')]){_0x5ee10c[_0xc703('0x34')]=_[_0xc703('0x37')](_0x5ee10c['where'],{'$or':_[_0xc703('0x38')](_0x593cbf,function(_0x501ce6){if(_0x501ce6['type']!==_0xc703('0x39')){var _0x10584f={};_0x10584f[_0x501ce6[_0xc703('0x26')]]={'$like':'%'+_0x55d0bb['query'][_0xc703('0x36')]+'%'};return _0x10584f;}})});}_0x5ee10c=_['merge']({},_0x5ee10c,_0x55d0bb[_0xc703('0x3a')]);var _0x65b2a6={'where':_0x5ee10c[_0xc703('0x34')]};return db[_0xc703('0x3b')][_0xc703('0x1e')](_0x65b2a6)[_0xc703('0x23')](function(_0x3c4e57){_0x4556c9[_0xc703('0x1e')]=_0x3c4e57;if(_0x55d0bb[_0xc703('0x2c')]['includeAll']){_0x5ee10c[_0xc703('0x3c')]=[{'all':!![]}];}return db[_0xc703('0x3b')][_0xc703('0x3d')](_0x5ee10c);})[_0xc703('0x23')](function(_0xbc2750){_0x4556c9[_0xc703('0x3e')]=_0xbc2750;return _0x4556c9;})[_0xc703('0x23')](respondWithFilteredResult(_0x5cf6b4,_0x5ee10c))[_0xc703('0x3f')](handleError(_0x5cf6b4,null));};exports[_0xc703('0x40')]=function(_0x3076b1,_0x3b71fc){var _0x3b3927={'raw':![],'where':{'id':_0x3076b1[_0xc703('0x41')]['id']}},_0x5d4cde={};_0x5d4cde[_0xc703('0x2b')]=_[_0xc703('0x2d')](db['ZendeskConfiguration'][_0xc703('0x42')]);_0x5d4cde['query']=_[_0xc703('0x2d')](_0x3076b1[_0xc703('0x2c')]);_0x5d4cde[_0xc703('0x2e')]=_[_0xc703('0x43')](_0x5d4cde[_0xc703('0x2b')],_0x5d4cde[_0xc703('0x2c')]);_0x3b3927[_0xc703('0x2f')]=_[_0xc703('0x43')](_0x5d4cde[_0xc703('0x2b')],qs['fields'](_0x3076b1[_0xc703('0x2c')][_0xc703('0x30')]));_0x3b3927[_0xc703('0x2f')]=_0x3b3927['attributes'][_0xc703('0x44')]?_0x3b3927[_0xc703('0x2f')]:_0x5d4cde['model'];if(_0x3076b1[_0xc703('0x2c')][_0xc703('0x45')]){_0x3b3927['include']=[{'all':!![]}];}_0x3b3927=_['merge']({},_0x3b3927,_0x3076b1[_0xc703('0x3a')]);return db[_0xc703('0x3b')][_0xc703('0x46')](_0x3b3927)['then'](handleEntityNotFound(_0x3b71fc,null))[_0xc703('0x23')](respondWithResult(_0x3b71fc,null))['catch'](handleError(_0x3b71fc,null));};exports['create']=function(_0x58a6f6,_0x421326){return db['ZendeskConfiguration'][_0xc703('0x47')](_0x58a6f6['body'],{})['then'](respondWithResult(_0x421326,0xc9))[_0xc703('0x3f')](handleError(_0x421326,null));};exports[_0xc703('0x22')]=function(_0x3722a9,_0x2a8bfd){if(_0x3722a9[_0xc703('0x48')]['id']){delete _0x3722a9[_0xc703('0x48')]['id'];}return db['ZendeskConfiguration'][_0xc703('0x46')]({'where':{'id':_0x3722a9[_0xc703('0x41')]['id']}})[_0xc703('0x23')](handleEntityNotFound(_0x2a8bfd,null))[_0xc703('0x23')](saveUpdates(_0x3722a9['body'],null))[_0xc703('0x23')](respondWithResult(_0x2a8bfd,null))[_0xc703('0x3f')](handleError(_0x2a8bfd,null));};exports[_0xc703('0x24')]=function(_0x108659,_0x47ab3b){return db[_0xc703('0x3b')]['find']({'where':{'id':_0x108659[_0xc703('0x41')]['id']}})[_0xc703('0x23')](handleEntityNotFound(_0x47ab3b,null))[_0xc703('0x23')](removeEntity(_0x47ab3b,null))[_0xc703('0x3f')](handleError(_0x47ab3b,null));};exports['getFields']=function(_0x580c21,_0x27015b,_0x5881cb){var _0x5d3c35={};var _0x37e5dc={};var _0x4ce52d;var _0x1f4740;return db['ZendeskConfiguration'][_0xc703('0x49')]({'where':{'id':_0x580c21[_0xc703('0x41')]['id']}})['then'](handleEntityNotFound(_0x27015b,null))[_0xc703('0x23')](function(_0x2b72b1){if(_0x2b72b1){_0x4ce52d=_0x2b72b1;_0x37e5dc['model']=_['keys'](db['ZendeskField'][_0xc703('0x42')]);_0x37e5dc[_0xc703('0x2c')]=_[_0xc703('0x2d')](_0x580c21[_0xc703('0x2c')]);_0x37e5dc['filters']=_[_0xc703('0x43')](_0x37e5dc[_0xc703('0x2b')],_0x37e5dc[_0xc703('0x2c')]);_0x5d3c35[_0xc703('0x2f')]=_[_0xc703('0x43')](_0x37e5dc[_0xc703('0x2b')],qs[_0xc703('0x30')](_0x580c21['query'][_0xc703('0x30')]));_0x5d3c35[_0xc703('0x2f')]=_0x5d3c35[_0xc703('0x2f')][_0xc703('0x44')]?_0x5d3c35['attributes']:_0x37e5dc[_0xc703('0x2b')];_0x5d3c35[_0xc703('0x33')]=qs[_0xc703('0x4a')](_0x580c21[_0xc703('0x2c')][_0xc703('0x4a')]);_0x5d3c35[_0xc703('0x34')]=qs[_0xc703('0x2e')](_[_0xc703('0x35')](_0x580c21[_0xc703('0x2c')],_0x37e5dc[_0xc703('0x2e')]));if(_0x580c21[_0xc703('0x2c')]['filter']){_0x5d3c35['where']=_[_0xc703('0x37')](_0x5d3c35[_0xc703('0x34')],{'$or':_[_0xc703('0x38')](_0x5d3c35[_0xc703('0x2f')],function(_0x35ef77){var _0x324f76={};_0x324f76[_0x35ef77]={'$like':'%'+_0x580c21['query'][_0xc703('0x36')]+'%'};return _0x324f76;})});}_0x5d3c35=_[_0xc703('0x37')]({},_0x5d3c35,_0x580c21[_0xc703('0x3a')]);return _0x4ce52d[_0xc703('0x4b')](_0x5d3c35);}})[_0xc703('0x23')](function(_0x219048){if(_0x219048){_0x1f4740=_0x219048['length'];if(!_0x580c21[_0xc703('0x2c')][_0xc703('0x31')](_0xc703('0x32'))){_0x5d3c35[_0xc703('0x1d')]=qs[_0xc703('0x1d')](_0x580c21[_0xc703('0x2c')][_0xc703('0x1d')]);_0x5d3c35[_0xc703('0x1b')]=qs['offset'](_0x580c21['query'][_0xc703('0x1b')]);}return _0x4ce52d[_0xc703('0x4b')](_0x5d3c35);}})[_0xc703('0x23')](function(_0xc5ff1b){if(_0xc5ff1b){return _0xc5ff1b?{'count':_0x1f4740,'rows':_0xc5ff1b}:null;}})['then'](respondWithResult(_0x27015b,null))[_0xc703('0x3f')](handleError(_0x27015b,null));};exports[_0xc703('0x4c')]=function(_0x50ffb4,_0x52c340,_0x582da5){var _0x163f17={};var _0x5677b1={};var _0xdbf266;var _0x4a9964;return db['ZendeskConfiguration'][_0xc703('0x49')]({'where':{'id':_0x50ffb4[_0xc703('0x41')]['id']}})[_0xc703('0x23')](handleEntityNotFound(_0x52c340,null))[_0xc703('0x23')](function(_0x2f1d38){if(_0x2f1d38){_0xdbf266=_0x2f1d38;_0x5677b1[_0xc703('0x2b')]=_[_0xc703('0x2d')](db[_0xc703('0x4d')][_0xc703('0x42')]);_0x5677b1[_0xc703('0x2c')]=_[_0xc703('0x2d')](_0x50ffb4[_0xc703('0x2c')]);_0x5677b1['filters']=_['intersection'](_0x5677b1[_0xc703('0x2b')],_0x5677b1[_0xc703('0x2c')]);_0x163f17[_0xc703('0x2f')]=_[_0xc703('0x43')](_0x5677b1[_0xc703('0x2b')],qs[_0xc703('0x30')](_0x50ffb4[_0xc703('0x2c')][_0xc703('0x30')]));_0x163f17['attributes']=_0x163f17[_0xc703('0x2f')]['length']?_0x163f17[_0xc703('0x2f')]:_0x5677b1[_0xc703('0x2b')];_0x163f17[_0xc703('0x33')]=qs[_0xc703('0x4a')](_0x50ffb4[_0xc703('0x2c')]['sort']);_0x163f17[_0xc703('0x34')]=qs[_0xc703('0x2e')](_['pick'](_0x50ffb4[_0xc703('0x2c')],_0x5677b1[_0xc703('0x2e')]));if(_0x50ffb4['query'][_0xc703('0x36')]){_0x163f17['where']=_['merge'](_0x163f17[_0xc703('0x34')],{'$or':_['map'](_0x163f17[_0xc703('0x2f')],function(_0x4dab36){var _0x2f0422={};_0x2f0422[_0x4dab36]={'$like':'%'+_0x50ffb4[_0xc703('0x2c')][_0xc703('0x36')]+'%'};return _0x2f0422;})});}_0x163f17=_['merge']({},_0x163f17,_0x50ffb4[_0xc703('0x3a')]);return _0xdbf266[_0xc703('0x4c')](_0x163f17);}})[_0xc703('0x23')](function(_0xfe7879){if(_0xfe7879){_0x4a9964=_0xfe7879[_0xc703('0x44')];if(!_0x50ffb4[_0xc703('0x2c')][_0xc703('0x31')](_0xc703('0x32'))){_0x163f17[_0xc703('0x1d')]=qs[_0xc703('0x1d')](_0x50ffb4['query'][_0xc703('0x1d')]);_0x163f17[_0xc703('0x1b')]=qs[_0xc703('0x1b')](_0x50ffb4[_0xc703('0x2c')][_0xc703('0x1b')]);}return _0xdbf266[_0xc703('0x4c')](_0x163f17);}})[_0xc703('0x23')](function(_0xe2c70f){if(_0xe2c70f){return _0xe2c70f?{'count':_0x4a9964,'rows':_0xe2c70f}:null;}})[_0xc703('0x23')](respondWithResult(_0x52c340,null))[_0xc703('0x3f')](handleError(_0x52c340,null));};exports[_0xc703('0x4e')]=function(_0x58d978,_0x544e0c,_0x53d9d8){var _0x4ffbf7={};var _0xad44f2={};var _0x45c7f0;var _0x1e2d5c;return db[_0xc703('0x3b')][_0xc703('0x49')]({'where':{'id':_0x58d978[_0xc703('0x41')]['id']}})[_0xc703('0x23')](handleEntityNotFound(_0x544e0c,null))[_0xc703('0x23')](function(_0x26d2a7){if(_0x26d2a7){_0x45c7f0=_0x26d2a7;_0xad44f2[_0xc703('0x2b')]=_[_0xc703('0x2d')](db['ZendeskField'][_0xc703('0x42')]);_0xad44f2[_0xc703('0x2c')]=_[_0xc703('0x2d')](_0x58d978[_0xc703('0x2c')]);_0xad44f2[_0xc703('0x2e')]=_[_0xc703('0x43')](_0xad44f2[_0xc703('0x2b')],_0xad44f2[_0xc703('0x2c')]);_0x4ffbf7[_0xc703('0x2f')]=_[_0xc703('0x43')](_0xad44f2[_0xc703('0x2b')],qs['fields'](_0x58d978['query']['fields']));_0x4ffbf7[_0xc703('0x2f')]=_0x4ffbf7['attributes'][_0xc703('0x44')]?_0x4ffbf7['attributes']:_0xad44f2[_0xc703('0x2b')];_0x4ffbf7[_0xc703('0x33')]=qs[_0xc703('0x4a')](_0x58d978[_0xc703('0x2c')][_0xc703('0x4a')]);_0x4ffbf7[_0xc703('0x34')]=qs[_0xc703('0x2e')](_[_0xc703('0x35')](_0x58d978[_0xc703('0x2c')],_0xad44f2[_0xc703('0x2e')]));if(_0x58d978[_0xc703('0x2c')][_0xc703('0x36')]){_0x4ffbf7[_0xc703('0x34')]=_['merge'](_0x4ffbf7['where'],{'$or':_['map'](_0x4ffbf7[_0xc703('0x2f')],function(_0x5072c8){var _0x13a751={};_0x13a751[_0x5072c8]={'$like':'%'+_0x58d978[_0xc703('0x2c')][_0xc703('0x36')]+'%'};return _0x13a751;})});}_0x4ffbf7=_[_0xc703('0x37')]({},_0x4ffbf7,_0x58d978[_0xc703('0x3a')]);return _0x45c7f0[_0xc703('0x4e')](_0x4ffbf7);}})[_0xc703('0x23')](function(_0x1ed817){if(_0x1ed817){_0x1e2d5c=_0x1ed817[_0xc703('0x44')];if(!_0x58d978[_0xc703('0x2c')][_0xc703('0x31')](_0xc703('0x32'))){_0x4ffbf7[_0xc703('0x1d')]=qs[_0xc703('0x1d')](_0x58d978[_0xc703('0x2c')][_0xc703('0x1d')]);_0x4ffbf7[_0xc703('0x1b')]=qs[_0xc703('0x1b')](_0x58d978[_0xc703('0x2c')]['offset']);}return _0x45c7f0[_0xc703('0x4e')](_0x4ffbf7);}})[_0xc703('0x23')](function(_0x5cd372){if(_0x5cd372){return _0x5cd372?{'count':_0x1e2d5c,'rows':_0x5cd372}:null;}})['then'](respondWithResult(_0x544e0c,null))[_0xc703('0x3f')](handleError(_0x544e0c,null));};exports[_0xc703('0x4f')]=function(_0x55f594,_0x11327c,_0x35add7){var _0x210df4={};var _0x569b4e={};var _0xa6bd1b;var _0x283901;return db[_0xc703('0x3b')][_0xc703('0x49')]({'where':{'id':_0x55f594['params']['id']}})[_0xc703('0x23')](handleEntityNotFound(_0x11327c,null))[_0xc703('0x23')](function(_0x1a20ec){if(_0x1a20ec){_0xa6bd1b=_0x1a20ec;_0x569b4e['model']=_['keys'](db[_0xc703('0x50')]['rawAttributes']);_0x569b4e[_0xc703('0x2c')]=_[_0xc703('0x2d')](_0x55f594[_0xc703('0x2c')]);_0x569b4e['filters']=_[_0xc703('0x43')](_0x569b4e[_0xc703('0x2b')],_0x569b4e[_0xc703('0x2c')]);_0x210df4[_0xc703('0x2f')]=_[_0xc703('0x43')](_0x569b4e[_0xc703('0x2b')],qs[_0xc703('0x30')](_0x55f594[_0xc703('0x2c')][_0xc703('0x30')]));_0x210df4[_0xc703('0x2f')]=_0x210df4[_0xc703('0x2f')][_0xc703('0x44')]?_0x210df4[_0xc703('0x2f')]:_0x569b4e['model'];_0x210df4[_0xc703('0x33')]=qs['sort'](_0x55f594['query']['sort']);_0x210df4['where']=qs['filters'](_[_0xc703('0x35')](_0x55f594['query'],_0x569b4e[_0xc703('0x2e')]));if(_0x55f594[_0xc703('0x2c')][_0xc703('0x36')]){_0x210df4[_0xc703('0x34')]=_['merge'](_0x210df4[_0xc703('0x34')],{'$or':_[_0xc703('0x38')](_0x210df4[_0xc703('0x2f')],function(_0x294343){var _0x45a596={};_0x45a596[_0x294343]={'$like':'%'+_0x55f594[_0xc703('0x2c')]['filter']+'%'};return _0x45a596;})});}_0x210df4=_[_0xc703('0x37')]({},_0x210df4,_0x55f594[_0xc703('0x3a')]);return _0xa6bd1b[_0xc703('0x4f')](_0x210df4);}})[_0xc703('0x23')](function(_0x393d79){if(_0x393d79){_0x283901=_0x393d79[_0xc703('0x44')];if(!_0x55f594[_0xc703('0x2c')][_0xc703('0x31')](_0xc703('0x32'))){_0x210df4[_0xc703('0x1d')]=qs[_0xc703('0x1d')](_0x55f594[_0xc703('0x2c')]['limit']);_0x210df4[_0xc703('0x1b')]=qs[_0xc703('0x1b')](_0x55f594['query'][_0xc703('0x1b')]);}return _0xa6bd1b['getTags'](_0x210df4);}})[_0xc703('0x23')](function(_0xc16c49){if(_0xc16c49){return _0xc16c49?{'count':_0x283901,'rows':_0xc16c49}:null;}})[_0xc703('0x23')](respondWithResult(_0x11327c,null))['catch'](handleError(_0x11327c,null));};exports['setTags']=function(_0x75602a,_0x54dc8a,_0x2380fc){if(_0x75602a[_0xc703('0x48')]['id']){delete _0x75602a['body']['id'];}return db[_0xc703('0x3b')][_0xc703('0x49')]({'where':{'id':_0x75602a['params']['id']}})[_0xc703('0x23')](handleEntityNotFound(_0x54dc8a,null))[_0xc703('0x23')](function(_0x90f3d3){if(_0x90f3d3){return _0x90f3d3[_0xc703('0x51')](_0x75602a['body']['ids']||[]);}return null;})[_0xc703('0x23')](respondWithResult(_0x54dc8a,null))['catch'](handleError(_0x54dc8a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 636afb8..bded38b 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 _0xbbbc=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x5cfe47,_0x3c4fa4){_0x5cfe47=_0x5cfe47-0x0;var _0x4754ad=_0xbbbc[_0x5cfe47];return _0x4754ad;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbbc=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x10c778,_0x58ef9e){_0x10c778=_0x10c778-0x0;var _0x4e9fb2=_0xbbbc[_0x10c778];return _0x4e9fb2;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'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 e64d320..4bdc95d 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 _0xb06b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','ZendeskConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x4855ce,_0x3fbf65){var _0x150377=function(_0x21555b){while(--_0x21555b){_0x4855ce['push'](_0x4855ce['shift']());}};_0x150377(++_0x3fbf65);}(_0xb06b,0x1db));var _0xbb06=function(_0x5eeb64,_0x4bb25e){_0x5eeb64=_0x5eeb64-0x0;var _0x3399bf=_0xb06b[_0x5eeb64];return _0x3399bf;};'use strict';var _=require(_0xbb06('0x0'));var util=require('util');var moment=require(_0xbb06('0x1'));var BPromise=require(_0xbb06('0x2'));var rs=require(_0xbb06('0x3'));var fs=require('fs');var Redis=require(_0xbb06('0x4'));var db=require(_0xbb06('0x5'))['db'];var utils=require(_0xbb06('0x6'));var logger=require(_0xbb06('0x7'))(_0xbb06('0x8'));var config=require(_0xbb06('0x9'));var jayson=require(_0xbb06('0xa'));var client=jayson[_0xbb06('0xb')][_0xbb06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3fbe03,_0x38cbd2,_0x1bfcab){return new BPromise(function(_0x1d3bf0,_0x28a300){return client[_0xbb06('0xd')](_0x3fbe03,_0x1bfcab)[_0xbb06('0xe')](function(_0x16439e){logger[_0xbb06('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x38cbd2,_0xbb06('0x10'));logger['debug'](_0xbb06('0x11'),_0x38cbd2,_0xbb06('0x10'),JSON[_0xbb06('0x12')](_0x16439e));if(_0x16439e[_0xbb06('0x13')]){if(_0x16439e['error']['code']===0x1f4){logger[_0xbb06('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x38cbd2,_0x16439e['error']['message']);return _0x28a300(_0x16439e[_0xbb06('0x13')][_0xbb06('0x14')]);}logger['error'](_0xbb06('0x15'),_0x38cbd2,_0x16439e[_0xbb06('0x13')]['message']);return _0x1d3bf0(_0x16439e[_0xbb06('0x13')][_0xbb06('0x14')]);}else{logger[_0xbb06('0xf')](_0xbb06('0x15'),_0x38cbd2,_0xbb06('0x10'));_0x1d3bf0(_0x16439e[_0xbb06('0x16')][_0xbb06('0x14')]);}})[_0xbb06('0x17')](function(_0x483c74){logger[_0xbb06('0x13')](_0xbb06('0x15'),_0x38cbd2,_0x483c74);_0x28a300(_0x483c74);});});} \ No newline at end of file +var _0x62c3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','catch','util'];(function(_0x1c76e4,_0x3a887d){var _0x336bba=function(_0x344bf7){while(--_0x344bf7){_0x1c76e4['push'](_0x1c76e4['shift']());}};_0x336bba(++_0x3a887d);}(_0x62c3,0x13f));var _0x362c=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x62c3[_0x540dcb];return _0x49353c;};'use strict';var _=require('lodash');var util=require(_0x362c('0x0'));var moment=require('moment');var BPromise=require(_0x362c('0x1'));var rs=require(_0x362c('0x2'));var fs=require('fs');var Redis=require(_0x362c('0x3'));var db=require(_0x362c('0x4'))['db'];var utils=require(_0x362c('0x5'));var logger=require(_0x362c('0x6'))(_0x362c('0x7'));var config=require(_0x362c('0x8'));var jayson=require(_0x362c('0x9'));var client=jayson[_0x362c('0xa')][_0x362c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47a955,_0x321446,_0x504c6a){return new BPromise(function(_0x1dc272,_0x1b7426){return client[_0x362c('0xc')](_0x47a955,_0x504c6a)['then'](function(_0xdc41ed){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x321446,_0x362c('0xd'));logger['debug'](_0x362c('0xe'),_0x321446,_0x362c('0xd'),JSON[_0x362c('0xf')](_0xdc41ed));if(_0xdc41ed[_0x362c('0x10')]){if(_0xdc41ed['error']['code']===0x1f4){logger['error'](_0x362c('0x11'),_0x321446,_0xdc41ed[_0x362c('0x10')][_0x362c('0x12')]);return _0x1b7426(_0xdc41ed['error'][_0x362c('0x12')]);}logger[_0x362c('0x10')](_0x362c('0x11'),_0x321446,_0xdc41ed['error'][_0x362c('0x12')]);return _0x1dc272(_0xdc41ed[_0x362c('0x10')][_0x362c('0x12')]);}else{logger['info'](_0x362c('0x11'),_0x321446,_0x362c('0xd'));_0x1dc272(_0xdc41ed['result'][_0x362c('0x12')]);}})[_0x362c('0x13')](function(_0xfce933){logger[_0x362c('0x10')](_0x362c('0x11'),_0x321446,_0xfce933);_0x1b7426(_0xfce933);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index cbe2fc7..63dbefd 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 _0xaaea=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','connect-timeout','express','fs-extra'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xaaea,0x1a5));var _0xaaae=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaaea[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xaaae('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaaae('0x1'));var express=require(_0xaaae('0x2'));var router=express['Router']();var fs_extra=require(_0xaaae('0x3'));var auth=require(_0xaaae('0x4'));var interaction=require(_0xaaae('0x5'));var config=require(_0xaaae('0x6'));var controller=require('./intZendeskField.controller');router[_0xaaae('0x7')]('/',auth[_0xaaae('0x8')](),controller[_0xaaae('0x9')]);router['get'](_0xaaae('0xa'),auth[_0xaaae('0x8')](),controller['show']);router[_0xaaae('0xb')]('/',auth[_0xaaae('0x8')](),controller[_0xaaae('0xc')]);router[_0xaaae('0xd')]('/:id',auth[_0xaaae('0x8')](),controller[_0xaaae('0xe')]);router[_0xaaae('0xf')]('/:id',auth[_0xaaae('0x8')](),controller['destroy']);module[_0xaaae('0x10')]=router; \ No newline at end of file +var _0x19c2=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','get','/:id','show','post','create','update','exports','multer','util','path','connect-timeout'];(function(_0x2fc5db,_0x2253b1){var _0x1ef11b=function(_0x2846a5){while(--_0x2846a5){_0x2fc5db['push'](_0x2fc5db['shift']());}};_0x1ef11b(++_0x2253b1);}(_0x19c2,0x11d));var _0x219c=function(_0x32a2cf,_0x20b153){_0x32a2cf=_0x32a2cf-0x0;var _0x250e9d=_0x19c2[_0x32a2cf];return _0x250e9d;};'use strict';var multer=require(_0x219c('0x0'));var util=require(_0x219c('0x1'));var path=require(_0x219c('0x2'));var timeout=require(_0x219c('0x3'));var express=require(_0x219c('0x4'));var router=express['Router']();var fs_extra=require(_0x219c('0x5'));var auth=require(_0x219c('0x6'));var interaction=require(_0x219c('0x7'));var config=require('../../config/environment');var controller=require(_0x219c('0x8'));router['get']('/',auth[_0x219c('0x9')](),controller['index']);router[_0x219c('0xa')](_0x219c('0xb'),auth[_0x219c('0x9')](),controller[_0x219c('0xc')]);router[_0x219c('0xd')]('/',auth[_0x219c('0x9')](),controller[_0x219c('0xe')]);router['put'](_0x219c('0xb'),auth[_0x219c('0x9')](),controller[_0x219c('0xf')]);router['delete'](_0x219c('0xb'),auth[_0x219c('0x9')](),controller['destroy']);module[_0x219c('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 0de9184..aadee4d 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 _0xfa16=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x643b2,_0x14e495){var _0x2e5346=function(_0x3ed065){while(--_0x3ed065){_0x643b2['push'](_0x643b2['shift']());}};_0x2e5346(++_0x14e495);}(_0xfa16,0x139));var _0x6fa1=function(_0x57dd33,_0x4e55bb){_0x57dd33=_0x57dd33-0x0;var _0x2c81cf=_0xfa16[_0x57dd33];return _0x2c81cf;};'use strict';var Sequelize=require('sequelize');module[_0x6fa1('0x0')]={'type':{'type':Sequelize[_0x6fa1('0x1')](_0x6fa1('0x2'),_0x6fa1('0x3'),_0x6fa1('0x4'),_0x6fa1('0x5'),_0x6fa1('0x6')),'defaultValue':_0x6fa1('0x2')},'content':{'type':Sequelize[_0x6fa1('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6fa1('0x1')](_0x6fa1('0x2'),_0x6fa1('0x3'),_0x6fa1('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6fa1('0x7')]},'customField':{'type':Sequelize[_0x6fa1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6fa1('0x7')]}}; \ No newline at end of file +var _0xa552=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x123ff8,_0x2b9a42){var _0x2d8b5e=function(_0x970b6f){while(--_0x970b6f){_0x123ff8['push'](_0x123ff8['shift']());}};_0x2d8b5e(++_0x2b9a42);}(_0xa552,0x97));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2a55('0x0'));module[_0x2a55('0x1')]={'type':{'type':Sequelize[_0x2a55('0x2')](_0x2a55('0x3'),'variable',_0x2a55('0x4'),_0x2a55('0x5'),_0x2a55('0x6')),'defaultValue':_0x2a55('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2a55('0x7')]},'keyType':{'type':Sequelize[_0x2a55('0x2')](_0x2a55('0x3'),_0x2a55('0x8'),_0x2a55('0x4'))},'keyContent':{'type':Sequelize[_0x2a55('0x7')]},'idField':{'type':Sequelize[_0x2a55('0x7')]},'nameField':{'type':Sequelize[_0x2a55('0x7')]},'customField':{'type':Sequelize[_0x2a55('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2a55('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1c6bdcd..140d380 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 _0xfc0d=['show','params','find','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','end','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x34199d,_0x475d68){var _0x1e9caa=function(_0x55a883){while(--_0x55a883){_0x34199d['push'](_0x34199d['shift']());}};_0x1e9caa(++_0x475d68);}(_0xfc0d,0x17b));var _0xdfc0=function(_0x59f680,_0x339bda){_0x59f680=_0x59f680-0x0;var _0x36f2cf=_0xfc0d[_0x59f680];return _0x36f2cf;};'use strict';var emlformat=require(_0xdfc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfc0('0x1'));var jsonpatch=require(_0xdfc0('0x2'));var rp=require('request-promise');var moment=require(_0xdfc0('0x3'));var BPromise=require(_0xdfc0('0x4'));var Mustache=require(_0xdfc0('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdfc0('0x6'));var fs=require('fs');var fs_extra=require(_0xdfc0('0x7'));var _=require(_0xdfc0('0x8'));var squel=require(_0xdfc0('0x9'));var crypto=require('crypto');var jsforce=require(_0xdfc0('0xa'));var deskjs=require(_0xdfc0('0xb'));var toCsv=require(_0xdfc0('0xc'));var querystring=require(_0xdfc0('0xd'));var Papa=require(_0xdfc0('0xe'));var Redis=require('ioredis');var authService=require(_0xdfc0('0xf'));var qs=require(_0xdfc0('0x10'));var as=require(_0xdfc0('0x11'));var hardwareService=require(_0xdfc0('0x12'));var logger=require(_0xdfc0('0x13'))(_0xdfc0('0x14'));var utils=require(_0xdfc0('0x15'));var config=require(_0xdfc0('0x16'));var licenseUtil=require(_0xdfc0('0x17'));var db=require(_0xdfc0('0x18'))['db'];function respondWithStatusCode(_0x1b30f0,_0x86b381){_0x86b381=_0x86b381||0xcc;return function(_0x5a048d){if(_0x5a048d){return _0x1b30f0[_0xdfc0('0x19')](_0x86b381);}return _0x1b30f0[_0xdfc0('0x1a')](_0x86b381)['end']();};}function respondWithResult(_0x4a86e8,_0x1c69cd){_0x1c69cd=_0x1c69cd||0xc8;return function(_0xdf6eac){if(_0xdf6eac){return _0x4a86e8[_0xdfc0('0x1a')](_0x1c69cd)['json'](_0xdf6eac);}};}function respondWithFilteredResult(_0x23d15c,_0x46b27d){return function(_0x12c87f){if(_0x12c87f){var _0x3189db=typeof _0x46b27d[_0xdfc0('0x1b')]===_0xdfc0('0x1c')&&typeof _0x46b27d[_0xdfc0('0x1d')]===_0xdfc0('0x1c');var _0x3a8f9a=_0x12c87f['count'];var _0x14bade=_0x3189db?0x0:_0x46b27d['offset'];var _0x32d4c1=_0x3189db?_0x12c87f[_0xdfc0('0x1e')]:_0x46b27d[_0xdfc0('0x1b')]+_0x46b27d['limit'];var _0x174fe4;if(_0x32d4c1>=_0x3a8f9a){_0x32d4c1=_0x3a8f9a;_0x174fe4=0xc8;}else{_0x174fe4=0xce;}_0x23d15c[_0xdfc0('0x1a')](_0x174fe4);return _0x23d15c['set'](_0xdfc0('0x1f'),_0x14bade+'-'+_0x32d4c1+'/'+_0x3a8f9a)[_0xdfc0('0x20')](_0x12c87f);}return null;};}function patchUpdates(_0x520f5e){return function(_0xb0efcd){try{jsonpatch[_0xdfc0('0x21')](_0xb0efcd,_0x520f5e,!![]);}catch(_0x2451a8){return BPromise[_0xdfc0('0x22')](_0x2451a8);}return _0xb0efcd['save']();};}function saveUpdates(_0x3e8490,_0x449415){return function(_0x2c48fd){if(_0x2c48fd){return _0x2c48fd[_0xdfc0('0x23')](_0x3e8490)['then'](function(_0x4e1ed9){return _0x4e1ed9;});}return null;};}function removeEntity(_0x1be6e6,_0x472768){return function(_0xe13a1c){if(_0xe13a1c){return _0xe13a1c[_0xdfc0('0x24')]()[_0xdfc0('0x25')](function(){_0x1be6e6[_0xdfc0('0x1a')](0xcc)[_0xdfc0('0x26')]();});}};}function handleEntityNotFound(_0x113a81,_0x3918cd){return function(_0xdb303f){if(!_0xdb303f){_0x113a81['sendStatus'](0x194);}return _0xdb303f;};}function handleError(_0x4d19da,_0xb52a79){_0xb52a79=_0xb52a79||0x1f4;return function(_0x444446){logger[_0xdfc0('0x27')](_0x444446[_0xdfc0('0x28')]);if(_0x444446[_0xdfc0('0x29')]){delete _0x444446['name'];}_0x4d19da['status'](_0xb52a79)[_0xdfc0('0x2a')](_0x444446);};}exports['index']=function(_0x30e4f2,_0x16f953){var _0x14ee3a={},_0x5199a7={},_0x3d721d={'count':0x0,'rows':[]};var _0x3e39f5=_[_0xdfc0('0x2b')](db[_0xdfc0('0x2c')][_0xdfc0('0x2d')],function(_0x1b9156){return{'name':_0x1b9156[_0xdfc0('0x2e')],'type':_0x1b9156[_0xdfc0('0x2f')][_0xdfc0('0x30')]};});_0x5199a7[_0xdfc0('0x31')]=_[_0xdfc0('0x2b')](_0x3e39f5,'name');_0x5199a7[_0xdfc0('0x32')]=_[_0xdfc0('0x33')](_0x30e4f2[_0xdfc0('0x32')]);_0x5199a7[_0xdfc0('0x34')]=_[_0xdfc0('0x35')](_0x5199a7[_0xdfc0('0x31')],_0x5199a7[_0xdfc0('0x32')]);_0x14ee3a[_0xdfc0('0x36')]=_[_0xdfc0('0x35')](_0x5199a7['model'],qs[_0xdfc0('0x37')](_0x30e4f2['query'][_0xdfc0('0x37')]));_0x14ee3a[_0xdfc0('0x36')]=_0x14ee3a[_0xdfc0('0x36')][_0xdfc0('0x38')]?_0x14ee3a[_0xdfc0('0x36')]:_0x5199a7['model'];if(!_0x30e4f2[_0xdfc0('0x32')][_0xdfc0('0x39')](_0xdfc0('0x3a'))){_0x14ee3a[_0xdfc0('0x1d')]=qs[_0xdfc0('0x1d')](_0x30e4f2[_0xdfc0('0x32')][_0xdfc0('0x1d')]);_0x14ee3a[_0xdfc0('0x1b')]=qs[_0xdfc0('0x1b')](_0x30e4f2[_0xdfc0('0x32')][_0xdfc0('0x1b')]);}_0x14ee3a[_0xdfc0('0x3b')]=qs[_0xdfc0('0x3c')](_0x30e4f2[_0xdfc0('0x32')][_0xdfc0('0x3c')]);_0x14ee3a[_0xdfc0('0x3d')]=qs[_0xdfc0('0x34')](_['pick'](_0x30e4f2[_0xdfc0('0x32')],_0x5199a7[_0xdfc0('0x34')]),_0x3e39f5);if(_0x30e4f2[_0xdfc0('0x32')]['filter']){_0x14ee3a[_0xdfc0('0x3d')]=_['merge'](_0x14ee3a['where'],{'$or':_[_0xdfc0('0x2b')](_0x3e39f5,function(_0x207fd4){if(_0x207fd4[_0xdfc0('0x2f')]!==_0xdfc0('0x3e')){var _0xcb17f7={};_0xcb17f7[_0x207fd4[_0xdfc0('0x29')]]={'$like':'%'+_0x30e4f2[_0xdfc0('0x32')][_0xdfc0('0x3f')]+'%'};return _0xcb17f7;}})});}_0x14ee3a=_[_0xdfc0('0x40')]({},_0x14ee3a,_0x30e4f2[_0xdfc0('0x41')]);var _0x13e27b={'where':_0x14ee3a[_0xdfc0('0x3d')]};return db[_0xdfc0('0x2c')]['count'](_0x13e27b)['then'](function(_0x4403e3){_0x3d721d['count']=_0x4403e3;if(_0x30e4f2[_0xdfc0('0x32')][_0xdfc0('0x42')]){_0x14ee3a[_0xdfc0('0x43')]=[{'all':!![]}];}return db[_0xdfc0('0x2c')][_0xdfc0('0x44')](_0x14ee3a);})[_0xdfc0('0x25')](function(_0x463e87){_0x3d721d[_0xdfc0('0x45')]=_0x463e87;return _0x3d721d;})[_0xdfc0('0x25')](respondWithFilteredResult(_0x16f953,_0x14ee3a))[_0xdfc0('0x46')](handleError(_0x16f953,null));};exports[_0xdfc0('0x47')]=function(_0x49ba6c,_0x53b13d){var _0x100024={'raw':!![],'where':{'id':_0x49ba6c[_0xdfc0('0x48')]['id']}},_0x43882f={};_0x43882f['model']=_[_0xdfc0('0x33')](db[_0xdfc0('0x2c')][_0xdfc0('0x2d')]);_0x43882f[_0xdfc0('0x32')]=_[_0xdfc0('0x33')](_0x49ba6c[_0xdfc0('0x32')]);_0x43882f[_0xdfc0('0x34')]=_[_0xdfc0('0x35')](_0x43882f[_0xdfc0('0x31')],_0x43882f[_0xdfc0('0x32')]);_0x100024[_0xdfc0('0x36')]=_[_0xdfc0('0x35')](_0x43882f['model'],qs['fields'](_0x49ba6c[_0xdfc0('0x32')][_0xdfc0('0x37')]));_0x100024[_0xdfc0('0x36')]=_0x100024[_0xdfc0('0x36')][_0xdfc0('0x38')]?_0x100024['attributes']:_0x43882f[_0xdfc0('0x31')];if(_0x49ba6c[_0xdfc0('0x32')]['includeAll']){_0x100024['include']=[{'all':!![]}];}_0x100024=_['merge']({},_0x100024,_0x49ba6c[_0xdfc0('0x41')]);return db[_0xdfc0('0x2c')][_0xdfc0('0x49')](_0x100024)['then'](handleEntityNotFound(_0x53b13d,null))[_0xdfc0('0x25')](respondWithResult(_0x53b13d,null))[_0xdfc0('0x46')](handleError(_0x53b13d,null));};exports['create']=function(_0x475b55,_0x47c698){return db['ZendeskField']['create'](_0x475b55[_0xdfc0('0x4a')],{})['then'](respondWithResult(_0x47c698,0xc9))['catch'](handleError(_0x47c698,null));};exports[_0xdfc0('0x23')]=function(_0x4a2700,_0x403ced){if(_0x4a2700[_0xdfc0('0x4a')]['id']){delete _0x4a2700[_0xdfc0('0x4a')]['id'];}return db[_0xdfc0('0x2c')][_0xdfc0('0x49')]({'where':{'id':_0x4a2700['params']['id']}})[_0xdfc0('0x25')](handleEntityNotFound(_0x403ced,null))['then'](saveUpdates(_0x4a2700[_0xdfc0('0x4a')],null))['then'](respondWithResult(_0x403ced,null))[_0xdfc0('0x46')](handleError(_0x403ced,null));};exports[_0xdfc0('0x24')]=function(_0x5aa15b,_0x5acd43){return db[_0xdfc0('0x2c')]['find']({'where':{'id':_0x5aa15b[_0xdfc0('0x48')]['id']}})[_0xdfc0('0x25')](handleEntityNotFound(_0x5acd43,null))[_0xdfc0('0x25')](removeEntity(_0x5acd43,null))[_0xdfc0('0x46')](handleError(_0x5acd43,null));}; \ No newline at end of file +var _0x08fd=['query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','include','create','update','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','stack','name','index','map','ZendeskField','rawAttributes','fieldName','key','model'];(function(_0x26a1d6,_0x1d7e93){var _0x228122=function(_0x529fb3){while(--_0x529fb3){_0x26a1d6['push'](_0x26a1d6['shift']());}};_0x228122(++_0x1d7e93);}(_0x08fd,0xa6));var _0xd08f=function(_0x55f34a,_0x4c8897){_0x55f34a=_0x55f34a-0x0;var _0x56efe4=_0x08fd[_0x55f34a];return _0x56efe4;};'use strict';var emlformat=require(_0xd08f('0x0'));var rimraf=require(_0xd08f('0x1'));var zipdir=require(_0xd08f('0x2'));var jsonpatch=require(_0xd08f('0x3'));var rp=require('request-promise');var moment=require(_0xd08f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd08f('0x5'));var path=require(_0xd08f('0x6'));var sox=require(_0xd08f('0x7'));var csv=require(_0xd08f('0x8'));var ejs=require(_0xd08f('0x9'));var fs=require('fs');var fs_extra=require(_0xd08f('0xa'));var _=require('lodash');var squel=require(_0xd08f('0xb'));var crypto=require(_0xd08f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd08f('0x8'));var querystring=require(_0xd08f('0xd'));var Papa=require(_0xd08f('0xe'));var Redis=require(_0xd08f('0xf'));var authService=require(_0xd08f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd08f('0x11'));var logger=require('../../config/logger')(_0xd08f('0x12'));var utils=require('../../config/utils');var config=require(_0xd08f('0x13'));var licenseUtil=require(_0xd08f('0x14'));var db=require(_0xd08f('0x15'))['db'];function respondWithStatusCode(_0x3e8c38,_0x3f6136){_0x3f6136=_0x3f6136||0xcc;return function(_0x15664b){if(_0x15664b){return _0x3e8c38[_0xd08f('0x16')](_0x3f6136);}return _0x3e8c38[_0xd08f('0x17')](_0x3f6136)[_0xd08f('0x18')]();};}function respondWithResult(_0x59c987,_0x4c2fc3){_0x4c2fc3=_0x4c2fc3||0xc8;return function(_0x1bc5a0){if(_0x1bc5a0){return _0x59c987['status'](_0x4c2fc3)[_0xd08f('0x19')](_0x1bc5a0);}};}function respondWithFilteredResult(_0x136dbe,_0x58fd99){return function(_0x2027db){if(_0x2027db){var _0x36299d=typeof _0x58fd99[_0xd08f('0x1a')]===_0xd08f('0x1b')&&typeof _0x58fd99[_0xd08f('0x1c')]===_0xd08f('0x1b');var _0x2b5146=_0x2027db['count'];var _0x164c45=_0x36299d?0x0:_0x58fd99['offset'];var _0x513ce5=_0x36299d?_0x2027db[_0xd08f('0x1d')]:_0x58fd99[_0xd08f('0x1a')]+_0x58fd99[_0xd08f('0x1c')];var _0x29bdc9;if(_0x513ce5>=_0x2b5146){_0x513ce5=_0x2b5146;_0x29bdc9=0xc8;}else{_0x29bdc9=0xce;}_0x136dbe[_0xd08f('0x17')](_0x29bdc9);return _0x136dbe[_0xd08f('0x1e')](_0xd08f('0x1f'),_0x164c45+'-'+_0x513ce5+'/'+_0x2b5146)['json'](_0x2027db);}return null;};}function patchUpdates(_0x52622b){return function(_0x7032c1){try{jsonpatch[_0xd08f('0x20')](_0x7032c1,_0x52622b,!![]);}catch(_0x50d4ea){return BPromise[_0xd08f('0x21')](_0x50d4ea);}return _0x7032c1['save']();};}function saveUpdates(_0x66f5d2,_0x480465){return function(_0x304c84){if(_0x304c84){return _0x304c84['update'](_0x66f5d2)[_0xd08f('0x22')](function(_0x2a86aa){return _0x2a86aa;});}return null;};}function removeEntity(_0x1ae8a6,_0x94940b){return function(_0x2107a0){if(_0x2107a0){return _0x2107a0['destroy']()['then'](function(){_0x1ae8a6[_0xd08f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11f558,_0x3d9635){return function(_0x1fe448){if(!_0x1fe448){_0x11f558[_0xd08f('0x16')](0x194);}return _0x1fe448;};}function handleError(_0x14010d,_0x1f3676){_0x1f3676=_0x1f3676||0x1f4;return function(_0x2d9dc5){logger['error'](_0x2d9dc5[_0xd08f('0x23')]);if(_0x2d9dc5[_0xd08f('0x24')]){delete _0x2d9dc5['name'];}_0x14010d[_0xd08f('0x17')](_0x1f3676)['send'](_0x2d9dc5);};}exports[_0xd08f('0x25')]=function(_0x575f73,_0x44ead6){var _0x27d048={},_0xde2de4={},_0x39b86a={'count':0x0,'rows':[]};var _0x1786ae=_[_0xd08f('0x26')](db[_0xd08f('0x27')][_0xd08f('0x28')],function(_0x4517db){return{'name':_0x4517db[_0xd08f('0x29')],'type':_0x4517db['type'][_0xd08f('0x2a')]};});_0xde2de4[_0xd08f('0x2b')]=_[_0xd08f('0x26')](_0x1786ae,_0xd08f('0x24'));_0xde2de4[_0xd08f('0x2c')]=_[_0xd08f('0x2d')](_0x575f73[_0xd08f('0x2c')]);_0xde2de4['filters']=_[_0xd08f('0x2e')](_0xde2de4[_0xd08f('0x2b')],_0xde2de4[_0xd08f('0x2c')]);_0x27d048['attributes']=_[_0xd08f('0x2e')](_0xde2de4[_0xd08f('0x2b')],qs[_0xd08f('0x2f')](_0x575f73['query'][_0xd08f('0x2f')]));_0x27d048[_0xd08f('0x30')]=_0x27d048[_0xd08f('0x30')][_0xd08f('0x31')]?_0x27d048['attributes']:_0xde2de4['model'];if(!_0x575f73[_0xd08f('0x2c')][_0xd08f('0x32')]('nolimit')){_0x27d048[_0xd08f('0x1c')]=qs[_0xd08f('0x1c')](_0x575f73[_0xd08f('0x2c')][_0xd08f('0x1c')]);_0x27d048['offset']=qs[_0xd08f('0x1a')](_0x575f73[_0xd08f('0x2c')][_0xd08f('0x1a')]);}_0x27d048[_0xd08f('0x33')]=qs[_0xd08f('0x34')](_0x575f73['query'][_0xd08f('0x34')]);_0x27d048[_0xd08f('0x35')]=qs[_0xd08f('0x36')](_[_0xd08f('0x37')](_0x575f73[_0xd08f('0x2c')],_0xde2de4[_0xd08f('0x36')]),_0x1786ae);if(_0x575f73[_0xd08f('0x2c')]['filter']){_0x27d048[_0xd08f('0x35')]=_[_0xd08f('0x38')](_0x27d048[_0xd08f('0x35')],{'$or':_['map'](_0x1786ae,function(_0x4b3733){if(_0x4b3733[_0xd08f('0x39')]!==_0xd08f('0x3a')){var _0x384c4a={};_0x384c4a[_0x4b3733[_0xd08f('0x24')]]={'$like':'%'+_0x575f73['query']['filter']+'%'};return _0x384c4a;}})});}_0x27d048=_[_0xd08f('0x38')]({},_0x27d048,_0x575f73[_0xd08f('0x3b')]);var _0x214f6d={'where':_0x27d048[_0xd08f('0x35')]};return db['ZendeskField']['count'](_0x214f6d)[_0xd08f('0x22')](function(_0x4e9ad9){_0x39b86a[_0xd08f('0x1d')]=_0x4e9ad9;if(_0x575f73['query'][_0xd08f('0x3c')]){_0x27d048['include']=[{'all':!![]}];}return db[_0xd08f('0x27')][_0xd08f('0x3d')](_0x27d048);})[_0xd08f('0x22')](function(_0x806f31){_0x39b86a['rows']=_0x806f31;return _0x39b86a;})['then'](respondWithFilteredResult(_0x44ead6,_0x27d048))[_0xd08f('0x3e')](handleError(_0x44ead6,null));};exports['show']=function(_0x577c82,_0x158a2b){var _0x3ca9ef={'raw':!![],'where':{'id':_0x577c82[_0xd08f('0x3f')]['id']}},_0x19d207={};_0x19d207[_0xd08f('0x2b')]=_[_0xd08f('0x2d')](db[_0xd08f('0x27')][_0xd08f('0x28')]);_0x19d207[_0xd08f('0x2c')]=_[_0xd08f('0x2d')](_0x577c82[_0xd08f('0x2c')]);_0x19d207[_0xd08f('0x36')]=_[_0xd08f('0x2e')](_0x19d207[_0xd08f('0x2b')],_0x19d207[_0xd08f('0x2c')]);_0x3ca9ef[_0xd08f('0x30')]=_['intersection'](_0x19d207[_0xd08f('0x2b')],qs[_0xd08f('0x2f')](_0x577c82[_0xd08f('0x2c')][_0xd08f('0x2f')]));_0x3ca9ef['attributes']=_0x3ca9ef[_0xd08f('0x30')][_0xd08f('0x31')]?_0x3ca9ef['attributes']:_0x19d207[_0xd08f('0x2b')];if(_0x577c82[_0xd08f('0x2c')][_0xd08f('0x3c')]){_0x3ca9ef[_0xd08f('0x40')]=[{'all':!![]}];}_0x3ca9ef=_['merge']({},_0x3ca9ef,_0x577c82[_0xd08f('0x3b')]);return db['ZendeskField']['find'](_0x3ca9ef)[_0xd08f('0x22')](handleEntityNotFound(_0x158a2b,null))[_0xd08f('0x22')](respondWithResult(_0x158a2b,null))[_0xd08f('0x3e')](handleError(_0x158a2b,null));};exports['create']=function(_0x36272c,_0x987f4b){return db[_0xd08f('0x27')][_0xd08f('0x41')](_0x36272c['body'],{})[_0xd08f('0x22')](respondWithResult(_0x987f4b,0xc9))['catch'](handleError(_0x987f4b,null));};exports[_0xd08f('0x42')]=function(_0x4e1ef8,_0x583981){if(_0x4e1ef8[_0xd08f('0x43')]['id']){delete _0x4e1ef8['body']['id'];}return db[_0xd08f('0x27')][_0xd08f('0x44')]({'where':{'id':_0x4e1ef8['params']['id']}})[_0xd08f('0x22')](handleEntityNotFound(_0x583981,null))['then'](saveUpdates(_0x4e1ef8['body'],null))[_0xd08f('0x22')](respondWithResult(_0x583981,null))['catch'](handleError(_0x583981,null));};exports[_0xd08f('0x45')]=function(_0x4eeb22,_0x1ba976){return db[_0xd08f('0x27')][_0xd08f('0x44')]({'where':{'id':_0x4eeb22[_0xd08f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1ba976,null))[_0xd08f('0x22')](removeEntity(_0x1ba976,null))[_0xd08f('0x3e')](handleError(_0x1ba976,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e7f6392..00a1bfe 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 _0x4de1=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','zendesk_unique_index','idField'];(function(_0xa2b098,_0x461a08){var _0x29502e=function(_0x43291a){while(--_0x43291a){_0xa2b098['push'](_0xa2b098['shift']());}};_0x29502e(++_0x461a08);}(_0x4de1,0x168));var _0x14de=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x4de1[_0x2faddb];return _0x273c05;};'use strict';var _=require('lodash');var util=require(_0x14de('0x0'));var logger=require(_0x14de('0x1'))(_0x14de('0x2'));var moment=require(_0x14de('0x3'));var BPromise=require(_0x14de('0x4'));var rp=require(_0x14de('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x14de('0x6'));var attributes=require(_0x14de('0x7'));module[_0x14de('0x8')]=function(_0x47f0d1,_0x2e75f1){return _0x47f0d1['define'](_0x14de('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x14de('0xa'),'fields':[_0x14de('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3087=['int_zendesk_fields','zendesk_unique_index','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define'];(function(_0x16e7bf,_0x182a1e){var _0x12d53b=function(_0x419649){while(--_0x419649){_0x16e7bf['push'](_0x16e7bf['shift']());}};_0x12d53b(++_0x182a1e);}(_0x3087,0x161));var _0x7308=function(_0x3626a7,_0x4e9617){_0x3626a7=_0x3626a7-0x0;var _0x103447=_0x3087[_0x3626a7];return _0x103447;};'use strict';var _=require(_0x7308('0x0'));var util=require(_0x7308('0x1'));var logger=require('../../config/logger')(_0x7308('0x2'));var moment=require(_0x7308('0x3'));var BPromise=require(_0x7308('0x4'));var rp=require(_0x7308('0x5'));var fs=require('fs');var path=require(_0x7308('0x6'));var rimraf=require(_0x7308('0x7'));var config=require('../../config/environment');var attributes=require(_0x7308('0x8'));module[_0x7308('0x9')]=function(_0x49df73,_0x190d27){return _0x49df73[_0x7308('0xa')]('ZendeskField',attributes,{'tableName':_0x7308('0xb'),'paranoid':![],'indexes':[{'name':_0x7308('0xc'),'fields':['idField','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 fc2e47c..3f0032e 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 _0xae25=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x494452,_0x5b9635){var _0x456e08=function(_0xf79cd4){while(--_0xf79cd4){_0x494452['push'](_0x494452['shift']());}};_0x456e08(++_0x5b9635);}(_0xae25,0xa4));var _0x5ae2=function(_0x16d983,_0x35fe9d){_0x16d983=_0x16d983-0x0;var _0x3902a9=_0xae25[_0x16d983];return _0x3902a9;};'use strict';var _=require(_0x5ae2('0x0'));var util=require(_0x5ae2('0x1'));var moment=require('moment');var BPromise=require(_0x5ae2('0x2'));var rs=require(_0x5ae2('0x3'));var fs=require('fs');var Redis=require(_0x5ae2('0x4'));var db=require(_0x5ae2('0x5'))['db'];var utils=require(_0x5ae2('0x6'));var logger=require(_0x5ae2('0x7'))(_0x5ae2('0x8'));var config=require(_0x5ae2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5ae2('0xa')][_0x5ae2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc712aa,_0x1850c5,_0x4fc6d6){return new BPromise(function(_0x32e28f,_0x5a4526){return client['request'](_0xc712aa,_0x4fc6d6)['then'](function(_0x2e486f){logger[_0x5ae2('0xc')](_0x5ae2('0xd'),_0x1850c5,_0x5ae2('0xe'));logger[_0x5ae2('0xf')](_0x5ae2('0x10'),_0x1850c5,_0x5ae2('0xe'),JSON[_0x5ae2('0x11')](_0x2e486f));if(_0x2e486f[_0x5ae2('0x12')]){if(_0x2e486f[_0x5ae2('0x12')][_0x5ae2('0x13')]===0x1f4){logger[_0x5ae2('0x12')](_0x5ae2('0xd'),_0x1850c5,_0x2e486f[_0x5ae2('0x12')][_0x5ae2('0x14')]);return _0x5a4526(_0x2e486f['error'][_0x5ae2('0x14')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x1850c5,_0x2e486f[_0x5ae2('0x12')][_0x5ae2('0x14')]);return _0x32e28f(_0x2e486f[_0x5ae2('0x12')][_0x5ae2('0x14')]);}else{logger[_0x5ae2('0xc')](_0x5ae2('0xd'),_0x1850c5,_0x5ae2('0xe'));_0x32e28f(_0x2e486f[_0x5ae2('0x15')][_0x5ae2('0x14')]);}})[_0x5ae2('0x16')](function(_0x2567ca){logger[_0x5ae2('0x12')](_0x5ae2('0xd'),_0x1850c5,_0x2567ca);_0x5a4526(_0x2567ca);});});} \ No newline at end of file +var _0x0b4e=['stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0x0b4e,0xf6));var _0xe0b4=function(_0x225e06,_0x41a798){_0x225e06=_0x225e06-0x0;var _0x2b4046=_0x0b4e[_0x225e06];return _0x2b4046;};'use strict';var _=require(_0xe0b4('0x0'));var util=require(_0xe0b4('0x1'));var moment=require(_0xe0b4('0x2'));var BPromise=require(_0xe0b4('0x3'));var rs=require(_0xe0b4('0x4'));var fs=require('fs');var Redis=require(_0xe0b4('0x5'));var db=require(_0xe0b4('0x6'))['db'];var utils=require(_0xe0b4('0x7'));var logger=require(_0xe0b4('0x8'))(_0xe0b4('0x9'));var config=require('../../config/environment');var jayson=require(_0xe0b4('0xa'));var client=jayson[_0xe0b4('0xb')][_0xe0b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42ba0e,_0x3055e6,_0x39e202){return new BPromise(function(_0x40020d,_0x305824){return client[_0xe0b4('0xd')](_0x42ba0e,_0x39e202)[_0xe0b4('0xe')](function(_0x2b3208){logger[_0xe0b4('0xf')](_0xe0b4('0x10'),_0x3055e6,_0xe0b4('0x11'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x3055e6,_0xe0b4('0x11'),JSON[_0xe0b4('0x12')](_0x2b3208));if(_0x2b3208[_0xe0b4('0x13')]){if(_0x2b3208[_0xe0b4('0x13')]['code']===0x1f4){logger[_0xe0b4('0x13')]('ZendeskField,\x20%s,\x20%s',_0x3055e6,_0x2b3208[_0xe0b4('0x13')][_0xe0b4('0x14')]);return _0x305824(_0x2b3208[_0xe0b4('0x13')][_0xe0b4('0x14')]);}logger[_0xe0b4('0x13')]('ZendeskField,\x20%s,\x20%s',_0x3055e6,_0x2b3208['error'][_0xe0b4('0x14')]);return _0x40020d(_0x2b3208[_0xe0b4('0x13')][_0xe0b4('0x14')]);}else{logger[_0xe0b4('0xf')](_0xe0b4('0x10'),_0x3055e6,_0xe0b4('0x11'));_0x40020d(_0x2b3208['result'][_0xe0b4('0x14')]);}})[_0xe0b4('0x15')](function(_0x53260d){logger[_0xe0b4('0x13')](_0xe0b4('0x10'),_0x3055e6,_0x53260d);_0x305824(_0x53260d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index bf8233d..706d349 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 _0xdfa4=['path','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','delete','destroy','exports','multer','util'];(function(_0x56054c,_0x5be6b8){var _0x4b5e7c=function(_0x40366f){while(--_0x40366f){_0x56054c['push'](_0x56054c['shift']());}};_0x4b5e7c(++_0x5be6b8);}(_0xdfa4,0x139));var _0x4dfa=function(_0x50a006,_0x6b2dc0){_0x50a006=_0x50a006-0x0;var _0x5ca575=_0xdfa4[_0x50a006];return _0x5ca575;};'use strict';var multer=require(_0x4dfa('0x0'));var util=require(_0x4dfa('0x1'));var path=require(_0x4dfa('0x2'));var timeout=require('connect-timeout');var express=require(_0x4dfa('0x3'));var router=express[_0x4dfa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4dfa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4dfa('0x6'));var controller=require(_0x4dfa('0x7'));router[_0x4dfa('0x8')]('/',auth[_0x4dfa('0x9')](),controller[_0x4dfa('0xa')]);router[_0x4dfa('0x8')](_0x4dfa('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4dfa('0x8')](_0x4dfa('0xc'),auth[_0x4dfa('0x9')](),controller[_0x4dfa('0xd')]);router[_0x4dfa('0x8')](_0x4dfa('0xe'),auth[_0x4dfa('0x9')](),controller[_0x4dfa('0xf')]);router['post']('/',auth[_0x4dfa('0x9')](),controller['create']);router[_0x4dfa('0x10')](_0x4dfa('0xc'),auth[_0x4dfa('0x9')](),controller[_0x4dfa('0x11')]);router['put'](_0x4dfa('0xb'),auth[_0x4dfa('0x9')](),controller['update']);router[_0x4dfa('0x12')](_0x4dfa('0xb'),auth[_0x4dfa('0x9')](),controller[_0x4dfa('0x13')]);module[_0x4dfa('0x14')]=router; \ No newline at end of file +var _0x38da=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','create','post','put','update','delete','/:id','destroy','multer'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x38da,0x92));var _0xa38d=function(_0x5519e0,_0xec8f68){_0x5519e0=_0x5519e0-0x0;var _0x14dfb2=_0x38da[_0x5519e0];return _0x14dfb2;};'use strict';var multer=require(_0xa38d('0x0'));var util=require('util');var path=require(_0xa38d('0x1'));var timeout=require(_0xa38d('0x2'));var express=require(_0xa38d('0x3'));var router=express['Router']();var fs_extra=require(_0xa38d('0x4'));var auth=require(_0xa38d('0x5'));var interaction=require(_0xa38d('0x6'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xa38d('0x7')]('/',auth[_0xa38d('0x8')](),controller[_0xa38d('0x9')]);router[_0xa38d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa38d('0xa')]);router[_0xa38d('0x7')](_0xa38d('0xb'),auth[_0xa38d('0x8')](),controller['getConfigurations']);router[_0xa38d('0x7')](_0xa38d('0xc'),auth[_0xa38d('0x8')](),controller[_0xa38d('0xd')]);router['post']('/',auth[_0xa38d('0x8')](),controller[_0xa38d('0xe')]);router[_0xa38d('0xf')](_0xa38d('0xb'),auth[_0xa38d('0x8')](),controller['addConfiguration']);router[_0xa38d('0x10')]('/:id',auth[_0xa38d('0x8')](),controller[_0xa38d('0x11')]);router[_0xa38d('0x12')](_0xa38d('0x13'),auth[_0xa38d('0x8')](),controller[_0xa38d('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index a6ed395..58fb49a 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 _0x9a19=['sequelize','exports','STRING'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x9a19,0x114));var _0x99a1=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9a19[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'name':{'type':Sequelize[_0x99a1('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x99a1('0x2')]},'zone':{'type':Sequelize[_0x99a1('0x2')]},'clientId':{'type':Sequelize[_0x99a1('0x2')]},'clientSecret':{'type':Sequelize[_0x99a1('0x2')]},'serverUrl':{'type':Sequelize[_0x99a1('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x99a1('0x2')]},'refreshToken':{'type':Sequelize[_0x99a1('0x2')]}}; \ No newline at end of file +var _0x4c4e=['sequelize','STRING'];(function(_0x2ad2f3,_0x3a6a7c){var _0x9eac9e=function(_0x4c0170){while(--_0x4c0170){_0x2ad2f3['push'](_0x2ad2f3['shift']());}};_0x9eac9e(++_0x3a6a7c);}(_0x4c4e,0x152));var _0xe4c4=function(_0x1ff540,_0x359d73){_0x1ff540=_0x1ff540-0x0;var _0x1ea6db=_0x4c4e[_0x1ff540];return _0x1ea6db;};'use strict';var Sequelize=require(_0xe4c4('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4c4('0x1')]},'description':{'type':Sequelize[_0xe4c4('0x1')]},'host':{'type':Sequelize[_0xe4c4('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe4c4('0x1')]},'clientSecret':{'type':Sequelize[_0xe4c4('0x1')]},'serverUrl':{'type':Sequelize[_0xe4c4('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xe4c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 10daa4b..9db9950 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 _0x83ff=['fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','options','find','create','body','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refresh_token','access_token','getFields','findOne','host','serverUrl','code','refreshToken','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','WhoId','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZohoAccount','rawAttributes'];(function(_0x38913c,_0xa322b0){var _0x43edc6=function(_0x55141c){while(--_0x55141c){_0x38913c['push'](_0x38913c['shift']());}};_0x43edc6(++_0xa322b0);}(_0x83ff,0x14c));var _0xf83f=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x83ff[_0x46d0c9];return _0x174506;};'use strict';var emlformat=require(_0xf83f('0x0'));var rimraf=require(_0xf83f('0x1'));var zipdir=require(_0xf83f('0x2'));var jsonpatch=require(_0xf83f('0x3'));var rp=require('request-promise');var moment=require(_0xf83f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf83f('0x5'));var path=require(_0xf83f('0x6'));var sox=require('sox');var csv=require(_0xf83f('0x7'));var ejs=require(_0xf83f('0x8'));var fs=require('fs');var fs_extra=require(_0xf83f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf83f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf83f('0x7'));var querystring=require(_0xf83f('0xb'));var Papa=require(_0xf83f('0xc'));var Redis=require(_0xf83f('0xd'));var authService=require(_0xf83f('0xe'));var qs=require(_0xf83f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf83f('0x10'));var logger=require(_0xf83f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xf83f('0x12'));var licenseUtil=require(_0xf83f('0x13'));var db=require(_0xf83f('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x527a23,_0x59e0a2){_0x59e0a2=_0x59e0a2||0xcc;return function(_0x32b518){if(_0x32b518){return _0x527a23[_0xf83f('0x15')](_0x59e0a2);}return _0x527a23[_0xf83f('0x16')](_0x59e0a2)['end']();};}function respondWithResult(_0x1f5d17,_0xdf590c){_0xdf590c=_0xdf590c||0xc8;return function(_0x551723){if(_0x551723){return _0x1f5d17[_0xf83f('0x16')](_0xdf590c)[_0xf83f('0x17')](_0x551723);}};}function respondWithFilteredResult(_0x3c394f,_0x3d80c5){return function(_0x1b1e7b){if(_0x1b1e7b){var _0x484a61=typeof _0x3d80c5[_0xf83f('0x18')]==='undefined'&&typeof _0x3d80c5['limit']==='undefined';var _0x36f747=_0x1b1e7b[_0xf83f('0x19')];var _0x1d8deb=_0x484a61?0x0:_0x3d80c5[_0xf83f('0x18')];var _0x3c2c86=_0x484a61?_0x1b1e7b[_0xf83f('0x19')]:_0x3d80c5[_0xf83f('0x18')]+_0x3d80c5[_0xf83f('0x1a')];var _0x17abea;if(_0x3c2c86>=_0x36f747){_0x3c2c86=_0x36f747;_0x17abea=0xc8;}else{_0x17abea=0xce;}_0x3c394f['status'](_0x17abea);return _0x3c394f[_0xf83f('0x1b')]('Content-Range',_0x1d8deb+'-'+_0x3c2c86+'/'+_0x36f747)[_0xf83f('0x17')](_0x1b1e7b);}return null;};}function patchUpdates(_0x964576){return function(_0x137335){try{jsonpatch[_0xf83f('0x1c')](_0x137335,_0x964576,!![]);}catch(_0x47c0b8){return BPromise[_0xf83f('0x1d')](_0x47c0b8);}return _0x137335[_0xf83f('0x1e')]();};}function saveUpdates(_0x1edfed,_0x575668){return function(_0x2a25e6){if(_0x2a25e6){return _0x2a25e6[_0xf83f('0x1f')](_0x1edfed)[_0xf83f('0x20')](function(_0xd42cb0){return _0xd42cb0;});}return null;};}function removeEntity(_0x20c45c,_0x409d4d){return function(_0x52e0c1){if(_0x52e0c1){return _0x52e0c1[_0xf83f('0x21')]()['then'](function(){_0x20c45c['status'](0xcc)[_0xf83f('0x22')]();});}};}function handleEntityNotFound(_0x329fd0,_0x5be43e){return function(_0x25523d){if(!_0x25523d){_0x329fd0[_0xf83f('0x15')](0x194);}return _0x25523d;};}function handleError(_0x6d013f,_0x2819e3){_0x2819e3=_0x2819e3||0x1f4;return function(_0x1074ed){logger[_0xf83f('0x23')](_0x1074ed[_0xf83f('0x24')]);if(_0x1074ed[_0xf83f('0x25')]){delete _0x1074ed['name'];}_0x6d013f[_0xf83f('0x16')](_0x2819e3)[_0xf83f('0x26')](_0x1074ed);};}exports[_0xf83f('0x27')]=function(_0x10b485,_0x196aff){var _0x1c2b2a={},_0xebdada={},_0x56120a={'count':0x0,'rows':[]};var _0x3fe5ce=_[_0xf83f('0x28')](db[_0xf83f('0x29')][_0xf83f('0x2a')],function(_0x5264c3){return{'name':_0x5264c3[_0xf83f('0x2b')],'type':_0x5264c3[_0xf83f('0x2c')][_0xf83f('0x2d')]};});_0xebdada[_0xf83f('0x2e')]=_['map'](_0x3fe5ce,'name');_0xebdada['query']=_[_0xf83f('0x2f')](_0x10b485[_0xf83f('0x30')]);_0xebdada[_0xf83f('0x31')]=_['intersection'](_0xebdada[_0xf83f('0x2e')],_0xebdada[_0xf83f('0x30')]);_0x1c2b2a[_0xf83f('0x32')]=_[_0xf83f('0x33')](_0xebdada[_0xf83f('0x2e')],qs['fields'](_0x10b485[_0xf83f('0x30')][_0xf83f('0x34')]));_0x1c2b2a[_0xf83f('0x32')]=_0x1c2b2a[_0xf83f('0x32')][_0xf83f('0x35')]?_0x1c2b2a[_0xf83f('0x32')]:_0xebdada[_0xf83f('0x2e')];if(!_0x10b485[_0xf83f('0x30')][_0xf83f('0x36')](_0xf83f('0x37'))){_0x1c2b2a[_0xf83f('0x1a')]=qs[_0xf83f('0x1a')](_0x10b485[_0xf83f('0x30')][_0xf83f('0x1a')]);_0x1c2b2a[_0xf83f('0x18')]=qs[_0xf83f('0x18')](_0x10b485[_0xf83f('0x30')][_0xf83f('0x18')]);}_0x1c2b2a[_0xf83f('0x38')]=qs[_0xf83f('0x39')](_0x10b485[_0xf83f('0x30')][_0xf83f('0x39')]);_0x1c2b2a[_0xf83f('0x3a')]=qs[_0xf83f('0x31')](_[_0xf83f('0x3b')](_0x10b485[_0xf83f('0x30')],_0xebdada['filters']),_0x3fe5ce);if(_0x10b485[_0xf83f('0x30')]['filter']){_0x1c2b2a[_0xf83f('0x3a')]=_[_0xf83f('0x3c')](_0x1c2b2a[_0xf83f('0x3a')],{'$or':_[_0xf83f('0x28')](_0x3fe5ce,function(_0x570242){if(_0x570242[_0xf83f('0x2c')]!==_0xf83f('0x3d')){var _0x572f83={};_0x572f83[_0x570242[_0xf83f('0x25')]]={'$like':'%'+_0x10b485['query'][_0xf83f('0x3e')]+'%'};return _0x572f83;}})});}_0x1c2b2a=_[_0xf83f('0x3c')]({},_0x1c2b2a,_0x10b485['options']);var _0x3fb03f={'where':_0x1c2b2a[_0xf83f('0x3a')]};return db[_0xf83f('0x29')][_0xf83f('0x19')](_0x3fb03f)['then'](function(_0x52383c){_0x56120a['count']=_0x52383c;if(_0x10b485[_0xf83f('0x30')][_0xf83f('0x3f')]){_0x1c2b2a[_0xf83f('0x40')]=[{'all':!![]}];}return db[_0xf83f('0x29')][_0xf83f('0x41')](_0x1c2b2a);})[_0xf83f('0x20')](function(_0x533c03){_0x56120a[_0xf83f('0x42')]=_0x533c03;return _0x56120a;})['then'](respondWithFilteredResult(_0x196aff,_0x1c2b2a))[_0xf83f('0x43')](handleError(_0x196aff,null));};exports['show']=function(_0x500f2b,_0x57e436){var _0x1d23d4={'raw':![],'where':{'id':_0x500f2b[_0xf83f('0x44')]['id']}},_0x36ec59={};_0x36ec59[_0xf83f('0x2e')]=_['keys'](db['ZohoAccount'][_0xf83f('0x2a')]);_0x36ec59[_0xf83f('0x30')]=_[_0xf83f('0x2f')](_0x500f2b[_0xf83f('0x30')]);_0x36ec59[_0xf83f('0x31')]=_[_0xf83f('0x33')](_0x36ec59[_0xf83f('0x2e')],_0x36ec59['query']);_0x1d23d4[_0xf83f('0x32')]=_['intersection'](_0x36ec59[_0xf83f('0x2e')],qs[_0xf83f('0x34')](_0x500f2b[_0xf83f('0x30')][_0xf83f('0x34')]));_0x1d23d4[_0xf83f('0x32')]=_0x1d23d4[_0xf83f('0x32')]['length']?_0x1d23d4[_0xf83f('0x32')]:_0x36ec59[_0xf83f('0x2e')];if(_0x500f2b[_0xf83f('0x30')][_0xf83f('0x3f')]){_0x1d23d4[_0xf83f('0x40')]=[{'all':!![]}];}_0x1d23d4=_[_0xf83f('0x3c')]({},_0x1d23d4,_0x500f2b[_0xf83f('0x45')]);return db[_0xf83f('0x29')][_0xf83f('0x46')](_0x1d23d4)[_0xf83f('0x20')](handleEntityNotFound(_0x57e436,null))[_0xf83f('0x20')](respondWithResult(_0x57e436,null))['catch'](handleError(_0x57e436,null));};exports[_0xf83f('0x47')]=function(_0x592995,_0x4c5f9c){return db[_0xf83f('0x29')]['create'](_0x592995['body'],{})['then'](respondWithResult(_0x4c5f9c,0xc9))[_0xf83f('0x43')](handleError(_0x4c5f9c,null));};exports[_0xf83f('0x1f')]=function(_0x1a9cd2,_0x12475d){if(_0x1a9cd2[_0xf83f('0x48')]['id']){delete _0x1a9cd2['body']['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x1a9cd2['params']['id']}})[_0xf83f('0x20')](handleEntityNotFound(_0x12475d,null))[_0xf83f('0x20')](saveUpdates(_0x1a9cd2[_0xf83f('0x48')],null))[_0xf83f('0x20')](respondWithResult(_0x12475d,null))[_0xf83f('0x43')](handleError(_0x12475d,null));};exports[_0xf83f('0x21')]=function(_0xdbe106,_0x475bdf){return db[_0xf83f('0x29')]['find']({'where':{'id':_0xdbe106[_0xf83f('0x44')]['id']}})['then'](handleEntityNotFound(_0x475bdf,null))[_0xf83f('0x20')](removeEntity(_0x475bdf,null))[_0xf83f('0x43')](handleError(_0x475bdf,null));};exports['getConfigurations']=function(_0x29c72e,_0x4b5301,_0x4cc426){var _0x3a40b9={};var _0x58f80f={};var _0x4416f9;var _0xff8952;return db[_0xf83f('0x29')]['findOne']({'where':{'id':_0x29c72e[_0xf83f('0x44')]['id']}})[_0xf83f('0x20')](handleEntityNotFound(_0x4b5301,null))[_0xf83f('0x20')](function(_0x37c0e7){if(_0x37c0e7){_0x4416f9=_0x37c0e7;_0x58f80f['model']=_[_0xf83f('0x2f')](db['ZohoConfiguration'][_0xf83f('0x2a')]);_0x58f80f[_0xf83f('0x30')]=_[_0xf83f('0x2f')](_0x29c72e[_0xf83f('0x30')]);_0x58f80f[_0xf83f('0x31')]=_['intersection'](_0x58f80f[_0xf83f('0x2e')],_0x58f80f[_0xf83f('0x30')]);_0x3a40b9['attributes']=_[_0xf83f('0x33')](_0x58f80f['model'],qs[_0xf83f('0x34')](_0x29c72e[_0xf83f('0x30')][_0xf83f('0x34')]));_0x3a40b9[_0xf83f('0x32')]=_0x3a40b9[_0xf83f('0x32')][_0xf83f('0x35')]?_0x3a40b9[_0xf83f('0x32')]:_0x58f80f[_0xf83f('0x2e')];_0x3a40b9[_0xf83f('0x38')]=qs['sort'](_0x29c72e[_0xf83f('0x30')][_0xf83f('0x39')]);_0x3a40b9[_0xf83f('0x3a')]=qs[_0xf83f('0x31')](_['pick'](_0x29c72e[_0xf83f('0x30')],_0x58f80f['filters']));if(_0x29c72e[_0xf83f('0x30')][_0xf83f('0x3e')]){_0x3a40b9[_0xf83f('0x3a')]=_['merge'](_0x3a40b9[_0xf83f('0x3a')],{'$or':_[_0xf83f('0x28')](_0x3a40b9[_0xf83f('0x32')],function(_0x136b1a){var _0x4a4781={};_0x4a4781[_0x136b1a]={'$like':'%'+_0x29c72e[_0xf83f('0x30')][_0xf83f('0x3e')]+'%'};return _0x4a4781;})});}_0x3a40b9=_[_0xf83f('0x3c')]({},_0x3a40b9,_0x29c72e[_0xf83f('0x45')]);return _0x4416f9['getConfigurations'](_0x3a40b9);}})['then'](function(_0x4e7564){if(_0x4e7564){_0xff8952=_0x4e7564[_0xf83f('0x35')];if(!_0x29c72e[_0xf83f('0x30')]['hasOwnProperty'](_0xf83f('0x37'))){_0x3a40b9[_0xf83f('0x1a')]=qs[_0xf83f('0x1a')](_0x29c72e[_0xf83f('0x30')][_0xf83f('0x1a')]);_0x3a40b9['offset']=qs[_0xf83f('0x18')](_0x29c72e['query'][_0xf83f('0x18')]);}return _0x4416f9[_0xf83f('0x49')](_0x3a40b9);}})[_0xf83f('0x20')](function(_0x109e0a){if(_0x109e0a){return _0x109e0a?{'count':_0xff8952,'rows':_0x109e0a}:null;}})[_0xf83f('0x20')](respondWithResult(_0x4b5301,null))[_0xf83f('0x43')](handleError(_0x4b5301,null));};exports['addConfiguration']=function(_0xf2b683,_0x1aaa61,_0x4969ac){if(_0xf2b683[_0xf83f('0x48')]['id']){delete _0xf2b683[_0xf83f('0x48')]['id'];}return db[_0xf83f('0x29')]['findOne']({'where':{'id':_0xf2b683['params']['id']}})['then'](handleEntityNotFound(_0x1aaa61,null))[_0xf83f('0x20')](function(_0x5774ef){if(_0x5774ef){_0xf2b683[_0xf83f('0x48')][_0xf83f('0x4a')]=_0x5774ef['id'];_0xf2b683['body'][_0xf83f('0x4b')]=integrations[_0xf83f('0x4c')](_0xf2b683[_0xf83f('0x48')][_0xf83f('0x4d')],_0xf2b683[_0xf83f('0x48')][_0xf83f('0x2c')]);_0xf2b683[_0xf83f('0x48')][_0xf83f('0x4e')]=integrations['getDescriptions'](_0xf2b683[_0xf83f('0x48')][_0xf83f('0x4d')],_0xf2b683[_0xf83f('0x48')][_0xf83f('0x2c')]);return db[_0xf83f('0x4f')][_0xf83f('0x47')](_0xf2b683[_0xf83f('0x48')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0xf83f('0x50')],'as':_0xf83f('0x4e')}]});}return null;})['then'](respondWithResult(_0x1aaa61,null))[_0xf83f('0x43')](handleError(_0x1aaa61,null));};function getAccessToken(_0x3b3003){return new Promise(function(_0x599f6d,_0x2c46b2){var _0x1be625;switch(_0x3b3003[_0xf83f('0x51')]){case'US':_0x1be625='https://accounts.zoho.com';break;case'AU':_0x1be625=_0xf83f('0x52');break;case'EU':_0x1be625=_0xf83f('0x53');break;case'IN':_0x1be625='https://accounts.zoho.in';break;case'CN':_0x1be625=_0xf83f('0x54');break;default:_0x1be625='https://accounts.zoho.eu';break;}var _0x3b9629={'method':_0xf83f('0x55'),'uri':_0x1be625+_0xf83f('0x56'),'qs':{'refresh_token':_0x3b3003['refreshToken'],'client_id':_0x3b3003['clientId'],'client_secret':_0x3b3003['clientSecret'],'grant_type':_0xf83f('0x57')},'json':!![]};return rp(_0x3b9629)[_0xf83f('0x20')](function(_0x131802){if(_0x131802['access_token']){_0x599f6d(_0x131802[_0xf83f('0x58')]);}else{_0x2c46b2('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xf83f('0x43')](function(_0x5c7efd){_0x2c46b2(_0x5c7efd);});});}exports[_0xf83f('0x59')]=function(_0x54d16e,_0x5c0bed,_0x4b07ee){var _0x54c94a,_0x2665ff,_0x4cbc86,_0x5f3ea9,_0x5999eb;return db[_0xf83f('0x29')][_0xf83f('0x5a')]({'where':{'id':_0x54d16e[_0xf83f('0x44')]['id']},'attributes':['id',_0xf83f('0x5b'),'zone','clientId','clientSecret',_0xf83f('0x5c'),_0xf83f('0x5d'),_0xf83f('0x5e')]})[_0xf83f('0x20')](handleEntityNotFound(_0x5c0bed,null))['then'](function(_0x2f262c){_0x5999eb=_0x2f262c;_0x54c94a=_0x5999eb[_0xf83f('0x5b')];_0x2665ff=_0x54c94a==='zoho.eu'?'eu':_0xf83f('0x5f');_0x4cbc86=_0x5999eb['serverUrl'];var _0x579ac4=_0x4cbc86[_0xf83f('0x60')](-0x1);if(_0x579ac4==='/'||_0x579ac4==='\x5c'||_0x579ac4===':'){_0x4cbc86=_0x4cbc86[_0xf83f('0x61')](0x0,_0x4cbc86[_0xf83f('0x62')](_0x579ac4));}if(!_0x5999eb[_0xf83f('0x5e')]){throw new Error(_0xf83f('0x63'));}return getAccessToken(_0x5999eb);})[_0xf83f('0x20')](function(_0x1153e8){if(_0x1153e8){return rp({'method':'GET','uri':util[_0xf83f('0x64')](_0xf83f('0x65'),_0x2665ff),'qs':{'module':_0xf83f('0x66')},'headers':{'Authorization':_0xf83f('0x67')+_0x1153e8},'json':!![]});}})[_0xf83f('0x20')](function(_0xc936a1){if(_0xc936a1){if(_0xc936a1[_0xf83f('0x68')]&&_0xc936a1[_0xf83f('0x68')][_0xf83f('0x23')]){throw new Error(_0xc936a1['response'][_0xf83f('0x23')]['message']);}var _0x11fc06=[];var _0x46c687=[];var _0x58c33a=[_0xf83f('0x69'),_0xf83f('0x6a'),'Description',_0xf83f('0x6b'),'Call_Duration',_0xf83f('0x6c'),_0xf83f('0x6d'),'Call_Type'];_0x46c687=_[_0xf83f('0x6e')](_0xc936a1[_0xf83f('0x34')],function(_0x5d328c){return _0x58c33a[_0xf83f('0x6f')](_0x5d328c[_0xf83f('0x70')]);});for(var _0xd87694=0x0;_0xd87694<_0x46c687[_0xf83f('0x35')];_0xd87694++){if(_0x46c687[_0xd87694][_0xf83f('0x71')]===![]){_0x11fc06[_0xf83f('0x72')]({'id':_0x46c687[_0xd87694]['id'],'name':_0x46c687[_0xd87694][_0xf83f('0x73')],'custom':_0x46c687[_0xd87694][_0xf83f('0x74')],'options':_0x46c687[_0xd87694][_0xf83f('0x75')]===_0xf83f('0x76')&&_0x46c687[_0xd87694][_0xf83f('0x77')][_0xf83f('0x35')]>-0x1?_[_0xf83f('0x28')](_0x46c687[_0xd87694][_0xf83f('0x77')],function(_0x59a53c){return{'name':_0x59a53c,'value':_0x59a53c};}):[]});}}return{'count':_0x11fc06['length'],'rows':_0x11fc06};}else{return{'count':0x0,'rows':[]};}})[_0xf83f('0x20')](respondWithResult(_0x5c0bed,null))[_0xf83f('0x43')](function(_0x1a5f69){var _0x32abf6=_0x54d16e['query'][_0xf83f('0x78')]?0x1f4:_0x1a5f69[_0xf83f('0x79')]||0x1f4;logger[_0xf83f('0x23')](_0xf83f('0x7a'),_0xf83f('0x59'),_0x32abf6,JSON[_0xf83f('0x7b')](_0x1a5f69));delete _0x1a5f69[_0xf83f('0x25')];if(_0x32abf6===0x191){_0x32abf6=0x190;}_0x5c0bed['status'](_0x32abf6)[_0xf83f('0x26')](_0x54d16e[_0xf83f('0x30')][_0xf83f('0x78')]?{'message':_0xf83f('0x7c'),'statusCode':_0x1a5f69[_0xf83f('0x79')]}:_0x1a5f69);});}; \ No newline at end of file +var _0xdddf=['Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','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','host','serverUrl','code','zoho.eu','com','substring','lastIndexOf','refreshToken','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','stringify'];(function(_0x3d9bfe,_0x2f64e2){var _0x4c0f42=function(_0x42f8b2){while(--_0x42f8b2){_0x3d9bfe['push'](_0x3d9bfe['shift']());}};_0x4c0f42(++_0x2f64e2);}(_0xdddf,0x111));var _0xfddd=function(_0x51a901,_0x4ec442){_0x51a901=_0x51a901-0x0;var _0x2afea2=_0xdddf[_0x51a901];return _0x2afea2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfddd('0x0'));var jsonpatch=require(_0xfddd('0x1'));var rp=require(_0xfddd('0x2'));var moment=require(_0xfddd('0x3'));var BPromise=require(_0xfddd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfddd('0x5'));var sox=require('sox');var csv=require(_0xfddd('0x6'));var ejs=require(_0xfddd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfddd('0x8'));var squel=require(_0xfddd('0x9'));var crypto=require('crypto');var jsforce=require(_0xfddd('0xa'));var deskjs=require(_0xfddd('0xb'));var toCsv=require(_0xfddd('0x6'));var querystring=require(_0xfddd('0xc'));var Papa=require(_0xfddd('0xd'));var Redis=require(_0xfddd('0xe'));var authService=require(_0xfddd('0xf'));var qs=require(_0xfddd('0x10'));var as=require(_0xfddd('0x11'));var hardwareService=require(_0xfddd('0x12'));var logger=require(_0xfddd('0x13'))(_0xfddd('0x14'));var utils=require(_0xfddd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfddd('0x16'));var db=require(_0xfddd('0x17'))['db'];var integrations=require(_0xfddd('0x18'));function respondWithStatusCode(_0x8539f2,_0xf645){_0xf645=_0xf645||0xcc;return function(_0x2018d8){if(_0x2018d8){return _0x8539f2['sendStatus'](_0xf645);}return _0x8539f2[_0xfddd('0x19')](_0xf645)[_0xfddd('0x1a')]();};}function respondWithResult(_0x4b08f3,_0x4f0024){_0x4f0024=_0x4f0024||0xc8;return function(_0x148b17){if(_0x148b17){return _0x4b08f3[_0xfddd('0x19')](_0x4f0024)[_0xfddd('0x1b')](_0x148b17);}};}function respondWithFilteredResult(_0x270ebf,_0x4690c8){return function(_0x40e757){if(_0x40e757){var _0xf9a378=typeof _0x4690c8[_0xfddd('0x1c')]==='undefined'&&typeof _0x4690c8[_0xfddd('0x1d')]===_0xfddd('0x1e');var _0x193dc8=_0x40e757['count'];var _0x367b81=_0xf9a378?0x0:_0x4690c8['offset'];var _0x416800=_0xf9a378?_0x40e757['count']:_0x4690c8['offset']+_0x4690c8[_0xfddd('0x1d')];var _0xf19fb2;if(_0x416800>=_0x193dc8){_0x416800=_0x193dc8;_0xf19fb2=0xc8;}else{_0xf19fb2=0xce;}_0x270ebf['status'](_0xf19fb2);return _0x270ebf[_0xfddd('0x1f')](_0xfddd('0x20'),_0x367b81+'-'+_0x416800+'/'+_0x193dc8)[_0xfddd('0x1b')](_0x40e757);}return null;};}function patchUpdates(_0x20332f){return function(_0x56dd3e){try{jsonpatch[_0xfddd('0x21')](_0x56dd3e,_0x20332f,!![]);}catch(_0x23ee68){return BPromise[_0xfddd('0x22')](_0x23ee68);}return _0x56dd3e[_0xfddd('0x23')]();};}function saveUpdates(_0xcc3947,_0x1a1ff0){return function(_0x551174){if(_0x551174){return _0x551174['update'](_0xcc3947)[_0xfddd('0x24')](function(_0x53ec1a){return _0x53ec1a;});}return null;};}function removeEntity(_0x5b2eb9,_0x4b7dd8){return function(_0x44ae1d){if(_0x44ae1d){return _0x44ae1d[_0xfddd('0x25')]()['then'](function(){_0x5b2eb9[_0xfddd('0x19')](0xcc)[_0xfddd('0x1a')]();});}};}function handleEntityNotFound(_0x57437e,_0x5518ca){return function(_0x4849e0){if(!_0x4849e0){_0x57437e[_0xfddd('0x26')](0x194);}return _0x4849e0;};}function handleError(_0x1d81f0,_0x137b6f){_0x137b6f=_0x137b6f||0x1f4;return function(_0x2fae0c){logger[_0xfddd('0x27')](_0x2fae0c[_0xfddd('0x28')]);if(_0x2fae0c[_0xfddd('0x29')]){delete _0x2fae0c[_0xfddd('0x29')];}_0x1d81f0[_0xfddd('0x19')](_0x137b6f)[_0xfddd('0x2a')](_0x2fae0c);};}exports[_0xfddd('0x2b')]=function(_0x2f9429,_0x1c97b7){var _0x452fd3={},_0x432b8b={},_0x359853={'count':0x0,'rows':[]};var _0x2af433=_[_0xfddd('0x2c')](db[_0xfddd('0x2d')][_0xfddd('0x2e')],function(_0x43505e){return{'name':_0x43505e['fieldName'],'type':_0x43505e[_0xfddd('0x2f')][_0xfddd('0x30')]};});_0x432b8b[_0xfddd('0x31')]=_['map'](_0x2af433,_0xfddd('0x29'));_0x432b8b[_0xfddd('0x32')]=_[_0xfddd('0x33')](_0x2f9429[_0xfddd('0x32')]);_0x432b8b[_0xfddd('0x34')]=_[_0xfddd('0x35')](_0x432b8b[_0xfddd('0x31')],_0x432b8b[_0xfddd('0x32')]);_0x452fd3['attributes']=_[_0xfddd('0x35')](_0x432b8b[_0xfddd('0x31')],qs[_0xfddd('0x36')](_0x2f9429[_0xfddd('0x32')][_0xfddd('0x36')]));_0x452fd3['attributes']=_0x452fd3['attributes'][_0xfddd('0x37')]?_0x452fd3[_0xfddd('0x38')]:_0x432b8b[_0xfddd('0x31')];if(!_0x2f9429['query']['hasOwnProperty'](_0xfddd('0x39'))){_0x452fd3['limit']=qs[_0xfddd('0x1d')](_0x2f9429['query']['limit']);_0x452fd3[_0xfddd('0x1c')]=qs[_0xfddd('0x1c')](_0x2f9429[_0xfddd('0x32')][_0xfddd('0x1c')]);}_0x452fd3[_0xfddd('0x3a')]=qs['sort'](_0x2f9429[_0xfddd('0x32')][_0xfddd('0x3b')]);_0x452fd3[_0xfddd('0x3c')]=qs[_0xfddd('0x34')](_['pick'](_0x2f9429['query'],_0x432b8b[_0xfddd('0x34')]),_0x2af433);if(_0x2f9429[_0xfddd('0x32')]['filter']){_0x452fd3[_0xfddd('0x3c')]=_[_0xfddd('0x3d')](_0x452fd3[_0xfddd('0x3c')],{'$or':_[_0xfddd('0x2c')](_0x2af433,function(_0x10e740){if(_0x10e740['type']!==_0xfddd('0x3e')){var _0x202085={};_0x202085[_0x10e740[_0xfddd('0x29')]]={'$like':'%'+_0x2f9429[_0xfddd('0x32')][_0xfddd('0x3f')]+'%'};return _0x202085;}})});}_0x452fd3=_['merge']({},_0x452fd3,_0x2f9429[_0xfddd('0x40')]);var _0x263f2e={'where':_0x452fd3[_0xfddd('0x3c')]};return db['ZohoAccount']['count'](_0x263f2e)[_0xfddd('0x24')](function(_0x463013){_0x359853[_0xfddd('0x41')]=_0x463013;if(_0x2f9429[_0xfddd('0x32')]['includeAll']){_0x452fd3[_0xfddd('0x42')]=[{'all':!![]}];}return db[_0xfddd('0x2d')][_0xfddd('0x43')](_0x452fd3);})[_0xfddd('0x24')](function(_0x4d0b88){_0x359853[_0xfddd('0x44')]=_0x4d0b88;return _0x359853;})['then'](respondWithFilteredResult(_0x1c97b7,_0x452fd3))[_0xfddd('0x45')](handleError(_0x1c97b7,null));};exports['show']=function(_0x53bc8c,_0x3f28c9){var _0x222ddd={'raw':![],'where':{'id':_0x53bc8c[_0xfddd('0x46')]['id']}},_0x2c7ff2={};_0x2c7ff2[_0xfddd('0x31')]=_[_0xfddd('0x33')](db[_0xfddd('0x2d')]['rawAttributes']);_0x2c7ff2['query']=_[_0xfddd('0x33')](_0x53bc8c[_0xfddd('0x32')]);_0x2c7ff2[_0xfddd('0x34')]=_[_0xfddd('0x35')](_0x2c7ff2['model'],_0x2c7ff2[_0xfddd('0x32')]);_0x222ddd[_0xfddd('0x38')]=_[_0xfddd('0x35')](_0x2c7ff2['model'],qs[_0xfddd('0x36')](_0x53bc8c[_0xfddd('0x32')]['fields']));_0x222ddd[_0xfddd('0x38')]=_0x222ddd[_0xfddd('0x38')]['length']?_0x222ddd['attributes']:_0x2c7ff2[_0xfddd('0x31')];if(_0x53bc8c['query'][_0xfddd('0x47')]){_0x222ddd[_0xfddd('0x42')]=[{'all':!![]}];}_0x222ddd=_['merge']({},_0x222ddd,_0x53bc8c[_0xfddd('0x40')]);return db['ZohoAccount'][_0xfddd('0x48')](_0x222ddd)[_0xfddd('0x24')](handleEntityNotFound(_0x3f28c9,null))[_0xfddd('0x24')](respondWithResult(_0x3f28c9,null))[_0xfddd('0x45')](handleError(_0x3f28c9,null));};exports[_0xfddd('0x49')]=function(_0x5b9799,_0xd2c672){return db['ZohoAccount'][_0xfddd('0x49')](_0x5b9799[_0xfddd('0x4a')],{})[_0xfddd('0x24')](respondWithResult(_0xd2c672,0xc9))['catch'](handleError(_0xd2c672,null));};exports[_0xfddd('0x4b')]=function(_0xbbb555,_0x266049){if(_0xbbb555[_0xfddd('0x4a')]['id']){delete _0xbbb555[_0xfddd('0x4a')]['id'];}return db['ZohoAccount'][_0xfddd('0x48')]({'where':{'id':_0xbbb555[_0xfddd('0x46')]['id']}})[_0xfddd('0x24')](handleEntityNotFound(_0x266049,null))['then'](saveUpdates(_0xbbb555[_0xfddd('0x4a')],null))['then'](respondWithResult(_0x266049,null))['catch'](handleError(_0x266049,null));};exports['destroy']=function(_0x47daf0,_0x463de6){return db['ZohoAccount'][_0xfddd('0x48')]({'where':{'id':_0x47daf0[_0xfddd('0x46')]['id']}})[_0xfddd('0x24')](handleEntityNotFound(_0x463de6,null))[_0xfddd('0x24')](removeEntity(_0x463de6,null))[_0xfddd('0x45')](handleError(_0x463de6,null));};exports[_0xfddd('0x4c')]=function(_0x5da387,_0x7df68a,_0x20671b){var _0x521b32={};var _0x32a1f3={};var _0x366c7f;var _0x32512a;return db[_0xfddd('0x2d')][_0xfddd('0x4d')]({'where':{'id':_0x5da387[_0xfddd('0x46')]['id']}})[_0xfddd('0x24')](handleEntityNotFound(_0x7df68a,null))['then'](function(_0x1c6f83){if(_0x1c6f83){_0x366c7f=_0x1c6f83;_0x32a1f3[_0xfddd('0x31')]=_['keys'](db[_0xfddd('0x4e')]['rawAttributes']);_0x32a1f3[_0xfddd('0x32')]=_['keys'](_0x5da387['query']);_0x32a1f3[_0xfddd('0x34')]=_[_0xfddd('0x35')](_0x32a1f3[_0xfddd('0x31')],_0x32a1f3[_0xfddd('0x32')]);_0x521b32['attributes']=_['intersection'](_0x32a1f3[_0xfddd('0x31')],qs[_0xfddd('0x36')](_0x5da387[_0xfddd('0x32')][_0xfddd('0x36')]));_0x521b32['attributes']=_0x521b32[_0xfddd('0x38')]['length']?_0x521b32[_0xfddd('0x38')]:_0x32a1f3[_0xfddd('0x31')];_0x521b32[_0xfddd('0x3a')]=qs[_0xfddd('0x3b')](_0x5da387['query']['sort']);_0x521b32['where']=qs['filters'](_[_0xfddd('0x4f')](_0x5da387[_0xfddd('0x32')],_0x32a1f3[_0xfddd('0x34')]));if(_0x5da387[_0xfddd('0x32')][_0xfddd('0x3f')]){_0x521b32[_0xfddd('0x3c')]=_[_0xfddd('0x3d')](_0x521b32[_0xfddd('0x3c')],{'$or':_[_0xfddd('0x2c')](_0x521b32[_0xfddd('0x38')],function(_0x3e09b4){var _0x2ca0ee={};_0x2ca0ee[_0x3e09b4]={'$like':'%'+_0x5da387[_0xfddd('0x32')][_0xfddd('0x3f')]+'%'};return _0x2ca0ee;})});}_0x521b32=_[_0xfddd('0x3d')]({},_0x521b32,_0x5da387['options']);return _0x366c7f[_0xfddd('0x4c')](_0x521b32);}})[_0xfddd('0x24')](function(_0x5b31c8){if(_0x5b31c8){_0x32512a=_0x5b31c8[_0xfddd('0x37')];if(!_0x5da387['query'][_0xfddd('0x50')]('nolimit')){_0x521b32['limit']=qs['limit'](_0x5da387[_0xfddd('0x32')][_0xfddd('0x1d')]);_0x521b32[_0xfddd('0x1c')]=qs['offset'](_0x5da387['query'][_0xfddd('0x1c')]);}return _0x366c7f['getConfigurations'](_0x521b32);}})['then'](function(_0x41cda7){if(_0x41cda7){return _0x41cda7?{'count':_0x32512a,'rows':_0x41cda7}:null;}})[_0xfddd('0x24')](respondWithResult(_0x7df68a,null))[_0xfddd('0x45')](handleError(_0x7df68a,null));};exports[_0xfddd('0x51')]=function(_0x4eadb5,_0x1d499d,_0x456c35){if(_0x4eadb5['body']['id']){delete _0x4eadb5[_0xfddd('0x4a')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x4eadb5[_0xfddd('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d499d,null))[_0xfddd('0x24')](function(_0x51041d){if(_0x51041d){_0x4eadb5[_0xfddd('0x4a')][_0xfddd('0x52')]=_0x51041d['id'];_0x4eadb5[_0xfddd('0x4a')][_0xfddd('0x53')]=integrations['getSubjects'](_0x4eadb5['body'][_0xfddd('0x54')],_0x4eadb5[_0xfddd('0x4a')][_0xfddd('0x2f')]);_0x4eadb5[_0xfddd('0x4a')][_0xfddd('0x55')]=integrations[_0xfddd('0x56')](_0x4eadb5[_0xfddd('0x4a')][_0xfddd('0x54')],_0x4eadb5[_0xfddd('0x4a')][_0xfddd('0x2f')]);return db['ZohoConfiguration'][_0xfddd('0x49')](_0x4eadb5[_0xfddd('0x4a')],{'include':[{'model':db[_0xfddd('0x57')],'as':_0xfddd('0x53')},{'model':db['ZohoField'],'as':_0xfddd('0x55')}]});}return null;})[_0xfddd('0x24')](respondWithResult(_0x1d499d,null))['catch'](handleError(_0x1d499d,null));};function getAccessToken(_0x2bef2f){return new Promise(function(_0xb82418,_0x521f2e){var _0xe1ee46;switch(_0x2bef2f[_0xfddd('0x58')]){case'US':_0xe1ee46='https://accounts.zoho.com';break;case'AU':_0xe1ee46='https://accounts.zoho.com.au';break;case'EU':_0xe1ee46=_0xfddd('0x59');break;case'IN':_0xe1ee46=_0xfddd('0x5a');break;case'CN':_0xe1ee46=_0xfddd('0x5b');break;default:_0xe1ee46=_0xfddd('0x59');break;}var _0x358454={'method':_0xfddd('0x5c'),'uri':_0xe1ee46+_0xfddd('0x5d'),'qs':{'refresh_token':_0x2bef2f['refreshToken'],'client_id':_0x2bef2f[_0xfddd('0x5e')],'client_secret':_0x2bef2f[_0xfddd('0x5f')],'grant_type':_0xfddd('0x60')},'json':!![]};return rp(_0x358454)['then'](function(_0x70d5cc){if(_0x70d5cc[_0xfddd('0x61')]){_0xb82418(_0x70d5cc[_0xfddd('0x61')]);}else{_0x521f2e(_0xfddd('0x62'));}})['catch'](function(_0x305a20){_0x521f2e(_0x305a20);});});}exports['getFields']=function(_0x3bd8fe,_0xe57280,_0x21085b){var _0x352aee,_0x52529f,_0x1e4949,_0x4463de,_0x1bae87;return db[_0xfddd('0x2d')][_0xfddd('0x4d')]({'where':{'id':_0x3bd8fe['params']['id']},'attributes':['id',_0xfddd('0x63'),_0xfddd('0x58'),_0xfddd('0x5e'),_0xfddd('0x5f'),_0xfddd('0x64'),_0xfddd('0x65'),'refreshToken']})[_0xfddd('0x24')](handleEntityNotFound(_0xe57280,null))['then'](function(_0x7326b9){_0x1bae87=_0x7326b9;_0x352aee=_0x1bae87[_0xfddd('0x63')];_0x52529f=_0x352aee===_0xfddd('0x66')?'eu':_0xfddd('0x67');_0x1e4949=_0x1bae87[_0xfddd('0x64')];var _0x209c3a=_0x1e4949['slice'](-0x1);if(_0x209c3a==='/'||_0x209c3a==='\x5c'||_0x209c3a===':'){_0x1e4949=_0x1e4949[_0xfddd('0x68')](0x0,_0x1e4949[_0xfddd('0x69')](_0x209c3a));}if(!_0x1bae87[_0xfddd('0x6a')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1bae87);})['then'](function(_0x2788e2){if(_0x2788e2){return rp({'method':_0xfddd('0x6b'),'uri':util[_0xfddd('0x6c')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x52529f),'qs':{'module':_0xfddd('0x6d')},'headers':{'Authorization':_0xfddd('0x6e')+_0x2788e2},'json':!![]});}})['then'](function(_0x1efbd8){if(_0x1efbd8){if(_0x1efbd8[_0xfddd('0x6f')]&&_0x1efbd8[_0xfddd('0x6f')][_0xfddd('0x27')]){throw new Error(_0x1efbd8[_0xfddd('0x6f')]['error'][_0xfddd('0x70')]);}var _0x37e75f=[];var _0x3dcefb=[];var _0x4aa953=[_0xfddd('0x71'),_0xfddd('0x72'),_0xfddd('0x73'),_0xfddd('0x74'),_0xfddd('0x75'),_0xfddd('0x76'),_0xfddd('0x77'),_0xfddd('0x78')];_0x3dcefb=_[_0xfddd('0x79')](_0x1efbd8[_0xfddd('0x36')],function(_0x5d571b){return _0x4aa953[_0xfddd('0x7a')](_0x5d571b[_0xfddd('0x7b')]);});for(var _0x39ea34=0x0;_0x39ea34<_0x3dcefb[_0xfddd('0x37')];_0x39ea34++){if(_0x3dcefb[_0x39ea34][_0xfddd('0x7c')]===![]){_0x37e75f[_0xfddd('0x7d')]({'id':_0x3dcefb[_0x39ea34]['id'],'name':_0x3dcefb[_0x39ea34][_0xfddd('0x7e')],'custom':_0x3dcefb[_0x39ea34][_0xfddd('0x7f')],'options':_0x3dcefb[_0x39ea34][_0xfddd('0x80')]===_0xfddd('0x81')&&_0x3dcefb[_0x39ea34][_0xfddd('0x82')]['length']>-0x1?_['map'](_0x3dcefb[_0x39ea34][_0xfddd('0x82')],function(_0x58a7b5){return{'name':_0x58a7b5,'value':_0x58a7b5};}):[]});}}return{'count':_0x37e75f[_0xfddd('0x37')],'rows':_0x37e75f};}else{return{'count':0x0,'rows':[]};}})[_0xfddd('0x24')](respondWithResult(_0xe57280,null))[_0xfddd('0x45')](function(_0x30431b){var _0x5a5606=_0x3bd8fe[_0xfddd('0x32')][_0xfddd('0x83')]?0x1f4:_0x30431b[_0xfddd('0x84')]||0x1f4;logger[_0xfddd('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xfddd('0x85'),_0x5a5606,JSON[_0xfddd('0x86')](_0x30431b));delete _0x30431b[_0xfddd('0x29')];if(_0x5a5606===0x191){_0x5a5606=0x190;}_0xe57280[_0xfddd('0x19')](_0x5a5606)['send'](_0x3bd8fe['query'][_0xfddd('0x83')]?{'message':_0xfddd('0x87'),'statusCode':_0x30431b[_0xfddd('0x84')]}:_0x30431b);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index d26ba3c..fa40308 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 _0xf4a9=['application/x-www-form-urlencoded','then','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','host','https://accounts.zoho.eu','refreshToken','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientId'];(function(_0x3fd74a,_0x453f08){var _0x27eaf4=function(_0x325a3d){while(--_0x325a3d){_0x3fd74a['push'](_0x3fd74a['shift']());}};_0x27eaf4(++_0x453f08);}(_0xf4a9,0x12d));var _0x9f4a=function(_0x5f4d59,_0x554969){_0x5f4d59=_0x5f4d59-0x0;var _0x4d5dea=_0xf4a9[_0x5f4d59];return _0x4d5dea;};'use strict';var _=require(_0x9f4a('0x0'));var util=require(_0x9f4a('0x1'));var logger=require(_0x9f4a('0x2'))(_0x9f4a('0x3'));var moment=require(_0x9f4a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f4a('0x5'));var config=require(_0x9f4a('0x6'));var attributes=require(_0x9f4a('0x7'));var integrations=require(_0x9f4a('0x8'));module[_0x9f4a('0x9')]=function(_0x52cec2,_0x227b79){return _0x52cec2[_0x9f4a('0xa')]('ZohoAccount',attributes,{'tableName':_0x9f4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x9f393f,_0x3aec8d,_0x3bc24f){if(_0x9f393f[_0x9f4a('0xc')](_0x9f4a('0xd'))||_0x9f393f[_0x9f4a('0xc')](_0x9f4a('0xe'))||_0x9f393f[_0x9f4a('0xc')]('clientId')||_0x9f393f[_0x9f4a('0xc')](_0x9f4a('0xf'))||_0x9f393f[_0x9f4a('0xc')](_0x9f4a('0x10'))||_0x9f393f[_0x9f4a('0xc')]('host')){var _0x55d19d,_0x3d09d7;_0x55d19d=_0x9f393f[_0x9f4a('0xe')];var _0x301ef7=_0x55d19d[_0x9f4a('0x11')](-0x1);if(_0x301ef7==='/'||_0x301ef7==='\x5c'||_0x301ef7===':'){_0x55d19d=_0x55d19d[_0x9f4a('0x12')](0x0,_0x55d19d[_0x9f4a('0x13')](_0x301ef7));}switch(_0x9f393f['zone']){case'US':_0x3d09d7='https://accounts.zoho.com';break;case'AU':_0x3d09d7=_0x9f4a('0x14');break;case'IN':_0x3d09d7=_0x9f4a('0x15');break;case'CN':_0x3d09d7=_0x9f4a('0x16');break;default:_0x3d09d7='https://accounts.zoho.eu';break;}var _0x5282ff={'method':_0x9f4a('0x17'),'uri':_0x3d09d7+_0x9f4a('0x18'),'form':{'grant_type':_0x9f4a('0x19'),'client_id':_0x9f393f[_0x9f4a('0x1a')],'client_secret':_0x9f393f[_0x9f4a('0xf')],'redirect_uri':_0x9f393f[_0x9f4a('0xe')],'code':_0x9f393f['code']},'headers':{'Content-Type':_0x9f4a('0x1b')}};return rp(_0x5282ff)[_0x9f4a('0x1c')](function(_0x3dd07d){var _0x3bf745=JSON['parse'](_0x3dd07d);if(_0x3bf745[_0x9f4a('0x1d')]){_0x9f393f['refreshToken']=_0x3bf745[_0x9f4a('0x1d')];logger[_0x9f4a('0x1e')](util[_0x9f4a('0x1f')](_0x9f4a('0x20'),_0x9f393f['name'],_0x9f393f['id']));}else{logger[_0x9f4a('0x21')](util[_0x9f4a('0x1f')](_0x9f4a('0x22'),_0x9f393f[_0x9f4a('0x23')],_0x9f393f['id']),util[_0x9f4a('0x24')](_0x3bf745,{'showHidden':![],'depth':null}));}return _0x3bc24f(null,_0x3aec8d);})[_0x9f4a('0x25')](function(_0x64a662){logger[_0x9f4a('0x21')](util['format'](_0x9f4a('0x22'),_0x9f393f[_0x9f4a('0x23')],_0x9f393f['id']),util[_0x9f4a('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3bc24f(_0x64a662);});}else{return _0x3bc24f(null,_0x3aec8d);}},'beforeUpdate':function(_0x31b41f,_0x225a10,_0x1a2a08){if(_0x31b41f['changed'](_0x9f4a('0xd'))||_0x31b41f['changed'](_0x9f4a('0xe'))||_0x31b41f['changed'](_0x9f4a('0x1a'))||_0x31b41f[_0x9f4a('0xc')](_0x9f4a('0xf'))||_0x31b41f['changed'](_0x9f4a('0x10'))||_0x31b41f[_0x9f4a('0xc')](_0x9f4a('0x26'))){var _0x5bb8c4,_0x298ce1;_0x5bb8c4=_0x31b41f[_0x9f4a('0xe')];var _0x242cb7=_0x5bb8c4[_0x9f4a('0x11')](-0x1);if(_0x242cb7==='/'||_0x242cb7==='\x5c'||_0x242cb7===':'){_0x5bb8c4=_0x5bb8c4['substring'](0x0,_0x5bb8c4['lastIndexOf'](_0x242cb7));}switch(_0x31b41f['zone']){case'US':_0x298ce1='https://accounts.zoho.com';break;case'AU':_0x298ce1=_0x9f4a('0x14');break;case'IN':_0x298ce1=_0x9f4a('0x15');break;case'CN':_0x298ce1='https://accounts.zoho.com.cn';break;default:_0x298ce1=_0x9f4a('0x27');break;}var _0x155eae={'method':_0x9f4a('0x17'),'uri':_0x298ce1+_0x9f4a('0x18'),'form':{'grant_type':_0x9f4a('0x19'),'client_id':_0x31b41f['clientId'],'client_secret':_0x31b41f['clientSecret'],'redirect_uri':_0x31b41f[_0x9f4a('0xe')],'code':_0x31b41f[_0x9f4a('0x10')]},'headers':{'Content-Type':_0x9f4a('0x1b')}};return rp(_0x155eae)[_0x9f4a('0x1c')](function(_0x2a7c5b){var _0x58de33=JSON['parse'](_0x2a7c5b);if(_0x58de33[_0x9f4a('0x1d')]){_0x31b41f[_0x9f4a('0x28')]=_0x58de33[_0x9f4a('0x1d')];logger[_0x9f4a('0x1e')](util[_0x9f4a('0x1f')](_0x9f4a('0x20'),_0x31b41f[_0x9f4a('0x23')],_0x31b41f['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x31b41f[_0x9f4a('0x23')],_0x31b41f['id']),util['inspect'](_0x58de33,{'showHidden':![],'depth':null}));}return _0x1a2a08(null,_0x225a10);})[_0x9f4a('0x25')](function(_0x2022e1){logger[_0x9f4a('0x21')](util[_0x9f4a('0x1f')](_0x9f4a('0x22'),_0x31b41f[_0x9f4a('0x23')],_0x31b41f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1a2a08(_0x2022e1);});}else{return _0x1a2a08(null,_0x225a10);}}}});}; \ No newline at end of file +var _0x13e6=['code','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','parse','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x13e6,0x1b3));var _0x613e=function(_0x16ada8,_0x44a8cf){_0x16ada8=_0x16ada8-0x0;var _0x58fac9=_0x13e6[_0x16ada8];return _0x58fac9;};'use strict';var _=require(_0x613e('0x0'));var util=require(_0x613e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613e('0x2'));var BPromise=require(_0x613e('0x3'));var rp=require(_0x613e('0x4'));var fs=require('fs');var path=require(_0x613e('0x5'));var rimraf=require(_0x613e('0x6'));var config=require(_0x613e('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x613e('0x8'));module[_0x613e('0x9')]=function(_0x37e21f,_0x2adb6c){return _0x37e21f['define'](_0x613e('0xa'),attributes,{'tableName':_0x613e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x9931ae,_0x5293d1,_0x1beeda){if(_0x9931ae['changed']('zone')||_0x9931ae[_0x613e('0xc')](_0x613e('0xd'))||_0x9931ae['changed'](_0x613e('0xe'))||_0x9931ae[_0x613e('0xc')](_0x613e('0xf'))||_0x9931ae[_0x613e('0xc')](_0x613e('0x10'))||_0x9931ae[_0x613e('0xc')](_0x613e('0x11'))){var _0x5e8dc6,_0x2ac3cf;_0x5e8dc6=_0x9931ae[_0x613e('0xd')];var _0x5a0d9e=_0x5e8dc6[_0x613e('0x12')](-0x1);if(_0x5a0d9e==='/'||_0x5a0d9e==='\x5c'||_0x5a0d9e===':'){_0x5e8dc6=_0x5e8dc6[_0x613e('0x13')](0x0,_0x5e8dc6[_0x613e('0x14')](_0x5a0d9e));}switch(_0x9931ae[_0x613e('0x15')]){case'US':_0x2ac3cf=_0x613e('0x16');break;case'AU':_0x2ac3cf=_0x613e('0x17');break;case'IN':_0x2ac3cf=_0x613e('0x18');break;case'CN':_0x2ac3cf=_0x613e('0x19');break;default:_0x2ac3cf=_0x613e('0x1a');break;}var _0x1b16d4={'method':_0x613e('0x1b'),'uri':_0x2ac3cf+_0x613e('0x1c'),'form':{'grant_type':_0x613e('0x1d'),'client_id':_0x9931ae[_0x613e('0xe')],'client_secret':_0x9931ae[_0x613e('0xf')],'redirect_uri':_0x9931ae[_0x613e('0xd')],'code':_0x9931ae['code']},'headers':{'Content-Type':_0x613e('0x1e')}};return rp(_0x1b16d4)['then'](function(_0x45eaf2){var _0x45f79e=JSON['parse'](_0x45eaf2);if(_0x45f79e[_0x613e('0x1f')]){_0x9931ae[_0x613e('0x20')]=_0x45f79e['refresh_token'];logger[_0x613e('0x21')](util[_0x613e('0x22')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x9931ae[_0x613e('0x23')],_0x9931ae['id']));}else{logger[_0x613e('0x24')](util['format'](_0x613e('0x25'),_0x9931ae[_0x613e('0x23')],_0x9931ae['id']),util[_0x613e('0x26')](_0x45f79e,{'showHidden':![],'depth':null}));}return _0x1beeda(null,_0x5293d1);})[_0x613e('0x27')](function(_0x14b8d8){logger[_0x613e('0x24')](util[_0x613e('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x9931ae[_0x613e('0x23')],_0x9931ae['id']),util[_0x613e('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x1beeda(_0x14b8d8);});}else{return _0x1beeda(null,_0x5293d1);}},'beforeUpdate':function(_0x2c74fb,_0x3366d6,_0xe084){if(_0x2c74fb[_0x613e('0xc')](_0x613e('0x15'))||_0x2c74fb[_0x613e('0xc')](_0x613e('0xd'))||_0x2c74fb[_0x613e('0xc')](_0x613e('0xe'))||_0x2c74fb['changed']('clientSecret')||_0x2c74fb['changed'](_0x613e('0x10'))||_0x2c74fb[_0x613e('0xc')](_0x613e('0x11'))){var _0x1bfbcb,_0x3936ab;_0x1bfbcb=_0x2c74fb[_0x613e('0xd')];var _0x474f13=_0x1bfbcb[_0x613e('0x12')](-0x1);if(_0x474f13==='/'||_0x474f13==='\x5c'||_0x474f13===':'){_0x1bfbcb=_0x1bfbcb[_0x613e('0x13')](0x0,_0x1bfbcb[_0x613e('0x14')](_0x474f13));}switch(_0x2c74fb[_0x613e('0x15')]){case'US':_0x3936ab=_0x613e('0x16');break;case'AU':_0x3936ab=_0x613e('0x17');break;case'IN':_0x3936ab=_0x613e('0x18');break;case'CN':_0x3936ab=_0x613e('0x19');break;default:_0x3936ab=_0x613e('0x1a');break;}var _0x239c27={'method':'POST','uri':_0x3936ab+_0x613e('0x1c'),'form':{'grant_type':_0x613e('0x1d'),'client_id':_0x2c74fb[_0x613e('0xe')],'client_secret':_0x2c74fb[_0x613e('0xf')],'redirect_uri':_0x2c74fb[_0x613e('0xd')],'code':_0x2c74fb[_0x613e('0x10')]},'headers':{'Content-Type':_0x613e('0x1e')}};return rp(_0x239c27)['then'](function(_0xa5d976){var _0x5c2e17=JSON[_0x613e('0x28')](_0xa5d976);if(_0x5c2e17['refresh_token']){_0x2c74fb[_0x613e('0x20')]=_0x5c2e17[_0x613e('0x1f')];logger[_0x613e('0x21')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c74fb[_0x613e('0x23')],_0x2c74fb['id']));}else{logger[_0x613e('0x24')](util['format'](_0x613e('0x25'),_0x2c74fb['name'],_0x2c74fb['id']),util[_0x613e('0x26')](_0x5c2e17,{'showHidden':![],'depth':null}));}return _0xe084(null,_0x3366d6);})[_0x613e('0x27')](function(_0xff0d95){logger['error'](util[_0x613e('0x22')](_0x613e('0x25'),_0x2c74fb[_0x613e('0x23')],_0x2c74fb['id']),util[_0x613e('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0xe084(_0xff0d95);});}else{return _0xe084(null,_0x3366d6);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 175d891..28b5e37 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 _0x5078=['message','result','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2d4ae2,_0x5a8638){var _0x3a27af=function(_0x310962){while(--_0x310962){_0x2d4ae2['push'](_0x2d4ae2['shift']());}};_0x3a27af(++_0x5a8638);}(_0x5078,0x148));var _0x8507=function(_0x49acee,_0x49c7ab){_0x49acee=_0x49acee-0x0;var _0x18a8f8=_0x5078[_0x49acee];return _0x18a8f8;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var moment=require(_0x8507('0x2'));var BPromise=require(_0x8507('0x3'));var rs=require(_0x8507('0x4'));var fs=require('fs');var Redis=require(_0x8507('0x5'));var db=require(_0x8507('0x6'))['db'];var utils=require(_0x8507('0x7'));var logger=require(_0x8507('0x8'))(_0x8507('0x9'));var config=require(_0x8507('0xa'));var jayson=require(_0x8507('0xb'));var client=jayson[_0x8507('0xc')][_0x8507('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1887c7,_0x27a50a,_0x5e9d83){return new BPromise(function(_0x10debc,_0x2a4991){return client[_0x8507('0xe')](_0x1887c7,_0x5e9d83)['then'](function(_0x549184){logger[_0x8507('0xf')](_0x8507('0x10'),_0x27a50a,_0x8507('0x11'));logger[_0x8507('0x12')](_0x8507('0x13'),_0x27a50a,_0x8507('0x11'),JSON[_0x8507('0x14')](_0x549184));if(_0x549184['error']){if(_0x549184[_0x8507('0x15')][_0x8507('0x16')]===0x1f4){logger[_0x8507('0x15')](_0x8507('0x10'),_0x27a50a,_0x549184[_0x8507('0x15')][_0x8507('0x17')]);return _0x2a4991(_0x549184['error'][_0x8507('0x17')]);}logger[_0x8507('0x15')](_0x8507('0x10'),_0x27a50a,_0x549184[_0x8507('0x15')][_0x8507('0x17')]);return _0x10debc(_0x549184[_0x8507('0x15')]['message']);}else{logger['info'](_0x8507('0x10'),_0x27a50a,_0x8507('0x11'));_0x10debc(_0x549184[_0x8507('0x18')]['message']);}})[_0x8507('0x19')](function(_0x375a0d){logger[_0x8507('0x15')](_0x8507('0x10'),_0x27a50a,_0x375a0d);_0x2a4991(_0x375a0d);});});}exports[_0x8507('0x1a')]=function(_0x13b285){var _0x569632=this;return new Promise(function(_0x36e387,_0x4d7146){return db['ZohoAccount'][_0x8507('0x1b')]({'raw':_0x13b285[_0x8507('0x1c')]?_0x13b285[_0x8507('0x1c')][_0x8507('0x1d')]===undefined?!![]:![]:!![],'where':_0x13b285[_0x8507('0x1c')]?_0x13b285['options'][_0x8507('0x1e')]||null:null,'attributes':_0x13b285[_0x8507('0x1c')]?_0x13b285[_0x8507('0x1c')][_0x8507('0x1f')]||null:null,'limit':_0x13b285[_0x8507('0x1c')]?_0x13b285[_0x8507('0x1c')][_0x8507('0x20')]||null:null,'include':_0x13b285[_0x8507('0x1c')]?_0x13b285['options'][_0x8507('0x21')]?_[_0x8507('0x22')](_0x13b285[_0x8507('0x1c')][_0x8507('0x21')],function(_0x873ec4){return{'model':db[_0x873ec4[_0x8507('0x23')]],'as':_0x873ec4['as'],'attributes':_0x873ec4[_0x8507('0x1f')],'include':_0x873ec4[_0x8507('0x21')]?_['map'](_0x873ec4[_0x8507('0x21')],function(_0x24fc61){return{'model':db[_0x24fc61[_0x8507('0x23')]],'as':_0x24fc61['as'],'attributes':_0x24fc61['attributes'],'include':_0x24fc61[_0x8507('0x21')]?_[_0x8507('0x22')](_0x24fc61[_0x8507('0x21')],function(_0x160402){return{'model':db[_0x160402['model']],'as':_0x160402['as'],'attributes':_0x160402[_0x8507('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8507('0x24')](function(_0x2bd833){logger[_0x8507('0xf')](_0x8507('0x1a'),_0x13b285);logger['debug'](_0x8507('0x1a'),_0x13b285,JSON[_0x8507('0x14')](_0x2bd833));_0x36e387(_0x2bd833);})[_0x8507('0x19')](function(_0x2ca452){logger[_0x8507('0x15')](_0x8507('0x1a'),_0x2ca452[_0x8507('0x17')],_0x13b285);_0x4d7146(_0x569632[_0x8507('0x15')](0x1f4,_0x2ca452[_0x8507('0x17')]));});});};exports[_0x8507('0x25')]=function(_0x25a7d1){var _0x32f500=this;return new Promise(function(_0x17031f,_0x54f37a){return db['ZohoAccount'][_0x8507('0x26')]({'raw':_0x25a7d1['options']?_0x25a7d1[_0x8507('0x1c')][_0x8507('0x1d')]===undefined?!![]:![]:!![],'where':_0x25a7d1['options']?_0x25a7d1['options']['where']||null:null,'attributes':_0x25a7d1[_0x8507('0x1c')]?_0x25a7d1[_0x8507('0x1c')][_0x8507('0x1f')]||null:null,'include':_0x25a7d1[_0x8507('0x1c')]?_0x25a7d1[_0x8507('0x1c')][_0x8507('0x21')]?_['map'](_0x25a7d1['options'][_0x8507('0x21')],function(_0x29e317){return{'model':db[_0x29e317[_0x8507('0x23')]],'as':_0x29e317['as'],'attributes':_0x29e317['attributes'],'include':_0x29e317['include']?_[_0x8507('0x22')](_0x29e317[_0x8507('0x21')],function(_0x5e5cbf){return{'model':db[_0x5e5cbf[_0x8507('0x23')]],'as':_0x5e5cbf['as'],'attributes':_0x5e5cbf[_0x8507('0x1f')],'include':_0x5e5cbf['include']?_['map'](_0x5e5cbf['include'],function(_0x134f88){return{'model':db[_0x134f88[_0x8507('0x23')]],'as':_0x134f88['as'],'attributes':_0x134f88[_0x8507('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8507('0x24')](function(_0x56c610){logger['info'](_0x8507('0x25'),_0x25a7d1);logger[_0x8507('0x12')]('ShowZohoAccount',_0x25a7d1,JSON[_0x8507('0x14')](_0x56c610));_0x17031f(_0x56c610);})[_0x8507('0x19')](function(_0x38edbd){logger['error'](_0x8507('0x25'),_0x38edbd[_0x8507('0x17')],_0x25a7d1);_0x54f37a(_0x32f500[_0x8507('0x15')](0x1f4,_0x38edbd[_0x8507('0x17')]));});});}; \ No newline at end of file +var _0x5458=['catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowZohoAccount','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1fd1c9,_0x35ffa5){var _0x128bbd=function(_0x3832af){while(--_0x3832af){_0x1fd1c9['push'](_0x1fd1c9['shift']());}};_0x128bbd(++_0x35ffa5);}(_0x5458,0x1c7));var _0x8545=function(_0x178d9c,_0x3aaad3){_0x178d9c=_0x178d9c-0x0;var _0x9656c5=_0x5458[_0x178d9c];return _0x9656c5;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var moment=require(_0x8545('0x2'));var BPromise=require('bluebird');var rs=require(_0x8545('0x3'));var fs=require('fs');var Redis=require(_0x8545('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8545('0x5'));var logger=require(_0x8545('0x6'))(_0x8545('0x7'));var config=require('../../config/environment');var jayson=require(_0x8545('0x8'));var client=jayson[_0x8545('0x9')][_0x8545('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x359d01,_0x5062c7,_0x291bc9){return new BPromise(function(_0x507ed8,_0x2cc4f4){return client[_0x8545('0xb')](_0x359d01,_0x291bc9)[_0x8545('0xc')](function(_0x10931d){logger[_0x8545('0xd')](_0x8545('0xe'),_0x5062c7,_0x8545('0xf'));logger[_0x8545('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5062c7,_0x8545('0xf'),JSON[_0x8545('0x11')](_0x10931d));if(_0x10931d[_0x8545('0x12')]){if(_0x10931d['error'][_0x8545('0x13')]===0x1f4){logger[_0x8545('0x12')](_0x8545('0xe'),_0x5062c7,_0x10931d[_0x8545('0x12')][_0x8545('0x14')]);return _0x2cc4f4(_0x10931d[_0x8545('0x12')][_0x8545('0x14')]);}logger[_0x8545('0x12')](_0x8545('0xe'),_0x5062c7,_0x10931d['error'][_0x8545('0x14')]);return _0x507ed8(_0x10931d[_0x8545('0x12')]['message']);}else{logger[_0x8545('0xd')](_0x8545('0xe'),_0x5062c7,_0x8545('0xf'));_0x507ed8(_0x10931d['result'][_0x8545('0x14')]);}})[_0x8545('0x15')](function(_0x3374f7){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x5062c7,_0x3374f7);_0x2cc4f4(_0x3374f7);});});}exports[_0x8545('0x16')]=function(_0x122a4c){var _0x4e5733=this;return new Promise(function(_0x50e621,_0x564d3f){return db[_0x8545('0x17')][_0x8545('0x18')]({'raw':_0x122a4c[_0x8545('0x19')]?_0x122a4c[_0x8545('0x19')][_0x8545('0x1a')]===undefined?!![]:![]:!![],'where':_0x122a4c[_0x8545('0x19')]?_0x122a4c[_0x8545('0x19')][_0x8545('0x1b')]||null:null,'attributes':_0x122a4c['options']?_0x122a4c[_0x8545('0x19')][_0x8545('0x1c')]||null:null,'limit':_0x122a4c[_0x8545('0x19')]?_0x122a4c[_0x8545('0x19')][_0x8545('0x1d')]||null:null,'include':_0x122a4c[_0x8545('0x19')]?_0x122a4c['options'][_0x8545('0x1e')]?_['map'](_0x122a4c['options'][_0x8545('0x1e')],function(_0x20d2d9){return{'model':db[_0x20d2d9[_0x8545('0x1f')]],'as':_0x20d2d9['as'],'attributes':_0x20d2d9['attributes'],'include':_0x20d2d9[_0x8545('0x1e')]?_[_0x8545('0x20')](_0x20d2d9[_0x8545('0x1e')],function(_0x178ff8){return{'model':db[_0x178ff8['model']],'as':_0x178ff8['as'],'attributes':_0x178ff8[_0x8545('0x1c')],'include':_0x178ff8[_0x8545('0x1e')]?_[_0x8545('0x20')](_0x178ff8[_0x8545('0x1e')],function(_0x4bd30a){return{'model':db[_0x4bd30a['model']],'as':_0x4bd30a['as'],'attributes':_0x4bd30a['attributes']};}):[]};}):[]};}):[]:[]})[_0x8545('0xc')](function(_0x2f244d){logger[_0x8545('0xd')]('GetZohoAccount',_0x122a4c);logger['debug'](_0x8545('0x16'),_0x122a4c,JSON[_0x8545('0x11')](_0x2f244d));_0x50e621(_0x2f244d);})[_0x8545('0x15')](function(_0x2ec6d6){logger[_0x8545('0x12')](_0x8545('0x16'),_0x2ec6d6[_0x8545('0x14')],_0x122a4c);_0x564d3f(_0x4e5733[_0x8545('0x12')](0x1f4,_0x2ec6d6[_0x8545('0x14')]));});});};exports[_0x8545('0x21')]=function(_0x576048){var _0x17e87e=this;return new Promise(function(_0x3b9659,_0x375289){return db['ZohoAccount']['find']({'raw':_0x576048[_0x8545('0x19')]?_0x576048[_0x8545('0x19')][_0x8545('0x1a')]===undefined?!![]:![]:!![],'where':_0x576048[_0x8545('0x19')]?_0x576048[_0x8545('0x19')][_0x8545('0x1b')]||null:null,'attributes':_0x576048[_0x8545('0x19')]?_0x576048[_0x8545('0x19')][_0x8545('0x1c')]||null:null,'include':_0x576048[_0x8545('0x19')]?_0x576048[_0x8545('0x19')][_0x8545('0x1e')]?_[_0x8545('0x20')](_0x576048[_0x8545('0x19')][_0x8545('0x1e')],function(_0x48b305){return{'model':db[_0x48b305[_0x8545('0x1f')]],'as':_0x48b305['as'],'attributes':_0x48b305['attributes'],'include':_0x48b305['include']?_[_0x8545('0x20')](_0x48b305['include'],function(_0x1efdc7){return{'model':db[_0x1efdc7['model']],'as':_0x1efdc7['as'],'attributes':_0x1efdc7[_0x8545('0x1c')],'include':_0x1efdc7[_0x8545('0x1e')]?_['map'](_0x1efdc7[_0x8545('0x1e')],function(_0x47a771){return{'model':db[_0x47a771['model']],'as':_0x47a771['as'],'attributes':_0x47a771[_0x8545('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8545('0xc')](function(_0x1b9ded){logger['info'](_0x8545('0x21'),_0x576048);logger[_0x8545('0x10')](_0x8545('0x21'),_0x576048,JSON['stringify'](_0x1b9ded));_0x3b9659(_0x1b9ded);})[_0x8545('0x15')](function(_0x113b81){logger[_0x8545('0x12')](_0x8545('0x21'),_0x113b81['message'],_0x576048);_0x375289(_0x17e87e[_0x8545('0x12')](0x1f4,_0x113b81[_0x8545('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index eb93770..2fb7b07 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 _0xf3a0=['index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2960de,_0x335d89){var _0x490434=function(_0x5b97b6){while(--_0x5b97b6){_0x2960de['push'](_0x2960de['shift']());}};_0x490434(++_0x335d89);}(_0xf3a0,0xa6));var _0x0f3a=function(_0x198247,_0x491c12){_0x198247=_0x198247-0x0;var _0x2b18bc=_0xf3a0[_0x198247];return _0x2b18bc;};'use strict';var multer=require(_0x0f3a('0x0'));var util=require(_0x0f3a('0x1'));var path=require(_0x0f3a('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f3a('0x3'));var router=express['Router']();var fs_extra=require(_0x0f3a('0x4'));var auth=require(_0x0f3a('0x5'));var interaction=require(_0x0f3a('0x6'));var config=require(_0x0f3a('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x0f3a('0x8')]('/',auth[_0x0f3a('0x9')](),controller[_0x0f3a('0xa')]);router[_0x0f3a('0x8')](_0x0f3a('0xb'),auth[_0x0f3a('0x9')](),controller[_0x0f3a('0xc')]);router[_0x0f3a('0x8')](_0x0f3a('0xd'),auth['isAuthenticated'](),controller[_0x0f3a('0xe')]);router[_0x0f3a('0x8')](_0x0f3a('0xf'),auth[_0x0f3a('0x9')](),controller['getSubjects']);router['get'](_0x0f3a('0x10'),auth[_0x0f3a('0x9')](),controller[_0x0f3a('0x11')]);router['post']('/',auth[_0x0f3a('0x9')](),controller['create']);router[_0x0f3a('0x12')](_0x0f3a('0xb'),auth['isAuthenticated'](),controller[_0x0f3a('0x13')]);router[_0x0f3a('0x14')](_0x0f3a('0xb'),auth['isAuthenticated'](),controller[_0x0f3a('0x15')]);module['exports']=router; \ No newline at end of file +var _0xba83=['getFields','getSubjects','/:id/descriptions','getDescriptions','create','update','delete','/:id','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x2bf081,_0x13efdf){var _0x3e4faf=function(_0x24ca9c){while(--_0x24ca9c){_0x2bf081['push'](_0x2bf081['shift']());}};_0x3e4faf(++_0x13efdf);}(_0xba83,0x1c2));var _0x3ba8=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0xba83[_0x101802];return _0x5d61ce;};'use strict';var multer=require(_0x3ba8('0x0'));var util=require(_0x3ba8('0x1'));var path=require(_0x3ba8('0x2'));var timeout=require(_0x3ba8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3ba8('0x4'));var auth=require(_0x3ba8('0x5'));var interaction=require(_0x3ba8('0x6'));var config=require(_0x3ba8('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x3ba8('0x8')]('/',auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xa')]);router[_0x3ba8('0x8')]('/:id',auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x3ba8('0xc')]);router[_0x3ba8('0x8')]('/:id/subjects',auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xd')]);router[_0x3ba8('0x8')](_0x3ba8('0xe'),auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3ba8('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3ba8('0x11')]);router[_0x3ba8('0x12')](_0x3ba8('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x3ba8('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index cfca690..f9948ad 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 _0xe126=['nothing','lead','contact_lead','STRING','exports','ENUM','contact'];(function(_0x5f083d,_0x24edd9){var _0x29a0f2=function(_0x1064d9){while(--_0x1064d9){_0x5f083d['push'](_0x5f083d['shift']());}};_0x29a0f2(++_0x24edd9);}(_0xe126,0xf2));var _0x6e12=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xe126[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require('sequelize');module[_0x6e12('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x6e12('0x1')]('lead',_0x6e12('0x2'),_0x6e12('0x3')),'defaultValue':_0x6e12('0x4')},'moduleSearch':{'type':Sequelize[_0x6e12('0x1')]('contact_lead',_0x6e12('0x2'),_0x6e12('0x4')),'defaultValue':_0x6e12('0x5')},'description':{'type':Sequelize[_0x6e12('0x6')]}}; \ No newline at end of file +var _0x3f98=['contact_lead','contact','sequelize','exports','STRING','ENUM','lead','nothing'];(function(_0x44c72b,_0x4dc6dd){var _0x3d0ec5=function(_0x144459){while(--_0x144459){_0x44c72b['push'](_0x44c72b['shift']());}};_0x3d0ec5(++_0x4dc6dd);}(_0x3f98,0x19a));var _0x83f9=function(_0x51355a,_0x54a655){_0x51355a=_0x51355a-0x0;var _0xadc9dd=_0x3f98[_0x51355a];return _0xadc9dd;};'use strict';var Sequelize=require(_0x83f9('0x0'));module[_0x83f9('0x1')]={'name':{'type':Sequelize[_0x83f9('0x2')]},'moduleCreate':{'type':Sequelize[_0x83f9('0x3')](_0x83f9('0x4'),'contact',_0x83f9('0x5')),'defaultValue':_0x83f9('0x4')},'moduleSearch':{'type':Sequelize[_0x83f9('0x3')](_0x83f9('0x6'),_0x83f9('0x7'),_0x83f9('0x4')),'defaultValue':_0x83f9('0x6')},'description':{'type':Sequelize[_0x83f9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 2ea2113..290011e 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 _0x1ff0=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','merge','options','includeAll','include','findAll','rows','show','create','body','catch','find','params','getFields','ZohoField','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','key'];(function(_0x555a66,_0x4e9388){var _0x461948=function(_0x503e9f){while(--_0x503e9f){_0x555a66['push'](_0x555a66['shift']());}};_0x461948(++_0x4e9388);}(_0x1ff0,0x11a));var _0x01ff=function(_0x23169e,_0x10291a){_0x23169e=_0x23169e-0x0;var _0x49e4f3=_0x1ff0[_0x23169e];return _0x49e4f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01ff('0x0'));var zipdir=require(_0x01ff('0x1'));var jsonpatch=require(_0x01ff('0x2'));var rp=require(_0x01ff('0x3'));var moment=require(_0x01ff('0x4'));var BPromise=require(_0x01ff('0x5'));var Mustache=require(_0x01ff('0x6'));var util=require(_0x01ff('0x7'));var path=require('path');var sox=require(_0x01ff('0x8'));var csv=require(_0x01ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01ff('0xa'));var squel=require(_0x01ff('0xb'));var crypto=require('crypto');var jsforce=require(_0x01ff('0xc'));var deskjs=require(_0x01ff('0xd'));var toCsv=require('to-csv');var querystring=require(_0x01ff('0xe'));var Papa=require('papaparse');var Redis=require(_0x01ff('0xf'));var authService=require(_0x01ff('0x10'));var qs=require(_0x01ff('0x11'));var as=require(_0x01ff('0x12'));var hardwareService=require(_0x01ff('0x13'));var logger=require('../../config/logger')(_0x01ff('0x14'));var utils=require(_0x01ff('0x15'));var config=require(_0x01ff('0x16'));var licenseUtil=require(_0x01ff('0x17'));var db=require(_0x01ff('0x18'))['db'];function respondWithStatusCode(_0x53a324,_0x5d7ec2){_0x5d7ec2=_0x5d7ec2||0xcc;return function(_0x3964ae){if(_0x3964ae){return _0x53a324[_0x01ff('0x19')](_0x5d7ec2);}return _0x53a324['status'](_0x5d7ec2)[_0x01ff('0x1a')]();};}function respondWithResult(_0x112cf7,_0x2bb036){_0x2bb036=_0x2bb036||0xc8;return function(_0x435dd3){if(_0x435dd3){return _0x112cf7[_0x01ff('0x1b')](_0x2bb036)['json'](_0x435dd3);}};}function respondWithFilteredResult(_0x2e251d,_0x333801){return function(_0x1a0588){if(_0x1a0588){var _0x330c23=typeof _0x333801['offset']===_0x01ff('0x1c')&&typeof _0x333801[_0x01ff('0x1d')]===_0x01ff('0x1c');var _0x2403b3=_0x1a0588[_0x01ff('0x1e')];var _0x38837f=_0x330c23?0x0:_0x333801[_0x01ff('0x1f')];var _0x7b8908=_0x330c23?_0x1a0588[_0x01ff('0x1e')]:_0x333801['offset']+_0x333801['limit'];var _0x2fe4e2;if(_0x7b8908>=_0x2403b3){_0x7b8908=_0x2403b3;_0x2fe4e2=0xc8;}else{_0x2fe4e2=0xce;}_0x2e251d[_0x01ff('0x1b')](_0x2fe4e2);return _0x2e251d[_0x01ff('0x20')](_0x01ff('0x21'),_0x38837f+'-'+_0x7b8908+'/'+_0x2403b3)[_0x01ff('0x22')](_0x1a0588);}return null;};}function patchUpdates(_0x443e62){return function(_0x3e5593){try{jsonpatch['apply'](_0x3e5593,_0x443e62,!![]);}catch(_0x487173){return BPromise[_0x01ff('0x23')](_0x487173);}return _0x3e5593[_0x01ff('0x24')]();};}function saveUpdates(_0x3e422c,_0x3f7456){return function(_0x19b746){if(_0x19b746){return _0x19b746[_0x01ff('0x25')](_0x3e422c)[_0x01ff('0x26')](function(_0x231833){return _0x231833;});}return null;};}function removeEntity(_0x2f9641,_0xe059b3){return function(_0x268e83){if(_0x268e83){return _0x268e83[_0x01ff('0x27')]()[_0x01ff('0x26')](function(){_0x2f9641[_0x01ff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15d416,_0xf47627){return function(_0x19fa64){if(!_0x19fa64){_0x15d416['sendStatus'](0x194);}return _0x19fa64;};}function handleError(_0x444964,_0xfd63ce){_0xfd63ce=_0xfd63ce||0x1f4;return function(_0x370aed){logger[_0x01ff('0x28')](_0x370aed[_0x01ff('0x29')]);if(_0x370aed[_0x01ff('0x2a')]){delete _0x370aed['name'];}_0x444964[_0x01ff('0x1b')](_0xfd63ce)[_0x01ff('0x2b')](_0x370aed);};}exports[_0x01ff('0x2c')]=function(_0x1f5338,_0xa817a3){var _0x1a1e18={},_0x28798d={},_0x3af065={'count':0x0,'rows':[]};var _0x15df44=_['map'](db[_0x01ff('0x2d')][_0x01ff('0x2e')],function(_0xd8f40e){return{'name':_0xd8f40e[_0x01ff('0x2f')],'type':_0xd8f40e[_0x01ff('0x30')][_0x01ff('0x31')]};});_0x28798d[_0x01ff('0x32')]=_['map'](_0x15df44,_0x01ff('0x2a'));_0x28798d[_0x01ff('0x33')]=_[_0x01ff('0x34')](_0x1f5338['query']);_0x28798d[_0x01ff('0x35')]=_[_0x01ff('0x36')](_0x28798d[_0x01ff('0x32')],_0x28798d['query']);_0x1a1e18[_0x01ff('0x37')]=_[_0x01ff('0x36')](_0x28798d[_0x01ff('0x32')],qs[_0x01ff('0x38')](_0x1f5338[_0x01ff('0x33')][_0x01ff('0x38')]));_0x1a1e18[_0x01ff('0x37')]=_0x1a1e18[_0x01ff('0x37')][_0x01ff('0x39')]?_0x1a1e18[_0x01ff('0x37')]:_0x28798d['model'];if(!_0x1f5338['query'][_0x01ff('0x3a')](_0x01ff('0x3b'))){_0x1a1e18[_0x01ff('0x1d')]=qs[_0x01ff('0x1d')](_0x1f5338[_0x01ff('0x33')]['limit']);_0x1a1e18[_0x01ff('0x1f')]=qs['offset'](_0x1f5338[_0x01ff('0x33')][_0x01ff('0x1f')]);}_0x1a1e18[_0x01ff('0x3c')]=qs['sort'](_0x1f5338['query'][_0x01ff('0x3d')]);_0x1a1e18[_0x01ff('0x3e')]=qs[_0x01ff('0x35')](_[_0x01ff('0x3f')](_0x1f5338[_0x01ff('0x33')],_0x28798d[_0x01ff('0x35')]),_0x15df44);if(_0x1f5338[_0x01ff('0x33')]['filter']){_0x1a1e18['where']=_['merge'](_0x1a1e18[_0x01ff('0x3e')],{'$or':_[_0x01ff('0x40')](_0x15df44,function(_0x41483f){if(_0x41483f[_0x01ff('0x30')]!=='VIRTUAL'){var _0x4664af={};_0x4664af[_0x41483f[_0x01ff('0x2a')]]={'$like':'%'+_0x1f5338[_0x01ff('0x33')][_0x01ff('0x41')]+'%'};return _0x4664af;}})});}_0x1a1e18=_[_0x01ff('0x42')]({},_0x1a1e18,_0x1f5338[_0x01ff('0x43')]);var _0x4019d4={'where':_0x1a1e18[_0x01ff('0x3e')]};return db[_0x01ff('0x2d')][_0x01ff('0x1e')](_0x4019d4)[_0x01ff('0x26')](function(_0x1e6df0){_0x3af065[_0x01ff('0x1e')]=_0x1e6df0;if(_0x1f5338[_0x01ff('0x33')][_0x01ff('0x44')]){_0x1a1e18[_0x01ff('0x45')]=[{'all':!![]}];}return db[_0x01ff('0x2d')][_0x01ff('0x46')](_0x1a1e18);})['then'](function(_0x5bff54){_0x3af065[_0x01ff('0x47')]=_0x5bff54;return _0x3af065;})[_0x01ff('0x26')](respondWithFilteredResult(_0xa817a3,_0x1a1e18))['catch'](handleError(_0xa817a3,null));};exports[_0x01ff('0x48')]=function(_0x478a94,_0x54cfa5){var _0x5568b6={'raw':![],'where':{'id':_0x478a94['params']['id']}},_0xa6df87={};_0xa6df87[_0x01ff('0x32')]=_[_0x01ff('0x34')](db[_0x01ff('0x2d')][_0x01ff('0x2e')]);_0xa6df87[_0x01ff('0x33')]=_[_0x01ff('0x34')](_0x478a94[_0x01ff('0x33')]);_0xa6df87['filters']=_[_0x01ff('0x36')](_0xa6df87['model'],_0xa6df87['query']);_0x5568b6[_0x01ff('0x37')]=_['intersection'](_0xa6df87[_0x01ff('0x32')],qs['fields'](_0x478a94['query'][_0x01ff('0x38')]));_0x5568b6[_0x01ff('0x37')]=_0x5568b6[_0x01ff('0x37')][_0x01ff('0x39')]?_0x5568b6[_0x01ff('0x37')]:_0xa6df87['model'];if(_0x478a94[_0x01ff('0x33')][_0x01ff('0x44')]){_0x5568b6[_0x01ff('0x45')]=[{'all':!![]}];}_0x5568b6=_[_0x01ff('0x42')]({},_0x5568b6,_0x478a94[_0x01ff('0x43')]);return db[_0x01ff('0x2d')]['find'](_0x5568b6)[_0x01ff('0x26')](handleEntityNotFound(_0x54cfa5,null))[_0x01ff('0x26')](respondWithResult(_0x54cfa5,null))['catch'](handleError(_0x54cfa5,null));};exports[_0x01ff('0x49')]=function(_0x4a905e,_0x30977b){return db['ZohoConfiguration']['create'](_0x4a905e[_0x01ff('0x4a')],{})[_0x01ff('0x26')](respondWithResult(_0x30977b,0xc9))[_0x01ff('0x4b')](handleError(_0x30977b,null));};exports[_0x01ff('0x25')]=function(_0x33b764,_0x231d28){if(_0x33b764[_0x01ff('0x4a')]['id']){delete _0x33b764[_0x01ff('0x4a')]['id'];}return db[_0x01ff('0x2d')][_0x01ff('0x4c')]({'where':{'id':_0x33b764[_0x01ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0x231d28,null))[_0x01ff('0x26')](saveUpdates(_0x33b764['body'],null))['then'](respondWithResult(_0x231d28,null))[_0x01ff('0x4b')](handleError(_0x231d28,null));};exports[_0x01ff('0x27')]=function(_0x1d98a3,_0x57f370){return db[_0x01ff('0x2d')][_0x01ff('0x4c')]({'where':{'id':_0x1d98a3[_0x01ff('0x4d')]['id']}})[_0x01ff('0x26')](handleEntityNotFound(_0x57f370,null))['then'](removeEntity(_0x57f370,null))[_0x01ff('0x4b')](handleError(_0x57f370,null));};exports[_0x01ff('0x4e')]=function(_0x2388df,_0x102323,_0x366f51){var _0x13144f={};var _0x463e51={};var _0xe04328;var _0x2d22aa;return db[_0x01ff('0x2d')]['findOne']({'where':{'id':_0x2388df[_0x01ff('0x4d')]['id']}})[_0x01ff('0x26')](handleEntityNotFound(_0x102323,null))['then'](function(_0x37a509){if(_0x37a509){_0xe04328=_0x37a509;_0x463e51[_0x01ff('0x32')]=_['keys'](db[_0x01ff('0x4f')][_0x01ff('0x2e')]);_0x463e51['query']=_[_0x01ff('0x34')](_0x2388df[_0x01ff('0x33')]);_0x463e51['filters']=_[_0x01ff('0x36')](_0x463e51['model'],_0x463e51[_0x01ff('0x33')]);_0x13144f['attributes']=_[_0x01ff('0x36')](_0x463e51[_0x01ff('0x32')],qs[_0x01ff('0x38')](_0x2388df[_0x01ff('0x33')][_0x01ff('0x38')]));_0x13144f[_0x01ff('0x37')]=_0x13144f['attributes'][_0x01ff('0x39')]?_0x13144f['attributes']:_0x463e51[_0x01ff('0x32')];_0x13144f['order']=qs['sort'](_0x2388df[_0x01ff('0x33')][_0x01ff('0x3d')]);_0x13144f[_0x01ff('0x3e')]=qs[_0x01ff('0x35')](_[_0x01ff('0x3f')](_0x2388df[_0x01ff('0x33')],_0x463e51[_0x01ff('0x35')]));if(_0x2388df[_0x01ff('0x33')][_0x01ff('0x41')]){_0x13144f[_0x01ff('0x3e')]=_['merge'](_0x13144f[_0x01ff('0x3e')],{'$or':_[_0x01ff('0x40')](_0x13144f[_0x01ff('0x37')],function(_0x24bf75){var _0x2d00ec={};_0x2d00ec[_0x24bf75]={'$like':'%'+_0x2388df[_0x01ff('0x33')][_0x01ff('0x41')]+'%'};return _0x2d00ec;})});}_0x13144f=_[_0x01ff('0x42')]({},_0x13144f,_0x2388df['options']);return _0xe04328[_0x01ff('0x4e')](_0x13144f);}})[_0x01ff('0x26')](function(_0xda5d3b){if(_0xda5d3b){_0x2d22aa=_0xda5d3b[_0x01ff('0x39')];if(!_0x2388df[_0x01ff('0x33')][_0x01ff('0x3a')](_0x01ff('0x3b'))){_0x13144f[_0x01ff('0x1d')]=qs[_0x01ff('0x1d')](_0x2388df[_0x01ff('0x33')]['limit']);_0x13144f[_0x01ff('0x1f')]=qs[_0x01ff('0x1f')](_0x2388df[_0x01ff('0x33')][_0x01ff('0x1f')]);}return _0xe04328[_0x01ff('0x4e')](_0x13144f);}})['then'](function(_0x39d8e8){if(_0x39d8e8){return _0x39d8e8?{'count':_0x2d22aa,'rows':_0x39d8e8}:null;}})[_0x01ff('0x26')](respondWithResult(_0x102323,null))[_0x01ff('0x4b')](handleError(_0x102323,null));};exports[_0x01ff('0x50')]=function(_0x48ac49,_0x5f1c9d,_0x2404b1){var _0x44c264={};var _0x2568b1={};var _0x5abe1a;var _0x5c53e6;return db['ZohoConfiguration'][_0x01ff('0x51')]({'where':{'id':_0x48ac49['params']['id']}})['then'](handleEntityNotFound(_0x5f1c9d,null))[_0x01ff('0x26')](function(_0x2fe4c8){if(_0x2fe4c8){_0x5abe1a=_0x2fe4c8;_0x2568b1[_0x01ff('0x32')]=_[_0x01ff('0x34')](db[_0x01ff('0x4f')][_0x01ff('0x2e')]);_0x2568b1[_0x01ff('0x33')]=_['keys'](_0x48ac49[_0x01ff('0x33')]);_0x2568b1[_0x01ff('0x35')]=_[_0x01ff('0x36')](_0x2568b1[_0x01ff('0x32')],_0x2568b1[_0x01ff('0x33')]);_0x44c264[_0x01ff('0x37')]=_[_0x01ff('0x36')](_0x2568b1[_0x01ff('0x32')],qs[_0x01ff('0x38')](_0x48ac49[_0x01ff('0x33')][_0x01ff('0x38')]));_0x44c264['attributes']=_0x44c264['attributes']['length']?_0x44c264[_0x01ff('0x37')]:_0x2568b1[_0x01ff('0x32')];_0x44c264[_0x01ff('0x3c')]=qs[_0x01ff('0x3d')](_0x48ac49[_0x01ff('0x33')][_0x01ff('0x3d')]);_0x44c264[_0x01ff('0x3e')]=qs[_0x01ff('0x35')](_[_0x01ff('0x3f')](_0x48ac49[_0x01ff('0x33')],_0x2568b1[_0x01ff('0x35')]));if(_0x48ac49['query'][_0x01ff('0x41')]){_0x44c264[_0x01ff('0x3e')]=_[_0x01ff('0x42')](_0x44c264['where'],{'$or':_[_0x01ff('0x40')](_0x44c264[_0x01ff('0x37')],function(_0x32cba3){var _0x528452={};_0x528452[_0x32cba3]={'$like':'%'+_0x48ac49[_0x01ff('0x33')]['filter']+'%'};return _0x528452;})});}_0x44c264=_['merge']({},_0x44c264,_0x48ac49[_0x01ff('0x43')]);return _0x5abe1a[_0x01ff('0x50')](_0x44c264);}})[_0x01ff('0x26')](function(_0x586299){if(_0x586299){_0x5c53e6=_0x586299[_0x01ff('0x39')];if(!_0x48ac49[_0x01ff('0x33')][_0x01ff('0x3a')](_0x01ff('0x3b'))){_0x44c264[_0x01ff('0x1d')]=qs[_0x01ff('0x1d')](_0x48ac49['query']['limit']);_0x44c264[_0x01ff('0x1f')]=qs[_0x01ff('0x1f')](_0x48ac49['query'][_0x01ff('0x1f')]);}return _0x5abe1a[_0x01ff('0x50')](_0x44c264);}})[_0x01ff('0x26')](function(_0x2ab85c){if(_0x2ab85c){return _0x2ab85c?{'count':_0x5c53e6,'rows':_0x2ab85c}:null;}})[_0x01ff('0x26')](respondWithResult(_0x5f1c9d,null))[_0x01ff('0x4b')](handleError(_0x5f1c9d,null));};exports[_0x01ff('0x52')]=function(_0x320896,_0x400147,_0x55e207){var _0x4abe09={};var _0x5204ae={};var _0x16d632;var _0x4fe7eb;return db[_0x01ff('0x2d')][_0x01ff('0x51')]({'where':{'id':_0x320896[_0x01ff('0x4d')]['id']}})[_0x01ff('0x26')](handleEntityNotFound(_0x400147,null))[_0x01ff('0x26')](function(_0x14cb78){if(_0x14cb78){_0x16d632=_0x14cb78;_0x5204ae[_0x01ff('0x32')]=_[_0x01ff('0x34')](db[_0x01ff('0x4f')]['rawAttributes']);_0x5204ae[_0x01ff('0x33')]=_[_0x01ff('0x34')](_0x320896[_0x01ff('0x33')]);_0x5204ae[_0x01ff('0x35')]=_[_0x01ff('0x36')](_0x5204ae[_0x01ff('0x32')],_0x5204ae['query']);_0x4abe09[_0x01ff('0x37')]=_[_0x01ff('0x36')](_0x5204ae[_0x01ff('0x32')],qs[_0x01ff('0x38')](_0x320896[_0x01ff('0x33')][_0x01ff('0x38')]));_0x4abe09[_0x01ff('0x37')]=_0x4abe09[_0x01ff('0x37')][_0x01ff('0x39')]?_0x4abe09[_0x01ff('0x37')]:_0x5204ae[_0x01ff('0x32')];_0x4abe09[_0x01ff('0x3c')]=qs[_0x01ff('0x3d')](_0x320896[_0x01ff('0x33')]['sort']);_0x4abe09[_0x01ff('0x3e')]=qs[_0x01ff('0x35')](_[_0x01ff('0x3f')](_0x320896[_0x01ff('0x33')],_0x5204ae['filters']));if(_0x320896['query'][_0x01ff('0x41')]){_0x4abe09['where']=_[_0x01ff('0x42')](_0x4abe09[_0x01ff('0x3e')],{'$or':_[_0x01ff('0x40')](_0x4abe09[_0x01ff('0x37')],function(_0x43fb8e){var _0x31ed03={};_0x31ed03[_0x43fb8e]={'$like':'%'+_0x320896[_0x01ff('0x33')][_0x01ff('0x41')]+'%'};return _0x31ed03;})});}_0x4abe09=_['merge']({},_0x4abe09,_0x320896[_0x01ff('0x43')]);return _0x16d632[_0x01ff('0x52')](_0x4abe09);}})[_0x01ff('0x26')](function(_0x457995){if(_0x457995){_0x4fe7eb=_0x457995['length'];if(!_0x320896[_0x01ff('0x33')][_0x01ff('0x3a')]('nolimit')){_0x4abe09[_0x01ff('0x1d')]=qs[_0x01ff('0x1d')](_0x320896[_0x01ff('0x33')][_0x01ff('0x1d')]);_0x4abe09[_0x01ff('0x1f')]=qs[_0x01ff('0x1f')](_0x320896['query']['offset']);}return _0x16d632[_0x01ff('0x52')](_0x4abe09);}})['then'](function(_0x238aef){if(_0x238aef){return _0x238aef?{'count':_0x4fe7eb,'rows':_0x238aef}:null;}})['then'](respondWithResult(_0x400147,null))[_0x01ff('0x4b')](handleError(_0x400147,null));}; \ No newline at end of file +var _0x5b4e=['Content-Range','json','apply','reject','save','update','stack','name','index','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','merge','where','includeAll','include','findAll','then','rows','show','params','find','create','body','catch','destroy','getFields','findOne','length','getSubjects','ZohoField','options','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','offset','set'];(function(_0xdd56f0,_0x469515){var _0x236550=function(_0x2313e9){while(--_0x2313e9){_0xdd56f0['push'](_0xdd56f0['shift']());}};_0x236550(++_0x469515);}(_0x5b4e,0x82));var _0xe5b4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b4e[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xe5b4('0x0'));var rimraf=require(_0xe5b4('0x1'));var zipdir=require(_0xe5b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5b4('0x3'));var moment=require(_0xe5b4('0x4'));var BPromise=require(_0xe5b4('0x5'));var Mustache=require(_0xe5b4('0x6'));var util=require(_0xe5b4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe5b4('0x8'));var ejs=require(_0xe5b4('0x9'));var fs=require('fs');var fs_extra=require(_0xe5b4('0xa'));var _=require('lodash');var squel=require(_0xe5b4('0xb'));var crypto=require(_0xe5b4('0xc'));var jsforce=require(_0xe5b4('0xd'));var deskjs=require(_0xe5b4('0xe'));var toCsv=require(_0xe5b4('0x8'));var querystring=require(_0xe5b4('0xf'));var Papa=require(_0xe5b4('0x10'));var Redis=require(_0xe5b4('0x11'));var authService=require(_0xe5b4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe5b4('0x13'));var hardwareService=require(_0xe5b4('0x14'));var logger=require(_0xe5b4('0x15'))(_0xe5b4('0x16'));var utils=require('../../config/utils');var config=require(_0xe5b4('0x17'));var licenseUtil=require(_0xe5b4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcdb738,_0x599594){_0x599594=_0x599594||0xcc;return function(_0x44b410){if(_0x44b410){return _0xcdb738[_0xe5b4('0x19')](_0x599594);}return _0xcdb738['status'](_0x599594)[_0xe5b4('0x1a')]();};}function respondWithResult(_0x1cc68,_0x339f8a){_0x339f8a=_0x339f8a||0xc8;return function(_0x2103d8){if(_0x2103d8){return _0x1cc68[_0xe5b4('0x1b')](_0x339f8a)['json'](_0x2103d8);}};}function respondWithFilteredResult(_0x14d9d5,_0x3faddc){return function(_0x2b9217){if(_0x2b9217){var _0x37a96d=typeof _0x3faddc['offset']===_0xe5b4('0x1c')&&typeof _0x3faddc[_0xe5b4('0x1d')]===_0xe5b4('0x1c');var _0x3f9953=_0x2b9217['count'];var _0x3e4484=_0x37a96d?0x0:_0x3faddc[_0xe5b4('0x1e')];var _0x39ff07=_0x37a96d?_0x2b9217['count']:_0x3faddc[_0xe5b4('0x1e')]+_0x3faddc['limit'];var _0x150027;if(_0x39ff07>=_0x3f9953){_0x39ff07=_0x3f9953;_0x150027=0xc8;}else{_0x150027=0xce;}_0x14d9d5[_0xe5b4('0x1b')](_0x150027);return _0x14d9d5[_0xe5b4('0x1f')](_0xe5b4('0x20'),_0x3e4484+'-'+_0x39ff07+'/'+_0x3f9953)[_0xe5b4('0x21')](_0x2b9217);}return null;};}function patchUpdates(_0xf4f66e){return function(_0x3b9ed1){try{jsonpatch[_0xe5b4('0x22')](_0x3b9ed1,_0xf4f66e,!![]);}catch(_0x5df576){return BPromise[_0xe5b4('0x23')](_0x5df576);}return _0x3b9ed1[_0xe5b4('0x24')]();};}function saveUpdates(_0x1bc9fd,_0xc50f64){return function(_0x12827b){if(_0x12827b){return _0x12827b[_0xe5b4('0x25')](_0x1bc9fd)['then'](function(_0x19b881){return _0x19b881;});}return null;};}function removeEntity(_0x35697f,_0x2a7d10){return function(_0x244bb9){if(_0x244bb9){return _0x244bb9['destroy']()['then'](function(){_0x35697f['status'](0xcc)[_0xe5b4('0x1a')]();});}};}function handleEntityNotFound(_0x2dfed6,_0x576644){return function(_0x24198c){if(!_0x24198c){_0x2dfed6['sendStatus'](0x194);}return _0x24198c;};}function handleError(_0x47245a,_0x22982f){_0x22982f=_0x22982f||0x1f4;return function(_0x3a4442){logger['error'](_0x3a4442[_0xe5b4('0x26')]);if(_0x3a4442[_0xe5b4('0x27')]){delete _0x3a4442[_0xe5b4('0x27')];}_0x47245a[_0xe5b4('0x1b')](_0x22982f)['send'](_0x3a4442);};}exports[_0xe5b4('0x28')]=function(_0x550d52,_0xb8bd5e){var _0x131c2d={},_0x558c51={},_0x36fc97={'count':0x0,'rows':[]};var _0x4800a9=_['map'](db[_0xe5b4('0x29')][_0xe5b4('0x2a')],function(_0xf936b){return{'name':_0xf936b[_0xe5b4('0x2b')],'type':_0xf936b[_0xe5b4('0x2c')][_0xe5b4('0x2d')]};});_0x558c51[_0xe5b4('0x2e')]=_[_0xe5b4('0x2f')](_0x4800a9,_0xe5b4('0x27'));_0x558c51[_0xe5b4('0x30')]=_[_0xe5b4('0x31')](_0x550d52[_0xe5b4('0x30')]);_0x558c51['filters']=_[_0xe5b4('0x32')](_0x558c51[_0xe5b4('0x2e')],_0x558c51[_0xe5b4('0x30')]);_0x131c2d[_0xe5b4('0x33')]=_[_0xe5b4('0x32')](_0x558c51[_0xe5b4('0x2e')],qs[_0xe5b4('0x34')](_0x550d52[_0xe5b4('0x30')]['fields']));_0x131c2d[_0xe5b4('0x33')]=_0x131c2d['attributes']['length']?_0x131c2d[_0xe5b4('0x33')]:_0x558c51[_0xe5b4('0x2e')];if(!_0x550d52[_0xe5b4('0x30')]['hasOwnProperty'](_0xe5b4('0x35'))){_0x131c2d[_0xe5b4('0x1d')]=qs['limit'](_0x550d52['query'][_0xe5b4('0x1d')]);_0x131c2d[_0xe5b4('0x1e')]=qs[_0xe5b4('0x1e')](_0x550d52[_0xe5b4('0x30')][_0xe5b4('0x1e')]);}_0x131c2d[_0xe5b4('0x36')]=qs[_0xe5b4('0x37')](_0x550d52['query'][_0xe5b4('0x37')]);_0x131c2d['where']=qs[_0xe5b4('0x38')](_[_0xe5b4('0x39')](_0x550d52[_0xe5b4('0x30')],_0x558c51['filters']),_0x4800a9);if(_0x550d52['query'][_0xe5b4('0x3a')]){_0x131c2d['where']=_[_0xe5b4('0x3b')](_0x131c2d[_0xe5b4('0x3c')],{'$or':_[_0xe5b4('0x2f')](_0x4800a9,function(_0x110314){if(_0x110314['type']!=='VIRTUAL'){var _0x2d25be={};_0x2d25be[_0x110314[_0xe5b4('0x27')]]={'$like':'%'+_0x550d52[_0xe5b4('0x30')][_0xe5b4('0x3a')]+'%'};return _0x2d25be;}})});}_0x131c2d=_[_0xe5b4('0x3b')]({},_0x131c2d,_0x550d52['options']);var _0x9c318c={'where':_0x131c2d[_0xe5b4('0x3c')]};return db[_0xe5b4('0x29')]['count'](_0x9c318c)['then'](function(_0x3cc3f0){_0x36fc97['count']=_0x3cc3f0;if(_0x550d52[_0xe5b4('0x30')][_0xe5b4('0x3d')]){_0x131c2d[_0xe5b4('0x3e')]=[{'all':!![]}];}return db[_0xe5b4('0x29')][_0xe5b4('0x3f')](_0x131c2d);})[_0xe5b4('0x40')](function(_0xfd2c19){_0x36fc97[_0xe5b4('0x41')]=_0xfd2c19;return _0x36fc97;})['then'](respondWithFilteredResult(_0xb8bd5e,_0x131c2d))['catch'](handleError(_0xb8bd5e,null));};exports[_0xe5b4('0x42')]=function(_0x24e0d3,_0x276059){var _0x519b14={'raw':![],'where':{'id':_0x24e0d3[_0xe5b4('0x43')]['id']}},_0x327cce={};_0x327cce[_0xe5b4('0x2e')]=_[_0xe5b4('0x31')](db['ZohoConfiguration'][_0xe5b4('0x2a')]);_0x327cce[_0xe5b4('0x30')]=_[_0xe5b4('0x31')](_0x24e0d3['query']);_0x327cce[_0xe5b4('0x38')]=_[_0xe5b4('0x32')](_0x327cce[_0xe5b4('0x2e')],_0x327cce[_0xe5b4('0x30')]);_0x519b14['attributes']=_[_0xe5b4('0x32')](_0x327cce['model'],qs[_0xe5b4('0x34')](_0x24e0d3[_0xe5b4('0x30')][_0xe5b4('0x34')]));_0x519b14[_0xe5b4('0x33')]=_0x519b14[_0xe5b4('0x33')]['length']?_0x519b14[_0xe5b4('0x33')]:_0x327cce[_0xe5b4('0x2e')];if(_0x24e0d3[_0xe5b4('0x30')]['includeAll']){_0x519b14[_0xe5b4('0x3e')]=[{'all':!![]}];}_0x519b14=_[_0xe5b4('0x3b')]({},_0x519b14,_0x24e0d3['options']);return db[_0xe5b4('0x29')][_0xe5b4('0x44')](_0x519b14)[_0xe5b4('0x40')](handleEntityNotFound(_0x276059,null))[_0xe5b4('0x40')](respondWithResult(_0x276059,null))['catch'](handleError(_0x276059,null));};exports['create']=function(_0x4d9442,_0x510139){return db['ZohoConfiguration'][_0xe5b4('0x45')](_0x4d9442[_0xe5b4('0x46')],{})[_0xe5b4('0x40')](respondWithResult(_0x510139,0xc9))['catch'](handleError(_0x510139,null));};exports[_0xe5b4('0x25')]=function(_0x4b488f,_0x337e8d){if(_0x4b488f['body']['id']){delete _0x4b488f[_0xe5b4('0x46')]['id'];}return db[_0xe5b4('0x29')][_0xe5b4('0x44')]({'where':{'id':_0x4b488f['params']['id']}})[_0xe5b4('0x40')](handleEntityNotFound(_0x337e8d,null))[_0xe5b4('0x40')](saveUpdates(_0x4b488f['body'],null))[_0xe5b4('0x40')](respondWithResult(_0x337e8d,null))[_0xe5b4('0x47')](handleError(_0x337e8d,null));};exports[_0xe5b4('0x48')]=function(_0x1fbc26,_0x117e76){return db[_0xe5b4('0x29')][_0xe5b4('0x44')]({'where':{'id':_0x1fbc26[_0xe5b4('0x43')]['id']}})[_0xe5b4('0x40')](handleEntityNotFound(_0x117e76,null))[_0xe5b4('0x40')](removeEntity(_0x117e76,null))[_0xe5b4('0x47')](handleError(_0x117e76,null));};exports[_0xe5b4('0x49')]=function(_0x83019a,_0x291dbc,_0x9e8e67){var _0x3f3162={};var _0x4f17db={};var _0x86bd57;var _0x178daf;return db[_0xe5b4('0x29')][_0xe5b4('0x4a')]({'where':{'id':_0x83019a[_0xe5b4('0x43')]['id']}})[_0xe5b4('0x40')](handleEntityNotFound(_0x291dbc,null))[_0xe5b4('0x40')](function(_0x2dc058){if(_0x2dc058){_0x86bd57=_0x2dc058;_0x4f17db['model']=_[_0xe5b4('0x31')](db['ZohoField'][_0xe5b4('0x2a')]);_0x4f17db[_0xe5b4('0x30')]=_[_0xe5b4('0x31')](_0x83019a['query']);_0x4f17db['filters']=_['intersection'](_0x4f17db[_0xe5b4('0x2e')],_0x4f17db[_0xe5b4('0x30')]);_0x3f3162[_0xe5b4('0x33')]=_[_0xe5b4('0x32')](_0x4f17db['model'],qs[_0xe5b4('0x34')](_0x83019a['query'][_0xe5b4('0x34')]));_0x3f3162[_0xe5b4('0x33')]=_0x3f3162['attributes'][_0xe5b4('0x4b')]?_0x3f3162['attributes']:_0x4f17db[_0xe5b4('0x2e')];_0x3f3162[_0xe5b4('0x36')]=qs[_0xe5b4('0x37')](_0x83019a['query'][_0xe5b4('0x37')]);_0x3f3162[_0xe5b4('0x3c')]=qs['filters'](_[_0xe5b4('0x39')](_0x83019a['query'],_0x4f17db['filters']));if(_0x83019a['query'][_0xe5b4('0x3a')]){_0x3f3162[_0xe5b4('0x3c')]=_[_0xe5b4('0x3b')](_0x3f3162[_0xe5b4('0x3c')],{'$or':_['map'](_0x3f3162[_0xe5b4('0x33')],function(_0x1c010c){var _0x5dffe5={};_0x5dffe5[_0x1c010c]={'$like':'%'+_0x83019a[_0xe5b4('0x30')]['filter']+'%'};return _0x5dffe5;})});}_0x3f3162=_[_0xe5b4('0x3b')]({},_0x3f3162,_0x83019a['options']);return _0x86bd57['getFields'](_0x3f3162);}})[_0xe5b4('0x40')](function(_0x424c63){if(_0x424c63){_0x178daf=_0x424c63['length'];if(!_0x83019a[_0xe5b4('0x30')]['hasOwnProperty'](_0xe5b4('0x35'))){_0x3f3162['limit']=qs['limit'](_0x83019a[_0xe5b4('0x30')][_0xe5b4('0x1d')]);_0x3f3162['offset']=qs[_0xe5b4('0x1e')](_0x83019a['query']['offset']);}return _0x86bd57[_0xe5b4('0x49')](_0x3f3162);}})[_0xe5b4('0x40')](function(_0x3b56d0){if(_0x3b56d0){return _0x3b56d0?{'count':_0x178daf,'rows':_0x3b56d0}:null;}})[_0xe5b4('0x40')](respondWithResult(_0x291dbc,null))[_0xe5b4('0x47')](handleError(_0x291dbc,null));};exports[_0xe5b4('0x4c')]=function(_0x3e3d68,_0x4549fa,_0x8abcbf){var _0x4bc557={};var _0x19badd={};var _0xbb0ecf;var _0xa3a5e8;return db['ZohoConfiguration'][_0xe5b4('0x4a')]({'where':{'id':_0x3e3d68[_0xe5b4('0x43')]['id']}})['then'](handleEntityNotFound(_0x4549fa,null))['then'](function(_0x3386c8){if(_0x3386c8){_0xbb0ecf=_0x3386c8;_0x19badd[_0xe5b4('0x2e')]=_[_0xe5b4('0x31')](db[_0xe5b4('0x4d')][_0xe5b4('0x2a')]);_0x19badd[_0xe5b4('0x30')]=_['keys'](_0x3e3d68[_0xe5b4('0x30')]);_0x19badd[_0xe5b4('0x38')]=_['intersection'](_0x19badd['model'],_0x19badd[_0xe5b4('0x30')]);_0x4bc557[_0xe5b4('0x33')]=_[_0xe5b4('0x32')](_0x19badd[_0xe5b4('0x2e')],qs[_0xe5b4('0x34')](_0x3e3d68[_0xe5b4('0x30')][_0xe5b4('0x34')]));_0x4bc557[_0xe5b4('0x33')]=_0x4bc557['attributes'][_0xe5b4('0x4b')]?_0x4bc557[_0xe5b4('0x33')]:_0x19badd[_0xe5b4('0x2e')];_0x4bc557[_0xe5b4('0x36')]=qs['sort'](_0x3e3d68['query'][_0xe5b4('0x37')]);_0x4bc557[_0xe5b4('0x3c')]=qs[_0xe5b4('0x38')](_[_0xe5b4('0x39')](_0x3e3d68['query'],_0x19badd[_0xe5b4('0x38')]));if(_0x3e3d68[_0xe5b4('0x30')][_0xe5b4('0x3a')]){_0x4bc557[_0xe5b4('0x3c')]=_['merge'](_0x4bc557[_0xe5b4('0x3c')],{'$or':_['map'](_0x4bc557[_0xe5b4('0x33')],function(_0x5dc9ed){var _0x3b48d8={};_0x3b48d8[_0x5dc9ed]={'$like':'%'+_0x3e3d68[_0xe5b4('0x30')]['filter']+'%'};return _0x3b48d8;})});}_0x4bc557=_[_0xe5b4('0x3b')]({},_0x4bc557,_0x3e3d68[_0xe5b4('0x4e')]);return _0xbb0ecf[_0xe5b4('0x4c')](_0x4bc557);}})[_0xe5b4('0x40')](function(_0x2db9ae){if(_0x2db9ae){_0xa3a5e8=_0x2db9ae[_0xe5b4('0x4b')];if(!_0x3e3d68[_0xe5b4('0x30')][_0xe5b4('0x4f')]('nolimit')){_0x4bc557[_0xe5b4('0x1d')]=qs['limit'](_0x3e3d68[_0xe5b4('0x30')][_0xe5b4('0x1d')]);_0x4bc557[_0xe5b4('0x1e')]=qs['offset'](_0x3e3d68[_0xe5b4('0x30')]['offset']);}return _0xbb0ecf[_0xe5b4('0x4c')](_0x4bc557);}})[_0xe5b4('0x40')](function(_0x3c5e49){if(_0x3c5e49){return _0x3c5e49?{'count':_0xa3a5e8,'rows':_0x3c5e49}:null;}})[_0xe5b4('0x40')](respondWithResult(_0x4549fa,null))[_0xe5b4('0x47')](handleError(_0x4549fa,null));};exports[_0xe5b4('0x50')]=function(_0x1a6494,_0x2c85ff,_0x1fb420){var _0x4dba4d={};var _0x424a3c={};var _0x26bce2;var _0x218cc4;return db[_0xe5b4('0x29')][_0xe5b4('0x4a')]({'where':{'id':_0x1a6494['params']['id']}})['then'](handleEntityNotFound(_0x2c85ff,null))[_0xe5b4('0x40')](function(_0x26add5){if(_0x26add5){_0x26bce2=_0x26add5;_0x424a3c['model']=_[_0xe5b4('0x31')](db[_0xe5b4('0x4d')]['rawAttributes']);_0x424a3c[_0xe5b4('0x30')]=_['keys'](_0x1a6494[_0xe5b4('0x30')]);_0x424a3c['filters']=_[_0xe5b4('0x32')](_0x424a3c[_0xe5b4('0x2e')],_0x424a3c[_0xe5b4('0x30')]);_0x4dba4d[_0xe5b4('0x33')]=_[_0xe5b4('0x32')](_0x424a3c[_0xe5b4('0x2e')],qs[_0xe5b4('0x34')](_0x1a6494['query']['fields']));_0x4dba4d[_0xe5b4('0x33')]=_0x4dba4d['attributes'][_0xe5b4('0x4b')]?_0x4dba4d[_0xe5b4('0x33')]:_0x424a3c[_0xe5b4('0x2e')];_0x4dba4d[_0xe5b4('0x36')]=qs[_0xe5b4('0x37')](_0x1a6494[_0xe5b4('0x30')]['sort']);_0x4dba4d['where']=qs[_0xe5b4('0x38')](_['pick'](_0x1a6494[_0xe5b4('0x30')],_0x424a3c[_0xe5b4('0x38')]));if(_0x1a6494[_0xe5b4('0x30')][_0xe5b4('0x3a')]){_0x4dba4d[_0xe5b4('0x3c')]=_[_0xe5b4('0x3b')](_0x4dba4d[_0xe5b4('0x3c')],{'$or':_[_0xe5b4('0x2f')](_0x4dba4d[_0xe5b4('0x33')],function(_0x55a00d){var _0x3f7ac5={};_0x3f7ac5[_0x55a00d]={'$like':'%'+_0x1a6494['query']['filter']+'%'};return _0x3f7ac5;})});}_0x4dba4d=_['merge']({},_0x4dba4d,_0x1a6494['options']);return _0x26bce2[_0xe5b4('0x50')](_0x4dba4d);}})[_0xe5b4('0x40')](function(_0x456bf3){if(_0x456bf3){_0x218cc4=_0x456bf3['length'];if(!_0x1a6494[_0xe5b4('0x30')][_0xe5b4('0x4f')](_0xe5b4('0x35'))){_0x4dba4d[_0xe5b4('0x1d')]=qs[_0xe5b4('0x1d')](_0x1a6494['query'][_0xe5b4('0x1d')]);_0x4dba4d['offset']=qs[_0xe5b4('0x1e')](_0x1a6494[_0xe5b4('0x30')][_0xe5b4('0x1e')]);}return _0x26bce2['getDescriptions'](_0x4dba4d);}})['then'](function(_0x4e21e6){if(_0x4e21e6){return _0x4e21e6?{'count':_0x218cc4,'rows':_0x4e21e6}:null;}})['then'](respondWithResult(_0x2c85ff,null))[_0xe5b4('0x47')](handleError(_0x2c85ff,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 7dfcf7d..20b188c 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 _0x90d6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ZohoConfiguration'];(function(_0x410d1f,_0x57618a){var _0x18eb62=function(_0x1e8c65){while(--_0x1e8c65){_0x410d1f['push'](_0x410d1f['shift']());}};_0x18eb62(++_0x57618a);}(_0x90d6,0x84));var _0x690d=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x90d6[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x690d('0x0'));var util=require(_0x690d('0x1'));var logger=require(_0x690d('0x2'))(_0x690d('0x3'));var moment=require(_0x690d('0x4'));var BPromise=require(_0x690d('0x5'));var rp=require(_0x690d('0x6'));var fs=require('fs');var path=require(_0x690d('0x7'));var rimraf=require(_0x690d('0x8'));var config=require(_0x690d('0x9'));var attributes=require('./intZohoConfiguration.attributes');module[_0x690d('0xa')]=function(_0x2fe08b,_0x402c35){return _0x2fe08b['define'](_0x690d('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53b2=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0x53b2,0x1e6));var _0x253b=function(_0x5be54e,_0x4b048a){_0x5be54e=_0x5be54e-0x0;var _0x1019aa=_0x53b2[_0x5be54e];return _0x1019aa;};'use strict';var _=require(_0x253b('0x0'));var util=require('util');var logger=require(_0x253b('0x1'))(_0x253b('0x2'));var moment=require(_0x253b('0x3'));var BPromise=require(_0x253b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x253b('0x5'));var rimraf=require(_0x253b('0x6'));var config=require(_0x253b('0x7'));var attributes=require(_0x253b('0x8'));module[_0x253b('0x9')]=function(_0x35f868,_0x439f5f){return _0x35f868[_0x253b('0xa')](_0x253b('0xb'),attributes,{'tableName':_0x253b('0xc'),'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 feb98a4..d3dca8d 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 _0x96d6=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x1b4fad,_0x2460b8){var _0x4e5266=function(_0xa6b0fe){while(--_0xa6b0fe){_0x1b4fad['push'](_0x1b4fad['shift']());}};_0x4e5266(++_0x2460b8);}(_0x96d6,0xb8));var _0x696d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x96d6[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x696d('0x0'));var util=require(_0x696d('0x1'));var moment=require(_0x696d('0x2'));var BPromise=require(_0x696d('0x3'));var rs=require(_0x696d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x696d('0x5'))['db'];var utils=require(_0x696d('0x6'));var logger=require(_0x696d('0x7'))(_0x696d('0x8'));var config=require(_0x696d('0x9'));var jayson=require(_0x696d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4962a5,_0x2f9a8e,_0x4c34f4){return new BPromise(function(_0xfc2d57,_0x16d4a9){return client['request'](_0x4962a5,_0x4c34f4)[_0x696d('0xb')](function(_0x3b7b2f){logger[_0x696d('0xc')](_0x696d('0xd'),_0x2f9a8e,_0x696d('0xe'));logger[_0x696d('0xf')](_0x696d('0x10'),_0x2f9a8e,_0x696d('0xe'),JSON[_0x696d('0x11')](_0x3b7b2f));if(_0x3b7b2f['error']){if(_0x3b7b2f[_0x696d('0x12')]['code']===0x1f4){logger[_0x696d('0x12')](_0x696d('0xd'),_0x2f9a8e,_0x3b7b2f['error'][_0x696d('0x13')]);return _0x16d4a9(_0x3b7b2f[_0x696d('0x12')][_0x696d('0x13')]);}logger[_0x696d('0x12')](_0x696d('0xd'),_0x2f9a8e,_0x3b7b2f[_0x696d('0x12')][_0x696d('0x13')]);return _0xfc2d57(_0x3b7b2f['error'][_0x696d('0x13')]);}else{logger[_0x696d('0xc')](_0x696d('0xd'),_0x2f9a8e,'request\x20sent');_0xfc2d57(_0x3b7b2f[_0x696d('0x14')]['message']);}})['catch'](function(_0x22c553){logger[_0x696d('0x12')](_0x696d('0xd'),_0x2f9a8e,_0x22c553);_0x16d4a9(_0x22c553);});});} \ No newline at end of file +var _0x7e8b=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x465cf2,_0x328646){var _0x55d12f=function(_0x5ca3f5){while(--_0x5ca3f5){_0x465cf2['push'](_0x465cf2['shift']());}};_0x55d12f(++_0x328646);}(_0x7e8b,0x1b8));var _0xb7e8=function(_0x13d878,_0x3ac33){_0x13d878=_0x13d878-0x0;var _0x4f9280=_0x7e8b[_0x13d878];return _0x4f9280;};'use strict';var _=require(_0xb7e8('0x0'));var util=require(_0xb7e8('0x1'));var moment=require(_0xb7e8('0x2'));var BPromise=require(_0xb7e8('0x3'));var rs=require(_0xb7e8('0x4'));var fs=require('fs');var Redis=require(_0xb7e8('0x5'));var db=require(_0xb7e8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7e8('0x7'))(_0xb7e8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e2420,_0x4282a3,_0x5b8a05){return new BPromise(function(_0x106d4f,_0x2c5b8c){return client[_0xb7e8('0x9')](_0x2e2420,_0x5b8a05)[_0xb7e8('0xa')](function(_0x3b7065){logger[_0xb7e8('0xb')](_0xb7e8('0xc'),_0x4282a3,_0xb7e8('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4282a3,'request\x20sent',JSON['stringify'](_0x3b7065));if(_0x3b7065[_0xb7e8('0xe')]){if(_0x3b7065['error'][_0xb7e8('0xf')]===0x1f4){logger[_0xb7e8('0xe')](_0xb7e8('0xc'),_0x4282a3,_0x3b7065[_0xb7e8('0xe')][_0xb7e8('0x10')]);return _0x2c5b8c(_0x3b7065[_0xb7e8('0xe')][_0xb7e8('0x10')]);}logger[_0xb7e8('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x4282a3,_0x3b7065[_0xb7e8('0xe')]['message']);return _0x106d4f(_0x3b7065['error'][_0xb7e8('0x10')]);}else{logger[_0xb7e8('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x4282a3,_0xb7e8('0xd'));_0x106d4f(_0x3b7065[_0xb7e8('0x11')][_0xb7e8('0x10')]);}})[_0xb7e8('0x12')](function(_0x31b38b){logger[_0xb7e8('0xe')](_0xb7e8('0xc'),_0x4282a3,_0x31b38b);_0x2c5b8c(_0x31b38b);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 3592ac2..e5b4dab 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 _0x3e0d=['exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x3e0d,0x1e1));var _0xd3e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e0d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd3e0('0x0'));var path=require(_0xd3e0('0x1'));var timeout=require('connect-timeout');var express=require(_0xd3e0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd3e0('0x3'));var interaction=require(_0xd3e0('0x4'));var config=require(_0xd3e0('0x5'));var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd3e0('0x6')]);router[_0xd3e0('0x7')](_0xd3e0('0x8'),auth[_0xd3e0('0x9')](),controller[_0xd3e0('0xa')]);router[_0xd3e0('0xb')]('/',auth[_0xd3e0('0x9')](),controller[_0xd3e0('0xc')]);router[_0xd3e0('0xd')](_0xd3e0('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xd3e0('0xe')](_0xd3e0('0x8'),auth[_0xd3e0('0x9')](),controller['destroy']);module[_0xd3e0('0xf')]=router; \ No newline at end of file +var _0x54b8=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','index','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x129098,_0x5b4d7a){var _0x588f8c=function(_0x634796){while(--_0x634796){_0x129098['push'](_0x129098['shift']());}};_0x588f8c(++_0x5b4d7a);}(_0x54b8,0x165));var _0x854b=function(_0x4a0274,_0x1e679c){_0x4a0274=_0x4a0274-0x0;var _0x1df1e0=_0x54b8[_0x4a0274];return _0x1df1e0;};'use strict';var multer=require(_0x854b('0x0'));var util=require(_0x854b('0x1'));var path=require(_0x854b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x854b('0x3')]();var fs_extra=require(_0x854b('0x4'));var auth=require(_0x854b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x854b('0x6'));var controller=require(_0x854b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x854b('0x8')]);router[_0x854b('0x9')](_0x854b('0xa'),auth[_0x854b('0xb')](),controller['show']);router[_0x854b('0xc')]('/',auth[_0x854b('0xb')](),controller[_0x854b('0xd')]);router[_0x854b('0xe')](_0x854b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x854b('0xf')](_0x854b('0xa'),auth[_0x854b('0xb')](),controller[_0x854b('0x10')]);module[_0x854b('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 d44697e..1fb04d5 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 _0x1475=['customVariable','STRING','sequelize','exports','ENUM','string','keyValue','picklist','variable'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x1475,0x1c4));var _0x5147=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x1475[_0x261b8a];return _0x3455e8;};'use strict';var Sequelize=require(_0x5147('0x0'));module[_0x5147('0x1')]={'type':{'type':Sequelize[_0x5147('0x2')](_0x5147('0x3'),'variable','customVariable',_0x5147('0x4'),_0x5147('0x5')),'defaultValue':_0x5147('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5147('0x2')]('string',_0x5147('0x6'),_0x5147('0x7'))},'keyContent':{'type':Sequelize[_0x5147('0x8')]},'idField':{'type':Sequelize[_0x5147('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7ecb=['customVariable','keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x3b72c9,_0x1349fb){var _0x1adbd7=function(_0x1c403f){while(--_0x1c403f){_0x3b72c9['push'](_0x3b72c9['shift']());}};_0x1adbd7(++_0x1349fb);}(_0x7ecb,0x1be));var _0xb7ec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ecb[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb7ec('0x0'));module[_0xb7ec('0x1')]={'type':{'type':Sequelize[_0xb7ec('0x2')]('string',_0xb7ec('0x3'),_0xb7ec('0x4'),_0xb7ec('0x5'),'picklist'),'defaultValue':_0xb7ec('0x6')},'content':{'type':Sequelize[_0xb7ec('0x7')]},'key':{'type':Sequelize[_0xb7ec('0x7')]},'keyType':{'type':Sequelize[_0xb7ec('0x2')](_0xb7ec('0x6'),_0xb7ec('0x3'),_0xb7ec('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb7ec('0x7')]},'nameField':{'type':Sequelize[_0xb7ec('0x7')]},'customField':{'type':Sequelize[_0xb7ec('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 35e7424..49ec30d 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 _0x0373=['stack','name','send','index','map','ZohoField','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0373,0xf6));var _0x3037=function(_0x4862de,_0x3ea85f){_0x4862de=_0x4862de-0x0;var _0x59c5b0=_0x0373[_0x4862de];return _0x59c5b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3037('0x0'));var zipdir=require(_0x3037('0x1'));var jsonpatch=require(_0x3037('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3037('0x3'));var Mustache=require(_0x3037('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3037('0x5'));var fs=require('fs');var fs_extra=require(_0x3037('0x6'));var _=require('lodash');var squel=require(_0x3037('0x7'));var crypto=require(_0x3037('0x8'));var jsforce=require(_0x3037('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3037('0xa'));var Papa=require(_0x3037('0xb'));var Redis=require('ioredis');var authService=require(_0x3037('0xc'));var qs=require(_0x3037('0xd'));var as=require(_0x3037('0xe'));var hardwareService=require(_0x3037('0xf'));var logger=require(_0x3037('0x10'))(_0x3037('0x11'));var utils=require(_0x3037('0x12'));var config=require(_0x3037('0x13'));var licenseUtil=require(_0x3037('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x267264,_0x214d0f){_0x214d0f=_0x214d0f||0xcc;return function(_0xb8879d){if(_0xb8879d){return _0x267264['sendStatus'](_0x214d0f);}return _0x267264[_0x3037('0x15')](_0x214d0f)[_0x3037('0x16')]();};}function respondWithResult(_0x307ccf,_0x20ecee){_0x20ecee=_0x20ecee||0xc8;return function(_0x30db1b){if(_0x30db1b){return _0x307ccf['status'](_0x20ecee)['json'](_0x30db1b);}};}function respondWithFilteredResult(_0x335164,_0x29e4da){return function(_0x38a16f){if(_0x38a16f){var _0x1435dc=typeof _0x29e4da[_0x3037('0x17')]===_0x3037('0x18')&&typeof _0x29e4da[_0x3037('0x19')]==='undefined';var _0x4c16f0=_0x38a16f[_0x3037('0x1a')];var _0x49a8c7=_0x1435dc?0x0:_0x29e4da[_0x3037('0x17')];var _0x1a5480=_0x1435dc?_0x38a16f[_0x3037('0x1a')]:_0x29e4da[_0x3037('0x17')]+_0x29e4da[_0x3037('0x19')];var _0xeb6794;if(_0x1a5480>=_0x4c16f0){_0x1a5480=_0x4c16f0;_0xeb6794=0xc8;}else{_0xeb6794=0xce;}_0x335164[_0x3037('0x15')](_0xeb6794);return _0x335164['set'](_0x3037('0x1b'),_0x49a8c7+'-'+_0x1a5480+'/'+_0x4c16f0)[_0x3037('0x1c')](_0x38a16f);}return null;};}function patchUpdates(_0x15dfad){return function(_0x1cbb86){try{jsonpatch['apply'](_0x1cbb86,_0x15dfad,!![]);}catch(_0xf34a21){return BPromise[_0x3037('0x1d')](_0xf34a21);}return _0x1cbb86[_0x3037('0x1e')]();};}function saveUpdates(_0x6dfc37,_0x2c7839){return function(_0x1e13aa){if(_0x1e13aa){return _0x1e13aa[_0x3037('0x1f')](_0x6dfc37)[_0x3037('0x20')](function(_0x3e9a3d){return _0x3e9a3d;});}return null;};}function removeEntity(_0x3a3d4d,_0x1a763b){return function(_0x215d4d){if(_0x215d4d){return _0x215d4d[_0x3037('0x21')]()[_0x3037('0x20')](function(){_0x3a3d4d[_0x3037('0x15')](0xcc)[_0x3037('0x16')]();});}};}function handleEntityNotFound(_0x4ad019,_0x1d80c9){return function(_0x2a4bc2){if(!_0x2a4bc2){_0x4ad019['sendStatus'](0x194);}return _0x2a4bc2;};}function handleError(_0x5c882e,_0x526c0d){_0x526c0d=_0x526c0d||0x1f4;return function(_0x39605f){logger['error'](_0x39605f[_0x3037('0x22')]);if(_0x39605f[_0x3037('0x23')]){delete _0x39605f['name'];}_0x5c882e[_0x3037('0x15')](_0x526c0d)[_0x3037('0x24')](_0x39605f);};}exports[_0x3037('0x25')]=function(_0x4f1b7b,_0x334613){var _0x5ad1f2={},_0x1b5210={},_0x43c3a8={'count':0x0,'rows':[]};var _0x11b12=_[_0x3037('0x26')](db[_0x3037('0x27')]['rawAttributes'],function(_0xeb7a23){return{'name':_0xeb7a23[_0x3037('0x28')],'type':_0xeb7a23[_0x3037('0x29')]['key']};});_0x1b5210[_0x3037('0x2a')]=_['map'](_0x11b12,_0x3037('0x23'));_0x1b5210[_0x3037('0x2b')]=_['keys'](_0x4f1b7b[_0x3037('0x2b')]);_0x1b5210['filters']=_[_0x3037('0x2c')](_0x1b5210['model'],_0x1b5210[_0x3037('0x2b')]);_0x5ad1f2['attributes']=_[_0x3037('0x2c')](_0x1b5210['model'],qs['fields'](_0x4f1b7b[_0x3037('0x2b')][_0x3037('0x2d')]));_0x5ad1f2[_0x3037('0x2e')]=_0x5ad1f2[_0x3037('0x2e')][_0x3037('0x2f')]?_0x5ad1f2[_0x3037('0x2e')]:_0x1b5210[_0x3037('0x2a')];if(!_0x4f1b7b[_0x3037('0x2b')][_0x3037('0x30')]('nolimit')){_0x5ad1f2[_0x3037('0x19')]=qs[_0x3037('0x19')](_0x4f1b7b['query']['limit']);_0x5ad1f2[_0x3037('0x17')]=qs['offset'](_0x4f1b7b[_0x3037('0x2b')]['offset']);}_0x5ad1f2[_0x3037('0x31')]=qs[_0x3037('0x32')](_0x4f1b7b[_0x3037('0x2b')][_0x3037('0x32')]);_0x5ad1f2['where']=qs[_0x3037('0x33')](_[_0x3037('0x34')](_0x4f1b7b[_0x3037('0x2b')],_0x1b5210['filters']),_0x11b12);if(_0x4f1b7b['query'][_0x3037('0x35')]){_0x5ad1f2[_0x3037('0x36')]=_[_0x3037('0x37')](_0x5ad1f2[_0x3037('0x36')],{'$or':_[_0x3037('0x26')](_0x11b12,function(_0x1877f0){if(_0x1877f0[_0x3037('0x29')]!==_0x3037('0x38')){var _0x382e63={};_0x382e63[_0x1877f0['name']]={'$like':'%'+_0x4f1b7b[_0x3037('0x2b')][_0x3037('0x35')]+'%'};return _0x382e63;}})});}_0x5ad1f2=_['merge']({},_0x5ad1f2,_0x4f1b7b['options']);var _0x1e55e5={'where':_0x5ad1f2['where']};return db[_0x3037('0x27')]['count'](_0x1e55e5)[_0x3037('0x20')](function(_0x58eb1f){_0x43c3a8[_0x3037('0x1a')]=_0x58eb1f;if(_0x4f1b7b[_0x3037('0x2b')][_0x3037('0x39')]){_0x5ad1f2[_0x3037('0x3a')]=[{'all':!![]}];}return db[_0x3037('0x27')][_0x3037('0x3b')](_0x5ad1f2);})[_0x3037('0x20')](function(_0x1ccbb6){_0x43c3a8[_0x3037('0x3c')]=_0x1ccbb6;return _0x43c3a8;})[_0x3037('0x20')](respondWithFilteredResult(_0x334613,_0x5ad1f2))[_0x3037('0x3d')](handleError(_0x334613,null));};exports[_0x3037('0x3e')]=function(_0x44e971,_0x50e503){var _0x2a9e0c={'raw':!![],'where':{'id':_0x44e971[_0x3037('0x3f')]['id']}},_0x4cb326={};_0x4cb326['model']=_[_0x3037('0x40')](db[_0x3037('0x27')][_0x3037('0x41')]);_0x4cb326[_0x3037('0x2b')]=_[_0x3037('0x40')](_0x44e971['query']);_0x4cb326[_0x3037('0x33')]=_[_0x3037('0x2c')](_0x4cb326['model'],_0x4cb326[_0x3037('0x2b')]);_0x2a9e0c[_0x3037('0x2e')]=_[_0x3037('0x2c')](_0x4cb326['model'],qs['fields'](_0x44e971[_0x3037('0x2b')][_0x3037('0x2d')]));_0x2a9e0c[_0x3037('0x2e')]=_0x2a9e0c[_0x3037('0x2e')][_0x3037('0x2f')]?_0x2a9e0c[_0x3037('0x2e')]:_0x4cb326['model'];if(_0x44e971['query'][_0x3037('0x39')]){_0x2a9e0c[_0x3037('0x3a')]=[{'all':!![]}];}_0x2a9e0c=_[_0x3037('0x37')]({},_0x2a9e0c,_0x44e971[_0x3037('0x42')]);return db['ZohoField'][_0x3037('0x43')](_0x2a9e0c)[_0x3037('0x20')](handleEntityNotFound(_0x50e503,null))[_0x3037('0x20')](respondWithResult(_0x50e503,null))[_0x3037('0x3d')](handleError(_0x50e503,null));};exports['create']=function(_0x224b1a,_0xfa206a){return db['ZohoField'][_0x3037('0x44')](_0x224b1a[_0x3037('0x45')],{})['then'](respondWithResult(_0xfa206a,0xc9))[_0x3037('0x3d')](handleError(_0xfa206a,null));};exports[_0x3037('0x1f')]=function(_0x18a145,_0x1a17d8){if(_0x18a145[_0x3037('0x45')]['id']){delete _0x18a145[_0x3037('0x45')]['id'];}return db[_0x3037('0x27')]['find']({'where':{'id':_0x18a145[_0x3037('0x3f')]['id']}})[_0x3037('0x20')](handleEntityNotFound(_0x1a17d8,null))['then'](saveUpdates(_0x18a145[_0x3037('0x45')],null))[_0x3037('0x20')](respondWithResult(_0x1a17d8,null))[_0x3037('0x3d')](handleError(_0x1a17d8,null));};exports[_0x3037('0x21')]=function(_0x23775a,_0x413d45){return db['ZohoField'][_0x3037('0x43')]({'where':{'id':_0x23775a[_0x3037('0x3f')]['id']}})[_0x3037('0x20')](handleEntityNotFound(_0x413d45,null))[_0x3037('0x20')](removeEntity(_0x413d45,null))[_0x3037('0x3d')](handleError(_0x413d45,null));}; \ No newline at end of file +var _0xb517=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb517,0x1d3));var _0x7b51=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xb517[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7b51('0x0'));var jsonpatch=require(_0x7b51('0x1'));var rp=require('request-promise');var moment=require(_0x7b51('0x2'));var BPromise=require(_0x7b51('0x3'));var Mustache=require(_0x7b51('0x4'));var util=require(_0x7b51('0x5'));var path=require(_0x7b51('0x6'));var sox=require(_0x7b51('0x7'));var csv=require('to-csv');var ejs=require(_0x7b51('0x8'));var fs=require('fs');var fs_extra=require(_0x7b51('0x9'));var _=require(_0x7b51('0xa'));var squel=require(_0x7b51('0xb'));var crypto=require('crypto');var jsforce=require(_0x7b51('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7b51('0xd'));var Papa=require(_0x7b51('0xe'));var Redis=require('ioredis');var authService=require(_0x7b51('0xf'));var qs=require(_0x7b51('0x10'));var as=require(_0x7b51('0x11'));var hardwareService=require(_0x7b51('0x12'));var logger=require('../../config/logger')(_0x7b51('0x13'));var utils=require(_0x7b51('0x14'));var config=require(_0x7b51('0x15'));var licenseUtil=require(_0x7b51('0x16'));var db=require(_0x7b51('0x17'))['db'];function respondWithStatusCode(_0x1daadd,_0x39d7cf){_0x39d7cf=_0x39d7cf||0xcc;return function(_0x1afd15){if(_0x1afd15){return _0x1daadd[_0x7b51('0x18')](_0x39d7cf);}return _0x1daadd[_0x7b51('0x19')](_0x39d7cf)[_0x7b51('0x1a')]();};}function respondWithResult(_0x35d3f4,_0x354313){_0x354313=_0x354313||0xc8;return function(_0x51fa37){if(_0x51fa37){return _0x35d3f4[_0x7b51('0x19')](_0x354313)[_0x7b51('0x1b')](_0x51fa37);}};}function respondWithFilteredResult(_0x502bc6,_0x8a981f){return function(_0x470f14){if(_0x470f14){var _0x2b5b94=typeof _0x8a981f[_0x7b51('0x1c')]===_0x7b51('0x1d')&&typeof _0x8a981f['limit']==='undefined';var _0x1998e1=_0x470f14[_0x7b51('0x1e')];var _0x270284=_0x2b5b94?0x0:_0x8a981f['offset'];var _0x48b0dd=_0x2b5b94?_0x470f14['count']:_0x8a981f['offset']+_0x8a981f[_0x7b51('0x1f')];var _0x116427;if(_0x48b0dd>=_0x1998e1){_0x48b0dd=_0x1998e1;_0x116427=0xc8;}else{_0x116427=0xce;}_0x502bc6[_0x7b51('0x19')](_0x116427);return _0x502bc6[_0x7b51('0x20')](_0x7b51('0x21'),_0x270284+'-'+_0x48b0dd+'/'+_0x1998e1)[_0x7b51('0x1b')](_0x470f14);}return null;};}function patchUpdates(_0x2f1d5e){return function(_0x3caade){try{jsonpatch['apply'](_0x3caade,_0x2f1d5e,!![]);}catch(_0x275e5b){return BPromise['reject'](_0x275e5b);}return _0x3caade['save']();};}function saveUpdates(_0x39c01f,_0xb8a734){return function(_0x58ce04){if(_0x58ce04){return _0x58ce04[_0x7b51('0x22')](_0x39c01f)[_0x7b51('0x23')](function(_0x2a08da){return _0x2a08da;});}return null;};}function removeEntity(_0x2f3a8d,_0x55b98c){return function(_0x6c3b68){if(_0x6c3b68){return _0x6c3b68[_0x7b51('0x24')]()[_0x7b51('0x23')](function(){_0x2f3a8d['status'](0xcc)[_0x7b51('0x1a')]();});}};}function handleEntityNotFound(_0x3977da,_0x5b0c25){return function(_0x2de3e1){if(!_0x2de3e1){_0x3977da[_0x7b51('0x18')](0x194);}return _0x2de3e1;};}function handleError(_0x54899e,_0x482829){_0x482829=_0x482829||0x1f4;return function(_0x5be16f){logger['error'](_0x5be16f['stack']);if(_0x5be16f[_0x7b51('0x25')]){delete _0x5be16f[_0x7b51('0x25')];}_0x54899e[_0x7b51('0x19')](_0x482829)[_0x7b51('0x26')](_0x5be16f);};}exports[_0x7b51('0x27')]=function(_0x3b9359,_0x15c9c2){var _0x171e36={},_0x3c4fb0={},_0x51f0d4={'count':0x0,'rows':[]};var _0x4f03a0=_[_0x7b51('0x28')](db[_0x7b51('0x29')][_0x7b51('0x2a')],function(_0x2f3551){return{'name':_0x2f3551[_0x7b51('0x2b')],'type':_0x2f3551[_0x7b51('0x2c')][_0x7b51('0x2d')]};});_0x3c4fb0[_0x7b51('0x2e')]=_[_0x7b51('0x28')](_0x4f03a0,_0x7b51('0x25'));_0x3c4fb0[_0x7b51('0x2f')]=_[_0x7b51('0x30')](_0x3b9359[_0x7b51('0x2f')]);_0x3c4fb0['filters']=_[_0x7b51('0x31')](_0x3c4fb0[_0x7b51('0x2e')],_0x3c4fb0[_0x7b51('0x2f')]);_0x171e36['attributes']=_[_0x7b51('0x31')](_0x3c4fb0[_0x7b51('0x2e')],qs[_0x7b51('0x32')](_0x3b9359[_0x7b51('0x2f')][_0x7b51('0x32')]));_0x171e36['attributes']=_0x171e36[_0x7b51('0x33')][_0x7b51('0x34')]?_0x171e36[_0x7b51('0x33')]:_0x3c4fb0[_0x7b51('0x2e')];if(!_0x3b9359[_0x7b51('0x2f')][_0x7b51('0x35')](_0x7b51('0x36'))){_0x171e36[_0x7b51('0x1f')]=qs['limit'](_0x3b9359['query'][_0x7b51('0x1f')]);_0x171e36[_0x7b51('0x1c')]=qs[_0x7b51('0x1c')](_0x3b9359['query'][_0x7b51('0x1c')]);}_0x171e36[_0x7b51('0x37')]=qs[_0x7b51('0x38')](_0x3b9359[_0x7b51('0x2f')][_0x7b51('0x38')]);_0x171e36[_0x7b51('0x39')]=qs[_0x7b51('0x3a')](_[_0x7b51('0x3b')](_0x3b9359[_0x7b51('0x2f')],_0x3c4fb0[_0x7b51('0x3a')]),_0x4f03a0);if(_0x3b9359['query'][_0x7b51('0x3c')]){_0x171e36[_0x7b51('0x39')]=_[_0x7b51('0x3d')](_0x171e36[_0x7b51('0x39')],{'$or':_[_0x7b51('0x28')](_0x4f03a0,function(_0x58b7fa){if(_0x58b7fa[_0x7b51('0x2c')]!==_0x7b51('0x3e')){var _0x341d50={};_0x341d50[_0x58b7fa['name']]={'$like':'%'+_0x3b9359[_0x7b51('0x2f')][_0x7b51('0x3c')]+'%'};return _0x341d50;}})});}_0x171e36=_[_0x7b51('0x3d')]({},_0x171e36,_0x3b9359[_0x7b51('0x3f')]);var _0x22509f={'where':_0x171e36['where']};return db[_0x7b51('0x29')][_0x7b51('0x1e')](_0x22509f)[_0x7b51('0x23')](function(_0x18e255){_0x51f0d4[_0x7b51('0x1e')]=_0x18e255;if(_0x3b9359[_0x7b51('0x2f')][_0x7b51('0x40')]){_0x171e36[_0x7b51('0x41')]=[{'all':!![]}];}return db[_0x7b51('0x29')][_0x7b51('0x42')](_0x171e36);})[_0x7b51('0x23')](function(_0x3aa5ff){_0x51f0d4[_0x7b51('0x43')]=_0x3aa5ff;return _0x51f0d4;})['then'](respondWithFilteredResult(_0x15c9c2,_0x171e36))['catch'](handleError(_0x15c9c2,null));};exports[_0x7b51('0x44')]=function(_0x1828e2,_0x19abac){var _0x56e509={'raw':!![],'where':{'id':_0x1828e2[_0x7b51('0x45')]['id']}},_0x5e0cf1={};_0x5e0cf1[_0x7b51('0x2e')]=_[_0x7b51('0x30')](db['ZohoField'][_0x7b51('0x2a')]);_0x5e0cf1[_0x7b51('0x2f')]=_['keys'](_0x1828e2['query']);_0x5e0cf1[_0x7b51('0x3a')]=_[_0x7b51('0x31')](_0x5e0cf1['model'],_0x5e0cf1[_0x7b51('0x2f')]);_0x56e509[_0x7b51('0x33')]=_['intersection'](_0x5e0cf1[_0x7b51('0x2e')],qs[_0x7b51('0x32')](_0x1828e2[_0x7b51('0x2f')][_0x7b51('0x32')]));_0x56e509[_0x7b51('0x33')]=_0x56e509[_0x7b51('0x33')][_0x7b51('0x34')]?_0x56e509[_0x7b51('0x33')]:_0x5e0cf1[_0x7b51('0x2e')];if(_0x1828e2[_0x7b51('0x2f')][_0x7b51('0x40')]){_0x56e509[_0x7b51('0x41')]=[{'all':!![]}];}_0x56e509=_[_0x7b51('0x3d')]({},_0x56e509,_0x1828e2[_0x7b51('0x3f')]);return db[_0x7b51('0x29')][_0x7b51('0x46')](_0x56e509)[_0x7b51('0x23')](handleEntityNotFound(_0x19abac,null))[_0x7b51('0x23')](respondWithResult(_0x19abac,null))[_0x7b51('0x47')](handleError(_0x19abac,null));};exports[_0x7b51('0x48')]=function(_0x901886,_0x21d3f7){return db[_0x7b51('0x29')][_0x7b51('0x48')](_0x901886[_0x7b51('0x49')],{})[_0x7b51('0x23')](respondWithResult(_0x21d3f7,0xc9))['catch'](handleError(_0x21d3f7,null));};exports['update']=function(_0x579f18,_0x92a622){if(_0x579f18[_0x7b51('0x49')]['id']){delete _0x579f18[_0x7b51('0x49')]['id'];}return db[_0x7b51('0x29')]['find']({'where':{'id':_0x579f18['params']['id']}})[_0x7b51('0x23')](handleEntityNotFound(_0x92a622,null))[_0x7b51('0x23')](saveUpdates(_0x579f18[_0x7b51('0x49')],null))[_0x7b51('0x23')](respondWithResult(_0x92a622,null))['catch'](handleError(_0x92a622,null));};exports[_0x7b51('0x24')]=function(_0x515d80,_0x2dbe14){return db[_0x7b51('0x29')][_0x7b51('0x46')]({'where':{'id':_0x515d80[_0x7b51('0x45')]['id']}})[_0x7b51('0x23')](handleEntityNotFound(_0x2dbe14,null))[_0x7b51('0x23')](removeEntity(_0x2dbe14,null))[_0x7b51('0x47')](handleError(_0x2dbe14,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 3a7bb57..2b0409f 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 _0xb145=['api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x101d5b,_0x40cfd){var _0x382a50=function(_0x2fd131){while(--_0x2fd131){_0x101d5b['push'](_0x101d5b['shift']());}};_0x382a50(++_0x40cfd);}(_0xb145,0xa3));var _0x5b14=function(_0x2f3b54,_0xd45ba2){_0x2f3b54=_0x2f3b54-0x0;var _0x190359=_0xb145[_0x2f3b54];return _0x190359;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));module[_0x5b14('0x9')]=function(_0x392425,_0x4d82ad){return _0x392425['define'](_0x5b14('0xa'),attributes,{'tableName':_0x5b14('0xb'),'paranoid':![],'indexes':[{'name':_0x5b14('0xc'),'fields':[_0x5b14('0xd'),_0x5b14('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e24=['request-promise','path','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x6c38e,_0x3dadb4){var _0x1a9b04=function(_0x254b07){while(--_0x254b07){_0x6c38e['push'](_0x6c38e['shift']());}};_0x1a9b04(++_0x3dadb4);}(_0x3e24,0x167));var _0x43e2=function(_0x91ff52,_0x2cde3c){_0x91ff52=_0x91ff52-0x0;var _0x37d193=_0x3e24[_0x91ff52];return _0x37d193;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var logger=require(_0x43e2('0x2'))(_0x43e2('0x3'));var moment=require(_0x43e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x43e2('0x5'));var fs=require('fs');var path=require(_0x43e2('0x6'));var rimraf=require('rimraf');var config=require(_0x43e2('0x7'));var attributes=require(_0x43e2('0x8'));module[_0x43e2('0x9')]=function(_0x28b144,_0x43b5a7){return _0x28b144[_0x43e2('0xa')](_0x43e2('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x43e2('0xc'),'fields':[_0x43e2('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 1eeee64..3323841 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 _0x8513=['ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8513,0xc2));var _0x3851=function(_0x4db844,_0x468bb9){_0x4db844=_0x4db844-0x0;var _0x25f99c=_0x8513[_0x4db844];return _0x25f99c;};'use strict';var _=require(_0x3851('0x0'));var util=require(_0x3851('0x1'));var moment=require(_0x3851('0x2'));var BPromise=require('bluebird');var rs=require(_0x3851('0x3'));var fs=require('fs');var Redis=require(_0x3851('0x4'));var db=require(_0x3851('0x5'))['db'];var utils=require(_0x3851('0x6'));var logger=require(_0x3851('0x7'))(_0x3851('0x8'));var config=require('../../config/environment');var jayson=require(_0x3851('0x9'));var client=jayson[_0x3851('0xa')][_0x3851('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b3fbc,_0x2cbd87,_0x5572d1){return new BPromise(function(_0x405a5b,_0x148429){return client['request'](_0x2b3fbc,_0x5572d1)[_0x3851('0xc')](function(_0x3d7274){logger['info'](_0x3851('0xd'),_0x2cbd87,'request\x20sent');logger[_0x3851('0xe')](_0x3851('0xf'),_0x2cbd87,_0x3851('0x10'),JSON[_0x3851('0x11')](_0x3d7274));if(_0x3d7274[_0x3851('0x12')]){if(_0x3d7274[_0x3851('0x12')][_0x3851('0x13')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x2cbd87,_0x3d7274[_0x3851('0x12')][_0x3851('0x14')]);return _0x148429(_0x3d7274[_0x3851('0x12')]['message']);}logger['error'](_0x3851('0xd'),_0x2cbd87,_0x3d7274['error'][_0x3851('0x14')]);return _0x405a5b(_0x3d7274['error'][_0x3851('0x14')]);}else{logger[_0x3851('0x15')](_0x3851('0xd'),_0x2cbd87,'request\x20sent');_0x405a5b(_0x3d7274['result'][_0x3851('0x14')]);}})[_0x3851('0x16')](function(_0x3d35e8){logger[_0x3851('0x12')](_0x3851('0xd'),_0x2cbd87,_0x3d35e8);_0x148429(_0x3d35e8);});});} \ No newline at end of file +var _0x8698=['debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x76176a,_0x1493dd){var _0xd70d1c=function(_0x2ff0b2){while(--_0x2ff0b2){_0x76176a['push'](_0x76176a['shift']());}};_0xd70d1c(++_0x1493dd);}(_0x8698,0xaf));var _0x8869=function(_0x25c371,_0x25b0ad){_0x25c371=_0x25c371-0x0;var _0x22d6e4=_0x8698[_0x25c371];return _0x22d6e4;};'use strict';var _=require(_0x8869('0x0'));var util=require(_0x8869('0x1'));var moment=require(_0x8869('0x2'));var BPromise=require(_0x8869('0x3'));var rs=require(_0x8869('0x4'));var fs=require('fs');var Redis=require(_0x8869('0x5'));var db=require(_0x8869('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8869('0x7'))(_0x8869('0x8'));var config=require(_0x8869('0x9'));var jayson=require(_0x8869('0xa'));var client=jayson[_0x8869('0xb')][_0x8869('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x517ffe,_0x22bb10,_0x4dead4){return new BPromise(function(_0x590ae9,_0x11a132){return client[_0x8869('0xd')](_0x517ffe,_0x4dead4)['then'](function(_0x4bb6f3){logger[_0x8869('0xe')](_0x8869('0xf'),_0x22bb10,_0x8869('0x10'));logger[_0x8869('0x11')](_0x8869('0x12'),_0x22bb10,'request\x20sent',JSON['stringify'](_0x4bb6f3));if(_0x4bb6f3[_0x8869('0x13')]){if(_0x4bb6f3[_0x8869('0x13')][_0x8869('0x14')]===0x1f4){logger[_0x8869('0x13')]('ZohoField,\x20%s,\x20%s',_0x22bb10,_0x4bb6f3[_0x8869('0x13')][_0x8869('0x15')]);return _0x11a132(_0x4bb6f3[_0x8869('0x13')]['message']);}logger['error'](_0x8869('0xf'),_0x22bb10,_0x4bb6f3['error'][_0x8869('0x15')]);return _0x590ae9(_0x4bb6f3[_0x8869('0x13')][_0x8869('0x15')]);}else{logger[_0x8869('0xe')](_0x8869('0xf'),_0x22bb10,_0x8869('0x10'));_0x590ae9(_0x4bb6f3[_0x8869('0x16')][_0x8869('0x15')]);}})[_0x8869('0x17')](function(_0x2c1daf){logger[_0x8869('0x13')](_0x8869('0xf'),_0x22bb10,_0x2c1daf);_0x11a132(_0x2c1daf);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 32f4df5..76d8ca5 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5ee359,_0x3f9a1e){var _0xe31cb2=function(_0x53dd9c){while(--_0x53dd9c){_0x5ee359['push'](_0x5ee359['shift']());}};_0xe31cb2(++_0x3f9a1e);}(_0xedd9,0xfc));var _0x9edd=function(_0x10bead,_0x192426){_0x10bead=_0x10bead-0x0;var _0x1f0a31=_0xedd9[_0x10bead];return _0x1f0a31;};'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 29399a1..e5f0261 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 _0x1b83=['STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b83,0x194));var _0x31b8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1b83[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x31b8('0x0'));module[_0x31b8('0x1')]={'name':{'type':Sequelize[_0x31b8('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x31b8('0x3')},'main':{'type':Sequelize[_0x31b8('0x2')],'defaultValue':_0x31b8('0x4')},'filename':{'type':Sequelize[_0x31b8('0x2')]},'path':{'type':Sequelize[_0x31b8('0x2')]},'type':{'type':Sequelize[_0x31b8('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x31b8('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x31b8('0x2')]},'state':{'type':Sequelize[_0x31b8('0x2')],'unique':_0x31b8('0x6')},'description':{'type':Sequelize[_0x31b8('0x2')]},'title':{'type':Sequelize[_0x31b8('0x2')]},'remoteUri':{'type':Sequelize[_0x31b8('0x2')]},'link':{'type':Sequelize[_0x31b8('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x80ed=['app.js','INTEGER','BOOLEAN','state','sequelize','STRING','unique_name_and_version'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x80ed,0x11c));var _0xd80e=function(_0x2de3ce,_0x1ecdb4){_0x2de3ce=_0x2de3ce-0x0;var _0x3cc248=_0x80ed[_0x2de3ce];return _0x3cc248;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'name':{'type':Sequelize[_0xd80e('0x1')],'allowNull':![],'unique':_0xd80e('0x2')},'version':{'type':Sequelize[_0xd80e('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xd80e('0x1')],'defaultValue':_0xd80e('0x3')},'filename':{'type':Sequelize[_0xd80e('0x1')]},'path':{'type':Sequelize[_0xd80e('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xd80e('0x4')]},'active':{'type':Sequelize[_0xd80e('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xd80e('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xd80e('0x1')],'unique':_0xd80e('0x6')},'description':{'type':Sequelize[_0xd80e('0x1')]},'title':{'type':Sequelize[_0xd80e('0x1')]},'remoteUri':{'type':Sequelize[_0xd80e('0x1')]},'link':{'type':Sequelize[_0xd80e('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index cd34398..eab2cdd 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3da=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x27f53e,_0x20535d){var _0x22696b=function(_0x5c53cb){while(--_0x5c53cb){_0x27f53e['push'](_0x27f53e['shift']());}};_0x22696b(++_0x20535d);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['create'](_0x38f92d['body'],{})['then'](respondWithResult(_0x4ed0f9,0xc9))[_0xae3d('0x48')](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0x39f213,_0x6fa6c){if(_0x39f213['body']['id']){delete _0x39f213['body']['id'];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x39f213[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x6fa6c,null))['then'](saveUpdates(_0x39f213[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x6fa6c,null))[_0xae3d('0x48')](handleError(_0x6fa6c,null));};exports[_0xae3d('0x29')]=function(_0x2a6a24,_0x38ccf1){return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x2a6a24[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x38ccf1,null))[_0xae3d('0x28')](removeEntity(_0x38ccf1,null))[_0xae3d('0x48')](handleError(_0x38ccf1,null));}; \ No newline at end of file +var _0x187d=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0x187d,0x93));var _0xd187=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x187d[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 267548d..df9a066 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 _0x0f49=['path','rimraf','./integration.attributes','exports','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3efadf,_0x4e9b60){var _0x21b00f=function(_0x5931a5){while(--_0x5931a5){_0x3efadf['push'](_0x3efadf['shift']());}};_0x21b00f(++_0x4e9b60);}(_0x0f49,0x126));var _0x90f4=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0x0f49[_0x5d6c3e];return _0x44ecb7;};'use strict';var _=require(_0x90f4('0x0'));var util=require(_0x90f4('0x1'));var logger=require(_0x90f4('0x2'))(_0x90f4('0x3'));var moment=require(_0x90f4('0x4'));var BPromise=require(_0x90f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90f4('0x6'));var rimraf=require(_0x90f4('0x7'));var config=require('../../config/environment');var attributes=require(_0x90f4('0x8'));module[_0x90f4('0x9')]=function(_0x504835,_0x3c0134){return _0x504835['define'](_0x90f4('0xa'),attributes,{'tableName':_0x90f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3dc=['bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','../../config/logger','api'];(function(_0x5140ca,_0xc4b953){var _0x332dbc=function(_0x22d45c){while(--_0x22d45c){_0x5140ca['push'](_0x5140ca['shift']());}};_0x332dbc(++_0xc4b953);}(_0xc3dc,0x99));var _0xcc3d=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xc3dc[_0x377a6e];return _0x37f751;};'use strict';var _=require('lodash');var util=require(_0xcc3d('0x0'));var logger=require(_0xcc3d('0x1'))(_0xcc3d('0x2'));var moment=require('moment');var BPromise=require(_0xcc3d('0x3'));var rp=require(_0xcc3d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc3d('0x5'));var config=require(_0xcc3d('0x6'));var attributes=require(_0xcc3d('0x7'));module[_0xcc3d('0x8')]=function(_0x1a11cf,_0x280c50){return _0x1a11cf[_0xcc3d('0x9')](_0xcc3d('0xa'),attributes,{'tableName':_0xcc3d('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 5cbe115..6a70e9a 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 _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x18e48d,_0x11d485){var _0x594bf3=function(_0x4345db){while(--_0x4345db){_0x18e48d['push'](_0x18e48d['shift']());}};_0x594bf3(++_0x11d485);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x4975,0x86));var _0x5497=function(_0x487c01,_0x59819e){_0x487c01=_0x487c01-0x0;var _0x570f4d=_0x4975[_0x487c01];return _0x570f4d;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 208827c..98612d8 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 _0x1967=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x1967,0x173));var _0x7196=function(_0x9bedab,_0x507eab){_0x9bedab=_0x9bedab-0x0;var _0x29db84=_0x1967[_0x9bedab];return _0x29db84;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')]('/',auth[_0x7196('0xa')](),controller['create']);router['put'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x12')]);router[_0x7196('0x13')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x14')]);module[_0x7196('0x15')]=router; \ No newline at end of file +var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x31bb1d,_0x8eea6b){var _0x2eb906=function(_0xee1dbf){while(--_0xee1dbf){_0x31bb1d['push'](_0x31bb1d['shift']());}};_0x2eb906(++_0x8eea6b);}(_0x1a85,0x178));var _0x51a8=function(_0x66f455,_0x43978d){_0x66f455=_0x66f455-0x0;var _0x2f4d67=_0x1a85[_0x66f455];return _0x2f4d67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 0e57031..47b34a1 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 _0x502a=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x1137e5,_0x4ad7dc){var _0x5a103e=function(_0x143a85){while(--_0x143a85){_0x1137e5['push'](_0x1137e5['shift']());}};_0x5a103e(++_0x4ad7dc);}(_0x502a,0xcf));var _0xa502=function(_0x134284,_0x2cac91){_0x134284=_0x134284-0x0;var _0x1e517a=_0x502a[_0x134284];return _0x1e517a;};'use strict';var Sequelize=require(_0xa502('0x0'));module[_0xa502('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xa502('0x2')]},'ticketId':{'type':Sequelize[_0xa502('0x2')]},'integrationId':{'type':Sequelize[_0xa502('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa502('0x2')]},'calleridname':{'type':Sequelize[_0xa502('0x2')]},'queue':{'type':Sequelize[_0xa502('0x2')]},'interface':{'type':Sequelize[_0xa502('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xa502('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa502('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xa502('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xa502('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xa502('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa502('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa502('0x4')]},'lastevent':{'type':Sequelize[_0xa502('0x2')]},'channel':{'type':Sequelize[_0xa502('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa502('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa502('0x2')]},'accountcode':{'type':Sequelize[_0xa502('0x2')]},'context':{'type':Sequelize[_0xa502('0x2')]},'exten':{'type':Sequelize[_0xa502('0x2')]},'priority':{'type':Sequelize[_0xa502('0x2')]},'destchannel':{'type':Sequelize[_0xa502('0x2')]},'destchannelstate':{'type':Sequelize[_0xa502('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xa502('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa502('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa502('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xa502('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xa502('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xa502('0x2')]},'destuniqueid':{'type':Sequelize[_0xa502('0x2')]},'messageId':{'type':Sequelize[_0xa502('0x2')]},'inReplyTo':{'type':Sequelize[_0xa502('0x2')]},'subject':{'type':Sequelize[_0xa502('0x2')]},'from':{'type':Sequelize[_0xa502('0x2')]},'to':{'type':Sequelize[_0xa502('0x2')]},'cc':{'type':Sequelize[_0xa502('0x2')]},'attachment':{'type':Sequelize[_0xa502('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xa502('0x7')](_0xa502('0x8'),_0xa502('0x9'),_0xa502('0xa'),_0xa502('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xa502('0x2')]},'appdata':{'type':Sequelize[_0xa502('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xdc55=['BOOLEAN','INTEGER','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING','DATE'];(function(_0x3f713e,_0x143255){var _0x105bef=function(_0x4527e3){while(--_0x4527e3){_0x3f713e['push'](_0x3f713e['shift']());}};_0x105bef(++_0x143255);}(_0xdc55,0x1d5));var _0x5dc5=function(_0x14cb31,_0x3dac96){_0x14cb31=_0x14cb31-0x0;var _0x2ac886=_0xdc55[_0x14cb31];return _0x2ac886;};'use strict';var Sequelize=require(_0x5dc5('0x0'));module[_0x5dc5('0x1')]={'integration':{'type':Sequelize[_0x5dc5('0x2')]},'eventChannel':{'type':Sequelize[_0x5dc5('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x5dc5('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x5dc5('0x2')]},'uniqueid':{'type':Sequelize[_0x5dc5('0x2')]},'calleridnum':{'type':Sequelize[_0x5dc5('0x2')]},'calleridname':{'type':Sequelize[_0x5dc5('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5dc5('0x2')]},'membername':{'type':Sequelize[_0x5dc5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5dc5('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5dc5('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5dc5('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5dc5('0x5')]},'reason':{'type':Sequelize[_0x5dc5('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5dc5('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5dc5('0x3')]},'agentdump':{'type':Sequelize[_0x5dc5('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5dc5('0x3')]},'lastevent':{'type':Sequelize[_0x5dc5('0x2')]},'channel':{'type':Sequelize[_0x5dc5('0x2')]},'channelstate':{'type':Sequelize[_0x5dc5('0x5')]},'channelstatedesc':{'type':Sequelize[_0x5dc5('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5dc5('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5dc5('0x2')]},'context':{'type':Sequelize[_0x5dc5('0x2')]},'exten':{'type':Sequelize[_0x5dc5('0x2')]},'priority':{'type':Sequelize[_0x5dc5('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5dc5('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5dc5('0x2')]},'destcalleridname':{'type':Sequelize[_0x5dc5('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x5dc5('0x2')]},'destlanguage':{'type':Sequelize[_0x5dc5('0x2')]},'destaccountcode':{'type':Sequelize[_0x5dc5('0x2')]},'destcontext':{'type':Sequelize[_0x5dc5('0x2')]},'destexten':{'type':Sequelize[_0x5dc5('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x5dc5('0x2')]},'messageId':{'type':Sequelize[_0x5dc5('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x5dc5('0x2')]},'from':{'type':Sequelize[_0x5dc5('0x2')]},'to':{'type':Sequelize[_0x5dc5('0x2')]},'cc':{'type':Sequelize[_0x5dc5('0x2')]},'attachment':{'type':Sequelize[_0x5dc5('0x6')]},'html':{'type':Sequelize[_0x5dc5('0x6')]},'text':{'type':Sequelize[_0x5dc5('0x6')]},'status':{'type':Sequelize[_0x5dc5('0x7')](_0x5dc5('0x8'),_0x5dc5('0x9'),_0x5dc5('0xa'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5dc5('0x2')]},'appdata':{'type':Sequelize['STRING']},'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 69cb261..fb6c039 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 _0x606a=['sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','end','error','name','send','map','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','catch','show','params','rawAttributes','fields','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x53889b,_0x3b9174){var _0x3da352=function(_0x56a8ff){while(--_0x56a8ff){_0x53889b['push'](_0x53889b['shift']());}};_0x3da352(++_0x3b9174);}(_0x606a,0x195));var _0xa606=function(_0x4f8193,_0x193b63){_0x4f8193=_0x4f8193-0x0;var _0x31b762=_0x606a[_0x4f8193];return _0x31b762;};'use strict';var emlformat=require(_0xa606('0x0'));var rimraf=require(_0xa606('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa606('0x2'));var rp=require('request-promise');var moment=require(_0xa606('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa606('0x4'));var util=require(_0xa606('0x5'));var path=require('path');var sox=require(_0xa606('0x6'));var csv=require(_0xa606('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa606('0x8'));var _=require(_0xa606('0x9'));var squel=require(_0xa606('0xa'));var crypto=require(_0xa606('0xb'));var jsforce=require(_0xa606('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa606('0x7'));var querystring=require(_0xa606('0xd'));var Papa=require('papaparse');var Redis=require(_0xa606('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa606('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa606('0x10'))('api');var utils=require(_0xa606('0x11'));var config=require(_0xa606('0x12'));var licenseUtil=require(_0xa606('0x13'));var db=require(_0xa606('0x14'))['db'];function respondWithStatusCode(_0x62c92f,_0x2f047e){_0x2f047e=_0x2f047e||0xcc;return function(_0x110162){if(_0x110162){return _0x62c92f[_0xa606('0x15')](_0x2f047e);}return _0x62c92f['status'](_0x2f047e)['end']();};}function respondWithResult(_0x10ef22,_0x2c3b5f){_0x2c3b5f=_0x2c3b5f||0xc8;return function(_0xa82b9a){if(_0xa82b9a){return _0x10ef22[_0xa606('0x16')](_0x2c3b5f)['json'](_0xa82b9a);}};}function respondWithFilteredResult(_0x5dc2f4,_0x132db9){return function(_0x193532){if(_0x193532){var _0x1267db=typeof _0x132db9[_0xa606('0x17')]===_0xa606('0x18')&&typeof _0x132db9['limit']===_0xa606('0x18');var _0xaf8cdb=_0x193532[_0xa606('0x19')];var _0x2a9b60=_0x1267db?0x0:_0x132db9['offset'];var _0xfd9154=_0x1267db?_0x193532[_0xa606('0x19')]:_0x132db9[_0xa606('0x17')]+_0x132db9[_0xa606('0x1a')];var _0x1fd752;if(_0xfd9154>=_0xaf8cdb){_0xfd9154=_0xaf8cdb;_0x1fd752=0xc8;}else{_0x1fd752=0xce;}_0x5dc2f4['status'](_0x1fd752);return _0x5dc2f4[_0xa606('0x1b')](_0xa606('0x1c'),_0x2a9b60+'-'+_0xfd9154+'/'+_0xaf8cdb)[_0xa606('0x1d')](_0x193532);}return null;};}function patchUpdates(_0x5a5efc){return function(_0x3a2be7){try{jsonpatch['apply'](_0x3a2be7,_0x5a5efc,!![]);}catch(_0x5a6333){return BPromise[_0xa606('0x1e')](_0x5a6333);}return _0x3a2be7[_0xa606('0x1f')]();};}function saveUpdates(_0x1221de,_0x28e583){return function(_0x1204b5){if(_0x1204b5){return _0x1204b5[_0xa606('0x20')](_0x1221de)[_0xa606('0x21')](function(_0xc031e7){return _0xc031e7;});}return null;};}function removeEntity(_0x2226d6,_0x751e11){return function(_0x55c2d2){if(_0x55c2d2){return _0x55c2d2['destroy']()[_0xa606('0x21')](function(){_0x2226d6['status'](0xcc)[_0xa606('0x22')]();});}};}function handleEntityNotFound(_0xc41b78,_0x4151e6){return function(_0x2e4712){if(!_0x2e4712){_0xc41b78[_0xa606('0x15')](0x194);}return _0x2e4712;};}function handleError(_0x55722b,_0x292b8e){_0x292b8e=_0x292b8e||0x1f4;return function(_0x5f0990){logger[_0xa606('0x23')](_0x5f0990['stack']);if(_0x5f0990['name']){delete _0x5f0990[_0xa606('0x24')];}_0x55722b[_0xa606('0x16')](_0x292b8e)[_0xa606('0x25')](_0x5f0990);};}exports['index']=function(_0x504e73,_0x23f197){var _0x42be13={},_0x4fe7e3={},_0x25a74d={'count':0x0,'rows':[]};var _0x5d35ae=_[_0xa606('0x26')](db['IntegrationReport']['rawAttributes'],function(_0x23bcbb){return{'name':_0x23bcbb['fieldName'],'type':_0x23bcbb['type'][_0xa606('0x27')]};});_0x4fe7e3[_0xa606('0x28')]=_[_0xa606('0x26')](_0x5d35ae,_0xa606('0x24'));_0x4fe7e3[_0xa606('0x29')]=_[_0xa606('0x2a')](_0x504e73[_0xa606('0x29')]);_0x4fe7e3[_0xa606('0x2b')]=_['intersection'](_0x4fe7e3[_0xa606('0x28')],_0x4fe7e3[_0xa606('0x29')]);_0x42be13[_0xa606('0x2c')]=_[_0xa606('0x2d')](_0x4fe7e3[_0xa606('0x28')],qs['fields'](_0x504e73[_0xa606('0x29')]['fields']));_0x42be13[_0xa606('0x2c')]=_0x42be13['attributes'][_0xa606('0x2e')]?_0x42be13[_0xa606('0x2c')]:_0x4fe7e3[_0xa606('0x28')];if(!_0x504e73['query'][_0xa606('0x2f')](_0xa606('0x30'))){_0x42be13[_0xa606('0x1a')]=qs[_0xa606('0x1a')](_0x504e73[_0xa606('0x29')][_0xa606('0x1a')]);_0x42be13[_0xa606('0x17')]=qs[_0xa606('0x17')](_0x504e73['query']['offset']);}_0x42be13['order']=qs[_0xa606('0x31')](_0x504e73['query'][_0xa606('0x31')]);_0x42be13[_0xa606('0x32')]=qs['filters'](_[_0xa606('0x33')](_0x504e73[_0xa606('0x29')],_0x4fe7e3[_0xa606('0x2b')]),_0x5d35ae);if(_0x504e73[_0xa606('0x29')][_0xa606('0x34')]){_0x42be13[_0xa606('0x32')]=_[_0xa606('0x35')](_0x42be13[_0xa606('0x32')],{'$or':_[_0xa606('0x26')](_0x5d35ae,function(_0x4c40b8){if(_0x4c40b8[_0xa606('0x36')]!==_0xa606('0x37')){var _0x39ea6c={};_0x39ea6c[_0x4c40b8['name']]={'$like':'%'+_0x504e73[_0xa606('0x29')][_0xa606('0x34')]+'%'};return _0x39ea6c;}})});}_0x42be13=_['merge']({},_0x42be13,_0x504e73[_0xa606('0x38')]);var _0x3cf8ab={'where':_0x42be13[_0xa606('0x32')]};return db[_0xa606('0x39')][_0xa606('0x19')](_0x3cf8ab)[_0xa606('0x21')](function(_0xc87ce2){_0x25a74d[_0xa606('0x19')]=_0xc87ce2;if(_0x504e73[_0xa606('0x29')][_0xa606('0x3a')]){_0x42be13[_0xa606('0x3b')]=[{'all':!![]}];}return db[_0xa606('0x39')][_0xa606('0x3c')](_0x42be13);})[_0xa606('0x21')](function(_0x446d1f){_0x25a74d['rows']=_0x446d1f;return _0x25a74d;})['then'](respondWithFilteredResult(_0x23f197,_0x42be13))[_0xa606('0x3d')](handleError(_0x23f197,null));};exports[_0xa606('0x3e')]=function(_0x28d334,_0x13c0f2){var _0x2332ee={'raw':![],'where':{'id':_0x28d334[_0xa606('0x3f')]['id']}},_0x41aed2={};_0x41aed2[_0xa606('0x28')]=_[_0xa606('0x2a')](db[_0xa606('0x39')][_0xa606('0x40')]);_0x41aed2[_0xa606('0x29')]=_['keys'](_0x28d334[_0xa606('0x29')]);_0x41aed2[_0xa606('0x2b')]=_['intersection'](_0x41aed2[_0xa606('0x28')],_0x41aed2[_0xa606('0x29')]);_0x2332ee['attributes']=_[_0xa606('0x2d')](_0x41aed2[_0xa606('0x28')],qs['fields'](_0x28d334['query'][_0xa606('0x41')]));_0x2332ee[_0xa606('0x2c')]=_0x2332ee[_0xa606('0x2c')][_0xa606('0x2e')]?_0x2332ee['attributes']:_0x41aed2[_0xa606('0x28')];if(_0x28d334[_0xa606('0x29')][_0xa606('0x3a')]){_0x2332ee[_0xa606('0x3b')]=[{'all':!![]}];}_0x2332ee=_[_0xa606('0x35')]({},_0x2332ee,_0x28d334[_0xa606('0x38')]);return db['IntegrationReport']['find'](_0x2332ee)[_0xa606('0x21')](handleEntityNotFound(_0x13c0f2,null))[_0xa606('0x21')](respondWithResult(_0x13c0f2,null))[_0xa606('0x3d')](handleError(_0x13c0f2,null));};exports[_0xa606('0x42')]=function(_0x4a66b1,_0x397d2d){return db[_0xa606('0x39')][_0xa606('0x42')](_0x4a66b1[_0xa606('0x43')],{})[_0xa606('0x21')](respondWithResult(_0x397d2d,0xc9))[_0xa606('0x3d')](handleError(_0x397d2d,null));};exports[_0xa606('0x20')]=function(_0x46e283,_0x26a5c9){if(_0x46e283['body']['id']){delete _0x46e283[_0xa606('0x43')]['id'];}return db[_0xa606('0x39')][_0xa606('0x44')]({'where':{'id':_0x46e283[_0xa606('0x3f')]['id']}})['then'](handleEntityNotFound(_0x26a5c9,null))[_0xa606('0x21')](saveUpdates(_0x46e283[_0xa606('0x43')],null))[_0xa606('0x21')](respondWithResult(_0x26a5c9,null))[_0xa606('0x3d')](handleError(_0x26a5c9,null));};exports[_0xa606('0x45')]=function(_0x483bbf,_0x4e15b2){return db[_0xa606('0x39')][_0xa606('0x44')]({'where':{'id':_0x483bbf['params']['id']}})[_0xa606('0x21')](handleEntityNotFound(_0x4e15b2,null))[_0xa606('0x21')](removeEntity(_0x4e15b2,null))[_0xa606('0x3d')](handleError(_0x4e15b2,null));};exports[_0xa606('0x46')]=function(_0x440433,_0x57716a){return db[_0xa606('0x39')][_0xa606('0x46')]()['then'](respondWithResult(_0x57716a,null))[_0xa606('0x3d')](handleError(_0x57716a,null));}; \ No newline at end of file +var _0xcf21=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs'];(function(_0x373a67,_0x5af5ff){var _0x15d61b=function(_0x226d35){while(--_0x226d35){_0x373a67['push'](_0x373a67['shift']());}};_0x15d61b(++_0x5af5ff);}(_0xcf21,0x12a));var _0x1cf2=function(_0x4acda3,_0x1bd408){_0x4acda3=_0x4acda3-0x0;var _0x200fa7=_0xcf21[_0x4acda3];return _0x200fa7;};'use strict';var emlformat=require(_0x1cf2('0x0'));var rimraf=require(_0x1cf2('0x1'));var zipdir=require(_0x1cf2('0x2'));var jsonpatch=require(_0x1cf2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1cf2('0x4'));var Mustache=require(_0x1cf2('0x5'));var util=require(_0x1cf2('0x6'));var path=require(_0x1cf2('0x7'));var sox=require(_0x1cf2('0x8'));var csv=require('to-csv');var ejs=require(_0x1cf2('0x9'));var fs=require('fs');var fs_extra=require(_0x1cf2('0xa'));var _=require(_0x1cf2('0xb'));var squel=require(_0x1cf2('0xc'));var crypto=require(_0x1cf2('0xd'));var jsforce=require(_0x1cf2('0xe'));var deskjs=require(_0x1cf2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1cf2('0x10'));var Redis=require('ioredis');var authService=require(_0x1cf2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1cf2('0x12'));var hardwareService=require(_0x1cf2('0x13'));var logger=require(_0x1cf2('0x14'))(_0x1cf2('0x15'));var utils=require(_0x1cf2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1cf2('0x17'));var db=require(_0x1cf2('0x18'))['db'];function respondWithStatusCode(_0x3b10ae,_0x3e02e9){_0x3e02e9=_0x3e02e9||0xcc;return function(_0x2a8a93){if(_0x2a8a93){return _0x3b10ae[_0x1cf2('0x19')](_0x3e02e9);}return _0x3b10ae[_0x1cf2('0x1a')](_0x3e02e9)['end']();};}function respondWithResult(_0x1a1e59,_0x8e65cd){_0x8e65cd=_0x8e65cd||0xc8;return function(_0x54e3da){if(_0x54e3da){return _0x1a1e59[_0x1cf2('0x1a')](_0x8e65cd)[_0x1cf2('0x1b')](_0x54e3da);}};}function respondWithFilteredResult(_0x39cbf,_0x58f7d8){return function(_0x1d7692){if(_0x1d7692){var _0x484ac8=typeof _0x58f7d8[_0x1cf2('0x1c')]==='undefined'&&typeof _0x58f7d8[_0x1cf2('0x1d')]===_0x1cf2('0x1e');var _0x56d759=_0x1d7692[_0x1cf2('0x1f')];var _0x21718c=_0x484ac8?0x0:_0x58f7d8[_0x1cf2('0x1c')];var _0x487186=_0x484ac8?_0x1d7692[_0x1cf2('0x1f')]:_0x58f7d8[_0x1cf2('0x1c')]+_0x58f7d8[_0x1cf2('0x1d')];var _0x4db9cf;if(_0x487186>=_0x56d759){_0x487186=_0x56d759;_0x4db9cf=0xc8;}else{_0x4db9cf=0xce;}_0x39cbf['status'](_0x4db9cf);return _0x39cbf['set']('Content-Range',_0x21718c+'-'+_0x487186+'/'+_0x56d759)[_0x1cf2('0x1b')](_0x1d7692);}return null;};}function patchUpdates(_0x694789){return function(_0x1e430d){try{jsonpatch[_0x1cf2('0x20')](_0x1e430d,_0x694789,!![]);}catch(_0x113149){return BPromise[_0x1cf2('0x21')](_0x113149);}return _0x1e430d[_0x1cf2('0x22')]();};}function saveUpdates(_0x261b67,_0x4c8606){return function(_0x448598){if(_0x448598){return _0x448598[_0x1cf2('0x23')](_0x261b67)[_0x1cf2('0x24')](function(_0xf763f){return _0xf763f;});}return null;};}function removeEntity(_0x292d64,_0x204a04){return function(_0x13f854){if(_0x13f854){return _0x13f854[_0x1cf2('0x25')]()[_0x1cf2('0x24')](function(){_0x292d64[_0x1cf2('0x1a')](0xcc)[_0x1cf2('0x26')]();});}};}function handleEntityNotFound(_0x61d794,_0x24faf8){return function(_0x179d25){if(!_0x179d25){_0x61d794[_0x1cf2('0x19')](0x194);}return _0x179d25;};}function handleError(_0x21cb3a,_0x4e46af){_0x4e46af=_0x4e46af||0x1f4;return function(_0x268617){logger['error'](_0x268617[_0x1cf2('0x27')]);if(_0x268617[_0x1cf2('0x28')]){delete _0x268617[_0x1cf2('0x28')];}_0x21cb3a[_0x1cf2('0x1a')](_0x4e46af)[_0x1cf2('0x29')](_0x268617);};}exports[_0x1cf2('0x2a')]=function(_0x44b10c,_0x4ae1fa){var _0x59b6f8={},_0x3d9856={},_0x22077a={'count':0x0,'rows':[]};var _0xfef37b=_[_0x1cf2('0x2b')](db[_0x1cf2('0x2c')][_0x1cf2('0x2d')],function(_0x189c3c){return{'name':_0x189c3c[_0x1cf2('0x2e')],'type':_0x189c3c[_0x1cf2('0x2f')][_0x1cf2('0x30')]};});_0x3d9856['model']=_['map'](_0xfef37b,_0x1cf2('0x28'));_0x3d9856['query']=_[_0x1cf2('0x31')](_0x44b10c[_0x1cf2('0x32')]);_0x3d9856['filters']=_[_0x1cf2('0x33')](_0x3d9856[_0x1cf2('0x34')],_0x3d9856[_0x1cf2('0x32')]);_0x59b6f8[_0x1cf2('0x35')]=_['intersection'](_0x3d9856[_0x1cf2('0x34')],qs[_0x1cf2('0x36')](_0x44b10c[_0x1cf2('0x32')][_0x1cf2('0x36')]));_0x59b6f8[_0x1cf2('0x35')]=_0x59b6f8[_0x1cf2('0x35')][_0x1cf2('0x37')]?_0x59b6f8['attributes']:_0x3d9856[_0x1cf2('0x34')];if(!_0x44b10c[_0x1cf2('0x32')][_0x1cf2('0x38')](_0x1cf2('0x39'))){_0x59b6f8[_0x1cf2('0x1d')]=qs[_0x1cf2('0x1d')](_0x44b10c[_0x1cf2('0x32')][_0x1cf2('0x1d')]);_0x59b6f8[_0x1cf2('0x1c')]=qs[_0x1cf2('0x1c')](_0x44b10c[_0x1cf2('0x32')][_0x1cf2('0x1c')]);}_0x59b6f8[_0x1cf2('0x3a')]=qs[_0x1cf2('0x3b')](_0x44b10c[_0x1cf2('0x32')]['sort']);_0x59b6f8[_0x1cf2('0x3c')]=qs[_0x1cf2('0x3d')](_['pick'](_0x44b10c[_0x1cf2('0x32')],_0x3d9856[_0x1cf2('0x3d')]),_0xfef37b);if(_0x44b10c[_0x1cf2('0x32')]['filter']){_0x59b6f8[_0x1cf2('0x3c')]=_[_0x1cf2('0x3e')](_0x59b6f8['where'],{'$or':_[_0x1cf2('0x2b')](_0xfef37b,function(_0x4cd974){if(_0x4cd974[_0x1cf2('0x2f')]!==_0x1cf2('0x3f')){var _0x485384={};_0x485384[_0x4cd974['name']]={'$like':'%'+_0x44b10c[_0x1cf2('0x32')][_0x1cf2('0x40')]+'%'};return _0x485384;}})});}_0x59b6f8=_[_0x1cf2('0x3e')]({},_0x59b6f8,_0x44b10c[_0x1cf2('0x41')]);var _0x4d2e27={'where':_0x59b6f8[_0x1cf2('0x3c')]};return db[_0x1cf2('0x2c')]['count'](_0x4d2e27)[_0x1cf2('0x24')](function(_0x6e4085){_0x22077a[_0x1cf2('0x1f')]=_0x6e4085;if(_0x44b10c['query'][_0x1cf2('0x42')]){_0x59b6f8[_0x1cf2('0x43')]=[{'all':!![]}];}return db[_0x1cf2('0x2c')][_0x1cf2('0x44')](_0x59b6f8);})[_0x1cf2('0x24')](function(_0x20a2ed){_0x22077a[_0x1cf2('0x45')]=_0x20a2ed;return _0x22077a;})['then'](respondWithFilteredResult(_0x4ae1fa,_0x59b6f8))[_0x1cf2('0x46')](handleError(_0x4ae1fa,null));};exports[_0x1cf2('0x47')]=function(_0x4aaa0a,_0xc9266d){var _0x5e5f7e={'raw':![],'where':{'id':_0x4aaa0a[_0x1cf2('0x48')]['id']}},_0x32a5ff={};_0x32a5ff[_0x1cf2('0x34')]=_[_0x1cf2('0x31')](db['IntegrationReport'][_0x1cf2('0x2d')]);_0x32a5ff[_0x1cf2('0x32')]=_[_0x1cf2('0x31')](_0x4aaa0a['query']);_0x32a5ff[_0x1cf2('0x3d')]=_[_0x1cf2('0x33')](_0x32a5ff[_0x1cf2('0x34')],_0x32a5ff[_0x1cf2('0x32')]);_0x5e5f7e[_0x1cf2('0x35')]=_[_0x1cf2('0x33')](_0x32a5ff['model'],qs[_0x1cf2('0x36')](_0x4aaa0a[_0x1cf2('0x32')][_0x1cf2('0x36')]));_0x5e5f7e[_0x1cf2('0x35')]=_0x5e5f7e[_0x1cf2('0x35')]['length']?_0x5e5f7e['attributes']:_0x32a5ff[_0x1cf2('0x34')];if(_0x4aaa0a['query']['includeAll']){_0x5e5f7e[_0x1cf2('0x43')]=[{'all':!![]}];}_0x5e5f7e=_[_0x1cf2('0x3e')]({},_0x5e5f7e,_0x4aaa0a[_0x1cf2('0x41')]);return db[_0x1cf2('0x2c')][_0x1cf2('0x49')](_0x5e5f7e)[_0x1cf2('0x24')](handleEntityNotFound(_0xc9266d,null))[_0x1cf2('0x24')](respondWithResult(_0xc9266d,null))[_0x1cf2('0x46')](handleError(_0xc9266d,null));};exports['create']=function(_0x12f324,_0x371104){return db[_0x1cf2('0x2c')][_0x1cf2('0x4a')](_0x12f324[_0x1cf2('0x4b')],{})[_0x1cf2('0x24')](respondWithResult(_0x371104,0xc9))[_0x1cf2('0x46')](handleError(_0x371104,null));};exports[_0x1cf2('0x23')]=function(_0x1cec1c,_0x157621){if(_0x1cec1c[_0x1cf2('0x4b')]['id']){delete _0x1cec1c[_0x1cf2('0x4b')]['id'];}return db['IntegrationReport'][_0x1cf2('0x49')]({'where':{'id':_0x1cec1c[_0x1cf2('0x48')]['id']}})[_0x1cf2('0x24')](handleEntityNotFound(_0x157621,null))['then'](saveUpdates(_0x1cec1c[_0x1cf2('0x4b')],null))['then'](respondWithResult(_0x157621,null))['catch'](handleError(_0x157621,null));};exports[_0x1cf2('0x25')]=function(_0x50cc3b,_0x33c3a9){return db[_0x1cf2('0x2c')][_0x1cf2('0x49')]({'where':{'id':_0x50cc3b[_0x1cf2('0x48')]['id']}})['then'](handleEntityNotFound(_0x33c3a9,null))[_0x1cf2('0x24')](removeEntity(_0x33c3a9,null))[_0x1cf2('0x46')](handleError(_0x33c3a9,null));};exports[_0x1cf2('0x4c')]=function(_0x167df4,_0x172b71){return db[_0x1cf2('0x2c')][_0x1cf2('0x4c')]()[_0x1cf2('0x24')](respondWithResult(_0x172b71,null))[_0x1cf2('0x46')](handleError(_0x172b71,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 7324490..63558ba 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 _0x20e7=['report_integration','../../config/logger','api','moment','path','exports','define','IntegrationReport'];(function(_0xd8396f,_0x17a88c){var _0x1a3345=function(_0x3d92ea){while(--_0x3d92ea){_0xd8396f['push'](_0xd8396f['shift']());}};_0x1a3345(++_0x17a88c);}(_0x20e7,0x1a9));var _0x720e=function(_0x1ff2a7,_0x45ae0f){_0x1ff2a7=_0x1ff2a7-0x0;var _0xe996e2=_0x20e7[_0x1ff2a7];return _0xe996e2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x720e('0x0'))(_0x720e('0x1'));var moment=require(_0x720e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x720e('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x720e('0x4')]=function(_0x2e63f3,_0x3bf641){return _0x2e63f3[_0x720e('0x5')](_0x720e('0x6'),attributes,{'tableName':_0x720e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x184c=['api','moment','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util','../../config/logger'];(function(_0x1685c6,_0x451816){var _0x520122=function(_0x1d14a9){while(--_0x1d14a9){_0x1685c6['push'](_0x1685c6['shift']());}};_0x520122(++_0x451816);}(_0x184c,0x1c4));var _0xc184=function(_0x35c1b4,_0x1e310e){_0x35c1b4=_0x35c1b4-0x0;var _0x44cd33=_0x184c[_0x35c1b4];return _0x44cd33;};'use strict';var _=require(_0xc184('0x0'));var util=require(_0xc184('0x1'));var logger=require(_0xc184('0x2'))(_0xc184('0x3'));var moment=require(_0xc184('0x4'));var BPromise=require(_0xc184('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc184('0x6'));var rimraf=require(_0xc184('0x7'));var config=require(_0xc184('0x8'));var attributes=require(_0xc184('0x9'));module[_0xc184('0xa')]=function(_0xc86740,_0x371734){return _0xc86740[_0xc184('0xb')](_0xc184('0xc'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 7ae219b..085cd86 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 _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(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x1967,0x173));var _0x7196=function(_0x556b82,_0x449387){_0x556b82=_0x556b82-0x0;var _0x3d87dc=_0x1967[_0x556b82];return _0x3d87dc;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x524e,0x15e));var _0xe524=function(_0x1365fe,_0x24eaee){_0x1365fe=_0x1365fe-0x0;var _0x31d66=_0x524e[_0x1365fe];return _0x31d66;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index d6a64bf..84b237e 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 _0x9aac=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./interval.controller','isAuthenticated','index','get','show','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy'];(function(_0x13f9f6,_0xd5c2d9){var _0x588eb1=function(_0x40390d){while(--_0x40390d){_0x13f9f6['push'](_0x13f9f6['shift']());}};_0x588eb1(++_0xd5c2d9);}(_0x9aac,0x135));var _0xc9aa=function(_0x57041e,_0x525a8c){_0x57041e=_0x57041e-0x0;var _0x362aae=_0x9aac[_0x57041e];return _0x362aae;};'use strict';var multer=require(_0xc9aa('0x0'));var util=require('util');var path=require(_0xc9aa('0x1'));var timeout=require(_0xc9aa('0x2'));var express=require('express');var router=express[_0xc9aa('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc9aa('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc9aa('0x5'));var controller=require(_0xc9aa('0x6'));router['get']('/',auth[_0xc9aa('0x7')](),controller[_0xc9aa('0x8')]);router[_0xc9aa('0x9')]('/:id',auth[_0xc9aa('0x7')](),controller[_0xc9aa('0xa')]);router[_0xc9aa('0x9')]('/:id/sub_intervals',auth[_0xc9aa('0x7')](),controller[_0xc9aa('0xb')]);router[_0xc9aa('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc9aa('0xc')]('/:id/sub_intervals',auth[_0xc9aa('0x7')](),controller[_0xc9aa('0xd')]);router[_0xc9aa('0xc')](_0xc9aa('0xe'),auth[_0xc9aa('0x7')](),controller[_0xc9aa('0xf')]);router[_0xc9aa('0x10')](_0xc9aa('0x11'),auth[_0xc9aa('0x7')](),controller[_0xc9aa('0x12')]);router[_0xc9aa('0x13')](_0xc9aa('0x11'),auth[_0xc9aa('0x7')](),controller[_0xc9aa('0x14')]);module[_0xc9aa('0x15')]=router; \ No newline at end of file +var _0xea44=['Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','addInterval','post','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x185d2a,_0x308609){var _0x4dea27=function(_0x513443){while(--_0x513443){_0x185d2a['push'](_0x185d2a['shift']());}};_0x4dea27(++_0x308609);}(_0xea44,0x1a5));var _0x4ea4=function(_0x23adf1,_0xac3762){_0x23adf1=_0x23adf1-0x0;var _0x25b499=_0xea44[_0x23adf1];return _0x25b499;};'use strict';var multer=require(_0x4ea4('0x0'));var util=require(_0x4ea4('0x1'));var path=require(_0x4ea4('0x2'));var timeout=require(_0x4ea4('0x3'));var express=require('express');var router=express[_0x4ea4('0x4')]();var fs_extra=require(_0x4ea4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4ea4('0x6'));var config=require(_0x4ea4('0x7'));var controller=require(_0x4ea4('0x8'));router[_0x4ea4('0x9')]('/',auth['isAuthenticated'](),controller[_0x4ea4('0xa')]);router[_0x4ea4('0x9')](_0x4ea4('0xb'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0xd')]);router[_0x4ea4('0x9')](_0x4ea4('0xe'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0xf')]);router['post']('/',auth[_0x4ea4('0xc')](),controller['create']);router['post'](_0x4ea4('0xe'),auth['isAuthenticated'](),controller[_0x4ea4('0x10')]);router[_0x4ea4('0x11')](_0x4ea4('0x12'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0x13')]);router[_0x4ea4('0x14')](_0x4ea4('0xb'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0x15')]);router[_0x4ea4('0x16')](_0x4ea4('0xb'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0x17')]);module[_0x4ea4('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index ec2f343..9b819c1 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 _0x7b97=['STRING','sequelize','exports'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x7b97,0x94));var _0x77b9=function(_0x146f3a,_0x373e03){_0x146f3a=_0x146f3a-0x0;var _0x4ebd8a=_0x7b97[_0x146f3a];return _0x4ebd8a;};'use strict';var Sequelize=require(_0x77b9('0x0'));module[_0x77b9('0x1')]={'name':{'type':Sequelize[_0x77b9('0x2')]},'description':{'type':Sequelize[_0x77b9('0x2')]},'interval':{'type':Sequelize[_0x77b9('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x5eb1=['sequelize','exports','STRING'];(function(_0x23ca3a,_0xe44c43){var _0x5c1aab=function(_0x29bcdd){while(--_0x29bcdd){_0x23ca3a['push'](_0x23ca3a['shift']());}};_0x5c1aab(++_0xe44c43);}(_0x5eb1,0x1a1));var _0x15eb=function(_0x26a672,_0x59f5be){_0x26a672=_0x26a672-0x0;var _0x348f43=_0x5eb1[_0x26a672];return _0x348f43;};'use strict';var Sequelize=require(_0x15eb('0x0'));module[_0x15eb('0x1')]={'name':{'type':Sequelize[_0x15eb('0x2')]},'description':{'type':Sequelize[_0x15eb('0x2')]},'interval':{'type':Sequelize[_0x15eb('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 35b07f7..2564cf5 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 _0xbf87=['nolimit','order','sort','filters','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','fields','includeAll','options','find','body','user','get','Intervals','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','IntervalId','getIntervals','pick','hasOwnProperty','addIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','map','Interval','fieldName','type','model','query','keys','intersection','attributes','length'];(function(_0x617e11,_0x1eba4f){var _0x14a03b=function(_0x87fee){while(--_0x87fee){_0x617e11['push'](_0x617e11['shift']());}};_0x14a03b(++_0x1eba4f);}(_0xbf87,0x1ec));var _0x7bf8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbf87[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7bf8('0x0'));var rimraf=require(_0x7bf8('0x1'));var zipdir=require(_0x7bf8('0x2'));var jsonpatch=require(_0x7bf8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7bf8('0x4'));var util=require(_0x7bf8('0x5'));var path=require(_0x7bf8('0x6'));var sox=require(_0x7bf8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bf8('0x8'));var squel=require(_0x7bf8('0x9'));var crypto=require(_0x7bf8('0xa'));var jsforce=require(_0x7bf8('0xb'));var deskjs=require(_0x7bf8('0xc'));var toCsv=require(_0x7bf8('0xd'));var querystring=require(_0x7bf8('0xe'));var Papa=require(_0x7bf8('0xf'));var Redis=require(_0x7bf8('0x10'));var authService=require(_0x7bf8('0x11'));var qs=require(_0x7bf8('0x12'));var as=require(_0x7bf8('0x13'));var hardwareService=require(_0x7bf8('0x14'));var logger=require(_0x7bf8('0x15'))(_0x7bf8('0x16'));var utils=require('../../config/utils');var config=require(_0x7bf8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7bf8('0x18'))['db'];var extensions=require(_0x7bf8('0x19'));function respondWithStatusCode(_0xeeeb8e,_0x2776cb){_0x2776cb=_0x2776cb||0xcc;return function(_0xedf168){if(_0xedf168){return _0xeeeb8e[_0x7bf8('0x1a')](_0x2776cb);}return _0xeeeb8e[_0x7bf8('0x1b')](_0x2776cb)['end']();};}function respondWithResult(_0x385de7,_0x559557){_0x559557=_0x559557||0xc8;return function(_0x4bbea5){if(_0x4bbea5){return _0x385de7[_0x7bf8('0x1b')](_0x559557)[_0x7bf8('0x1c')](_0x4bbea5);}};}function respondWithFilteredResult(_0x26598b,_0x294762){return function(_0x3144f9){if(_0x3144f9){var _0x3cd959=typeof _0x294762[_0x7bf8('0x1d')]===_0x7bf8('0x1e')&&typeof _0x294762[_0x7bf8('0x1f')]===_0x7bf8('0x1e');var _0x849df0=_0x3144f9[_0x7bf8('0x20')];var _0x149676=_0x3cd959?0x0:_0x294762['offset'];var _0x2bda2c=_0x3cd959?_0x3144f9[_0x7bf8('0x20')]:_0x294762[_0x7bf8('0x1d')]+_0x294762[_0x7bf8('0x1f')];var _0x2c4c6e;if(_0x2bda2c>=_0x849df0){_0x2bda2c=_0x849df0;_0x2c4c6e=0xc8;}else{_0x2c4c6e=0xce;}_0x26598b[_0x7bf8('0x1b')](_0x2c4c6e);return _0x26598b[_0x7bf8('0x21')](_0x7bf8('0x22'),_0x149676+'-'+_0x2bda2c+'/'+_0x849df0)[_0x7bf8('0x1c')](_0x3144f9);}return null;};}function patchUpdates(_0x434690){return function(_0x19ae25){try{jsonpatch[_0x7bf8('0x23')](_0x19ae25,_0x434690,!![]);}catch(_0x1cd229){return BPromise[_0x7bf8('0x24')](_0x1cd229);}return _0x19ae25[_0x7bf8('0x25')]();};}function saveUpdates(_0x1c2a7f,_0x3afd50){return function(_0x331f5a){if(_0x331f5a){return _0x331f5a[_0x7bf8('0x26')](_0x1c2a7f)[_0x7bf8('0x27')](function(_0xce0d14){return _0xce0d14;});}return null;};}function removeEntity(_0x54b235,_0x8e5081){return function(_0x34151c){if(_0x34151c){return _0x34151c[_0x7bf8('0x28')]()[_0x7bf8('0x27')](function(){var _0xf6f7c6=_0x34151c['get']({'plain':!![]});var _0x22f082='Intervals';return db['UserProfileResource']['destroy']({'where':{'type':_0x22f082,'resourceId':_0xf6f7c6['id']}})[_0x7bf8('0x27')](function(){return _0x34151c;});})[_0x7bf8('0x27')](function(){_0x54b235[_0x7bf8('0x1b')](0xcc)[_0x7bf8('0x29')]();});}};}function handleEntityNotFound(_0x6827b9,_0x34b08a){return function(_0x1916b3){if(!_0x1916b3){_0x6827b9[_0x7bf8('0x1a')](0x194);}return _0x1916b3;};}function handleError(_0x61e9ed,_0xd26bd){_0xd26bd=_0xd26bd||0x1f4;return function(_0x57a714){logger['error'](_0x57a714['stack']);if(_0x57a714['name']){delete _0x57a714[_0x7bf8('0x2a')];}_0x61e9ed[_0x7bf8('0x1b')](_0xd26bd)['send'](_0x57a714);};}exports[_0x7bf8('0x2b')]=function(_0x2eb892,_0x2b38e6){var _0xb41a7b={},_0x273550={},_0x54d934={'count':0x0,'rows':[]};var _0x588b26=_[_0x7bf8('0x2c')](db[_0x7bf8('0x2d')]['rawAttributes'],function(_0x497c0d){return{'name':_0x497c0d[_0x7bf8('0x2e')],'type':_0x497c0d[_0x7bf8('0x2f')]['key']};});_0x273550[_0x7bf8('0x30')]=_['map'](_0x588b26,_0x7bf8('0x2a'));_0x273550[_0x7bf8('0x31')]=_[_0x7bf8('0x32')](_0x2eb892['query']);_0x273550['filters']=_[_0x7bf8('0x33')](_0x273550['model'],_0x273550[_0x7bf8('0x31')]);_0xb41a7b['attributes']=_['intersection'](_0x273550[_0x7bf8('0x30')],qs['fields'](_0x2eb892[_0x7bf8('0x31')]['fields']));_0xb41a7b[_0x7bf8('0x34')]=_0xb41a7b['attributes'][_0x7bf8('0x35')]?_0xb41a7b[_0x7bf8('0x34')]:_0x273550[_0x7bf8('0x30')];if(!_0x2eb892[_0x7bf8('0x31')]['hasOwnProperty'](_0x7bf8('0x36'))){_0xb41a7b['limit']=qs['limit'](_0x2eb892['query']['limit']);_0xb41a7b['offset']=qs[_0x7bf8('0x1d')](_0x2eb892[_0x7bf8('0x31')]['offset']);}_0xb41a7b[_0x7bf8('0x37')]=qs[_0x7bf8('0x38')](_0x2eb892[_0x7bf8('0x31')][_0x7bf8('0x38')]);_0xb41a7b['where']=qs['filters'](_['pick'](_0x2eb892[_0x7bf8('0x31')],_0x273550[_0x7bf8('0x39')]),_0x588b26);if(_0x2eb892[_0x7bf8('0x31')][_0x7bf8('0x3a')]){_0xb41a7b[_0x7bf8('0x3b')]=_[_0x7bf8('0x3c')](_0xb41a7b[_0x7bf8('0x3b')],{'$or':_[_0x7bf8('0x2c')](_0x588b26,function(_0x3094ae){if(_0x3094ae[_0x7bf8('0x2f')]!==_0x7bf8('0x3d')){var _0x33bfef={};_0x33bfef[_0x3094ae[_0x7bf8('0x2a')]]={'$like':'%'+_0x2eb892[_0x7bf8('0x31')][_0x7bf8('0x3a')]+'%'};return _0x33bfef;}})});}_0xb41a7b=_[_0x7bf8('0x3c')]({},_0xb41a7b,_0x2eb892['options']);var _0x37e28e={'where':_0xb41a7b['where']};return db['Interval'][_0x7bf8('0x20')](_0x37e28e)[_0x7bf8('0x27')](function(_0x3f8096){_0x54d934[_0x7bf8('0x20')]=_0x3f8096;if(_0x2eb892[_0x7bf8('0x31')]['includeAll']){_0xb41a7b[_0x7bf8('0x3e')]=[{'all':!![]}];}return db[_0x7bf8('0x2d')][_0x7bf8('0x3f')](_0xb41a7b);})[_0x7bf8('0x27')](function(_0xe6b058){_0x54d934[_0x7bf8('0x40')]=_0xe6b058;return _0x54d934;})['then'](respondWithFilteredResult(_0x2b38e6,_0xb41a7b))[_0x7bf8('0x41')](handleError(_0x2b38e6,null));};exports[_0x7bf8('0x42')]=function(_0x413f68,_0x2c9917){var _0x51720a={'raw':!![],'where':{'id':_0x413f68['params']['id']}},_0x21b3df={};_0x21b3df[_0x7bf8('0x30')]=_[_0x7bf8('0x32')](db[_0x7bf8('0x2d')]['rawAttributes']);_0x21b3df[_0x7bf8('0x31')]=_[_0x7bf8('0x32')](_0x413f68[_0x7bf8('0x31')]);_0x21b3df['filters']=_[_0x7bf8('0x33')](_0x21b3df[_0x7bf8('0x30')],_0x21b3df['query']);_0x51720a[_0x7bf8('0x34')]=_['intersection'](_0x21b3df['model'],qs[_0x7bf8('0x43')](_0x413f68[_0x7bf8('0x31')][_0x7bf8('0x43')]));_0x51720a['attributes']=_0x51720a[_0x7bf8('0x34')][_0x7bf8('0x35')]?_0x51720a['attributes']:_0x21b3df[_0x7bf8('0x30')];if(_0x413f68['query'][_0x7bf8('0x44')]){_0x51720a[_0x7bf8('0x3e')]=[{'all':!![]}];}_0x51720a=_[_0x7bf8('0x3c')]({},_0x51720a,_0x413f68[_0x7bf8('0x45')]);return db[_0x7bf8('0x2d')][_0x7bf8('0x46')](_0x51720a)['then'](handleEntityNotFound(_0x2c9917,null))[_0x7bf8('0x27')](respondWithResult(_0x2c9917,null))['catch'](handleError(_0x2c9917,null));};exports['create']=function(_0xe3dda0,_0x446c09){return db[_0x7bf8('0x2d')]['create'](_0xe3dda0[_0x7bf8('0x47')],{})['then'](function(_0x63f7a5){var _0x1f8c33=_0xe3dda0[_0x7bf8('0x48')]['get']({'plain':!![]});if(!_0x1f8c33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f8c33['role']===_0x7bf8('0x48')){var _0x224417=_0x63f7a5[_0x7bf8('0x49')]({'plain':!![]});var _0x3bba39=_0x7bf8('0x4a');return db['UserProfileSection'][_0x7bf8('0x46')]({'where':{'name':_0x3bba39,'userProfileId':_0x1f8c33[_0x7bf8('0x4b')]},'raw':!![]})[_0x7bf8('0x27')](function(_0x359670){if(_0x359670&&_0x359670[_0x7bf8('0x4c')]===0x0){return db[_0x7bf8('0x4d')][_0x7bf8('0x4e')]({'name':_0x224417['name'],'resourceId':_0x224417['id'],'type':_0x359670[_0x7bf8('0x2a')],'sectionId':_0x359670['id']},{})['then'](function(){return _0x63f7a5;});}else{return _0x63f7a5;}})['catch'](function(_0x129d36){logger[_0x7bf8('0x4f')](_0x7bf8('0x50'),_0x129d36);throw _0x129d36;});}return _0x63f7a5;})[_0x7bf8('0x27')](respondWithResult(_0x446c09,0xc9))['catch'](handleError(_0x446c09,null));};exports[_0x7bf8('0x26')]=function(_0x1b83b0,_0x4ab7cb){if(_0x1b83b0[_0x7bf8('0x47')]['id']){delete _0x1b83b0[_0x7bf8('0x47')]['id'];}return db[_0x7bf8('0x2d')]['find']({'where':{'id':_0x1b83b0['params']['id']}})['then'](handleEntityNotFound(_0x4ab7cb,null))['then'](saveUpdates(_0x1b83b0[_0x7bf8('0x47')],null))[_0x7bf8('0x27')](respondWithResult(_0x4ab7cb,null))['catch'](handleError(_0x4ab7cb,null));};exports['destroy']=function(_0x49cc9b,_0x5c24ca){return db[_0x7bf8('0x2d')][_0x7bf8('0x46')]({'where':{'id':_0x49cc9b[_0x7bf8('0x51')]['id']}})[_0x7bf8('0x27')](handleEntityNotFound(_0x5c24ca,null))['then'](removeEntity(_0x5c24ca,null))[_0x7bf8('0x41')](handleError(_0x5c24ca,null));};exports['addInterval']=function(_0x186329,_0x17337d,_0x4e65bb){if(_0x186329[_0x7bf8('0x47')]['id']){delete _0x186329[_0x7bf8('0x47')]['id'];}return db[_0x7bf8('0x2d')][_0x7bf8('0x46')]({'where':{'id':_0x186329[_0x7bf8('0x51')]['id']}})['then'](handleEntityNotFound(_0x17337d,null))[_0x7bf8('0x27')](function(_0x38860b){if(_0x38860b){_0x186329[_0x7bf8('0x47')][_0x7bf8('0x52')]=_0x38860b['id'];return db[_0x7bf8('0x2d')][_0x7bf8('0x4e')](_0x186329[_0x7bf8('0x47')]);}})['then'](respondWithResult(_0x17337d,null))['catch'](handleError(_0x17337d,null));};exports[_0x7bf8('0x53')]=function(_0x41e401,_0x5ab2e4,_0x6d4ead){var _0x4e7aff={};var _0x1e6a19={};var _0x202251;var _0x4767f4;return db['Interval']['findOne']({'where':{'id':_0x41e401[_0x7bf8('0x51')]['id']}})[_0x7bf8('0x27')](handleEntityNotFound(_0x5ab2e4,null))[_0x7bf8('0x27')](function(_0xa815b7){if(_0xa815b7){_0x202251=_0xa815b7;_0x1e6a19[_0x7bf8('0x30')]=_[_0x7bf8('0x32')](db[_0x7bf8('0x2d')]['rawAttributes']);_0x1e6a19['query']=_[_0x7bf8('0x32')](_0x41e401['query']);_0x1e6a19[_0x7bf8('0x39')]=_['intersection'](_0x1e6a19['model'],_0x1e6a19['query']);_0x4e7aff[_0x7bf8('0x34')]=_[_0x7bf8('0x33')](_0x1e6a19[_0x7bf8('0x30')],qs['fields'](_0x41e401[_0x7bf8('0x31')][_0x7bf8('0x43')]));_0x4e7aff[_0x7bf8('0x34')]=_0x4e7aff['attributes'][_0x7bf8('0x35')]?_0x4e7aff['attributes']:_0x1e6a19[_0x7bf8('0x30')];_0x4e7aff['order']=qs[_0x7bf8('0x38')](_0x41e401[_0x7bf8('0x31')][_0x7bf8('0x38')]);_0x4e7aff[_0x7bf8('0x3b')]=qs[_0x7bf8('0x39')](_[_0x7bf8('0x54')](_0x41e401[_0x7bf8('0x31')],_0x1e6a19[_0x7bf8('0x39')]));if(_0x41e401['query'][_0x7bf8('0x3a')]){_0x4e7aff[_0x7bf8('0x3b')]=_[_0x7bf8('0x3c')](_0x4e7aff[_0x7bf8('0x3b')],{'$or':_['map'](_0x4e7aff['attributes'],function(_0x38ac8d){var _0x32604f={};_0x32604f[_0x38ac8d]={'$like':'%'+_0x41e401['query'][_0x7bf8('0x3a')]+'%'};return _0x32604f;})});}_0x4e7aff=_['merge']({},_0x4e7aff,_0x41e401[_0x7bf8('0x45')]);return _0x202251[_0x7bf8('0x53')](_0x4e7aff);}})[_0x7bf8('0x27')](function(_0xc5d700){if(_0xc5d700){_0x4767f4=_0xc5d700[_0x7bf8('0x35')];if(!_0x41e401['query'][_0x7bf8('0x55')](_0x7bf8('0x36'))){_0x4e7aff[_0x7bf8('0x1f')]=qs['limit'](_0x41e401[_0x7bf8('0x31')]['limit']);_0x4e7aff[_0x7bf8('0x1d')]=qs[_0x7bf8('0x1d')](_0x41e401[_0x7bf8('0x31')]['offset']);}return _0x202251[_0x7bf8('0x53')](_0x4e7aff);}})[_0x7bf8('0x27')](function(_0x1ab405){if(_0x1ab405){return _0x1ab405?{'count':_0x4767f4,'rows':_0x1ab405}:null;}})['then'](respondWithResult(_0x5ab2e4,null))[_0x7bf8('0x41')](handleError(_0x5ab2e4,null));};exports[_0x7bf8('0x56')]=function(_0xb36d20,_0x396cd7,_0x4e751d){return db['Interval'][_0x7bf8('0x57')]({'where':{'id':_0xb36d20['params']['id']}})[_0x7bf8('0x27')](handleEntityNotFound(_0x396cd7,null))[_0x7bf8('0x27')](function(_0x57993b){if(_0x57993b){return db[_0x7bf8('0x58')][_0x7bf8('0x59')](function(_0xf387d5){return db['Interval'][_0x7bf8('0x28')]({'where':{'IntervalId':_0xb36d20[_0x7bf8('0x51')]['id']},'transaction':_0xf387d5})['then'](function(_0x337958){var _0x23de2d=_[_0x7bf8('0x2c')](_0xb36d20[_0x7bf8('0x47')],function(_0x3439da){delete _0x3439da['id'];_0x3439da[_0x7bf8('0x52')]=_0xb36d20[_0x7bf8('0x51')]['id'];return _0x3439da;});return db[_0x7bf8('0x2d')][_0x7bf8('0x5a')](_0x23de2d,{'transaction':_0xf387d5});});})[_0x7bf8('0x27')](function(){return db[_0x7bf8('0x2d')][_0x7bf8('0x3f')]({'where':{'IntervalId':_0xb36d20[_0x7bf8('0x51')]['id']}});});}})[_0x7bf8('0x27')](respondWithResult(_0x396cd7,null))[_0x7bf8('0x41')](handleError(_0x396cd7,null));}; \ No newline at end of file +var _0xcdd6=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','fieldName','type','model','map','keys','filters','intersection','query','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Interval','includeAll','findAll','catch','show','rawAttributes','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','sequelize','transaction','eml-format','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','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','../../components/extensions/rewrite','sendStatus','status','end'];(function(_0x291589,_0x394acd){var _0x304d5d=function(_0x12e247){while(--_0x12e247){_0x291589['push'](_0x291589['shift']());}};_0x304d5d(++_0x394acd);}(_0xcdd6,0xf5));var _0x6cdd=function(_0x56172a,_0x4e9617){_0x56172a=_0x56172a-0x0;var _0x259380=_0xcdd6[_0x56172a];return _0x259380;};'use strict';var emlformat=require(_0x6cdd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6cdd('0x1'));var rp=require(_0x6cdd('0x2'));var moment=require(_0x6cdd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cdd('0x4'));var path=require(_0x6cdd('0x5'));var sox=require('sox');var csv=require(_0x6cdd('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cdd('0x7'));var _=require(_0x6cdd('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6cdd('0x9'));var deskjs=require(_0x6cdd('0xa'));var toCsv=require(_0x6cdd('0x6'));var querystring=require(_0x6cdd('0xb'));var Papa=require(_0x6cdd('0xc'));var Redis=require('ioredis');var authService=require(_0x6cdd('0xd'));var qs=require(_0x6cdd('0xe'));var as=require(_0x6cdd('0xf'));var hardwareService=require(_0x6cdd('0x10'));var logger=require(_0x6cdd('0x11'))(_0x6cdd('0x12'));var utils=require(_0x6cdd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6cdd('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0x6cdd('0x15'));function respondWithStatusCode(_0x4bb4f9,_0x200ac9){_0x200ac9=_0x200ac9||0xcc;return function(_0x316d10){if(_0x316d10){return _0x4bb4f9[_0x6cdd('0x16')](_0x200ac9);}return _0x4bb4f9[_0x6cdd('0x17')](_0x200ac9)[_0x6cdd('0x18')]();};}function respondWithResult(_0x3ac029,_0x1aa78f){_0x1aa78f=_0x1aa78f||0xc8;return function(_0x267438){if(_0x267438){return _0x3ac029[_0x6cdd('0x17')](_0x1aa78f)[_0x6cdd('0x19')](_0x267438);}};}function respondWithFilteredResult(_0x5556c2,_0x161873){return function(_0x5906c4){if(_0x5906c4){var _0x26d97c=typeof _0x161873[_0x6cdd('0x1a')]===_0x6cdd('0x1b')&&typeof _0x161873[_0x6cdd('0x1c')]===_0x6cdd('0x1b');var _0x20f92b=_0x5906c4[_0x6cdd('0x1d')];var _0x460fc3=_0x26d97c?0x0:_0x161873[_0x6cdd('0x1a')];var _0x8ce07c=_0x26d97c?_0x5906c4[_0x6cdd('0x1d')]:_0x161873[_0x6cdd('0x1a')]+_0x161873[_0x6cdd('0x1c')];var _0x4edbd4;if(_0x8ce07c>=_0x20f92b){_0x8ce07c=_0x20f92b;_0x4edbd4=0xc8;}else{_0x4edbd4=0xce;}_0x5556c2[_0x6cdd('0x17')](_0x4edbd4);return _0x5556c2[_0x6cdd('0x1e')](_0x6cdd('0x1f'),_0x460fc3+'-'+_0x8ce07c+'/'+_0x20f92b)['json'](_0x5906c4);}return null;};}function patchUpdates(_0x1a85d1){return function(_0x553d72){try{jsonpatch[_0x6cdd('0x20')](_0x553d72,_0x1a85d1,!![]);}catch(_0x1f3870){return BPromise[_0x6cdd('0x21')](_0x1f3870);}return _0x553d72[_0x6cdd('0x22')]();};}function saveUpdates(_0x322ba7,_0x1c2ab7){return function(_0x5448a5){if(_0x5448a5){return _0x5448a5['update'](_0x322ba7)[_0x6cdd('0x23')](function(_0x2f9214){return _0x2f9214;});}return null;};}function removeEntity(_0x2e4796,_0x4e0cc8){return function(_0x42a209){if(_0x42a209){return _0x42a209['destroy']()['then'](function(){var _0x3bc45b=_0x42a209[_0x6cdd('0x24')]({'plain':!![]});var _0x58d4bc='Intervals';return db[_0x6cdd('0x25')][_0x6cdd('0x26')]({'where':{'type':_0x58d4bc,'resourceId':_0x3bc45b['id']}})['then'](function(){return _0x42a209;});})[_0x6cdd('0x23')](function(){_0x2e4796[_0x6cdd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39cce5,_0x45e7c2){return function(_0x492990){if(!_0x492990){_0x39cce5[_0x6cdd('0x16')](0x194);}return _0x492990;};}function handleError(_0x4bf80c,_0x3778f1){_0x3778f1=_0x3778f1||0x1f4;return function(_0x1d53ea){logger[_0x6cdd('0x27')](_0x1d53ea[_0x6cdd('0x28')]);if(_0x1d53ea['name']){delete _0x1d53ea[_0x6cdd('0x29')];}_0x4bf80c[_0x6cdd('0x17')](_0x3778f1)[_0x6cdd('0x2a')](_0x1d53ea);};}exports['index']=function(_0x40f308,_0x1eb4a1){var _0x47399f={},_0x30c00f={},_0x4ebdb0={'count':0x0,'rows':[]};var _0x429883=_['map'](db['Interval']['rawAttributes'],function(_0x86210a){return{'name':_0x86210a[_0x6cdd('0x2b')],'type':_0x86210a[_0x6cdd('0x2c')]['key']};});_0x30c00f[_0x6cdd('0x2d')]=_[_0x6cdd('0x2e')](_0x429883,'name');_0x30c00f['query']=_[_0x6cdd('0x2f')](_0x40f308['query']);_0x30c00f[_0x6cdd('0x30')]=_[_0x6cdd('0x31')](_0x30c00f[_0x6cdd('0x2d')],_0x30c00f[_0x6cdd('0x32')]);_0x47399f['attributes']=_[_0x6cdd('0x31')](_0x30c00f[_0x6cdd('0x2d')],qs[_0x6cdd('0x33')](_0x40f308[_0x6cdd('0x32')][_0x6cdd('0x33')]));_0x47399f['attributes']=_0x47399f['attributes'][_0x6cdd('0x34')]?_0x47399f[_0x6cdd('0x35')]:_0x30c00f[_0x6cdd('0x2d')];if(!_0x40f308[_0x6cdd('0x32')]['hasOwnProperty'](_0x6cdd('0x36'))){_0x47399f[_0x6cdd('0x1c')]=qs['limit'](_0x40f308[_0x6cdd('0x32')]['limit']);_0x47399f['offset']=qs['offset'](_0x40f308[_0x6cdd('0x32')][_0x6cdd('0x1a')]);}_0x47399f[_0x6cdd('0x37')]=qs[_0x6cdd('0x38')](_0x40f308[_0x6cdd('0x32')][_0x6cdd('0x38')]);_0x47399f[_0x6cdd('0x39')]=qs[_0x6cdd('0x30')](_[_0x6cdd('0x3a')](_0x40f308[_0x6cdd('0x32')],_0x30c00f[_0x6cdd('0x30')]),_0x429883);if(_0x40f308[_0x6cdd('0x32')][_0x6cdd('0x3b')]){_0x47399f[_0x6cdd('0x39')]=_[_0x6cdd('0x3c')](_0x47399f['where'],{'$or':_['map'](_0x429883,function(_0x1f136b){if(_0x1f136b[_0x6cdd('0x2c')]!==_0x6cdd('0x3d')){var _0xf5d2d5={};_0xf5d2d5[_0x1f136b[_0x6cdd('0x29')]]={'$like':'%'+_0x40f308['query'][_0x6cdd('0x3b')]+'%'};return _0xf5d2d5;}})});}_0x47399f=_[_0x6cdd('0x3c')]({},_0x47399f,_0x40f308['options']);var _0x538782={'where':_0x47399f['where']};return db[_0x6cdd('0x3e')][_0x6cdd('0x1d')](_0x538782)[_0x6cdd('0x23')](function(_0x11e943){_0x4ebdb0[_0x6cdd('0x1d')]=_0x11e943;if(_0x40f308[_0x6cdd('0x32')][_0x6cdd('0x3f')]){_0x47399f['include']=[{'all':!![]}];}return db[_0x6cdd('0x3e')][_0x6cdd('0x40')](_0x47399f);})['then'](function(_0x99f359){_0x4ebdb0['rows']=_0x99f359;return _0x4ebdb0;})['then'](respondWithFilteredResult(_0x1eb4a1,_0x47399f))[_0x6cdd('0x41')](handleError(_0x1eb4a1,null));};exports[_0x6cdd('0x42')]=function(_0x428966,_0x478a9f){var _0x114eea={'raw':!![],'where':{'id':_0x428966['params']['id']}},_0x5d60c6={};_0x5d60c6[_0x6cdd('0x2d')]=_['keys'](db[_0x6cdd('0x3e')][_0x6cdd('0x43')]);_0x5d60c6[_0x6cdd('0x32')]=_[_0x6cdd('0x2f')](_0x428966[_0x6cdd('0x32')]);_0x5d60c6[_0x6cdd('0x30')]=_[_0x6cdd('0x31')](_0x5d60c6['model'],_0x5d60c6['query']);_0x114eea[_0x6cdd('0x35')]=_[_0x6cdd('0x31')](_0x5d60c6[_0x6cdd('0x2d')],qs[_0x6cdd('0x33')](_0x428966['query']['fields']));_0x114eea[_0x6cdd('0x35')]=_0x114eea['attributes'][_0x6cdd('0x34')]?_0x114eea['attributes']:_0x5d60c6['model'];if(_0x428966[_0x6cdd('0x32')][_0x6cdd('0x3f')]){_0x114eea[_0x6cdd('0x44')]=[{'all':!![]}];}_0x114eea=_[_0x6cdd('0x3c')]({},_0x114eea,_0x428966[_0x6cdd('0x45')]);return db[_0x6cdd('0x3e')][_0x6cdd('0x46')](_0x114eea)[_0x6cdd('0x23')](handleEntityNotFound(_0x478a9f,null))['then'](respondWithResult(_0x478a9f,null))[_0x6cdd('0x41')](handleError(_0x478a9f,null));};exports['create']=function(_0x492441,_0x50a219){return db[_0x6cdd('0x3e')][_0x6cdd('0x47')](_0x492441['body'],{})[_0x6cdd('0x23')](function(_0x4161f2){var _0x40295f=_0x492441[_0x6cdd('0x48')]['get']({'plain':!![]});if(!_0x40295f)throw new Error(_0x6cdd('0x49'));if(_0x40295f[_0x6cdd('0x4a')]===_0x6cdd('0x48')){var _0x16ac54=_0x4161f2[_0x6cdd('0x24')]({'plain':!![]});var _0x1529d7=_0x6cdd('0x4b');return db[_0x6cdd('0x4c')]['find']({'where':{'name':_0x1529d7,'userProfileId':_0x40295f[_0x6cdd('0x4d')]},'raw':!![]})[_0x6cdd('0x23')](function(_0x32d64d){if(_0x32d64d&&_0x32d64d[_0x6cdd('0x4e')]===0x0){return db[_0x6cdd('0x25')]['create']({'name':_0x16ac54['name'],'resourceId':_0x16ac54['id'],'type':_0x32d64d[_0x6cdd('0x29')],'sectionId':_0x32d64d['id']},{})['then'](function(){return _0x4161f2;});}else{return _0x4161f2;}})[_0x6cdd('0x41')](function(_0x1a3925){logger[_0x6cdd('0x27')](_0x6cdd('0x4f'),_0x1a3925);throw _0x1a3925;});}return _0x4161f2;})[_0x6cdd('0x23')](respondWithResult(_0x50a219,0xc9))['catch'](handleError(_0x50a219,null));};exports[_0x6cdd('0x50')]=function(_0x2eadc2,_0x25ff2a){if(_0x2eadc2[_0x6cdd('0x51')]['id']){delete _0x2eadc2['body']['id'];}return db[_0x6cdd('0x3e')][_0x6cdd('0x46')]({'where':{'id':_0x2eadc2['params']['id']}})[_0x6cdd('0x23')](handleEntityNotFound(_0x25ff2a,null))[_0x6cdd('0x23')](saveUpdates(_0x2eadc2[_0x6cdd('0x51')],null))[_0x6cdd('0x23')](respondWithResult(_0x25ff2a,null))[_0x6cdd('0x41')](handleError(_0x25ff2a,null));};exports['destroy']=function(_0xc23220,_0x231f70){return db[_0x6cdd('0x3e')][_0x6cdd('0x46')]({'where':{'id':_0xc23220[_0x6cdd('0x52')]['id']}})[_0x6cdd('0x23')](handleEntityNotFound(_0x231f70,null))[_0x6cdd('0x23')](removeEntity(_0x231f70,null))[_0x6cdd('0x41')](handleError(_0x231f70,null));};exports[_0x6cdd('0x53')]=function(_0xf2fc73,_0x582af6,_0x1c413a){if(_0xf2fc73[_0x6cdd('0x51')]['id']){delete _0xf2fc73[_0x6cdd('0x51')]['id'];}return db[_0x6cdd('0x3e')][_0x6cdd('0x46')]({'where':{'id':_0xf2fc73[_0x6cdd('0x52')]['id']}})[_0x6cdd('0x23')](handleEntityNotFound(_0x582af6,null))[_0x6cdd('0x23')](function(_0x4bb462){if(_0x4bb462){_0xf2fc73[_0x6cdd('0x51')][_0x6cdd('0x54')]=_0x4bb462['id'];return db[_0x6cdd('0x3e')][_0x6cdd('0x47')](_0xf2fc73[_0x6cdd('0x51')]);}})[_0x6cdd('0x23')](respondWithResult(_0x582af6,null))['catch'](handleError(_0x582af6,null));};exports[_0x6cdd('0x55')]=function(_0x1f9196,_0x28ae17,_0x281ed8){var _0x39bf0e={};var _0x5760b2={};var _0x4fe6f9;var _0x42ba4c;return db[_0x6cdd('0x3e')][_0x6cdd('0x56')]({'where':{'id':_0x1f9196[_0x6cdd('0x52')]['id']}})[_0x6cdd('0x23')](handleEntityNotFound(_0x28ae17,null))[_0x6cdd('0x23')](function(_0x3efc50){if(_0x3efc50){_0x4fe6f9=_0x3efc50;_0x5760b2[_0x6cdd('0x2d')]=_[_0x6cdd('0x2f')](db[_0x6cdd('0x3e')][_0x6cdd('0x43')]);_0x5760b2['query']=_[_0x6cdd('0x2f')](_0x1f9196['query']);_0x5760b2[_0x6cdd('0x30')]=_[_0x6cdd('0x31')](_0x5760b2[_0x6cdd('0x2d')],_0x5760b2[_0x6cdd('0x32')]);_0x39bf0e[_0x6cdd('0x35')]=_[_0x6cdd('0x31')](_0x5760b2[_0x6cdd('0x2d')],qs['fields'](_0x1f9196[_0x6cdd('0x32')][_0x6cdd('0x33')]));_0x39bf0e[_0x6cdd('0x35')]=_0x39bf0e[_0x6cdd('0x35')][_0x6cdd('0x34')]?_0x39bf0e[_0x6cdd('0x35')]:_0x5760b2[_0x6cdd('0x2d')];_0x39bf0e[_0x6cdd('0x37')]=qs[_0x6cdd('0x38')](_0x1f9196[_0x6cdd('0x32')]['sort']);_0x39bf0e['where']=qs[_0x6cdd('0x30')](_[_0x6cdd('0x3a')](_0x1f9196[_0x6cdd('0x32')],_0x5760b2[_0x6cdd('0x30')]));if(_0x1f9196[_0x6cdd('0x32')]['filter']){_0x39bf0e['where']=_[_0x6cdd('0x3c')](_0x39bf0e[_0x6cdd('0x39')],{'$or':_[_0x6cdd('0x2e')](_0x39bf0e[_0x6cdd('0x35')],function(_0x3b0f41){var _0x3a5dbf={};_0x3a5dbf[_0x3b0f41]={'$like':'%'+_0x1f9196['query']['filter']+'%'};return _0x3a5dbf;})});}_0x39bf0e=_[_0x6cdd('0x3c')]({},_0x39bf0e,_0x1f9196[_0x6cdd('0x45')]);return _0x4fe6f9[_0x6cdd('0x55')](_0x39bf0e);}})[_0x6cdd('0x23')](function(_0x111aff){if(_0x111aff){_0x42ba4c=_0x111aff[_0x6cdd('0x34')];if(!_0x1f9196[_0x6cdd('0x32')][_0x6cdd('0x57')](_0x6cdd('0x36'))){_0x39bf0e['limit']=qs[_0x6cdd('0x1c')](_0x1f9196[_0x6cdd('0x32')][_0x6cdd('0x1c')]);_0x39bf0e['offset']=qs[_0x6cdd('0x1a')](_0x1f9196[_0x6cdd('0x32')][_0x6cdd('0x1a')]);}return _0x4fe6f9[_0x6cdd('0x55')](_0x39bf0e);}})[_0x6cdd('0x23')](function(_0x4e632b){if(_0x4e632b){return _0x4e632b?{'count':_0x42ba4c,'rows':_0x4e632b}:null;}})[_0x6cdd('0x23')](respondWithResult(_0x28ae17,null))['catch'](handleError(_0x28ae17,null));};exports['addIntervals']=function(_0x20237b,_0x5629f7,_0x53e5ba){return db[_0x6cdd('0x3e')][_0x6cdd('0x56')]({'where':{'id':_0x20237b[_0x6cdd('0x52')]['id']}})[_0x6cdd('0x23')](handleEntityNotFound(_0x5629f7,null))[_0x6cdd('0x23')](function(_0x201dad){if(_0x201dad){return db[_0x6cdd('0x58')][_0x6cdd('0x59')](function(_0x2d0986){return db['Interval']['destroy']({'where':{'IntervalId':_0x20237b[_0x6cdd('0x52')]['id']},'transaction':_0x2d0986})[_0x6cdd('0x23')](function(_0x2bb5e2){var _0x3d78bf=_[_0x6cdd('0x2e')](_0x20237b['body'],function(_0x589d6a){delete _0x589d6a['id'];_0x589d6a['IntervalId']=_0x20237b[_0x6cdd('0x52')]['id'];return _0x589d6a;});return db[_0x6cdd('0x3e')]['bulkCreate'](_0x3d78bf,{'transaction':_0x2d0986});});})['then'](function(){return db[_0x6cdd('0x3e')][_0x6cdd('0x40')]({'where':{'IntervalId':_0x20237b['params']['id']}});});}})[_0x6cdd('0x23')](respondWithResult(_0x5629f7,null))[_0x6cdd('0x41')](handleError(_0x5629f7,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 3550c8e..0c8fa4b 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 _0x53df=['exports','define','Interval','rewrite','interval','string','getIntervals','then','all','map','reduce','../../components/extensions/rewrite','../../utils/iftime'];(function(_0x5fe20f,_0x26463c){var _0x4adf4e=function(_0x14991c){while(--_0x14991c){_0x5fe20f['push'](_0x5fe20f['shift']());}};_0x4adf4e(++_0x26463c);}(_0x53df,0x8d));var _0xf53d=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x53df[_0xd0b415];return _0x2bdf2c;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0xf53d('0x0'));var iftime=require(_0xf53d('0x1'))['iftime'];module[_0xf53d('0x2')]=function(_0x18c6cc){return _0x18c6cc[_0xf53d('0x3')](_0xf53d('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x6ad5d7){extensions[_0xf53d('0x5')](_0x18c6cc,_0x6ad5d7);},'afterBulkCreate':function(_0x15ef52,_0x3fa357,_0x18bcf6){_0x18bcf6();extensions[_0xf53d('0x5')](_0x18c6cc,_0x15ef52[0x0]);},'afterUpdate':function(_0x5009d0){extensions[_0xf53d('0x5')](_0x18c6cc,_0x5009d0);},'afterDestroy':function(_0x493e53){extensions[_0xf53d('0x5')](_0x18c6cc,_0x493e53);}},'instanceMethods':{'ifTime':function(_0xeff38e=undefined,_0x2a2320=new Date()){if(typeof this[_0xf53d('0x6')]===_0xf53d('0x7')){return iftime(this[_0xf53d('0x6')],_0xeff38e,_0x2a2320);}else{return this[_0xf53d('0x8')]()[_0xf53d('0x9')](function(_0x1bb937){return Promise[_0xf53d('0xa')](_0x1bb937[_0xf53d('0xb')](function(_0x54186f){return _0x54186f['ifTime'](_0xeff38e,_0x2a2320);}));})[_0xf53d('0x9')](function(_0x298986){return _0x298986[_0xf53d('0xc')](function(_0x57f779,_0x55d058){return _0x57f779||_0x55d058;},![]);});}}}});}; \ No newline at end of file +var _0x96c2=['getIntervals','then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','tools_intervals','rewrite','interval','string'];(function(_0x301613,_0x5d8672){var _0x1ade61=function(_0xb11f03){while(--_0xb11f03){_0x301613['push'](_0x301613['shift']());}};_0x1ade61(++_0x5d8672);}(_0x96c2,0x1e6));var _0x296c=function(_0x42c6f1,_0x338d7b){_0x42c6f1=_0x42c6f1-0x0;var _0x3c7398=_0x96c2[_0x42c6f1];return _0x3c7398;};'use strict';var attributes=require(_0x296c('0x0'));var extensions=require(_0x296c('0x1'));var iftime=require(_0x296c('0x2'))[_0x296c('0x3')];module[_0x296c('0x4')]=function(_0x358a2f){return _0x358a2f[_0x296c('0x5')]('Interval',attributes,{'tableName':_0x296c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49a869){extensions['rewrite'](_0x358a2f,_0x49a869);},'afterBulkCreate':function(_0x508877,_0x54fcd7,_0x43b4ee){_0x43b4ee();extensions['rewrite'](_0x358a2f,_0x508877[0x0]);},'afterUpdate':function(_0x549734){extensions[_0x296c('0x7')](_0x358a2f,_0x549734);},'afterDestroy':function(_0x381790){extensions[_0x296c('0x7')](_0x358a2f,_0x381790);}},'instanceMethods':{'ifTime':function(_0x23a15f=undefined,_0x23e519=new Date()){if(typeof this[_0x296c('0x8')]===_0x296c('0x9')){return iftime(this[_0x296c('0x8')],_0x23a15f,_0x23e519);}else{return this[_0x296c('0xa')]()[_0x296c('0xb')](function(_0x55715f){return Promise[_0x296c('0xc')](_0x55715f[_0x296c('0xd')](function(_0x937ec5){return _0x937ec5[_0x296c('0xe')](_0x23a15f,_0x23e519);}));})[_0x296c('0xb')](function(_0x1d367f){return _0x1d367f[_0x296c('0xf')](function(_0xaff3ec,_0x418904){return _0xaff3ec||_0x418904;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index e92f3f0..7c4440c 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 _0x3e41=['where','attributes','map','model','include','then','debug','stringify','catch','error','message','ShowInterval','Interval','raw','info','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','isArray','intervals','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','IntervalIftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','../../config/logger','GetInterval','findAll','options'];(function(_0x16f345,_0x161996){var _0x33dcca=function(_0x220563){while(--_0x220563){_0x16f345['push'](_0x16f345['shift']());}};_0x33dcca(++_0x161996);}(_0x3e41,0xb6));var _0x13e4=function(_0x34f10c,_0x3cf83c){_0x34f10c=_0x34f10c-0x0;var _0x100fe7=_0x3e41[_0x34f10c];return _0x100fe7;};'use strict';var _=require(_0x13e4('0x0'));var util=require(_0x13e4('0x1'));var db=require(_0x13e4('0x2'))['db'];var iftime=require(_0x13e4('0x3'))['iftime'];var logger=require(_0x13e4('0x4'))('rpc');exports[_0x13e4('0x5')]=function(_0x2a349e){var _0x5610a1=this;return new Promise(function(_0x50178a,_0xfcec41){return db['Interval'][_0x13e4('0x6')]({'raw':_0x2a349e[_0x13e4('0x7')]?_0x2a349e['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a349e['options']?_0x2a349e[_0x13e4('0x7')][_0x13e4('0x8')]||null:null,'attributes':_0x2a349e[_0x13e4('0x7')]?_0x2a349e[_0x13e4('0x7')][_0x13e4('0x9')]||null:null,'limit':_0x2a349e[_0x13e4('0x7')]?_0x2a349e['options']['limit']||null:null,'include':_0x2a349e[_0x13e4('0x7')]?_0x2a349e['options']['include']?_[_0x13e4('0xa')](_0x2a349e[_0x13e4('0x7')]['include'],function(_0x2f7a2f){return{'model':db[_0x2f7a2f[_0x13e4('0xb')]],'as':_0x2f7a2f['as'],'attributes':_0x2f7a2f[_0x13e4('0x9')],'include':_0x2f7a2f[_0x13e4('0xc')]?_[_0x13e4('0xa')](_0x2f7a2f[_0x13e4('0xc')],function(_0x55be60){return{'model':db[_0x55be60['model']],'as':_0x55be60['as'],'attributes':_0x55be60[_0x13e4('0x9')],'include':_0x55be60['include']?_[_0x13e4('0xa')](_0x55be60[_0x13e4('0xc')],function(_0x167edf){return{'model':db[_0x167edf[_0x13e4('0xb')]],'as':_0x167edf['as'],'attributes':_0x167edf[_0x13e4('0x9')]};}):[]};}):[]};}):[]:[]})[_0x13e4('0xd')](function(_0x5f3b59){logger['info'](_0x13e4('0x5'),_0x2a349e);logger[_0x13e4('0xe')](_0x13e4('0x5'),_0x2a349e,JSON[_0x13e4('0xf')](_0x5f3b59));_0x50178a(_0x5f3b59);})[_0x13e4('0x10')](function(_0x100c61){logger[_0x13e4('0x11')](_0x13e4('0x5'),_0x100c61[_0x13e4('0x12')],_0x2a349e);_0xfcec41(_0x5610a1['error'](0x1f4,_0x100c61[_0x13e4('0x12')]));});});};exports[_0x13e4('0x13')]=function(_0x5a955c){var _0x581d99=this;return new Promise(function(_0x2d3330,_0x357395){return db[_0x13e4('0x14')]['find']({'raw':_0x5a955c[_0x13e4('0x7')]?_0x5a955c[_0x13e4('0x7')][_0x13e4('0x15')]===undefined?!![]:![]:!![],'where':_0x5a955c[_0x13e4('0x7')]?_0x5a955c[_0x13e4('0x7')][_0x13e4('0x8')]||null:null,'attributes':_0x5a955c[_0x13e4('0x7')]?_0x5a955c[_0x13e4('0x7')][_0x13e4('0x9')]||null:null,'include':_0x5a955c[_0x13e4('0x7')]?_0x5a955c[_0x13e4('0x7')][_0x13e4('0xc')]?_[_0x13e4('0xa')](_0x5a955c[_0x13e4('0x7')]['include'],function(_0x429e98){return{'model':db[_0x429e98[_0x13e4('0xb')]],'as':_0x429e98['as'],'attributes':_0x429e98['attributes'],'include':_0x429e98['include']?_[_0x13e4('0xa')](_0x429e98[_0x13e4('0xc')],function(_0x6e5ca){return{'model':db[_0x6e5ca[_0x13e4('0xb')]],'as':_0x6e5ca['as'],'attributes':_0x6e5ca[_0x13e4('0x9')],'include':_0x6e5ca[_0x13e4('0xc')]?_[_0x13e4('0xa')](_0x6e5ca[_0x13e4('0xc')],function(_0x5ff627){return{'model':db[_0x5ff627['model']],'as':_0x5ff627['as'],'attributes':_0x5ff627['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x494280){logger[_0x13e4('0x16')](_0x13e4('0x13'),_0x5a955c);logger[_0x13e4('0xe')](_0x13e4('0x13'),_0x5a955c,JSON[_0x13e4('0xf')](_0x494280));_0x2d3330(_0x494280);})[_0x13e4('0x10')](function(_0x3646a9){logger[_0x13e4('0x11')]('ShowInterval',_0x3646a9[_0x13e4('0x12')],_0x5a955c);_0x357395(_0x581d99[_0x13e4('0x11')](0x1f4,_0x3646a9[_0x13e4('0x12')]));});});};function checkArrayOfIntervals(_0x3c6227,_0x1b5fab){var _0x4e22c2=[];return db[_0x13e4('0x14')]['findAll']({'where':{'id':_0x3c6227}})[_0x13e4('0xd')](function(_0x38d357){_0x4e22c2=_0x38d357;return Promise[_0x13e4('0x17')](_0x4e22c2[_0x13e4('0xa')](function(_0x109b20){return _0x109b20[_0x13e4('0x18')](_0x1b5fab);}));})[_0x13e4('0xd')](function(_0x1e5d7b){var _0x127055=_0x1e5d7b[_0x13e4('0x19')](function(_0xfafde2,_0x597b70){return _0xfafde2||_0x597b70;},![]);logger[_0x13e4('0x16')](util[_0x13e4('0x1a')](_0x13e4('0x1b'),_0x4e22c2[_0x13e4('0xa')](function(_0x2c9931){return _0x2c9931[_0x13e4('0x1c')];})[_0x13e4('0x1d')](',\x20'),_0x4e22c2[_0x13e4('0xa')](function(_0x53fb77){return _0x53fb77['id'];})[_0x13e4('0x1d')](',\x20')));return _0x127055;});}function checkSingleInterval(_0x450525,_0x148ec0){return db[_0x13e4('0x14')][_0x13e4('0x1e')](_0x450525)['then'](function(_0x1a9103){if(_0x1a9103){logger[_0x13e4('0x16')](util[_0x13e4('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x1a9103['name'],_0x1a9103['id']));return _0x1a9103['ifTime'](_0x148ec0);}});}exports['IntervalIftime']=function(_0x4ad7f4){var _0x27cb94=_0x4ad7f4['intervalIds'];var _0x2325d5=Array[_0x13e4('0x1f')](_0x4ad7f4['intervals'])?_0x4ad7f4['intervals']:typeof _0x4ad7f4[_0x13e4('0x20')]==='string'?[_0x4ad7f4[_0x13e4('0x20')]]:[];var _0x3970d8=_0x4ad7f4['timezone']||undefined;var _0x44d21e=![];if(_0x2325d5['length']){logger[_0x13e4('0x16')](util[_0x13e4('0x1a')](_0x13e4('0x21'),_0x2325d5[_0x13e4('0x1d')](';\x20')));}if(_0x3970d8){logger['info'](util[_0x13e4('0x1a')](_0x13e4('0x22'),_0x3970d8));}logger['debug'](_0x13e4('0x23'),_0x44d21e);logger['silly'](_0x13e4('0x24'),_0x4ad7f4);return Promise[_0x13e4('0x25')]()['then'](function(){if(Array['isArray'](_0x27cb94)){return checkArrayOfIntervals(_0x27cb94,_0x3970d8);}else if(_0x27cb94){return checkSingleInterval(_0x27cb94,_0x3970d8);}})[_0x13e4('0xd')](function(_0x4db1be){var _0x4f96c3=_0x2325d5[_0x13e4('0x19')](function(_0x1dcd35,_0x3c4f12){return _0x1dcd35||iftime(_0x3c4f12,_0x3970d8);},![]);_0x44d21e=_0x4db1be||_0x4f96c3;return _0x44d21e;})[_0x13e4('0x10')](function(_0xfc187){logger['error'](_0x13e4('0x24'),_0x4ad7f4,_0xfc187);throw this[_0x13e4('0x11')](0x1f4,_0xfc187['message']);});}; \ No newline at end of file +var _0x54f7=['Interval','options','where','attributes','limit','include','model','map','then','GetInterval','debug','stringify','catch','error','message','raw','info','ShowInterval','findAll','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','ifTime','IntervalIftime','intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc'];(function(_0x17086b,_0x117941){var _0x3b7614=function(_0x5c0269){while(--_0x5c0269){_0x17086b['push'](_0x17086b['shift']());}};_0x3b7614(++_0x117941);}(_0x54f7,0x80));var _0x754f=function(_0x410fd0,_0x4b8953){_0x410fd0=_0x410fd0-0x0;var _0x1ea69b=_0x54f7[_0x410fd0];return _0x1ea69b;};'use strict';var _=require(_0x754f('0x0'));var util=require(_0x754f('0x1'));var db=require(_0x754f('0x2'))['db'];var iftime=require(_0x754f('0x3'))[_0x754f('0x4')];var logger=require(_0x754f('0x5'))(_0x754f('0x6'));exports['GetInterval']=function(_0x2f4709){var _0x41da40=this;return new Promise(function(_0x4bf3dc,_0x6b07ad){return db[_0x754f('0x7')]['findAll']({'raw':_0x2f4709[_0x754f('0x8')]?_0x2f4709[_0x754f('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x2f4709['options']?_0x2f4709[_0x754f('0x8')][_0x754f('0x9')]||null:null,'attributes':_0x2f4709[_0x754f('0x8')]?_0x2f4709[_0x754f('0x8')][_0x754f('0xa')]||null:null,'limit':_0x2f4709[_0x754f('0x8')]?_0x2f4709[_0x754f('0x8')][_0x754f('0xb')]||null:null,'include':_0x2f4709[_0x754f('0x8')]?_0x2f4709['options'][_0x754f('0xc')]?_['map'](_0x2f4709[_0x754f('0x8')][_0x754f('0xc')],function(_0x4e09b1){return{'model':db[_0x4e09b1['model']],'as':_0x4e09b1['as'],'attributes':_0x4e09b1[_0x754f('0xa')],'include':_0x4e09b1[_0x754f('0xc')]?_['map'](_0x4e09b1[_0x754f('0xc')],function(_0x4a28da){return{'model':db[_0x4a28da[_0x754f('0xd')]],'as':_0x4a28da['as'],'attributes':_0x4a28da[_0x754f('0xa')],'include':_0x4a28da[_0x754f('0xc')]?_[_0x754f('0xe')](_0x4a28da['include'],function(_0x493570){return{'model':db[_0x493570[_0x754f('0xd')]],'as':_0x493570['as'],'attributes':_0x493570[_0x754f('0xa')]};}):[]};}):[]};}):[]:[]})[_0x754f('0xf')](function(_0x3c4c29){logger['info'](_0x754f('0x10'),_0x2f4709);logger[_0x754f('0x11')](_0x754f('0x10'),_0x2f4709,JSON[_0x754f('0x12')](_0x3c4c29));_0x4bf3dc(_0x3c4c29);})[_0x754f('0x13')](function(_0x5b05d5){logger[_0x754f('0x14')](_0x754f('0x10'),_0x5b05d5[_0x754f('0x15')],_0x2f4709);_0x6b07ad(_0x41da40[_0x754f('0x14')](0x1f4,_0x5b05d5[_0x754f('0x15')]));});});};exports['ShowInterval']=function(_0x51f156){var _0x4ceb33=this;return new Promise(function(_0x2c134c,_0x2eba7d){return db[_0x754f('0x7')]['find']({'raw':_0x51f156[_0x754f('0x8')]?_0x51f156[_0x754f('0x8')][_0x754f('0x16')]===undefined?!![]:![]:!![],'where':_0x51f156[_0x754f('0x8')]?_0x51f156[_0x754f('0x8')][_0x754f('0x9')]||null:null,'attributes':_0x51f156[_0x754f('0x8')]?_0x51f156[_0x754f('0x8')]['attributes']||null:null,'include':_0x51f156['options']?_0x51f156[_0x754f('0x8')][_0x754f('0xc')]?_[_0x754f('0xe')](_0x51f156[_0x754f('0x8')][_0x754f('0xc')],function(_0xbc8fcc){return{'model':db[_0xbc8fcc['model']],'as':_0xbc8fcc['as'],'attributes':_0xbc8fcc[_0x754f('0xa')],'include':_0xbc8fcc['include']?_[_0x754f('0xe')](_0xbc8fcc[_0x754f('0xc')],function(_0x272cfc){return{'model':db[_0x272cfc['model']],'as':_0x272cfc['as'],'attributes':_0x272cfc[_0x754f('0xa')],'include':_0x272cfc['include']?_['map'](_0x272cfc['include'],function(_0x159077){return{'model':db[_0x159077['model']],'as':_0x159077['as'],'attributes':_0x159077[_0x754f('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1487c2){logger[_0x754f('0x17')](_0x754f('0x18'),_0x51f156);logger[_0x754f('0x11')]('ShowInterval',_0x51f156,JSON[_0x754f('0x12')](_0x1487c2));_0x2c134c(_0x1487c2);})[_0x754f('0x13')](function(_0x2dd98f){logger['error'](_0x754f('0x18'),_0x2dd98f[_0x754f('0x15')],_0x51f156);_0x2eba7d(_0x4ceb33['error'](0x1f4,_0x2dd98f[_0x754f('0x15')]));});});};function checkArrayOfIntervals(_0xa87d9f,_0x74d593){var _0x55fe96=[];return db[_0x754f('0x7')][_0x754f('0x19')]({'where':{'id':_0xa87d9f}})['then'](function(_0xa7747f){_0x55fe96=_0xa7747f;return Promise[_0x754f('0x1a')](_0x55fe96[_0x754f('0xe')](function(_0x147570){return _0x147570['ifTime'](_0x74d593);}));})[_0x754f('0xf')](function(_0x52b7f5){var _0x4e6fd1=_0x52b7f5[_0x754f('0x1b')](function(_0x2bb7ae,_0x2bf9dd){return _0x2bb7ae||_0x2bf9dd;},![]);logger[_0x754f('0x17')](util[_0x754f('0x1c')](_0x754f('0x1d'),_0x55fe96['map'](function(_0x363490){return _0x363490[_0x754f('0x1e')];})[_0x754f('0x1f')](',\x20'),_0x55fe96[_0x754f('0xe')](function(_0x55936e){return _0x55936e['id'];})[_0x754f('0x1f')](',\x20')));return _0x4e6fd1;});}function checkSingleInterval(_0x3e34bb,_0x4c8a4d){return db[_0x754f('0x7')][_0x754f('0x20')](_0x3e34bb)['then'](function(_0x5e3525){if(_0x5e3525){logger['info'](util[_0x754f('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x5e3525[_0x754f('0x1e')],_0x5e3525['id']));return _0x5e3525[_0x754f('0x21')](_0x4c8a4d);}});}exports[_0x754f('0x22')]=function(_0x299e1d){var _0x3a647b=_0x299e1d[_0x754f('0x23')];var _0x354e6d=Array['isArray'](_0x299e1d[_0x754f('0x24')])?_0x299e1d[_0x754f('0x24')]:typeof _0x299e1d['intervals']===_0x754f('0x25')?[_0x299e1d[_0x754f('0x24')]]:[];var _0x500922=_0x299e1d[_0x754f('0x26')]||undefined;var _0xaa403b=![];if(_0x354e6d[_0x754f('0x27')]){logger['info'](util[_0x754f('0x1c')](_0x754f('0x28'),_0x354e6d[_0x754f('0x1f')](';\x20')));}if(_0x500922){logger[_0x754f('0x17')](util[_0x754f('0x1c')](_0x754f('0x29'),_0x500922));}logger[_0x754f('0x11')](_0x754f('0x2a'),_0xaa403b);logger[_0x754f('0x2b')](_0x754f('0x22'),_0x299e1d);return Promise[_0x754f('0x2c')]()[_0x754f('0xf')](function(){if(Array['isArray'](_0x3a647b)){return checkArrayOfIntervals(_0x3a647b,_0x500922);}else if(_0x3a647b){return checkSingleInterval(_0x3a647b,_0x500922);}})[_0x754f('0xf')](function(_0xaaabd0){var _0x137153=_0x354e6d[_0x754f('0x1b')](function(_0x36e530,_0x4a0b18){return _0x36e530||iftime(_0x4a0b18,_0x500922);},![]);_0xaa403b=_0xaaabd0||_0x137153;return _0xaa403b;})[_0x754f('0x13')](function(_0x35aa67){logger[_0x754f('0x14')](_0x754f('0x22'),_0x299e1d,_0x35aa67);throw this[_0x754f('0x14')](0x1f4,_0x35aa67[_0x754f('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 9553935..a8c4eaa 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x322efc,_0x2c08b5){var _0x2214d3=function(_0x2d2fe1){while(--_0x2d2fe1){_0x322efc['push'](_0x322efc['shift']());}};_0x2214d3(++_0x2c08b5);}(_0x2032,0xd9));var _0x2203=function(_0x51ebe6,_0x1b1e46){_0x51ebe6=_0x51ebe6-0x0;var _0xfa5934=_0x2032[_0x51ebe6];return _0xfa5934;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x2e8293,_0x3d09e1){var _0x4a6614=function(_0x2120b1){while(--_0x2120b1){_0x2e8293['push'](_0x2e8293['shift']());}};_0x4a6614(++_0x3d09e1);}(_0x2ef3,0xba));var _0x32ef=function(_0x467d92,_0x38b09e){_0x467d92=_0x467d92-0x0;var _0x50f056=_0x2ef3[_0x467d92];return _0x50f056;};'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 4de8296..a6ec5ff 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 _0xa64e=['remoteAddress','socket','https','../../config/logger','api','support','key','MOTGUI','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11501','oldToken','customfield_11503','customfield_11504','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','base64','request','setEncoding','utf8','data','end','status','json','error','api.jira','write','openIssue','send','body','headers','connection'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0xa64e,0x1ba));var _0xea64=function(_0x10e870,_0x4c4324){_0x10e870=_0x10e870-0x0;var _0x29b93d=_0xa64e[_0x10e870];return _0x29b93d;};'use strict';var BPromise=require('bluebird');var https=require(_0xea64('0x0'));var logger=require(_0xea64('0x1'))(_0xea64('0x2'));var USERNAME=_0xea64('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x4e177e,_0x43058d){var _0x6edea9={'fields':{'project':{'key':_0x4e177e[_0xea64('0x4')]||_0xea64('0x5')},'summary':(_0x4e177e[_0xea64('0x6')]||_0xea64('0x7'))+'\x20from\x20'+_0x4e177e['ip'],'description':_0x4e177e[_0xea64('0x8')]||JSON[_0xea64('0x9')](_0x4e177e),'issuetype':{'name':_0x4e177e[_0xea64('0xa')]||_0xea64('0xb')}}};_0x6edea9[_0xea64('0xc')]['customfield_11500']=_0x4e177e['email'];_0x6edea9['fields'][_0xea64('0xd')]=_0x4e177e[_0xea64('0xe')];_0x6edea9[_0xea64('0xc')]['customfield_11502']=_0x4e177e['newToken'];_0x6edea9[_0xea64('0xc')][_0xea64('0xf')]=_0x4e177e['name'];_0x6edea9[_0xea64('0xc')][_0xea64('0x10')]=_0x4e177e['reason'];_0x6edea9[_0xea64('0xc')][_0xea64('0x11')]=_0x4e177e['ip'];var _0x4d3ed7={'host':_0xea64('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xea64('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0xea64('0x14'),'Authorization':_0xea64('0x15')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xea64('0x16'))}};var _0x2f42a0=JSON['stringify'](_0x6edea9);var _0x3f239c=https[_0xea64('0x17')](_0x4d3ed7,function(_0x1575d2){_0x1575d2[_0xea64('0x18')](_0xea64('0x19'));var _0x406929='';_0x1575d2['on'](_0xea64('0x1a'),function(_0x339c9e){_0x406929+=_0x339c9e;});_0x1575d2['on'](_0xea64('0x1b'),function(){if(_0x43058d){return _0x43058d[_0xea64('0x1c')](_0x1575d2['statusCode'])[_0xea64('0x1d')](JSON['parse'](_0x406929));}});});_0x3f239c['on'](_0xea64('0x1e'),function(_0x39a12b){if(_0x43058d){return _0x43058d[_0xea64('0x1c')](0x1f4)[_0xea64('0x1d')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xea64('0x1f')}]});}});_0x3f239c[_0xea64('0x20')](_0x2f42a0);_0x3f239c['end']();}exports[_0xea64('0x21')]=openIssue;exports[_0xea64('0x22')]=function(_0x4a691c,_0x5566d7){_0x4a691c[_0xea64('0x23')]['ip']=_0x4a691c[_0xea64('0x24')]['x-forwarded-for']||_0x4a691c[_0xea64('0x25')][_0xea64('0x26')]||_0x4a691c[_0xea64('0x27')][_0xea64('0x26')]||_0x4a691c[_0xea64('0x25')]['socket'][_0xea64('0x26')];return openIssue(_0x4a691c[_0xea64('0x23')],_0x5566d7);}; \ No newline at end of file +var _0xc4f3=['customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','stringify','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','end','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','Bug','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504'];(function(_0x16cfae,_0x3c3596){var _0x5a04cf=function(_0x578063){while(--_0x578063){_0x16cfae['push'](_0x16cfae['shift']());}};_0x5a04cf(++_0x3c3596);}(_0xc4f3,0x14e));var _0x3c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f3[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x3c4f('0x0'));var https=require(_0x3c4f('0x1'));var logger=require(_0x3c4f('0x2'))(_0x3c4f('0x3'));var USERNAME=_0x3c4f('0x4');var PASSWORD=_0x3c4f('0x5');function openIssue(_0x3207d8,_0x156d02){var _0x962ff0={'fields':{'project':{'key':_0x3207d8[_0x3c4f('0x6')]||_0x3c4f('0x7')},'summary':(_0x3207d8[_0x3c4f('0x8')]||_0x3c4f('0x9'))+'\x20from\x20'+_0x3207d8['ip'],'description':_0x3207d8[_0x3c4f('0xa')]||JSON['stringify'](_0x3207d8),'issuetype':{'name':_0x3207d8['issuetype']||_0x3c4f('0xb')}}};_0x962ff0[_0x3c4f('0xc')]['customfield_11500']=_0x3207d8['email'];_0x962ff0[_0x3c4f('0xc')][_0x3c4f('0xd')]=_0x3207d8[_0x3c4f('0xe')];_0x962ff0[_0x3c4f('0xc')][_0x3c4f('0xf')]=_0x3207d8[_0x3c4f('0x10')];_0x962ff0[_0x3c4f('0xc')]['customfield_11503']=_0x3207d8['name'];_0x962ff0[_0x3c4f('0xc')][_0x3c4f('0x11')]=_0x3207d8['reason'];_0x962ff0['fields'][_0x3c4f('0x12')]=_0x3207d8['ip'];var _0xeeb511={'host':_0x3c4f('0x13'),'port':0x1bb,'path':_0x3c4f('0x14'),'method':_0x3c4f('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x3c4f('0x16'),'Authorization':_0x3c4f('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x220b69=JSON[_0x3c4f('0x18')](_0x962ff0);var _0x21be3f=https['request'](_0xeeb511,function(_0x2056f0){_0x2056f0[_0x3c4f('0x19')](_0x3c4f('0x1a'));var _0x1188eb='';_0x2056f0['on'](_0x3c4f('0x1b'),function(_0x51e8a8){_0x1188eb+=_0x51e8a8;});_0x2056f0['on']('end',function(){if(_0x156d02){return _0x156d02[_0x3c4f('0x1c')](_0x2056f0[_0x3c4f('0x1d')])[_0x3c4f('0x1e')](JSON[_0x3c4f('0x1f')](_0x1188eb));}});});_0x21be3f['on'](_0x3c4f('0x20'),function(_0x1b9ca3){if(_0x156d02){return _0x156d02[_0x3c4f('0x1c')](0x1f4)[_0x3c4f('0x1e')]({'errors':[{'message':_0x3c4f('0x21'),'type':'api.jira'}]});}});_0x21be3f[_0x3c4f('0x22')](_0x220b69);_0x21be3f[_0x3c4f('0x23')]();}exports[_0x3c4f('0x24')]=openIssue;exports[_0x3c4f('0x25')]=function(_0x451f01,_0x458817){_0x451f01[_0x3c4f('0x26')]['ip']=_0x451f01[_0x3c4f('0x27')][_0x3c4f('0x28')]||_0x451f01[_0x3c4f('0x29')][_0x3c4f('0x2a')]||_0x451f01['socket'][_0x3c4f('0x2a')]||_0x451f01[_0x3c4f('0x29')][_0x3c4f('0x2b')][_0x3c4f('0x2a')];return openIssue(_0x451f01[_0x3c4f('0x26')],_0x458817);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5edaebb..7b716e2 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 _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0x78d6a4,_0x54c5df){var _0x4f06db=function(_0x5cca87){while(--_0x5cca87){_0x78d6a4['push'](_0x78d6a4['shift']());}};_0x4f06db(++_0x54c5df);}(_0x6324,0x142));var _0x4632=function(_0x41f745,_0x4b5c4a){_0x41f745=_0x41f745-0x0;var _0x2cbbcb=_0x6324[_0x41f745];return _0x2cbbcb;};'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('./jscriptyAnswerReport.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['post']('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller[_0x4632('0xf')]);router[_0x4632('0x10')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller['destroy']);module[_0x4632('0x11')]=router; \ No newline at end of file +var _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0x4918fa,_0x3139e4){var _0x1473fd=function(_0x169224){while(--_0x169224){_0x4918fa['push'](_0x4918fa['shift']());}};_0x1473fd(++_0x3139e4);}(_0x6324,0x142));var _0x4632=function(_0x2d0953,_0x30bcf9){_0x2d0953=_0x2d0953-0x0;var _0x1e824a=_0x6324[_0x2d0953];return _0x1e824a;};'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('./jscriptyAnswerReport.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['post']('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller[_0x4632('0xf')]);router[_0x4632('0x10')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller['destroy']);module[_0x4632('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 0da293a..d445a3f 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(_0x10ba1b,_0x14b33e){_0x10ba1b=_0x10ba1b-0x0;var _0x2604a5=_0x7a54[_0x10ba1b];return _0x2604a5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x98f150,_0x276db5){_0x98f150=_0x98f150-0x0;var _0x3f9d4f=_0x7a54[_0x98f150];return _0x3f9d4f;};'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 110a276..ad07a03 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 _0x7f05=['show','rawAttributes','attributes','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch'];(function(_0x513cbb,_0x5bbea5){var _0x481b9e=function(_0x3a32b8){while(--_0x3a32b8){_0x513cbb['push'](_0x513cbb['shift']());}};_0x481b9e(++_0x5bbea5);}(_0x7f05,0xdc));var _0x57f0=function(_0x30e914,_0x22dafe){_0x30e914=_0x30e914-0x0;var _0x5c9421=_0x7f05[_0x30e914];return _0x5c9421;};'use strict';var emlformat=require(_0x57f0('0x0'));var rimraf=require(_0x57f0('0x1'));var zipdir=require(_0x57f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57f0('0x3'));var moment=require('moment');var BPromise=require(_0x57f0('0x4'));var Mustache=require(_0x57f0('0x5'));var util=require('util');var path=require(_0x57f0('0x6'));var sox=require(_0x57f0('0x7'));var csv=require('to-csv');var ejs=require(_0x57f0('0x8'));var fs=require('fs');var fs_extra=require(_0x57f0('0x9'));var _=require('lodash');var squel=require(_0x57f0('0xa'));var crypto=require(_0x57f0('0xb'));var jsforce=require(_0x57f0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x57f0('0xd'));var Papa=require('papaparse');var Redis=require(_0x57f0('0xe'));var authService=require(_0x57f0('0xf'));var qs=require(_0x57f0('0x10'));var as=require(_0x57f0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x57f0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cd266,_0x5615ff){_0x5615ff=_0x5615ff||0xcc;return function(_0x1aa9c8){if(_0x1aa9c8){return _0x5cd266[_0x57f0('0x13')](_0x5615ff);}return _0x5cd266[_0x57f0('0x14')](_0x5615ff)[_0x57f0('0x15')]();};}function respondWithResult(_0x599a6b,_0x4d8d89){_0x4d8d89=_0x4d8d89||0xc8;return function(_0x471f97){if(_0x471f97){return _0x599a6b[_0x57f0('0x14')](_0x4d8d89)[_0x57f0('0x16')](_0x471f97);}};}function respondWithFilteredResult(_0x2e57df,_0x238245){return function(_0x2130ca){if(_0x2130ca){var _0x555e18=typeof _0x238245['offset']===_0x57f0('0x17')&&typeof _0x238245['limit']==='undefined';var _0x48eadd=_0x2130ca['count'];var _0x20d0ba=_0x555e18?0x0:_0x238245[_0x57f0('0x18')];var _0x124f9e=_0x555e18?_0x2130ca['count']:_0x238245[_0x57f0('0x18')]+_0x238245[_0x57f0('0x19')];var _0x3d0cf6;if(_0x124f9e>=_0x48eadd){_0x124f9e=_0x48eadd;_0x3d0cf6=0xc8;}else{_0x3d0cf6=0xce;}_0x2e57df['status'](_0x3d0cf6);return _0x2e57df[_0x57f0('0x1a')](_0x57f0('0x1b'),_0x20d0ba+'-'+_0x124f9e+'/'+_0x48eadd)['json'](_0x2130ca);}return null;};}function patchUpdates(_0x589c18){return function(_0x1f8483){try{jsonpatch[_0x57f0('0x1c')](_0x1f8483,_0x589c18,!![]);}catch(_0x599aa2){return BPromise[_0x57f0('0x1d')](_0x599aa2);}return _0x1f8483['save']();};}function saveUpdates(_0x3a5b6f,_0x9c498){return function(_0x426a09){if(_0x426a09){return _0x426a09[_0x57f0('0x1e')](_0x3a5b6f)['then'](function(_0x5d16a6){return _0x5d16a6;});}return null;};}function removeEntity(_0x43a679,_0x56ceb5){return function(_0x1279ae){if(_0x1279ae){return _0x1279ae[_0x57f0('0x1f')]()[_0x57f0('0x20')](function(){_0x43a679[_0x57f0('0x14')](0xcc)[_0x57f0('0x15')]();});}};}function handleEntityNotFound(_0x1c2cae,_0x4de0f5){return function(_0x941a03){if(!_0x941a03){_0x1c2cae['sendStatus'](0x194);}return _0x941a03;};}function handleError(_0x44a353,_0x5a176f){_0x5a176f=_0x5a176f||0x1f4;return function(_0x563fa5){logger[_0x57f0('0x21')](_0x563fa5['stack']);if(_0x563fa5[_0x57f0('0x22')]){delete _0x563fa5['name'];}_0x44a353['status'](_0x5a176f)[_0x57f0('0x23')](_0x563fa5);};}exports[_0x57f0('0x24')]=function(_0x16c711,_0x3ac9d3){var _0x1858ea={},_0x114b1d={},_0xb3ef4e={'count':0x0,'rows':[]};var _0x43699b=_[_0x57f0('0x25')](db[_0x57f0('0x26')]['rawAttributes'],function(_0x2c61af){return{'name':_0x2c61af[_0x57f0('0x27')],'type':_0x2c61af[_0x57f0('0x28')][_0x57f0('0x29')]};});_0x114b1d[_0x57f0('0x2a')]=_[_0x57f0('0x25')](_0x43699b,_0x57f0('0x22'));_0x114b1d[_0x57f0('0x2b')]=_[_0x57f0('0x2c')](_0x16c711[_0x57f0('0x2b')]);_0x114b1d[_0x57f0('0x2d')]=_[_0x57f0('0x2e')](_0x114b1d[_0x57f0('0x2a')],_0x114b1d[_0x57f0('0x2b')]);_0x1858ea['attributes']=_[_0x57f0('0x2e')](_0x114b1d[_0x57f0('0x2a')],qs[_0x57f0('0x2f')](_0x16c711[_0x57f0('0x2b')]['fields']));_0x1858ea['attributes']=_0x1858ea['attributes'][_0x57f0('0x30')]?_0x1858ea['attributes']:_0x114b1d[_0x57f0('0x2a')];if(!_0x16c711[_0x57f0('0x2b')][_0x57f0('0x31')]('nolimit')){_0x1858ea[_0x57f0('0x19')]=qs[_0x57f0('0x19')](_0x16c711[_0x57f0('0x2b')][_0x57f0('0x19')]);_0x1858ea[_0x57f0('0x18')]=qs[_0x57f0('0x18')](_0x16c711[_0x57f0('0x2b')][_0x57f0('0x18')]);}_0x1858ea[_0x57f0('0x32')]=qs[_0x57f0('0x33')](_0x16c711[_0x57f0('0x2b')][_0x57f0('0x33')]);_0x1858ea[_0x57f0('0x34')]=qs[_0x57f0('0x2d')](_[_0x57f0('0x35')](_0x16c711[_0x57f0('0x2b')],_0x114b1d[_0x57f0('0x2d')]),_0x43699b);if(_0x16c711[_0x57f0('0x2b')][_0x57f0('0x36')]){_0x1858ea['where']=_['merge'](_0x1858ea[_0x57f0('0x34')],{'$or':_[_0x57f0('0x25')](_0x43699b,function(_0x382436){if(_0x382436['type']!==_0x57f0('0x37')){var _0x294756={};_0x294756[_0x382436[_0x57f0('0x22')]]={'$like':'%'+_0x16c711[_0x57f0('0x2b')][_0x57f0('0x36')]+'%'};return _0x294756;}})});}_0x1858ea=_[_0x57f0('0x38')]({},_0x1858ea,_0x16c711[_0x57f0('0x39')]);var _0x2cf365={'where':_0x1858ea[_0x57f0('0x34')]};return db['JscriptyAnswerReport'][_0x57f0('0x3a')](_0x2cf365)[_0x57f0('0x20')](function(_0x44d630){_0xb3ef4e[_0x57f0('0x3a')]=_0x44d630;if(_0x16c711['query'][_0x57f0('0x3b')]){_0x1858ea[_0x57f0('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x57f0('0x3d')](_0x1858ea);})[_0x57f0('0x20')](function(_0x2c3dbd){_0xb3ef4e[_0x57f0('0x3e')]=_0x2c3dbd;return _0xb3ef4e;})[_0x57f0('0x20')](respondWithFilteredResult(_0x3ac9d3,_0x1858ea))[_0x57f0('0x3f')](handleError(_0x3ac9d3,null));};exports[_0x57f0('0x40')]=function(_0x4f3271,_0x42379c){var _0x4e0abe={'raw':!![],'where':{'id':_0x4f3271['params']['id']}},_0x3dd680={};_0x3dd680[_0x57f0('0x2a')]=_[_0x57f0('0x2c')](db[_0x57f0('0x26')][_0x57f0('0x41')]);_0x3dd680[_0x57f0('0x2b')]=_[_0x57f0('0x2c')](_0x4f3271[_0x57f0('0x2b')]);_0x3dd680[_0x57f0('0x2d')]=_[_0x57f0('0x2e')](_0x3dd680[_0x57f0('0x2a')],_0x3dd680[_0x57f0('0x2b')]);_0x4e0abe['attributes']=_[_0x57f0('0x2e')](_0x3dd680[_0x57f0('0x2a')],qs['fields'](_0x4f3271['query'][_0x57f0('0x2f')]));_0x4e0abe['attributes']=_0x4e0abe[_0x57f0('0x42')][_0x57f0('0x30')]?_0x4e0abe[_0x57f0('0x42')]:_0x3dd680['model'];if(_0x4f3271[_0x57f0('0x2b')][_0x57f0('0x3b')]){_0x4e0abe['include']=[{'all':!![]}];}_0x4e0abe=_[_0x57f0('0x38')]({},_0x4e0abe,_0x4f3271[_0x57f0('0x39')]);return db[_0x57f0('0x26')][_0x57f0('0x43')](_0x4e0abe)[_0x57f0('0x20')](handleEntityNotFound(_0x42379c,null))[_0x57f0('0x20')](respondWithResult(_0x42379c,null))['catch'](handleError(_0x42379c,null));};exports[_0x57f0('0x44')]=function(_0x390119,_0x4b93e5){return db[_0x57f0('0x26')]['create'](_0x390119[_0x57f0('0x45')],{})['then'](respondWithResult(_0x4b93e5,0xc9))[_0x57f0('0x3f')](handleError(_0x4b93e5,null));};exports['update']=function(_0x4c6eb1,_0x22abb2){if(_0x4c6eb1[_0x57f0('0x45')]['id']){delete _0x4c6eb1[_0x57f0('0x45')]['id'];}return db['JscriptyAnswerReport'][_0x57f0('0x43')]({'where':{'id':_0x4c6eb1[_0x57f0('0x46')]['id']}})[_0x57f0('0x20')](handleEntityNotFound(_0x22abb2,null))[_0x57f0('0x20')](saveUpdates(_0x4c6eb1[_0x57f0('0x45')],null))[_0x57f0('0x20')](respondWithResult(_0x22abb2,null))[_0x57f0('0x3f')](handleError(_0x22abb2,null));};exports[_0x57f0('0x1f')]=function(_0x7f6cf5,_0x5bdd21){return db[_0x57f0('0x26')][_0x57f0('0x43')]({'where':{'id':_0x7f6cf5['params']['id']}})[_0x57f0('0x20')](handleEntityNotFound(_0x5bdd21,null))[_0x57f0('0x20')](removeEntity(_0x5bdd21,null))['catch'](handleError(_0x5bdd21,null));};exports['describe']=function(_0x440fd8,_0x71081b){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x71081b,null))[_0x57f0('0x3f')](handleError(_0x71081b,null));}; \ No newline at end of file +var _0x86f4=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','JscriptyAnswerReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x550241,_0x423164){var _0x25619b=function(_0x2b0f6d){while(--_0x2b0f6d){_0x550241['push'](_0x550241['shift']());}};_0x25619b(++_0x423164);}(_0x86f4,0x18a));var _0x486f=function(_0x46f25a,_0x39a801){_0x46f25a=_0x46f25a-0x0;var _0x36e47c=_0x86f4[_0x46f25a];return _0x36e47c;};'use strict';var emlformat=require(_0x486f('0x0'));var rimraf=require(_0x486f('0x1'));var zipdir=require(_0x486f('0x2'));var jsonpatch=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var moment=require(_0x486f('0x5'));var BPromise=require(_0x486f('0x6'));var Mustache=require('mustache');var util=require(_0x486f('0x7'));var path=require(_0x486f('0x8'));var sox=require('sox');var csv=require(_0x486f('0x9'));var ejs=require(_0x486f('0xa'));var fs=require('fs');var fs_extra=require(_0x486f('0xb'));var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0x9'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var licenseUtil=require(_0x486f('0x1b'));var db=require(_0x486f('0x1c'))['db'];function respondWithStatusCode(_0x4312fb,_0x1c4e55){_0x1c4e55=_0x1c4e55||0xcc;return function(_0x4eb4f9){if(_0x4eb4f9){return _0x4312fb[_0x486f('0x1d')](_0x1c4e55);}return _0x4312fb['status'](_0x1c4e55)[_0x486f('0x1e')]();};}function respondWithResult(_0x2cc608,_0x1ac871){_0x1ac871=_0x1ac871||0xc8;return function(_0x50bee8){if(_0x50bee8){return _0x2cc608['status'](_0x1ac871)[_0x486f('0x1f')](_0x50bee8);}};}function respondWithFilteredResult(_0x3a4fef,_0x51334f){return function(_0x16830e){if(_0x16830e){var _0x2ab753=typeof _0x51334f[_0x486f('0x20')]==='undefined'&&typeof _0x51334f['limit']===_0x486f('0x21');var _0x3eeae0=_0x16830e[_0x486f('0x22')];var _0x39bfac=_0x2ab753?0x0:_0x51334f['offset'];var _0x59deb8=_0x2ab753?_0x16830e[_0x486f('0x22')]:_0x51334f[_0x486f('0x20')]+_0x51334f[_0x486f('0x23')];var _0x20a1f7;if(_0x59deb8>=_0x3eeae0){_0x59deb8=_0x3eeae0;_0x20a1f7=0xc8;}else{_0x20a1f7=0xce;}_0x3a4fef[_0x486f('0x24')](_0x20a1f7);return _0x3a4fef[_0x486f('0x25')](_0x486f('0x26'),_0x39bfac+'-'+_0x59deb8+'/'+_0x3eeae0)[_0x486f('0x1f')](_0x16830e);}return null;};}function patchUpdates(_0xe0b1cc){return function(_0x3d79bc){try{jsonpatch[_0x486f('0x27')](_0x3d79bc,_0xe0b1cc,!![]);}catch(_0x4ccac0){return BPromise[_0x486f('0x28')](_0x4ccac0);}return _0x3d79bc[_0x486f('0x29')]();};}function saveUpdates(_0x26a909,_0x4a0eb5){return function(_0x4d784e){if(_0x4d784e){return _0x4d784e[_0x486f('0x2a')](_0x26a909)[_0x486f('0x2b')](function(_0x16a530){return _0x16a530;});}return null;};}function removeEntity(_0x14b309,_0x351f81){return function(_0x26822b){if(_0x26822b){return _0x26822b[_0x486f('0x2c')]()[_0x486f('0x2b')](function(){_0x14b309[_0x486f('0x24')](0xcc)[_0x486f('0x1e')]();});}};}function handleEntityNotFound(_0x2e983b,_0x71a26f){return function(_0x387462){if(!_0x387462){_0x2e983b[_0x486f('0x1d')](0x194);}return _0x387462;};}function handleError(_0x8b3277,_0x30b322){_0x30b322=_0x30b322||0x1f4;return function(_0x6f1e8e){logger[_0x486f('0x2d')](_0x6f1e8e[_0x486f('0x2e')]);if(_0x6f1e8e[_0x486f('0x2f')]){delete _0x6f1e8e[_0x486f('0x2f')];}_0x8b3277[_0x486f('0x24')](_0x30b322)['send'](_0x6f1e8e);};}exports['index']=function(_0x52fb3a,_0x5b4718){var _0x173512={},_0x5c994a={},_0x2003a3={'count':0x0,'rows':[]};var _0x3ffa45=_['map'](db[_0x486f('0x30')]['rawAttributes'],function(_0x1f9dee){return{'name':_0x1f9dee[_0x486f('0x31')],'type':_0x1f9dee[_0x486f('0x32')][_0x486f('0x33')]};});_0x5c994a[_0x486f('0x34')]=_[_0x486f('0x35')](_0x3ffa45,'name');_0x5c994a[_0x486f('0x36')]=_[_0x486f('0x37')](_0x52fb3a[_0x486f('0x36')]);_0x5c994a[_0x486f('0x38')]=_[_0x486f('0x39')](_0x5c994a[_0x486f('0x34')],_0x5c994a[_0x486f('0x36')]);_0x173512[_0x486f('0x3a')]=_['intersection'](_0x5c994a[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x52fb3a['query'][_0x486f('0x3b')]));_0x173512[_0x486f('0x3a')]=_0x173512[_0x486f('0x3a')][_0x486f('0x3c')]?_0x173512[_0x486f('0x3a')]:_0x5c994a['model'];if(!_0x52fb3a[_0x486f('0x36')][_0x486f('0x3d')](_0x486f('0x3e'))){_0x173512[_0x486f('0x23')]=qs[_0x486f('0x23')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x23')]);_0x173512['offset']=qs[_0x486f('0x20')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x20')]);}_0x173512['order']=qs['sort'](_0x52fb3a[_0x486f('0x36')][_0x486f('0x3f')]);_0x173512['where']=qs[_0x486f('0x38')](_['pick'](_0x52fb3a[_0x486f('0x36')],_0x5c994a[_0x486f('0x38')]),_0x3ffa45);if(_0x52fb3a['query']['filter']){_0x173512[_0x486f('0x40')]=_[_0x486f('0x41')](_0x173512[_0x486f('0x40')],{'$or':_[_0x486f('0x35')](_0x3ffa45,function(_0xdedd85){if(_0xdedd85[_0x486f('0x32')]!==_0x486f('0x42')){var _0x1742e0={};_0x1742e0[_0xdedd85[_0x486f('0x2f')]]={'$like':'%'+_0x52fb3a[_0x486f('0x36')][_0x486f('0x43')]+'%'};return _0x1742e0;}})});}_0x173512=_[_0x486f('0x41')]({},_0x173512,_0x52fb3a[_0x486f('0x44')]);var _0x43d9be={'where':_0x173512['where']};return db[_0x486f('0x30')][_0x486f('0x22')](_0x43d9be)['then'](function(_0x12f7dc){_0x2003a3[_0x486f('0x22')]=_0x12f7dc;if(_0x52fb3a[_0x486f('0x36')][_0x486f('0x45')]){_0x173512[_0x486f('0x46')]=[{'all':!![]}];}return db[_0x486f('0x30')][_0x486f('0x47')](_0x173512);})[_0x486f('0x2b')](function(_0x3205e0){_0x2003a3['rows']=_0x3205e0;return _0x2003a3;})['then'](respondWithFilteredResult(_0x5b4718,_0x173512))[_0x486f('0x48')](handleError(_0x5b4718,null));};exports[_0x486f('0x49')]=function(_0x3cf897,_0x42ef68){var _0x2937a6={'raw':!![],'where':{'id':_0x3cf897[_0x486f('0x4a')]['id']}},_0x250979={};_0x250979[_0x486f('0x34')]=_[_0x486f('0x37')](db['JscriptyAnswerReport'][_0x486f('0x4b')]);_0x250979[_0x486f('0x36')]=_[_0x486f('0x37')](_0x3cf897[_0x486f('0x36')]);_0x250979['filters']=_[_0x486f('0x39')](_0x250979['model'],_0x250979[_0x486f('0x36')]);_0x2937a6[_0x486f('0x3a')]=_[_0x486f('0x39')](_0x250979[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x3cf897[_0x486f('0x36')]['fields']));_0x2937a6['attributes']=_0x2937a6[_0x486f('0x3a')][_0x486f('0x3c')]?_0x2937a6[_0x486f('0x3a')]:_0x250979[_0x486f('0x34')];if(_0x3cf897['query'][_0x486f('0x45')]){_0x2937a6[_0x486f('0x46')]=[{'all':!![]}];}_0x2937a6=_[_0x486f('0x41')]({},_0x2937a6,_0x3cf897['options']);return db[_0x486f('0x30')][_0x486f('0x4c')](_0x2937a6)[_0x486f('0x2b')](handleEntityNotFound(_0x42ef68,null))[_0x486f('0x2b')](respondWithResult(_0x42ef68,null))[_0x486f('0x48')](handleError(_0x42ef68,null));};exports[_0x486f('0x4d')]=function(_0xb65e98,_0x21f222){return db['JscriptyAnswerReport'][_0x486f('0x4d')](_0xb65e98['body'],{})[_0x486f('0x2b')](respondWithResult(_0x21f222,0xc9))[_0x486f('0x48')](handleError(_0x21f222,null));};exports[_0x486f('0x2a')]=function(_0x1055cf,_0x34033e){if(_0x1055cf[_0x486f('0x4e')]['id']){delete _0x1055cf['body']['id'];}return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x1055cf[_0x486f('0x4a')]['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x34033e,null))[_0x486f('0x2b')](saveUpdates(_0x1055cf[_0x486f('0x4e')],null))[_0x486f('0x2b')](respondWithResult(_0x34033e,null))[_0x486f('0x48')](handleError(_0x34033e,null));};exports[_0x486f('0x2c')]=function(_0x5cd989,_0x300de9){return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x5cd989['params']['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x300de9,null))[_0x486f('0x2b')](removeEntity(_0x300de9,null))[_0x486f('0x48')](handleError(_0x300de9,null));};exports['describe']=function(_0x195c9c,_0x372d2f){return db[_0x486f('0x30')][_0x486f('0x4f')]()['then'](respondWithResult(_0x372d2f,null))['catch'](handleError(_0x372d2f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index bf40cee..d45bb96 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 _0x4c9b=['request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4c9b,0x75));var _0xb4c9=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0x4c9b[_0x5b64a1];return _0x4b6f55;};'use strict';var _=require(_0xb4c9('0x0'));var util=require('util');var logger=require(_0xb4c9('0x1'))(_0xb4c9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb4c9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4c9('0x4'));var config=require(_0xb4c9('0x5'));var attributes=require(_0xb4c9('0x6'));module[_0xb4c9('0x7')]=function(_0x59dd41,_0xa74e4e){return _0x59dd41['define'](_0xb4c9('0x8'),attributes,{'tableName':_0xb4c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3871=['report_jscripty_answers','lodash','util','api','moment','request-promise','path','rimraf','exports','define','JscriptyAnswerReport'];(function(_0x44cfb2,_0x260eab){var _0xee945f=function(_0x4cb6f9){while(--_0x4cb6f9){_0x44cfb2['push'](_0x44cfb2['shift']());}};_0xee945f(++_0x260eab);}(_0x3871,0x9b));var _0x1387=function(_0x4b5517,_0x37c76f){_0x4b5517=_0x4b5517-0x0;var _0x5a12a5=_0x3871[_0x4b5517];return _0x5a12a5;};'use strict';var _=require(_0x1387('0x0'));var util=require(_0x1387('0x1'));var logger=require('../../config/logger')(_0x1387('0x2'));var moment=require(_0x1387('0x3'));var BPromise=require('bluebird');var rp=require(_0x1387('0x4'));var fs=require('fs');var path=require(_0x1387('0x5'));var rimraf=require(_0x1387('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x1387('0x7')]=function(_0x3a9e73,_0x1f53f9){return _0x3a9e73[_0x1387('0x8')](_0x1387('0x9'),attributes,{'tableName':_0x1387('0xa'),'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 92462e4..ab78bb2 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 _0x64d9=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x1e210d,_0x2f76bc){var _0x3929a6=function(_0x320e6f){while(--_0x320e6f){_0x1e210d['push'](_0x1e210d['shift']());}};_0x3929a6(++_0x2f76bc);}(_0x64d9,0xb2));var _0x964d=function(_0x3b7b72,_0x327e8d){_0x3b7b72=_0x3b7b72-0x0;var _0x4c7a1f=_0x64d9[_0x3b7b72];return _0x4c7a1f;};'use strict';var _=require(_0x964d('0x0'));var util=require(_0x964d('0x1'));var moment=require('moment');var BPromise=require(_0x964d('0x2'));var rs=require(_0x964d('0x3'));var fs=require('fs');var Redis=require(_0x964d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x964d('0x5'));var logger=require('../../config/logger')(_0x964d('0x6'));var config=require(_0x964d('0x7'));var jayson=require(_0x964d('0x8'));var client=jayson[_0x964d('0x9')][_0x964d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x66760a,_0x258efb,_0x43f99c){return new BPromise(function(_0x3fbbaa,_0x49926b){return client['request'](_0x66760a,_0x43f99c)[_0x964d('0xb')](function(_0xd5eafb){logger[_0x964d('0xc')](_0x964d('0xd'),_0x258efb,_0x964d('0xe'));logger['debug'](_0x964d('0xf'),_0x258efb,'request\x20sent',JSON['stringify'](_0xd5eafb));if(_0xd5eafb[_0x964d('0x10')]){if(_0xd5eafb['error'][_0x964d('0x11')]===0x1f4){logger[_0x964d('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x258efb,_0xd5eafb[_0x964d('0x10')][_0x964d('0x12')]);return _0x49926b(_0xd5eafb[_0x964d('0x10')][_0x964d('0x12')]);}logger[_0x964d('0x10')](_0x964d('0xd'),_0x258efb,_0xd5eafb[_0x964d('0x10')]['message']);return _0x3fbbaa(_0xd5eafb[_0x964d('0x10')][_0x964d('0x12')]);}else{logger[_0x964d('0xc')](_0x964d('0xd'),_0x258efb,_0x964d('0xe'));_0x3fbbaa(_0xd5eafb['result'][_0x964d('0x12')]);}})[_0x964d('0x13')](function(_0x120715){logger[_0x964d('0x10')](_0x964d('0xd'),_0x258efb,_0x120715);_0x49926b(_0x120715);});});} \ No newline at end of file +var _0x94cc=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e9895,_0x4a7a88){var _0x5be034=function(_0x32add1){while(--_0x32add1){_0x4e9895['push'](_0x4e9895['shift']());}};_0x5be034(++_0x4a7a88);}(_0x94cc,0x161));var _0xc94c=function(_0x11253d,_0x449fd5){_0x11253d=_0x11253d-0x0;var _0x203634=_0x94cc[_0x11253d];return _0x203634;};'use strict';var _=require(_0xc94c('0x0'));var util=require(_0xc94c('0x1'));var moment=require('moment');var BPromise=require(_0xc94c('0x2'));var rs=require(_0xc94c('0x3'));var fs=require('fs');var Redis=require(_0xc94c('0x4'));var db=require(_0xc94c('0x5'))['db'];var utils=require(_0xc94c('0x6'));var logger=require(_0xc94c('0x7'))(_0xc94c('0x8'));var config=require(_0xc94c('0x9'));var jayson=require(_0xc94c('0xa'));var client=jayson['client'][_0xc94c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a90e3,_0x2c8009,_0x6eacf8){return new BPromise(function(_0x4ee095,_0x54eebe){return client[_0xc94c('0xc')](_0x5a90e3,_0x6eacf8)[_0xc94c('0xd')](function(_0x203b94){logger[_0xc94c('0xe')](_0xc94c('0xf'),_0x2c8009,_0xc94c('0x10'));logger[_0xc94c('0x11')](_0xc94c('0x12'),_0x2c8009,'request\x20sent',JSON[_0xc94c('0x13')](_0x203b94));if(_0x203b94[_0xc94c('0x14')]){if(_0x203b94['error'][_0xc94c('0x15')]===0x1f4){logger[_0xc94c('0x14')](_0xc94c('0xf'),_0x2c8009,_0x203b94['error'][_0xc94c('0x16')]);return _0x54eebe(_0x203b94['error'][_0xc94c('0x16')]);}logger[_0xc94c('0x14')](_0xc94c('0xf'),_0x2c8009,_0x203b94['error'][_0xc94c('0x16')]);return _0x4ee095(_0x203b94[_0xc94c('0x14')][_0xc94c('0x16')]);}else{logger[_0xc94c('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2c8009,_0xc94c('0x10'));_0x4ee095(_0x203b94[_0xc94c('0x17')]['message']);}})[_0xc94c('0x18')](function(_0xaa815){logger[_0xc94c('0x14')](_0xc94c('0xf'),_0x2c8009,_0xaa815);_0x54eebe(_0xaa815);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9b979f7..74bd905 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 _0xd94c=['Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','clone','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xd94c,0xbb));var _0xcd94=function(_0x1f119c,_0x4c4397){_0x1f119c=_0x1f119c-0x0;var _0x3df52f=_0xd94c[_0x1f119c];return _0x3df52f;};'use strict';var multer=require(_0xcd94('0x0'));var util=require(_0xcd94('0x1'));var path=require(_0xcd94('0x2'));var timeout=require(_0xcd94('0x3'));var express=require(_0xcd94('0x4'));var router=express[_0xcd94('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcd94('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcd94('0x7'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0xcd94('0x8')](),controller[_0xcd94('0x9')]);router[_0xcd94('0xa')](_0xcd94('0xb'),auth['isAuthenticated'](),controller[_0xcd94('0xc')]);router[_0xcd94('0xa')]('/:id/sessions',auth['isAuthenticated'](),controller['getSessions']);router['get'](_0xcd94('0xd'),auth['isAuthenticated'](),controller[_0xcd94('0xe')]);router[_0xcd94('0xa')](_0xcd94('0xf'),auth['isAuthenticated'](),timeout(_0xcd94('0x10')),controller[_0xcd94('0x11')]);router[_0xcd94('0x12')]('/',auth[_0xcd94('0x8')](),controller[_0xcd94('0x13')]);router[_0xcd94('0x12')]('/:id/clone',auth['isAuthenticated'](),controller[_0xcd94('0x14')]);router['put'](_0xcd94('0xb'),auth[_0xcd94('0x8')](),controller[_0xcd94('0x15')]);router['delete'](_0xcd94('0xb'),auth['isAuthenticated'](),controller[_0xcd94('0x16')]);module[_0xcd94('0x17')]=router; \ No newline at end of file +var _0xd458=['index','/:id','show','/:id/sessions','getSessions','getAnswers','30s','getSummary','post','create','clone','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x3aa779,_0x4a18c5){var _0x2fd150=function(_0x239bb1){while(--_0x239bb1){_0x3aa779['push'](_0x3aa779['shift']());}};_0x2fd150(++_0x4a18c5);}(_0xd458,0x108));var _0x8d45=function(_0x1cc91f,_0x1f4703){_0x1cc91f=_0x1cc91f-0x0;var _0x112306=_0xd458[_0x1cc91f];return _0x112306;};'use strict';var multer=require('multer');var util=require(_0x8d45('0x0'));var path=require(_0x8d45('0x1'));var timeout=require(_0x8d45('0x2'));var express=require(_0x8d45('0x3'));var router=express[_0x8d45('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8d45('0x5'));var interaction=require(_0x8d45('0x6'));var config=require(_0x8d45('0x7'));var controller=require(_0x8d45('0x8'));router[_0x8d45('0x9')]('/',auth[_0x8d45('0xa')](),controller[_0x8d45('0xb')]);router[_0x8d45('0x9')](_0x8d45('0xc'),auth[_0x8d45('0xa')](),controller[_0x8d45('0xd')]);router[_0x8d45('0x9')](_0x8d45('0xe'),auth['isAuthenticated'](),controller[_0x8d45('0xf')]);router[_0x8d45('0x9')]('/:id/answers',auth[_0x8d45('0xa')](),controller[_0x8d45('0x10')]);router[_0x8d45('0x9')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x8d45('0x11')),controller[_0x8d45('0x12')]);router[_0x8d45('0x13')]('/',auth[_0x8d45('0xa')](),controller[_0x8d45('0x14')]);router[_0x8d45('0x13')]('/:id/clone',auth[_0x8d45('0xa')](),controller[_0x8d45('0x15')]);router['put']('/:id',auth[_0x8d45('0xa')](),controller[_0x8d45('0x16')]);router[_0x8d45('0x17')]('/:id',auth[_0x8d45('0xa')](),controller['destroy']);module[_0x8d45('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 c94d912..99be8cd 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 _0x4824=['name','TEXT','isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','exports','STRING'];(function(_0x3582ea,_0x5755d6){var _0x43a64c=function(_0xad81ac){while(--_0xad81ac){_0x3582ea['push'](_0x3582ea['shift']());}};_0x43a64c(++_0x5755d6);}(_0x4824,0xf9));var _0x4482=function(_0x585236,_0x43bb8c){_0x585236=_0x585236-0x0;var _0x55fc3d=_0x4824[_0x585236];return _0x55fc3d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4482('0x0'));var util=require('util');module[_0x4482('0x1')]={'name':{'type':Sequelize[_0x4482('0x2')],'unique':_0x4482('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x4482('0x4')]('long'),'set':function(_0x73cbb1){if(_[_0x4482('0x5')](_0x73cbb1)){this[_0x4482('0x6')](_0x4482('0x7'),JSON[_0x4482('0x8')](_0x73cbb1));}else if(_['isString'](_0x73cbb1)){this[_0x4482('0x6')](_0x4482('0x7'),_0x73cbb1);}else{this[_0x4482('0x6')](_0x4482('0x7'),util[_0x4482('0x9')](_0x4482('0xa'),this[_0x4482('0xb')]('name')||'',this['getDataValue'](_0x4482('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4482('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4482('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x41df=['name','long','isObjectLike','setDataValue','formData','format','getDataValue','description','BOOLEAN','sequelize','lodash','STRING'];(function(_0x57693f,_0x33f8b4){var _0x4b6f54=function(_0x245d5c){while(--_0x245d5c){_0x57693f['push'](_0x57693f['shift']());}};_0x4b6f54(++_0x33f8b4);}(_0x41df,0x8d));var _0xf41d=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x41df[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0xf41d('0x0'));var _=require(_0xf41d('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xf41d('0x2')],'unique':_0xf41d('0x3')},'description':{'type':Sequelize[_0xf41d('0x2')]},'formData':{'type':Sequelize['TEXT'](_0xf41d('0x4')),'set':function(_0x5c9653){if(_[_0xf41d('0x5')](_0x5c9653)){this[_0xf41d('0x6')](_0xf41d('0x7'),JSON['stringify'](_0x5c9653));}else if(_['isString'](_0x5c9653)){this[_0xf41d('0x6')](_0xf41d('0x7'),_0x5c9653);}else{this[_0xf41d('0x6')](_0xf41d('0x7'),util[_0xf41d('0x8')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xf41d('0x9')](_0xf41d('0x3'))||'',this[_0xf41d('0x9')](_0xf41d('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf41d('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf41d('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 35f5991..78f8b9f 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 _0x5a13=['apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','then','destroy','Projects','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','map','VIRTUAL','merge','options','JscriptyProject','includeAll','include','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','autoAssociation','UserProfileResource','update','getSessions','findOne','JscriptySessionReport','sort','pick','ProjectId','findAll','rows','JscriptyAnswerReport','number','fromCharCode'];(function(_0x91fbc7,_0x207e4c){var _0x32a811=function(_0x3d6a42){while(--_0x3d6a42){_0x91fbc7['push'](_0x91fbc7['shift']());}};_0x32a811(++_0x207e4c);}(_0x5a13,0x92));var _0x35a1=function(_0x467c67,_0x157c6f){_0x467c67=_0x467c67-0x0;var _0x4a100c=_0x5a13[_0x467c67];return _0x4a100c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35a1('0x0'));var zipdir=require(_0x35a1('0x1'));var jsonpatch=require(_0x35a1('0x2'));var rp=require(_0x35a1('0x3'));var moment=require(_0x35a1('0x4'));var BPromise=require(_0x35a1('0x5'));var Mustache=require('mustache');var util=require(_0x35a1('0x6'));var path=require('path');var sox=require(_0x35a1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35a1('0x8'));var squel=require(_0x35a1('0x9'));var crypto=require(_0x35a1('0xa'));var jsforce=require(_0x35a1('0xb'));var deskjs=require(_0x35a1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x35a1('0xd'));var Papa=require(_0x35a1('0xe'));var Redis=require(_0x35a1('0xf'));var authService=require(_0x35a1('0x10'));var qs=require(_0x35a1('0x11'));var as=require(_0x35a1('0x12'));var hardwareService=require(_0x35a1('0x13'));var logger=require(_0x35a1('0x14'))(_0x35a1('0x15'));var utils=require('../../config/utils');var config=require(_0x35a1('0x16'));var licenseUtil=require(_0x35a1('0x17'));var db=require(_0x35a1('0x18'))['db'];function respondWithStatusCode(_0x398b62,_0x2c5ba0){_0x2c5ba0=_0x2c5ba0||0xcc;return function(_0x48212d){if(_0x48212d){return _0x398b62[_0x35a1('0x19')](_0x2c5ba0);}return _0x398b62['status'](_0x2c5ba0)[_0x35a1('0x1a')]();};}function respondWithResult(_0x360a5e,_0x51c277){_0x51c277=_0x51c277||0xc8;return function(_0x1ddfb9){if(_0x1ddfb9){return _0x360a5e[_0x35a1('0x1b')](_0x51c277)[_0x35a1('0x1c')](_0x1ddfb9);}};}function respondWithFilteredResult(_0x440481,_0x4faa68){return function(_0xac42ac){if(_0xac42ac){var _0x156a6a=typeof _0x4faa68[_0x35a1('0x1d')]===_0x35a1('0x1e')&&typeof _0x4faa68['limit']===_0x35a1('0x1e');var _0xaa8549=_0xac42ac['count'];var _0x274954=_0x156a6a?0x0:_0x4faa68[_0x35a1('0x1d')];var _0x4e477a=_0x156a6a?_0xac42ac[_0x35a1('0x1f')]:_0x4faa68[_0x35a1('0x1d')]+_0x4faa68[_0x35a1('0x20')];var _0x3931bb;if(_0x4e477a>=_0xaa8549){_0x4e477a=_0xaa8549;_0x3931bb=0xc8;}else{_0x3931bb=0xce;}_0x440481[_0x35a1('0x1b')](_0x3931bb);return _0x440481['set'](_0x35a1('0x21'),_0x274954+'-'+_0x4e477a+'/'+_0xaa8549)[_0x35a1('0x1c')](_0xac42ac);}return null;};}function patchUpdates(_0x4b978e){return function(_0x50f6d1){try{jsonpatch['apply'](_0x50f6d1,_0x4b978e,!![]);}catch(_0x5f557b){return BPromise[_0x35a1('0x22')](_0x5f557b);}return _0x50f6d1['save']();};}function saveUpdates(_0x3e24a3,_0x240565){return function(_0x151e40){if(_0x151e40){return _0x151e40['update'](_0x3e24a3)[_0x35a1('0x23')](function(_0x5eef97){return _0x5eef97;});}return null;};}function removeEntity(_0x228d72,_0x31272b){return function(_0x11aa01){if(_0x11aa01){return _0x11aa01[_0x35a1('0x24')]()[_0x35a1('0x23')](function(){var _0x37c947=_0x11aa01['get']({'plain':!![]});var _0x269a49=_0x35a1('0x25');return db['UserProfileResource'][_0x35a1('0x24')]({'where':{'type':_0x269a49,'resourceId':_0x37c947['id']}})[_0x35a1('0x23')](function(){return _0x11aa01;});})['then'](function(){_0x228d72[_0x35a1('0x1b')](0xcc)[_0x35a1('0x1a')]();});}};}function handleEntityNotFound(_0x346d2e,_0xd28d1e){return function(_0x4410fd){if(!_0x4410fd){_0x346d2e[_0x35a1('0x19')](0x194);}return _0x4410fd;};}function handleError(_0x3bb6c0,_0x303665){_0x303665=_0x303665||0x1f4;return function(_0x5f9764){logger['error'](_0x5f9764[_0x35a1('0x26')]);if(_0x5f9764[_0x35a1('0x27')]){delete _0x5f9764['name'];}_0x3bb6c0['status'](_0x303665)[_0x35a1('0x28')](_0x5f9764);};}exports[_0x35a1('0x29')]=function(_0x3b1a9a,_0x2672c6){var _0x199990={},_0x19be3d={},_0x2d6327={'count':0x0,'rows':[]};var _0x43e977=_['map'](db['JscriptyProject'][_0x35a1('0x2a')],function(_0xc671ca){return{'name':_0xc671ca[_0x35a1('0x2b')],'type':_0xc671ca[_0x35a1('0x2c')]['key']};});_0x19be3d[_0x35a1('0x2d')]=_['map'](_0x43e977,'name');_0x19be3d[_0x35a1('0x2e')]=_[_0x35a1('0x2f')](_0x3b1a9a[_0x35a1('0x2e')]);_0x19be3d['filters']=_[_0x35a1('0x30')](_0x19be3d[_0x35a1('0x2d')],_0x19be3d[_0x35a1('0x2e')]);_0x199990[_0x35a1('0x31')]=_[_0x35a1('0x30')](_0x19be3d[_0x35a1('0x2d')],qs[_0x35a1('0x32')](_0x3b1a9a[_0x35a1('0x2e')][_0x35a1('0x32')]));_0x199990['attributes']=_0x199990[_0x35a1('0x31')][_0x35a1('0x33')]?_0x199990[_0x35a1('0x31')]:_0x19be3d[_0x35a1('0x2d')];if(!_0x3b1a9a[_0x35a1('0x2e')][_0x35a1('0x34')](_0x35a1('0x35'))){_0x199990[_0x35a1('0x20')]=qs[_0x35a1('0x20')](_0x3b1a9a['query'][_0x35a1('0x20')]);_0x199990['offset']=qs[_0x35a1('0x1d')](_0x3b1a9a[_0x35a1('0x2e')][_0x35a1('0x1d')]);}_0x199990[_0x35a1('0x36')]=qs['sort'](_0x3b1a9a[_0x35a1('0x2e')]['sort']);_0x199990[_0x35a1('0x37')]=qs[_0x35a1('0x38')](_['pick'](_0x3b1a9a[_0x35a1('0x2e')],_0x19be3d['filters']),_0x43e977);if(_0x3b1a9a[_0x35a1('0x2e')][_0x35a1('0x39')]){_0x199990['where']=_['merge'](_0x199990['where'],{'$or':_[_0x35a1('0x3a')](_0x43e977,function(_0xdfd61d){if(_0xdfd61d[_0x35a1('0x2c')]!==_0x35a1('0x3b')){var _0x57efd2={};_0x57efd2[_0xdfd61d[_0x35a1('0x27')]]={'$like':'%'+_0x3b1a9a['query'][_0x35a1('0x39')]+'%'};return _0x57efd2;}})});}_0x199990=_[_0x35a1('0x3c')]({},_0x199990,_0x3b1a9a[_0x35a1('0x3d')]);var _0x22bdd1={'where':_0x199990[_0x35a1('0x37')]};return db[_0x35a1('0x3e')]['count'](_0x22bdd1)[_0x35a1('0x23')](function(_0xbdbaf4){_0x2d6327['count']=_0xbdbaf4;if(_0x3b1a9a[_0x35a1('0x2e')][_0x35a1('0x3f')]){_0x199990[_0x35a1('0x40')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x199990);})[_0x35a1('0x23')](function(_0x56f134){_0x2d6327['rows']=_0x56f134;return _0x2d6327;})[_0x35a1('0x23')](respondWithFilteredResult(_0x2672c6,_0x199990))[_0x35a1('0x41')](handleError(_0x2672c6,null));};exports[_0x35a1('0x42')]=function(_0x1ed5df,_0x330f2e){var _0x576db7={'raw':![],'where':{'id':_0x1ed5df[_0x35a1('0x43')]['id']}},_0x11ce01={};_0x11ce01[_0x35a1('0x2d')]=_[_0x35a1('0x2f')](db[_0x35a1('0x3e')][_0x35a1('0x2a')]);_0x11ce01[_0x35a1('0x2e')]=_[_0x35a1('0x2f')](_0x1ed5df[_0x35a1('0x2e')]);_0x11ce01['filters']=_[_0x35a1('0x30')](_0x11ce01[_0x35a1('0x2d')],_0x11ce01[_0x35a1('0x2e')]);_0x576db7['attributes']=_[_0x35a1('0x30')](_0x11ce01['model'],qs[_0x35a1('0x32')](_0x1ed5df['query'][_0x35a1('0x32')]));_0x576db7[_0x35a1('0x31')]=_0x576db7[_0x35a1('0x31')][_0x35a1('0x33')]?_0x576db7[_0x35a1('0x31')]:_0x11ce01[_0x35a1('0x2d')];if(_0x1ed5df[_0x35a1('0x2e')][_0x35a1('0x3f')]){_0x576db7[_0x35a1('0x40')]=[{'all':!![]}];}_0x576db7=_[_0x35a1('0x3c')]({},_0x576db7,_0x1ed5df[_0x35a1('0x3d')]);return db[_0x35a1('0x3e')]['find'](_0x576db7)[_0x35a1('0x23')](handleEntityNotFound(_0x330f2e,null))[_0x35a1('0x23')](respondWithResult(_0x330f2e,null))[_0x35a1('0x41')](handleError(_0x330f2e,null));};exports[_0x35a1('0x44')]=function(_0x41801b,_0x218179){return db['JscriptyProject'][_0x35a1('0x44')](_0x41801b[_0x35a1('0x45')],{})[_0x35a1('0x23')](function(_0x193727){var _0x2e120f=_0x41801b[_0x35a1('0x46')][_0x35a1('0x47')]({'plain':!![]});if(!_0x2e120f)throw new Error(_0x35a1('0x48'));if(_0x2e120f[_0x35a1('0x49')]===_0x35a1('0x46')){var _0x5c61a3=_0x193727[_0x35a1('0x47')]({'plain':!![]});var _0x324cc4=_0x35a1('0x25');return db[_0x35a1('0x4a')][_0x35a1('0x4b')]({'where':{'name':_0x324cc4,'userProfileId':_0x2e120f[_0x35a1('0x4c')]},'raw':!![]})[_0x35a1('0x23')](function(_0x581b4a){if(_0x581b4a&&_0x581b4a['autoAssociation']===0x0){return db['UserProfileResource'][_0x35a1('0x44')]({'name':_0x5c61a3[_0x35a1('0x27')],'resourceId':_0x5c61a3['id'],'type':_0x581b4a[_0x35a1('0x27')],'sectionId':_0x581b4a['id']},{})[_0x35a1('0x23')](function(){return _0x193727;});}else{return _0x193727;}})[_0x35a1('0x41')](function(_0x25dead){logger[_0x35a1('0x4d')](_0x35a1('0x4e'),_0x25dead);throw _0x25dead;});}return _0x193727;})['then'](respondWithResult(_0x218179,0xc9))[_0x35a1('0x41')](handleError(_0x218179,null));};exports[_0x35a1('0x4f')]=function(_0x5d7185,_0x30f4fd){var _0x7b635e={'where':{'id':_0x5d7185[_0x35a1('0x43')]['id']}},_0x4f6bfe={};_0x4f6bfe[_0x35a1('0x2d')]=_[_0x35a1('0x2f')](db[_0x35a1('0x3e')][_0x35a1('0x2a')]);_0x7b635e[_0x35a1('0x31')]=_[_0x35a1('0x30')](_0x4f6bfe[_0x35a1('0x2d')],qs[_0x35a1('0x32')](_0x5d7185[_0x35a1('0x2e')][_0x35a1('0x32')]));_0x7b635e[_0x35a1('0x31')]=_0x7b635e[_0x35a1('0x31')]['length']?_0x7b635e[_0x35a1('0x31')]:_0x4f6bfe[_0x35a1('0x2d')];if(_0x5d7185[_0x35a1('0x2e')][_0x35a1('0x3f')]){_0x7b635e[_0x35a1('0x40')]=[{'all':!![]}];}_0x7b635e=_[_0x35a1('0x3c')]({},_0x7b635e,_0x5d7185[_0x35a1('0x3d')]);return db[_0x35a1('0x3e')][_0x35a1('0x4b')](_0x7b635e)[_0x35a1('0x23')](handleEntityNotFound(_0x30f4fd,null))['then'](function(_0x2045e9){if(_0x2045e9){var _0x19f39c=_0x2045e9[_0x35a1('0x47')]({'plain':!![]});_0x19f39c=qs[_0x35a1('0x50')](_0x19f39c,['id',_0x35a1('0x51'),'updatedAt']);_0x5d7185[_0x35a1('0x45')]=_[_0x35a1('0x50')](_0x5d7185[_0x35a1('0x45')],['id',_0x35a1('0x51'),'updatedAt']);return db[_0x35a1('0x3e')][_0x35a1('0x44')](_[_0x35a1('0x3c')](_0x19f39c,_0x5d7185[_0x35a1('0x45')]),{'include':_0x5d7185[_0x35a1('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x35a1('0x23')](function(_0x4a8670){var _0x208bc7=_0x5d7185['user'][_0x35a1('0x47')]({'plain':!![]});if(!_0x208bc7)throw new Error(_0x35a1('0x48'));if(_0x208bc7[_0x35a1('0x49')]===_0x35a1('0x46')){var _0x10e917=_0x4a8670['get']({'plain':!![]});var _0x42f2b8='Projects';return db[_0x35a1('0x4a')][_0x35a1('0x4b')]({'where':{'name':_0x42f2b8,'userProfileId':_0x208bc7['userProfileId']},'raw':!![]})['then'](function(_0x54d160){if(_0x54d160&&_0x54d160[_0x35a1('0x52')]===0x0){return db[_0x35a1('0x53')][_0x35a1('0x44')]({'name':_0x10e917['name'],'resourceId':_0x10e917['id'],'type':_0x54d160[_0x35a1('0x27')],'sectionId':_0x54d160['id']},{})[_0x35a1('0x23')](function(){return _0x4a8670;});}else{return _0x4a8670;}})[_0x35a1('0x41')](function(_0x5d18d7){logger[_0x35a1('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d18d7);throw _0x5d18d7;});}return _0x4a8670;});}})[_0x35a1('0x23')](respondWithResult(_0x30f4fd,0xc9))['catch'](handleError(_0x30f4fd,null));};exports[_0x35a1('0x54')]=function(_0x5528cc,_0x1a3310){if(_0x5528cc[_0x35a1('0x45')]['id']){delete _0x5528cc[_0x35a1('0x45')]['id'];}return db[_0x35a1('0x3e')][_0x35a1('0x4b')]({'where':{'id':_0x5528cc['params']['id']}})[_0x35a1('0x23')](handleEntityNotFound(_0x1a3310,null))['then'](saveUpdates(_0x5528cc[_0x35a1('0x45')],null))['then'](respondWithResult(_0x1a3310,null))['catch'](handleError(_0x1a3310,null));};exports['destroy']=function(_0x44c0d5,_0x4d5ae0){return db[_0x35a1('0x3e')][_0x35a1('0x4b')]({'where':{'id':_0x44c0d5['params']['id']}})['then'](handleEntityNotFound(_0x4d5ae0,null))['then'](removeEntity(_0x4d5ae0,null))[_0x35a1('0x41')](handleError(_0x4d5ae0,null));};exports[_0x35a1('0x55')]=function(_0x271c15,_0x1eb17f,_0x1740f9){var _0x579176={'raw':!![],'where':{}};var _0x26b3f9={};var _0x1ee35b={'count':0x0,'rows':[]};return db[_0x35a1('0x3e')][_0x35a1('0x56')]({'where':{'id':_0x271c15[_0x35a1('0x43')]['id']}})['then'](handleEntityNotFound(_0x1eb17f,null))[_0x35a1('0x23')](function(_0x14dde6){if(_0x14dde6){_0x26b3f9[_0x35a1('0x2d')]=_[_0x35a1('0x2f')](db[_0x35a1('0x57')][_0x35a1('0x2a')]);_0x26b3f9[_0x35a1('0x2e')]=_[_0x35a1('0x2f')](_0x271c15[_0x35a1('0x2e')]);_0x26b3f9[_0x35a1('0x38')]=_['intersection'](_0x26b3f9[_0x35a1('0x2d')],_0x26b3f9[_0x35a1('0x2e')]);_0x579176[_0x35a1('0x31')]=_[_0x35a1('0x30')](_0x26b3f9['model'],qs[_0x35a1('0x32')](_0x271c15[_0x35a1('0x2e')][_0x35a1('0x32')]));_0x579176['attributes']=_0x579176[_0x35a1('0x31')][_0x35a1('0x33')]?_0x579176[_0x35a1('0x31')]:_0x26b3f9['model'];if(!_0x271c15['query'][_0x35a1('0x34')](_0x35a1('0x35'))){_0x579176['limit']=qs['limit'](_0x271c15[_0x35a1('0x2e')]['limit']);_0x579176[_0x35a1('0x1d')]=qs[_0x35a1('0x1d')](_0x271c15[_0x35a1('0x2e')][_0x35a1('0x1d')]);}_0x579176['order']=qs[_0x35a1('0x58')](_0x271c15['query']['sort']);_0x579176[_0x35a1('0x37')]=qs[_0x35a1('0x38')](_[_0x35a1('0x59')](_0x271c15['query'],_0x26b3f9[_0x35a1('0x38')]));_0x579176[_0x35a1('0x37')][_0x35a1('0x5a')]=_0x14dde6['id'];if(_0x271c15[_0x35a1('0x2e')][_0x35a1('0x39')]){_0x579176[_0x35a1('0x37')]=_[_0x35a1('0x3c')](_0x579176[_0x35a1('0x37')],{'$or':_[_0x35a1('0x3a')](_0x579176[_0x35a1('0x31')],function(_0x40ada6){var _0x4ba83a={};_0x4ba83a[_0x40ada6]={'$like':'%'+_0x271c15[_0x35a1('0x2e')][_0x35a1('0x39')]+'%'};return _0x4ba83a;})});}_0x579176=_[_0x35a1('0x3c')]({},_0x579176,_0x271c15['options']);return db[_0x35a1('0x57')]['count']({'where':_0x579176[_0x35a1('0x37')]})[_0x35a1('0x23')](function(_0x155032){_0x1ee35b[_0x35a1('0x1f')]=_0x155032;if(_0x271c15[_0x35a1('0x2e')][_0x35a1('0x3f')]){_0x579176['include']=[{'all':!![]}];}return db[_0x35a1('0x57')][_0x35a1('0x5b')](_0x579176);})[_0x35a1('0x23')](function(_0x28aa99){_0x1ee35b[_0x35a1('0x5c')]=_0x28aa99;return _0x1ee35b;});}})['then'](respondWithFilteredResult(_0x1eb17f,_0x579176))[_0x35a1('0x41')](handleError(_0x1eb17f,null));};exports['getAnswers']=function(_0x3aa536,_0x5b1705,_0x5df223){var _0x4d0fe0={'raw':!![],'where':{}};var _0x2d9484={};var _0x217a78={'count':0x0,'rows':[]};return db[_0x35a1('0x3e')][_0x35a1('0x56')]({'where':{'id':_0x3aa536[_0x35a1('0x43')]['id']}})[_0x35a1('0x23')](handleEntityNotFound(_0x5b1705,null))[_0x35a1('0x23')](function(_0x2c9a74){if(_0x2c9a74){_0x2d9484[_0x35a1('0x2d')]=_['keys'](db[_0x35a1('0x5d')][_0x35a1('0x2a')]);_0x2d9484[_0x35a1('0x2e')]=_[_0x35a1('0x2f')](_0x3aa536[_0x35a1('0x2e')]);_0x2d9484[_0x35a1('0x38')]=_[_0x35a1('0x30')](_0x2d9484[_0x35a1('0x2d')],_0x2d9484[_0x35a1('0x2e')]);_0x4d0fe0[_0x35a1('0x31')]=_[_0x35a1('0x30')](_0x2d9484['model'],qs[_0x35a1('0x32')](_0x3aa536[_0x35a1('0x2e')][_0x35a1('0x32')]));_0x4d0fe0[_0x35a1('0x31')]=_0x4d0fe0[_0x35a1('0x31')][_0x35a1('0x33')]?_0x4d0fe0[_0x35a1('0x31')]:_0x2d9484[_0x35a1('0x2d')];if(!_0x3aa536[_0x35a1('0x2e')][_0x35a1('0x34')](_0x35a1('0x35'))){_0x4d0fe0[_0x35a1('0x20')]=qs[_0x35a1('0x20')](_0x3aa536[_0x35a1('0x2e')][_0x35a1('0x20')]);_0x4d0fe0[_0x35a1('0x1d')]=qs[_0x35a1('0x1d')](_0x3aa536[_0x35a1('0x2e')][_0x35a1('0x1d')]);}_0x4d0fe0[_0x35a1('0x36')]=qs[_0x35a1('0x58')](_0x3aa536[_0x35a1('0x2e')]['sort']);_0x4d0fe0[_0x35a1('0x37')]=qs['filters'](_[_0x35a1('0x59')](_0x3aa536[_0x35a1('0x2e')],_0x2d9484[_0x35a1('0x38')]));_0x4d0fe0[_0x35a1('0x37')]['ProjectId']=_0x2c9a74['id'];if(_0x3aa536['query'][_0x35a1('0x39')]){_0x4d0fe0[_0x35a1('0x37')]=_[_0x35a1('0x3c')](_0x4d0fe0[_0x35a1('0x37')],{'$or':_[_0x35a1('0x3a')](_0x4d0fe0[_0x35a1('0x31')],function(_0x23685c){var _0x2a109a={};_0x2a109a[_0x23685c]={'$like':'%'+_0x3aa536[_0x35a1('0x2e')]['filter']+'%'};return _0x2a109a;})});}_0x4d0fe0=_['merge']({},_0x4d0fe0,_0x3aa536[_0x35a1('0x3d')]);return db['JscriptyAnswerReport'][_0x35a1('0x1f')]({'where':_0x4d0fe0[_0x35a1('0x37')]})[_0x35a1('0x23')](function(_0x46b6c4){_0x217a78['count']=_0x46b6c4;if(_0x3aa536[_0x35a1('0x2e')][_0x35a1('0x3f')]){_0x4d0fe0['include']=[{'all':!![]}];}return db[_0x35a1('0x5d')][_0x35a1('0x5b')](_0x4d0fe0);})['then'](function(_0x1a2fac){_0x217a78[_0x35a1('0x5c')]=_0x1a2fac;return _0x217a78;});}})[_0x35a1('0x23')](respondWithFilteredResult(_0x5b1705,_0x4d0fe0))['catch'](handleError(_0x5b1705,null));};function char(_0x3c4c13){return _0x35a1('0x5e')===typeof _0x3c4c13?String[_0x35a1('0x5f')][_0x35a1('0x60')](null,arguments):_0x3c4c13;}function needsEncapsulation(_0x3b8e0e){return!!_0x3b8e0e&&(_0x3b8e0e[_0x35a1('0x61')]()[_0x35a1('0x62')](char(0xd))>=0x0||_0x3b8e0e[_0x35a1('0x61')]()['indexOf'](char(0xa))>=0x0||_0x3b8e0e['toString']()[_0x35a1('0x62')](char(0x2c))>=0x0||_0x3b8e0e[_0x35a1('0x61')]()[_0x35a1('0x62')](char(0x22))>=0x0);}function encapsulate(_0x15099f){var _0x39b8e5=char(0x22),_0x45fe2b='\x5c'+char(0x22),_0xcdc473=_0x15099f[_0x35a1('0x61')]()[_0x35a1('0x63')](new RegExp(_0x39b8e5,'g'),_0x45fe2b);return _0x39b8e5+_0xcdc473+_0x39b8e5;}exports[_0x35a1('0x64')]=function(_0x1f39b5,_0x27d43d,_0x3c5fcd){var _0xb2e3a8,_0x1425b8;var _0x1129ea={'where':{'ProjectId':_0x1f39b5[_0x35a1('0x43')]['id']}};if(_0x1f39b5['query'][_0x35a1('0x65')]){_0x1129ea[_0x35a1('0x37')]['starttime']=JSON[_0x35a1('0x66')](_0x1f39b5[_0x35a1('0x2e')][_0x35a1('0x65')]);}return db[_0x35a1('0x57')][_0x35a1('0x5b')](_0x1129ea)['then'](handleEntityNotFound(_0x27d43d,null))[_0x35a1('0x23')](function(_0x258914){if(_0x258914){_0xb2e3a8=_0x258914;return db[_0x35a1('0x67')]['findAll']({'where':{'SessionId':{'$in':_[_0x35a1('0x3a')](_0xb2e3a8,'id')},'ProjectId':_0x1f39b5[_0x35a1('0x43')]['id']},'order':_0x35a1('0x68')});}})[_0x35a1('0x23')](handleEntityNotFound(_0x27d43d,null))[_0x35a1('0x23')](function(_0x3813d0){if(_0x3813d0){_0x1425b8=_0x3813d0;var _0x546e32={};for(var _0x373385=0x0,_0x1fc282=_0x1425b8[_0x35a1('0x33')];_0x373385<_0x1fc282;_0x373385++){if(!_0x546e32[_0x35a1('0x34')](_0x1425b8[_0x373385]['questionId'])){_0x546e32[_0x1425b8[_0x373385][_0x35a1('0x69')]]=needsEncapsulation(_0x1425b8[_0x373385][_0x35a1('0x6a')])?encapsulate(_0x1425b8[_0x373385][_0x35a1('0x6a')]):_0x1425b8[_0x373385][_0x35a1('0x6a')];}}var _0x42ee1c=[],_0x429ea8={};for(var _0x24367f=0x0,_0x564cc3=_0xb2e3a8[_0x35a1('0x33')];_0x24367f<_0x564cc3;_0x24367f++){_0x429ea8={'ProjectId':_0x1f39b5[_0x35a1('0x43')]['id'],'SessionId':_0xb2e3a8[_0x24367f]['id'],'StartTime':moment(_0xb2e3a8[_0x24367f][_0x35a1('0x6b')])[_0x35a1('0x6c')](_0x35a1('0x6d'))};for(var _0x408247=0x0,_0x117ca4=_0x1425b8['length'];_0x408247<_0x117ca4;_0x408247++){if(_0x1425b8[_0x408247]['SessionId']==_0xb2e3a8[_0x24367f]['id']&&_0x546e32['hasOwnProperty'](_0x1425b8[_0x408247][_0x35a1('0x69')])){_0x429ea8[_0x546e32[_0x1425b8[_0x408247][_0x35a1('0x69')]]]=_0x1425b8[_0x408247][_0x35a1('0x6e')];}}for(var _0x2ad397 in _0x546e32){if(!_0x429ea8[_0x35a1('0x34')](_0x546e32[_0x2ad397])){_0x429ea8[_0x546e32[_0x2ad397]]=null;}}_0x42ee1c['push'](_0x429ea8);}return _0x42ee1c;}})['then'](function(_0x50e1d8){if(!_[_0x35a1('0x6f')](_0x50e1d8)){var _0x5a5d51=toCsv(_0x50e1d8);var _0x49ee88=Date[_0x35a1('0x70')]();fs[_0x35a1('0x71')](util[_0x35a1('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1f39b5['params']['id'],_0x49ee88),_0x5a5d51);_0x27d43d[_0x35a1('0x72')](_0x35a1('0x73'),_0x35a1('0x74')+util[_0x35a1('0x6c')](_0x35a1('0x75'),_0x1f39b5[_0x35a1('0x43')]['id'],_0x49ee88));_0x27d43d[_0x35a1('0x72')](_0x35a1('0x76'),_0x35a1('0x77'));return _0x27d43d[_0x35a1('0x78')](util[_0x35a1('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1f39b5[_0x35a1('0x43')]['id'],_0x49ee88));}else{return _0x27d43d['sendStatus'](0xcc);}})[_0x35a1('0x41')](handleError(_0x27d43d,null));}; \ No newline at end of file +var _0x3c32=['sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','Projects','UserProfileResource','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','JscriptyProject','includeAll','include','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','omit','updatedAt','get','role','userProfileId','autoAssociation','nolimit','getAnswers','findOne','JscriptyAnswerReport','ProjectId','findAll','number','apply','toString','indexOf','getSummary','startTime','starttime','parse','JscriptySessionReport','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util'];(function(_0x149156,_0x11375e){var _0x2e189b=function(_0x321074){while(--_0x321074){_0x149156['push'](_0x149156['shift']());}};_0x2e189b(++_0x11375e);}(_0x3c32,0x161));var _0x23c3=function(_0x571922,_0x2cee98){_0x571922=_0x571922-0x0;var _0x2c98ac=_0x3c32[_0x571922];return _0x2c98ac;};'use strict';var emlformat=require(_0x23c3('0x0'));var rimraf=require(_0x23c3('0x1'));var zipdir=require(_0x23c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23c3('0x3'));var moment=require(_0x23c3('0x4'));var BPromise=require(_0x23c3('0x5'));var Mustache=require('mustache');var util=require(_0x23c3('0x6'));var path=require('path');var sox=require(_0x23c3('0x7'));var csv=require(_0x23c3('0x8'));var ejs=require(_0x23c3('0x9'));var fs=require('fs');var fs_extra=require(_0x23c3('0xa'));var _=require(_0x23c3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x23c3('0xc'));var toCsv=require(_0x23c3('0x8'));var querystring=require(_0x23c3('0xd'));var Papa=require(_0x23c3('0xe'));var Redis=require(_0x23c3('0xf'));var authService=require(_0x23c3('0x10'));var qs=require(_0x23c3('0x11'));var as=require(_0x23c3('0x12'));var hardwareService=require(_0x23c3('0x13'));var logger=require(_0x23c3('0x14'))(_0x23c3('0x15'));var utils=require(_0x23c3('0x16'));var config=require(_0x23c3('0x17'));var licenseUtil=require(_0x23c3('0x18'));var db=require(_0x23c3('0x19'))['db'];function respondWithStatusCode(_0x155ed0,_0x3896ba){_0x3896ba=_0x3896ba||0xcc;return function(_0x28bfbb){if(_0x28bfbb){return _0x155ed0[_0x23c3('0x1a')](_0x3896ba);}return _0x155ed0[_0x23c3('0x1b')](_0x3896ba)['end']();};}function respondWithResult(_0x5caabd,_0x22a034){_0x22a034=_0x22a034||0xc8;return function(_0x38a11a){if(_0x38a11a){return _0x5caabd[_0x23c3('0x1b')](_0x22a034)[_0x23c3('0x1c')](_0x38a11a);}};}function respondWithFilteredResult(_0x3cd6db,_0x31ebaa){return function(_0x16b80c){if(_0x16b80c){var _0x51e880=typeof _0x31ebaa['offset']===_0x23c3('0x1d')&&typeof _0x31ebaa[_0x23c3('0x1e')]==='undefined';var _0x4737e4=_0x16b80c[_0x23c3('0x1f')];var _0x20a8b7=_0x51e880?0x0:_0x31ebaa[_0x23c3('0x20')];var _0x25880d=_0x51e880?_0x16b80c[_0x23c3('0x1f')]:_0x31ebaa['offset']+_0x31ebaa[_0x23c3('0x1e')];var _0x4742be;if(_0x25880d>=_0x4737e4){_0x25880d=_0x4737e4;_0x4742be=0xc8;}else{_0x4742be=0xce;}_0x3cd6db[_0x23c3('0x1b')](_0x4742be);return _0x3cd6db['set'](_0x23c3('0x21'),_0x20a8b7+'-'+_0x25880d+'/'+_0x4737e4)['json'](_0x16b80c);}return null;};}function patchUpdates(_0x4c8369){return function(_0x338d5a){try{jsonpatch['apply'](_0x338d5a,_0x4c8369,!![]);}catch(_0x5719d3){return BPromise[_0x23c3('0x22')](_0x5719d3);}return _0x338d5a[_0x23c3('0x23')]();};}function saveUpdates(_0x452f34,_0x381aee){return function(_0x5c5993){if(_0x5c5993){return _0x5c5993[_0x23c3('0x24')](_0x452f34)['then'](function(_0xc287a5){return _0xc287a5;});}return null;};}function removeEntity(_0x238d27,_0x30fe87){return function(_0x1210a4){if(_0x1210a4){return _0x1210a4['destroy']()[_0x23c3('0x25')](function(){var _0xc061da=_0x1210a4['get']({'plain':!![]});var _0x24fabd=_0x23c3('0x26');return db[_0x23c3('0x27')][_0x23c3('0x28')]({'where':{'type':_0x24fabd,'resourceId':_0xc061da['id']}})[_0x23c3('0x25')](function(){return _0x1210a4;});})['then'](function(){_0x238d27[_0x23c3('0x1b')](0xcc)[_0x23c3('0x29')]();});}};}function handleEntityNotFound(_0x2c3a6a,_0x1c958a){return function(_0xa520fc){if(!_0xa520fc){_0x2c3a6a[_0x23c3('0x1a')](0x194);}return _0xa520fc;};}function handleError(_0x237c7d,_0x2a1b2c){_0x2a1b2c=_0x2a1b2c||0x1f4;return function(_0x856e72){logger[_0x23c3('0x2a')](_0x856e72[_0x23c3('0x2b')]);if(_0x856e72[_0x23c3('0x2c')]){delete _0x856e72[_0x23c3('0x2c')];}_0x237c7d[_0x23c3('0x1b')](_0x2a1b2c)[_0x23c3('0x2d')](_0x856e72);};}exports[_0x23c3('0x2e')]=function(_0x1ad0ea,_0x28af56){var _0x12b8be={},_0xd732d7={},_0x1bc3ce={'count':0x0,'rows':[]};var _0x47abc5=_['map'](db['JscriptyProject'][_0x23c3('0x2f')],function(_0x5e117f){return{'name':_0x5e117f[_0x23c3('0x30')],'type':_0x5e117f['type'][_0x23c3('0x31')]};});_0xd732d7[_0x23c3('0x32')]=_[_0x23c3('0x33')](_0x47abc5,_0x23c3('0x2c'));_0xd732d7[_0x23c3('0x34')]=_[_0x23c3('0x35')](_0x1ad0ea[_0x23c3('0x34')]);_0xd732d7['filters']=_[_0x23c3('0x36')](_0xd732d7['model'],_0xd732d7[_0x23c3('0x34')]);_0x12b8be[_0x23c3('0x37')]=_['intersection'](_0xd732d7['model'],qs['fields'](_0x1ad0ea[_0x23c3('0x34')][_0x23c3('0x38')]));_0x12b8be[_0x23c3('0x37')]=_0x12b8be['attributes'][_0x23c3('0x39')]?_0x12b8be[_0x23c3('0x37')]:_0xd732d7[_0x23c3('0x32')];if(!_0x1ad0ea[_0x23c3('0x34')][_0x23c3('0x3a')]('nolimit')){_0x12b8be[_0x23c3('0x1e')]=qs[_0x23c3('0x1e')](_0x1ad0ea[_0x23c3('0x34')]['limit']);_0x12b8be['offset']=qs[_0x23c3('0x20')](_0x1ad0ea[_0x23c3('0x34')][_0x23c3('0x20')]);}_0x12b8be[_0x23c3('0x3b')]=qs['sort'](_0x1ad0ea[_0x23c3('0x34')][_0x23c3('0x3c')]);_0x12b8be[_0x23c3('0x3d')]=qs[_0x23c3('0x3e')](_[_0x23c3('0x3f')](_0x1ad0ea[_0x23c3('0x34')],_0xd732d7['filters']),_0x47abc5);if(_0x1ad0ea['query'][_0x23c3('0x40')]){_0x12b8be['where']=_[_0x23c3('0x41')](_0x12b8be[_0x23c3('0x3d')],{'$or':_[_0x23c3('0x33')](_0x47abc5,function(_0xb46bc){if(_0xb46bc[_0x23c3('0x42')]!==_0x23c3('0x43')){var _0x3dbdc0={};_0x3dbdc0[_0xb46bc[_0x23c3('0x2c')]]={'$like':'%'+_0x1ad0ea[_0x23c3('0x34')][_0x23c3('0x40')]+'%'};return _0x3dbdc0;}})});}_0x12b8be=_[_0x23c3('0x41')]({},_0x12b8be,_0x1ad0ea[_0x23c3('0x44')]);var _0x277681={'where':_0x12b8be[_0x23c3('0x3d')]};return db[_0x23c3('0x45')]['count'](_0x277681)['then'](function(_0x21b427){_0x1bc3ce[_0x23c3('0x1f')]=_0x21b427;if(_0x1ad0ea['query'][_0x23c3('0x46')]){_0x12b8be[_0x23c3('0x47')]=[{'all':!![]}];}return db[_0x23c3('0x45')]['findAll'](_0x12b8be);})['then'](function(_0x1e98be){_0x1bc3ce[_0x23c3('0x48')]=_0x1e98be;return _0x1bc3ce;})[_0x23c3('0x25')](respondWithFilteredResult(_0x28af56,_0x12b8be))[_0x23c3('0x49')](handleError(_0x28af56,null));};exports[_0x23c3('0x4a')]=function(_0x4474d3,_0x3bcaad){var _0x33b393={'raw':![],'where':{'id':_0x4474d3['params']['id']}},_0xef696c={};_0xef696c['model']=_[_0x23c3('0x35')](db['JscriptyProject'][_0x23c3('0x2f')]);_0xef696c[_0x23c3('0x34')]=_['keys'](_0x4474d3[_0x23c3('0x34')]);_0xef696c[_0x23c3('0x3e')]=_[_0x23c3('0x36')](_0xef696c[_0x23c3('0x32')],_0xef696c[_0x23c3('0x34')]);_0x33b393['attributes']=_[_0x23c3('0x36')](_0xef696c[_0x23c3('0x32')],qs['fields'](_0x4474d3['query']['fields']));_0x33b393['attributes']=_0x33b393[_0x23c3('0x37')][_0x23c3('0x39')]?_0x33b393[_0x23c3('0x37')]:_0xef696c[_0x23c3('0x32')];if(_0x4474d3[_0x23c3('0x34')][_0x23c3('0x46')]){_0x33b393[_0x23c3('0x47')]=[{'all':!![]}];}_0x33b393=_[_0x23c3('0x41')]({},_0x33b393,_0x4474d3['options']);return db[_0x23c3('0x45')]['find'](_0x33b393)[_0x23c3('0x25')](handleEntityNotFound(_0x3bcaad,null))[_0x23c3('0x25')](respondWithResult(_0x3bcaad,null))['catch'](handleError(_0x3bcaad,null));};exports[_0x23c3('0x4b')]=function(_0x1c29e1,_0x13d2e1){return db[_0x23c3('0x45')][_0x23c3('0x4b')](_0x1c29e1[_0x23c3('0x4c')],{})['then'](function(_0x5169be){var _0xcb8172=_0x1c29e1[_0x23c3('0x4d')]['get']({'plain':!![]});if(!_0xcb8172)throw new Error(_0x23c3('0x4e'));if(_0xcb8172['role']===_0x23c3('0x4d')){var _0x49e2d5=_0x5169be['get']({'plain':!![]});var _0x7ff776=_0x23c3('0x26');return db[_0x23c3('0x4f')]['find']({'where':{'name':_0x7ff776,'userProfileId':_0xcb8172['userProfileId']},'raw':!![]})[_0x23c3('0x25')](function(_0x170324){if(_0x170324&&_0x170324['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x49e2d5[_0x23c3('0x2c')],'resourceId':_0x49e2d5['id'],'type':_0x170324['name'],'sectionId':_0x170324['id']},{})[_0x23c3('0x25')](function(){return _0x5169be;});}else{return _0x5169be;}})[_0x23c3('0x49')](function(_0x31243c){logger[_0x23c3('0x2a')](_0x23c3('0x50'),_0x31243c);throw _0x31243c;});}return _0x5169be;})[_0x23c3('0x25')](respondWithResult(_0x13d2e1,0xc9))['catch'](handleError(_0x13d2e1,null));};exports['clone']=function(_0x3f31e6,_0x479d90){var _0x5f31ca={'where':{'id':_0x3f31e6[_0x23c3('0x51')]['id']}},_0x1fc444={};_0x1fc444['model']=_[_0x23c3('0x35')](db[_0x23c3('0x45')][_0x23c3('0x2f')]);_0x5f31ca['attributes']=_['intersection'](_0x1fc444[_0x23c3('0x32')],qs['fields'](_0x3f31e6[_0x23c3('0x34')][_0x23c3('0x38')]));_0x5f31ca[_0x23c3('0x37')]=_0x5f31ca[_0x23c3('0x37')][_0x23c3('0x39')]?_0x5f31ca[_0x23c3('0x37')]:_0x1fc444[_0x23c3('0x32')];if(_0x3f31e6[_0x23c3('0x34')][_0x23c3('0x46')]){_0x5f31ca[_0x23c3('0x47')]=[{'all':!![]}];}_0x5f31ca=_[_0x23c3('0x41')]({},_0x5f31ca,_0x3f31e6['options']);return db[_0x23c3('0x45')][_0x23c3('0x52')](_0x5f31ca)['then'](handleEntityNotFound(_0x479d90,null))[_0x23c3('0x25')](function(_0x440243){if(_0x440243){var _0xdfdd10=_0x440243['get']({'plain':!![]});_0xdfdd10=qs[_0x23c3('0x53')](_0xdfdd10,['id','createdAt',_0x23c3('0x54')]);_0x3f31e6[_0x23c3('0x4c')]=_['omit'](_0x3f31e6[_0x23c3('0x4c')],['id','createdAt',_0x23c3('0x54')]);return db[_0x23c3('0x45')][_0x23c3('0x4b')](_[_0x23c3('0x41')](_0xdfdd10,_0x3f31e6['body']),{'include':_0x3f31e6['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4289b5){var _0x34b3b6=_0x3f31e6[_0x23c3('0x4d')][_0x23c3('0x55')]({'plain':!![]});if(!_0x34b3b6)throw new Error(_0x23c3('0x4e'));if(_0x34b3b6[_0x23c3('0x56')]===_0x23c3('0x4d')){var _0x194627=_0x4289b5[_0x23c3('0x55')]({'plain':!![]});var _0x2a4b5c=_0x23c3('0x26');return db[_0x23c3('0x4f')][_0x23c3('0x52')]({'where':{'name':_0x2a4b5c,'userProfileId':_0x34b3b6[_0x23c3('0x57')]},'raw':!![]})[_0x23c3('0x25')](function(_0x4c5519){if(_0x4c5519&&_0x4c5519[_0x23c3('0x58')]===0x0){return db[_0x23c3('0x27')]['create']({'name':_0x194627['name'],'resourceId':_0x194627['id'],'type':_0x4c5519['name'],'sectionId':_0x4c5519['id']},{})[_0x23c3('0x25')](function(){return _0x4289b5;});}else{return _0x4289b5;}})[_0x23c3('0x49')](function(_0x57a668){logger['error'](_0x23c3('0x50'),_0x57a668);throw _0x57a668;});}return _0x4289b5;});}})[_0x23c3('0x25')](respondWithResult(_0x479d90,0xc9))['catch'](handleError(_0x479d90,null));};exports['update']=function(_0x1dca53,_0x38378c){if(_0x1dca53[_0x23c3('0x4c')]['id']){delete _0x1dca53[_0x23c3('0x4c')]['id'];}return db[_0x23c3('0x45')][_0x23c3('0x52')]({'where':{'id':_0x1dca53[_0x23c3('0x51')]['id']}})[_0x23c3('0x25')](handleEntityNotFound(_0x38378c,null))[_0x23c3('0x25')](saveUpdates(_0x1dca53[_0x23c3('0x4c')],null))['then'](respondWithResult(_0x38378c,null))['catch'](handleError(_0x38378c,null));};exports['destroy']=function(_0x576201,_0xc52e0){return db[_0x23c3('0x45')][_0x23c3('0x52')]({'where':{'id':_0x576201[_0x23c3('0x51')]['id']}})[_0x23c3('0x25')](handleEntityNotFound(_0xc52e0,null))[_0x23c3('0x25')](removeEntity(_0xc52e0,null))[_0x23c3('0x49')](handleError(_0xc52e0,null));};exports['getSessions']=function(_0x1fc2e1,_0x3a6b84,_0x4bccd1){var _0x35bc9e={'raw':!![],'where':{}};var _0x5cddd8={};var _0x3abcbc={'count':0x0,'rows':[]};return db[_0x23c3('0x45')]['findOne']({'where':{'id':_0x1fc2e1[_0x23c3('0x51')]['id']}})['then'](handleEntityNotFound(_0x3a6b84,null))[_0x23c3('0x25')](function(_0x59d93c){if(_0x59d93c){_0x5cddd8[_0x23c3('0x32')]=_[_0x23c3('0x35')](db['JscriptySessionReport'][_0x23c3('0x2f')]);_0x5cddd8['query']=_[_0x23c3('0x35')](_0x1fc2e1[_0x23c3('0x34')]);_0x5cddd8[_0x23c3('0x3e')]=_[_0x23c3('0x36')](_0x5cddd8[_0x23c3('0x32')],_0x5cddd8[_0x23c3('0x34')]);_0x35bc9e[_0x23c3('0x37')]=_[_0x23c3('0x36')](_0x5cddd8[_0x23c3('0x32')],qs[_0x23c3('0x38')](_0x1fc2e1[_0x23c3('0x34')][_0x23c3('0x38')]));_0x35bc9e['attributes']=_0x35bc9e[_0x23c3('0x37')][_0x23c3('0x39')]?_0x35bc9e[_0x23c3('0x37')]:_0x5cddd8[_0x23c3('0x32')];if(!_0x1fc2e1[_0x23c3('0x34')]['hasOwnProperty'](_0x23c3('0x59'))){_0x35bc9e[_0x23c3('0x1e')]=qs[_0x23c3('0x1e')](_0x1fc2e1[_0x23c3('0x34')][_0x23c3('0x1e')]);_0x35bc9e[_0x23c3('0x20')]=qs[_0x23c3('0x20')](_0x1fc2e1[_0x23c3('0x34')][_0x23c3('0x20')]);}_0x35bc9e[_0x23c3('0x3b')]=qs[_0x23c3('0x3c')](_0x1fc2e1['query']['sort']);_0x35bc9e[_0x23c3('0x3d')]=qs[_0x23c3('0x3e')](_[_0x23c3('0x3f')](_0x1fc2e1['query'],_0x5cddd8[_0x23c3('0x3e')]));_0x35bc9e[_0x23c3('0x3d')]['ProjectId']=_0x59d93c['id'];if(_0x1fc2e1[_0x23c3('0x34')][_0x23c3('0x40')]){_0x35bc9e[_0x23c3('0x3d')]=_[_0x23c3('0x41')](_0x35bc9e[_0x23c3('0x3d')],{'$or':_['map'](_0x35bc9e['attributes'],function(_0x3da3db){var _0x38a152={};_0x38a152[_0x3da3db]={'$like':'%'+_0x1fc2e1[_0x23c3('0x34')][_0x23c3('0x40')]+'%'};return _0x38a152;})});}_0x35bc9e=_['merge']({},_0x35bc9e,_0x1fc2e1['options']);return db['JscriptySessionReport'][_0x23c3('0x1f')]({'where':_0x35bc9e[_0x23c3('0x3d')]})[_0x23c3('0x25')](function(_0x4d43f9){_0x3abcbc[_0x23c3('0x1f')]=_0x4d43f9;if(_0x1fc2e1[_0x23c3('0x34')][_0x23c3('0x46')]){_0x35bc9e[_0x23c3('0x47')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x35bc9e);})[_0x23c3('0x25')](function(_0x5b76c6){_0x3abcbc[_0x23c3('0x48')]=_0x5b76c6;return _0x3abcbc;});}})[_0x23c3('0x25')](respondWithFilteredResult(_0x3a6b84,_0x35bc9e))['catch'](handleError(_0x3a6b84,null));};exports[_0x23c3('0x5a')]=function(_0x217eee,_0x1f39bd,_0x527264){var _0x576e25={'raw':!![],'where':{}};var _0x4675fa={};var _0x2d5ac2={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x23c3('0x5b')]({'where':{'id':_0x217eee['params']['id']}})['then'](handleEntityNotFound(_0x1f39bd,null))['then'](function(_0xf4e753){if(_0xf4e753){_0x4675fa['model']=_[_0x23c3('0x35')](db[_0x23c3('0x5c')][_0x23c3('0x2f')]);_0x4675fa[_0x23c3('0x34')]=_['keys'](_0x217eee[_0x23c3('0x34')]);_0x4675fa[_0x23c3('0x3e')]=_['intersection'](_0x4675fa[_0x23c3('0x32')],_0x4675fa[_0x23c3('0x34')]);_0x576e25[_0x23c3('0x37')]=_[_0x23c3('0x36')](_0x4675fa[_0x23c3('0x32')],qs[_0x23c3('0x38')](_0x217eee[_0x23c3('0x34')][_0x23c3('0x38')]));_0x576e25[_0x23c3('0x37')]=_0x576e25[_0x23c3('0x37')]['length']?_0x576e25[_0x23c3('0x37')]:_0x4675fa[_0x23c3('0x32')];if(!_0x217eee['query']['hasOwnProperty'](_0x23c3('0x59'))){_0x576e25[_0x23c3('0x1e')]=qs['limit'](_0x217eee[_0x23c3('0x34')][_0x23c3('0x1e')]);_0x576e25[_0x23c3('0x20')]=qs[_0x23c3('0x20')](_0x217eee[_0x23c3('0x34')]['offset']);}_0x576e25['order']=qs[_0x23c3('0x3c')](_0x217eee[_0x23c3('0x34')][_0x23c3('0x3c')]);_0x576e25[_0x23c3('0x3d')]=qs[_0x23c3('0x3e')](_['pick'](_0x217eee[_0x23c3('0x34')],_0x4675fa[_0x23c3('0x3e')]));_0x576e25[_0x23c3('0x3d')][_0x23c3('0x5d')]=_0xf4e753['id'];if(_0x217eee[_0x23c3('0x34')]['filter']){_0x576e25[_0x23c3('0x3d')]=_[_0x23c3('0x41')](_0x576e25[_0x23c3('0x3d')],{'$or':_[_0x23c3('0x33')](_0x576e25['attributes'],function(_0xfa697){var _0x18ed6f={};_0x18ed6f[_0xfa697]={'$like':'%'+_0x217eee['query'][_0x23c3('0x40')]+'%'};return _0x18ed6f;})});}_0x576e25=_[_0x23c3('0x41')]({},_0x576e25,_0x217eee['options']);return db[_0x23c3('0x5c')][_0x23c3('0x1f')]({'where':_0x576e25[_0x23c3('0x3d')]})['then'](function(_0x2fa763){_0x2d5ac2['count']=_0x2fa763;if(_0x217eee['query'][_0x23c3('0x46')]){_0x576e25[_0x23c3('0x47')]=[{'all':!![]}];}return db[_0x23c3('0x5c')][_0x23c3('0x5e')](_0x576e25);})[_0x23c3('0x25')](function(_0x3aad3e){_0x2d5ac2[_0x23c3('0x48')]=_0x3aad3e;return _0x2d5ac2;});}})[_0x23c3('0x25')](respondWithFilteredResult(_0x1f39bd,_0x576e25))[_0x23c3('0x49')](handleError(_0x1f39bd,null));};function char(_0x120a73){return _0x23c3('0x5f')===typeof _0x120a73?String['fromCharCode'][_0x23c3('0x60')](null,arguments):_0x120a73;}function needsEncapsulation(_0x504155){return!!_0x504155&&(_0x504155[_0x23c3('0x61')]()[_0x23c3('0x62')](char(0xd))>=0x0||_0x504155[_0x23c3('0x61')]()[_0x23c3('0x62')](char(0xa))>=0x0||_0x504155[_0x23c3('0x61')]()['indexOf'](char(0x2c))>=0x0||_0x504155[_0x23c3('0x61')]()[_0x23c3('0x62')](char(0x22))>=0x0);}function encapsulate(_0x44f4c1){var _0x4c1a87=char(0x22),_0x38f1b2='\x5c'+char(0x22),_0x4c1f06=_0x44f4c1['toString']()['replace'](new RegExp(_0x4c1a87,'g'),_0x38f1b2);return _0x4c1a87+_0x4c1f06+_0x4c1a87;}exports[_0x23c3('0x63')]=function(_0x2c81a3,_0x3b6493,_0x3cb8a6){var _0x1677ec,_0x52c519;var _0x179b69={'where':{'ProjectId':_0x2c81a3[_0x23c3('0x51')]['id']}};if(_0x2c81a3[_0x23c3('0x34')][_0x23c3('0x64')]){_0x179b69[_0x23c3('0x3d')][_0x23c3('0x65')]=JSON[_0x23c3('0x66')](_0x2c81a3[_0x23c3('0x34')]['startTime']);}return db[_0x23c3('0x67')][_0x23c3('0x5e')](_0x179b69)[_0x23c3('0x25')](handleEntityNotFound(_0x3b6493,null))[_0x23c3('0x25')](function(_0x1b900b){if(_0x1b900b){_0x1677ec=_0x1b900b;return db[_0x23c3('0x68')][_0x23c3('0x5e')]({'where':{'SessionId':{'$in':_['map'](_0x1677ec,'id')},'ProjectId':_0x2c81a3[_0x23c3('0x51')]['id']},'order':_0x23c3('0x69')});}})[_0x23c3('0x25')](handleEntityNotFound(_0x3b6493,null))[_0x23c3('0x25')](function(_0x4fed40){if(_0x4fed40){_0x52c519=_0x4fed40;var _0x2e4a7c={};for(var _0x4483f8=0x0,_0x4b572d=_0x52c519[_0x23c3('0x39')];_0x4483f8<_0x4b572d;_0x4483f8++){if(!_0x2e4a7c['hasOwnProperty'](_0x52c519[_0x4483f8][_0x23c3('0x6a')])){_0x2e4a7c[_0x52c519[_0x4483f8]['questionId']]=needsEncapsulation(_0x52c519[_0x4483f8][_0x23c3('0x6b')])?encapsulate(_0x52c519[_0x4483f8]['question']):_0x52c519[_0x4483f8][_0x23c3('0x6b')];}}var _0x2d62ac=[],_0x5c23f1={};for(var _0x10db90=0x0,_0x21d9f0=_0x1677ec[_0x23c3('0x39')];_0x10db90<_0x21d9f0;_0x10db90++){_0x5c23f1={'ProjectId':_0x2c81a3[_0x23c3('0x51')]['id'],'SessionId':_0x1677ec[_0x10db90]['id'],'StartTime':moment(_0x1677ec[_0x10db90]['starttime'])['format'](_0x23c3('0x6c'))};for(var _0x53ba12=0x0,_0x5d1108=_0x52c519['length'];_0x53ba12<_0x5d1108;_0x53ba12++){if(_0x52c519[_0x53ba12][_0x23c3('0x6d')]==_0x1677ec[_0x10db90]['id']&&_0x2e4a7c[_0x23c3('0x3a')](_0x52c519[_0x53ba12][_0x23c3('0x6a')])){_0x5c23f1[_0x2e4a7c[_0x52c519[_0x53ba12][_0x23c3('0x6a')]]]=_0x52c519[_0x53ba12][_0x23c3('0x6e')];}}for(var _0x525fa6 in _0x2e4a7c){if(!_0x5c23f1[_0x23c3('0x3a')](_0x2e4a7c[_0x525fa6])){_0x5c23f1[_0x2e4a7c[_0x525fa6]]=null;}}_0x2d62ac[_0x23c3('0x6f')](_0x5c23f1);}return _0x2d62ac;}})[_0x23c3('0x25')](function(_0x526929){if(!_['isEmpty'](_0x526929)){var _0x56fef5=toCsv(_0x526929);var _0x386eb9=Date[_0x23c3('0x70')]();fs[_0x23c3('0x71')](util[_0x23c3('0x72')](_0x23c3('0x73'),_0x2c81a3[_0x23c3('0x51')]['id'],_0x386eb9),_0x56fef5);_0x3b6493['setHeader']('Content-disposition','attachment;\x20filename='+util['format'](_0x23c3('0x74'),_0x2c81a3[_0x23c3('0x51')]['id'],_0x386eb9));_0x3b6493[_0x23c3('0x75')](_0x23c3('0x76'),'text/csv');return _0x3b6493[_0x23c3('0x77')](util['format'](_0x23c3('0x73'),_0x2c81a3[_0x23c3('0x51')]['id'],_0x386eb9));}else{return _0x3b6493[_0x23c3('0x1a')](0xcc);}})['catch'](handleError(_0x3b6493,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 10d49bd..7932e2b 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 _0x2494=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyProject.attributes','define','jscripty_projects'];(function(_0x225b26,_0x5af384){var _0x17c3af=function(_0x577ac4){while(--_0x577ac4){_0x225b26['push'](_0x225b26['shift']());}};_0x17c3af(++_0x5af384);}(_0x2494,0x82));var _0x4249=function(_0x955f29,_0x5b87b2){_0x955f29=_0x955f29-0x0;var _0x56abba=_0x2494[_0x955f29];return _0x56abba;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var logger=require(_0x4249('0x1'))(_0x4249('0x2'));var moment=require(_0x4249('0x3'));var BPromise=require(_0x4249('0x4'));var rp=require(_0x4249('0x5'));var fs=require('fs');var path=require(_0x4249('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4249('0x7'));module['exports']=function(_0x3c2d8d,_0x1d4ca8){return _0x3c2d8d[_0x4249('0x8')]('JscriptyProject',attributes,{'tableName':_0x4249('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe22=['../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x105d2e,_0xefc0f9){var _0x44969d=function(_0x2fca67){while(--_0x2fca67){_0x105d2e['push'](_0x105d2e['shift']());}};_0x44969d(++_0xefc0f9);}(_0xbe22,0x1c1));var _0x2be2=function(_0x1c80d3,_0x4e00ab){_0x1c80d3=_0x1c80d3-0x0;var _0x3d4ad8=_0xbe22[_0x1c80d3];return _0x3d4ad8;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2be2('0x2'));var BPromise=require(_0x2be2('0x3'));var rp=require(_0x2be2('0x4'));var fs=require('fs');var path=require(_0x2be2('0x5'));var rimraf=require(_0x2be2('0x6'));var config=require(_0x2be2('0x7'));var attributes=require(_0x2be2('0x8'));module[_0x2be2('0x9')]=function(_0x1b3bde,_0x3a4d77){return _0x1b3bde['define'](_0x2be2('0xa'),attributes,{'tableName':_0x2be2('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 e058dd8..38c0214 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 _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x28da10,_0x29470c){var _0x298372=function(_0x4acba9){while(--_0x4acba9){_0x28da10['push'](_0x28da10['shift']());}};_0x298372(++_0x29470c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x312668,_0x6a85f3){_0x312668=_0x312668-0x0;var _0x344e3c=_0xf4eb[_0x312668];return _0x344e3c;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x37cbbc,_0x1ac641){var _0x263bc2=function(_0x300089){while(--_0x300089){_0x37cbbc['push'](_0x37cbbc['shift']());}};_0x263bc2(++_0x1ac641);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index b76e503..dcf2fcc 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 _0xbb1a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','get','isAuthenticated','describe','/:id','post','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb1a,0x1a0));var _0xabb1=function(_0x4f72c0,_0x54caa1){_0x4f72c0=_0x4f72c0-0x0;var _0x38d60b=_0xbb1a[_0x4f72c0];return _0x38d60b;};'use strict';var multer=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var path=require(_0xabb1('0x2'));var timeout=require(_0xabb1('0x3'));var express=require(_0xabb1('0x4'));var router=express[_0xabb1('0x5')]();var fs_extra=require(_0xabb1('0x6'));var auth=require(_0xabb1('0x7'));var interaction=require(_0xabb1('0x8'));var config=require(_0xabb1('0x9'));var controller=require(_0xabb1('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xabb1('0xb')]);router[_0xabb1('0xc')]('/describe',auth[_0xabb1('0xd')](),controller[_0xabb1('0xe')]);router[_0xabb1('0xc')](_0xabb1('0xf'),auth[_0xabb1('0xd')](),controller['show']);router[_0xabb1('0x10')]('/',auth[_0xabb1('0xd')](),controller[_0xabb1('0x11')]);router[_0xabb1('0x12')](_0xabb1('0xf'),auth[_0xabb1('0xd')](),controller[_0xabb1('0x13')]);router[_0xabb1('0x14')](_0xabb1('0xf'),auth[_0xabb1('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7c73=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path'];(function(_0x35565a,_0x14263d){var _0x16dd84=function(_0x4b4da6){while(--_0x4b4da6){_0x35565a['push'](_0x35565a['shift']());}};_0x16dd84(++_0x14263d);}(_0x7c73,0x165));var _0x37c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c73[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x37c7('0x0'));var util=require(_0x37c7('0x1'));var path=require(_0x37c7('0x2'));var timeout=require(_0x37c7('0x3'));var express=require(_0x37c7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37c7('0x5'));var interaction=require(_0x37c7('0x6'));var config=require(_0x37c7('0x7'));var controller=require(_0x37c7('0x8'));router[_0x37c7('0x9')]('/',auth[_0x37c7('0xa')](),controller['index']);router[_0x37c7('0x9')](_0x37c7('0xb'),auth[_0x37c7('0xa')](),controller[_0x37c7('0xc')]);router[_0x37c7('0x9')](_0x37c7('0xd'),auth['isAuthenticated'](),controller[_0x37c7('0xe')]);router[_0x37c7('0xf')]('/',auth[_0x37c7('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x37c7('0x10')]);router[_0x37c7('0x11')]('/:id',auth[_0x37c7('0xa')](),controller[_0x37c7('0x12')]);module[_0x37c7('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 04e2a63..3d36034 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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x469ab4,_0x4a7be3){_0x469ab4=_0x469ab4-0x0;var _0x122250=_0x7a54[_0x469ab4];return _0x122250;};'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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0xb41fba,_0x1892f5){_0xb41fba=_0xb41fba-0x0;var _0x254098=_0x7a54[_0xb41fba];return _0x254098;};'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 7c8ee15..576dbec 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 _0x8a50=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','limit','undefined','count','offset','set','Content-Range','reject','update','destroy','then','sendStatus','name','index','map','JscriptyQuestionReport','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','catch','show','params','rawAttributes','options','create','body','find','describe','eml-format','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a50,0x157));var _0x08a5=function(_0x33dd8d,_0x2e0033){_0x33dd8d=_0x33dd8d-0x0;var _0x3c992e=_0x8a50[_0x33dd8d];return _0x3c992e;};'use strict';var emlformat=require(_0x08a5('0x0'));var rimraf=require(_0x08a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08a5('0x2'));var rp=require(_0x08a5('0x3'));var moment=require(_0x08a5('0x4'));var BPromise=require(_0x08a5('0x5'));var Mustache=require('mustache');var util=require(_0x08a5('0x6'));var path=require(_0x08a5('0x7'));var sox=require(_0x08a5('0x8'));var csv=require('to-csv');var ejs=require(_0x08a5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x08a5('0xa'));var deskjs=require(_0x08a5('0xb'));var toCsv=require(_0x08a5('0xc'));var querystring=require('querystring');var Papa=require(_0x08a5('0xd'));var Redis=require(_0x08a5('0xe'));var authService=require(_0x08a5('0xf'));var qs=require(_0x08a5('0x10'));var as=require(_0x08a5('0x11'));var hardwareService=require(_0x08a5('0x12'));var logger=require(_0x08a5('0x13'))('api');var utils=require(_0x08a5('0x14'));var config=require(_0x08a5('0x15'));var licenseUtil=require(_0x08a5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1de1b1,_0x2e4614){_0x2e4614=_0x2e4614||0xcc;return function(_0x8a9719){if(_0x8a9719){return _0x1de1b1['sendStatus'](_0x2e4614);}return _0x1de1b1[_0x08a5('0x17')](_0x2e4614)[_0x08a5('0x18')]();};}function respondWithResult(_0xd8eee7,_0x4d6468){_0x4d6468=_0x4d6468||0xc8;return function(_0x4a304d){if(_0x4a304d){return _0xd8eee7[_0x08a5('0x17')](_0x4d6468)['json'](_0x4a304d);}};}function respondWithFilteredResult(_0x49cd4b,_0x3209ce){return function(_0x47aeb7){if(_0x47aeb7){var _0x512c50=typeof _0x3209ce['offset']==='undefined'&&typeof _0x3209ce[_0x08a5('0x19')]===_0x08a5('0x1a');var _0x48e11a=_0x47aeb7[_0x08a5('0x1b')];var _0x3988a9=_0x512c50?0x0:_0x3209ce['offset'];var _0x5d0788=_0x512c50?_0x47aeb7[_0x08a5('0x1b')]:_0x3209ce[_0x08a5('0x1c')]+_0x3209ce['limit'];var _0x57fe86;if(_0x5d0788>=_0x48e11a){_0x5d0788=_0x48e11a;_0x57fe86=0xc8;}else{_0x57fe86=0xce;}_0x49cd4b[_0x08a5('0x17')](_0x57fe86);return _0x49cd4b[_0x08a5('0x1d')](_0x08a5('0x1e'),_0x3988a9+'-'+_0x5d0788+'/'+_0x48e11a)['json'](_0x47aeb7);}return null;};}function patchUpdates(_0x487cc5){return function(_0x1cd0aa){try{jsonpatch['apply'](_0x1cd0aa,_0x487cc5,!![]);}catch(_0x5b2549){return BPromise[_0x08a5('0x1f')](_0x5b2549);}return _0x1cd0aa['save']();};}function saveUpdates(_0x840878,_0x5d93da){return function(_0xac7941){if(_0xac7941){return _0xac7941[_0x08a5('0x20')](_0x840878)['then'](function(_0x54ccab){return _0x54ccab;});}return null;};}function removeEntity(_0x1d7eb1,_0x4b9e77){return function(_0x2fe552){if(_0x2fe552){return _0x2fe552[_0x08a5('0x21')]()[_0x08a5('0x22')](function(){_0x1d7eb1[_0x08a5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e1f8,_0xfec84c){return function(_0x3416fd){if(!_0x3416fd){_0x34e1f8[_0x08a5('0x23')](0x194);}return _0x3416fd;};}function handleError(_0x370f42,_0x3512a0){_0x3512a0=_0x3512a0||0x1f4;return function(_0x1328f0){logger['error'](_0x1328f0['stack']);if(_0x1328f0[_0x08a5('0x24')]){delete _0x1328f0[_0x08a5('0x24')];}_0x370f42[_0x08a5('0x17')](_0x3512a0)['send'](_0x1328f0);};}exports[_0x08a5('0x25')]=function(_0xcb0c96,_0x217be3){var _0x494cd8={},_0x24db09={},_0x53cfe9={'count':0x0,'rows':[]};var _0x5c2da4=_[_0x08a5('0x26')](db[_0x08a5('0x27')]['rawAttributes'],function(_0x505404){return{'name':_0x505404['fieldName'],'type':_0x505404[_0x08a5('0x28')]['key']};});_0x24db09['model']=_[_0x08a5('0x26')](_0x5c2da4,_0x08a5('0x24'));_0x24db09[_0x08a5('0x29')]=_[_0x08a5('0x2a')](_0xcb0c96['query']);_0x24db09[_0x08a5('0x2b')]=_[_0x08a5('0x2c')](_0x24db09[_0x08a5('0x2d')],_0x24db09[_0x08a5('0x29')]);_0x494cd8[_0x08a5('0x2e')]=_[_0x08a5('0x2c')](_0x24db09[_0x08a5('0x2d')],qs[_0x08a5('0x2f')](_0xcb0c96['query'][_0x08a5('0x2f')]));_0x494cd8[_0x08a5('0x2e')]=_0x494cd8[_0x08a5('0x2e')][_0x08a5('0x30')]?_0x494cd8[_0x08a5('0x2e')]:_0x24db09['model'];if(!_0xcb0c96[_0x08a5('0x29')][_0x08a5('0x31')](_0x08a5('0x32'))){_0x494cd8['limit']=qs[_0x08a5('0x19')](_0xcb0c96[_0x08a5('0x29')]['limit']);_0x494cd8[_0x08a5('0x1c')]=qs[_0x08a5('0x1c')](_0xcb0c96[_0x08a5('0x29')][_0x08a5('0x1c')]);}_0x494cd8[_0x08a5('0x33')]=qs['sort'](_0xcb0c96[_0x08a5('0x29')][_0x08a5('0x34')]);_0x494cd8[_0x08a5('0x35')]=qs[_0x08a5('0x2b')](_[_0x08a5('0x36')](_0xcb0c96[_0x08a5('0x29')],_0x24db09[_0x08a5('0x2b')]),_0x5c2da4);if(_0xcb0c96[_0x08a5('0x29')][_0x08a5('0x37')]){_0x494cd8[_0x08a5('0x35')]=_['merge'](_0x494cd8[_0x08a5('0x35')],{'$or':_[_0x08a5('0x26')](_0x5c2da4,function(_0x2ab402){if(_0x2ab402['type']!==_0x08a5('0x38')){var _0x5d4d5c={};_0x5d4d5c[_0x2ab402['name']]={'$like':'%'+_0xcb0c96[_0x08a5('0x29')][_0x08a5('0x37')]+'%'};return _0x5d4d5c;}})});}_0x494cd8=_[_0x08a5('0x39')]({},_0x494cd8,_0xcb0c96['options']);var _0x3e331c={'where':_0x494cd8[_0x08a5('0x35')]};return db[_0x08a5('0x27')][_0x08a5('0x1b')](_0x3e331c)[_0x08a5('0x22')](function(_0x3d3522){_0x53cfe9[_0x08a5('0x1b')]=_0x3d3522;if(_0xcb0c96[_0x08a5('0x29')][_0x08a5('0x3a')]){_0x494cd8[_0x08a5('0x3b')]=[{'all':!![]}];}return db[_0x08a5('0x27')]['findAll'](_0x494cd8);})['then'](function(_0x2e0131){_0x53cfe9['rows']=_0x2e0131;return _0x53cfe9;})['then'](respondWithFilteredResult(_0x217be3,_0x494cd8))[_0x08a5('0x3c')](handleError(_0x217be3,null));};exports[_0x08a5('0x3d')]=function(_0x2decbf,_0x1cd9e0){var _0x3e804e={'raw':!![],'where':{'id':_0x2decbf[_0x08a5('0x3e')]['id']}},_0x5588fa={};_0x5588fa['model']=_['keys'](db[_0x08a5('0x27')][_0x08a5('0x3f')]);_0x5588fa[_0x08a5('0x29')]=_[_0x08a5('0x2a')](_0x2decbf[_0x08a5('0x29')]);_0x5588fa[_0x08a5('0x2b')]=_[_0x08a5('0x2c')](_0x5588fa[_0x08a5('0x2d')],_0x5588fa[_0x08a5('0x29')]);_0x3e804e[_0x08a5('0x2e')]=_[_0x08a5('0x2c')](_0x5588fa[_0x08a5('0x2d')],qs[_0x08a5('0x2f')](_0x2decbf[_0x08a5('0x29')][_0x08a5('0x2f')]));_0x3e804e[_0x08a5('0x2e')]=_0x3e804e['attributes'][_0x08a5('0x30')]?_0x3e804e[_0x08a5('0x2e')]:_0x5588fa['model'];if(_0x2decbf[_0x08a5('0x29')][_0x08a5('0x3a')]){_0x3e804e[_0x08a5('0x3b')]=[{'all':!![]}];}_0x3e804e=_[_0x08a5('0x39')]({},_0x3e804e,_0x2decbf[_0x08a5('0x40')]);return db[_0x08a5('0x27')]['find'](_0x3e804e)['then'](handleEntityNotFound(_0x1cd9e0,null))[_0x08a5('0x22')](respondWithResult(_0x1cd9e0,null))[_0x08a5('0x3c')](handleError(_0x1cd9e0,null));};exports[_0x08a5('0x41')]=function(_0x4825ef,_0x44b88f){return db[_0x08a5('0x27')][_0x08a5('0x41')](_0x4825ef[_0x08a5('0x42')],{})[_0x08a5('0x22')](respondWithResult(_0x44b88f,0xc9))['catch'](handleError(_0x44b88f,null));};exports['update']=function(_0x5102df,_0x212398){if(_0x5102df[_0x08a5('0x42')]['id']){delete _0x5102df[_0x08a5('0x42')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x5102df[_0x08a5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x212398,null))[_0x08a5('0x22')](saveUpdates(_0x5102df[_0x08a5('0x42')],null))[_0x08a5('0x22')](respondWithResult(_0x212398,null))[_0x08a5('0x3c')](handleError(_0x212398,null));};exports['destroy']=function(_0x254569,_0x1097e5){return db[_0x08a5('0x27')][_0x08a5('0x43')]({'where':{'id':_0x254569[_0x08a5('0x3e')]['id']}})[_0x08a5('0x22')](handleEntityNotFound(_0x1097e5,null))[_0x08a5('0x22')](removeEntity(_0x1097e5,null))[_0x08a5('0x3c')](handleError(_0x1097e5,null));};exports['describe']=function(_0x2705fd,_0x34cee3){return db[_0x08a5('0x27')][_0x08a5('0x44')]()[_0x08a5('0x22')](respondWithResult(_0x34cee3,null))[_0x08a5('0x3c')](handleError(_0x34cee3,null));}; \ No newline at end of file +var _0xe759=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','index','map','JscriptyQuestionReport','rawAttributes','key','model','query','keys','filters','attributes'];(function(_0x4257cf,_0x3cd364){var _0x5394a3=function(_0x3ae4da){while(--_0x3ae4da){_0x4257cf['push'](_0x4257cf['shift']());}};_0x5394a3(++_0x3cd364);}(_0xe759,0xa8));var _0x9e75=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe759[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x9e75('0x0'));var rimraf=require(_0x9e75('0x1'));var zipdir=require(_0x9e75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e75('0x3'));var moment=require(_0x9e75('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9e75('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9e75('0x6'));var csv=require('to-csv');var ejs=require(_0x9e75('0x7'));var fs=require('fs');var fs_extra=require(_0x9e75('0x8'));var _=require(_0x9e75('0x9'));var squel=require(_0x9e75('0xa'));var crypto=require(_0x9e75('0xb'));var jsforce=require(_0x9e75('0xc'));var deskjs=require(_0x9e75('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9e75('0xe'));var Redis=require(_0x9e75('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e75('0x10'));var as=require(_0x9e75('0x11'));var hardwareService=require(_0x9e75('0x12'));var logger=require(_0x9e75('0x13'))(_0x9e75('0x14'));var utils=require(_0x9e75('0x15'));var config=require(_0x9e75('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ed207,_0x4d9ac8){_0x4d9ac8=_0x4d9ac8||0xcc;return function(_0xee63e9){if(_0xee63e9){return _0x3ed207[_0x9e75('0x17')](_0x4d9ac8);}return _0x3ed207[_0x9e75('0x18')](_0x4d9ac8)['end']();};}function respondWithResult(_0x3dbabd,_0x2e0f0a){_0x2e0f0a=_0x2e0f0a||0xc8;return function(_0x254592){if(_0x254592){return _0x3dbabd[_0x9e75('0x18')](_0x2e0f0a)['json'](_0x254592);}};}function respondWithFilteredResult(_0x3f3374,_0x56e137){return function(_0x1e7680){if(_0x1e7680){var _0x4b8e2f=typeof _0x56e137[_0x9e75('0x19')]==='undefined'&&typeof _0x56e137[_0x9e75('0x1a')]==='undefined';var _0x2401c3=_0x1e7680[_0x9e75('0x1b')];var _0xf167d1=_0x4b8e2f?0x0:_0x56e137[_0x9e75('0x19')];var _0x18c72c=_0x4b8e2f?_0x1e7680[_0x9e75('0x1b')]:_0x56e137[_0x9e75('0x19')]+_0x56e137['limit'];var _0x57d3e3;if(_0x18c72c>=_0x2401c3){_0x18c72c=_0x2401c3;_0x57d3e3=0xc8;}else{_0x57d3e3=0xce;}_0x3f3374[_0x9e75('0x18')](_0x57d3e3);return _0x3f3374[_0x9e75('0x1c')](_0x9e75('0x1d'),_0xf167d1+'-'+_0x18c72c+'/'+_0x2401c3)[_0x9e75('0x1e')](_0x1e7680);}return null;};}function patchUpdates(_0x21f239){return function(_0x163e37){try{jsonpatch['apply'](_0x163e37,_0x21f239,!![]);}catch(_0x39ee3a){return BPromise[_0x9e75('0x1f')](_0x39ee3a);}return _0x163e37[_0x9e75('0x20')]();};}function saveUpdates(_0x2f1219,_0x38bf88){return function(_0x5efb0e){if(_0x5efb0e){return _0x5efb0e[_0x9e75('0x21')](_0x2f1219)[_0x9e75('0x22')](function(_0x2b284f){return _0x2b284f;});}return null;};}function removeEntity(_0x21426f,_0xcd951a){return function(_0x1b6b0a){if(_0x1b6b0a){return _0x1b6b0a[_0x9e75('0x23')]()['then'](function(){_0x21426f[_0x9e75('0x18')](0xcc)[_0x9e75('0x24')]();});}};}function handleEntityNotFound(_0x2329c1,_0x5ea19c){return function(_0x496c95){if(!_0x496c95){_0x2329c1[_0x9e75('0x17')](0x194);}return _0x496c95;};}function handleError(_0x37b0bc,_0x966c0f){_0x966c0f=_0x966c0f||0x1f4;return function(_0x3b4928){logger['error'](_0x3b4928['stack']);if(_0x3b4928['name']){delete _0x3b4928[_0x9e75('0x25')];}_0x37b0bc[_0x9e75('0x18')](_0x966c0f)['send'](_0x3b4928);};}exports[_0x9e75('0x26')]=function(_0x10e1c4,_0x45e844){var _0x4c4df4={},_0x38509c={},_0xd1ef2f={'count':0x0,'rows':[]};var _0x4aff4f=_[_0x9e75('0x27')](db[_0x9e75('0x28')][_0x9e75('0x29')],function(_0x1c9dce){return{'name':_0x1c9dce['fieldName'],'type':_0x1c9dce['type'][_0x9e75('0x2a')]};});_0x38509c[_0x9e75('0x2b')]=_[_0x9e75('0x27')](_0x4aff4f,_0x9e75('0x25'));_0x38509c[_0x9e75('0x2c')]=_[_0x9e75('0x2d')](_0x10e1c4[_0x9e75('0x2c')]);_0x38509c[_0x9e75('0x2e')]=_['intersection'](_0x38509c[_0x9e75('0x2b')],_0x38509c[_0x9e75('0x2c')]);_0x4c4df4[_0x9e75('0x2f')]=_[_0x9e75('0x30')](_0x38509c[_0x9e75('0x2b')],qs[_0x9e75('0x31')](_0x10e1c4['query']['fields']));_0x4c4df4[_0x9e75('0x2f')]=_0x4c4df4[_0x9e75('0x2f')][_0x9e75('0x32')]?_0x4c4df4[_0x9e75('0x2f')]:_0x38509c['model'];if(!_0x10e1c4[_0x9e75('0x2c')][_0x9e75('0x33')](_0x9e75('0x34'))){_0x4c4df4[_0x9e75('0x1a')]=qs[_0x9e75('0x1a')](_0x10e1c4['query']['limit']);_0x4c4df4[_0x9e75('0x19')]=qs['offset'](_0x10e1c4[_0x9e75('0x2c')][_0x9e75('0x19')]);}_0x4c4df4[_0x9e75('0x35')]=qs[_0x9e75('0x36')](_0x10e1c4[_0x9e75('0x2c')][_0x9e75('0x36')]);_0x4c4df4[_0x9e75('0x37')]=qs[_0x9e75('0x2e')](_[_0x9e75('0x38')](_0x10e1c4['query'],_0x38509c[_0x9e75('0x2e')]),_0x4aff4f);if(_0x10e1c4[_0x9e75('0x2c')][_0x9e75('0x39')]){_0x4c4df4[_0x9e75('0x37')]=_[_0x9e75('0x3a')](_0x4c4df4[_0x9e75('0x37')],{'$or':_[_0x9e75('0x27')](_0x4aff4f,function(_0x39f3c8){if(_0x39f3c8[_0x9e75('0x3b')]!==_0x9e75('0x3c')){var _0x45624a={};_0x45624a[_0x39f3c8[_0x9e75('0x25')]]={'$like':'%'+_0x10e1c4[_0x9e75('0x2c')][_0x9e75('0x39')]+'%'};return _0x45624a;}})});}_0x4c4df4=_[_0x9e75('0x3a')]({},_0x4c4df4,_0x10e1c4[_0x9e75('0x3d')]);var _0x32e283={'where':_0x4c4df4['where']};return db[_0x9e75('0x28')][_0x9e75('0x1b')](_0x32e283)[_0x9e75('0x22')](function(_0x4fa04e){_0xd1ef2f[_0x9e75('0x1b')]=_0x4fa04e;if(_0x10e1c4['query']['includeAll']){_0x4c4df4[_0x9e75('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x9e75('0x3f')](_0x4c4df4);})[_0x9e75('0x22')](function(_0x428b88){_0xd1ef2f[_0x9e75('0x40')]=_0x428b88;return _0xd1ef2f;})[_0x9e75('0x22')](respondWithFilteredResult(_0x45e844,_0x4c4df4))[_0x9e75('0x41')](handleError(_0x45e844,null));};exports[_0x9e75('0x42')]=function(_0x29d136,_0x4f0560){var _0x376dd6={'raw':!![],'where':{'id':_0x29d136[_0x9e75('0x43')]['id']}},_0x77eeb0={};_0x77eeb0['model']=_[_0x9e75('0x2d')](db[_0x9e75('0x28')][_0x9e75('0x29')]);_0x77eeb0[_0x9e75('0x2c')]=_[_0x9e75('0x2d')](_0x29d136['query']);_0x77eeb0[_0x9e75('0x2e')]=_[_0x9e75('0x30')](_0x77eeb0[_0x9e75('0x2b')],_0x77eeb0[_0x9e75('0x2c')]);_0x376dd6[_0x9e75('0x2f')]=_[_0x9e75('0x30')](_0x77eeb0[_0x9e75('0x2b')],qs[_0x9e75('0x31')](_0x29d136[_0x9e75('0x2c')][_0x9e75('0x31')]));_0x376dd6[_0x9e75('0x2f')]=_0x376dd6[_0x9e75('0x2f')]['length']?_0x376dd6[_0x9e75('0x2f')]:_0x77eeb0[_0x9e75('0x2b')];if(_0x29d136[_0x9e75('0x2c')]['includeAll']){_0x376dd6[_0x9e75('0x3e')]=[{'all':!![]}];}_0x376dd6=_['merge']({},_0x376dd6,_0x29d136[_0x9e75('0x3d')]);return db[_0x9e75('0x28')][_0x9e75('0x44')](_0x376dd6)[_0x9e75('0x22')](handleEntityNotFound(_0x4f0560,null))['then'](respondWithResult(_0x4f0560,null))[_0x9e75('0x41')](handleError(_0x4f0560,null));};exports[_0x9e75('0x45')]=function(_0x1c36a6,_0x553ffb){return db[_0x9e75('0x28')][_0x9e75('0x45')](_0x1c36a6[_0x9e75('0x46')],{})[_0x9e75('0x22')](respondWithResult(_0x553ffb,0xc9))[_0x9e75('0x41')](handleError(_0x553ffb,null));};exports[_0x9e75('0x21')]=function(_0x2e5939,_0x2ed276){if(_0x2e5939[_0x9e75('0x46')]['id']){delete _0x2e5939[_0x9e75('0x46')]['id'];}return db[_0x9e75('0x28')][_0x9e75('0x44')]({'where':{'id':_0x2e5939[_0x9e75('0x43')]['id']}})[_0x9e75('0x22')](handleEntityNotFound(_0x2ed276,null))[_0x9e75('0x22')](saveUpdates(_0x2e5939[_0x9e75('0x46')],null))['then'](respondWithResult(_0x2ed276,null))[_0x9e75('0x41')](handleError(_0x2ed276,null));};exports[_0x9e75('0x23')]=function(_0x3c9d60,_0x1ddc68){return db[_0x9e75('0x28')][_0x9e75('0x44')]({'where':{'id':_0x3c9d60[_0x9e75('0x43')]['id']}})[_0x9e75('0x22')](handleEntityNotFound(_0x1ddc68,null))[_0x9e75('0x22')](removeEntity(_0x1ddc68,null))[_0x9e75('0x41')](handleError(_0x1ddc68,null));};exports[_0x9e75('0x47')]=function(_0x304c7f,_0x58e56d){return db[_0x9e75('0x28')]['describe']()[_0x9e75('0x22')](respondWithResult(_0x58e56d,null))[_0x9e75('0x41')](handleError(_0x58e56d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index d7785ad..dc57979 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 _0x4922=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x323b20,_0x397e4c){var _0x3ef1b1=function(_0x57726d){while(--_0x57726d){_0x323b20['push'](_0x323b20['shift']());}};_0x3ef1b1(++_0x397e4c);}(_0x4922,0xb3));var _0x2492=function(_0x40709c,_0x2fa9ba){_0x40709c=_0x40709c-0x0;var _0x351e1d=_0x4922[_0x40709c];return _0x351e1d;};'use strict';var _=require(_0x2492('0x0'));var util=require(_0x2492('0x1'));var logger=require(_0x2492('0x2'))(_0x2492('0x3'));var moment=require(_0x2492('0x4'));var BPromise=require(_0x2492('0x5'));var rp=require(_0x2492('0x6'));var fs=require('fs');var path=require(_0x2492('0x7'));var rimraf=require(_0x2492('0x8'));var config=require(_0x2492('0x9'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x2492('0xa')]=function(_0x432131,_0x7e03fe){return _0x432131[_0x2492('0xb')]('JscriptyQuestionReport',attributes,{'tableName':_0x2492('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ea3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','util','../../config/logger'];(function(_0x44f859,_0x39d4cd){var _0x2ecda6=function(_0x594b3){while(--_0x594b3){_0x44f859['push'](_0x44f859['shift']());}};_0x2ecda6(++_0x39d4cd);}(_0x2ea3,0x17e));var _0x32ea=function(_0x2b7196,_0x582f8e){_0x2b7196=_0x2b7196-0x0;var _0x4b7b3a=_0x2ea3[_0x2b7196];return _0x4b7b3a;};'use strict';var _=require('lodash');var util=require(_0x32ea('0x0'));var logger=require(_0x32ea('0x1'))('api');var moment=require(_0x32ea('0x2'));var BPromise=require(_0x32ea('0x3'));var rp=require(_0x32ea('0x4'));var fs=require('fs');var path=require(_0x32ea('0x5'));var rimraf=require(_0x32ea('0x6'));var config=require(_0x32ea('0x7'));var attributes=require(_0x32ea('0x8'));module[_0x32ea('0x9')]=function(_0xc0b9f7,_0x484998){return _0xc0b9f7[_0x32ea('0xa')](_0x32ea('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 7eb8267..9660488 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 _0x5bd0=['result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x42d825,_0x1045d0){var _0x417c63=function(_0x3d131c){while(--_0x3d131c){_0x42d825['push'](_0x42d825['shift']());}};_0x417c63(++_0x1045d0);}(_0x5bd0,0x11f));var _0x05bd=function(_0xcd26a9,_0x512e77){_0xcd26a9=_0xcd26a9-0x0;var _0x3afcbc=_0x5bd0[_0xcd26a9];return _0x3afcbc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x05bd('0x0'));var BPromise=require(_0x05bd('0x1'));var rs=require(_0x05bd('0x2'));var fs=require('fs');var Redis=require(_0x05bd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x05bd('0x4'))(_0x05bd('0x5'));var config=require(_0x05bd('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x05bd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x291be9,_0x479eb5,_0x4eafd7){return new BPromise(function(_0x2b9819,_0x4d232c){return client[_0x05bd('0x8')](_0x291be9,_0x4eafd7)[_0x05bd('0x9')](function(_0x2705c5){logger[_0x05bd('0xa')](_0x05bd('0xb'),_0x479eb5,'request\x20sent');logger[_0x05bd('0xc')](_0x05bd('0xd'),_0x479eb5,_0x05bd('0xe'),JSON['stringify'](_0x2705c5));if(_0x2705c5[_0x05bd('0xf')]){if(_0x2705c5[_0x05bd('0xf')]['code']===0x1f4){logger[_0x05bd('0xf')](_0x05bd('0xb'),_0x479eb5,_0x2705c5['error'][_0x05bd('0x10')]);return _0x4d232c(_0x2705c5[_0x05bd('0xf')][_0x05bd('0x10')]);}logger[_0x05bd('0xf')](_0x05bd('0xb'),_0x479eb5,_0x2705c5['error']['message']);return _0x2b9819(_0x2705c5[_0x05bd('0xf')]['message']);}else{logger[_0x05bd('0xa')](_0x05bd('0xb'),_0x479eb5,_0x05bd('0xe'));_0x2b9819(_0x2705c5[_0x05bd('0x11')]['message']);}})[_0x05bd('0x12')](function(_0x4670b4){logger[_0x05bd('0xf')](_0x05bd('0xb'),_0x479eb5,_0x4670b4);_0x4d232c(_0x4670b4);});});} \ No newline at end of file +var _0xa0b7=['request','then','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x4f949f,_0x22a8a1){var _0x263e01=function(_0x3e94ba){while(--_0x3e94ba){_0x4f949f['push'](_0x4f949f['shift']());}};_0x263e01(++_0x22a8a1);}(_0xa0b7,0x1da));var _0x7a0b=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xa0b7[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x7a0b('0x0'));var util=require('util');var moment=require(_0x7a0b('0x1'));var BPromise=require(_0x7a0b('0x2'));var rs=require(_0x7a0b('0x3'));var fs=require('fs');var Redis=require(_0x7a0b('0x4'));var db=require(_0x7a0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a0b('0x6'))('rpc');var config=require(_0x7a0b('0x7'));var jayson=require(_0x7a0b('0x8'));var client=jayson['client'][_0x7a0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55fd2b,_0x245831,_0xde1c0b){return new BPromise(function(_0x46fc23,_0x107b51){return client[_0x7a0b('0xa')](_0x55fd2b,_0xde1c0b)[_0x7a0b('0xb')](function(_0x4fff01){logger['info'](_0x7a0b('0xc'),_0x245831,'request\x20sent');logger[_0x7a0b('0xd')](_0x7a0b('0xe'),_0x245831,'request\x20sent',JSON[_0x7a0b('0xf')](_0x4fff01));if(_0x4fff01[_0x7a0b('0x10')]){if(_0x4fff01[_0x7a0b('0x10')][_0x7a0b('0x11')]===0x1f4){logger[_0x7a0b('0x10')](_0x7a0b('0xc'),_0x245831,_0x4fff01[_0x7a0b('0x10')][_0x7a0b('0x12')]);return _0x107b51(_0x4fff01['error'][_0x7a0b('0x12')]);}logger['error'](_0x7a0b('0xc'),_0x245831,_0x4fff01[_0x7a0b('0x10')][_0x7a0b('0x12')]);return _0x46fc23(_0x4fff01[_0x7a0b('0x10')][_0x7a0b('0x12')]);}else{logger[_0x7a0b('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x245831,'request\x20sent');_0x46fc23(_0x4fff01[_0x7a0b('0x14')][_0x7a0b('0x12')]);}})[_0x7a0b('0x15')](function(_0x37f9a9){logger[_0x7a0b('0x10')](_0x7a0b('0xc'),_0x245831,_0x37f9a9);_0x107b51(_0x37f9a9);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8ab6101..d34f8b9 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 _0x0516=['/describe','describe','/:id','show','/:id/questions','post','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0xc6d0b6,_0x1b6ba9){var _0x3ea0cf=function(_0xaa3eab){while(--_0xaa3eab){_0xc6d0b6['push'](_0xc6d0b6['shift']());}};_0x3ea0cf(++_0x1b6ba9);}(_0x0516,0xb5));var _0x6051=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x0516[_0x10852d];return _0x13a8d6;};'use strict';var multer=require(_0x6051('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6051('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6051('0x2'));var auth=require(_0x6051('0x3'));var interaction=require(_0x6051('0x4'));var config=require(_0x6051('0x5'));var controller=require(_0x6051('0x6'));router[_0x6051('0x7')]('/',auth[_0x6051('0x8')](),controller['index']);router[_0x6051('0x7')](_0x6051('0x9'),auth[_0x6051('0x8')](),controller[_0x6051('0xa')]);router['get'](_0x6051('0xb'),auth[_0x6051('0x8')](),controller[_0x6051('0xc')]);router[_0x6051('0x7')](_0x6051('0xd'),auth[_0x6051('0x8')](),controller['getQuestions']);router[_0x6051('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6051('0xb'),auth[_0x6051('0x8')](),controller[_0x6051('0xf')]);router[_0x6051('0x10')](_0x6051('0xb'),auth[_0x6051('0x8')](),controller[_0x6051('0x11')]);module[_0x6051('0x12')]=router; \ No newline at end of file +var _0xcd50=['exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/questions','post','put','delete','destroy'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xcd50,0x1e7));var _0x0cd5=function(_0x1e93ae,_0x4c9a5e){_0x1e93ae=_0x1e93ae-0x0;var _0x1f9ea5=_0xcd50[_0x1e93ae];return _0x1f9ea5;};'use strict';var multer=require(_0x0cd5('0x0'));var util=require(_0x0cd5('0x1'));var path=require(_0x0cd5('0x2'));var timeout=require(_0x0cd5('0x3'));var express=require(_0x0cd5('0x4'));var router=express['Router']();var fs_extra=require(_0x0cd5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cd5('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x0cd5('0x7')]('/',auth[_0x0cd5('0x8')](),controller['index']);router['get']('/describe',auth[_0x0cd5('0x8')](),controller[_0x0cd5('0x9')]);router[_0x0cd5('0x7')](_0x0cd5('0xa'),auth[_0x0cd5('0x8')](),controller[_0x0cd5('0xb')]);router['get'](_0x0cd5('0xc'),auth[_0x0cd5('0x8')](),controller['getQuestions']);router[_0x0cd5('0xd')]('/',auth[_0x0cd5('0x8')](),controller['create']);router[_0x0cd5('0xe')](_0x0cd5('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x0cd5('0xf')](_0x0cd5('0xa'),auth['isAuthenticated'](),controller[_0x0cd5('0x10')]);module[_0x0cd5('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index e6b257d..6f3f55c 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 _0x193e=['setDataValue','starttime','endtime','format','STRING','BOOLEAN','sequelize','DATE'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x193e,0x1be));var _0xe193=function(_0x152faf,_0x4a3966){_0x152faf=_0x152faf-0x0;var _0x335b6c=_0x193e[_0x152faf];return _0x335b6c;};'use strict';var moment=require('moment');var Sequelize=require(_0xe193('0x0'));module['exports']={'starttime':{'type':Sequelize[_0xe193('0x1')],'set':function(_0x326cc3){this[_0xe193('0x2')](_0xe193('0x3'),_0x326cc3);this['setDataValue'](_0xe193('0x4'),moment()[_0xe193('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xe193('0x1')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xe193('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe193('0x6')]},'calleridname':{'type':Sequelize[_0xe193('0x6')]},'calleridnum':{'type':Sequelize[_0xe193('0x6')]},'completed':{'type':Sequelize[_0xe193('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x8c8a=['BOOLEAN','moment','sequelize','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x542730,_0x107034){var _0x5dd58a=function(_0x3c2c57){while(--_0x3c2c57){_0x542730['push'](_0x542730['shift']());}};_0x5dd58a(++_0x107034);}(_0x8c8a,0xbf));var _0xa8c8=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0x8c8a[_0x592d48];return _0x5d789e;};'use strict';var moment=require(_0xa8c8('0x0'));var Sequelize=require(_0xa8c8('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xa8c8('0x2')],'set':function(_0x3c7106){this[_0xa8c8('0x3')](_0xa8c8('0x4'),_0x3c7106);this[_0xa8c8('0x3')](_0xa8c8('0x5'),moment()[_0xa8c8('0x6')](_0xa8c8('0x7')));}},'endtime':{'type':Sequelize[_0xa8c8('0x2')]},'membername':{'type':Sequelize[_0xa8c8('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa8c8('0x8')]},'calleridname':{'type':Sequelize[_0xa8c8('0x8')]},'calleridnum':{'type':Sequelize[_0xa8c8('0x8')]},'completed':{'type':Sequelize[_0xa8c8('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 3496edf..9a487d9 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 _0x323f=['JscriptyQuestionReport','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','end','error','stack','name','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','create','body','describe','getQuestions','findOne','pick','SessionId'];(function(_0x4f6e60,_0x489974){var _0x19cc6c=function(_0x549060){while(--_0x549060){_0x4f6e60['push'](_0x4f6e60['shift']());}};_0x19cc6c(++_0x489974);}(_0x323f,0x191));var _0xf323=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x323f[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0xf323('0x0'));var rimraf=require(_0xf323('0x1'));var zipdir=require(_0xf323('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf323('0x3'));var moment=require(_0xf323('0x4'));var BPromise=require(_0xf323('0x5'));var Mustache=require(_0xf323('0x6'));var util=require(_0xf323('0x7'));var path=require(_0xf323('0x8'));var sox=require(_0xf323('0x9'));var csv=require(_0xf323('0xa'));var ejs=require(_0xf323('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf323('0xc'));var crypto=require(_0xf323('0xd'));var jsforce=require(_0xf323('0xe'));var deskjs=require(_0xf323('0xf'));var toCsv=require(_0xf323('0xa'));var querystring=require('querystring');var Papa=require(_0xf323('0x10'));var Redis=require(_0xf323('0x11'));var authService=require(_0xf323('0x12'));var qs=require(_0xf323('0x13'));var as=require(_0xf323('0x14'));var hardwareService=require(_0xf323('0x15'));var logger=require(_0xf323('0x16'))(_0xf323('0x17'));var utils=require(_0xf323('0x18'));var config=require(_0xf323('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x67f3a8,_0x161014){_0x161014=_0x161014||0xcc;return function(_0x20674e){if(_0x20674e){return _0x67f3a8[_0xf323('0x1a')](_0x161014);}return _0x67f3a8[_0xf323('0x1b')](_0x161014)['end']();};}function respondWithResult(_0x244959,_0x29ab57){_0x29ab57=_0x29ab57||0xc8;return function(_0x241579){if(_0x241579){return _0x244959[_0xf323('0x1b')](_0x29ab57)[_0xf323('0x1c')](_0x241579);}};}function respondWithFilteredResult(_0x48c1a4,_0x1b2118){return function(_0x9d8f12){if(_0x9d8f12){var _0xc38268=typeof _0x1b2118[_0xf323('0x1d')]===_0xf323('0x1e')&&typeof _0x1b2118[_0xf323('0x1f')]==='undefined';var _0x21298d=_0x9d8f12[_0xf323('0x20')];var _0x4c9e5f=_0xc38268?0x0:_0x1b2118[_0xf323('0x1d')];var _0x2f3ac6=_0xc38268?_0x9d8f12[_0xf323('0x20')]:_0x1b2118[_0xf323('0x1d')]+_0x1b2118['limit'];var _0x92d550;if(_0x2f3ac6>=_0x21298d){_0x2f3ac6=_0x21298d;_0x92d550=0xc8;}else{_0x92d550=0xce;}_0x48c1a4[_0xf323('0x1b')](_0x92d550);return _0x48c1a4['set'](_0xf323('0x21'),_0x4c9e5f+'-'+_0x2f3ac6+'/'+_0x21298d)[_0xf323('0x1c')](_0x9d8f12);}return null;};}function patchUpdates(_0x385c33){return function(_0x41c8b2){try{jsonpatch[_0xf323('0x22')](_0x41c8b2,_0x385c33,!![]);}catch(_0x2869de){return BPromise['reject'](_0x2869de);}return _0x41c8b2[_0xf323('0x23')]();};}function saveUpdates(_0xfca894,_0x172d35){return function(_0x4401f0){if(_0x4401f0){return _0x4401f0[_0xf323('0x24')](_0xfca894)['then'](function(_0x22ebe1){return _0x22ebe1;});}return null;};}function removeEntity(_0x31d442,_0x31d89d){return function(_0xea11d4){if(_0xea11d4){return _0xea11d4[_0xf323('0x25')]()[_0xf323('0x26')](function(){_0x31d442[_0xf323('0x1b')](0xcc)[_0xf323('0x27')]();});}};}function handleEntityNotFound(_0x545570,_0x36126c){return function(_0x249aca){if(!_0x249aca){_0x545570['sendStatus'](0x194);}return _0x249aca;};}function handleError(_0x5ac9af,_0x1e37ca){_0x1e37ca=_0x1e37ca||0x1f4;return function(_0x378e26){logger[_0xf323('0x28')](_0x378e26[_0xf323('0x29')]);if(_0x378e26[_0xf323('0x2a')]){delete _0x378e26[_0xf323('0x2a')];}_0x5ac9af[_0xf323('0x1b')](_0x1e37ca)['send'](_0x378e26);};}exports[_0xf323('0x2b')]=function(_0x3af589,_0x43a57d){var _0x5bfad4={},_0x29f56f={},_0x7d7cc1={'count':0x0,'rows':[]};var _0x3b5429=_[_0xf323('0x2c')](db[_0xf323('0x2d')][_0xf323('0x2e')],function(_0x20b79c){return{'name':_0x20b79c['fieldName'],'type':_0x20b79c[_0xf323('0x2f')][_0xf323('0x30')]};});_0x29f56f[_0xf323('0x31')]=_[_0xf323('0x2c')](_0x3b5429,_0xf323('0x2a'));_0x29f56f[_0xf323('0x32')]=_[_0xf323('0x33')](_0x3af589[_0xf323('0x32')]);_0x29f56f['filters']=_[_0xf323('0x34')](_0x29f56f['model'],_0x29f56f[_0xf323('0x32')]);_0x5bfad4['attributes']=_[_0xf323('0x34')](_0x29f56f['model'],qs['fields'](_0x3af589[_0xf323('0x32')][_0xf323('0x35')]));_0x5bfad4['attributes']=_0x5bfad4[_0xf323('0x36')]['length']?_0x5bfad4[_0xf323('0x36')]:_0x29f56f[_0xf323('0x31')];if(!_0x3af589[_0xf323('0x32')][_0xf323('0x37')](_0xf323('0x38'))){_0x5bfad4[_0xf323('0x1f')]=qs['limit'](_0x3af589['query'][_0xf323('0x1f')]);_0x5bfad4[_0xf323('0x1d')]=qs[_0xf323('0x1d')](_0x3af589[_0xf323('0x32')]['offset']);}_0x5bfad4[_0xf323('0x39')]=qs[_0xf323('0x3a')](_0x3af589[_0xf323('0x32')]['sort']);_0x5bfad4[_0xf323('0x3b')]=qs['filters'](_['pick'](_0x3af589[_0xf323('0x32')],_0x29f56f[_0xf323('0x3c')]),_0x3b5429);if(_0x3af589[_0xf323('0x32')][_0xf323('0x3d')]){_0x5bfad4[_0xf323('0x3b')]=_[_0xf323('0x3e')](_0x5bfad4[_0xf323('0x3b')],{'$or':_[_0xf323('0x2c')](_0x3b5429,function(_0xed689d){if(_0xed689d[_0xf323('0x2f')]!==_0xf323('0x3f')){var _0x335f12={};_0x335f12[_0xed689d[_0xf323('0x2a')]]={'$like':'%'+_0x3af589[_0xf323('0x32')][_0xf323('0x3d')]+'%'};return _0x335f12;}})});}_0x5bfad4=_[_0xf323('0x3e')]({},_0x5bfad4,_0x3af589['options']);var _0x482991={'where':_0x5bfad4['where']};return db[_0xf323('0x2d')]['count'](_0x482991)[_0xf323('0x26')](function(_0x236c3c){_0x7d7cc1[_0xf323('0x20')]=_0x236c3c;if(_0x3af589[_0xf323('0x32')]['includeAll']){_0x5bfad4['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xf323('0x40')](_0x5bfad4);})['then'](function(_0xf5c3cd){_0x7d7cc1['rows']=_0xf5c3cd;return _0x7d7cc1;})[_0xf323('0x26')](respondWithFilteredResult(_0x43a57d,_0x5bfad4))[_0xf323('0x41')](handleError(_0x43a57d,null));};exports[_0xf323('0x42')]=function(_0x2bdc88,_0x1a7f10){var _0x345e92={'raw':!![],'where':{'id':_0x2bdc88[_0xf323('0x43')]['id']}},_0x2a58b6={};_0x2a58b6['model']=_[_0xf323('0x33')](db[_0xf323('0x2d')][_0xf323('0x2e')]);_0x2a58b6[_0xf323('0x32')]=_[_0xf323('0x33')](_0x2bdc88[_0xf323('0x32')]);_0x2a58b6[_0xf323('0x3c')]=_[_0xf323('0x34')](_0x2a58b6[_0xf323('0x31')],_0x2a58b6['query']);_0x345e92[_0xf323('0x36')]=_[_0xf323('0x34')](_0x2a58b6[_0xf323('0x31')],qs['fields'](_0x2bdc88[_0xf323('0x32')][_0xf323('0x35')]));_0x345e92[_0xf323('0x36')]=_0x345e92[_0xf323('0x36')]['length']?_0x345e92[_0xf323('0x36')]:_0x2a58b6['model'];if(_0x2bdc88[_0xf323('0x32')][_0xf323('0x44')]){_0x345e92[_0xf323('0x45')]=[{'all':!![]}];}_0x345e92=_[_0xf323('0x3e')]({},_0x345e92,_0x2bdc88[_0xf323('0x46')]);return db[_0xf323('0x2d')][_0xf323('0x47')](_0x345e92)[_0xf323('0x26')](handleEntityNotFound(_0x1a7f10,null))[_0xf323('0x26')](respondWithResult(_0x1a7f10,null))[_0xf323('0x41')](handleError(_0x1a7f10,null));};exports[_0xf323('0x48')]=function(_0x552cd0,_0x4b7631){return db['JscriptySessionReport'][_0xf323('0x48')](_0x552cd0[_0xf323('0x49')],{})[_0xf323('0x26')](respondWithResult(_0x4b7631,0xc9))['catch'](handleError(_0x4b7631,null));};exports[_0xf323('0x24')]=function(_0x6b24fa,_0x2a4d6d){if(_0x6b24fa[_0xf323('0x49')]['id']){delete _0x6b24fa[_0xf323('0x49')]['id'];}return db['JscriptySessionReport'][_0xf323('0x47')]({'where':{'id':_0x6b24fa[_0xf323('0x43')]['id']}})[_0xf323('0x26')](handleEntityNotFound(_0x2a4d6d,null))[_0xf323('0x26')](saveUpdates(_0x6b24fa[_0xf323('0x49')],null))[_0xf323('0x26')](respondWithResult(_0x2a4d6d,null))[_0xf323('0x41')](handleError(_0x2a4d6d,null));};exports[_0xf323('0x25')]=function(_0x7d1954,_0x3a3b2d){return db[_0xf323('0x2d')][_0xf323('0x47')]({'where':{'id':_0x7d1954['params']['id']}})[_0xf323('0x26')](handleEntityNotFound(_0x3a3b2d,null))[_0xf323('0x26')](removeEntity(_0x3a3b2d,null))['catch'](handleError(_0x3a3b2d,null));};exports[_0xf323('0x4a')]=function(_0x5ca684,_0x51a40f){return db['JscriptySessionReport'][_0xf323('0x4a')]()[_0xf323('0x26')](respondWithResult(_0x51a40f,null))[_0xf323('0x41')](handleError(_0x51a40f,null));};exports[_0xf323('0x4b')]=function(_0x16ad47,_0x4357e8,_0xdae29){var _0x5287d5={'raw':!![],'where':{}};var _0x1209d2={};var _0x46f231={'count':0x0,'rows':[]};return db[_0xf323('0x2d')][_0xf323('0x4c')]({'where':{'id':_0x16ad47['params']['id']}})['then'](handleEntityNotFound(_0x4357e8,null))['then'](function(_0x45290a){if(_0x45290a){_0x1209d2[_0xf323('0x31')]=_[_0xf323('0x33')](db['JscriptyQuestionReport'][_0xf323('0x2e')]);_0x1209d2['query']=_[_0xf323('0x33')](_0x16ad47['query']);_0x1209d2[_0xf323('0x3c')]=_[_0xf323('0x34')](_0x1209d2[_0xf323('0x31')],_0x1209d2['query']);_0x5287d5[_0xf323('0x36')]=_[_0xf323('0x34')](_0x1209d2[_0xf323('0x31')],qs['fields'](_0x16ad47['query'][_0xf323('0x35')]));_0x5287d5['attributes']=_0x5287d5[_0xf323('0x36')]['length']?_0x5287d5[_0xf323('0x36')]:_0x1209d2['model'];if(!_0x16ad47[_0xf323('0x32')]['hasOwnProperty'](_0xf323('0x38'))){_0x5287d5[_0xf323('0x1f')]=qs[_0xf323('0x1f')](_0x16ad47[_0xf323('0x32')][_0xf323('0x1f')]);_0x5287d5[_0xf323('0x1d')]=qs[_0xf323('0x1d')](_0x16ad47[_0xf323('0x32')][_0xf323('0x1d')]);}_0x5287d5['order']=qs[_0xf323('0x3a')](_0x16ad47[_0xf323('0x32')][_0xf323('0x3a')]);_0x5287d5[_0xf323('0x3b')]=qs[_0xf323('0x3c')](_[_0xf323('0x4d')](_0x16ad47['query'],_0x1209d2['filters']));_0x5287d5[_0xf323('0x3b')][_0xf323('0x4e')]=_0x45290a['id'];if(_0x16ad47[_0xf323('0x32')]['filter']){_0x5287d5[_0xf323('0x3b')]=_[_0xf323('0x3e')](_0x5287d5['where'],{'$or':_[_0xf323('0x2c')](_0x5287d5['attributes'],function(_0x433d5a){var _0x3ef994={};_0x3ef994[_0x433d5a]={'$like':'%'+_0x16ad47[_0xf323('0x32')]['filter']+'%'};return _0x3ef994;})});}_0x5287d5=_[_0xf323('0x3e')]({},_0x5287d5,_0x16ad47['options']);return db[_0xf323('0x4f')]['count']({'where':_0x5287d5[_0xf323('0x3b')]})[_0xf323('0x26')](function(_0x3276e6){_0x46f231[_0xf323('0x20')]=_0x3276e6;if(_0x16ad47['query'][_0xf323('0x44')]){_0x5287d5[_0xf323('0x45')]=[{'all':!![]}];}return db[_0xf323('0x4f')][_0xf323('0x40')](_0x5287d5);})['then'](function(_0x1ad72d){_0x46f231['rows']=_0x1ad72d;return _0x46f231;});}})[_0xf323('0x26')](respondWithFilteredResult(_0x4357e8,_0x5287d5))[_0xf323('0x41')](handleError(_0x4357e8,null));}; \ No newline at end of file +var _0x79b9=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','show','params','rawAttributes','length','includeAll','find','catch','create','update','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','filter','findAll','rows','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','name','send','map','JscriptySessionReport'];(function(_0x42af18,_0x147924){var _0x1a37ac=function(_0x1ade82){while(--_0x1ade82){_0x42af18['push'](_0x42af18['shift']());}};_0x1a37ac(++_0x147924);}(_0x79b9,0x1a6));var _0x979b=function(_0x36a787,_0x3650ad){_0x36a787=_0x36a787-0x0;var _0x4486db=_0x79b9[_0x36a787];return _0x4486db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x979b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x979b('0x1'));var moment=require(_0x979b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x979b('0x3'));var util=require(_0x979b('0x4'));var path=require(_0x979b('0x5'));var sox=require(_0x979b('0x6'));var csv=require(_0x979b('0x7'));var ejs=require(_0x979b('0x8'));var fs=require('fs');var fs_extra=require(_0x979b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x979b('0xa'));var jsforce=require(_0x979b('0xb'));var deskjs=require(_0x979b('0xc'));var toCsv=require(_0x979b('0x7'));var querystring=require(_0x979b('0xd'));var Papa=require('papaparse');var Redis=require(_0x979b('0xe'));var authService=require(_0x979b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x979b('0x10'));var logger=require(_0x979b('0x11'))('api');var utils=require(_0x979b('0x12'));var config=require(_0x979b('0x13'));var licenseUtil=require(_0x979b('0x14'));var db=require(_0x979b('0x15'))['db'];function respondWithStatusCode(_0x4e2290,_0x42f0b3){_0x42f0b3=_0x42f0b3||0xcc;return function(_0x329793){if(_0x329793){return _0x4e2290[_0x979b('0x16')](_0x42f0b3);}return _0x4e2290[_0x979b('0x17')](_0x42f0b3)[_0x979b('0x18')]();};}function respondWithResult(_0x53eb20,_0x1bb7ca){_0x1bb7ca=_0x1bb7ca||0xc8;return function(_0x303c99){if(_0x303c99){return _0x53eb20['status'](_0x1bb7ca)[_0x979b('0x19')](_0x303c99);}};}function respondWithFilteredResult(_0x4073d2,_0x553267){return function(_0x306f35){if(_0x306f35){var _0x855fbb=typeof _0x553267[_0x979b('0x1a')]===_0x979b('0x1b')&&typeof _0x553267[_0x979b('0x1c')]==='undefined';var _0x18a70a=_0x306f35[_0x979b('0x1d')];var _0x45b6a5=_0x855fbb?0x0:_0x553267[_0x979b('0x1a')];var _0x1f5b8d=_0x855fbb?_0x306f35[_0x979b('0x1d')]:_0x553267[_0x979b('0x1a')]+_0x553267['limit'];var _0x4bbe36;if(_0x1f5b8d>=_0x18a70a){_0x1f5b8d=_0x18a70a;_0x4bbe36=0xc8;}else{_0x4bbe36=0xce;}_0x4073d2[_0x979b('0x17')](_0x4bbe36);return _0x4073d2[_0x979b('0x1e')](_0x979b('0x1f'),_0x45b6a5+'-'+_0x1f5b8d+'/'+_0x18a70a)[_0x979b('0x19')](_0x306f35);}return null;};}function patchUpdates(_0x2b3b63){return function(_0x40515d){try{jsonpatch['apply'](_0x40515d,_0x2b3b63,!![]);}catch(_0x2aba93){return BPromise['reject'](_0x2aba93);}return _0x40515d[_0x979b('0x20')]();};}function saveUpdates(_0x18b859,_0x5daca4){return function(_0x36e088){if(_0x36e088){return _0x36e088['update'](_0x18b859)[_0x979b('0x21')](function(_0x35d53d){return _0x35d53d;});}return null;};}function removeEntity(_0x2e9a20,_0x44a06b){return function(_0x486528){if(_0x486528){return _0x486528[_0x979b('0x22')]()['then'](function(){_0x2e9a20[_0x979b('0x17')](0xcc)[_0x979b('0x18')]();});}};}function handleEntityNotFound(_0x5b3d7c,_0x1e9bc7){return function(_0x2ca8c1){if(!_0x2ca8c1){_0x5b3d7c[_0x979b('0x16')](0x194);}return _0x2ca8c1;};}function handleError(_0x3c7ba1,_0x5b4379){_0x5b4379=_0x5b4379||0x1f4;return function(_0x1a44ed){logger[_0x979b('0x23')](_0x1a44ed['stack']);if(_0x1a44ed['name']){delete _0x1a44ed[_0x979b('0x24')];}_0x3c7ba1[_0x979b('0x17')](_0x5b4379)[_0x979b('0x25')](_0x1a44ed);};}exports['index']=function(_0xb5367,_0x421efc){var _0x3b0ab7={},_0x56fddd={},_0x226ce9={'count':0x0,'rows':[]};var _0x4eb2d9=_[_0x979b('0x26')](db[_0x979b('0x27')]['rawAttributes'],function(_0xefa336){return{'name':_0xefa336[_0x979b('0x28')],'type':_0xefa336[_0x979b('0x29')]['key']};});_0x56fddd[_0x979b('0x2a')]=_[_0x979b('0x26')](_0x4eb2d9,_0x979b('0x24'));_0x56fddd[_0x979b('0x2b')]=_[_0x979b('0x2c')](_0xb5367[_0x979b('0x2b')]);_0x56fddd[_0x979b('0x2d')]=_[_0x979b('0x2e')](_0x56fddd['model'],_0x56fddd[_0x979b('0x2b')]);_0x3b0ab7[_0x979b('0x2f')]=_['intersection'](_0x56fddd[_0x979b('0x2a')],qs[_0x979b('0x30')](_0xb5367[_0x979b('0x2b')][_0x979b('0x30')]));_0x3b0ab7[_0x979b('0x2f')]=_0x3b0ab7[_0x979b('0x2f')]['length']?_0x3b0ab7[_0x979b('0x2f')]:_0x56fddd[_0x979b('0x2a')];if(!_0xb5367['query'][_0x979b('0x31')](_0x979b('0x32'))){_0x3b0ab7[_0x979b('0x1c')]=qs[_0x979b('0x1c')](_0xb5367[_0x979b('0x2b')][_0x979b('0x1c')]);_0x3b0ab7[_0x979b('0x1a')]=qs[_0x979b('0x1a')](_0xb5367['query']['offset']);}_0x3b0ab7[_0x979b('0x33')]=qs[_0x979b('0x34')](_0xb5367[_0x979b('0x2b')][_0x979b('0x34')]);_0x3b0ab7[_0x979b('0x35')]=qs[_0x979b('0x2d')](_[_0x979b('0x36')](_0xb5367['query'],_0x56fddd[_0x979b('0x2d')]),_0x4eb2d9);if(_0xb5367['query']['filter']){_0x3b0ab7[_0x979b('0x35')]=_[_0x979b('0x37')](_0x3b0ab7['where'],{'$or':_['map'](_0x4eb2d9,function(_0xd921b6){if(_0xd921b6['type']!==_0x979b('0x38')){var _0x174283={};_0x174283[_0xd921b6[_0x979b('0x24')]]={'$like':'%'+_0xb5367[_0x979b('0x2b')]['filter']+'%'};return _0x174283;}})});}_0x3b0ab7=_[_0x979b('0x37')]({},_0x3b0ab7,_0xb5367[_0x979b('0x39')]);var _0xaeb97e={'where':_0x3b0ab7[_0x979b('0x35')]};return db[_0x979b('0x27')]['count'](_0xaeb97e)['then'](function(_0xb68146){_0x226ce9[_0x979b('0x1d')]=_0xb68146;if(_0xb5367[_0x979b('0x2b')]['includeAll']){_0x3b0ab7[_0x979b('0x3a')]=[{'all':!![]}];}return db[_0x979b('0x27')]['findAll'](_0x3b0ab7);})[_0x979b('0x21')](function(_0xd3185d){_0x226ce9['rows']=_0xd3185d;return _0x226ce9;})[_0x979b('0x21')](respondWithFilteredResult(_0x421efc,_0x3b0ab7))['catch'](handleError(_0x421efc,null));};exports[_0x979b('0x3b')]=function(_0x3af912,_0x2d37e4){var _0x18fdd4={'raw':!![],'where':{'id':_0x3af912[_0x979b('0x3c')]['id']}},_0x4f5e44={};_0x4f5e44[_0x979b('0x2a')]=_[_0x979b('0x2c')](db['JscriptySessionReport'][_0x979b('0x3d')]);_0x4f5e44[_0x979b('0x2b')]=_[_0x979b('0x2c')](_0x3af912[_0x979b('0x2b')]);_0x4f5e44[_0x979b('0x2d')]=_[_0x979b('0x2e')](_0x4f5e44[_0x979b('0x2a')],_0x4f5e44[_0x979b('0x2b')]);_0x18fdd4[_0x979b('0x2f')]=_['intersection'](_0x4f5e44[_0x979b('0x2a')],qs[_0x979b('0x30')](_0x3af912[_0x979b('0x2b')][_0x979b('0x30')]));_0x18fdd4[_0x979b('0x2f')]=_0x18fdd4[_0x979b('0x2f')][_0x979b('0x3e')]?_0x18fdd4[_0x979b('0x2f')]:_0x4f5e44['model'];if(_0x3af912[_0x979b('0x2b')][_0x979b('0x3f')]){_0x18fdd4[_0x979b('0x3a')]=[{'all':!![]}];}_0x18fdd4=_[_0x979b('0x37')]({},_0x18fdd4,_0x3af912[_0x979b('0x39')]);return db[_0x979b('0x27')][_0x979b('0x40')](_0x18fdd4)[_0x979b('0x21')](handleEntityNotFound(_0x2d37e4,null))[_0x979b('0x21')](respondWithResult(_0x2d37e4,null))[_0x979b('0x41')](handleError(_0x2d37e4,null));};exports['create']=function(_0x5ed3d8,_0x9698dc){return db[_0x979b('0x27')][_0x979b('0x42')](_0x5ed3d8['body'],{})[_0x979b('0x21')](respondWithResult(_0x9698dc,0xc9))[_0x979b('0x41')](handleError(_0x9698dc,null));};exports[_0x979b('0x43')]=function(_0x31b5ae,_0x570bf0){if(_0x31b5ae[_0x979b('0x44')]['id']){delete _0x31b5ae['body']['id'];}return db[_0x979b('0x27')]['find']({'where':{'id':_0x31b5ae[_0x979b('0x3c')]['id']}})[_0x979b('0x21')](handleEntityNotFound(_0x570bf0,null))['then'](saveUpdates(_0x31b5ae[_0x979b('0x44')],null))[_0x979b('0x21')](respondWithResult(_0x570bf0,null))['catch'](handleError(_0x570bf0,null));};exports[_0x979b('0x22')]=function(_0x3245e7,_0x354c72){return db['JscriptySessionReport'][_0x979b('0x40')]({'where':{'id':_0x3245e7[_0x979b('0x3c')]['id']}})[_0x979b('0x21')](handleEntityNotFound(_0x354c72,null))[_0x979b('0x21')](removeEntity(_0x354c72,null))[_0x979b('0x41')](handleError(_0x354c72,null));};exports[_0x979b('0x45')]=function(_0x30d3b8,_0x3d34c9){return db[_0x979b('0x27')]['describe']()['then'](respondWithResult(_0x3d34c9,null))['catch'](handleError(_0x3d34c9,null));};exports[_0x979b('0x46')]=function(_0x358454,_0x73ff86,_0x158873){var _0x15e6f3={'raw':!![],'where':{}};var _0x516bf5={};var _0x4f8e2c={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x979b('0x47')]({'where':{'id':_0x358454[_0x979b('0x3c')]['id']}})[_0x979b('0x21')](handleEntityNotFound(_0x73ff86,null))['then'](function(_0x1229eb){if(_0x1229eb){_0x516bf5[_0x979b('0x2a')]=_[_0x979b('0x2c')](db[_0x979b('0x48')][_0x979b('0x3d')]);_0x516bf5[_0x979b('0x2b')]=_[_0x979b('0x2c')](_0x358454['query']);_0x516bf5[_0x979b('0x2d')]=_[_0x979b('0x2e')](_0x516bf5[_0x979b('0x2a')],_0x516bf5[_0x979b('0x2b')]);_0x15e6f3['attributes']=_[_0x979b('0x2e')](_0x516bf5[_0x979b('0x2a')],qs[_0x979b('0x30')](_0x358454[_0x979b('0x2b')][_0x979b('0x30')]));_0x15e6f3[_0x979b('0x2f')]=_0x15e6f3[_0x979b('0x2f')][_0x979b('0x3e')]?_0x15e6f3[_0x979b('0x2f')]:_0x516bf5['model'];if(!_0x358454[_0x979b('0x2b')][_0x979b('0x31')](_0x979b('0x32'))){_0x15e6f3[_0x979b('0x1c')]=qs['limit'](_0x358454[_0x979b('0x2b')]['limit']);_0x15e6f3[_0x979b('0x1a')]=qs[_0x979b('0x1a')](_0x358454[_0x979b('0x2b')][_0x979b('0x1a')]);}_0x15e6f3[_0x979b('0x33')]=qs[_0x979b('0x34')](_0x358454[_0x979b('0x2b')]['sort']);_0x15e6f3[_0x979b('0x35')]=qs['filters'](_[_0x979b('0x36')](_0x358454[_0x979b('0x2b')],_0x516bf5[_0x979b('0x2d')]));_0x15e6f3[_0x979b('0x35')][_0x979b('0x49')]=_0x1229eb['id'];if(_0x358454[_0x979b('0x2b')][_0x979b('0x4a')]){_0x15e6f3[_0x979b('0x35')]=_['merge'](_0x15e6f3[_0x979b('0x35')],{'$or':_[_0x979b('0x26')](_0x15e6f3[_0x979b('0x2f')],function(_0x500e7d){var _0x4f7f9f={};_0x4f7f9f[_0x500e7d]={'$like':'%'+_0x358454[_0x979b('0x2b')][_0x979b('0x4a')]+'%'};return _0x4f7f9f;})});}_0x15e6f3=_[_0x979b('0x37')]({},_0x15e6f3,_0x358454[_0x979b('0x39')]);return db[_0x979b('0x48')]['count']({'where':_0x15e6f3['where']})[_0x979b('0x21')](function(_0x6ef2f4){_0x4f8e2c[_0x979b('0x1d')]=_0x6ef2f4;if(_0x358454[_0x979b('0x2b')]['includeAll']){_0x15e6f3[_0x979b('0x3a')]=[{'all':!![]}];}return db[_0x979b('0x48')][_0x979b('0x4b')](_0x15e6f3);})[_0x979b('0x21')](function(_0x1c82eb){_0x4f8e2c[_0x979b('0x4c')]=_0x1c82eb;return _0x4f8e2c;});}})[_0x979b('0x21')](respondWithFilteredResult(_0x73ff86,_0x15e6f3))['catch'](handleError(_0x73ff86,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 1ee489f..75153af 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 _0x7bd0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0xa9c94,_0x420fa9){var _0x587e7f=function(_0x51f83e){while(--_0x51f83e){_0xa9c94['push'](_0xa9c94['shift']());}};_0x587e7f(++_0x420fa9);}(_0x7bd0,0x111));var _0x07bd=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0x7bd0[_0x4450b1];return _0x399b0b;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));module[_0x07bd('0xa')]=function(_0x313548,_0x3e8349){return _0x313548[_0x07bd('0xb')](_0x07bd('0xc'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f9d=['define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x5ebd6e,_0x46633e){var _0x3cbde1=function(_0x5fe20e){while(--_0x5fe20e){_0x5ebd6e['push'](_0x5ebd6e['shift']());}};_0x3cbde1(++_0x46633e);}(_0x8f9d,0x93));var _0xd8f9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8f9d[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var logger=require(_0xd8f9('0x1'))('api');var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rp=require(_0xd8f9('0x4'));var fs=require('fs');var path=require(_0xd8f9('0x5'));var rimraf=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var attributes=require(_0xd8f9('0x8'));module['exports']=function(_0x1c37be,_0x24dd1e){return _0x1c37be[_0xd8f9('0x9')](_0xd8f9('0xa'),attributes,{'tableName':_0xd8f9('0xb'),'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 0e8b7b0..e57d7be 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2e12cc,_0x5d54ca){var _0x2af118=function(_0x3ec61a){while(--_0x3ec61a){_0x2e12cc['push'](_0x2e12cc['shift']());}};_0x2af118(++_0x5d54ca);}(_0x5f2f,0x73));var _0xf5f2=function(_0x347797,_0x3c1550){_0x347797=_0x347797-0x0;var _0xe0a098=_0x5f2f[_0x347797];return _0xe0a098;};'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')]('JscriptySessionReport,\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 _0x81c6=['stringify','code','error','message','info','result','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x81c6,0x1d5));var _0x681c=function(_0x3917d3,_0xab2510){_0x3917d3=_0x3917d3-0x0;var _0x36b6fa=_0x81c6[_0x3917d3];return _0x36b6fa;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 7e7b49e..9761737 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 _0x409d=['Router','../../components/auth/service','get','index','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','path','connect-timeout','express'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x409d,0xb2));var _0xd409=function(_0x31a44b,_0x5443ef){_0x31a44b=_0x31a44b-0x0;var _0x2e6a71=_0x409d[_0x31a44b];return _0x2e6a71;};'use strict';var multer=require(_0xd409('0x0'));var util=require('util');var path=require(_0xd409('0x1'));var timeout=require(_0xd409('0x2'));var express=require(_0xd409('0x3'));var router=express[_0xd409('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd409('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0xd409('0x6')]('/',controller[_0xd409('0x7')]);router['put'](_0xd409('0x8'),auth[_0xd409('0x9')](),controller[_0xd409('0xa')]);router[_0xd409('0x6')](_0xd409('0xb'),auth[_0xd409('0x9')](),controller[_0xd409('0xc')]);module[_0xd409('0xd')]=router; \ No newline at end of file +var _0x8692=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','update','/download_log_file','exports','util','path','connect-timeout','express'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x8692,0xbf));var _0x2869=function(_0x25b0c9,_0x598bcf){_0x25b0c9=_0x25b0c9-0x0;var _0x43885f=_0x8692[_0x25b0c9];return _0x43885f;};'use strict';var multer=require('multer');var util=require(_0x2869('0x0'));var path=require(_0x2869('0x1'));var timeout=require(_0x2869('0x2'));var express=require(_0x2869('0x3'));var router=express[_0x2869('0x4')]();var fs_extra=require(_0x2869('0x5'));var auth=require(_0x2869('0x6'));var interaction=require(_0x2869('0x7'));var config=require(_0x2869('0x8'));var controller=require('./license.controller');router[_0x2869('0x9')]('/',controller[_0x2869('0xa')]);router['put']('/:id',auth[_0x2869('0xb')](),controller[_0x2869('0xc')]);router[_0x2869('0x9')](_0x2869('0xd'),auth[_0x2869('0xb')](),controller['downloadLogFile']);module[_0x2869('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 3293572..95d1c73 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 _0xa868=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x2a70ae,_0x8c97c5){var _0x9043f2=function(_0x59a687){while(--_0x59a687){_0x2a70ae['push'](_0x2a70ae['shift']());}};_0x9043f2(++_0x8c97c5);}(_0xa868,0x1d9));var _0x8a86=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xa868[_0x1eda20];return _0x31b953;};'use strict';var Sequelize=require(_0x8a86('0x0'));module[_0x8a86('0x1')]={'license':{'type':Sequelize[_0x8a86('0x2')]},'data1':{'type':Sequelize[_0x8a86('0x3')]},'data2':{'type':Sequelize[_0x8a86('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x8a86('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x75c1=['TEXT','STRING','INTEGER','sequelize'];(function(_0x258a29,_0x309152){var _0x49261b=function(_0x5e897a){while(--_0x5e897a){_0x258a29['push'](_0x258a29['shift']());}};_0x49261b(++_0x309152);}(_0x75c1,0x1a3));var _0x175c=function(_0x49c792,_0x45bd7d){_0x49c792=_0x49c792-0x0;var _0x2ca401=_0x75c1[_0x49c792];return _0x2ca401;};'use strict';var Sequelize=require(_0x175c('0x0'));module['exports']={'license':{'type':Sequelize[_0x175c('0x1')]},'data1':{'type':Sequelize[_0x175c('0x2')]},'data2':{'type':Sequelize[_0x175c('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x175c('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 02d2cae..1fdd3c9 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 _0x6ff7=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','../../config/license/util','index','model','query','filters','attributes','intersection','fields','length','merge','options','getLicense','catch','body','License','find','params','get','key','demo','downloadLogFile','/var','log','xcally','setHeader','Content-Type','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x2441e8,_0x1041ec){var _0x3617ff=function(_0x271d26){while(--_0x271d26){_0x2441e8['push'](_0x2441e8['shift']());}};_0x3617ff(++_0x1041ec);}(_0x6ff7,0x19d));var _0x76ff=function(_0x139664,_0x4c9fd2){_0x139664=_0x139664-0x0;var _0x2c2c39=_0x6ff7[_0x139664];return _0x2c2c39;};'use strict';var emlformat=require(_0x76ff('0x0'));var rimraf=require(_0x76ff('0x1'));var zipdir=require(_0x76ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76ff('0x3'));var moment=require(_0x76ff('0x4'));var BPromise=require(_0x76ff('0x5'));var Mustache=require(_0x76ff('0x6'));var util=require(_0x76ff('0x7'));var path=require(_0x76ff('0x8'));var sox=require(_0x76ff('0x9'));var csv=require(_0x76ff('0xa'));var ejs=require(_0x76ff('0xb'));var fs=require('fs');var fs_extra=require(_0x76ff('0xc'));var _=require(_0x76ff('0xd'));var squel=require(_0x76ff('0xe'));var crypto=require(_0x76ff('0xf'));var jsforce=require(_0x76ff('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x76ff('0xa'));var querystring=require(_0x76ff('0x11'));var Papa=require(_0x76ff('0x12'));var Redis=require(_0x76ff('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x76ff('0x14'));var hardwareService=require(_0x76ff('0x15'));var logger=require(_0x76ff('0x16'))('api');var utils=require(_0x76ff('0x17'));var config=require(_0x76ff('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x76ff('0x19'))['db'];function respondWithStatusCode(_0xd44624,_0x3ab2c7){_0x3ab2c7=_0x3ab2c7||0xcc;return function(_0x5dd8c9){if(_0x5dd8c9){return _0xd44624['sendStatus'](_0x3ab2c7);}return _0xd44624['status'](_0x3ab2c7)[_0x76ff('0x1a')]();};}function respondWithResult(_0x5d60cb,_0x5087d1){_0x5087d1=_0x5087d1||0xc8;return function(_0x21e22f){if(_0x21e22f){return _0x5d60cb[_0x76ff('0x1b')](_0x5087d1)[_0x76ff('0x1c')](_0x21e22f);}};}function respondWithFilteredResult(_0x297926,_0x285c33){return function(_0xa8fba9){if(_0xa8fba9){var _0xc5faab=typeof _0x285c33[_0x76ff('0x1d')]===_0x76ff('0x1e')&&typeof _0x285c33[_0x76ff('0x1f')]===_0x76ff('0x1e');var _0x1cf114=_0xa8fba9[_0x76ff('0x20')];var _0x23f036=_0xc5faab?0x0:_0x285c33[_0x76ff('0x1d')];var _0x513ae8=_0xc5faab?_0xa8fba9[_0x76ff('0x20')]:_0x285c33[_0x76ff('0x1d')]+_0x285c33[_0x76ff('0x1f')];var _0x2672fb;if(_0x513ae8>=_0x1cf114){_0x513ae8=_0x1cf114;_0x2672fb=0xc8;}else{_0x2672fb=0xce;}_0x297926[_0x76ff('0x1b')](_0x2672fb);return _0x297926[_0x76ff('0x21')](_0x76ff('0x22'),_0x23f036+'-'+_0x513ae8+'/'+_0x1cf114)[_0x76ff('0x1c')](_0xa8fba9);}return null;};}function patchUpdates(_0x6479f9){return function(_0x858893){try{jsonpatch[_0x76ff('0x23')](_0x858893,_0x6479f9,!![]);}catch(_0x17be7b){return BPromise[_0x76ff('0x24')](_0x17be7b);}return _0x858893[_0x76ff('0x25')]();};}function saveUpdates(_0x20f2dd,_0x2da2c4){return function(_0x13d930){if(_0x13d930){return _0x13d930[_0x76ff('0x26')](_0x20f2dd)[_0x76ff('0x27')](function(_0x2263f7){return _0x2263f7;});}return null;};}function removeEntity(_0x23f822,_0x3a98b){return function(_0x2b5f82){if(_0x2b5f82){return _0x2b5f82[_0x76ff('0x28')]()[_0x76ff('0x27')](function(){_0x23f822['status'](0xcc)[_0x76ff('0x1a')]();});}};}function handleEntityNotFound(_0x48df6e,_0x1e8685){return function(_0x5b5fc0){if(!_0x5b5fc0){_0x48df6e[_0x76ff('0x29')](0x194);}return _0x5b5fc0;};}function handleError(_0x2f1fa7,_0x1dd94a){_0x1dd94a=_0x1dd94a||0x1f4;return function(_0x5aa149){logger[_0x76ff('0x2a')](_0x5aa149[_0x76ff('0x2b')]);if(_0x5aa149['name']){delete _0x5aa149[_0x76ff('0x2c')];}_0x2f1fa7['status'](_0x1dd94a)[_0x76ff('0x2d')](_0x5aa149);};}var utilLicense=require(_0x76ff('0x2e'));exports[_0x76ff('0x2f')]=function(_0x396e9b,_0x23943){var _0x1a40f9={'raw':!![],'where':{'id':0x1}},_0x291bc9={};_0x291bc9[_0x76ff('0x30')]=_['keys'](db['License']['rawAttributes']);_0x291bc9[_0x76ff('0x31')]=_['keys'](_0x396e9b[_0x76ff('0x31')]);_0x291bc9[_0x76ff('0x32')]=_['intersection'](_0x291bc9['model'],_0x291bc9['query']);_0x1a40f9[_0x76ff('0x33')]=_[_0x76ff('0x34')](_0x291bc9[_0x76ff('0x30')],qs['fields'](_0x396e9b[_0x76ff('0x31')][_0x76ff('0x35')]));_0x1a40f9[_0x76ff('0x33')]=_0x1a40f9[_0x76ff('0x33')][_0x76ff('0x36')]?_0x1a40f9['attributes']:_0x291bc9['model'];_0x1a40f9=_[_0x76ff('0x37')]({},_0x1a40f9,_0x396e9b[_0x76ff('0x38')]);return utilLicense[_0x76ff('0x39')](_0x1a40f9)['then'](respondWithResult(_0x23943,null))[_0x76ff('0x3a')](handleError(_0x23943,null));};exports[_0x76ff('0x26')]=function(_0x415810,_0x37db3e){if(_0x415810[_0x76ff('0x3b')]['id']){delete _0x415810[_0x76ff('0x3b')]['id'];}return db[_0x76ff('0x3c')][_0x76ff('0x3d')]({'where':{'id':_0x415810[_0x76ff('0x3e')]['id']}})[_0x76ff('0x27')](handleEntityNotFound(_0x37db3e,null))[_0x76ff('0x27')](function(_0x2ce7fc){var _0x232946=_0x2ce7fc[_0x76ff('0x3f')]({'plain':!![]});return utilLicense['checkLicense'](_0x232946,_0x415810[_0x76ff('0x3b')][_0x76ff('0x40')]);})[_0x76ff('0x27')](function(_0x3e166e){if(!_0x3e166e[_0x76ff('0x41')]){return saveUpdates(_0x415810[_0x76ff('0x3b')],null);}return _0x3e166e;})[_0x76ff('0x27')](respondWithResult(_0x37db3e,null))['catch'](handleError(_0x37db3e,null));};exports[_0x76ff('0x42')]=function(_0x5ca826,_0x3a8813){var _0x56ddb6='license-info.log';var _0x2e78f2=path['join'](_0x76ff('0x43'),_0x76ff('0x44'),_0x76ff('0x45'),_0x56ddb6);_0x3a8813[_0x76ff('0x46')]('Content-disposition','attachment;\x20filename='+_0x56ddb6);_0x3a8813[_0x76ff('0x21')](_0x76ff('0x47'),'text/plain');_0x3a8813['download'](_0x2e78f2);}; \ No newline at end of file +var _0x9c10=['request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','catch','body','params','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch'];(function(_0x548ccb,_0x1fab15){var _0x2f7701=function(_0x92da09){while(--_0x92da09){_0x548ccb['push'](_0x548ccb['shift']());}};_0x2f7701(++_0x1fab15);}(_0x9c10,0x1a7));var _0x09c1=function(_0xb41555,_0x1dd63e){_0xb41555=_0xb41555-0x0;var _0x5b2406=_0x9c10[_0xb41555];return _0x5b2406;};'use strict';var emlformat=require(_0x09c1('0x0'));var rimraf=require(_0x09c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09c1('0x2'));var rp=require(_0x09c1('0x3'));var moment=require(_0x09c1('0x4'));var BPromise=require(_0x09c1('0x5'));var Mustache=require('mustache');var util=require(_0x09c1('0x6'));var path=require(_0x09c1('0x7'));var sox=require(_0x09c1('0x8'));var csv=require('to-csv');var ejs=require(_0x09c1('0x9'));var fs=require('fs');var fs_extra=require(_0x09c1('0xa'));var _=require(_0x09c1('0xb'));var squel=require(_0x09c1('0xc'));var crypto=require('crypto');var jsforce=require(_0x09c1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x09c1('0xe'));var Papa=require(_0x09c1('0xf'));var Redis=require('ioredis');var authService=require(_0x09c1('0x10'));var qs=require(_0x09c1('0x11'));var as=require(_0x09c1('0x12'));var hardwareService=require(_0x09c1('0x13'));var logger=require(_0x09c1('0x14'))(_0x09c1('0x15'));var utils=require(_0x09c1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x09c1('0x17'));var db=require(_0x09c1('0x18'))['db'];function respondWithStatusCode(_0x5cccf2,_0x392907){_0x392907=_0x392907||0xcc;return function(_0x375bab){if(_0x375bab){return _0x5cccf2['sendStatus'](_0x392907);}return _0x5cccf2[_0x09c1('0x19')](_0x392907)[_0x09c1('0x1a')]();};}function respondWithResult(_0x38dd39,_0x2a3083){_0x2a3083=_0x2a3083||0xc8;return function(_0x3b8ec1){if(_0x3b8ec1){return _0x38dd39[_0x09c1('0x19')](_0x2a3083)['json'](_0x3b8ec1);}};}function respondWithFilteredResult(_0x4e280f,_0x4e1bb0){return function(_0x4e059a){if(_0x4e059a){var _0x37e3a2=typeof _0x4e1bb0[_0x09c1('0x1b')]===_0x09c1('0x1c')&&typeof _0x4e1bb0[_0x09c1('0x1d')]===_0x09c1('0x1c');var _0x318838=_0x4e059a[_0x09c1('0x1e')];var _0xb8125d=_0x37e3a2?0x0:_0x4e1bb0[_0x09c1('0x1b')];var _0x2795e1=_0x37e3a2?_0x4e059a[_0x09c1('0x1e')]:_0x4e1bb0[_0x09c1('0x1b')]+_0x4e1bb0[_0x09c1('0x1d')];var _0x5766b9;if(_0x2795e1>=_0x318838){_0x2795e1=_0x318838;_0x5766b9=0xc8;}else{_0x5766b9=0xce;}_0x4e280f[_0x09c1('0x19')](_0x5766b9);return _0x4e280f[_0x09c1('0x1f')]('Content-Range',_0xb8125d+'-'+_0x2795e1+'/'+_0x318838)[_0x09c1('0x20')](_0x4e059a);}return null;};}function patchUpdates(_0x3accb3){return function(_0x4f1205){try{jsonpatch[_0x09c1('0x21')](_0x4f1205,_0x3accb3,!![]);}catch(_0x436cc3){return BPromise[_0x09c1('0x22')](_0x436cc3);}return _0x4f1205[_0x09c1('0x23')]();};}function saveUpdates(_0x58070e,_0x4f908d){return function(_0x59e7fe){if(_0x59e7fe){return _0x59e7fe[_0x09c1('0x24')](_0x58070e)['then'](function(_0x19fe06){return _0x19fe06;});}return null;};}function removeEntity(_0xb9c69,_0x954815){return function(_0x10beda){if(_0x10beda){return _0x10beda[_0x09c1('0x25')]()[_0x09c1('0x26')](function(){_0xb9c69[_0x09c1('0x19')](0xcc)[_0x09c1('0x1a')]();});}};}function handleEntityNotFound(_0xe7be25,_0x47d794){return function(_0x91874e){if(!_0x91874e){_0xe7be25[_0x09c1('0x27')](0x194);}return _0x91874e;};}function handleError(_0x384a8a,_0x1a8acb){_0x1a8acb=_0x1a8acb||0x1f4;return function(_0x4bc1dc){logger[_0x09c1('0x28')](_0x4bc1dc['stack']);if(_0x4bc1dc[_0x09c1('0x29')]){delete _0x4bc1dc[_0x09c1('0x29')];}_0x384a8a[_0x09c1('0x19')](_0x1a8acb)[_0x09c1('0x2a')](_0x4bc1dc);};}var utilLicense=require('../../config/license/util');exports[_0x09c1('0x2b')]=function(_0x174ed7,_0x5d9961){var _0x1e75ca={'raw':!![],'where':{'id':0x1}},_0x558213={};_0x558213[_0x09c1('0x2c')]=_[_0x09c1('0x2d')](db[_0x09c1('0x2e')][_0x09c1('0x2f')]);_0x558213[_0x09c1('0x30')]=_[_0x09c1('0x2d')](_0x174ed7[_0x09c1('0x30')]);_0x558213[_0x09c1('0x31')]=_[_0x09c1('0x32')](_0x558213[_0x09c1('0x2c')],_0x558213[_0x09c1('0x30')]);_0x1e75ca['attributes']=_[_0x09c1('0x32')](_0x558213[_0x09c1('0x2c')],qs[_0x09c1('0x33')](_0x174ed7[_0x09c1('0x30')][_0x09c1('0x33')]));_0x1e75ca[_0x09c1('0x34')]=_0x1e75ca['attributes'][_0x09c1('0x35')]?_0x1e75ca[_0x09c1('0x34')]:_0x558213[_0x09c1('0x2c')];_0x1e75ca=_['merge']({},_0x1e75ca,_0x174ed7['options']);return utilLicense['getLicense'](_0x1e75ca)['then'](respondWithResult(_0x5d9961,null))[_0x09c1('0x36')](handleError(_0x5d9961,null));};exports[_0x09c1('0x24')]=function(_0x37c4b8,_0x4cf4ec){if(_0x37c4b8['body']['id']){delete _0x37c4b8[_0x09c1('0x37')]['id'];}return db[_0x09c1('0x2e')]['find']({'where':{'id':_0x37c4b8[_0x09c1('0x38')]['id']}})[_0x09c1('0x26')](handleEntityNotFound(_0x4cf4ec,null))[_0x09c1('0x26')](function(_0x1c7e7f){var _0x562151=_0x1c7e7f[_0x09c1('0x39')]({'plain':!![]});return utilLicense[_0x09c1('0x3a')](_0x562151,_0x37c4b8[_0x09c1('0x37')][_0x09c1('0x3b')]);})[_0x09c1('0x26')](function(_0x4a7c76){if(!_0x4a7c76['demo']){return saveUpdates(_0x37c4b8[_0x09c1('0x37')],null);}return _0x4a7c76;})[_0x09c1('0x26')](respondWithResult(_0x4cf4ec,null))[_0x09c1('0x36')](handleError(_0x4cf4ec,null));};exports[_0x09c1('0x3c')]=function(_0x580424,_0xe2716c){var _0x1198b3=_0x09c1('0x3d');var _0x1b914b=path[_0x09c1('0x3e')](_0x09c1('0x3f'),_0x09c1('0x40'),'xcally',_0x1198b3);_0xe2716c[_0x09c1('0x41')](_0x09c1('0x42'),_0x09c1('0x43')+_0x1198b3);_0xe2716c[_0x09c1('0x1f')](_0x09c1('0x44'),_0x09c1('0x45'));_0xe2716c[_0x09c1('0x46')](_0x1b914b);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 24976ec..573ad75 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 _0xb749=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','exports','License','license'];(function(_0xc6b69,_0x13f2e6){var _0x1d859e=function(_0x63cd09){while(--_0x63cd09){_0xc6b69['push'](_0xc6b69['shift']());}};_0x1d859e(++_0x13f2e6);}(_0xb749,0xe4));var _0x9b74=function(_0x2c227b,_0x2ff5ee){_0x2c227b=_0x2c227b-0x0;var _0x30410b=_0xb749[_0x2c227b];return _0x30410b;};'use strict';var _=require('lodash');var util=require(_0x9b74('0x0'));var logger=require(_0x9b74('0x1'))(_0x9b74('0x2'));var moment=require(_0x9b74('0x3'));var BPromise=require(_0x9b74('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b74('0x5'));var rimraf=require(_0x9b74('0x6'));var config=require(_0x9b74('0x7'));var attributes=require(_0x9b74('0x8'));module[_0x9b74('0x9')]=function(_0x412728,_0x28ade9){return _0x412728['define'](_0x9b74('0xa'),attributes,{'tableName':_0x9b74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fa3=['rimraf','exports','define','License','license','lodash','util','api','moment','bluebird','request-promise'];(function(_0xd86794,_0x678771){var _0x4dd2ce=function(_0x194dac){while(--_0x194dac){_0xd86794['push'](_0xd86794['shift']());}};_0x4dd2ce(++_0x678771);}(_0x0fa3,0x1e9));var _0x30fa=function(_0x198fc6,_0x5eaee9){_0x198fc6=_0x198fc6-0x0;var _0x4376bb=_0x0fa3[_0x198fc6];return _0x4376bb;};'use strict';var _=require(_0x30fa('0x0'));var util=require(_0x30fa('0x1'));var logger=require('../../config/logger')(_0x30fa('0x2'));var moment=require(_0x30fa('0x3'));var BPromise=require(_0x30fa('0x4'));var rp=require(_0x30fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30fa('0x6'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0x30fa('0x7')]=function(_0x17bd30,_0x437439){return _0x17bd30[_0x30fa('0x8')](_0x30fa('0x9'),attributes,{'tableName':_0x30fa('0xa'),'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 1a8cdf5..7970234 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 _0x26a5=['request','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3cb199,_0xb9b38){var _0x427adb=function(_0x429300){while(--_0x429300){_0x3cb199['push'](_0x3cb199['shift']());}};_0x427adb(++_0xb9b38);}(_0x26a5,0x122));var _0x526a=function(_0x2b6960,_0x231952){_0x2b6960=_0x2b6960-0x0;var _0x3cf4e7=_0x26a5[_0x2b6960];return _0x3cf4e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x526a('0x0'));var rs=require(_0x526a('0x1'));var fs=require('fs');var Redis=require(_0x526a('0x2'));var db=require(_0x526a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x526a('0x4'))(_0x526a('0x5'));var config=require(_0x526a('0x6'));var jayson=require(_0x526a('0x7'));var client=jayson[_0x526a('0x8')][_0x526a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x495aee,_0x1a83c8,_0x8efe30){return new BPromise(function(_0x116cd1,_0x3f46cf){return client[_0x526a('0xa')](_0x495aee,_0x8efe30)['then'](function(_0x3fb992){logger[_0x526a('0xb')](_0x526a('0xc'),_0x1a83c8,_0x526a('0xd'));logger[_0x526a('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x1a83c8,'request\x20sent',JSON[_0x526a('0xf')](_0x3fb992));if(_0x3fb992[_0x526a('0x10')]){if(_0x3fb992[_0x526a('0x10')]['code']===0x1f4){logger['error'](_0x526a('0xc'),_0x1a83c8,_0x3fb992[_0x526a('0x10')][_0x526a('0x11')]);return _0x3f46cf(_0x3fb992[_0x526a('0x10')][_0x526a('0x11')]);}logger[_0x526a('0x10')]('License,\x20%s,\x20%s',_0x1a83c8,_0x3fb992['error'][_0x526a('0x11')]);return _0x116cd1(_0x3fb992[_0x526a('0x10')]['message']);}else{logger['info'](_0x526a('0xc'),_0x1a83c8,_0x526a('0xd'));_0x116cd1(_0x3fb992[_0x526a('0x12')][_0x526a('0x11')]);}})[_0x526a('0x13')](function(_0x2e3602){logger['error'](_0x526a('0xc'),_0x1a83c8,_0x2e3602);_0x3f46cf(_0x2e3602);});});} \ No newline at end of file +var _0x620e=['http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x17bbed,_0x14942c){var _0x526358=function(_0x213f53){while(--_0x213f53){_0x17bbed['push'](_0x17bbed['shift']());}};_0x526358(++_0x14942c);}(_0x620e,0x80));var _0xe620=function(_0x874bde,_0x14c3ec){_0x874bde=_0x874bde-0x0;var _0x2742a4=_0x620e[_0x874bde];return _0x2742a4;};'use strict';var _=require(_0xe620('0x0'));var util=require(_0xe620('0x1'));var moment=require(_0xe620('0x2'));var BPromise=require('bluebird');var rs=require(_0xe620('0x3'));var fs=require('fs');var Redis=require(_0xe620('0x4'));var db=require(_0xe620('0x5'))['db'];var utils=require(_0xe620('0x6'));var logger=require(_0xe620('0x7'))('rpc');var config=require(_0xe620('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe620('0x9')][_0xe620('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e83ab,_0x52ae9c,_0x2101f5){return new BPromise(function(_0x609143,_0x271bfb){return client[_0xe620('0xb')](_0x4e83ab,_0x2101f5)[_0xe620('0xc')](function(_0x4251cd){logger[_0xe620('0xd')]('License,\x20%s,\x20%s',_0x52ae9c,'request\x20sent');logger[_0xe620('0xe')](_0xe620('0xf'),_0x52ae9c,_0xe620('0x10'),JSON[_0xe620('0x11')](_0x4251cd));if(_0x4251cd['error']){if(_0x4251cd[_0xe620('0x12')]['code']===0x1f4){logger[_0xe620('0x12')](_0xe620('0x13'),_0x52ae9c,_0x4251cd[_0xe620('0x12')][_0xe620('0x14')]);return _0x271bfb(_0x4251cd[_0xe620('0x12')][_0xe620('0x14')]);}logger['error'](_0xe620('0x13'),_0x52ae9c,_0x4251cd[_0xe620('0x12')][_0xe620('0x14')]);return _0x609143(_0x4251cd[_0xe620('0x12')][_0xe620('0x14')]);}else{logger['info'](_0xe620('0x13'),_0x52ae9c,_0xe620('0x10'));_0x609143(_0x4251cd[_0xe620('0x15')][_0xe620('0x14')]);}})[_0xe620('0x16')](function(_0x1878f1){logger[_0xe620('0x12')](_0xe620('0x13'),_0x52ae9c,_0x1878f1);_0x271bfb(_0x1878f1);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index a5b08c5..0a85de2 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 _0x155b=['addImap','/:id/out_servers','addInteraction','/:id/applications','addApplications','/:id/send','send','update','removeAnswers','removeImap','delete','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x155b,0x1da));var _0xb155=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x155b[_0x43c8b8];return _0x413be3;};'use strict';var multer=require(_0xb155('0x0'));var util=require(_0xb155('0x1'));var path=require(_0xb155('0x2'));var timeout=require(_0xb155('0x3'));var express=require(_0xb155('0x4'));var router=express['Router']();var fs_extra=require(_0xb155('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb155('0x6'));var config=require(_0xb155('0x7'));var controller=require(_0xb155('0x8'));router[_0xb155('0x9')]('/',auth[_0xb155('0xa')](),controller[_0xb155('0xb')]);router['get'](_0xb155('0xc'),auth[_0xb155('0xa')](),controller[_0xb155('0xd')]);router[_0xb155('0x9')](_0xb155('0xe'),auth['isAuthenticated'](),controller[_0xb155('0xf')]);router[_0xb155('0x9')]('/:id/dispositions',auth[_0xb155('0xa')](),controller['getDispositions']);router[_0xb155('0x9')](_0xb155('0x10'),auth[_0xb155('0xa')](),controller[_0xb155('0x11')]);router[_0xb155('0x9')](_0xb155('0x12'),auth['isAuthenticated'](),controller['getImap']);router[_0xb155('0x9')]('/:id/out_servers',auth[_0xb155('0xa')](),controller[_0xb155('0x13')]);router[_0xb155('0x9')](_0xb155('0x14'),auth[_0xb155('0xa')](),controller[_0xb155('0x15')]);router[_0xb155('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router['get'](_0xb155('0x16'),auth[_0xb155('0xa')](),controller[_0xb155('0x17')]);router['get'](_0xb155('0x18'),auth[_0xb155('0xa')](),controller[_0xb155('0x19')]);router['get'](_0xb155('0x1a'),auth[_0xb155('0xa')](),controller[_0xb155('0x1b')]);router[_0xb155('0x1c')](_0xb155('0x1d'),auth[_0xb155('0xa')](),controller[_0xb155('0x1e')]);router[_0xb155('0x1c')]('/:id/canned_answers',auth[_0xb155('0xa')](),controller['addAnswer']);router[_0xb155('0x1c')]('/',auth['isAuthenticated'](),controller[_0xb155('0x1f')]);router[_0xb155('0x1c')](_0xb155('0x12'),auth[_0xb155('0xa')](),controller[_0xb155('0x20')]);router[_0xb155('0x1c')](_0xb155('0x21'),auth['isAuthenticated'](),controller['addSmtp']);router[_0xb155('0x1c')](_0xb155('0x14'),auth['isAuthenticated'](),controller[_0xb155('0x22')]);router[_0xb155('0x1c')](_0xb155('0x23'),auth[_0xb155('0xa')](),controller[_0xb155('0x24')]);router[_0xb155('0x1c')](_0xb155('0x25'),auth[_0xb155('0xa')](),controller[_0xb155('0x26')]);router[_0xb155('0x1c')](_0xb155('0x1a'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xb155('0xe'),auth[_0xb155('0xa')](),controller[_0xb155('0x27')]);router['delete'](_0xb155('0x1d'),auth[_0xb155('0xa')](),controller['removeDispositions']);router['delete'](_0xb155('0x10'),auth[_0xb155('0xa')](),controller[_0xb155('0x28')]);router['delete'](_0xb155('0x12'),auth[_0xb155('0xa')](),controller[_0xb155('0x29')]);router[_0xb155('0x2a')](_0xb155('0x21'),auth['isAuthenticated'](),controller[_0xb155('0x2b')]);router[_0xb155('0x2a')](_0xb155('0xe'),auth[_0xb155('0xa')](),controller[_0xb155('0x2c')]);router[_0xb155('0x2a')](_0xb155('0x1a'),auth[_0xb155('0xa')](),controller[_0xb155('0x2d')]);module['exports']=router; \ No newline at end of file +var _0x450d=['getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','/:id/dispositions','addDisposition','addImap','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeImap','removeSmtp','/:id','destroy','removeAgents','exports','multer','util','connect-timeout','../../components/interaction/service','./mailAccount.controller','isAuthenticated','get','describe','show','/:id/canned_answers'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x450d,0x74));var _0xd450=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x450d[_0x369151];return _0x4292d5;};'use strict';var multer=require(_0xd450('0x0'));var util=require(_0xd450('0x1'));var path=require('path');var timeout=require(_0xd450('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd450('0x3'));var config=require('../../config/environment');var controller=require(_0xd450('0x4'));router['get']('/',auth[_0xd450('0x5')](),controller['index']);router[_0xd450('0x6')]('/describe',auth[_0xd450('0x5')](),controller[_0xd450('0x7')]);router[_0xd450('0x6')]('/:id',auth[_0xd450('0x5')](),controller[_0xd450('0x8')]);router[_0xd450('0x6')]('/:id/dispositions',auth[_0xd450('0x5')](),controller['getDispositions']);router[_0xd450('0x6')](_0xd450('0x9'),auth[_0xd450('0x5')](),controller[_0xd450('0xa')]);router[_0xd450('0x6')](_0xd450('0xb'),auth[_0xd450('0x5')](),controller['getImap']);router['get'](_0xd450('0xc'),auth[_0xd450('0x5')](),controller[_0xd450('0xd')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0xd450('0xe')]);router[_0xd450('0x6')](_0xd450('0xf'),auth[_0xd450('0x5')](),controller[_0xd450('0x10')]);router['get'](_0xd450('0x11'),auth['isAuthenticated'](),controller[_0xd450('0x12')]);router[_0xd450('0x6')](_0xd450('0x13'),auth[_0xd450('0x5')](),controller[_0xd450('0x14')]);router[_0xd450('0x6')]('/:id/users',auth[_0xd450('0x5')](),controller[_0xd450('0x15')]);router[_0xd450('0x16')](_0xd450('0x17'),auth[_0xd450('0x5')](),controller[_0xd450('0x18')]);router[_0xd450('0x16')](_0xd450('0x9'),auth[_0xd450('0x5')](),controller['addAnswer']);router[_0xd450('0x16')]('/',auth[_0xd450('0x5')](),controller['create']);router[_0xd450('0x16')](_0xd450('0xb'),auth['isAuthenticated'](),controller[_0xd450('0x19')]);router['post'](_0xd450('0xc'),auth['isAuthenticated'](),controller['addSmtp']);router[_0xd450('0x16')](_0xd450('0x1a'),auth[_0xd450('0x5')](),controller[_0xd450('0x1b')]);router[_0xd450('0x16')](_0xd450('0xf'),auth[_0xd450('0x5')](),controller[_0xd450('0x1c')]);router['post'](_0xd450('0x1d'),auth[_0xd450('0x5')](),controller[_0xd450('0x1e')]);router[_0xd450('0x16')]('/:id/users',auth[_0xd450('0x5')](),controller[_0xd450('0x1f')]);router[_0xd450('0x20')]('/:id',auth[_0xd450('0x5')](),controller[_0xd450('0x21')]);router[_0xd450('0x22')](_0xd450('0x17'),auth[_0xd450('0x5')](),controller[_0xd450('0x23')]);router['delete'](_0xd450('0x9'),auth[_0xd450('0x5')](),controller['removeAnswers']);router[_0xd450('0x22')]('/:id/in_servers',auth[_0xd450('0x5')](),controller[_0xd450('0x24')]);router[_0xd450('0x22')]('/:id/out_servers',auth[_0xd450('0x5')](),controller[_0xd450('0x25')]);router[_0xd450('0x22')](_0xd450('0x26'),auth[_0xd450('0x5')](),controller[_0xd450('0x27')]);router[_0xd450('0x22')]('/:id/users',auth[_0xd450('0x5')](),controller[_0xd450('0x28')]);module[_0xd450('0x29')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 80fc6e5..ae3828d 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 _0x0b06=['provider','custom','sequelize','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue'];(function(_0x17b351,_0x4c9601){var _0x2fad30=function(_0x4cb3ca){while(--_0x4cb3ca){_0x17b351['push'](_0x17b351['shift']());}};_0x2fad30(++_0x4c9601);}(_0x0b06,0xf2));var _0x60b0=function(_0x58f870,_0x481681){_0x58f870=_0x58f870-0x0;var _0x924de0=_0x0b06[_0x58f870];return _0x924de0;};'use strict';var Sequelize=require(_0x60b0('0x0'));module[_0x60b0('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x60b0('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x60b0('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x60b0('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x60b0('0x4')]},'markAsUnread':{'type':Sequelize[_0x60b0('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x60b0('0x3')],'allowNull':![],'defaultValue':_0x60b0('0x5')},'fontSize':{'type':Sequelize[_0x60b0('0x6')](0x2)[_0x60b0('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x60b0('0x8');}},'notificationSound':{'type':Sequelize[_0x60b0('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x60b0('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x60b0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x60b0('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x60b0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x60b0('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x60b0('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x60b0('0x2')],'defaultValue':![],'comment':_0x60b0('0x9'),'set':function(_0x558e6c){if(!_0x558e6c)this[_0x60b0('0xa')](_0x60b0('0xb'),null);this['setDataValue'](_0x60b0('0xc'),_0x558e6c);}},'provider':{'type':Sequelize[_0x60b0('0xd')](_0x60b0('0xe'),_0x60b0('0xf'),'yahoo',_0x60b0('0x10')),'defaultValue':null,'get':function(){if(!this[_0x60b0('0x11')](_0x60b0('0x12')))return _0x60b0('0x13');return this[_0x60b0('0x11')]('provider');},'set':function(_0x1a7a0d){if(_0x1a7a0d===_0x60b0('0x13'))_0x1a7a0d=null;return this[_0x60b0('0xa')](_0x60b0('0x12'),_0x1a7a0d);}}}; \ No newline at end of file +var _0x36b9=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1b0c7c,_0x468383){var _0x44f649=function(_0x56fbc6){while(--_0x56fbc6){_0x1b0c7c['push'](_0x1b0c7c['shift']());}};_0x44f649(++_0x468383);}(_0x36b9,0x132));var _0x936b=function(_0x28c384,_0x15c131){_0x28c384=_0x28c384-0x0;var _0x4c6974=_0x36b9[_0x28c384];return _0x4c6974;};'use strict';var Sequelize=require(_0x936b('0x0'));module[_0x936b('0x1')]={'description':{'type':Sequelize[_0x936b('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x936b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x936b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x936b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x936b('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x936b('0x4')]},'markAsUnread':{'type':Sequelize[_0x936b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x936b('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x936b('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x936b('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x936b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x936b('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x936b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x936b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x936b('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x936b('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x936b('0x9'),'set':function(_0x3f8196){if(!_0x3f8196)this[_0x936b('0xa')](_0x936b('0xb'),null);this[_0x936b('0xa')](_0x936b('0xc'),_0x3f8196);}},'provider':{'type':Sequelize[_0x936b('0xd')](_0x936b('0xe'),_0x936b('0xf'),_0x936b('0x10'),_0x936b('0x11')),'defaultValue':null,'get':function(){if(!this[_0x936b('0x12')](_0x936b('0x13')))return _0x936b('0x14');return this['getDataValue'](_0x936b('0x13'));},'set':function(_0x21985d){if(_0x21985d===_0x936b('0x14'))_0x21985d=null;return this[_0x936b('0xa')](_0x936b('0x13'),_0x21985d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e70a2c6..a33af23 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 _0x1111=['MailAccounts','UserProfileResource','destroy','stack','name','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','gmail','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','filter','options','includeAll','findAll','rows','show','params','include','body','provider','custom','MailServerOut','Mail\x20Account\x20not\x20found','describe','addDisposition','find','MailAccountId','Disposition','create','getDispositions','findOne','pick','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','send','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','List','messageId','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','then','get'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x1111,0x9a));var _0x1111=function(_0x338084,_0x46f6df){_0x338084=_0x338084-0x0;var _0x460735=_0x1111[_0x338084];return _0x460735;};'use strict';var moment=require(_0x1111('0x0'));var BPromise=require(_0x1111('0x1'));var util=require('util');var path=require(_0x1111('0x2'));var _=require(_0x1111('0x3'));var juice=require(_0x1111('0x4'));var Redis=require(_0x1111('0x5'));var qs=require(_0x1111('0x6'));var logger=require(_0x1111('0x7'))(_0x1111('0x8'));var config=require(_0x1111('0x9'));var db=require(_0x1111('0xa'))['db'];config[_0x1111('0xb')]=_[_0x1111('0xc')](config['redis'],{'host':_0x1111('0xd'),'port':0x18eb});var socket=require(_0x1111('0xe'))(new Redis(config[_0x1111('0xb')]));require(_0x1111('0xf'))[_0x1111('0x10')](socket);var jayson=require(_0x1111('0x11'));var client=jayson['client'][_0x1111('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x105806,_0x180593,_0x3337a8,_0x1baffb){return new BPromise(function(_0x7f1ed9,_0xfc4245){var _0x421f81=_0x1baffb||client;return _0x421f81[_0x1111('0x13')](_0x105806,_0x3337a8)['then'](function(_0x35280f){logger[_0x1111('0x14')](_0x1111('0x15'),_0x180593,_0x1111('0x16'));logger[_0x1111('0x17')](_0x1111('0x18'),_0x180593,_0x1111('0x16'),JSON[_0x1111('0x19')](_0x35280f));if(_0x35280f[_0x1111('0x1a')]){if(_0x35280f[_0x1111('0x1a')]['code']===0x1f4){logger[_0x1111('0x1a')](_0x1111('0x15'),_0x180593,_0x35280f['error'][_0x1111('0x1b')]);return _0xfc4245(_0x35280f[_0x1111('0x1a')][_0x1111('0x1b')]);}logger[_0x1111('0x1a')](_0x1111('0x15'),_0x180593,_0x35280f[_0x1111('0x1a')][_0x1111('0x1b')]);return _0x7f1ed9(_0x35280f[_0x1111('0x1a')][_0x1111('0x1b')]);}else{logger[_0x1111('0x14')](_0x1111('0x15'),_0x180593,'request\x20sent');_0x7f1ed9(_0x35280f[_0x1111('0x1c')][_0x1111('0x1b')]);}})[_0x1111('0x1d')](function(_0x54da4b){logger['error'](_0x1111('0x15'),_0x180593,_0x54da4b);_0xfc4245(_0x54da4b);});});}function respondWithStatusCode(_0x23c98a,_0x279e4b){_0x279e4b=_0x279e4b||0xcc;return function(_0x44d36b){if(_0x44d36b){return _0x23c98a[_0x1111('0x1e')](_0x279e4b);}return _0x23c98a[_0x1111('0x1f')](_0x279e4b)[_0x1111('0x20')]();};}function respondWithResult(_0x10a01a,_0x1e339a){_0x1e339a=_0x1e339a||0xc8;return function(_0x273f24){if(_0x273f24){return _0x10a01a[_0x1111('0x1f')](_0x1e339a)[_0x1111('0x21')](_0x273f24);}};}function respondWithFilteredResult(_0x472d2f,_0x250760){return function(_0x1d76e6){if(_0x1d76e6){var _0x10c7ea=typeof _0x250760['offset']===_0x1111('0x22')&&typeof _0x250760['limit']==='undefined';var _0x41297b=_0x1d76e6[_0x1111('0x23')];var _0x10af62=_0x10c7ea?0x0:_0x250760[_0x1111('0x24')];var _0x4a8a75=_0x10c7ea?_0x1d76e6[_0x1111('0x23')]:_0x250760[_0x1111('0x24')]+_0x250760[_0x1111('0x25')];var _0x572931;if(_0x4a8a75>=_0x41297b){_0x4a8a75=_0x41297b;_0x572931=0xc8;}else{_0x572931=0xce;}_0x472d2f['status'](_0x572931);return _0x472d2f[_0x1111('0x26')](_0x1111('0x27'),_0x10af62+'-'+_0x4a8a75+'/'+_0x41297b)['json'](_0x1d76e6);}return null;};}function saveUpdates(_0x359643){return function(_0x5a0ee7){if(_0x5a0ee7){return _0x5a0ee7[_0x1111('0x28')](_0x359643)[_0x1111('0x29')](function(_0xd73a81){return _0xd73a81;});}return null;};}function removeEntity(_0x59a205){return function(_0x409b45){if(_0x409b45){return _0x409b45['destroy']()['then'](function(){var _0x4954a8=_0x409b45[_0x1111('0x2a')]({'plain':!![]});var _0x4b6d2f=_0x1111('0x2b');return db[_0x1111('0x2c')][_0x1111('0x2d')]({'where':{'type':_0x4b6d2f,'resourceId':_0x4954a8['id']}})[_0x1111('0x29')](function(){return _0x409b45;});})[_0x1111('0x29')](function(){_0x59a205['status'](0xcc)[_0x1111('0x20')]();});}};}function handleEntityNotFound(_0x1d5a9a){return function(_0x558f91){if(!_0x558f91){_0x1d5a9a['sendStatus'](0x194);}return _0x558f91;};}function handleError(_0xea6657,_0x226764){_0x226764=_0x226764||0x1f4;return function(_0x49bf99){logger[_0x1111('0x1a')](_0x49bf99[_0x1111('0x2e')]);if(_0x49bf99[_0x1111('0x2f')]){delete _0x49bf99['name'];}_0xea6657['status'](_0x226764)['send'](_0x49bf99);};}function getImapHost(_0x58d027){switch(_0x58d027){case'gmail':return _0x1111('0x30');case _0x1111('0x31'):return _0x1111('0x32');case'hotmail':return _0x1111('0x33');case _0x1111('0x34'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x58d027);}function getSmtpHost(_0xcad2bc){switch(_0xcad2bc){case _0x1111('0x35'):return _0x1111('0x36');case _0x1111('0x31'):return _0x1111('0x37');case _0x1111('0x38'):return _0x1111('0x39');case _0x1111('0x34'):return _0x1111('0x3a');}throw new Error(_0x1111('0x3b'),_0xcad2bc);}function getAuthenticationOptions(_0x8d2528,_0x1cce56){var _0x41275a={};var _0xdaef7f={};if(_0x8d2528){_0x41275a['user']=_0xdaef7f[_0x1111('0x3c')]=_0x1cce56[_0x1111('0x3d')];_0x41275a[_0x1111('0x3e')]=_0xdaef7f[_0x1111('0x3f')]=_0x1cce56[_0x1111('0x3e')];if(_0x1cce56[_0x1111('0x40')]){_0x41275a['modernAuthentication']=_0xdaef7f[_0x1111('0x40')]=!![];_0x41275a[_0x1111('0x41')]=_0xdaef7f[_0x1111('0x41')]=_0x1cce56[_0x1111('0x41')];_0x41275a[_0x1111('0x3e')]=_0xdaef7f['pass']=null;}else{_0x41275a[_0x1111('0x41')]=_0xdaef7f['CloudProviderId']=null;}_0x41275a[_0x1111('0x42')]=getImapHost(_0x8d2528);_0x41275a[_0x1111('0x43')]=0x3e1;_0xdaef7f['host']=getSmtpHost(_0x8d2528);_0xdaef7f[_0x1111('0x43')]=0x24b;_0xdaef7f[_0x1111('0x44')]=![];_0x41275a[_0x1111('0x45')]=_0xdaef7f[_0x1111('0x45')]=null;}else{if(_0x1cce56[_0x1111('0x46')]){_0x41275a[_0x1111('0x3c')]=_0xdaef7f['user']=_0x1cce56[_0x1111('0x3d')];_0x41275a['password']=_0xdaef7f[_0x1111('0x3f')]=_0x1cce56[_0x1111('0x3e')];}else{_0x41275a['authentication']=_0xdaef7f['authentication']=![];_0x41275a['user']=_0xdaef7f[_0x1111('0x3c')]=null;_0x41275a[_0x1111('0x3e')]=_0xdaef7f[_0x1111('0x3f')]=null;}_0x41275a[_0x1111('0x42')]=_0x1cce56[_0x1111('0x47')][_0x1111('0x42')];_0x41275a['port']=_0x1cce56[_0x1111('0x47')]['port'];_0xdaef7f[_0x1111('0x42')]=_0x1cce56[_0x1111('0x48')]['host'];_0xdaef7f[_0x1111('0x43')]=_0x1cce56[_0x1111('0x48')]['port'];}return{'Imap':_0x41275a,'Smtp':_0xdaef7f};}exports['index']=function(_0x8d2f25,_0x2c0a34){var _0x4a6007={'include':[{'model':db[_0x1111('0x49')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x1111('0x4a')],'as':_0x1111('0x4b')}]},_0x2fe51a={},_0x1d789e={'count':0x0,'rows':[]};var _0x3c3909=_[_0x1111('0x4c')](db[_0x1111('0x4d')][_0x1111('0x4e')],function(_0x52ccda){return{'name':_0x52ccda['fieldName'],'type':_0x52ccda['type'][_0x1111('0x4f')]};});_0x2fe51a['model']=_[_0x1111('0x4c')](_0x3c3909,_0x1111('0x2f'));_0x2fe51a['query']=_[_0x1111('0x50')](_0x8d2f25[_0x1111('0x51')]);_0x2fe51a['filters']=_[_0x1111('0x52')](_0x2fe51a[_0x1111('0x53')],_0x2fe51a[_0x1111('0x51')]);_0x4a6007[_0x1111('0x54')]=_[_0x1111('0x52')](_0x2fe51a[_0x1111('0x53')],qs[_0x1111('0x55')](_0x8d2f25[_0x1111('0x51')][_0x1111('0x55')]));_0x4a6007[_0x1111('0x54')]=_0x4a6007[_0x1111('0x54')][_0x1111('0x56')]?_0x4a6007[_0x1111('0x54')]:_0x2fe51a[_0x1111('0x53')];if(!_0x8d2f25['query'][_0x1111('0x57')](_0x1111('0x58'))){_0x4a6007[_0x1111('0x25')]=qs[_0x1111('0x25')](_0x8d2f25[_0x1111('0x51')]['limit']);_0x4a6007[_0x1111('0x24')]=qs['offset'](_0x8d2f25['query']['offset']);}_0x4a6007[_0x1111('0x59')]=qs['sort'](_0x8d2f25[_0x1111('0x51')][_0x1111('0x5a')]);_0x4a6007[_0x1111('0x5b')]=qs[_0x1111('0x5c')](_['pick'](_0x8d2f25[_0x1111('0x51')],_0x2fe51a[_0x1111('0x5c')]),_0x3c3909);if(_0x8d2f25[_0x1111('0x51')]['filter']){_0x4a6007[_0x1111('0x5b')]=_[_0x1111('0x5d')](_0x4a6007['where'],{'$or':_[_0x1111('0x4c')](_0x3c3909,function(_0x19a026){if(_0x19a026[_0x1111('0x5e')]!=='VIRTUAL'){var _0x47e291={};_0x47e291[_0x19a026[_0x1111('0x2f')]]={'$like':'%'+_0x8d2f25[_0x1111('0x51')][_0x1111('0x5f')]+'%'};return _0x47e291;}})});}_0x4a6007=_['merge']({},_0x4a6007,_0x8d2f25[_0x1111('0x60')]);var _0x73a86c={'where':_0x4a6007[_0x1111('0x5b')]};return db[_0x1111('0x4d')][_0x1111('0x23')](_0x73a86c)[_0x1111('0x29')](function(_0x23ee22){_0x1d789e[_0x1111('0x23')]=_0x23ee22;if(_0x8d2f25[_0x1111('0x51')][_0x1111('0x61')]){_0x4a6007['include']=[{'all':!![]}];}return db[_0x1111('0x4d')][_0x1111('0x62')](_0x4a6007);})[_0x1111('0x29')](function(_0x503609){_0x1d789e[_0x1111('0x63')]=_0x503609;return _0x1d789e;})['then'](respondWithFilteredResult(_0x2c0a34,_0x4a6007))[_0x1111('0x1d')](handleError(_0x2c0a34,null));};exports[_0x1111('0x64')]=function(_0x2c229c,_0x1a2761){var _0x47741={'raw':![],'where':{'id':_0x2c229c[_0x1111('0x65')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1111('0x47')},{'model':db['MailServerOut'],'as':_0x1111('0x48')},{'model':db[_0x1111('0x4a')],'as':'mandatoryDispositionPause'}]},_0x47505c={};_0x47505c[_0x1111('0x53')]=_[_0x1111('0x50')](db[_0x1111('0x4d')][_0x1111('0x4e')]);_0x47505c['query']=_['keys'](_0x2c229c[_0x1111('0x51')]);_0x47505c[_0x1111('0x5c')]=_['intersection'](_0x47505c[_0x1111('0x53')],_0x47505c[_0x1111('0x51')]);_0x47741[_0x1111('0x54')]=_['intersection'](_0x47505c['model'],qs['fields'](_0x2c229c['query'][_0x1111('0x55')]));_0x47741[_0x1111('0x54')]=_0x47741[_0x1111('0x54')]['length']?_0x47741[_0x1111('0x54')]:_0x47505c[_0x1111('0x53')];if(_0x2c229c[_0x1111('0x51')]['includeAll']){_0x47741[_0x1111('0x66')]=[{'all':!![]}];}_0x47741=_[_0x1111('0x5d')]({},_0x47741,_0x2c229c[_0x1111('0x60')]);return db['MailAccount']['find'](_0x47741)[_0x1111('0x29')](handleEntityNotFound(_0x1a2761,null))['then'](respondWithResult(_0x1a2761,null))[_0x1111('0x1d')](handleError(_0x1a2761,null));};exports[_0x1111('0x28')]=function(_0x5b607d,_0x597083){if(_0x5b607d[_0x1111('0x67')]['id']){delete _0x5b607d[_0x1111('0x67')]['id'];}var _0x38f9c4=_0x5b607d[_0x1111('0x67')][_0x1111('0x68')]===_0x1111('0x69')?null:_0x5b607d[_0x1111('0x67')]['provider'];var _0x2254b2=_0x5b607d[_0x1111('0x67')][_0x1111('0x47')]||{};var _0x5d6696=_0x5b607d[_0x1111('0x67')]['Smtp']||{};if(_0x38f9c4){_0x2254b2['host']=getImapHost(_0x38f9c4);_0x2254b2[_0x1111('0x43')]=0x3e1;_0x5d6696[_0x1111('0x42')]=getSmtpHost(_0x38f9c4);_0x5d6696[_0x1111('0x43')]=0x24b;_0x5d6696['secure']=![];}if(_0x5d6696[_0x1111('0x40')]){_0x5d6696[_0x1111('0x44')]=![];}else{_0x5d6696[_0x1111('0x41')]=null;}if(!_0x2254b2['modernAuthentication'])_0x2254b2[_0x1111('0x41')]=null;_0x5b607d[_0x1111('0x67')]['Imap']=_0x2254b2;_0x5b607d[_0x1111('0x67')][_0x1111('0x48')]=_0x5d6696;return db[_0x1111('0x4d')]['find']({'where':{'id':_0x5b607d[_0x1111('0x65')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1111('0x47')},{'model':db[_0x1111('0x6a')],'as':'Smtp'},{'model':db['Pause'],'as':_0x1111('0x4b')}]})[_0x1111('0x29')](handleEntityNotFound(_0x597083,null))[_0x1111('0x29')](function(_0x359a6f){if(!_0x359a6f)throw new Error(_0x1111('0x6b'));if(_0x359a6f['service'])delete _0x5b607d[_0x1111('0x67')][_0x1111('0x47')];return _0x359a6f;})['then'](saveUpdates(_0x5b607d[_0x1111('0x67')],null))[_0x1111('0x29')](function(_0x17ec9c){if(!_0x5b607d[_0x1111('0x67')][_0x1111('0x47')])return _0x17ec9c;return db[_0x1111('0x49')][_0x1111('0x28')](_0x5b607d[_0x1111('0x67')][_0x1111('0x47')],{'where':{'MailAccountId':_0x17ec9c['id']}})[_0x1111('0x29')](function(){return _0x17ec9c;});})[_0x1111('0x29')](function(_0x43b4ce){if(!_0x5b607d[_0x1111('0x67')][_0x1111('0x48')])return _0x43b4ce;return db[_0x1111('0x6a')][_0x1111('0x28')](_0x5b607d[_0x1111('0x67')][_0x1111('0x48')],{'where':{'MailAccountId':_0x43b4ce['id']}})[_0x1111('0x29')](function(){return _0x43b4ce;});})[_0x1111('0x29')](respondWithResult(_0x597083,null))[_0x1111('0x1d')](handleError(_0x597083,null));};exports[_0x1111('0x6c')]=function(_0x11ea18,_0x75b318){return db[_0x1111('0x4d')][_0x1111('0x6c')]()[_0x1111('0x29')](respondWithResult(_0x75b318,null))[_0x1111('0x1d')](handleError(_0x75b318,null));};exports[_0x1111('0x6d')]=function(_0xaaa51a,_0xf159e6){if(_0xaaa51a[_0x1111('0x67')]['id']){delete _0xaaa51a[_0x1111('0x67')]['id'];}return db[_0x1111('0x4d')][_0x1111('0x6e')]({'where':{'id':_0xaaa51a[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0xf159e6,null))[_0x1111('0x29')](function(_0x53c789){if(_0x53c789){_0xaaa51a['body'][_0x1111('0x6f')]=_0x53c789['id'];return db[_0x1111('0x70')][_0x1111('0x71')](_0xaaa51a['body']);}})[_0x1111('0x29')](respondWithResult(_0xf159e6,null))[_0x1111('0x1d')](handleError(_0xf159e6,null));};exports[_0x1111('0x72')]=function(_0x3616cc,_0x5b12d6){var _0x4f14bd={'raw':![],'where':{}};var _0x5c269c={};var _0x166693={'count':0x0,'rows':[]};return db['MailAccount'][_0x1111('0x73')]({'where':{'id':_0x3616cc[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x5b12d6,null))[_0x1111('0x29')](function(_0x476671){if(_0x476671){_0x5c269c['model']=_[_0x1111('0x50')](db[_0x1111('0x70')][_0x1111('0x4e')]);_0x5c269c[_0x1111('0x51')]=_[_0x1111('0x50')](_0x3616cc[_0x1111('0x51')]);_0x5c269c[_0x1111('0x5c')]=_[_0x1111('0x52')](_0x5c269c['model'],_0x5c269c[_0x1111('0x51')]);_0x4f14bd['attributes']=_[_0x1111('0x52')](_0x5c269c[_0x1111('0x53')],qs[_0x1111('0x55')](_0x3616cc[_0x1111('0x51')][_0x1111('0x55')]));_0x4f14bd[_0x1111('0x54')]=_0x4f14bd[_0x1111('0x54')][_0x1111('0x56')]?_0x4f14bd[_0x1111('0x54')]:_0x5c269c[_0x1111('0x53')];if(!_0x3616cc[_0x1111('0x51')][_0x1111('0x57')]('nolimit')){_0x4f14bd[_0x1111('0x25')]=qs[_0x1111('0x25')](_0x3616cc['query'][_0x1111('0x25')]);_0x4f14bd[_0x1111('0x24')]=qs['offset'](_0x3616cc['query']['offset']);}_0x4f14bd['order']=qs[_0x1111('0x5a')](_0x3616cc[_0x1111('0x51')]['sort']);_0x4f14bd['where']=qs[_0x1111('0x5c')](_[_0x1111('0x74')](_0x3616cc[_0x1111('0x51')],_0x5c269c[_0x1111('0x5c')]));_0x4f14bd['where'][_0x1111('0x6f')]=_0x476671['id'];if(_0x3616cc[_0x1111('0x51')]['filter']){_0x4f14bd[_0x1111('0x5b')]=_[_0x1111('0x5d')](_0x4f14bd[_0x1111('0x5b')],{'$or':_[_0x1111('0x4c')](_0x4f14bd[_0x1111('0x54')],function(_0xf651ab){var _0x595354={};_0x595354[_0xf651ab]={'$like':'%'+_0x3616cc[_0x1111('0x51')][_0x1111('0x5f')]+'%'};return _0x595354;})});}_0x4f14bd=_[_0x1111('0x5d')]({},_0x4f14bd,_0x3616cc['options']);return db['Disposition'][_0x1111('0x23')]({'where':_0x4f14bd[_0x1111('0x5b')]})[_0x1111('0x29')](function(_0x113a2f){_0x166693['count']=_0x113a2f;if(_0x3616cc[_0x1111('0x51')]['includeAll']){_0x4f14bd['include']=[{'all':!![]}];}return db['Disposition'][_0x1111('0x62')](_0x4f14bd);})[_0x1111('0x29')](function(_0x4d2c19){_0x166693[_0x1111('0x63')]=_0x4d2c19;return _0x166693;});}})[_0x1111('0x29')](respondWithFilteredResult(_0x5b12d6,_0x4f14bd))[_0x1111('0x1d')](handleError(_0x5b12d6,null));};exports[_0x1111('0x75')]=function(_0x3e24b3,_0x711989){return db[_0x1111('0x4d')][_0x1111('0x6e')]({'where':{'id':_0x3e24b3[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x711989,null))[_0x1111('0x29')](function(_0x1000a0){if(_0x1000a0){return _0x1000a0[_0x1111('0x75')](_0x3e24b3[_0x1111('0x51')]['ids']);}})[_0x1111('0x29')](respondWithStatusCode(_0x711989,null))[_0x1111('0x1d')](handleError(_0x711989,null));};exports[_0x1111('0x76')]=function(_0x38a008,_0x13c838){if(_0x38a008['body']['id']){delete _0x38a008[_0x1111('0x67')]['id'];}return db[_0x1111('0x4d')][_0x1111('0x6e')]({'where':{'id':_0x38a008[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x13c838,null))[_0x1111('0x29')](function(_0x177c0a){if(_0x177c0a){_0x38a008[_0x1111('0x67')][_0x1111('0x6f')]=_0x177c0a['id'];return db['CannedAnswer'][_0x1111('0x71')](_0x38a008[_0x1111('0x67')]);}})[_0x1111('0x29')](respondWithResult(_0x13c838,null))[_0x1111('0x1d')](handleError(_0x13c838,null));};exports['getAnswers']=function(_0x5360b1,_0x5dfc4a){var _0x12d535={'raw':![],'where':{}};var _0x37dca1={};var _0x58a453={'count':0x0,'rows':[]};return db[_0x1111('0x4d')][_0x1111('0x73')]({'where':{'id':_0x5360b1[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x5dfc4a,null))[_0x1111('0x29')](function(_0x55a5ef){if(_0x55a5ef){_0x37dca1[_0x1111('0x53')]=_[_0x1111('0x50')](db[_0x1111('0x77')]['rawAttributes']);_0x37dca1[_0x1111('0x51')]=_[_0x1111('0x50')](_0x5360b1[_0x1111('0x51')]);_0x37dca1['filters']=_[_0x1111('0x52')](_0x37dca1[_0x1111('0x53')],_0x37dca1[_0x1111('0x51')]);_0x12d535['attributes']=_[_0x1111('0x52')](_0x37dca1[_0x1111('0x53')],qs[_0x1111('0x55')](_0x5360b1[_0x1111('0x51')]['fields']));_0x12d535[_0x1111('0x54')]=_0x12d535[_0x1111('0x54')][_0x1111('0x56')]?_0x12d535[_0x1111('0x54')]:_0x37dca1['model'];if(!_0x5360b1[_0x1111('0x51')]['hasOwnProperty'](_0x1111('0x58'))){_0x12d535[_0x1111('0x25')]=qs[_0x1111('0x25')](_0x5360b1[_0x1111('0x51')][_0x1111('0x25')]);_0x12d535['offset']=qs[_0x1111('0x24')](_0x5360b1[_0x1111('0x51')][_0x1111('0x24')]);}_0x12d535[_0x1111('0x59')]=qs['sort'](_0x5360b1[_0x1111('0x51')][_0x1111('0x5a')]);_0x12d535[_0x1111('0x5b')]=qs['filters'](_[_0x1111('0x74')](_0x5360b1['query'],_0x37dca1[_0x1111('0x5c')]));_0x12d535[_0x1111('0x5b')][_0x1111('0x6f')]=_0x55a5ef['id'];if(_0x5360b1[_0x1111('0x51')][_0x1111('0x5f')]){_0x12d535['where']=_[_0x1111('0x5d')](_0x12d535[_0x1111('0x5b')],{'$or':_[_0x1111('0x4c')](_0x12d535[_0x1111('0x54')],function(_0x1f903f){var _0x55cbf5={};_0x55cbf5[_0x1f903f]={'$like':'%'+_0x5360b1[_0x1111('0x51')][_0x1111('0x5f')]+'%'};return _0x55cbf5;})});}_0x12d535=_['merge']({},_0x12d535,_0x5360b1[_0x1111('0x60')]);return db['CannedAnswer'][_0x1111('0x23')]({'where':_0x12d535['where']})[_0x1111('0x29')](function(_0x84e56e){_0x58a453[_0x1111('0x23')]=_0x84e56e;if(_0x5360b1[_0x1111('0x51')][_0x1111('0x61')]){_0x12d535[_0x1111('0x66')]=[{'all':!![]}];}return db[_0x1111('0x77')][_0x1111('0x62')](_0x12d535);})[_0x1111('0x29')](function(_0x5f13a6){_0x58a453[_0x1111('0x63')]=_0x5f13a6;return _0x58a453;});}})[_0x1111('0x29')](respondWithFilteredResult(_0x5dfc4a,_0x12d535))[_0x1111('0x1d')](handleError(_0x5dfc4a,null));};exports[_0x1111('0x78')]=function(_0x132b73,_0x40bb88){return db[_0x1111('0x4d')][_0x1111('0x6e')]({'where':{'id':_0x132b73[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x40bb88,null))[_0x1111('0x29')](function(_0x177b6a){if(_0x177b6a){return _0x177b6a[_0x1111('0x78')](_0x132b73[_0x1111('0x51')][_0x1111('0x79')]);}})[_0x1111('0x29')](respondWithStatusCode(_0x40bb88,null))[_0x1111('0x1d')](handleError(_0x40bb88,null));};exports[_0x1111('0x71')]=function(_0x2d0094,_0x4ae5d9){var _0x55fe90={'name':_0x2d0094[_0x1111('0x67')][_0x1111('0x2f')],'key':_0x2d0094[_0x1111('0x67')][_0x1111('0x4f')],'provider':_0x2d0094[_0x1111('0x67')]['provider']===_0x1111('0x69')?null:_0x2d0094[_0x1111('0x67')][_0x1111('0x68')],'email':_0x2d0094['body']['email'],'ListId':_0x2d0094[_0x1111('0x67')][_0x1111('0x7a')],'active':!_[_0x1111('0x7b')](_0x2d0094[_0x1111('0x67')][_0x1111('0x7c')])?_0x2d0094['body']['active']:!![],'description':_0x2d0094[_0x1111('0x67')]['description']||null};var _0x4f86b3=getAuthenticationOptions(_0x55fe90[_0x1111('0x68')],_0x2d0094[_0x1111('0x67')]);_0x55fe90['Imap']=_0x4f86b3[_0x1111('0x47')];_0x55fe90[_0x1111('0x48')]=_0x4f86b3[_0x1111('0x48')];return db[_0x1111('0x4d')]['create'](_0x55fe90,{'include':[{'model':db['MailServerOut'],'as':_0x1111('0x48')},{'model':db[_0x1111('0x49')],'as':_0x1111('0x47')}]})[_0x1111('0x29')](function(_0xf96c1e){var _0x504830=_0x2d0094[_0x1111('0x3c')][_0x1111('0x2a')]({'plain':!![]});if(!_0x504830)throw new Error(_0x1111('0x7d'));if(_0x504830[_0x1111('0x7e')]===_0x1111('0x3c')){var _0x7b3457=_0xf96c1e['get']({'plain':!![]});return db[_0x1111('0x7f')][_0x1111('0x6e')]({'where':{'name':_0x1111('0x2b'),'userProfileId':_0x504830[_0x1111('0x80')]},'raw':!![]})[_0x1111('0x29')](function(_0x2679a2){if(_0x2679a2&&_0x2679a2['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x7b3457[_0x1111('0x2f')],'resourceId':_0x7b3457['id'],'type':_0x2679a2['name'],'sectionId':_0x2679a2['id']},{})[_0x1111('0x29')](function(){return _0xf96c1e;});}else{return _0xf96c1e;}})['catch'](function(_0x2cf5a3){logger[_0x1111('0x1a')](_0x1111('0x81'),_0x2cf5a3);throw _0x2cf5a3;});}return _0xf96c1e;})[_0x1111('0x29')](respondWithResult(_0x4ae5d9,0xc9))[_0x1111('0x1d')](handleError(_0x4ae5d9,null));};exports[_0x1111('0x82')]=function(_0x3edc91,_0x3285e1){return db[_0x1111('0x4d')]['findOne']({'where':{'id':_0x3edc91[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x3285e1,null))[_0x1111('0x29')](function(_0x3b0465){if(_0x3b0465){return _0x3b0465[_0x1111('0x82')]();}return null;})[_0x1111('0x29')](respondWithResult(_0x3285e1,null))[_0x1111('0x1d')](handleError(_0x3285e1,null));};exports['addImap']=function(_0x2d3c05,_0x3b0dca){if(_0x2d3c05[_0x1111('0x67')]['id']){delete _0x2d3c05['body']['id'];}return db[_0x1111('0x4d')][_0x1111('0x6e')]({'where':{'id':_0x2d3c05[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x3b0dca,null))[_0x1111('0x29')](function(_0x1aa74d){if(_0x1aa74d){_0x2d3c05['body'][_0x1111('0x6f')]=_0x1aa74d['id'];return db['MailServerIn'][_0x1111('0x71')](_0x2d3c05[_0x1111('0x67')]);}})[_0x1111('0x29')](respondWithResult(_0x3b0dca,null))[_0x1111('0x1d')](handleError(_0x3b0dca,null));};exports[_0x1111('0x83')]=function(_0x5935a5,_0x3d060e){return db[_0x1111('0x4d')]['findOne']({'where':{'id':_0x5935a5[_0x1111('0x65')]['id']}})['then'](handleEntityNotFound(_0x3d060e,null))[_0x1111('0x29')](function(_0x4f8f46){if(_0x4f8f46){return _0x4f8f46[_0x1111('0x84')](null);}return null;})[_0x1111('0x29')](respondWithStatusCode(_0x3d060e,null))[_0x1111('0x1d')](handleError(_0x3d060e,null));};exports['getSmtp']=function(_0x1a990f,_0x2e3da5){return db[_0x1111('0x4d')][_0x1111('0x73')]({'where':{'id':_0x1a990f['params']['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x2e3da5,null))[_0x1111('0x29')](function(_0x2831d3){if(_0x2831d3){return _0x2831d3['getSmtp']();}return null;})[_0x1111('0x29')](respondWithResult(_0x2e3da5,null))[_0x1111('0x1d')](handleError(_0x2e3da5,null));};exports[_0x1111('0x85')]=function(_0x5619ba,_0xdaa30b){if(_0x5619ba[_0x1111('0x67')]['id']){delete _0x5619ba[_0x1111('0x67')]['id'];}return db[_0x1111('0x4d')][_0x1111('0x6e')]({'where':{'id':_0x5619ba[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0xdaa30b,null))[_0x1111('0x29')](function(_0x3b332d){if(_0x3b332d){_0x5619ba['body'][_0x1111('0x6f')]=_0x3b332d['id'];return db[_0x1111('0x6a')]['create'](_0x5619ba['body']);}})[_0x1111('0x29')](respondWithResult(_0xdaa30b,null))[_0x1111('0x1d')](handleError(_0xdaa30b,null));};exports[_0x1111('0x86')]=function(_0x42eae8,_0x336164){return db[_0x1111('0x4d')]['findOne']({'where':{'id':_0x42eae8[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x336164,null))[_0x1111('0x29')](function(_0x219808){if(_0x219808){return _0x219808['setSmtp'](null);}return null;})[_0x1111('0x29')](respondWithStatusCode(_0x336164,null))[_0x1111('0x1d')](handleError(_0x336164,null));};exports['addInteraction']=function(_0x1de7c3,_0x449ba5){return db[_0x1111('0x87')][_0x1111('0x6e')]({'where':{'id':_0x1de7c3['params']['id']}})['then'](handleEntityNotFound(_0x449ba5,null))[_0x1111('0x29')](function(_0x4085da){if(_0x4085da){return _0x4085da[_0x1111('0x88')](_0x1de7c3[_0x1111('0x67')][_0x1111('0x79')],_[_0x1111('0x89')](_0x1de7c3[_0x1111('0x67')],['ids','id'])||{});}})['then'](respondWithResult(_0x449ba5,null))[_0x1111('0x1d')](handleError(_0x449ba5,null));};exports[_0x1111('0x8a')]=function(_0xc73970,_0x42381b){var _0x5f1c58={'raw':![],'where':{}};var _0x2e3cab={};var _0x3f52f1={'count':0x0,'rows':[]};return db['MailAccount'][_0x1111('0x73')]({'where':{'id':_0xc73970[_0x1111('0x65')]['id']}})['then'](handleEntityNotFound(_0x42381b,null))[_0x1111('0x29')](function(_0x4be0ea){if(_0x4be0ea){_0x2e3cab[_0x1111('0x53')]=_[_0x1111('0x50')](db['MailInteraction'][_0x1111('0x4e')]);_0x2e3cab[_0x1111('0x51')]=_['keys'](_0xc73970[_0x1111('0x51')]);_0x2e3cab[_0x1111('0x5c')]=_[_0x1111('0x52')](_0x2e3cab[_0x1111('0x53')],_0x2e3cab[_0x1111('0x51')]);_0x5f1c58[_0x1111('0x54')]=_[_0x1111('0x52')](_0x2e3cab['model'],qs[_0x1111('0x55')](_0xc73970[_0x1111('0x51')]['fields']));_0x5f1c58['attributes']=_0x5f1c58[_0x1111('0x54')][_0x1111('0x56')]?_0x5f1c58[_0x1111('0x54')]:_0x2e3cab[_0x1111('0x53')];if(!_0xc73970[_0x1111('0x51')][_0x1111('0x57')](_0x1111('0x58'))){_0x5f1c58['limit']=qs[_0x1111('0x25')](_0xc73970[_0x1111('0x51')][_0x1111('0x25')]);_0x5f1c58[_0x1111('0x24')]=qs[_0x1111('0x24')](_0xc73970['query'][_0x1111('0x24')]);}_0x5f1c58[_0x1111('0x59')]=qs['sort'](_0xc73970[_0x1111('0x51')][_0x1111('0x5a')]);_0x5f1c58[_0x1111('0x5b')]=qs['filters'](_[_0x1111('0x74')](_0xc73970[_0x1111('0x51')],_0x2e3cab[_0x1111('0x5c')]));_0x5f1c58[_0x1111('0x5b')][_0x1111('0x6f')]=_0x4be0ea['id'];if(_0xc73970[_0x1111('0x51')][_0x1111('0x5f')]){_0x5f1c58[_0x1111('0x5b')]=_[_0x1111('0x5d')](_0x5f1c58[_0x1111('0x5b')],{'$or':_[_0x1111('0x4c')](_0x5f1c58['attributes'],function(_0x1c283b){var _0x22030e={};_0x22030e[_0x1c283b]={'$like':'%'+_0xc73970['query']['filter']+'%'};return _0x22030e;})});}_0x5f1c58=_[_0x1111('0x5d')]({},_0x5f1c58,_0xc73970['options']);return db['MailInteraction'][_0x1111('0x23')]({'where':_0x5f1c58[_0x1111('0x5b')]})[_0x1111('0x29')](function(_0x5009a3){_0x3f52f1['count']=_0x5009a3;if(_0xc73970[_0x1111('0x51')][_0x1111('0x61')]){_0x5f1c58['include']=[{'model':db[_0x1111('0x8b')],'as':'Contact','required':![]},{'model':db[_0x1111('0x8c')],'as':'Owner','attributes':[_0x1111('0x2f'),_0x1111('0x8d'),_0x1111('0x8e')],'required':![]},{'model':db[_0x1111('0x8f')],'as':_0x1111('0x90'),'attributes':['id',_0x1111('0x2f'),_0x1111('0x91')],'where':_0xc73970[_0x1111('0x51')]['tag']?{'id':_0xc73970['query'][_0x1111('0x92')]}:undefined,'required':_0xc73970[_0x1111('0x51')][_0x1111('0x92')]?!![]:![]}];}return db[_0x1111('0x87')][_0x1111('0x62')](_0x5f1c58);})[_0x1111('0x29')](function(_0x69a8cf){_0x3f52f1[_0x1111('0x63')]=_0x69a8cf;return _0x3f52f1;});}})[_0x1111('0x29')](respondWithFilteredResult(_0x42381b,_0x5f1c58))[_0x1111('0x1d')](handleError(_0x42381b,null));};exports[_0x1111('0x93')]=function addApplications(_0x4234e7,_0x3c92bc){var _0xaa3eac=_0x4234e7['params']['id'];var _0x127c20=_0x4234e7[_0x1111('0x67')];var _0x802b1d=0xc8;var _0x345bab=null;return db[_0x1111('0x94')][_0x1111('0x95')]({'isolationLevel':db[_0x1111('0x94')][_0x1111('0x96')][_0x1111('0x97')][_0x1111('0x98')]},function(_0xca3dc4){return db[_0x1111('0x4d')][_0x1111('0x73')]({'where':{'id':_0xaa3eac},'transaction':_0xca3dc4})[_0x1111('0x29')](function(_0xb2d288){if(_0xb2d288){return db[_0x1111('0x99')][_0x1111('0x2d')]({'where':{'MailAccountId':_0xaa3eac},'transaction':_0xca3dc4})[_0x1111('0x29')](function(){var _0x51c492=_[_0x1111('0x4c')](_0x127c20,function(_0x201894){_0x201894[_0x1111('0x6f')]=_0xaa3eac;return _0x201894;});return db[_0x1111('0x99')]['bulkCreate'](_0x51c492,{'transaction':_0xca3dc4});});}else{_0x802b1d=0x194;_0x345bab=[];}});})[_0x1111('0x29')](function(){if(_0x802b1d!==0x194){return db[_0x1111('0x99')]['findAndCountAll']({'where':{'MailAccountId':_0xaa3eac},'order':_0x1111('0x9a')})[_0x1111('0x29')](function(_0x35021b){_0x345bab=_0x35021b;});}})[_0x1111('0x1d')](function(_0x456eb7){_0x802b1d=0x1f4;logger['error'](_0x456eb7[_0x1111('0x2e')]);if(_0x456eb7[_0x1111('0x2f')]){delete _0x456eb7['name'];}_0x345bab=_0x456eb7;})['finally'](function(){if(_0x345bab===null){_0x3c92bc[_0x1111('0x1e')](_0x802b1d);}else{if(_0x802b1d===0x1f4){_0x3c92bc[_0x1111('0x1f')](_0x802b1d)[_0x1111('0x9b')](_0x345bab);}else{_0x3c92bc['status'](_0x802b1d)[_0x1111('0x21')](_0x345bab);}}});};exports[_0x1111('0x9c')]=function(_0x1d7317,_0x572f08){var _0x25524f={};var _0x1b72d9={};var _0x3eabb5;var _0x16aea9;return db[_0x1111('0x4d')][_0x1111('0x73')]({'where':{'id':_0x1d7317['params']['id']}})['then'](handleEntityNotFound(_0x572f08,null))[_0x1111('0x29')](function(_0x1e1656){if(_0x1e1656){_0x3eabb5=_0x1e1656;_0x1b72d9[_0x1111('0x53')]=_[_0x1111('0x50')](db[_0x1111('0x99')]['rawAttributes']);_0x1b72d9[_0x1111('0x51')]=_[_0x1111('0x50')](_0x1d7317[_0x1111('0x51')]);_0x1b72d9['filters']=_['intersection'](_0x1b72d9[_0x1111('0x53')],_0x1b72d9[_0x1111('0x51')]);_0x25524f[_0x1111('0x54')]=_[_0x1111('0x52')](_0x1b72d9['model'],qs['fields'](_0x1d7317[_0x1111('0x51')][_0x1111('0x55')]));_0x25524f[_0x1111('0x54')]=_0x25524f[_0x1111('0x54')][_0x1111('0x56')]?_0x25524f[_0x1111('0x54')]:_0x1b72d9[_0x1111('0x53')];_0x25524f[_0x1111('0x59')]=qs[_0x1111('0x5a')](_0x1d7317[_0x1111('0x51')][_0x1111('0x5a')]);_0x25524f[_0x1111('0x5b')]=qs['filters'](_[_0x1111('0x74')](_0x1d7317[_0x1111('0x51')],_0x1b72d9['filters']));if(_0x1d7317[_0x1111('0x51')]['filter']){_0x25524f['where']=_[_0x1111('0x5d')](_0x25524f['where'],{'$or':_[_0x1111('0x4c')](_0x25524f[_0x1111('0x54')],function(_0x38838f){var _0x289980={};_0x289980[_0x38838f]={'$like':'%'+_0x1d7317[_0x1111('0x51')][_0x1111('0x5f')]+'%'};return _0x289980;})});}_0x25524f=_['merge']({},_0x25524f,_0x1d7317[_0x1111('0x60')]);return _0x3eabb5[_0x1111('0x9c')](_0x25524f);}})[_0x1111('0x29')](function(_0x41e66a){if(_0x41e66a){_0x16aea9=_0x41e66a['length'];if(!_0x1d7317[_0x1111('0x51')][_0x1111('0x57')](_0x1111('0x58'))){_0x25524f['limit']=qs['limit'](_0x1d7317[_0x1111('0x51')][_0x1111('0x25')]);_0x25524f[_0x1111('0x24')]=qs[_0x1111('0x24')](_0x1d7317[_0x1111('0x51')][_0x1111('0x24')]);}return _0x3eabb5[_0x1111('0x9c')](_0x25524f);}})[_0x1111('0x29')](function(_0x59609d){if(_0x59609d){return _0x59609d?{'count':_0x16aea9,'rows':_0x59609d}:null;}})[_0x1111('0x29')](respondWithResult(_0x572f08,null))['catch'](handleError(_0x572f08,null));};exports['getMessages']=function(_0x5bf0d7,_0x58fba1){var _0x37188c={'raw':!![],'where':{}};var _0x1cbad8={};var _0x595363={'count':0x0,'rows':[]};return db[_0x1111('0x4d')][_0x1111('0x73')]({'where':{'id':_0x5bf0d7[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x58fba1,null))[_0x1111('0x29')](function(_0xd7bfcc){if(_0xd7bfcc){_0x1cbad8[_0x1111('0x53')]=_[_0x1111('0x50')](db[_0x1111('0x9d')][_0x1111('0x4e')]);_0x1cbad8['query']=_['keys'](_0x5bf0d7['query']);_0x1cbad8['filters']=_[_0x1111('0x52')](_0x1cbad8[_0x1111('0x53')],_0x1cbad8[_0x1111('0x51')]);_0x37188c[_0x1111('0x54')]=_[_0x1111('0x52')](_0x1cbad8[_0x1111('0x53')],qs[_0x1111('0x55')](_0x5bf0d7['query'][_0x1111('0x55')]));_0x37188c[_0x1111('0x54')]=_0x37188c[_0x1111('0x54')]['length']?_0x37188c[_0x1111('0x54')]:_0x1cbad8[_0x1111('0x53')];if(!_0x5bf0d7[_0x1111('0x51')][_0x1111('0x57')](_0x1111('0x58'))){_0x37188c[_0x1111('0x25')]=qs['limit'](_0x5bf0d7[_0x1111('0x51')]['limit']);_0x37188c[_0x1111('0x24')]=qs['offset'](_0x5bf0d7[_0x1111('0x51')][_0x1111('0x24')]);}_0x37188c[_0x1111('0x59')]=qs[_0x1111('0x5a')](_0x5bf0d7['query'][_0x1111('0x5a')]);_0x37188c[_0x1111('0x5b')]=qs[_0x1111('0x5c')](_[_0x1111('0x74')](_0x5bf0d7[_0x1111('0x51')],_0x1cbad8[_0x1111('0x5c')]));_0x37188c[_0x1111('0x5b')][_0x1111('0x6f')]=_0xd7bfcc['id'];if(_0x5bf0d7[_0x1111('0x51')][_0x1111('0x5f')]){_0x37188c['where']=_[_0x1111('0x5d')](_0x37188c[_0x1111('0x5b')],{'$or':_['map'](_0x37188c['attributes'],function(_0x35d511){var _0x3c1db4={};_0x3c1db4[_0x35d511]={'$like':'%'+_0x5bf0d7[_0x1111('0x51')][_0x1111('0x5f')]+'%'};return _0x3c1db4;})});}if(_0x5bf0d7[_0x1111('0x51')][_0x1111('0x9e')]){var _0x31e8b6=_0x5bf0d7['query'][_0x1111('0x9e')][_0x1111('0x9f')](',');var _0x35d8b9={};_0x35d8b9[_0x31e8b6[0x0]]={'$gte':moment(_0x31e8b6[0x1])[_0x1111('0xa0')](_0x1111('0xa1'))};_0x37188c[_0x1111('0x5b')]=_['merge'](_0x37188c[_0x1111('0x5b')],_0x35d8b9);}_0x37188c=_['merge']({},_0x37188c,_0x5bf0d7[_0x1111('0x60')]);return db[_0x1111('0x9d')][_0x1111('0x23')]({'where':_0x37188c['where']})[_0x1111('0x29')](function(_0x180a5a){_0x595363[_0x1111('0x23')]=_0x180a5a;if(_0x5bf0d7[_0x1111('0x51')][_0x1111('0x61')]){_0x37188c[_0x1111('0x66')]=[{'all':!![]}];}return db[_0x1111('0x9d')][_0x1111('0x62')](_0x37188c);})[_0x1111('0x29')](function(_0x4e2b43){if(_0x5bf0d7[_0x1111('0x51')][_0x1111('0xa2')]===_0x1111('0xa3')){for(var _0x58f88b=0x0;_0x58f88b<_0x4e2b43[_0x1111('0x56')];_0x58f88b++){_0x4e2b43[_0x58f88b][_0x1111('0x67')]=juice(_0x4e2b43[_0x58f88b][_0x1111('0x67')]);}}_0x595363[_0x1111('0x63')]=_0x4e2b43;return _0x595363;});}})[_0x1111('0x29')](respondWithFilteredResult(_0x58fba1,_0x37188c))['catch'](handleError(_0x58fba1,null));};exports[_0x1111('0x9b')]=function(_0x229a18,_0x44e727){var _0x219160,_0x4a971d={},_0x23f695;if(_0x229a18[_0x1111('0x67')]['to']){_0x23f695=_0x229a18[_0x1111('0x67')]['to'][_0x1111('0x9f')](',')[0x0];}return db[_0x1111('0x4d')][_0x1111('0x6e')]({'where':{'id':_0x229a18[_0x1111('0x65')]['id']},'include':[{'model':db[_0x1111('0xa4')],'as':'List','include':[{'model':db[_0x1111('0x8b')],'as':_0x1111('0xa5'),'where':{'email':_0x23f695},'limit':0x1,'order':[[_0x1111('0xa6'),_0x1111('0xa7')]]}]},{'model':db[_0x1111('0x6a')],'as':_0x1111('0x48'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x1111('0x29')](handleEntityNotFound(_0x44e727,null))[_0x1111('0x29')](function(_0x2bb738){if(!_0x2bb738)return;_0x219160=_0x2bb738;if(!_0x2bb738[_0x1111('0x48')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_['isNil'](_0x229a18['body'][_0x1111('0xa8')])){_0x229a18[_0x1111('0x67')]['from']=util['format'](_0x1111('0xa9'),_0x2bb738[_0x1111('0x2f')],_0x2bb738[_0x1111('0xaa')]||_0x2bb738[_0x1111('0x48')][_0x1111('0x3c')]);}if(_0x229a18[_0x1111('0x67')][_0x1111('0xab')]&&_0x229a18['body'][_0x1111('0xab')][_0x1111('0x56')]){for(var _0x446f6a=0x0;_0x446f6a<_0x229a18['body']['attachments'][_0x1111('0x56')];_0x446f6a+=0x1){_0x229a18['body']['attachments'][_0x446f6a]={'filename':_0x229a18[_0x1111('0x67')][_0x1111('0xab')][_0x446f6a]['name'],'path':path['join'](config['root'],_0x1111('0xac'),_0x229a18[_0x1111('0x67')]['attachments'][_0x446f6a][_0x1111('0xad')])};}}var _0x176b05=_0x2bb738[_0x1111('0xae')]();return respondWithRpcPromise(_0x1111('0xaf'),'sendMail',{'account':_0x176b05,'message':_0x229a18['body']});})['then'](function(_0x5ad40e){if(!_0x5ad40e)return;_0x4a971d=_0x5ad40e;if(!_0x219160['List'])throw new Error(_0x1111('0xb0'));if(_0x219160[_0x1111('0xb1')][_0x1111('0xa5')][_0x1111('0x56')])return _0x219160[_0x1111('0xb1')]['Contacts'][0x0];return db['CmContact'][_0x1111('0x71')](_[_0x1111('0xc')](_0x229a18[_0x1111('0x67')],{'firstName':_0x229a18[_0x1111('0x67')]['to'],'email':_0x229a18[_0x1111('0x67')]['to'],'phone':_0x229a18[_0x1111('0x67')]['to'],'ListId':_0x219160[_0x1111('0x7a')]}));})[_0x1111('0x29')](function(_0x24c780){if(!_0x24c780)return;var _0x2ec1b8={'UserId':_0x229a18[_0x1111('0x3c')]['id'],'ContactId':_0x24c780['id'],'MailAccountId':_0x219160['id'],'inReplyTo':_0x4a971d[_0x1111('0xb2')],'to':_0x229a18[_0x1111('0x67')][_0x1111('0xa8')],'cc':_0x229a18[_0x1111('0x67')]['cc'],'subject':_0x229a18['body'][_0x1111('0xb3')],'attach':_0x229a18[_0x1111('0x67')][_0x1111('0xb4')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x1111('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x1111('0xb5'),'Messages':[_[_0x1111('0x5d')](_0x229a18['body'],{'messageId':_0x4a971d[_0x1111('0xb2')],'sentAt':moment()[_0x1111('0xa0')](_0x1111('0xa1')),'read':!![],'MailAccountId':_0x219160['id'],'UserId':_0x229a18[_0x1111('0x3c')]['id'],'ContactId':_0x24c780['id']})]};if(_0x229a18['body'][_0x1111('0xb6')]){_0x2ec1b8=_[_0x1111('0x5d')](_0x2ec1b8,_0x229a18[_0x1111('0x67')][_0x1111('0xb6')]);}return db[_0x1111('0x87')][_0x1111('0x71')](_0x2ec1b8,{'include':[{'model':db['MailMessage'],'as':_0x1111('0xb7')}]});})[_0x1111('0x29')](respondWithResult(_0x44e727,null))[_0x1111('0x1d')](handleError(_0x44e727,null));};exports[_0x1111('0xb8')]=function(_0x4b21a7,_0x2c0348){return db[_0x1111('0x4d')]['find']({'where':{'id':_0x4b21a7[_0x1111('0x65')]['id']},'include':[{'model':db[_0x1111('0x6a')],'as':_0x1111('0x48'),'raw':!![],'include':[{'model':db[_0x1111('0xb9')],'as':_0x1111('0xb9'),'raw':!![]}]}]})[_0x1111('0x29')](handleEntityNotFound(_0x2c0348,null))[_0x1111('0x29')](function(_0x10dc8b){if(!_0x10dc8b[_0x1111('0x48')])return;var _0x14c713=_0x10dc8b[_0x1111('0xae')]();return respondWithRpcPromise(_0x1111('0xba'),'verifySmtp',{'account':_0x14c713});})[_0x1111('0x29')](respondWithResult(_0x2c0348,null))[_0x1111('0x1d')](handleError(_0x2c0348,null));};exports[_0x1111('0x2d')]=function(_0x305dd1,_0x37062e){return db[_0x1111('0x4d')]['find']({'where':{'id':_0x305dd1[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x37062e,null))['then'](function(_0x3bbb68){if(_0x3bbb68&&_0x3bbb68['service']){throw new db['Sequelize'][(_0x1111('0xbb'))](_0x1111('0xbc'));}return _0x3bbb68;})[_0x1111('0x29')](removeEntity(_0x37062e,null))[_0x1111('0x1d')](handleError(_0x37062e,null));};exports[_0x1111('0xbd')]=function(_0x4ba5a0,_0x331c16){return db[_0x1111('0x4d')][_0x1111('0x6e')]({'where':{'id':_0x4ba5a0[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x331c16,null))['then'](function(_0x2909e6){if(_0x2909e6){return _0x2909e6[_0x1111('0xbd')](_0x4ba5a0[_0x1111('0x67')][_0x1111('0x79')],_[_0x1111('0x89')](_0x4ba5a0[_0x1111('0x67')],[_0x1111('0x79'),'id'])||{})[_0x1111('0xbe')](function(_0x2330fb){for(var _0x53a141=0x0;_0x53a141<_0x4ba5a0[_0x1111('0x67')][_0x1111('0x79')][_0x1111('0x56')];_0x53a141+=0x1){socket['emit'](_0x1111('0xbf'),{'UserId':Number(_0x4ba5a0[_0x1111('0x67')][_0x1111('0x79')][_0x53a141]),'MailAccountId':Number(_0x4ba5a0[_0x1111('0x65')]['id'])});}return _0x2330fb;});}})[_0x1111('0x29')](respondWithResult(_0x331c16,null))[_0x1111('0x1d')](handleError(_0x331c16,null));};exports['removeAgents']=function(_0x37be17,_0x42f415){return db['MailAccount'][_0x1111('0x6e')]({'where':{'id':_0x37be17[_0x1111('0x65')]['id']}})['then'](handleEntityNotFound(_0x42f415,null))['then'](function(_0x1b67de){if(_0x1b67de){return _0x1b67de[_0x1111('0xc0')](_0x37be17['query'][_0x1111('0x79')])[_0x1111('0x29')](function(){if(_[_0x1111('0xc1')](_0x37be17[_0x1111('0x51')][_0x1111('0x79')])){for(var _0x84b066=0x0;_0x84b066<_0x37be17[_0x1111('0x51')][_0x1111('0x79')][_0x1111('0x56')];_0x84b066+=0x1){socket[_0x1111('0xc2')](_0x1111('0xc3'),{'UserId':Number(_0x37be17[_0x1111('0x51')][_0x1111('0x79')][_0x84b066]),'MailAccountId':Number(_0x37be17[_0x1111('0x65')]['id'])});}}else{socket[_0x1111('0xc2')](_0x1111('0xc3'),{'UserId':Number(_0x37be17['query'][_0x1111('0x79')]),'MailAccountId':Number(_0x37be17['params']['id'])});}});}})['then'](respondWithStatusCode(_0x42f415,null))[_0x1111('0x1d')](handleError(_0x42f415,null));};exports[_0x1111('0xc4')]=function(_0x9b9845,_0x5117e8){var _0x4336f6={};var _0x126aa1={};var _0x2a8154;var _0x5c3e0d;return db[_0x1111('0x4d')][_0x1111('0x73')]({'where':{'id':_0x9b9845[_0x1111('0x65')]['id']}})[_0x1111('0x29')](handleEntityNotFound(_0x5117e8,null))['then'](function(_0x13174f){if(_0x13174f){_0x2a8154=_0x13174f;_0x126aa1[_0x1111('0x53')]=_['keys'](db[_0x1111('0x8c')][_0x1111('0x4e')]);_0x126aa1[_0x1111('0x51')]=_[_0x1111('0x50')](_0x9b9845[_0x1111('0x51')]);_0x126aa1[_0x1111('0x5c')]=_[_0x1111('0x52')](_0x126aa1['model'],_0x126aa1[_0x1111('0x51')]);_0x4336f6[_0x1111('0x54')]=_[_0x1111('0x52')](_0x126aa1['model'],qs[_0x1111('0x55')](_0x9b9845[_0x1111('0x51')][_0x1111('0x55')]));_0x4336f6[_0x1111('0x54')]=_0x4336f6[_0x1111('0x54')][_0x1111('0x56')]?_0x4336f6['attributes']:_0x126aa1[_0x1111('0x53')];_0x4336f6[_0x1111('0x59')]=qs[_0x1111('0x5a')](_0x9b9845[_0x1111('0x51')][_0x1111('0x5a')]);_0x4336f6['where']=qs[_0x1111('0x5c')](_['pick'](_0x9b9845[_0x1111('0x51')],_0x126aa1[_0x1111('0x5c')]));if(_0x9b9845[_0x1111('0x51')][_0x1111('0x5f')]){_0x4336f6[_0x1111('0x5b')]=_[_0x1111('0x5d')](_0x4336f6[_0x1111('0x5b')],{'$or':_['map'](_0x4336f6[_0x1111('0x54')],function(_0x912a0f){var _0x1876fd={};_0x1876fd[_0x912a0f]={'$like':'%'+_0x9b9845[_0x1111('0x51')][_0x1111('0x5f')]+'%'};return _0x1876fd;})});}_0x4336f6=_['merge']({},_0x4336f6,_0x9b9845[_0x1111('0x60')]);return _0x2a8154[_0x1111('0xc4')](_0x4336f6);}})[_0x1111('0x29')](function(_0x15895d){if(_0x15895d){_0x5c3e0d=_0x15895d[_0x1111('0x56')];if(!_0x9b9845['query'][_0x1111('0x57')]('nolimit')){_0x4336f6[_0x1111('0x25')]=qs['limit'](_0x9b9845[_0x1111('0x51')][_0x1111('0x25')]);_0x4336f6[_0x1111('0x24')]=qs[_0x1111('0x24')](_0x9b9845[_0x1111('0x51')]['offset']);}return _0x2a8154[_0x1111('0xc4')](_0x4336f6);}})[_0x1111('0x29')](function(_0x35ad40){if(_0x35ad40){return _0x35ad40?{'count':_0x5c3e0d,'rows':_0x35ad40}:null;}})[_0x1111('0x29')](respondWithResult(_0x5117e8,null))[_0x1111('0x1d')](handleError(_0x5117e8,null));}; \ No newline at end of file +var _0x62a9=['keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','Pause','intersection','update','custom','provider','body','modernAuthentication','find','params','MailServerIn','Mail\x20Account\x20not\x20found','describe','create','getDispositions','findOne','Disposition','MailAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','User','Owner','fullname','Tags','color','tag','transaction','sequelize','Transaction','MailApplication','destroy','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List','Contacts','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','path','lodash','juice','../../components/parsers/qs','api','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','get','MailAccounts','UserProfileResource','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','pass','CloudProviderId','host','port','secure','service','password','authentication','Imap','index','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','key','model','map','query'];(function(_0x23e6d6,_0x3fe925){var _0x531f33=function(_0x878f4f){while(--_0x878f4f){_0x23e6d6['push'](_0x23e6d6['shift']());}};_0x531f33(++_0x3fe925);}(_0x62a9,0x134));var _0x962a=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x62a9[_0x1d87fc];return _0x492b56;};'use strict';var moment=require('moment');var BPromise=require(_0x962a('0x0'));var util=require(_0x962a('0x1'));var path=require(_0x962a('0x2'));var _=require(_0x962a('0x3'));var juice=require(_0x962a('0x4'));var Redis=require('ioredis');var qs=require(_0x962a('0x5'));var logger=require('../../config/logger')(_0x962a('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x962a('0x7')]=_[_0x962a('0x8')](config[_0x962a('0x7')],{'host':_0x962a('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x962a('0xa'))[_0x962a('0xb')](socket);var jayson=require(_0x962a('0xc'));var client=jayson['client'][_0x962a('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x3f98d0,_0x48df84,_0x28b97c,_0x5c07ab){return new BPromise(function(_0x5e3766,_0x12958f){var _0x1bb01c=_0x5c07ab||client;return _0x1bb01c[_0x962a('0xe')](_0x3f98d0,_0x28b97c)[_0x962a('0xf')](function(_0x2be5fc){logger[_0x962a('0x10')](_0x962a('0x11'),_0x48df84,_0x962a('0x12'));logger['debug'](_0x962a('0x13'),_0x48df84,'request\x20sent',JSON[_0x962a('0x14')](_0x2be5fc));if(_0x2be5fc[_0x962a('0x15')]){if(_0x2be5fc[_0x962a('0x15')][_0x962a('0x16')]===0x1f4){logger[_0x962a('0x15')](_0x962a('0x11'),_0x48df84,_0x2be5fc[_0x962a('0x15')][_0x962a('0x17')]);return _0x12958f(_0x2be5fc[_0x962a('0x15')][_0x962a('0x17')]);}logger[_0x962a('0x15')](_0x962a('0x11'),_0x48df84,_0x2be5fc[_0x962a('0x15')]['message']);return _0x5e3766(_0x2be5fc['error']['message']);}else{logger[_0x962a('0x10')]('MailAccount,\x20%s,\x20%s',_0x48df84,_0x962a('0x12'));_0x5e3766(_0x2be5fc[_0x962a('0x18')][_0x962a('0x17')]);}})[_0x962a('0x19')](function(_0x17f804){logger[_0x962a('0x15')]('MailAccount,\x20%s,\x20%s',_0x48df84,_0x17f804);_0x12958f(_0x17f804);});});}function respondWithStatusCode(_0x265d45,_0xf347ac){_0xf347ac=_0xf347ac||0xcc;return function(_0x3be799){if(_0x3be799){return _0x265d45[_0x962a('0x1a')](_0xf347ac);}return _0x265d45[_0x962a('0x1b')](_0xf347ac)[_0x962a('0x1c')]();};}function respondWithResult(_0x202f7a,_0x5bb55b){_0x5bb55b=_0x5bb55b||0xc8;return function(_0x1cc8b0){if(_0x1cc8b0){return _0x202f7a[_0x962a('0x1b')](_0x5bb55b)['json'](_0x1cc8b0);}};}function respondWithFilteredResult(_0x281ec6,_0x26f133){return function(_0x4c8e1d){if(_0x4c8e1d){var _0x173a30=typeof _0x26f133[_0x962a('0x1d')]===_0x962a('0x1e')&&typeof _0x26f133[_0x962a('0x1f')]==='undefined';var _0x221925=_0x4c8e1d['count'];var _0x44ec0c=_0x173a30?0x0:_0x26f133[_0x962a('0x1d')];var _0x5e6bb1=_0x173a30?_0x4c8e1d[_0x962a('0x20')]:_0x26f133[_0x962a('0x1d')]+_0x26f133[_0x962a('0x1f')];var _0x5bd083;if(_0x5e6bb1>=_0x221925){_0x5e6bb1=_0x221925;_0x5bd083=0xc8;}else{_0x5bd083=0xce;}_0x281ec6[_0x962a('0x1b')](_0x5bd083);return _0x281ec6[_0x962a('0x21')](_0x962a('0x22'),_0x44ec0c+'-'+_0x5e6bb1+'/'+_0x221925)[_0x962a('0x23')](_0x4c8e1d);}return null;};}function saveUpdates(_0x2508e3){return function(_0x4c40ef){if(_0x4c40ef){return _0x4c40ef['update'](_0x2508e3)[_0x962a('0xf')](function(_0x3c7ab0){return _0x3c7ab0;});}return null;};}function removeEntity(_0x48c6fa){return function(_0x14d0e2){if(_0x14d0e2){return _0x14d0e2['destroy']()['then'](function(){var _0x2e8afe=_0x14d0e2[_0x962a('0x24')]({'plain':!![]});var _0x2ba07f=_0x962a('0x25');return db[_0x962a('0x26')]['destroy']({'where':{'type':_0x2ba07f,'resourceId':_0x2e8afe['id']}})[_0x962a('0xf')](function(){return _0x14d0e2;});})[_0x962a('0xf')](function(){_0x48c6fa[_0x962a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x598ee2){return function(_0x1b702e){if(!_0x1b702e){_0x598ee2[_0x962a('0x1a')](0x194);}return _0x1b702e;};}function handleError(_0x3b2e96,_0x4ede91){_0x4ede91=_0x4ede91||0x1f4;return function(_0x32454e){logger[_0x962a('0x15')](_0x32454e[_0x962a('0x27')]);if(_0x32454e[_0x962a('0x28')]){delete _0x32454e['name'];}_0x3b2e96[_0x962a('0x1b')](_0x4ede91)[_0x962a('0x29')](_0x32454e);};}function getImapHost(_0x5895d2){switch(_0x5895d2){case'gmail':return _0x962a('0x2a');case _0x962a('0x2b'):return _0x962a('0x2c');case _0x962a('0x2d'):return _0x962a('0x2e');case _0x962a('0x2f'):return _0x962a('0x30');}throw new Error(_0x962a('0x31'),_0x5895d2);}function getSmtpHost(_0x726118){switch(_0x726118){case'gmail':return _0x962a('0x32');case'yahoo':return _0x962a('0x33');case'hotmail':return _0x962a('0x34');case'outlook365':return _0x962a('0x35');}throw new Error(_0x962a('0x31'),_0x726118);}function getAuthenticationOptions(_0x2939e4,_0xbd8b94){var _0x532e80={};var _0xf57a16={};if(_0x2939e4){_0x532e80[_0x962a('0x36')]=_0xf57a16[_0x962a('0x36')]=_0xbd8b94[_0x962a('0x37')];_0x532e80['password']=_0xf57a16[_0x962a('0x38')]=_0xbd8b94['password'];if(_0xbd8b94['modernAuthentication']){_0x532e80['modernAuthentication']=_0xf57a16['modernAuthentication']=!![];_0x532e80[_0x962a('0x39')]=_0xf57a16['CloudProviderId']=_0xbd8b94[_0x962a('0x39')];_0x532e80['password']=_0xf57a16['pass']=null;}else{_0x532e80[_0x962a('0x39')]=_0xf57a16[_0x962a('0x39')]=null;}_0x532e80[_0x962a('0x3a')]=getImapHost(_0x2939e4);_0x532e80['port']=0x3e1;_0xf57a16[_0x962a('0x3a')]=getSmtpHost(_0x2939e4);_0xf57a16[_0x962a('0x3b')]=0x24b;_0xf57a16[_0x962a('0x3c')]=![];_0x532e80['service']=_0xf57a16[_0x962a('0x3d')]=null;}else{if(_0xbd8b94['authentication']){_0x532e80[_0x962a('0x36')]=_0xf57a16['user']=_0xbd8b94[_0x962a('0x37')];_0x532e80['password']=_0xf57a16[_0x962a('0x38')]=_0xbd8b94[_0x962a('0x3e')];}else{_0x532e80[_0x962a('0x3f')]=_0xf57a16[_0x962a('0x3f')]=![];_0x532e80[_0x962a('0x36')]=_0xf57a16[_0x962a('0x36')]=null;_0x532e80['password']=_0xf57a16[_0x962a('0x38')]=null;}_0x532e80['host']=_0xbd8b94[_0x962a('0x40')][_0x962a('0x3a')];_0x532e80['port']=_0xbd8b94[_0x962a('0x40')]['port'];_0xf57a16[_0x962a('0x3a')]=_0xbd8b94['Smtp'][_0x962a('0x3a')];_0xf57a16[_0x962a('0x3b')]=_0xbd8b94['Smtp']['port'];}return{'Imap':_0x532e80,'Smtp':_0xf57a16};}exports[_0x962a('0x41')]=function(_0x61f74e,_0x3752c4){var _0x1fc201={'include':[{'model':db['MailServerIn'],'as':_0x962a('0x40')},{'model':db[_0x962a('0x42')],'as':_0x962a('0x43')},{'model':db['Pause'],'as':_0x962a('0x44')}]},_0xc6b54={},_0x1e8203={'count':0x0,'rows':[]};var _0x5b5fa1=_['map'](db[_0x962a('0x45')][_0x962a('0x46')],function(_0x418703){return{'name':_0x418703[_0x962a('0x47')],'type':_0x418703['type'][_0x962a('0x48')]};});_0xc6b54[_0x962a('0x49')]=_[_0x962a('0x4a')](_0x5b5fa1,_0x962a('0x28'));_0xc6b54[_0x962a('0x4b')]=_[_0x962a('0x4c')](_0x61f74e[_0x962a('0x4b')]);_0xc6b54[_0x962a('0x4d')]=_['intersection'](_0xc6b54[_0x962a('0x49')],_0xc6b54['query']);_0x1fc201[_0x962a('0x4e')]=_['intersection'](_0xc6b54[_0x962a('0x49')],qs[_0x962a('0x4f')](_0x61f74e[_0x962a('0x4b')][_0x962a('0x4f')]));_0x1fc201[_0x962a('0x4e')]=_0x1fc201[_0x962a('0x4e')][_0x962a('0x50')]?_0x1fc201['attributes']:_0xc6b54['model'];if(!_0x61f74e[_0x962a('0x4b')][_0x962a('0x51')](_0x962a('0x52'))){_0x1fc201[_0x962a('0x1f')]=qs[_0x962a('0x1f')](_0x61f74e['query'][_0x962a('0x1f')]);_0x1fc201['offset']=qs[_0x962a('0x1d')](_0x61f74e[_0x962a('0x4b')]['offset']);}_0x1fc201[_0x962a('0x53')]=qs[_0x962a('0x54')](_0x61f74e[_0x962a('0x4b')][_0x962a('0x54')]);_0x1fc201[_0x962a('0x55')]=qs[_0x962a('0x4d')](_[_0x962a('0x56')](_0x61f74e[_0x962a('0x4b')],_0xc6b54[_0x962a('0x4d')]),_0x5b5fa1);if(_0x61f74e[_0x962a('0x4b')][_0x962a('0x57')]){_0x1fc201['where']=_[_0x962a('0x58')](_0x1fc201[_0x962a('0x55')],{'$or':_[_0x962a('0x4a')](_0x5b5fa1,function(_0x236890){if(_0x236890[_0x962a('0x59')]!==_0x962a('0x5a')){var _0x5cb056={};_0x5cb056[_0x236890[_0x962a('0x28')]]={'$like':'%'+_0x61f74e[_0x962a('0x4b')][_0x962a('0x57')]+'%'};return _0x5cb056;}})});}_0x1fc201=_['merge']({},_0x1fc201,_0x61f74e[_0x962a('0x5b')]);var _0x375f37={'where':_0x1fc201[_0x962a('0x55')]};return db[_0x962a('0x45')][_0x962a('0x20')](_0x375f37)[_0x962a('0xf')](function(_0x508f6a){_0x1e8203[_0x962a('0x20')]=_0x508f6a;if(_0x61f74e[_0x962a('0x4b')][_0x962a('0x5c')]){_0x1fc201[_0x962a('0x5d')]=[{'all':!![]}];}return db['MailAccount'][_0x962a('0x5e')](_0x1fc201);})[_0x962a('0xf')](function(_0x5563ad){_0x1e8203[_0x962a('0x5f')]=_0x5563ad;return _0x1e8203;})[_0x962a('0xf')](respondWithFilteredResult(_0x3752c4,_0x1fc201))[_0x962a('0x19')](handleError(_0x3752c4,null));};exports['show']=function(_0x29e1d6,_0x3178bd){var _0x3bdf76={'raw':![],'where':{'id':_0x29e1d6['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x962a('0x40')},{'model':db[_0x962a('0x42')],'as':_0x962a('0x43')},{'model':db[_0x962a('0x60')],'as':_0x962a('0x44')}]},_0x33126f={};_0x33126f[_0x962a('0x49')]=_[_0x962a('0x4c')](db['MailAccount'][_0x962a('0x46')]);_0x33126f[_0x962a('0x4b')]=_[_0x962a('0x4c')](_0x29e1d6[_0x962a('0x4b')]);_0x33126f[_0x962a('0x4d')]=_[_0x962a('0x61')](_0x33126f[_0x962a('0x49')],_0x33126f[_0x962a('0x4b')]);_0x3bdf76[_0x962a('0x4e')]=_[_0x962a('0x61')](_0x33126f[_0x962a('0x49')],qs[_0x962a('0x4f')](_0x29e1d6[_0x962a('0x4b')][_0x962a('0x4f')]));_0x3bdf76['attributes']=_0x3bdf76[_0x962a('0x4e')][_0x962a('0x50')]?_0x3bdf76[_0x962a('0x4e')]:_0x33126f[_0x962a('0x49')];if(_0x29e1d6[_0x962a('0x4b')][_0x962a('0x5c')]){_0x3bdf76[_0x962a('0x5d')]=[{'all':!![]}];}_0x3bdf76=_[_0x962a('0x58')]({},_0x3bdf76,_0x29e1d6[_0x962a('0x5b')]);return db[_0x962a('0x45')]['find'](_0x3bdf76)[_0x962a('0xf')](handleEntityNotFound(_0x3178bd,null))[_0x962a('0xf')](respondWithResult(_0x3178bd,null))[_0x962a('0x19')](handleError(_0x3178bd,null));};exports[_0x962a('0x62')]=function(_0x34cdb9,_0xfae18d){if(_0x34cdb9['body']['id']){delete _0x34cdb9['body']['id'];}var _0x12cf06=_0x34cdb9['body']['provider']===_0x962a('0x63')?null:_0x34cdb9['body'][_0x962a('0x64')];var _0x2b17b6=_0x34cdb9['body'][_0x962a('0x40')]||{};var _0x5164b5=_0x34cdb9[_0x962a('0x65')][_0x962a('0x43')]||{};if(_0x12cf06){_0x2b17b6[_0x962a('0x3a')]=getImapHost(_0x12cf06);_0x2b17b6[_0x962a('0x3b')]=0x3e1;_0x5164b5[_0x962a('0x3a')]=getSmtpHost(_0x12cf06);_0x5164b5['port']=0x24b;_0x5164b5[_0x962a('0x3c')]=![];}if(_0x5164b5['modernAuthentication']){_0x5164b5[_0x962a('0x3c')]=![];}else{_0x5164b5[_0x962a('0x39')]=null;}if(!_0x2b17b6[_0x962a('0x66')])_0x2b17b6['CloudProviderId']=null;_0x34cdb9[_0x962a('0x65')][_0x962a('0x40')]=_0x2b17b6;_0x34cdb9[_0x962a('0x65')][_0x962a('0x43')]=_0x5164b5;return db['MailAccount'][_0x962a('0x67')]({'where':{'id':_0x34cdb9[_0x962a('0x68')]['id']},'include':[{'model':db[_0x962a('0x69')],'as':_0x962a('0x40')},{'model':db[_0x962a('0x42')],'as':_0x962a('0x43')},{'model':db[_0x962a('0x60')],'as':_0x962a('0x44')}]})[_0x962a('0xf')](handleEntityNotFound(_0xfae18d,null))[_0x962a('0xf')](function(_0x162bbc){if(!_0x162bbc)throw new Error(_0x962a('0x6a'));if(_0x162bbc[_0x962a('0x3d')])delete _0x34cdb9[_0x962a('0x65')]['Imap'];return _0x162bbc;})[_0x962a('0xf')](saveUpdates(_0x34cdb9['body'],null))[_0x962a('0xf')](function(_0x143ca6){if(!_0x34cdb9['body'][_0x962a('0x40')])return _0x143ca6;return db[_0x962a('0x69')][_0x962a('0x62')](_0x34cdb9[_0x962a('0x65')]['Imap'],{'where':{'MailAccountId':_0x143ca6['id']}})['then'](function(){return _0x143ca6;});})[_0x962a('0xf')](function(_0x537859){if(!_0x34cdb9[_0x962a('0x65')][_0x962a('0x43')])return _0x537859;return db['MailServerOut'][_0x962a('0x62')](_0x34cdb9['body'][_0x962a('0x43')],{'where':{'MailAccountId':_0x537859['id']}})[_0x962a('0xf')](function(){return _0x537859;});})['then'](respondWithResult(_0xfae18d,null))[_0x962a('0x19')](handleError(_0xfae18d,null));};exports[_0x962a('0x6b')]=function(_0x1aae0c,_0x5d8dae){return db['MailAccount'][_0x962a('0x6b')]()[_0x962a('0xf')](respondWithResult(_0x5d8dae,null))['catch'](handleError(_0x5d8dae,null));};exports['addDisposition']=function(_0x3f80d2,_0xf18dc2){if(_0x3f80d2[_0x962a('0x65')]['id']){delete _0x3f80d2['body']['id'];}return db['MailAccount'][_0x962a('0x67')]({'where':{'id':_0x3f80d2[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0xf18dc2,null))['then'](function(_0x240abb){if(_0x240abb){_0x3f80d2[_0x962a('0x65')]['MailAccountId']=_0x240abb['id'];return db['Disposition'][_0x962a('0x6c')](_0x3f80d2[_0x962a('0x65')]);}})['then'](respondWithResult(_0xf18dc2,null))[_0x962a('0x19')](handleError(_0xf18dc2,null));};exports[_0x962a('0x6d')]=function(_0x402045,_0x5ec9e3){var _0x3e0a41={'raw':![],'where':{}};var _0x36ca86={};var _0x411e63={'count':0x0,'rows':[]};return db['MailAccount'][_0x962a('0x6e')]({'where':{'id':_0x402045[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x5ec9e3,null))[_0x962a('0xf')](function(_0x5a5d88){if(_0x5a5d88){_0x36ca86[_0x962a('0x49')]=_[_0x962a('0x4c')](db[_0x962a('0x6f')][_0x962a('0x46')]);_0x36ca86[_0x962a('0x4b')]=_[_0x962a('0x4c')](_0x402045[_0x962a('0x4b')]);_0x36ca86['filters']=_[_0x962a('0x61')](_0x36ca86['model'],_0x36ca86[_0x962a('0x4b')]);_0x3e0a41[_0x962a('0x4e')]=_[_0x962a('0x61')](_0x36ca86[_0x962a('0x49')],qs[_0x962a('0x4f')](_0x402045[_0x962a('0x4b')][_0x962a('0x4f')]));_0x3e0a41[_0x962a('0x4e')]=_0x3e0a41[_0x962a('0x4e')][_0x962a('0x50')]?_0x3e0a41[_0x962a('0x4e')]:_0x36ca86[_0x962a('0x49')];if(!_0x402045[_0x962a('0x4b')][_0x962a('0x51')](_0x962a('0x52'))){_0x3e0a41['limit']=qs[_0x962a('0x1f')](_0x402045[_0x962a('0x4b')][_0x962a('0x1f')]);_0x3e0a41[_0x962a('0x1d')]=qs[_0x962a('0x1d')](_0x402045[_0x962a('0x4b')]['offset']);}_0x3e0a41['order']=qs[_0x962a('0x54')](_0x402045[_0x962a('0x4b')][_0x962a('0x54')]);_0x3e0a41[_0x962a('0x55')]=qs[_0x962a('0x4d')](_[_0x962a('0x56')](_0x402045[_0x962a('0x4b')],_0x36ca86['filters']));_0x3e0a41[_0x962a('0x55')][_0x962a('0x70')]=_0x5a5d88['id'];if(_0x402045[_0x962a('0x4b')]['filter']){_0x3e0a41[_0x962a('0x55')]=_[_0x962a('0x58')](_0x3e0a41[_0x962a('0x55')],{'$or':_['map'](_0x3e0a41[_0x962a('0x4e')],function(_0x47c214){var _0x572482={};_0x572482[_0x47c214]={'$like':'%'+_0x402045[_0x962a('0x4b')][_0x962a('0x57')]+'%'};return _0x572482;})});}_0x3e0a41=_['merge']({},_0x3e0a41,_0x402045[_0x962a('0x5b')]);return db['Disposition'][_0x962a('0x20')]({'where':_0x3e0a41[_0x962a('0x55')]})[_0x962a('0xf')](function(_0x1bbd83){_0x411e63['count']=_0x1bbd83;if(_0x402045[_0x962a('0x4b')][_0x962a('0x5c')]){_0x3e0a41[_0x962a('0x5d')]=[{'all':!![]}];}return db[_0x962a('0x6f')][_0x962a('0x5e')](_0x3e0a41);})[_0x962a('0xf')](function(_0x5ba0f9){_0x411e63[_0x962a('0x5f')]=_0x5ba0f9;return _0x411e63;});}})[_0x962a('0xf')](respondWithFilteredResult(_0x5ec9e3,_0x3e0a41))['catch'](handleError(_0x5ec9e3,null));};exports[_0x962a('0x71')]=function(_0x11be0c,_0x4ac837){return db[_0x962a('0x45')][_0x962a('0x67')]({'where':{'id':_0x11be0c[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x4ac837,null))[_0x962a('0xf')](function(_0x4550c1){if(_0x4550c1){return _0x4550c1[_0x962a('0x71')](_0x11be0c['query'][_0x962a('0x72')]);}})[_0x962a('0xf')](respondWithStatusCode(_0x4ac837,null))[_0x962a('0x19')](handleError(_0x4ac837,null));};exports['addAnswer']=function(_0x3ef8c7,_0x17458c){if(_0x3ef8c7[_0x962a('0x65')]['id']){delete _0x3ef8c7['body']['id'];}return db['MailAccount'][_0x962a('0x67')]({'where':{'id':_0x3ef8c7[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x17458c,null))['then'](function(_0x12c77f){if(_0x12c77f){_0x3ef8c7[_0x962a('0x65')][_0x962a('0x70')]=_0x12c77f['id'];return db[_0x962a('0x73')][_0x962a('0x6c')](_0x3ef8c7[_0x962a('0x65')]);}})[_0x962a('0xf')](respondWithResult(_0x17458c,null))['catch'](handleError(_0x17458c,null));};exports[_0x962a('0x74')]=function(_0x2a9e36,_0x4372ab){var _0x5d2091={'raw':![],'where':{}};var _0x1bb10d={};var _0x3184cb={'count':0x0,'rows':[]};return db[_0x962a('0x45')][_0x962a('0x6e')]({'where':{'id':_0x2a9e36[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x4372ab,null))[_0x962a('0xf')](function(_0x115531){if(_0x115531){_0x1bb10d[_0x962a('0x49')]=_['keys'](db['CannedAnswer'][_0x962a('0x46')]);_0x1bb10d['query']=_[_0x962a('0x4c')](_0x2a9e36[_0x962a('0x4b')]);_0x1bb10d['filters']=_['intersection'](_0x1bb10d[_0x962a('0x49')],_0x1bb10d[_0x962a('0x4b')]);_0x5d2091[_0x962a('0x4e')]=_[_0x962a('0x61')](_0x1bb10d[_0x962a('0x49')],qs[_0x962a('0x4f')](_0x2a9e36['query']['fields']));_0x5d2091[_0x962a('0x4e')]=_0x5d2091[_0x962a('0x4e')]['length']?_0x5d2091[_0x962a('0x4e')]:_0x1bb10d[_0x962a('0x49')];if(!_0x2a9e36[_0x962a('0x4b')]['hasOwnProperty'](_0x962a('0x52'))){_0x5d2091[_0x962a('0x1f')]=qs[_0x962a('0x1f')](_0x2a9e36[_0x962a('0x4b')][_0x962a('0x1f')]);_0x5d2091[_0x962a('0x1d')]=qs['offset'](_0x2a9e36['query']['offset']);}_0x5d2091[_0x962a('0x53')]=qs['sort'](_0x2a9e36[_0x962a('0x4b')][_0x962a('0x54')]);_0x5d2091[_0x962a('0x55')]=qs[_0x962a('0x4d')](_[_0x962a('0x56')](_0x2a9e36[_0x962a('0x4b')],_0x1bb10d['filters']));_0x5d2091[_0x962a('0x55')][_0x962a('0x70')]=_0x115531['id'];if(_0x2a9e36[_0x962a('0x4b')]['filter']){_0x5d2091[_0x962a('0x55')]=_[_0x962a('0x58')](_0x5d2091['where'],{'$or':_[_0x962a('0x4a')](_0x5d2091[_0x962a('0x4e')],function(_0x1d7f3c){var _0x2a4f76={};_0x2a4f76[_0x1d7f3c]={'$like':'%'+_0x2a9e36['query'][_0x962a('0x57')]+'%'};return _0x2a4f76;})});}_0x5d2091=_[_0x962a('0x58')]({},_0x5d2091,_0x2a9e36[_0x962a('0x5b')]);return db[_0x962a('0x73')]['count']({'where':_0x5d2091[_0x962a('0x55')]})[_0x962a('0xf')](function(_0x22bcf3){_0x3184cb[_0x962a('0x20')]=_0x22bcf3;if(_0x2a9e36[_0x962a('0x4b')][_0x962a('0x5c')]){_0x5d2091['include']=[{'all':!![]}];}return db[_0x962a('0x73')][_0x962a('0x5e')](_0x5d2091);})['then'](function(_0x9eff4f){_0x3184cb[_0x962a('0x5f')]=_0x9eff4f;return _0x3184cb;});}})['then'](respondWithFilteredResult(_0x4372ab,_0x5d2091))[_0x962a('0x19')](handleError(_0x4372ab,null));};exports[_0x962a('0x75')]=function(_0x3f710f,_0x19aeb5){return db['MailAccount']['find']({'where':{'id':_0x3f710f[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x19aeb5,null))['then'](function(_0x767f16){if(_0x767f16){return _0x767f16[_0x962a('0x75')](_0x3f710f['query'][_0x962a('0x72')]);}})['then'](respondWithStatusCode(_0x19aeb5,null))[_0x962a('0x19')](handleError(_0x19aeb5,null));};exports[_0x962a('0x6c')]=function(_0x534eee,_0x2f4c59){var _0x2e656c={'name':_0x534eee[_0x962a('0x65')][_0x962a('0x28')],'key':_0x534eee['body'][_0x962a('0x48')],'provider':_0x534eee[_0x962a('0x65')][_0x962a('0x64')]===_0x962a('0x63')?null:_0x534eee[_0x962a('0x65')][_0x962a('0x64')],'email':_0x534eee[_0x962a('0x65')][_0x962a('0x76')],'ListId':_0x534eee[_0x962a('0x65')][_0x962a('0x77')],'active':!_['isNil'](_0x534eee['body']['active'])?_0x534eee[_0x962a('0x65')][_0x962a('0x78')]:!![],'description':_0x534eee[_0x962a('0x65')][_0x962a('0x79')]||null};var _0x3654bd=getAuthenticationOptions(_0x2e656c[_0x962a('0x64')],_0x534eee[_0x962a('0x65')]);_0x2e656c[_0x962a('0x40')]=_0x3654bd[_0x962a('0x40')];_0x2e656c[_0x962a('0x43')]=_0x3654bd[_0x962a('0x43')];return db[_0x962a('0x45')][_0x962a('0x6c')](_0x2e656c,{'include':[{'model':db['MailServerOut'],'as':_0x962a('0x43')},{'model':db[_0x962a('0x69')],'as':_0x962a('0x40')}]})[_0x962a('0xf')](function(_0x5169d2){var _0x5042a7=_0x534eee[_0x962a('0x36')][_0x962a('0x24')]({'plain':!![]});if(!_0x5042a7)throw new Error(_0x962a('0x7a'));if(_0x5042a7[_0x962a('0x7b')]===_0x962a('0x36')){var _0x3a3216=_0x5169d2['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x962a('0x25'),'userProfileId':_0x5042a7[_0x962a('0x7c')]},'raw':!![]})[_0x962a('0xf')](function(_0x1df4d3){if(_0x1df4d3&&_0x1df4d3['autoAssociation']===0x0){return db[_0x962a('0x26')]['create']({'name':_0x3a3216[_0x962a('0x28')],'resourceId':_0x3a3216['id'],'type':_0x1df4d3[_0x962a('0x28')],'sectionId':_0x1df4d3['id']},{})['then'](function(){return _0x5169d2;});}else{return _0x5169d2;}})[_0x962a('0x19')](function(_0x56bba7){logger[_0x962a('0x15')](_0x962a('0x7d'),_0x56bba7);throw _0x56bba7;});}return _0x5169d2;})[_0x962a('0xf')](respondWithResult(_0x2f4c59,0xc9))[_0x962a('0x19')](handleError(_0x2f4c59,null));};exports[_0x962a('0x7e')]=function(_0xb88087,_0x1c67b3){return db['MailAccount'][_0x962a('0x6e')]({'where':{'id':_0xb88087[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x1c67b3,null))[_0x962a('0xf')](function(_0x2adcb5){if(_0x2adcb5){return _0x2adcb5[_0x962a('0x7e')]();}return null;})[_0x962a('0xf')](respondWithResult(_0x1c67b3,null))[_0x962a('0x19')](handleError(_0x1c67b3,null));};exports[_0x962a('0x7f')]=function(_0x123ada,_0x10a159){if(_0x123ada[_0x962a('0x65')]['id']){delete _0x123ada[_0x962a('0x65')]['id'];}return db[_0x962a('0x45')]['find']({'where':{'id':_0x123ada['params']['id']}})['then'](handleEntityNotFound(_0x10a159,null))[_0x962a('0xf')](function(_0x5afabf){if(_0x5afabf){_0x123ada[_0x962a('0x65')][_0x962a('0x70')]=_0x5afabf['id'];return db[_0x962a('0x69')][_0x962a('0x6c')](_0x123ada[_0x962a('0x65')]);}})['then'](respondWithResult(_0x10a159,null))['catch'](handleError(_0x10a159,null));};exports[_0x962a('0x80')]=function(_0xd6b0d,_0xa749fe){return db[_0x962a('0x45')][_0x962a('0x6e')]({'where':{'id':_0xd6b0d[_0x962a('0x68')]['id']}})['then'](handleEntityNotFound(_0xa749fe,null))[_0x962a('0xf')](function(_0x450d10){if(_0x450d10){return _0x450d10[_0x962a('0x81')](null);}return null;})['then'](respondWithStatusCode(_0xa749fe,null))[_0x962a('0x19')](handleError(_0xa749fe,null));};exports[_0x962a('0x82')]=function(_0x35343c,_0x2374d6){return db[_0x962a('0x45')][_0x962a('0x6e')]({'where':{'id':_0x35343c[_0x962a('0x68')]['id']}})['then'](handleEntityNotFound(_0x2374d6,null))[_0x962a('0xf')](function(_0x501ca8){if(_0x501ca8){return _0x501ca8[_0x962a('0x82')]();}return null;})[_0x962a('0xf')](respondWithResult(_0x2374d6,null))[_0x962a('0x19')](handleError(_0x2374d6,null));};exports['addSmtp']=function(_0x442412,_0x25b27c){if(_0x442412[_0x962a('0x65')]['id']){delete _0x442412['body']['id'];}return db[_0x962a('0x45')]['find']({'where':{'id':_0x442412[_0x962a('0x68')]['id']}})['then'](handleEntityNotFound(_0x25b27c,null))[_0x962a('0xf')](function(_0x395cb5){if(_0x395cb5){_0x442412[_0x962a('0x65')][_0x962a('0x70')]=_0x395cb5['id'];return db[_0x962a('0x42')][_0x962a('0x6c')](_0x442412[_0x962a('0x65')]);}})[_0x962a('0xf')](respondWithResult(_0x25b27c,null))['catch'](handleError(_0x25b27c,null));};exports[_0x962a('0x83')]=function(_0x29f05f,_0x4b8ffa){return db[_0x962a('0x45')]['findOne']({'where':{'id':_0x29f05f[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x4b8ffa,null))[_0x962a('0xf')](function(_0x1becc3){if(_0x1becc3){return _0x1becc3['setSmtp'](null);}return null;})[_0x962a('0xf')](respondWithStatusCode(_0x4b8ffa,null))[_0x962a('0x19')](handleError(_0x4b8ffa,null));};exports[_0x962a('0x84')]=function(_0x32d2e9,_0x4be205){return db[_0x962a('0x85')]['find']({'where':{'id':_0x32d2e9[_0x962a('0x68')]['id']}})['then'](handleEntityNotFound(_0x4be205,null))[_0x962a('0xf')](function(_0x1863ef){if(_0x1863ef){return _0x1863ef[_0x962a('0x84')](_0x32d2e9[_0x962a('0x65')][_0x962a('0x72')],_['omit'](_0x32d2e9[_0x962a('0x65')],['ids','id'])||{});}})[_0x962a('0xf')](respondWithResult(_0x4be205,null))[_0x962a('0x19')](handleError(_0x4be205,null));};exports[_0x962a('0x86')]=function(_0x2650c1,_0x21479b){var _0x5ec139={'raw':![],'where':{}};var _0x4b6cbb={};var _0x58904a={'count':0x0,'rows':[]};return db['MailAccount'][_0x962a('0x6e')]({'where':{'id':_0x2650c1['params']['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x21479b,null))[_0x962a('0xf')](function(_0xa6dbcf){if(_0xa6dbcf){_0x4b6cbb[_0x962a('0x49')]=_['keys'](db[_0x962a('0x85')]['rawAttributes']);_0x4b6cbb['query']=_[_0x962a('0x4c')](_0x2650c1[_0x962a('0x4b')]);_0x4b6cbb[_0x962a('0x4d')]=_['intersection'](_0x4b6cbb['model'],_0x4b6cbb[_0x962a('0x4b')]);_0x5ec139[_0x962a('0x4e')]=_[_0x962a('0x61')](_0x4b6cbb[_0x962a('0x49')],qs[_0x962a('0x4f')](_0x2650c1[_0x962a('0x4b')][_0x962a('0x4f')]));_0x5ec139[_0x962a('0x4e')]=_0x5ec139[_0x962a('0x4e')][_0x962a('0x50')]?_0x5ec139['attributes']:_0x4b6cbb[_0x962a('0x49')];if(!_0x2650c1[_0x962a('0x4b')][_0x962a('0x51')](_0x962a('0x52'))){_0x5ec139['limit']=qs[_0x962a('0x1f')](_0x2650c1[_0x962a('0x4b')]['limit']);_0x5ec139[_0x962a('0x1d')]=qs[_0x962a('0x1d')](_0x2650c1[_0x962a('0x4b')][_0x962a('0x1d')]);}_0x5ec139[_0x962a('0x53')]=qs['sort'](_0x2650c1[_0x962a('0x4b')][_0x962a('0x54')]);_0x5ec139[_0x962a('0x55')]=qs[_0x962a('0x4d')](_['pick'](_0x2650c1[_0x962a('0x4b')],_0x4b6cbb['filters']));_0x5ec139['where']['MailAccountId']=_0xa6dbcf['id'];if(_0x2650c1[_0x962a('0x4b')]['filter']){_0x5ec139[_0x962a('0x55')]=_[_0x962a('0x58')](_0x5ec139['where'],{'$or':_['map'](_0x5ec139[_0x962a('0x4e')],function(_0x144029){var _0x5d9d6d={};_0x5d9d6d[_0x144029]={'$like':'%'+_0x2650c1[_0x962a('0x4b')]['filter']+'%'};return _0x5d9d6d;})});}_0x5ec139=_['merge']({},_0x5ec139,_0x2650c1[_0x962a('0x5b')]);return db[_0x962a('0x85')][_0x962a('0x20')]({'where':_0x5ec139[_0x962a('0x55')]})[_0x962a('0xf')](function(_0x58fe4b){_0x58904a[_0x962a('0x20')]=_0x58fe4b;if(_0x2650c1['query'][_0x962a('0x5c')]){_0x5ec139['include']=[{'model':db[_0x962a('0x87')],'as':'Contact','required':![]},{'model':db[_0x962a('0x88')],'as':_0x962a('0x89'),'attributes':[_0x962a('0x28'),_0x962a('0x8a'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x962a('0x8b'),'attributes':['id',_0x962a('0x28'),_0x962a('0x8c')],'where':_0x2650c1[_0x962a('0x4b')][_0x962a('0x8d')]?{'id':_0x2650c1['query']['tag']}:undefined,'required':_0x2650c1[_0x962a('0x4b')][_0x962a('0x8d')]?!![]:![]}];}return db[_0x962a('0x85')][_0x962a('0x5e')](_0x5ec139);})[_0x962a('0xf')](function(_0x5717b1){_0x58904a[_0x962a('0x5f')]=_0x5717b1;return _0x58904a;});}})[_0x962a('0xf')](respondWithFilteredResult(_0x21479b,_0x5ec139))['catch'](handleError(_0x21479b,null));};exports['addApplications']=function addApplications(_0x46186d,_0x3e5aa9){var _0x5b4f8c=_0x46186d[_0x962a('0x68')]['id'];var _0x3ddaa2=_0x46186d[_0x962a('0x65')];var _0x2febd7=0xc8;var _0x46a8b3=null;return db['sequelize'][_0x962a('0x8e')]({'isolationLevel':db[_0x962a('0x8f')][_0x962a('0x90')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3cf315){return db[_0x962a('0x45')][_0x962a('0x6e')]({'where':{'id':_0x5b4f8c},'transaction':_0x3cf315})[_0x962a('0xf')](function(_0x1d48dc){if(_0x1d48dc){return db[_0x962a('0x91')][_0x962a('0x92')]({'where':{'MailAccountId':_0x5b4f8c},'transaction':_0x3cf315})['then'](function(){var _0x35bb73=_['map'](_0x3ddaa2,function(_0x468418){_0x468418['MailAccountId']=_0x5b4f8c;return _0x468418;});return db[_0x962a('0x91')][_0x962a('0x93')](_0x35bb73,{'transaction':_0x3cf315});});}else{_0x2febd7=0x194;_0x46a8b3=[];}});})[_0x962a('0xf')](function(){if(_0x2febd7!==0x194){return db[_0x962a('0x91')][_0x962a('0x94')]({'where':{'MailAccountId':_0x5b4f8c},'order':_0x962a('0x95')})[_0x962a('0xf')](function(_0x37d0b2){_0x46a8b3=_0x37d0b2;});}})[_0x962a('0x19')](function(_0x14ca77){_0x2febd7=0x1f4;logger[_0x962a('0x15')](_0x14ca77[_0x962a('0x27')]);if(_0x14ca77[_0x962a('0x28')]){delete _0x14ca77['name'];}_0x46a8b3=_0x14ca77;})['finally'](function(){if(_0x46a8b3===null){_0x3e5aa9[_0x962a('0x1a')](_0x2febd7);}else{if(_0x2febd7===0x1f4){_0x3e5aa9[_0x962a('0x1b')](_0x2febd7)[_0x962a('0x29')](_0x46a8b3);}else{_0x3e5aa9[_0x962a('0x1b')](_0x2febd7)['json'](_0x46a8b3);}}});};exports['getApplications']=function(_0x543b68,_0x1f8d56){var _0x1b5403={};var _0xe38975={};var _0xbdc1dc;var _0x525804;return db[_0x962a('0x45')][_0x962a('0x6e')]({'where':{'id':_0x543b68[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x1f8d56,null))[_0x962a('0xf')](function(_0x45de3b){if(_0x45de3b){_0xbdc1dc=_0x45de3b;_0xe38975['model']=_[_0x962a('0x4c')](db[_0x962a('0x91')]['rawAttributes']);_0xe38975[_0x962a('0x4b')]=_[_0x962a('0x4c')](_0x543b68[_0x962a('0x4b')]);_0xe38975['filters']=_[_0x962a('0x61')](_0xe38975['model'],_0xe38975[_0x962a('0x4b')]);_0x1b5403[_0x962a('0x4e')]=_[_0x962a('0x61')](_0xe38975[_0x962a('0x49')],qs[_0x962a('0x4f')](_0x543b68[_0x962a('0x4b')][_0x962a('0x4f')]));_0x1b5403[_0x962a('0x4e')]=_0x1b5403['attributes']['length']?_0x1b5403['attributes']:_0xe38975[_0x962a('0x49')];_0x1b5403[_0x962a('0x53')]=qs[_0x962a('0x54')](_0x543b68[_0x962a('0x4b')][_0x962a('0x54')]);_0x1b5403[_0x962a('0x55')]=qs[_0x962a('0x4d')](_[_0x962a('0x56')](_0x543b68[_0x962a('0x4b')],_0xe38975[_0x962a('0x4d')]));if(_0x543b68[_0x962a('0x4b')][_0x962a('0x57')]){_0x1b5403['where']=_[_0x962a('0x58')](_0x1b5403[_0x962a('0x55')],{'$or':_['map'](_0x1b5403[_0x962a('0x4e')],function(_0x2e39cb){var _0x4ded3a={};_0x4ded3a[_0x2e39cb]={'$like':'%'+_0x543b68[_0x962a('0x4b')][_0x962a('0x57')]+'%'};return _0x4ded3a;})});}_0x1b5403=_[_0x962a('0x58')]({},_0x1b5403,_0x543b68[_0x962a('0x5b')]);return _0xbdc1dc[_0x962a('0x96')](_0x1b5403);}})[_0x962a('0xf')](function(_0x42e607){if(_0x42e607){_0x525804=_0x42e607[_0x962a('0x50')];if(!_0x543b68[_0x962a('0x4b')][_0x962a('0x51')]('nolimit')){_0x1b5403[_0x962a('0x1f')]=qs[_0x962a('0x1f')](_0x543b68['query'][_0x962a('0x1f')]);_0x1b5403[_0x962a('0x1d')]=qs[_0x962a('0x1d')](_0x543b68['query'][_0x962a('0x1d')]);}return _0xbdc1dc[_0x962a('0x96')](_0x1b5403);}})[_0x962a('0xf')](function(_0x3675f1){if(_0x3675f1){return _0x3675f1?{'count':_0x525804,'rows':_0x3675f1}:null;}})[_0x962a('0xf')](respondWithResult(_0x1f8d56,null))[_0x962a('0x19')](handleError(_0x1f8d56,null));};exports[_0x962a('0x97')]=function(_0x531393,_0x59496d){var _0x1cb193={'raw':!![],'where':{}};var _0x145871={};var _0x4182de={'count':0x0,'rows':[]};return db[_0x962a('0x45')][_0x962a('0x6e')]({'where':{'id':_0x531393[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x59496d,null))[_0x962a('0xf')](function(_0x11fb29){if(_0x11fb29){_0x145871[_0x962a('0x49')]=_[_0x962a('0x4c')](db[_0x962a('0x98')][_0x962a('0x46')]);_0x145871[_0x962a('0x4b')]=_[_0x962a('0x4c')](_0x531393[_0x962a('0x4b')]);_0x145871[_0x962a('0x4d')]=_['intersection'](_0x145871[_0x962a('0x49')],_0x145871['query']);_0x1cb193['attributes']=_[_0x962a('0x61')](_0x145871[_0x962a('0x49')],qs['fields'](_0x531393[_0x962a('0x4b')][_0x962a('0x4f')]));_0x1cb193[_0x962a('0x4e')]=_0x1cb193[_0x962a('0x4e')]['length']?_0x1cb193[_0x962a('0x4e')]:_0x145871[_0x962a('0x49')];if(!_0x531393['query'][_0x962a('0x51')](_0x962a('0x52'))){_0x1cb193[_0x962a('0x1f')]=qs[_0x962a('0x1f')](_0x531393[_0x962a('0x4b')]['limit']);_0x1cb193[_0x962a('0x1d')]=qs[_0x962a('0x1d')](_0x531393[_0x962a('0x4b')][_0x962a('0x1d')]);}_0x1cb193[_0x962a('0x53')]=qs['sort'](_0x531393[_0x962a('0x4b')][_0x962a('0x54')]);_0x1cb193['where']=qs['filters'](_[_0x962a('0x56')](_0x531393[_0x962a('0x4b')],_0x145871[_0x962a('0x4d')]));_0x1cb193[_0x962a('0x55')][_0x962a('0x70')]=_0x11fb29['id'];if(_0x531393['query'][_0x962a('0x57')]){_0x1cb193[_0x962a('0x55')]=_[_0x962a('0x58')](_0x1cb193[_0x962a('0x55')],{'$or':_[_0x962a('0x4a')](_0x1cb193[_0x962a('0x4e')],function(_0x1980ee){var _0x3387c4={};_0x3387c4[_0x1980ee]={'$like':'%'+_0x531393[_0x962a('0x4b')][_0x962a('0x57')]+'%'};return _0x3387c4;})});}if(_0x531393[_0x962a('0x4b')][_0x962a('0x99')]){var _0x1c832d=_0x531393['query'][_0x962a('0x99')][_0x962a('0x9a')](',');var _0x510cb5={};_0x510cb5[_0x1c832d[0x0]]={'$gte':moment(_0x1c832d[0x1])[_0x962a('0x9b')](_0x962a('0x9c'))};_0x1cb193['where']=_[_0x962a('0x58')](_0x1cb193[_0x962a('0x55')],_0x510cb5);}_0x1cb193=_[_0x962a('0x58')]({},_0x1cb193,_0x531393[_0x962a('0x5b')]);return db[_0x962a('0x98')][_0x962a('0x20')]({'where':_0x1cb193[_0x962a('0x55')]})[_0x962a('0xf')](function(_0x3a55a5){_0x4182de[_0x962a('0x20')]=_0x3a55a5;if(_0x531393['query'][_0x962a('0x5c')]){_0x1cb193[_0x962a('0x5d')]=[{'all':!![]}];}return db[_0x962a('0x98')][_0x962a('0x5e')](_0x1cb193);})[_0x962a('0xf')](function(_0x1eb1c6){if(_0x531393[_0x962a('0x4b')]['inlineCss']===_0x962a('0x9d')){for(var _0x2c5518=0x0;_0x2c5518<_0x1eb1c6['length'];_0x2c5518++){_0x1eb1c6[_0x2c5518][_0x962a('0x65')]=juice(_0x1eb1c6[_0x2c5518][_0x962a('0x65')]);}}_0x4182de[_0x962a('0x5f')]=_0x1eb1c6;return _0x4182de;});}})[_0x962a('0xf')](respondWithFilteredResult(_0x59496d,_0x1cb193))[_0x962a('0x19')](handleError(_0x59496d,null));};exports[_0x962a('0x29')]=function(_0x3ba1c1,_0x1d9ead){var _0xe59d6f,_0x292f1e={},_0x5bfa8a;if(_0x3ba1c1[_0x962a('0x65')]['to']){_0x5bfa8a=_0x3ba1c1[_0x962a('0x65')]['to'][_0x962a('0x9a')](',')[0x0];}return db[_0x962a('0x45')][_0x962a('0x67')]({'where':{'id':_0x3ba1c1[_0x962a('0x68')]['id']},'include':[{'model':db[_0x962a('0x9e')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x5bfa8a},'limit':0x1,'order':[[_0x962a('0x9f'),_0x962a('0xa0')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x962a('0xa1')],'as':_0x962a('0xa1'),'raw':!![]}]}]})[_0x962a('0xf')](handleEntityNotFound(_0x1d9ead,null))[_0x962a('0xf')](function(_0x51bd41){if(!_0x51bd41)return;_0xe59d6f=_0x51bd41;if(!_0x51bd41[_0x962a('0x43')])throw new Error(_0x962a('0xa2'));if(_[_0x962a('0xa3')](_0x3ba1c1[_0x962a('0x65')]['from'])){_0x3ba1c1[_0x962a('0x65')][_0x962a('0xa4')]=util[_0x962a('0x9b')](_0x962a('0xa5'),_0x51bd41['name'],_0x51bd41['email']||_0x51bd41[_0x962a('0x43')][_0x962a('0x36')]);}if(_0x3ba1c1['body'][_0x962a('0xa6')]&&_0x3ba1c1['body'][_0x962a('0xa6')]['length']){for(var _0xd2eb1c=0x0;_0xd2eb1c<_0x3ba1c1[_0x962a('0x65')][_0x962a('0xa6')][_0x962a('0x50')];_0xd2eb1c+=0x1){_0x3ba1c1[_0x962a('0x65')][_0x962a('0xa6')][_0xd2eb1c]={'filename':_0x3ba1c1[_0x962a('0x65')][_0x962a('0xa6')][_0xd2eb1c][_0x962a('0x28')],'path':path[_0x962a('0xa7')](config['root'],_0x962a('0xa8'),_0x3ba1c1[_0x962a('0x65')][_0x962a('0xa6')][_0xd2eb1c][_0x962a('0xa9')])};}}var _0x1a13a2=_0x51bd41[_0x962a('0xaa')]();return respondWithRpcPromise(_0x962a('0xab'),_0x962a('0xac'),{'account':_0x1a13a2,'message':_0x3ba1c1[_0x962a('0x65')]});})[_0x962a('0xf')](function(_0x36b76e){if(!_0x36b76e)return;_0x292f1e=_0x36b76e;if(!_0xe59d6f[_0x962a('0xad')])throw new Error('List\x20not\x20found');if(_0xe59d6f['List'][_0x962a('0xae')]['length'])return _0xe59d6f[_0x962a('0xad')][_0x962a('0xae')][0x0];return db[_0x962a('0x87')]['create'](_[_0x962a('0x8')](_0x3ba1c1[_0x962a('0x65')],{'firstName':_0x3ba1c1[_0x962a('0x65')]['to'],'email':_0x3ba1c1['body']['to'],'phone':_0x3ba1c1[_0x962a('0x65')]['to'],'ListId':_0xe59d6f[_0x962a('0x77')]}));})['then'](function(_0x3889c1){if(!_0x3889c1)return;var _0xcd61a3={'UserId':_0x3ba1c1[_0x962a('0x36')]['id'],'ContactId':_0x3889c1['id'],'MailAccountId':_0xe59d6f['id'],'inReplyTo':_0x292f1e[_0x962a('0xaf')],'to':_0x3ba1c1[_0x962a('0x65')][_0x962a('0xa4')],'cc':_0x3ba1c1[_0x962a('0x65')]['cc'],'subject':_0x3ba1c1['body'][_0x962a('0xb0')],'attach':_0x3ba1c1[_0x962a('0x65')][_0x962a('0xb1')],'firstMsgDirection':_0x962a('0xb2'),'lastMsgAt':moment()[_0x962a('0x9b')](_0x962a('0x9c')),'lastMsgDirection':_0x962a('0xb2'),'Messages':[_[_0x962a('0x58')](_0x3ba1c1[_0x962a('0x65')],{'messageId':_0x292f1e['messageId'],'sentAt':moment()[_0x962a('0x9b')](_0x962a('0x9c')),'read':!![],'MailAccountId':_0xe59d6f['id'],'UserId':_0x3ba1c1[_0x962a('0x36')]['id'],'ContactId':_0x3889c1['id']})]};if(_0x3ba1c1['body'][_0x962a('0xb3')]){_0xcd61a3=_[_0x962a('0x58')](_0xcd61a3,_0x3ba1c1[_0x962a('0x65')][_0x962a('0xb3')]);}return db[_0x962a('0x85')][_0x962a('0x6c')](_0xcd61a3,{'include':[{'model':db[_0x962a('0x98')],'as':'Messages'}]});})[_0x962a('0xf')](respondWithResult(_0x1d9ead,null))['catch'](handleError(_0x1d9ead,null));};exports[_0x962a('0xb4')]=function(_0x34d9c6,_0x568fd9){return db['MailAccount']['find']({'where':{'id':_0x34d9c6['params']['id']},'include':[{'model':db[_0x962a('0x42')],'as':_0x962a('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x962a('0xa1'),'raw':!![]}]}]})[_0x962a('0xf')](handleEntityNotFound(_0x568fd9,null))[_0x962a('0xf')](function(_0x1d76c7){if(!_0x1d76c7['Smtp'])return;var _0x449102=_0x1d76c7[_0x962a('0xaa')]();return respondWithRpcPromise(_0x962a('0xb5'),_0x962a('0xb4'),{'account':_0x449102});})[_0x962a('0xf')](respondWithResult(_0x568fd9,null))[_0x962a('0x19')](handleError(_0x568fd9,null));};exports[_0x962a('0x92')]=function(_0x28fd41,_0x92c1c){return db[_0x962a('0x45')][_0x962a('0x67')]({'where':{'id':_0x28fd41[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x92c1c,null))[_0x962a('0xf')](function(_0x3583a2){if(_0x3583a2&&_0x3583a2[_0x962a('0x3d')]){throw new db['Sequelize']['ValidationError'](_0x962a('0xb6'));}return _0x3583a2;})[_0x962a('0xf')](removeEntity(_0x92c1c,null))[_0x962a('0x19')](handleError(_0x92c1c,null));};exports[_0x962a('0xb7')]=function(_0x55e963,_0x532ee6){return db[_0x962a('0x45')]['find']({'where':{'id':_0x55e963[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x532ee6,null))[_0x962a('0xf')](function(_0x8e60e3){if(_0x8e60e3){return _0x8e60e3[_0x962a('0xb7')](_0x55e963['body']['ids'],_[_0x962a('0xb8')](_0x55e963[_0x962a('0x65')],[_0x962a('0x72'),'id'])||{})[_0x962a('0xb9')](function(_0x3826e2){for(var _0xc17a7=0x0;_0xc17a7<_0x55e963['body'][_0x962a('0x72')][_0x962a('0x50')];_0xc17a7+=0x1){socket[_0x962a('0xba')](_0x962a('0xbb'),{'UserId':Number(_0x55e963[_0x962a('0x65')]['ids'][_0xc17a7]),'MailAccountId':Number(_0x55e963[_0x962a('0x68')]['id'])});}return _0x3826e2;});}})[_0x962a('0xf')](respondWithResult(_0x532ee6,null))[_0x962a('0x19')](handleError(_0x532ee6,null));};exports['removeAgents']=function(_0xa9dc03,_0x620f44){return db[_0x962a('0x45')]['find']({'where':{'id':_0xa9dc03[_0x962a('0x68')]['id']}})[_0x962a('0xf')](handleEntityNotFound(_0x620f44,null))[_0x962a('0xf')](function(_0x3e7113){if(_0x3e7113){return _0x3e7113[_0x962a('0xbc')](_0xa9dc03[_0x962a('0x4b')]['ids'])[_0x962a('0xf')](function(){if(_[_0x962a('0xbd')](_0xa9dc03['query']['ids'])){for(var _0x48041e=0x0;_0x48041e<_0xa9dc03[_0x962a('0x4b')][_0x962a('0x72')][_0x962a('0x50')];_0x48041e+=0x1){socket[_0x962a('0xba')](_0x962a('0xbe'),{'UserId':Number(_0xa9dc03['query'][_0x962a('0x72')][_0x48041e]),'MailAccountId':Number(_0xa9dc03[_0x962a('0x68')]['id'])});}}else{socket['emit'](_0x962a('0xbe'),{'UserId':Number(_0xa9dc03[_0x962a('0x4b')]['ids']),'MailAccountId':Number(_0xa9dc03[_0x962a('0x68')]['id'])});}});}})[_0x962a('0xf')](respondWithStatusCode(_0x620f44,null))[_0x962a('0x19')](handleError(_0x620f44,null));};exports[_0x962a('0xbf')]=function(_0x318123,_0x4514f9){var _0x126761={};var _0x567fb2={};var _0x2302d1;var _0x4d34ae;return db[_0x962a('0x45')]['findOne']({'where':{'id':_0x318123[_0x962a('0x68')]['id']}})['then'](handleEntityNotFound(_0x4514f9,null))[_0x962a('0xf')](function(_0x2fc572){if(_0x2fc572){_0x2302d1=_0x2fc572;_0x567fb2['model']=_[_0x962a('0x4c')](db[_0x962a('0x88')][_0x962a('0x46')]);_0x567fb2['query']=_['keys'](_0x318123[_0x962a('0x4b')]);_0x567fb2[_0x962a('0x4d')]=_['intersection'](_0x567fb2['model'],_0x567fb2['query']);_0x126761[_0x962a('0x4e')]=_[_0x962a('0x61')](_0x567fb2[_0x962a('0x49')],qs['fields'](_0x318123[_0x962a('0x4b')][_0x962a('0x4f')]));_0x126761[_0x962a('0x4e')]=_0x126761[_0x962a('0x4e')][_0x962a('0x50')]?_0x126761[_0x962a('0x4e')]:_0x567fb2[_0x962a('0x49')];_0x126761[_0x962a('0x53')]=qs[_0x962a('0x54')](_0x318123[_0x962a('0x4b')][_0x962a('0x54')]);_0x126761[_0x962a('0x55')]=qs['filters'](_[_0x962a('0x56')](_0x318123['query'],_0x567fb2[_0x962a('0x4d')]));if(_0x318123['query'][_0x962a('0x57')]){_0x126761[_0x962a('0x55')]=_['merge'](_0x126761[_0x962a('0x55')],{'$or':_[_0x962a('0x4a')](_0x126761[_0x962a('0x4e')],function(_0x2a12d4){var _0x560b15={};_0x560b15[_0x2a12d4]={'$like':'%'+_0x318123[_0x962a('0x4b')][_0x962a('0x57')]+'%'};return _0x560b15;})});}_0x126761=_['merge']({},_0x126761,_0x318123[_0x962a('0x5b')]);return _0x2302d1['getAgents'](_0x126761);}})[_0x962a('0xf')](function(_0x479a29){if(_0x479a29){_0x4d34ae=_0x479a29['length'];if(!_0x318123[_0x962a('0x4b')][_0x962a('0x51')](_0x962a('0x52'))){_0x126761[_0x962a('0x1f')]=qs[_0x962a('0x1f')](_0x318123[_0x962a('0x4b')][_0x962a('0x1f')]);_0x126761[_0x962a('0x1d')]=qs[_0x962a('0x1d')](_0x318123['query']['offset']);}return _0x2302d1[_0x962a('0xbf')](_0x126761);}})[_0x962a('0xf')](function(_0x5442e9){if(_0x5442e9){return _0x5442e9?{'count':_0x4d34ae,'rows':_0x5442e9}:null;}})[_0x962a('0xf')](respondWithResult(_0x4514f9,null))['catch'](handleError(_0x4514f9,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 582b2df..c9cb66c 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 _0x794b=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x794b,0x1c2));var _0xb794=function(_0x2c22dc,_0x277d94){_0x2c22dc=_0x2c22dc-0x0;var _0x118d78=_0x794b[_0x2c22dc];return _0x118d78;};'use strict';var EventEmitter=require(_0xb794('0x0'));var MailAccount=require(_0xb794('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb794('0x2')](0x0);var events={'afterCreate':_0xb794('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xf9af2a){return function(_0x241c85,_0x4d00a4,_0x5dc6dc){MailAccountEvents[_0xb794('0x4')](_0xf9af2a+':'+_0x241c85['id'],_0x241c85);MailAccountEvents[_0xb794('0x4')](_0xf9af2a,_0x241c85);_0x5dc6dc(null);};}for(var e in events){if(events[_0xb794('0x5')](e)){var event=events[e];MailAccount[_0xb794('0x6')](e,emitEvent(event));}}module[_0xb794('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x4cb5=['../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5426e0,_0x316e4f){var _0x4aedec=function(_0x33975a){while(--_0x33975a){_0x5426e0['push'](_0x5426e0['shift']());}};_0x4aedec(++_0x316e4f);}(_0x4cb5,0x8f));var _0x54cb=function(_0x2e1a49,_0x5a4f26){_0x2e1a49=_0x2e1a49-0x0;var _0x56234d=_0x4cb5[_0x2e1a49];return _0x56234d;};'use strict';var EventEmitter=require(_0x54cb('0x0'));var MailAccount=require(_0x54cb('0x1'))['db'][_0x54cb('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x54cb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x54cb('0x4'),'afterDestroy':_0x54cb('0x5')};function emitEvent(_0x240a36){return function(_0xe3fc36,_0x297dd8,_0xf3461f){MailAccountEvents[_0x54cb('0x6')](_0x240a36+':'+_0xe3fc36['id'],_0xe3fc36);MailAccountEvents['emit'](_0x240a36,_0xe3fc36);_0xf3461f(null);};}for(var e in events){if(events[_0x54cb('0x7')](e)){var event=events[e];MailAccount[_0x54cb('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 b73e388..1a6fbf3 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 _0x9129=['OAuth2','CloudProvider','data5','./mailAccount.attributes','exports','MailAccount','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth'];(function(_0xe0444c,_0x5acdf5){var _0x232b2d=function(_0x1c75bc){while(--_0x1c75bc){_0xe0444c['push'](_0xe0444c['shift']());}};_0x232b2d(++_0x5acdf5);}(_0x9129,0x157));var _0x9912=function(_0x35acf5,_0x4577af){_0x35acf5=_0x35acf5-0x0;var _0x3ffed3=_0x9129[_0x35acf5];return _0x3ffed3;};'use strict';var attributes=require(_0x9912('0x0'));module[_0x9912('0x1')]=function(_0x290531){return _0x290531['define'](_0x9912('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x105f0c=this;var _0x352993={'id':_0x105f0c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x105f0c[_0x9912('0x3')]!==_0x9912('0x4')){_0x352993[_0x9912('0x5')]=_0x105f0c[_0x9912('0x3')];}else{_0x352993[_0x9912('0x6')]=_0x105f0c[_0x9912('0x7')]['host'];_0x352993['port']=_0x105f0c[_0x9912('0x7')][_0x9912('0x8')];_0x352993[_0x9912('0x9')]=_0x105f0c[_0x9912('0x7')]['secure'];}if(_0x105f0c['Smtp'][_0x9912('0xa')]){if(_0x105f0c['Smtp'][_0x9912('0xb')]){if(!_0x105f0c['Smtp']['CloudProvider'])throw new Error(_0x9912('0xc'));_0x352993[_0x9912('0xd')]={'type':_0x9912('0xe'),'user':_0x105f0c['Smtp']['user'],'accessToken':_0x105f0c[_0x9912('0x7')][_0x9912('0xf')][_0x9912('0x10')]};}else{_0x352993[_0x9912('0xd')]={'user':_0x105f0c[_0x9912('0x7')]['user'],'pass':_0x105f0c[_0x9912('0x7')]['pass']};}}return _0x352993;}}});}; \ No newline at end of file +var _0x75e6=['MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','data5','user','pass','./mailAccount.attributes','define'];(function(_0x3f39ab,_0x16c981){var _0x170952=function(_0x45e049){while(--_0x45e049){_0x3f39ab['push'](_0x3f39ab['shift']());}};_0x170952(++_0x16c981);}(_0x75e6,0x1ae));var _0x675e=function(_0x49d5a6,_0x3a1f12){_0x49d5a6=_0x49d5a6-0x0;var _0x56d4fa=_0x75e6[_0x49d5a6];return _0x56d4fa;};'use strict';var attributes=require(_0x675e('0x0'));module['exports']=function(_0x3dc64a){return _0x3dc64a[_0x675e('0x1')](_0x675e('0x2'),attributes,{'tableName':_0x675e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4faddc=this;var _0x1b2072={'id':_0x4faddc['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4faddc[_0x675e('0x4')]!==_0x675e('0x5')){_0x1b2072[_0x675e('0x6')]=_0x4faddc[_0x675e('0x4')];}else{_0x1b2072[_0x675e('0x7')]=_0x4faddc[_0x675e('0x8')]['host'];_0x1b2072[_0x675e('0x9')]=_0x4faddc[_0x675e('0x8')][_0x675e('0x9')];_0x1b2072['secure']=_0x4faddc['Smtp']['secure'];}if(_0x4faddc[_0x675e('0x8')][_0x675e('0xa')]){if(_0x4faddc[_0x675e('0x8')][_0x675e('0xb')]){if(!_0x4faddc['Smtp'][_0x675e('0xc')])throw new Error(_0x675e('0xd'));_0x1b2072[_0x675e('0xe')]={'type':'OAuth2','user':_0x4faddc[_0x675e('0x8')]['user'],'accessToken':_0x4faddc[_0x675e('0x8')][_0x675e('0xc')][_0x675e('0xf')]};}else{_0x1b2072[_0x675e('0xe')]={'user':_0x4faddc[_0x675e('0x8')][_0x675e('0x10')],'pass':_0x4faddc['Smtp'][_0x675e('0x11')]};}}return _0x1b2072;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 5d5505b..bb71e69 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 _0x6d38=['result','catch','findAll','options','raw','attributes','limit','map','include','model','then','GetMailAccount','debug','ShowMailAccount','find','smtp','setDataValue','smtpOptions','body','mail','difference','rawAttributes','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','CmList','List','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','CloudProvider','get','account','omit','getSmtpOptions','list','applications','orderBy','autoclose','push','length','close','create','List\x20not\x20found','messageId','generate','subject','attach','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','contact','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailAccount.socket','register','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6d38[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var moment=require(_0x86d3('0x0'));var BPromise=require(_0x86d3('0x1'));var rs=require(_0x86d3('0x2'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x86d3('0x3'))('rpc');var config=require(_0x86d3('0x4'));var jayson=require(_0x86d3('0x5'));var client=jayson[_0x86d3('0x6')]['http']({'port':0x232c});config[_0x86d3('0x7')]=_[_0x86d3('0x8')](config[_0x86d3('0x7')],{'host':_0x86d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x86d3('0xa'))[_0x86d3('0xb')](socket);function respondWithRpcPromise(_0xf273f5,_0x499640,_0x4a277e){return new BPromise(function(_0x3ed317,_0x555e6d){return client['request'](_0xf273f5,_0x4a277e)['then'](function(_0x4300e2){logger[_0x86d3('0xc')]('MailAccount,\x20%s,\x20%s',_0x499640,_0x86d3('0xd'));logger['debug'](_0x86d3('0xe'),_0x499640,_0x86d3('0xd'),JSON[_0x86d3('0xf')](_0x4300e2));if(_0x4300e2[_0x86d3('0x10')]){if(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x11')]===0x1f4){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2['error'][_0x86d3('0x13')]);return _0x555e6d(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);}logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);return _0x3ed317(_0x4300e2[_0x86d3('0x10')]['message']);}else{logger[_0x86d3('0xc')](_0x86d3('0x12'),_0x499640,_0x86d3('0xd'));_0x3ed317(_0x4300e2[_0x86d3('0x14')][_0x86d3('0x13')]);}})[_0x86d3('0x15')](function(_0x33e459){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x33e459);_0x555e6d(_0x33e459);});});}exports['GetMailAccount']=function(_0x191ba5){var _0x57c340=this;return new Promise(function(_0x6ced9e,_0x5c4d55){return db['MailAccount'][_0x86d3('0x16')]({'raw':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x18')]===undefined?!![]:![]:!![],'where':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')]['where']||null:null,'attributes':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'limit':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x1a')]||null:null,'include':_0x191ba5[_0x86d3('0x17')]?_0x191ba5['options']['include']?_[_0x86d3('0x1b')](_0x191ba5['options'][_0x86d3('0x1c')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x1d')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x19')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x1c')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x19')],'include':_0x611764['include']?_[_0x86d3('0x1b')](_0x611764[_0x86d3('0x1c')],function(_0x287b96){return{'model':db[_0x287b96[_0x86d3('0x1d')]],'as':_0x287b96['as'],'attributes':_0x287b96[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x1f203e){logger[_0x86d3('0xc')](_0x86d3('0x1f'),_0x191ba5);logger[_0x86d3('0x20')](_0x86d3('0x1f'),_0x191ba5,JSON[_0x86d3('0xf')](_0x1f203e));_0x6ced9e(_0x1f203e);})[_0x86d3('0x15')](function(_0x28c25e){logger['error'](_0x86d3('0x1f'),_0x28c25e[_0x86d3('0x13')],_0x191ba5);_0x5c4d55(_0x57c340[_0x86d3('0x10')](0x1f4,_0x28c25e[_0x86d3('0x13')]));});});};exports[_0x86d3('0x21')]=function(_0x245e39){var _0x4a5ff0=this;return new Promise(function(_0xba2f49,_0x5c71df){return db['MailAccount'][_0x86d3('0x22')]({'raw':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['where']||null:null,'attributes':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'include':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x245e39[_0x86d3('0x17')]['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x19')],'include':_0x4cdf45['include']?_[_0x86d3('0x1b')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x1d')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x19')],'include':_0x366943[_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x366943[_0x86d3('0x1c')],function(_0x2d15b9){return{'model':db[_0x2d15b9['model']],'as':_0x2d15b9['as'],'attributes':_0x2d15b9[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x5e2519){if(_0x245e39[_0x86d3('0x17')][_0x86d3('0x23')]===!![])_0x5e2519[_0x86d3('0x24')](_0x86d3('0x25'),_0x5e2519['getSmtpOptions']());logger[_0x86d3('0xc')](_0x86d3('0x21'),_0x245e39);logger[_0x86d3('0x20')]('ShowMailAccount',_0x245e39,JSON[_0x86d3('0xf')](_0x5e2519));_0xba2f49(_0x5e2519);})[_0x86d3('0x15')](function(_0x1a1c06){logger[_0x86d3('0x10')](_0x86d3('0x21'),_0x1a1c06[_0x86d3('0x13')],_0x245e39);_0x5c71df(_0x4a5ff0[_0x86d3('0x10')](0x1f4,_0x1a1c06[_0x86d3('0x13')]));});});};exports['NotifyMailAccount']=function(_0x22bc98){var _0x470978=this;return new Promise(function(_0x2bdc67,_0x461052){var _0x5ebb4d={'body':_0x22bc98[_0x86d3('0x26')],'channel':_0x86d3('0x27')};var _0x6f72be=_[_0x86d3('0x28')](_['keys'](db['CmContact'][_0x86d3('0x29')]),['createdAt','updatedAt',_0x86d3('0x2a'),_0x86d3('0x2b')]);var _0x43490a=![];if(_0x22bc98[_0x86d3('0x26')]['id']){delete _0x22bc98[_0x86d3('0x26')]['id'];}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x86d3('0x2d')](_0x22bc98[_0x86d3('0x26')]['body'])||_0x22bc98[_0x86d3('0x26')][_0x86d3('0x26')]===''){return _0x461052(_0x470978['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x2f')+_0x6f72be));}if(!_[_0x86d3('0x30')](_0x6f72be,_0x22bc98[_0x86d3('0x26')]['mapKey'])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x31')+_0x6f72be));}var _0x5d9dad={};_0x5d9dad[_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')]]=_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')];return db[_0x86d3('0x32')][_0x86d3('0x22')]({'where':{'id':_0x22bc98['account']['id']},'include':[{'model':db[_0x86d3('0x33')],'as':_0x86d3('0x34'),'include':[{'model':db['CmContact'],'as':_0x86d3('0x35'),'where':_0x5d9dad,'limit':0x1,'order':[[_0x86d3('0x36'),_0x86d3('0x37')]]}]},{'model':db[_0x86d3('0x38')],'as':_0x86d3('0x39')},{'model':db['MailServerOut'],'as':_0x86d3('0x3a'),'include':[{'model':db[_0x86d3('0x3b')],'as':_0x86d3('0x3b')}]}]})[_0x86d3('0x1e')](function(_0x369b75){if(_0x369b75&&_0x369b75[_0x86d3('0x34')]){var _0x1a4345=_0x369b75[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x1a4345,[_0x86d3('0x39'),_0x86d3('0x34')]);_0x5ebb4d['account'][_0x86d3('0x25')]=_0x369b75[_0x86d3('0x3f')]();_0x5ebb4d['applications']=_0x1a4345[_0x86d3('0x39')];_0x5ebb4d[_0x86d3('0x40')]=_0x1a4345[_0x86d3('0x34')];_0x5ebb4d[_0x86d3('0x41')]=_[_0x86d3('0x42')](_0x5ebb4d[_0x86d3('0x41')],['priority'],['asc']);if(_0x5ebb4d['account']&&_0x5ebb4d['account'][_0x86d3('0x43')]){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x44')]({'id':0x0,'priority':_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x45')]+0x1,'app':_0x86d3('0x46'),'appdata':_0x86d3('0x43'),'interval':'*,*,*,*'});}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')]){delete _0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')];}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x34')]){delete _0x5ebb4d[_0x86d3('0x3d')]['List'];}if(_0x1a4345[_0x86d3('0x34')]['Contacts'][_0x86d3('0x45')]){return _0x1a4345[_0x86d3('0x34')][_0x86d3('0x35')][0x0];}var _0x3ffd22=_[_0x86d3('0x8')](_0x22bc98['body'],{'firstName':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')],'ListId':_0x1a4345[_0x86d3('0x2b')]});_0x3ffd22[_0x22bc98['body']['mapKey']]=_0x22bc98['body'][_0x86d3('0x2c')];return db['CmContact'][_0x86d3('0x47')](_0x3ffd22);}else{throw new Error(_0x86d3('0x48'));}})[_0x86d3('0x1e')](function(_0x319ea0){_0x5ebb4d['contact']=_0x319ea0;if(_0x319ea0){if(!_0x22bc98['body']['message'][_0x86d3('0x49')]){_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')]=rs[_0x86d3('0x4a')]()+'\x20'+_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')];}var _0x5123fd={'ContactId':_0x319ea0['id'],'MailAccountId':_0x22bc98[_0x86d3('0x3d')]['id'],'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98['body'][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98['body'][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4c')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x86d3('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x22bc98['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x86d3('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x4f')]}}]})[_0x86d3('0x1e')](function(_0xa48003){if(_0xa48003){return[_0xa48003,![]];}return db['MailInteraction']['create'](_0x5123fd)[_0x86d3('0x1e')](function(_0xf2c179){return[_0xf2c179,!![]];});});}else{throw new Error(_0x86d3('0x50'));}})[_0x86d3('0x51')](function(_0x22d8eb,_0x1952af){if(_0x22d8eb){_0x43490a=_0x1952af;if(!_0x1952af){return _0x22d8eb[_0x86d3('0x52')]({'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22d8eb['attach']?_0x22d8eb[_0x86d3('0x4c')]:_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgDirection':'in'});}else{return _0x22d8eb;}}})['then'](function(_0x41d448){_0x5ebb4d['interaction']=_0x41d448[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x55')][_0x86d3('0x56')]=_0x43490a;return db[_0x86d3('0x57')][_0x86d3('0x47')]({'body':_0x22bc98['body'][_0x86d3('0x26')],'MailAccountId':_0x22bc98['account']['id'],'MailInteractionId':_0x41d448['id'],'direction':'in','ContactId':_0x5ebb4d[_0x86d3('0x58')]['id'],'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')],'from':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['to'],'cc':_0x22bc98[_0x86d3('0x26')]['message']['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'Attachments':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attachments'],'originTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x59')],'originCc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5a')],'bcc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5b')],'ChatWebsiteId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5c')]||null,'originChannel':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['originChannel']||_0x86d3('0x5d'),'ChatOfflineMessageId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x86d3('0x5f')}]});})[_0x86d3('0x1e')](function(_0x1a97f3){_0x5ebb4d[_0x86d3('0x13')]=_0x1a97f3;if(_0x5ebb4d['interaction']['UserId']){return db[_0x86d3('0x60')]['find']({'attributes':['id',_0x86d3('0x61')],'where':{'id':_0x5ebb4d['interaction']['UserId']}})[_0x86d3('0x1e')](function(_0x28bd40){if(_0x28bd40){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x62')]({'id':0x0,'priority':0x0,'app':_0x86d3('0x63'),'appdata':_0x28bd40['name']+','+(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x86d3('0x65'),_0x86d3('0x66'),_0x5ebb4d);});}return respondWithRpcPromise('Start',_0x86d3('0x66'),_0x5ebb4d);})['then'](function(_0x1867fc){_0x2bdc67(_0x1867fc);})['catch'](function(_0x5bb2e5){_0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x5bb2e5['message']));});});}; \ No newline at end of file +var _0xd943=['MailServerOut','Smtp','CloudProvider','get','account','omit','smtpOptions','applications','list','asc','autoclose','close','Contacts','length','defaults','ListId','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','create','spread','attach','interaction','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailAccount','findAll','options','where','attributes','limit','include','map','model','stringify','GetMailAccount','ShowMailAccount','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','updatedAt','CompanyId','isNil','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','DESC','MailApplication','Applications'];(function(_0x2fe6d9,_0x4e5470){var _0x3dfbfd=function(_0x21ec09){while(--_0x21ec09){_0x2fe6d9['push'](_0x2fe6d9['shift']());}};_0x3dfbfd(++_0x4e5470);}(_0xd943,0x15d));var _0x3d94=function(_0x487353,_0x4caec7){_0x487353=_0x487353-0x0;var _0x23196f=_0xd943[_0x487353];return _0x23196f;};'use strict';var _=require(_0x3d94('0x0'));var moment=require(_0x3d94('0x1'));var BPromise=require(_0x3d94('0x2'));var rs=require(_0x3d94('0x3'));var Redis=require('ioredis');var db=require(_0x3d94('0x4'))['db'];var logger=require(_0x3d94('0x5'))(_0x3d94('0x6'));var config=require(_0x3d94('0x7'));var jayson=require(_0x3d94('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0x3d94('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3d94('0xa'))(new Redis(config[_0x3d94('0x9')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3984a3,_0x27e381,_0x1cc58c){return new BPromise(function(_0x5908a7,_0x182066){return client['request'](_0x3984a3,_0x1cc58c)[_0x3d94('0xb')](function(_0x301536){logger['info'](_0x3d94('0xc'),_0x27e381,_0x3d94('0xd'));logger[_0x3d94('0xe')](_0x3d94('0xf'),_0x27e381,_0x3d94('0xd'),JSON['stringify'](_0x301536));if(_0x301536[_0x3d94('0x10')]){if(_0x301536[_0x3d94('0x10')][_0x3d94('0x11')]===0x1f4){logger['error'](_0x3d94('0xc'),_0x27e381,_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);return _0x182066(_0x301536['error'][_0x3d94('0x12')]);}logger[_0x3d94('0x10')](_0x3d94('0xc'),_0x27e381,_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);return _0x5908a7(_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);}else{logger[_0x3d94('0x13')]('MailAccount,\x20%s,\x20%s',_0x27e381,_0x3d94('0xd'));_0x5908a7(_0x301536[_0x3d94('0x14')][_0x3d94('0x12')]);}})[_0x3d94('0x15')](function(_0x4afc92){logger[_0x3d94('0x10')](_0x3d94('0xc'),_0x27e381,_0x4afc92);_0x182066(_0x4afc92);});});}exports['GetMailAccount']=function(_0x9bca24){var _0x59b741=this;return new Promise(function(_0x28bead,_0x193934){return db[_0x3d94('0x16')][_0x3d94('0x17')]({'raw':_0x9bca24[_0x3d94('0x18')]?_0x9bca24['options']['raw']===undefined?!![]:![]:!![],'where':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x19')]||null:null,'attributes':_0x9bca24['options']?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1a')]||null:null,'limit':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1b')]||null:null,'include':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1c')],function(_0x192839){return{'model':db[_0x192839[_0x3d94('0x1e')]],'as':_0x192839['as'],'attributes':_0x192839[_0x3d94('0x1a')],'include':_0x192839[_0x3d94('0x1c')]?_['map'](_0x192839[_0x3d94('0x1c')],function(_0x558fd2){return{'model':db[_0x558fd2[_0x3d94('0x1e')]],'as':_0x558fd2['as'],'attributes':_0x558fd2[_0x3d94('0x1a')],'include':_0x558fd2[_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x558fd2[_0x3d94('0x1c')],function(_0x82b568){return{'model':db[_0x82b568[_0x3d94('0x1e')]],'as':_0x82b568['as'],'attributes':_0x82b568['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x362642){logger['info']('GetMailAccount',_0x9bca24);logger[_0x3d94('0xe')]('GetMailAccount',_0x9bca24,JSON[_0x3d94('0x1f')](_0x362642));_0x28bead(_0x362642);})[_0x3d94('0x15')](function(_0x32403a){logger['error'](_0x3d94('0x20'),_0x32403a['message'],_0x9bca24);_0x193934(_0x59b741[_0x3d94('0x10')](0x1f4,_0x32403a['message']));});});};exports[_0x3d94('0x21')]=function(_0x215ad7){var _0x29b1ff=this;return new Promise(function(_0x246f88,_0x50560c){return db[_0x3d94('0x16')]['find']({'raw':_0x215ad7[_0x3d94('0x18')]?_0x215ad7[_0x3d94('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x215ad7['options']?_0x215ad7[_0x3d94('0x18')][_0x3d94('0x19')]||null:null,'attributes':_0x215ad7[_0x3d94('0x18')]?_0x215ad7['options'][_0x3d94('0x1a')]||null:null,'include':_0x215ad7[_0x3d94('0x18')]?_0x215ad7['options'][_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x215ad7[_0x3d94('0x18')][_0x3d94('0x1c')],function(_0x782c1){return{'model':db[_0x782c1['model']],'as':_0x782c1['as'],'attributes':_0x782c1[_0x3d94('0x1a')],'include':_0x782c1[_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x782c1[_0x3d94('0x1c')],function(_0xb493f1){return{'model':db[_0xb493f1[_0x3d94('0x1e')]],'as':_0xb493f1['as'],'attributes':_0xb493f1['attributes'],'include':_0xb493f1['include']?_[_0x3d94('0x1d')](_0xb493f1[_0x3d94('0x1c')],function(_0x1c1b25){return{'model':db[_0x1c1b25[_0x3d94('0x1e')]],'as':_0x1c1b25['as'],'attributes':_0x1c1b25[_0x3d94('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3d94('0xb')](function(_0x2ef743){if(_0x215ad7[_0x3d94('0x18')][_0x3d94('0x22')]===!![])_0x2ef743[_0x3d94('0x23')]('smtpOptions',_0x2ef743[_0x3d94('0x24')]());logger[_0x3d94('0x13')](_0x3d94('0x21'),_0x215ad7);logger[_0x3d94('0xe')]('ShowMailAccount',_0x215ad7,JSON[_0x3d94('0x1f')](_0x2ef743));_0x246f88(_0x2ef743);})[_0x3d94('0x15')](function(_0x35e0e6){logger[_0x3d94('0x10')](_0x3d94('0x21'),_0x35e0e6['message'],_0x215ad7);_0x50560c(_0x29b1ff[_0x3d94('0x10')](0x1f4,_0x35e0e6[_0x3d94('0x12')]));});});};exports[_0x3d94('0x25')]=function(_0x485066){var _0x4eee4d=this;return new Promise(function(_0x4d8a8f,_0x47905e){var _0x3b3550={'body':_0x485066[_0x3d94('0x26')],'channel':_0x3d94('0x27')};var _0x146ccb=_[_0x3d94('0x28')](_[_0x3d94('0x29')](db[_0x3d94('0x2a')]['rawAttributes']),['createdAt',_0x3d94('0x2b'),_0x3d94('0x2c'),'ListId']);var _0x2d0aa2=![];if(_0x485066['body']['id']){delete _0x485066[_0x3d94('0x26')]['id'];}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x26')])||_0x485066['body'][_0x3d94('0x26')]===''){return _0x47905e(_0x4eee4d['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x146ccb));}if(!_[_0x3d94('0x30')](_0x146ccb,_0x485066['body'][_0x3d94('0x2f')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,_0x3d94('0x31')+_0x146ccb));}var _0x15c8e7={};_0x15c8e7[_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')]]=_0x485066[_0x3d94('0x26')]['from'];return db[_0x3d94('0x16')][_0x3d94('0x32')]({'where':{'id':_0x485066['account']['id']},'include':[{'model':db['CmList'],'as':_0x3d94('0x33'),'include':[{'model':db[_0x3d94('0x2a')],'as':'Contacts','where':_0x15c8e7,'limit':0x1,'order':[[_0x3d94('0x2b'),_0x3d94('0x34')]]}]},{'model':db[_0x3d94('0x35')],'as':_0x3d94('0x36')},{'model':db[_0x3d94('0x37')],'as':_0x3d94('0x38'),'include':[{'model':db[_0x3d94('0x39')],'as':_0x3d94('0x39')}]}]})[_0x3d94('0xb')](function(_0x2429bc){if(_0x2429bc&&_0x2429bc[_0x3d94('0x33')]){var _0x29682b=_0x2429bc[_0x3d94('0x3a')]({'plain':!![]});_0x3b3550[_0x3d94('0x3b')]=_[_0x3d94('0x3c')](_0x29682b,['Applications',_0x3d94('0x33')]);_0x3b3550[_0x3d94('0x3b')][_0x3d94('0x3d')]=_0x2429bc[_0x3d94('0x24')]();_0x3b3550[_0x3d94('0x3e')]=_0x29682b[_0x3d94('0x36')];_0x3b3550[_0x3d94('0x3f')]=_0x29682b[_0x3d94('0x33')];_0x3b3550[_0x3d94('0x3e')]=_['orderBy'](_0x3b3550[_0x3d94('0x3e')],['priority'],[_0x3d94('0x40')]);if(_0x3b3550[_0x3d94('0x3b')]&&_0x3b3550['account'][_0x3d94('0x41')]){_0x3b3550['applications']['push']({'id':0x0,'priority':_0x3b3550[_0x3d94('0x3e')]['length']+0x1,'app':_0x3d94('0x42'),'appdata':_0x3d94('0x41'),'interval':'*,*,*,*'});}if(_0x3b3550[_0x3d94('0x3b')]['Applications']){delete _0x3b3550['account'][_0x3d94('0x36')];}if(_0x3b3550[_0x3d94('0x3b')][_0x3d94('0x33')]){delete _0x3b3550[_0x3d94('0x3b')][_0x3d94('0x33')];}if(_0x29682b[_0x3d94('0x33')][_0x3d94('0x43')][_0x3d94('0x44')]){return _0x29682b[_0x3d94('0x33')]['Contacts'][0x0];}var _0x28cfbb=_[_0x3d94('0x45')](_0x485066[_0x3d94('0x26')],{'firstName':_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')],'ListId':_0x29682b[_0x3d94('0x46')]});_0x28cfbb[_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')]]=_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')];return db[_0x3d94('0x2a')]['create'](_0x28cfbb);}else{throw new Error(_0x3d94('0x47'));}})['then'](function(_0x709841){_0x3b3550[_0x3d94('0x48')]=_0x709841;if(_0x709841){if(!_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')]){_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')]=rs[_0x3d94('0x4a')]()+'\x20'+_0x485066['body']['message'][_0x3d94('0x2e')];}var _0x4bd97c={'ContactId':_0x709841['id'],'MailAccountId':_0x485066[_0x3d94('0x3b')]['id'],'inReplyTo':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x49')],'to':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x2e')],'cc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['cc'],'subject':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x4b')],'attach':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['attach'],'lastMsgAt':moment()[_0x3d94('0x4c')](_0x3d94('0x4d')),'lastMsgDirection':'in'};return db[_0x3d94('0x4e')][_0x3d94('0x32')]({'where':{'closed':![],'MailAccountId':_0x485066['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x3d94('0x4f'),'attributes':[_0x3d94('0x49')],'where':{'messageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['inReplyTo']}}]})[_0x3d94('0xb')](function(_0x1c99d1){if(_0x1c99d1){return[_0x1c99d1,![]];}return db['MailInteraction'][_0x3d94('0x50')](_0x4bd97c)[_0x3d94('0xb')](function(_0x336e36){return[_0x336e36,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3d94('0x51')](function(_0x227372,_0x585531){if(_0x227372){_0x2d0aa2=_0x585531;if(!_0x585531){return _0x227372['update']({'inReplyTo':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['messageId'],'to':_0x485066['body']['message'][_0x3d94('0x2e')],'cc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['cc'],'subject':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['subject'],'attach':_0x227372[_0x3d94('0x52')]?_0x227372[_0x3d94('0x52')]:_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x52')],'substatus':null,'substatusAt':moment()[_0x3d94('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x3d94('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x227372;}}})[_0x3d94('0xb')](function(_0x41d561){_0x3b3550[_0x3d94('0x53')]=_0x41d561[_0x3d94('0x3a')]({'plain':!![]});_0x3b3550[_0x3d94('0x53')][_0x3d94('0x54')]=_0x2d0aa2;return db['MailMessage']['create']({'body':_0x485066[_0x3d94('0x26')]['body'],'MailAccountId':_0x485066['account']['id'],'MailInteractionId':_0x41d561['id'],'direction':'in','ContactId':_0x3b3550['contact']['id'],'messageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')],'from':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x2e')],'to':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['to'],'cc':_0x485066['body'][_0x3d94('0x12')]['cc'],'subject':_0x485066['body'][_0x3d94('0x12')][_0x3d94('0x4b')],'attach':_0x485066[_0x3d94('0x26')]['message']['attach'],'Attachments':_0x485066['body'][_0x3d94('0x12')][_0x3d94('0x55')],'originTo':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x56')],'originCc':_0x485066['body']['message'][_0x3d94('0x57')],'bcc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['bcc'],'ChatWebsiteId':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x58')]||null,'originChannel':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x59')]||_0x3d94('0x5a'),'ChatOfflineMessageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x5b')]||null},{'include':[{'model':db[_0x3d94('0x5c')],'as':_0x3d94('0x5d')}]});})[_0x3d94('0xb')](function(_0xe6cfd1){_0x3b3550[_0x3d94('0x12')]=_0xe6cfd1;if(_0x3b3550['interaction'][_0x3d94('0x5e')]){return db[_0x3d94('0x5f')][_0x3d94('0x32')]({'attributes':['id',_0x3d94('0x60')],'where':{'id':_0x3b3550['interaction'][_0x3d94('0x5e')]}})['then'](function(_0x4f217f){if(_0x4f217f){_0x3b3550[_0x3d94('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3d94('0x61'),'appdata':_0x4f217f[_0x3d94('0x60')]+','+(_0x3b3550['account'][_0x3d94('0x62')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3d94('0x63'),_0x3d94('0x64'),_0x3b3550);});}return respondWithRpcPromise('Start','startRouting',_0x3b3550);})['then'](function(_0x833d96){_0x4d8a8f(_0x833d96);})['catch'](function(_0x5a8114){_0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,_0x5a8114[_0x3d94('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 57a9c42..d0f3be0 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 _0x0f07=['register','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x49a57f,_0x405f38){var _0x2fa2a5=function(_0x359a98){while(--_0x359a98){_0x49a57f['push'](_0x49a57f['shift']());}};_0x2fa2a5(++_0x405f38);}(_0x0f07,0x11a));var _0x70f0=function(_0x299079,_0x125fd1){_0x299079=_0x299079-0x0;var _0x5a45b0=_0x0f07[_0x299079];return _0x5a45b0;};'use strict';var MailAccountEvents=require(_0x70f0('0x0'));var events=[_0x70f0('0x1'),_0x70f0('0x2'),_0x70f0('0x3')];function createListener(_0x4bd63a,_0x3e48d6){return function(_0x3f40e5){_0x3e48d6[_0x70f0('0x4')](_0x4bd63a,_0x3f40e5);};}function removeListener(_0x434827,_0x2336ba){return function(){MailAccountEvents[_0x70f0('0x5')](_0x434827,_0x2336ba);};}exports[_0x70f0('0x6')]=function(_0x359802){for(var _0xb87fa8=0x0,_0x3a3be2=events['length'];_0xb87fa8<_0x3a3be2;_0xb87fa8++){var _0x5bed98=events[_0xb87fa8];var _0xddeef7=createListener(_0x70f0('0x7')+_0x5bed98,_0x359802);MailAccountEvents['on'](_0x5bed98,_0xddeef7);}}; \ No newline at end of file +var _0x209e=['removeListener','register','length','mailAccount:','save','remove','emit'];(function(_0x359dd1,_0x2a3e77){var _0x1559de=function(_0x5b2dd9){while(--_0x5b2dd9){_0x359dd1['push'](_0x359dd1['shift']());}};_0x1559de(++_0x2a3e77);}(_0x209e,0x89));var _0xe209=function(_0x1b2896,_0x27d3d6){_0x1b2896=_0x1b2896-0x0;var _0xfe232a=_0x209e[_0x1b2896];return _0xfe232a;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xe209('0x0'),_0xe209('0x1'),'update'];function createListener(_0x4ea308,_0x5efe05){return function(_0x137160){_0x5efe05[_0xe209('0x2')](_0x4ea308,_0x137160);};}function removeListener(_0x555070,_0x4607fc){return function(){MailAccountEvents[_0xe209('0x3')](_0x555070,_0x4607fc);};}exports[_0xe209('0x4')]=function(_0x338805){for(var _0x164e1b=0x0,_0x49963a=events[_0xe209('0x5')];_0x164e1b<_0x49963a;_0x164e1b++){var _0x15eb5e=events[_0x164e1b];var _0x9016f4=createListener(_0xe209('0x6')+_0x15eb5e,_0x338805);MailAccountEvents['on'](_0x15eb5e,_0x9016f4);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index de8c029..d6f49e5 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 _0xc4c0=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get'];(function(_0x2265e5,_0x193b4e){var _0x750cac=function(_0x51d647){while(--_0x51d647){_0x2265e5['push'](_0x2265e5['shift']());}};_0x750cac(++_0x193b4e);}(_0xc4c0,0x13a));var _0x0c4c=function(_0x55cb9f,_0x64654d){_0x55cb9f=_0x55cb9f-0x0;var _0x272a75=_0xc4c0[_0x55cb9f];return _0x272a75;};'use strict';var multer=require(_0x0c4c('0x0'));var util=require(_0x0c4c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c4c('0x2'));var router=express[_0x0c4c('0x3')]();var fs_extra=require(_0x0c4c('0x4'));var auth=require(_0x0c4c('0x5'));var interaction=require(_0x0c4c('0x6'));var config=require('../../config/environment');var controller=require(_0x0c4c('0x7'));router[_0x0c4c('0x8')](_0x0c4c('0x9'),auth[_0x0c4c('0xa')](),controller[_0x0c4c('0xb')]);router[_0x0c4c('0xc')]('/:id',auth[_0x0c4c('0xa')](),controller[_0x0c4c('0xd')]);router[_0x0c4c('0xe')]('/:id',auth[_0x0c4c('0xa')](),controller[_0x0c4c('0xf')]);module[_0x0c4c('0x10')]=router; \ No newline at end of file +var _0x7586=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','put','/:id','delete','destroy','exports'];(function(_0xc78d40,_0xfa35e5){var _0x3f6f61=function(_0x4831f7){while(--_0x4831f7){_0xc78d40['push'](_0xc78d40['shift']());}};_0x3f6f61(++_0xfa35e5);}(_0x7586,0x1b0));var _0x6758=function(_0x508786,_0x26e090){_0x508786=_0x508786-0x0;var _0x2c9780=_0x7586[_0x508786];return _0x2c9780;};'use strict';var multer=require(_0x6758('0x0'));var util=require(_0x6758('0x1'));var path=require(_0x6758('0x2'));var timeout=require('connect-timeout');var express=require(_0x6758('0x3'));var router=express[_0x6758('0x4')]();var fs_extra=require(_0x6758('0x5'));var auth=require(_0x6758('0x6'));var interaction=require(_0x6758('0x7'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x6758('0x8')]('/:id',auth[_0x6758('0x9')](),controller[_0x6758('0xa')]);router[_0x6758('0xb')](_0x6758('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6758('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6758('0xe')]);module[_0x6758('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index e2555cc..8bf0765 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 _0xa50d=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0x124933,_0x3a821a){var _0x14d7ce=function(_0x1ed2a6){while(--_0x1ed2a6){_0x124933['push'](_0x124933['shift']());}};_0x14d7ce(++_0x3a821a);}(_0xa50d,0x1dd));var _0xda50=function(_0x44cf8a,_0x25b667){_0x44cf8a=_0x44cf8a-0x0;var _0x41d2e3=_0xa50d[_0x44cf8a];return _0x41d2e3;};'use strict';var Sequelize=require(_0xda50('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xda50('0x1')],'allowNull':![],'defaultValue':_0xda50('0x2')},'appdata':{'type':Sequelize[_0xda50('0x3')]()},'description':{'type':Sequelize[_0xda50('0x1')]},'interval':{'type':Sequelize[_0xda50('0x1')],'defaultValue':_0xda50('0x4')}}; \ No newline at end of file +var _0xe6f2=['exports','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x51a480,_0x2e086a){var _0x35a992=function(_0x22810e){while(--_0x22810e){_0x51a480['push'](_0x51a480['shift']());}};_0x35a992(++_0x2e086a);}(_0xe6f2,0x95));var _0x2e6f=function(_0x3f56ea,_0x1d7f54){_0x3f56ea=_0x3f56ea-0x0;var _0x37fa95=_0xe6f2[_0x3f56ea];return _0x37fa95;};'use strict';var Sequelize=require(_0x2e6f('0x0'));module[_0x2e6f('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e6f('0x2')},'appdata':{'type':Sequelize[_0x2e6f('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2e6f('0x4')],'defaultValue':_0x2e6f('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 22cd3c1..4afe53f 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3f7d24,_0x3ce1d5){var _0x143f6e=function(_0x4689be){while(--_0x4689be){_0x3f7d24['push'](_0x3f7d24['shift']());}};_0x143f6e(++_0x3ce1d5);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file +var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x70e0,0x17b));var _0x070e=function(_0x1d2d26,_0x2ee403){_0x1d2d26=_0x1d2d26-0x0;var _0x2f3215=_0x70e0[_0x1d2d26];return _0x2f3215;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 443110b..76d9478 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 _0x6b39=['utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x16e6ea,_0x44978e){var _0x29ae3c=function(_0x54da81){while(--_0x54da81){_0x16e6ea['push'](_0x16e6ea['shift']());}};_0x29ae3c(++_0x44978e);}(_0x6b39,0xb7));var _0x96b3=function(_0x4845bc,_0x25e144){_0x4845bc=_0x4845bc-0x0;var _0x82713d=_0x6b39[_0x4845bc];return _0x82713d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x96b3('0x0'));var moment=require(_0x96b3('0x1'));var BPromise=require(_0x96b3('0x2'));var rp=require(_0x96b3('0x3'));var fs=require('fs');var path=require(_0x96b3('0x4'));var rimraf=require(_0x96b3('0x5'));var config=require(_0x96b3('0x6'));var attributes=require(_0x96b3('0x7'));module[_0x96b3('0x8')]=function(_0x526978,_0x345648){return _0x526978[_0x96b3('0x9')](_0x96b3('0xa'),attributes,{'tableName':_0x96b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x96b3('0xc'),'collate':_0x96b3('0xd')});}; \ No newline at end of file +var _0xfe94=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications'];(function(_0x2185f1,_0x540ad2){var _0xf85844=function(_0x5af92d){while(--_0x5af92d){_0x2185f1['push'](_0x2185f1['shift']());}};_0xf85844(++_0x540ad2);}(_0xfe94,0x188));var _0x4fe9=function(_0x561dfc,_0x255f77){_0x561dfc=_0x561dfc-0x0;var _0x2e2fd6=_0xfe94[_0x561dfc];return _0x2e2fd6;};'use strict';var _=require(_0x4fe9('0x0'));var util=require(_0x4fe9('0x1'));var logger=require(_0x4fe9('0x2'))(_0x4fe9('0x3'));var moment=require(_0x4fe9('0x4'));var BPromise=require(_0x4fe9('0x5'));var rp=require(_0x4fe9('0x6'));var fs=require('fs');var path=require(_0x4fe9('0x7'));var rimraf=require(_0x4fe9('0x8'));var config=require(_0x4fe9('0x9'));var attributes=require(_0x4fe9('0xa'));module[_0x4fe9('0xb')]=function(_0x27c778,_0x18d2c2){return _0x27c778['define']('MailApplication',attributes,{'tableName':_0x4fe9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4fe9('0xd'),'collate':_0x4fe9('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 8eac474..418c468 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 _0xeb5c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailApplication','body','options','raw','where','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xeb5c,0x95));var _0xceb5=function(_0x3c5203,_0x63fb03){_0x3c5203=_0x3c5203-0x0;var _0x46c93e=_0xeb5c[_0x3c5203];return _0x46c93e;};'use strict';var _=require(_0xceb5('0x0'));var util=require(_0xceb5('0x1'));var moment=require(_0xceb5('0x2'));var BPromise=require(_0xceb5('0x3'));var rs=require(_0xceb5('0x4'));var fs=require('fs');var Redis=require(_0xceb5('0x5'));var db=require(_0xceb5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xceb5('0x7'))(_0xceb5('0x8'));var config=require(_0xceb5('0x9'));var jayson=require(_0xceb5('0xa'));var client=jayson[_0xceb5('0xb')][_0xceb5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6cf5,_0x5c1414,_0x211813){return new BPromise(function(_0x221798,_0x597552){return client['request'](_0x5c6cf5,_0x211813)[_0xceb5('0xd')](function(_0x12053a){logger[_0xceb5('0xe')](_0xceb5('0xf'),_0x5c1414,_0xceb5('0x10'));logger[_0xceb5('0x11')](_0xceb5('0x12'),_0x5c1414,'request\x20sent',JSON[_0xceb5('0x13')](_0x12053a));if(_0x12053a['error']){if(_0x12053a[_0xceb5('0x14')][_0xceb5('0x15')]===0x1f4){logger[_0xceb5('0x14')](_0xceb5('0xf'),_0x5c1414,_0x12053a[_0xceb5('0x14')][_0xceb5('0x16')]);return _0x597552(_0x12053a[_0xceb5('0x14')][_0xceb5('0x16')]);}logger[_0xceb5('0x14')](_0xceb5('0xf'),_0x5c1414,_0x12053a[_0xceb5('0x14')][_0xceb5('0x16')]);return _0x221798(_0x12053a['error'][_0xceb5('0x16')]);}else{logger[_0xceb5('0xe')]('MailApplication,\x20%s,\x20%s',_0x5c1414,_0xceb5('0x10'));_0x221798(_0x12053a[_0xceb5('0x17')][_0xceb5('0x16')]);}})[_0xceb5('0x18')](function(_0x18b318){logger['error'](_0xceb5('0xf'),_0x5c1414,_0x18b318);_0x597552(_0x18b318);});});}exports['UpdateMailApplication']=function(_0x1307f1){var _0xe1d442=this;return new Promise(function(_0x7430b9,_0x2a02b8){return db[_0xceb5('0x19')]['update'](_0x1307f1[_0xceb5('0x1a')],{'raw':_0x1307f1['options']?_0x1307f1[_0xceb5('0x1b')][_0xceb5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1307f1[_0xceb5('0x1b')]?_0x1307f1[_0xceb5('0x1b')][_0xceb5('0x1d')]||null:null,'attributes':_0x1307f1[_0xceb5('0x1b')]?_0x1307f1[_0xceb5('0x1b')]['attributes']||null:null,'limit':_0x1307f1[_0xceb5('0x1b')]?_0x1307f1[_0xceb5('0x1b')]['limit']||null:null})[_0xceb5('0xd')](function(_0x30f5ed){logger[_0xceb5('0xe')](_0xceb5('0x1e'),_0x1307f1);logger[_0xceb5('0x11')]('UpdateMailApplication',_0x1307f1,JSON[_0xceb5('0x13')](_0x30f5ed));_0x7430b9(_0x30f5ed);})[_0xceb5('0x18')](function(_0x4bfe22){logger['error'](_0xceb5('0x1e'),_0x4bfe22['message'],_0x1307f1);_0x2a02b8(_0xe1d442[_0xceb5('0x14')](0x1f4,_0x4bfe22[_0xceb5('0x16')]));});});}; \ No newline at end of file +var _0xb3b1=['raw','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','update','body','options'];(function(_0xd24036,_0x41ab24){var _0x4e1f74=function(_0x59a960){while(--_0x59a960){_0xd24036['push'](_0xd24036['shift']());}};_0x4e1f74(++_0x41ab24);}(_0xb3b1,0xd2));var _0x1b3b=function(_0x1b819e,_0x496e33){_0x1b819e=_0x1b819e-0x0;var _0x5a613b=_0xb3b1[_0x1b819e];return _0x5a613b;};'use strict';var _=require(_0x1b3b('0x0'));var util=require(_0x1b3b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b3b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b3b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b3b('0x4'))(_0x1b3b('0x5'));var config=require(_0x1b3b('0x6'));var jayson=require(_0x1b3b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x339da3,_0x1ff4aa,_0x324011){return new BPromise(function(_0x16dcda,_0x92211e){return client[_0x1b3b('0x8')](_0x339da3,_0x324011)[_0x1b3b('0x9')](function(_0x174511){logger[_0x1b3b('0xa')](_0x1b3b('0xb'),_0x1ff4aa,_0x1b3b('0xc'));logger[_0x1b3b('0xd')](_0x1b3b('0xe'),_0x1ff4aa,_0x1b3b('0xc'),JSON[_0x1b3b('0xf')](_0x174511));if(_0x174511[_0x1b3b('0x10')]){if(_0x174511[_0x1b3b('0x10')][_0x1b3b('0x11')]===0x1f4){logger[_0x1b3b('0x10')](_0x1b3b('0xb'),_0x1ff4aa,_0x174511[_0x1b3b('0x10')][_0x1b3b('0x12')]);return _0x92211e(_0x174511[_0x1b3b('0x10')]['message']);}logger[_0x1b3b('0x10')](_0x1b3b('0xb'),_0x1ff4aa,_0x174511['error'][_0x1b3b('0x12')]);return _0x16dcda(_0x174511[_0x1b3b('0x10')][_0x1b3b('0x12')]);}else{logger[_0x1b3b('0xa')]('MailApplication,\x20%s,\x20%s',_0x1ff4aa,_0x1b3b('0xc'));_0x16dcda(_0x174511[_0x1b3b('0x13')]['message']);}})['catch'](function(_0x5b4622){logger[_0x1b3b('0x10')]('MailApplication,\x20%s,\x20%s',_0x1ff4aa,_0x5b4622);_0x92211e(_0x5b4622);});});}exports[_0x1b3b('0x14')]=function(_0x520639){var _0x3b381c=this;return new Promise(function(_0x286976,_0x5a10a0){return db['MailApplication'][_0x1b3b('0x15')](_0x520639[_0x1b3b('0x16')],{'raw':_0x520639[_0x1b3b('0x17')]?_0x520639[_0x1b3b('0x17')][_0x1b3b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x520639[_0x1b3b('0x17')]?_0x520639[_0x1b3b('0x17')]['where']||null:null,'attributes':_0x520639[_0x1b3b('0x17')]?_0x520639[_0x1b3b('0x17')]['attributes']||null:null,'limit':_0x520639['options']?_0x520639[_0x1b3b('0x17')]['limit']||null:null})[_0x1b3b('0x9')](function(_0x457dcc){logger[_0x1b3b('0xa')](_0x1b3b('0x14'),_0x520639);logger[_0x1b3b('0xd')]('UpdateMailApplication',_0x520639,JSON['stringify'](_0x457dcc));_0x286976(_0x457dcc);})[_0x1b3b('0x19')](function(_0x58a9df){logger[_0x1b3b('0x10')](_0x1b3b('0x14'),_0x58a9df[_0x1b3b('0x12')],_0x520639);_0x5a10a0(_0x3b381c['error'](0x1f4,_0x58a9df[_0x1b3b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 1b40760..d054d4f 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 _0xb961=['index','get','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x14e4d7,_0x49fab7){var _0x5444d4=function(_0x3e3e2d){while(--_0x3e3e2d){_0x14e4d7['push'](_0x14e4d7['shift']());}};_0x5444d4(++_0x49fab7);}(_0xb961,0xb1));var _0x1b96=function(_0x106e84,_0x246c27){_0x106e84=_0x106e84-0x0;var _0x299306=_0xb961[_0x106e84];return _0x299306;};'use strict';var express=require(_0x1b96('0x0'));var router=express[_0x1b96('0x1')]();var auth=require(_0x1b96('0x2'));var interaction=require(_0x1b96('0x3'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x1b96('0x4')](),controller[_0x1b96('0x5')]);router[_0x1b96('0x6')](_0x1b96('0x7'),auth[_0x1b96('0x4')](),controller[_0x1b96('0x8')]);router['get'](_0x1b96('0x9'),auth[_0x1b96('0x4')](),controller[_0x1b96('0xa')]);router[_0x1b96('0x6')](_0x1b96('0xb'),auth[_0x1b96('0x4')](),controller[_0x1b96('0xc')]);router['get']('/:id/download',auth[_0x1b96('0x4')](),controller[_0x1b96('0xd')]);router[_0x1b96('0xe')]('/',auth[_0x1b96('0x4')](),controller['create']);router['post'](_0x1b96('0xb'),auth[_0x1b96('0x4')](),controller[_0x1b96('0xf')]);router[_0x1b96('0xe')](_0x1b96('0x10'),auth['isAuthenticated'](),interaction['tracked'](_0x1b96('0x11'),_0x1b96('0x12')),controller[_0x1b96('0x13')]);router['put'](_0x1b96('0x9'),auth[_0x1b96('0x4')](),interaction[_0x1b96('0x14')]('mail',_0x1b96('0x15')),controller['update']);router[_0x1b96('0x16')](_0x1b96('0x9'),auth[_0x1b96('0x4')](),interaction[_0x1b96('0x14')]('mail','mailinteraction:destroy'),controller[_0x1b96('0x17')]);router[_0x1b96('0x16')](_0x1b96('0x10'),auth[_0x1b96('0x4')](),controller[_0x1b96('0x18')]);module[_0x1b96('0x19')]=router; \ No newline at end of file +var _0x951b=['isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get'];(function(_0x34c58e,_0x2f8d7d){var _0x593f5b=function(_0x262ac8){while(--_0x262ac8){_0x34c58e['push'](_0x34c58e['shift']());}};_0x593f5b(++_0x2f8d7d);}(_0x951b,0x14b));var _0xb951=function(_0x1f9c2e,_0x1bdec9){_0x1f9c2e=_0x1f9c2e-0x0;var _0x9cb458=_0x951b[_0x1f9c2e];return _0x9cb458;};'use strict';var express=require(_0xb951('0x0'));var router=express['Router']();var auth=require(_0xb951('0x1'));var interaction=require(_0xb951('0x2'));var controller=require(_0xb951('0x3'));router[_0xb951('0x4')]('/',auth[_0xb951('0x5')](),controller[_0xb951('0x6')]);router[_0xb951('0x4')]('/describe',auth[_0xb951('0x5')](),controller[_0xb951('0x7')]);router[_0xb951('0x4')](_0xb951('0x8'),auth[_0xb951('0x5')](),controller['show']);router[_0xb951('0x4')](_0xb951('0x9'),auth['isAuthenticated'](),controller[_0xb951('0xa')]);router[_0xb951('0x4')](_0xb951('0xb'),auth[_0xb951('0x5')](),controller[_0xb951('0xc')]);router[_0xb951('0xd')]('/',auth[_0xb951('0x5')](),controller[_0xb951('0xe')]);router[_0xb951('0xd')](_0xb951('0x9'),auth['isAuthenticated'](),controller[_0xb951('0xf')]);router[_0xb951('0xd')](_0xb951('0x10'),auth['isAuthenticated'](),interaction['tracked'](_0xb951('0x11'),_0xb951('0x12')),controller['addTags']);router[_0xb951('0x13')](_0xb951('0x8'),auth['isAuthenticated'](),interaction[_0xb951('0x14')](_0xb951('0x11'),_0xb951('0x15')),controller[_0xb951('0x16')]);router[_0xb951('0x17')](_0xb951('0x8'),auth['isAuthenticated'](),interaction[_0xb951('0x14')](_0xb951('0x11'),_0xb951('0x18')),controller[_0xb951('0x19')]);router[_0xb951('0x17')](_0xb951('0x10'),auth['isAuthenticated'](),controller[_0xb951('0x1a')]);module[_0xb951('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f7a2efa..fc57b94 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 _0xf350=['out','sequelize','iconv','BOOLEAN','DATE','STRING','TEXT','ENUM'];(function(_0x19826f,_0x273748){var _0xa1cce4=function(_0x346323){while(--_0x346323){_0x19826f['push'](_0x19826f['shift']());}};_0xa1cce4(++_0x273748);}(_0xf350,0x1e9));var _0x0f35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf350[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x0f35('0x0'));var iconv=require(_0x0f35('0x1'));module['exports']={'closed':{'type':Sequelize[_0x0f35('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0f35('0x3')]},'disposition':{'type':Sequelize[_0x0f35('0x4')]},'secondDisposition':{'type':Sequelize[_0x0f35('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0f35('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x0f35('0x5')]('long')},'subject':{'type':Sequelize[_0x0f35('0x5')]()},'attach':{'type':Sequelize[_0x0f35('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0f35('0x3')]},'substatus':{'type':Sequelize[_0x0f35('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x0f35('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0f35('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0f35('0x6')]('in',_0x0f35('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0f35('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf774=['long','TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0xf774,0x1e4));var _0x4f77=function(_0x240d73,_0x2dc0a1){_0x240d73=_0x240d73-0x0;var _0x4657c7=_0xf774[_0x240d73];return _0x4657c7;};'use strict';var Sequelize=require(_0x4f77('0x0'));var iconv=require(_0x4f77('0x1'));module[_0x4f77('0x2')]={'closed':{'type':Sequelize[_0x4f77('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4f77('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4f77('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4f77('0x5')]},'note':{'type':Sequelize[_0x4f77('0x5')]},'inReplyTo':{'type':Sequelize[_0x4f77('0x5')](0x1fe)},'to':{'type':Sequelize[_0x4f77('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x4f77('0x6'))},'subject':{'type':Sequelize[_0x4f77('0x7')]()},'attach':{'type':Sequelize[_0x4f77('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4f77('0x4')]},'substatus':{'type':Sequelize[_0x4f77('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x4f77('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4f77('0x8')]('in',_0x4f77('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4f77('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 15dcedd..da2bc9a 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 _0x8bc7=['intersection','fields','length','include','merge','options','find','create','body','addMessage','omit','ids','getMessages','findOne','MailMessage','filters','hasOwnProperty','order','sort','where','pick','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','rows','addTags','setTags','spread','Tag','emit','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','format','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','bluebird','util','path','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','set','update','then','destroy','status','error','name','send','index','map','MailInteraction','rawAttributes','fieldName','key','findAll','mail','user','catch','show','params','model','keys','query','attributes'];(function(_0x349c34,_0xc39a71){var _0x458104=function(_0x51abdb){while(--_0x51abdb){_0x349c34['push'](_0x349c34['shift']());}};_0x458104(++_0xc39a71);}(_0x8bc7,0x126));var _0x78bc=function(_0x26b59e,_0x1b20d5){_0x26b59e=_0x26b59e-0x0;var _0x437af8=_0x8bc7[_0x26b59e];return _0x437af8;};'use strict';var emlformat=require(_0x78bc('0x0'));var rimraf=require(_0x78bc('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x78bc('0x2'));var util=require(_0x78bc('0x3'));var path=require(_0x78bc('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x78bc('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x78bc('0x6'));var logger=require(_0x78bc('0x7'))('api');var config=require(_0x78bc('0x8'));var db=require(_0x78bc('0x9'))['db'];var htmlEntities=require(_0x78bc('0xa'));config[_0x78bc('0xb')]=_[_0x78bc('0xc')](config[_0x78bc('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x78bc('0xd'))(new Redis(config[_0x78bc('0xb')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5fcb53,_0x4329cd){_0x4329cd=_0x4329cd||0xcc;return function(_0x490a2c){if(_0x490a2c){return _0x5fcb53[_0x78bc('0xe')](_0x4329cd);}return _0x5fcb53['status'](_0x4329cd)[_0x78bc('0xf')]();};}function respondWithResult(_0x16d635,_0x2630dc){_0x2630dc=_0x2630dc||0xc8;return function(_0x4f3f44){if(_0x4f3f44){return _0x16d635['status'](_0x2630dc)[_0x78bc('0x10')](_0x4f3f44);}};}function respondWithFilteredResult(_0x28d67f,_0x14ddc0){return function(_0xeed866){if(_0xeed866){var _0x21d261=typeof _0x14ddc0[_0x78bc('0x11')]===_0x78bc('0x12')&&typeof _0x14ddc0[_0x78bc('0x13')]==='undefined';var _0x1e3896=_0xeed866[_0x78bc('0x14')];var _0x3e06ba=_0x21d261?0x0:_0x14ddc0['offset'];var _0x11dcd5=_0x21d261?_0xeed866[_0x78bc('0x14')]:_0x14ddc0[_0x78bc('0x11')]+_0x14ddc0[_0x78bc('0x13')];var _0x9e3c43;if(_0x11dcd5>=_0x1e3896){_0x11dcd5=_0x1e3896;_0x9e3c43=0xc8;}else{_0x9e3c43=0xce;}_0x28d67f['status'](_0x9e3c43);return _0x28d67f[_0x78bc('0x15')]('Content-Range',_0x3e06ba+'-'+_0x11dcd5+'/'+_0x1e3896)[_0x78bc('0x10')](_0xeed866);}return null;};}function saveUpdates(_0x1d7055){return function(_0x218504){if(_0x218504){return _0x218504[_0x78bc('0x16')](_0x1d7055)[_0x78bc('0x17')](function(_0x208dc0){return _0x208dc0;});}return null;};}function removeEntity(_0x16b916){return function(_0x1d327e){if(_0x1d327e){return _0x1d327e[_0x78bc('0x18')]()[_0x78bc('0x17')](function(){_0x16b916[_0x78bc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28d07e){return function(_0x3758d7){if(!_0x3758d7){_0x28d07e['sendStatus'](0x194);}return _0x3758d7;};}function handleError(_0x5e2001,_0x6b73ca){_0x6b73ca=_0x6b73ca||0x1f4;return function(_0x247059){logger[_0x78bc('0x1a')](_0x247059['stack']);if(_0x247059[_0x78bc('0x1b')]){delete _0x247059[_0x78bc('0x1b')];}_0x5e2001[_0x78bc('0x19')](_0x6b73ca)[_0x78bc('0x1c')](_0x247059);};}exports[_0x78bc('0x1d')]=function(_0x2e16c9,_0x3cf9c9){var _0x52429f={};var _0x5e28db=_[_0x78bc('0x1e')](db[_0x78bc('0x1f')][_0x78bc('0x20')],function(_0xe240d0){return{'name':_0xe240d0[_0x78bc('0x21')],'type':_0xe240d0['type'][_0x78bc('0x22')]};});_0x52429f=qs['getOptions'](_0x5e28db,_0x2e16c9);return interaction[_0x78bc('0x23')](_0x78bc('0x24'),_0x2e16c9['query'],_0x2e16c9[_0x78bc('0x25')],_0x52429f,_0x5e28db)[_0x78bc('0x17')](respondWithFilteredResult(_0x3cf9c9,_0x52429f))[_0x78bc('0x26')](handleError(_0x3cf9c9,null));};exports[_0x78bc('0x27')]=function(_0x2a8aac,_0x1284a1){var _0x444d0e={'raw':![],'where':{'id':_0x2a8aac[_0x78bc('0x28')]['id']}},_0x6e56f5={};_0x6e56f5[_0x78bc('0x29')]=_[_0x78bc('0x2a')](db[_0x78bc('0x1f')][_0x78bc('0x20')]);_0x6e56f5['query']=_[_0x78bc('0x2a')](_0x2a8aac[_0x78bc('0x2b')]);_0x6e56f5['filters']=_['intersection'](_0x6e56f5[_0x78bc('0x29')],_0x6e56f5[_0x78bc('0x2b')]);_0x444d0e[_0x78bc('0x2c')]=_[_0x78bc('0x2d')](_0x6e56f5[_0x78bc('0x29')],qs[_0x78bc('0x2e')](_0x2a8aac[_0x78bc('0x2b')][_0x78bc('0x2e')]));_0x444d0e[_0x78bc('0x2c')]=_0x444d0e[_0x78bc('0x2c')][_0x78bc('0x2f')]?_0x444d0e[_0x78bc('0x2c')]:_0x6e56f5[_0x78bc('0x29')];if(_0x2a8aac[_0x78bc('0x2b')]['includeAll']){_0x444d0e[_0x78bc('0x30')]=[{'all':!![]}];}_0x444d0e=_[_0x78bc('0x31')]({},_0x444d0e,_0x2a8aac[_0x78bc('0x32')]);return db[_0x78bc('0x1f')][_0x78bc('0x33')](_0x444d0e)[_0x78bc('0x17')](handleEntityNotFound(_0x1284a1,null))[_0x78bc('0x17')](respondWithResult(_0x1284a1,null))['catch'](handleError(_0x1284a1,null));};exports[_0x78bc('0x34')]=function(_0x1bce31,_0x2cd699){return db[_0x78bc('0x1f')]['create'](_0x1bce31[_0x78bc('0x35')],{})[_0x78bc('0x17')](respondWithResult(_0x2cd699,0xc9))[_0x78bc('0x26')](handleError(_0x2cd699,null));};exports[_0x78bc('0x16')]=function(_0x4e0495,_0x198cff){if(_0x4e0495['body']['id']){delete _0x4e0495['body']['id'];}return db[_0x78bc('0x1f')]['find']({'where':{'id':_0x4e0495[_0x78bc('0x28')]['id']}})[_0x78bc('0x17')](handleEntityNotFound(_0x198cff,null))[_0x78bc('0x17')](saveUpdates(_0x4e0495[_0x78bc('0x35')],null))[_0x78bc('0x17')](respondWithResult(_0x198cff,null))[_0x78bc('0x26')](handleError(_0x198cff,null));};exports[_0x78bc('0x18')]=function(_0x395614,_0xec1ce8){return db[_0x78bc('0x1f')][_0x78bc('0x33')]({'where':{'id':_0x395614[_0x78bc('0x28')]['id']}})['then'](handleEntityNotFound(_0xec1ce8,null))[_0x78bc('0x17')](removeEntity(_0xec1ce8,null))['catch'](handleError(_0xec1ce8,null));};exports['describe']=function(_0x1d7a5a,_0x1830cd){return db[_0x78bc('0x1f')]['describe']()[_0x78bc('0x17')](respondWithResult(_0x1830cd,null))[_0x78bc('0x26')](handleError(_0x1830cd,null));};exports[_0x78bc('0x36')]=function(_0x421f38,_0x5182d9){return db['MailMessage'][_0x78bc('0x33')]({'where':{'id':_0x421f38[_0x78bc('0x28')]['id']}})[_0x78bc('0x17')](handleEntityNotFound(_0x5182d9,null))[_0x78bc('0x17')](function(_0x47ce6a){if(_0x47ce6a){return _0x47ce6a[_0x78bc('0x36')](_0x421f38[_0x78bc('0x35')]['ids'],_[_0x78bc('0x37')](_0x421f38[_0x78bc('0x35')],[_0x78bc('0x38'),'id'])||{});}})[_0x78bc('0x17')](respondWithResult(_0x5182d9,null))[_0x78bc('0x26')](handleError(_0x5182d9,null));};exports[_0x78bc('0x39')]=function(_0xd46b7b,_0x1cb7ec){var _0x18df6d={'raw':![],'where':{}};var _0x176dba={};var _0x12388d={'count':0x0,'rows':[]};return db[_0x78bc('0x1f')][_0x78bc('0x3a')]({'where':{'id':_0xd46b7b['params']['id']}})[_0x78bc('0x17')](handleEntityNotFound(_0x1cb7ec,null))[_0x78bc('0x17')](function(_0x54a2c3){if(_0x54a2c3){_0x176dba[_0x78bc('0x29')]=_[_0x78bc('0x2a')](db[_0x78bc('0x3b')]['rawAttributes']);_0x176dba[_0x78bc('0x2b')]=_[_0x78bc('0x2a')](_0xd46b7b[_0x78bc('0x2b')]);_0x176dba[_0x78bc('0x3c')]=_[_0x78bc('0x2d')](_0x176dba['model'],_0x176dba[_0x78bc('0x2b')]);_0x18df6d['attributes']=_[_0x78bc('0x2d')](_0x176dba[_0x78bc('0x29')],qs[_0x78bc('0x2e')](_0xd46b7b['query'][_0x78bc('0x2e')]));_0x18df6d[_0x78bc('0x2c')]=_0x18df6d['attributes'][_0x78bc('0x2f')]?_0x18df6d['attributes']:_0x176dba[_0x78bc('0x29')];if(!_0xd46b7b[_0x78bc('0x2b')][_0x78bc('0x3d')]('nolimit')){_0x18df6d[_0x78bc('0x13')]=qs[_0x78bc('0x13')](_0xd46b7b[_0x78bc('0x2b')][_0x78bc('0x13')]);_0x18df6d[_0x78bc('0x11')]=qs[_0x78bc('0x11')](_0xd46b7b[_0x78bc('0x2b')][_0x78bc('0x11')]);}_0x18df6d[_0x78bc('0x3e')]=qs['sort'](_0xd46b7b['query'][_0x78bc('0x3f')]);_0x18df6d[_0x78bc('0x40')]=qs[_0x78bc('0x3c')](_[_0x78bc('0x41')](_0xd46b7b['query'],_0x176dba[_0x78bc('0x3c')]));_0x18df6d['where'][_0x78bc('0x42')]=_0x54a2c3['id'];if(_0xd46b7b['query'][_0x78bc('0x43')]){_0x18df6d[_0x78bc('0x40')]=_['merge'](_0x18df6d['where'],{'$or':_['map'](_0x18df6d['attributes'],function(_0x2f55ca){var _0x59f14a={};_0x59f14a[_0x2f55ca]={'$like':'%'+_0xd46b7b[_0x78bc('0x2b')]['filter']+'%'};return _0x59f14a;})});}if(_0xd46b7b[_0x78bc('0x2b')][_0x78bc('0x44')]){var _0x5a5b85=_0xd46b7b[_0x78bc('0x2b')][_0x78bc('0x44')][_0x78bc('0x45')](',');var _0x1ffa08={};_0x1ffa08[_0x5a5b85[0x0]]={'$gte':moment(_0x5a5b85[0x1])['format'](_0x78bc('0x46'))};_0x18df6d[_0x78bc('0x40')]=_[_0x78bc('0x31')](_0x18df6d[_0x78bc('0x40')],_0x1ffa08);}_0x18df6d=_[_0x78bc('0x31')]({},_0x18df6d,_0xd46b7b[_0x78bc('0x32')]);return db['MailMessage']['count']({'where':_0x18df6d[_0x78bc('0x40')]})[_0x78bc('0x17')](function(_0x1fd83c){_0x12388d[_0x78bc('0x14')]=_0x1fd83c;if(_0xd46b7b['query'][_0x78bc('0x47')]){_0x18df6d[_0x78bc('0x30')]=[{'all':!![]}];}return db[_0x78bc('0x3b')][_0x78bc('0x23')](_0x18df6d);})[_0x78bc('0x17')](function(_0x2509bc){if(_0xd46b7b[_0x78bc('0x2b')][_0x78bc('0x48')]===_0x78bc('0x49')){for(var _0x32d4c8=0x0;_0x32d4c8<_0x2509bc['length'];_0x32d4c8++){_0x2509bc[_0x32d4c8]['body']=juice(_0x2509bc[_0x32d4c8][_0x78bc('0x35')]);}}_0x12388d[_0x78bc('0x4a')]=_0x2509bc;return _0x12388d;});}})[_0x78bc('0x17')](respondWithFilteredResult(_0x1cb7ec,_0x18df6d))['catch'](handleError(_0x1cb7ec,null));};exports[_0x78bc('0x4b')]=function(_0x174287,_0x1c23c3){return db['MailInteraction']['find']({'where':{'id':_0x174287[_0x78bc('0x28')]['id']}})['then'](handleEntityNotFound(_0x1c23c3,null))['then'](function(_0x24c10b){if(_0x24c10b){return _0x24c10b[_0x78bc('0x4c')](_0x174287['body'][_0x78bc('0x38')],_[_0x78bc('0x37')](_0x174287['body'],[_0x78bc('0x38'),'id'])||{})[_0x78bc('0x4d')](function(){return db[_0x78bc('0x4e')][_0x78bc('0x23')]({'attributes':['id','name','color'],'where':{'id':_0x174287[_0x78bc('0x35')]['ids']}});})[_0x78bc('0x17')](function(_0x109894){socket[_0x78bc('0x4f')]('mailInteractionTags:save',{'id':Number(_0x174287['params']['id']),'tags':_0x109894||[]});return{'id':Number(_0x174287[_0x78bc('0x28')]['id']),'tags':_0x109894||[]};});}})[_0x78bc('0x17')](respondWithResult(_0x1c23c3,null))['catch'](handleError(_0x1c23c3,null));};exports[_0x78bc('0x50')]=function(_0x4ff1b8,_0x28589a){return db[_0x78bc('0x1f')][_0x78bc('0x33')]({'where':{'id':_0x4ff1b8[_0x78bc('0x28')]['id']}})[_0x78bc('0x17')](handleEntityNotFound(_0x28589a,null))[_0x78bc('0x17')](function(_0x583034){if(_0x583034){return _0x583034[_0x78bc('0x50')](_0x4ff1b8['query'][_0x78bc('0x38')]);}})[_0x78bc('0x17')](respondWithStatusCode(_0x28589a,null))[_0x78bc('0x26')](handleError(_0x28589a,null));};exports[_0x78bc('0x51')]=function(_0x34982a,_0x235940){var _0x52f011=moment()[_0x78bc('0x52')]()[_0x78bc('0x53')]();var _0x256ce7=path[_0x78bc('0x54')](config['root'],_0x78bc('0x55'),_0x78bc('0x56'),_0x78bc('0x57'));var _0x7f29c6=path[_0x78bc('0x54')](config[_0x78bc('0x58')],_0x78bc('0x55'),'files',_0x78bc('0x59'));var _0x4edb0c=path[_0x78bc('0x54')](_0x256ce7,_0x52f011);var _0x3f031c=util[_0x78bc('0x5a')]('transcript-%d-%s.zip',_0x34982a['params']['id'],_0x52f011);var _0x3eae72=path[_0x78bc('0x54')](_0x256ce7,_0x3f031c);var _0x11bcf6=[];if(_0x34982a['query'][_0x78bc('0x59')]){_0x11bcf6[_0x78bc('0x5b')]({'model':db[_0x78bc('0x5c')],'as':_0x78bc('0x5d'),'raw':!![]});}var _0x46f56e=[{'model':db[_0x78bc('0x3b')],'as':_0x78bc('0x5e'),'attributes':['id',_0x78bc('0x35'),_0x78bc('0x5f'),'to','cc',_0x78bc('0x60'),_0x78bc('0x61'),_0x78bc('0x62')],'where':{'secret':![]},'order':qs[_0x78bc('0x3f')]('id'),'include':_0x11bcf6}];return db[_0x78bc('0x1f')][_0x78bc('0x33')]({'where':{'id':_0x34982a['params']['id']},'include':_0x46f56e})['then'](handleEntityNotFound(_0x235940,null))['then'](function(_0x19c4d1){if(_0x19c4d1&&_0x19c4d1[_0x78bc('0x5e')]){var _0x589d7e=_0x19c4d1[_0x78bc('0x63')]({'plain':!![]});fs[_0x78bc('0x64')](_0x4edb0c);return BPromise[_0x78bc('0x65')](_0x589d7e[_0x78bc('0x5e')],function(_0x17b4e9,_0xe5e041){var _0x5af4ad={'from':_0x17b4e9['from'],'to':_0x17b4e9['to']||_0x78bc('0x66'),'subject':_0x17b4e9[_0x78bc('0x61')],'html':htmlEntities[_0x78bc('0x67')](_0x17b4e9['body']),'headers':{'Date':moment(_0x17b4e9['createdAt'])['format'](_0x78bc('0x68'))},'attachments':[]};if(_0x17b4e9['cc']){_0x5af4ad[_0x78bc('0x69')]['Cc']=_0x17b4e9['cc'];}if(_0x17b4e9[_0x78bc('0x60')]){_0x5af4ad[_0x78bc('0x69')][_0x78bc('0x6a')]=_0x17b4e9[_0x78bc('0x60')];}return new BPromise(function(_0xa2aa56,_0x7b786){if(_0x17b4e9[_0x78bc('0x5d')]){for(var _0xf1c520=0x0;_0xf1c520<_0x17b4e9[_0x78bc('0x5d')][_0x78bc('0x2f')];_0xf1c520++){var _0x1dc32e=_0x17b4e9[_0x78bc('0x5d')][_0xf1c520];var _0x320fce=path['join'](_0x7f29c6,_0x1dc32e[_0x78bc('0x6b')]);if(fs[_0x78bc('0x6c')](_0x320fce)){_0x5af4ad[_0x78bc('0x59')][_0x78bc('0x5b')]({'name':_0x1dc32e[_0x78bc('0x1b')],'contentType':_0x1dc32e['type'],'data':fs['readFileSync'](_0x320fce)});}}}emlformat[_0x78bc('0x6d')](_0x5af4ad,function(_0x5028f6,_0x316a78){if(_0x5028f6)return _0x7b786(_0x5028f6);fs[_0x78bc('0x6e')](path[_0x78bc('0x54')](_0x4edb0c,util[_0x78bc('0x5a')](_0x78bc('0x6f'),_0xe5e041)),_0x316a78);return _0xa2aa56(_0x316a78);});});})['then'](function(){return new BPromise(function(_0xfbd0e3,_0x2e73ee){zipdir(_0x4edb0c,{'saveTo':_0x3eae72},function(_0x360ddf,_0x10179e){if(_0x360ddf)return _0x2e73ee(_0x360ddf);return _0xfbd0e3(_0x10179e);});})[_0x78bc('0x17')](function(){return new BPromise(function(_0x3505b,_0x2e4e85){rimraf(_0x4edb0c,function(_0xd4b77b){if(_0xd4b77b)_0x2e4e85(_0xd4b77b);return _0x3505b();});});})['then'](function(){return _0x235940[_0x78bc('0x51')](_0x3eae72,_0x3f031c,function(_0x122ea9){if(!_0x122ea9)fs[_0x78bc('0x70')](_0x3eae72);});});});}else{return _0x235940[_0x78bc('0xe')](0xc8);}})['catch'](handleError(_0x235940,null));}; \ No newline at end of file +var _0x6dd0=['index','map','rawAttributes','fieldName','type','key','getOptions','findAll','mail','user','catch','model','keys','MailInteraction','query','filters','attributes','intersection','fields','length','include','options','find','create','body','params','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','MailInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','rows','setTags','Tag','emit','mailInteractionTags:save','removeTags','unix','toString','root','files','tmp','attachments','join','transcript-%d-%s.zip','push','Attachment','Attachments','from','bcc','subject','createdAt','Messages','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','rimraf','moment','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6dd0,0xca));var _0x06dd=function(_0x389e2f,_0x93ac99){_0x389e2f=_0x389e2f-0x0;var _0x32aaf0=_0x6dd0[_0x389e2f];return _0x32aaf0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06dd('0x0'));var zipdir=require('zip-dir');var moment=require(_0x06dd('0x1'));var BPromise=require('bluebird');var util=require(_0x06dd('0x2'));var path=require(_0x06dd('0x3'));var fs=require('fs');var _=require(_0x06dd('0x4'));var juice=require(_0x06dd('0x5'));var Redis=require(_0x06dd('0x6'));var interaction=require(_0x06dd('0x7'));var qs=require(_0x06dd('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x06dd('0x9'));var db=require(_0x06dd('0xa'))['db'];var htmlEntities=require(_0x06dd('0xb'));config['redis']=_['defaults'](config[_0x06dd('0xc')],{'host':_0x06dd('0xd'),'port':0x18eb});var socket=require(_0x06dd('0xe'))(new Redis(config[_0x06dd('0xc')]));require('./mailInteraction.socket')[_0x06dd('0xf')](socket);function respondWithStatusCode(_0x2afc50,_0x5c4d6b){_0x5c4d6b=_0x5c4d6b||0xcc;return function(_0x557bcf){if(_0x557bcf){return _0x2afc50['sendStatus'](_0x5c4d6b);}return _0x2afc50['status'](_0x5c4d6b)[_0x06dd('0x10')]();};}function respondWithResult(_0x4da037,_0x2a194d){_0x2a194d=_0x2a194d||0xc8;return function(_0x412079){if(_0x412079){return _0x4da037[_0x06dd('0x11')](_0x2a194d)[_0x06dd('0x12')](_0x412079);}};}function respondWithFilteredResult(_0x4bd13b,_0x2e56cd){return function(_0x688a80){if(_0x688a80){var _0x322bf5=typeof _0x2e56cd[_0x06dd('0x13')]===_0x06dd('0x14')&&typeof _0x2e56cd[_0x06dd('0x15')]===_0x06dd('0x14');var _0x2541b6=_0x688a80[_0x06dd('0x16')];var _0x1eb6bc=_0x322bf5?0x0:_0x2e56cd[_0x06dd('0x13')];var _0x3cf082=_0x322bf5?_0x688a80[_0x06dd('0x16')]:_0x2e56cd[_0x06dd('0x13')]+_0x2e56cd[_0x06dd('0x15')];var _0x49cb8d;if(_0x3cf082>=_0x2541b6){_0x3cf082=_0x2541b6;_0x49cb8d=0xc8;}else{_0x49cb8d=0xce;}_0x4bd13b[_0x06dd('0x11')](_0x49cb8d);return _0x4bd13b[_0x06dd('0x17')](_0x06dd('0x18'),_0x1eb6bc+'-'+_0x3cf082+'/'+_0x2541b6)[_0x06dd('0x12')](_0x688a80);}return null;};}function saveUpdates(_0x4e981d){return function(_0x277e40){if(_0x277e40){return _0x277e40[_0x06dd('0x19')](_0x4e981d)[_0x06dd('0x1a')](function(_0x316d08){return _0x316d08;});}return null;};}function removeEntity(_0x4aed30){return function(_0x425275){if(_0x425275){return _0x425275[_0x06dd('0x1b')]()['then'](function(){_0x4aed30[_0x06dd('0x11')](0xcc)[_0x06dd('0x10')]();});}};}function handleEntityNotFound(_0x22f3a9){return function(_0x11bb0d){if(!_0x11bb0d){_0x22f3a9[_0x06dd('0x1c')](0x194);}return _0x11bb0d;};}function handleError(_0x2108f0,_0x329156){_0x329156=_0x329156||0x1f4;return function(_0x5795fe){logger[_0x06dd('0x1d')](_0x5795fe[_0x06dd('0x1e')]);if(_0x5795fe[_0x06dd('0x1f')]){delete _0x5795fe[_0x06dd('0x1f')];}_0x2108f0[_0x06dd('0x11')](_0x329156)['send'](_0x5795fe);};}exports[_0x06dd('0x20')]=function(_0x25c3b5,_0x215f89){var _0x5c828e={};var _0x508719=_[_0x06dd('0x21')](db['MailInteraction'][_0x06dd('0x22')],function(_0x1d2ef6){return{'name':_0x1d2ef6[_0x06dd('0x23')],'type':_0x1d2ef6[_0x06dd('0x24')][_0x06dd('0x25')]};});_0x5c828e=qs[_0x06dd('0x26')](_0x508719,_0x25c3b5);return interaction[_0x06dd('0x27')](_0x06dd('0x28'),_0x25c3b5['query'],_0x25c3b5[_0x06dd('0x29')],_0x5c828e,_0x508719)[_0x06dd('0x1a')](respondWithFilteredResult(_0x215f89,_0x5c828e))[_0x06dd('0x2a')](handleError(_0x215f89,null));};exports['show']=function(_0x14c0c3,_0x1edeba){var _0x1d3e5d={'raw':![],'where':{'id':_0x14c0c3['params']['id']}},_0x2eb193={};_0x2eb193[_0x06dd('0x2b')]=_[_0x06dd('0x2c')](db[_0x06dd('0x2d')][_0x06dd('0x22')]);_0x2eb193[_0x06dd('0x2e')]=_[_0x06dd('0x2c')](_0x14c0c3['query']);_0x2eb193[_0x06dd('0x2f')]=_['intersection'](_0x2eb193[_0x06dd('0x2b')],_0x2eb193[_0x06dd('0x2e')]);_0x1d3e5d[_0x06dd('0x30')]=_[_0x06dd('0x31')](_0x2eb193[_0x06dd('0x2b')],qs[_0x06dd('0x32')](_0x14c0c3[_0x06dd('0x2e')][_0x06dd('0x32')]));_0x1d3e5d[_0x06dd('0x30')]=_0x1d3e5d['attributes'][_0x06dd('0x33')]?_0x1d3e5d['attributes']:_0x2eb193[_0x06dd('0x2b')];if(_0x14c0c3[_0x06dd('0x2e')]['includeAll']){_0x1d3e5d[_0x06dd('0x34')]=[{'all':!![]}];}_0x1d3e5d=_['merge']({},_0x1d3e5d,_0x14c0c3[_0x06dd('0x35')]);return db['MailInteraction'][_0x06dd('0x36')](_0x1d3e5d)['then'](handleEntityNotFound(_0x1edeba,null))[_0x06dd('0x1a')](respondWithResult(_0x1edeba,null))[_0x06dd('0x2a')](handleError(_0x1edeba,null));};exports['create']=function(_0x30ff32,_0x57db07){return db[_0x06dd('0x2d')][_0x06dd('0x37')](_0x30ff32[_0x06dd('0x38')],{})[_0x06dd('0x1a')](respondWithResult(_0x57db07,0xc9))[_0x06dd('0x2a')](handleError(_0x57db07,null));};exports[_0x06dd('0x19')]=function(_0x519665,_0x154b33){if(_0x519665[_0x06dd('0x38')]['id']){delete _0x519665[_0x06dd('0x38')]['id'];}return db[_0x06dd('0x2d')]['find']({'where':{'id':_0x519665['params']['id']}})['then'](handleEntityNotFound(_0x154b33,null))[_0x06dd('0x1a')](saveUpdates(_0x519665[_0x06dd('0x38')],null))[_0x06dd('0x1a')](respondWithResult(_0x154b33,null))[_0x06dd('0x2a')](handleError(_0x154b33,null));};exports['destroy']=function(_0x19226b,_0x45fc5a){return db['MailInteraction']['find']({'where':{'id':_0x19226b[_0x06dd('0x39')]['id']}})[_0x06dd('0x1a')](handleEntityNotFound(_0x45fc5a,null))['then'](removeEntity(_0x45fc5a,null))[_0x06dd('0x2a')](handleError(_0x45fc5a,null));};exports[_0x06dd('0x3a')]=function(_0x135a35,_0x3e5639){return db['MailInteraction'][_0x06dd('0x3a')]()[_0x06dd('0x1a')](respondWithResult(_0x3e5639,null))[_0x06dd('0x2a')](handleError(_0x3e5639,null));};exports[_0x06dd('0x3b')]=function(_0x33ad29,_0x55aec2){return db[_0x06dd('0x3c')]['find']({'where':{'id':_0x33ad29[_0x06dd('0x39')]['id']}})[_0x06dd('0x1a')](handleEntityNotFound(_0x55aec2,null))[_0x06dd('0x1a')](function(_0x3ab63b){if(_0x3ab63b){return _0x3ab63b[_0x06dd('0x3b')](_0x33ad29[_0x06dd('0x38')][_0x06dd('0x3d')],_[_0x06dd('0x3e')](_0x33ad29[_0x06dd('0x38')],[_0x06dd('0x3d'),'id'])||{});}})[_0x06dd('0x1a')](respondWithResult(_0x55aec2,null))['catch'](handleError(_0x55aec2,null));};exports[_0x06dd('0x3f')]=function(_0x4b48a9,_0x49e4c4){var _0x3c3a53={'raw':![],'where':{}};var _0x3d7a17={};var _0x153402={'count':0x0,'rows':[]};return db['MailInteraction'][_0x06dd('0x40')]({'where':{'id':_0x4b48a9['params']['id']}})[_0x06dd('0x1a')](handleEntityNotFound(_0x49e4c4,null))[_0x06dd('0x1a')](function(_0x5c4f02){if(_0x5c4f02){_0x3d7a17['model']=_[_0x06dd('0x2c')](db[_0x06dd('0x3c')][_0x06dd('0x22')]);_0x3d7a17['query']=_[_0x06dd('0x2c')](_0x4b48a9[_0x06dd('0x2e')]);_0x3d7a17[_0x06dd('0x2f')]=_['intersection'](_0x3d7a17[_0x06dd('0x2b')],_0x3d7a17[_0x06dd('0x2e')]);_0x3c3a53[_0x06dd('0x30')]=_[_0x06dd('0x31')](_0x3d7a17[_0x06dd('0x2b')],qs[_0x06dd('0x32')](_0x4b48a9[_0x06dd('0x2e')]['fields']));_0x3c3a53[_0x06dd('0x30')]=_0x3c3a53['attributes'][_0x06dd('0x33')]?_0x3c3a53[_0x06dd('0x30')]:_0x3d7a17[_0x06dd('0x2b')];if(!_0x4b48a9[_0x06dd('0x2e')][_0x06dd('0x41')](_0x06dd('0x42'))){_0x3c3a53[_0x06dd('0x15')]=qs[_0x06dd('0x15')](_0x4b48a9[_0x06dd('0x2e')][_0x06dd('0x15')]);_0x3c3a53[_0x06dd('0x13')]=qs[_0x06dd('0x13')](_0x4b48a9[_0x06dd('0x2e')][_0x06dd('0x13')]);}_0x3c3a53['order']=qs[_0x06dd('0x43')](_0x4b48a9[_0x06dd('0x2e')]['sort']);_0x3c3a53[_0x06dd('0x44')]=qs[_0x06dd('0x2f')](_[_0x06dd('0x45')](_0x4b48a9[_0x06dd('0x2e')],_0x3d7a17[_0x06dd('0x2f')]));_0x3c3a53[_0x06dd('0x44')][_0x06dd('0x46')]=_0x5c4f02['id'];if(_0x4b48a9['query'][_0x06dd('0x47')]){_0x3c3a53[_0x06dd('0x44')]=_[_0x06dd('0x48')](_0x3c3a53[_0x06dd('0x44')],{'$or':_[_0x06dd('0x21')](_0x3c3a53['attributes'],function(_0x3820b6){var _0x16819b={};_0x16819b[_0x3820b6]={'$like':'%'+_0x4b48a9[_0x06dd('0x2e')][_0x06dd('0x47')]+'%'};return _0x16819b;})});}if(_0x4b48a9[_0x06dd('0x2e')][_0x06dd('0x49')]){var _0x33da14=_0x4b48a9['query'][_0x06dd('0x49')][_0x06dd('0x4a')](',');var _0x150a05={};_0x150a05[_0x33da14[0x0]]={'$gte':moment(_0x33da14[0x1])[_0x06dd('0x4b')](_0x06dd('0x4c'))};_0x3c3a53['where']=_[_0x06dd('0x48')](_0x3c3a53[_0x06dd('0x44')],_0x150a05);}_0x3c3a53=_['merge']({},_0x3c3a53,_0x4b48a9['options']);return db['MailMessage'][_0x06dd('0x16')]({'where':_0x3c3a53[_0x06dd('0x44')]})[_0x06dd('0x1a')](function(_0x1d7016){_0x153402['count']=_0x1d7016;if(_0x4b48a9[_0x06dd('0x2e')][_0x06dd('0x4d')]){_0x3c3a53[_0x06dd('0x34')]=[{'all':!![]}];}return db[_0x06dd('0x3c')][_0x06dd('0x27')](_0x3c3a53);})[_0x06dd('0x1a')](function(_0x11e3f7){if(_0x4b48a9[_0x06dd('0x2e')][_0x06dd('0x4e')]===_0x06dd('0x4f')){for(var _0x1cfe7e=0x0;_0x1cfe7e<_0x11e3f7['length'];_0x1cfe7e++){_0x11e3f7[_0x1cfe7e][_0x06dd('0x38')]=juice(_0x11e3f7[_0x1cfe7e][_0x06dd('0x38')]);}}_0x153402[_0x06dd('0x50')]=_0x11e3f7;return _0x153402;});}})[_0x06dd('0x1a')](respondWithFilteredResult(_0x49e4c4,_0x3c3a53))[_0x06dd('0x2a')](handleError(_0x49e4c4,null));};exports['addTags']=function(_0x27b357,_0x209e22){return db[_0x06dd('0x2d')][_0x06dd('0x36')]({'where':{'id':_0x27b357[_0x06dd('0x39')]['id']}})[_0x06dd('0x1a')](handleEntityNotFound(_0x209e22,null))[_0x06dd('0x1a')](function(_0x10fc0e){if(_0x10fc0e){return _0x10fc0e[_0x06dd('0x51')](_0x27b357[_0x06dd('0x38')][_0x06dd('0x3d')],_[_0x06dd('0x3e')](_0x27b357[_0x06dd('0x38')],[_0x06dd('0x3d'),'id'])||{})['spread'](function(){return db[_0x06dd('0x52')][_0x06dd('0x27')]({'attributes':['id',_0x06dd('0x1f'),'color'],'where':{'id':_0x27b357[_0x06dd('0x38')]['ids']}});})['then'](function(_0xaae6a2){socket[_0x06dd('0x53')](_0x06dd('0x54'),{'id':Number(_0x27b357[_0x06dd('0x39')]['id']),'tags':_0xaae6a2||[]});return{'id':Number(_0x27b357[_0x06dd('0x39')]['id']),'tags':_0xaae6a2||[]};});}})['then'](respondWithResult(_0x209e22,null))[_0x06dd('0x2a')](handleError(_0x209e22,null));};exports[_0x06dd('0x55')]=function(_0x3896af,_0x14afda){return db[_0x06dd('0x2d')][_0x06dd('0x36')]({'where':{'id':_0x3896af[_0x06dd('0x39')]['id']}})[_0x06dd('0x1a')](handleEntityNotFound(_0x14afda,null))[_0x06dd('0x1a')](function(_0x3b47e2){if(_0x3b47e2){return _0x3b47e2[_0x06dd('0x55')](_0x3896af[_0x06dd('0x2e')]['ids']);}})['then'](respondWithStatusCode(_0x14afda,null))[_0x06dd('0x2a')](handleError(_0x14afda,null));};exports['download']=function(_0x5b09ea,_0x54f9fa){var _0x59d58a=moment()[_0x06dd('0x56')]()[_0x06dd('0x57')]();var _0x5df2d9=path['join'](config[_0x06dd('0x58')],'server',_0x06dd('0x59'),_0x06dd('0x5a'));var _0x1d649a=path['join'](config[_0x06dd('0x58')],'server',_0x06dd('0x59'),_0x06dd('0x5b'));var _0x6e260e=path[_0x06dd('0x5c')](_0x5df2d9,_0x59d58a);var _0x47f04f=util['format'](_0x06dd('0x5d'),_0x5b09ea[_0x06dd('0x39')]['id'],_0x59d58a);var _0x527da6=path[_0x06dd('0x5c')](_0x5df2d9,_0x47f04f);var _0x15ee24=[];if(_0x5b09ea['query'][_0x06dd('0x5b')]){_0x15ee24[_0x06dd('0x5e')]({'model':db[_0x06dd('0x5f')],'as':_0x06dd('0x60'),'raw':!![]});}var _0x13e85b=[{'model':db[_0x06dd('0x3c')],'as':'Messages','attributes':['id','body',_0x06dd('0x61'),'to','cc',_0x06dd('0x62'),_0x06dd('0x63'),_0x06dd('0x64')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x15ee24}];return db[_0x06dd('0x2d')][_0x06dd('0x36')]({'where':{'id':_0x5b09ea[_0x06dd('0x39')]['id']},'include':_0x13e85b})[_0x06dd('0x1a')](handleEntityNotFound(_0x54f9fa,null))[_0x06dd('0x1a')](function(_0x38d578){if(_0x38d578&&_0x38d578[_0x06dd('0x65')]){var _0x337b59=_0x38d578[_0x06dd('0x66')]({'plain':!![]});fs[_0x06dd('0x67')](_0x6e260e);return BPromise[_0x06dd('0x68')](_0x337b59[_0x06dd('0x65')],function(_0x337867,_0x1e2ec5){var _0x4c4092={'from':_0x337867['from'],'to':_0x337867['to']||'missing.recipient@your.company.com','subject':_0x337867[_0x06dd('0x63')],'html':htmlEntities[_0x06dd('0x69')](_0x337867[_0x06dd('0x38')]),'headers':{'Date':moment(_0x337867[_0x06dd('0x64')])['format'](_0x06dd('0x6a'))},'attachments':[]};if(_0x337867['cc']){_0x4c4092[_0x06dd('0x6b')]['Cc']=_0x337867['cc'];}if(_0x337867['bcc']){_0x4c4092[_0x06dd('0x6b')][_0x06dd('0x6c')]=_0x337867[_0x06dd('0x62')];}return new BPromise(function(_0x91a891,_0x330b5d){if(_0x337867['Attachments']){for(var _0x520731=0x0;_0x520731<_0x337867[_0x06dd('0x60')][_0x06dd('0x33')];_0x520731++){var _0x42ab97=_0x337867[_0x06dd('0x60')][_0x520731];var _0x43b200=path[_0x06dd('0x5c')](_0x1d649a,_0x42ab97[_0x06dd('0x6d')]);if(fs[_0x06dd('0x6e')](_0x43b200)){_0x4c4092['attachments'][_0x06dd('0x5e')]({'name':_0x42ab97[_0x06dd('0x1f')],'contentType':_0x42ab97[_0x06dd('0x24')],'data':fs[_0x06dd('0x6f')](_0x43b200)});}}}emlformat[_0x06dd('0x70')](_0x4c4092,function(_0x4a804a,_0x187218){if(_0x4a804a)return _0x330b5d(_0x4a804a);fs[_0x06dd('0x71')](path['join'](_0x6e260e,util[_0x06dd('0x4b')](_0x06dd('0x72'),_0x1e2ec5)),_0x187218);return _0x91a891(_0x187218);});});})[_0x06dd('0x1a')](function(){return new BPromise(function(_0x2a8695,_0x2bd606){zipdir(_0x6e260e,{'saveTo':_0x527da6},function(_0x2f1893,_0x563d86){if(_0x2f1893)return _0x2bd606(_0x2f1893);return _0x2a8695(_0x563d86);});})['then'](function(){return new BPromise(function(_0x507c6d,_0x568fff){rimraf(_0x6e260e,function(_0x652860){if(_0x652860)_0x568fff(_0x652860);return _0x507c6d();});});})[_0x06dd('0x1a')](function(){return _0x54f9fa[_0x06dd('0x73')](_0x527da6,_0x47f04f,function(_0x261ca0){if(!_0x261ca0)fs[_0x06dd('0x74')](_0x527da6);});});});}else{return _0x54f9fa['sendStatus'](0xc8);}})[_0x06dd('0x2a')](handleError(_0x54f9fa,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index b5af8b2..dd49624 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 _0x1853=['unreadMessages','length','emit','hook','events','../../mysqldb','MailInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x1853,0x1a8));var _0x3185=function(_0x2a5dc1,_0xc58ca4){_0x2a5dc1=_0x2a5dc1-0x0;var _0x244d63=_0x1853[_0x2a5dc1];return _0x244d63;};'use strict';var EventEmitter=require(_0x3185('0x0'));var MailInteraction=require(_0x3185('0x1'))['db'][_0x3185('0x2')];var MailMessage=require(_0x3185('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3185('0x3')](0x0);var events={'afterCreate':_0x3185('0x4'),'afterUpdate':_0x3185('0x5'),'afterDestroy':'remove'};function emitEvent(_0x27dfa2){return function(_0x3df9f0,_0x48aa47,_0x97530f){_0x3df9f0[_0x3185('0x6')]({'attributes':['id'],'raw':!![]})[_0x3185('0x7')](function(_0x1b59d6){_0x3df9f0[_0x3185('0x8')]('Users',_0x1b59d6[_0x3185('0x9')](function(_0x1d6334){return{'id':_0x1d6334['id']};}));return MailMessage[_0x3185('0xa')]({'where':{'MailInteractionId':_0x3df9f0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3185('0x7')](function(_0x57be01){_0x3df9f0[_0x3185('0x8')](_0x3185('0xb'),_0x57be01[_0x3185('0xc')]);MailInteractionEvents[_0x3185('0xd')](_0x27dfa2+':'+_0x3df9f0['id'],_0x3df9f0);MailInteractionEvents['emit'](_0x27dfa2,_0x3df9f0);_0x97530f(null);})['catch'](_0x97530f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x3185('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xbc48=['then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers'];(function(_0xc80d54,_0x39a6a7){var _0x308fc6=function(_0x23cb71){while(--_0x23cb71){_0xc80d54['push'](_0xc80d54['shift']());}};_0x308fc6(++_0x39a6a7);}(_0xbc48,0x90));var _0x8bc4=function(_0x527273,_0x4edcb1){_0x527273=_0x527273-0x0;var _0x578ec4=_0xbc48[_0x527273];return _0x578ec4;};'use strict';var EventEmitter=require(_0x8bc4('0x0'));var MailInteraction=require(_0x8bc4('0x1'))['db'][_0x8bc4('0x2')];var MailMessage=require(_0x8bc4('0x1'))['db'][_0x8bc4('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x8bc4('0x4')](0x0);var events={'afterCreate':_0x8bc4('0x5'),'afterUpdate':'update','afterDestroy':_0x8bc4('0x6')};function emitEvent(_0x2342a8){return function(_0x306ee3,_0x2cc45b,_0x50b13e){_0x306ee3[_0x8bc4('0x7')]({'attributes':['id'],'raw':!![]})[_0x8bc4('0x8')](function(_0x121704){_0x306ee3[_0x8bc4('0x9')](_0x8bc4('0xa'),_0x121704[_0x8bc4('0xb')](function(_0xff81a3){return{'id':_0xff81a3['id']};}));return MailMessage[_0x8bc4('0xc')]({'where':{'MailInteractionId':_0x306ee3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8bc4('0x8')](function(_0x344db2){_0x306ee3[_0x8bc4('0x9')](_0x8bc4('0xd'),_0x344db2['length']);MailInteractionEvents[_0x8bc4('0xe')](_0x2342a8+':'+_0x306ee3['id'],_0x306ee3);MailInteractionEvents[_0x8bc4('0xe')](_0x2342a8,_0x306ee3);_0x50b13e(null);})[_0x8bc4('0xf')](_0x50b13e(null));};}for(var e in events){if(events[_0x8bc4('0x10')](e)){var event=events[e];MailInteraction[_0x8bc4('0x11')](e,emitEvent(event));}}module[_0x8bc4('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 1c9e1a1..3817d12 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 _0x82b0=['MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define'];(function(_0x5ac01c,_0xe600aa){var _0x5adcb4=function(_0x3c1cae){while(--_0x3c1cae){_0x5ac01c['push'](_0x5ac01c['shift']());}};_0x5adcb4(++_0xe600aa);}(_0x82b0,0x6c));var _0x082b=function(_0x4583f5,_0x48986e){_0x4583f5=_0x4583f5-0x0;var _0x16513b=_0x82b0[_0x4583f5];return _0x16513b;};'use strict';var _=require(_0x082b('0x0'));var util=require(_0x082b('0x1'));var logger=require(_0x082b('0x2'))(_0x082b('0x3'));var moment=require(_0x082b('0x4'));var BPromise=require(_0x082b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x082b('0x6'));var rimraf=require(_0x082b('0x7'));var config=require(_0x082b('0x8'));var attributes=require(_0x082b('0x9'));module[_0x082b('0xa')]=function(_0x47f064,_0x453f68){return _0x47f064[_0x082b('0xb')](_0x082b('0xc'),attributes,{'tableName':_0x082b('0xd'),'paranoid':![],'indexes':[{'name':_0x082b('0xe'),'fields':[_0x082b('0xf'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x513a81,_0x394d1b,_0x4df052){if(_0x513a81[_0x082b('0x10')]){_0x513a81[_0x082b('0x11')]=moment()['format'](_0x082b('0x12'));}if(_0x513a81[_0x082b('0x13')]){_0x513a81[_0x082b('0x14')]=moment()[_0x082b('0x15')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4df052(null,_0x394d1b);},'beforeUpdate':function(_0x53ea15,_0x43a984,_0x4af4cb){if(_0x53ea15[_0x082b('0x16')](_0x082b('0x10'))){_0x53ea15['substatusAt']=_0x53ea15[_0x082b('0x10')]?moment()[_0x082b('0x15')](_0x082b('0x12')):null;}if(_0x53ea15[_0x082b('0x16')](_0x082b('0x13'))){_0x53ea15['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x53ea15[_0x082b('0x10')]=null;_0x53ea15[_0x082b('0x11')]=null;}_0x4af4cb(null,_0x53ea15);},'afterUpdate':function(_0x3d99e7,_0xb56a63,_0x798a16){var _0x4c088f=_0x47f064[_0x082b('0x17')];var _0x481c26=_0x3d99e7['get']({'plain':!![]});if(_0x481c26[_0x082b('0x13')]){return _0x4c088f[_0x082b('0x18')][_0x082b('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x481c26['id']}})[_0x082b('0x1a')](function(){_0x798a16();})[_0x082b('0x1b')](function(_0x3362fb){_0x798a16(_0x3362fb);});}else{_0x798a16();}}},'charset':_0x082b('0x1c'),'collate':_0x082b('0x1d')});}; \ No newline at end of file +var _0x40c7=['YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','closed','get','MailMessage','update','then','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','mail_interactions','FULLTEXT','substatusAt','format'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x40c7,0xa3));var _0x740c=function(_0x485f53,_0x104081){_0x485f53=_0x485f53-0x0;var _0x480f1e=_0x40c7[_0x485f53];return _0x480f1e;};'use strict';var _=require(_0x740c('0x0'));var util=require('util');var logger=require(_0x740c('0x1'))(_0x740c('0x2'));var moment=require(_0x740c('0x3'));var BPromise=require('bluebird');var rp=require(_0x740c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x740c('0x5'));var config=require(_0x740c('0x6'));var attributes=require(_0x740c('0x7'));module[_0x740c('0x8')]=function(_0x3dc786,_0x2e2eff){return _0x3dc786['define']('MailInteraction',attributes,{'tableName':_0x740c('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x740c('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a8b48,_0x509771,_0x1f2183){if(_0x2a8b48['substatus']){_0x2a8b48[_0x740c('0xb')]=moment()[_0x740c('0xc')](_0x740c('0xd'));}if(_0x2a8b48['closed']){_0x2a8b48[_0x740c('0xe')]=moment()[_0x740c('0xc')](_0x740c('0xd'));}_0x1f2183(null,_0x509771);},'beforeUpdate':function(_0x56209f,_0x1c2bdb,_0x3769cc){if(_0x56209f[_0x740c('0xf')](_0x740c('0x10'))){_0x56209f[_0x740c('0xb')]=_0x56209f['substatus']?moment()[_0x740c('0xc')](_0x740c('0xd')):null;}if(_0x56209f['changed'](_0x740c('0x11'))){_0x56209f[_0x740c('0xe')]=moment()[_0x740c('0xc')]('YYYY-MM-DD\x20HH:mm:ss');_0x56209f[_0x740c('0x10')]=null;_0x56209f['substatusAt']=null;}_0x3769cc(null,_0x56209f);},'afterUpdate':function(_0x255b6c,_0x4b0bca,_0xc8bf6c){var _0x4e03d5=_0x3dc786['models'];var _0x8e7066=_0x255b6c[_0x740c('0x12')]({'plain':!![]});if(_0x8e7066[_0x740c('0x11')]){return _0x4e03d5[_0x740c('0x13')][_0x740c('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x8e7066['id']}})[_0x740c('0x15')](function(){_0xc8bf6c();})['catch'](function(_0x34f369){_0xc8bf6c(_0x34f369);});}else{_0xc8bf6c();}}},'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 dc60072..b5b9ba1 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 _0xf2e0=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailInteraction','body','options','raw','where','attributes','limit','UpdateMailInteraction','debug','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash'];(function(_0x2fdd12,_0x231b71){var _0x35831b=function(_0x14552a){while(--_0x14552a){_0x2fdd12['push'](_0x2fdd12['shift']());}};_0x35831b(++_0x231b71);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf2e0[_0x432682];return _0x463d05;};'use strict';var _=require(_0x0f2e('0x0'));var util=require(_0x0f2e('0x1'));var moment=require('moment');var BPromise=require(_0x0f2e('0x2'));var rs=require(_0x0f2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f2e('0x4'))['db'];var utils=require(_0x0f2e('0x5'));var logger=require(_0x0f2e('0x6'))('rpc');var config=require(_0x0f2e('0x7'));var jayson=require(_0x0f2e('0x8'));var client=jayson[_0x0f2e('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0f2e('0xa')](config['redis'],{'host':_0x0f2e('0xb'),'port':0x18eb});var socket=require(_0x0f2e('0xc'))(new Redis(config[_0x0f2e('0xd')]));require('./mailInteraction.socket')[_0x0f2e('0xe')](socket);function respondWithRpcPromise(_0x3ce553,_0x4492eb,_0x5e74a3){return new BPromise(function(_0x321f9e,_0x35c2cd){return client['request'](_0x3ce553,_0x5e74a3)[_0x0f2e('0xf')](function(_0x18b904){logger[_0x0f2e('0x10')](_0x0f2e('0x11'),_0x4492eb,_0x0f2e('0x12'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x4492eb,_0x0f2e('0x12'),JSON[_0x0f2e('0x13')](_0x18b904));if(_0x18b904[_0x0f2e('0x14')]){if(_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x15')]===0x1f4){logger[_0x0f2e('0x14')](_0x0f2e('0x11'),_0x4492eb,_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x16')]);return _0x35c2cd(_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x16')]);}logger[_0x0f2e('0x14')](_0x0f2e('0x11'),_0x4492eb,_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x16')]);return _0x321f9e(_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x16')]);}else{logger[_0x0f2e('0x10')](_0x0f2e('0x11'),_0x4492eb,'request\x20sent');_0x321f9e(_0x18b904[_0x0f2e('0x17')][_0x0f2e('0x16')]);}})[_0x0f2e('0x18')](function(_0x553a87){logger[_0x0f2e('0x14')](_0x0f2e('0x11'),_0x4492eb,_0x553a87);_0x35c2cd(_0x553a87);});});}exports['UpdateMailInteraction']=function(_0x4dfad5){var _0x3d4ae5=this;return new Promise(function(_0x5734f1,_0xa5be54){return db[_0x0f2e('0x19')]['update'](_0x4dfad5[_0x0f2e('0x1a')],{'raw':_0x4dfad5[_0x0f2e('0x1b')]?_0x4dfad5[_0x0f2e('0x1b')][_0x0f2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dfad5[_0x0f2e('0x1b')]?_0x4dfad5[_0x0f2e('0x1b')][_0x0f2e('0x1d')]||null:null,'attributes':_0x4dfad5[_0x0f2e('0x1b')]?_0x4dfad5['options'][_0x0f2e('0x1e')]||null:null,'limit':_0x4dfad5[_0x0f2e('0x1b')]?_0x4dfad5[_0x0f2e('0x1b')][_0x0f2e('0x1f')]||null:null})['then'](function(_0x4c7a9e){logger[_0x0f2e('0x10')](_0x0f2e('0x20'),_0x4dfad5);logger[_0x0f2e('0x21')]('UpdateMailInteraction',_0x4dfad5,JSON['stringify'](_0x4c7a9e));_0x5734f1(_0x4c7a9e);})[_0x0f2e('0x18')](function(_0x48cd20){logger['error'](_0x0f2e('0x20'),_0x48cd20[_0x0f2e('0x16')],_0x4dfad5);_0xa5be54(_0x3d4ae5[_0x0f2e('0x14')](0x1f4,_0x48cd20[_0x0f2e('0x16')]));});});};exports[_0x0f2e('0x22')]=function(_0x4d73b0){return new Promise(function(_0x18eea3,_0x2e1256){return db[_0x0f2e('0x19')][_0x0f2e('0x23')]({'where':_0x4d73b0['options']?_0x4d73b0[_0x0f2e('0x1b')][_0x0f2e('0x1d')]||null:null})[_0x0f2e('0xf')](function(_0xe3c2d0){if(_0xe3c2d0){return _0xe3c2d0[_0x0f2e('0x24')](_0x4d73b0[_0x0f2e('0x1a')][_0x0f2e('0x25')],_['omit'](_0x4d73b0['body'],[_0x0f2e('0x25'),'id'])||{});}})[_0x0f2e('0x26')](function(_0xb8dc21){logger[_0x0f2e('0x10')](_0x0f2e('0x27'),_0x4d73b0);logger['debug'](_0x0f2e('0x27'),_0x4d73b0,JSON[_0x0f2e('0x13')](_0xb8dc21));_0x18eea3(_0xb8dc21);})[_0x0f2e('0x18')](function(_0x22a031){logger[_0x0f2e('0x14')](_0x0f2e('0x27'),_0x22a031[_0x0f2e('0x16')],_0x4d73b0);_0x2e1256(_this['error'](0x1f4,_0x22a031[_0x0f2e('0x16')]));});});}; \ No newline at end of file +var _0x2787=['redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','limit','then','debug','stringify','AddTagsToMailInteraction','find','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2787,0x15e));var _0x7278=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2787[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7278('0x0'));var util=require('util');var moment=require(_0x7278('0x1'));var BPromise=require('bluebird');var rs=require(_0x7278('0x2'));var fs=require('fs');var Redis=require(_0x7278('0x3'));var db=require(_0x7278('0x4'))['db'];var utils=require(_0x7278('0x5'));var logger=require(_0x7278('0x6'))(_0x7278('0x7'));var config=require('../../config/environment');var jayson=require(_0x7278('0x8'));var client=jayson[_0x7278('0x9')]['http']({'port':0x232a});config[_0x7278('0xa')]=_[_0x7278('0xb')](config['redis'],{'host':_0x7278('0xc'),'port':0x18eb});var socket=require(_0x7278('0xd'))(new Redis(config[_0x7278('0xa')]));require(_0x7278('0xe'))[_0x7278('0xf')](socket);function respondWithRpcPromise(_0x184450,_0x4fdb2b,_0x322afa){return new BPromise(function(_0xcea77e,_0x339fdc){return client['request'](_0x184450,_0x322afa)['then'](function(_0x2693a3){logger['info'](_0x7278('0x10'),_0x4fdb2b,_0x7278('0x11'));logger['debug'](_0x7278('0x12'),_0x4fdb2b,'request\x20sent',JSON['stringify'](_0x2693a3));if(_0x2693a3['error']){if(_0x2693a3[_0x7278('0x13')][_0x7278('0x14')]===0x1f4){logger[_0x7278('0x13')](_0x7278('0x10'),_0x4fdb2b,_0x2693a3['error'][_0x7278('0x15')]);return _0x339fdc(_0x2693a3[_0x7278('0x13')][_0x7278('0x15')]);}logger[_0x7278('0x13')]('MailInteraction,\x20%s,\x20%s',_0x4fdb2b,_0x2693a3[_0x7278('0x13')][_0x7278('0x15')]);return _0xcea77e(_0x2693a3[_0x7278('0x13')][_0x7278('0x15')]);}else{logger[_0x7278('0x16')](_0x7278('0x10'),_0x4fdb2b,'request\x20sent');_0xcea77e(_0x2693a3[_0x7278('0x17')][_0x7278('0x15')]);}})[_0x7278('0x18')](function(_0x517461){logger[_0x7278('0x13')](_0x7278('0x10'),_0x4fdb2b,_0x517461);_0x339fdc(_0x517461);});});}exports[_0x7278('0x19')]=function(_0x153122){var _0x273f14=this;return new Promise(function(_0x1c7431,_0x499e2c){return db[_0x7278('0x1a')]['update'](_0x153122[_0x7278('0x1b')],{'raw':_0x153122[_0x7278('0x1c')]?_0x153122[_0x7278('0x1c')][_0x7278('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x153122['options']?_0x153122[_0x7278('0x1c')][_0x7278('0x1e')]||null:null,'attributes':_0x153122['options']?_0x153122['options']['attributes']||null:null,'limit':_0x153122['options']?_0x153122['options'][_0x7278('0x1f')]||null:null})[_0x7278('0x20')](function(_0x3b2205){logger[_0x7278('0x16')](_0x7278('0x19'),_0x153122);logger[_0x7278('0x21')]('UpdateMailInteraction',_0x153122,JSON[_0x7278('0x22')](_0x3b2205));_0x1c7431(_0x3b2205);})['catch'](function(_0x2163e4){logger[_0x7278('0x13')](_0x7278('0x19'),_0x2163e4[_0x7278('0x15')],_0x153122);_0x499e2c(_0x273f14[_0x7278('0x13')](0x1f4,_0x2163e4['message']));});});};exports[_0x7278('0x23')]=function(_0x3c9b08){return new Promise(function(_0x1b9098,_0x239e44){return db[_0x7278('0x1a')][_0x7278('0x24')]({'where':_0x3c9b08[_0x7278('0x1c')]?_0x3c9b08[_0x7278('0x1c')][_0x7278('0x1e')]||null:null})[_0x7278('0x20')](function(_0x1a3460){if(_0x1a3460){return _0x1a3460['addTags'](_0x3c9b08[_0x7278('0x1b')][_0x7278('0x25')],_['omit'](_0x3c9b08['body'],[_0x7278('0x25'),'id'])||{});}})[_0x7278('0x26')](function(_0x47fc0d){logger['info'](_0x7278('0x27'),_0x3c9b08);logger[_0x7278('0x21')](_0x7278('0x27'),_0x3c9b08,JSON[_0x7278('0x22')](_0x47fc0d));_0x1b9098(_0x47fc0d);})[_0x7278('0x18')](function(_0x2ade99){logger['error'](_0x7278('0x27'),_0x2ade99[_0x7278('0x15')],_0x3c9b08);_0x239e44(_this[_0x7278('0x13')](0x1f4,_0x2ade99['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 0ec6293..d34c592 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 _0x7198=['removeListener','register','mailInteraction:','remove','update','emit'];(function(_0x15e72a,_0x1b63f7){var _0x13bd22=function(_0x1623cf){while(--_0x1623cf){_0x15e72a['push'](_0x15e72a['shift']());}};_0x13bd22(++_0x1b63f7);}(_0x7198,0x1a1));var _0x8719=function(_0x321716,_0x392ac0){_0x321716=_0x321716-0x0;var _0x1ea224=_0x7198[_0x321716];return _0x1ea224;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x8719('0x0'),_0x8719('0x1')];function createListener(_0x42c7ae,_0x5e0ed4){return function(_0x305fb1){_0x5e0ed4[_0x8719('0x2')](_0x42c7ae,_0x305fb1);};}function removeListener(_0x5d428c,_0x5d247c){return function(){MailInteractionEvents[_0x8719('0x3')](_0x5d428c,_0x5d247c);};}exports[_0x8719('0x4')]=function(_0xc0e131){for(var _0x3b2bb7=0x0,_0x5dc224=events['length'];_0x3b2bb7<_0x5dc224;_0x3b2bb7++){var _0x49f660=events[_0x3b2bb7];var _0xc5ff67=createListener(_0x8719('0x5')+_0x49f660,_0xc0e131);MailInteractionEvents['on'](_0x49f660,_0xc5ff67);}}; \ No newline at end of file +var _0x22a0=['mailInteraction:','save','remove','update','emit','length'];(function(_0x4ef3,_0x84ad99){var _0x562f3a=function(_0x32ae71){while(--_0x32ae71){_0x4ef3['push'](_0x4ef3['shift']());}};_0x562f3a(++_0x84ad99);}(_0x22a0,0x1e7));var _0x022a=function(_0x561f21,_0x275f68){_0x561f21=_0x561f21-0x0;var _0xa9c0ec=_0x22a0[_0x561f21];return _0xa9c0ec;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x022a('0x0'),_0x022a('0x1'),_0x022a('0x2')];function createListener(_0x485123,_0x4de04f){return function(_0x37d502){_0x4de04f[_0x022a('0x3')](_0x485123,_0x37d502);};}function removeListener(_0x520f55,_0x598ba7){return function(){MailInteractionEvents['removeListener'](_0x520f55,_0x598ba7);};}exports['register']=function(_0x2ca9b8){for(var _0x4d6043=0x0,_0x36c7cd=events[_0x022a('0x4')];_0x4d6043<_0x36c7cd;_0x4d6043++){var _0x1abcdf=events[_0x4d6043];var _0x325b60=createListener(_0x022a('0x5')+_0x1abcdf,_0x2ca9b8);MailInteractionEvents['on'](_0x1abcdf,_0x325b60);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b546912..cb79986 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 _0xcf9d=['index','get','/describe','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated'];(function(_0x5c97df,_0x3f2b45){var _0x4a8613=function(_0x36134c){while(--_0x36134c){_0x5c97df['push'](_0x5c97df['shift']());}};_0x4a8613(++_0x3f2b45);}(_0xcf9d,0x147));var _0xdcf9=function(_0x26b6d1,_0x57f1d9){_0x26b6d1=_0x26b6d1-0x0;var _0x494b96=_0xcf9d[_0x26b6d1];return _0x494b96;};'use strict';var multer=require('multer');var util=require(_0xdcf9('0x0'));var path=require(_0xdcf9('0x1'));var timeout=require(_0xdcf9('0x2'));var express=require(_0xdcf9('0x3'));var router=express[_0xdcf9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdcf9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdcf9('0x6'));var controller=require(_0xdcf9('0x7'));router['get']('/',auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x9')]);router[_0xdcf9('0xa')](_0xdcf9('0xb'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0xc')]);router[_0xdcf9('0xa')](_0xdcf9('0xd'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0xe')]);router[_0xdcf9('0xa')](_0xdcf9('0xf'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x10')]);router[_0xdcf9('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xdcf9('0x12'),_0xdcf9('0x13')),controller[_0xdcf9('0x14')]);router[_0xdcf9('0x15')](_0xdcf9('0xd'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x16')]);router[_0xdcf9('0x15')]('/:id/accept',auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x17')]);router['put'](_0xdcf9('0x18'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x19')]);router[_0xdcf9('0x1a')](_0xdcf9('0xd'),auth[_0xdcf9('0x8')](),controller[_0xdcf9('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x7b6b=['post','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download'];(function(_0x16c071,_0x475628){var _0x4e51c5=function(_0x284972){while(--_0x284972){_0x16c071['push'](_0x16c071['shift']());}};_0x4e51c5(++_0x475628);}(_0x7b6b,0xac));var _0xb7b6=function(_0x38cef0,_0x381d4e){_0x38cef0=_0x38cef0-0x0;var _0x7c0b97=_0x7b6b[_0x38cef0];return _0x7c0b97;};'use strict';var multer=require(_0xb7b6('0x0'));var util=require('util');var path=require(_0xb7b6('0x1'));var timeout=require(_0xb7b6('0x2'));var express=require(_0xb7b6('0x3'));var router=express['Router']();var fs_extra=require(_0xb7b6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb7b6('0x5'));var config=require(_0xb7b6('0x6'));var controller=require(_0xb7b6('0x7'));router[_0xb7b6('0x8')]('/',auth[_0xb7b6('0x9')](),controller[_0xb7b6('0xa')]);router[_0xb7b6('0x8')](_0xb7b6('0xb'),auth[_0xb7b6('0x9')](),controller[_0xb7b6('0xc')]);router[_0xb7b6('0x8')](_0xb7b6('0xd'),auth[_0xb7b6('0x9')](),controller[_0xb7b6('0xe')]);router[_0xb7b6('0x8')](_0xb7b6('0xf'),auth[_0xb7b6('0x9')](),controller[_0xb7b6('0x10')]);router[_0xb7b6('0x11')]('/',auth[_0xb7b6('0x9')](),interaction['tracked'](_0xb7b6('0x12'),_0xb7b6('0x13')),controller[_0xb7b6('0x14')]);router[_0xb7b6('0x15')](_0xb7b6('0xd'),auth[_0xb7b6('0x9')](),controller[_0xb7b6('0x16')]);router[_0xb7b6('0x15')](_0xb7b6('0x17'),auth[_0xb7b6('0x9')](),controller[_0xb7b6('0x18')]);router[_0xb7b6('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0xb7b6('0x19')]);router['delete']('/:id',auth[_0xb7b6('0x9')](),controller['destroy']);module[_0xb7b6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index a971e7a..8386559 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 _0xa021=['ENUM','out','STRING','long','DATE','INTEGER','Email','sequelize','lodash','TEXT','BOOLEAN'];(function(_0x45c1d7,_0x14e406){var _0x43f521=function(_0x1b5d67){while(--_0x1b5d67){_0x45c1d7['push'](_0x45c1d7['shift']());}};_0x43f521(++_0x14e406);}(_0xa021,0x151));var _0x1a02=function(_0x513483,_0x105ccd){_0x513483=_0x513483-0x0;var _0x384a1e=_0xa021[_0x513483];return _0x384a1e;};'use strict';var Sequelize=require(_0x1a02('0x0'));var _=require(_0x1a02('0x1'));module['exports']={'body':{'type':Sequelize[_0x1a02('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x1a02('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1a02('0x4')]('in',_0x1a02('0x5')),'defaultValue':_0x1a02('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x1a02('0x6')]},'to':{'type':Sequelize[_0x1a02('0x2')](_0x1a02('0x7'))},'cc':{'type':Sequelize[_0x1a02('0x2')](_0x1a02('0x7'))},'bcc':{'type':Sequelize[_0x1a02('0x2')](_0x1a02('0x7'))},'subject':{'type':Sequelize[_0x1a02('0x2')]},'sentAt':{'type':Sequelize[_0x1a02('0x8')]},'attach':{'type':Sequelize[_0x1a02('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1a02('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1a02('0x8')]},'originTo':{'type':Sequelize[_0x1a02('0x2')](_0x1a02('0x7'))},'originCc':{'type':Sequelize[_0x1a02('0x2')](_0x1a02('0x7'))},'originChannel':{'type':Sequelize[_0x1a02('0x4')](_0x1a02('0xa'),'Chat'),'defaultValue':_0x1a02('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x6d85=['ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','TEXT','long','medium','BOOLEAN'];(function(_0x3ada0a,_0x5e94e9){var _0x41ffc0=function(_0xd4dabc){while(--_0xd4dabc){_0x3ada0a['push'](_0x3ada0a['shift']());}};_0x41ffc0(++_0x5e94e9);}(_0x6d85,0x173));var _0x56d8=function(_0x5e7986,_0x8770ef){_0x5e7986=_0x5e7986-0x0;var _0x2ada39=_0x6d85[_0x5e7986];return _0x2ada39;};'use strict';var Sequelize=require(_0x56d8('0x0'));var _=require(_0x56d8('0x1'));module['exports']={'body':{'type':Sequelize[_0x56d8('0x2')](_0x56d8('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x56d8('0x2')](_0x56d8('0x4'))},'read':{'type':Sequelize[_0x56d8('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x56d8('0x6')]('in',_0x56d8('0x7')),'defaultValue':_0x56d8('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x56d8('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x56d8('0x2')](_0x56d8('0x3'))},'cc':{'type':Sequelize[_0x56d8('0x2')]('long')},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x56d8('0x2')]},'sentAt':{'type':Sequelize[_0x56d8('0x9')]},'attach':{'type':Sequelize[_0x56d8('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x56d8('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x56d8('0x3'))},'originCc':{'type':Sequelize[_0x56d8('0x2')](_0x56d8('0x3'))},'originChannel':{'type':Sequelize[_0x56d8('0x6')](_0x56d8('0xb'),_0x56d8('0xc')),'defaultValue':_0x56d8('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 ecfcd74..996666b 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 _0xe7a8=['rows','params','rawAttributes','include','find','body','describe','create','direction','secret','split','findOne','List','CmContact','Contacts','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','root','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','format','UserId','user','agent','get','MailInteraction','isNil','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','interface','rejectmessage','download','toString','join','tmp','server','message-%s.eml','subject','createdAt','Attachment','Attachments','from','decode','headers','bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','MailMessage,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','status','json','offset','limit','count','set','update','then','destroy','end','sendStatus','stack','name','index','map','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','MailMessage','findAll'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0xe7a8,0xee));var _0x8e7a=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0xe7a8[_0x2b1551];return _0x2fc2a1;};'use strict';var emlformat=require(_0x8e7a('0x0'));var moment=require(_0x8e7a('0x1'));var BPromise=require(_0x8e7a('0x2'));var util=require('util');var path=require(_0x8e7a('0x3'));var fs=require('fs');var _=require(_0x8e7a('0x4'));var Redis=require(_0x8e7a('0x5'));var htmlToText=require(_0x8e7a('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8e7a('0x7'));var interaction_log=require(_0x8e7a('0x8'))(_0x8e7a('0x9'));var config=require(_0x8e7a('0xa'));var db=require(_0x8e7a('0xb'))['db'];config[_0x8e7a('0xc')]=_[_0x8e7a('0xd')](config[_0x8e7a('0xc')],{'host':_0x8e7a('0xe'),'port':0x18eb});var socket=require(_0x8e7a('0xf'))(new Redis(config[_0x8e7a('0xc')]));var htmlEntities=require('html-entities');require(_0x8e7a('0x10'))['register'](socket);var jayson=require(_0x8e7a('0x11'));var client=jayson[_0x8e7a('0x12')]['http']({'port':0x232c});var client9003=jayson[_0x8e7a('0x12')][_0x8e7a('0x13')]({'port':0x232b});var client9002=jayson[_0x8e7a('0x12')][_0x8e7a('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x5e331d,_0x39003a,_0x243781,_0x276568){return new BPromise(function(_0x50d848,_0x333327){var _0x302b8d=_0x276568||client;return _0x302b8d['request'](_0x5e331d,_0x243781)['then'](function(_0x309b38){logger['info'](_0x8e7a('0x14'),_0x39003a,_0x8e7a('0x15'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x39003a,_0x8e7a('0x15'),JSON['stringify'](_0x309b38));if(_0x309b38['error']){if(_0x309b38[_0x8e7a('0x16')]['code']===0x1f4){logger[_0x8e7a('0x16')]('MailMessage,\x20%s,\x20%s',_0x39003a,_0x309b38[_0x8e7a('0x16')]['message']);return _0x333327(_0x309b38[_0x8e7a('0x16')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x39003a,_0x309b38[_0x8e7a('0x16')][_0x8e7a('0x17')]);return _0x50d848(_0x309b38['error'][_0x8e7a('0x17')]);}else{logger[_0x8e7a('0x18')](_0x8e7a('0x14'),_0x39003a,'request\x20sent');_0x50d848(_0x309b38[_0x8e7a('0x19')][_0x8e7a('0x17')]);}})[_0x8e7a('0x1a')](function(_0x1fbd81){logger[_0x8e7a('0x16')](_0x8e7a('0x14'),_0x39003a,_0x1fbd81);_0x333327(_0x1fbd81);});});}function respondWithResult(_0xe17a6c,_0x2f3fb4){_0x2f3fb4=_0x2f3fb4||0xc8;return function(_0x675eac){if(_0x675eac){return _0xe17a6c[_0x8e7a('0x1b')](_0x2f3fb4)[_0x8e7a('0x1c')](_0x675eac);}};}function respondWithFilteredResult(_0x678209,_0x2cee24){return function(_0x2d797a){if(_0x2d797a){var _0x2a7df1=typeof _0x2cee24[_0x8e7a('0x1d')]==='undefined'&&typeof _0x2cee24[_0x8e7a('0x1e')]==='undefined';var _0x4ff998=_0x2d797a['count'];var _0xad0909=_0x2a7df1?0x0:_0x2cee24[_0x8e7a('0x1d')];var _0x2f67f7=_0x2a7df1?_0x2d797a[_0x8e7a('0x1f')]:_0x2cee24[_0x8e7a('0x1d')]+_0x2cee24[_0x8e7a('0x1e')];var _0xac9db7;if(_0x2f67f7>=_0x4ff998){_0x2f67f7=_0x4ff998;_0xac9db7=0xc8;}else{_0xac9db7=0xce;}_0x678209['status'](_0xac9db7);return _0x678209[_0x8e7a('0x20')]('Content-Range',_0xad0909+'-'+_0x2f67f7+'/'+_0x4ff998)['json'](_0x2d797a);}return null;};}function saveUpdates(_0x18d47b){return function(_0x31b32a){if(_0x31b32a){return _0x31b32a[_0x8e7a('0x21')](_0x18d47b)[_0x8e7a('0x22')](function(_0x21e701){return _0x21e701;});}return null;};}function removeEntity(_0xc25b9d){return function(_0x4645e3){if(_0x4645e3){return _0x4645e3[_0x8e7a('0x23')]()['then'](function(){_0xc25b9d[_0x8e7a('0x1b')](0xcc)[_0x8e7a('0x24')]();});}};}function handleEntityNotFound(_0x504c7f){return function(_0x47f627){if(!_0x47f627){_0x504c7f[_0x8e7a('0x25')](0x194);}return _0x47f627;};}function handleError(_0x26d2a2,_0x4da9e6){_0x4da9e6=_0x4da9e6||0x1f4;return function(_0x3a4774){logger[_0x8e7a('0x16')](_0x3a4774[_0x8e7a('0x26')]);if(_0x3a4774[_0x8e7a('0x27')]){delete _0x3a4774[_0x8e7a('0x27')];}_0x26d2a2[_0x8e7a('0x1b')](_0x4da9e6)['send'](_0x3a4774);};}exports[_0x8e7a('0x28')]=function(_0x54914e,_0x4f687d){var _0x4daf26={},_0x3a9bdf={},_0x2fee7b={'count':0x0,'rows':[]};var _0x5435c6=_[_0x8e7a('0x29')](db['MailMessage']['rawAttributes'],function(_0x21ac2b){return{'name':_0x21ac2b[_0x8e7a('0x2a')],'type':_0x21ac2b[_0x8e7a('0x2b')][_0x8e7a('0x2c')]};});_0x3a9bdf['model']=_[_0x8e7a('0x29')](_0x5435c6,_0x8e7a('0x27'));_0x3a9bdf[_0x8e7a('0x2d')]=_['keys'](_0x54914e[_0x8e7a('0x2d')]);_0x3a9bdf[_0x8e7a('0x2e')]=_['intersection'](_0x3a9bdf[_0x8e7a('0x2f')],_0x3a9bdf[_0x8e7a('0x2d')]);_0x4daf26['attributes']=_[_0x8e7a('0x30')](_0x3a9bdf['model'],qs[_0x8e7a('0x31')](_0x54914e['query'][_0x8e7a('0x31')]));_0x4daf26[_0x8e7a('0x32')]=_0x4daf26[_0x8e7a('0x32')][_0x8e7a('0x33')]?_0x4daf26[_0x8e7a('0x32')]:_0x3a9bdf[_0x8e7a('0x2f')];if(!_0x54914e['query']['hasOwnProperty']('nolimit')){_0x4daf26[_0x8e7a('0x1e')]=qs[_0x8e7a('0x1e')](_0x54914e[_0x8e7a('0x2d')][_0x8e7a('0x1e')]);_0x4daf26['offset']=qs[_0x8e7a('0x1d')](_0x54914e[_0x8e7a('0x2d')][_0x8e7a('0x1d')]);}_0x4daf26['order']=qs['sort'](_0x54914e['query'][_0x8e7a('0x34')]);_0x4daf26[_0x8e7a('0x35')]=qs[_0x8e7a('0x2e')](_[_0x8e7a('0x36')](_0x54914e[_0x8e7a('0x2d')],_0x3a9bdf[_0x8e7a('0x2e')]),_0x5435c6);if(_0x54914e['query'][_0x8e7a('0x37')]){_0x4daf26[_0x8e7a('0x35')]=_[_0x8e7a('0x38')](_0x4daf26[_0x8e7a('0x35')],{'$or':_[_0x8e7a('0x29')](_0x5435c6,function(_0x25f427){if(_0x25f427[_0x8e7a('0x2b')]!==_0x8e7a('0x39')){var _0x3a534c={};_0x3a534c[_0x25f427[_0x8e7a('0x27')]]={'$like':'%'+_0x54914e[_0x8e7a('0x2d')]['filter']+'%'};return _0x3a534c;}})});}_0x4daf26=_[_0x8e7a('0x38')]({},_0x4daf26,_0x54914e[_0x8e7a('0x3a')]);var _0x4a0158={'where':_0x4daf26['where']};return db['MailMessage']['count'](_0x4a0158)[_0x8e7a('0x22')](function(_0x278a84){_0x2fee7b['count']=_0x278a84;if(_0x54914e[_0x8e7a('0x2d')][_0x8e7a('0x3b')]){_0x4daf26['include']=[{'all':!![]}];}return db[_0x8e7a('0x3c')][_0x8e7a('0x3d')](_0x4daf26);})[_0x8e7a('0x22')](function(_0x5750d7){_0x2fee7b[_0x8e7a('0x3e')]=_0x5750d7;return _0x2fee7b;})[_0x8e7a('0x22')](respondWithFilteredResult(_0x4f687d,_0x4daf26))[_0x8e7a('0x1a')](handleError(_0x4f687d,null));};exports['show']=function(_0x57a6e1,_0x26b53b){var _0x26afdb={'raw':!![],'where':{'id':_0x57a6e1[_0x8e7a('0x3f')]['id']}},_0x506803={};_0x506803['model']=_['keys'](db['MailMessage'][_0x8e7a('0x40')]);_0x506803[_0x8e7a('0x2d')]=_['keys'](_0x57a6e1[_0x8e7a('0x2d')]);_0x506803[_0x8e7a('0x2e')]=_[_0x8e7a('0x30')](_0x506803[_0x8e7a('0x2f')],_0x506803[_0x8e7a('0x2d')]);_0x26afdb[_0x8e7a('0x32')]=_[_0x8e7a('0x30')](_0x506803[_0x8e7a('0x2f')],qs['fields'](_0x57a6e1[_0x8e7a('0x2d')][_0x8e7a('0x31')]));_0x26afdb['attributes']=_0x26afdb[_0x8e7a('0x32')][_0x8e7a('0x33')]?_0x26afdb[_0x8e7a('0x32')]:_0x506803[_0x8e7a('0x2f')];if(_0x57a6e1[_0x8e7a('0x2d')][_0x8e7a('0x3b')]){_0x26afdb[_0x8e7a('0x41')]=[{'all':!![]}];}_0x26afdb=_[_0x8e7a('0x38')]({},_0x26afdb,_0x57a6e1[_0x8e7a('0x3a')]);return db[_0x8e7a('0x3c')][_0x8e7a('0x42')](_0x26afdb)[_0x8e7a('0x22')](handleEntityNotFound(_0x26b53b,null))[_0x8e7a('0x22')](respondWithResult(_0x26b53b,null))[_0x8e7a('0x1a')](handleError(_0x26b53b,null));};exports['update']=function(_0x453268,_0x2fe6b1){if(_0x453268[_0x8e7a('0x43')]['id']){delete _0x453268[_0x8e7a('0x43')]['id'];}return db[_0x8e7a('0x3c')]['find']({'where':{'id':_0x453268[_0x8e7a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2fe6b1,null))['then'](saveUpdates(_0x453268[_0x8e7a('0x43')],null))[_0x8e7a('0x22')](respondWithResult(_0x2fe6b1,null))[_0x8e7a('0x1a')](handleError(_0x2fe6b1,null));};exports[_0x8e7a('0x23')]=function(_0x2d0c96,_0x576c73){return db['MailMessage']['find']({'where':{'id':_0x2d0c96[_0x8e7a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x576c73,null))[_0x8e7a('0x22')](removeEntity(_0x576c73,null))[_0x8e7a('0x1a')](handleError(_0x576c73,null));};exports[_0x8e7a('0x44')]=function(_0x3a5577,_0x197f53){return db['MailMessage'][_0x8e7a('0x44')]()['then'](respondWithResult(_0x197f53,null))[_0x8e7a('0x1a')](handleError(_0x197f53,null));};exports[_0x8e7a('0x45')]=function(_0x1c55ef,_0x1cdec1){return db[_0x8e7a('0x3c')][_0x8e7a('0x45')](_0x1c55ef[_0x8e7a('0x43')])[_0x8e7a('0x22')](function(_0xa16343){if(_0xa16343){if(_0xa16343[_0x8e7a('0x46')]==='out'&&!_0xa16343[_0x8e7a('0x47')]){var _0x59eace,_0x2504fd,_0x318042;if(_0x1c55ef[_0x8e7a('0x43')]['to']){_0x2504fd=_0x1c55ef[_0x8e7a('0x43')]['to'][_0x8e7a('0x48')](',')[0x0];}return db['MailAccount'][_0x8e7a('0x49')]({'where':{'id':_0xa16343['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x8e7a('0x4a'),'include':[{'model':db[_0x8e7a('0x4b')],'as':_0x8e7a('0x4c'),'where':{'email':_0x2504fd},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8e7a('0x4d')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x8e7a('0x4e')],'as':_0x8e7a('0x4e'),'raw':!![]}]}]})['then'](function(_0x5183bb){_0x59eace=_0x5183bb;if(!_0x59eace||!_0x59eace[_0x8e7a('0x4f')])return;var _0x3b7b5d=_0x59eace[_0x8e7a('0x50')]();if(_0x1c55ef[_0x8e7a('0x43')][_0x8e7a('0x51')]&&_0x1c55ef[_0x8e7a('0x43')][_0x8e7a('0x51')][_0x8e7a('0x33')]){for(var _0x42a3ae=0x0;_0x42a3ae<_0x1c55ef['body']['attachments']['length'];_0x42a3ae+=0x1){_0x1c55ef[_0x8e7a('0x43')][_0x8e7a('0x51')][_0x42a3ae]={'filename':_0x1c55ef[_0x8e7a('0x43')][_0x8e7a('0x51')][_0x42a3ae][_0x8e7a('0x27')],'path':path['join'](config[_0x8e7a('0x52')],_0x8e7a('0x53'),_0x1c55ef[_0x8e7a('0x43')][_0x8e7a('0x51')][_0x42a3ae][_0x8e7a('0x54')])};}}_0x318042={'account':_0x3b7b5d,'message':_0x1c55ef[_0x8e7a('0x43')]};return;})[_0x8e7a('0x22')](function(){if(_0x59eace['List']){if(_0x59eace[_0x8e7a('0x4a')]['Contacts']['length']){return _0x59eace[_0x8e7a('0x4a')][_0x8e7a('0x4c')][0x0];}else{return db[_0x8e7a('0x4b')][_0x8e7a('0x45')](_[_0x8e7a('0xd')](_0x1c55ef['body'],{'firstName':_0x1c55ef[_0x8e7a('0x43')]['to'],'email':_0x1c55ef[_0x8e7a('0x43')]['to'],'phone':_0x1c55ef['body']['to'],'ListId':_0x59eace[_0x8e7a('0x55')]}));}}else{throw new Error(_0x8e7a('0x56'));}})[_0x8e7a('0x22')](function(){if(_0x318042){return respondWithRpcPromise('SendMail',_0x8e7a('0x57'),_0x318042,client9003)[_0x8e7a('0x22')](function(_0xcb0d8e){return _0xa16343[_0x8e7a('0x21')]({'read':!![],'messageId':_0xcb0d8e['messageId'],'sentAt':moment()['format'](_0x8e7a('0x58'))});})[_0x8e7a('0x1a')](function(_0x3c3ef3){logger[_0x8e7a('0x16')]('%s',JSON[_0x8e7a('0x59')](_0x3c3ef3));return _0xa16343;});}return _0xa16343;});}return _0xa16343;}})[_0x8e7a('0x22')](respondWithResult(_0x1cdec1,0xc9))[_0x8e7a('0x1a')](handleError(_0x1cdec1,null));};exports[_0x8e7a('0x5a')]=function(_0x5447de,_0x551180){var _0x1943ba={'agent':{},'channel':_0x8e7a('0x5b')};if(_0x5447de[_0x8e7a('0x43')]['id']){delete _0x5447de[_0x8e7a('0x43')]['id'];}_0x5447de[_0x8e7a('0x43')][_0x8e7a('0x5c')]=!![];_0x5447de[_0x8e7a('0x43')][_0x8e7a('0x5d')]=moment()[_0x8e7a('0x5e')](_0x8e7a('0x58'));_0x5447de[_0x8e7a('0x43')][_0x8e7a('0x5f')]=_0x5447de[_0x8e7a('0x43')]['UserId']||_0x5447de[_0x8e7a('0x60')]['id'];_0x1943ba[_0x8e7a('0x61')]['id']=_0x5447de[_0x8e7a('0x43')]['UserId'];return db['MailMessage'][_0x8e7a('0x42')]({'where':{'id':_0x5447de['params']['id'],'UserId':null}})[_0x8e7a('0x22')](handleEntityNotFound(_0x551180,null))['then'](saveUpdates(_0x5447de['body'],null))[_0x8e7a('0x22')](function(_0x10bdc8){if(_0x10bdc8){_0x1943ba[_0x8e7a('0x17')]=_0x10bdc8[_0x8e7a('0x62')]({'plain':!![]});return db[_0x8e7a('0x63')][_0x8e7a('0x42')]({'where':{'id':_0x10bdc8['MailInteractionId']}});}return null;})[_0x8e7a('0x22')](handleEntityNotFound(_0x551180,null))[_0x8e7a('0x22')](function(_0x38ebb0){if(_0x38ebb0){return _0x38ebb0[_0x8e7a('0x21')]({'UserId':_0x5447de[_0x8e7a('0x43')]['UserId'],'read1stAt':_[_0x8e7a('0x64')](_0x38ebb0['read1stAt'])?moment()[_0x8e7a('0x5e')](_0x8e7a('0x58')):undefined});}return null;})[_0x8e7a('0x22')](function(_0x55a835){if(_0x55a835){_0x1943ba['interaction']=_0x55a835[_0x8e7a('0x62')]({'plain':!![]});interaction_log['info'](_0x8e7a('0x65'),_0x5447de[_0x8e7a('0x60')]['id'],_0x5447de['user'][_0x8e7a('0x27')],_0x5447de[_0x8e7a('0x60')][_0x8e7a('0x66')],_0x1943ba[_0x8e7a('0x67')]['id'],_0x5447de[_0x8e7a('0x43')]?JSON[_0x8e7a('0x59')](_0x5447de[_0x8e7a('0x43')]):_0x8e7a('0x68'));return respondWithRpcPromise(_0x8e7a('0x69'),'acceptMessage',_0x1943ba);}return null;})[_0x8e7a('0x22')](function(_0x595601){var _0x37d975=_0x8e7a('0x6a')+_0x595601['message'][_0x8e7a('0x6b')];return db['sequelize'][_0x8e7a('0x2d')](_0x37d975,{'type':db[_0x8e7a('0x6c')][_0x8e7a('0x6d')][_0x8e7a('0x6e')],'raw':!![]})[_0x8e7a('0x22')](function(_0x33e946){return _0x33e946;});})[_0x8e7a('0x22')](function(_0x41a1cb){if(_0x41a1cb){_0x1943ba[_0x8e7a('0x17')][_0x8e7a('0x6f')]=_0x41a1cb[0x0];if(!_0x5447de[_0x8e7a('0x43')]['UserId'])return;return db[_0x8e7a('0x70')][_0x8e7a('0x42')]({'where':{'id':_0x5447de[_0x8e7a('0x43')][_0x8e7a('0x5f')],'role':'agent'},'attributes':['id',_0x8e7a('0x27'),_0x8e7a('0x71'),_0x8e7a('0x72'),_0x8e7a('0x73')],'raw':!![]});}return null;})['then'](function(_0x346d7d){if(!_0x346d7d)return null;_0x1943ba[_0x8e7a('0x17')][_0x8e7a('0x61')]=_0x346d7d;return _0x1943ba;})['then'](function(_0x3ffaca){if(_0x3ffaca){if(_0x5447de[_0x8e7a('0x43')][_0x8e7a('0x74')]){_0x1943ba[_0x8e7a('0x17')]['interface']=util[_0x8e7a('0x5e')](_0x8e7a('0x75'),_0x5447de[_0x8e7a('0x60')]['name']);_0x1943ba[_0x8e7a('0x17')][_0x8e7a('0x76')]=_0x1943ba['channel'];_0x1943ba[_0x8e7a('0x17')][_0x8e7a('0x77')]=_0x1943ba[_0x8e7a('0x76')];_0x1943ba[_0x8e7a('0x17')][_0x8e7a('0x78')]=_0x8e7a('0x5a');_0x1943ba[_0x8e7a('0x17')]['body']=htmlToText[_0x8e7a('0x79')](_0x1943ba[_0x8e7a('0x17')]['body']);return respondWithRpcPromise(_0x8e7a('0x7a'),_0x8e7a('0x7a'),{'event':_0x8e7a('0x7b'),'message':_0x1943ba[_0x8e7a('0x17')]},client9002)['then'](function(){return _0x1943ba;});}return _0x1943ba;}return null;})[_0x8e7a('0x22')](respondWithResult(_0x551180,null))[_0x8e7a('0x1a')](handleError(_0x551180,null));};exports[_0x8e7a('0x7c')]=function(_0x3bc070,_0x5487f7){var _0x259c65={'agent':{},'channel':_0x8e7a('0x5b')};if(_0x3bc070[_0x8e7a('0x43')]['id']){delete _0x3bc070[_0x8e7a('0x43')]['id'];}_0x3bc070[_0x8e7a('0x43')][_0x8e7a('0x5f')]=_0x3bc070[_0x8e7a('0x43')][_0x8e7a('0x5f')]||_0x3bc070[_0x8e7a('0x60')]['id'];_0x259c65['agent']['id']=_0x3bc070['body'][_0x8e7a('0x5f')];return db[_0x8e7a('0x3c')][_0x8e7a('0x42')]({'where':{'id':_0x3bc070[_0x8e7a('0x3f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5487f7,null))[_0x8e7a('0x22')](function(_0xdacb17){if(_0xdacb17){_0x259c65['message']=_0xdacb17[_0x8e7a('0x62')]({'plain':!![]});return db[_0x8e7a('0x63')][_0x8e7a('0x42')]({'where':{'id':_0xdacb17[_0x8e7a('0x7d')]}});}return null;})[_0x8e7a('0x22')](handleEntityNotFound(_0x5487f7,null))[_0x8e7a('0x22')](function(_0x3fa197){if(_0x3fa197){_0x259c65[_0x8e7a('0x67')]=_0x3fa197['get']({'plain':!![]});interaction_log['info'](_0x8e7a('0x7e'),_0x3bc070[_0x8e7a('0x60')]['id'],_0x3bc070['user']['name'],_0x3bc070[_0x8e7a('0x60')][_0x8e7a('0x66')],_0x259c65[_0x8e7a('0x67')]['id'],_0x3bc070['body']?JSON[_0x8e7a('0x59')](_0x3bc070[_0x8e7a('0x43')]):_0x8e7a('0x68'));return respondWithRpcPromise(_0x8e7a('0x7f'),'rejectMessage',_0x259c65);}return null;})['then'](function(_0x128fce){var _0x3d05ca=_0x8e7a('0x6a')+_0x128fce[_0x8e7a('0x17')][_0x8e7a('0x6b')];return db[_0x8e7a('0x80')][_0x8e7a('0x2d')](_0x3d05ca,{'type':db[_0x8e7a('0x6c')]['QueryTypes'][_0x8e7a('0x6e')],'raw':!![]})[_0x8e7a('0x22')](function(_0x4656ef){return _0x4656ef;});})[_0x8e7a('0x22')](function(_0x1fdf93){if(_0x1fdf93){_0x259c65['message'][_0x8e7a('0x6f')]=_0x1fdf93[0x0];if(!_0x3bc070['body'][_0x8e7a('0x5f')])return;return db[_0x8e7a('0x70')][_0x8e7a('0x42')]({'where':{'id':_0x3bc070[_0x8e7a('0x43')][_0x8e7a('0x5f')],'role':'agent'},'attributes':['id',_0x8e7a('0x27'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x5563c4){if(!_0x5563c4)return null;_0x259c65[_0x8e7a('0x17')][_0x8e7a('0x61')]=_0x5563c4;return _0x259c65;})[_0x8e7a('0x22')](function(_0x3ec6f7){if(_0x3ec6f7){_0x3ec6f7[_0x8e7a('0x17')][_0x8e7a('0x81')]=util['format'](_0x8e7a('0x75'),_0x3bc070['user'][_0x8e7a('0x27')]);_0x3ec6f7['message'][_0x8e7a('0x76')]=_0x259c65[_0x8e7a('0x76')];_0x3ec6f7[_0x8e7a('0x17')][_0x8e7a('0x77')]=_0x259c65[_0x8e7a('0x76')];_0x3ec6f7['message'][_0x8e7a('0x78')]=_0x8e7a('0x7c');_0x3ec6f7[_0x8e7a('0x17')][_0x8e7a('0x43')]=htmlToText[_0x8e7a('0x79')](_0x259c65['message']['body']);respondWithRpcPromise(_0x8e7a('0x7a'),_0x8e7a('0x7a'),{'event':_0x8e7a('0x82'),'message':_0x3ec6f7[_0x8e7a('0x17')]},client9002);return _0x259c65;}return null;})[_0x8e7a('0x22')](respondWithResult(_0x5487f7,null))[_0x8e7a('0x1a')](handleError(_0x5487f7,null));};exports[_0x8e7a('0x83')]=function(_0x30a8e4,_0x31caa8){var _0x2cfca5=moment()['unix']()[_0x8e7a('0x84')]();var _0x58409b=path[_0x8e7a('0x85')](config[_0x8e7a('0x52')],'server','files',_0x8e7a('0x86'));var _0x66d987=path[_0x8e7a('0x85')](config['root'],_0x8e7a('0x87'),'files',_0x8e7a('0x51'));var _0x4dd9e4=util[_0x8e7a('0x5e')](_0x8e7a('0x88'),_0x2cfca5);return db['MailMessage']['find']({'where':{'id':_0x30a8e4[_0x8e7a('0x3f')]['id']},'attributes':['id',_0x8e7a('0x43'),'from','to','cc','bcc',_0x8e7a('0x89'),_0x8e7a('0x8a')],'include':_0x30a8e4[_0x8e7a('0x2d')][_0x8e7a('0x51')]?[{'model':db[_0x8e7a('0x8b')],'as':_0x8e7a('0x8c')}]:undefined})[_0x8e7a('0x22')](handleEntityNotFound(_0x31caa8,null))[_0x8e7a('0x22')](function(_0x2972fe){if(_0x2972fe){var _0x41f976=_0x2972fe;var _0x34dfb4={'from':_0x41f976[_0x8e7a('0x8d')],'to':_0x41f976['to'],'subject':_0x41f976[_0x8e7a('0x89')],'html':htmlEntities[_0x8e7a('0x8e')](_0x41f976[_0x8e7a('0x43')]),'headers':{'Date':moment(_0x41f976[_0x8e7a('0x8a')])[_0x8e7a('0x5e')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2972fe['cc']){_0x34dfb4[_0x8e7a('0x8f')]['Cc']=_0x2972fe['cc'];}if(_0x2972fe[_0x8e7a('0x90')]){_0x34dfb4[_0x8e7a('0x8f')]['Bcc']=_0x2972fe['bcc'];}return new BPromise(function(_0x477a6b,_0x206a02){if(_0x2972fe['Attachments']){for(var _0x3916f=0x0;_0x3916f<_0x2972fe['Attachments'][_0x8e7a('0x33')];_0x3916f++){var _0x10cf10=_0x2972fe[_0x8e7a('0x8c')][_0x3916f];var _0x2e75a9=path[_0x8e7a('0x85')](_0x66d987,_0x10cf10['basename']);if(fs[_0x8e7a('0x91')](_0x2e75a9)){_0x34dfb4[_0x8e7a('0x51')]['push']({'name':_0x10cf10[_0x8e7a('0x27')],'contentType':_0x10cf10[_0x8e7a('0x2b')],'data':fs[_0x8e7a('0x92')](_0x2e75a9)});}}}emlformat[_0x8e7a('0x93')](_0x34dfb4,function(_0x4a7e13,_0xa35042){if(_0x4a7e13)return _0x206a02(_0x4a7e13);fs[_0x8e7a('0x94')](path[_0x8e7a('0x85')](_0x58409b,_0x4dd9e4),_0xa35042);return _0x477a6b(_0xa35042);});});}})['then'](function(_0x310373){if(_0x310373){return _0x31caa8['download'](path[_0x8e7a('0x85')](_0x58409b,_0x4dd9e4),_0x4dd9e4,function(_0x1c3a99){if(!_0x1c3a99)fs[_0x8e7a('0x95')](path[_0x8e7a('0x85')](_0x58409b,_0x4dd9e4));});}})[_0x8e7a('0x1a')](handleError(_0x31caa8,null));}; \ No newline at end of file +var _0xac0c=['contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','bcc','createdAt','Attachments','from','subject','decode','headers','Bcc','existsSync','push','readFileSync','writeFileSync','unlinkSync','moment','path','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','status','json','offset','undefined','limit','count','then','destroy','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','options','MailMessage','includeAll','include','findAll','rows','catch','show','params','find','body','describe','create','direction','secret','split','MailAccount','findOne','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','server/files/attachments','basename','List','ListId','SendMail','sendMail','messageId','format','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes'];(function(_0x25b6fb,_0x48ffea){var _0xf143b0=function(_0x21bbe6){while(--_0x21bbe6){_0x25b6fb['push'](_0x25b6fb['shift']());}};_0xf143b0(++_0x48ffea);}(_0xac0c,0x160));var _0xcac0=function(_0x3e4519,_0x4d8f2a){_0x3e4519=_0x3e4519-0x0;var _0x27e5cf=_0xac0c[_0x3e4519];return _0x27e5cf;};'use strict';var emlformat=require('eml-format');var moment=require(_0xcac0('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xcac0('0x1'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0xcac0('0x2'));var logger=require(_0xcac0('0x3'))(_0xcac0('0x4'));var interaction_log=require(_0xcac0('0x3'))(_0xcac0('0x5'));var config=require(_0xcac0('0x6'));var db=require(_0xcac0('0x7'))['db'];config['redis']=_[_0xcac0('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcac0('0x9'))(new Redis(config['redis']));var htmlEntities=require(_0xcac0('0xa'));require(_0xcac0('0xb'))[_0xcac0('0xc')](socket);var jayson=require(_0xcac0('0xd'));var client=jayson[_0xcac0('0xe')][_0xcac0('0xf')]({'port':0x232c});var client9003=jayson['client'][_0xcac0('0xf')]({'port':0x232b});var client9002=jayson[_0xcac0('0xe')][_0xcac0('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x1b1c47,_0x1ac639,_0x55ae70,_0x5d3926){return new BPromise(function(_0x4d8feb,_0x262947){var _0x12bb6f=_0x5d3926||client;return _0x12bb6f[_0xcac0('0x10')](_0x1b1c47,_0x55ae70)['then'](function(_0x20666d){logger['info']('MailMessage,\x20%s,\x20%s',_0x1ac639,'request\x20sent');logger[_0xcac0('0x11')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1ac639,_0xcac0('0x12'),JSON[_0xcac0('0x13')](_0x20666d));if(_0x20666d[_0xcac0('0x14')]){if(_0x20666d[_0xcac0('0x14')][_0xcac0('0x15')]===0x1f4){logger[_0xcac0('0x14')]('MailMessage,\x20%s,\x20%s',_0x1ac639,_0x20666d[_0xcac0('0x14')]['message']);return _0x262947(_0x20666d[_0xcac0('0x14')]['message']);}logger[_0xcac0('0x14')](_0xcac0('0x16'),_0x1ac639,_0x20666d[_0xcac0('0x14')][_0xcac0('0x17')]);return _0x4d8feb(_0x20666d[_0xcac0('0x14')][_0xcac0('0x17')]);}else{logger[_0xcac0('0x18')](_0xcac0('0x16'),_0x1ac639,_0xcac0('0x12'));_0x4d8feb(_0x20666d['result']['message']);}})['catch'](function(_0x5d3861){logger[_0xcac0('0x14')](_0xcac0('0x16'),_0x1ac639,_0x5d3861);_0x262947(_0x5d3861);});});}function respondWithResult(_0x167520,_0x3c8c82){_0x3c8c82=_0x3c8c82||0xc8;return function(_0x445b3a){if(_0x445b3a){return _0x167520[_0xcac0('0x19')](_0x3c8c82)[_0xcac0('0x1a')](_0x445b3a);}};}function respondWithFilteredResult(_0x556073,_0x3064c0){return function(_0x3cb2de){if(_0x3cb2de){var _0x57fa4b=typeof _0x3064c0[_0xcac0('0x1b')]===_0xcac0('0x1c')&&typeof _0x3064c0[_0xcac0('0x1d')]==='undefined';var _0x21f873=_0x3cb2de[_0xcac0('0x1e')];var _0x484fb2=_0x57fa4b?0x0:_0x3064c0[_0xcac0('0x1b')];var _0x4c85ef=_0x57fa4b?_0x3cb2de[_0xcac0('0x1e')]:_0x3064c0[_0xcac0('0x1b')]+_0x3064c0['limit'];var _0x16fc62;if(_0x4c85ef>=_0x21f873){_0x4c85ef=_0x21f873;_0x16fc62=0xc8;}else{_0x16fc62=0xce;}_0x556073[_0xcac0('0x19')](_0x16fc62);return _0x556073['set']('Content-Range',_0x484fb2+'-'+_0x4c85ef+'/'+_0x21f873)[_0xcac0('0x1a')](_0x3cb2de);}return null;};}function saveUpdates(_0x2db7b4){return function(_0x34c3da){if(_0x34c3da){return _0x34c3da['update'](_0x2db7b4)[_0xcac0('0x1f')](function(_0x23b81d){return _0x23b81d;});}return null;};}function removeEntity(_0x3272ce){return function(_0x1e419f){if(_0x1e419f){return _0x1e419f[_0xcac0('0x20')]()[_0xcac0('0x1f')](function(){_0x3272ce[_0xcac0('0x19')](0xcc)[_0xcac0('0x21')]();});}};}function handleEntityNotFound(_0x29e1ac){return function(_0x3013c7){if(!_0x3013c7){_0x29e1ac[_0xcac0('0x22')](0x194);}return _0x3013c7;};}function handleError(_0x3e8bcf,_0x9315dc){_0x9315dc=_0x9315dc||0x1f4;return function(_0x56df8c){logger[_0xcac0('0x14')](_0x56df8c[_0xcac0('0x23')]);if(_0x56df8c['name']){delete _0x56df8c[_0xcac0('0x24')];}_0x3e8bcf[_0xcac0('0x19')](_0x9315dc)[_0xcac0('0x25')](_0x56df8c);};}exports[_0xcac0('0x26')]=function(_0xe1357b,_0x31a857){var _0xc9f73d={},_0x289c6c={},_0x46897f={'count':0x0,'rows':[]};var _0x1fbb85=_['map'](db['MailMessage'][_0xcac0('0x27')],function(_0x4813a5){return{'name':_0x4813a5[_0xcac0('0x28')],'type':_0x4813a5[_0xcac0('0x29')][_0xcac0('0x2a')]};});_0x289c6c[_0xcac0('0x2b')]=_[_0xcac0('0x2c')](_0x1fbb85,_0xcac0('0x24'));_0x289c6c[_0xcac0('0x2d')]=_[_0xcac0('0x2e')](_0xe1357b['query']);_0x289c6c[_0xcac0('0x2f')]=_[_0xcac0('0x30')](_0x289c6c[_0xcac0('0x2b')],_0x289c6c[_0xcac0('0x2d')]);_0xc9f73d['attributes']=_[_0xcac0('0x30')](_0x289c6c[_0xcac0('0x2b')],qs['fields'](_0xe1357b['query'][_0xcac0('0x31')]));_0xc9f73d[_0xcac0('0x32')]=_0xc9f73d['attributes'][_0xcac0('0x33')]?_0xc9f73d[_0xcac0('0x32')]:_0x289c6c[_0xcac0('0x2b')];if(!_0xe1357b[_0xcac0('0x2d')][_0xcac0('0x34')]('nolimit')){_0xc9f73d[_0xcac0('0x1d')]=qs[_0xcac0('0x1d')](_0xe1357b[_0xcac0('0x2d')][_0xcac0('0x1d')]);_0xc9f73d[_0xcac0('0x1b')]=qs[_0xcac0('0x1b')](_0xe1357b[_0xcac0('0x2d')][_0xcac0('0x1b')]);}_0xc9f73d['order']=qs[_0xcac0('0x35')](_0xe1357b[_0xcac0('0x2d')]['sort']);_0xc9f73d[_0xcac0('0x36')]=qs[_0xcac0('0x2f')](_[_0xcac0('0x37')](_0xe1357b[_0xcac0('0x2d')],_0x289c6c[_0xcac0('0x2f')]),_0x1fbb85);if(_0xe1357b[_0xcac0('0x2d')]['filter']){_0xc9f73d['where']=_[_0xcac0('0x38')](_0xc9f73d[_0xcac0('0x36')],{'$or':_[_0xcac0('0x2c')](_0x1fbb85,function(_0x5f1605){if(_0x5f1605[_0xcac0('0x29')]!=='VIRTUAL'){var _0x51f5af={};_0x51f5af[_0x5f1605[_0xcac0('0x24')]]={'$like':'%'+_0xe1357b[_0xcac0('0x2d')]['filter']+'%'};return _0x51f5af;}})});}_0xc9f73d=_[_0xcac0('0x38')]({},_0xc9f73d,_0xe1357b[_0xcac0('0x39')]);var _0x484166={'where':_0xc9f73d[_0xcac0('0x36')]};return db[_0xcac0('0x3a')]['count'](_0x484166)[_0xcac0('0x1f')](function(_0x5a3f4f){_0x46897f[_0xcac0('0x1e')]=_0x5a3f4f;if(_0xe1357b[_0xcac0('0x2d')][_0xcac0('0x3b')]){_0xc9f73d[_0xcac0('0x3c')]=[{'all':!![]}];}return db[_0xcac0('0x3a')][_0xcac0('0x3d')](_0xc9f73d);})[_0xcac0('0x1f')](function(_0x1749fb){_0x46897f[_0xcac0('0x3e')]=_0x1749fb;return _0x46897f;})['then'](respondWithFilteredResult(_0x31a857,_0xc9f73d))[_0xcac0('0x3f')](handleError(_0x31a857,null));};exports[_0xcac0('0x40')]=function(_0x3ea33b,_0x137f26){var _0x221198={'raw':!![],'where':{'id':_0x3ea33b[_0xcac0('0x41')]['id']}},_0x2856b3={};_0x2856b3[_0xcac0('0x2b')]=_[_0xcac0('0x2e')](db[_0xcac0('0x3a')][_0xcac0('0x27')]);_0x2856b3[_0xcac0('0x2d')]=_[_0xcac0('0x2e')](_0x3ea33b[_0xcac0('0x2d')]);_0x2856b3[_0xcac0('0x2f')]=_['intersection'](_0x2856b3[_0xcac0('0x2b')],_0x2856b3[_0xcac0('0x2d')]);_0x221198[_0xcac0('0x32')]=_[_0xcac0('0x30')](_0x2856b3[_0xcac0('0x2b')],qs[_0xcac0('0x31')](_0x3ea33b['query']['fields']));_0x221198[_0xcac0('0x32')]=_0x221198[_0xcac0('0x32')]['length']?_0x221198[_0xcac0('0x32')]:_0x2856b3[_0xcac0('0x2b')];if(_0x3ea33b[_0xcac0('0x2d')][_0xcac0('0x3b')]){_0x221198[_0xcac0('0x3c')]=[{'all':!![]}];}_0x221198=_[_0xcac0('0x38')]({},_0x221198,_0x3ea33b[_0xcac0('0x39')]);return db[_0xcac0('0x3a')][_0xcac0('0x42')](_0x221198)[_0xcac0('0x1f')](handleEntityNotFound(_0x137f26,null))[_0xcac0('0x1f')](respondWithResult(_0x137f26,null))[_0xcac0('0x3f')](handleError(_0x137f26,null));};exports['update']=function(_0x4aed8a,_0x2a2cb8){if(_0x4aed8a[_0xcac0('0x43')]['id']){delete _0x4aed8a['body']['id'];}return db[_0xcac0('0x3a')][_0xcac0('0x42')]({'where':{'id':_0x4aed8a['params']['id']}})['then'](handleEntityNotFound(_0x2a2cb8,null))[_0xcac0('0x1f')](saveUpdates(_0x4aed8a[_0xcac0('0x43')],null))[_0xcac0('0x1f')](respondWithResult(_0x2a2cb8,null))[_0xcac0('0x3f')](handleError(_0x2a2cb8,null));};exports[_0xcac0('0x20')]=function(_0x28bcdf,_0x228f1a){return db[_0xcac0('0x3a')]['find']({'where':{'id':_0x28bcdf[_0xcac0('0x41')]['id']}})[_0xcac0('0x1f')](handleEntityNotFound(_0x228f1a,null))[_0xcac0('0x1f')](removeEntity(_0x228f1a,null))[_0xcac0('0x3f')](handleError(_0x228f1a,null));};exports[_0xcac0('0x44')]=function(_0x433777,_0x2e77d0){return db['MailMessage'][_0xcac0('0x44')]()['then'](respondWithResult(_0x2e77d0,null))['catch'](handleError(_0x2e77d0,null));};exports[_0xcac0('0x45')]=function(_0xea4f35,_0x346898){return db[_0xcac0('0x3a')][_0xcac0('0x45')](_0xea4f35['body'])[_0xcac0('0x1f')](function(_0x9405f6){if(_0x9405f6){if(_0x9405f6[_0xcac0('0x46')]==='out'&&!_0x9405f6[_0xcac0('0x47')]){var _0x3d69c0,_0x39755d,_0x8251c2;if(_0xea4f35[_0xcac0('0x43')]['to']){_0x39755d=_0xea4f35[_0xcac0('0x43')]['to'][_0xcac0('0x48')](',')[0x0];}return db[_0xcac0('0x49')][_0xcac0('0x4a')]({'where':{'id':_0x9405f6['MailAccountId']},'include':[{'model':db[_0xcac0('0x4b')],'as':'List','include':[{'model':db[_0xcac0('0x4c')],'as':_0xcac0('0x4d'),'where':{'email':_0x39755d},'limit':0x1,'order':[[_0xcac0('0x4e'),_0xcac0('0x4f')]]}]},{'model':db[_0xcac0('0x50')],'as':_0xcac0('0x51'),'raw':!![],'include':[{'model':db[_0xcac0('0x52')],'as':_0xcac0('0x52'),'raw':!![]}]}]})[_0xcac0('0x1f')](function(_0x15175a){_0x3d69c0=_0x15175a;if(!_0x3d69c0||!_0x3d69c0[_0xcac0('0x51')])return;var _0x23ac58=_0x3d69c0[_0xcac0('0x53')]();if(_0xea4f35[_0xcac0('0x43')][_0xcac0('0x54')]&&_0xea4f35['body'][_0xcac0('0x54')][_0xcac0('0x33')]){for(var _0x1d26af=0x0;_0x1d26af<_0xea4f35[_0xcac0('0x43')]['attachments'][_0xcac0('0x33')];_0x1d26af+=0x1){_0xea4f35[_0xcac0('0x43')][_0xcac0('0x54')][_0x1d26af]={'filename':_0xea4f35[_0xcac0('0x43')][_0xcac0('0x54')][_0x1d26af][_0xcac0('0x24')],'path':path[_0xcac0('0x55')](config['root'],_0xcac0('0x56'),_0xea4f35[_0xcac0('0x43')][_0xcac0('0x54')][_0x1d26af][_0xcac0('0x57')])};}}_0x8251c2={'account':_0x23ac58,'message':_0xea4f35[_0xcac0('0x43')]};return;})[_0xcac0('0x1f')](function(){if(_0x3d69c0['List']){if(_0x3d69c0[_0xcac0('0x58')][_0xcac0('0x4d')]['length']){return _0x3d69c0[_0xcac0('0x58')][_0xcac0('0x4d')][0x0];}else{return db[_0xcac0('0x4c')][_0xcac0('0x45')](_[_0xcac0('0x8')](_0xea4f35[_0xcac0('0x43')],{'firstName':_0xea4f35[_0xcac0('0x43')]['to'],'email':_0xea4f35[_0xcac0('0x43')]['to'],'phone':_0xea4f35['body']['to'],'ListId':_0x3d69c0[_0xcac0('0x59')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x8251c2){return respondWithRpcPromise(_0xcac0('0x5a'),_0xcac0('0x5b'),_0x8251c2,client9003)[_0xcac0('0x1f')](function(_0x27e960){return _0x9405f6['update']({'read':!![],'messageId':_0x27e960[_0xcac0('0x5c')],'sentAt':moment()[_0xcac0('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xcac0('0x3f')](function(_0x467832){logger[_0xcac0('0x14')]('%s',JSON[_0xcac0('0x13')](_0x467832));return _0x9405f6;});}return _0x9405f6;});}return _0x9405f6;}})[_0xcac0('0x1f')](respondWithResult(_0x346898,0xc9))[_0xcac0('0x3f')](handleError(_0x346898,null));};exports[_0xcac0('0x5e')]=function(_0x4fc3a3,_0x1038e0){var _0x530caf={'agent':{},'channel':_0xcac0('0x5f')};if(_0x4fc3a3[_0xcac0('0x43')]['id']){delete _0x4fc3a3[_0xcac0('0x43')]['id'];}_0x4fc3a3[_0xcac0('0x43')][_0xcac0('0x60')]=!![];_0x4fc3a3[_0xcac0('0x43')][_0xcac0('0x61')]=moment()[_0xcac0('0x5d')](_0xcac0('0x62'));_0x4fc3a3['body'][_0xcac0('0x63')]=_0x4fc3a3[_0xcac0('0x43')]['UserId']||_0x4fc3a3[_0xcac0('0x64')]['id'];_0x530caf[_0xcac0('0x65')]['id']=_0x4fc3a3[_0xcac0('0x43')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x4fc3a3[_0xcac0('0x41')]['id'],'UserId':null}})[_0xcac0('0x1f')](handleEntityNotFound(_0x1038e0,null))['then'](saveUpdates(_0x4fc3a3[_0xcac0('0x43')],null))[_0xcac0('0x1f')](function(_0x512f16){if(_0x512f16){_0x530caf[_0xcac0('0x17')]=_0x512f16[_0xcac0('0x66')]({'plain':!![]});return db[_0xcac0('0x67')][_0xcac0('0x42')]({'where':{'id':_0x512f16[_0xcac0('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x1038e0,null))[_0xcac0('0x1f')](function(_0x168bfd){if(_0x168bfd){return _0x168bfd['update']({'UserId':_0x4fc3a3['body'][_0xcac0('0x63')],'read1stAt':_[_0xcac0('0x69')](_0x168bfd[_0xcac0('0x6a')])?moment()[_0xcac0('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcac0('0x1f')](function(_0x4f7995){if(_0x4f7995){_0x530caf[_0xcac0('0x6b')]=_0x4f7995[_0xcac0('0x66')]({'plain':!![]});interaction_log[_0xcac0('0x18')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4fc3a3[_0xcac0('0x64')]['id'],_0x4fc3a3[_0xcac0('0x64')]['name'],_0x4fc3a3['user']['role'],_0x530caf[_0xcac0('0x6b')]['id'],_0x4fc3a3[_0xcac0('0x43')]?JSON[_0xcac0('0x13')](_0x4fc3a3[_0xcac0('0x43')]):_0xcac0('0x6c'));return respondWithRpcPromise(_0xcac0('0x6d'),_0xcac0('0x6e'),_0x530caf);}return null;})['then'](function(_0x3707d7){var _0x756a41=_0xcac0('0x6f')+_0x3707d7[_0xcac0('0x17')][_0xcac0('0x70')];return db[_0xcac0('0x71')][_0xcac0('0x2d')](_0x756a41,{'type':db[_0xcac0('0x72')][_0xcac0('0x73')]['SELECT'],'raw':!![]})['then'](function(_0x242a23){return _0x242a23;});})[_0xcac0('0x1f')](function(_0xa7a355){if(_0xa7a355){_0x530caf[_0xcac0('0x17')][_0xcac0('0x74')]=_0xa7a355[0x0];if(!_0x4fc3a3['body'][_0xcac0('0x63')])return;return db[_0xcac0('0x75')][_0xcac0('0x42')]({'where':{'id':_0x4fc3a3[_0xcac0('0x43')][_0xcac0('0x63')],'role':'agent'},'attributes':['id',_0xcac0('0x24'),_0xcac0('0x76'),'email',_0xcac0('0x77')],'raw':!![]});}return null;})['then'](function(_0x593f15){if(!_0x593f15)return null;_0x530caf[_0xcac0('0x17')][_0xcac0('0x65')]=_0x593f15;return _0x530caf;})['then'](function(_0x4d9a3d){if(_0x4d9a3d){if(_0x4fc3a3['body'][_0xcac0('0x78')]){_0x530caf[_0xcac0('0x17')][_0xcac0('0x79')]=util['format'](_0xcac0('0x7a'),_0x4fc3a3[_0xcac0('0x64')][_0xcac0('0x24')]);_0x530caf[_0xcac0('0x17')][_0xcac0('0x7b')]=_0x530caf[_0xcac0('0x7b')];_0x530caf[_0xcac0('0x17')][_0xcac0('0x7c')]=_0x530caf['channel'];_0x530caf[_0xcac0('0x17')]['event']='accept';_0x530caf['message']['body']=htmlToText[_0xcac0('0x7d')](_0x530caf[_0xcac0('0x17')][_0xcac0('0x43')]);return respondWithRpcPromise('EventManager',_0xcac0('0x7e'),{'event':_0xcac0('0x7f'),'message':_0x530caf[_0xcac0('0x17')]},client9002)[_0xcac0('0x1f')](function(){return _0x530caf;});}return _0x530caf;}return null;})['then'](respondWithResult(_0x1038e0,null))[_0xcac0('0x3f')](handleError(_0x1038e0,null));};exports[_0xcac0('0x80')]=function(_0x4e535b,_0x31cebb){var _0x2c8cdf={'agent':{},'channel':_0xcac0('0x5f')};if(_0x4e535b[_0xcac0('0x43')]['id']){delete _0x4e535b['body']['id'];}_0x4e535b[_0xcac0('0x43')][_0xcac0('0x63')]=_0x4e535b[_0xcac0('0x43')][_0xcac0('0x63')]||_0x4e535b[_0xcac0('0x64')]['id'];_0x2c8cdf['agent']['id']=_0x4e535b['body'][_0xcac0('0x63')];return db[_0xcac0('0x3a')][_0xcac0('0x42')]({'where':{'id':_0x4e535b[_0xcac0('0x41')]['id'],'UserId':null}})[_0xcac0('0x1f')](handleEntityNotFound(_0x31cebb,null))[_0xcac0('0x1f')](function(_0x41c3dd){if(_0x41c3dd){_0x2c8cdf[_0xcac0('0x17')]=_0x41c3dd[_0xcac0('0x66')]({'plain':!![]});return db[_0xcac0('0x67')]['find']({'where':{'id':_0x41c3dd[_0xcac0('0x68')]}});}return null;})[_0xcac0('0x1f')](handleEntityNotFound(_0x31cebb,null))[_0xcac0('0x1f')](function(_0x5a1e1d){if(_0x5a1e1d){_0x2c8cdf[_0xcac0('0x6b')]=_0x5a1e1d[_0xcac0('0x66')]({'plain':!![]});interaction_log['info'](_0xcac0('0x81'),_0x4e535b[_0xcac0('0x64')]['id'],_0x4e535b[_0xcac0('0x64')]['name'],_0x4e535b[_0xcac0('0x64')][_0xcac0('0x82')],_0x2c8cdf[_0xcac0('0x6b')]['id'],_0x4e535b[_0xcac0('0x43')]?JSON[_0xcac0('0x13')](_0x4e535b[_0xcac0('0x43')]):_0xcac0('0x6c'));return respondWithRpcPromise(_0xcac0('0x83'),_0xcac0('0x84'),_0x2c8cdf);}return null;})['then'](function(_0x4038c4){var _0x1b71c6=_0xcac0('0x6f')+_0x4038c4[_0xcac0('0x17')][_0xcac0('0x70')];return db[_0xcac0('0x71')][_0xcac0('0x2d')](_0x1b71c6,{'type':db['Sequelize'][_0xcac0('0x73')][_0xcac0('0x85')],'raw':!![]})[_0xcac0('0x1f')](function(_0x4488cd){return _0x4488cd;});})['then'](function(_0x383557){if(_0x383557){_0x2c8cdf['message'][_0xcac0('0x74')]=_0x383557[0x0];if(!_0x4e535b[_0xcac0('0x43')][_0xcac0('0x63')])return;return db[_0xcac0('0x75')]['find']({'where':{'id':_0x4e535b[_0xcac0('0x43')]['UserId'],'role':_0xcac0('0x65')},'attributes':['id',_0xcac0('0x24'),_0xcac0('0x76'),'email',_0xcac0('0x77')],'raw':!![]});}return null;})[_0xcac0('0x1f')](function(_0x1cbd2a){if(!_0x1cbd2a)return null;_0x2c8cdf['message'][_0xcac0('0x65')]=_0x1cbd2a;return _0x2c8cdf;})['then'](function(_0x282cf4){if(_0x282cf4){_0x282cf4['message'][_0xcac0('0x79')]=util['format']('SIP/%s',_0x4e535b[_0xcac0('0x64')][_0xcac0('0x24')]);_0x282cf4[_0xcac0('0x17')][_0xcac0('0x7b')]=_0x2c8cdf['channel'];_0x282cf4['message']['motionChannel']=_0x2c8cdf[_0xcac0('0x7b')];_0x282cf4[_0xcac0('0x17')]['event']=_0xcac0('0x80');_0x282cf4[_0xcac0('0x17')]['body']=htmlToText[_0xcac0('0x7d')](_0x2c8cdf[_0xcac0('0x17')][_0xcac0('0x43')]);respondWithRpcPromise('EventManager',_0xcac0('0x7e'),{'event':_0xcac0('0x86'),'message':_0x282cf4[_0xcac0('0x17')]},client9002);return _0x2c8cdf;}return null;})[_0xcac0('0x1f')](respondWithResult(_0x31cebb,null))[_0xcac0('0x3f')](handleError(_0x31cebb,null));};exports[_0xcac0('0x87')]=function(_0x16d9f6,_0x4f7e67){var _0x5298d1=moment()[_0xcac0('0x88')]()[_0xcac0('0x89')]();var _0x5eb7fa=path['join'](config[_0xcac0('0x8a')],_0xcac0('0x8b'),_0xcac0('0x8c'),_0xcac0('0x8d'));var _0x1a43db=path[_0xcac0('0x55')](config[_0xcac0('0x8a')],_0xcac0('0x8b'),_0xcac0('0x8c'),_0xcac0('0x54'));var _0x35f41c=util[_0xcac0('0x5d')](_0xcac0('0x8e'),_0x5298d1);return db[_0xcac0('0x3a')][_0xcac0('0x42')]({'where':{'id':_0x16d9f6[_0xcac0('0x41')]['id']},'attributes':['id','body','from','to','cc',_0xcac0('0x8f'),'subject',_0xcac0('0x90')],'include':_0x16d9f6[_0xcac0('0x2d')][_0xcac0('0x54')]?[{'model':db['Attachment'],'as':_0xcac0('0x91')}]:undefined})['then'](handleEntityNotFound(_0x4f7e67,null))[_0xcac0('0x1f')](function(_0x1a56e6){if(_0x1a56e6){var _0x7d9e4b=_0x1a56e6;var _0x4305a5={'from':_0x7d9e4b[_0xcac0('0x92')],'to':_0x7d9e4b['to'],'subject':_0x7d9e4b[_0xcac0('0x93')],'html':htmlEntities[_0xcac0('0x94')](_0x7d9e4b[_0xcac0('0x43')]),'headers':{'Date':moment(_0x7d9e4b['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1a56e6['cc']){_0x4305a5[_0xcac0('0x95')]['Cc']=_0x1a56e6['cc'];}if(_0x1a56e6[_0xcac0('0x8f')]){_0x4305a5[_0xcac0('0x95')][_0xcac0('0x96')]=_0x1a56e6[_0xcac0('0x8f')];}return new BPromise(function(_0x1a1d4c,_0x149988){if(_0x1a56e6['Attachments']){for(var _0x4ecfa2=0x0;_0x4ecfa2<_0x1a56e6['Attachments'][_0xcac0('0x33')];_0x4ecfa2++){var _0x3e6eb0=_0x1a56e6[_0xcac0('0x91')][_0x4ecfa2];var _0x1c1dbb=path['join'](_0x1a43db,_0x3e6eb0[_0xcac0('0x57')]);if(fs[_0xcac0('0x97')](_0x1c1dbb)){_0x4305a5[_0xcac0('0x54')][_0xcac0('0x98')]({'name':_0x3e6eb0[_0xcac0('0x24')],'contentType':_0x3e6eb0[_0xcac0('0x29')],'data':fs[_0xcac0('0x99')](_0x1c1dbb)});}}}emlformat['build'](_0x4305a5,function(_0x56416a,_0x4161da){if(_0x56416a)return _0x149988(_0x56416a);fs[_0xcac0('0x9a')](path[_0xcac0('0x55')](_0x5eb7fa,_0x35f41c),_0x4161da);return _0x1a1d4c(_0x4161da);});});}})[_0xcac0('0x1f')](function(_0x417310){if(_0x417310){return _0x4f7e67[_0xcac0('0x87')](path['join'](_0x5eb7fa,_0x35f41c),_0x35f41c,function(_0x10ae49){if(!_0x10ae49)fs[_0xcac0('0x9b')](path[_0xcac0('0x55')](_0x5eb7fa,_0x35f41c));});}})[_0xcac0('0x3f')](handleError(_0x4f7e67,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index e963ccf..d426fd7 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 _0x639b=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1f1636,_0x568ac8){var _0x25417d=function(_0xb38470){while(--_0xb38470){_0x1f1636['push'](_0x1f1636['shift']());}};_0x25417d(++_0x568ac8);}(_0x639b,0x1a7));var _0xb639=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x639b[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xb639('0x0'));var MailMessage=require(_0xb639('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb639('0x2')](0x0);var events={'afterCreate':_0xb639('0x3'),'afterUpdate':'update','afterDestroy':_0xb639('0x4')};function emitEvent(_0x207b05){return function(_0x1a9a03,_0x286bec,_0x35b2aa){MailMessageEvents[_0xb639('0x5')](_0x207b05+':'+_0x1a9a03['id'],_0x1a9a03);MailMessageEvents[_0xb639('0x5')](_0x207b05,_0x1a9a03);_0x35b2aa(null);};}for(var e in events){if(events[_0xb639('0x6')](e)){var event=events[e];MailMessage[_0xb639('0x7')](e,emitEvent(event));}}module[_0xb639('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x1012=['emit','hasOwnProperty','exports','../../mysqldb','MailMessage','setMaxListeners','update'];(function(_0x1daff0,_0x27acfa){var _0xc3e54f=function(_0x1c2edb){while(--_0x1c2edb){_0x1daff0['push'](_0x1daff0['shift']());}};_0xc3e54f(++_0x27acfa);}(_0x1012,0xea));var _0x2101=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x1012[_0x1762b4];return _0x29beda;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x2101('0x0'))['db'][_0x2101('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2101('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2101('0x3'),'afterDestroy':'remove'};function emitEvent(_0x49b322){return function(_0xac1ec7,_0x1f3843,_0xda5402){MailMessageEvents[_0x2101('0x4')](_0x49b322+':'+_0xac1ec7['id'],_0xac1ec7);MailMessageEvents[_0x2101('0x4')](_0x49b322,_0xac1ec7);_0xda5402(null);};}for(var e in events){if(events[_0x2101('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x2101('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index a91db8a..b0efb40 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 _0xd083=['direction','toLowerCase','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','subject','plainBody','fromString','models','get'];(function(_0x5e3b18,_0x198773){var _0x2d3391=function(_0x276a8d){while(--_0x276a8d){_0x5e3b18['push'](_0x5e3b18['shift']());}};_0x2d3391(++_0x198773);}(_0xd083,0xa7));var _0x3d08=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0xd083[_0x4d674b];return _0x535a1f;};'use strict';var _=require(_0x3d08('0x0'));var util=require(_0x3d08('0x1'));var logger=require(_0x3d08('0x2'))(_0x3d08('0x3'));var moment=require(_0x3d08('0x4'));var BPromise=require(_0x3d08('0x5'));var rp=require(_0x3d08('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x3d08('0x7'));var rimraf=require(_0x3d08('0x8'));var config=require('../../config/environment');var attributes=require(_0x3d08('0x9'));module[_0x3d08('0xa')]=function(_0x10f165,_0x305436){return _0x10f165['define'](_0x3d08('0xb'),attributes,{'tableName':_0x3d08('0xc'),'paranoid':![],'indexes':[{'name':_0x3d08('0xd'),'fields':[_0x3d08('0xd')]},{'name':'fti_mail_messages','fields':['plainBody',_0x3d08('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1a5e3a,_0x5a9b6a,_0x78a679){if(_0x1a5e3a['body']){_0x1a5e3a[_0x3d08('0xf')]=htmlToText[_0x3d08('0x10')](_0x1a5e3a['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x78a679(null,_0x5a9b6a);},'afterCreate':function(_0x33d1a3,_0x5d9993,_0x4b8764){var _0x40e621=_0x10f165[_0x3d08('0x11')];var _0x1ba7b6=_0x33d1a3[_0x3d08('0x12')]({'plain':!![]});if(_0x1ba7b6[_0x3d08('0x13')][_0x3d08('0x14')]()==='in'||_0x1ba7b6['direction']['toLowerCase']()==='out'&&!_0x1ba7b6['secret']&&!_[_0x3d08('0x15')](_0x1ba7b6[_0x3d08('0x16')])){_0x40e621[_0x3d08('0x17')][_0x3d08('0x18')]({'where':{'id':_0x1ba7b6[_0x3d08('0x19')]}})[_0x3d08('0x1a')](function(_0x5b5195){if(_0x5b5195){_0x5b5195['update']({'lastMsgAt':_0x1ba7b6[_0x3d08('0x1b')],'lastMsgDirection':_0x1ba7b6[_0x3d08('0x13')][_0x3d08('0x14')]()});}})['catch'](function(_0x36b8f2){console[_0x3d08('0x1c')](_0x36b8f2);});}_0x4b8764();}},'charset':_0x3d08('0x1d'),'collate':_0x3d08('0x1e')});}; \ No newline at end of file +var _0xd0ad=['path','../../config/environment','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','direction','toLowerCase','secret','isNil','UserId','MailInteraction','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','html-to-text'];(function(_0xbb2e58,_0x1fe145){var _0x2f0d91=function(_0x331b3c){while(--_0x331b3c){_0xbb2e58['push'](_0xbb2e58['shift']());}};_0x2f0d91(++_0x1fe145);}(_0xd0ad,0x6e));var _0xdd0a=function(_0x5d7f88,_0x563dd7){_0x5d7f88=_0x5d7f88-0x0;var _0x502eaf=_0xd0ad[_0x5d7f88];return _0x502eaf;};'use strict';var _=require(_0xdd0a('0x0'));var util=require(_0xdd0a('0x1'));var logger=require('../../config/logger')(_0xdd0a('0x2'));var moment=require('moment');var BPromise=require(_0xdd0a('0x3'));var rp=require(_0xdd0a('0x4'));var htmlToText=require(_0xdd0a('0x5'));var fs=require('fs');var path=require(_0xdd0a('0x6'));var rimraf=require('rimraf');var config=require(_0xdd0a('0x7'));var attributes=require('./mailMessage.attributes');module[_0xdd0a('0x8')]=function(_0x450c36,_0x5ceab1){return _0x450c36[_0xdd0a('0x9')](_0xdd0a('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xdd0a('0xb'),'fields':[_0xdd0a('0xb')]},{'name':_0xdd0a('0xc'),'fields':[_0xdd0a('0xd'),_0xdd0a('0xe')],'type':_0xdd0a('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x28e989,_0x5e3642,_0x2a3bf9){if(_0x28e989[_0xdd0a('0x10')]){_0x28e989[_0xdd0a('0xd')]=htmlToText[_0xdd0a('0x11')](_0x28e989[_0xdd0a('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2a3bf9(null,_0x5e3642);},'afterCreate':function(_0x2677d1,_0x1ded1e,_0x1908b5){var _0x530643=_0x450c36['models'];var _0x11e9b1=_0x2677d1['get']({'plain':!![]});if(_0x11e9b1[_0xdd0a('0x12')][_0xdd0a('0x13')]()==='in'||_0x11e9b1[_0xdd0a('0x12')][_0xdd0a('0x13')]()==='out'&&!_0x11e9b1[_0xdd0a('0x14')]&&!_[_0xdd0a('0x15')](_0x11e9b1[_0xdd0a('0x16')])){_0x530643[_0xdd0a('0x17')]['findOne']({'where':{'id':_0x11e9b1['MailInteractionId']}})[_0xdd0a('0x18')](function(_0x59dec7){if(_0x59dec7){_0x59dec7['update']({'lastMsgAt':_0x11e9b1[_0xdd0a('0x19')],'lastMsgDirection':_0x11e9b1[_0xdd0a('0x12')][_0xdd0a('0x13')]()});}})['catch'](function(_0x165693){console[_0xdd0a('0x1a')](_0x165693);});}_0x1908b5();}},'charset':_0xdd0a('0x1b'),'collate':_0xdd0a('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 4d7518f..ea46195 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 _0xa30a=['then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MailMessage','create','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});config[_0xaa30('0xb')]=_[_0xaa30('0xc')](config[_0xaa30('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0xd'))(new Redis(config[_0xaa30('0xb')]));require(_0xaa30('0xe'))[_0xaa30('0xf')](socket);function respondWithRpcPromise(_0x14a6a6,_0x45419f,_0x56f686){return new BPromise(function(_0x5afbf5,_0x12a8ce){return client['request'](_0x14a6a6,_0x56f686)[_0xaa30('0x10')](function(_0x1a5681){logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');logger[_0xaa30('0x13')](_0xaa30('0x14'),_0x45419f,_0xaa30('0x15'),JSON['stringify'](_0x1a5681));if(_0x1a5681[_0xaa30('0x16')]){if(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x17')]===0x1f4){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);return _0x12a8ce(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);}logger[_0xaa30('0x16')]('MailMessage,\x20%s,\x20%s',_0x45419f,_0x1a5681[_0xaa30('0x16')]['message']);return _0x5afbf5(_0x1a5681['error'][_0xaa30('0x18')]);}else{logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');_0x5afbf5(_0x1a5681['result']['message']);}})[_0xaa30('0x19')](function(_0x4acdfa){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x4acdfa);_0x12a8ce(_0x4acdfa);});});}exports['CreateMailMessage']=function(_0x4e29f9){var _0x520abb=this;return new Promise(function(_0x3cbf92,_0x3e4f1d){return db[_0xaa30('0x1a')][_0xaa30('0x1b')](_0x4e29f9[_0xaa30('0x1c')],{'raw':_0x4e29f9['options']?_0x4e29f9[_0xaa30('0x1d')][_0xaa30('0x1e')]===undefined?!![]:![]:!![]})[_0xaa30('0x10')](function(_0x2d9e35){logger[_0xaa30('0x11')]('CreateMailMessage',_0x4e29f9);logger[_0xaa30('0x13')](_0xaa30('0x1f'),_0x4e29f9,JSON[_0xaa30('0x20')](_0x2d9e35));_0x3cbf92(_0x2d9e35);})[_0xaa30('0x19')](function(_0x57d1ca){logger[_0xaa30('0x16')](_0xaa30('0x1f'),_0x57d1ca[_0xaa30('0x18')],_0x4e29f9);_0x3e4f1d(_0x520abb[_0xaa30('0x16')](0x1f4,_0x57d1ca[_0xaa30('0x18')]));});});}; \ No newline at end of file +var _0x583c=['request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','CreateMailMessage','MailMessage','create','body','options','raw','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register'];(function(_0x22c415,_0x273b84){var _0x3ef055=function(_0x5ef923){while(--_0x5ef923){_0x22c415['push'](_0x22c415['shift']());}};_0x3ef055(++_0x273b84);}(_0x583c,0x12b));var _0xc583=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x583c[_0x4169d8];return _0x32084a;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});config[_0xc583('0xa')]=_[_0xc583('0xb')](config['redis'],{'host':_0xc583('0xc'),'port':0x18eb});var socket=require(_0xc583('0xd'))(new Redis(config['redis']));require(_0xc583('0xe'))[_0xc583('0xf')](socket);function respondWithRpcPromise(_0x25f8d3,_0xb23f07,_0x2d99ca){return new BPromise(function(_0x550b1e,_0x3437be){return client[_0xc583('0x10')](_0x25f8d3,_0x2d99ca)['then'](function(_0x23c51a){logger[_0xc583('0x11')]('MailMessage,\x20%s,\x20%s',_0xb23f07,_0xc583('0x12'));logger[_0xc583('0x13')](_0xc583('0x14'),_0xb23f07,_0xc583('0x12'),JSON[_0xc583('0x15')](_0x23c51a));if(_0x23c51a[_0xc583('0x16')]){if(_0x23c51a[_0xc583('0x16')][_0xc583('0x17')]===0x1f4){logger[_0xc583('0x16')]('MailMessage,\x20%s,\x20%s',_0xb23f07,_0x23c51a[_0xc583('0x16')]['message']);return _0x3437be(_0x23c51a[_0xc583('0x16')][_0xc583('0x18')]);}logger['error'](_0xc583('0x19'),_0xb23f07,_0x23c51a[_0xc583('0x16')]['message']);return _0x550b1e(_0x23c51a[_0xc583('0x16')][_0xc583('0x18')]);}else{logger['info'](_0xc583('0x19'),_0xb23f07,_0xc583('0x12'));_0x550b1e(_0x23c51a[_0xc583('0x1a')][_0xc583('0x18')]);}})['catch'](function(_0x3dd3cc){logger['error'](_0xc583('0x19'),_0xb23f07,_0x3dd3cc);_0x3437be(_0x3dd3cc);});});}exports[_0xc583('0x1b')]=function(_0xfd9a60){var _0x774f4c=this;return new Promise(function(_0x1052b5,_0x12b910){return db[_0xc583('0x1c')][_0xc583('0x1d')](_0xfd9a60[_0xc583('0x1e')],{'raw':_0xfd9a60[_0xc583('0x1f')]?_0xfd9a60[_0xc583('0x1f')][_0xc583('0x20')]===undefined?!![]:![]:!![]})[_0xc583('0x21')](function(_0x478ee1){logger['info'](_0xc583('0x1b'),_0xfd9a60);logger[_0xc583('0x13')](_0xc583('0x1b'),_0xfd9a60,JSON['stringify'](_0x478ee1));_0x1052b5(_0x478ee1);})[_0xc583('0x22')](function(_0x959500){logger[_0xc583('0x16')](_0xc583('0x1b'),_0x959500[_0xc583('0x18')],_0xfd9a60);_0x12b910(_0x774f4c['error'](0x1f4,_0x959500['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 027f3c2..78c46c3 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 _0xc775=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','remove'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xc775,0x156));var _0x5c77=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc775[_0x21a9d9];return _0x46adce;};'use strict';var MailMessageEvents=require(_0x5c77('0x0'));var events=['save',_0x5c77('0x1'),_0x5c77('0x2')];function createListener(_0x568275,_0xa341ed){return function(_0x1120e1){_0xa341ed[_0x5c77('0x3')](_0x568275,_0x1120e1);};}function removeListener(_0x53a40c,_0x3ec6b9){return function(){MailMessageEvents[_0x5c77('0x4')](_0x53a40c,_0x3ec6b9);};}exports[_0x5c77('0x5')]=function(_0x54d8ff){for(var _0x36bd85=0x0,_0x25945b=events[_0x5c77('0x6')];_0x36bd85<_0x25945b;_0x36bd85++){var _0x483bc0=events[_0x36bd85];var _0x4bcee4=createListener(_0x5c77('0x7')+_0x483bc0,_0x54d8ff);MailMessageEvents['on'](_0x483bc0,_0x4bcee4);}}; \ No newline at end of file +var _0x6dd0=['remove','update','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x4deada,_0x39335c){var _0x164c75=function(_0x19b450){while(--_0x19b450){_0x4deada['push'](_0x4deada['shift']());}};_0x164c75(++_0x39335c);}(_0x6dd0,0xae));var _0x06dd=function(_0x21b605,_0x2f0cb7){_0x21b605=_0x21b605-0x0;var _0x4dfef8=_0x6dd0[_0x21b605];return _0x4dfef8;};'use strict';var MailMessageEvents=require(_0x06dd('0x0'));var events=[_0x06dd('0x1'),_0x06dd('0x2'),_0x06dd('0x3')];function createListener(_0x31a559,_0x13717f){return function(_0x5ac84a){_0x13717f['emit'](_0x31a559,_0x5ac84a);};}function removeListener(_0x1e9379,_0x41b4d5){return function(){MailMessageEvents[_0x06dd('0x4')](_0x1e9379,_0x41b4d5);};}exports[_0x06dd('0x5')]=function(_0x1fd4d6){for(var _0x3e060d=0x0,_0x4c8123=events[_0x06dd('0x6')];_0x3e060d<_0x4c8123;_0x3e060d++){var _0x37fb3b=events[_0x3e060d];var _0x350274=createListener(_0x06dd('0x7')+_0x37fb3b,_0x1fd4d6);MailMessageEvents['on'](_0x37fb3b,_0x350274);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 2a38af0..6361842 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 _0x1815=['getMembers','/:id/teams','/:id/users','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','describe','/:id','isAuthenticated','show','/:id/members'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0x1815,0xaf));var _0x5181=function(_0x434f2e,_0x68493e){_0x434f2e=_0x434f2e-0x0;var _0x76c0b9=_0x1815[_0x434f2e];return _0x76c0b9;};'use strict';var multer=require(_0x5181('0x0'));var util=require(_0x5181('0x1'));var path=require(_0x5181('0x2'));var timeout=require(_0x5181('0x3'));var express=require(_0x5181('0x4'));var router=express['Router']();var fs_extra=require(_0x5181('0x5'));var auth=require(_0x5181('0x6'));var interaction=require(_0x5181('0x7'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5181('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5181('0x9')]);router[_0x5181('0x8')](_0x5181('0xa'),auth[_0x5181('0xb')](),controller[_0x5181('0xc')]);router['get'](_0x5181('0xd'),auth[_0x5181('0xb')](),controller[_0x5181('0xe')]);router[_0x5181('0x8')](_0x5181('0xf'),auth[_0x5181('0xb')](),controller['getTeams']);router['get'](_0x5181('0x10'),auth[_0x5181('0xb')](),controller['getAgents']);router[_0x5181('0x11')]('/',auth[_0x5181('0xb')](),controller['create']);router[_0x5181('0x11')](_0x5181('0xf'),auth[_0x5181('0xb')](),controller[_0x5181('0x12')]);router[_0x5181('0x11')](_0x5181('0x10'),auth['isAuthenticated'](),controller[_0x5181('0x13')]);router[_0x5181('0x14')](_0x5181('0xa'),auth[_0x5181('0xb')](),controller[_0x5181('0x15')]);router[_0x5181('0x16')](_0x5181('0xa'),auth[_0x5181('0xb')](),controller[_0x5181('0x17')]);router['delete'](_0x5181('0xf'),auth[_0x5181('0xb')](),controller[_0x5181('0x18')]);router['delete']('/:id/users',auth[_0x5181('0xb')](),controller[_0x5181('0x19')]);module[_0x5181('0x1a')]=router; \ No newline at end of file +var _0x0569=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x0569,0x113));var _0x9056=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x0569[_0x3e7804];return _0x56efda;};'use strict';var multer=require(_0x9056('0x0'));var util=require(_0x9056('0x1'));var path=require(_0x9056('0x2'));var timeout=require(_0x9056('0x3'));var express=require(_0x9056('0x4'));var router=express['Router']();var fs_extra=require(_0x9056('0x5'));var auth=require(_0x9056('0x6'));var interaction=require(_0x9056('0x7'));var config=require('../../config/environment');var controller=require(_0x9056('0x8'));router[_0x9056('0x9')]('/',auth[_0x9056('0xa')](),controller[_0x9056('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9056('0xc')]);router[_0x9056('0x9')](_0x9056('0xd'),auth[_0x9056('0xa')](),controller[_0x9056('0xe')]);router[_0x9056('0x9')](_0x9056('0xf'),auth[_0x9056('0xa')](),controller[_0x9056('0x10')]);router['get'](_0x9056('0x11'),auth[_0x9056('0xa')](),controller[_0x9056('0x12')]);router['get'](_0x9056('0x13'),auth['isAuthenticated'](),controller[_0x9056('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9056('0x15')]);router[_0x9056('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9056('0x17')]);router[_0x9056('0x16')](_0x9056('0x13'),auth[_0x9056('0xa')](),controller[_0x9056('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9056('0x19')]);router['delete'](_0x9056('0xd'),auth[_0x9056('0xa')](),controller[_0x9056('0x1a')]);router[_0x9056('0x1b')](_0x9056('0x11'),auth[_0x9056('0xa')](),controller[_0x9056('0x1c')]);router[_0x9056('0x1b')](_0x9056('0x13'),auth[_0x9056('0xa')](),controller[_0x9056('0x1d')]);module[_0x9056('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 7452b54..e95658c 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 _0xc703=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x4c86bd,_0x6e7bc3){var _0x3390a7=function(_0x5c0394){while(--_0x5c0394){_0x4c86bd['push'](_0x4c86bd['shift']());}};_0x3390a7(++_0x6e7bc3);}(_0xc703,0x19f));var _0x3c70=function(_0x1fe559,_0x25fba7){_0x1fe559=_0x1fe559-0x0;var _0xb5b18c=_0xc703[_0x1fe559];return _0xb5b18c;};'use strict';var Sequelize=require(_0x3c70('0x0'));module[_0x3c70('0x1')]={'name':{'type':Sequelize[_0x3c70('0x2')],'unique':_0x3c70('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3c70('0x2')]},'timeout':{'type':Sequelize[_0x3c70('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3c70('0x5'),_0x3c70('0x6'),_0x3c70('0x7'))}}; \ No newline at end of file +var _0x2c83=['exports','STRING','name','ENUM','rrmemory','beepall','sequelize'];(function(_0x47ff2f,_0x435af2){var _0x170768=function(_0x24b58c){while(--_0x24b58c){_0x47ff2f['push'](_0x47ff2f['shift']());}};_0x170768(++_0x435af2);}(_0x2c83,0xdf));var _0x32c8=function(_0x13246c,_0x1179e5){_0x13246c=_0x13246c-0x0;var _0x197f16=_0x2c83[_0x13246c];return _0x197f16;};'use strict';var Sequelize=require(_0x32c8('0x0'));module[_0x32c8('0x1')]={'name':{'type':Sequelize[_0x32c8('0x2')],'unique':_0x32c8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x32c8('0x4')](_0x32c8('0x5'),_0x32c8('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4702809..f82abd3 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 _0x1ea1=['length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','rawAttributes','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','SIP','createdAt','getTeams','Team','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','value','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./mailQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueue','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x17ab58,_0x112a5c){var _0x448340=function(_0x586449){while(--_0x586449){_0x17ab58['push'](_0x17ab58['shift']());}};_0x448340(++_0x112a5c);}(_0x1ea1,0xce));var _0x11ea=function(_0x1ab30e,_0xf5cb91){_0x1ab30e=_0x1ab30e-0x0;var _0x4f0a10=_0x1ea1[_0x1ab30e];return _0x4f0a10;};'use strict';var emlformat=require(_0x11ea('0x0'));var rimraf=require(_0x11ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11ea('0x2'));var rp=require(_0x11ea('0x3'));var moment=require('moment');var BPromise=require(_0x11ea('0x4'));var Mustache=require(_0x11ea('0x5'));var util=require(_0x11ea('0x6'));var path=require(_0x11ea('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x11ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x11ea('0x9'));var crypto=require(_0x11ea('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x11ea('0xb'));var toCsv=require('to-csv');var querystring=require(_0x11ea('0xc'));var Papa=require('papaparse');var Redis=require(_0x11ea('0xd'));var authService=require(_0x11ea('0xe'));var qs=require(_0x11ea('0xf'));var as=require(_0x11ea('0x10'));var hardwareService=require(_0x11ea('0x11'));var logger=require(_0x11ea('0x12'))(_0x11ea('0x13'));var utils=require('../../config/utils');var config=require(_0x11ea('0x14'));var licenseUtil=require(_0x11ea('0x15'));var db=require(_0x11ea('0x16'))['db'];config[_0x11ea('0x17')]=_[_0x11ea('0x18')](config[_0x11ea('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x11ea('0x19'))[_0x11ea('0x1a')](socket);function respondWithStatusCode(_0x4e4c38,_0x3bc4e3){_0x3bc4e3=_0x3bc4e3||0xcc;return function(_0x22e048){if(_0x22e048){return _0x4e4c38[_0x11ea('0x1b')](_0x3bc4e3);}return _0x4e4c38[_0x11ea('0x1c')](_0x3bc4e3)[_0x11ea('0x1d')]();};}function respondWithResult(_0x42fdd5,_0x263dbe){_0x263dbe=_0x263dbe||0xc8;return function(_0x5a6933){if(_0x5a6933){return _0x42fdd5[_0x11ea('0x1c')](_0x263dbe)[_0x11ea('0x1e')](_0x5a6933);}};}function respondWithFilteredResult(_0x156b35,_0x14537e){return function(_0x32e928){if(_0x32e928){var _0x778d63=typeof _0x14537e[_0x11ea('0x1f')]==='undefined'&&typeof _0x14537e[_0x11ea('0x20')]===_0x11ea('0x21');var _0x593146=_0x32e928[_0x11ea('0x22')];var _0x342481=_0x778d63?0x0:_0x14537e[_0x11ea('0x1f')];var _0x11bed3=_0x778d63?_0x32e928[_0x11ea('0x22')]:_0x14537e[_0x11ea('0x1f')]+_0x14537e[_0x11ea('0x20')];var _0xc50182;if(_0x11bed3>=_0x593146){_0x11bed3=_0x593146;_0xc50182=0xc8;}else{_0xc50182=0xce;}_0x156b35[_0x11ea('0x1c')](_0xc50182);return _0x156b35[_0x11ea('0x23')](_0x11ea('0x24'),_0x342481+'-'+_0x11bed3+'/'+_0x593146)[_0x11ea('0x1e')](_0x32e928);}return null;};}function patchUpdates(_0x24ff12){return function(_0x27ca75){try{jsonpatch[_0x11ea('0x25')](_0x27ca75,_0x24ff12,!![]);}catch(_0xd9c0f5){return BPromise[_0x11ea('0x26')](_0xd9c0f5);}return _0x27ca75[_0x11ea('0x27')]();};}function saveUpdates(_0x3c6653,_0x7df261){return function(_0x2aeec3){if(_0x2aeec3){return _0x2aeec3['update'](_0x3c6653)[_0x11ea('0x28')](function(_0xf6b093){return _0xf6b093;});}return null;};}function removeEntity(_0x4c4f9b,_0x566222){return function(_0x1f074a){if(_0x1f074a){return _0x1f074a[_0x11ea('0x29')]()[_0x11ea('0x28')](function(){var _0xe0802d=_0x1f074a[_0x11ea('0x2a')]({'plain':!![]});var _0x340414=_0x11ea('0x2b');return db[_0x11ea('0x2c')][_0x11ea('0x29')]({'where':{'type':_0x340414,'resourceId':_0xe0802d['id']}})[_0x11ea('0x28')](function(){return _0x1f074a;});})[_0x11ea('0x28')](function(){_0x4c4f9b[_0x11ea('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fa44,_0x81eb50){return function(_0x3636b0){if(!_0x3636b0){_0x56fa44[_0x11ea('0x1b')](0x194);}return _0x3636b0;};}function handleError(_0x5eba1c,_0x58f734){_0x58f734=_0x58f734||0x1f4;return function(_0x18a80e){logger['error'](_0x18a80e[_0x11ea('0x2d')]);if(_0x18a80e[_0x11ea('0x2e')]){delete _0x18a80e['name'];}_0x5eba1c[_0x11ea('0x1c')](_0x58f734)[_0x11ea('0x2f')](_0x18a80e);};}exports[_0x11ea('0x30')]=function(_0x3c3eba,_0x2b978c){var _0x54206b={},_0x196796={},_0x467391={'count':0x0,'rows':[]};var _0x1a7a14=_[_0x11ea('0x31')](db['MailQueue']['rawAttributes'],function(_0x1b8489){return{'name':_0x1b8489[_0x11ea('0x32')],'type':_0x1b8489[_0x11ea('0x33')][_0x11ea('0x34')]};});_0x196796[_0x11ea('0x35')]=_[_0x11ea('0x31')](_0x1a7a14,'name');_0x196796[_0x11ea('0x36')]=_['keys'](_0x3c3eba[_0x11ea('0x36')]);_0x196796[_0x11ea('0x37')]=_[_0x11ea('0x38')](_0x196796['model'],_0x196796[_0x11ea('0x36')]);_0x54206b['attributes']=_[_0x11ea('0x38')](_0x196796[_0x11ea('0x35')],qs['fields'](_0x3c3eba[_0x11ea('0x36')][_0x11ea('0x39')]));_0x54206b['attributes']=_0x54206b[_0x11ea('0x3a')]['length']?_0x54206b['attributes']:_0x196796['model'];if(!_0x3c3eba[_0x11ea('0x36')][_0x11ea('0x3b')](_0x11ea('0x3c'))){_0x54206b[_0x11ea('0x20')]=qs[_0x11ea('0x20')](_0x3c3eba['query'][_0x11ea('0x20')]);_0x54206b[_0x11ea('0x1f')]=qs[_0x11ea('0x1f')](_0x3c3eba[_0x11ea('0x36')][_0x11ea('0x1f')]);}_0x54206b[_0x11ea('0x3d')]=qs[_0x11ea('0x3e')](_0x3c3eba[_0x11ea('0x36')][_0x11ea('0x3e')]);_0x54206b[_0x11ea('0x3f')]=qs['filters'](_[_0x11ea('0x40')](_0x3c3eba[_0x11ea('0x36')],_0x196796[_0x11ea('0x37')]),_0x1a7a14);if(_0x3c3eba['query'][_0x11ea('0x41')]){_0x54206b['where']=_[_0x11ea('0x42')](_0x54206b[_0x11ea('0x3f')],{'$or':_[_0x11ea('0x31')](_0x1a7a14,function(_0x5ef824){if(_0x5ef824[_0x11ea('0x33')]!==_0x11ea('0x43')){var _0x2de969={};_0x2de969[_0x5ef824[_0x11ea('0x2e')]]={'$like':'%'+_0x3c3eba[_0x11ea('0x36')][_0x11ea('0x41')]+'%'};return _0x2de969;}})});}_0x54206b=_[_0x11ea('0x42')]({},_0x54206b,_0x3c3eba[_0x11ea('0x44')]);var _0x506e5d={'where':_0x54206b['where']};return db[_0x11ea('0x45')][_0x11ea('0x22')](_0x506e5d)['then'](function(_0x4d69c9){_0x467391['count']=_0x4d69c9;if(_0x3c3eba['query'][_0x11ea('0x46')]){_0x54206b[_0x11ea('0x47')]=[{'all':!![]}];}return db[_0x11ea('0x45')][_0x11ea('0x48')](_0x54206b);})[_0x11ea('0x28')](function(_0x473d57){_0x467391[_0x11ea('0x49')]=_0x473d57;return _0x467391;})['then'](respondWithFilteredResult(_0x2b978c,_0x54206b))[_0x11ea('0x4a')](handleError(_0x2b978c,null));};exports[_0x11ea('0x4b')]=function(_0x3a8ee7,_0x1200de){var _0x507adf={'raw':!![],'where':{'id':_0x3a8ee7[_0x11ea('0x4c')]['id']}},_0x1f4dd8={};_0x1f4dd8[_0x11ea('0x35')]=_[_0x11ea('0x4d')](db['MailQueue']['rawAttributes']);_0x1f4dd8[_0x11ea('0x36')]=_[_0x11ea('0x4d')](_0x3a8ee7[_0x11ea('0x36')]);_0x1f4dd8[_0x11ea('0x37')]=_['intersection'](_0x1f4dd8['model'],_0x1f4dd8[_0x11ea('0x36')]);_0x507adf[_0x11ea('0x3a')]=_[_0x11ea('0x38')](_0x1f4dd8[_0x11ea('0x35')],qs[_0x11ea('0x39')](_0x3a8ee7['query']['fields']));_0x507adf['attributes']=_0x507adf['attributes'][_0x11ea('0x4e')]?_0x507adf['attributes']:_0x1f4dd8['model'];if(_0x3a8ee7[_0x11ea('0x36')][_0x11ea('0x46')]){_0x507adf['include']=[{'all':!![]}];}_0x507adf=_['merge']({},_0x507adf,_0x3a8ee7[_0x11ea('0x44')]);return db['MailQueue'][_0x11ea('0x4f')](_0x507adf)['then'](handleEntityNotFound(_0x1200de,null))['then'](respondWithResult(_0x1200de,null))[_0x11ea('0x4a')](handleError(_0x1200de,null));};exports[_0x11ea('0x50')]=function(_0x20e5a2,_0x4761cb){return db[_0x11ea('0x45')][_0x11ea('0x50')](_0x20e5a2['body'],{})[_0x11ea('0x28')](function(_0x29c9b7){var _0x445f31=_0x20e5a2['user'][_0x11ea('0x2a')]({'plain':!![]});if(!_0x445f31)throw new Error(_0x11ea('0x51'));if(_0x445f31[_0x11ea('0x52')]===_0x11ea('0x53')){var _0x24918d=_0x29c9b7[_0x11ea('0x2a')]({'plain':!![]});var _0x5a72ff=_0x11ea('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x5a72ff,'userProfileId':_0x445f31[_0x11ea('0x54')]},'raw':!![]})[_0x11ea('0x28')](function(_0x14fb98){if(_0x14fb98&&_0x14fb98[_0x11ea('0x55')]===0x0){return db[_0x11ea('0x2c')][_0x11ea('0x50')]({'name':_0x24918d['name'],'resourceId':_0x24918d['id'],'type':_0x14fb98['name'],'sectionId':_0x14fb98['id']},{})[_0x11ea('0x28')](function(){return _0x29c9b7;});}else{return _0x29c9b7;}})['catch'](function(_0x222299){logger[_0x11ea('0x56')](_0x11ea('0x57'),_0x222299);throw _0x222299;});}return _0x29c9b7;})[_0x11ea('0x28')](respondWithResult(_0x4761cb,0xc9))[_0x11ea('0x4a')](handleError(_0x4761cb,null));};exports[_0x11ea('0x58')]=function(_0x588a0a,_0x1be1d0){if(_0x588a0a['body']['id']){delete _0x588a0a[_0x11ea('0x59')]['id'];}return db[_0x11ea('0x45')]['find']({'where':{'id':_0x588a0a['params']['id']}})['then'](handleEntityNotFound(_0x1be1d0,null))[_0x11ea('0x28')](saveUpdates(_0x588a0a[_0x11ea('0x59')],null))[_0x11ea('0x28')](respondWithResult(_0x1be1d0,null))[_0x11ea('0x4a')](handleError(_0x1be1d0,null));};exports[_0x11ea('0x29')]=function(_0x294d4f,_0x2df23d){return db['MailQueue'][_0x11ea('0x4f')]({'where':{'id':_0x294d4f[_0x11ea('0x4c')]['id']}})[_0x11ea('0x28')](handleEntityNotFound(_0x2df23d,null))[_0x11ea('0x28')](removeEntity(_0x2df23d,null))['catch'](handleError(_0x2df23d,null));};exports[_0x11ea('0x5a')]=function(_0x35a456,_0x4e1cfc){return db[_0x11ea('0x45')][_0x11ea('0x5a')]()['then'](respondWithResult(_0x4e1cfc,null))[_0x11ea('0x4a')](handleError(_0x4e1cfc,null));};exports[_0x11ea('0x5b')]=function(_0x4bad3f,_0x4a9001,_0x2e975a){var _0xcbb8bf={'raw':!![],'where':{}},_0x44c705={},_0x5bfaeb;return db['MailQueue'][_0x11ea('0x5c')]({'where':{'id':_0x4bad3f[_0x11ea('0x4c')]['id']}})[_0x11ea('0x28')](handleEntityNotFound(_0x4a9001,null))[_0x11ea('0x28')](function(_0x5bb8ef){if(_0x5bb8ef){_0x5bfaeb=_0x5bb8ef[_0x11ea('0x2a')]({'plain':!![]});_0x44c705['model']=_[_0x11ea('0x4d')](db['UserMailQueue'][_0x11ea('0x5d')]);_0x44c705[_0x11ea('0x36')]=_[_0x11ea('0x4d')](_0x4bad3f[_0x11ea('0x36')]);_0x44c705[_0x11ea('0x37')]=_[_0x11ea('0x38')](_0x44c705['model'],_0x44c705['query']);_0xcbb8bf[_0x11ea('0x3a')]=_[_0x11ea('0x38')](_0x44c705['model'],qs['fields'](_0x4bad3f[_0x11ea('0x36')]['fields']));_0xcbb8bf[_0x11ea('0x3a')]=_0xcbb8bf[_0x11ea('0x3a')][_0x11ea('0x4e')]?_0xcbb8bf[_0x11ea('0x3a')]:_0x44c705['model'];if(!_0x4bad3f[_0x11ea('0x36')][_0x11ea('0x3b')](_0x11ea('0x3c'))){_0xcbb8bf['limit']=qs['limit'](_0x4bad3f[_0x11ea('0x36')]['limit']);_0xcbb8bf[_0x11ea('0x1f')]=qs[_0x11ea('0x1f')](_0x4bad3f[_0x11ea('0x36')][_0x11ea('0x1f')]);}_0xcbb8bf[_0x11ea('0x3d')]=qs[_0x11ea('0x3e')](_0x4bad3f[_0x11ea('0x36')][_0x11ea('0x3e')]);_0xcbb8bf['where']=qs[_0x11ea('0x37')](_[_0x11ea('0x40')](_0x4bad3f['query'],_0x44c705[_0x11ea('0x37')]));_0xcbb8bf['where'][_0x11ea('0x5e')]=_0x5bb8ef['id'];if(_0x4bad3f[_0x11ea('0x36')]['filter']){_0xcbb8bf[_0x11ea('0x3f')]=_[_0x11ea('0x42')](_0xcbb8bf['where'],{'$or':_['map'](_0xcbb8bf[_0x11ea('0x3a')],function(_0xdc817e){var _0x53136f={};_0x53136f[_0xdc817e]={'$like':'%'+_0x4bad3f[_0x11ea('0x36')][_0x11ea('0x41')]+'%'};return _0x53136f;})});}_0xcbb8bf=_[_0x11ea('0x42')]({},_0xcbb8bf,_0x4bad3f[_0x11ea('0x44')]);return db[_0x11ea('0x5f')][_0x11ea('0x48')](_0xcbb8bf);}})[_0x11ea('0x28')](function(_0x231ee1){if(_0x231ee1){return db[_0x11ea('0x60')][_0x11ea('0x61')]({'where':{'id':_['map'](_0x231ee1,_0x11ea('0x62')),'role':_0x11ea('0x63')},'attributes':['id','name',_0x11ea('0x64'),_0x11ea('0x65'),'createdAt']});}})['then'](function(_0x8ba581){if(_0x8ba581){return{'count':_0x8ba581['count'],'rows':_[_0x11ea('0x31')](_0x8ba581['rows'],function(_0x32f991){return{'membername':_0x32f991[_0x11ea('0x2e')],'UserId':_0x32f991['id'],'queue_name':_0x5bfaeb['name'],'MailQueueId':_0x5bfaeb['id'],'interface':util[_0x11ea('0x66')]('%s/%s',_0x11ea('0x67'),_0x32f991['name']),'penalty':0x0,'paused':_0x32f991['mailPause'],'createdAt':_0x32f991[_0x11ea('0x68')],'updatedAt':_0x32f991['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x11ea('0x28')](respondWithFilteredResult(_0x4a9001,_0xcbb8bf))[_0x11ea('0x4a')](handleError(_0x4a9001,null));};exports[_0x11ea('0x69')]=function(_0x1fee57,_0x1e9a0f,_0x2c7a55){var _0x25660a={};var _0x521301={};var _0x11c994;var _0x5ec222;return db['MailQueue'][_0x11ea('0x5c')]({'where':{'id':_0x1fee57[_0x11ea('0x4c')]['id']}})[_0x11ea('0x28')](handleEntityNotFound(_0x1e9a0f,null))['then'](function(_0x5226b3){if(_0x5226b3){_0x11c994=_0x5226b3;_0x521301[_0x11ea('0x35')]=_['keys'](db['Team'][_0x11ea('0x5d')]);_0x521301[_0x11ea('0x36')]=_[_0x11ea('0x4d')](_0x1fee57[_0x11ea('0x36')]);_0x521301[_0x11ea('0x37')]=_[_0x11ea('0x38')](_0x521301['model'],_0x521301[_0x11ea('0x36')]);_0x25660a['attributes']=_[_0x11ea('0x38')](_0x521301[_0x11ea('0x35')],qs[_0x11ea('0x39')](_0x1fee57[_0x11ea('0x36')][_0x11ea('0x39')]));_0x25660a[_0x11ea('0x3a')]=_0x25660a['attributes']['length']?_0x25660a[_0x11ea('0x3a')]:_0x521301[_0x11ea('0x35')];_0x25660a[_0x11ea('0x3d')]=qs['sort'](_0x1fee57[_0x11ea('0x36')][_0x11ea('0x3e')]);_0x25660a[_0x11ea('0x3f')]=qs[_0x11ea('0x37')](_[_0x11ea('0x40')](_0x1fee57['query'],_0x521301[_0x11ea('0x37')]));if(_0x1fee57['query'][_0x11ea('0x41')]){_0x25660a[_0x11ea('0x3f')]=_[_0x11ea('0x42')](_0x25660a[_0x11ea('0x3f')],{'$or':_[_0x11ea('0x31')](_0x25660a[_0x11ea('0x3a')],function(_0x3c3eac){var _0x1479e2={};_0x1479e2[_0x3c3eac]={'$like':'%'+_0x1fee57['query'][_0x11ea('0x41')]+'%'};return _0x1479e2;})});}_0x25660a=_[_0x11ea('0x42')]({},_0x25660a,_0x1fee57[_0x11ea('0x44')]);return _0x11c994['getTeams'](_0x25660a);}})['then'](function(_0xe3cac6){if(_0xe3cac6){_0x5ec222=_0xe3cac6[_0x11ea('0x4e')];if(!_0x1fee57[_0x11ea('0x36')][_0x11ea('0x3b')](_0x11ea('0x3c'))){_0x25660a[_0x11ea('0x20')]=qs['limit'](_0x1fee57['query'][_0x11ea('0x20')]);_0x25660a[_0x11ea('0x1f')]=qs[_0x11ea('0x1f')](_0x1fee57[_0x11ea('0x36')][_0x11ea('0x1f')]);}return _0x11c994[_0x11ea('0x69')](_0x25660a);}})[_0x11ea('0x28')](function(_0x22325a){if(_0x22325a){return _0x22325a?{'count':_0x5ec222,'rows':_0x22325a}:null;}})[_0x11ea('0x28')](respondWithResult(_0x1e9a0f,null))['catch'](handleError(_0x1e9a0f,null));};exports['addTeams']=function(_0x3fe39d,_0x55802e,_0x5119cd){var _0x22c938=_0x3fe39d[_0x11ea('0x59')]['ids'];return db[_0x11ea('0x6a')][_0x11ea('0x48')]({'where':{'id':_0x22c938},'attributes':['id'],'include':[{'model':db[_0x11ea('0x60')],'as':'Agents','attributes':['id',_0x11ea('0x2e'),'online',_0x11ea('0x6b'),_0x11ea('0x6c')],'raw':!![]}]})[_0x11ea('0x28')](function(_0x4c1479){if(_0x4c1479){var _0x2c6a37=_['flatMap'](_0x4c1479,function(_0x189f66){var _0x483cd8=_0x189f66[_0x11ea('0x2a')]({'plain':!![]});return _0x483cd8[_0x11ea('0x6d')];});return db[_0x11ea('0x45')]['find']({'where':{'id':_0x3fe39d[_0x11ea('0x4c')]['id']}})[_0x11ea('0x28')](function(_0x22b860){return db[_0x11ea('0x6e')][_0x11ea('0x6f')](function(_0x288f8e){return _0x22b860['addTeams'](_0x22c938,{'transaction':_0x288f8e})[_0x11ea('0x28')](function(){return BPromise[_0x11ea('0x70')](_0x2c6a37,function(_0xab6059){return db[_0x11ea('0x5f')][_0x11ea('0x71')]({'where':{'UserId':_0xab6059['id'],'MailQueueId':_0x3fe39d[_0x11ea('0x4c')]['id']},'transaction':_0x288f8e});});})[_0x11ea('0x28')](function(){_0x2c6a37[_0x11ea('0x72')](function(_0xa0a9bb){socket[_0x11ea('0x73')](_0x11ea('0x74'),{'UserId':_0xa0a9bb['id'],'MailQueueId':_0x22b860['id']});});});});});}})[_0x11ea('0x28')](respondWithStatusCode(_0x55802e,null))['catch'](handleError(_0x55802e,null));};exports[_0x11ea('0x75')]=function(_0x1c74f5,_0xd75e6b,_0x594548){return db[_0x11ea('0x6a')][_0x11ea('0x48')]({'where':{'id':_0x1c74f5['query'][_0x11ea('0x76')]},'attributes':['id'],'include':[{'model':db[_0x11ea('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x11ea('0x28')](handleEntityNotFound(_0xd75e6b,null))[_0x11ea('0x28')](function(_0x54fb66){var _0x3ea2a8=_[_0x11ea('0x31')](_0x54fb66,'id');var _0x4895b0=[];var _0x3ec124=[];var _0x5cd8bf=squel[_0x11ea('0x77')]();_0x5cd8bf[_0x11ea('0x78')](_0x11ea('0x79'))['from'](_0x11ea('0x7a'),'tq')[_0x11ea('0x7b')](_0x11ea('0x7c'),'ut',_0x11ea('0x7d'))[_0x11ea('0x3f')](_0x11ea('0x7e'),_0x1c74f5['params']['id']);for(var _0x3a683f=0x0;_0x3a683f<_0x54fb66[_0x11ea('0x4e')];_0x3a683f+=0x1){let _0x16106a=_0x54fb66[_0x3a683f];for(var _0x587ccf=0x0;_0x587ccf<_0x16106a['Agents'][_0x11ea('0x4e')];_0x587ccf+=0x1){let _0x1e55ba=_0x16106a[_0x11ea('0x6d')][_0x587ccf];var _0x3f5cd9=_0x5cd8bf['clone']();_0x3f5cd9[_0x11ea('0x3f')](_0x11ea('0x7f'),_0x1e55ba['id']);_0x3ec124[_0x11ea('0x80')](db[_0x11ea('0x6e')][_0x11ea('0x36')](_0x3f5cd9[_0x11ea('0x81')](),{'type':db['sequelize'][_0x11ea('0x82')][_0x11ea('0x83')]})[_0x11ea('0x28')](function(_0x4253da){if(_0x4253da[_0x11ea('0x4e')]===0x1){return _0x1e55ba['id'];}else{var _0x54ab65=_['every'](_[_0x11ea('0x31')](_0x4253da,_0x11ea('0x84')),function(_0x14c7b2){return _['includes'](_0x3ea2a8,_0x14c7b2);});if(_0x54ab65){return _0x1e55ba['id'];}}}));}}return BPromise[_0x11ea('0x85')](_0x3ec124)[_0x11ea('0x28')](function(_0x23bfea){_0x4895b0=_(_0x4895b0)[_0x11ea('0x86')](_0x23bfea)['compact']()[_0x11ea('0x87')]();return db['MailQueue'][_0x11ea('0x4f')]({'where':{'id':_0x1c74f5[_0x11ea('0x4c')]['id']}})['then'](function(_0x3cde3a){return db[_0x11ea('0x6e')][_0x11ea('0x6f')](function(_0x5af7bb){return _0x3cde3a['removeTeams'](_0x1c74f5[_0x11ea('0x36')]['ids'],{'transaction':_0x5af7bb})[_0x11ea('0x28')](function(){if(!_['isEmpty'](_0x4895b0)){return _0x3cde3a[_0x11ea('0x88')](_0x4895b0,{'transaction':_0x5af7bb});}})[_0x11ea('0x28')](function(){_0x4895b0[_0x11ea('0x72')](function(_0x347d69){socket['emit'](_0x11ea('0x89'),{'UserId':_0x347d69,'MailQueueId':_0x3cde3a['id']});});});});});});})[_0x11ea('0x28')](respondWithStatusCode(_0xd75e6b,null))[_0x11ea('0x4a')](handleError(_0xd75e6b,null));};exports[_0x11ea('0x8a')]=function(_0x165f46,_0x9156b1,_0x4b5d70){return db[_0x11ea('0x45')][_0x11ea('0x4f')]({'where':{'id':_0x165f46[_0x11ea('0x4c')]['id']}})['then'](handleEntityNotFound(_0x9156b1,null))[_0x11ea('0x28')](function(_0x544b03){if(_0x544b03){return _0x544b03[_0x11ea('0x8a')](_0x165f46['body'][_0x11ea('0x76')],_['omit'](_0x165f46[_0x11ea('0x59')],[_0x11ea('0x76'),'id'])||{})[_0x11ea('0x8b')](function(_0xaecad5){for(var _0x2a2232=0x0;_0x2a2232<_0x165f46[_0x11ea('0x59')]['ids'][_0x11ea('0x4e')];_0x2a2232+=0x1){socket[_0x11ea('0x73')](_0x11ea('0x74'),{'UserId':Number(_0x165f46[_0x11ea('0x59')]['ids'][_0x2a2232]),'MailQueueId':Number(_0x165f46[_0x11ea('0x4c')]['id'])});}return _0xaecad5;});}})[_0x11ea('0x28')](respondWithResult(_0x9156b1,null))[_0x11ea('0x4a')](handleError(_0x9156b1,null));};exports[_0x11ea('0x88')]=function(_0x1a0b45,_0x3d8a92,_0x404338){return db['MailQueue']['find']({'where':{'id':_0x1a0b45[_0x11ea('0x4c')]['id']}})[_0x11ea('0x28')](handleEntityNotFound(_0x3d8a92,null))[_0x11ea('0x28')](function(_0x5546fb){if(_0x5546fb){return _0x5546fb[_0x11ea('0x88')](_0x1a0b45[_0x11ea('0x36')][_0x11ea('0x76')])[_0x11ea('0x28')](function(){if(_[_0x11ea('0x8c')](_0x1a0b45[_0x11ea('0x36')][_0x11ea('0x76')])){for(var _0x537ad8=0x0;_0x537ad8<_0x1a0b45[_0x11ea('0x36')][_0x11ea('0x76')]['length'];_0x537ad8+=0x1){socket[_0x11ea('0x73')](_0x11ea('0x89'),{'UserId':Number(_0x1a0b45[_0x11ea('0x36')]['ids'][_0x537ad8]),'MailQueueId':Number(_0x1a0b45[_0x11ea('0x4c')]['id'])});}}else{socket['emit'](_0x11ea('0x89'),{'UserId':Number(_0x1a0b45['query'][_0x11ea('0x76')]),'MailQueueId':Number(_0x1a0b45[_0x11ea('0x4c')]['id'])});}});}})[_0x11ea('0x28')](respondWithStatusCode(_0x3d8a92,null))[_0x11ea('0x4a')](handleError(_0x3d8a92,null));};exports[_0x11ea('0x8d')]=function(_0x4e934d,_0x2418f2,_0x1e9e5a){var _0x1d8162={};var _0x23b061={};var _0x3aedc3;var _0xa58755;return db['MailQueue'][_0x11ea('0x5c')]({'where':{'id':_0x4e934d['params']['id']}})[_0x11ea('0x28')](handleEntityNotFound(_0x2418f2,null))['then'](function(_0x1bd1fb){if(_0x1bd1fb){_0x3aedc3=_0x1bd1fb;_0x23b061[_0x11ea('0x35')]=_[_0x11ea('0x4d')](db[_0x11ea('0x60')][_0x11ea('0x5d')]);_0x23b061[_0x11ea('0x36')]=_[_0x11ea('0x4d')](_0x4e934d[_0x11ea('0x36')]);_0x23b061['filters']=_[_0x11ea('0x38')](_0x23b061['model'],_0x23b061[_0x11ea('0x36')]);_0x1d8162[_0x11ea('0x3a')]=_[_0x11ea('0x38')](_0x23b061[_0x11ea('0x35')],qs[_0x11ea('0x39')](_0x4e934d[_0x11ea('0x36')][_0x11ea('0x39')]));_0x1d8162[_0x11ea('0x3a')]=_0x1d8162['attributes']['length']?_0x1d8162[_0x11ea('0x3a')]:_0x23b061[_0x11ea('0x35')];_0x1d8162['order']=qs[_0x11ea('0x3e')](_0x4e934d['query']['sort']);_0x1d8162[_0x11ea('0x3f')]=qs[_0x11ea('0x37')](_[_0x11ea('0x40')](_0x4e934d[_0x11ea('0x36')],_0x23b061[_0x11ea('0x37')]));if(_0x4e934d[_0x11ea('0x36')]['filter']){_0x1d8162[_0x11ea('0x3f')]=_[_0x11ea('0x42')](_0x1d8162[_0x11ea('0x3f')],{'$or':_[_0x11ea('0x31')](_0x1d8162[_0x11ea('0x3a')],function(_0x11a1cd){var _0x13ea56={};_0x13ea56[_0x11a1cd]={'$like':'%'+_0x4e934d[_0x11ea('0x36')][_0x11ea('0x41')]+'%'};return _0x13ea56;})});}_0x1d8162=_[_0x11ea('0x42')]({},_0x1d8162,_0x4e934d['options']);return _0x3aedc3[_0x11ea('0x8d')](_0x1d8162);}})[_0x11ea('0x28')](function(_0x12c818){if(_0x12c818){_0xa58755=_0x12c818[_0x11ea('0x4e')];if(!_0x4e934d['query']['hasOwnProperty']('nolimit')){_0x1d8162['limit']=qs[_0x11ea('0x20')](_0x4e934d[_0x11ea('0x36')][_0x11ea('0x20')]);_0x1d8162[_0x11ea('0x1f')]=qs[_0x11ea('0x1f')](_0x4e934d[_0x11ea('0x36')]['offset']);}return _0x3aedc3[_0x11ea('0x8d')](_0x1d8162);}})['then'](function(_0x4881dd){if(_0x4881dd){return _0x4881dd?{'count':_0xa58755,'rows':_0x4881dd}:null;}})[_0x11ea('0x28')](respondWithResult(_0x2418f2,null))[_0x11ea('0x4a')](handleError(_0x2418f2,null));}; \ No newline at end of file +var _0x37a4=['user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','pick','MailQueueId','options','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','createdAt','%s/%s','SIP','updatedAt','Team','getTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','userMailQueue:save','removeTeams','Agents','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','then','get','MailQueues','UserProfileResource','destroy','error','stack','name','MailQueue','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','find','create','body'];(function(_0x28e459,_0x5d8f1d){var _0x2bdd36=function(_0x2b0161){while(--_0x2b0161){_0x28e459['push'](_0x28e459['shift']());}};_0x2bdd36(++_0x5d8f1d);}(_0x37a4,0xcb));var _0x437a=function(_0x42f845,_0x47e96a){_0x42f845=_0x42f845-0x0;var _0x4f2940=_0x37a4[_0x42f845];return _0x4f2940;};'use strict';var emlformat=require(_0x437a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x437a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x437a('0x2'));var moment=require(_0x437a('0x3'));var BPromise=require(_0x437a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x437a('0x5'));var sox=require(_0x437a('0x6'));var csv=require(_0x437a('0x7'));var ejs=require(_0x437a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x437a('0x9'));var squel=require(_0x437a('0xa'));var crypto=require('crypto');var jsforce=require(_0x437a('0xb'));var deskjs=require(_0x437a('0xc'));var toCsv=require(_0x437a('0x7'));var querystring=require(_0x437a('0xd'));var Papa=require(_0x437a('0xe'));var Redis=require(_0x437a('0xf'));var authService=require(_0x437a('0x10'));var qs=require(_0x437a('0x11'));var as=require(_0x437a('0x12'));var hardwareService=require(_0x437a('0x13'));var logger=require(_0x437a('0x14'))('api');var utils=require(_0x437a('0x15'));var config=require(_0x437a('0x16'));var licenseUtil=require(_0x437a('0x17'));var db=require(_0x437a('0x18'))['db'];config[_0x437a('0x19')]=_['defaults'](config[_0x437a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x437a('0x1a'))(new Redis(config[_0x437a('0x19')]));require(_0x437a('0x1b'))[_0x437a('0x1c')](socket);function respondWithStatusCode(_0x1f4756,_0x89cb08){_0x89cb08=_0x89cb08||0xcc;return function(_0x372161){if(_0x372161){return _0x1f4756[_0x437a('0x1d')](_0x89cb08);}return _0x1f4756[_0x437a('0x1e')](_0x89cb08)[_0x437a('0x1f')]();};}function respondWithResult(_0x19cf32,_0x16aa9c){_0x16aa9c=_0x16aa9c||0xc8;return function(_0x4a44d6){if(_0x4a44d6){return _0x19cf32[_0x437a('0x1e')](_0x16aa9c)['json'](_0x4a44d6);}};}function respondWithFilteredResult(_0x33804e,_0x20173b){return function(_0x170ba3){if(_0x170ba3){var _0x60f54b=typeof _0x20173b[_0x437a('0x20')]===_0x437a('0x21')&&typeof _0x20173b['limit']===_0x437a('0x21');var _0x459284=_0x170ba3[_0x437a('0x22')];var _0x598d89=_0x60f54b?0x0:_0x20173b[_0x437a('0x20')];var _0x53cd54=_0x60f54b?_0x170ba3[_0x437a('0x22')]:_0x20173b[_0x437a('0x20')]+_0x20173b['limit'];var _0x76d5f7;if(_0x53cd54>=_0x459284){_0x53cd54=_0x459284;_0x76d5f7=0xc8;}else{_0x76d5f7=0xce;}_0x33804e['status'](_0x76d5f7);return _0x33804e[_0x437a('0x23')](_0x437a('0x24'),_0x598d89+'-'+_0x53cd54+'/'+_0x459284)[_0x437a('0x25')](_0x170ba3);}return null;};}function patchUpdates(_0x439957){return function(_0x263b61){try{jsonpatch[_0x437a('0x26')](_0x263b61,_0x439957,!![]);}catch(_0x3f9b10){return BPromise[_0x437a('0x27')](_0x3f9b10);}return _0x263b61[_0x437a('0x28')]();};}function saveUpdates(_0x3dad6f,_0x1adcc7){return function(_0x46ebad){if(_0x46ebad){return _0x46ebad['update'](_0x3dad6f)[_0x437a('0x29')](function(_0x29ccd0){return _0x29ccd0;});}return null;};}function removeEntity(_0x39f79b,_0x4d6707){return function(_0x224d7){if(_0x224d7){return _0x224d7['destroy']()[_0x437a('0x29')](function(){var _0x422c2e=_0x224d7[_0x437a('0x2a')]({'plain':!![]});var _0x335659=_0x437a('0x2b');return db[_0x437a('0x2c')][_0x437a('0x2d')]({'where':{'type':_0x335659,'resourceId':_0x422c2e['id']}})[_0x437a('0x29')](function(){return _0x224d7;});})[_0x437a('0x29')](function(){_0x39f79b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e6498,_0x434eb1){return function(_0x212e50){if(!_0x212e50){_0x5e6498[_0x437a('0x1d')](0x194);}return _0x212e50;};}function handleError(_0x5bf228,_0x397ae7){_0x397ae7=_0x397ae7||0x1f4;return function(_0x3cbc11){logger[_0x437a('0x2e')](_0x3cbc11[_0x437a('0x2f')]);if(_0x3cbc11[_0x437a('0x30')]){delete _0x3cbc11['name'];}_0x5bf228['status'](_0x397ae7)['send'](_0x3cbc11);};}exports['index']=function(_0x3693dc,_0x374d61){var _0x312df5={},_0x4a66d9={},_0x4f5413={'count':0x0,'rows':[]};var _0x5e1a94=_['map'](db[_0x437a('0x31')][_0x437a('0x32')],function(_0x1e6296){return{'name':_0x1e6296['fieldName'],'type':_0x1e6296['type'][_0x437a('0x33')]};});_0x4a66d9['model']=_[_0x437a('0x34')](_0x5e1a94,_0x437a('0x30'));_0x4a66d9[_0x437a('0x35')]=_[_0x437a('0x36')](_0x3693dc[_0x437a('0x35')]);_0x4a66d9[_0x437a('0x37')]=_[_0x437a('0x38')](_0x4a66d9[_0x437a('0x39')],_0x4a66d9['query']);_0x312df5[_0x437a('0x3a')]=_[_0x437a('0x38')](_0x4a66d9['model'],qs[_0x437a('0x3b')](_0x3693dc[_0x437a('0x35')]['fields']));_0x312df5['attributes']=_0x312df5['attributes'][_0x437a('0x3c')]?_0x312df5[_0x437a('0x3a')]:_0x4a66d9[_0x437a('0x39')];if(!_0x3693dc[_0x437a('0x35')][_0x437a('0x3d')](_0x437a('0x3e'))){_0x312df5[_0x437a('0x3f')]=qs[_0x437a('0x3f')](_0x3693dc['query'][_0x437a('0x3f')]);_0x312df5[_0x437a('0x20')]=qs[_0x437a('0x20')](_0x3693dc[_0x437a('0x35')][_0x437a('0x20')]);}_0x312df5[_0x437a('0x40')]=qs[_0x437a('0x41')](_0x3693dc[_0x437a('0x35')][_0x437a('0x41')]);_0x312df5['where']=qs[_0x437a('0x37')](_['pick'](_0x3693dc[_0x437a('0x35')],_0x4a66d9[_0x437a('0x37')]),_0x5e1a94);if(_0x3693dc[_0x437a('0x35')][_0x437a('0x42')]){_0x312df5[_0x437a('0x43')]=_[_0x437a('0x44')](_0x312df5['where'],{'$or':_[_0x437a('0x34')](_0x5e1a94,function(_0x1bc1ba){if(_0x1bc1ba[_0x437a('0x45')]!==_0x437a('0x46')){var _0x384be3={};_0x384be3[_0x1bc1ba[_0x437a('0x30')]]={'$like':'%'+_0x3693dc[_0x437a('0x35')]['filter']+'%'};return _0x384be3;}})});}_0x312df5=_['merge']({},_0x312df5,_0x3693dc['options']);var _0x34f908={'where':_0x312df5[_0x437a('0x43')]};return db[_0x437a('0x31')]['count'](_0x34f908)[_0x437a('0x29')](function(_0x43a6c1){_0x4f5413[_0x437a('0x22')]=_0x43a6c1;if(_0x3693dc['query']['includeAll']){_0x312df5['include']=[{'all':!![]}];}return db[_0x437a('0x31')][_0x437a('0x47')](_0x312df5);})[_0x437a('0x29')](function(_0x295406){_0x4f5413[_0x437a('0x48')]=_0x295406;return _0x4f5413;})[_0x437a('0x29')](respondWithFilteredResult(_0x374d61,_0x312df5))[_0x437a('0x49')](handleError(_0x374d61,null));};exports[_0x437a('0x4a')]=function(_0xd90e28,_0x5b4bc2){var _0x4423a1={'raw':!![],'where':{'id':_0xd90e28[_0x437a('0x4b')]['id']}},_0x151e9f={};_0x151e9f[_0x437a('0x39')]=_['keys'](db[_0x437a('0x31')][_0x437a('0x32')]);_0x151e9f['query']=_[_0x437a('0x36')](_0xd90e28[_0x437a('0x35')]);_0x151e9f['filters']=_[_0x437a('0x38')](_0x151e9f[_0x437a('0x39')],_0x151e9f[_0x437a('0x35')]);_0x4423a1[_0x437a('0x3a')]=_[_0x437a('0x38')](_0x151e9f[_0x437a('0x39')],qs[_0x437a('0x3b')](_0xd90e28['query']['fields']));_0x4423a1[_0x437a('0x3a')]=_0x4423a1['attributes'][_0x437a('0x3c')]?_0x4423a1['attributes']:_0x151e9f[_0x437a('0x39')];if(_0xd90e28[_0x437a('0x35')][_0x437a('0x4c')]){_0x4423a1[_0x437a('0x4d')]=[{'all':!![]}];}_0x4423a1=_['merge']({},_0x4423a1,_0xd90e28['options']);return db[_0x437a('0x31')][_0x437a('0x4e')](_0x4423a1)[_0x437a('0x29')](handleEntityNotFound(_0x5b4bc2,null))[_0x437a('0x29')](respondWithResult(_0x5b4bc2,null))[_0x437a('0x49')](handleError(_0x5b4bc2,null));};exports[_0x437a('0x4f')]=function(_0x2b2092,_0x12d2f3){return db[_0x437a('0x31')]['create'](_0x2b2092[_0x437a('0x50')],{})[_0x437a('0x29')](function(_0x465c4e){var _0x466f1c=_0x2b2092[_0x437a('0x51')][_0x437a('0x2a')]({'plain':!![]});if(!_0x466f1c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x466f1c[_0x437a('0x52')]===_0x437a('0x51')){var _0x33c6b1=_0x465c4e['get']({'plain':!![]});var _0x56cc15=_0x437a('0x2b');return db[_0x437a('0x53')][_0x437a('0x4e')]({'where':{'name':_0x56cc15,'userProfileId':_0x466f1c[_0x437a('0x54')]},'raw':!![]})['then'](function(_0x1b255f){if(_0x1b255f&&_0x1b255f[_0x437a('0x55')]===0x0){return db['UserProfileResource'][_0x437a('0x4f')]({'name':_0x33c6b1['name'],'resourceId':_0x33c6b1['id'],'type':_0x1b255f['name'],'sectionId':_0x1b255f['id']},{})[_0x437a('0x29')](function(){return _0x465c4e;});}else{return _0x465c4e;}})[_0x437a('0x49')](function(_0x380d69){logger[_0x437a('0x2e')](_0x437a('0x56'),_0x380d69);throw _0x380d69;});}return _0x465c4e;})[_0x437a('0x29')](respondWithResult(_0x12d2f3,0xc9))[_0x437a('0x49')](handleError(_0x12d2f3,null));};exports[_0x437a('0x57')]=function(_0x1cd3af,_0x2be0f6){if(_0x1cd3af[_0x437a('0x50')]['id']){delete _0x1cd3af[_0x437a('0x50')]['id'];}return db[_0x437a('0x31')][_0x437a('0x4e')]({'where':{'id':_0x1cd3af[_0x437a('0x4b')]['id']}})[_0x437a('0x29')](handleEntityNotFound(_0x2be0f6,null))['then'](saveUpdates(_0x1cd3af['body'],null))[_0x437a('0x29')](respondWithResult(_0x2be0f6,null))[_0x437a('0x49')](handleError(_0x2be0f6,null));};exports[_0x437a('0x2d')]=function(_0x21953e,_0x28d977){return db['MailQueue'][_0x437a('0x4e')]({'where':{'id':_0x21953e[_0x437a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28d977,null))[_0x437a('0x29')](removeEntity(_0x28d977,null))[_0x437a('0x49')](handleError(_0x28d977,null));};exports[_0x437a('0x58')]=function(_0x5f15f6,_0x2ab953){return db['MailQueue'][_0x437a('0x58')]()[_0x437a('0x29')](respondWithResult(_0x2ab953,null))['catch'](handleError(_0x2ab953,null));};exports[_0x437a('0x59')]=function(_0x1bbff8,_0x2eacd6,_0x204932){var _0x562728={'raw':!![],'where':{}},_0x431741={},_0x55bddc;return db[_0x437a('0x31')][_0x437a('0x5a')]({'where':{'id':_0x1bbff8[_0x437a('0x4b')]['id']}})[_0x437a('0x29')](handleEntityNotFound(_0x2eacd6,null))[_0x437a('0x29')](function(_0x354209){if(_0x354209){_0x55bddc=_0x354209['get']({'plain':!![]});_0x431741[_0x437a('0x39')]=_['keys'](db['UserMailQueue'][_0x437a('0x32')]);_0x431741[_0x437a('0x35')]=_[_0x437a('0x36')](_0x1bbff8[_0x437a('0x35')]);_0x431741['filters']=_[_0x437a('0x38')](_0x431741[_0x437a('0x39')],_0x431741[_0x437a('0x35')]);_0x562728[_0x437a('0x3a')]=_['intersection'](_0x431741[_0x437a('0x39')],qs['fields'](_0x1bbff8[_0x437a('0x35')][_0x437a('0x3b')]));_0x562728['attributes']=_0x562728[_0x437a('0x3a')][_0x437a('0x3c')]?_0x562728[_0x437a('0x3a')]:_0x431741[_0x437a('0x39')];if(!_0x1bbff8[_0x437a('0x35')]['hasOwnProperty'](_0x437a('0x3e'))){_0x562728[_0x437a('0x3f')]=qs['limit'](_0x1bbff8[_0x437a('0x35')][_0x437a('0x3f')]);_0x562728[_0x437a('0x20')]=qs['offset'](_0x1bbff8[_0x437a('0x35')][_0x437a('0x20')]);}_0x562728[_0x437a('0x40')]=qs[_0x437a('0x41')](_0x1bbff8[_0x437a('0x35')]['sort']);_0x562728[_0x437a('0x43')]=qs[_0x437a('0x37')](_[_0x437a('0x5b')](_0x1bbff8[_0x437a('0x35')],_0x431741[_0x437a('0x37')]));_0x562728[_0x437a('0x43')][_0x437a('0x5c')]=_0x354209['id'];if(_0x1bbff8['query']['filter']){_0x562728[_0x437a('0x43')]=_[_0x437a('0x44')](_0x562728[_0x437a('0x43')],{'$or':_[_0x437a('0x34')](_0x562728[_0x437a('0x3a')],function(_0x29733c){var _0x4a4dc5={};_0x4a4dc5[_0x29733c]={'$like':'%'+_0x1bbff8[_0x437a('0x35')][_0x437a('0x42')]+'%'};return _0x4a4dc5;})});}_0x562728=_[_0x437a('0x44')]({},_0x562728,_0x1bbff8[_0x437a('0x5d')]);return db[_0x437a('0x5e')]['findAll'](_0x562728);}})[_0x437a('0x29')](function(_0x3d66a7){if(_0x3d66a7){return db[_0x437a('0x5f')][_0x437a('0x60')]({'where':{'id':_[_0x437a('0x34')](_0x3d66a7,_0x437a('0x61')),'role':_0x437a('0x62')},'attributes':['id',_0x437a('0x30'),_0x437a('0x63'),'updatedAt',_0x437a('0x64')]});}})['then'](function(_0x562ee7){if(_0x562ee7){return{'count':_0x562ee7[_0x437a('0x22')],'rows':_[_0x437a('0x34')](_0x562ee7[_0x437a('0x48')],function(_0x7da21a){return{'membername':_0x7da21a['name'],'UserId':_0x7da21a['id'],'queue_name':_0x55bddc[_0x437a('0x30')],'MailQueueId':_0x55bddc['id'],'interface':util['format'](_0x437a('0x65'),_0x437a('0x66'),_0x7da21a[_0x437a('0x30')]),'penalty':0x0,'paused':_0x7da21a[_0x437a('0x63')],'createdAt':_0x7da21a[_0x437a('0x64')],'updatedAt':_0x7da21a[_0x437a('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x437a('0x29')](respondWithFilteredResult(_0x2eacd6,_0x562728))[_0x437a('0x49')](handleError(_0x2eacd6,null));};exports['getTeams']=function(_0x19fd48,_0x3ce49e,_0x17c233){var _0x4c25df={};var _0x202910={};var _0x255e69;var _0x341696;return db[_0x437a('0x31')][_0x437a('0x5a')]({'where':{'id':_0x19fd48[_0x437a('0x4b')]['id']}})[_0x437a('0x29')](handleEntityNotFound(_0x3ce49e,null))['then'](function(_0x251dd9){if(_0x251dd9){_0x255e69=_0x251dd9;_0x202910['model']=_[_0x437a('0x36')](db[_0x437a('0x68')][_0x437a('0x32')]);_0x202910[_0x437a('0x35')]=_[_0x437a('0x36')](_0x19fd48[_0x437a('0x35')]);_0x202910['filters']=_[_0x437a('0x38')](_0x202910[_0x437a('0x39')],_0x202910[_0x437a('0x35')]);_0x4c25df[_0x437a('0x3a')]=_[_0x437a('0x38')](_0x202910['model'],qs['fields'](_0x19fd48[_0x437a('0x35')][_0x437a('0x3b')]));_0x4c25df[_0x437a('0x3a')]=_0x4c25df['attributes'][_0x437a('0x3c')]?_0x4c25df[_0x437a('0x3a')]:_0x202910[_0x437a('0x39')];_0x4c25df['order']=qs[_0x437a('0x41')](_0x19fd48[_0x437a('0x35')][_0x437a('0x41')]);_0x4c25df[_0x437a('0x43')]=qs[_0x437a('0x37')](_[_0x437a('0x5b')](_0x19fd48[_0x437a('0x35')],_0x202910[_0x437a('0x37')]));if(_0x19fd48[_0x437a('0x35')][_0x437a('0x42')]){_0x4c25df[_0x437a('0x43')]=_[_0x437a('0x44')](_0x4c25df[_0x437a('0x43')],{'$or':_[_0x437a('0x34')](_0x4c25df[_0x437a('0x3a')],function(_0xbf8dee){var _0x4bd87c={};_0x4bd87c[_0xbf8dee]={'$like':'%'+_0x19fd48[_0x437a('0x35')][_0x437a('0x42')]+'%'};return _0x4bd87c;})});}_0x4c25df=_[_0x437a('0x44')]({},_0x4c25df,_0x19fd48[_0x437a('0x5d')]);return _0x255e69[_0x437a('0x69')](_0x4c25df);}})['then'](function(_0x5d8d67){if(_0x5d8d67){_0x341696=_0x5d8d67['length'];if(!_0x19fd48['query']['hasOwnProperty'](_0x437a('0x3e'))){_0x4c25df[_0x437a('0x3f')]=qs[_0x437a('0x3f')](_0x19fd48[_0x437a('0x35')][_0x437a('0x3f')]);_0x4c25df[_0x437a('0x20')]=qs[_0x437a('0x20')](_0x19fd48[_0x437a('0x35')][_0x437a('0x20')]);}return _0x255e69[_0x437a('0x69')](_0x4c25df);}})[_0x437a('0x29')](function(_0x89281a){if(_0x89281a){return _0x89281a?{'count':_0x341696,'rows':_0x89281a}:null;}})[_0x437a('0x29')](respondWithResult(_0x3ce49e,null))[_0x437a('0x49')](handleError(_0x3ce49e,null));};exports['addTeams']=function(_0xcb23d9,_0xc4bc3c,_0x14c8b4){var _0x236285=_0xcb23d9[_0x437a('0x50')][_0x437a('0x6a')];return db['Team'][_0x437a('0x47')]({'where':{'id':_0x236285},'attributes':['id'],'include':[{'model':db[_0x437a('0x5f')],'as':'Agents','attributes':['id',_0x437a('0x30'),_0x437a('0x6b'),_0x437a('0x6c'),_0x437a('0x6d')],'raw':!![]}]})[_0x437a('0x29')](function(_0x24dec4){if(_0x24dec4){var _0x5ded72=_[_0x437a('0x6e')](_0x24dec4,function(_0x59a53b){var _0x13f5d8=_0x59a53b['get']({'plain':!![]});return _0x13f5d8['Agents'];});return db[_0x437a('0x31')][_0x437a('0x4e')]({'where':{'id':_0xcb23d9[_0x437a('0x4b')]['id']}})[_0x437a('0x29')](function(_0x44c5dd){return db[_0x437a('0x6f')][_0x437a('0x70')](function(_0x572edc){return _0x44c5dd[_0x437a('0x71')](_0x236285,{'transaction':_0x572edc})['then'](function(){return BPromise[_0x437a('0x72')](_0x5ded72,function(_0x3a2ba3){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x3a2ba3['id'],'MailQueueId':_0xcb23d9[_0x437a('0x4b')]['id']},'transaction':_0x572edc});});})[_0x437a('0x29')](function(){_0x5ded72[_0x437a('0x73')](function(_0x294c29){socket['emit'](_0x437a('0x74'),{'UserId':_0x294c29['id'],'MailQueueId':_0x44c5dd['id']});});});});});}})[_0x437a('0x29')](respondWithStatusCode(_0xc4bc3c,null))['catch'](handleError(_0xc4bc3c,null));};exports[_0x437a('0x75')]=function(_0x2ee41d,_0x1a6c02,_0x5b6b2b){return db[_0x437a('0x68')][_0x437a('0x47')]({'where':{'id':_0x2ee41d[_0x437a('0x35')][_0x437a('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x437a('0x5f')],'as':_0x437a('0x76'),'attributes':['id'],'raw':!![]}]})[_0x437a('0x29')](handleEntityNotFound(_0x1a6c02,null))[_0x437a('0x29')](function(_0x4475cf){var _0x5e31fa=_[_0x437a('0x34')](_0x4475cf,'id');var _0x280307=[];var _0x1d1dd4=[];var _0x108566=squel[_0x437a('0x77')]();_0x108566[_0x437a('0x78')]('tq.TeamId')[_0x437a('0x79')]('team_has_mail_queues','tq')[_0x437a('0x7a')](_0x437a('0x7b'),'ut',_0x437a('0x7c'))[_0x437a('0x43')](_0x437a('0x7d'),_0x2ee41d[_0x437a('0x4b')]['id']);for(var _0x48b1d4=0x0;_0x48b1d4<_0x4475cf['length'];_0x48b1d4+=0x1){let _0x1f4b39=_0x4475cf[_0x48b1d4];for(var _0x20e6f1=0x0;_0x20e6f1<_0x1f4b39[_0x437a('0x76')][_0x437a('0x3c')];_0x20e6f1+=0x1){let _0x181026=_0x1f4b39[_0x437a('0x76')][_0x20e6f1];var _0xb291fc=_0x108566['clone']();_0xb291fc['where'](_0x437a('0x7e'),_0x181026['id']);_0x1d1dd4[_0x437a('0x7f')](db[_0x437a('0x6f')][_0x437a('0x35')](_0xb291fc['toString'](),{'type':db[_0x437a('0x6f')][_0x437a('0x80')][_0x437a('0x81')]})['then'](function(_0x6683cb){if(_0x6683cb[_0x437a('0x3c')]===0x1){return _0x181026['id'];}else{var _0xa647cc=_[_0x437a('0x82')](_['map'](_0x6683cb,'TeamId'),function(_0x3e31fa){return _[_0x437a('0x83')](_0x5e31fa,_0x3e31fa);});if(_0xa647cc){return _0x181026['id'];}}}));}}return BPromise[_0x437a('0x84')](_0x1d1dd4)['then'](function(_0x57c985){_0x280307=_(_0x280307)['union'](_0x57c985)['compact']()[_0x437a('0x85')]();return db[_0x437a('0x31')][_0x437a('0x4e')]({'where':{'id':_0x2ee41d[_0x437a('0x4b')]['id']}})[_0x437a('0x29')](function(_0x3c4b70){return db[_0x437a('0x6f')]['transaction'](function(_0x5f17b6){return _0x3c4b70[_0x437a('0x75')](_0x2ee41d[_0x437a('0x35')][_0x437a('0x6a')],{'transaction':_0x5f17b6})[_0x437a('0x29')](function(){if(!_[_0x437a('0x86')](_0x280307)){return _0x3c4b70[_0x437a('0x87')](_0x280307,{'transaction':_0x5f17b6});}})['then'](function(){_0x280307[_0x437a('0x73')](function(_0x987b67){socket[_0x437a('0x88')](_0x437a('0x89'),{'UserId':_0x987b67,'MailQueueId':_0x3c4b70['id']});});});});});});})[_0x437a('0x29')](respondWithStatusCode(_0x1a6c02,null))[_0x437a('0x49')](handleError(_0x1a6c02,null));};exports[_0x437a('0x8a')]=function(_0x15b5c8,_0x357ef6,_0x5990b2){return db[_0x437a('0x31')]['find']({'where':{'id':_0x15b5c8['params']['id']}})[_0x437a('0x29')](handleEntityNotFound(_0x357ef6,null))[_0x437a('0x29')](function(_0x4cfba6){if(_0x4cfba6){return _0x4cfba6[_0x437a('0x8a')](_0x15b5c8[_0x437a('0x50')][_0x437a('0x6a')],_['omit'](_0x15b5c8['body'],[_0x437a('0x6a'),'id'])||{})[_0x437a('0x8b')](function(_0x132357){for(var _0x57c9d1=0x0;_0x57c9d1<_0x15b5c8[_0x437a('0x50')]['ids']['length'];_0x57c9d1+=0x1){socket[_0x437a('0x88')](_0x437a('0x74'),{'UserId':Number(_0x15b5c8[_0x437a('0x50')][_0x437a('0x6a')][_0x57c9d1]),'MailQueueId':Number(_0x15b5c8[_0x437a('0x4b')]['id'])});}return _0x132357;});}})[_0x437a('0x29')](respondWithResult(_0x357ef6,null))[_0x437a('0x49')](handleError(_0x357ef6,null));};exports[_0x437a('0x87')]=function(_0x558e75,_0x42fba3,_0x3a85cb){return db[_0x437a('0x31')][_0x437a('0x4e')]({'where':{'id':_0x558e75[_0x437a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x42fba3,null))[_0x437a('0x29')](function(_0xdb8645){if(_0xdb8645){return _0xdb8645[_0x437a('0x87')](_0x558e75[_0x437a('0x35')][_0x437a('0x6a')])[_0x437a('0x29')](function(){if(_[_0x437a('0x8c')](_0x558e75['query'][_0x437a('0x6a')])){for(var _0x33408a=0x0;_0x33408a<_0x558e75[_0x437a('0x35')][_0x437a('0x6a')][_0x437a('0x3c')];_0x33408a+=0x1){socket[_0x437a('0x88')]('userMailQueue:remove',{'UserId':Number(_0x558e75[_0x437a('0x35')]['ids'][_0x33408a]),'MailQueueId':Number(_0x558e75[_0x437a('0x4b')]['id'])});}}else{socket[_0x437a('0x88')](_0x437a('0x89'),{'UserId':Number(_0x558e75[_0x437a('0x35')][_0x437a('0x6a')]),'MailQueueId':Number(_0x558e75[_0x437a('0x4b')]['id'])});}});}})[_0x437a('0x29')](respondWithStatusCode(_0x42fba3,null))[_0x437a('0x49')](handleError(_0x42fba3,null));};exports[_0x437a('0x8d')]=function(_0x8257dc,_0x212209,_0x50a2fd){var _0xfb0f34={};var _0x91212={};var _0x5f1147;var _0x3690c8;return db['MailQueue'][_0x437a('0x5a')]({'where':{'id':_0x8257dc[_0x437a('0x4b')]['id']}})[_0x437a('0x29')](handleEntityNotFound(_0x212209,null))[_0x437a('0x29')](function(_0x304649){if(_0x304649){_0x5f1147=_0x304649;_0x91212[_0x437a('0x39')]=_[_0x437a('0x36')](db[_0x437a('0x5f')]['rawAttributes']);_0x91212[_0x437a('0x35')]=_['keys'](_0x8257dc[_0x437a('0x35')]);_0x91212[_0x437a('0x37')]=_['intersection'](_0x91212[_0x437a('0x39')],_0x91212[_0x437a('0x35')]);_0xfb0f34[_0x437a('0x3a')]=_[_0x437a('0x38')](_0x91212[_0x437a('0x39')],qs['fields'](_0x8257dc['query'][_0x437a('0x3b')]));_0xfb0f34[_0x437a('0x3a')]=_0xfb0f34[_0x437a('0x3a')]['length']?_0xfb0f34[_0x437a('0x3a')]:_0x91212[_0x437a('0x39')];_0xfb0f34[_0x437a('0x40')]=qs[_0x437a('0x41')](_0x8257dc['query']['sort']);_0xfb0f34['where']=qs['filters'](_['pick'](_0x8257dc[_0x437a('0x35')],_0x91212['filters']));if(_0x8257dc[_0x437a('0x35')][_0x437a('0x42')]){_0xfb0f34[_0x437a('0x43')]=_['merge'](_0xfb0f34[_0x437a('0x43')],{'$or':_[_0x437a('0x34')](_0xfb0f34['attributes'],function(_0x38c08d){var _0x33e300={};_0x33e300[_0x38c08d]={'$like':'%'+_0x8257dc[_0x437a('0x35')][_0x437a('0x42')]+'%'};return _0x33e300;})});}_0xfb0f34=_[_0x437a('0x44')]({},_0xfb0f34,_0x8257dc['options']);return _0x5f1147[_0x437a('0x8d')](_0xfb0f34);}})['then'](function(_0x1e62eb){if(_0x1e62eb){_0x3690c8=_0x1e62eb['length'];if(!_0x8257dc[_0x437a('0x35')][_0x437a('0x3d')](_0x437a('0x3e'))){_0xfb0f34['limit']=qs[_0x437a('0x3f')](_0x8257dc[_0x437a('0x35')][_0x437a('0x3f')]);_0xfb0f34['offset']=qs[_0x437a('0x20')](_0x8257dc[_0x437a('0x35')]['offset']);}return _0x5f1147[_0x437a('0x8d')](_0xfb0f34);}})[_0x437a('0x29')](function(_0x190e93){if(_0x190e93){return _0x190e93?{'count':_0x3690c8,'rows':_0x190e93}:null;}})['then'](respondWithResult(_0x212209,null))[_0x437a('0x49')](handleError(_0x212209,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 55a23b5..42d32c9 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 _0x9951=['../../mysqldb','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1fada1,_0x165008){var _0x560086=function(_0x1a1188){while(--_0x1a1188){_0x1fada1['push'](_0x1fada1['shift']());}};_0x560086(++_0x165008);}(_0x9951,0xa9));var _0x1995=function(_0x2ba88c,_0x2d1b30){_0x2ba88c=_0x2ba88c-0x0;var _0x34798e=_0x9951[_0x2ba88c];return _0x34798e;};'use strict';var EventEmitter=require(_0x1995('0x0'));var MailQueue=require(_0x1995('0x1'))['db'][_0x1995('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1995('0x3')](0x0);var events={'afterCreate':_0x1995('0x4'),'afterUpdate':'update','afterDestroy':_0x1995('0x5')};function emitEvent(_0x32fde8){return function(_0x150f4c,_0x1c4b9f,_0x34ac8d){MailQueueEvents[_0x1995('0x6')](_0x32fde8+':'+_0x150f4c['id'],_0x150f4c);MailQueueEvents['emit'](_0x32fde8,_0x150f4c);_0x34ac8d(null);};}for(var e in events){if(events[_0x1995('0x7')](e)){var event=events[e];MailQueue[_0x1995('0x8')](e,emitEvent(event));}}module[_0x1995('0x9')]=MailQueueEvents; \ No newline at end of file +var _0xeb54=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x326189,_0x23e569){var _0x487e40=function(_0x37dcab){while(--_0x37dcab){_0x326189['push'](_0x326189['shift']());}};_0x487e40(++_0x23e569);}(_0xeb54,0x1bf));var _0x4eb5=function(_0x39ea06,_0x3a7310){_0x39ea06=_0x39ea06-0x0;var _0x5dff85=_0xeb54[_0x39ea06];return _0x5dff85;};'use strict';var EventEmitter=require(_0x4eb5('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4eb5('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4eb5('0x2'),'afterDestroy':_0x4eb5('0x3')};function emitEvent(_0x1d8395){return function(_0x1931cc,_0x2302af,_0x254735){MailQueueEvents[_0x4eb5('0x4')](_0x1d8395+':'+_0x1931cc['id'],_0x1931cc);MailQueueEvents['emit'](_0x1d8395,_0x1931cc);_0x254735(null);};}for(var e in events){if(events[_0x4eb5('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x4eb5('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 85bc04b..e0bd4fe 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 _0x4997=['define','MailQueue','mail_queues','lodash','util','api','moment','bluebird','path','rimraf','./mailQueue.attributes','exports'];(function(_0x553458,_0x583fd3){var _0x3835d6=function(_0x2c5c86){while(--_0x2c5c86){_0x553458['push'](_0x553458['shift']());}};_0x3835d6(++_0x583fd3);}(_0x4997,0xff));var _0x7499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4997[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7499('0x0'));var util=require(_0x7499('0x1'));var logger=require('../../config/logger')(_0x7499('0x2'));var moment=require(_0x7499('0x3'));var BPromise=require(_0x7499('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7499('0x5'));var rimraf=require(_0x7499('0x6'));var config=require('../../config/environment');var attributes=require(_0x7499('0x7'));module[_0x7499('0x8')]=function(_0x326560,_0x4a9df6){return _0x326560[_0x7499('0x9')](_0x7499('0xa'),attributes,{'tableName':_0x7499('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f11=['path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x230951,_0x4dad52){var _0xeb26b1=function(_0x25776c){while(--_0x25776c){_0x230951['push'](_0x230951['shift']());}};_0xeb26b1(++_0x4dad52);}(_0x2f11,0x173));var _0x12f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f11[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x12f1('0x0'));var util=require(_0x12f1('0x1'));var logger=require(_0x12f1('0x2'))('api');var moment=require(_0x12f1('0x3'));var BPromise=require(_0x12f1('0x4'));var rp=require(_0x12f1('0x5'));var fs=require('fs');var path=require(_0x12f1('0x6'));var rimraf=require(_0x12f1('0x7'));var config=require(_0x12f1('0x8'));var attributes=require(_0x12f1('0x9'));module[_0x12f1('0xa')]=function(_0x4bf1ae,_0x48dc90){return _0x4bf1ae['define'](_0x12f1('0xb'),attributes,{'tableName':_0x12f1('0xc'),'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 ab9668e..c6f577b 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 _0xa2ab=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash'];(function(_0x5685e8,_0x20724f){var _0x582977=function(_0x49c64f){while(--_0x49c64f){_0x5685e8['push'](_0x5685e8['shift']());}};_0x582977(++_0x20724f);}(_0xa2ab,0xa7));var _0xba2a=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0xa2ab[_0x5ac1e5];return _0x1bccc6;};'use strict';var _=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var moment=require(_0xba2a('0x2'));var BPromise=require('bluebird');var rs=require(_0xba2a('0x3'));var fs=require('fs');var Redis=require(_0xba2a('0x4'));var db=require(_0xba2a('0x5'))['db'];var utils=require(_0xba2a('0x6'));var logger=require(_0xba2a('0x7'))(_0xba2a('0x8'));var config=require(_0xba2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xba2a('0xa')][_0xba2a('0xb')]({'port':0x232a});config[_0xba2a('0xc')]=_['defaults'](config[_0xba2a('0xc')],{'host':_0xba2a('0xd'),'port':0x18eb});var socket=require(_0xba2a('0xe'))(new Redis(config[_0xba2a('0xc')]));require('./mailQueue.socket')[_0xba2a('0xf')](socket);function respondWithRpcPromise(_0x43fa56,_0x2f4d3d,_0x3607e2){return new BPromise(function(_0xde4888,_0x549c6e){return client[_0xba2a('0x10')](_0x43fa56,_0x3607e2)[_0xba2a('0x11')](function(_0x1ab975){logger[_0xba2a('0x12')]('MailQueue,\x20%s,\x20%s',_0x2f4d3d,_0xba2a('0x13'));logger[_0xba2a('0x14')](_0xba2a('0x15'),_0x2f4d3d,_0xba2a('0x13'),JSON[_0xba2a('0x16')](_0x1ab975));if(_0x1ab975['error']){if(_0x1ab975[_0xba2a('0x17')][_0xba2a('0x18')]===0x1f4){logger[_0xba2a('0x17')](_0xba2a('0x19'),_0x2f4d3d,_0x1ab975['error'][_0xba2a('0x1a')]);return _0x549c6e(_0x1ab975[_0xba2a('0x17')][_0xba2a('0x1a')]);}logger[_0xba2a('0x17')]('MailQueue,\x20%s,\x20%s',_0x2f4d3d,_0x1ab975[_0xba2a('0x17')][_0xba2a('0x1a')]);return _0xde4888(_0x1ab975['error'][_0xba2a('0x1a')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x2f4d3d,_0xba2a('0x13'));_0xde4888(_0x1ab975[_0xba2a('0x1b')][_0xba2a('0x1a')]);}})[_0xba2a('0x1c')](function(_0x1ef800){logger['error'](_0xba2a('0x19'),_0x2f4d3d,_0x1ef800);_0x549c6e(_0x1ef800);});});}exports[_0xba2a('0x1d')]=function(_0x4d572d){var _0x200e32=this;return new Promise(function(_0x5c9fb4,_0x3b3924){return db[_0xba2a('0x1e')][_0xba2a('0x1f')]({'raw':_0x4d572d[_0xba2a('0x20')]?_0x4d572d[_0xba2a('0x20')][_0xba2a('0x21')]===undefined?!![]:![]:!![],'where':_0x4d572d['options']?_0x4d572d[_0xba2a('0x20')][_0xba2a('0x22')]||null:null,'attributes':_0x4d572d[_0xba2a('0x20')]?_0x4d572d[_0xba2a('0x20')][_0xba2a('0x23')]||null:null,'limit':_0x4d572d['options']?_0x4d572d[_0xba2a('0x20')][_0xba2a('0x24')]||null:null,'include':_0x4d572d[_0xba2a('0x20')]?_0x4d572d[_0xba2a('0x20')][_0xba2a('0x25')]?_[_0xba2a('0x26')](_0x4d572d[_0xba2a('0x20')][_0xba2a('0x25')],function(_0x4bba7a){return{'model':db[_0x4bba7a[_0xba2a('0x27')]],'as':_0x4bba7a['as'],'attributes':_0x4bba7a[_0xba2a('0x23')],'include':_0x4bba7a[_0xba2a('0x25')]?_[_0xba2a('0x26')](_0x4bba7a['include'],function(_0x2e627b){return{'model':db[_0x2e627b[_0xba2a('0x27')]],'as':_0x2e627b['as'],'attributes':_0x2e627b[_0xba2a('0x23')],'include':_0x2e627b['include']?_['map'](_0x2e627b[_0xba2a('0x25')],function(_0x2f292b){return{'model':db[_0x2f292b[_0xba2a('0x27')]],'as':_0x2f292b['as'],'attributes':_0x2f292b[_0xba2a('0x23')]};}):[]};}):[]};}):[]:[]})[_0xba2a('0x11')](function(_0x403372){logger[_0xba2a('0x12')](_0xba2a('0x1d'),_0x4d572d);logger[_0xba2a('0x14')](_0xba2a('0x1d'),_0x4d572d,JSON['stringify'](_0x403372));_0x5c9fb4(_0x403372);})[_0xba2a('0x1c')](function(_0x77ac7c){logger[_0xba2a('0x17')](_0xba2a('0x1d'),_0x77ac7c['message'],_0x4d572d);_0x3b3924(_0x200e32[_0xba2a('0x17')](0x1f4,_0x77ac7c[_0xba2a('0x1a')]));});});};exports[_0xba2a('0x28')]=function(_0x49597b){var _0x30d3b5=this;return new Promise(function(_0x274174,_0x12979d){return db[_0xba2a('0x1e')][_0xba2a('0x29')]({'raw':_0x49597b[_0xba2a('0x20')]?_0x49597b[_0xba2a('0x20')][_0xba2a('0x21')]===undefined?!![]:![]:!![],'where':_0x49597b['options']?_0x49597b[_0xba2a('0x20')][_0xba2a('0x22')]||null:null,'attributes':_0x49597b[_0xba2a('0x20')]?_0x49597b[_0xba2a('0x20')][_0xba2a('0x23')]||null:null,'include':_0x49597b['options']?_0x49597b[_0xba2a('0x20')][_0xba2a('0x25')]?_[_0xba2a('0x26')](_0x49597b[_0xba2a('0x20')]['include'],function(_0xcf787){return{'model':db[_0xcf787[_0xba2a('0x27')]],'as':_0xcf787['as'],'attributes':_0xcf787[_0xba2a('0x23')],'include':_0xcf787['include']?_[_0xba2a('0x26')](_0xcf787[_0xba2a('0x25')],function(_0x1c59e3){return{'model':db[_0x1c59e3['model']],'as':_0x1c59e3['as'],'attributes':_0x1c59e3[_0xba2a('0x23')],'include':_0x1c59e3[_0xba2a('0x25')]?_[_0xba2a('0x26')](_0x1c59e3[_0xba2a('0x25')],function(_0x64c4a4){return{'model':db[_0x64c4a4[_0xba2a('0x27')]],'as':_0x64c4a4['as'],'attributes':_0x64c4a4[_0xba2a('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37e9fe){logger['info'](_0xba2a('0x28'),_0x49597b);logger[_0xba2a('0x14')]('ShowMailQueue',_0x49597b,JSON['stringify'](_0x37e9fe));_0x274174(_0x37e9fe);})['catch'](function(_0x55a587){logger[_0xba2a('0x17')]('ShowMailQueue',_0x55a587[_0xba2a('0x1a')],_0x49597b);_0x12979d(_0x30d3b5[_0xba2a('0x17')](0x1f4,_0x55a587['message']));});});}; \ No newline at end of file +var _0xe6b0=['localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','catch','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults'];(function(_0x247045,_0x41991c){var _0x2fbaa6=function(_0x2c872c){while(--_0x2c872c){_0x247045['push'](_0x247045['shift']());}};_0x2fbaa6(++_0x41991c);}(_0xe6b0,0x15a));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e6b('0x0'));var util=require(_0x0e6b('0x1'));var moment=require(_0x0e6b('0x2'));var BPromise=require(_0x0e6b('0x3'));var rs=require(_0x0e6b('0x4'));var fs=require('fs');var Redis=require(_0x0e6b('0x5'));var db=require(_0x0e6b('0x6'))['db'];var utils=require(_0x0e6b('0x7'));var logger=require(_0x0e6b('0x8'))(_0x0e6b('0x9'));var config=require('../../config/environment');var jayson=require(_0x0e6b('0xa'));var client=jayson['client'][_0x0e6b('0xb')]({'port':0x232a});config[_0x0e6b('0xc')]=_[_0x0e6b('0xd')](config[_0x0e6b('0xc')],{'host':_0x0e6b('0xe'),'port':0x18eb});var socket=require(_0x0e6b('0xf'))(new Redis(config[_0x0e6b('0xc')]));require('./mailQueue.socket')[_0x0e6b('0x10')](socket);function respondWithRpcPromise(_0x26c270,_0x556e87,_0x362f49){return new BPromise(function(_0x4fe25d,_0x29997f){return client[_0x0e6b('0x11')](_0x26c270,_0x362f49)[_0x0e6b('0x12')](function(_0x1e1a8f){logger[_0x0e6b('0x13')](_0x0e6b('0x14'),_0x556e87,'request\x20sent');logger[_0x0e6b('0x15')](_0x0e6b('0x16'),_0x556e87,'request\x20sent',JSON[_0x0e6b('0x17')](_0x1e1a8f));if(_0x1e1a8f[_0x0e6b('0x18')]){if(_0x1e1a8f['error']['code']===0x1f4){logger[_0x0e6b('0x18')]('MailQueue,\x20%s,\x20%s',_0x556e87,_0x1e1a8f[_0x0e6b('0x18')][_0x0e6b('0x19')]);return _0x29997f(_0x1e1a8f[_0x0e6b('0x18')][_0x0e6b('0x19')]);}logger['error'](_0x0e6b('0x14'),_0x556e87,_0x1e1a8f[_0x0e6b('0x18')]['message']);return _0x4fe25d(_0x1e1a8f[_0x0e6b('0x18')][_0x0e6b('0x19')]);}else{logger[_0x0e6b('0x13')]('MailQueue,\x20%s,\x20%s',_0x556e87,_0x0e6b('0x1a'));_0x4fe25d(_0x1e1a8f[_0x0e6b('0x1b')][_0x0e6b('0x19')]);}})['catch'](function(_0xa55755){logger[_0x0e6b('0x18')](_0x0e6b('0x14'),_0x556e87,_0xa55755);_0x29997f(_0xa55755);});});}exports[_0x0e6b('0x1c')]=function(_0x1060f6){var _0x552134=this;return new Promise(function(_0xf5e029,_0x21dbe4){return db[_0x0e6b('0x1d')][_0x0e6b('0x1e')]({'raw':_0x1060f6[_0x0e6b('0x1f')]?_0x1060f6[_0x0e6b('0x1f')][_0x0e6b('0x20')]===undefined?!![]:![]:!![],'where':_0x1060f6['options']?_0x1060f6[_0x0e6b('0x1f')]['where']||null:null,'attributes':_0x1060f6['options']?_0x1060f6[_0x0e6b('0x1f')][_0x0e6b('0x21')]||null:null,'limit':_0x1060f6[_0x0e6b('0x1f')]?_0x1060f6['options'][_0x0e6b('0x22')]||null:null,'include':_0x1060f6[_0x0e6b('0x1f')]?_0x1060f6[_0x0e6b('0x1f')][_0x0e6b('0x23')]?_[_0x0e6b('0x24')](_0x1060f6['options'][_0x0e6b('0x23')],function(_0x382fc3){return{'model':db[_0x382fc3[_0x0e6b('0x25')]],'as':_0x382fc3['as'],'attributes':_0x382fc3[_0x0e6b('0x21')],'include':_0x382fc3['include']?_[_0x0e6b('0x24')](_0x382fc3[_0x0e6b('0x23')],function(_0x403b06){return{'model':db[_0x403b06['model']],'as':_0x403b06['as'],'attributes':_0x403b06[_0x0e6b('0x21')],'include':_0x403b06[_0x0e6b('0x23')]?_[_0x0e6b('0x24')](_0x403b06[_0x0e6b('0x23')],function(_0x3d8c26){return{'model':db[_0x3d8c26['model']],'as':_0x3d8c26['as'],'attributes':_0x3d8c26[_0x0e6b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9f268f){logger[_0x0e6b('0x13')](_0x0e6b('0x1c'),_0x1060f6);logger[_0x0e6b('0x15')](_0x0e6b('0x1c'),_0x1060f6,JSON[_0x0e6b('0x17')](_0x9f268f));_0xf5e029(_0x9f268f);})[_0x0e6b('0x26')](function(_0x1a7be6){logger[_0x0e6b('0x18')]('GetMailQueue',_0x1a7be6['message'],_0x1060f6);_0x21dbe4(_0x552134['error'](0x1f4,_0x1a7be6['message']));});});};exports[_0x0e6b('0x27')]=function(_0x1d9d35){var _0x26a0e6=this;return new Promise(function(_0x259408,_0x4b6b27){return db['MailQueue']['find']({'raw':_0x1d9d35['options']?_0x1d9d35['options'][_0x0e6b('0x20')]===undefined?!![]:![]:!![],'where':_0x1d9d35[_0x0e6b('0x1f')]?_0x1d9d35[_0x0e6b('0x1f')]['where']||null:null,'attributes':_0x1d9d35[_0x0e6b('0x1f')]?_0x1d9d35[_0x0e6b('0x1f')][_0x0e6b('0x21')]||null:null,'include':_0x1d9d35[_0x0e6b('0x1f')]?_0x1d9d35[_0x0e6b('0x1f')][_0x0e6b('0x23')]?_[_0x0e6b('0x24')](_0x1d9d35[_0x0e6b('0x1f')][_0x0e6b('0x23')],function(_0x12776a){return{'model':db[_0x12776a[_0x0e6b('0x25')]],'as':_0x12776a['as'],'attributes':_0x12776a[_0x0e6b('0x21')],'include':_0x12776a[_0x0e6b('0x23')]?_['map'](_0x12776a[_0x0e6b('0x23')],function(_0x4ddca4){return{'model':db[_0x4ddca4['model']],'as':_0x4ddca4['as'],'attributes':_0x4ddca4[_0x0e6b('0x21')],'include':_0x4ddca4[_0x0e6b('0x23')]?_[_0x0e6b('0x24')](_0x4ddca4['include'],function(_0x36cf19){return{'model':db[_0x36cf19[_0x0e6b('0x25')]],'as':_0x36cf19['as'],'attributes':_0x36cf19[_0x0e6b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0e6b('0x12')](function(_0x5f2a1e){logger[_0x0e6b('0x13')](_0x0e6b('0x27'),_0x1d9d35);logger[_0x0e6b('0x15')](_0x0e6b('0x27'),_0x1d9d35,JSON[_0x0e6b('0x17')](_0x5f2a1e));_0x259408(_0x5f2a1e);})['catch'](function(_0x52e831){logger[_0x0e6b('0x18')]('ShowMailQueue',_0x52e831[_0x0e6b('0x19')],_0x1d9d35);_0x4b6b27(_0x26a0e6[_0x0e6b('0x18')](0x1f4,_0x52e831[_0x0e6b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 336ebc3..994749b 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 _0x770f=['remove','update','emit','removeListener','register','length','mailQueue:','save'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x770f,0x1e7));var _0xf770=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x770f[_0x333767];return _0x51661b;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xf770('0x0'),_0xf770('0x1'),_0xf770('0x2')];function createListener(_0x4fa4bb,_0x113cb3){return function(_0x2b1d29){_0x113cb3[_0xf770('0x3')](_0x4fa4bb,_0x2b1d29);};}function removeListener(_0x4c29c4,_0xf8dd64){return function(){MailQueueEvents[_0xf770('0x4')](_0x4c29c4,_0xf8dd64);};}exports[_0xf770('0x5')]=function(_0x37176a){for(var _0x40027f=0x0,_0x5a0a9b=events[_0xf770('0x6')];_0x40027f<_0x5a0a9b;_0x40027f++){var _0x3df014=events[_0x40027f];var _0x43578=createListener(_0xf770('0x7')+_0x3df014,_0x37176a);MailQueueEvents['on'](_0x3df014,_0x43578);}}; \ No newline at end of file +var _0xeaef=['save','remove','emit','register','length','./mailQueue.events'];(function(_0x568062,_0xca5174){var _0x1204e2=function(_0x444420){while(--_0x444420){_0x568062['push'](_0x568062['shift']());}};_0x1204e2(++_0xca5174);}(_0xeaef,0x131));var _0xfeae=function(_0x3468f0,_0x570fa7){_0x3468f0=_0x3468f0-0x0;var _0x1c500b=_0xeaef[_0x3468f0];return _0x1c500b;};'use strict';var MailQueueEvents=require(_0xfeae('0x0'));var events=[_0xfeae('0x1'),_0xfeae('0x2'),'update'];function createListener(_0x10613a,_0x25715d){return function(_0xb3439d){_0x25715d[_0xfeae('0x3')](_0x10613a,_0xb3439d);};}function removeListener(_0x1b5a15,_0x4f6afa){return function(){MailQueueEvents['removeListener'](_0x1b5a15,_0x4f6afa);};}exports[_0xfeae('0x4')]=function(_0x36b47c){for(var _0x450c05=0x0,_0x3aafa3=events[_0xfeae('0x5')];_0x450c05<_0x3aafa3;_0x450c05++){var _0x55f3df=events[_0x450c05];var _0x297a5c=createListener('mailQueue:'+_0x55f3df,_0x36b47c);MailQueueEvents['on'](_0x55f3df,_0x297a5c);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ea538fb..70064b9 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 _0xc58b=['create','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0xd95342,_0xb75bf6){var _0x54d694=function(_0x1190c1){while(--_0x1190c1){_0xd95342['push'](_0xd95342['shift']());}};_0x54d694(++_0xb75bf6);}(_0xc58b,0x17f));var _0xbc58=function(_0x2b38f2,_0xac1540){_0x2b38f2=_0x2b38f2-0x0;var _0x3b5810=_0xc58b[_0x2b38f2];return _0x3b5810;};'use strict';var multer=require('multer');var util=require(_0xbc58('0x0'));var path=require(_0xbc58('0x1'));var timeout=require(_0xbc58('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbc58('0x3'));var auth=require(_0xbc58('0x4'));var interaction=require(_0xbc58('0x5'));var config=require('../../config/environment');var controller=require(_0xbc58('0x6'));router[_0xbc58('0x7')]('/',auth[_0xbc58('0x8')](),controller[_0xbc58('0x9')]);router[_0xbc58('0x7')](_0xbc58('0xa'),auth[_0xbc58('0x8')](),controller['describe']);router['get'](_0xbc58('0xb'),auth[_0xbc58('0x8')](),controller[_0xbc58('0xc')]);router['post']('/',auth[_0xbc58('0x8')](),controller[_0xbc58('0xd')]);router['put'](_0xbc58('0xb'),auth['isAuthenticated'](),controller[_0xbc58('0xe')]);router[_0xbc58('0xf')](_0xbc58('0xb'),auth[_0xbc58('0x8')](),controller[_0xbc58('0x10')]);module[_0xbc58('0x11')]=router; \ No newline at end of file +var _0xdc74=['post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','index','isAuthenticated','describe','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc74,0x1e5));var _0x4dc7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdc74[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x4dc7('0x0'));var util=require('util');var path=require(_0x4dc7('0x1'));var timeout=require(_0x4dc7('0x2'));var express=require(_0x4dc7('0x3'));var router=express[_0x4dc7('0x4')]();var fs_extra=require(_0x4dc7('0x5'));var auth=require(_0x4dc7('0x6'));var interaction=require(_0x4dc7('0x7'));var config=require('../../config/environment');var controller=require(_0x4dc7('0x8'));router[_0x4dc7('0x9')]('/',auth['isAuthenticated'](),controller[_0x4dc7('0xa')]);router[_0x4dc7('0x9')]('/describe',auth[_0x4dc7('0xb')](),controller[_0x4dc7('0xc')]);router[_0x4dc7('0x9')](_0x4dc7('0xd'),auth[_0x4dc7('0xb')](),controller[_0x4dc7('0xe')]);router[_0x4dc7('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4dc7('0x10')](_0x4dc7('0xd'),auth[_0x4dc7('0xb')](),controller[_0x4dc7('0x11')]);router['delete'](_0x4dc7('0xd'),auth[_0x4dc7('0xb')](),controller[_0x4dc7('0x12')]);module[_0x4dc7('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 29b3b85..dd7dbba 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 _0x88a5=['moment','exports','STRING','DATE'];(function(_0x198490,_0x4a7473){var _0x3899b0=function(_0x269be3){while(--_0x269be3){_0x198490['push'](_0x198490['shift']());}};_0x3899b0(++_0x4a7473);}(_0x88a5,0x88));var _0x588a=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x88a5[_0x9cd4c3];return _0x4c9025;};'use strict';var moment=require(_0x588a('0x0'));var Sequelize=require('sequelize');module[_0x588a('0x1')]={'uniqueid':{'type':Sequelize[_0x588a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x588a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x588a('0x3')]},'acceptAt':{'type':Sequelize[_0x588a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x588a('0x2')]}}; \ No newline at end of file +var _0x7b58=['STRING','moment','sequelize','DATE'];(function(_0x145f26,_0x5b5422){var _0x435fa5=function(_0x3a01c6){while(--_0x3a01c6){_0x145f26['push'](_0x145f26['shift']());}};_0x435fa5(++_0x5b5422);}(_0x7b58,0xe9));var _0x87b5=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x7b58[_0x42ebba];return _0x3fd2af;};'use strict';var moment=require(_0x87b5('0x0'));var Sequelize=require(_0x87b5('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x87b5('0x2')]},'acceptAt':{'type':Sequelize[_0x87b5('0x2')]},'exitAt':{'type':Sequelize[_0x87b5('0x2')]},'reason':{'type':Sequelize[_0x87b5('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 5af6b05..dc50392 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 _0x0598=['include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','MailQueueReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0598,0x92));var _0x8059=function(_0x5dd1b5,_0x2d15d9){_0x5dd1b5=_0x5dd1b5-0x0;var _0xdfd85d=_0x0598[_0x5dd1b5];return _0xdfd85d;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['MailQueueReport']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':!![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['MailQueueReport'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));};exports[_0x8059('0x42')]=function(_0x429cf0,_0x5d5f16){return db[_0x8059('0x24')]['describe']()[_0x8059('0x1d')](respondWithResult(_0x5d5f16,null))[_0x8059('0x39')](handleError(_0x5d5f16,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','MailQueueReport','rawAttributes','type'];(function(_0x5e76c6,_0xf16290){var _0x43fb22=function(_0x5cac4c){while(--_0x5cac4c){_0x5e76c6['push'](_0x5e76c6['shift']());}};_0x43fb22(++_0xf16290);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'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['MailQueueReport'][_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['MailQueueReport']['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['MailQueueReport'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 1833ff5..0e539be 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 _0x9926=['uniqueid','lodash','api','moment','bluebird','request-promise','rimraf','./mailQueueReport.attributes','define'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x9926,0x106));var _0x6992=function(_0x36b97f,_0x2ff796){_0x36b97f=_0x36b97f-0x0;var _0x385c1a=_0x9926[_0x36b97f];return _0x385c1a;};'use strict';var _=require(_0x6992('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6992('0x1'));var moment=require(_0x6992('0x2'));var BPromise=require(_0x6992('0x3'));var rp=require(_0x6992('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6992('0x5'));var config=require('../../config/environment');var attributes=require(_0x6992('0x6'));module['exports']=function(_0x57acae,_0x4a2e08){return _0x57acae[_0x6992('0x7')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x6992('0x8'),'fields':[_0x6992('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1dcd=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','api','moment','bluebird','request-promise','path'];(function(_0x3db60f,_0x4d1688){var _0xa27775=function(_0x59d31d){while(--_0x59d31d){_0x3db60f['push'](_0x3db60f['shift']());}};_0xa27775(++_0x4d1688);}(_0x1dcd,0x166));var _0xd1dc=function(_0x1364f9,_0x422296){_0x1364f9=_0x1364f9-0x0;var _0x1af7b9=_0x1dcd[_0x1364f9];return _0x1af7b9;};'use strict';var _=require(_0xd1dc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd1dc('0x1'));var moment=require(_0xd1dc('0x2'));var BPromise=require(_0xd1dc('0x3'));var rp=require(_0xd1dc('0x4'));var fs=require('fs');var path=require(_0xd1dc('0x5'));var rimraf=require(_0xd1dc('0x6'));var config=require(_0xd1dc('0x7'));var attributes=require(_0xd1dc('0x8'));module[_0xd1dc('0x9')]=function(_0x58659b,_0x37a38d){return _0x58659b[_0xd1dc('0xa')](_0xd1dc('0xb'),attributes,{'tableName':_0xd1dc('0xc'),'paranoid':![],'indexes':[{'name':_0xd1dc('0xd'),'fields':[_0xd1dc('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 678e698..3e8ce7b 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x18f6cf,_0x7989eb){var _0x43accc=function(_0x142ee6){while(--_0x142ee6){_0x18f6cf['push'](_0x18f6cf['shift']());}};_0x43accc(++_0x7989eb);}(_0x7a54,0x106));var _0x47a5=function(_0x110909,_0x3587c9){_0x110909=_0x110909-0x0;var _0x2cc94e=_0x7a54[_0x110909];return _0x2cc94e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x3b4691,_0x297c4d){var _0x5d4691=function(_0x1d2e6c){while(--_0x1d2e6c){_0x3b4691['push'](_0x3b4691['shift']());}};_0x5d4691(++_0x297c4d);}(_0xdb28,0x106));var _0x8db2=function(_0x460c73,_0x47721e){_0x460c73=_0x460c73-0x0;var _0x51fd86=_0xdb28[_0x460c73];return _0x51fd86;};'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')]('MailQueueReport,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 39fb380..77bb456 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3ac545,_0x32cfb2){var _0x88220b=function(_0x3ee405){while(--_0x3ee405){_0x3ac545['push'](_0x3ac545['shift']());}};_0x88220b(++_0x32cfb2);}(_0x70e0,0x17b));var _0x070e=function(_0x327468,_0x3c274e){_0x327468=_0x327468-0x0;var _0x41aef1=_0x70e0[_0x327468];return _0x41aef1;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x38257d,_0x4aa6da){var _0x1175b3=function(_0x5b900a){while(--_0x5b900a){_0x38257d['push'](_0x38257d['shift']());}};_0x1175b3(++_0x4aa6da);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index a2bd28c..c174406 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 _0x1543=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3f90e3,_0x148567){var _0x5b52dd=function(_0x3a82dc){while(--_0x3a82dc){_0x3f90e3['push'](_0x3f90e3['shift']());}};_0x5b52dd(++_0x148567);}(_0x1543,0x109));var _0x3154=function(_0x3760f8,_0x42fe41){_0x3760f8=_0x3760f8-0x0;var _0x34b376=_0x1543[_0x3760f8];return _0x34b376;};'use strict';var Sequelize=require(_0x3154('0x0'));module[_0x3154('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3154('0x2')]},'authentication':{'type':Sequelize[_0x3154('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3154('0x2')]},'password':{'type':Sequelize[_0x3154('0x2')]},'port':{'type':Sequelize[_0x3154('0x4')]},'tls':{'type':Sequelize[_0x3154('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3154('0x2')],'defaultValue':_0x3154('0x5')},'connTimeout':{'type':Sequelize[_0x3154('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x3154('0x2')]},'modernAuthentication':{'type':Sequelize[_0x3154('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2bf4=['STRING','BOOLEAN','INBOX','INTEGER','sequelize','exports'];(function(_0x4771ab,_0x56416d){var _0x46a8a6=function(_0x9bbdaf){while(--_0x9bbdaf){_0x4771ab['push'](_0x4771ab['shift']());}};_0x46a8a6(++_0x56416d);}(_0x2bf4,0x15a));var _0x42bf=function(_0xb20b3f,_0x4ac2ce){_0xb20b3f=_0xb20b3f-0x0;var _0x413304=_0x2bf4[_0xb20b3f];return _0x413304;};'use strict';var Sequelize=require(_0x42bf('0x0'));module[_0x42bf('0x1')]={'description':{'type':Sequelize[_0x42bf('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x42bf('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x42bf('0x2')]},'password':{'type':Sequelize[_0x42bf('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x42bf('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x42bf('0x2')],'defaultValue':_0x42bf('0x4')},'connTimeout':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x42bf('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 3945b7a..838ddf8 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 _0x289b=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','MailServerIn','mail_servers_in'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x289b,0xbb));var _0xb289=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x289b[_0x1911ed];return _0x11edaa;};'use strict';var _=require(_0xb289('0x0'));var util=require(_0xb289('0x1'));var logger=require('../../config/logger')(_0xb289('0x2'));var moment=require('moment');var BPromise=require(_0xb289('0x3'));var rp=require(_0xb289('0x4'));var fs=require('fs');var path=require(_0xb289('0x5'));var rimraf=require(_0xb289('0x6'));var config=require(_0xb289('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x4a650f,_0x44eefd){return _0x4a650f[_0xb289('0x8')](_0xb289('0x9'),attributes,{'tableName':_0xb289('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b94=['mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','MailServerIn'];(function(_0x5c3581,_0x4f3df2){var _0xb85a10=function(_0x3474f9){while(--_0x3474f9){_0x5c3581['push'](_0x5c3581['shift']());}};_0xb85a10(++_0x4f3df2);}(_0x9b94,0x175));var _0x49b9=function(_0x23ca06,_0x36292d){_0x23ca06=_0x23ca06-0x0;var _0xc385c4=_0x9b94[_0x23ca06];return _0xc385c4;};'use strict';var _=require(_0x49b9('0x0'));var util=require(_0x49b9('0x1'));var logger=require(_0x49b9('0x2'))(_0x49b9('0x3'));var moment=require(_0x49b9('0x4'));var BPromise=require(_0x49b9('0x5'));var rp=require(_0x49b9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49b9('0x7'));var config=require(_0x49b9('0x8'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x3d7b2c,_0x140623){return _0x3d7b2c[_0x49b9('0x9')](_0x49b9('0xa'),attributes,{'tableName':_0x49b9('0xb'),'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 01d8671..ee254f7 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 _0xaf98=['then','info','request\x20sent','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x2f4a02,_0x5c9eff){var _0xe1433b=function(_0x3d58d4){while(--_0x3d58d4){_0x2f4a02['push'](_0x2f4a02['shift']());}};_0xe1433b(++_0x5c9eff);}(_0xaf98,0x11d));var _0x8af9=function(_0x1195b6,_0x1e8c68){_0x1195b6=_0x1195b6-0x0;var _0x2a0aa1=_0xaf98[_0x1195b6];return _0x2a0aa1;};'use strict';var _=require(_0x8af9('0x0'));var util=require(_0x8af9('0x1'));var moment=require(_0x8af9('0x2'));var BPromise=require(_0x8af9('0x3'));var rs=require(_0x8af9('0x4'));var fs=require('fs');var Redis=require(_0x8af9('0x5'));var db=require(_0x8af9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8af9('0x7'))('rpc');var config=require(_0x8af9('0x8'));var jayson=require(_0x8af9('0x9'));var client=jayson[_0x8af9('0xa')][_0x8af9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7e316a,_0x197b3b,_0x40d3ca){return new BPromise(function(_0xe01421,_0x3992a7){return client['request'](_0x7e316a,_0x40d3ca)[_0x8af9('0xc')](function(_0x285228){logger[_0x8af9('0xd')]('MailServerIn,\x20%s,\x20%s',_0x197b3b,_0x8af9('0xe'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x197b3b,_0x8af9('0xe'),JSON[_0x8af9('0xf')](_0x285228));if(_0x285228['error']){if(_0x285228[_0x8af9('0x10')][_0x8af9('0x11')]===0x1f4){logger[_0x8af9('0x10')](_0x8af9('0x12'),_0x197b3b,_0x285228['error'][_0x8af9('0x13')]);return _0x3992a7(_0x285228[_0x8af9('0x10')][_0x8af9('0x13')]);}logger[_0x8af9('0x10')]('MailServerIn,\x20%s,\x20%s',_0x197b3b,_0x285228['error'][_0x8af9('0x13')]);return _0xe01421(_0x285228['error'][_0x8af9('0x13')]);}else{logger[_0x8af9('0xd')](_0x8af9('0x12'),_0x197b3b,'request\x20sent');_0xe01421(_0x285228[_0x8af9('0x14')]['message']);}})['catch'](function(_0x5557b2){logger[_0x8af9('0x10')](_0x8af9('0x12'),_0x197b3b,_0x5557b2);_0x3992a7(_0x5557b2);});});}exports[_0x8af9('0x15')]=function(_0x165115){var _0x44150a=this;return new Promise(function(_0x484d22,_0x29815d){return db[_0x8af9('0x16')][_0x8af9('0x17')]({'raw':_0x165115['options']?_0x165115[_0x8af9('0x18')][_0x8af9('0x19')]===undefined?!![]:![]:!![],'where':_0x165115[_0x8af9('0x18')]?_0x165115[_0x8af9('0x18')][_0x8af9('0x1a')]||null:null,'attributes':_0x165115[_0x8af9('0x18')]?_0x165115[_0x8af9('0x18')][_0x8af9('0x1b')]||null:null,'limit':_0x165115[_0x8af9('0x18')]?_0x165115[_0x8af9('0x18')][_0x8af9('0x1c')]||null:null,'include':_0x165115[_0x8af9('0x18')]?_0x165115[_0x8af9('0x18')][_0x8af9('0x1d')]?_[_0x8af9('0x1e')](_0x165115['options'][_0x8af9('0x1d')],function(_0x475e9e){return{'model':db[_0x475e9e[_0x8af9('0x1f')]],'as':_0x475e9e['as'],'attributes':_0x475e9e[_0x8af9('0x1b')],'include':_0x475e9e[_0x8af9('0x1d')]?_['map'](_0x475e9e[_0x8af9('0x1d')],function(_0x5f3acc){return{'model':db[_0x5f3acc[_0x8af9('0x1f')]],'as':_0x5f3acc['as'],'attributes':_0x5f3acc[_0x8af9('0x1b')],'include':_0x5f3acc[_0x8af9('0x1d')]?_['map'](_0x5f3acc[_0x8af9('0x1d')],function(_0x2b37f9){return{'model':db[_0x2b37f9[_0x8af9('0x1f')]],'as':_0x2b37f9['as'],'attributes':_0x2b37f9[_0x8af9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8af9('0xc')](function(_0x5e26a6){logger['info'](_0x8af9('0x15'),_0x165115);logger['debug'](_0x8af9('0x15'),_0x165115,JSON[_0x8af9('0xf')](_0x5e26a6));_0x484d22(_0x5e26a6);})[_0x8af9('0x20')](function(_0x4aabac){logger[_0x8af9('0x10')]('GetMailServerIn',_0x4aabac['message'],_0x165115);_0x29815d(_0x44150a[_0x8af9('0x10')](0x1f4,_0x4aabac['message']));});});}; \ No newline at end of file +var _0xc9fb=['MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','info','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x5d788d,_0x2f748f){var _0x2909d9=function(_0x4e7c09){while(--_0x4e7c09){_0x5d788d['push'](_0x5d788d['shift']());}};_0x2909d9(++_0x2f748f);}(_0xc9fb,0x148));var _0xbc9f=function(_0x238e28,_0x294a26){_0x238e28=_0x238e28-0x0;var _0x59482b=_0xc9fb[_0x238e28];return _0x59482b;};'use strict';var _=require(_0xbc9f('0x0'));var util=require(_0xbc9f('0x1'));var moment=require(_0xbc9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc9f('0x4'))['db'];var utils=require(_0xbc9f('0x5'));var logger=require(_0xbc9f('0x6'))(_0xbc9f('0x7'));var config=require(_0xbc9f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbc9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x297171,_0x1a0347,_0xa41afa){return new BPromise(function(_0x257d99,_0x46c304){return client[_0xbc9f('0xa')](_0x297171,_0xa41afa)[_0xbc9f('0xb')](function(_0x31ed09){logger['info'](_0xbc9f('0xc'),_0x1a0347,_0xbc9f('0xd'));logger[_0xbc9f('0xe')](_0xbc9f('0xf'),_0x1a0347,'request\x20sent',JSON['stringify'](_0x31ed09));if(_0x31ed09['error']){if(_0x31ed09[_0xbc9f('0x10')][_0xbc9f('0x11')]===0x1f4){logger[_0xbc9f('0x10')](_0xbc9f('0xc'),_0x1a0347,_0x31ed09[_0xbc9f('0x10')][_0xbc9f('0x12')]);return _0x46c304(_0x31ed09[_0xbc9f('0x10')][_0xbc9f('0x12')]);}logger['error'](_0xbc9f('0xc'),_0x1a0347,_0x31ed09[_0xbc9f('0x10')][_0xbc9f('0x12')]);return _0x257d99(_0x31ed09[_0xbc9f('0x10')]['message']);}else{logger['info'](_0xbc9f('0xc'),_0x1a0347,_0xbc9f('0xd'));_0x257d99(_0x31ed09[_0xbc9f('0x13')][_0xbc9f('0x12')]);}})[_0xbc9f('0x14')](function(_0x3958a1){logger[_0xbc9f('0x10')]('MailServerIn,\x20%s,\x20%s',_0x1a0347,_0x3958a1);_0x46c304(_0x3958a1);});});}exports[_0xbc9f('0x15')]=function(_0x19fe02){var _0x264d9e=this;return new Promise(function(_0x1f487a,_0x390b47){return db[_0xbc9f('0x16')][_0xbc9f('0x17')]({'raw':_0x19fe02[_0xbc9f('0x18')]?_0x19fe02[_0xbc9f('0x18')][_0xbc9f('0x19')]===undefined?!![]:![]:!![],'where':_0x19fe02[_0xbc9f('0x18')]?_0x19fe02['options'][_0xbc9f('0x1a')]||null:null,'attributes':_0x19fe02[_0xbc9f('0x18')]?_0x19fe02['options']['attributes']||null:null,'limit':_0x19fe02[_0xbc9f('0x18')]?_0x19fe02[_0xbc9f('0x18')][_0xbc9f('0x1b')]||null:null,'include':_0x19fe02['options']?_0x19fe02[_0xbc9f('0x18')][_0xbc9f('0x1c')]?_[_0xbc9f('0x1d')](_0x19fe02[_0xbc9f('0x18')][_0xbc9f('0x1c')],function(_0x15f119){return{'model':db[_0x15f119[_0xbc9f('0x1e')]],'as':_0x15f119['as'],'attributes':_0x15f119[_0xbc9f('0x1f')],'include':_0x15f119[_0xbc9f('0x1c')]?_[_0xbc9f('0x1d')](_0x15f119[_0xbc9f('0x1c')],function(_0xef650e){return{'model':db[_0xef650e['model']],'as':_0xef650e['as'],'attributes':_0xef650e[_0xbc9f('0x1f')],'include':_0xef650e['include']?_[_0xbc9f('0x1d')](_0xef650e[_0xbc9f('0x1c')],function(_0x2e746c){return{'model':db[_0x2e746c['model']],'as':_0x2e746c['as'],'attributes':_0x2e746c[_0xbc9f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbc9f('0xb')](function(_0x2adadc){logger[_0xbc9f('0x20')](_0xbc9f('0x15'),_0x19fe02);logger[_0xbc9f('0xe')](_0xbc9f('0x15'),_0x19fe02,JSON[_0xbc9f('0x21')](_0x2adadc));_0x1f487a(_0x2adadc);})[_0xbc9f('0x14')](function(_0x519f90){logger[_0xbc9f('0x10')](_0xbc9f('0x15'),_0x519f90[_0xbc9f('0x12')],_0x19fe02);_0x390b47(_0x264d9e['error'](0x1f4,_0x519f90[_0xbc9f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 1b37c30..64dd3ca 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(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0x45811b,_0x112522){_0x45811b=_0x45811b-0x0;var _0x4131f9=_0x7a54[_0x45811b];return _0x4131f9;};'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(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_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 f6b9a6c..efd36bf 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 _0x4e81=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x4e81,0x1bc));var _0x14e8=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x4e81[_0x4e55a9];return _0x4a9b67;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'description':{'type':Sequelize[_0x14e8('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x14e8('0x3')]},'secure':{'type':Sequelize[_0x14e8('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x14e8('0x2')]},'authentication':{'type':Sequelize[_0x14e8('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x14e8('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x84a0=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x84a0,0x66));var _0x084a=function(_0xf5bd9a,_0x5a0bfb){_0xf5bd9a=_0xf5bd9a-0x0;var _0x30f9ee=_0x84a0[_0xf5bd9a];return _0x30f9ee;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'description':{'type':Sequelize[_0x084a('0x2')]},'host':{'type':Sequelize[_0x084a('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x084a('0x2')]},'port':{'type':Sequelize[_0x084a('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x084a('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x084a('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 55eda76..d13b696 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 _0x7d8e=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','model','query'];(function(_0x500c02,_0x17afde){var _0x1a1efd=function(_0xa52f03){while(--_0xa52f03){_0x500c02['push'](_0x500c02['shift']());}};_0x1a1efd(++_0x17afde);}(_0x7d8e,0xac));var _0xe7d8=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x7d8e[_0x2962d5];return _0x273406;};'use strict';var emlformat=require(_0xe7d8('0x0'));var rimraf=require(_0xe7d8('0x1'));var zipdir=require(_0xe7d8('0x2'));var jsonpatch=require(_0xe7d8('0x3'));var rp=require(_0xe7d8('0x4'));var moment=require(_0xe7d8('0x5'));var BPromise=require(_0xe7d8('0x6'));var Mustache=require(_0xe7d8('0x7'));var util=require(_0xe7d8('0x8'));var path=require('path');var sox=require(_0xe7d8('0x9'));var csv=require('to-csv');var ejs=require(_0xe7d8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7d8('0xb'));var squel=require(_0xe7d8('0xc'));var crypto=require('crypto');var jsforce=require(_0xe7d8('0xd'));var deskjs=require(_0xe7d8('0xe'));var toCsv=require(_0xe7d8('0xf'));var querystring=require(_0xe7d8('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7d8('0x11'));var qs=require(_0xe7d8('0x12'));var as=require(_0xe7d8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7d8('0x14'))(_0xe7d8('0x15'));var utils=require(_0xe7d8('0x16'));var config=require(_0xe7d8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59d659,_0x112b94){_0x112b94=_0x112b94||0xcc;return function(_0x51a901){if(_0x51a901){return _0x59d659[_0xe7d8('0x18')](_0x112b94);}return _0x59d659[_0xe7d8('0x19')](_0x112b94)[_0xe7d8('0x1a')]();};}function respondWithResult(_0x4942e8,_0x5e1411){_0x5e1411=_0x5e1411||0xc8;return function(_0x49ba0f){if(_0x49ba0f){return _0x4942e8[_0xe7d8('0x19')](_0x5e1411)[_0xe7d8('0x1b')](_0x49ba0f);}};}function respondWithFilteredResult(_0x21bcf1,_0x1df85a){return function(_0x4987bc){if(_0x4987bc){var _0x21a200=typeof _0x1df85a['offset']===_0xe7d8('0x1c')&&typeof _0x1df85a[_0xe7d8('0x1d')]==='undefined';var _0x38d44d=_0x4987bc[_0xe7d8('0x1e')];var _0x33d823=_0x21a200?0x0:_0x1df85a['offset'];var _0x1a2465=_0x21a200?_0x4987bc[_0xe7d8('0x1e')]:_0x1df85a['offset']+_0x1df85a[_0xe7d8('0x1d')];var _0x2e6ffa;if(_0x1a2465>=_0x38d44d){_0x1a2465=_0x38d44d;_0x2e6ffa=0xc8;}else{_0x2e6ffa=0xce;}_0x21bcf1[_0xe7d8('0x19')](_0x2e6ffa);return _0x21bcf1[_0xe7d8('0x1f')](_0xe7d8('0x20'),_0x33d823+'-'+_0x1a2465+'/'+_0x38d44d)[_0xe7d8('0x1b')](_0x4987bc);}return null;};}function patchUpdates(_0x37ce4b){return function(_0x3247c5){try{jsonpatch['apply'](_0x3247c5,_0x37ce4b,!![]);}catch(_0x20e4bc){return BPromise[_0xe7d8('0x21')](_0x20e4bc);}return _0x3247c5[_0xe7d8('0x22')]();};}function saveUpdates(_0x355742,_0x1af5de){return function(_0x43933c){if(_0x43933c){return _0x43933c[_0xe7d8('0x23')](_0x355742)[_0xe7d8('0x24')](function(_0x471b54){return _0x471b54;});}return null;};}function removeEntity(_0x52e087,_0x1c9277){return function(_0x3bf496){if(_0x3bf496){return _0x3bf496['destroy']()[_0xe7d8('0x24')](function(){_0x52e087[_0xe7d8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4adb90,_0x2fa6a3){return function(_0x4b3b4e){if(!_0x4b3b4e){_0x4adb90[_0xe7d8('0x18')](0x194);}return _0x4b3b4e;};}function handleError(_0x20a694,_0x44acd5){_0x44acd5=_0x44acd5||0x1f4;return function(_0x8ee44e){logger['error'](_0x8ee44e[_0xe7d8('0x25')]);if(_0x8ee44e[_0xe7d8('0x26')]){delete _0x8ee44e['name'];}_0x20a694[_0xe7d8('0x19')](_0x44acd5)[_0xe7d8('0x27')](_0x8ee44e);};}exports[_0xe7d8('0x28')]=function(_0x101538,_0x5cfaea){var _0xed58a7={},_0x2894a2={},_0x1a9064={'count':0x0,'rows':[]};var _0x21a72f=_[_0xe7d8('0x29')](db[_0xe7d8('0x2a')][_0xe7d8('0x2b')],function(_0x1086a8){return{'name':_0x1086a8[_0xe7d8('0x2c')],'type':_0x1086a8['type']['key']};});_0x2894a2[_0xe7d8('0x2d')]=_[_0xe7d8('0x29')](_0x21a72f,'name');_0x2894a2[_0xe7d8('0x2e')]=_[_0xe7d8('0x2f')](_0x101538[_0xe7d8('0x2e')]);_0x2894a2[_0xe7d8('0x30')]=_[_0xe7d8('0x31')](_0x2894a2['model'],_0x2894a2['query']);_0xed58a7[_0xe7d8('0x32')]=_[_0xe7d8('0x31')](_0x2894a2[_0xe7d8('0x2d')],qs[_0xe7d8('0x33')](_0x101538[_0xe7d8('0x2e')][_0xe7d8('0x33')]));_0xed58a7[_0xe7d8('0x32')]=_0xed58a7[_0xe7d8('0x32')][_0xe7d8('0x34')]?_0xed58a7[_0xe7d8('0x32')]:_0x2894a2['model'];if(!_0x101538[_0xe7d8('0x2e')][_0xe7d8('0x35')](_0xe7d8('0x36'))){_0xed58a7['limit']=qs[_0xe7d8('0x1d')](_0x101538['query']['limit']);_0xed58a7[_0xe7d8('0x37')]=qs[_0xe7d8('0x37')](_0x101538[_0xe7d8('0x2e')][_0xe7d8('0x37')]);}_0xed58a7[_0xe7d8('0x38')]=qs['sort'](_0x101538['query'][_0xe7d8('0x39')]);_0xed58a7[_0xe7d8('0x3a')]=qs[_0xe7d8('0x30')](_[_0xe7d8('0x3b')](_0x101538[_0xe7d8('0x2e')],_0x2894a2[_0xe7d8('0x30')]),_0x21a72f);if(_0x101538[_0xe7d8('0x2e')][_0xe7d8('0x3c')]){_0xed58a7['where']=_[_0xe7d8('0x3d')](_0xed58a7['where'],{'$or':_[_0xe7d8('0x29')](_0x21a72f,function(_0x2f57a5){if(_0x2f57a5['type']!=='VIRTUAL'){var _0x19eda9={};_0x19eda9[_0x2f57a5[_0xe7d8('0x26')]]={'$like':'%'+_0x101538['query'][_0xe7d8('0x3c')]+'%'};return _0x19eda9;}})});}_0xed58a7=_[_0xe7d8('0x3d')]({},_0xed58a7,_0x101538[_0xe7d8('0x3e')]);var _0x566452={'where':_0xed58a7[_0xe7d8('0x3a')]};return db[_0xe7d8('0x2a')][_0xe7d8('0x1e')](_0x566452)[_0xe7d8('0x24')](function(_0x3957eb){_0x1a9064[_0xe7d8('0x1e')]=_0x3957eb;if(_0x101538[_0xe7d8('0x2e')]['includeAll']){_0xed58a7[_0xe7d8('0x3f')]=[{'all':!![]}];}return db[_0xe7d8('0x2a')][_0xe7d8('0x40')](_0xed58a7);})[_0xe7d8('0x24')](function(_0x2756a2){_0x1a9064[_0xe7d8('0x41')]=_0x2756a2;return _0x1a9064;})[_0xe7d8('0x24')](respondWithFilteredResult(_0x5cfaea,_0xed58a7))[_0xe7d8('0x42')](handleError(_0x5cfaea,null));};exports[_0xe7d8('0x43')]=function(_0x4f9244,_0x42f290){var _0x5b8987={'raw':!![],'where':{'id':_0x4f9244[_0xe7d8('0x44')]['id']}},_0x269d81={};_0x269d81[_0xe7d8('0x2d')]=_['keys'](db[_0xe7d8('0x2a')][_0xe7d8('0x2b')]);_0x269d81[_0xe7d8('0x2e')]=_[_0xe7d8('0x2f')](_0x4f9244[_0xe7d8('0x2e')]);_0x269d81['filters']=_[_0xe7d8('0x31')](_0x269d81['model'],_0x269d81[_0xe7d8('0x2e')]);_0x5b8987[_0xe7d8('0x32')]=_[_0xe7d8('0x31')](_0x269d81[_0xe7d8('0x2d')],qs[_0xe7d8('0x33')](_0x4f9244[_0xe7d8('0x2e')][_0xe7d8('0x33')]));_0x5b8987[_0xe7d8('0x32')]=_0x5b8987[_0xe7d8('0x32')][_0xe7d8('0x34')]?_0x5b8987[_0xe7d8('0x32')]:_0x269d81['model'];if(_0x4f9244[_0xe7d8('0x2e')][_0xe7d8('0x45')]){_0x5b8987[_0xe7d8('0x3f')]=[{'all':!![]}];}_0x5b8987=_[_0xe7d8('0x3d')]({},_0x5b8987,_0x4f9244[_0xe7d8('0x3e')]);return db[_0xe7d8('0x2a')][_0xe7d8('0x46')](_0x5b8987)[_0xe7d8('0x24')](handleEntityNotFound(_0x42f290,null))[_0xe7d8('0x24')](respondWithResult(_0x42f290,null))[_0xe7d8('0x42')](handleError(_0x42f290,null));};exports['create']=function(_0x36a38e,_0x468557){return db[_0xe7d8('0x2a')][_0xe7d8('0x47')](_0x36a38e[_0xe7d8('0x48')],{})[_0xe7d8('0x24')](respondWithResult(_0x468557,0xc9))['catch'](handleError(_0x468557,null));};exports[_0xe7d8('0x23')]=function(_0x34999d,_0x47e523){if(_0x34999d[_0xe7d8('0x48')]['id']){delete _0x34999d['body']['id'];}return db['MailServerOut'][_0xe7d8('0x46')]({'where':{'id':_0x34999d[_0xe7d8('0x44')]['id']}})[_0xe7d8('0x24')](handleEntityNotFound(_0x47e523,null))['then'](saveUpdates(_0x34999d[_0xe7d8('0x48')],null))[_0xe7d8('0x24')](respondWithResult(_0x47e523,null))['catch'](handleError(_0x47e523,null));};exports['destroy']=function(_0x5bd5ee,_0x74f072){return db[_0xe7d8('0x2a')][_0xe7d8('0x46')]({'where':{'id':_0x5bd5ee[_0xe7d8('0x44')]['id']}})[_0xe7d8('0x24')](handleEntityNotFound(_0x74f072,null))['then'](removeEntity(_0x74f072,null))[_0xe7d8('0x42')](handleError(_0x74f072,null));}; \ No newline at end of file +var _0x2d06=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','catch','params','includeAll','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x4d7517,_0x162c71){var _0x521996=function(_0x48476c){while(--_0x48476c){_0x4d7517['push'](_0x4d7517['shift']());}};_0x521996(++_0x162c71);}(_0x2d06,0x184));var _0x62d0=function(_0x20abcf,_0x4d8bf4){_0x20abcf=_0x20abcf-0x0;var _0x1e7014=_0x2d06[_0x20abcf];return _0x1e7014;};'use strict';var emlformat=require(_0x62d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x62d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x62d0('0x2'));var moment=require(_0x62d0('0x3'));var BPromise=require(_0x62d0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x62d0('0x5'));var sox=require(_0x62d0('0x6'));var csv=require(_0x62d0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62d0('0x8'));var squel=require('squel');var crypto=require(_0x62d0('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x62d0('0x7'));var querystring=require('querystring');var Papa=require(_0x62d0('0xa'));var Redis=require(_0x62d0('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x62d0('0xc'));var as=require(_0x62d0('0xd'));var hardwareService=require(_0x62d0('0xe'));var logger=require(_0x62d0('0xf'))(_0x62d0('0x10'));var utils=require(_0x62d0('0x11'));var config=require(_0x62d0('0x12'));var licenseUtil=require(_0x62d0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d000a,_0x431702){_0x431702=_0x431702||0xcc;return function(_0xb2f3a3){if(_0xb2f3a3){return _0x5d000a[_0x62d0('0x14')](_0x431702);}return _0x5d000a[_0x62d0('0x15')](_0x431702)[_0x62d0('0x16')]();};}function respondWithResult(_0x469e36,_0x394041){_0x394041=_0x394041||0xc8;return function(_0x24d1e0){if(_0x24d1e0){return _0x469e36['status'](_0x394041)[_0x62d0('0x17')](_0x24d1e0);}};}function respondWithFilteredResult(_0x1d4539,_0x2e5e86){return function(_0x3bf173){if(_0x3bf173){var _0x1b8a9c=typeof _0x2e5e86[_0x62d0('0x18')]===_0x62d0('0x19')&&typeof _0x2e5e86[_0x62d0('0x1a')]===_0x62d0('0x19');var _0x8cc5d4=_0x3bf173[_0x62d0('0x1b')];var _0x2f16f1=_0x1b8a9c?0x0:_0x2e5e86[_0x62d0('0x18')];var _0x105b20=_0x1b8a9c?_0x3bf173[_0x62d0('0x1b')]:_0x2e5e86[_0x62d0('0x18')]+_0x2e5e86[_0x62d0('0x1a')];var _0x2a888f;if(_0x105b20>=_0x8cc5d4){_0x105b20=_0x8cc5d4;_0x2a888f=0xc8;}else{_0x2a888f=0xce;}_0x1d4539[_0x62d0('0x15')](_0x2a888f);return _0x1d4539[_0x62d0('0x1c')](_0x62d0('0x1d'),_0x2f16f1+'-'+_0x105b20+'/'+_0x8cc5d4)[_0x62d0('0x17')](_0x3bf173);}return null;};}function patchUpdates(_0x48705c){return function(_0x1bf55c){try{jsonpatch[_0x62d0('0x1e')](_0x1bf55c,_0x48705c,!![]);}catch(_0x2dc59e){return BPromise[_0x62d0('0x1f')](_0x2dc59e);}return _0x1bf55c[_0x62d0('0x20')]();};}function saveUpdates(_0x1f0df1,_0x16ef45){return function(_0x1d71ed){if(_0x1d71ed){return _0x1d71ed[_0x62d0('0x21')](_0x1f0df1)[_0x62d0('0x22')](function(_0x57ec10){return _0x57ec10;});}return null;};}function removeEntity(_0x4051fc,_0x5011bb){return function(_0x2275d1){if(_0x2275d1){return _0x2275d1[_0x62d0('0x23')]()[_0x62d0('0x22')](function(){_0x4051fc[_0x62d0('0x15')](0xcc)[_0x62d0('0x16')]();});}};}function handleEntityNotFound(_0x335586,_0x3602a2){return function(_0x4c3ef4){if(!_0x4c3ef4){_0x335586['sendStatus'](0x194);}return _0x4c3ef4;};}function handleError(_0x497df5,_0x29c5ab){_0x29c5ab=_0x29c5ab||0x1f4;return function(_0x41e3e1){logger[_0x62d0('0x24')](_0x41e3e1['stack']);if(_0x41e3e1[_0x62d0('0x25')]){delete _0x41e3e1['name'];}_0x497df5[_0x62d0('0x15')](_0x29c5ab)[_0x62d0('0x26')](_0x41e3e1);};}exports[_0x62d0('0x27')]=function(_0x397c97,_0x38d103){var _0x4be21e={},_0x287f4a={},_0x175b22={'count':0x0,'rows':[]};var _0x341300=_[_0x62d0('0x28')](db[_0x62d0('0x29')][_0x62d0('0x2a')],function(_0x84c8af){return{'name':_0x84c8af[_0x62d0('0x2b')],'type':_0x84c8af['type'][_0x62d0('0x2c')]};});_0x287f4a['model']=_[_0x62d0('0x28')](_0x341300,_0x62d0('0x25'));_0x287f4a['query']=_[_0x62d0('0x2d')](_0x397c97['query']);_0x287f4a[_0x62d0('0x2e')]=_[_0x62d0('0x2f')](_0x287f4a[_0x62d0('0x30')],_0x287f4a[_0x62d0('0x31')]);_0x4be21e[_0x62d0('0x32')]=_[_0x62d0('0x2f')](_0x287f4a['model'],qs[_0x62d0('0x33')](_0x397c97[_0x62d0('0x31')][_0x62d0('0x33')]));_0x4be21e[_0x62d0('0x32')]=_0x4be21e[_0x62d0('0x32')][_0x62d0('0x34')]?_0x4be21e[_0x62d0('0x32')]:_0x287f4a[_0x62d0('0x30')];if(!_0x397c97[_0x62d0('0x31')][_0x62d0('0x35')](_0x62d0('0x36'))){_0x4be21e['limit']=qs['limit'](_0x397c97[_0x62d0('0x31')][_0x62d0('0x1a')]);_0x4be21e[_0x62d0('0x18')]=qs[_0x62d0('0x18')](_0x397c97['query'][_0x62d0('0x18')]);}_0x4be21e['order']=qs[_0x62d0('0x37')](_0x397c97['query'][_0x62d0('0x37')]);_0x4be21e[_0x62d0('0x38')]=qs['filters'](_[_0x62d0('0x39')](_0x397c97[_0x62d0('0x31')],_0x287f4a[_0x62d0('0x2e')]),_0x341300);if(_0x397c97['query'][_0x62d0('0x3a')]){_0x4be21e['where']=_[_0x62d0('0x3b')](_0x4be21e['where'],{'$or':_[_0x62d0('0x28')](_0x341300,function(_0x4d1737){if(_0x4d1737[_0x62d0('0x3c')]!==_0x62d0('0x3d')){var _0x514bf7={};_0x514bf7[_0x4d1737[_0x62d0('0x25')]]={'$like':'%'+_0x397c97[_0x62d0('0x31')][_0x62d0('0x3a')]+'%'};return _0x514bf7;}})});}_0x4be21e=_[_0x62d0('0x3b')]({},_0x4be21e,_0x397c97[_0x62d0('0x3e')]);var _0x459cb9={'where':_0x4be21e[_0x62d0('0x38')]};return db['MailServerOut'][_0x62d0('0x1b')](_0x459cb9)[_0x62d0('0x22')](function(_0x4683f1){_0x175b22[_0x62d0('0x1b')]=_0x4683f1;if(_0x397c97['query']['includeAll']){_0x4be21e['include']=[{'all':!![]}];}return db[_0x62d0('0x29')]['findAll'](_0x4be21e);})[_0x62d0('0x22')](function(_0xac4a85){_0x175b22['rows']=_0xac4a85;return _0x175b22;})[_0x62d0('0x22')](respondWithFilteredResult(_0x38d103,_0x4be21e))[_0x62d0('0x3f')](handleError(_0x38d103,null));};exports['show']=function(_0x2dbfe4,_0xa0ef05){var _0x15c2da={'raw':!![],'where':{'id':_0x2dbfe4[_0x62d0('0x40')]['id']}},_0x3abbf2={};_0x3abbf2[_0x62d0('0x30')]=_[_0x62d0('0x2d')](db[_0x62d0('0x29')][_0x62d0('0x2a')]);_0x3abbf2['query']=_[_0x62d0('0x2d')](_0x2dbfe4['query']);_0x3abbf2['filters']=_[_0x62d0('0x2f')](_0x3abbf2[_0x62d0('0x30')],_0x3abbf2[_0x62d0('0x31')]);_0x15c2da['attributes']=_[_0x62d0('0x2f')](_0x3abbf2[_0x62d0('0x30')],qs['fields'](_0x2dbfe4[_0x62d0('0x31')][_0x62d0('0x33')]));_0x15c2da[_0x62d0('0x32')]=_0x15c2da[_0x62d0('0x32')]['length']?_0x15c2da[_0x62d0('0x32')]:_0x3abbf2[_0x62d0('0x30')];if(_0x2dbfe4[_0x62d0('0x31')][_0x62d0('0x41')]){_0x15c2da['include']=[{'all':!![]}];}_0x15c2da=_[_0x62d0('0x3b')]({},_0x15c2da,_0x2dbfe4[_0x62d0('0x3e')]);return db[_0x62d0('0x29')][_0x62d0('0x42')](_0x15c2da)[_0x62d0('0x22')](handleEntityNotFound(_0xa0ef05,null))[_0x62d0('0x22')](respondWithResult(_0xa0ef05,null))[_0x62d0('0x3f')](handleError(_0xa0ef05,null));};exports[_0x62d0('0x43')]=function(_0x5d150d,_0xa1fa){return db['MailServerOut'][_0x62d0('0x43')](_0x5d150d['body'],{})[_0x62d0('0x22')](respondWithResult(_0xa1fa,0xc9))['catch'](handleError(_0xa1fa,null));};exports[_0x62d0('0x21')]=function(_0xecc2d,_0x1dfa83){if(_0xecc2d[_0x62d0('0x44')]['id']){delete _0xecc2d[_0x62d0('0x44')]['id'];}return db[_0x62d0('0x29')][_0x62d0('0x42')]({'where':{'id':_0xecc2d[_0x62d0('0x40')]['id']}})[_0x62d0('0x22')](handleEntityNotFound(_0x1dfa83,null))['then'](saveUpdates(_0xecc2d[_0x62d0('0x44')],null))[_0x62d0('0x22')](respondWithResult(_0x1dfa83,null))['catch'](handleError(_0x1dfa83,null));};exports[_0x62d0('0x23')]=function(_0x28c758,_0x54d9b1){return db[_0x62d0('0x29')][_0x62d0('0x42')]({'where':{'id':_0x28c758[_0x62d0('0x40')]['id']}})[_0x62d0('0x22')](handleEntityNotFound(_0x54d9b1,null))[_0x62d0('0x22')](removeEntity(_0x54d9b1,null))[_0x62d0('0x3f')](handleError(_0x54d9b1,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 31951ba..aff9cfc 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 _0xf48f=['./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x2f1343,_0x59bd6a){var _0x2d8268=function(_0x2844e9){while(--_0x2844e9){_0x2f1343['push'](_0x2f1343['shift']());}};_0x2d8268(++_0x59bd6a);}(_0xf48f,0x10c));var _0xff48=function(_0x5835d4,_0x56ddde){_0x5835d4=_0x5835d4-0x0;var _0x792778=_0xf48f[_0x5835d4];return _0x792778;};'use strict';var _=require(_0xff48('0x0'));var util=require(_0xff48('0x1'));var logger=require(_0xff48('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xff48('0x3'));var fs=require('fs');var path=require(_0xff48('0x4'));var rimraf=require(_0xff48('0x5'));var config=require(_0xff48('0x6'));var attributes=require(_0xff48('0x7'));module['exports']=function(_0x69e9e1,_0x4d770a){return _0x69e9e1[_0xff48('0x8')](_0xff48('0x9'),attributes,{'tableName':_0xff48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e4b=['define','MailServerOut','mail_servers_out','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e4b,0x17c));var _0xb3e4=function(_0x35a87c,_0xe2fb59){_0x35a87c=_0x35a87c-0x0;var _0xc2b279=_0x3e4b[_0x35a87c];return _0xc2b279;};'use strict';var _=require(_0xb3e4('0x0'));var util=require('util');var logger=require(_0xb3e4('0x1'))('api');var moment=require(_0xb3e4('0x2'));var BPromise=require(_0xb3e4('0x3'));var rp=require(_0xb3e4('0x4'));var fs=require('fs');var path=require(_0xb3e4('0x5'));var rimraf=require(_0xb3e4('0x6'));var config=require(_0xb3e4('0x7'));var attributes=require(_0xb3e4('0x8'));module[_0xb3e4('0x9')]=function(_0x360e85,_0x12c27b){return _0x360e85[_0xb3e4('0xa')](_0xb3e4('0xb'),attributes,{'tableName':_0xb3e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 715a1c1..2953502 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x3dd781,_0x1e29ec){var _0x191150=function(_0x3db520){while(--_0x3db520){_0x3dd781['push'](_0x3dd781['shift']());}};_0x191150(++_0x1e29ec);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _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(_0x13a094,_0x250688){var _0xa3d083=function(_0xa272f4){while(--_0xa272f4){_0x13a094['push'](_0x13a094['shift']());}};_0xa3d083(++_0x250688);}(_0x2ef3,0xba));var _0x32ef=function(_0x15f349,_0x36a9a6){_0x15f349=_0x15f349-0x0;var _0x2b89c0=_0x2ef3[_0x15f349];return _0x2b89c0;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index daec4cc..9ab707e 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 _0xfba2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x1cd0ae,_0x56e71c){var _0x67c678=function(_0x273652){while(--_0x273652){_0x1cd0ae['push'](_0x1cd0ae['shift']());}};_0x67c678(++_0x56e71c);}(_0xfba2,0xf2));var _0x2fba=function(_0x155fe7,_0x4af6a1){_0x155fe7=_0x155fe7-0x0;var _0x3bb7f6=_0xfba2[_0x155fe7];return _0x3bb7f6;};'use strict';var multer=require(_0x2fba('0x0'));var util=require(_0x2fba('0x1'));var path=require(_0x2fba('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fba('0x3'));var router=express['Router']();var fs_extra=require(_0x2fba('0x4'));var auth=require(_0x2fba('0x5'));var interaction=require(_0x2fba('0x6'));var config=require(_0x2fba('0x7'));var controller=require(_0x2fba('0x8'));router[_0x2fba('0x9')]('/',auth[_0x2fba('0xa')](),controller[_0x2fba('0xb')]);router[_0x2fba('0x9')](_0x2fba('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x2fba('0x9')](_0x2fba('0xd'),auth[_0x2fba('0xa')](),controller[_0x2fba('0xe')]);router['post']('/',auth[_0x2fba('0xa')](),controller[_0x2fba('0xf')]);router[_0x2fba('0x10')]('/:id',auth[_0x2fba('0xa')](),controller['update']);router[_0x2fba('0x11')](_0x2fba('0xd'),auth[_0x2fba('0xa')](),controller[_0x2fba('0x12')]);module['exports']=router; \ No newline at end of file +var _0xbffb=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','index','get','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x184c94,_0x5dfaa4){var _0x3a7f7f=function(_0x11e9b4){while(--_0x11e9b4){_0x184c94['push'](_0x184c94['shift']());}};_0x3a7f7f(++_0x5dfaa4);}(_0xbffb,0xa5));var _0xbbff=function(_0x5f3517,_0xc09135){_0x5f3517=_0x5f3517-0x0;var _0x4318e1=_0xbffb[_0x5f3517];return _0x4318e1;};'use strict';var multer=require(_0xbbff('0x0'));var util=require('util');var path=require(_0xbbff('0x1'));var timeout=require(_0xbbff('0x2'));var express=require(_0xbbff('0x3'));var router=express[_0xbbff('0x4')]();var fs_extra=require(_0xbbff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbbff('0x6'));var config=require(_0xbbff('0x7'));var controller=require(_0xbbff('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbbff('0x9')]);router[_0xbbff('0xa')](_0xbbff('0xb'),auth[_0xbbff('0xc')](),controller[_0xbbff('0xd')]);router[_0xbbff('0xa')](_0xbbff('0xe'),auth[_0xbbff('0xc')](),controller[_0xbbff('0xf')]);router['post']('/',auth[_0xbbff('0xc')](),controller['create']);router[_0xbbff('0x10')](_0xbbff('0xe'),auth['isAuthenticated'](),controller[_0xbbff('0x11')]);router[_0xbbff('0x12')]('/:id',auth[_0xbbff('0xc')](),controller[_0xbbff('0x13')]);module[_0xbbff('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 86772dd..0d1ef98 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 _0x8d0a=['STRING','name','sequelize'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x8d0a,0x65));var _0xa8d0=function(_0x4dbdfa,_0x14e82a){_0x4dbdfa=_0x4dbdfa-0x0;var _0x59ad98=_0x8d0a[_0x4dbdfa];return _0x59ad98;};'use strict';var Sequelize=require(_0xa8d0('0x0'));module['exports']={'name':{'type':Sequelize[_0xa8d0('0x1')],'unique':_0xa8d0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa8d0('0x1')]}}; \ No newline at end of file +var _0x0309=['STRING','sequelize'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x0309,0x165));var _0x9030=function(_0x5d669e,_0x42dd1c){_0x5d669e=_0x5d669e-0x0;var _0x13c51d=_0x0309[_0x5d669e];return _0x13c51d;};'use strict';var Sequelize=require(_0x9030('0x0'));module['exports']={'name':{'type':Sequelize[_0x9030('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9030('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1b2abdb..6ebdbe1 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 _0x0d85=['error','name','send','index','map','MailSubstatus','fieldName','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','options','where','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end'];(function(_0x55e722,_0xef5d78){var _0x33964d=function(_0x2a6718){while(--_0x2a6718){_0x55e722['push'](_0x55e722['shift']());}};_0x33964d(++_0xef5d78);}(_0x0d85,0x1f2));var _0x50d8=function(_0x39e98a,_0x3fc1ee){_0x39e98a=_0x39e98a-0x0;var _0x3f1242=_0x0d85[_0x39e98a];return _0x3f1242;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50d8('0x0'));var zipdir=require(_0x50d8('0x1'));var jsonpatch=require(_0x50d8('0x2'));var rp=require('request-promise');var moment=require(_0x50d8('0x3'));var BPromise=require(_0x50d8('0x4'));var Mustache=require(_0x50d8('0x5'));var util=require(_0x50d8('0x6'));var path=require(_0x50d8('0x7'));var sox=require(_0x50d8('0x8'));var csv=require(_0x50d8('0x9'));var ejs=require(_0x50d8('0xa'));var fs=require('fs');var fs_extra=require(_0x50d8('0xb'));var _=require('lodash');var squel=require(_0x50d8('0xc'));var crypto=require(_0x50d8('0xd'));var jsforce=require(_0x50d8('0xe'));var deskjs=require(_0x50d8('0xf'));var toCsv=require(_0x50d8('0x9'));var querystring=require(_0x50d8('0x10'));var Papa=require(_0x50d8('0x11'));var Redis=require(_0x50d8('0x12'));var authService=require(_0x50d8('0x13'));var qs=require(_0x50d8('0x14'));var as=require(_0x50d8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x50d8('0x16'))(_0x50d8('0x17'));var utils=require(_0x50d8('0x18'));var config=require(_0x50d8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x50d8('0x1a'))['db'];function respondWithStatusCode(_0x154c20,_0x23d8e3){_0x23d8e3=_0x23d8e3||0xcc;return function(_0x58a23c){if(_0x58a23c){return _0x154c20[_0x50d8('0x1b')](_0x23d8e3);}return _0x154c20[_0x50d8('0x1c')](_0x23d8e3)['end']();};}function respondWithResult(_0x486c2e,_0x1d188d){_0x1d188d=_0x1d188d||0xc8;return function(_0x3faa91){if(_0x3faa91){return _0x486c2e['status'](_0x1d188d)[_0x50d8('0x1d')](_0x3faa91);}};}function respondWithFilteredResult(_0x212e59,_0x5e7378){return function(_0x4b4d23){if(_0x4b4d23){var _0x2471ee=typeof _0x5e7378[_0x50d8('0x1e')]===_0x50d8('0x1f')&&typeof _0x5e7378[_0x50d8('0x20')]==='undefined';var _0x4f0bbd=_0x4b4d23[_0x50d8('0x21')];var _0x5d18bc=_0x2471ee?0x0:_0x5e7378[_0x50d8('0x1e')];var _0x571262=_0x2471ee?_0x4b4d23[_0x50d8('0x21')]:_0x5e7378[_0x50d8('0x1e')]+_0x5e7378[_0x50d8('0x20')];var _0x198299;if(_0x571262>=_0x4f0bbd){_0x571262=_0x4f0bbd;_0x198299=0xc8;}else{_0x198299=0xce;}_0x212e59[_0x50d8('0x1c')](_0x198299);return _0x212e59[_0x50d8('0x22')](_0x50d8('0x23'),_0x5d18bc+'-'+_0x571262+'/'+_0x4f0bbd)[_0x50d8('0x1d')](_0x4b4d23);}return null;};}function patchUpdates(_0x3b53c0){return function(_0x3defba){try{jsonpatch['apply'](_0x3defba,_0x3b53c0,!![]);}catch(_0x46576a){return BPromise[_0x50d8('0x24')](_0x46576a);}return _0x3defba['save']();};}function saveUpdates(_0x242e3a,_0x1af601){return function(_0x278ac6){if(_0x278ac6){return _0x278ac6[_0x50d8('0x25')](_0x242e3a)[_0x50d8('0x26')](function(_0xa5c4b8){return _0xa5c4b8;});}return null;};}function removeEntity(_0x1703b8,_0x99f5e7){return function(_0x173166){if(_0x173166){return _0x173166[_0x50d8('0x27')]()[_0x50d8('0x26')](function(){_0x1703b8['status'](0xcc)[_0x50d8('0x28')]();});}};}function handleEntityNotFound(_0x58fd35,_0x4ac6f3){return function(_0x4ac27f){if(!_0x4ac27f){_0x58fd35['sendStatus'](0x194);}return _0x4ac27f;};}function handleError(_0x69c619,_0x322d52){_0x322d52=_0x322d52||0x1f4;return function(_0x4ca55d){logger[_0x50d8('0x29')](_0x4ca55d['stack']);if(_0x4ca55d[_0x50d8('0x2a')]){delete _0x4ca55d[_0x50d8('0x2a')];}_0x69c619['status'](_0x322d52)[_0x50d8('0x2b')](_0x4ca55d);};}exports[_0x50d8('0x2c')]=function(_0xe7930e,_0x3e8b23){var _0x1e88d0={},_0x458296={},_0x2af99c={'count':0x0,'rows':[]};var _0xd05f5f=_[_0x50d8('0x2d')](db[_0x50d8('0x2e')]['rawAttributes'],function(_0x4d86f1){return{'name':_0x4d86f1[_0x50d8('0x2f')],'type':_0x4d86f1[_0x50d8('0x30')]['key']};});_0x458296['model']=_[_0x50d8('0x2d')](_0xd05f5f,_0x50d8('0x2a'));_0x458296[_0x50d8('0x31')]=_[_0x50d8('0x32')](_0xe7930e['query']);_0x458296['filters']=_[_0x50d8('0x33')](_0x458296[_0x50d8('0x34')],_0x458296[_0x50d8('0x31')]);_0x1e88d0['attributes']=_['intersection'](_0x458296['model'],qs[_0x50d8('0x35')](_0xe7930e[_0x50d8('0x31')]['fields']));_0x1e88d0[_0x50d8('0x36')]=_0x1e88d0[_0x50d8('0x36')]['length']?_0x1e88d0[_0x50d8('0x36')]:_0x458296[_0x50d8('0x34')];if(!_0xe7930e[_0x50d8('0x31')][_0x50d8('0x37')](_0x50d8('0x38'))){_0x1e88d0['limit']=qs['limit'](_0xe7930e['query']['limit']);_0x1e88d0[_0x50d8('0x1e')]=qs[_0x50d8('0x1e')](_0xe7930e[_0x50d8('0x31')][_0x50d8('0x1e')]);}_0x1e88d0['order']=qs[_0x50d8('0x39')](_0xe7930e[_0x50d8('0x31')]['sort']);_0x1e88d0['where']=qs[_0x50d8('0x3a')](_[_0x50d8('0x3b')](_0xe7930e['query'],_0x458296['filters']),_0xd05f5f);if(_0xe7930e['query'][_0x50d8('0x3c')]){_0x1e88d0['where']=_[_0x50d8('0x3d')](_0x1e88d0['where'],{'$or':_[_0x50d8('0x2d')](_0xd05f5f,function(_0xdd5f28){if(_0xdd5f28['type']!=='VIRTUAL'){var _0x27c988={};_0x27c988[_0xdd5f28[_0x50d8('0x2a')]]={'$like':'%'+_0xe7930e[_0x50d8('0x31')][_0x50d8('0x3c')]+'%'};return _0x27c988;}})});}_0x1e88d0=_[_0x50d8('0x3d')]({},_0x1e88d0,_0xe7930e[_0x50d8('0x3e')]);var _0x11a5ab={'where':_0x1e88d0[_0x50d8('0x3f')]};return db[_0x50d8('0x2e')][_0x50d8('0x21')](_0x11a5ab)['then'](function(_0x47874a){_0x2af99c[_0x50d8('0x21')]=_0x47874a;if(_0xe7930e['query']['includeAll']){_0x1e88d0[_0x50d8('0x40')]=[{'all':!![]}];}return db[_0x50d8('0x2e')][_0x50d8('0x41')](_0x1e88d0);})[_0x50d8('0x26')](function(_0x40eba8){_0x2af99c[_0x50d8('0x42')]=_0x40eba8;return _0x2af99c;})[_0x50d8('0x26')](respondWithFilteredResult(_0x3e8b23,_0x1e88d0))[_0x50d8('0x43')](handleError(_0x3e8b23,null));};exports[_0x50d8('0x44')]=function(_0x3efcf4,_0x2fb551){var _0x25390c={'raw':!![],'where':{'id':_0x3efcf4[_0x50d8('0x45')]['id']}},_0x1ddb63={};_0x1ddb63[_0x50d8('0x34')]=_['keys'](db[_0x50d8('0x2e')][_0x50d8('0x46')]);_0x1ddb63[_0x50d8('0x31')]=_[_0x50d8('0x32')](_0x3efcf4['query']);_0x1ddb63[_0x50d8('0x3a')]=_['intersection'](_0x1ddb63[_0x50d8('0x34')],_0x1ddb63[_0x50d8('0x31')]);_0x25390c[_0x50d8('0x36')]=_[_0x50d8('0x33')](_0x1ddb63[_0x50d8('0x34')],qs[_0x50d8('0x35')](_0x3efcf4['query'][_0x50d8('0x35')]));_0x25390c[_0x50d8('0x36')]=_0x25390c[_0x50d8('0x36')][_0x50d8('0x47')]?_0x25390c[_0x50d8('0x36')]:_0x1ddb63[_0x50d8('0x34')];if(_0x3efcf4[_0x50d8('0x31')][_0x50d8('0x48')]){_0x25390c[_0x50d8('0x40')]=[{'all':!![]}];}_0x25390c=_[_0x50d8('0x3d')]({},_0x25390c,_0x3efcf4[_0x50d8('0x3e')]);return db[_0x50d8('0x2e')]['find'](_0x25390c)[_0x50d8('0x26')](handleEntityNotFound(_0x2fb551,null))[_0x50d8('0x26')](respondWithResult(_0x2fb551,null))[_0x50d8('0x43')](handleError(_0x2fb551,null));};exports[_0x50d8('0x49')]=function(_0x37af48,_0x236699){return db[_0x50d8('0x2e')][_0x50d8('0x49')](_0x37af48['body'],{})[_0x50d8('0x26')](respondWithResult(_0x236699,0xc9))['catch'](handleError(_0x236699,null));};exports[_0x50d8('0x25')]=function(_0x2ad1bf,_0x3ef881){if(_0x2ad1bf[_0x50d8('0x4a')]['id']){delete _0x2ad1bf['body']['id'];}return db[_0x50d8('0x2e')]['find']({'where':{'id':_0x2ad1bf[_0x50d8('0x45')]['id']}})[_0x50d8('0x26')](handleEntityNotFound(_0x3ef881,null))[_0x50d8('0x26')](saveUpdates(_0x2ad1bf[_0x50d8('0x4a')],null))[_0x50d8('0x26')](respondWithResult(_0x3ef881,null))[_0x50d8('0x43')](handleError(_0x3ef881,null));};exports[_0x50d8('0x27')]=function(_0x501bfe,_0x2a3642){return db[_0x50d8('0x2e')][_0x50d8('0x4b')]({'where':{'id':_0x501bfe[_0x50d8('0x45')]['id']}})[_0x50d8('0x26')](handleEntityNotFound(_0x2a3642,null))[_0x50d8('0x26')](removeEntity(_0x2a3642,null))['catch'](handleError(_0x2a3642,null));};exports[_0x50d8('0x4c')]=function(_0x4a906e,_0x399116){return db[_0x50d8('0x2e')][_0x50d8('0x4c')]()['then'](respondWithResult(_0x399116,null))[_0x50d8('0x43')](handleError(_0x399116,null));}; \ No newline at end of file +var _0x14f5=['api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','MailSubstatus','then','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4a9421,_0x157e8c){var _0x49d7f2=function(_0x5db072){while(--_0x5db072){_0x4a9421['push'](_0x4a9421['shift']());}};_0x49d7f2(++_0x157e8c);}(_0x14f5,0x118));var _0x514f=function(_0x5c1e60,_0x55c99d){_0x5c1e60=_0x5c1e60-0x0;var _0x331093=_0x14f5[_0x5c1e60];return _0x331093;};'use strict';var emlformat=require(_0x514f('0x0'));var rimraf=require(_0x514f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x514f('0x2'));var rp=require('request-promise');var moment=require(_0x514f('0x3'));var BPromise=require(_0x514f('0x4'));var Mustache=require('mustache');var util=require(_0x514f('0x5'));var path=require(_0x514f('0x6'));var sox=require(_0x514f('0x7'));var csv=require(_0x514f('0x8'));var ejs=require(_0x514f('0x9'));var fs=require('fs');var fs_extra=require(_0x514f('0xa'));var _=require(_0x514f('0xb'));var squel=require(_0x514f('0xc'));var crypto=require(_0x514f('0xd'));var jsforce=require(_0x514f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x514f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x514f('0xf'));var authService=require(_0x514f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x514f('0x11'));var hardwareService=require(_0x514f('0x12'));var logger=require(_0x514f('0x13'))(_0x514f('0x14'));var utils=require(_0x514f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x514f('0x16'));var db=require(_0x514f('0x17'))['db'];function respondWithStatusCode(_0x1eca5b,_0xdc42fd){_0xdc42fd=_0xdc42fd||0xcc;return function(_0x4743b1){if(_0x4743b1){return _0x1eca5b['sendStatus'](_0xdc42fd);}return _0x1eca5b[_0x514f('0x18')](_0xdc42fd)[_0x514f('0x19')]();};}function respondWithResult(_0x5c1abd,_0x2650c1){_0x2650c1=_0x2650c1||0xc8;return function(_0x1de323){if(_0x1de323){return _0x5c1abd[_0x514f('0x18')](_0x2650c1)[_0x514f('0x1a')](_0x1de323);}};}function respondWithFilteredResult(_0x491983,_0x5ebc13){return function(_0x3f1237){if(_0x3f1237){var _0x11a42e=typeof _0x5ebc13[_0x514f('0x1b')]==='undefined'&&typeof _0x5ebc13[_0x514f('0x1c')]===_0x514f('0x1d');var _0x376a49=_0x3f1237['count'];var _0x45cbce=_0x11a42e?0x0:_0x5ebc13[_0x514f('0x1b')];var _0x460922=_0x11a42e?_0x3f1237[_0x514f('0x1e')]:_0x5ebc13[_0x514f('0x1b')]+_0x5ebc13[_0x514f('0x1c')];var _0x449237;if(_0x460922>=_0x376a49){_0x460922=_0x376a49;_0x449237=0xc8;}else{_0x449237=0xce;}_0x491983[_0x514f('0x18')](_0x449237);return _0x491983[_0x514f('0x1f')](_0x514f('0x20'),_0x45cbce+'-'+_0x460922+'/'+_0x376a49)['json'](_0x3f1237);}return null;};}function patchUpdates(_0x2b5f98){return function(_0x36dade){try{jsonpatch['apply'](_0x36dade,_0x2b5f98,!![]);}catch(_0x10f60e){return BPromise[_0x514f('0x21')](_0x10f60e);}return _0x36dade[_0x514f('0x22')]();};}function saveUpdates(_0x58de75,_0xba42a3){return function(_0x645a18){if(_0x645a18){return _0x645a18[_0x514f('0x23')](_0x58de75)['then'](function(_0xa3ab17){return _0xa3ab17;});}return null;};}function removeEntity(_0x28206e,_0x642fc0){return function(_0x361670){if(_0x361670){return _0x361670[_0x514f('0x24')]()['then'](function(){_0x28206e[_0x514f('0x18')](0xcc)[_0x514f('0x19')]();});}};}function handleEntityNotFound(_0x442f2,_0x4f9115){return function(_0x22eaea){if(!_0x22eaea){_0x442f2[_0x514f('0x25')](0x194);}return _0x22eaea;};}function handleError(_0x182a82,_0x11fbff){_0x11fbff=_0x11fbff||0x1f4;return function(_0x3a1f33){logger[_0x514f('0x26')](_0x3a1f33[_0x514f('0x27')]);if(_0x3a1f33[_0x514f('0x28')]){delete _0x3a1f33[_0x514f('0x28')];}_0x182a82[_0x514f('0x18')](_0x11fbff)['send'](_0x3a1f33);};}exports['index']=function(_0x51c824,_0x28229f){var _0x4ac578={},_0xd425dc={},_0x5499df={'count':0x0,'rows':[]};var _0xb9c3bb=_[_0x514f('0x29')](db['MailSubstatus'][_0x514f('0x2a')],function(_0x4f6ced){return{'name':_0x4f6ced[_0x514f('0x2b')],'type':_0x4f6ced[_0x514f('0x2c')]['key']};});_0xd425dc[_0x514f('0x2d')]=_[_0x514f('0x29')](_0xb9c3bb,_0x514f('0x28'));_0xd425dc[_0x514f('0x2e')]=_[_0x514f('0x2f')](_0x51c824[_0x514f('0x2e')]);_0xd425dc[_0x514f('0x30')]=_[_0x514f('0x31')](_0xd425dc[_0x514f('0x2d')],_0xd425dc[_0x514f('0x2e')]);_0x4ac578[_0x514f('0x32')]=_[_0x514f('0x31')](_0xd425dc[_0x514f('0x2d')],qs[_0x514f('0x33')](_0x51c824[_0x514f('0x2e')]['fields']));_0x4ac578[_0x514f('0x32')]=_0x4ac578[_0x514f('0x32')][_0x514f('0x34')]?_0x4ac578[_0x514f('0x32')]:_0xd425dc[_0x514f('0x2d')];if(!_0x51c824['query'][_0x514f('0x35')](_0x514f('0x36'))){_0x4ac578[_0x514f('0x1c')]=qs[_0x514f('0x1c')](_0x51c824[_0x514f('0x2e')][_0x514f('0x1c')]);_0x4ac578['offset']=qs[_0x514f('0x1b')](_0x51c824[_0x514f('0x2e')][_0x514f('0x1b')]);}_0x4ac578[_0x514f('0x37')]=qs[_0x514f('0x38')](_0x51c824[_0x514f('0x2e')][_0x514f('0x38')]);_0x4ac578['where']=qs[_0x514f('0x30')](_[_0x514f('0x39')](_0x51c824['query'],_0xd425dc[_0x514f('0x30')]),_0xb9c3bb);if(_0x51c824['query'][_0x514f('0x3a')]){_0x4ac578[_0x514f('0x3b')]=_['merge'](_0x4ac578[_0x514f('0x3b')],{'$or':_[_0x514f('0x29')](_0xb9c3bb,function(_0x378829){if(_0x378829[_0x514f('0x2c')]!==_0x514f('0x3c')){var _0x3a8049={};_0x3a8049[_0x378829[_0x514f('0x28')]]={'$like':'%'+_0x51c824[_0x514f('0x2e')][_0x514f('0x3a')]+'%'};return _0x3a8049;}})});}_0x4ac578=_[_0x514f('0x3d')]({},_0x4ac578,_0x51c824[_0x514f('0x3e')]);var _0x5af4b0={'where':_0x4ac578[_0x514f('0x3b')]};return db[_0x514f('0x3f')][_0x514f('0x1e')](_0x5af4b0)[_0x514f('0x40')](function(_0x16513e){_0x5499df[_0x514f('0x1e')]=_0x16513e;if(_0x51c824[_0x514f('0x2e')][_0x514f('0x41')]){_0x4ac578[_0x514f('0x42')]=[{'all':!![]}];}return db[_0x514f('0x3f')][_0x514f('0x43')](_0x4ac578);})[_0x514f('0x40')](function(_0x4d81b1){_0x5499df[_0x514f('0x44')]=_0x4d81b1;return _0x5499df;})[_0x514f('0x40')](respondWithFilteredResult(_0x28229f,_0x4ac578))[_0x514f('0x45')](handleError(_0x28229f,null));};exports['show']=function(_0x4db1ed,_0x2adc03){var _0x490740={'raw':!![],'where':{'id':_0x4db1ed[_0x514f('0x46')]['id']}},_0x3fe2bd={};_0x3fe2bd['model']=_[_0x514f('0x2f')](db[_0x514f('0x3f')][_0x514f('0x2a')]);_0x3fe2bd[_0x514f('0x2e')]=_['keys'](_0x4db1ed[_0x514f('0x2e')]);_0x3fe2bd['filters']=_[_0x514f('0x31')](_0x3fe2bd[_0x514f('0x2d')],_0x3fe2bd[_0x514f('0x2e')]);_0x490740[_0x514f('0x32')]=_[_0x514f('0x31')](_0x3fe2bd['model'],qs[_0x514f('0x33')](_0x4db1ed[_0x514f('0x2e')][_0x514f('0x33')]));_0x490740[_0x514f('0x32')]=_0x490740['attributes'][_0x514f('0x34')]?_0x490740['attributes']:_0x3fe2bd['model'];if(_0x4db1ed['query']['includeAll']){_0x490740[_0x514f('0x42')]=[{'all':!![]}];}_0x490740=_[_0x514f('0x3d')]({},_0x490740,_0x4db1ed['options']);return db[_0x514f('0x3f')][_0x514f('0x47')](_0x490740)[_0x514f('0x40')](handleEntityNotFound(_0x2adc03,null))[_0x514f('0x40')](respondWithResult(_0x2adc03,null))[_0x514f('0x45')](handleError(_0x2adc03,null));};exports[_0x514f('0x48')]=function(_0x310a0e,_0xa40c8e){return db[_0x514f('0x3f')][_0x514f('0x48')](_0x310a0e[_0x514f('0x49')],{})[_0x514f('0x40')](respondWithResult(_0xa40c8e,0xc9))['catch'](handleError(_0xa40c8e,null));};exports[_0x514f('0x23')]=function(_0x58b556,_0x4a06ec){if(_0x58b556[_0x514f('0x49')]['id']){delete _0x58b556[_0x514f('0x49')]['id'];}return db['MailSubstatus'][_0x514f('0x47')]({'where':{'id':_0x58b556['params']['id']}})['then'](handleEntityNotFound(_0x4a06ec,null))[_0x514f('0x40')](saveUpdates(_0x58b556[_0x514f('0x49')],null))[_0x514f('0x40')](respondWithResult(_0x4a06ec,null))[_0x514f('0x45')](handleError(_0x4a06ec,null));};exports[_0x514f('0x24')]=function(_0x49be0f,_0x2981e7){return db[_0x514f('0x3f')][_0x514f('0x47')]({'where':{'id':_0x49be0f[_0x514f('0x46')]['id']}})[_0x514f('0x40')](handleEntityNotFound(_0x2981e7,null))[_0x514f('0x40')](removeEntity(_0x2981e7,null))[_0x514f('0x45')](handleError(_0x2981e7,null));};exports[_0x514f('0x4a')]=function(_0x11c0c3,_0x307670){return db[_0x514f('0x3f')][_0x514f('0x4a')]()[_0x514f('0x40')](respondWithResult(_0x307670,null))[_0x514f('0x45')](handleError(_0x307670,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index f475c8b..54ac830 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 _0x2bb8=['emit','hasOwnProperty','hook','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x4df337,_0x3bf41d){var _0x4a1c4e=function(_0x248214){while(--_0x248214){_0x4df337['push'](_0x4df337['shift']());}};_0x4a1c4e(++_0x3bf41d);}(_0x2bb8,0x10b));var _0x82bb=function(_0x3c922a,_0x2c4663){_0x3c922a=_0x3c922a-0x0;var _0x32ca71=_0x2bb8[_0x3c922a];return _0x32ca71;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x82bb('0x0'))['db'][_0x82bb('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x82bb('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x4bcafe){return function(_0x4dac06,_0x3aa964,_0x442b40){MailSubstatusEvents[_0x82bb('0x3')](_0x4bcafe+':'+_0x4dac06['id'],_0x4dac06);MailSubstatusEvents['emit'](_0x4bcafe,_0x4dac06);_0x442b40(null);};}for(var e in events){if(events[_0x82bb('0x4')](e)){var event=events[e];MailSubstatus[_0x82bb('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x9aac=['update','emit','hasOwnProperty','hook','exports','MailSubstatus'];(function(_0x564cf3,_0x595b52){var _0x9cd21e=function(_0x2ca13e){while(--_0x2ca13e){_0x564cf3['push'](_0x564cf3['shift']());}};_0x9cd21e(++_0x595b52);}(_0x9aac,0x1af));var _0xc9aa=function(_0x4e13ce,_0x33d081){_0x4e13ce=_0x4e13ce-0x0;var _0x44f4fa=_0x9aac[_0x4e13ce];return _0x44f4fa;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0xc9aa('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xc9aa('0x1')};function emitEvent(_0x58bdb3){return function(_0x171653,_0xff4608,_0x17a869){MailSubstatusEvents[_0xc9aa('0x2')](_0x58bdb3+':'+_0x171653['id'],_0x171653);MailSubstatusEvents[_0xc9aa('0x2')](_0x58bdb3,_0x171653);_0x17a869(null);};}for(var e in events){if(events[_0xc9aa('0x3')](e)){var event=events[e];MailSubstatus[_0xc9aa('0x4')](e,emitEvent(event));}}module[_0xc9aa('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 466a876..8e71b44 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 _0xc0f6=['./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','Condition','mailSubstatus','_previousDataValues','name','then'];(function(_0x2f1e33,_0x3b6dac){var _0x36732d=function(_0x1c6b70){while(--_0x1c6b70){_0x2f1e33['push'](_0x2f1e33['shift']());}};_0x36732d(++_0x3b6dac);}(_0xc0f6,0x1ea));var _0x6c0f=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xc0f6[_0x280ae7];return _0x418b9e;};'use strict';var attributes=require(_0x6c0f('0x0'));module[_0x6c0f('0x1')]=function(_0x5cb033){var _0x35d723=_0x5cb033['models'];return _0x5cb033[_0x6c0f('0x2')](_0x6c0f('0x3'),attributes,{'tableName':_0x6c0f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x44f393,_0x1f6880,_0x4492ad){return _0x35d723[_0x6c0f('0x5')]['update']({'value':_0x44f393['name']},{'where':{'field':_0x6c0f('0x6'),'value':_0x44f393[_0x6c0f('0x7')][_0x6c0f('0x8')]}})[_0x6c0f('0x9')](function(){_0x4492ad();})['catch'](function(_0x3e50d7){_0x4492ad(_0x3e50d7);});}}});}; \ No newline at end of file +var _0x8c8f=['./mailSubstatus.attributes','name','mailSubstatus','_previousDataValues','then','catch'];(function(_0x584f10,_0x93b820){var _0x77ba37=function(_0x47d0f2){while(--_0x47d0f2){_0x584f10['push'](_0x584f10['shift']());}};_0x77ba37(++_0x93b820);}(_0x8c8f,0x1e6));var _0xf8c8=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x8c8f[_0x4b2436];return _0x4f5ab2;};'use strict';var attributes=require(_0xf8c8('0x0'));module['exports']=function(_0x3c9ffe){var _0x5c1fe1=_0x3c9ffe['models'];return _0x3c9ffe['define']('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5f25fe,_0x22f13f,_0x5f1880){return _0x5c1fe1['Condition']['update']({'value':_0x5f25fe[_0xf8c8('0x1')]},{'where':{'field':_0xf8c8('0x2'),'value':_0x5f25fe[_0xf8c8('0x3')][_0xf8c8('0x1')]}})[_0xf8c8('0x4')](function(){_0x5f1880();})[_0xf8c8('0x5')](function(_0x24dbf1){_0x5f1880(_0x24dbf1);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index ea75f57..4fc684a 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 _0xa623=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x5e6889,_0x3aabb7){var _0x14fd63=function(_0xfc743){while(--_0xfc743){_0x5e6889['push'](_0x5e6889['shift']());}};_0x14fd63(++_0x3aabb7);}(_0xa623,0x1b1));var _0x3a62=function(_0x1bf4c0,_0x5c688f){_0x1bf4c0=_0x1bf4c0-0x0;var _0x101186=_0xa623[_0x1bf4c0];return _0x101186;};'use strict';var _=require('lodash');var util=require(_0x3a62('0x0'));var moment=require(_0x3a62('0x1'));var BPromise=require(_0x3a62('0x2'));var rs=require(_0x3a62('0x3'));var fs=require('fs');var Redis=require(_0x3a62('0x4'));var db=require(_0x3a62('0x5'))['db'];var utils=require(_0x3a62('0x6'));var logger=require(_0x3a62('0x7'))(_0x3a62('0x8'));var config=require(_0x3a62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3a62('0xa')][_0x3a62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x302220,_0x3808bc,_0x1f0065){return new BPromise(function(_0x4c0a40,_0x37c32b){return client[_0x3a62('0xc')](_0x302220,_0x1f0065)['then'](function(_0x5d0d3b){logger[_0x3a62('0xd')](_0x3a62('0xe'),_0x3808bc,'request\x20sent');logger[_0x3a62('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x3808bc,_0x3a62('0x10'),JSON[_0x3a62('0x11')](_0x5d0d3b));if(_0x5d0d3b[_0x3a62('0x12')]){if(_0x5d0d3b[_0x3a62('0x12')][_0x3a62('0x13')]===0x1f4){logger[_0x3a62('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x3808bc,_0x5d0d3b['error'][_0x3a62('0x14')]);return _0x37c32b(_0x5d0d3b[_0x3a62('0x12')][_0x3a62('0x14')]);}logger[_0x3a62('0x12')](_0x3a62('0xe'),_0x3808bc,_0x5d0d3b[_0x3a62('0x12')]['message']);return _0x4c0a40(_0x5d0d3b[_0x3a62('0x12')][_0x3a62('0x14')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x3808bc,_0x3a62('0x10'));_0x4c0a40(_0x5d0d3b[_0x3a62('0x15')][_0x3a62('0x14')]);}})[_0x3a62('0x16')](function(_0x372261){logger['error'](_0x3a62('0xe'),_0x3808bc,_0x372261);_0x37c32b(_0x372261);});});} \ No newline at end of file +var _0xbe4f=['../../config/environment','jayson/promise','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbe4f,0x121));var _0xfbe4=function(_0x25ba51,_0x407b6d){_0x25ba51=_0x25ba51-0x0;var _0xc2e236=_0xbe4f[_0x25ba51];return _0xc2e236;};'use strict';var _=require(_0xfbe4('0x0'));var util=require(_0xfbe4('0x1'));var moment=require(_0xfbe4('0x2'));var BPromise=require(_0xfbe4('0x3'));var rs=require(_0xfbe4('0x4'));var fs=require('fs');var Redis=require(_0xfbe4('0x5'));var db=require(_0xfbe4('0x6'))['db'];var utils=require(_0xfbe4('0x7'));var logger=require(_0xfbe4('0x8'))(_0xfbe4('0x9'));var config=require(_0xfbe4('0xa'));var jayson=require(_0xfbe4('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x421139,_0x1aac90,_0x24cad1){return new BPromise(function(_0x47b823,_0x5cf614){return client['request'](_0x421139,_0x24cad1)[_0xfbe4('0xc')](function(_0x3ff1f1){logger[_0xfbe4('0xd')](_0xfbe4('0xe'),_0x1aac90,_0xfbe4('0xf'));logger['debug'](_0xfbe4('0x10'),_0x1aac90,_0xfbe4('0xf'),JSON[_0xfbe4('0x11')](_0x3ff1f1));if(_0x3ff1f1['error']){if(_0x3ff1f1[_0xfbe4('0x12')][_0xfbe4('0x13')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x1aac90,_0x3ff1f1[_0xfbe4('0x12')][_0xfbe4('0x14')]);return _0x5cf614(_0x3ff1f1[_0xfbe4('0x12')][_0xfbe4('0x14')]);}logger[_0xfbe4('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x1aac90,_0x3ff1f1['error'][_0xfbe4('0x14')]);return _0x47b823(_0x3ff1f1[_0xfbe4('0x12')][_0xfbe4('0x14')]);}else{logger[_0xfbe4('0xd')](_0xfbe4('0xe'),_0x1aac90,_0xfbe4('0xf'));_0x47b823(_0x3ff1f1[_0xfbe4('0x15')][_0xfbe4('0x14')]);}})[_0xfbe4('0x16')](function(_0x3322e1){logger[_0xfbe4('0x12')](_0xfbe4('0xe'),_0x1aac90,_0x3322e1);_0x5cf614(_0x3322e1);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index af7f85e..2d44312 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 _0xca33=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id','isAuthenticated','show','post','update','delete','exports','multer'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xca33,0x6b));var _0x3ca3=function(_0x23a3a5,_0x5ca1fe){_0x23a3a5=_0x23a3a5-0x0;var _0x4ef29e=_0xca33[_0x23a3a5];return _0x4ef29e;};'use strict';var multer=require(_0x3ca3('0x0'));var util=require(_0x3ca3('0x1'));var path=require(_0x3ca3('0x2'));var timeout=require(_0x3ca3('0x3'));var express=require(_0x3ca3('0x4'));var router=express['Router']();var fs_extra=require(_0x3ca3('0x5'));var auth=require(_0x3ca3('0x6'));var interaction=require(_0x3ca3('0x7'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0x3ca3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3ca3('0x9'),auth['isAuthenticated'](),controller[_0x3ca3('0xa')]);router['get'](_0x3ca3('0xb'),auth[_0x3ca3('0xc')](),controller[_0x3ca3('0xd')]);router[_0x3ca3('0xe')]('/',auth[_0x3ca3('0xc')](),controller['create']);router['put']('/:id',auth[_0x3ca3('0xc')](),controller[_0x3ca3('0xf')]);router[_0x3ca3('0x10')](_0x3ca3('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3ca3('0x11')]=router; \ No newline at end of file +var _0xb67c=['describe','post','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x5b21a2,_0x2c6461){var _0x57166b=function(_0x2c0c1a){while(--_0x2c0c1a){_0x5b21a2['push'](_0x5b21a2['shift']());}};_0x57166b(++_0x2c6461);}(_0xb67c,0x94));var _0xcb67=function(_0x20e81e,_0x2ad41f){_0x20e81e=_0x20e81e-0x0;var _0x3e6654=_0xb67c[_0x20e81e];return _0x3e6654;};'use strict';var multer=require(_0xcb67('0x0'));var util=require(_0xcb67('0x1'));var path=require(_0xcb67('0x2'));var timeout=require(_0xcb67('0x3'));var express=require(_0xcb67('0x4'));var router=express[_0xcb67('0x5')]();var fs_extra=require(_0xcb67('0x6'));var auth=require(_0xcb67('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcb67('0x8'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0xcb67('0x9')](),controller[_0xcb67('0xa')]);router[_0xcb67('0xb')]('/describe',auth[_0xcb67('0x9')](),controller[_0xcb67('0xc')]);router[_0xcb67('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcb67('0xd')]('/',auth[_0xcb67('0x9')](),controller[_0xcb67('0xe')]);router[_0xcb67('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcb67('0x10')]);router[_0xcb67('0x11')](_0xcb67('0x12'),auth[_0xcb67('0x9')](),controller['destroy']);module[_0xcb67('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 6091c47..a1195d2 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x9bde,0xe1));var _0xe9bd=function(_0x21b27f,_0x3c3692){_0x21b27f=_0x21b27f-0x0;var _0xefcf49=_0x9bde[_0x21b27f];return _0xefcf49;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x47c919,_0x37ff1f){var _0x2e808b=function(_0x50770d){while(--_0x50770d){_0x47c919['push'](_0x47c919['shift']());}};_0x2e808b(++_0x37ff1f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x00bb[_0x1facfa];return _0x9ec701;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ddfb82a..5e3afe6 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 _0xd017=['status','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd017,0x1b0));var _0x7d01=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xd017[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0x7d01('0x0'));var rimraf=require(_0x7d01('0x1'));var zipdir=require(_0x7d01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d01('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d01('0x4'));var path=require(_0x7d01('0x5'));var sox=require(_0x7d01('0x6'));var csv=require(_0x7d01('0x7'));var ejs=require(_0x7d01('0x8'));var fs=require('fs');var fs_extra=require(_0x7d01('0x9'));var _=require(_0x7d01('0xa'));var squel=require(_0x7d01('0xb'));var crypto=require(_0x7d01('0xc'));var jsforce=require(_0x7d01('0xd'));var deskjs=require(_0x7d01('0xe'));var toCsv=require(_0x7d01('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d01('0xf'));var qs=require(_0x7d01('0x10'));var as=require(_0x7d01('0x11'));var hardwareService=require(_0x7d01('0x12'));var logger=require(_0x7d01('0x13'))(_0x7d01('0x14'));var utils=require(_0x7d01('0x15'));var config=require(_0x7d01('0x16'));var licenseUtil=require(_0x7d01('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2685f7,_0x3107c3){_0x3107c3=_0x3107c3||0xcc;return function(_0x1121b0){if(_0x1121b0){return _0x2685f7['sendStatus'](_0x3107c3);}return _0x2685f7['status'](_0x3107c3)['end']();};}function respondWithResult(_0x1c0993,_0xa45e44){_0xa45e44=_0xa45e44||0xc8;return function(_0x127d8d){if(_0x127d8d){return _0x1c0993[_0x7d01('0x18')](_0xa45e44)[_0x7d01('0x19')](_0x127d8d);}};}function respondWithFilteredResult(_0x3690b6,_0x29420){return function(_0x36abe1){if(_0x36abe1){var _0x260606=typeof _0x29420[_0x7d01('0x1a')]==='undefined'&&typeof _0x29420[_0x7d01('0x1b')]===_0x7d01('0x1c');var _0x518ed8=_0x36abe1['count'];var _0x75ad0b=_0x260606?0x0:_0x29420[_0x7d01('0x1a')];var _0x45476a=_0x260606?_0x36abe1['count']:_0x29420[_0x7d01('0x1a')]+_0x29420[_0x7d01('0x1b')];var _0x3f4242;if(_0x45476a>=_0x518ed8){_0x45476a=_0x518ed8;_0x3f4242=0xc8;}else{_0x3f4242=0xce;}_0x3690b6['status'](_0x3f4242);return _0x3690b6[_0x7d01('0x1d')]('Content-Range',_0x75ad0b+'-'+_0x45476a+'/'+_0x518ed8)['json'](_0x36abe1);}return null;};}function patchUpdates(_0x41d1fa){return function(_0x88afcd){try{jsonpatch[_0x7d01('0x1e')](_0x88afcd,_0x41d1fa,!![]);}catch(_0x533a54){return BPromise[_0x7d01('0x1f')](_0x533a54);}return _0x88afcd[_0x7d01('0x20')]();};}function saveUpdates(_0x3ad692,_0x3cc583){return function(_0x473a79){if(_0x473a79){return _0x473a79[_0x7d01('0x21')](_0x3ad692)[_0x7d01('0x22')](function(_0x1f0380){return _0x1f0380;});}return null;};}function removeEntity(_0x4c0c30,_0x618ab9){return function(_0x56f377){if(_0x56f377){return _0x56f377[_0x7d01('0x23')]()['then'](function(){_0x4c0c30[_0x7d01('0x18')](0xcc)[_0x7d01('0x24')]();});}};}function handleEntityNotFound(_0x11ad14,_0x1c1f6a){return function(_0x1e5f50){if(!_0x1e5f50){_0x11ad14[_0x7d01('0x25')](0x194);}return _0x1e5f50;};}function handleError(_0xa1866,_0x497b45){_0x497b45=_0x497b45||0x1f4;return function(_0xdc21bf){logger[_0x7d01('0x26')](_0xdc21bf[_0x7d01('0x27')]);if(_0xdc21bf['name']){delete _0xdc21bf[_0x7d01('0x28')];}_0xa1866[_0x7d01('0x18')](_0x497b45)['send'](_0xdc21bf);};}exports[_0x7d01('0x29')]=function(_0x372b39,_0x2c781b){var _0x7bf035={},_0x527577={},_0x15ac28={'count':0x0,'rows':[]};var _0x3a7c9a=_[_0x7d01('0x2a')](db['MailTransferReport'][_0x7d01('0x2b')],function(_0x5b1a52){return{'name':_0x5b1a52['fieldName'],'type':_0x5b1a52[_0x7d01('0x2c')][_0x7d01('0x2d')]};});_0x527577['model']=_['map'](_0x3a7c9a,_0x7d01('0x28'));_0x527577[_0x7d01('0x2e')]=_[_0x7d01('0x2f')](_0x372b39['query']);_0x527577[_0x7d01('0x30')]=_[_0x7d01('0x31')](_0x527577[_0x7d01('0x32')],_0x527577['query']);_0x7bf035['attributes']=_[_0x7d01('0x31')](_0x527577[_0x7d01('0x32')],qs[_0x7d01('0x33')](_0x372b39[_0x7d01('0x2e')][_0x7d01('0x33')]));_0x7bf035['attributes']=_0x7bf035[_0x7d01('0x34')][_0x7d01('0x35')]?_0x7bf035[_0x7d01('0x34')]:_0x527577[_0x7d01('0x32')];if(!_0x372b39[_0x7d01('0x2e')][_0x7d01('0x36')]('nolimit')){_0x7bf035[_0x7d01('0x1b')]=qs[_0x7d01('0x1b')](_0x372b39['query'][_0x7d01('0x1b')]);_0x7bf035[_0x7d01('0x1a')]=qs[_0x7d01('0x1a')](_0x372b39[_0x7d01('0x2e')][_0x7d01('0x1a')]);}_0x7bf035[_0x7d01('0x37')]=qs[_0x7d01('0x38')](_0x372b39[_0x7d01('0x2e')][_0x7d01('0x38')]);_0x7bf035['where']=qs[_0x7d01('0x30')](_[_0x7d01('0x39')](_0x372b39[_0x7d01('0x2e')],_0x527577['filters']),_0x3a7c9a);if(_0x372b39['query'][_0x7d01('0x3a')]){_0x7bf035['where']=_[_0x7d01('0x3b')](_0x7bf035[_0x7d01('0x3c')],{'$or':_['map'](_0x3a7c9a,function(_0x337b90){if(_0x337b90[_0x7d01('0x2c')]!==_0x7d01('0x3d')){var _0x160ce7={};_0x160ce7[_0x337b90[_0x7d01('0x28')]]={'$like':'%'+_0x372b39['query'][_0x7d01('0x3a')]+'%'};return _0x160ce7;}})});}_0x7bf035=_[_0x7d01('0x3b')]({},_0x7bf035,_0x372b39[_0x7d01('0x3e')]);var _0x47eddc={'where':_0x7bf035['where']};return db[_0x7d01('0x3f')][_0x7d01('0x40')](_0x47eddc)['then'](function(_0x458753){_0x15ac28['count']=_0x458753;if(_0x372b39[_0x7d01('0x2e')][_0x7d01('0x41')]){_0x7bf035[_0x7d01('0x42')]=[{'all':!![]}];}return db[_0x7d01('0x3f')][_0x7d01('0x43')](_0x7bf035);})[_0x7d01('0x22')](function(_0x37e4d1){_0x15ac28[_0x7d01('0x44')]=_0x37e4d1;return _0x15ac28;})['then'](respondWithFilteredResult(_0x2c781b,_0x7bf035))[_0x7d01('0x45')](handleError(_0x2c781b,null));};exports[_0x7d01('0x46')]=function(_0x9ac015,_0x2630f3){var _0x5231d3={'raw':!![],'where':{'id':_0x9ac015[_0x7d01('0x47')]['id']}},_0x10ed2d={};_0x10ed2d[_0x7d01('0x32')]=_['keys'](db[_0x7d01('0x3f')][_0x7d01('0x2b')]);_0x10ed2d[_0x7d01('0x2e')]=_['keys'](_0x9ac015['query']);_0x10ed2d[_0x7d01('0x30')]=_[_0x7d01('0x31')](_0x10ed2d['model'],_0x10ed2d[_0x7d01('0x2e')]);_0x5231d3['attributes']=_[_0x7d01('0x31')](_0x10ed2d['model'],qs[_0x7d01('0x33')](_0x9ac015[_0x7d01('0x2e')][_0x7d01('0x33')]));_0x5231d3[_0x7d01('0x34')]=_0x5231d3[_0x7d01('0x34')][_0x7d01('0x35')]?_0x5231d3[_0x7d01('0x34')]:_0x10ed2d[_0x7d01('0x32')];if(_0x9ac015[_0x7d01('0x2e')]['includeAll']){_0x5231d3[_0x7d01('0x42')]=[{'all':!![]}];}_0x5231d3=_[_0x7d01('0x3b')]({},_0x5231d3,_0x9ac015[_0x7d01('0x3e')]);return db[_0x7d01('0x3f')][_0x7d01('0x48')](_0x5231d3)[_0x7d01('0x22')](handleEntityNotFound(_0x2630f3,null))['then'](respondWithResult(_0x2630f3,null))[_0x7d01('0x45')](handleError(_0x2630f3,null));};exports[_0x7d01('0x49')]=function(_0x192758,_0x1b8a4a){return db[_0x7d01('0x3f')][_0x7d01('0x49')](_0x192758[_0x7d01('0x4a')],{})['then'](respondWithResult(_0x1b8a4a,0xc9))[_0x7d01('0x45')](handleError(_0x1b8a4a,null));};exports[_0x7d01('0x21')]=function(_0x552e18,_0x6ad2fc){if(_0x552e18['body']['id']){delete _0x552e18[_0x7d01('0x4a')]['id'];}return db[_0x7d01('0x3f')][_0x7d01('0x48')]({'where':{'id':_0x552e18[_0x7d01('0x47')]['id']}})[_0x7d01('0x22')](handleEntityNotFound(_0x6ad2fc,null))['then'](saveUpdates(_0x552e18[_0x7d01('0x4a')],null))[_0x7d01('0x22')](respondWithResult(_0x6ad2fc,null))[_0x7d01('0x45')](handleError(_0x6ad2fc,null));};exports[_0x7d01('0x23')]=function(_0x2eddd7,_0x731c7a){return db[_0x7d01('0x3f')]['find']({'where':{'id':_0x2eddd7[_0x7d01('0x47')]['id']}})[_0x7d01('0x22')](handleEntityNotFound(_0x731c7a,null))[_0x7d01('0x22')](removeEntity(_0x731c7a,null))[_0x7d01('0x45')](handleError(_0x731c7a,null));};exports[_0x7d01('0x4b')]=function(_0x39247f,_0x3abc4c){return db[_0x7d01('0x3f')][_0x7d01('0x4b')]()[_0x7d01('0x22')](respondWithResult(_0x3abc4c,null))[_0x7d01('0x45')](handleError(_0x3abc4c,null));}; \ No newline at end of file +var _0x8aac=['include','findAll','params','length','includeAll','options','find','catch','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','MailTransferReport'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x8aac,0x130));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8aa('0x0'));var jsonpatch=require(_0xc8aa('0x1'));var rp=require(_0xc8aa('0x2'));var moment=require(_0xc8aa('0x3'));var BPromise=require(_0xc8aa('0x4'));var Mustache=require(_0xc8aa('0x5'));var util=require('util');var path=require(_0xc8aa('0x6'));var sox=require(_0xc8aa('0x7'));var csv=require(_0xc8aa('0x8'));var ejs=require(_0xc8aa('0x9'));var fs=require('fs');var fs_extra=require(_0xc8aa('0xa'));var _=require(_0xc8aa('0xb'));var squel=require('squel');var crypto=require(_0xc8aa('0xc'));var jsforce=require(_0xc8aa('0xd'));var deskjs=require(_0xc8aa('0xe'));var toCsv=require(_0xc8aa('0x8'));var querystring=require(_0xc8aa('0xf'));var Papa=require(_0xc8aa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc8aa('0x11'));var as=require(_0xc8aa('0x12'));var hardwareService=require(_0xc8aa('0x13'));var logger=require(_0xc8aa('0x14'))(_0xc8aa('0x15'));var utils=require(_0xc8aa('0x16'));var config=require(_0xc8aa('0x17'));var licenseUtil=require(_0xc8aa('0x18'));var db=require(_0xc8aa('0x19'))['db'];function respondWithStatusCode(_0x2346d0,_0xce603f){_0xce603f=_0xce603f||0xcc;return function(_0xefb27e){if(_0xefb27e){return _0x2346d0[_0xc8aa('0x1a')](_0xce603f);}return _0x2346d0['status'](_0xce603f)[_0xc8aa('0x1b')]();};}function respondWithResult(_0x1fae05,_0x468dfd){_0x468dfd=_0x468dfd||0xc8;return function(_0x2bf798){if(_0x2bf798){return _0x1fae05[_0xc8aa('0x1c')](_0x468dfd)['json'](_0x2bf798);}};}function respondWithFilteredResult(_0x4e0c2c,_0x560137){return function(_0x2adedd){if(_0x2adedd){var _0x369061=typeof _0x560137[_0xc8aa('0x1d')]==='undefined'&&typeof _0x560137[_0xc8aa('0x1e')]===_0xc8aa('0x1f');var _0x2a5fbd=_0x2adedd[_0xc8aa('0x20')];var _0x52a61f=_0x369061?0x0:_0x560137[_0xc8aa('0x1d')];var _0x2d2000=_0x369061?_0x2adedd[_0xc8aa('0x20')]:_0x560137[_0xc8aa('0x1d')]+_0x560137[_0xc8aa('0x1e')];var _0x26be5a;if(_0x2d2000>=_0x2a5fbd){_0x2d2000=_0x2a5fbd;_0x26be5a=0xc8;}else{_0x26be5a=0xce;}_0x4e0c2c[_0xc8aa('0x1c')](_0x26be5a);return _0x4e0c2c[_0xc8aa('0x21')](_0xc8aa('0x22'),_0x52a61f+'-'+_0x2d2000+'/'+_0x2a5fbd)['json'](_0x2adedd);}return null;};}function patchUpdates(_0x783811){return function(_0x1898bf){try{jsonpatch[_0xc8aa('0x23')](_0x1898bf,_0x783811,!![]);}catch(_0x170b8b){return BPromise[_0xc8aa('0x24')](_0x170b8b);}return _0x1898bf['save']();};}function saveUpdates(_0x2a0992,_0x607ed7){return function(_0x40c793){if(_0x40c793){return _0x40c793[_0xc8aa('0x25')](_0x2a0992)[_0xc8aa('0x26')](function(_0x4fecef){return _0x4fecef;});}return null;};}function removeEntity(_0x29372a,_0x4dffb7){return function(_0x205133){if(_0x205133){return _0x205133['destroy']()[_0xc8aa('0x26')](function(){_0x29372a['status'](0xcc)[_0xc8aa('0x1b')]();});}};}function handleEntityNotFound(_0x3d304e,_0x5e2df3){return function(_0x2bd6f9){if(!_0x2bd6f9){_0x3d304e[_0xc8aa('0x1a')](0x194);}return _0x2bd6f9;};}function handleError(_0x2f453c,_0x4c0f02){_0x4c0f02=_0x4c0f02||0x1f4;return function(_0x281e1d){logger[_0xc8aa('0x27')](_0x281e1d['stack']);if(_0x281e1d[_0xc8aa('0x28')]){delete _0x281e1d[_0xc8aa('0x28')];}_0x2f453c[_0xc8aa('0x1c')](_0x4c0f02)[_0xc8aa('0x29')](_0x281e1d);};}exports['index']=function(_0x4968f4,_0x3279e9){var _0x1594fb={},_0xf2ab9c={},_0x494728={'count':0x0,'rows':[]};var _0x349802=_[_0xc8aa('0x2a')](db['MailTransferReport'][_0xc8aa('0x2b')],function(_0x117561){return{'name':_0x117561[_0xc8aa('0x2c')],'type':_0x117561['type'][_0xc8aa('0x2d')]};});_0xf2ab9c[_0xc8aa('0x2e')]=_[_0xc8aa('0x2a')](_0x349802,_0xc8aa('0x28'));_0xf2ab9c['query']=_[_0xc8aa('0x2f')](_0x4968f4[_0xc8aa('0x30')]);_0xf2ab9c[_0xc8aa('0x31')]=_[_0xc8aa('0x32')](_0xf2ab9c[_0xc8aa('0x2e')],_0xf2ab9c[_0xc8aa('0x30')]);_0x1594fb[_0xc8aa('0x33')]=_[_0xc8aa('0x32')](_0xf2ab9c['model'],qs['fields'](_0x4968f4[_0xc8aa('0x30')][_0xc8aa('0x34')]));_0x1594fb['attributes']=_0x1594fb[_0xc8aa('0x33')]['length']?_0x1594fb['attributes']:_0xf2ab9c[_0xc8aa('0x2e')];if(!_0x4968f4[_0xc8aa('0x30')][_0xc8aa('0x35')](_0xc8aa('0x36'))){_0x1594fb['limit']=qs['limit'](_0x4968f4[_0xc8aa('0x30')]['limit']);_0x1594fb[_0xc8aa('0x1d')]=qs[_0xc8aa('0x1d')](_0x4968f4[_0xc8aa('0x30')][_0xc8aa('0x1d')]);}_0x1594fb['order']=qs[_0xc8aa('0x37')](_0x4968f4[_0xc8aa('0x30')][_0xc8aa('0x37')]);_0x1594fb[_0xc8aa('0x38')]=qs[_0xc8aa('0x31')](_[_0xc8aa('0x39')](_0x4968f4[_0xc8aa('0x30')],_0xf2ab9c[_0xc8aa('0x31')]),_0x349802);if(_0x4968f4[_0xc8aa('0x30')]['filter']){_0x1594fb[_0xc8aa('0x38')]=_['merge'](_0x1594fb['where'],{'$or':_['map'](_0x349802,function(_0x3386b4){if(_0x3386b4['type']!=='VIRTUAL'){var _0x29ae1b={};_0x29ae1b[_0x3386b4[_0xc8aa('0x28')]]={'$like':'%'+_0x4968f4[_0xc8aa('0x30')][_0xc8aa('0x3a')]+'%'};return _0x29ae1b;}})});}_0x1594fb=_[_0xc8aa('0x3b')]({},_0x1594fb,_0x4968f4['options']);var _0x3426d3={'where':_0x1594fb['where']};return db[_0xc8aa('0x3c')]['count'](_0x3426d3)['then'](function(_0x32e88d){_0x494728['count']=_0x32e88d;if(_0x4968f4[_0xc8aa('0x30')]['includeAll']){_0x1594fb[_0xc8aa('0x3d')]=[{'all':!![]}];}return db[_0xc8aa('0x3c')][_0xc8aa('0x3e')](_0x1594fb);})['then'](function(_0x4d0325){_0x494728['rows']=_0x4d0325;return _0x494728;})['then'](respondWithFilteredResult(_0x3279e9,_0x1594fb))['catch'](handleError(_0x3279e9,null));};exports['show']=function(_0x52e321,_0x18253b){var _0x45b248={'raw':!![],'where':{'id':_0x52e321[_0xc8aa('0x3f')]['id']}},_0x4d72bc={};_0x4d72bc[_0xc8aa('0x2e')]=_[_0xc8aa('0x2f')](db['MailTransferReport'][_0xc8aa('0x2b')]);_0x4d72bc[_0xc8aa('0x30')]=_['keys'](_0x52e321[_0xc8aa('0x30')]);_0x4d72bc[_0xc8aa('0x31')]=_[_0xc8aa('0x32')](_0x4d72bc['model'],_0x4d72bc[_0xc8aa('0x30')]);_0x45b248[_0xc8aa('0x33')]=_[_0xc8aa('0x32')](_0x4d72bc[_0xc8aa('0x2e')],qs[_0xc8aa('0x34')](_0x52e321[_0xc8aa('0x30')]['fields']));_0x45b248['attributes']=_0x45b248[_0xc8aa('0x33')][_0xc8aa('0x40')]?_0x45b248[_0xc8aa('0x33')]:_0x4d72bc[_0xc8aa('0x2e')];if(_0x52e321[_0xc8aa('0x30')][_0xc8aa('0x41')]){_0x45b248[_0xc8aa('0x3d')]=[{'all':!![]}];}_0x45b248=_[_0xc8aa('0x3b')]({},_0x45b248,_0x52e321[_0xc8aa('0x42')]);return db[_0xc8aa('0x3c')][_0xc8aa('0x43')](_0x45b248)[_0xc8aa('0x26')](handleEntityNotFound(_0x18253b,null))[_0xc8aa('0x26')](respondWithResult(_0x18253b,null))[_0xc8aa('0x44')](handleError(_0x18253b,null));};exports[_0xc8aa('0x45')]=function(_0x5ed88d,_0x5de48f){return db[_0xc8aa('0x3c')][_0xc8aa('0x45')](_0x5ed88d['body'],{})[_0xc8aa('0x26')](respondWithResult(_0x5de48f,0xc9))['catch'](handleError(_0x5de48f,null));};exports['update']=function(_0x43edfc,_0x1a807f){if(_0x43edfc[_0xc8aa('0x46')]['id']){delete _0x43edfc[_0xc8aa('0x46')]['id'];}return db[_0xc8aa('0x3c')]['find']({'where':{'id':_0x43edfc[_0xc8aa('0x3f')]['id']}})[_0xc8aa('0x26')](handleEntityNotFound(_0x1a807f,null))[_0xc8aa('0x26')](saveUpdates(_0x43edfc[_0xc8aa('0x46')],null))['then'](respondWithResult(_0x1a807f,null))[_0xc8aa('0x44')](handleError(_0x1a807f,null));};exports[_0xc8aa('0x47')]=function(_0x13deb8,_0x222050){return db[_0xc8aa('0x3c')][_0xc8aa('0x43')]({'where':{'id':_0x13deb8['params']['id']}})[_0xc8aa('0x26')](handleEntityNotFound(_0x222050,null))[_0xc8aa('0x26')](removeEntity(_0x222050,null))['catch'](handleError(_0x222050,null));};exports[_0xc8aa('0x48')]=function(_0x28ef50,_0x111d1e){return db['MailTransferReport'][_0xc8aa('0x48')]()[_0xc8aa('0x26')](respondWithResult(_0x111d1e,null))[_0xc8aa('0x44')](handleError(_0x111d1e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 5a404ea..c18aac0 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 _0x4b1f=['api','moment','bluebird','path','rimraf','../../config/environment','define','MailTransferReport','report_mail_transfer','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b1f,0x195));var _0xf4b1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x4b1f[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var logger=require('../../config/logger')(_0xf4b1('0x2'));var moment=require(_0xf4b1('0x3'));var BPromise=require(_0xf4b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4b1('0x5'));var rimraf=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x1ab96b,_0x4b676){return _0x1ab96b[_0xf4b1('0x8')](_0xf4b1('0x9'),attributes,{'tableName':_0xf4b1('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x1cb9,0x14e));var _0x91cb=function(_0x367f1d,_0x256556){_0x367f1d=_0x367f1d-0x0;var _0x5ef4ca=_0x1cb9[_0x367f1d];return _0x5ef4ca;};'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':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index be04de9..9731694 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 _0x3c20=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x3c20,0x150));var _0x03c2=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x3c20[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x03c2('0x0'));var rs=require(_0x03c2('0x1'));var fs=require('fs');var Redis=require(_0x03c2('0x2'));var db=require(_0x03c2('0x3'))['db'];var utils=require(_0x03c2('0x4'));var logger=require(_0x03c2('0x5'))(_0x03c2('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x03c2('0x7')][_0x03c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e5c3d,_0x355da4,_0x2221d8){return new BPromise(function(_0x345142,_0x570918){return client[_0x03c2('0x9')](_0x3e5c3d,_0x2221d8)[_0x03c2('0xa')](function(_0x2ce22f){logger[_0x03c2('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x355da4,_0x03c2('0xc'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x355da4,_0x03c2('0xc'),JSON[_0x03c2('0xd')](_0x2ce22f));if(_0x2ce22f[_0x03c2('0xe')]){if(_0x2ce22f[_0x03c2('0xe')][_0x03c2('0xf')]===0x1f4){logger[_0x03c2('0xe')](_0x03c2('0x10'),_0x355da4,_0x2ce22f[_0x03c2('0xe')][_0x03c2('0x11')]);return _0x570918(_0x2ce22f['error'][_0x03c2('0x11')]);}logger[_0x03c2('0xe')](_0x03c2('0x10'),_0x355da4,_0x2ce22f['error'][_0x03c2('0x11')]);return _0x345142(_0x2ce22f[_0x03c2('0xe')][_0x03c2('0x11')]);}else{logger['info'](_0x03c2('0x10'),_0x355da4,'request\x20sent');_0x345142(_0x2ce22f[_0x03c2('0x12')]['message']);}})[_0x03c2('0x13')](function(_0x421759){logger[_0x03c2('0xe')](_0x03c2('0x10'),_0x355da4,_0x421759);_0x570918(_0x421759);});});} \ No newline at end of file +var _0x961a=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x961a,0x1b3));var _0xa961=function(_0xd84c7,_0x596096){_0xd84c7=_0xd84c7-0x0;var _0x8bda37=_0x961a[_0xd84c7];return _0x8bda37;};'use strict';var _=require('lodash');var util=require(_0xa961('0x0'));var moment=require(_0xa961('0x1'));var BPromise=require(_0xa961('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa961('0x3'));var db=require(_0xa961('0x4'))['db'];var utils=require(_0xa961('0x5'));var logger=require(_0xa961('0x6'))(_0xa961('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa961('0x8')][_0xa961('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33257a,_0xe34040,_0x4f0de6){return new BPromise(function(_0x181739,_0x33cf41){return client['request'](_0x33257a,_0x4f0de6)[_0xa961('0xa')](function(_0x59fb81){logger['info'](_0xa961('0xb'),_0xe34040,_0xa961('0xc'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xe34040,_0xa961('0xc'),JSON[_0xa961('0xd')](_0x59fb81));if(_0x59fb81['error']){if(_0x59fb81[_0xa961('0xe')][_0xa961('0xf')]===0x1f4){logger[_0xa961('0xe')]('MailTransferReport,\x20%s,\x20%s',_0xe34040,_0x59fb81[_0xa961('0xe')][_0xa961('0x10')]);return _0x33cf41(_0x59fb81[_0xa961('0xe')]['message']);}logger[_0xa961('0xe')](_0xa961('0xb'),_0xe34040,_0x59fb81[_0xa961('0xe')][_0xa961('0x10')]);return _0x181739(_0x59fb81['error']['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0xe34040,'request\x20sent');_0x181739(_0x59fb81[_0xa961('0x11')]['message']);}})[_0xa961('0x12')](function(_0x1f84bd){logger[_0xa961('0xe')](_0xa961('0xb'),_0xe34040,_0x1f84bd);_0x33cf41(_0x1f84bd);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b70a7de..2f86368 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 _0x660b=['exports','util','path','connect-timeout','fs-extra','../../components/auth/service','./memberReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x660b,0x121));var _0xb660=function(_0x4f1467,_0x357aae){_0x4f1467=_0x4f1467-0x0;var _0x50a4ce=_0x660b[_0x4f1467];return _0x50a4ce;};'use strict';var multer=require('multer');var util=require(_0xb660('0x0'));var path=require(_0xb660('0x1'));var timeout=require(_0xb660('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb660('0x3'));var auth=require(_0xb660('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb660('0x5'));router[_0xb660('0x6')]('/',auth[_0xb660('0x7')](),controller[_0xb660('0x8')]);router[_0xb660('0x6')]('/describe',auth[_0xb660('0x7')](),controller['describe']);router['get'](_0xb660('0x9'),auth[_0xb660('0x7')](),controller[_0xb660('0xa')]);router[_0xb660('0xb')]('/',auth[_0xb660('0x7')](),controller['create']);router[_0xb660('0xc')]('/:id',auth[_0xb660('0x7')](),controller[_0xb660('0xd')]);router[_0xb660('0xe')](_0xb660('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xb660('0xf')]=router; \ No newline at end of file +var _0x204a=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x33e5d9,_0x93908f){var _0x7b8d23=function(_0x3a3841){while(--_0x3a3841){_0x33e5d9['push'](_0x33e5d9['shift']());}};_0x7b8d23(++_0x93908f);}(_0x204a,0x17d));var _0xa204=function(_0x358cf8,_0x49e227){_0x358cf8=_0x358cf8-0x0;var _0x54555b=_0x204a[_0x358cf8];return _0x54555b;};'use strict';var multer=require(_0xa204('0x0'));var util=require(_0xa204('0x1'));var path=require('path');var timeout=require(_0xa204('0x2'));var express=require('express');var router=express[_0xa204('0x3')]();var fs_extra=require(_0xa204('0x4'));var auth=require(_0xa204('0x5'));var interaction=require(_0xa204('0x6'));var config=require(_0xa204('0x7'));var controller=require(_0xa204('0x8'));router[_0xa204('0x9')]('/',auth[_0xa204('0xa')](),controller[_0xa204('0xb')]);router[_0xa204('0x9')](_0xa204('0xc'),auth[_0xa204('0xa')](),controller[_0xa204('0xd')]);router['get'](_0xa204('0xe'),auth[_0xa204('0xa')](),controller[_0xa204('0xf')]);router[_0xa204('0x10')]('/',auth[_0xa204('0xa')](),controller[_0xa204('0x11')]);router[_0xa204('0x12')]('/:id',auth[_0xa204('0xa')](),controller[_0xa204('0x13')]);router[_0xa204('0x14')](_0xa204('0xe'),auth[_0xa204('0xa')](),controller[_0xa204('0x15')]);module[_0xa204('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e8391fb..c47159a 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 _0x2999=['DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','INTEGER','sequelize','moment','STRING'];(function(_0x138c23,_0x299a8c){var _0xe1d5eb=function(_0x1364cc){while(--_0x1364cc){_0x138c23['push'](_0x138c23['shift']());}};_0xe1d5eb(++_0x299a8c);}(_0x2999,0xed));var _0x9299=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2999[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9299('0x0'));var moment=require(_0x9299('0x1'));module['exports']={'channel':{'type':Sequelize[_0x9299('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9299('0x2')]},'type':{'type':Sequelize[_0x9299('0x2')],'defaultValue':_0x9299('0x3'),'comment':_0x9299('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x9299('0x5')]},'exitAt':{'type':Sequelize[_0x9299('0x5')],'set':function(_0xb81bcb){var _0x3a37c5=moment(_0xb81bcb);var _0x485e3e=moment(this['getDataValue'](_0x9299('0x6')));var _0x13c66a=_0x3a37c5[_0x9299('0x7')](_0x485e3e,_0x9299('0x8'));this[_0x9299('0x9')](_0x9299('0xa'),_0xb81bcb);this[_0x9299('0x9')](_0x9299('0xb'),_0x13c66a>=0x0?_0x13c66a:null);}},'data1':{'type':Sequelize[_0x9299('0x2')],'comment':_0x9299('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x9299('0xd')},'data3':{'type':Sequelize[_0x9299('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x9299('0xe')},'data5':{'type':Sequelize[_0x9299('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x9299('0x2')]},'internal':{'type':Sequelize[_0x9299('0xf')]},'uniqueid':{'type':Sequelize[_0x9299('0x2')]}}; \ No newline at end of file +var _0x31ee=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','enterAt','diff','setDataValue','exitAt'];(function(_0x581cad,_0x355b2e){var _0x1a9f4b=function(_0x5c8461){while(--_0x5c8461){_0x581cad['push'](_0x581cad['shift']());}};_0x1a9f4b(++_0x355b2e);}(_0x31ee,0xf4));var _0xe31e=function(_0x294ba7,_0x3f0ec7){_0x294ba7=_0x294ba7-0x0;var _0x3606b6=_0x31ee[_0x294ba7];return _0x3606b6;};'use strict';var Sequelize=require(_0xe31e('0x0'));var moment=require(_0xe31e('0x1'));module[_0xe31e('0x2')]={'channel':{'type':Sequelize[_0xe31e('0x3')]},'membername':{'type':Sequelize[_0xe31e('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe31e('0x3')],'defaultValue':_0xe31e('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xe31e('0x5')]},'enterAt':{'type':Sequelize[_0xe31e('0x6')]},'exitAt':{'type':Sequelize[_0xe31e('0x6')],'set':function(_0x1483aa){var _0x10de21=moment(_0x1483aa);var _0x3ce090=moment(this['getDataValue'](_0xe31e('0x7')));var _0x24b27e=_0x10de21[_0xe31e('0x8')](_0x3ce090,'seconds');this[_0xe31e('0x9')](_0xe31e('0xa'),_0x1483aa);this[_0xe31e('0x9')](_0xe31e('0xb'),_0x24b27e>=0x0?_0x24b27e:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xe31e('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0xe31e('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0xe31e('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0xe31e('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0xe31e('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xe31e('0x5')]},'uniqueid':{'type':Sequelize[_0xe31e('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index af28bb8..2d48c2a 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(_0x469df0,_0x53a14c){var _0x3cbd4a=function(_0x300436){while(--_0x300436){_0x469df0['push'](_0x469df0['shift']());}};_0x3cbd4a(++_0x53a14c);}(_0x3e74,0x175));var _0x43e7=function(_0x4bfc7a,_0x39351c){_0x4bfc7a=_0x4bfc7a-0x0;var _0x1cf99b=_0x3e74[_0x4bfc7a];return _0x1cf99b;};'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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x1e88eb,_0x4d031e){var _0x23fe01=function(_0x42f79c){while(--_0x42f79c){_0x1e88eb['push'](_0x1e88eb['shift']());}};_0x23fe01(++_0x4d031e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index a62ca95..2eb3a9b 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 _0x3c34=['membername','interface','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface'];(function(_0x16c121,_0xdf2335){var _0x409ba2=function(_0x50e127){while(--_0x50e127){_0x16c121['push'](_0x16c121['shift']());}};_0x409ba2(++_0xdf2335);}(_0x3c34,0x14c));var _0x43c3=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x3c34[_0x874cf1];return _0x233579;};'use strict';var _=require(_0x43c3('0x0'));var util=require(_0x43c3('0x1'));var logger=require(_0x43c3('0x2'))(_0x43c3('0x3'));var moment=require(_0x43c3('0x4'));var BPromise=require(_0x43c3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x43c3('0x6'));var config=require(_0x43c3('0x7'));var attributes=require(_0x43c3('0x8'));module[_0x43c3('0x9')]=function(_0x3b7cdd,_0x49135e){return _0x3b7cdd['define'](_0x43c3('0xa'),attributes,{'tableName':_0x43c3('0xb'),'paranoid':![],'indexes':[{'name':_0x43c3('0xc'),'fields':[_0x43c3('0xd'),_0x43c3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2036=['request-promise','path','rimraf','MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x2036,0x8c));var _0x6203=function(_0x134999,_0x4de0c9){_0x134999=_0x134999-0x0;var _0x46e471=_0x2036[_0x134999];return _0x46e471;};'use strict';var _=require('lodash');var util=require(_0x6203('0x0'));var logger=require(_0x6203('0x1'))(_0x6203('0x2'));var moment=require(_0x6203('0x3'));var BPromise=require('bluebird');var rp=require(_0x6203('0x4'));var fs=require('fs');var path=require(_0x6203('0x5'));var rimraf=require(_0x6203('0x6'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x20e11b,_0x136d1a){return _0x20e11b['define'](_0x6203('0x7'),attributes,{'tableName':_0x6203('0x8'),'paranoid':![],'indexes':[{'name':_0x6203('0x9'),'fields':[_0x6203('0xa'),_0x6203('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 9f158e4..ddddca8 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 _0xc7a3=['../../config/logger','rpc','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','findAll','options','raw','where','limit','include','map','model','attributes','info','debug','catch','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x224053,_0xd5814a){var _0xaeb5ec=function(_0x324600){while(--_0x324600){_0x224053['push'](_0x224053['shift']());}};_0xaeb5ec(++_0xd5814a);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x48cdb1,_0x5a48f0){_0x48cdb1=_0x48cdb1-0x0;var _0x9446f8=_0xc7a3[_0x48cdb1];return _0x9446f8;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var moment=require(_0x3c7a('0x1'));var BPromise=require(_0x3c7a('0x2'));var rs=require(_0x3c7a('0x3'));var fs=require('fs');var Redis=require(_0x3c7a('0x4'));var db=require(_0x3c7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c7a('0x6'))(_0x3c7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x3c7a('0x8'));var client=jayson[_0x3c7a('0x9')][_0x3c7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48e820,_0x115c8a,_0x4f0608){return new BPromise(function(_0x20d36c,_0x5a6fbf){return client[_0x3c7a('0xb')](_0x48e820,_0x4f0608)[_0x3c7a('0xc')](function(_0x132476){logger['info'](_0x3c7a('0xd'),_0x115c8a,_0x3c7a('0xe'));logger['debug'](_0x3c7a('0xf'),_0x115c8a,'request\x20sent',JSON[_0x3c7a('0x10')](_0x132476));if(_0x132476['error']){if(_0x132476[_0x3c7a('0x11')][_0x3c7a('0x12')]===0x1f4){logger[_0x3c7a('0x11')](_0x3c7a('0xd'),_0x115c8a,_0x132476[_0x3c7a('0x11')]['message']);return _0x5a6fbf(_0x132476[_0x3c7a('0x11')][_0x3c7a('0x13')]);}logger[_0x3c7a('0x11')](_0x3c7a('0xd'),_0x115c8a,_0x132476[_0x3c7a('0x11')]['message']);return _0x20d36c(_0x132476[_0x3c7a('0x11')][_0x3c7a('0x13')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x115c8a,_0x3c7a('0xe'));_0x20d36c(_0x132476[_0x3c7a('0x14')][_0x3c7a('0x13')]);}})['catch'](function(_0x1bae30){logger['error'](_0x3c7a('0xd'),_0x115c8a,_0x1bae30);_0x5a6fbf(_0x1bae30);});});}exports[_0x3c7a('0x15')]=function(_0x36e8c2){var _0xb8d04b=this;return new Promise(function(_0x3cb5bf,_0x185df4){return db['MemberReport'][_0x3c7a('0x16')]({'raw':_0x36e8c2[_0x3c7a('0x17')]?_0x36e8c2[_0x3c7a('0x17')][_0x3c7a('0x18')]===undefined?!![]:![]:!![],'where':_0x36e8c2[_0x3c7a('0x17')]?_0x36e8c2[_0x3c7a('0x17')][_0x3c7a('0x19')]||null:null,'attributes':_0x36e8c2[_0x3c7a('0x17')]?_0x36e8c2[_0x3c7a('0x17')]['attributes']||null:null,'limit':_0x36e8c2[_0x3c7a('0x17')]?_0x36e8c2['options'][_0x3c7a('0x1a')]||null:null,'include':_0x36e8c2['options']?_0x36e8c2[_0x3c7a('0x17')][_0x3c7a('0x1b')]?_[_0x3c7a('0x1c')](_0x36e8c2[_0x3c7a('0x17')][_0x3c7a('0x1b')],function(_0x245dde){return{'model':db[_0x245dde[_0x3c7a('0x1d')]],'as':_0x245dde['as'],'attributes':_0x245dde[_0x3c7a('0x1e')],'include':_0x245dde[_0x3c7a('0x1b')]?_[_0x3c7a('0x1c')](_0x245dde[_0x3c7a('0x1b')],function(_0x317fbd){return{'model':db[_0x317fbd['model']],'as':_0x317fbd['as'],'attributes':_0x317fbd[_0x3c7a('0x1e')],'include':_0x317fbd[_0x3c7a('0x1b')]?_[_0x3c7a('0x1c')](_0x317fbd[_0x3c7a('0x1b')],function(_0x9b910c){return{'model':db[_0x9b910c[_0x3c7a('0x1d')]],'as':_0x9b910c['as'],'attributes':_0x9b910c[_0x3c7a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3c7a('0xc')](function(_0x5bbcde){logger[_0x3c7a('0x1f')](_0x3c7a('0x15'),_0x36e8c2);logger[_0x3c7a('0x20')](_0x3c7a('0x15'),_0x36e8c2,JSON[_0x3c7a('0x10')](_0x5bbcde));_0x3cb5bf(_0x5bbcde);})[_0x3c7a('0x21')](function(_0xccf304){logger[_0x3c7a('0x11')](_0x3c7a('0x15'),_0xccf304[_0x3c7a('0x13')],_0x36e8c2);_0x185df4(_0xb8d04b[_0x3c7a('0x11')](0x1f4,_0xccf304[_0x3c7a('0x13')]));});});};exports[_0x3c7a('0x22')]=function(_0xbe2d34){var _0x2e7c6d=this;return new Promise(function(_0x2d873b,_0x3c93a6){return db[_0x3c7a('0x23')][_0x3c7a('0x24')](_0xbe2d34[_0x3c7a('0x25')],{'raw':_0xbe2d34[_0x3c7a('0x17')]?_0xbe2d34[_0x3c7a('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5e9176){logger['info'](_0x3c7a('0x22'),_0xbe2d34);logger[_0x3c7a('0x20')](_0x3c7a('0x22'),_0xbe2d34,JSON[_0x3c7a('0x10')](_0x5e9176));_0x2d873b(_0x5e9176);})[_0x3c7a('0x21')](function(_0xd5ce35){logger[_0x3c7a('0x11')](_0x3c7a('0x22'),_0xd5ce35[_0x3c7a('0x13')],_0xbe2d34);_0x3c93a6(_0x2e7c6d[_0x3c7a('0x11')](0x1f4,_0xd5ce35[_0x3c7a('0x13')]));});});};exports[_0x3c7a('0x26')]=function(_0x37adbf){var _0x2b6a21=this;return new Promise(function(_0x589295,_0x2d1668){return db[_0x3c7a('0x23')]['update'](_0x37adbf[_0x3c7a('0x25')],{'raw':_0x37adbf['options']?_0x37adbf[_0x3c7a('0x17')][_0x3c7a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37adbf['options']?_0x37adbf[_0x3c7a('0x17')][_0x3c7a('0x19')]||null:null,'attributes':_0x37adbf[_0x3c7a('0x17')]?_0x37adbf[_0x3c7a('0x17')][_0x3c7a('0x1e')]||null:null,'limit':_0x37adbf[_0x3c7a('0x17')]?_0x37adbf[_0x3c7a('0x17')][_0x3c7a('0x1a')]||null:null})[_0x3c7a('0xc')](function(_0x394e54){logger['info'](_0x3c7a('0x26'),_0x37adbf);logger[_0x3c7a('0x20')](_0x3c7a('0x26'),_0x37adbf,JSON[_0x3c7a('0x10')](_0x394e54));_0x589295(_0x394e54);})[_0x3c7a('0x21')](function(_0x44da91){logger[_0x3c7a('0x11')](_0x3c7a('0x26'),_0x44da91['message'],_0x37adbf);_0x2d1668(_0x2b6a21[_0x3c7a('0x11')](0x1f4,_0x44da91[_0x3c7a('0x13')]));});});}; \ No newline at end of file +var _0xfa45=['MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','model','attributes','include','CreateMemberReport','create','UpdateMemberReport','body','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0xfddf41,_0x25a9e7){var _0xb3956d=function(_0x2f2ffe){while(--_0x2f2ffe){_0xfddf41['push'](_0xfddf41['shift']());}};_0xb3956d(++_0x25a9e7);}(_0xfa45,0x11b));var _0x5fa4=function(_0x1c9c55,_0x4efedf){_0x1c9c55=_0x1c9c55-0x0;var _0x3287e5=_0xfa45[_0x1c9c55];return _0x3287e5;};'use strict';var _=require(_0x5fa4('0x0'));var util=require(_0x5fa4('0x1'));var moment=require(_0x5fa4('0x2'));var BPromise=require(_0x5fa4('0x3'));var rs=require(_0x5fa4('0x4'));var fs=require('fs');var Redis=require(_0x5fa4('0x5'));var db=require(_0x5fa4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fa4('0x7'))('rpc');var config=require(_0x5fa4('0x8'));var jayson=require(_0x5fa4('0x9'));var client=jayson[_0x5fa4('0xa')][_0x5fa4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28a266,_0x465a79,_0x298dce){return new BPromise(function(_0x108de1,_0xeb788d){return client[_0x5fa4('0xc')](_0x28a266,_0x298dce)['then'](function(_0x25d557){logger['info'](_0x5fa4('0xd'),_0x465a79,_0x5fa4('0xe'));logger[_0x5fa4('0xf')](_0x5fa4('0x10'),_0x465a79,_0x5fa4('0xe'),JSON[_0x5fa4('0x11')](_0x25d557));if(_0x25d557[_0x5fa4('0x12')]){if(_0x25d557[_0x5fa4('0x12')]['code']===0x1f4){logger[_0x5fa4('0x12')]('MemberReport,\x20%s,\x20%s',_0x465a79,_0x25d557[_0x5fa4('0x12')][_0x5fa4('0x13')]);return _0xeb788d(_0x25d557[_0x5fa4('0x12')][_0x5fa4('0x13')]);}logger[_0x5fa4('0x12')]('MemberReport,\x20%s,\x20%s',_0x465a79,_0x25d557[_0x5fa4('0x12')][_0x5fa4('0x13')]);return _0x108de1(_0x25d557['error'][_0x5fa4('0x13')]);}else{logger[_0x5fa4('0x14')]('MemberReport,\x20%s,\x20%s',_0x465a79,_0x5fa4('0xe'));_0x108de1(_0x25d557['result']['message']);}})[_0x5fa4('0x15')](function(_0x1645b1){logger[_0x5fa4('0x12')](_0x5fa4('0xd'),_0x465a79,_0x1645b1);_0xeb788d(_0x1645b1);});});}exports[_0x5fa4('0x16')]=function(_0x100a46){var _0x4a3924=this;return new Promise(function(_0x3d6380,_0x4ef44b){return db[_0x5fa4('0x17')][_0x5fa4('0x18')]({'raw':_0x100a46[_0x5fa4('0x19')]?_0x100a46[_0x5fa4('0x19')][_0x5fa4('0x1a')]===undefined?!![]:![]:!![],'where':_0x100a46[_0x5fa4('0x19')]?_0x100a46[_0x5fa4('0x19')][_0x5fa4('0x1b')]||null:null,'attributes':_0x100a46[_0x5fa4('0x19')]?_0x100a46[_0x5fa4('0x19')]['attributes']||null:null,'limit':_0x100a46['options']?_0x100a46[_0x5fa4('0x19')][_0x5fa4('0x1c')]||null:null,'include':_0x100a46[_0x5fa4('0x19')]?_0x100a46[_0x5fa4('0x19')]['include']?_['map'](_0x100a46[_0x5fa4('0x19')]['include'],function(_0xe63c6b){return{'model':db[_0xe63c6b[_0x5fa4('0x1d')]],'as':_0xe63c6b['as'],'attributes':_0xe63c6b[_0x5fa4('0x1e')],'include':_0xe63c6b[_0x5fa4('0x1f')]?_['map'](_0xe63c6b[_0x5fa4('0x1f')],function(_0x3d2abb){return{'model':db[_0x3d2abb[_0x5fa4('0x1d')]],'as':_0x3d2abb['as'],'attributes':_0x3d2abb[_0x5fa4('0x1e')],'include':_0x3d2abb['include']?_['map'](_0x3d2abb[_0x5fa4('0x1f')],function(_0x46a1d9){return{'model':db[_0x46a1d9[_0x5fa4('0x1d')]],'as':_0x46a1d9['as'],'attributes':_0x46a1d9[_0x5fa4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34006f){logger[_0x5fa4('0x14')](_0x5fa4('0x16'),_0x100a46);logger[_0x5fa4('0xf')]('GetMemberReport',_0x100a46,JSON['stringify'](_0x34006f));_0x3d6380(_0x34006f);})[_0x5fa4('0x15')](function(_0x379fff){logger[_0x5fa4('0x12')](_0x5fa4('0x16'),_0x379fff['message'],_0x100a46);_0x4ef44b(_0x4a3924[_0x5fa4('0x12')](0x1f4,_0x379fff[_0x5fa4('0x13')]));});});};exports[_0x5fa4('0x20')]=function(_0x25ce24){var _0x1f6b19=this;return new Promise(function(_0x1764b6,_0x2c5397){return db[_0x5fa4('0x17')][_0x5fa4('0x21')](_0x25ce24['body'],{'raw':_0x25ce24[_0x5fa4('0x19')]?_0x25ce24[_0x5fa4('0x19')][_0x5fa4('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3b3f52){logger[_0x5fa4('0x14')](_0x5fa4('0x20'),_0x25ce24);logger[_0x5fa4('0xf')](_0x5fa4('0x20'),_0x25ce24,JSON[_0x5fa4('0x11')](_0x3b3f52));_0x1764b6(_0x3b3f52);})['catch'](function(_0x2f734f){logger[_0x5fa4('0x12')](_0x5fa4('0x20'),_0x2f734f[_0x5fa4('0x13')],_0x25ce24);_0x2c5397(_0x1f6b19[_0x5fa4('0x12')](0x1f4,_0x2f734f['message']));});});};exports[_0x5fa4('0x22')]=function(_0x2c31f8){var _0x51f03d=this;return new Promise(function(_0x254ec8,_0x508ff7){return db[_0x5fa4('0x17')]['update'](_0x2c31f8[_0x5fa4('0x23')],{'raw':_0x2c31f8[_0x5fa4('0x19')]?_0x2c31f8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c31f8['options']?_0x2c31f8[_0x5fa4('0x19')][_0x5fa4('0x1b')]||null:null,'attributes':_0x2c31f8[_0x5fa4('0x19')]?_0x2c31f8[_0x5fa4('0x19')]['attributes']||null:null,'limit':_0x2c31f8['options']?_0x2c31f8[_0x5fa4('0x19')][_0x5fa4('0x1c')]||null:null})[_0x5fa4('0x24')](function(_0x54f7be){logger[_0x5fa4('0x14')](_0x5fa4('0x22'),_0x2c31f8);logger[_0x5fa4('0xf')]('UpdateMemberReport',_0x2c31f8,JSON[_0x5fa4('0x11')](_0x54f7be));_0x254ec8(_0x54f7be);})[_0x5fa4('0x15')](function(_0x519c75){logger[_0x5fa4('0x12')]('UpdateMemberReport',_0x519c75[_0x5fa4('0x13')],_0x2c31f8);_0x508ff7(_0x51f03d[_0x5fa4('0x12')](0x1f4,_0x519c75[_0x5fa4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 5833e2d..53f1fdd 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 _0x1af1=['../../components/interaction/service','../../config/environment','get','index','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1af1,0x1e9));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x11af('0x0'));var util=require(_0x11af('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x11af('0x2'));var router=express[_0x11af('0x3')]();var fs_extra=require(_0x11af('0x4'));var auth=require(_0x11af('0x5'));var interaction=require(_0x11af('0x6'));var config=require(_0x11af('0x7'));var controller=require('./migration.controller');router[_0x11af('0x8')]('/',controller[_0x11af('0x9')]);module[_0x11af('0xa')]=router; \ No newline at end of file +var _0x6927=['../../config/environment','./migration.controller','get','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x6927,0xf6));var _0x7692=function(_0x392591,_0xddb0b5){_0x392591=_0x392591-0x0;var _0x19f797=_0x6927[_0x392591];return _0x19f797;};'use strict';var multer=require(_0x7692('0x0'));var util=require('util');var path=require(_0x7692('0x1'));var timeout=require(_0x7692('0x2'));var express=require(_0x7692('0x3'));var router=express[_0x7692('0x4')]();var fs_extra=require(_0x7692('0x5'));var auth=require(_0x7692('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7692('0x7'));var controller=require(_0x7692('0x8'));router[_0x7692('0x9')]('/',controller['index']);module[_0x7692('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 96aa9bd..4e1c858 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 _0x2539=['sequelize','exports','STRING'];(function(_0x4ac776,_0x17d7c1){var _0x589f5e=function(_0x2a18e1){while(--_0x2a18e1){_0x4ac776['push'](_0x4ac776['shift']());}};_0x589f5e(++_0x17d7c1);}(_0x2539,0xd2));var _0x9253=function(_0x5280dc,_0x130caa){_0x5280dc=_0x5280dc-0x0;var _0x54c16b=_0x2539[_0x5280dc];return _0x54c16b;};'use strict';var Sequelize=require(_0x9253('0x0'));module[_0x9253('0x1')]={'version':{'type':Sequelize[_0x9253('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x7fd9=['version','exports','STRING'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x7fd9,0xfd));var _0x97fd=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x7fd9[_0x1ad926];return _0x1b81dc;};'use strict';var Sequelize=require('sequelize');module[_0x97fd('0x0')]={'version':{'type':Sequelize[_0x97fd('0x1')],'unique':_0x97fd('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 9c83e05..12f4e8f 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 _0x9980=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','index','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x9980,0xb2));var _0x0998=function(_0x434cae,_0x3a9b7f){_0x434cae=_0x434cae-0x0;var _0x1c8e07=_0x9980[_0x434cae];return _0x1c8e07;};'use strict';var emlformat=require(_0x0998('0x0'));var rimraf=require(_0x0998('0x1'));var zipdir=require(_0x0998('0x2'));var jsonpatch=require(_0x0998('0x3'));var rp=require('request-promise');var moment=require(_0x0998('0x4'));var BPromise=require(_0x0998('0x5'));var Mustache=require(_0x0998('0x6'));var util=require(_0x0998('0x7'));var path=require('path');var sox=require(_0x0998('0x8'));var csv=require(_0x0998('0x9'));var ejs=require(_0x0998('0xa'));var fs=require('fs');var fs_extra=require(_0x0998('0xb'));var _=require('lodash');var squel=require(_0x0998('0xc'));var crypto=require(_0x0998('0xd'));var jsforce=require(_0x0998('0xe'));var deskjs=require(_0x0998('0xf'));var toCsv=require(_0x0998('0x9'));var querystring=require(_0x0998('0x10'));var Papa=require('papaparse');var Redis=require(_0x0998('0x11'));var authService=require(_0x0998('0x12'));var qs=require(_0x0998('0x13'));var as=require(_0x0998('0x14'));var hardwareService=require(_0x0998('0x15'));var logger=require('../../config/logger')(_0x0998('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0998('0x17'));var db=require(_0x0998('0x18'))['db'];function respondWithStatusCode(_0x2c0a36,_0x296c13){_0x296c13=_0x296c13||0xcc;return function(_0x2fbdff){if(_0x2fbdff){return _0x2c0a36['sendStatus'](_0x296c13);}return _0x2c0a36['status'](_0x296c13)[_0x0998('0x19')]();};}function respondWithResult(_0x426a35,_0x2bffb2){_0x2bffb2=_0x2bffb2||0xc8;return function(_0x57e48f){if(_0x57e48f){return _0x426a35['status'](_0x2bffb2)['json'](_0x57e48f);}};}function respondWithFilteredResult(_0x150e68,_0x57d299){return function(_0x2d440c){if(_0x2d440c){var _0x633115=typeof _0x57d299[_0x0998('0x1a')]===_0x0998('0x1b')&&typeof _0x57d299[_0x0998('0x1c')]===_0x0998('0x1b');var _0x4ba3e1=_0x2d440c[_0x0998('0x1d')];var _0x24c3f4=_0x633115?0x0:_0x57d299['offset'];var _0x31eea0=_0x633115?_0x2d440c[_0x0998('0x1d')]:_0x57d299['offset']+_0x57d299[_0x0998('0x1c')];var _0x2c7fb4;if(_0x31eea0>=_0x4ba3e1){_0x31eea0=_0x4ba3e1;_0x2c7fb4=0xc8;}else{_0x2c7fb4=0xce;}_0x150e68[_0x0998('0x1e')](_0x2c7fb4);return _0x150e68[_0x0998('0x1f')](_0x0998('0x20'),_0x24c3f4+'-'+_0x31eea0+'/'+_0x4ba3e1)[_0x0998('0x21')](_0x2d440c);}return null;};}function patchUpdates(_0x21c0cd){return function(_0x1d3235){try{jsonpatch[_0x0998('0x22')](_0x1d3235,_0x21c0cd,!![]);}catch(_0x292282){return BPromise[_0x0998('0x23')](_0x292282);}return _0x1d3235[_0x0998('0x24')]();};}function saveUpdates(_0x2f33b7,_0x4d6154){return function(_0x1135a7){if(_0x1135a7){return _0x1135a7['update'](_0x2f33b7)[_0x0998('0x25')](function(_0x504df){return _0x504df;});}return null;};}function removeEntity(_0x95e8fe,_0x253428){return function(_0x178fa2){if(_0x178fa2){return _0x178fa2['destroy']()[_0x0998('0x25')](function(){_0x95e8fe[_0x0998('0x1e')](0xcc)[_0x0998('0x19')]();});}};}function handleEntityNotFound(_0x69cd6d,_0x5d9601){return function(_0x2e0ac6){if(!_0x2e0ac6){_0x69cd6d[_0x0998('0x26')](0x194);}return _0x2e0ac6;};}function handleError(_0x5a0e8c,_0x4c5ff8){_0x4c5ff8=_0x4c5ff8||0x1f4;return function(_0x2e93e6){logger[_0x0998('0x27')](_0x2e93e6[_0x0998('0x28')]);if(_0x2e93e6[_0x0998('0x29')]){delete _0x2e93e6['name'];}_0x5a0e8c['status'](_0x4c5ff8)['send'](_0x2e93e6);};}exports[_0x0998('0x2a')]=function(_0x26bb11,_0x2edd80){var _0x468056={},_0x6d3dcd={},_0x30fc01={'count':0x0,'rows':[]};var _0x97143e=_[_0x0998('0x2b')](db[_0x0998('0x2c')][_0x0998('0x2d')],function(_0x4f6a58){return{'name':_0x4f6a58[_0x0998('0x2e')],'type':_0x4f6a58['type'][_0x0998('0x2f')]};});_0x6d3dcd[_0x0998('0x30')]=_['map'](_0x97143e,_0x0998('0x29'));_0x6d3dcd[_0x0998('0x31')]=_[_0x0998('0x32')](_0x26bb11[_0x0998('0x31')]);_0x6d3dcd[_0x0998('0x33')]=_['intersection'](_0x6d3dcd[_0x0998('0x30')],_0x6d3dcd[_0x0998('0x31')]);_0x468056[_0x0998('0x34')]=_['intersection'](_0x6d3dcd[_0x0998('0x30')],qs['fields'](_0x26bb11[_0x0998('0x31')][_0x0998('0x35')]));_0x468056[_0x0998('0x34')]=_0x468056['attributes']['length']?_0x468056['attributes']:_0x6d3dcd['model'];if(!_0x26bb11[_0x0998('0x31')][_0x0998('0x36')]('nolimit')){_0x468056['limit']=qs['limit'](_0x26bb11[_0x0998('0x31')][_0x0998('0x1c')]);_0x468056[_0x0998('0x1a')]=qs[_0x0998('0x1a')](_0x26bb11[_0x0998('0x31')][_0x0998('0x1a')]);}_0x468056[_0x0998('0x37')]=qs[_0x0998('0x38')](_0x26bb11[_0x0998('0x31')][_0x0998('0x38')]);_0x468056[_0x0998('0x39')]=qs[_0x0998('0x33')](_['pick'](_0x26bb11['query'],_0x6d3dcd[_0x0998('0x33')]),_0x97143e);if(_0x26bb11[_0x0998('0x31')][_0x0998('0x3a')]){_0x468056[_0x0998('0x39')]=_[_0x0998('0x3b')](_0x468056[_0x0998('0x39')],{'$or':_[_0x0998('0x2b')](_0x97143e,function(_0x41718b){if(_0x41718b[_0x0998('0x3c')]!==_0x0998('0x3d')){var _0x4e60fc={};_0x4e60fc[_0x41718b[_0x0998('0x29')]]={'$like':'%'+_0x26bb11[_0x0998('0x31')]['filter']+'%'};return _0x4e60fc;}})});}_0x468056=_['merge']({},_0x468056,_0x26bb11[_0x0998('0x3e')]);var _0x1b29f3={'where':_0x468056['where']};return db[_0x0998('0x2c')]['count'](_0x1b29f3)['then'](function(_0xcd00cd){_0x30fc01[_0x0998('0x1d')]=_0xcd00cd;if(_0x26bb11['query']['includeAll']){_0x468056[_0x0998('0x3f')]=[{'all':!![]}];}return db[_0x0998('0x2c')]['findAll'](_0x468056);})['then'](function(_0xbe2008){_0x30fc01[_0x0998('0x40')]=_0xbe2008;return _0x30fc01;})[_0x0998('0x25')](respondWithFilteredResult(_0x2edd80,_0x468056))[_0x0998('0x41')](handleError(_0x2edd80,null));}; \ No newline at end of file +var _0x1ff6=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','Migration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path'];(function(_0x356894,_0x178ae1){var _0x4f55d5=function(_0x523c57){while(--_0x523c57){_0x356894['push'](_0x356894['shift']());}};_0x4f55d5(++_0x178ae1);}(_0x1ff6,0x191));var _0x61ff=function(_0x5b5ae3,_0xff9830){_0x5b5ae3=_0x5b5ae3-0x0;var _0x242c57=_0x1ff6[_0x5b5ae3];return _0x242c57;};'use strict';var emlformat=require(_0x61ff('0x0'));var rimraf=require(_0x61ff('0x1'));var zipdir=require(_0x61ff('0x2'));var jsonpatch=require(_0x61ff('0x3'));var rp=require(_0x61ff('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x61ff('0x5'));var path=require(_0x61ff('0x6'));var sox=require(_0x61ff('0x7'));var csv=require('to-csv');var ejs=require(_0x61ff('0x8'));var fs=require('fs');var fs_extra=require(_0x61ff('0x9'));var _=require(_0x61ff('0xa'));var squel=require(_0x61ff('0xb'));var crypto=require(_0x61ff('0xc'));var jsforce=require(_0x61ff('0xd'));var deskjs=require(_0x61ff('0xe'));var toCsv=require(_0x61ff('0xf'));var querystring=require(_0x61ff('0x10'));var Papa=require(_0x61ff('0x11'));var Redis=require('ioredis');var authService=require(_0x61ff('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x61ff('0x13'));var hardwareService=require(_0x61ff('0x14'));var logger=require('../../config/logger')(_0x61ff('0x15'));var utils=require('../../config/utils');var config=require(_0x61ff('0x16'));var licenseUtil=require(_0x61ff('0x17'));var db=require(_0x61ff('0x18'))['db'];function respondWithStatusCode(_0x4f14ec,_0x31414f){_0x31414f=_0x31414f||0xcc;return function(_0x212305){if(_0x212305){return _0x4f14ec['sendStatus'](_0x31414f);}return _0x4f14ec[_0x61ff('0x19')](_0x31414f)['end']();};}function respondWithResult(_0x4a744d,_0x1715d9){_0x1715d9=_0x1715d9||0xc8;return function(_0x441c4d){if(_0x441c4d){return _0x4a744d[_0x61ff('0x19')](_0x1715d9)[_0x61ff('0x1a')](_0x441c4d);}};}function respondWithFilteredResult(_0x2e1aba,_0x1cbbc9){return function(_0x128128){if(_0x128128){var _0x42fe0e=typeof _0x1cbbc9['offset']===_0x61ff('0x1b')&&typeof _0x1cbbc9[_0x61ff('0x1c')]===_0x61ff('0x1b');var _0x12d074=_0x128128[_0x61ff('0x1d')];var _0x4d8648=_0x42fe0e?0x0:_0x1cbbc9[_0x61ff('0x1e')];var _0x238949=_0x42fe0e?_0x128128[_0x61ff('0x1d')]:_0x1cbbc9['offset']+_0x1cbbc9[_0x61ff('0x1c')];var _0xd66ac7;if(_0x238949>=_0x12d074){_0x238949=_0x12d074;_0xd66ac7=0xc8;}else{_0xd66ac7=0xce;}_0x2e1aba[_0x61ff('0x19')](_0xd66ac7);return _0x2e1aba[_0x61ff('0x1f')](_0x61ff('0x20'),_0x4d8648+'-'+_0x238949+'/'+_0x12d074)[_0x61ff('0x1a')](_0x128128);}return null;};}function patchUpdates(_0x1976ec){return function(_0x148657){try{jsonpatch[_0x61ff('0x21')](_0x148657,_0x1976ec,!![]);}catch(_0x502ee7){return BPromise[_0x61ff('0x22')](_0x502ee7);}return _0x148657[_0x61ff('0x23')]();};}function saveUpdates(_0x2b9b58,_0x240962){return function(_0x2e461e){if(_0x2e461e){return _0x2e461e[_0x61ff('0x24')](_0x2b9b58)[_0x61ff('0x25')](function(_0x1dbd35){return _0x1dbd35;});}return null;};}function removeEntity(_0x5ec40e,_0x5de69d){return function(_0x472931){if(_0x472931){return _0x472931[_0x61ff('0x26')]()['then'](function(){_0x5ec40e['status'](0xcc)[_0x61ff('0x27')]();});}};}function handleEntityNotFound(_0x3efa10,_0x3ed80c){return function(_0x585ca9){if(!_0x585ca9){_0x3efa10['sendStatus'](0x194);}return _0x585ca9;};}function handleError(_0x3da36e,_0x5bebc4){_0x5bebc4=_0x5bebc4||0x1f4;return function(_0x4b0850){logger['error'](_0x4b0850['stack']);if(_0x4b0850[_0x61ff('0x28')]){delete _0x4b0850[_0x61ff('0x28')];}_0x3da36e['status'](_0x5bebc4)[_0x61ff('0x29')](_0x4b0850);};}exports[_0x61ff('0x2a')]=function(_0x48c178,_0x2f3305){var _0x3dfd8c={},_0x1f5d15={},_0x57aaf9={'count':0x0,'rows':[]};var _0x19b6c5=_[_0x61ff('0x2b')](db[_0x61ff('0x2c')]['rawAttributes'],function(_0x2a75a4){return{'name':_0x2a75a4[_0x61ff('0x2d')],'type':_0x2a75a4[_0x61ff('0x2e')][_0x61ff('0x2f')]};});_0x1f5d15[_0x61ff('0x30')]=_[_0x61ff('0x2b')](_0x19b6c5,_0x61ff('0x28'));_0x1f5d15['query']=_['keys'](_0x48c178[_0x61ff('0x31')]);_0x1f5d15[_0x61ff('0x32')]=_[_0x61ff('0x33')](_0x1f5d15['model'],_0x1f5d15[_0x61ff('0x31')]);_0x3dfd8c[_0x61ff('0x34')]=_['intersection'](_0x1f5d15['model'],qs[_0x61ff('0x35')](_0x48c178[_0x61ff('0x31')][_0x61ff('0x35')]));_0x3dfd8c['attributes']=_0x3dfd8c[_0x61ff('0x34')][_0x61ff('0x36')]?_0x3dfd8c['attributes']:_0x1f5d15[_0x61ff('0x30')];if(!_0x48c178[_0x61ff('0x31')][_0x61ff('0x37')](_0x61ff('0x38'))){_0x3dfd8c[_0x61ff('0x1c')]=qs[_0x61ff('0x1c')](_0x48c178['query']['limit']);_0x3dfd8c[_0x61ff('0x1e')]=qs[_0x61ff('0x1e')](_0x48c178[_0x61ff('0x31')]['offset']);}_0x3dfd8c[_0x61ff('0x39')]=qs[_0x61ff('0x3a')](_0x48c178[_0x61ff('0x31')][_0x61ff('0x3a')]);_0x3dfd8c[_0x61ff('0x3b')]=qs['filters'](_[_0x61ff('0x3c')](_0x48c178[_0x61ff('0x31')],_0x1f5d15[_0x61ff('0x32')]),_0x19b6c5);if(_0x48c178[_0x61ff('0x31')][_0x61ff('0x3d')]){_0x3dfd8c[_0x61ff('0x3b')]=_[_0x61ff('0x3e')](_0x3dfd8c[_0x61ff('0x3b')],{'$or':_[_0x61ff('0x2b')](_0x19b6c5,function(_0x31d4d9){if(_0x31d4d9['type']!=='VIRTUAL'){var _0x34d042={};_0x34d042[_0x31d4d9['name']]={'$like':'%'+_0x48c178[_0x61ff('0x31')][_0x61ff('0x3d')]+'%'};return _0x34d042;}})});}_0x3dfd8c=_[_0x61ff('0x3e')]({},_0x3dfd8c,_0x48c178[_0x61ff('0x3f')]);var _0x2c8ae5={'where':_0x3dfd8c[_0x61ff('0x3b')]};return db[_0x61ff('0x2c')][_0x61ff('0x1d')](_0x2c8ae5)['then'](function(_0x319658){_0x57aaf9['count']=_0x319658;if(_0x48c178[_0x61ff('0x31')][_0x61ff('0x40')]){_0x3dfd8c[_0x61ff('0x41')]=[{'all':!![]}];}return db[_0x61ff('0x2c')]['findAll'](_0x3dfd8c);})[_0x61ff('0x25')](function(_0x99ced0){_0x57aaf9[_0x61ff('0x42')]=_0x99ced0;return _0x57aaf9;})[_0x61ff('0x25')](respondWithFilteredResult(_0x2f3305,_0x3dfd8c))[_0x61ff('0x43')](handleError(_0x2f3305,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f46fee1..e269f4d 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 _0x9404=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0x24bbc9,_0x49c2c2){var _0x176a0b=function(_0x3ea511){while(--_0x3ea511){_0x24bbc9['push'](_0x24bbc9['shift']());}};_0x176a0b(++_0x49c2c2);}(_0x9404,0x193));var _0x4940=function(_0x5f4a20,_0xf579f0){_0x5f4a20=_0x5f4a20-0x0;var _0x57e65c=_0x9404[_0x5f4a20];return _0x57e65c;};'use strict';var _=require(_0x4940('0x0'));var util=require(_0x4940('0x1'));var logger=require(_0x4940('0x2'))(_0x4940('0x3'));var moment=require(_0x4940('0x4'));var BPromise=require(_0x4940('0x5'));var rp=require(_0x4940('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4940('0x7'));var config=require(_0x4940('0x8'));var attributes=require(_0x4940('0x9'));module[_0x4940('0xa')]=function(_0x24d0f6,_0x18bf65){return _0x24d0f6[_0x4940('0xb')](_0x4940('0xc'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa86f=['rimraf','../../config/environment','./migration.attributes','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x49be90,_0x34c3ab){var _0x202603=function(_0xdf8d74){while(--_0xdf8d74){_0x49be90['push'](_0x49be90['shift']());}};_0x202603(++_0x34c3ab);}(_0xa86f,0x95));var _0xfa86=function(_0x32eed6,_0xc5ca1b){_0x32eed6=_0x32eed6-0x0;var _0x2349ce=_0xa86f[_0x32eed6];return _0x2349ce;};'use strict';var _=require(_0xfa86('0x0'));var util=require(_0xfa86('0x1'));var logger=require(_0xfa86('0x2'))(_0xfa86('0x3'));var moment=require(_0xfa86('0x4'));var BPromise=require(_0xfa86('0x5'));var rp=require(_0xfa86('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa86('0x7'));var config=require(_0xfa86('0x8'));var attributes=require(_0xfa86('0x9'));module['exports']=function(_0x1e0503,_0x2fd5b4){return _0x1e0503[_0xfa86('0xa')](_0xfa86('0xb'),attributes,{'tableName':_0xfa86('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 0b9bf47..8652115 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 _0x3d15=['debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Migration,\x20%s,\x20%s'];(function(_0x2a66a8,_0x4b402a){var _0x20cda2=function(_0x2164ca){while(--_0x2164ca){_0x2a66a8['push'](_0x2a66a8['shift']());}};_0x20cda2(++_0x4b402a);}(_0x3d15,0x127));var _0x53d1=function(_0x8f7825,_0xaa0ca0){_0x8f7825=_0x8f7825-0x0;var _0x29a7c9=_0x3d15[_0x8f7825];return _0x29a7c9;};'use strict';var _=require('lodash');var util=require(_0x53d1('0x0'));var moment=require(_0x53d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x53d1('0x2'));var fs=require('fs');var Redis=require(_0x53d1('0x3'));var db=require(_0x53d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x53d1('0x5'))(_0x53d1('0x6'));var config=require(_0x53d1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x53d1('0x8')][_0x53d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b4385,_0x8abe67,_0x32dfe1){return new BPromise(function(_0x1c4833,_0x49309e){return client[_0x53d1('0xa')](_0x4b4385,_0x32dfe1)[_0x53d1('0xb')](function(_0x59f965){logger['info'](_0x53d1('0xc'),_0x8abe67,'request\x20sent');logger[_0x53d1('0xd')](_0x53d1('0xe'),_0x8abe67,_0x53d1('0xf'),JSON[_0x53d1('0x10')](_0x59f965));if(_0x59f965[_0x53d1('0x11')]){if(_0x59f965[_0x53d1('0x11')][_0x53d1('0x12')]===0x1f4){logger[_0x53d1('0x11')]('Migration,\x20%s,\x20%s',_0x8abe67,_0x59f965[_0x53d1('0x11')][_0x53d1('0x13')]);return _0x49309e(_0x59f965[_0x53d1('0x11')][_0x53d1('0x13')]);}logger[_0x53d1('0x11')](_0x53d1('0xc'),_0x8abe67,_0x59f965[_0x53d1('0x11')][_0x53d1('0x13')]);return _0x1c4833(_0x59f965[_0x53d1('0x11')][_0x53d1('0x13')]);}else{logger[_0x53d1('0x14')](_0x53d1('0xc'),_0x8abe67,_0x53d1('0xf'));_0x1c4833(_0x59f965['result'][_0x53d1('0x13')]);}})[_0x53d1('0x15')](function(_0x4438ef){logger['error'](_0x53d1('0xc'),_0x8abe67,_0x4438ef);_0x49309e(_0x4438ef);});});} \ No newline at end of file +var _0x5bc5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5bc5,0xb2));var _0x55bc=function(_0x10df1e,_0xf56f85){_0x10df1e=_0x10df1e-0x0;var _0x3e24fb=_0x5bc5[_0x10df1e];return _0x3e24fb;};'use strict';var _=require(_0x55bc('0x0'));var util=require(_0x55bc('0x1'));var moment=require(_0x55bc('0x2'));var BPromise=require(_0x55bc('0x3'));var rs=require(_0x55bc('0x4'));var fs=require('fs');var Redis=require(_0x55bc('0x5'));var db=require(_0x55bc('0x6'))['db'];var utils=require(_0x55bc('0x7'));var logger=require(_0x55bc('0x8'))(_0x55bc('0x9'));var config=require(_0x55bc('0xa'));var jayson=require(_0x55bc('0xb'));var client=jayson[_0x55bc('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d78d6,_0x5719c9,_0x2a612b){return new BPromise(function(_0x38839e,_0x4d0610){return client[_0x55bc('0xd')](_0x4d78d6,_0x2a612b)[_0x55bc('0xe')](function(_0xc535ac){logger[_0x55bc('0xf')](_0x55bc('0x10'),_0x5719c9,_0x55bc('0x11'));logger[_0x55bc('0x12')](_0x55bc('0x13'),_0x5719c9,'request\x20sent',JSON[_0x55bc('0x14')](_0xc535ac));if(_0xc535ac[_0x55bc('0x15')]){if(_0xc535ac[_0x55bc('0x15')]['code']===0x1f4){logger[_0x55bc('0x15')]('Migration,\x20%s,\x20%s',_0x5719c9,_0xc535ac[_0x55bc('0x15')][_0x55bc('0x16')]);return _0x4d0610(_0xc535ac[_0x55bc('0x15')]['message']);}logger[_0x55bc('0x15')]('Migration,\x20%s,\x20%s',_0x5719c9,_0xc535ac[_0x55bc('0x15')][_0x55bc('0x16')]);return _0x38839e(_0xc535ac[_0x55bc('0x15')]['message']);}else{logger[_0x55bc('0xf')](_0x55bc('0x10'),_0x5719c9,'request\x20sent');_0x38839e(_0xc535ac['result'][_0x55bc('0x16')]);}})['catch'](function(_0x482eea){logger[_0x55bc('0x15')](_0x55bc('0x10'),_0x5719c9,_0x482eea);_0x4d0610(_0x482eea);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 673d9cf..b680a5b 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 _0xa3eb=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index'];(function(_0x95a30c,_0x2988be){var _0x3eb15c=function(_0xd7ceb8){while(--_0xd7ceb8){_0x95a30c['push'](_0x95a30c['shift']());}};_0x3eb15c(++_0x2988be);}(_0xa3eb,0x1ed));var _0xba3e=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xa3eb[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0xba3e('0x0'));var util=require(_0xba3e('0x1'));var path=require(_0xba3e('0x2'));var timeout=require('connect-timeout');var express=require(_0xba3e('0x3'));var router=express[_0xba3e('0x4')]();var fs_extra=require(_0xba3e('0x5'));var auth=require(_0xba3e('0x6'));var interaction=require(_0xba3e('0x7'));var config=require(_0xba3e('0x8'));var controller=require(_0xba3e('0x9'));router[_0xba3e('0xa')]('/',auth[_0xba3e('0xb')](),controller[_0xba3e('0xc')]);router[_0xba3e('0xa')](_0xba3e('0xd'),auth[_0xba3e('0xb')](),controller[_0xba3e('0xe')]);router[_0xba3e('0xf')]('/',auth[_0xba3e('0xb')](),controller[_0xba3e('0x10')]);router[_0xba3e('0x11')](_0xba3e('0xd'),auth['isAuthenticated'](),controller[_0xba3e('0x12')]);router[_0xba3e('0x13')](_0xba3e('0xd'),auth['isAuthenticated'](),controller[_0xba3e('0x14')]);module[_0xba3e('0x15')]=router; \ No newline at end of file +var _0x46c9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','path','connect-timeout','express','Router'];(function(_0x1102ef,_0x2d8385){var _0xbfbd56=function(_0x4c83c7){while(--_0x4c83c7){_0x1102ef['push'](_0x1102ef['shift']());}};_0xbfbd56(++_0x2d8385);}(_0x46c9,0x106));var _0x946c=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0x46c9[_0x118653];return _0xc11fa6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x946c('0x0'));var timeout=require(_0x946c('0x1'));var express=require(_0x946c('0x2'));var router=express[_0x946c('0x3')]();var fs_extra=require(_0x946c('0x4'));var auth=require(_0x946c('0x5'));var interaction=require(_0x946c('0x6'));var config=require(_0x946c('0x7'));var controller=require(_0x946c('0x8'));router[_0x946c('0x9')]('/',auth[_0x946c('0xa')](),controller[_0x946c('0xb')]);router[_0x946c('0x9')](_0x946c('0xc'),auth[_0x946c('0xa')](),controller[_0x946c('0xd')]);router[_0x946c('0xe')]('/',auth[_0x946c('0xa')](),controller[_0x946c('0xf')]);router[_0x946c('0x10')]('/:id',auth[_0x946c('0xa')](),controller[_0x946c('0x11')]);router['delete'](_0x946c('0xc'),auth['isAuthenticated'](),controller[_0x946c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 9317a61..c46e10f 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 _0x7ef8=['ENUM','stun','STRING','sequelize','exports'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7ef8,0xdf));var _0x87ef=function(_0x3b7a06,_0x41f79e){_0x3b7a06=_0x3b7a06-0x0;var _0x363e31=_0x7ef8[_0x3b7a06];return _0x363e31;};'use strict';var Sequelize=require(_0x87ef('0x0'));module[_0x87ef('0x1')]={'type':{'type':Sequelize[_0x87ef('0x2')]('localnet','externip',_0x87ef('0x3'),'turn')},'value':{'type':Sequelize[_0x87ef('0x4')]},'username':{'type':Sequelize[_0x87ef('0x4')]},'password':{'type':Sequelize[_0x87ef('0x4')]}}; \ No newline at end of file +var _0x6ee5=['exports','ENUM','localnet','externip','turn','STRING','sequelize'];(function(_0x4f32e6,_0x4c9028){var _0x125c78=function(_0xe85e9b){while(--_0xe85e9b){_0x4f32e6['push'](_0x4f32e6['shift']());}};_0x125c78(++_0x4c9028);}(_0x6ee5,0x11e));var _0x56ee=function(_0x52fbf7,_0x426a02){_0x52fbf7=_0x52fbf7-0x0;var _0x160927=_0x6ee5[_0x52fbf7];return _0x160927;};'use strict';var Sequelize=require(_0x56ee('0x0'));module[_0x56ee('0x1')]={'type':{'type':Sequelize[_0x56ee('0x2')](_0x56ee('0x3'),_0x56ee('0x4'),'stun',_0x56ee('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x56ee('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 7177d7f..4548c9e 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 _0xa226=['catch','json','limit','undefined','count','offset','status','set','update','destroy','then','end','name','send','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Network','include','findAll','rows','show','params','includeAll','find','create','body','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','toUpperCase','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','STUN','chan_sip.so','format','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x317c62,_0x26e37e){var _0x3bd6ce=function(_0x2b2e2e){while(--_0x2b2e2e){_0x317c62['push'](_0x317c62['shift']());}};_0x3bd6ce(++_0x26e37e);}(_0xa226,0x13c));var _0x6a22=function(_0x3acd6b,_0xaae0e){_0x3acd6b=_0x3acd6b-0x0;var _0x1ce55c=_0xa226[_0x3acd6b];return _0x1ce55c;};'use strict';var util=require(_0x6a22('0x0'));var path=require(_0x6a22('0x1'));var ejs=require(_0x6a22('0x2'));var fs=require('fs');var _=require(_0x6a22('0x3'));var qs=require(_0x6a22('0x4'));var logger=require(_0x6a22('0x5'))(_0x6a22('0x6'));var config=require('../../config/environment');var db=require(_0x6a22('0x7'))['db'];var jayson=require(_0x6a22('0x8'));var client=jayson[_0x6a22('0x9')][_0x6a22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x502992,_0x433b9a,_0x2369c4,_0x6eb11c){return new Promise(function(_0x3a8c12,_0x2d8f39){var _0x45e4df=_0x6eb11c||client;return _0x45e4df[_0x6a22('0xb')](_0x502992,_0x2369c4)['then'](function(_0x3509dc){logger[_0x6a22('0xc')](_0x6a22('0xd'),_0x433b9a,_0x6a22('0xe'));logger[_0x6a22('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0x433b9a,_0x6a22('0xe'),JSON[_0x6a22('0x10')](_0x3509dc));if(_0x3509dc[_0x6a22('0x11')]){if(_0x3509dc[_0x6a22('0x11')]['code']===0x1f4){logger[_0x6a22('0x11')](_0x6a22('0xd'),_0x433b9a,_0x3509dc[_0x6a22('0x11')][_0x6a22('0x12')]);return _0x2d8f39(_0x3509dc[_0x6a22('0x11')]['message']);}logger[_0x6a22('0x11')](_0x6a22('0xd'),_0x433b9a,_0x3509dc[_0x6a22('0x11')][_0x6a22('0x12')]);return _0x3a8c12(_0x3509dc[_0x6a22('0x11')]['message']);}else{logger['info'](_0x6a22('0xd'),_0x433b9a,'request\x20sent');_0x3a8c12(_0x3509dc[_0x6a22('0x13')]['message']);}})[_0x6a22('0x14')](function(_0xda914){logger[_0x6a22('0x11')](_0x6a22('0xd'),_0x433b9a,_0xda914);_0x2d8f39(_0xda914);});});}function respondWithResult(_0x413d7d,_0xf1f183){_0xf1f183=_0xf1f183||0xc8;return function(_0x4ff0f5){if(_0x4ff0f5){return _0x413d7d['status'](_0xf1f183)[_0x6a22('0x15')](_0x4ff0f5);}};}function respondWithFilteredResult(_0x2173e7,_0xe1b6a3){return function(_0x2011ae){if(_0x2011ae){var _0x4e4dd6=typeof _0xe1b6a3['offset']==='undefined'&&typeof _0xe1b6a3[_0x6a22('0x16')]===_0x6a22('0x17');var _0x542fa1=_0x2011ae[_0x6a22('0x18')];var _0x51da6a=_0x4e4dd6?0x0:_0xe1b6a3[_0x6a22('0x19')];var _0x5c2f26=_0x4e4dd6?_0x2011ae['count']:_0xe1b6a3['offset']+_0xe1b6a3[_0x6a22('0x16')];var _0x4cd88a;if(_0x5c2f26>=_0x542fa1){_0x5c2f26=_0x542fa1;_0x4cd88a=0xc8;}else{_0x4cd88a=0xce;}_0x2173e7[_0x6a22('0x1a')](_0x4cd88a);return _0x2173e7[_0x6a22('0x1b')]('Content-Range',_0x51da6a+'-'+_0x5c2f26+'/'+_0x542fa1)[_0x6a22('0x15')](_0x2011ae);}return null;};}function saveUpdates(_0x57b1f6){return function(_0xb78019){if(_0xb78019){return _0xb78019[_0x6a22('0x1c')](_0x57b1f6)['then'](function(_0x1b15ec){return _0x1b15ec;});}return null;};}function removeEntity(_0xc416c1){return function(_0x2f8239){if(_0x2f8239){return _0x2f8239[_0x6a22('0x1d')]()[_0x6a22('0x1e')](function(){_0xc416c1[_0x6a22('0x1a')](0xcc)[_0x6a22('0x1f')]();});}};}function handleEntityNotFound(_0x143029){return function(_0x3f6ffd){if(!_0x3f6ffd){_0x143029['sendStatus'](0x194);}return _0x3f6ffd;};}function handleError(_0x590661,_0x519871){_0x519871=_0x519871||0x1f4;return function(_0x391e07){logger[_0x6a22('0x11')](_0x391e07['stack']);if(_0x391e07[_0x6a22('0x20')]){delete _0x391e07[_0x6a22('0x20')];}_0x590661[_0x6a22('0x1a')](_0x519871)[_0x6a22('0x21')](_0x391e07);};}exports['index']=function(_0x53f7b1,_0x872496){var _0x338613={},_0x5e7bf4={},_0x55c427={'count':0x0,'rows':[]};var _0x384981=_['map'](db['Network'][_0x6a22('0x22')],function(_0x574967){return{'name':_0x574967['fieldName'],'type':_0x574967[_0x6a22('0x23')][_0x6a22('0x24')]};});_0x5e7bf4['model']=_[_0x6a22('0x25')](_0x384981,_0x6a22('0x20'));_0x5e7bf4[_0x6a22('0x26')]=_[_0x6a22('0x27')](_0x53f7b1[_0x6a22('0x26')]);_0x5e7bf4[_0x6a22('0x28')]=_[_0x6a22('0x29')](_0x5e7bf4[_0x6a22('0x2a')],_0x5e7bf4[_0x6a22('0x26')]);_0x338613[_0x6a22('0x2b')]=_['intersection'](_0x5e7bf4[_0x6a22('0x2a')],qs[_0x6a22('0x2c')](_0x53f7b1[_0x6a22('0x26')][_0x6a22('0x2c')]));_0x338613[_0x6a22('0x2b')]=_0x338613[_0x6a22('0x2b')][_0x6a22('0x2d')]?_0x338613[_0x6a22('0x2b')]:_0x5e7bf4[_0x6a22('0x2a')];if(!_0x53f7b1['query'][_0x6a22('0x2e')]('nolimit')){_0x338613[_0x6a22('0x16')]=qs[_0x6a22('0x16')](_0x53f7b1['query']['limit']);_0x338613[_0x6a22('0x19')]=qs[_0x6a22('0x19')](_0x53f7b1['query'][_0x6a22('0x19')]);}_0x338613['order']=qs[_0x6a22('0x2f')](_0x53f7b1['query'][_0x6a22('0x2f')]);_0x338613[_0x6a22('0x30')]=qs['filters'](_[_0x6a22('0x31')](_0x53f7b1[_0x6a22('0x26')],_0x5e7bf4[_0x6a22('0x28')]),_0x384981);if(_0x53f7b1[_0x6a22('0x26')][_0x6a22('0x32')]){_0x338613[_0x6a22('0x30')]=_[_0x6a22('0x33')](_0x338613[_0x6a22('0x30')],{'$or':_[_0x6a22('0x25')](_0x384981,function(_0x16adff){if(_0x16adff[_0x6a22('0x23')]!==_0x6a22('0x34')){var _0x3ea87d={};_0x3ea87d[_0x16adff['name']]={'$like':'%'+_0x53f7b1[_0x6a22('0x26')][_0x6a22('0x32')]+'%'};return _0x3ea87d;}})});}_0x338613=_[_0x6a22('0x33')]({},_0x338613,_0x53f7b1[_0x6a22('0x35')]);var _0x400249={'where':_0x338613[_0x6a22('0x30')]};return db[_0x6a22('0x36')][_0x6a22('0x18')](_0x400249)[_0x6a22('0x1e')](function(_0x1238ca){_0x55c427[_0x6a22('0x18')]=_0x1238ca;if(_0x53f7b1[_0x6a22('0x26')]['includeAll']){_0x338613[_0x6a22('0x37')]=[{'all':!![]}];}return db[_0x6a22('0x36')][_0x6a22('0x38')](_0x338613);})[_0x6a22('0x1e')](function(_0x4d82e5){_0x55c427[_0x6a22('0x39')]=_0x4d82e5;return _0x55c427;})[_0x6a22('0x1e')](respondWithFilteredResult(_0x872496,_0x338613))[_0x6a22('0x14')](handleError(_0x872496,null));};exports[_0x6a22('0x3a')]=function(_0x4d9324,_0x37e0e4){var _0x4b273e={'raw':!![],'where':{'id':_0x4d9324[_0x6a22('0x3b')]['id']}},_0x1252cc={};_0x1252cc[_0x6a22('0x2a')]=_[_0x6a22('0x27')](db['Network'][_0x6a22('0x22')]);_0x1252cc[_0x6a22('0x26')]=_[_0x6a22('0x27')](_0x4d9324[_0x6a22('0x26')]);_0x1252cc['filters']=_[_0x6a22('0x29')](_0x1252cc[_0x6a22('0x2a')],_0x1252cc['query']);_0x4b273e[_0x6a22('0x2b')]=_[_0x6a22('0x29')](_0x1252cc[_0x6a22('0x2a')],qs[_0x6a22('0x2c')](_0x4d9324['query']['fields']));_0x4b273e[_0x6a22('0x2b')]=_0x4b273e[_0x6a22('0x2b')][_0x6a22('0x2d')]?_0x4b273e[_0x6a22('0x2b')]:_0x1252cc[_0x6a22('0x2a')];if(_0x4d9324[_0x6a22('0x26')][_0x6a22('0x3c')]){_0x4b273e[_0x6a22('0x37')]=[{'all':!![]}];}_0x4b273e=_['merge']({},_0x4b273e,_0x4d9324[_0x6a22('0x35')]);return db[_0x6a22('0x36')][_0x6a22('0x3d')](_0x4b273e)['then'](handleEntityNotFound(_0x37e0e4,null))[_0x6a22('0x1e')](respondWithResult(_0x37e0e4,null))[_0x6a22('0x14')](handleError(_0x37e0e4,null));};exports[_0x6a22('0x3e')]=function(_0x582d04,_0x3f8680){var _0x105e81;return db[_0x6a22('0x36')]['create'](_0x582d04['body'],{'raw':!![]})[_0x6a22('0x1e')](function(_0x21b500){_0x105e81=_0x21b500;return db[_0x6a22('0x36')]['findAll']({'where':{'type':_0x582d04[_0x6a22('0x3f')]['type']},'raw':!![]});})[_0x6a22('0x1e')](function(_0x47d68e){if(_0x105e81[_0x6a22('0x23')]['toUpperCase']()=='STUN'){var _0xda5954=fs['readFileSync'](path[_0x6a22('0x40')](config['root'],_0x6a22('0x41')),_0x6a22('0x42'));var _0x47d9b2=ejs[_0x6a22('0x43')](_0xda5954,{'networks':_0x47d68e||[]});fs[_0x6a22('0x44')](_0x6a22('0x45'),_0x47d9b2);return respondWithRpcPromise('Reload',_0x6a22('0x3e'),{'module':'res_stun_monitor.so'});}else if(_0x105e81[_0x6a22('0x23')][_0x6a22('0x46')]()==_0x6a22('0x47')){var _0x4760fb=fs[_0x6a22('0x48')](path[_0x6a22('0x40')](config[_0x6a22('0x49')],_0x6a22('0x4a')),_0x6a22('0x42'));var _0x367bef=ejs['render'](_0x4760fb,{'networks':_0x47d68e||[]});fs['writeFileSync'](_0x6a22('0x4b'),_0x367bef);return respondWithRpcPromise('Reload',_0x6a22('0x3e'),{'module':_0x6a22('0x4c')});}else{var _0x1ca6a5=fs[_0x6a22('0x48')](path[_0x6a22('0x40')](config[_0x6a22('0x49')],_0x6a22('0x4d')),_0x6a22('0x42'));var _0x321337=ejs[_0x6a22('0x43')](_0x1ca6a5,{'networks':_0x47d68e||[]});fs[_0x6a22('0x44')](util['format'](_0x6a22('0x4e'),_0x582d04[_0x6a22('0x3f')][_0x6a22('0x23')][_0x6a22('0x4f')]()),_0x321337);return respondWithRpcPromise(_0x6a22('0x50'),_0x6a22('0x3e'),{'module':'chan_sip.so'});}})[_0x6a22('0x1e')](function(){return _0x105e81;})['then'](respondWithResult(_0x3f8680,0xc9))[_0x6a22('0x14')](handleError(_0x3f8680,null));};exports['update']=function(_0xc60a77,_0x5f524a){var _0x49f4fd;return db['Network']['find']({'where':{'id':_0xc60a77['params']['id']}})['then'](handleEntityNotFound(_0x5f524a,null))[_0x6a22('0x1e')](saveUpdates(_0xc60a77[_0x6a22('0x3f')],null))['then'](function(_0x3a19a0){if(_0x3a19a0){_0x49f4fd=_0x3a19a0;return db['Network']['findAll']({'where':{'type':_0x49f4fd[_0x6a22('0x23')]},'raw':!![]});}return null;})[_0x6a22('0x1e')](function(_0x96e40b){if(_0x49f4fd[_0x6a22('0x23')]['toUpperCase']()==_0x6a22('0x51')){var _0x529652=fs['readFileSync'](path[_0x6a22('0x40')](config[_0x6a22('0x49')],_0x6a22('0x41')),_0x6a22('0x42'));var _0x5cac03=ejs[_0x6a22('0x43')](_0x529652,{'networks':_0x96e40b||[]});fs[_0x6a22('0x44')](_0x6a22('0x45'),_0x5cac03);return respondWithRpcPromise(_0x6a22('0x50'),_0x6a22('0x1c'),{'module':_0x6a22('0x4c')});}else if(_0x49f4fd[_0x6a22('0x23')][_0x6a22('0x46')]()==_0x6a22('0x47')){var _0x422266=fs['readFileSync'](path[_0x6a22('0x40')](config[_0x6a22('0x49')],'server/files/templates/turn_multiple.ejs'),_0x6a22('0x42'));var _0x55e8ca=ejs[_0x6a22('0x43')](_0x422266,{'networks':_0x96e40b||[]});fs[_0x6a22('0x44')]('/etc/asterisk/turn_xcally.conf',_0x55e8ca);return respondWithRpcPromise(_0x6a22('0x50'),_0x6a22('0x1c'),{'module':_0x6a22('0x4c')});}else{var _0x89e424=fs['readFileSync'](path[_0x6a22('0x40')](config[_0x6a22('0x49')],'server/files/templates/network.ejs'),_0x6a22('0x42'));var _0x3db057=ejs[_0x6a22('0x43')](_0x89e424,{'networks':_0x96e40b||[]});fs['writeFileSync'](util['format'](_0x6a22('0x4e'),_0xc60a77[_0x6a22('0x3f')][_0x6a22('0x23')]['toLowerCase']()),_0x3db057);return respondWithRpcPromise('Reload',_0x6a22('0x1c'),{'module':_0x6a22('0x52')});}})['then'](function(_0x535e85){if(_0x535e85){return _0x49f4fd;}return null;})[_0x6a22('0x1e')](respondWithResult(_0x5f524a,null))[_0x6a22('0x14')](handleError(_0x5f524a,null));};exports[_0x6a22('0x1d')]=function(_0x242274,_0x4eef9e){var _0x46a3cd;return db[_0x6a22('0x36')][_0x6a22('0x3d')]({'where':{'id':_0x242274[_0x6a22('0x3b')]['id']}})[_0x6a22('0x1e')](function(_0x16c73f){_0x46a3cd=_0x16c73f;return _0x16c73f;})[_0x6a22('0x1e')](handleEntityNotFound(_0x4eef9e,null))[_0x6a22('0x1e')](removeEntity(_0x4eef9e,null))[_0x6a22('0x1e')](function(){if(_0x46a3cd){return db[_0x6a22('0x36')][_0x6a22('0x38')]({'where':{'type':_0x46a3cd['type']},'raw':!![]});}})[_0x6a22('0x1e')](function(_0x35e522){if(_0x46a3cd['type'][_0x6a22('0x46')]()=='STUN'){var _0x498762=fs[_0x6a22('0x48')](path[_0x6a22('0x40')](config[_0x6a22('0x49')],_0x6a22('0x41')),'utf8');var _0x32158f=ejs[_0x6a22('0x43')](_0x498762,{'networks':_0x35e522||[]});fs['writeFileSync'](_0x6a22('0x45'),_0x32158f);return respondWithRpcPromise('Reload',_0x6a22('0x1d'),{'module':_0x6a22('0x4c')});}else if(_0x46a3cd[_0x6a22('0x23')]['toUpperCase']()==_0x6a22('0x47')){var _0x2dac26=fs[_0x6a22('0x48')](path[_0x6a22('0x40')](config[_0x6a22('0x49')],_0x6a22('0x4a')),_0x6a22('0x42'));var _0x8fac35=ejs[_0x6a22('0x43')](_0x2dac26,{'networks':_0x35e522||[]});fs[_0x6a22('0x44')]('/etc/asterisk/turn_xcally.conf',_0x8fac35);return respondWithRpcPromise(_0x6a22('0x50'),'destroy',{'module':_0x6a22('0x4c')});}else{var _0x359b41=fs[_0x6a22('0x48')](path[_0x6a22('0x40')](config['root'],_0x6a22('0x4d')),_0x6a22('0x42'));var _0x475f39=ejs['render'](_0x359b41,{'networks':_0x35e522||[]});fs[_0x6a22('0x44')](util[_0x6a22('0x53')](_0x6a22('0x4e'),_0x46a3cd[_0x6a22('0x23')][_0x6a22('0x4f')]()),_0x475f39);return respondWithRpcPromise(_0x6a22('0x50'),_0x6a22('0x1d'),{'module':_0x6a22('0x52')});}})[_0x6a22('0x14')](handleError(_0x4eef9e,null));}; \ No newline at end of file +var _0x0fe8=['length','model','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','create','findAll','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','find','params','root','body','toLowerCase','destroy','server/files/templates/network.ejs','util','path','ejs','lodash','../../components/parsers/qs','../../config/environment','jayson/promise','client','http','then','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Network,\x20%s,\x20%s','message','result','catch','status','limit','undefined','count','offset','set','Content-Range','json','update','end','sendStatus','name','send','map','Network','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields'];(function(_0x56a616,_0x5a3c7c){var _0xe94844=function(_0x1d3816){while(--_0x1d3816){_0x56a616['push'](_0x56a616['shift']());}};_0xe94844(++_0x5a3c7c);}(_0x0fe8,0xc4));var _0x80fe=function(_0x368e49,_0x35129c){_0x368e49=_0x368e49-0x0;var _0x35423e=_0x0fe8[_0x368e49];return _0x35423e;};'use strict';var util=require(_0x80fe('0x0'));var path=require(_0x80fe('0x1'));var ejs=require(_0x80fe('0x2'));var fs=require('fs');var _=require(_0x80fe('0x3'));var qs=require(_0x80fe('0x4'));var logger=require('../../config/logger')('api');var config=require(_0x80fe('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0x80fe('0x6'));var client=jayson[_0x80fe('0x7')][_0x80fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d4544,_0x56f33f,_0x14cfc2,_0x1869e8){return new Promise(function(_0x338c36,_0x4d5161){var _0x26891c=_0x1869e8||client;return _0x26891c['request'](_0x1d4544,_0x14cfc2)[_0x80fe('0x9')](function(_0x2d0163){logger[_0x80fe('0xa')]('Network,\x20%s,\x20%s',_0x56f33f,'request\x20sent');logger[_0x80fe('0xb')](_0x80fe('0xc'),_0x56f33f,_0x80fe('0xd'),JSON['stringify'](_0x2d0163));if(_0x2d0163[_0x80fe('0xe')]){if(_0x2d0163[_0x80fe('0xe')][_0x80fe('0xf')]===0x1f4){logger[_0x80fe('0xe')](_0x80fe('0x10'),_0x56f33f,_0x2d0163[_0x80fe('0xe')]['message']);return _0x4d5161(_0x2d0163[_0x80fe('0xe')][_0x80fe('0x11')]);}logger[_0x80fe('0xe')](_0x80fe('0x10'),_0x56f33f,_0x2d0163[_0x80fe('0xe')]['message']);return _0x338c36(_0x2d0163['error']['message']);}else{logger[_0x80fe('0xa')]('Network,\x20%s,\x20%s',_0x56f33f,_0x80fe('0xd'));_0x338c36(_0x2d0163[_0x80fe('0x12')][_0x80fe('0x11')]);}})[_0x80fe('0x13')](function(_0x5e1a5d){logger['error'](_0x80fe('0x10'),_0x56f33f,_0x5e1a5d);_0x4d5161(_0x5e1a5d);});});}function respondWithResult(_0x486fdb,_0x15359d){_0x15359d=_0x15359d||0xc8;return function(_0x1311f2){if(_0x1311f2){return _0x486fdb[_0x80fe('0x14')](_0x15359d)['json'](_0x1311f2);}};}function respondWithFilteredResult(_0x189248,_0x17a9a5){return function(_0x271b2a){if(_0x271b2a){var _0xbdb14=typeof _0x17a9a5['offset']==='undefined'&&typeof _0x17a9a5[_0x80fe('0x15')]===_0x80fe('0x16');var _0x5e7ca4=_0x271b2a[_0x80fe('0x17')];var _0x335bc4=_0xbdb14?0x0:_0x17a9a5[_0x80fe('0x18')];var _0x509a3d=_0xbdb14?_0x271b2a[_0x80fe('0x17')]:_0x17a9a5[_0x80fe('0x18')]+_0x17a9a5[_0x80fe('0x15')];var _0x511101;if(_0x509a3d>=_0x5e7ca4){_0x509a3d=_0x5e7ca4;_0x511101=0xc8;}else{_0x511101=0xce;}_0x189248[_0x80fe('0x14')](_0x511101);return _0x189248[_0x80fe('0x19')](_0x80fe('0x1a'),_0x335bc4+'-'+_0x509a3d+'/'+_0x5e7ca4)[_0x80fe('0x1b')](_0x271b2a);}return null;};}function saveUpdates(_0x40b220){return function(_0xc67e7d){if(_0xc67e7d){return _0xc67e7d[_0x80fe('0x1c')](_0x40b220)[_0x80fe('0x9')](function(_0x26fb74){return _0x26fb74;});}return null;};}function removeEntity(_0x5918a7){return function(_0x59f236){if(_0x59f236){return _0x59f236['destroy']()[_0x80fe('0x9')](function(){_0x5918a7['status'](0xcc)[_0x80fe('0x1d')]();});}};}function handleEntityNotFound(_0x4413d8){return function(_0x1ac0ec){if(!_0x1ac0ec){_0x4413d8[_0x80fe('0x1e')](0x194);}return _0x1ac0ec;};}function handleError(_0x4f21e9,_0x51020c){_0x51020c=_0x51020c||0x1f4;return function(_0x3dfdf1){logger[_0x80fe('0xe')](_0x3dfdf1['stack']);if(_0x3dfdf1['name']){delete _0x3dfdf1[_0x80fe('0x1f')];}_0x4f21e9[_0x80fe('0x14')](_0x51020c)[_0x80fe('0x20')](_0x3dfdf1);};}exports['index']=function(_0x5f2a26,_0x31c92d){var _0x437a85={},_0x3e8128={},_0x5269a4={'count':0x0,'rows':[]};var _0x805b39=_[_0x80fe('0x21')](db[_0x80fe('0x22')][_0x80fe('0x23')],function(_0x399d73){return{'name':_0x399d73[_0x80fe('0x24')],'type':_0x399d73[_0x80fe('0x25')][_0x80fe('0x26')]};});_0x3e8128['model']=_[_0x80fe('0x21')](_0x805b39,_0x80fe('0x1f'));_0x3e8128[_0x80fe('0x27')]=_[_0x80fe('0x28')](_0x5f2a26[_0x80fe('0x27')]);_0x3e8128['filters']=_[_0x80fe('0x29')](_0x3e8128['model'],_0x3e8128[_0x80fe('0x27')]);_0x437a85[_0x80fe('0x2a')]=_[_0x80fe('0x29')](_0x3e8128['model'],qs['fields'](_0x5f2a26[_0x80fe('0x27')][_0x80fe('0x2b')]));_0x437a85[_0x80fe('0x2a')]=_0x437a85['attributes'][_0x80fe('0x2c')]?_0x437a85['attributes']:_0x3e8128[_0x80fe('0x2d')];if(!_0x5f2a26[_0x80fe('0x27')][_0x80fe('0x2e')]('nolimit')){_0x437a85['limit']=qs[_0x80fe('0x15')](_0x5f2a26['query'][_0x80fe('0x15')]);_0x437a85[_0x80fe('0x18')]=qs['offset'](_0x5f2a26[_0x80fe('0x27')][_0x80fe('0x18')]);}_0x437a85['order']=qs[_0x80fe('0x2f')](_0x5f2a26[_0x80fe('0x27')]['sort']);_0x437a85['where']=qs['filters'](_['pick'](_0x5f2a26[_0x80fe('0x27')],_0x3e8128['filters']),_0x805b39);if(_0x5f2a26[_0x80fe('0x27')][_0x80fe('0x30')]){_0x437a85[_0x80fe('0x31')]=_[_0x80fe('0x32')](_0x437a85[_0x80fe('0x31')],{'$or':_[_0x80fe('0x21')](_0x805b39,function(_0x3f86ad){if(_0x3f86ad[_0x80fe('0x25')]!=='VIRTUAL'){var _0x1ee3d7={};_0x1ee3d7[_0x3f86ad[_0x80fe('0x1f')]]={'$like':'%'+_0x5f2a26[_0x80fe('0x27')][_0x80fe('0x30')]+'%'};return _0x1ee3d7;}})});}_0x437a85=_['merge']({},_0x437a85,_0x5f2a26[_0x80fe('0x33')]);var _0x36c3ad={'where':_0x437a85['where']};return db[_0x80fe('0x22')]['count'](_0x36c3ad)['then'](function(_0x4ff118){_0x5269a4[_0x80fe('0x17')]=_0x4ff118;if(_0x5f2a26[_0x80fe('0x27')][_0x80fe('0x34')]){_0x437a85[_0x80fe('0x35')]=[{'all':!![]}];}return db['Network']['findAll'](_0x437a85);})[_0x80fe('0x9')](function(_0x4b0a6c){_0x5269a4['rows']=_0x4b0a6c;return _0x5269a4;})[_0x80fe('0x9')](respondWithFilteredResult(_0x31c92d,_0x437a85))['catch'](handleError(_0x31c92d,null));};exports['show']=function(_0x47b4ff,_0x32c01f){var _0x19da4c={'raw':!![],'where':{'id':_0x47b4ff['params']['id']}},_0x274903={};_0x274903[_0x80fe('0x2d')]=_[_0x80fe('0x28')](db[_0x80fe('0x22')][_0x80fe('0x23')]);_0x274903[_0x80fe('0x27')]=_[_0x80fe('0x28')](_0x47b4ff['query']);_0x274903['filters']=_['intersection'](_0x274903[_0x80fe('0x2d')],_0x274903[_0x80fe('0x27')]);_0x19da4c[_0x80fe('0x2a')]=_['intersection'](_0x274903[_0x80fe('0x2d')],qs[_0x80fe('0x2b')](_0x47b4ff[_0x80fe('0x27')][_0x80fe('0x2b')]));_0x19da4c[_0x80fe('0x2a')]=_0x19da4c[_0x80fe('0x2a')]['length']?_0x19da4c[_0x80fe('0x2a')]:_0x274903[_0x80fe('0x2d')];if(_0x47b4ff[_0x80fe('0x27')][_0x80fe('0x34')]){_0x19da4c[_0x80fe('0x35')]=[{'all':!![]}];}_0x19da4c=_[_0x80fe('0x32')]({},_0x19da4c,_0x47b4ff['options']);return db['Network']['find'](_0x19da4c)[_0x80fe('0x9')](handleEntityNotFound(_0x32c01f,null))[_0x80fe('0x9')](respondWithResult(_0x32c01f,null))[_0x80fe('0x13')](handleError(_0x32c01f,null));};exports[_0x80fe('0x36')]=function(_0x3c88c7,_0x5f5df2){var _0x283c92;return db[_0x80fe('0x22')][_0x80fe('0x36')](_0x3c88c7['body'],{'raw':!![]})[_0x80fe('0x9')](function(_0x484699){_0x283c92=_0x484699;return db[_0x80fe('0x22')][_0x80fe('0x37')]({'where':{'type':_0x3c88c7['body'][_0x80fe('0x25')]},'raw':!![]});})[_0x80fe('0x9')](function(_0x4645f1){if(_0x283c92['type'][_0x80fe('0x38')]()==_0x80fe('0x39')){var _0x1a431c=fs[_0x80fe('0x3a')](path[_0x80fe('0x3b')](config['root'],_0x80fe('0x3c')),_0x80fe('0x3d'));var _0x13ab4c=ejs[_0x80fe('0x3e')](_0x1a431c,{'networks':_0x4645f1||[]});fs[_0x80fe('0x3f')](_0x80fe('0x40'),_0x13ab4c);return respondWithRpcPromise('Reload',_0x80fe('0x36'),{'module':_0x80fe('0x41')});}else if(_0x283c92[_0x80fe('0x25')][_0x80fe('0x38')]()==_0x80fe('0x42')){var _0x3c1847=fs[_0x80fe('0x3a')](path[_0x80fe('0x3b')](config['root'],_0x80fe('0x43')),_0x80fe('0x3d'));var _0x2f5f98=ejs[_0x80fe('0x3e')](_0x3c1847,{'networks':_0x4645f1||[]});fs[_0x80fe('0x3f')](_0x80fe('0x44'),_0x2f5f98);return respondWithRpcPromise(_0x80fe('0x45'),_0x80fe('0x36'),{'module':'res_stun_monitor.so'});}else{var _0x31f42c=fs[_0x80fe('0x3a')](path['join'](config['root'],'server/files/templates/network.ejs'),_0x80fe('0x3d'));var _0x119837=ejs[_0x80fe('0x3e')](_0x31f42c,{'networks':_0x4645f1||[]});fs[_0x80fe('0x3f')](util[_0x80fe('0x46')](_0x80fe('0x47'),_0x3c88c7['body']['type']['toLowerCase']()),_0x119837);return respondWithRpcPromise(_0x80fe('0x45'),_0x80fe('0x36'),{'module':_0x80fe('0x48')});}})['then'](function(){return _0x283c92;})['then'](respondWithResult(_0x5f5df2,0xc9))[_0x80fe('0x13')](handleError(_0x5f5df2,null));};exports['update']=function(_0x33afd2,_0x279756){var _0x42df1f;return db['Network'][_0x80fe('0x49')]({'where':{'id':_0x33afd2[_0x80fe('0x4a')]['id']}})[_0x80fe('0x9')](handleEntityNotFound(_0x279756,null))['then'](saveUpdates(_0x33afd2['body'],null))[_0x80fe('0x9')](function(_0x378b6d){if(_0x378b6d){_0x42df1f=_0x378b6d;return db[_0x80fe('0x22')]['findAll']({'where':{'type':_0x42df1f[_0x80fe('0x25')]},'raw':!![]});}return null;})[_0x80fe('0x9')](function(_0x15c880){if(_0x42df1f[_0x80fe('0x25')][_0x80fe('0x38')]()=='STUN'){var _0x5bcd90=fs[_0x80fe('0x3a')](path[_0x80fe('0x3b')](config[_0x80fe('0x4b')],'server/files/templates/stun_multiple.ejs'),_0x80fe('0x3d'));var _0x44a394=ejs[_0x80fe('0x3e')](_0x5bcd90,{'networks':_0x15c880||[]});fs[_0x80fe('0x3f')](_0x80fe('0x40'),_0x44a394);return respondWithRpcPromise('Reload',_0x80fe('0x1c'),{'module':'res_stun_monitor.so'});}else if(_0x42df1f[_0x80fe('0x25')]['toUpperCase']()==_0x80fe('0x42')){var _0x41d8cc=fs['readFileSync'](path[_0x80fe('0x3b')](config['root'],_0x80fe('0x43')),'utf8');var _0x2b1bd8=ejs[_0x80fe('0x3e')](_0x41d8cc,{'networks':_0x15c880||[]});fs[_0x80fe('0x3f')]('/etc/asterisk/turn_xcally.conf',_0x2b1bd8);return respondWithRpcPromise(_0x80fe('0x45'),_0x80fe('0x1c'),{'module':_0x80fe('0x41')});}else{var _0x3b0d85=fs['readFileSync'](path['join'](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x5b26c8=ejs['render'](_0x3b0d85,{'networks':_0x15c880||[]});fs['writeFileSync'](util[_0x80fe('0x46')](_0x80fe('0x47'),_0x33afd2[_0x80fe('0x4c')][_0x80fe('0x25')][_0x80fe('0x4d')]()),_0x5b26c8);return respondWithRpcPromise(_0x80fe('0x45'),_0x80fe('0x1c'),{'module':_0x80fe('0x48')});}})[_0x80fe('0x9')](function(_0x5c0a9f){if(_0x5c0a9f){return _0x42df1f;}return null;})[_0x80fe('0x9')](respondWithResult(_0x279756,null))[_0x80fe('0x13')](handleError(_0x279756,null));};exports[_0x80fe('0x4e')]=function(_0x2cbd27,_0x45db0a){var _0x56798a;return db['Network'][_0x80fe('0x49')]({'where':{'id':_0x2cbd27['params']['id']}})[_0x80fe('0x9')](function(_0x2dcf9c){_0x56798a=_0x2dcf9c;return _0x2dcf9c;})[_0x80fe('0x9')](handleEntityNotFound(_0x45db0a,null))[_0x80fe('0x9')](removeEntity(_0x45db0a,null))[_0x80fe('0x9')](function(){if(_0x56798a){return db[_0x80fe('0x22')][_0x80fe('0x37')]({'where':{'type':_0x56798a['type']},'raw':!![]});}})[_0x80fe('0x9')](function(_0x2deed4){if(_0x56798a[_0x80fe('0x25')][_0x80fe('0x38')]()=='STUN'){var _0x1812b7=fs['readFileSync'](path['join'](config[_0x80fe('0x4b')],_0x80fe('0x3c')),_0x80fe('0x3d'));var _0x43be21=ejs['render'](_0x1812b7,{'networks':_0x2deed4||[]});fs[_0x80fe('0x3f')](_0x80fe('0x40'),_0x43be21);return respondWithRpcPromise(_0x80fe('0x45'),_0x80fe('0x4e'),{'module':_0x80fe('0x41')});}else if(_0x56798a[_0x80fe('0x25')][_0x80fe('0x38')]()==_0x80fe('0x42')){var _0x1fbf30=fs[_0x80fe('0x3a')](path['join'](config['root'],_0x80fe('0x43')),_0x80fe('0x3d'));var _0x1046bf=ejs[_0x80fe('0x3e')](_0x1fbf30,{'networks':_0x2deed4||[]});fs[_0x80fe('0x3f')](_0x80fe('0x44'),_0x1046bf);return respondWithRpcPromise(_0x80fe('0x45'),_0x80fe('0x4e'),{'module':_0x80fe('0x41')});}else{var _0x3395c1=fs[_0x80fe('0x3a')](path[_0x80fe('0x3b')](config['root'],_0x80fe('0x4f')),_0x80fe('0x3d'));var _0x3d8765=ejs['render'](_0x3395c1,{'networks':_0x2deed4||[]});fs[_0x80fe('0x3f')](util[_0x80fe('0x46')](_0x80fe('0x47'),_0x56798a[_0x80fe('0x25')][_0x80fe('0x4d')]()),_0x3d8765);return respondWithRpcPromise(_0x80fe('0x45'),_0x80fe('0x4e'),{'module':_0x80fe('0x48')});}})[_0x80fe('0x13')](handleError(_0x45db0a,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 90e5803..a777452 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 _0xb4e6=['path','rimraf','./network.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x27b295,_0x165173){var _0x47c640=function(_0x1b8702){while(--_0x1b8702){_0x27b295['push'](_0x27b295['shift']());}};_0x47c640(++_0x165173);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xb4e6[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4746=['rimraf','../../config/environment','exports','define','Network','network','lodash','util','api','bluebird','request-promise','path'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x4746,0xc6));var _0x6474=function(_0x47ccfc,_0x174e80){_0x47ccfc=_0x47ccfc-0x0;var _0x118cb0=_0x4746[_0x47ccfc];return _0x118cb0;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var logger=require('../../config/logger')(_0x6474('0x2'));var moment=require('moment');var BPromise=require(_0x6474('0x3'));var rp=require(_0x6474('0x4'));var fs=require('fs');var path=require(_0x6474('0x5'));var rimraf=require(_0x6474('0x6'));var config=require(_0x6474('0x7'));var attributes=require('./network.attributes');module[_0x6474('0x8')]=function(_0x2bcf7c,_0x4cadd7){return _0x2bcf7c[_0x6474('0x9')](_0x6474('0xa'),attributes,{'tableName':_0x6474('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 99f81c2..c9b7d1b 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x3a7a2d,_0x41b0df){_0x3a7a2d=_0x3a7a2d-0x0;var _0x3ef231=_0x7a54[_0x3a7a2d];return _0x3ef231;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x421580,_0xcaa76c){var _0x3adf8c=function(_0x58ce53){while(--_0x58ce53){_0x421580['push'](_0x421580['shift']());}};_0x3adf8c(++_0xcaa76c);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 3d362c4..6ed2a02 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 _0x4364=['removeDispositions','removeAgents','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addAgents','/:id/send','put','update','delete','destroy'];(function(_0x2db21f,_0x5f5843){var _0x5de05d=function(_0xa989d1){while(--_0xa989d1){_0x2db21f['push'](_0x2db21f['shift']());}};_0x5de05d(++_0x5f5843);}(_0x4364,0x1f2));var _0x4436=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4364[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require('multer');var util=require(_0x4436('0x0'));var path=require(_0x4436('0x1'));var timeout=require(_0x4436('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4436('0x3'));var config=require(_0x4436('0x4'));var controller=require('./openchannelAccount.controller');router[_0x4436('0x5')]('/',auth['isAuthenticated'](),controller[_0x4436('0x6')]);router[_0x4436('0x5')](_0x4436('0x7'),auth[_0x4436('0x8')](),controller['describe']);router['get'](_0x4436('0x9'),auth['isAuthenticated'](),controller[_0x4436('0xa')]);router['get'](_0x4436('0xb'),auth['isAuthenticated'](),controller[_0x4436('0xc')]);router[_0x4436('0x5')](_0x4436('0xd'),auth[_0x4436('0x8')](),controller[_0x4436('0xe')]);router[_0x4436('0x5')](_0x4436('0xf'),auth[_0x4436('0x8')](),controller['getApplications']);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x4436('0x10')]);router[_0x4436('0x5')](_0x4436('0x11'),auth[_0x4436('0x8')](),controller[_0x4436('0x12')]);router[_0x4436('0x13')]('/',auth[_0x4436('0x8')](),controller[_0x4436('0x14')]);router[_0x4436('0x13')](_0x4436('0xb'),auth[_0x4436('0x8')](),controller[_0x4436('0x15')]);router[_0x4436('0x13')](_0x4436('0xd'),auth[_0x4436('0x8')](),controller['addAnswer']);router[_0x4436('0x13')](_0x4436('0x16'),controller[_0x4436('0x17')]);router[_0x4436('0x13')](_0x4436('0xf'),auth[_0x4436('0x8')](),controller['addApplications']);router[_0x4436('0x13')](_0x4436('0x11'),auth['isAuthenticated'](),controller[_0x4436('0x18')]);router[_0x4436('0x13')](_0x4436('0x19'),auth['isAuthenticated'](),controller['send']);router[_0x4436('0x1a')](_0x4436('0x9'),auth['isAuthenticated'](),controller[_0x4436('0x1b')]);router[_0x4436('0x1c')]('/:id',auth[_0x4436('0x8')](),controller[_0x4436('0x1d')]);router[_0x4436('0x1c')](_0x4436('0xb'),auth['isAuthenticated'](),controller[_0x4436('0x1e')]);router['delete'](_0x4436('0xd'),auth[_0x4436('0x8')](),controller['removeAnswers']);router[_0x4436('0x1c')]('/:id/users',auth[_0x4436('0x8')](),controller[_0x4436('0x1f')]);module[_0x4436('0x20')]=router; \ No newline at end of file +var _0xe76d=['removeAnswers','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/applications','/:id/send','put','/:id','delete','destroy','removeDispositions'];(function(_0xa013a4,_0x2ff249){var _0x27f4a2=function(_0x1a5a6f){while(--_0x1a5a6f){_0xa013a4['push'](_0xa013a4['shift']());}};_0x27f4a2(++_0x2ff249);}(_0xe76d,0x1f0));var _0xde76=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xe76d[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xde76('0x0'));var util=require('util');var path=require(_0xde76('0x1'));var timeout=require(_0xde76('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xde76('0x3'));var auth=require(_0xde76('0x4'));var interaction=require(_0xde76('0x5'));var config=require(_0xde76('0x6'));var controller=require(_0xde76('0x7'));router['get']('/',auth[_0xde76('0x8')](),controller[_0xde76('0x9')]);router[_0xde76('0xa')](_0xde76('0xb'),auth['isAuthenticated'](),controller[_0xde76('0xc')]);router[_0xde76('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xde76('0xd')]);router[_0xde76('0xa')](_0xde76('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xde76('0xa')](_0xde76('0xf'),auth[_0xde76('0x8')](),controller[_0xde76('0x10')]);router[_0xde76('0xa')]('/:id/applications',auth[_0xde76('0x8')](),controller[_0xde76('0x11')]);router[_0xde76('0xa')](_0xde76('0x12'),auth['isAuthenticated'](),controller[_0xde76('0x13')]);router[_0xde76('0xa')](_0xde76('0x14'),auth[_0xde76('0x8')](),controller[_0xde76('0x15')]);router[_0xde76('0x16')]('/',auth['isAuthenticated'](),controller[_0xde76('0x17')]);router[_0xde76('0x16')](_0xde76('0xe'),auth[_0xde76('0x8')](),controller['addDisposition']);router['post'](_0xde76('0xf'),auth[_0xde76('0x8')](),controller[_0xde76('0x18')]);router[_0xde76('0x16')]('/:id/notify',controller['notify']);router[_0xde76('0x16')](_0xde76('0x19'),auth[_0xde76('0x8')](),controller['addApplications']);router[_0xde76('0x16')](_0xde76('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0xde76('0x16')](_0xde76('0x1a'),auth[_0xde76('0x8')](),controller['send']);router[_0xde76('0x1b')](_0xde76('0x1c'),auth['isAuthenticated'](),controller['update']);router[_0xde76('0x1d')](_0xde76('0x1c'),auth['isAuthenticated'](),controller[_0xde76('0x1e')]);router['delete'](_0xde76('0xe'),auth[_0xde76('0x8')](),controller[_0xde76('0x1f')]);router[_0xde76('0x1d')](_0xde76('0xf'),auth[_0xde76('0x8')](),controller[_0xde76('0x20')]);router[_0xde76('0x1d')](_0xde76('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 2e64cd3..9e95657 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 _0xd72f=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER'];(function(_0x4088a4,_0x4218ee){var _0x5e621e=function(_0x1fdf60){while(--_0x1fdf60){_0x4088a4['push'](_0x4088a4['shift']());}};_0x5e621e(++_0x4218ee);}(_0xd72f,0xfb));var _0xfd72=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xd72f[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0xfd72('0x0'));var rs=require(_0xfd72('0x1'));module[_0xfd72('0x2')]={'name':{'type':Sequelize[_0xfd72('0x3')],'unique':_0xfd72('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xfd72('0x5')]();}},'replyUri':{'type':Sequelize[_0xfd72('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfd72('0x6')],'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[_0xfd72('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfd72('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfd72('0x3')]},'queueTransfer':{'type':Sequelize[_0xfd72('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfd72('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfd72('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfd72('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xfd72('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xfd72('0x7')],'defaultValue':![],'comment':_0xfd72('0xa'),'set':function(_0x1c3ce6){if(!_0x1c3ce6)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xfd72('0xb')](_0xfd72('0xc'),_0x1c3ce6);}}}; \ No newline at end of file +var _0xa0c9=['exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x52ece1,_0x425dc5){var _0x329205=function(_0xf76c47){while(--_0xf76c47){_0x52ece1['push'](_0x52ece1['shift']());}};_0x329205(++_0x425dc5);}(_0xa0c9,0xec));var _0x9a0c=function(_0x72f47d,_0x573fca){_0x72f47d=_0x72f47d-0x0;var _0x4cfc6a=_0xa0c9[_0x72f47d];return _0x4cfc6a;};'use strict';var Sequelize=require(_0x9a0c('0x0'));var rs=require(_0x9a0c('0x1'));module[_0x9a0c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x9a0c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9a0c('0x4')]},'token':{'type':Sequelize[_0x9a0c('0x4')],'defaultValue':function(){return rs[_0x9a0c('0x5')]();}},'replyUri':{'type':Sequelize[_0x9a0c('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9a0c('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9a0c('0x6')],'defaultValue':function(){return _0x9a0c('0x7');}},'notificationSound':{'type':Sequelize[_0x9a0c('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x9a0c('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9a0c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9a0c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9a0c('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x9a0c('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x9a0c('0x8')],'defaultValue':![],'comment':_0x9a0c('0xb'),'set':function(_0x2c7140){if(!_0x2c7140)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9a0c('0xc')](_0x9a0c('0xd'),_0x2c7140);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f5cc848..3a8e3dd 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 _0x0d77=['Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','Pause','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','OpenchannelAccount','includeAll','findAll','rows','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','mapKey','includes','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','asc','firstName','threadId','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','options','getApplications','getInteractions','OpenchannelInteraction','User','Owner','fullname','internal','Tag','color','tag','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x0d77,0x8b));var _0x70d7=function(_0x1aec2c,_0x46e47f){_0x1aec2c=_0x1aec2c-0x0;var _0x4ad327=_0x0d77[_0x1aec2c];return _0x4ad327;};'use strict';var emlformat=require(_0x70d7('0x0'));var rimraf=require(_0x70d7('0x1'));var zipdir=require(_0x70d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x70d7('0x3'));var moment=require(_0x70d7('0x4'));var BPromise=require(_0x70d7('0x5'));var Mustache=require('mustache');var util=require(_0x70d7('0x6'));var path=require(_0x70d7('0x7'));var sox=require('sox');var csv=require(_0x70d7('0x8'));var ejs=require(_0x70d7('0x9'));var fs=require('fs');var fs_extra=require(_0x70d7('0xa'));var _=require(_0x70d7('0xb'));var squel=require(_0x70d7('0xc'));var crypto=require('crypto');var jsforce=require(_0x70d7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x70d7('0x8'));var querystring=require('querystring');var Papa=require(_0x70d7('0xe'));var Redis=require('ioredis');var authService=require(_0x70d7('0xf'));var qs=require(_0x70d7('0x10'));var as=require(_0x70d7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70d7('0x12'))(_0x70d7('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x70d7('0x14'));var db=require(_0x70d7('0x15'))['db'];config[_0x70d7('0x16')]=_[_0x70d7('0x17')](config[_0x70d7('0x16')],{'host':_0x70d7('0x18'),'port':0x18eb});var socket=require(_0x70d7('0x19'))(new Redis(config[_0x70d7('0x16')]));require(_0x70d7('0x1a'))[_0x70d7('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x70d7('0x1c')][_0x70d7('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x70d7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x227b33,_0x4e9dfd,_0x5e10fc,_0x5dfbc2){return new BPromise(function(_0x2c9956,_0x373b23){var _0x272269=_0x5dfbc2||client;return _0x272269[_0x70d7('0x1e')](_0x227b33,_0x5e10fc)[_0x70d7('0x1f')](function(_0x3e2c9a){logger[_0x70d7('0x20')](_0x70d7('0x21'),_0x4e9dfd,'request\x20sent');logger[_0x70d7('0x22')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4e9dfd,_0x70d7('0x23'),JSON[_0x70d7('0x24')](_0x3e2c9a));if(_0x3e2c9a['error']){if(_0x3e2c9a[_0x70d7('0x25')]['code']===0x1f4){logger[_0x70d7('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x4e9dfd,_0x3e2c9a[_0x70d7('0x25')][_0x70d7('0x26')]);return _0x373b23(_0x3e2c9a[_0x70d7('0x25')][_0x70d7('0x26')]);}logger[_0x70d7('0x25')](_0x70d7('0x21'),_0x4e9dfd,_0x3e2c9a[_0x70d7('0x25')][_0x70d7('0x26')]);return _0x2c9956(_0x3e2c9a['error']['message']);}else{logger[_0x70d7('0x20')](_0x70d7('0x21'),_0x4e9dfd,_0x70d7('0x23'));_0x2c9956(_0x3e2c9a[_0x70d7('0x27')]['message']);}})[_0x70d7('0x28')](function(_0x378349){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4e9dfd,_0x378349);_0x373b23(_0x378349);});});}function respondWithStatusCode(_0x3d44fa,_0x184ec9){_0x184ec9=_0x184ec9||0xcc;return function(_0x275fd4){if(_0x275fd4){return _0x3d44fa[_0x70d7('0x29')](_0x184ec9);}return _0x3d44fa[_0x70d7('0x2a')](_0x184ec9)[_0x70d7('0x2b')]();};}function respondWithResult(_0x2ccce1,_0x2d3bc0){_0x2d3bc0=_0x2d3bc0||0xc8;return function(_0x64586a){if(_0x64586a){return _0x2ccce1['status'](_0x2d3bc0)[_0x70d7('0x2c')](_0x64586a);}};}function respondWithFilteredResult(_0x5e9b43,_0x4fb48d){return function(_0x3a6ab8){if(_0x3a6ab8){var _0x3f078d=typeof _0x4fb48d[_0x70d7('0x2d')]===_0x70d7('0x2e')&&typeof _0x4fb48d[_0x70d7('0x2f')]===_0x70d7('0x2e');var _0x2753b8=_0x3a6ab8[_0x70d7('0x30')];var _0x1b7d3e=_0x3f078d?0x0:_0x4fb48d[_0x70d7('0x2d')];var _0x112062=_0x3f078d?_0x3a6ab8[_0x70d7('0x30')]:_0x4fb48d[_0x70d7('0x2d')]+_0x4fb48d[_0x70d7('0x2f')];var _0x5550a2;if(_0x112062>=_0x2753b8){_0x112062=_0x2753b8;_0x5550a2=0xc8;}else{_0x5550a2=0xce;}_0x5e9b43[_0x70d7('0x2a')](_0x5550a2);return _0x5e9b43[_0x70d7('0x31')](_0x70d7('0x32'),_0x1b7d3e+'-'+_0x112062+'/'+_0x2753b8)[_0x70d7('0x2c')](_0x3a6ab8);}return null;};}function patchUpdates(_0x3d0814){return function(_0x412802){try{jsonpatch['apply'](_0x412802,_0x3d0814,!![]);}catch(_0x11551c){return BPromise[_0x70d7('0x33')](_0x11551c);}return _0x412802[_0x70d7('0x34')]();};}function saveUpdates(_0x3257c5,_0x12f5a4){return function(_0x3441aa){if(_0x3441aa){return _0x3441aa[_0x70d7('0x35')](_0x3257c5)[_0x70d7('0x1f')](function(_0x2f876c){return _0x2f876c;});}return null;};}function removeEntity(_0x12aa60,_0x56c59b){return function(_0x1229e0){if(_0x1229e0){return _0x1229e0[_0x70d7('0x36')]()[_0x70d7('0x1f')](function(){var _0x9062cc=_0x1229e0[_0x70d7('0x37')]({'plain':!![]});var _0xe7fd2f=_0x70d7('0x38');return db[_0x70d7('0x39')][_0x70d7('0x36')]({'where':{'type':_0xe7fd2f,'resourceId':_0x9062cc['id']}})[_0x70d7('0x1f')](function(){return _0x1229e0;});})[_0x70d7('0x1f')](function(){_0x12aa60[_0x70d7('0x2a')](0xcc)[_0x70d7('0x2b')]();});}};}function handleEntityNotFound(_0x237e26,_0x19bd2b){return function(_0x41a70b){if(!_0x41a70b){_0x237e26[_0x70d7('0x29')](0x194);}return _0x41a70b;};}function handleError(_0x11c7b6,_0x429fc9){_0x429fc9=_0x429fc9||0x1f4;return function(_0x77d8b0){logger[_0x70d7('0x25')](_0x77d8b0[_0x70d7('0x3a')]);if(_0x77d8b0[_0x70d7('0x3b')]){delete _0x77d8b0[_0x70d7('0x3b')];}_0x11c7b6[_0x70d7('0x2a')](_0x429fc9)[_0x70d7('0x3c')](_0x77d8b0);};}exports['index']=function(_0x3db864,_0x2dd288){var _0x343bd6={'include':[{'model':db[_0x70d7('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1b0d46={},_0x500824={'count':0x0,'rows':[]};var _0x54d80c=_[_0x70d7('0x3e')](db['OpenchannelAccount'][_0x70d7('0x3f')],function(_0x1f7d0f){return{'name':_0x1f7d0f['fieldName'],'type':_0x1f7d0f[_0x70d7('0x40')]['key']};});_0x1b0d46[_0x70d7('0x41')]=_['map'](_0x54d80c,_0x70d7('0x3b'));_0x1b0d46['query']=_[_0x70d7('0x42')](_0x3db864[_0x70d7('0x43')]);_0x1b0d46[_0x70d7('0x44')]=_[_0x70d7('0x45')](_0x1b0d46[_0x70d7('0x41')],_0x1b0d46['query']);_0x343bd6[_0x70d7('0x46')]=_[_0x70d7('0x45')](_0x1b0d46[_0x70d7('0x41')],qs[_0x70d7('0x47')](_0x3db864['query'][_0x70d7('0x47')]));_0x343bd6['attributes']=_0x343bd6[_0x70d7('0x46')][_0x70d7('0x48')]?_0x343bd6[_0x70d7('0x46')]:_0x1b0d46[_0x70d7('0x41')];if(!_0x3db864[_0x70d7('0x43')][_0x70d7('0x49')](_0x70d7('0x4a'))){_0x343bd6['limit']=qs[_0x70d7('0x2f')](_0x3db864[_0x70d7('0x43')][_0x70d7('0x2f')]);_0x343bd6[_0x70d7('0x2d')]=qs[_0x70d7('0x2d')](_0x3db864[_0x70d7('0x43')][_0x70d7('0x2d')]);}_0x343bd6['order']=qs['sort'](_0x3db864[_0x70d7('0x43')][_0x70d7('0x4b')]);_0x343bd6[_0x70d7('0x4c')]=qs[_0x70d7('0x44')](_[_0x70d7('0x4d')](_0x3db864['query'],_0x1b0d46[_0x70d7('0x44')]),_0x54d80c);if(_0x3db864[_0x70d7('0x43')][_0x70d7('0x4e')]){_0x343bd6['where']=_['merge'](_0x343bd6['where'],{'$or':_[_0x70d7('0x3e')](_0x54d80c,function(_0xe6487f){if(_0xe6487f[_0x70d7('0x40')]!==_0x70d7('0x4f')){var _0x74d1e5={};_0x74d1e5[_0xe6487f[_0x70d7('0x3b')]]={'$like':'%'+_0x3db864['query']['filter']+'%'};return _0x74d1e5;}})});}_0x343bd6=_[_0x70d7('0x50')]({},_0x343bd6,_0x3db864['options']);var _0x4a9b84={'where':_0x343bd6[_0x70d7('0x4c')]};return db[_0x70d7('0x51')][_0x70d7('0x30')](_0x4a9b84)['then'](function(_0x746cf7){_0x500824[_0x70d7('0x30')]=_0x746cf7;if(_0x3db864[_0x70d7('0x43')][_0x70d7('0x52')]){_0x343bd6['include']=[{'all':!![]}];}return db[_0x70d7('0x51')][_0x70d7('0x53')](_0x343bd6);})['then'](function(_0x2f94e6){_0x500824[_0x70d7('0x54')]=_0x2f94e6;return _0x500824;})[_0x70d7('0x1f')](respondWithFilteredResult(_0x2dd288,_0x343bd6))['catch'](handleError(_0x2dd288,null));};exports['show']=function(_0x226c83,_0x3e6a37){var _0x2708a2={'raw':![],'where':{'id':_0x226c83[_0x70d7('0x55')]['id']},'include':[{'model':db[_0x70d7('0x3d')],'as':'mandatoryDispositionPause'}]},_0x51cbd3={};_0x51cbd3['model']=_[_0x70d7('0x42')](db['OpenchannelAccount']['rawAttributes']);_0x51cbd3[_0x70d7('0x43')]=_[_0x70d7('0x42')](_0x226c83['query']);_0x51cbd3[_0x70d7('0x44')]=_[_0x70d7('0x45')](_0x51cbd3[_0x70d7('0x41')],_0x51cbd3[_0x70d7('0x43')]);_0x2708a2['attributes']=_['intersection'](_0x51cbd3[_0x70d7('0x41')],qs['fields'](_0x226c83['query']['fields']));_0x2708a2[_0x70d7('0x46')]=_0x2708a2[_0x70d7('0x46')][_0x70d7('0x48')]?_0x2708a2[_0x70d7('0x46')]:_0x51cbd3[_0x70d7('0x41')];if(_0x226c83[_0x70d7('0x43')][_0x70d7('0x52')]){_0x2708a2[_0x70d7('0x56')]=[{'all':!![]}];}_0x2708a2=_[_0x70d7('0x50')]({},_0x2708a2,_0x226c83['options']);return db[_0x70d7('0x51')][_0x70d7('0x57')](_0x2708a2)[_0x70d7('0x1f')](handleEntityNotFound(_0x3e6a37,null))[_0x70d7('0x1f')](respondWithResult(_0x3e6a37,null))[_0x70d7('0x28')](handleError(_0x3e6a37,null));};exports[_0x70d7('0x58')]=function(_0x2a2d83,_0x86974a){return db[_0x70d7('0x51')]['create'](_0x2a2d83[_0x70d7('0x59')],{})['then'](function(_0xe442dc){var _0x3d93c5=_0x2a2d83[_0x70d7('0x5a')]['get']({'plain':!![]});if(!_0x3d93c5)throw new Error(_0x70d7('0x5b'));if(_0x3d93c5[_0x70d7('0x5c')]===_0x70d7('0x5a')){var _0x130c79=_0xe442dc['get']({'plain':!![]});var _0x18c792='OpenchannelAccounts';return db['UserProfileSection'][_0x70d7('0x57')]({'where':{'name':_0x18c792,'userProfileId':_0x3d93c5[_0x70d7('0x5d')]},'raw':!![]})[_0x70d7('0x1f')](function(_0x10d124){if(_0x10d124&&_0x10d124[_0x70d7('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x130c79[_0x70d7('0x3b')],'resourceId':_0x130c79['id'],'type':_0x10d124['name'],'sectionId':_0x10d124['id']},{})[_0x70d7('0x1f')](function(){return _0xe442dc;});}else{return _0xe442dc;}})[_0x70d7('0x28')](function(_0x139aee){logger[_0x70d7('0x25')](_0x70d7('0x5f'),_0x139aee);throw _0x139aee;});}return _0xe442dc;})[_0x70d7('0x1f')](respondWithResult(_0x86974a,0xc9))[_0x70d7('0x28')](handleError(_0x86974a,null));};exports[_0x70d7('0x35')]=function(_0xe7ed84,_0x30addc){if(_0xe7ed84[_0x70d7('0x59')]['id']){delete _0xe7ed84['body']['id'];}return db[_0x70d7('0x51')][_0x70d7('0x57')]({'where':{'id':_0xe7ed84[_0x70d7('0x55')]['id']},'include':[{'model':db[_0x70d7('0x3d')],'as':_0x70d7('0x60')}]})['then'](handleEntityNotFound(_0x30addc,null))[_0x70d7('0x1f')](saveUpdates(_0xe7ed84[_0x70d7('0x59')],null))['then'](respondWithResult(_0x30addc,null))[_0x70d7('0x28')](handleError(_0x30addc,null));};exports['destroy']=function(_0xaf330e,_0x5d606f){return db[_0x70d7('0x51')][_0x70d7('0x57')]({'where':{'id':_0xaf330e[_0x70d7('0x55')]['id']}})[_0x70d7('0x1f')](handleEntityNotFound(_0x5d606f,null))[_0x70d7('0x1f')](removeEntity(_0x5d606f,null))[_0x70d7('0x28')](handleError(_0x5d606f,null));};exports['describe']=function(_0x65281a,_0x5ad885){return db[_0x70d7('0x51')][_0x70d7('0x61')]()[_0x70d7('0x1f')](respondWithResult(_0x5ad885,null))[_0x70d7('0x28')](handleError(_0x5ad885,null));};exports[_0x70d7('0x62')]=function(_0x5ca86d,_0x5e39c4,_0x44b960){if(_0x5ca86d[_0x70d7('0x59')]['id']){delete _0x5ca86d[_0x70d7('0x59')]['id'];}return db['OpenchannelAccount'][_0x70d7('0x57')]({'where':{'id':_0x5ca86d[_0x70d7('0x55')]['id']}})[_0x70d7('0x1f')](handleEntityNotFound(_0x5e39c4,null))[_0x70d7('0x1f')](function(_0x54df04){if(_0x54df04){_0x5ca86d[_0x70d7('0x59')][_0x70d7('0x63')]=_0x54df04['id'];return db[_0x70d7('0x64')][_0x70d7('0x58')](_0x5ca86d[_0x70d7('0x59')]);}})[_0x70d7('0x1f')](respondWithResult(_0x5e39c4,null))['catch'](handleError(_0x5e39c4,null));};exports[_0x70d7('0x65')]=function(_0x47072e,_0x5ba0fb,_0x35959a){var _0x50cb41={'raw':![],'where':{}};var _0xf33cab={};var _0x26b3fb={'count':0x0,'rows':[]};return db[_0x70d7('0x51')][_0x70d7('0x66')]({'where':{'id':_0x47072e['params']['id']}})['then'](handleEntityNotFound(_0x5ba0fb,null))[_0x70d7('0x1f')](function(_0x4e0d05){if(_0x4e0d05){_0xf33cab[_0x70d7('0x41')]=_[_0x70d7('0x42')](db[_0x70d7('0x64')][_0x70d7('0x3f')]);_0xf33cab[_0x70d7('0x43')]=_['keys'](_0x47072e['query']);_0xf33cab[_0x70d7('0x44')]=_[_0x70d7('0x45')](_0xf33cab[_0x70d7('0x41')],_0xf33cab[_0x70d7('0x43')]);_0x50cb41[_0x70d7('0x46')]=_[_0x70d7('0x45')](_0xf33cab[_0x70d7('0x41')],qs['fields'](_0x47072e[_0x70d7('0x43')][_0x70d7('0x47')]));_0x50cb41[_0x70d7('0x46')]=_0x50cb41[_0x70d7('0x46')][_0x70d7('0x48')]?_0x50cb41[_0x70d7('0x46')]:_0xf33cab[_0x70d7('0x41')];if(!_0x47072e[_0x70d7('0x43')][_0x70d7('0x49')]('nolimit')){_0x50cb41[_0x70d7('0x2f')]=qs[_0x70d7('0x2f')](_0x47072e[_0x70d7('0x43')][_0x70d7('0x2f')]);_0x50cb41[_0x70d7('0x2d')]=qs[_0x70d7('0x2d')](_0x47072e[_0x70d7('0x43')][_0x70d7('0x2d')]);}_0x50cb41['order']=qs[_0x70d7('0x4b')](_0x47072e['query'][_0x70d7('0x4b')]);_0x50cb41[_0x70d7('0x4c')]=qs[_0x70d7('0x44')](_['pick'](_0x47072e[_0x70d7('0x43')],_0xf33cab[_0x70d7('0x44')]));_0x50cb41[_0x70d7('0x4c')][_0x70d7('0x63')]=_0x4e0d05['id'];if(_0x47072e[_0x70d7('0x43')][_0x70d7('0x4e')]){_0x50cb41[_0x70d7('0x4c')]=_[_0x70d7('0x50')](_0x50cb41[_0x70d7('0x4c')],{'$or':_[_0x70d7('0x3e')](_0x50cb41[_0x70d7('0x46')],function(_0x5714d6){var _0x4075b3={};_0x4075b3[_0x5714d6]={'$like':'%'+_0x47072e[_0x70d7('0x43')][_0x70d7('0x4e')]+'%'};return _0x4075b3;})});}_0x50cb41=_[_0x70d7('0x50')]({},_0x50cb41,_0x47072e['options']);return db[_0x70d7('0x64')]['count']({'where':_0x50cb41[_0x70d7('0x4c')]})['then'](function(_0x505017){_0x26b3fb[_0x70d7('0x30')]=_0x505017;if(_0x47072e[_0x70d7('0x43')][_0x70d7('0x52')]){_0x50cb41[_0x70d7('0x56')]=[{'all':!![]}];}return db[_0x70d7('0x64')][_0x70d7('0x53')](_0x50cb41);})[_0x70d7('0x1f')](function(_0x142f3f){_0x26b3fb[_0x70d7('0x54')]=_0x142f3f;return _0x26b3fb;});}})[_0x70d7('0x1f')](respondWithFilteredResult(_0x5ba0fb,_0x50cb41))[_0x70d7('0x28')](handleError(_0x5ba0fb,null));};exports[_0x70d7('0x67')]=function(_0x27ba0c,_0xfbd0d2,_0x265461){return db[_0x70d7('0x51')][_0x70d7('0x57')]({'where':{'id':_0x27ba0c['params']['id']}})[_0x70d7('0x1f')](handleEntityNotFound(_0xfbd0d2,null))[_0x70d7('0x1f')](function(_0x3d039f){if(_0x3d039f){return _0x3d039f[_0x70d7('0x67')](_0x27ba0c[_0x70d7('0x43')]['ids']);}})[_0x70d7('0x1f')](respondWithStatusCode(_0xfbd0d2,null))[_0x70d7('0x28')](handleError(_0xfbd0d2,null));};exports[_0x70d7('0x68')]=function(_0x355331,_0x5bcd4d,_0x42085f){if(_0x355331[_0x70d7('0x59')]['id']){delete _0x355331[_0x70d7('0x59')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x355331[_0x70d7('0x55')]['id']}})['then'](handleEntityNotFound(_0x5bcd4d,null))['then'](function(_0x5b4c24){if(_0x5b4c24){_0x355331[_0x70d7('0x59')]['OpenchannelAccountId']=_0x5b4c24['id'];return db[_0x70d7('0x69')][_0x70d7('0x58')](_0x355331['body']);}})[_0x70d7('0x1f')](respondWithResult(_0x5bcd4d,null))['catch'](handleError(_0x5bcd4d,null));};exports[_0x70d7('0x6a')]=function(_0x92e8bd,_0x596a93,_0x4447bb){var _0x44f65f={'raw':![],'where':{}};var _0x583ccd={};var _0x45f4ff={'count':0x0,'rows':[]};return db[_0x70d7('0x51')][_0x70d7('0x66')]({'where':{'id':_0x92e8bd[_0x70d7('0x55')]['id']}})[_0x70d7('0x1f')](handleEntityNotFound(_0x596a93,null))[_0x70d7('0x1f')](function(_0x4226a6){if(_0x4226a6){_0x583ccd[_0x70d7('0x41')]=_[_0x70d7('0x42')](db[_0x70d7('0x69')][_0x70d7('0x3f')]);_0x583ccd['query']=_['keys'](_0x92e8bd[_0x70d7('0x43')]);_0x583ccd['filters']=_[_0x70d7('0x45')](_0x583ccd[_0x70d7('0x41')],_0x583ccd[_0x70d7('0x43')]);_0x44f65f[_0x70d7('0x46')]=_[_0x70d7('0x45')](_0x583ccd[_0x70d7('0x41')],qs[_0x70d7('0x47')](_0x92e8bd[_0x70d7('0x43')][_0x70d7('0x47')]));_0x44f65f['attributes']=_0x44f65f[_0x70d7('0x46')]['length']?_0x44f65f[_0x70d7('0x46')]:_0x583ccd[_0x70d7('0x41')];if(!_0x92e8bd[_0x70d7('0x43')][_0x70d7('0x49')]('nolimit')){_0x44f65f[_0x70d7('0x2f')]=qs['limit'](_0x92e8bd[_0x70d7('0x43')][_0x70d7('0x2f')]);_0x44f65f['offset']=qs['offset'](_0x92e8bd[_0x70d7('0x43')][_0x70d7('0x2d')]);}_0x44f65f[_0x70d7('0x6b')]=qs[_0x70d7('0x4b')](_0x92e8bd['query'][_0x70d7('0x4b')]);_0x44f65f[_0x70d7('0x4c')]=qs['filters'](_[_0x70d7('0x4d')](_0x92e8bd[_0x70d7('0x43')],_0x583ccd[_0x70d7('0x44')]));_0x44f65f[_0x70d7('0x4c')]['OpenchannelAccountId']=_0x4226a6['id'];if(_0x92e8bd[_0x70d7('0x43')][_0x70d7('0x4e')]){_0x44f65f[_0x70d7('0x4c')]=_[_0x70d7('0x50')](_0x44f65f['where'],{'$or':_[_0x70d7('0x3e')](_0x44f65f[_0x70d7('0x46')],function(_0x5dd8f7){var _0x5bb312={};_0x5bb312[_0x5dd8f7]={'$like':'%'+_0x92e8bd[_0x70d7('0x43')][_0x70d7('0x4e')]+'%'};return _0x5bb312;})});}_0x44f65f=_[_0x70d7('0x50')]({},_0x44f65f,_0x92e8bd['options']);return db[_0x70d7('0x69')]['count']({'where':_0x44f65f[_0x70d7('0x4c')]})[_0x70d7('0x1f')](function(_0x41dc8e){_0x45f4ff[_0x70d7('0x30')]=_0x41dc8e;if(_0x92e8bd[_0x70d7('0x43')]['includeAll']){_0x44f65f[_0x70d7('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0x70d7('0x53')](_0x44f65f);})[_0x70d7('0x1f')](function(_0x4dacbf){_0x45f4ff['rows']=_0x4dacbf;return _0x45f4ff;});}})[_0x70d7('0x1f')](respondWithFilteredResult(_0x596a93,_0x44f65f))[_0x70d7('0x28')](handleError(_0x596a93,null));};exports[_0x70d7('0x6c')]=function(_0x9879c9,_0x6409e2,_0x434cb6){return db[_0x70d7('0x51')][_0x70d7('0x57')]({'where':{'id':_0x9879c9['params']['id']}})['then'](handleEntityNotFound(_0x6409e2,null))['then'](function(_0x39f433){if(_0x39f433){return _0x39f433['removeAnswers'](_0x9879c9['query'][_0x70d7('0x6d')]);}})['then'](respondWithStatusCode(_0x6409e2,null))[_0x70d7('0x28')](handleError(_0x6409e2,null));};exports[_0x70d7('0x6e')]=function(_0x5812f1,_0x4bb4e9,_0x326a6f){var _0x1891c8={'body':_0x5812f1[_0x70d7('0x59')],'channel':_0x70d7('0x6f')};var _0x956d42=[];var _0x527b58=[];var _0x358b3c={};var _0x385e73=![];return db[_0x70d7('0x70')][_0x70d7('0x61')]()[_0x70d7('0x1f')](function(_0x19c278){if(!_0x19c278){throw new db[(_0x70d7('0x71'))]['ValidationError'](_0x70d7('0x72'));}_0x956d42=_[_0x70d7('0x73')](_[_0x70d7('0x42')](_0x19c278),[_0x70d7('0x74'),_0x70d7('0x75')]);_0x527b58=_[_0x70d7('0x73')](_[_0x70d7('0x42')](_0x19c278),['createdAt',_0x70d7('0x75'),_0x70d7('0x76'),_0x70d7('0x77')]);if(_0x5812f1['body']['id']){delete _0x5812f1[_0x70d7('0x59')]['id'];}if(_['isNil'](_0x5812f1[_0x70d7('0x59')][_0x70d7('0x78')])){throw new db['Sequelize'][(_0x70d7('0x79'))](_0x70d7('0x7a'));}if(_[_0x70d7('0x7b')](_0x5812f1[_0x70d7('0x59')][_0x70d7('0x59')])||_0x5812f1[_0x70d7('0x59')][_0x70d7('0x59')]===''){throw new db[(_0x70d7('0x71'))][(_0x70d7('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x70d7('0x7b')](_0x5812f1[_0x70d7('0x59')][_0x70d7('0x7c')])){throw new db[(_0x70d7('0x71'))][(_0x70d7('0x79'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x527b58);}if(!_[_0x70d7('0x7d')](_0x527b58,_0x5812f1[_0x70d7('0x59')]['mapKey'])){throw new db['Sequelize'][(_0x70d7('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x527b58);}_0x358b3c[_0x5812f1['body']['mapKey']]=_0x5812f1[_0x70d7('0x59')]['from'];})[_0x70d7('0x1f')](function(){return db[_0x70d7('0x51')][_0x70d7('0x57')]({'where':{'id':_0x5812f1[_0x70d7('0x55')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x70d7('0x70')],'as':_0x70d7('0x7e'),'where':_0x358b3c,'limit':0x1,'order':[[_0x70d7('0x75'),_0x70d7('0x7f')]]}]},{'model':db[_0x70d7('0x80')],'as':_0x70d7('0x81')}]});})['then'](handleEntityNotFound(_0x4bb4e9,null))['then'](function(_0x1c7608){if(_0x1c7608&&_0x1c7608[_0x70d7('0x82')]){_0x1891c8[_0x70d7('0x83')]=_0x1c7608;_0x1891c8[_0x70d7('0x84')]=_0x1c7608[_0x70d7('0x81')];_0x1891c8[_0x70d7('0x85')]=_0x1c7608[_0x70d7('0x82')];_0x1891c8[_0x70d7('0x84')]=_[_0x70d7('0x86')](_0x1891c8[_0x70d7('0x84')],['priority'],[_0x70d7('0x87')]);if(_0x1891c8[_0x70d7('0x83')]['Applications']){delete _0x1891c8[_0x70d7('0x83')][_0x70d7('0x81')];}if(_0x1891c8[_0x70d7('0x83')][_0x70d7('0x82')]&&_0x1891c8[_0x70d7('0x83')][_0x70d7('0x82')]['Contacts']['length']){return _0x1891c8['account'][_0x70d7('0x82')][_0x70d7('0x7e')][0x0];}var _0x417ef5=_[_0x70d7('0x17')](_0x5812f1[_0x70d7('0x59')],{'firstName':_0x5812f1[_0x70d7('0x59')][_0x70d7('0x78')],'ListId':_0x1c7608[_0x70d7('0x77')]});_0x417ef5[_0x5812f1[_0x70d7('0x59')]['mapKey']]=_0x5812f1[_0x70d7('0x59')][_0x70d7('0x78')];return db[_0x70d7('0x70')][_0x70d7('0x58')](_0x417ef5,{'fields':_0x956d42,'raw':!![]});}})[_0x70d7('0x1f')](handleEntityNotFound(_0x4bb4e9,null))[_0x70d7('0x1f')](function(_0x3e0a9e){_0x1891c8['contact']=_0x3e0a9e;if(_0x3e0a9e){var _0xf736d4={'ContactId':_0x3e0a9e['id'],'OpenchannelAccountId':_0x5812f1[_0x70d7('0x55')]['id'],'from':(_0x3e0a9e[_0x70d7('0x88')]||'')+'\x20'+(_0x3e0a9e['lastName']||'')};var _0x49885e={'OpenchannelAccountId':_0x5812f1[_0x70d7('0x55')]['id'],'closed':![]};if(_0x5812f1['body'][_0x70d7('0x89')]){_0x49885e[_0x70d7('0x89')]=_0x5812f1[_0x70d7('0x59')]['threadId'];return db['OpenchannelInteraction'][_0x70d7('0x57')]({'where':_0x49885e})[_0x70d7('0x1f')](function(_0x2bf7ea){if(_0x2bf7ea){return[_0x2bf7ea,![]];}_0xf736d4[_0x70d7('0x89')]=_0x5812f1[_0x70d7('0x59')][_0x70d7('0x89')];_0xf736d4[_0x70d7('0x8a')]=_0x5812f1[_0x70d7('0x59')]['externalUrl'];return db['OpenchannelInteraction']['create'](_0xf736d4)[_0x70d7('0x1f')](function(_0x3f82da){return[_0x3f82da,!![]];});});}else{_0x49885e[_0x70d7('0x89')]=null;}_0x49885e[_0x70d7('0x8b')]=_0x3e0a9e['id'];return db['OpenchannelInteraction']['find']({'where':_0x49885e})[_0x70d7('0x1f')](function(_0x5c7f84){if(_0x5c7f84){return[_0x5c7f84,![]];}return db['OpenchannelInteraction']['create'](_0xf736d4)[_0x70d7('0x1f')](function(_0x43de3c){return[_0x43de3c,!![]];});});}})[_0x70d7('0x8c')](function(_0x31d20a,_0x1b5e2f){if(_0x31d20a){_0x385e73=_0x1b5e2f;if(!_0x1b5e2f){var _0x156cd9={'from':(_0x1891c8['contact']['firstName']||'')+'\x20'+(_0x1891c8[_0x70d7('0x8d')]['lastName']||'')};if(_0x5812f1['body'][_0x70d7('0x89')]&&_0x5812f1[_0x70d7('0x59')][_0x70d7('0x8e')]&&_0x5812f1['body'][_0x70d7('0x89')]!=_0x5812f1[_0x70d7('0x59')][_0x70d7('0x8e')]){_0x156cd9[_0x70d7('0x89')]=_0x5812f1['body'][_0x70d7('0x8e')];}return _0x31d20a[_0x70d7('0x35')](_0x156cd9);}else{return _0x31d20a;}}})['then'](function(_0x2df3b0){_0x1891c8[_0x70d7('0x8f')]=_0x2df3b0[_0x70d7('0x37')]({'plain':!![]});_0x1891c8[_0x70d7('0x8f')][_0x70d7('0x90')]=_0x385e73;if(_0x1891c8[_0x70d7('0x8f')][_0x70d7('0x90')]){if(_0x1891c8[_0x70d7('0x83')][_0x70d7('0x91')]){_0x1891c8[_0x70d7('0x84')][_0x70d7('0x92')]({'id':0x0,'priority':_0x1891c8['applications']['length']+0x1,'app':_0x70d7('0x93'),'appdata':_0x70d7('0x94'),'interval':_0x70d7('0x95')});}}return db[_0x70d7('0x96')]['create']({'body':_0x5812f1[_0x70d7('0x59')]['body'],'OpenchannelAccountId':_0x5812f1[_0x70d7('0x55')]['id'],'OpenchannelInteractionId':_0x2df3b0['id'],'direction':'in','ContactId':_0x1891c8[_0x70d7('0x8d')]['id'],'AttachmentId':_0x5812f1['body'][_0x70d7('0x97')]});})[_0x70d7('0x1f')](function(_0x39fdbc){_0x1891c8[_0x70d7('0x26')]=_0x39fdbc;if(_0x1891c8['interaction'][_0x70d7('0x98')]){return db['User'][_0x70d7('0x57')]({'attributes':['id',_0x70d7('0x3b')],'where':{'id':_0x1891c8['interaction']['UserId']}})['then'](function(_0x305eea){if(_0x305eea){_0x1891c8[_0x70d7('0x84')][_0x70d7('0x99')]({'id':0x0,'priority':0x0,'app':_0x70d7('0x9a'),'appdata':_0x305eea[_0x70d7('0x3b')]+','+(_0x1891c8[_0x70d7('0x83')][_0x70d7('0x9b')]||0xa),'interval':_0x70d7('0x95')});_0x1891c8['forcedOwnership']=![];}return respondWithRpcPromise(_0x70d7('0x9c'),_0x70d7('0x9d'),_0x1891c8);});}return respondWithRpcPromise(_0x70d7('0x9c'),_0x70d7('0x9d'),_0x1891c8);})[_0x70d7('0x1f')](function(_0x47dbc0){respondWithRpcPromise(_0x70d7('0x9e'),_0x70d7('0x9e'),{'event':'notify','message':_0x47dbc0},client9002);return _0x47dbc0;})['then'](respondWithResult(_0x4bb4e9,null))[_0x70d7('0x28')](handleError(_0x4bb4e9,null));};exports[_0x70d7('0x9f')]=function(_0x3fe544,_0x57a09e){var _0x396352=_0x3fe544[_0x70d7('0x55')]['id'];var _0x4ceb52=_0x3fe544['body'];var _0x4c532c=0xc8;var _0x4bd53e=null;return db[_0x70d7('0xa0')][_0x70d7('0xa1')]({'isolationLevel':db['sequelize']['Transaction'][_0x70d7('0xa2')][_0x70d7('0xa3')]},function(_0x21b702){return db[_0x70d7('0x51')]['findOne']({'where':{'id':_0x396352},'transaction':_0x21b702})[_0x70d7('0x1f')](function(_0x14c27d){if(_0x14c27d){return db[_0x70d7('0x80')][_0x70d7('0x36')]({'where':{'OpenchannelAccountId':_0x396352},'transaction':_0x21b702})[_0x70d7('0x1f')](function(){var _0x5e1427=_[_0x70d7('0x3e')](_0x4ceb52,function(_0x28aa00){_0x28aa00[_0x70d7('0x63')]=_0x396352;return _0x28aa00;});return db[_0x70d7('0x80')]['bulkCreate'](_0x5e1427,{'transaction':_0x21b702});});}else{_0x4c532c=0x194;_0x4bd53e=[];}});})[_0x70d7('0x1f')](function(){if(_0x4c532c!==0x194){return db[_0x70d7('0x80')][_0x70d7('0xa4')]({'where':{'OpenchannelAccountId':_0x396352},'order':_0x70d7('0xa5')})[_0x70d7('0x1f')](function(_0xec54de){_0x4bd53e=_0xec54de;});}})[_0x70d7('0x28')](function(_0x1d7041){_0x4c532c=0x1f4;logger[_0x70d7('0x25')](_0x1d7041[_0x70d7('0x3a')]);if(_0x1d7041[_0x70d7('0x3b')]){delete _0x1d7041['name'];}_0x4bd53e=_0x1d7041;})[_0x70d7('0xa6')](function(){if(_0x4bd53e===null){_0x57a09e['sendStatus'](_0x4c532c);}else{if(_0x4c532c===0x1f4){_0x57a09e[_0x70d7('0x2a')](_0x4c532c)[_0x70d7('0x3c')](_0x4bd53e);}else{_0x57a09e[_0x70d7('0x2a')](_0x4c532c)[_0x70d7('0x2c')](_0x4bd53e);}}});};exports['getApplications']=function(_0x141bbd,_0x1c71f1,_0x5d1ddf){var _0x2f3b36={};var _0x2ed941={};var _0x2d8879;var _0x27d37c;return db['OpenchannelAccount'][_0x70d7('0x66')]({'where':{'id':_0x141bbd[_0x70d7('0x55')]['id']}})[_0x70d7('0x1f')](handleEntityNotFound(_0x1c71f1,null))[_0x70d7('0x1f')](function(_0x33e866){if(_0x33e866){_0x2d8879=_0x33e866;_0x2ed941[_0x70d7('0x41')]=_[_0x70d7('0x42')](db[_0x70d7('0x80')][_0x70d7('0x3f')]);_0x2ed941[_0x70d7('0x43')]=_[_0x70d7('0x42')](_0x141bbd['query']);_0x2ed941[_0x70d7('0x44')]=_[_0x70d7('0x45')](_0x2ed941[_0x70d7('0x41')],_0x2ed941[_0x70d7('0x43')]);_0x2f3b36[_0x70d7('0x46')]=_[_0x70d7('0x45')](_0x2ed941[_0x70d7('0x41')],qs['fields'](_0x141bbd[_0x70d7('0x43')][_0x70d7('0x47')]));_0x2f3b36[_0x70d7('0x46')]=_0x2f3b36[_0x70d7('0x46')][_0x70d7('0x48')]?_0x2f3b36[_0x70d7('0x46')]:_0x2ed941[_0x70d7('0x41')];_0x2f3b36['order']=qs['sort'](_0x141bbd[_0x70d7('0x43')][_0x70d7('0x4b')]);_0x2f3b36['where']=qs[_0x70d7('0x44')](_[_0x70d7('0x4d')](_0x141bbd['query'],_0x2ed941[_0x70d7('0x44')]));if(_0x141bbd['query'][_0x70d7('0x4e')]){_0x2f3b36[_0x70d7('0x4c')]=_[_0x70d7('0x50')](_0x2f3b36[_0x70d7('0x4c')],{'$or':_[_0x70d7('0x3e')](_0x2f3b36[_0x70d7('0x46')],function(_0x34494d){var _0x264546={};_0x264546[_0x34494d]={'$like':'%'+_0x141bbd[_0x70d7('0x43')][_0x70d7('0x4e')]+'%'};return _0x264546;})});}_0x2f3b36=_[_0x70d7('0x50')]({},_0x2f3b36,_0x141bbd[_0x70d7('0xa7')]);return _0x2d8879[_0x70d7('0xa8')](_0x2f3b36);}})[_0x70d7('0x1f')](function(_0x480ed2){if(_0x480ed2){_0x27d37c=_0x480ed2[_0x70d7('0x48')];if(!_0x141bbd[_0x70d7('0x43')][_0x70d7('0x49')](_0x70d7('0x4a'))){_0x2f3b36[_0x70d7('0x2f')]=qs[_0x70d7('0x2f')](_0x141bbd[_0x70d7('0x43')][_0x70d7('0x2f')]);_0x2f3b36[_0x70d7('0x2d')]=qs[_0x70d7('0x2d')](_0x141bbd[_0x70d7('0x43')][_0x70d7('0x2d')]);}return _0x2d8879[_0x70d7('0xa8')](_0x2f3b36);}})[_0x70d7('0x1f')](function(_0x2e24fa){if(_0x2e24fa){return _0x2e24fa?{'count':_0x27d37c,'rows':_0x2e24fa}:null;}})[_0x70d7('0x1f')](respondWithResult(_0x1c71f1,null))['catch'](handleError(_0x1c71f1,null));};exports[_0x70d7('0xa9')]=function(_0x35b731,_0x36da8d,_0x51652b){var _0x95929f={'raw':![],'where':{}};var _0x527e09={};var _0x5418fd={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x70d7('0x66')]({'where':{'id':_0x35b731['params']['id']}})[_0x70d7('0x1f')](handleEntityNotFound(_0x36da8d,null))['then'](function(_0xd59f2e){if(_0xd59f2e){_0x527e09['model']=_[_0x70d7('0x42')](db[_0x70d7('0xaa')][_0x70d7('0x3f')]);_0x527e09['query']=_[_0x70d7('0x42')](_0x35b731[_0x70d7('0x43')]);_0x527e09[_0x70d7('0x44')]=_['intersection'](_0x527e09[_0x70d7('0x41')],_0x527e09[_0x70d7('0x43')]);_0x95929f[_0x70d7('0x46')]=_[_0x70d7('0x45')](_0x527e09[_0x70d7('0x41')],qs[_0x70d7('0x47')](_0x35b731['query'][_0x70d7('0x47')]));_0x95929f[_0x70d7('0x46')]=_0x95929f['attributes'][_0x70d7('0x48')]?_0x95929f['attributes']:_0x527e09[_0x70d7('0x41')];if(!_0x35b731[_0x70d7('0x43')][_0x70d7('0x49')]('nolimit')){_0x95929f[_0x70d7('0x2f')]=qs['limit'](_0x35b731[_0x70d7('0x43')][_0x70d7('0x2f')]);_0x95929f['offset']=qs['offset'](_0x35b731[_0x70d7('0x43')][_0x70d7('0x2d')]);}_0x95929f[_0x70d7('0x6b')]=qs[_0x70d7('0x4b')](_0x35b731[_0x70d7('0x43')][_0x70d7('0x4b')]);_0x95929f[_0x70d7('0x4c')]=qs[_0x70d7('0x44')](_['pick'](_0x35b731['query'],_0x527e09[_0x70d7('0x44')]));_0x95929f[_0x70d7('0x4c')]['OpenchannelAccountId']=_0xd59f2e['id'];if(_0x35b731[_0x70d7('0x43')][_0x70d7('0x4e')]){_0x95929f[_0x70d7('0x4c')]=_['merge'](_0x95929f[_0x70d7('0x4c')],{'$or':_[_0x70d7('0x3e')](_0x95929f[_0x70d7('0x46')],function(_0x3abd5b){var _0x25db60={};_0x25db60[_0x3abd5b]={'$like':'%'+_0x35b731[_0x70d7('0x43')][_0x70d7('0x4e')]+'%'};return _0x25db60;})});}_0x95929f=_[_0x70d7('0x50')]({},_0x95929f,_0x35b731[_0x70d7('0xa7')]);return db['OpenchannelInteraction'][_0x70d7('0x30')]({'where':_0x95929f['where']})[_0x70d7('0x1f')](function(_0x1dc1e0){_0x5418fd[_0x70d7('0x30')]=_0x1dc1e0;if(_0x35b731[_0x70d7('0x43')][_0x70d7('0x52')]){_0x95929f[_0x70d7('0x56')]=[{'model':db[_0x70d7('0x70')],'as':'Contact','required':![]},{'model':db[_0x70d7('0xab')],'as':_0x70d7('0xac'),'attributes':[_0x70d7('0x3b'),_0x70d7('0xad'),_0x70d7('0xae')],'required':![]},{'model':db[_0x70d7('0xaf')],'as':'Tags','attributes':['id',_0x70d7('0x3b'),_0x70d7('0xb0')],'where':_0x35b731['query'][_0x70d7('0xb1')]?{'id':_0x35b731[_0x70d7('0x43')][_0x70d7('0xb1')]}:undefined,'required':_0x35b731[_0x70d7('0x43')][_0x70d7('0xb1')]?!![]:![]}];}return db[_0x70d7('0xaa')][_0x70d7('0x53')](_0x95929f);})[_0x70d7('0x1f')](function(_0x2ce361){_0x5418fd[_0x70d7('0x54')]=_0x2ce361;return _0x5418fd;});}})[_0x70d7('0x1f')](respondWithFilteredResult(_0x36da8d,_0x95929f))[_0x70d7('0x28')](handleError(_0x36da8d,null));};exports['addAgents']=function(_0x5da42f,_0x77cd43,_0x35f91e){return db[_0x70d7('0x51')][_0x70d7('0x57')]({'where':{'id':_0x5da42f[_0x70d7('0x55')]['id']}})[_0x70d7('0x1f')](handleEntityNotFound(_0x77cd43,null))[_0x70d7('0x1f')](function(_0x4c8144){if(_0x4c8144){return _0x4c8144['addAgents'](_0x5da42f[_0x70d7('0x59')][_0x70d7('0x6d')],_[_0x70d7('0xb2')](_0x5da42f[_0x70d7('0x59')],[_0x70d7('0x6d'),'id'])||{})[_0x70d7('0x8c')](function(_0x34b3e5){for(var _0x16c704=0x0;_0x16c704<_0x5da42f[_0x70d7('0x59')][_0x70d7('0x6d')]['length'];_0x16c704+=0x1){socket[_0x70d7('0xb3')]('userOpenchannelAccount:save',{'UserId':Number(_0x5da42f[_0x70d7('0x59')][_0x70d7('0x6d')][_0x16c704]),'OpenchannelAccountId':Number(_0x5da42f[_0x70d7('0x55')]['id'])});}return _0x34b3e5;});}})[_0x70d7('0x1f')](respondWithResult(_0x77cd43,null))[_0x70d7('0x28')](handleError(_0x77cd43,null));};exports['removeAgents']=function(_0x12458d,_0x30cc80,_0x589635){return db[_0x70d7('0x51')][_0x70d7('0x57')]({'where':{'id':_0x12458d['params']['id']}})[_0x70d7('0x1f')](handleEntityNotFound(_0x30cc80,null))[_0x70d7('0x1f')](function(_0x5d53e7){if(_0x5d53e7){return _0x5d53e7[_0x70d7('0xb4')](_0x12458d[_0x70d7('0x43')]['ids'])[_0x70d7('0x1f')](function(){if(_[_0x70d7('0xb5')](_0x12458d[_0x70d7('0x43')][_0x70d7('0x6d')])){for(var _0x20cb5f=0x0;_0x20cb5f<_0x12458d[_0x70d7('0x43')][_0x70d7('0x6d')]['length'];_0x20cb5f+=0x1){socket['emit'](_0x70d7('0xb6'),{'UserId':Number(_0x12458d[_0x70d7('0x43')][_0x70d7('0x6d')][_0x20cb5f]),'OpenchannelAccountId':Number(_0x12458d[_0x70d7('0x55')]['id'])});}}else{socket[_0x70d7('0xb3')](_0x70d7('0xb6'),{'UserId':Number(_0x12458d[_0x70d7('0x43')][_0x70d7('0x6d')]),'OpenchannelAccountId':Number(_0x12458d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x30cc80,null))[_0x70d7('0x28')](handleError(_0x30cc80,null));};exports['getAgents']=function(_0xac797c,_0x526709,_0x512f13){var _0x551cef={};var _0xca69d3={};var _0x23f09b;var _0x34fa92;return db[_0x70d7('0x51')][_0x70d7('0x66')]({'where':{'id':_0xac797c[_0x70d7('0x55')]['id']}})['then'](handleEntityNotFound(_0x526709,null))[_0x70d7('0x1f')](function(_0x8fb872){if(_0x8fb872){_0x23f09b=_0x8fb872;_0xca69d3[_0x70d7('0x41')]=_[_0x70d7('0x42')](db[_0x70d7('0xab')][_0x70d7('0x3f')]);_0xca69d3[_0x70d7('0x43')]=_[_0x70d7('0x42')](_0xac797c[_0x70d7('0x43')]);_0xca69d3[_0x70d7('0x44')]=_['intersection'](_0xca69d3[_0x70d7('0x41')],_0xca69d3[_0x70d7('0x43')]);_0x551cef[_0x70d7('0x46')]=_['intersection'](_0xca69d3[_0x70d7('0x41')],qs[_0x70d7('0x47')](_0xac797c[_0x70d7('0x43')][_0x70d7('0x47')]));_0x551cef[_0x70d7('0x46')]=_0x551cef[_0x70d7('0x46')]['length']?_0x551cef['attributes']:_0xca69d3[_0x70d7('0x41')];_0x551cef[_0x70d7('0x6b')]=qs[_0x70d7('0x4b')](_0xac797c[_0x70d7('0x43')]['sort']);_0x551cef['where']=qs[_0x70d7('0x44')](_[_0x70d7('0x4d')](_0xac797c[_0x70d7('0x43')],_0xca69d3[_0x70d7('0x44')]));if(_0xac797c['query'][_0x70d7('0x4e')]){_0x551cef['where']=_[_0x70d7('0x50')](_0x551cef['where'],{'$or':_[_0x70d7('0x3e')](_0x551cef[_0x70d7('0x46')],function(_0x129026){var _0x4afe16={};_0x4afe16[_0x129026]={'$like':'%'+_0xac797c[_0x70d7('0x43')][_0x70d7('0x4e')]+'%'};return _0x4afe16;})});}_0x551cef=_[_0x70d7('0x50')]({},_0x551cef,_0xac797c[_0x70d7('0xa7')]);return _0x23f09b['getAgents'](_0x551cef);}})[_0x70d7('0x1f')](function(_0x5bcc30){if(_0x5bcc30){_0x34fa92=_0x5bcc30['length'];if(!_0xac797c[_0x70d7('0x43')][_0x70d7('0x49')]('nolimit')){_0x551cef[_0x70d7('0x2f')]=qs['limit'](_0xac797c[_0x70d7('0x43')][_0x70d7('0x2f')]);_0x551cef[_0x70d7('0x2d')]=qs[_0x70d7('0x2d')](_0xac797c[_0x70d7('0x43')][_0x70d7('0x2d')]);}return _0x23f09b[_0x70d7('0xb7')](_0x551cef);}})[_0x70d7('0x1f')](function(_0x3347d8){if(_0x3347d8){return _0x3347d8?{'count':_0x34fa92,'rows':_0x3347d8}:null;}})['then'](respondWithResult(_0x526709,null))['catch'](handleError(_0x526709,null));};exports[_0x70d7('0x3c')]=function(_0xdf0cb,_0xe50459,_0x479eac){var _0x15bf92,_0x532ccb,_0x7063eb;if(_['isNil'](_0xdf0cb[_0x70d7('0x59')]['body'])||_0xdf0cb[_0x70d7('0x59')][_0x70d7('0x59')]===''){throw new db[(_0x70d7('0x71'))]['ValidationError'](_0x70d7('0xb8'));}if(_['isNil'](_0xdf0cb[_0x70d7('0x59')]['to'])){}_0x15bf92=_0xdf0cb['body']['to'];return db[_0x70d7('0x51')][_0x70d7('0x66')]({'where':{'id':_0xdf0cb[_0x70d7('0x55')]['id']}})['then'](handleEntityNotFound(_0xe50459,null))[_0x70d7('0x1f')](function(_0x4e39e1){if(_0x4e39e1){return db[_0x70d7('0x51')][_0x70d7('0x57')]({'where':{'id':_0x4e39e1['id']},'include':[{'model':db[_0x70d7('0xb9')],'as':_0x70d7('0x82'),'include':[{'model':db[_0x70d7('0x70')],'as':'Contacts','where':{[_0x4e39e1[_0x70d7('0x7c')]]:_0x15bf92},'limit':0x1,'order':[[_0x70d7('0x75'),_0x70d7('0x7f')]]}]}]})['then'](handleEntityNotFound(_0xe50459,null))[_0x70d7('0x1f')](function(_0x388c5c){if(_0x388c5c&&_0x388c5c[_0x70d7('0x82')]){_0x532ccb=_0x388c5c[_0x70d7('0x37')]({'plain':!![]});if(_0x532ccb[_0x70d7('0x82')]&&_0x532ccb[_0x70d7('0x82')][_0x70d7('0x7e')]['length']){return _0x532ccb[_0x70d7('0x82')][_0x70d7('0x7e')][0x0];}return db[_0x70d7('0x70')][_0x70d7('0x58')](_['defaults'](_0xdf0cb['body'],{'firstName':_0x15bf92,[_0x388c5c[_0x70d7('0x7c')]]:_0x15bf92,'phone':_0x15bf92,'ListId':_0x532ccb[_0x70d7('0x77')]}));}})[_0x70d7('0x1f')](handleEntityNotFound(_0xe50459,null))[_0x70d7('0x1f')](function(_0xa55029){if(_0xa55029){_0x7063eb=_0xa55029;return db[_0x70d7('0xaa')]['find']({'where':{'ContactId':_0x7063eb['id'],'closed':![],'OpenchannelAccountId':_0x532ccb['id']}})[_0x70d7('0x1f')](function(_0x4db20b){if(_0x4db20b){return[_0x4db20b,![]];}return db[_0x70d7('0xaa')]['create']({'UserId':_0xdf0cb[_0x70d7('0x5a')]['id'],'ContactId':_0x7063eb['id'],'OpenchannelAccountId':_0x532ccb['id'],'lastMsgDirection':_0x70d7('0xba'),'firstMsgDirection':_0x70d7('0xba'),'Messages':[_[_0x70d7('0x50')](_0xdf0cb[_0x70d7('0x59')],{'read':![],'body':_0xdf0cb['body'][_0x70d7('0x59')],'OpenchannelAccountId':_0x532ccb['id'],'UserId':_0xdf0cb[_0x70d7('0x5a')]['id'],'ContactId':_0x7063eb['id']})]},{'include':[{'model':db[_0x70d7('0x96')],'as':_0x70d7('0xbb')}]})['then'](function(_0x596e5d){return[_0x596e5d,!![]];});});}})['spread'](function(_0x32c9a4,_0x440dc){if(_0x440dc){return _0x32c9a4;}return db[_0x70d7('0x96')][_0x70d7('0x58')](_[_0x70d7('0x50')](_0xdf0cb[_0x70d7('0x59')],{'read':![],'body':_0xdf0cb[_0x70d7('0x59')][_0x70d7('0x59')],'OpenchannelAccountId':_0x532ccb['id'],'OpenchannelInteractionId':_0x32c9a4['id'],'UserId':_0xdf0cb['user']['id'],'ContactId':_0x7063eb['id']}))[_0x70d7('0x1f')](function(_0x3c3a98){_0x32c9a4[_0x70d7('0xbc')][_0x70d7('0xbb')]=[];_0x32c9a4[_0x70d7('0xbc')][_0x70d7('0xbb')]['push'](_0x3c3a98[_0x70d7('0xbc')]);return _0x32c9a4;});});}})['then'](respondWithResult(_0xe50459,null))[_0x70d7('0x28')](handleError(_0xe50459,null));}; \ No newline at end of file +var _0xb43b=['Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','Disposition','getDispositions','findOne','order','includeAll','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','Applications','account','applications','list','orderBy','priority','List','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','fullname','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','out'];(function(_0x41e723,_0x5e6494){var _0x5cf973=function(_0x4ce435){while(--_0x4ce435){_0x41e723['push'](_0x41e723['shift']());}};_0x5cf973(++_0x5e6494);}(_0xb43b,0xbf));var _0xbb43=function(_0x3e532f,_0x12e9d1){_0x3e532f=_0x3e532f-0x0;var _0x26a1ab=_0xb43b[_0x3e532f];return _0x26a1ab;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x1'));var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require(_0xbb43('0x9'));var csv=require(_0xbb43('0xa'));var ejs=require(_0xbb43('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb43('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb43('0xd'));var deskjs=require(_0xbb43('0xe'));var toCsv=require(_0xbb43('0xa'));var querystring=require(_0xbb43('0xf'));var Papa=require(_0xbb43('0x10'));var Redis=require('ioredis');var authService=require(_0xbb43('0x11'));var qs=require(_0xbb43('0x12'));var as=require(_0xbb43('0x13'));var hardwareService=require(_0xbb43('0x14'));var logger=require('../../config/logger')(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbb43('0x17')]=_['defaults'](config[_0xbb43('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb43('0x18'))(new Redis(config[_0xbb43('0x17')]));require(_0xbb43('0x19'))[_0xbb43('0x1a')](socket);var jayson=require(_0xbb43('0x1b'));var client=jayson['client'][_0xbb43('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xbb43('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x32425c,_0x15182b,_0x10c91b,_0x3be44b){return new BPromise(function(_0x126f61,_0x3c4a5a){var _0x209c9c=_0x3be44b||client;return _0x209c9c[_0xbb43('0x1d')](_0x32425c,_0x10c91b)[_0xbb43('0x1e')](function(_0xe15a1b){logger['info'](_0xbb43('0x1f'),_0x15182b,'request\x20sent');logger[_0xbb43('0x20')](_0xbb43('0x21'),_0x15182b,_0xbb43('0x22'),JSON[_0xbb43('0x23')](_0xe15a1b));if(_0xe15a1b['error']){if(_0xe15a1b[_0xbb43('0x24')][_0xbb43('0x25')]===0x1f4){logger[_0xbb43('0x24')](_0xbb43('0x1f'),_0x15182b,_0xe15a1b[_0xbb43('0x24')][_0xbb43('0x26')]);return _0x3c4a5a(_0xe15a1b[_0xbb43('0x24')][_0xbb43('0x26')]);}logger[_0xbb43('0x24')](_0xbb43('0x1f'),_0x15182b,_0xe15a1b[_0xbb43('0x24')][_0xbb43('0x26')]);return _0x126f61(_0xe15a1b[_0xbb43('0x24')][_0xbb43('0x26')]);}else{logger['info'](_0xbb43('0x1f'),_0x15182b,_0xbb43('0x22'));_0x126f61(_0xe15a1b['result'][_0xbb43('0x26')]);}})[_0xbb43('0x27')](function(_0x25279b){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x15182b,_0x25279b);_0x3c4a5a(_0x25279b);});});}function respondWithStatusCode(_0x20f223,_0x16da8a){_0x16da8a=_0x16da8a||0xcc;return function(_0x5b21b6){if(_0x5b21b6){return _0x20f223['sendStatus'](_0x16da8a);}return _0x20f223[_0xbb43('0x28')](_0x16da8a)[_0xbb43('0x29')]();};}function respondWithResult(_0x268fb5,_0x4bb859){_0x4bb859=_0x4bb859||0xc8;return function(_0x27bb65){if(_0x27bb65){return _0x268fb5[_0xbb43('0x28')](_0x4bb859)[_0xbb43('0x2a')](_0x27bb65);}};}function respondWithFilteredResult(_0x1a6e2b,_0x5d613c){return function(_0x2a4766){if(_0x2a4766){var _0x170e7a=typeof _0x5d613c[_0xbb43('0x2b')]===_0xbb43('0x2c')&&typeof _0x5d613c[_0xbb43('0x2d')]===_0xbb43('0x2c');var _0x2860d8=_0x2a4766['count'];var _0x3b2290=_0x170e7a?0x0:_0x5d613c[_0xbb43('0x2b')];var _0x3c46c6=_0x170e7a?_0x2a4766['count']:_0x5d613c[_0xbb43('0x2b')]+_0x5d613c[_0xbb43('0x2d')];var _0x9384d8;if(_0x3c46c6>=_0x2860d8){_0x3c46c6=_0x2860d8;_0x9384d8=0xc8;}else{_0x9384d8=0xce;}_0x1a6e2b[_0xbb43('0x28')](_0x9384d8);return _0x1a6e2b[_0xbb43('0x2e')](_0xbb43('0x2f'),_0x3b2290+'-'+_0x3c46c6+'/'+_0x2860d8)[_0xbb43('0x2a')](_0x2a4766);}return null;};}function patchUpdates(_0xa86300){return function(_0xd579d8){try{jsonpatch['apply'](_0xd579d8,_0xa86300,!![]);}catch(_0x5253a4){return BPromise['reject'](_0x5253a4);}return _0xd579d8['save']();};}function saveUpdates(_0x352249,_0x1186fd){return function(_0x15c3e5){if(_0x15c3e5){return _0x15c3e5[_0xbb43('0x30')](_0x352249)[_0xbb43('0x1e')](function(_0xa153c9){return _0xa153c9;});}return null;};}function removeEntity(_0x3c8758,_0x3082b3){return function(_0x5c1270){if(_0x5c1270){return _0x5c1270[_0xbb43('0x31')]()[_0xbb43('0x1e')](function(){var _0x418b2a=_0x5c1270[_0xbb43('0x32')]({'plain':!![]});var _0x4c65d0=_0xbb43('0x33');return db[_0xbb43('0x34')][_0xbb43('0x31')]({'where':{'type':_0x4c65d0,'resourceId':_0x418b2a['id']}})[_0xbb43('0x1e')](function(){return _0x5c1270;});})['then'](function(){_0x3c8758[_0xbb43('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ba581,_0x10014c){return function(_0x2b6efc){if(!_0x2b6efc){_0x3ba581[_0xbb43('0x35')](0x194);}return _0x2b6efc;};}function handleError(_0x1da15a,_0x1c1f8b){_0x1c1f8b=_0x1c1f8b||0x1f4;return function(_0x316ab1){logger[_0xbb43('0x24')](_0x316ab1[_0xbb43('0x36')]);if(_0x316ab1[_0xbb43('0x37')]){delete _0x316ab1[_0xbb43('0x37')];}_0x1da15a[_0xbb43('0x28')](_0x1c1f8b)['send'](_0x316ab1);};}exports[_0xbb43('0x38')]=function(_0x467009,_0x363e1a){var _0x2db230={'include':[{'model':db[_0xbb43('0x39')],'as':_0xbb43('0x3a')}]},_0x2a4b21={},_0x2a854d={'count':0x0,'rows':[]};var _0x92d7cf=_[_0xbb43('0x3b')](db[_0xbb43('0x3c')][_0xbb43('0x3d')],function(_0x202291){return{'name':_0x202291[_0xbb43('0x3e')],'type':_0x202291[_0xbb43('0x3f')]['key']};});_0x2a4b21[_0xbb43('0x40')]=_[_0xbb43('0x3b')](_0x92d7cf,_0xbb43('0x37'));_0x2a4b21[_0xbb43('0x41')]=_[_0xbb43('0x42')](_0x467009[_0xbb43('0x41')]);_0x2a4b21['filters']=_[_0xbb43('0x43')](_0x2a4b21[_0xbb43('0x40')],_0x2a4b21['query']);_0x2db230['attributes']=_[_0xbb43('0x43')](_0x2a4b21[_0xbb43('0x40')],qs[_0xbb43('0x44')](_0x467009[_0xbb43('0x41')][_0xbb43('0x44')]));_0x2db230['attributes']=_0x2db230['attributes'][_0xbb43('0x45')]?_0x2db230[_0xbb43('0x46')]:_0x2a4b21[_0xbb43('0x40')];if(!_0x467009[_0xbb43('0x41')][_0xbb43('0x47')](_0xbb43('0x48'))){_0x2db230[_0xbb43('0x2d')]=qs[_0xbb43('0x2d')](_0x467009[_0xbb43('0x41')][_0xbb43('0x2d')]);_0x2db230['offset']=qs['offset'](_0x467009[_0xbb43('0x41')][_0xbb43('0x2b')]);}_0x2db230['order']=qs[_0xbb43('0x49')](_0x467009[_0xbb43('0x41')][_0xbb43('0x49')]);_0x2db230[_0xbb43('0x4a')]=qs[_0xbb43('0x4b')](_[_0xbb43('0x4c')](_0x467009[_0xbb43('0x41')],_0x2a4b21['filters']),_0x92d7cf);if(_0x467009[_0xbb43('0x41')][_0xbb43('0x4d')]){_0x2db230['where']=_[_0xbb43('0x4e')](_0x2db230[_0xbb43('0x4a')],{'$or':_['map'](_0x92d7cf,function(_0x3ab5fb){if(_0x3ab5fb[_0xbb43('0x3f')]!==_0xbb43('0x4f')){var _0x15fab6={};_0x15fab6[_0x3ab5fb[_0xbb43('0x37')]]={'$like':'%'+_0x467009[_0xbb43('0x41')][_0xbb43('0x4d')]+'%'};return _0x15fab6;}})});}_0x2db230=_[_0xbb43('0x4e')]({},_0x2db230,_0x467009[_0xbb43('0x50')]);var _0x2f044f={'where':_0x2db230[_0xbb43('0x4a')]};return db[_0xbb43('0x3c')]['count'](_0x2f044f)[_0xbb43('0x1e')](function(_0x10c8d7){_0x2a854d[_0xbb43('0x51')]=_0x10c8d7;if(_0x467009[_0xbb43('0x41')]['includeAll']){_0x2db230[_0xbb43('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xbb43('0x53')](_0x2db230);})['then'](function(_0x21f78b){_0x2a854d[_0xbb43('0x54')]=_0x21f78b;return _0x2a854d;})[_0xbb43('0x1e')](respondWithFilteredResult(_0x363e1a,_0x2db230))['catch'](handleError(_0x363e1a,null));};exports[_0xbb43('0x55')]=function(_0x218da6,_0x3581c6){var _0x4dc5d4={'raw':![],'where':{'id':_0x218da6[_0xbb43('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xbb43('0x3a')}]},_0xd485c7={};_0xd485c7['model']=_[_0xbb43('0x42')](db[_0xbb43('0x3c')]['rawAttributes']);_0xd485c7[_0xbb43('0x41')]=_[_0xbb43('0x42')](_0x218da6[_0xbb43('0x41')]);_0xd485c7['filters']=_[_0xbb43('0x43')](_0xd485c7['model'],_0xd485c7[_0xbb43('0x41')]);_0x4dc5d4[_0xbb43('0x46')]=_[_0xbb43('0x43')](_0xd485c7['model'],qs[_0xbb43('0x44')](_0x218da6[_0xbb43('0x41')]['fields']));_0x4dc5d4['attributes']=_0x4dc5d4[_0xbb43('0x46')][_0xbb43('0x45')]?_0x4dc5d4['attributes']:_0xd485c7['model'];if(_0x218da6[_0xbb43('0x41')]['includeAll']){_0x4dc5d4[_0xbb43('0x52')]=[{'all':!![]}];}_0x4dc5d4=_[_0xbb43('0x4e')]({},_0x4dc5d4,_0x218da6[_0xbb43('0x50')]);return db['OpenchannelAccount']['find'](_0x4dc5d4)['then'](handleEntityNotFound(_0x3581c6,null))['then'](respondWithResult(_0x3581c6,null))['catch'](handleError(_0x3581c6,null));};exports[_0xbb43('0x57')]=function(_0x31d265,_0x2a726d){return db[_0xbb43('0x3c')][_0xbb43('0x57')](_0x31d265['body'],{})[_0xbb43('0x1e')](function(_0x529455){var _0x6e7c04=_0x31d265['user'][_0xbb43('0x32')]({'plain':!![]});if(!_0x6e7c04)throw new Error(_0xbb43('0x58'));if(_0x6e7c04[_0xbb43('0x59')]===_0xbb43('0x5a')){var _0x4c13ad=_0x529455[_0xbb43('0x32')]({'plain':!![]});var _0x511e60=_0xbb43('0x33');return db[_0xbb43('0x5b')]['find']({'where':{'name':_0x511e60,'userProfileId':_0x6e7c04[_0xbb43('0x5c')]},'raw':!![]})[_0xbb43('0x1e')](function(_0x5cde88){if(_0x5cde88&&_0x5cde88[_0xbb43('0x5d')]===0x0){return db[_0xbb43('0x34')][_0xbb43('0x57')]({'name':_0x4c13ad[_0xbb43('0x37')],'resourceId':_0x4c13ad['id'],'type':_0x5cde88[_0xbb43('0x37')],'sectionId':_0x5cde88['id']},{})[_0xbb43('0x1e')](function(){return _0x529455;});}else{return _0x529455;}})[_0xbb43('0x27')](function(_0x161556){logger['error'](_0xbb43('0x5e'),_0x161556);throw _0x161556;});}return _0x529455;})['then'](respondWithResult(_0x2a726d,0xc9))[_0xbb43('0x27')](handleError(_0x2a726d,null));};exports[_0xbb43('0x30')]=function(_0x5e5530,_0x1b7920){if(_0x5e5530[_0xbb43('0x5f')]['id']){delete _0x5e5530[_0xbb43('0x5f')]['id'];}return db[_0xbb43('0x3c')][_0xbb43('0x60')]({'where':{'id':_0x5e5530[_0xbb43('0x56')]['id']},'include':[{'model':db[_0xbb43('0x39')],'as':_0xbb43('0x3a')}]})['then'](handleEntityNotFound(_0x1b7920,null))[_0xbb43('0x1e')](saveUpdates(_0x5e5530[_0xbb43('0x5f')],null))[_0xbb43('0x1e')](respondWithResult(_0x1b7920,null))[_0xbb43('0x27')](handleError(_0x1b7920,null));};exports['destroy']=function(_0x226f27,_0x5d73a5){return db[_0xbb43('0x3c')]['find']({'where':{'id':_0x226f27[_0xbb43('0x56')]['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x5d73a5,null))[_0xbb43('0x1e')](removeEntity(_0x5d73a5,null))[_0xbb43('0x27')](handleError(_0x5d73a5,null));};exports[_0xbb43('0x61')]=function(_0x43468e,_0x349699){return db[_0xbb43('0x3c')][_0xbb43('0x61')]()[_0xbb43('0x1e')](respondWithResult(_0x349699,null))['catch'](handleError(_0x349699,null));};exports[_0xbb43('0x62')]=function(_0x5f4dc2,_0x1b9280,_0x3efdd7){if(_0x5f4dc2[_0xbb43('0x5f')]['id']){delete _0x5f4dc2[_0xbb43('0x5f')]['id'];}return db[_0xbb43('0x3c')][_0xbb43('0x60')]({'where':{'id':_0x5f4dc2[_0xbb43('0x56')]['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x1b9280,null))['then'](function(_0x405665){if(_0x405665){_0x5f4dc2['body']['OpenchannelAccountId']=_0x405665['id'];return db[_0xbb43('0x63')]['create'](_0x5f4dc2[_0xbb43('0x5f')]);}})[_0xbb43('0x1e')](respondWithResult(_0x1b9280,null))['catch'](handleError(_0x1b9280,null));};exports[_0xbb43('0x64')]=function(_0x347c53,_0x52bd44,_0x443173){var _0xec31d5={'raw':![],'where':{}};var _0x2a0df7={};var _0x14678c={'count':0x0,'rows':[]};return db[_0xbb43('0x3c')][_0xbb43('0x65')]({'where':{'id':_0x347c53[_0xbb43('0x56')]['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x52bd44,null))[_0xbb43('0x1e')](function(_0x28ce3e){if(_0x28ce3e){_0x2a0df7[_0xbb43('0x40')]=_[_0xbb43('0x42')](db[_0xbb43('0x63')][_0xbb43('0x3d')]);_0x2a0df7[_0xbb43('0x41')]=_[_0xbb43('0x42')](_0x347c53[_0xbb43('0x41')]);_0x2a0df7[_0xbb43('0x4b')]=_[_0xbb43('0x43')](_0x2a0df7[_0xbb43('0x40')],_0x2a0df7[_0xbb43('0x41')]);_0xec31d5[_0xbb43('0x46')]=_[_0xbb43('0x43')](_0x2a0df7[_0xbb43('0x40')],qs[_0xbb43('0x44')](_0x347c53[_0xbb43('0x41')][_0xbb43('0x44')]));_0xec31d5[_0xbb43('0x46')]=_0xec31d5[_0xbb43('0x46')][_0xbb43('0x45')]?_0xec31d5['attributes']:_0x2a0df7[_0xbb43('0x40')];if(!_0x347c53[_0xbb43('0x41')][_0xbb43('0x47')](_0xbb43('0x48'))){_0xec31d5[_0xbb43('0x2d')]=qs[_0xbb43('0x2d')](_0x347c53['query'][_0xbb43('0x2d')]);_0xec31d5[_0xbb43('0x2b')]=qs['offset'](_0x347c53['query']['offset']);}_0xec31d5[_0xbb43('0x66')]=qs[_0xbb43('0x49')](_0x347c53[_0xbb43('0x41')][_0xbb43('0x49')]);_0xec31d5['where']=qs['filters'](_[_0xbb43('0x4c')](_0x347c53['query'],_0x2a0df7[_0xbb43('0x4b')]));_0xec31d5[_0xbb43('0x4a')]['OpenchannelAccountId']=_0x28ce3e['id'];if(_0x347c53[_0xbb43('0x41')][_0xbb43('0x4d')]){_0xec31d5[_0xbb43('0x4a')]=_['merge'](_0xec31d5[_0xbb43('0x4a')],{'$or':_['map'](_0xec31d5[_0xbb43('0x46')],function(_0x3492e6){var _0x4bd0d6={};_0x4bd0d6[_0x3492e6]={'$like':'%'+_0x347c53[_0xbb43('0x41')][_0xbb43('0x4d')]+'%'};return _0x4bd0d6;})});}_0xec31d5=_[_0xbb43('0x4e')]({},_0xec31d5,_0x347c53[_0xbb43('0x50')]);return db[_0xbb43('0x63')]['count']({'where':_0xec31d5['where']})[_0xbb43('0x1e')](function(_0x3d2008){_0x14678c[_0xbb43('0x51')]=_0x3d2008;if(_0x347c53[_0xbb43('0x41')][_0xbb43('0x67')]){_0xec31d5[_0xbb43('0x52')]=[{'all':!![]}];}return db[_0xbb43('0x63')][_0xbb43('0x53')](_0xec31d5);})['then'](function(_0x22c358){_0x14678c['rows']=_0x22c358;return _0x14678c;});}})[_0xbb43('0x1e')](respondWithFilteredResult(_0x52bd44,_0xec31d5))[_0xbb43('0x27')](handleError(_0x52bd44,null));};exports['removeDispositions']=function(_0x371a7c,_0x1ba677,_0xbcc283){return db[_0xbb43('0x3c')][_0xbb43('0x60')]({'where':{'id':_0x371a7c[_0xbb43('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ba677,null))[_0xbb43('0x1e')](function(_0x2d18e7){if(_0x2d18e7){return _0x2d18e7['removeDispositions'](_0x371a7c[_0xbb43('0x41')]['ids']);}})[_0xbb43('0x1e')](respondWithStatusCode(_0x1ba677,null))[_0xbb43('0x27')](handleError(_0x1ba677,null));};exports[_0xbb43('0x68')]=function(_0x1a6438,_0x6a1fa6,_0x126b2a){if(_0x1a6438[_0xbb43('0x5f')]['id']){delete _0x1a6438[_0xbb43('0x5f')]['id'];}return db[_0xbb43('0x3c')][_0xbb43('0x60')]({'where':{'id':_0x1a6438[_0xbb43('0x56')]['id']}})['then'](handleEntityNotFound(_0x6a1fa6,null))[_0xbb43('0x1e')](function(_0x50f5d0){if(_0x50f5d0){_0x1a6438[_0xbb43('0x5f')][_0xbb43('0x69')]=_0x50f5d0['id'];return db[_0xbb43('0x6a')][_0xbb43('0x57')](_0x1a6438[_0xbb43('0x5f')]);}})['then'](respondWithResult(_0x6a1fa6,null))[_0xbb43('0x27')](handleError(_0x6a1fa6,null));};exports[_0xbb43('0x6b')]=function(_0x2306fa,_0x3ba331,_0x3c5b72){var _0x5e26d1={'raw':![],'where':{}};var _0x36305d={};var _0x48efd9={'count':0x0,'rows':[]};return db[_0xbb43('0x3c')][_0xbb43('0x65')]({'where':{'id':_0x2306fa[_0xbb43('0x56')]['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x3ba331,null))[_0xbb43('0x1e')](function(_0x5b2803){if(_0x5b2803){_0x36305d[_0xbb43('0x40')]=_['keys'](db[_0xbb43('0x6a')]['rawAttributes']);_0x36305d[_0xbb43('0x41')]=_['keys'](_0x2306fa[_0xbb43('0x41')]);_0x36305d[_0xbb43('0x4b')]=_[_0xbb43('0x43')](_0x36305d['model'],_0x36305d[_0xbb43('0x41')]);_0x5e26d1['attributes']=_[_0xbb43('0x43')](_0x36305d[_0xbb43('0x40')],qs['fields'](_0x2306fa[_0xbb43('0x41')][_0xbb43('0x44')]));_0x5e26d1[_0xbb43('0x46')]=_0x5e26d1[_0xbb43('0x46')]['length']?_0x5e26d1[_0xbb43('0x46')]:_0x36305d[_0xbb43('0x40')];if(!_0x2306fa['query']['hasOwnProperty']('nolimit')){_0x5e26d1[_0xbb43('0x2d')]=qs['limit'](_0x2306fa[_0xbb43('0x41')][_0xbb43('0x2d')]);_0x5e26d1[_0xbb43('0x2b')]=qs['offset'](_0x2306fa['query'][_0xbb43('0x2b')]);}_0x5e26d1[_0xbb43('0x66')]=qs[_0xbb43('0x49')](_0x2306fa[_0xbb43('0x41')]['sort']);_0x5e26d1[_0xbb43('0x4a')]=qs[_0xbb43('0x4b')](_[_0xbb43('0x4c')](_0x2306fa['query'],_0x36305d[_0xbb43('0x4b')]));_0x5e26d1[_0xbb43('0x4a')][_0xbb43('0x69')]=_0x5b2803['id'];if(_0x2306fa[_0xbb43('0x41')][_0xbb43('0x4d')]){_0x5e26d1['where']=_[_0xbb43('0x4e')](_0x5e26d1['where'],{'$or':_[_0xbb43('0x3b')](_0x5e26d1[_0xbb43('0x46')],function(_0x1055f9){var _0x2adf50={};_0x2adf50[_0x1055f9]={'$like':'%'+_0x2306fa['query'][_0xbb43('0x4d')]+'%'};return _0x2adf50;})});}_0x5e26d1=_['merge']({},_0x5e26d1,_0x2306fa[_0xbb43('0x50')]);return db[_0xbb43('0x6a')]['count']({'where':_0x5e26d1[_0xbb43('0x4a')]})[_0xbb43('0x1e')](function(_0x37345e){_0x48efd9[_0xbb43('0x51')]=_0x37345e;if(_0x2306fa['query']['includeAll']){_0x5e26d1['include']=[{'all':!![]}];}return db[_0xbb43('0x6a')][_0xbb43('0x53')](_0x5e26d1);})['then'](function(_0x3537d8){_0x48efd9[_0xbb43('0x54')]=_0x3537d8;return _0x48efd9;});}})[_0xbb43('0x1e')](respondWithFilteredResult(_0x3ba331,_0x5e26d1))[_0xbb43('0x27')](handleError(_0x3ba331,null));};exports[_0xbb43('0x6c')]=function(_0x174586,_0x6a0f62,_0xf3db56){return db[_0xbb43('0x3c')]['find']({'where':{'id':_0x174586[_0xbb43('0x56')]['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x6a0f62,null))[_0xbb43('0x1e')](function(_0x394e1e){if(_0x394e1e){return _0x394e1e[_0xbb43('0x6c')](_0x174586[_0xbb43('0x41')][_0xbb43('0x6d')]);}})[_0xbb43('0x1e')](respondWithStatusCode(_0x6a0f62,null))[_0xbb43('0x27')](handleError(_0x6a0f62,null));};exports[_0xbb43('0x6e')]=function(_0x9edadf,_0x5e3539,_0x3299f8){var _0x29b93f={'body':_0x9edadf['body'],'channel':_0xbb43('0x6f')};var _0x3d4717=[];var _0x13e255=[];var _0x502af7={};var _0x58ba69=![];return db[_0xbb43('0x70')][_0xbb43('0x61')]()[_0xbb43('0x1e')](function(_0x187f44){if(!_0x187f44){throw new db[(_0xbb43('0x71'))][(_0xbb43('0x72'))](_0xbb43('0x73'));}_0x3d4717=_[_0xbb43('0x74')](_['keys'](_0x187f44),[_0xbb43('0x75'),_0xbb43('0x76')]);_0x13e255=_[_0xbb43('0x74')](_[_0xbb43('0x42')](_0x187f44),[_0xbb43('0x75'),'updatedAt','CompanyId',_0xbb43('0x77')]);if(_0x9edadf[_0xbb43('0x5f')]['id']){delete _0x9edadf[_0xbb43('0x5f')]['id'];}if(_[_0xbb43('0x78')](_0x9edadf['body'][_0xbb43('0x79')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xbb43('0x78')](_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x5f')])||_0x9edadf['body'][_0xbb43('0x5f')]===''){throw new db[(_0xbb43('0x71'))][(_0xbb43('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbb43('0x78')](_0x9edadf['body'][_0xbb43('0x7a')])){throw new db[(_0xbb43('0x71'))][(_0xbb43('0x72'))](_0xbb43('0x7b')+_0x13e255);}if(!_[_0xbb43('0x7c')](_0x13e255,_0x9edadf['body'][_0xbb43('0x7a')])){throw new db[(_0xbb43('0x71'))]['ValidationError'](_0xbb43('0x7d')+_0x13e255);}_0x502af7[_0x9edadf['body']['mapKey']]=_0x9edadf[_0xbb43('0x5f')]['from'];})[_0xbb43('0x1e')](function(){return db[_0xbb43('0x3c')][_0xbb43('0x60')]({'where':{'id':_0x9edadf[_0xbb43('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xbb43('0x70')],'as':_0xbb43('0x7e'),'where':_0x502af7,'limit':0x1,'order':[[_0xbb43('0x76'),_0xbb43('0x7f')]]}]},{'model':db['OpenchannelApplication'],'as':_0xbb43('0x80')}]});})[_0xbb43('0x1e')](handleEntityNotFound(_0x5e3539,null))[_0xbb43('0x1e')](function(_0xad2232){if(_0xad2232&&_0xad2232['List']){_0x29b93f[_0xbb43('0x81')]=_0xad2232;_0x29b93f[_0xbb43('0x82')]=_0xad2232['Applications'];_0x29b93f[_0xbb43('0x83')]=_0xad2232['List'];_0x29b93f[_0xbb43('0x82')]=_[_0xbb43('0x84')](_0x29b93f[_0xbb43('0x82')],[_0xbb43('0x85')],['asc']);if(_0x29b93f[_0xbb43('0x81')][_0xbb43('0x80')]){delete _0x29b93f[_0xbb43('0x81')][_0xbb43('0x80')];}if(_0x29b93f[_0xbb43('0x81')][_0xbb43('0x86')]&&_0x29b93f['account'][_0xbb43('0x86')][_0xbb43('0x7e')][_0xbb43('0x45')]){return _0x29b93f[_0xbb43('0x81')][_0xbb43('0x86')]['Contacts'][0x0];}var _0x567dc8=_[_0xbb43('0x87')](_0x9edadf[_0xbb43('0x5f')],{'firstName':_0x9edadf['body'][_0xbb43('0x79')],'ListId':_0xad2232[_0xbb43('0x77')]});_0x567dc8[_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x7a')]]=_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x79')];return db[_0xbb43('0x70')][_0xbb43('0x57')](_0x567dc8,{'fields':_0x3d4717,'raw':!![]});}})[_0xbb43('0x1e')](handleEntityNotFound(_0x5e3539,null))[_0xbb43('0x1e')](function(_0x8b8045){_0x29b93f[_0xbb43('0x88')]=_0x8b8045;if(_0x8b8045){var _0x4703c7={'ContactId':_0x8b8045['id'],'OpenchannelAccountId':_0x9edadf[_0xbb43('0x56')]['id'],'from':(_0x8b8045[_0xbb43('0x89')]||'')+'\x20'+(_0x8b8045[_0xbb43('0x8a')]||'')};var _0x21151d={'OpenchannelAccountId':_0x9edadf[_0xbb43('0x56')]['id'],'closed':![]};if(_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x8b')]){_0x21151d[_0xbb43('0x8b')]=_0x9edadf['body'][_0xbb43('0x8b')];return db[_0xbb43('0x8c')][_0xbb43('0x60')]({'where':_0x21151d})[_0xbb43('0x1e')](function(_0x360524){if(_0x360524){return[_0x360524,![]];}_0x4703c7['threadId']=_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x8b')];_0x4703c7[_0xbb43('0x8d')]=_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x8d')];return db['OpenchannelInteraction']['create'](_0x4703c7)[_0xbb43('0x1e')](function(_0x408598){return[_0x408598,!![]];});});}else{_0x21151d[_0xbb43('0x8b')]=null;}_0x21151d['ContactId']=_0x8b8045['id'];return db['OpenchannelInteraction']['find']({'where':_0x21151d})[_0xbb43('0x1e')](function(_0x1bece2){if(_0x1bece2){return[_0x1bece2,![]];}return db['OpenchannelInteraction'][_0xbb43('0x57')](_0x4703c7)[_0xbb43('0x1e')](function(_0x3f07fc){return[_0x3f07fc,!![]];});});}})[_0xbb43('0x8e')](function(_0x55ca8d,_0x30cc03){if(_0x55ca8d){_0x58ba69=_0x30cc03;if(!_0x30cc03){var _0x445590={'from':(_0x29b93f[_0xbb43('0x88')][_0xbb43('0x89')]||'')+'\x20'+(_0x29b93f[_0xbb43('0x88')]['lastName']||'')};if(_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x8b')]&&_0x9edadf[_0xbb43('0x5f')]['messageId']&&_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x8b')]!=_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x8f')]){_0x445590[_0xbb43('0x8b')]=_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x8f')];}return _0x55ca8d['update'](_0x445590);}else{return _0x55ca8d;}}})['then'](function(_0x4e3636){_0x29b93f[_0xbb43('0x90')]=_0x4e3636[_0xbb43('0x32')]({'plain':!![]});_0x29b93f[_0xbb43('0x90')][_0xbb43('0x91')]=_0x58ba69;if(_0x29b93f[_0xbb43('0x90')]['created']){if(_0x29b93f['account'][_0xbb43('0x92')]){_0x29b93f['applications'][_0xbb43('0x93')]({'id':0x0,'priority':_0x29b93f['applications']['length']+0x1,'app':_0xbb43('0x94'),'appdata':_0xbb43('0x95'),'interval':'*,*,*,*'});}}return db[_0xbb43('0x96')]['create']({'body':_0x9edadf[_0xbb43('0x5f')]['body'],'OpenchannelAccountId':_0x9edadf['params']['id'],'OpenchannelInteractionId':_0x4e3636['id'],'direction':'in','ContactId':_0x29b93f['contact']['id'],'AttachmentId':_0x9edadf[_0xbb43('0x5f')][_0xbb43('0x97')]});})[_0xbb43('0x1e')](function(_0x27504a){_0x29b93f[_0xbb43('0x26')]=_0x27504a;if(_0x29b93f['interaction'][_0xbb43('0x98')]){return db[_0xbb43('0x99')][_0xbb43('0x60')]({'attributes':['id',_0xbb43('0x37')],'where':{'id':_0x29b93f[_0xbb43('0x90')][_0xbb43('0x98')]}})[_0xbb43('0x1e')](function(_0x53c49d){if(_0x53c49d){_0x29b93f[_0xbb43('0x82')]['unshift']({'id':0x0,'priority':0x0,'app':_0xbb43('0x9a'),'appdata':_0x53c49d[_0xbb43('0x37')]+','+(_0x29b93f[_0xbb43('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0xbb43('0x9b')});_0x29b93f[_0xbb43('0x9c')]=![];}return respondWithRpcPromise(_0xbb43('0x9d'),'startRouting',_0x29b93f);});}return respondWithRpcPromise(_0xbb43('0x9d'),_0xbb43('0x9e'),_0x29b93f);})[_0xbb43('0x1e')](function(_0xdd5a06){respondWithRpcPromise(_0xbb43('0x9f'),'EventManager',{'event':_0xbb43('0x6e'),'message':_0xdd5a06},client9002);return _0xdd5a06;})['then'](respondWithResult(_0x5e3539,null))[_0xbb43('0x27')](handleError(_0x5e3539,null));};exports[_0xbb43('0xa0')]=function(_0x45ba96,_0x3aed08){var _0xb9869e=_0x45ba96['params']['id'];var _0x42c68e=_0x45ba96[_0xbb43('0x5f')];var _0x1aa696=0xc8;var _0x3b829e=null;return db[_0xbb43('0xa1')][_0xbb43('0xa2')]({'isolationLevel':db[_0xbb43('0xa1')][_0xbb43('0xa3')][_0xbb43('0xa4')]['READ_COMMITTED']},function(_0x401e7b){return db[_0xbb43('0x3c')][_0xbb43('0x65')]({'where':{'id':_0xb9869e},'transaction':_0x401e7b})['then'](function(_0x3c7bda){if(_0x3c7bda){return db[_0xbb43('0xa5')][_0xbb43('0x31')]({'where':{'OpenchannelAccountId':_0xb9869e},'transaction':_0x401e7b})[_0xbb43('0x1e')](function(){var _0x18574c=_[_0xbb43('0x3b')](_0x42c68e,function(_0x236f6b){_0x236f6b[_0xbb43('0x69')]=_0xb9869e;return _0x236f6b;});return db[_0xbb43('0xa5')][_0xbb43('0xa6')](_0x18574c,{'transaction':_0x401e7b});});}else{_0x1aa696=0x194;_0x3b829e=[];}});})[_0xbb43('0x1e')](function(){if(_0x1aa696!==0x194){return db[_0xbb43('0xa5')][_0xbb43('0xa7')]({'where':{'OpenchannelAccountId':_0xb9869e},'order':_0xbb43('0x85')})[_0xbb43('0x1e')](function(_0x23bb72){_0x3b829e=_0x23bb72;});}})[_0xbb43('0x27')](function(_0x4afeed){_0x1aa696=0x1f4;logger[_0xbb43('0x24')](_0x4afeed[_0xbb43('0x36')]);if(_0x4afeed[_0xbb43('0x37')]){delete _0x4afeed['name'];}_0x3b829e=_0x4afeed;})['finally'](function(){if(_0x3b829e===null){_0x3aed08[_0xbb43('0x35')](_0x1aa696);}else{if(_0x1aa696===0x1f4){_0x3aed08[_0xbb43('0x28')](_0x1aa696)['send'](_0x3b829e);}else{_0x3aed08['status'](_0x1aa696)[_0xbb43('0x2a')](_0x3b829e);}}});};exports[_0xbb43('0xa8')]=function(_0x1954e8,_0x16eff3,_0x2ff011){var _0x5ccc92={};var _0x2651f9={};var _0x53c8dd;var _0x5313b6;return db['OpenchannelAccount'][_0xbb43('0x65')]({'where':{'id':_0x1954e8[_0xbb43('0x56')]['id']}})['then'](handleEntityNotFound(_0x16eff3,null))[_0xbb43('0x1e')](function(_0x3244ed){if(_0x3244ed){_0x53c8dd=_0x3244ed;_0x2651f9[_0xbb43('0x40')]=_[_0xbb43('0x42')](db[_0xbb43('0xa5')]['rawAttributes']);_0x2651f9[_0xbb43('0x41')]=_[_0xbb43('0x42')](_0x1954e8[_0xbb43('0x41')]);_0x2651f9[_0xbb43('0x4b')]=_['intersection'](_0x2651f9[_0xbb43('0x40')],_0x2651f9['query']);_0x5ccc92[_0xbb43('0x46')]=_[_0xbb43('0x43')](_0x2651f9[_0xbb43('0x40')],qs[_0xbb43('0x44')](_0x1954e8[_0xbb43('0x41')][_0xbb43('0x44')]));_0x5ccc92[_0xbb43('0x46')]=_0x5ccc92[_0xbb43('0x46')][_0xbb43('0x45')]?_0x5ccc92[_0xbb43('0x46')]:_0x2651f9[_0xbb43('0x40')];_0x5ccc92[_0xbb43('0x66')]=qs[_0xbb43('0x49')](_0x1954e8[_0xbb43('0x41')][_0xbb43('0x49')]);_0x5ccc92[_0xbb43('0x4a')]=qs['filters'](_['pick'](_0x1954e8[_0xbb43('0x41')],_0x2651f9[_0xbb43('0x4b')]));if(_0x1954e8['query'][_0xbb43('0x4d')]){_0x5ccc92[_0xbb43('0x4a')]=_[_0xbb43('0x4e')](_0x5ccc92[_0xbb43('0x4a')],{'$or':_[_0xbb43('0x3b')](_0x5ccc92['attributes'],function(_0x1a534c){var _0x5291bb={};_0x5291bb[_0x1a534c]={'$like':'%'+_0x1954e8['query'][_0xbb43('0x4d')]+'%'};return _0x5291bb;})});}_0x5ccc92=_['merge']({},_0x5ccc92,_0x1954e8[_0xbb43('0x50')]);return _0x53c8dd['getApplications'](_0x5ccc92);}})[_0xbb43('0x1e')](function(_0x1474ae){if(_0x1474ae){_0x5313b6=_0x1474ae[_0xbb43('0x45')];if(!_0x1954e8[_0xbb43('0x41')]['hasOwnProperty'](_0xbb43('0x48'))){_0x5ccc92[_0xbb43('0x2d')]=qs[_0xbb43('0x2d')](_0x1954e8[_0xbb43('0x41')]['limit']);_0x5ccc92[_0xbb43('0x2b')]=qs[_0xbb43('0x2b')](_0x1954e8[_0xbb43('0x41')]['offset']);}return _0x53c8dd[_0xbb43('0xa8')](_0x5ccc92);}})[_0xbb43('0x1e')](function(_0x22da55){if(_0x22da55){return _0x22da55?{'count':_0x5313b6,'rows':_0x22da55}:null;}})[_0xbb43('0x1e')](respondWithResult(_0x16eff3,null))[_0xbb43('0x27')](handleError(_0x16eff3,null));};exports['getInteractions']=function(_0x913569,_0x5b3250,_0x5ca869){var _0x4702cd={'raw':![],'where':{}};var _0x47967a={};var _0x1a61e1={'count':0x0,'rows':[]};return db[_0xbb43('0x3c')][_0xbb43('0x65')]({'where':{'id':_0x913569[_0xbb43('0x56')]['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x5b3250,null))['then'](function(_0x28d33a){if(_0x28d33a){_0x47967a[_0xbb43('0x40')]=_['keys'](db[_0xbb43('0x8c')][_0xbb43('0x3d')]);_0x47967a[_0xbb43('0x41')]=_[_0xbb43('0x42')](_0x913569[_0xbb43('0x41')]);_0x47967a[_0xbb43('0x4b')]=_['intersection'](_0x47967a[_0xbb43('0x40')],_0x47967a[_0xbb43('0x41')]);_0x4702cd[_0xbb43('0x46')]=_[_0xbb43('0x43')](_0x47967a[_0xbb43('0x40')],qs[_0xbb43('0x44')](_0x913569[_0xbb43('0x41')][_0xbb43('0x44')]));_0x4702cd['attributes']=_0x4702cd[_0xbb43('0x46')][_0xbb43('0x45')]?_0x4702cd['attributes']:_0x47967a[_0xbb43('0x40')];if(!_0x913569[_0xbb43('0x41')][_0xbb43('0x47')](_0xbb43('0x48'))){_0x4702cd[_0xbb43('0x2d')]=qs[_0xbb43('0x2d')](_0x913569[_0xbb43('0x41')][_0xbb43('0x2d')]);_0x4702cd[_0xbb43('0x2b')]=qs[_0xbb43('0x2b')](_0x913569[_0xbb43('0x41')][_0xbb43('0x2b')]);}_0x4702cd[_0xbb43('0x66')]=qs['sort'](_0x913569[_0xbb43('0x41')][_0xbb43('0x49')]);_0x4702cd['where']=qs[_0xbb43('0x4b')](_['pick'](_0x913569[_0xbb43('0x41')],_0x47967a[_0xbb43('0x4b')]));_0x4702cd[_0xbb43('0x4a')][_0xbb43('0x69')]=_0x28d33a['id'];if(_0x913569[_0xbb43('0x41')][_0xbb43('0x4d')]){_0x4702cd[_0xbb43('0x4a')]=_[_0xbb43('0x4e')](_0x4702cd[_0xbb43('0x4a')],{'$or':_[_0xbb43('0x3b')](_0x4702cd[_0xbb43('0x46')],function(_0xff50df){var _0x54fca4={};_0x54fca4[_0xff50df]={'$like':'%'+_0x913569['query'][_0xbb43('0x4d')]+'%'};return _0x54fca4;})});}_0x4702cd=_[_0xbb43('0x4e')]({},_0x4702cd,_0x913569['options']);return db[_0xbb43('0x8c')]['count']({'where':_0x4702cd['where']})['then'](function(_0x140520){_0x1a61e1[_0xbb43('0x51')]=_0x140520;if(_0x913569[_0xbb43('0x41')][_0xbb43('0x67')]){_0x4702cd[_0xbb43('0x52')]=[{'model':db[_0xbb43('0x70')],'as':_0xbb43('0xa9'),'required':![]},{'model':db[_0xbb43('0x99')],'as':'Owner','attributes':[_0xbb43('0x37'),_0xbb43('0xaa'),'internal'],'required':![]},{'model':db[_0xbb43('0xab')],'as':_0xbb43('0xac'),'attributes':['id',_0xbb43('0x37'),_0xbb43('0xad')],'where':_0x913569[_0xbb43('0x41')][_0xbb43('0xae')]?{'id':_0x913569[_0xbb43('0x41')][_0xbb43('0xae')]}:undefined,'required':_0x913569[_0xbb43('0x41')]['tag']?!![]:![]}];}return db[_0xbb43('0x8c')][_0xbb43('0x53')](_0x4702cd);})['then'](function(_0x50921c){_0x1a61e1[_0xbb43('0x54')]=_0x50921c;return _0x1a61e1;});}})[_0xbb43('0x1e')](respondWithFilteredResult(_0x5b3250,_0x4702cd))[_0xbb43('0x27')](handleError(_0x5b3250,null));};exports[_0xbb43('0xaf')]=function(_0x4a5d08,_0x3130b3,_0x4b6cfe){return db[_0xbb43('0x3c')]['find']({'where':{'id':_0x4a5d08[_0xbb43('0x56')]['id']}})['then'](handleEntityNotFound(_0x3130b3,null))[_0xbb43('0x1e')](function(_0x68bd09){if(_0x68bd09){return _0x68bd09[_0xbb43('0xaf')](_0x4a5d08[_0xbb43('0x5f')]['ids'],_[_0xbb43('0xb0')](_0x4a5d08[_0xbb43('0x5f')],[_0xbb43('0x6d'),'id'])||{})[_0xbb43('0x8e')](function(_0x71d1d9){for(var _0x1fbd28=0x0;_0x1fbd28<_0x4a5d08['body'][_0xbb43('0x6d')]['length'];_0x1fbd28+=0x1){socket[_0xbb43('0xb1')](_0xbb43('0xb2'),{'UserId':Number(_0x4a5d08[_0xbb43('0x5f')]['ids'][_0x1fbd28]),'OpenchannelAccountId':Number(_0x4a5d08[_0xbb43('0x56')]['id'])});}return _0x71d1d9;});}})[_0xbb43('0x1e')](respondWithResult(_0x3130b3,null))['catch'](handleError(_0x3130b3,null));};exports[_0xbb43('0xb3')]=function(_0x1d7aa8,_0x2f6fe6,_0x34aa82){return db[_0xbb43('0x3c')][_0xbb43('0x60')]({'where':{'id':_0x1d7aa8['params']['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x2f6fe6,null))[_0xbb43('0x1e')](function(_0x4dd2c6){if(_0x4dd2c6){return _0x4dd2c6[_0xbb43('0xb3')](_0x1d7aa8['query']['ids'])['then'](function(){if(_[_0xbb43('0xb4')](_0x1d7aa8['query'][_0xbb43('0x6d')])){for(var _0x43088f=0x0;_0x43088f<_0x1d7aa8[_0xbb43('0x41')][_0xbb43('0x6d')][_0xbb43('0x45')];_0x43088f+=0x1){socket[_0xbb43('0xb1')](_0xbb43('0xb5'),{'UserId':Number(_0x1d7aa8[_0xbb43('0x41')]['ids'][_0x43088f]),'OpenchannelAccountId':Number(_0x1d7aa8[_0xbb43('0x56')]['id'])});}}else{socket[_0xbb43('0xb1')](_0xbb43('0xb5'),{'UserId':Number(_0x1d7aa8[_0xbb43('0x41')][_0xbb43('0x6d')]),'OpenchannelAccountId':Number(_0x1d7aa8[_0xbb43('0x56')]['id'])});}});}})[_0xbb43('0x1e')](respondWithStatusCode(_0x2f6fe6,null))[_0xbb43('0x27')](handleError(_0x2f6fe6,null));};exports[_0xbb43('0xb6')]=function(_0x2cb3d8,_0x32ef02,_0x2ff487){var _0x39d4b5={};var _0x256258={};var _0x50fc65;var _0x4a6256;return db[_0xbb43('0x3c')][_0xbb43('0x65')]({'where':{'id':_0x2cb3d8[_0xbb43('0x56')]['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x32ef02,null))[_0xbb43('0x1e')](function(_0x3fa073){if(_0x3fa073){_0x50fc65=_0x3fa073;_0x256258['model']=_[_0xbb43('0x42')](db[_0xbb43('0x99')][_0xbb43('0x3d')]);_0x256258[_0xbb43('0x41')]=_[_0xbb43('0x42')](_0x2cb3d8[_0xbb43('0x41')]);_0x256258[_0xbb43('0x4b')]=_[_0xbb43('0x43')](_0x256258[_0xbb43('0x40')],_0x256258['query']);_0x39d4b5['attributes']=_[_0xbb43('0x43')](_0x256258[_0xbb43('0x40')],qs[_0xbb43('0x44')](_0x2cb3d8[_0xbb43('0x41')]['fields']));_0x39d4b5[_0xbb43('0x46')]=_0x39d4b5['attributes']['length']?_0x39d4b5[_0xbb43('0x46')]:_0x256258[_0xbb43('0x40')];_0x39d4b5[_0xbb43('0x66')]=qs[_0xbb43('0x49')](_0x2cb3d8[_0xbb43('0x41')][_0xbb43('0x49')]);_0x39d4b5[_0xbb43('0x4a')]=qs[_0xbb43('0x4b')](_[_0xbb43('0x4c')](_0x2cb3d8['query'],_0x256258[_0xbb43('0x4b')]));if(_0x2cb3d8[_0xbb43('0x41')][_0xbb43('0x4d')]){_0x39d4b5['where']=_['merge'](_0x39d4b5[_0xbb43('0x4a')],{'$or':_[_0xbb43('0x3b')](_0x39d4b5[_0xbb43('0x46')],function(_0x2b9f55){var _0x1f9e33={};_0x1f9e33[_0x2b9f55]={'$like':'%'+_0x2cb3d8[_0xbb43('0x41')][_0xbb43('0x4d')]+'%'};return _0x1f9e33;})});}_0x39d4b5=_[_0xbb43('0x4e')]({},_0x39d4b5,_0x2cb3d8['options']);return _0x50fc65[_0xbb43('0xb6')](_0x39d4b5);}})[_0xbb43('0x1e')](function(_0x543d05){if(_0x543d05){_0x4a6256=_0x543d05['length'];if(!_0x2cb3d8[_0xbb43('0x41')][_0xbb43('0x47')]('nolimit')){_0x39d4b5['limit']=qs[_0xbb43('0x2d')](_0x2cb3d8[_0xbb43('0x41')]['limit']);_0x39d4b5[_0xbb43('0x2b')]=qs[_0xbb43('0x2b')](_0x2cb3d8[_0xbb43('0x41')][_0xbb43('0x2b')]);}return _0x50fc65['getAgents'](_0x39d4b5);}})[_0xbb43('0x1e')](function(_0x582c77){if(_0x582c77){return _0x582c77?{'count':_0x4a6256,'rows':_0x582c77}:null;}})[_0xbb43('0x1e')](respondWithResult(_0x32ef02,null))['catch'](handleError(_0x32ef02,null));};exports[_0xbb43('0xb7')]=function(_0x16e5b1,_0x52220a,_0x185e5a){var _0x59b58f,_0x1e5988,_0x1de001;if(_[_0xbb43('0x78')](_0x16e5b1[_0xbb43('0x5f')]['body'])||_0x16e5b1[_0xbb43('0x5f')][_0xbb43('0x5f')]===''){throw new db['Sequelize'][(_0xbb43('0x72'))](_0xbb43('0xb8'));}if(_[_0xbb43('0x78')](_0x16e5b1[_0xbb43('0x5f')]['to'])){}_0x59b58f=_0x16e5b1[_0xbb43('0x5f')]['to'];return db[_0xbb43('0x3c')][_0xbb43('0x65')]({'where':{'id':_0x16e5b1[_0xbb43('0x56')]['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x52220a,null))['then'](function(_0x10ced4){if(_0x10ced4){return db[_0xbb43('0x3c')]['find']({'where':{'id':_0x10ced4['id']},'include':[{'model':db[_0xbb43('0xb9')],'as':_0xbb43('0x86'),'include':[{'model':db[_0xbb43('0x70')],'as':'Contacts','where':{[_0x10ced4[_0xbb43('0x7a')]]:_0x59b58f},'limit':0x1,'order':[['updatedAt',_0xbb43('0x7f')]]}]}]})[_0xbb43('0x1e')](handleEntityNotFound(_0x52220a,null))['then'](function(_0x4ba2dc){if(_0x4ba2dc&&_0x4ba2dc[_0xbb43('0x86')]){_0x1e5988=_0x4ba2dc[_0xbb43('0x32')]({'plain':!![]});if(_0x1e5988[_0xbb43('0x86')]&&_0x1e5988[_0xbb43('0x86')]['Contacts'][_0xbb43('0x45')]){return _0x1e5988[_0xbb43('0x86')][_0xbb43('0x7e')][0x0];}return db['CmContact'][_0xbb43('0x57')](_[_0xbb43('0x87')](_0x16e5b1[_0xbb43('0x5f')],{'firstName':_0x59b58f,[_0x4ba2dc[_0xbb43('0x7a')]]:_0x59b58f,'phone':_0x59b58f,'ListId':_0x1e5988[_0xbb43('0x77')]}));}})['then'](handleEntityNotFound(_0x52220a,null))[_0xbb43('0x1e')](function(_0x5addc8){if(_0x5addc8){_0x1de001=_0x5addc8;return db[_0xbb43('0x8c')][_0xbb43('0x60')]({'where':{'ContactId':_0x1de001['id'],'closed':![],'OpenchannelAccountId':_0x1e5988['id']}})[_0xbb43('0x1e')](function(_0x34ba56){if(_0x34ba56){return[_0x34ba56,![]];}return db[_0xbb43('0x8c')]['create']({'UserId':_0x16e5b1[_0xbb43('0x5a')]['id'],'ContactId':_0x1de001['id'],'OpenchannelAccountId':_0x1e5988['id'],'lastMsgDirection':'out','firstMsgDirection':_0xbb43('0xba'),'Messages':[_[_0xbb43('0x4e')](_0x16e5b1['body'],{'read':![],'body':_0x16e5b1[_0xbb43('0x5f')][_0xbb43('0x5f')],'OpenchannelAccountId':_0x1e5988['id'],'UserId':_0x16e5b1[_0xbb43('0x5a')]['id'],'ContactId':_0x1de001['id']})]},{'include':[{'model':db[_0xbb43('0x96')],'as':_0xbb43('0xbb')}]})['then'](function(_0x496661){return[_0x496661,!![]];});});}})[_0xbb43('0x8e')](function(_0x385c4b,_0x50f964){if(_0x50f964){return _0x385c4b;}return db[_0xbb43('0x96')]['create'](_['merge'](_0x16e5b1['body'],{'read':![],'body':_0x16e5b1[_0xbb43('0x5f')][_0xbb43('0x5f')],'OpenchannelAccountId':_0x1e5988['id'],'OpenchannelInteractionId':_0x385c4b['id'],'UserId':_0x16e5b1[_0xbb43('0x5a')]['id'],'ContactId':_0x1de001['id']}))['then'](function(_0x2a0c02){_0x385c4b[_0xbb43('0xbc')][_0xbb43('0xbb')]=[];_0x385c4b[_0xbb43('0xbc')][_0xbb43('0xbb')][_0xbb43('0x93')](_0x2a0c02[_0xbb43('0xbc')]);return _0x385c4b;});});}})['then'](respondWithResult(_0x52220a,null))[_0xbb43('0x27')](handleError(_0x52220a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index a7dc70e..5780fdd 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 _0x22fb=['hook','exports','OpenchannelAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0x22fb,0x192));var _0xb22f=function(_0x34e610,_0x309a13){_0x34e610=_0x34e610-0x0;var _0x445bf6=_0x22fb[_0x34e610];return _0x445bf6;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xb22f('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb22f('0x1'),'afterUpdate':_0xb22f('0x2'),'afterDestroy':_0xb22f('0x3')};function emitEvent(_0x10d2c4){return function(_0x201512,_0x50cdab,_0x44717d){OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4+':'+_0x201512['id'],_0x201512);OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4,_0x201512);_0x44717d(null);};}for(var e in events){if(events[_0xb22f('0x5')](e)){var event=events[e];OpenchannelAccount[_0xb22f('0x6')](e,emitEvent(event));}}module[_0xb22f('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb903=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb','OpenchannelAccount'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb903,0x185));var _0x3b90=function(_0x400b22,_0xaa37e6){_0x400b22=_0x400b22-0x0;var _0x1410a1=_0xb903[_0x400b22];return _0x1410a1;};'use strict';var EventEmitter=require(_0x3b90('0x0'));var OpenchannelAccount=require(_0x3b90('0x1'))['db'][_0x3b90('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3b90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b90('0x4'),'afterDestroy':_0x3b90('0x5')};function emitEvent(_0x3b024a){return function(_0x1cd5d8,_0x30d8db,_0x40f726){OpenchannelAccountEvents[_0x3b90('0x6')](_0x3b024a+':'+_0x1cd5d8['id'],_0x1cd5d8);OpenchannelAccountEvents['emit'](_0x3b024a,_0x1cd5d8);_0x40f726(null);};}for(var e in events){if(events[_0x3b90('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index abd2dcf..9b1474f 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(_0x16e5ab,_0x57ea34){var _0x395f01=function(_0x3eeb4f){while(--_0x3eeb4f){_0x16e5ab['push'](_0x16e5ab['shift']());}};_0x395f01(++_0x57ea34);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x24d122,_0x325655){var _0x524cd2=function(_0x3e72b5){while(--_0x3e72b5){_0x24d122['push'](_0x24d122['shift']());}};_0x524cd2(++_0x325655);}(_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 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 0a44004..fc633aa 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 _0x55f1=['socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost'];(function(_0x325f18,_0x3b96b0){var _0x3cd7e0=function(_0x1b82a1){while(--_0x1b82a1){_0x325f18['push'](_0x325f18['shift']());}};_0x3cd7e0(++_0x3b96b0);}(_0x55f1,0x9b));var _0x155f=function(_0x1c52ec,_0x117c33){_0x1c52ec=_0x1c52ec-0x0;var _0x27fc46=_0x55f1[_0x1c52ec];return _0x27fc46;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});config[_0x155f('0xa')]=_[_0x155f('0xb')](config[_0x155f('0xa')],{'host':_0x155f('0xc'),'port':0x18eb});var socket=require(_0x155f('0xd'))(new Redis(config[_0x155f('0xa')]));require(_0x155f('0xe'))[_0x155f('0xf')](socket);function respondWithRpcPromise(_0x281c5a,_0x11c946,_0x39d85a){return new BPromise(function(_0x5b9e3b,_0x9fb9a){return client[_0x155f('0x10')](_0x281c5a,_0x39d85a)[_0x155f('0x11')](function(_0x3575d8){logger['info'](_0x155f('0x12'),_0x11c946,_0x155f('0x13'));logger[_0x155f('0x14')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x11c946,'request\x20sent',JSON[_0x155f('0x15')](_0x3575d8));if(_0x3575d8[_0x155f('0x16')]){if(_0x3575d8[_0x155f('0x16')][_0x155f('0x17')]===0x1f4){logger[_0x155f('0x16')](_0x155f('0x12'),_0x11c946,_0x3575d8[_0x155f('0x16')]['message']);return _0x9fb9a(_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);}logger['error'](_0x155f('0x12'),_0x11c946,_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);return _0x5b9e3b(_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);}else{logger[_0x155f('0x19')](_0x155f('0x12'),_0x11c946,_0x155f('0x13'));_0x5b9e3b(_0x3575d8[_0x155f('0x1a')][_0x155f('0x18')]);}})[_0x155f('0x1b')](function(_0x3bdede){logger[_0x155f('0x16')](_0x155f('0x12'),_0x11c946,_0x3bdede);_0x9fb9a(_0x3bdede);});});} \ No newline at end of file +var _0x6b20=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3a6c17,_0x276e1b){var _0x40c411=function(_0x3f1717){while(--_0x3f1717){_0x3a6c17['push'](_0x3a6c17['shift']());}};_0x40c411(++_0x276e1b);}(_0x6b20,0xd1));var _0x06b2=function(_0x235f1e,_0x27719c){_0x235f1e=_0x235f1e-0x0;var _0x12e98c=_0x6b20[_0x235f1e];return _0x12e98c;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});config[_0x06b2('0xb')]=_[_0x06b2('0xc')](config['redis'],{'host':_0x06b2('0xd'),'port':0x18eb});var socket=require(_0x06b2('0xe'))(new Redis(config[_0x06b2('0xb')]));require('./openchannelAccount.socket')[_0x06b2('0xf')](socket);function respondWithRpcPromise(_0x57f854,_0x2cc28f,_0x4da705){return new BPromise(function(_0x552cd8,_0x301519){return client[_0x06b2('0x10')](_0x57f854,_0x4da705)['then'](function(_0x182f8f){logger[_0x06b2('0x11')](_0x06b2('0x12'),_0x2cc28f,_0x06b2('0x13'));logger[_0x06b2('0x14')](_0x06b2('0x15'),_0x2cc28f,_0x06b2('0x13'),JSON[_0x06b2('0x16')](_0x182f8f));if(_0x182f8f[_0x06b2('0x17')]){if(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x18')]===0x1f4){logger[_0x06b2('0x17')](_0x06b2('0x12'),_0x2cc28f,_0x182f8f['error'][_0x06b2('0x19')]);return _0x301519(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x19')]);}logger[_0x06b2('0x17')](_0x06b2('0x12'),_0x2cc28f,_0x182f8f[_0x06b2('0x17')]['message']);return _0x552cd8(_0x182f8f[_0x06b2('0x17')][_0x06b2('0x19')]);}else{logger['info'](_0x06b2('0x12'),_0x2cc28f,'request\x20sent');_0x552cd8(_0x182f8f['result'][_0x06b2('0x19')]);}})[_0x06b2('0x1a')](function(_0x27852e){logger[_0x06b2('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2cc28f,_0x27852e);_0x301519(_0x27852e);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c134edb..03e5ec6 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 _0xd404=['save','update','emit','removeListener','register','./openchannelAccount.events'];(function(_0x3a57d3,_0x34c013){var _0x4a9334=function(_0x327655){while(--_0x327655){_0x3a57d3['push'](_0x3a57d3['shift']());}};_0x4a9334(++_0x34c013);}(_0xd404,0x15b));var _0x4d40=function(_0x107b16,_0x21c460){_0x107b16=_0x107b16-0x0;var _0x56d2e5=_0xd404[_0x107b16];return _0x56d2e5;};'use strict';var OpenchannelAccountEvents=require(_0x4d40('0x0'));var events=[_0x4d40('0x1'),'remove',_0x4d40('0x2')];function createListener(_0x2322e5,_0x502a67){return function(_0x3e9bbc){_0x502a67[_0x4d40('0x3')](_0x2322e5,_0x3e9bbc);};}function removeListener(_0xba821,_0x8bde12){return function(){OpenchannelAccountEvents[_0x4d40('0x4')](_0xba821,_0x8bde12);};}exports[_0x4d40('0x5')]=function(_0xc2a9db){for(var _0x24a237=0x0,_0x2e4bd8=events['length'];_0x24a237<_0x2e4bd8;_0x24a237++){var _0x292180=events[_0x24a237];var _0x116941=createListener('openchannelAccount:'+_0x292180,_0xc2a9db);OpenchannelAccountEvents['on'](_0x292180,_0x116941);}}; \ No newline at end of file +var _0x3ef0=['length','openchannelAccount:','./openchannelAccount.events','remove','emit','register'];(function(_0x506cbe,_0x818678){var _0x4fdaa7=function(_0x28db18){while(--_0x28db18){_0x506cbe['push'](_0x506cbe['shift']());}};_0x4fdaa7(++_0x818678);}(_0x3ef0,0x19a));var _0x03ef=function(_0x2bcfc8,_0x41618c){_0x2bcfc8=_0x2bcfc8-0x0;var _0x23308d=_0x3ef0[_0x2bcfc8];return _0x23308d;};'use strict';var OpenchannelAccountEvents=require(_0x03ef('0x0'));var events=['save',_0x03ef('0x1'),'update'];function createListener(_0x3ee9a3,_0x5367d2){return function(_0x2aa000){_0x5367d2[_0x03ef('0x2')](_0x3ee9a3,_0x2aa000);};}function removeListener(_0x321d93,_0x5298e7){return function(){OpenchannelAccountEvents['removeListener'](_0x321d93,_0x5298e7);};}exports[_0x03ef('0x3')]=function(_0xadf812){for(var _0x1ea0f9=0x0,_0x47e561=events[_0x03ef('0x4')];_0x1ea0f9<_0x47e561;_0x1ea0f9++){var _0x3c06ee=events[_0x1ea0f9];var _0x2d54e7=createListener(_0x03ef('0x5')+_0x3c06ee,_0xadf812);OpenchannelAccountEvents['on'](_0x3c06ee,_0x2d54e7);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index a8276db..8e98e8b 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 _0xd3a9=['isAuthenticated','post','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xd3a9,0x86));var _0x9d3a=function(_0x387d73,_0x26df45){_0x387d73=_0x387d73-0x0;var _0x3939a9=_0xd3a9[_0x387d73];return _0x3939a9;};'use strict';var multer=require(_0x9d3a('0x0'));var util=require(_0x9d3a('0x1'));var path=require(_0x9d3a('0x2'));var timeout=require(_0x9d3a('0x3'));var express=require(_0x9d3a('0x4'));var router=express['Router']();var fs_extra=require(_0x9d3a('0x5'));var auth=require(_0x9d3a('0x6'));var interaction=require(_0x9d3a('0x7'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x9d3a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9d3a('0x8')](_0x9d3a('0x9'),auth[_0x9d3a('0xa')](),controller['show']);router[_0x9d3a('0xb')]('/',auth[_0x9d3a('0xa')](),controller['create']);router[_0x9d3a('0xc')]('/:id',auth[_0x9d3a('0xa')](),controller[_0x9d3a('0xd')]);router[_0x9d3a('0xe')](_0x9d3a('0x9'),auth[_0x9d3a('0xa')](),controller['destroy']);module[_0x9d3a('0xf')]=router; \ No newline at end of file +var _0xc0a7=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x77b607,_0x18e6c8){var _0x136258=function(_0x469396){while(--_0x469396){_0x77b607['push'](_0x77b607['shift']());}};_0x136258(++_0x18e6c8);}(_0xc0a7,0x1b3));var _0x7c0a=function(_0x9e31aa,_0x2bf0d3){_0x9e31aa=_0x9e31aa-0x0;var _0x356c46=_0xc0a7[_0x9e31aa];return _0x356c46;};'use strict';var multer=require(_0x7c0a('0x0'));var util=require('util');var path=require(_0x7c0a('0x1'));var timeout=require(_0x7c0a('0x2'));var express=require(_0x7c0a('0x3'));var router=express[_0x7c0a('0x4')]();var fs_extra=require(_0x7c0a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7c0a('0x6'));var config=require(_0x7c0a('0x7'));var controller=require(_0x7c0a('0x8'));router[_0x7c0a('0x9')]('/',auth[_0x7c0a('0xa')](),controller[_0x7c0a('0xb')]);router['get'](_0x7c0a('0xc'),auth[_0x7c0a('0xa')](),controller[_0x7c0a('0xd')]);router[_0x7c0a('0xe')]('/',auth['isAuthenticated'](),controller[_0x7c0a('0xf')]);router[_0x7c0a('0x10')](_0x7c0a('0xc'),auth[_0x7c0a('0xa')](),controller[_0x7c0a('0x11')]);router[_0x7c0a('0x12')](_0x7c0a('0xc'),auth[_0x7c0a('0xa')](),controller['destroy']);module[_0x7c0a('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 685287d..059258e 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 _0xc2ac=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x3e024e,_0xdbd816){var _0x1c749e=function(_0x52c16c){while(--_0x52c16c){_0x3e024e['push'](_0x3e024e['shift']());}};_0x1c749e(++_0xdbd816);}(_0xc2ac,0x8b));var _0xcc2a=function(_0x1f5e33,_0x10f720){_0x1f5e33=_0x1f5e33-0x0;var _0x28aadf=_0xc2ac[_0x1f5e33];return _0x28aadf;};'use strict';var Sequelize=require(_0xcc2a('0x0'));module[_0xcc2a('0x1')]={'priority':{'type':Sequelize[_0xcc2a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcc2a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcc2a('0x4')]()},'description':{'type':Sequelize[_0xcc2a('0x3')]},'interval':{'type':Sequelize[_0xcc2a('0x3')],'defaultValue':_0xcc2a('0x5')}}; \ No newline at end of file +var _0x0ada=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x53e4a0,_0x205bce){var _0x3d19e0=function(_0x303b8c){while(--_0x303b8c){_0x53e4a0['push'](_0x53e4a0['shift']());}};_0x3d19e0(++_0x205bce);}(_0x0ada,0x10f));var _0xa0ad=function(_0x6dce5e,_0x1fcf30){_0x6dce5e=_0x6dce5e-0x0;var _0x380732=_0x0ada[_0x6dce5e];return _0x380732;};'use strict';var Sequelize=require(_0xa0ad('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa0ad('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa0ad('0x2')],'allowNull':![],'defaultValue':_0xa0ad('0x3')},'appdata':{'type':Sequelize[_0xa0ad('0x4')]()},'description':{'type':Sequelize[_0xa0ad('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa0ad('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index befd116..acd8453 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 _0xdeee=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','map','OpenchannelApplication','rawAttributes','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','findAll','show','params','keys','intersection','include','catch','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x111c6c,_0x5ac573){var _0x2e983a=function(_0x2c0d8f){while(--_0x2c0d8f){_0x111c6c['push'](_0x111c6c['shift']());}};_0x2e983a(++_0x5ac573);}(_0xdeee,0xc3));var _0xedee=function(_0x375cee,_0x3def06){_0x375cee=_0x375cee-0x0;var _0x525a6f=_0xdeee[_0x375cee];return _0x525a6f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xedee('0x0'));var jsonpatch=require(_0xedee('0x1'));var rp=require(_0xedee('0x2'));var moment=require(_0xedee('0x3'));var BPromise=require(_0xedee('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xedee('0x5'));var sox=require(_0xedee('0x6'));var csv=require(_0xedee('0x7'));var ejs=require(_0xedee('0x8'));var fs=require('fs');var fs_extra=require(_0xedee('0x9'));var _=require(_0xedee('0xa'));var squel=require(_0xedee('0xb'));var crypto=require(_0xedee('0xc'));var jsforce=require(_0xedee('0xd'));var deskjs=require(_0xedee('0xe'));var toCsv=require(_0xedee('0x7'));var querystring=require(_0xedee('0xf'));var Papa=require(_0xedee('0x10'));var Redis=require('ioredis');var authService=require(_0xedee('0x11'));var qs=require(_0xedee('0x12'));var as=require(_0xedee('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xedee('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xedee('0x15'));var db=require(_0xedee('0x16'))['db'];function respondWithStatusCode(_0x2f6c37,_0x142b1){_0x142b1=_0x142b1||0xcc;return function(_0x464f3d){if(_0x464f3d){return _0x2f6c37[_0xedee('0x17')](_0x142b1);}return _0x2f6c37[_0xedee('0x18')](_0x142b1)[_0xedee('0x19')]();};}function respondWithResult(_0x4e5441,_0x506fbf){_0x506fbf=_0x506fbf||0xc8;return function(_0x237892){if(_0x237892){return _0x4e5441[_0xedee('0x18')](_0x506fbf)[_0xedee('0x1a')](_0x237892);}};}function respondWithFilteredResult(_0x1b4a0e,_0x47bcd9){return function(_0xfe3a14){if(_0xfe3a14){var _0x2c3230=typeof _0x47bcd9[_0xedee('0x1b')]===_0xedee('0x1c')&&typeof _0x47bcd9[_0xedee('0x1d')]===_0xedee('0x1c');var _0x220f5a=_0xfe3a14[_0xedee('0x1e')];var _0x1a6969=_0x2c3230?0x0:_0x47bcd9[_0xedee('0x1b')];var _0x63c1f7=_0x2c3230?_0xfe3a14[_0xedee('0x1e')]:_0x47bcd9[_0xedee('0x1b')]+_0x47bcd9[_0xedee('0x1d')];var _0x3f6d35;if(_0x63c1f7>=_0x220f5a){_0x63c1f7=_0x220f5a;_0x3f6d35=0xc8;}else{_0x3f6d35=0xce;}_0x1b4a0e['status'](_0x3f6d35);return _0x1b4a0e['set'](_0xedee('0x1f'),_0x1a6969+'-'+_0x63c1f7+'/'+_0x220f5a)['json'](_0xfe3a14);}return null;};}function patchUpdates(_0x214eda){return function(_0x27b790){try{jsonpatch['apply'](_0x27b790,_0x214eda,!![]);}catch(_0x3236a1){return BPromise[_0xedee('0x20')](_0x3236a1);}return _0x27b790[_0xedee('0x21')]();};}function saveUpdates(_0x2cc1a3,_0x472762){return function(_0x195024){if(_0x195024){return _0x195024[_0xedee('0x22')](_0x2cc1a3)[_0xedee('0x23')](function(_0x395885){return _0x395885;});}return null;};}function removeEntity(_0x42b0ec,_0x3bd1cf){return function(_0x18aa04){if(_0x18aa04){return _0x18aa04['destroy']()[_0xedee('0x23')](function(){_0x42b0ec[_0xedee('0x18')](0xcc)[_0xedee('0x19')]();});}};}function handleEntityNotFound(_0x7a89cf,_0x3f4a80){return function(_0x3a38d3){if(!_0x3a38d3){_0x7a89cf[_0xedee('0x17')](0x194);}return _0x3a38d3;};}function handleError(_0x115556,_0x11bff1){_0x11bff1=_0x11bff1||0x1f4;return function(_0x1a88ed){logger[_0xedee('0x24')](_0x1a88ed[_0xedee('0x25')]);if(_0x1a88ed[_0xedee('0x26')]){delete _0x1a88ed[_0xedee('0x26')];}_0x115556['status'](_0x11bff1)[_0xedee('0x27')](_0x1a88ed);};}exports['index']=function(_0x8e0e34,_0x3d8de6){var _0x5bfb2a={},_0x3fcab3={},_0x3768cb={'count':0x0,'rows':[]};var _0x54407f=_[_0xedee('0x28')](db[_0xedee('0x29')][_0xedee('0x2a')],function(_0x766037){return{'name':_0x766037['fieldName'],'type':_0x766037['type'][_0xedee('0x2b')]};});_0x3fcab3[_0xedee('0x2c')]=_[_0xedee('0x28')](_0x54407f,_0xedee('0x26'));_0x3fcab3[_0xedee('0x2d')]=_['keys'](_0x8e0e34[_0xedee('0x2d')]);_0x3fcab3[_0xedee('0x2e')]=_['intersection'](_0x3fcab3['model'],_0x3fcab3[_0xedee('0x2d')]);_0x5bfb2a['attributes']=_['intersection'](_0x3fcab3[_0xedee('0x2c')],qs[_0xedee('0x2f')](_0x8e0e34['query'][_0xedee('0x2f')]));_0x5bfb2a[_0xedee('0x30')]=_0x5bfb2a[_0xedee('0x30')][_0xedee('0x31')]?_0x5bfb2a[_0xedee('0x30')]:_0x3fcab3[_0xedee('0x2c')];if(!_0x8e0e34['query'][_0xedee('0x32')](_0xedee('0x33'))){_0x5bfb2a[_0xedee('0x1d')]=qs[_0xedee('0x1d')](_0x8e0e34[_0xedee('0x2d')][_0xedee('0x1d')]);_0x5bfb2a['offset']=qs['offset'](_0x8e0e34[_0xedee('0x2d')][_0xedee('0x1b')]);}_0x5bfb2a['order']=qs[_0xedee('0x34')](_0x8e0e34['query'][_0xedee('0x34')]);_0x5bfb2a[_0xedee('0x35')]=qs[_0xedee('0x2e')](_[_0xedee('0x36')](_0x8e0e34[_0xedee('0x2d')],_0x3fcab3[_0xedee('0x2e')]),_0x54407f);if(_0x8e0e34[_0xedee('0x2d')][_0xedee('0x37')]){_0x5bfb2a['where']=_[_0xedee('0x38')](_0x5bfb2a[_0xedee('0x35')],{'$or':_[_0xedee('0x28')](_0x54407f,function(_0x3e0135){if(_0x3e0135[_0xedee('0x39')]!=='VIRTUAL'){var _0x156f82={};_0x156f82[_0x3e0135[_0xedee('0x26')]]={'$like':'%'+_0x8e0e34[_0xedee('0x2d')]['filter']+'%'};return _0x156f82;}})});}_0x5bfb2a=_[_0xedee('0x38')]({},_0x5bfb2a,_0x8e0e34[_0xedee('0x3a')]);var _0x43c473={'where':_0x5bfb2a[_0xedee('0x35')]};return db[_0xedee('0x29')]['count'](_0x43c473)['then'](function(_0x4956b7){_0x3768cb[_0xedee('0x1e')]=_0x4956b7;if(_0x8e0e34[_0xedee('0x2d')][_0xedee('0x3b')]){_0x5bfb2a['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xedee('0x3c')](_0x5bfb2a);})['then'](function(_0x5c2bea){_0x3768cb['rows']=_0x5c2bea;return _0x3768cb;})[_0xedee('0x23')](respondWithFilteredResult(_0x3d8de6,_0x5bfb2a))['catch'](handleError(_0x3d8de6,null));};exports[_0xedee('0x3d')]=function(_0x2afcdd,_0x582499){var _0x53cab0={'raw':!![],'where':{'id':_0x2afcdd[_0xedee('0x3e')]['id']}},_0xee8115={};_0xee8115[_0xedee('0x2c')]=_['keys'](db[_0xedee('0x29')]['rawAttributes']);_0xee8115[_0xedee('0x2d')]=_[_0xedee('0x3f')](_0x2afcdd[_0xedee('0x2d')]);_0xee8115['filters']=_[_0xedee('0x40')](_0xee8115[_0xedee('0x2c')],_0xee8115['query']);_0x53cab0[_0xedee('0x30')]=_[_0xedee('0x40')](_0xee8115['model'],qs[_0xedee('0x2f')](_0x2afcdd['query'][_0xedee('0x2f')]));_0x53cab0['attributes']=_0x53cab0[_0xedee('0x30')][_0xedee('0x31')]?_0x53cab0[_0xedee('0x30')]:_0xee8115[_0xedee('0x2c')];if(_0x2afcdd[_0xedee('0x2d')]['includeAll']){_0x53cab0[_0xedee('0x41')]=[{'all':!![]}];}_0x53cab0=_[_0xedee('0x38')]({},_0x53cab0,_0x2afcdd['options']);return db[_0xedee('0x29')]['find'](_0x53cab0)[_0xedee('0x23')](handleEntityNotFound(_0x582499,null))['then'](respondWithResult(_0x582499,null))[_0xedee('0x42')](handleError(_0x582499,null));};exports[_0xedee('0x43')]=function(_0x30df5f,_0x289cac){return db[_0xedee('0x29')][_0xedee('0x43')](_0x30df5f[_0xedee('0x44')],{})[_0xedee('0x23')](respondWithResult(_0x289cac,0xc9))[_0xedee('0x42')](handleError(_0x289cac,null));};exports['update']=function(_0x19cf60,_0x386a93){if(_0x19cf60[_0xedee('0x44')]['id']){delete _0x19cf60[_0xedee('0x44')]['id'];}return db[_0xedee('0x29')]['find']({'where':{'id':_0x19cf60[_0xedee('0x3e')]['id']}})[_0xedee('0x23')](handleEntityNotFound(_0x386a93,null))['then'](saveUpdates(_0x19cf60[_0xedee('0x44')],null))[_0xedee('0x23')](respondWithResult(_0x386a93,null))['catch'](handleError(_0x386a93,null));};exports[_0xedee('0x45')]=function(_0x173993,_0x201559){return db['OpenchannelApplication']['find']({'where':{'id':_0x173993['params']['id']}})['then'](handleEntityNotFound(_0x201559,null))['then'](removeEntity(_0x201559,null))[_0xedee('0x42')](handleError(_0x201559,null));}; \ No newline at end of file +var _0x010f=['reject','save','then','destroy','end','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','merge','VIRTUAL','where','includeAll','findAll','rows','catch','params','include','options','find','create','body','eml-format','rimraf','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply'];(function(_0x3c1176,_0x4e1850){var _0x52467f=function(_0x10dd03){while(--_0x10dd03){_0x3c1176['push'](_0x3c1176['shift']());}};_0x52467f(++_0x4e1850);}(_0x010f,0x14d));var _0xf010=function(_0x4ee872,_0x506594){_0x4ee872=_0x4ee872-0x0;var _0x51a0ad=_0x010f[_0x4ee872];return _0x51a0ad;};'use strict';var emlformat=require(_0xf010('0x0'));var rimraf=require(_0xf010('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf010('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf010('0x3'));var util=require(_0xf010('0x4'));var path=require(_0xf010('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf010('0x6'));var fs=require('fs');var fs_extra=require(_0xf010('0x7'));var _=require(_0xf010('0x8'));var squel=require(_0xf010('0x9'));var crypto=require('crypto');var jsforce=require(_0xf010('0xa'));var deskjs=require(_0xf010('0xb'));var toCsv=require(_0xf010('0xc'));var querystring=require('querystring');var Papa=require(_0xf010('0xd'));var Redis=require(_0xf010('0xe'));var authService=require(_0xf010('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf010('0x10'));var hardwareService=require(_0xf010('0x11'));var logger=require('../../config/logger')(_0xf010('0x12'));var utils=require(_0xf010('0x13'));var config=require(_0xf010('0x14'));var licenseUtil=require(_0xf010('0x15'));var db=require(_0xf010('0x16'))['db'];function respondWithStatusCode(_0x432a48,_0x875c93){_0x875c93=_0x875c93||0xcc;return function(_0x1ffc55){if(_0x1ffc55){return _0x432a48[_0xf010('0x17')](_0x875c93);}return _0x432a48[_0xf010('0x18')](_0x875c93)['end']();};}function respondWithResult(_0x2bfc28,_0x680fda){_0x680fda=_0x680fda||0xc8;return function(_0x75c548){if(_0x75c548){return _0x2bfc28[_0xf010('0x18')](_0x680fda)[_0xf010('0x19')](_0x75c548);}};}function respondWithFilteredResult(_0x552c1d,_0x3104e7){return function(_0x2d0e13){if(_0x2d0e13){var _0x33f23b=typeof _0x3104e7[_0xf010('0x1a')]==='undefined'&&typeof _0x3104e7[_0xf010('0x1b')]===_0xf010('0x1c');var _0x300219=_0x2d0e13[_0xf010('0x1d')];var _0x489433=_0x33f23b?0x0:_0x3104e7[_0xf010('0x1a')];var _0x78e53b=_0x33f23b?_0x2d0e13[_0xf010('0x1d')]:_0x3104e7[_0xf010('0x1a')]+_0x3104e7[_0xf010('0x1b')];var _0x55334d;if(_0x78e53b>=_0x300219){_0x78e53b=_0x300219;_0x55334d=0xc8;}else{_0x55334d=0xce;}_0x552c1d['status'](_0x55334d);return _0x552c1d['set'](_0xf010('0x1e'),_0x489433+'-'+_0x78e53b+'/'+_0x300219)[_0xf010('0x19')](_0x2d0e13);}return null;};}function patchUpdates(_0xac8856){return function(_0x5247f1){try{jsonpatch[_0xf010('0x1f')](_0x5247f1,_0xac8856,!![]);}catch(_0x3cdf14){return BPromise[_0xf010('0x20')](_0x3cdf14);}return _0x5247f1[_0xf010('0x21')]();};}function saveUpdates(_0x158c6d,_0xc6ee90){return function(_0x2580e0){if(_0x2580e0){return _0x2580e0['update'](_0x158c6d)[_0xf010('0x22')](function(_0x2bf4e1){return _0x2bf4e1;});}return null;};}function removeEntity(_0x312e90,_0x348b17){return function(_0x1d6c16){if(_0x1d6c16){return _0x1d6c16[_0xf010('0x23')]()[_0xf010('0x22')](function(){_0x312e90[_0xf010('0x18')](0xcc)[_0xf010('0x24')]();});}};}function handleEntityNotFound(_0x33053,_0x2a704f){return function(_0x1b19d2){if(!_0x1b19d2){_0x33053['sendStatus'](0x194);}return _0x1b19d2;};}function handleError(_0x1f8531,_0x588d6f){_0x588d6f=_0x588d6f||0x1f4;return function(_0x27541f){logger[_0xf010('0x25')](_0x27541f[_0xf010('0x26')]);if(_0x27541f[_0xf010('0x27')]){delete _0x27541f[_0xf010('0x27')];}_0x1f8531[_0xf010('0x18')](_0x588d6f)[_0xf010('0x28')](_0x27541f);};}exports[_0xf010('0x29')]=function(_0x2dc53a,_0x36a7f6){var _0x3a6cc9={},_0x52cb85={},_0x527782={'count':0x0,'rows':[]};var _0x283b98=_[_0xf010('0x2a')](db[_0xf010('0x2b')][_0xf010('0x2c')],function(_0x2714de){return{'name':_0x2714de['fieldName'],'type':_0x2714de[_0xf010('0x2d')][_0xf010('0x2e')]};});_0x52cb85['model']=_['map'](_0x283b98,_0xf010('0x27'));_0x52cb85[_0xf010('0x2f')]=_[_0xf010('0x30')](_0x2dc53a[_0xf010('0x2f')]);_0x52cb85['filters']=_[_0xf010('0x31')](_0x52cb85[_0xf010('0x32')],_0x52cb85[_0xf010('0x2f')]);_0x3a6cc9[_0xf010('0x33')]=_[_0xf010('0x31')](_0x52cb85[_0xf010('0x32')],qs['fields'](_0x2dc53a[_0xf010('0x2f')][_0xf010('0x34')]));_0x3a6cc9[_0xf010('0x33')]=_0x3a6cc9['attributes'][_0xf010('0x35')]?_0x3a6cc9[_0xf010('0x33')]:_0x52cb85[_0xf010('0x32')];if(!_0x2dc53a[_0xf010('0x2f')][_0xf010('0x36')](_0xf010('0x37'))){_0x3a6cc9['limit']=qs[_0xf010('0x1b')](_0x2dc53a['query'][_0xf010('0x1b')]);_0x3a6cc9[_0xf010('0x1a')]=qs['offset'](_0x2dc53a[_0xf010('0x2f')][_0xf010('0x1a')]);}_0x3a6cc9[_0xf010('0x38')]=qs['sort'](_0x2dc53a[_0xf010('0x2f')]['sort']);_0x3a6cc9['where']=qs[_0xf010('0x39')](_[_0xf010('0x3a')](_0x2dc53a[_0xf010('0x2f')],_0x52cb85['filters']),_0x283b98);if(_0x2dc53a[_0xf010('0x2f')][_0xf010('0x3b')]){_0x3a6cc9['where']=_[_0xf010('0x3c')](_0x3a6cc9['where'],{'$or':_[_0xf010('0x2a')](_0x283b98,function(_0x2e51af){if(_0x2e51af[_0xf010('0x2d')]!==_0xf010('0x3d')){var _0xbd1615={};_0xbd1615[_0x2e51af['name']]={'$like':'%'+_0x2dc53a[_0xf010('0x2f')][_0xf010('0x3b')]+'%'};return _0xbd1615;}})});}_0x3a6cc9=_[_0xf010('0x3c')]({},_0x3a6cc9,_0x2dc53a['options']);var _0x27c74f={'where':_0x3a6cc9[_0xf010('0x3e')]};return db[_0xf010('0x2b')][_0xf010('0x1d')](_0x27c74f)['then'](function(_0x2fc1b1){_0x527782['count']=_0x2fc1b1;if(_0x2dc53a[_0xf010('0x2f')][_0xf010('0x3f')]){_0x3a6cc9['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xf010('0x40')](_0x3a6cc9);})[_0xf010('0x22')](function(_0x4d01b7){_0x527782[_0xf010('0x41')]=_0x4d01b7;return _0x527782;})[_0xf010('0x22')](respondWithFilteredResult(_0x36a7f6,_0x3a6cc9))[_0xf010('0x42')](handleError(_0x36a7f6,null));};exports['show']=function(_0x42512d,_0x228b43){var _0xd663af={'raw':!![],'where':{'id':_0x42512d[_0xf010('0x43')]['id']}},_0x868f13={};_0x868f13[_0xf010('0x32')]=_['keys'](db['OpenchannelApplication'][_0xf010('0x2c')]);_0x868f13['query']=_[_0xf010('0x30')](_0x42512d['query']);_0x868f13[_0xf010('0x39')]=_[_0xf010('0x31')](_0x868f13[_0xf010('0x32')],_0x868f13[_0xf010('0x2f')]);_0xd663af[_0xf010('0x33')]=_[_0xf010('0x31')](_0x868f13['model'],qs[_0xf010('0x34')](_0x42512d[_0xf010('0x2f')][_0xf010('0x34')]));_0xd663af[_0xf010('0x33')]=_0xd663af[_0xf010('0x33')][_0xf010('0x35')]?_0xd663af[_0xf010('0x33')]:_0x868f13[_0xf010('0x32')];if(_0x42512d[_0xf010('0x2f')][_0xf010('0x3f')]){_0xd663af[_0xf010('0x44')]=[{'all':!![]}];}_0xd663af=_[_0xf010('0x3c')]({},_0xd663af,_0x42512d[_0xf010('0x45')]);return db['OpenchannelApplication'][_0xf010('0x46')](_0xd663af)[_0xf010('0x22')](handleEntityNotFound(_0x228b43,null))['then'](respondWithResult(_0x228b43,null))[_0xf010('0x42')](handleError(_0x228b43,null));};exports[_0xf010('0x47')]=function(_0x919a29,_0x278f20){return db[_0xf010('0x2b')][_0xf010('0x47')](_0x919a29[_0xf010('0x48')],{})[_0xf010('0x22')](respondWithResult(_0x278f20,0xc9))[_0xf010('0x42')](handleError(_0x278f20,null));};exports['update']=function(_0x6b9aab,_0x1d38b7){if(_0x6b9aab[_0xf010('0x48')]['id']){delete _0x6b9aab[_0xf010('0x48')]['id'];}return db[_0xf010('0x2b')][_0xf010('0x46')]({'where':{'id':_0x6b9aab[_0xf010('0x43')]['id']}})[_0xf010('0x22')](handleEntityNotFound(_0x1d38b7,null))['then'](saveUpdates(_0x6b9aab[_0xf010('0x48')],null))[_0xf010('0x22')](respondWithResult(_0x1d38b7,null))[_0xf010('0x42')](handleError(_0x1d38b7,null));};exports[_0xf010('0x23')]=function(_0xcce7b6,_0x35ed11){return db['OpenchannelApplication'][_0xf010('0x46')]({'where':{'id':_0xcce7b6[_0xf010('0x43')]['id']}})[_0xf010('0x22')](handleEntityNotFound(_0x35ed11,null))['then'](removeEntity(_0x35ed11,null))[_0xf010('0x42')](handleError(_0x35ed11,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index d3b819a..229583a 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 _0x1d4a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x5fe69a,_0x5484f5){var _0x3f1aee=function(_0x54387f){while(--_0x54387f){_0x5fe69a['push'](_0x5fe69a['shift']());}};_0x3f1aee(++_0x5484f5);}(_0x1d4a,0x80));var _0xa1d4=function(_0x28c98e,_0x5f5599){_0x28c98e=_0x28c98e-0x0;var _0x2bac7f=_0x1d4a[_0x28c98e];return _0x2bac7f;};'use strict';var _=require(_0xa1d4('0x0'));var util=require('util');var logger=require(_0xa1d4('0x1'))(_0xa1d4('0x2'));var moment=require(_0xa1d4('0x3'));var BPromise=require(_0xa1d4('0x4'));var rp=require(_0xa1d4('0x5'));var fs=require('fs');var path=require(_0xa1d4('0x6'));var rimraf=require(_0xa1d4('0x7'));var config=require(_0xa1d4('0x8'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x4fd24f,_0x2b720d){return _0x4fd24f['define'](_0xa1d4('0x9'),attributes,{'tableName':_0xa1d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa1d4('0xb'),'collate':_0xa1d4('0xc')});}; \ No newline at end of file +var _0x7d8d=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','openchannel_applications','utf8mb4'];(function(_0x43e97d,_0x56a06b){var _0x424cd9=function(_0x4f574b){while(--_0x4f574b){_0x43e97d['push'](_0x43e97d['shift']());}};_0x424cd9(++_0x56a06b);}(_0x7d8d,0x18d));var _0xd7d8=function(_0x5e5cd5,_0x184819){_0x5e5cd5=_0x5e5cd5-0x0;var _0x2b266c=_0x7d8d[_0x5e5cd5];return _0x2b266c;};'use strict';var _=require(_0xd7d8('0x0'));var util=require(_0xd7d8('0x1'));var logger=require('../../config/logger')(_0xd7d8('0x2'));var moment=require('moment');var BPromise=require(_0xd7d8('0x3'));var rp=require(_0xd7d8('0x4'));var fs=require('fs');var path=require(_0xd7d8('0x5'));var rimraf=require('rimraf');var config=require(_0xd7d8('0x6'));var attributes=require(_0xd7d8('0x7'));module['exports']=function(_0x10e1ed,_0x1ae12c){return _0x10e1ed['define']('OpenchannelApplication',attributes,{'tableName':_0xd7d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd7d8('0x9'),'collate':_0xd7d8('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 64e0109..bad472b 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 _0x1991=['jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateOpenchannelApplication','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5cd7e7,_0x25daff){var _0x20d208=function(_0x99eaa1){while(--_0x99eaa1){_0x5cd7e7['push'](_0x5cd7e7['shift']());}};_0x20d208(++_0x25daff);}(_0x1991,0x140));var _0x1199=function(_0x196498,_0x223d49){_0x196498=_0x196498-0x0;var _0x41eabe=_0x1991[_0x196498];return _0x41eabe;};'use strict';var _=require(_0x1199('0x0'));var util=require(_0x1199('0x1'));var moment=require(_0x1199('0x2'));var BPromise=require(_0x1199('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1199('0x4'));var db=require(_0x1199('0x5'))['db'];var utils=require(_0x1199('0x6'));var logger=require(_0x1199('0x7'))(_0x1199('0x8'));var config=require(_0x1199('0x9'));var jayson=require(_0x1199('0xa'));var client=jayson[_0x1199('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5225b6,_0x5ec19f,_0x4c3b0c){return new BPromise(function(_0x34311f,_0x54f03b){return client[_0x1199('0xc')](_0x5225b6,_0x4c3b0c)[_0x1199('0xd')](function(_0x4ba4be){logger[_0x1199('0xe')](_0x1199('0xf'),_0x5ec19f,_0x1199('0x10'));logger[_0x1199('0x11')](_0x1199('0x12'),_0x5ec19f,_0x1199('0x10'),JSON['stringify'](_0x4ba4be));if(_0x4ba4be[_0x1199('0x13')]){if(_0x4ba4be[_0x1199('0x13')][_0x1199('0x14')]===0x1f4){logger[_0x1199('0x13')](_0x1199('0xf'),_0x5ec19f,_0x4ba4be[_0x1199('0x13')][_0x1199('0x15')]);return _0x54f03b(_0x4ba4be['error'][_0x1199('0x15')]);}logger[_0x1199('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x5ec19f,_0x4ba4be[_0x1199('0x13')][_0x1199('0x15')]);return _0x34311f(_0x4ba4be[_0x1199('0x13')]['message']);}else{logger[_0x1199('0xe')](_0x1199('0xf'),_0x5ec19f,_0x1199('0x10'));_0x34311f(_0x4ba4be['result'][_0x1199('0x15')]);}})[_0x1199('0x16')](function(_0x5ede3d){logger[_0x1199('0x13')](_0x1199('0xf'),_0x5ec19f,_0x5ede3d);_0x54f03b(_0x5ede3d);});});}exports[_0x1199('0x17')]=function(_0x37c725){var _0x35b4a4=this;return new Promise(function(_0x1e9a5b,_0x21020e){return db['OpenchannelApplication']['update'](_0x37c725['body'],{'raw':_0x37c725[_0x1199('0x18')]?_0x37c725[_0x1199('0x18')][_0x1199('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37c725[_0x1199('0x18')]?_0x37c725[_0x1199('0x18')][_0x1199('0x1a')]||null:null,'attributes':_0x37c725[_0x1199('0x18')]?_0x37c725['options'][_0x1199('0x1b')]||null:null,'limit':_0x37c725[_0x1199('0x18')]?_0x37c725[_0x1199('0x18')][_0x1199('0x1c')]||null:null})[_0x1199('0xd')](function(_0x52da44){logger[_0x1199('0xe')](_0x1199('0x17'),_0x37c725);logger[_0x1199('0x11')](_0x1199('0x17'),_0x37c725,JSON[_0x1199('0x1d')](_0x52da44));_0x1e9a5b(_0x52da44);})['catch'](function(_0x43b833){logger[_0x1199('0x13')](_0x1199('0x17'),_0x43b833[_0x1199('0x15')],_0x37c725);_0x21020e(_0x35b4a4[_0x1199('0x13')](0x1f4,_0x43b833['message']));});});}; \ No newline at end of file +var _0xb07f=['raw','attributes','limit','UpdateOpenchannelApplication','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','OpenchannelApplication','update','options'];(function(_0xb24fad,_0xd58756){var _0x173226=function(_0x33b4d6){while(--_0x33b4d6){_0xb24fad['push'](_0xb24fad['shift']());}};_0x173226(++_0xd58756);}(_0xb07f,0x90));var _0xfb07=function(_0x680be8,_0x27ad4f){_0x680be8=_0x680be8-0x0;var _0x5ef590=_0xb07f[_0x680be8];return _0x5ef590;};'use strict';var _=require(_0xfb07('0x0'));var util=require(_0xfb07('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfb07('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb07('0x3'))['db'];var utils=require(_0xfb07('0x4'));var logger=require(_0xfb07('0x5'))('rpc');var config=require(_0xfb07('0x6'));var jayson=require(_0xfb07('0x7'));var client=jayson[_0xfb07('0x8')][_0xfb07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d51ca,_0x54bfef,_0x42f218){return new BPromise(function(_0x2ed021,_0x528c2f){return client['request'](_0x2d51ca,_0x42f218)[_0xfb07('0xa')](function(_0x4f7e9b){logger[_0xfb07('0xb')](_0xfb07('0xc'),_0x54bfef,'request\x20sent');logger[_0xfb07('0xd')](_0xfb07('0xe'),_0x54bfef,'request\x20sent',JSON[_0xfb07('0xf')](_0x4f7e9b));if(_0x4f7e9b['error']){if(_0x4f7e9b['error'][_0xfb07('0x10')]===0x1f4){logger[_0xfb07('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x54bfef,_0x4f7e9b['error'][_0xfb07('0x12')]);return _0x528c2f(_0x4f7e9b[_0xfb07('0x11')]['message']);}logger['error'](_0xfb07('0xc'),_0x54bfef,_0x4f7e9b[_0xfb07('0x11')][_0xfb07('0x12')]);return _0x2ed021(_0x4f7e9b['error']['message']);}else{logger[_0xfb07('0xb')](_0xfb07('0xc'),_0x54bfef,_0xfb07('0x13'));_0x2ed021(_0x4f7e9b[_0xfb07('0x14')][_0xfb07('0x12')]);}})['catch'](function(_0x219d8c){logger['error'](_0xfb07('0xc'),_0x54bfef,_0x219d8c);_0x528c2f(_0x219d8c);});});}exports['UpdateOpenchannelApplication']=function(_0x5a7d4a){var _0x2ca908=this;return new Promise(function(_0x1f49a7,_0x130740){return db[_0xfb07('0x15')][_0xfb07('0x16')](_0x5a7d4a['body'],{'raw':_0x5a7d4a[_0xfb07('0x17')]?_0x5a7d4a[_0xfb07('0x17')][_0xfb07('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a7d4a[_0xfb07('0x17')]?_0x5a7d4a[_0xfb07('0x17')]['where']||null:null,'attributes':_0x5a7d4a[_0xfb07('0x17')]?_0x5a7d4a[_0xfb07('0x17')][_0xfb07('0x19')]||null:null,'limit':_0x5a7d4a[_0xfb07('0x17')]?_0x5a7d4a[_0xfb07('0x17')][_0xfb07('0x1a')]||null:null})[_0xfb07('0xa')](function(_0x429e9e){logger[_0xfb07('0xb')](_0xfb07('0x1b'),_0x5a7d4a);logger[_0xfb07('0xd')](_0xfb07('0x1b'),_0x5a7d4a,JSON['stringify'](_0x429e9e));_0x1f49a7(_0x429e9e);})['catch'](function(_0x1cff1a){logger[_0xfb07('0x11')]('UpdateOpenchannelApplication',_0x1cff1a['message'],_0x5a7d4a);_0x130740(_0x2ca908['error'](0x1f4,_0x1cff1a['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index ce61d54..82efe99 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 _0xdded=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','getMessages','post','/:id/messages','/:id/tags','tracked','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags'];(function(_0x2837c4,_0x39b9ff){var _0x634023=function(_0x18683a){while(--_0x18683a){_0x2837c4['push'](_0x2837c4['shift']());}};_0x634023(++_0x39b9ff);}(_0xdded,0xa8));var _0xddde=function(_0x2a207e,_0x2c34d0){_0x2a207e=_0x2a207e-0x0;var _0x3857a6=_0xdded[_0x2a207e];return _0x3857a6;};'use strict';var multer=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var path=require('path');var timeout=require(_0xddde('0x2'));var express=require(_0xddde('0x3'));var router=express[_0xddde('0x4')]();var fs_extra=require(_0xddde('0x5'));var auth=require(_0xddde('0x6'));var interaction=require(_0xddde('0x7'));var config=require(_0xddde('0x8'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0xddde('0x9')](),controller[_0xddde('0xa')]);router[_0xddde('0xb')](_0xddde('0xc'),auth[_0xddde('0x9')](),controller[_0xddde('0xd')]);router[_0xddde('0xb')](_0xddde('0xe'),auth[_0xddde('0x9')](),controller['show']);router[_0xddde('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xddde('0xf')]);router[_0xddde('0xb')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xddde('0x10')]('/',auth[_0xddde('0x9')](),controller['create']);router['post'](_0xddde('0x11'),auth[_0xddde('0x9')](),controller['addMessage']);router[_0xddde('0x10')](_0xddde('0x12'),auth[_0xddde('0x9')](),interaction[_0xddde('0x13')]('openchannel','openchannelinteraction:addtags'),controller[_0xddde('0x14')]);router[_0xddde('0x15')](_0xddde('0xe'),auth[_0xddde('0x9')](),interaction['tracked']('openchannel',_0xddde('0x16')),controller[_0xddde('0x17')]);router[_0xddde('0x18')]('/:id',auth[_0xddde('0x9')](),interaction['tracked']('openchannel',_0xddde('0x19')),controller[_0xddde('0x1a')]);router[_0xddde('0x18')](_0xddde('0x12'),auth['isAuthenticated'](),controller[_0xddde('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x5a63=['index','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','removeTags','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated'];(function(_0x284e03,_0x4455b1){var _0x46a87e=function(_0x312f6c){while(--_0x312f6c){_0x284e03['push'](_0x284e03['shift']());}};_0x46a87e(++_0x4455b1);}(_0x5a63,0xa6));var _0x35a6=function(_0x16acf5,_0x14840e){_0x16acf5=_0x16acf5-0x0;var _0x15c56a=_0x5a63[_0x16acf5];return _0x15c56a;};'use strict';var multer=require('multer');var util=require(_0x35a6('0x0'));var path=require(_0x35a6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x35a6('0x2'));var auth=require(_0x35a6('0x3'));var interaction=require(_0x35a6('0x4'));var config=require(_0x35a6('0x5'));var controller=require(_0x35a6('0x6'));router['get']('/',auth[_0x35a6('0x7')](),controller[_0x35a6('0x8')]);router[_0x35a6('0x9')](_0x35a6('0xa'),auth[_0x35a6('0x7')](),controller['describe']);router['get'](_0x35a6('0xb'),auth[_0x35a6('0x7')](),controller[_0x35a6('0xc')]);router['get'](_0x35a6('0xd'),auth[_0x35a6('0x7')](),controller[_0x35a6('0xe')]);router[_0x35a6('0x9')](_0x35a6('0xf'),auth[_0x35a6('0x7')](),controller['download']);router[_0x35a6('0x10')]('/',auth[_0x35a6('0x7')](),controller[_0x35a6('0x11')]);router[_0x35a6('0x10')](_0x35a6('0xd'),auth[_0x35a6('0x7')](),controller[_0x35a6('0x12')]);router[_0x35a6('0x10')](_0x35a6('0x13'),auth['isAuthenticated'](),interaction[_0x35a6('0x14')](_0x35a6('0x15'),_0x35a6('0x16')),controller[_0x35a6('0x17')]);router[_0x35a6('0x18')](_0x35a6('0xb'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x35a6('0x19')),controller['update']);router[_0x35a6('0x1a')](_0x35a6('0xb'),auth[_0x35a6('0x7')](),interaction['tracked']('openchannel',_0x35a6('0x1b')),controller['destroy']);router[_0x35a6('0x1a')]('/:id/tags',auth[_0x35a6('0x7')](),controller[_0x35a6('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index bf5a5f6..9284d33 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 _0xa588=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x59d438,_0x49e538){var _0x4cde6b=function(_0x7897cd){while(--_0x7897cd){_0x59d438['push'](_0x59d438['shift']());}};_0x4cde6b(++_0x49e538);}(_0xa588,0xe1));var _0x8a58=function(_0x337dd9,_0x54e3f3){_0x337dd9=_0x337dd9-0x0;var _0x20f4fc=_0xa588[_0x337dd9];return _0x20f4fc;};'use strict';var Sequelize=require('sequelize');module[_0x8a58('0x0')]={'closed':{'type':Sequelize[_0x8a58('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8a58('0x2')]},'disposition':{'type':Sequelize[_0x8a58('0x3')]},'secondDisposition':{'type':Sequelize[_0x8a58('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8a58('0x3')]},'note':{'type':Sequelize[_0x8a58('0x3')]},'read1stAt':{'type':Sequelize[_0x8a58('0x2')]},'threadId':{'type':Sequelize[_0x8a58('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x8a58('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x8a58('0x4')]('in',_0x8a58('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x8a58('0x4')]('in',_0x8a58('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8a58('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x8a58('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x1e69=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x6f5442,_0x4293be){var _0x375af3=function(_0x5119d9){while(--_0x5119d9){_0x6f5442['push'](_0x6f5442['shift']());}};_0x375af3(++_0x4293be);}(_0x1e69,0x85));var _0x91e6=function(_0x4e56a2,_0x5a241c){_0x4e56a2=_0x4e56a2-0x0;var _0x1e819c=_0x1e69[_0x4e56a2];return _0x1e819c;};'use strict';var Sequelize=require('sequelize');module[_0x91e6('0x0')]={'closed':{'type':Sequelize[_0x91e6('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x91e6('0x2')]},'disposition':{'type':Sequelize[_0x91e6('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x91e6('0x3')]},'read1stAt':{'type':Sequelize[_0x91e6('0x2')]},'threadId':{'type':Sequelize[_0x91e6('0x3')]},'externalUrl':{'type':Sequelize[_0x91e6('0x3')]},'lastMsgAt':{'type':Sequelize[_0x91e6('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x91e6('0x4')]('in',_0x91e6('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x91e6('0x4')]('in',_0x91e6('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x91e6('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x91e6('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 25feb1d..6311510 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 _0x4332=['rawAttributes','fieldName','key','getOptions','openchannel','query','user','catch','type','from','params','model','keys','OpenchannelInteraction','filters','intersection','attributes','fields','length','merge','options','find','create','body','update','describe','addMessage','omit','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','sort','where','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','ids','spread','Tag','findAll','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','fullname','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','get','mkdirSync','Openchannel','Account','Owner','N.A.','closed','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','toString','System','Contact','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','util','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','then','destroy','error','name','send','index','map'];(function(_0x2678d6,_0x4e2001){var _0x475503=function(_0x34b23d){while(--_0x34b23d){_0x2678d6['push'](_0x2678d6['shift']());}};_0x475503(++_0x4e2001);}(_0x4332,0x16a));var _0x2433=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4332[_0x17d9e3];return _0x14192d;};'use strict';var rimraf=require(_0x2433('0x0'));var zipdir=require(_0x2433('0x1'));var moment=require('moment');var util=require(_0x2433('0x2'));var path=require('path');var ejs=require(_0x2433('0x3'));var fs=require('fs');var _=require(_0x2433('0x4'));var Redis=require(_0x2433('0x5'));var interaction=require(_0x2433('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x2433('0x7'))('api');var config=require(_0x2433('0x8'));var db=require(_0x2433('0x9'))['db'];config['redis']=_[_0x2433('0xa')](config[_0x2433('0xb')],{'host':_0x2433('0xc'),'port':0x18eb});var socket=require(_0x2433('0xd'))(new Redis(config[_0x2433('0xb')]));require(_0x2433('0xe'))[_0x2433('0xf')](socket);function respondWithStatusCode(_0x5b62e5,_0x1a2f38){_0x1a2f38=_0x1a2f38||0xcc;return function(_0x150ec1){if(_0x150ec1){return _0x5b62e5[_0x2433('0x10')](_0x1a2f38);}return _0x5b62e5[_0x2433('0x11')](_0x1a2f38)[_0x2433('0x12')]();};}function respondWithResult(_0x2c010b,_0x4d4ae8){_0x4d4ae8=_0x4d4ae8||0xc8;return function(_0x12a8c1){if(_0x12a8c1){return _0x2c010b[_0x2433('0x11')](_0x4d4ae8)[_0x2433('0x13')](_0x12a8c1);}};}function respondWithFilteredResult(_0x32187d,_0x5191df){return function(_0x2cabaf){if(_0x2cabaf){var _0x15d096=typeof _0x5191df[_0x2433('0x14')]==='undefined'&&typeof _0x5191df[_0x2433('0x15')]==='undefined';var _0xb17062=_0x2cabaf['count'];var _0x1104ed=_0x15d096?0x0:_0x5191df[_0x2433('0x14')];var _0x2d9943=_0x15d096?_0x2cabaf[_0x2433('0x16')]:_0x5191df['offset']+_0x5191df[_0x2433('0x15')];var _0x524836;if(_0x2d9943>=_0xb17062){_0x2d9943=_0xb17062;_0x524836=0xc8;}else{_0x524836=0xce;}_0x32187d['status'](_0x524836);return _0x32187d[_0x2433('0x17')]('Content-Range',_0x1104ed+'-'+_0x2d9943+'/'+_0xb17062)[_0x2433('0x13')](_0x2cabaf);}return null;};}function saveUpdates(_0x26be3b){return function(_0x19227d){if(_0x19227d){return _0x19227d['update'](_0x26be3b)[_0x2433('0x18')](function(_0x5c0688){return _0x5c0688;});}return null;};}function removeEntity(_0x2d71eb){return function(_0x16b167){if(_0x16b167){return _0x16b167[_0x2433('0x19')]()[_0x2433('0x18')](function(){_0x2d71eb[_0x2433('0x11')](0xcc)[_0x2433('0x12')]();});}};}function handleEntityNotFound(_0x4a16a3){return function(_0x3d63f7){if(!_0x3d63f7){_0x4a16a3['sendStatus'](0x194);}return _0x3d63f7;};}function handleError(_0x41d519,_0x2ec3db){_0x2ec3db=_0x2ec3db||0x1f4;return function(_0x5ad216){logger[_0x2433('0x1a')](_0x5ad216['stack']);if(_0x5ad216[_0x2433('0x1b')]){delete _0x5ad216['name'];}_0x41d519[_0x2433('0x11')](_0x2ec3db)[_0x2433('0x1c')](_0x5ad216);};}exports[_0x2433('0x1d')]=function(_0x512419,_0x18eff2){var _0x25fb43={};var _0x23b013=_[_0x2433('0x1e')](db['OpenchannelInteraction'][_0x2433('0x1f')],function(_0x30be11){return{'name':_0x30be11[_0x2433('0x20')],'type':_0x30be11['type'][_0x2433('0x21')]};});_0x25fb43=qs[_0x2433('0x22')](_0x23b013,_0x512419);return interaction['findAll'](_0x2433('0x23'),_0x512419[_0x2433('0x24')],_0x512419[_0x2433('0x25')],_0x25fb43,_0x23b013)[_0x2433('0x18')](respondWithFilteredResult(_0x18eff2,_0x25fb43))[_0x2433('0x26')](handleError(_0x18eff2,null));};exports['show']=function(_0x48b058,_0x1adb18){var _0xe28a29={};if(_0x48b058['query'][_0x2433('0x27')]&&_0x48b058['query']['type']===_0x2433('0x28')){_0xe28a29[_0x2433('0x28')]=_0x48b058[_0x2433('0x29')]['id'];}else{_0xe28a29['id']=_0x48b058['params']['id'];}var _0x504b59={'raw':![],'where':_0xe28a29},_0x5eb098={};_0x5eb098[_0x2433('0x2a')]=_[_0x2433('0x2b')](db[_0x2433('0x2c')][_0x2433('0x1f')]);_0x5eb098[_0x2433('0x24')]=_[_0x2433('0x2b')](_0x48b058[_0x2433('0x24')]);_0x5eb098[_0x2433('0x2d')]=_[_0x2433('0x2e')](_0x5eb098[_0x2433('0x2a')],_0x5eb098[_0x2433('0x24')]);_0x504b59[_0x2433('0x2f')]=_['intersection'](_0x5eb098[_0x2433('0x2a')],qs[_0x2433('0x30')](_0x48b058['query'][_0x2433('0x30')]));_0x504b59[_0x2433('0x2f')]=_0x504b59['attributes'][_0x2433('0x31')]?_0x504b59[_0x2433('0x2f')]:_0x5eb098['model'];if(_0x48b058[_0x2433('0x24')]['includeAll']){_0x504b59['include']=[{'all':!![]}];}_0x504b59=_[_0x2433('0x32')]({},_0x504b59,_0x48b058[_0x2433('0x33')]);return db[_0x2433('0x2c')][_0x2433('0x34')](_0x504b59)[_0x2433('0x18')](handleEntityNotFound(_0x1adb18,null))[_0x2433('0x18')](respondWithResult(_0x1adb18,null))[_0x2433('0x26')](handleError(_0x1adb18,null));};exports[_0x2433('0x35')]=function(_0x576ebc,_0x432a1e){return db[_0x2433('0x2c')]['create'](_0x576ebc[_0x2433('0x36')],{})[_0x2433('0x18')](respondWithResult(_0x432a1e,0xc9))[_0x2433('0x26')](handleError(_0x432a1e,null));};exports[_0x2433('0x37')]=function(_0x404e2e,_0xbc6748){if(_0x404e2e['body']['id']){delete _0x404e2e[_0x2433('0x36')]['id'];}return db[_0x2433('0x2c')][_0x2433('0x34')]({'where':{'id':_0x404e2e[_0x2433('0x29')]['id']}})[_0x2433('0x18')](handleEntityNotFound(_0xbc6748,null))[_0x2433('0x18')](saveUpdates(_0x404e2e[_0x2433('0x36')],null))[_0x2433('0x18')](respondWithResult(_0xbc6748,null))[_0x2433('0x26')](handleError(_0xbc6748,null));};exports[_0x2433('0x19')]=function(_0x17dad6,_0xaa7b01){return db[_0x2433('0x2c')][_0x2433('0x34')]({'where':{'id':_0x17dad6['params']['id']}})[_0x2433('0x18')](handleEntityNotFound(_0xaa7b01,null))[_0x2433('0x18')](removeEntity(_0xaa7b01,null))[_0x2433('0x26')](handleError(_0xaa7b01,null));};exports[_0x2433('0x38')]=function(_0x29f3c4,_0x2ce425){return db[_0x2433('0x2c')]['describe']()['then'](respondWithResult(_0x2ce425,null))[_0x2433('0x26')](handleError(_0x2ce425,null));};exports[_0x2433('0x39')]=function(_0x383ce1,_0x172580){return db['OpenchannelMessage'][_0x2433('0x34')]({'where':{'id':_0x383ce1['params']['id']}})[_0x2433('0x18')](handleEntityNotFound(_0x172580,null))['then'](function(_0x2838ca){if(_0x2838ca){return _0x2838ca[_0x2433('0x39')](_0x383ce1['body']['ids'],_[_0x2433('0x3a')](_0x383ce1[_0x2433('0x36')],['ids','id'])||{});}})[_0x2433('0x18')](respondWithResult(_0x172580,null))[_0x2433('0x26')](handleError(_0x172580,null));};exports[_0x2433('0x3b')]=function(_0x35cc13,_0x13ed27){var _0x59678c={'raw':![],'where':{}};var _0x1075d7={};var _0x5da8cf={'count':0x0,'rows':[]};return db[_0x2433('0x2c')][_0x2433('0x3c')]({'where':{'id':_0x35cc13['params']['id']}})['then'](handleEntityNotFound(_0x13ed27,null))['then'](function(_0x45fb59){if(_0x45fb59){_0x1075d7[_0x2433('0x2a')]=_[_0x2433('0x2b')](db[_0x2433('0x3d')][_0x2433('0x1f')]);_0x1075d7['query']=_[_0x2433('0x2b')](_0x35cc13[_0x2433('0x24')]);_0x1075d7[_0x2433('0x2d')]=_['intersection'](_0x1075d7[_0x2433('0x2a')],_0x1075d7[_0x2433('0x24')]);_0x59678c[_0x2433('0x2f')]=_['intersection'](_0x1075d7[_0x2433('0x2a')],qs[_0x2433('0x30')](_0x35cc13[_0x2433('0x24')][_0x2433('0x30')]));_0x59678c[_0x2433('0x2f')]=_0x59678c[_0x2433('0x2f')][_0x2433('0x31')]?_0x59678c[_0x2433('0x2f')]:_0x1075d7[_0x2433('0x2a')];if(!_0x35cc13[_0x2433('0x24')][_0x2433('0x3e')](_0x2433('0x3f'))){_0x59678c[_0x2433('0x15')]=qs[_0x2433('0x15')](_0x35cc13[_0x2433('0x24')][_0x2433('0x15')]);_0x59678c[_0x2433('0x14')]=qs[_0x2433('0x14')](_0x35cc13['query'][_0x2433('0x14')]);}_0x59678c['order']=qs[_0x2433('0x40')](_0x35cc13['query'][_0x2433('0x40')]);_0x59678c['where']=qs[_0x2433('0x2d')](_['pick'](_0x35cc13[_0x2433('0x24')],_0x1075d7[_0x2433('0x2d')]));_0x59678c[_0x2433('0x41')][_0x2433('0x42')]=_0x45fb59['id'];if(_0x35cc13[_0x2433('0x24')][_0x2433('0x43')]){_0x59678c[_0x2433('0x41')]=_[_0x2433('0x32')](_0x59678c[_0x2433('0x41')],{'$or':_[_0x2433('0x1e')](_0x59678c[_0x2433('0x2f')],function(_0x5c0b1c){var _0x4620d3={};_0x4620d3[_0x5c0b1c]={'$like':'%'+_0x35cc13['query'][_0x2433('0x43')]+'%'};return _0x4620d3;})});}if(_0x35cc13[_0x2433('0x24')][_0x2433('0x44')]){var _0x506eef=_0x35cc13['query'][_0x2433('0x44')][_0x2433('0x45')](',');var _0x2ee6ed={};_0x2ee6ed[_0x506eef[0x0]]={'$gte':moment(_0x506eef[0x1])[_0x2433('0x46')](_0x2433('0x47'))};_0x59678c[_0x2433('0x41')]=_[_0x2433('0x32')](_0x59678c[_0x2433('0x41')],_0x2ee6ed);}_0x59678c=_['merge']({},_0x59678c,_0x35cc13[_0x2433('0x33')]);return db[_0x2433('0x3d')]['count']({'where':_0x59678c[_0x2433('0x41')]})['then'](function(_0x48163f){_0x5da8cf[_0x2433('0x16')]=_0x48163f;if(_0x35cc13[_0x2433('0x24')]['includeAll']){_0x59678c[_0x2433('0x48')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x59678c);})[_0x2433('0x18')](function(_0xf64b2c){_0x5da8cf[_0x2433('0x49')]=_0xf64b2c;return _0x5da8cf;});}})[_0x2433('0x18')](respondWithFilteredResult(_0x13ed27,_0x59678c))[_0x2433('0x26')](handleError(_0x13ed27,null));};exports[_0x2433('0x4a')]=function(_0x2a7b72,_0x498f9b){return db[_0x2433('0x2c')]['find']({'where':{'id':_0x2a7b72['params']['id']}})[_0x2433('0x18')](handleEntityNotFound(_0x498f9b,null))['then'](function(_0x25e176){if(_0x25e176){return _0x25e176['setTags'](_0x2a7b72[_0x2433('0x36')][_0x2433('0x4b')],_['omit'](_0x2a7b72[_0x2433('0x36')],[_0x2433('0x4b'),'id'])||{})[_0x2433('0x4c')](function(){return db[_0x2433('0x4d')][_0x2433('0x4e')]({'attributes':['id',_0x2433('0x1b'),_0x2433('0x4f')],'where':{'id':_0x2a7b72[_0x2433('0x36')][_0x2433('0x4b')]}});})[_0x2433('0x18')](function(_0x102786){socket[_0x2433('0x50')](_0x2433('0x51'),{'id':Number(_0x2a7b72[_0x2433('0x29')]['id']),'tags':_0x102786||[]});return{'id':Number(_0x2a7b72[_0x2433('0x29')]['id']),'tags':_0x102786||[]};});}})[_0x2433('0x18')](respondWithResult(_0x498f9b,null))['catch'](handleError(_0x498f9b,null));};exports[_0x2433('0x52')]=function(_0xaea4c5,_0x2d2c2a){return db[_0x2433('0x2c')][_0x2433('0x34')]({'where':{'id':_0xaea4c5[_0x2433('0x29')]['id']}})[_0x2433('0x18')](handleEntityNotFound(_0x2d2c2a,null))['then'](function(_0x22b39f){if(_0x22b39f){return _0x22b39f[_0x2433('0x52')](_0xaea4c5[_0x2433('0x24')][_0x2433('0x4b')]);}})[_0x2433('0x18')](respondWithStatusCode(_0x2d2c2a,null))['catch'](handleError(_0x2d2c2a,null));};exports[_0x2433('0x53')]=function(_0x219f49,_0x3c8b80){var _0x205991=moment()[_0x2433('0x54')]()['toString']();var _0x5643ea=path[_0x2433('0x55')](config[_0x2433('0x56')],_0x2433('0x57'),'files','tmp');var _0x5ce714=path[_0x2433('0x55')](config[_0x2433('0x56')],_0x2433('0x57'),_0x2433('0x58'),_0x2433('0x59'));var _0x228dfc=path[_0x2433('0x55')](_0x5643ea,_0x205991);var _0x208ad0=util[_0x2433('0x46')](_0x2433('0x5a'),_0x219f49['params']['id'],_0x205991);var _0x14bac1=path[_0x2433('0x55')](_0x5643ea,_0x208ad0);var _0x4dec53=[];_0x4dec53[_0x2433('0x5b')]({'model':db[_0x2433('0x5c')],'as':_0x2433('0x5c'),'attributes':['id',_0x2433('0x5d')],'raw':!![]});_0x4dec53['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x2433('0x5e'),_0x2433('0x5f')],'raw':!![]});if(_0x219f49[_0x2433('0x24')][_0x2433('0x59')]){_0x4dec53['push']({'model':db['Attachment'],'as':_0x2433('0x60'),'raw':!![]});}var _0x54e5a2=[{'model':db['OpenchannelMessage'],'as':_0x2433('0x61'),'attributes':['id',_0x2433('0x36'),_0x2433('0x62'),_0x2433('0x63'),_0x2433('0x64'),_0x2433('0x65')],'include':_0x4dec53}];_0x54e5a2['push']({'model':db[_0x2433('0x66')],'as':'Account','attributes':['id',_0x2433('0x1b')]});_0x54e5a2['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x2433('0x5d')]});return db[_0x2433('0x2c')][_0x2433('0x34')]({'where':{'id':_0x219f49[_0x2433('0x29')]['id']},'include':_0x54e5a2})[_0x2433('0x18')](handleEntityNotFound(_0x3c8b80,null))[_0x2433('0x18')](function(_0x53c4a7){if(_0x53c4a7){var _0x2ce919=_0x53c4a7[_0x2433('0x67')]({'plain':!![]});fs[_0x2433('0x68')](_0x228dfc);var _0x728245={'channel':_0x2433('0x69'),'account':_0x2ce919[_0x2433('0x6a')][_0x2433('0x1b')],'agent':_0x2ce919[_0x2433('0x6b')]?_0x2ce919[_0x2433('0x6b')][_0x2433('0x5d')]:_0x2433('0x6c'),'createdAt':moment(_0x2ce919['createdAt'])[_0x2433('0x46')](_0x2433('0x47'))['toString'](),'closedAt':_0x2ce919[_0x2433('0x6d')]?moment(_0x2ce919[_0x2433('0x6e')])['format'](_0x2433('0x47'))['toString']():'','disposition':_0x2ce919['disposition'],'visibility':_0x2ce919[_0x2433('0x6f')]?_0x2433('0x70'):_0x2433('0x71'),'messages':_(_0x2ce919['Messages'])[_0x2433('0x43')]({'secret':![]})[_0x2433('0x1e')](function(_0x240fdb){if(_0x240fdb[_0x2433('0x60')]){var _0xb732ed=path['join'](_0x5ce714,_0x240fdb['Attachment'][_0x2433('0x72')]);if(fs[_0x2433('0x73')](_0xb732ed)){fs[_0x2433('0x74')](_0xb732ed)['pipe'](fs[_0x2433('0x75')](path['join'](_0x228dfc,_0x240fdb[_0x2433('0x60')][_0x2433('0x72')])));}}return{'date':moment(_0x240fdb['createdAt'])[_0x2433('0x46')](_0x2433('0x47'))[_0x2433('0x76')](),'sender':_0x240fdb[_0x2433('0x63')]==='out'?_0x240fdb[_0x2433('0x5c')]?_0x240fdb[_0x2433('0x5c')]['fullname']:_0x2433('0x77'):_0x240fdb[_0x2433('0x78')][_0x2433('0x5e')]+(_0x240fdb[_0x2433('0x78')][_0x2433('0x5f')]?'\x20'+_0x240fdb[_0x2433('0x78')][_0x2433('0x5f')]:''),'body':_0x240fdb[_0x2433('0x60')]?_0x240fdb[_0x2433('0x60')][_0x2433('0x72')]:_0x240fdb['body'],'direction':_0x240fdb[_0x2433('0x63')]===_0x2433('0x79')?'A':'C','secret':_0x240fdb['secret'],'read':_0x240fdb[_0x2433('0x65')],'attachment':_0x240fdb[_0x2433('0x60')]};})[_0x2433('0x7a')]()};return ejs[_0x2433('0x7b')](path[_0x2433('0x55')](config[_0x2433('0x56')],_0x2433('0x57'),_0x2433('0x7c'),_0x2433('0x7d')),{'interaction':_0x728245})[_0x2433('0x18')](function(_0x238947){var _0x5d5a69=path[_0x2433('0x55')](_0x228dfc,_0x2433('0x7e')+_0x2ce919['id']+'-'+_0x205991+_0x2433('0x7f'));var _0x8b7b9d={'path':_0x5d5a69,'channel':_0x2433('0x69'),'interactionId':_0x2ce919['id']};return pdf[_0x2433('0x80')](_0x238947,_0x8b7b9d);})[_0x2433('0x18')](function(){return new Promise(function(_0x3f0c00,_0x19a4b5){zipdir(_0x228dfc,{'saveTo':_0x14bac1},function(_0x31b95e,_0xd8b2b7){if(_0x31b95e)return _0x19a4b5(_0x31b95e);return _0x3f0c00(_0xd8b2b7);});})[_0x2433('0x18')](function(){return new Promise(function(_0x2d4c75,_0x5ca760){rimraf(_0x228dfc,function(_0x49b556){if(_0x49b556)_0x5ca760(_0x49b556);return _0x2d4c75();});});})[_0x2433('0x18')](function(){return _0x3c8b80[_0x2433('0x53')](_0x14bac1,_0x208ad0,function(_0x43eac4){if(_0x43eac4){logger[_0x2433('0x1a')](_0x2433('0x81'),_0x43eac4);}else{fs[_0x2433('0x82')](_0x14bac1);}});});});}else{return _0x3c8b80['sendStatus'](0xc8);}})[_0x2433('0x26')](handleError(_0x3c8b80,null));}; \ No newline at end of file +var _0x5228=['end','stack','name','index','map','OpenchannelInteraction','rawAttributes','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','options','create','body','find','params','describe','addMessage','omit','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','sort','pick','where','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','root','server','files','attachments','push','User','fullname','Contact','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Account','Owner','get','N.A.','format','closed','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','direction','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','update','then','destroy'];(function(_0x281c79,_0x22d1be){var _0xfbfaf1=function(_0xf5af54){while(--_0xf5af54){_0x281c79['push'](_0x281c79['shift']());}};_0xfbfaf1(++_0x22d1be);}(_0x5228,0xe5));var _0x8522=function(_0x7d3fe6,_0x994062){_0x7d3fe6=_0x7d3fe6-0x0;var _0xd568f3=_0x5228[_0x7d3fe6];return _0xd568f3;};'use strict';var rimraf=require(_0x8522('0x0'));var zipdir=require('zip-dir');var moment=require(_0x8522('0x1'));var util=require(_0x8522('0x2'));var path=require(_0x8522('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8522('0x4'));var Redis=require('ioredis');var interaction=require(_0x8522('0x5'));var qs=require(_0x8522('0x6'));var pdf=require(_0x8522('0x7'));var logger=require(_0x8522('0x8'))(_0x8522('0x9'));var config=require(_0x8522('0xa'));var db=require(_0x8522('0xb'))['db'];config[_0x8522('0xc')]=_[_0x8522('0xd')](config[_0x8522('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8522('0xe'))(new Redis(config[_0x8522('0xc')]));require('./openchannelInteraction.socket')[_0x8522('0xf')](socket);function respondWithStatusCode(_0x321d8a,_0xb375df){_0xb375df=_0xb375df||0xcc;return function(_0x1f0683){if(_0x1f0683){return _0x321d8a[_0x8522('0x10')](_0xb375df);}return _0x321d8a[_0x8522('0x11')](_0xb375df)['end']();};}function respondWithResult(_0x3b39d5,_0xe7220a){_0xe7220a=_0xe7220a||0xc8;return function(_0x217401){if(_0x217401){return _0x3b39d5['status'](_0xe7220a)['json'](_0x217401);}};}function respondWithFilteredResult(_0x210fb0,_0x5db6c4){return function(_0x10bc6f){if(_0x10bc6f){var _0x85a434=typeof _0x5db6c4[_0x8522('0x12')]===_0x8522('0x13')&&typeof _0x5db6c4[_0x8522('0x14')]===_0x8522('0x13');var _0x326be6=_0x10bc6f[_0x8522('0x15')];var _0x524d13=_0x85a434?0x0:_0x5db6c4[_0x8522('0x12')];var _0x362890=_0x85a434?_0x10bc6f[_0x8522('0x15')]:_0x5db6c4[_0x8522('0x12')]+_0x5db6c4['limit'];var _0x424372;if(_0x362890>=_0x326be6){_0x362890=_0x326be6;_0x424372=0xc8;}else{_0x424372=0xce;}_0x210fb0[_0x8522('0x11')](_0x424372);return _0x210fb0['set'](_0x8522('0x16'),_0x524d13+'-'+_0x362890+'/'+_0x326be6)[_0x8522('0x17')](_0x10bc6f);}return null;};}function saveUpdates(_0x29f3e2){return function(_0x5137f7){if(_0x5137f7){return _0x5137f7[_0x8522('0x18')](_0x29f3e2)[_0x8522('0x19')](function(_0x16e4fa){return _0x16e4fa;});}return null;};}function removeEntity(_0x44a2d2){return function(_0x4b691d){if(_0x4b691d){return _0x4b691d[_0x8522('0x1a')]()[_0x8522('0x19')](function(){_0x44a2d2[_0x8522('0x11')](0xcc)[_0x8522('0x1b')]();});}};}function handleEntityNotFound(_0x44a3cf){return function(_0xfbeff9){if(!_0xfbeff9){_0x44a3cf[_0x8522('0x10')](0x194);}return _0xfbeff9;};}function handleError(_0x8a6702,_0x1c41de){_0x1c41de=_0x1c41de||0x1f4;return function(_0x25e187){logger['error'](_0x25e187[_0x8522('0x1c')]);if(_0x25e187[_0x8522('0x1d')]){delete _0x25e187[_0x8522('0x1d')];}_0x8a6702[_0x8522('0x11')](_0x1c41de)['send'](_0x25e187);};}exports[_0x8522('0x1e')]=function(_0x1c8fd5,_0x33d8c8){var _0x6af37b={};var _0x38c332=_[_0x8522('0x1f')](db[_0x8522('0x20')][_0x8522('0x21')],function(_0x5d49ac){return{'name':_0x5d49ac['fieldName'],'type':_0x5d49ac[_0x8522('0x22')][_0x8522('0x23')]};});_0x6af37b=qs[_0x8522('0x24')](_0x38c332,_0x1c8fd5);return interaction[_0x8522('0x25')](_0x8522('0x26'),_0x1c8fd5[_0x8522('0x27')],_0x1c8fd5[_0x8522('0x28')],_0x6af37b,_0x38c332)[_0x8522('0x19')](respondWithFilteredResult(_0x33d8c8,_0x6af37b))[_0x8522('0x29')](handleError(_0x33d8c8,null));};exports[_0x8522('0x2a')]=function(_0x79b965,_0x44e293){var _0x5d1501={};if(_0x79b965['query'][_0x8522('0x22')]&&_0x79b965[_0x8522('0x27')][_0x8522('0x22')]==='from'){_0x5d1501[_0x8522('0x2b')]=_0x79b965['params']['id'];}else{_0x5d1501['id']=_0x79b965['params']['id'];}var _0x41820f={'raw':![],'where':_0x5d1501},_0x4204f1={};_0x4204f1[_0x8522('0x2c')]=_[_0x8522('0x2d')](db[_0x8522('0x20')][_0x8522('0x21')]);_0x4204f1[_0x8522('0x27')]=_[_0x8522('0x2d')](_0x79b965[_0x8522('0x27')]);_0x4204f1[_0x8522('0x2e')]=_[_0x8522('0x2f')](_0x4204f1[_0x8522('0x2c')],_0x4204f1[_0x8522('0x27')]);_0x41820f['attributes']=_[_0x8522('0x2f')](_0x4204f1[_0x8522('0x2c')],qs['fields'](_0x79b965['query'][_0x8522('0x30')]));_0x41820f[_0x8522('0x31')]=_0x41820f[_0x8522('0x31')][_0x8522('0x32')]?_0x41820f[_0x8522('0x31')]:_0x4204f1[_0x8522('0x2c')];if(_0x79b965[_0x8522('0x27')][_0x8522('0x33')]){_0x41820f[_0x8522('0x34')]=[{'all':!![]}];}_0x41820f=_[_0x8522('0x35')]({},_0x41820f,_0x79b965[_0x8522('0x36')]);return db[_0x8522('0x20')]['find'](_0x41820f)[_0x8522('0x19')](handleEntityNotFound(_0x44e293,null))[_0x8522('0x19')](respondWithResult(_0x44e293,null))[_0x8522('0x29')](handleError(_0x44e293,null));};exports[_0x8522('0x37')]=function(_0x2dd38e,_0x3586b2){return db[_0x8522('0x20')]['create'](_0x2dd38e[_0x8522('0x38')],{})[_0x8522('0x19')](respondWithResult(_0x3586b2,0xc9))[_0x8522('0x29')](handleError(_0x3586b2,null));};exports['update']=function(_0x220005,_0x134703){if(_0x220005[_0x8522('0x38')]['id']){delete _0x220005['body']['id'];}return db[_0x8522('0x20')][_0x8522('0x39')]({'where':{'id':_0x220005['params']['id']}})[_0x8522('0x19')](handleEntityNotFound(_0x134703,null))[_0x8522('0x19')](saveUpdates(_0x220005[_0x8522('0x38')],null))[_0x8522('0x19')](respondWithResult(_0x134703,null))[_0x8522('0x29')](handleError(_0x134703,null));};exports[_0x8522('0x1a')]=function(_0x250192,_0x3a9d35){return db['OpenchannelInteraction']['find']({'where':{'id':_0x250192[_0x8522('0x3a')]['id']}})[_0x8522('0x19')](handleEntityNotFound(_0x3a9d35,null))['then'](removeEntity(_0x3a9d35,null))[_0x8522('0x29')](handleError(_0x3a9d35,null));};exports[_0x8522('0x3b')]=function(_0x4c197c,_0x4134cd){return db[_0x8522('0x20')][_0x8522('0x3b')]()[_0x8522('0x19')](respondWithResult(_0x4134cd,null))[_0x8522('0x29')](handleError(_0x4134cd,null));};exports[_0x8522('0x3c')]=function(_0x3c1141,_0x5b1aff){return db['OpenchannelMessage'][_0x8522('0x39')]({'where':{'id':_0x3c1141['params']['id']}})[_0x8522('0x19')](handleEntityNotFound(_0x5b1aff,null))[_0x8522('0x19')](function(_0x46cd15){if(_0x46cd15){return _0x46cd15[_0x8522('0x3c')](_0x3c1141[_0x8522('0x38')]['ids'],_[_0x8522('0x3d')](_0x3c1141[_0x8522('0x38')],[_0x8522('0x3e'),'id'])||{});}})[_0x8522('0x19')](respondWithResult(_0x5b1aff,null))[_0x8522('0x29')](handleError(_0x5b1aff,null));};exports[_0x8522('0x3f')]=function(_0x298bb3,_0x5b85eb){var _0x48563c={'raw':![],'where':{}};var _0x505fd9={};var _0x2cd36e={'count':0x0,'rows':[]};return db[_0x8522('0x20')][_0x8522('0x40')]({'where':{'id':_0x298bb3[_0x8522('0x3a')]['id']}})[_0x8522('0x19')](handleEntityNotFound(_0x5b85eb,null))['then'](function(_0x5b7368){if(_0x5b7368){_0x505fd9[_0x8522('0x2c')]=_[_0x8522('0x2d')](db[_0x8522('0x41')]['rawAttributes']);_0x505fd9[_0x8522('0x27')]=_[_0x8522('0x2d')](_0x298bb3[_0x8522('0x27')]);_0x505fd9[_0x8522('0x2e')]=_[_0x8522('0x2f')](_0x505fd9[_0x8522('0x2c')],_0x505fd9['query']);_0x48563c[_0x8522('0x31')]=_[_0x8522('0x2f')](_0x505fd9[_0x8522('0x2c')],qs[_0x8522('0x30')](_0x298bb3[_0x8522('0x27')][_0x8522('0x30')]));_0x48563c[_0x8522('0x31')]=_0x48563c[_0x8522('0x31')][_0x8522('0x32')]?_0x48563c[_0x8522('0x31')]:_0x505fd9[_0x8522('0x2c')];if(!_0x298bb3['query'][_0x8522('0x42')](_0x8522('0x43'))){_0x48563c[_0x8522('0x14')]=qs[_0x8522('0x14')](_0x298bb3[_0x8522('0x27')]['limit']);_0x48563c[_0x8522('0x12')]=qs[_0x8522('0x12')](_0x298bb3['query'][_0x8522('0x12')]);}_0x48563c['order']=qs[_0x8522('0x44')](_0x298bb3['query'][_0x8522('0x44')]);_0x48563c['where']=qs['filters'](_[_0x8522('0x45')](_0x298bb3[_0x8522('0x27')],_0x505fd9['filters']));_0x48563c[_0x8522('0x46')][_0x8522('0x47')]=_0x5b7368['id'];if(_0x298bb3[_0x8522('0x27')][_0x8522('0x48')]){_0x48563c[_0x8522('0x46')]=_['merge'](_0x48563c[_0x8522('0x46')],{'$or':_[_0x8522('0x1f')](_0x48563c['attributes'],function(_0x5b82ad){var _0xde1e51={};_0xde1e51[_0x5b82ad]={'$like':'%'+_0x298bb3[_0x8522('0x27')][_0x8522('0x48')]+'%'};return _0xde1e51;})});}if(_0x298bb3['query'][_0x8522('0x49')]){var _0x2011e9=_0x298bb3[_0x8522('0x27')][_0x8522('0x49')][_0x8522('0x4a')](',');var _0x390108={};_0x390108[_0x2011e9[0x0]]={'$gte':moment(_0x2011e9[0x1])['format'](_0x8522('0x4b'))};_0x48563c[_0x8522('0x46')]=_['merge'](_0x48563c[_0x8522('0x46')],_0x390108);}_0x48563c=_['merge']({},_0x48563c,_0x298bb3['options']);return db['OpenchannelMessage']['count']({'where':_0x48563c[_0x8522('0x46')]})['then'](function(_0xff9f7a){_0x2cd36e[_0x8522('0x15')]=_0xff9f7a;if(_0x298bb3['query']['includeAll']){_0x48563c['include']=[{'all':!![]}];}return db[_0x8522('0x41')][_0x8522('0x25')](_0x48563c);})['then'](function(_0x5721a4){_0x2cd36e[_0x8522('0x4c')]=_0x5721a4;return _0x2cd36e;});}})[_0x8522('0x19')](respondWithFilteredResult(_0x5b85eb,_0x48563c))[_0x8522('0x29')](handleError(_0x5b85eb,null));};exports[_0x8522('0x4d')]=function(_0x20ed14,_0x3c3044){return db['OpenchannelInteraction'][_0x8522('0x39')]({'where':{'id':_0x20ed14['params']['id']}})['then'](handleEntityNotFound(_0x3c3044,null))[_0x8522('0x19')](function(_0x1912b6){if(_0x1912b6){return _0x1912b6[_0x8522('0x4e')](_0x20ed14[_0x8522('0x38')][_0x8522('0x3e')],_[_0x8522('0x3d')](_0x20ed14[_0x8522('0x38')],[_0x8522('0x3e'),'id'])||{})['spread'](function(){return db[_0x8522('0x4f')][_0x8522('0x25')]({'attributes':['id',_0x8522('0x1d'),'color'],'where':{'id':_0x20ed14[_0x8522('0x38')]['ids']}});})[_0x8522('0x19')](function(_0x295542){socket[_0x8522('0x50')](_0x8522('0x51'),{'id':Number(_0x20ed14['params']['id']),'tags':_0x295542||[]});return{'id':Number(_0x20ed14[_0x8522('0x3a')]['id']),'tags':_0x295542||[]};});}})[_0x8522('0x19')](respondWithResult(_0x3c3044,null))[_0x8522('0x29')](handleError(_0x3c3044,null));};exports[_0x8522('0x52')]=function(_0x1155e0,_0x5b70ca){return db[_0x8522('0x20')][_0x8522('0x39')]({'where':{'id':_0x1155e0[_0x8522('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5b70ca,null))[_0x8522('0x19')](function(_0x1894eb){if(_0x1894eb){return _0x1894eb['removeTags'](_0x1155e0[_0x8522('0x27')]['ids']);}})['then'](respondWithStatusCode(_0x5b70ca,null))['catch'](handleError(_0x5b70ca,null));};exports['download']=function(_0x463c63,_0x27ea5b){var _0x324945=moment()[_0x8522('0x53')]()[_0x8522('0x54')]();var _0xb88067=path[_0x8522('0x55')](config[_0x8522('0x56')],_0x8522('0x57'),'files','tmp');var _0x26fc76=path[_0x8522('0x55')](config[_0x8522('0x56')],_0x8522('0x57'),_0x8522('0x58'),_0x8522('0x59'));var _0x4dd89c=path[_0x8522('0x55')](_0xb88067,_0x324945);var _0x23dfe3=util['format']('transcript-%d-%s.zip',_0x463c63[_0x8522('0x3a')]['id'],_0x324945);var _0x2200b2=path[_0x8522('0x55')](_0xb88067,_0x23dfe3);var _0x212e8c=[];_0x212e8c[_0x8522('0x5a')]({'model':db[_0x8522('0x5b')],'as':_0x8522('0x5b'),'attributes':['id',_0x8522('0x5c')],'raw':!![]});_0x212e8c[_0x8522('0x5a')]({'model':db['CmContact'],'as':_0x8522('0x5d'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x463c63[_0x8522('0x27')][_0x8522('0x59')]){_0x212e8c[_0x8522('0x5a')]({'model':db[_0x8522('0x5e')],'as':_0x8522('0x5e'),'raw':!![]});}var _0x4bdc42=[{'model':db[_0x8522('0x41')],'as':_0x8522('0x5f'),'attributes':['id',_0x8522('0x38'),_0x8522('0x60'),'direction',_0x8522('0x61'),_0x8522('0x62')],'include':_0x212e8c}];_0x4bdc42['push']({'model':db[_0x8522('0x63')],'as':_0x8522('0x64'),'attributes':['id',_0x8522('0x1d')]});_0x4bdc42[_0x8522('0x5a')]({'model':db[_0x8522('0x5b')],'as':_0x8522('0x65'),'attributes':['id',_0x8522('0x5c')]});return db[_0x8522('0x20')]['find']({'where':{'id':_0x463c63[_0x8522('0x3a')]['id']},'include':_0x4bdc42})['then'](handleEntityNotFound(_0x27ea5b,null))[_0x8522('0x19')](function(_0x15230e){if(_0x15230e){var _0xd28da=_0x15230e[_0x8522('0x66')]({'plain':!![]});fs['mkdirSync'](_0x4dd89c);var _0x2f4fde={'channel':'Openchannel','account':_0xd28da[_0x8522('0x64')][_0x8522('0x1d')],'agent':_0xd28da['Owner']?_0xd28da['Owner'][_0x8522('0x5c')]:_0x8522('0x67'),'createdAt':moment(_0xd28da[_0x8522('0x60')])[_0x8522('0x68')](_0x8522('0x4b'))[_0x8522('0x54')](),'closedAt':_0xd28da[_0x8522('0x69')]?moment(_0xd28da[_0x8522('0x6a')])[_0x8522('0x68')](_0x8522('0x4b'))[_0x8522('0x54')]():'','disposition':_0xd28da['disposition'],'visibility':_0xd28da[_0x8522('0x6b')]?_0x8522('0x6c'):_0x8522('0x6d'),'messages':_(_0xd28da[_0x8522('0x5f')])[_0x8522('0x48')]({'secret':![]})[_0x8522('0x1f')](function(_0x592cdf){if(_0x592cdf[_0x8522('0x5e')]){var _0x3d83d9=path[_0x8522('0x55')](_0x26fc76,_0x592cdf[_0x8522('0x5e')][_0x8522('0x6e')]);if(fs[_0x8522('0x6f')](_0x3d83d9)){fs[_0x8522('0x70')](_0x3d83d9)[_0x8522('0x71')](fs[_0x8522('0x72')](path[_0x8522('0x55')](_0x4dd89c,_0x592cdf['Attachment']['basename'])));}}return{'date':moment(_0x592cdf[_0x8522('0x60')])['format'](_0x8522('0x4b'))[_0x8522('0x54')](),'sender':_0x592cdf['direction']===_0x8522('0x73')?_0x592cdf[_0x8522('0x5b')]?_0x592cdf[_0x8522('0x5b')][_0x8522('0x5c')]:_0x8522('0x74'):_0x592cdf[_0x8522('0x5d')]['firstName']+(_0x592cdf[_0x8522('0x5d')][_0x8522('0x75')]?'\x20'+_0x592cdf[_0x8522('0x5d')][_0x8522('0x75')]:''),'body':_0x592cdf[_0x8522('0x5e')]?_0x592cdf[_0x8522('0x5e')][_0x8522('0x6e')]:_0x592cdf['body'],'direction':_0x592cdf[_0x8522('0x76')]===_0x8522('0x73')?'A':'C','secret':_0x592cdf[_0x8522('0x61')],'read':_0x592cdf[_0x8522('0x62')],'attachment':_0x592cdf[_0x8522('0x5e')]};})[_0x8522('0x77')]()};return ejs['renderFile'](path[_0x8522('0x55')](config['root'],_0x8522('0x57'),_0x8522('0x78'),_0x8522('0x79')),{'interaction':_0x2f4fde})[_0x8522('0x19')](function(_0x2931b6){var _0x401043=path['join'](_0x4dd89c,_0x8522('0x7a')+_0xd28da['id']+'-'+_0x324945+_0x8522('0x7b'));var _0x11097e={'path':_0x401043,'channel':'Openchannel','interactionId':_0xd28da['id']};return pdf[_0x8522('0x7c')](_0x2931b6,_0x11097e);})[_0x8522('0x19')](function(){return new Promise(function(_0x26114b,_0x56ff0b){zipdir(_0x4dd89c,{'saveTo':_0x2200b2},function(_0x43e51e,_0x23ea64){if(_0x43e51e)return _0x56ff0b(_0x43e51e);return _0x26114b(_0x23ea64);});})[_0x8522('0x19')](function(){return new Promise(function(_0xfdc3f2,_0x43d4bd){rimraf(_0x4dd89c,function(_0x261e7e){if(_0x261e7e)_0x43d4bd(_0x261e7e);return _0xfdc3f2();});});})[_0x8522('0x19')](function(){return _0x27ea5b[_0x8522('0x7d')](_0x2200b2,_0x23dfe3,function(_0x30be5e){if(_0x30be5e){logger['error'](_0x8522('0x7e'),_0x30be5e);}else{fs[_0x8522('0x7f')](_0x2200b2);}});});});}else{return _0x27ea5b[_0x8522('0x10')](0xc8);}})[_0x8522('0x29')](handleError(_0x27ea5b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f112439..f0c2683 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 _0xbc56=['hook','exports','../../mysqldb','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch'];(function(_0x5ce493,_0x35c68f){var _0x382730=function(_0x54faf3){while(--_0x54faf3){_0x5ce493['push'](_0x5ce493['shift']());}};_0x382730(++_0x35c68f);}(_0xbc56,0xd4));var _0x6bc5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbc56[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x6bc5('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x6bc5('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6bc5('0x1'),'afterUpdate':_0x6bc5('0x2'),'afterDestroy':_0x6bc5('0x3')};function emitEvent(_0x43917d){return function(_0x18808a,_0x589e1e,_0x4079bc){_0x18808a[_0x6bc5('0x4')]({'attributes':['id'],'raw':!![]})[_0x6bc5('0x5')](function(_0x278339){_0x18808a[_0x6bc5('0x6')](_0x6bc5('0x7'),_0x278339['map'](function(_0x1e991f){return{'id':_0x1e991f['id']};}));return OpenchannelMessage[_0x6bc5('0x8')]({'where':{'OpenchannelInteractionId':_0x18808a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3bc700){_0x18808a[_0x6bc5('0x6')](_0x6bc5('0x9'),_0x3bc700[_0x6bc5('0xa')]);OpenchannelInteractionEvents[_0x6bc5('0xb')](_0x43917d+':'+_0x18808a['id'],_0x18808a);OpenchannelInteractionEvents[_0x6bc5('0xb')](_0x43917d,_0x18808a);_0x4079bc(null);})[_0x6bc5('0xc')](_0x4079bc(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x6bc5('0xd')](e,emitEvent(event));}}module[_0x6bc5('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xe399=['map','findAll','emit','catch','exports','OpenchannelInteraction','setMaxListeners','update','remove','then','setDataValue'];(function(_0x45207c,_0x5e6766){var _0x5a1b52=function(_0x2be81c){while(--_0x2be81c){_0x45207c['push'](_0x45207c['shift']());}};_0x5a1b52(++_0x5e6766);}(_0xe399,0xec));var _0x9e39=function(_0x534ae4,_0x5ab30f){_0x534ae4=_0x534ae4-0x0;var _0x249ee2=_0xe399[_0x534ae4];return _0x249ee2;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x9e39('0x0')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9e39('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9e39('0x2'),'afterDestroy':_0x9e39('0x3')};function emitEvent(_0xba8a91){return function(_0x3b7803,_0x4e99b1,_0x1e7287){_0x3b7803['getUsers']({'attributes':['id'],'raw':!![]})[_0x9e39('0x4')](function(_0x361f91){_0x3b7803[_0x9e39('0x5')]('Users',_0x361f91[_0x9e39('0x6')](function(_0x1f7e02){return{'id':_0x1f7e02['id']};}));return OpenchannelMessage[_0x9e39('0x7')]({'where':{'OpenchannelInteractionId':_0x3b7803['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e39('0x4')](function(_0x500021){_0x3b7803[_0x9e39('0x5')]('unreadMessages',_0x500021['length']);OpenchannelInteractionEvents[_0x9e39('0x8')](_0xba8a91+':'+_0x3b7803['id'],_0x3b7803);OpenchannelInteractionEvents[_0x9e39('0x8')](_0xba8a91,_0x3b7803);_0x1e7287(null);})[_0x9e39('0x9')](_0x1e7287(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x9e39('0xa')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 944c193..c793c8d 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 _0xe5b1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','lodash','util','../../config/logger'];(function(_0x15bb39,_0x42bd41){var _0x88fadc=function(_0x177f6c){while(--_0x177f6c){_0x15bb39['push'](_0x15bb39['shift']());}};_0x88fadc(++_0x42bd41);}(_0xe5b1,0x9f));var _0x1e5b=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0xe5b1[_0x31a37b];return _0x49ae16;};'use strict';var _=require(_0x1e5b('0x0'));var util=require(_0x1e5b('0x1'));var logger=require(_0x1e5b('0x2'))(_0x1e5b('0x3'));var moment=require(_0x1e5b('0x4'));var BPromise=require(_0x1e5b('0x5'));var rp=require(_0x1e5b('0x6'));var fs=require('fs');var path=require(_0x1e5b('0x7'));var rimraf=require(_0x1e5b('0x8'));var config=require(_0x1e5b('0x9'));var attributes=require(_0x1e5b('0xa'));module['exports']=function(_0xeec1c9,_0x14cf1e){return _0xeec1c9[_0x1e5b('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0x1e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e5b('0xd'),'collate':_0x1e5b('0xe'),'hooks':{'beforeUpdate':function(_0x20f338,_0x18a883,_0x136e86){if(_0x20f338[_0x1e5b('0xf')](_0x1e5b('0x10'))){_0x20f338['closedAt']=moment()[_0x1e5b('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x136e86(null,_0x20f338);}}});}; \ No newline at end of file +var _0x7a59=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4_unicode_ci','changed'];(function(_0x1bf1e3,_0x4e59ed){var _0x374780=function(_0x5f2531){while(--_0x5f2531){_0x1bf1e3['push'](_0x1bf1e3['shift']());}};_0x374780(++_0x4e59ed);}(_0x7a59,0x199));var _0x97a5=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x7a59[_0x223461];return _0x4dbe0a;};'use strict';var _=require('lodash');var util=require(_0x97a5('0x0'));var logger=require('../../config/logger')(_0x97a5('0x1'));var moment=require(_0x97a5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97a5('0x3'));var config=require(_0x97a5('0x4'));var attributes=require(_0x97a5('0x5'));module[_0x97a5('0x6')]=function(_0x9d7d36,_0x4da73c){return _0x9d7d36[_0x97a5('0x7')]('OpenchannelInteraction',attributes,{'tableName':_0x97a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x97a5('0x9'),'hooks':{'beforeUpdate':function(_0x298b02,_0x43f79e,_0x9fb071){if(_0x298b02[_0x97a5('0xa')](_0x97a5('0xb'))){_0x298b02[_0x97a5('0xc')]=moment()[_0x97a5('0xd')](_0x97a5('0xe'));}_0x9fb071(null,_0x298b02);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 7f17f00..325a335 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 _0x65e6=['localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','catch','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','debug','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x138d32,_0x2ac579){var _0x3ebff7=function(_0x4b860a){while(--_0x4b860a){_0x138d32['push'](_0x138d32['shift']());}};_0x3ebff7(++_0x2ac579);}(_0x65e6,0xf5));var _0x665e=function(_0x344555,_0x2a0050){_0x344555=_0x344555-0x0;var _0x48b90d=_0x65e6[_0x344555];return _0x48b90d;};'use strict';var _=require(_0x665e('0x0'));var util=require('util');var moment=require(_0x665e('0x1'));var BPromise=require('bluebird');var rs=require(_0x665e('0x2'));var fs=require('fs');var Redis=require(_0x665e('0x3'));var db=require(_0x665e('0x4'))['db'];var utils=require(_0x665e('0x5'));var logger=require(_0x665e('0x6'))(_0x665e('0x7'));var config=require('../../config/environment');var jayson=require(_0x665e('0x8'));var client=jayson[_0x665e('0x9')][_0x665e('0xa')]({'port':0x232a});config[_0x665e('0xb')]=_[_0x665e('0xc')](config[_0x665e('0xb')],{'host':_0x665e('0xd'),'port':0x18eb});var socket=require(_0x665e('0xe'))(new Redis(config[_0x665e('0xb')]));require(_0x665e('0xf'))[_0x665e('0x10')](socket);function respondWithRpcPromise(_0xd03e5b,_0x248b26,_0x21e0eb){return new BPromise(function(_0xa3c45b,_0x7e24b1){return client[_0x665e('0x11')](_0xd03e5b,_0x21e0eb)[_0x665e('0x12')](function(_0x4b32e9){logger[_0x665e('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x248b26,_0x665e('0x14'));logger['debug'](_0x665e('0x15'),_0x248b26,'request\x20sent',JSON['stringify'](_0x4b32e9));if(_0x4b32e9['error']){if(_0x4b32e9[_0x665e('0x16')][_0x665e('0x17')]===0x1f4){logger[_0x665e('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x248b26,_0x4b32e9['error'][_0x665e('0x18')]);return _0x7e24b1(_0x4b32e9[_0x665e('0x16')][_0x665e('0x18')]);}logger[_0x665e('0x16')](_0x665e('0x19'),_0x248b26,_0x4b32e9['error'][_0x665e('0x18')]);return _0xa3c45b(_0x4b32e9[_0x665e('0x16')][_0x665e('0x18')]);}else{logger[_0x665e('0x13')](_0x665e('0x19'),_0x248b26,_0x665e('0x14'));_0xa3c45b(_0x4b32e9['result']['message']);}})[_0x665e('0x1a')](function(_0x255e44){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x248b26,_0x255e44);_0x7e24b1(_0x255e44);});});}exports['UpdateOpenchannelInteraction']=function(_0x25c264){var _0x56c348=this;return new Promise(function(_0x26e19b,_0x35779d){return db['OpenchannelInteraction']['update'](_0x25c264[_0x665e('0x1b')],{'raw':_0x25c264[_0x665e('0x1c')]?_0x25c264['options'][_0x665e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25c264[_0x665e('0x1c')]?_0x25c264[_0x665e('0x1c')][_0x665e('0x1e')]||null:null,'attributes':_0x25c264[_0x665e('0x1c')]?_0x25c264['options'][_0x665e('0x1f')]||null:null,'limit':_0x25c264[_0x665e('0x1c')]?_0x25c264[_0x665e('0x1c')][_0x665e('0x20')]||null:null})[_0x665e('0x12')](function(_0x1aa31e){logger[_0x665e('0x13')](_0x665e('0x21'),_0x25c264);logger['debug'](_0x665e('0x21'),_0x25c264,JSON['stringify'](_0x1aa31e));_0x26e19b(_0x1aa31e);})[_0x665e('0x1a')](function(_0x5023c0){logger[_0x665e('0x16')](_0x665e('0x21'),_0x5023c0[_0x665e('0x18')],_0x25c264);_0x35779d(_0x56c348['error'](0x1f4,_0x5023c0[_0x665e('0x18')]));});});};exports[_0x665e('0x22')]=function(_0x2bdc6b){return new Promise(function(_0x5f5c17,_0x501a36){return db[_0x665e('0x23')][_0x665e('0x24')]({'where':_0x2bdc6b[_0x665e('0x1c')]?_0x2bdc6b[_0x665e('0x1c')][_0x665e('0x1e')]||null:null})['then'](function(_0x1ea73c){if(_0x1ea73c){return _0x1ea73c[_0x665e('0x25')](_0x2bdc6b['body'][_0x665e('0x26')],_[_0x665e('0x27')](_0x2bdc6b[_0x665e('0x1b')],[_0x665e('0x26'),'id'])||{});}})[_0x665e('0x28')](function(_0x524462){logger[_0x665e('0x13')]('AddTags',_0x2bdc6b);logger[_0x665e('0x29')](_0x665e('0x2a'),_0x2bdc6b,JSON['stringify'](_0x524462));_0x5f5c17(_0x524462);})[_0x665e('0x1a')](function(_0x23b486){logger['error'](_0x665e('0x2a'),_0x23b486['message'],_0x2bdc6b);_0x501a36(_this[_0x665e('0x16')](0x1f4,_0x23b486[_0x665e('0x18')]));});});}; \ No newline at end of file +var _0xc878=['defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateOpenchannelInteraction','options','raw','attributes','limit','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0xc878,0x152));var _0x8c87=function(_0x10df1e,_0xf56f85){_0x10df1e=_0x10df1e-0x0;var _0x3e24fb=_0xc878[_0x10df1e];return _0x3e24fb;};'use strict';var _=require(_0x8c87('0x0'));var util=require(_0x8c87('0x1'));var moment=require(_0x8c87('0x2'));var BPromise=require(_0x8c87('0x3'));var rs=require(_0x8c87('0x4'));var fs=require('fs');var Redis=require(_0x8c87('0x5'));var db=require(_0x8c87('0x6'))['db'];var utils=require(_0x8c87('0x7'));var logger=require(_0x8c87('0x8'))(_0x8c87('0x9'));var config=require(_0x8c87('0xa'));var jayson=require(_0x8c87('0xb'));var client=jayson[_0x8c87('0xc')]['http']({'port':0x232a});config[_0x8c87('0xd')]=_[_0x8c87('0xe')](config[_0x8c87('0xd')],{'host':_0x8c87('0xf'),'port':0x18eb});var socket=require(_0x8c87('0x10'))(new Redis(config[_0x8c87('0xd')]));require('./openchannelInteraction.socket')[_0x8c87('0x11')](socket);function respondWithRpcPromise(_0x306ad5,_0x43bbb0,_0x452ed5){return new BPromise(function(_0x2a091d,_0xbe43cb){return client[_0x8c87('0x12')](_0x306ad5,_0x452ed5)[_0x8c87('0x13')](function(_0x5af379){logger[_0x8c87('0x14')](_0x8c87('0x15'),_0x43bbb0,_0x8c87('0x16'));logger[_0x8c87('0x17')](_0x8c87('0x18'),_0x43bbb0,_0x8c87('0x16'),JSON['stringify'](_0x5af379));if(_0x5af379[_0x8c87('0x19')]){if(_0x5af379[_0x8c87('0x19')][_0x8c87('0x1a')]===0x1f4){logger[_0x8c87('0x19')](_0x8c87('0x15'),_0x43bbb0,_0x5af379['error'][_0x8c87('0x1b')]);return _0xbe43cb(_0x5af379['error']['message']);}logger[_0x8c87('0x19')](_0x8c87('0x15'),_0x43bbb0,_0x5af379[_0x8c87('0x19')][_0x8c87('0x1b')]);return _0x2a091d(_0x5af379[_0x8c87('0x19')]['message']);}else{logger[_0x8c87('0x14')](_0x8c87('0x15'),_0x43bbb0,_0x8c87('0x16'));_0x2a091d(_0x5af379['result'][_0x8c87('0x1b')]);}})[_0x8c87('0x1c')](function(_0x4a4405){logger[_0x8c87('0x19')](_0x8c87('0x15'),_0x43bbb0,_0x4a4405);_0xbe43cb(_0x4a4405);});});}exports[_0x8c87('0x1d')]=function(_0x3ba562){var _0x9dc898=this;return new Promise(function(_0x2f01a0,_0x114600){return db['OpenchannelInteraction']['update'](_0x3ba562['body'],{'raw':_0x3ba562[_0x8c87('0x1e')]?_0x3ba562[_0x8c87('0x1e')][_0x8c87('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ba562['options']?_0x3ba562[_0x8c87('0x1e')]['where']||null:null,'attributes':_0x3ba562[_0x8c87('0x1e')]?_0x3ba562[_0x8c87('0x1e')][_0x8c87('0x20')]||null:null,'limit':_0x3ba562[_0x8c87('0x1e')]?_0x3ba562['options'][_0x8c87('0x21')]||null:null})['then'](function(_0x5bc38a){logger[_0x8c87('0x14')](_0x8c87('0x1d'),_0x3ba562);logger[_0x8c87('0x17')](_0x8c87('0x1d'),_0x3ba562,JSON[_0x8c87('0x22')](_0x5bc38a));_0x2f01a0(_0x5bc38a);})['catch'](function(_0x289d67){logger[_0x8c87('0x19')](_0x8c87('0x1d'),_0x289d67[_0x8c87('0x1b')],_0x3ba562);_0x114600(_0x9dc898[_0x8c87('0x19')](0x1f4,_0x289d67['message']));});});};exports[_0x8c87('0x23')]=function(_0x2ef4f1){return new Promise(function(_0x10dd60,_0x13212c){return db[_0x8c87('0x24')][_0x8c87('0x25')]({'where':_0x2ef4f1[_0x8c87('0x1e')]?_0x2ef4f1['options'][_0x8c87('0x26')]||null:null})[_0x8c87('0x13')](function(_0x8f347f){if(_0x8f347f){return _0x8f347f[_0x8c87('0x27')](_0x2ef4f1['body'][_0x8c87('0x28')],_[_0x8c87('0x29')](_0x2ef4f1['body'],[_0x8c87('0x28'),'id'])||{});}})[_0x8c87('0x2a')](function(_0x111af0){logger[_0x8c87('0x14')](_0x8c87('0x2b'),_0x2ef4f1);logger[_0x8c87('0x17')]('AddTags',_0x2ef4f1,JSON['stringify'](_0x111af0));_0x10dd60(_0x111af0);})[_0x8c87('0x1c')](function(_0x48c486){logger[_0x8c87('0x19')]('AddTags',_0x48c486[_0x8c87('0x1b')],_0x2ef4f1);_0x13212c(_this[_0x8c87('0x19')](0x1f4,_0x48c486['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index f52c4f3..032628c 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 _0x3e59=['openchannelInteraction:','./openchannelInteraction.events','save','remove','removeListener'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0x3e59,0x155));var _0x93e5=function(_0x29b974,_0x4d7e73){_0x29b974=_0x29b974-0x0;var _0x33e066=_0x3e59[_0x29b974];return _0x33e066;};'use strict';var OpenchannelInteractionEvents=require(_0x93e5('0x0'));var events=[_0x93e5('0x1'),_0x93e5('0x2'),'update'];function createListener(_0x27e43f,_0x416e35){return function(_0xe9a84c){_0x416e35['emit'](_0x27e43f,_0xe9a84c);};}function removeListener(_0x558d35,_0x27aad8){return function(){OpenchannelInteractionEvents[_0x93e5('0x3')](_0x558d35,_0x27aad8);};}exports['register']=function(_0x106965){for(var _0x223864=0x0,_0x500ff8=events['length'];_0x223864<_0x500ff8;_0x223864++){var _0x1410c3=events[_0x223864];var _0x3d9180=createListener(_0x93e5('0x4')+_0x1410c3,_0x106965);OpenchannelInteractionEvents['on'](_0x1410c3,_0x3d9180);}}; \ No newline at end of file +var _0xb61c=['emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb61c,0xca));var _0xcb61=function(_0x27d01b,_0x4e3a2b){_0x27d01b=_0x27d01b-0x0;var _0x5c2e08=_0xb61c[_0x27d01b];return _0x5c2e08;};'use strict';var OpenchannelInteractionEvents=require(_0xcb61('0x0'));var events=['save','remove',_0xcb61('0x1')];function createListener(_0x5e5d27,_0x10aa48){return function(_0x31b0a4){_0x10aa48[_0xcb61('0x2')](_0x5e5d27,_0x31b0a4);};}function removeListener(_0x528551,_0x1e9c00){return function(){OpenchannelInteractionEvents[_0xcb61('0x3')](_0x528551,_0x1e9c00);};}exports[_0xcb61('0x4')]=function(_0x12dbc1){for(var _0x3d137b=0x0,_0x8832d3=events['length'];_0x3d137b<_0x8832d3;_0x3d137b++){var _0x381dff=events[_0x3d137b];var _0xdb92ab=createListener(_0xcb61('0x5')+_0x381dff,_0x12dbc1);OpenchannelInteractionEvents['on'](_0x381dff,_0xdb92ab);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e9bb225..978a577 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(_0x36ed97,_0x10fe26){var _0x34f875=function(_0x41e806){while(--_0x41e806){_0x36ed97['push'](_0x36ed97['shift']());}};_0x34f875(++_0x10fe26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 _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(_0x4ad2f1,_0x46d6ab){var _0x268355=function(_0x425102){while(--_0x425102){_0x4ad2f1['push'](_0x4ad2f1['shift']());}};_0x268355(++_0x46d6ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 0dccb9e..3f159f8 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 _0x38d0=['BOOLEAN','ENUM','DATE','exports','TEXT','medium'];(function(_0x5c209b,_0x236d51){var _0x7e2536=function(_0x4cf801){while(--_0x4cf801){_0x5c209b['push'](_0x5c209b['shift']());}};_0x7e2536(++_0x236d51);}(_0x38d0,0x123));var _0x038d=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x38d0[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require('sequelize');module[_0x038d('0x0')]={'body':{'type':Sequelize[_0x038d('0x1')](_0x038d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x038d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x038d('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x038d('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x038d('0x1')]}}; \ No newline at end of file +var _0x453b=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x20066c,_0x261dea){var _0x36d1f=function(_0x32a552){while(--_0x32a552){_0x20066c['push'](_0x20066c['shift']());}};_0x36d1f(++_0x261dea);}(_0x453b,0x164));var _0xb453=function(_0x11b19b,_0x213234){_0x11b19b=_0x11b19b-0x0;var _0x1daac1=_0x453b[_0x11b19b];return _0x1daac1;};'use strict';var Sequelize=require(_0xb453('0x0'));module[_0xb453('0x1')]={'body':{'type':Sequelize[_0xb453('0x2')](_0xb453('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb453('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb453('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb453('0x5')]('in',_0xb453('0x6')),'defaultValue':_0xb453('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb453('0x7')]},'providerName':{'type':Sequelize[_0xb453('0x8')]},'providerResponse':{'type':Sequelize[_0xb453('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index ad567f6..b4ea4af 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 _0xb6b3=['merge','find','create','body','describe','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','internal','motionChannel','event','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','destroy','stack','index','map','OpenchannelMessage','rawAttributes','fieldName','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x5bf8a9,_0x5411e2){var _0x4738a4=function(_0x4df817){while(--_0x4df817){_0x5bf8a9['push'](_0x5bf8a9['shift']());}};_0x4738a4(++_0x5411e2);}(_0xb6b3,0x12e));var _0x3b6b=function(_0x42cd14,_0x44c325){_0x42cd14=_0x42cd14-0x0;var _0x369958=_0xb6b3[_0x42cd14];return _0x369958;};'use strict';var emlformat=require(_0x3b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b6b('0x1'));var jsonpatch=require(_0x3b6b('0x2'));var rp=require(_0x3b6b('0x3'));var moment=require(_0x3b6b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3b6b('0x5'));var util=require(_0x3b6b('0x6'));var path=require(_0x3b6b('0x7'));var sox=require(_0x3b6b('0x8'));var csv=require('to-csv');var ejs=require(_0x3b6b('0x9'));var fs=require('fs');var fs_extra=require(_0x3b6b('0xa'));var _=require(_0x3b6b('0xb'));var squel=require(_0x3b6b('0xc'));var crypto=require(_0x3b6b('0xd'));var jsforce=require(_0x3b6b('0xe'));var deskjs=require(_0x3b6b('0xf'));var toCsv=require(_0x3b6b('0x10'));var querystring=require(_0x3b6b('0x11'));var Papa=require('papaparse');var Redis=require(_0x3b6b('0x12'));var authService=require(_0x3b6b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3b6b('0x14'));var hardwareService=require(_0x3b6b('0x15'));var logger=require(_0x3b6b('0x16'))('api');var utils=require(_0x3b6b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3b6b('0x18'));var db=require(_0x3b6b('0x19'))['db'];config[_0x3b6b('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3b6b('0x1b'))(new Redis(config[_0x3b6b('0x1a')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x3b6b('0x1c'));var client=jayson[_0x3b6b('0x1d')][_0x3b6b('0x1e')]({'port':0x232c});var client9002=jayson[_0x3b6b('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2465f0,_0x298c36,_0x3598b5,_0x261a6c){return new BPromise(function(_0x5b9b95,_0x547227){var _0x25d311=_0x261a6c||client;return _0x25d311[_0x3b6b('0x1f')](_0x2465f0,_0x3598b5)[_0x3b6b('0x20')](function(_0x3e84f1){logger[_0x3b6b('0x21')](_0x3b6b('0x22'),_0x298c36,_0x3b6b('0x23'));logger['debug'](_0x3b6b('0x24'),_0x298c36,'request\x20sent',JSON[_0x3b6b('0x25')](_0x3e84f1));if(_0x3e84f1[_0x3b6b('0x26')]){if(_0x3e84f1[_0x3b6b('0x26')]['code']===0x1f4){logger[_0x3b6b('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x298c36,_0x3e84f1[_0x3b6b('0x26')]['message']);return _0x547227(_0x3e84f1[_0x3b6b('0x26')][_0x3b6b('0x27')]);}logger[_0x3b6b('0x26')](_0x3b6b('0x22'),_0x298c36,_0x3e84f1['error'][_0x3b6b('0x27')]);return _0x5b9b95(_0x3e84f1[_0x3b6b('0x26')]['message']);}else{logger[_0x3b6b('0x21')](_0x3b6b('0x22'),_0x298c36,_0x3b6b('0x23'));_0x5b9b95(_0x3e84f1['result'][_0x3b6b('0x27')]);}})[_0x3b6b('0x28')](function(_0x3eb797){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x298c36,_0x3eb797);_0x547227(_0x3eb797);});});}function respondWithStatusCode(_0x473212,_0x10aad3){_0x10aad3=_0x10aad3||0xcc;return function(_0x4953f7){if(_0x4953f7){return _0x473212[_0x3b6b('0x29')](_0x10aad3);}return _0x473212[_0x3b6b('0x2a')](_0x10aad3)[_0x3b6b('0x2b')]();};}function respondWithResult(_0x46963c,_0x1c6c56){_0x1c6c56=_0x1c6c56||0xc8;return function(_0x2472dc){if(_0x2472dc){return _0x46963c[_0x3b6b('0x2a')](_0x1c6c56)[_0x3b6b('0x2c')](_0x2472dc);}};}function respondWithFilteredResult(_0x550b6,_0x296495){return function(_0x34d048){if(_0x34d048){var _0x57f3bd=typeof _0x296495['offset']==='undefined'&&typeof _0x296495['limit']===_0x3b6b('0x2d');var _0x28f3d0=_0x34d048[_0x3b6b('0x2e')];var _0x2362a3=_0x57f3bd?0x0:_0x296495[_0x3b6b('0x2f')];var _0x58e5d6=_0x57f3bd?_0x34d048['count']:_0x296495['offset']+_0x296495[_0x3b6b('0x30')];var _0x1b42ff;if(_0x58e5d6>=_0x28f3d0){_0x58e5d6=_0x28f3d0;_0x1b42ff=0xc8;}else{_0x1b42ff=0xce;}_0x550b6['status'](_0x1b42ff);return _0x550b6[_0x3b6b('0x31')]('Content-Range',_0x2362a3+'-'+_0x58e5d6+'/'+_0x28f3d0)['json'](_0x34d048);}return null;};}function patchUpdates(_0x1989da){return function(_0x5b51e6){try{jsonpatch['apply'](_0x5b51e6,_0x1989da,!![]);}catch(_0x1a7620){return BPromise[_0x3b6b('0x32')](_0x1a7620);}return _0x5b51e6[_0x3b6b('0x33')]();};}function saveUpdates(_0x124e22,_0x1fc665){return function(_0x44530b){if(_0x44530b){return _0x44530b[_0x3b6b('0x34')](_0x124e22)[_0x3b6b('0x20')](function(_0x12149b){return _0x12149b;});}return null;};}function removeEntity(_0x3546bc,_0x4a412c){return function(_0x1178d0){if(_0x1178d0){return _0x1178d0[_0x3b6b('0x35')]()[_0x3b6b('0x20')](function(){_0x3546bc[_0x3b6b('0x2a')](0xcc)[_0x3b6b('0x2b')]();});}};}function handleEntityNotFound(_0x130d71,_0x27d52a){return function(_0x19c32c){if(!_0x19c32c){_0x130d71[_0x3b6b('0x29')](0x194);}return _0x19c32c;};}function handleError(_0x582d76,_0x38592f){_0x38592f=_0x38592f||0x1f4;return function(_0x5b5777){logger['error'](_0x5b5777[_0x3b6b('0x36')]);if(_0x5b5777['name']){delete _0x5b5777['name'];}_0x582d76[_0x3b6b('0x2a')](_0x38592f)['send'](_0x5b5777);};}exports[_0x3b6b('0x37')]=function(_0x42a7f9,_0xa98c7e){var _0x55781d={},_0x118d3a={},_0x19819c={'count':0x0,'rows':[]};var _0x161d37=_[_0x3b6b('0x38')](db[_0x3b6b('0x39')][_0x3b6b('0x3a')],function(_0x1076a3){return{'name':_0x1076a3[_0x3b6b('0x3b')],'type':_0x1076a3['type'][_0x3b6b('0x3c')]};});_0x118d3a['model']=_[_0x3b6b('0x38')](_0x161d37,_0x3b6b('0x3d'));_0x118d3a[_0x3b6b('0x3e')]=_[_0x3b6b('0x3f')](_0x42a7f9[_0x3b6b('0x3e')]);_0x118d3a['filters']=_[_0x3b6b('0x40')](_0x118d3a[_0x3b6b('0x41')],_0x118d3a['query']);_0x55781d[_0x3b6b('0x42')]=_[_0x3b6b('0x40')](_0x118d3a['model'],qs[_0x3b6b('0x43')](_0x42a7f9[_0x3b6b('0x3e')][_0x3b6b('0x43')]));_0x55781d[_0x3b6b('0x42')]=_0x55781d['attributes'][_0x3b6b('0x44')]?_0x55781d[_0x3b6b('0x42')]:_0x118d3a[_0x3b6b('0x41')];if(!_0x42a7f9[_0x3b6b('0x3e')][_0x3b6b('0x45')](_0x3b6b('0x46'))){_0x55781d['limit']=qs[_0x3b6b('0x30')](_0x42a7f9['query'][_0x3b6b('0x30')]);_0x55781d[_0x3b6b('0x2f')]=qs[_0x3b6b('0x2f')](_0x42a7f9['query']['offset']);}_0x55781d[_0x3b6b('0x47')]=qs[_0x3b6b('0x48')](_0x42a7f9[_0x3b6b('0x3e')][_0x3b6b('0x48')]);_0x55781d[_0x3b6b('0x49')]=qs['filters'](_[_0x3b6b('0x4a')](_0x42a7f9['query'],_0x118d3a[_0x3b6b('0x4b')]),_0x161d37);if(_0x42a7f9[_0x3b6b('0x3e')][_0x3b6b('0x4c')]){_0x55781d[_0x3b6b('0x49')]=_['merge'](_0x55781d['where'],{'$or':_[_0x3b6b('0x38')](_0x161d37,function(_0x142a44){if(_0x142a44[_0x3b6b('0x4d')]!==_0x3b6b('0x4e')){var _0x5dabb0={};_0x5dabb0[_0x142a44['name']]={'$like':'%'+_0x42a7f9[_0x3b6b('0x3e')][_0x3b6b('0x4c')]+'%'};return _0x5dabb0;}})});}_0x55781d=_['merge']({},_0x55781d,_0x42a7f9[_0x3b6b('0x4f')]);var _0x4f5f30={'where':_0x55781d[_0x3b6b('0x49')]};return db[_0x3b6b('0x39')][_0x3b6b('0x2e')](_0x4f5f30)['then'](function(_0x2ddcad){_0x19819c[_0x3b6b('0x2e')]=_0x2ddcad;if(_0x42a7f9[_0x3b6b('0x3e')][_0x3b6b('0x50')]){_0x55781d[_0x3b6b('0x51')]=[{'all':!![]}];}return db[_0x3b6b('0x39')][_0x3b6b('0x52')](_0x55781d);})['then'](function(_0x41453a){_0x19819c[_0x3b6b('0x53')]=_0x41453a;return _0x19819c;})[_0x3b6b('0x20')](respondWithFilteredResult(_0xa98c7e,_0x55781d))[_0x3b6b('0x28')](handleError(_0xa98c7e,null));};exports['show']=function(_0x2d837d,_0x74159c){var _0x4036b8={'raw':!![],'where':{'id':_0x2d837d[_0x3b6b('0x54')]['id']}},_0x2ecee4={};_0x2ecee4[_0x3b6b('0x41')]=_[_0x3b6b('0x3f')](db['OpenchannelMessage'][_0x3b6b('0x3a')]);_0x2ecee4[_0x3b6b('0x3e')]=_[_0x3b6b('0x3f')](_0x2d837d['query']);_0x2ecee4['filters']=_['intersection'](_0x2ecee4['model'],_0x2ecee4[_0x3b6b('0x3e')]);_0x4036b8[_0x3b6b('0x42')]=_['intersection'](_0x2ecee4[_0x3b6b('0x41')],qs[_0x3b6b('0x43')](_0x2d837d[_0x3b6b('0x3e')][_0x3b6b('0x43')]));_0x4036b8[_0x3b6b('0x42')]=_0x4036b8[_0x3b6b('0x42')][_0x3b6b('0x44')]?_0x4036b8[_0x3b6b('0x42')]:_0x2ecee4[_0x3b6b('0x41')];if(_0x2d837d['query'][_0x3b6b('0x50')]){_0x4036b8['include']=[{'all':!![]}];}_0x4036b8=_[_0x3b6b('0x55')]({},_0x4036b8,_0x2d837d['options']);return db[_0x3b6b('0x39')][_0x3b6b('0x56')](_0x4036b8)[_0x3b6b('0x20')](handleEntityNotFound(_0x74159c,null))[_0x3b6b('0x20')](respondWithResult(_0x74159c,null))['catch'](handleError(_0x74159c,null));};exports[_0x3b6b('0x57')]=function(_0x44d031,_0xe7edce){return db['OpenchannelMessage']['create'](_0x44d031[_0x3b6b('0x58')],{})['then'](respondWithResult(_0xe7edce,0xc9))[_0x3b6b('0x28')](handleError(_0xe7edce,null));};exports['update']=function(_0x5e12ae,_0x2391cb){if(_0x5e12ae['body']['id']){delete _0x5e12ae[_0x3b6b('0x58')]['id'];}return db[_0x3b6b('0x39')]['find']({'where':{'id':_0x5e12ae['params']['id']}})[_0x3b6b('0x20')](handleEntityNotFound(_0x2391cb,null))[_0x3b6b('0x20')](saveUpdates(_0x5e12ae[_0x3b6b('0x58')],null))[_0x3b6b('0x20')](respondWithResult(_0x2391cb,null))[_0x3b6b('0x28')](handleError(_0x2391cb,null));};exports[_0x3b6b('0x35')]=function(_0x52553c,_0x136271){return db[_0x3b6b('0x39')]['find']({'where':{'id':_0x52553c[_0x3b6b('0x54')]['id']}})[_0x3b6b('0x20')](handleEntityNotFound(_0x136271,null))[_0x3b6b('0x20')](removeEntity(_0x136271,null))[_0x3b6b('0x28')](handleError(_0x136271,null));};exports[_0x3b6b('0x59')]=function(_0x13bb00,_0x20f167){return db['OpenchannelMessage'][_0x3b6b('0x59')]()[_0x3b6b('0x20')](respondWithResult(_0x20f167,null))[_0x3b6b('0x28')](handleError(_0x20f167,null));};var interaction_log=require(_0x3b6b('0x16'))('openchannel-interactions');exports[_0x3b6b('0x5a')]=function(_0x47db07,_0x453c84,_0x1360fd){var _0x1b3551={'agent':{},'channel':_0x3b6b('0x5b')};if(_0x47db07[_0x3b6b('0x58')]['id']){delete _0x47db07[_0x3b6b('0x58')]['id'];}_0x47db07['body'][_0x3b6b('0x5c')]=!![];_0x47db07[_0x3b6b('0x58')]['readAt']=moment()['format'](_0x3b6b('0x5d'));_0x47db07['body'][_0x3b6b('0x5e')]=_0x47db07['body'][_0x3b6b('0x5e')]||_0x47db07[_0x3b6b('0x5f')]['id'];_0x1b3551[_0x3b6b('0x60')]['id']=_0x47db07[_0x3b6b('0x58')][_0x3b6b('0x5e')];return db[_0x3b6b('0x39')]['find']({'where':{'id':_0x47db07['params']['id'],'UserId':null}})[_0x3b6b('0x20')](handleEntityNotFound(_0x453c84,null))[_0x3b6b('0x20')](saveUpdates(_0x47db07[_0x3b6b('0x58')],null))[_0x3b6b('0x20')](function(_0x813158){if(_0x813158){_0x1b3551[_0x3b6b('0x27')]=_0x813158[_0x3b6b('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0x3b6b('0x56')]({'where':{'id':_0x813158['OpenchannelInteractionId']}});}return null;})[_0x3b6b('0x20')](handleEntityNotFound(_0x453c84,null))[_0x3b6b('0x20')](function(_0x2815a6){if(_0x2815a6){return _0x2815a6['update']({'UserId':_0x47db07[_0x3b6b('0x58')]['UserId'],'read1stAt':_[_0x3b6b('0x62')](_0x2815a6[_0x3b6b('0x63')])?moment()[_0x3b6b('0x64')](_0x3b6b('0x5d')):undefined});}return null;})['then'](function(_0x305758){if(_0x305758){_0x1b3551[_0x3b6b('0x65')]=_0x305758['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47db07[_0x3b6b('0x5f')]['id'],_0x47db07[_0x3b6b('0x5f')][_0x3b6b('0x3d')],_0x47db07[_0x3b6b('0x5f')][_0x3b6b('0x66')],_0x1b3551[_0x3b6b('0x65')]['id'],_0x47db07[_0x3b6b('0x58')]?JSON[_0x3b6b('0x25')](_0x47db07['body']):_0x3b6b('0x67'));return respondWithRpcPromise(_0x3b6b('0x68'),_0x3b6b('0x69'),_0x1b3551);}return null;})[_0x3b6b('0x20')](function(_0xa18b68){var _0x40afee='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa18b68[_0x3b6b('0x27')][_0x3b6b('0x6a')];return db['sequelize']['query'](_0x40afee,{'type':db[_0x3b6b('0x6b')][_0x3b6b('0x6c')][_0x3b6b('0x6d')],'raw':!![]})[_0x3b6b('0x20')](function(_0x170cbe){return _0x170cbe;});})[_0x3b6b('0x20')](function(_0x35734e){if(_0x35734e){_0x1b3551[_0x3b6b('0x27')][_0x3b6b('0x6e')]=_0x35734e[0x0];if(!_0x47db07[_0x3b6b('0x58')][_0x3b6b('0x5e')])return;return db[_0x3b6b('0x6f')][_0x3b6b('0x56')]({'where':{'id':_0x47db07[_0x3b6b('0x58')][_0x3b6b('0x5e')],'role':'agent'},'attributes':['id',_0x3b6b('0x3d'),_0x3b6b('0x70'),_0x3b6b('0x71'),'internal'],'raw':!![]});}return null;})['then'](function(_0x557ff6){if(!_0x557ff6)return null;_0x1b3551[_0x3b6b('0x27')][_0x3b6b('0x60')]=_0x557ff6;return _0x1b3551;})['then'](function(_0x323705){if(_0x323705){if(_0x47db07[_0x3b6b('0x58')][_0x3b6b('0x72')]){_0x1b3551[_0x3b6b('0x27')][_0x3b6b('0x73')]=util[_0x3b6b('0x64')](_0x3b6b('0x74'),_0x47db07[_0x3b6b('0x5f')]['name']);_0x1b3551['message'][_0x3b6b('0x75')]=_0x1b3551[_0x3b6b('0x75')];_0x1b3551[_0x3b6b('0x27')]['motionChannel']=_0x1b3551[_0x3b6b('0x75')];_0x1b3551[_0x3b6b('0x27')]['event']=_0x3b6b('0x5a');return respondWithRpcPromise(_0x3b6b('0x76'),_0x3b6b('0x76'),{'event':_0x3b6b('0x77'),'message':_0x1b3551['message']},client9002)[_0x3b6b('0x20')](function(){return _0x1b3551;});}return _0x1b3551;}return null;})['then'](respondWithResult(_0x453c84,null))[_0x3b6b('0x28')](handleError(_0x453c84,null));};var interaction_log=require(_0x3b6b('0x16'))(_0x3b6b('0x78'));exports[_0x3b6b('0x32')]=function(_0x3762e0,_0x4b8af9,_0x641175){var _0x428ed8={'agent':{},'channel':_0x3b6b('0x5b')};if(_0x3762e0[_0x3b6b('0x58')]['id']){delete _0x3762e0[_0x3b6b('0x58')]['id'];}_0x3762e0['body'][_0x3b6b('0x5e')]=_0x3762e0[_0x3b6b('0x58')]['UserId']||_0x3762e0[_0x3b6b('0x5f')]['id'];_0x428ed8[_0x3b6b('0x60')]['id']=_0x3762e0[_0x3b6b('0x58')]['UserId'];return db[_0x3b6b('0x39')][_0x3b6b('0x56')]({'where':{'id':_0x3762e0[_0x3b6b('0x54')]['id'],'UserId':null}})[_0x3b6b('0x20')](handleEntityNotFound(_0x4b8af9,null))['then'](function(_0x17fb40){if(_0x17fb40){_0x428ed8['message']=_0x17fb40['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x3b6b('0x56')]({'where':{'id':_0x17fb40[_0x3b6b('0x79')]}});}return null;})[_0x3b6b('0x20')](handleEntityNotFound(_0x4b8af9,null))[_0x3b6b('0x20')](function(_0x1f2340){if(_0x1f2340){_0x428ed8[_0x3b6b('0x65')]=_0x1f2340[_0x3b6b('0x61')]({'plain':!![]});interaction_log[_0x3b6b('0x21')](_0x3b6b('0x7a'),_0x3762e0[_0x3b6b('0x5f')]['id'],_0x3762e0['user'][_0x3b6b('0x3d')],_0x3762e0[_0x3b6b('0x5f')]['role'],_0x428ed8['interaction']['id'],_0x3762e0[_0x3b6b('0x58')]?JSON[_0x3b6b('0x25')](_0x3762e0['body']):_0x3b6b('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x428ed8);}return null;})[_0x3b6b('0x20')](function(_0x130cb9){var _0x2979e6=_0x3b6b('0x7b')+_0x130cb9[_0x3b6b('0x27')][_0x3b6b('0x6a')];return db[_0x3b6b('0x7c')]['query'](_0x2979e6,{'type':db['Sequelize']['QueryTypes'][_0x3b6b('0x6d')],'raw':!![]})[_0x3b6b('0x20')](function(_0x20b155){return _0x20b155;});})[_0x3b6b('0x20')](function(_0x1ffeae){if(_0x1ffeae){_0x428ed8['message'][_0x3b6b('0x6e')]=_0x1ffeae[0x0];if(!_0x3762e0[_0x3b6b('0x58')][_0x3b6b('0x5e')])return;return db[_0x3b6b('0x6f')]['find']({'where':{'id':_0x3762e0[_0x3b6b('0x58')]['UserId'],'role':_0x3b6b('0x60')},'attributes':['id',_0x3b6b('0x3d'),_0x3b6b('0x70'),_0x3b6b('0x71'),_0x3b6b('0x7d')],'raw':!![]});}return null;})[_0x3b6b('0x20')](function(_0x234fe9){if(!_0x234fe9)return null;_0x428ed8[_0x3b6b('0x27')]['agent']=_0x234fe9;return _0x428ed8;})[_0x3b6b('0x20')](function(_0x41644d){if(_0x41644d){_0x41644d[_0x3b6b('0x27')][_0x3b6b('0x73')]=util[_0x3b6b('0x64')](_0x3b6b('0x74'),_0x3762e0['user'][_0x3b6b('0x3d')]);_0x41644d[_0x3b6b('0x27')][_0x3b6b('0x75')]=_0x428ed8[_0x3b6b('0x75')];_0x41644d[_0x3b6b('0x27')][_0x3b6b('0x7e')]=_0x428ed8[_0x3b6b('0x75')];_0x41644d[_0x3b6b('0x27')][_0x3b6b('0x7f')]=_0x3b6b('0x32');respondWithRpcPromise(_0x3b6b('0x76'),'EventManager',{'event':_0x3b6b('0x80'),'message':_0x41644d['message']},client9002);return _0x428ed8;}return null;})[_0x3b6b('0x20')](respondWithResult(_0x4b8af9,null))['catch'](handleError(_0x4b8af9,null));}; \ No newline at end of file +var _0x47c8=['destroy','end','stack','name','index','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','filter','options','findAll','show','params','include','find','create','body','describe','openchannel-interactions','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','read1stAt','format','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','agent','email','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','openchannel','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','User','fullname','internal','interface','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','sendStatus','status','json','offset','undefined','set','Content-Range','apply','reject','save','update','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x47c8,0x1cc));var _0x847c=function(_0x2e2c20,_0x560cf0){_0x2e2c20=_0x2e2c20-0x0;var _0x151be4=_0x47c8[_0x2e2c20];return _0x151be4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x847c('0x0'));var jsonpatch=require(_0x847c('0x1'));var rp=require(_0x847c('0x2'));var moment=require(_0x847c('0x3'));var BPromise=require(_0x847c('0x4'));var Mustache=require(_0x847c('0x5'));var util=require('util');var path=require(_0x847c('0x6'));var sox=require(_0x847c('0x7'));var csv=require(_0x847c('0x8'));var ejs=require(_0x847c('0x9'));var fs=require('fs');var fs_extra=require(_0x847c('0xa'));var _=require(_0x847c('0xb'));var squel=require('squel');var crypto=require(_0x847c('0xc'));var jsforce=require(_0x847c('0xd'));var deskjs=require(_0x847c('0xe'));var toCsv=require(_0x847c('0x8'));var querystring=require(_0x847c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x847c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x847c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x847c('0x12'))(_0x847c('0x13'));var utils=require(_0x847c('0x14'));var config=require(_0x847c('0x15'));var licenseUtil=require(_0x847c('0x16'));var db=require('../../mysqldb')['db'];config[_0x847c('0x17')]=_[_0x847c('0x18')](config[_0x847c('0x17')],{'host':_0x847c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x847c('0x17')]));require(_0x847c('0x1a'))[_0x847c('0x1b')](socket);var jayson=require(_0x847c('0x1c'));var client=jayson[_0x847c('0x1d')][_0x847c('0x1e')]({'port':0x232c});var client9002=jayson[_0x847c('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d4628,_0x5292ac,_0x3d335d,_0x16a548){return new BPromise(function(_0x2c612e,_0x1566ed){var _0xaa4e75=_0x16a548||client;return _0xaa4e75[_0x847c('0x1f')](_0x4d4628,_0x3d335d)['then'](function(_0x5101f4){logger['info'](_0x847c('0x20'),_0x5292ac,'request\x20sent');logger[_0x847c('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x5292ac,_0x847c('0x22'),JSON['stringify'](_0x5101f4));if(_0x5101f4[_0x847c('0x23')]){if(_0x5101f4[_0x847c('0x23')]['code']===0x1f4){logger[_0x847c('0x23')](_0x847c('0x20'),_0x5292ac,_0x5101f4['error'][_0x847c('0x24')]);return _0x1566ed(_0x5101f4[_0x847c('0x23')][_0x847c('0x24')]);}logger[_0x847c('0x23')](_0x847c('0x20'),_0x5292ac,_0x5101f4['error'][_0x847c('0x24')]);return _0x2c612e(_0x5101f4[_0x847c('0x23')][_0x847c('0x24')]);}else{logger[_0x847c('0x25')](_0x847c('0x20'),_0x5292ac,_0x847c('0x22'));_0x2c612e(_0x5101f4[_0x847c('0x26')][_0x847c('0x24')]);}})[_0x847c('0x27')](function(_0x39baab){logger[_0x847c('0x23')](_0x847c('0x20'),_0x5292ac,_0x39baab);_0x1566ed(_0x39baab);});});}function respondWithStatusCode(_0xcfe953,_0x4e1715){_0x4e1715=_0x4e1715||0xcc;return function(_0x41f665){if(_0x41f665){return _0xcfe953[_0x847c('0x28')](_0x4e1715);}return _0xcfe953[_0x847c('0x29')](_0x4e1715)['end']();};}function respondWithResult(_0x9f3a86,_0x29bc64){_0x29bc64=_0x29bc64||0xc8;return function(_0x1904ff){if(_0x1904ff){return _0x9f3a86[_0x847c('0x29')](_0x29bc64)[_0x847c('0x2a')](_0x1904ff);}};}function respondWithFilteredResult(_0x377d95,_0xf58eb7){return function(_0x1f2efc){if(_0x1f2efc){var _0x3d85a7=typeof _0xf58eb7[_0x847c('0x2b')]==='undefined'&&typeof _0xf58eb7['limit']===_0x847c('0x2c');var _0x261b84=_0x1f2efc['count'];var _0x463ce1=_0x3d85a7?0x0:_0xf58eb7[_0x847c('0x2b')];var _0x5b2b7e=_0x3d85a7?_0x1f2efc['count']:_0xf58eb7[_0x847c('0x2b')]+_0xf58eb7['limit'];var _0x49f0df;if(_0x5b2b7e>=_0x261b84){_0x5b2b7e=_0x261b84;_0x49f0df=0xc8;}else{_0x49f0df=0xce;}_0x377d95[_0x847c('0x29')](_0x49f0df);return _0x377d95[_0x847c('0x2d')](_0x847c('0x2e'),_0x463ce1+'-'+_0x5b2b7e+'/'+_0x261b84)[_0x847c('0x2a')](_0x1f2efc);}return null;};}function patchUpdates(_0x1806ef){return function(_0x43a649){try{jsonpatch[_0x847c('0x2f')](_0x43a649,_0x1806ef,!![]);}catch(_0x279b6e){return BPromise[_0x847c('0x30')](_0x279b6e);}return _0x43a649[_0x847c('0x31')]();};}function saveUpdates(_0x5d84ca,_0x46ced1){return function(_0x3e100a){if(_0x3e100a){return _0x3e100a[_0x847c('0x32')](_0x5d84ca)[_0x847c('0x33')](function(_0x1828f0){return _0x1828f0;});}return null;};}function removeEntity(_0x5c7271,_0x24202f){return function(_0x1e65ae){if(_0x1e65ae){return _0x1e65ae[_0x847c('0x34')]()[_0x847c('0x33')](function(){_0x5c7271[_0x847c('0x29')](0xcc)[_0x847c('0x35')]();});}};}function handleEntityNotFound(_0x2035b6,_0x1a7f79){return function(_0x3b9149){if(!_0x3b9149){_0x2035b6['sendStatus'](0x194);}return _0x3b9149;};}function handleError(_0x1d6ccd,_0xa4cfbe){_0xa4cfbe=_0xa4cfbe||0x1f4;return function(_0x41cb82){logger[_0x847c('0x23')](_0x41cb82[_0x847c('0x36')]);if(_0x41cb82[_0x847c('0x37')]){delete _0x41cb82['name'];}_0x1d6ccd[_0x847c('0x29')](_0xa4cfbe)['send'](_0x41cb82);};}exports[_0x847c('0x38')]=function(_0x2fefb3,_0x403c63){var _0x401ed3={},_0x49ea45={},_0x435ef8={'count':0x0,'rows':[]};var _0x2965f5=_['map'](db[_0x847c('0x39')][_0x847c('0x3a')],function(_0x7d3855){return{'name':_0x7d3855[_0x847c('0x3b')],'type':_0x7d3855[_0x847c('0x3c')]['key']};});_0x49ea45[_0x847c('0x3d')]=_['map'](_0x2965f5,_0x847c('0x37'));_0x49ea45[_0x847c('0x3e')]=_[_0x847c('0x3f')](_0x2fefb3[_0x847c('0x3e')]);_0x49ea45[_0x847c('0x40')]=_['intersection'](_0x49ea45['model'],_0x49ea45[_0x847c('0x3e')]);_0x401ed3['attributes']=_[_0x847c('0x41')](_0x49ea45[_0x847c('0x3d')],qs[_0x847c('0x42')](_0x2fefb3[_0x847c('0x3e')][_0x847c('0x42')]));_0x401ed3[_0x847c('0x43')]=_0x401ed3[_0x847c('0x43')][_0x847c('0x44')]?_0x401ed3[_0x847c('0x43')]:_0x49ea45[_0x847c('0x3d')];if(!_0x2fefb3[_0x847c('0x3e')][_0x847c('0x45')](_0x847c('0x46'))){_0x401ed3[_0x847c('0x47')]=qs['limit'](_0x2fefb3[_0x847c('0x3e')][_0x847c('0x47')]);_0x401ed3[_0x847c('0x2b')]=qs[_0x847c('0x2b')](_0x2fefb3[_0x847c('0x3e')][_0x847c('0x2b')]);}_0x401ed3[_0x847c('0x48')]=qs[_0x847c('0x49')](_0x2fefb3[_0x847c('0x3e')][_0x847c('0x49')]);_0x401ed3[_0x847c('0x4a')]=qs['filters'](_[_0x847c('0x4b')](_0x2fefb3['query'],_0x49ea45[_0x847c('0x40')]),_0x2965f5);if(_0x2fefb3[_0x847c('0x3e')]['filter']){_0x401ed3[_0x847c('0x4a')]=_[_0x847c('0x4c')](_0x401ed3[_0x847c('0x4a')],{'$or':_[_0x847c('0x4d')](_0x2965f5,function(_0x3528be){if(_0x3528be[_0x847c('0x3c')]!=='VIRTUAL'){var _0x1b064c={};_0x1b064c[_0x3528be['name']]={'$like':'%'+_0x2fefb3[_0x847c('0x3e')][_0x847c('0x4e')]+'%'};return _0x1b064c;}})});}_0x401ed3=_[_0x847c('0x4c')]({},_0x401ed3,_0x2fefb3[_0x847c('0x4f')]);var _0x46ab10={'where':_0x401ed3[_0x847c('0x4a')]};return db[_0x847c('0x39')]['count'](_0x46ab10)[_0x847c('0x33')](function(_0x2f6c64){_0x435ef8['count']=_0x2f6c64;if(_0x2fefb3['query']['includeAll']){_0x401ed3['include']=[{'all':!![]}];}return db[_0x847c('0x39')][_0x847c('0x50')](_0x401ed3);})['then'](function(_0x278c15){_0x435ef8['rows']=_0x278c15;return _0x435ef8;})[_0x847c('0x33')](respondWithFilteredResult(_0x403c63,_0x401ed3))[_0x847c('0x27')](handleError(_0x403c63,null));};exports[_0x847c('0x51')]=function(_0xe10aab,_0x4d42c5){var _0x41ed94={'raw':!![],'where':{'id':_0xe10aab[_0x847c('0x52')]['id']}},_0x4c20ab={};_0x4c20ab[_0x847c('0x3d')]=_[_0x847c('0x3f')](db[_0x847c('0x39')]['rawAttributes']);_0x4c20ab[_0x847c('0x3e')]=_[_0x847c('0x3f')](_0xe10aab[_0x847c('0x3e')]);_0x4c20ab[_0x847c('0x40')]=_[_0x847c('0x41')](_0x4c20ab[_0x847c('0x3d')],_0x4c20ab['query']);_0x41ed94[_0x847c('0x43')]=_[_0x847c('0x41')](_0x4c20ab[_0x847c('0x3d')],qs[_0x847c('0x42')](_0xe10aab[_0x847c('0x3e')][_0x847c('0x42')]));_0x41ed94[_0x847c('0x43')]=_0x41ed94[_0x847c('0x43')][_0x847c('0x44')]?_0x41ed94['attributes']:_0x4c20ab[_0x847c('0x3d')];if(_0xe10aab['query']['includeAll']){_0x41ed94[_0x847c('0x53')]=[{'all':!![]}];}_0x41ed94=_[_0x847c('0x4c')]({},_0x41ed94,_0xe10aab[_0x847c('0x4f')]);return db[_0x847c('0x39')][_0x847c('0x54')](_0x41ed94)[_0x847c('0x33')](handleEntityNotFound(_0x4d42c5,null))[_0x847c('0x33')](respondWithResult(_0x4d42c5,null))['catch'](handleError(_0x4d42c5,null));};exports[_0x847c('0x55')]=function(_0x5e57a9,_0x3c0d7e){return db[_0x847c('0x39')][_0x847c('0x55')](_0x5e57a9['body'],{})[_0x847c('0x33')](respondWithResult(_0x3c0d7e,0xc9))[_0x847c('0x27')](handleError(_0x3c0d7e,null));};exports['update']=function(_0x4562e5,_0x197541){if(_0x4562e5['body']['id']){delete _0x4562e5[_0x847c('0x56')]['id'];}return db['OpenchannelMessage'][_0x847c('0x54')]({'where':{'id':_0x4562e5[_0x847c('0x52')]['id']}})['then'](handleEntityNotFound(_0x197541,null))['then'](saveUpdates(_0x4562e5[_0x847c('0x56')],null))[_0x847c('0x33')](respondWithResult(_0x197541,null))['catch'](handleError(_0x197541,null));};exports['destroy']=function(_0x230b23,_0x366ab5){return db['OpenchannelMessage'][_0x847c('0x54')]({'where':{'id':_0x230b23[_0x847c('0x52')]['id']}})[_0x847c('0x33')](handleEntityNotFound(_0x366ab5,null))[_0x847c('0x33')](removeEntity(_0x366ab5,null))[_0x847c('0x27')](handleError(_0x366ab5,null));};exports[_0x847c('0x57')]=function(_0x3dcc50,_0x10edf5){return db['OpenchannelMessage'][_0x847c('0x57')]()[_0x847c('0x33')](respondWithResult(_0x10edf5,null))[_0x847c('0x27')](handleError(_0x10edf5,null));};var interaction_log=require(_0x847c('0x12'))(_0x847c('0x58'));exports['accept']=function(_0x11577b,_0xc0887c,_0x60f6af){var _0x289238={'agent':{},'channel':'openchannel'};if(_0x11577b['body']['id']){delete _0x11577b[_0x847c('0x56')]['id'];}_0x11577b['body'][_0x847c('0x59')]=!![];_0x11577b[_0x847c('0x56')]['readAt']=moment()['format'](_0x847c('0x5a'));_0x11577b['body'][_0x847c('0x5b')]=_0x11577b[_0x847c('0x56')][_0x847c('0x5b')]||_0x11577b[_0x847c('0x5c')]['id'];_0x289238['agent']['id']=_0x11577b[_0x847c('0x56')][_0x847c('0x5b')];return db['OpenchannelMessage']['find']({'where':{'id':_0x11577b[_0x847c('0x52')]['id'],'UserId':null}})[_0x847c('0x33')](handleEntityNotFound(_0xc0887c,null))[_0x847c('0x33')](saveUpdates(_0x11577b[_0x847c('0x56')],null))['then'](function(_0x2c6741){if(_0x2c6741){_0x289238['message']=_0x2c6741[_0x847c('0x5d')]({'plain':!![]});return db['OpenchannelInteraction'][_0x847c('0x54')]({'where':{'id':_0x2c6741[_0x847c('0x5e')]}});}return null;})[_0x847c('0x33')](handleEntityNotFound(_0xc0887c,null))[_0x847c('0x33')](function(_0x15b719){if(_0x15b719){return _0x15b719[_0x847c('0x32')]({'UserId':_0x11577b[_0x847c('0x56')]['UserId'],'read1stAt':_['isNil'](_0x15b719[_0x847c('0x5f')])?moment()[_0x847c('0x60')](_0x847c('0x5a')):undefined});}return null;})[_0x847c('0x33')](function(_0x1efd16){if(_0x1efd16){_0x289238[_0x847c('0x61')]=_0x1efd16[_0x847c('0x5d')]({'plain':!![]});interaction_log[_0x847c('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11577b[_0x847c('0x5c')]['id'],_0x11577b['user']['name'],_0x11577b[_0x847c('0x5c')][_0x847c('0x62')],_0x289238[_0x847c('0x61')]['id'],_0x11577b[_0x847c('0x56')]?JSON[_0x847c('0x63')](_0x11577b[_0x847c('0x56')]):_0x847c('0x64'));return respondWithRpcPromise(_0x847c('0x65'),_0x847c('0x66'),_0x289238);}return null;})['then'](function(_0x50fa8b){var _0x4ad17c=_0x847c('0x67')+_0x50fa8b['message'][_0x847c('0x68')];return db[_0x847c('0x69')][_0x847c('0x3e')](_0x4ad17c,{'type':db['Sequelize'][_0x847c('0x6a')][_0x847c('0x6b')],'raw':!![]})['then'](function(_0x60dce1){return _0x60dce1;});})[_0x847c('0x33')](function(_0x50b3c0){if(_0x50b3c0){_0x289238[_0x847c('0x24')]['contact']=_0x50b3c0[0x0];if(!_0x11577b[_0x847c('0x56')][_0x847c('0x5b')])return;return db['User'][_0x847c('0x54')]({'where':{'id':_0x11577b[_0x847c('0x56')][_0x847c('0x5b')],'role':_0x847c('0x6c')},'attributes':['id',_0x847c('0x37'),'fullname',_0x847c('0x6d'),'internal'],'raw':!![]});}return null;})[_0x847c('0x33')](function(_0x3f14cf){if(!_0x3f14cf)return null;_0x289238[_0x847c('0x24')][_0x847c('0x6c')]=_0x3f14cf;return _0x289238;})[_0x847c('0x33')](function(_0x27a9f2){if(_0x27a9f2){if(_0x11577b[_0x847c('0x56')][_0x847c('0x6e')]){_0x289238['message']['interface']=util['format'](_0x847c('0x6f'),_0x11577b[_0x847c('0x5c')][_0x847c('0x37')]);_0x289238[_0x847c('0x24')][_0x847c('0x70')]=_0x289238[_0x847c('0x70')];_0x289238[_0x847c('0x24')][_0x847c('0x71')]=_0x289238['channel'];_0x289238[_0x847c('0x24')][_0x847c('0x72')]=_0x847c('0x73');return respondWithRpcPromise('EventManager',_0x847c('0x74'),{'event':_0x847c('0x75'),'message':_0x289238[_0x847c('0x24')]},client9002)[_0x847c('0x33')](function(){return _0x289238;});}return _0x289238;}return null;})[_0x847c('0x33')](respondWithResult(_0xc0887c,null))[_0x847c('0x27')](handleError(_0xc0887c,null));};var interaction_log=require(_0x847c('0x12'))(_0x847c('0x58'));exports[_0x847c('0x30')]=function(_0x163d6b,_0x3eae38,_0x4d7204){var _0x34118e={'agent':{},'channel':_0x847c('0x76')};if(_0x163d6b[_0x847c('0x56')]['id']){delete _0x163d6b['body']['id'];}_0x163d6b[_0x847c('0x56')][_0x847c('0x5b')]=_0x163d6b[_0x847c('0x56')]['UserId']||_0x163d6b[_0x847c('0x5c')]['id'];_0x34118e['agent']['id']=_0x163d6b['body'][_0x847c('0x5b')];return db['OpenchannelMessage']['find']({'where':{'id':_0x163d6b[_0x847c('0x52')]['id'],'UserId':null}})[_0x847c('0x33')](handleEntityNotFound(_0x3eae38,null))[_0x847c('0x33')](function(_0x54566d){if(_0x54566d){_0x34118e[_0x847c('0x24')]=_0x54566d['get']({'plain':!![]});return db[_0x847c('0x77')][_0x847c('0x54')]({'where':{'id':_0x54566d['OpenchannelInteractionId']}});}return null;})[_0x847c('0x33')](handleEntityNotFound(_0x3eae38,null))[_0x847c('0x33')](function(_0x816a45){if(_0x816a45){_0x34118e['interaction']=_0x816a45[_0x847c('0x5d')]({'plain':!![]});interaction_log[_0x847c('0x25')](_0x847c('0x78'),_0x163d6b['user']['id'],_0x163d6b[_0x847c('0x5c')]['name'],_0x163d6b['user'][_0x847c('0x62')],_0x34118e['interaction']['id'],_0x163d6b[_0x847c('0x56')]?JSON[_0x847c('0x63')](_0x163d6b[_0x847c('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0x847c('0x79'),_0x34118e);}return null;})[_0x847c('0x33')](function(_0x3d87bc){var _0x4427f2=_0x847c('0x67')+_0x3d87bc['message'][_0x847c('0x68')];return db[_0x847c('0x69')][_0x847c('0x3e')](_0x4427f2,{'type':db[_0x847c('0x7a')][_0x847c('0x6a')][_0x847c('0x6b')],'raw':!![]})[_0x847c('0x33')](function(_0x530ed8){return _0x530ed8;});})[_0x847c('0x33')](function(_0xf52dcd){if(_0xf52dcd){_0x34118e[_0x847c('0x24')]['contact']=_0xf52dcd[0x0];if(!_0x163d6b[_0x847c('0x56')][_0x847c('0x5b')])return;return db[_0x847c('0x7b')][_0x847c('0x54')]({'where':{'id':_0x163d6b[_0x847c('0x56')][_0x847c('0x5b')],'role':_0x847c('0x6c')},'attributes':['id',_0x847c('0x37'),_0x847c('0x7c'),_0x847c('0x6d'),_0x847c('0x7d')],'raw':!![]});}return null;})[_0x847c('0x33')](function(_0xaca41b){if(!_0xaca41b)return null;_0x34118e[_0x847c('0x24')][_0x847c('0x6c')]=_0xaca41b;return _0x34118e;})[_0x847c('0x33')](function(_0x4a57ed){if(_0x4a57ed){_0x4a57ed['message'][_0x847c('0x7e')]=util['format'](_0x847c('0x6f'),_0x163d6b['user'][_0x847c('0x37')]);_0x4a57ed['message'][_0x847c('0x70')]=_0x34118e[_0x847c('0x70')];_0x4a57ed['message'][_0x847c('0x71')]=_0x34118e[_0x847c('0x70')];_0x4a57ed[_0x847c('0x24')][_0x847c('0x72')]=_0x847c('0x30');respondWithRpcPromise(_0x847c('0x74'),_0x847c('0x74'),{'event':_0x847c('0x7f'),'message':_0x4a57ed[_0x847c('0x24')]},client9002);return _0x34118e;}return null;})[_0x847c('0x33')](respondWithResult(_0x3eae38,null))[_0x847c('0x27')](handleError(_0x3eae38,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index dff5a59..99ca900 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 _0xb3a5=['exports','events','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x9c80f6,_0x313ad6){var _0x5a237b=function(_0x439137){while(--_0x439137){_0x9c80f6['push'](_0x9c80f6['shift']());}};_0x5a237b(++_0x313ad6);}(_0xb3a5,0x17d));var _0x5b3a=function(_0x1a4ab0,_0x3a4457){_0x1a4ab0=_0x1a4ab0-0x0;var _0x2610e4=_0xb3a5[_0x1a4ab0];return _0x2610e4;};'use strict';var EventEmitter=require(_0x5b3a('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x5b3a('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5b3a('0x2')](0x0);var events={'afterCreate':_0x5b3a('0x3'),'afterUpdate':_0x5b3a('0x4'),'afterDestroy':_0x5b3a('0x5')};function emitEvent(_0x46a506){return function(_0x5ea987,_0x3a4566,_0x2e4acf){OpenchannelMessageEvents[_0x5b3a('0x6')](_0x46a506+':'+_0x5ea987['id'],_0x5ea987);OpenchannelMessageEvents[_0x5b3a('0x6')](_0x46a506,_0x5ea987);_0x2e4acf(null);};}for(var e in events){if(events[_0x5b3a('0x7')](e)){var event=events[e];OpenchannelMessage[_0x5b3a('0x8')](e,emitEvent(event));}}module[_0x5b3a('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x4b07=['emit','hasOwnProperty','hook','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x1ce25a,_0x46b990){var _0x5c6db8=function(_0x7cea){while(--_0x7cea){_0x1ce25a['push'](_0x1ce25a['shift']());}};_0x5c6db8(++_0x46b990);}(_0x4b07,0x16b));var _0x74b0=function(_0x29ccdd,_0x4f3d58){_0x29ccdd=_0x29ccdd-0x0;var _0x192ad4=_0x4b07[_0x29ccdd];return _0x192ad4;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x74b0('0x0'))['db'][_0x74b0('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x74b0('0x2')](0x0);var events={'afterCreate':_0x74b0('0x3'),'afterUpdate':_0x74b0('0x4'),'afterDestroy':_0x74b0('0x5')};function emitEvent(_0x261661){return function(_0x116cbb,_0x733dc8,_0x2869b6){OpenchannelMessageEvents[_0x74b0('0x6')](_0x261661+':'+_0x116cbb['id'],_0x116cbb);OpenchannelMessageEvents['emit'](_0x261661,_0x116cbb);_0x2869b6(null);};}for(var e in events){if(events[_0x74b0('0x7')](e)){var event=events[e];OpenchannelMessage[_0x74b0('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index a600b45..96ef166 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 _0x9166=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','openchannel_messages','fti_openchannel_messages','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','CmContact','describe','then','OpenchannelAccount','find','keys','get','info','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Contact','method','POST','body','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x9166,0x196));var _0x6916=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0x9166[_0x1e1020];return _0x464719;};'use strict';var _=require('lodash');var util=require(_0x6916('0x0'));var logger=require(_0x6916('0x1'))(_0x6916('0x2'));var moment=require(_0x6916('0x3'));var BPromise=require(_0x6916('0x4'));var rp=require(_0x6916('0x5'));var fs=require('fs');var path=require(_0x6916('0x6'));var rimraf=require(_0x6916('0x7'));var config=require(_0x6916('0x8'));var attributes=require(_0x6916('0x9'));module['exports']=function(_0x397a1c,_0x2195cd){return _0x397a1c[_0x6916('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x6916('0xb'),'paranoid':![],'indexes':[{'name':_0x6916('0xc'),'fields':['body'],'type':_0x6916('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7e6802,_0x389d2c,_0x4cfacc){var _0x31251e=_0x397a1c['models'];var _0x391557=_0x7e6802['get']({'plain':!![]});if(_0x391557[_0x6916('0xe')][_0x6916('0xf')]()==='in'||_0x391557[_0x6916('0xe')]['toLowerCase']()===_0x6916('0x10')&&!_0x391557[_0x6916('0x11')]&&!_[_0x6916('0x12')](_0x391557[_0x6916('0x13')])){_0x31251e[_0x6916('0x14')][_0x6916('0x15')]({'where':{'id':_0x391557[_0x6916('0x16')]}})['then'](function(_0x493822){if(_0x493822){_0x493822[_0x6916('0x17')]({'lastMsgAt':_0x391557[_0x6916('0x18')],'lastMsgDirection':_0x391557['direction'][_0x6916('0xf')]()});}})[_0x6916('0x19')](function(_0x5f57ad){console[_0x6916('0x1a')](_0x5f57ad);});}if(_0x391557[_0x6916('0xe')]===_0x6916('0x10')&&!_0x391557[_0x6916('0x11')]){var _0x2e12f6;_0x31251e[_0x6916('0x1b')][_0x6916('0x1c')]()[_0x6916('0x1d')](function(_0x3fbc0b){return _0x31251e[_0x6916('0x1e')][_0x6916('0x1f')]({'where':{'id':_0x391557['OpenchannelAccountId']},'include':[{'model':_0x31251e[_0x6916('0x14')],'as':'Interactions','where':{'id':_0x391557[_0x6916('0x16')]},'limit':0x1,'include':[{'model':_0x31251e[_0x6916('0x1b')],'as':'Contact','attributes':_[_0x6916('0x20')](_0x3fbc0b)}]}]});})[_0x6916('0x1d')](function(_0x3446e1){_0x2e12f6=_0x3446e1[_0x6916('0x21')]({'plain':!![]});if(_0x2e12f6&&_0x2e12f6['replyUri']){logger[_0x6916('0x22')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x6916('0x23'),_0x391557['id'],_0x2e12f6[_0x6916('0x24')]));if(_0x2e12f6[_0x6916('0x25')]&&_0x2e12f6[_0x6916('0x25')][_0x6916('0x26')]){_0x391557['Interaction']=_['omit'](_0x2e12f6[_0x6916('0x25')][0x0],'Contact');_0x391557['Contact']=_0x2e12f6[_0x6916('0x25')][0x0][_0x6916('0x27')];}var _0x389d2c={'method':'POST','uri':encodeURI(_0x2e12f6[_0x6916('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x389d2c[_0x6916('0x28')]){case'GET':_0x389d2c['qs']=_0x391557;break;case _0x6916('0x29'):_0x389d2c[_0x6916('0x2a')]=_0x391557;break;}return rp(_0x389d2c)[_0x6916('0x1d')](function(_0xb8460e){logger['info'](_0x6916('0x2b'),_0x6916('0x2c'),util['format'](_0x6916('0x2d'),_0x391557['id'],_0x2e12f6[_0x6916('0x24')]));if(_0xb8460e[_0x6916('0x2a')][_0x6916('0x2e')]&&_0xb8460e[_0x6916('0x2a')][_0x6916('0x2e')]!=_0x391557[_0x6916('0x2f')][_0x6916('0x2e')]){return _0x31251e['OpenchannelInteraction'][_0x6916('0x17')]({'threadId':_0xb8460e[_0x6916('0x2a')][_0x6916('0x2e')]},{'where':{'id':_0x391557[_0x6916('0x2f')]['id']}});}else{return;}})[_0x6916('0x1d')](function(){return _0x7e6802[_0x6916('0x17')]({'read':!![]});})[_0x6916('0x19')](function(_0x23c274){logger[_0x6916('0x1a')](_0x6916('0x2b'),_0x6916('0x2c'),util['inspect'](_0x23c274,{'showHidden':![],'depth':null}));_0x4cfacc();});}else{_0x4cfacc();}})[_0x6916('0x30')](function(){_0x4cfacc();});}else{_0x4cfacc();}}},'charset':_0x6916('0x31'),'collate':_0x6916('0x32')});}; \ No newline at end of file +var _0x8422=['update','afterCreate','inspect','finally','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','catch','error','CmContact','describe','find','OpenchannelAccountId','keys','then','info','OpenchannelMessage,\x20%s,\x20%s','format','Interactions','Interaction','Contact','POST','replyUri','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId'];(function(_0x1b0d6a,_0x41ad9d){var _0x17950e=function(_0x29e2e8){while(--_0x29e2e8){_0x1b0d6a['push'](_0x1b0d6a['shift']());}};_0x17950e(++_0x41ad9d);}(_0x8422,0x137));var _0x2842=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8422[_0x29b609];return _0x54c952;};'use strict';var _=require('lodash');var util=require(_0x2842('0x0'));var logger=require(_0x2842('0x1'))(_0x2842('0x2'));var moment=require(_0x2842('0x3'));var BPromise=require(_0x2842('0x4'));var rp=require(_0x2842('0x5'));var fs=require('fs');var path=require(_0x2842('0x6'));var rimraf=require(_0x2842('0x7'));var config=require(_0x2842('0x8'));var attributes=require(_0x2842('0x9'));module[_0x2842('0xa')]=function(_0x330a22,_0x5f114d){return _0x330a22[_0x2842('0xb')](_0x2842('0xc'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x2842('0xd'),'fields':[_0x2842('0xe')],'type':_0x2842('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x274f94,_0x463ca8,_0x580311){var _0x219ff3=_0x330a22[_0x2842('0x10')];var _0x32d18b=_0x274f94['get']({'plain':!![]});if(_0x32d18b[_0x2842('0x11')][_0x2842('0x12')]()==='in'||_0x32d18b[_0x2842('0x11')][_0x2842('0x12')]()===_0x2842('0x13')&&!_0x32d18b[_0x2842('0x14')]&&!_[_0x2842('0x15')](_0x32d18b[_0x2842('0x16')])){_0x219ff3[_0x2842('0x17')][_0x2842('0x18')]({'where':{'id':_0x32d18b[_0x2842('0x19')]}})['then'](function(_0x7f6e05){if(_0x7f6e05){_0x7f6e05['update']({'lastMsgAt':_0x32d18b['createdAt'],'lastMsgDirection':_0x32d18b[_0x2842('0x11')][_0x2842('0x12')]()});}})[_0x2842('0x1a')](function(_0x39a904){console[_0x2842('0x1b')](_0x39a904);});}if(_0x32d18b[_0x2842('0x11')]===_0x2842('0x13')&&!_0x32d18b[_0x2842('0x14')]){var _0x2b2e59;_0x219ff3[_0x2842('0x1c')][_0x2842('0x1d')]()['then'](function(_0x4eb722){return _0x219ff3['OpenchannelAccount'][_0x2842('0x1e')]({'where':{'id':_0x32d18b[_0x2842('0x1f')]},'include':[{'model':_0x219ff3['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x32d18b['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x219ff3[_0x2842('0x1c')],'as':'Contact','attributes':_[_0x2842('0x20')](_0x4eb722)}]}]});})[_0x2842('0x21')](function(_0x5acf80){_0x2b2e59=_0x5acf80['get']({'plain':!![]});if(_0x2b2e59&&_0x2b2e59['replyUri']){logger[_0x2842('0x22')](_0x2842('0x23'),'afterCreate',util[_0x2842('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x32d18b['id'],_0x2b2e59['replyUri']));if(_0x2b2e59[_0x2842('0x25')]&&_0x2b2e59[_0x2842('0x25')]['length']){_0x32d18b[_0x2842('0x26')]=_['omit'](_0x2b2e59[_0x2842('0x25')][0x0],_0x2842('0x27'));_0x32d18b['Contact']=_0x2b2e59[_0x2842('0x25')][0x0]['Contact'];}var _0x463ca8={'method':_0x2842('0x28'),'uri':encodeURI(_0x2b2e59[_0x2842('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x463ca8[_0x2842('0x2a')]){case _0x2842('0x2b'):_0x463ca8['qs']=_0x32d18b;break;case _0x2842('0x28'):_0x463ca8['body']=_0x32d18b;break;}return rp(_0x463ca8)[_0x2842('0x21')](function(_0x534ebc){logger['info'](_0x2842('0x23'),'afterCreate',util[_0x2842('0x24')](_0x2842('0x2c'),_0x32d18b['id'],_0x2b2e59[_0x2842('0x29')]));if(_0x534ebc['body'][_0x2842('0x2d')]&&_0x534ebc[_0x2842('0xe')][_0x2842('0x2d')]!=_0x32d18b['Interaction'][_0x2842('0x2d')]){return _0x219ff3[_0x2842('0x17')]['update']({'threadId':_0x534ebc[_0x2842('0xe')]['threadId']},{'where':{'id':_0x32d18b['Interaction']['id']}});}else{return;}})[_0x2842('0x21')](function(){return _0x274f94[_0x2842('0x2e')]({'read':!![]});})['catch'](function(_0x2299e3){logger[_0x2842('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x2842('0x2f'),util[_0x2842('0x30')](_0x2299e3,{'showHidden':![],'depth':null}));_0x580311();});}else{_0x580311();}})[_0x2842('0x31')](function(){_0x580311();});}else{_0x580311();}}},'charset':_0x2842('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 a831b85..e600e30 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x345f4d,_0x565bb4){var _0x32a76d=function(_0x566fb4){while(--_0x566fb4){_0x345f4d['push'](_0x345f4d['shift']());}};_0x32a76d(++_0x565bb4);}(_0x1261,0x144));var _0x1126=function(_0x234ce7,_0x3e909c){_0x234ce7=_0x234ce7-0x0;var _0x57c561=_0x1261[_0x234ce7];return _0x57c561;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _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(_0x2ba054,_0x4cfa79){var _0x5d2153=function(_0xd698b4){while(--_0xd698b4){_0x2ba054['push'](_0x2ba054['shift']());}};_0x5d2153(++_0x4cfa79);}(_0xdb28,0x106));var _0x8db2=function(_0x299448,_0x15e0ea){_0x299448=_0x299448-0x0;var _0x243f7f=_0xdb28[_0x299448];return _0x243f7f;};'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 4ef8aeb..e1f3854 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 _0xa6bb=['save','remove','update','removeListener','register','length'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xa6bb,0x12c));var _0xba6b=function(_0x402f80,_0x52db2e){_0x402f80=_0x402f80-0x0;var _0x5ea81b=_0xa6bb[_0x402f80];return _0x5ea81b;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xba6b('0x0'),_0xba6b('0x1'),_0xba6b('0x2')];function createListener(_0x418373,_0x112efb){return function(_0x5f29e1){_0x112efb['emit'](_0x418373,_0x5f29e1);};}function removeListener(_0x5d1f87,_0x17e34b){return function(){OpenchannelMessageEvents[_0xba6b('0x3')](_0x5d1f87,_0x17e34b);};}exports[_0xba6b('0x4')]=function(_0x517d10){for(var _0x4cc381=0x0,_0x2a00d6=events[_0xba6b('0x5')];_0x4cc381<_0x2a00d6;_0x4cc381++){var _0x2f305e=events[_0x4cc381];var _0x5506d6=createListener('openchannelMessage:'+_0x2f305e,_0x517d10);OpenchannelMessageEvents['on'](_0x2f305e,_0x5506d6);}}; \ No newline at end of file +var _0xb353=['emit','removeListener','register','length','./openchannelMessage.events','save','remove'];(function(_0x5343b2,_0x3489ab){var _0x113bd3=function(_0x2a7776){while(--_0x2a7776){_0x5343b2['push'](_0x5343b2['shift']());}};_0x113bd3(++_0x3489ab);}(_0xb353,0xdd));var _0x3b35=function(_0x3c0f74,_0x38cce1){_0x3c0f74=_0x3c0f74-0x0;var _0x595116=_0xb353[_0x3c0f74];return _0x595116;};'use strict';var OpenchannelMessageEvents=require(_0x3b35('0x0'));var events=[_0x3b35('0x1'),_0x3b35('0x2'),'update'];function createListener(_0x72e594,_0xf793dd){return function(_0x263555){_0xf793dd[_0x3b35('0x3')](_0x72e594,_0x263555);};}function removeListener(_0x22509f,_0x172980){return function(){OpenchannelMessageEvents[_0x3b35('0x4')](_0x22509f,_0x172980);};}exports[_0x3b35('0x5')]=function(_0x4e3bbe){for(var _0x28638f=0x0,_0x48611f=events[_0x3b35('0x6')];_0x28638f<_0x48611f;_0x28638f++){var _0x37d4c9=events[_0x28638f];var _0x16a7c9=createListener('openchannelMessage:'+_0x37d4c9,_0x4e3bbe);OpenchannelMessageEvents['on'](_0x37d4c9,_0x16a7c9);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 1fbb2c3..9348464 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 _0x40ab=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x40ab,0xed));var _0xb40a=function(_0x5aacbf,_0x2e486f){_0x5aacbf=_0x5aacbf-0x0;var _0x4fd790=_0x40ab[_0x5aacbf];return _0x4fd790;};'use strict';var multer=require(_0xb40a('0x0'));var util=require('util');var path=require(_0xb40a('0x1'));var timeout=require(_0xb40a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb40a('0x3'));var auth=require(_0xb40a('0x4'));var interaction=require(_0xb40a('0x5'));var config=require(_0xb40a('0x6'));var controller=require('./openchannelQueue.controller');router[_0xb40a('0x7')]('/',auth[_0xb40a('0x8')](),controller[_0xb40a('0x9')]);router[_0xb40a('0x7')]('/describe',auth[_0xb40a('0x8')](),controller[_0xb40a('0xa')]);router['get'](_0xb40a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb40a('0x7')]('/:id/members',auth[_0xb40a('0x8')](),controller[_0xb40a('0xc')]);router['get'](_0xb40a('0xd'),auth[_0xb40a('0x8')](),controller[_0xb40a('0xe')]);router[_0xb40a('0x7')](_0xb40a('0xf'),auth[_0xb40a('0x8')](),controller[_0xb40a('0x10')]);router[_0xb40a('0x11')]('/',auth[_0xb40a('0x8')](),controller['create']);router[_0xb40a('0x11')](_0xb40a('0xd'),auth[_0xb40a('0x8')](),controller[_0xb40a('0x12')]);router[_0xb40a('0x11')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0xb40a('0x8')](),controller[_0xb40a('0x13')]);router[_0xb40a('0x14')](_0xb40a('0xb'),auth['isAuthenticated'](),controller[_0xb40a('0x15')]);router[_0xb40a('0x14')](_0xb40a('0xd'),auth[_0xb40a('0x8')](),controller['removeTeams']);router[_0xb40a('0x14')](_0xb40a('0xf'),auth['isAuthenticated'](),controller[_0xb40a('0x16')]);module[_0xb40a('0x17')]=router; \ No newline at end of file +var _0x7d54=['update','delete','destroy','removeTeams','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','/describe','describe','get','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','create','addTeams','post','put'];(function(_0x3a7cf7,_0x51661){var _0x1f040c=function(_0x566236){while(--_0x566236){_0x3a7cf7['push'](_0x3a7cf7['shift']());}};_0x1f040c(++_0x51661);}(_0x7d54,0x1b4));var _0x47d5=function(_0x11238d,_0x499ac8){_0x11238d=_0x11238d-0x0;var _0x3686b0=_0x7d54[_0x11238d];return _0x3686b0;};'use strict';var multer=require(_0x47d5('0x0'));var util=require(_0x47d5('0x1'));var path=require(_0x47d5('0x2'));var timeout=require(_0x47d5('0x3'));var express=require('express');var router=express[_0x47d5('0x4')]();var fs_extra=require(_0x47d5('0x5'));var auth=require(_0x47d5('0x6'));var interaction=require(_0x47d5('0x7'));var config=require('../../config/environment');var controller=require(_0x47d5('0x8'));router['get']('/',auth[_0x47d5('0x9')](),controller['index']);router['get'](_0x47d5('0xa'),auth[_0x47d5('0x9')](),controller[_0x47d5('0xb')]);router[_0x47d5('0xc')](_0x47d5('0xd'),auth[_0x47d5('0x9')](),controller[_0x47d5('0xe')]);router[_0x47d5('0xc')]('/:id/members',auth[_0x47d5('0x9')](),controller[_0x47d5('0xf')]);router[_0x47d5('0xc')](_0x47d5('0x10'),auth[_0x47d5('0x9')](),controller[_0x47d5('0x11')]);router[_0x47d5('0xc')](_0x47d5('0x12'),auth[_0x47d5('0x9')](),controller['getAgents']);router['post']('/',auth[_0x47d5('0x9')](),controller[_0x47d5('0x13')]);router['post'](_0x47d5('0x10'),auth[_0x47d5('0x9')](),controller[_0x47d5('0x14')]);router[_0x47d5('0x15')](_0x47d5('0x12'),auth[_0x47d5('0x9')](),controller['addAgents']);router[_0x47d5('0x16')](_0x47d5('0xd'),auth[_0x47d5('0x9')](),controller[_0x47d5('0x17')]);router[_0x47d5('0x18')](_0x47d5('0xd'),auth[_0x47d5('0x9')](),controller[_0x47d5('0x19')]);router[_0x47d5('0x18')](_0x47d5('0x10'),auth[_0x47d5('0x9')](),controller[_0x47d5('0x1a')]);router[_0x47d5('0x18')](_0x47d5('0x12'),auth[_0x47d5('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index d2a36e7..2ae82e7 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 _0xec42=['roundrobin','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0xdd9bba,_0x2e6c98){var _0x39c164=function(_0xe5ccdd){while(--_0xe5ccdd){_0xdd9bba['push'](_0xdd9bba['shift']());}};_0x39c164(++_0x2e6c98);}(_0xec42,0x1a5));var _0x2ec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec42[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2ec4('0x0'));module[_0x2ec4('0x1')]={'name':{'type':Sequelize[_0x2ec4('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2ec4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2ec4('0x3')](_0x2ec4('0x4'),'beepall',_0x2ec4('0x5'))}}; \ No newline at end of file +var _0x759e=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x173e65,_0x24a8bf){var _0x37d496=function(_0x34b441){while(--_0x34b441){_0x173e65['push'](_0x173e65['shift']());}};_0x37d496(++_0x24a8bf);}(_0x759e,0x1cd));var _0xe759=function(_0x5f4448,_0x266c9b){_0x5f4448=_0x5f4448-0x0;var _0x590c99=_0x759e[_0x5f4448];return _0x590c99;};'use strict';var Sequelize=require(_0xe759('0x0'));module[_0xe759('0x1')]={'name':{'type':Sequelize[_0xe759('0x2')],'unique':_0xe759('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe759('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe759('0x4')](_0xe759('0x5'),_0xe759('0x6'),_0xe759('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4cc1be6..57d8556 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 _0xead4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','then','get','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','type','VIRTUAL','filter','merge','options','rows','params','length','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','getMembers','findOne','pick','User','findAndCountAll','agent','openchannelPause','%s/%s','createdAt','updatedAt','Team','getTeams','nolimit','ids','findAll','Agents','online','voicePause','interface','transaction','addTeams','findOrCreate','select','field','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','sequelize','toString','QueryTypes','SELECT','every','includes','all','value','removeTeams','isEmpty','removeAgents','forEach','emit','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x46806e,_0x5e28ed){var _0x333def=function(_0x31e7b7){while(--_0x31e7b7){_0x46806e['push'](_0x46806e['shift']());}};_0x333def(++_0x5e28ed);}(_0xead4,0x107));var _0x4ead=function(_0x5e4c6d,_0x171c39){_0x5e4c6d=_0x5e4c6d-0x0;var _0xe23a07=_0xead4[_0x5e4c6d];return _0xe23a07;};'use strict';var emlformat=require(_0x4ead('0x0'));var rimraf=require(_0x4ead('0x1'));var zipdir=require(_0x4ead('0x2'));var jsonpatch=require(_0x4ead('0x3'));var rp=require(_0x4ead('0x4'));var moment=require('moment');var BPromise=require(_0x4ead('0x5'));var Mustache=require(_0x4ead('0x6'));var util=require(_0x4ead('0x7'));var path=require(_0x4ead('0x8'));var sox=require(_0x4ead('0x9'));var csv=require(_0x4ead('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ead('0xb'));var _=require(_0x4ead('0xc'));var squel=require(_0x4ead('0xd'));var crypto=require(_0x4ead('0xe'));var jsforce=require(_0x4ead('0xf'));var deskjs=require(_0x4ead('0x10'));var toCsv=require(_0x4ead('0xa'));var querystring=require(_0x4ead('0x11'));var Papa=require(_0x4ead('0x12'));var Redis=require(_0x4ead('0x13'));var authService=require(_0x4ead('0x14'));var qs=require(_0x4ead('0x15'));var as=require(_0x4ead('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ead('0x17'))(_0x4ead('0x18'));var utils=require('../../config/utils');var config=require(_0x4ead('0x19'));var licenseUtil=require(_0x4ead('0x1a'));var db=require(_0x4ead('0x1b'))['db'];config[_0x4ead('0x1c')]=_[_0x4ead('0x1d')](config['redis'],{'host':_0x4ead('0x1e'),'port':0x18eb});var socket=require(_0x4ead('0x1f'))(new Redis(config[_0x4ead('0x1c')]));require(_0x4ead('0x20'))[_0x4ead('0x21')](socket);function respondWithStatusCode(_0x28ef60,_0x47040e){_0x47040e=_0x47040e||0xcc;return function(_0x19e0de){if(_0x19e0de){return _0x28ef60[_0x4ead('0x22')](_0x47040e);}return _0x28ef60[_0x4ead('0x23')](_0x47040e)[_0x4ead('0x24')]();};}function respondWithResult(_0x207c41,_0x13495b){_0x13495b=_0x13495b||0xc8;return function(_0x1250f0){if(_0x1250f0){return _0x207c41['status'](_0x13495b)['json'](_0x1250f0);}};}function respondWithFilteredResult(_0x219083,_0x13bb71){return function(_0x347c7f){if(_0x347c7f){var _0x58c651=typeof _0x13bb71[_0x4ead('0x25')]==='undefined'&&typeof _0x13bb71[_0x4ead('0x26')]===_0x4ead('0x27');var _0x27d3fc=_0x347c7f[_0x4ead('0x28')];var _0x4367ab=_0x58c651?0x0:_0x13bb71['offset'];var _0x6fcb89=_0x58c651?_0x347c7f[_0x4ead('0x28')]:_0x13bb71[_0x4ead('0x25')]+_0x13bb71[_0x4ead('0x26')];var _0x111f54;if(_0x6fcb89>=_0x27d3fc){_0x6fcb89=_0x27d3fc;_0x111f54=0xc8;}else{_0x111f54=0xce;}_0x219083[_0x4ead('0x23')](_0x111f54);return _0x219083[_0x4ead('0x29')](_0x4ead('0x2a'),_0x4367ab+'-'+_0x6fcb89+'/'+_0x27d3fc)[_0x4ead('0x2b')](_0x347c7f);}return null;};}function patchUpdates(_0x148206){return function(_0x307e6d){try{jsonpatch['apply'](_0x307e6d,_0x148206,!![]);}catch(_0x38aee0){return BPromise[_0x4ead('0x2c')](_0x38aee0);}return _0x307e6d['save']();};}function saveUpdates(_0x16d0e4,_0x240038){return function(_0x10ec4b){if(_0x10ec4b){return _0x10ec4b['update'](_0x16d0e4)['then'](function(_0x3ef8a1){return _0x3ef8a1;});}return null;};}function removeEntity(_0x392aec,_0x32e44d){return function(_0x16ad67){if(_0x16ad67){return _0x16ad67['destroy']()[_0x4ead('0x2d')](function(){var _0x143993=_0x16ad67[_0x4ead('0x2e')]({'plain':!![]});var _0x2380c5='OpenchannelQueues';return db[_0x4ead('0x2f')]['destroy']({'where':{'type':_0x2380c5,'resourceId':_0x143993['id']}})[_0x4ead('0x2d')](function(){return _0x16ad67;});})[_0x4ead('0x2d')](function(){_0x392aec[_0x4ead('0x23')](0xcc)[_0x4ead('0x24')]();});}};}function handleEntityNotFound(_0x3c6ecf,_0x386f97){return function(_0x22fc93){if(!_0x22fc93){_0x3c6ecf[_0x4ead('0x22')](0x194);}return _0x22fc93;};}function handleError(_0x36cf76,_0x395187){_0x395187=_0x395187||0x1f4;return function(_0x2e876a){logger[_0x4ead('0x30')](_0x2e876a[_0x4ead('0x31')]);if(_0x2e876a[_0x4ead('0x32')]){delete _0x2e876a[_0x4ead('0x32')];}_0x36cf76[_0x4ead('0x23')](_0x395187)[_0x4ead('0x33')](_0x2e876a);};}exports[_0x4ead('0x34')]=function(_0x2c2cc3,_0x46914b){var _0x1caf10={},_0x543a40={},_0x1df26d={'count':0x0,'rows':[]};var _0x1d5f41=_[_0x4ead('0x35')](db[_0x4ead('0x36')][_0x4ead('0x37')],function(_0x5a9c7c){return{'name':_0x5a9c7c[_0x4ead('0x38')],'type':_0x5a9c7c['type'][_0x4ead('0x39')]};});_0x543a40[_0x4ead('0x3a')]=_[_0x4ead('0x35')](_0x1d5f41,_0x4ead('0x32'));_0x543a40[_0x4ead('0x3b')]=_[_0x4ead('0x3c')](_0x2c2cc3['query']);_0x543a40[_0x4ead('0x3d')]=_[_0x4ead('0x3e')](_0x543a40[_0x4ead('0x3a')],_0x543a40[_0x4ead('0x3b')]);_0x1caf10[_0x4ead('0x3f')]=_[_0x4ead('0x3e')](_0x543a40[_0x4ead('0x3a')],qs[_0x4ead('0x40')](_0x2c2cc3['query'][_0x4ead('0x40')]));_0x1caf10[_0x4ead('0x3f')]=_0x1caf10['attributes']['length']?_0x1caf10[_0x4ead('0x3f')]:_0x543a40[_0x4ead('0x3a')];if(!_0x2c2cc3[_0x4ead('0x3b')][_0x4ead('0x41')]('nolimit')){_0x1caf10[_0x4ead('0x26')]=qs[_0x4ead('0x26')](_0x2c2cc3[_0x4ead('0x3b')][_0x4ead('0x26')]);_0x1caf10[_0x4ead('0x25')]=qs[_0x4ead('0x25')](_0x2c2cc3[_0x4ead('0x3b')][_0x4ead('0x25')]);}_0x1caf10[_0x4ead('0x42')]=qs['sort'](_0x2c2cc3['query'][_0x4ead('0x43')]);_0x1caf10[_0x4ead('0x44')]=qs[_0x4ead('0x3d')](_['pick'](_0x2c2cc3['query'],_0x543a40[_0x4ead('0x3d')]),_0x1d5f41);if(_0x2c2cc3['query']['filter']){_0x1caf10[_0x4ead('0x44')]=_['merge'](_0x1caf10[_0x4ead('0x44')],{'$or':_['map'](_0x1d5f41,function(_0x10feca){if(_0x10feca[_0x4ead('0x45')]!==_0x4ead('0x46')){var _0x7208d3={};_0x7208d3[_0x10feca[_0x4ead('0x32')]]={'$like':'%'+_0x2c2cc3[_0x4ead('0x3b')][_0x4ead('0x47')]+'%'};return _0x7208d3;}})});}_0x1caf10=_[_0x4ead('0x48')]({},_0x1caf10,_0x2c2cc3[_0x4ead('0x49')]);var _0x4c87de={'where':_0x1caf10[_0x4ead('0x44')]};return db['OpenchannelQueue'][_0x4ead('0x28')](_0x4c87de)[_0x4ead('0x2d')](function(_0x48902a){_0x1df26d['count']=_0x48902a;if(_0x2c2cc3['query']['includeAll']){_0x1caf10['include']=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x1caf10);})[_0x4ead('0x2d')](function(_0x131a8e){_0x1df26d[_0x4ead('0x4a')]=_0x131a8e;return _0x1df26d;})[_0x4ead('0x2d')](respondWithFilteredResult(_0x46914b,_0x1caf10))['catch'](handleError(_0x46914b,null));};exports['show']=function(_0x5114c4,_0x2f9059){var _0x233291={'raw':!![],'where':{'id':_0x5114c4[_0x4ead('0x4b')]['id']}},_0x19740b={};_0x19740b[_0x4ead('0x3a')]=_[_0x4ead('0x3c')](db['OpenchannelQueue'][_0x4ead('0x37')]);_0x19740b[_0x4ead('0x3b')]=_['keys'](_0x5114c4['query']);_0x19740b[_0x4ead('0x3d')]=_[_0x4ead('0x3e')](_0x19740b[_0x4ead('0x3a')],_0x19740b['query']);_0x233291[_0x4ead('0x3f')]=_[_0x4ead('0x3e')](_0x19740b[_0x4ead('0x3a')],qs[_0x4ead('0x40')](_0x5114c4['query']['fields']));_0x233291[_0x4ead('0x3f')]=_0x233291['attributes'][_0x4ead('0x4c')]?_0x233291[_0x4ead('0x3f')]:_0x19740b[_0x4ead('0x3a')];if(_0x5114c4[_0x4ead('0x3b')][_0x4ead('0x4d')]){_0x233291[_0x4ead('0x4e')]=[{'all':!![]}];}_0x233291=_['merge']({},_0x233291,_0x5114c4[_0x4ead('0x49')]);return db['OpenchannelQueue']['find'](_0x233291)['then'](handleEntityNotFound(_0x2f9059,null))[_0x4ead('0x2d')](respondWithResult(_0x2f9059,null))['catch'](handleError(_0x2f9059,null));};exports[_0x4ead('0x4f')]=function(_0x289ce2,_0x4d7dc1){return db[_0x4ead('0x36')][_0x4ead('0x4f')](_0x289ce2['body'],{})['then'](function(_0x2824ae){var _0xa7b8c4=_0x289ce2[_0x4ead('0x50')][_0x4ead('0x2e')]({'plain':!![]});if(!_0xa7b8c4)throw new Error(_0x4ead('0x51'));if(_0xa7b8c4[_0x4ead('0x52')]===_0x4ead('0x50')){var _0x3c092b=_0x2824ae[_0x4ead('0x2e')]({'plain':!![]});var _0x42a6d7=_0x4ead('0x53');return db['UserProfileSection'][_0x4ead('0x54')]({'where':{'name':_0x42a6d7,'userProfileId':_0xa7b8c4[_0x4ead('0x55')]},'raw':!![]})[_0x4ead('0x2d')](function(_0x250095){if(_0x250095&&_0x250095['autoAssociation']===0x0){return db[_0x4ead('0x2f')][_0x4ead('0x4f')]({'name':_0x3c092b[_0x4ead('0x32')],'resourceId':_0x3c092b['id'],'type':_0x250095[_0x4ead('0x32')],'sectionId':_0x250095['id']},{})[_0x4ead('0x2d')](function(){return _0x2824ae;});}else{return _0x2824ae;}})[_0x4ead('0x56')](function(_0x158b1b){logger['error'](_0x4ead('0x57'),_0x158b1b);throw _0x158b1b;});}return _0x2824ae;})[_0x4ead('0x2d')](respondWithResult(_0x4d7dc1,0xc9))[_0x4ead('0x56')](handleError(_0x4d7dc1,null));};exports[_0x4ead('0x58')]=function(_0xfe43fa,_0x566a15){if(_0xfe43fa[_0x4ead('0x59')]['id']){delete _0xfe43fa[_0x4ead('0x59')]['id'];}return db[_0x4ead('0x36')][_0x4ead('0x54')]({'where':{'id':_0xfe43fa[_0x4ead('0x4b')]['id']}})[_0x4ead('0x2d')](handleEntityNotFound(_0x566a15,null))[_0x4ead('0x2d')](saveUpdates(_0xfe43fa[_0x4ead('0x59')],null))[_0x4ead('0x2d')](respondWithResult(_0x566a15,null))[_0x4ead('0x56')](handleError(_0x566a15,null));};exports[_0x4ead('0x5a')]=function(_0x5bced4,_0x433e5e){return db[_0x4ead('0x36')][_0x4ead('0x54')]({'where':{'id':_0x5bced4[_0x4ead('0x4b')]['id']}})['then'](handleEntityNotFound(_0x433e5e,null))[_0x4ead('0x2d')](removeEntity(_0x433e5e,null))[_0x4ead('0x56')](handleError(_0x433e5e,null));};exports[_0x4ead('0x5b')]=function(_0x50425c,_0x482ec9){return db[_0x4ead('0x36')]['describe']()[_0x4ead('0x2d')](respondWithResult(_0x482ec9,null))[_0x4ead('0x56')](handleError(_0x482ec9,null));};exports[_0x4ead('0x5c')]=function(_0x34317e,_0x3da0ee,_0x42eeb4){var _0x439c79={'raw':!![],'where':{}},_0x4ad8dc={},_0x2a08a1;return db[_0x4ead('0x36')][_0x4ead('0x5d')]({'where':{'id':_0x34317e[_0x4ead('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3da0ee,null))[_0x4ead('0x2d')](function(_0x206bf0){if(_0x206bf0){_0x2a08a1=_0x206bf0['get']({'plain':!![]});_0x4ad8dc[_0x4ead('0x3a')]=_[_0x4ead('0x3c')](db['UserOpenchannelQueue'][_0x4ead('0x37')]);_0x4ad8dc['query']=_[_0x4ead('0x3c')](_0x34317e[_0x4ead('0x3b')]);_0x4ad8dc['filters']=_[_0x4ead('0x3e')](_0x4ad8dc[_0x4ead('0x3a')],_0x4ad8dc[_0x4ead('0x3b')]);_0x439c79[_0x4ead('0x3f')]=_[_0x4ead('0x3e')](_0x4ad8dc[_0x4ead('0x3a')],qs[_0x4ead('0x40')](_0x34317e[_0x4ead('0x3b')][_0x4ead('0x40')]));_0x439c79[_0x4ead('0x3f')]=_0x439c79[_0x4ead('0x3f')][_0x4ead('0x4c')]?_0x439c79[_0x4ead('0x3f')]:_0x4ad8dc[_0x4ead('0x3a')];if(!_0x34317e[_0x4ead('0x3b')][_0x4ead('0x41')]('nolimit')){_0x439c79[_0x4ead('0x26')]=qs[_0x4ead('0x26')](_0x34317e[_0x4ead('0x3b')]['limit']);_0x439c79[_0x4ead('0x25')]=qs[_0x4ead('0x25')](_0x34317e['query'][_0x4ead('0x25')]);}_0x439c79[_0x4ead('0x42')]=qs[_0x4ead('0x43')](_0x34317e[_0x4ead('0x3b')][_0x4ead('0x43')]);_0x439c79[_0x4ead('0x44')]=qs[_0x4ead('0x3d')](_[_0x4ead('0x5e')](_0x34317e[_0x4ead('0x3b')],_0x4ad8dc['filters']));_0x439c79[_0x4ead('0x44')]['OpenchannelQueueId']=_0x206bf0['id'];if(_0x34317e[_0x4ead('0x3b')]['filter']){_0x439c79['where']=_[_0x4ead('0x48')](_0x439c79[_0x4ead('0x44')],{'$or':_[_0x4ead('0x35')](_0x439c79[_0x4ead('0x3f')],function(_0x2dde9c){var _0x55f163={};_0x55f163[_0x2dde9c]={'$like':'%'+_0x34317e[_0x4ead('0x3b')]['filter']+'%'};return _0x55f163;})});}_0x439c79=_[_0x4ead('0x48')]({},_0x439c79,_0x34317e['options']);return db['UserOpenchannelQueue']['findAll'](_0x439c79);}})['then'](function(_0x1c6e35){if(_0x1c6e35){return db[_0x4ead('0x5f')][_0x4ead('0x60')]({'where':{'id':_[_0x4ead('0x35')](_0x1c6e35,'UserId'),'role':_0x4ead('0x61')},'attributes':['id','name',_0x4ead('0x62'),'updatedAt','createdAt']});}})[_0x4ead('0x2d')](function(_0x127fa7){if(_0x127fa7){return{'count':_0x127fa7[_0x4ead('0x28')],'rows':_[_0x4ead('0x35')](_0x127fa7[_0x4ead('0x4a')],function(_0x34d452){return{'membername':_0x34d452['name'],'UserId':_0x34d452['id'],'queue_name':_0x2a08a1[_0x4ead('0x32')],'OpenchannelQueueId':_0x2a08a1['id'],'interface':util['format'](_0x4ead('0x63'),'SIP',_0x34d452['name']),'penalty':0x0,'paused':_0x34d452[_0x4ead('0x62')],'createdAt':_0x34d452[_0x4ead('0x64')],'updatedAt':_0x34d452[_0x4ead('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4ead('0x2d')](respondWithFilteredResult(_0x3da0ee,_0x439c79))[_0x4ead('0x56')](handleError(_0x3da0ee,null));};exports['getTeams']=function(_0x3bf441,_0x3c7ff1,_0x321f3c){var _0x21ae39={};var _0x2f2298={};var _0x282551;var _0x59273a;return db[_0x4ead('0x36')][_0x4ead('0x5d')]({'where':{'id':_0x3bf441[_0x4ead('0x4b')]['id']}})[_0x4ead('0x2d')](handleEntityNotFound(_0x3c7ff1,null))[_0x4ead('0x2d')](function(_0x4c3da5){if(_0x4c3da5){_0x282551=_0x4c3da5;_0x2f2298['model']=_['keys'](db[_0x4ead('0x66')]['rawAttributes']);_0x2f2298[_0x4ead('0x3b')]=_[_0x4ead('0x3c')](_0x3bf441['query']);_0x2f2298[_0x4ead('0x3d')]=_[_0x4ead('0x3e')](_0x2f2298[_0x4ead('0x3a')],_0x2f2298[_0x4ead('0x3b')]);_0x21ae39[_0x4ead('0x3f')]=_['intersection'](_0x2f2298[_0x4ead('0x3a')],qs[_0x4ead('0x40')](_0x3bf441[_0x4ead('0x3b')][_0x4ead('0x40')]));_0x21ae39['attributes']=_0x21ae39[_0x4ead('0x3f')][_0x4ead('0x4c')]?_0x21ae39['attributes']:_0x2f2298['model'];_0x21ae39[_0x4ead('0x42')]=qs[_0x4ead('0x43')](_0x3bf441[_0x4ead('0x3b')][_0x4ead('0x43')]);_0x21ae39[_0x4ead('0x44')]=qs['filters'](_[_0x4ead('0x5e')](_0x3bf441[_0x4ead('0x3b')],_0x2f2298['filters']));if(_0x3bf441[_0x4ead('0x3b')][_0x4ead('0x47')]){_0x21ae39['where']=_[_0x4ead('0x48')](_0x21ae39[_0x4ead('0x44')],{'$or':_[_0x4ead('0x35')](_0x21ae39[_0x4ead('0x3f')],function(_0x4c189f){var _0x156eab={};_0x156eab[_0x4c189f]={'$like':'%'+_0x3bf441[_0x4ead('0x3b')][_0x4ead('0x47')]+'%'};return _0x156eab;})});}_0x21ae39=_[_0x4ead('0x48')]({},_0x21ae39,_0x3bf441['options']);return _0x282551[_0x4ead('0x67')](_0x21ae39);}})[_0x4ead('0x2d')](function(_0x4a2dab){if(_0x4a2dab){_0x59273a=_0x4a2dab[_0x4ead('0x4c')];if(!_0x3bf441[_0x4ead('0x3b')]['hasOwnProperty'](_0x4ead('0x68'))){_0x21ae39['limit']=qs[_0x4ead('0x26')](_0x3bf441[_0x4ead('0x3b')][_0x4ead('0x26')]);_0x21ae39[_0x4ead('0x25')]=qs['offset'](_0x3bf441[_0x4ead('0x3b')][_0x4ead('0x25')]);}return _0x282551[_0x4ead('0x67')](_0x21ae39);}})[_0x4ead('0x2d')](function(_0x276703){if(_0x276703){return _0x276703?{'count':_0x59273a,'rows':_0x276703}:null;}})[_0x4ead('0x2d')](respondWithResult(_0x3c7ff1,null))[_0x4ead('0x56')](handleError(_0x3c7ff1,null));};exports['addTeams']=function(_0x49d588,_0x795d4a,_0x510e6d){var _0x5076b8=_0x49d588['body'][_0x4ead('0x69')];return db[_0x4ead('0x66')][_0x4ead('0x6a')]({'where':{'id':_0x5076b8},'attributes':['id'],'include':[{'model':db[_0x4ead('0x5f')],'as':_0x4ead('0x6b'),'attributes':['id',_0x4ead('0x32'),_0x4ead('0x6c'),_0x4ead('0x6d'),_0x4ead('0x6e')],'raw':!![]}]})[_0x4ead('0x2d')](function(_0x1627e5){if(_0x1627e5){var _0x5dcdda=_['flatMap'](_0x1627e5,function(_0x51a43e){var _0x294241=_0x51a43e[_0x4ead('0x2e')]({'plain':!![]});return _0x294241[_0x4ead('0x6b')];});return db['OpenchannelQueue'][_0x4ead('0x54')]({'where':{'id':_0x49d588[_0x4ead('0x4b')]['id']}})[_0x4ead('0x2d')](function(_0x3fb484){return db['sequelize'][_0x4ead('0x6f')](function(_0x58c575){return _0x3fb484[_0x4ead('0x70')](_0x5076b8,{'transaction':_0x58c575})['then'](function(){return BPromise['each'](_0x5dcdda,function(_0xad1e6b){return db['UserOpenchannelQueue'][_0x4ead('0x71')]({'where':{'UserId':_0xad1e6b['id'],'OpenchannelQueueId':_0x49d588[_0x4ead('0x4b')]['id']},'transaction':_0x58c575});});})[_0x4ead('0x2d')](function(){_0x5dcdda['forEach'](function(_0x2d6478){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x2d6478['id'],'OpenchannelQueueId':_0x3fb484['id']});});});});});}})[_0x4ead('0x2d')](respondWithStatusCode(_0x795d4a,null))[_0x4ead('0x56')](handleError(_0x795d4a,null));};exports['removeTeams']=function(_0x8bf4cd,_0x2641ac,_0x7d06bd){return db[_0x4ead('0x66')][_0x4ead('0x6a')]({'where':{'id':_0x8bf4cd['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4ead('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x4ead('0x2d')](handleEntityNotFound(_0x2641ac,null))[_0x4ead('0x2d')](function(_0x1042e5){var _0x536169=_[_0x4ead('0x35')](_0x1042e5,'id');var _0xf93d97=[];var _0x47d58e=[];var _0x5e430a=squel[_0x4ead('0x72')]();_0x5e430a[_0x4ead('0x73')]('tq.TeamId')['from'](_0x4ead('0x74'),'tq')[_0x4ead('0x75')](_0x4ead('0x76'),'ut',_0x4ead('0x77'))[_0x4ead('0x44')]('OpenchannelQueueId\x20=\x20?',_0x8bf4cd[_0x4ead('0x4b')]['id']);for(var _0x48df36=0x0;_0x48df36<_0x1042e5[_0x4ead('0x4c')];_0x48df36+=0x1){let _0x1b6f4a=_0x1042e5[_0x48df36];for(var _0x71a175=0x0;_0x71a175<_0x1b6f4a['Agents']['length'];_0x71a175+=0x1){let _0x5637a9=_0x1b6f4a['Agents'][_0x71a175];var _0xae34ff=_0x5e430a[_0x4ead('0x78')]();_0xae34ff[_0x4ead('0x44')]('ut.UserId\x20=\x20?',_0x5637a9['id']);_0x47d58e['push'](db[_0x4ead('0x79')][_0x4ead('0x3b')](_0xae34ff[_0x4ead('0x7a')](),{'type':db['sequelize'][_0x4ead('0x7b')][_0x4ead('0x7c')]})['then'](function(_0x353a81){if(_0x353a81['length']===0x1){return _0x5637a9['id'];}else{var _0xcb3bf0=_[_0x4ead('0x7d')](_['map'](_0x353a81,'TeamId'),function(_0x4b3513){return _[_0x4ead('0x7e')](_0x536169,_0x4b3513);});if(_0xcb3bf0){return _0x5637a9['id'];}}}));}}return BPromise[_0x4ead('0x7f')](_0x47d58e)[_0x4ead('0x2d')](function(_0x25794b){_0xf93d97=_(_0xf93d97)['union'](_0x25794b)['compact']()[_0x4ead('0x80')]();return db[_0x4ead('0x36')]['find']({'where':{'id':_0x8bf4cd[_0x4ead('0x4b')]['id']}})[_0x4ead('0x2d')](function(_0x1f1232){return db[_0x4ead('0x79')][_0x4ead('0x6f')](function(_0x277fce){return _0x1f1232[_0x4ead('0x81')](_0x8bf4cd[_0x4ead('0x3b')][_0x4ead('0x69')],{'transaction':_0x277fce})[_0x4ead('0x2d')](function(){if(!_[_0x4ead('0x82')](_0xf93d97)){return _0x1f1232[_0x4ead('0x83')](_0xf93d97,{'transaction':_0x277fce});}})[_0x4ead('0x2d')](function(){_0xf93d97[_0x4ead('0x84')](function(_0x511da8){socket[_0x4ead('0x85')](_0x4ead('0x86'),{'UserId':_0x511da8,'OpenchannelQueueId':_0x1f1232['id']});});});});});});})[_0x4ead('0x2d')](respondWithStatusCode(_0x2641ac,null))['catch'](handleError(_0x2641ac,null));};exports[_0x4ead('0x87')]=function(_0x3f2832,_0x56c05b,_0x46a1bc){return db[_0x4ead('0x36')][_0x4ead('0x54')]({'where':{'id':_0x3f2832[_0x4ead('0x4b')]['id']}})[_0x4ead('0x2d')](handleEntityNotFound(_0x56c05b,null))[_0x4ead('0x2d')](function(_0x46466d){if(_0x46466d){return _0x46466d[_0x4ead('0x87')](_0x3f2832[_0x4ead('0x59')][_0x4ead('0x69')],_[_0x4ead('0x88')](_0x3f2832[_0x4ead('0x59')],[_0x4ead('0x69'),'id'])||{})[_0x4ead('0x89')](function(_0xf4b4e7){for(var _0x446746=0x0;_0x446746<_0x3f2832[_0x4ead('0x59')][_0x4ead('0x69')]['length'];_0x446746+=0x1){socket['emit'](_0x4ead('0x8a'),{'UserId':Number(_0x3f2832['body'][_0x4ead('0x69')][_0x446746]),'OpenchannelQueueId':Number(_0x3f2832[_0x4ead('0x4b')]['id'])});}return _0xf4b4e7;});}})[_0x4ead('0x2d')](respondWithResult(_0x56c05b,null))[_0x4ead('0x56')](handleError(_0x56c05b,null));};exports[_0x4ead('0x83')]=function(_0x2456d4,_0x388c85,_0x4227ac){return db[_0x4ead('0x36')]['find']({'where':{'id':_0x2456d4['params']['id']}})['then'](handleEntityNotFound(_0x388c85,null))['then'](function(_0x3abff1){if(_0x3abff1){return _0x3abff1['removeAgents'](_0x2456d4['query'][_0x4ead('0x69')])[_0x4ead('0x2d')](function(){if(_[_0x4ead('0x8b')](_0x2456d4['query'][_0x4ead('0x69')])){for(var _0x5ec183=0x0;_0x5ec183<_0x2456d4[_0x4ead('0x3b')][_0x4ead('0x69')][_0x4ead('0x4c')];_0x5ec183+=0x1){socket['emit'](_0x4ead('0x86'),{'UserId':Number(_0x2456d4[_0x4ead('0x3b')]['ids'][_0x5ec183]),'OpenchannelQueueId':Number(_0x2456d4[_0x4ead('0x4b')]['id'])});}}else{socket[_0x4ead('0x85')](_0x4ead('0x86'),{'UserId':Number(_0x2456d4['query'][_0x4ead('0x69')]),'OpenchannelQueueId':Number(_0x2456d4[_0x4ead('0x4b')]['id'])});}});}})[_0x4ead('0x2d')](respondWithStatusCode(_0x388c85,null))[_0x4ead('0x56')](handleError(_0x388c85,null));};exports[_0x4ead('0x8c')]=function(_0x3e16e0,_0x26fe38,_0x54d880){var _0x38f225={};var _0x1ca324={};var _0x393875;var _0x5b3355;return db[_0x4ead('0x36')][_0x4ead('0x5d')]({'where':{'id':_0x3e16e0['params']['id']}})[_0x4ead('0x2d')](handleEntityNotFound(_0x26fe38,null))[_0x4ead('0x2d')](function(_0x25ead1){if(_0x25ead1){_0x393875=_0x25ead1;_0x1ca324['model']=_[_0x4ead('0x3c')](db['User']['rawAttributes']);_0x1ca324[_0x4ead('0x3b')]=_[_0x4ead('0x3c')](_0x3e16e0['query']);_0x1ca324[_0x4ead('0x3d')]=_['intersection'](_0x1ca324[_0x4ead('0x3a')],_0x1ca324[_0x4ead('0x3b')]);_0x38f225['attributes']=_[_0x4ead('0x3e')](_0x1ca324[_0x4ead('0x3a')],qs[_0x4ead('0x40')](_0x3e16e0[_0x4ead('0x3b')][_0x4ead('0x40')]));_0x38f225[_0x4ead('0x3f')]=_0x38f225[_0x4ead('0x3f')]['length']?_0x38f225[_0x4ead('0x3f')]:_0x1ca324[_0x4ead('0x3a')];_0x38f225[_0x4ead('0x42')]=qs[_0x4ead('0x43')](_0x3e16e0[_0x4ead('0x3b')][_0x4ead('0x43')]);_0x38f225[_0x4ead('0x44')]=qs[_0x4ead('0x3d')](_[_0x4ead('0x5e')](_0x3e16e0['query'],_0x1ca324['filters']));if(_0x3e16e0['query'][_0x4ead('0x47')]){_0x38f225[_0x4ead('0x44')]=_['merge'](_0x38f225[_0x4ead('0x44')],{'$or':_[_0x4ead('0x35')](_0x38f225[_0x4ead('0x3f')],function(_0x2c489f){var _0x2bd697={};_0x2bd697[_0x2c489f]={'$like':'%'+_0x3e16e0[_0x4ead('0x3b')]['filter']+'%'};return _0x2bd697;})});}_0x38f225=_[_0x4ead('0x48')]({},_0x38f225,_0x3e16e0['options']);return _0x393875['getAgents'](_0x38f225);}})[_0x4ead('0x2d')](function(_0x5b508a){if(_0x5b508a){_0x5b3355=_0x5b508a[_0x4ead('0x4c')];if(!_0x3e16e0[_0x4ead('0x3b')]['hasOwnProperty'](_0x4ead('0x68'))){_0x38f225['limit']=qs[_0x4ead('0x26')](_0x3e16e0[_0x4ead('0x3b')][_0x4ead('0x26')]);_0x38f225[_0x4ead('0x25')]=qs[_0x4ead('0x25')](_0x3e16e0[_0x4ead('0x3b')][_0x4ead('0x25')]);}return _0x393875[_0x4ead('0x8c')](_0x38f225);}})[_0x4ead('0x2d')](function(_0x3c10cf){if(_0x3c10cf){return _0x3c10cf?{'count':_0x5b3355,'rows':_0x3c10cf}:null;}})[_0x4ead('0x2d')](respondWithResult(_0x26fe38,null))['catch'](handleError(_0x26fe38,null));}; \ No newline at end of file +var _0x67e0=['options','OpenchannelQueue','include','findAll','rows','show','params','includeAll','find','create','body','user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','User','online','interface','flatMap','Agents','sequelize','findOrCreate','forEach','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','union','value','removeTeams','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x67e0,0x1f0));var _0x067e=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x67e0[_0x3f1710];return _0x528458;};'use strict';var emlformat=require(_0x067e('0x0'));var rimraf=require(_0x067e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x067e('0x2'));var moment=require(_0x067e('0x3'));var BPromise=require(_0x067e('0x4'));var Mustache=require(_0x067e('0x5'));var util=require(_0x067e('0x6'));var path=require(_0x067e('0x7'));var sox=require('sox');var csv=require(_0x067e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x067e('0x9'));var squel=require(_0x067e('0xa'));var crypto=require(_0x067e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x067e('0xc'));var toCsv=require(_0x067e('0x8'));var querystring=require(_0x067e('0xd'));var Papa=require(_0x067e('0xe'));var Redis=require(_0x067e('0xf'));var authService=require(_0x067e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x067e('0x11'));var hardwareService=require(_0x067e('0x12'));var logger=require('../../config/logger')(_0x067e('0x13'));var utils=require(_0x067e('0x14'));var config=require(_0x067e('0x15'));var licenseUtil=require(_0x067e('0x16'));var db=require(_0x067e('0x17'))['db'];config[_0x067e('0x18')]=_[_0x067e('0x19')](config[_0x067e('0x18')],{'host':_0x067e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x067e('0x1b'))[_0x067e('0x1c')](socket);function respondWithStatusCode(_0x349014,_0x1a398b){_0x1a398b=_0x1a398b||0xcc;return function(_0x4cc40b){if(_0x4cc40b){return _0x349014[_0x067e('0x1d')](_0x1a398b);}return _0x349014[_0x067e('0x1e')](_0x1a398b)[_0x067e('0x1f')]();};}function respondWithResult(_0x5e5c7e,_0x241439){_0x241439=_0x241439||0xc8;return function(_0x1e4c17){if(_0x1e4c17){return _0x5e5c7e[_0x067e('0x1e')](_0x241439)[_0x067e('0x20')](_0x1e4c17);}};}function respondWithFilteredResult(_0x8e7ca0,_0x2ff65a){return function(_0x4e91d9){if(_0x4e91d9){var _0x3268de=typeof _0x2ff65a[_0x067e('0x21')]===_0x067e('0x22')&&typeof _0x2ff65a[_0x067e('0x23')]==='undefined';var _0x270909=_0x4e91d9[_0x067e('0x24')];var _0x2b02b6=_0x3268de?0x0:_0x2ff65a[_0x067e('0x21')];var _0x4d780e=_0x3268de?_0x4e91d9[_0x067e('0x24')]:_0x2ff65a[_0x067e('0x21')]+_0x2ff65a[_0x067e('0x23')];var _0x2c29bd;if(_0x4d780e>=_0x270909){_0x4d780e=_0x270909;_0x2c29bd=0xc8;}else{_0x2c29bd=0xce;}_0x8e7ca0[_0x067e('0x1e')](_0x2c29bd);return _0x8e7ca0[_0x067e('0x25')](_0x067e('0x26'),_0x2b02b6+'-'+_0x4d780e+'/'+_0x270909)[_0x067e('0x20')](_0x4e91d9);}return null;};}function patchUpdates(_0x208ab5){return function(_0x203b45){try{jsonpatch[_0x067e('0x27')](_0x203b45,_0x208ab5,!![]);}catch(_0x46c936){return BPromise[_0x067e('0x28')](_0x46c936);}return _0x203b45[_0x067e('0x29')]();};}function saveUpdates(_0x22222e,_0x30c70f){return function(_0x5da9bf){if(_0x5da9bf){return _0x5da9bf[_0x067e('0x2a')](_0x22222e)[_0x067e('0x2b')](function(_0x30b0ab){return _0x30b0ab;});}return null;};}function removeEntity(_0x838011,_0x51efa5){return function(_0xe103f1){if(_0xe103f1){return _0xe103f1[_0x067e('0x2c')]()['then'](function(){var _0x1d8f5d=_0xe103f1[_0x067e('0x2d')]({'plain':!![]});var _0x1e151f='OpenchannelQueues';return db[_0x067e('0x2e')][_0x067e('0x2c')]({'where':{'type':_0x1e151f,'resourceId':_0x1d8f5d['id']}})[_0x067e('0x2b')](function(){return _0xe103f1;});})[_0x067e('0x2b')](function(){_0x838011['status'](0xcc)[_0x067e('0x1f')]();});}};}function handleEntityNotFound(_0x4920ea,_0x5e3999){return function(_0x4bd071){if(!_0x4bd071){_0x4920ea['sendStatus'](0x194);}return _0x4bd071;};}function handleError(_0x31a864,_0x5aeae9){_0x5aeae9=_0x5aeae9||0x1f4;return function(_0x3c6ed7){logger[_0x067e('0x2f')](_0x3c6ed7[_0x067e('0x30')]);if(_0x3c6ed7['name']){delete _0x3c6ed7['name'];}_0x31a864[_0x067e('0x1e')](_0x5aeae9)['send'](_0x3c6ed7);};}exports[_0x067e('0x31')]=function(_0x39178c,_0xc00207){var _0x24017e={},_0x36cb7b={},_0x5d59df={'count':0x0,'rows':[]};var _0x1e9078=_['map'](db['OpenchannelQueue'][_0x067e('0x32')],function(_0xf464c4){return{'name':_0xf464c4[_0x067e('0x33')],'type':_0xf464c4[_0x067e('0x34')][_0x067e('0x35')]};});_0x36cb7b[_0x067e('0x36')]=_[_0x067e('0x37')](_0x1e9078,'name');_0x36cb7b[_0x067e('0x38')]=_[_0x067e('0x39')](_0x39178c[_0x067e('0x38')]);_0x36cb7b[_0x067e('0x3a')]=_[_0x067e('0x3b')](_0x36cb7b['model'],_0x36cb7b[_0x067e('0x38')]);_0x24017e['attributes']=_[_0x067e('0x3b')](_0x36cb7b[_0x067e('0x36')],qs['fields'](_0x39178c[_0x067e('0x38')][_0x067e('0x3c')]));_0x24017e[_0x067e('0x3d')]=_0x24017e[_0x067e('0x3d')][_0x067e('0x3e')]?_0x24017e[_0x067e('0x3d')]:_0x36cb7b['model'];if(!_0x39178c['query'][_0x067e('0x3f')]('nolimit')){_0x24017e[_0x067e('0x23')]=qs[_0x067e('0x23')](_0x39178c[_0x067e('0x38')]['limit']);_0x24017e['offset']=qs[_0x067e('0x21')](_0x39178c[_0x067e('0x38')][_0x067e('0x21')]);}_0x24017e[_0x067e('0x40')]=qs['sort'](_0x39178c[_0x067e('0x38')][_0x067e('0x41')]);_0x24017e[_0x067e('0x42')]=qs[_0x067e('0x3a')](_[_0x067e('0x43')](_0x39178c[_0x067e('0x38')],_0x36cb7b[_0x067e('0x3a')]),_0x1e9078);if(_0x39178c[_0x067e('0x38')][_0x067e('0x44')]){_0x24017e['where']=_[_0x067e('0x45')](_0x24017e['where'],{'$or':_[_0x067e('0x37')](_0x1e9078,function(_0x99a74c){if(_0x99a74c[_0x067e('0x34')]!==_0x067e('0x46')){var _0x22d16e={};_0x22d16e[_0x99a74c[_0x067e('0x47')]]={'$like':'%'+_0x39178c[_0x067e('0x38')][_0x067e('0x44')]+'%'};return _0x22d16e;}})});}_0x24017e=_[_0x067e('0x45')]({},_0x24017e,_0x39178c[_0x067e('0x48')]);var _0x3b0c8e={'where':_0x24017e[_0x067e('0x42')]};return db[_0x067e('0x49')][_0x067e('0x24')](_0x3b0c8e)[_0x067e('0x2b')](function(_0x10e6db){_0x5d59df[_0x067e('0x24')]=_0x10e6db;if(_0x39178c[_0x067e('0x38')]['includeAll']){_0x24017e[_0x067e('0x4a')]=[{'all':!![]}];}return db[_0x067e('0x49')][_0x067e('0x4b')](_0x24017e);})[_0x067e('0x2b')](function(_0x18efa3){_0x5d59df[_0x067e('0x4c')]=_0x18efa3;return _0x5d59df;})['then'](respondWithFilteredResult(_0xc00207,_0x24017e))['catch'](handleError(_0xc00207,null));};exports[_0x067e('0x4d')]=function(_0x5cd26a,_0x41289e){var _0x35142f={'raw':!![],'where':{'id':_0x5cd26a[_0x067e('0x4e')]['id']}},_0x18a91a={};_0x18a91a[_0x067e('0x36')]=_[_0x067e('0x39')](db[_0x067e('0x49')][_0x067e('0x32')]);_0x18a91a[_0x067e('0x38')]=_[_0x067e('0x39')](_0x5cd26a[_0x067e('0x38')]);_0x18a91a[_0x067e('0x3a')]=_[_0x067e('0x3b')](_0x18a91a['model'],_0x18a91a['query']);_0x35142f[_0x067e('0x3d')]=_[_0x067e('0x3b')](_0x18a91a[_0x067e('0x36')],qs[_0x067e('0x3c')](_0x5cd26a[_0x067e('0x38')][_0x067e('0x3c')]));_0x35142f['attributes']=_0x35142f[_0x067e('0x3d')]['length']?_0x35142f[_0x067e('0x3d')]:_0x18a91a[_0x067e('0x36')];if(_0x5cd26a[_0x067e('0x38')][_0x067e('0x4f')]){_0x35142f['include']=[{'all':!![]}];}_0x35142f=_[_0x067e('0x45')]({},_0x35142f,_0x5cd26a[_0x067e('0x48')]);return db['OpenchannelQueue'][_0x067e('0x50')](_0x35142f)['then'](handleEntityNotFound(_0x41289e,null))[_0x067e('0x2b')](respondWithResult(_0x41289e,null))['catch'](handleError(_0x41289e,null));};exports[_0x067e('0x51')]=function(_0x2ef2cc,_0x56a1d4){return db[_0x067e('0x49')][_0x067e('0x51')](_0x2ef2cc[_0x067e('0x52')],{})['then'](function(_0x42503d){var _0x2f9600=_0x2ef2cc[_0x067e('0x53')][_0x067e('0x2d')]({'plain':!![]});if(!_0x2f9600)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f9600['role']===_0x067e('0x53')){var _0x116bfd=_0x42503d[_0x067e('0x2d')]({'plain':!![]});var _0x4141d6='OpenchannelQueues';return db[_0x067e('0x54')][_0x067e('0x50')]({'where':{'name':_0x4141d6,'userProfileId':_0x2f9600[_0x067e('0x55')]},'raw':!![]})[_0x067e('0x2b')](function(_0xcb4e68){if(_0xcb4e68&&_0xcb4e68['autoAssociation']===0x0){return db[_0x067e('0x2e')][_0x067e('0x51')]({'name':_0x116bfd['name'],'resourceId':_0x116bfd['id'],'type':_0xcb4e68[_0x067e('0x47')],'sectionId':_0xcb4e68['id']},{})[_0x067e('0x2b')](function(){return _0x42503d;});}else{return _0x42503d;}})[_0x067e('0x56')](function(_0x34a48a){logger[_0x067e('0x2f')](_0x067e('0x57'),_0x34a48a);throw _0x34a48a;});}return _0x42503d;})[_0x067e('0x2b')](respondWithResult(_0x56a1d4,0xc9))[_0x067e('0x56')](handleError(_0x56a1d4,null));};exports[_0x067e('0x2a')]=function(_0x4b97c,_0x536c46){if(_0x4b97c['body']['id']){delete _0x4b97c['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x4b97c[_0x067e('0x4e')]['id']}})[_0x067e('0x2b')](handleEntityNotFound(_0x536c46,null))[_0x067e('0x2b')](saveUpdates(_0x4b97c['body'],null))[_0x067e('0x2b')](respondWithResult(_0x536c46,null))[_0x067e('0x56')](handleError(_0x536c46,null));};exports[_0x067e('0x2c')]=function(_0x5d978f,_0x13ceda){return db[_0x067e('0x49')][_0x067e('0x50')]({'where':{'id':_0x5d978f[_0x067e('0x4e')]['id']}})[_0x067e('0x2b')](handleEntityNotFound(_0x13ceda,null))[_0x067e('0x2b')](removeEntity(_0x13ceda,null))[_0x067e('0x56')](handleError(_0x13ceda,null));};exports['describe']=function(_0x3997b2,_0x575845){return db[_0x067e('0x49')][_0x067e('0x58')]()[_0x067e('0x2b')](respondWithResult(_0x575845,null))[_0x067e('0x56')](handleError(_0x575845,null));};exports[_0x067e('0x59')]=function(_0x5ca2be,_0x5d5055,_0x15c886){var _0x4ce150={'raw':!![],'where':{}},_0x462a9b={},_0x474e7e;return db[_0x067e('0x49')][_0x067e('0x5a')]({'where':{'id':_0x5ca2be[_0x067e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5d5055,null))[_0x067e('0x2b')](function(_0xa57c09){if(_0xa57c09){_0x474e7e=_0xa57c09[_0x067e('0x2d')]({'plain':!![]});_0x462a9b['model']=_['keys'](db[_0x067e('0x5b')][_0x067e('0x32')]);_0x462a9b[_0x067e('0x38')]=_[_0x067e('0x39')](_0x5ca2be[_0x067e('0x38')]);_0x462a9b[_0x067e('0x3a')]=_[_0x067e('0x3b')](_0x462a9b[_0x067e('0x36')],_0x462a9b[_0x067e('0x38')]);_0x4ce150[_0x067e('0x3d')]=_['intersection'](_0x462a9b['model'],qs[_0x067e('0x3c')](_0x5ca2be['query']['fields']));_0x4ce150[_0x067e('0x3d')]=_0x4ce150[_0x067e('0x3d')][_0x067e('0x3e')]?_0x4ce150['attributes']:_0x462a9b[_0x067e('0x36')];if(!_0x5ca2be[_0x067e('0x38')][_0x067e('0x3f')](_0x067e('0x5c'))){_0x4ce150[_0x067e('0x23')]=qs[_0x067e('0x23')](_0x5ca2be['query']['limit']);_0x4ce150[_0x067e('0x21')]=qs[_0x067e('0x21')](_0x5ca2be['query'][_0x067e('0x21')]);}_0x4ce150['order']=qs[_0x067e('0x41')](_0x5ca2be[_0x067e('0x38')][_0x067e('0x41')]);_0x4ce150['where']=qs[_0x067e('0x3a')](_[_0x067e('0x43')](_0x5ca2be['query'],_0x462a9b[_0x067e('0x3a')]));_0x4ce150[_0x067e('0x42')][_0x067e('0x5d')]=_0xa57c09['id'];if(_0x5ca2be[_0x067e('0x38')][_0x067e('0x44')]){_0x4ce150[_0x067e('0x42')]=_[_0x067e('0x45')](_0x4ce150[_0x067e('0x42')],{'$or':_[_0x067e('0x37')](_0x4ce150[_0x067e('0x3d')],function(_0x53964f){var _0x1a8398={};_0x1a8398[_0x53964f]={'$like':'%'+_0x5ca2be[_0x067e('0x38')][_0x067e('0x44')]+'%'};return _0x1a8398;})});}_0x4ce150=_[_0x067e('0x45')]({},_0x4ce150,_0x5ca2be[_0x067e('0x48')]);return db[_0x067e('0x5b')]['findAll'](_0x4ce150);}})[_0x067e('0x2b')](function(_0x306dbe){if(_0x306dbe){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x306dbe,_0x067e('0x5e')),'role':_0x067e('0x5f')},'attributes':['id',_0x067e('0x47'),_0x067e('0x60'),_0x067e('0x61'),'createdAt']});}})[_0x067e('0x2b')](function(_0x3e2124){if(_0x3e2124){return{'count':_0x3e2124['count'],'rows':_[_0x067e('0x37')](_0x3e2124[_0x067e('0x4c')],function(_0x574715){return{'membername':_0x574715[_0x067e('0x47')],'UserId':_0x574715['id'],'queue_name':_0x474e7e[_0x067e('0x47')],'OpenchannelQueueId':_0x474e7e['id'],'interface':util[_0x067e('0x62')](_0x067e('0x63'),_0x067e('0x64'),_0x574715['name']),'penalty':0x0,'paused':_0x574715[_0x067e('0x60')],'createdAt':_0x574715[_0x067e('0x65')],'updatedAt':_0x574715[_0x067e('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x067e('0x2b')](respondWithFilteredResult(_0x5d5055,_0x4ce150))['catch'](handleError(_0x5d5055,null));};exports[_0x067e('0x66')]=function(_0x4a10ed,_0x4b1453,_0x506176){var _0x30d514={};var _0x5009df={};var _0x2cd90f;var _0x1b84b7;return db['OpenchannelQueue'][_0x067e('0x5a')]({'where':{'id':_0x4a10ed[_0x067e('0x4e')]['id']}})[_0x067e('0x2b')](handleEntityNotFound(_0x4b1453,null))[_0x067e('0x2b')](function(_0x13dc76){if(_0x13dc76){_0x2cd90f=_0x13dc76;_0x5009df['model']=_[_0x067e('0x39')](db['Team']['rawAttributes']);_0x5009df[_0x067e('0x38')]=_[_0x067e('0x39')](_0x4a10ed[_0x067e('0x38')]);_0x5009df['filters']=_['intersection'](_0x5009df[_0x067e('0x36')],_0x5009df['query']);_0x30d514[_0x067e('0x3d')]=_[_0x067e('0x3b')](_0x5009df[_0x067e('0x36')],qs[_0x067e('0x3c')](_0x4a10ed[_0x067e('0x38')][_0x067e('0x3c')]));_0x30d514[_0x067e('0x3d')]=_0x30d514['attributes'][_0x067e('0x3e')]?_0x30d514['attributes']:_0x5009df[_0x067e('0x36')];_0x30d514[_0x067e('0x40')]=qs[_0x067e('0x41')](_0x4a10ed[_0x067e('0x38')][_0x067e('0x41')]);_0x30d514[_0x067e('0x42')]=qs[_0x067e('0x3a')](_[_0x067e('0x43')](_0x4a10ed[_0x067e('0x38')],_0x5009df[_0x067e('0x3a')]));if(_0x4a10ed[_0x067e('0x38')][_0x067e('0x44')]){_0x30d514[_0x067e('0x42')]=_[_0x067e('0x45')](_0x30d514[_0x067e('0x42')],{'$or':_[_0x067e('0x37')](_0x30d514['attributes'],function(_0x12f5d2){var _0x192182={};_0x192182[_0x12f5d2]={'$like':'%'+_0x4a10ed[_0x067e('0x38')]['filter']+'%'};return _0x192182;})});}_0x30d514=_['merge']({},_0x30d514,_0x4a10ed['options']);return _0x2cd90f[_0x067e('0x66')](_0x30d514);}})[_0x067e('0x2b')](function(_0xa91b58){if(_0xa91b58){_0x1b84b7=_0xa91b58[_0x067e('0x3e')];if(!_0x4a10ed[_0x067e('0x38')][_0x067e('0x3f')](_0x067e('0x5c'))){_0x30d514[_0x067e('0x23')]=qs[_0x067e('0x23')](_0x4a10ed[_0x067e('0x38')][_0x067e('0x23')]);_0x30d514[_0x067e('0x21')]=qs[_0x067e('0x21')](_0x4a10ed[_0x067e('0x38')][_0x067e('0x21')]);}return _0x2cd90f[_0x067e('0x66')](_0x30d514);}})[_0x067e('0x2b')](function(_0x20adce){if(_0x20adce){return _0x20adce?{'count':_0x1b84b7,'rows':_0x20adce}:null;}})[_0x067e('0x2b')](respondWithResult(_0x4b1453,null))[_0x067e('0x56')](handleError(_0x4b1453,null));};exports[_0x067e('0x67')]=function(_0x5b223e,_0x15c040,_0x2a7a86){var _0x70f27f=_0x5b223e[_0x067e('0x52')][_0x067e('0x68')];return db[_0x067e('0x69')][_0x067e('0x4b')]({'where':{'id':_0x70f27f},'attributes':['id'],'include':[{'model':db[_0x067e('0x6a')],'as':'Agents','attributes':['id',_0x067e('0x47'),_0x067e('0x6b'),'voicePause',_0x067e('0x6c')],'raw':!![]}]})[_0x067e('0x2b')](function(_0x4b5ecc){if(_0x4b5ecc){var _0x3a5cff=_[_0x067e('0x6d')](_0x4b5ecc,function(_0x1039e5){var _0x3052f4=_0x1039e5['get']({'plain':!![]});return _0x3052f4[_0x067e('0x6e')];});return db[_0x067e('0x49')][_0x067e('0x50')]({'where':{'id':_0x5b223e[_0x067e('0x4e')]['id']}})[_0x067e('0x2b')](function(_0x248f82){return db[_0x067e('0x6f')]['transaction'](function(_0x4313bd){return _0x248f82[_0x067e('0x67')](_0x70f27f,{'transaction':_0x4313bd})[_0x067e('0x2b')](function(){return BPromise['each'](_0x3a5cff,function(_0xb26686){return db[_0x067e('0x5b')][_0x067e('0x70')]({'where':{'UserId':_0xb26686['id'],'OpenchannelQueueId':_0x5b223e[_0x067e('0x4e')]['id']},'transaction':_0x4313bd});});})[_0x067e('0x2b')](function(){_0x3a5cff[_0x067e('0x71')](function(_0x58a71e){socket['emit'](_0x067e('0x72'),{'UserId':_0x58a71e['id'],'OpenchannelQueueId':_0x248f82['id']});});});});});}})[_0x067e('0x2b')](respondWithStatusCode(_0x15c040,null))[_0x067e('0x56')](handleError(_0x15c040,null));};exports['removeTeams']=function(_0x2d77f2,_0x482259,_0x28618d){return db[_0x067e('0x69')]['findAll']({'where':{'id':_0x2d77f2[_0x067e('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x067e('0x6a')],'as':_0x067e('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x067e('0x2b')](handleEntityNotFound(_0x482259,null))[_0x067e('0x2b')](function(_0xe48d3b){var _0x382e63=_[_0x067e('0x37')](_0xe48d3b,'id');var _0x1f28f6=[];var _0x644519=[];var _0x463ab5=squel[_0x067e('0x73')]();_0x463ab5[_0x067e('0x74')](_0x067e('0x75'))[_0x067e('0x76')](_0x067e('0x77'),'tq')[_0x067e('0x78')](_0x067e('0x79'),'ut',_0x067e('0x7a'))[_0x067e('0x42')](_0x067e('0x7b'),_0x2d77f2[_0x067e('0x4e')]['id']);for(var _0x39d4de=0x0;_0x39d4de<_0xe48d3b[_0x067e('0x3e')];_0x39d4de+=0x1){let _0x54c94d=_0xe48d3b[_0x39d4de];for(var _0x768f71=0x0;_0x768f71<_0x54c94d[_0x067e('0x6e')][_0x067e('0x3e')];_0x768f71+=0x1){let _0x1fde57=_0x54c94d[_0x067e('0x6e')][_0x768f71];var _0x572594=_0x463ab5[_0x067e('0x7c')]();_0x572594[_0x067e('0x42')](_0x067e('0x7d'),_0x1fde57['id']);_0x644519[_0x067e('0x7e')](db['sequelize']['query'](_0x572594['toString'](),{'type':db['sequelize'][_0x067e('0x7f')]['SELECT']})[_0x067e('0x2b')](function(_0xb11384){if(_0xb11384[_0x067e('0x3e')]===0x1){return _0x1fde57['id'];}else{var _0x26ce29=_[_0x067e('0x80')](_[_0x067e('0x37')](_0xb11384,_0x067e('0x81')),function(_0x6a64fa){return _[_0x067e('0x82')](_0x382e63,_0x6a64fa);});if(_0x26ce29){return _0x1fde57['id'];}}}));}}return BPromise['all'](_0x644519)[_0x067e('0x2b')](function(_0x5c0642){_0x1f28f6=_(_0x1f28f6)[_0x067e('0x83')](_0x5c0642)['compact']()[_0x067e('0x84')]();return db[_0x067e('0x49')][_0x067e('0x50')]({'where':{'id':_0x2d77f2[_0x067e('0x4e')]['id']}})[_0x067e('0x2b')](function(_0x5edf86){return db[_0x067e('0x6f')]['transaction'](function(_0x40ef66){return _0x5edf86[_0x067e('0x85')](_0x2d77f2[_0x067e('0x38')][_0x067e('0x68')],{'transaction':_0x40ef66})[_0x067e('0x2b')](function(){if(!_[_0x067e('0x86')](_0x1f28f6)){return _0x5edf86[_0x067e('0x87')](_0x1f28f6,{'transaction':_0x40ef66});}})['then'](function(){_0x1f28f6[_0x067e('0x71')](function(_0x5f765a){socket[_0x067e('0x88')](_0x067e('0x89'),{'UserId':_0x5f765a,'OpenchannelQueueId':_0x5edf86['id']});});});});});});})[_0x067e('0x2b')](respondWithStatusCode(_0x482259,null))[_0x067e('0x56')](handleError(_0x482259,null));};exports[_0x067e('0x8a')]=function(_0x46c03b,_0x3d5e5e,_0x48230e){return db[_0x067e('0x49')][_0x067e('0x50')]({'where':{'id':_0x46c03b[_0x067e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d5e5e,null))[_0x067e('0x2b')](function(_0x2e606a){if(_0x2e606a){return _0x2e606a[_0x067e('0x8a')](_0x46c03b['body']['ids'],_['omit'](_0x46c03b[_0x067e('0x52')],[_0x067e('0x68'),'id'])||{})[_0x067e('0x8b')](function(_0x56e0cf){for(var _0x362e57=0x0;_0x362e57<_0x46c03b[_0x067e('0x52')]['ids'][_0x067e('0x3e')];_0x362e57+=0x1){socket[_0x067e('0x88')](_0x067e('0x72'),{'UserId':Number(_0x46c03b[_0x067e('0x52')]['ids'][_0x362e57]),'OpenchannelQueueId':Number(_0x46c03b[_0x067e('0x4e')]['id'])});}return _0x56e0cf;});}})[_0x067e('0x2b')](respondWithResult(_0x3d5e5e,null))[_0x067e('0x56')](handleError(_0x3d5e5e,null));};exports[_0x067e('0x87')]=function(_0x4b51a9,_0x385b6a,_0xe95cc){return db[_0x067e('0x49')][_0x067e('0x50')]({'where':{'id':_0x4b51a9[_0x067e('0x4e')]['id']}})[_0x067e('0x2b')](handleEntityNotFound(_0x385b6a,null))[_0x067e('0x2b')](function(_0x4c0678){if(_0x4c0678){return _0x4c0678['removeAgents'](_0x4b51a9[_0x067e('0x38')][_0x067e('0x68')])['then'](function(){if(_[_0x067e('0x8c')](_0x4b51a9[_0x067e('0x38')][_0x067e('0x68')])){for(var _0x3ef36f=0x0;_0x3ef36f<_0x4b51a9['query'][_0x067e('0x68')][_0x067e('0x3e')];_0x3ef36f+=0x1){socket[_0x067e('0x88')](_0x067e('0x89'),{'UserId':Number(_0x4b51a9[_0x067e('0x38')]['ids'][_0x3ef36f]),'OpenchannelQueueId':Number(_0x4b51a9[_0x067e('0x4e')]['id'])});}}else{socket[_0x067e('0x88')](_0x067e('0x89'),{'UserId':Number(_0x4b51a9['query'][_0x067e('0x68')]),'OpenchannelQueueId':Number(_0x4b51a9[_0x067e('0x4e')]['id'])});}});}})[_0x067e('0x2b')](respondWithStatusCode(_0x385b6a,null))[_0x067e('0x56')](handleError(_0x385b6a,null));};exports['getAgents']=function(_0x46b472,_0x1d9542,_0x54d456){var _0x10a9cb={};var _0x1ad3e7={};var _0x128c6f;var _0x4098fb;return db[_0x067e('0x49')][_0x067e('0x5a')]({'where':{'id':_0x46b472['params']['id']}})[_0x067e('0x2b')](handleEntityNotFound(_0x1d9542,null))['then'](function(_0x39e6e1){if(_0x39e6e1){_0x128c6f=_0x39e6e1;_0x1ad3e7[_0x067e('0x36')]=_[_0x067e('0x39')](db[_0x067e('0x6a')][_0x067e('0x32')]);_0x1ad3e7[_0x067e('0x38')]=_['keys'](_0x46b472[_0x067e('0x38')]);_0x1ad3e7[_0x067e('0x3a')]=_[_0x067e('0x3b')](_0x1ad3e7[_0x067e('0x36')],_0x1ad3e7[_0x067e('0x38')]);_0x10a9cb['attributes']=_[_0x067e('0x3b')](_0x1ad3e7[_0x067e('0x36')],qs['fields'](_0x46b472['query'][_0x067e('0x3c')]));_0x10a9cb[_0x067e('0x3d')]=_0x10a9cb['attributes'][_0x067e('0x3e')]?_0x10a9cb[_0x067e('0x3d')]:_0x1ad3e7[_0x067e('0x36')];_0x10a9cb['order']=qs[_0x067e('0x41')](_0x46b472[_0x067e('0x38')]['sort']);_0x10a9cb[_0x067e('0x42')]=qs[_0x067e('0x3a')](_[_0x067e('0x43')](_0x46b472[_0x067e('0x38')],_0x1ad3e7[_0x067e('0x3a')]));if(_0x46b472['query'][_0x067e('0x44')]){_0x10a9cb[_0x067e('0x42')]=_[_0x067e('0x45')](_0x10a9cb[_0x067e('0x42')],{'$or':_[_0x067e('0x37')](_0x10a9cb[_0x067e('0x3d')],function(_0x3e78be){var _0x1cf01f={};_0x1cf01f[_0x3e78be]={'$like':'%'+_0x46b472[_0x067e('0x38')][_0x067e('0x44')]+'%'};return _0x1cf01f;})});}_0x10a9cb=_[_0x067e('0x45')]({},_0x10a9cb,_0x46b472[_0x067e('0x48')]);return _0x128c6f[_0x067e('0x8d')](_0x10a9cb);}})[_0x067e('0x2b')](function(_0x4e480b){if(_0x4e480b){_0x4098fb=_0x4e480b[_0x067e('0x3e')];if(!_0x46b472[_0x067e('0x38')][_0x067e('0x3f')](_0x067e('0x5c'))){_0x10a9cb[_0x067e('0x23')]=qs[_0x067e('0x23')](_0x46b472[_0x067e('0x38')][_0x067e('0x23')]);_0x10a9cb['offset']=qs['offset'](_0x46b472[_0x067e('0x38')][_0x067e('0x21')]);}return _0x128c6f[_0x067e('0x8d')](_0x10a9cb);}})['then'](function(_0x1b1e40){if(_0x1b1e40){return _0x1b1e40?{'count':_0x4098fb,'rows':_0x1b1e40}:null;}})['then'](respondWithResult(_0x1d9542,null))[_0x067e('0x56')](handleError(_0x1d9542,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 3d81ffd..c01b98f 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 _0xbd99=['remove','emit','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','update'];(function(_0x4414ee,_0x3ca022){var _0x14862b=function(_0x1c1fa3){while(--_0x1c1fa3){_0x4414ee['push'](_0x4414ee['shift']());}};_0x14862b(++_0x3ca022);}(_0xbd99,0xff));var _0x9bd9=function(_0x30c810,_0x29ee03){_0x30c810=_0x30c810-0x0;var _0x15d136=_0xbd99[_0x30c810];return _0x15d136;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x9bd9('0x0'))['db'][_0x9bd9('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9bd9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9bd9('0x3'),'afterDestroy':_0x9bd9('0x4')};function emitEvent(_0x4eb096){return function(_0x4cc8ac,_0x5327c8,_0x16bc5d){OpenchannelQueueEvents[_0x9bd9('0x5')](_0x4eb096+':'+_0x4cc8ac['id'],_0x4cc8ac);OpenchannelQueueEvents[_0x9bd9('0x5')](_0x4eb096,_0x4cc8ac);_0x16bc5d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x9bd9('0x6')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x394e=['hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x394e,0x18f));var _0xe394=function(_0x443242,_0x4d9878){_0x443242=_0x443242-0x0;var _0x2c7479=_0x394e[_0x443242];return _0x2c7479;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xe394('0x0'))['db'][_0xe394('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe394('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe394('0x3'),'afterDestroy':_0xe394('0x4')};function emitEvent(_0x499db5){return function(_0x4f318d,_0x68bf0a,_0x506bf8){OpenchannelQueueEvents[_0xe394('0x5')](_0x499db5+':'+_0x4f318d['id'],_0x4f318d);OpenchannelQueueEvents[_0xe394('0x5')](_0x499db5,_0x4f318d);_0x506bf8(null);};}for(var e in events){if(events[_0xe394('0x6')](e)){var event=events[e];OpenchannelQueue[_0xe394('0x7')](e,emitEvent(event));}}module[_0xe394('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index cccf3f2..6a8a4de 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 _0x25d9=['api','moment','bluebird','path','OpenchannelQueue','lodash','../../config/logger'];(function(_0x25fd2c,_0x4aa71a){var _0x504c4a=function(_0x35f15c){while(--_0x35f15c){_0x25fd2c['push'](_0x25fd2c['shift']());}};_0x504c4a(++_0x4aa71a);}(_0x25d9,0x14e));var _0x925d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x25d9[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x925d('0x0'));var util=require('util');var logger=require(_0x925d('0x1'))(_0x925d('0x2'));var moment=require(_0x925d('0x3'));var BPromise=require(_0x925d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x925d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x2ca766,_0x169909){return _0x2ca766['define'](_0x925d('0x6'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb63=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash'];(function(_0x2661ae,_0x252bed){var _0x18525a=function(_0x18b9f7){while(--_0x18b9f7){_0x2661ae['push'](_0x2661ae['shift']());}};_0x18525a(++_0x252bed);}(_0xfb63,0x154));var _0x3fb6=function(_0x7db3f8,_0x1135fd){_0x7db3f8=_0x7db3f8-0x0;var _0x239272=_0xfb63[_0x7db3f8];return _0x239272;};'use strict';var _=require(_0x3fb6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3fb6('0x1'));var moment=require(_0x3fb6('0x2'));var BPromise=require(_0x3fb6('0x3'));var rp=require(_0x3fb6('0x4'));var fs=require('fs');var path=require(_0x3fb6('0x5'));var rimraf=require(_0x3fb6('0x6'));var config=require(_0x3fb6('0x7'));var attributes=require(_0x3fb6('0x8'));module['exports']=function(_0x4f6dce,_0x525561){return _0x4f6dce[_0x3fb6('0x9')]('OpenchannelQueue',attributes,{'tableName':_0x3fb6('0xa'),'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 467dc26..f4286ea 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 _0x75e6=['debug','error','code','message','info','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','map','model','include','GetOpenchannelQueue','stringify','find','ShowOpenchannelQueue','lodash','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2a2b9d,_0x29ad81){var _0x314b2d=function(_0x2887cb){while(--_0x2887cb){_0x2a2b9d['push'](_0x2a2b9d['shift']());}};_0x314b2d(++_0x29ad81);}(_0x75e6,0x16b));var _0x675e=function(_0xabda9f,_0x295b6c){_0xabda9f=_0xabda9f-0x0;var _0x38b1b2=_0x75e6[_0xabda9f];return _0x38b1b2;};'use strict';var _=require(_0x675e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x675e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x675e('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x675e('0x3'))('rpc');var config=require(_0x675e('0x4'));var jayson=require(_0x675e('0x5'));var client=jayson[_0x675e('0x6')][_0x675e('0x7')]({'port':0x232a});config[_0x675e('0x8')]=_[_0x675e('0x9')](config[_0x675e('0x8')],{'host':_0x675e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x675e('0x8')]));require(_0x675e('0xb'))[_0x675e('0xc')](socket);function respondWithRpcPromise(_0x129eb6,_0x31b10e,_0x507d3d){return new BPromise(function(_0x20b497,_0x347cb1){return client[_0x675e('0xd')](_0x129eb6,_0x507d3d)[_0x675e('0xe')](function(_0xe44c50){logger['info'](_0x675e('0xf'),_0x31b10e,_0x675e('0x10'));logger[_0x675e('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x31b10e,_0x675e('0x10'),JSON['stringify'](_0xe44c50));if(_0xe44c50[_0x675e('0x12')]){if(_0xe44c50[_0x675e('0x12')][_0x675e('0x13')]===0x1f4){logger[_0x675e('0x12')](_0x675e('0xf'),_0x31b10e,_0xe44c50[_0x675e('0x12')][_0x675e('0x14')]);return _0x347cb1(_0xe44c50[_0x675e('0x12')][_0x675e('0x14')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x31b10e,_0xe44c50[_0x675e('0x12')][_0x675e('0x14')]);return _0x20b497(_0xe44c50[_0x675e('0x12')][_0x675e('0x14')]);}else{logger[_0x675e('0x15')](_0x675e('0xf'),_0x31b10e,_0x675e('0x10'));_0x20b497(_0xe44c50[_0x675e('0x16')]['message']);}})[_0x675e('0x17')](function(_0x4de163){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x31b10e,_0x4de163);_0x347cb1(_0x4de163);});});}exports['GetOpenchannelQueue']=function(_0x3ee744){var _0x3e0ebd=this;return new Promise(function(_0x1603d3,_0xa0a2f4){return db[_0x675e('0x18')][_0x675e('0x19')]({'raw':_0x3ee744[_0x675e('0x1a')]?_0x3ee744[_0x675e('0x1a')][_0x675e('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ee744[_0x675e('0x1a')]?_0x3ee744['options'][_0x675e('0x1c')]||null:null,'attributes':_0x3ee744[_0x675e('0x1a')]?_0x3ee744[_0x675e('0x1a')][_0x675e('0x1d')]||null:null,'limit':_0x3ee744[_0x675e('0x1a')]?_0x3ee744['options'][_0x675e('0x1e')]||null:null,'include':_0x3ee744['options']?_0x3ee744[_0x675e('0x1a')]['include']?_[_0x675e('0x1f')](_0x3ee744[_0x675e('0x1a')]['include'],function(_0x5ccd6d){return{'model':db[_0x5ccd6d[_0x675e('0x20')]],'as':_0x5ccd6d['as'],'attributes':_0x5ccd6d[_0x675e('0x1d')],'include':_0x5ccd6d[_0x675e('0x21')]?_[_0x675e('0x1f')](_0x5ccd6d[_0x675e('0x21')],function(_0x46ec96){return{'model':db[_0x46ec96[_0x675e('0x20')]],'as':_0x46ec96['as'],'attributes':_0x46ec96['attributes'],'include':_0x46ec96[_0x675e('0x21')]?_[_0x675e('0x1f')](_0x46ec96[_0x675e('0x21')],function(_0x4f54e8){return{'model':db[_0x4f54e8['model']],'as':_0x4f54e8['as'],'attributes':_0x4f54e8[_0x675e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x675e('0xe')](function(_0xc2c51f){logger[_0x675e('0x15')](_0x675e('0x22'),_0x3ee744);logger[_0x675e('0x11')](_0x675e('0x22'),_0x3ee744,JSON[_0x675e('0x23')](_0xc2c51f));_0x1603d3(_0xc2c51f);})[_0x675e('0x17')](function(_0x3041c9){logger[_0x675e('0x12')](_0x675e('0x22'),_0x3041c9[_0x675e('0x14')],_0x3ee744);_0xa0a2f4(_0x3e0ebd[_0x675e('0x12')](0x1f4,_0x3041c9[_0x675e('0x14')]));});});};exports['ShowOpenchannelQueue']=function(_0x580a8c){var _0x3a4a9b=this;return new Promise(function(_0x51a5b,_0x1caaad){return db[_0x675e('0x18')][_0x675e('0x24')]({'raw':_0x580a8c[_0x675e('0x1a')]?_0x580a8c['options'][_0x675e('0x1b')]===undefined?!![]:![]:!![],'where':_0x580a8c['options']?_0x580a8c['options'][_0x675e('0x1c')]||null:null,'attributes':_0x580a8c['options']?_0x580a8c[_0x675e('0x1a')][_0x675e('0x1d')]||null:null,'include':_0x580a8c[_0x675e('0x1a')]?_0x580a8c[_0x675e('0x1a')]['include']?_[_0x675e('0x1f')](_0x580a8c[_0x675e('0x1a')][_0x675e('0x21')],function(_0x3087d3){return{'model':db[_0x3087d3[_0x675e('0x20')]],'as':_0x3087d3['as'],'attributes':_0x3087d3['attributes'],'include':_0x3087d3[_0x675e('0x21')]?_[_0x675e('0x1f')](_0x3087d3[_0x675e('0x21')],function(_0x555e7b){return{'model':db[_0x555e7b[_0x675e('0x20')]],'as':_0x555e7b['as'],'attributes':_0x555e7b[_0x675e('0x1d')],'include':_0x555e7b[_0x675e('0x21')]?_[_0x675e('0x1f')](_0x555e7b[_0x675e('0x21')],function(_0x1d2360){return{'model':db[_0x1d2360['model']],'as':_0x1d2360['as'],'attributes':_0x1d2360[_0x675e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50f2a7){logger[_0x675e('0x15')]('ShowOpenchannelQueue',_0x580a8c);logger[_0x675e('0x11')](_0x675e('0x25'),_0x580a8c,JSON[_0x675e('0x23')](_0x50f2a7));_0x51a5b(_0x50f2a7);})['catch'](function(_0xf08c7b){logger[_0x675e('0x12')]('ShowOpenchannelQueue',_0xf08c7b['message'],_0x580a8c);_0x1caaad(_0x3a4a9b[_0x675e('0x12')](0x1f4,_0xf08c7b[_0x675e('0x14')]));});});}; \ No newline at end of file +var _0x76b9=['message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','map','include','ShowOpenchannelQueue','find','model','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e15c2,_0x25b65f){var _0xcf2e63=function(_0x1bede2){while(--_0x1bede2){_0x3e15c2['push'](_0x3e15c2['shift']());}};_0xcf2e63(++_0x25b65f);}(_0x76b9,0xec));var _0x976b=function(_0xfb3e6f,_0x334293){_0xfb3e6f=_0xfb3e6f-0x0;var _0x3c0ccf=_0x76b9[_0xfb3e6f];return _0x3c0ccf;};'use strict';var _=require(_0x976b('0x0'));var util=require('util');var moment=require(_0x976b('0x1'));var BPromise=require(_0x976b('0x2'));var rs=require(_0x976b('0x3'));var fs=require('fs');var Redis=require(_0x976b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x976b('0x5'));var logger=require(_0x976b('0x6'))(_0x976b('0x7'));var config=require(_0x976b('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x976b('0x9')]=_[_0x976b('0xa')](config['redis'],{'host':_0x976b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x976b('0x9')]));require(_0x976b('0xc'))[_0x976b('0xd')](socket);function respondWithRpcPromise(_0x58781f,_0x581f8c,_0x245bab){return new BPromise(function(_0x79c7a6,_0x88162e){return client['request'](_0x58781f,_0x245bab)[_0x976b('0xe')](function(_0x486f4b){logger[_0x976b('0xf')](_0x976b('0x10'),_0x581f8c,_0x976b('0x11'));logger[_0x976b('0x12')](_0x976b('0x13'),_0x581f8c,_0x976b('0x11'),JSON[_0x976b('0x14')](_0x486f4b));if(_0x486f4b['error']){if(_0x486f4b[_0x976b('0x15')][_0x976b('0x16')]===0x1f4){logger[_0x976b('0x15')](_0x976b('0x10'),_0x581f8c,_0x486f4b[_0x976b('0x15')][_0x976b('0x17')]);return _0x88162e(_0x486f4b[_0x976b('0x15')][_0x976b('0x17')]);}logger[_0x976b('0x15')](_0x976b('0x10'),_0x581f8c,_0x486f4b[_0x976b('0x15')][_0x976b('0x17')]);return _0x79c7a6(_0x486f4b['error'][_0x976b('0x17')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x581f8c,_0x976b('0x11'));_0x79c7a6(_0x486f4b[_0x976b('0x18')]['message']);}})[_0x976b('0x19')](function(_0x50662f){logger['error'](_0x976b('0x10'),_0x581f8c,_0x50662f);_0x88162e(_0x50662f);});});}exports[_0x976b('0x1a')]=function(_0x3a0e06){var _0x776923=this;return new Promise(function(_0x2f8c95,_0x1f536e){return db[_0x976b('0x1b')]['findAll']({'raw':_0x3a0e06[_0x976b('0x1c')]?_0x3a0e06[_0x976b('0x1c')][_0x976b('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a0e06['options']?_0x3a0e06[_0x976b('0x1c')][_0x976b('0x1e')]||null:null,'attributes':_0x3a0e06['options']?_0x3a0e06['options'][_0x976b('0x1f')]||null:null,'limit':_0x3a0e06[_0x976b('0x1c')]?_0x3a0e06[_0x976b('0x1c')]['limit']||null:null,'include':_0x3a0e06[_0x976b('0x1c')]?_0x3a0e06['options']['include']?_[_0x976b('0x20')](_0x3a0e06[_0x976b('0x1c')][_0x976b('0x21')],function(_0x3f3ab1){return{'model':db[_0x3f3ab1['model']],'as':_0x3f3ab1['as'],'attributes':_0x3f3ab1[_0x976b('0x1f')],'include':_0x3f3ab1[_0x976b('0x21')]?_[_0x976b('0x20')](_0x3f3ab1[_0x976b('0x21')],function(_0x3fdc61){return{'model':db[_0x3fdc61['model']],'as':_0x3fdc61['as'],'attributes':_0x3fdc61[_0x976b('0x1f')],'include':_0x3fdc61['include']?_[_0x976b('0x20')](_0x3fdc61['include'],function(_0x261577){return{'model':db[_0x261577['model']],'as':_0x261577['as'],'attributes':_0x261577[_0x976b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x976b('0xe')](function(_0x143e3d){logger[_0x976b('0xf')](_0x976b('0x1a'),_0x3a0e06);logger['debug']('GetOpenchannelQueue',_0x3a0e06,JSON['stringify'](_0x143e3d));_0x2f8c95(_0x143e3d);})['catch'](function(_0x9e5a5f){logger['error'](_0x976b('0x1a'),_0x9e5a5f['message'],_0x3a0e06);_0x1f536e(_0x776923[_0x976b('0x15')](0x1f4,_0x9e5a5f['message']));});});};exports[_0x976b('0x22')]=function(_0x3f4c54){var _0x5b4c35=this;return new Promise(function(_0x2adb5e,_0x31181d){return db['OpenchannelQueue'][_0x976b('0x23')]({'raw':_0x3f4c54['options']?_0x3f4c54[_0x976b('0x1c')][_0x976b('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f4c54[_0x976b('0x1c')]?_0x3f4c54[_0x976b('0x1c')][_0x976b('0x1e')]||null:null,'attributes':_0x3f4c54[_0x976b('0x1c')]?_0x3f4c54['options'][_0x976b('0x1f')]||null:null,'include':_0x3f4c54['options']?_0x3f4c54[_0x976b('0x1c')][_0x976b('0x21')]?_[_0x976b('0x20')](_0x3f4c54[_0x976b('0x1c')]['include'],function(_0x36448a){return{'model':db[_0x36448a['model']],'as':_0x36448a['as'],'attributes':_0x36448a['attributes'],'include':_0x36448a[_0x976b('0x21')]?_['map'](_0x36448a[_0x976b('0x21')],function(_0x1bbfb4){return{'model':db[_0x1bbfb4[_0x976b('0x24')]],'as':_0x1bbfb4['as'],'attributes':_0x1bbfb4[_0x976b('0x1f')],'include':_0x1bbfb4[_0x976b('0x21')]?_['map'](_0x1bbfb4[_0x976b('0x21')],function(_0xd2fe37){return{'model':db[_0xd2fe37['model']],'as':_0xd2fe37['as'],'attributes':_0xd2fe37[_0x976b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b7865){logger[_0x976b('0xf')]('ShowOpenchannelQueue',_0x3f4c54);logger[_0x976b('0x12')](_0x976b('0x22'),_0x3f4c54,JSON[_0x976b('0x14')](_0x4b7865));_0x2adb5e(_0x4b7865);})[_0x976b('0x19')](function(_0xdc461b){logger[_0x976b('0x15')](_0x976b('0x22'),_0xdc461b[_0x976b('0x17')],_0x3f4c54);_0x31181d(_0x5b4c35[_0x976b('0x15')](0x1f4,_0xdc461b['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index f8a3f6e..8bee562 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 _0xb125=['length','openchannelQueue:','./openchannelQueue.events','save','update','emit','removeListener','register'];(function(_0x525907,_0x1d18fa){var _0x2b7680=function(_0x5d70e0){while(--_0x5d70e0){_0x525907['push'](_0x525907['shift']());}};_0x2b7680(++_0x1d18fa);}(_0xb125,0x1a2));var _0x5b12=function(_0x4f656f,_0x4721cd){_0x4f656f=_0x4f656f-0x0;var _0x4aa9f0=_0xb125[_0x4f656f];return _0x4aa9f0;};'use strict';var OpenchannelQueueEvents=require(_0x5b12('0x0'));var events=[_0x5b12('0x1'),'remove',_0x5b12('0x2')];function createListener(_0x192284,_0x47acf4){return function(_0x1be993){_0x47acf4[_0x5b12('0x3')](_0x192284,_0x1be993);};}function removeListener(_0x20ff52,_0x1dc769){return function(){OpenchannelQueueEvents[_0x5b12('0x4')](_0x20ff52,_0x1dc769);};}exports[_0x5b12('0x5')]=function(_0x3ac7f9){for(var _0x3150b9=0x0,_0x984f69=events[_0x5b12('0x6')];_0x3150b9<_0x984f69;_0x3150b9++){var _0x29f024=events[_0x3150b9];var _0x445538=createListener(_0x5b12('0x7')+_0x29f024,_0x3ac7f9);OpenchannelQueueEvents['on'](_0x29f024,_0x445538);}}; \ No newline at end of file +var _0x97c2=['length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener','register'];(function(_0x1a6a25,_0x2394f6){var _0x592ccb=function(_0x4f6994){while(--_0x4f6994){_0x1a6a25['push'](_0x1a6a25['shift']());}};_0x592ccb(++_0x2394f6);}(_0x97c2,0x18a));var _0x297c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x97c2[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelQueueEvents=require(_0x297c('0x0'));var events=['save',_0x297c('0x1'),_0x297c('0x2')];function createListener(_0x13f77a,_0x2249bd){return function(_0x1eeb59){_0x2249bd[_0x297c('0x3')](_0x13f77a,_0x1eeb59);};}function removeListener(_0x41f597,_0x8a5c08){return function(){OpenchannelQueueEvents[_0x297c('0x4')](_0x41f597,_0x8a5c08);};}exports[_0x297c('0x5')]=function(_0x11ecc7){for(var _0x36a739=0x0,_0x3a3180=events[_0x297c('0x6')];_0x36a739<_0x3a3180;_0x36a739++){var _0x449c40=events[_0x36a739];var _0x1422b1=createListener(_0x297c('0x7')+_0x449c40,_0x11ecc7);OpenchannelQueueEvents['on'](_0x449c40,_0x1422b1);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 693e158..e663965 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 _0x98a2=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x98a2,0x17f));var _0x298a=function(_0x47dd8d,_0xe0fd50){_0x47dd8d=_0x47dd8d-0x0;var _0x41aae4=_0x98a2[_0x47dd8d];return _0x41aae4;};'use strict';var multer=require(_0x298a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x298a('0x1'));var express=require(_0x298a('0x2'));var router=express[_0x298a('0x3')]();var fs_extra=require(_0x298a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x298a('0x5'));var config=require(_0x298a('0x6'));var controller=require(_0x298a('0x7'));router['get']('/',auth[_0x298a('0x8')](),controller[_0x298a('0x9')]);router[_0x298a('0xa')](_0x298a('0xb'),auth[_0x298a('0x8')](),controller[_0x298a('0xc')]);router[_0x298a('0xa')](_0x298a('0xd'),auth[_0x298a('0x8')](),controller['show']);router[_0x298a('0xe')]('/',auth['isAuthenticated'](),controller[_0x298a('0xf')]);router[_0x298a('0x10')](_0x298a('0xd'),auth[_0x298a('0x8')](),controller['update']);router[_0x298a('0x11')](_0x298a('0xd'),auth[_0x298a('0x8')](),controller[_0x298a('0x12')]);module[_0x298a('0x13')]=router; \ No newline at end of file +var _0x51c2=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','post','put','update','delete','/:id','destroy'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0x51c2,0xfc));var _0x251c=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0x51c2[_0x235482];return _0x5f5bea;};'use strict';var multer=require('multer');var util=require(_0x251c('0x0'));var path=require(_0x251c('0x1'));var timeout=require('connect-timeout');var express=require(_0x251c('0x2'));var router=express[_0x251c('0x3')]();var fs_extra=require(_0x251c('0x4'));var auth=require(_0x251c('0x5'));var interaction=require(_0x251c('0x6'));var config=require(_0x251c('0x7'));var controller=require(_0x251c('0x8'));router[_0x251c('0x9')]('/',auth['isAuthenticated'](),controller[_0x251c('0xa')]);router['get'](_0x251c('0xb'),auth[_0x251c('0xc')](),controller[_0x251c('0xd')]);router[_0x251c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x251c('0xe')]);router[_0x251c('0xf')]('/',auth[_0x251c('0xc')](),controller['create']);router[_0x251c('0x10')]('/:id',auth[_0x251c('0xc')](),controller[_0x251c('0x11')]);router[_0x251c('0x12')](_0x251c('0x13'),auth[_0x251c('0xc')](),controller[_0x251c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index e4d4216..fba40d3 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 _0xa2c5=['STRING','DATE','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa2c5,0x7a));var _0x5a2c=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xa2c5[_0xc4001c];return _0x49f7bc;};'use strict';var moment=require('moment');var Sequelize=require(_0x5a2c('0x0'));module[_0x5a2c('0x1')]={'uniqueid':{'type':Sequelize[_0x5a2c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5a2c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5a2c('0x3')]},'acceptAt':{'type':Sequelize[_0x5a2c('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5a2c('0x2')]}}; \ No newline at end of file +var _0x0303=['DATE','STRING'];(function(_0x493a07,_0x123d76){var _0x23d140=function(_0x1ae684){while(--_0x1ae684){_0x493a07['push'](_0x493a07['shift']());}};_0x23d140(++_0x123d76);}(_0x0303,0x159));var _0x3030=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x0303[_0x246f0c];return _0x30fe50;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3030('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x3030('0x0')]},'joinAt':{'type':Sequelize[_0x3030('0x1')]},'leaveAt':{'type':Sequelize[_0x3030('0x1')]},'acceptAt':{'type':Sequelize[_0x3030('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3030('0x0')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6c0cc1c..2779a42 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 _0x36f4=['set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','catch','show','params','includeAll','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','offset','count'];(function(_0x578522,_0x53ef80){var _0x14fda6=function(_0x32f199){while(--_0x32f199){_0x578522['push'](_0x578522['shift']());}};_0x14fda6(++_0x53ef80);}(_0x36f4,0x1db));var _0x436f=function(_0x558972,_0x426a69){_0x558972=_0x558972-0x0;var _0x190b74=_0x36f4[_0x558972];return _0x190b74;};'use strict';var emlformat=require(_0x436f('0x0'));var rimraf=require(_0x436f('0x1'));var zipdir=require(_0x436f('0x2'));var jsonpatch=require(_0x436f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x436f('0x4'));var util=require(_0x436f('0x5'));var path=require(_0x436f('0x6'));var sox=require('sox');var csv=require(_0x436f('0x7'));var ejs=require(_0x436f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x436f('0x9'));var squel=require('squel');var crypto=require(_0x436f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x436f('0x7'));var querystring=require(_0x436f('0xb'));var Papa=require(_0x436f('0xc'));var Redis=require(_0x436f('0xd'));var authService=require(_0x436f('0xe'));var qs=require(_0x436f('0xf'));var as=require(_0x436f('0x10'));var hardwareService=require(_0x436f('0x11'));var logger=require(_0x436f('0x12'))(_0x436f('0x13'));var utils=require(_0x436f('0x14'));var config=require(_0x436f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x595af5,_0x1b1a73){_0x1b1a73=_0x1b1a73||0xcc;return function(_0x405389){if(_0x405389){return _0x595af5[_0x436f('0x16')](_0x1b1a73);}return _0x595af5[_0x436f('0x17')](_0x1b1a73)['end']();};}function respondWithResult(_0x1953f9,_0x3e3be9){_0x3e3be9=_0x3e3be9||0xc8;return function(_0x2b4e7e){if(_0x2b4e7e){return _0x1953f9[_0x436f('0x17')](_0x3e3be9)[_0x436f('0x18')](_0x2b4e7e);}};}function respondWithFilteredResult(_0xa281ff,_0x335ab8){return function(_0x10ea43){if(_0x10ea43){var _0x490ab6=typeof _0x335ab8['offset']===_0x436f('0x19')&&typeof _0x335ab8[_0x436f('0x1a')]===_0x436f('0x19');var _0x2ab883=_0x10ea43['count'];var _0x19ce60=_0x490ab6?0x0:_0x335ab8[_0x436f('0x1b')];var _0x46489b=_0x490ab6?_0x10ea43[_0x436f('0x1c')]:_0x335ab8[_0x436f('0x1b')]+_0x335ab8[_0x436f('0x1a')];var _0x4df954;if(_0x46489b>=_0x2ab883){_0x46489b=_0x2ab883;_0x4df954=0xc8;}else{_0x4df954=0xce;}_0xa281ff[_0x436f('0x17')](_0x4df954);return _0xa281ff[_0x436f('0x1d')](_0x436f('0x1e'),_0x19ce60+'-'+_0x46489b+'/'+_0x2ab883)['json'](_0x10ea43);}return null;};}function patchUpdates(_0x7a886f){return function(_0x4d717f){try{jsonpatch[_0x436f('0x1f')](_0x4d717f,_0x7a886f,!![]);}catch(_0x525624){return BPromise[_0x436f('0x20')](_0x525624);}return _0x4d717f['save']();};}function saveUpdates(_0x383200,_0x454d92){return function(_0x38e869){if(_0x38e869){return _0x38e869[_0x436f('0x21')](_0x383200)[_0x436f('0x22')](function(_0x4f825e){return _0x4f825e;});}return null;};}function removeEntity(_0x36c854,_0x4850a8){return function(_0x4e9254){if(_0x4e9254){return _0x4e9254[_0x436f('0x23')]()[_0x436f('0x22')](function(){_0x36c854[_0x436f('0x17')](0xcc)[_0x436f('0x24')]();});}};}function handleEntityNotFound(_0x5384bf,_0x5a6363){return function(_0x5511cd){if(!_0x5511cd){_0x5384bf[_0x436f('0x16')](0x194);}return _0x5511cd;};}function handleError(_0x264e09,_0x47d464){_0x47d464=_0x47d464||0x1f4;return function(_0x4d89fe){logger[_0x436f('0x25')](_0x4d89fe[_0x436f('0x26')]);if(_0x4d89fe[_0x436f('0x27')]){delete _0x4d89fe[_0x436f('0x27')];}_0x264e09[_0x436f('0x17')](_0x47d464)['send'](_0x4d89fe);};}exports[_0x436f('0x28')]=function(_0x4ed743,_0xd90f9e){var _0x5432c4={},_0x2c44ba={},_0x268f24={'count':0x0,'rows':[]};var _0x5c60a4=_[_0x436f('0x29')](db[_0x436f('0x2a')][_0x436f('0x2b')],function(_0x35c6a4){return{'name':_0x35c6a4[_0x436f('0x2c')],'type':_0x35c6a4[_0x436f('0x2d')][_0x436f('0x2e')]};});_0x2c44ba['model']=_[_0x436f('0x29')](_0x5c60a4,_0x436f('0x27'));_0x2c44ba[_0x436f('0x2f')]=_[_0x436f('0x30')](_0x4ed743[_0x436f('0x2f')]);_0x2c44ba[_0x436f('0x31')]=_['intersection'](_0x2c44ba[_0x436f('0x32')],_0x2c44ba[_0x436f('0x2f')]);_0x5432c4[_0x436f('0x33')]=_[_0x436f('0x34')](_0x2c44ba[_0x436f('0x32')],qs[_0x436f('0x35')](_0x4ed743[_0x436f('0x2f')][_0x436f('0x35')]));_0x5432c4[_0x436f('0x33')]=_0x5432c4['attributes'][_0x436f('0x36')]?_0x5432c4[_0x436f('0x33')]:_0x2c44ba[_0x436f('0x32')];if(!_0x4ed743['query'][_0x436f('0x37')](_0x436f('0x38'))){_0x5432c4[_0x436f('0x1a')]=qs[_0x436f('0x1a')](_0x4ed743[_0x436f('0x2f')][_0x436f('0x1a')]);_0x5432c4['offset']=qs[_0x436f('0x1b')](_0x4ed743[_0x436f('0x2f')][_0x436f('0x1b')]);}_0x5432c4[_0x436f('0x39')]=qs[_0x436f('0x3a')](_0x4ed743[_0x436f('0x2f')]['sort']);_0x5432c4[_0x436f('0x3b')]=qs[_0x436f('0x31')](_['pick'](_0x4ed743[_0x436f('0x2f')],_0x2c44ba[_0x436f('0x31')]),_0x5c60a4);if(_0x4ed743['query'][_0x436f('0x3c')]){_0x5432c4['where']=_[_0x436f('0x3d')](_0x5432c4[_0x436f('0x3b')],{'$or':_[_0x436f('0x29')](_0x5c60a4,function(_0x4a6099){if(_0x4a6099[_0x436f('0x2d')]!==_0x436f('0x3e')){var _0x3bd61c={};_0x3bd61c[_0x4a6099['name']]={'$like':'%'+_0x4ed743[_0x436f('0x2f')]['filter']+'%'};return _0x3bd61c;}})});}_0x5432c4=_[_0x436f('0x3d')]({},_0x5432c4,_0x4ed743['options']);var _0x35fd0b={'where':_0x5432c4[_0x436f('0x3b')]};return db['OpenchannelQueueReport'][_0x436f('0x1c')](_0x35fd0b)[_0x436f('0x22')](function(_0x51bd41){_0x268f24[_0x436f('0x1c')]=_0x51bd41;if(_0x4ed743[_0x436f('0x2f')]['includeAll']){_0x5432c4[_0x436f('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x5432c4);})[_0x436f('0x22')](function(_0x298915){_0x268f24['rows']=_0x298915;return _0x268f24;})[_0x436f('0x22')](respondWithFilteredResult(_0xd90f9e,_0x5432c4))[_0x436f('0x40')](handleError(_0xd90f9e,null));};exports[_0x436f('0x41')]=function(_0x3403f2,_0x13c1ca){var _0x125ee5={'raw':!![],'where':{'id':_0x3403f2[_0x436f('0x42')]['id']}},_0x4700e1={};_0x4700e1[_0x436f('0x32')]=_[_0x436f('0x30')](db[_0x436f('0x2a')][_0x436f('0x2b')]);_0x4700e1[_0x436f('0x2f')]=_[_0x436f('0x30')](_0x3403f2[_0x436f('0x2f')]);_0x4700e1[_0x436f('0x31')]=_[_0x436f('0x34')](_0x4700e1[_0x436f('0x32')],_0x4700e1[_0x436f('0x2f')]);_0x125ee5['attributes']=_['intersection'](_0x4700e1[_0x436f('0x32')],qs['fields'](_0x3403f2[_0x436f('0x2f')]['fields']));_0x125ee5['attributes']=_0x125ee5['attributes']['length']?_0x125ee5[_0x436f('0x33')]:_0x4700e1['model'];if(_0x3403f2[_0x436f('0x2f')][_0x436f('0x43')]){_0x125ee5['include']=[{'all':!![]}];}_0x125ee5=_[_0x436f('0x3d')]({},_0x125ee5,_0x3403f2[_0x436f('0x44')]);return db[_0x436f('0x2a')][_0x436f('0x45')](_0x125ee5)['then'](handleEntityNotFound(_0x13c1ca,null))['then'](respondWithResult(_0x13c1ca,null))['catch'](handleError(_0x13c1ca,null));};exports['create']=function(_0x27562e,_0x1f27fe){return db['OpenchannelQueueReport']['create'](_0x27562e[_0x436f('0x46')],{})['then'](respondWithResult(_0x1f27fe,0xc9))[_0x436f('0x40')](handleError(_0x1f27fe,null));};exports[_0x436f('0x21')]=function(_0x5c39b1,_0xffd8ae){if(_0x5c39b1[_0x436f('0x46')]['id']){delete _0x5c39b1[_0x436f('0x46')]['id'];}return db[_0x436f('0x2a')][_0x436f('0x45')]({'where':{'id':_0x5c39b1[_0x436f('0x42')]['id']}})[_0x436f('0x22')](handleEntityNotFound(_0xffd8ae,null))[_0x436f('0x22')](saveUpdates(_0x5c39b1[_0x436f('0x46')],null))[_0x436f('0x22')](respondWithResult(_0xffd8ae,null))[_0x436f('0x40')](handleError(_0xffd8ae,null));};exports[_0x436f('0x23')]=function(_0x36ebc1,_0x475a41){return db[_0x436f('0x2a')][_0x436f('0x45')]({'where':{'id':_0x36ebc1['params']['id']}})[_0x436f('0x22')](handleEntityNotFound(_0x475a41,null))[_0x436f('0x22')](removeEntity(_0x475a41,null))[_0x436f('0x40')](handleError(_0x475a41,null));};exports['describe']=function(_0x19bdd0,_0x186d01){return db['OpenchannelQueueReport'][_0x436f('0x47')]()[_0x436f('0x22')](respondWithResult(_0x186d01,null))[_0x436f('0x40')](handleError(_0x186d01,null));}; \ No newline at end of file +var _0x0188=['stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x0188,0x164));var _0x8018=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x0188[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8018('0x0'));var zipdir=require(_0x8018('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8018('0x2'));var moment=require('moment');var BPromise=require(_0x8018('0x3'));var Mustache=require(_0x8018('0x4'));var util=require(_0x8018('0x5'));var path=require(_0x8018('0x6'));var sox=require('sox');var csv=require(_0x8018('0x7'));var ejs=require(_0x8018('0x8'));var fs=require('fs');var fs_extra=require(_0x8018('0x9'));var _=require(_0x8018('0xa'));var squel=require(_0x8018('0xb'));var crypto=require(_0x8018('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8018('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8018('0xe'));var Papa=require(_0x8018('0xf'));var Redis=require(_0x8018('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8018('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8018('0x12'));var logger=require(_0x8018('0x13'))(_0x8018('0x14'));var utils=require(_0x8018('0x15'));var config=require(_0x8018('0x16'));var licenseUtil=require(_0x8018('0x17'));var db=require(_0x8018('0x18'))['db'];function respondWithStatusCode(_0x20d05f,_0x21449d){_0x21449d=_0x21449d||0xcc;return function(_0x114ad6){if(_0x114ad6){return _0x20d05f[_0x8018('0x19')](_0x21449d);}return _0x20d05f[_0x8018('0x1a')](_0x21449d)['end']();};}function respondWithResult(_0x57145b,_0xecb2b8){_0xecb2b8=_0xecb2b8||0xc8;return function(_0x23d9b2){if(_0x23d9b2){return _0x57145b['status'](_0xecb2b8)[_0x8018('0x1b')](_0x23d9b2);}};}function respondWithFilteredResult(_0x3750b3,_0x2cf2cf){return function(_0x1185a7){if(_0x1185a7){var _0x296ff7=typeof _0x2cf2cf['offset']==='undefined'&&typeof _0x2cf2cf[_0x8018('0x1c')]==='undefined';var _0x122208=_0x1185a7[_0x8018('0x1d')];var _0x4dc7a4=_0x296ff7?0x0:_0x2cf2cf[_0x8018('0x1e')];var _0x3f4b3b=_0x296ff7?_0x1185a7[_0x8018('0x1d')]:_0x2cf2cf[_0x8018('0x1e')]+_0x2cf2cf[_0x8018('0x1c')];var _0xa191f2;if(_0x3f4b3b>=_0x122208){_0x3f4b3b=_0x122208;_0xa191f2=0xc8;}else{_0xa191f2=0xce;}_0x3750b3[_0x8018('0x1a')](_0xa191f2);return _0x3750b3[_0x8018('0x1f')](_0x8018('0x20'),_0x4dc7a4+'-'+_0x3f4b3b+'/'+_0x122208)[_0x8018('0x1b')](_0x1185a7);}return null;};}function patchUpdates(_0x496259){return function(_0x1a567b){try{jsonpatch[_0x8018('0x21')](_0x1a567b,_0x496259,!![]);}catch(_0x2e408b){return BPromise[_0x8018('0x22')](_0x2e408b);}return _0x1a567b[_0x8018('0x23')]();};}function saveUpdates(_0x26a76c,_0x4ed732){return function(_0x3e3b73){if(_0x3e3b73){return _0x3e3b73[_0x8018('0x24')](_0x26a76c)[_0x8018('0x25')](function(_0x283e7a){return _0x283e7a;});}return null;};}function removeEntity(_0xab0398,_0x2688f7){return function(_0x2ba7d5){if(_0x2ba7d5){return _0x2ba7d5['destroy']()[_0x8018('0x25')](function(){_0xab0398[_0x8018('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x463d3b,_0x3de9ca){return function(_0x426678){if(!_0x426678){_0x463d3b['sendStatus'](0x194);}return _0x426678;};}function handleError(_0x58e9d7,_0x231d7){_0x231d7=_0x231d7||0x1f4;return function(_0x511885){logger[_0x8018('0x26')](_0x511885[_0x8018('0x27')]);if(_0x511885['name']){delete _0x511885[_0x8018('0x28')];}_0x58e9d7[_0x8018('0x1a')](_0x231d7)[_0x8018('0x29')](_0x511885);};}exports[_0x8018('0x2a')]=function(_0x647675,_0x56d25e){var _0x4276ed={},_0xa07f4a={},_0x34fe68={'count':0x0,'rows':[]};var _0x5456f8=_[_0x8018('0x2b')](db['OpenchannelQueueReport'][_0x8018('0x2c')],function(_0x57362c){return{'name':_0x57362c[_0x8018('0x2d')],'type':_0x57362c[_0x8018('0x2e')][_0x8018('0x2f')]};});_0xa07f4a['model']=_[_0x8018('0x2b')](_0x5456f8,'name');_0xa07f4a['query']=_[_0x8018('0x30')](_0x647675[_0x8018('0x31')]);_0xa07f4a['filters']=_[_0x8018('0x32')](_0xa07f4a[_0x8018('0x33')],_0xa07f4a['query']);_0x4276ed[_0x8018('0x34')]=_['intersection'](_0xa07f4a[_0x8018('0x33')],qs[_0x8018('0x35')](_0x647675[_0x8018('0x31')]['fields']));_0x4276ed[_0x8018('0x34')]=_0x4276ed[_0x8018('0x34')][_0x8018('0x36')]?_0x4276ed['attributes']:_0xa07f4a[_0x8018('0x33')];if(!_0x647675['query'][_0x8018('0x37')](_0x8018('0x38'))){_0x4276ed['limit']=qs[_0x8018('0x1c')](_0x647675[_0x8018('0x31')][_0x8018('0x1c')]);_0x4276ed[_0x8018('0x1e')]=qs[_0x8018('0x1e')](_0x647675[_0x8018('0x31')][_0x8018('0x1e')]);}_0x4276ed[_0x8018('0x39')]=qs[_0x8018('0x3a')](_0x647675['query'][_0x8018('0x3a')]);_0x4276ed[_0x8018('0x3b')]=qs[_0x8018('0x3c')](_[_0x8018('0x3d')](_0x647675[_0x8018('0x31')],_0xa07f4a[_0x8018('0x3c')]),_0x5456f8);if(_0x647675['query']['filter']){_0x4276ed[_0x8018('0x3b')]=_[_0x8018('0x3e')](_0x4276ed[_0x8018('0x3b')],{'$or':_[_0x8018('0x2b')](_0x5456f8,function(_0x53f1fe){if(_0x53f1fe[_0x8018('0x2e')]!==_0x8018('0x3f')){var _0x2a420d={};_0x2a420d[_0x53f1fe[_0x8018('0x28')]]={'$like':'%'+_0x647675['query'][_0x8018('0x40')]+'%'};return _0x2a420d;}})});}_0x4276ed=_[_0x8018('0x3e')]({},_0x4276ed,_0x647675[_0x8018('0x41')]);var _0xbb0a3b={'where':_0x4276ed[_0x8018('0x3b')]};return db[_0x8018('0x42')][_0x8018('0x1d')](_0xbb0a3b)[_0x8018('0x25')](function(_0x5ded3f){_0x34fe68[_0x8018('0x1d')]=_0x5ded3f;if(_0x647675[_0x8018('0x31')][_0x8018('0x43')]){_0x4276ed[_0x8018('0x44')]=[{'all':!![]}];}return db[_0x8018('0x42')][_0x8018('0x45')](_0x4276ed);})[_0x8018('0x25')](function(_0x274915){_0x34fe68[_0x8018('0x46')]=_0x274915;return _0x34fe68;})[_0x8018('0x25')](respondWithFilteredResult(_0x56d25e,_0x4276ed))[_0x8018('0x47')](handleError(_0x56d25e,null));};exports[_0x8018('0x48')]=function(_0x3d82d7,_0x22ec20){var _0x3def26={'raw':!![],'where':{'id':_0x3d82d7[_0x8018('0x49')]['id']}},_0x3207a9={};_0x3207a9[_0x8018('0x33')]=_[_0x8018('0x30')](db[_0x8018('0x42')][_0x8018('0x2c')]);_0x3207a9[_0x8018('0x31')]=_[_0x8018('0x30')](_0x3d82d7['query']);_0x3207a9[_0x8018('0x3c')]=_[_0x8018('0x32')](_0x3207a9[_0x8018('0x33')],_0x3207a9[_0x8018('0x31')]);_0x3def26[_0x8018('0x34')]=_[_0x8018('0x32')](_0x3207a9[_0x8018('0x33')],qs[_0x8018('0x35')](_0x3d82d7['query'][_0x8018('0x35')]));_0x3def26[_0x8018('0x34')]=_0x3def26[_0x8018('0x34')][_0x8018('0x36')]?_0x3def26[_0x8018('0x34')]:_0x3207a9[_0x8018('0x33')];if(_0x3d82d7[_0x8018('0x31')][_0x8018('0x43')]){_0x3def26[_0x8018('0x44')]=[{'all':!![]}];}_0x3def26=_[_0x8018('0x3e')]({},_0x3def26,_0x3d82d7['options']);return db[_0x8018('0x42')][_0x8018('0x4a')](_0x3def26)[_0x8018('0x25')](handleEntityNotFound(_0x22ec20,null))[_0x8018('0x25')](respondWithResult(_0x22ec20,null))[_0x8018('0x47')](handleError(_0x22ec20,null));};exports[_0x8018('0x4b')]=function(_0x222805,_0x2896eb){return db[_0x8018('0x42')][_0x8018('0x4b')](_0x222805[_0x8018('0x4c')],{})['then'](respondWithResult(_0x2896eb,0xc9))[_0x8018('0x47')](handleError(_0x2896eb,null));};exports['update']=function(_0x243b8a,_0x24299d){if(_0x243b8a[_0x8018('0x4c')]['id']){delete _0x243b8a[_0x8018('0x4c')]['id'];}return db[_0x8018('0x42')][_0x8018('0x4a')]({'where':{'id':_0x243b8a['params']['id']}})[_0x8018('0x25')](handleEntityNotFound(_0x24299d,null))[_0x8018('0x25')](saveUpdates(_0x243b8a['body'],null))['then'](respondWithResult(_0x24299d,null))['catch'](handleError(_0x24299d,null));};exports[_0x8018('0x4d')]=function(_0x2d7dc9,_0x23b0c3){return db[_0x8018('0x42')][_0x8018('0x4a')]({'where':{'id':_0x2d7dc9['params']['id']}})['then'](handleEntityNotFound(_0x23b0c3,null))[_0x8018('0x25')](removeEntity(_0x23b0c3,null))[_0x8018('0x47')](handleError(_0x23b0c3,null));};exports['describe']=function(_0x454e53,_0x1fa272){return db[_0x8018('0x42')][_0x8018('0x4e')]()[_0x8018('0x25')](respondWithResult(_0x1fa272,null))['catch'](handleError(_0x1fa272,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4cd6ac0..2f3b659 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(_0x43e745,_0x48e2c2){var _0x1f5546=function(_0x47b509){while(--_0x47b509){_0x43e745['push'](_0x43e745['shift']());}};_0x1f5546(++_0x48e2c2);}(_0x1261,0x144));var _0x1126=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x1261[_0x2b55b5];return _0x103d28;};'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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0x814b,0x1a2));var _0xb814=function(_0x4cdcdc,_0x34eac7){_0x4cdcdc=_0x4cdcdc-0x0;var _0x4704ce=_0x814b[_0x4cdcdc];return _0x4704ce;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('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 dd447e0..17327ca 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 _0x4cf8=['info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateOpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x49c824,_0x18e9be){var _0x29dc99=function(_0x1b1080){while(--_0x1b1080){_0x49c824['push'](_0x49c824['shift']());}};_0x29dc99(++_0x18e9be);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0x4cf8[_0x77d310];return _0x2cdce4;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));var BPromise=require(_0x84cf('0x3'));var rs=require(_0x84cf('0x4'));var fs=require('fs');var Redis=require(_0x84cf('0x5'));var db=require(_0x84cf('0x6'))['db'];var utils=require(_0x84cf('0x7'));var logger=require(_0x84cf('0x8'))(_0x84cf('0x9'));var config=require(_0x84cf('0xa'));var jayson=require(_0x84cf('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x455345,_0x56c5cc,_0x15ba85){return new BPromise(function(_0x2c11b0,_0x51b84c){return client[_0x84cf('0xc')](_0x455345,_0x15ba85)[_0x84cf('0xd')](function(_0x489063){logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));logger[_0x84cf('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x56c5cc,_0x84cf('0x10'),JSON[_0x84cf('0x12')](_0x489063));if(_0x489063['error']){if(_0x489063['error'][_0x84cf('0x13')]===0x1f4){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x51b84c(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x2c11b0(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}else{logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));_0x2c11b0(_0x489063[_0x84cf('0x16')][_0x84cf('0x15')]);}})[_0x84cf('0x17')](function(_0x5b8ac8){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x5b8ac8);_0x51b84c(_0x5b8ac8);});});}exports[_0x84cf('0x18')]=function(_0x1abe2d){var _0x1dad1a=this;return new Promise(function(_0x13ba16,_0xe6b5b6){return db['OpenchannelQueueReport']['create'](_0x1abe2d[_0x84cf('0x19')],{'raw':_0x1abe2d[_0x84cf('0x1a')]?_0x1abe2d[_0x84cf('0x1a')][_0x84cf('0x1b')]===undefined?!![]:![]:!![]})[_0x84cf('0xd')](function(_0x5dda3f){logger[_0x84cf('0xe')](_0x84cf('0x18'),_0x1abe2d);logger[_0x84cf('0x11')](_0x84cf('0x18'),_0x1abe2d,JSON[_0x84cf('0x12')](_0x5dda3f));_0x13ba16(_0x5dda3f);})['catch'](function(_0x42fa45){logger[_0x84cf('0x14')](_0x84cf('0x18'),_0x42fa45[_0x84cf('0x15')],_0x1abe2d);_0xe6b5b6(_0x1dad1a[_0x84cf('0x14')](0x1f4,_0x42fa45[_0x84cf('0x15')]));});});};exports[_0x84cf('0x1c')]=function(_0x4c9d1c){var _0x2b2c90=this;return new Promise(function(_0x26db3f,_0x1c7747){return db[_0x84cf('0x1d')][_0x84cf('0x1e')](_0x4c9d1c[_0x84cf('0x19')],{'raw':_0x4c9d1c[_0x84cf('0x1a')]?_0x4c9d1c[_0x84cf('0x1a')][_0x84cf('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c9d1c[_0x84cf('0x1a')]?_0x4c9d1c['options'][_0x84cf('0x1f')]||null:null,'attributes':_0x4c9d1c[_0x84cf('0x1a')]?_0x4c9d1c[_0x84cf('0x1a')][_0x84cf('0x20')]||null:null,'limit':_0x4c9d1c['options']?_0x4c9d1c[_0x84cf('0x1a')]['limit']||null:null})[_0x84cf('0xd')](function(_0x4092fd){logger[_0x84cf('0xe')](_0x84cf('0x1c'),_0x4c9d1c);logger[_0x84cf('0x11')](_0x84cf('0x1c'),_0x4c9d1c,JSON[_0x84cf('0x12')](_0x4092fd));_0x26db3f(_0x4092fd);})[_0x84cf('0x17')](function(_0x1bfa56){logger[_0x84cf('0x14')](_0x84cf('0x1c'),_0x1bfa56[_0x84cf('0x15')],_0x4c9d1c);_0x1c7747(_0x2b2c90[_0x84cf('0x14')](0x1f4,_0x1bfa56[_0x84cf('0x15')]));});});}; \ No newline at end of file +var _0x5a13=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','attributes','limit','debug','lodash','util','bluebird','randomstring','ioredis'];(function(_0x9b64d0,_0x4f745d){var _0xa65edb=function(_0x433b9a){while(--_0x433b9a){_0x9b64d0['push'](_0x9b64d0['shift']());}};_0xa65edb(++_0x4f745d);}(_0x5a13,0x145));var _0x35a1=function(_0x215e5f,_0x47e622){_0x215e5f=_0x215e5f-0x0;var _0x4a341b=_0x5a13[_0x215e5f];return _0x4a341b;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}exports[_0x35a1('0x17')]=function(_0x1de373){var _0x5e4317=this;return new Promise(function(_0x3b17dc,_0xbeb751){return db[_0x35a1('0x18')][_0x35a1('0x19')](_0x1de373[_0x35a1('0x1a')],{'raw':_0x1de373[_0x35a1('0x1b')]?_0x1de373[_0x35a1('0x1b')][_0x35a1('0x1c')]===undefined?!![]:![]:!![]})[_0x35a1('0xd')](function(_0x5929e5){logger[_0x35a1('0x14')](_0x35a1('0x17'),_0x1de373);logger['debug'](_0x35a1('0x17'),_0x1de373,JSON[_0x35a1('0x10')](_0x5929e5));_0x3b17dc(_0x5929e5);})['catch'](function(_0xc13bad){logger['error'](_0x35a1('0x17'),_0xc13bad[_0x35a1('0x12')],_0x1de373);_0xbeb751(_0x5e4317[_0x35a1('0x13')](0x1f4,_0xc13bad['message']));});});};exports[_0x35a1('0x1d')]=function(_0x2b87a1){var _0x48f1bd=this;return new Promise(function(_0x4c41ce,_0x5303b4){return db[_0x35a1('0x18')]['update'](_0x2b87a1['body'],{'raw':_0x2b87a1['options']?_0x2b87a1[_0x35a1('0x1b')][_0x35a1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b87a1[_0x35a1('0x1b')]?_0x2b87a1[_0x35a1('0x1b')]['where']||null:null,'attributes':_0x2b87a1[_0x35a1('0x1b')]?_0x2b87a1[_0x35a1('0x1b')][_0x35a1('0x1e')]||null:null,'limit':_0x2b87a1[_0x35a1('0x1b')]?_0x2b87a1[_0x35a1('0x1b')][_0x35a1('0x1f')]||null:null})[_0x35a1('0xd')](function(_0x24bb2d){logger[_0x35a1('0x14')](_0x35a1('0x1d'),_0x2b87a1);logger[_0x35a1('0x20')](_0x35a1('0x1d'),_0x2b87a1,JSON[_0x35a1('0x10')](_0x24bb2d));_0x4c41ce(_0x24bb2d);})[_0x35a1('0x16')](function(_0x2ae0ca){logger['error'](_0x35a1('0x1d'),_0x2ae0ca[_0x35a1('0x12')],_0x2b87a1);_0x5303b4(_0x48f1bd[_0x35a1('0x13')](0x1f4,_0x2ae0ca[_0x35a1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 6d416da..60f939a 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 _0xff4c=['create','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xff4c,0xcc));var _0xcff4=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0xff4c[_0x2300c7];return _0x23f720;};'use strict';var multer=require(_0xcff4('0x0'));var util=require('util');var path=require(_0xcff4('0x1'));var timeout=require(_0xcff4('0x2'));var express=require('express');var router=express[_0xcff4('0x3')]();var fs_extra=require(_0xcff4('0x4'));var auth=require(_0xcff4('0x5'));var interaction=require(_0xcff4('0x6'));var config=require(_0xcff4('0x7'));var controller=require(_0xcff4('0x8'));router[_0xcff4('0x9')]('/',auth[_0xcff4('0xa')](),controller['index']);router['get'](_0xcff4('0xb'),auth['isAuthenticated'](),controller[_0xcff4('0xc')]);router[_0xcff4('0x9')](_0xcff4('0xd'),auth[_0xcff4('0xa')](),controller[_0xcff4('0xe')]);router[_0xcff4('0xf')]('/',auth[_0xcff4('0xa')](),controller[_0xcff4('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcff4('0x11')](_0xcff4('0xd'),auth[_0xcff4('0xa')](),controller[_0xcff4('0x12')]);module[_0xcff4('0x13')]=router; \ No newline at end of file +var _0x03ff=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','create'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0x03ff,0x1a8));var _0xf03f=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x03ff[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xf03f('0x0'));var util=require(_0xf03f('0x1'));var path=require(_0xf03f('0x2'));var timeout=require(_0xf03f('0x3'));var express=require(_0xf03f('0x4'));var router=express[_0xf03f('0x5')]();var fs_extra=require(_0xf03f('0x6'));var auth=require(_0xf03f('0x7'));var interaction=require(_0xf03f('0x8'));var config=require(_0xf03f('0x9'));var controller=require('./openchannelTransferReport.controller');router[_0xf03f('0xa')]('/',auth[_0xf03f('0xb')](),controller[_0xf03f('0xc')]);router[_0xf03f('0xa')]('/describe',auth[_0xf03f('0xb')](),controller[_0xf03f('0xd')]);router[_0xf03f('0xa')](_0xf03f('0xe'),auth[_0xf03f('0xb')](),controller['show']);router['post']('/',auth[_0xf03f('0xb')](),controller[_0xf03f('0xf')]);router[_0xf03f('0x10')](_0xf03f('0xe'),auth[_0xf03f('0xb')](),controller[_0xf03f('0x11')]);router['delete'](_0xf03f('0xe'),auth[_0xf03f('0xb')](),controller[_0xf03f('0x12')]);module[_0xf03f('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 10c108f..0f1ea84 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xb8e8f4,_0x292049){var _0x5b0cce=function(_0x2b9620){while(--_0x2b9620){_0xb8e8f4['push'](_0xb8e8f4['shift']());}};_0x5b0cce(++_0x292049);}(_0x70e0,0x17b));var _0x070e=function(_0x18858c,_0x522e21){_0x18858c=_0x18858c-0x0;var _0x974a0e=_0x70e0[_0x18858c];return _0x974a0e;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2c049f,_0x4afb47){var _0x3984d8=function(_0x231805){while(--_0x231805){_0x2c049f['push'](_0x2c049f['shift']());}};_0x3984d8(++_0x4afb47);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1bd344,_0x2e7deb){_0x1bd344=_0x1bd344-0x0;var _0x32ab08=_0xf4eb[_0x1bd344];return _0x32ab08;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6337c6f..9262476 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 _0xdab2=['merge','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','type','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','rows','catch','show'];(function(_0xe71aa9,_0x2afcac){var _0x5222e5=function(_0x32dbb7){while(--_0x32dbb7){_0xe71aa9['push'](_0xe71aa9['shift']());}};_0x5222e5(++_0x2afcac);}(_0xdab2,0x17d));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dab('0x0'));var rimraf=require(_0x2dab('0x1'));var zipdir=require(_0x2dab('0x2'));var jsonpatch=require(_0x2dab('0x3'));var rp=require(_0x2dab('0x4'));var moment=require(_0x2dab('0x5'));var BPromise=require(_0x2dab('0x6'));var Mustache=require(_0x2dab('0x7'));var util=require(_0x2dab('0x8'));var path=require('path');var sox=require(_0x2dab('0x9'));var csv=require(_0x2dab('0xa'));var ejs=require(_0x2dab('0xb'));var fs=require('fs');var fs_extra=require(_0x2dab('0xc'));var _=require(_0x2dab('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2dab('0xa'));var querystring=require(_0x2dab('0xe'));var Papa=require(_0x2dab('0xf'));var Redis=require(_0x2dab('0x10'));var authService=require(_0x2dab('0x11'));var qs=require(_0x2dab('0x12'));var as=require(_0x2dab('0x13'));var hardwareService=require(_0x2dab('0x14'));var logger=require(_0x2dab('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2dab('0x16'));var licenseUtil=require(_0x2dab('0x17'));var db=require(_0x2dab('0x18'))['db'];function respondWithStatusCode(_0x5d9d6e,_0x3f7218){_0x3f7218=_0x3f7218||0xcc;return function(_0x274c4f){if(_0x274c4f){return _0x5d9d6e[_0x2dab('0x19')](_0x3f7218);}return _0x5d9d6e[_0x2dab('0x1a')](_0x3f7218)[_0x2dab('0x1b')]();};}function respondWithResult(_0x5363af,_0x12dfd5){_0x12dfd5=_0x12dfd5||0xc8;return function(_0x468ec0){if(_0x468ec0){return _0x5363af['status'](_0x12dfd5)[_0x2dab('0x1c')](_0x468ec0);}};}function respondWithFilteredResult(_0x17ae29,_0x3c44c9){return function(_0x3e0820){if(_0x3e0820){var _0x2b9421=typeof _0x3c44c9['offset']===_0x2dab('0x1d')&&typeof _0x3c44c9[_0x2dab('0x1e')]===_0x2dab('0x1d');var _0x4a07ce=_0x3e0820['count'];var _0x5e6718=_0x2b9421?0x0:_0x3c44c9[_0x2dab('0x1f')];var _0x37d2ba=_0x2b9421?_0x3e0820[_0x2dab('0x20')]:_0x3c44c9[_0x2dab('0x1f')]+_0x3c44c9[_0x2dab('0x1e')];var _0x4ad354;if(_0x37d2ba>=_0x4a07ce){_0x37d2ba=_0x4a07ce;_0x4ad354=0xc8;}else{_0x4ad354=0xce;}_0x17ae29[_0x2dab('0x1a')](_0x4ad354);return _0x17ae29['set'](_0x2dab('0x21'),_0x5e6718+'-'+_0x37d2ba+'/'+_0x4a07ce)[_0x2dab('0x1c')](_0x3e0820);}return null;};}function patchUpdates(_0x204cbc){return function(_0x27e867){try{jsonpatch[_0x2dab('0x22')](_0x27e867,_0x204cbc,!![]);}catch(_0x49312c){return BPromise[_0x2dab('0x23')](_0x49312c);}return _0x27e867[_0x2dab('0x24')]();};}function saveUpdates(_0x3002d0,_0x2f9eab){return function(_0x1a929f){if(_0x1a929f){return _0x1a929f[_0x2dab('0x25')](_0x3002d0)['then'](function(_0xedfe20){return _0xedfe20;});}return null;};}function removeEntity(_0x241987,_0x57a597){return function(_0x5015e4){if(_0x5015e4){return _0x5015e4[_0x2dab('0x26')]()[_0x2dab('0x27')](function(){_0x241987['status'](0xcc)[_0x2dab('0x1b')]();});}};}function handleEntityNotFound(_0x5d912e,_0x337dcd){return function(_0x1efb25){if(!_0x1efb25){_0x5d912e[_0x2dab('0x19')](0x194);}return _0x1efb25;};}function handleError(_0x5f36f6,_0x265d94){_0x265d94=_0x265d94||0x1f4;return function(_0x2c5d5d){logger[_0x2dab('0x28')](_0x2c5d5d[_0x2dab('0x29')]);if(_0x2c5d5d[_0x2dab('0x2a')]){delete _0x2c5d5d[_0x2dab('0x2a')];}_0x5f36f6[_0x2dab('0x1a')](_0x265d94)[_0x2dab('0x2b')](_0x2c5d5d);};}exports[_0x2dab('0x2c')]=function(_0x4300c8,_0x4f93da){var _0x52cb3a={},_0x165cca={},_0x432efa={'count':0x0,'rows':[]};var _0x332200=_['map'](db[_0x2dab('0x2d')][_0x2dab('0x2e')],function(_0x28dd23){return{'name':_0x28dd23['fieldName'],'type':_0x28dd23[_0x2dab('0x2f')]['key']};});_0x165cca['model']=_[_0x2dab('0x30')](_0x332200,_0x2dab('0x2a'));_0x165cca[_0x2dab('0x31')]=_[_0x2dab('0x32')](_0x4300c8[_0x2dab('0x31')]);_0x165cca[_0x2dab('0x33')]=_[_0x2dab('0x34')](_0x165cca['model'],_0x165cca['query']);_0x52cb3a[_0x2dab('0x35')]=_[_0x2dab('0x34')](_0x165cca[_0x2dab('0x36')],qs[_0x2dab('0x37')](_0x4300c8[_0x2dab('0x31')][_0x2dab('0x37')]));_0x52cb3a['attributes']=_0x52cb3a[_0x2dab('0x35')]['length']?_0x52cb3a['attributes']:_0x165cca[_0x2dab('0x36')];if(!_0x4300c8[_0x2dab('0x31')][_0x2dab('0x38')](_0x2dab('0x39'))){_0x52cb3a[_0x2dab('0x1e')]=qs[_0x2dab('0x1e')](_0x4300c8['query'][_0x2dab('0x1e')]);_0x52cb3a[_0x2dab('0x1f')]=qs['offset'](_0x4300c8[_0x2dab('0x31')][_0x2dab('0x1f')]);}_0x52cb3a[_0x2dab('0x3a')]=qs[_0x2dab('0x3b')](_0x4300c8['query'][_0x2dab('0x3b')]);_0x52cb3a[_0x2dab('0x3c')]=qs[_0x2dab('0x33')](_[_0x2dab('0x3d')](_0x4300c8['query'],_0x165cca[_0x2dab('0x33')]),_0x332200);if(_0x4300c8[_0x2dab('0x31')]['filter']){_0x52cb3a[_0x2dab('0x3c')]=_['merge'](_0x52cb3a['where'],{'$or':_[_0x2dab('0x30')](_0x332200,function(_0x28927a){if(_0x28927a['type']!=='VIRTUAL'){var _0x95c4aa={};_0x95c4aa[_0x28927a[_0x2dab('0x2a')]]={'$like':'%'+_0x4300c8[_0x2dab('0x31')][_0x2dab('0x3e')]+'%'};return _0x95c4aa;}})});}_0x52cb3a=_['merge']({},_0x52cb3a,_0x4300c8[_0x2dab('0x3f')]);var _0x171f9f={'where':_0x52cb3a['where']};return db[_0x2dab('0x2d')]['count'](_0x171f9f)[_0x2dab('0x27')](function(_0x27b8e0){_0x432efa[_0x2dab('0x20')]=_0x27b8e0;if(_0x4300c8[_0x2dab('0x31')][_0x2dab('0x40')]){_0x52cb3a[_0x2dab('0x41')]=[{'all':!![]}];}return db[_0x2dab('0x2d')]['findAll'](_0x52cb3a);})[_0x2dab('0x27')](function(_0x1ad199){_0x432efa[_0x2dab('0x42')]=_0x1ad199;return _0x432efa;})[_0x2dab('0x27')](respondWithFilteredResult(_0x4f93da,_0x52cb3a))[_0x2dab('0x43')](handleError(_0x4f93da,null));};exports[_0x2dab('0x44')]=function(_0x36b823,_0x2cd099){var _0x1e3c9e={'raw':!![],'where':{'id':_0x36b823['params']['id']}},_0x39f96b={};_0x39f96b[_0x2dab('0x36')]=_['keys'](db[_0x2dab('0x2d')]['rawAttributes']);_0x39f96b[_0x2dab('0x31')]=_[_0x2dab('0x32')](_0x36b823[_0x2dab('0x31')]);_0x39f96b[_0x2dab('0x33')]=_['intersection'](_0x39f96b[_0x2dab('0x36')],_0x39f96b[_0x2dab('0x31')]);_0x1e3c9e[_0x2dab('0x35')]=_['intersection'](_0x39f96b[_0x2dab('0x36')],qs['fields'](_0x36b823['query'][_0x2dab('0x37')]));_0x1e3c9e[_0x2dab('0x35')]=_0x1e3c9e[_0x2dab('0x35')]['length']?_0x1e3c9e[_0x2dab('0x35')]:_0x39f96b[_0x2dab('0x36')];if(_0x36b823[_0x2dab('0x31')][_0x2dab('0x40')]){_0x1e3c9e[_0x2dab('0x41')]=[{'all':!![]}];}_0x1e3c9e=_[_0x2dab('0x45')]({},_0x1e3c9e,_0x36b823[_0x2dab('0x3f')]);return db[_0x2dab('0x2d')][_0x2dab('0x46')](_0x1e3c9e)[_0x2dab('0x27')](handleEntityNotFound(_0x2cd099,null))[_0x2dab('0x27')](respondWithResult(_0x2cd099,null))['catch'](handleError(_0x2cd099,null));};exports[_0x2dab('0x47')]=function(_0x2a0e16,_0x2032b9){return db[_0x2dab('0x2d')][_0x2dab('0x47')](_0x2a0e16['body'],{})[_0x2dab('0x27')](respondWithResult(_0x2032b9,0xc9))[_0x2dab('0x43')](handleError(_0x2032b9,null));};exports[_0x2dab('0x25')]=function(_0x5713b6,_0x220ae6){if(_0x5713b6[_0x2dab('0x48')]['id']){delete _0x5713b6[_0x2dab('0x48')]['id'];}return db['OpenchannelTransferReport'][_0x2dab('0x46')]({'where':{'id':_0x5713b6[_0x2dab('0x49')]['id']}})[_0x2dab('0x27')](handleEntityNotFound(_0x220ae6,null))[_0x2dab('0x27')](saveUpdates(_0x5713b6[_0x2dab('0x48')],null))['then'](respondWithResult(_0x220ae6,null))[_0x2dab('0x43')](handleError(_0x220ae6,null));};exports[_0x2dab('0x26')]=function(_0x7017eb,_0x395805){return db['OpenchannelTransferReport'][_0x2dab('0x46')]({'where':{'id':_0x7017eb[_0x2dab('0x49')]['id']}})[_0x2dab('0x27')](handleEntityNotFound(_0x395805,null))[_0x2dab('0x27')](removeEntity(_0x395805,null))[_0x2dab('0x43')](handleError(_0x395805,null));};exports[_0x2dab('0x4a')]=function(_0x7d8404,_0x484a3d){return db[_0x2dab('0x2d')][_0x2dab('0x4a')]()['then'](respondWithResult(_0x484a3d,null))[_0x2dab('0x43')](handleError(_0x484a3d,null));}; \ No newline at end of file +var _0x6658=['OpenchannelTransferReport','findAll','catch','keys','find','create','body','update','destroy','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x6658,0x1c1));var _0x8665=function(_0x1a185c,_0x498960){_0x1a185c=_0x1a185c-0x0;var _0x30ac6d=_0x6658[_0x1a185c];return _0x30ac6d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8665('0x0'));var jsonpatch=require(_0x8665('0x1'));var rp=require(_0x8665('0x2'));var moment=require(_0x8665('0x3'));var BPromise=require(_0x8665('0x4'));var Mustache=require(_0x8665('0x5'));var util=require(_0x8665('0x6'));var path=require(_0x8665('0x7'));var sox=require(_0x8665('0x8'));var csv=require(_0x8665('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8665('0xa'));var squel=require('squel');var crypto=require(_0x8665('0xb'));var jsforce=require(_0x8665('0xc'));var deskjs=require(_0x8665('0xd'));var toCsv=require(_0x8665('0x9'));var querystring=require(_0x8665('0xe'));var Papa=require(_0x8665('0xf'));var Redis=require(_0x8665('0x10'));var authService=require(_0x8665('0x11'));var qs=require(_0x8665('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8665('0x13'));var logger=require(_0x8665('0x14'))(_0x8665('0x15'));var utils=require(_0x8665('0x16'));var config=require(_0x8665('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8665('0x18'))['db'];function respondWithStatusCode(_0x3e9e8e,_0x3aeab8){_0x3aeab8=_0x3aeab8||0xcc;return function(_0x1059b8){if(_0x1059b8){return _0x3e9e8e[_0x8665('0x19')](_0x3aeab8);}return _0x3e9e8e[_0x8665('0x1a')](_0x3aeab8)['end']();};}function respondWithResult(_0x169caf,_0x2156ad){_0x2156ad=_0x2156ad||0xc8;return function(_0x25da75){if(_0x25da75){return _0x169caf[_0x8665('0x1a')](_0x2156ad)[_0x8665('0x1b')](_0x25da75);}};}function respondWithFilteredResult(_0x1bd04f,_0x2f3e4f){return function(_0x307c5a){if(_0x307c5a){var _0x22c79a=typeof _0x2f3e4f[_0x8665('0x1c')]==='undefined'&&typeof _0x2f3e4f[_0x8665('0x1d')]===_0x8665('0x1e');var _0x5ffbbb=_0x307c5a[_0x8665('0x1f')];var _0xd55040=_0x22c79a?0x0:_0x2f3e4f[_0x8665('0x1c')];var _0x5013a0=_0x22c79a?_0x307c5a[_0x8665('0x1f')]:_0x2f3e4f['offset']+_0x2f3e4f[_0x8665('0x1d')];var _0x3c6a55;if(_0x5013a0>=_0x5ffbbb){_0x5013a0=_0x5ffbbb;_0x3c6a55=0xc8;}else{_0x3c6a55=0xce;}_0x1bd04f[_0x8665('0x1a')](_0x3c6a55);return _0x1bd04f[_0x8665('0x20')](_0x8665('0x21'),_0xd55040+'-'+_0x5013a0+'/'+_0x5ffbbb)[_0x8665('0x1b')](_0x307c5a);}return null;};}function patchUpdates(_0x42b67a){return function(_0x30e102){try{jsonpatch['apply'](_0x30e102,_0x42b67a,!![]);}catch(_0x3a354a){return BPromise['reject'](_0x3a354a);}return _0x30e102[_0x8665('0x22')]();};}function saveUpdates(_0x17c444,_0x2cae7f){return function(_0x5497d8){if(_0x5497d8){return _0x5497d8['update'](_0x17c444)[_0x8665('0x23')](function(_0x2e24e0){return _0x2e24e0;});}return null;};}function removeEntity(_0x4ef640,_0x1eba53){return function(_0x284215){if(_0x284215){return _0x284215['destroy']()['then'](function(){_0x4ef640[_0x8665('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe92852,_0x3a7509){return function(_0x2892bf){if(!_0x2892bf){_0xe92852[_0x8665('0x19')](0x194);}return _0x2892bf;};}function handleError(_0x5f442e,_0x111758){_0x111758=_0x111758||0x1f4;return function(_0x2429b8){logger['error'](_0x2429b8[_0x8665('0x24')]);if(_0x2429b8[_0x8665('0x25')]){delete _0x2429b8[_0x8665('0x25')];}_0x5f442e[_0x8665('0x1a')](_0x111758)[_0x8665('0x26')](_0x2429b8);};}exports[_0x8665('0x27')]=function(_0x150815,_0x45a7fc){var _0x6f450c={},_0x47dc66={},_0x326a90={'count':0x0,'rows':[]};var _0x40dd95=_[_0x8665('0x28')](db['OpenchannelTransferReport'][_0x8665('0x29')],function(_0x1ed3fd){return{'name':_0x1ed3fd[_0x8665('0x2a')],'type':_0x1ed3fd['type'][_0x8665('0x2b')]};});_0x47dc66[_0x8665('0x2c')]=_[_0x8665('0x28')](_0x40dd95,_0x8665('0x25'));_0x47dc66[_0x8665('0x2d')]=_['keys'](_0x150815[_0x8665('0x2d')]);_0x47dc66['filters']=_[_0x8665('0x2e')](_0x47dc66['model'],_0x47dc66['query']);_0x6f450c['attributes']=_['intersection'](_0x47dc66[_0x8665('0x2c')],qs[_0x8665('0x2f')](_0x150815[_0x8665('0x2d')][_0x8665('0x2f')]));_0x6f450c[_0x8665('0x30')]=_0x6f450c[_0x8665('0x30')][_0x8665('0x31')]?_0x6f450c[_0x8665('0x30')]:_0x47dc66[_0x8665('0x2c')];if(!_0x150815[_0x8665('0x2d')][_0x8665('0x32')](_0x8665('0x33'))){_0x6f450c[_0x8665('0x1d')]=qs[_0x8665('0x1d')](_0x150815[_0x8665('0x2d')][_0x8665('0x1d')]);_0x6f450c[_0x8665('0x1c')]=qs[_0x8665('0x1c')](_0x150815[_0x8665('0x2d')][_0x8665('0x1c')]);}_0x6f450c[_0x8665('0x34')]=qs['sort'](_0x150815[_0x8665('0x2d')]['sort']);_0x6f450c[_0x8665('0x35')]=qs['filters'](_['pick'](_0x150815[_0x8665('0x2d')],_0x47dc66[_0x8665('0x36')]),_0x40dd95);if(_0x150815[_0x8665('0x2d')][_0x8665('0x37')]){_0x6f450c[_0x8665('0x35')]=_[_0x8665('0x38')](_0x6f450c[_0x8665('0x35')],{'$or':_[_0x8665('0x28')](_0x40dd95,function(_0x5cfd2c){if(_0x5cfd2c[_0x8665('0x39')]!==_0x8665('0x3a')){var _0xecd536={};_0xecd536[_0x5cfd2c[_0x8665('0x25')]]={'$like':'%'+_0x150815[_0x8665('0x2d')][_0x8665('0x37')]+'%'};return _0xecd536;}})});}_0x6f450c=_[_0x8665('0x38')]({},_0x6f450c,_0x150815[_0x8665('0x3b')]);var _0x4af215={'where':_0x6f450c[_0x8665('0x35')]};return db['OpenchannelTransferReport'][_0x8665('0x1f')](_0x4af215)[_0x8665('0x23')](function(_0x2543d7){_0x326a90[_0x8665('0x1f')]=_0x2543d7;if(_0x150815[_0x8665('0x2d')][_0x8665('0x3c')]){_0x6f450c[_0x8665('0x3d')]=[{'all':!![]}];}return db[_0x8665('0x3e')][_0x8665('0x3f')](_0x6f450c);})['then'](function(_0x1c00b8){_0x326a90['rows']=_0x1c00b8;return _0x326a90;})[_0x8665('0x23')](respondWithFilteredResult(_0x45a7fc,_0x6f450c))[_0x8665('0x40')](handleError(_0x45a7fc,null));};exports['show']=function(_0x3faf11,_0x34ae78){var _0x2b14b9={'raw':!![],'where':{'id':_0x3faf11['params']['id']}},_0x12a947={};_0x12a947[_0x8665('0x2c')]=_[_0x8665('0x41')](db['OpenchannelTransferReport'][_0x8665('0x29')]);_0x12a947[_0x8665('0x2d')]=_[_0x8665('0x41')](_0x3faf11[_0x8665('0x2d')]);_0x12a947[_0x8665('0x36')]=_[_0x8665('0x2e')](_0x12a947[_0x8665('0x2c')],_0x12a947[_0x8665('0x2d')]);_0x2b14b9[_0x8665('0x30')]=_[_0x8665('0x2e')](_0x12a947[_0x8665('0x2c')],qs[_0x8665('0x2f')](_0x3faf11['query'][_0x8665('0x2f')]));_0x2b14b9[_0x8665('0x30')]=_0x2b14b9[_0x8665('0x30')]['length']?_0x2b14b9[_0x8665('0x30')]:_0x12a947[_0x8665('0x2c')];if(_0x3faf11[_0x8665('0x2d')]['includeAll']){_0x2b14b9['include']=[{'all':!![]}];}_0x2b14b9=_[_0x8665('0x38')]({},_0x2b14b9,_0x3faf11[_0x8665('0x3b')]);return db[_0x8665('0x3e')][_0x8665('0x42')](_0x2b14b9)[_0x8665('0x23')](handleEntityNotFound(_0x34ae78,null))[_0x8665('0x23')](respondWithResult(_0x34ae78,null))[_0x8665('0x40')](handleError(_0x34ae78,null));};exports[_0x8665('0x43')]=function(_0x5c280b,_0xf0c2c7){return db[_0x8665('0x3e')]['create'](_0x5c280b[_0x8665('0x44')],{})['then'](respondWithResult(_0xf0c2c7,0xc9))['catch'](handleError(_0xf0c2c7,null));};exports[_0x8665('0x45')]=function(_0x39b12e,_0x1918d6){if(_0x39b12e['body']['id']){delete _0x39b12e[_0x8665('0x44')]['id'];}return db[_0x8665('0x3e')]['find']({'where':{'id':_0x39b12e['params']['id']}})[_0x8665('0x23')](handleEntityNotFound(_0x1918d6,null))[_0x8665('0x23')](saveUpdates(_0x39b12e[_0x8665('0x44')],null))['then'](respondWithResult(_0x1918d6,null))[_0x8665('0x40')](handleError(_0x1918d6,null));};exports[_0x8665('0x46')]=function(_0x2fffe5,_0xf7d19b){return db[_0x8665('0x3e')][_0x8665('0x42')]({'where':{'id':_0x2fffe5[_0x8665('0x47')]['id']}})[_0x8665('0x23')](handleEntityNotFound(_0xf7d19b,null))[_0x8665('0x23')](removeEntity(_0xf7d19b,null))['catch'](handleError(_0xf7d19b,null));};exports[_0x8665('0x48')]=function(_0x36b206,_0x4bd00f){return db['OpenchannelTransferReport'][_0x8665('0x48')]()[_0x8665('0x23')](respondWithResult(_0x4bd00f,null))[_0x8665('0x40')](handleError(_0x4bd00f,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 5579969..b98d9b8 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 _0x2d4a=['api','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x5e03b0,_0x523bb8){var _0x40e684=function(_0xd6debc){while(--_0xd6debc){_0x5e03b0['push'](_0x5e03b0['shift']());}};_0x40e684(++_0x523bb8);}(_0x2d4a,0x1d2));var _0xa2d4=function(_0xc90e82,_0x3f7caa){_0xc90e82=_0xc90e82-0x0;var _0x5f11b0=_0x2d4a[_0xc90e82];return _0x5f11b0;};'use strict';var _=require(_0xa2d4('0x0'));var util=require(_0xa2d4('0x1'));var logger=require('../../config/logger')(_0xa2d4('0x2'));var moment=require('moment');var BPromise=require(_0xa2d4('0x3'));var rp=require(_0xa2d4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2d4('0x5'));var config=require(_0xa2d4('0x6'));var attributes=require(_0xa2d4('0x7'));module[_0xa2d4('0x8')]=function(_0x23f26e,_0x65f1cd){return _0x23f26e[_0xa2d4('0x9')](_0xa2d4('0xa'),attributes,{'tableName':_0xa2d4('0xb'),'paranoid':![],'indexes':[{'name':_0xa2d4('0xc'),'fields':[_0xa2d4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x821e=['../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x466f60,_0x3e306a){var _0x15fe8b=function(_0x5a665e){while(--_0x5a665e){_0x466f60['push'](_0x466f60['shift']());}};_0x15fe8b(++_0x3e306a);}(_0x821e,0x1f4));var _0xe821=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0x821e[_0x3c81b5];return _0x5888c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe821('0x0'))(_0xe821('0x1'));var moment=require(_0xe821('0x2'));var BPromise=require(_0xe821('0x3'));var rp=require(_0xe821('0x4'));var fs=require('fs');var path=require(_0xe821('0x5'));var rimraf=require(_0xe821('0x6'));var config=require(_0xe821('0x7'));var attributes=require(_0xe821('0x8'));module['exports']=function(_0x15be81,_0x1e99e4){return _0x15be81[_0xe821('0x9')](_0xe821('0xa'),attributes,{'tableName':_0xe821('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe821('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 3b58969..1894a6f 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 _0x4074=['jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4074,0xf0));var _0x4407=function(_0x48904e,_0x41158d){_0x48904e=_0x48904e-0x0;var _0x1d7eca=_0x4074[_0x48904e];return _0x1d7eca;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var moment=require(_0x4407('0x2'));var BPromise=require('bluebird');var rs=require(_0x4407('0x3'));var fs=require('fs');var Redis=require(_0x4407('0x4'));var db=require(_0x4407('0x5'))['db'];var utils=require(_0x4407('0x6'));var logger=require(_0x4407('0x7'))(_0x4407('0x8'));var config=require(_0x4407('0x9'));var jayson=require(_0x4407('0xa'));var client=jayson[_0x4407('0xb')][_0x4407('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4933cf,_0x988538,_0x5f0699){return new BPromise(function(_0x414f0a,_0x3c1aee){return client[_0x4407('0xd')](_0x4933cf,_0x5f0699)['then'](function(_0x5e70a5){logger['info'](_0x4407('0xe'),_0x988538,_0x4407('0xf'));logger[_0x4407('0x10')](_0x4407('0x11'),_0x988538,_0x4407('0xf'),JSON[_0x4407('0x12')](_0x5e70a5));if(_0x5e70a5[_0x4407('0x13')]){if(_0x5e70a5[_0x4407('0x13')][_0x4407('0x14')]===0x1f4){logger[_0x4407('0x13')](_0x4407('0xe'),_0x988538,_0x5e70a5['error'][_0x4407('0x15')]);return _0x3c1aee(_0x5e70a5[_0x4407('0x13')]['message']);}logger[_0x4407('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x988538,_0x5e70a5[_0x4407('0x13')][_0x4407('0x15')]);return _0x414f0a(_0x5e70a5[_0x4407('0x13')][_0x4407('0x15')]);}else{logger[_0x4407('0x16')](_0x4407('0xe'),_0x988538,_0x4407('0xf'));_0x414f0a(_0x5e70a5[_0x4407('0x17')]['message']);}})[_0x4407('0x18')](function(_0x65b20b){logger[_0x4407('0x13')](_0x4407('0xe'),_0x988538,_0x65b20b);_0x3c1aee(_0x65b20b);});});} \ No newline at end of file +var _0xdd0c=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xb11722,_0x122200){var _0x13f584=function(_0x44aa3e){while(--_0x44aa3e){_0xb11722['push'](_0xb11722['shift']());}};_0x13f584(++_0x122200);}(_0xdd0c,0x165));var _0xcdd0=function(_0x1e258f,_0x3b3465){_0x1e258f=_0x1e258f-0x0;var _0x4e8f5b=_0xdd0c[_0x1e258f];return _0x4e8f5b;};'use strict';var _=require('lodash');var util=require(_0xcdd0('0x0'));var moment=require(_0xcdd0('0x1'));var BPromise=require(_0xcdd0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdd0('0x4'));var logger=require(_0xcdd0('0x5'))(_0xcdd0('0x6'));var config=require(_0xcdd0('0x7'));var jayson=require(_0xcdd0('0x8'));var client=jayson['client'][_0xcdd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b6f5d,_0x1fd3f6,_0x15c402){return new BPromise(function(_0x337496,_0x557a65){return client[_0xcdd0('0xa')](_0x1b6f5d,_0x15c402)['then'](function(_0x5db720){logger[_0xcdd0('0xb')](_0xcdd0('0xc'),_0x1fd3f6,_0xcdd0('0xd'));logger[_0xcdd0('0xe')](_0xcdd0('0xf'),_0x1fd3f6,_0xcdd0('0xd'),JSON[_0xcdd0('0x10')](_0x5db720));if(_0x5db720[_0xcdd0('0x11')]){if(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x12')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x557a65(_0x5db720['error'][_0xcdd0('0x13')]);}logger[_0xcdd0('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x337496(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);}else{logger[_0xcdd0('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1fd3f6,'request\x20sent');_0x337496(_0x5db720[_0xcdd0('0x14')][_0xcdd0('0x13')]);}})[_0xcdd0('0x15')](function(_0xf7af04){logger[_0xcdd0('0x11')](_0xcdd0('0xc'),_0x1fd3f6,_0xf7af04);_0x557a65(_0xf7af04);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index d273306..31f166a 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 _0x8b03=['update','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','post','put'];(function(_0x5473da,_0x49396c){var _0x3b0928=function(_0x556ba7){while(--_0x556ba7){_0x5473da['push'](_0x5473da['shift']());}};_0x3b0928(++_0x49396c);}(_0x8b03,0x179));var _0x38b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b03[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x38b0('0x0'));var util=require(_0x38b0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38b0('0x2'));var router=express[_0x38b0('0x3')]();var fs_extra=require(_0x38b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x38b0('0x5'));var config=require(_0x38b0('0x6'));var controller=require(_0x38b0('0x7'));router['get']('/',auth[_0x38b0('0x8')](),controller[_0x38b0('0x9')]);router[_0x38b0('0xa')](_0x38b0('0xb'),auth[_0x38b0('0x8')](),controller['show']);router[_0x38b0('0xc')]('/',auth[_0x38b0('0x8')](),controller['create']);router[_0x38b0('0xd')](_0x38b0('0xb'),auth['isAuthenticated'](),controller[_0x38b0('0xe')]);router[_0x38b0('0xf')](_0x38b0('0xb'),auth[_0x38b0('0x8')](),controller[_0x38b0('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3b34=['/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./pause.controller','get','index','isAuthenticated','show','post','create','put','update'];(function(_0x233662,_0x3b468f){var _0x32cf8d=function(_0x5c0e49){while(--_0x5c0e49){_0x233662['push'](_0x233662['shift']());}};_0x32cf8d(++_0x3b468f);}(_0x3b34,0xa4));var _0x43b3=function(_0x237398,_0xc0ef22){_0x237398=_0x237398-0x0;var _0x5598de=_0x3b34[_0x237398];return _0x5598de;};'use strict';var multer=require(_0x43b3('0x0'));var util=require('util');var path=require(_0x43b3('0x1'));var timeout=require(_0x43b3('0x2'));var express=require(_0x43b3('0x3'));var router=express[_0x43b3('0x4')]();var fs_extra=require(_0x43b3('0x5'));var auth=require(_0x43b3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x43b3('0x7'));router[_0x43b3('0x8')]('/',auth['isAuthenticated'](),controller[_0x43b3('0x9')]);router['get']('/:id',auth[_0x43b3('0xa')](),controller[_0x43b3('0xb')]);router[_0x43b3('0xc')]('/',auth['isAuthenticated'](),controller[_0x43b3('0xd')]);router[_0x43b3('0xe')]('/:id',auth[_0x43b3('0xa')](),controller[_0x43b3('0xf')]);router['delete'](_0x43b3('0x10'),auth[_0x43b3('0xa')](),controller[_0x43b3('0x11')]);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 9fcc52c..9aecb20 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 _0xcbf8=['exports','STRING','sequelize'];(function(_0x4d821c,_0x22bd0e){var _0x15dd5b=function(_0x20e8f2){while(--_0x20e8f2){_0x4d821c['push'](_0x4d821c['shift']());}};_0x15dd5b(++_0x22bd0e);}(_0xcbf8,0x1be));var _0x8cbf=function(_0x245206,_0x3e2477){_0x245206=_0x245206-0x0;var _0x40e68b=_0xcbf8[_0x245206];return _0x40e68b;};'use strict';var Sequelize=require(_0x8cbf('0x0'));module[_0x8cbf('0x1')]={'name':{'type':Sequelize[_0x8cbf('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8cbf('0x2')]}}; \ No newline at end of file +var _0x4505=['STRING','sequelize','exports','name'];(function(_0x3283bc,_0x3d8a52){var _0x347e02=function(_0x166539){while(--_0x166539){_0x3283bc['push'](_0x3283bc['shift']());}};_0x347e02(++_0x3d8a52);}(_0x4505,0xcd));var _0x5450=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x4505[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x5450('0x0'));module[_0x5450('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5450('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5450('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index f3ba173..82c1af5 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 _0xb7de=['length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','intersection','find','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','util','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','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','Pauses','destroy','error','stack','name','send','Pause','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','fields'];(function(_0x777456,_0x57998f){var _0x5895b0=function(_0x3b9ce4){while(--_0x3b9ce4){_0x777456['push'](_0x777456['shift']());}};_0x5895b0(++_0x57998f);}(_0xb7de,0xbb));var _0xeb7d=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xb7de[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0xeb7d('0x0'));var rimraf=require(_0xeb7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeb7d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeb7d('0x3'));var path=require('path');var sox=require(_0xeb7d('0x4'));var csv=require(_0xeb7d('0x5'));var ejs=require(_0xeb7d('0x6'));var fs=require('fs');var fs_extra=require(_0xeb7d('0x7'));var _=require(_0xeb7d('0x8'));var squel=require('squel');var crypto=require(_0xeb7d('0x9'));var jsforce=require(_0xeb7d('0xa'));var deskjs=require(_0xeb7d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xeb7d('0xc'));var Papa=require(_0xeb7d('0xd'));var Redis=require(_0xeb7d('0xe'));var authService=require(_0xeb7d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeb7d('0x10'));var hardwareService=require(_0xeb7d('0x11'));var logger=require(_0xeb7d('0x12'))(_0xeb7d('0x13'));var utils=require(_0xeb7d('0x14'));var config=require(_0xeb7d('0x15'));var licenseUtil=require(_0xeb7d('0x16'));var db=require(_0xeb7d('0x17'))['db'];function respondWithStatusCode(_0x382abd,_0x27b014){_0x27b014=_0x27b014||0xcc;return function(_0xbe0887){if(_0xbe0887){return _0x382abd[_0xeb7d('0x18')](_0x27b014);}return _0x382abd[_0xeb7d('0x19')](_0x27b014)['end']();};}function respondWithResult(_0x58a706,_0x11c8c8){_0x11c8c8=_0x11c8c8||0xc8;return function(_0x1a68af){if(_0x1a68af){return _0x58a706[_0xeb7d('0x19')](_0x11c8c8)[_0xeb7d('0x1a')](_0x1a68af);}};}function respondWithFilteredResult(_0x244b4a,_0x10e4b7){return function(_0x5bd2ae){if(_0x5bd2ae){var _0x347f6e=typeof _0x10e4b7[_0xeb7d('0x1b')]==='undefined'&&typeof _0x10e4b7[_0xeb7d('0x1c')]===_0xeb7d('0x1d');var _0x3ccaf9=_0x5bd2ae[_0xeb7d('0x1e')];var _0x27c024=_0x347f6e?0x0:_0x10e4b7[_0xeb7d('0x1b')];var _0x4fa5f1=_0x347f6e?_0x5bd2ae[_0xeb7d('0x1e')]:_0x10e4b7[_0xeb7d('0x1b')]+_0x10e4b7['limit'];var _0x2ddc3b;if(_0x4fa5f1>=_0x3ccaf9){_0x4fa5f1=_0x3ccaf9;_0x2ddc3b=0xc8;}else{_0x2ddc3b=0xce;}_0x244b4a[_0xeb7d('0x19')](_0x2ddc3b);return _0x244b4a[_0xeb7d('0x1f')](_0xeb7d('0x20'),_0x27c024+'-'+_0x4fa5f1+'/'+_0x3ccaf9)[_0xeb7d('0x1a')](_0x5bd2ae);}return null;};}function patchUpdates(_0x171e24){return function(_0x388e03){try{jsonpatch[_0xeb7d('0x21')](_0x388e03,_0x171e24,!![]);}catch(_0x30c099){return BPromise[_0xeb7d('0x22')](_0x30c099);}return _0x388e03[_0xeb7d('0x23')]();};}function saveUpdates(_0x22347e,_0x213f92){return function(_0x28cf37){if(_0x28cf37){return _0x28cf37[_0xeb7d('0x24')](_0x22347e)[_0xeb7d('0x25')](function(_0x540296){return _0x540296;});}return null;};}function removeEntity(_0x5cdd79,_0x26be5a){return function(_0x136632){if(_0x136632){return _0x136632['destroy']()[_0xeb7d('0x25')](function(){var _0x2d347a=_0x136632[_0xeb7d('0x26')]({'plain':!![]});var _0x4f89ad=_0xeb7d('0x27');return db['UserProfileResource'][_0xeb7d('0x28')]({'where':{'type':_0x4f89ad,'resourceId':_0x2d347a['id']}})[_0xeb7d('0x25')](function(){return _0x136632;});})['then'](function(){_0x5cdd79[_0xeb7d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6d36,_0x1166cf){return function(_0x551c88){if(!_0x551c88){_0x2b6d36[_0xeb7d('0x18')](0x194);}return _0x551c88;};}function handleError(_0x4739fb,_0x58ae88){_0x58ae88=_0x58ae88||0x1f4;return function(_0x1a83c8){logger[_0xeb7d('0x29')](_0x1a83c8[_0xeb7d('0x2a')]);if(_0x1a83c8[_0xeb7d('0x2b')]){delete _0x1a83c8[_0xeb7d('0x2b')];}_0x4739fb[_0xeb7d('0x19')](_0x58ae88)[_0xeb7d('0x2c')](_0x1a83c8);};}exports['index']=function(_0x1bb381,_0x3b09d5){var _0x3dde41={},_0x5b1cfe={},_0xcd7d1={'count':0x0,'rows':[]};var _0x17f332=_['map'](db[_0xeb7d('0x2d')][_0xeb7d('0x2e')],function(_0x10689a){return{'name':_0x10689a[_0xeb7d('0x2f')],'type':_0x10689a[_0xeb7d('0x30')]['key']};});_0x5b1cfe['model']=_[_0xeb7d('0x31')](_0x17f332,_0xeb7d('0x2b'));_0x5b1cfe[_0xeb7d('0x32')]=_[_0xeb7d('0x33')](_0x1bb381[_0xeb7d('0x32')]);_0x5b1cfe[_0xeb7d('0x34')]=_['intersection'](_0x5b1cfe[_0xeb7d('0x35')],_0x5b1cfe[_0xeb7d('0x32')]);_0x3dde41[_0xeb7d('0x36')]=_['intersection'](_0x5b1cfe[_0xeb7d('0x35')],qs['fields'](_0x1bb381[_0xeb7d('0x32')][_0xeb7d('0x37')]));_0x3dde41[_0xeb7d('0x36')]=_0x3dde41[_0xeb7d('0x36')][_0xeb7d('0x38')]?_0x3dde41[_0xeb7d('0x36')]:_0x5b1cfe['model'];if(!_0x1bb381['query'][_0xeb7d('0x39')](_0xeb7d('0x3a'))){_0x3dde41[_0xeb7d('0x1c')]=qs[_0xeb7d('0x1c')](_0x1bb381[_0xeb7d('0x32')][_0xeb7d('0x1c')]);_0x3dde41[_0xeb7d('0x1b')]=qs[_0xeb7d('0x1b')](_0x1bb381[_0xeb7d('0x32')]['offset']);}_0x3dde41[_0xeb7d('0x3b')]=qs[_0xeb7d('0x3c')](_0x1bb381[_0xeb7d('0x32')][_0xeb7d('0x3c')]);_0x3dde41['where']=qs[_0xeb7d('0x34')](_[_0xeb7d('0x3d')](_0x1bb381[_0xeb7d('0x32')],_0x5b1cfe[_0xeb7d('0x34')]),_0x17f332);if(_0x1bb381[_0xeb7d('0x32')]['filter']){_0x3dde41['where']=_[_0xeb7d('0x3e')](_0x3dde41[_0xeb7d('0x3f')],{'$or':_[_0xeb7d('0x31')](_0x17f332,function(_0x1f23be){if(_0x1f23be[_0xeb7d('0x30')]!==_0xeb7d('0x40')){var _0xf1bc20={};_0xf1bc20[_0x1f23be[_0xeb7d('0x2b')]]={'$like':'%'+_0x1bb381[_0xeb7d('0x32')][_0xeb7d('0x41')]+'%'};return _0xf1bc20;}})});}_0x3dde41=_['merge']({},_0x3dde41,_0x1bb381[_0xeb7d('0x42')]);var _0x5e658f={'where':_0x3dde41[_0xeb7d('0x3f')]};return db['Pause']['count'](_0x5e658f)['then'](function(_0x599553){_0xcd7d1['count']=_0x599553;if(_0x1bb381[_0xeb7d('0x32')][_0xeb7d('0x43')]){_0x3dde41[_0xeb7d('0x44')]=[{'all':!![]}];}return db['Pause'][_0xeb7d('0x45')](_0x3dde41);})['then'](function(_0x534963){_0xcd7d1['rows']=_0x534963;return _0xcd7d1;})[_0xeb7d('0x25')](respondWithFilteredResult(_0x3b09d5,_0x3dde41))[_0xeb7d('0x46')](handleError(_0x3b09d5,null));};exports['show']=function(_0x5b4642,_0x5f5540){var _0x3486b8={'raw':!![],'where':{'id':_0x5b4642[_0xeb7d('0x47')]['id']}},_0x415def={};_0x415def[_0xeb7d('0x35')]=_['keys'](db[_0xeb7d('0x2d')][_0xeb7d('0x2e')]);_0x415def[_0xeb7d('0x32')]=_[_0xeb7d('0x33')](_0x5b4642[_0xeb7d('0x32')]);_0x415def['filters']=_[_0xeb7d('0x48')](_0x415def['model'],_0x415def[_0xeb7d('0x32')]);_0x3486b8[_0xeb7d('0x36')]=_['intersection'](_0x415def[_0xeb7d('0x35')],qs[_0xeb7d('0x37')](_0x5b4642[_0xeb7d('0x32')]['fields']));_0x3486b8[_0xeb7d('0x36')]=_0x3486b8[_0xeb7d('0x36')][_0xeb7d('0x38')]?_0x3486b8[_0xeb7d('0x36')]:_0x415def[_0xeb7d('0x35')];if(_0x5b4642['query']['includeAll']){_0x3486b8['include']=[{'all':!![]}];}_0x3486b8=_[_0xeb7d('0x3e')]({},_0x3486b8,_0x5b4642['options']);return db[_0xeb7d('0x2d')][_0xeb7d('0x49')](_0x3486b8)['then'](handleEntityNotFound(_0x5f5540,null))['then'](respondWithResult(_0x5f5540,null))[_0xeb7d('0x46')](handleError(_0x5f5540,null));};exports[_0xeb7d('0x4a')]=function(_0x1ec816,_0x2c0b27){return db[_0xeb7d('0x2d')]['create'](_0x1ec816['body'],{})['then'](function(_0xdf5d71){var _0x3feb89=_0x1ec816[_0xeb7d('0x4b')][_0xeb7d('0x26')]({'plain':!![]});if(!_0x3feb89)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3feb89[_0xeb7d('0x4c')]===_0xeb7d('0x4b')){var _0x4f976a=_0xdf5d71[_0xeb7d('0x26')]({'plain':!![]});var _0x13bd1c=_0xeb7d('0x27');return db['UserProfileSection'][_0xeb7d('0x49')]({'where':{'name':_0x13bd1c,'userProfileId':_0x3feb89[_0xeb7d('0x4d')]},'raw':!![]})['then'](function(_0xa8e014){if(_0xa8e014&&_0xa8e014[_0xeb7d('0x4e')]===0x0){return db['UserProfileResource'][_0xeb7d('0x4a')]({'name':_0x4f976a[_0xeb7d('0x2b')],'resourceId':_0x4f976a['id'],'type':_0xa8e014[_0xeb7d('0x2b')],'sectionId':_0xa8e014['id']},{})['then'](function(){return _0xdf5d71;});}else{return _0xdf5d71;}})[_0xeb7d('0x46')](function(_0x481cff){logger['error'](_0xeb7d('0x4f'),_0x481cff);throw _0x481cff;});}return _0xdf5d71;})[_0xeb7d('0x25')](respondWithResult(_0x2c0b27,0xc9))[_0xeb7d('0x46')](handleError(_0x2c0b27,null));};exports['update']=function(_0x3f2cd9,_0x5cdc38){if(_0x3f2cd9[_0xeb7d('0x50')]['id']){delete _0x3f2cd9['body']['id'];}return db[_0xeb7d('0x2d')]['find']({'where':{'id':_0x3f2cd9['params']['id']}})[_0xeb7d('0x25')](handleEntityNotFound(_0x5cdc38,null))[_0xeb7d('0x25')](saveUpdates(_0x3f2cd9[_0xeb7d('0x50')],null))[_0xeb7d('0x25')](respondWithResult(_0x5cdc38,null))[_0xeb7d('0x46')](handleError(_0x5cdc38,null));};exports[_0xeb7d('0x28')]=function(_0x1cc317,_0x31c58d){return db[_0xeb7d('0x2d')][_0xeb7d('0x49')]({'where':{'id':_0x1cc317['params']['id']}})[_0xeb7d('0x25')](handleEntityNotFound(_0x31c58d,null))[_0xeb7d('0x25')](removeEntity(_0x31c58d,null))[_0xeb7d('0x46')](handleError(_0x31c58d,null));}; \ No newline at end of file +var _0x6f0d=['findAll','catch','keys','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','set','json','apply','reject','save','then','get','Pauses','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','options','count','includeAll','include','Pause'];(function(_0x51f4fc,_0x1fe3ef){var _0x4d96fc=function(_0xddc9){while(--_0xddc9){_0x51f4fc['push'](_0x51f4fc['shift']());}};_0x4d96fc(++_0x1fe3ef);}(_0x6f0d,0x192));var _0xd6f0=function(_0x4bef8c,_0x57ab3b){_0x4bef8c=_0x4bef8c-0x0;var _0x51e1df=_0x6f0d[_0x4bef8c];return _0x51e1df;};'use strict';var emlformat=require(_0xd6f0('0x0'));var rimraf=require(_0xd6f0('0x1'));var zipdir=require(_0xd6f0('0x2'));var jsonpatch=require(_0xd6f0('0x3'));var rp=require(_0xd6f0('0x4'));var moment=require(_0xd6f0('0x5'));var BPromise=require(_0xd6f0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd6f0('0x7'));var sox=require(_0xd6f0('0x8'));var csv=require(_0xd6f0('0x9'));var ejs=require(_0xd6f0('0xa'));var fs=require('fs');var fs_extra=require(_0xd6f0('0xb'));var _=require(_0xd6f0('0xc'));var squel=require(_0xd6f0('0xd'));var crypto=require(_0xd6f0('0xe'));var jsforce=require(_0xd6f0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd6f0('0x9'));var querystring=require(_0xd6f0('0x10'));var Papa=require(_0xd6f0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require(_0xd6f0('0x17'));var licenseUtil=require(_0xd6f0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x457ea7,_0x521128){_0x521128=_0x521128||0xcc;return function(_0x134d00){if(_0x134d00){return _0x457ea7[_0xd6f0('0x19')](_0x521128);}return _0x457ea7[_0xd6f0('0x1a')](_0x521128)[_0xd6f0('0x1b')]();};}function respondWithResult(_0xc409ea,_0x37aef5){_0x37aef5=_0x37aef5||0xc8;return function(_0xb9ba35){if(_0xb9ba35){return _0xc409ea[_0xd6f0('0x1a')](_0x37aef5)['json'](_0xb9ba35);}};}function respondWithFilteredResult(_0x2167e3,_0x312d91){return function(_0x46d0cd){if(_0x46d0cd){var _0x38a1e1=typeof _0x312d91[_0xd6f0('0x1c')]===_0xd6f0('0x1d')&&typeof _0x312d91['limit']==='undefined';var _0x57fc04=_0x46d0cd['count'];var _0x41f87b=_0x38a1e1?0x0:_0x312d91['offset'];var _0xed9ad6=_0x38a1e1?_0x46d0cd['count']:_0x312d91[_0xd6f0('0x1c')]+_0x312d91['limit'];var _0x2d7dab;if(_0xed9ad6>=_0x57fc04){_0xed9ad6=_0x57fc04;_0x2d7dab=0xc8;}else{_0x2d7dab=0xce;}_0x2167e3[_0xd6f0('0x1a')](_0x2d7dab);return _0x2167e3[_0xd6f0('0x1e')]('Content-Range',_0x41f87b+'-'+_0xed9ad6+'/'+_0x57fc04)[_0xd6f0('0x1f')](_0x46d0cd);}return null;};}function patchUpdates(_0x469994){return function(_0x1a079e){try{jsonpatch[_0xd6f0('0x20')](_0x1a079e,_0x469994,!![]);}catch(_0x47c4e6){return BPromise[_0xd6f0('0x21')](_0x47c4e6);}return _0x1a079e[_0xd6f0('0x22')]();};}function saveUpdates(_0x129c2e,_0x4924b9){return function(_0x13974d){if(_0x13974d){return _0x13974d['update'](_0x129c2e)[_0xd6f0('0x23')](function(_0x2d3611){return _0x2d3611;});}return null;};}function removeEntity(_0x4d0f05,_0x5cac9c){return function(_0x2b3ee4){if(_0x2b3ee4){return _0x2b3ee4['destroy']()[_0xd6f0('0x23')](function(){var _0x176b55=_0x2b3ee4[_0xd6f0('0x24')]({'plain':!![]});var _0x4e4be8=_0xd6f0('0x25');return db[_0xd6f0('0x26')]['destroy']({'where':{'type':_0x4e4be8,'resourceId':_0x176b55['id']}})['then'](function(){return _0x2b3ee4;});})['then'](function(){_0x4d0f05[_0xd6f0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x504384,_0x32c2f){return function(_0x4a7d1b){if(!_0x4a7d1b){_0x504384['sendStatus'](0x194);}return _0x4a7d1b;};}function handleError(_0x4015a5,_0x3ca61b){_0x3ca61b=_0x3ca61b||0x1f4;return function(_0x596629){logger[_0xd6f0('0x27')](_0x596629[_0xd6f0('0x28')]);if(_0x596629[_0xd6f0('0x29')]){delete _0x596629['name'];}_0x4015a5[_0xd6f0('0x1a')](_0x3ca61b)['send'](_0x596629);};}exports[_0xd6f0('0x2a')]=function(_0x595c48,_0x577d2e){var _0x49869a={},_0x5aa038={},_0x27ec96={'count':0x0,'rows':[]};var _0x4f9b30=_['map'](db['Pause'][_0xd6f0('0x2b')],function(_0x1cd232){return{'name':_0x1cd232[_0xd6f0('0x2c')],'type':_0x1cd232[_0xd6f0('0x2d')]['key']};});_0x5aa038['model']=_[_0xd6f0('0x2e')](_0x4f9b30,_0xd6f0('0x29'));_0x5aa038[_0xd6f0('0x2f')]=_['keys'](_0x595c48[_0xd6f0('0x2f')]);_0x5aa038[_0xd6f0('0x30')]=_[_0xd6f0('0x31')](_0x5aa038[_0xd6f0('0x32')],_0x5aa038['query']);_0x49869a[_0xd6f0('0x33')]=_[_0xd6f0('0x31')](_0x5aa038[_0xd6f0('0x32')],qs[_0xd6f0('0x34')](_0x595c48[_0xd6f0('0x2f')][_0xd6f0('0x34')]));_0x49869a[_0xd6f0('0x33')]=_0x49869a[_0xd6f0('0x33')][_0xd6f0('0x35')]?_0x49869a[_0xd6f0('0x33')]:_0x5aa038[_0xd6f0('0x32')];if(!_0x595c48[_0xd6f0('0x2f')]['hasOwnProperty'](_0xd6f0('0x36'))){_0x49869a[_0xd6f0('0x37')]=qs['limit'](_0x595c48[_0xd6f0('0x2f')][_0xd6f0('0x37')]);_0x49869a[_0xd6f0('0x1c')]=qs['offset'](_0x595c48['query'][_0xd6f0('0x1c')]);}_0x49869a[_0xd6f0('0x38')]=qs[_0xd6f0('0x39')](_0x595c48['query'][_0xd6f0('0x39')]);_0x49869a[_0xd6f0('0x3a')]=qs[_0xd6f0('0x30')](_['pick'](_0x595c48[_0xd6f0('0x2f')],_0x5aa038['filters']),_0x4f9b30);if(_0x595c48['query'][_0xd6f0('0x3b')]){_0x49869a[_0xd6f0('0x3a')]=_[_0xd6f0('0x3c')](_0x49869a['where'],{'$or':_[_0xd6f0('0x2e')](_0x4f9b30,function(_0x324e4b){if(_0x324e4b[_0xd6f0('0x2d')]!=='VIRTUAL'){var _0x29e5ac={};_0x29e5ac[_0x324e4b[_0xd6f0('0x29')]]={'$like':'%'+_0x595c48['query'][_0xd6f0('0x3b')]+'%'};return _0x29e5ac;}})});}_0x49869a=_['merge']({},_0x49869a,_0x595c48[_0xd6f0('0x3d')]);var _0x24ef9a={'where':_0x49869a[_0xd6f0('0x3a')]};return db['Pause'][_0xd6f0('0x3e')](_0x24ef9a)[_0xd6f0('0x23')](function(_0x20e447){_0x27ec96[_0xd6f0('0x3e')]=_0x20e447;if(_0x595c48[_0xd6f0('0x2f')][_0xd6f0('0x3f')]){_0x49869a[_0xd6f0('0x40')]=[{'all':!![]}];}return db[_0xd6f0('0x41')][_0xd6f0('0x42')](_0x49869a);})[_0xd6f0('0x23')](function(_0xa3560a){_0x27ec96['rows']=_0xa3560a;return _0x27ec96;})[_0xd6f0('0x23')](respondWithFilteredResult(_0x577d2e,_0x49869a))[_0xd6f0('0x43')](handleError(_0x577d2e,null));};exports['show']=function(_0x55ecf7,_0x417741){var _0x2e2a35={'raw':!![],'where':{'id':_0x55ecf7['params']['id']}},_0x2749d7={};_0x2749d7['model']=_[_0xd6f0('0x44')](db[_0xd6f0('0x41')][_0xd6f0('0x2b')]);_0x2749d7[_0xd6f0('0x2f')]=_[_0xd6f0('0x44')](_0x55ecf7[_0xd6f0('0x2f')]);_0x2749d7[_0xd6f0('0x30')]=_[_0xd6f0('0x31')](_0x2749d7[_0xd6f0('0x32')],_0x2749d7[_0xd6f0('0x2f')]);_0x2e2a35['attributes']=_[_0xd6f0('0x31')](_0x2749d7[_0xd6f0('0x32')],qs[_0xd6f0('0x34')](_0x55ecf7[_0xd6f0('0x2f')]['fields']));_0x2e2a35['attributes']=_0x2e2a35[_0xd6f0('0x33')][_0xd6f0('0x35')]?_0x2e2a35[_0xd6f0('0x33')]:_0x2749d7[_0xd6f0('0x32')];if(_0x55ecf7[_0xd6f0('0x2f')][_0xd6f0('0x3f')]){_0x2e2a35['include']=[{'all':!![]}];}_0x2e2a35=_['merge']({},_0x2e2a35,_0x55ecf7[_0xd6f0('0x3d')]);return db['Pause'][_0xd6f0('0x45')](_0x2e2a35)[_0xd6f0('0x23')](handleEntityNotFound(_0x417741,null))[_0xd6f0('0x23')](respondWithResult(_0x417741,null))[_0xd6f0('0x43')](handleError(_0x417741,null));};exports['create']=function(_0x4de620,_0x4bd38f){return db[_0xd6f0('0x41')]['create'](_0x4de620[_0xd6f0('0x46')],{})[_0xd6f0('0x23')](function(_0x209493){var _0x45e32d=_0x4de620['user'][_0xd6f0('0x24')]({'plain':!![]});if(!_0x45e32d)throw new Error(_0xd6f0('0x47'));if(_0x45e32d[_0xd6f0('0x48')]==='user'){var _0x45b45d=_0x209493[_0xd6f0('0x24')]({'plain':!![]});var _0x546af3=_0xd6f0('0x25');return db['UserProfileSection'][_0xd6f0('0x45')]({'where':{'name':_0x546af3,'userProfileId':_0x45e32d[_0xd6f0('0x49')]},'raw':!![]})[_0xd6f0('0x23')](function(_0x161ec3){if(_0x161ec3&&_0x161ec3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x45b45d[_0xd6f0('0x29')],'resourceId':_0x45b45d['id'],'type':_0x161ec3['name'],'sectionId':_0x161ec3['id']},{})[_0xd6f0('0x23')](function(){return _0x209493;});}else{return _0x209493;}})[_0xd6f0('0x43')](function(_0x570175){logger[_0xd6f0('0x27')](_0xd6f0('0x4a'),_0x570175);throw _0x570175;});}return _0x209493;})[_0xd6f0('0x23')](respondWithResult(_0x4bd38f,0xc9))[_0xd6f0('0x43')](handleError(_0x4bd38f,null));};exports[_0xd6f0('0x4b')]=function(_0x4b18b9,_0x270248){if(_0x4b18b9[_0xd6f0('0x46')]['id']){delete _0x4b18b9[_0xd6f0('0x46')]['id'];}return db['Pause'][_0xd6f0('0x45')]({'where':{'id':_0x4b18b9[_0xd6f0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x270248,null))[_0xd6f0('0x23')](saveUpdates(_0x4b18b9['body'],null))[_0xd6f0('0x23')](respondWithResult(_0x270248,null))[_0xd6f0('0x43')](handleError(_0x270248,null));};exports[_0xd6f0('0x4d')]=function(_0x22f81a,_0x4f937e){return db[_0xd6f0('0x41')][_0xd6f0('0x45')]({'where':{'id':_0x22f81a[_0xd6f0('0x4c')]['id']}})[_0xd6f0('0x23')](handleEntityNotFound(_0x4f937e,null))['then'](removeEntity(_0x4f937e,null))[_0xd6f0('0x43')](handleError(_0x4f937e,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index b37f419..0e23c58 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x280a50,_0x12268e){var _0xaf6e96=function(_0x3db625){while(--_0x3db625){_0x280a50['push'](_0x280a50['shift']());}};_0xaf6e96(++_0x12268e);}(_0xe14b,0x93));var _0xbe14=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0xe14b[_0x4f35f4];return _0x2e9a70;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x1c0007,_0x52d004){var _0x3429b2=function(_0x1faa72){while(--_0x1faa72){_0x1c0007['push'](_0x1c0007['shift']());}};_0x3429b2(++_0x52d004);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x5fc3[_0x2cd1fb];return _0x48fd2b;};'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 6bc5d4f..c888f76 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x5566bd,_0x525f8a){var _0x1b2c88=function(_0x115893){while(--_0x115893){_0x5566bd['push'](_0x5566bd['shift']());}};_0x1b2c88(++_0x525f8a);}(_0x7a54,0x106));var _0x47a5=function(_0x50f36d,_0x59709e){_0x50f36d=_0x50f36d-0x0;var _0x10b59b=_0x7a54[_0x50f36d];return _0x10b59b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x176089,_0x15c28a){var _0xe4e1ba=function(_0x2d693b){while(--_0x2d693b){_0x176089['push'](_0x176089['shift']());}};_0xe4e1ba(++_0x15c28a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xb10b[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 17b6c73..f6305ca 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 _0xb4e6=['put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','/webhook','webhookPost'];(function(_0x40dc3c,_0x2f9f40){var _0x5a153e=function(_0x102c92){while(--_0x102c92){_0x40dc3c['push'](_0x40dc3c['shift']());}};_0x5a153e(++_0x2f9f40);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0xb4e6[_0x95942];return _0x6d7f81;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var fs_extra=require(_0x6b4e('0x5'));var auth=require(_0x6b4e('0x6'));var interaction=require(_0x6b4e('0x7'));var config=require('../../config/environment');var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')]('/webhook',controller['webhookGet']);router[_0x6b4e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b4e('0xb')]);router[_0x6b4e('0x9')](_0x6b4e('0xc'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xd')]);var upload=multer({'storage':multer[_0x6b4e('0xe')]({'destination':function(_0x323487,_0x49c734,_0x39b4ec){_0x39b4ec(null,path[_0x6b4e('0xf')](config['root'],_0x6b4e('0x10')));},'filename':function(_0x9cd7da,_0x432399,_0x2b2ce0){_0x432399[_0x6b4e('0x11')]=_0x432399[_0x6b4e('0x11')][_0x6b4e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b2ce0(null,util['format'](_0x6b4e('0x13'),path[_0x6b4e('0x14')](_0x432399['originalname'],path[_0x6b4e('0x15')](_0x432399['originalname'])),Date[_0x6b4e('0x16')](),path[_0x6b4e('0x15')](_0x432399[_0x6b4e('0x11')])));}})});router[_0x6b4e('0x17')]('/',upload[_0x6b4e('0x18')](_0x6b4e('0x19')),controller['upload']);router['post'](_0x6b4e('0x1a'),controller[_0x6b4e('0x1b')]);router[_0x6b4e('0x1c')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1e')]);router[_0x6b4e('0x1f')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1f')]);module[_0x6b4e('0x20')]=router; \ No newline at end of file +var _0x04de=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','/webhook','webhookGet','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','webhookPost'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x04de,0x107));var _0xe04d=function(_0x5b2dea,_0x3da967){_0x5b2dea=_0x5b2dea-0x0;var _0x78f627=_0x04de[_0x5b2dea];return _0x78f627;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var fs_extra=require(_0xe04d('0x6'));var auth=require(_0xe04d('0x7'));var interaction=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var controller=require(_0xe04d('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe04d('0xb'),controller[_0xe04d('0xc')]);router[_0xe04d('0xd')](_0xe04d('0xe'),auth[_0xe04d('0xf')](),controller[_0xe04d('0x10')]);router[_0xe04d('0xd')](_0xe04d('0x11'),auth['isAuthenticated'](),controller[_0xe04d('0x12')]);var upload=multer({'storage':multer[_0xe04d('0x13')]({'destination':function(_0x2576b2,_0x30c46b,_0xad5c34){_0xad5c34(null,path[_0xe04d('0x14')](config[_0xe04d('0x15')],_0xe04d('0x16')));},'filename':function(_0x3ccdc8,_0x53f59a,_0x8bf2d2){_0x53f59a[_0xe04d('0x17')]=_0x53f59a[_0xe04d('0x17')][_0xe04d('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x8bf2d2(null,util[_0xe04d('0x19')](_0xe04d('0x1a'),path[_0xe04d('0x1b')](_0x53f59a[_0xe04d('0x17')],path[_0xe04d('0x1c')](_0x53f59a[_0xe04d('0x17')])),Date[_0xe04d('0x1d')](),path[_0xe04d('0x1c')](_0x53f59a['originalname'])));}})});router[_0xe04d('0x1e')]('/',upload['single'](_0xe04d('0x1f')),controller['upload']);router[_0xe04d('0x1e')](_0xe04d('0xb'),controller[_0xe04d('0x20')]);router[_0xe04d('0x21')](_0xe04d('0xe'),auth[_0xe04d('0xf')](),controller[_0xe04d('0x22')]);router[_0xe04d('0x23')](_0xe04d('0xe'),auth['isAuthenticated'](),controller[_0xe04d('0x23')]);module[_0xe04d('0x24')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index f3fcf62..acf6edf 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 _0x14a5=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly'];(function(_0x24d4a0,_0x1cc35f){var _0x27437e=function(_0x1bcb97){while(--_0x1bcb97){_0x24d4a0['push'](_0x24d4a0['shift']());}};_0x27437e(++_0x1cc35f);}(_0x14a5,0x123));var _0x514a=function(_0x4b30db,_0x13b217){_0x4b30db=_0x4b30db-0x0;var _0x4b7020=_0x14a5[_0x4b30db];return _0x4b7020;};'use strict';var Sequelize=require(_0x514a('0x0'));module['exports']={'name':{'type':Sequelize[_0x514a('0x1')]},'type':{'type':Sequelize[_0x514a('0x2')](_0x514a('0x3'),_0x514a('0x4'))},'description':{'type':Sequelize[_0x514a('0x5')]},'version':{'type':Sequelize[_0x514a('0x5')]},'path':{'type':Sequelize[_0x514a('0x1')],'comment':_0x514a('0x6')},'active':{'type':Sequelize[_0x514a('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x514a('0x8'),_0x514a('0x9'),_0x514a('0xa')),'defaultValue':_0x514a('0x9'),'comment':_0x514a('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x514a('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x514a('0x1')]},'scriptPath':{'type':Sequelize[_0x514a('0x1')]}}; \ No newline at end of file +var _0x3796=['ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x3796,0x153));var _0x6379=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x3796[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x6379('0x0'));module['exports']={'name':{'type':Sequelize[_0x6379('0x1')]},'type':{'type':Sequelize[_0x6379('0x2')]('html',_0x6379('0x3'))},'description':{'type':Sequelize[_0x6379('0x4')]},'version':{'type':Sequelize[_0x6379('0x4')]},'path':{'type':Sequelize[_0x6379('0x1')],'comment':_0x6379('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6379('0x6')},'sidebar':{'type':Sequelize[_0x6379('0x2')](_0x6379('0x7'),_0x6379('0x8'),'always','never'),'defaultValue':_0x6379('0x9'),'comment':_0x6379('0xa')},'icon':{'type':Sequelize[_0x6379('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x6379('0x1')]},'scriptName':{'type':Sequelize[_0x6379('0x1')]},'scriptPath':{'type':Sequelize[_0x6379('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 87f8c3d..960ad19 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 _0xd9c6=['**/*','join','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','manifest.json','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','scriptPath','create','body','role','userProfileId','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','download','statusCode','webhookPost','zip-dir','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','Plugins','UserProfileResource','error','name','send','map','Plugin','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','root','server/files/plugins','format','%s.zip','basename','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob'];(function(_0x1e97df,_0x196a17){var _0x2cd300=function(_0x21e4b8){while(--_0x21e4b8){_0x1e97df['push'](_0x1e97df['shift']());}};_0x2cd300(++_0x196a17);}(_0xd9c6,0xef));var _0x6d9c=function(_0x16a1bf,_0x372fda){_0x16a1bf=_0x16a1bf-0x0;var _0x2c129a=_0xd9c6[_0x16a1bf];return _0x2c129a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6d9c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6d9c('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6d9c('0x2'));var sox=require(_0x6d9c('0x3'));var csv=require(_0x6d9c('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d9c('0x5'));var _=require(_0x6d9c('0x6'));var squel=require(_0x6d9c('0x7'));var crypto=require(_0x6d9c('0x8'));var jsforce=require(_0x6d9c('0x9'));var deskjs=require(_0x6d9c('0xa'));var toCsv=require(_0x6d9c('0x4'));var querystring=require(_0x6d9c('0xb'));var Papa=require(_0x6d9c('0xc'));var extract=require('extract-zip');var rimraf=require(_0x6d9c('0xd'));var archiver=require(_0x6d9c('0xe'));var Redis=require(_0x6d9c('0xf'));var authService=require(_0x6d9c('0x10'));var qs=require(_0x6d9c('0x11'));var as=require(_0x6d9c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d9c('0x13'))(_0x6d9c('0x14'));var utils=require(_0x6d9c('0x15'));var config=require(_0x6d9c('0x16'));var licenseUtil=require(_0x6d9c('0x17'));var db=require('../../mysqldb')['db'];config[_0x6d9c('0x18')]=_['defaults'](config[_0x6d9c('0x18')],{'host':_0x6d9c('0x19'),'port':0x18eb});var socket=require(_0x6d9c('0x1a'))(new Redis(config[_0x6d9c('0x18')]));require('./plugin.socket')[_0x6d9c('0x1b')](socket);function respondWithStatusCode(_0x30c80b,_0x1d84b2){_0x1d84b2=_0x1d84b2||0xcc;return function(_0x543e2e){if(_0x543e2e){return _0x30c80b[_0x6d9c('0x1c')](_0x1d84b2);}return _0x30c80b[_0x6d9c('0x1d')](_0x1d84b2)[_0x6d9c('0x1e')]();};}function respondWithResult(_0x94078c,_0x59f1d3){_0x59f1d3=_0x59f1d3||0xc8;return function(_0x269206){if(_0x269206){return _0x94078c[_0x6d9c('0x1d')](_0x59f1d3)['json'](_0x269206);}};}function respondWithFilteredResult(_0x344148,_0xea9f33){return function(_0x1c738a){if(_0x1c738a){var _0x1a0cde=typeof _0xea9f33[_0x6d9c('0x1f')]===_0x6d9c('0x20')&&typeof _0xea9f33[_0x6d9c('0x21')]===_0x6d9c('0x20');var _0x1f4199=_0x1c738a[_0x6d9c('0x22')];var _0x1b6164=_0x1a0cde?0x0:_0xea9f33[_0x6d9c('0x1f')];var _0x19a69c=_0x1a0cde?_0x1c738a[_0x6d9c('0x22')]:_0xea9f33[_0x6d9c('0x1f')]+_0xea9f33[_0x6d9c('0x21')];var _0x2bb135;if(_0x19a69c>=_0x1f4199){_0x19a69c=_0x1f4199;_0x2bb135=0xc8;}else{_0x2bb135=0xce;}_0x344148[_0x6d9c('0x1d')](_0x2bb135);return _0x344148['set'](_0x6d9c('0x23'),_0x1b6164+'-'+_0x19a69c+'/'+_0x1f4199)['json'](_0x1c738a);}return null;};}function patchUpdates(_0x599332){return function(_0xc19a85){try{jsonpatch[_0x6d9c('0x24')](_0xc19a85,_0x599332,!![]);}catch(_0x522e29){return BPromise['reject'](_0x522e29);}return _0xc19a85[_0x6d9c('0x25')]();};}function saveUpdates(_0x1b7346,_0x9f10){return function(_0x2bac4e){if(_0x2bac4e){return _0x2bac4e[_0x6d9c('0x26')](_0x1b7346)[_0x6d9c('0x27')](function(_0x514331){return _0x514331;});}return null;};}function removeEntity(_0x2456bb,_0x529321){return function(_0x3fc90e){if(_0x3fc90e){return _0x3fc90e[_0x6d9c('0x28')]()[_0x6d9c('0x27')](function(){var _0xfc4f8d=_0x3fc90e[_0x6d9c('0x29')]({'plain':!![]});var _0x53f633=_0x6d9c('0x2a');return db[_0x6d9c('0x2b')][_0x6d9c('0x28')]({'where':{'type':_0x53f633,'resourceId':_0xfc4f8d['id']}})[_0x6d9c('0x27')](function(){return _0x3fc90e;});})[_0x6d9c('0x27')](function(){_0x2456bb[_0x6d9c('0x1d')](0xcc)[_0x6d9c('0x1e')]();});}};}function handleEntityNotFound(_0x3c84d5,_0x3120dd){return function(_0x40f0b0){if(!_0x40f0b0){_0x3c84d5['sendStatus'](0x194);}return _0x40f0b0;};}function handleError(_0x50cac7,_0x5db5d9){_0x5db5d9=_0x5db5d9||0x1f4;return function(_0x3ba9c1){logger[_0x6d9c('0x2c')](_0x3ba9c1['stack']);if(_0x3ba9c1[_0x6d9c('0x2d')]){delete _0x3ba9c1[_0x6d9c('0x2d')];}_0x50cac7[_0x6d9c('0x1d')](_0x5db5d9)[_0x6d9c('0x2e')](_0x3ba9c1);};}exports['index']=function(_0x2fe776,_0x2c4e76){var _0x3378b9={},_0x36d00e={},_0x399741={'count':0x0,'rows':[]};var _0x5a10ee=_[_0x6d9c('0x2f')](db[_0x6d9c('0x30')][_0x6d9c('0x31')],function(_0x3db1c7){return{'name':_0x3db1c7['fieldName'],'type':_0x3db1c7[_0x6d9c('0x32')][_0x6d9c('0x33')]};});_0x36d00e['model']=_[_0x6d9c('0x2f')](_0x5a10ee,_0x6d9c('0x2d'));_0x36d00e[_0x6d9c('0x34')]=_[_0x6d9c('0x35')](_0x2fe776['query']);_0x36d00e[_0x6d9c('0x36')]=_[_0x6d9c('0x37')](_0x36d00e['model'],_0x36d00e['query']);_0x3378b9[_0x6d9c('0x38')]=_[_0x6d9c('0x37')](_0x36d00e['model'],qs[_0x6d9c('0x39')](_0x2fe776[_0x6d9c('0x34')][_0x6d9c('0x39')]));_0x3378b9[_0x6d9c('0x38')]=_0x3378b9[_0x6d9c('0x38')][_0x6d9c('0x3a')]?_0x3378b9[_0x6d9c('0x38')]:_0x36d00e[_0x6d9c('0x3b')];if(!_0x2fe776[_0x6d9c('0x34')][_0x6d9c('0x3c')]('nolimit')){_0x3378b9[_0x6d9c('0x21')]=qs['limit'](_0x2fe776['query'][_0x6d9c('0x21')]);_0x3378b9[_0x6d9c('0x1f')]=qs[_0x6d9c('0x1f')](_0x2fe776['query'][_0x6d9c('0x1f')]);}_0x3378b9[_0x6d9c('0x3d')]=qs[_0x6d9c('0x3e')](_0x2fe776[_0x6d9c('0x34')][_0x6d9c('0x3e')]);_0x3378b9['where']=qs['filters'](_[_0x6d9c('0x3f')](_0x2fe776[_0x6d9c('0x34')],_0x36d00e[_0x6d9c('0x36')]),_0x5a10ee);if(_0x2fe776['query'][_0x6d9c('0x40')]){_0x3378b9[_0x6d9c('0x41')]=_[_0x6d9c('0x42')](_0x3378b9[_0x6d9c('0x41')],{'$or':_[_0x6d9c('0x2f')](_0x5a10ee,function(_0x648f88){if(_0x648f88[_0x6d9c('0x32')]!==_0x6d9c('0x43')){var _0x403ba2={};_0x403ba2[_0x648f88[_0x6d9c('0x2d')]]={'$like':'%'+_0x2fe776[_0x6d9c('0x34')][_0x6d9c('0x40')]+'%'};return _0x403ba2;}})});}_0x3378b9=_[_0x6d9c('0x42')]({},_0x3378b9,_0x2fe776['options']);var _0x321091={'where':_0x3378b9[_0x6d9c('0x41')]};return db[_0x6d9c('0x30')]['count'](_0x321091)[_0x6d9c('0x27')](function(_0x25fb76){_0x399741[_0x6d9c('0x22')]=_0x25fb76;if(_0x2fe776[_0x6d9c('0x34')][_0x6d9c('0x44')]){_0x3378b9[_0x6d9c('0x45')]=[{'all':!![]}];}return db[_0x6d9c('0x30')][_0x6d9c('0x46')](_0x3378b9);})[_0x6d9c('0x27')](function(_0x179056){_0x399741[_0x6d9c('0x47')]=_0x179056;return _0x399741;})[_0x6d9c('0x27')](respondWithFilteredResult(_0x2c4e76,_0x3378b9))[_0x6d9c('0x48')](handleError(_0x2c4e76,null));};exports[_0x6d9c('0x49')]=function(_0x5b4f99,_0x579513){var _0x3d6a11={'raw':!![],'where':{'id':_0x5b4f99[_0x6d9c('0x4a')]['id']}},_0x2aa25b={};_0x2aa25b[_0x6d9c('0x3b')]=_[_0x6d9c('0x35')](db[_0x6d9c('0x30')][_0x6d9c('0x31')]);_0x2aa25b[_0x6d9c('0x34')]=_[_0x6d9c('0x35')](_0x5b4f99[_0x6d9c('0x34')]);_0x2aa25b[_0x6d9c('0x36')]=_[_0x6d9c('0x37')](_0x2aa25b['model'],_0x2aa25b[_0x6d9c('0x34')]);_0x3d6a11[_0x6d9c('0x38')]=_['intersection'](_0x2aa25b[_0x6d9c('0x3b')],qs['fields'](_0x5b4f99['query'][_0x6d9c('0x39')]));_0x3d6a11[_0x6d9c('0x38')]=_0x3d6a11[_0x6d9c('0x38')][_0x6d9c('0x3a')]?_0x3d6a11[_0x6d9c('0x38')]:_0x2aa25b[_0x6d9c('0x3b')];if(_0x5b4f99['query'][_0x6d9c('0x44')]){_0x3d6a11['include']=[{'all':!![]}];}_0x3d6a11=_['merge']({},_0x3d6a11,_0x5b4f99[_0x6d9c('0x4b')]);return db['Plugin'][_0x6d9c('0x4c')](_0x3d6a11)['then'](handleEntityNotFound(_0x579513,null))[_0x6d9c('0x27')](respondWithResult(_0x579513,null))[_0x6d9c('0x48')](handleError(_0x579513,null));};exports['download']=function(_0x24f265,_0xb678d1,_0x194d5c){return db['Plugin']['find']({'where':{'id':_0x24f265[_0x6d9c('0x4a')]['id']},'attributes':['name','path'],'raw':!![]})['then'](handleEntityNotFound(_0xb678d1,null))[_0x6d9c('0x27')](function(_0x50ecee){if(_0x50ecee){var _0x3dc3e2=path['join'](config[_0x6d9c('0x4d')],_0x6d9c('0x4e'),util[_0x6d9c('0x4f')](_0x6d9c('0x50'),path[_0x6d9c('0x51')](_0x50ecee[_0x6d9c('0x2')])));var _0x3a2c84=fs['createWriteStream'](_0x3dc3e2);var _0x1bfeab=archiver(_0x6d9c('0x52'),{'zlib':{'level':0x9}});_0x1bfeab['on'](_0x6d9c('0x53'),function(_0x51eb25){if(_0x51eb25['code']===_0x6d9c('0x54')){logger['error'](_0x51eb25);}else{throw new db[(_0x6d9c('0x55'))][(_0x6d9c('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1bfeab['on'](_0x6d9c('0x2c'),function(_0x463b57){throw new db[(_0x6d9c('0x55'))]['Error'](_0x6d9c('0x57'));});_0x1bfeab['pipe'](_0x3a2c84);_0x1bfeab[_0x6d9c('0x58')](_0x6d9c('0x59'),{'cwd':path[_0x6d9c('0x5a')](config[_0x6d9c('0x4d')],_0x6d9c('0x4e'),path['dirname'](_0x50ecee['path'])),'ignore':[path['join'](path[_0x6d9c('0x51')](_0x50ecee[_0x6d9c('0x2')]),_0x6d9c('0x5b')),path[_0x6d9c('0x5a')](path['basename'](_0x50ecee[_0x6d9c('0x2')]),_0x6d9c('0x5c'))],'nodir':!![]})[_0x6d9c('0x5d')]();_0x3a2c84['on']('close',function(){if(!fs[_0x6d9c('0x5e')](_0x3dc3e2)){throw new db[(_0x6d9c('0x55'))]['Error'](_0x6d9c('0x5f'));}return _0xb678d1['download'](_0x3dc3e2,util[_0x6d9c('0x4f')](_0x6d9c('0x50'),path[_0x6d9c('0x51')](_0x50ecee[_0x6d9c('0x2')])),function(_0x102530){if(_0x102530){throw new db[(_0x6d9c('0x55'))][(_0x6d9c('0x56'))](_0x6d9c('0x60'));}fs[_0x6d9c('0x61')](_0x3dc3e2);logger[_0x6d9c('0x62')](_0x6d9c('0x63'));logger[_0x6d9c('0x62')](_0x6d9c('0x64'));});});}return null;})['catch'](handleError(_0xb678d1,null));};exports[_0x6d9c('0x65')]=function(_0x4a0303,_0x216409,_0xa6f5e9){var _0x62d21c=path[_0x6d9c('0x51')](_0x4a0303['file'][_0x6d9c('0x66')],path[_0x6d9c('0x67')](_0x4a0303[_0x6d9c('0x68')]['filename']));var _0x483b24=path[_0x6d9c('0x5a')](config['root'],'server/files/plugins',_0x4a0303['file'][_0x6d9c('0x66')]);var _0x1f6b01=path[_0x6d9c('0x5a')](config[_0x6d9c('0x4d')],_0x6d9c('0x4e'),_0x62d21c);logger[_0x6d9c('0x62')]('Plugin\x20upload\x20filepath:\x20%s',_0x483b24);logger[_0x6d9c('0x62')]('Plugin\x20upload\x20destination:\x20%s',_0x1f6b01);try{fs['chmodSync'](_0x483b24,parseInt('0777',0x8));extract(_0x483b24,{'dir':_0x1f6b01},function(_0x35e3fa){if(_0x35e3fa){logger['error'](_0x35e3fa);handleError(_0x35e3fa,!![]);};var _0x1d2b31=fs[_0x6d9c('0x69')](_0x1f6b01);if(_0x1d2b31[_0x6d9c('0x3a')]>0x1){removeReferences(_0x483b24,_0x1f6b01);logger[_0x6d9c('0x2c')]('Invalid\x20plugin\x20structure');return _0xa6f5e9(new Error('Invalid\x20plugin\x20structure'));}var _0x2427c8=fs[_0x6d9c('0x6a')](path[_0x6d9c('0x5a')](_0x1f6b01,_0x1d2b31[0x0]));if(_0x2427c8[_0x6d9c('0x6b')]()){removeReferences(_0x483b24,_0x1f6b01);logger['error']('Invalid\x20plugin\x20structure');return _0xa6f5e9(new Error(_0x6d9c('0x6c')));}if(_0x2427c8[_0x6d9c('0x6d')]()){var _0x53909a=fs['readdirSync'](path[_0x6d9c('0x5a')](_0x1f6b01,_0x1d2b31[0x0]));if(_0x53909a[_0x6d9c('0x3a')]===0x0){removeReferences(_0x483b24,_0x1f6b01);logger[_0x6d9c('0x2c')]('Invalid\x20plugin\x20structure');return _0xa6f5e9(new Error(_0x6d9c('0x6c')));}var _0x34171a=_0x53909a['some'](function(_0x256eba){return _0x256eba===_0x6d9c('0x6e');});if(!_0x34171a){return _0xa6f5e9(new Error('Plugin\x20manifest\x20missing'));}var _0x2c5027=fs[_0x6d9c('0x6f')](path[_0x6d9c('0x5a')](_0x1f6b01,_0x1d2b31[0x0],_0x6d9c('0x6e')));var _0x1b56be=JSON['parse'](_0x2c5027);if('undefined'==typeof _0x1b56be[_0x6d9c('0x2d')]){return _0xa6f5e9(new Error(_0x6d9c('0x70')));}if('undefined'==typeof _0x1b56be[_0x6d9c('0x32')]){return _0xa6f5e9(new Error(_0x6d9c('0x71')));}if(_0x6d9c('0x20')==typeof _0x1b56be[_0x6d9c('0x72')]){return _0xa6f5e9(new Error(_0x6d9c('0x73')));}if('undefined'==typeof _0x1b56be[_0x6d9c('0x74')]){return _0xa6f5e9(new Error(_0x6d9c('0x75')));}if(_0x1b56be[_0x6d9c('0x32')]===_0x6d9c('0x76')){if(_0x6d9c('0x20')==typeof _0x1b56be['parameters']['views']){return _0xa6f5e9(new Error(_0x6d9c('0x77')));}if(_0x6d9c('0x20')==typeof _0x1b56be[_0x6d9c('0x74')][_0x6d9c('0x78')][_0x6d9c('0x79')]&&'undefined'==typeof _0x1b56be[_0x6d9c('0x74')]['views']['agent']){return _0xa6f5e9(new Error(_0x6d9c('0x7a')));}}else if(_0x1b56be[_0x6d9c('0x32')]===_0x6d9c('0x7b')){if('undefined'==typeof _0x1b56be['parameters']['scriptName']){return _0xa6f5e9(new Error(_0x6d9c('0x7c')));}if('undefined'==typeof _0x1b56be[_0x6d9c('0x74')]['scriptPath']){return _0xa6f5e9(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xa6f5e9(new Error(_0x6d9c('0x7d')));}var _0x2a705f=_0x1b56be[_0x6d9c('0x2d')];var _0x3e4004=_0x1b56be[_0x6d9c('0x7e')];var _0x5073cc=_0x1b56be[_0x6d9c('0x32')];var _0x56239c=_0x1b56be[_0x6d9c('0x7f')]?_0x1b56be[_0x6d9c('0x7f')]:'always';var _0x17c86e=_0x1b56be[_0x6d9c('0x80')]?_0x1b56be[_0x6d9c('0x80')]:_0x6d9c('0x81');var _0x3c4295='';var _0x54e690='';var _0x3668ed='';var _0x12b6d3='';var _0x23393a=_0x1b56be[_0x6d9c('0x72')];if(_0x5073cc===_0x6d9c('0x76')){if('undefined'!=typeof _0x1b56be[_0x6d9c('0x74')][_0x6d9c('0x78')][_0x6d9c('0x79')]){var _0x3ab351=_0x1b56be[_0x6d9c('0x74')][_0x6d9c('0x78')][_0x6d9c('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x6d9c('0x82')](_0x3ab351)){_0x3c4295=path['join']('plugins',_0x62d21c,_0x1d2b31[0x0],_0x3ab351);}else{_0x3c4295=_0x3ab351;}}else{logger[_0x6d9c('0x62')](_0x6d9c('0x83'));}if('undefined'!=typeof _0x1b56be[_0x6d9c('0x74')][_0x6d9c('0x78')][_0x6d9c('0x84')]){var _0x25ef45=_0x1b56be[_0x6d9c('0x74')][_0x6d9c('0x78')][_0x6d9c('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x6d9c('0x82')](_0x25ef45)){_0x54e690=path['join'](_0x6d9c('0x85'),_0x62d21c,_0x1d2b31[0x0],_0x25ef45);}else{_0x54e690=_0x25ef45;}}else{logger['info'](_0x6d9c('0x86'));}}else if(_0x5073cc===_0x6d9c('0x7b')){_0x3668ed=_0x1b56be['parameters'][_0x6d9c('0x87')];_0x12b6d3=_0x1b56be[_0x6d9c('0x74')][_0x6d9c('0x88')];if(_0x6d9c('0x20')!=typeof _0x1b56be[_0x6d9c('0x74')][_0x6d9c('0x78')]){if(_0x6d9c('0x20')!=typeof _0x1b56be[_0x6d9c('0x74')]['views'][_0x6d9c('0x79')]){var _0x3ab351=_0x1b56be['parameters'][_0x6d9c('0x78')][_0x6d9c('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x6d9c('0x82')](_0x3ab351)){_0x3c4295=path[_0x6d9c('0x5a')]('plugins',_0x62d21c,_0x1d2b31[0x0],_0x3ab351);}else{_0x3c4295=_0x3ab351;}}if(_0x6d9c('0x20')!=typeof _0x1b56be[_0x6d9c('0x74')][_0x6d9c('0x78')][_0x6d9c('0x84')]){var _0x25ef45=_0x1b56be[_0x6d9c('0x74')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x6d9c('0x82')](_0x25ef45)){_0x54e690=path['join'](_0x6d9c('0x85'),_0x62d21c,_0x1d2b31[0x0],_0x25ef45);}else{_0x54e690=_0x25ef45;}}}}var _0x47cfb9={'name':_0x2a705f,'description':_0x3e4004,'path':path[_0x6d9c('0x5a')](_0x62d21c,_0x1d2b31[0x0]),'type':_0x5073cc,'sidebar':_0x56239c,'icon':_0x17c86e,'adminUrl':_0x3c4295,'agentUrl':_0x54e690,'scriptName':_0x3668ed,'scriptPath':_0x12b6d3,'version':_0x23393a};removeReferences(_0x483b24,null);return db['Plugin'][_0x6d9c('0x89')](_0x47cfb9)[_0x6d9c('0x27')](function(_0x571d1d){var _0xbf2ce6={'role':_0x4a0303[_0x6d9c('0x8a')][_0x6d9c('0x8b')],'userProfileId':_0x4a0303['body'][_0x6d9c('0x8c')]};if(!_0xbf2ce6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbf2ce6[_0x6d9c('0x8b')]===_0x6d9c('0x8d')){var _0x316267=_0x571d1d[_0x6d9c('0x29')]({'plain':!![]});return db[_0x6d9c('0x8e')][_0x6d9c('0x4c')]({'where':{'name':_0x6d9c('0x2a'),'userProfileId':_0xbf2ce6[_0x6d9c('0x8c')]},'raw':!![]})[_0x6d9c('0x27')](function(_0x2040f2){if(_0x2040f2&&_0x2040f2['autoAssociation']===0x0){return db[_0x6d9c('0x2b')][_0x6d9c('0x89')]({'name':_0x316267['name'],'resourceId':_0x316267['id'],'type':_0x2040f2['name'],'sectionId':_0x2040f2['id']},{})[_0x6d9c('0x27')](function(){return _0x571d1d;});}else{return _0x571d1d;}})['catch'](function(_0x4c432f){logger[_0x6d9c('0x2c')](_0x6d9c('0x8f'),_0x4c432f);throw _0x4c432f;});}return _0x571d1d;})['then'](respondWithResult(_0x216409,null))[_0x6d9c('0x48')](handleError(_0x216409,null));}});}catch(_0x2ef5b7){_0x216409[_0x6d9c('0x1d')](0x1f4)[_0x6d9c('0x2e')](_0x2ef5b7);}};function removeReferences(_0x38fd83,_0x4c62d5){try{if(_0x38fd83){fs[_0x6d9c('0x61')](_0x38fd83);logger['info']('Zip\x20archive\x20removed');}if(_0x4c62d5){rimraf(_0x4c62d5,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x1924ca){logger['error'](_0x1924ca);}}exports[_0x6d9c('0x26')]=function(_0x3cf6e2,_0x3ba4c4,_0x5060b2){return db['Plugin']['find']({'where':{'id':_0x3cf6e2[_0x6d9c('0x4a')]['id']}})[_0x6d9c('0x27')](handleEntityNotFound(_0x3ba4c4,null))[_0x6d9c('0x27')](saveUpdates(_0x3cf6e2[_0x6d9c('0x8a')],null))[_0x6d9c('0x27')](respondWithResult(_0x3ba4c4,null))[_0x6d9c('0x48')](handleError(_0x3ba4c4,null));};exports[_0x6d9c('0x90')]=function(_0x12ec62,_0xd09ddf,_0x25b441){return db[_0x6d9c('0x30')][_0x6d9c('0x4c')]({'where':{'id':_0x12ec62['params']['id']}})['then'](function(_0xc8dee0){if(_0xc8dee0){return _0xc8dee0[_0x6d9c('0x28')]();}})[_0x6d9c('0x27')](function(_0x5c5cba){rimraf(path[_0x6d9c('0x5a')](config['root'],'server/files/plugins',path['dirname'](_0x5c5cba[_0x6d9c('0x2')])),function(){});return _0x5c5cba;})[_0x6d9c('0x27')](handleEntityNotFound(_0xd09ddf,null))[_0x6d9c('0x27')](respondWithStatusCode(_0xd09ddf,null))['catch'](handleError(_0xd09ddf,null));};exports[_0x6d9c('0x91')]=function(_0x349db2,_0x3ee208,_0x1f9f1c){return BPromise[_0x6d9c('0x92')]()[_0x6d9c('0x27')](function(){if(!_0x349db2[_0x6d9c('0x34')][_0x6d9c('0x2')]){throw new Error(_0x6d9c('0x93'));}if(!_0x349db2[_0x6d9c('0x34')][_0x6d9c('0x94')]){throw new Error(_0x6d9c('0x95'));}var _0x55a0ad=_0x349db2[_0x6d9c('0x34')][_0x6d9c('0x96')]?_0x349db2[_0x6d9c('0x34')][_0x6d9c('0x96')]+':'+_0x349db2[_0x6d9c('0x34')]['port']:_0x6d9c('0x97')+_0x349db2[_0x6d9c('0x34')][_0x6d9c('0x94')];var _0x2f0c8a=_0x349db2[_0x6d9c('0x34')][_0x6d9c('0x98')]?_0x349db2[_0x6d9c('0x34')][_0x6d9c('0x98')]:!![];var _0x71a088=_0x349db2['query'][_0x6d9c('0x99')]?_0x349db2['query']['encoding']:null;var _0x456349={'method':_0x349db2[_0x6d9c('0x9a')],'uri':util[_0x6d9c('0x4f')](_0x6d9c('0x9b'),_0x55a0ad,_0x349db2[_0x6d9c('0x34')]['path']),'json':_0x2f0c8a,'resolveWithFullResponse':!![],'encoding':_0x71a088,'qs':_0x349db2[_0x6d9c('0x34')]};if(_0x349db2[_0x6d9c('0x9c')]){_0x456349[_0x6d9c('0x9c')]=_0x349db2['headers'];if(_0x456349[_0x6d9c('0x9c')]['content-length']){delete _0x456349[_0x6d9c('0x9c')][_0x6d9c('0x9d')];}}if(_0x456349['headers']['content-type']){delete _0x456349[_0x6d9c('0x9c')][_0x6d9c('0x9e')];}return rp(_0x456349);})[_0x6d9c('0x27')](function(_0xeebec3){if(_0xeebec3){_0x3ee208[_0x6d9c('0x9f')](_0xeebec3[_0x6d9c('0x9c')]);logger[_0x6d9c('0x62')](_0xeebec3['body']);if(_[_0x6d9c('0xa0')](_0x349db2['query'][_0x6d9c('0x2')],_0x6d9c('0xa1'))&&_0xeebec3[_0x6d9c('0xa2')]==0x1f4){return _0x3ee208[_0x6d9c('0x1c')](_0xeebec3['statusCode']);}else{return _0x3ee208[_0x6d9c('0x1d')](_0xeebec3[_0x6d9c('0xa2')])['send'](_0xeebec3[_0x6d9c('0x8a')]);}}else{return _0x3ee208['sendStatus'](0xc8);}})[_0x6d9c('0x48')](handleError(_0x3ee208,null));};exports[_0x6d9c('0xa3')]=function(_0x153f41,_0x3054d0,_0x5d971a){return BPromise[_0x6d9c('0x92')]()[_0x6d9c('0x27')](function(){if(!_0x153f41['query']['path']){throw new Error(_0x6d9c('0x93'));}if(!_0x153f41['query'][_0x6d9c('0x94')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x275b24=_0x153f41[_0x6d9c('0x34')][_0x6d9c('0x96')]?_0x153f41['query'][_0x6d9c('0x96')]+':'+_0x153f41[_0x6d9c('0x34')][_0x6d9c('0x94')]:_0x6d9c('0x97')+_0x153f41['query'][_0x6d9c('0x94')];var _0x26bb9d=_0x153f41[_0x6d9c('0x34')][_0x6d9c('0x98')]?_0x153f41['query'][_0x6d9c('0x98')]:!![];var _0x1feab9=_0x153f41[_0x6d9c('0x34')]['encoding']?_0x153f41[_0x6d9c('0x34')]['encoding']:null;var _0x1aa59e={'method':_0x153f41[_0x6d9c('0x9a')],'uri':util[_0x6d9c('0x4f')]('%s%s',_0x275b24,_0x153f41[_0x6d9c('0x34')][_0x6d9c('0x2')]),'json':_0x26bb9d,'resolveWithFullResponse':!![],'encoding':_0x1feab9,'body':_0x153f41[_0x6d9c('0x8a')]};if(_0x153f41[_0x6d9c('0x9c')]){_0x1aa59e[_0x6d9c('0x9c')]=_0x153f41['headers'];if(_0x1aa59e[_0x6d9c('0x9c')]['content-length']){delete _0x1aa59e[_0x6d9c('0x9c')][_0x6d9c('0x9d')];}}if(_0x1aa59e[_0x6d9c('0x9c')][_0x6d9c('0x9e')]){delete _0x1aa59e[_0x6d9c('0x9c')][_0x6d9c('0x9e')];}return rp(_0x1aa59e);})[_0x6d9c('0x27')](function(_0x4c7ba1){if(_0x4c7ba1){_0x3054d0[_0x6d9c('0x9f')](_0x4c7ba1[_0x6d9c('0x9c')]);logger[_0x6d9c('0x62')](_0x4c7ba1[_0x6d9c('0x8a')]);return _0x3054d0[_0x6d9c('0x1d')](_0x4c7ba1[_0x6d9c('0xa2')])[_0x6d9c('0x2e')](_0x4c7ba1[_0x6d9c('0x8a')]);}else{return _0x3054d0[_0x6d9c('0x1c')](0xc8);}})[_0x6d9c('0x48')](handleError(_0x3054d0,null));}; \ No newline at end of file +var _0x289e=['attributes','fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','catch','show','keys','find','params','server/files/plugins','format','%s.zip','basename','createWriteStream','code','ENOENT','error','Sequelize','Error','glob','**/*','root','join','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','test','plugins','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Plugins','UserProfileResource','end','stack','name','send','index','map','Plugin','rawAttributes','fieldName','key','query','filters','intersection','model'];(function(_0x60ce95,_0x2365a1){var _0x4676e1=function(_0x32430f){while(--_0x32430f){_0x60ce95['push'](_0x60ce95['shift']());}};_0x4676e1(++_0x2365a1);}(_0x289e,0x1b4));var _0xe289=function(_0x58236d,_0x365c03){_0x58236d=_0x58236d-0x0;var _0x322688=_0x289e[_0x58236d];return _0x322688;};'use strict';var emlformat=require(_0xe289('0x0'));var rimraf=require(_0xe289('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe289('0x2'));var rp=require(_0xe289('0x3'));var moment=require('moment');var BPromise=require(_0xe289('0x4'));var Mustache=require(_0xe289('0x5'));var util=require(_0xe289('0x6'));var path=require(_0xe289('0x7'));var sox=require(_0xe289('0x8'));var csv=require(_0xe289('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe289('0xa'));var _=require(_0xe289('0xb'));var squel=require('squel');var crypto=require(_0xe289('0xc'));var jsforce=require(_0xe289('0xd'));var deskjs=require(_0xe289('0xe'));var toCsv=require(_0xe289('0x9'));var querystring=require('querystring');var Papa=require(_0xe289('0xf'));var extract=require(_0xe289('0x10'));var rimraf=require('rimraf');var archiver=require(_0xe289('0x11'));var Redis=require('ioredis');var authService=require(_0xe289('0x12'));var qs=require(_0xe289('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe289('0x14'))(_0xe289('0x15'));var utils=require(_0xe289('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe289('0x17'))['db'];config[_0xe289('0x18')]=_[_0xe289('0x19')](config[_0xe289('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xe289('0x1a'))(new Redis(config[_0xe289('0x18')]));require(_0xe289('0x1b'))['register'](socket);function respondWithStatusCode(_0x1a4b06,_0x3f1bd5){_0x3f1bd5=_0x3f1bd5||0xcc;return function(_0x1ee083){if(_0x1ee083){return _0x1a4b06[_0xe289('0x1c')](_0x3f1bd5);}return _0x1a4b06[_0xe289('0x1d')](_0x3f1bd5)['end']();};}function respondWithResult(_0x43891d,_0x14e36a){_0x14e36a=_0x14e36a||0xc8;return function(_0x6b5513){if(_0x6b5513){return _0x43891d[_0xe289('0x1d')](_0x14e36a)['json'](_0x6b5513);}};}function respondWithFilteredResult(_0x1bb5fa,_0x5f57db){return function(_0x17093c){if(_0x17093c){var _0x5d7454=typeof _0x5f57db[_0xe289('0x1e')]===_0xe289('0x1f')&&typeof _0x5f57db['limit']===_0xe289('0x1f');var _0x1e778b=_0x17093c[_0xe289('0x20')];var _0x2da97f=_0x5d7454?0x0:_0x5f57db[_0xe289('0x1e')];var _0x33c0ab=_0x5d7454?_0x17093c[_0xe289('0x20')]:_0x5f57db[_0xe289('0x1e')]+_0x5f57db[_0xe289('0x21')];var _0x616dc9;if(_0x33c0ab>=_0x1e778b){_0x33c0ab=_0x1e778b;_0x616dc9=0xc8;}else{_0x616dc9=0xce;}_0x1bb5fa[_0xe289('0x1d')](_0x616dc9);return _0x1bb5fa[_0xe289('0x22')](_0xe289('0x23'),_0x2da97f+'-'+_0x33c0ab+'/'+_0x1e778b)[_0xe289('0x24')](_0x17093c);}return null;};}function patchUpdates(_0x291954){return function(_0x374cad){try{jsonpatch[_0xe289('0x25')](_0x374cad,_0x291954,!![]);}catch(_0x3193cf){return BPromise[_0xe289('0x26')](_0x3193cf);}return _0x374cad[_0xe289('0x27')]();};}function saveUpdates(_0x9d7e75,_0x22aa8f){return function(_0x2919b6){if(_0x2919b6){return _0x2919b6['update'](_0x9d7e75)[_0xe289('0x28')](function(_0xfcdd4d){return _0xfcdd4d;});}return null;};}function removeEntity(_0x295488,_0x1819fd){return function(_0x4bc33d){if(_0x4bc33d){return _0x4bc33d[_0xe289('0x29')]()[_0xe289('0x28')](function(){var _0x5ebcd3=_0x4bc33d[_0xe289('0x2a')]({'plain':!![]});var _0x39ce9a=_0xe289('0x2b');return db[_0xe289('0x2c')]['destroy']({'where':{'type':_0x39ce9a,'resourceId':_0x5ebcd3['id']}})[_0xe289('0x28')](function(){return _0x4bc33d;});})['then'](function(){_0x295488[_0xe289('0x1d')](0xcc)[_0xe289('0x2d')]();});}};}function handleEntityNotFound(_0x1b9fe4,_0x38cc03){return function(_0x47c4fc){if(!_0x47c4fc){_0x1b9fe4[_0xe289('0x1c')](0x194);}return _0x47c4fc;};}function handleError(_0x58bd41,_0x1b8871){_0x1b8871=_0x1b8871||0x1f4;return function(_0x90bb76){logger['error'](_0x90bb76[_0xe289('0x2e')]);if(_0x90bb76[_0xe289('0x2f')]){delete _0x90bb76['name'];}_0x58bd41[_0xe289('0x1d')](_0x1b8871)[_0xe289('0x30')](_0x90bb76);};}exports[_0xe289('0x31')]=function(_0x5c5bcb,_0x215272){var _0x1d0ecb={},_0x7e1329={},_0x1c251a={'count':0x0,'rows':[]};var _0x27c1e1=_[_0xe289('0x32')](db[_0xe289('0x33')][_0xe289('0x34')],function(_0x4f9b96){return{'name':_0x4f9b96[_0xe289('0x35')],'type':_0x4f9b96['type'][_0xe289('0x36')]};});_0x7e1329['model']=_['map'](_0x27c1e1,_0xe289('0x2f'));_0x7e1329[_0xe289('0x37')]=_['keys'](_0x5c5bcb[_0xe289('0x37')]);_0x7e1329[_0xe289('0x38')]=_[_0xe289('0x39')](_0x7e1329[_0xe289('0x3a')],_0x7e1329[_0xe289('0x37')]);_0x1d0ecb[_0xe289('0x3b')]=_[_0xe289('0x39')](_0x7e1329['model'],qs[_0xe289('0x3c')](_0x5c5bcb['query']['fields']));_0x1d0ecb['attributes']=_0x1d0ecb['attributes'][_0xe289('0x3d')]?_0x1d0ecb[_0xe289('0x3b')]:_0x7e1329[_0xe289('0x3a')];if(!_0x5c5bcb[_0xe289('0x37')]['hasOwnProperty'](_0xe289('0x3e'))){_0x1d0ecb[_0xe289('0x21')]=qs['limit'](_0x5c5bcb[_0xe289('0x37')][_0xe289('0x21')]);_0x1d0ecb[_0xe289('0x1e')]=qs[_0xe289('0x1e')](_0x5c5bcb[_0xe289('0x37')][_0xe289('0x1e')]);}_0x1d0ecb[_0xe289('0x3f')]=qs[_0xe289('0x40')](_0x5c5bcb[_0xe289('0x37')][_0xe289('0x40')]);_0x1d0ecb[_0xe289('0x41')]=qs[_0xe289('0x38')](_[_0xe289('0x42')](_0x5c5bcb[_0xe289('0x37')],_0x7e1329[_0xe289('0x38')]),_0x27c1e1);if(_0x5c5bcb['query']['filter']){_0x1d0ecb[_0xe289('0x41')]=_['merge'](_0x1d0ecb[_0xe289('0x41')],{'$or':_[_0xe289('0x32')](_0x27c1e1,function(_0x52854a){if(_0x52854a[_0xe289('0x43')]!==_0xe289('0x44')){var _0x4c0ffa={};_0x4c0ffa[_0x52854a[_0xe289('0x2f')]]={'$like':'%'+_0x5c5bcb[_0xe289('0x37')][_0xe289('0x45')]+'%'};return _0x4c0ffa;}})});}_0x1d0ecb=_[_0xe289('0x46')]({},_0x1d0ecb,_0x5c5bcb[_0xe289('0x47')]);var _0x51a4d5={'where':_0x1d0ecb[_0xe289('0x41')]};return db['Plugin']['count'](_0x51a4d5)[_0xe289('0x28')](function(_0x52ea7e){_0x1c251a[_0xe289('0x20')]=_0x52ea7e;if(_0x5c5bcb[_0xe289('0x37')][_0xe289('0x48')]){_0x1d0ecb[_0xe289('0x49')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x1d0ecb);})['then'](function(_0x1a3d0b){_0x1c251a['rows']=_0x1a3d0b;return _0x1c251a;})['then'](respondWithFilteredResult(_0x215272,_0x1d0ecb))[_0xe289('0x4a')](handleError(_0x215272,null));};exports[_0xe289('0x4b')]=function(_0x537f7b,_0x333869){var _0x198d8e={'raw':!![],'where':{'id':_0x537f7b['params']['id']}},_0x3d43ef={};_0x3d43ef[_0xe289('0x3a')]=_[_0xe289('0x4c')](db['Plugin'][_0xe289('0x34')]);_0x3d43ef[_0xe289('0x37')]=_[_0xe289('0x4c')](_0x537f7b[_0xe289('0x37')]);_0x3d43ef[_0xe289('0x38')]=_[_0xe289('0x39')](_0x3d43ef[_0xe289('0x3a')],_0x3d43ef['query']);_0x198d8e['attributes']=_[_0xe289('0x39')](_0x3d43ef[_0xe289('0x3a')],qs[_0xe289('0x3c')](_0x537f7b[_0xe289('0x37')]['fields']));_0x198d8e[_0xe289('0x3b')]=_0x198d8e[_0xe289('0x3b')]['length']?_0x198d8e[_0xe289('0x3b')]:_0x3d43ef[_0xe289('0x3a')];if(_0x537f7b[_0xe289('0x37')][_0xe289('0x48')]){_0x198d8e['include']=[{'all':!![]}];}_0x198d8e=_[_0xe289('0x46')]({},_0x198d8e,_0x537f7b[_0xe289('0x47')]);return db['Plugin'][_0xe289('0x4d')](_0x198d8e)['then'](handleEntityNotFound(_0x333869,null))['then'](respondWithResult(_0x333869,null))[_0xe289('0x4a')](handleError(_0x333869,null));};exports['download']=function(_0xb79349,_0x4df448,_0xec0f9e){return db['Plugin'][_0xe289('0x4d')]({'where':{'id':_0xb79349[_0xe289('0x4e')]['id']},'attributes':[_0xe289('0x2f'),_0xe289('0x7')],'raw':!![]})[_0xe289('0x28')](handleEntityNotFound(_0x4df448,null))[_0xe289('0x28')](function(_0x597d10){if(_0x597d10){var _0x3807d2=path['join'](config['root'],_0xe289('0x4f'),util[_0xe289('0x50')](_0xe289('0x51'),path[_0xe289('0x52')](_0x597d10[_0xe289('0x7')])));var _0x40d045=fs[_0xe289('0x53')](_0x3807d2);var _0x44c391=archiver('zip',{'zlib':{'level':0x9}});_0x44c391['on']('warning',function(_0x36d39a){if(_0x36d39a[_0xe289('0x54')]===_0xe289('0x55')){logger[_0xe289('0x56')](_0x36d39a);}else{throw new db[(_0xe289('0x57'))][(_0xe289('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x44c391['on'](_0xe289('0x56'),function(_0x183690){throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x44c391['pipe'](_0x40d045);_0x44c391[_0xe289('0x59')](_0xe289('0x5a'),{'cwd':path['join'](config[_0xe289('0x5b')],'server/files/plugins',path['dirname'](_0x597d10[_0xe289('0x7')])),'ignore':[path[_0xe289('0x5c')](path[_0xe289('0x52')](_0x597d10['path']),_0xe289('0x5d')),path[_0xe289('0x5c')](path['basename'](_0x597d10[_0xe289('0x7')]),'attachments/**/*')],'nodir':!![]})[_0xe289('0x5e')]();_0x40d045['on'](_0xe289('0x5f'),function(){if(!fs[_0xe289('0x60')](_0x3807d2)){throw new db['Sequelize'][(_0xe289('0x58'))](_0xe289('0x61'));}return _0x4df448[_0xe289('0x62')](_0x3807d2,util[_0xe289('0x50')](_0xe289('0x51'),path[_0xe289('0x52')](_0x597d10[_0xe289('0x7')])),function(_0xe10007){if(_0xe10007){throw new db[(_0xe289('0x57'))]['Error'](_0xe289('0x63'));}fs[_0xe289('0x64')](_0x3807d2);logger[_0xe289('0x65')](_0xe289('0x66'));logger[_0xe289('0x65')](_0xe289('0x67'));});});}return null;})[_0xe289('0x4a')](handleError(_0x4df448,null));};exports[_0xe289('0x68')]=function(_0xb6a759,_0x6d87ed,_0x3cf9a6){var _0x33e5b2=path[_0xe289('0x52')](_0xb6a759[_0xe289('0x69')][_0xe289('0x6a')],path['extname'](_0xb6a759[_0xe289('0x69')][_0xe289('0x6a')]));var _0x55556d=path[_0xe289('0x5c')](config[_0xe289('0x5b')],_0xe289('0x4f'),_0xb6a759[_0xe289('0x69')][_0xe289('0x6a')]);var _0x5790e3=path[_0xe289('0x5c')](config[_0xe289('0x5b')],_0xe289('0x4f'),_0x33e5b2);logger[_0xe289('0x65')](_0xe289('0x6b'),_0x55556d);logger[_0xe289('0x65')]('Plugin\x20upload\x20destination:\x20%s',_0x5790e3);try{fs[_0xe289('0x6c')](_0x55556d,parseInt(_0xe289('0x6d'),0x8));extract(_0x55556d,{'dir':_0x5790e3},function(_0x1715d3){if(_0x1715d3){logger['error'](_0x1715d3);handleError(_0x1715d3,!![]);};var _0x4dd918=fs[_0xe289('0x6e')](_0x5790e3);if(_0x4dd918[_0xe289('0x3d')]>0x1){removeReferences(_0x55556d,_0x5790e3);logger[_0xe289('0x56')](_0xe289('0x6f'));return _0x3cf9a6(new Error(_0xe289('0x6f')));}var _0x3d2614=fs['lstatSync'](path[_0xe289('0x5c')](_0x5790e3,_0x4dd918[0x0]));if(_0x3d2614[_0xe289('0x70')]()){removeReferences(_0x55556d,_0x5790e3);logger['error']('Invalid\x20plugin\x20structure');return _0x3cf9a6(new Error('Invalid\x20plugin\x20structure'));}if(_0x3d2614[_0xe289('0x71')]()){var _0x5c2eed=fs[_0xe289('0x6e')](path[_0xe289('0x5c')](_0x5790e3,_0x4dd918[0x0]));if(_0x5c2eed[_0xe289('0x3d')]===0x0){removeReferences(_0x55556d,_0x5790e3);logger[_0xe289('0x56')](_0xe289('0x6f'));return _0x3cf9a6(new Error(_0xe289('0x6f')));}var _0x5be6d8=_0x5c2eed[_0xe289('0x72')](function(_0x139f6e){return _0x139f6e==='manifest.json';});if(!_0x5be6d8){return _0x3cf9a6(new Error(_0xe289('0x73')));}var _0xedcbd4=fs['readFileSync'](path['join'](_0x5790e3,_0x4dd918[0x0],_0xe289('0x74')));var _0x3a42bf=JSON[_0xe289('0x75')](_0xedcbd4);if(_0xe289('0x1f')==typeof _0x3a42bf[_0xe289('0x2f')]){return _0x3cf9a6(new Error(_0xe289('0x76')));}if(_0xe289('0x1f')==typeof _0x3a42bf['type']){return _0x3cf9a6(new Error(_0xe289('0x77')));}if(_0xe289('0x1f')==typeof _0x3a42bf[_0xe289('0x78')]){return _0x3cf9a6(new Error(_0xe289('0x79')));}if('undefined'==typeof _0x3a42bf[_0xe289('0x7a')]){return _0x3cf9a6(new Error(_0xe289('0x7b')));}if(_0x3a42bf['type']===_0xe289('0x7c')){if('undefined'==typeof _0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')]){return _0x3cf9a6(new Error(_0xe289('0x7e')));}if(_0xe289('0x1f')==typeof _0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')][_0xe289('0x7f')]&&_0xe289('0x1f')==typeof _0x3a42bf[_0xe289('0x7a')]['views'][_0xe289('0x80')]){return _0x3cf9a6(new Error(_0xe289('0x81')));}}else if(_0x3a42bf[_0xe289('0x43')]===_0xe289('0x82')){if('undefined'==typeof _0x3a42bf[_0xe289('0x7a')][_0xe289('0x83')]){return _0x3cf9a6(new Error(_0xe289('0x84')));}if(_0xe289('0x1f')==typeof _0x3a42bf[_0xe289('0x7a')][_0xe289('0x85')]){return _0x3cf9a6(new Error(_0xe289('0x86')));}}else{return _0x3cf9a6(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x14fe2a=_0x3a42bf[_0xe289('0x2f')];var _0x20d4d6=_0x3a42bf[_0xe289('0x87')];var _0x1c77b5=_0x3a42bf['type'];var _0x5e5547=_0x3a42bf[_0xe289('0x88')]?_0x3a42bf[_0xe289('0x88')]:_0xe289('0x89');var _0x2fddc9=_0x3a42bf[_0xe289('0x8a')]?_0x3a42bf[_0xe289('0x8a')]:'icon-apps';var _0x9184bc='';var _0x124a4b='';var _0x2de70f='';var _0x5e0f0e='';var _0x26c575=_0x3a42bf[_0xe289('0x78')];if(_0x1c77b5===_0xe289('0x7c')){if(_0xe289('0x1f')!=typeof _0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')][_0xe289('0x7f')]){var _0x31763d=_0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x31763d)){_0x9184bc=path[_0xe289('0x5c')]('plugins',_0x33e5b2,_0x4dd918[0x0],_0x31763d);}else{_0x9184bc=_0x31763d;}}else{logger[_0xe289('0x65')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')]['agent']){var _0x53e263=_0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')][_0xe289('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xe289('0x8b')](_0x53e263)){_0x124a4b=path[_0xe289('0x5c')](_0xe289('0x8c'),_0x33e5b2,_0x4dd918[0x0],_0x53e263);}else{_0x124a4b=_0x53e263;}}else{logger[_0xe289('0x65')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1c77b5===_0xe289('0x82')){_0x2de70f=_0x3a42bf[_0xe289('0x7a')]['scriptName'];_0x5e0f0e=_0x3a42bf['parameters'][_0xe289('0x85')];if(_0xe289('0x1f')!=typeof _0x3a42bf['parameters'][_0xe289('0x7d')]){if(_0xe289('0x1f')!=typeof _0x3a42bf[_0xe289('0x7a')]['views'][_0xe289('0x7f')]){var _0x31763d=_0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')][_0xe289('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x31763d)){_0x9184bc=path['join'](_0xe289('0x8c'),_0x33e5b2,_0x4dd918[0x0],_0x31763d);}else{_0x9184bc=_0x31763d;}}if(_0xe289('0x1f')!=typeof _0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')]['agent']){var _0x53e263=_0x3a42bf[_0xe289('0x7a')][_0xe289('0x7d')][_0xe289('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x53e263)){_0x124a4b=path[_0xe289('0x5c')](_0xe289('0x8c'),_0x33e5b2,_0x4dd918[0x0],_0x53e263);}else{_0x124a4b=_0x53e263;}}}}var _0xb10c4a={'name':_0x14fe2a,'description':_0x20d4d6,'path':path[_0xe289('0x5c')](_0x33e5b2,_0x4dd918[0x0]),'type':_0x1c77b5,'sidebar':_0x5e5547,'icon':_0x2fddc9,'adminUrl':_0x9184bc,'agentUrl':_0x124a4b,'scriptName':_0x2de70f,'scriptPath':_0x5e0f0e,'version':_0x26c575};removeReferences(_0x55556d,null);return db['Plugin'][_0xe289('0x8d')](_0xb10c4a)[_0xe289('0x28')](function(_0x5bffba){var _0x429529={'role':_0xb6a759[_0xe289('0x8e')][_0xe289('0x8f')],'userProfileId':_0xb6a759[_0xe289('0x8e')]['userProfileId']};if(!_0x429529)throw new Error(_0xe289('0x90'));if(_0x429529[_0xe289('0x8f')]===_0xe289('0x91')){var _0x26bfba=_0x5bffba[_0xe289('0x2a')]({'plain':!![]});return db[_0xe289('0x92')][_0xe289('0x4d')]({'where':{'name':_0xe289('0x2b'),'userProfileId':_0x429529['userProfileId']},'raw':!![]})[_0xe289('0x28')](function(_0x3db4aa){if(_0x3db4aa&&_0x3db4aa['autoAssociation']===0x0){return db['UserProfileResource'][_0xe289('0x8d')]({'name':_0x26bfba['name'],'resourceId':_0x26bfba['id'],'type':_0x3db4aa[_0xe289('0x2f')],'sectionId':_0x3db4aa['id']},{})[_0xe289('0x28')](function(){return _0x5bffba;});}else{return _0x5bffba;}})[_0xe289('0x4a')](function(_0x51df57){logger[_0xe289('0x56')](_0xe289('0x93'),_0x51df57);throw _0x51df57;});}return _0x5bffba;})['then'](respondWithResult(_0x6d87ed,null))[_0xe289('0x4a')](handleError(_0x6d87ed,null));}});}catch(_0x4668c2){_0x6d87ed[_0xe289('0x1d')](0x1f4)[_0xe289('0x30')](_0x4668c2);}};function removeReferences(_0x2b34dc,_0x474f1e){try{if(_0x2b34dc){fs[_0xe289('0x64')](_0x2b34dc);logger[_0xe289('0x65')](_0xe289('0x94'));}if(_0x474f1e){rimraf(_0x474f1e,function(){});logger[_0xe289('0x65')](_0xe289('0x95'));}}catch(_0x386bb6){logger[_0xe289('0x56')](_0x386bb6);}}exports[_0xe289('0x96')]=function(_0x256b45,_0x5d1b56,_0x4a5ce3){return db[_0xe289('0x33')][_0xe289('0x4d')]({'where':{'id':_0x256b45[_0xe289('0x4e')]['id']}})[_0xe289('0x28')](handleEntityNotFound(_0x5d1b56,null))['then'](saveUpdates(_0x256b45[_0xe289('0x8e')],null))[_0xe289('0x28')](respondWithResult(_0x5d1b56,null))[_0xe289('0x4a')](handleError(_0x5d1b56,null));};exports[_0xe289('0x97')]=function(_0x372c35,_0x9396fd,_0x4ae884){return db['Plugin'][_0xe289('0x4d')]({'where':{'id':_0x372c35[_0xe289('0x4e')]['id']}})['then'](function(_0x4e219c){if(_0x4e219c){return _0x4e219c[_0xe289('0x29')]();}})[_0xe289('0x28')](function(_0x490f0e){rimraf(path[_0xe289('0x5c')](config['root'],_0xe289('0x4f'),path['dirname'](_0x490f0e[_0xe289('0x7')])),function(){});return _0x490f0e;})[_0xe289('0x28')](handleEntityNotFound(_0x9396fd,null))[_0xe289('0x28')](respondWithStatusCode(_0x9396fd,null))[_0xe289('0x4a')](handleError(_0x9396fd,null));};exports[_0xe289('0x98')]=function(_0x117fea,_0x2ce417,_0x2f881d){return BPromise['resolve']()[_0xe289('0x28')](function(){if(!_0x117fea[_0xe289('0x37')][_0xe289('0x7')]){throw new Error(_0xe289('0x99'));}if(!_0x117fea['query']['port']){throw new Error(_0xe289('0x9a'));}var _0x59b8ef=_0x117fea['query']['hostname']?_0x117fea['query'][_0xe289('0x9b')]+':'+_0x117fea['query'][_0xe289('0x9c')]:'http://localhost:'+_0x117fea[_0xe289('0x37')][_0xe289('0x9c')];var _0x290d6e=_0x117fea[_0xe289('0x37')][_0xe289('0x24')]?_0x117fea[_0xe289('0x37')][_0xe289('0x24')]:!![];var _0x2be444=_0x117fea[_0xe289('0x37')][_0xe289('0x9d')]?_0x117fea[_0xe289('0x37')]['encoding']:null;var _0x316b55={'method':_0x117fea[_0xe289('0x9e')],'uri':util[_0xe289('0x50')](_0xe289('0x9f'),_0x59b8ef,_0x117fea[_0xe289('0x37')]['path']),'json':_0x290d6e,'resolveWithFullResponse':!![],'encoding':_0x2be444,'qs':_0x117fea[_0xe289('0x37')]};if(_0x117fea[_0xe289('0xa0')]){_0x316b55[_0xe289('0xa0')]=_0x117fea[_0xe289('0xa0')];if(_0x316b55['headers']['content-length']){delete _0x316b55[_0xe289('0xa0')][_0xe289('0xa1')];}}if(_0x316b55['headers'][_0xe289('0xa2')]){delete _0x316b55[_0xe289('0xa0')][_0xe289('0xa2')];}return rp(_0x316b55);})['then'](function(_0x3a1253){if(_0x3a1253){_0x2ce417[_0xe289('0x22')](_0x3a1253['headers']);logger[_0xe289('0x65')](_0x3a1253[_0xe289('0x8e')]);if(_[_0xe289('0xa3')](_0x117fea[_0xe289('0x37')][_0xe289('0x7')],_0xe289('0x62'))&&_0x3a1253['statusCode']==0x1f4){return _0x2ce417[_0xe289('0x1c')](_0x3a1253[_0xe289('0xa4')]);}else{return _0x2ce417['status'](_0x3a1253[_0xe289('0xa4')])[_0xe289('0x30')](_0x3a1253[_0xe289('0x8e')]);}}else{return _0x2ce417[_0xe289('0x1c')](0xc8);}})[_0xe289('0x4a')](handleError(_0x2ce417,null));};exports['webhookPost']=function(_0x55f6fc,_0x16419c,_0x4daa3e){return BPromise['resolve']()[_0xe289('0x28')](function(){if(!_0x55f6fc['query'][_0xe289('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x55f6fc[_0xe289('0x37')][_0xe289('0x9c')]){throw new Error(_0xe289('0x9a'));}var _0x474115=_0x55f6fc[_0xe289('0x37')]['hostname']?_0x55f6fc[_0xe289('0x37')]['hostname']+':'+_0x55f6fc[_0xe289('0x37')][_0xe289('0x9c')]:'http://localhost:'+_0x55f6fc['query']['port'];var _0x78e115=_0x55f6fc['query'][_0xe289('0x24')]?_0x55f6fc[_0xe289('0x37')][_0xe289('0x24')]:!![];var _0x2356d5=_0x55f6fc[_0xe289('0x37')][_0xe289('0x9d')]?_0x55f6fc[_0xe289('0x37')][_0xe289('0x9d')]:null;var _0x2a2474={'method':_0x55f6fc[_0xe289('0x9e')],'uri':util[_0xe289('0x50')](_0xe289('0x9f'),_0x474115,_0x55f6fc['query'][_0xe289('0x7')]),'json':_0x78e115,'resolveWithFullResponse':!![],'encoding':_0x2356d5,'body':_0x55f6fc[_0xe289('0x8e')]};if(_0x55f6fc[_0xe289('0xa0')]){_0x2a2474[_0xe289('0xa0')]=_0x55f6fc[_0xe289('0xa0')];if(_0x2a2474[_0xe289('0xa0')][_0xe289('0xa1')]){delete _0x2a2474[_0xe289('0xa0')][_0xe289('0xa1')];}}if(_0x2a2474[_0xe289('0xa0')][_0xe289('0xa2')]){delete _0x2a2474[_0xe289('0xa0')][_0xe289('0xa2')];}return rp(_0x2a2474);})[_0xe289('0x28')](function(_0x8c72e4){if(_0x8c72e4){_0x16419c[_0xe289('0x22')](_0x8c72e4[_0xe289('0xa0')]);logger[_0xe289('0x65')](_0x8c72e4['body']);return _0x16419c[_0xe289('0x1d')](_0x8c72e4[_0xe289('0xa4')])['send'](_0x8c72e4[_0xe289('0x8e')]);}else{return _0x16419c[_0xe289('0x1c')](0xc8);}})[_0xe289('0x4a')](handleError(_0x16419c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 8dd007d..beae740 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 _0x297f=['../../mysqldb','save','update','remove','emit','hasOwnProperty','events'];(function(_0x48fc78,_0x221335){var _0x57a4db=function(_0x2c843e){while(--_0x2c843e){_0x48fc78['push'](_0x48fc78['shift']());}};_0x57a4db(++_0x221335);}(_0x297f,0x1f0));var _0xf297=function(_0xdda8a6,_0x3f098b){_0xdda8a6=_0xdda8a6-0x0;var _0x591821=_0x297f[_0xdda8a6];return _0x591821;};'use strict';var EventEmitter=require(_0xf297('0x0'));var Plugin=require(_0xf297('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf297('0x2'),'afterUpdate':_0xf297('0x3'),'afterDestroy':_0xf297('0x4')};function emitEvent(_0x39ec01){return function(_0x586413,_0x462efe,_0x4a736d){PluginEvents[_0xf297('0x5')](_0x39ec01+':'+_0x586413['id'],_0x586413);PluginEvents[_0xf297('0x5')](_0x39ec01,_0x586413);_0x4a736d(null);};}for(var e in events){if(events[_0xf297('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xadf0=['save','update','remove','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x2bb07d,_0x311fe5){var _0xa6660c=function(_0x1ed6d3){while(--_0x1ed6d3){_0x2bb07d['push'](_0x2bb07d['shift']());}};_0xa6660c(++_0x311fe5);}(_0xadf0,0x12d));var _0x0adf=function(_0x5a93e6,_0xed0d78){_0x5a93e6=_0x5a93e6-0x0;var _0x324f66=_0xadf0[_0x5a93e6];return _0x324f66;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x0adf('0x0'))['db'][_0x0adf('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x0adf('0x2')](0x0);var events={'afterCreate':_0x0adf('0x3'),'afterUpdate':_0x0adf('0x4'),'afterDestroy':_0x0adf('0x5')};function emitEvent(_0x911855){return function(_0x4b4b16,_0xb48987,_0x567ca2){PluginEvents['emit'](_0x911855+':'+_0x4b4b16['id'],_0x4b4b16);PluginEvents['emit'](_0x911855,_0x4b4b16);_0x567ca2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x0adf('0x6')](e,emitEvent(event));}}module[_0x0adf('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 0cc0631..4511517 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 _0x72a2=['define','Plugin','plugins','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x72a2,0x161));var _0x272a=function(_0x27ce4c,_0x2f5333){_0x27ce4c=_0x27ce4c-0x0;var _0x4ebb7c=_0x72a2[_0x27ce4c];return _0x4ebb7c;};'use strict';var _=require('lodash');var util=require(_0x272a('0x0'));var logger=require(_0x272a('0x1'))(_0x272a('0x2'));var moment=require(_0x272a('0x3'));var BPromise=require(_0x272a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x272a('0x5'));var rimraf=require('rimraf');var config=require(_0x272a('0x6'));var attributes=require('./plugin.attributes');module['exports']=function(_0x4f628a,_0x2ba5db){return _0x4f628a[_0x272a('0x7')](_0x272a('0x8'),attributes,{'tableName':_0x272a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5410=['../../config/environment','./plugin.attributes','define','Plugin','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x491220,_0xb4cdc7){var _0x34a153=function(_0x4ef8d9){while(--_0x4ef8d9){_0x491220['push'](_0x491220['shift']());}};_0x34a153(++_0xb4cdc7);}(_0x5410,0xa0));var _0x0541=function(_0x5518eb,_0x26bcdf){_0x5518eb=_0x5518eb-0x0;var _0x3e5efd=_0x5410[_0x5518eb];return _0x3e5efd;};'use strict';var _=require('lodash');var util=require(_0x0541('0x0'));var logger=require(_0x0541('0x1'))(_0x0541('0x2'));var moment=require(_0x0541('0x3'));var BPromise=require(_0x0541('0x4'));var rp=require(_0x0541('0x5'));var fs=require('fs');var path=require(_0x0541('0x6'));var rimraf=require(_0x0541('0x7'));var config=require(_0x0541('0x8'));var attributes=require(_0x0541('0x9'));module['exports']=function(_0x19e8e5,_0x3a199b){return _0x19e8e5[_0x0541('0xa')](_0x0541('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 27e96b9..c837732 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 _0x6cf2=['request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','options','raw','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x6cf2,0x152));var _0x26cf=function(_0x3da318,_0x256273){_0x3da318=_0x3da318-0x0;var _0x17a60c=_0x6cf2[_0x3da318];return _0x17a60c;};'use strict';var _=require(_0x26cf('0x0'));var util=require(_0x26cf('0x1'));var moment=require(_0x26cf('0x2'));var BPromise=require('bluebird');var rs=require(_0x26cf('0x3'));var fs=require('fs');var Redis=require(_0x26cf('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x26cf('0x5'))(_0x26cf('0x6'));var config=require('../../config/environment');var jayson=require(_0x26cf('0x7'));var client=jayson[_0x26cf('0x8')][_0x26cf('0x9')]({'port':0x232a});config[_0x26cf('0xa')]=_['defaults'](config['redis'],{'host':_0x26cf('0xb'),'port':0x18eb});var socket=require(_0x26cf('0xc'))(new Redis(config[_0x26cf('0xa')]));require('./plugin.socket')[_0x26cf('0xd')](socket);function respondWithRpcPromise(_0x1e345c,_0x115ba1,_0x161927){return new BPromise(function(_0x1456a5,_0x504b60){return client[_0x26cf('0xe')](_0x1e345c,_0x161927)[_0x26cf('0xf')](function(_0x41edab){logger[_0x26cf('0x10')]('Plugin,\x20%s,\x20%s',_0x115ba1,_0x26cf('0x11'));logger[_0x26cf('0x12')](_0x26cf('0x13'),_0x115ba1,_0x26cf('0x11'),JSON[_0x26cf('0x14')](_0x41edab));if(_0x41edab[_0x26cf('0x15')]){if(_0x41edab[_0x26cf('0x15')][_0x26cf('0x16')]===0x1f4){logger['error'](_0x26cf('0x17'),_0x115ba1,_0x41edab['error'][_0x26cf('0x18')]);return _0x504b60(_0x41edab[_0x26cf('0x15')][_0x26cf('0x18')]);}logger[_0x26cf('0x15')]('Plugin,\x20%s,\x20%s',_0x115ba1,_0x41edab[_0x26cf('0x15')]['message']);return _0x1456a5(_0x41edab[_0x26cf('0x15')][_0x26cf('0x18')]);}else{logger[_0x26cf('0x10')](_0x26cf('0x17'),_0x115ba1,_0x26cf('0x11'));_0x1456a5(_0x41edab[_0x26cf('0x19')]['message']);}})[_0x26cf('0x1a')](function(_0x3ea7d0){logger['error'](_0x26cf('0x17'),_0x115ba1,_0x3ea7d0);_0x504b60(_0x3ea7d0);});});}exports[_0x26cf('0x1b')]=function(_0xf4a4e4){var _0x1b5e11=this;return new Promise(function(_0x49e77d,_0x370085){return db[_0x26cf('0x1c')][_0x26cf('0x1d')](_0xf4a4e4['body'],{'raw':_0xf4a4e4['options']?_0xf4a4e4[_0x26cf('0x1e')][_0x26cf('0x1f')]===undefined?!![]:![]:!![]})[_0x26cf('0xf')](function(_0x5e14da){logger[_0x26cf('0x10')]('CreatePlugin',_0xf4a4e4);logger['debug'](_0x26cf('0x1b'),_0xf4a4e4,JSON[_0x26cf('0x14')](_0x5e14da));_0x49e77d(_0x5e14da);})['catch'](function(_0xa023b1){logger['error']('CreatePlugin',_0xa023b1[_0x26cf('0x18')],_0xf4a4e4);_0x370085(_0x1b5e11[_0x26cf('0x15')](0x1f4,_0xa023b1[_0x26cf('0x18')]));});});}; \ No newline at end of file +var _0xf056=['register','request','then','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','create','options','raw','CreatePlugin','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket'];(function(_0x4821ad,_0x2f2805){var _0x403d28=function(_0x11d816){while(--_0x11d816){_0x4821ad['push'](_0x4821ad['shift']());}};_0x403d28(++_0x2f2805);}(_0xf056,0x186));var _0x6f05=function(_0x23dd95,_0x21623a){_0x23dd95=_0x23dd95-0x0;var _0x187fd2=_0xf056[_0x23dd95];return _0x187fd2;};'use strict';var _=require(_0x6f05('0x0'));var util=require(_0x6f05('0x1'));var moment=require(_0x6f05('0x2'));var BPromise=require(_0x6f05('0x3'));var rs=require(_0x6f05('0x4'));var fs=require('fs');var Redis=require(_0x6f05('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f05('0x6'));var logger=require(_0x6f05('0x7'))(_0x6f05('0x8'));var config=require(_0x6f05('0x9'));var jayson=require(_0x6f05('0xa'));var client=jayson[_0x6f05('0xb')][_0x6f05('0xc')]({'port':0x232a});config[_0x6f05('0xd')]=_[_0x6f05('0xe')](config['redis'],{'host':_0x6f05('0xf'),'port':0x18eb});var socket=require(_0x6f05('0x10'))(new Redis(config[_0x6f05('0xd')]));require(_0x6f05('0x11'))[_0x6f05('0x12')](socket);function respondWithRpcPromise(_0x99429f,_0x598d59,_0x2c6377){return new BPromise(function(_0x5a4bc2,_0x1a9396){return client[_0x6f05('0x13')](_0x99429f,_0x2c6377)[_0x6f05('0x14')](function(_0x59e8ba){logger[_0x6f05('0x15')](_0x6f05('0x16'),_0x598d59,'request\x20sent');logger[_0x6f05('0x17')]('Plugin,\x20%s,\x20%s,\x20%s',_0x598d59,_0x6f05('0x18'),JSON[_0x6f05('0x19')](_0x59e8ba));if(_0x59e8ba['error']){if(_0x59e8ba[_0x6f05('0x1a')][_0x6f05('0x1b')]===0x1f4){logger[_0x6f05('0x1a')]('Plugin,\x20%s,\x20%s',_0x598d59,_0x59e8ba['error'][_0x6f05('0x1c')]);return _0x1a9396(_0x59e8ba['error'][_0x6f05('0x1c')]);}logger[_0x6f05('0x1a')](_0x6f05('0x16'),_0x598d59,_0x59e8ba[_0x6f05('0x1a')][_0x6f05('0x1c')]);return _0x5a4bc2(_0x59e8ba['error'][_0x6f05('0x1c')]);}else{logger[_0x6f05('0x15')](_0x6f05('0x16'),_0x598d59,_0x6f05('0x18'));_0x5a4bc2(_0x59e8ba[_0x6f05('0x1d')][_0x6f05('0x1c')]);}})['catch'](function(_0x2fde5e){logger[_0x6f05('0x1a')](_0x6f05('0x16'),_0x598d59,_0x2fde5e);_0x1a9396(_0x2fde5e);});});}exports['CreatePlugin']=function(_0x3f3c59){var _0x36b5dc=this;return new Promise(function(_0x1eea5b,_0x268340){return db['Plugin'][_0x6f05('0x1e')](_0x3f3c59['body'],{'raw':_0x3f3c59[_0x6f05('0x1f')]?_0x3f3c59[_0x6f05('0x1f')][_0x6f05('0x20')]===undefined?!![]:![]:!![]})[_0x6f05('0x14')](function(_0x46f39e){logger[_0x6f05('0x15')](_0x6f05('0x21'),_0x3f3c59);logger['debug'](_0x6f05('0x21'),_0x3f3c59,JSON['stringify'](_0x46f39e));_0x1eea5b(_0x46f39e);})['catch'](function(_0x4c835b){logger[_0x6f05('0x1a')]('CreatePlugin',_0x4c835b[_0x6f05('0x1c')],_0x3f3c59);_0x268340(_0x36b5dc[_0x6f05('0x1a')](0x1f4,_0x4c835b[_0x6f05('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index bfd10ca..5524d43 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 _0xf34d=['save','remove','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf34d,0x129));var _0xdf34=function(_0x81f8c4,_0x2a5682){_0x81f8c4=_0x81f8c4-0x0;var _0x4b1afc=_0xf34d[_0x81f8c4];return _0x4b1afc;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xdf34('0x0'),_0xdf34('0x1'),_0xdf34('0x2')];function createListener(_0x4ed3ad,_0x3e649e){return function(_0x24322b){_0x3e649e['emit'](_0x4ed3ad,_0x24322b);};}function removeListener(_0xd77ea7,_0x48ce7e){return function(){PluginEvents['removeListener'](_0xd77ea7,_0x48ce7e);};}exports['register']=function(_0x324854){for(var _0x4b25fc=0x0,_0x551fb4=events['length'];_0x4b25fc<_0x551fb4;_0x4b25fc++){var _0x3c261b=events[_0x4b25fc];var _0x2ab0e5=createListener('plugin:'+_0x3c261b,_0x324854);PluginEvents['on'](_0x3c261b,_0x2ab0e5);}}; \ No newline at end of file +var _0xbd0e=['update','emit','removeListener','length','plugin:','./plugin.events','save','remove'];(function(_0x328b9b,_0x13082a){var _0x3a2d51=function(_0x63002b){while(--_0x63002b){_0x328b9b['push'](_0x328b9b['shift']());}};_0x3a2d51(++_0x13082a);}(_0xbd0e,0x10d));var _0xebd0=function(_0x1715a2,_0x13d1d3){_0x1715a2=_0x1715a2-0x0;var _0x447fc1=_0xbd0e[_0x1715a2];return _0x447fc1;};'use strict';var PluginEvents=require(_0xebd0('0x0'));var events=[_0xebd0('0x1'),_0xebd0('0x2'),_0xebd0('0x3')];function createListener(_0x49ab2a,_0x12fe6c){return function(_0x2c2a0a){_0x12fe6c[_0xebd0('0x4')](_0x49ab2a,_0x2c2a0a);};}function removeListener(_0x3cbefe,_0x5dba12){return function(){PluginEvents[_0xebd0('0x5')](_0x3cbefe,_0x5dba12);};}exports['register']=function(_0x24e19c){for(var _0x3f80cd=0x0,_0x496e03=events[_0xebd0('0x6')];_0x3f80cd<_0x496e03;_0x3f80cd++){var _0x248140=events[_0x3f80cd];var _0x5d2005=createListener(_0xebd0('0x7')+_0x248140,_0x24e19c);PluginEvents['on'](_0x248140,_0x5d2005);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 9d50569..67c1864 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(_0x2904f2,_0x3001ad){var _0x17936d=function(_0x534623){while(--_0x534623){_0x2904f2['push'](_0x2904f2['shift']());}};_0x17936d(++_0x3001ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x308182,_0x5c805a){var _0x423e4c=function(_0x4094b7){while(--_0x4094b7){_0x308182['push'](_0x308182['shift']());}};_0x423e4c(++_0x5c805a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 bbf8ac4..529c615 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 _0x4ea3=['dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','destroy','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','name','npm\x20install','info','index','list','then','reject','express','length','catch','show','describe','params','create','body','script','../../files/plugins','chdir'];(function(_0x2920d7,_0x2028a2){var _0xfdce5f=function(_0x1778b0){while(--_0x1778b0){_0x2920d7['push'](_0x2920d7['shift']());}};_0xfdce5f(++_0x2028a2);}(_0x4ea3,0x70));var _0x34ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4ea3[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x34ea('0x0'));var pm2=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var path=require('path');var exec=require(_0x34ea('0x4'))['exec'];var BPromise=require(_0x34ea('0x5'));function handleEntityNotFound(_0x571f1b,_0x5e5a84){return function(_0x2ce955){if(!_0x2ce955){_0x571f1b[_0x34ea('0x6')](0x194);;}return _0x2ce955;};}function respondWithResult(_0x962596,_0x123d48){_0x123d48=_0x123d48||0xc8;return function(_0x40434e){if(_0x40434e){return _0x962596[_0x34ea('0x7')](_0x123d48)[_0x34ea('0x8')](_0x40434e);}return null;};}function handleError(_0x5bec7c,_0x341727){_0x341727=_0x341727||0x1f4;return function(_0x6e9ccc){logger[_0x34ea('0x9')](_0x6e9ccc['stack']);if(_0x6e9ccc[_0x34ea('0xa')]){delete _0x6e9ccc[_0x34ea('0xa')];}_0x5bec7c['status'](_0x341727)['send'](_0x6e9ccc);};}function execChildProcess(){return new BPromise(function(_0x5bd8b6,_0x346287){exec(_0x34ea('0xb'),function(_0x58bb0d,_0x11229e,_0x29a5c8){logger[_0x34ea('0xc')](_0x11229e);logger[_0x34ea('0xc')](_0x29a5c8);if(_0x58bb0d){logger[_0x34ea('0x9')](_0x58bb0d);return _0x346287(_0x58bb0d);}return _0x5bd8b6(_0x11229e);});});}exports[_0x34ea('0xd')]=function(_0x37e1b4,_0x36af43){return pm2[_0x34ea('0xe')]()[_0x34ea('0xf')](function(_0x36a4c6){if(_0x36a4c6){var _0x5ef9ae=_[_0x34ea('0x10')](_0x36a4c6,function(_0x89e3f2){return _0x89e3f2[_0x34ea('0xa')]===_0x34ea('0x11')||_0x89e3f2[_0x34ea('0xa')]==='motion2';});return{'rows':_0x5ef9ae,'count':_0x5ef9ae[_0x34ea('0x12')]};}return null;})[_0x34ea('0xf')](respondWithResult(_0x36af43,null))[_0x34ea('0x13')](handleError(_0x36af43,null));};exports[_0x34ea('0x14')]=function(_0x5f420f,_0x2680e0){return pm2[_0x34ea('0x15')](_0x5f420f[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x2680e0,null))[_0x34ea('0xf')](handleEntityNotFound(_0x2680e0,null))[_0x34ea('0x13')](handleError(_0x2680e0,null));};exports[_0x34ea('0x17')]=function(_0x127308,_0x52af16){if(_0x127308[_0x34ea('0x18')][_0x34ea('0xa')]&&_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]){var _0x4fc1a2=path['join'](__dirname,_0x34ea('0x1a'),_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]);var _0x51022f=process['cwd']();process[_0x34ea('0x1b')](path[_0x34ea('0x1c')](_0x4fc1a2));return execChildProcess()[_0x34ea('0xf')](function(_0x30c4b0){process[_0x34ea('0x1b')](_0x51022f);return pm2[_0x34ea('0x1d')]({'name':_0x127308['body'][_0x34ea('0xa')],'script':_0x4fc1a2});})[_0x34ea('0xf')](function(_0x3c0983){pm2[_0x34ea('0x1e')]();return _0x3c0983[0x0];})['then'](respondWithResult(_0x52af16,0xc9))['catch'](handleError(_0x52af16,null));}else{return _0x52af16['status'](0x1f4)[_0x34ea('0x1f')]({'message':_0x34ea('0x20')});}};exports[_0x34ea('0x21')]=function(_0x4204d7,_0x5b8b3e){if(_0x4204d7[_0x34ea('0x18')]['id']){delete _0x4204d7[_0x34ea('0x18')]['id'];}var _0x27c6f7={'online':'restart','stopped':'stop'};if(_0x27c6f7['hasOwnProperty'](_0x4204d7['body'][_0x34ea('0x7')])){return pm2[_0x27c6f7[_0x4204d7[_0x34ea('0x18')][_0x34ea('0x7')]]](_0x4204d7[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x5b8b3e,0xc8))[_0x34ea('0x13')](handleError(_0x5b8b3e,null));}else{return _0x5b8b3e['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20status'});}};exports[_0x34ea('0x22')]=function(_0x14e018,_0x3cb968){if(_0x14e018['body']['id']){delete _0x14e018[_0x34ea('0x18')]['id'];}if(_0x14e018[_0x34ea('0x16')]['id']){return pm2['delete'](_0x14e018[_0x34ea('0x16')]['id'])['then'](function(_0x1392b6){pm2[_0x34ea('0x1e')]();return _0x1392b6[0x0];})[_0x34ea('0xf')](respondWithResult(_0x3cb968,null))['catch'](handleError(_0x3cb968,null));}else{return _0x3cb968['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xa9e0=['list','then','reject','express','motion2','catch','describe','params','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','bluebird','sendStatus','status','stack','name','send','info','error','index'];(function(_0x5700ed,_0x420ac4){var _0x926939=function(_0x285aae){while(--_0x285aae){_0x5700ed['push'](_0x5700ed['shift']());}};_0x926939(++_0x420ac4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var pm2=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var path=require('path');var exec=require(_0x0a9e('0x3'))['exec'];var BPromise=require(_0x0a9e('0x4'));function handleEntityNotFound(_0x432180,_0x2ab90b){return function(_0x991246){if(!_0x991246){_0x432180[_0x0a9e('0x5')](0x194);;}return _0x991246;};}function respondWithResult(_0x57b080,_0x219af0){_0x219af0=_0x219af0||0xc8;return function(_0x441e3a){if(_0x441e3a){return _0x57b080[_0x0a9e('0x6')](_0x219af0)['json'](_0x441e3a);}return null;};}function handleError(_0x503809,_0xe42b77){_0xe42b77=_0xe42b77||0x1f4;return function(_0x56465b){logger['error'](_0x56465b[_0x0a9e('0x7')]);if(_0x56465b[_0x0a9e('0x8')]){delete _0x56465b[_0x0a9e('0x8')];}_0x503809[_0x0a9e('0x6')](_0xe42b77)[_0x0a9e('0x9')](_0x56465b);};}function execChildProcess(){return new BPromise(function(_0xbd1168,_0x4a4c56){exec('npm\x20install',function(_0x527cdd,_0x4cfe67,_0x273d4d){logger[_0x0a9e('0xa')](_0x4cfe67);logger[_0x0a9e('0xa')](_0x273d4d);if(_0x527cdd){logger[_0x0a9e('0xb')](_0x527cdd);return _0x4a4c56(_0x527cdd);}return _0xbd1168(_0x4cfe67);});});}exports[_0x0a9e('0xc')]=function(_0x69aeb7,_0x5db4b0){return pm2[_0x0a9e('0xd')]()[_0x0a9e('0xe')](function(_0x2b4227){if(_0x2b4227){var _0x281129=_[_0x0a9e('0xf')](_0x2b4227,function(_0x4d5611){return _0x4d5611['name']===_0x0a9e('0x10')||_0x4d5611['name']===_0x0a9e('0x11');});return{'rows':_0x281129,'count':_0x281129['length']};}return null;})[_0x0a9e('0xe')](respondWithResult(_0x5db4b0,null))[_0x0a9e('0x12')](handleError(_0x5db4b0,null));};exports['show']=function(_0x225616,_0x5a0a06){return pm2[_0x0a9e('0x13')](_0x225616[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](respondWithResult(_0x5a0a06,null))[_0x0a9e('0xe')](handleEntityNotFound(_0x5a0a06,null))[_0x0a9e('0x12')](handleError(_0x5a0a06,null));};exports[_0x0a9e('0x15')]=function(_0x530eb7,_0x20559e){if(_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x8')]&&_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x17')]){var _0x4bb1e3=path[_0x0a9e('0x18')](__dirname,_0x0a9e('0x19'),_0x530eb7['body'][_0x0a9e('0x17')]);var _0x5a09ef=process['cwd']();process[_0x0a9e('0x1a')](path[_0x0a9e('0x1b')](_0x4bb1e3));return execChildProcess()[_0x0a9e('0xe')](function(_0x30bae6){process['chdir'](_0x5a09ef);return pm2[_0x0a9e('0x1c')]({'name':_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x8')],'script':_0x4bb1e3});})[_0x0a9e('0xe')](function(_0x370d86){pm2[_0x0a9e('0x1d')]();return _0x370d86[0x0];})[_0x0a9e('0xe')](respondWithResult(_0x20559e,0xc9))['catch'](handleError(_0x20559e,null));}else{return _0x20559e['status'](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x1e')});}};exports[_0x0a9e('0x1f')]=function(_0x33161b,_0x526cf3){if(_0x33161b[_0x0a9e('0x16')]['id']){delete _0x33161b['body']['id'];}var _0x45a1e7={'online':'restart','stopped':_0x0a9e('0x20')};if(_0x45a1e7[_0x0a9e('0x21')](_0x33161b[_0x0a9e('0x16')][_0x0a9e('0x6')])){return pm2[_0x45a1e7[_0x33161b[_0x0a9e('0x16')][_0x0a9e('0x6')]]](_0x33161b[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](respondWithResult(_0x526cf3,0xc8))['catch'](handleError(_0x526cf3,null));}else{return _0x526cf3[_0x0a9e('0x6')](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x22')});}};exports[_0x0a9e('0x23')]=function(_0x5c877d,_0x15b200){if(_0x5c877d[_0x0a9e('0x16')]['id']){delete _0x5c877d[_0x0a9e('0x16')]['id'];}if(_0x5c877d[_0x0a9e('0x14')]['id']){return pm2[_0x0a9e('0x24')](_0x5c877d[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](function(_0x2e8759){pm2[_0x0a9e('0x1d')]();return _0x2e8759[0x0];})['then'](respondWithResult(_0x15b200,null))[_0x0a9e('0x12')](handleError(_0x15b200,null));}else{return _0x15b200['status'](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index d8e25ee..3cbaba4 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 _0x101e=['getAgents','/queues','isAuthenticated','getQueues','express','../../components/auth/service','./realtime.controller','get','/agents'];(function(_0x3d491f,_0x6d9bcd){var _0x130f27=function(_0x4f5b8d){while(--_0x4f5b8d){_0x3d491f['push'](_0x3d491f['shift']());}};_0x130f27(++_0x6d9bcd);}(_0x101e,0x67));var _0xe101=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x101e[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require(_0xe101('0x0'));var router=express['Router']();var auth=require(_0xe101('0x1'));var controller=require(_0xe101('0x2'));router[_0xe101('0x3')](_0xe101('0x4'),auth['isAuthenticated'](),controller[_0xe101('0x5')]);router[_0xe101('0x3')](_0xe101('0x6'),auth[_0xe101('0x7')](),controller[_0xe101('0x8')]);module['exports']=router; \ No newline at end of file +var _0x92f0=['express','../../components/auth/service','./realtime.controller','get','isAuthenticated','getQueues','exports'];(function(_0x4aa7cd,_0x2bd0fe){var _0x21fe4f=function(_0x5a5ca9){while(--_0x5a5ca9){_0x4aa7cd['push'](_0x4aa7cd['shift']());}};_0x21fe4f(++_0x2bd0fe);}(_0x92f0,0x181));var _0x092f=function(_0x3af6d3,_0xd6ff2e){_0x3af6d3=_0x3af6d3-0x0;var _0xf0c5a8=_0x92f0[_0x3af6d3];return _0xf0c5a8;};'use strict';var express=require(_0x092f('0x0'));var router=express['Router']();var auth=require(_0x092f('0x1'));var controller=require(_0x092f('0x2'));router[_0x092f('0x3')]('/agents',auth[_0x092f('0x4')](),controller['getAgents']);router[_0x092f('0x3')]('/queues',auth[_0x092f('0x4')](),controller[_0x092f('0x5')]);module[_0x092f('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 83a7830..f5a1c45 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 _0x032e=['getAgentIdsByStatus','map','User','rawAttributes','type','key','role','agent','online','getOptions','raw','push','literal','forEach','where','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','rows','find','filterAgentAttributes','pause','Pause','sortAgentsByStatus','split','pick','catch','getQueues','startCase','Queue','fieldName','voice','outbound','dialActive','dialMethod','QueueCampaigns','Queues','name','filter','getRealtimeQueues','initializeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','then','getRealtimeAgents','getSortedAgentsIdsByStatus'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x032e,0x124));var _0xe032=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x032e[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var rta=require(_0xe032('0x1'));var rtq=require(_0xe032('0x2'));var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var db=require(_0xe032('0x3'))['db'];var APIBadRequestError=require(_0xe032('0x4'))[_0xe032('0x5')];var APIHandleError=require(_0xe032('0x4'))[_0xe032('0x6')];function respondWithFilteredResult(_0x420020,_0x2ba8a0){return function(_0x33ad0b){if(_0x33ad0b){var _0x37432f=typeof _0x2ba8a0[_0xe032('0x7')]===_0xe032('0x8')&&typeof _0x2ba8a0[_0xe032('0x9')]===_0xe032('0x8');var _0x3b0ef8=_0x33ad0b[_0xe032('0xa')];var _0x2d8a14=_0x37432f?0x0:_0x2ba8a0[_0xe032('0x7')];var _0x167bd9=_0x37432f?_0x33ad0b['count']:_0x2ba8a0[_0xe032('0x7')]+_0x2ba8a0[_0xe032('0x9')];var _0x13c126;if(_0x167bd9>=_0x3b0ef8){_0x167bd9=_0x3b0ef8;_0x13c126=0xc8;}else{_0x13c126=0xce;}_0x420020[_0xe032('0xb')](_0x13c126);return _0x420020[_0xe032('0xc')](_0xe032('0xd'),_0x2d8a14+'-'+_0x167bd9+'/'+_0x3b0ef8)[_0xe032('0xe')](_0x33ad0b);}return null;};}exports['getAgents']=function(_0x646979,_0x266d71){var _0x28c2b6={'count':0x0,'rows':[]};var _0x1a53ab={};var _0x4aee44;var _0x311592=utils[_0xe032('0xf')]();var _0x176547;var _0x422e96;var _0x17b3aa=_0x646979[_0xe032('0x10')][_0xe032('0x11')];var _0x4da5b7=_0x646979[_0xe032('0x10')][_0xe032('0x12')];var _0x36fb7c=_0x646979[_0xe032('0x10')][_0xe032('0x13')];var _0x208b00=_0x4da5b7==='pause'||_0x4da5b7===_0xe032('0x14')?!![]:![];var _0x25cedb=[];var _0x1f9298;var _0x41d2a5;Promise[_0xe032('0x15')]()['then'](function(){if(_0x646979['query']['channel']){if(!utils[_0xe032('0x16')](_0x646979['query'][_0xe032('0x17')])){throw new APIBadRequestError(util[_0xe032('0x18')](_0xe032('0x19'),_0x646979[_0xe032('0x10')][_0xe032('0x17')]));}_0x4aee44=_0x646979[_0xe032('0x10')][_0xe032('0x17')]['toLowerCase']();}if(!_0x646979[_0xe032('0x10')][_0xe032('0x1a')]||!_0x646979[_0xe032('0x10')][_0xe032('0x1a')][_0xe032('0x1b')](_0xe032('0x1c'))){_0x646979[_0xe032('0x10')][_0xe032('0x1a')]=rta['validateSortParameter'](_0x646979['query']['sort']);return;}var _0x4ef536=rta[_0xe032('0x1d')](_0x646979[_0xe032('0x10')][_0xe032('0x1a')]);_0x646979[_0xe032('0x10')][_0xe032('0x1a')]=_0x4ef536[_0xe032('0x1e')][_0xe032('0x1f')](',');_0x1f9298=_0x4ef536[_0xe032('0x20')];})[_0xe032('0x21')](function(){if(!_0x17b3aa){return[];}return rta['getAgentIdsByQueues'](_0x17b3aa,_0x4aee44);})[_0xe032('0x21')](function(_0x1af097){_0x25cedb=_0x1af097;return rta[_0xe032('0x22')]();})[_0xe032('0x21')](function(_0x5cc95d){_0x422e96=_0x5cc95d['rows'];if((!_0x4da5b7||_0x208b00)&&!_0x1f9298){return _0x25cedb;}if(_0x1f9298&&!_0x4da5b7){return rta[_0xe032('0x23')](_0x422e96,_0x25cedb,_0x1f9298);}else{return rta[_0xe032('0x24')](_0x422e96,_0x25cedb,_0x4da5b7);}})[_0xe032('0x21')](function(_0xae116e){_0x25cedb=_0xae116e;var _0x4e8b72=![];if(_0x25cedb['length']===0x0){if(_0x17b3aa||_0x4da5b7){_0x4e8b72=!![];}if(_0x208b00){_0x4e8b72=![];}}if(_0x4e8b72){return _0x28c2b6;}var _0x4fe00e=_[_0xe032('0x25')](db[_0xe032('0x26')][_0xe032('0x27')],function(_0x707b){return{'name':_0x707b['fieldName'],'type':_0x707b[_0xe032('0x28')][_0xe032('0x29')]};});_0x646979[_0xe032('0x10')][_0xe032('0x2a')]=_0xe032('0x2b');_0x646979['query'][_0xe032('0x2c')]=!![];_0x1a53ab=qs[_0xe032('0x2d')](_0x4fe00e,_0x646979);_0x1a53ab[_0xe032('0x2e')]=!![];var _0x2cc18c=[];if(_0x25cedb['length']>0x0){_0x2cc18c[_0xe032('0x2f')]({'id':{'$in':_0x25cedb}});if(_0x1f9298&&!_0x4da5b7){_0x41d2a5=[db['sequelize'][_0xe032('0x30')]('FIELD(id,'+_0x25cedb+')')];_0x1a53ab[_0xe032('0x20')]=_0x41d2a5;}}if(_0x208b00){_0x311592['forEach'](function(_0x2c1ec0){var _0x517df6=!![];if(_0x4da5b7===_0xe032('0x14')&&_0x4aee44!==_0x2c1ec0){_0x517df6=![];}_0x2cc18c[_0xe032('0x2f')]({[_0x2c1ec0+'Pause']:_0x517df6});});if(_0x36fb7c){_0x2cc18c[_0xe032('0x2f')]({'pauseType':_0x36fb7c});}}else if(_0x4da5b7){_0x311592[_0xe032('0x31')](function(_0x253558){_0x2cc18c[_0xe032('0x2f')]({[_0x253558+'Pause']:![]});});}_0x1a53ab[_0xe032('0x32')]=_['merge'](_0x1a53ab[_0xe032('0x32')],{'$and':_0x2cc18c});if(_0x646979[_0xe032('0x33')]['role']===_0xe032('0x33')){var _0x23b790={'params':{'id':_0x646979['user'][_0xe032('0x34')]},'query':{'section':_0xe032('0x35'),'role':_0xe032('0x2b'),'online':!![],'raw':!![],'ids':_0x25cedb,'customSorting':_0x41d2a5}};if(_0x208b00){_0x23b790[_0xe032('0x10')][_0xe032('0x36')]=_0x2cc18c;}_0x23b790[_0xe032('0x10')]=Object[_0xe032('0x37')](_0x23b790[_0xe032('0x10')],_0x646979[_0xe032('0x10')]);delete _0x23b790[_0xe032('0x10')]['id'];return db[_0xe032('0x38')][_0xe032('0x39')](_0x23b790);}return db[_0xe032('0x26')][_0xe032('0x3a')](_0x1a53ab);})[_0xe032('0x21')](function(_0x14ea1a){_0x28c2b6[_0xe032('0xa')]=_0x14ea1a['count'];_0x176547=_0x14ea1a[_0xe032('0x3b')];return _0x176547['map'](function(_0x3d02c1){var _0x2bcfb4=_[_0xe032('0x3c')](_0x422e96,['id',_0x3d02c1['id']]);if(_0x2bcfb4){var _0x119790=rta[_0xe032('0x3d')](_0x2bcfb4);_['merge'](_0x3d02c1,_0x119790);}_0x3d02c1[_0xe032('0x1c')]=rta['getAgentStatus'](_0x3d02c1);if(_0x3d02c1[_0xe032('0x1c')]['includes'](_0xe032('0x3e'))){_0x311592[_0xe032('0x31')](function(_0x2644a1){if(_0x3d02c1[_0x2644a1+_0xe032('0x3f')]){_0x3d02c1[_0x2644a1+'Status']=_0xe032('0x3e');}});}return _0x3d02c1;});})['then'](function(_0x2b9664){if(!_0x1f9298||_0x41d2a5){return _0x2b9664;}return rta[_0xe032('0x40')](_0x2b9664,_0x1f9298);})[_0xe032('0x21')](function(_0xe572b6){var _0x4b58eb=null;if(_0x646979['query'][_0xe032('0x1e')]){var _0x203021=_0x646979['query'][_0xe032('0x1e')][_0xe032('0x41')](',');_0x4b58eb=_0xe572b6[_0xe032('0x25')](function(_0x2cfedf){return _[_0xe032('0x42')](_0x2cfedf,_0x203021);});}_0x28c2b6['rows']=_0x4b58eb||_0xe572b6;return _0x28c2b6;})[_0xe032('0x21')](respondWithFilteredResult(_0x266d71,_0x1a53ab))[_0xe032('0x43')](APIHandleError(_0x266d71));};exports[_0xe032('0x44')]=function(_0x753009,_0x24b929){var _0x16d6aa={'count':0x0,'rows':[]};var _0x165f09={};var _0x318f86;var _0x5d21e6;var _0x535f34;Promise[_0xe032('0x15')]()['then'](function(){if(_0x753009[_0xe032('0x10')][_0xe032('0x17')]){if(!utils[_0xe032('0x16')](_0x753009[_0xe032('0x10')][_0xe032('0x17')])){throw new APIBadRequestError(util[_0xe032('0x18')](_0xe032('0x19'),_0x753009[_0xe032('0x10')][_0xe032('0x17')]));}_0x318f86=_0x753009['query'][_0xe032('0x17')]['toLowerCase']();}var _0x5378cb=_[_0xe032('0x45')](_0x318f86)+_0xe032('0x46');var _0x62bfc8=_[_0xe032('0x25')](db[_0x5378cb]['rawAttributes'],function(_0x3893bf){return{'name':_0x3893bf[_0xe032('0x47')],'type':_0x3893bf[_0xe032('0x28')][_0xe032('0x29')]};});if(!_0x753009[_0xe032('0x10')][_0xe032('0x1e')]){var _0x3774bc=['id','name'];if(_0x318f86===_0xe032('0x48')){_0x3774bc[_0xe032('0x2f')]('type');if(_0x753009[_0xe032('0x10')][_0xe032('0x28')]===_0xe032('0x49')){_0x3774bc[_0xe032('0x2f')]([_0xe032('0x4a'),_0xe032('0x4b')]);}}_0x753009[_0xe032('0x10')][_0xe032('0x1e')]=_0x3774bc[_0xe032('0x1f')](',');}_0x165f09=qs[_0xe032('0x2d')](_0x62bfc8,_0x753009);if(_0x753009[_0xe032('0x33')][_0xe032('0x2a')]===_0xe032('0x33')){var _0x2f8114={'params':{'id':_0x753009['user'][_0xe032('0x34')]},'query':{'section':_0x318f86==='voice'&&_0x753009[_0xe032('0x10')][_0xe032('0x28')]===_0xe032('0x49')?_0xe032('0x4c'):_[_0xe032('0x45')](_0x318f86)+_0xe032('0x4d'),'type':_0x753009[_0xe032('0x10')][_0xe032('0x28')],'nolimit':!![],'sort':_0xe032('0x4e'),'filter':_0x753009[_0xe032('0x10')][_0xe032('0x4f')]}};_0x2f8114['query']=Object[_0xe032('0x37')](_0x2f8114[_0xe032('0x10')],_0x753009['query']);delete _0x2f8114[_0xe032('0x10')]['id'];return db['UserProfile'][_0xe032('0x39')](_0x2f8114);}return db[_0x5378cb][_0xe032('0x3a')](_0x165f09);})[_0xe032('0x21')](function(_0x414243){_0x16d6aa[_0xe032('0xa')]=_0x414243['count'];_0x5d21e6=_0x414243[_0xe032('0x3b')];return rtq[_0xe032('0x50')](_0x753009,_0x318f86);})[_0xe032('0x21')](function(_0x21a32f){_0x535f34=_0x21a32f[_0xe032('0x3b')];return rtq[_0xe032('0x51')](_0x5d21e6,_0x535f34,_0x318f86,_0x753009[_0xe032('0x10')]['type']);})[_0xe032('0x21')](function(_0x19bbc1){_0x16d6aa[_0xe032('0x3b')]=_0x19bbc1;return _0x16d6aa;})[_0xe032('0x21')](respondWithFilteredResult(_0x24b929,_0x165f09))[_0xe032('0x43')](APIHandleError(_0x24b929));}; \ No newline at end of file +var _0xdc97=['util','../../components/realtime/agents','../../components/parsers/qs','../../mysqldb','../../errors/api','handleError','limit','undefined','count','offset','status','set','getChannels','globalQueueFilter','query','globalStatusFilter','pauseTypeFilter','pause','resolve','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','then','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','role','agent','online','getOptions','push','literal','FIELD(id,','order','forEach','*pause','Pause','where','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','User','findAndCountAll','map','find','filterAgentAttributes','merge','globalStatus','getAgentStatus','split','pick','catch','getQueues','startCase','Queue','type','key','name','voice','outbound','dialActive','dialMethod','join','Queues','getRealtimeQueues','initializeQueues','lodash'];(function(_0x39587d,_0x4857d5){var _0x22db5f=function(_0x23e58a){while(--_0x23e58a){_0x39587d['push'](_0x39587d['shift']());}};_0x22db5f(++_0x4857d5);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2f1a0e,_0x269e41){_0x2f1a0e=_0x2f1a0e-0x0;var _0x13e31a=_0xdc97[_0x2f1a0e];return _0x13e31a;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var rta=require(_0x7dc9('0x2'));var rtq=require('../../components/realtime/queues');var qs=require(_0x7dc9('0x3'));var utils=require('../../config/utils');var db=require(_0x7dc9('0x4'))['db'];var APIBadRequestError=require(_0x7dc9('0x5'))['APIBadRequestError'];var APIHandleError=require(_0x7dc9('0x5'))[_0x7dc9('0x6')];function respondWithFilteredResult(_0xb15a0b,_0x3ba3ca){return function(_0x589f02){if(_0x589f02){var _0x2636ef=typeof _0x3ba3ca['offset']==='undefined'&&typeof _0x3ba3ca[_0x7dc9('0x7')]===_0x7dc9('0x8');var _0x3318ea=_0x589f02[_0x7dc9('0x9')];var _0x3dd07e=_0x2636ef?0x0:_0x3ba3ca['offset'];var _0xb2fa2a=_0x2636ef?_0x589f02[_0x7dc9('0x9')]:_0x3ba3ca[_0x7dc9('0xa')]+_0x3ba3ca[_0x7dc9('0x7')];var _0x359c88;if(_0xb2fa2a>=_0x3318ea){_0xb2fa2a=_0x3318ea;_0x359c88=0xc8;}else{_0x359c88=0xce;}_0xb15a0b[_0x7dc9('0xb')](_0x359c88);return _0xb15a0b[_0x7dc9('0xc')]('Content-Range',_0x3dd07e+'-'+_0xb2fa2a+'/'+_0x3318ea)['json'](_0x589f02);}return null;};}exports['getAgents']=function(_0x599ef1,_0x94c75a){var _0x14e5db={'count':0x0,'rows':[]};var _0x5c6ca5={};var _0xbd06be;var _0x2f3acd=utils[_0x7dc9('0xd')]();var _0xf37bc7;var _0x31d43d;var _0x11af93=_0x599ef1['query'][_0x7dc9('0xe')];var _0x278191=_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x10')];var _0x11606f=_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x11')];var _0x389d36=_0x278191===_0x7dc9('0x12')||_0x278191==='*pause'?!![]:![];var _0x22577e=[];var _0x4afb47;var _0x1f5906;Promise[_0x7dc9('0x13')]()['then'](function(){if(_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x14')]){if(!utils[_0x7dc9('0x15')](_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x14')])){throw new APIBadRequestError(util[_0x7dc9('0x16')](_0x7dc9('0x17'),_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x14')]));}_0xbd06be=_0x599ef1[_0x7dc9('0xf')]['channel']['toLowerCase']();}if(!_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x18')]||!_0x599ef1['query'][_0x7dc9('0x18')][_0x7dc9('0x19')]('globalStatus')){_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x18')]=rta[_0x7dc9('0x1a')](_0x599ef1['query'][_0x7dc9('0x18')]);return;}var _0x1e3a8d=rta[_0x7dc9('0x1b')](_0x599ef1['query']['sort']);_0x599ef1['query'][_0x7dc9('0x18')]=_0x1e3a8d[_0x7dc9('0x1c')]['join'](',');_0x4afb47=_0x1e3a8d['order'];})[_0x7dc9('0x1d')](function(){if(!_0x11af93){return[];}return rta['getAgentIdsByQueues'](_0x11af93,_0xbd06be);})[_0x7dc9('0x1d')](function(_0x1c690b){_0x22577e=_0x1c690b;return rta[_0x7dc9('0x1e')]();})[_0x7dc9('0x1d')](function(_0xa2aaa9){_0x31d43d=_0xa2aaa9[_0x7dc9('0x1f')];if((!_0x278191||_0x389d36)&&!_0x4afb47){return _0x22577e;}if(_0x4afb47&&!_0x278191){return rta[_0x7dc9('0x20')](_0x31d43d,_0x22577e,_0x4afb47);}else{return rta[_0x7dc9('0x21')](_0x31d43d,_0x22577e,_0x278191);}})[_0x7dc9('0x1d')](function(_0x3c4379){_0x22577e=_0x3c4379;var _0x14083d=![];if(_0x22577e[_0x7dc9('0x22')]===0x0){if(_0x11af93||_0x278191){_0x14083d=!![];}if(_0x389d36){_0x14083d=![];}}if(_0x14083d){return _0x14e5db;}var _0x4bb716=_['map'](db['User']['rawAttributes'],function(_0x4a68f0){return{'name':_0x4a68f0['fieldName'],'type':_0x4a68f0['type']['key']};});_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x23')]=_0x7dc9('0x24');_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x25')]=!![];_0x5c6ca5=qs[_0x7dc9('0x26')](_0x4bb716,_0x599ef1);_0x5c6ca5['raw']=!![];var _0x5ce3e1=[];if(_0x22577e['length']>0x0){_0x5ce3e1[_0x7dc9('0x27')]({'id':{'$in':_0x22577e}});if(_0x4afb47&&!_0x278191){_0x1f5906=[db['sequelize'][_0x7dc9('0x28')](_0x7dc9('0x29')+_0x22577e+')')];_0x5c6ca5[_0x7dc9('0x2a')]=_0x1f5906;}}if(_0x389d36){_0x2f3acd[_0x7dc9('0x2b')](function(_0x109c66){var _0x165882=!![];if(_0x278191===_0x7dc9('0x2c')&&_0xbd06be!==_0x109c66){_0x165882=![];}_0x5ce3e1[_0x7dc9('0x27')]({[_0x109c66+'Pause']:_0x165882});});if(_0x11606f){_0x5ce3e1[_0x7dc9('0x27')]({'pauseType':_0x11606f});}}else if(_0x278191){_0x2f3acd['forEach'](function(_0x421e1a){_0x5ce3e1[_0x7dc9('0x27')]({[_0x421e1a+_0x7dc9('0x2d')]:![]});});}_0x5c6ca5[_0x7dc9('0x2e')]=_['merge'](_0x5c6ca5[_0x7dc9('0x2e')],{'$and':_0x5ce3e1});if(_0x599ef1['user'][_0x7dc9('0x23')]==='user'){var _0x590bed={'params':{'id':_0x599ef1[_0x7dc9('0x2f')][_0x7dc9('0x30')]},'query':{'section':_0x7dc9('0x31'),'role':_0x7dc9('0x24'),'online':!![],'raw':!![],'ids':_0x22577e,'customSorting':_0x1f5906}};if(_0x389d36){_0x590bed['query'][_0x7dc9('0x32')]=_0x5ce3e1;}_0x590bed[_0x7dc9('0xf')]=Object[_0x7dc9('0x33')](_0x590bed[_0x7dc9('0xf')],_0x599ef1[_0x7dc9('0xf')]);delete _0x590bed[_0x7dc9('0xf')]['id'];return db[_0x7dc9('0x34')][_0x7dc9('0x35')](_0x590bed);}return db[_0x7dc9('0x36')][_0x7dc9('0x37')](_0x5c6ca5);})[_0x7dc9('0x1d')](function(_0x3a8d80){_0x14e5db['count']=_0x3a8d80[_0x7dc9('0x9')];_0xf37bc7=_0x3a8d80[_0x7dc9('0x1f')];return _0xf37bc7[_0x7dc9('0x38')](function(_0xfd2612){var _0x4bcdce=_[_0x7dc9('0x39')](_0x31d43d,['id',_0xfd2612['id']]);if(_0x4bcdce){var _0x89db0e=rta[_0x7dc9('0x3a')](_0x4bcdce);_[_0x7dc9('0x3b')](_0xfd2612,_0x89db0e);}_0xfd2612[_0x7dc9('0x3c')]=rta[_0x7dc9('0x3d')](_0xfd2612);if(_0xfd2612['globalStatus']['includes'](_0x7dc9('0x12'))){_0x2f3acd[_0x7dc9('0x2b')](function(_0x495100){if(_0xfd2612[_0x495100+_0x7dc9('0x2d')]){_0xfd2612[_0x495100+'Status']=_0x7dc9('0x12');}});}return _0xfd2612;});})[_0x7dc9('0x1d')](function(_0x3bca9c){if(!_0x4afb47||_0x1f5906){return _0x3bca9c;}return rta['sortAgentsByStatus'](_0x3bca9c,_0x4afb47);})[_0x7dc9('0x1d')](function(_0x1df27f){var _0x1929b6=null;if(_0x599ef1[_0x7dc9('0xf')][_0x7dc9('0x1c')]){var _0x23499a=_0x599ef1[_0x7dc9('0xf')]['fields'][_0x7dc9('0x3e')](',');_0x1929b6=_0x1df27f['map'](function(_0x52d883){return _[_0x7dc9('0x3f')](_0x52d883,_0x23499a);});}_0x14e5db[_0x7dc9('0x1f')]=_0x1929b6||_0x1df27f;return _0x14e5db;})[_0x7dc9('0x1d')](respondWithFilteredResult(_0x94c75a,_0x5c6ca5))[_0x7dc9('0x40')](APIHandleError(_0x94c75a));};exports[_0x7dc9('0x41')]=function(_0x1bd3a7,_0x2ce57f){var _0x765fee={'count':0x0,'rows':[]};var _0x3b130f={};var _0x573b48;var _0x1c41ef;var _0x1971c7;Promise[_0x7dc9('0x13')]()[_0x7dc9('0x1d')](function(){if(_0x1bd3a7[_0x7dc9('0xf')][_0x7dc9('0x14')]){if(!utils['isValidChannel'](_0x1bd3a7[_0x7dc9('0xf')][_0x7dc9('0x14')])){throw new APIBadRequestError(util['format'](_0x7dc9('0x17'),_0x1bd3a7[_0x7dc9('0xf')][_0x7dc9('0x14')]));}_0x573b48=_0x1bd3a7['query'][_0x7dc9('0x14')]['toLowerCase']();}var _0x55826d=_[_0x7dc9('0x42')](_0x573b48)+_0x7dc9('0x43');var _0x36d591=_['map'](db[_0x55826d]['rawAttributes'],function(_0x415ebd){return{'name':_0x415ebd['fieldName'],'type':_0x415ebd[_0x7dc9('0x44')][_0x7dc9('0x45')]};});if(!_0x1bd3a7['query'][_0x7dc9('0x1c')]){var _0x1d6c0a=['id',_0x7dc9('0x46')];if(_0x573b48===_0x7dc9('0x47')){_0x1d6c0a[_0x7dc9('0x27')](_0x7dc9('0x44'));if(_0x1bd3a7[_0x7dc9('0xf')][_0x7dc9('0x44')]===_0x7dc9('0x48')){_0x1d6c0a[_0x7dc9('0x27')]([_0x7dc9('0x49'),_0x7dc9('0x4a')]);}}_0x1bd3a7[_0x7dc9('0xf')]['fields']=_0x1d6c0a[_0x7dc9('0x4b')](',');}_0x3b130f=qs['getOptions'](_0x36d591,_0x1bd3a7);if(_0x1bd3a7['user'][_0x7dc9('0x23')]===_0x7dc9('0x2f')){var _0x40e382={'params':{'id':_0x1bd3a7[_0x7dc9('0x2f')][_0x7dc9('0x30')]},'query':{'section':_0x573b48==='voice'&&_0x1bd3a7[_0x7dc9('0xf')][_0x7dc9('0x44')]===_0x7dc9('0x48')?'QueueCampaigns':_[_0x7dc9('0x42')](_0x573b48)+_0x7dc9('0x4c'),'type':_0x1bd3a7[_0x7dc9('0xf')][_0x7dc9('0x44')],'nolimit':!![],'sort':_0x7dc9('0x46'),'filter':_0x1bd3a7[_0x7dc9('0xf')]['filter']}};_0x40e382[_0x7dc9('0xf')]=Object[_0x7dc9('0x33')](_0x40e382[_0x7dc9('0xf')],_0x1bd3a7[_0x7dc9('0xf')]);delete _0x40e382[_0x7dc9('0xf')]['id'];return db[_0x7dc9('0x34')][_0x7dc9('0x35')](_0x40e382);}return db[_0x55826d][_0x7dc9('0x37')](_0x3b130f);})[_0x7dc9('0x1d')](function(_0x1de02f){_0x765fee[_0x7dc9('0x9')]=_0x1de02f[_0x7dc9('0x9')];_0x1c41ef=_0x1de02f['rows'];return rtq[_0x7dc9('0x4d')](_0x1bd3a7,_0x573b48);})[_0x7dc9('0x1d')](function(_0x38df9a){_0x1971c7=_0x38df9a[_0x7dc9('0x1f')];return rtq[_0x7dc9('0x4e')](_0x1c41ef,_0x1971c7,_0x573b48,_0x1bd3a7['query'][_0x7dc9('0x44')]);})[_0x7dc9('0x1d')](function(_0x2c1452){_0x765fee[_0x7dc9('0x1f')]=_0x2c1452;return _0x765fee;})[_0x7dc9('0x1d')](respondWithFilteredResult(_0x2ce57f,_0x3b130f))[_0x7dc9('0x40')](APIHandleError(_0x2ce57f));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index f55f9f1..204886a 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x59726f,_0x12ca2b){var _0x261676=function(_0x48bc57){while(--_0x48bc57){_0x59726f['push'](_0x59726f['shift']());}};_0x261676(++_0x12ca2b);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xf0f7ba,_0x48be70){var _0x44382c=function(_0x5b746c){while(--_0x5b746c){_0xf0f7ba['push'](_0xf0f7ba['shift']());}};_0x44382c(++_0x48be70);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 719742c..e65498f 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 _0x9f5a=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x4f4ec8,_0x81f07a){var _0x2dfa52=function(_0x4f0a59){while(--_0x4f0a59){_0x4f4ec8['push'](_0x4f4ec8['shift']());}};_0x2dfa52(++_0x81f07a);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x9ead56,_0x1d4312){_0x9ead56=_0x9ead56-0x0;var _0x3abf2e=_0x9f5a[_0x9ead56];return _0x3abf2e;};'use strict';var Sequelize=require(_0xa9f5('0x0'));module[_0xa9f5('0x1')]={'state':{'type':Sequelize[_0xa9f5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa9f5('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xa9f5('0x3')]},'starttime':{'type':Sequelize[_0xa9f5('0x4')]},'responsetime':{'type':Sequelize[_0xa9f5('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa9f5('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa9f5('0x3')]}}; \ No newline at end of file +var _0xbe2c=['exports','STRING','DATE','INTEGER','sequelize'];(function(_0x3a7e45,_0x1b1eb3){var _0x278476=function(_0x3f13c9){while(--_0x3f13c9){_0x3a7e45['push'](_0x3a7e45['shift']());}};_0x278476(++_0x1b1eb3);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x219bb5,_0x451238){_0x219bb5=_0x219bb5-0x0;var _0x43e822=_0xbe2c[_0x219bb5];return _0x43e822;};'use strict';var Sequelize=require(_0xcbe2('0x0'));module[_0xcbe2('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xcbe2('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xcbe2('0x2')]},'starttime':{'type':Sequelize[_0xcbe2('0x3')]},'responsetime':{'type':Sequelize[_0xcbe2('0x3')]},'ringtime':{'type':Sequelize[_0xcbe2('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xcbe2('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xcbe2('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 3bee78a..a335d7d 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 _0xef9d=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','moment','bluebird'];(function(_0x46f367,_0x259719){var _0x420802=function(_0x6fe8de){while(--_0x6fe8de){_0x46f367['push'](_0x46f367['shift']());}};_0x420802(++_0x259719);}(_0xef9d,0x171));var _0xdef9=function(_0x5ab85a,_0x43275e){_0x5ab85a=_0x5ab85a-0x0;var _0x400d41=_0xef9d[_0x5ab85a];return _0x400d41;};'use strict';var _=require('lodash');var util=require(_0xdef9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdef9('0x1'));var BPromise=require(_0xdef9('0x2'));var rp=require(_0xdef9('0x3'));var fs=require('fs');var path=require(_0xdef9('0x4'));var rimraf=require(_0xdef9('0x5'));var config=require(_0xdef9('0x6'));var attributes=require(_0xdef9('0x7'));module[_0xdef9('0x8')]=function(_0x23e09d,_0x43fc0f){return _0x23e09d[_0xdef9('0x9')](_0xdef9('0xa'),attributes,{'tableName':_0xdef9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7629=['exports','define','ReportAgentPreview','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x5e1fd0,_0x394cf9){var _0x2ad6cf=function(_0x1641c){while(--_0x1641c){_0x5e1fd0['push'](_0x5e1fd0['shift']());}};_0x2ad6cf(++_0x394cf9);}(_0x7629,0xb9));var _0x9762=function(_0x475bd7,_0x2da876){_0x475bd7=_0x475bd7-0x0;var _0xe57553=_0x7629[_0x475bd7];return _0xe57553;};'use strict';var _=require('lodash');var util=require(_0x9762('0x0'));var logger=require(_0x9762('0x1'))(_0x9762('0x2'));var moment=require(_0x9762('0x3'));var BPromise=require(_0x9762('0x4'));var rp=require(_0x9762('0x5'));var fs=require('fs');var path=require(_0x9762('0x6'));var rimraf=require(_0x9762('0x7'));var config=require(_0x9762('0x8'));var attributes=require(_0x9762('0x9'));module[_0x9762('0xa')]=function(_0x5cba8d,_0x130213){return _0x5cba8d[_0x9762('0xb')](_0x9762('0xc'),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 ce41934..9064956 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 _0x1bfb=['../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x41ecb7,_0x4cbadc){var _0x22c983=function(_0x9ce3de){while(--_0x9ce3de){_0x41ecb7['push'](_0x41ecb7['shift']());}};_0x22c983(++_0x4cbadc);}(_0x1bfb,0x190));var _0xb1bf=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x1bfb[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0xb1bf('0x0'));var util=require(_0xb1bf('0x1'));var moment=require(_0xb1bf('0x2'));var BPromise=require(_0xb1bf('0x3'));var rs=require(_0xb1bf('0x4'));var fs=require('fs');var Redis=require(_0xb1bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb1bf('0x6'));var logger=require(_0xb1bf('0x7'))(_0xb1bf('0x8'));var config=require('../../config/environment');var jayson=require(_0xb1bf('0x9'));var client=jayson['client'][_0xb1bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x377b04,_0x2df49a,_0x46eae){return new BPromise(function(_0x4b5195,_0x1af548){return client['request'](_0x377b04,_0x46eae)[_0xb1bf('0xb')](function(_0x723470){logger[_0xb1bf('0xc')](_0xb1bf('0xd'),_0x2df49a,_0xb1bf('0xe'));logger[_0xb1bf('0xf')](_0xb1bf('0x10'),_0x2df49a,_0xb1bf('0xe'),JSON[_0xb1bf('0x11')](_0x723470));if(_0x723470[_0xb1bf('0x12')]){if(_0x723470[_0xb1bf('0x12')][_0xb1bf('0x13')]===0x1f4){logger[_0xb1bf('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x2df49a,_0x723470[_0xb1bf('0x12')]['message']);return _0x1af548(_0x723470['error'][_0xb1bf('0x14')]);}logger[_0xb1bf('0x12')](_0xb1bf('0xd'),_0x2df49a,_0x723470['error'][_0xb1bf('0x14')]);return _0x4b5195(_0x723470[_0xb1bf('0x12')][_0xb1bf('0x14')]);}else{logger[_0xb1bf('0xc')](_0xb1bf('0xd'),_0x2df49a,'request\x20sent');_0x4b5195(_0x723470[_0xb1bf('0x15')][_0xb1bf('0x14')]);}})['catch'](function(_0x3ff36f){logger[_0xb1bf('0x12')](_0xb1bf('0xd'),_0x2df49a,_0x3ff36f);_0x1af548(_0x3ff36f);});});}exports[_0xb1bf('0x16')]=function(_0x26f041){var _0x23c059=this;return new Promise(function(_0x2bfe2c,_0x3e8bc3){return db[_0xb1bf('0x17')][_0xb1bf('0x18')](_0x26f041[_0xb1bf('0x19')],{'raw':_0x26f041['options']?_0x26f041[_0xb1bf('0x1a')][_0xb1bf('0x1b')]===undefined?!![]:![]:!![]})[_0xb1bf('0xb')](function(_0x4d43a1){logger[_0xb1bf('0xc')](_0xb1bf('0x16'),_0x26f041);logger[_0xb1bf('0xf')](_0xb1bf('0x16'),_0x26f041,JSON[_0xb1bf('0x11')](_0x4d43a1));_0x2bfe2c(_0x4d43a1);})[_0xb1bf('0x1c')](function(_0x58c7ed){logger[_0xb1bf('0x12')]('CreateReportAgentPreview',_0x58c7ed[_0xb1bf('0x14')],_0x26f041);_0x3e8bc3(_0x23c059[_0xb1bf('0x12')](0x1f4,_0x58c7ed[_0xb1bf('0x14')]));});});}; \ No newline at end of file +var _0xc280=['request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xc280,0x7e));var _0x0c28=function(_0x36f596,_0x1a8d7b){_0x36f596=_0x36f596-0x0;var _0x524378=_0xc280[_0x36f596];return _0x524378;};'use strict';var _=require(_0x0c28('0x0'));var util=require(_0x0c28('0x1'));var moment=require(_0x0c28('0x2'));var BPromise=require(_0x0c28('0x3'));var rs=require(_0x0c28('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c28('0x5'))['db'];var utils=require(_0x0c28('0x6'));var logger=require('../../config/logger')(_0x0c28('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c28('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5892fa,_0x2cd880,_0x74a378){return new BPromise(function(_0x210a0f,_0x3c9788){return client[_0x0c28('0x9')](_0x5892fa,_0x74a378)[_0x0c28('0xa')](function(_0x2690b0){logger[_0x0c28('0xb')](_0x0c28('0xc'),_0x2cd880,_0x0c28('0xd'));logger[_0x0c28('0xe')](_0x0c28('0xf'),_0x2cd880,_0x0c28('0xd'),JSON['stringify'](_0x2690b0));if(_0x2690b0[_0x0c28('0x10')]){if(_0x2690b0[_0x0c28('0x10')][_0x0c28('0x11')]===0x1f4){logger[_0x0c28('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x2cd880,_0x2690b0['error'][_0x0c28('0x12')]);return _0x3c9788(_0x2690b0[_0x0c28('0x10')][_0x0c28('0x12')]);}logger[_0x0c28('0x10')](_0x0c28('0xc'),_0x2cd880,_0x2690b0['error']['message']);return _0x210a0f(_0x2690b0[_0x0c28('0x10')]['message']);}else{logger[_0x0c28('0xb')](_0x0c28('0xc'),_0x2cd880,'request\x20sent');_0x210a0f(_0x2690b0[_0x0c28('0x13')]['message']);}})[_0x0c28('0x14')](function(_0x177e8f){logger[_0x0c28('0x10')](_0x0c28('0xc'),_0x2cd880,_0x177e8f);_0x3c9788(_0x177e8f);});});}exports[_0x0c28('0x15')]=function(_0x19ccde){var _0x18b4d8=this;return new Promise(function(_0xc691c0,_0x2bc61e){return db[_0x0c28('0x16')][_0x0c28('0x17')](_0x19ccde[_0x0c28('0x18')],{'raw':_0x19ccde['options']?_0x19ccde[_0x0c28('0x19')][_0x0c28('0x1a')]===undefined?!![]:![]:!![]})[_0x0c28('0xa')](function(_0x2b224b){logger[_0x0c28('0xb')](_0x0c28('0x15'),_0x19ccde);logger[_0x0c28('0xe')](_0x0c28('0x15'),_0x19ccde,JSON['stringify'](_0x2b224b));_0xc691c0(_0x2b224b);})['catch'](function(_0x270be0){logger['error'](_0x0c28('0x15'),_0x270be0['message'],_0x19ccde);_0x2bc61e(_0x18b4d8['error'](0x1f4,_0x270be0[_0x0c28('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index f364a31..329da3e 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 _0x75f2=['/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','agentNotify','exports','multer','util','path','express','Router','get'];(function(_0x202b05,_0x5a246c){var _0x22a0a7=function(_0x5157f2){while(--_0x5157f2){_0x202b05['push'](_0x202b05['shift']());}};_0x22a0a7(++_0x5a246c);}(_0x75f2,0x19e));var _0x275f=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x75f2[_0x36f243];return _0x426436;};'use strict';var multer=require(_0x275f('0x0'));var util=require(_0x275f('0x1'));var path=require(_0x275f('0x2'));var express=require(_0x275f('0x3'));var router=express[_0x275f('0x4')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x275f('0x5')](_0x275f('0x6'),auth[_0x275f('0x7')](),controller[_0x275f('0x8')]);router[_0x275f('0x5')](_0x275f('0x9'),auth[_0x275f('0x7')](),controller[_0x275f('0xa')]);router[_0x275f('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x275f('0x7')](),controller[_0x275f('0xb')]);router[_0x275f('0x5')](_0x275f('0xc'),auth[_0x275f('0x7')](),controller[_0x275f('0xd')]);router[_0x275f('0x5')](_0x275f('0xe'),auth[_0x275f('0x7')](),controller['chatQueues']);router[_0x275f('0x5')](_0x275f('0xf'),auth[_0x275f('0x7')](),controller[_0x275f('0x10')]);router[_0x275f('0x5')](_0x275f('0x11'),auth[_0x275f('0x7')](),controller[_0x275f('0x12')]);router[_0x275f('0x5')](_0x275f('0x13'),auth[_0x275f('0x7')](),controller['openchannelQueues']);router['get']('/sms/queues',auth[_0x275f('0x7')](),controller[_0x275f('0x14')]);router[_0x275f('0x5')](_0x275f('0x15'),auth[_0x275f('0x7')](),controller[_0x275f('0x16')]);router[_0x275f('0x5')](_0x275f('0x17'),auth[_0x275f('0x7')](),controller[_0x275f('0x18')]);router[_0x275f('0x5')](_0x275f('0x19'),auth[_0x275f('0x7')](),controller[_0x275f('0x1a')]);router['get'](_0x275f('0x1b'),auth[_0x275f('0x7')](),controller['voiceQueuesChannels']);router['get'](_0x275f('0x1c'),auth[_0x275f('0x7')](),controller['voiceQueuesChannel']);router[_0x275f('0x5')](_0x275f('0x1d'),auth[_0x275f('0x7')](),controller['voiceQueuesChannelHangup']);router['get'](_0x275f('0x1e'),auth[_0x275f('0x7')](),controller[_0x275f('0x1f')]);router[_0x275f('0x5')](_0x275f('0x20'),auth[_0x275f('0x7')](),controller[_0x275f('0x21')]);router[_0x275f('0x22')](_0x275f('0x20'),auth[_0x275f('0x7')](),controller[_0x275f('0x23')]);router[_0x275f('0x5')](_0x275f('0x24'),auth[_0x275f('0x7')](),controller[_0x275f('0x25')]);router['get']('/outbound/channels',auth[_0x275f('0x7')](),controller[_0x275f('0x26')]);router[_0x275f('0x5')](_0x275f('0x27'),auth[_0x275f('0x7')](),controller[_0x275f('0x28')]);router['put'](_0x275f('0x29'),auth[_0x275f('0x7')](),controller[_0x275f('0x2a')]);router[_0x275f('0x5')](_0x275f('0x2b'),auth[_0x275f('0x7')](),controller['telephones']);router[_0x275f('0x5')]('/trunks',auth[_0x275f('0x7')](),controller[_0x275f('0x2c')]);router['get'](_0x275f('0x2d'),auth['isAuthenticated'](),controller[_0x275f('0x2e')]);router[_0x275f('0x5')](_0x275f('0x2f'),auth[_0x275f('0x7')](),controller[_0x275f('0x30')]);router[_0x275f('0x5')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x275f('0x31')]);router[_0x275f('0x5')](_0x275f('0x32'),auth['isAuthenticated'](),controller[_0x275f('0x33')]);router[_0x275f('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x275f('0x7')](),controller[_0x275f('0x34')]);router[_0x275f('0x5')](_0x275f('0x35'),auth['isAuthenticated'](),controller[_0x275f('0x36')]);router[_0x275f('0x5')](_0x275f('0x37'),auth[_0x275f('0x7')](),controller[_0x275f('0x38')]);router[_0x275f('0x5')](_0x275f('0x39'),auth['isAuthenticated'](),controller[_0x275f('0x3a')]);router[_0x275f('0x5')](_0x275f('0x3b'),auth[_0x275f('0x7')](),controller[_0x275f('0x3c')]);router[_0x275f('0x3d')](_0x275f('0x3e'),auth[_0x275f('0x7')](),controller[_0x275f('0x3f')](_0x275f('0x40')));router['get'](_0x275f('0x41'),auth['isAuthenticated'](),controller[_0x275f('0x42')]);router[_0x275f('0x3d')](_0x275f('0x43'),auth['isAuthenticated'](),controller[_0x275f('0x3f')]('chat'));router[_0x275f('0x5')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x275f('0x44')]);router[_0x275f('0x3d')](_0x275f('0x45'),auth[_0x275f('0x7')](),controller['queueNotify'](_0x275f('0x46')));router[_0x275f('0x5')](_0x275f('0x47'),auth['isAuthenticated'](),controller[_0x275f('0x48')]);router[_0x275f('0x3d')](_0x275f('0x49'),auth['isAuthenticated'](),controller[_0x275f('0x3f')](_0x275f('0x4a')));router[_0x275f('0x5')](_0x275f('0x4b'),auth[_0x275f('0x7')](),controller['showOpenchannelQueues']);router['post'](_0x275f('0x4c'),auth[_0x275f('0x7')](),controller[_0x275f('0x3f')](_0x275f('0x4d')));router[_0x275f('0x3d')](_0x275f('0x4e'),auth['isAuthenticated'](),controller[_0x275f('0x3f')](_0x275f('0x4f')));router[_0x275f('0x5')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x275f('0x50')]);router[_0x275f('0x5')](_0x275f('0x51'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x275f('0x3d')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x275f('0x52')]);module[_0x275f('0x53')]=router; \ No newline at end of file +var _0xa841=['/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id','showMailQueues','post','queueNotify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues'];(function(_0x1e1a40,_0x120381){var _0x233c8e=function(_0x134c29){while(--_0x134c29){_0x1e1a40['push'](_0x1e1a40['shift']());}};_0x233c8e(++_0x120381);}(_0xa841,0x181));var _0x1a84=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xa841[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x1a84('0x0'));var util=require(_0x1a84('0x1'));var path=require(_0x1a84('0x2'));var express=require(_0x1a84('0x3'));var router=express[_0x1a84('0x4')]();var auth=require(_0x1a84('0x5'));var controller=require(_0x1a84('0x6'));router[_0x1a84('0x7')](_0x1a84('0x8'),auth[_0x1a84('0x9')](),controller['voiceChannels']);router[_0x1a84('0x7')](_0x1a84('0xa'),auth[_0x1a84('0x9')](),controller[_0x1a84('0xb')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x1a84('0x9')](),controller[_0x1a84('0xc')]);router[_0x1a84('0x7')](_0x1a84('0xd'),auth['isAuthenticated'](),controller[_0x1a84('0xe')]);router['get'](_0x1a84('0xf'),auth['isAuthenticated'](),controller['chatQueues']);router[_0x1a84('0x7')](_0x1a84('0x10'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x11')]);router[_0x1a84('0x7')]('/mail/accounts',auth[_0x1a84('0x9')](),controller[_0x1a84('0x12')]);router[_0x1a84('0x7')](_0x1a84('0x13'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x14')]);router[_0x1a84('0x7')](_0x1a84('0x15'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x16')]);router[_0x1a84('0x7')]('/whatsapp/queues',auth[_0x1a84('0x9')](),controller[_0x1a84('0x17')]);router['get'](_0x1a84('0x18'),auth[_0x1a84('0x9')](),controller['faxQueues']);router[_0x1a84('0x7')](_0x1a84('0x19'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x1a')]);router['get'](_0x1a84('0x1b'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x1c')]);router[_0x1a84('0x7')]('/voice/queues/channels/:uniqueid',auth[_0x1a84('0x9')](),controller[_0x1a84('0x1d')]);router[_0x1a84('0x7')](_0x1a84('0x1e'),auth[_0x1a84('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x1a84('0x7')](_0x1a84('0x1f'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x20')]);router[_0x1a84('0x7')](_0x1a84('0x21'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x22')]);router[_0x1a84('0x23')](_0x1a84('0x21'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x24')]);router['get'](_0x1a84('0x25'),auth['isAuthenticated'](),controller[_0x1a84('0x26')]);router[_0x1a84('0x7')](_0x1a84('0x27'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0x1a84('0x7')](_0x1a84('0x28'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x29')]);router[_0x1a84('0x23')](_0x1a84('0x2a'),auth[_0x1a84('0x9')](),controller['agentCapacity']);router[_0x1a84('0x7')](_0x1a84('0x2b'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x2c')]);router['get'](_0x1a84('0x2d'),auth['isAuthenticated'](),controller[_0x1a84('0x2e')]);router[_0x1a84('0x7')](_0x1a84('0x2f'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x30')]);router[_0x1a84('0x7')](_0x1a84('0x31'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x32')]);router[_0x1a84('0x7')](_0x1a84('0x33'),auth[_0x1a84('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0x1a84('0x7')](_0x1a84('0x34'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x35')]);router[_0x1a84('0x7')](_0x1a84('0x36'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x37')]);router[_0x1a84('0x7')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x1a84('0x7')]('/sms/queues/waitinginteractions',auth[_0x1a84('0x9')](),controller[_0x1a84('0x38')]);router[_0x1a84('0x7')](_0x1a84('0x39'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x3a')]);router['get'](_0x1a84('0x3b'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x3c')]);router['post']('/mail/queues/:id/notify',auth[_0x1a84('0x9')](),controller['queueNotify']('mail'));router[_0x1a84('0x7')](_0x1a84('0x3d'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x3e')]);router[_0x1a84('0x3f')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x1a84('0x40')]('chat'));router[_0x1a84('0x7')](_0x1a84('0x41'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x42')]);router[_0x1a84('0x3f')](_0x1a84('0x43'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x40')](_0x1a84('0x44')));router['get'](_0x1a84('0x45'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x46')]);router[_0x1a84('0x3f')](_0x1a84('0x47'),auth['isAuthenticated'](),controller[_0x1a84('0x40')](_0x1a84('0x48')));router[_0x1a84('0x7')](_0x1a84('0x49'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x4a')]);router[_0x1a84('0x3f')](_0x1a84('0x4b'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x40')](_0x1a84('0x4c')));router['post']('/whatsapp/queues/:id/notify',auth[_0x1a84('0x9')](),controller[_0x1a84('0x40')]('whatsapp'));router[_0x1a84('0x7')]('/sms/queues/:id',auth[_0x1a84('0x9')](),controller[_0x1a84('0x4d')]);router[_0x1a84('0x7')](_0x1a84('0x4e'),auth[_0x1a84('0x9')](),controller[_0x1a84('0x4f')]);router[_0x1a84('0x3f')]('/agents/:id/notify',auth[_0x1a84('0x9')](),controller[_0x1a84('0x50')]);module[_0x1a84('0x51')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index f3c163a..eab2167 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 _0x5437=['code','message','error','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','then','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','MessageId','InteractionId','agent','agentTransferTimeout','bluebird','moment','lodash','util','api','jayson/promise','client','http','request'];(function(_0x327cbf,_0x114362){var _0x409cb8=function(_0x34f0a1){while(--_0x34f0a1){_0x327cbf['push'](_0x327cbf['shift']());}};_0x409cb8(++_0x114362);}(_0x5437,0x7d));var _0x7543=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x5437[_0x1fcaf1];return _0x55f464;};'use strict';var BPromise=require(_0x7543('0x0'));var moment=require(_0x7543('0x1'));var _=require(_0x7543('0x2'));var util=require(_0x7543('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x7543('0x4'));var jayson=require(_0x7543('0x5'));var amiClient=jayson[_0x7543('0x6')][_0x7543('0x7')]({'port':0x232a});var mailClient=jayson[_0x7543('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x7543('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x57a4ab,_0x56bd89,_0x4319cb){return new BPromise(function(_0x496438,_0x1f8124){var _0x5b1042=_0x4319cb?_0x4319cb:amiClient;return _0x5b1042[_0x7543('0x8')](_0x57a4ab,_0x56bd89)['then'](function(_0x5a52db){if(_0x5a52db['error']){if(_0x5a52db['error'][_0x7543('0x9')]===0x1f4){return _0x1f8124(_0x5a52db['error'][_0x7543('0xa')]);}return _0x496438(_0x5a52db[_0x7543('0xb')][_0x7543('0xa')]);}else{_0x496438(_0x5a52db[_0x7543('0xc')]);}})[_0x7543('0xd')](function(_0x399c06){_0x1f8124(_0x399c06);});});}function respondWithResult(_0x2a23ad,_0x304e46){_0x304e46=_0x304e46||0xc8;return function(_0x220da5){if(_0x220da5){return _0x2a23ad[_0x7543('0xe')](_0x304e46)[_0x7543('0xf')](_0x220da5);}return _0x2a23ad[_0x7543('0x10')](0x194);};}function handleError(_0x5374a1,_0x511c3d){_0x511c3d=_0x511c3d||0x1f4;return function(_0x2465ab){logger[_0x7543('0xb')](_0x2465ab[_0x7543('0x11')]);if(_0x2465ab[_0x7543('0x12')]){delete _0x2465ab[_0x7543('0x12')];}_0x5374a1[_0x7543('0xe')](_0x511c3d)[_0x7543('0x13')](_0x2465ab);};}function findById(_0xa61a9d){return function(_0x11aeb5){if(!_[_0x7543('0x14')](_0xa61a9d)&&!_[_0x7543('0x14')](_0x11aeb5)&&!_['isNil'](_0x11aeb5[_0x7543('0x15')])){return _[_0x7543('0x16')](_0x11aeb5['rows'],function(_0x36b454){return _0x36b454['id']==_0xa61a9d;});}return null;};}exports[_0x7543('0x17')]=function(_0x34b632,_0xe15a51){return respondWithRpcPromise(_0x7543('0x18'),_0x34b632['query'])[_0x7543('0x19')](respondWithResult(_0xe15a51,null))[_0x7543('0xd')](handleError(_0xe15a51,null));};exports['voiceChannelMixMonitor']=function(_0x19f2de,_0x43a7e7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x7543('0x1a')](_0x19f2de[_0x7543('0x1b')],_0x19f2de[_0x7543('0x1c')]))[_0x7543('0x19')](respondWithResult(_0x43a7e7,null))[_0x7543('0xd')](handleError(_0x43a7e7,null));};exports[_0x7543('0x1d')]=function(_0xdf38a8,_0x36e558){return respondWithRpcPromise(_0x7543('0x1e'),_[_0x7543('0x1a')](_0xdf38a8[_0x7543('0x1b')],_0xdf38a8[_0x7543('0x1c')]))[_0x7543('0x19')](respondWithResult(_0x36e558,null))['catch'](handleError(_0x36e558,null));};exports[_0x7543('0x1f')]=function(_0x7b7ab5,_0x9270a7){return respondWithRpcPromise(_0x7543('0x20'),_0x7b7ab5[_0x7543('0x1b')])[_0x7543('0x19')](respondWithResult(_0x9270a7,null))[_0x7543('0xd')](handleError(_0x9270a7,null));};exports[_0x7543('0x21')]=function(_0x5201f9,_0x539a9b){return respondWithRpcPromise('VoiceQueues',_0x5201f9[_0x7543('0x1b')])[_0x7543('0x19')](findById(_0x5201f9[_0x7543('0x1c')]['id']))[_0x7543('0x19')](respondWithResult(_0x539a9b,null))['catch'](handleError(_0x539a9b,null));};exports['updateVoiceQueue']=function(_0x31a476,_0x4cf052){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x7543('0x1a')](_0x31a476[_0x7543('0x22')],_0x31a476[_0x7543('0x1c')]))[_0x7543('0x19')](respondWithResult(_0x4cf052,null))['catch'](handleError(_0x4cf052,null));};exports[_0x7543('0x23')]=function(_0x6a2235,_0x1d85d7){return respondWithRpcPromise(_0x7543('0x24'),_[_0x7543('0x1a')](_0x6a2235[_0x7543('0x1b')],_0x6a2235['params']))['then'](respondWithResult(_0x1d85d7,null))[_0x7543('0xd')](handleError(_0x1d85d7,null));};exports[_0x7543('0x25')]=function(_0x11f67f,_0xc47852){return respondWithRpcPromise(_0x7543('0x26'),_0x11f67f[_0x7543('0x1b')])[_0x7543('0x19')](respondWithResult(_0xc47852,null))['catch'](handleError(_0xc47852,null));};exports[_0x7543('0x27')]=function(_0x38daea,_0x301359){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x7543('0x1a')](_0x38daea[_0x7543('0x1b')],_0x38daea[_0x7543('0x1c')]))[_0x7543('0x19')](respondWithResult(_0x301359,null))['catch'](handleError(_0x301359,null));};exports[_0x7543('0x28')]=function(_0x62d4a7,_0x738a32){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x7543('0x1a')](_0x62d4a7['query'],_0x62d4a7[_0x7543('0x1c')]))['then'](respondWithResult(_0x738a32,null))['catch'](handleError(_0x738a32,null));};exports[_0x7543('0x29')]=function(_0xccfa08,_0xc28f66){return respondWithRpcPromise(_0x7543('0x2a'),_[_0x7543('0x1a')](_0xccfa08[_0x7543('0x1b')],_0xccfa08[_0x7543('0x1c')]))[_0x7543('0x19')](respondWithResult(_0xc28f66,null))[_0x7543('0xd')](handleError(_0xc28f66,null));};exports['outbound']=function(_0x35dd36,_0xdb7512){return respondWithRpcPromise(_0x7543('0x2b'),_0x35dd36[_0x7543('0x1b')])[_0x7543('0x19')](respondWithResult(_0xdb7512,null))[_0x7543('0xd')](handleError(_0xdb7512,null));};exports[_0x7543('0x2c')]=function(_0x586420,_0x458c67){return respondWithRpcPromise(_0x7543('0x2d'),_0x586420['query'])[_0x7543('0x19')](respondWithResult(_0x458c67,null))[_0x7543('0xd')](handleError(_0x458c67,null));};exports[_0x7543('0x2e')]=function(_0x132591,_0x49b3cd){var _0x42eb43;return respondWithRpcPromise('Agents',_0x132591[_0x7543('0x1b')])[_0x7543('0x19')](function(_0x3a378f){_0x42eb43=_0x3a378f;return respondWithRpcPromise(_0x7543('0x2f'),_0x132591['query'],routingClient);})[_0x7543('0x19')](function(_0x29f10d){return _[_0x7543('0x1a')]({},_0x29f10d,_0x42eb43);})[_0x7543('0x19')](respondWithResult(_0x49b3cd,null))[_0x7543('0xd')](handleError(_0x49b3cd,null));};exports[_0x7543('0x30')]=function(_0x28e55d,_0x31da2a){if(_0x28e55d[_0x7543('0x22')]&&_0x28e55d['body']['interaction']&&_0x28e55d[_0x7543('0x31')]&&_0x28e55d[_0x7543('0x31')][_0x7543('0x12')]){for(var _0x3c5125 in _0x28e55d[_0x7543('0x22')][_0x7543('0x32')]){if(_0x28e55d[_0x7543('0x22')][_0x7543('0x32')][_0x7543('0x33')](_0x3c5125)){db[_0x7543('0x34')]['findAll']({'where':{'channel':_0x3c5125,'membername':_0x28e55d[_0x7543('0x31')][_0x7543('0x12')],'type':_0x7543('0x35'),'exitAt':null,'uniqueid':_0x28e55d[_0x7543('0x22')]['interaction'][_0x3c5125]&&_0x28e55d[_0x7543('0x22')][_0x7543('0x32')][_0x3c5125][_0x7543('0x36')]?{'$notIn':_0x28e55d['body'][_0x7543('0x32')][_0x3c5125]}:{'$ne':null}}})[_0x7543('0x19')](function(_0x3eaddb){var _0x8e0e62=moment()[_0x7543('0x37')](_0x7543('0x38'));for(var _0x242fca=0x0,_0x3336e6=_0x3eaddb[_0x7543('0x36')];_0x242fca<_0x3336e6;_0x242fca+=0x1){_0x3eaddb[_0x242fca][_0x7543('0x39')]({'exitAt':_0x8e0e62});}});for(var _0xb7d6d6=0x0;_0xb7d6d6<_0x28e55d[_0x7543('0x22')][_0x7543('0x32')][_0x3c5125][_0x7543('0x36')];_0xb7d6d6+=0x1){db[_0x7543('0x34')][_0x7543('0x3a')]({'where':{'channel':_0x3c5125,'membername':_0x28e55d[_0x7543('0x31')][_0x7543('0x12')],'type':_0x7543('0x35'),'uniqueid':_0x28e55d[_0x7543('0x22')][_0x7543('0x32')][_0x3c5125][_0xb7d6d6],'exitAt':null},'defaults':{'channel':_0x3c5125,'membername':_0x28e55d[_0x7543('0x31')]['name'],'interface':_['isNil'](_0x28e55d['user'][_0x7543('0x3b')])?util[_0x7543('0x37')](_0x7543('0x3c'),_0x28e55d['user']['name']):_0x28e55d[_0x7543('0x31')][_0x7543('0x3b')],'type':_0x7543('0x35'),'enterAt':moment()[_0x7543('0x37')](_0x7543('0x38')),'role':'agent','internal':_0x28e55d[_0x7543('0x31')][_0x7543('0x3d')],'uniqueid':_0x28e55d[_0x7543('0x22')][_0x7543('0x32')][_0x3c5125][_0xb7d6d6]}});}}}}return respondWithRpcPromise(_0x7543('0x3e'),{'id':_0x28e55d['params']['id'],'capacity':_0x28e55d[_0x7543('0x22')][_0x7543('0x3f')]},routingClient)[_0x7543('0x19')](respondWithResult(_0x31da2a,null))['catch'](handleError(_0x31da2a,null));};exports[_0x7543('0x40')]=function(_0x5200e2,_0xbbf274){return respondWithRpcPromise(_0x7543('0x41'),_0x5200e2[_0x7543('0x1b')])[_0x7543('0x19')](respondWithResult(_0xbbf274,null))['catch'](handleError(_0xbbf274,null));};exports[_0x7543('0x42')]=function(_0x15ecdc,_0x3ef722){return respondWithRpcPromise(_0x7543('0x43'),_0x15ecdc[_0x7543('0x1b')])[_0x7543('0x19')](respondWithResult(_0x3ef722,null))['catch'](handleError(_0x3ef722,null));};exports[_0x7543('0x44')]=function(_0x3ec4aa,_0x17d249){return respondWithRpcPromise(_0x7543('0x45'),_0x3ec4aa[_0x7543('0x1b')])[_0x7543('0x19')](respondWithResult(_0x17d249,null))[_0x7543('0xd')](handleError(_0x17d249,null));};exports[_0x7543('0x46')]=function(_0xcad267,_0xb612ba){return respondWithRpcPromise(_0x7543('0x47'),_0xcad267['query'],routingClient)[_0x7543('0x19')](respondWithResult(_0xb612ba,null))[_0x7543('0xd')](handleError(_0xb612ba,null));};exports[_0x7543('0x48')]=function(_0x2f00ef,_0x46e150){return respondWithRpcPromise(_0x7543('0x47'),_0x2f00ef[_0x7543('0x1b')],routingClient)['then'](findById(_0x2f00ef['params']['id']))['then'](respondWithResult(_0x46e150,null))[_0x7543('0xd')](handleError(_0x46e150,null));};exports['mailQueues']=function(_0x934b19,_0x2b541b){return respondWithRpcPromise('MailQueues',_0x934b19[_0x7543('0x1b')],routingClient)[_0x7543('0x19')](respondWithResult(_0x2b541b,null))[_0x7543('0xd')](handleError(_0x2b541b,null));};exports[_0x7543('0x49')]=function(_0x144735,_0x6cc8a1){return respondWithRpcPromise(_0x7543('0x4a'),_0x144735['query'],routingClient)['then'](findById(_0x144735[_0x7543('0x1c')]['id']))['then'](respondWithResult(_0x6cc8a1,null))[_0x7543('0xd')](handleError(_0x6cc8a1,null));};exports['mailAccounts']=function(_0x42113e,_0x4955a9){return respondWithRpcPromise(_0x7543('0x4b'),_0x42113e[_0x7543('0x1b')],mailClient)[_0x7543('0x19')](respondWithResult(_0x4955a9,null))[_0x7543('0xd')](handleError(_0x4955a9,null));};exports[_0x7543('0x4c')]=function(_0x261734,_0x2ed560){return respondWithRpcPromise(_0x7543('0x4d'),_0x261734[_0x7543('0x1b')],routingClient)['then'](respondWithResult(_0x2ed560,null))[_0x7543('0xd')](handleError(_0x2ed560,null));};exports['showOpenchannelQueues']=function(_0x2b61a7,_0x2494a7){return respondWithRpcPromise(_0x7543('0x4d'),_0x2b61a7[_0x7543('0x1b')],routingClient)['then'](findById(_0x2b61a7[_0x7543('0x1c')]['id']))[_0x7543('0x19')](respondWithResult(_0x2494a7,null))[_0x7543('0xd')](handleError(_0x2494a7,null));};exports[_0x7543('0x4e')]=function(_0x40f9e3,_0x106fe5){return respondWithRpcPromise('SmsQueues',_0x40f9e3[_0x7543('0x1b')],routingClient)['then'](respondWithResult(_0x106fe5,null))[_0x7543('0xd')](handleError(_0x106fe5,null));};exports[_0x7543('0x4f')]=function(_0x1ff8d8,_0x2fa86a){return respondWithRpcPromise(_0x7543('0x50'),_0x1ff8d8[_0x7543('0x1b')],routingClient)['then'](findById(_0x1ff8d8[_0x7543('0x1c')]['id']))['then'](respondWithResult(_0x2fa86a,null))[_0x7543('0xd')](handleError(_0x2fa86a,null));};exports[_0x7543('0x51')]=function(_0x13ef18,_0x7a2556){return respondWithRpcPromise(_0x7543('0x52'),_0x13ef18[_0x7543('0x1b')],routingClient)['then'](respondWithResult(_0x7a2556,null))['catch'](handleError(_0x7a2556,null));};exports[_0x7543('0x53')]=function(_0x2693c7,_0x52af56){return respondWithRpcPromise('WhatsappQueues',_0x2693c7[_0x7543('0x1b')],routingClient)[_0x7543('0x19')](findById(_0x2693c7[_0x7543('0x1c')]['id']))['then'](respondWithResult(_0x52af56,null))[_0x7543('0xd')](handleError(_0x52af56,null));};exports[_0x7543('0x54')]=function(_0x2d9c0e,_0x55349e){return respondWithRpcPromise('FaxQueues',_0x2d9c0e[_0x7543('0x1b')],routingClient)[_0x7543('0x19')](respondWithResult(_0x55349e,null))[_0x7543('0xd')](handleError(_0x55349e,null));};exports[_0x7543('0x55')]=function(_0x12d762,_0x331217){return respondWithRpcPromise(_0x7543('0x56'),_0x12d762['query'],routingClient)['then'](findById(_0x12d762[_0x7543('0x1c')]['id']))[_0x7543('0x19')](respondWithResult(_0x331217,null))['catch'](handleError(_0x331217,null));};exports[_0x7543('0x57')]=function(_0x15788b,_0x34d91f){return respondWithRpcPromise(_0x7543('0x58'),_0x15788b[_0x7543('0x1b')])[_0x7543('0x19')](respondWithResult(_0x34d91f,null))[_0x7543('0xd')](handleError(_0x34d91f,null));};exports[_0x7543('0x59')]=function(_0x522604,_0x4c1797){return respondWithRpcPromise(_0x7543('0x5a'),_0x522604[_0x7543('0x1b')],routingClient)['then'](respondWithResult(_0x4c1797,null))[_0x7543('0xd')](handleError(_0x4c1797,null));};exports[_0x7543('0x5b')]=function(_0x3797cd,_0x381dc5){return respondWithRpcPromise(_0x7543('0x5c'),_0x3797cd[_0x7543('0x1b')],routingClient)[_0x7543('0x19')](respondWithResult(_0x381dc5,null))['catch'](handleError(_0x381dc5,null));};exports[_0x7543('0x5d')]=function(_0x5ee13a,_0x2ef6a8){return respondWithRpcPromise(_0x7543('0x5e'),_0x5ee13a[_0x7543('0x1b')],routingClient)[_0x7543('0x19')](respondWithResult(_0x2ef6a8,null))[_0x7543('0xd')](handleError(_0x2ef6a8,null));};exports[_0x7543('0x5f')]=function(_0x3841c1,_0x5db972){return respondWithRpcPromise(_0x7543('0x5e'),_0x3841c1['query'],routingClient)[_0x7543('0x19')](function(_0x1a65e4){if(_0x3841c1[_0x7543('0x1b')][_0x7543('0x60')]!==undefined){var _0xcc3e9f=_(_0x1a65e4[_0x7543('0x15')])[_0x7543('0x61')]([_0x3841c1['query']['type'],_0x3841c1[_0x7543('0x1c')]['id']])['map'](_0x7543('0x62'))[_0x7543('0x63')]()[_0x7543('0x64')]();return _0x1a65e4[_0x7543('0x15')][_0x7543('0x61')](function(_0x4fa4a2){return _0xcc3e9f['indexOf'](_0x4fa4a2[_0x7543('0x62')])>-0x1;});}else{return _0x1a65e4['rows'][_0x7543('0x61')](function(_0x345f76){return _0x345f76[_0x7543('0x62')]===parseInt(_0x3841c1[_0x7543('0x1c')]['id']);});}})['then'](respondWithResult(_0x5db972,null))['catch'](handleError(_0x5db972,null));};exports[_0x7543('0x65')]=function(_0x2abd8c,_0x4e53ff){return respondWithRpcPromise(_0x7543('0x66'),_0x2abd8c['query'],routingClient)[_0x7543('0x19')](respondWithResult(_0x4e53ff,null))[_0x7543('0xd')](handleError(_0x4e53ff,null));};exports[_0x7543('0x67')]=function(_0x22c1d3,_0xcfdcd2){return respondWithRpcPromise(_0x7543('0x68'),_0x22c1d3['query'],routingClient)[_0x7543('0x19')](respondWithResult(_0xcfdcd2,null))[_0x7543('0xd')](handleError(_0xcfdcd2,null));};exports[_0x7543('0x69')]=function(_0x15208e,_0x56e953){return respondWithRpcPromise(_0x7543('0x6a'),_0x15208e[_0x7543('0x1b')],routingClient)[_0x7543('0x19')](respondWithResult(_0x56e953,null))[_0x7543('0xd')](handleError(_0x56e953,null));};exports[_0x7543('0x6b')]=function(_0x3853eb){return function(_0x94364f,_0x13727b){var _0xefbcd6,_0x2eff3f;var _0x119539=_[_0x7543('0x6c')](_0x3853eb);var _0x5bd3f6=_0x3853eb===_0x7543('0x6d')?_0x7543('0x6e'):_0x7543('0x6f');return db[_0x119539+_0x7543('0x70')][_0x7543('0x71')]({'raw':!![],'where':{'id':_0x94364f[_0x7543('0x1c')]['id']}})[_0x7543('0x19')](function(_0x32dbe5){if(_[_0x7543('0x14')](_0x32dbe5)){throw new Error(_0x119539+_0x7543('0x72'));}_0xefbcd6=_0x32dbe5;return db[_0x119539+_0x7543('0x73')]['findOne']({'where':{'id':_0x94364f[_0x7543('0x22')][_0x7543('0x74')]},'include':[{'model':db[_0x119539+_0x7543('0x75')],'as':'Interaction'},{'model':db[_0x119539+_0x5bd3f6],'as':_0x7543('0x6f')}]});})[_0x7543('0x19')](function(_0x3afda7){if(_[_0x7543('0x14')](_0x3afda7)){throw new Error(_0x119539+_0x7543('0x76'));}_0x2eff3f=_0x3afda7;return _0x3afda7[_0x7543('0x77')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7543('0x19')](function(){var _0x628bbb={'uniqueid':_0x3853eb+'.'+_0x2eff3f['id']+'.'+_0x2eff3f[_0x7543('0x75')]['id'],'FromUserId':_0x94364f[_0x7543('0x31')]['id'],'type':_0x7543('0x78')};_0x628bbb[_0x119539+'MessageId']=_0x2eff3f['id'];_0x628bbb[_0x119539+'InteractionId']=_0x2eff3f[_0x7543('0x75')]['id'];_0x628bbb[_0x7543('0x79')+_0x119539+_0x5bd3f6+'Id']=_0x2eff3f[_0x7543('0x6f')]['id'];_0x628bbb['To'+_0x119539+_0x7543('0x7a')]=_0xefbcd6['id'];return db[_0x119539+_0x7543('0x7b')][_0x7543('0x7c')](_0x628bbb);})['then'](function(){return respondWithRpcPromise(_0x7543('0x7d'),{'channel':_0x3853eb,'interaction':_0x2eff3f['Interaction'],'message':_0x2eff3f,'account':_0x2eff3f[_0x7543('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7543('0x78'),'appdata':_0xefbcd6[_0x7543('0x12')]+','+(_0x2eff3f['Account']['queueTransferTimeout']||0x12c),'interval':_0x7543('0x7e')}]},routingClient);})[_0x7543('0x19')](respondWithResult(_0x13727b,null))[_0x7543('0xd')](handleError(_0x13727b,null));};};exports[_0x7543('0x7f')]=function(_0x13330f,_0x52b001){var _0x432d3d,_0xd36f69;if(_[_0x7543('0x14')](_0x13330f[_0x7543('0x22')][_0x7543('0x80')])){throw new Error(_0x7543('0x81'));}var _0x1225bf=_0x13330f[_0x7543('0x22')]['channel'];var _0x5d1b64=_[_0x7543('0x6c')](_0x1225bf);var _0xa649fc=_0x1225bf===_0x7543('0x6d')?_0x7543('0x6e'):_0x7543('0x6f');return db['User']['findOne']({'raw':!![],'where':{'id':_0x13330f[_0x7543('0x1c')]['id'],'role':'agent'}})[_0x7543('0x19')](function(_0x6ece7d){if(_[_0x7543('0x14')](_0x6ece7d)){throw new Error('Agent\x20not\x20found');}_0x432d3d=_0x6ece7d;return db[_0x5d1b64+'Message'][_0x7543('0x71')]({'where':{'id':_0x13330f['body'][_0x7543('0x74')]},'include':[{'model':db[_0x5d1b64+_0x7543('0x75')],'as':_0x7543('0x75')},{'model':db[_0x5d1b64+_0xa649fc],'as':_0x7543('0x6f')}]});})[_0x7543('0x19')](function(_0x3e2ac2){if(_['isNil'](_0x3e2ac2)){throw new Error(_0x5d1b64+_0x7543('0x76'));}_0xd36f69=_0x3e2ac2;return _0x3e2ac2['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7543('0x19')](function(){var _0x22cea5={'uniqueid':_0x1225bf+'.'+_0xd36f69['id']+'.'+_0xd36f69[_0x7543('0x75')]['id'],'FromUserId':_0x13330f['user']['id'],'type':'agent','ToUserId':_0x432d3d['id']};_0x22cea5[_0x5d1b64+_0x7543('0x82')]=_0xd36f69['id'];_0x22cea5[_0x5d1b64+_0x7543('0x83')]=_0xd36f69['Interaction']['id'];_0x22cea5['From'+_0x5d1b64+_0xa649fc+'Id']=_0xd36f69[_0x7543('0x6f')]['id'];return db[_0x5d1b64+_0x7543('0x7b')][_0x7543('0x7c')](_0x22cea5);})[_0x7543('0x19')](function(){return respondWithRpcPromise(_0x7543('0x7d'),{'channel':_0x1225bf,'interaction':_0xd36f69[_0x7543('0x75')],'message':_0xd36f69,'account':_0xd36f69[_0x7543('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7543('0x84'),'appdata':_0x432d3d['name']+','+(_0xd36f69[_0x7543('0x6f')][_0x7543('0x85')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x7543('0x19')](respondWithResult(_0x52b001,null))[_0x7543('0xd')](handleError(_0x52b001,null));}; \ No newline at end of file +var _0xefee=['campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','uniq','value','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Queue','\x20Queue\x20not\x20found','messageId','Interaction','Account','\x20Message\x20not\x20found','InteractionId','From','QueueId','TransferReport','Start','*,*,*,*','agentNotify','channel','chat','User','findOne','update','agentTransferTimeout','bluebird','util','../../mysqldb','../../config/logger','client','http','then','error','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','MemberReport','INTERACTION','format','length','findOrCreate','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks'];(function(_0x37d9b1,_0x358b0d){var _0x580044=function(_0x23530f){while(--_0x23530f){_0x37d9b1['push'](_0x37d9b1['shift']());}};_0x580044(++_0x358b0d);}(_0xefee,0x122));var _0xeefe=function(_0x3eac17,_0x44d549){_0x3eac17=_0x3eac17-0x0;var _0x19c279=_0xefee[_0x3eac17];return _0x19c279;};'use strict';var BPromise=require(_0xeefe('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xeefe('0x1'));var db=require(_0xeefe('0x2'))['db'];var logger=require(_0xeefe('0x3'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0xeefe('0x4')][_0xeefe('0x5')]({'port':0x232a});var mailClient=jayson[_0xeefe('0x4')][_0xeefe('0x5')]({'port':0x232b});var routingClient=jayson[_0xeefe('0x4')][_0xeefe('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x5c00a0,_0x580baa,_0x55a7a6){return new BPromise(function(_0x12d49b,_0x376186){var _0x1dd21f=_0x55a7a6?_0x55a7a6:amiClient;return _0x1dd21f['request'](_0x5c00a0,_0x580baa)[_0xeefe('0x6')](function(_0x3ea393){if(_0x3ea393[_0xeefe('0x7')]){if(_0x3ea393[_0xeefe('0x7')]['code']===0x1f4){return _0x376186(_0x3ea393[_0xeefe('0x7')][_0xeefe('0x8')]);}return _0x12d49b(_0x3ea393[_0xeefe('0x7')]['message']);}else{_0x12d49b(_0x3ea393[_0xeefe('0x9')]);}})[_0xeefe('0xa')](function(_0x25103d){_0x376186(_0x25103d);});});}function respondWithResult(_0x428716,_0x14d6f8){_0x14d6f8=_0x14d6f8||0xc8;return function(_0x3d8192){if(_0x3d8192){return _0x428716[_0xeefe('0xb')](_0x14d6f8)['json'](_0x3d8192);}return _0x428716[_0xeefe('0xc')](0x194);};}function handleError(_0x577e42,_0x2004ef){_0x2004ef=_0x2004ef||0x1f4;return function(_0x2b7fad){logger[_0xeefe('0x7')](_0x2b7fad[_0xeefe('0xd')]);if(_0x2b7fad[_0xeefe('0xe')]){delete _0x2b7fad['name'];}_0x577e42[_0xeefe('0xb')](_0x2004ef)[_0xeefe('0xf')](_0x2b7fad);};}function findById(_0x4bd904){return function(_0x2a2ccd){if(!_[_0xeefe('0x10')](_0x4bd904)&&!_[_0xeefe('0x10')](_0x2a2ccd)&&!_['isNil'](_0x2a2ccd[_0xeefe('0x11')])){return _[_0xeefe('0x12')](_0x2a2ccd[_0xeefe('0x11')],function(_0x430d24){return _0x430d24['id']==_0x4bd904;});}return null;};}exports[_0xeefe('0x13')]=function(_0x3fc6c5,_0x1f76f0){return respondWithRpcPromise('VoiceChannels',_0x3fc6c5[_0xeefe('0x14')])['then'](respondWithResult(_0x1f76f0,null))['catch'](handleError(_0x1f76f0,null));};exports['voiceChannelMixMonitor']=function(_0x17fdd8,_0x3da503){return respondWithRpcPromise(_0xeefe('0x15'),_[_0xeefe('0x16')](_0x17fdd8['query'],_0x17fdd8['params']))[_0xeefe('0x6')](respondWithResult(_0x3da503,null))[_0xeefe('0xa')](handleError(_0x3da503,null));};exports[_0xeefe('0x17')]=function(_0x43fcc7,_0x5ab7b6){return respondWithRpcPromise(_0xeefe('0x18'),_[_0xeefe('0x16')](_0x43fcc7[_0xeefe('0x14')],_0x43fcc7[_0xeefe('0x19')]))['then'](respondWithResult(_0x5ab7b6,null))[_0xeefe('0xa')](handleError(_0x5ab7b6,null));};exports['voiceQueues']=function(_0x26a363,_0x2ad5d6){return respondWithRpcPromise(_0xeefe('0x1a'),_0x26a363['query'])[_0xeefe('0x6')](respondWithResult(_0x2ad5d6,null))[_0xeefe('0xa')](handleError(_0x2ad5d6,null));};exports[_0xeefe('0x1b')]=function(_0x3e7b02,_0x27cf79){return respondWithRpcPromise(_0xeefe('0x1a'),_0x3e7b02[_0xeefe('0x14')])[_0xeefe('0x6')](findById(_0x3e7b02[_0xeefe('0x19')]['id']))[_0xeefe('0x6')](respondWithResult(_0x27cf79,null))[_0xeefe('0xa')](handleError(_0x27cf79,null));};exports['updateVoiceQueue']=function(_0x1d6a53,_0x3f7c90){return respondWithRpcPromise(_0xeefe('0x1c'),_[_0xeefe('0x16')](_0x1d6a53[_0xeefe('0x1d')],_0x1d6a53[_0xeefe('0x19')]))[_0xeefe('0x6')](respondWithResult(_0x3f7c90,null))['catch'](handleError(_0x3f7c90,null));};exports[_0xeefe('0x1e')]=function(_0x17aacc,_0x2e4128){return respondWithRpcPromise(_0xeefe('0x1f'),_['merge'](_0x17aacc[_0xeefe('0x14')],_0x17aacc['params']))[_0xeefe('0x6')](respondWithResult(_0x2e4128,null))[_0xeefe('0xa')](handleError(_0x2e4128,null));};exports[_0xeefe('0x20')]=function(_0x4c369d,_0x258702){return respondWithRpcPromise(_0xeefe('0x21'),_0x4c369d[_0xeefe('0x14')])[_0xeefe('0x6')](respondWithResult(_0x258702,null))[_0xeefe('0xa')](handleError(_0x258702,null));};exports[_0xeefe('0x22')]=function(_0x56de1a,_0x2772c2){return respondWithRpcPromise(_0xeefe('0x23'),_[_0xeefe('0x16')](_0x56de1a[_0xeefe('0x14')],_0x56de1a[_0xeefe('0x19')]))[_0xeefe('0x6')](respondWithResult(_0x2772c2,null))['catch'](handleError(_0x2772c2,null));};exports[_0xeefe('0x24')]=function(_0x3681ba,_0x4e3c81){return respondWithRpcPromise(_0xeefe('0x25'),_[_0xeefe('0x16')](_0x3681ba[_0xeefe('0x14')],_0x3681ba[_0xeefe('0x19')]))['then'](respondWithResult(_0x4e3c81,null))[_0xeefe('0xa')](handleError(_0x4e3c81,null));};exports['voiceQueuesChannelRedirect']=function(_0x35b477,_0x48bbc9){return respondWithRpcPromise(_0xeefe('0x26'),_[_0xeefe('0x16')](_0x35b477['query'],_0x35b477[_0xeefe('0x19')]))[_0xeefe('0x6')](respondWithResult(_0x48bbc9,null))[_0xeefe('0xa')](handleError(_0x48bbc9,null));};exports[_0xeefe('0x27')]=function(_0xe4512,_0x46fbff){return respondWithRpcPromise('Outbound',_0xe4512[_0xeefe('0x14')])[_0xeefe('0x6')](respondWithResult(_0x46fbff,null))['catch'](handleError(_0x46fbff,null));};exports[_0xeefe('0x28')]=function(_0x18f91a,_0x3292a3){return respondWithRpcPromise(_0xeefe('0x29'),_0x18f91a[_0xeefe('0x14')])[_0xeefe('0x6')](respondWithResult(_0x3292a3,null))[_0xeefe('0xa')](handleError(_0x3292a3,null));};exports[_0xeefe('0x2a')]=function(_0x409365,_0x1d2f01){var _0x2913fc;return respondWithRpcPromise(_0xeefe('0x2b'),_0x409365[_0xeefe('0x14')])[_0xeefe('0x6')](function(_0x17d3b9){_0x2913fc=_0x17d3b9;return respondWithRpcPromise('Agents',_0x409365[_0xeefe('0x14')],routingClient);})[_0xeefe('0x6')](function(_0x22d4b4){return _[_0xeefe('0x16')]({},_0x22d4b4,_0x2913fc);})[_0xeefe('0x6')](respondWithResult(_0x1d2f01,null))[_0xeefe('0xa')](handleError(_0x1d2f01,null));};exports[_0xeefe('0x2c')]=function(_0x44750a,_0x1f1fbd){if(_0x44750a['body']&&_0x44750a[_0xeefe('0x1d')][_0xeefe('0x2d')]&&_0x44750a[_0xeefe('0x2e')]&&_0x44750a['user'][_0xeefe('0xe')]){for(var _0x27a7c3 in _0x44750a[_0xeefe('0x1d')]['interaction']){if(_0x44750a['body'][_0xeefe('0x2d')]['hasOwnProperty'](_0x27a7c3)){db[_0xeefe('0x2f')]['findAll']({'where':{'channel':_0x27a7c3,'membername':_0x44750a[_0xeefe('0x2e')][_0xeefe('0xe')],'type':_0xeefe('0x30'),'exitAt':null,'uniqueid':_0x44750a['body'][_0xeefe('0x2d')][_0x27a7c3]&&_0x44750a[_0xeefe('0x1d')][_0xeefe('0x2d')][_0x27a7c3]['length']?{'$notIn':_0x44750a['body'][_0xeefe('0x2d')][_0x27a7c3]}:{'$ne':null}}})['then'](function(_0xd5083e){var _0x53622e=moment()[_0xeefe('0x31')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4cf419=0x0,_0x1a52b0=_0xd5083e[_0xeefe('0x32')];_0x4cf419<_0x1a52b0;_0x4cf419+=0x1){_0xd5083e[_0x4cf419]['updateAttributes']({'exitAt':_0x53622e});}});for(var _0x38effa=0x0;_0x38effa<_0x44750a[_0xeefe('0x1d')][_0xeefe('0x2d')][_0x27a7c3][_0xeefe('0x32')];_0x38effa+=0x1){db[_0xeefe('0x2f')][_0xeefe('0x33')]({'where':{'channel':_0x27a7c3,'membername':_0x44750a['user'][_0xeefe('0xe')],'type':'INTERACTION','uniqueid':_0x44750a[_0xeefe('0x1d')][_0xeefe('0x2d')][_0x27a7c3][_0x38effa],'exitAt':null},'defaults':{'channel':_0x27a7c3,'membername':_0x44750a['user'][_0xeefe('0xe')],'interface':_[_0xeefe('0x10')](_0x44750a[_0xeefe('0x2e')][_0xeefe('0x34')])?util[_0xeefe('0x31')](_0xeefe('0x35'),_0x44750a[_0xeefe('0x2e')][_0xeefe('0xe')]):_0x44750a[_0xeefe('0x2e')][_0xeefe('0x34')],'type':'INTERACTION','enterAt':moment()[_0xeefe('0x31')](_0xeefe('0x36')),'role':_0xeefe('0x37'),'internal':_0x44750a[_0xeefe('0x2e')][_0xeefe('0x38')],'uniqueid':_0x44750a[_0xeefe('0x1d')]['interaction'][_0x27a7c3][_0x38effa]}});}}}}return respondWithRpcPromise(_0xeefe('0x39'),{'id':_0x44750a[_0xeefe('0x19')]['id'],'capacity':_0x44750a['body'][_0xeefe('0x3a')]},routingClient)[_0xeefe('0x6')](respondWithResult(_0x1f1fbd,null))[_0xeefe('0xa')](handleError(_0x1f1fbd,null));};exports['telephones']=function(_0x566c2c,_0xf736df){return respondWithRpcPromise(_0xeefe('0x3b'),_0x566c2c[_0xeefe('0x14')])['then'](respondWithResult(_0xf736df,null))[_0xeefe('0xa')](handleError(_0xf736df,null));};exports[_0xeefe('0x3c')]=function(_0x1dd8e9,_0x2845ea){return respondWithRpcPromise('Trunks',_0x1dd8e9[_0xeefe('0x14')])['then'](respondWithResult(_0x2845ea,null))['catch'](handleError(_0x2845ea,null));};exports[_0xeefe('0x3d')]=function(_0x3b92e0,_0x5f2ee6){return respondWithRpcPromise(_0xeefe('0x3e'),_0x3b92e0[_0xeefe('0x14')])[_0xeefe('0x6')](respondWithResult(_0x5f2ee6,null))[_0xeefe('0xa')](handleError(_0x5f2ee6,null));};exports[_0xeefe('0x3f')]=function(_0x5830a2,_0x431612){return respondWithRpcPromise('ChatQueues',_0x5830a2[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](respondWithResult(_0x431612,null))[_0xeefe('0xa')](handleError(_0x431612,null));};exports[_0xeefe('0x40')]=function(_0x3a74ac,_0x17203c){return respondWithRpcPromise(_0xeefe('0x41'),_0x3a74ac[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](findById(_0x3a74ac[_0xeefe('0x19')]['id']))['then'](respondWithResult(_0x17203c,null))[_0xeefe('0xa')](handleError(_0x17203c,null));};exports[_0xeefe('0x42')]=function(_0x151a1f,_0x44bc81){return respondWithRpcPromise(_0xeefe('0x43'),_0x151a1f[_0xeefe('0x14')],routingClient)['then'](respondWithResult(_0x44bc81,null))[_0xeefe('0xa')](handleError(_0x44bc81,null));};exports[_0xeefe('0x44')]=function(_0x263bad,_0x2898b8){return respondWithRpcPromise(_0xeefe('0x43'),_0x263bad[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](findById(_0x263bad[_0xeefe('0x19')]['id']))[_0xeefe('0x6')](respondWithResult(_0x2898b8,null))[_0xeefe('0xa')](handleError(_0x2898b8,null));};exports['mailAccounts']=function(_0x334cf5,_0x46b5f9){return respondWithRpcPromise('MailAccounts',_0x334cf5[_0xeefe('0x14')],mailClient)['then'](respondWithResult(_0x46b5f9,null))[_0xeefe('0xa')](handleError(_0x46b5f9,null));};exports[_0xeefe('0x45')]=function(_0x29b15f,_0xda826){return respondWithRpcPromise(_0xeefe('0x46'),_0x29b15f[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](respondWithResult(_0xda826,null))[_0xeefe('0xa')](handleError(_0xda826,null));};exports[_0xeefe('0x47')]=function(_0x5784c8,_0x3e16a2){return respondWithRpcPromise(_0xeefe('0x46'),_0x5784c8[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](findById(_0x5784c8[_0xeefe('0x19')]['id']))['then'](respondWithResult(_0x3e16a2,null))[_0xeefe('0xa')](handleError(_0x3e16a2,null));};exports[_0xeefe('0x48')]=function(_0x241908,_0x28721f){return respondWithRpcPromise(_0xeefe('0x49'),_0x241908['query'],routingClient)[_0xeefe('0x6')](respondWithResult(_0x28721f,null))[_0xeefe('0xa')](handleError(_0x28721f,null));};exports[_0xeefe('0x4a')]=function(_0x3c4428,_0x42f5c2){return respondWithRpcPromise(_0xeefe('0x49'),_0x3c4428[_0xeefe('0x14')],routingClient)['then'](findById(_0x3c4428[_0xeefe('0x19')]['id']))[_0xeefe('0x6')](respondWithResult(_0x42f5c2,null))[_0xeefe('0xa')](handleError(_0x42f5c2,null));};exports[_0xeefe('0x4b')]=function(_0x41d534,_0x196de6){return respondWithRpcPromise(_0xeefe('0x4c'),_0x41d534[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](respondWithResult(_0x196de6,null))[_0xeefe('0xa')](handleError(_0x196de6,null));};exports[_0xeefe('0x4d')]=function(_0x1710d9,_0x30311c){return respondWithRpcPromise('WhatsappQueues',_0x1710d9['query'],routingClient)[_0xeefe('0x6')](findById(_0x1710d9[_0xeefe('0x19')]['id']))[_0xeefe('0x6')](respondWithResult(_0x30311c,null))[_0xeefe('0xa')](handleError(_0x30311c,null));};exports['faxQueues']=function(_0x354943,_0x9fe650){return respondWithRpcPromise(_0xeefe('0x4e'),_0x354943[_0xeefe('0x14')],routingClient)['then'](respondWithResult(_0x9fe650,null))[_0xeefe('0xa')](handleError(_0x9fe650,null));};exports[_0xeefe('0x4f')]=function(_0x3daef7,_0x30546e){return respondWithRpcPromise('FaxQueues',_0x3daef7[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](findById(_0x3daef7[_0xeefe('0x19')]['id']))[_0xeefe('0x6')](respondWithResult(_0x30546e,null))['catch'](handleError(_0x30546e,null));};exports[_0xeefe('0x50')]=function(_0x3bfe2a,_0xcd3aa2){return respondWithRpcPromise(_0xeefe('0x51'),_0x3bfe2a[_0xeefe('0x14')])['then'](respondWithResult(_0xcd3aa2,null))['catch'](handleError(_0xcd3aa2,null));};exports[_0xeefe('0x52')]=function(_0x4f4809,_0xbd9cdb){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4f4809['query'],routingClient)['then'](respondWithResult(_0xbd9cdb,null))[_0xeefe('0xa')](handleError(_0xbd9cdb,null));};exports[_0xeefe('0x53')]=function(_0x5d2ac0,_0x3dea6f){return respondWithRpcPromise(_0xeefe('0x54'),_0x5d2ac0[_0xeefe('0x14')],routingClient)['then'](respondWithResult(_0x3dea6f,null))[_0xeefe('0xa')](handleError(_0x3dea6f,null));};exports[_0xeefe('0x55')]=function(_0x235717,_0x49c8db){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x235717['query'],routingClient)['then'](respondWithResult(_0x49c8db,null))[_0xeefe('0xa')](handleError(_0x49c8db,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x35c980,_0x18b193){return respondWithRpcPromise(_0xeefe('0x56'),_0x35c980[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](function(_0x357df0){if(_0x35c980['query'][_0xeefe('0x57')]!==undefined){var _0x462592=_(_0x357df0[_0xeefe('0x11')])['filter']([_0x35c980[_0xeefe('0x14')][_0xeefe('0x57')],_0x35c980[_0xeefe('0x19')]['id']])[_0xeefe('0x58')]('queue_id')[_0xeefe('0x59')]()[_0xeefe('0x5a')]();return _0x357df0['rows']['filter'](function(_0x6ce027){return _0x462592[_0xeefe('0x5b')](_0x6ce027[_0xeefe('0x5c')])>-0x1;});}else{return _0x357df0[_0xeefe('0x11')]['filter'](function(_0xf3a3d2){return _0xf3a3d2[_0xeefe('0x5c')]===parseInt(_0x35c980[_0xeefe('0x19')]['id']);});}})[_0xeefe('0x6')](respondWithResult(_0x18b193,null))[_0xeefe('0xa')](handleError(_0x18b193,null));};exports['smsQueuesWaitingInteractions']=function(_0x4448f6,_0x48b606){return respondWithRpcPromise(_0xeefe('0x5d'),_0x4448f6[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](respondWithResult(_0x48b606,null))[_0xeefe('0xa')](handleError(_0x48b606,null));};exports[_0xeefe('0x5e')]=function(_0x3736a7,_0x55b3d5){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x3736a7['query'],routingClient)[_0xeefe('0x6')](respondWithResult(_0x55b3d5,null))[_0xeefe('0xa')](handleError(_0x55b3d5,null));};exports[_0xeefe('0x5f')]=function(_0x27b892,_0xbee2bc){return respondWithRpcPromise(_0xeefe('0x60'),_0x27b892[_0xeefe('0x14')],routingClient)[_0xeefe('0x6')](respondWithResult(_0xbee2bc,null))[_0xeefe('0xa')](handleError(_0xbee2bc,null));};exports[_0xeefe('0x61')]=function(_0x3feaeb){return function(_0x18d656,_0xc74b16){var _0x40bb72,_0x46562f;var _0x579b24=_['capitalize'](_0x3feaeb);var _0x39b291=_0x3feaeb==='chat'?'Website':'Account';return db[_0x579b24+_0xeefe('0x62')]['findOne']({'raw':!![],'where':{'id':_0x18d656[_0xeefe('0x19')]['id']}})[_0xeefe('0x6')](function(_0x268873){if(_['isNil'](_0x268873)){throw new Error(_0x579b24+_0xeefe('0x63'));}_0x40bb72=_0x268873;return db[_0x579b24+'Message']['findOne']({'where':{'id':_0x18d656['body'][_0xeefe('0x64')]},'include':[{'model':db[_0x579b24+'Interaction'],'as':_0xeefe('0x65')},{'model':db[_0x579b24+_0x39b291],'as':_0xeefe('0x66')}]});})['then'](function(_0x132f59){if(_[_0xeefe('0x10')](_0x132f59)){throw new Error(_0x579b24+_0xeefe('0x67'));}_0x46562f=_0x132f59;return _0x132f59['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xeefe('0x6')](function(){var _0x18f1c9={'uniqueid':_0x3feaeb+'.'+_0x46562f['id']+'.'+_0x46562f['Interaction']['id'],'FromUserId':_0x18d656['user']['id'],'type':'queue'};_0x18f1c9[_0x579b24+'MessageId']=_0x46562f['id'];_0x18f1c9[_0x579b24+_0xeefe('0x68')]=_0x46562f['Interaction']['id'];_0x18f1c9[_0xeefe('0x69')+_0x579b24+_0x39b291+'Id']=_0x46562f[_0xeefe('0x66')]['id'];_0x18f1c9['To'+_0x579b24+_0xeefe('0x6a')]=_0x40bb72['id'];return db[_0x579b24+_0xeefe('0x6b')]['create'](_0x18f1c9);})[_0xeefe('0x6')](function(){return respondWithRpcPromise(_0xeefe('0x6c'),{'channel':_0x3feaeb,'interaction':_0x46562f['Interaction'],'message':_0x46562f,'account':_0x46562f[_0xeefe('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x40bb72[_0xeefe('0xe')]+','+(_0x46562f[_0xeefe('0x66')]['queueTransferTimeout']||0x12c),'interval':_0xeefe('0x6d')}]},routingClient);})[_0xeefe('0x6')](respondWithResult(_0xc74b16,null))[_0xeefe('0xa')](handleError(_0xc74b16,null));};};exports[_0xeefe('0x6e')]=function(_0x4576eb,_0x41b000){var _0x4c0d76,_0x4dedbb;if(_[_0xeefe('0x10')](_0x4576eb[_0xeefe('0x1d')][_0xeefe('0x6f')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x20f65b=_0x4576eb['body'][_0xeefe('0x6f')];var _0x24b909=_['capitalize'](_0x20f65b);var _0x572182=_0x20f65b===_0xeefe('0x70')?'Website':_0xeefe('0x66');return db[_0xeefe('0x71')][_0xeefe('0x72')]({'raw':!![],'where':{'id':_0x4576eb[_0xeefe('0x19')]['id'],'role':_0xeefe('0x37')}})['then'](function(_0x197660){if(_[_0xeefe('0x10')](_0x197660)){throw new Error('Agent\x20not\x20found');}_0x4c0d76=_0x197660;return db[_0x24b909+'Message'][_0xeefe('0x72')]({'where':{'id':_0x4576eb[_0xeefe('0x1d')][_0xeefe('0x64')]},'include':[{'model':db[_0x24b909+'Interaction'],'as':_0xeefe('0x65')},{'model':db[_0x24b909+_0x572182],'as':_0xeefe('0x66')}]});})[_0xeefe('0x6')](function(_0x23fb39){if(_['isNil'](_0x23fb39)){throw new Error(_0x24b909+'\x20Message\x20not\x20found');}_0x4dedbb=_0x23fb39;return _0x23fb39[_0xeefe('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0xeefe('0x6')](function(){var _0x1abe0d={'uniqueid':_0x20f65b+'.'+_0x4dedbb['id']+'.'+_0x4dedbb[_0xeefe('0x65')]['id'],'FromUserId':_0x4576eb[_0xeefe('0x2e')]['id'],'type':_0xeefe('0x37'),'ToUserId':_0x4c0d76['id']};_0x1abe0d[_0x24b909+'MessageId']=_0x4dedbb['id'];_0x1abe0d[_0x24b909+_0xeefe('0x68')]=_0x4dedbb[_0xeefe('0x65')]['id'];_0x1abe0d[_0xeefe('0x69')+_0x24b909+_0x572182+'Id']=_0x4dedbb[_0xeefe('0x66')]['id'];return db[_0x24b909+'TransferReport']['create'](_0x1abe0d);})[_0xeefe('0x6')](function(){return respondWithRpcPromise('Start',{'channel':_0x20f65b,'interaction':_0x4dedbb['Interaction'],'message':_0x4dedbb,'account':_0x4dedbb[_0xeefe('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0xeefe('0x37'),'appdata':_0x4c0d76[_0xeefe('0xe')]+','+(_0x4dedbb[_0xeefe('0x66')][_0xeefe('0x74')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xeefe('0x6')](respondWithResult(_0x41b000,null))[_0xeefe('0xa')](handleError(_0x41b000,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index fd22e90..cb5c801 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 _0x44b3=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','isAuthenticated','show','/:id/run','run','post','create','put','/:id','delete','destroy'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x44b3,0x1ba));var _0x344b=function(_0x4e5a56,_0x13ba61){_0x4e5a56=_0x4e5a56-0x0;var _0x34c973=_0x44b3[_0x4e5a56];return _0x34c973;};'use strict';var multer=require('multer');var util=require(_0x344b('0x0'));var path=require(_0x344b('0x1'));var timeout=require('connect-timeout');var express=require(_0x344b('0x2'));var router=express['Router']();var fs_extra=require(_0x344b('0x3'));var auth=require(_0x344b('0x4'));var interaction=require(_0x344b('0x5'));var config=require(_0x344b('0x6'));var controller=require(_0x344b('0x7'));router[_0x344b('0x8')]('/',auth['isAuthenticated'](),controller[_0x344b('0x9')]);router[_0x344b('0x8')]('/:id',auth[_0x344b('0xa')](),controller[_0x344b('0xb')]);router['get'](_0x344b('0xc'),auth[_0x344b('0xa')](),controller[_0x344b('0xd')]);router[_0x344b('0xe')]('/',auth[_0x344b('0xa')](),controller[_0x344b('0xf')]);router[_0x344b('0x10')](_0x344b('0x11'),auth[_0x344b('0xa')](),controller['update']);router[_0x344b('0x12')](_0x344b('0x11'),auth[_0x344b('0xa')](),controller[_0x344b('0x13')]);module[_0x344b('0x14')]=router; \ No newline at end of file +var _0xb1c4=['express','Router','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xb1c4,0x81));var _0x4b1c=function(_0x45dd7a,_0x3f7de0){_0x45dd7a=_0x45dd7a-0x0;var _0x517f18=_0xb1c4[_0x45dd7a];return _0x517f18;};'use strict';var multer=require('multer');var util=require(_0x4b1c('0x0'));var path=require(_0x4b1c('0x1'));var timeout=require(_0x4b1c('0x2'));var express=require(_0x4b1c('0x3'));var router=express[_0x4b1c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4b1c('0x5'));var config=require(_0x4b1c('0x6'));var controller=require(_0x4b1c('0x7'));router[_0x4b1c('0x8')]('/',auth[_0x4b1c('0x9')](),controller[_0x4b1c('0xa')]);router[_0x4b1c('0x8')](_0x4b1c('0xb'),auth[_0x4b1c('0x9')](),controller[_0x4b1c('0xc')]);router[_0x4b1c('0x8')](_0x4b1c('0xd'),auth['isAuthenticated'](),controller[_0x4b1c('0xe')]);router[_0x4b1c('0xf')]('/',auth['isAuthenticated'](),controller[_0x4b1c('0x10')]);router[_0x4b1c('0x11')](_0x4b1c('0xb'),auth[_0x4b1c('0x9')](),controller[_0x4b1c('0x12')]);router[_0x4b1c('0x13')](_0x4b1c('0xb'),auth[_0x4b1c('0x9')](),controller[_0x4b1c('0x14')]);module[_0x4b1c('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 9b78361..610e8c3 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 _0x48da=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','weeks','days','minutes','csv','xlsx','custom','default','TEXT','sequelize','exports','STRING'];(function(_0x125bad,_0x4bc955){var _0x40e256=function(_0x2449ad){while(--_0x2449ad){_0x125bad['push'](_0x125bad['shift']());}};_0x40e256(++_0x4bc955);}(_0x48da,0x165));var _0xa48d=function(_0x4bb742,_0x4a83e0){_0x4bb742=_0x4bb742-0x0;var _0x34a97f=_0x48da[_0x4bb742];return _0x34a97f;};'use strict';var Sequelize=require(_0xa48d('0x0'));module[_0xa48d('0x1')]={'name':{'type':Sequelize[_0xa48d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa48d('0x2')]},'active':{'type':Sequelize[_0xa48d('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa48d('0x2')],'allowNull':![],'defaultValue':_0xa48d('0x4')},'startAt':{'type':Sequelize[_0xa48d('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xa48d('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa48d('0x6')](_0xa48d('0x7'),_0xa48d('0x8'),_0xa48d('0x9'),_0xa48d('0xa'),_0xa48d('0xb'),'hours',_0xa48d('0xc')),'allowNull':![],'defaultValue':_0xa48d('0xb')},'output':{'type':Sequelize[_0xa48d('0x6')](_0xa48d('0xd'),'pdf',_0xa48d('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xa48d('0x6')](_0xa48d('0xf'),_0xa48d('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xa48d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xa48d('0x2')]},'cc':{'type':Sequelize[_0xa48d('0x11')]},'bcc':{'type':Sequelize[_0xa48d('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xa48d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb671=['sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','minutes','csv','pdf','xlsx','custom','TEXT'];(function(_0x354be4,_0x2ff75c){var _0x804ed9=function(_0x2228f9){while(--_0x2228f9){_0x354be4['push'](_0x354be4['shift']());}};_0x804ed9(++_0x2ff75c);}(_0xb671,0xa2));var _0x1b67=function(_0x585fd0,_0x1ab3b0){_0x585fd0=_0x585fd0-0x0;var _0x1d04fa=_0xb671[_0x585fd0];return _0x1d04fa;};'use strict';var Sequelize=require(_0x1b67('0x0'));module[_0x1b67('0x1')]={'name':{'type':Sequelize[_0x1b67('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1b67('0x2')]},'active':{'type':Sequelize[_0x1b67('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1b67('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x1b67('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1b67('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1b67('0x6')](_0x1b67('0x7'),_0x1b67('0x8'),_0x1b67('0x9'),_0x1b67('0xa'),_0x1b67('0xb'),'hours',_0x1b67('0xc')),'allowNull':![],'defaultValue':_0x1b67('0xb')},'output':{'type':Sequelize[_0x1b67('0x6')](_0x1b67('0xd'),_0x1b67('0xe'),_0x1b67('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x1b67('0x6')](_0x1b67('0x10'),'default'),'allowNull':![],'defaultValue':_0x1b67('0x10')},'sendMail':{'type':Sequelize[_0x1b67('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x1b67('0x2')]},'cc':{'type':Sequelize[_0x1b67('0x11')]},'bcc':{'type':Sequelize[_0x1b67('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x1b67('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index d58c50a..83e1712 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 _0x277b=['fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','get','stack','name','send','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','then','includeAll','include','Schedule','findAll','rows','show','keys','rawAttributes','find','catch','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','params','run','eml-format','rimraf','zip-dir'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x277b,0xff));var _0xb277=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x277b[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require(_0xb277('0x0'));var rimraf=require(_0xb277('0x1'));var zipdir=require(_0xb277('0x2'));var jsonpatch=require(_0xb277('0x3'));var rp=require(_0xb277('0x4'));var moment=require(_0xb277('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb277('0x6'));var path=require(_0xb277('0x7'));var sox=require(_0xb277('0x8'));var csv=require(_0xb277('0x9'));var ejs=require(_0xb277('0xa'));var fs=require('fs');var fs_extra=require(_0xb277('0xb'));var _=require(_0xb277('0xc'));var squel=require('squel');var crypto=require(_0xb277('0xd'));var jsforce=require(_0xb277('0xe'));var deskjs=require(_0xb277('0xf'));var toCsv=require(_0xb277('0x9'));var querystring=require(_0xb277('0x10'));var Papa=require('papaparse');var Redis=require(_0xb277('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb277('0x12'));var as=require(_0xb277('0x13'));var hardwareService=require(_0xb277('0x14'));var logger=require('../../config/logger')(_0xb277('0x15'));var utils=require(_0xb277('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb277('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ae5d1,_0x15af6e){_0x15af6e=_0x15af6e||0xcc;return function(_0x5e8ed3){if(_0x5e8ed3){return _0x4ae5d1[_0xb277('0x18')](_0x15af6e);}return _0x4ae5d1['status'](_0x15af6e)[_0xb277('0x19')]();};}function respondWithResult(_0x3557c2,_0x25ca9b){_0x25ca9b=_0x25ca9b||0xc8;return function(_0x15cb9b){if(_0x15cb9b){return _0x3557c2[_0xb277('0x1a')](_0x25ca9b)[_0xb277('0x1b')](_0x15cb9b);}};}function respondWithFilteredResult(_0x267a7f,_0x2f18a4){return function(_0x279a13){if(_0x279a13){var _0x2e7c25=typeof _0x2f18a4[_0xb277('0x1c')]==='undefined'&&typeof _0x2f18a4[_0xb277('0x1d')]===_0xb277('0x1e');var _0x5a9753=_0x279a13[_0xb277('0x1f')];var _0x1b7c24=_0x2e7c25?0x0:_0x2f18a4['offset'];var _0x4bdcf0=_0x2e7c25?_0x279a13['count']:_0x2f18a4[_0xb277('0x1c')]+_0x2f18a4[_0xb277('0x1d')];var _0x56c73e;if(_0x4bdcf0>=_0x5a9753){_0x4bdcf0=_0x5a9753;_0x56c73e=0xc8;}else{_0x56c73e=0xce;}_0x267a7f[_0xb277('0x1a')](_0x56c73e);return _0x267a7f[_0xb277('0x20')](_0xb277('0x21'),_0x1b7c24+'-'+_0x4bdcf0+'/'+_0x5a9753)[_0xb277('0x1b')](_0x279a13);}return null;};}function patchUpdates(_0x1028d6){return function(_0x8b1963){try{jsonpatch[_0xb277('0x22')](_0x8b1963,_0x1028d6,!![]);}catch(_0x183958){return BPromise[_0xb277('0x23')](_0x183958);}return _0x8b1963['save']();};}function saveUpdates(_0x568400,_0x3d4fcc){return function(_0x1a206b){if(_0x1a206b){return _0x1a206b[_0xb277('0x24')](_0x568400)['then'](function(_0xce96e9){return _0xce96e9;});}return null;};}function removeEntity(_0x11949a,_0xc8c70){return function(_0x30292e){if(_0x30292e){return _0x30292e[_0xb277('0x25')]()['then'](function(){var _0x50e640=_0x30292e[_0xb277('0x26')]({'plain':!![]});var _0x503a07='Scheduler';return db['UserProfileResource'][_0xb277('0x25')]({'where':{'type':_0x503a07,'resourceId':_0x50e640['id']}})['then'](function(){return _0x30292e;});})['then'](function(){_0x11949a[_0xb277('0x1a')](0xcc)[_0xb277('0x19')]();});}};}function handleEntityNotFound(_0x58228e,_0x1eed71){return function(_0x416fd9){if(!_0x416fd9){_0x58228e[_0xb277('0x18')](0x194);}return _0x416fd9;};}function handleError(_0x2c1d05,_0x4c7d48){_0x4c7d48=_0x4c7d48||0x1f4;return function(_0x32197e){logger['error'](_0x32197e[_0xb277('0x27')]);if(_0x32197e[_0xb277('0x28')]){delete _0x32197e['name'];}_0x2c1d05[_0xb277('0x1a')](_0x4c7d48)[_0xb277('0x29')](_0x32197e);};}exports['index']=function(_0xf86520,_0x4f3a18){var _0x2c4c6e={},_0x3e6b6c={},_0x18b427={'count':0x0,'rows':[]};var _0x21ebbe=_['map'](db['Schedule']['rawAttributes'],function(_0x245a59){return{'name':_0x245a59[_0xb277('0x2a')],'type':_0x245a59['type'][_0xb277('0x2b')]};});_0x3e6b6c[_0xb277('0x2c')]=_['map'](_0x21ebbe,_0xb277('0x28'));_0x3e6b6c['query']=_['keys'](_0xf86520[_0xb277('0x2d')]);_0x3e6b6c[_0xb277('0x2e')]=_['intersection'](_0x3e6b6c[_0xb277('0x2c')],_0x3e6b6c[_0xb277('0x2d')]);_0x2c4c6e[_0xb277('0x2f')]=_[_0xb277('0x30')](_0x3e6b6c[_0xb277('0x2c')],qs[_0xb277('0x31')](_0xf86520['query'][_0xb277('0x31')]));_0x2c4c6e[_0xb277('0x2f')]=_0x2c4c6e[_0xb277('0x2f')][_0xb277('0x32')]?_0x2c4c6e[_0xb277('0x2f')]:_0x3e6b6c[_0xb277('0x2c')];if(!_0xf86520[_0xb277('0x2d')][_0xb277('0x33')](_0xb277('0x34'))){_0x2c4c6e['limit']=qs[_0xb277('0x1d')](_0xf86520[_0xb277('0x2d')][_0xb277('0x1d')]);_0x2c4c6e[_0xb277('0x1c')]=qs[_0xb277('0x1c')](_0xf86520[_0xb277('0x2d')][_0xb277('0x1c')]);}_0x2c4c6e[_0xb277('0x35')]=qs[_0xb277('0x36')](_0xf86520['query'][_0xb277('0x36')]);_0x2c4c6e[_0xb277('0x37')]=qs[_0xb277('0x2e')](_[_0xb277('0x38')](_0xf86520[_0xb277('0x2d')],_0x3e6b6c['filters']),_0x21ebbe);if(_0xf86520[_0xb277('0x2d')]['filter']){_0x2c4c6e[_0xb277('0x37')]=_[_0xb277('0x39')](_0x2c4c6e[_0xb277('0x37')],{'$or':_[_0xb277('0x3a')](_0x21ebbe,function(_0x179525){if(_0x179525[_0xb277('0x3b')]!==_0xb277('0x3c')){var _0x1312e8={};_0x1312e8[_0x179525[_0xb277('0x28')]]={'$like':'%'+_0xf86520[_0xb277('0x2d')]['filter']+'%'};return _0x1312e8;}})});}_0x2c4c6e=_['merge']({},_0x2c4c6e,_0xf86520[_0xb277('0x3d')]);var _0x3ec505={'where':_0x2c4c6e[_0xb277('0x37')]};return db['Schedule'][_0xb277('0x1f')](_0x3ec505)[_0xb277('0x3e')](function(_0x466f2f){_0x18b427[_0xb277('0x1f')]=_0x466f2f;if(_0xf86520[_0xb277('0x2d')][_0xb277('0x3f')]){_0x2c4c6e[_0xb277('0x40')]=[{'all':!![]}];}return db[_0xb277('0x41')][_0xb277('0x42')](_0x2c4c6e);})[_0xb277('0x3e')](function(_0x41278e){_0x18b427[_0xb277('0x43')]=_0x41278e;return _0x18b427;})[_0xb277('0x3e')](respondWithFilteredResult(_0x4f3a18,_0x2c4c6e))['catch'](handleError(_0x4f3a18,null));};exports[_0xb277('0x44')]=function(_0x3ec3f1,_0x3fe12d){var _0x35cc09={'raw':![],'where':{'id':_0x3ec3f1['params']['id']}},_0x37d936={};_0x37d936[_0xb277('0x2c')]=_[_0xb277('0x45')](db['Schedule'][_0xb277('0x46')]);_0x37d936[_0xb277('0x2d')]=_[_0xb277('0x45')](_0x3ec3f1[_0xb277('0x2d')]);_0x37d936['filters']=_[_0xb277('0x30')](_0x37d936[_0xb277('0x2c')],_0x37d936[_0xb277('0x2d')]);_0x35cc09[_0xb277('0x2f')]=_[_0xb277('0x30')](_0x37d936['model'],qs[_0xb277('0x31')](_0x3ec3f1[_0xb277('0x2d')][_0xb277('0x31')]));_0x35cc09[_0xb277('0x2f')]=_0x35cc09[_0xb277('0x2f')][_0xb277('0x32')]?_0x35cc09[_0xb277('0x2f')]:_0x37d936[_0xb277('0x2c')];if(_0x3ec3f1[_0xb277('0x2d')]['includeAll']){_0x35cc09[_0xb277('0x40')]=[{'all':!![]}];}_0x35cc09=_[_0xb277('0x39')]({},_0x35cc09,_0x3ec3f1[_0xb277('0x3d')]);return db[_0xb277('0x41')][_0xb277('0x47')](_0x35cc09)['then'](handleEntityNotFound(_0x3fe12d,null))['then'](respondWithResult(_0x3fe12d,null))[_0xb277('0x48')](handleError(_0x3fe12d,null));};exports[_0xb277('0x49')]=function(_0x205c76,_0x5b6515){return db['Schedule']['create'](_0x205c76[_0xb277('0x4a')],{})[_0xb277('0x3e')](function(_0x59726d){var _0x247aaa=_0x205c76[_0xb277('0x4b')][_0xb277('0x26')]({'plain':!![]});if(!_0x247aaa)throw new Error(_0xb277('0x4c'));if(_0x247aaa[_0xb277('0x4d')]===_0xb277('0x4b')){var _0x4bf7be=_0x59726d['get']({'plain':!![]});var _0x201282='Scheduler';return db[_0xb277('0x4e')][_0xb277('0x47')]({'where':{'name':_0x201282,'userProfileId':_0x247aaa[_0xb277('0x4f')]},'raw':!![]})[_0xb277('0x3e')](function(_0x437276){if(_0x437276&&_0x437276[_0xb277('0x50')]===0x0){return db[_0xb277('0x51')][_0xb277('0x49')]({'name':_0x4bf7be[_0xb277('0x28')],'resourceId':_0x4bf7be['id'],'type':_0x437276[_0xb277('0x28')],'sectionId':_0x437276['id']},{})['then'](function(){return _0x59726d;});}else{return _0x59726d;}})['catch'](function(_0x22e45a){logger[_0xb277('0x52')](_0xb277('0x53'),_0x22e45a);throw _0x22e45a;});}return _0x59726d;})[_0xb277('0x3e')](respondWithResult(_0x5b6515,0xc9))[_0xb277('0x48')](handleError(_0x5b6515,null));};exports[_0xb277('0x24')]=function(_0x5edf4e,_0x345841){if(_0x5edf4e[_0xb277('0x4a')]['id']){delete _0x5edf4e[_0xb277('0x4a')]['id'];}return db[_0xb277('0x41')]['find']({'where':{'id':_0x5edf4e[_0xb277('0x54')]['id']}})[_0xb277('0x3e')](handleEntityNotFound(_0x345841,null))['then'](saveUpdates(_0x5edf4e['body'],null))[_0xb277('0x3e')](respondWithResult(_0x345841,null))[_0xb277('0x48')](handleError(_0x345841,null));};exports['destroy']=function(_0x18f41a,_0x2bc205){return db['Schedule']['find']({'where':{'id':_0x18f41a[_0xb277('0x54')]['id']}})[_0xb277('0x3e')](handleEntityNotFound(_0x2bc205,null))[_0xb277('0x3e')](removeEntity(_0x2bc205,null))[_0xb277('0x48')](handleError(_0x2bc205,null));};exports[_0xb277('0x55')]=function(_0x28e523,_0x275184,_0xac1476){var _0x42044f=require('../../config/schedule');return db[_0xb277('0x41')]['find']({'where':{'id':_0x28e523['params']['id']},'raw':!![]})[_0xb277('0x3e')](handleEntityNotFound(_0x275184,null))[_0xb277('0x3e')](function(){_0x42044f[_0xb277('0x55')](_0x28e523[_0xb277('0x54')]['id']);})[_0xb277('0x3e')](respondWithStatusCode(_0x275184,null))[_0xb277('0x48')](handleError(_0x275184,null));}; \ No newline at end of file +var _0xb637=['fields','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','params','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','get','Scheduler','destroy','error','stack','name','send','map','Schedule','fieldName','type','key','query','keys','intersection','model','attributes'];(function(_0x163d10,_0xe50522){var _0x5b7e47=function(_0x262a9c){while(--_0x262a9c){_0x163d10['push'](_0x163d10['shift']());}};_0x5b7e47(++_0xe50522);}(_0xb637,0x70));var _0x7b63=function(_0x28cbd6,_0x22bb6c){_0x28cbd6=_0x28cbd6-0x0;var _0xc7d851=_0xb637[_0x28cbd6];return _0xc7d851;};'use strict';var emlformat=require(_0x7b63('0x0'));var rimraf=require(_0x7b63('0x1'));var zipdir=require(_0x7b63('0x2'));var jsonpatch=require(_0x7b63('0x3'));var rp=require('request-promise');var moment=require(_0x7b63('0x4'));var BPromise=require(_0x7b63('0x5'));var Mustache=require(_0x7b63('0x6'));var util=require('util');var path=require(_0x7b63('0x7'));var sox=require(_0x7b63('0x8'));var csv=require(_0x7b63('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b63('0xa'));var _=require(_0x7b63('0xb'));var squel=require('squel');var crypto=require(_0x7b63('0xc'));var jsforce=require(_0x7b63('0xd'));var deskjs=require(_0x7b63('0xe'));var toCsv=require(_0x7b63('0x9'));var querystring=require(_0x7b63('0xf'));var Papa=require(_0x7b63('0x10'));var Redis=require(_0x7b63('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7b63('0x12'));var as=require(_0x7b63('0x13'));var hardwareService=require(_0x7b63('0x14'));var logger=require(_0x7b63('0x15'))(_0x7b63('0x16'));var utils=require(_0x7b63('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7b63('0x18'));var db=require(_0x7b63('0x19'))['db'];function respondWithStatusCode(_0x319f78,_0x26b37d){_0x26b37d=_0x26b37d||0xcc;return function(_0x58fb3d){if(_0x58fb3d){return _0x319f78[_0x7b63('0x1a')](_0x26b37d);}return _0x319f78[_0x7b63('0x1b')](_0x26b37d)[_0x7b63('0x1c')]();};}function respondWithResult(_0x288f8b,_0x202b89){_0x202b89=_0x202b89||0xc8;return function(_0x29bb3a){if(_0x29bb3a){return _0x288f8b[_0x7b63('0x1b')](_0x202b89)['json'](_0x29bb3a);}};}function respondWithFilteredResult(_0x46a9aa,_0x50af3c){return function(_0x15a133){if(_0x15a133){var _0xc7e334=typeof _0x50af3c[_0x7b63('0x1d')]===_0x7b63('0x1e')&&typeof _0x50af3c[_0x7b63('0x1f')]==='undefined';var _0x2885f6=_0x15a133[_0x7b63('0x20')];var _0x222b5b=_0xc7e334?0x0:_0x50af3c[_0x7b63('0x1d')];var _0x3ee432=_0xc7e334?_0x15a133[_0x7b63('0x20')]:_0x50af3c[_0x7b63('0x1d')]+_0x50af3c['limit'];var _0x4e8aba;if(_0x3ee432>=_0x2885f6){_0x3ee432=_0x2885f6;_0x4e8aba=0xc8;}else{_0x4e8aba=0xce;}_0x46a9aa[_0x7b63('0x1b')](_0x4e8aba);return _0x46a9aa[_0x7b63('0x21')](_0x7b63('0x22'),_0x222b5b+'-'+_0x3ee432+'/'+_0x2885f6)[_0x7b63('0x23')](_0x15a133);}return null;};}function patchUpdates(_0x3fc3c7){return function(_0x4eca16){try{jsonpatch['apply'](_0x4eca16,_0x3fc3c7,!![]);}catch(_0x1d8d86){return BPromise['reject'](_0x1d8d86);}return _0x4eca16[_0x7b63('0x24')]();};}function saveUpdates(_0x377a26,_0x2c291e){return function(_0x31d84f){if(_0x31d84f){return _0x31d84f[_0x7b63('0x25')](_0x377a26)[_0x7b63('0x26')](function(_0x2d8815){return _0x2d8815;});}return null;};}function removeEntity(_0x2b1f9c,_0x40e710){return function(_0xed2734){if(_0xed2734){return _0xed2734['destroy']()['then'](function(){var _0x4436ac=_0xed2734[_0x7b63('0x27')]({'plain':!![]});var _0x5426e9=_0x7b63('0x28');return db['UserProfileResource'][_0x7b63('0x29')]({'where':{'type':_0x5426e9,'resourceId':_0x4436ac['id']}})[_0x7b63('0x26')](function(){return _0xed2734;});})['then'](function(){_0x2b1f9c[_0x7b63('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ef2d,_0x355b3f){return function(_0x52f1b4){if(!_0x52f1b4){_0x13ef2d[_0x7b63('0x1a')](0x194);}return _0x52f1b4;};}function handleError(_0x763f3c,_0x160f4e){_0x160f4e=_0x160f4e||0x1f4;return function(_0x422052){logger[_0x7b63('0x2a')](_0x422052[_0x7b63('0x2b')]);if(_0x422052[_0x7b63('0x2c')]){delete _0x422052[_0x7b63('0x2c')];}_0x763f3c[_0x7b63('0x1b')](_0x160f4e)[_0x7b63('0x2d')](_0x422052);};}exports['index']=function(_0x25356a,_0x3dba3d){var _0x211b3e={},_0x3db25b={},_0x3f4728={'count':0x0,'rows':[]};var _0x2a57e9=_[_0x7b63('0x2e')](db[_0x7b63('0x2f')]['rawAttributes'],function(_0x333182){return{'name':_0x333182[_0x7b63('0x30')],'type':_0x333182[_0x7b63('0x31')][_0x7b63('0x32')]};});_0x3db25b['model']=_[_0x7b63('0x2e')](_0x2a57e9,'name');_0x3db25b[_0x7b63('0x33')]=_[_0x7b63('0x34')](_0x25356a[_0x7b63('0x33')]);_0x3db25b['filters']=_[_0x7b63('0x35')](_0x3db25b[_0x7b63('0x36')],_0x3db25b[_0x7b63('0x33')]);_0x211b3e[_0x7b63('0x37')]=_[_0x7b63('0x35')](_0x3db25b[_0x7b63('0x36')],qs[_0x7b63('0x38')](_0x25356a[_0x7b63('0x33')]['fields']));_0x211b3e[_0x7b63('0x37')]=_0x211b3e[_0x7b63('0x37')][_0x7b63('0x39')]?_0x211b3e[_0x7b63('0x37')]:_0x3db25b['model'];if(!_0x25356a['query']['hasOwnProperty'](_0x7b63('0x3a'))){_0x211b3e['limit']=qs[_0x7b63('0x1f')](_0x25356a[_0x7b63('0x33')][_0x7b63('0x1f')]);_0x211b3e['offset']=qs[_0x7b63('0x1d')](_0x25356a[_0x7b63('0x33')]['offset']);}_0x211b3e[_0x7b63('0x3b')]=qs[_0x7b63('0x3c')](_0x25356a[_0x7b63('0x33')][_0x7b63('0x3c')]);_0x211b3e['where']=qs[_0x7b63('0x3d')](_[_0x7b63('0x3e')](_0x25356a[_0x7b63('0x33')],_0x3db25b[_0x7b63('0x3d')]),_0x2a57e9);if(_0x25356a[_0x7b63('0x33')]['filter']){_0x211b3e[_0x7b63('0x3f')]=_[_0x7b63('0x40')](_0x211b3e[_0x7b63('0x3f')],{'$or':_[_0x7b63('0x2e')](_0x2a57e9,function(_0xb1dc17){if(_0xb1dc17[_0x7b63('0x31')]!==_0x7b63('0x41')){var _0x21d98e={};_0x21d98e[_0xb1dc17[_0x7b63('0x2c')]]={'$like':'%'+_0x25356a[_0x7b63('0x33')][_0x7b63('0x42')]+'%'};return _0x21d98e;}})});}_0x211b3e=_[_0x7b63('0x40')]({},_0x211b3e,_0x25356a['options']);var _0x1bcf3e={'where':_0x211b3e['where']};return db[_0x7b63('0x2f')]['count'](_0x1bcf3e)['then'](function(_0x50fa22){_0x3f4728[_0x7b63('0x20')]=_0x50fa22;if(_0x25356a[_0x7b63('0x33')][_0x7b63('0x43')]){_0x211b3e[_0x7b63('0x44')]=[{'all':!![]}];}return db['Schedule'][_0x7b63('0x45')](_0x211b3e);})[_0x7b63('0x26')](function(_0x1652a3){_0x3f4728[_0x7b63('0x46')]=_0x1652a3;return _0x3f4728;})[_0x7b63('0x26')](respondWithFilteredResult(_0x3dba3d,_0x211b3e))[_0x7b63('0x47')](handleError(_0x3dba3d,null));};exports[_0x7b63('0x48')]=function(_0x21bc85,_0x25b202){var _0x133cd9={'raw':![],'where':{'id':_0x21bc85['params']['id']}},_0x2afbe7={};_0x2afbe7[_0x7b63('0x36')]=_[_0x7b63('0x34')](db[_0x7b63('0x2f')][_0x7b63('0x49')]);_0x2afbe7[_0x7b63('0x33')]=_[_0x7b63('0x34')](_0x21bc85[_0x7b63('0x33')]);_0x2afbe7[_0x7b63('0x3d')]=_[_0x7b63('0x35')](_0x2afbe7['model'],_0x2afbe7[_0x7b63('0x33')]);_0x133cd9[_0x7b63('0x37')]=_['intersection'](_0x2afbe7[_0x7b63('0x36')],qs[_0x7b63('0x38')](_0x21bc85[_0x7b63('0x33')][_0x7b63('0x38')]));_0x133cd9[_0x7b63('0x37')]=_0x133cd9[_0x7b63('0x37')][_0x7b63('0x39')]?_0x133cd9[_0x7b63('0x37')]:_0x2afbe7[_0x7b63('0x36')];if(_0x21bc85['query'][_0x7b63('0x43')]){_0x133cd9[_0x7b63('0x44')]=[{'all':!![]}];}_0x133cd9=_['merge']({},_0x133cd9,_0x21bc85['options']);return db[_0x7b63('0x2f')][_0x7b63('0x4a')](_0x133cd9)[_0x7b63('0x26')](handleEntityNotFound(_0x25b202,null))['then'](respondWithResult(_0x25b202,null))[_0x7b63('0x47')](handleError(_0x25b202,null));};exports[_0x7b63('0x4b')]=function(_0x3532df,_0x21b847){return db[_0x7b63('0x2f')]['create'](_0x3532df['body'],{})[_0x7b63('0x26')](function(_0x2d5a31){var _0x4ab112=_0x3532df[_0x7b63('0x4c')]['get']({'plain':!![]});if(!_0x4ab112)throw new Error(_0x7b63('0x4d'));if(_0x4ab112[_0x7b63('0x4e')]==='user'){var _0x1e6aaa=_0x2d5a31[_0x7b63('0x27')]({'plain':!![]});var _0x413917=_0x7b63('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x413917,'userProfileId':_0x4ab112[_0x7b63('0x4f')]},'raw':!![]})[_0x7b63('0x26')](function(_0x33a0a7){if(_0x33a0a7&&_0x33a0a7[_0x7b63('0x50')]===0x0){return db['UserProfileResource'][_0x7b63('0x4b')]({'name':_0x1e6aaa[_0x7b63('0x2c')],'resourceId':_0x1e6aaa['id'],'type':_0x33a0a7[_0x7b63('0x2c')],'sectionId':_0x33a0a7['id']},{})[_0x7b63('0x26')](function(){return _0x2d5a31;});}else{return _0x2d5a31;}})[_0x7b63('0x47')](function(_0x178d3d){logger[_0x7b63('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x178d3d);throw _0x178d3d;});}return _0x2d5a31;})[_0x7b63('0x26')](respondWithResult(_0x21b847,0xc9))[_0x7b63('0x47')](handleError(_0x21b847,null));};exports[_0x7b63('0x25')]=function(_0x39dcdf,_0x4303d1){if(_0x39dcdf['body']['id']){delete _0x39dcdf[_0x7b63('0x51')]['id'];}return db[_0x7b63('0x2f')][_0x7b63('0x4a')]({'where':{'id':_0x39dcdf['params']['id']}})['then'](handleEntityNotFound(_0x4303d1,null))[_0x7b63('0x26')](saveUpdates(_0x39dcdf['body'],null))[_0x7b63('0x26')](respondWithResult(_0x4303d1,null))['catch'](handleError(_0x4303d1,null));};exports[_0x7b63('0x29')]=function(_0x1ee058,_0x554aa0){return db['Schedule']['find']({'where':{'id':_0x1ee058[_0x7b63('0x52')]['id']}})[_0x7b63('0x26')](handleEntityNotFound(_0x554aa0,null))[_0x7b63('0x26')](removeEntity(_0x554aa0,null))[_0x7b63('0x47')](handleError(_0x554aa0,null));};exports['run']=function(_0x4860ce,_0x54d202,_0x33e043){var _0x1f3068=require(_0x7b63('0x53'));return db['Schedule'][_0x7b63('0x4a')]({'where':{'id':_0x4860ce['params']['id']},'raw':!![]})[_0x7b63('0x26')](handleEntityNotFound(_0x54d202,null))[_0x7b63('0x26')](function(){_0x1f3068['run'](_0x4860ce['params']['id']);})[_0x7b63('0x26')](respondWithStatusCode(_0x54d202,null))[_0x7b63('0x47')](handleError(_0x54d202,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 6d4107e..fcaaa85 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 _0x968f=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules'];(function(_0x26329,_0x4e1b78){var _0xba4aec=function(_0x4275d2){while(--_0x4275d2){_0x26329['push'](_0x26329['shift']());}};_0xba4aec(++_0x4e1b78);}(_0x968f,0x82));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xf968('0x0'));var logger=require(_0xf968('0x1'))('api');var moment=require(_0xf968('0x2'));var BPromise=require(_0xf968('0x3'));var rp=require(_0xf968('0x4'));var fs=require('fs');var path=require(_0xf968('0x5'));var rimraf=require(_0xf968('0x6'));var config=require(_0xf968('0x7'));var attributes=require(_0xf968('0x8'));module[_0xf968('0x9')]=function(_0x5ff813,_0x33eff9){return _0x5ff813[_0xf968('0xa')](_0xf968('0xb'),attributes,{'tableName':_0xf968('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01e5=['tools_schedules','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01e5,0x15d));var _0x501e=function(_0x3e8ee0,_0x5adba1){_0x3e8ee0=_0x3e8ee0-0x0;var _0x17db42=_0x01e5[_0x3e8ee0];return _0x17db42;};'use strict';var _=require(_0x501e('0x0'));var util=require('util');var logger=require(_0x501e('0x1'))(_0x501e('0x2'));var moment=require(_0x501e('0x3'));var BPromise=require('bluebird');var rp=require(_0x501e('0x4'));var fs=require('fs');var path=require(_0x501e('0x5'));var rimraf=require(_0x501e('0x6'));var config=require(_0x501e('0x7'));var attributes=require(_0x501e('0x8'));module['exports']=function(_0x1a12f3,_0x2f3688){return _0x1a12f3[_0x501e('0x9')](_0x501e('0xa'),attributes,{'tableName':_0x501e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 5b39cfc..bcaeacd 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 _0xbba1=['http','request','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2581e4,_0x4e81c9){var _0x14e0de=function(_0x31c094){while(--_0x31c094){_0x2581e4['push'](_0x2581e4['shift']());}};_0x14e0de(++_0x4e81c9);}(_0xbba1,0x7b));var _0x1bba=function(_0x289903,_0xb29f99){_0x289903=_0x289903-0x0;var _0x392d74=_0xbba1[_0x289903];return _0x392d74;};'use strict';var _=require(_0x1bba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1bba('0x1'));var rs=require(_0x1bba('0x2'));var fs=require('fs');var Redis=require(_0x1bba('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1bba('0x4'))(_0x1bba('0x5'));var config=require(_0x1bba('0x6'));var jayson=require(_0x1bba('0x7'));var client=jayson[_0x1bba('0x8')][_0x1bba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212b23,_0x382d1b,_0x2f89c5){return new BPromise(function(_0x3f2775,_0x580b5e){return client[_0x1bba('0xa')](_0x212b23,_0x2f89c5)['then'](function(_0x394b6c){logger[_0x1bba('0xb')]('Schedule,\x20%s,\x20%s',_0x382d1b,'request\x20sent');logger[_0x1bba('0xc')](_0x1bba('0xd'),_0x382d1b,_0x1bba('0xe'),JSON[_0x1bba('0xf')](_0x394b6c));if(_0x394b6c[_0x1bba('0x10')]){if(_0x394b6c[_0x1bba('0x10')][_0x1bba('0x11')]===0x1f4){logger[_0x1bba('0x10')](_0x1bba('0x12'),_0x382d1b,_0x394b6c[_0x1bba('0x10')][_0x1bba('0x13')]);return _0x580b5e(_0x394b6c[_0x1bba('0x10')][_0x1bba('0x13')]);}logger[_0x1bba('0x10')](_0x1bba('0x12'),_0x382d1b,_0x394b6c[_0x1bba('0x10')][_0x1bba('0x13')]);return _0x3f2775(_0x394b6c[_0x1bba('0x10')][_0x1bba('0x13')]);}else{logger[_0x1bba('0xb')]('Schedule,\x20%s,\x20%s',_0x382d1b,_0x1bba('0xe'));_0x3f2775(_0x394b6c[_0x1bba('0x14')][_0x1bba('0x13')]);}})[_0x1bba('0x15')](function(_0x261ae9){logger[_0x1bba('0x10')](_0x1bba('0x12'),_0x382d1b,_0x261ae9);_0x580b5e(_0x261ae9);});});} \ No newline at end of file +var _0xbe46=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x49a612,_0x5692dd){var _0x2489f1=function(_0x4826bb){while(--_0x4826bb){_0x49a612['push'](_0x49a612['shift']());}};_0x2489f1(++_0x5692dd);}(_0xbe46,0x177));var _0x6be4=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xbe46[_0x4dbaad];return _0x226c72;};'use strict';var _=require('lodash');var util=require(_0x6be4('0x0'));var moment=require(_0x6be4('0x1'));var BPromise=require(_0x6be4('0x2'));var rs=require(_0x6be4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6be4('0x4'))['db'];var utils=require(_0x6be4('0x5'));var logger=require('../../config/logger')(_0x6be4('0x6'));var config=require(_0x6be4('0x7'));var jayson=require(_0x6be4('0x8'));var client=jayson[_0x6be4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d1724,_0x1ada89,_0x4f254e){return new BPromise(function(_0x29d11c,_0x5155bb){return client['request'](_0x1d1724,_0x4f254e)[_0x6be4('0xa')](function(_0x4415ec){logger[_0x6be4('0xb')](_0x6be4('0xc'),_0x1ada89,_0x6be4('0xd'));logger[_0x6be4('0xe')](_0x6be4('0xf'),_0x1ada89,'request\x20sent',JSON[_0x6be4('0x10')](_0x4415ec));if(_0x4415ec['error']){if(_0x4415ec[_0x6be4('0x11')][_0x6be4('0x12')]===0x1f4){logger[_0x6be4('0x11')](_0x6be4('0xc'),_0x1ada89,_0x4415ec[_0x6be4('0x11')][_0x6be4('0x13')]);return _0x5155bb(_0x4415ec[_0x6be4('0x11')][_0x6be4('0x13')]);}logger['error'](_0x6be4('0xc'),_0x1ada89,_0x4415ec[_0x6be4('0x11')][_0x6be4('0x13')]);return _0x29d11c(_0x4415ec[_0x6be4('0x11')]['message']);}else{logger[_0x6be4('0xb')](_0x6be4('0xc'),_0x1ada89,'request\x20sent');_0x29d11c(_0x4415ec['result']['message']);}})[_0x6be4('0x14')](function(_0x934a6d){logger[_0x6be4('0x11')](_0x6be4('0xc'),_0x1ada89,_0x934a6d);_0x5155bb(_0x934a6d);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 04e4be2..9f3e9db 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 _0x30b1=['/:id','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id/download','download','put'];(function(_0x26c640,_0x98948f){var _0x4a6348=function(_0x4a18d2){while(--_0x4a18d2){_0x26c640['push'](_0x26c640['shift']());}};_0x4a6348(++_0x98948f);}(_0x30b1,0x1f1));var _0x130b=function(_0x418ad5,_0x33a547){_0x418ad5=_0x418ad5-0x0;var _0x268384=_0x30b1[_0x418ad5];return _0x268384;};'use strict';var multer=require(_0x130b('0x0'));var util=require(_0x130b('0x1'));var path=require(_0x130b('0x2'));var timeout=require(_0x130b('0x3'));var express=require(_0x130b('0x4'));var router=express['Router']();var fs_extra=require(_0x130b('0x5'));var auth=require(_0x130b('0x6'));var interaction=require(_0x130b('0x7'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router['get']('/',auth[_0x130b('0x8')](),controller[_0x130b('0x9')]);router[_0x130b('0xa')](_0x130b('0xb'),auth[_0x130b('0x8')](),controller[_0x130b('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x130b('0xa')](_0x130b('0xd'),auth[_0x130b('0x8')](),controller[_0x130b('0xe')]);router['post']('/',auth[_0x130b('0x8')](),controller['create']);router[_0x130b('0xf')](_0x130b('0x10'),auth[_0x130b('0x8')](),controller[_0x130b('0x11')]);router['delete']('/:id',auth[_0x130b('0x8')](),controller['destroy']);module[_0x130b('0x12')]=router; \ No newline at end of file +var _0xee53=['post','put','update','exports','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','download'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xee53,0x1ea));var _0x3ee5=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xee53[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require('multer');var util=require(_0x3ee5('0x0'));var path=require(_0x3ee5('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ee5('0x2'));var router=express['Router']();var fs_extra=require(_0x3ee5('0x3'));var auth=require(_0x3ee5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3ee5('0x5'));var controller=require(_0x3ee5('0x6'));router[_0x3ee5('0x7')]('/',auth[_0x3ee5('0x8')](),controller['index']);router[_0x3ee5('0x7')](_0x3ee5('0x9'),auth['isAuthenticated'](),controller[_0x3ee5('0xa')]);router[_0x3ee5('0x7')](_0x3ee5('0xb'),auth['isAuthenticated'](),controller[_0x3ee5('0xc')]);router[_0x3ee5('0x7')]('/:id/download',auth[_0x3ee5('0x8')](),controller[_0x3ee5('0xd')]);router[_0x3ee5('0xe')]('/',auth[_0x3ee5('0x8')](),controller['create']);router[_0x3ee5('0xf')](_0x3ee5('0xb'),auth['isAuthenticated'](),controller[_0x3ee5('0x10')]);router['delete']('/:id',auth[_0x3ee5('0x8')](),controller['destroy']);module[_0x3ee5('0x11')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2baddfc..cfce263 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 _0xc893=['format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','path','VIRTUAL','getDataValue','value','extname','STRING','replace','startedAt','subtract','closedAt','setDataValue','duration','DATE'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xc893,0x194));var _0x3c89=function(_0x2b1ede,_0x1304d8){_0x2b1ede=_0x2b1ede-0x0;var _0x291295=_0xc893[_0x2b1ede];return _0x291295;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3c89('0x0'));var path=require(_0x3c89('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x3c89('0x2')],'get':function(){return this[_0x3c89('0x3')](_0x3c89('0x4'))?path[_0x3c89('0x5')](this[_0x3c89('0x3')](_0x3c89('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x3c89('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x3c89('0x6')],'set':function(_0x1a0ec4){var _0x189b7=_0x1a0ec4[_0x3c89('0x7')](/\\/g,'/');this['setDataValue'](_0x3c89('0x4'),_0x189b7);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x3cfe79){this['setDataValue'](_0x3c89('0x8'),moment()[_0x3c89('0x9')](_0x3cfe79,'ms'));this['setDataValue'](_0x3c89('0xa'),moment());this[_0x3c89('0xb')](_0x3c89('0xc'),_0x3cfe79);}},'startedAt':{'type':Sequelize[_0x3c89('0xd')],'get':function(){return moment(this[_0x3c89('0x3')](_0x3c89('0x8')))[_0x3c89('0xe')](_0x3c89('0xf'))[_0x3c89('0x10')]();}},'closedAt':{'type':Sequelize[_0x3c89('0xd')],'get':function(){return moment(this[_0x3c89('0x3')](_0x3c89('0xa')))[_0x3c89('0xe')](_0x3c89('0xf'))['toString']();}},'createdAt':{'type':Sequelize[_0x3c89('0xd')],'get':function(){return moment(this[_0x3c89('0x3')](_0x3c89('0x11')))[_0x3c89('0xe')](_0x3c89('0xf'))[_0x3c89('0x10')]();}},'updatedAt':{'type':Sequelize[_0x3c89('0xd')],'get':function(){return moment(this[_0x3c89('0x3')](_0x3c89('0x12')))[_0x3c89('0xe')](_0x3c89('0xf'))['toString']();}}}; \ No newline at end of file +var _0x672a=['exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','closedAt','sequelize','moment','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x672a,0x122));var _0xa672=function(_0x53e9ca,_0x5dbe10){_0x53e9ca=_0x53e9ca-0x0;var _0x2c0404=_0x672a[_0x53e9ca];return _0x2c0404;};'use strict';var Sequelize=require(_0xa672('0x0'));var moment=require(_0xa672('0x1'));var path=require(_0xa672('0x2'));var config=require(_0xa672('0x3'));module[_0xa672('0x4')]={'format':{'type':Sequelize[_0xa672('0x5')],'get':function(){return this[_0xa672('0x6')](_0xa672('0x7'))?path[_0xa672('0x8')](this[_0xa672('0x6')](_0xa672('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa672('0x9')]},'value':{'type':Sequelize[_0xa672('0x9')],'set':function(_0x3a4797){var _0x33dd0c=_0x3a4797[_0xa672('0xa')](/\\/g,'/');this[_0xa672('0xb')](_0xa672('0x7'),_0x33dd0c);}},'rating':{'type':Sequelize[_0xa672('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa672('0xc')],'set':function(_0x370f20){this[_0xa672('0xb')](_0xa672('0xd'),moment()[_0xa672('0xe')](_0x370f20,'ms'));this[_0xa672('0xb')]('closedAt',moment());this[_0xa672('0xb')](_0xa672('0xf'),_0x370f20);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa672('0x6')](_0xa672('0xd')))[_0xa672('0x10')](_0xa672('0x11'))[_0xa672('0x12')]();}},'closedAt':{'type':Sequelize[_0xa672('0x13')],'get':function(){return moment(this[_0xa672('0x6')](_0xa672('0x14')))[_0xa672('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xa672('0x12')]();}},'createdAt':{'type':Sequelize[_0xa672('0x13')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xa672('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa672('0x6')]('updatedAt'))['format'](_0xa672('0x11'))[_0xa672('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 3567298..5793bf2 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 _0xa41a=['unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','index','map','rawAttributes','type','key','differenceBy','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','params','include','find','catch','create','body','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname'];(function(_0x5cb66d,_0x549ff3){var _0x557c4a=function(_0x268248){while(--_0x268248){_0x5cb66d['push'](_0x5cb66d['shift']());}};_0x557c4a(++_0x549ff3);}(_0xa41a,0x6b));var _0xaa41=function(_0x43f8df,_0x1d6dd0){_0x43f8df=_0x43f8df-0x0;var _0x3d55ef=_0xa41a[_0x43f8df];return _0x3d55ef;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){_0x43a85c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aec5,_0x527cac){return function(_0x493a10){if(!_0x493a10){_0x16aec5[_0xaa41('0x19')](0x194);}return _0x493a10;};}function handleError(_0x59707f,_0x536bed){_0x536bed=_0x536bed||0x1f4;return function(_0x2d0ac0){logger[_0xaa41('0x26')](_0x2d0ac0[_0xaa41('0x27')]);if(_0x2d0ac0[_0xaa41('0x28')]){delete _0x2d0ac0[_0xaa41('0x28')];}_0x59707f[_0xaa41('0x1a')](_0x536bed)['send'](_0x2d0ac0);};}exports[_0xaa41('0x29')]=function(_0x1f0275,_0x63c18c){var _0x9a16e3={},_0x1d8c2b={},_0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=_[_0xaa41('0x2a')](db['ScreenRecording'][_0xaa41('0x2b')],function(_0x48b48b){return{'name':_0x48b48b['fieldName'],'type':_0x48b48b[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x1d8c2b['model']=_[_0xaa41('0x2e')](_[_0xaa41('0x2a')](_0x30f88e,'name'),['format']);_0x1d8c2b['query']=_[_0xaa41('0x2f')](_0x1f0275[_0xaa41('0x30')]);_0x1d8c2b[_0xaa41('0x31')]=_[_0xaa41('0x32')](_0x1d8c2b['model'],_0x1d8c2b[_0xaa41('0x30')]);_0x9a16e3[_0xaa41('0x33')]=_[_0xaa41('0x32')](_0x1d8c2b['model'],qs[_0xaa41('0x34')](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x34')]));_0x9a16e3['attributes']=_0x9a16e3[_0xaa41('0x33')][_0xaa41('0x35')]?_0x9a16e3['attributes']:_0x1d8c2b[_0xaa41('0x36')];if(!_0x1f0275[_0xaa41('0x30')][_0xaa41('0x37')]('nolimit')){_0x9a16e3[_0xaa41('0x1e')]=qs['limit'](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x1e')]);_0x9a16e3[_0xaa41('0x20')]=qs['offset'](_0x1f0275['query']['offset']);}_0x9a16e3[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x39')]);_0x9a16e3['where']=qs['filters'](_[_0xaa41('0x3a')](_0x1f0275[_0xaa41('0x30')],_0x1d8c2b[_0xaa41('0x31')]),_0x30f88e);if(_0x1f0275[_0xaa41('0x30')][_0xaa41('0x3b')]){_0x9a16e3[_0xaa41('0x3c')]=_[_0xaa41('0x3d')](_0x9a16e3['where'],{'$or':_[_0xaa41('0x2a')](_0x30f88e,function(_0x5cf689){if(_0x5cf689[_0xaa41('0x2c')]!==_0xaa41('0x3e')){var _0x57f1bf={};_0x57f1bf[_0x5cf689['name']]={'$like':'%'+_0x1f0275[_0xaa41('0x30')][_0xaa41('0x3b')]+'%'};return _0x57f1bf;}})});}_0x9a16e3=_['merge']({},_0x9a16e3,_0x1f0275[_0xaa41('0x3f')]);var _0x563687={'where':_0x9a16e3[_0xaa41('0x3c')]};return db[_0xaa41('0x40')][_0xaa41('0x1f')](_0x563687)[_0xaa41('0x25')](function(_0x3e6cac){_0x4466a3[_0xaa41('0x1f')]=_0x3e6cac;if(_0x1f0275[_0xaa41('0x30')][_0xaa41('0x41')]){_0x9a16e3['include']=[{'all':!![]}];}return db[_0xaa41('0x40')][_0xaa41('0x42')](_0x9a16e3);})[_0xaa41('0x25')](function(_0x398c35){_0x4466a3[_0xaa41('0x43')]=_0x398c35;return _0x4466a3;})[_0xaa41('0x25')](respondWithFilteredResult(_0x63c18c,_0x9a16e3))['catch'](handleError(_0x63c18c,null));};exports['show']=function(_0x87e2f4,_0x4f9086){var _0x1ed366={'raw':![],'where':{'id':_0x87e2f4[_0xaa41('0x44')]['id']}},_0x215896={};_0x215896[_0xaa41('0x36')]=_[_0xaa41('0x2f')](db[_0xaa41('0x40')][_0xaa41('0x2b')]);_0x215896['query']=_[_0xaa41('0x2f')](_0x87e2f4['query']);_0x215896['filters']=_[_0xaa41('0x32')](_0x215896['model'],_0x215896['query']);_0x1ed366['attributes']=_[_0xaa41('0x32')](_0x215896['model'],qs[_0xaa41('0x34')](_0x87e2f4[_0xaa41('0x30')]['fields']));_0x1ed366['attributes']=_0x1ed366[_0xaa41('0x33')][_0xaa41('0x35')]?_0x1ed366[_0xaa41('0x33')]:_0x215896[_0xaa41('0x36')];if(_0x87e2f4[_0xaa41('0x30')][_0xaa41('0x41')]){_0x1ed366[_0xaa41('0x45')]=[{'all':!![]}];}_0x1ed366=_[_0xaa41('0x3d')]({},_0x1ed366,_0x87e2f4[_0xaa41('0x3f')]);return db['ScreenRecording'][_0xaa41('0x46')](_0x1ed366)[_0xaa41('0x25')](handleEntityNotFound(_0x4f9086,null))[_0xaa41('0x25')](respondWithResult(_0x4f9086,null))[_0xaa41('0x47')](handleError(_0x4f9086,null));};exports[_0xaa41('0x48')]=function(_0x1d6112,_0x538b12){return db[_0xaa41('0x40')][_0xaa41('0x48')](_0x1d6112[_0xaa41('0x49')],{})[_0xaa41('0x25')](respondWithResult(_0x538b12,0xc9))['catch'](handleError(_0x538b12,null));};exports[_0xaa41('0x23')]=function(_0x5787f3,_0x49fedd){if(_0x5787f3[_0xaa41('0x49')]['id']){delete _0x5787f3[_0xaa41('0x49')]['id'];}delete _0x5787f3[_0xaa41('0x49')]['duration'];delete _0x5787f3[_0xaa41('0x49')][_0xaa41('0x4a')];delete _0x5787f3[_0xaa41('0x49')]['closedAt'];delete _0x5787f3[_0xaa41('0x49')][_0xaa41('0x4b')];return db[_0xaa41('0x40')][_0xaa41('0x46')]({'where':{'id':_0x5787f3[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x49fedd,null))[_0xaa41('0x25')](saveUpdates(_0x5787f3[_0xaa41('0x49')],null))['then'](respondWithResult(_0x49fedd,null))[_0xaa41('0x47')](handleError(_0x49fedd,null));};exports['describe']=function(_0x5ae65e,_0x1bdcd6){return db[_0xaa41('0x40')][_0xaa41('0x4c')]()[_0xaa41('0x25')](respondWithResult(_0x1bdcd6,null))[_0xaa41('0x47')](handleError(_0x1bdcd6,null));};exports[_0xaa41('0x4d')]=function(_0x48c4c7,_0x3c5082,_0x519e39){var _0xecb54=require(_0xaa41('0x4e'));var _0x1d518f=![];var _0x4f9e92={};if(_0x48c4c7[_0xaa41('0x30')][_0xaa41('0x2c')]&&_0x48c4c7['query'][_0xaa41('0x2c')]===_0xaa41('0x4f')){_0x4f9e92[_0xaa41('0x4f')]=_0x48c4c7['params']['id'];}else{_0x4f9e92['id']=_0x48c4c7[_0xaa41('0x44')]['id'];}return db[_0xaa41('0x40')]['find']({'where':_0x4f9e92,'attributes':['id','value'],'raw':!![]})[_0xaa41('0x25')](handleEntityNotFound(_0x3c5082,null))[_0xaa41('0x25')](function(_0x3a29d2){if(_0x3a29d2){var _0x4d20c6=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x3a29d2[_0xaa41('0x4b')]);var _0x2abb78=util['format'](_0xaa41('0x53'),_0x4d20c6);if(fs['existsSync'](_0x2abb78)){_0x1d518f=!![];return _0xecb54['decryptFile'](_0x2abb78,_0x4d20c6,config[_0xaa41('0x54')]['recording'])[_0xaa41('0x25')](function(){return _0x3a29d2;});}return _0x3a29d2;}})[_0xaa41('0x25')](function(_0x169ddf){if(_0x169ddf){var _0x5e83e1=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x169ddf[_0xaa41('0x4b')]);if(!fs[_0xaa41('0x55')](_0x5e83e1)){throw new db[(_0xaa41('0x56'))][(_0xaa41('0x57'))](_0xaa41('0x58'));}if(_0x169ddf[_0xaa41('0x59')]){return _0x3c5082['download'](_0x5e83e1,_0x169ddf[_0xaa41('0x59')]+path[_0xaa41('0x5a')](_0x5e83e1),function(){if(_0x1d518f){fs[_0xaa41('0x5b')](_0x5e83e1);}});}else{return _0x3c5082['download'](_0x5e83e1,function(_0x3fe47a){if(_0x1d518f){fs[_0xaa41('0x5b')](_0x5e83e1);}});}}})[_0xaa41('0x47')](function(_0x134579){if(_0x134579[_0xaa41('0x5c')]===_0xaa41('0x58')){_0x3c5082[_0xaa41('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x3c5082,null);}});};exports['destroy']=function(_0x540325,_0x4ec357){return db['ScreenRecording'][_0xaa41('0x46')]({'where':{'id':_0x540325['params']['id']}})['then'](function(_0x24c6f3){if(_[_0xaa41('0x5d')](_0x24c6f3)){throw new ReferenceError(_0xaa41('0x5e'));}return _0x24c6f3;})[_0xaa41('0x25')](function(_0x5cabc4){var _0x244d41=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x5cabc4[_0xaa41('0x4b')]);logger[_0xaa41('0x5f')](_0xaa41('0x60'),_0x244d41);if(!_[_0xaa41('0x5d')](_0x5cabc4[_0xaa41('0x4b')])&&fs['existsSync'](_0x244d41)){logger[_0xaa41('0x5f')](_0xaa41('0x61')+_0x244d41+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x244d41);}_0x244d41=_0x244d41+'.cypher';if(!_[_0xaa41('0x5d')](_0x5cabc4['value'])&&fs[_0xaa41('0x55')](_0x244d41)){logger['info'](_0xaa41('0x61')+_0x244d41+_0xaa41('0x62'));fs['unlinkSync'](_0x244d41);}return _0x5cabc4;})[_0xaa41('0x25')](function(_0x33efc5){if(!_0x33efc5)throw new InternalError();return _0x33efc5[_0xaa41('0x24')]();})[_0xaa41('0x25')](function(){_0x4ec357['status'](0xcc)['end']();})[_0xaa41('0x47')](handleError(_0x4ec357,null));}; \ No newline at end of file +var _0x98a8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','join','server/files/screen_recordings','value','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x4d0741,_0x51e0d2){var _0x381311=function(_0x2bcfed){while(--_0x2bcfed){_0x4d0741['push'](_0x4d0741['shift']());}};_0x381311(++_0x51e0d2);}(_0x98a8,0x12c));var _0x898a=function(_0x49890c,_0x3e8740){_0x49890c=_0x49890c-0x0;var _0x38292b=_0x98a8[_0x49890c];return _0x38292b;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x1426e3,_0x5b7719){return function(_0x20bde0){if(!_0x20bde0){_0x1426e3['sendStatus'](0x194);}return _0x20bde0;};}function handleError(_0x513c6b,_0x53ddb2){_0x53ddb2=_0x53ddb2||0x1f4;return function(_0x3678be){logger[_0x898a('0x25')](_0x3678be[_0x898a('0x26')]);if(_0x3678be[_0x898a('0x27')]){delete _0x3678be[_0x898a('0x27')];}_0x513c6b[_0x898a('0x1a')](_0x53ddb2)[_0x898a('0x28')](_0x3678be);};}exports[_0x898a('0x29')]=function(_0xd31922,_0x58149d){var _0x4b3e68={},_0x47f1ed={},_0xe9c33d={'count':0x0,'rows':[]};var _0x62fe93=_[_0x898a('0x2a')](db[_0x898a('0x2b')][_0x898a('0x2c')],function(_0x560000){return{'name':_0x560000[_0x898a('0x2d')],'type':_0x560000[_0x898a('0x2e')][_0x898a('0x2f')]};});_0x47f1ed[_0x898a('0x30')]=_[_0x898a('0x31')](_[_0x898a('0x2a')](_0x62fe93,'name'),[_0x898a('0x32')]);_0x47f1ed[_0x898a('0x33')]=_[_0x898a('0x34')](_0xd31922[_0x898a('0x33')]);_0x47f1ed[_0x898a('0x35')]=_['intersection'](_0x47f1ed['model'],_0x47f1ed[_0x898a('0x33')]);_0x4b3e68[_0x898a('0x36')]=_[_0x898a('0x37')](_0x47f1ed['model'],qs[_0x898a('0x38')](_0xd31922[_0x898a('0x33')][_0x898a('0x38')]));_0x4b3e68[_0x898a('0x36')]=_0x4b3e68[_0x898a('0x36')][_0x898a('0x39')]?_0x4b3e68[_0x898a('0x36')]:_0x47f1ed[_0x898a('0x30')];if(!_0xd31922['query'][_0x898a('0x3a')]('nolimit')){_0x4b3e68['limit']=qs[_0x898a('0x3b')](_0xd31922['query'][_0x898a('0x3b')]);_0x4b3e68['offset']=qs[_0x898a('0x1e')](_0xd31922['query'][_0x898a('0x1e')]);}_0x4b3e68[_0x898a('0x3c')]=qs[_0x898a('0x3d')](_0xd31922['query']['sort']);_0x4b3e68['where']=qs[_0x898a('0x35')](_[_0x898a('0x3e')](_0xd31922['query'],_0x47f1ed[_0x898a('0x35')]),_0x62fe93);if(_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]){_0x4b3e68[_0x898a('0x40')]=_['merge'](_0x4b3e68['where'],{'$or':_[_0x898a('0x2a')](_0x62fe93,function(_0x454c8c){if(_0x454c8c['type']!=='VIRTUAL'){var _0x168f92={};_0x168f92[_0x454c8c[_0x898a('0x27')]]={'$like':'%'+_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]+'%'};return _0x168f92;}})});}_0x4b3e68=_['merge']({},_0x4b3e68,_0xd31922[_0x898a('0x41')]);var _0x369c02={'where':_0x4b3e68['where']};return db['ScreenRecording']['count'](_0x369c02)[_0x898a('0x23')](function(_0x477a9d){_0xe9c33d[_0x898a('0x1d')]=_0x477a9d;if(_0xd31922[_0x898a('0x33')][_0x898a('0x42')]){_0x4b3e68[_0x898a('0x43')]=[{'all':!![]}];}return db[_0x898a('0x2b')][_0x898a('0x44')](_0x4b3e68);})[_0x898a('0x23')](function(_0x235fcf){_0xe9c33d[_0x898a('0x45')]=_0x235fcf;return _0xe9c33d;})[_0x898a('0x23')](respondWithFilteredResult(_0x58149d,_0x4b3e68))[_0x898a('0x46')](handleError(_0x58149d,null));};exports[_0x898a('0x47')]=function(_0x21f307,_0x4c8628){var _0x26ad34={'raw':![],'where':{'id':_0x21f307[_0x898a('0x48')]['id']}},_0x11c437={};_0x11c437['model']=_[_0x898a('0x34')](db[_0x898a('0x2b')][_0x898a('0x2c')]);_0x11c437[_0x898a('0x33')]=_[_0x898a('0x34')](_0x21f307[_0x898a('0x33')]);_0x11c437[_0x898a('0x35')]=_[_0x898a('0x37')](_0x11c437['model'],_0x11c437[_0x898a('0x33')]);_0x26ad34[_0x898a('0x36')]=_[_0x898a('0x37')](_0x11c437[_0x898a('0x30')],qs['fields'](_0x21f307[_0x898a('0x33')][_0x898a('0x38')]));_0x26ad34['attributes']=_0x26ad34[_0x898a('0x36')]['length']?_0x26ad34[_0x898a('0x36')]:_0x11c437['model'];if(_0x21f307['query'][_0x898a('0x42')]){_0x26ad34['include']=[{'all':!![]}];}_0x26ad34=_[_0x898a('0x49')]({},_0x26ad34,_0x21f307[_0x898a('0x41')]);return db['ScreenRecording'][_0x898a('0x4a')](_0x26ad34)[_0x898a('0x23')](handleEntityNotFound(_0x4c8628,null))['then'](respondWithResult(_0x4c8628,null))[_0x898a('0x46')](handleError(_0x4c8628,null));};exports[_0x898a('0x4b')]=function(_0x11a0a3,_0x118240){return db['ScreenRecording'][_0x898a('0x4b')](_0x11a0a3[_0x898a('0x4c')],{})['then'](respondWithResult(_0x118240,0xc9))[_0x898a('0x46')](handleError(_0x118240,null));};exports[_0x898a('0x22')]=function(_0x4ab441,_0x28525b){if(_0x4ab441['body']['id']){delete _0x4ab441[_0x898a('0x4c')]['id'];}delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4d')];delete _0x4ab441['body'][_0x898a('0x4e')];delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4f')];delete _0x4ab441[_0x898a('0x4c')]['value'];return db[_0x898a('0x2b')]['find']({'where':{'id':_0x4ab441[_0x898a('0x48')]['id']}})[_0x898a('0x23')](handleEntityNotFound(_0x28525b,null))[_0x898a('0x23')](saveUpdates(_0x4ab441['body'],null))[_0x898a('0x23')](respondWithResult(_0x28525b,null))[_0x898a('0x46')](handleError(_0x28525b,null));};exports[_0x898a('0x50')]=function(_0x5d325a,_0x52f8c6){return db[_0x898a('0x2b')][_0x898a('0x50')]()[_0x898a('0x23')](respondWithResult(_0x52f8c6,null))[_0x898a('0x46')](handleError(_0x52f8c6,null));};exports[_0x898a('0x51')]=function(_0x36b63a,_0x369f33,_0x6c0f07){var _0x289167=require(_0x898a('0x52'));var _0x2382a9=![];var _0x5e9329={};if(_0x36b63a[_0x898a('0x33')][_0x898a('0x2e')]&&_0x36b63a['query'][_0x898a('0x2e')]==='uniqueid'){_0x5e9329['uniqueid']=_0x36b63a[_0x898a('0x48')]['id'];}else{_0x5e9329['id']=_0x36b63a[_0x898a('0x48')]['id'];}return db[_0x898a('0x2b')]['find']({'where':_0x5e9329,'attributes':['id','value'],'raw':!![]})[_0x898a('0x23')](handleEntityNotFound(_0x369f33,null))[_0x898a('0x23')](function(_0x515725){if(_0x515725){var _0xaa96f7=path[_0x898a('0x53')](config['root'],_0x898a('0x54'),_0x515725[_0x898a('0x55')]);var _0x3122cc=util['format'](_0x898a('0x56'),_0xaa96f7);if(fs[_0x898a('0x57')](_0x3122cc)){_0x2382a9=!![];return _0x289167[_0x898a('0x58')](_0x3122cc,_0xaa96f7,config[_0x898a('0x59')][_0x898a('0x5a')])[_0x898a('0x23')](function(){return _0x515725;});}return _0x515725;}})['then'](function(_0x22a08a){if(_0x22a08a){var _0x4df5f0=path[_0x898a('0x53')](config[_0x898a('0x5b')],_0x898a('0x54'),_0x22a08a[_0x898a('0x55')]);if(!fs[_0x898a('0x57')](_0x4df5f0)){throw new db[(_0x898a('0x5c'))][(_0x898a('0x5d'))](_0x898a('0x5e'));}if(_0x22a08a[_0x898a('0x5f')]){return _0x369f33['download'](_0x4df5f0,_0x22a08a[_0x898a('0x5f')]+path[_0x898a('0x60')](_0x4df5f0),function(){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}else{return _0x369f33[_0x898a('0x51')](_0x4df5f0,function(_0x219976){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}}})[_0x898a('0x46')](function(_0x68fd81){if(_0x68fd81[_0x898a('0x62')]===_0x898a('0x5e')){_0x369f33[_0x898a('0x1a')](0x194)[_0x898a('0x28')](_0x898a('0x63'));}else{return handleError(_0x369f33,null);}});};exports[_0x898a('0x24')]=function(_0x22f9ba,_0x5f42ae){return db[_0x898a('0x2b')][_0x898a('0x4a')]({'where':{'id':_0x22f9ba['params']['id']}})[_0x898a('0x23')](function(_0x4583a1){if(_['isNil'](_0x4583a1)){throw new ReferenceError(_0x898a('0x64'));}return _0x4583a1;})[_0x898a('0x23')](function(_0x21f0f8){var _0x1f3f5b=path['join'](config[_0x898a('0x5b')],_0x898a('0x54'),_0x21f0f8[_0x898a('0x55')]);logger[_0x898a('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x1f3f5b);if(!_[_0x898a('0x66')](_0x21f0f8[_0x898a('0x55')])&&fs['existsSync'](_0x1f3f5b)){logger[_0x898a('0x65')](_0x898a('0x67')+_0x1f3f5b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x898a('0x68')](_0x1f3f5b);}_0x1f3f5b=_0x1f3f5b+'.cypher';if(!_[_0x898a('0x66')](_0x21f0f8['value'])&&fs['existsSync'](_0x1f3f5b)){logger['info'](_0x898a('0x67')+_0x1f3f5b+_0x898a('0x69'));fs[_0x898a('0x68')](_0x1f3f5b);}return _0x21f0f8;})[_0x898a('0x23')](function(_0x5e0535){if(!_0x5e0535)throw new InternalError();return _0x5e0535['destroy']();})[_0x898a('0x23')](function(){_0x5f42ae[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();})[_0x898a('0x46')](handleError(_0x5f42ae,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 1ed261b..f328512 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 _0x4168=['ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4168,0x8a));var _0x8416=function(_0x251fc2,_0x1339df){_0x251fc2=_0x251fc2-0x0;var _0x5e95cc=_0x4168[_0x251fc2];return _0x5e95cc;};'use strict';var _=require(_0x8416('0x0'));var util=require('util');var logger=require(_0x8416('0x1'))(_0x8416('0x2'));var moment=require(_0x8416('0x3'));var BPromise=require(_0x8416('0x4'));var rp=require(_0x8416('0x5'));var fs=require('fs');var path=require(_0x8416('0x6'));var rimraf=require(_0x8416('0x7'));var config=require(_0x8416('0x8'));var attributes=require(_0x8416('0x9'));module[_0x8416('0xa')]=function(_0x172608,_0x33aee5){return _0x172608[_0x8416('0xb')](_0x8416('0xc'),attributes,{'tableName':_0x8416('0xd'),'paranoid':![],'indexes':[{'name':_0x8416('0xe'),'fields':[_0x8416('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x89e0=['screen_recordings','interactionid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x2f1b59,_0x5a9460){var _0x5a659c=function(_0x266808){while(--_0x266808){_0x2f1b59['push'](_0x2f1b59['shift']());}};_0x5a659c(++_0x5a9460);}(_0x89e0,0x9e));var _0x089e=function(_0x6be757,_0x24affc){_0x6be757=_0x6be757-0x0;var _0x9b95aa=_0x89e0[_0x6be757];return _0x9b95aa;};'use strict';var _=require('lodash');var util=require(_0x089e('0x0'));var logger=require(_0x089e('0x1'))(_0x089e('0x2'));var moment=require(_0x089e('0x3'));var BPromise=require('bluebird');var rp=require(_0x089e('0x4'));var fs=require('fs');var path=require(_0x089e('0x5'));var rimraf=require(_0x089e('0x6'));var config=require(_0x089e('0x7'));var attributes=require(_0x089e('0x8'));module[_0x089e('0x9')]=function(_0x35450d,_0xc98b95){return _0x35450d[_0x089e('0xa')]('ScreenRecording',attributes,{'tableName':_0x089e('0xb'),'paranoid':![],'indexes':[{'name':_0x089e('0xc'),'fields':[_0x089e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index fe91249..01dc0ca 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 _0xc350=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','stringify','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash'];(function(_0x1e9821,_0x401cc9){var _0x23ec6d=function(_0x36af78){while(--_0x36af78){_0x1e9821['push'](_0x1e9821['shift']());}};_0x23ec6d(++_0x401cc9);}(_0xc350,0xe6));var _0x0c35=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0xc350[_0x1fcaf1];return _0x55f464;};'use strict';var _=require(_0x0c35('0x0'));var util=require(_0x0c35('0x1'));var moment=require(_0x0c35('0x2'));var BPromise=require(_0x0c35('0x3'));var rs=require(_0x0c35('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0c35('0x5'));var logger=require(_0x0c35('0x6'))(_0x0c35('0x7'));var config=require(_0x0c35('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0c35('0x9')][_0x0c35('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f0f32,_0x547d5e,_0x25e27e){return new BPromise(function(_0x2acf2e,_0x4bc75f){return client[_0x0c35('0xb')](_0x1f0f32,_0x25e27e)['then'](function(_0x385019){logger[_0x0c35('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x547d5e,_0x0c35('0xd'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x547d5e,_0x0c35('0xd'),JSON[_0x0c35('0xe')](_0x385019));if(_0x385019['error']){if(_0x385019[_0x0c35('0xf')][_0x0c35('0x10')]===0x1f4){logger[_0x0c35('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x547d5e,_0x385019[_0x0c35('0xf')][_0x0c35('0x11')]);return _0x4bc75f(_0x385019[_0x0c35('0xf')][_0x0c35('0x11')]);}logger[_0x0c35('0xf')](_0x0c35('0x12'),_0x547d5e,_0x385019[_0x0c35('0xf')][_0x0c35('0x11')]);return _0x2acf2e(_0x385019[_0x0c35('0xf')][_0x0c35('0x11')]);}else{logger['info'](_0x0c35('0x12'),_0x547d5e,_0x0c35('0xd'));_0x2acf2e(_0x385019[_0x0c35('0x13')][_0x0c35('0x11')]);}})[_0x0c35('0x14')](function(_0x59bd1f){logger[_0x0c35('0xf')](_0x0c35('0x12'),_0x547d5e,_0x59bd1f);_0x4bc75f(_0x59bd1f);});});} \ No newline at end of file +var _0x70ce=['error','message','ScreenRecording,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x431488,_0x37f9d5){var _0x9ce3d1=function(_0x228d1a){while(--_0x228d1a){_0x431488['push'](_0x431488['shift']());}};_0x9ce3d1(++_0x37f9d5);}(_0x70ce,0x16c));var _0xe70c=function(_0x275983,_0x2e8bb0){_0x275983=_0x275983-0x0;var _0x234332=_0x70ce[_0x275983];return _0x234332;};'use strict';var _=require(_0xe70c('0x0'));var util=require(_0xe70c('0x1'));var moment=require(_0xe70c('0x2'));var BPromise=require(_0xe70c('0x3'));var rs=require(_0xe70c('0x4'));var fs=require('fs');var Redis=require(_0xe70c('0x5'));var db=require(_0xe70c('0x6'))['db'];var utils=require(_0xe70c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe70c('0x8'));var jayson=require(_0xe70c('0x9'));var client=jayson['client'][_0xe70c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ed7f7,_0x41f2c0,_0x2be15b){return new BPromise(function(_0x517a9b,_0x2e391c){return client['request'](_0x4ed7f7,_0x2be15b)[_0xe70c('0xb')](function(_0x4a6964){logger[_0xe70c('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x41f2c0,_0xe70c('0xd'));logger['debug'](_0xe70c('0xe'),_0x41f2c0,'request\x20sent',JSON[_0xe70c('0xf')](_0x4a6964));if(_0x4a6964[_0xe70c('0x10')]){if(_0x4a6964[_0xe70c('0x10')]['code']===0x1f4){logger[_0xe70c('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x41f2c0,_0x4a6964[_0xe70c('0x10')][_0xe70c('0x11')]);return _0x2e391c(_0x4a6964[_0xe70c('0x10')][_0xe70c('0x11')]);}logger[_0xe70c('0x10')](_0xe70c('0x12'),_0x41f2c0,_0x4a6964['error'][_0xe70c('0x11')]);return _0x517a9b(_0x4a6964['error'][_0xe70c('0x11')]);}else{logger[_0xe70c('0xc')](_0xe70c('0x12'),_0x41f2c0,'request\x20sent');_0x517a9b(_0x4a6964['result'][_0xe70c('0x11')]);}})[_0xe70c('0x13')](function(_0x5d6333){logger[_0xe70c('0x10')](_0xe70c('0x12'),_0x41f2c0,_0x5d6333);_0x2e391c(_0x5d6333);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 5d9b6db..d234047 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 _0x1e4e=['server/files/images/logos/','format','logo','extname','originalname','single','file','diskStorage','join','%s%s','logologin','addLogoLogin','post','addPreferred','/:id/favicon','put','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','root'];(function(_0x4624d9,_0x2fb5a4){var _0x4471fe=function(_0x471fe3){while(--_0x471fe3){_0x4624d9['push'](_0x4624d9['shift']());}};_0x4471fe(++_0x2fb5a4);}(_0x1e4e,0x79));var _0xe1e4=function(_0x596338,_0x2a667b){_0x596338=_0x596338-0x0;var _0x4448b6=_0x1e4e[_0x596338];return _0x4448b6;};'use strict';var multer=require(_0xe1e4('0x0'));var util=require(_0xe1e4('0x1'));var path=require(_0xe1e4('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1e4('0x3'));var router=express[_0xe1e4('0x4')]();var fs_extra=require(_0xe1e4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe1e4('0x6'));var config=require(_0xe1e4('0x7'));var controller=require(_0xe1e4('0x8'));router[_0xe1e4('0x9')]('/',auth[_0xe1e4('0xa')](),controller['index']);router['get'](_0xe1e4('0xb'),controller['getDate']);router[_0xe1e4('0x9')]('/:id',controller[_0xe1e4('0xc')]);router['get'](_0xe1e4('0xd'),controller['getLogo']);router[_0xe1e4('0x9')](_0xe1e4('0xe'),controller[_0xe1e4('0xf')]);router[_0xe1e4('0x9')]('/:id/gdpr',controller[_0xe1e4('0x10')]);router[_0xe1e4('0x9')](_0xe1e4('0x11'),controller['getPreferred']);router['get']('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f5cb9,_0x3da04d,_0x181729){_0x181729(null,path['join'](config[_0xe1e4('0x12')],_0xe1e4('0x13')));},'filename':function(_0xc5001e,_0x2755b4,_0x54709d){_0x54709d(null,util[_0xe1e4('0x14')]('%s%s',_0xe1e4('0x15'),path[_0xe1e4('0x16')](_0x2755b4[_0xe1e4('0x17')])));}})});router['post'](_0xe1e4('0xd'),upload[_0xe1e4('0x18')](_0xe1e4('0x19')),controller['addLogo']);var upload=multer({'storage':multer[_0xe1e4('0x1a')]({'destination':function(_0x41bb1f,_0x353ea2,_0x5c3b24){_0x5c3b24(null,path[_0xe1e4('0x1b')](config[_0xe1e4('0x12')],'server/files/images/logos/'));},'filename':function(_0xd67e02,_0x73cb3b,_0x1d8985){_0x1d8985(null,util['format'](_0xe1e4('0x1c'),_0xe1e4('0x1d'),path[_0xe1e4('0x16')](_0x73cb3b['originalname'])));}})});router['post'](_0xe1e4('0xe'),upload['single'](_0xe1e4('0x19')),controller[_0xe1e4('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x41bd28,_0xdc18ce,_0x5a5c1e){_0x5a5c1e(null,path['join'](config[_0xe1e4('0x12')],_0xe1e4('0x13')));},'filename':function(_0x1e167f,_0x4e1c86,_0x4bf2ad){_0x4bf2ad(null,util[_0xe1e4('0x14')](_0xe1e4('0x1c'),'preferred',path[_0xe1e4('0x16')](_0x4e1c86['originalname'])));}})});router[_0xe1e4('0x1f')](_0xe1e4('0x11'),upload['single'](_0xe1e4('0x19')),controller[_0xe1e4('0x20')]);var upload=multer({'storage':multer[_0xe1e4('0x1a')]({'destination':function(_0x25fd2f,_0x477c76,_0x124b07){_0x124b07(null,path[_0xe1e4('0x1b')](config[_0xe1e4('0x12')],_0xe1e4('0x13')));},'filename':function(_0x6cf68a,_0x4cf728,_0x1c18ca){_0x1c18ca(null,util[_0xe1e4('0x14')](_0xe1e4('0x1c'),'favicon',path[_0xe1e4('0x16')](_0x4cf728[_0xe1e4('0x17')])));}})});router[_0xe1e4('0x1f')](_0xe1e4('0x21'),upload[_0xe1e4('0x18')](_0xe1e4('0x19')),controller['addFavicon']);router[_0xe1e4('0x22')]('/:id',auth[_0xe1e4('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xe98d=['diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','/:id/logo','single','file','addLogo','%s%s','extname','preferred','favicon','addFavicon','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/now','getDate','get','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon'];(function(_0x5d3376,_0x5c7ac5){var _0xc4d2b8=function(_0x4a5b08){while(--_0x4a5b08){_0x5d3376['push'](_0x5d3376['shift']());}};_0xc4d2b8(++_0x5c7ac5);}(_0xe98d,0x72));var _0xde98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xde98('0x0'));var util=require(_0xde98('0x1'));var path=require(_0xde98('0x2'));var timeout=require(_0xde98('0x3'));var express=require(_0xde98('0x4'));var router=express[_0xde98('0x5')]();var fs_extra=require(_0xde98('0x6'));var auth=require(_0xde98('0x7'));var interaction=require(_0xde98('0x8'));var config=require(_0xde98('0x9'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xde98('0xa')]);router['get'](_0xde98('0xb'),controller[_0xde98('0xc')]);router[_0xde98('0xd')]('/:id',controller[_0xde98('0xe')]);router['get']('/:id/logo',controller[_0xde98('0xf')]);router[_0xde98('0xd')](_0xde98('0x10'),controller[_0xde98('0x11')]);router[_0xde98('0xd')](_0xde98('0x12'),controller[_0xde98('0x13')]);router[_0xde98('0xd')](_0xde98('0x14'),controller[_0xde98('0x15')]);router[_0xde98('0xd')](_0xde98('0x16'),controller[_0xde98('0x17')]);var upload=multer({'storage':multer[_0xde98('0x18')]({'destination':function(_0x44ed37,_0x1002fd,_0x6a1e61){_0x6a1e61(null,path[_0xde98('0x19')](config[_0xde98('0x1a')],_0xde98('0x1b')));},'filename':function(_0xb32683,_0x1ab586,_0x5b49e1){_0x5b49e1(null,util[_0xde98('0x1c')]('%s%s',_0xde98('0x1d'),path['extname'](_0x1ab586[_0xde98('0x1e')])));}})});router[_0xde98('0x1f')](_0xde98('0x20'),upload[_0xde98('0x21')](_0xde98('0x22')),controller[_0xde98('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb185c,_0x46b9f2,_0x1e691e){_0x1e691e(null,path[_0xde98('0x19')](config['root'],_0xde98('0x1b')));},'filename':function(_0x219e57,_0xa54bd8,_0x4029e2){_0x4029e2(null,util[_0xde98('0x1c')](_0xde98('0x24'),'logologin',path[_0xde98('0x25')](_0xa54bd8[_0xde98('0x1e')])));}})});router[_0xde98('0x1f')](_0xde98('0x10'),upload[_0xde98('0x21')](_0xde98('0x22')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xde98('0x18')]({'destination':function(_0x147784,_0x7af350,_0x5791c0){_0x5791c0(null,path[_0xde98('0x19')](config[_0xde98('0x1a')],'server/files/images/logos/'));},'filename':function(_0x7a45e1,_0x532f43,_0x260501){_0x260501(null,util[_0xde98('0x1c')](_0xde98('0x24'),_0xde98('0x26'),path['extname'](_0x532f43['originalname'])));}})});router[_0xde98('0x1f')](_0xde98('0x14'),upload[_0xde98('0x21')](_0xde98('0x22')),controller['addPreferred']);var upload=multer({'storage':multer[_0xde98('0x18')]({'destination':function(_0x23f389,_0xc142f4,_0x111ca2){_0x111ca2(null,path[_0xde98('0x19')](config['root'],'server/files/images/logos/'));},'filename':function(_0x297215,_0x217870,_0x5b3e04){_0x5b3e04(null,util['format']('%s%s',_0xde98('0x27'),path[_0xde98('0x25')](_0x217870['originalname'])));}})});router['post'](_0xde98('0x16'),upload[_0xde98('0x21')](_0xde98('0x22')),controller[_0xde98('0x28')]);router[_0xde98('0x29')](_0xde98('0x2a'),auth[_0xde98('0x2b')](),controller[_0xde98('0x2c')]);module[_0xde98('0x2d')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 75f0273..010014c 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 _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0xdc5838,_0x24a88a){var _0x945910=function(_0x2786cf){while(--_0x2786cf){_0xdc5838['push'](_0xdc5838['shift']());}};_0x945910(++_0x24a88a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x1155a9,_0x370456){var _0x35ac41=function(_0x5a6298){while(--_0x5a6298){_0x1155a9['push'](_0x1155a9['shift']());}};_0x35ac41(++_0x370456);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index ddfdee6..061ee6c 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 _0xfab5=['logo','addLogoLogin','loginLogo','params','../../config/license/util','getLicense','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','default','custom','default_logo.svg','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','preferred','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','Sequelize','ValidationError','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','options','find','body','addLogo','file','filename'];(function(_0xa3e96b,_0x5ed1d1){var _0x5f53ec=function(_0x30fa93){while(--_0x30fa93){_0xa3e96b['push'](_0xa3e96b['shift']());}};_0x5f53ec(++_0x5ed1d1);}(_0xfab5,0x199));var _0x5fab=function(_0x46314f,_0x4332dd){_0x46314f=_0x46314f-0x0;var _0x5a1f0c=_0xfab5[_0x46314f];return _0x5a1f0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fab('0x0'));var zipdir=require(_0x5fab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fab('0x2'));var moment=require(_0x5fab('0x3'));var BPromise=require(_0x5fab('0x4'));var Mustache=require(_0x5fab('0x5'));var util=require(_0x5fab('0x6'));var path=require(_0x5fab('0x7'));var sox=require('sox');var csv=require(_0x5fab('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fab('0x9'));var squel=require(_0x5fab('0xa'));var crypto=require(_0x5fab('0xb'));var jsforce=require(_0x5fab('0xc'));var deskjs=require(_0x5fab('0xd'));var toCsv=require(_0x5fab('0x8'));var querystring=require(_0x5fab('0xe'));var Papa=require('papaparse');var Redis=require(_0x5fab('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5fab('0x10'));var as=require(_0x5fab('0x11'));var hardwareService=require(_0x5fab('0x12'));var logger=require(_0x5fab('0x13'))('api');var utils=require(_0x5fab('0x14'));var config=require(_0x5fab('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5fab('0x16'))['db'];var jayson=require(_0x5fab('0x17'));var client=jayson[_0x5fab('0x18')][_0x5fab('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4dd4f1,_0x19eb8d,_0x3b2cde,_0xad4627){return new BPromise(function(_0xab89ae,_0x2f941b){var _0x1bfcc2=_0xad4627||client;return _0x1bfcc2[_0x5fab('0x1a')](_0x4dd4f1,_0x3b2cde)[_0x5fab('0x1b')](function(_0x39c115){logger[_0x5fab('0x1c')](_0x5fab('0x1d'),_0x19eb8d,_0x5fab('0x1e'));logger['debug'](_0x5fab('0x1f'),_0x19eb8d,_0x5fab('0x1e'),JSON[_0x5fab('0x20')](_0x39c115));if(_0x39c115[_0x5fab('0x21')]){if(_0x39c115[_0x5fab('0x21')][_0x5fab('0x22')]===0x1f4){logger[_0x5fab('0x21')](_0x5fab('0x1d'),_0x19eb8d,_0x39c115['error'][_0x5fab('0x23')]);return _0x2f941b(_0x39c115[_0x5fab('0x21')]['message']);}logger[_0x5fab('0x21')](_0x5fab('0x1d'),_0x19eb8d,_0x39c115[_0x5fab('0x21')]['message']);return _0xab89ae(_0x39c115[_0x5fab('0x21')]['message']);}else{logger[_0x5fab('0x1c')](_0x5fab('0x1d'),_0x19eb8d,'request\x20sent');_0xab89ae(_0x39c115[_0x5fab('0x24')][_0x5fab('0x23')]);}})[_0x5fab('0x25')](function(_0x3f4839){logger['error'](_0x5fab('0x1d'),_0x19eb8d,_0x3f4839);_0x2f941b(_0x3f4839);});});}function respondWithStatusCode(_0x401e5e,_0xf0b336){_0xf0b336=_0xf0b336||0xcc;return function(_0x25c13e){if(_0x25c13e){return _0x401e5e[_0x5fab('0x26')](_0xf0b336);}return _0x401e5e[_0x5fab('0x27')](_0xf0b336)['end']();};}function respondWithResult(_0x55dd1f,_0x1d87aa){_0x1d87aa=_0x1d87aa||0xc8;return function(_0x17ebd1){if(_0x17ebd1){return _0x55dd1f[_0x5fab('0x27')](_0x1d87aa)['json'](_0x17ebd1);}};}function respondWithFilteredResult(_0x2bd895,_0x1a3140){return function(_0x5241e0){if(_0x5241e0){var _0xd6b605=typeof _0x1a3140['offset']===_0x5fab('0x28')&&typeof _0x1a3140[_0x5fab('0x29')]==='undefined';var _0x5ac6ca=_0x5241e0['count'];var _0x234b63=_0xd6b605?0x0:_0x1a3140[_0x5fab('0x2a')];var _0x3e97a1=_0xd6b605?_0x5241e0[_0x5fab('0x2b')]:_0x1a3140[_0x5fab('0x2a')]+_0x1a3140[_0x5fab('0x29')];var _0x236846;if(_0x3e97a1>=_0x5ac6ca){_0x3e97a1=_0x5ac6ca;_0x236846=0xc8;}else{_0x236846=0xce;}_0x2bd895[_0x5fab('0x27')](_0x236846);return _0x2bd895[_0x5fab('0x2c')](_0x5fab('0x2d'),_0x234b63+'-'+_0x3e97a1+'/'+_0x5ac6ca)['json'](_0x5241e0);}return null;};}function patchUpdates(_0x1be793){return function(_0x5cbb61){try{jsonpatch[_0x5fab('0x2e')](_0x5cbb61,_0x1be793,!![]);}catch(_0x585833){return BPromise[_0x5fab('0x2f')](_0x585833);}return _0x5cbb61[_0x5fab('0x30')]();};}function saveUpdates(_0x4e24d3,_0x4d8a69){return function(_0x4b9c87){if(_0x4b9c87){return _0x4b9c87[_0x5fab('0x31')](_0x4e24d3)[_0x5fab('0x1b')](function(_0x4662d6){return _0x4662d6;});}return null;};}function removeEntity(_0x1c11f8,_0x53e335){return function(_0x4f0f73){if(_0x4f0f73){return _0x4f0f73[_0x5fab('0x32')]()[_0x5fab('0x1b')](function(){_0x1c11f8['status'](0xcc)[_0x5fab('0x33')]();});}};}function handleEntityNotFound(_0x52202d,_0xcd4373){return function(_0x55165e){if(!_0x55165e){_0x52202d[_0x5fab('0x26')](0x194);}return _0x55165e;};}function handleError(_0x508e9d,_0x28d47f){_0x28d47f=_0x28d47f||0x1f4;return function(_0x412290){logger[_0x5fab('0x21')](_0x412290[_0x5fab('0x34')]);if(_0x412290['name']){delete _0x412290[_0x5fab('0x35')];}_0x508e9d[_0x5fab('0x27')](_0x28d47f)[_0x5fab('0x36')](_0x412290);};}exports[_0x5fab('0x37')]=function(_0x2304c4,_0x3f681f){var _0x179ec7={},_0x37d34b={},_0x36c83c={'count':0x0,'rows':[]};var _0x1530fd=_[_0x5fab('0x38')](db[_0x5fab('0x39')][_0x5fab('0x3a')],function(_0x3ba3c5){return{'name':_0x3ba3c5[_0x5fab('0x3b')],'type':_0x3ba3c5[_0x5fab('0x3c')][_0x5fab('0x3d')]};});_0x37d34b[_0x5fab('0x3e')]=_[_0x5fab('0x38')](_0x1530fd,_0x5fab('0x35'));_0x37d34b[_0x5fab('0x3f')]=_['keys'](_0x2304c4[_0x5fab('0x3f')]);_0x37d34b[_0x5fab('0x40')]=_[_0x5fab('0x41')](_0x37d34b[_0x5fab('0x3e')],_0x37d34b['query']);_0x179ec7[_0x5fab('0x42')]=_['intersection'](_0x37d34b[_0x5fab('0x3e')],qs[_0x5fab('0x43')](_0x2304c4[_0x5fab('0x3f')][_0x5fab('0x43')]));_0x179ec7[_0x5fab('0x42')]=_0x179ec7[_0x5fab('0x42')]['length']?_0x179ec7['attributes']:_0x37d34b['model'];if(!_0x2304c4[_0x5fab('0x3f')][_0x5fab('0x44')](_0x5fab('0x45'))){_0x179ec7[_0x5fab('0x29')]=qs[_0x5fab('0x29')](_0x2304c4[_0x5fab('0x3f')]['limit']);_0x179ec7[_0x5fab('0x2a')]=qs['offset'](_0x2304c4[_0x5fab('0x3f')][_0x5fab('0x2a')]);}_0x179ec7[_0x5fab('0x46')]=qs['sort'](_0x2304c4['query'][_0x5fab('0x47')]);_0x179ec7[_0x5fab('0x48')]=qs[_0x5fab('0x40')](_[_0x5fab('0x49')](_0x2304c4[_0x5fab('0x3f')],_0x37d34b[_0x5fab('0x40')]),_0x1530fd);if(_0x2304c4[_0x5fab('0x3f')][_0x5fab('0x4a')]){_0x179ec7[_0x5fab('0x48')]=_[_0x5fab('0x4b')](_0x179ec7[_0x5fab('0x48')],{'$or':_[_0x5fab('0x38')](_0x1530fd,function(_0x3fbd2d){if(_0x3fbd2d['type']!==_0x5fab('0x4c')){var _0x201bd7={};_0x201bd7[_0x3fbd2d[_0x5fab('0x35')]]={'$like':'%'+_0x2304c4['query']['filter']+'%'};return _0x201bd7;}})});}_0x179ec7=_[_0x5fab('0x4b')]({},_0x179ec7,_0x2304c4['options']);var _0x53c3f0={'where':_0x179ec7[_0x5fab('0x48')]};return db['Setting'][_0x5fab('0x2b')](_0x53c3f0)[_0x5fab('0x1b')](function(_0x521f8f){_0x36c83c[_0x5fab('0x2b')]=_0x521f8f;if(_0x2304c4['query'][_0x5fab('0x4d')]){_0x179ec7[_0x5fab('0x4e')]=[{'all':!![]}];}return db[_0x5fab('0x39')]['findAll'](_0x179ec7);})[_0x5fab('0x1b')](function(_0x233933){_0x36c83c[_0x5fab('0x4f')]=_0x233933;return _0x36c83c;})['then'](respondWithFilteredResult(_0x3f681f,_0x179ec7))[_0x5fab('0x25')](handleError(_0x3f681f,null));};exports[_0x5fab('0x50')]=function(_0x47c986,_0x3e1082){var _0x46d0eb={'raw':![],'where':{'id':_0x47c986['params']['id']}},_0x297437={};_0x297437[_0x5fab('0x3e')]=_['keys'](db[_0x5fab('0x39')][_0x5fab('0x3a')]);_0x297437[_0x5fab('0x3f')]=_['keys'](_0x47c986[_0x5fab('0x3f')]);_0x297437[_0x5fab('0x40')]=_[_0x5fab('0x41')](_0x297437['model'],_0x297437['query']);_0x46d0eb[_0x5fab('0x42')]=_[_0x5fab('0x41')](_0x297437[_0x5fab('0x3e')],qs['fields'](_0x47c986[_0x5fab('0x3f')][_0x5fab('0x43')]));_0x46d0eb['attributes']=_0x46d0eb['attributes']['length']?_0x46d0eb['attributes']:_0x297437['model'];if(_0x47c986['query'][_0x5fab('0x4d')]){_0x46d0eb['include']=[{'all':!![]}];}_0x46d0eb=_[_0x5fab('0x4b')]({},_0x46d0eb,_0x47c986[_0x5fab('0x51')]);return db['Setting'][_0x5fab('0x52')](_0x46d0eb)['then'](handleEntityNotFound(_0x3e1082,null))[_0x5fab('0x1b')](respondWithResult(_0x3e1082,null))[_0x5fab('0x25')](handleError(_0x3e1082,null));};exports[_0x5fab('0x31')]=function(_0x46d016,_0x2d213b){if(_0x46d016[_0x5fab('0x53')]['id']){delete _0x46d016['body']['id'];}return db['Setting'][_0x5fab('0x52')]({'where':{'id':_0x46d016['params']['id']}})[_0x5fab('0x1b')](handleEntityNotFound(_0x2d213b,null))['then'](saveUpdates(_0x46d016[_0x5fab('0x53')],null))[_0x5fab('0x1b')](respondWithResult(_0x2d213b,null))[_0x5fab('0x25')](handleError(_0x2d213b,null));};exports[_0x5fab('0x54')]=function(_0x3d4021,_0x5605bb,_0x248b07){if(_0x3d4021[_0x5fab('0x55')]&&_0x3d4021[_0x5fab('0x55')][_0x5fab('0x56')]){_0x3d4021['body'][_0x5fab('0x57')]=_0x3d4021[_0x5fab('0x55')]['filename'];}return db[_0x5fab('0x39')][_0x5fab('0x52')]({'where':{'id':_0x3d4021['params']['id']}})[_0x5fab('0x1b')](handleEntityNotFound(_0x5605bb,null))[_0x5fab('0x1b')](saveUpdates(_0x3d4021[_0x5fab('0x53')],null))[_0x5fab('0x1b')](respondWithResult(_0x5605bb,null))[_0x5fab('0x25')](handleError(_0x5605bb,null));};exports[_0x5fab('0x58')]=function(_0x4ac7a3,_0x20fda6,_0x10ff49){if(_0x4ac7a3[_0x5fab('0x55')]&&_0x4ac7a3[_0x5fab('0x55')][_0x5fab('0x56')]){_0x4ac7a3['body'][_0x5fab('0x59')]=_0x4ac7a3[_0x5fab('0x55')]['filename'];}return db[_0x5fab('0x39')]['find']({'where':{'id':_0x4ac7a3[_0x5fab('0x5a')]['id']}})[_0x5fab('0x1b')](handleEntityNotFound(_0x20fda6,null))[_0x5fab('0x1b')](saveUpdates(_0x4ac7a3[_0x5fab('0x53')],null))[_0x5fab('0x1b')](respondWithResult(_0x20fda6,null))[_0x5fab('0x25')](handleError(_0x20fda6,null));};var utilLicense=require(_0x5fab('0x5b'));exports['getLogo']=function(_0x51a3d6,_0x5e3dd4,_0x40f6f8){var _0x535e77='server/files/images/logos';var _0xa98c3e={'custom':![]};return utilLicense[_0x5fab('0x5c')]()[_0x5fab('0x1b')](function(_0x28e0fa){if(_0x28e0fa){_0xa98c3e=_0x28e0fa;}return db['Setting'][_0x5fab('0x52')]({'where':{'id':_0x51a3d6['params']['id']},'attributes':['logo',_0x5fab('0x59'),'preferred',_0x5fab('0x5d'),_0x5fab('0x5e'),'defaultLoginLogo','defaultPreferred',_0x5fab('0x5f')],'raw':!![]});})[_0x5fab('0x1b')](handleEntityNotFound(_0x5e3dd4,null))[_0x5fab('0x1b')](function(_0x5c5e07){if(_0x5c5e07){var _0x312d49=_0x5c5e07['logo']&&fs[_0x5fab('0x60')](path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x535e77,_[_0x5fab('0x63')](_0x5c5e07[_0x5fab('0x57')])))?path['join'](config[_0x5fab('0x62')],_0x535e77,_[_0x5fab('0x63')](_0x5c5e07[_0x5fab('0x57')])):path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x535e77,_[_0x5fab('0x63')]('default_logo.svg'));var _0x5921b0=_0x5fab('0x64')+_['upperFirst']('logo');if(_0x5c5e07[_0x5921b0]||!_0xa98c3e[_0x5fab('0x65')]){_0x312d49=path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x535e77,_[_0x5fab('0x63')](_0x5fab('0x66')));}if(!fs[_0x5fab('0x60')](_0x312d49)){throw new db['Sequelize']['ValidationError'](_[_0x5fab('0x67')](_0x5fab('0x57'))+_0x5fab('0x68'));}return _0x5e3dd4[_0x5fab('0x69')](_0x312d49);}})['catch'](handleError(_0x5e3dd4,null));};var utilLicense=require(_0x5fab('0x5b'));exports[_0x5fab('0x6a')]=function(_0x3f2c4e,_0x2aeb82,_0x4372d6){var _0x2084f6=_0x5fab('0x6b');var _0x139aab={'custom':![]};return utilLicense['getLicense']()[_0x5fab('0x1b')](function(_0x2fc7ec){if(_0x2fc7ec){_0x139aab=_0x2fc7ec;}return db[_0x5fab('0x39')][_0x5fab('0x52')]({'where':{'id':_0x3f2c4e[_0x5fab('0x5a')]['id']},'attributes':[_0x5fab('0x57'),'loginLogo',_0x5fab('0x6c'),'favicon',_0x5fab('0x5e'),_0x5fab('0x6d'),_0x5fab('0x6e'),_0x5fab('0x5f')],'raw':!![]});})[_0x5fab('0x1b')](handleEntityNotFound(_0x2aeb82,null))[_0x5fab('0x1b')](function(_0x134aeb){if(_0x134aeb){var _0x365767=_0x134aeb[_0x5fab('0x59')]&&fs[_0x5fab('0x60')](path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x2084f6,_['toLower'](_0x134aeb[_0x5fab('0x59')])))?path['join'](config[_0x5fab('0x62')],_0x2084f6,_['toLower'](_0x134aeb['loginLogo'])):path['join'](config['root'],_0x2084f6,_['toLower'](_0x5fab('0x6f')));var _0x8a6e76=_0x5fab('0x64')+_['upperFirst'](_0x5fab('0x59'));if(_0x134aeb[_0x8a6e76]||!_0x139aab[_0x5fab('0x65')]){_0x365767=path[_0x5fab('0x61')](config['root'],_0x2084f6,_[_0x5fab('0x63')](_0x5fab('0x6f')));}if(!fs['existsSync'](_0x365767)){throw new db[(_0x5fab('0x70'))][(_0x5fab('0x71'))](_[_0x5fab('0x67')]('loginLogo')+_0x5fab('0x68'));}return _0x2aeb82[_0x5fab('0x69')](_0x365767);}})['catch'](handleError(_0x2aeb82,null));};exports['gdpr']=function(_0x38d081,_0x2ba1d5){return db[_0x5fab('0x39')][_0x5fab('0x52')]({'where':{'id':_0x38d081[_0x5fab('0x5a')]['id']},'attributes':[_0x5fab('0x72')]})['then'](respondWithResult(_0x2ba1d5,null))['catch'](handleError(_0x2ba1d5,null));};exports[_0x5fab('0x73')]=function(_0x2d189d,_0x5c5738,_0x448f3d){if(_0x2d189d[_0x5fab('0x55')]&&_0x2d189d[_0x5fab('0x55')][_0x5fab('0x56')]){_0x2d189d[_0x5fab('0x53')][_0x5fab('0x6c')]=_0x2d189d['file']['filename'];}return db[_0x5fab('0x39')]['find']({'where':{'id':_0x2d189d[_0x5fab('0x5a')]['id']}})[_0x5fab('0x1b')](handleEntityNotFound(_0x5c5738,null))[_0x5fab('0x1b')](saveUpdates(_0x2d189d['body'],null))[_0x5fab('0x1b')](respondWithResult(_0x5c5738,null))['catch'](handleError(_0x5c5738,null));};var utilLicense=require(_0x5fab('0x5b'));exports['getPreferred']=function(_0x5e7933,_0x5b4c1b,_0x396572){var _0x4558fb=_0x5fab('0x6b');var _0x2d3590={'custom':![]};return utilLicense[_0x5fab('0x5c')]()[_0x5fab('0x1b')](function(_0xc230f7){if(_0xc230f7){_0x2d3590=_0xc230f7;}return db[_0x5fab('0x39')][_0x5fab('0x52')]({'where':{'id':_0x5e7933[_0x5fab('0x5a')]['id']},'attributes':[_0x5fab('0x57'),_0x5fab('0x59'),_0x5fab('0x6c'),'favicon',_0x5fab('0x5e'),_0x5fab('0x6d'),_0x5fab('0x6e'),_0x5fab('0x5f')],'raw':!![]});})[_0x5fab('0x1b')](handleEntityNotFound(_0x5b4c1b,null))[_0x5fab('0x1b')](function(_0x5d97bd){if(_0x5d97bd){var _0x377943=_0x5d97bd['preferred']&&fs[_0x5fab('0x60')](path['join'](config[_0x5fab('0x62')],_0x4558fb,_[_0x5fab('0x63')](_0x5d97bd[_0x5fab('0x6c')])))?path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x4558fb,_['toLower'](_0x5d97bd[_0x5fab('0x6c')])):path['join'](config[_0x5fab('0x62')],_0x4558fb,_[_0x5fab('0x63')]('default_preferred.png'));var _0x5c2b85=_0x5fab('0x64')+_[_0x5fab('0x67')]('preferred');if(_0x5d97bd[_0x5c2b85]||!_0x2d3590[_0x5fab('0x65')]||!_0x2d3590['preferred']){_0x377943=path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x4558fb,_['toLower'](_0x5fab('0x74')));}if(!fs[_0x5fab('0x60')](_0x377943)){throw new db['Sequelize'][(_0x5fab('0x71'))](_['upperFirst'](_0x5fab('0x6c'))+_0x5fab('0x68'));}return _0x5b4c1b['download'](_0x377943);}})['catch'](handleError(_0x5b4c1b,null));};exports[_0x5fab('0x75')]=function(_0x6ef85b,_0x2dca16,_0x2bf44f){if(_0x6ef85b['file']&&_0x6ef85b[_0x5fab('0x55')][_0x5fab('0x56')]){_0x6ef85b['body'][_0x5fab('0x5d')]=_0x6ef85b['file'][_0x5fab('0x56')];}return db['Setting'][_0x5fab('0x52')]({'where':{'id':_0x6ef85b[_0x5fab('0x5a')]['id']}})[_0x5fab('0x1b')](handleEntityNotFound(_0x2dca16,null))['then'](saveUpdates(_0x6ef85b[_0x5fab('0x53')],null))[_0x5fab('0x1b')](respondWithResult(_0x2dca16,null))[_0x5fab('0x25')](handleError(_0x2dca16,null));};var utilLicense=require(_0x5fab('0x5b'));exports[_0x5fab('0x76')]=function(_0x55a20f,_0x7a84c7,_0x3b2fba){var _0x8ddfaa=_0x5fab('0x6b');var _0x8d0155={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x5a5b5c){if(_0x5a5b5c){_0x8d0155=_0x5a5b5c;}return db['Setting'][_0x5fab('0x52')]({'where':{'id':_0x55a20f[_0x5fab('0x5a')]['id']},'attributes':['logo',_0x5fab('0x59'),'preferred',_0x5fab('0x5d'),_0x5fab('0x5e'),_0x5fab('0x6d'),_0x5fab('0x6e'),_0x5fab('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x7a84c7,null))['then'](function(_0x4a5c2a){if(_0x4a5c2a){var _0x4c9ad6=_0x4a5c2a[_0x5fab('0x5d')]&&fs[_0x5fab('0x60')](path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x8ddfaa,_[_0x5fab('0x63')](_0x4a5c2a[_0x5fab('0x5d')])))?path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x8ddfaa,_[_0x5fab('0x63')](_0x4a5c2a[_0x5fab('0x5d')])):path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x8ddfaa,_['toLower'](_0x5fab('0x77')));var _0x16c29e=_0x5fab('0x64')+_[_0x5fab('0x67')](_0x5fab('0x5d'));if(_0x4a5c2a[_0x16c29e]||!_0x8d0155[_0x5fab('0x65')]){_0x4c9ad6=path[_0x5fab('0x61')](config[_0x5fab('0x62')],_0x8ddfaa,_[_0x5fab('0x63')](_0x5fab('0x77')));}if(!fs[_0x5fab('0x60')](_0x4c9ad6)){throw new db['Sequelize'][(_0x5fab('0x71'))](_['upperFirst'](_0x5fab('0x5d'))+_0x5fab('0x68'));}return _0x7a84c7[_0x5fab('0x69')](_0x4c9ad6);}})[_0x5fab('0x25')](handleError(_0x7a84c7,null));};exports[_0x5fab('0x78')]=function(_0x85c08a,_0x2b9a59){var _0x57deaf={'offset':moment()[_0x5fab('0x79')]()};_0x57deaf['now']=moment()[_0x5fab('0x79')](_0x57deaf[_0x5fab('0x2a')])[_0x5fab('0x7a')](_0x5fab('0x7b'));return _0x2b9a59[_0x5fab('0x27')](0xc8)[_0x5fab('0x36')](_0x57deaf);}; \ No newline at end of file +var _0x498a=['sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','stack','name','send','Setting','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','catch','keys','options','find','body','params','addLogo','file','logo','filename','addLogoLogin','getLogo','loginLogo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','getLogoLogin','preferred','default_loginLogo.svg','\x20not\x20found','download','securePassword','addPreferred','getPreferred','server/files/images/logos','getLicense','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5586e4,_0x13cab6){var _0x140f8b=function(_0x811038){while(--_0x811038){_0x5586e4['push'](_0x5586e4['shift']());}};_0x140f8b(++_0x13cab6);}(_0x498a,0x1bc));var _0xa498=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x498a[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xa498('0x0'));var rimraf=require(_0xa498('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa498('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa498('0x3'));var Mustache=require(_0xa498('0x4'));var util=require(_0xa498('0x5'));var path=require(_0xa498('0x6'));var sox=require('sox');var csv=require(_0xa498('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa498('0x8'));var _=require(_0xa498('0x9'));var squel=require('squel');var crypto=require(_0xa498('0xa'));var jsforce=require(_0xa498('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa498('0x7'));var querystring=require(_0xa498('0xc'));var Papa=require(_0xa498('0xd'));var Redis=require(_0xa498('0xe'));var authService=require(_0xa498('0xf'));var qs=require(_0xa498('0x10'));var as=require(_0xa498('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa498('0x12'))(_0xa498('0x13'));var utils=require(_0xa498('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa498('0x15'));var db=require(_0xa498('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa498('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4840ed,_0x6b54c0,_0xc2680f,_0x57fff2){return new BPromise(function(_0x25f378,_0x53210a){var _0x295a37=_0x57fff2||client;return _0x295a37[_0xa498('0x18')](_0x4840ed,_0xc2680f)[_0xa498('0x19')](function(_0x535a56){logger[_0xa498('0x1a')](_0xa498('0x1b'),_0x6b54c0,_0xa498('0x1c'));logger[_0xa498('0x1d')](_0xa498('0x1e'),_0x6b54c0,'request\x20sent',JSON[_0xa498('0x1f')](_0x535a56));if(_0x535a56[_0xa498('0x20')]){if(_0x535a56['error'][_0xa498('0x21')]===0x1f4){logger[_0xa498('0x20')](_0xa498('0x1b'),_0x6b54c0,_0x535a56['error'][_0xa498('0x22')]);return _0x53210a(_0x535a56[_0xa498('0x20')][_0xa498('0x22')]);}logger[_0xa498('0x20')](_0xa498('0x1b'),_0x6b54c0,_0x535a56[_0xa498('0x20')][_0xa498('0x22')]);return _0x25f378(_0x535a56[_0xa498('0x20')][_0xa498('0x22')]);}else{logger[_0xa498('0x1a')]('Setting,\x20%s,\x20%s',_0x6b54c0,'request\x20sent');_0x25f378(_0x535a56[_0xa498('0x23')][_0xa498('0x22')]);}})['catch'](function(_0x33ec37){logger[_0xa498('0x20')](_0xa498('0x1b'),_0x6b54c0,_0x33ec37);_0x53210a(_0x33ec37);});});}function respondWithStatusCode(_0x1a159c,_0x135ea4){_0x135ea4=_0x135ea4||0xcc;return function(_0x4b8a6e){if(_0x4b8a6e){return _0x1a159c[_0xa498('0x24')](_0x135ea4);}return _0x1a159c['status'](_0x135ea4)[_0xa498('0x25')]();};}function respondWithResult(_0x232b87,_0x572dff){_0x572dff=_0x572dff||0xc8;return function(_0x45bbd0){if(_0x45bbd0){return _0x232b87[_0xa498('0x26')](_0x572dff)[_0xa498('0x27')](_0x45bbd0);}};}function respondWithFilteredResult(_0x342c5e,_0xb5a355){return function(_0x289d1c){if(_0x289d1c){var _0x19b027=typeof _0xb5a355['offset']===_0xa498('0x28')&&typeof _0xb5a355[_0xa498('0x29')]==='undefined';var _0x489462=_0x289d1c[_0xa498('0x2a')];var _0x28ad1e=_0x19b027?0x0:_0xb5a355[_0xa498('0x2b')];var _0x1a25c5=_0x19b027?_0x289d1c[_0xa498('0x2a')]:_0xb5a355[_0xa498('0x2b')]+_0xb5a355[_0xa498('0x29')];var _0xeee628;if(_0x1a25c5>=_0x489462){_0x1a25c5=_0x489462;_0xeee628=0xc8;}else{_0xeee628=0xce;}_0x342c5e[_0xa498('0x26')](_0xeee628);return _0x342c5e[_0xa498('0x2c')](_0xa498('0x2d'),_0x28ad1e+'-'+_0x1a25c5+'/'+_0x489462)[_0xa498('0x27')](_0x289d1c);}return null;};}function patchUpdates(_0x32de72){return function(_0x3fc323){try{jsonpatch['apply'](_0x3fc323,_0x32de72,!![]);}catch(_0x39ea90){return BPromise[_0xa498('0x2e')](_0x39ea90);}return _0x3fc323[_0xa498('0x2f')]();};}function saveUpdates(_0x578bf4,_0x8527b7){return function(_0xb09e38){if(_0xb09e38){return _0xb09e38['update'](_0x578bf4)[_0xa498('0x19')](function(_0x95aa19){return _0x95aa19;});}return null;};}function removeEntity(_0x100c34,_0x5daef0){return function(_0xf0c8e9){if(_0xf0c8e9){return _0xf0c8e9['destroy']()[_0xa498('0x19')](function(){_0x100c34[_0xa498('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x80382f,_0x346771){return function(_0x491071){if(!_0x491071){_0x80382f[_0xa498('0x24')](0x194);}return _0x491071;};}function handleError(_0x48e030,_0x3d5b93){_0x3d5b93=_0x3d5b93||0x1f4;return function(_0x16520b){logger['error'](_0x16520b[_0xa498('0x30')]);if(_0x16520b[_0xa498('0x31')]){delete _0x16520b[_0xa498('0x31')];}_0x48e030[_0xa498('0x26')](_0x3d5b93)[_0xa498('0x32')](_0x16520b);};}exports['index']=function(_0x11f88e,_0x126191){var _0x50a1d9={},_0x346e75={},_0x52c170={'count':0x0,'rows':[]};var _0x4014b7=_['map'](db[_0xa498('0x33')][_0xa498('0x34')],function(_0x2ec7a3){return{'name':_0x2ec7a3['fieldName'],'type':_0x2ec7a3['type'][_0xa498('0x35')]};});_0x346e75[_0xa498('0x36')]=_['map'](_0x4014b7,_0xa498('0x31'));_0x346e75['query']=_['keys'](_0x11f88e[_0xa498('0x37')]);_0x346e75[_0xa498('0x38')]=_[_0xa498('0x39')](_0x346e75[_0xa498('0x36')],_0x346e75[_0xa498('0x37')]);_0x50a1d9[_0xa498('0x3a')]=_['intersection'](_0x346e75[_0xa498('0x36')],qs[_0xa498('0x3b')](_0x11f88e[_0xa498('0x37')]['fields']));_0x50a1d9[_0xa498('0x3a')]=_0x50a1d9[_0xa498('0x3a')][_0xa498('0x3c')]?_0x50a1d9['attributes']:_0x346e75['model'];if(!_0x11f88e[_0xa498('0x37')]['hasOwnProperty'](_0xa498('0x3d'))){_0x50a1d9['limit']=qs[_0xa498('0x29')](_0x11f88e[_0xa498('0x37')]['limit']);_0x50a1d9['offset']=qs[_0xa498('0x2b')](_0x11f88e[_0xa498('0x37')][_0xa498('0x2b')]);}_0x50a1d9[_0xa498('0x3e')]=qs['sort'](_0x11f88e[_0xa498('0x37')][_0xa498('0x3f')]);_0x50a1d9[_0xa498('0x40')]=qs[_0xa498('0x38')](_[_0xa498('0x41')](_0x11f88e['query'],_0x346e75['filters']),_0x4014b7);if(_0x11f88e[_0xa498('0x37')][_0xa498('0x42')]){_0x50a1d9['where']=_[_0xa498('0x43')](_0x50a1d9[_0xa498('0x40')],{'$or':_[_0xa498('0x44')](_0x4014b7,function(_0x3b3dd4){if(_0x3b3dd4[_0xa498('0x45')]!==_0xa498('0x46')){var _0x298806={};_0x298806[_0x3b3dd4[_0xa498('0x31')]]={'$like':'%'+_0x11f88e[_0xa498('0x37')][_0xa498('0x42')]+'%'};return _0x298806;}})});}_0x50a1d9=_[_0xa498('0x43')]({},_0x50a1d9,_0x11f88e['options']);var _0x51cb8f={'where':_0x50a1d9[_0xa498('0x40')]};return db['Setting'][_0xa498('0x2a')](_0x51cb8f)[_0xa498('0x19')](function(_0x4def8e){_0x52c170[_0xa498('0x2a')]=_0x4def8e;if(_0x11f88e[_0xa498('0x37')][_0xa498('0x47')]){_0x50a1d9[_0xa498('0x48')]=[{'all':!![]}];}return db[_0xa498('0x33')][_0xa498('0x49')](_0x50a1d9);})['then'](function(_0x23301e){_0x52c170[_0xa498('0x4a')]=_0x23301e;return _0x52c170;})['then'](respondWithFilteredResult(_0x126191,_0x50a1d9))[_0xa498('0x4b')](handleError(_0x126191,null));};exports['show']=function(_0xbf0aca,_0x229565){var _0x8e7cfe={'raw':![],'where':{'id':_0xbf0aca['params']['id']}},_0x14f7a6={};_0x14f7a6['model']=_[_0xa498('0x4c')](db[_0xa498('0x33')][_0xa498('0x34')]);_0x14f7a6['query']=_[_0xa498('0x4c')](_0xbf0aca['query']);_0x14f7a6[_0xa498('0x38')]=_['intersection'](_0x14f7a6['model'],_0x14f7a6[_0xa498('0x37')]);_0x8e7cfe['attributes']=_[_0xa498('0x39')](_0x14f7a6[_0xa498('0x36')],qs[_0xa498('0x3b')](_0xbf0aca[_0xa498('0x37')][_0xa498('0x3b')]));_0x8e7cfe[_0xa498('0x3a')]=_0x8e7cfe['attributes'][_0xa498('0x3c')]?_0x8e7cfe[_0xa498('0x3a')]:_0x14f7a6['model'];if(_0xbf0aca[_0xa498('0x37')]['includeAll']){_0x8e7cfe[_0xa498('0x48')]=[{'all':!![]}];}_0x8e7cfe=_['merge']({},_0x8e7cfe,_0xbf0aca[_0xa498('0x4d')]);return db[_0xa498('0x33')][_0xa498('0x4e')](_0x8e7cfe)['then'](handleEntityNotFound(_0x229565,null))[_0xa498('0x19')](respondWithResult(_0x229565,null))[_0xa498('0x4b')](handleError(_0x229565,null));};exports['update']=function(_0x552ae9,_0x4cdad6){if(_0x552ae9[_0xa498('0x4f')]['id']){delete _0x552ae9[_0xa498('0x4f')]['id'];}return db['Setting']['find']({'where':{'id':_0x552ae9[_0xa498('0x50')]['id']}})[_0xa498('0x19')](handleEntityNotFound(_0x4cdad6,null))[_0xa498('0x19')](saveUpdates(_0x552ae9['body'],null))['then'](respondWithResult(_0x4cdad6,null))['catch'](handleError(_0x4cdad6,null));};exports[_0xa498('0x51')]=function(_0x41b5f6,_0xd09e35,_0x5af64e){if(_0x41b5f6['file']&&_0x41b5f6[_0xa498('0x52')]['filename']){_0x41b5f6['body'][_0xa498('0x53')]=_0x41b5f6['file'][_0xa498('0x54')];}return db[_0xa498('0x33')][_0xa498('0x4e')]({'where':{'id':_0x41b5f6[_0xa498('0x50')]['id']}})[_0xa498('0x19')](handleEntityNotFound(_0xd09e35,null))[_0xa498('0x19')](saveUpdates(_0x41b5f6[_0xa498('0x4f')],null))[_0xa498('0x19')](respondWithResult(_0xd09e35,null))[_0xa498('0x4b')](handleError(_0xd09e35,null));};exports[_0xa498('0x55')]=function(_0x4fb2ba,_0x55f5d2,_0x4d52ef){if(_0x4fb2ba[_0xa498('0x52')]&&_0x4fb2ba[_0xa498('0x52')]['filename']){_0x4fb2ba['body']['loginLogo']=_0x4fb2ba[_0xa498('0x52')][_0xa498('0x54')];}return db[_0xa498('0x33')][_0xa498('0x4e')]({'where':{'id':_0x4fb2ba['params']['id']}})[_0xa498('0x19')](handleEntityNotFound(_0x55f5d2,null))[_0xa498('0x19')](saveUpdates(_0x4fb2ba[_0xa498('0x4f')],null))[_0xa498('0x19')](respondWithResult(_0x55f5d2,null))['catch'](handleError(_0x55f5d2,null));};var utilLicense=require('../../config/license/util');exports[_0xa498('0x56')]=function(_0x4d7826,_0x501701,_0x357ca9){var _0x23abb6='server/files/images/logos';var _0x26d40f={'custom':![]};return utilLicense['getLicense']()[_0xa498('0x19')](function(_0x566509){if(_0x566509){_0x26d40f=_0x566509;}return db[_0xa498('0x33')]['find']({'where':{'id':_0x4d7826[_0xa498('0x50')]['id']},'attributes':[_0xa498('0x53'),_0xa498('0x57'),'preferred',_0xa498('0x58'),_0xa498('0x59'),_0xa498('0x5a'),_0xa498('0x5b'),_0xa498('0x5c')],'raw':!![]});})[_0xa498('0x19')](handleEntityNotFound(_0x501701,null))[_0xa498('0x19')](function(_0x3db58a){if(_0x3db58a){var _0x410d5c=_0x3db58a[_0xa498('0x53')]&&fs[_0xa498('0x5d')](path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x23abb6,_[_0xa498('0x60')](_0x3db58a[_0xa498('0x53')])))?path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x23abb6,_[_0xa498('0x60')](_0x3db58a[_0xa498('0x53')])):path['join'](config['root'],_0x23abb6,_[_0xa498('0x60')](_0xa498('0x61')));var _0x299e93=_0xa498('0x62')+_['upperFirst'](_0xa498('0x53'));if(_0x3db58a[_0x299e93]||!_0x26d40f[_0xa498('0x63')]){_0x410d5c=path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x23abb6,_[_0xa498('0x60')](_0xa498('0x61')));}if(!fs[_0xa498('0x5d')](_0x410d5c)){throw new db[(_0xa498('0x64'))][(_0xa498('0x65'))](_[_0xa498('0x66')](_0xa498('0x53'))+'\x20not\x20found');}return _0x501701['download'](_0x410d5c);}})['catch'](handleError(_0x501701,null));};var utilLicense=require('../../config/license/util');exports[_0xa498('0x67')]=function(_0x13f3dc,_0x3d5d46,_0x166aed){var _0x45ea10='server/files/images/logos';var _0x2bfd4a={'custom':![]};return utilLicense['getLicense']()[_0xa498('0x19')](function(_0x550af1){if(_0x550af1){_0x2bfd4a=_0x550af1;}return db[_0xa498('0x33')][_0xa498('0x4e')]({'where':{'id':_0x13f3dc['params']['id']},'attributes':[_0xa498('0x53'),_0xa498('0x57'),_0xa498('0x68'),_0xa498('0x58'),_0xa498('0x59'),_0xa498('0x5a'),'defaultPreferred',_0xa498('0x5c')],'raw':!![]});})[_0xa498('0x19')](handleEntityNotFound(_0x3d5d46,null))[_0xa498('0x19')](function(_0x53503d){if(_0x53503d){var _0x50fc7c=_0x53503d['loginLogo']&&fs[_0xa498('0x5d')](path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x45ea10,_[_0xa498('0x60')](_0x53503d['loginLogo'])))?path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x45ea10,_[_0xa498('0x60')](_0x53503d[_0xa498('0x57')])):path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x45ea10,_[_0xa498('0x60')](_0xa498('0x69')));var _0xb35ac2=_0xa498('0x62')+_[_0xa498('0x66')](_0xa498('0x57'));if(_0x53503d[_0xb35ac2]||!_0x2bfd4a[_0xa498('0x63')]){_0x50fc7c=path[_0xa498('0x5e')](config['root'],_0x45ea10,_['toLower'](_0xa498('0x69')));}if(!fs[_0xa498('0x5d')](_0x50fc7c)){throw new db[(_0xa498('0x64'))][(_0xa498('0x65'))](_[_0xa498('0x66')]('loginLogo')+_0xa498('0x6a'));}return _0x3d5d46[_0xa498('0x6b')](_0x50fc7c);}})[_0xa498('0x4b')](handleError(_0x3d5d46,null));};exports['gdpr']=function(_0x4a3cf1,_0x586716){return db['Setting'][_0xa498('0x4e')]({'where':{'id':_0x4a3cf1[_0xa498('0x50')]['id']},'attributes':[_0xa498('0x6c')]})[_0xa498('0x19')](respondWithResult(_0x586716,null))['catch'](handleError(_0x586716,null));};exports[_0xa498('0x6d')]=function(_0x224ee6,_0x5e0c71,_0xb0e62c){if(_0x224ee6[_0xa498('0x52')]&&_0x224ee6[_0xa498('0x52')][_0xa498('0x54')]){_0x224ee6[_0xa498('0x4f')][_0xa498('0x68')]=_0x224ee6['file'][_0xa498('0x54')];}return db[_0xa498('0x33')][_0xa498('0x4e')]({'where':{'id':_0x224ee6[_0xa498('0x50')]['id']}})['then'](handleEntityNotFound(_0x5e0c71,null))[_0xa498('0x19')](saveUpdates(_0x224ee6[_0xa498('0x4f')],null))[_0xa498('0x19')](respondWithResult(_0x5e0c71,null))[_0xa498('0x4b')](handleError(_0x5e0c71,null));};var utilLicense=require(_0xa498('0x15'));exports[_0xa498('0x6e')]=function(_0x4b5dfe,_0x20683b,_0x128e4e){var _0x52d03f=_0xa498('0x6f');var _0x14bf65={'custom':![]};return utilLicense[_0xa498('0x70')]()[_0xa498('0x19')](function(_0x3a0749){if(_0x3a0749){_0x14bf65=_0x3a0749;}return db[_0xa498('0x33')][_0xa498('0x4e')]({'where':{'id':_0x4b5dfe[_0xa498('0x50')]['id']},'attributes':['logo','loginLogo','preferred',_0xa498('0x58'),'defaultLogo',_0xa498('0x5a'),_0xa498('0x5b'),_0xa498('0x5c')],'raw':!![]});})[_0xa498('0x19')](handleEntityNotFound(_0x20683b,null))[_0xa498('0x19')](function(_0x58a2c5){if(_0x58a2c5){var _0x540f2d=_0x58a2c5[_0xa498('0x68')]&&fs['existsSync'](path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x52d03f,_[_0xa498('0x60')](_0x58a2c5[_0xa498('0x68')])))?path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x52d03f,_[_0xa498('0x60')](_0x58a2c5[_0xa498('0x68')])):path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x52d03f,_['toLower'](_0xa498('0x71')));var _0x40b064=_0xa498('0x62')+_[_0xa498('0x66')]('preferred');if(_0x58a2c5[_0x40b064]||!_0x14bf65[_0xa498('0x63')]||!_0x14bf65[_0xa498('0x68')]){_0x540f2d=path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x52d03f,_[_0xa498('0x60')](_0xa498('0x71')));}if(!fs[_0xa498('0x5d')](_0x540f2d)){throw new db[(_0xa498('0x64'))][(_0xa498('0x65'))](_[_0xa498('0x66')](_0xa498('0x68'))+_0xa498('0x6a'));}return _0x20683b[_0xa498('0x6b')](_0x540f2d);}})[_0xa498('0x4b')](handleError(_0x20683b,null));};exports[_0xa498('0x72')]=function(_0x100614,_0x22fd0e,_0x181cac){if(_0x100614[_0xa498('0x52')]&&_0x100614['file'][_0xa498('0x54')]){_0x100614[_0xa498('0x4f')][_0xa498('0x58')]=_0x100614['file'][_0xa498('0x54')];}return db['Setting']['find']({'where':{'id':_0x100614[_0xa498('0x50')]['id']}})['then'](handleEntityNotFound(_0x22fd0e,null))['then'](saveUpdates(_0x100614[_0xa498('0x4f')],null))['then'](respondWithResult(_0x22fd0e,null))[_0xa498('0x4b')](handleError(_0x22fd0e,null));};var utilLicense=require(_0xa498('0x15'));exports[_0xa498('0x73')]=function(_0x8473cc,_0x51d797,_0x41a606){var _0x766ea9=_0xa498('0x6f');var _0x448efb={'custom':![]};return utilLicense[_0xa498('0x70')]()[_0xa498('0x19')](function(_0x1577bb){if(_0x1577bb){_0x448efb=_0x1577bb;}return db[_0xa498('0x33')][_0xa498('0x4e')]({'where':{'id':_0x8473cc['params']['id']},'attributes':[_0xa498('0x53'),'loginLogo',_0xa498('0x68'),_0xa498('0x58'),_0xa498('0x59'),_0xa498('0x5a'),_0xa498('0x5b'),_0xa498('0x5c')],'raw':!![]});})[_0xa498('0x19')](handleEntityNotFound(_0x51d797,null))['then'](function(_0x246e36){if(_0x246e36){var _0x1d4987=_0x246e36[_0xa498('0x58')]&&fs[_0xa498('0x5d')](path[_0xa498('0x5e')](config['root'],_0x766ea9,_[_0xa498('0x60')](_0x246e36['favicon'])))?path['join'](config[_0xa498('0x5f')],_0x766ea9,_[_0xa498('0x60')](_0x246e36[_0xa498('0x58')])):path[_0xa498('0x5e')](config[_0xa498('0x5f')],_0x766ea9,_['toLower'](_0xa498('0x74')));var _0x5d0c88='default'+_[_0xa498('0x66')](_0xa498('0x58'));if(_0x246e36[_0x5d0c88]||!_0x448efb[_0xa498('0x63')]){_0x1d4987=path[_0xa498('0x5e')](config['root'],_0x766ea9,_[_0xa498('0x60')](_0xa498('0x74')));}if(!fs[_0xa498('0x5d')](_0x1d4987)){throw new db[(_0xa498('0x64'))]['ValidationError'](_[_0xa498('0x66')](_0xa498('0x58'))+'\x20not\x20found');}return _0x51d797[_0xa498('0x6b')](_0x1d4987);}})[_0xa498('0x4b')](handleError(_0x51d797,null));};exports['getDate']=function(_0x3fa732,_0x50000e){var _0x4f50e8={'offset':moment()[_0xa498('0x75')]()};_0x4f50e8['now']=moment()[_0xa498('0x75')](_0x4f50e8['offset'])[_0xa498('0x76')](_0xa498('0x77'));return _0x50000e['status'](0xc8)[_0xa498('0x32')](_0x4f50e8);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 3cbeed8..b63f0b8 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x55ca,0x126));var _0xa55c=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0x55ca[_0x20b29c];return _0x20d81b;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x435d49,_0xe63b56){var _0x40a43d=function(_0x427d95){while(--_0x427d95){_0x435d49['push'](_0x435d49['shift']());}};_0x40a43d(++_0xe63b56);}(_0x3e74,0x175));var _0x43e7=function(_0x1ecb52,_0xa019a8){_0x1ecb52=_0x1ecb52-0x0;var _0x472cf2=_0x3e74[_0x1ecb52];return _0x472cf2;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 0f9d5c5..8a15904 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 _0x7739=['find','options','raw','attributes','include','model','map','ShowSetting','stringify','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','error','code','Setting,\x20%s,\x20%s','message','result'];(function(_0x470291,_0x1ce9b4){var _0x398a4e=function(_0x1962f8){while(--_0x1962f8){_0x470291['push'](_0x470291['shift']());}};_0x398a4e(++_0x1ce9b4);}(_0x7739,0x9b));var _0x9773=function(_0x55359c,_0x4dac0b){_0x55359c=_0x55359c-0x0;var _0x7b3ec2=_0x7739[_0x55359c];return _0x7b3ec2;};'use strict';var _=require(_0x9773('0x0'));var util=require(_0x9773('0x1'));var moment=require(_0x9773('0x2'));var BPromise=require(_0x9773('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9773('0x4'))['db'];var utils=require(_0x9773('0x5'));var logger=require(_0x9773('0x6'))('rpc');var config=require(_0x9773('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9773('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4244e6,_0x242fb1,_0x24ba0c){return new BPromise(function(_0x2be813,_0xe31929){return client[_0x9773('0x9')](_0x4244e6,_0x24ba0c)[_0x9773('0xa')](function(_0x32b26f){logger[_0x9773('0xb')]('Setting,\x20%s,\x20%s',_0x242fb1,_0x9773('0xc'));logger[_0x9773('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x242fb1,_0x9773('0xc'),JSON['stringify'](_0x32b26f));if(_0x32b26f[_0x9773('0xe')]){if(_0x32b26f[_0x9773('0xe')][_0x9773('0xf')]===0x1f4){logger[_0x9773('0xe')](_0x9773('0x10'),_0x242fb1,_0x32b26f[_0x9773('0xe')]['message']);return _0xe31929(_0x32b26f[_0x9773('0xe')][_0x9773('0x11')]);}logger[_0x9773('0xe')](_0x9773('0x10'),_0x242fb1,_0x32b26f[_0x9773('0xe')][_0x9773('0x11')]);return _0x2be813(_0x32b26f['error'][_0x9773('0x11')]);}else{logger[_0x9773('0xb')](_0x9773('0x10'),_0x242fb1,'request\x20sent');_0x2be813(_0x32b26f[_0x9773('0x12')]['message']);}})['catch'](function(_0x4f312c){logger[_0x9773('0xe')]('Setting,\x20%s,\x20%s',_0x242fb1,_0x4f312c);_0xe31929(_0x4f312c);});});}exports['ShowSetting']=function(_0x18afe0){var _0x2bb1e8=this;return new Promise(function(_0x359809,_0x552219){return db['Setting'][_0x9773('0x13')]({'raw':_0x18afe0[_0x9773('0x14')]?_0x18afe0[_0x9773('0x14')][_0x9773('0x15')]===undefined?!![]:![]:!![],'where':_0x18afe0[_0x9773('0x14')]?_0x18afe0[_0x9773('0x14')]['where']||null:null,'attributes':_0x18afe0[_0x9773('0x14')]?_0x18afe0[_0x9773('0x14')][_0x9773('0x16')]||null:null,'include':_0x18afe0[_0x9773('0x14')]?_0x18afe0[_0x9773('0x14')][_0x9773('0x17')]?_['map'](_0x18afe0[_0x9773('0x14')][_0x9773('0x17')],function(_0x45d73b){return{'model':db[_0x45d73b[_0x9773('0x18')]],'as':_0x45d73b['as'],'attributes':_0x45d73b[_0x9773('0x16')],'include':_0x45d73b[_0x9773('0x17')]?_[_0x9773('0x19')](_0x45d73b[_0x9773('0x17')],function(_0x1ed6ee){return{'model':db[_0x1ed6ee['model']],'as':_0x1ed6ee['as'],'attributes':_0x1ed6ee[_0x9773('0x16')],'include':_0x1ed6ee['include']?_['map'](_0x1ed6ee[_0x9773('0x17')],function(_0x3bff57){return{'model':db[_0x3bff57[_0x9773('0x18')]],'as':_0x3bff57['as'],'attributes':_0x3bff57[_0x9773('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9773('0xa')](function(_0x2ef1ff){logger[_0x9773('0xb')](_0x9773('0x1a'),_0x18afe0);logger[_0x9773('0xd')](_0x9773('0x1a'),_0x18afe0,JSON[_0x9773('0x1b')](_0x2ef1ff));_0x359809(_0x2ef1ff);})[_0x9773('0x1c')](function(_0x1df826){logger['error']('ShowSetting',_0x1df826[_0x9773('0x11')],_0x18afe0);_0x552219(_0x2bb1e8['error'](0x1f4,_0x1df826[_0x9773('0x11')]));});});}; \ No newline at end of file +var _0x3192=['Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','options','attributes','include','model','map','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x5b8f99,_0x1daa83){var _0x20cacd=function(_0x2c5f9a){while(--_0x2c5f9a){_0x5b8f99['push'](_0x5b8f99['shift']());}};_0x20cacd(++_0x1daa83);}(_0x3192,0x128));var _0x2319=function(_0x5bf763,_0x14340c){_0x5bf763=_0x5bf763-0x0;var _0x4ddae9=_0x3192[_0x5bf763];return _0x4ddae9;};'use strict';var _=require(_0x2319('0x0'));var util=require(_0x2319('0x1'));var moment=require(_0x2319('0x2'));var BPromise=require(_0x2319('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2319('0x4'))(_0x2319('0x5'));var config=require(_0x2319('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2319('0x7')][_0x2319('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x485b52,_0xe21804,_0x586960){return new BPromise(function(_0x179e26,_0x4c1d5b){return client[_0x2319('0x9')](_0x485b52,_0x586960)[_0x2319('0xa')](function(_0x13d23c){logger[_0x2319('0xb')](_0x2319('0xc'),_0xe21804,_0x2319('0xd'));logger[_0x2319('0xe')](_0x2319('0xf'),_0xe21804,_0x2319('0xd'),JSON[_0x2319('0x10')](_0x13d23c));if(_0x13d23c[_0x2319('0x11')]){if(_0x13d23c[_0x2319('0x11')][_0x2319('0x12')]===0x1f4){logger[_0x2319('0x11')](_0x2319('0xc'),_0xe21804,_0x13d23c['error'][_0x2319('0x13')]);return _0x4c1d5b(_0x13d23c[_0x2319('0x11')][_0x2319('0x13')]);}logger[_0x2319('0x11')](_0x2319('0xc'),_0xe21804,_0x13d23c['error']['message']);return _0x179e26(_0x13d23c[_0x2319('0x11')][_0x2319('0x13')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0xe21804,_0x2319('0xd'));_0x179e26(_0x13d23c[_0x2319('0x14')]['message']);}})[_0x2319('0x15')](function(_0x287c7b){logger[_0x2319('0x11')](_0x2319('0xc'),_0xe21804,_0x287c7b);_0x4c1d5b(_0x287c7b);});});}exports[_0x2319('0x16')]=function(_0x31f682){var _0x5e195d=this;return new Promise(function(_0x51400e,_0x1857ea){return db['Setting']['find']({'raw':_0x31f682['options']?_0x31f682[_0x2319('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x31f682[_0x2319('0x17')]?_0x31f682['options']['where']||null:null,'attributes':_0x31f682[_0x2319('0x17')]?_0x31f682[_0x2319('0x17')][_0x2319('0x18')]||null:null,'include':_0x31f682['options']?_0x31f682[_0x2319('0x17')][_0x2319('0x19')]?_['map'](_0x31f682[_0x2319('0x17')][_0x2319('0x19')],function(_0x20b711){return{'model':db[_0x20b711[_0x2319('0x1a')]],'as':_0x20b711['as'],'attributes':_0x20b711['attributes'],'include':_0x20b711[_0x2319('0x19')]?_[_0x2319('0x1b')](_0x20b711[_0x2319('0x19')],function(_0x266852){return{'model':db[_0x266852['model']],'as':_0x266852['as'],'attributes':_0x266852[_0x2319('0x18')],'include':_0x266852[_0x2319('0x19')]?_['map'](_0x266852[_0x2319('0x19')],function(_0x5efdf6){return{'model':db[_0x5efdf6[_0x2319('0x1a')]],'as':_0x5efdf6['as'],'attributes':_0x5efdf6[_0x2319('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2319('0xa')](function(_0x2fe5a9){logger[_0x2319('0xb')](_0x2319('0x16'),_0x31f682);logger[_0x2319('0xe')](_0x2319('0x16'),_0x31f682,JSON['stringify'](_0x2fe5a9));_0x51400e(_0x2fe5a9);})[_0x2319('0x15')](function(_0xd63bdf){logger[_0x2319('0x11')](_0x2319('0x16'),_0xd63bdf['message'],_0x31f682);_0x1857ea(_0x5e195d[_0x2319('0x11')](0x1f4,_0xd63bdf['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index c04c059..5a0f5bf 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 _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x2407e9,_0x5265d7){var _0x1a8057=function(_0x113a1a){while(--_0x113a1a){_0x2407e9['push'](_0x2407e9['shift']());}};_0x1a8057(++_0x5265d7);}(_0x53ec,0x192));var _0xc53e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x53ec[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file +var _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x214140,_0x273e62){var _0x1f45fa=function(_0x1dd61f){while(--_0x1dd61f){_0x214140['push'](_0x214140['shift']());}};_0x1f45fa(++_0x273e62);}(_0x814b,0x1a2));var _0xb814=function(_0xcb19e1,_0x465489){_0xcb19e1=_0xcb19e1-0x0;var _0x121872=_0x814b[_0xcb19e1];return _0x121872;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 57b8b45..30e2f2d 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 _0xc2ad=['connectel','clicksend','plivo','clickatell','bandwidth','csc','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','ENUM','twilio','skebby'];(function(_0xd43e1d,_0x26a204){var _0x5c7332=function(_0x266a00){while(--_0x266a00){_0xd43e1d['push'](_0xd43e1d['shift']());}};_0x5c7332(++_0x26a204);}(_0xc2ad,0x66));var _0xdc2a=function(_0x40aff5,_0x5f005a){_0x40aff5=_0x40aff5-0x0;var _0x264c4c=_0xc2ad[_0x40aff5];return _0x264c4c;};'use strict';var Sequelize=require(_0xdc2a('0x0'));var rs=require(_0xdc2a('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdc2a('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xdc2a('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xdc2a('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xdc2a('0x3')],'defaultValue':function(){return rs[_0xdc2a('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdc2a('0x5')](_0xdc2a('0x6'),_0xdc2a('0x7'),_0xdc2a('0x8'),_0xdc2a('0x9'),_0xdc2a('0xa'),_0xdc2a('0xb'),_0xdc2a('0xc'),_0xdc2a('0xd'),'infobip',_0xdc2a('0xe'))},'accountSid':{'type':Sequelize[_0xdc2a('0x3')]},'authId':{'type':Sequelize[_0xdc2a('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xdc2a('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xdc2a('0x3')]},'password':{'type':Sequelize[_0xdc2a('0x3')]},'apiKey':{'type':Sequelize[_0xdc2a('0x3')]},'applicationId':{'type':Sequelize[_0xdc2a('0x3')]},'accountId':{'type':Sequelize[_0xdc2a('0x3')]},'senderString':{'type':Sequelize[_0xdc2a('0x3')]},'deliveryReport':{'type':Sequelize[_0xdc2a('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xdc2a('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xdc2a('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdc2a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdc2a('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdc2a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdc2a('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdc2a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc2a('0x11')],'comment':_0xdc2a('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xdc2a('0x13'),'set':function(_0x2deaf7){if(!_0x2deaf7)this['setDataValue'](_0xdc2a('0x14'),null);this['setDataValue'](_0xdc2a('0x15'),_0x2deaf7);}}}; \ No newline at end of file +var _0x1481=['plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','skebby','connectel','clicksend'];(function(_0x509994,_0x2764b6){var _0x39c019=function(_0x19c6db){while(--_0x19c6db){_0x509994['push'](_0x509994['shift']());}};_0x39c019(++_0x2764b6);}(_0x1481,0x168));var _0x1148=function(_0x3c6634,_0x17499b){_0x3c6634=_0x3c6634-0x0;var _0x349302=_0x1481[_0x3c6634];return _0x349302;};'use strict';var Sequelize=require(_0x1148('0x0'));var rs=require('randomstring');module[_0x1148('0x1')]={'name':{'type':Sequelize[_0x1148('0x2')],'unique':_0x1148('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x1148('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x1148('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x1148('0x2')],'defaultValue':function(){return rs[_0x1148('0x4')]();}},'phone':{'type':Sequelize[_0x1148('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0x1148('0x5'),_0x1148('0x6'),_0x1148('0x7'),_0x1148('0x8'),_0x1148('0x9'),_0x1148('0xa'),_0x1148('0xb'),_0x1148('0xc'),_0x1148('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x1148('0x2')]},'authToken':{'type':Sequelize[_0x1148('0x2')]},'smsMethod':{'type':Sequelize[_0x1148('0xe')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1148('0x2')]},'apiKey':{'type':Sequelize[_0x1148('0x2')]},'applicationId':{'type':Sequelize[_0x1148('0x2')]},'accountId':{'type':Sequelize[_0x1148('0x2')]},'senderString':{'type':Sequelize[_0x1148('0x2')]},'deliveryReport':{'type':Sequelize[_0x1148('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x1148('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1148('0x10');}},'notificationSound':{'type':Sequelize[_0x1148('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1148('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1148('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1148('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1148('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1148('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x1148('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x1148('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x1148('0xf')],'defaultValue':![],'comment':_0x1148('0x13'),'set':function(_0x21db94){if(!_0x21db94)this[_0x1148('0x14')](_0x1148('0x15'),null);this[_0x1148('0x14')](_0x1148('0x16'),_0x21db94);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 54ae6a2..2fcba8a 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 _0xf200=['receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','findAndCountAll','finally','getApplications','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','user','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','status_code','groupName','DELIVERED','redif','clickatell','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','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','catch','sendStatus','status','json','limit','undefined','offset','Content-Range','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','SmsAccount','count','includeAll','include','show','params','mandatoryDispositionPause','keys','create','body','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findAll','removeDispositions','ids','SmsAccountId','CannedAnswer','findOne','filter','rows','removeAnswers','notify','sms','account','orderBy','Applications','priority','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','fromNumber','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting'];(function(_0x463183,_0x56bd4e){var _0xd5fe56=function(_0x55cb29){while(--_0x55cb29){_0x463183['push'](_0x463183['shift']());}};_0xd5fe56(++_0x56bd4e);}(_0xf200,0x109));var _0x0f20=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf200[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f20('0x0'));var zipdir=require(_0x0f20('0x1'));var jsonpatch=require(_0x0f20('0x2'));var rp=require('request-promise');var moment=require(_0x0f20('0x3'));var BPromise=require(_0x0f20('0x4'));var Mustache=require(_0x0f20('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0f20('0x6'));var csv=require(_0x0f20('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f20('0x8'));var _=require(_0x0f20('0x9'));var squel=require('squel');var crypto=require(_0x0f20('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0f20('0x7'));var querystring=require(_0x0f20('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0f20('0xc'));var qs=require(_0x0f20('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f20('0xe'))(_0x0f20('0xf'));var utils=require(_0x0f20('0x10'));var config=require(_0x0f20('0x11'));var licenseUtil=require(_0x0f20('0x12'));var db=require('../../mysqldb')['db'];config[_0x0f20('0x13')]=_[_0x0f20('0x14')](config[_0x0f20('0x13')],{'host':_0x0f20('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f20('0x13')]));require(_0x0f20('0x16'))[_0x0f20('0x17')](socket);var jayson=require(_0x0f20('0x18'));var client=jayson[_0x0f20('0x19')][_0x0f20('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0xf706c0,_0x42d084,_0xe01874,_0x38c3af){return new BPromise(function(_0x38f14b,_0x267c51){var _0x5bf3f2=_0x38c3af||client;return _0x5bf3f2[_0x0f20('0x1b')](_0xf706c0,_0xe01874)[_0x0f20('0x1c')](function(_0x48c28d){logger[_0x0f20('0x1d')](_0x0f20('0x1e'),_0x42d084,_0x0f20('0x1f'));logger['debug'](_0x0f20('0x20'),_0x42d084,'request\x20sent',JSON[_0x0f20('0x21')](_0x48c28d));if(_0x48c28d[_0x0f20('0x22')]){if(_0x48c28d[_0x0f20('0x22')][_0x0f20('0x23')]===0x1f4){logger[_0x0f20('0x22')](_0x0f20('0x1e'),_0x42d084,_0x48c28d[_0x0f20('0x22')][_0x0f20('0x24')]);return _0x267c51(_0x48c28d['error'][_0x0f20('0x24')]);}logger[_0x0f20('0x22')](_0x0f20('0x1e'),_0x42d084,_0x48c28d[_0x0f20('0x22')][_0x0f20('0x24')]);return _0x38f14b(_0x48c28d[_0x0f20('0x22')][_0x0f20('0x24')]);}else{logger['info'](_0x0f20('0x1e'),_0x42d084,_0x0f20('0x1f'));_0x38f14b(_0x48c28d['result'][_0x0f20('0x24')]);}})[_0x0f20('0x25')](function(_0x3cf389){logger['error'](_0x0f20('0x1e'),_0x42d084,_0x3cf389);_0x267c51(_0x3cf389);});});}function respondWithStatusCode(_0x4cecff,_0x3f19b3){_0x3f19b3=_0x3f19b3||0xcc;return function(_0x549dc3){if(_0x549dc3){return _0x4cecff[_0x0f20('0x26')](_0x3f19b3);}return _0x4cecff[_0x0f20('0x27')](_0x3f19b3)['end']();};}function respondWithResult(_0x54574b,_0x4dd5f3){_0x4dd5f3=_0x4dd5f3||0xc8;return function(_0xc83682){if(_0xc83682){return _0x54574b[_0x0f20('0x27')](_0x4dd5f3)[_0x0f20('0x28')](_0xc83682);}};}function respondWithFilteredResult(_0x4804cd,_0x3f821c){return function(_0x53bee2){if(_0x53bee2){var _0x57e603=typeof _0x3f821c['offset']==='undefined'&&typeof _0x3f821c[_0x0f20('0x29')]===_0x0f20('0x2a');var _0x3ff7bd=_0x53bee2['count'];var _0x3d31a1=_0x57e603?0x0:_0x3f821c[_0x0f20('0x2b')];var _0x38e3aa=_0x57e603?_0x53bee2['count']:_0x3f821c[_0x0f20('0x2b')]+_0x3f821c['limit'];var _0x297dbc;if(_0x38e3aa>=_0x3ff7bd){_0x38e3aa=_0x3ff7bd;_0x297dbc=0xc8;}else{_0x297dbc=0xce;}_0x4804cd[_0x0f20('0x27')](_0x297dbc);return _0x4804cd['set'](_0x0f20('0x2c'),_0x3d31a1+'-'+_0x38e3aa+'/'+_0x3ff7bd)['json'](_0x53bee2);}return null;};}function patchUpdates(_0x4253d5){return function(_0x4d90bd){try{jsonpatch['apply'](_0x4d90bd,_0x4253d5,!![]);}catch(_0x4d161b){return BPromise[_0x0f20('0x2d')](_0x4d161b);}return _0x4d90bd[_0x0f20('0x2e')]();};}function saveUpdates(_0x577d20,_0x1263b7){return function(_0x563814){if(_0x563814){return _0x563814['update'](_0x577d20)[_0x0f20('0x1c')](function(_0x48a20f){return _0x48a20f;});}return null;};}function removeEntity(_0x391cb5,_0x187478){return function(_0x3d47af){if(_0x3d47af){return _0x3d47af[_0x0f20('0x2f')]()[_0x0f20('0x1c')](function(){var _0x854c49=_0x3d47af[_0x0f20('0x30')]({'plain':!![]});var _0x1494e0=_0x0f20('0x31');return db[_0x0f20('0x32')]['destroy']({'where':{'type':_0x1494e0,'resourceId':_0x854c49['id']}})['then'](function(){return _0x3d47af;});})[_0x0f20('0x1c')](function(){_0x391cb5[_0x0f20('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x593c54,_0x44f977){return function(_0x58bef8){if(!_0x58bef8){_0x593c54[_0x0f20('0x26')](0x194);}return _0x58bef8;};}function handleError(_0x4f1c7d,_0x143d69){_0x143d69=_0x143d69||0x1f4;return function(_0x289d6d){logger['error'](_0x289d6d[_0x0f20('0x33')]);if(_0x289d6d[_0x0f20('0x34')]){delete _0x289d6d[_0x0f20('0x34')];}_0x4f1c7d[_0x0f20('0x27')](_0x143d69)[_0x0f20('0x35')](_0x289d6d);};}exports[_0x0f20('0x36')]=function(_0x253da6,_0x5e45ff){var _0x1549ff={'include':[{'model':db[_0x0f20('0x37')],'as':'mandatoryDispositionPause'}]},_0x5d0068={},_0x101397={'count':0x0,'rows':[]};var _0x249ed0=_[_0x0f20('0x38')](db['SmsAccount'][_0x0f20('0x39')],function(_0x496606){return{'name':_0x496606[_0x0f20('0x3a')],'type':_0x496606[_0x0f20('0x3b')][_0x0f20('0x3c')]};});_0x5d0068[_0x0f20('0x3d')]=_[_0x0f20('0x38')](_0x249ed0,_0x0f20('0x34'));_0x5d0068['query']=_['keys'](_0x253da6[_0x0f20('0x3e')]);_0x5d0068['filters']=_[_0x0f20('0x3f')](_0x5d0068[_0x0f20('0x3d')],_0x5d0068[_0x0f20('0x3e')]);_0x1549ff[_0x0f20('0x40')]=_[_0x0f20('0x3f')](_0x5d0068[_0x0f20('0x3d')],qs[_0x0f20('0x41')](_0x253da6[_0x0f20('0x3e')][_0x0f20('0x41')]));_0x1549ff['attributes']=_0x1549ff[_0x0f20('0x40')][_0x0f20('0x42')]?_0x1549ff[_0x0f20('0x40')]:_0x5d0068['model'];if(!_0x253da6[_0x0f20('0x3e')][_0x0f20('0x43')](_0x0f20('0x44'))){_0x1549ff[_0x0f20('0x29')]=qs[_0x0f20('0x29')](_0x253da6['query']['limit']);_0x1549ff[_0x0f20('0x2b')]=qs[_0x0f20('0x2b')](_0x253da6[_0x0f20('0x3e')][_0x0f20('0x2b')]);}_0x1549ff[_0x0f20('0x45')]=qs[_0x0f20('0x46')](_0x253da6[_0x0f20('0x3e')][_0x0f20('0x46')]);_0x1549ff[_0x0f20('0x47')]=qs[_0x0f20('0x48')](_[_0x0f20('0x49')](_0x253da6['query'],_0x5d0068[_0x0f20('0x48')]),_0x249ed0);if(_0x253da6['query']['filter']){_0x1549ff[_0x0f20('0x47')]=_[_0x0f20('0x4a')](_0x1549ff[_0x0f20('0x47')],{'$or':_['map'](_0x249ed0,function(_0x5dda94){if(_0x5dda94['type']!=='VIRTUAL'){var _0x3aa346={};_0x3aa346[_0x5dda94['name']]={'$like':'%'+_0x253da6['query']['filter']+'%'};return _0x3aa346;}})});}_0x1549ff=_[_0x0f20('0x4a')]({},_0x1549ff,_0x253da6[_0x0f20('0x4b')]);var _0x5b9db8={'where':_0x1549ff[_0x0f20('0x47')]};return db[_0x0f20('0x4c')][_0x0f20('0x4d')](_0x5b9db8)[_0x0f20('0x1c')](function(_0x372a04){_0x101397['count']=_0x372a04;if(_0x253da6[_0x0f20('0x3e')][_0x0f20('0x4e')]){_0x1549ff[_0x0f20('0x4f')]=[{'all':!![]}];}return db[_0x0f20('0x4c')]['findAll'](_0x1549ff);})[_0x0f20('0x1c')](function(_0x3a5fca){_0x101397['rows']=_0x3a5fca;return _0x101397;})['then'](respondWithFilteredResult(_0x5e45ff,_0x1549ff))[_0x0f20('0x25')](handleError(_0x5e45ff,null));};exports[_0x0f20('0x50')]=function(_0x327481,_0x25fdba){var _0x455bbb={'raw':![],'where':{'id':_0x327481[_0x0f20('0x51')]['id']},'include':[{'model':db[_0x0f20('0x37')],'as':_0x0f20('0x52')}]},_0x147c1a={};_0x147c1a[_0x0f20('0x3d')]=_['keys'](db['SmsAccount']['rawAttributes']);_0x147c1a[_0x0f20('0x3e')]=_[_0x0f20('0x53')](_0x327481[_0x0f20('0x3e')]);_0x147c1a[_0x0f20('0x48')]=_[_0x0f20('0x3f')](_0x147c1a[_0x0f20('0x3d')],_0x147c1a[_0x0f20('0x3e')]);_0x455bbb[_0x0f20('0x40')]=_[_0x0f20('0x3f')](_0x147c1a[_0x0f20('0x3d')],qs['fields'](_0x327481[_0x0f20('0x3e')][_0x0f20('0x41')]));_0x455bbb['attributes']=_0x455bbb[_0x0f20('0x40')]['length']?_0x455bbb[_0x0f20('0x40')]:_0x147c1a[_0x0f20('0x3d')];if(_0x327481['query'][_0x0f20('0x4e')]){_0x455bbb[_0x0f20('0x4f')]=[{'all':!![]}];}_0x455bbb=_[_0x0f20('0x4a')]({},_0x455bbb,_0x327481[_0x0f20('0x4b')]);return db[_0x0f20('0x4c')]['find'](_0x455bbb)[_0x0f20('0x1c')](handleEntityNotFound(_0x25fdba,null))['then'](respondWithResult(_0x25fdba,null))[_0x0f20('0x25')](handleError(_0x25fdba,null));};exports[_0x0f20('0x54')]=function(_0x4ae959,_0x439771){return db[_0x0f20('0x4c')][_0x0f20('0x54')](_0x4ae959[_0x0f20('0x55')],{})[_0x0f20('0x1c')](function(_0x1688dc){var _0xaf4c19=_0x4ae959['user'][_0x0f20('0x30')]({'plain':!![]});if(!_0xaf4c19)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaf4c19[_0x0f20('0x56')]==='user'){var _0x5215b3=_0x1688dc[_0x0f20('0x30')]({'plain':!![]});var _0x23546e=_0x0f20('0x31');return db[_0x0f20('0x57')][_0x0f20('0x58')]({'where':{'name':_0x23546e,'userProfileId':_0xaf4c19[_0x0f20('0x59')]},'raw':!![]})[_0x0f20('0x1c')](function(_0x138681){if(_0x138681&&_0x138681['autoAssociation']===0x0){return db[_0x0f20('0x32')][_0x0f20('0x54')]({'name':_0x5215b3['name'],'resourceId':_0x5215b3['id'],'type':_0x138681[_0x0f20('0x34')],'sectionId':_0x138681['id']},{})[_0x0f20('0x1c')](function(){return _0x1688dc;});}else{return _0x1688dc;}})[_0x0f20('0x25')](function(_0x5f4572){logger['error'](_0x0f20('0x5a'),_0x5f4572);throw _0x5f4572;});}return _0x1688dc;})[_0x0f20('0x1c')](respondWithResult(_0x439771,0xc9))[_0x0f20('0x25')](handleError(_0x439771,null));};exports[_0x0f20('0x5b')]=function(_0x32a2a8,_0x1e786d){if(_0x32a2a8[_0x0f20('0x55')]['id']){delete _0x32a2a8[_0x0f20('0x55')]['id'];}return db[_0x0f20('0x4c')]['find']({'where':{'id':_0x32a2a8[_0x0f20('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x0f20('0x52')}]})[_0x0f20('0x1c')](handleEntityNotFound(_0x1e786d,null))[_0x0f20('0x1c')](saveUpdates(_0x32a2a8[_0x0f20('0x55')],null))[_0x0f20('0x1c')](respondWithResult(_0x1e786d,null))[_0x0f20('0x25')](handleError(_0x1e786d,null));};exports[_0x0f20('0x2f')]=function(_0x45dba0,_0x4109fe){return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x45dba0[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x4109fe,null))[_0x0f20('0x1c')](removeEntity(_0x4109fe,null))[_0x0f20('0x25')](handleError(_0x4109fe,null));};exports[_0x0f20('0x5c')]=function(_0x1e57a6,_0x2650e8){return db['SmsAccount'][_0x0f20('0x5c')]()['then'](respondWithResult(_0x2650e8,null))[_0x0f20('0x25')](handleError(_0x2650e8,null));};exports[_0x0f20('0x5d')]=function(_0x274095,_0x12a52a,_0x59dfd1){if(_0x274095[_0x0f20('0x55')]['id']){delete _0x274095[_0x0f20('0x55')]['id'];}return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x274095['params']['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x12a52a,null))[_0x0f20('0x1c')](function(_0x4ddce4){if(_0x4ddce4){_0x274095[_0x0f20('0x55')]['SmsAccountId']=_0x4ddce4['id'];return db[_0x0f20('0x5e')][_0x0f20('0x54')](_0x274095[_0x0f20('0x55')]);}})[_0x0f20('0x1c')](respondWithResult(_0x12a52a,null))[_0x0f20('0x25')](handleError(_0x12a52a,null));};exports[_0x0f20('0x5f')]=function(_0x26154d,_0x484d9b,_0x5f4586){var _0x9261ac={'raw':![],'where':{}};var _0xa9023={};var _0x1b7dd7={'count':0x0,'rows':[]};return db[_0x0f20('0x4c')]['findOne']({'where':{'id':_0x26154d['params']['id']}})['then'](handleEntityNotFound(_0x484d9b,null))[_0x0f20('0x1c')](function(_0x41dca8){if(_0x41dca8){_0xa9023[_0x0f20('0x3d')]=_[_0x0f20('0x53')](db[_0x0f20('0x5e')][_0x0f20('0x39')]);_0xa9023[_0x0f20('0x3e')]=_[_0x0f20('0x53')](_0x26154d[_0x0f20('0x3e')]);_0xa9023['filters']=_[_0x0f20('0x3f')](_0xa9023[_0x0f20('0x3d')],_0xa9023['query']);_0x9261ac[_0x0f20('0x40')]=_[_0x0f20('0x3f')](_0xa9023['model'],qs[_0x0f20('0x41')](_0x26154d[_0x0f20('0x3e')][_0x0f20('0x41')]));_0x9261ac[_0x0f20('0x40')]=_0x9261ac['attributes'][_0x0f20('0x42')]?_0x9261ac[_0x0f20('0x40')]:_0xa9023[_0x0f20('0x3d')];if(!_0x26154d['query']['hasOwnProperty'](_0x0f20('0x44'))){_0x9261ac[_0x0f20('0x29')]=qs[_0x0f20('0x29')](_0x26154d[_0x0f20('0x3e')][_0x0f20('0x29')]);_0x9261ac[_0x0f20('0x2b')]=qs[_0x0f20('0x2b')](_0x26154d['query'][_0x0f20('0x2b')]);}_0x9261ac['order']=qs[_0x0f20('0x46')](_0x26154d[_0x0f20('0x3e')][_0x0f20('0x46')]);_0x9261ac[_0x0f20('0x47')]=qs[_0x0f20('0x48')](_[_0x0f20('0x49')](_0x26154d['query'],_0xa9023[_0x0f20('0x48')]));_0x9261ac['where']['SmsAccountId']=_0x41dca8['id'];if(_0x26154d[_0x0f20('0x3e')]['filter']){_0x9261ac[_0x0f20('0x47')]=_[_0x0f20('0x4a')](_0x9261ac['where'],{'$or':_[_0x0f20('0x38')](_0x9261ac['attributes'],function(_0x19e71f){var _0x10889d={};_0x10889d[_0x19e71f]={'$like':'%'+_0x26154d['query']['filter']+'%'};return _0x10889d;})});}_0x9261ac=_['merge']({},_0x9261ac,_0x26154d[_0x0f20('0x4b')]);return db['Disposition'][_0x0f20('0x4d')]({'where':_0x9261ac[_0x0f20('0x47')]})[_0x0f20('0x1c')](function(_0x5a4beb){_0x1b7dd7[_0x0f20('0x4d')]=_0x5a4beb;if(_0x26154d['query'][_0x0f20('0x4e')]){_0x9261ac[_0x0f20('0x4f')]=[{'all':!![]}];}return db[_0x0f20('0x5e')][_0x0f20('0x60')](_0x9261ac);})[_0x0f20('0x1c')](function(_0x178174){_0x1b7dd7['rows']=_0x178174;return _0x1b7dd7;});}})[_0x0f20('0x1c')](respondWithFilteredResult(_0x484d9b,_0x9261ac))[_0x0f20('0x25')](handleError(_0x484d9b,null));};exports[_0x0f20('0x61')]=function(_0x4aab0e,_0x232923,_0x3fd2e0){return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x4aab0e[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x232923,null))['then'](function(_0x58aaa5){if(_0x58aaa5){return _0x58aaa5['removeDispositions'](_0x4aab0e[_0x0f20('0x3e')][_0x0f20('0x62')]);}})[_0x0f20('0x1c')](respondWithStatusCode(_0x232923,null))[_0x0f20('0x25')](handleError(_0x232923,null));};exports['addAnswer']=function(_0x361cce,_0x50cb93,_0x55a79d){if(_0x361cce[_0x0f20('0x55')]['id']){delete _0x361cce['body']['id'];}return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x361cce[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x50cb93,null))[_0x0f20('0x1c')](function(_0x325125){if(_0x325125){_0x361cce['body'][_0x0f20('0x63')]=_0x325125['id'];return db[_0x0f20('0x64')][_0x0f20('0x54')](_0x361cce[_0x0f20('0x55')]);}})[_0x0f20('0x1c')](respondWithResult(_0x50cb93,null))[_0x0f20('0x25')](handleError(_0x50cb93,null));};exports['getAnswers']=function(_0x1bc2cb,_0x21af3c,_0x306a1d){var _0x115351={'raw':![],'where':{}};var _0x2cffef={};var _0x43e687={'count':0x0,'rows':[]};return db[_0x0f20('0x4c')][_0x0f20('0x65')]({'where':{'id':_0x1bc2cb[_0x0f20('0x51')]['id']}})['then'](handleEntityNotFound(_0x21af3c,null))[_0x0f20('0x1c')](function(_0x8a3db8){if(_0x8a3db8){_0x2cffef[_0x0f20('0x3d')]=_[_0x0f20('0x53')](db[_0x0f20('0x64')][_0x0f20('0x39')]);_0x2cffef[_0x0f20('0x3e')]=_[_0x0f20('0x53')](_0x1bc2cb[_0x0f20('0x3e')]);_0x2cffef[_0x0f20('0x48')]=_['intersection'](_0x2cffef[_0x0f20('0x3d')],_0x2cffef['query']);_0x115351[_0x0f20('0x40')]=_[_0x0f20('0x3f')](_0x2cffef[_0x0f20('0x3d')],qs['fields'](_0x1bc2cb[_0x0f20('0x3e')][_0x0f20('0x41')]));_0x115351[_0x0f20('0x40')]=_0x115351['attributes']['length']?_0x115351['attributes']:_0x2cffef[_0x0f20('0x3d')];if(!_0x1bc2cb['query'][_0x0f20('0x43')](_0x0f20('0x44'))){_0x115351[_0x0f20('0x29')]=qs['limit'](_0x1bc2cb['query'][_0x0f20('0x29')]);_0x115351[_0x0f20('0x2b')]=qs[_0x0f20('0x2b')](_0x1bc2cb[_0x0f20('0x3e')][_0x0f20('0x2b')]);}_0x115351['order']=qs[_0x0f20('0x46')](_0x1bc2cb[_0x0f20('0x3e')][_0x0f20('0x46')]);_0x115351['where']=qs[_0x0f20('0x48')](_['pick'](_0x1bc2cb[_0x0f20('0x3e')],_0x2cffef['filters']));_0x115351[_0x0f20('0x47')][_0x0f20('0x63')]=_0x8a3db8['id'];if(_0x1bc2cb[_0x0f20('0x3e')]['filter']){_0x115351[_0x0f20('0x47')]=_[_0x0f20('0x4a')](_0x115351[_0x0f20('0x47')],{'$or':_['map'](_0x115351['attributes'],function(_0x5c7eee){var _0x411cae={};_0x411cae[_0x5c7eee]={'$like':'%'+_0x1bc2cb[_0x0f20('0x3e')][_0x0f20('0x66')]+'%'};return _0x411cae;})});}_0x115351=_[_0x0f20('0x4a')]({},_0x115351,_0x1bc2cb[_0x0f20('0x4b')]);return db['CannedAnswer'][_0x0f20('0x4d')]({'where':_0x115351[_0x0f20('0x47')]})[_0x0f20('0x1c')](function(_0x593a7c){_0x43e687[_0x0f20('0x4d')]=_0x593a7c;if(_0x1bc2cb[_0x0f20('0x3e')]['includeAll']){_0x115351[_0x0f20('0x4f')]=[{'all':!![]}];}return db[_0x0f20('0x64')][_0x0f20('0x60')](_0x115351);})['then'](function(_0xa03b97){_0x43e687[_0x0f20('0x67')]=_0xa03b97;return _0x43e687;});}})['then'](respondWithFilteredResult(_0x21af3c,_0x115351))['catch'](handleError(_0x21af3c,null));};exports[_0x0f20('0x68')]=function(_0x4efe59,_0xc3334,_0x2100a7){return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x4efe59[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0xc3334,null))[_0x0f20('0x1c')](function(_0x880713){if(_0x880713){return _0x880713['removeAnswers'](_0x4efe59[_0x0f20('0x3e')]['ids']);}})[_0x0f20('0x1c')](respondWithStatusCode(_0xc3334,null))['catch'](handleError(_0xc3334,null));};exports[_0x0f20('0x69')]=function(_0x512cfd,_0x15d65d,_0x4993bd){var _0x47a744={'channel':_0x0f20('0x6a')};var _0x41cc22=[];var _0x5565db=[];var _0x55deb7={};return db[_0x0f20('0x4c')]['find']({'where':{'id':_0x512cfd[_0x0f20('0x51')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x0f20('0x1c')](handleEntityNotFound(_0x15d65d,null))[_0x0f20('0x1c')](function(_0x483f2e){_0x47a744[_0x0f20('0x6b')]=_0x483f2e;_0x47a744['applications']=_[_0x0f20('0x6c')](_0x483f2e[_0x0f20('0x6d')],[_0x0f20('0x6e')],[_0x0f20('0x6f')]);if(_0x47a744[_0x0f20('0x6b')]['Applications']){delete _0x47a744[_0x0f20('0x6b')][_0x0f20('0x6d')];}return db[_0x0f20('0x70')]['describe']();})[_0x0f20('0x1c')](function(_0x24c40b){if(!_0x24c40b){throw new db[(_0x0f20('0x71'))][(_0x0f20('0x72'))]('no\x20available\x20attributes');}_0x41cc22=_[_0x0f20('0x73')](_[_0x0f20('0x53')](_0x24c40b),['createdAt',_0x0f20('0x74')]);_0x5565db=_[_0x0f20('0x73')](_[_0x0f20('0x53')](_0x24c40b),[_0x0f20('0x75'),_0x0f20('0x74'),'CompanyId','ListId']);_0x47a744[_0x0f20('0x55')]={'mapKey':_0x0f20('0x76')};if(_0x47a744['account'][_0x0f20('0x3b')]){switch(_0x47a744[_0x0f20('0x6b')][_0x0f20('0x3b')]){case _0x0f20('0x77'):_0x47a744[_0x0f20('0x55')][_0x0f20('0x78')]=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x79')];_0x47a744[_0x0f20('0x55')]['body']=_0x512cfd['body'][_0x0f20('0x7a')];_0x47a744['body'][_0x0f20('0x7b')]=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x7c')];break;case _0x0f20('0x7d'):_0x47a744[_0x0f20('0x55')]['from']='+'+_0x512cfd[_0x0f20('0x55')][_0x0f20('0x7e')];_0x47a744['body'][_0x0f20('0x55')]=_0x512cfd['body'][_0x0f20('0x7f')];break;case _0x0f20('0x80'):_0x47a744['body'][_0x0f20('0x78')]=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x78')];_0x47a744[_0x0f20('0x55')]['body']=_0x512cfd[_0x0f20('0x55')]['message'];break;case _0x0f20('0x81'):_0x47a744[_0x0f20('0x55')][_0x0f20('0x78')]=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x78')];_0x47a744[_0x0f20('0x55')][_0x0f20('0x55')]=_0x512cfd[_0x0f20('0x55')]['body'];_0x47a744[_0x0f20('0x55')][_0x0f20('0x7b')]=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x82')];break;case _0x0f20('0x83'):_0x47a744[_0x0f20('0x55')][_0x0f20('0x78')]=_0x512cfd['body'][_0x0f20('0x79')];_0x47a744[_0x0f20('0x55')][_0x0f20('0x55')]=_0x512cfd[_0x0f20('0x55')]['Text'];_0x47a744['body'][_0x0f20('0x7b')]=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x84')];break;case _0x0f20('0x85'):_0x47a744[_0x0f20('0x55')][_0x0f20('0x78')]='+'+_0x512cfd['body'][_0x0f20('0x86')][0x0][_0x0f20('0x78')];_0x47a744[_0x0f20('0x55')]['body']=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x86')][0x0][_0x0f20('0x7f')];_0x47a744['body'][_0x0f20('0x7b')]=_0x512cfd['body'][_0x0f20('0x86')][0x0][_0x0f20('0x7b')];break;case _0x0f20('0x87'):_0x47a744[_0x0f20('0x55')]['from']=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x88')];_0x47a744['body'][_0x0f20('0x55')]=_0x512cfd['body']['segmentedMessage']['message'];break;case'clickatell':_0x47a744[_0x0f20('0x55')][_0x0f20('0x78')]=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x89')];_0x47a744[_0x0f20('0x55')][_0x0f20('0x55')]=_0x512cfd['body'][_0x0f20('0x7f')];_0x47a744[_0x0f20('0x55')][_0x0f20('0x7b')]=_0x512cfd[_0x0f20('0x55')]['replyMessageId'];break;case _0x0f20('0x8a'):_0x47a744[_0x0f20('0x55')][_0x0f20('0x7b')]=_0x512cfd[_0x0f20('0x55')][0x0][_0x0f20('0x24')]['id'];_0x47a744[_0x0f20('0x55')]['from']=_0x512cfd['body'][0x0][_0x0f20('0x24')][_0x0f20('0x78')];_0x47a744[_0x0f20('0x55')]['body']=_0x512cfd[_0x0f20('0x55')][0x0][_0x0f20('0x24')][_0x0f20('0x7f')];break;case _0x0f20('0x8b'):_0x47a744['body'][_0x0f20('0x78')]=_0x512cfd[_0x0f20('0x55')]['from'];_0x47a744[_0x0f20('0x55')][_0x0f20('0x55')]=_0x512cfd[_0x0f20('0x55')][_0x0f20('0x24')];_0x47a744['body'][_0x0f20('0x7b')]=_0x512cfd['body']['refid'];break;}}if(_0x47a744[_0x0f20('0x55')]['id']){delete _0x47a744['body']['id'];}if(_[_0x0f20('0x8c')](_0x47a744[_0x0f20('0x55')][_0x0f20('0x78')])){throw new db[(_0x0f20('0x71'))][(_0x0f20('0x72'))](_0x0f20('0x8d'));}if(_[_0x0f20('0x8c')](_0x47a744[_0x0f20('0x55')][_0x0f20('0x55')])||_0x47a744[_0x0f20('0x55')][_0x0f20('0x55')]===''){throw new db['Sequelize']['ValidationError'](_0x0f20('0x8e'));}if(_[_0x0f20('0x8c')](_0x47a744[_0x0f20('0x55')][_0x0f20('0x8f')])){throw new db[(_0x0f20('0x71'))][(_0x0f20('0x72'))](_0x0f20('0x90')+_0x5565db);}if(!_['includes'](_0x5565db,_0x47a744[_0x0f20('0x55')][_0x0f20('0x8f')])){throw new db[(_0x0f20('0x71'))][(_0x0f20('0x72'))](_0x0f20('0x91')+_0x5565db);}_0x55deb7[_0x47a744[_0x0f20('0x55')]['mapKey']]=_0x47a744[_0x0f20('0x55')][_0x0f20('0x78')];return db[_0x0f20('0x92')][_0x0f20('0x58')]({'where':{'id':_0x47a744[_0x0f20('0x6b')][_0x0f20('0x93')]},'include':[{'model':db[_0x0f20('0x70')],'as':_0x0f20('0x94'),'where':_0x55deb7,'limit':0x1,'order':[[_0x0f20('0x74'),_0x0f20('0x95')]]}]});})[_0x0f20('0x1c')](handleEntityNotFound(_0x15d65d,null))[_0x0f20('0x1c')](function(_0x588360){if(_0x588360){_0x47a744[_0x0f20('0x96')]=_[_0x0f20('0x97')](_0x588360,['Contacts']);if(_0x588360[_0x0f20('0x94')][_0x0f20('0x42')]){return _0x588360[_0x0f20('0x94')][0x0];}var _0x496e1f=_[_0x0f20('0x14')](_0x47a744[_0x0f20('0x55')],{'firstName':_0x47a744[_0x0f20('0x55')][_0x0f20('0x78')],'ListId':_0x588360['id']});_0x496e1f[_0x47a744[_0x0f20('0x55')][_0x0f20('0x8f')]]=_0x47a744[_0x0f20('0x55')]['from'];return db[_0x0f20('0x70')]['create'](_0x496e1f,{'fields':_0x41cc22,'raw':!![]});}})[_0x0f20('0x1c')](handleEntityNotFound(_0x15d65d,null))['then'](function(_0xc46e52){if(_0xc46e52){_0x47a744[_0x0f20('0x98')]=_0xc46e52;var _0x524b30={'ContactId':_0xc46e52['id'],'phone':_0x47a744['body'][_0x0f20('0x78')],'SmsAccountId':_0x512cfd['params']['id']};var _0xae4b02={'ContactId':_0xc46e52['id'],'SmsAccountId':_0x512cfd[_0x0f20('0x51')]['id'],'closed':![]};return db['SmsInteraction'][_0x0f20('0x58')]({'where':_0xae4b02})[_0x0f20('0x1c')](function(_0x274fd1){if(_0x274fd1){return[_0x274fd1,![]];}return db[_0x0f20('0x99')]['create'](_0x524b30)[_0x0f20('0x1c')](function(_0x68e65){return[_0x68e65,!![]];});});}})[_0x0f20('0x9a')](function(_0x4f6e74,_0x202c7d){_0x47a744[_0x0f20('0x9b')]=_0x4f6e74[_0x0f20('0x30')]({'plain':!![]});_0x47a744[_0x0f20('0x9b')][_0x0f20('0x9c')]=![];if(_0x202c7d){if(_0x47a744['account'][_0x0f20('0x9d')]){_0x47a744['applications'][_0x0f20('0x9e')]({'id':0x0,'priority':_0x47a744[_0x0f20('0x9f')][_0x0f20('0x42')]+0x1,'app':_0x0f20('0xa0'),'appdata':_0x0f20('0xa1'),'interval':_0x0f20('0xa2')});}_0x47a744['interaction'][_0x0f20('0x9c')]=!![];}return db[_0x0f20('0xa3')][_0x0f20('0x54')]({'phone':_0x47a744['body'][_0x0f20('0x78')],'messageId':_0x47a744[_0x0f20('0x55')][_0x0f20('0x7b')],'body':_0x47a744[_0x0f20('0x55')][_0x0f20('0x55')],'SmsAccountId':_0x512cfd['params']['id'],'SmsInteractionId':_0x4f6e74['id'],'direction':'in','ContactId':_0x4f6e74[_0x0f20('0xa4')],'AttachmentId':_0x47a744[_0x0f20('0x55')][_0x0f20('0xa5')]});})[_0x0f20('0x1c')](function(_0x43d664){_0x47a744['message']=_0x43d664;if(_0x47a744[_0x0f20('0x9b')][_0x0f20('0xa6')]){return db['User'][_0x0f20('0x58')]({'attributes':['id','name'],'where':{'id':_0x47a744['interaction'][_0x0f20('0xa6')]}})['then'](function(_0x562e65){if(_0x562e65){_0x47a744[_0x0f20('0x9f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0f20('0xa7'),'appdata':_0x562e65['name']+','+(_0x47a744[_0x0f20('0x6b')][_0x0f20('0xa8')]||0xa),'interval':_0x0f20('0xa2')});}return respondWithRpcPromise(_0x0f20('0xa9'),_0x0f20('0xaa'),_0x47a744);});}return respondWithRpcPromise('Start','startRouting',_0x47a744);})[_0x0f20('0x1c')](function(_0x16a243){if(_0x16a243){var _0x27ee52=0xc8;var _0x5dd07c=_0x0f20('0xab');logger['info'](_0x0f20('0x20'),_0x5dd07c,_0x27ee52,_0x0f20('0xac'));logger[_0x0f20('0xad')](_0x0f20('0xae'),_0x5dd07c,_0x27ee52,'entity\x20found',JSON[_0x0f20('0x21')](_0x16a243));if(_0x47a744[_0x0f20('0x6b')][_0x0f20('0x3b')]===_0x0f20('0x77')){return _0x15d65d[_0x0f20('0x27')](_0x27ee52)[_0x0f20('0xaf')](_0x0f20('0xb0'),'text/xml')['send']('\x0a');}else{return _0x15d65d[_0x0f20('0x27')](_0x27ee52)[_0x0f20('0x28')](_0x16a243);}}})[_0x0f20('0x25')](handleError(_0x15d65d,null));};exports[_0x0f20('0xb1')]=function(_0xc8ff93,_0x2f3382){var _0x21804b=_0xc8ff93['params']['id'];var _0x45af51=_0xc8ff93[_0x0f20('0x55')];var _0x112023=0xc8;var _0x5f0315=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x0f20('0xb2')]['Transaction'][_0x0f20('0xb3')][_0x0f20('0xb4')]},function(_0x335751){return db['SmsAccount'][_0x0f20('0x65')]({'where':{'id':_0x21804b},'transaction':_0x335751})[_0x0f20('0x1c')](function(_0x38d3e2){if(_0x38d3e2){return db[_0x0f20('0xb5')][_0x0f20('0x2f')]({'where':{'SmsAccountId':_0x21804b},'transaction':_0x335751})[_0x0f20('0x1c')](function(){var _0x2e3b1a=_[_0x0f20('0x38')](_0x45af51,function(_0x1eb4a8){_0x1eb4a8['SmsAccountId']=_0x21804b;return _0x1eb4a8;});return db[_0x0f20('0xb5')]['bulkCreate'](_0x2e3b1a,{'transaction':_0x335751});});}else{_0x112023=0x194;_0x5f0315=[];}});})[_0x0f20('0x1c')](function(){if(_0x112023!==0x194){return db[_0x0f20('0xb5')][_0x0f20('0xb6')]({'where':{'SmsAccountId':_0x21804b},'order':_0x0f20('0x6e')})[_0x0f20('0x1c')](function(_0x1332df){_0x5f0315=_0x1332df;});}})[_0x0f20('0x25')](function(_0x53813c){_0x112023=0x1f4;logger['error'](_0x53813c[_0x0f20('0x33')]);if(_0x53813c[_0x0f20('0x34')]){delete _0x53813c['name'];}_0x5f0315=_0x53813c;})[_0x0f20('0xb7')](function(){if(_0x5f0315===null){_0x2f3382[_0x0f20('0x26')](_0x112023);}else{if(_0x112023===0x1f4){_0x2f3382[_0x0f20('0x27')](_0x112023)[_0x0f20('0x35')](_0x5f0315);}else{_0x2f3382[_0x0f20('0x27')](_0x112023)[_0x0f20('0x28')](_0x5f0315);}}});};exports[_0x0f20('0xb8')]=function(_0x287352,_0x4b960b,_0x5d0c01){var _0xa1b369={};var _0x30cd5a={};var _0x539a0e;var _0x481b1f;return db[_0x0f20('0x4c')][_0x0f20('0x65')]({'where':{'id':_0x287352['params']['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x4b960b,null))[_0x0f20('0x1c')](function(_0x1f73e9){if(_0x1f73e9){_0x539a0e=_0x1f73e9;_0x30cd5a[_0x0f20('0x3d')]=_[_0x0f20('0x53')](db[_0x0f20('0xb5')][_0x0f20('0x39')]);_0x30cd5a[_0x0f20('0x3e')]=_[_0x0f20('0x53')](_0x287352[_0x0f20('0x3e')]);_0x30cd5a[_0x0f20('0x48')]=_[_0x0f20('0x3f')](_0x30cd5a[_0x0f20('0x3d')],_0x30cd5a['query']);_0xa1b369['attributes']=_[_0x0f20('0x3f')](_0x30cd5a[_0x0f20('0x3d')],qs['fields'](_0x287352[_0x0f20('0x3e')][_0x0f20('0x41')]));_0xa1b369[_0x0f20('0x40')]=_0xa1b369[_0x0f20('0x40')]['length']?_0xa1b369['attributes']:_0x30cd5a[_0x0f20('0x3d')];_0xa1b369[_0x0f20('0x45')]=qs[_0x0f20('0x46')](_0x287352[_0x0f20('0x3e')]['sort']);_0xa1b369[_0x0f20('0x47')]=qs['filters'](_[_0x0f20('0x49')](_0x287352['query'],_0x30cd5a['filters']));if(_0x287352[_0x0f20('0x3e')]['filter']){_0xa1b369[_0x0f20('0x47')]=_[_0x0f20('0x4a')](_0xa1b369[_0x0f20('0x47')],{'$or':_[_0x0f20('0x38')](_0xa1b369['attributes'],function(_0x56cdc4){var _0x224f0b={};_0x224f0b[_0x56cdc4]={'$like':'%'+_0x287352[_0x0f20('0x3e')][_0x0f20('0x66')]+'%'};return _0x224f0b;})});}_0xa1b369=_[_0x0f20('0x4a')]({},_0xa1b369,_0x287352['options']);return _0x539a0e[_0x0f20('0xb8')](_0xa1b369);}})[_0x0f20('0x1c')](function(_0x7597c9){if(_0x7597c9){_0x481b1f=_0x7597c9[_0x0f20('0x42')];if(!_0x287352[_0x0f20('0x3e')][_0x0f20('0x43')](_0x0f20('0x44'))){_0xa1b369[_0x0f20('0x29')]=qs[_0x0f20('0x29')](_0x287352[_0x0f20('0x3e')][_0x0f20('0x29')]);_0xa1b369[_0x0f20('0x2b')]=qs[_0x0f20('0x2b')](_0x287352[_0x0f20('0x3e')][_0x0f20('0x2b')]);}return _0x539a0e[_0x0f20('0xb8')](_0xa1b369);}})['then'](function(_0x34ae7e){if(_0x34ae7e){return _0x34ae7e?{'count':_0x481b1f,'rows':_0x34ae7e}:null;}})[_0x0f20('0x1c')](respondWithResult(_0x4b960b,null))[_0x0f20('0x25')](handleError(_0x4b960b,null));};exports['getInteractions']=function(_0x310c97,_0x5edcbc,_0x2a4052){var _0x58b4e5={'raw':![],'where':{}};var _0x3cfb2d={};var _0x4c1ec4={'count':0x0,'rows':[]};return db[_0x0f20('0x4c')][_0x0f20('0x65')]({'where':{'id':_0x310c97[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x5edcbc,null))[_0x0f20('0x1c')](function(_0x30c41b){if(_0x30c41b){_0x3cfb2d[_0x0f20('0x3d')]=_[_0x0f20('0x53')](db['SmsInteraction'][_0x0f20('0x39')]);_0x3cfb2d['query']=_[_0x0f20('0x53')](_0x310c97[_0x0f20('0x3e')]);_0x3cfb2d['filters']=_['intersection'](_0x3cfb2d[_0x0f20('0x3d')],_0x3cfb2d[_0x0f20('0x3e')]);_0x58b4e5['attributes']=_['intersection'](_0x3cfb2d['model'],qs[_0x0f20('0x41')](_0x310c97[_0x0f20('0x3e')][_0x0f20('0x41')]));_0x58b4e5['attributes']=_0x58b4e5['attributes'][_0x0f20('0x42')]?_0x58b4e5[_0x0f20('0x40')]:_0x3cfb2d['model'];if(!_0x310c97[_0x0f20('0x3e')][_0x0f20('0x43')](_0x0f20('0x44'))){_0x58b4e5[_0x0f20('0x29')]=qs['limit'](_0x310c97[_0x0f20('0x3e')][_0x0f20('0x29')]);_0x58b4e5[_0x0f20('0x2b')]=qs[_0x0f20('0x2b')](_0x310c97['query'][_0x0f20('0x2b')]);}_0x58b4e5[_0x0f20('0x45')]=qs['sort'](_0x310c97[_0x0f20('0x3e')]['sort']);_0x58b4e5['where']=qs['filters'](_['pick'](_0x310c97[_0x0f20('0x3e')],_0x3cfb2d[_0x0f20('0x48')]));_0x58b4e5[_0x0f20('0x47')][_0x0f20('0x63')]=_0x30c41b['id'];if(_0x310c97[_0x0f20('0x3e')][_0x0f20('0x66')]){_0x58b4e5[_0x0f20('0x47')]=_[_0x0f20('0x4a')](_0x58b4e5[_0x0f20('0x47')],{'$or':_['map'](_0x58b4e5['attributes'],function(_0x32245d){var _0x133d33={};_0x133d33[_0x32245d]={'$like':'%'+_0x310c97[_0x0f20('0x3e')][_0x0f20('0x66')]+'%'};return _0x133d33;})});}_0x58b4e5=_[_0x0f20('0x4a')]({},_0x58b4e5,_0x310c97[_0x0f20('0x4b')]);return db[_0x0f20('0x99')][_0x0f20('0x4d')]({'where':_0x58b4e5[_0x0f20('0x47')]})[_0x0f20('0x1c')](function(_0x2999b1){_0x4c1ec4['count']=_0x2999b1;if(_0x310c97['query'][_0x0f20('0x4e')]){_0x58b4e5[_0x0f20('0x4f')]=[{'model':db[_0x0f20('0x70')],'as':_0x0f20('0xb9'),'required':![]},{'model':db['User'],'as':_0x0f20('0xba'),'attributes':[_0x0f20('0x34'),_0x0f20('0xbb'),'internal'],'required':![]},{'model':db[_0x0f20('0xbc')],'as':_0x0f20('0xbd'),'attributes':['id',_0x0f20('0x34'),_0x0f20('0xbe')],'where':_0x310c97[_0x0f20('0x3e')][_0x0f20('0xbf')]?{'id':_0x310c97[_0x0f20('0x3e')][_0x0f20('0xbf')]}:undefined,'required':_0x310c97[_0x0f20('0x3e')][_0x0f20('0xbf')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x58b4e5);})[_0x0f20('0x1c')](function(_0x3c3197){_0x4c1ec4[_0x0f20('0x67')]=_0x3c3197;return _0x4c1ec4;});}})[_0x0f20('0x1c')](respondWithFilteredResult(_0x5edcbc,_0x58b4e5))[_0x0f20('0x25')](handleError(_0x5edcbc,null));};exports[_0x0f20('0x35')]=function(_0x8e08c0,_0x4904b1,_0x4f887c){var _0x4bd8d6,_0x52fc0d,_0x5f43f0;if(_[_0x0f20('0x8c')](_0x8e08c0[_0x0f20('0x55')][_0x0f20('0x55')])||_0x8e08c0[_0x0f20('0x55')]['body']===''){throw new db[(_0x0f20('0x71'))][(_0x0f20('0x72'))](_0x0f20('0x8e'));}if(_[_0x0f20('0x8c')](_0x8e08c0['body']['to'])){throw new db['Sequelize']['ValidationError'](_0x0f20('0xc0'));}_0x4bd8d6=_0x8e08c0['body']['to'];return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x8e08c0[_0x0f20('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0x0f20('0xc1'),'include':[{'model':db[_0x0f20('0x70')],'as':_0x0f20('0x94'),'where':{'mobile':_0x4bd8d6},'limit':0x1,'order':[[_0x0f20('0x74'),_0x0f20('0x95')]]}]}]})[_0x0f20('0x1c')](handleEntityNotFound(_0x4904b1,null))[_0x0f20('0x1c')](function(_0x50f349){if(_0x50f349&&_0x50f349[_0x0f20('0xc1')]){_0x52fc0d=_0x50f349[_0x0f20('0x30')]({'plain':!![]});if(_0x52fc0d[_0x0f20('0xc1')]&&_0x52fc0d['List']['Contacts'][_0x0f20('0x42')]){return _0x52fc0d[_0x0f20('0xc1')]['Contacts'][0x0];}return db[_0x0f20('0x70')][_0x0f20('0x54')](_['defaults'](_0x8e08c0[_0x0f20('0x55')],{'firstName':_0x4bd8d6,'mobile':_0x4bd8d6,'phone':_0x4bd8d6,'ListId':_0x52fc0d[_0x0f20('0x93')]}));}})[_0x0f20('0x1c')](handleEntityNotFound(_0x4904b1,null))[_0x0f20('0x1c')](function(_0x38e4c7){if(_0x38e4c7){_0x5f43f0=_0x38e4c7;return db[_0x0f20('0x99')][_0x0f20('0x58')]({'where':{'ContactId':_0x5f43f0['id'],'closed':![],'SmsAccountId':_0x52fc0d['id']}})['then'](function(_0x263b6d){if(_0x263b6d){return[_0x263b6d,![]];}return db['SmsInteraction'][_0x0f20('0x54')]({'UserId':_0x8e08c0[_0x0f20('0xc2')]['id'],'ContactId':_0x5f43f0['id'],'SmsAccountId':_0x52fc0d['id'],'phone':_0x4bd8d6,'firstMsgDirection':'out','Messages':[_['merge'](_0x8e08c0[_0x0f20('0x55')],{'read':![],'body':_0x8e08c0['body'][_0x0f20('0x55')],'phone':_0x4bd8d6,'SmsAccountId':_0x52fc0d['id'],'UserId':_0x8e08c0[_0x0f20('0xc2')]['id'],'ContactId':_0x5f43f0['id']})]},{'include':[{'model':db[_0x0f20('0xa3')],'as':_0x0f20('0xc3')}]})[_0x0f20('0x1c')](function(_0x34be56){return[_0x34be56,!![]];});});}})['spread'](function(_0x55b204,_0x42a4a6){if(_0x42a4a6){return _0x55b204;}return db['SmsMessage']['create'](_[_0x0f20('0x4a')](_0x8e08c0[_0x0f20('0x55')],{'read':![],'body':_0x8e08c0[_0x0f20('0x55')][_0x0f20('0x55')],'phone':_0x4bd8d6,'SmsAccountId':_0x52fc0d['id'],'SmsInteractionId':_0x55b204['id'],'UserId':_0x8e08c0[_0x0f20('0xc2')]['id'],'ContactId':_0x5f43f0['id']}))['then'](function(_0x22627){_0x55b204[_0x0f20('0xc4')][_0x0f20('0xc3')]=[];_0x55b204['dataValues'][_0x0f20('0xc3')][_0x0f20('0x9e')](_0x22627['dataValues']);return _0x55b204;});})[_0x0f20('0x1c')](respondWithResult(_0x4904b1,null))[_0x0f20('0x25')](handleError(_0x4904b1,null));};exports[_0x0f20('0x27')]=function(_0x622d6,_0x5e28f4,_0x4bf36e){if(_0x622d6[_0x0f20('0x55')]['id']){delete _0x622d6[_0x0f20('0x55')]['id'];}var _0xdd7a3c,_0x1bc01e,_0x13bed5;return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x622d6[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x5e28f4,null))[_0x0f20('0x1c')](function(_0x50714e){if(_0x50714e){_0x13bed5=_0x50714e;logger[_0x0f20('0xad')](_0x0f20('0x20'),_0x0f20('0x27'),'received\x20delivery\x20report\x20from',_0x50714e[_0x0f20('0x3b')],util[_0x0f20('0xc5')](_0x622d6[_0x0f20('0x55')],{'showHidden':![],'depth':null}));switch(_0x50714e['type']){case _0x0f20('0x7d'):if(_0x622d6[_0x0f20('0x55')][_0x0f20('0xc6')]&&_0x622d6['body'][_0x0f20('0x27')]){_0x1bc01e=_0x622d6[_0x0f20('0x55')][_0x0f20('0x27')];return db['SmsMessage'][_0x0f20('0x58')]({'where':{'messageId':_0x622d6[_0x0f20('0x55')][_0x0f20('0xc6')]}});}break;case _0x0f20('0x80'):if(_0x622d6['body']['requestid']&&_0x622d6['body'][_0x0f20('0xc7')]){_0x1bc01e=_0x622d6[_0x0f20('0x55')][_0x0f20('0xc7')];return db[_0x0f20('0xa3')]['find']({'where':{'messageId':_0x622d6[_0x0f20('0x55')]['requestid']}});}break;case'clicksend':if(_0x622d6[_0x0f20('0x55')][_0x0f20('0x82')]&&_0x622d6[_0x0f20('0x55')][_0x0f20('0xc8')]){_0x1bc01e=_0x622d6[_0x0f20('0x55')][_0x0f20('0xc8')];return db[_0x0f20('0xa3')]['find']({'where':{'messageId':_0x622d6[_0x0f20('0x55')]['message_id']}});}break;case'infobip':var _0x54f756=_0x622d6[_0x0f20('0x55')][_0x0f20('0x86')][0x0];if(_0x54f756[_0x0f20('0x7b')]&&_0x54f756[_0x0f20('0x27')][_0x0f20('0xc9')]===_0x0f20('0xca')){_0x1bc01e=_0x54f756[_0x0f20('0x27')]['groupName'];return db[_0x0f20('0xa3')]['find']({'where':{'messageId':_0x54f756[_0x0f20('0x7b')]}});}break;case'clickatell':if(_0x622d6['body'][_0x0f20('0x7b')]&&_0x622d6['body'][_0x0f20('0x27')]){_0x1bc01e=_0x622d6[_0x0f20('0x55')][_0x0f20('0x27')];return db[_0x0f20('0xa3')][_0x0f20('0x58')]({'where':{'messageId':_0x622d6[_0x0f20('0x55')]['messageId']}});}break;case _0x0f20('0x8a'):if(_0x622d6[_0x0f20('0x55')][0x0][_0x0f20('0x24')]['id']){_0x1bc01e=_0x622d6[_0x0f20('0x55')][0x0][_0x0f20('0x3b')];return db[_0x0f20('0xa3')][_0x0f20('0x58')]({'where':{'messageId':_0x622d6[_0x0f20('0x55')][0x0][_0x0f20('0x24')]['id']}});}break;case _0x0f20('0x8b'):if(_0x622d6['body'][_0x0f20('0xcb')]&&_0x622d6['body'][_0x0f20('0x27')]){_0x1bc01e=_0x622d6[_0x0f20('0x55')]['status'];return db['SmsMessage'][_0x0f20('0x58')]({'where':{'messageId':_0x622d6[_0x0f20('0x55')][_0x0f20('0xcb')]}});}break;}}})[_0x0f20('0x1c')](handleEntityNotFound(_0x5e28f4,null))[_0x0f20('0x1c')](function(_0x36da70){if(_0x36da70){_0xdd7a3c=_0x36da70;switch(_0x13bed5['type']){case _0x0f20('0x7d'):if(_0x1bc01e===_0x0f20('0xca')){return _0xdd7a3c[_0x0f20('0x5b')]({'read':!![]});}else{logger[_0x0f20('0x22')](_0x0f20('0x20'),_0x0f20('0x27'),_0x0f20('0x7d'),util['inspect'](_0x622d6[_0x0f20('0x55')],{'showHidden':![],'depth':null}));}break;case _0x0f20('0x80'):if(_0x1bc01e==='1'){return _0xdd7a3c[_0x0f20('0x5b')]({'read':!![]});}else{logger[_0x0f20('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0f20('0x27'),_0x0f20('0x7d'),util[_0x0f20('0xc5')](_0x622d6[_0x0f20('0x55')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x622d6['body']['error_code']&&_0x1bc01e>=0xc8&&_0x1bc01e<=0xce){return _0xdd7a3c[_0x0f20('0x5b')]({'read':!![]});}else{logger[_0x0f20('0x22')](_0x0f20('0x20'),'status',_0x0f20('0x81'),util['inspect'](_0x622d6[_0x0f20('0x55')],{'showHidden':![],'depth':null}));}break;case _0x0f20('0x85'):var _0x21cb5b=_0x622d6[_0x0f20('0x55')][_0x0f20('0x86')][0x0];if(_0x21cb5b[_0x0f20('0x27')][_0x0f20('0xc9')]==='DELIVERED'){return _0xdd7a3c['update']({'read':!![]});}else{logger[_0x0f20('0x22')](_0x0f20('0x20'),'status',_0x0f20('0x85'),util['inspect'](_0x622d6[_0x0f20('0x55')],{'showHidden':![],'depth':null}));}break;case _0x0f20('0xcc'):if(_0x1bc01e=='DELIVERED_TO_GATEWAY'||_0x1bc01e==_0x0f20('0xcd')){return _0xdd7a3c['update']({'read':!![]});}else{logger[_0x0f20('0x22')](_0x0f20('0x20'),'status',_0x0f20('0xcc'),util[_0x0f20('0xc5')](_0x622d6[_0x0f20('0x55')],{'showHidden':![],'depth':null}));}break;case _0x0f20('0x8a'):if(_0x1bc01e==_0x0f20('0xce')){return _0xdd7a3c[_0x0f20('0x5b')]({'read':!![]});}else{logger[_0x0f20('0x22')](_0x0f20('0x20'),'status',_0x0f20('0x8a'),util[_0x0f20('0xc5')](_0x622d6['body'],{'showHidden':![],'depth':null}));}break;case _0x0f20('0x8b'):if(_0x1bc01e==='DELIVRD'||_0x1bc01e===_0x0f20('0xcf')){return _0xdd7a3c[_0x0f20('0x5b')]({'read':!![]});}else{logger[_0x0f20('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0f20('0x8b'),util[_0x0f20('0xc5')](_0x622d6[_0x0f20('0x55')],{'showHidden':![],'depth':null}));}break;}return _0xdd7a3c;}})[_0x0f20('0x1c')](respondWithResult(_0x5e28f4,null))[_0x0f20('0x25')](handleError(_0x5e28f4,null));};exports[_0x0f20('0xd0')]=function(_0x48e793,_0x24f379,_0x595e4d){var _0x3f9071,_0x29cd17,_0x4e2865;return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x48e793[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x24f379,null))[_0x0f20('0x1c')](function(_0x28d4a1){if(_0x28d4a1){_0x4e2865=_0x28d4a1;logger[_0x0f20('0xad')](_0x0f20('0x20'),_0x0f20('0x27'),'received\x20delivery\x20report\x20from',_0x28d4a1[_0x0f20('0x3b')],util[_0x0f20('0xc5')](_0x48e793[_0x0f20('0x3e')],{'showHidden':![],'depth':null}));switch(_0x28d4a1[_0x0f20('0x3b')]){case _0x0f20('0x87'):if(_0x48e793['query']['message-id']&&_0x48e793[_0x0f20('0x3e')][_0x0f20('0xd1')]){_0x29cd17=_0x48e793[_0x0f20('0x3e')]['state'];return db[_0x0f20('0xa3')][_0x0f20('0x58')]({'where':{'messageId':_0x48e793[_0x0f20('0x3e')][_0x0f20('0xd2')]}});}break;}}})[_0x0f20('0x1c')](handleEntityNotFound(_0x24f379,null))[_0x0f20('0x1c')](function(_0x13b863){if(_0x13b863){_0x3f9071=_0x13b863;switch(_0x4e2865[_0x0f20('0x3b')]){case _0x0f20('0x87'):if(_0x29cd17==='2'||_0x29cd17==='6'){return _0x3f9071[_0x0f20('0x5b')]({'read':!![]});}else{logger[_0x0f20('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0f20('0x27'),_0x0f20('0x87'),util[_0x0f20('0xc5')](_0x48e793['query'],{'showHidden':![],'depth':null}));};break;}return _0x3f9071;}})[_0x0f20('0x1c')](respondWithResult(_0x24f379,null))[_0x0f20('0x25')](handleError(_0x24f379,null));};exports[_0x0f20('0xd3')]=function(_0x2122b2,_0x24a8db,_0x4ae8a9){return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x2122b2[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x24a8db,null))[_0x0f20('0x1c')](function(_0x5a1c0d){if(_0x5a1c0d){return _0x5a1c0d['addAgents'](_0x2122b2[_0x0f20('0x55')]['ids'],_[_0x0f20('0x97')](_0x2122b2[_0x0f20('0x55')],[_0x0f20('0x62'),'id'])||{})[_0x0f20('0x9a')](function(_0x1ec5de){for(var _0x18e558=0x0;_0x18e558<_0x2122b2[_0x0f20('0x55')]['ids']['length'];_0x18e558+=0x1){socket[_0x0f20('0xd4')](_0x0f20('0xd5'),{'UserId':Number(_0x2122b2['body'][_0x0f20('0x62')][_0x18e558]),'SmsAccountId':Number(_0x2122b2[_0x0f20('0x51')]['id'])});}return _0x1ec5de;});}})[_0x0f20('0x1c')](respondWithResult(_0x24a8db,null))[_0x0f20('0x25')](handleError(_0x24a8db,null));};exports[_0x0f20('0xd6')]=function(_0x4a5ee7,_0x1beee1,_0x201f19){return db[_0x0f20('0x4c')][_0x0f20('0x58')]({'where':{'id':_0x4a5ee7[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x1beee1,null))[_0x0f20('0x1c')](function(_0x545f57){if(_0x545f57){return _0x545f57[_0x0f20('0xd6')](_0x4a5ee7['query']['ids'])[_0x0f20('0x1c')](function(){if(_['isArray'](_0x4a5ee7[_0x0f20('0x3e')][_0x0f20('0x62')])){for(var _0x3bee0c=0x0;_0x3bee0c<_0x4a5ee7[_0x0f20('0x3e')][_0x0f20('0x62')][_0x0f20('0x42')];_0x3bee0c+=0x1){socket[_0x0f20('0xd4')](_0x0f20('0xd7'),{'UserId':Number(_0x4a5ee7[_0x0f20('0x3e')][_0x0f20('0x62')][_0x3bee0c]),'SmsAccountId':Number(_0x4a5ee7[_0x0f20('0x51')]['id'])});}}else{socket[_0x0f20('0xd4')](_0x0f20('0xd7'),{'UserId':Number(_0x4a5ee7[_0x0f20('0x3e')][_0x0f20('0x62')]),'SmsAccountId':Number(_0x4a5ee7[_0x0f20('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x1beee1,null))[_0x0f20('0x25')](handleError(_0x1beee1,null));};exports[_0x0f20('0xd8')]=function(_0x5c2ba3,_0x2460a2,_0x1b9f55){var _0x158786={};var _0x5c5553={};var _0x214def;var _0x3ae74d;return db[_0x0f20('0x4c')][_0x0f20('0x65')]({'where':{'id':_0x5c2ba3[_0x0f20('0x51')]['id']}})[_0x0f20('0x1c')](handleEntityNotFound(_0x2460a2,null))[_0x0f20('0x1c')](function(_0x433e4e){if(_0x433e4e){_0x214def=_0x433e4e;_0x5c5553[_0x0f20('0x3d')]=_[_0x0f20('0x53')](db[_0x0f20('0xd9')][_0x0f20('0x39')]);_0x5c5553[_0x0f20('0x3e')]=_[_0x0f20('0x53')](_0x5c2ba3[_0x0f20('0x3e')]);_0x5c5553[_0x0f20('0x48')]=_[_0x0f20('0x3f')](_0x5c5553['model'],_0x5c5553['query']);_0x158786[_0x0f20('0x40')]=_[_0x0f20('0x3f')](_0x5c5553[_0x0f20('0x3d')],qs[_0x0f20('0x41')](_0x5c2ba3[_0x0f20('0x3e')][_0x0f20('0x41')]));_0x158786[_0x0f20('0x40')]=_0x158786['attributes']['length']?_0x158786[_0x0f20('0x40')]:_0x5c5553[_0x0f20('0x3d')];_0x158786[_0x0f20('0x45')]=qs[_0x0f20('0x46')](_0x5c2ba3[_0x0f20('0x3e')]['sort']);_0x158786[_0x0f20('0x47')]=qs[_0x0f20('0x48')](_[_0x0f20('0x49')](_0x5c2ba3[_0x0f20('0x3e')],_0x5c5553[_0x0f20('0x48')]));if(_0x5c2ba3[_0x0f20('0x3e')][_0x0f20('0x66')]){_0x158786['where']=_[_0x0f20('0x4a')](_0x158786[_0x0f20('0x47')],{'$or':_[_0x0f20('0x38')](_0x158786[_0x0f20('0x40')],function(_0x50649c){var _0x567728={};_0x567728[_0x50649c]={'$like':'%'+_0x5c2ba3['query']['filter']+'%'};return _0x567728;})});}_0x158786=_['merge']({},_0x158786,_0x5c2ba3['options']);return _0x214def[_0x0f20('0xd8')](_0x158786);}})[_0x0f20('0x1c')](function(_0x4fe682){if(_0x4fe682){_0x3ae74d=_0x4fe682[_0x0f20('0x42')];if(!_0x5c2ba3[_0x0f20('0x3e')][_0x0f20('0x43')](_0x0f20('0x44'))){_0x158786[_0x0f20('0x29')]=qs[_0x0f20('0x29')](_0x5c2ba3[_0x0f20('0x3e')]['limit']);_0x158786['offset']=qs[_0x0f20('0x2b')](_0x5c2ba3['query'][_0x0f20('0x2b')]);}return _0x214def[_0x0f20('0xd8')](_0x158786);}})['then'](function(_0x5e95b8){if(_0x5e95b8){return _0x5e95b8?{'count':_0x3ae74d,'rows':_0x5e95b8}:null;}})['then'](respondWithResult(_0x2460a2,null))[_0x0f20('0x25')](handleError(_0x2460a2,null));}; \ No newline at end of file +var _0x0c10=['Pause','map','SmsAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','mandatoryDispositionPause','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','notify','sms','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','mobile','twilio','from','Body','MessageSid','skebby','sender','connectel','clicksend','messageId','message_id','plivo','From','Text','MessageUUID','results','text','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','ListId','Contacts','DESC','list','defaults','contact','SmsInteraction','autoclose','push','close','*,*,*,*','interaction','created','SmsMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','SmsApplication','stack','getApplications','nolimit','getInteractions','Contact','Owner','fullname','Tags','color','tag','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','csc','state','message-id','addAgents','spread','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','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/license/util','../../mysqldb','redis','./smsAccount.socket','register','request','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','SmsAccounts','name','send'];(function(_0x55717d,_0x24d4db){var _0x544dba=function(_0x1b4bf8){while(--_0x1b4bf8){_0x55717d['push'](_0x55717d['shift']());}};_0x544dba(++_0x24d4db);}(_0x0c10,0xa8));var _0x00c1=function(_0x53fda3,_0x5cc847){_0x53fda3=_0x53fda3-0x0;var _0x3c0742=_0x0c10[_0x53fda3];return _0x3c0742;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00c1('0x0'));var zipdir=require(_0x00c1('0x1'));var jsonpatch=require(_0x00c1('0x2'));var rp=require(_0x00c1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x00c1('0x4'));var sox=require(_0x00c1('0x5'));var csv=require(_0x00c1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00c1('0x7'));var _=require(_0x00c1('0x8'));var squel=require('squel');var crypto=require(_0x00c1('0x9'));var jsforce=require(_0x00c1('0xa'));var deskjs=require(_0x00c1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x00c1('0xc'));var Papa=require(_0x00c1('0xd'));var Redis=require(_0x00c1('0xe'));var authService=require(_0x00c1('0xf'));var qs=require(_0x00c1('0x10'));var as=require(_0x00c1('0x11'));var hardwareService=require(_0x00c1('0x12'));var logger=require(_0x00c1('0x13'))('api');var utils=require(_0x00c1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x00c1('0x15'));var db=require(_0x00c1('0x16'))['db'];config[_0x00c1('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x00c1('0x18'))[_0x00c1('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3b9dd6,_0x23a4cb,_0xe23531,_0x321506){return new BPromise(function(_0x1eba94,_0x5b2cdd){var _0x46e8ab=_0x321506||client;return _0x46e8ab[_0x00c1('0x1a')](_0x3b9dd6,_0xe23531)['then'](function(_0x58b399){logger['info']('SmsAccount,\x20%s,\x20%s',_0x23a4cb,_0x00c1('0x1b'));logger[_0x00c1('0x1c')](_0x00c1('0x1d'),_0x23a4cb,_0x00c1('0x1b'),JSON['stringify'](_0x58b399));if(_0x58b399[_0x00c1('0x1e')]){if(_0x58b399['error'][_0x00c1('0x1f')]===0x1f4){logger[_0x00c1('0x1e')](_0x00c1('0x20'),_0x23a4cb,_0x58b399[_0x00c1('0x1e')]['message']);return _0x5b2cdd(_0x58b399[_0x00c1('0x1e')][_0x00c1('0x21')]);}logger['error'](_0x00c1('0x20'),_0x23a4cb,_0x58b399[_0x00c1('0x1e')]['message']);return _0x1eba94(_0x58b399[_0x00c1('0x1e')][_0x00c1('0x21')]);}else{logger[_0x00c1('0x22')](_0x00c1('0x20'),_0x23a4cb,_0x00c1('0x1b'));_0x1eba94(_0x58b399[_0x00c1('0x23')]['message']);}})[_0x00c1('0x24')](function(_0x14da54){logger[_0x00c1('0x1e')](_0x00c1('0x20'),_0x23a4cb,_0x14da54);_0x5b2cdd(_0x14da54);});});}function respondWithStatusCode(_0x5e727c,_0xb25703){_0xb25703=_0xb25703||0xcc;return function(_0x3f6f94){if(_0x3f6f94){return _0x5e727c[_0x00c1('0x25')](_0xb25703);}return _0x5e727c[_0x00c1('0x26')](_0xb25703)['end']();};}function respondWithResult(_0x48364a,_0x463923){_0x463923=_0x463923||0xc8;return function(_0x5b90e3){if(_0x5b90e3){return _0x48364a[_0x00c1('0x26')](_0x463923)[_0x00c1('0x27')](_0x5b90e3);}};}function respondWithFilteredResult(_0x405ae6,_0xa5f8d5){return function(_0x5ee53d){if(_0x5ee53d){var _0xc6618d=typeof _0xa5f8d5[_0x00c1('0x28')]===_0x00c1('0x29')&&typeof _0xa5f8d5[_0x00c1('0x2a')]==='undefined';var _0x514c83=_0x5ee53d[_0x00c1('0x2b')];var _0x475775=_0xc6618d?0x0:_0xa5f8d5['offset'];var _0x30cace=_0xc6618d?_0x5ee53d[_0x00c1('0x2b')]:_0xa5f8d5[_0x00c1('0x28')]+_0xa5f8d5[_0x00c1('0x2a')];var _0x2eaa99;if(_0x30cace>=_0x514c83){_0x30cace=_0x514c83;_0x2eaa99=0xc8;}else{_0x2eaa99=0xce;}_0x405ae6[_0x00c1('0x26')](_0x2eaa99);return _0x405ae6[_0x00c1('0x2c')](_0x00c1('0x2d'),_0x475775+'-'+_0x30cace+'/'+_0x514c83)[_0x00c1('0x27')](_0x5ee53d);}return null;};}function patchUpdates(_0x4e731c){return function(_0xe4e061){try{jsonpatch['apply'](_0xe4e061,_0x4e731c,!![]);}catch(_0xe7a748){return BPromise['reject'](_0xe7a748);}return _0xe4e061['save']();};}function saveUpdates(_0x345205,_0x6db468){return function(_0x17fe07){if(_0x17fe07){return _0x17fe07[_0x00c1('0x2e')](_0x345205)['then'](function(_0x15b229){return _0x15b229;});}return null;};}function removeEntity(_0x320e6d,_0x42713b){return function(_0x36861c){if(_0x36861c){return _0x36861c[_0x00c1('0x2f')]()[_0x00c1('0x30')](function(){var _0x38c75f=_0x36861c[_0x00c1('0x31')]({'plain':!![]});var _0x4ffbf7=_0x00c1('0x32');return db['UserProfileResource'][_0x00c1('0x2f')]({'where':{'type':_0x4ffbf7,'resourceId':_0x38c75f['id']}})['then'](function(){return _0x36861c;});})[_0x00c1('0x30')](function(){_0x320e6d[_0x00c1('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57cad4,_0x1c1a32){return function(_0x4a6e3b){if(!_0x4a6e3b){_0x57cad4['sendStatus'](0x194);}return _0x4a6e3b;};}function handleError(_0x5ae52a,_0x7cc07c){_0x7cc07c=_0x7cc07c||0x1f4;return function(_0x5a5396){logger[_0x00c1('0x1e')](_0x5a5396['stack']);if(_0x5a5396[_0x00c1('0x33')]){delete _0x5a5396[_0x00c1('0x33')];}_0x5ae52a[_0x00c1('0x26')](_0x7cc07c)[_0x00c1('0x34')](_0x5a5396);};}exports['index']=function(_0x268cf0,_0x1593d4){var _0x4b2c6d={'include':[{'model':db[_0x00c1('0x35')],'as':'mandatoryDispositionPause'}]},_0x1019ca={},_0x45edd6={'count':0x0,'rows':[]};var _0x5ea885=_[_0x00c1('0x36')](db[_0x00c1('0x37')][_0x00c1('0x38')],function(_0xb2ecfa){return{'name':_0xb2ecfa['fieldName'],'type':_0xb2ecfa[_0x00c1('0x39')][_0x00c1('0x3a')]};});_0x1019ca[_0x00c1('0x3b')]=_[_0x00c1('0x36')](_0x5ea885,_0x00c1('0x33'));_0x1019ca[_0x00c1('0x3c')]=_[_0x00c1('0x3d')](_0x268cf0[_0x00c1('0x3c')]);_0x1019ca[_0x00c1('0x3e')]=_[_0x00c1('0x3f')](_0x1019ca[_0x00c1('0x3b')],_0x1019ca['query']);_0x4b2c6d[_0x00c1('0x40')]=_[_0x00c1('0x3f')](_0x1019ca[_0x00c1('0x3b')],qs[_0x00c1('0x41')](_0x268cf0[_0x00c1('0x3c')]['fields']));_0x4b2c6d[_0x00c1('0x40')]=_0x4b2c6d['attributes'][_0x00c1('0x42')]?_0x4b2c6d[_0x00c1('0x40')]:_0x1019ca[_0x00c1('0x3b')];if(!_0x268cf0['query'][_0x00c1('0x43')]('nolimit')){_0x4b2c6d[_0x00c1('0x2a')]=qs[_0x00c1('0x2a')](_0x268cf0[_0x00c1('0x3c')][_0x00c1('0x2a')]);_0x4b2c6d[_0x00c1('0x28')]=qs[_0x00c1('0x28')](_0x268cf0['query'][_0x00c1('0x28')]);}_0x4b2c6d[_0x00c1('0x44')]=qs[_0x00c1('0x45')](_0x268cf0[_0x00c1('0x3c')][_0x00c1('0x45')]);_0x4b2c6d[_0x00c1('0x46')]=qs[_0x00c1('0x3e')](_[_0x00c1('0x47')](_0x268cf0[_0x00c1('0x3c')],_0x1019ca['filters']),_0x5ea885);if(_0x268cf0['query'][_0x00c1('0x48')]){_0x4b2c6d['where']=_[_0x00c1('0x49')](_0x4b2c6d[_0x00c1('0x46')],{'$or':_[_0x00c1('0x36')](_0x5ea885,function(_0x166ea8){if(_0x166ea8[_0x00c1('0x39')]!==_0x00c1('0x4a')){var _0x4a29d4={};_0x4a29d4[_0x166ea8[_0x00c1('0x33')]]={'$like':'%'+_0x268cf0['query']['filter']+'%'};return _0x4a29d4;}})});}_0x4b2c6d=_[_0x00c1('0x49')]({},_0x4b2c6d,_0x268cf0['options']);var _0x5a14fb={'where':_0x4b2c6d[_0x00c1('0x46')]};return db['SmsAccount'][_0x00c1('0x2b')](_0x5a14fb)[_0x00c1('0x30')](function(_0x51f59a){_0x45edd6[_0x00c1('0x2b')]=_0x51f59a;if(_0x268cf0[_0x00c1('0x3c')][_0x00c1('0x4b')]){_0x4b2c6d[_0x00c1('0x4c')]=[{'all':!![]}];}return db[_0x00c1('0x37')][_0x00c1('0x4d')](_0x4b2c6d);})['then'](function(_0x865b95){_0x45edd6['rows']=_0x865b95;return _0x45edd6;})[_0x00c1('0x30')](respondWithFilteredResult(_0x1593d4,_0x4b2c6d))['catch'](handleError(_0x1593d4,null));};exports[_0x00c1('0x4e')]=function(_0x587c19,_0x3a8818){var _0x56326e={'raw':![],'where':{'id':_0x587c19[_0x00c1('0x4f')]['id']},'include':[{'model':db[_0x00c1('0x35')],'as':_0x00c1('0x50')}]},_0x3705cc={};_0x3705cc[_0x00c1('0x3b')]=_[_0x00c1('0x3d')](db[_0x00c1('0x37')][_0x00c1('0x38')]);_0x3705cc[_0x00c1('0x3c')]=_[_0x00c1('0x3d')](_0x587c19[_0x00c1('0x3c')]);_0x3705cc[_0x00c1('0x3e')]=_[_0x00c1('0x3f')](_0x3705cc[_0x00c1('0x3b')],_0x3705cc[_0x00c1('0x3c')]);_0x56326e[_0x00c1('0x40')]=_['intersection'](_0x3705cc[_0x00c1('0x3b')],qs['fields'](_0x587c19['query']['fields']));_0x56326e[_0x00c1('0x40')]=_0x56326e[_0x00c1('0x40')][_0x00c1('0x42')]?_0x56326e[_0x00c1('0x40')]:_0x3705cc[_0x00c1('0x3b')];if(_0x587c19[_0x00c1('0x3c')]['includeAll']){_0x56326e[_0x00c1('0x4c')]=[{'all':!![]}];}_0x56326e=_['merge']({},_0x56326e,_0x587c19['options']);return db[_0x00c1('0x37')][_0x00c1('0x51')](_0x56326e)[_0x00c1('0x30')](handleEntityNotFound(_0x3a8818,null))['then'](respondWithResult(_0x3a8818,null))[_0x00c1('0x24')](handleError(_0x3a8818,null));};exports[_0x00c1('0x52')]=function(_0x438047,_0x2798f1){return db[_0x00c1('0x37')]['create'](_0x438047['body'],{})['then'](function(_0x2e749c){var _0x31829d=_0x438047['user'][_0x00c1('0x31')]({'plain':!![]});if(!_0x31829d)throw new Error(_0x00c1('0x53'));if(_0x31829d[_0x00c1('0x54')]==='user'){var _0x24f63a=_0x2e749c['get']({'plain':!![]});var _0x5e0314=_0x00c1('0x32');return db[_0x00c1('0x55')][_0x00c1('0x51')]({'where':{'name':_0x5e0314,'userProfileId':_0x31829d['userProfileId']},'raw':!![]})[_0x00c1('0x30')](function(_0x3a18d2){if(_0x3a18d2&&_0x3a18d2['autoAssociation']===0x0){return db[_0x00c1('0x56')][_0x00c1('0x52')]({'name':_0x24f63a[_0x00c1('0x33')],'resourceId':_0x24f63a['id'],'type':_0x3a18d2[_0x00c1('0x33')],'sectionId':_0x3a18d2['id']},{})[_0x00c1('0x30')](function(){return _0x2e749c;});}else{return _0x2e749c;}})['catch'](function(_0xca4497){logger['error'](_0x00c1('0x57'),_0xca4497);throw _0xca4497;});}return _0x2e749c;})[_0x00c1('0x30')](respondWithResult(_0x2798f1,0xc9))[_0x00c1('0x24')](handleError(_0x2798f1,null));};exports[_0x00c1('0x2e')]=function(_0x36509f,_0x3b06d3){if(_0x36509f[_0x00c1('0x58')]['id']){delete _0x36509f[_0x00c1('0x58')]['id'];}return db[_0x00c1('0x37')][_0x00c1('0x51')]({'where':{'id':_0x36509f[_0x00c1('0x4f')]['id']},'include':[{'model':db[_0x00c1('0x35')],'as':_0x00c1('0x50')}]})[_0x00c1('0x30')](handleEntityNotFound(_0x3b06d3,null))['then'](saveUpdates(_0x36509f[_0x00c1('0x58')],null))[_0x00c1('0x30')](respondWithResult(_0x3b06d3,null))[_0x00c1('0x24')](handleError(_0x3b06d3,null));};exports['destroy']=function(_0x52b7cd,_0x743e4d){return db[_0x00c1('0x37')][_0x00c1('0x51')]({'where':{'id':_0x52b7cd[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x743e4d,null))['then'](removeEntity(_0x743e4d,null))[_0x00c1('0x24')](handleError(_0x743e4d,null));};exports[_0x00c1('0x59')]=function(_0xe42f20,_0x35be92){return db[_0x00c1('0x37')]['describe']()[_0x00c1('0x30')](respondWithResult(_0x35be92,null))['catch'](handleError(_0x35be92,null));};exports[_0x00c1('0x5a')]=function(_0x1d9c0a,_0x13818b,_0x429f11){if(_0x1d9c0a['body']['id']){delete _0x1d9c0a[_0x00c1('0x58')]['id'];}return db[_0x00c1('0x37')][_0x00c1('0x51')]({'where':{'id':_0x1d9c0a[_0x00c1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x13818b,null))[_0x00c1('0x30')](function(_0x5d75f8){if(_0x5d75f8){_0x1d9c0a['body'][_0x00c1('0x5b')]=_0x5d75f8['id'];return db[_0x00c1('0x5c')][_0x00c1('0x52')](_0x1d9c0a['body']);}})['then'](respondWithResult(_0x13818b,null))[_0x00c1('0x24')](handleError(_0x13818b,null));};exports[_0x00c1('0x5d')]=function(_0x4bb698,_0x195ac3,_0xd70e7d){var _0x3504e3={'raw':![],'where':{}};var _0x718fb3={};var _0x206239={'count':0x0,'rows':[]};return db[_0x00c1('0x37')]['findOne']({'where':{'id':_0x4bb698[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x195ac3,null))[_0x00c1('0x30')](function(_0x246219){if(_0x246219){_0x718fb3[_0x00c1('0x3b')]=_['keys'](db[_0x00c1('0x5c')][_0x00c1('0x38')]);_0x718fb3[_0x00c1('0x3c')]=_['keys'](_0x4bb698[_0x00c1('0x3c')]);_0x718fb3[_0x00c1('0x3e')]=_[_0x00c1('0x3f')](_0x718fb3[_0x00c1('0x3b')],_0x718fb3[_0x00c1('0x3c')]);_0x3504e3[_0x00c1('0x40')]=_[_0x00c1('0x3f')](_0x718fb3[_0x00c1('0x3b')],qs[_0x00c1('0x41')](_0x4bb698[_0x00c1('0x3c')]['fields']));_0x3504e3[_0x00c1('0x40')]=_0x3504e3[_0x00c1('0x40')][_0x00c1('0x42')]?_0x3504e3[_0x00c1('0x40')]:_0x718fb3[_0x00c1('0x3b')];if(!_0x4bb698[_0x00c1('0x3c')]['hasOwnProperty']('nolimit')){_0x3504e3[_0x00c1('0x2a')]=qs[_0x00c1('0x2a')](_0x4bb698[_0x00c1('0x3c')][_0x00c1('0x2a')]);_0x3504e3[_0x00c1('0x28')]=qs[_0x00c1('0x28')](_0x4bb698['query']['offset']);}_0x3504e3[_0x00c1('0x44')]=qs[_0x00c1('0x45')](_0x4bb698[_0x00c1('0x3c')][_0x00c1('0x45')]);_0x3504e3[_0x00c1('0x46')]=qs['filters'](_[_0x00c1('0x47')](_0x4bb698['query'],_0x718fb3[_0x00c1('0x3e')]));_0x3504e3[_0x00c1('0x46')][_0x00c1('0x5b')]=_0x246219['id'];if(_0x4bb698[_0x00c1('0x3c')]['filter']){_0x3504e3[_0x00c1('0x46')]=_['merge'](_0x3504e3[_0x00c1('0x46')],{'$or':_[_0x00c1('0x36')](_0x3504e3['attributes'],function(_0x27ab32){var _0x33eccb={};_0x33eccb[_0x27ab32]={'$like':'%'+_0x4bb698['query'][_0x00c1('0x48')]+'%'};return _0x33eccb;})});}_0x3504e3=_[_0x00c1('0x49')]({},_0x3504e3,_0x4bb698[_0x00c1('0x5e')]);return db['Disposition'][_0x00c1('0x2b')]({'where':_0x3504e3[_0x00c1('0x46')]})[_0x00c1('0x30')](function(_0x3fd033){_0x206239[_0x00c1('0x2b')]=_0x3fd033;if(_0x4bb698['query'][_0x00c1('0x4b')]){_0x3504e3[_0x00c1('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0x00c1('0x4d')](_0x3504e3);})[_0x00c1('0x30')](function(_0x17365e){_0x206239['rows']=_0x17365e;return _0x206239;});}})['then'](respondWithFilteredResult(_0x195ac3,_0x3504e3))['catch'](handleError(_0x195ac3,null));};exports[_0x00c1('0x5f')]=function(_0x1c8df9,_0x1a1443,_0xb000e8){return db[_0x00c1('0x37')][_0x00c1('0x51')]({'where':{'id':_0x1c8df9[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x1a1443,null))[_0x00c1('0x30')](function(_0x349e80){if(_0x349e80){return _0x349e80[_0x00c1('0x5f')](_0x1c8df9[_0x00c1('0x3c')][_0x00c1('0x60')]);}})[_0x00c1('0x30')](respondWithStatusCode(_0x1a1443,null))[_0x00c1('0x24')](handleError(_0x1a1443,null));};exports[_0x00c1('0x61')]=function(_0x3a36d3,_0x4d8dd2,_0x1155d3){if(_0x3a36d3[_0x00c1('0x58')]['id']){delete _0x3a36d3[_0x00c1('0x58')]['id'];}return db[_0x00c1('0x37')][_0x00c1('0x51')]({'where':{'id':_0x3a36d3[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x4d8dd2,null))[_0x00c1('0x30')](function(_0x14f18c){if(_0x14f18c){_0x3a36d3[_0x00c1('0x58')][_0x00c1('0x5b')]=_0x14f18c['id'];return db[_0x00c1('0x62')][_0x00c1('0x52')](_0x3a36d3['body']);}})[_0x00c1('0x30')](respondWithResult(_0x4d8dd2,null))[_0x00c1('0x24')](handleError(_0x4d8dd2,null));};exports[_0x00c1('0x63')]=function(_0x282105,_0x2525f8,_0x1b33a8){var _0x4ba5c8={'raw':![],'where':{}};var _0x113dd4={};var _0x302ee5={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x282105[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x2525f8,null))[_0x00c1('0x30')](function(_0x16a2ec){if(_0x16a2ec){_0x113dd4[_0x00c1('0x3b')]=_[_0x00c1('0x3d')](db[_0x00c1('0x62')]['rawAttributes']);_0x113dd4['query']=_[_0x00c1('0x3d')](_0x282105['query']);_0x113dd4['filters']=_[_0x00c1('0x3f')](_0x113dd4[_0x00c1('0x3b')],_0x113dd4[_0x00c1('0x3c')]);_0x4ba5c8[_0x00c1('0x40')]=_[_0x00c1('0x3f')](_0x113dd4['model'],qs[_0x00c1('0x41')](_0x282105[_0x00c1('0x3c')][_0x00c1('0x41')]));_0x4ba5c8[_0x00c1('0x40')]=_0x4ba5c8[_0x00c1('0x40')]['length']?_0x4ba5c8[_0x00c1('0x40')]:_0x113dd4[_0x00c1('0x3b')];if(!_0x282105[_0x00c1('0x3c')][_0x00c1('0x43')]('nolimit')){_0x4ba5c8[_0x00c1('0x2a')]=qs[_0x00c1('0x2a')](_0x282105[_0x00c1('0x3c')][_0x00c1('0x2a')]);_0x4ba5c8[_0x00c1('0x28')]=qs[_0x00c1('0x28')](_0x282105['query'][_0x00c1('0x28')]);}_0x4ba5c8['order']=qs[_0x00c1('0x45')](_0x282105[_0x00c1('0x3c')]['sort']);_0x4ba5c8[_0x00c1('0x46')]=qs[_0x00c1('0x3e')](_['pick'](_0x282105[_0x00c1('0x3c')],_0x113dd4[_0x00c1('0x3e')]));_0x4ba5c8[_0x00c1('0x46')][_0x00c1('0x5b')]=_0x16a2ec['id'];if(_0x282105[_0x00c1('0x3c')][_0x00c1('0x48')]){_0x4ba5c8['where']=_[_0x00c1('0x49')](_0x4ba5c8['where'],{'$or':_[_0x00c1('0x36')](_0x4ba5c8[_0x00c1('0x40')],function(_0x91893c){var _0x2c9be7={};_0x2c9be7[_0x91893c]={'$like':'%'+_0x282105['query']['filter']+'%'};return _0x2c9be7;})});}_0x4ba5c8=_['merge']({},_0x4ba5c8,_0x282105[_0x00c1('0x5e')]);return db[_0x00c1('0x62')][_0x00c1('0x2b')]({'where':_0x4ba5c8[_0x00c1('0x46')]})['then'](function(_0x21d331){_0x302ee5[_0x00c1('0x2b')]=_0x21d331;if(_0x282105[_0x00c1('0x3c')][_0x00c1('0x4b')]){_0x4ba5c8[_0x00c1('0x4c')]=[{'all':!![]}];}return db[_0x00c1('0x62')][_0x00c1('0x4d')](_0x4ba5c8);})[_0x00c1('0x30')](function(_0x2ea24a){_0x302ee5[_0x00c1('0x64')]=_0x2ea24a;return _0x302ee5;});}})[_0x00c1('0x30')](respondWithFilteredResult(_0x2525f8,_0x4ba5c8))['catch'](handleError(_0x2525f8,null));};exports[_0x00c1('0x65')]=function(_0x48fbea,_0x28f7d5,_0x164360){return db['SmsAccount'][_0x00c1('0x51')]({'where':{'id':_0x48fbea[_0x00c1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x28f7d5,null))[_0x00c1('0x30')](function(_0x17a20d){if(_0x17a20d){return _0x17a20d[_0x00c1('0x65')](_0x48fbea[_0x00c1('0x3c')][_0x00c1('0x60')]);}})['then'](respondWithStatusCode(_0x28f7d5,null))[_0x00c1('0x24')](handleError(_0x28f7d5,null));};exports[_0x00c1('0x66')]=function(_0x5c21d1,_0x2f7d70,_0x532a6e){var _0x2545d7={'channel':_0x00c1('0x67')};var _0x295f7c=[];var _0x3df88a=[];var _0x585c86={};return db['SmsAccount'][_0x00c1('0x51')]({'where':{'id':_0x5c21d1[_0x00c1('0x4f')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x00c1('0x68')}]})['then'](handleEntityNotFound(_0x2f7d70,null))[_0x00c1('0x30')](function(_0x50211f){_0x2545d7[_0x00c1('0x69')]=_0x50211f;_0x2545d7[_0x00c1('0x6a')]=_[_0x00c1('0x6b')](_0x50211f[_0x00c1('0x68')],[_0x00c1('0x6c')],[_0x00c1('0x6d')]);if(_0x2545d7[_0x00c1('0x69')][_0x00c1('0x68')]){delete _0x2545d7['account'][_0x00c1('0x68')];}return db[_0x00c1('0x6e')][_0x00c1('0x59')]();})[_0x00c1('0x30')](function(_0x581a66){if(!_0x581a66){throw new db[(_0x00c1('0x6f'))][(_0x00c1('0x70'))](_0x00c1('0x71'));}_0x295f7c=_[_0x00c1('0x72')](_[_0x00c1('0x3d')](_0x581a66),['createdAt',_0x00c1('0x73')]);_0x3df88a=_[_0x00c1('0x72')](_[_0x00c1('0x3d')](_0x581a66),[_0x00c1('0x74'),_0x00c1('0x73'),_0x00c1('0x75'),'ListId']);_0x2545d7['body']={'mapKey':_0x00c1('0x76')};if(_0x2545d7['account'][_0x00c1('0x39')]){switch(_0x2545d7['account']['type']){case _0x00c1('0x77'):_0x2545d7['body'][_0x00c1('0x78')]=_0x5c21d1[_0x00c1('0x58')]['From'];_0x2545d7['body'][_0x00c1('0x58')]=_0x5c21d1['body'][_0x00c1('0x79')];_0x2545d7[_0x00c1('0x58')]['messageId']=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x7a')];break;case _0x00c1('0x7b'):_0x2545d7[_0x00c1('0x58')][_0x00c1('0x78')]='+'+_0x5c21d1['body'][_0x00c1('0x7c')];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')]=_0x5c21d1[_0x00c1('0x58')]['text'];break;case _0x00c1('0x7d'):_0x2545d7['body'][_0x00c1('0x78')]=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x78')];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')]=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x21')];break;case _0x00c1('0x7e'):_0x2545d7[_0x00c1('0x58')]['from']=_0x5c21d1['body'][_0x00c1('0x78')];_0x2545d7['body'][_0x00c1('0x58')]=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x58')];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x7f')]=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x80')];break;case _0x00c1('0x81'):_0x2545d7['body']['from']=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x82')];_0x2545d7['body'][_0x00c1('0x58')]=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x83')];_0x2545d7['body']['messageId']=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x84')];break;case'infobip':_0x2545d7[_0x00c1('0x58')]['from']='+'+_0x5c21d1['body'][_0x00c1('0x85')][0x0][_0x00c1('0x78')];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')]=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x85')][0x0][_0x00c1('0x86')];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x7f')]=_0x5c21d1[_0x00c1('0x58')]['results'][0x0]['messageId'];break;case'csc':_0x2545d7[_0x00c1('0x58')]['from']=_0x5c21d1[_0x00c1('0x58')]['originatingAddress'];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')]=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x87')]['message'];break;case _0x00c1('0x88'):_0x2545d7[_0x00c1('0x58')][_0x00c1('0x78')]=_0x5c21d1['body'][_0x00c1('0x89')];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')]=_0x5c21d1['body'][_0x00c1('0x86')];_0x2545d7['body'][_0x00c1('0x7f')]=_0x5c21d1['body'][_0x00c1('0x8a')];break;case _0x00c1('0x8b'):_0x2545d7[_0x00c1('0x58')]['messageId']=_0x5c21d1[_0x00c1('0x58')][0x0][_0x00c1('0x21')]['id'];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x78')]=_0x5c21d1['body'][0x0][_0x00c1('0x21')]['from'];_0x2545d7['body'][_0x00c1('0x58')]=_0x5c21d1[_0x00c1('0x58')][0x0]['message'][_0x00c1('0x86')];break;case _0x00c1('0x8c'):_0x2545d7[_0x00c1('0x58')][_0x00c1('0x78')]=_0x5c21d1['body']['from'];_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')]=_0x5c21d1[_0x00c1('0x58')][_0x00c1('0x21')];_0x2545d7['body'][_0x00c1('0x7f')]=_0x5c21d1[_0x00c1('0x58')]['refid'];break;}}if(_0x2545d7[_0x00c1('0x58')]['id']){delete _0x2545d7[_0x00c1('0x58')]['id'];}if(_[_0x00c1('0x8d')](_0x2545d7[_0x00c1('0x58')][_0x00c1('0x78')])){throw new db['Sequelize']['ValidationError'](_0x00c1('0x8e'));}if(_['isNil'](_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')])||_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')]===''){throw new db['Sequelize'][(_0x00c1('0x70'))](_0x00c1('0x8f'));}if(_[_0x00c1('0x8d')](_0x2545d7[_0x00c1('0x58')][_0x00c1('0x90')])){throw new db[(_0x00c1('0x6f'))]['ValidationError'](_0x00c1('0x91')+_0x3df88a);}if(!_[_0x00c1('0x92')](_0x3df88a,_0x2545d7[_0x00c1('0x58')][_0x00c1('0x90')])){throw new db[(_0x00c1('0x6f'))][(_0x00c1('0x70'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3df88a);}_0x585c86[_0x2545d7[_0x00c1('0x58')][_0x00c1('0x90')]]=_0x2545d7[_0x00c1('0x58')]['from'];return db[_0x00c1('0x93')][_0x00c1('0x51')]({'where':{'id':_0x2545d7[_0x00c1('0x69')][_0x00c1('0x94')]},'include':[{'model':db['CmContact'],'as':_0x00c1('0x95'),'where':_0x585c86,'limit':0x1,'order':[[_0x00c1('0x73'),_0x00c1('0x96')]]}]});})[_0x00c1('0x30')](handleEntityNotFound(_0x2f7d70,null))[_0x00c1('0x30')](function(_0x1a01d3){if(_0x1a01d3){_0x2545d7[_0x00c1('0x97')]=_['omit'](_0x1a01d3,[_0x00c1('0x95')]);if(_0x1a01d3['Contacts'][_0x00c1('0x42')]){return _0x1a01d3[_0x00c1('0x95')][0x0];}var _0x203585=_[_0x00c1('0x98')](_0x2545d7[_0x00c1('0x58')],{'firstName':_0x2545d7[_0x00c1('0x58')][_0x00c1('0x78')],'ListId':_0x1a01d3['id']});_0x203585[_0x2545d7[_0x00c1('0x58')]['mapKey']]=_0x2545d7['body'][_0x00c1('0x78')];return db[_0x00c1('0x6e')][_0x00c1('0x52')](_0x203585,{'fields':_0x295f7c,'raw':!![]});}})['then'](handleEntityNotFound(_0x2f7d70,null))[_0x00c1('0x30')](function(_0x253eba){if(_0x253eba){_0x2545d7[_0x00c1('0x99')]=_0x253eba;var _0x564b31={'ContactId':_0x253eba['id'],'phone':_0x2545d7['body'][_0x00c1('0x78')],'SmsAccountId':_0x5c21d1[_0x00c1('0x4f')]['id']};var _0x548dde={'ContactId':_0x253eba['id'],'SmsAccountId':_0x5c21d1[_0x00c1('0x4f')]['id'],'closed':![]};return db[_0x00c1('0x9a')][_0x00c1('0x51')]({'where':_0x548dde})[_0x00c1('0x30')](function(_0x100908){if(_0x100908){return[_0x100908,![]];}return db[_0x00c1('0x9a')][_0x00c1('0x52')](_0x564b31)[_0x00c1('0x30')](function(_0x2bd438){return[_0x2bd438,!![]];});});}})['spread'](function(_0x5ee807,_0x5c85db){_0x2545d7['interaction']=_0x5ee807[_0x00c1('0x31')]({'plain':!![]});_0x2545d7['interaction']['created']=![];if(_0x5c85db){if(_0x2545d7[_0x00c1('0x69')][_0x00c1('0x9b')]){_0x2545d7[_0x00c1('0x6a')][_0x00c1('0x9c')]({'id':0x0,'priority':_0x2545d7[_0x00c1('0x6a')][_0x00c1('0x42')]+0x1,'app':_0x00c1('0x9d'),'appdata':'unmanaged','interval':_0x00c1('0x9e')});}_0x2545d7[_0x00c1('0x9f')][_0x00c1('0xa0')]=!![];}return db[_0x00c1('0xa1')][_0x00c1('0x52')]({'phone':_0x2545d7[_0x00c1('0x58')][_0x00c1('0x78')],'messageId':_0x2545d7['body'][_0x00c1('0x7f')],'body':_0x2545d7[_0x00c1('0x58')][_0x00c1('0x58')],'SmsAccountId':_0x5c21d1[_0x00c1('0x4f')]['id'],'SmsInteractionId':_0x5ee807['id'],'direction':'in','ContactId':_0x5ee807['ContactId'],'AttachmentId':_0x2545d7['body'][_0x00c1('0xa2')]});})[_0x00c1('0x30')](function(_0x1ff5e9){_0x2545d7[_0x00c1('0x21')]=_0x1ff5e9;if(_0x2545d7[_0x00c1('0x9f')][_0x00c1('0xa3')]){return db[_0x00c1('0xa4')][_0x00c1('0x51')]({'attributes':['id',_0x00c1('0x33')],'where':{'id':_0x2545d7[_0x00c1('0x9f')][_0x00c1('0xa3')]}})[_0x00c1('0x30')](function(_0x19140c){if(_0x19140c){_0x2545d7[_0x00c1('0x6a')]['unshift']({'id':0x0,'priority':0x0,'app':_0x00c1('0xa5'),'appdata':_0x19140c[_0x00c1('0x33')]+','+(_0x2545d7[_0x00c1('0x69')][_0x00c1('0xa6')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x00c1('0xa7'),_0x2545d7);});}return respondWithRpcPromise(_0x00c1('0xa8'),_0x00c1('0xa7'),_0x2545d7);})[_0x00c1('0x30')](function(_0x14a55e){if(_0x14a55e){var _0x380a0d=0xc8;var _0x47d11c=_0x00c1('0xa9');logger[_0x00c1('0x22')](_0x00c1('0x1d'),_0x47d11c,_0x380a0d,'entity\x20found');logger[_0x00c1('0x1c')](_0x00c1('0xaa'),_0x47d11c,_0x380a0d,_0x00c1('0xab'),JSON[_0x00c1('0xac')](_0x14a55e));if(_0x2545d7[_0x00c1('0x69')][_0x00c1('0x39')]==='twilio'){return _0x2f7d70[_0x00c1('0x26')](_0x380a0d)[_0x00c1('0x2c')]('Content-Type',_0x00c1('0xad'))[_0x00c1('0x34')](_0x00c1('0xae'));}else{return _0x2f7d70['status'](_0x380a0d)['json'](_0x14a55e);}}})[_0x00c1('0x24')](handleError(_0x2f7d70,null));};exports[_0x00c1('0xaf')]=function(_0x2fe73e,_0x972fb5){var _0x2fe075=_0x2fe73e['params']['id'];var _0x59e520=_0x2fe73e[_0x00c1('0x58')];var _0x104b75=0xc8;var _0x1d5432=null;return db[_0x00c1('0xb0')][_0x00c1('0xb1')]({'isolationLevel':db['sequelize'][_0x00c1('0xb2')][_0x00c1('0xb3')]['READ_COMMITTED']},function(_0x5771ee){return db[_0x00c1('0x37')][_0x00c1('0xb4')]({'where':{'id':_0x2fe075},'transaction':_0x5771ee})[_0x00c1('0x30')](function(_0xc8f8d0){if(_0xc8f8d0){return db['SmsApplication'][_0x00c1('0x2f')]({'where':{'SmsAccountId':_0x2fe075},'transaction':_0x5771ee})[_0x00c1('0x30')](function(){var _0x224693=_[_0x00c1('0x36')](_0x59e520,function(_0x3eda6c){_0x3eda6c[_0x00c1('0x5b')]=_0x2fe075;return _0x3eda6c;});return db[_0x00c1('0xb5')]['bulkCreate'](_0x224693,{'transaction':_0x5771ee});});}else{_0x104b75=0x194;_0x1d5432=[];}});})['then'](function(){if(_0x104b75!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x2fe075},'order':_0x00c1('0x6c')})[_0x00c1('0x30')](function(_0x105856){_0x1d5432=_0x105856;});}})[_0x00c1('0x24')](function(_0xcf6740){_0x104b75=0x1f4;logger[_0x00c1('0x1e')](_0xcf6740[_0x00c1('0xb6')]);if(_0xcf6740[_0x00c1('0x33')]){delete _0xcf6740[_0x00c1('0x33')];}_0x1d5432=_0xcf6740;})['finally'](function(){if(_0x1d5432===null){_0x972fb5[_0x00c1('0x25')](_0x104b75);}else{if(_0x104b75===0x1f4){_0x972fb5[_0x00c1('0x26')](_0x104b75)[_0x00c1('0x34')](_0x1d5432);}else{_0x972fb5['status'](_0x104b75)['json'](_0x1d5432);}}});};exports[_0x00c1('0xb7')]=function(_0x3541d5,_0x24e817,_0x323470){var _0x5ba32c={};var _0x4c910c={};var _0x557116;var _0x2135cf;return db[_0x00c1('0x37')][_0x00c1('0xb4')]({'where':{'id':_0x3541d5['params']['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x24e817,null))[_0x00c1('0x30')](function(_0x4c3634){if(_0x4c3634){_0x557116=_0x4c3634;_0x4c910c['model']=_['keys'](db[_0x00c1('0xb5')][_0x00c1('0x38')]);_0x4c910c['query']=_['keys'](_0x3541d5['query']);_0x4c910c[_0x00c1('0x3e')]=_[_0x00c1('0x3f')](_0x4c910c[_0x00c1('0x3b')],_0x4c910c['query']);_0x5ba32c[_0x00c1('0x40')]=_[_0x00c1('0x3f')](_0x4c910c[_0x00c1('0x3b')],qs[_0x00c1('0x41')](_0x3541d5[_0x00c1('0x3c')]['fields']));_0x5ba32c['attributes']=_0x5ba32c[_0x00c1('0x40')][_0x00c1('0x42')]?_0x5ba32c[_0x00c1('0x40')]:_0x4c910c[_0x00c1('0x3b')];_0x5ba32c['order']=qs[_0x00c1('0x45')](_0x3541d5['query'][_0x00c1('0x45')]);_0x5ba32c[_0x00c1('0x46')]=qs[_0x00c1('0x3e')](_[_0x00c1('0x47')](_0x3541d5[_0x00c1('0x3c')],_0x4c910c['filters']));if(_0x3541d5[_0x00c1('0x3c')]['filter']){_0x5ba32c[_0x00c1('0x46')]=_['merge'](_0x5ba32c[_0x00c1('0x46')],{'$or':_[_0x00c1('0x36')](_0x5ba32c[_0x00c1('0x40')],function(_0x2a2ac3){var _0xdc7a23={};_0xdc7a23[_0x2a2ac3]={'$like':'%'+_0x3541d5[_0x00c1('0x3c')][_0x00c1('0x48')]+'%'};return _0xdc7a23;})});}_0x5ba32c=_['merge']({},_0x5ba32c,_0x3541d5[_0x00c1('0x5e')]);return _0x557116['getApplications'](_0x5ba32c);}})[_0x00c1('0x30')](function(_0x22becd){if(_0x22becd){_0x2135cf=_0x22becd['length'];if(!_0x3541d5[_0x00c1('0x3c')][_0x00c1('0x43')](_0x00c1('0xb8'))){_0x5ba32c[_0x00c1('0x2a')]=qs[_0x00c1('0x2a')](_0x3541d5[_0x00c1('0x3c')]['limit']);_0x5ba32c[_0x00c1('0x28')]=qs[_0x00c1('0x28')](_0x3541d5[_0x00c1('0x3c')]['offset']);}return _0x557116[_0x00c1('0xb7')](_0x5ba32c);}})[_0x00c1('0x30')](function(_0x450a73){if(_0x450a73){return _0x450a73?{'count':_0x2135cf,'rows':_0x450a73}:null;}})['then'](respondWithResult(_0x24e817,null))['catch'](handleError(_0x24e817,null));};exports[_0x00c1('0xb9')]=function(_0x3d0444,_0x3ca364,_0x3d841c){var _0x3eae66={'raw':![],'where':{}};var _0x198b3a={};var _0x118100={'count':0x0,'rows':[]};return db['SmsAccount'][_0x00c1('0xb4')]({'where':{'id':_0x3d0444[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x3ca364,null))[_0x00c1('0x30')](function(_0x36de01){if(_0x36de01){_0x198b3a[_0x00c1('0x3b')]=_[_0x00c1('0x3d')](db[_0x00c1('0x9a')][_0x00c1('0x38')]);_0x198b3a[_0x00c1('0x3c')]=_[_0x00c1('0x3d')](_0x3d0444['query']);_0x198b3a['filters']=_[_0x00c1('0x3f')](_0x198b3a['model'],_0x198b3a[_0x00c1('0x3c')]);_0x3eae66['attributes']=_[_0x00c1('0x3f')](_0x198b3a['model'],qs[_0x00c1('0x41')](_0x3d0444[_0x00c1('0x3c')][_0x00c1('0x41')]));_0x3eae66['attributes']=_0x3eae66[_0x00c1('0x40')][_0x00c1('0x42')]?_0x3eae66[_0x00c1('0x40')]:_0x198b3a['model'];if(!_0x3d0444[_0x00c1('0x3c')][_0x00c1('0x43')]('nolimit')){_0x3eae66['limit']=qs[_0x00c1('0x2a')](_0x3d0444[_0x00c1('0x3c')][_0x00c1('0x2a')]);_0x3eae66[_0x00c1('0x28')]=qs[_0x00c1('0x28')](_0x3d0444['query'][_0x00c1('0x28')]);}_0x3eae66[_0x00c1('0x44')]=qs['sort'](_0x3d0444[_0x00c1('0x3c')]['sort']);_0x3eae66[_0x00c1('0x46')]=qs[_0x00c1('0x3e')](_['pick'](_0x3d0444[_0x00c1('0x3c')],_0x198b3a[_0x00c1('0x3e')]));_0x3eae66[_0x00c1('0x46')][_0x00c1('0x5b')]=_0x36de01['id'];if(_0x3d0444[_0x00c1('0x3c')][_0x00c1('0x48')]){_0x3eae66[_0x00c1('0x46')]=_['merge'](_0x3eae66[_0x00c1('0x46')],{'$or':_[_0x00c1('0x36')](_0x3eae66[_0x00c1('0x40')],function(_0x173522){var _0x428496={};_0x428496[_0x173522]={'$like':'%'+_0x3d0444[_0x00c1('0x3c')][_0x00c1('0x48')]+'%'};return _0x428496;})});}_0x3eae66=_[_0x00c1('0x49')]({},_0x3eae66,_0x3d0444[_0x00c1('0x5e')]);return db[_0x00c1('0x9a')]['count']({'where':_0x3eae66[_0x00c1('0x46')]})[_0x00c1('0x30')](function(_0x1c0eaa){_0x118100['count']=_0x1c0eaa;if(_0x3d0444[_0x00c1('0x3c')][_0x00c1('0x4b')]){_0x3eae66[_0x00c1('0x4c')]=[{'model':db['CmContact'],'as':_0x00c1('0xba'),'required':![]},{'model':db['User'],'as':_0x00c1('0xbb'),'attributes':[_0x00c1('0x33'),_0x00c1('0xbc'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x00c1('0xbd'),'attributes':['id',_0x00c1('0x33'),_0x00c1('0xbe')],'where':_0x3d0444[_0x00c1('0x3c')][_0x00c1('0xbf')]?{'id':_0x3d0444[_0x00c1('0x3c')]['tag']}:undefined,'required':_0x3d0444[_0x00c1('0x3c')]['tag']?!![]:![]}];}return db[_0x00c1('0x9a')][_0x00c1('0x4d')](_0x3eae66);})[_0x00c1('0x30')](function(_0x3dcfad){_0x118100['rows']=_0x3dcfad;return _0x118100;});}})[_0x00c1('0x30')](respondWithFilteredResult(_0x3ca364,_0x3eae66))[_0x00c1('0x24')](handleError(_0x3ca364,null));};exports[_0x00c1('0x34')]=function(_0xb53658,_0x4a9074,_0x24ce95){var _0x5893ad,_0x1f18d2,_0x371b82;if(_[_0x00c1('0x8d')](_0xb53658[_0x00c1('0x58')][_0x00c1('0x58')])||_0xb53658[_0x00c1('0x58')][_0x00c1('0x58')]===''){throw new db['Sequelize'][(_0x00c1('0x70'))](_0x00c1('0x8f'));}if(_[_0x00c1('0x8d')](_0xb53658[_0x00c1('0x58')]['to'])){throw new db[(_0x00c1('0x6f'))][(_0x00c1('0x70'))]('to\x20is\x20mandatory');}_0x5893ad=_0xb53658[_0x00c1('0x58')]['to'];return db[_0x00c1('0x37')][_0x00c1('0x51')]({'where':{'id':_0xb53658['params']['id']},'include':[{'model':db[_0x00c1('0x93')],'as':_0x00c1('0xc0'),'include':[{'model':db[_0x00c1('0x6e')],'as':_0x00c1('0x95'),'where':{'mobile':_0x5893ad},'limit':0x1,'order':[[_0x00c1('0x73'),_0x00c1('0x96')]]}]}]})[_0x00c1('0x30')](handleEntityNotFound(_0x4a9074,null))[_0x00c1('0x30')](function(_0xa78889){if(_0xa78889&&_0xa78889[_0x00c1('0xc0')]){_0x1f18d2=_0xa78889[_0x00c1('0x31')]({'plain':!![]});if(_0x1f18d2[_0x00c1('0xc0')]&&_0x1f18d2[_0x00c1('0xc0')][_0x00c1('0x95')]['length']){return _0x1f18d2[_0x00c1('0xc0')][_0x00c1('0x95')][0x0];}return db[_0x00c1('0x6e')][_0x00c1('0x52')](_[_0x00c1('0x98')](_0xb53658[_0x00c1('0x58')],{'firstName':_0x5893ad,'mobile':_0x5893ad,'phone':_0x5893ad,'ListId':_0x1f18d2['ListId']}));}})[_0x00c1('0x30')](handleEntityNotFound(_0x4a9074,null))['then'](function(_0x55747e){if(_0x55747e){_0x371b82=_0x55747e;return db[_0x00c1('0x9a')][_0x00c1('0x51')]({'where':{'ContactId':_0x371b82['id'],'closed':![],'SmsAccountId':_0x1f18d2['id']}})['then'](function(_0xdc780a){if(_0xdc780a){return[_0xdc780a,![]];}return db[_0x00c1('0x9a')]['create']({'UserId':_0xb53658['user']['id'],'ContactId':_0x371b82['id'],'SmsAccountId':_0x1f18d2['id'],'phone':_0x5893ad,'firstMsgDirection':_0x00c1('0xc1'),'Messages':[_[_0x00c1('0x49')](_0xb53658[_0x00c1('0x58')],{'read':![],'body':_0xb53658[_0x00c1('0x58')][_0x00c1('0x58')],'phone':_0x5893ad,'SmsAccountId':_0x1f18d2['id'],'UserId':_0xb53658['user']['id'],'ContactId':_0x371b82['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x00c1('0xc2')}]})[_0x00c1('0x30')](function(_0x1215ef){return[_0x1215ef,!![]];});});}})['spread'](function(_0x35a601,_0x150645){if(_0x150645){return _0x35a601;}return db['SmsMessage'][_0x00c1('0x52')](_[_0x00c1('0x49')](_0xb53658[_0x00c1('0x58')],{'read':![],'body':_0xb53658[_0x00c1('0x58')][_0x00c1('0x58')],'phone':_0x5893ad,'SmsAccountId':_0x1f18d2['id'],'SmsInteractionId':_0x35a601['id'],'UserId':_0xb53658['user']['id'],'ContactId':_0x371b82['id']}))[_0x00c1('0x30')](function(_0x78ead){_0x35a601['dataValues'][_0x00c1('0xc2')]=[];_0x35a601[_0x00c1('0xc3')][_0x00c1('0xc2')][_0x00c1('0x9c')](_0x78ead[_0x00c1('0xc3')]);return _0x35a601;});})[_0x00c1('0x30')](respondWithResult(_0x4a9074,null))[_0x00c1('0x24')](handleError(_0x4a9074,null));};exports[_0x00c1('0x26')]=function(_0x429859,_0x3bf212,_0x175263){if(_0x429859[_0x00c1('0x58')]['id']){delete _0x429859[_0x00c1('0x58')]['id'];}var _0x362e92,_0x3a0aa9,_0x3b9bcd;return db['SmsAccount'][_0x00c1('0x51')]({'where':{'id':_0x429859[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x3bf212,null))['then'](function(_0x635d7a){if(_0x635d7a){_0x3b9bcd=_0x635d7a;logger[_0x00c1('0x1c')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x00c1('0xc4'),_0x635d7a['type'],util[_0x00c1('0xc5')](_0x429859[_0x00c1('0x58')],{'showHidden':![],'depth':null}));switch(_0x635d7a['type']){case _0x00c1('0x7b'):if(_0x429859[_0x00c1('0x58')][_0x00c1('0xc6')]&&_0x429859[_0x00c1('0x58')]['status']){_0x3a0aa9=_0x429859[_0x00c1('0x58')]['status'];return db[_0x00c1('0xa1')][_0x00c1('0x51')]({'where':{'messageId':_0x429859[_0x00c1('0x58')][_0x00c1('0xc6')]}});}break;case _0x00c1('0x7d'):if(_0x429859['body'][_0x00c1('0xc7')]&&_0x429859[_0x00c1('0x58')][_0x00c1('0xc8')]){_0x3a0aa9=_0x429859['body'][_0x00c1('0xc8')];return db[_0x00c1('0xa1')][_0x00c1('0x51')]({'where':{'messageId':_0x429859[_0x00c1('0x58')][_0x00c1('0xc7')]}});}break;case _0x00c1('0x7e'):if(_0x429859['body']['message_id']&&_0x429859[_0x00c1('0x58')]['status_code']){_0x3a0aa9=_0x429859['body'][_0x00c1('0xc9')];return db[_0x00c1('0xa1')]['find']({'where':{'messageId':_0x429859[_0x00c1('0x58')][_0x00c1('0x80')]}});}break;case _0x00c1('0xca'):var _0x1ab6ad=_0x429859['body']['results'][0x0];if(_0x1ab6ad[_0x00c1('0x7f')]&&_0x1ab6ad[_0x00c1('0x26')][_0x00c1('0xcb')]==='DELIVERED'){_0x3a0aa9=_0x1ab6ad['status'][_0x00c1('0xcb')];return db['SmsMessage'][_0x00c1('0x51')]({'where':{'messageId':_0x1ab6ad[_0x00c1('0x7f')]}});}break;case _0x00c1('0x88'):if(_0x429859[_0x00c1('0x58')][_0x00c1('0x7f')]&&_0x429859['body']['status']){_0x3a0aa9=_0x429859[_0x00c1('0x58')][_0x00c1('0x26')];return db['SmsMessage'][_0x00c1('0x51')]({'where':{'messageId':_0x429859['body'][_0x00c1('0x7f')]}});}break;case _0x00c1('0x8b'):if(_0x429859[_0x00c1('0x58')][0x0][_0x00c1('0x21')]['id']){_0x3a0aa9=_0x429859[_0x00c1('0x58')][0x0][_0x00c1('0x39')];return db[_0x00c1('0xa1')][_0x00c1('0x51')]({'where':{'messageId':_0x429859[_0x00c1('0x58')][0x0][_0x00c1('0x21')]['id']}});}break;case _0x00c1('0x8c'):if(_0x429859[_0x00c1('0x58')][_0x00c1('0xcc')]&&_0x429859[_0x00c1('0x58')][_0x00c1('0x26')]){_0x3a0aa9=_0x429859[_0x00c1('0x58')]['status'];return db[_0x00c1('0xa1')]['find']({'where':{'messageId':_0x429859[_0x00c1('0x58')][_0x00c1('0xcc')]}});}break;}}})[_0x00c1('0x30')](handleEntityNotFound(_0x3bf212,null))['then'](function(_0x102978){if(_0x102978){_0x362e92=_0x102978;switch(_0x3b9bcd[_0x00c1('0x39')]){case'skebby':if(_0x3a0aa9===_0x00c1('0xcd')){return _0x362e92[_0x00c1('0x2e')]({'read':!![]});}else{logger[_0x00c1('0x1e')](_0x00c1('0x1d'),_0x00c1('0x26'),_0x00c1('0x7b'),util[_0x00c1('0xc5')](_0x429859[_0x00c1('0x58')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3a0aa9==='1'){return _0x362e92[_0x00c1('0x2e')]({'read':!![]});}else{logger['error'](_0x00c1('0x1d'),_0x00c1('0x26'),_0x00c1('0x7b'),util[_0x00c1('0xc5')](_0x429859[_0x00c1('0x58')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x429859['body'][_0x00c1('0xce')]&&_0x3a0aa9>=0xc8&&_0x3a0aa9<=0xce){return _0x362e92['update']({'read':!![]});}else{logger[_0x00c1('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x00c1('0x7e'),util[_0x00c1('0xc5')](_0x429859[_0x00c1('0x58')],{'showHidden':![],'depth':null}));}break;case _0x00c1('0xca'):var _0x49d83b=_0x429859['body']['results'][0x0];if(_0x49d83b[_0x00c1('0x26')]['groupName']===_0x00c1('0xcd')){return _0x362e92[_0x00c1('0x2e')]({'read':!![]});}else{logger['error'](_0x00c1('0x1d'),_0x00c1('0x26'),_0x00c1('0xca'),util['inspect'](_0x429859['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3a0aa9==_0x00c1('0xcf')||_0x3a0aa9==_0x00c1('0xd0')){return _0x362e92[_0x00c1('0x2e')]({'read':!![]});}else{logger['error'](_0x00c1('0x1d'),_0x00c1('0x26'),'clickatell',util['inspect'](_0x429859[_0x00c1('0x58')],{'showHidden':![],'depth':null}));}break;case _0x00c1('0x8b'):if(_0x3a0aa9=='message-delivered'){return _0x362e92[_0x00c1('0x2e')]({'read':!![]});}else{logger[_0x00c1('0x1e')](_0x00c1('0x1d'),_0x00c1('0x26'),'bandwidth',util['inspect'](_0x429859[_0x00c1('0x58')],{'showHidden':![],'depth':null}));}break;case _0x00c1('0x8c'):if(_0x3a0aa9===_0x00c1('0xd1')||_0x3a0aa9==='ACCEPTD'){return _0x362e92[_0x00c1('0x2e')]({'read':!![]});}else{logger[_0x00c1('0x1e')](_0x00c1('0x1d'),_0x00c1('0x26'),_0x00c1('0x8c'),util[_0x00c1('0xc5')](_0x429859[_0x00c1('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x362e92;}})[_0x00c1('0x30')](respondWithResult(_0x3bf212,null))[_0x00c1('0x24')](handleError(_0x3bf212,null));};exports[_0x00c1('0xd2')]=function(_0xc9c45a,_0x120042,_0x33bac5){var _0x4ea308,_0x3d1f45,_0x19a93d;return db[_0x00c1('0x37')][_0x00c1('0x51')]({'where':{'id':_0xc9c45a['params']['id']}})['then'](handleEntityNotFound(_0x120042,null))[_0x00c1('0x30')](function(_0x956146){if(_0x956146){_0x19a93d=_0x956146;logger[_0x00c1('0x1c')](_0x00c1('0x1d'),_0x00c1('0x26'),_0x00c1('0xc4'),_0x956146[_0x00c1('0x39')],util[_0x00c1('0xc5')](_0xc9c45a[_0x00c1('0x3c')],{'showHidden':![],'depth':null}));switch(_0x956146['type']){case _0x00c1('0xd3'):if(_0xc9c45a['query']['message-id']&&_0xc9c45a['query'][_0x00c1('0xd4')]){_0x3d1f45=_0xc9c45a[_0x00c1('0x3c')][_0x00c1('0xd4')];return db['SmsMessage'][_0x00c1('0x51')]({'where':{'messageId':_0xc9c45a['query'][_0x00c1('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x120042,null))['then'](function(_0x46599a){if(_0x46599a){_0x4ea308=_0x46599a;switch(_0x19a93d[_0x00c1('0x39')]){case _0x00c1('0xd3'):if(_0x3d1f45==='2'||_0x3d1f45==='6'){return _0x4ea308['update']({'read':!![]});}else{logger[_0x00c1('0x1e')](_0x00c1('0x1d'),'status',_0x00c1('0xd3'),util[_0x00c1('0xc5')](_0xc9c45a[_0x00c1('0x3c')],{'showHidden':![],'depth':null}));};break;}return _0x4ea308;}})[_0x00c1('0x30')](respondWithResult(_0x120042,null))[_0x00c1('0x24')](handleError(_0x120042,null));};exports[_0x00c1('0xd6')]=function(_0x4a9cb7,_0x5ad7b5,_0x4524ba){return db['SmsAccount'][_0x00c1('0x51')]({'where':{'id':_0x4a9cb7[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x5ad7b5,null))[_0x00c1('0x30')](function(_0x18ff18){if(_0x18ff18){return _0x18ff18[_0x00c1('0xd6')](_0x4a9cb7[_0x00c1('0x58')][_0x00c1('0x60')],_['omit'](_0x4a9cb7['body'],[_0x00c1('0x60'),'id'])||{})[_0x00c1('0xd7')](function(_0xba3dcd){for(var _0x55e003=0x0;_0x55e003<_0x4a9cb7[_0x00c1('0x58')]['ids'][_0x00c1('0x42')];_0x55e003+=0x1){socket[_0x00c1('0xd8')](_0x00c1('0xd9'),{'UserId':Number(_0x4a9cb7[_0x00c1('0x58')][_0x00c1('0x60')][_0x55e003]),'SmsAccountId':Number(_0x4a9cb7[_0x00c1('0x4f')]['id'])});}return _0xba3dcd;});}})[_0x00c1('0x30')](respondWithResult(_0x5ad7b5,null))[_0x00c1('0x24')](handleError(_0x5ad7b5,null));};exports[_0x00c1('0xda')]=function(_0x246ce5,_0x172fbd,_0x4895de){return db[_0x00c1('0x37')][_0x00c1('0x51')]({'where':{'id':_0x246ce5[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0x172fbd,null))['then'](function(_0x166020){if(_0x166020){return _0x166020[_0x00c1('0xda')](_0x246ce5[_0x00c1('0x3c')]['ids'])[_0x00c1('0x30')](function(){if(_[_0x00c1('0xdb')](_0x246ce5[_0x00c1('0x3c')][_0x00c1('0x60')])){for(var _0x35b247=0x0;_0x35b247<_0x246ce5[_0x00c1('0x3c')]['ids']['length'];_0x35b247+=0x1){socket['emit'](_0x00c1('0xdc'),{'UserId':Number(_0x246ce5[_0x00c1('0x3c')][_0x00c1('0x60')][_0x35b247]),'SmsAccountId':Number(_0x246ce5[_0x00c1('0x4f')]['id'])});}}else{socket['emit'](_0x00c1('0xdc'),{'UserId':Number(_0x246ce5[_0x00c1('0x3c')]['ids']),'SmsAccountId':Number(_0x246ce5['params']['id'])});}});}})[_0x00c1('0x30')](respondWithStatusCode(_0x172fbd,null))[_0x00c1('0x24')](handleError(_0x172fbd,null));};exports['getAgents']=function(_0x3c4869,_0xe0177c,_0xcf3813){var _0x298411={};var _0x9c89f7={};var _0x12a1fa;var _0x3da757;return db[_0x00c1('0x37')]['findOne']({'where':{'id':_0x3c4869[_0x00c1('0x4f')]['id']}})[_0x00c1('0x30')](handleEntityNotFound(_0xe0177c,null))['then'](function(_0x455e54){if(_0x455e54){_0x12a1fa=_0x455e54;_0x9c89f7[_0x00c1('0x3b')]=_[_0x00c1('0x3d')](db[_0x00c1('0xa4')][_0x00c1('0x38')]);_0x9c89f7[_0x00c1('0x3c')]=_['keys'](_0x3c4869[_0x00c1('0x3c')]);_0x9c89f7[_0x00c1('0x3e')]=_[_0x00c1('0x3f')](_0x9c89f7['model'],_0x9c89f7['query']);_0x298411['attributes']=_['intersection'](_0x9c89f7[_0x00c1('0x3b')],qs[_0x00c1('0x41')](_0x3c4869['query'][_0x00c1('0x41')]));_0x298411[_0x00c1('0x40')]=_0x298411['attributes'][_0x00c1('0x42')]?_0x298411[_0x00c1('0x40')]:_0x9c89f7[_0x00c1('0x3b')];_0x298411[_0x00c1('0x44')]=qs[_0x00c1('0x45')](_0x3c4869['query'][_0x00c1('0x45')]);_0x298411['where']=qs[_0x00c1('0x3e')](_['pick'](_0x3c4869[_0x00c1('0x3c')],_0x9c89f7[_0x00c1('0x3e')]));if(_0x3c4869['query'][_0x00c1('0x48')]){_0x298411['where']=_[_0x00c1('0x49')](_0x298411['where'],{'$or':_[_0x00c1('0x36')](_0x298411['attributes'],function(_0x5cb64a){var _0x3bd271={};_0x3bd271[_0x5cb64a]={'$like':'%'+_0x3c4869[_0x00c1('0x3c')][_0x00c1('0x48')]+'%'};return _0x3bd271;})});}_0x298411=_[_0x00c1('0x49')]({},_0x298411,_0x3c4869[_0x00c1('0x5e')]);return _0x12a1fa['getAgents'](_0x298411);}})[_0x00c1('0x30')](function(_0x5fbd9e){if(_0x5fbd9e){_0x3da757=_0x5fbd9e[_0x00c1('0x42')];if(!_0x3c4869[_0x00c1('0x3c')]['hasOwnProperty'](_0x00c1('0xb8'))){_0x298411[_0x00c1('0x2a')]=qs[_0x00c1('0x2a')](_0x3c4869[_0x00c1('0x3c')][_0x00c1('0x2a')]);_0x298411['offset']=qs[_0x00c1('0x28')](_0x3c4869[_0x00c1('0x3c')]['offset']);}return _0x12a1fa['getAgents'](_0x298411);}})[_0x00c1('0x30')](function(_0x482bef){if(_0x482bef){return _0x482bef?{'count':_0x3da757,'rows':_0x482bef}:null;}})['then'](respondWithResult(_0xe0177c,null))[_0x00c1('0x24')](handleError(_0xe0177c,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 2967368..20a128d 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 _0x080e=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x080e,0x19e));var _0xe080=function(_0x5ecfc0,_0x2b1d77){_0x5ecfc0=_0x5ecfc0-0x0;var _0x2f0385=_0x080e[_0x5ecfc0];return _0x2f0385;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xe080('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe080('0x1')](0x0);var events={'afterCreate':_0xe080('0x2'),'afterUpdate':_0xe080('0x3'),'afterDestroy':_0xe080('0x4')};function emitEvent(_0x4aa471){return function(_0x33d74b,_0x199f27,_0x4f61cf){SmsAccountEvents['emit'](_0x4aa471+':'+_0x33d74b['id'],_0x33d74b);SmsAccountEvents[_0xe080('0x5')](_0x4aa471,_0x33d74b);_0x4f61cf(null);};}for(var e in events){if(events[_0xe080('0x6')](e)){var event=events[e];SmsAccount[_0xe080('0x7')](e,emitEvent(event));}}module[_0xe080('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x4814=['remove','emit','hasOwnProperty','hook','events','SmsAccount','save'];(function(_0x3efdd8,_0x3728e3){var _0x395759=function(_0x4adae5){while(--_0x4adae5){_0x3efdd8['push'](_0x3efdd8['shift']());}};_0x395759(++_0x3728e3);}(_0x4814,0x74));var _0x4481=function(_0x29b3b8,_0x387185){_0x29b3b8=_0x29b3b8-0x0;var _0x3ee7a5=_0x4814[_0x29b3b8];return _0x3ee7a5;};'use strict';var EventEmitter=require(_0x4481('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x4481('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4481('0x2'),'afterUpdate':'update','afterDestroy':_0x4481('0x3')};function emitEvent(_0x56728d){return function(_0x5c6201,_0x555e38,_0x43dc6d){SmsAccountEvents['emit'](_0x56728d+':'+_0x5c6201['id'],_0x5c6201);SmsAccountEvents[_0x4481('0x4')](_0x56728d,_0x5c6201);_0x43dc6d(null);};}for(var e in events){if(events[_0x4481('0x5')](e)){var event=events[e];SmsAccount[_0x4481('0x6')](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 fb4de89..406ccdd 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 _0xf5d4=['SmsAccount','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2e106d,_0x240bd2){var _0x462032=function(_0x57b5b9){while(--_0x57b5b9){_0x2e106d['push'](_0x2e106d['shift']());}};_0x462032(++_0x240bd2);}(_0xf5d4,0x19f));var _0x4f5d=function(_0xeb5eb8,_0x128a28){_0xeb5eb8=_0xeb5eb8-0x0;var _0x5c8c1b=_0xf5d4[_0xeb5eb8];return _0x5c8c1b;};'use strict';var _=require(_0x4f5d('0x0'));var util=require(_0x4f5d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4f5d('0x2'));var rp=require(_0x4f5d('0x3'));var fs=require('fs');var path=require(_0x4f5d('0x4'));var rimraf=require(_0x4f5d('0x5'));var config=require(_0x4f5d('0x6'));var attributes=require('./smsAccount.attributes');module[_0x4f5d('0x7')]=function(_0x503b75,_0x2208b6){return _0x503b75['define'](_0x4f5d('0x8'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0395=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x0395,0xd5));var _0x5039=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0x0395[_0x45f4e9];return _0x559d8f;};'use strict';var _=require(_0x5039('0x0'));var util=require(_0x5039('0x1'));var logger=require(_0x5039('0x2'))('api');var moment=require(_0x5039('0x3'));var BPromise=require(_0x5039('0x4'));var rp=require(_0x5039('0x5'));var fs=require('fs');var path=require(_0x5039('0x6'));var rimraf=require(_0x5039('0x7'));var config=require(_0x5039('0x8'));var attributes=require(_0x5039('0x9'));module[_0x5039('0xa')]=function(_0xfed60f,_0x319d86){return _0xfed60f[_0x5039('0xb')]('SmsAccount',attributes,{'tableName':'sms_accounts','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 ffc770b..489648d 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 _0xf811=['map','model','then','ShowSmsAccount','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','SmsAccount','find','options','raw','where','attributes','include'];(function(_0x5022a1,_0x2d7a86){var _0x378bf4=function(_0x4d8176){while(--_0x4d8176){_0x5022a1['push'](_0x5022a1['shift']());}};_0x378bf4(++_0x2d7a86);}(_0xf811,0x1f3));var _0x1f81=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xf811[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var moment=require(_0x1f81('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f81('0x3'));var db=require(_0x1f81('0x4'))['db'];var utils=require(_0x1f81('0x5'));var logger=require('../../config/logger')(_0x1f81('0x6'));var config=require(_0x1f81('0x7'));var jayson=require(_0x1f81('0x8'));var client=jayson[_0x1f81('0x9')][_0x1f81('0xa')]({'port':0x232a});config[_0x1f81('0xb')]=_[_0x1f81('0xc')](config[_0x1f81('0xb')],{'host':_0x1f81('0xd'),'port':0x18eb});var socket=require(_0x1f81('0xe'))(new Redis(config[_0x1f81('0xb')]));require('./smsAccount.socket')[_0x1f81('0xf')](socket);function respondWithRpcPromise(_0x490953,_0x594ee3,_0x547bd1){return new BPromise(function(_0x53dd8d,_0x294d9c){return client[_0x1f81('0x10')](_0x490953,_0x547bd1)['then'](function(_0x30e2bb){logger['info'](_0x1f81('0x11'),_0x594ee3,'request\x20sent');logger[_0x1f81('0x12')](_0x1f81('0x13'),_0x594ee3,_0x1f81('0x14'),JSON[_0x1f81('0x15')](_0x30e2bb));if(_0x30e2bb['error']){if(_0x30e2bb[_0x1f81('0x16')][_0x1f81('0x17')]===0x1f4){logger[_0x1f81('0x16')]('SmsAccount,\x20%s,\x20%s',_0x594ee3,_0x30e2bb[_0x1f81('0x16')][_0x1f81('0x18')]);return _0x294d9c(_0x30e2bb[_0x1f81('0x16')][_0x1f81('0x18')]);}logger[_0x1f81('0x16')](_0x1f81('0x11'),_0x594ee3,_0x30e2bb[_0x1f81('0x16')]['message']);return _0x53dd8d(_0x30e2bb[_0x1f81('0x16')]['message']);}else{logger[_0x1f81('0x19')](_0x1f81('0x11'),_0x594ee3,'request\x20sent');_0x53dd8d(_0x30e2bb['result']['message']);}})['catch'](function(_0x119372){logger[_0x1f81('0x16')]('SmsAccount,\x20%s,\x20%s',_0x594ee3,_0x119372);_0x294d9c(_0x119372);});});}exports['ShowSmsAccount']=function(_0x57ab45){var _0x4a7f1d=this;return new Promise(function(_0x18006b,_0xe658a3){return db[_0x1f81('0x1a')][_0x1f81('0x1b')]({'raw':_0x57ab45['options']?_0x57ab45[_0x1f81('0x1c')][_0x1f81('0x1d')]===undefined?!![]:![]:!![],'where':_0x57ab45[_0x1f81('0x1c')]?_0x57ab45[_0x1f81('0x1c')][_0x1f81('0x1e')]||null:null,'attributes':_0x57ab45[_0x1f81('0x1c')]?_0x57ab45[_0x1f81('0x1c')][_0x1f81('0x1f')]||null:null,'include':_0x57ab45[_0x1f81('0x1c')]?_0x57ab45[_0x1f81('0x1c')][_0x1f81('0x20')]?_[_0x1f81('0x21')](_0x57ab45[_0x1f81('0x1c')][_0x1f81('0x20')],function(_0x2c87fe){return{'model':db[_0x2c87fe[_0x1f81('0x22')]],'as':_0x2c87fe['as'],'attributes':_0x2c87fe[_0x1f81('0x1f')],'include':_0x2c87fe[_0x1f81('0x20')]?_[_0x1f81('0x21')](_0x2c87fe['include'],function(_0x1b2cbb){return{'model':db[_0x1b2cbb[_0x1f81('0x22')]],'as':_0x1b2cbb['as'],'attributes':_0x1b2cbb[_0x1f81('0x1f')],'include':_0x1b2cbb[_0x1f81('0x20')]?_[_0x1f81('0x21')](_0x1b2cbb[_0x1f81('0x20')],function(_0x58d3b6){return{'model':db[_0x58d3b6['model']],'as':_0x58d3b6['as'],'attributes':_0x58d3b6[_0x1f81('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1f81('0x23')](function(_0x3aa02f){logger[_0x1f81('0x19')](_0x1f81('0x24'),_0x57ab45);logger[_0x1f81('0x12')](_0x1f81('0x24'),_0x57ab45,JSON[_0x1f81('0x15')](_0x3aa02f));_0x18006b(_0x3aa02f);})[_0x1f81('0x25')](function(_0x41faf3){logger['error'](_0x1f81('0x24'),_0x41faf3[_0x1f81('0x18')],_0x57ab45);_0xe658a3(_0x4a7f1d[_0x1f81('0x16')](0x1f4,_0x41faf3['message']));});});}; \ No newline at end of file +var _0x9397=['model','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSmsAccount','find','options','raw','where','attributes','include','map'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x9397,0x15f));var _0x7939=function(_0x304107,_0xa47eaf){_0x304107=_0x304107-0x0;var _0x43d4af=_0x9397[_0x304107];return _0x43d4af;};'use strict';var _=require(_0x7939('0x0'));var util=require(_0x7939('0x1'));var moment=require('moment');var BPromise=require(_0x7939('0x2'));var rs=require(_0x7939('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7939('0x4'));var logger=require(_0x7939('0x5'))(_0x7939('0x6'));var config=require(_0x7939('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7939('0x8')][_0x7939('0x9')]({'port':0x232a});config[_0x7939('0xa')]=_[_0x7939('0xb')](config[_0x7939('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7939('0xc'))(new Redis(config['redis']));require(_0x7939('0xd'))[_0x7939('0xe')](socket);function respondWithRpcPromise(_0x3f7147,_0x226226,_0x590d2b){return new BPromise(function(_0x4297c0,_0x44c5bc){return client[_0x7939('0xf')](_0x3f7147,_0x590d2b)[_0x7939('0x10')](function(_0x5c27ac){logger[_0x7939('0x11')](_0x7939('0x12'),_0x226226,_0x7939('0x13'));logger[_0x7939('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x226226,_0x7939('0x13'),JSON[_0x7939('0x15')](_0x5c27ac));if(_0x5c27ac['error']){if(_0x5c27ac[_0x7939('0x16')][_0x7939('0x17')]===0x1f4){logger[_0x7939('0x16')](_0x7939('0x12'),_0x226226,_0x5c27ac[_0x7939('0x16')][_0x7939('0x18')]);return _0x44c5bc(_0x5c27ac[_0x7939('0x16')][_0x7939('0x18')]);}logger[_0x7939('0x16')](_0x7939('0x12'),_0x226226,_0x5c27ac[_0x7939('0x16')][_0x7939('0x18')]);return _0x4297c0(_0x5c27ac[_0x7939('0x16')][_0x7939('0x18')]);}else{logger['info'](_0x7939('0x12'),_0x226226,_0x7939('0x13'));_0x4297c0(_0x5c27ac['result'][_0x7939('0x18')]);}})[_0x7939('0x19')](function(_0x2055b6){logger[_0x7939('0x16')](_0x7939('0x12'),_0x226226,_0x2055b6);_0x44c5bc(_0x2055b6);});});}exports[_0x7939('0x1a')]=function(_0x879a86){var _0x3a605d=this;return new Promise(function(_0x3ce651,_0x550a17){return db['SmsAccount'][_0x7939('0x1b')]({'raw':_0x879a86[_0x7939('0x1c')]?_0x879a86[_0x7939('0x1c')][_0x7939('0x1d')]===undefined?!![]:![]:!![],'where':_0x879a86[_0x7939('0x1c')]?_0x879a86['options'][_0x7939('0x1e')]||null:null,'attributes':_0x879a86[_0x7939('0x1c')]?_0x879a86[_0x7939('0x1c')][_0x7939('0x1f')]||null:null,'include':_0x879a86['options']?_0x879a86[_0x7939('0x1c')][_0x7939('0x20')]?_[_0x7939('0x21')](_0x879a86[_0x7939('0x1c')][_0x7939('0x20')],function(_0x33f49c){return{'model':db[_0x33f49c['model']],'as':_0x33f49c['as'],'attributes':_0x33f49c['attributes'],'include':_0x33f49c['include']?_[_0x7939('0x21')](_0x33f49c[_0x7939('0x20')],function(_0x15b548){return{'model':db[_0x15b548[_0x7939('0x22')]],'as':_0x15b548['as'],'attributes':_0x15b548[_0x7939('0x1f')],'include':_0x15b548[_0x7939('0x20')]?_['map'](_0x15b548[_0x7939('0x20')],function(_0x131542){return{'model':db[_0x131542[_0x7939('0x22')]],'as':_0x131542['as'],'attributes':_0x131542[_0x7939('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7939('0x10')](function(_0x21172a){logger[_0x7939('0x11')](_0x7939('0x1a'),_0x879a86);logger[_0x7939('0x14')](_0x7939('0x1a'),_0x879a86,JSON[_0x7939('0x15')](_0x21172a));_0x3ce651(_0x21172a);})[_0x7939('0x19')](function(_0x345f6e){logger[_0x7939('0x16')]('ShowSmsAccount',_0x345f6e[_0x7939('0x18')],_0x879a86);_0x550a17(_0x3a605d['error'](0x1f4,_0x345f6e[_0x7939('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 4ff34dc..1af465e 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 1393a6b..928e5aa 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x10cde6,_0x5c823a){var _0x1fd24e=function(_0x23f742){while(--_0x23f742){_0x10cde6['push'](_0x10cde6['shift']());}};_0x1fd24e(++_0x5c823a);}(_0x34e8,0x12c));var _0x834e=function(_0x5e4bc9,_0x28ad8c){_0x5e4bc9=_0x5e4bc9-0x0;var _0x30862e=_0x34e8[_0x5e4bc9];return _0x30862e;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b3badfa..382724e 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 _0x2271=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x4833b2,_0x332c7c){var _0x34a989=function(_0x3da557){while(--_0x3da557){_0x4833b2['push'](_0x4833b2['shift']());}};_0x34a989(++_0x332c7c);}(_0x2271,0x1c2));var _0x1227=function(_0x4e72b0,_0x38ca6e){_0x4e72b0=_0x4e72b0-0x0;var _0xc2a028=_0x2271[_0x4e72b0];return _0xc2a028;};'use strict';var Sequelize=require(_0x1227('0x0'));module[_0x1227('0x1')]={'priority':{'type':Sequelize[_0x1227('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1227('0x3')],'allowNull':![],'defaultValue':_0x1227('0x4')},'appdata':{'type':Sequelize[_0x1227('0x5')]()},'description':{'type':Sequelize[_0x1227('0x3')]},'interval':{'type':Sequelize[_0x1227('0x3')],'defaultValue':_0x1227('0x6')}}; \ No newline at end of file +var _0x711f=['sequelize','exports','STRING','TEXT','*,*,*,*'];(function(_0x476419,_0x175333){var _0x3789bc=function(_0x2fa4dd){while(--_0x2fa4dd){_0x476419['push'](_0x476419['shift']());}};_0x3789bc(++_0x175333);}(_0x711f,0xbe));var _0xf711=function(_0x44ceee,_0x2a5e28){_0x44ceee=_0x44ceee-0x0;var _0x1a065c=_0x711f[_0x44ceee];return _0x1a065c;};'use strict';var Sequelize=require(_0xf711('0x0'));module[_0xf711('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf711('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf711('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf711('0x2')],'defaultValue':_0xf711('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index daa4f12..e04bc36 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 _0x9974=['VIRTUAL','options','SmsApplication','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x9974,0x1cb));var _0x4997=function(_0xac0cde,_0x278968){_0xac0cde=_0xac0cde-0x0;var _0x44dfad=_0x9974[_0xac0cde];return _0x44dfad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4997('0x0'));var zipdir=require(_0x4997('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4997('0x2'));var moment=require(_0x4997('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4997('0x4'));var util=require(_0x4997('0x5'));var path=require(_0x4997('0x6'));var sox=require(_0x4997('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4997('0x8'));var squel=require(_0x4997('0x9'));var crypto=require(_0x4997('0xa'));var jsforce=require(_0x4997('0xb'));var deskjs=require(_0x4997('0xc'));var toCsv=require(_0x4997('0xd'));var querystring=require(_0x4997('0xe'));var Papa=require(_0x4997('0xf'));var Redis=require(_0x4997('0x10'));var authService=require(_0x4997('0x11'));var qs=require(_0x4997('0x12'));var as=require(_0x4997('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4997('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4997('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x84cc23,_0x35c5af){_0x35c5af=_0x35c5af||0xcc;return function(_0x11b8ac){if(_0x11b8ac){return _0x84cc23['sendStatus'](_0x35c5af);}return _0x84cc23['status'](_0x35c5af)[_0x4997('0x16')]();};}function respondWithResult(_0x1c2c79,_0x290520){_0x290520=_0x290520||0xc8;return function(_0x355f99){if(_0x355f99){return _0x1c2c79[_0x4997('0x17')](_0x290520)[_0x4997('0x18')](_0x355f99);}};}function respondWithFilteredResult(_0x432edd,_0x423548){return function(_0x15dd0f){if(_0x15dd0f){var _0x8bd5bb=typeof _0x423548[_0x4997('0x19')]===_0x4997('0x1a')&&typeof _0x423548[_0x4997('0x1b')]===_0x4997('0x1a');var _0x2264b3=_0x15dd0f[_0x4997('0x1c')];var _0x5751d8=_0x8bd5bb?0x0:_0x423548[_0x4997('0x19')];var _0x51e151=_0x8bd5bb?_0x15dd0f[_0x4997('0x1c')]:_0x423548[_0x4997('0x19')]+_0x423548[_0x4997('0x1b')];var _0x20cbdb;if(_0x51e151>=_0x2264b3){_0x51e151=_0x2264b3;_0x20cbdb=0xc8;}else{_0x20cbdb=0xce;}_0x432edd[_0x4997('0x17')](_0x20cbdb);return _0x432edd[_0x4997('0x1d')](_0x4997('0x1e'),_0x5751d8+'-'+_0x51e151+'/'+_0x2264b3)['json'](_0x15dd0f);}return null;};}function patchUpdates(_0x162c31){return function(_0x44074c){try{jsonpatch[_0x4997('0x1f')](_0x44074c,_0x162c31,!![]);}catch(_0x3bbf51){return BPromise[_0x4997('0x20')](_0x3bbf51);}return _0x44074c['save']();};}function saveUpdates(_0xa115b6,_0x297675){return function(_0x4abfc2){if(_0x4abfc2){return _0x4abfc2['update'](_0xa115b6)[_0x4997('0x21')](function(_0x33a321){return _0x33a321;});}return null;};}function removeEntity(_0x5210bd,_0x3921af){return function(_0xcdc7c1){if(_0xcdc7c1){return _0xcdc7c1['destroy']()['then'](function(){_0x5210bd[_0x4997('0x17')](0xcc)[_0x4997('0x16')]();});}};}function handleEntityNotFound(_0x51ef39,_0x54db21){return function(_0xa09b2d){if(!_0xa09b2d){_0x51ef39[_0x4997('0x22')](0x194);}return _0xa09b2d;};}function handleError(_0x1c9140,_0x50cc6f){_0x50cc6f=_0x50cc6f||0x1f4;return function(_0x58dc28){logger[_0x4997('0x23')](_0x58dc28['stack']);if(_0x58dc28[_0x4997('0x24')]){delete _0x58dc28[_0x4997('0x24')];}_0x1c9140['status'](_0x50cc6f)[_0x4997('0x25')](_0x58dc28);};}exports[_0x4997('0x26')]=function(_0x4599b0,_0x3e4f6f){var _0x1d090d={},_0x1cb432={},_0x250e2d={'count':0x0,'rows':[]};var _0x5e54b7=_[_0x4997('0x27')](db['SmsApplication'][_0x4997('0x28')],function(_0x2f641b){return{'name':_0x2f641b[_0x4997('0x29')],'type':_0x2f641b[_0x4997('0x2a')][_0x4997('0x2b')]};});_0x1cb432[_0x4997('0x2c')]=_['map'](_0x5e54b7,'name');_0x1cb432['query']=_[_0x4997('0x2d')](_0x4599b0[_0x4997('0x2e')]);_0x1cb432[_0x4997('0x2f')]=_['intersection'](_0x1cb432[_0x4997('0x2c')],_0x1cb432[_0x4997('0x2e')]);_0x1d090d[_0x4997('0x30')]=_[_0x4997('0x31')](_0x1cb432[_0x4997('0x2c')],qs[_0x4997('0x32')](_0x4599b0[_0x4997('0x2e')][_0x4997('0x32')]));_0x1d090d[_0x4997('0x30')]=_0x1d090d[_0x4997('0x30')][_0x4997('0x33')]?_0x1d090d[_0x4997('0x30')]:_0x1cb432[_0x4997('0x2c')];if(!_0x4599b0[_0x4997('0x2e')][_0x4997('0x34')]('nolimit')){_0x1d090d['limit']=qs[_0x4997('0x1b')](_0x4599b0['query'][_0x4997('0x1b')]);_0x1d090d[_0x4997('0x19')]=qs[_0x4997('0x19')](_0x4599b0[_0x4997('0x2e')][_0x4997('0x19')]);}_0x1d090d[_0x4997('0x35')]=qs['sort'](_0x4599b0[_0x4997('0x2e')][_0x4997('0x36')]);_0x1d090d[_0x4997('0x37')]=qs[_0x4997('0x2f')](_[_0x4997('0x38')](_0x4599b0[_0x4997('0x2e')],_0x1cb432[_0x4997('0x2f')]),_0x5e54b7);if(_0x4599b0[_0x4997('0x2e')][_0x4997('0x39')]){_0x1d090d[_0x4997('0x37')]=_[_0x4997('0x3a')](_0x1d090d[_0x4997('0x37')],{'$or':_['map'](_0x5e54b7,function(_0x211974){if(_0x211974[_0x4997('0x2a')]!==_0x4997('0x3b')){var _0x439acc={};_0x439acc[_0x211974[_0x4997('0x24')]]={'$like':'%'+_0x4599b0[_0x4997('0x2e')][_0x4997('0x39')]+'%'};return _0x439acc;}})});}_0x1d090d=_['merge']({},_0x1d090d,_0x4599b0[_0x4997('0x3c')]);var _0x5610b2={'where':_0x1d090d[_0x4997('0x37')]};return db[_0x4997('0x3d')][_0x4997('0x1c')](_0x5610b2)[_0x4997('0x21')](function(_0x570b94){_0x250e2d[_0x4997('0x1c')]=_0x570b94;if(_0x4599b0[_0x4997('0x2e')][_0x4997('0x3e')]){_0x1d090d[_0x4997('0x3f')]=[{'all':!![]}];}return db[_0x4997('0x3d')][_0x4997('0x40')](_0x1d090d);})[_0x4997('0x21')](function(_0x3c56d1){_0x250e2d[_0x4997('0x41')]=_0x3c56d1;return _0x250e2d;})[_0x4997('0x21')](respondWithFilteredResult(_0x3e4f6f,_0x1d090d))[_0x4997('0x42')](handleError(_0x3e4f6f,null));};exports[_0x4997('0x43')]=function(_0x165f0d,_0x2ecee5){var _0x47bb41={'raw':!![],'where':{'id':_0x165f0d[_0x4997('0x44')]['id']}},_0xf020ec={};_0xf020ec[_0x4997('0x2c')]=_[_0x4997('0x2d')](db[_0x4997('0x3d')]['rawAttributes']);_0xf020ec[_0x4997('0x2e')]=_[_0x4997('0x2d')](_0x165f0d[_0x4997('0x2e')]);_0xf020ec[_0x4997('0x2f')]=_[_0x4997('0x31')](_0xf020ec[_0x4997('0x2c')],_0xf020ec[_0x4997('0x2e')]);_0x47bb41[_0x4997('0x30')]=_['intersection'](_0xf020ec['model'],qs[_0x4997('0x32')](_0x165f0d[_0x4997('0x2e')][_0x4997('0x32')]));_0x47bb41['attributes']=_0x47bb41[_0x4997('0x30')][_0x4997('0x33')]?_0x47bb41['attributes']:_0xf020ec[_0x4997('0x2c')];if(_0x165f0d['query'][_0x4997('0x3e')]){_0x47bb41['include']=[{'all':!![]}];}_0x47bb41=_[_0x4997('0x3a')]({},_0x47bb41,_0x165f0d[_0x4997('0x3c')]);return db[_0x4997('0x3d')][_0x4997('0x45')](_0x47bb41)[_0x4997('0x21')](handleEntityNotFound(_0x2ecee5,null))[_0x4997('0x21')](respondWithResult(_0x2ecee5,null))[_0x4997('0x42')](handleError(_0x2ecee5,null));};exports[_0x4997('0x46')]=function(_0x30d1c8,_0x8ddb3c){return db['SmsApplication'][_0x4997('0x46')](_0x30d1c8[_0x4997('0x47')],{})[_0x4997('0x21')](respondWithResult(_0x8ddb3c,0xc9))['catch'](handleError(_0x8ddb3c,null));};exports[_0x4997('0x48')]=function(_0x4428cb,_0x25608f){if(_0x4428cb['body']['id']){delete _0x4428cb['body']['id'];}return db['SmsApplication'][_0x4997('0x45')]({'where':{'id':_0x4428cb[_0x4997('0x44')]['id']}})[_0x4997('0x21')](handleEntityNotFound(_0x25608f,null))[_0x4997('0x21')](saveUpdates(_0x4428cb['body'],null))['then'](respondWithResult(_0x25608f,null))[_0x4997('0x42')](handleError(_0x25608f,null));};exports[_0x4997('0x49')]=function(_0x41b216,_0x31fe30){return db[_0x4997('0x3d')][_0x4997('0x45')]({'where':{'id':_0x41b216['params']['id']}})[_0x4997('0x21')](handleEntityNotFound(_0x31fe30,null))[_0x4997('0x21')](removeEntity(_0x31fe30,null))[_0x4997('0x42')](handleError(_0x31fe30,null));}; \ No newline at end of file +var _0x05be=['type','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','SmsApplication','rawAttributes','map','filters','intersection','model','query','fields','attributes','length','nolimit','limit','sort','where','pick','filter'];(function(_0x3798d0,_0x525b45){var _0x3d7214=function(_0x47824e){while(--_0x47824e){_0x3798d0['push'](_0x3798d0['shift']());}};_0x3d7214(++_0x525b45);}(_0x05be,0x1dc));var _0xe05b=function(_0x55d6bf,_0x27d38d){_0x55d6bf=_0x55d6bf-0x0;var _0x379799=_0x05be[_0x55d6bf];return _0x379799;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe05b('0x0'));var rp=require(_0xe05b('0x1'));var moment=require(_0xe05b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe05b('0x3'));var util=require('util');var path=require('path');var sox=require(_0xe05b('0x4'));var csv=require(_0xe05b('0x5'));var ejs=require(_0xe05b('0x6'));var fs=require('fs');var fs_extra=require(_0xe05b('0x7'));var _=require('lodash');var squel=require(_0xe05b('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe05b('0x9'));var authService=require(_0xe05b('0xa'));var qs=require(_0xe05b('0xb'));var as=require(_0xe05b('0xc'));var hardwareService=require(_0xe05b('0xd'));var logger=require('../../config/logger')(_0xe05b('0xe'));var utils=require('../../config/utils');var config=require(_0xe05b('0xf'));var licenseUtil=require(_0xe05b('0x10'));var db=require(_0xe05b('0x11'))['db'];function respondWithStatusCode(_0x2b6bd5,_0x3cca38){_0x3cca38=_0x3cca38||0xcc;return function(_0x18adac){if(_0x18adac){return _0x2b6bd5['sendStatus'](_0x3cca38);}return _0x2b6bd5[_0xe05b('0x12')](_0x3cca38)[_0xe05b('0x13')]();};}function respondWithResult(_0x27923b,_0xef05cb){_0xef05cb=_0xef05cb||0xc8;return function(_0x257175){if(_0x257175){return _0x27923b[_0xe05b('0x12')](_0xef05cb)[_0xe05b('0x14')](_0x257175);}};}function respondWithFilteredResult(_0xc97ee0,_0xaa0a44){return function(_0x507f71){if(_0x507f71){var _0x582b31=typeof _0xaa0a44[_0xe05b('0x15')]===_0xe05b('0x16')&&typeof _0xaa0a44['limit']===_0xe05b('0x16');var _0x429922=_0x507f71[_0xe05b('0x17')];var _0x7f1fce=_0x582b31?0x0:_0xaa0a44[_0xe05b('0x15')];var _0x1e6f64=_0x582b31?_0x507f71[_0xe05b('0x17')]:_0xaa0a44[_0xe05b('0x15')]+_0xaa0a44['limit'];var _0x5a02a7;if(_0x1e6f64>=_0x429922){_0x1e6f64=_0x429922;_0x5a02a7=0xc8;}else{_0x5a02a7=0xce;}_0xc97ee0['status'](_0x5a02a7);return _0xc97ee0[_0xe05b('0x18')]('Content-Range',_0x7f1fce+'-'+_0x1e6f64+'/'+_0x429922)['json'](_0x507f71);}return null;};}function patchUpdates(_0xf00870){return function(_0x411857){try{jsonpatch[_0xe05b('0x19')](_0x411857,_0xf00870,!![]);}catch(_0x5ed095){return BPromise[_0xe05b('0x1a')](_0x5ed095);}return _0x411857[_0xe05b('0x1b')]();};}function saveUpdates(_0x3d3a30,_0x552c70){return function(_0x3e7827){if(_0x3e7827){return _0x3e7827[_0xe05b('0x1c')](_0x3d3a30)[_0xe05b('0x1d')](function(_0x572378){return _0x572378;});}return null;};}function removeEntity(_0x353aba,_0x36bc69){return function(_0x5509c3){if(_0x5509c3){return _0x5509c3[_0xe05b('0x1e')]()['then'](function(){_0x353aba[_0xe05b('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x358f28,_0x4fbc9a){return function(_0x2b609d){if(!_0x2b609d){_0x358f28['sendStatus'](0x194);}return _0x2b609d;};}function handleError(_0x5ba829,_0x2a8d67){_0x2a8d67=_0x2a8d67||0x1f4;return function(_0x2aacb3){logger[_0xe05b('0x1f')](_0x2aacb3[_0xe05b('0x20')]);if(_0x2aacb3[_0xe05b('0x21')]){delete _0x2aacb3[_0xe05b('0x21')];}_0x5ba829['status'](_0x2a8d67)[_0xe05b('0x22')](_0x2aacb3);};}exports[_0xe05b('0x23')]=function(_0x230f56,_0x227f29){var _0x441767={},_0x22f57b={},_0x237a13={'count':0x0,'rows':[]};var _0x359335=_['map'](db[_0xe05b('0x24')][_0xe05b('0x25')],function(_0x2798e5){return{'name':_0x2798e5['fieldName'],'type':_0x2798e5['type']['key']};});_0x22f57b['model']=_[_0xe05b('0x26')](_0x359335,_0xe05b('0x21'));_0x22f57b['query']=_['keys'](_0x230f56['query']);_0x22f57b[_0xe05b('0x27')]=_[_0xe05b('0x28')](_0x22f57b[_0xe05b('0x29')],_0x22f57b[_0xe05b('0x2a')]);_0x441767['attributes']=_[_0xe05b('0x28')](_0x22f57b[_0xe05b('0x29')],qs['fields'](_0x230f56[_0xe05b('0x2a')][_0xe05b('0x2b')]));_0x441767[_0xe05b('0x2c')]=_0x441767[_0xe05b('0x2c')][_0xe05b('0x2d')]?_0x441767[_0xe05b('0x2c')]:_0x22f57b['model'];if(!_0x230f56[_0xe05b('0x2a')]['hasOwnProperty'](_0xe05b('0x2e'))){_0x441767['limit']=qs[_0xe05b('0x2f')](_0x230f56[_0xe05b('0x2a')][_0xe05b('0x2f')]);_0x441767[_0xe05b('0x15')]=qs['offset'](_0x230f56[_0xe05b('0x2a')][_0xe05b('0x15')]);}_0x441767['order']=qs['sort'](_0x230f56[_0xe05b('0x2a')][_0xe05b('0x30')]);_0x441767[_0xe05b('0x31')]=qs['filters'](_[_0xe05b('0x32')](_0x230f56['query'],_0x22f57b[_0xe05b('0x27')]),_0x359335);if(_0x230f56[_0xe05b('0x2a')][_0xe05b('0x33')]){_0x441767['where']=_['merge'](_0x441767[_0xe05b('0x31')],{'$or':_['map'](_0x359335,function(_0x3bdb0c){if(_0x3bdb0c[_0xe05b('0x34')]!=='VIRTUAL'){var _0x423e77={};_0x423e77[_0x3bdb0c[_0xe05b('0x21')]]={'$like':'%'+_0x230f56['query'][_0xe05b('0x33')]+'%'};return _0x423e77;}})});}_0x441767=_[_0xe05b('0x35')]({},_0x441767,_0x230f56[_0xe05b('0x36')]);var _0x3e8664={'where':_0x441767[_0xe05b('0x31')]};return db[_0xe05b('0x24')]['count'](_0x3e8664)[_0xe05b('0x1d')](function(_0x30a815){_0x237a13[_0xe05b('0x17')]=_0x30a815;if(_0x230f56['query'][_0xe05b('0x37')]){_0x441767[_0xe05b('0x38')]=[{'all':!![]}];}return db['SmsApplication'][_0xe05b('0x39')](_0x441767);})[_0xe05b('0x1d')](function(_0x8a619d){_0x237a13[_0xe05b('0x3a')]=_0x8a619d;return _0x237a13;})[_0xe05b('0x1d')](respondWithFilteredResult(_0x227f29,_0x441767))[_0xe05b('0x3b')](handleError(_0x227f29,null));};exports[_0xe05b('0x3c')]=function(_0x4aa76c,_0x44292d){var _0x38f149={'raw':!![],'where':{'id':_0x4aa76c[_0xe05b('0x3d')]['id']}},_0x2b3545={};_0x2b3545['model']=_['keys'](db[_0xe05b('0x24')]['rawAttributes']);_0x2b3545[_0xe05b('0x2a')]=_[_0xe05b('0x3e')](_0x4aa76c['query']);_0x2b3545[_0xe05b('0x27')]=_[_0xe05b('0x28')](_0x2b3545['model'],_0x2b3545[_0xe05b('0x2a')]);_0x38f149['attributes']=_[_0xe05b('0x28')](_0x2b3545[_0xe05b('0x29')],qs['fields'](_0x4aa76c['query'][_0xe05b('0x2b')]));_0x38f149[_0xe05b('0x2c')]=_0x38f149['attributes'][_0xe05b('0x2d')]?_0x38f149[_0xe05b('0x2c')]:_0x2b3545[_0xe05b('0x29')];if(_0x4aa76c[_0xe05b('0x2a')]['includeAll']){_0x38f149[_0xe05b('0x38')]=[{'all':!![]}];}_0x38f149=_[_0xe05b('0x35')]({},_0x38f149,_0x4aa76c[_0xe05b('0x36')]);return db[_0xe05b('0x24')][_0xe05b('0x3f')](_0x38f149)[_0xe05b('0x1d')](handleEntityNotFound(_0x44292d,null))[_0xe05b('0x1d')](respondWithResult(_0x44292d,null))[_0xe05b('0x3b')](handleError(_0x44292d,null));};exports[_0xe05b('0x40')]=function(_0x4e1156,_0x1ee26e){return db[_0xe05b('0x24')][_0xe05b('0x40')](_0x4e1156[_0xe05b('0x41')],{})['then'](respondWithResult(_0x1ee26e,0xc9))[_0xe05b('0x3b')](handleError(_0x1ee26e,null));};exports[_0xe05b('0x1c')]=function(_0x14d18c,_0x46728d){if(_0x14d18c[_0xe05b('0x41')]['id']){delete _0x14d18c[_0xe05b('0x41')]['id'];}return db[_0xe05b('0x24')]['find']({'where':{'id':_0x14d18c[_0xe05b('0x3d')]['id']}})[_0xe05b('0x1d')](handleEntityNotFound(_0x46728d,null))['then'](saveUpdates(_0x14d18c[_0xe05b('0x41')],null))[_0xe05b('0x1d')](respondWithResult(_0x46728d,null))['catch'](handleError(_0x46728d,null));};exports[_0xe05b('0x1e')]=function(_0x4be175,_0x26c7bd){return db['SmsApplication'][_0xe05b('0x3f')]({'where':{'id':_0x4be175['params']['id']}})['then'](handleEntityNotFound(_0x26c7bd,null))['then'](removeEntity(_0x26c7bd,null))[_0xe05b('0x3b')](handleError(_0x26c7bd,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 0b045e6..bffc3ce 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 _0x2e02=['rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','util','api','moment','bluebird','request-promise','path'];(function(_0x40575c,_0x1b99f9){var _0x1daac3=function(_0x2ce802){while(--_0x2ce802){_0x40575c['push'](_0x40575c['shift']());}};_0x1daac3(++_0x1b99f9);}(_0x2e02,0xcc));var _0x22e0=function(_0x43c62a,_0x125d82){_0x43c62a=_0x43c62a-0x0;var _0x367fb8=_0x2e02[_0x43c62a];return _0x367fb8;};'use strict';var _=require('lodash');var util=require(_0x22e0('0x0'));var logger=require('../../config/logger')(_0x22e0('0x1'));var moment=require(_0x22e0('0x2'));var BPromise=require(_0x22e0('0x3'));var rp=require(_0x22e0('0x4'));var fs=require('fs');var path=require(_0x22e0('0x5'));var rimraf=require(_0x22e0('0x6'));var config=require(_0x22e0('0x7'));var attributes=require(_0x22e0('0x8'));module[_0x22e0('0x9')]=function(_0x2067f3,_0x27a94f){return _0x2067f3[_0x22e0('0xa')](_0x22e0('0xb'),attributes,{'tableName':_0x22e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x22e0('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1f93=['SmsApplication','sms_applications','utf8mb4','util','../../config/logger','api','bluebird','request-promise','rimraf','./smsApplication.attributes','exports','define'];(function(_0x269672,_0x2e3531){var _0x38289d=function(_0x17bab4){while(--_0x17bab4){_0x269672['push'](_0x269672['shift']());}};_0x38289d(++_0x2e3531);}(_0x1f93,0x19b));var _0x31f9=function(_0xaa2eba,_0x43834e){_0xaa2eba=_0xaa2eba-0x0;var _0x4901fc=_0x1f93[_0xaa2eba];return _0x4901fc;};'use strict';var _=require('lodash');var util=require(_0x31f9('0x0'));var logger=require(_0x31f9('0x1'))(_0x31f9('0x2'));var moment=require('moment');var BPromise=require(_0x31f9('0x3'));var rp=require(_0x31f9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31f9('0x5'));var config=require('../../config/environment');var attributes=require(_0x31f9('0x6'));module[_0x31f9('0x7')]=function(_0x584af2,_0x5f309c){return _0x584af2[_0x31f9('0x8')](_0x31f9('0x9'),attributes,{'tableName':_0x31f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x31f9('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 3d984ad..e9c08fc 100644 --- a/server/api/smsApplication/smsApplication.rpc.js +++ b/server/api/smsApplication/smsApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa413=['result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','info'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0xa413,0x1e5));var _0x3a41=function(_0x468afb,_0x53b753){_0x468afb=_0x468afb-0x0;var _0x30c0e3=_0xa413[_0x468afb];return _0x30c0e3;};'use strict';var _=require(_0x3a41('0x0'));var util=require('util');var moment=require(_0x3a41('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a41('0x2'));var fs=require('fs');var Redis=require(_0x3a41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a41('0x4'))(_0x3a41('0x5'));var config=require(_0x3a41('0x6'));var jayson=require(_0x3a41('0x7'));var client=jayson[_0x3a41('0x8')][_0x3a41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45f6d2,_0x407d52,_0xca7253){return new BPromise(function(_0x473cd2,_0x27c2e5){return client['request'](_0x45f6d2,_0xca7253)[_0x3a41('0xa')](function(_0x570304){logger['info']('SmsApplication,\x20%s,\x20%s',_0x407d52,_0x3a41('0xb'));logger['debug'](_0x3a41('0xc'),_0x407d52,'request\x20sent',JSON[_0x3a41('0xd')](_0x570304));if(_0x570304[_0x3a41('0xe')]){if(_0x570304['error'][_0x3a41('0xf')]===0x1f4){logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x27c2e5(_0x570304['error'][_0x3a41('0x11')]);}logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x473cd2(_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);}else{logger[_0x3a41('0x12')](_0x3a41('0x10'),_0x407d52,_0x3a41('0xb'));_0x473cd2(_0x570304[_0x3a41('0x13')]['message']);}})[_0x3a41('0x14')](function(_0x30d675){logger['error']('SmsApplication,\x20%s,\x20%s',_0x407d52,_0x30d675);_0x27c2e5(_0x30d675);});});} \ No newline at end of file +var _0xf1f9=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x1939e0,_0x2fbce2){var _0x2cfeec=function(_0x5222c8){while(--_0x5222c8){_0x1939e0['push'](_0x1939e0['shift']());}};_0x2cfeec(++_0x2fbce2);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x2e1a6c,_0x1e0fc0){_0x2e1a6c=_0x2e1a6c-0x0;var _0x2715a2=_0xf1f9[_0x2e1a6c];return _0x2715a2;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require(_0x9f1f('0x7'))(_0x9f1f('0x8'));var config=require(_0x9f1f('0x9'));var jayson=require(_0x9f1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x363d26,_0x373b98,_0x117fa5){return new BPromise(function(_0x12309e,_0x4e6054){return client[_0x9f1f('0xb')](_0x363d26,_0x117fa5)[_0x9f1f('0xc')](function(_0x3efac2){logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));logger[_0x9f1f('0x10')](_0x9f1f('0x11'),_0x373b98,'request\x20sent',JSON[_0x9f1f('0x12')](_0x3efac2));if(_0x3efac2[_0x9f1f('0x13')]){if(_0x3efac2[_0x9f1f('0x13')]['code']===0x1f4){logger['error'](_0x9f1f('0xe'),_0x373b98,_0x3efac2['error'][_0x9f1f('0x14')]);return _0x4e6054(_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);}logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);return _0x12309e(_0x3efac2['error'][_0x9f1f('0x14')]);}else{logger['info'](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));_0x12309e(_0x3efac2[_0x9f1f('0x15')][_0x9f1f('0x14')]);}})[_0x9f1f('0x16')](function(_0x5645fc){logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x5645fc);_0x4e6054(_0x5645fc);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 11a0746..a01dc24 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 _0x0713=['put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','smsinteraction:addtags','addTags'];(function(_0x255e3b,_0x5acf2a){var _0x3b60b2=function(_0x1d341a){while(--_0x1d341a){_0x255e3b['push'](_0x255e3b['shift']());}};_0x3b60b2(++_0x5acf2a);}(_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('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/download',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x11')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['post']('/:id/messages',auth[_0x3071('0x9')](),controller['addMessage']);router[_0x3071('0x11')](_0x3071('0x13'),auth['isAuthenticated'](),interaction[_0x3071('0x14')]('sms',_0x3071('0x15')),controller[_0x3071('0x16')]);router[_0x3071('0x17')](_0x3071('0xd'),auth[_0x3071('0x9')](),interaction[_0x3071('0x14')](_0x3071('0x18'),_0x3071('0x19')),controller[_0x3071('0x1a')]);router[_0x3071('0x1b')]('/:id',auth[_0x3071('0x9')](),interaction[_0x3071('0x14')](_0x3071('0x18'),_0x3071('0x1c')),controller[_0x3071('0x1d')]);router[_0x3071('0x1b')](_0x3071('0x13'),auth[_0x3071('0x9')](),controller['removeTags']);module[_0x3071('0x1e')]=router; \ No newline at end of file +var _0x3266=['isAuthenticated','index','get','/:id','show','getMessages','/:id/download','download','post','create','addMessage','sms','smsinteraction:addtags','addTags','put','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller'];(function(_0x2d0570,_0x454225){var _0x955d2f=function(_0x2073e7){while(--_0x2073e7){_0x2d0570['push'](_0x2d0570['shift']());}};_0x955d2f(++_0x454225);}(_0x3266,0x6a));var _0x6326=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x3266[_0xd1c39b];return _0x58f5bc;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require(_0x6326('0x2'));var timeout=require(_0x6326('0x3'));var express=require(_0x6326('0x4'));var router=express[_0x6326('0x5')]();var fs_extra=require(_0x6326('0x6'));var auth=require(_0x6326('0x7'));var interaction=require(_0x6326('0x8'));var config=require('../../config/environment');var controller=require(_0x6326('0x9'));router['get']('/',auth[_0x6326('0xa')](),controller[_0x6326('0xb')]);router[_0x6326('0xc')]('/describe',auth[_0x6326('0xa')](),controller['describe']);router[_0x6326('0xc')](_0x6326('0xd'),auth[_0x6326('0xa')](),controller[_0x6326('0xe')]);router[_0x6326('0xc')]('/:id/messages',auth[_0x6326('0xa')](),controller[_0x6326('0xf')]);router[_0x6326('0xc')](_0x6326('0x10'),auth[_0x6326('0xa')](),controller[_0x6326('0x11')]);router[_0x6326('0x12')]('/',auth[_0x6326('0xa')](),controller[_0x6326('0x13')]);router[_0x6326('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6326('0x14')]);router[_0x6326('0x12')]('/:id/tags',auth[_0x6326('0xa')](),interaction['tracked'](_0x6326('0x15'),_0x6326('0x16')),controller[_0x6326('0x17')]);router[_0x6326('0x18')](_0x6326('0xd'),auth[_0x6326('0xa')](),interaction['tracked'](_0x6326('0x15'),'smsinteraction:update'),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x6326('0x15'),_0x6326('0x19')),controller[_0x6326('0x1a')]);router['delete']('/:id/tags',auth[_0x6326('0xa')](),controller[_0x6326('0x1b')]);module[_0x6326('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 730a3e0..e01c4d8 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 _0xf95f=['out','ENUM','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x4cb6db,_0x424fb2){var _0x2540c8=function(_0xfdc6b5){while(--_0xfdc6b5){_0x4cb6db['push'](_0x4cb6db['shift']());}};_0x2540c8(++_0x424fb2);}(_0xf95f,0x142));var _0xff95=function(_0x3feec6,_0x4db012){_0x3feec6=_0x3feec6-0x0;var _0x56d5e2=_0xf95f[_0x3feec6];return _0x56d5e2;};'use strict';var Sequelize=require(_0xff95('0x0'));var moment=require(_0xff95('0x1'));module[_0xff95('0x2')]={'closed':{'type':Sequelize[_0xff95('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xff95('0x4')]},'disposition':{'type':Sequelize[_0xff95('0x5')]},'secondDisposition':{'type':Sequelize[_0xff95('0x5')]},'thirdDisposition':{'type':Sequelize[_0xff95('0x5')]},'note':{'type':Sequelize[_0xff95('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xff95('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xff95('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xff95('0x7')]('in',_0xff95('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xff95('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdcc4=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x167564,_0x1f1c18){var _0x555f1a=function(_0x21b1ac){while(--_0x21b1ac){_0x167564['push'](_0x167564['shift']());}};_0x555f1a(++_0x1f1c18);}(_0xdcc4,0xea));var _0x4dcc=function(_0x4ebf6a,_0xfd0a40){_0x4ebf6a=_0x4ebf6a-0x0;var _0x1e7a72=_0xdcc4[_0x4ebf6a];return _0x1e7a72;};'use strict';var Sequelize=require(_0x4dcc('0x0'));var moment=require(_0x4dcc('0x1'));module[_0x4dcc('0x2')]={'closed':{'type':Sequelize[_0x4dcc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4dcc('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4dcc('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4dcc('0x5')]},'note':{'type':Sequelize[_0x4dcc('0x5')]},'phone':{'type':Sequelize[_0x4dcc('0x5')]},'read1stAt':{'type':Sequelize[_0x4dcc('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4dcc('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4dcc('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4dcc('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4dcc('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 7f0fa89..a75b7cd 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 _0x7ee4=['format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','push','User','fullname','lastName','Messages','direction','secret','Account','get','mkdirSync','Sms','Owner','createdAt','closedAt','out','System','Contact','firstName','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','then','destroy','error','stack','name','index','map','SmsInteraction','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','keys','rawAttributes','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','update','body','params','find','SmsMessage','ids','getMessages','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','$gte','split'];(function(_0x4c6585,_0xd4075b){var _0x4baf47=function(_0x5244ae){while(--_0x5244ae){_0x4c6585['push'](_0x4c6585['shift']());}};_0x4baf47(++_0xd4075b);}(_0x7ee4,0xa7));var _0x47ee=function(_0x279bbc,_0x4857fb){_0x279bbc=_0x279bbc-0x0;var _0x527c92=_0x7ee4[_0x279bbc];return _0x527c92;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x47ee('0x0'));var moment=require(_0x47ee('0x1'));var BPromise=require(_0x47ee('0x2'));var util=require(_0x47ee('0x3'));var path=require(_0x47ee('0x4'));var ejs=require(_0x47ee('0x5'));var fs=require('fs');var _=require(_0x47ee('0x6'));var Redis=require(_0x47ee('0x7'));var interaction=require(_0x47ee('0x8'));var qs=require(_0x47ee('0x9'));var pdf=require(_0x47ee('0xa'));var logger=require(_0x47ee('0xb'))('api');var config=require(_0x47ee('0xc'));var db=require(_0x47ee('0xd'))['db'];config[_0x47ee('0xe')]=_[_0x47ee('0xf')](config[_0x47ee('0xe')],{'host':_0x47ee('0x10'),'port':0x18eb});var socket=require(_0x47ee('0x11'))(new Redis(config['redis']));require(_0x47ee('0x12'))[_0x47ee('0x13')](socket);function respondWithStatusCode(_0x4b04c5,_0x23bd9f){_0x23bd9f=_0x23bd9f||0xcc;return function(_0x2122a7){if(_0x2122a7){return _0x4b04c5[_0x47ee('0x14')](_0x23bd9f);}return _0x4b04c5[_0x47ee('0x15')](_0x23bd9f)[_0x47ee('0x16')]();};}function respondWithResult(_0x5b7090,_0x3bf00e){_0x3bf00e=_0x3bf00e||0xc8;return function(_0x38ffa9){if(_0x38ffa9){return _0x5b7090[_0x47ee('0x15')](_0x3bf00e)['json'](_0x38ffa9);}};}function respondWithFilteredResult(_0x211199,_0x2c655f){return function(_0x5d21fc){if(_0x5d21fc){var _0x25de45=typeof _0x2c655f[_0x47ee('0x17')]===_0x47ee('0x18')&&typeof _0x2c655f[_0x47ee('0x19')]==='undefined';var _0x40cd83=_0x5d21fc[_0x47ee('0x1a')];var _0x53f1cc=_0x25de45?0x0:_0x2c655f[_0x47ee('0x17')];var _0x84917c=_0x25de45?_0x5d21fc[_0x47ee('0x1a')]:_0x2c655f[_0x47ee('0x17')]+_0x2c655f[_0x47ee('0x19')];var _0x1dcf04;if(_0x84917c>=_0x40cd83){_0x84917c=_0x40cd83;_0x1dcf04=0xc8;}else{_0x1dcf04=0xce;}_0x211199[_0x47ee('0x15')](_0x1dcf04);return _0x211199['set'](_0x47ee('0x1b'),_0x53f1cc+'-'+_0x84917c+'/'+_0x40cd83)[_0x47ee('0x1c')](_0x5d21fc);}return null;};}function saveUpdates(_0xe8902b){return function(_0x2bb7bb){if(_0x2bb7bb){return _0x2bb7bb['update'](_0xe8902b)[_0x47ee('0x1d')](function(_0x4d498e){return _0x4d498e;});}return null;};}function removeEntity(_0xfb763e){return function(_0x1688d2){if(_0x1688d2){return _0x1688d2[_0x47ee('0x1e')]()[_0x47ee('0x1d')](function(){_0xfb763e['status'](0xcc)[_0x47ee('0x16')]();});}};}function handleEntityNotFound(_0x43c719){return function(_0x462b81){if(!_0x462b81){_0x43c719[_0x47ee('0x14')](0x194);}return _0x462b81;};}function handleError(_0x5cd240,_0x2c5047){_0x2c5047=_0x2c5047||0x1f4;return function(_0x4d43a4){logger[_0x47ee('0x1f')](_0x4d43a4[_0x47ee('0x20')]);if(_0x4d43a4[_0x47ee('0x21')]){delete _0x4d43a4[_0x47ee('0x21')];}_0x5cd240[_0x47ee('0x15')](_0x2c5047)['send'](_0x4d43a4);};}exports[_0x47ee('0x22')]=function(_0x10dea5,_0x13720f){var _0x414327={};var _0x4dfa04=_[_0x47ee('0x23')](db[_0x47ee('0x24')]['rawAttributes'],function(_0x9956e6){return{'name':_0x9956e6[_0x47ee('0x25')],'type':_0x9956e6[_0x47ee('0x26')][_0x47ee('0x27')]};});_0x414327=qs[_0x47ee('0x28')](_0x4dfa04,_0x10dea5);return interaction[_0x47ee('0x29')](_0x47ee('0x2a'),_0x10dea5[_0x47ee('0x2b')],_0x10dea5[_0x47ee('0x2c')],_0x414327,_0x4dfa04)[_0x47ee('0x1d')](respondWithFilteredResult(_0x13720f,_0x414327))[_0x47ee('0x2d')](handleError(_0x13720f,null));};exports[_0x47ee('0x2e')]=function(_0x3cf77c,_0x5bc1ed){var _0x4cd6c3={'raw':![],'where':{'id':_0x3cf77c['params']['id']}},_0x5d93ea={};_0x5d93ea['model']=_[_0x47ee('0x2f')](db['SmsInteraction'][_0x47ee('0x30')]);_0x5d93ea['query']=_[_0x47ee('0x2f')](_0x3cf77c[_0x47ee('0x2b')]);_0x5d93ea[_0x47ee('0x31')]=_['intersection'](_0x5d93ea[_0x47ee('0x32')],_0x5d93ea[_0x47ee('0x2b')]);_0x4cd6c3[_0x47ee('0x33')]=_[_0x47ee('0x34')](_0x5d93ea['model'],qs['fields'](_0x3cf77c['query'][_0x47ee('0x35')]));_0x4cd6c3[_0x47ee('0x33')]=_0x4cd6c3[_0x47ee('0x33')][_0x47ee('0x36')]?_0x4cd6c3[_0x47ee('0x33')]:_0x5d93ea[_0x47ee('0x32')];if(_0x3cf77c['query'][_0x47ee('0x37')]){_0x4cd6c3[_0x47ee('0x38')]=[{'all':!![]}];}_0x4cd6c3=_[_0x47ee('0x39')]({},_0x4cd6c3,_0x3cf77c[_0x47ee('0x3a')]);return db[_0x47ee('0x24')]['find'](_0x4cd6c3)['then'](handleEntityNotFound(_0x5bc1ed,null))[_0x47ee('0x1d')](respondWithResult(_0x5bc1ed,null))[_0x47ee('0x2d')](handleError(_0x5bc1ed,null));};exports['create']=function(_0x28773e,_0xc764d9){return db[_0x47ee('0x24')]['create'](_0x28773e['body'],{})[_0x47ee('0x1d')](respondWithResult(_0xc764d9,0xc9))['catch'](handleError(_0xc764d9,null));};exports[_0x47ee('0x3b')]=function(_0xef4f05,_0x2fb97a){if(_0xef4f05[_0x47ee('0x3c')]['id']){delete _0xef4f05['body']['id'];}return db[_0x47ee('0x24')]['find']({'where':{'id':_0xef4f05[_0x47ee('0x3d')]['id']}})[_0x47ee('0x1d')](handleEntityNotFound(_0x2fb97a,null))[_0x47ee('0x1d')](saveUpdates(_0xef4f05[_0x47ee('0x3c')],null))[_0x47ee('0x1d')](respondWithResult(_0x2fb97a,null))[_0x47ee('0x2d')](handleError(_0x2fb97a,null));};exports[_0x47ee('0x1e')]=function(_0xaec704,_0xd86447){return db[_0x47ee('0x24')][_0x47ee('0x3e')]({'where':{'id':_0xaec704[_0x47ee('0x3d')]['id']}})[_0x47ee('0x1d')](handleEntityNotFound(_0xd86447,null))['then'](removeEntity(_0xd86447,null))[_0x47ee('0x2d')](handleError(_0xd86447,null));};exports['describe']=function(_0x1852a2,_0xf55d21){return db[_0x47ee('0x24')]['describe']()[_0x47ee('0x1d')](respondWithResult(_0xf55d21,null))[_0x47ee('0x2d')](handleError(_0xf55d21,null));};exports['addMessage']=function(_0x5ae049,_0x10f411){return db[_0x47ee('0x3f')]['find']({'where':{'id':_0x5ae049[_0x47ee('0x3d')]['id']}})['then'](handleEntityNotFound(_0x10f411,null))[_0x47ee('0x1d')](function(_0x3a2389){if(_0x3a2389){return _0x3a2389['addMessage'](_0x5ae049[_0x47ee('0x3c')][_0x47ee('0x40')],_['omit'](_0x5ae049[_0x47ee('0x3c')],[_0x47ee('0x40'),'id'])||{});}})[_0x47ee('0x1d')](respondWithResult(_0x10f411,null))['catch'](handleError(_0x10f411,null));};exports[_0x47ee('0x41')]=function(_0xfd14c1,_0x520092){var _0x25cb49={'raw':![],'where':{}};var _0x3b1085={};var _0x5cf298={'count':0x0,'rows':[]};return db[_0x47ee('0x24')]['findOne']({'where':{'id':_0xfd14c1[_0x47ee('0x3d')]['id']}})[_0x47ee('0x1d')](handleEntityNotFound(_0x520092,null))['then'](function(_0x1ba96d){if(_0x1ba96d){_0x3b1085[_0x47ee('0x32')]=_[_0x47ee('0x2f')](db[_0x47ee('0x3f')]['rawAttributes']);_0x3b1085[_0x47ee('0x2b')]=_[_0x47ee('0x2f')](_0xfd14c1[_0x47ee('0x2b')]);_0x3b1085[_0x47ee('0x31')]=_[_0x47ee('0x34')](_0x3b1085[_0x47ee('0x32')],_0x3b1085[_0x47ee('0x2b')]);_0x25cb49[_0x47ee('0x33')]=_[_0x47ee('0x34')](_0x3b1085['model'],qs[_0x47ee('0x35')](_0xfd14c1[_0x47ee('0x2b')][_0x47ee('0x35')]));_0x25cb49['attributes']=_0x25cb49[_0x47ee('0x33')][_0x47ee('0x36')]?_0x25cb49['attributes']:_0x3b1085[_0x47ee('0x32')];if(!_0xfd14c1['query'][_0x47ee('0x42')]('nolimit')){_0x25cb49[_0x47ee('0x19')]=qs[_0x47ee('0x19')](_0xfd14c1[_0x47ee('0x2b')]['limit']);_0x25cb49[_0x47ee('0x17')]=qs[_0x47ee('0x17')](_0xfd14c1[_0x47ee('0x2b')][_0x47ee('0x17')]);}_0x25cb49[_0x47ee('0x43')]=qs[_0x47ee('0x44')](_0xfd14c1[_0x47ee('0x2b')][_0x47ee('0x44')]);_0x25cb49[_0x47ee('0x45')]=qs['filters'](_[_0x47ee('0x46')](_0xfd14c1[_0x47ee('0x2b')],_0x3b1085[_0x47ee('0x31')]));_0x25cb49[_0x47ee('0x45')][_0x47ee('0x47')]=_0x1ba96d['id'];if(_0xfd14c1[_0x47ee('0x2b')][_0x47ee('0x48')]){_0x25cb49[_0x47ee('0x45')]=_[_0x47ee('0x39')](_0x25cb49['where'],{'$or':_['map'](_0x25cb49['attributes'],function(_0x1f70c0){var _0x34baaf={};_0x34baaf[_0x1f70c0]={'$like':'%'+_0xfd14c1[_0x47ee('0x2b')]['filter']+'%'};return _0x34baaf;})});}if(_0xfd14c1['query']['$gte']){var _0x831013=_0xfd14c1[_0x47ee('0x2b')][_0x47ee('0x49')][_0x47ee('0x4a')](',');var _0x5c1135={};_0x5c1135[_0x831013[0x0]]={'$gte':moment(_0x831013[0x1])[_0x47ee('0x4b')](_0x47ee('0x4c'))};_0x25cb49[_0x47ee('0x45')]=_[_0x47ee('0x39')](_0x25cb49[_0x47ee('0x45')],_0x5c1135);}_0x25cb49=_[_0x47ee('0x39')]({},_0x25cb49,_0xfd14c1[_0x47ee('0x3a')]);return db[_0x47ee('0x3f')]['count']({'where':_0x25cb49[_0x47ee('0x45')]})[_0x47ee('0x1d')](function(_0xd11040){_0x5cf298[_0x47ee('0x1a')]=_0xd11040;if(_0xfd14c1['query'][_0x47ee('0x37')]){_0x25cb49[_0x47ee('0x38')]=[{'all':!![]}];}return db[_0x47ee('0x3f')][_0x47ee('0x29')](_0x25cb49);})['then'](function(_0x1351ae){_0x5cf298[_0x47ee('0x4d')]=_0x1351ae;return _0x5cf298;});}})[_0x47ee('0x1d')](respondWithFilteredResult(_0x520092,_0x25cb49))[_0x47ee('0x2d')](handleError(_0x520092,null));};exports[_0x47ee('0x4e')]=function(_0x345885,_0x2aa41e){return db[_0x47ee('0x24')][_0x47ee('0x3e')]({'where':{'id':_0x345885[_0x47ee('0x3d')]['id']}})[_0x47ee('0x1d')](handleEntityNotFound(_0x2aa41e,null))[_0x47ee('0x1d')](function(_0x59f94f){if(_0x59f94f){return _0x59f94f[_0x47ee('0x4f')](_0x345885[_0x47ee('0x3c')][_0x47ee('0x40')],_[_0x47ee('0x50')](_0x345885[_0x47ee('0x3c')],[_0x47ee('0x40'),'id'])||{})['spread'](function(){return db[_0x47ee('0x51')][_0x47ee('0x29')]({'attributes':['id','name',_0x47ee('0x52')],'where':{'id':_0x345885[_0x47ee('0x3c')][_0x47ee('0x40')]}});})[_0x47ee('0x1d')](function(_0x123b74){socket[_0x47ee('0x53')](_0x47ee('0x54'),{'id':Number(_0x345885['params']['id']),'tags':_0x123b74||[]});return{'id':Number(_0x345885['params']['id']),'tags':_0x123b74||[]};});}})[_0x47ee('0x1d')](respondWithResult(_0x2aa41e,null))['catch'](handleError(_0x2aa41e,null));};exports['removeTags']=function(_0x4305d1,_0x367278){return db[_0x47ee('0x24')]['find']({'where':{'id':_0x4305d1[_0x47ee('0x3d')]['id']}})['then'](handleEntityNotFound(_0x367278,null))['then'](function(_0x511685){if(_0x511685){return _0x511685[_0x47ee('0x55')](_0x4305d1[_0x47ee('0x2b')][_0x47ee('0x40')]);}})[_0x47ee('0x1d')](respondWithStatusCode(_0x367278,null))['catch'](handleError(_0x367278,null));};exports[_0x47ee('0x56')]=function(_0x538440,_0x1ec135){var _0x37d716=moment()[_0x47ee('0x57')]()[_0x47ee('0x58')]();var _0x5bb54a=path[_0x47ee('0x59')](config[_0x47ee('0x5a')],'server',_0x47ee('0x5b'),_0x47ee('0x5c'));var _0x45c179=path[_0x47ee('0x59')](_0x5bb54a,_0x37d716);var _0x188978=util[_0x47ee('0x4b')]('transcript-%d-%s.zip',_0x538440[_0x47ee('0x3d')]['id'],_0x37d716);var _0x3d3b26=path[_0x47ee('0x59')](_0x5bb54a,_0x188978);var _0x72913a=[];_0x72913a[_0x47ee('0x5d')]({'model':db[_0x47ee('0x5e')],'as':_0x47ee('0x5e'),'attributes':['id',_0x47ee('0x5f')],'raw':!![]});_0x72913a[_0x47ee('0x5d')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0x47ee('0x60')],'raw':!![]});var _0x45d1f0=[{'model':db['SmsMessage'],'as':_0x47ee('0x61'),'attributes':['id',_0x47ee('0x3c'),'createdAt',_0x47ee('0x62'),_0x47ee('0x63'),'read'],'include':_0x72913a}];_0x45d1f0['push']({'model':db['SmsAccount'],'as':_0x47ee('0x64'),'attributes':['id','name']});_0x45d1f0[_0x47ee('0x5d')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0x47ee('0x3e')]({'where':{'id':_0x538440[_0x47ee('0x3d')]['id']},'include':_0x45d1f0})[_0x47ee('0x1d')](handleEntityNotFound(_0x1ec135,null))['then'](function(_0x5117de){if(_0x5117de){var _0x21f21c=_0x5117de[_0x47ee('0x65')]({'plain':!![]});fs[_0x47ee('0x66')](_0x45c179);var _0x166675={'channel':_0x47ee('0x67'),'account':_0x21f21c[_0x47ee('0x64')]['name'],'agent':_0x21f21c[_0x47ee('0x68')]?_0x21f21c[_0x47ee('0x68')][_0x47ee('0x5f')]:'N.A.','createdAt':moment(_0x21f21c[_0x47ee('0x69')])[_0x47ee('0x4b')](_0x47ee('0x4c'))[_0x47ee('0x58')](),'closedAt':_0x21f21c['closed']?moment(_0x21f21c[_0x47ee('0x6a')])[_0x47ee('0x4b')](_0x47ee('0x4c'))[_0x47ee('0x58')]():'','disposition':_0x21f21c['disposition'],'messages':_(_0x21f21c[_0x47ee('0x61')])[_0x47ee('0x48')]({'secret':![]})[_0x47ee('0x23')](function(_0x27cb95){return{'date':moment(_0x27cb95[_0x47ee('0x69')])[_0x47ee('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x27cb95[_0x47ee('0x62')]===_0x47ee('0x6b')?_0x27cb95[_0x47ee('0x5e')]?_0x27cb95[_0x47ee('0x5e')][_0x47ee('0x5f')]:_0x47ee('0x6c'):_0x27cb95[_0x47ee('0x6d')][_0x47ee('0x6e')]+(_0x27cb95[_0x47ee('0x6d')]['lastName']?'\x20'+_0x27cb95[_0x47ee('0x6d')][_0x47ee('0x60')]:''),'body':_0x27cb95['body'],'direction':_0x27cb95['direction']===_0x47ee('0x6b')?'A':'C','secret':_0x27cb95[_0x47ee('0x63')],'read':_0x27cb95[_0x47ee('0x6f')]};})[_0x47ee('0x70')]()};return ejs[_0x47ee('0x71')](path['join'](config[_0x47ee('0x5a')],'server',_0x47ee('0x72'),_0x47ee('0x73')),{'interaction':_0x166675})[_0x47ee('0x1d')](function(_0xc1a685){var _0x308039=path['join'](_0x45c179,_0x47ee('0x74')+_0x21f21c['id']+'-'+_0x37d716+_0x47ee('0x75'));var _0x462789={'path':_0x308039,'channel':'Sms','interactionId':_0x21f21c['id']};return pdf[_0x47ee('0x76')](_0xc1a685,_0x462789);})[_0x47ee('0x1d')](function(){return new BPromise(function(_0x1a8eec,_0x5bcd5e){zipdir(_0x45c179,{'saveTo':_0x3d3b26},function(_0x49dbde,_0x4522c0){if(_0x49dbde)return _0x5bcd5e(_0x49dbde);return _0x1a8eec(_0x4522c0);});})[_0x47ee('0x1d')](function(){return new BPromise(function(_0x235d8a,_0x46b34e){rimraf(_0x45c179,function(_0x1e9ef6){if(_0x1e9ef6)_0x46b34e(_0x1e9ef6);return _0x235d8a();});});})['then'](function(){return _0x1ec135['download'](_0x3d3b26,_0x188978,function(_0x1e9335){if(_0x1e9335){console['log'](_0x47ee('0x77'),_0x1e9335);}else{fs[_0x47ee('0x78')](_0x3d3b26);}});});});}else{return _0x1ec135['sendStatus'](0xc8);}})[_0x47ee('0x2d')](handleError(_0x1ec135,null));}; \ No newline at end of file +var _0x234d=['unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','defaults','redis','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','params','model','keys','intersection','attributes','fields','length','includeAll','include','find','catch','create','body','describe','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','SmsMessage','rows','addTags','setTags','color','smsInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','direction','secret','read','SmsAccount','Account','Owner','get','N.A.','createdAt','closedAt','disposition','Messages','out','System','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','err'];(function(_0xf947d9,_0x6a67fb){var _0x412e73=function(_0x63cd89){while(--_0x63cd89){_0xf947d9['push'](_0xf947d9['shift']());}};_0x412e73(++_0x6a67fb);}(_0x234d,0x1dd));var _0xd234=function(_0x3d74a2,_0x21d570){_0x3d74a2=_0x3d74a2-0x0;var _0x5e7a7a=_0x234d[_0x3d74a2];return _0x5e7a7a;};'use strict';var rimraf=require(_0xd234('0x0'));var zipdir=require(_0xd234('0x1'));var moment=require(_0xd234('0x2'));var BPromise=require(_0xd234('0x3'));var util=require('util');var path=require(_0xd234('0x4'));var ejs=require(_0xd234('0x5'));var fs=require('fs');var _=require(_0xd234('0x6'));var Redis=require(_0xd234('0x7'));var interaction=require(_0xd234('0x8'));var qs=require(_0xd234('0x9'));var pdf=require(_0xd234('0xa'));var logger=require('../../config/logger')('api');var config=require(_0xd234('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd234('0xc')](config[_0xd234('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd234('0xd')]));require(_0xd234('0xe'))[_0xd234('0xf')](socket);function respondWithStatusCode(_0x183c9b,_0x40cb77){_0x40cb77=_0x40cb77||0xcc;return function(_0x401fd1){if(_0x401fd1){return _0x183c9b[_0xd234('0x10')](_0x40cb77);}return _0x183c9b[_0xd234('0x11')](_0x40cb77)[_0xd234('0x12')]();};}function respondWithResult(_0x568e63,_0x183d10){_0x183d10=_0x183d10||0xc8;return function(_0x1c6187){if(_0x1c6187){return _0x568e63[_0xd234('0x11')](_0x183d10)[_0xd234('0x13')](_0x1c6187);}};}function respondWithFilteredResult(_0x51f241,_0x56d8fa){return function(_0x47235d){if(_0x47235d){var _0x533232=typeof _0x56d8fa[_0xd234('0x14')]===_0xd234('0x15')&&typeof _0x56d8fa[_0xd234('0x16')]===_0xd234('0x15');var _0x5bc874=_0x47235d['count'];var _0x488a6b=_0x533232?0x0:_0x56d8fa[_0xd234('0x14')];var _0x32e6df=_0x533232?_0x47235d[_0xd234('0x17')]:_0x56d8fa[_0xd234('0x14')]+_0x56d8fa[_0xd234('0x16')];var _0x15c6b3;if(_0x32e6df>=_0x5bc874){_0x32e6df=_0x5bc874;_0x15c6b3=0xc8;}else{_0x15c6b3=0xce;}_0x51f241[_0xd234('0x11')](_0x15c6b3);return _0x51f241['set'](_0xd234('0x18'),_0x488a6b+'-'+_0x32e6df+'/'+_0x5bc874)[_0xd234('0x13')](_0x47235d);}return null;};}function saveUpdates(_0xb10e63){return function(_0x3d869e){if(_0x3d869e){return _0x3d869e[_0xd234('0x19')](_0xb10e63)[_0xd234('0x1a')](function(_0x2f42f8){return _0x2f42f8;});}return null;};}function removeEntity(_0x4e02c8){return function(_0x940eaf){if(_0x940eaf){return _0x940eaf[_0xd234('0x1b')]()[_0xd234('0x1a')](function(){_0x4e02c8[_0xd234('0x11')](0xcc)[_0xd234('0x12')]();});}};}function handleEntityNotFound(_0x4abbba){return function(_0x493669){if(!_0x493669){_0x4abbba[_0xd234('0x10')](0x194);}return _0x493669;};}function handleError(_0x2abf7c,_0x14fc9c){_0x14fc9c=_0x14fc9c||0x1f4;return function(_0x370ee8){logger[_0xd234('0x1c')](_0x370ee8[_0xd234('0x1d')]);if(_0x370ee8[_0xd234('0x1e')]){delete _0x370ee8[_0xd234('0x1e')];}_0x2abf7c[_0xd234('0x11')](_0x14fc9c)[_0xd234('0x1f')](_0x370ee8);};}exports[_0xd234('0x20')]=function(_0x1da4e4,_0x407ab9){var _0x25c175={};var _0x2395c6=_[_0xd234('0x21')](db[_0xd234('0x22')][_0xd234('0x23')],function(_0x5cc6f5){return{'name':_0x5cc6f5[_0xd234('0x24')],'type':_0x5cc6f5[_0xd234('0x25')][_0xd234('0x26')]};});_0x25c175=qs[_0xd234('0x27')](_0x2395c6,_0x1da4e4);return interaction[_0xd234('0x28')](_0xd234('0x29'),_0x1da4e4[_0xd234('0x2a')],_0x1da4e4[_0xd234('0x2b')],_0x25c175,_0x2395c6)['then'](respondWithFilteredResult(_0x407ab9,_0x25c175))['catch'](handleError(_0x407ab9,null));};exports['show']=function(_0x13dbea,_0x5636d2){var _0x5ba18d={'raw':![],'where':{'id':_0x13dbea[_0xd234('0x2c')]['id']}},_0x5982a8={};_0x5982a8[_0xd234('0x2d')]=_[_0xd234('0x2e')](db[_0xd234('0x22')]['rawAttributes']);_0x5982a8[_0xd234('0x2a')]=_['keys'](_0x13dbea['query']);_0x5982a8['filters']=_[_0xd234('0x2f')](_0x5982a8[_0xd234('0x2d')],_0x5982a8[_0xd234('0x2a')]);_0x5ba18d[_0xd234('0x30')]=_[_0xd234('0x2f')](_0x5982a8[_0xd234('0x2d')],qs['fields'](_0x13dbea['query'][_0xd234('0x31')]));_0x5ba18d[_0xd234('0x30')]=_0x5ba18d[_0xd234('0x30')][_0xd234('0x32')]?_0x5ba18d[_0xd234('0x30')]:_0x5982a8[_0xd234('0x2d')];if(_0x13dbea[_0xd234('0x2a')][_0xd234('0x33')]){_0x5ba18d[_0xd234('0x34')]=[{'all':!![]}];}_0x5ba18d=_['merge']({},_0x5ba18d,_0x13dbea['options']);return db[_0xd234('0x22')][_0xd234('0x35')](_0x5ba18d)['then'](handleEntityNotFound(_0x5636d2,null))['then'](respondWithResult(_0x5636d2,null))[_0xd234('0x36')](handleError(_0x5636d2,null));};exports[_0xd234('0x37')]=function(_0x3d6300,_0x5046dc){return db['SmsInteraction'][_0xd234('0x37')](_0x3d6300['body'],{})['then'](respondWithResult(_0x5046dc,0xc9))[_0xd234('0x36')](handleError(_0x5046dc,null));};exports[_0xd234('0x19')]=function(_0x92ad86,_0x2c2893){if(_0x92ad86[_0xd234('0x38')]['id']){delete _0x92ad86[_0xd234('0x38')]['id'];}return db['SmsInteraction'][_0xd234('0x35')]({'where':{'id':_0x92ad86[_0xd234('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2c2893,null))[_0xd234('0x1a')](saveUpdates(_0x92ad86[_0xd234('0x38')],null))['then'](respondWithResult(_0x2c2893,null))['catch'](handleError(_0x2c2893,null));};exports[_0xd234('0x1b')]=function(_0xff5138,_0x2ac2f4){return db[_0xd234('0x22')]['find']({'where':{'id':_0xff5138['params']['id']}})[_0xd234('0x1a')](handleEntityNotFound(_0x2ac2f4,null))[_0xd234('0x1a')](removeEntity(_0x2ac2f4,null))[_0xd234('0x36')](handleError(_0x2ac2f4,null));};exports[_0xd234('0x39')]=function(_0x378114,_0x547ab2){return db[_0xd234('0x22')][_0xd234('0x39')]()[_0xd234('0x1a')](respondWithResult(_0x547ab2,null))[_0xd234('0x36')](handleError(_0x547ab2,null));};exports[_0xd234('0x3a')]=function(_0x24b742,_0x26cbf8){return db['SmsMessage'][_0xd234('0x35')]({'where':{'id':_0x24b742['params']['id']}})[_0xd234('0x1a')](handleEntityNotFound(_0x26cbf8,null))[_0xd234('0x1a')](function(_0x210fbb){if(_0x210fbb){return _0x210fbb['addMessage'](_0x24b742['body'][_0xd234('0x3b')],_[_0xd234('0x3c')](_0x24b742[_0xd234('0x38')],[_0xd234('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x26cbf8,null))[_0xd234('0x36')](handleError(_0x26cbf8,null));};exports['getMessages']=function(_0x21e042,_0x20ea1f){var _0x294384={'raw':![],'where':{}};var _0x24b1b3={};var _0x1c9f87={'count':0x0,'rows':[]};return db[_0xd234('0x22')]['findOne']({'where':{'id':_0x21e042[_0xd234('0x2c')]['id']}})[_0xd234('0x1a')](handleEntityNotFound(_0x20ea1f,null))['then'](function(_0x21f4db){if(_0x21f4db){_0x24b1b3['model']=_[_0xd234('0x2e')](db['SmsMessage'][_0xd234('0x23')]);_0x24b1b3[_0xd234('0x2a')]=_[_0xd234('0x2e')](_0x21e042[_0xd234('0x2a')]);_0x24b1b3['filters']=_[_0xd234('0x2f')](_0x24b1b3[_0xd234('0x2d')],_0x24b1b3[_0xd234('0x2a')]);_0x294384[_0xd234('0x30')]=_[_0xd234('0x2f')](_0x24b1b3[_0xd234('0x2d')],qs[_0xd234('0x31')](_0x21e042[_0xd234('0x2a')][_0xd234('0x31')]));_0x294384['attributes']=_0x294384[_0xd234('0x30')][_0xd234('0x32')]?_0x294384[_0xd234('0x30')]:_0x24b1b3[_0xd234('0x2d')];if(!_0x21e042[_0xd234('0x2a')][_0xd234('0x3d')](_0xd234('0x3e'))){_0x294384[_0xd234('0x16')]=qs[_0xd234('0x16')](_0x21e042[_0xd234('0x2a')][_0xd234('0x16')]);_0x294384['offset']=qs[_0xd234('0x14')](_0x21e042['query'][_0xd234('0x14')]);}_0x294384[_0xd234('0x3f')]=qs['sort'](_0x21e042[_0xd234('0x2a')][_0xd234('0x40')]);_0x294384[_0xd234('0x41')]=qs[_0xd234('0x42')](_[_0xd234('0x43')](_0x21e042['query'],_0x24b1b3['filters']));_0x294384[_0xd234('0x41')]['SmsInteractionId']=_0x21f4db['id'];if(_0x21e042['query'][_0xd234('0x44')]){_0x294384[_0xd234('0x41')]=_[_0xd234('0x45')](_0x294384[_0xd234('0x41')],{'$or':_['map'](_0x294384['attributes'],function(_0x559058){var _0x3add0f={};_0x3add0f[_0x559058]={'$like':'%'+_0x21e042[_0xd234('0x2a')][_0xd234('0x44')]+'%'};return _0x3add0f;})});}if(_0x21e042[_0xd234('0x2a')][_0xd234('0x46')]){var _0x513b11=_0x21e042[_0xd234('0x2a')]['$gte'][_0xd234('0x47')](',');var _0x3e8f4a={};_0x3e8f4a[_0x513b11[0x0]]={'$gte':moment(_0x513b11[0x1])[_0xd234('0x48')](_0xd234('0x49'))};_0x294384[_0xd234('0x41')]=_[_0xd234('0x45')](_0x294384[_0xd234('0x41')],_0x3e8f4a);}_0x294384=_['merge']({},_0x294384,_0x21e042[_0xd234('0x4a')]);return db['SmsMessage'][_0xd234('0x17')]({'where':_0x294384[_0xd234('0x41')]})[_0xd234('0x1a')](function(_0x8d7483){_0x1c9f87[_0xd234('0x17')]=_0x8d7483;if(_0x21e042[_0xd234('0x2a')][_0xd234('0x33')]){_0x294384['include']=[{'all':!![]}];}return db[_0xd234('0x4b')]['findAll'](_0x294384);})[_0xd234('0x1a')](function(_0x1d4a51){_0x1c9f87[_0xd234('0x4c')]=_0x1d4a51;return _0x1c9f87;});}})[_0xd234('0x1a')](respondWithFilteredResult(_0x20ea1f,_0x294384))[_0xd234('0x36')](handleError(_0x20ea1f,null));};exports[_0xd234('0x4d')]=function(_0x5c5508,_0xef2e53){return db[_0xd234('0x22')][_0xd234('0x35')]({'where':{'id':_0x5c5508[_0xd234('0x2c')]['id']}})[_0xd234('0x1a')](handleEntityNotFound(_0xef2e53,null))['then'](function(_0x4dc215){if(_0x4dc215){return _0x4dc215[_0xd234('0x4e')](_0x5c5508[_0xd234('0x38')][_0xd234('0x3b')],_['omit'](_0x5c5508['body'],['ids','id'])||{})['spread'](function(){return db['Tag'][_0xd234('0x28')]({'attributes':['id',_0xd234('0x1e'),_0xd234('0x4f')],'where':{'id':_0x5c5508[_0xd234('0x38')][_0xd234('0x3b')]}});})[_0xd234('0x1a')](function(_0x4ec4bd){socket['emit'](_0xd234('0x50'),{'id':Number(_0x5c5508['params']['id']),'tags':_0x4ec4bd||[]});return{'id':Number(_0x5c5508[_0xd234('0x2c')]['id']),'tags':_0x4ec4bd||[]};});}})[_0xd234('0x1a')](respondWithResult(_0xef2e53,null))[_0xd234('0x36')](handleError(_0xef2e53,null));};exports['removeTags']=function(_0x49c892,_0x42e09a){return db['SmsInteraction'][_0xd234('0x35')]({'where':{'id':_0x49c892[_0xd234('0x2c')]['id']}})['then'](handleEntityNotFound(_0x42e09a,null))[_0xd234('0x1a')](function(_0x218d64){if(_0x218d64){return _0x218d64[_0xd234('0x51')](_0x49c892['query'][_0xd234('0x3b')]);}})[_0xd234('0x1a')](respondWithStatusCode(_0x42e09a,null))['catch'](handleError(_0x42e09a,null));};exports[_0xd234('0x52')]=function(_0x4fc9ea,_0x33a9b4){var _0xbbf51d=moment()['unix']()[_0xd234('0x53')]();var _0x4f2cc6=path[_0xd234('0x54')](config[_0xd234('0x55')],_0xd234('0x56'),_0xd234('0x57'),_0xd234('0x58'));var _0x2a84fa=path[_0xd234('0x54')](_0x4f2cc6,_0xbbf51d);var _0x52ba2a=util[_0xd234('0x48')](_0xd234('0x59'),_0x4fc9ea[_0xd234('0x2c')]['id'],_0xbbf51d);var _0x2aae43=path[_0xd234('0x54')](_0x4f2cc6,_0x52ba2a);var _0x57ccf8=[];_0x57ccf8[_0xd234('0x5a')]({'model':db['User'],'as':_0xd234('0x5b'),'attributes':['id',_0xd234('0x5c')],'raw':!![]});_0x57ccf8[_0xd234('0x5a')]({'model':db['CmContact'],'as':_0xd234('0x5d'),'attributes':['id',_0xd234('0x5e'),_0xd234('0x5f')],'raw':!![]});var _0xcf2387=[{'model':db[_0xd234('0x4b')],'as':'Messages','attributes':['id',_0xd234('0x38'),'createdAt',_0xd234('0x60'),_0xd234('0x61'),_0xd234('0x62')],'include':_0x57ccf8}];_0xcf2387[_0xd234('0x5a')]({'model':db[_0xd234('0x63')],'as':_0xd234('0x64'),'attributes':['id',_0xd234('0x1e')]});_0xcf2387[_0xd234('0x5a')]({'model':db['User'],'as':_0xd234('0x65'),'attributes':['id',_0xd234('0x5c')]});return db[_0xd234('0x22')][_0xd234('0x35')]({'where':{'id':_0x4fc9ea['params']['id']},'include':_0xcf2387})['then'](handleEntityNotFound(_0x33a9b4,null))[_0xd234('0x1a')](function(_0x370aba){if(_0x370aba){var _0x46b8b4=_0x370aba[_0xd234('0x66')]({'plain':!![]});fs['mkdirSync'](_0x2a84fa);var _0x4e6268={'channel':'Sms','account':_0x46b8b4[_0xd234('0x64')][_0xd234('0x1e')],'agent':_0x46b8b4[_0xd234('0x65')]?_0x46b8b4[_0xd234('0x65')][_0xd234('0x5c')]:_0xd234('0x67'),'createdAt':moment(_0x46b8b4[_0xd234('0x68')])[_0xd234('0x48')](_0xd234('0x49'))[_0xd234('0x53')](),'closedAt':_0x46b8b4['closed']?moment(_0x46b8b4[_0xd234('0x69')])[_0xd234('0x48')](_0xd234('0x49'))[_0xd234('0x53')]():'','disposition':_0x46b8b4[_0xd234('0x6a')],'messages':_(_0x46b8b4[_0xd234('0x6b')])[_0xd234('0x44')]({'secret':![]})['map'](function(_0x303bf9){return{'date':moment(_0x303bf9[_0xd234('0x68')])[_0xd234('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd234('0x53')](),'sender':_0x303bf9[_0xd234('0x60')]===_0xd234('0x6c')?_0x303bf9[_0xd234('0x5b')]?_0x303bf9[_0xd234('0x5b')]['fullname']:_0xd234('0x6d'):_0x303bf9[_0xd234('0x5d')]['firstName']+(_0x303bf9[_0xd234('0x5d')][_0xd234('0x5f')]?'\x20'+_0x303bf9[_0xd234('0x5d')][_0xd234('0x5f')]:''),'body':_0x303bf9[_0xd234('0x38')],'direction':_0x303bf9[_0xd234('0x60')]===_0xd234('0x6c')?'A':'C','secret':_0x303bf9[_0xd234('0x61')],'read':_0x303bf9[_0xd234('0x62')]};})[_0xd234('0x6e')]()};return ejs[_0xd234('0x6f')](path[_0xd234('0x54')](config['root'],_0xd234('0x56'),'views',_0xd234('0x70')),{'interaction':_0x4e6268})[_0xd234('0x1a')](function(_0x517282){var _0x1a22f4=path['join'](_0x2a84fa,_0xd234('0x71')+_0x46b8b4['id']+'-'+_0xbbf51d+_0xd234('0x72'));var _0x268e4f={'path':_0x1a22f4,'channel':_0xd234('0x73'),'interactionId':_0x46b8b4['id']};return pdf[_0xd234('0x74')](_0x517282,_0x268e4f);})[_0xd234('0x1a')](function(){return new BPromise(function(_0x438b56,_0x18a582){zipdir(_0x2a84fa,{'saveTo':_0x2aae43},function(_0x21e077,_0xad415b){if(_0x21e077)return _0x18a582(_0x21e077);return _0x438b56(_0xad415b);});})['then'](function(){return new BPromise(function(_0x25afa6,_0x5d0b9d){rimraf(_0x2a84fa,function(_0x27b9bc){if(_0x27b9bc)_0x5d0b9d(_0x27b9bc);return _0x25afa6();});});})[_0xd234('0x1a')](function(){return _0x33a9b4[_0xd234('0x52')](_0x2aae43,_0x52ba2a,function(_0x58ec22){if(_0x58ec22){console['log'](_0xd234('0x75'),_0x58ec22);}else{fs[_0xd234('0x76')](_0x2aae43);}});});});}else{return _0x33a9b4['sendStatus'](0xc8);}})[_0xd234('0x36')](handleError(_0x33a9b4,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 906adfe..ff08130 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 _0x5204=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x228dfa,_0x3632bf){var _0x5e1738=function(_0x12dbe7){while(--_0x12dbe7){_0x228dfa['push'](_0x228dfa['shift']());}};_0x5e1738(++_0x3632bf);}(_0x5204,0xdf));var _0x4520=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0x5204[_0x1de43c];return _0x296d3e;};'use strict';var EventEmitter=require(_0x4520('0x0'));var SmsInteraction=require(_0x4520('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4520('0x1'))['db'][_0x4520('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4520('0x3')](0x0);var events={'afterCreate':_0x4520('0x4'),'afterUpdate':_0x4520('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41d89c){return function(_0x58b8a8,_0x180174,_0x209381){_0x58b8a8[_0x4520('0x6')]({'attributes':['id'],'raw':!![]})[_0x4520('0x7')](function(_0x396d29){_0x58b8a8[_0x4520('0x8')](_0x4520('0x9'),_0x396d29['map'](function(_0x297f0a){return{'id':_0x297f0a['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x58b8a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4520('0x7')](function(_0x37a617){_0x58b8a8[_0x4520('0x8')](_0x4520('0xa'),_0x37a617[_0x4520('0xb')]);SmsInteractionEvents[_0x4520('0xc')](_0x41d89c+':'+_0x58b8a8['id'],_0x58b8a8);SmsInteractionEvents[_0x4520('0xc')](_0x41d89c,_0x58b8a8);_0x209381(null);})[_0x4520('0xd')](_0x209381(null));};}for(var e in events){if(events[_0x4520('0xe')](e)){var event=events[e];SmsInteraction[_0x4520('0xf')](e,emitEvent(event));}}module[_0x4520('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x5fdc=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','map'];(function(_0x1cca0d,_0x19e33c){var _0x2185b8=function(_0x147f3c){while(--_0x147f3c){_0x1cca0d['push'](_0x1cca0d['shift']());}};_0x2185b8(++_0x19e33c);}(_0x5fdc,0x127));var _0xc5fd=function(_0x278617,_0x51d07f){_0x278617=_0x278617-0x0;var _0x5384b3=_0x5fdc[_0x278617];return _0x5384b3;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var SmsInteraction=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var SmsMessage=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc5fd('0x4')](0x0);var events={'afterCreate':_0xc5fd('0x5'),'afterUpdate':_0xc5fd('0x6'),'afterDestroy':_0xc5fd('0x7')};function emitEvent(_0x1b6205){return function(_0xca27a0,_0xea5748,_0x44722b){_0xca27a0[_0xc5fd('0x8')]({'attributes':['id'],'raw':!![]})[_0xc5fd('0x9')](function(_0x5a2eb4){_0xca27a0['setDataValue']('Users',_0x5a2eb4[_0xc5fd('0xa')](function(_0x46bce3){return{'id':_0x46bce3['id']};}));return SmsMessage[_0xc5fd('0xb')]({'where':{'SmsInteractionId':_0xca27a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5fd('0x9')](function(_0x4e6d35){_0xca27a0['setDataValue'](_0xc5fd('0xc'),_0x4e6d35[_0xc5fd('0xd')]);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205+':'+_0xca27a0['id'],_0xca27a0);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205,_0xca27a0);_0x44722b(null);})[_0xc5fd('0xf')](_0x44722b(null));};}for(var e in events){if(events[_0xc5fd('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc5fd('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 85071ec..2ae1bc4 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 _0xf926=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','SmsInteraction','sms_interactions','changed','closedAt','format'];(function(_0x5a9977,_0x3d463f){var _0x5aa6f1=function(_0x5b405c){while(--_0x5b405c){_0x5a9977['push'](_0x5a9977['shift']());}};_0x5aa6f1(++_0x3d463f);}(_0xf926,0x17b));var _0x6f92=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xf926[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require(_0x6f92('0x0'));var logger=require(_0x6f92('0x1'))('api');var moment=require(_0x6f92('0x2'));var BPromise=require(_0x6f92('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f92('0x4'));var rimraf=require(_0x6f92('0x5'));var config=require(_0x6f92('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x3ab9c2,_0x4597fa){return _0x3ab9c2[_0x6f92('0x7')](_0x6f92('0x8'),attributes,{'tableName':_0x6f92('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2de591,_0x1f26bc,_0x551dc9){if(_0x2de591[_0x6f92('0xa')]('closed')){_0x2de591[_0x6f92('0xb')]=moment()[_0x6f92('0xc')](_0x6f92('0xd'));}_0x551dc9(null,_0x2de591);}}});}; \ No newline at end of file +var _0xefda=['lodash','../../config/logger','api','moment','path','rimraf','exports','define','SmsInteraction','closed','closedAt','format'];(function(_0x53cc96,_0xcada22){var _0x79eb8=function(_0x37747f){while(--_0x37747f){_0x53cc96['push'](_0x53cc96['shift']());}};_0x79eb8(++_0xcada22);}(_0xefda,0x1ec));var _0xaefd=function(_0x9d631c,_0x37f0fd){_0x9d631c=_0x9d631c-0x0;var _0xee8e8=_0xefda[_0x9d631c];return _0xee8e8;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require(_0xaefd('0x1'))(_0xaefd('0x2'));var moment=require(_0xaefd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0xaefd('0x6')]=function(_0x3a5a97,_0x2ffb64){return _0x3a5a97[_0xaefd('0x7')](_0xaefd('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x73c796,_0x1e77b7,_0x44d202){if(_0x73c796['changed'](_0xaefd('0x9'))){_0x73c796[_0xaefd('0xa')]=moment()[_0xaefd('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x44d202(null,_0x73c796);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index e95dab0..81e9a28 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 _0x7d2f=['../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsInteraction','update','body','options','raw','where','limit','UpdateSmsInteraction','stringify','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c9a74,_0x4604f5){var _0x3dc66c=function(_0x5b0170){while(--_0x5b0170){_0x2c9a74['push'](_0x2c9a74['shift']());}};_0x3dc66c(++_0x4604f5);}(_0x7d2f,0x1bc));var _0xf7d2=function(_0x33110b,_0x3e97f2){_0x33110b=_0x33110b-0x0;var _0x39a972=_0x7d2f[_0x33110b];return _0x39a972;};'use strict';var _=require(_0xf7d2('0x0'));var util=require(_0xf7d2('0x1'));var moment=require(_0xf7d2('0x2'));var BPromise=require(_0xf7d2('0x3'));var rs=require(_0xf7d2('0x4'));var fs=require('fs');var Redis=require(_0xf7d2('0x5'));var db=require(_0xf7d2('0x6'))['db'];var utils=require(_0xf7d2('0x7'));var logger=require(_0xf7d2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf7d2('0x9'));var client=jayson[_0xf7d2('0xa')]['http']({'port':0x232a});config[_0xf7d2('0xb')]=_[_0xf7d2('0xc')](config[_0xf7d2('0xb')],{'host':_0xf7d2('0xd'),'port':0x18eb});var socket=require(_0xf7d2('0xe'))(new Redis(config[_0xf7d2('0xb')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x404667,_0x5e2289,_0x5cfe24){return new BPromise(function(_0x42b87b,_0x359b72){return client[_0xf7d2('0xf')](_0x404667,_0x5cfe24)[_0xf7d2('0x10')](function(_0x7d1ebb){logger[_0xf7d2('0x11')](_0xf7d2('0x12'),_0x5e2289,_0xf7d2('0x13'));logger[_0xf7d2('0x14')](_0xf7d2('0x15'),_0x5e2289,'request\x20sent',JSON['stringify'](_0x7d1ebb));if(_0x7d1ebb[_0xf7d2('0x16')]){if(_0x7d1ebb[_0xf7d2('0x16')][_0xf7d2('0x17')]===0x1f4){logger[_0xf7d2('0x16')](_0xf7d2('0x12'),_0x5e2289,_0x7d1ebb[_0xf7d2('0x16')]['message']);return _0x359b72(_0x7d1ebb[_0xf7d2('0x16')][_0xf7d2('0x18')]);}logger[_0xf7d2('0x16')](_0xf7d2('0x12'),_0x5e2289,_0x7d1ebb[_0xf7d2('0x16')][_0xf7d2('0x18')]);return _0x42b87b(_0x7d1ebb['error'][_0xf7d2('0x18')]);}else{logger[_0xf7d2('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x5e2289,_0xf7d2('0x13'));_0x42b87b(_0x7d1ebb[_0xf7d2('0x19')][_0xf7d2('0x18')]);}})[_0xf7d2('0x1a')](function(_0x1667d8){logger[_0xf7d2('0x16')](_0xf7d2('0x12'),_0x5e2289,_0x1667d8);_0x359b72(_0x1667d8);});});}exports['UpdateSmsInteraction']=function(_0x515f20){var _0x24cb44=this;return new Promise(function(_0x3a5053,_0x83a849){return db[_0xf7d2('0x1b')][_0xf7d2('0x1c')](_0x515f20[_0xf7d2('0x1d')],{'raw':_0x515f20['options']?_0x515f20[_0xf7d2('0x1e')][_0xf7d2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x515f20[_0xf7d2('0x1e')]?_0x515f20[_0xf7d2('0x1e')][_0xf7d2('0x20')]||null:null,'attributes':_0x515f20[_0xf7d2('0x1e')]?_0x515f20[_0xf7d2('0x1e')]['attributes']||null:null,'limit':_0x515f20[_0xf7d2('0x1e')]?_0x515f20['options'][_0xf7d2('0x21')]||null:null})[_0xf7d2('0x10')](function(_0x100471){logger[_0xf7d2('0x11')](_0xf7d2('0x22'),_0x515f20);logger[_0xf7d2('0x14')](_0xf7d2('0x22'),_0x515f20,JSON[_0xf7d2('0x23')](_0x100471));_0x3a5053(_0x100471);})[_0xf7d2('0x1a')](function(_0x38592c){logger[_0xf7d2('0x16')](_0xf7d2('0x22'),_0x38592c['message'],_0x515f20);_0x83a849(_0x24cb44[_0xf7d2('0x16')](0x1f4,_0x38592c[_0xf7d2('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x1c18d1){return new Promise(function(_0xdd5805,_0x2633d3){return db[_0xf7d2('0x1b')][_0xf7d2('0x24')]({'where':_0x1c18d1[_0xf7d2('0x1e')]?_0x1c18d1[_0xf7d2('0x1e')][_0xf7d2('0x20')]||null:null})['then'](function(_0x1c73af){if(_0x1c73af){return _0x1c73af[_0xf7d2('0x25')](_0x1c18d1['body'][_0xf7d2('0x26')],_['omit'](_0x1c18d1[_0xf7d2('0x1d')],[_0xf7d2('0x26'),'id'])||{});}})[_0xf7d2('0x27')](function(_0x48326c){logger['info'](_0xf7d2('0x28'),_0x1c18d1);logger['debug'](_0xf7d2('0x28'),_0x1c18d1,JSON[_0xf7d2('0x23')](_0x48326c));_0xdd5805(_0x48326c);})[_0xf7d2('0x1a')](function(_0x2893ba){logger[_0xf7d2('0x16')](_0xf7d2('0x28'),_0x2893ba['message'],_0x1c18d1);_0x2633d3(_this[_0xf7d2('0x16')](0x1f4,_0x2893ba[_0xf7d2('0x18')]));});});}; \ No newline at end of file +var _0x1d16=['attributes','limit','AddTagsToSmsInteraction','find','where','addTags','ids','omit','spread','AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw'];(function(_0x574162,_0x2425ea){var _0x39c245=function(_0x46653f){while(--_0x46653f){_0x574162['push'](_0x574162['shift']());}};_0x39c245(++_0x2425ea);}(_0x1d16,0x10c));var _0x61d1=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x1d16[_0x175e89];return _0x2ed996;};'use strict';var _=require('lodash');var util=require(_0x61d1('0x0'));var moment=require('moment');var BPromise=require(_0x61d1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61d1('0x2'));var db=require(_0x61d1('0x3'))['db'];var utils=require(_0x61d1('0x4'));var logger=require(_0x61d1('0x5'))(_0x61d1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x61d1('0x7')][_0x61d1('0x8')]({'port':0x232a});config[_0x61d1('0x9')]=_[_0x61d1('0xa')](config['redis'],{'host':_0x61d1('0xb'),'port':0x18eb});var socket=require(_0x61d1('0xc'))(new Redis(config[_0x61d1('0x9')]));require(_0x61d1('0xd'))[_0x61d1('0xe')](socket);function respondWithRpcPromise(_0x3823ab,_0x461b66,_0x18fb55){return new BPromise(function(_0x4f986c,_0x5d6701){return client[_0x61d1('0xf')](_0x3823ab,_0x18fb55)[_0x61d1('0x10')](function(_0x4e780c){logger[_0x61d1('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x461b66,'request\x20sent');logger[_0x61d1('0x12')](_0x61d1('0x13'),_0x461b66,'request\x20sent',JSON[_0x61d1('0x14')](_0x4e780c));if(_0x4e780c[_0x61d1('0x15')]){if(_0x4e780c[_0x61d1('0x15')][_0x61d1('0x16')]===0x1f4){logger[_0x61d1('0x15')](_0x61d1('0x17'),_0x461b66,_0x4e780c['error']['message']);return _0x5d6701(_0x4e780c[_0x61d1('0x15')][_0x61d1('0x18')]);}logger[_0x61d1('0x15')](_0x61d1('0x17'),_0x461b66,_0x4e780c[_0x61d1('0x15')][_0x61d1('0x18')]);return _0x4f986c(_0x4e780c[_0x61d1('0x15')][_0x61d1('0x18')]);}else{logger[_0x61d1('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x461b66,'request\x20sent');_0x4f986c(_0x4e780c[_0x61d1('0x19')]['message']);}})[_0x61d1('0x1a')](function(_0x4d03fe){logger[_0x61d1('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x461b66,_0x4d03fe);_0x5d6701(_0x4d03fe);});});}exports[_0x61d1('0x1b')]=function(_0x495c02){var _0x2fefbd=this;return new Promise(function(_0x550397,_0x2d8c34){return db[_0x61d1('0x1c')][_0x61d1('0x1d')](_0x495c02[_0x61d1('0x1e')],{'raw':_0x495c02[_0x61d1('0x1f')]?_0x495c02[_0x61d1('0x1f')][_0x61d1('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495c02[_0x61d1('0x1f')]?_0x495c02[_0x61d1('0x1f')]['where']||null:null,'attributes':_0x495c02[_0x61d1('0x1f')]?_0x495c02[_0x61d1('0x1f')][_0x61d1('0x21')]||null:null,'limit':_0x495c02[_0x61d1('0x1f')]?_0x495c02[_0x61d1('0x1f')][_0x61d1('0x22')]||null:null})[_0x61d1('0x10')](function(_0x30edf4){logger[_0x61d1('0x11')](_0x61d1('0x1b'),_0x495c02);logger[_0x61d1('0x12')](_0x61d1('0x1b'),_0x495c02,JSON[_0x61d1('0x14')](_0x30edf4));_0x550397(_0x30edf4);})[_0x61d1('0x1a')](function(_0x4ba3a9){logger['error'](_0x61d1('0x1b'),_0x4ba3a9['message'],_0x495c02);_0x2d8c34(_0x2fefbd[_0x61d1('0x15')](0x1f4,_0x4ba3a9[_0x61d1('0x18')]));});});};exports[_0x61d1('0x23')]=function(_0x1cacec){return new Promise(function(_0x14a047,_0x114a9f){return db[_0x61d1('0x1c')][_0x61d1('0x24')]({'where':_0x1cacec[_0x61d1('0x1f')]?_0x1cacec[_0x61d1('0x1f')][_0x61d1('0x25')]||null:null})['then'](function(_0x4d26b3){if(_0x4d26b3){return _0x4d26b3[_0x61d1('0x26')](_0x1cacec['body'][_0x61d1('0x27')],_[_0x61d1('0x28')](_0x1cacec[_0x61d1('0x1e')],[_0x61d1('0x27'),'id'])||{});}})[_0x61d1('0x29')](function(_0x5250cd){logger['info'](_0x61d1('0x2a'),_0x1cacec);logger[_0x61d1('0x12')](_0x61d1('0x2a'),_0x1cacec,JSON[_0x61d1('0x14')](_0x5250cd));_0x14a047(_0x5250cd);})[_0x61d1('0x1a')](function(_0x6a0f3f){logger[_0x61d1('0x15')](_0x61d1('0x2a'),_0x6a0f3f[_0x61d1('0x18')],_0x1cacec);_0x114a9f(_this[_0x61d1('0x15')](0x1f4,_0x6a0f3f[_0x61d1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e1f5b69..c3268c2 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 _0xf0b2=['length','smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x517772,_0x1dd510){var _0x5ad5d0=function(_0xd557d1){while(--_0xd557d1){_0x517772['push'](_0x517772['shift']());}};_0x5ad5d0(++_0x1dd510);}(_0xf0b2,0x89));var _0x2f0b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xf0b2[_0xc6be3a];return _0x56a310;};'use strict';var SmsInteractionEvents=require(_0x2f0b('0x0'));var events=[_0x2f0b('0x1'),_0x2f0b('0x2'),_0x2f0b('0x3')];function createListener(_0x1ee7ba,_0x5baf1a){return function(_0x40ee10){_0x5baf1a[_0x2f0b('0x4')](_0x1ee7ba,_0x40ee10);};}function removeListener(_0x56e234,_0x418d2d){return function(){SmsInteractionEvents[_0x2f0b('0x5')](_0x56e234,_0x418d2d);};}exports[_0x2f0b('0x6')]=function(_0x5e4fe2){for(var _0x32b7ad=0x0,_0x299867=events[_0x2f0b('0x7')];_0x32b7ad<_0x299867;_0x32b7ad++){var _0x22e536=events[_0x32b7ad];var _0xdfc2fb=createListener(_0x2f0b('0x8')+_0x22e536,_0x5e4fe2);SmsInteractionEvents['on'](_0x22e536,_0xdfc2fb);}}; \ No newline at end of file +var _0x1607=['length','smsInteraction:','save','remove','emit','removeListener'];(function(_0x5720da,_0x446144){var _0x556b5c=function(_0x2fbd42){while(--_0x2fbd42){_0x5720da['push'](_0x5720da['shift']());}};_0x556b5c(++_0x446144);}(_0x1607,0x176));var _0x7160=function(_0x210c11,_0x42c127){_0x210c11=_0x210c11-0x0;var _0x520a62=_0x1607[_0x210c11];return _0x520a62;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x7160('0x0'),_0x7160('0x1'),'update'];function createListener(_0x5db28c,_0x33ec23){return function(_0x512805){_0x33ec23[_0x7160('0x2')](_0x5db28c,_0x512805);};}function removeListener(_0x3ac0cf,_0x3ddd27){return function(){SmsInteractionEvents[_0x7160('0x3')](_0x3ac0cf,_0x3ddd27);};}exports['register']=function(_0x4b28e0){for(var _0x53f68f=0x0,_0x3d72ae=events[_0x7160('0x4')];_0x53f68f<_0x3d72ae;_0x53f68f++){var _0x480052=events[_0x53f68f];var _0x275bd6=createListener(_0x7160('0x5')+_0x480052,_0x4b28e0);SmsInteractionEvents['on'](_0x480052,_0x275bd6);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 43f5239..c36d9f1 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 _0xb5a4=['index','/describe','describe','/:id','show','post','tracked','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated'];(function(_0x20bffa,_0x32e064){var _0x4858d4=function(_0x5a2904){while(--_0x5a2904){_0x20bffa['push'](_0x20bffa['shift']());}};_0x4858d4(++_0x32e064);}(_0xb5a4,0x17d));var _0x4b5a=function(_0x3b0299,_0x429ae5){_0x3b0299=_0x3b0299-0x0;var _0x4deaeb=_0xb5a4[_0x3b0299];return _0x4deaeb;};'use strict';var multer=require('multer');var util=require(_0x4b5a('0x0'));var path=require(_0x4b5a('0x1'));var timeout=require(_0x4b5a('0x2'));var express=require('express');var router=express[_0x4b5a('0x3')]();var fs_extra=require(_0x4b5a('0x4'));var auth=require(_0x4b5a('0x5'));var interaction=require(_0x4b5a('0x6'));var config=require(_0x4b5a('0x7'));var controller=require(_0x4b5a('0x8'));router[_0x4b5a('0x9')]('/',auth[_0x4b5a('0xa')](),controller[_0x4b5a('0xb')]);router['get'](_0x4b5a('0xc'),auth[_0x4b5a('0xa')](),controller[_0x4b5a('0xd')]);router[_0x4b5a('0x9')](_0x4b5a('0xe'),auth[_0x4b5a('0xa')](),controller[_0x4b5a('0xf')]);router[_0x4b5a('0x10')]('/',auth['isAuthenticated'](),interaction[_0x4b5a('0x11')]('sms','smsmessage:create'),controller[_0x4b5a('0x12')]);router['post'](_0x4b5a('0x13'),controller[_0x4b5a('0x14')]);router[_0x4b5a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x4b5a('0x16')]);router[_0x4b5a('0x15')](_0x4b5a('0x17'),auth[_0x4b5a('0xa')](),controller[_0x4b5a('0x18')]);router[_0x4b5a('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0x4b5a('0x19')]);router[_0x4b5a('0x1a')](_0x4b5a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4b5a('0x1b')]=router; \ No newline at end of file +var _0x08bd=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','post','tracked','sms','create','/:id/status','put','/:id','update','/:id/accept','accept','reject','destroy','multer','util','path','connect-timeout','express'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0x08bd,0xd3));var _0xd08b=function(_0x30de89,_0xf1be1){_0x30de89=_0x30de89-0x0;var _0x1f2cd5=_0x08bd[_0x30de89];return _0x1f2cd5;};'use strict';var multer=require(_0xd08b('0x0'));var util=require(_0xd08b('0x1'));var path=require(_0xd08b('0x2'));var timeout=require(_0xd08b('0x3'));var express=require(_0xd08b('0x4'));var router=express['Router']();var fs_extra=require(_0xd08b('0x5'));var auth=require(_0xd08b('0x6'));var interaction=require(_0xd08b('0x7'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0xd08b('0x8')]('/',auth[_0xd08b('0x9')](),controller['index']);router[_0xd08b('0x8')](_0xd08b('0xa'),auth[_0xd08b('0x9')](),controller[_0xd08b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd08b('0xc')]('/',auth[_0xd08b('0x9')](),interaction[_0xd08b('0xd')](_0xd08b('0xe'),'smsmessage:create'),controller[_0xd08b('0xf')]);router[_0xd08b('0xc')](_0xd08b('0x10'),controller['status']);router[_0xd08b('0x11')](_0xd08b('0x12'),auth[_0xd08b('0x9')](),controller[_0xd08b('0x13')]);router[_0xd08b('0x11')](_0xd08b('0x14'),auth['isAuthenticated'](),controller[_0xd08b('0x15')]);router[_0xd08b('0x11')]('/:id/reject',auth[_0xd08b('0x9')](),controller[_0xd08b('0x16')]);router['delete'](_0xd08b('0x12'),auth[_0xd08b('0x9')](),controller[_0xd08b('0x17')]);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 557618f..aab392e 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 _0x61bb=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61bb,0xa1));var _0xb61b=function(_0x21769a,_0x285d33){_0x21769a=_0x21769a-0x0;var _0x685202=_0x61bb[_0x21769a];return _0x685202;};'use strict';var Sequelize=require('sequelize');module[_0xb61b('0x0')]={'body':{'type':Sequelize[_0xb61b('0x1')](_0xb61b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb61b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb61b('0x4')]('in',_0xb61b('0x5')),'defaultValue':_0xb61b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb61b('0x6')](0xbe)},'phone':{'type':Sequelize[_0xb61b('0x6')]},'readAt':{'type':Sequelize[_0xb61b('0x7')]},'secret':{'type':Sequelize[_0xb61b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb61b('0x6')]},'providerResponse':{'type':Sequelize[_0xb61b('0x1')]}}; \ No newline at end of file +var _0x22c0=['out','DATE','STRING','TEXT','sequelize','exports','BOOLEAN','ENUM'];(function(_0x17da78,_0x3b3502){var _0x5ada33=function(_0x2c29ba){while(--_0x2c29ba){_0x17da78['push'](_0x17da78['shift']());}};_0x5ada33(++_0x3b3502);}(_0x22c0,0x1c4));var _0x022c=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x22c0[_0x46a3ff];return _0x404bc2;};'use strict';var Sequelize=require(_0x022c('0x0'));module[_0x022c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x022c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x022c('0x3')]('in',_0x022c('0x4')),'defaultValue':_0x022c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x022c('0x5')]},'secret':{'type':Sequelize[_0x022c('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x022c('0x6')]},'providerResponse':{'type':Sequelize[_0x022c('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 96a681e..0812bd1 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 _0xe61c=['limit','count','Content-Range','reject','save','update','destroy','sendStatus','stack','send','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SmsMessage','includeAll','include','findAll','rows','params','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','Sequelize','email','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','twilio','MessageUUID','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0xe61c,0xee));var _0xce61=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0xe61c[_0x3e182f];return _0x23edc9;};'use strict';var emlformat=require(_0xce61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce61('0x1'));var jsonpatch=require(_0xce61('0x2'));var rp=require(_0xce61('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xce61('0x4'));var util=require('util');var path=require(_0xce61('0x5'));var sox=require(_0xce61('0x6'));var csv=require(_0xce61('0x7'));var ejs=require(_0xce61('0x8'));var fs=require('fs');var fs_extra=require(_0xce61('0x9'));var _=require(_0xce61('0xa'));var squel=require(_0xce61('0xb'));var crypto=require('crypto');var jsforce=require(_0xce61('0xc'));var deskjs=require(_0xce61('0xd'));var toCsv=require(_0xce61('0x7'));var querystring=require(_0xce61('0xe'));var Papa=require(_0xce61('0xf'));var Redis=require(_0xce61('0x10'));var authService=require(_0xce61('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce61('0x12'));var hardwareService=require(_0xce61('0x13'));var logger=require('../../config/logger')(_0xce61('0x14'));var utils=require(_0xce61('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xce61('0x16'));var db=require('../../mysqldb')['db'];config[_0xce61('0x17')]=_[_0xce61('0x18')](config['redis'],{'host':_0xce61('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce61('0x17')]));require('./smsMessage.socket')[_0xce61('0x1a')](socket);var jayson=require(_0xce61('0x1b'));var client=jayson[_0xce61('0x1c')][_0xce61('0x1d')]({'port':0x232c});var client9002=jayson[_0xce61('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4feb11,_0x330cae,_0x5a1398,_0x590cb3){return new BPromise(function(_0x1977f6,_0x15151b){var _0x1a0553=_0x590cb3||client;return _0x1a0553['request'](_0x4feb11,_0x5a1398)[_0xce61('0x1e')](function(_0x4baf32){logger[_0xce61('0x1f')](_0xce61('0x20'),_0x330cae,_0xce61('0x21'));logger[_0xce61('0x22')](_0xce61('0x23'),_0x330cae,_0xce61('0x21'),JSON[_0xce61('0x24')](_0x4baf32));if(_0x4baf32[_0xce61('0x25')]){if(_0x4baf32['error']['code']===0x1f4){logger[_0xce61('0x25')]('SmsMessage,\x20%s,\x20%s',_0x330cae,_0x4baf32[_0xce61('0x25')][_0xce61('0x26')]);return _0x15151b(_0x4baf32[_0xce61('0x25')][_0xce61('0x26')]);}logger[_0xce61('0x25')](_0xce61('0x20'),_0x330cae,_0x4baf32[_0xce61('0x25')][_0xce61('0x26')]);return _0x1977f6(_0x4baf32['error']['message']);}else{logger[_0xce61('0x1f')](_0xce61('0x20'),_0x330cae,_0xce61('0x21'));_0x1977f6(_0x4baf32[_0xce61('0x27')][_0xce61('0x26')]);}})[_0xce61('0x28')](function(_0x471a08){logger[_0xce61('0x25')](_0xce61('0x20'),_0x330cae,_0x471a08);_0x15151b(_0x471a08);});});}function respondWithStatusCode(_0x2758e4,_0x54b4e5){_0x54b4e5=_0x54b4e5||0xcc;return function(_0x2a1185){if(_0x2a1185){return _0x2758e4['sendStatus'](_0x54b4e5);}return _0x2758e4[_0xce61('0x29')](_0x54b4e5)[_0xce61('0x2a')]();};}function respondWithResult(_0x894785,_0x23c30d){_0x23c30d=_0x23c30d||0xc8;return function(_0x13407f){if(_0x13407f){return _0x894785['status'](_0x23c30d)[_0xce61('0x2b')](_0x13407f);}};}function respondWithFilteredResult(_0x344d20,_0x51af87){return function(_0x4e9020){if(_0x4e9020){var _0x5cb588=typeof _0x51af87[_0xce61('0x2c')]===_0xce61('0x2d')&&typeof _0x51af87[_0xce61('0x2e')]===_0xce61('0x2d');var _0x2a882d=_0x4e9020['count'];var _0x74f1bc=_0x5cb588?0x0:_0x51af87[_0xce61('0x2c')];var _0x4f73cb=_0x5cb588?_0x4e9020[_0xce61('0x2f')]:_0x51af87[_0xce61('0x2c')]+_0x51af87['limit'];var _0xcface1;if(_0x4f73cb>=_0x2a882d){_0x4f73cb=_0x2a882d;_0xcface1=0xc8;}else{_0xcface1=0xce;}_0x344d20[_0xce61('0x29')](_0xcface1);return _0x344d20['set'](_0xce61('0x30'),_0x74f1bc+'-'+_0x4f73cb+'/'+_0x2a882d)['json'](_0x4e9020);}return null;};}function patchUpdates(_0x303295){return function(_0x5d206e){try{jsonpatch['apply'](_0x5d206e,_0x303295,!![]);}catch(_0x4f3ca2){return BPromise[_0xce61('0x31')](_0x4f3ca2);}return _0x5d206e[_0xce61('0x32')]();};}function saveUpdates(_0x337011,_0x24beaf){return function(_0x30f81c){if(_0x30f81c){return _0x30f81c[_0xce61('0x33')](_0x337011)[_0xce61('0x1e')](function(_0xc4a23e){return _0xc4a23e;});}return null;};}function removeEntity(_0xad0c75,_0x46281e){return function(_0x11708c){if(_0x11708c){return _0x11708c[_0xce61('0x34')]()[_0xce61('0x1e')](function(){_0xad0c75[_0xce61('0x29')](0xcc)[_0xce61('0x2a')]();});}};}function handleEntityNotFound(_0xa8705b,_0x591e9b){return function(_0x18367a){if(!_0x18367a){_0xa8705b[_0xce61('0x35')](0x194);}return _0x18367a;};}function handleError(_0x251f9b,_0x5f0e13){_0x5f0e13=_0x5f0e13||0x1f4;return function(_0x16fef7){logger[_0xce61('0x25')](_0x16fef7[_0xce61('0x36')]);if(_0x16fef7['name']){delete _0x16fef7['name'];}_0x251f9b['status'](_0x5f0e13)[_0xce61('0x37')](_0x16fef7);};}exports[_0xce61('0x38')]=function(_0x1b8c66,_0xd20e10){var _0xfe5b4c={},_0x23632a={},_0x3179e4={'count':0x0,'rows':[]};var _0x14fe23=_[_0xce61('0x39')](db['SmsMessage']['rawAttributes'],function(_0x17feb8){return{'name':_0x17feb8[_0xce61('0x3a')],'type':_0x17feb8[_0xce61('0x3b')][_0xce61('0x3c')]};});_0x23632a[_0xce61('0x3d')]=_['map'](_0x14fe23,_0xce61('0x3e'));_0x23632a[_0xce61('0x3f')]=_[_0xce61('0x40')](_0x1b8c66[_0xce61('0x3f')]);_0x23632a[_0xce61('0x41')]=_[_0xce61('0x42')](_0x23632a['model'],_0x23632a[_0xce61('0x3f')]);_0xfe5b4c[_0xce61('0x43')]=_['intersection'](_0x23632a['model'],qs[_0xce61('0x44')](_0x1b8c66[_0xce61('0x3f')][_0xce61('0x44')]));_0xfe5b4c[_0xce61('0x43')]=_0xfe5b4c[_0xce61('0x43')]['length']?_0xfe5b4c[_0xce61('0x43')]:_0x23632a['model'];if(!_0x1b8c66[_0xce61('0x3f')][_0xce61('0x45')](_0xce61('0x46'))){_0xfe5b4c[_0xce61('0x2e')]=qs['limit'](_0x1b8c66['query']['limit']);_0xfe5b4c[_0xce61('0x2c')]=qs['offset'](_0x1b8c66[_0xce61('0x3f')][_0xce61('0x2c')]);}_0xfe5b4c['order']=qs[_0xce61('0x47')](_0x1b8c66[_0xce61('0x3f')]['sort']);_0xfe5b4c[_0xce61('0x48')]=qs[_0xce61('0x41')](_[_0xce61('0x49')](_0x1b8c66[_0xce61('0x3f')],_0x23632a['filters']),_0x14fe23);if(_0x1b8c66[_0xce61('0x3f')][_0xce61('0x4a')]){_0xfe5b4c[_0xce61('0x48')]=_['merge'](_0xfe5b4c[_0xce61('0x48')],{'$or':_['map'](_0x14fe23,function(_0x252e7b){if(_0x252e7b[_0xce61('0x3b')]!==_0xce61('0x4b')){var _0x25e088={};_0x25e088[_0x252e7b[_0xce61('0x3e')]]={'$like':'%'+_0x1b8c66['query'][_0xce61('0x4a')]+'%'};return _0x25e088;}})});}_0xfe5b4c=_[_0xce61('0x4c')]({},_0xfe5b4c,_0x1b8c66[_0xce61('0x4d')]);var _0x4f8e3d={'where':_0xfe5b4c['where']};return db[_0xce61('0x4e')][_0xce61('0x2f')](_0x4f8e3d)[_0xce61('0x1e')](function(_0x4d320e){_0x3179e4[_0xce61('0x2f')]=_0x4d320e;if(_0x1b8c66[_0xce61('0x3f')][_0xce61('0x4f')]){_0xfe5b4c[_0xce61('0x50')]=[{'all':!![]}];}return db[_0xce61('0x4e')][_0xce61('0x51')](_0xfe5b4c);})[_0xce61('0x1e')](function(_0x104236){_0x3179e4[_0xce61('0x52')]=_0x104236;return _0x3179e4;})[_0xce61('0x1e')](respondWithFilteredResult(_0xd20e10,_0xfe5b4c))['catch'](handleError(_0xd20e10,null));};exports['show']=function(_0x5b2839,_0x23794c){var _0x28727a={'raw':!![],'where':{'id':_0x5b2839[_0xce61('0x53')]['id']}},_0x1a5af2={};_0x1a5af2[_0xce61('0x3d')]=_[_0xce61('0x40')](db[_0xce61('0x4e')]['rawAttributes']);_0x1a5af2[_0xce61('0x3f')]=_[_0xce61('0x40')](_0x5b2839[_0xce61('0x3f')]);_0x1a5af2['filters']=_['intersection'](_0x1a5af2['model'],_0x1a5af2[_0xce61('0x3f')]);_0x28727a[_0xce61('0x43')]=_['intersection'](_0x1a5af2['model'],qs[_0xce61('0x44')](_0x5b2839[_0xce61('0x3f')][_0xce61('0x44')]));_0x28727a['attributes']=_0x28727a[_0xce61('0x43')]['length']?_0x28727a[_0xce61('0x43')]:_0x1a5af2[_0xce61('0x3d')];if(_0x5b2839[_0xce61('0x3f')]['includeAll']){_0x28727a[_0xce61('0x50')]=[{'all':!![]}];}_0x28727a=_[_0xce61('0x4c')]({},_0x28727a,_0x5b2839[_0xce61('0x4d')]);return db[_0xce61('0x4e')][_0xce61('0x54')](_0x28727a)[_0xce61('0x1e')](handleEntityNotFound(_0x23794c,null))[_0xce61('0x1e')](respondWithResult(_0x23794c,null))[_0xce61('0x28')](handleError(_0x23794c,null));};exports[_0xce61('0x55')]=function(_0x3796a6,_0x5e79a2){return db[_0xce61('0x4e')][_0xce61('0x55')](_0x3796a6[_0xce61('0x56')],{})[_0xce61('0x1e')](respondWithResult(_0x5e79a2,0xc9))[_0xce61('0x28')](handleError(_0x5e79a2,null));};exports[_0xce61('0x33')]=function(_0x10aa11,_0x539e11){if(_0x10aa11[_0xce61('0x56')]['id']){delete _0x10aa11['body']['id'];}return db[_0xce61('0x4e')]['find']({'where':{'id':_0x10aa11[_0xce61('0x53')]['id']}})[_0xce61('0x1e')](handleEntityNotFound(_0x539e11,null))[_0xce61('0x1e')](saveUpdates(_0x10aa11[_0xce61('0x56')],null))[_0xce61('0x1e')](respondWithResult(_0x539e11,null))['catch'](handleError(_0x539e11,null));};exports[_0xce61('0x34')]=function(_0x5127c7,_0x356b63){return db[_0xce61('0x4e')][_0xce61('0x54')]({'where':{'id':_0x5127c7[_0xce61('0x53')]['id']}})['then'](handleEntityNotFound(_0x356b63,null))[_0xce61('0x1e')](removeEntity(_0x356b63,null))[_0xce61('0x28')](handleError(_0x356b63,null));};exports[_0xce61('0x57')]=function(_0x12392b,_0xe78ec6){return db[_0xce61('0x4e')][_0xce61('0x57')]()[_0xce61('0x1e')](respondWithResult(_0xe78ec6,null))['catch'](handleError(_0xe78ec6,null));};var interaction_log=require(_0xce61('0x58'))(_0xce61('0x59'));exports[_0xce61('0x5a')]=function(_0x20ce9c,_0x5dc275,_0x1d71c8){var _0x5a7815={'agent':{},'channel':_0xce61('0x5b')};if(_0x20ce9c[_0xce61('0x56')]['id']){delete _0x20ce9c[_0xce61('0x56')]['id'];}_0x20ce9c[_0xce61('0x56')][_0xce61('0x5c')]=!![];_0x20ce9c[_0xce61('0x56')][_0xce61('0x5d')]=moment()[_0xce61('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x20ce9c[_0xce61('0x56')][_0xce61('0x5f')]=_0x20ce9c['body'][_0xce61('0x5f')]||_0x20ce9c[_0xce61('0x60')]['id'];_0x5a7815[_0xce61('0x61')]['id']=_0x20ce9c[_0xce61('0x56')][_0xce61('0x5f')];return db[_0xce61('0x4e')][_0xce61('0x54')]({'where':{'id':_0x20ce9c[_0xce61('0x53')]['id'],'UserId':null}})[_0xce61('0x1e')](handleEntityNotFound(_0x5dc275,null))[_0xce61('0x1e')](saveUpdates(_0x20ce9c[_0xce61('0x56')],null))[_0xce61('0x1e')](function(_0x58ab44){if(_0x58ab44){_0x5a7815[_0xce61('0x26')]=_0x58ab44[_0xce61('0x62')]({'plain':!![]});return db[_0xce61('0x63')][_0xce61('0x54')]({'where':{'id':_0x58ab44[_0xce61('0x64')]}});}return null;})[_0xce61('0x1e')](handleEntityNotFound(_0x5dc275,null))[_0xce61('0x1e')](function(_0xc7945b){if(_0xc7945b){return _0xc7945b['update']({'UserId':_0x20ce9c[_0xce61('0x56')][_0xce61('0x5f')],'read1stAt':_[_0xce61('0x65')](_0xc7945b[_0xce61('0x66')])?moment()[_0xce61('0x5e')](_0xce61('0x67')):undefined});}return null;})['then'](function(_0x263153){if(_0x263153){_0x5a7815[_0xce61('0x68')]=_0x263153[_0xce61('0x62')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x20ce9c[_0xce61('0x60')]['id'],_0x20ce9c[_0xce61('0x60')][_0xce61('0x3e')],_0x20ce9c[_0xce61('0x60')][_0xce61('0x69')],_0x5a7815[_0xce61('0x68')]['id'],_0x20ce9c['body']?JSON[_0xce61('0x24')](_0x20ce9c[_0xce61('0x56')]):_0xce61('0x6a'));return respondWithRpcPromise(_0xce61('0x6b'),'acceptMessage',_0x5a7815);}return null;})[_0xce61('0x1e')](function(_0x92e776){var _0x47cec5=_0xce61('0x6c')+_0x92e776['message']['ContactId'];return db[_0xce61('0x6d')][_0xce61('0x3f')](_0x47cec5,{'type':db['Sequelize'][_0xce61('0x6e')][_0xce61('0x6f')],'raw':!![]})['then'](function(_0x14c5f2){return _0x14c5f2;});})[_0xce61('0x1e')](function(_0x5bf9b2){if(_0x5bf9b2){_0x5a7815['message']['contact']=_0x5bf9b2[0x0];if(!_0x20ce9c['body'][_0xce61('0x5f')])return;return db[_0xce61('0x70')][_0xce61('0x54')]({'where':{'id':_0x20ce9c[_0xce61('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0xce61('0x3e'),_0xce61('0x71'),'email',_0xce61('0x72')],'raw':!![]});}return null;})[_0xce61('0x1e')](function(_0x2a8dd9){if(!_0x2a8dd9)return null;_0x5a7815[_0xce61('0x26')][_0xce61('0x61')]=_0x2a8dd9;return _0x5a7815;})[_0xce61('0x1e')](function(_0x39d81f){if(_0x39d81f){if(_0x20ce9c[_0xce61('0x56')][_0xce61('0x73')]){_0x5a7815['message'][_0xce61('0x74')]=util[_0xce61('0x5e')](_0xce61('0x75'),_0x20ce9c[_0xce61('0x60')][_0xce61('0x3e')]);_0x5a7815[_0xce61('0x26')][_0xce61('0x76')]=_0x5a7815[_0xce61('0x76')];_0x5a7815[_0xce61('0x26')][_0xce61('0x77')]=_0x5a7815['channel'];_0x5a7815[_0xce61('0x26')][_0xce61('0x78')]='accept';return respondWithRpcPromise(_0xce61('0x79'),_0xce61('0x79'),{'event':_0xce61('0x7a'),'message':_0x5a7815[_0xce61('0x26')]},client9002)[_0xce61('0x1e')](function(){return _0x5a7815;});}return _0x5a7815;}return null;})['then'](respondWithResult(_0x5dc275,null))[_0xce61('0x28')](handleError(_0x5dc275,null));};var interaction_log=require(_0xce61('0x58'))(_0xce61('0x59'));exports['reject']=function(_0x447f1a,_0x23642d,_0x159147){var _0x206e19={'agent':{},'channel':'sms'};if(_0x447f1a[_0xce61('0x56')]['id']){delete _0x447f1a[_0xce61('0x56')]['id'];}_0x447f1a[_0xce61('0x56')][_0xce61('0x5f')]=_0x447f1a[_0xce61('0x56')][_0xce61('0x5f')]||_0x447f1a[_0xce61('0x60')]['id'];_0x206e19[_0xce61('0x61')]['id']=_0x447f1a['body'][_0xce61('0x5f')];return db[_0xce61('0x4e')][_0xce61('0x54')]({'where':{'id':_0x447f1a['params']['id'],'UserId':null}})[_0xce61('0x1e')](handleEntityNotFound(_0x23642d,null))[_0xce61('0x1e')](function(_0x3f1d58){if(_0x3f1d58){_0x206e19[_0xce61('0x26')]=_0x3f1d58['get']({'plain':!![]});return db[_0xce61('0x63')]['find']({'where':{'id':_0x3f1d58[_0xce61('0x64')]}});}return null;})[_0xce61('0x1e')](handleEntityNotFound(_0x23642d,null))[_0xce61('0x1e')](function(_0x26f0ef){if(_0x26f0ef){_0x206e19[_0xce61('0x68')]=_0x26f0ef[_0xce61('0x62')]({'plain':!![]});interaction_log['info'](_0xce61('0x7b'),_0x447f1a[_0xce61('0x60')]['id'],_0x447f1a['user']['name'],_0x447f1a[_0xce61('0x60')][_0xce61('0x69')],_0x206e19[_0xce61('0x68')]['id'],_0x447f1a[_0xce61('0x56')]?JSON[_0xce61('0x24')](_0x447f1a['body']):_0xce61('0x6a'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x206e19);}return null;})['then'](function(_0x56892c){var _0x4a31cd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x56892c[_0xce61('0x26')][_0xce61('0x7c')];return db['sequelize'][_0xce61('0x3f')](_0x4a31cd,{'type':db[_0xce61('0x7d')][_0xce61('0x6e')][_0xce61('0x6f')],'raw':!![]})[_0xce61('0x1e')](function(_0x33c080){return _0x33c080;});})[_0xce61('0x1e')](function(_0x5cd4b9){if(_0x5cd4b9){_0x206e19[_0xce61('0x26')]['contact']=_0x5cd4b9[0x0];if(!_0x447f1a[_0xce61('0x56')][_0xce61('0x5f')])return;return db[_0xce61('0x70')][_0xce61('0x54')]({'where':{'id':_0x447f1a[_0xce61('0x56')]['UserId'],'role':_0xce61('0x61')},'attributes':['id','name',_0xce61('0x71'),_0xce61('0x7e'),'internal'],'raw':!![]});}return null;})[_0xce61('0x1e')](function(_0x43956b){if(!_0x43956b)return null;_0x206e19[_0xce61('0x26')][_0xce61('0x61')]=_0x43956b;return _0x206e19;})[_0xce61('0x1e')](function(_0x3fa18d){if(_0x3fa18d){_0x3fa18d[_0xce61('0x26')]['interface']=util[_0xce61('0x5e')](_0xce61('0x75'),_0x447f1a['user'][_0xce61('0x3e')]);_0x3fa18d['message'][_0xce61('0x76')]=_0x206e19[_0xce61('0x76')];_0x3fa18d[_0xce61('0x26')]['motionChannel']=_0x206e19['channel'];_0x3fa18d[_0xce61('0x26')]['event']=_0xce61('0x31');respondWithRpcPromise(_0xce61('0x79'),_0xce61('0x79'),{'event':'rejectmessage','message':_0x3fa18d[_0xce61('0x26')]},client9002);return _0x206e19;}return null;})['then'](respondWithResult(_0x23642d,null))['catch'](handleError(_0x23642d,null));};exports[_0xce61('0x29')]=function(_0x3e30cc,_0x56f463,_0xd0723b){if(_0x3e30cc[_0xce61('0x56')]['id']){delete _0x3e30cc[_0xce61('0x56')]['id'];}var _0x2b49f6;return db['SmsMessage']['find']({'where':{'id':_0x3e30cc[_0xce61('0x53')]['id']}})[_0xce61('0x1e')](handleEntityNotFound(_0x56f463,null))[_0xce61('0x1e')](function(_0x164512){if(_0x164512){_0x2b49f6=_0x164512;return db['SmsAccount'][_0xce61('0x54')]({'where':{'id':_0x164512[_0xce61('0x7f')]}});}})['then'](handleEntityNotFound(_0x56f463,null))['then'](function(_0x1c4d5f){if(_0x1c4d5f){logger[_0xce61('0x22')](_0xce61('0x23'),'status',_0xce61('0x80'),_0x1c4d5f['type'],util[_0xce61('0x81')](_0x3e30cc['body'],{'showHidden':![],'depth':null}));switch(_0x1c4d5f['type']){case'twilio':if(_0x3e30cc[_0xce61('0x56')][_0xce61('0x82')]&&_0x3e30cc[_0xce61('0x56')][_0xce61('0x82')]===_0x2b49f6[_0xce61('0x83')]){return _0x2b49f6[_0xce61('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xce61('0x29'),_0xce61('0x84'),util[_0xce61('0x81')](_0x3e30cc[_0xce61('0x56')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3e30cc[_0xce61('0x56')][_0xce61('0x85')]&&_0x3e30cc[_0xce61('0x56')][_0xce61('0x85')]===_0x2b49f6[_0xce61('0x83')]&&_['indexOf']([_0xce61('0x86'),'delivered'],_0x3e30cc[_0xce61('0x56')][_0xce61('0x87')])>=0x0){return _0x2b49f6[_0xce61('0x33')]({'read':!![]});}else{logger['error'](_0xce61('0x88'),'status',_0xce61('0x89'),util[_0xce61('0x81')](_0x3e30cc[_0xce61('0x56')],{'showHidden':![],'depth':null}));}break;case _0xce61('0x8a'):var _0x260759=_0x3e30cc[_0xce61('0x56')][_0xce61('0x8b')][0x0];if(_0x260759[_0xce61('0x29')][_0xce61('0x8c')]===_0xce61('0x8d')){return _0x2b49f6[_0xce61('0x33')]({'read':!![]});}else{logger[_0xce61('0x25')](_0xce61('0x88'),_0xce61('0x29'),'infobip',util['inspect'](_0x3e30cc[_0xce61('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x2b49f6;}})[_0xce61('0x1e')](respondWithResult(_0x56f463,null))['catch'](handleError(_0x56f463,null));}; \ No newline at end of file +var _0xe1c4=['read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','channel','EventManager','SmsInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','motionChannel','event','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','sent','delivered','Status','plivio','infobip','results','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','end','name','send','index','map','SmsMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','sms-interactions','accept','sms'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0xe1c4[_0x46efd7];return _0x5637e4;};'use strict';var emlformat=require(_0x4e1c('0x0'));var rimraf=require(_0x4e1c('0x1'));var zipdir=require(_0x4e1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e1c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4e1c('0x4'));var util=require(_0x4e1c('0x5'));var path=require(_0x4e1c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e1c('0x7'));var fs=require('fs');var fs_extra=require(_0x4e1c('0x8'));var _=require(_0x4e1c('0x9'));var squel=require(_0x4e1c('0xa'));var crypto=require(_0x4e1c('0xb'));var jsforce=require(_0x4e1c('0xc'));var deskjs=require(_0x4e1c('0xd'));var toCsv=require(_0x4e1c('0xe'));var querystring=require(_0x4e1c('0xf'));var Papa=require(_0x4e1c('0x10'));var Redis=require(_0x4e1c('0x11'));var authService=require(_0x4e1c('0x12'));var qs=require(_0x4e1c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e1c('0x14'));var logger=require(_0x4e1c('0x15'))('api');var utils=require(_0x4e1c('0x16'));var config=require(_0x4e1c('0x17'));var licenseUtil=require(_0x4e1c('0x18'));var db=require(_0x4e1c('0x19'))['db'];config['redis']=_[_0x4e1c('0x1a')](config[_0x4e1c('0x1b')],{'host':_0x4e1c('0x1c'),'port':0x18eb});var socket=require(_0x4e1c('0x1d'))(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x4e1c('0x1e'));var client=jayson[_0x4e1c('0x1f')][_0x4e1c('0x20')]({'port':0x232c});var client9002=jayson[_0x4e1c('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd5bc,_0x374c78,_0x12811c,_0xdb080a){return new BPromise(function(_0x44a842,_0x109d84){var _0x58d9e3=_0xdb080a||client;return _0x58d9e3[_0x4e1c('0x21')](_0x2cd5bc,_0x12811c)[_0x4e1c('0x22')](function(_0x2af3db){logger[_0x4e1c('0x23')](_0x4e1c('0x24'),_0x374c78,_0x4e1c('0x25'));logger[_0x4e1c('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x374c78,_0x4e1c('0x25'),JSON[_0x4e1c('0x27')](_0x2af3db));if(_0x2af3db[_0x4e1c('0x28')]){if(_0x2af3db[_0x4e1c('0x28')][_0x4e1c('0x29')]===0x1f4){logger[_0x4e1c('0x28')](_0x4e1c('0x24'),_0x374c78,_0x2af3db['error'][_0x4e1c('0x2a')]);return _0x109d84(_0x2af3db[_0x4e1c('0x28')][_0x4e1c('0x2a')]);}logger[_0x4e1c('0x28')](_0x4e1c('0x24'),_0x374c78,_0x2af3db[_0x4e1c('0x28')][_0x4e1c('0x2a')]);return _0x44a842(_0x2af3db[_0x4e1c('0x28')][_0x4e1c('0x2a')]);}else{logger['info'](_0x4e1c('0x24'),_0x374c78,_0x4e1c('0x25'));_0x44a842(_0x2af3db[_0x4e1c('0x2b')]['message']);}})['catch'](function(_0x17f5a5){logger['error'](_0x4e1c('0x24'),_0x374c78,_0x17f5a5);_0x109d84(_0x17f5a5);});});}function respondWithStatusCode(_0xd9c771,_0x2a2ccb){_0x2a2ccb=_0x2a2ccb||0xcc;return function(_0x564b30){if(_0x564b30){return _0xd9c771[_0x4e1c('0x2c')](_0x2a2ccb);}return _0xd9c771[_0x4e1c('0x2d')](_0x2a2ccb)['end']();};}function respondWithResult(_0x53980c,_0x2526a6){_0x2526a6=_0x2526a6||0xc8;return function(_0x264c48){if(_0x264c48){return _0x53980c[_0x4e1c('0x2d')](_0x2526a6)[_0x4e1c('0x2e')](_0x264c48);}};}function respondWithFilteredResult(_0x5ef2f7,_0xeccf79){return function(_0x8e3e14){if(_0x8e3e14){var _0x1b5ba8=typeof _0xeccf79[_0x4e1c('0x2f')]==='undefined'&&typeof _0xeccf79[_0x4e1c('0x30')]===_0x4e1c('0x31');var _0x53bdc7=_0x8e3e14[_0x4e1c('0x32')];var _0x5ae521=_0x1b5ba8?0x0:_0xeccf79[_0x4e1c('0x2f')];var _0x3c007f=_0x1b5ba8?_0x8e3e14[_0x4e1c('0x32')]:_0xeccf79[_0x4e1c('0x2f')]+_0xeccf79['limit'];var _0x2656d1;if(_0x3c007f>=_0x53bdc7){_0x3c007f=_0x53bdc7;_0x2656d1=0xc8;}else{_0x2656d1=0xce;}_0x5ef2f7['status'](_0x2656d1);return _0x5ef2f7[_0x4e1c('0x33')]('Content-Range',_0x5ae521+'-'+_0x3c007f+'/'+_0x53bdc7)[_0x4e1c('0x2e')](_0x8e3e14);}return null;};}function patchUpdates(_0x3a4e3c){return function(_0x4a5e2e){try{jsonpatch[_0x4e1c('0x34')](_0x4a5e2e,_0x3a4e3c,!![]);}catch(_0x513a2e){return BPromise[_0x4e1c('0x35')](_0x513a2e);}return _0x4a5e2e[_0x4e1c('0x36')]();};}function saveUpdates(_0x22a506,_0x68c5dc){return function(_0xbde1d0){if(_0xbde1d0){return _0xbde1d0[_0x4e1c('0x37')](_0x22a506)[_0x4e1c('0x22')](function(_0xbfa994){return _0xbfa994;});}return null;};}function removeEntity(_0x415ba7,_0xd71946){return function(_0x51208f){if(_0x51208f){return _0x51208f[_0x4e1c('0x38')]()[_0x4e1c('0x22')](function(){_0x415ba7[_0x4e1c('0x2d')](0xcc)[_0x4e1c('0x39')]();});}};}function handleEntityNotFound(_0x10101c,_0x3f2b9a){return function(_0x4e3e96){if(!_0x4e3e96){_0x10101c['sendStatus'](0x194);}return _0x4e3e96;};}function handleError(_0xa37d6,_0x68640d){_0x68640d=_0x68640d||0x1f4;return function(_0x3bd9fb){logger[_0x4e1c('0x28')](_0x3bd9fb['stack']);if(_0x3bd9fb[_0x4e1c('0x3a')]){delete _0x3bd9fb[_0x4e1c('0x3a')];}_0xa37d6['status'](_0x68640d)[_0x4e1c('0x3b')](_0x3bd9fb);};}exports[_0x4e1c('0x3c')]=function(_0x729915,_0x5f0280){var _0x39bc52={},_0xa5b309={},_0x4853fc={'count':0x0,'rows':[]};var _0x4091de=_[_0x4e1c('0x3d')](db[_0x4e1c('0x3e')][_0x4e1c('0x3f')],function(_0x1cb1a3){return{'name':_0x1cb1a3[_0x4e1c('0x40')],'type':_0x1cb1a3['type']['key']};});_0xa5b309[_0x4e1c('0x41')]=_[_0x4e1c('0x3d')](_0x4091de,_0x4e1c('0x3a'));_0xa5b309[_0x4e1c('0x42')]=_[_0x4e1c('0x43')](_0x729915[_0x4e1c('0x42')]);_0xa5b309[_0x4e1c('0x44')]=_[_0x4e1c('0x45')](_0xa5b309[_0x4e1c('0x41')],_0xa5b309[_0x4e1c('0x42')]);_0x39bc52[_0x4e1c('0x46')]=_['intersection'](_0xa5b309['model'],qs[_0x4e1c('0x47')](_0x729915[_0x4e1c('0x42')][_0x4e1c('0x47')]));_0x39bc52[_0x4e1c('0x46')]=_0x39bc52[_0x4e1c('0x46')][_0x4e1c('0x48')]?_0x39bc52['attributes']:_0xa5b309[_0x4e1c('0x41')];if(!_0x729915[_0x4e1c('0x42')][_0x4e1c('0x49')](_0x4e1c('0x4a'))){_0x39bc52[_0x4e1c('0x30')]=qs[_0x4e1c('0x30')](_0x729915[_0x4e1c('0x42')][_0x4e1c('0x30')]);_0x39bc52[_0x4e1c('0x2f')]=qs[_0x4e1c('0x2f')](_0x729915[_0x4e1c('0x42')]['offset']);}_0x39bc52[_0x4e1c('0x4b')]=qs[_0x4e1c('0x4c')](_0x729915[_0x4e1c('0x42')][_0x4e1c('0x4c')]);_0x39bc52[_0x4e1c('0x4d')]=qs[_0x4e1c('0x44')](_[_0x4e1c('0x4e')](_0x729915[_0x4e1c('0x42')],_0xa5b309['filters']),_0x4091de);if(_0x729915[_0x4e1c('0x42')]['filter']){_0x39bc52[_0x4e1c('0x4d')]=_[_0x4e1c('0x4f')](_0x39bc52['where'],{'$or':_[_0x4e1c('0x3d')](_0x4091de,function(_0x11c8fe){if(_0x11c8fe['type']!=='VIRTUAL'){var _0x20d362={};_0x20d362[_0x11c8fe[_0x4e1c('0x3a')]]={'$like':'%'+_0x729915[_0x4e1c('0x42')][_0x4e1c('0x50')]+'%'};return _0x20d362;}})});}_0x39bc52=_['merge']({},_0x39bc52,_0x729915[_0x4e1c('0x51')]);var _0x2aa544={'where':_0x39bc52[_0x4e1c('0x4d')]};return db[_0x4e1c('0x3e')]['count'](_0x2aa544)[_0x4e1c('0x22')](function(_0x2d6e50){_0x4853fc[_0x4e1c('0x32')]=_0x2d6e50;if(_0x729915[_0x4e1c('0x42')][_0x4e1c('0x52')]){_0x39bc52[_0x4e1c('0x53')]=[{'all':!![]}];}return db[_0x4e1c('0x3e')][_0x4e1c('0x54')](_0x39bc52);})[_0x4e1c('0x22')](function(_0x53f269){_0x4853fc[_0x4e1c('0x55')]=_0x53f269;return _0x4853fc;})['then'](respondWithFilteredResult(_0x5f0280,_0x39bc52))[_0x4e1c('0x56')](handleError(_0x5f0280,null));};exports[_0x4e1c('0x57')]=function(_0x29f908,_0x56b317){var _0x5ea849={'raw':!![],'where':{'id':_0x29f908[_0x4e1c('0x58')]['id']}},_0x1c314c={};_0x1c314c['model']=_[_0x4e1c('0x43')](db[_0x4e1c('0x3e')]['rawAttributes']);_0x1c314c['query']=_[_0x4e1c('0x43')](_0x29f908['query']);_0x1c314c[_0x4e1c('0x44')]=_[_0x4e1c('0x45')](_0x1c314c[_0x4e1c('0x41')],_0x1c314c[_0x4e1c('0x42')]);_0x5ea849[_0x4e1c('0x46')]=_[_0x4e1c('0x45')](_0x1c314c[_0x4e1c('0x41')],qs[_0x4e1c('0x47')](_0x29f908['query'][_0x4e1c('0x47')]));_0x5ea849[_0x4e1c('0x46')]=_0x5ea849['attributes'][_0x4e1c('0x48')]?_0x5ea849['attributes']:_0x1c314c[_0x4e1c('0x41')];if(_0x29f908[_0x4e1c('0x42')][_0x4e1c('0x52')]){_0x5ea849['include']=[{'all':!![]}];}_0x5ea849=_[_0x4e1c('0x4f')]({},_0x5ea849,_0x29f908[_0x4e1c('0x51')]);return db['SmsMessage'][_0x4e1c('0x59')](_0x5ea849)[_0x4e1c('0x22')](handleEntityNotFound(_0x56b317,null))[_0x4e1c('0x22')](respondWithResult(_0x56b317,null))[_0x4e1c('0x56')](handleError(_0x56b317,null));};exports['create']=function(_0x384102,_0x16c15d){return db[_0x4e1c('0x3e')][_0x4e1c('0x5a')](_0x384102[_0x4e1c('0x5b')],{})[_0x4e1c('0x22')](respondWithResult(_0x16c15d,0xc9))[_0x4e1c('0x56')](handleError(_0x16c15d,null));};exports['update']=function(_0x1d5548,_0x13e096){if(_0x1d5548[_0x4e1c('0x5b')]['id']){delete _0x1d5548[_0x4e1c('0x5b')]['id'];}return db['SmsMessage'][_0x4e1c('0x59')]({'where':{'id':_0x1d5548[_0x4e1c('0x58')]['id']}})['then'](handleEntityNotFound(_0x13e096,null))['then'](saveUpdates(_0x1d5548[_0x4e1c('0x5b')],null))[_0x4e1c('0x22')](respondWithResult(_0x13e096,null))[_0x4e1c('0x56')](handleError(_0x13e096,null));};exports[_0x4e1c('0x38')]=function(_0x30742e,_0x307626){return db[_0x4e1c('0x3e')][_0x4e1c('0x59')]({'where':{'id':_0x30742e[_0x4e1c('0x58')]['id']}})['then'](handleEntityNotFound(_0x307626,null))[_0x4e1c('0x22')](removeEntity(_0x307626,null))['catch'](handleError(_0x307626,null));};exports[_0x4e1c('0x5c')]=function(_0x65874d,_0x2b78e2){return db['SmsMessage'][_0x4e1c('0x5c')]()[_0x4e1c('0x22')](respondWithResult(_0x2b78e2,null))[_0x4e1c('0x56')](handleError(_0x2b78e2,null));};var interaction_log=require('../../config/logger')(_0x4e1c('0x5d'));exports[_0x4e1c('0x5e')]=function(_0x5398fd,_0x335830,_0x380ba6){var _0x108765={'agent':{},'channel':_0x4e1c('0x5f')};if(_0x5398fd[_0x4e1c('0x5b')]['id']){delete _0x5398fd[_0x4e1c('0x5b')]['id'];}_0x5398fd[_0x4e1c('0x5b')][_0x4e1c('0x60')]=!![];_0x5398fd['body'][_0x4e1c('0x61')]=moment()[_0x4e1c('0x62')](_0x4e1c('0x63'));_0x5398fd['body'][_0x4e1c('0x64')]=_0x5398fd[_0x4e1c('0x5b')][_0x4e1c('0x64')]||_0x5398fd[_0x4e1c('0x65')]['id'];_0x108765[_0x4e1c('0x66')]['id']=_0x5398fd[_0x4e1c('0x5b')][_0x4e1c('0x64')];return db[_0x4e1c('0x3e')][_0x4e1c('0x59')]({'where':{'id':_0x5398fd[_0x4e1c('0x58')]['id'],'UserId':null}})[_0x4e1c('0x22')](handleEntityNotFound(_0x335830,null))[_0x4e1c('0x22')](saveUpdates(_0x5398fd[_0x4e1c('0x5b')],null))[_0x4e1c('0x22')](function(_0x506e3a){if(_0x506e3a){_0x108765['message']=_0x506e3a[_0x4e1c('0x67')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x506e3a['SmsInteractionId']}});}return null;})[_0x4e1c('0x22')](handleEntityNotFound(_0x335830,null))[_0x4e1c('0x22')](function(_0x43cda1){if(_0x43cda1){return _0x43cda1[_0x4e1c('0x37')]({'UserId':_0x5398fd[_0x4e1c('0x5b')][_0x4e1c('0x64')],'read1stAt':_['isNil'](_0x43cda1['read1stAt'])?moment()[_0x4e1c('0x62')](_0x4e1c('0x63')):undefined});}return null;})[_0x4e1c('0x22')](function(_0x399669){if(_0x399669){_0x108765[_0x4e1c('0x68')]=_0x399669[_0x4e1c('0x67')]({'plain':!![]});interaction_log[_0x4e1c('0x23')](_0x4e1c('0x69'),_0x5398fd['user']['id'],_0x5398fd[_0x4e1c('0x65')][_0x4e1c('0x3a')],_0x5398fd[_0x4e1c('0x65')][_0x4e1c('0x6a')],_0x108765[_0x4e1c('0x68')]['id'],_0x5398fd[_0x4e1c('0x5b')]?JSON[_0x4e1c('0x27')](_0x5398fd[_0x4e1c('0x5b')]):'null');return respondWithRpcPromise(_0x4e1c('0x6b'),_0x4e1c('0x6c'),_0x108765);}return null;})[_0x4e1c('0x22')](function(_0x5dafd2){var _0x515c7b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5dafd2['message']['ContactId'];return db['sequelize'][_0x4e1c('0x42')](_0x515c7b,{'type':db[_0x4e1c('0x6d')][_0x4e1c('0x6e')]['SELECT'],'raw':!![]})[_0x4e1c('0x22')](function(_0x156e56){return _0x156e56;});})[_0x4e1c('0x22')](function(_0xb53af){if(_0xb53af){_0x108765[_0x4e1c('0x2a')][_0x4e1c('0x6f')]=_0xb53af[0x0];if(!_0x5398fd[_0x4e1c('0x5b')][_0x4e1c('0x64')])return;return db[_0x4e1c('0x70')][_0x4e1c('0x59')]({'where':{'id':_0x5398fd[_0x4e1c('0x5b')][_0x4e1c('0x64')],'role':_0x4e1c('0x66')},'attributes':['id',_0x4e1c('0x3a'),_0x4e1c('0x71'),'email',_0x4e1c('0x72')],'raw':!![]});}return null;})[_0x4e1c('0x22')](function(_0x43fffc){if(!_0x43fffc)return null;_0x108765['message'][_0x4e1c('0x66')]=_0x43fffc;return _0x108765;})[_0x4e1c('0x22')](function(_0x696664){if(_0x696664){if(_0x5398fd[_0x4e1c('0x5b')][_0x4e1c('0x73')]){_0x108765[_0x4e1c('0x2a')][_0x4e1c('0x74')]=util[_0x4e1c('0x62')](_0x4e1c('0x75'),_0x5398fd['user'][_0x4e1c('0x3a')]);_0x108765[_0x4e1c('0x2a')][_0x4e1c('0x76')]=_0x108765[_0x4e1c('0x76')];_0x108765[_0x4e1c('0x2a')]['motionChannel']=_0x108765[_0x4e1c('0x76')];_0x108765[_0x4e1c('0x2a')]['event']=_0x4e1c('0x5e');return respondWithRpcPromise(_0x4e1c('0x77'),_0x4e1c('0x77'),{'event':'acceptmessage','message':_0x108765[_0x4e1c('0x2a')]},client9002)['then'](function(){return _0x108765;});}return _0x108765;}return null;})[_0x4e1c('0x22')](respondWithResult(_0x335830,null))['catch'](handleError(_0x335830,null));};var interaction_log=require(_0x4e1c('0x15'))(_0x4e1c('0x5d'));exports[_0x4e1c('0x35')]=function(_0x2390f4,_0x325360,_0x1feb4d){var _0x3b8846={'agent':{},'channel':_0x4e1c('0x5f')};if(_0x2390f4[_0x4e1c('0x5b')]['id']){delete _0x2390f4[_0x4e1c('0x5b')]['id'];}_0x2390f4[_0x4e1c('0x5b')][_0x4e1c('0x64')]=_0x2390f4[_0x4e1c('0x5b')][_0x4e1c('0x64')]||_0x2390f4[_0x4e1c('0x65')]['id'];_0x3b8846[_0x4e1c('0x66')]['id']=_0x2390f4['body'][_0x4e1c('0x64')];return db[_0x4e1c('0x3e')][_0x4e1c('0x59')]({'where':{'id':_0x2390f4[_0x4e1c('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x325360,null))['then'](function(_0x145d0a){if(_0x145d0a){_0x3b8846[_0x4e1c('0x2a')]=_0x145d0a[_0x4e1c('0x67')]({'plain':!![]});return db['SmsInteraction'][_0x4e1c('0x59')]({'where':{'id':_0x145d0a[_0x4e1c('0x78')]}});}return null;})[_0x4e1c('0x22')](handleEntityNotFound(_0x325360,null))['then'](function(_0x26de67){if(_0x26de67){_0x3b8846[_0x4e1c('0x68')]=_0x26de67[_0x4e1c('0x67')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2390f4[_0x4e1c('0x65')]['id'],_0x2390f4[_0x4e1c('0x65')]['name'],_0x2390f4[_0x4e1c('0x65')]['role'],_0x3b8846['interaction']['id'],_0x2390f4['body']?JSON[_0x4e1c('0x27')](_0x2390f4[_0x4e1c('0x5b')]):'null');return respondWithRpcPromise(_0x4e1c('0x79'),_0x4e1c('0x7a'),_0x3b8846);}return null;})[_0x4e1c('0x22')](function(_0x4c256b){var _0x5f107a=_0x4e1c('0x7b')+_0x4c256b[_0x4e1c('0x2a')][_0x4e1c('0x7c')];return db[_0x4e1c('0x7d')][_0x4e1c('0x42')](_0x5f107a,{'type':db[_0x4e1c('0x6d')][_0x4e1c('0x6e')][_0x4e1c('0x7e')],'raw':!![]})[_0x4e1c('0x22')](function(_0x4431b5){return _0x4431b5;});})[_0x4e1c('0x22')](function(_0x1eefd8){if(_0x1eefd8){_0x3b8846[_0x4e1c('0x2a')][_0x4e1c('0x6f')]=_0x1eefd8[0x0];if(!_0x2390f4[_0x4e1c('0x5b')][_0x4e1c('0x64')])return;return db[_0x4e1c('0x70')]['find']({'where':{'id':_0x2390f4[_0x4e1c('0x5b')]['UserId'],'role':_0x4e1c('0x66')},'attributes':['id',_0x4e1c('0x3a'),'fullname','email',_0x4e1c('0x72')],'raw':!![]});}return null;})[_0x4e1c('0x22')](function(_0x38a2de){if(!_0x38a2de)return null;_0x3b8846[_0x4e1c('0x2a')]['agent']=_0x38a2de;return _0x3b8846;})[_0x4e1c('0x22')](function(_0x9d273f){if(_0x9d273f){_0x9d273f[_0x4e1c('0x2a')][_0x4e1c('0x74')]=util[_0x4e1c('0x62')](_0x4e1c('0x75'),_0x2390f4[_0x4e1c('0x65')]['name']);_0x9d273f['message'][_0x4e1c('0x76')]=_0x3b8846[_0x4e1c('0x76')];_0x9d273f[_0x4e1c('0x2a')][_0x4e1c('0x7f')]=_0x3b8846[_0x4e1c('0x76')];_0x9d273f[_0x4e1c('0x2a')][_0x4e1c('0x80')]='reject';respondWithRpcPromise(_0x4e1c('0x77'),_0x4e1c('0x77'),{'event':_0x4e1c('0x81'),'message':_0x9d273f[_0x4e1c('0x2a')]},client9002);return _0x3b8846;}return null;})['then'](respondWithResult(_0x325360,null))[_0x4e1c('0x56')](handleError(_0x325360,null));};exports[_0x4e1c('0x2d')]=function(_0x45fb6d,_0x470a7f,_0x31ef9a){if(_0x45fb6d[_0x4e1c('0x5b')]['id']){delete _0x45fb6d[_0x4e1c('0x5b')]['id'];}var _0x5cc37f;return db['SmsMessage'][_0x4e1c('0x59')]({'where':{'id':_0x45fb6d['params']['id']}})[_0x4e1c('0x22')](handleEntityNotFound(_0x470a7f,null))[_0x4e1c('0x22')](function(_0x45e59e){if(_0x45e59e){_0x5cc37f=_0x45e59e;return db['SmsAccount'][_0x4e1c('0x59')]({'where':{'id':_0x45e59e[_0x4e1c('0x82')]}});}})[_0x4e1c('0x22')](handleEntityNotFound(_0x470a7f,null))['then'](function(_0x4d4242){if(_0x4d4242){logger[_0x4e1c('0x26')](_0x4e1c('0x83'),_0x4e1c('0x2d'),_0x4e1c('0x84'),_0x4d4242[_0x4e1c('0x85')],util[_0x4e1c('0x86')](_0x45fb6d[_0x4e1c('0x5b')],{'showHidden':![],'depth':null}));switch(_0x4d4242[_0x4e1c('0x85')]){case'twilio':if(_0x45fb6d['body'][_0x4e1c('0x87')]&&_0x45fb6d['body'][_0x4e1c('0x87')]===_0x5cc37f[_0x4e1c('0x88')]){return _0x5cc37f[_0x4e1c('0x37')]({'read':!![]});}else{logger[_0x4e1c('0x28')](_0x4e1c('0x89'),_0x4e1c('0x2d'),_0x4e1c('0x8a'),util[_0x4e1c('0x86')](_0x45fb6d[_0x4e1c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4e1c('0x8b'):if(_0x45fb6d[_0x4e1c('0x5b')][_0x4e1c('0x8c')]&&_0x45fb6d[_0x4e1c('0x5b')]['MessageUUID']===_0x5cc37f[_0x4e1c('0x88')]&&_['indexOf']([_0x4e1c('0x8d'),_0x4e1c('0x8e')],_0x45fb6d[_0x4e1c('0x5b')][_0x4e1c('0x8f')])>=0x0){return _0x5cc37f[_0x4e1c('0x37')]({'read':!![]});}else{logger['error'](_0x4e1c('0x89'),_0x4e1c('0x2d'),_0x4e1c('0x90'),util['inspect'](_0x45fb6d[_0x4e1c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4e1c('0x91'):var _0x5f2c47=_0x45fb6d[_0x4e1c('0x5b')][_0x4e1c('0x92')][0x0];if(_0x5f2c47['status']['groupName']==='DELIVERED'){return _0x5cc37f[_0x4e1c('0x37')]({'read':!![]});}else{logger[_0x4e1c('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4e1c('0x2d'),_0x4e1c('0x91'),util[_0x4e1c('0x86')](_0x45fb6d[_0x4e1c('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x5cc37f;}})[_0x4e1c('0x22')](respondWithResult(_0x470a7f,null))[_0x4e1c('0x56')](handleError(_0x470a7f,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 2d11c0e..3f427f8 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 _0x712e=['exports','events','../../mysqldb','SmsMessage','save','update','remove','emit'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x712e,0x199));var _0xe712=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x712e[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xe712('0x0'));var SmsMessage=require(_0xe712('0x1'))['db'][_0xe712('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe712('0x3'),'afterUpdate':_0xe712('0x4'),'afterDestroy':_0xe712('0x5')};function emitEvent(_0x3d9321){return function(_0x4e2701,_0x2b6663,_0x242ea1){SmsMessageEvents['emit'](_0x3d9321+':'+_0x4e2701['id'],_0x4e2701);SmsMessageEvents[_0xe712('0x6')](_0x3d9321,_0x4e2701);_0x242ea1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xe712('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0xb4b5=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2be40f,_0x339623){var _0xbc6191=function(_0x22954c){while(--_0x22954c){_0x2be40f['push'](_0x2be40f['shift']());}};_0xbc6191(++_0x339623);}(_0xb4b5,0x142));var _0x5b4b=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0xb4b5[_0x17a32f];return _0x15a293;};'use strict';var EventEmitter=require(_0x5b4b('0x0'));var SmsMessage=require(_0x5b4b('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5b4b('0x2')](0x0);var events={'afterCreate':_0x5b4b('0x3'),'afterUpdate':_0x5b4b('0x4'),'afterDestroy':_0x5b4b('0x5')};function emitEvent(_0x4c13b6){return function(_0x59913a,_0x5736ed,_0x31f950){SmsMessageEvents[_0x5b4b('0x6')](_0x4c13b6+':'+_0x59913a['id'],_0x59913a);SmsMessageEvents['emit'](_0x4c13b6,_0x59913a);_0x31f950(null);};}for(var e in events){if(events[_0x5b4b('0x7')](e)){var event=events[e];SmsMessage[_0x5b4b('0x8')](e,emitEvent(event));}}module[_0x5b4b('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c29983c..5cbe501 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 _0x6ea8=['Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','apiKey','login','text','timestamp','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','uuid','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','catch','error','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','user_key','session_key','total_sent','internal_order_id','deliveryReport','read'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x6ea8,0xbc));var _0x86ea=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x6ea8[_0x273dc5];return _0x46dae7;};'use strict';var _=require(_0x86ea('0x0'));var util=require(_0x86ea('0x1'));var logger=require(_0x86ea('0x2'))('api');var moment=require(_0x86ea('0x3'));var BPromise=require(_0x86ea('0x4'));var rp=require(_0x86ea('0x5'));var fs=require('fs');var path=require(_0x86ea('0x6'));var rimraf=require(_0x86ea('0x7'));var config=require('../../config/environment');var attributes=require(_0x86ea('0x8'));module[_0x86ea('0x9')]=function(_0x34eb6b,_0x6e3a20){return _0x34eb6b[_0x86ea('0xa')](_0x86ea('0xb'),attributes,{'tableName':_0x86ea('0xc'),'paranoid':![],'indexes':[{'name':_0x86ea('0xd'),'fields':[_0x86ea('0xd')]},{'name':_0x86ea('0xe'),'fields':[_0x86ea('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42489e,_0x362ff9,_0x150b5b){var _0x450f2a=_0x34eb6b['models'];var _0x56899c=_0x42489e['get']({'plain':!![]});if(_0x56899c[_0x86ea('0x10')][_0x86ea('0x11')]()==='in'||_0x56899c[_0x86ea('0x10')][_0x86ea('0x11')]()===_0x86ea('0x12')&&!_0x56899c[_0x86ea('0x13')]&&!_[_0x86ea('0x14')](_0x56899c[_0x86ea('0x15')])&&!_[_0x86ea('0x14')](_0x56899c[_0x86ea('0x16')])){_0x450f2a[_0x86ea('0x17')]['findOne']({'where':{'id':_0x56899c[_0x86ea('0x16')]}})[_0x86ea('0x18')](function(_0xa81d41){if(_0xa81d41){_0xa81d41[_0x86ea('0x19')]({'lastMsgAt':_0x56899c['createdAt'],'lastMsgDirection':_0x56899c[_0x86ea('0x10')]['toLowerCase']()});}})[_0x86ea('0x1a')](function(_0x41ff24){console[_0x86ea('0x1b')](_0x41ff24);});}if(_0x56899c[_0x86ea('0x10')]===_0x86ea('0x12')&&!_0x56899c['secret']){var _0xa7f253;_0x450f2a[_0x86ea('0x1c')][_0x86ea('0x1d')]({'where':{'id':_0x56899c[_0x86ea('0x1e')]},'raw':!![]})['then'](function(_0x34d660){_0xa7f253=_0x34d660;if(_0xa7f253&&_0xa7f253[_0x86ea('0x1f')]){switch(_0xa7f253[_0x86ea('0x1f')]){case _0x86ea('0x20'):var _0x4c9db7=require('twilio');if(_0xa7f253[_0x86ea('0x21')]&&_0xa7f253[_0x86ea('0x22')]&&_0xa7f253[_0x86ea('0x23')]){var _0x487c4d=new _0x4c9db7(_0xa7f253[_0x86ea('0x21')],_0xa7f253['authToken']);_0x487c4d['messages'][_0x86ea('0x24')]({'body':_0x56899c[_0x86ea('0xf')],'to':_0x56899c['phone'],'from':_0xa7f253[_0x86ea('0x23')],'statusCallback':_0xa7f253[_0x86ea('0x25')]+_0x86ea('0x26')+_0x56899c['id']+_0x86ea('0x27')+_0xa7f253[_0x86ea('0x28')]})[_0x86ea('0x18')](function(_0x346f2b){if(_0x346f2b[_0x86ea('0x29')]){return _0x42489e[_0x86ea('0x19')]({'messageId':_0x346f2b[_0x86ea('0x29')]});}})[_0x86ea('0x1a')](function(_0x23b006){logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x20'),util[_0x86ea('0x2c')](_0x23b006,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x86ea('0x20'),_0x86ea('0x2d'));}break;case _0x86ea('0x2e'):var _0x39ca46=_0x86ea('0x2f');if(_0xa7f253[_0x86ea('0x30')]&&_0xa7f253[_0x86ea('0x31')]){var _0x4a2775={'recipient':[_0x56899c[_0x86ea('0x23')]],'message':_0x56899c[_0x86ea('0xf')],'message_type':_0xa7f253[_0x86ea('0x32')]};if(_0xa7f253[_0x86ea('0x32')]&&_0xa7f253[_0x86ea('0x32')]!=='SI'){_0x4a2775[_0x86ea('0x33')]=_0xa7f253[_0x86ea('0x23')];}var _0x2d809a={'url':_0x39ca46+_0x86ea('0x34')+_0xa7f253['username']+_0x86ea('0x35')+_0xa7f253[_0x86ea('0x31')],'method':_0x86ea('0x36')};rp(_0x2d809a)['then'](function(_0x14c1ad){var _0x4cd69e=_0x14c1ad[_0x86ea('0x37')](';');var _0x1b8317={'user_key':_0x4cd69e[0x0],'session_key':_0x4cd69e[0x1]};_0x2d809a={'url':_0x39ca46+_0x86ea('0x38'),'method':_0x86ea('0x39'),'headers':{'user_key':_0x1b8317[_0x86ea('0x3a')],'Session_key':_0x1b8317[_0x86ea('0x3b')]},'json':!![],'body':_0x4a2775};return rp(_0x2d809a);})[_0x86ea('0x18')](function(_0x3b10d7){if(_0x3b10d7[_0x86ea('0x3c')]>=0x1){var _0x2eeb5f={'messageId':_0x3b10d7[_0x86ea('0x3d')]};if(_0xa7f253[_0x86ea('0x32')]!=='GP'||!_0xa7f253[_0x86ea('0x3e')]){_0x2eeb5f[_0x86ea('0x3f')]=!![];}return _0x42489e[_0x86ea('0x19')](_0x2eeb5f);}else{return logger[_0x86ea('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x86ea('0x2b'),_0x86ea('0x2e'),util[_0x86ea('0x2c')](_0x3b10d7,{'showHidden':![],'depth':null}));}})[_0x86ea('0x1a')](function(_0x1ef654){return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),'skebby',util['inspect'](_0x1ef654,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x2e'),_0x86ea('0x40'));}break;case _0x86ea('0x41'):if(_0xa7f253[_0x86ea('0x22')]){var _0x2eb5db={'recipient':_0x56899c[_0x86ea('0x23')],'message':_0x56899c[_0x86ea('0xf')],'sender':_0xa7f253[_0x86ea('0x42')]||_0xa7f253['phone'],'authorization':_0xa7f253[_0x86ea('0x22')]};var _0x362ff9={'method':_0x86ea('0x39'),'uri':_0x86ea('0x43'),'body':_0x2eb5db,'json':!![]};rp(_0x362ff9)['then'](function(_0x328f9e){var _0x1b54de={'messageId':_0x328f9e[_0x86ea('0x44')]};if(!_0xa7f253[_0x86ea('0x3e')]){_0x1b54de[_0x86ea('0x3f')]=!![];}return _0x42489e['update'](_0x1b54de);})['catch'](function(_0x3fb28f){logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x41'),util[_0x86ea('0x2c')](_0x3fb28f,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x86ea('0x2b'),_0x86ea('0x41'),_0x86ea('0x45'));}break;case _0x86ea('0x46'):if(_0xa7f253[_0x86ea('0x30')]&&_0xa7f253[_0x86ea('0x31')]){var _0x2eb5db={'messages':[{'source':_0x86ea('0x47'),'to':_0x56899c[_0x86ea('0x23')],'body':_0x56899c[_0x86ea('0xf')],'from':_0xa7f253[_0x86ea('0x42')]||_0xa7f253[_0x86ea('0x23')]}]};var _0x3551a0=util[_0x86ea('0x48')](_0x86ea('0x49'),_0xa7f253[_0x86ea('0x30')],_0xa7f253['password']);var _0x362ff9={'method':'POST','uri':_0x86ea('0x4a'),'body':_0x2eb5db,'headers':{'Authorization':util[_0x86ea('0x48')]('Basic\x20%s',new Buffer(_0x3551a0)[_0x86ea('0x4b')](_0x86ea('0x4c')))},'json':!![]};rp(_0x362ff9)[_0x86ea('0x18')](function(_0x31ef6e){if(_0x31ef6e[_0x86ea('0x4d')]>=0xc8&&_0x31ef6e['http_code']<=0xce){if(_0x31ef6e['data']&&_0x31ef6e[_0x86ea('0x4e')][_0x86ea('0x4f')]>0x0){var _0x1844a6=_[_0x86ea('0x50')](_0x31ef6e['data'][_0x86ea('0x51')]);var _0x25b270={'messageId':_0x1844a6[_0x86ea('0x52')]};if(!_0xa7f253['deliveryReport']){_0x25b270[_0x86ea('0x3f')]=!![];}return _0x42489e[_0x86ea('0x19')](_0x25b270);}else{logger[_0x86ea('0x1b')](_0x86ea('0x2a'),'afterCreate','clickSend',util[_0x86ea('0x2c')](_0x31ef6e,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x86ea('0x2b'),'clickSend',util[_0x86ea('0x2c')](_0x31ef6e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x713adc){logger[_0x86ea('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x86ea('0x2b'),'clickSend',util[_0x86ea('0x2c')](_0x713adc,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x86ea('0x54'):if(_0xa7f253[_0x86ea('0x55')]&&_0xa7f253[_0x86ea('0x22')]){var _0x2eb5db={'dst':_0x56899c[_0x86ea('0x23')],'text':_0x56899c[_0x86ea('0xf')],'src':_0xa7f253[_0x86ea('0x42')]||_0xa7f253[_0x86ea('0x23')],'url':_0xa7f253['remote']+_0x86ea('0x26')+_0x56899c['id']+_0x86ea('0x27')+_0xa7f253[_0x86ea('0x28')]};var _0x3551a0=util[_0x86ea('0x48')](_0x86ea('0x49'),_0xa7f253[_0x86ea('0x55')],_0xa7f253['authToken']);var _0x362ff9={'method':_0x86ea('0x39'),'uri':util[_0x86ea('0x48')](_0x86ea('0x56'),_0xa7f253[_0x86ea('0x55')]),'body':_0x2eb5db,'headers':{'Authorization':util[_0x86ea('0x48')](_0x86ea('0x57'),new Buffer(_0x3551a0)[_0x86ea('0x4b')](_0x86ea('0x4c')))},'json':!![]};rp(_0x362ff9)[_0x86ea('0x18')](function(_0x8e00d5){var _0x2b2064={'messageId':_0x8e00d5[_0x86ea('0x58')][0x0]};return _0x42489e[_0x86ea('0x19')](_0x2b2064);})[_0x86ea('0x1a')](function(_0x4ff443){logger['error'](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x54'),util[_0x86ea('0x2c')](_0x4ff443,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x86ea('0x2b'),_0x86ea('0x54'),_0x86ea('0x59'));}break;case _0x86ea('0x5a'):if(_0xa7f253[_0x86ea('0x30')]&&_0xa7f253[_0x86ea('0x31')]){if(_0xa7f253[_0x86ea('0x5b')]){var _0x5637e5={'method':'POST','uri':_0xa7f253['baseUrl']+_0x86ea('0x5c'),'body':{'username':_0xa7f253[_0x86ea('0x30')],'password':_0xa7f253[_0x86ea('0x31')]},'json':!![]};return rp(_0x5637e5)[_0x86ea('0x18')](function(_0x26c2bc){var _0x58f76f={'method':'POST','uri':_0xa7f253['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0xa7f253[_0x86ea('0x23')],'destinations':[{'to':_0x56899c[_0x86ea('0x23')]}],'text':_0x56899c['body'],'notifyUrl':_0xa7f253[_0x86ea('0x25')]+'/api/sms/messages/'+_0x56899c['id']+_0x86ea('0x27')+_0xa7f253[_0x86ea('0x28')],'notifyContentType':_0x86ea('0x5d'),'callbackData':_0xa7f253['phone']+';'+_0x56899c[_0x86ea('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x26c2bc[_0x86ea('0x28')]},'json':!![]};return rp(_0x58f76f)[_0x86ea('0x18')](function(_0x28d109){if(_0x28d109['messages']){var _0x3c4397={'messageId':_0x28d109['messages'][0x0][_0x86ea('0xd')]};if(!_0xa7f253[_0x86ea('0x3e')]){_0x3c4397['read']=!![];}return _0x42489e[_0x86ea('0x19')](_0x3c4397);}else{return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),'infobip',util[_0x86ea('0x2c')](_0x28d109,{'showHidden':![],'depth':null}));}});})[_0x86ea('0x1a')](function(_0x20d6ac){return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x5a'),util[_0x86ea('0x2c')](_0x20d6ac,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x5a'),_0x86ea('0x5e'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x86ea('0x2b'),_0x86ea('0x5a'),_0x86ea('0x40'));}break;case'csc':var _0x8f77a5=require('crypto');if(_0xa7f253[_0x86ea('0x5f')]){var _0x49b6d7={};_0x49b6d7[_0x86ea('0x60')]=_0xa7f253[_0x86ea('0x30')];_0x49b6d7[_0x86ea('0x23')]=_0x56899c['phone'];_0x49b6d7['sender']=_0xa7f253[_0x86ea('0x23')];_0x49b6d7[_0x86ea('0x61')]=_0x56899c[_0x86ea('0xf')];_0x49b6d7[_0x86ea('0x62')]=+new Date();var _0x1458fa='';var _0x5d644f='';var _0x33b125=Object['keys'](_0x49b6d7);_0x33b125['sort']();for(var _0x34ffdd=0x0;_0x34ffdd<_0x33b125[_0x86ea('0x63')];_0x34ffdd++){if(_0x1458fa!=''){_0x1458fa+='&';}_0x1458fa+=_0x33b125[_0x34ffdd]+'='+encodeURIComponent(_0x49b6d7[_0x33b125[_0x34ffdd]]);_0x5d644f+=_0x49b6d7[_0x33b125[_0x34ffdd]];}_0x5d644f+=_0xa7f253[_0x86ea('0x5f')];_0x5d644f=_0x8f77a5[_0x86ea('0x64')](_0x86ea('0x65'))['update'](_0x5d644f)[_0x86ea('0x66')](_0x86ea('0x67'));if(_0x1458fa!==''){_0x1458fa+='&';}_0x1458fa+=_0x86ea('0x68')+_0x5d644f;var _0x2d809a={'method':'GET','uri':_0xa7f253['baseUrl']+_0x86ea('0x69')+_0x1458fa,'json':!![]};return rp(_0x2d809a)[_0x86ea('0x18')](function(_0x44424e){var _0x3210b9=Object['keys'](_0x44424e);if(_0x44424e[_0x3210b9[0x0]][_0x86ea('0x1b')]&&parseInt(_0x44424e[_0x3210b9[0x0]]['error'])===0x0){var _0x18836b={'messageId':_0x44424e[_0x3210b9[0x0]][_0x86ea('0x6a')]};if(!_0xa7f253[_0x86ea('0x3e')]){_0x18836b[_0x86ea('0x3f')]=!![];}return _0x42489e['update'](_0x18836b);}else{return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x6b'),util[_0x86ea('0x2c')](_0x44424e[_0x86ea('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2d8c4d){return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x6b'),util[_0x86ea('0x2c')](_0x2d8c4d,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x86ea('0x2b'),_0x86ea('0x6b'),_0x86ea('0x6c'));}break;case'clickatell':if(_0xa7f253['apiKey']){var _0x592a7a={'method':_0x86ea('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xa7f253[_0x86ea('0x5f')]},'body':{'content':_0x56899c[_0x86ea('0xf')],'to':[_0x56899c[_0x86ea('0x23')]],'from':_0xa7f253[_0x86ea('0x23')],'binary':![],'clientMessageId':_0x86ea('0x6d'),'charset':'UTF-8'},'json':!![]};rp(_0x592a7a)[_0x86ea('0x18')](function(_0x1fab0f){if(!_0x1fab0f['error']){var _0x5ca5c0={'messageId':_0x1fab0f[_0x86ea('0x51')][0x0][_0x86ea('0x6e')]};if(!_0xa7f253['deliveryReport']){_0x5ca5c0[_0x86ea('0x3f')]=!![];}return _0x42489e['update'](_0x5ca5c0);}else{return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x6f'),util[_0x86ea('0x2c')](_0x1fab0f[_0x86ea('0x1b')],{'showHidden':![],'depth':null}));}})[_0x86ea('0x1a')](function(_0x111426){return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x6f'),util['inspect'](_0x111426,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x6f'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0xa7f253['username']&&_0xa7f253[_0x86ea('0x31')]){var _0x3551a0=util[_0x86ea('0x48')]('%s:%s',_0xa7f253[_0x86ea('0x30')],_0xa7f253[_0x86ea('0x31')]);var _0x362ff9={'method':_0x86ea('0x39'),'uri':_0x86ea('0x70')+_0xa7f253[_0x86ea('0x71')]+_0x86ea('0x72'),'body':{'to':[_0x56899c['phone']],'text':_0x56899c[_0x86ea('0xf')],'from':_0xa7f253[_0x86ea('0x23')],'applicationId':_0xa7f253[_0x86ea('0x73')]},'headers':{'Authorization':util[_0x86ea('0x48')](_0x86ea('0x57'),new Buffer(_0x3551a0)[_0x86ea('0x4b')](_0x86ea('0x4c')))},'json':!![]};rp(_0x362ff9)[_0x86ea('0x18')](function(_0x53a852){if(_0x53a852['id']){var _0x5bcd17={'messageId':_0x53a852['id']};return _0x42489e[_0x86ea('0x19')](_0x5bcd17);}else{logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x74'),util[_0x86ea('0x2c')](_0x53a852,{'showHidden':![],'depth':null}));}})[_0x86ea('0x1a')](function(_0x492903){logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x74'),util[_0x86ea('0x2c')](_0x492903,{'showHidden':![],'depth':null}));});}else{logger[_0x86ea('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x86ea('0x2b'),'bandwidth',_0x86ea('0x40'));}break;case _0x86ea('0x75'):if(_0xa7f253[_0x86ea('0x5f')]){var _0x363eec={};var _0x2d809a={'method':_0x86ea('0x39'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x86ea('0x76')+_0xa7f253['apiKey'],'Content-Type':_0x86ea('0x5d')},'body':{'from':_0xa7f253[_0x86ea('0x23')],'to':_0x56899c[_0x86ea('0x23')],'text':_0x56899c['body']},'json':!![]};return rp(_0x2d809a)[_0x86ea('0x18')](function(_0x501aba){if(_0x501aba[_0x86ea('0x77')]==0xca){_0x363eec['message']=_0x501aba;var _0x14cce3={'method':'POST','uri':_0x86ea('0x78'),'headers':{'Authorization':_0x86ea('0x76')+_0xa7f253['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x363eec[_0x86ea('0x79')][_0x86ea('0x7a')]},'json':!![]};return rp(_0x14cce3)[_0x86ea('0x18')](function(_0x46e376){_0x363eec[_0x86ea('0x7b')]=_0x46e376;var _0x5527ce={'messageId':_0x363eec[_0x86ea('0x79')][_0x86ea('0x7a')],'read':!![]};return _0x42489e[_0x86ea('0x19')](_0x5527ce);});}else{return logger['error'](_0x86ea('0x2a'),'afterCreate',_0x86ea('0x75'),util[_0x86ea('0x2c')](_0x501aba,{'showHidden':![],'depth':null}));}})[_0x86ea('0x1a')](function(_0x4eb572){return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),_0x86ea('0x75'),util[_0x86ea('0x2c')](_0x4eb572,{'showHidden':![],'depth':null}));});}else{return logger[_0x86ea('0x1b')](_0x86ea('0x2a'),_0x86ea('0x2b'),'intelepeer','Token\x20not\x20received');}break;}}})[_0x86ea('0x7c')](function(){_0x150b5b();});}else{_0x150b5b();}}},'charset':'utf8mb4','collate':_0x86ea('0x7d')});}; \ No newline at end of file +var _0x1fcf=['session_key','internal_order_id','skebby','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','read','connectel','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/status?token=','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','digest','hex','/external/get/send.php?','csc','clickatell','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','Missing\x20parameters:\x20username,\x20password','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','type','twilio','authToken','phone','accountSid','messages','create','remote','/api/sms/messages/','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key'];(function(_0x3d3d7b,_0x5c0937){var _0x33e7c8=function(_0xe0ee81){while(--_0xe0ee81){_0x3d3d7b['push'](_0x3d3d7b['shift']());}};_0x33e7c8(++_0x5c0937);}(_0x1fcf,0x1c4));var _0xf1fc=function(_0x400347,_0x1cbcc1){_0x400347=_0x400347-0x0;var _0x52a0fb=_0x1fcf[_0x400347];return _0x52a0fb;};'use strict';var _=require(_0xf1fc('0x0'));var util=require(_0xf1fc('0x1'));var logger=require(_0xf1fc('0x2'))(_0xf1fc('0x3'));var moment=require(_0xf1fc('0x4'));var BPromise=require(_0xf1fc('0x5'));var rp=require(_0xf1fc('0x6'));var fs=require('fs');var path=require(_0xf1fc('0x7'));var rimraf=require(_0xf1fc('0x8'));var config=require(_0xf1fc('0x9'));var attributes=require(_0xf1fc('0xa'));module['exports']=function(_0x5aa6e2,_0x23dfe5){return _0x5aa6e2[_0xf1fc('0xb')](_0xf1fc('0xc'),attributes,{'tableName':_0xf1fc('0xd'),'paranoid':![],'indexes':[{'name':_0xf1fc('0xe'),'fields':[_0xf1fc('0xe')]},{'name':'fti_sms_messages','fields':[_0xf1fc('0xf')],'type':_0xf1fc('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c980e,_0x3729c2,_0x25ae8a){var _0x55b3a8=_0x5aa6e2[_0xf1fc('0x11')];var _0x476b31=_0x2c980e[_0xf1fc('0x12')]({'plain':!![]});if(_0x476b31[_0xf1fc('0x13')][_0xf1fc('0x14')]()==='in'||_0x476b31[_0xf1fc('0x13')][_0xf1fc('0x14')]()===_0xf1fc('0x15')&&!_0x476b31['secret']&&!_[_0xf1fc('0x16')](_0x476b31[_0xf1fc('0x17')])&&!_['isNil'](_0x476b31['SmsInteractionId'])){_0x55b3a8[_0xf1fc('0x18')]['findOne']({'where':{'id':_0x476b31[_0xf1fc('0x19')]}})[_0xf1fc('0x1a')](function(_0x387b46){if(_0x387b46){_0x387b46[_0xf1fc('0x1b')]({'lastMsgAt':_0x476b31[_0xf1fc('0x1c')],'lastMsgDirection':_0x476b31['direction'][_0xf1fc('0x14')]()});}})[_0xf1fc('0x1d')](function(_0x1b14c6){console[_0xf1fc('0x1e')](_0x1b14c6);});}if(_0x476b31[_0xf1fc('0x13')]===_0xf1fc('0x15')&&!_0x476b31['secret']){var _0x1d7d58;_0x55b3a8[_0xf1fc('0x1f')][_0xf1fc('0x20')]({'where':{'id':_0x476b31['SmsAccountId']},'raw':!![]})[_0xf1fc('0x1a')](function(_0x56e1b2){_0x1d7d58=_0x56e1b2;if(_0x1d7d58&&_0x1d7d58[_0xf1fc('0x21')]){switch(_0x1d7d58[_0xf1fc('0x21')]){case'twilio':var _0x8a887f=require(_0xf1fc('0x22'));if(_0x1d7d58['accountSid']&&_0x1d7d58[_0xf1fc('0x23')]&&_0x1d7d58[_0xf1fc('0x24')]){var _0x106b11=new _0x8a887f(_0x1d7d58[_0xf1fc('0x25')],_0x1d7d58[_0xf1fc('0x23')]);_0x106b11[_0xf1fc('0x26')][_0xf1fc('0x27')]({'body':_0x476b31[_0xf1fc('0xf')],'to':_0x476b31[_0xf1fc('0x24')],'from':_0x1d7d58[_0xf1fc('0x24')],'statusCallback':_0x1d7d58[_0xf1fc('0x28')]+_0xf1fc('0x29')+_0x476b31['id']+'/status?token='+_0x1d7d58[_0xf1fc('0x2a')]})['then'](function(_0x1f85f1){if(_0x1f85f1[_0xf1fc('0x2b')]){return _0x2c980e[_0xf1fc('0x1b')]({'messageId':_0x1f85f1[_0xf1fc('0x2b')]});}})[_0xf1fc('0x1d')](function(_0x46d6e3){logger[_0xf1fc('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf1fc('0x2c'),_0xf1fc('0x22'),util[_0xf1fc('0x2d')](_0x46d6e3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x22'),_0xf1fc('0x2f'));}break;case'skebby':var _0x28e823=_0xf1fc('0x30');if(_0x1d7d58[_0xf1fc('0x31')]&&_0x1d7d58[_0xf1fc('0x32')]){var _0xaaa4da={'recipient':[_0x476b31[_0xf1fc('0x24')]],'message':_0x476b31['body'],'message_type':_0x1d7d58[_0xf1fc('0x33')]};if(_0x1d7d58['smsMethod']&&_0x1d7d58[_0xf1fc('0x33')]!=='SI'){_0xaaa4da[_0xf1fc('0x34')]=_0x1d7d58[_0xf1fc('0x24')];}var _0x133ceb={'url':_0x28e823+_0xf1fc('0x35')+_0x1d7d58['username']+_0xf1fc('0x36')+_0x1d7d58['password'],'method':_0xf1fc('0x37')};rp(_0x133ceb)[_0xf1fc('0x1a')](function(_0x4506f2){var _0x2585de=_0x4506f2[_0xf1fc('0x38')](';');var _0x59402d={'user_key':_0x2585de[0x0],'session_key':_0x2585de[0x1]};_0x133ceb={'url':_0x28e823+_0xf1fc('0x39'),'method':_0xf1fc('0x3a'),'headers':{'user_key':_0x59402d[_0xf1fc('0x3b')],'Session_key':_0x59402d[_0xf1fc('0x3c')]},'json':!![],'body':_0xaaa4da};return rp(_0x133ceb);})[_0xf1fc('0x1a')](function(_0xac1750){if(_0xac1750['total_sent']>=0x1){var _0x328952={'messageId':_0xac1750[_0xf1fc('0x3d')]};if(_0x1d7d58['smsMethod']!=='GP'||!_0x1d7d58['deliveryReport']){_0x328952['read']=!![];}return _0x2c980e[_0xf1fc('0x1b')](_0x328952);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf1fc('0x2c'),_0xf1fc('0x3e'),util['inspect'](_0xac1750,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4dfd14){return logger[_0xf1fc('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf1fc('0x2c'),_0xf1fc('0x3e'),util[_0xf1fc('0x2d')](_0x4dfd14,{'showHidden':![],'depth':null}));});}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x1d7d58[_0xf1fc('0x23')]){var _0x2e670b={'recipient':_0x476b31[_0xf1fc('0x24')],'message':_0x476b31[_0xf1fc('0xf')],'sender':_0x1d7d58['senderString']||_0x1d7d58[_0xf1fc('0x24')],'authorization':_0x1d7d58['authToken']};var _0x3729c2={'method':_0xf1fc('0x3a'),'uri':_0xf1fc('0x3f'),'body':_0x2e670b,'json':!![]};rp(_0x3729c2)[_0xf1fc('0x1a')](function(_0x968c2b){var _0x19443a={'messageId':_0x968c2b[_0xf1fc('0x40')]};if(!_0x1d7d58[_0xf1fc('0x41')]){_0x19443a[_0xf1fc('0x42')]=!![];}return _0x2c980e[_0xf1fc('0x1b')](_0x19443a);})[_0xf1fc('0x1d')](function(_0x1c3e06){logger['error'](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x43'),util['inspect'](_0x1c3e06,{'showHidden':![],'depth':null}));});}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),'afterCreate',_0xf1fc('0x43'),'Missing\x20parameters:\x20authToken');}break;case _0xf1fc('0x44'):if(_0x1d7d58[_0xf1fc('0x31')]&&_0x1d7d58[_0xf1fc('0x32')]){var _0x2e670b={'messages':[{'source':_0xf1fc('0x45'),'to':_0x476b31[_0xf1fc('0x24')],'body':_0x476b31['body'],'from':_0x1d7d58[_0xf1fc('0x46')]||_0x1d7d58['phone']}]};var _0x1beea8=util[_0xf1fc('0x47')](_0xf1fc('0x48'),_0x1d7d58['username'],_0x1d7d58['password']);var _0x3729c2={'method':_0xf1fc('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2e670b,'headers':{'Authorization':util[_0xf1fc('0x47')](_0xf1fc('0x49'),new Buffer(_0x1beea8)[_0xf1fc('0x4a')](_0xf1fc('0x4b')))},'json':!![]};rp(_0x3729c2)['then'](function(_0x5d1d8f){if(_0x5d1d8f[_0xf1fc('0x4c')]>=0xc8&&_0x5d1d8f[_0xf1fc('0x4c')]<=0xce){if(_0x5d1d8f[_0xf1fc('0x4d')]&&_0x5d1d8f['data'][_0xf1fc('0x4e')]>0x0){var _0x6ecb2=_[_0xf1fc('0x4f')](_0x5d1d8f[_0xf1fc('0x4d')][_0xf1fc('0x26')]);var _0x2dae10={'messageId':_0x6ecb2[_0xf1fc('0x50')]};if(!_0x1d7d58[_0xf1fc('0x41')]){_0x2dae10['read']=!![];}return _0x2c980e[_0xf1fc('0x1b')](_0x2dae10);}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),'clickSend',util[_0xf1fc('0x2d')](_0x5d1d8f,{'showHidden':![],'depth':null}));}}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x51'),util[_0xf1fc('0x2d')](_0x5d1d8f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5cea18){logger[_0xf1fc('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf1fc('0x51'),util[_0xf1fc('0x2d')](_0x5cea18,{'showHidden':![],'depth':null}));});}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x51'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf1fc('0x52'):if(_0x1d7d58[_0xf1fc('0x53')]&&_0x1d7d58[_0xf1fc('0x23')]){var _0x2e670b={'dst':_0x476b31[_0xf1fc('0x24')],'text':_0x476b31[_0xf1fc('0xf')],'src':_0x1d7d58[_0xf1fc('0x46')]||_0x1d7d58[_0xf1fc('0x24')],'url':_0x1d7d58[_0xf1fc('0x28')]+_0xf1fc('0x29')+_0x476b31['id']+_0xf1fc('0x54')+_0x1d7d58[_0xf1fc('0x2a')]};var _0x1beea8=util[_0xf1fc('0x47')](_0xf1fc('0x48'),_0x1d7d58[_0xf1fc('0x53')],_0x1d7d58[_0xf1fc('0x23')]);var _0x3729c2={'method':_0xf1fc('0x3a'),'uri':util[_0xf1fc('0x47')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1d7d58[_0xf1fc('0x53')]),'body':_0x2e670b,'headers':{'Authorization':util[_0xf1fc('0x47')](_0xf1fc('0x49'),new Buffer(_0x1beea8)[_0xf1fc('0x4a')](_0xf1fc('0x4b')))},'json':!![]};rp(_0x3729c2)[_0xf1fc('0x1a')](function(_0xef4801){var _0x30d7e2={'messageId':_0xef4801[_0xf1fc('0x55')][0x0]};return _0x2c980e[_0xf1fc('0x1b')](_0x30d7e2);})[_0xf1fc('0x1d')](function(_0xc67ef2){logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x52'),util[_0xf1fc('0x2d')](_0xc67ef2,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf1fc('0x2c'),_0xf1fc('0x52'),_0xf1fc('0x56'));}break;case _0xf1fc('0x57'):if(_0x1d7d58[_0xf1fc('0x31')]&&_0x1d7d58[_0xf1fc('0x32')]){if(_0x1d7d58[_0xf1fc('0x58')]){var _0x296256={'method':_0xf1fc('0x3a'),'uri':_0x1d7d58[_0xf1fc('0x58')]+_0xf1fc('0x59'),'body':{'username':_0x1d7d58['username'],'password':_0x1d7d58[_0xf1fc('0x32')]},'json':!![]};return rp(_0x296256)[_0xf1fc('0x1a')](function(_0x21458f){var _0x44faac={'method':_0xf1fc('0x3a'),'uri':_0x1d7d58[_0xf1fc('0x58')]+_0xf1fc('0x5a'),'body':{'messages':[{'from':_0x1d7d58[_0xf1fc('0x24')],'destinations':[{'to':_0x476b31[_0xf1fc('0x24')]}],'text':_0x476b31[_0xf1fc('0xf')],'notifyUrl':_0x1d7d58['remote']+_0xf1fc('0x29')+_0x476b31['id']+_0xf1fc('0x54')+_0x1d7d58['token'],'notifyContentType':_0xf1fc('0x5b'),'callbackData':_0x1d7d58[_0xf1fc('0x24')]+';'+_0x476b31[_0xf1fc('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x21458f[_0xf1fc('0x2a')]},'json':!![]};return rp(_0x44faac)[_0xf1fc('0x1a')](function(_0x2d68cf){if(_0x2d68cf['messages']){var _0x2875d3={'messageId':_0x2d68cf[_0xf1fc('0x26')][0x0]['messageId']};if(!_0x1d7d58[_0xf1fc('0x41')]){_0x2875d3['read']=!![];}return _0x2c980e['update'](_0x2875d3);}else{return logger[_0xf1fc('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf1fc('0x57'),util[_0xf1fc('0x2d')](_0x2d68cf,{'showHidden':![],'depth':null}));}});})[_0xf1fc('0x1d')](function(_0x316c1d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf1fc('0x2c'),_0xf1fc('0x57'),util[_0xf1fc('0x2d')](_0x316c1d,{'showHidden':![],'depth':null}));});}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),'infobip',_0xf1fc('0x5c'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x36bcd1=require(_0xf1fc('0x5d'));if(_0x1d7d58[_0xf1fc('0x5e')]){var _0x2f67a7={};_0x2f67a7[_0xf1fc('0x5f')]=_0x1d7d58[_0xf1fc('0x31')];_0x2f67a7['phone']=_0x476b31[_0xf1fc('0x24')];_0x2f67a7[_0xf1fc('0x34')]=_0x1d7d58[_0xf1fc('0x24')];_0x2f67a7[_0xf1fc('0x60')]=_0x476b31['body'];_0x2f67a7[_0xf1fc('0x61')]=+new Date();var _0x226727='';var _0x1d7a2b='';var _0x2a2c1b=Object[_0xf1fc('0x62')](_0x2f67a7);_0x2a2c1b[_0xf1fc('0x63')]();for(var _0x425bb2=0x0;_0x425bb2<_0x2a2c1b[_0xf1fc('0x64')];_0x425bb2++){if(_0x226727!=''){_0x226727+='&';}_0x226727+=_0x2a2c1b[_0x425bb2]+'='+encodeURIComponent(_0x2f67a7[_0x2a2c1b[_0x425bb2]]);_0x1d7a2b+=_0x2f67a7[_0x2a2c1b[_0x425bb2]];}_0x1d7a2b+=_0x1d7d58[_0xf1fc('0x5e')];_0x1d7a2b=_0x36bcd1[_0xf1fc('0x65')]('md5')[_0xf1fc('0x1b')](_0x1d7a2b)[_0xf1fc('0x66')](_0xf1fc('0x67'));if(_0x226727!==''){_0x226727+='&';}_0x226727+='signature='+_0x1d7a2b;var _0x133ceb={'method':_0xf1fc('0x37'),'uri':_0x1d7d58[_0xf1fc('0x58')]+_0xf1fc('0x68')+_0x226727,'json':!![]};return rp(_0x133ceb)[_0xf1fc('0x1a')](function(_0x2f2abb){var _0x39ce83=Object[_0xf1fc('0x62')](_0x2f2abb);if(_0x2f2abb[_0x39ce83[0x0]][_0xf1fc('0x1e')]&&parseInt(_0x2f2abb[_0x39ce83[0x0]][_0xf1fc('0x1e')])===0x0){var _0x51ad06={'messageId':_0x2f2abb[_0x39ce83[0x0]]['id_sms']};if(!_0x1d7d58['deliveryReport']){_0x51ad06['read']=!![];}return _0x2c980e[_0xf1fc('0x1b')](_0x51ad06);}else{return logger['error'](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x69'),util[_0xf1fc('0x2d')](_0x2f2abb[_0xf1fc('0x1e')],{'showHidden':![],'depth':null}));}})[_0xf1fc('0x1d')](function(_0x18a44b){return logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),'csc',util[_0xf1fc('0x2d')](_0x18a44b,{'showHidden':![],'depth':null}));});}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x69'),'Missing\x20parameters:\x20apiKey');}break;case _0xf1fc('0x6a'):if(_0x1d7d58[_0xf1fc('0x5e')]){var _0x31b986={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x1d7d58[_0xf1fc('0x5e')]},'body':{'content':_0x476b31['body'],'to':[_0x476b31['phone']],'from':_0x1d7d58[_0xf1fc('0x24')],'binary':![],'clientMessageId':_0xf1fc('0x6b'),'charset':_0xf1fc('0x6c')},'json':!![]};rp(_0x31b986)['then'](function(_0x5639ad){if(!_0x5639ad[_0xf1fc('0x1e')]){var _0x409218={'messageId':_0x5639ad['messages'][0x0][_0xf1fc('0x6d')]};if(!_0x1d7d58[_0xf1fc('0x41')]){_0x409218[_0xf1fc('0x42')]=!![];}return _0x2c980e[_0xf1fc('0x1b')](_0x409218);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf1fc('0x2c'),_0xf1fc('0x6a'),util[_0xf1fc('0x2d')](_0x5639ad[_0xf1fc('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3b10e7){return logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x6a'),util[_0xf1fc('0x2d')](_0x3b10e7,{'showHidden':![],'depth':null}));});}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x1d7d58[_0xf1fc('0x31')]&&_0x1d7d58[_0xf1fc('0x32')]){var _0x1beea8=util[_0xf1fc('0x47')](_0xf1fc('0x48'),_0x1d7d58[_0xf1fc('0x31')],_0x1d7d58[_0xf1fc('0x32')]);var _0x3729c2={'method':_0xf1fc('0x3a'),'uri':_0xf1fc('0x6e')+_0x1d7d58[_0xf1fc('0x6f')]+_0xf1fc('0x70'),'body':{'to':[_0x476b31[_0xf1fc('0x24')]],'text':_0x476b31[_0xf1fc('0xf')],'from':_0x1d7d58[_0xf1fc('0x24')],'applicationId':_0x1d7d58[_0xf1fc('0x71')]},'headers':{'Authorization':util[_0xf1fc('0x47')]('Basic\x20%s',new Buffer(_0x1beea8)[_0xf1fc('0x4a')](_0xf1fc('0x4b')))},'json':!![]};rp(_0x3729c2)[_0xf1fc('0x1a')](function(_0x3c1613){if(_0x3c1613['id']){var _0x3a5c62={'messageId':_0x3c1613['id']};return _0x2c980e[_0xf1fc('0x1b')](_0x3a5c62);}else{logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),_0xf1fc('0x2c'),_0xf1fc('0x72'),util['inspect'](_0x3c1613,{'showHidden':![],'depth':null}));}})[_0xf1fc('0x1d')](function(_0x4dcf8e){logger['error'](_0xf1fc('0x2e'),_0xf1fc('0x2c'),'bandwidth',util[_0xf1fc('0x2d')](_0x4dcf8e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf1fc('0x2e'),_0xf1fc('0x2c'),'bandwidth',_0xf1fc('0x73'));}break;case _0xf1fc('0x74'):if(_0x1d7d58['apiKey']){var _0x4201d7={};var _0x133ceb={'method':_0xf1fc('0x3a'),'uri':_0xf1fc('0x75'),'headers':{'Authorization':_0xf1fc('0x76')+_0x1d7d58[_0xf1fc('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x1d7d58[_0xf1fc('0x24')],'to':_0x476b31['phone'],'text':_0x476b31['body']},'json':!![]};return rp(_0x133ceb)[_0xf1fc('0x1a')](function(_0x484176){if(_0x484176[_0xf1fc('0x77')]==0xca){_0x4201d7[_0xf1fc('0x78')]=_0x484176;var _0x5d7903={'method':_0xf1fc('0x3a'),'uri':_0xf1fc('0x79'),'headers':{'Authorization':_0xf1fc('0x76')+_0x1d7d58['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x4201d7[_0xf1fc('0x78')][_0xf1fc('0x7a')]},'json':!![]};return rp(_0x5d7903)[_0xf1fc('0x1a')](function(_0x15f4f0){_0x4201d7[_0xf1fc('0x7b')]=_0x15f4f0;var _0x39a7b5={'messageId':_0x4201d7['message'][_0xf1fc('0x7a')],'read':!![]};return _0x2c980e['update'](_0x39a7b5);});}else{return logger[_0xf1fc('0x1e')](_0xf1fc('0x2e'),'afterCreate',_0xf1fc('0x74'),util[_0xf1fc('0x2d')](_0x484176,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4b94a3){return logger[_0xf1fc('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf1fc('0x2c'),_0xf1fc('0x74'),util['inspect'](_0x4b94a3,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xf1fc('0x2e'),'afterCreate','intelepeer',_0xf1fc('0x7c'));}break;}}})[_0xf1fc('0x7d')](function(){_0x25ae8a();});}else{_0x25ae8a();}}},'charset':_0xf1fc('0x7e'),'collate':_0xf1fc('0x7f')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 2ed08b4..52acf2e 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 _0x3384=['register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter'];(function(_0x46c512,_0x15f541){var _0x1532c3=function(_0xa868f5){while(--_0xa868f5){_0x46c512['push'](_0x46c512['shift']());}};_0x1532c3(++_0x15f541);}(_0x3384,0x1aa));var _0x4338=function(_0x2ed6e0,_0x5571c0){_0x2ed6e0=_0x2ed6e0-0x0;var _0x3df63d=_0x3384[_0x2ed6e0];return _0x3df63d;};'use strict';var _=require('lodash');var util=require(_0x4338('0x0'));var moment=require(_0x4338('0x1'));var BPromise=require(_0x4338('0x2'));var rs=require(_0x4338('0x3'));var fs=require('fs');var Redis=require(_0x4338('0x4'));var db=require(_0x4338('0x5'))['db'];var utils=require(_0x4338('0x6'));var logger=require(_0x4338('0x7'))(_0x4338('0x8'));var config=require(_0x4338('0x9'));var jayson=require(_0x4338('0xa'));var client=jayson[_0x4338('0xb')][_0x4338('0xc')]({'port':0x232a});config['redis']=_[_0x4338('0xd')](config[_0x4338('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x4338('0xf'))(new Redis(config[_0x4338('0xe')]));require('./smsMessage.socket')[_0x4338('0x10')](socket);function respondWithRpcPromise(_0x226ae1,_0x5c6e09,_0x3a0bc3){return new BPromise(function(_0x5e2668,_0x4c7587){return client[_0x4338('0x11')](_0x226ae1,_0x3a0bc3)[_0x4338('0x12')](function(_0x2b4d93){logger['info'](_0x4338('0x13'),_0x5c6e09,_0x4338('0x14'));logger[_0x4338('0x15')](_0x4338('0x16'),_0x5c6e09,_0x4338('0x14'),JSON[_0x4338('0x17')](_0x2b4d93));if(_0x2b4d93[_0x4338('0x18')]){if(_0x2b4d93[_0x4338('0x18')]['code']===0x1f4){logger[_0x4338('0x18')](_0x4338('0x13'),_0x5c6e09,_0x2b4d93[_0x4338('0x18')]['message']);return _0x4c7587(_0x2b4d93['error']['message']);}logger[_0x4338('0x18')](_0x4338('0x13'),_0x5c6e09,_0x2b4d93[_0x4338('0x18')]['message']);return _0x5e2668(_0x2b4d93[_0x4338('0x18')][_0x4338('0x19')]);}else{logger[_0x4338('0x1a')](_0x4338('0x13'),_0x5c6e09,_0x4338('0x14'));_0x5e2668(_0x2b4d93[_0x4338('0x1b')][_0x4338('0x19')]);}})[_0x4338('0x1c')](function(_0x21247a){logger[_0x4338('0x18')](_0x4338('0x13'),_0x5c6e09,_0x21247a);_0x4c7587(_0x21247a);});});}exports[_0x4338('0x1d')]=function(_0x3f6cdb){var _0x42416f=this;return new Promise(function(_0x2c8530,_0x3799f6){return db[_0x4338('0x1e')]['create'](_0x3f6cdb[_0x4338('0x1f')],{'raw':_0x3f6cdb[_0x4338('0x20')]?_0x3f6cdb[_0x4338('0x20')][_0x4338('0x21')]===undefined?!![]:![]:!![]})[_0x4338('0x12')](function(_0x6c0e0f){logger['info'](_0x4338('0x1d'),_0x3f6cdb);logger[_0x4338('0x15')](_0x4338('0x1d'),_0x3f6cdb,JSON[_0x4338('0x17')](_0x6c0e0f));_0x2c8530(_0x6c0e0f);})[_0x4338('0x1c')](function(_0x5b32fd){logger[_0x4338('0x18')](_0x4338('0x1d'),_0x5b32fd[_0x4338('0x19')],_0x3f6cdb);_0x3799f6(_0x42416f[_0x4338('0x18')](0x1f4,_0x5b32fd[_0x4338('0x19')]));});});}; \ No newline at end of file +var _0x907c=['SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSmsMessage','SmsMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info'];(function(_0x240376,_0x434c95){var _0x3d9582=function(_0x54cf7f){while(--_0x54cf7f){_0x240376['push'](_0x240376['shift']());}};_0x3d9582(++_0x434c95);}(_0x907c,0x1bf));var _0xc907=function(_0x5322cf,_0x246e56){_0x5322cf=_0x5322cf-0x0;var _0xf74f1c=_0x907c[_0x5322cf];return _0xf74f1c;};'use strict';var _=require(_0xc907('0x0'));var util=require(_0xc907('0x1'));var moment=require(_0xc907('0x2'));var BPromise=require(_0xc907('0x3'));var rs=require(_0xc907('0x4'));var fs=require('fs');var Redis=require(_0xc907('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc907('0x6'));var logger=require(_0xc907('0x7'))(_0xc907('0x8'));var config=require(_0xc907('0x9'));var jayson=require(_0xc907('0xa'));var client=jayson['client'][_0xc907('0xb')]({'port':0x232a});config[_0xc907('0xc')]=_[_0xc907('0xd')](config[_0xc907('0xc')],{'host':_0xc907('0xe'),'port':0x18eb});var socket=require(_0xc907('0xf'))(new Redis(config[_0xc907('0xc')]));require(_0xc907('0x10'))[_0xc907('0x11')](socket);function respondWithRpcPromise(_0x30d13e,_0x357196,_0x15bef0){return new BPromise(function(_0x3cfe4b,_0x5a838c){return client[_0xc907('0x12')](_0x30d13e,_0x15bef0)[_0xc907('0x13')](function(_0x3c12ba){logger[_0xc907('0x14')](_0xc907('0x15'),_0x357196,_0xc907('0x16'));logger[_0xc907('0x17')](_0xc907('0x18'),_0x357196,_0xc907('0x16'),JSON[_0xc907('0x19')](_0x3c12ba));if(_0x3c12ba['error']){if(_0x3c12ba[_0xc907('0x1a')][_0xc907('0x1b')]===0x1f4){logger[_0xc907('0x1a')](_0xc907('0x15'),_0x357196,_0x3c12ba[_0xc907('0x1a')]['message']);return _0x5a838c(_0x3c12ba[_0xc907('0x1a')][_0xc907('0x1c')]);}logger['error'](_0xc907('0x15'),_0x357196,_0x3c12ba[_0xc907('0x1a')][_0xc907('0x1c')]);return _0x3cfe4b(_0x3c12ba[_0xc907('0x1a')][_0xc907('0x1c')]);}else{logger[_0xc907('0x14')](_0xc907('0x15'),_0x357196,_0xc907('0x16'));_0x3cfe4b(_0x3c12ba['result'][_0xc907('0x1c')]);}})['catch'](function(_0xb4042b){logger[_0xc907('0x1a')](_0xc907('0x15'),_0x357196,_0xb4042b);_0x5a838c(_0xb4042b);});});}exports[_0xc907('0x1d')]=function(_0x3f6eb6){var _0x2a61df=this;return new Promise(function(_0x111391,_0x45cbbb){return db[_0xc907('0x1e')][_0xc907('0x1f')](_0x3f6eb6[_0xc907('0x20')],{'raw':_0x3f6eb6[_0xc907('0x21')]?_0x3f6eb6['options'][_0xc907('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x20fd59){logger[_0xc907('0x14')](_0xc907('0x1d'),_0x3f6eb6);logger[_0xc907('0x17')](_0xc907('0x1d'),_0x3f6eb6,JSON[_0xc907('0x19')](_0x20fd59));_0x111391(_0x20fd59);})[_0xc907('0x23')](function(_0x557208){logger['error']('CreateSmsMessage',_0x557208[_0xc907('0x1c')],_0x3f6eb6);_0x45cbbb(_0x2a61df[_0xc907('0x1a')](0x1f4,_0x557208['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 9215b95..c7dffb3 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 _0x38e0=['register','length','smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener'];(function(_0x204248,_0xb04da1){var _0x323175=function(_0x935500){while(--_0x935500){_0x204248['push'](_0x204248['shift']());}};_0x323175(++_0xb04da1);}(_0x38e0,0xae));var _0x038e=function(_0x159c12,_0x44591c){_0x159c12=_0x159c12-0x0;var _0x196cd3=_0x38e0[_0x159c12];return _0x196cd3;};'use strict';var SmsMessageEvents=require(_0x038e('0x0'));var events=[_0x038e('0x1'),_0x038e('0x2'),_0x038e('0x3')];function createListener(_0x479a75,_0xe4d838){return function(_0x88d702){_0xe4d838[_0x038e('0x4')](_0x479a75,_0x88d702);};}function removeListener(_0xac2b5c,_0x452e47){return function(){SmsMessageEvents[_0x038e('0x5')](_0xac2b5c,_0x452e47);};}exports[_0x038e('0x6')]=function(_0x5ba328){for(var _0x8b58=0x0,_0x5a629c=events[_0x038e('0x7')];_0x8b58<_0x5a629c;_0x8b58++){var _0x539c99=events[_0x8b58];var _0x55e03b=createListener(_0x038e('0x8')+_0x539c99,_0x5ba328);SmsMessageEvents['on'](_0x539c99,_0x55e03b);}}; \ No newline at end of file +var _0xc283=['remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0xc283,0x1ed));var _0x3c28=function(_0x4c3541,_0x404ed4){_0x4c3541=_0x4c3541-0x0;var _0x18fc7e=_0xc283[_0x4c3541];return _0x18fc7e;};'use strict';var SmsMessageEvents=require(_0x3c28('0x0'));var events=[_0x3c28('0x1'),_0x3c28('0x2'),_0x3c28('0x3')];function createListener(_0x2eaef3,_0x308517){return function(_0xb22392){_0x308517[_0x3c28('0x4')](_0x2eaef3,_0xb22392);};}function removeListener(_0x3940c9,_0x13a7c5){return function(){SmsMessageEvents[_0x3c28('0x5')](_0x3940c9,_0x13a7c5);};}exports[_0x3c28('0x6')]=function(_0x285a70){for(var _0x265f61=0x0,_0x54b860=events[_0x3c28('0x7')];_0x265f61<_0x54b860;_0x265f61++){var _0x9f7a0b=events[_0x265f61];var _0x101bb4=createListener(_0x3c28('0x8')+_0x9f7a0b,_0x285a70);SmsMessageEvents['on'](_0x9f7a0b,_0x101bb4);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index fd86c30..7ce4ae7 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 _0x4d80=['../../config/environment','isAuthenticated','index','get','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','delete','destroy','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3219ed,_0x441891){var _0xe0783a=function(_0x4b666e){while(--_0x4b666e){_0x3219ed['push'](_0x3219ed['shift']());}};_0xe0783a(++_0x441891);}(_0x4d80,0x1d7));var _0x04d8=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4d80[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x04d8('0x0'));var util=require(_0x04d8('0x1'));var path=require(_0x04d8('0x2'));var timeout=require(_0x04d8('0x3'));var express=require(_0x04d8('0x4'));var router=express[_0x04d8('0x5')]();var fs_extra=require(_0x04d8('0x6'));var auth=require(_0x04d8('0x7'));var interaction=require(_0x04d8('0x8'));var config=require(_0x04d8('0x9'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x04d8('0xa')](),controller[_0x04d8('0xb')]);router[_0x04d8('0xc')](_0x04d8('0xd'),auth['isAuthenticated'](),controller[_0x04d8('0xe')]);router[_0x04d8('0xc')]('/:id',auth[_0x04d8('0xa')](),controller[_0x04d8('0xf')]);router[_0x04d8('0xc')](_0x04d8('0x10'),auth[_0x04d8('0xa')](),controller[_0x04d8('0x11')]);router['get'](_0x04d8('0x12'),auth[_0x04d8('0xa')](),controller[_0x04d8('0x13')]);router[_0x04d8('0xc')](_0x04d8('0x14'),auth['isAuthenticated'](),controller[_0x04d8('0x15')]);router[_0x04d8('0x16')]('/',auth[_0x04d8('0xa')](),controller['create']);router[_0x04d8('0x16')](_0x04d8('0x12'),auth[_0x04d8('0xa')](),controller[_0x04d8('0x17')]);router['post'](_0x04d8('0x14'),auth['isAuthenticated'](),controller[_0x04d8('0x18')]);router[_0x04d8('0x19')](_0x04d8('0x1a'),auth[_0x04d8('0xa')](),controller['update']);router[_0x04d8('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x04d8('0x1c')]);router[_0x04d8('0x1b')](_0x04d8('0x12'),auth['isAuthenticated'](),controller[_0x04d8('0x1d')]);router[_0x04d8('0x1b')](_0x04d8('0x14'),auth[_0x04d8('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xef17=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id/members','getMembers','getTeams','/:id/users','create','post','/:id/teams','addTeams','addAgents','put','/:id','update','delete','destroy'];(function(_0x333db6,_0x4fde9e){var _0x59c239=function(_0x56f21b){while(--_0x56f21b){_0x333db6['push'](_0x333db6['shift']());}};_0x59c239(++_0x4fde9e);}(_0xef17,0x158));var _0x7ef1=function(_0x5bfd92,_0x2802c5){_0x5bfd92=_0x5bfd92-0x0;var _0xacb8f0=_0xef17[_0x5bfd92];return _0xacb8f0;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var fs_extra=require(_0x7ef1('0x6'));var auth=require(_0x7ef1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7ef1('0x8'));var controller=require('./smsQueue.controller');router[_0x7ef1('0x9')]('/',auth['isAuthenticated'](),controller[_0x7ef1('0xa')]);router[_0x7ef1('0x9')](_0x7ef1('0xb'),auth[_0x7ef1('0xc')](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0x9')]('/:id',auth[_0x7ef1('0xc')](),controller['show']);router[_0x7ef1('0x9')](_0x7ef1('0xe'),auth['isAuthenticated'](),controller[_0x7ef1('0xf')]);router[_0x7ef1('0x9')]('/:id/teams',auth[_0x7ef1('0xc')](),controller[_0x7ef1('0x10')]);router[_0x7ef1('0x9')](_0x7ef1('0x11'),auth[_0x7ef1('0xc')](),controller['getAgents']);router['post']('/',auth[_0x7ef1('0xc')](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x13')](_0x7ef1('0x14'),auth[_0x7ef1('0xc')](),controller[_0x7ef1('0x15')]);router[_0x7ef1('0x13')]('/:id/users',auth[_0x7ef1('0xc')](),controller[_0x7ef1('0x16')]);router[_0x7ef1('0x17')](_0x7ef1('0x18'),auth[_0x7ef1('0xc')](),controller[_0x7ef1('0x19')]);router[_0x7ef1('0x1a')](_0x7ef1('0x18'),auth[_0x7ef1('0xc')](),controller[_0x7ef1('0x1b')]);router[_0x7ef1('0x1a')](_0x7ef1('0x14'),auth[_0x7ef1('0xc')](),controller[_0x7ef1('0x1c')]);router[_0x7ef1('0x1a')](_0x7ef1('0x11'),auth[_0x7ef1('0xc')](),controller[_0x7ef1('0x1d')]);module[_0x7ef1('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 5161da8..967f358 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 _0xb400=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x19cfac,_0x3745dc){var _0x25d2a5=function(_0x2bad78){while(--_0x2bad78){_0x19cfac['push'](_0x19cfac['shift']());}};_0x25d2a5(++_0x3745dc);}(_0xb400,0xc8));var _0x0b40=function(_0x595d5c,_0x29c0b4){_0x595d5c=_0x595d5c-0x0;var _0x55d05b=_0xb400[_0x595d5c];return _0x55d05b;};'use strict';var Sequelize=require(_0x0b40('0x0'));module[_0x0b40('0x1')]={'name':{'type':Sequelize[_0x0b40('0x2')],'unique':_0x0b40('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0b40('0x2')]},'timeout':{'type':Sequelize[_0x0b40('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b40('0x5')](_0x0b40('0x6'),_0x0b40('0x7'),_0x0b40('0x8'))}}; \ No newline at end of file +var _0x1760=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x26fbd9,_0x159518){var _0xb3e5d5=function(_0x39a4aa){while(--_0x39a4aa){_0x26fbd9['push'](_0x26fbd9['shift']());}};_0xb3e5d5(++_0x159518);}(_0x1760,0x9a));var _0x0176=function(_0x4690c7,_0x300faf){_0x4690c7=_0x4690c7-0x0;var _0x6912ab=_0x1760[_0x4690c7];return _0x6912ab;};'use strict';var Sequelize=require(_0x0176('0x0'));module[_0x0176('0x1')]={'name':{'type':Sequelize[_0x0176('0x2')],'unique':_0x0176('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0176('0x2')]},'timeout':{'type':Sequelize[_0x0176('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0176('0x5')](_0x0176('0x6'),'beepall',_0x0176('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 811dc33..0481d2a 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 _0x5f63=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','save','then','get','SmsQueues','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','SmsQueue','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','update','params','destroy','describe','findOne','SmsQueueId','UserSmsQueue','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','emit','addAgents','omit','userSmsQueue:remove','getAgents','eml-format'];(function(_0x432a54,_0x3465e1){var _0x1f02dc=function(_0x1496ae){while(--_0x1496ae){_0x432a54['push'](_0x432a54['shift']());}};_0x1f02dc(++_0x3465e1);}(_0x5f63,0x117));var _0x35f6=function(_0xf55841,_0x3a0b8e){_0xf55841=_0xf55841-0x0;var _0x1afe9e=_0x5f63[_0xf55841];return _0x1afe9e;};'use strict';var emlformat=require(_0x35f6('0x0'));var rimraf=require(_0x35f6('0x1'));var zipdir=require(_0x35f6('0x2'));var jsonpatch=require(_0x35f6('0x3'));var rp=require(_0x35f6('0x4'));var moment=require(_0x35f6('0x5'));var BPromise=require(_0x35f6('0x6'));var Mustache=require(_0x35f6('0x7'));var util=require('util');var path=require(_0x35f6('0x8'));var sox=require(_0x35f6('0x9'));var csv=require(_0x35f6('0xa'));var ejs=require(_0x35f6('0xb'));var fs=require('fs');var fs_extra=require(_0x35f6('0xc'));var _=require(_0x35f6('0xd'));var squel=require('squel');var crypto=require(_0x35f6('0xe'));var jsforce=require(_0x35f6('0xf'));var deskjs=require(_0x35f6('0x10'));var toCsv=require(_0x35f6('0xa'));var querystring=require(_0x35f6('0x11'));var Papa=require(_0x35f6('0x12'));var Redis=require(_0x35f6('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35f6('0x14'));var logger=require(_0x35f6('0x15'))(_0x35f6('0x16'));var utils=require('../../config/utils');var config=require(_0x35f6('0x17'));var licenseUtil=require(_0x35f6('0x18'));var db=require(_0x35f6('0x19'))['db'];config[_0x35f6('0x1a')]=_[_0x35f6('0x1b')](config[_0x35f6('0x1a')],{'host':_0x35f6('0x1c'),'port':0x18eb});var socket=require(_0x35f6('0x1d'))(new Redis(config[_0x35f6('0x1a')]));require('./smsQueue.socket')[_0x35f6('0x1e')](socket);function respondWithStatusCode(_0x12f620,_0x5a2276){_0x5a2276=_0x5a2276||0xcc;return function(_0x51320f){if(_0x51320f){return _0x12f620[_0x35f6('0x1f')](_0x5a2276);}return _0x12f620[_0x35f6('0x20')](_0x5a2276)[_0x35f6('0x21')]();};}function respondWithResult(_0x26bf06,_0x593f46){_0x593f46=_0x593f46||0xc8;return function(_0x51c574){if(_0x51c574){return _0x26bf06[_0x35f6('0x20')](_0x593f46)['json'](_0x51c574);}};}function respondWithFilteredResult(_0x557a1b,_0x403f91){return function(_0x457f55){if(_0x457f55){var _0x2e2673=typeof _0x403f91['offset']===_0x35f6('0x22')&&typeof _0x403f91[_0x35f6('0x23')]===_0x35f6('0x22');var _0x10cdae=_0x457f55['count'];var _0x310aad=_0x2e2673?0x0:_0x403f91[_0x35f6('0x24')];var _0x28ee49=_0x2e2673?_0x457f55[_0x35f6('0x25')]:_0x403f91[_0x35f6('0x24')]+_0x403f91['limit'];var _0xee7609;if(_0x28ee49>=_0x10cdae){_0x28ee49=_0x10cdae;_0xee7609=0xc8;}else{_0xee7609=0xce;}_0x557a1b['status'](_0xee7609);return _0x557a1b[_0x35f6('0x26')](_0x35f6('0x27'),_0x310aad+'-'+_0x28ee49+'/'+_0x10cdae)[_0x35f6('0x28')](_0x457f55);}return null;};}function patchUpdates(_0x340f82){return function(_0x4a155c){try{jsonpatch['apply'](_0x4a155c,_0x340f82,!![]);}catch(_0x356812){return BPromise[_0x35f6('0x29')](_0x356812);}return _0x4a155c[_0x35f6('0x2a')]();};}function saveUpdates(_0x43019,_0x5addfc){return function(_0x17c0b5){if(_0x17c0b5){return _0x17c0b5['update'](_0x43019)['then'](function(_0x2b18ee){return _0x2b18ee;});}return null;};}function removeEntity(_0x47d564,_0x4ec963){return function(_0x2e3820){if(_0x2e3820){return _0x2e3820['destroy']()[_0x35f6('0x2b')](function(){var _0xe2b689=_0x2e3820[_0x35f6('0x2c')]({'plain':!![]});var _0x5d3e54=_0x35f6('0x2d');return db[_0x35f6('0x2e')]['destroy']({'where':{'type':_0x5d3e54,'resourceId':_0xe2b689['id']}})['then'](function(){return _0x2e3820;});})[_0x35f6('0x2b')](function(){_0x47d564[_0x35f6('0x20')](0xcc)[_0x35f6('0x21')]();});}};}function handleEntityNotFound(_0x25f161,_0x53edb8){return function(_0x308836){if(!_0x308836){_0x25f161[_0x35f6('0x1f')](0x194);}return _0x308836;};}function handleError(_0x40b0ec,_0x94d606){_0x94d606=_0x94d606||0x1f4;return function(_0x75cb39){logger[_0x35f6('0x2f')](_0x75cb39[_0x35f6('0x30')]);if(_0x75cb39[_0x35f6('0x31')]){delete _0x75cb39[_0x35f6('0x31')];}_0x40b0ec['status'](_0x94d606)['send'](_0x75cb39);};}exports['index']=function(_0x3f5af7,_0x141890){var _0x3478d6={},_0xf99ea4={},_0x316cc8={'count':0x0,'rows':[]};var _0x15ad4b=_[_0x35f6('0x32')](db['SmsQueue'][_0x35f6('0x33')],function(_0x38dc7a){return{'name':_0x38dc7a[_0x35f6('0x34')],'type':_0x38dc7a['type'][_0x35f6('0x35')]};});_0xf99ea4['model']=_[_0x35f6('0x32')](_0x15ad4b,'name');_0xf99ea4[_0x35f6('0x36')]=_[_0x35f6('0x37')](_0x3f5af7[_0x35f6('0x36')]);_0xf99ea4['filters']=_[_0x35f6('0x38')](_0xf99ea4[_0x35f6('0x39')],_0xf99ea4[_0x35f6('0x36')]);_0x3478d6['attributes']=_['intersection'](_0xf99ea4['model'],qs[_0x35f6('0x3a')](_0x3f5af7[_0x35f6('0x36')]['fields']));_0x3478d6[_0x35f6('0x3b')]=_0x3478d6['attributes'][_0x35f6('0x3c')]?_0x3478d6[_0x35f6('0x3b')]:_0xf99ea4[_0x35f6('0x39')];if(!_0x3f5af7[_0x35f6('0x36')][_0x35f6('0x3d')](_0x35f6('0x3e'))){_0x3478d6[_0x35f6('0x23')]=qs[_0x35f6('0x23')](_0x3f5af7[_0x35f6('0x36')][_0x35f6('0x23')]);_0x3478d6['offset']=qs[_0x35f6('0x24')](_0x3f5af7[_0x35f6('0x36')]['offset']);}_0x3478d6[_0x35f6('0x3f')]=qs[_0x35f6('0x40')](_0x3f5af7['query'][_0x35f6('0x40')]);_0x3478d6[_0x35f6('0x41')]=qs[_0x35f6('0x42')](_[_0x35f6('0x43')](_0x3f5af7[_0x35f6('0x36')],_0xf99ea4[_0x35f6('0x42')]),_0x15ad4b);if(_0x3f5af7['query'][_0x35f6('0x44')]){_0x3478d6[_0x35f6('0x41')]=_[_0x35f6('0x45')](_0x3478d6[_0x35f6('0x41')],{'$or':_['map'](_0x15ad4b,function(_0x4e97ad){if(_0x4e97ad['type']!=='VIRTUAL'){var _0x28b7aa={};_0x28b7aa[_0x4e97ad[_0x35f6('0x31')]]={'$like':'%'+_0x3f5af7[_0x35f6('0x36')][_0x35f6('0x44')]+'%'};return _0x28b7aa;}})});}_0x3478d6=_[_0x35f6('0x45')]({},_0x3478d6,_0x3f5af7[_0x35f6('0x46')]);var _0x30594b={'where':_0x3478d6['where']};return db['SmsQueue'][_0x35f6('0x25')](_0x30594b)[_0x35f6('0x2b')](function(_0x321173){_0x316cc8[_0x35f6('0x25')]=_0x321173;if(_0x3f5af7['query'][_0x35f6('0x47')]){_0x3478d6[_0x35f6('0x48')]=[{'all':!![]}];}return db[_0x35f6('0x49')]['findAll'](_0x3478d6);})['then'](function(_0x477786){_0x316cc8[_0x35f6('0x4a')]=_0x477786;return _0x316cc8;})['then'](respondWithFilteredResult(_0x141890,_0x3478d6))[_0x35f6('0x4b')](handleError(_0x141890,null));};exports[_0x35f6('0x4c')]=function(_0x82d4e9,_0x2d6b04){var _0x73a7d6={'raw':!![],'where':{'id':_0x82d4e9['params']['id']}},_0x2b3868={};_0x2b3868[_0x35f6('0x39')]=_[_0x35f6('0x37')](db['SmsQueue']['rawAttributes']);_0x2b3868[_0x35f6('0x36')]=_['keys'](_0x82d4e9[_0x35f6('0x36')]);_0x2b3868[_0x35f6('0x42')]=_[_0x35f6('0x38')](_0x2b3868['model'],_0x2b3868[_0x35f6('0x36')]);_0x73a7d6[_0x35f6('0x3b')]=_[_0x35f6('0x38')](_0x2b3868[_0x35f6('0x39')],qs['fields'](_0x82d4e9[_0x35f6('0x36')][_0x35f6('0x3a')]));_0x73a7d6[_0x35f6('0x3b')]=_0x73a7d6[_0x35f6('0x3b')]['length']?_0x73a7d6[_0x35f6('0x3b')]:_0x2b3868[_0x35f6('0x39')];if(_0x82d4e9[_0x35f6('0x36')][_0x35f6('0x47')]){_0x73a7d6['include']=[{'all':!![]}];}_0x73a7d6=_[_0x35f6('0x45')]({},_0x73a7d6,_0x82d4e9[_0x35f6('0x46')]);return db[_0x35f6('0x49')][_0x35f6('0x4d')](_0x73a7d6)['then'](handleEntityNotFound(_0x2d6b04,null))[_0x35f6('0x2b')](respondWithResult(_0x2d6b04,null))['catch'](handleError(_0x2d6b04,null));};exports[_0x35f6('0x4e')]=function(_0x87c116,_0x955140){return db['SmsQueue']['create'](_0x87c116[_0x35f6('0x4f')],{})['then'](function(_0x2e5040){var _0xa8737c=_0x87c116['user'][_0x35f6('0x2c')]({'plain':!![]});if(!_0xa8737c)throw new Error(_0x35f6('0x50'));if(_0xa8737c['role']===_0x35f6('0x51')){var _0xa9c8=_0x2e5040['get']({'plain':!![]});var _0x459183=_0x35f6('0x2d');return db[_0x35f6('0x52')][_0x35f6('0x4d')]({'where':{'name':_0x459183,'userProfileId':_0xa8737c[_0x35f6('0x53')]},'raw':!![]})[_0x35f6('0x2b')](function(_0x454695){if(_0x454695&&_0x454695[_0x35f6('0x54')]===0x0){return db[_0x35f6('0x2e')][_0x35f6('0x4e')]({'name':_0xa9c8[_0x35f6('0x31')],'resourceId':_0xa9c8['id'],'type':_0x454695['name'],'sectionId':_0x454695['id']},{})[_0x35f6('0x2b')](function(){return _0x2e5040;});}else{return _0x2e5040;}})[_0x35f6('0x4b')](function(_0x2ef16a){logger[_0x35f6('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ef16a);throw _0x2ef16a;});}return _0x2e5040;})[_0x35f6('0x2b')](respondWithResult(_0x955140,0xc9))[_0x35f6('0x4b')](handleError(_0x955140,null));};exports[_0x35f6('0x55')]=function(_0x49f90f,_0x39e7b9){if(_0x49f90f['body']['id']){delete _0x49f90f[_0x35f6('0x4f')]['id'];}return db[_0x35f6('0x49')][_0x35f6('0x4d')]({'where':{'id':_0x49f90f[_0x35f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x39e7b9,null))[_0x35f6('0x2b')](saveUpdates(_0x49f90f[_0x35f6('0x4f')],null))[_0x35f6('0x2b')](respondWithResult(_0x39e7b9,null))[_0x35f6('0x4b')](handleError(_0x39e7b9,null));};exports[_0x35f6('0x57')]=function(_0x3cc384,_0x398443){return db[_0x35f6('0x49')][_0x35f6('0x4d')]({'where':{'id':_0x3cc384['params']['id']}})[_0x35f6('0x2b')](handleEntityNotFound(_0x398443,null))[_0x35f6('0x2b')](removeEntity(_0x398443,null))[_0x35f6('0x4b')](handleError(_0x398443,null));};exports[_0x35f6('0x58')]=function(_0x414a66,_0x24ccf4){return db[_0x35f6('0x49')][_0x35f6('0x58')]()[_0x35f6('0x2b')](respondWithResult(_0x24ccf4,null))[_0x35f6('0x4b')](handleError(_0x24ccf4,null));};exports['getMembers']=function(_0x30546a,_0x584794,_0x49a9c8){var _0x35b1b1={'raw':!![],'where':{}},_0x18b981={},_0x4876af;return db[_0x35f6('0x49')][_0x35f6('0x59')]({'where':{'id':_0x30546a[_0x35f6('0x56')]['id']}})[_0x35f6('0x2b')](handleEntityNotFound(_0x584794,null))['then'](function(_0x1d2f57){if(_0x1d2f57){_0x4876af=_0x1d2f57[_0x35f6('0x2c')]({'plain':!![]});_0x18b981[_0x35f6('0x39')]=_['keys'](db['UserSmsQueue']['rawAttributes']);_0x18b981[_0x35f6('0x36')]=_[_0x35f6('0x37')](_0x30546a[_0x35f6('0x36')]);_0x18b981[_0x35f6('0x42')]=_['intersection'](_0x18b981[_0x35f6('0x39')],_0x18b981['query']);_0x35b1b1[_0x35f6('0x3b')]=_[_0x35f6('0x38')](_0x18b981[_0x35f6('0x39')],qs[_0x35f6('0x3a')](_0x30546a[_0x35f6('0x36')][_0x35f6('0x3a')]));_0x35b1b1[_0x35f6('0x3b')]=_0x35b1b1['attributes']['length']?_0x35b1b1[_0x35f6('0x3b')]:_0x18b981['model'];if(!_0x30546a[_0x35f6('0x36')][_0x35f6('0x3d')](_0x35f6('0x3e'))){_0x35b1b1[_0x35f6('0x23')]=qs[_0x35f6('0x23')](_0x30546a[_0x35f6('0x36')][_0x35f6('0x23')]);_0x35b1b1[_0x35f6('0x24')]=qs[_0x35f6('0x24')](_0x30546a[_0x35f6('0x36')][_0x35f6('0x24')]);}_0x35b1b1['order']=qs[_0x35f6('0x40')](_0x30546a['query']['sort']);_0x35b1b1[_0x35f6('0x41')]=qs[_0x35f6('0x42')](_[_0x35f6('0x43')](_0x30546a[_0x35f6('0x36')],_0x18b981[_0x35f6('0x42')]));_0x35b1b1[_0x35f6('0x41')][_0x35f6('0x5a')]=_0x1d2f57['id'];if(_0x30546a[_0x35f6('0x36')][_0x35f6('0x44')]){_0x35b1b1[_0x35f6('0x41')]=_[_0x35f6('0x45')](_0x35b1b1[_0x35f6('0x41')],{'$or':_[_0x35f6('0x32')](_0x35b1b1[_0x35f6('0x3b')],function(_0x1c4ff9){var _0x5f2059={};_0x5f2059[_0x1c4ff9]={'$like':'%'+_0x30546a[_0x35f6('0x36')][_0x35f6('0x44')]+'%'};return _0x5f2059;})});}_0x35b1b1=_['merge']({},_0x35b1b1,_0x30546a[_0x35f6('0x46')]);return db[_0x35f6('0x5b')][_0x35f6('0x5c')](_0x35b1b1);}})['then'](function(_0x3ff2fe){if(_0x3ff2fe){return db[_0x35f6('0x5d')][_0x35f6('0x5e')]({'where':{'id':_[_0x35f6('0x32')](_0x3ff2fe,_0x35f6('0x5f')),'role':_0x35f6('0x60')},'attributes':['id',_0x35f6('0x31'),_0x35f6('0x61'),_0x35f6('0x62'),_0x35f6('0x63')]});}})[_0x35f6('0x2b')](function(_0x2e9499){if(_0x2e9499){return{'count':_0x2e9499[_0x35f6('0x25')],'rows':_['map'](_0x2e9499['rows'],function(_0x23afe3){return{'membername':_0x23afe3['name'],'UserId':_0x23afe3['id'],'queue_name':_0x4876af[_0x35f6('0x31')],'SmsQueueId':_0x4876af['id'],'interface':util[_0x35f6('0x64')]('%s/%s',_0x35f6('0x65'),_0x23afe3[_0x35f6('0x31')]),'penalty':0x0,'paused':_0x23afe3[_0x35f6('0x61')],'createdAt':_0x23afe3[_0x35f6('0x63')],'updatedAt':_0x23afe3[_0x35f6('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x584794,_0x35b1b1))['catch'](handleError(_0x584794,null));};exports[_0x35f6('0x66')]=function(_0xa7d2c6,_0x35cf05,_0x2a8fd8){var _0x4c86c9={};var _0xfccf5a={};var _0x4a95b4;var _0x3e721b;return db['SmsQueue'][_0x35f6('0x59')]({'where':{'id':_0xa7d2c6[_0x35f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x35cf05,null))[_0x35f6('0x2b')](function(_0x3d210b){if(_0x3d210b){_0x4a95b4=_0x3d210b;_0xfccf5a['model']=_[_0x35f6('0x37')](db[_0x35f6('0x67')][_0x35f6('0x33')]);_0xfccf5a[_0x35f6('0x36')]=_[_0x35f6('0x37')](_0xa7d2c6[_0x35f6('0x36')]);_0xfccf5a[_0x35f6('0x42')]=_[_0x35f6('0x38')](_0xfccf5a[_0x35f6('0x39')],_0xfccf5a[_0x35f6('0x36')]);_0x4c86c9['attributes']=_[_0x35f6('0x38')](_0xfccf5a['model'],qs['fields'](_0xa7d2c6[_0x35f6('0x36')][_0x35f6('0x3a')]));_0x4c86c9[_0x35f6('0x3b')]=_0x4c86c9[_0x35f6('0x3b')][_0x35f6('0x3c')]?_0x4c86c9[_0x35f6('0x3b')]:_0xfccf5a[_0x35f6('0x39')];_0x4c86c9[_0x35f6('0x3f')]=qs[_0x35f6('0x40')](_0xa7d2c6[_0x35f6('0x36')][_0x35f6('0x40')]);_0x4c86c9[_0x35f6('0x41')]=qs[_0x35f6('0x42')](_[_0x35f6('0x43')](_0xa7d2c6[_0x35f6('0x36')],_0xfccf5a[_0x35f6('0x42')]));if(_0xa7d2c6[_0x35f6('0x36')]['filter']){_0x4c86c9[_0x35f6('0x41')]=_[_0x35f6('0x45')](_0x4c86c9[_0x35f6('0x41')],{'$or':_[_0x35f6('0x32')](_0x4c86c9[_0x35f6('0x3b')],function(_0x51a4eb){var _0x19b355={};_0x19b355[_0x51a4eb]={'$like':'%'+_0xa7d2c6[_0x35f6('0x36')][_0x35f6('0x44')]+'%'};return _0x19b355;})});}_0x4c86c9=_[_0x35f6('0x45')]({},_0x4c86c9,_0xa7d2c6[_0x35f6('0x46')]);return _0x4a95b4[_0x35f6('0x66')](_0x4c86c9);}})[_0x35f6('0x2b')](function(_0x5f5b82){if(_0x5f5b82){_0x3e721b=_0x5f5b82['length'];if(!_0xa7d2c6[_0x35f6('0x36')][_0x35f6('0x3d')](_0x35f6('0x3e'))){_0x4c86c9[_0x35f6('0x23')]=qs[_0x35f6('0x23')](_0xa7d2c6[_0x35f6('0x36')][_0x35f6('0x23')]);_0x4c86c9[_0x35f6('0x24')]=qs[_0x35f6('0x24')](_0xa7d2c6[_0x35f6('0x36')][_0x35f6('0x24')]);}return _0x4a95b4['getTeams'](_0x4c86c9);}})[_0x35f6('0x2b')](function(_0x29f1c5){if(_0x29f1c5){return _0x29f1c5?{'count':_0x3e721b,'rows':_0x29f1c5}:null;}})['then'](respondWithResult(_0x35cf05,null))[_0x35f6('0x4b')](handleError(_0x35cf05,null));};exports[_0x35f6('0x68')]=function(_0x19ec07,_0x4a5107,_0x43c04e){var _0x4d8aa3=_0x19ec07[_0x35f6('0x4f')][_0x35f6('0x69')];return db[_0x35f6('0x67')][_0x35f6('0x5c')]({'where':{'id':_0x4d8aa3},'attributes':['id'],'include':[{'model':db[_0x35f6('0x5d')],'as':_0x35f6('0x6a'),'attributes':['id',_0x35f6('0x31'),_0x35f6('0x6b'),_0x35f6('0x6c'),_0x35f6('0x6d')],'raw':!![]}]})[_0x35f6('0x2b')](function(_0x4c419d){if(_0x4c419d){var _0x5261d9=_[_0x35f6('0x6e')](_0x4c419d,function(_0x48cd0b){var _0x5f1e92=_0x48cd0b[_0x35f6('0x2c')]({'plain':!![]});return _0x5f1e92[_0x35f6('0x6a')];});return db['SmsQueue']['find']({'where':{'id':_0x19ec07[_0x35f6('0x56')]['id']}})[_0x35f6('0x2b')](function(_0x3678ba){return db[_0x35f6('0x6f')][_0x35f6('0x70')](function(_0x1f3f01){return _0x3678ba[_0x35f6('0x68')](_0x4d8aa3,{'transaction':_0x1f3f01})[_0x35f6('0x2b')](function(){return BPromise[_0x35f6('0x71')](_0x5261d9,function(_0xf13280){return db['UserSmsQueue'][_0x35f6('0x72')]({'where':{'UserId':_0xf13280['id'],'SmsQueueId':_0x19ec07[_0x35f6('0x56')]['id']},'transaction':_0x1f3f01});});})[_0x35f6('0x2b')](function(){_0x5261d9[_0x35f6('0x73')](function(_0x3a0bf8){socket['emit']('userSmsQueue:save',{'UserId':_0x3a0bf8['id'],'SmsQueueId':_0x3678ba['id']});});});});});}})[_0x35f6('0x2b')](respondWithStatusCode(_0x4a5107,null))[_0x35f6('0x4b')](handleError(_0x4a5107,null));};exports[_0x35f6('0x74')]=function(_0x1cd885,_0xbbf095,_0x2b2567){return db[_0x35f6('0x67')]['findAll']({'where':{'id':_0x1cd885['query'][_0x35f6('0x69')]},'attributes':['id'],'include':[{'model':db[_0x35f6('0x5d')],'as':_0x35f6('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xbbf095,null))[_0x35f6('0x2b')](function(_0x28c4a4){var _0x3c91be=_[_0x35f6('0x32')](_0x28c4a4,'id');var _0x1e545d=[];var _0x3c5070=[];var _0x20e009=squel[_0x35f6('0x75')]();_0x20e009[_0x35f6('0x76')](_0x35f6('0x77'))['from'](_0x35f6('0x78'),'tq')['join'](_0x35f6('0x79'),'ut',_0x35f6('0x7a'))['where'](_0x35f6('0x7b'),_0x1cd885[_0x35f6('0x56')]['id']);for(var _0x3789ba=0x0;_0x3789ba<_0x28c4a4[_0x35f6('0x3c')];_0x3789ba+=0x1){let _0x14fdd4=_0x28c4a4[_0x3789ba];for(var _0x599607=0x0;_0x599607<_0x14fdd4['Agents']['length'];_0x599607+=0x1){let _0x3055f5=_0x14fdd4[_0x35f6('0x6a')][_0x599607];var _0x1c3c5d=_0x20e009['clone']();_0x1c3c5d[_0x35f6('0x41')](_0x35f6('0x7c'),_0x3055f5['id']);_0x3c5070[_0x35f6('0x7d')](db[_0x35f6('0x6f')]['query'](_0x1c3c5d['toString'](),{'type':db['sequelize']['QueryTypes'][_0x35f6('0x7e')]})[_0x35f6('0x2b')](function(_0x36681e){if(_0x36681e[_0x35f6('0x3c')]===0x1){return _0x3055f5['id'];}else{var _0x37da47=_[_0x35f6('0x7f')](_['map'](_0x36681e,_0x35f6('0x80')),function(_0x161ab0){return _[_0x35f6('0x81')](_0x3c91be,_0x161ab0);});if(_0x37da47){return _0x3055f5['id'];}}}));}}return BPromise[_0x35f6('0x82')](_0x3c5070)[_0x35f6('0x2b')](function(_0xec963a){_0x1e545d=_(_0x1e545d)[_0x35f6('0x83')](_0xec963a)[_0x35f6('0x84')]()['value']();return db[_0x35f6('0x49')][_0x35f6('0x4d')]({'where':{'id':_0x1cd885['params']['id']}})[_0x35f6('0x2b')](function(_0x33d23c){return db[_0x35f6('0x6f')][_0x35f6('0x70')](function(_0x46e06e){return _0x33d23c[_0x35f6('0x74')](_0x1cd885[_0x35f6('0x36')][_0x35f6('0x69')],{'transaction':_0x46e06e})[_0x35f6('0x2b')](function(){if(!_[_0x35f6('0x85')](_0x1e545d)){return _0x33d23c[_0x35f6('0x86')](_0x1e545d,{'transaction':_0x46e06e});}})[_0x35f6('0x2b')](function(){_0x1e545d[_0x35f6('0x73')](function(_0x4c0c70){socket[_0x35f6('0x87')]('userSmsQueue:remove',{'UserId':_0x4c0c70,'SmsQueueId':_0x33d23c['id']});});});});});});})[_0x35f6('0x2b')](respondWithStatusCode(_0xbbf095,null))['catch'](handleError(_0xbbf095,null));};exports[_0x35f6('0x88')]=function(_0x533621,_0x26c5d8,_0x2664fd){return db[_0x35f6('0x49')]['find']({'where':{'id':_0x533621[_0x35f6('0x56')]['id']}})[_0x35f6('0x2b')](handleEntityNotFound(_0x26c5d8,null))[_0x35f6('0x2b')](function(_0x3f3eda){if(_0x3f3eda){return _0x3f3eda['addAgents'](_0x533621[_0x35f6('0x4f')]['ids'],_[_0x35f6('0x89')](_0x533621[_0x35f6('0x4f')],[_0x35f6('0x69'),'id'])||{})['spread'](function(_0x12655b){for(var _0x5ac039=0x0;_0x5ac039<_0x533621['body']['ids']['length'];_0x5ac039+=0x1){socket[_0x35f6('0x87')]('userSmsQueue:save',{'UserId':Number(_0x533621[_0x35f6('0x4f')][_0x35f6('0x69')][_0x5ac039]),'SmsQueueId':Number(_0x533621[_0x35f6('0x56')]['id'])});}return _0x12655b;});}})['then'](respondWithResult(_0x26c5d8,null))[_0x35f6('0x4b')](handleError(_0x26c5d8,null));};exports[_0x35f6('0x86')]=function(_0x466028,_0x49afc9,_0x180c3e){return db[_0x35f6('0x49')]['find']({'where':{'id':_0x466028[_0x35f6('0x56')]['id']}})[_0x35f6('0x2b')](handleEntityNotFound(_0x49afc9,null))[_0x35f6('0x2b')](function(_0xe8a19e){if(_0xe8a19e){return _0xe8a19e[_0x35f6('0x86')](_0x466028[_0x35f6('0x36')][_0x35f6('0x69')])[_0x35f6('0x2b')](function(){if(_['isArray'](_0x466028[_0x35f6('0x36')][_0x35f6('0x69')])){for(var _0x4ffad0=0x0;_0x4ffad0<_0x466028['query'][_0x35f6('0x69')][_0x35f6('0x3c')];_0x4ffad0+=0x1){socket[_0x35f6('0x87')](_0x35f6('0x8a'),{'UserId':Number(_0x466028[_0x35f6('0x36')][_0x35f6('0x69')][_0x4ffad0]),'SmsQueueId':Number(_0x466028['params']['id'])});}}else{socket[_0x35f6('0x87')](_0x35f6('0x8a'),{'UserId':Number(_0x466028[_0x35f6('0x36')][_0x35f6('0x69')]),'SmsQueueId':Number(_0x466028['params']['id'])});}});}})[_0x35f6('0x2b')](respondWithStatusCode(_0x49afc9,null))[_0x35f6('0x4b')](handleError(_0x49afc9,null));};exports[_0x35f6('0x8b')]=function(_0x5752c9,_0xefa15f,_0x3d248f){var _0x1d4ea2={};var _0x5c5cd7={};var _0x3c4fc8;var _0x39e9e9;return db[_0x35f6('0x49')][_0x35f6('0x59')]({'where':{'id':_0x5752c9[_0x35f6('0x56')]['id']}})[_0x35f6('0x2b')](handleEntityNotFound(_0xefa15f,null))['then'](function(_0x38b70c){if(_0x38b70c){_0x3c4fc8=_0x38b70c;_0x5c5cd7[_0x35f6('0x39')]=_[_0x35f6('0x37')](db[_0x35f6('0x5d')][_0x35f6('0x33')]);_0x5c5cd7[_0x35f6('0x36')]=_[_0x35f6('0x37')](_0x5752c9[_0x35f6('0x36')]);_0x5c5cd7[_0x35f6('0x42')]=_[_0x35f6('0x38')](_0x5c5cd7[_0x35f6('0x39')],_0x5c5cd7[_0x35f6('0x36')]);_0x1d4ea2[_0x35f6('0x3b')]=_[_0x35f6('0x38')](_0x5c5cd7['model'],qs['fields'](_0x5752c9[_0x35f6('0x36')][_0x35f6('0x3a')]));_0x1d4ea2[_0x35f6('0x3b')]=_0x1d4ea2[_0x35f6('0x3b')][_0x35f6('0x3c')]?_0x1d4ea2[_0x35f6('0x3b')]:_0x5c5cd7[_0x35f6('0x39')];_0x1d4ea2[_0x35f6('0x3f')]=qs[_0x35f6('0x40')](_0x5752c9[_0x35f6('0x36')][_0x35f6('0x40')]);_0x1d4ea2['where']=qs[_0x35f6('0x42')](_['pick'](_0x5752c9['query'],_0x5c5cd7[_0x35f6('0x42')]));if(_0x5752c9[_0x35f6('0x36')]['filter']){_0x1d4ea2[_0x35f6('0x41')]=_[_0x35f6('0x45')](_0x1d4ea2['where'],{'$or':_[_0x35f6('0x32')](_0x1d4ea2[_0x35f6('0x3b')],function(_0x44062a){var _0x4c616c={};_0x4c616c[_0x44062a]={'$like':'%'+_0x5752c9[_0x35f6('0x36')][_0x35f6('0x44')]+'%'};return _0x4c616c;})});}_0x1d4ea2=_['merge']({},_0x1d4ea2,_0x5752c9[_0x35f6('0x46')]);return _0x3c4fc8[_0x35f6('0x8b')](_0x1d4ea2);}})['then'](function(_0x314183){if(_0x314183){_0x39e9e9=_0x314183['length'];if(!_0x5752c9[_0x35f6('0x36')][_0x35f6('0x3d')](_0x35f6('0x3e'))){_0x1d4ea2[_0x35f6('0x23')]=qs['limit'](_0x5752c9[_0x35f6('0x36')][_0x35f6('0x23')]);_0x1d4ea2[_0x35f6('0x24')]=qs[_0x35f6('0x24')](_0x5752c9[_0x35f6('0x36')][_0x35f6('0x24')]);}return _0x3c4fc8[_0x35f6('0x8b')](_0x1d4ea2);}})['then'](function(_0x20bd6d){if(_0x20bd6d){return _0x20bd6d?{'count':_0x39e9e9,'rows':_0x20bd6d}:null;}})[_0x35f6('0x2b')](respondWithResult(_0xefa15f,null))[_0x35f6('0x4b')](handleError(_0xefa15f,null));}; \ No newline at end of file +var _0x398a=['mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsQueue.socket','status','end','offset','undefined','limit','count','set','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','index','map','SmsQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','params','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','userProfileId','autoAssociation','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','updatedAt','%s/%s','smsPause','getTeams','nolimit','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userSmsQueue:save','removeTeams','Agents','select','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xbead20,_0x2876c4){var _0x5f07bd=function(_0x451c9a){while(--_0x451c9a){_0xbead20['push'](_0xbead20['shift']());}};_0x5f07bd(++_0x2876c4);}(_0x398a,0x7d));var _0xa398=function(_0x54a4a2,_0x3359fe){_0x54a4a2=_0x54a4a2-0x0;var _0x1d6351=_0x398a[_0x54a4a2];return _0x1d6351;};'use strict';var emlformat=require(_0xa398('0x0'));var rimraf=require(_0xa398('0x1'));var zipdir=require(_0xa398('0x2'));var jsonpatch=require(_0xa398('0x3'));var rp=require(_0xa398('0x4'));var moment=require(_0xa398('0x5'));var BPromise=require(_0xa398('0x6'));var Mustache=require(_0xa398('0x7'));var util=require(_0xa398('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa398('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa398('0xa'));var squel=require(_0xa398('0xb'));var crypto=require(_0xa398('0xc'));var jsforce=require(_0xa398('0xd'));var deskjs=require(_0xa398('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa398('0xf'));var Papa=require(_0xa398('0x10'));var Redis=require(_0xa398('0x11'));var authService=require(_0xa398('0x12'));var qs=require(_0xa398('0x13'));var as=require(_0xa398('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa398('0x15'));var utils=require(_0xa398('0x16'));var config=require(_0xa398('0x17'));var licenseUtil=require(_0xa398('0x18'));var db=require(_0xa398('0x19'))['db'];config[_0xa398('0x1a')]=_['defaults'](config[_0xa398('0x1a')],{'host':_0xa398('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa398('0x1a')]));require(_0xa398('0x1c'))['register'](socket);function respondWithStatusCode(_0x510bf9,_0x49bf48){_0x49bf48=_0x49bf48||0xcc;return function(_0xa81658){if(_0xa81658){return _0x510bf9['sendStatus'](_0x49bf48);}return _0x510bf9[_0xa398('0x1d')](_0x49bf48)[_0xa398('0x1e')]();};}function respondWithResult(_0x5696fd,_0x16aed7){_0x16aed7=_0x16aed7||0xc8;return function(_0x6ee48c){if(_0x6ee48c){return _0x5696fd[_0xa398('0x1d')](_0x16aed7)['json'](_0x6ee48c);}};}function respondWithFilteredResult(_0x27a3b8,_0x475860){return function(_0x2c56f9){if(_0x2c56f9){var _0xe64699=typeof _0x475860[_0xa398('0x1f')]===_0xa398('0x20')&&typeof _0x475860[_0xa398('0x21')]===_0xa398('0x20');var _0x547dda=_0x2c56f9[_0xa398('0x22')];var _0x24240d=_0xe64699?0x0:_0x475860[_0xa398('0x1f')];var _0x3addfa=_0xe64699?_0x2c56f9[_0xa398('0x22')]:_0x475860[_0xa398('0x1f')]+_0x475860['limit'];var _0x1437ff;if(_0x3addfa>=_0x547dda){_0x3addfa=_0x547dda;_0x1437ff=0xc8;}else{_0x1437ff=0xce;}_0x27a3b8[_0xa398('0x1d')](_0x1437ff);return _0x27a3b8[_0xa398('0x23')]('Content-Range',_0x24240d+'-'+_0x3addfa+'/'+_0x547dda)['json'](_0x2c56f9);}return null;};}function patchUpdates(_0x5a0712){return function(_0x3bd5ba){try{jsonpatch['apply'](_0x3bd5ba,_0x5a0712,!![]);}catch(_0x4d4bba){return BPromise['reject'](_0x4d4bba);}return _0x3bd5ba['save']();};}function saveUpdates(_0xe667b0,_0xb88abf){return function(_0x3cb403){if(_0x3cb403){return _0x3cb403[_0xa398('0x24')](_0xe667b0)[_0xa398('0x25')](function(_0x209acf){return _0x209acf;});}return null;};}function removeEntity(_0x4a87bd,_0x440a34){return function(_0x3ded3f){if(_0x3ded3f){return _0x3ded3f[_0xa398('0x26')]()[_0xa398('0x25')](function(){var _0xeda87b=_0x3ded3f['get']({'plain':!![]});var _0x30dc65='SmsQueues';return db[_0xa398('0x27')][_0xa398('0x26')]({'where':{'type':_0x30dc65,'resourceId':_0xeda87b['id']}})['then'](function(){return _0x3ded3f;});})['then'](function(){_0x4a87bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23e631,_0x570a61){return function(_0xa4bbbf){if(!_0xa4bbbf){_0x23e631[_0xa398('0x28')](0x194);}return _0xa4bbbf;};}function handleError(_0x2aa2f5,_0x276748){_0x276748=_0x276748||0x1f4;return function(_0xe32a0d){logger[_0xa398('0x29')](_0xe32a0d[_0xa398('0x2a')]);if(_0xe32a0d['name']){delete _0xe32a0d[_0xa398('0x2b')];}_0x2aa2f5[_0xa398('0x1d')](_0x276748)[_0xa398('0x2c')](_0xe32a0d);};}exports[_0xa398('0x2d')]=function(_0x577fcf,_0x78f8fc){var _0x53ca08={},_0x527f98={},_0x2d17bb={'count':0x0,'rows':[]};var _0x708713=_[_0xa398('0x2e')](db[_0xa398('0x2f')][_0xa398('0x30')],function(_0x2acbd8){return{'name':_0x2acbd8['fieldName'],'type':_0x2acbd8['type'][_0xa398('0x31')]};});_0x527f98[_0xa398('0x32')]=_[_0xa398('0x2e')](_0x708713,_0xa398('0x2b'));_0x527f98[_0xa398('0x33')]=_[_0xa398('0x34')](_0x577fcf[_0xa398('0x33')]);_0x527f98[_0xa398('0x35')]=_[_0xa398('0x36')](_0x527f98[_0xa398('0x32')],_0x527f98['query']);_0x53ca08[_0xa398('0x37')]=_[_0xa398('0x36')](_0x527f98[_0xa398('0x32')],qs[_0xa398('0x38')](_0x577fcf[_0xa398('0x33')][_0xa398('0x38')]));_0x53ca08['attributes']=_0x53ca08['attributes'][_0xa398('0x39')]?_0x53ca08[_0xa398('0x37')]:_0x527f98[_0xa398('0x32')];if(!_0x577fcf[_0xa398('0x33')][_0xa398('0x3a')]('nolimit')){_0x53ca08['limit']=qs[_0xa398('0x21')](_0x577fcf[_0xa398('0x33')][_0xa398('0x21')]);_0x53ca08[_0xa398('0x1f')]=qs['offset'](_0x577fcf[_0xa398('0x33')][_0xa398('0x1f')]);}_0x53ca08[_0xa398('0x3b')]=qs['sort'](_0x577fcf[_0xa398('0x33')][_0xa398('0x3c')]);_0x53ca08['where']=qs[_0xa398('0x35')](_[_0xa398('0x3d')](_0x577fcf[_0xa398('0x33')],_0x527f98[_0xa398('0x35')]),_0x708713);if(_0x577fcf[_0xa398('0x33')][_0xa398('0x3e')]){_0x53ca08['where']=_['merge'](_0x53ca08[_0xa398('0x3f')],{'$or':_['map'](_0x708713,function(_0x1d5b2d){if(_0x1d5b2d['type']!=='VIRTUAL'){var _0x2f7bbe={};_0x2f7bbe[_0x1d5b2d['name']]={'$like':'%'+_0x577fcf['query'][_0xa398('0x3e')]+'%'};return _0x2f7bbe;}})});}_0x53ca08=_['merge']({},_0x53ca08,_0x577fcf[_0xa398('0x40')]);var _0xb963d0={'where':_0x53ca08[_0xa398('0x3f')]};return db[_0xa398('0x2f')][_0xa398('0x22')](_0xb963d0)[_0xa398('0x25')](function(_0xa2ad0a){_0x2d17bb[_0xa398('0x22')]=_0xa2ad0a;if(_0x577fcf[_0xa398('0x33')][_0xa398('0x41')]){_0x53ca08[_0xa398('0x42')]=[{'all':!![]}];}return db[_0xa398('0x2f')][_0xa398('0x43')](_0x53ca08);})[_0xa398('0x25')](function(_0x49882e){_0x2d17bb[_0xa398('0x44')]=_0x49882e;return _0x2d17bb;})[_0xa398('0x25')](respondWithFilteredResult(_0x78f8fc,_0x53ca08))[_0xa398('0x45')](handleError(_0x78f8fc,null));};exports['show']=function(_0x2f19e0,_0xad3c35){var _0x430872={'raw':!![],'where':{'id':_0x2f19e0[_0xa398('0x46')]['id']}},_0x26ed14={};_0x26ed14[_0xa398('0x32')]=_[_0xa398('0x34')](db[_0xa398('0x2f')]['rawAttributes']);_0x26ed14['query']=_[_0xa398('0x34')](_0x2f19e0[_0xa398('0x33')]);_0x26ed14['filters']=_[_0xa398('0x36')](_0x26ed14[_0xa398('0x32')],_0x26ed14[_0xa398('0x33')]);_0x430872[_0xa398('0x37')]=_[_0xa398('0x36')](_0x26ed14[_0xa398('0x32')],qs[_0xa398('0x38')](_0x2f19e0[_0xa398('0x33')][_0xa398('0x38')]));_0x430872[_0xa398('0x37')]=_0x430872[_0xa398('0x37')]['length']?_0x430872[_0xa398('0x37')]:_0x26ed14['model'];if(_0x2f19e0[_0xa398('0x33')][_0xa398('0x41')]){_0x430872[_0xa398('0x42')]=[{'all':!![]}];}_0x430872=_[_0xa398('0x47')]({},_0x430872,_0x2f19e0[_0xa398('0x40')]);return db['SmsQueue'][_0xa398('0x48')](_0x430872)['then'](handleEntityNotFound(_0xad3c35,null))[_0xa398('0x25')](respondWithResult(_0xad3c35,null))[_0xa398('0x45')](handleError(_0xad3c35,null));};exports[_0xa398('0x49')]=function(_0x539ee2,_0xd7cd46){return db['SmsQueue'][_0xa398('0x49')](_0x539ee2[_0xa398('0x4a')],{})[_0xa398('0x25')](function(_0x51f0a4){var _0x52e0b7=_0x539ee2[_0xa398('0x4b')][_0xa398('0x4c')]({'plain':!![]});if(!_0x52e0b7)throw new Error(_0xa398('0x4d'));if(_0x52e0b7[_0xa398('0x4e')]===_0xa398('0x4b')){var _0x423bba=_0x51f0a4[_0xa398('0x4c')]({'plain':!![]});var _0x37224b=_0xa398('0x4f');return db['UserProfileSection'][_0xa398('0x48')]({'where':{'name':_0x37224b,'userProfileId':_0x52e0b7[_0xa398('0x50')]},'raw':!![]})['then'](function(_0x3a5200){if(_0x3a5200&&_0x3a5200[_0xa398('0x51')]===0x0){return db[_0xa398('0x27')][_0xa398('0x49')]({'name':_0x423bba[_0xa398('0x2b')],'resourceId':_0x423bba['id'],'type':_0x3a5200[_0xa398('0x2b')],'sectionId':_0x3a5200['id']},{})['then'](function(){return _0x51f0a4;});}else{return _0x51f0a4;}})[_0xa398('0x45')](function(_0x55e967){logger[_0xa398('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55e967);throw _0x55e967;});}return _0x51f0a4;})[_0xa398('0x25')](respondWithResult(_0xd7cd46,0xc9))[_0xa398('0x45')](handleError(_0xd7cd46,null));};exports[_0xa398('0x24')]=function(_0x1bfa46,_0x3aff4c){if(_0x1bfa46[_0xa398('0x4a')]['id']){delete _0x1bfa46[_0xa398('0x4a')]['id'];}return db[_0xa398('0x2f')][_0xa398('0x48')]({'where':{'id':_0x1bfa46['params']['id']}})[_0xa398('0x25')](handleEntityNotFound(_0x3aff4c,null))[_0xa398('0x25')](saveUpdates(_0x1bfa46['body'],null))[_0xa398('0x25')](respondWithResult(_0x3aff4c,null))[_0xa398('0x45')](handleError(_0x3aff4c,null));};exports[_0xa398('0x26')]=function(_0x6f7d9f,_0x1e5206){return db[_0xa398('0x2f')][_0xa398('0x48')]({'where':{'id':_0x6f7d9f[_0xa398('0x46')]['id']}})[_0xa398('0x25')](handleEntityNotFound(_0x1e5206,null))[_0xa398('0x25')](removeEntity(_0x1e5206,null))[_0xa398('0x45')](handleError(_0x1e5206,null));};exports[_0xa398('0x52')]=function(_0x1e8d2c,_0x5d60d3){return db[_0xa398('0x2f')][_0xa398('0x52')]()[_0xa398('0x25')](respondWithResult(_0x5d60d3,null))['catch'](handleError(_0x5d60d3,null));};exports[_0xa398('0x53')]=function(_0x4de544,_0xb78a1d,_0x1f09a6){var _0x259d96={'raw':!![],'where':{}},_0x287fe5={},_0x3a16b6;return db[_0xa398('0x2f')][_0xa398('0x54')]({'where':{'id':_0x4de544[_0xa398('0x46')]['id']}})[_0xa398('0x25')](handleEntityNotFound(_0xb78a1d,null))[_0xa398('0x25')](function(_0x12fb0a){if(_0x12fb0a){_0x3a16b6=_0x12fb0a[_0xa398('0x4c')]({'plain':!![]});_0x287fe5[_0xa398('0x32')]=_[_0xa398('0x34')](db[_0xa398('0x55')][_0xa398('0x30')]);_0x287fe5[_0xa398('0x33')]=_[_0xa398('0x34')](_0x4de544[_0xa398('0x33')]);_0x287fe5[_0xa398('0x35')]=_[_0xa398('0x36')](_0x287fe5['model'],_0x287fe5[_0xa398('0x33')]);_0x259d96[_0xa398('0x37')]=_[_0xa398('0x36')](_0x287fe5[_0xa398('0x32')],qs['fields'](_0x4de544[_0xa398('0x33')][_0xa398('0x38')]));_0x259d96[_0xa398('0x37')]=_0x259d96[_0xa398('0x37')][_0xa398('0x39')]?_0x259d96['attributes']:_0x287fe5[_0xa398('0x32')];if(!_0x4de544[_0xa398('0x33')]['hasOwnProperty']('nolimit')){_0x259d96['limit']=qs[_0xa398('0x21')](_0x4de544[_0xa398('0x33')][_0xa398('0x21')]);_0x259d96[_0xa398('0x1f')]=qs[_0xa398('0x1f')](_0x4de544[_0xa398('0x33')][_0xa398('0x1f')]);}_0x259d96['order']=qs['sort'](_0x4de544[_0xa398('0x33')][_0xa398('0x3c')]);_0x259d96[_0xa398('0x3f')]=qs[_0xa398('0x35')](_[_0xa398('0x3d')](_0x4de544[_0xa398('0x33')],_0x287fe5[_0xa398('0x35')]));_0x259d96[_0xa398('0x3f')][_0xa398('0x56')]=_0x12fb0a['id'];if(_0x4de544[_0xa398('0x33')][_0xa398('0x3e')]){_0x259d96[_0xa398('0x3f')]=_['merge'](_0x259d96['where'],{'$or':_[_0xa398('0x2e')](_0x259d96[_0xa398('0x37')],function(_0x304e04){var _0x1cd570={};_0x1cd570[_0x304e04]={'$like':'%'+_0x4de544['query'][_0xa398('0x3e')]+'%'};return _0x1cd570;})});}_0x259d96=_['merge']({},_0x259d96,_0x4de544[_0xa398('0x40')]);return db['UserSmsQueue'][_0xa398('0x43')](_0x259d96);}})[_0xa398('0x25')](function(_0x4c9488){if(_0x4c9488){return db[_0xa398('0x57')][_0xa398('0x58')]({'where':{'id':_[_0xa398('0x2e')](_0x4c9488,_0xa398('0x59')),'role':_0xa398('0x5a')},'attributes':['id',_0xa398('0x2b'),'smsPause',_0xa398('0x5b'),'createdAt']});}})[_0xa398('0x25')](function(_0x61532a){if(_0x61532a){return{'count':_0x61532a['count'],'rows':_[_0xa398('0x2e')](_0x61532a[_0xa398('0x44')],function(_0x5b3359){return{'membername':_0x5b3359[_0xa398('0x2b')],'UserId':_0x5b3359['id'],'queue_name':_0x3a16b6[_0xa398('0x2b')],'SmsQueueId':_0x3a16b6['id'],'interface':util['format'](_0xa398('0x5c'),'SIP',_0x5b3359[_0xa398('0x2b')]),'penalty':0x0,'paused':_0x5b3359[_0xa398('0x5d')],'createdAt':_0x5b3359['createdAt'],'updatedAt':_0x5b3359[_0xa398('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa398('0x25')](respondWithFilteredResult(_0xb78a1d,_0x259d96))['catch'](handleError(_0xb78a1d,null));};exports[_0xa398('0x5e')]=function(_0x3a0aed,_0x4e4892,_0x2b02d1){var _0x21d488={};var _0x2d6751={};var _0x371d89;var _0x2637d5;return db[_0xa398('0x2f')]['findOne']({'where':{'id':_0x3a0aed[_0xa398('0x46')]['id']}})[_0xa398('0x25')](handleEntityNotFound(_0x4e4892,null))[_0xa398('0x25')](function(_0x1a2f1b){if(_0x1a2f1b){_0x371d89=_0x1a2f1b;_0x2d6751[_0xa398('0x32')]=_[_0xa398('0x34')](db['Team']['rawAttributes']);_0x2d6751[_0xa398('0x33')]=_['keys'](_0x3a0aed[_0xa398('0x33')]);_0x2d6751['filters']=_[_0xa398('0x36')](_0x2d6751['model'],_0x2d6751[_0xa398('0x33')]);_0x21d488['attributes']=_[_0xa398('0x36')](_0x2d6751[_0xa398('0x32')],qs[_0xa398('0x38')](_0x3a0aed[_0xa398('0x33')][_0xa398('0x38')]));_0x21d488[_0xa398('0x37')]=_0x21d488[_0xa398('0x37')][_0xa398('0x39')]?_0x21d488['attributes']:_0x2d6751[_0xa398('0x32')];_0x21d488[_0xa398('0x3b')]=qs[_0xa398('0x3c')](_0x3a0aed[_0xa398('0x33')][_0xa398('0x3c')]);_0x21d488['where']=qs[_0xa398('0x35')](_[_0xa398('0x3d')](_0x3a0aed[_0xa398('0x33')],_0x2d6751['filters']));if(_0x3a0aed[_0xa398('0x33')]['filter']){_0x21d488[_0xa398('0x3f')]=_[_0xa398('0x47')](_0x21d488[_0xa398('0x3f')],{'$or':_[_0xa398('0x2e')](_0x21d488[_0xa398('0x37')],function(_0x4bca09){var _0xc60e72={};_0xc60e72[_0x4bca09]={'$like':'%'+_0x3a0aed[_0xa398('0x33')][_0xa398('0x3e')]+'%'};return _0xc60e72;})});}_0x21d488=_[_0xa398('0x47')]({},_0x21d488,_0x3a0aed[_0xa398('0x40')]);return _0x371d89[_0xa398('0x5e')](_0x21d488);}})[_0xa398('0x25')](function(_0x45a151){if(_0x45a151){_0x2637d5=_0x45a151[_0xa398('0x39')];if(!_0x3a0aed['query'][_0xa398('0x3a')](_0xa398('0x5f'))){_0x21d488[_0xa398('0x21')]=qs[_0xa398('0x21')](_0x3a0aed['query']['limit']);_0x21d488[_0xa398('0x1f')]=qs[_0xa398('0x1f')](_0x3a0aed[_0xa398('0x33')]['offset']);}return _0x371d89[_0xa398('0x5e')](_0x21d488);}})[_0xa398('0x25')](function(_0x17d0e1){if(_0x17d0e1){return _0x17d0e1?{'count':_0x2637d5,'rows':_0x17d0e1}:null;}})[_0xa398('0x25')](respondWithResult(_0x4e4892,null))[_0xa398('0x45')](handleError(_0x4e4892,null));};exports[_0xa398('0x60')]=function(_0x1ad604,_0x5c67ef,_0x533612){var _0x11a701=_0x1ad604[_0xa398('0x4a')][_0xa398('0x61')];return db['Team'][_0xa398('0x43')]({'where':{'id':_0x11a701},'attributes':['id'],'include':[{'model':db[_0xa398('0x57')],'as':'Agents','attributes':['id',_0xa398('0x2b'),_0xa398('0x62'),_0xa398('0x63'),_0xa398('0x64')],'raw':!![]}]})[_0xa398('0x25')](function(_0x3d53a2){if(_0x3d53a2){var _0x13037d=_[_0xa398('0x65')](_0x3d53a2,function(_0x4f9e74){var _0x169ddf=_0x4f9e74[_0xa398('0x4c')]({'plain':!![]});return _0x169ddf['Agents'];});return db['SmsQueue'][_0xa398('0x48')]({'where':{'id':_0x1ad604[_0xa398('0x46')]['id']}})['then'](function(_0x703d8e){return db[_0xa398('0x66')][_0xa398('0x67')](function(_0x2d3484){return _0x703d8e[_0xa398('0x60')](_0x11a701,{'transaction':_0x2d3484})[_0xa398('0x25')](function(){return BPromise['each'](_0x13037d,function(_0x2805a4){return db[_0xa398('0x55')][_0xa398('0x68')]({'where':{'UserId':_0x2805a4['id'],'SmsQueueId':_0x1ad604[_0xa398('0x46')]['id']},'transaction':_0x2d3484});});})[_0xa398('0x25')](function(){_0x13037d['forEach'](function(_0x56a3b7){socket[_0xa398('0x69')](_0xa398('0x6a'),{'UserId':_0x56a3b7['id'],'SmsQueueId':_0x703d8e['id']});});});});});}})[_0xa398('0x25')](respondWithStatusCode(_0x5c67ef,null))[_0xa398('0x45')](handleError(_0x5c67ef,null));};exports[_0xa398('0x6b')]=function(_0x3206cf,_0x46bb0c,_0x591f1d){return db['Team'][_0xa398('0x43')]({'where':{'id':_0x3206cf[_0xa398('0x33')][_0xa398('0x61')]},'attributes':['id'],'include':[{'model':db[_0xa398('0x57')],'as':_0xa398('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xa398('0x25')](handleEntityNotFound(_0x46bb0c,null))['then'](function(_0x4207d2){var _0x105514=_[_0xa398('0x2e')](_0x4207d2,'id');var _0x263f40=[];var _0x4e80e9=[];var _0x579aa2=squel[_0xa398('0x6d')]();_0x579aa2['field']('tq.TeamId')[_0xa398('0x6e')](_0xa398('0x6f'),'tq')[_0xa398('0x70')](_0xa398('0x71'),'ut',_0xa398('0x72'))[_0xa398('0x3f')](_0xa398('0x73'),_0x3206cf[_0xa398('0x46')]['id']);for(var _0x33d4aa=0x0;_0x33d4aa<_0x4207d2[_0xa398('0x39')];_0x33d4aa+=0x1){let _0x32dcba=_0x4207d2[_0x33d4aa];for(var _0x37ec5b=0x0;_0x37ec5b<_0x32dcba['Agents'][_0xa398('0x39')];_0x37ec5b+=0x1){let _0x266c77=_0x32dcba[_0xa398('0x6c')][_0x37ec5b];var _0x3d9f05=_0x579aa2[_0xa398('0x74')]();_0x3d9f05[_0xa398('0x3f')]('ut.UserId\x20=\x20?',_0x266c77['id']);_0x4e80e9['push'](db['sequelize']['query'](_0x3d9f05['toString'](),{'type':db[_0xa398('0x66')][_0xa398('0x75')][_0xa398('0x76')]})[_0xa398('0x25')](function(_0x3ae9c7){if(_0x3ae9c7['length']===0x1){return _0x266c77['id'];}else{var _0x2d5f1c=_[_0xa398('0x77')](_['map'](_0x3ae9c7,_0xa398('0x78')),function(_0x2e312e){return _[_0xa398('0x79')](_0x105514,_0x2e312e);});if(_0x2d5f1c){return _0x266c77['id'];}}}));}}return BPromise[_0xa398('0x7a')](_0x4e80e9)[_0xa398('0x25')](function(_0x2d7c14){_0x263f40=_(_0x263f40)[_0xa398('0x7b')](_0x2d7c14)['compact']()[_0xa398('0x7c')]();return db[_0xa398('0x2f')][_0xa398('0x48')]({'where':{'id':_0x3206cf[_0xa398('0x46')]['id']}})[_0xa398('0x25')](function(_0x218e1a){return db[_0xa398('0x66')][_0xa398('0x67')](function(_0x4deecc){return _0x218e1a['removeTeams'](_0x3206cf['query']['ids'],{'transaction':_0x4deecc})[_0xa398('0x25')](function(){if(!_[_0xa398('0x7d')](_0x263f40)){return _0x218e1a[_0xa398('0x7e')](_0x263f40,{'transaction':_0x4deecc});}})[_0xa398('0x25')](function(){_0x263f40[_0xa398('0x7f')](function(_0x2648d5){socket['emit'](_0xa398('0x80'),{'UserId':_0x2648d5,'SmsQueueId':_0x218e1a['id']});});});});});});})['then'](respondWithStatusCode(_0x46bb0c,null))[_0xa398('0x45')](handleError(_0x46bb0c,null));};exports[_0xa398('0x81')]=function(_0xb2baf3,_0x229817,_0x324309){return db[_0xa398('0x2f')]['find']({'where':{'id':_0xb2baf3['params']['id']}})[_0xa398('0x25')](handleEntityNotFound(_0x229817,null))[_0xa398('0x25')](function(_0x39dccc){if(_0x39dccc){return _0x39dccc[_0xa398('0x81')](_0xb2baf3[_0xa398('0x4a')][_0xa398('0x61')],_['omit'](_0xb2baf3[_0xa398('0x4a')],[_0xa398('0x61'),'id'])||{})['spread'](function(_0x1d284c){for(var _0x22343e=0x0;_0x22343e<_0xb2baf3['body']['ids'][_0xa398('0x39')];_0x22343e+=0x1){socket[_0xa398('0x69')]('userSmsQueue:save',{'UserId':Number(_0xb2baf3[_0xa398('0x4a')][_0xa398('0x61')][_0x22343e]),'SmsQueueId':Number(_0xb2baf3[_0xa398('0x46')]['id'])});}return _0x1d284c;});}})['then'](respondWithResult(_0x229817,null))['catch'](handleError(_0x229817,null));};exports[_0xa398('0x7e')]=function(_0x47c1ac,_0x2a8e37,_0x481dad){return db[_0xa398('0x2f')]['find']({'where':{'id':_0x47c1ac[_0xa398('0x46')]['id']}})[_0xa398('0x25')](handleEntityNotFound(_0x2a8e37,null))[_0xa398('0x25')](function(_0x46989d){if(_0x46989d){return _0x46989d[_0xa398('0x7e')](_0x47c1ac['query'][_0xa398('0x61')])['then'](function(){if(_[_0xa398('0x82')](_0x47c1ac['query'][_0xa398('0x61')])){for(var _0x5a1065=0x0;_0x5a1065<_0x47c1ac[_0xa398('0x33')]['ids'][_0xa398('0x39')];_0x5a1065+=0x1){socket[_0xa398('0x69')](_0xa398('0x80'),{'UserId':Number(_0x47c1ac[_0xa398('0x33')][_0xa398('0x61')][_0x5a1065]),'SmsQueueId':Number(_0x47c1ac[_0xa398('0x46')]['id'])});}}else{socket['emit'](_0xa398('0x80'),{'UserId':Number(_0x47c1ac['query']['ids']),'SmsQueueId':Number(_0x47c1ac[_0xa398('0x46')]['id'])});}});}})[_0xa398('0x25')](respondWithStatusCode(_0x2a8e37,null))[_0xa398('0x45')](handleError(_0x2a8e37,null));};exports[_0xa398('0x83')]=function(_0x5dc754,_0x19b68c,_0x35fda4){var _0x2bb4e5={};var _0x14693f={};var _0x1c51b3;var _0x3e2119;return db[_0xa398('0x2f')]['findOne']({'where':{'id':_0x5dc754[_0xa398('0x46')]['id']}})['then'](handleEntityNotFound(_0x19b68c,null))['then'](function(_0x136ff1){if(_0x136ff1){_0x1c51b3=_0x136ff1;_0x14693f[_0xa398('0x32')]=_[_0xa398('0x34')](db[_0xa398('0x57')][_0xa398('0x30')]);_0x14693f[_0xa398('0x33')]=_[_0xa398('0x34')](_0x5dc754[_0xa398('0x33')]);_0x14693f[_0xa398('0x35')]=_[_0xa398('0x36')](_0x14693f[_0xa398('0x32')],_0x14693f['query']);_0x2bb4e5[_0xa398('0x37')]=_[_0xa398('0x36')](_0x14693f[_0xa398('0x32')],qs['fields'](_0x5dc754[_0xa398('0x33')][_0xa398('0x38')]));_0x2bb4e5[_0xa398('0x37')]=_0x2bb4e5[_0xa398('0x37')][_0xa398('0x39')]?_0x2bb4e5[_0xa398('0x37')]:_0x14693f[_0xa398('0x32')];_0x2bb4e5['order']=qs[_0xa398('0x3c')](_0x5dc754['query'][_0xa398('0x3c')]);_0x2bb4e5[_0xa398('0x3f')]=qs[_0xa398('0x35')](_[_0xa398('0x3d')](_0x5dc754['query'],_0x14693f[_0xa398('0x35')]));if(_0x5dc754[_0xa398('0x33')][_0xa398('0x3e')]){_0x2bb4e5['where']=_[_0xa398('0x47')](_0x2bb4e5[_0xa398('0x3f')],{'$or':_[_0xa398('0x2e')](_0x2bb4e5[_0xa398('0x37')],function(_0xe5bad3){var _0x17f047={};_0x17f047[_0xe5bad3]={'$like':'%'+_0x5dc754[_0xa398('0x33')][_0xa398('0x3e')]+'%'};return _0x17f047;})});}_0x2bb4e5=_[_0xa398('0x47')]({},_0x2bb4e5,_0x5dc754[_0xa398('0x40')]);return _0x1c51b3[_0xa398('0x83')](_0x2bb4e5);}})[_0xa398('0x25')](function(_0x3f4cd4){if(_0x3f4cd4){_0x3e2119=_0x3f4cd4[_0xa398('0x39')];if(!_0x5dc754['query'][_0xa398('0x3a')](_0xa398('0x5f'))){_0x2bb4e5[_0xa398('0x21')]=qs[_0xa398('0x21')](_0x5dc754[_0xa398('0x33')]['limit']);_0x2bb4e5['offset']=qs[_0xa398('0x1f')](_0x5dc754[_0xa398('0x33')]['offset']);}return _0x1c51b3['getAgents'](_0x2bb4e5);}})['then'](function(_0x1e1acc){if(_0x1e1acc){return _0x1e1acc?{'count':_0x3e2119,'rows':_0x1e1acc}:null;}})[_0xa398('0x25')](respondWithResult(_0x19b68c,null))['catch'](handleError(_0x19b68c,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index b9749be..3136b88 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 _0xf27d=['setMaxListeners','save','update','emit','hook','exports','../../mysqldb','SmsQueue'];(function(_0x4d50b4,_0x314aaa){var _0x18bcbf=function(_0x1f251f){while(--_0x1f251f){_0x4d50b4['push'](_0x4d50b4['shift']());}};_0x18bcbf(++_0x314aaa);}(_0xf27d,0xde));var _0xdf27=function(_0x390b27,_0x583fda){_0x390b27=_0x390b27-0x0;var _0x1e1b85=_0xf27d[_0x390b27];return _0x1e1b85;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xdf27('0x0'))['db'][_0xdf27('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xdf27('0x2')](0x0);var events={'afterCreate':_0xdf27('0x3'),'afterUpdate':_0xdf27('0x4'),'afterDestroy':'remove'};function emitEvent(_0x20a3be){return function(_0x4b80d5,_0x199dcf,_0x133203){SmsQueueEvents[_0xdf27('0x5')](_0x20a3be+':'+_0x4b80d5['id'],_0x4b80d5);SmsQueueEvents[_0xdf27('0x5')](_0x20a3be,_0x4b80d5);_0x133203(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xdf27('0x6')](e,emitEvent(event));}}module[_0xdf27('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xf699=['save','remove','emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xf699,0x72));var _0x9f69=function(_0xcca961,_0x394290){_0xcca961=_0xcca961-0x0;var _0x58712a=_0xf699[_0xcca961];return _0x58712a;};'use strict';var EventEmitter=require(_0x9f69('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x9f69('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9f69('0x2')](0x0);var events={'afterCreate':_0x9f69('0x3'),'afterUpdate':'update','afterDestroy':_0x9f69('0x4')};function emitEvent(_0x265da9){return function(_0x16a11b,_0x118d9a,_0x4df389){SmsQueueEvents[_0x9f69('0x5')](_0x265da9+':'+_0x16a11b['id'],_0x16a11b);SmsQueueEvents[_0x9f69('0x5')](_0x265da9,_0x16a11b);_0x4df389(null);};}for(var e in events){if(events[_0x9f69('0x6')](e)){var event=events[e];SmsQueue[_0x9f69('0x7')](e,emitEvent(event));}}module[_0x9f69('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 0860c34..164c744 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 _0x1b7f=['define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3b041f,_0x69381c){var _0x5a77aa=function(_0x2f35b5){while(--_0x2f35b5){_0x3b041f['push'](_0x3b041f['shift']());}};_0x5a77aa(++_0x69381c);}(_0x1b7f,0x65));var _0xf1b7=function(_0x1d13f6,_0x69e526){_0x1d13f6=_0x1d13f6-0x0;var _0x224674=_0x1b7f[_0x1d13f6];return _0x224674;};'use strict';var _=require(_0xf1b7('0x0'));var util=require(_0xf1b7('0x1'));var logger=require(_0xf1b7('0x2'))(_0xf1b7('0x3'));var moment=require(_0xf1b7('0x4'));var BPromise=require(_0xf1b7('0x5'));var rp=require(_0xf1b7('0x6'));var fs=require('fs');var path=require(_0xf1b7('0x7'));var rimraf=require(_0xf1b7('0x8'));var config=require(_0xf1b7('0x9'));var attributes=require('./smsQueue.attributes');module[_0xf1b7('0xa')]=function(_0x1dd1cb,_0x9fa8d5){return _0x1dd1cb[_0xf1b7('0xb')](_0xf1b7('0xc'),attributes,{'tableName':_0xf1b7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x631c=['define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x631c,0x155));var _0xc631=function(_0x502ef0,_0x3ed837){_0x502ef0=_0x502ef0-0x0;var _0x1d5783=_0x631c[_0x502ef0];return _0x1d5783;};'use strict';var _=require(_0xc631('0x0'));var util=require(_0xc631('0x1'));var logger=require(_0xc631('0x2'))(_0xc631('0x3'));var moment=require(_0xc631('0x4'));var BPromise=require(_0xc631('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc631('0x6'));var rimraf=require(_0xc631('0x7'));var config=require(_0xc631('0x8'));var attributes=require(_0xc631('0x9'));module['exports']=function(_0x2e54f1,_0x3b1a4e){return _0x2e54f1[_0xc631('0xa')](_0xc631('0xb'),attributes,{'tableName':_0xc631('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 b0f087e..2ad8de3 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 _0x140d=['ShowSmsQueue','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','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','findAll','options','raw','attributes','limit','map','model','include','find','where'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x140d,0x1b9));var _0xd140=function(_0x48e1ca,_0x2b2a59){_0x48e1ca=_0x48e1ca-0x0;var _0x1e814e=_0x140d[_0x48e1ca];return _0x1e814e;};'use strict';var _=require('lodash');var util=require(_0xd140('0x0'));var moment=require(_0xd140('0x1'));var BPromise=require('bluebird');var rs=require(_0xd140('0x2'));var fs=require('fs');var Redis=require(_0xd140('0x3'));var db=require(_0xd140('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd140('0x5'));var config=require(_0xd140('0x6'));var jayson=require(_0xd140('0x7'));var client=jayson['client'][_0xd140('0x8')]({'port':0x232a});config[_0xd140('0x9')]=_[_0xd140('0xa')](config[_0xd140('0x9')],{'host':_0xd140('0xb'),'port':0x18eb});var socket=require(_0xd140('0xc'))(new Redis(config[_0xd140('0x9')]));require(_0xd140('0xd'))['register'](socket);function respondWithRpcPromise(_0x8869b5,_0x51b810,_0x3014bc){return new BPromise(function(_0x41373d,_0x323996){return client[_0xd140('0xe')](_0x8869b5,_0x3014bc)[_0xd140('0xf')](function(_0x2ef494){logger[_0xd140('0x10')](_0xd140('0x11'),_0x51b810,_0xd140('0x12'));logger[_0xd140('0x13')](_0xd140('0x14'),_0x51b810,_0xd140('0x12'),JSON[_0xd140('0x15')](_0x2ef494));if(_0x2ef494['error']){if(_0x2ef494[_0xd140('0x16')][_0xd140('0x17')]===0x1f4){logger[_0xd140('0x16')]('SmsQueue,\x20%s,\x20%s',_0x51b810,_0x2ef494[_0xd140('0x16')]['message']);return _0x323996(_0x2ef494[_0xd140('0x16')][_0xd140('0x18')]);}logger[_0xd140('0x16')](_0xd140('0x11'),_0x51b810,_0x2ef494[_0xd140('0x16')]['message']);return _0x41373d(_0x2ef494[_0xd140('0x16')][_0xd140('0x18')]);}else{logger[_0xd140('0x10')](_0xd140('0x11'),_0x51b810,'request\x20sent');_0x41373d(_0x2ef494[_0xd140('0x19')][_0xd140('0x18')]);}})[_0xd140('0x1a')](function(_0x50d438){logger[_0xd140('0x16')](_0xd140('0x11'),_0x51b810,_0x50d438);_0x323996(_0x50d438);});});}exports[_0xd140('0x1b')]=function(_0x4c9e8a){var _0x51fecb=this;return new Promise(function(_0x5ed9d1,_0x4efa7){return db[_0xd140('0x1c')][_0xd140('0x1d')]({'raw':_0x4c9e8a[_0xd140('0x1e')]?_0x4c9e8a[_0xd140('0x1e')][_0xd140('0x1f')]===undefined?!![]:![]:!![],'where':_0x4c9e8a[_0xd140('0x1e')]?_0x4c9e8a[_0xd140('0x1e')]['where']||null:null,'attributes':_0x4c9e8a[_0xd140('0x1e')]?_0x4c9e8a[_0xd140('0x1e')][_0xd140('0x20')]||null:null,'limit':_0x4c9e8a['options']?_0x4c9e8a[_0xd140('0x1e')][_0xd140('0x21')]||null:null,'include':_0x4c9e8a[_0xd140('0x1e')]?_0x4c9e8a['options']['include']?_[_0xd140('0x22')](_0x4c9e8a[_0xd140('0x1e')]['include'],function(_0x4fd6f9){return{'model':db[_0x4fd6f9[_0xd140('0x23')]],'as':_0x4fd6f9['as'],'attributes':_0x4fd6f9['attributes'],'include':_0x4fd6f9[_0xd140('0x24')]?_['map'](_0x4fd6f9[_0xd140('0x24')],function(_0x52c62e){return{'model':db[_0x52c62e[_0xd140('0x23')]],'as':_0x52c62e['as'],'attributes':_0x52c62e[_0xd140('0x20')],'include':_0x52c62e[_0xd140('0x24')]?_[_0xd140('0x22')](_0x52c62e[_0xd140('0x24')],function(_0x59ce19){return{'model':db[_0x59ce19[_0xd140('0x23')]],'as':_0x59ce19['as'],'attributes':_0x59ce19[_0xd140('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd140('0xf')](function(_0x265b2a){logger[_0xd140('0x10')]('GetSmsQueue',_0x4c9e8a);logger[_0xd140('0x13')]('GetSmsQueue',_0x4c9e8a,JSON[_0xd140('0x15')](_0x265b2a));_0x5ed9d1(_0x265b2a);})[_0xd140('0x1a')](function(_0xfdbd62){logger[_0xd140('0x16')](_0xd140('0x1b'),_0xfdbd62[_0xd140('0x18')],_0x4c9e8a);_0x4efa7(_0x51fecb[_0xd140('0x16')](0x1f4,_0xfdbd62[_0xd140('0x18')]));});});};exports['ShowSmsQueue']=function(_0x3a603b){var _0x449c82=this;return new Promise(function(_0x103e61,_0x2f9a71){return db['SmsQueue'][_0xd140('0x25')]({'raw':_0x3a603b[_0xd140('0x1e')]?_0x3a603b['options'][_0xd140('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a603b['options']?_0x3a603b[_0xd140('0x1e')][_0xd140('0x26')]||null:null,'attributes':_0x3a603b[_0xd140('0x1e')]?_0x3a603b[_0xd140('0x1e')][_0xd140('0x20')]||null:null,'include':_0x3a603b['options']?_0x3a603b['options'][_0xd140('0x24')]?_[_0xd140('0x22')](_0x3a603b['options'][_0xd140('0x24')],function(_0x65ccdc){return{'model':db[_0x65ccdc[_0xd140('0x23')]],'as':_0x65ccdc['as'],'attributes':_0x65ccdc['attributes'],'include':_0x65ccdc['include']?_[_0xd140('0x22')](_0x65ccdc[_0xd140('0x24')],function(_0x5a2a44){return{'model':db[_0x5a2a44[_0xd140('0x23')]],'as':_0x5a2a44['as'],'attributes':_0x5a2a44[_0xd140('0x20')],'include':_0x5a2a44[_0xd140('0x24')]?_[_0xd140('0x22')](_0x5a2a44[_0xd140('0x24')],function(_0x5c30d4){return{'model':db[_0x5c30d4[_0xd140('0x23')]],'as':_0x5c30d4['as'],'attributes':_0x5c30d4[_0xd140('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd140('0xf')](function(_0x484542){logger[_0xd140('0x10')](_0xd140('0x27'),_0x3a603b);logger[_0xd140('0x13')]('ShowSmsQueue',_0x3a603b,JSON[_0xd140('0x15')](_0x484542));_0x103e61(_0x484542);})[_0xd140('0x1a')](function(_0x395bf9){logger[_0xd140('0x16')](_0xd140('0x27'),_0x395bf9['message'],_0x3a603b);_0x2f9a71(_0x449c82[_0xd140('0x16')](0x1f4,_0x395bf9['message']));});});}; \ No newline at end of file +var _0x505e=['error','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','findAll','options','where','attributes','limit','include','model','map','debug','ShowSmsQueue','SmsQueue','find','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','request\x20sent','stringify'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x505e,0xa2));var _0xe505=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0x505e[_0x4d8a8f];return _0xfc4adc;};'use strict';var _=require(_0xe505('0x0'));var util=require(_0xe505('0x1'));var moment=require(_0xe505('0x2'));var BPromise=require(_0xe505('0x3'));var rs=require(_0xe505('0x4'));var fs=require('fs');var Redis=require(_0xe505('0x5'));var db=require(_0xe505('0x6'))['db'];var utils=require(_0xe505('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe505('0x8')]({'port':0x232a});config[_0xe505('0x9')]=_[_0xe505('0xa')](config[_0xe505('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe505('0xb'))(new Redis(config[_0xe505('0x9')]));require(_0xe505('0xc'))[_0xe505('0xd')](socket);function respondWithRpcPromise(_0xcc346c,_0x5d2fad,_0x2a4fa0){return new BPromise(function(_0x5b464a,_0x3dcbb4){return client[_0xe505('0xe')](_0xcc346c,_0x2a4fa0)[_0xe505('0xf')](function(_0x490d85){logger['info']('SmsQueue,\x20%s,\x20%s',_0x5d2fad,_0xe505('0x10'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x5d2fad,_0xe505('0x10'),JSON[_0xe505('0x11')](_0x490d85));if(_0x490d85[_0xe505('0x12')]){if(_0x490d85[_0xe505('0x12')]['code']===0x1f4){logger[_0xe505('0x12')](_0xe505('0x13'),_0x5d2fad,_0x490d85[_0xe505('0x12')]['message']);return _0x3dcbb4(_0x490d85['error']['message']);}logger[_0xe505('0x12')](_0xe505('0x13'),_0x5d2fad,_0x490d85[_0xe505('0x12')][_0xe505('0x14')]);return _0x5b464a(_0x490d85[_0xe505('0x12')]['message']);}else{logger['info'](_0xe505('0x13'),_0x5d2fad,_0xe505('0x10'));_0x5b464a(_0x490d85['result']['message']);}})[_0xe505('0x15')](function(_0x12d9da){logger[_0xe505('0x12')](_0xe505('0x13'),_0x5d2fad,_0x12d9da);_0x3dcbb4(_0x12d9da);});});}exports[_0xe505('0x16')]=function(_0x26a343){var _0x29b48c=this;return new Promise(function(_0x451027,_0x4271cf){return db['SmsQueue'][_0xe505('0x17')]({'raw':_0x26a343[_0xe505('0x18')]?_0x26a343[_0xe505('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x26a343['options']?_0x26a343[_0xe505('0x18')][_0xe505('0x19')]||null:null,'attributes':_0x26a343[_0xe505('0x18')]?_0x26a343['options'][_0xe505('0x1a')]||null:null,'limit':_0x26a343[_0xe505('0x18')]?_0x26a343['options'][_0xe505('0x1b')]||null:null,'include':_0x26a343[_0xe505('0x18')]?_0x26a343['options'][_0xe505('0x1c')]?_['map'](_0x26a343[_0xe505('0x18')][_0xe505('0x1c')],function(_0x4d0489){return{'model':db[_0x4d0489[_0xe505('0x1d')]],'as':_0x4d0489['as'],'attributes':_0x4d0489[_0xe505('0x1a')],'include':_0x4d0489['include']?_['map'](_0x4d0489[_0xe505('0x1c')],function(_0x57081d){return{'model':db[_0x57081d[_0xe505('0x1d')]],'as':_0x57081d['as'],'attributes':_0x57081d[_0xe505('0x1a')],'include':_0x57081d[_0xe505('0x1c')]?_[_0xe505('0x1e')](_0x57081d['include'],function(_0x5ccc51){return{'model':db[_0x5ccc51[_0xe505('0x1d')]],'as':_0x5ccc51['as'],'attributes':_0x5ccc51[_0xe505('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe505('0xf')](function(_0x39b0b2){logger['info']('GetSmsQueue',_0x26a343);logger[_0xe505('0x1f')](_0xe505('0x16'),_0x26a343,JSON[_0xe505('0x11')](_0x39b0b2));_0x451027(_0x39b0b2);})[_0xe505('0x15')](function(_0x28891c){logger[_0xe505('0x12')](_0xe505('0x16'),_0x28891c[_0xe505('0x14')],_0x26a343);_0x4271cf(_0x29b48c['error'](0x1f4,_0x28891c[_0xe505('0x14')]));});});};exports[_0xe505('0x20')]=function(_0x1b91d5){var _0x36e683=this;return new Promise(function(_0x1ae2b3,_0x1c41e0){return db[_0xe505('0x21')][_0xe505('0x22')]({'raw':_0x1b91d5[_0xe505('0x18')]?_0x1b91d5[_0xe505('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1b91d5[_0xe505('0x18')]?_0x1b91d5['options'][_0xe505('0x19')]||null:null,'attributes':_0x1b91d5['options']?_0x1b91d5[_0xe505('0x18')]['attributes']||null:null,'include':_0x1b91d5[_0xe505('0x18')]?_0x1b91d5[_0xe505('0x18')][_0xe505('0x1c')]?_[_0xe505('0x1e')](_0x1b91d5[_0xe505('0x18')][_0xe505('0x1c')],function(_0x3bb431){return{'model':db[_0x3bb431[_0xe505('0x1d')]],'as':_0x3bb431['as'],'attributes':_0x3bb431[_0xe505('0x1a')],'include':_0x3bb431[_0xe505('0x1c')]?_[_0xe505('0x1e')](_0x3bb431[_0xe505('0x1c')],function(_0x3823d9){return{'model':db[_0x3823d9[_0xe505('0x1d')]],'as':_0x3823d9['as'],'attributes':_0x3823d9[_0xe505('0x1a')],'include':_0x3823d9['include']?_[_0xe505('0x1e')](_0x3823d9[_0xe505('0x1c')],function(_0x83a3ca){return{'model':db[_0x83a3ca[_0xe505('0x1d')]],'as':_0x83a3ca['as'],'attributes':_0x83a3ca[_0xe505('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a2497){logger[_0xe505('0x23')](_0xe505('0x20'),_0x1b91d5);logger[_0xe505('0x1f')](_0xe505('0x20'),_0x1b91d5,JSON[_0xe505('0x11')](_0x4a2497));_0x1ae2b3(_0x4a2497);})[_0xe505('0x15')](function(_0x443cd6){logger['error'](_0xe505('0x20'),_0x443cd6['message'],_0x1b91d5);_0x1c41e0(_0x36e683['error'](0x1f4,_0x443cd6['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 74e97e5..2cc80f2 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 _0xa2a5=['smsQueue:','./smsQueue.events','remove','update','emit','register','length'];(function(_0x2d2b6a,_0x3549ef){var _0x49f70d=function(_0x301c1d){while(--_0x301c1d){_0x2d2b6a['push'](_0x2d2b6a['shift']());}};_0x49f70d(++_0x3549ef);}(_0xa2a5,0x119));var _0x5a2a=function(_0x2fbcbf,_0x21392f){_0x2fbcbf=_0x2fbcbf-0x0;var _0x316396=_0xa2a5[_0x2fbcbf];return _0x316396;};'use strict';var SmsQueueEvents=require(_0x5a2a('0x0'));var events=['save',_0x5a2a('0x1'),_0x5a2a('0x2')];function createListener(_0x4d11e1,_0x1751a1){return function(_0x391f2d){_0x1751a1[_0x5a2a('0x3')](_0x4d11e1,_0x391f2d);};}function removeListener(_0x4e54e2,_0x44eb3b){return function(){SmsQueueEvents['removeListener'](_0x4e54e2,_0x44eb3b);};}exports[_0x5a2a('0x4')]=function(_0x2ac42b){for(var _0x287ac2=0x0,_0x312191=events[_0x5a2a('0x5')];_0x287ac2<_0x312191;_0x287ac2++){var _0x21719b=events[_0x287ac2];var _0x14064b=createListener(_0x5a2a('0x6')+_0x21719b,_0x2ac42b);SmsQueueEvents['on'](_0x21719b,_0x14064b);}}; \ No newline at end of file +var _0xb4b7=['update','emit','removeListener','length','smsQueue:','./smsQueue.events','save'];(function(_0x3b6a6d,_0x3ba7df){var _0x13268d=function(_0x3f94f1){while(--_0x3f94f1){_0x3b6a6d['push'](_0x3b6a6d['shift']());}};_0x13268d(++_0x3ba7df);}(_0xb4b7,0x11d));var _0x7b4b=function(_0x1e6d64,_0xfe5157){_0x1e6d64=_0x1e6d64-0x0;var _0x1c97d4=_0xb4b7[_0x1e6d64];return _0x1c97d4;};'use strict';var SmsQueueEvents=require(_0x7b4b('0x0'));var events=[_0x7b4b('0x1'),'remove',_0x7b4b('0x2')];function createListener(_0x402213,_0x33c822){return function(_0x2b9db2){_0x33c822[_0x7b4b('0x3')](_0x402213,_0x2b9db2);};}function removeListener(_0x385250,_0x19ac62){return function(){SmsQueueEvents[_0x7b4b('0x4')](_0x385250,_0x19ac62);};}exports['register']=function(_0x3e3d7c){for(var _0x34c3c9=0x0,_0x4e09a9=events[_0x7b4b('0x5')];_0x34c3c9<_0x4e09a9;_0x34c3c9++){var _0x4bc82f=events[_0x34c3c9];var _0x3e0624=createListener(_0x7b4b('0x6')+_0x4bc82f,_0x3e3d7c);SmsQueueEvents['on'](_0x4bc82f,_0x3e0624);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 8e582b8..b1d70b4 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 _0xf1c6=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','destroy','path','connect-timeout','express','Router','fs-extra'];(function(_0x3391fe,_0x5c24d9){var _0x1ae383=function(_0x5e71a4){while(--_0x5e71a4){_0x3391fe['push'](_0x3391fe['shift']());}};_0x1ae383(++_0x5c24d9);}(_0xf1c6,0x145));var _0x6f1c=function(_0x1c7370,_0x401d0c){_0x1c7370=_0x1c7370-0x0;var _0x436d97=_0xf1c6[_0x1c7370];return _0x436d97;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f1c('0x0'));var timeout=require(_0x6f1c('0x1'));var express=require(_0x6f1c('0x2'));var router=express[_0x6f1c('0x3')]();var fs_extra=require(_0x6f1c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f1c('0x5'));var controller=require('./smsQueueReport.controller');router[_0x6f1c('0x6')]('/',auth[_0x6f1c('0x7')](),controller[_0x6f1c('0x8')]);router['get'](_0x6f1c('0x9'),auth['isAuthenticated'](),controller[_0x6f1c('0xa')]);router[_0x6f1c('0x6')](_0x6f1c('0xb'),auth['isAuthenticated'](),controller[_0x6f1c('0xc')]);router['post']('/',auth[_0x6f1c('0x7')](),controller[_0x6f1c('0xd')]);router['put'](_0x6f1c('0xb'),auth[_0x6f1c('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6f1c('0xe')]);module['exports']=router; \ No newline at end of file +var _0xcca7=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xcca7,0x1aa));var _0x7cca=function(_0x118355,_0x201311){_0x118355=_0x118355-0x0;var _0x32f7ea=_0xcca7[_0x118355];return _0x32f7ea;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require(_0x7cca('0x7'));router[_0x7cca('0x8')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xa')]);router['get']('/describe',auth[_0x7cca('0x9')](),controller[_0x7cca('0xb')]);router[_0x7cca('0x8')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x10')]('/:id',auth[_0x7cca('0x9')](),controller[_0x7cca('0x11')]);router[_0x7cca('0x12')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller['destroy']);module[_0x7cca('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 64f383d..34a6ed9 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 _0x11ce=['sequelize','STRING','DATE','moment'];(function(_0x1db2a6,_0x1b6877){var _0xd87758=function(_0xd64823){while(--_0xd64823){_0x1db2a6['push'](_0x1db2a6['shift']());}};_0xd87758(++_0x1b6877);}(_0x11ce,0xd3));var _0xe11c=function(_0x1803f6,_0x2f89c4){_0x1803f6=_0x1803f6-0x0;var _0x4f178e=_0x11ce[_0x1803f6];return _0x4f178e;};'use strict';var moment=require(_0xe11c('0x0'));var Sequelize=require(_0xe11c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe11c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe11c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe11c('0x3')]},'acceptAt':{'type':Sequelize[_0xe11c('0x3')]},'exitAt':{'type':Sequelize[_0xe11c('0x3')]},'reason':{'type':Sequelize[_0xe11c('0x2')]}}; \ No newline at end of file +var _0x1eab=['DATE','moment','exports','STRING'];(function(_0x4f65ea,_0x8dfc0e){var _0x5235d9=function(_0x5a2fa0){while(--_0x5a2fa0){_0x4f65ea['push'](_0x4f65ea['shift']());}};_0x5235d9(++_0x8dfc0e);}(_0x1eab,0xad));var _0xb1ea=function(_0x4aa3f3,_0x294d69){_0x4aa3f3=_0x4aa3f3-0x0;var _0x2704e9=_0x1eab[_0x4aa3f3];return _0x2704e9;};'use strict';var moment=require(_0xb1ea('0x0'));var Sequelize=require('sequelize');module[_0xb1ea('0x1')]={'uniqueid':{'type':Sequelize[_0xb1ea('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb1ea('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb1ea('0x3')]},'acceptAt':{'type':Sequelize[_0xb1ea('0x3')]},'exitAt':{'type':Sequelize[_0xb1ea('0x3')]},'reason':{'type':Sequelize[_0xb1ea('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 698c529..4462822 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 _0x5312=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','keys','fields','length','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x5747dc,_0x51e2c1){var _0x52757c=function(_0x525b94){while(--_0x525b94){_0x5747dc['push'](_0x5747dc['shift']());}};_0x52757c(++_0x51e2c1);}(_0x5312,0xce));var _0x2531=function(_0x377425,_0xf26548){_0x377425=_0x377425-0x0;var _0x362cef=_0x5312[_0x377425];return _0x362cef;};'use strict';var emlformat=require(_0x2531('0x0'));var rimraf=require(_0x2531('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2531('0x2'));var rp=require(_0x2531('0x3'));var moment=require(_0x2531('0x4'));var BPromise=require(_0x2531('0x5'));var Mustache=require(_0x2531('0x6'));var util=require(_0x2531('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2531('0x8'));var ejs=require(_0x2531('0x9'));var fs=require('fs');var fs_extra=require(_0x2531('0xa'));var _=require(_0x2531('0xb'));var squel=require(_0x2531('0xc'));var crypto=require(_0x2531('0xd'));var jsforce=require(_0x2531('0xe'));var deskjs=require(_0x2531('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2531('0x10'));var Redis=require(_0x2531('0x11'));var authService=require(_0x2531('0x12'));var qs=require(_0x2531('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2531('0x14'))(_0x2531('0x15'));var utils=require(_0x2531('0x16'));var config=require(_0x2531('0x17'));var licenseUtil=require(_0x2531('0x18'));var db=require(_0x2531('0x19'))['db'];function respondWithStatusCode(_0x3e2ae9,_0x4a79db){_0x4a79db=_0x4a79db||0xcc;return function(_0x51b225){if(_0x51b225){return _0x3e2ae9[_0x2531('0x1a')](_0x4a79db);}return _0x3e2ae9[_0x2531('0x1b')](_0x4a79db)[_0x2531('0x1c')]();};}function respondWithResult(_0x37c5b4,_0x407f6b){_0x407f6b=_0x407f6b||0xc8;return function(_0x5beab8){if(_0x5beab8){return _0x37c5b4[_0x2531('0x1b')](_0x407f6b)[_0x2531('0x1d')](_0x5beab8);}};}function respondWithFilteredResult(_0x162bc0,_0x5d9d15){return function(_0x20519e){if(_0x20519e){var _0x2c751f=typeof _0x5d9d15[_0x2531('0x1e')]===_0x2531('0x1f')&&typeof _0x5d9d15[_0x2531('0x20')]===_0x2531('0x1f');var _0x43f92c=_0x20519e[_0x2531('0x21')];var _0x221101=_0x2c751f?0x0:_0x5d9d15[_0x2531('0x1e')];var _0x548e6f=_0x2c751f?_0x20519e[_0x2531('0x21')]:_0x5d9d15[_0x2531('0x1e')]+_0x5d9d15['limit'];var _0x37c767;if(_0x548e6f>=_0x43f92c){_0x548e6f=_0x43f92c;_0x37c767=0xc8;}else{_0x37c767=0xce;}_0x162bc0[_0x2531('0x1b')](_0x37c767);return _0x162bc0[_0x2531('0x22')](_0x2531('0x23'),_0x221101+'-'+_0x548e6f+'/'+_0x43f92c)[_0x2531('0x1d')](_0x20519e);}return null;};}function patchUpdates(_0x547097){return function(_0x5f0370){try{jsonpatch[_0x2531('0x24')](_0x5f0370,_0x547097,!![]);}catch(_0x2af91a){return BPromise['reject'](_0x2af91a);}return _0x5f0370['save']();};}function saveUpdates(_0x567941,_0x30fc8d){return function(_0xc9855a){if(_0xc9855a){return _0xc9855a[_0x2531('0x25')](_0x567941)['then'](function(_0x10350d){return _0x10350d;});}return null;};}function removeEntity(_0x26fa89,_0x198a52){return function(_0x5d3d97){if(_0x5d3d97){return _0x5d3d97[_0x2531('0x26')]()['then'](function(){_0x26fa89['status'](0xcc)[_0x2531('0x1c')]();});}};}function handleEntityNotFound(_0x5e476f,_0xb42a95){return function(_0x333061){if(!_0x333061){_0x5e476f[_0x2531('0x1a')](0x194);}return _0x333061;};}function handleError(_0x34c8a8,_0x37fdea){_0x37fdea=_0x37fdea||0x1f4;return function(_0x1dc9f8){logger['error'](_0x1dc9f8['stack']);if(_0x1dc9f8[_0x2531('0x27')]){delete _0x1dc9f8['name'];}_0x34c8a8['status'](_0x37fdea)[_0x2531('0x28')](_0x1dc9f8);};}exports[_0x2531('0x29')]=function(_0x113c2b,_0x5bf94e){var _0x3ebe77={},_0x3de907={},_0x2244c4={'count':0x0,'rows':[]};var _0x291b31=_[_0x2531('0x2a')](db[_0x2531('0x2b')][_0x2531('0x2c')],function(_0xe13460){return{'name':_0xe13460[_0x2531('0x2d')],'type':_0xe13460[_0x2531('0x2e')][_0x2531('0x2f')]};});_0x3de907[_0x2531('0x30')]=_[_0x2531('0x2a')](_0x291b31,_0x2531('0x27'));_0x3de907[_0x2531('0x31')]=_['keys'](_0x113c2b[_0x2531('0x31')]);_0x3de907['filters']=_[_0x2531('0x32')](_0x3de907[_0x2531('0x30')],_0x3de907[_0x2531('0x31')]);_0x3ebe77['attributes']=_[_0x2531('0x32')](_0x3de907[_0x2531('0x30')],qs['fields'](_0x113c2b['query']['fields']));_0x3ebe77['attributes']=_0x3ebe77['attributes']['length']?_0x3ebe77[_0x2531('0x33')]:_0x3de907[_0x2531('0x30')];if(!_0x113c2b[_0x2531('0x31')][_0x2531('0x34')](_0x2531('0x35'))){_0x3ebe77[_0x2531('0x20')]=qs[_0x2531('0x20')](_0x113c2b[_0x2531('0x31')][_0x2531('0x20')]);_0x3ebe77[_0x2531('0x1e')]=qs[_0x2531('0x1e')](_0x113c2b[_0x2531('0x31')][_0x2531('0x1e')]);}_0x3ebe77['order']=qs[_0x2531('0x36')](_0x113c2b['query'][_0x2531('0x36')]);_0x3ebe77[_0x2531('0x37')]=qs[_0x2531('0x38')](_[_0x2531('0x39')](_0x113c2b[_0x2531('0x31')],_0x3de907[_0x2531('0x38')]),_0x291b31);if(_0x113c2b['query'][_0x2531('0x3a')]){_0x3ebe77[_0x2531('0x37')]=_['merge'](_0x3ebe77['where'],{'$or':_[_0x2531('0x2a')](_0x291b31,function(_0x3e58e8){if(_0x3e58e8[_0x2531('0x2e')]!=='VIRTUAL'){var _0x499d3d={};_0x499d3d[_0x3e58e8[_0x2531('0x27')]]={'$like':'%'+_0x113c2b[_0x2531('0x31')][_0x2531('0x3a')]+'%'};return _0x499d3d;}})});}_0x3ebe77=_[_0x2531('0x3b')]({},_0x3ebe77,_0x113c2b[_0x2531('0x3c')]);var _0xb039f4={'where':_0x3ebe77['where']};return db[_0x2531('0x2b')][_0x2531('0x21')](_0xb039f4)[_0x2531('0x3d')](function(_0x242f18){_0x2244c4[_0x2531('0x21')]=_0x242f18;if(_0x113c2b['query'][_0x2531('0x3e')]){_0x3ebe77[_0x2531('0x3f')]=[{'all':!![]}];}return db[_0x2531('0x2b')][_0x2531('0x40')](_0x3ebe77);})[_0x2531('0x3d')](function(_0x51770f){_0x2244c4[_0x2531('0x41')]=_0x51770f;return _0x2244c4;})[_0x2531('0x3d')](respondWithFilteredResult(_0x5bf94e,_0x3ebe77))[_0x2531('0x42')](handleError(_0x5bf94e,null));};exports[_0x2531('0x43')]=function(_0x23f54e,_0x5f2a57){var _0x587b1e={'raw':!![],'where':{'id':_0x23f54e['params']['id']}},_0x1f0124={};_0x1f0124[_0x2531('0x30')]=_[_0x2531('0x44')](db[_0x2531('0x2b')][_0x2531('0x2c')]);_0x1f0124[_0x2531('0x31')]=_[_0x2531('0x44')](_0x23f54e['query']);_0x1f0124['filters']=_[_0x2531('0x32')](_0x1f0124[_0x2531('0x30')],_0x1f0124[_0x2531('0x31')]);_0x587b1e[_0x2531('0x33')]=_[_0x2531('0x32')](_0x1f0124[_0x2531('0x30')],qs[_0x2531('0x45')](_0x23f54e[_0x2531('0x31')][_0x2531('0x45')]));_0x587b1e[_0x2531('0x33')]=_0x587b1e[_0x2531('0x33')][_0x2531('0x46')]?_0x587b1e[_0x2531('0x33')]:_0x1f0124[_0x2531('0x30')];if(_0x23f54e[_0x2531('0x31')][_0x2531('0x3e')]){_0x587b1e[_0x2531('0x3f')]=[{'all':!![]}];}_0x587b1e=_[_0x2531('0x3b')]({},_0x587b1e,_0x23f54e[_0x2531('0x3c')]);return db[_0x2531('0x2b')][_0x2531('0x47')](_0x587b1e)[_0x2531('0x3d')](handleEntityNotFound(_0x5f2a57,null))['then'](respondWithResult(_0x5f2a57,null))[_0x2531('0x42')](handleError(_0x5f2a57,null));};exports[_0x2531('0x48')]=function(_0x43fe0a,_0x48afae){return db[_0x2531('0x2b')][_0x2531('0x48')](_0x43fe0a['body'],{})[_0x2531('0x3d')](respondWithResult(_0x48afae,0xc9))[_0x2531('0x42')](handleError(_0x48afae,null));};exports['update']=function(_0x15cc4b,_0x4ebd2a){if(_0x15cc4b['body']['id']){delete _0x15cc4b[_0x2531('0x49')]['id'];}return db[_0x2531('0x2b')]['find']({'where':{'id':_0x15cc4b[_0x2531('0x4a')]['id']}})[_0x2531('0x3d')](handleEntityNotFound(_0x4ebd2a,null))[_0x2531('0x3d')](saveUpdates(_0x15cc4b[_0x2531('0x49')],null))['then'](respondWithResult(_0x4ebd2a,null))[_0x2531('0x42')](handleError(_0x4ebd2a,null));};exports['destroy']=function(_0x437e17,_0x2a3987){return db[_0x2531('0x2b')][_0x2531('0x47')]({'where':{'id':_0x437e17[_0x2531('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2a3987,null))['then'](removeEntity(_0x2a3987,null))['catch'](handleError(_0x2a3987,null));};exports[_0x2531('0x4b')]=function(_0x5cbcb2,_0x355fc8){return db[_0x2531('0x2b')][_0x2531('0x4b')]()[_0x2531('0x3d')](respondWithResult(_0x355fc8,null))[_0x2531('0x42')](handleError(_0x355fc8,null));}; \ No newline at end of file +var _0xb1b2=['length','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','destroy','then','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','SmsQueueReport','includeAll','include','catch','show','rawAttributes'];(function(_0x537433,_0x337fab){var _0x19e6b6=function(_0x3f3ca3){while(--_0x3f3ca3){_0x537433['push'](_0x537433['shift']());}};_0x19e6b6(++_0x337fab);}(_0xb1b2,0x183));var _0x2b1b=function(_0x3539d1,_0x2c1cb2){_0x3539d1=_0x3539d1-0x0;var _0x3ad7b7=_0xb1b2[_0x3539d1];return _0x3ad7b7;};'use strict';var emlformat=require(_0x2b1b('0x0'));var rimraf=require(_0x2b1b('0x1'));var zipdir=require(_0x2b1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b1b('0x3'));var moment=require(_0x2b1b('0x4'));var BPromise=require(_0x2b1b('0x5'));var Mustache=require(_0x2b1b('0x6'));var util=require(_0x2b1b('0x7'));var path=require(_0x2b1b('0x8'));var sox=require(_0x2b1b('0x9'));var csv=require(_0x2b1b('0xa'));var ejs=require(_0x2b1b('0xb'));var fs=require('fs');var fs_extra=require(_0x2b1b('0xc'));var _=require(_0x2b1b('0xd'));var squel=require(_0x2b1b('0xe'));var crypto=require('crypto');var jsforce=require(_0x2b1b('0xf'));var deskjs=require(_0x2b1b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2b1b('0x11'));var Papa=require(_0x2b1b('0x12'));var Redis=require(_0x2b1b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2b1b('0x14'));var as=require(_0x2b1b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b1b('0x16'))(_0x2b1b('0x17'));var utils=require('../../config/utils');var config=require(_0x2b1b('0x18'));var licenseUtil=require(_0x2b1b('0x19'));var db=require(_0x2b1b('0x1a'))['db'];function respondWithStatusCode(_0x14461d,_0x4d74e4){_0x4d74e4=_0x4d74e4||0xcc;return function(_0x22a347){if(_0x22a347){return _0x14461d[_0x2b1b('0x1b')](_0x4d74e4);}return _0x14461d[_0x2b1b('0x1c')](_0x4d74e4)[_0x2b1b('0x1d')]();};}function respondWithResult(_0x349efa,_0x60302b){_0x60302b=_0x60302b||0xc8;return function(_0x4d9904){if(_0x4d9904){return _0x349efa[_0x2b1b('0x1c')](_0x60302b)[_0x2b1b('0x1e')](_0x4d9904);}};}function respondWithFilteredResult(_0x202836,_0x3493f0){return function(_0x24f2d6){if(_0x24f2d6){var _0x3d1bb8=typeof _0x3493f0['offset']==='undefined'&&typeof _0x3493f0[_0x2b1b('0x1f')]===_0x2b1b('0x20');var _0x2d1eaa=_0x24f2d6[_0x2b1b('0x21')];var _0xafa3d9=_0x3d1bb8?0x0:_0x3493f0[_0x2b1b('0x22')];var _0xe32438=_0x3d1bb8?_0x24f2d6[_0x2b1b('0x21')]:_0x3493f0['offset']+_0x3493f0[_0x2b1b('0x1f')];var _0x4263a6;if(_0xe32438>=_0x2d1eaa){_0xe32438=_0x2d1eaa;_0x4263a6=0xc8;}else{_0x4263a6=0xce;}_0x202836['status'](_0x4263a6);return _0x202836['set'](_0x2b1b('0x23'),_0xafa3d9+'-'+_0xe32438+'/'+_0x2d1eaa)['json'](_0x24f2d6);}return null;};}function patchUpdates(_0x915a8c){return function(_0x2fb8ab){try{jsonpatch['apply'](_0x2fb8ab,_0x915a8c,!![]);}catch(_0x2e0fa8){return BPromise[_0x2b1b('0x24')](_0x2e0fa8);}return _0x2fb8ab[_0x2b1b('0x25')]();};}function saveUpdates(_0x203d59,_0x29abc7){return function(_0x5dcb46){if(_0x5dcb46){return _0x5dcb46['update'](_0x203d59)['then'](function(_0x4b89e3){return _0x4b89e3;});}return null;};}function removeEntity(_0x2a498f,_0x5464ef){return function(_0x2a311c){if(_0x2a311c){return _0x2a311c[_0x2b1b('0x26')]()[_0x2b1b('0x27')](function(){_0x2a498f[_0x2b1b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e9069,_0x5dfa42){return function(_0x1130a3){if(!_0x1130a3){_0x3e9069[_0x2b1b('0x1b')](0x194);}return _0x1130a3;};}function handleError(_0x36735e,_0xc6957b){_0xc6957b=_0xc6957b||0x1f4;return function(_0x2284c3){logger[_0x2b1b('0x28')](_0x2284c3['stack']);if(_0x2284c3[_0x2b1b('0x29')]){delete _0x2284c3[_0x2b1b('0x29')];}_0x36735e[_0x2b1b('0x1c')](_0xc6957b)[_0x2b1b('0x2a')](_0x2284c3);};}exports[_0x2b1b('0x2b')]=function(_0x18b730,_0x18e59a){var _0x2d2d92={},_0x5596c5={},_0x1e043a={'count':0x0,'rows':[]};var _0x1b3a36=_[_0x2b1b('0x2c')](db['SmsQueueReport']['rawAttributes'],function(_0x4f4d7d){return{'name':_0x4f4d7d[_0x2b1b('0x2d')],'type':_0x4f4d7d[_0x2b1b('0x2e')][_0x2b1b('0x2f')]};});_0x5596c5['model']=_[_0x2b1b('0x2c')](_0x1b3a36,_0x2b1b('0x29'));_0x5596c5[_0x2b1b('0x30')]=_[_0x2b1b('0x31')](_0x18b730[_0x2b1b('0x30')]);_0x5596c5[_0x2b1b('0x32')]=_[_0x2b1b('0x33')](_0x5596c5[_0x2b1b('0x34')],_0x5596c5['query']);_0x2d2d92[_0x2b1b('0x35')]=_[_0x2b1b('0x33')](_0x5596c5['model'],qs[_0x2b1b('0x36')](_0x18b730['query'][_0x2b1b('0x36')]));_0x2d2d92[_0x2b1b('0x35')]=_0x2d2d92['attributes']['length']?_0x2d2d92[_0x2b1b('0x35')]:_0x5596c5['model'];if(!_0x18b730[_0x2b1b('0x30')][_0x2b1b('0x37')](_0x2b1b('0x38'))){_0x2d2d92[_0x2b1b('0x1f')]=qs[_0x2b1b('0x1f')](_0x18b730[_0x2b1b('0x30')]['limit']);_0x2d2d92[_0x2b1b('0x22')]=qs['offset'](_0x18b730[_0x2b1b('0x30')][_0x2b1b('0x22')]);}_0x2d2d92['order']=qs[_0x2b1b('0x39')](_0x18b730[_0x2b1b('0x30')][_0x2b1b('0x39')]);_0x2d2d92[_0x2b1b('0x3a')]=qs['filters'](_[_0x2b1b('0x3b')](_0x18b730[_0x2b1b('0x30')],_0x5596c5[_0x2b1b('0x32')]),_0x1b3a36);if(_0x18b730['query'][_0x2b1b('0x3c')]){_0x2d2d92['where']=_['merge'](_0x2d2d92[_0x2b1b('0x3a')],{'$or':_[_0x2b1b('0x2c')](_0x1b3a36,function(_0x406bcf){if(_0x406bcf['type']!=='VIRTUAL'){var _0x8368e6={};_0x8368e6[_0x406bcf[_0x2b1b('0x29')]]={'$like':'%'+_0x18b730[_0x2b1b('0x30')]['filter']+'%'};return _0x8368e6;}})});}_0x2d2d92=_[_0x2b1b('0x3d')]({},_0x2d2d92,_0x18b730[_0x2b1b('0x3e')]);var _0x2a307b={'where':_0x2d2d92[_0x2b1b('0x3a')]};return db[_0x2b1b('0x3f')][_0x2b1b('0x21')](_0x2a307b)[_0x2b1b('0x27')](function(_0x1b956c){_0x1e043a[_0x2b1b('0x21')]=_0x1b956c;if(_0x18b730[_0x2b1b('0x30')][_0x2b1b('0x40')]){_0x2d2d92[_0x2b1b('0x41')]=[{'all':!![]}];}return db[_0x2b1b('0x3f')]['findAll'](_0x2d2d92);})['then'](function(_0x4d039a){_0x1e043a['rows']=_0x4d039a;return _0x1e043a;})[_0x2b1b('0x27')](respondWithFilteredResult(_0x18e59a,_0x2d2d92))[_0x2b1b('0x42')](handleError(_0x18e59a,null));};exports[_0x2b1b('0x43')]=function(_0x15b346,_0x1e9d8c){var _0x26089f={'raw':!![],'where':{'id':_0x15b346['params']['id']}},_0x39c790={};_0x39c790[_0x2b1b('0x34')]=_[_0x2b1b('0x31')](db[_0x2b1b('0x3f')][_0x2b1b('0x44')]);_0x39c790[_0x2b1b('0x30')]=_['keys'](_0x15b346[_0x2b1b('0x30')]);_0x39c790[_0x2b1b('0x32')]=_['intersection'](_0x39c790['model'],_0x39c790[_0x2b1b('0x30')]);_0x26089f[_0x2b1b('0x35')]=_[_0x2b1b('0x33')](_0x39c790[_0x2b1b('0x34')],qs[_0x2b1b('0x36')](_0x15b346[_0x2b1b('0x30')]['fields']));_0x26089f[_0x2b1b('0x35')]=_0x26089f[_0x2b1b('0x35')][_0x2b1b('0x45')]?_0x26089f[_0x2b1b('0x35')]:_0x39c790['model'];if(_0x15b346['query']['includeAll']){_0x26089f['include']=[{'all':!![]}];}_0x26089f=_[_0x2b1b('0x3d')]({},_0x26089f,_0x15b346['options']);return db['SmsQueueReport'][_0x2b1b('0x46')](_0x26089f)[_0x2b1b('0x27')](handleEntityNotFound(_0x1e9d8c,null))[_0x2b1b('0x27')](respondWithResult(_0x1e9d8c,null))['catch'](handleError(_0x1e9d8c,null));};exports[_0x2b1b('0x47')]=function(_0x166766,_0x43361b){return db['SmsQueueReport'][_0x2b1b('0x47')](_0x166766[_0x2b1b('0x48')],{})[_0x2b1b('0x27')](respondWithResult(_0x43361b,0xc9))['catch'](handleError(_0x43361b,null));};exports[_0x2b1b('0x49')]=function(_0x304d89,_0x4037c9){if(_0x304d89[_0x2b1b('0x48')]['id']){delete _0x304d89[_0x2b1b('0x48')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x304d89[_0x2b1b('0x4a')]['id']}})[_0x2b1b('0x27')](handleEntityNotFound(_0x4037c9,null))[_0x2b1b('0x27')](saveUpdates(_0x304d89[_0x2b1b('0x48')],null))[_0x2b1b('0x27')](respondWithResult(_0x4037c9,null))[_0x2b1b('0x42')](handleError(_0x4037c9,null));};exports[_0x2b1b('0x26')]=function(_0x212f41,_0x6f4f7d){return db[_0x2b1b('0x3f')][_0x2b1b('0x46')]({'where':{'id':_0x212f41['params']['id']}})[_0x2b1b('0x27')](handleEntityNotFound(_0x6f4f7d,null))[_0x2b1b('0x27')](removeEntity(_0x6f4f7d,null))[_0x2b1b('0x42')](handleError(_0x6f4f7d,null));};exports[_0x2b1b('0x4b')]=function(_0x21868f,_0x4513a0){return db['SmsQueueReport'][_0x2b1b('0x4b')]()[_0x2b1b('0x27')](respondWithResult(_0x4513a0,null))[_0x2b1b('0x42')](handleError(_0x4513a0,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 578c6ca..1b398ca 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x12939d,_0x24971d){var _0x38f9ab=function(_0x23a8d5){while(--_0x23a8d5){_0x12939d['push'](_0x12939d['shift']());}};_0x38f9ab(++_0x24971d);}(_0xe706,0xa3));var _0x6e70=function(_0x1bae3e,_0x12950c){_0x1bae3e=_0x1bae3e-0x0;var _0x170b37=_0xe706[_0x1bae3e];return _0x170b37;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x3376a7,_0x56bb16){var _0x50ae0e=function(_0x5085ee){while(--_0x5085ee){_0x3376a7['push'](_0x3376a7['shift']());}};_0x50ae0e(++_0x56bb16);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb7e7[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 6f556e8..f979fc2 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 _0x0b64=['request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','body','options','then','stringify','catch','UpdateSmsQueueReport','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s'];(function(_0x4441ad,_0x463635){var _0x2546ef=function(_0x3b42f9){while(--_0x3b42f9){_0x4441ad['push'](_0x4441ad['shift']());}};_0x2546ef(++_0x463635);}(_0x0b64,0x1bf));var _0x40b6=function(_0x2a7542,_0x29531d){_0x2a7542=_0x2a7542-0x0;var _0x2cc262=_0x0b64[_0x2a7542];return _0x2cc262;};'use strict';var _=require(_0x40b6('0x0'));var util=require(_0x40b6('0x1'));var moment=require('moment');var BPromise=require(_0x40b6('0x2'));var rs=require(_0x40b6('0x3'));var fs=require('fs');var Redis=require(_0x40b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40b6('0x5'));var logger=require(_0x40b6('0x6'))(_0x40b6('0x7'));var config=require(_0x40b6('0x8'));var jayson=require(_0x40b6('0x9'));var client=jayson[_0x40b6('0xa')][_0x40b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d24d4,_0x3e74f6,_0x5a9267){return new BPromise(function(_0x50e7b6,_0x3d8e15){return client[_0x40b6('0xc')](_0x3d24d4,_0x5a9267)['then'](function(_0x43117d){logger[_0x40b6('0xd')](_0x40b6('0xe'),_0x3e74f6,_0x40b6('0xf'));logger[_0x40b6('0x10')](_0x40b6('0x11'),_0x3e74f6,'request\x20sent',JSON['stringify'](_0x43117d));if(_0x43117d[_0x40b6('0x12')]){if(_0x43117d[_0x40b6('0x12')][_0x40b6('0x13')]===0x1f4){logger[_0x40b6('0x12')](_0x40b6('0xe'),_0x3e74f6,_0x43117d[_0x40b6('0x12')]['message']);return _0x3d8e15(_0x43117d['error'][_0x40b6('0x14')]);}logger['error'](_0x40b6('0xe'),_0x3e74f6,_0x43117d['error'][_0x40b6('0x14')]);return _0x50e7b6(_0x43117d[_0x40b6('0x12')][_0x40b6('0x14')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x3e74f6,_0x40b6('0xf'));_0x50e7b6(_0x43117d[_0x40b6('0x15')][_0x40b6('0x14')]);}})['catch'](function(_0x440169){logger[_0x40b6('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x3e74f6,_0x440169);_0x3d8e15(_0x440169);});});}exports[_0x40b6('0x16')]=function(_0xa062df){var _0xee9958=this;return new Promise(function(_0x555917,_0x1f929a){return db[_0x40b6('0x17')]['create'](_0xa062df[_0x40b6('0x18')],{'raw':_0xa062df[_0x40b6('0x19')]?_0xa062df[_0x40b6('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x40b6('0x1a')](function(_0x1b51a6){logger['info'](_0x40b6('0x16'),_0xa062df);logger[_0x40b6('0x10')](_0x40b6('0x16'),_0xa062df,JSON[_0x40b6('0x1b')](_0x1b51a6));_0x555917(_0x1b51a6);})[_0x40b6('0x1c')](function(_0x33aee1){logger[_0x40b6('0x12')](_0x40b6('0x16'),_0x33aee1['message'],_0xa062df);_0x1f929a(_0xee9958[_0x40b6('0x12')](0x1f4,_0x33aee1[_0x40b6('0x14')]));});});};exports[_0x40b6('0x1d')]=function(_0x27f916){var _0x16e291=this;return new Promise(function(_0x29eba3,_0xe7b550){return db[_0x40b6('0x17')][_0x40b6('0x1e')](_0x27f916[_0x40b6('0x18')],{'raw':_0x27f916['options']?_0x27f916[_0x40b6('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f916['options']?_0x27f916[_0x40b6('0x19')]['where']||null:null,'attributes':_0x27f916[_0x40b6('0x19')]?_0x27f916[_0x40b6('0x19')][_0x40b6('0x1f')]||null:null,'limit':_0x27f916[_0x40b6('0x19')]?_0x27f916[_0x40b6('0x19')][_0x40b6('0x20')]||null:null})['then'](function(_0x54e622){logger['info'](_0x40b6('0x1d'),_0x27f916);logger[_0x40b6('0x10')](_0x40b6('0x1d'),_0x27f916,JSON[_0x40b6('0x1b')](_0x54e622));_0x29eba3(_0x54e622);})['catch'](function(_0x15010e){logger['error'](_0x40b6('0x1d'),_0x15010e['message'],_0x27f916);_0xe7b550(_0x16e291[_0x40b6('0x12')](0x1f4,_0x15010e[_0x40b6('0x14')]));});});}; \ No newline at end of file +var _0x1396=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','update','where','limit','UpdateSmsQueueReport','lodash','util','moment'];(function(_0x1dded7,_0x4a9778){var _0x126eb5=function(_0x55132e){while(--_0x55132e){_0x1dded7['push'](_0x1dded7['shift']());}};_0x126eb5(++_0x4a9778);}(_0x1396,0x15d));var _0x6139=function(_0x12254f,_0x100cfe){_0x12254f=_0x12254f-0x0;var _0x3a4fa2=_0x1396[_0x12254f];return _0x3a4fa2;};'use strict';var _=require(_0x6139('0x0'));var util=require(_0x6139('0x1'));var moment=require(_0x6139('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6139('0x3'));var db=require(_0x6139('0x4'))['db'];var utils=require(_0x6139('0x5'));var logger=require(_0x6139('0x6'))(_0x6139('0x7'));var config=require(_0x6139('0x8'));var jayson=require(_0x6139('0x9'));var client=jayson[_0x6139('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4704f7,_0x36290c,_0x428877){return new BPromise(function(_0x444127,_0x1961d2){return client['request'](_0x4704f7,_0x428877)['then'](function(_0x2065e1){logger[_0x6139('0xb')](_0x6139('0xc'),_0x36290c,_0x6139('0xd'));logger[_0x6139('0xe')](_0x6139('0xf'),_0x36290c,_0x6139('0xd'),JSON[_0x6139('0x10')](_0x2065e1));if(_0x2065e1['error']){if(_0x2065e1['error'][_0x6139('0x11')]===0x1f4){logger[_0x6139('0x12')](_0x6139('0xc'),_0x36290c,_0x2065e1[_0x6139('0x12')][_0x6139('0x13')]);return _0x1961d2(_0x2065e1[_0x6139('0x12')]['message']);}logger[_0x6139('0x12')](_0x6139('0xc'),_0x36290c,_0x2065e1['error'][_0x6139('0x13')]);return _0x444127(_0x2065e1[_0x6139('0x12')][_0x6139('0x13')]);}else{logger[_0x6139('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x36290c,_0x6139('0xd'));_0x444127(_0x2065e1[_0x6139('0x14')][_0x6139('0x13')]);}})['catch'](function(_0x25eccd){logger[_0x6139('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x36290c,_0x25eccd);_0x1961d2(_0x25eccd);});});}exports[_0x6139('0x15')]=function(_0x104bcb){var _0x5c9492=this;return new Promise(function(_0x1d7439,_0xfb3d96){return db[_0x6139('0x16')][_0x6139('0x17')](_0x104bcb[_0x6139('0x18')],{'raw':_0x104bcb['options']?_0x104bcb[_0x6139('0x19')][_0x6139('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4481ba){logger['info'](_0x6139('0x15'),_0x104bcb);logger['debug'](_0x6139('0x15'),_0x104bcb,JSON[_0x6139('0x10')](_0x4481ba));_0x1d7439(_0x4481ba);})[_0x6139('0x1b')](function(_0x5b9cdf){logger[_0x6139('0x12')](_0x6139('0x15'),_0x5b9cdf[_0x6139('0x13')],_0x104bcb);_0xfb3d96(_0x5c9492[_0x6139('0x12')](0x1f4,_0x5b9cdf[_0x6139('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x14e04e){var _0x1b834f=this;return new Promise(function(_0x2f2c38,_0x21e947){return db[_0x6139('0x16')][_0x6139('0x1c')](_0x14e04e['body'],{'raw':_0x14e04e['options']?_0x14e04e[_0x6139('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14e04e[_0x6139('0x19')]?_0x14e04e[_0x6139('0x19')][_0x6139('0x1d')]||null:null,'attributes':_0x14e04e[_0x6139('0x19')]?_0x14e04e[_0x6139('0x19')]['attributes']||null:null,'limit':_0x14e04e['options']?_0x14e04e['options'][_0x6139('0x1e')]||null:null})['then'](function(_0x56cb60){logger['info']('UpdateSmsQueueReport',_0x14e04e);logger[_0x6139('0xe')](_0x6139('0x1f'),_0x14e04e,JSON[_0x6139('0x10')](_0x56cb60));_0x2f2c38(_0x56cb60);})[_0x6139('0x1b')](function(_0x5955e5){logger[_0x6139('0x12')]('UpdateSmsQueueReport',_0x5955e5['message'],_0x14e04e);_0x21e947(_0x1b834f[_0x6139('0x12')](0x1f4,_0x5955e5[_0x6139('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 8d58848..c4662d4 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 _0x33c5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x33c5,0xe6));var _0x533c=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x33c5[_0x3c6ae2];return _0x4edda;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0xa')]);router[_0x533c('0x8')](_0x533c('0xb'),auth[_0x533c('0x9')](),controller[_0x533c('0xc')]);router[_0x533c('0x8')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0xe')]);router[_0x533c('0xf')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0x10')]);router[_0x533c('0x11')]('/:id',auth[_0x533c('0x9')](),controller[_0x533c('0x12')]);router[_0x533c('0x13')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4006=['path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4006,0x1c7));var _0x6400=function(_0x34485c,_0x39cc2a){_0x34485c=_0x34485c-0x0;var _0x23e8d9=_0x4006[_0x34485c];return _0x23e8d9;};'use strict';var multer=require('multer');var util=require(_0x6400('0x0'));var path=require(_0x6400('0x1'));var timeout=require(_0x6400('0x2'));var express=require(_0x6400('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6400('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6400('0x5'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x6400('0x6')](),controller['index']);router[_0x6400('0x7')](_0x6400('0x8'),auth[_0x6400('0x6')](),controller[_0x6400('0x9')]);router['get'](_0x6400('0xa'),auth[_0x6400('0x6')](),controller[_0x6400('0xb')]);router[_0x6400('0xc')]('/',auth[_0x6400('0x6')](),controller[_0x6400('0xd')]);router[_0x6400('0xe')](_0x6400('0xa'),auth[_0x6400('0x6')](),controller[_0x6400('0xf')]);router[_0x6400('0x10')]('/:id',auth[_0x6400('0x6')](),controller[_0x6400('0x11')]);module[_0x6400('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 471eb24..8f993c1 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x28a5c8,_0x1daab9){var _0xcbebc2=function(_0x469f66){while(--_0x469f66){_0x28a5c8['push'](_0x28a5c8['shift']());}};_0xcbebc2(++_0x1daab9);}(_0x70e0,0x17b));var _0x070e=function(_0x50e432,_0x4b65e0){_0x50e432=_0x50e432-0x0;var _0x1508d6=_0x70e0[_0x50e432];return _0x1508d6;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x34756e,_0x3c036a){var _0x365e63=function(_0xc96601){while(--_0xc96601){_0x34756e['push'](_0x34756e['shift']());}};_0x365e63(++_0x3c036a);}(_0x34e8,0x12c));var _0x834e=function(_0xb127e2,_0x2d2fc9){_0xb127e2=_0xb127e2-0x0;var _0x32a3f2=_0x34e8[_0xb127e2];return _0x32a3f2;};'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 aa7fa8d..f88d452 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 _0x39df=['includeAll','findAll','rows','catch','show','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','filter','options'];(function(_0x4e8efd,_0x46bc20){var _0x31e442=function(_0x4c6c00){while(--_0x4c6c00){_0x4e8efd['push'](_0x4e8efd['shift']());}};_0x31e442(++_0x46bc20);}(_0x39df,0x173));var _0xf39d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x39df[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xf39d('0x0'));var rimraf=require(_0xf39d('0x1'));var zipdir=require(_0xf39d('0x2'));var jsonpatch=require(_0xf39d('0x3'));var rp=require(_0xf39d('0x4'));var moment=require('moment');var BPromise=require(_0xf39d('0x5'));var Mustache=require(_0xf39d('0x6'));var util=require('util');var path=require(_0xf39d('0x7'));var sox=require(_0xf39d('0x8'));var csv=require(_0xf39d('0x9'));var ejs=require(_0xf39d('0xa'));var fs=require('fs');var fs_extra=require(_0xf39d('0xb'));var _=require('lodash');var squel=require(_0xf39d('0xc'));var crypto=require(_0xf39d('0xd'));var jsforce=require(_0xf39d('0xe'));var deskjs=require(_0xf39d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf39d('0x10'));var Redis=require(_0xf39d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf39d('0x12'));var as=require(_0xf39d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf39d('0x14'));var utils=require(_0xf39d('0x15'));var config=require(_0xf39d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf39d('0x17'))['db'];function respondWithStatusCode(_0x59a661,_0x245154){_0x245154=_0x245154||0xcc;return function(_0xf0eaa2){if(_0xf0eaa2){return _0x59a661[_0xf39d('0x18')](_0x245154);}return _0x59a661['status'](_0x245154)[_0xf39d('0x19')]();};}function respondWithResult(_0x59fd9b,_0x1e9dea){_0x1e9dea=_0x1e9dea||0xc8;return function(_0x2dfa36){if(_0x2dfa36){return _0x59fd9b[_0xf39d('0x1a')](_0x1e9dea)[_0xf39d('0x1b')](_0x2dfa36);}};}function respondWithFilteredResult(_0xfdeecf,_0x4bbcd8){return function(_0x229fcc){if(_0x229fcc){var _0x5cebb4=typeof _0x4bbcd8[_0xf39d('0x1c')]==='undefined'&&typeof _0x4bbcd8[_0xf39d('0x1d')]===_0xf39d('0x1e');var _0x568ddd=_0x229fcc[_0xf39d('0x1f')];var _0x5ee709=_0x5cebb4?0x0:_0x4bbcd8['offset'];var _0x175fa4=_0x5cebb4?_0x229fcc[_0xf39d('0x1f')]:_0x4bbcd8['offset']+_0x4bbcd8[_0xf39d('0x1d')];var _0x157602;if(_0x175fa4>=_0x568ddd){_0x175fa4=_0x568ddd;_0x157602=0xc8;}else{_0x157602=0xce;}_0xfdeecf['status'](_0x157602);return _0xfdeecf['set']('Content-Range',_0x5ee709+'-'+_0x175fa4+'/'+_0x568ddd)['json'](_0x229fcc);}return null;};}function patchUpdates(_0x4263a1){return function(_0x3fdc73){try{jsonpatch[_0xf39d('0x20')](_0x3fdc73,_0x4263a1,!![]);}catch(_0x49c3b3){return BPromise[_0xf39d('0x21')](_0x49c3b3);}return _0x3fdc73['save']();};}function saveUpdates(_0xed780,_0x55a9bb){return function(_0xaf1481){if(_0xaf1481){return _0xaf1481[_0xf39d('0x22')](_0xed780)[_0xf39d('0x23')](function(_0x104d65){return _0x104d65;});}return null;};}function removeEntity(_0x2923e2,_0x278002){return function(_0x35ec49){if(_0x35ec49){return _0x35ec49[_0xf39d('0x24')]()[_0xf39d('0x23')](function(){_0x2923e2[_0xf39d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d65b6,_0x1e32d1){return function(_0x292ce9){if(!_0x292ce9){_0x5d65b6[_0xf39d('0x18')](0x194);}return _0x292ce9;};}function handleError(_0x4865d4,_0x5239a1){_0x5239a1=_0x5239a1||0x1f4;return function(_0x279c85){logger[_0xf39d('0x25')](_0x279c85[_0xf39d('0x26')]);if(_0x279c85[_0xf39d('0x27')]){delete _0x279c85[_0xf39d('0x27')];}_0x4865d4[_0xf39d('0x1a')](_0x5239a1)[_0xf39d('0x28')](_0x279c85);};}exports[_0xf39d('0x29')]=function(_0x450c59,_0x26209a){var _0x31982c={},_0x264e3c={},_0x397414={'count':0x0,'rows':[]};var _0x5dae28=_[_0xf39d('0x2a')](db[_0xf39d('0x2b')][_0xf39d('0x2c')],function(_0x3397c4){return{'name':_0x3397c4['fieldName'],'type':_0x3397c4[_0xf39d('0x2d')][_0xf39d('0x2e')]};});_0x264e3c[_0xf39d('0x2f')]=_[_0xf39d('0x2a')](_0x5dae28,_0xf39d('0x27'));_0x264e3c[_0xf39d('0x30')]=_[_0xf39d('0x31')](_0x450c59[_0xf39d('0x30')]);_0x264e3c[_0xf39d('0x32')]=_[_0xf39d('0x33')](_0x264e3c[_0xf39d('0x2f')],_0x264e3c[_0xf39d('0x30')]);_0x31982c[_0xf39d('0x34')]=_[_0xf39d('0x33')](_0x264e3c['model'],qs[_0xf39d('0x35')](_0x450c59['query'][_0xf39d('0x35')]));_0x31982c['attributes']=_0x31982c['attributes'][_0xf39d('0x36')]?_0x31982c['attributes']:_0x264e3c['model'];if(!_0x450c59[_0xf39d('0x30')][_0xf39d('0x37')]('nolimit')){_0x31982c['limit']=qs[_0xf39d('0x1d')](_0x450c59[_0xf39d('0x30')][_0xf39d('0x1d')]);_0x31982c[_0xf39d('0x1c')]=qs[_0xf39d('0x1c')](_0x450c59[_0xf39d('0x30')][_0xf39d('0x1c')]);}_0x31982c['order']=qs[_0xf39d('0x38')](_0x450c59[_0xf39d('0x30')]['sort']);_0x31982c[_0xf39d('0x39')]=qs[_0xf39d('0x32')](_['pick'](_0x450c59['query'],_0x264e3c[_0xf39d('0x32')]),_0x5dae28);if(_0x450c59['query']['filter']){_0x31982c[_0xf39d('0x39')]=_[_0xf39d('0x3a')](_0x31982c[_0xf39d('0x39')],{'$or':_[_0xf39d('0x2a')](_0x5dae28,function(_0x3ac37c){if(_0x3ac37c[_0xf39d('0x2d')]!=='VIRTUAL'){var _0x18522c={};_0x18522c[_0x3ac37c[_0xf39d('0x27')]]={'$like':'%'+_0x450c59[_0xf39d('0x30')][_0xf39d('0x3b')]+'%'};return _0x18522c;}})});}_0x31982c=_[_0xf39d('0x3a')]({},_0x31982c,_0x450c59[_0xf39d('0x3c')]);var _0x2caeac={'where':_0x31982c[_0xf39d('0x39')]};return db[_0xf39d('0x2b')]['count'](_0x2caeac)['then'](function(_0x8fa85){_0x397414[_0xf39d('0x1f')]=_0x8fa85;if(_0x450c59[_0xf39d('0x30')][_0xf39d('0x3d')]){_0x31982c['include']=[{'all':!![]}];}return db[_0xf39d('0x2b')][_0xf39d('0x3e')](_0x31982c);})[_0xf39d('0x23')](function(_0x34ef11){_0x397414[_0xf39d('0x3f')]=_0x34ef11;return _0x397414;})[_0xf39d('0x23')](respondWithFilteredResult(_0x26209a,_0x31982c))[_0xf39d('0x40')](handleError(_0x26209a,null));};exports[_0xf39d('0x41')]=function(_0x137822,_0x2df893){var _0xdf2f16={'raw':!![],'where':{'id':_0x137822['params']['id']}},_0x13706={};_0x13706[_0xf39d('0x2f')]=_[_0xf39d('0x31')](db[_0xf39d('0x2b')][_0xf39d('0x2c')]);_0x13706['query']=_['keys'](_0x137822[_0xf39d('0x30')]);_0x13706[_0xf39d('0x32')]=_['intersection'](_0x13706[_0xf39d('0x2f')],_0x13706[_0xf39d('0x30')]);_0xdf2f16['attributes']=_['intersection'](_0x13706['model'],qs['fields'](_0x137822['query'][_0xf39d('0x35')]));_0xdf2f16[_0xf39d('0x34')]=_0xdf2f16[_0xf39d('0x34')][_0xf39d('0x36')]?_0xdf2f16[_0xf39d('0x34')]:_0x13706['model'];if(_0x137822[_0xf39d('0x30')]['includeAll']){_0xdf2f16[_0xf39d('0x42')]=[{'all':!![]}];}_0xdf2f16=_['merge']({},_0xdf2f16,_0x137822['options']);return db[_0xf39d('0x2b')]['find'](_0xdf2f16)[_0xf39d('0x23')](handleEntityNotFound(_0x2df893,null))[_0xf39d('0x23')](respondWithResult(_0x2df893,null))[_0xf39d('0x40')](handleError(_0x2df893,null));};exports[_0xf39d('0x43')]=function(_0x5000a5,_0x383237){return db[_0xf39d('0x2b')][_0xf39d('0x43')](_0x5000a5['body'],{})[_0xf39d('0x23')](respondWithResult(_0x383237,0xc9))[_0xf39d('0x40')](handleError(_0x383237,null));};exports['update']=function(_0x3d90a0,_0x231bf0){if(_0x3d90a0['body']['id']){delete _0x3d90a0[_0xf39d('0x44')]['id'];}return db[_0xf39d('0x2b')][_0xf39d('0x45')]({'where':{'id':_0x3d90a0[_0xf39d('0x46')]['id']}})[_0xf39d('0x23')](handleEntityNotFound(_0x231bf0,null))[_0xf39d('0x23')](saveUpdates(_0x3d90a0[_0xf39d('0x44')],null))[_0xf39d('0x23')](respondWithResult(_0x231bf0,null))[_0xf39d('0x40')](handleError(_0x231bf0,null));};exports[_0xf39d('0x24')]=function(_0x8cbe15,_0x39ea5e){return db['SmsTransferReport'][_0xf39d('0x45')]({'where':{'id':_0x8cbe15[_0xf39d('0x46')]['id']}})[_0xf39d('0x23')](handleEntityNotFound(_0x39ea5e,null))[_0xf39d('0x23')](removeEntity(_0x39ea5e,null))[_0xf39d('0x40')](handleError(_0x39ea5e,null));};exports[_0xf39d('0x47')]=function(_0xe215a9,_0x1921d0){return db['SmsTransferReport']['describe']()[_0xf39d('0x23')](respondWithResult(_0x1921d0,null))['catch'](handleError(_0x1921d0,null));}; \ No newline at end of file +var _0xa51e=['fieldName','type','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','SmsTransferReport','rawAttributes'];(function(_0x3091c1,_0x44233c){var _0x27a97d=function(_0x519263){while(--_0x519263){_0x3091c1['push'](_0x3091c1['shift']());}};_0x27a97d(++_0x44233c);}(_0xa51e,0x65));var _0xea51=function(_0xe67d1c,_0x1b21d1){_0xe67d1c=_0xe67d1c-0x0;var _0x11673c=_0xa51e[_0xe67d1c];return _0x11673c;};'use strict';var emlformat=require(_0xea51('0x0'));var rimraf=require(_0xea51('0x1'));var zipdir=require(_0xea51('0x2'));var jsonpatch=require(_0xea51('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xea51('0x4'));var Mustache=require('mustache');var util=require(_0xea51('0x5'));var path=require('path');var sox=require(_0xea51('0x6'));var csv=require('to-csv');var ejs=require(_0xea51('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea51('0x8'));var crypto=require(_0xea51('0x9'));var jsforce=require(_0xea51('0xa'));var deskjs=require(_0xea51('0xb'));var toCsv=require(_0xea51('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea51('0xd'));var authService=require(_0xea51('0xe'));var qs=require(_0xea51('0xf'));var as=require(_0xea51('0x10'));var hardwareService=require(_0xea51('0x11'));var logger=require(_0xea51('0x12'))(_0xea51('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xea51('0x14'))['db'];function respondWithStatusCode(_0x634c2c,_0x2ea0a8){_0x2ea0a8=_0x2ea0a8||0xcc;return function(_0xa9fee2){if(_0xa9fee2){return _0x634c2c[_0xea51('0x15')](_0x2ea0a8);}return _0x634c2c[_0xea51('0x16')](_0x2ea0a8)['end']();};}function respondWithResult(_0x15a994,_0x161bb4){_0x161bb4=_0x161bb4||0xc8;return function(_0x3cd6de){if(_0x3cd6de){return _0x15a994['status'](_0x161bb4)[_0xea51('0x17')](_0x3cd6de);}};}function respondWithFilteredResult(_0x2838e5,_0x11cd2f){return function(_0x484e8c){if(_0x484e8c){var _0x32b74a=typeof _0x11cd2f[_0xea51('0x18')]===_0xea51('0x19')&&typeof _0x11cd2f[_0xea51('0x1a')]===_0xea51('0x19');var _0x2c3cab=_0x484e8c[_0xea51('0x1b')];var _0x7103d9=_0x32b74a?0x0:_0x11cd2f[_0xea51('0x18')];var _0x190dd4=_0x32b74a?_0x484e8c[_0xea51('0x1b')]:_0x11cd2f[_0xea51('0x18')]+_0x11cd2f[_0xea51('0x1a')];var _0x48b2cb;if(_0x190dd4>=_0x2c3cab){_0x190dd4=_0x2c3cab;_0x48b2cb=0xc8;}else{_0x48b2cb=0xce;}_0x2838e5['status'](_0x48b2cb);return _0x2838e5[_0xea51('0x1c')](_0xea51('0x1d'),_0x7103d9+'-'+_0x190dd4+'/'+_0x2c3cab)[_0xea51('0x17')](_0x484e8c);}return null;};}function patchUpdates(_0x4e2a49){return function(_0x4bae93){try{jsonpatch[_0xea51('0x1e')](_0x4bae93,_0x4e2a49,!![]);}catch(_0x1ebb0b){return BPromise[_0xea51('0x1f')](_0x1ebb0b);}return _0x4bae93['save']();};}function saveUpdates(_0x3771bd,_0xa0ede7){return function(_0x2062e6){if(_0x2062e6){return _0x2062e6[_0xea51('0x20')](_0x3771bd)[_0xea51('0x21')](function(_0x35c6ef){return _0x35c6ef;});}return null;};}function removeEntity(_0x56da30,_0xfa3195){return function(_0x2e763a){if(_0x2e763a){return _0x2e763a[_0xea51('0x22')]()[_0xea51('0x21')](function(){_0x56da30[_0xea51('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x131253,_0x104d7e){return function(_0x2ec2d4){if(!_0x2ec2d4){_0x131253['sendStatus'](0x194);}return _0x2ec2d4;};}function handleError(_0x11bb72,_0x4cf9a6){_0x4cf9a6=_0x4cf9a6||0x1f4;return function(_0x37570e){logger[_0xea51('0x23')](_0x37570e['stack']);if(_0x37570e[_0xea51('0x24')]){delete _0x37570e[_0xea51('0x24')];}_0x11bb72[_0xea51('0x16')](_0x4cf9a6)[_0xea51('0x25')](_0x37570e);};}exports[_0xea51('0x26')]=function(_0x269f4b,_0x2f70c2){var _0x41ed02={},_0x23cd77={},_0x4e4a28={'count':0x0,'rows':[]};var _0x3998d2=_['map'](db[_0xea51('0x27')][_0xea51('0x28')],function(_0x465049){return{'name':_0x465049[_0xea51('0x29')],'type':_0x465049[_0xea51('0x2a')][_0xea51('0x2b')]};});_0x23cd77[_0xea51('0x2c')]=_[_0xea51('0x2d')](_0x3998d2,_0xea51('0x24'));_0x23cd77[_0xea51('0x2e')]=_['keys'](_0x269f4b[_0xea51('0x2e')]);_0x23cd77['filters']=_['intersection'](_0x23cd77[_0xea51('0x2c')],_0x23cd77[_0xea51('0x2e')]);_0x41ed02[_0xea51('0x2f')]=_[_0xea51('0x30')](_0x23cd77[_0xea51('0x2c')],qs['fields'](_0x269f4b[_0xea51('0x2e')][_0xea51('0x31')]));_0x41ed02['attributes']=_0x41ed02[_0xea51('0x2f')][_0xea51('0x32')]?_0x41ed02[_0xea51('0x2f')]:_0x23cd77['model'];if(!_0x269f4b[_0xea51('0x2e')][_0xea51('0x33')]('nolimit')){_0x41ed02[_0xea51('0x1a')]=qs[_0xea51('0x1a')](_0x269f4b[_0xea51('0x2e')][_0xea51('0x1a')]);_0x41ed02[_0xea51('0x18')]=qs[_0xea51('0x18')](_0x269f4b['query'][_0xea51('0x18')]);}_0x41ed02['order']=qs[_0xea51('0x34')](_0x269f4b[_0xea51('0x2e')][_0xea51('0x34')]);_0x41ed02[_0xea51('0x35')]=qs[_0xea51('0x36')](_[_0xea51('0x37')](_0x269f4b[_0xea51('0x2e')],_0x23cd77[_0xea51('0x36')]),_0x3998d2);if(_0x269f4b[_0xea51('0x2e')][_0xea51('0x38')]){_0x41ed02['where']=_[_0xea51('0x39')](_0x41ed02[_0xea51('0x35')],{'$or':_[_0xea51('0x2d')](_0x3998d2,function(_0xa125e5){if(_0xa125e5[_0xea51('0x2a')]!==_0xea51('0x3a')){var _0x4f8a06={};_0x4f8a06[_0xa125e5[_0xea51('0x24')]]={'$like':'%'+_0x269f4b[_0xea51('0x2e')][_0xea51('0x38')]+'%'};return _0x4f8a06;}})});}_0x41ed02=_['merge']({},_0x41ed02,_0x269f4b[_0xea51('0x3b')]);var _0x50fcbf={'where':_0x41ed02['where']};return db[_0xea51('0x27')][_0xea51('0x1b')](_0x50fcbf)['then'](function(_0x55709c){_0x4e4a28[_0xea51('0x1b')]=_0x55709c;if(_0x269f4b['query']['includeAll']){_0x41ed02[_0xea51('0x3c')]=[{'all':!![]}];}return db[_0xea51('0x27')][_0xea51('0x3d')](_0x41ed02);})[_0xea51('0x21')](function(_0x22da2a){_0x4e4a28['rows']=_0x22da2a;return _0x4e4a28;})[_0xea51('0x21')](respondWithFilteredResult(_0x2f70c2,_0x41ed02))[_0xea51('0x3e')](handleError(_0x2f70c2,null));};exports[_0xea51('0x3f')]=function(_0x31bae5,_0x17964f){var _0x445162={'raw':!![],'where':{'id':_0x31bae5[_0xea51('0x40')]['id']}},_0x14528b={};_0x14528b[_0xea51('0x2c')]=_[_0xea51('0x41')](db[_0xea51('0x27')][_0xea51('0x28')]);_0x14528b['query']=_[_0xea51('0x41')](_0x31bae5[_0xea51('0x2e')]);_0x14528b['filters']=_[_0xea51('0x30')](_0x14528b['model'],_0x14528b[_0xea51('0x2e')]);_0x445162['attributes']=_['intersection'](_0x14528b[_0xea51('0x2c')],qs[_0xea51('0x31')](_0x31bae5[_0xea51('0x2e')][_0xea51('0x31')]));_0x445162['attributes']=_0x445162[_0xea51('0x2f')][_0xea51('0x32')]?_0x445162['attributes']:_0x14528b[_0xea51('0x2c')];if(_0x31bae5[_0xea51('0x2e')][_0xea51('0x42')]){_0x445162[_0xea51('0x3c')]=[{'all':!![]}];}_0x445162=_['merge']({},_0x445162,_0x31bae5[_0xea51('0x3b')]);return db[_0xea51('0x27')]['find'](_0x445162)[_0xea51('0x21')](handleEntityNotFound(_0x17964f,null))['then'](respondWithResult(_0x17964f,null))[_0xea51('0x3e')](handleError(_0x17964f,null));};exports['create']=function(_0x58cef4,_0x6407c2){return db[_0xea51('0x27')][_0xea51('0x43')](_0x58cef4[_0xea51('0x44')],{})[_0xea51('0x21')](respondWithResult(_0x6407c2,0xc9))[_0xea51('0x3e')](handleError(_0x6407c2,null));};exports[_0xea51('0x20')]=function(_0x4a9e16,_0x48c7d5){if(_0x4a9e16[_0xea51('0x44')]['id']){delete _0x4a9e16[_0xea51('0x44')]['id'];}return db[_0xea51('0x27')][_0xea51('0x45')]({'where':{'id':_0x4a9e16[_0xea51('0x40')]['id']}})[_0xea51('0x21')](handleEntityNotFound(_0x48c7d5,null))[_0xea51('0x21')](saveUpdates(_0x4a9e16[_0xea51('0x44')],null))[_0xea51('0x21')](respondWithResult(_0x48c7d5,null))[_0xea51('0x3e')](handleError(_0x48c7d5,null));};exports[_0xea51('0x22')]=function(_0x4bec5f,_0x281c0d){return db[_0xea51('0x27')][_0xea51('0x45')]({'where':{'id':_0x4bec5f[_0xea51('0x40')]['id']}})['then'](handleEntityNotFound(_0x281c0d,null))[_0xea51('0x21')](removeEntity(_0x281c0d,null))['catch'](handleError(_0x281c0d,null));};exports[_0xea51('0x46')]=function(_0x220a36,_0x231e0f){return db[_0xea51('0x27')][_0xea51('0x46')]()[_0xea51('0x21')](respondWithResult(_0x231e0f,null))[_0xea51('0x3e')](handleError(_0x231e0f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index db49fc1..fe143c5 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 _0xf555=['path','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','bluebird','request-promise'];(function(_0x2a0832,_0x3dee4f){var _0x5197e3=function(_0x42c3e7){while(--_0x42c3e7){_0x2a0832['push'](_0x2a0832['shift']());}};_0x5197e3(++_0x3dee4f);}(_0xf555,0x97));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f55('0x0'));var util=require(_0x5f55('0x1'));var logger=require('../../config/logger')(_0x5f55('0x2'));var moment=require('moment');var BPromise=require(_0x5f55('0x3'));var rp=require(_0x5f55('0x4'));var fs=require('fs');var path=require(_0x5f55('0x5'));var rimraf=require('rimraf');var config=require(_0x5f55('0x6'));var attributes=require(_0x5f55('0x7'));module['exports']=function(_0x2c6a58,_0x113537){return _0x2c6a58[_0x5f55('0x8')](_0x5f55('0x9'),attributes,{'tableName':_0x5f55('0xa'),'paranoid':![],'indexes':[{'name':_0x5f55('0xb'),'fields':[_0x5f55('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac51=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util'];(function(_0x3e7699,_0x47b8ad){var _0x3c7347=function(_0x1b6d18){while(--_0x1b6d18){_0x3e7699['push'](_0x3e7699['shift']());}};_0x3c7347(++_0x47b8ad);}(_0xac51,0x184));var _0x1ac5=function(_0x5be795,_0x1cb1b8){_0x5be795=_0x5be795-0x0;var _0x4e8a3b=_0xac51[_0x5be795];return _0x4e8a3b;};'use strict';var _=require(_0x1ac5('0x0'));var util=require(_0x1ac5('0x1'));var logger=require(_0x1ac5('0x2'))(_0x1ac5('0x3'));var moment=require(_0x1ac5('0x4'));var BPromise=require(_0x1ac5('0x5'));var rp=require(_0x1ac5('0x6'));var fs=require('fs');var path=require(_0x1ac5('0x7'));var rimraf=require(_0x1ac5('0x8'));var config=require('../../config/environment');var attributes=require(_0x1ac5('0x9'));module['exports']=function(_0x5a1571,_0x3ff85d){return _0x5a1571['define'](_0x1ac5('0xa'),attributes,{'tableName':_0x1ac5('0xb'),'paranoid':![],'indexes':[{'name':_0x1ac5('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f6991d4..e4ffa9c 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 _0xf4d9=['../../config/environment','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x51688e,_0x3761bb){_0x51688e=_0x51688e-0x0;var _0x1a5e21=_0xf4d9[_0x51688e];return _0x1a5e21;};'use strict';var _=require(_0x9f4d('0x0'));var util=require('util');var moment=require(_0x9f4d('0x1'));var BPromise=require(_0x9f4d('0x2'));var rs=require(_0x9f4d('0x3'));var fs=require('fs');var Redis=require(_0x9f4d('0x4'));var db=require(_0x9f4d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f4d('0x6'))(_0x9f4d('0x7'));var config=require(_0x9f4d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9f4d('0x9')][_0x9f4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d7228,_0x4ee67d,_0x415499){return new BPromise(function(_0x55865b,_0x34fe3f){return client['request'](_0x2d7228,_0x415499)[_0x9f4d('0xb')](function(_0x451c00){logger[_0x9f4d('0xc')](_0x9f4d('0xd'),_0x4ee67d,'request\x20sent');logger[_0x9f4d('0xe')](_0x9f4d('0xf'),_0x4ee67d,_0x9f4d('0x10'),JSON[_0x9f4d('0x11')](_0x451c00));if(_0x451c00[_0x9f4d('0x12')]){if(_0x451c00[_0x9f4d('0x12')][_0x9f4d('0x13')]===0x1f4){logger[_0x9f4d('0x12')](_0x9f4d('0xd'),_0x4ee67d,_0x451c00[_0x9f4d('0x12')][_0x9f4d('0x14')]);return _0x34fe3f(_0x451c00['error'][_0x9f4d('0x14')]);}logger[_0x9f4d('0x12')](_0x9f4d('0xd'),_0x4ee67d,_0x451c00['error'][_0x9f4d('0x14')]);return _0x55865b(_0x451c00[_0x9f4d('0x12')][_0x9f4d('0x14')]);}else{logger[_0x9f4d('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x4ee67d,'request\x20sent');_0x55865b(_0x451c00['result'][_0x9f4d('0x14')]);}})[_0x9f4d('0x15')](function(_0x4526f0){logger[_0x9f4d('0x12')](_0x9f4d('0xd'),_0x4ee67d,_0x4526f0);_0x34fe3f(_0x4526f0);});});} \ No newline at end of file +var _0xde64=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4ec59f,_0x4fa23){var _0x53c04e=function(_0x4d618f){while(--_0x4d618f){_0x4ec59f['push'](_0x4ec59f['shift']());}};_0x53c04e(++_0x4fa23);}(_0xde64,0x17c));var _0x4de6=function(_0x23c2f7,_0x5d9c34){_0x23c2f7=_0x23c2f7-0x0;var _0x39a2dc=_0xde64[_0x23c2f7];return _0x39a2dc;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var moment=require(_0x4de6('0x2'));var BPromise=require(_0x4de6('0x3'));var rs=require(_0x4de6('0x4'));var fs=require('fs');var Redis=require(_0x4de6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4de6('0x6'));var logger=require(_0x4de6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4de6('0x8'));var client=jayson[_0x4de6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568496,_0x24edef,_0x35ae72){return new BPromise(function(_0x475fb9,_0x248e39){return client[_0x4de6('0xa')](_0x568496,_0x35ae72)[_0x4de6('0xb')](function(_0x48a974){logger[_0x4de6('0xc')](_0x4de6('0xd'),_0x24edef,_0x4de6('0xe'));logger['debug'](_0x4de6('0xf'),_0x24edef,_0x4de6('0xe'),JSON[_0x4de6('0x10')](_0x48a974));if(_0x48a974[_0x4de6('0x11')]){if(_0x48a974[_0x4de6('0x11')]['code']===0x1f4){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974[_0x4de6('0x11')]['message']);return _0x248e39(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974['error'][_0x4de6('0x12')]);return _0x475fb9(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}else{logger['info'](_0x4de6('0xd'),_0x24edef,'request\x20sent');_0x475fb9(_0x48a974['result'][_0x4de6('0x12')]);}})[_0x4de6('0x13')](function(_0x6dbcf3){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x6dbcf3);_0x248e39(_0x6dbcf3);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 48eb738..1b97ade 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 _0xbd82=['/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','post','file','create','put','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index'];(function(_0x14814,_0x18046d){var _0x50227b=function(_0x5a3ae6){while(--_0x5a3ae6){_0x14814['push'](_0x14814['shift']());}};_0x50227b(++_0x18046d);}(_0xbd82,0xb3));var _0x2bd8=function(_0xcfaeed,_0x1844c8){_0xcfaeed=_0xcfaeed-0x0;var _0x318dac=_0xbd82[_0xcfaeed];return _0x318dac;};'use strict';var multer=require(_0x2bd8('0x0'));var util=require('util');var path=require(_0x2bd8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2bd8('0x2')]();var fs_extra=require(_0x2bd8('0x3'));var auth=require(_0x2bd8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2bd8('0x5'));var controller=require(_0x2bd8('0x6'));router[_0x2bd8('0x7')]('/',auth[_0x2bd8('0x8')](),controller[_0x2bd8('0x9')]);router[_0x2bd8('0x7')](_0x2bd8('0xa'),auth[_0x2bd8('0x8')](),controller[_0x2bd8('0xb')]);router[_0x2bd8('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x2bd8('0xc')]);var upload=multer({'storage':multer[_0x2bd8('0xd')]({'destination':function(_0x257263,_0x3f4e37,_0x567c21){_0x567c21(null,path[_0x2bd8('0xe')](config[_0x2bd8('0xf')],_0x2bd8('0x10')));},'filename':function(_0x3b3f61,_0x5c85fd,_0x457b45){_0x5c85fd[_0x2bd8('0x11')]=_0x5c85fd[_0x2bd8('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x457b45(null,util[_0x2bd8('0x12')](_0x2bd8('0x13'),path['basename'](_0x5c85fd[_0x2bd8('0x11')],path[_0x2bd8('0x14')](_0x5c85fd[_0x2bd8('0x11')])),Date[_0x2bd8('0x15')](),path[_0x2bd8('0x14')](_0x5c85fd[_0x2bd8('0x11')])));}})});router[_0x2bd8('0x16')]('/',upload['single'](_0x2bd8('0x17')),controller[_0x2bd8('0x18')]);router[_0x2bd8('0x19')](_0x2bd8('0xa'),auth[_0x2bd8('0x8')](),controller['update']);router['delete'](_0x2bd8('0xa'),auth[_0x2bd8('0x8')](),controller['delete']);module[_0x2bd8('0x1a')]=router; \ No newline at end of file +var _0xabe4=['path','connect-timeout','fs-extra','./sound.controller','isAuthenticated','get','show','/:id/download','download','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','now','single','file','put','/:id','delete','exports','multer','util'];(function(_0x210a3a,_0x1f5265){var _0x328725=function(_0x21de5f){while(--_0x21de5f){_0x210a3a['push'](_0x210a3a['shift']());}};_0x328725(++_0x1f5265);}(_0xabe4,0x136));var _0x4abe=function(_0x3e36b6,_0x43de3b){_0x3e36b6=_0x3e36b6-0x0;var _0x4a3a36=_0xabe4[_0x3e36b6];return _0x4a3a36;};'use strict';var multer=require(_0x4abe('0x0'));var util=require(_0x4abe('0x1'));var path=require(_0x4abe('0x2'));var timeout=require(_0x4abe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4abe('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4abe('0x5'));router['get']('/',auth[_0x4abe('0x6')](),controller['index']);router[_0x4abe('0x7')]('/:id',auth[_0x4abe('0x6')](),controller[_0x4abe('0x8')]);router[_0x4abe('0x7')](_0x4abe('0x9'),auth[_0x4abe('0x6')](),controller[_0x4abe('0xa')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f0efd,_0x1f7bf6,_0x5b62c4){_0x5b62c4(null,path[_0x4abe('0xb')](config['root'],_0x4abe('0xc')));},'filename':function(_0x143156,_0x3d376b,_0xb3d3b5){_0x3d376b[_0x4abe('0xd')]=_0x3d376b[_0x4abe('0xd')][_0x4abe('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb3d3b5(null,util[_0x4abe('0xf')](_0x4abe('0x10'),path['basename'](_0x3d376b['originalname'],path['extname'](_0x3d376b[_0x4abe('0xd')])),Date[_0x4abe('0x11')](),path['extname'](_0x3d376b[_0x4abe('0xd')])));}})});router['post']('/',upload[_0x4abe('0x12')](_0x4abe('0x13')),controller['create']);router[_0x4abe('0x14')](_0x4abe('0x15'),auth[_0x4abe('0x6')](),controller['update']);router[_0x4abe('0x16')](_0x4abe('0x15'),auth[_0x4abe('0x6')](),controller[_0x4abe('0x16')]);module[_0x4abe('0x17')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 8dfa5f4..7180352 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 _0xe10b=['exports','STRING','name','FLOAT','INTEGER','BIGINT'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0xe10b,0x108));var _0xbe10=function(_0xafc49d,_0x157f7f){_0xafc49d=_0xafc49d-0x0;var _0x4b1bee=_0xe10b[_0xafc49d];return _0x4b1bee;};'use strict';var Sequelize=require('sequelize');module[_0xbe10('0x0')]={'name':{'type':Sequelize[_0xbe10('0x1')],'unique':_0xbe10('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xbe10('0x1')]},'display_name':{'type':Sequelize[_0xbe10('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xbe10('0x1')]},'original_format':{'type':Sequelize[_0xbe10('0x1')]},'original_duration':{'type':Sequelize[_0xbe10('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xbe10('0x4')]},'original_bitRate':{'type':Sequelize[_0xbe10('0x5')]},'original_sampleRate':{'type':Sequelize[_0xbe10('0x4')]},'converted_format':{'type':Sequelize[_0xbe10('0x1')]},'converted_duration':{'type':Sequelize[_0xbe10('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xbe10('0x5')]},'converted_channelCount':{'type':Sequelize[_0xbe10('0x4')]},'converted_bitRate':{'type':Sequelize[_0xbe10('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xbe10('0x4')]}}; \ No newline at end of file +var _0x1680=['exports','STRING','name','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1680,0x84));var _0x0168=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x1680[_0x220afa];return _0x1b79d1;};'use strict';var Sequelize=require(_0x0168('0x0'));module[_0x0168('0x1')]={'name':{'type':Sequelize[_0x0168('0x2')],'unique':_0x0168('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0168('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x0168('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x0168('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x0168('0x5')]},'original_bitRate':{'type':Sequelize[_0x0168('0x6')]},'original_sampleRate':{'type':Sequelize[_0x0168('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x0168('0x5')]},'converted_bitRate':{'type':Sequelize[_0x0168('0x6')]},'converted_sampleRate':{'type':Sequelize[_0x0168('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 8cbcf63..aa9d775 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 _0x78de=['delete','destroy','original_format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','merge','find','download','save_name','existsSync','join','root','Sequelize','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','converted_format','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','unlinkSync','original_duration','duration','original_sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','sampleCount','converted_channelCount','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description'];(function(_0x448e25,_0x1ec3f4){var _0x2952b4=function(_0x197c49){while(--_0x197c49){_0x448e25['push'](_0x448e25['shift']());}};_0x2952b4(++_0x1ec3f4);}(_0x78de,0x85));var _0xe78d=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x78de[_0x5e3b04];return _0x1fc44d;};'use strict';var emlformat=require(_0xe78d('0x0'));var rimraf=require(_0xe78d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe78d('0x2'));var rp=require(_0xe78d('0x3'));var moment=require(_0xe78d('0x4'));var BPromise=require(_0xe78d('0x5'));var Mustache=require(_0xe78d('0x6'));var util=require(_0xe78d('0x7'));var path=require(_0xe78d('0x8'));var sox=require('sox');var csv=require(_0xe78d('0x9'));var ejs=require(_0xe78d('0xa'));var fs=require('fs');var fs_extra=require(_0xe78d('0xb'));var _=require('lodash');var squel=require(_0xe78d('0xc'));var crypto=require(_0xe78d('0xd'));var jsforce=require(_0xe78d('0xe'));var deskjs=require(_0xe78d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe78d('0x10'));var Papa=require(_0xe78d('0x11'));var Redis=require('ioredis');var authService=require(_0xe78d('0x12'));var qs=require(_0xe78d('0x13'));var as=require(_0xe78d('0x14'));var hardwareService=require(_0xe78d('0x15'));var logger=require(_0xe78d('0x16'))(_0xe78d('0x17'));var utils=require(_0xe78d('0x18'));var config=require(_0xe78d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe78d('0x1a'))['db'];function respondWithStatusCode(_0x201e7d,_0x53389e){_0x53389e=_0x53389e||0xcc;return function(_0x52f108){if(_0x52f108){return _0x201e7d[_0xe78d('0x1b')](_0x53389e);}return _0x201e7d['status'](_0x53389e)[_0xe78d('0x1c')]();};}function respondWithResult(_0xbe2851,_0x5be167){_0x5be167=_0x5be167||0xc8;return function(_0x402118){if(_0x402118){return _0xbe2851['status'](_0x5be167)[_0xe78d('0x1d')](_0x402118);}};}function respondWithFilteredResult(_0x4933f3,_0x575c39){return function(_0x22e83f){if(_0x22e83f){var _0x5499ae=typeof _0x575c39[_0xe78d('0x1e')]===_0xe78d('0x1f')&&typeof _0x575c39[_0xe78d('0x20')]==='undefined';var _0x598562=_0x22e83f['count'];var _0x307490=_0x5499ae?0x0:_0x575c39['offset'];var _0x3a8d1b=_0x5499ae?_0x22e83f['count']:_0x575c39[_0xe78d('0x1e')]+_0x575c39[_0xe78d('0x20')];var _0x1e170b;if(_0x3a8d1b>=_0x598562){_0x3a8d1b=_0x598562;_0x1e170b=0xc8;}else{_0x1e170b=0xce;}_0x4933f3[_0xe78d('0x21')](_0x1e170b);return _0x4933f3[_0xe78d('0x22')](_0xe78d('0x23'),_0x307490+'-'+_0x3a8d1b+'/'+_0x598562)[_0xe78d('0x1d')](_0x22e83f);}return null;};}function patchUpdates(_0x187b51){return function(_0x4ae3a5){try{jsonpatch[_0xe78d('0x24')](_0x4ae3a5,_0x187b51,!![]);}catch(_0x6c2afe){return BPromise[_0xe78d('0x25')](_0x6c2afe);}return _0x4ae3a5[_0xe78d('0x26')]();};}function saveUpdates(_0x261692,_0x3911c6){return function(_0x394ff9){if(_0x394ff9){return _0x394ff9[_0xe78d('0x27')](_0x261692)[_0xe78d('0x28')](function(_0x2de151){return _0x2de151;});}return null;};}function removeEntity(_0x712191,_0xb3a082){return function(_0x16a3d5){if(_0x16a3d5){return _0x16a3d5['destroy']()[_0xe78d('0x28')](function(){var _0xad9bd6=_0x16a3d5['get']({'plain':!![]});var _0x40ba80=_0xe78d('0x29');return db[_0xe78d('0x2a')]['destroy']({'where':{'type':_0x40ba80,'resourceId':_0xad9bd6['id']}})[_0xe78d('0x28')](function(){return _0x16a3d5;});})[_0xe78d('0x28')](function(){_0x712191['status'](0xcc)[_0xe78d('0x1c')]();});}};}function handleEntityNotFound(_0x126460,_0x25ebf0){return function(_0x3039ed){if(!_0x3039ed){_0x126460[_0xe78d('0x1b')](0x194);}return _0x3039ed;};}function handleError(_0x18a2d9,_0x59c7fb){_0x59c7fb=_0x59c7fb||0x1f4;return function(_0x119f44){logger[_0xe78d('0x2b')](_0x119f44[_0xe78d('0x2c')]);if(_0x119f44['name']){delete _0x119f44[_0xe78d('0x2d')];}_0x18a2d9[_0xe78d('0x21')](_0x59c7fb)[_0xe78d('0x2e')](_0x119f44);};}exports[_0xe78d('0x2f')]=function(_0x3d34af,_0x2b0d3f){var _0x311782={},_0x165ff2={},_0x19762b={'count':0x0,'rows':[]};var _0x4c9aa5=_[_0xe78d('0x30')](db[_0xe78d('0x31')][_0xe78d('0x32')],function(_0x9b8c4c){return{'name':_0x9b8c4c[_0xe78d('0x33')],'type':_0x9b8c4c['type'][_0xe78d('0x34')]};});_0x165ff2[_0xe78d('0x35')]=_['map'](_0x4c9aa5,'name');_0x165ff2['query']=_[_0xe78d('0x36')](_0x3d34af[_0xe78d('0x37')]);_0x165ff2[_0xe78d('0x38')]=_[_0xe78d('0x39')](_0x165ff2['model'],_0x165ff2['query']);_0x311782[_0xe78d('0x3a')]=_[_0xe78d('0x39')](_0x165ff2['model'],qs[_0xe78d('0x3b')](_0x3d34af[_0xe78d('0x37')][_0xe78d('0x3b')]));_0x311782[_0xe78d('0x3a')]=_0x311782[_0xe78d('0x3a')][_0xe78d('0x3c')]?_0x311782['attributes']:_0x165ff2[_0xe78d('0x35')];if(!_0x3d34af[_0xe78d('0x37')][_0xe78d('0x3d')](_0xe78d('0x3e'))){_0x311782['limit']=qs[_0xe78d('0x20')](_0x3d34af['query']['limit']);_0x311782['offset']=qs[_0xe78d('0x1e')](_0x3d34af[_0xe78d('0x37')][_0xe78d('0x1e')]);}_0x311782[_0xe78d('0x3f')]=qs['sort'](_0x3d34af[_0xe78d('0x37')][_0xe78d('0x40')]);_0x311782[_0xe78d('0x41')]=qs[_0xe78d('0x38')](_['pick'](_0x3d34af[_0xe78d('0x37')],_0x165ff2['filters']),_0x4c9aa5);if(_0x3d34af[_0xe78d('0x37')]['filter']){_0x311782['where']=_['merge'](_0x311782[_0xe78d('0x41')],{'$or':_[_0xe78d('0x30')](_0x4c9aa5,function(_0x793059){if(_0x793059[_0xe78d('0x42')]!==_0xe78d('0x43')){var _0x14c1f1={};_0x14c1f1[_0x793059[_0xe78d('0x2d')]]={'$like':'%'+_0x3d34af[_0xe78d('0x37')]['filter']+'%'};return _0x14c1f1;}})});}_0x311782=_['merge']({},_0x311782,_0x3d34af[_0xe78d('0x44')]);var _0x55c22f={'where':_0x311782[_0xe78d('0x41')]};return db[_0xe78d('0x31')][_0xe78d('0x45')](_0x55c22f)[_0xe78d('0x28')](function(_0x4684ae){_0x19762b[_0xe78d('0x45')]=_0x4684ae;if(_0x3d34af[_0xe78d('0x37')][_0xe78d('0x46')]){_0x311782[_0xe78d('0x47')]=[{'all':!![]}];}return db[_0xe78d('0x31')][_0xe78d('0x48')](_0x311782);})[_0xe78d('0x28')](function(_0x2a50f2){_0x19762b[_0xe78d('0x49')]=_0x2a50f2;return _0x19762b;})['then'](respondWithFilteredResult(_0x2b0d3f,_0x311782))[_0xe78d('0x4a')](handleError(_0x2b0d3f,null));};exports['show']=function(_0x52886e,_0x919c93){var _0xc37213={'raw':!![],'where':{'id':_0x52886e[_0xe78d('0x4b')]['id']}},_0x5413b6={};_0x5413b6['model']=_[_0xe78d('0x36')](db[_0xe78d('0x31')][_0xe78d('0x32')]);_0x5413b6[_0xe78d('0x37')]=_['keys'](_0x52886e[_0xe78d('0x37')]);_0x5413b6[_0xe78d('0x38')]=_[_0xe78d('0x39')](_0x5413b6[_0xe78d('0x35')],_0x5413b6[_0xe78d('0x37')]);_0xc37213['attributes']=_[_0xe78d('0x39')](_0x5413b6[_0xe78d('0x35')],qs[_0xe78d('0x3b')](_0x52886e[_0xe78d('0x37')][_0xe78d('0x3b')]));_0xc37213[_0xe78d('0x3a')]=_0xc37213['attributes'][_0xe78d('0x3c')]?_0xc37213[_0xe78d('0x3a')]:_0x5413b6[_0xe78d('0x35')];if(_0x52886e[_0xe78d('0x37')][_0xe78d('0x46')]){_0xc37213[_0xe78d('0x47')]=[{'all':!![]}];}_0xc37213=_[_0xe78d('0x4c')]({},_0xc37213,_0x52886e['options']);return db[_0xe78d('0x31')][_0xe78d('0x4d')](_0xc37213)['then'](handleEntityNotFound(_0x919c93,null))[_0xe78d('0x28')](respondWithResult(_0x919c93,null))[_0xe78d('0x4a')](handleError(_0x919c93,null));};exports[_0xe78d('0x4e')]=function(_0x2638bc,_0x38b9b8,_0x461087){return db['Sound'][_0xe78d('0x4d')]({'where':{'id':_0x2638bc[_0xe78d('0x4b')]['id']},'attributes':['name',_0xe78d('0x4f'),'converted_format'],'raw':!![]})[_0xe78d('0x28')](handleEntityNotFound(_0x38b9b8,null))[_0xe78d('0x28')](function(_0xbc5f10){if(_0xbc5f10){if(!fs[_0xe78d('0x50')](path[_0xe78d('0x51')](config[_0xe78d('0x52')],'server/files/sounds/converted',_0xbc5f10[_0xe78d('0x4f')]+'.'+_0xbc5f10['converted_format']))){throw new db[(_0xe78d('0x53'))]['ValidationError'](_0xe78d('0x54'));}return _0x38b9b8[_0xe78d('0x4e')](path[_0xe78d('0x51')](config['root'],_0xe78d('0x55'),util[_0xe78d('0x56')](_0xe78d('0x57'),_0xbc5f10[_0xe78d('0x4f')],_0xbc5f10['converted_format'])),util[_0xe78d('0x56')](_0xe78d('0x57'),_0xbc5f10[_0xe78d('0x2d')],_0xbc5f10[_0xe78d('0x58')]));}return null;})['catch'](handleError(_0x38b9b8,null));};exports[_0xe78d('0x59')]=function(_0xc973c5,_0x3ba21d,_0x90aef3){var _0x534fbc={'name':path[_0xe78d('0x5a')](_0xc973c5['file'][_0xe78d('0x5b')],path[_0xe78d('0x5c')](_0xc973c5[_0xe78d('0x5d')][_0xe78d('0x5b')])),'save_name':path['basename'](_0xc973c5[_0xe78d('0x5d')][_0xe78d('0x5e')],path['extname'](_0xc973c5[_0xe78d('0x5d')][_0xe78d('0x5e')])),'original_format':path['extname'](_0xc973c5[_0xe78d('0x5d')]['originalname'])[_0xe78d('0x5f')](0x1),'converted_format':_0xe78d('0x60')};var _0x4146ca=path[_0xe78d('0x51')](config[_0xe78d('0x52')],_0xe78d('0x61'),_0xc973c5[_0xe78d('0x5d')]['filename']);var _0x26d30c=path['join'](config[_0xe78d('0x52')],_0xe78d('0x55'),util[_0xe78d('0x56')](_0xe78d('0x57'),path[_0xe78d('0x5a')](_0xc973c5[_0xe78d('0x5d')][_0xe78d('0x5e')],path[_0xe78d('0x5c')](_0xc973c5[_0xe78d('0x5d')][_0xe78d('0x5e')])),_0x534fbc[_0xe78d('0x58')]));logger[_0xe78d('0x62')](_0xe78d('0x63'),_0x4146ca);logger[_0xe78d('0x62')]('Sound\x20upload\x20destination:\x20%s',_0x26d30c);try{fs[_0xe78d('0x64')](_0x4146ca,parseInt('0777',0x8));var _0x1ed0aa=sox[_0xe78d('0x65')](_0x4146ca,_0x26d30c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1ed0aa['on'](_0xe78d('0x2b'),function(_0x4fb8ee){fs[_0xe78d('0x66')](_0x4146ca);_0x3ba21d[_0xe78d('0x21')](0x1f4)[_0xe78d('0x2e')](_0x4fb8ee);});_0x1ed0aa['on']('src',function(_0x4e20dc){_0x534fbc[_0xe78d('0x67')]=isNaN(_0x4e20dc[_0xe78d('0x68')])?null:_0x4e20dc[_0xe78d('0x68')]*0x3e8;_0x534fbc[_0xe78d('0x69')]=isNaN(_0x4e20dc['sampleCount'])?null:_0x4e20dc['sampleCount'];_0x534fbc['original_channelCount']=isNaN(_0x4e20dc[_0xe78d('0x6a')])?null:_0x4e20dc[_0xe78d('0x6a')];_0x534fbc[_0xe78d('0x6b')]=isNaN(_0x4e20dc[_0xe78d('0x6c')])?null:_0x4e20dc[_0xe78d('0x6c')];_0x534fbc[_0xe78d('0x6d')]=isNaN(_0x4e20dc[_0xe78d('0x6e')])?null:_0x4e20dc[_0xe78d('0x6e')];});_0x1ed0aa['on'](_0xe78d('0x6f'),function(_0x417441){_0x534fbc[_0xe78d('0x70')]=isNaN(_0x417441['duration'])?null:_0x417441[_0xe78d('0x68')]*0x3e8;_0x534fbc['converted_sampleCount']=isNaN(_0x417441['sampleCount'])?null:_0x417441[_0xe78d('0x71')];_0x534fbc[_0xe78d('0x72')]=isNaN(_0x417441['channelCount'])?null:_0x417441[_0xe78d('0x6a')];_0x534fbc['converted_bitRate']=isNaN(_0x417441['bitRate'])?null:_0x417441[_0xe78d('0x6c')];_0x534fbc[_0xe78d('0x73')]=isNaN(_0x417441[_0xe78d('0x6e')])?null:_0x417441[_0xe78d('0x6e')];});_0x1ed0aa['on'](_0xe78d('0x1c'),function(){fs['chmodSync'](_0x26d30c,parseInt(_0xe78d('0x74'),0x8));return db['Sound']['create'](_0x534fbc)[_0xe78d('0x28')](function(_0x5d68d3){var _0x2858d1={'role':_0xc973c5[_0xe78d('0x75')][_0xe78d('0x76')],'userProfileId':_0xc973c5['body'][_0xe78d('0x77')]};if(!_0x2858d1)throw new Error(_0xe78d('0x78'));if(_0x2858d1[_0xe78d('0x76')]===_0xe78d('0x79')){var _0x1e2d5a=_0x5d68d3['get']({'plain':!![]});return db[_0xe78d('0x7a')][_0xe78d('0x4d')]({'where':{'name':_0xe78d('0x29'),'userProfileId':_0x2858d1[_0xe78d('0x77')]},'raw':!![]})[_0xe78d('0x28')](function(_0x41a4e7){if(_0x41a4e7&&_0x41a4e7['autoAssociation']===0x0){return db[_0xe78d('0x2a')][_0xe78d('0x59')]({'name':_0x1e2d5a[_0xe78d('0x2d')],'resourceId':_0x1e2d5a['id'],'type':_0x41a4e7['name'],'sectionId':_0x41a4e7['id']},{})['then'](function(){return _0x5d68d3;});}else{return _0x5d68d3;}})[_0xe78d('0x4a')](function(_0x2995a3){logger[_0xe78d('0x2b')](_0xe78d('0x7b'),_0x2995a3);throw _0x2995a3;});}return _0x5d68d3;})[_0xe78d('0x28')](respondWithResult(_0x3ba21d,null))['catch'](handleError(_0x3ba21d,null));});_0x1ed0aa[_0xe78d('0x7c')]();}catch(_0x488d72){_0x3ba21d[_0xe78d('0x21')](0x1f4)['send'](_0x488d72);}};exports['update']=function(_0x237529,_0x55949d,_0x5579f7){return db[_0xe78d('0x31')][_0xe78d('0x4d')]({'where':{'id':_0x237529[_0xe78d('0x4b')]['id']}})[_0xe78d('0x28')](handleEntityNotFound(_0x55949d,null))[_0xe78d('0x28')](saveUpdates(_[_0xe78d('0x7d')](_0x237529[_0xe78d('0x75')],['name',_0xe78d('0x7e')]),null))[_0xe78d('0x28')](respondWithResult(_0x55949d,null))['catch'](handleError(_0x55949d,null));};exports[_0xe78d('0x7f')]=function(_0x4b18bf,_0x4d9348,_0x300ebf){return db['Sound'][_0xe78d('0x4d')]({'where':{'id':_0x4b18bf[_0xe78d('0x4b')]['id']}})[_0xe78d('0x28')](function(_0x375049){if(_0x375049){return _0x375049[_0xe78d('0x80')]();}})['then'](function(_0x3886af){var _0x57710f=path[_0xe78d('0x51')](config[_0xe78d('0x52')],_0xe78d('0x61'),util[_0xe78d('0x56')](_0xe78d('0x57'),_0x3886af[_0xe78d('0x4f')],_0x3886af[_0xe78d('0x81')]));var _0x2b0403=path[_0xe78d('0x51')](config[_0xe78d('0x52')],_0xe78d('0x55'),util[_0xe78d('0x56')](_0xe78d('0x57'),_0x3886af[_0xe78d('0x4f')],_0x3886af[_0xe78d('0x58')]));fs[_0xe78d('0x66')](_0x57710f);fs['unlinkSync'](_0x2b0403);return _0x3886af;})['then'](function(_0x1cfbff){if(_0x1cfbff){return _0x4d9348['status'](0xcc)[_0xe78d('0x1c')]();}})[_0xe78d('0x28')](handleEntityNotFound(_0x4d9348,null))['catch'](handleError(_0x4d9348,null));}; \ No newline at end of file +var _0x7a0b=['converted_sampleRate','body','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','Sounds','UserProfileResource','destroy','status','end','error','stack','name','send','map','Sound','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','download','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate'];(function(_0x2b2751,_0x6635f){var _0x500fd0=function(_0x2487b5){while(--_0x2487b5){_0x2b2751['push'](_0x2b2751['shift']());}};_0x500fd0(++_0x6635f);}(_0x7a0b,0xfd));var _0xb7a0=function(_0x4f2b87,_0xe0661d){_0x4f2b87=_0x4f2b87-0x0;var _0xee4001=_0x7a0b[_0x4f2b87];return _0xee4001;};'use strict';var emlformat=require(_0xb7a0('0x0'));var rimraf=require(_0xb7a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7a0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb7a0('0x3'));var util=require(_0xb7a0('0x4'));var path=require(_0xb7a0('0x5'));var sox=require('sox');var csv=require(_0xb7a0('0x6'));var ejs=require(_0xb7a0('0x7'));var fs=require('fs');var fs_extra=require(_0xb7a0('0x8'));var _=require('lodash');var squel=require(_0xb7a0('0x9'));var crypto=require('crypto');var jsforce=require(_0xb7a0('0xa'));var deskjs=require(_0xb7a0('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb7a0('0xc'));var Redis=require(_0xb7a0('0xd'));var authService=require(_0xb7a0('0xe'));var qs=require(_0xb7a0('0xf'));var as=require(_0xb7a0('0x10'));var hardwareService=require(_0xb7a0('0x11'));var logger=require(_0xb7a0('0x12'))('api');var utils=require(_0xb7a0('0x13'));var config=require(_0xb7a0('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x380101,_0x579294){_0x579294=_0x579294||0xcc;return function(_0x548f9c){if(_0x548f9c){return _0x380101[_0xb7a0('0x15')](_0x579294);}return _0x380101['status'](_0x579294)['end']();};}function respondWithResult(_0x340fa9,_0x12cfd0){_0x12cfd0=_0x12cfd0||0xc8;return function(_0x4bfa93){if(_0x4bfa93){return _0x340fa9['status'](_0x12cfd0)[_0xb7a0('0x16')](_0x4bfa93);}};}function respondWithFilteredResult(_0x5d2eae,_0x3dbf3e){return function(_0x49fa18){if(_0x49fa18){var _0x28827e=typeof _0x3dbf3e[_0xb7a0('0x17')]===_0xb7a0('0x18')&&typeof _0x3dbf3e[_0xb7a0('0x19')]===_0xb7a0('0x18');var _0x54317f=_0x49fa18['count'];var _0x28fba7=_0x28827e?0x0:_0x3dbf3e['offset'];var _0x11938e=_0x28827e?_0x49fa18[_0xb7a0('0x1a')]:_0x3dbf3e[_0xb7a0('0x17')]+_0x3dbf3e[_0xb7a0('0x19')];var _0x4a800d;if(_0x11938e>=_0x54317f){_0x11938e=_0x54317f;_0x4a800d=0xc8;}else{_0x4a800d=0xce;}_0x5d2eae['status'](_0x4a800d);return _0x5d2eae[_0xb7a0('0x1b')](_0xb7a0('0x1c'),_0x28fba7+'-'+_0x11938e+'/'+_0x54317f)[_0xb7a0('0x16')](_0x49fa18);}return null;};}function patchUpdates(_0x5b06e0){return function(_0x320bb8){try{jsonpatch[_0xb7a0('0x1d')](_0x320bb8,_0x5b06e0,!![]);}catch(_0x29c592){return BPromise['reject'](_0x29c592);}return _0x320bb8['save']();};}function saveUpdates(_0x5b8b9d,_0x517120){return function(_0x39a422){if(_0x39a422){return _0x39a422['update'](_0x5b8b9d)[_0xb7a0('0x1e')](function(_0x20ccfe){return _0x20ccfe;});}return null;};}function removeEntity(_0x5ef33b,_0x1a2936){return function(_0x1c69cf){if(_0x1c69cf){return _0x1c69cf['destroy']()[_0xb7a0('0x1e')](function(){var _0x392ff1=_0x1c69cf[_0xb7a0('0x1f')]({'plain':!![]});var _0x41aad4=_0xb7a0('0x20');return db[_0xb7a0('0x21')][_0xb7a0('0x22')]({'where':{'type':_0x41aad4,'resourceId':_0x392ff1['id']}})[_0xb7a0('0x1e')](function(){return _0x1c69cf;});})[_0xb7a0('0x1e')](function(){_0x5ef33b[_0xb7a0('0x23')](0xcc)[_0xb7a0('0x24')]();});}};}function handleEntityNotFound(_0x3858e9,_0x3b1de8){return function(_0x5245c4){if(!_0x5245c4){_0x3858e9[_0xb7a0('0x15')](0x194);}return _0x5245c4;};}function handleError(_0x43df3d,_0x1a0350){_0x1a0350=_0x1a0350||0x1f4;return function(_0xfb8b2d){logger[_0xb7a0('0x25')](_0xfb8b2d[_0xb7a0('0x26')]);if(_0xfb8b2d[_0xb7a0('0x27')]){delete _0xfb8b2d[_0xb7a0('0x27')];}_0x43df3d[_0xb7a0('0x23')](_0x1a0350)[_0xb7a0('0x28')](_0xfb8b2d);};}exports['index']=function(_0x40a473,_0x33a14f){var _0x16e29a={},_0x70240={},_0x38ab9b={'count':0x0,'rows':[]};var _0x246664=_[_0xb7a0('0x29')](db[_0xb7a0('0x2a')][_0xb7a0('0x2b')],function(_0x354d97){return{'name':_0x354d97[_0xb7a0('0x2c')],'type':_0x354d97['type']['key']};});_0x70240['model']=_['map'](_0x246664,_0xb7a0('0x27'));_0x70240[_0xb7a0('0x2d')]=_[_0xb7a0('0x2e')](_0x40a473['query']);_0x70240[_0xb7a0('0x2f')]=_[_0xb7a0('0x30')](_0x70240[_0xb7a0('0x31')],_0x70240['query']);_0x16e29a[_0xb7a0('0x32')]=_[_0xb7a0('0x30')](_0x70240[_0xb7a0('0x31')],qs[_0xb7a0('0x33')](_0x40a473[_0xb7a0('0x2d')][_0xb7a0('0x33')]));_0x16e29a[_0xb7a0('0x32')]=_0x16e29a[_0xb7a0('0x32')]['length']?_0x16e29a['attributes']:_0x70240['model'];if(!_0x40a473[_0xb7a0('0x2d')][_0xb7a0('0x34')](_0xb7a0('0x35'))){_0x16e29a['limit']=qs['limit'](_0x40a473[_0xb7a0('0x2d')][_0xb7a0('0x19')]);_0x16e29a[_0xb7a0('0x17')]=qs[_0xb7a0('0x17')](_0x40a473[_0xb7a0('0x2d')][_0xb7a0('0x17')]);}_0x16e29a[_0xb7a0('0x36')]=qs[_0xb7a0('0x37')](_0x40a473[_0xb7a0('0x2d')][_0xb7a0('0x37')]);_0x16e29a['where']=qs['filters'](_[_0xb7a0('0x38')](_0x40a473[_0xb7a0('0x2d')],_0x70240['filters']),_0x246664);if(_0x40a473[_0xb7a0('0x2d')][_0xb7a0('0x39')]){_0x16e29a[_0xb7a0('0x3a')]=_[_0xb7a0('0x3b')](_0x16e29a[_0xb7a0('0x3a')],{'$or':_[_0xb7a0('0x29')](_0x246664,function(_0x2ecd16){if(_0x2ecd16[_0xb7a0('0x3c')]!==_0xb7a0('0x3d')){var _0x6f9e05={};_0x6f9e05[_0x2ecd16[_0xb7a0('0x27')]]={'$like':'%'+_0x40a473['query'][_0xb7a0('0x39')]+'%'};return _0x6f9e05;}})});}_0x16e29a=_[_0xb7a0('0x3b')]({},_0x16e29a,_0x40a473[_0xb7a0('0x3e')]);var _0x29a526={'where':_0x16e29a[_0xb7a0('0x3a')]};return db[_0xb7a0('0x2a')][_0xb7a0('0x1a')](_0x29a526)['then'](function(_0x47bf49){_0x38ab9b[_0xb7a0('0x1a')]=_0x47bf49;if(_0x40a473[_0xb7a0('0x2d')][_0xb7a0('0x3f')]){_0x16e29a[_0xb7a0('0x40')]=[{'all':!![]}];}return db[_0xb7a0('0x2a')][_0xb7a0('0x41')](_0x16e29a);})[_0xb7a0('0x1e')](function(_0x32915f){_0x38ab9b[_0xb7a0('0x42')]=_0x32915f;return _0x38ab9b;})[_0xb7a0('0x1e')](respondWithFilteredResult(_0x33a14f,_0x16e29a))[_0xb7a0('0x43')](handleError(_0x33a14f,null));};exports[_0xb7a0('0x44')]=function(_0x2dc70b,_0x270a0f){var _0x169d35={'raw':!![],'where':{'id':_0x2dc70b['params']['id']}},_0x44677b={};_0x44677b['model']=_['keys'](db[_0xb7a0('0x2a')]['rawAttributes']);_0x44677b[_0xb7a0('0x2d')]=_[_0xb7a0('0x2e')](_0x2dc70b[_0xb7a0('0x2d')]);_0x44677b[_0xb7a0('0x2f')]=_[_0xb7a0('0x30')](_0x44677b[_0xb7a0('0x31')],_0x44677b[_0xb7a0('0x2d')]);_0x169d35[_0xb7a0('0x32')]=_[_0xb7a0('0x30')](_0x44677b[_0xb7a0('0x31')],qs[_0xb7a0('0x33')](_0x2dc70b[_0xb7a0('0x2d')]['fields']));_0x169d35[_0xb7a0('0x32')]=_0x169d35[_0xb7a0('0x32')]['length']?_0x169d35[_0xb7a0('0x32')]:_0x44677b['model'];if(_0x2dc70b['query'][_0xb7a0('0x3f')]){_0x169d35['include']=[{'all':!![]}];}_0x169d35=_[_0xb7a0('0x3b')]({},_0x169d35,_0x2dc70b[_0xb7a0('0x3e')]);return db[_0xb7a0('0x2a')][_0xb7a0('0x45')](_0x169d35)[_0xb7a0('0x1e')](handleEntityNotFound(_0x270a0f,null))[_0xb7a0('0x1e')](respondWithResult(_0x270a0f,null))[_0xb7a0('0x43')](handleError(_0x270a0f,null));};exports[_0xb7a0('0x46')]=function(_0x4567ec,_0x3168ed,_0x445a4d){return db[_0xb7a0('0x2a')][_0xb7a0('0x45')]({'where':{'id':_0x4567ec[_0xb7a0('0x47')]['id']},'attributes':['name',_0xb7a0('0x48'),_0xb7a0('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x3168ed,null))[_0xb7a0('0x1e')](function(_0x4b88a4){if(_0x4b88a4){if(!fs[_0xb7a0('0x4a')](path[_0xb7a0('0x4b')](config[_0xb7a0('0x4c')],_0xb7a0('0x4d'),_0x4b88a4[_0xb7a0('0x48')]+'.'+_0x4b88a4[_0xb7a0('0x49')]))){throw new db[(_0xb7a0('0x4e'))][(_0xb7a0('0x4f'))](_0xb7a0('0x50'));}return _0x3168ed[_0xb7a0('0x46')](path[_0xb7a0('0x4b')](config['root'],_0xb7a0('0x4d'),util['format'](_0xb7a0('0x51'),_0x4b88a4[_0xb7a0('0x48')],_0x4b88a4['converted_format'])),util[_0xb7a0('0x52')](_0xb7a0('0x51'),_0x4b88a4[_0xb7a0('0x27')],_0x4b88a4['converted_format']));}return null;})[_0xb7a0('0x43')](handleError(_0x3168ed,null));};exports[_0xb7a0('0x53')]=function(_0xe4279f,_0x5add51,_0x568c6a){var _0x5a0307={'name':path[_0xb7a0('0x54')](_0xe4279f[_0xb7a0('0x55')][_0xb7a0('0x56')],path[_0xb7a0('0x57')](_0xe4279f[_0xb7a0('0x55')][_0xb7a0('0x56')])),'save_name':path['basename'](_0xe4279f['file']['filename'],path['extname'](_0xe4279f[_0xb7a0('0x55')][_0xb7a0('0x58')])),'original_format':path[_0xb7a0('0x57')](_0xe4279f['file'][_0xb7a0('0x56')])[_0xb7a0('0x59')](0x1),'converted_format':_0xb7a0('0x5a')};var _0x2205eb=path['join'](config[_0xb7a0('0x4c')],_0xb7a0('0x5b'),_0xe4279f[_0xb7a0('0x55')][_0xb7a0('0x58')]);var _0x2b0e2e=path[_0xb7a0('0x4b')](config[_0xb7a0('0x4c')],'server/files/sounds/converted',util[_0xb7a0('0x52')]('%s.%s',path[_0xb7a0('0x54')](_0xe4279f[_0xb7a0('0x55')][_0xb7a0('0x58')],path['extname'](_0xe4279f[_0xb7a0('0x55')][_0xb7a0('0x58')])),_0x5a0307['converted_format']));logger[_0xb7a0('0x5c')](_0xb7a0('0x5d'),_0x2205eb);logger[_0xb7a0('0x5c')](_0xb7a0('0x5e'),_0x2b0e2e);try{fs[_0xb7a0('0x5f')](_0x2205eb,parseInt(_0xb7a0('0x60'),0x8));var _0x5a2e07=sox[_0xb7a0('0x61')](_0x2205eb,_0x2b0e2e,{'sampleRate':0x1f40,'format':_0xb7a0('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5a2e07['on'](_0xb7a0('0x25'),function(_0x1088cd){fs[_0xb7a0('0x62')](_0x2205eb);_0x5add51[_0xb7a0('0x23')](0x1f4)[_0xb7a0('0x28')](_0x1088cd);});_0x5a2e07['on'](_0xb7a0('0x63'),function(_0x2c1cab){_0x5a0307[_0xb7a0('0x64')]=isNaN(_0x2c1cab[_0xb7a0('0x65')])?null:_0x2c1cab[_0xb7a0('0x65')]*0x3e8;_0x5a0307[_0xb7a0('0x66')]=isNaN(_0x2c1cab['sampleCount'])?null:_0x2c1cab[_0xb7a0('0x67')];_0x5a0307['original_channelCount']=isNaN(_0x2c1cab[_0xb7a0('0x68')])?null:_0x2c1cab[_0xb7a0('0x68')];_0x5a0307['original_bitRate']=isNaN(_0x2c1cab[_0xb7a0('0x69')])?null:_0x2c1cab[_0xb7a0('0x69')];_0x5a0307[_0xb7a0('0x6a')]=isNaN(_0x2c1cab[_0xb7a0('0x6b')])?null:_0x2c1cab[_0xb7a0('0x6b')];});_0x5a2e07['on'](_0xb7a0('0x6c'),function(_0x547426){_0x5a0307[_0xb7a0('0x6d')]=isNaN(_0x547426[_0xb7a0('0x65')])?null:_0x547426[_0xb7a0('0x65')]*0x3e8;_0x5a0307[_0xb7a0('0x6e')]=isNaN(_0x547426['sampleCount'])?null:_0x547426['sampleCount'];_0x5a0307[_0xb7a0('0x6f')]=isNaN(_0x547426[_0xb7a0('0x68')])?null:_0x547426[_0xb7a0('0x68')];_0x5a0307[_0xb7a0('0x70')]=isNaN(_0x547426[_0xb7a0('0x69')])?null:_0x547426['bitRate'];_0x5a0307[_0xb7a0('0x71')]=isNaN(_0x547426['sampleRate'])?null:_0x547426['sampleRate'];});_0x5a2e07['on'](_0xb7a0('0x24'),function(){fs[_0xb7a0('0x5f')](_0x2b0e2e,parseInt(_0xb7a0('0x60'),0x8));return db[_0xb7a0('0x2a')]['create'](_0x5a0307)['then'](function(_0x13d47e){var _0x5d1b6f={'role':_0xe4279f[_0xb7a0('0x72')][_0xb7a0('0x73')],'userProfileId':_0xe4279f[_0xb7a0('0x72')][_0xb7a0('0x74')]};if(!_0x5d1b6f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d1b6f[_0xb7a0('0x73')]==='user'){var _0x4205c8=_0x13d47e[_0xb7a0('0x1f')]({'plain':!![]});return db['UserProfileSection'][_0xb7a0('0x45')]({'where':{'name':_0xb7a0('0x20'),'userProfileId':_0x5d1b6f[_0xb7a0('0x74')]},'raw':!![]})[_0xb7a0('0x1e')](function(_0x4ad19f){if(_0x4ad19f&&_0x4ad19f[_0xb7a0('0x75')]===0x0){return db[_0xb7a0('0x21')][_0xb7a0('0x53')]({'name':_0x4205c8[_0xb7a0('0x27')],'resourceId':_0x4205c8['id'],'type':_0x4ad19f[_0xb7a0('0x27')],'sectionId':_0x4ad19f['id']},{})[_0xb7a0('0x1e')](function(){return _0x13d47e;});}else{return _0x13d47e;}})[_0xb7a0('0x43')](function(_0x103a9b){logger[_0xb7a0('0x25')](_0xb7a0('0x76'),_0x103a9b);throw _0x103a9b;});}return _0x13d47e;})[_0xb7a0('0x1e')](respondWithResult(_0x5add51,null))[_0xb7a0('0x43')](handleError(_0x5add51,null));});_0x5a2e07[_0xb7a0('0x77')]();}catch(_0x55bcb1){_0x5add51[_0xb7a0('0x23')](0x1f4)['send'](_0x55bcb1);}};exports['update']=function(_0x2e79b2,_0x569144,_0x2e9755){return db[_0xb7a0('0x2a')][_0xb7a0('0x45')]({'where':{'id':_0x2e79b2[_0xb7a0('0x47')]['id']}})[_0xb7a0('0x1e')](handleEntityNotFound(_0x569144,null))['then'](saveUpdates(_[_0xb7a0('0x38')](_0x2e79b2['body'],[_0xb7a0('0x27'),_0xb7a0('0x78')]),null))[_0xb7a0('0x1e')](respondWithResult(_0x569144,null))[_0xb7a0('0x43')](handleError(_0x569144,null));};exports['delete']=function(_0xbd5c9,_0x5c8bc9,_0x100091){return db[_0xb7a0('0x2a')][_0xb7a0('0x45')]({'where':{'id':_0xbd5c9['params']['id']}})[_0xb7a0('0x1e')](function(_0x3ceb10){if(_0x3ceb10){return _0x3ceb10[_0xb7a0('0x22')]();}})[_0xb7a0('0x1e')](function(_0x193c06){var _0x272860=path[_0xb7a0('0x4b')](config[_0xb7a0('0x4c')],_0xb7a0('0x5b'),util[_0xb7a0('0x52')](_0xb7a0('0x51'),_0x193c06[_0xb7a0('0x48')],_0x193c06[_0xb7a0('0x79')]));var _0x8c7892=path['join'](config[_0xb7a0('0x4c')],_0xb7a0('0x4d'),util['format'](_0xb7a0('0x51'),_0x193c06[_0xb7a0('0x48')],_0x193c06[_0xb7a0('0x49')]));fs[_0xb7a0('0x62')](_0x272860);fs[_0xb7a0('0x62')](_0x8c7892);return _0x193c06;})[_0xb7a0('0x1e')](function(_0x2007d1){if(_0x2007d1){return _0x5c8bc9['status'](0xcc)[_0xb7a0('0x24')]();}})[_0xb7a0('0x1e')](handleEntityNotFound(_0x5c8bc9,null))['catch'](handleError(_0x5c8bc9,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 22ac33e..e7baf44 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 _0xc0a2=['bluebird','request-promise','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','moment'];(function(_0x48017a,_0x9c5ba2){var _0x3d52d2=function(_0x59dec0){while(--_0x59dec0){_0x48017a['push'](_0x48017a['shift']());}};_0x3d52d2(++_0x9c5ba2);}(_0xc0a2,0xbc));var _0x2c0a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0a2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2c0a('0x0'));var util=require(_0x2c0a('0x1'));var logger=require(_0x2c0a('0x2'))('api');var moment=require(_0x2c0a('0x3'));var BPromise=require(_0x2c0a('0x4'));var rp=require(_0x2c0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c0a('0x6'));var config=require('../../config/environment');var attributes=require(_0x2c0a('0x7'));module[_0x2c0a('0x8')]=function(_0x1eb8fa,_0x143dea){return _0x1eb8fa[_0x2c0a('0x9')](_0x2c0a('0xa'),attributes,{'tableName':_0x2c0a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x082c=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','../../config/logger','moment'];(function(_0x4eec2b,_0x588cb1){var _0x3447c7=function(_0x2fd20c){while(--_0x2fd20c){_0x4eec2b['push'](_0x4eec2b['shift']());}};_0x3447c7(++_0x588cb1);}(_0x082c,0x183));var _0xc082=function(_0x4c7a27,_0x3811bb){_0x4c7a27=_0x4c7a27-0x0;var _0x427aa5=_0x082c[_0x4c7a27];return _0x427aa5;};'use strict';var _=require(_0xc082('0x0'));var util=require('util');var logger=require(_0xc082('0x1'))('api');var moment=require(_0xc082('0x2'));var BPromise=require(_0xc082('0x3'));var rp=require(_0xc082('0x4'));var fs=require('fs');var path=require(_0xc082('0x5'));var rimraf=require(_0xc082('0x6'));var config=require(_0xc082('0x7'));var attributes=require('./sound.attributes');module[_0xc082('0x8')]=function(_0x46a9dd,_0x2b0ea5){return _0x46a9dd[_0xc082('0x9')]('Sound',attributes,{'tableName':'tools_sounds','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 90a0559..9e5cf24 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 _0x7e3a=['client','http','then','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7e3a,0x155));var _0xa7e3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7e3a[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xa7e3('0x0'));var moment=require(_0xa7e3('0x1'));var BPromise=require(_0xa7e3('0x2'));var rs=require(_0xa7e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa7e3('0x5'));var jayson=require(_0xa7e3('0x6'));var client=jayson[_0xa7e3('0x7')][_0xa7e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bf412,_0x40faa1,_0x42f91d){return new BPromise(function(_0x1ef511,_0x77fba5){return client['request'](_0x1bf412,_0x42f91d)[_0xa7e3('0x9')](function(_0x5ebff6){logger[_0xa7e3('0xa')](_0xa7e3('0xb'),_0x40faa1,'request\x20sent');logger[_0xa7e3('0xc')]('Sound,\x20%s,\x20%s,\x20%s',_0x40faa1,_0xa7e3('0xd'),JSON[_0xa7e3('0xe')](_0x5ebff6));if(_0x5ebff6[_0xa7e3('0xf')]){if(_0x5ebff6[_0xa7e3('0xf')][_0xa7e3('0x10')]===0x1f4){logger[_0xa7e3('0xf')](_0xa7e3('0xb'),_0x40faa1,_0x5ebff6[_0xa7e3('0xf')][_0xa7e3('0x11')]);return _0x77fba5(_0x5ebff6[_0xa7e3('0xf')][_0xa7e3('0x11')]);}logger['error']('Sound,\x20%s,\x20%s',_0x40faa1,_0x5ebff6[_0xa7e3('0xf')][_0xa7e3('0x11')]);return _0x1ef511(_0x5ebff6[_0xa7e3('0xf')][_0xa7e3('0x11')]);}else{logger[_0xa7e3('0xa')](_0xa7e3('0xb'),_0x40faa1,'request\x20sent');_0x1ef511(_0x5ebff6[_0xa7e3('0x12')][_0xa7e3('0x11')]);}})[_0xa7e3('0x13')](function(_0x36ba5d){logger[_0xa7e3('0xf')](_0xa7e3('0xb'),_0x40faa1,_0x36ba5d);_0x77fba5(_0x36ba5d);});});}exports[_0xa7e3('0x14')]=function(_0xa67b5e){var _0x5438ce=this;return new Promise(function(_0x106042,_0x1ada15){return db[_0xa7e3('0x15')][_0xa7e3('0x16')]({'raw':_0xa67b5e['options']?_0xa67b5e[_0xa7e3('0x17')][_0xa7e3('0x18')]===undefined?!![]:![]:!![],'where':_0xa67b5e[_0xa7e3('0x17')]?_0xa67b5e[_0xa7e3('0x17')]['where']||null:null,'attributes':_0xa67b5e[_0xa7e3('0x17')]?_0xa67b5e['options'][_0xa7e3('0x19')]||null:null,'include':_0xa67b5e['options']?_0xa67b5e['options'][_0xa7e3('0x1a')]?_[_0xa7e3('0x1b')](_0xa67b5e[_0xa7e3('0x17')][_0xa7e3('0x1a')],function(_0x466f7c){return{'model':db[_0x466f7c['model']],'as':_0x466f7c['as'],'attributes':_0x466f7c[_0xa7e3('0x19')],'include':_0x466f7c[_0xa7e3('0x1a')]?_[_0xa7e3('0x1b')](_0x466f7c[_0xa7e3('0x1a')],function(_0x277846){return{'model':db[_0x277846[_0xa7e3('0x1c')]],'as':_0x277846['as'],'attributes':_0x277846[_0xa7e3('0x19')],'include':_0x277846[_0xa7e3('0x1a')]?_[_0xa7e3('0x1b')](_0x277846[_0xa7e3('0x1a')],function(_0x2f3e0d){return{'model':db[_0x2f3e0d[_0xa7e3('0x1c')]],'as':_0x2f3e0d['as'],'attributes':_0x2f3e0d['attributes']};}):[]};}):[]};}):[]:[]})[_0xa7e3('0x9')](function(_0x41df4e){logger[_0xa7e3('0xa')](_0xa7e3('0x14'),_0xa67b5e);logger['debug'](_0xa7e3('0x14'),_0xa67b5e,JSON[_0xa7e3('0xe')](_0x41df4e));_0x106042(_0x41df4e);})[_0xa7e3('0x13')](function(_0x56f155){logger[_0xa7e3('0xf')](_0xa7e3('0x14'),_0x56f155[_0xa7e3('0x11')],_0xa67b5e);_0x1ada15(_0x5438ce[_0xa7e3('0xf')](0x1f4,_0x56f155[_0xa7e3('0x11')]));});});}; \ No newline at end of file +var _0x3acf=['message','info','result','catch','Sound','find','raw','options','attributes','include','map','model','ShowSound','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s'];(function(_0x5f09b5,_0x29c29c){var _0xaa1a4f=function(_0x2b8f7d){while(--_0x2b8f7d){_0x5f09b5['push'](_0x5f09b5['shift']());}};_0xaa1a4f(++_0x29c29c);}(_0x3acf,0x1dc));var _0xf3ac=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0x3acf[_0x2637ac];return _0x4a5758;};'use strict';var _=require(_0xf3ac('0x0'));var util=require(_0xf3ac('0x1'));var moment=require(_0xf3ac('0x2'));var BPromise=require(_0xf3ac('0x3'));var rs=require(_0xf3ac('0x4'));var fs=require('fs');var Redis=require(_0xf3ac('0x5'));var db=require(_0xf3ac('0x6'))['db'];var utils=require(_0xf3ac('0x7'));var logger=require('../../config/logger')(_0xf3ac('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3ac('0x9'));var client=jayson[_0xf3ac('0xa')][_0xf3ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x290e4c,_0x510480,_0x3cee5b){return new BPromise(function(_0x22a0d0,_0x6db29f){return client[_0xf3ac('0xc')](_0x290e4c,_0x3cee5b)['then'](function(_0x3f68c8){logger['info']('Sound,\x20%s,\x20%s',_0x510480,_0xf3ac('0xd'));logger[_0xf3ac('0xe')](_0xf3ac('0xf'),_0x510480,_0xf3ac('0xd'),JSON['stringify'](_0x3f68c8));if(_0x3f68c8[_0xf3ac('0x10')]){if(_0x3f68c8[_0xf3ac('0x10')][_0xf3ac('0x11')]===0x1f4){logger[_0xf3ac('0x10')](_0xf3ac('0x12'),_0x510480,_0x3f68c8[_0xf3ac('0x10')][_0xf3ac('0x13')]);return _0x6db29f(_0x3f68c8['error'][_0xf3ac('0x13')]);}logger[_0xf3ac('0x10')](_0xf3ac('0x12'),_0x510480,_0x3f68c8[_0xf3ac('0x10')]['message']);return _0x22a0d0(_0x3f68c8[_0xf3ac('0x10')][_0xf3ac('0x13')]);}else{logger[_0xf3ac('0x14')]('Sound,\x20%s,\x20%s',_0x510480,_0xf3ac('0xd'));_0x22a0d0(_0x3f68c8[_0xf3ac('0x15')][_0xf3ac('0x13')]);}})[_0xf3ac('0x16')](function(_0x138d35){logger[_0xf3ac('0x10')](_0xf3ac('0x12'),_0x510480,_0x138d35);_0x6db29f(_0x138d35);});});}exports['ShowSound']=function(_0x57a52){var _0x1cbd88=this;return new Promise(function(_0x288cc2,_0x242cff){return db[_0xf3ac('0x17')][_0xf3ac('0x18')]({'raw':_0x57a52['options']?_0x57a52['options'][_0xf3ac('0x19')]===undefined?!![]:![]:!![],'where':_0x57a52[_0xf3ac('0x1a')]?_0x57a52['options']['where']||null:null,'attributes':_0x57a52[_0xf3ac('0x1a')]?_0x57a52['options'][_0xf3ac('0x1b')]||null:null,'include':_0x57a52[_0xf3ac('0x1a')]?_0x57a52[_0xf3ac('0x1a')][_0xf3ac('0x1c')]?_['map'](_0x57a52[_0xf3ac('0x1a')][_0xf3ac('0x1c')],function(_0x104be9){return{'model':db[_0x104be9['model']],'as':_0x104be9['as'],'attributes':_0x104be9[_0xf3ac('0x1b')],'include':_0x104be9[_0xf3ac('0x1c')]?_[_0xf3ac('0x1d')](_0x104be9[_0xf3ac('0x1c')],function(_0x3762d8){return{'model':db[_0x3762d8[_0xf3ac('0x1e')]],'as':_0x3762d8['as'],'attributes':_0x3762d8[_0xf3ac('0x1b')],'include':_0x3762d8[_0xf3ac('0x1c')]?_[_0xf3ac('0x1d')](_0x3762d8[_0xf3ac('0x1c')],function(_0x1ea5fa){return{'model':db[_0x1ea5fa[_0xf3ac('0x1e')]],'as':_0x1ea5fa['as'],'attributes':_0x1ea5fa[_0xf3ac('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf5ea5c){logger['info']('ShowSound',_0x57a52);logger[_0xf3ac('0xe')](_0xf3ac('0x1f'),_0x57a52,JSON[_0xf3ac('0x20')](_0xf5ea5c));_0x288cc2(_0xf5ea5c);})[_0xf3ac('0x16')](function(_0x169a02){logger['error'](_0xf3ac('0x1f'),_0x169a02['message'],_0x57a52);_0x242cff(_0x1cbd88[_0xf3ac('0x10')](0x1f4,_0x169a02[_0xf3ac('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index adb1b5a..39bfd0b 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0xe86b12,_0x4827a0){var _0x598296=function(_0x1ac321){while(--_0x1ac321){_0xe86b12['push'](_0xe86b12['shift']());}};_0x598296(++_0x4827a0);}(_0x5eb8,0xb0));var _0x85eb=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x5eb8[_0x13187a];return _0x65b85f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3c0467,_0x458f2e){var _0x4707e8=function(_0x2cc523){while(--_0x2cc523){_0x3c0467['push'](_0x3c0467['shift']());}};_0x4707e8(++_0x458f2e);}(_0xac4a,0x13f));var _0xaac4=function(_0xb381a0,_0x3e8cdf){_0xb381a0=_0xb381a0-0x0;var _0xeb0292=_0xac4a[_0xb381a0];return _0xeb0292;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 2b933de..80132e9 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 _0x3293=['sequelize','STRING','medium','out'];(function(_0x1f504c,_0x319b4f){var _0x50d2e6=function(_0x47f98d){while(--_0x47f98d){_0x1f504c['push'](_0x1f504c['shift']());}};_0x50d2e6(++_0x319b4f);}(_0x3293,0x158));var _0x3329=function(_0x5ee6fb,_0x3da37c){_0x5ee6fb=_0x5ee6fb-0x0;var _0x48d42e=_0x3293[_0x5ee6fb];return _0x48d42e;};'use strict';var Sequelize=require(_0x3329('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3329('0x1')]},'body':{'type':Sequelize['TEXT'](_0x3329('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3329('0x3')),'defaultValue':_0x3329('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3329('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb39b=['out','STRING','sequelize','exports','TEXT','medium','ENUM'];(function(_0x1c9e6d,_0x5b9c3a){var _0x2f0d5c=function(_0xf9059c){while(--_0xf9059c){_0x1c9e6d['push'](_0x1c9e6d['shift']());}};_0x2f0d5c(++_0x5b9c3a);}(_0xb39b,0x128));var _0xbb39=function(_0x5395d2,_0x3edb99){_0x5395d2=_0x5395d2-0x0;var _0xf4c5ee=_0xb39b[_0x5395d2];return _0xf4c5ee;};'use strict';var Sequelize=require(_0xbb39('0x0'));module[_0xbb39('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xbb39('0x2')](_0xbb39('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xbb39('0x4')]('in',_0xbb39('0x5')),'defaultValue':_0xbb39('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xbb39('0x6')]},'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 0002a67..33ffda7 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 _0x2b84=['../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x42701f,_0x3d2f90){var _0x36aafb=function(_0x1bb284){while(--_0x1bb284){_0x42701f['push'](_0x42701f['shift']());}};_0x36aafb(++_0x3d2f90);}(_0x2b84,0x1ed));var _0x42b8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2b84[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x42b8('0x0'));var rimraf=require(_0x42b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42b8('0x2'));var rp=require(_0x42b8('0x3'));var moment=require(_0x42b8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x42b8('0x5'));var util=require('util');var path=require(_0x42b8('0x6'));var sox=require('sox');var csv=require(_0x42b8('0x7'));var ejs=require(_0x42b8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x42b8('0x9'));var crypto=require(_0x42b8('0xa'));var jsforce=require(_0x42b8('0xb'));var deskjs=require(_0x42b8('0xc'));var toCsv=require(_0x42b8('0x7'));var querystring=require('querystring');var Papa=require(_0x42b8('0xd'));var Redis=require(_0x42b8('0xe'));var authService=require(_0x42b8('0xf'));var qs=require(_0x42b8('0x10'));var as=require(_0x42b8('0x11'));var hardwareService=require(_0x42b8('0x12'));var logger=require(_0x42b8('0x13'))(_0x42b8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x42b8('0x15'));var db=require(_0x42b8('0x16'))['db'];function respondWithStatusCode(_0x5a10b5,_0x3f7cc1){_0x3f7cc1=_0x3f7cc1||0xcc;return function(_0x54d531){if(_0x54d531){return _0x5a10b5['sendStatus'](_0x3f7cc1);}return _0x5a10b5[_0x42b8('0x17')](_0x3f7cc1)[_0x42b8('0x18')]();};}function respondWithResult(_0x15fab4,_0x1ea576){_0x1ea576=_0x1ea576||0xc8;return function(_0xf1fcc1){if(_0xf1fcc1){return _0x15fab4['status'](_0x1ea576)[_0x42b8('0x19')](_0xf1fcc1);}};}function respondWithFilteredResult(_0x48d8f9,_0x23a8f8){return function(_0x58c768){if(_0x58c768){var _0x54b74b=typeof _0x23a8f8[_0x42b8('0x1a')]===_0x42b8('0x1b')&&typeof _0x23a8f8[_0x42b8('0x1c')]===_0x42b8('0x1b');var _0x1b7701=_0x58c768[_0x42b8('0x1d')];var _0x5ef289=_0x54b74b?0x0:_0x23a8f8[_0x42b8('0x1a')];var _0x5664a4=_0x54b74b?_0x58c768['count']:_0x23a8f8[_0x42b8('0x1a')]+_0x23a8f8[_0x42b8('0x1c')];var _0x2310a2;if(_0x5664a4>=_0x1b7701){_0x5664a4=_0x1b7701;_0x2310a2=0xc8;}else{_0x2310a2=0xce;}_0x48d8f9[_0x42b8('0x17')](_0x2310a2);return _0x48d8f9[_0x42b8('0x1e')](_0x42b8('0x1f'),_0x5ef289+'-'+_0x5664a4+'/'+_0x1b7701)[_0x42b8('0x19')](_0x58c768);}return null;};}function patchUpdates(_0x3dd964){return function(_0x2a28ba){try{jsonpatch['apply'](_0x2a28ba,_0x3dd964,!![]);}catch(_0x5dbcdd){return BPromise['reject'](_0x5dbcdd);}return _0x2a28ba[_0x42b8('0x20')]();};}function saveUpdates(_0xcdbef8,_0x135bab){return function(_0x20b35f){if(_0x20b35f){return _0x20b35f['update'](_0xcdbef8)[_0x42b8('0x21')](function(_0x3434b0){return _0x3434b0;});}return null;};}function removeEntity(_0x5cbca8,_0x479b6d){return function(_0x328e72){if(_0x328e72){return _0x328e72[_0x42b8('0x22')]()[_0x42b8('0x21')](function(){_0x5cbca8[_0x42b8('0x17')](0xcc)[_0x42b8('0x18')]();});}};}function handleEntityNotFound(_0x551b5e,_0x30cde3){return function(_0xa29e14){if(!_0xa29e14){_0x551b5e[_0x42b8('0x23')](0x194);}return _0xa29e14;};}function handleError(_0x17a6b4,_0x37a904){_0x37a904=_0x37a904||0x1f4;return function(_0x48836e){logger[_0x42b8('0x24')](_0x48836e[_0x42b8('0x25')]);if(_0x48836e['name']){delete _0x48836e[_0x42b8('0x26')];}_0x17a6b4['status'](_0x37a904)[_0x42b8('0x27')](_0x48836e);};}exports[_0x42b8('0x28')]=function(_0x59dc05,_0x42cd34){var _0x47b462={},_0x31ef39={},_0x134bee={'count':0x0,'rows':[]};var _0x24108b=_['map'](db[_0x42b8('0x29')][_0x42b8('0x2a')],function(_0x81944d){return{'name':_0x81944d[_0x42b8('0x2b')],'type':_0x81944d[_0x42b8('0x2c')][_0x42b8('0x2d')]};});_0x31ef39[_0x42b8('0x2e')]=_[_0x42b8('0x2f')](_0x24108b,_0x42b8('0x26'));_0x31ef39[_0x42b8('0x30')]=_[_0x42b8('0x31')](_0x59dc05['query']);_0x31ef39[_0x42b8('0x32')]=_[_0x42b8('0x33')](_0x31ef39['model'],_0x31ef39[_0x42b8('0x30')]);_0x47b462[_0x42b8('0x34')]=_[_0x42b8('0x33')](_0x31ef39[_0x42b8('0x2e')],qs['fields'](_0x59dc05[_0x42b8('0x30')]['fields']));_0x47b462[_0x42b8('0x34')]=_0x47b462[_0x42b8('0x34')]['length']?_0x47b462[_0x42b8('0x34')]:_0x31ef39[_0x42b8('0x2e')];if(!_0x59dc05[_0x42b8('0x30')][_0x42b8('0x35')](_0x42b8('0x36'))){_0x47b462[_0x42b8('0x1c')]=qs[_0x42b8('0x1c')](_0x59dc05[_0x42b8('0x30')]['limit']);_0x47b462[_0x42b8('0x1a')]=qs['offset'](_0x59dc05['query'][_0x42b8('0x1a')]);}_0x47b462[_0x42b8('0x37')]=qs[_0x42b8('0x38')](_0x59dc05[_0x42b8('0x30')]['sort']);_0x47b462[_0x42b8('0x39')]=qs['filters'](_[_0x42b8('0x3a')](_0x59dc05[_0x42b8('0x30')],_0x31ef39[_0x42b8('0x32')]),_0x24108b);if(_0x59dc05[_0x42b8('0x30')][_0x42b8('0x3b')]){_0x47b462[_0x42b8('0x39')]=_[_0x42b8('0x3c')](_0x47b462['where'],{'$or':_[_0x42b8('0x2f')](_0x24108b,function(_0xa3aeca){if(_0xa3aeca[_0x42b8('0x2c')]!=='VIRTUAL'){var _0x2548a1={};_0x2548a1[_0xa3aeca['name']]={'$like':'%'+_0x59dc05[_0x42b8('0x30')][_0x42b8('0x3b')]+'%'};return _0x2548a1;}})});}_0x47b462=_['merge']({},_0x47b462,_0x59dc05[_0x42b8('0x3d')]);var _0x2d6ac4={'where':_0x47b462[_0x42b8('0x39')]};return db[_0x42b8('0x29')][_0x42b8('0x1d')](_0x2d6ac4)[_0x42b8('0x21')](function(_0x138e5b){_0x134bee[_0x42b8('0x1d')]=_0x138e5b;if(_0x59dc05['query'][_0x42b8('0x3e')]){_0x47b462[_0x42b8('0x3f')]=[{'all':!![]}];}return db['SquareMessage'][_0x42b8('0x40')](_0x47b462);})[_0x42b8('0x21')](function(_0x3f8d00){_0x134bee[_0x42b8('0x41')]=_0x3f8d00;return _0x134bee;})['then'](respondWithFilteredResult(_0x42cd34,_0x47b462))[_0x42b8('0x42')](handleError(_0x42cd34,null));};exports[_0x42b8('0x43')]=function(_0x1167fd,_0x3e3508){var _0x424cb8={'raw':!![],'where':{'id':_0x1167fd[_0x42b8('0x44')]['id']}},_0x5ded87={};_0x5ded87[_0x42b8('0x2e')]=_[_0x42b8('0x31')](db[_0x42b8('0x29')]['rawAttributes']);_0x5ded87[_0x42b8('0x30')]=_[_0x42b8('0x31')](_0x1167fd[_0x42b8('0x30')]);_0x5ded87['filters']=_['intersection'](_0x5ded87[_0x42b8('0x2e')],_0x5ded87[_0x42b8('0x30')]);_0x424cb8[_0x42b8('0x34')]=_[_0x42b8('0x33')](_0x5ded87[_0x42b8('0x2e')],qs[_0x42b8('0x45')](_0x1167fd[_0x42b8('0x30')][_0x42b8('0x45')]));_0x424cb8[_0x42b8('0x34')]=_0x424cb8[_0x42b8('0x34')]['length']?_0x424cb8[_0x42b8('0x34')]:_0x5ded87[_0x42b8('0x2e')];if(_0x1167fd['query']['includeAll']){_0x424cb8['include']=[{'all':!![]}];}_0x424cb8=_['merge']({},_0x424cb8,_0x1167fd[_0x42b8('0x3d')]);return db[_0x42b8('0x29')][_0x42b8('0x46')](_0x424cb8)[_0x42b8('0x21')](handleEntityNotFound(_0x3e3508,null))[_0x42b8('0x21')](respondWithResult(_0x3e3508,null))[_0x42b8('0x42')](handleError(_0x3e3508,null));};exports['create']=function(_0x29bf29,_0x4cbac0){return db[_0x42b8('0x29')][_0x42b8('0x47')](_0x29bf29['body'],{})[_0x42b8('0x21')](respondWithResult(_0x4cbac0,0xc9))[_0x42b8('0x42')](handleError(_0x4cbac0,null));};exports['update']=function(_0x47b4ec,_0x37dbdd){if(_0x47b4ec[_0x42b8('0x48')]['id']){delete _0x47b4ec[_0x42b8('0x48')]['id'];}return db[_0x42b8('0x29')][_0x42b8('0x46')]({'where':{'id':_0x47b4ec[_0x42b8('0x44')]['id']}})[_0x42b8('0x21')](handleEntityNotFound(_0x37dbdd,null))[_0x42b8('0x21')](saveUpdates(_0x47b4ec['body'],null))[_0x42b8('0x21')](respondWithResult(_0x37dbdd,null))[_0x42b8('0x42')](handleError(_0x37dbdd,null));};exports['destroy']=function(_0x404e53,_0x34aa32){return db['SquareMessage'][_0x42b8('0x46')]({'where':{'id':_0x404e53['params']['id']}})[_0x42b8('0x21')](handleEntityNotFound(_0x34aa32,null))[_0x42b8('0x21')](removeEntity(_0x34aa32,null))[_0x42b8('0x42')](handleError(_0x34aa32,null));}; \ No newline at end of file +var _0x5d2f=['end','json','offset','limit','count','Content-Range','apply','save','then','destroy','error','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2e2c03,_0x2462b0){var _0x457e3e=function(_0x130452){while(--_0x130452){_0x2e2c03['push'](_0x2e2c03['shift']());}};_0x457e3e(++_0x2462b0);}(_0x5d2f,0x17d));var _0xf5d2=function(_0x416f4e,_0x46a4b1){_0x416f4e=_0x416f4e-0x0;var _0x230028=_0x5d2f[_0x416f4e];return _0x230028;};'use strict';var emlformat=require(_0xf5d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5d2('0x1'));var jsonpatch=require(_0xf5d2('0x2'));var rp=require(_0xf5d2('0x3'));var moment=require(_0xf5d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf5d2('0x5'));var util=require(_0xf5d2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf5d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5d2('0x8'));var _=require(_0xf5d2('0x9'));var squel=require(_0xf5d2('0xa'));var crypto=require('crypto');var jsforce=require(_0xf5d2('0xb'));var deskjs=require(_0xf5d2('0xc'));var toCsv=require(_0xf5d2('0x7'));var querystring=require(_0xf5d2('0xd'));var Papa=require(_0xf5d2('0xe'));var Redis=require(_0xf5d2('0xf'));var authService=require(_0xf5d2('0x10'));var qs=require(_0xf5d2('0x11'));var as=require(_0xf5d2('0x12'));var hardwareService=require(_0xf5d2('0x13'));var logger=require(_0xf5d2('0x14'))('api');var utils=require(_0xf5d2('0x15'));var config=require(_0xf5d2('0x16'));var licenseUtil=require(_0xf5d2('0x17'));var db=require(_0xf5d2('0x18'))['db'];function respondWithStatusCode(_0x862893,_0x45a78b){_0x45a78b=_0x45a78b||0xcc;return function(_0x18643d){if(_0x18643d){return _0x862893[_0xf5d2('0x19')](_0x45a78b);}return _0x862893[_0xf5d2('0x1a')](_0x45a78b)[_0xf5d2('0x1b')]();};}function respondWithResult(_0x4e3dbe,_0x3feeae){_0x3feeae=_0x3feeae||0xc8;return function(_0x235d16){if(_0x235d16){return _0x4e3dbe[_0xf5d2('0x1a')](_0x3feeae)[_0xf5d2('0x1c')](_0x235d16);}};}function respondWithFilteredResult(_0x19ff31,_0x10ebe5){return function(_0x1925d0){if(_0x1925d0){var _0x294af7=typeof _0x10ebe5[_0xf5d2('0x1d')]==='undefined'&&typeof _0x10ebe5[_0xf5d2('0x1e')]==='undefined';var _0x4feb1e=_0x1925d0[_0xf5d2('0x1f')];var _0xcce1ad=_0x294af7?0x0:_0x10ebe5[_0xf5d2('0x1d')];var _0x1f1d54=_0x294af7?_0x1925d0[_0xf5d2('0x1f')]:_0x10ebe5[_0xf5d2('0x1d')]+_0x10ebe5[_0xf5d2('0x1e')];var _0x20623c;if(_0x1f1d54>=_0x4feb1e){_0x1f1d54=_0x4feb1e;_0x20623c=0xc8;}else{_0x20623c=0xce;}_0x19ff31[_0xf5d2('0x1a')](_0x20623c);return _0x19ff31['set'](_0xf5d2('0x20'),_0xcce1ad+'-'+_0x1f1d54+'/'+_0x4feb1e)[_0xf5d2('0x1c')](_0x1925d0);}return null;};}function patchUpdates(_0x2b46ef){return function(_0x451743){try{jsonpatch[_0xf5d2('0x21')](_0x451743,_0x2b46ef,!![]);}catch(_0x2c5a3e){return BPromise['reject'](_0x2c5a3e);}return _0x451743[_0xf5d2('0x22')]();};}function saveUpdates(_0x1805e7,_0x446b27){return function(_0x43e3d4){if(_0x43e3d4){return _0x43e3d4['update'](_0x1805e7)[_0xf5d2('0x23')](function(_0x380234){return _0x380234;});}return null;};}function removeEntity(_0x1acdd1,_0x23dd3d){return function(_0xcbe249){if(_0xcbe249){return _0xcbe249[_0xf5d2('0x24')]()['then'](function(){_0x1acdd1[_0xf5d2('0x1a')](0xcc)[_0xf5d2('0x1b')]();});}};}function handleEntityNotFound(_0x285c31,_0x14c57a){return function(_0x5b07d0){if(!_0x5b07d0){_0x285c31[_0xf5d2('0x19')](0x194);}return _0x5b07d0;};}function handleError(_0x2e35e7,_0x2733eb){_0x2733eb=_0x2733eb||0x1f4;return function(_0x5f04ef){logger[_0xf5d2('0x25')](_0x5f04ef['stack']);if(_0x5f04ef[_0xf5d2('0x26')]){delete _0x5f04ef[_0xf5d2('0x26')];}_0x2e35e7[_0xf5d2('0x1a')](_0x2733eb)['send'](_0x5f04ef);};}exports[_0xf5d2('0x27')]=function(_0x5a4ce6,_0x4db99c){var _0x217a7e={},_0x581a79={},_0x4c9bb0={'count':0x0,'rows':[]};var _0x56f99c=_[_0xf5d2('0x28')](db[_0xf5d2('0x29')][_0xf5d2('0x2a')],function(_0x29727b){return{'name':_0x29727b[_0xf5d2('0x2b')],'type':_0x29727b[_0xf5d2('0x2c')][_0xf5d2('0x2d')]};});_0x581a79[_0xf5d2('0x2e')]=_['map'](_0x56f99c,'name');_0x581a79[_0xf5d2('0x2f')]=_[_0xf5d2('0x30')](_0x5a4ce6[_0xf5d2('0x2f')]);_0x581a79[_0xf5d2('0x31')]=_[_0xf5d2('0x32')](_0x581a79['model'],_0x581a79[_0xf5d2('0x2f')]);_0x217a7e[_0xf5d2('0x33')]=_['intersection'](_0x581a79[_0xf5d2('0x2e')],qs['fields'](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x34')]));_0x217a7e[_0xf5d2('0x33')]=_0x217a7e[_0xf5d2('0x33')][_0xf5d2('0x35')]?_0x217a7e[_0xf5d2('0x33')]:_0x581a79['model'];if(!_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x36')]('nolimit')){_0x217a7e[_0xf5d2('0x1e')]=qs[_0xf5d2('0x1e')](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x1e')]);_0x217a7e[_0xf5d2('0x1d')]=qs[_0xf5d2('0x1d')](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x1d')]);}_0x217a7e['order']=qs['sort'](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x37')]);_0x217a7e[_0xf5d2('0x38')]=qs[_0xf5d2('0x31')](_['pick'](_0x5a4ce6['query'],_0x581a79['filters']),_0x56f99c);if(_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x39')]){_0x217a7e[_0xf5d2('0x38')]=_[_0xf5d2('0x3a')](_0x217a7e['where'],{'$or':_[_0xf5d2('0x28')](_0x56f99c,function(_0x225e2b){if(_0x225e2b[_0xf5d2('0x2c')]!=='VIRTUAL'){var _0x21959b={};_0x21959b[_0x225e2b[_0xf5d2('0x26')]]={'$like':'%'+_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x39')]+'%'};return _0x21959b;}})});}_0x217a7e=_[_0xf5d2('0x3a')]({},_0x217a7e,_0x5a4ce6[_0xf5d2('0x3b')]);var _0x1c8d0e={'where':_0x217a7e['where']};return db['SquareMessage'][_0xf5d2('0x1f')](_0x1c8d0e)[_0xf5d2('0x23')](function(_0x23bfbf){_0x4c9bb0[_0xf5d2('0x1f')]=_0x23bfbf;if(_0x5a4ce6['query'][_0xf5d2('0x3c')]){_0x217a7e[_0xf5d2('0x3d')]=[{'all':!![]}];}return db[_0xf5d2('0x29')][_0xf5d2('0x3e')](_0x217a7e);})['then'](function(_0x23dc08){_0x4c9bb0['rows']=_0x23dc08;return _0x4c9bb0;})[_0xf5d2('0x23')](respondWithFilteredResult(_0x4db99c,_0x217a7e))[_0xf5d2('0x3f')](handleError(_0x4db99c,null));};exports['show']=function(_0x5b8645,_0x1b2faa){var _0x115957={'raw':!![],'where':{'id':_0x5b8645[_0xf5d2('0x40')]['id']}},_0x1d2914={};_0x1d2914[_0xf5d2('0x2e')]=_['keys'](db[_0xf5d2('0x29')][_0xf5d2('0x2a')]);_0x1d2914['query']=_[_0xf5d2('0x30')](_0x5b8645[_0xf5d2('0x2f')]);_0x1d2914[_0xf5d2('0x31')]=_[_0xf5d2('0x32')](_0x1d2914[_0xf5d2('0x2e')],_0x1d2914[_0xf5d2('0x2f')]);_0x115957[_0xf5d2('0x33')]=_[_0xf5d2('0x32')](_0x1d2914['model'],qs[_0xf5d2('0x34')](_0x5b8645[_0xf5d2('0x2f')][_0xf5d2('0x34')]));_0x115957[_0xf5d2('0x33')]=_0x115957[_0xf5d2('0x33')][_0xf5d2('0x35')]?_0x115957[_0xf5d2('0x33')]:_0x1d2914[_0xf5d2('0x2e')];if(_0x5b8645['query'][_0xf5d2('0x3c')]){_0x115957[_0xf5d2('0x3d')]=[{'all':!![]}];}_0x115957=_['merge']({},_0x115957,_0x5b8645[_0xf5d2('0x3b')]);return db[_0xf5d2('0x29')][_0xf5d2('0x41')](_0x115957)[_0xf5d2('0x23')](handleEntityNotFound(_0x1b2faa,null))[_0xf5d2('0x23')](respondWithResult(_0x1b2faa,null))[_0xf5d2('0x3f')](handleError(_0x1b2faa,null));};exports[_0xf5d2('0x42')]=function(_0x23a0bc,_0x5e4115){return db[_0xf5d2('0x29')][_0xf5d2('0x42')](_0x23a0bc[_0xf5d2('0x43')],{})[_0xf5d2('0x23')](respondWithResult(_0x5e4115,0xc9))[_0xf5d2('0x3f')](handleError(_0x5e4115,null));};exports['update']=function(_0x4b2b6e,_0x37b3e0){if(_0x4b2b6e['body']['id']){delete _0x4b2b6e[_0xf5d2('0x43')]['id'];}return db[_0xf5d2('0x29')][_0xf5d2('0x41')]({'where':{'id':_0x4b2b6e['params']['id']}})[_0xf5d2('0x23')](handleEntityNotFound(_0x37b3e0,null))[_0xf5d2('0x23')](saveUpdates(_0x4b2b6e[_0xf5d2('0x43')],null))[_0xf5d2('0x23')](respondWithResult(_0x37b3e0,null))[_0xf5d2('0x3f')](handleError(_0x37b3e0,null));};exports['destroy']=function(_0x831fcd,_0x1a14db){return db[_0xf5d2('0x29')][_0xf5d2('0x41')]({'where':{'id':_0x831fcd['params']['id']}})[_0xf5d2('0x23')](handleEntityNotFound(_0x1a14db,null))[_0xf5d2('0x23')](removeEntity(_0x1a14db,null))[_0xf5d2('0x3f')](handleError(_0x1a14db,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index f7923ec..50baba6 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 _0xf04e=['square_messages','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage'];(function(_0xd2266d,_0x23c4ae){var _0x5628f4=function(_0x18ba9b){while(--_0x18ba9b){_0xd2266d['push'](_0xd2266d['shift']());}};_0x5628f4(++_0x23c4ae);}(_0xf04e,0x1c8));var _0xef04=function(_0x3fd9d6,_0x128792){_0x3fd9d6=_0x3fd9d6-0x0;var _0x27478a=_0xf04e[_0x3fd9d6];return _0x27478a;};'use strict';var _=require('lodash');var util=require(_0xef04('0x0'));var logger=require(_0xef04('0x1'))(_0xef04('0x2'));var moment=require(_0xef04('0x3'));var BPromise=require(_0xef04('0x4'));var rp=require(_0xef04('0x5'));var fs=require('fs');var path=require(_0xef04('0x6'));var rimraf=require(_0xef04('0x7'));var config=require(_0xef04('0x8'));var attributes=require(_0xef04('0x9'));module[_0xef04('0xa')]=function(_0x53d29d,_0x581b0f){return _0x53d29d['define'](_0xef04('0xb'),attributes,{'tableName':_0xef04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ddf=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x46c93c,_0x1d48e5){var _0x36ee26=function(_0x363750){while(--_0x363750){_0x46c93c['push'](_0x46c93c['shift']());}};_0x36ee26(++_0x1d48e5);}(_0x1ddf,0x186));var _0xf1dd=function(_0xf2726b,_0x87deb7){_0xf2726b=_0xf2726b-0x0;var _0xa61a5=_0x1ddf[_0xf2726b];return _0xa61a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf1dd('0x0'))(_0xf1dd('0x1'));var moment=require(_0xf1dd('0x2'));var BPromise=require(_0xf1dd('0x3'));var rp=require(_0xf1dd('0x4'));var fs=require('fs');var path=require(_0xf1dd('0x5'));var rimraf=require(_0xf1dd('0x6'));var config=require(_0xf1dd('0x7'));var attributes=require(_0xf1dd('0x8'));module[_0xf1dd('0x9')]=function(_0x12e5e9,_0x2d1fbc){return _0x12e5e9[_0xf1dd('0xa')]('SquareMessage',attributes,{'tableName':_0xf1dd('0xb'),'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 9a62a4f..caa56cd 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 _0x14f6=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','body','options','raw','lodash'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x14f6,0xe9));var _0x614f=function(_0x57ab62,_0x30fd72){_0x57ab62=_0x57ab62-0x0;var _0x3083f0=_0x14f6[_0x57ab62];return _0x3083f0;};'use strict';var _=require(_0x614f('0x0'));var util=require(_0x614f('0x1'));var moment=require('moment');var BPromise=require(_0x614f('0x2'));var rs=require(_0x614f('0x3'));var fs=require('fs');var Redis=require(_0x614f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x614f('0x5'));var logger=require('../../config/logger')(_0x614f('0x6'));var config=require(_0x614f('0x7'));var jayson=require(_0x614f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2085db,_0x954c5a,_0x5970fa){return new BPromise(function(_0x1b692e,_0x457ed3){return client[_0x614f('0x9')](_0x2085db,_0x5970fa)[_0x614f('0xa')](function(_0x4c5b37){logger[_0x614f('0xb')](_0x614f('0xc'),_0x954c5a,_0x614f('0xd'));logger[_0x614f('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x954c5a,_0x614f('0xd'),JSON[_0x614f('0xf')](_0x4c5b37));if(_0x4c5b37[_0x614f('0x10')]){if(_0x4c5b37[_0x614f('0x10')][_0x614f('0x11')]===0x1f4){logger[_0x614f('0x10')](_0x614f('0xc'),_0x954c5a,_0x4c5b37[_0x614f('0x10')]['message']);return _0x457ed3(_0x4c5b37[_0x614f('0x10')][_0x614f('0x12')]);}logger['error'](_0x614f('0xc'),_0x954c5a,_0x4c5b37[_0x614f('0x10')][_0x614f('0x12')]);return _0x1b692e(_0x4c5b37['error'][_0x614f('0x12')]);}else{logger['info'](_0x614f('0xc'),_0x954c5a,'request\x20sent');_0x1b692e(_0x4c5b37[_0x614f('0x13')][_0x614f('0x12')]);}})[_0x614f('0x14')](function(_0x2eca19){logger['error'](_0x614f('0xc'),_0x954c5a,_0x2eca19);_0x457ed3(_0x2eca19);});});}exports[_0x614f('0x15')]=function(_0x4f7972){var _0x3d7051=this;return new Promise(function(_0x108802,_0x5640b5){return db[_0x614f('0x16')]['create'](_0x4f7972[_0x614f('0x17')],{'raw':_0x4f7972[_0x614f('0x18')]?_0x4f7972['options'][_0x614f('0x19')]===undefined?!![]:![]:!![]})[_0x614f('0xa')](function(_0x3cf7ee){logger['info'](_0x614f('0x15'),_0x4f7972);logger['debug'](_0x614f('0x15'),_0x4f7972,JSON[_0x614f('0xf')](_0x3cf7ee));_0x108802(_0x3cf7ee);})[_0x614f('0x14')](function(_0x1b80d6){logger[_0x614f('0x10')](_0x614f('0x15'),_0x1b80d6['message'],_0x4f7972);_0x5640b5(_0x3d7051['error'](0x1f4,_0x1b80d6[_0x614f('0x12')]));});});}; \ No newline at end of file +var _0xe2ef=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util'];(function(_0x49ac49,_0x59b723){var _0x58563b=function(_0xed6349){while(--_0xed6349){_0x49ac49['push'](_0x49ac49['shift']());}};_0x58563b(++_0x59b723);}(_0xe2ef,0xa6));var _0xfe2e=function(_0xd044d8,_0x4c5a2e){_0xd044d8=_0xd044d8-0x0;var _0x511785=_0xe2ef[_0xd044d8];return _0x511785;};'use strict';var _=require(_0xfe2e('0x0'));var util=require(_0xfe2e('0x1'));var moment=require(_0xfe2e('0x2'));var BPromise=require(_0xfe2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2e('0x4'));var db=require(_0xfe2e('0x5'))['db'];var utils=require(_0xfe2e('0x6'));var logger=require('../../config/logger')(_0xfe2e('0x7'));var config=require('../../config/environment');var jayson=require(_0xfe2e('0x8'));var client=jayson['client'][_0xfe2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x271e37,_0x4104e2,_0x17ba37){return new BPromise(function(_0x115c59,_0xf6ec81){return client[_0xfe2e('0xa')](_0x271e37,_0x17ba37)['then'](function(_0x571753){logger[_0xfe2e('0xb')](_0xfe2e('0xc'),_0x4104e2,_0xfe2e('0xd'));logger[_0xfe2e('0xe')](_0xfe2e('0xf'),_0x4104e2,'request\x20sent',JSON[_0xfe2e('0x10')](_0x571753));if(_0x571753[_0xfe2e('0x11')]){if(_0x571753[_0xfe2e('0x11')][_0xfe2e('0x12')]===0x1f4){logger[_0xfe2e('0x11')](_0xfe2e('0xc'),_0x4104e2,_0x571753['error'][_0xfe2e('0x13')]);return _0xf6ec81(_0x571753['error'][_0xfe2e('0x13')]);}logger['error'](_0xfe2e('0xc'),_0x4104e2,_0x571753[_0xfe2e('0x11')][_0xfe2e('0x13')]);return _0x115c59(_0x571753[_0xfe2e('0x11')][_0xfe2e('0x13')]);}else{logger[_0xfe2e('0xb')](_0xfe2e('0xc'),_0x4104e2,_0xfe2e('0xd'));_0x115c59(_0x571753[_0xfe2e('0x14')][_0xfe2e('0x13')]);}})[_0xfe2e('0x15')](function(_0x17f84f){logger[_0xfe2e('0x11')](_0xfe2e('0xc'),_0x4104e2,_0x17f84f);_0xf6ec81(_0x17f84f);});});}exports[_0xfe2e('0x16')]=function(_0x330f54){var _0x120988=this;return new Promise(function(_0x403faf,_0x384ea0){return db[_0xfe2e('0x17')][_0xfe2e('0x18')](_0x330f54[_0xfe2e('0x19')],{'raw':_0x330f54[_0xfe2e('0x1a')]?_0x330f54[_0xfe2e('0x1a')][_0xfe2e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x120155){logger[_0xfe2e('0xb')](_0xfe2e('0x16'),_0x330f54);logger['debug']('CreateSquareMessage',_0x330f54,JSON[_0xfe2e('0x10')](_0x120155));_0x403faf(_0x120155);})['catch'](function(_0x39f8cd){logger['error'](_0xfe2e('0x16'),_0x39f8cd[_0xfe2e('0x13')],_0x330f54);_0x384ea0(_0x120988[_0xfe2e('0x11')](0x1f4,_0x39f8cd['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1bc68b3..c13cd34 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 _0x6c67=['test','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test'];(function(_0x1587d1,_0x4ac855){var _0x376394=function(_0x513269){while(--_0x513269){_0x1587d1['push'](_0x1587d1['shift']());}};_0x376394(++_0x4ac855);}(_0x6c67,0x132));var _0x76c6=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x6c67[_0x39c734];return _0xb2a2f9;};'use strict';var multer=require(_0x76c6('0x0'));var util=require(_0x76c6('0x1'));var path=require(_0x76c6('0x2'));var timeout=require(_0x76c6('0x3'));var express=require(_0x76c6('0x4'));var router=express[_0x76c6('0x5')]();var fs_extra=require(_0x76c6('0x6'));var auth=require(_0x76c6('0x7'));var interaction=require(_0x76c6('0x8'));var config=require(_0x76c6('0x9'));var controller=require(_0x76c6('0xa'));router[_0x76c6('0xb')]('/',auth[_0x76c6('0xc')](),controller[_0x76c6('0xd')]);router[_0x76c6('0xb')]('/:id',auth[_0x76c6('0xc')](),controller[_0x76c6('0xe')]);router[_0x76c6('0xb')](_0x76c6('0xf'),auth[_0x76c6('0xc')](),timeout('15s'),controller[_0x76c6('0x10')]);router['post']('/',auth[_0x76c6('0xc')](),controller[_0x76c6('0x11')]);router[_0x76c6('0x12')](_0x76c6('0x13'),auth[_0x76c6('0xc')](),controller['update']);router[_0x76c6('0x14')](_0x76c6('0x13'),auth[_0x76c6('0xc')](),controller[_0x76c6('0x15')]);module[_0x76c6('0x16')]=router; \ No newline at end of file +var _0x894a=['create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','show','/:id/test','test','post'];(function(_0x3f4478,_0xdfbf81){var _0x80941b=function(_0x2356d6){while(--_0x2356d6){_0x3f4478['push'](_0x3f4478['shift']());}};_0x80941b(++_0xdfbf81);}(_0x894a,0xcd));var _0xa894=function(_0x1a27a3,_0x27eba1){_0x1a27a3=_0x1a27a3-0x0;var _0x3c10dc=_0x894a[_0x1a27a3];return _0x3c10dc;};'use strict';var multer=require(_0xa894('0x0'));var util=require(_0xa894('0x1'));var path=require(_0xa894('0x2'));var timeout=require(_0xa894('0x3'));var express=require(_0xa894('0x4'));var router=express[_0xa894('0x5')]();var fs_extra=require(_0xa894('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa894('0x7'));var config=require('../../config/environment');var controller=require(_0xa894('0x8'));router[_0xa894('0x9')]('/',auth[_0xa894('0xa')](),controller['index']);router[_0xa894('0x9')]('/:id',auth[_0xa894('0xa')](),controller[_0xa894('0xb')]);router[_0xa894('0x9')](_0xa894('0xc'),auth[_0xa894('0xa')](),timeout('15s'),controller[_0xa894('0xd')]);router[_0xa894('0xe')]('/',auth['isAuthenticated'](),controller[_0xa894('0xf')]);router[_0xa894('0x10')](_0xa894('0x11'),auth[_0xa894('0xa')](),controller['update']);router[_0xa894('0x12')]('/:id',auth[_0xa894('0xa')](),controller[_0xa894('0x13')]);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 152845d..cb1e7dd 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 _0x13f7=['STRING','name'];(function(_0x4ac65f,_0x259d53){var _0x5ab2af=function(_0x4177fc){while(--_0x4177fc){_0x4ac65f['push'](_0x4ac65f['shift']());}};_0x5ab2af(++_0x259d53);}(_0x13f7,0x8a));var _0x713f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f7[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x713f('0x0')],'unique':_0x713f('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x713f('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9861=['name','STRING','exports'];(function(_0x535d49,_0x5784a0){var _0x1153f8=function(_0x58ede0){while(--_0x58ede0){_0x535d49['push'](_0x535d49['shift']());}};_0x1153f8(++_0x5784a0);}(_0x9861,0x104));var _0x1986=function(_0x2d77d0,_0x375ca9){_0x2d77d0=_0x2d77d0-0x0;var _0x23ac57=_0x9861[_0x2d77d0];return _0x23ac57;};'use strict';var Sequelize=require('sequelize');module[_0x1986('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x1986('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1986('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 747c51d..541cfe2 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 _0x4a77=['fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','count','offset','set','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','end','sendStatus','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','test','dsn','odbc','openSync','eml-format'];(function(_0x24153c,_0x5c6f){var _0x4fd334=function(_0x15642a){while(--_0x15642a){_0x24153c['push'](_0x24153c['shift']());}};_0x4fd334(++_0x5c6f);}(_0x4a77,0xfe));var _0x74a7=function(_0x21d321,_0x52a2dc){_0x21d321=_0x21d321-0x0;var _0x1c784b=_0x4a77[_0x21d321];return _0x1c784b;};'use strict';var emlformat=require(_0x74a7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x74a7('0x1'));var rp=require(_0x74a7('0x2'));var moment=require(_0x74a7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74a7('0x4'));var util=require(_0x74a7('0x5'));var path=require(_0x74a7('0x6'));var sox=require(_0x74a7('0x7'));var csv=require('to-csv');var ejs=require(_0x74a7('0x8'));var fs=require('fs');var fs_extra=require(_0x74a7('0x9'));var _=require('lodash');var squel=require(_0x74a7('0xa'));var crypto=require(_0x74a7('0xb'));var jsforce=require(_0x74a7('0xc'));var deskjs=require(_0x74a7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x74a7('0xe'));var Redis=require(_0x74a7('0xf'));var authService=require(_0x74a7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74a7('0x11'));var logger=require(_0x74a7('0x12'))(_0x74a7('0x13'));var utils=require(_0x74a7('0x14'));var config=require(_0x74a7('0x15'));var licenseUtil=require(_0x74a7('0x16'));var db=require(_0x74a7('0x17'))['db'];function respondWithStatusCode(_0x3b8bbf,_0x2212f0){_0x2212f0=_0x2212f0||0xcc;return function(_0x3d6f81){if(_0x3d6f81){return _0x3b8bbf['sendStatus'](_0x2212f0);}return _0x3b8bbf[_0x74a7('0x18')](_0x2212f0)['end']();};}function respondWithResult(_0x25445f,_0x52dcc5){_0x52dcc5=_0x52dcc5||0xc8;return function(_0x260d22){if(_0x260d22){return _0x25445f[_0x74a7('0x18')](_0x52dcc5)[_0x74a7('0x19')](_0x260d22);}};}function respondWithFilteredResult(_0xc40664,_0x2aa0d7){return function(_0x2773db){if(_0x2773db){var _0x2ee54f=typeof _0x2aa0d7['offset']==='undefined'&&typeof _0x2aa0d7[_0x74a7('0x1a')]==='undefined';var _0x3dd880=_0x2773db[_0x74a7('0x1b')];var _0x2c1add=_0x2ee54f?0x0:_0x2aa0d7[_0x74a7('0x1c')];var _0x3718c0=_0x2ee54f?_0x2773db['count']:_0x2aa0d7[_0x74a7('0x1c')]+_0x2aa0d7[_0x74a7('0x1a')];var _0x52b2e6;if(_0x3718c0>=_0x3dd880){_0x3718c0=_0x3dd880;_0x52b2e6=0xc8;}else{_0x52b2e6=0xce;}_0xc40664[_0x74a7('0x18')](_0x52b2e6);return _0xc40664[_0x74a7('0x1d')]('Content-Range',_0x2c1add+'-'+_0x3718c0+'/'+_0x3dd880)[_0x74a7('0x19')](_0x2773db);}return null;};}function patchUpdates(_0x35ddd4){return function(_0x4f7e6b){try{jsonpatch[_0x74a7('0x1e')](_0x4f7e6b,_0x35ddd4,!![]);}catch(_0x1fd3b0){return BPromise[_0x74a7('0x1f')](_0x1fd3b0);}return _0x4f7e6b[_0x74a7('0x20')]();};}function saveUpdates(_0x33e674,_0x56a27e){return function(_0x1c7d43){if(_0x1c7d43){return _0x1c7d43[_0x74a7('0x21')](_0x33e674)[_0x74a7('0x22')](function(_0x7d9c3d){return _0x7d9c3d;});}return null;};}function removeEntity(_0x3c48d2,_0xee3922){return function(_0x20c66d){if(_0x20c66d){return _0x20c66d[_0x74a7('0x23')]()[_0x74a7('0x22')](function(){var _0x3c6ff2=_0x20c66d[_0x74a7('0x24')]({'plain':!![]});var _0x595874=_0x74a7('0x25');return db[_0x74a7('0x26')][_0x74a7('0x23')]({'where':{'type':_0x595874,'resourceId':_0x3c6ff2['id']}})[_0x74a7('0x22')](function(){return _0x20c66d;});})['then'](function(){_0x3c48d2[_0x74a7('0x18')](0xcc)[_0x74a7('0x27')]();});}};}function handleEntityNotFound(_0x240abb,_0x27cba9){return function(_0x1477f1){if(!_0x1477f1){_0x240abb[_0x74a7('0x28')](0x194);}return _0x1477f1;};}function handleError(_0x29e8ce,_0x1b5e37){_0x1b5e37=_0x1b5e37||0x1f4;return function(_0x2ebb8e){logger['error'](_0x2ebb8e[_0x74a7('0x29')]);if(_0x2ebb8e[_0x74a7('0x2a')]){delete _0x2ebb8e[_0x74a7('0x2a')];}_0x29e8ce[_0x74a7('0x18')](_0x1b5e37)[_0x74a7('0x2b')](_0x2ebb8e);};}exports['index']=function(_0x5642be,_0x29602f){var _0x15f0cd={},_0x35ec2d={},_0x43a15c={'count':0x0,'rows':[]};var _0xbf73b0=_[_0x74a7('0x2c')](db[_0x74a7('0x2d')][_0x74a7('0x2e')],function(_0x1a57f3){return{'name':_0x1a57f3[_0x74a7('0x2f')],'type':_0x1a57f3[_0x74a7('0x30')][_0x74a7('0x31')]};});_0x35ec2d['model']=_['map'](_0xbf73b0,_0x74a7('0x2a'));_0x35ec2d[_0x74a7('0x32')]=_['keys'](_0x5642be[_0x74a7('0x32')]);_0x35ec2d[_0x74a7('0x33')]=_[_0x74a7('0x34')](_0x35ec2d['model'],_0x35ec2d[_0x74a7('0x32')]);_0x15f0cd['attributes']=_[_0x74a7('0x34')](_0x35ec2d[_0x74a7('0x35')],qs[_0x74a7('0x36')](_0x5642be[_0x74a7('0x32')][_0x74a7('0x36')]));_0x15f0cd[_0x74a7('0x37')]=_0x15f0cd['attributes'][_0x74a7('0x38')]?_0x15f0cd[_0x74a7('0x37')]:_0x35ec2d['model'];if(!_0x5642be[_0x74a7('0x32')]['hasOwnProperty']('nolimit')){_0x15f0cd['limit']=qs[_0x74a7('0x1a')](_0x5642be[_0x74a7('0x32')][_0x74a7('0x1a')]);_0x15f0cd[_0x74a7('0x1c')]=qs[_0x74a7('0x1c')](_0x5642be[_0x74a7('0x32')][_0x74a7('0x1c')]);}_0x15f0cd['order']=qs['sort'](_0x5642be[_0x74a7('0x32')][_0x74a7('0x39')]);_0x15f0cd[_0x74a7('0x3a')]=qs[_0x74a7('0x33')](_[_0x74a7('0x3b')](_0x5642be[_0x74a7('0x32')],_0x35ec2d['filters']),_0xbf73b0);if(_0x5642be['query'][_0x74a7('0x3c')]){_0x15f0cd[_0x74a7('0x3a')]=_['merge'](_0x15f0cd[_0x74a7('0x3a')],{'$or':_[_0x74a7('0x2c')](_0xbf73b0,function(_0x529dc2){if(_0x529dc2['type']!==_0x74a7('0x3d')){var _0x18b10b={};_0x18b10b[_0x529dc2[_0x74a7('0x2a')]]={'$like':'%'+_0x5642be[_0x74a7('0x32')][_0x74a7('0x3c')]+'%'};return _0x18b10b;}})});}_0x15f0cd=_['merge']({},_0x15f0cd,_0x5642be[_0x74a7('0x3e')]);var _0x57aba8={'where':_0x15f0cd[_0x74a7('0x3a')]};return db[_0x74a7('0x2d')][_0x74a7('0x1b')](_0x57aba8)['then'](function(_0x126c9c){_0x43a15c[_0x74a7('0x1b')]=_0x126c9c;if(_0x5642be['query'][_0x74a7('0x3f')]){_0x15f0cd[_0x74a7('0x40')]=[{'all':!![]}];}return db[_0x74a7('0x2d')][_0x74a7('0x41')](_0x15f0cd);})['then'](function(_0x15cacc){_0x43a15c[_0x74a7('0x42')]=_0x15cacc;return _0x43a15c;})[_0x74a7('0x22')](respondWithFilteredResult(_0x29602f,_0x15f0cd))[_0x74a7('0x43')](handleError(_0x29602f,null));};exports['show']=function(_0x35fbdd,_0x1f0177){var _0x23cd28={'raw':!![],'where':{'id':_0x35fbdd[_0x74a7('0x44')]['id']}},_0x57bb21={};_0x57bb21[_0x74a7('0x35')]=_['keys'](db[_0x74a7('0x2d')][_0x74a7('0x2e')]);_0x57bb21['query']=_[_0x74a7('0x45')](_0x35fbdd[_0x74a7('0x32')]);_0x57bb21[_0x74a7('0x33')]=_[_0x74a7('0x34')](_0x57bb21[_0x74a7('0x35')],_0x57bb21[_0x74a7('0x32')]);_0x23cd28[_0x74a7('0x37')]=_['intersection'](_0x57bb21[_0x74a7('0x35')],qs[_0x74a7('0x36')](_0x35fbdd[_0x74a7('0x32')][_0x74a7('0x36')]));_0x23cd28[_0x74a7('0x37')]=_0x23cd28[_0x74a7('0x37')][_0x74a7('0x38')]?_0x23cd28[_0x74a7('0x37')]:_0x57bb21[_0x74a7('0x35')];if(_0x35fbdd[_0x74a7('0x32')][_0x74a7('0x3f')]){_0x23cd28[_0x74a7('0x40')]=[{'all':!![]}];}_0x23cd28=_[_0x74a7('0x46')]({},_0x23cd28,_0x35fbdd['options']);return db[_0x74a7('0x2d')][_0x74a7('0x47')](_0x23cd28)[_0x74a7('0x22')](handleEntityNotFound(_0x1f0177,null))['then'](respondWithResult(_0x1f0177,null))[_0x74a7('0x43')](handleError(_0x1f0177,null));};exports['create']=function(_0x121ff0,_0x2ad8ec){return db['SquareOdbc'][_0x74a7('0x48')](_0x121ff0[_0x74a7('0x49')],{})[_0x74a7('0x22')](function(_0x136726){var _0x597a7b=_0x121ff0['user'][_0x74a7('0x24')]({'plain':!![]});if(!_0x597a7b)throw new Error(_0x74a7('0x4a'));if(_0x597a7b[_0x74a7('0x4b')]===_0x74a7('0x4c')){var _0x48ed99=_0x136726[_0x74a7('0x24')]({'plain':!![]});var _0x155d0a=_0x74a7('0x25');return db[_0x74a7('0x4d')][_0x74a7('0x47')]({'where':{'name':_0x155d0a,'userProfileId':_0x597a7b[_0x74a7('0x4e')]},'raw':!![]})[_0x74a7('0x22')](function(_0x3b97d1){if(_0x3b97d1&&_0x3b97d1[_0x74a7('0x4f')]===0x0){return db[_0x74a7('0x26')][_0x74a7('0x48')]({'name':_0x48ed99[_0x74a7('0x2a')],'resourceId':_0x48ed99['id'],'type':_0x3b97d1[_0x74a7('0x2a')],'sectionId':_0x3b97d1['id']},{})[_0x74a7('0x22')](function(){return _0x136726;});}else{return _0x136726;}})['catch'](function(_0x361917){logger[_0x74a7('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x361917);throw _0x361917;});}return _0x136726;})[_0x74a7('0x22')](respondWithResult(_0x2ad8ec,0xc9))[_0x74a7('0x43')](handleError(_0x2ad8ec,null));};exports[_0x74a7('0x21')]=function(_0x438588,_0x39ba73){if(_0x438588['body']['id']){delete _0x438588[_0x74a7('0x49')]['id'];}return db[_0x74a7('0x2d')]['find']({'where':{'id':_0x438588[_0x74a7('0x44')]['id']}})['then'](handleEntityNotFound(_0x39ba73,null))['then'](saveUpdates(_0x438588[_0x74a7('0x49')],null))[_0x74a7('0x22')](respondWithResult(_0x39ba73,null))[_0x74a7('0x43')](handleError(_0x39ba73,null));};exports['destroy']=function(_0x1e2562,_0x4405b3){return db['SquareOdbc'][_0x74a7('0x47')]({'where':{'id':_0x1e2562[_0x74a7('0x44')]['id']}})[_0x74a7('0x22')](handleEntityNotFound(_0x4405b3,null))[_0x74a7('0x22')](removeEntity(_0x4405b3,null))['catch'](handleError(_0x4405b3,null));};exports[_0x74a7('0x51')]=function(_0x482957,_0x1ffad4,_0x2afc0d){var _0x2284a4;return db[_0x74a7('0x2d')][_0x74a7('0x47')]({'where':{'id':_0x482957[_0x74a7('0x44')]['id']},'attributes':['id',_0x74a7('0x52')]})['then'](handleEntityNotFound(_0x1ffad4,null))[_0x74a7('0x22')](function(_0x5df086){if(_0x5df086){var _0x22f12d=require(_0x74a7('0x53'))();_0x22f12d[_0x74a7('0x54')](_0x5df086[_0x74a7('0x52')]);_0x22f12d['closeSync']();return _0x5df086;}})[_0x74a7('0x22')](respondWithResult(_0x1ffad4,null))[_0x74a7('0x43')](handleError(_0x1ffad4,null));}; \ No newline at end of file +var _0x37c9=['includeAll','include','rows','catch','params','keys','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','dsn','openSync','closeSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ODBC','error','name','map','SquareOdbc','rawAttributes','fieldName','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options'];(function(_0x2b75d9,_0x4e7c6e){var _0x5a2ac1=function(_0x8cc2ca){while(--_0x8cc2ca){_0x2b75d9['push'](_0x2b75d9['shift']());}};_0x5a2ac1(++_0x4e7c6e);}(_0x37c9,0xb4));var _0x937c=function(_0x23da97,_0x37718a){_0x23da97=_0x23da97-0x0;var _0x4c9aff=_0x37c9[_0x23da97];return _0x4c9aff;};'use strict';var emlformat=require(_0x937c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x937c('0x1'));var jsonpatch=require(_0x937c('0x2'));var rp=require('request-promise');var moment=require(_0x937c('0x3'));var BPromise=require(_0x937c('0x4'));var Mustache=require('mustache');var util=require(_0x937c('0x5'));var path=require(_0x937c('0x6'));var sox=require(_0x937c('0x7'));var csv=require(_0x937c('0x8'));var ejs=require(_0x937c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x937c('0xa'));var squel=require(_0x937c('0xb'));var crypto=require(_0x937c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x937c('0xd'));var toCsv=require(_0x937c('0x8'));var querystring=require(_0x937c('0xe'));var Papa=require(_0x937c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x937c('0x10'));var hardwareService=require(_0x937c('0x11'));var logger=require(_0x937c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x937c('0x13'));var licenseUtil=require(_0x937c('0x14'));var db=require(_0x937c('0x15'))['db'];function respondWithStatusCode(_0x478b2e,_0x305a7f){_0x305a7f=_0x305a7f||0xcc;return function(_0x2850bb){if(_0x2850bb){return _0x478b2e[_0x937c('0x16')](_0x305a7f);}return _0x478b2e[_0x937c('0x17')](_0x305a7f)['end']();};}function respondWithResult(_0x188f1c,_0x2b58f4){_0x2b58f4=_0x2b58f4||0xc8;return function(_0x3bb6d7){if(_0x3bb6d7){return _0x188f1c[_0x937c('0x17')](_0x2b58f4)[_0x937c('0x18')](_0x3bb6d7);}};}function respondWithFilteredResult(_0x391736,_0x2a6011){return function(_0x3c4238){if(_0x3c4238){var _0x3bcb84=typeof _0x2a6011[_0x937c('0x19')]===_0x937c('0x1a')&&typeof _0x2a6011[_0x937c('0x1b')]===_0x937c('0x1a');var _0x52822a=_0x3c4238[_0x937c('0x1c')];var _0x3c94c7=_0x3bcb84?0x0:_0x2a6011[_0x937c('0x19')];var _0x5e560f=_0x3bcb84?_0x3c4238[_0x937c('0x1c')]:_0x2a6011[_0x937c('0x19')]+_0x2a6011['limit'];var _0x3c10dc;if(_0x5e560f>=_0x52822a){_0x5e560f=_0x52822a;_0x3c10dc=0xc8;}else{_0x3c10dc=0xce;}_0x391736[_0x937c('0x17')](_0x3c10dc);return _0x391736[_0x937c('0x1d')](_0x937c('0x1e'),_0x3c94c7+'-'+_0x5e560f+'/'+_0x52822a)[_0x937c('0x18')](_0x3c4238);}return null;};}function patchUpdates(_0x43c324){return function(_0x5e0873){try{jsonpatch[_0x937c('0x1f')](_0x5e0873,_0x43c324,!![]);}catch(_0x19c10e){return BPromise[_0x937c('0x20')](_0x19c10e);}return _0x5e0873[_0x937c('0x21')]();};}function saveUpdates(_0x217525,_0x3fb940){return function(_0x130492){if(_0x130492){return _0x130492[_0x937c('0x22')](_0x217525)[_0x937c('0x23')](function(_0x33bd26){return _0x33bd26;});}return null;};}function removeEntity(_0x621766,_0x204729){return function(_0x254578){if(_0x254578){return _0x254578[_0x937c('0x24')]()[_0x937c('0x23')](function(){var _0x3a954d=_0x254578['get']({'plain':!![]});var _0x4a0e46=_0x937c('0x25');return db['UserProfileResource'][_0x937c('0x24')]({'where':{'type':_0x4a0e46,'resourceId':_0x3a954d['id']}})['then'](function(){return _0x254578;});})[_0x937c('0x23')](function(){_0x621766[_0x937c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x559896,_0x1e8c63){return function(_0x2335a0){if(!_0x2335a0){_0x559896[_0x937c('0x16')](0x194);}return _0x2335a0;};}function handleError(_0x16f0c3,_0xf1c3bb){_0xf1c3bb=_0xf1c3bb||0x1f4;return function(_0x53994b){logger[_0x937c('0x26')](_0x53994b['stack']);if(_0x53994b[_0x937c('0x27')]){delete _0x53994b[_0x937c('0x27')];}_0x16f0c3[_0x937c('0x17')](_0xf1c3bb)['send'](_0x53994b);};}exports['index']=function(_0x496f88,_0xabafcf){var _0x3ed729={},_0x51ece0={},_0x5efeea={'count':0x0,'rows':[]};var _0x4754cd=_[_0x937c('0x28')](db[_0x937c('0x29')][_0x937c('0x2a')],function(_0xed1a3f){return{'name':_0xed1a3f[_0x937c('0x2b')],'type':_0xed1a3f['type']['key']};});_0x51ece0[_0x937c('0x2c')]=_[_0x937c('0x28')](_0x4754cd,_0x937c('0x27'));_0x51ece0[_0x937c('0x2d')]=_['keys'](_0x496f88[_0x937c('0x2d')]);_0x51ece0[_0x937c('0x2e')]=_['intersection'](_0x51ece0[_0x937c('0x2c')],_0x51ece0['query']);_0x3ed729[_0x937c('0x2f')]=_[_0x937c('0x30')](_0x51ece0[_0x937c('0x2c')],qs['fields'](_0x496f88['query']['fields']));_0x3ed729[_0x937c('0x2f')]=_0x3ed729[_0x937c('0x2f')][_0x937c('0x31')]?_0x3ed729[_0x937c('0x2f')]:_0x51ece0[_0x937c('0x2c')];if(!_0x496f88[_0x937c('0x2d')][_0x937c('0x32')](_0x937c('0x33'))){_0x3ed729[_0x937c('0x1b')]=qs[_0x937c('0x1b')](_0x496f88['query']['limit']);_0x3ed729[_0x937c('0x19')]=qs[_0x937c('0x19')](_0x496f88[_0x937c('0x2d')][_0x937c('0x19')]);}_0x3ed729[_0x937c('0x34')]=qs[_0x937c('0x35')](_0x496f88[_0x937c('0x2d')]['sort']);_0x3ed729['where']=qs[_0x937c('0x2e')](_[_0x937c('0x36')](_0x496f88[_0x937c('0x2d')],_0x51ece0['filters']),_0x4754cd);if(_0x496f88[_0x937c('0x2d')]['filter']){_0x3ed729[_0x937c('0x37')]=_[_0x937c('0x38')](_0x3ed729[_0x937c('0x37')],{'$or':_['map'](_0x4754cd,function(_0x364511){if(_0x364511['type']!==_0x937c('0x39')){var _0x2b31af={};_0x2b31af[_0x364511[_0x937c('0x27')]]={'$like':'%'+_0x496f88['query'][_0x937c('0x3a')]+'%'};return _0x2b31af;}})});}_0x3ed729=_['merge']({},_0x3ed729,_0x496f88[_0x937c('0x3b')]);var _0x2c028a={'where':_0x3ed729[_0x937c('0x37')]};return db[_0x937c('0x29')][_0x937c('0x1c')](_0x2c028a)['then'](function(_0x4726fe){_0x5efeea['count']=_0x4726fe;if(_0x496f88[_0x937c('0x2d')][_0x937c('0x3c')]){_0x3ed729[_0x937c('0x3d')]=[{'all':!![]}];}return db[_0x937c('0x29')]['findAll'](_0x3ed729);})[_0x937c('0x23')](function(_0x36917e){_0x5efeea[_0x937c('0x3e')]=_0x36917e;return _0x5efeea;})[_0x937c('0x23')](respondWithFilteredResult(_0xabafcf,_0x3ed729))[_0x937c('0x3f')](handleError(_0xabafcf,null));};exports['show']=function(_0xa31c18,_0x3fe924){var _0x2b7b05={'raw':!![],'where':{'id':_0xa31c18[_0x937c('0x40')]['id']}},_0x2404c1={};_0x2404c1['model']=_['keys'](db[_0x937c('0x29')][_0x937c('0x2a')]);_0x2404c1[_0x937c('0x2d')]=_[_0x937c('0x41')](_0xa31c18[_0x937c('0x2d')]);_0x2404c1[_0x937c('0x2e')]=_[_0x937c('0x30')](_0x2404c1[_0x937c('0x2c')],_0x2404c1[_0x937c('0x2d')]);_0x2b7b05[_0x937c('0x2f')]=_[_0x937c('0x30')](_0x2404c1['model'],qs[_0x937c('0x42')](_0xa31c18['query']['fields']));_0x2b7b05[_0x937c('0x2f')]=_0x2b7b05[_0x937c('0x2f')][_0x937c('0x31')]?_0x2b7b05[_0x937c('0x2f')]:_0x2404c1['model'];if(_0xa31c18[_0x937c('0x2d')][_0x937c('0x3c')]){_0x2b7b05[_0x937c('0x3d')]=[{'all':!![]}];}_0x2b7b05=_[_0x937c('0x38')]({},_0x2b7b05,_0xa31c18[_0x937c('0x3b')]);return db[_0x937c('0x29')][_0x937c('0x43')](_0x2b7b05)[_0x937c('0x23')](handleEntityNotFound(_0x3fe924,null))['then'](respondWithResult(_0x3fe924,null))[_0x937c('0x3f')](handleError(_0x3fe924,null));};exports[_0x937c('0x44')]=function(_0x58def4,_0x449a8e){return db[_0x937c('0x29')][_0x937c('0x44')](_0x58def4[_0x937c('0x45')],{})[_0x937c('0x23')](function(_0x3c2a2b){var _0x49bb18=_0x58def4[_0x937c('0x46')][_0x937c('0x47')]({'plain':!![]});if(!_0x49bb18)throw new Error(_0x937c('0x48'));if(_0x49bb18['role']===_0x937c('0x46')){var _0x56ccc1=_0x3c2a2b[_0x937c('0x47')]({'plain':!![]});var _0x3de3e2=_0x937c('0x25');return db[_0x937c('0x49')][_0x937c('0x43')]({'where':{'name':_0x3de3e2,'userProfileId':_0x49bb18[_0x937c('0x4a')]},'raw':!![]})[_0x937c('0x23')](function(_0x36031f){if(_0x36031f&&_0x36031f[_0x937c('0x4b')]===0x0){return db[_0x937c('0x4c')][_0x937c('0x44')]({'name':_0x56ccc1['name'],'resourceId':_0x56ccc1['id'],'type':_0x36031f[_0x937c('0x27')],'sectionId':_0x36031f['id']},{})[_0x937c('0x23')](function(){return _0x3c2a2b;});}else{return _0x3c2a2b;}})[_0x937c('0x3f')](function(_0x1e68d5){logger[_0x937c('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e68d5);throw _0x1e68d5;});}return _0x3c2a2b;})[_0x937c('0x23')](respondWithResult(_0x449a8e,0xc9))[_0x937c('0x3f')](handleError(_0x449a8e,null));};exports[_0x937c('0x22')]=function(_0x47ae6a,_0x389248){if(_0x47ae6a['body']['id']){delete _0x47ae6a[_0x937c('0x45')]['id'];}return db[_0x937c('0x29')]['find']({'where':{'id':_0x47ae6a[_0x937c('0x40')]['id']}})[_0x937c('0x23')](handleEntityNotFound(_0x389248,null))[_0x937c('0x23')](saveUpdates(_0x47ae6a['body'],null))[_0x937c('0x23')](respondWithResult(_0x389248,null))[_0x937c('0x3f')](handleError(_0x389248,null));};exports['destroy']=function(_0x1311e2,_0x59547e){return db[_0x937c('0x29')][_0x937c('0x43')]({'where':{'id':_0x1311e2['params']['id']}})[_0x937c('0x23')](handleEntityNotFound(_0x59547e,null))[_0x937c('0x23')](removeEntity(_0x59547e,null))['catch'](handleError(_0x59547e,null));};exports['test']=function(_0x2efdce,_0x122003,_0x106408){var _0x22a57a;return db[_0x937c('0x29')]['find']({'where':{'id':_0x2efdce['params']['id']},'attributes':['id',_0x937c('0x4d')]})[_0x937c('0x23')](handleEntityNotFound(_0x122003,null))[_0x937c('0x23')](function(_0x9ba7dc){if(_0x9ba7dc){var _0x3717a7=require('odbc')();_0x3717a7[_0x937c('0x4e')](_0x9ba7dc['dsn']);_0x3717a7[_0x937c('0x4f')]();return _0x9ba7dc;}})[_0x937c('0x23')](respondWithResult(_0x122003,null))[_0x937c('0x3f')](handleError(_0x122003,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index f35bf64..e81bf43 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 _0xfe36=['api','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0xfe36,0x142));var _0x6fe3=function(_0x1175ba,_0x5cec5b){_0x1175ba=_0x1175ba-0x0;var _0x12cf5f=_0xfe36[_0x1175ba];return _0x12cf5f;};'use strict';var _=require(_0x6fe3('0x0'));var util=require(_0x6fe3('0x1'));var logger=require('../../config/logger')(_0x6fe3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6fe3('0x3'));var fs=require('fs');var path=require(_0x6fe3('0x4'));var rimraf=require(_0x6fe3('0x5'));var config=require(_0x6fe3('0x6'));var attributes=require(_0x6fe3('0x7'));module[_0x6fe3('0x8')]=function(_0x582cc7,_0x1c3031){return _0x582cc7[_0x6fe3('0x9')](_0x6fe3('0xa'),attributes,{'tableName':_0x6fe3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5313=['path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','util','../../config/logger'];(function(_0x49bba6,_0x4ef0b9){var _0x4da95b=function(_0x504476){while(--_0x504476){_0x49bba6['push'](_0x49bba6['shift']());}};_0x4da95b(++_0x4ef0b9);}(_0x5313,0x1dd));var _0x3531=function(_0x39e376,_0x8d3339){_0x39e376=_0x39e376-0x0;var _0x488e7c=_0x5313[_0x39e376];return _0x488e7c;};'use strict';var _=require(_0x3531('0x0'));var util=require(_0x3531('0x1'));var logger=require(_0x3531('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3531('0x3'));var rimraf=require(_0x3531('0x4'));var config=require(_0x3531('0x5'));var attributes=require(_0x3531('0x6'));module['exports']=function(_0x540927,_0x18c7bb){return _0x540927[_0x3531('0x7')](_0x3531('0x8'),attributes,{'tableName':_0x3531('0x9'),'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 de39556..2d4f03d 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 _0x4c0d=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','where','include','map','model','attributes','debug','moment'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x4c0d,0x117));var _0xd4c0=function(_0x365a62,_0x373c63){_0x365a62=_0x365a62-0x0;var _0x2379e0=_0x4c0d[_0x365a62];return _0x2379e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd4c0('0x0'));var BPromise=require('bluebird');var rs=require(_0xd4c0('0x1'));var fs=require('fs');var Redis=require(_0xd4c0('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4c0('0x3'))('rpc');var config=require(_0xd4c0('0x4'));var jayson=require(_0xd4c0('0x5'));var client=jayson['client'][_0xd4c0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x149862,_0x259e1b,_0x9e5782){return new BPromise(function(_0x30e948,_0x1e2575){return client[_0xd4c0('0x7')](_0x149862,_0x9e5782)[_0xd4c0('0x8')](function(_0x5bd600){logger[_0xd4c0('0x9')](_0xd4c0('0xa'),_0x259e1b,_0xd4c0('0xb'));logger['debug'](_0xd4c0('0xc'),_0x259e1b,_0xd4c0('0xb'),JSON[_0xd4c0('0xd')](_0x5bd600));if(_0x5bd600[_0xd4c0('0xe')]){if(_0x5bd600[_0xd4c0('0xe')]['code']===0x1f4){logger[_0xd4c0('0xe')](_0xd4c0('0xa'),_0x259e1b,_0x5bd600[_0xd4c0('0xe')][_0xd4c0('0xf')]);return _0x1e2575(_0x5bd600[_0xd4c0('0xe')][_0xd4c0('0xf')]);}logger[_0xd4c0('0xe')](_0xd4c0('0xa'),_0x259e1b,_0x5bd600[_0xd4c0('0xe')][_0xd4c0('0xf')]);return _0x30e948(_0x5bd600['error'][_0xd4c0('0xf')]);}else{logger[_0xd4c0('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x259e1b,_0xd4c0('0xb'));_0x30e948(_0x5bd600[_0xd4c0('0x10')][_0xd4c0('0xf')]);}})[_0xd4c0('0x11')](function(_0xb1c3ca){logger['error'](_0xd4c0('0xa'),_0x259e1b,_0xb1c3ca);_0x1e2575(_0xb1c3ca);});});}exports[_0xd4c0('0x12')]=function(_0x165381){var _0x1885b2=this;return new Promise(function(_0x504795,_0x4a2255){return db[_0xd4c0('0x13')][_0xd4c0('0x14')]({'raw':_0x165381[_0xd4c0('0x15')]?_0x165381[_0xd4c0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x165381[_0xd4c0('0x15')]?_0x165381[_0xd4c0('0x15')][_0xd4c0('0x16')]||null:null,'attributes':_0x165381[_0xd4c0('0x15')]?_0x165381['options']['attributes']||null:null,'include':_0x165381[_0xd4c0('0x15')]?_0x165381['options'][_0xd4c0('0x17')]?_[_0xd4c0('0x18')](_0x165381['options'][_0xd4c0('0x17')],function(_0x3bda63){return{'model':db[_0x3bda63[_0xd4c0('0x19')]],'as':_0x3bda63['as'],'attributes':_0x3bda63[_0xd4c0('0x1a')],'include':_0x3bda63[_0xd4c0('0x17')]?_[_0xd4c0('0x18')](_0x3bda63[_0xd4c0('0x17')],function(_0x16a0b2){return{'model':db[_0x16a0b2['model']],'as':_0x16a0b2['as'],'attributes':_0x16a0b2[_0xd4c0('0x1a')],'include':_0x16a0b2[_0xd4c0('0x17')]?_[_0xd4c0('0x18')](_0x16a0b2[_0xd4c0('0x17')],function(_0x23dc40){return{'model':db[_0x23dc40[_0xd4c0('0x19')]],'as':_0x23dc40['as'],'attributes':_0x23dc40[_0xd4c0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd4c0('0x8')](function(_0x6d7fc6){logger['info'](_0xd4c0('0x12'),_0x165381);logger[_0xd4c0('0x1b')](_0xd4c0('0x12'),_0x165381,JSON[_0xd4c0('0xd')](_0x6d7fc6));_0x504795(_0x6d7fc6);})[_0xd4c0('0x11')](function(_0x309378){logger[_0xd4c0('0xe')](_0xd4c0('0x12'),_0x309378[_0xd4c0('0xf')],_0x165381);_0x4a2255(_0x1885b2['error'](0x1f4,_0x309378['message']));});});}; \ No newline at end of file +var _0x5ef7=['stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','include','map','attributes','model','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0xb6dcc9,_0x47a19c){var _0x4c0588=function(_0x5edaa4){while(--_0x5edaa4){_0xb6dcc9['push'](_0xb6dcc9['shift']());}};_0x4c0588(++_0x47a19c);}(_0x5ef7,0x1a2));var _0x75ef=function(_0x553790,_0xc60917){_0x553790=_0x553790-0x0;var _0x29b8f0=_0x5ef7[_0x553790];return _0x29b8f0;};'use strict';var _=require(_0x75ef('0x0'));var util=require('util');var moment=require(_0x75ef('0x1'));var BPromise=require(_0x75ef('0x2'));var rs=require(_0x75ef('0x3'));var fs=require('fs');var Redis=require(_0x75ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x75ef('0x5'));var logger=require('../../config/logger')(_0x75ef('0x6'));var config=require(_0x75ef('0x7'));var jayson=require(_0x75ef('0x8'));var client=jayson[_0x75ef('0x9')][_0x75ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25f51f,_0x4611a2,_0x5ec303){return new BPromise(function(_0xbfe631,_0x55f3ad){return client['request'](_0x25f51f,_0x5ec303)[_0x75ef('0xb')](function(_0x293cc3){logger['info'](_0x75ef('0xc'),_0x4611a2,_0x75ef('0xd'));logger[_0x75ef('0xe')](_0x75ef('0xf'),_0x4611a2,_0x75ef('0xd'),JSON[_0x75ef('0x10')](_0x293cc3));if(_0x293cc3[_0x75ef('0x11')]){if(_0x293cc3['error'][_0x75ef('0x12')]===0x1f4){logger[_0x75ef('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4611a2,_0x293cc3[_0x75ef('0x11')][_0x75ef('0x13')]);return _0x55f3ad(_0x293cc3['error'][_0x75ef('0x13')]);}logger[_0x75ef('0x11')](_0x75ef('0xc'),_0x4611a2,_0x293cc3[_0x75ef('0x11')][_0x75ef('0x13')]);return _0xbfe631(_0x293cc3[_0x75ef('0x11')][_0x75ef('0x13')]);}else{logger[_0x75ef('0x14')](_0x75ef('0xc'),_0x4611a2,_0x75ef('0xd'));_0xbfe631(_0x293cc3[_0x75ef('0x15')][_0x75ef('0x13')]);}})[_0x75ef('0x16')](function(_0x39370f){logger[_0x75ef('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4611a2,_0x39370f);_0x55f3ad(_0x39370f);});});}exports[_0x75ef('0x17')]=function(_0x37734a){var _0x286af8=this;return new Promise(function(_0x18d1f9,_0x31fcf1){return db[_0x75ef('0x18')][_0x75ef('0x19')]({'raw':_0x37734a[_0x75ef('0x1a')]?_0x37734a[_0x75ef('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x37734a[_0x75ef('0x1a')]?_0x37734a[_0x75ef('0x1a')]['where']||null:null,'attributes':_0x37734a[_0x75ef('0x1a')]?_0x37734a[_0x75ef('0x1a')]['attributes']||null:null,'include':_0x37734a[_0x75ef('0x1a')]?_0x37734a[_0x75ef('0x1a')][_0x75ef('0x1b')]?_[_0x75ef('0x1c')](_0x37734a['options'][_0x75ef('0x1b')],function(_0xa4f3f9){return{'model':db[_0xa4f3f9['model']],'as':_0xa4f3f9['as'],'attributes':_0xa4f3f9[_0x75ef('0x1d')],'include':_0xa4f3f9[_0x75ef('0x1b')]?_[_0x75ef('0x1c')](_0xa4f3f9[_0x75ef('0x1b')],function(_0x14289d){return{'model':db[_0x14289d[_0x75ef('0x1e')]],'as':_0x14289d['as'],'attributes':_0x14289d[_0x75ef('0x1d')],'include':_0x14289d[_0x75ef('0x1b')]?_['map'](_0x14289d['include'],function(_0x46745c){return{'model':db[_0x46745c[_0x75ef('0x1e')]],'as':_0x46745c['as'],'attributes':_0x46745c[_0x75ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x75ef('0xb')](function(_0x4d3d33){logger[_0x75ef('0x14')]('ShowSquareOdbc',_0x37734a);logger[_0x75ef('0xe')](_0x75ef('0x17'),_0x37734a,JSON[_0x75ef('0x10')](_0x4d3d33));_0x18d1f9(_0x4d3d33);})[_0x75ef('0x16')](function(_0x39f553){logger[_0x75ef('0x11')](_0x75ef('0x17'),_0x39f553['message'],_0x37734a);_0x31fcf1(_0x286af8[_0x75ef('0x11')](0x1f4,_0x39f553[_0x75ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 0671fd5..54887db 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 _0x2788=['../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2d067d,_0xc8324f){var _0x5c2ec2=function(_0x516627){while(--_0x516627){_0x2d067d['push'](_0x2d067d['shift']());}};_0x5c2ec2(++_0xc8324f);}(_0x2788,0x11f));var _0x8278=function(_0xec2b48,_0x529f87){_0xec2b48=_0xec2b48-0x0;var _0x480683=_0x2788[_0xec2b48];return _0x480683;};'use strict';var multer=require('multer');var util=require(_0x8278('0x0'));var path=require(_0x8278('0x1'));var timeout=require(_0x8278('0x2'));var express=require('express');var router=express[_0x8278('0x3')]();var fs_extra=require(_0x8278('0x4'));var auth=require(_0x8278('0x5'));var interaction=require(_0x8278('0x6'));var config=require(_0x8278('0x7'));var controller=require(_0x8278('0x8'));router[_0x8278('0x9')]('/',auth['isAuthenticated'](),controller[_0x8278('0xa')]);router['get'](_0x8278('0xb'),auth[_0x8278('0xc')](),controller[_0x8278('0xd')]);router[_0x8278('0xe')]('/',auth[_0x8278('0xc')](),controller[_0x8278('0xf')]);router[_0x8278('0x10')]('/:id',auth[_0x8278('0xc')](),controller[_0x8278('0x11')]);router[_0x8278('0x12')]('/:id',auth[_0x8278('0xc')](),controller[_0x8278('0x13')]);module[_0x8278('0x14')]=router; \ No newline at end of file +var _0x19eb=['/:id','isAuthenticated','post','create','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','index'];(function(_0x30b8da,_0x282d8f){var _0x429af1=function(_0x6348ee){while(--_0x6348ee){_0x30b8da['push'](_0x30b8da['shift']());}};_0x429af1(++_0x282d8f);}(_0x19eb,0x14b));var _0xb19e=function(_0x22c393,_0x1f2389){_0x22c393=_0x22c393-0x0;var _0x161580=_0x19eb[_0x22c393];return _0x161580;};'use strict';var multer=require(_0xb19e('0x0'));var util=require(_0xb19e('0x1'));var path=require(_0xb19e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb19e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb19e('0x4'));var interaction=require(_0xb19e('0x5'));var config=require('../../config/environment');var controller=require(_0xb19e('0x6'));router[_0xb19e('0x7')]('/',auth['isAuthenticated'](),controller[_0xb19e('0x8')]);router[_0xb19e('0x7')](_0xb19e('0x9'),auth[_0xb19e('0xa')](),controller['show']);router[_0xb19e('0xb')]('/',auth[_0xb19e('0xa')](),controller[_0xb19e('0xc')]);router[_0xb19e('0xd')](_0xb19e('0x9'),auth[_0xb19e('0xa')](),controller[_0xb19e('0xe')]);router[_0xb19e('0xf')](_0xb19e('0x9'),auth[_0xb19e('0xa')](),controller['destroy']);module[_0xb19e('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 0b07a31..66e17e1 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 _0x1f42=['exports','STRING','TEXT','BLOB','preproduction','getDataValue','toString','utf8','long','production','DATE','sequelize'];(function(_0x5f2011,_0x4033fd){var _0x103642=function(_0x26f854){while(--_0x26f854){_0x5f2011['push'](_0x5f2011['shift']());}};_0x103642(++_0x4033fd);}(_0x1f42,0x11f));var _0x21f4=function(_0x37f88b,_0x1ce5ee){_0x37f88b=_0x37f88b-0x0;var _0x31e5c0=_0x1f42[_0x37f88b];return _0x31e5c0;};'use strict';var Sequelize=require(_0x21f4('0x0'));module[_0x21f4('0x1')]={'name':{'type':Sequelize[_0x21f4('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x21f4('0x2')]},'notes':{'type':Sequelize[_0x21f4('0x3')]},'preproduction':{'type':Sequelize[_0x21f4('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x21f4('0x5'))){return this[_0x21f4('0x6')]('preproduction')[_0x21f4('0x7')](_0x21f4('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x21f4('0x9')),'get':function(){if(this[_0x21f4('0x6')]('production')){return this[_0x21f4('0x6')](_0x21f4('0xa'))['toString']('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x21f4('0xb')]}}; \ No newline at end of file +var _0xb22c=['getDataValue','preproduction','toString','utf8','production','DATE','exports','STRING','name','TEXT','BLOB','long'];(function(_0x4c99b4,_0x3f016a){var _0x4fe8ad=function(_0x31a8ee){while(--_0x31a8ee){_0x4c99b4['push'](_0x4c99b4['shift']());}};_0x4fe8ad(++_0x3f016a);}(_0xb22c,0x66));var _0xcb22=function(_0x317e0a,_0x274de1){_0x317e0a=_0x317e0a-0x0;var _0xa1e1f4=_0xb22c[_0x317e0a];return _0xa1e1f4;};'use strict';var Sequelize=require('sequelize');module[_0xcb22('0x0')]={'name':{'type':Sequelize[_0xcb22('0x1')],'unique':_0xcb22('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcb22('0x1')]},'notes':{'type':Sequelize[_0xcb22('0x3')]},'preproduction':{'type':Sequelize[_0xcb22('0x4')](_0xcb22('0x5')),'get':function(){if(this[_0xcb22('0x6')](_0xcb22('0x7'))){return this['getDataValue'](_0xcb22('0x7'))[_0xcb22('0x8')](_0xcb22('0x9'));}}},'production':{'type':Sequelize[_0xcb22('0x4')](_0xcb22('0x5')),'get':function(){if(this['getDataValue'](_0xcb22('0xa'))){return this[_0xcb22('0x6')]('production')[_0xcb22('0x8')]('utf8');}}},'savedAt':{'type':Sequelize[_0xcb22('0xb')]},'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 83bc083..f9bf5d7 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 _0xec0a=['./squareProject.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','update','then','destroy','get','UserProfileResource','agi','stringify','end','sendStatus','error','name','index','map','SquareProject','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','find','userProfileId','production','lodash','ioredis','../../config/logger','api','../../config/environment','redis','defaults'];(function(_0x34c411,_0xa2390a){var _0x2c8f2a=function(_0x169bd1){while(--_0x169bd1){_0x34c411['push'](_0x34c411['shift']());}};_0x2c8f2a(++_0xa2390a);}(_0xec0a,0xbc));var _0xaec0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xec0a[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xaec0('0x0'));var Redis=require(_0xaec0('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xaec0('0x2'))(_0xaec0('0x3'));var config=require(_0xaec0('0x4'));var db=require('../../mysqldb')['db'];config[_0xaec0('0x5')]=_[_0xaec0('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaec0('0x7'))[_0xaec0('0x8')](socket);function respondWithResult(_0x3d5a69,_0x34727a){_0x34727a=_0x34727a||0xc8;return function(_0x3b1584){if(_0x3b1584){return _0x3d5a69[_0xaec0('0x9')](_0x34727a)[_0xaec0('0xa')](_0x3b1584);}};}function respondWithFilteredResult(_0xe0eb86,_0x2a604b){return function(_0x4e16f0){if(_0x4e16f0){var _0x10ecbc=typeof _0x2a604b['offset']==='undefined'&&typeof _0x2a604b[_0xaec0('0xb')]===_0xaec0('0xc');var _0x6ea140=_0x4e16f0[_0xaec0('0xd')];var _0x4b9ada=_0x10ecbc?0x0:_0x2a604b['offset'];var _0x381923=_0x10ecbc?_0x4e16f0[_0xaec0('0xd')]:_0x2a604b[_0xaec0('0xe')]+_0x2a604b[_0xaec0('0xb')];var _0x2eb010;if(_0x381923>=_0x6ea140){_0x381923=_0x6ea140;_0x2eb010=0xc8;}else{_0x2eb010=0xce;}_0xe0eb86[_0xaec0('0x9')](_0x2eb010);return _0xe0eb86[_0xaec0('0xf')](_0xaec0('0x10'),_0x4b9ada+'-'+_0x381923+'/'+_0x6ea140)[_0xaec0('0xa')](_0x4e16f0);}return null;};}function saveUpdates(_0x40e858){return function(_0x506906){if(_0x506906){return _0x506906[_0xaec0('0x11')](_0x40e858)[_0xaec0('0x12')](function(_0x17e70d){return _0x17e70d;});}return null;};}function removeEntity(_0xd162f4){return function(_0x1c0077){if(_0x1c0077){return _0x1c0077[_0xaec0('0x13')]()[_0xaec0('0x12')](function(){var _0x111173=_0x1c0077[_0xaec0('0x14')]({'plain':!![]});var _0x4330c7='SquareProjects';return db[_0xaec0('0x15')][_0xaec0('0x13')]({'where':{'type':_0x4330c7,'resourceId':_0x111173['id']}})['then'](function(){return _0x1c0077;});})[_0xaec0('0x12')](function(){var _0x50f386=new Redis(config['redis']);_0x50f386['publish'](_0xaec0('0x16'),JSON[_0xaec0('0x17')]({'id':_0x1c0077['id'],'deleted':!![]}));})[_0xaec0('0x12')](function(){_0xd162f4[_0xaec0('0x9')](0xcc)[_0xaec0('0x18')]();});}};}function handleEntityNotFound(_0x211406){return function(_0x3fea8c){if(!_0x3fea8c){_0x211406[_0xaec0('0x19')](0x194);}return _0x3fea8c;};}function handleError(_0x1b94da,_0x1088af){_0x1088af=_0x1088af||0x1f4;return function(_0x41f78e){logger[_0xaec0('0x1a')](_0x41f78e['stack']);if(_0x41f78e[_0xaec0('0x1b')]){delete _0x41f78e[_0xaec0('0x1b')];}_0x1b94da['status'](_0x1088af)['send'](_0x41f78e);};}exports[_0xaec0('0x1c')]=function(_0x3b0cc1,_0x37af5d){var _0x36d977={},_0x8e4839={},_0x376e67={'count':0x0,'rows':[]};var _0x48e085=_[_0xaec0('0x1d')](db[_0xaec0('0x1e')][_0xaec0('0x1f')],function(_0x1661e9){return{'name':_0x1661e9['fieldName'],'type':_0x1661e9[_0xaec0('0x20')][_0xaec0('0x21')]};});_0x8e4839['model']=_['map'](_0x48e085,_0xaec0('0x1b'));_0x8e4839[_0xaec0('0x22')]=_[_0xaec0('0x23')](_0x3b0cc1[_0xaec0('0x22')]);_0x8e4839[_0xaec0('0x24')]=_['intersection'](_0x8e4839[_0xaec0('0x25')],_0x8e4839[_0xaec0('0x22')]);_0x36d977[_0xaec0('0x26')]=_[_0xaec0('0x27')](_0x8e4839['model'],qs[_0xaec0('0x28')](_0x3b0cc1[_0xaec0('0x22')][_0xaec0('0x28')]));_0x36d977[_0xaec0('0x26')]=_0x36d977[_0xaec0('0x26')][_0xaec0('0x29')]?_0x36d977[_0xaec0('0x26')]:_0x8e4839[_0xaec0('0x25')];if(!_0x3b0cc1['query']['hasOwnProperty']('nolimit')){_0x36d977[_0xaec0('0xb')]=qs[_0xaec0('0xb')](_0x3b0cc1[_0xaec0('0x22')][_0xaec0('0xb')]);_0x36d977['offset']=qs['offset'](_0x3b0cc1[_0xaec0('0x22')][_0xaec0('0xe')]);}_0x36d977[_0xaec0('0x2a')]=qs[_0xaec0('0x2b')](_0x3b0cc1['query'][_0xaec0('0x2b')]);_0x36d977[_0xaec0('0x2c')]=qs[_0xaec0('0x24')](_[_0xaec0('0x2d')](_0x3b0cc1[_0xaec0('0x22')],_0x8e4839[_0xaec0('0x24')]),_0x48e085);if(_0x3b0cc1[_0xaec0('0x22')][_0xaec0('0x2e')]){_0x36d977['where']=_['merge'](_0x36d977[_0xaec0('0x2c')],{'$or':_['map'](_0x48e085,function(_0x2a22f9){if(_0x2a22f9[_0xaec0('0x20')]!==_0xaec0('0x2f')){var _0x114def={};_0x114def[_0x2a22f9[_0xaec0('0x1b')]]={'$like':'%'+_0x3b0cc1[_0xaec0('0x22')][_0xaec0('0x2e')]+'%'};return _0x114def;}})});}_0x36d977=_[_0xaec0('0x30')]({},_0x36d977,_0x3b0cc1[_0xaec0('0x31')]);var _0x401e37={'where':_0x36d977[_0xaec0('0x2c')]};return db[_0xaec0('0x1e')]['count'](_0x401e37)[_0xaec0('0x12')](function(_0x151bd4){_0x376e67['count']=_0x151bd4;if(_0x3b0cc1[_0xaec0('0x22')]['includeAll']){_0x36d977[_0xaec0('0x32')]=[{'all':!![]}];}return db['SquareProject'][_0xaec0('0x33')](_0x36d977);})[_0xaec0('0x12')](function(_0x3c9805){_0x376e67[_0xaec0('0x34')]=_0x3c9805;return _0x376e67;})[_0xaec0('0x12')](respondWithFilteredResult(_0x37af5d,_0x36d977))[_0xaec0('0x35')](handleError(_0x37af5d,null));};exports['show']=function(_0x42c760,_0x2f75dc){var _0x45212d={'raw':![],'where':{'id':_0x42c760[_0xaec0('0x36')]['id']}},_0x2b50e9={};_0x2b50e9[_0xaec0('0x25')]=_[_0xaec0('0x23')](db['SquareProject'][_0xaec0('0x1f')]);_0x2b50e9[_0xaec0('0x22')]=_[_0xaec0('0x23')](_0x42c760[_0xaec0('0x22')]);_0x2b50e9[_0xaec0('0x24')]=_[_0xaec0('0x27')](_0x2b50e9[_0xaec0('0x25')],_0x2b50e9[_0xaec0('0x22')]);_0x45212d[_0xaec0('0x26')]=_[_0xaec0('0x27')](_0x2b50e9[_0xaec0('0x25')],qs[_0xaec0('0x28')](_0x42c760[_0xaec0('0x22')][_0xaec0('0x28')]));_0x45212d[_0xaec0('0x26')]=_0x45212d[_0xaec0('0x26')][_0xaec0('0x29')]?_0x45212d[_0xaec0('0x26')]:_0x2b50e9[_0xaec0('0x25')];if(_0x42c760[_0xaec0('0x22')][_0xaec0('0x37')]){_0x45212d['include']=[{'all':!![]}];}_0x45212d=_[_0xaec0('0x30')]({},_0x45212d,_0x42c760[_0xaec0('0x31')]);return db['SquareProject']['find'](_0x45212d)[_0xaec0('0x12')](handleEntityNotFound(_0x2f75dc,null))[_0xaec0('0x12')](respondWithResult(_0x2f75dc,null))[_0xaec0('0x35')](handleError(_0x2f75dc,null));};exports['create']=function(_0x385dce,_0xb2a2e3){return db['SquareProject'][_0xaec0('0x38')](_0x385dce[_0xaec0('0x39')],{})[_0xaec0('0x12')](function(_0x40eecc){var _0x4592ec=_0x385dce[_0xaec0('0x3a')][_0xaec0('0x14')]({'plain':!![]});if(!_0x4592ec)throw new Error(_0xaec0('0x3b'));if(_0x4592ec['role']==='user'){var _0x3cad52=_0x40eecc[_0xaec0('0x14')]({'plain':!![]});var _0x586d30=_0xaec0('0x3c');return db[_0xaec0('0x3d')][_0xaec0('0x3e')]({'where':{'name':_0x586d30,'userProfileId':_0x4592ec[_0xaec0('0x3f')]},'raw':!![]})['then'](function(_0x22a9b3){if(_0x22a9b3&&_0x22a9b3['autoAssociation']===0x0){return db[_0xaec0('0x15')][_0xaec0('0x38')]({'name':_0x3cad52[_0xaec0('0x1b')],'resourceId':_0x3cad52['id'],'type':_0x22a9b3[_0xaec0('0x1b')],'sectionId':_0x22a9b3['id']},{})[_0xaec0('0x12')](function(){return _0x40eecc;});}else{return _0x40eecc;}})['catch'](function(_0x100aca){logger[_0xaec0('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x100aca);throw _0x100aca;});}return _0x40eecc;})[_0xaec0('0x12')](respondWithResult(_0xb2a2e3,0xc9))[_0xaec0('0x35')](handleError(_0xb2a2e3,null));};exports['update']=function(_0x254016,_0x4f21f6){if(_0x254016[_0xaec0('0x39')]['id']){delete _0x254016[_0xaec0('0x39')]['id'];}return db[_0xaec0('0x1e')][_0xaec0('0x3e')]({'where':{'id':_0x254016['params']['id']}})[_0xaec0('0x12')](handleEntityNotFound(_0x4f21f6,null))['then'](saveUpdates(_0x254016['body'],null))[_0xaec0('0x12')](function(_0x1d888b){if(!_0x1d888b)return;var _0x28c51b=_0x1d888b[_0xaec0('0x14')]({'plain':!![]});return _0x28c51b;})['then'](function(_0x412be8){var _0x5ebf35=new Redis(config[_0xaec0('0x5')]);_0x5ebf35['publish'](_0xaec0('0x16'),JSON[_0xaec0('0x17')](_[_0xaec0('0x2d')](_0x412be8,['id',_0xaec0('0x1b'),_0xaec0('0x40')])));return _0x412be8;})['then'](respondWithResult(_0x4f21f6,null))[_0xaec0('0x35')](handleError(_0x4f21f6,null));};exports[_0xaec0('0x13')]=function(_0x12ed6a,_0x27f29f){return db[_0xaec0('0x1e')][_0xaec0('0x3e')]({'where':{'id':_0x12ed6a[_0xaec0('0x36')]['id']}})['then'](handleEntityNotFound(_0x27f29f,null))[_0xaec0('0x12')](removeEntity(_0x27f29f,null))[_0xaec0('0x35')](handleError(_0x27f29f,null));}; \ No newline at end of file +var _0xf221=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','lodash','ioredis','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','sendStatus','error','stack','name','index','SquareProject','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x465b3b,_0x501395){var _0x1d337d=function(_0x229aaa){while(--_0x229aaa){_0x465b3b['push'](_0x465b3b['shift']());}};_0x1d337d(++_0x501395);}(_0xf221,0xa8));var _0x1f22=function(_0x3cd6b1,_0x407231){_0x3cd6b1=_0x3cd6b1-0x0;var _0x282eb5=_0xf221[_0x3cd6b1];return _0x282eb5;};'use strict';var _=require(_0x1f22('0x0'));var Redis=require(_0x1f22('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x1f22('0x2'))(_0x1f22('0x3'));var config=require(_0x1f22('0x4'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1f22('0x5')](config[_0x1f22('0x6')],{'host':_0x1f22('0x7'),'port':0x18eb});var socket=require(_0x1f22('0x8'))(new Redis(config[_0x1f22('0x6')]));require(_0x1f22('0x9'))['register'](socket);function respondWithResult(_0x4acdbb,_0x216ee2){_0x216ee2=_0x216ee2||0xc8;return function(_0x5d640c){if(_0x5d640c){return _0x4acdbb[_0x1f22('0xa')](_0x216ee2)[_0x1f22('0xb')](_0x5d640c);}};}function respondWithFilteredResult(_0x5681e2,_0x2649d9){return function(_0x4dee71){if(_0x4dee71){var _0x352924=typeof _0x2649d9[_0x1f22('0xc')]===_0x1f22('0xd')&&typeof _0x2649d9[_0x1f22('0xe')]===_0x1f22('0xd');var _0x249e97=_0x4dee71['count'];var _0x1ec599=_0x352924?0x0:_0x2649d9[_0x1f22('0xc')];var _0x16e928=_0x352924?_0x4dee71[_0x1f22('0xf')]:_0x2649d9[_0x1f22('0xc')]+_0x2649d9[_0x1f22('0xe')];var _0x2fb9fe;if(_0x16e928>=_0x249e97){_0x16e928=_0x249e97;_0x2fb9fe=0xc8;}else{_0x2fb9fe=0xce;}_0x5681e2[_0x1f22('0xa')](_0x2fb9fe);return _0x5681e2[_0x1f22('0x10')](_0x1f22('0x11'),_0x1ec599+'-'+_0x16e928+'/'+_0x249e97)[_0x1f22('0xb')](_0x4dee71);}return null;};}function saveUpdates(_0x400f33){return function(_0x25f83f){if(_0x25f83f){return _0x25f83f[_0x1f22('0x12')](_0x400f33)[_0x1f22('0x13')](function(_0x96426c){return _0x96426c;});}return null;};}function removeEntity(_0x5a9b9d){return function(_0x347a54){if(_0x347a54){return _0x347a54[_0x1f22('0x14')]()[_0x1f22('0x13')](function(){var _0x22b863=_0x347a54[_0x1f22('0x15')]({'plain':!![]});var _0x4bd1b5=_0x1f22('0x16');return db[_0x1f22('0x17')][_0x1f22('0x14')]({'where':{'type':_0x4bd1b5,'resourceId':_0x22b863['id']}})[_0x1f22('0x13')](function(){return _0x347a54;});})[_0x1f22('0x13')](function(){var _0x6e6836=new Redis(config['redis']);_0x6e6836[_0x1f22('0x18')](_0x1f22('0x19'),JSON['stringify']({'id':_0x347a54['id'],'deleted':!![]}));})[_0x1f22('0x13')](function(){_0x5a9b9d[_0x1f22('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a9ab){return function(_0x2cb63a){if(!_0x2cb63a){_0x44a9ab[_0x1f22('0x1a')](0x194);}return _0x2cb63a;};}function handleError(_0x49f6fe,_0xb96e85){_0xb96e85=_0xb96e85||0x1f4;return function(_0x2db613){logger[_0x1f22('0x1b')](_0x2db613[_0x1f22('0x1c')]);if(_0x2db613[_0x1f22('0x1d')]){delete _0x2db613[_0x1f22('0x1d')];}_0x49f6fe[_0x1f22('0xa')](_0xb96e85)['send'](_0x2db613);};}exports[_0x1f22('0x1e')]=function(_0x4fd35e,_0x377741){var _0x5c441f={},_0x593d31={},_0x374fae={'count':0x0,'rows':[]};var _0xb378ca=_['map'](db[_0x1f22('0x1f')][_0x1f22('0x20')],function(_0x53866e){return{'name':_0x53866e[_0x1f22('0x21')],'type':_0x53866e[_0x1f22('0x22')][_0x1f22('0x23')]};});_0x593d31[_0x1f22('0x24')]=_['map'](_0xb378ca,'name');_0x593d31[_0x1f22('0x25')]=_[_0x1f22('0x26')](_0x4fd35e[_0x1f22('0x25')]);_0x593d31[_0x1f22('0x27')]=_[_0x1f22('0x28')](_0x593d31[_0x1f22('0x24')],_0x593d31[_0x1f22('0x25')]);_0x5c441f[_0x1f22('0x29')]=_[_0x1f22('0x28')](_0x593d31['model'],qs[_0x1f22('0x2a')](_0x4fd35e['query'][_0x1f22('0x2a')]));_0x5c441f[_0x1f22('0x29')]=_0x5c441f['attributes'][_0x1f22('0x2b')]?_0x5c441f[_0x1f22('0x29')]:_0x593d31[_0x1f22('0x24')];if(!_0x4fd35e[_0x1f22('0x25')][_0x1f22('0x2c')](_0x1f22('0x2d'))){_0x5c441f['limit']=qs[_0x1f22('0xe')](_0x4fd35e[_0x1f22('0x25')][_0x1f22('0xe')]);_0x5c441f[_0x1f22('0xc')]=qs[_0x1f22('0xc')](_0x4fd35e[_0x1f22('0x25')][_0x1f22('0xc')]);}_0x5c441f[_0x1f22('0x2e')]=qs[_0x1f22('0x2f')](_0x4fd35e['query'][_0x1f22('0x2f')]);_0x5c441f[_0x1f22('0x30')]=qs['filters'](_[_0x1f22('0x31')](_0x4fd35e['query'],_0x593d31['filters']),_0xb378ca);if(_0x4fd35e[_0x1f22('0x25')][_0x1f22('0x32')]){_0x5c441f['where']=_[_0x1f22('0x33')](_0x5c441f['where'],{'$or':_['map'](_0xb378ca,function(_0x59594f){if(_0x59594f[_0x1f22('0x22')]!==_0x1f22('0x34')){var _0x3676ed={};_0x3676ed[_0x59594f['name']]={'$like':'%'+_0x4fd35e['query'][_0x1f22('0x32')]+'%'};return _0x3676ed;}})});}_0x5c441f=_[_0x1f22('0x33')]({},_0x5c441f,_0x4fd35e[_0x1f22('0x35')]);var _0x16ec13={'where':_0x5c441f[_0x1f22('0x30')]};return db[_0x1f22('0x1f')]['count'](_0x16ec13)['then'](function(_0x3fabaf){_0x374fae['count']=_0x3fabaf;if(_0x4fd35e[_0x1f22('0x25')][_0x1f22('0x36')]){_0x5c441f[_0x1f22('0x37')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x5c441f);})[_0x1f22('0x13')](function(_0x142a1e){_0x374fae['rows']=_0x142a1e;return _0x374fae;})[_0x1f22('0x13')](respondWithFilteredResult(_0x377741,_0x5c441f))[_0x1f22('0x38')](handleError(_0x377741,null));};exports[_0x1f22('0x39')]=function(_0x217c85,_0x382f9e){var _0x7a681c={'raw':![],'where':{'id':_0x217c85[_0x1f22('0x3a')]['id']}},_0x15f369={};_0x15f369[_0x1f22('0x24')]=_[_0x1f22('0x26')](db[_0x1f22('0x1f')]['rawAttributes']);_0x15f369['query']=_[_0x1f22('0x26')](_0x217c85[_0x1f22('0x25')]);_0x15f369['filters']=_[_0x1f22('0x28')](_0x15f369['model'],_0x15f369['query']);_0x7a681c['attributes']=_['intersection'](_0x15f369[_0x1f22('0x24')],qs[_0x1f22('0x2a')](_0x217c85['query'][_0x1f22('0x2a')]));_0x7a681c[_0x1f22('0x29')]=_0x7a681c[_0x1f22('0x29')][_0x1f22('0x2b')]?_0x7a681c[_0x1f22('0x29')]:_0x15f369[_0x1f22('0x24')];if(_0x217c85[_0x1f22('0x25')][_0x1f22('0x36')]){_0x7a681c[_0x1f22('0x37')]=[{'all':!![]}];}_0x7a681c=_[_0x1f22('0x33')]({},_0x7a681c,_0x217c85[_0x1f22('0x35')]);return db[_0x1f22('0x1f')][_0x1f22('0x3b')](_0x7a681c)['then'](handleEntityNotFound(_0x382f9e,null))[_0x1f22('0x13')](respondWithResult(_0x382f9e,null))[_0x1f22('0x38')](handleError(_0x382f9e,null));};exports[_0x1f22('0x3c')]=function(_0xcd0edc,_0x13e00f){return db[_0x1f22('0x1f')][_0x1f22('0x3c')](_0xcd0edc[_0x1f22('0x3d')],{})[_0x1f22('0x13')](function(_0x19dee5){var _0x2f2562=_0xcd0edc[_0x1f22('0x3e')][_0x1f22('0x15')]({'plain':!![]});if(!_0x2f2562)throw new Error(_0x1f22('0x3f'));if(_0x2f2562[_0x1f22('0x40')]==='user'){var _0x329d3c=_0x19dee5[_0x1f22('0x15')]({'plain':!![]});var _0x409c1c=_0x1f22('0x16');return db[_0x1f22('0x41')][_0x1f22('0x3b')]({'where':{'name':_0x409c1c,'userProfileId':_0x2f2562['userProfileId']},'raw':!![]})[_0x1f22('0x13')](function(_0x56bebf){if(_0x56bebf&&_0x56bebf[_0x1f22('0x42')]===0x0){return db[_0x1f22('0x17')]['create']({'name':_0x329d3c[_0x1f22('0x1d')],'resourceId':_0x329d3c['id'],'type':_0x56bebf[_0x1f22('0x1d')],'sectionId':_0x56bebf['id']},{})[_0x1f22('0x13')](function(){return _0x19dee5;});}else{return _0x19dee5;}})[_0x1f22('0x38')](function(_0x74f19c){logger[_0x1f22('0x1b')](_0x1f22('0x43'),_0x74f19c);throw _0x74f19c;});}return _0x19dee5;})[_0x1f22('0x13')](respondWithResult(_0x13e00f,0xc9))['catch'](handleError(_0x13e00f,null));};exports[_0x1f22('0x12')]=function(_0x3ee77c,_0x181a1d){if(_0x3ee77c[_0x1f22('0x3d')]['id']){delete _0x3ee77c[_0x1f22('0x3d')]['id'];}return db['SquareProject'][_0x1f22('0x3b')]({'where':{'id':_0x3ee77c[_0x1f22('0x3a')]['id']}})[_0x1f22('0x13')](handleEntityNotFound(_0x181a1d,null))[_0x1f22('0x13')](saveUpdates(_0x3ee77c[_0x1f22('0x3d')],null))['then'](function(_0x51308d){if(!_0x51308d)return;var _0x4ef2b=_0x51308d[_0x1f22('0x15')]({'plain':!![]});return _0x4ef2b;})[_0x1f22('0x13')](function(_0xeca44e){var _0x35bd6e=new Redis(config[_0x1f22('0x6')]);_0x35bd6e['publish'](_0x1f22('0x19'),JSON[_0x1f22('0x44')](_[_0x1f22('0x31')](_0xeca44e,['id',_0x1f22('0x1d'),'production'])));return _0xeca44e;})['then'](respondWithResult(_0x181a1d,null))[_0x1f22('0x38')](handleError(_0x181a1d,null));};exports[_0x1f22('0x14')]=function(_0x3105f3,_0x3ae4dd){return db[_0x1f22('0x1f')]['find']({'where':{'id':_0x3105f3['params']['id']}})[_0x1f22('0x13')](handleEntityNotFound(_0x3ae4dd,null))['then'](removeEntity(_0x3ae4dd,null))[_0x1f22('0x38')](handleError(_0x3ae4dd,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 6d41d38..a26e04a 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 _0xc772=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x4b7d87,_0x238711){var _0x3b9f82=function(_0x2c5173){while(--_0x2c5173){_0x4b7d87['push'](_0x4b7d87['shift']());}};_0x3b9f82(++_0x238711);}(_0xc772,0x13b));var _0x2c77=function(_0x25617d,_0x45a0dd){_0x25617d=_0x25617d-0x0;var _0x1df6f8=_0xc772[_0x25617d];return _0x1df6f8;};'use strict';var EventEmitter=require(_0x2c77('0x0'));var SquareProject=require(_0x2c77('0x1'))['db'][_0x2c77('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2c77('0x3')](0x0);var events={'afterCreate':_0x2c77('0x4'),'afterUpdate':_0x2c77('0x5'),'afterDestroy':_0x2c77('0x6')};function emitEvent(_0x5ed4d5){return function(_0x2b510a,_0x432b27,_0x4458b8){SquareProjectEvents[_0x2c77('0x7')](_0x5ed4d5+':'+_0x2b510a['id'],_0x2b510a);SquareProjectEvents[_0x2c77('0x7')](_0x5ed4d5,_0x2b510a);_0x4458b8(null);};}for(var e in events){if(events[_0x2c77('0x8')](e)){var event=events[e];SquareProject[_0x2c77('0x9')](e,emitEvent(event));}}module[_0x2c77('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0xca50=['events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit'];(function(_0x4a368e,_0x135d5a){var _0x1c26e7=function(_0x4ab668){while(--_0x4ab668){_0x4a368e['push'](_0x4a368e['shift']());}};_0x1c26e7(++_0x135d5a);}(_0xca50,0x118));var _0x0ca5=function(_0x4738ed,_0x1d267f){_0x4738ed=_0x4738ed-0x0;var _0x1abc73=_0xca50[_0x4738ed];return _0x1abc73;};'use strict';var EventEmitter=require(_0x0ca5('0x0'));var SquareProject=require(_0x0ca5('0x1'))['db'][_0x0ca5('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0ca5('0x3')](0x0);var events={'afterCreate':_0x0ca5('0x4'),'afterUpdate':_0x0ca5('0x5'),'afterDestroy':_0x0ca5('0x6')};function emitEvent(_0x45b98d){return function(_0x1ca35f,_0x7f5a80,_0x243080){SquareProjectEvents[_0x0ca5('0x7')](_0x45b98d+':'+_0x1ca35f['id'],_0x1ca35f);SquareProjectEvents[_0x0ca5('0x7')](_0x45b98d,_0x1ca35f);_0x243080(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 688162d..a58b3e6 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 _0x1743=['production','publishedAt','format','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0x203e60,_0x3b0b53){var _0xe92e72=function(_0x4cea41){while(--_0x4cea41){_0x203e60['push'](_0x203e60['shift']());}};_0xe92e72(++_0x3b0b53);}(_0x1743,0x1a7));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3174('0x0'));var util=require(_0x3174('0x1'));var logger=require('../../config/logger')(_0x3174('0x2'));var moment=require(_0x3174('0x3'));var BPromise=require(_0x3174('0x4'));var rp=require(_0x3174('0x5'));var fs=require('fs');var path=require(_0x3174('0x6'));var rimraf=require(_0x3174('0x7'));var config=require(_0x3174('0x8'));var attributes=require(_0x3174('0x9'));module[_0x3174('0xa')]=function(_0x58b752,_0x4bdd46){return _0x58b752[_0x3174('0xb')](_0x3174('0xc'),attributes,{'tableName':_0x3174('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d437f,_0x5a6da6,_0x14fc13){if(_0x3d437f['changed'](_0x3174('0xe'))){_0x3d437f[_0x3174('0xf')]=moment()['format'](_0x3174('0x10'));}if(_0x3d437f[_0x3174('0x11')](_0x3174('0x12'))){_0x3d437f[_0x3174('0x13')]=moment()[_0x3174('0x14')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14fc13(null,_0x3d437f);}}});}; \ No newline at end of file +var _0x8bc4=['publishedAt','format','lodash','api','moment','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x2b9c5f,_0x21307d){var _0x40e3f6=function(_0x47b79f){while(--_0x47b79f){_0x2b9c5f['push'](_0x2b9c5f['shift']());}};_0x40e3f6(++_0x21307d);}(_0x8bc4,0x145));var _0x48bc=function(_0x5acbe5,_0xf5b1fd){_0x5acbe5=_0x5acbe5-0x0;var _0x26798c=_0x8bc4[_0x5acbe5];return _0x26798c;};'use strict';var _=require(_0x48bc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x48bc('0x1'));var moment=require(_0x48bc('0x2'));var BPromise=require('bluebird');var rp=require(_0x48bc('0x3'));var fs=require('fs');var path=require(_0x48bc('0x4'));var rimraf=require('rimraf');var config=require(_0x48bc('0x5'));var attributes=require(_0x48bc('0x6'));module[_0x48bc('0x7')]=function(_0xed0208,_0x404e6c){return _0xed0208[_0x48bc('0x8')](_0x48bc('0x9'),attributes,{'tableName':_0x48bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22d96d,_0x31e85d,_0x26d8ea){if(_0x22d96d[_0x48bc('0xb')]('preproduction')){_0x22d96d[_0x48bc('0xc')]=moment()['format'](_0x48bc('0xd'));}if(_0x22d96d[_0x48bc('0xb')](_0x48bc('0xe'))){_0x22d96d[_0x48bc('0xf')]=moment()[_0x48bc('0x10')](_0x48bc('0xd'));}_0x26d8ea(null,_0x22d96d);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b09cb8b..d77a86d 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 _0xa725=['redis','GetSquareProjects','findAll','options','raw','where','limit','include','map','model','attributes','then','info','error','message','ShowSquareProject','debug','stringify','catch','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0xb3c263,_0x419cae){var _0x43387c=function(_0x24c6d7){while(--_0x24c6d7){_0xb3c263['push'](_0xb3c263['shift']());}};_0x43387c(++_0x419cae);}(_0xa725,0x9d));var _0x5a72=function(_0x9f3520,_0x30a02f){_0x9f3520=_0x9f3520-0x0;var _0x25d1f8=_0xa725[_0x9f3520];return _0x25d1f8;};'use strict';var _=require('lodash');var Redis=require(_0x5a72('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0x5a72('0x1'))(_0x5a72('0x2'));var config=require(_0x5a72('0x3'));config[_0x5a72('0x4')]=_['defaults'](config[_0x5a72('0x4')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a72('0x4')]));require('./squareProject.socket')['register'](socket);exports[_0x5a72('0x5')]=function(_0x44cce1){var _0x2cd9b0=this;return new Promise(function(_0x17c39c,_0x35f390){return db['SquareProject'][_0x5a72('0x6')]({'raw':_0x44cce1[_0x5a72('0x7')]?_0x44cce1['options'][_0x5a72('0x8')]===undefined?!![]:![]:!![],'where':_0x44cce1[_0x5a72('0x7')]?_0x44cce1[_0x5a72('0x7')][_0x5a72('0x9')]||null:null,'attributes':_0x44cce1[_0x5a72('0x7')]?_0x44cce1[_0x5a72('0x7')]['attributes']||null:null,'limit':_0x44cce1['options']?_0x44cce1[_0x5a72('0x7')][_0x5a72('0xa')]||null:null,'include':_0x44cce1['options']?_0x44cce1[_0x5a72('0x7')][_0x5a72('0xb')]?_[_0x5a72('0xc')](_0x44cce1[_0x5a72('0x7')]['include'],function(_0x463c10){return{'model':db[_0x463c10[_0x5a72('0xd')]],'as':_0x463c10['as'],'attributes':_0x463c10[_0x5a72('0xe')],'include':_0x463c10[_0x5a72('0xb')]?_[_0x5a72('0xc')](_0x463c10['include'],function(_0x1539a8){return{'model':db[_0x1539a8[_0x5a72('0xd')]],'as':_0x1539a8['as'],'attributes':_0x1539a8[_0x5a72('0xe')],'include':_0x1539a8[_0x5a72('0xb')]?_[_0x5a72('0xc')](_0x1539a8[_0x5a72('0xb')],function(_0x383012){return{'model':db[_0x383012[_0x5a72('0xd')]],'as':_0x383012['as'],'attributes':_0x383012[_0x5a72('0xe')]};}):[]};}):[]};}):[]:[]})[_0x5a72('0xf')](function(_0x100934){logger[_0x5a72('0x10')](_0x5a72('0x5'),_0x44cce1);logger['debug'](_0x5a72('0x5'),_0x44cce1,JSON['stringify'](_0x100934));_0x17c39c(_0x100934);})['catch'](function(_0x6036c5){logger[_0x5a72('0x11')](_0x5a72('0x5'),_0x6036c5[_0x5a72('0x12')],_0x44cce1);_0x35f390(_0x2cd9b0['error'](0x1f4,_0x6036c5[_0x5a72('0x12')]));});});};exports[_0x5a72('0x13')]=function(_0x1ac5d6){var _0x4f416b=this;return new Promise(function(_0xc804f0,_0x3757f0){return db['SquareProject']['find']({'raw':_0x1ac5d6['options']?_0x1ac5d6['options'][_0x5a72('0x8')]===undefined?!![]:![]:!![],'where':_0x1ac5d6[_0x5a72('0x7')]?_0x1ac5d6[_0x5a72('0x7')][_0x5a72('0x9')]||null:null,'attributes':_0x1ac5d6[_0x5a72('0x7')]?_0x1ac5d6[_0x5a72('0x7')]['attributes']||null:null,'include':_0x1ac5d6[_0x5a72('0x7')]?_0x1ac5d6[_0x5a72('0x7')][_0x5a72('0xb')]?_[_0x5a72('0xc')](_0x1ac5d6[_0x5a72('0x7')][_0x5a72('0xb')],function(_0x88f2e7){return{'model':db[_0x88f2e7[_0x5a72('0xd')]],'as':_0x88f2e7['as'],'attributes':_0x88f2e7['attributes'],'include':_0x88f2e7[_0x5a72('0xb')]?_['map'](_0x88f2e7[_0x5a72('0xb')],function(_0x3e3654){return{'model':db[_0x3e3654[_0x5a72('0xd')]],'as':_0x3e3654['as'],'attributes':_0x3e3654[_0x5a72('0xe')],'include':_0x3e3654[_0x5a72('0xb')]?_[_0x5a72('0xc')](_0x3e3654[_0x5a72('0xb')],function(_0x9576dc){return{'model':db[_0x9576dc['model']],'as':_0x9576dc['as'],'attributes':_0x9576dc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x269086){logger[_0x5a72('0x10')](_0x5a72('0x13'),_0x1ac5d6);logger[_0x5a72('0x14')](_0x5a72('0x13'),_0x1ac5d6,JSON[_0x5a72('0x15')](_0x269086));_0xc804f0(_0x269086);})[_0x5a72('0x16')](function(_0x3ae7a0){logger[_0x5a72('0x11')]('ShowSquareProject',_0x3ae7a0[_0x5a72('0x12')],_0x1ac5d6);_0x3757f0(_0x4f416b[_0x5a72('0x11')](0x1f4,_0x3ae7a0['message']));});});}; \ No newline at end of file +var _0x48f3=['findAll','options','where','attributes','include','model','map','then','info','debug','stringify','catch','message','error','ShowSquareProject','find','raw','lodash','ioredis','../../mysqldb','../../config/logger','rpc','defaults','redis','localhost','GetSquareProjects','SquareProject'];(function(_0x29f3e2,_0x25d51b){var _0x3bb516=function(_0x49fe1a){while(--_0x49fe1a){_0x29f3e2['push'](_0x29f3e2['shift']());}};_0x3bb516(++_0x25d51b);}(_0x48f3,0x13a));var _0x348f=function(_0x40e0ab,_0x26d731){_0x40e0ab=_0x40e0ab-0x0;var _0x37479b=_0x48f3[_0x40e0ab];return _0x37479b;};'use strict';var _=require(_0x348f('0x0'));var Redis=require(_0x348f('0x1'));var db=require(_0x348f('0x2'))['db'];var logger=require(_0x348f('0x3'))(_0x348f('0x4'));var config=require('../../config/environment');config['redis']=_[_0x348f('0x5')](config[_0x348f('0x6')],{'host':_0x348f('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);exports[_0x348f('0x8')]=function(_0x31feb7){var _0x2cc146=this;return new Promise(function(_0x3d0cbf,_0x240ffd){return db[_0x348f('0x9')][_0x348f('0xa')]({'raw':_0x31feb7[_0x348f('0xb')]?_0x31feb7[_0x348f('0xb')]['raw']===undefined?!![]:![]:!![],'where':_0x31feb7[_0x348f('0xb')]?_0x31feb7[_0x348f('0xb')][_0x348f('0xc')]||null:null,'attributes':_0x31feb7[_0x348f('0xb')]?_0x31feb7[_0x348f('0xb')][_0x348f('0xd')]||null:null,'limit':_0x31feb7[_0x348f('0xb')]?_0x31feb7[_0x348f('0xb')]['limit']||null:null,'include':_0x31feb7[_0x348f('0xb')]?_0x31feb7[_0x348f('0xb')][_0x348f('0xe')]?_['map'](_0x31feb7[_0x348f('0xb')]['include'],function(_0x8e9c56){return{'model':db[_0x8e9c56[_0x348f('0xf')]],'as':_0x8e9c56['as'],'attributes':_0x8e9c56[_0x348f('0xd')],'include':_0x8e9c56[_0x348f('0xe')]?_[_0x348f('0x10')](_0x8e9c56[_0x348f('0xe')],function(_0xff3b55){return{'model':db[_0xff3b55[_0x348f('0xf')]],'as':_0xff3b55['as'],'attributes':_0xff3b55[_0x348f('0xd')],'include':_0xff3b55['include']?_['map'](_0xff3b55[_0x348f('0xe')],function(_0x4b80e4){return{'model':db[_0x4b80e4[_0x348f('0xf')]],'as':_0x4b80e4['as'],'attributes':_0x4b80e4['attributes']};}):[]};}):[]};}):[]:[]})[_0x348f('0x11')](function(_0x5625cf){logger[_0x348f('0x12')](_0x348f('0x8'),_0x31feb7);logger[_0x348f('0x13')]('GetSquareProjects',_0x31feb7,JSON[_0x348f('0x14')](_0x5625cf));_0x3d0cbf(_0x5625cf);})[_0x348f('0x15')](function(_0x3b9629){logger['error']('GetSquareProjects',_0x3b9629[_0x348f('0x16')],_0x31feb7);_0x240ffd(_0x2cc146[_0x348f('0x17')](0x1f4,_0x3b9629[_0x348f('0x16')]));});});};exports[_0x348f('0x18')]=function(_0x1a6fed){var _0x2333ea=this;return new Promise(function(_0x205f10,_0x2b4e19){return db[_0x348f('0x9')][_0x348f('0x19')]({'raw':_0x1a6fed['options']?_0x1a6fed[_0x348f('0xb')][_0x348f('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a6fed[_0x348f('0xb')]?_0x1a6fed['options'][_0x348f('0xc')]||null:null,'attributes':_0x1a6fed[_0x348f('0xb')]?_0x1a6fed[_0x348f('0xb')][_0x348f('0xd')]||null:null,'include':_0x1a6fed[_0x348f('0xb')]?_0x1a6fed[_0x348f('0xb')][_0x348f('0xe')]?_['map'](_0x1a6fed['options'][_0x348f('0xe')],function(_0x47c79a){return{'model':db[_0x47c79a[_0x348f('0xf')]],'as':_0x47c79a['as'],'attributes':_0x47c79a[_0x348f('0xd')],'include':_0x47c79a[_0x348f('0xe')]?_['map'](_0x47c79a[_0x348f('0xe')],function(_0x204838){return{'model':db[_0x204838['model']],'as':_0x204838['as'],'attributes':_0x204838[_0x348f('0xd')],'include':_0x204838[_0x348f('0xe')]?_[_0x348f('0x10')](_0x204838[_0x348f('0xe')],function(_0x4e1af3){return{'model':db[_0x4e1af3['model']],'as':_0x4e1af3['as'],'attributes':_0x4e1af3[_0x348f('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56f656){logger[_0x348f('0x12')]('ShowSquareProject',_0x1a6fed);logger['debug'](_0x348f('0x18'),_0x1a6fed,JSON[_0x348f('0x14')](_0x56f656));_0x205f10(_0x56f656);})['catch'](function(_0x3a1e74){logger['error'](_0x348f('0x18'),_0x3a1e74['message'],_0x1a6fed);_0x2b4e19(_0x2333ea['error'](0x1f4,_0x3a1e74[_0x348f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 68ad9a0..d9281db 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 _0x2d4e=['removeListener','length','save','remove','emit'];(function(_0x1d2972,_0x52cc29){var _0x3bf673=function(_0x2d682e){while(--_0x2d682e){_0x1d2972['push'](_0x1d2972['shift']());}};_0x3bf673(++_0x52cc29);}(_0x2d4e,0x16a));var _0xe2d4=function(_0x55988a,_0xafecad){_0x55988a=_0x55988a-0x0;var _0x767db5=_0x2d4e[_0x55988a];return _0x767db5;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xe2d4('0x0'),_0xe2d4('0x1'),'update'];function createListener(_0x31b357,_0x2f3164){return function(_0x2ec688){_0x2f3164[_0xe2d4('0x2')](_0x31b357,_0x2ec688);};}function removeListener(_0x5871d2,_0x3a399c){return function(){SquareProjectEvents[_0xe2d4('0x3')](_0x5871d2,_0x3a399c);};}exports['register']=function(_0xa860fa){for(var _0x1c3240=0x0,_0x2b7037=events[_0xe2d4('0x4')];_0x1c3240<_0x2b7037;_0x1c3240++){var _0x45cea6=events[_0x1c3240];var _0x3ccc81=createListener('squareProject:'+_0x45cea6,_0xa860fa);SquareProjectEvents['on'](_0x45cea6,_0x3ccc81);}}; \ No newline at end of file +var _0xd3b9=['length','./squareProject.events','save','remove','update','emit','removeListener','register'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd3b9,0x109));var _0x9d3b=function(_0x400d58,_0x343289){_0x400d58=_0x400d58-0x0;var _0x53108d=_0xd3b9[_0x400d58];return _0x53108d;};'use strict';var SquareProjectEvents=require(_0x9d3b('0x0'));var events=[_0x9d3b('0x1'),_0x9d3b('0x2'),_0x9d3b('0x3')];function createListener(_0x240948,_0x5cddda){return function(_0x413654){_0x5cddda[_0x9d3b('0x4')](_0x240948,_0x413654);};}function removeListener(_0x359eba,_0x3ddf4b){return function(){SquareProjectEvents[_0x9d3b('0x5')](_0x359eba,_0x3ddf4b);};}exports[_0x9d3b('0x6')]=function(_0x218650){for(var _0x367fdd=0x0,_0x5f1573=events[_0x9d3b('0x7')];_0x367fdd<_0x5f1573;_0x367fdd++){var _0x5911c5=events[_0x367fdd];var _0x337db1=createListener('squareProject:'+_0x5911c5,_0x218650);SquareProjectEvents['on'](_0x5911c5,_0x337db1);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index dc95327..97554de 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 _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(_0x5806f7,_0x415618){var _0x2ef419=function(_0x252424){while(--_0x252424){_0x5806f7['push'](_0x5806f7['shift']());}};_0x2ef419(++_0x415618);}(_0x326f,0xd1));var _0xf326=function(_0x223348,_0x2649dd){_0x223348=_0x223348-0x0;var _0x3f88de=_0x326f[_0x223348];return _0x3f88de;};'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 +var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2d884b,_0x527937){var _0x5aa715=function(_0x3cf298){while(--_0x3cf298){_0x2d884b['push'](_0x2d884b['shift']());}};_0x5aa715(++_0x527937);}(_0xabce,0x103));var _0xeabc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xabce[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 53944f0..0723bd7 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 _0x7c09=['exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x53f942,_0x446013){var _0x36fc9d=function(_0xdb0406){while(--_0xdb0406){_0x53f942['push'](_0x53f942['shift']());}};_0x36fc9d(++_0x446013);}(_0x7c09,0x102));var _0x97c0=function(_0x29deae,_0x49989c){_0x29deae=_0x29deae-0x0;var _0x56517f=_0x7c09[_0x29deae];return _0x56517f;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'uniqueid':{'type':Sequelize[_0x97c0('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97c0('0x1')]},'context':{'type':Sequelize[_0x97c0('0x1')]},'extension':{'type':Sequelize[_0x97c0('0x1')]},'priority':{'type':Sequelize[_0x97c0('0x1')]},'accountcode':{'type':Sequelize[_0x97c0('0x1')]},'dnid':{'type':Sequelize[_0x97c0('0x1')]},'projectName':{'type':Sequelize[_0x97c0('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x97c0('0x2')],'get':function(){var _0x42c6c7='';var _0x2c19fa=this[_0x97c0('0x3')](_0x97c0('0x4'));if(_0x2c19fa){_0x42c6c7=_0x2c19fa['substring'](_0x2c19fa[_0x97c0('0x5')]('.'));}return _0x42c6c7;}}}; \ No newline at end of file +var _0xee14=['VIRTUAL','getDataValue','savePath','substring','STRING'];(function(_0x5cb945,_0x341379){var _0x5b01ed=function(_0x4163da){while(--_0x4163da){_0x5cb945['push'](_0x5cb945['shift']());}};_0x5b01ed(++_0x341379);}(_0xee14,0x13a));var _0x4ee1=function(_0x5a35d3,_0x52ae68){_0x5a35d3=_0x5a35d3-0x0;var _0x4a0bd8=_0xee14[_0x5a35d3];return _0x4a0bd8;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'callerid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'extension':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'dnid':{'type':Sequelize[_0x4ee1('0x0')]},'projectName':{'type':Sequelize[_0x4ee1('0x0')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4ee1('0x0')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4ee1('0x1')],'get':function(){var _0x3a45a3='';var _0x187656=this[_0x4ee1('0x2')](_0x4ee1('0x3'));if(_0x187656){_0x3a45a3=_0x187656[_0x4ee1('0x4')](_0x187656['lastIndexOf']('.'));}return _0x3a45a3;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 773569c..34af936 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 _0xb45d=['rimraf','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','SquareRecording','rawAttributes','fieldName','type','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','../../components/encryptor','uniqueid','savePath','format','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb45d,0x170));var _0xdb45=function(_0x508685,_0x9f94af){_0x508685=_0x508685-0x0;var _0x976a76=_0xb45d[_0x508685];return _0x976a76;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb45('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdb45('0x1'));var util=require('util');var path=require(_0xdb45('0x2'));var sox=require(_0xdb45('0x3'));var csv=require(_0xdb45('0x4'));var ejs=require(_0xdb45('0x5'));var fs=require('fs');var fs_extra=require(_0xdb45('0x6'));var _=require(_0xdb45('0x7'));var squel=require(_0xdb45('0x8'));var crypto=require(_0xdb45('0x9'));var jsforce=require(_0xdb45('0xa'));var deskjs=require(_0xdb45('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdb45('0xc'));var authService=require(_0xdb45('0xd'));var qs=require(_0xdb45('0xe'));var as=require(_0xdb45('0xf'));var hardwareService=require(_0xdb45('0x10'));var logger=require(_0xdb45('0x11'))(_0xdb45('0x12'));var utils=require(_0xdb45('0x13'));var config=require(_0xdb45('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb45('0x15'))['db'];function respondWithStatusCode(_0xb49c41,_0x5b88e4){_0x5b88e4=_0x5b88e4||0xcc;return function(_0xea30f6){if(_0xea30f6){return _0xb49c41['sendStatus'](_0x5b88e4);}return _0xb49c41[_0xdb45('0x16')](_0x5b88e4)['end']();};}function respondWithResult(_0x587f12,_0x302378){_0x302378=_0x302378||0xc8;return function(_0x8bfa59){if(_0x8bfa59){return _0x587f12[_0xdb45('0x16')](_0x302378)[_0xdb45('0x17')](_0x8bfa59);}};}function respondWithFilteredResult(_0x19942a,_0x90dff5){return function(_0x37ca4c){if(_0x37ca4c){var _0x5841d9=typeof _0x90dff5['offset']===_0xdb45('0x18')&&typeof _0x90dff5[_0xdb45('0x19')]==='undefined';var _0x4d65c5=_0x37ca4c['count'];var _0x42c1dd=_0x5841d9?0x0:_0x90dff5[_0xdb45('0x1a')];var _0x5b5017=_0x5841d9?_0x37ca4c[_0xdb45('0x1b')]:_0x90dff5[_0xdb45('0x1a')]+_0x90dff5['limit'];var _0x8b1cb4;if(_0x5b5017>=_0x4d65c5){_0x5b5017=_0x4d65c5;_0x8b1cb4=0xc8;}else{_0x8b1cb4=0xce;}_0x19942a[_0xdb45('0x16')](_0x8b1cb4);return _0x19942a[_0xdb45('0x1c')]('Content-Range',_0x42c1dd+'-'+_0x5b5017+'/'+_0x4d65c5)['json'](_0x37ca4c);}return null;};}function patchUpdates(_0x2f7c35){return function(_0x377ee1){try{jsonpatch[_0xdb45('0x1d')](_0x377ee1,_0x2f7c35,!![]);}catch(_0x2f320e){return BPromise[_0xdb45('0x1e')](_0x2f320e);}return _0x377ee1[_0xdb45('0x1f')]();};}function saveUpdates(_0x2ec2f6,_0x380b10){return function(_0x185e5f){if(_0x185e5f){return _0x185e5f[_0xdb45('0x20')](_0x2ec2f6)[_0xdb45('0x21')](function(_0x56d104){return _0x56d104;});}return null;};}function removeEntity(_0xca5b1,_0x1516af){return function(_0x287415){if(_0x287415){return _0x287415[_0xdb45('0x22')]()[_0xdb45('0x21')](function(){_0xca5b1[_0xdb45('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc5df3c,_0x39fada){return function(_0x59192e){if(!_0x59192e){_0xc5df3c[_0xdb45('0x23')](0x194);}return _0x59192e;};}function handleError(_0x382d3f,_0xa1614c){_0xa1614c=_0xa1614c||0x1f4;return function(_0x45b1ea){logger[_0xdb45('0x24')](_0x45b1ea[_0xdb45('0x25')]);if(_0x45b1ea[_0xdb45('0x26')]){delete _0x45b1ea[_0xdb45('0x26')];}_0x382d3f[_0xdb45('0x16')](_0xa1614c)['send'](_0x45b1ea);};}exports['index']=function(_0x298421,_0x4c3c43){var _0x5dd5c1={},_0x28f50b={},_0x1bd2cc={'count':0x0,'rows':[]};var _0xe32da=_['map'](db[_0xdb45('0x27')][_0xdb45('0x28')],function(_0x1c21c2){return{'name':_0x1c21c2[_0xdb45('0x29')],'type':_0x1c21c2[_0xdb45('0x2a')]['key']};});_0x28f50b['model']=_[_0xdb45('0x2b')](_0xe32da,_0xdb45('0x26'));_0x28f50b[_0xdb45('0x2c')]=_[_0xdb45('0x2d')](_0x298421[_0xdb45('0x2c')]);_0x28f50b['filters']=_['intersection'](_0x28f50b['model'],_0x28f50b[_0xdb45('0x2c')]);_0x5dd5c1['attributes']=_[_0xdb45('0x2e')](_0x28f50b[_0xdb45('0x2f')],qs['fields'](_0x298421['query'][_0xdb45('0x30')]));_0x5dd5c1[_0xdb45('0x31')]=_0x5dd5c1[_0xdb45('0x31')][_0xdb45('0x32')]?_0x5dd5c1['attributes']:_0x28f50b[_0xdb45('0x2f')];if(!_0x298421[_0xdb45('0x2c')][_0xdb45('0x33')](_0xdb45('0x34'))){_0x5dd5c1[_0xdb45('0x19')]=qs[_0xdb45('0x19')](_0x298421[_0xdb45('0x2c')]['limit']);_0x5dd5c1[_0xdb45('0x1a')]=qs['offset'](_0x298421['query'][_0xdb45('0x1a')]);}_0x5dd5c1['order']=qs['sort'](_0x298421[_0xdb45('0x2c')][_0xdb45('0x35')]);_0x5dd5c1[_0xdb45('0x36')]=qs[_0xdb45('0x37')](_['pick'](_0x298421[_0xdb45('0x2c')],_0x28f50b[_0xdb45('0x37')]),_0xe32da);if(_0x298421[_0xdb45('0x2c')]['filter']){_0x5dd5c1['where']=_[_0xdb45('0x38')](_0x5dd5c1[_0xdb45('0x36')],{'$or':_[_0xdb45('0x2b')](_0xe32da,function(_0xfbcee2){if(_0xfbcee2[_0xdb45('0x2a')]!==_0xdb45('0x39')){var _0x2dfb8b={};_0x2dfb8b[_0xfbcee2[_0xdb45('0x26')]]={'$like':'%'+_0x298421[_0xdb45('0x2c')][_0xdb45('0x3a')]+'%'};return _0x2dfb8b;}})});}_0x5dd5c1=_[_0xdb45('0x38')]({},_0x5dd5c1,_0x298421[_0xdb45('0x3b')]);var _0x255fc9={'where':_0x5dd5c1[_0xdb45('0x36')]};return db[_0xdb45('0x27')]['count'](_0x255fc9)['then'](function(_0x2ec0a5){_0x1bd2cc['count']=_0x2ec0a5;if(_0x298421[_0xdb45('0x2c')][_0xdb45('0x3c')]){_0x5dd5c1[_0xdb45('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0xdb45('0x3e')](_0x5dd5c1);})['then'](function(_0xc3a1aa){_0x1bd2cc[_0xdb45('0x3f')]=_0xc3a1aa;return _0x1bd2cc;})[_0xdb45('0x21')](respondWithFilteredResult(_0x4c3c43,_0x5dd5c1))[_0xdb45('0x40')](handleError(_0x4c3c43,null));};exports['show']=function(_0x3bdef5,_0x3eafa3){var _0x9f83e1={'raw':!![],'where':{'id':_0x3bdef5[_0xdb45('0x41')]['id']}},_0x3631e0={};_0x3631e0[_0xdb45('0x2f')]=_[_0xdb45('0x2d')](db[_0xdb45('0x27')][_0xdb45('0x28')]);_0x3631e0[_0xdb45('0x2c')]=_['keys'](_0x3bdef5['query']);_0x3631e0['filters']=_['intersection'](_0x3631e0[_0xdb45('0x2f')],_0x3631e0['query']);_0x9f83e1[_0xdb45('0x31')]=_['intersection'](_0x3631e0[_0xdb45('0x2f')],qs['fields'](_0x3bdef5[_0xdb45('0x2c')][_0xdb45('0x30')]));_0x9f83e1[_0xdb45('0x31')]=_0x9f83e1[_0xdb45('0x31')][_0xdb45('0x32')]?_0x9f83e1[_0xdb45('0x31')]:_0x3631e0[_0xdb45('0x2f')];if(_0x3bdef5['query'][_0xdb45('0x3c')]){_0x9f83e1[_0xdb45('0x3d')]=[{'all':!![]}];}_0x9f83e1=_['merge']({},_0x9f83e1,_0x3bdef5[_0xdb45('0x3b')]);return db['SquareRecording'][_0xdb45('0x42')](_0x9f83e1)[_0xdb45('0x21')](handleEntityNotFound(_0x3eafa3,null))[_0xdb45('0x21')](respondWithResult(_0x3eafa3,null))['catch'](handleError(_0x3eafa3,null));};exports[_0xdb45('0x43')]=function(_0x4fce0a,_0x580f00){return db['SquareRecording']['create'](_0x4fce0a[_0xdb45('0x44')],{})[_0xdb45('0x21')](respondWithResult(_0x580f00,0xc9))['catch'](handleError(_0x580f00,null));};exports[_0xdb45('0x20')]=function(_0x2ca3b0,_0x282a53){if(_0x2ca3b0[_0xdb45('0x44')]['id']){delete _0x2ca3b0[_0xdb45('0x44')]['id'];}return db['SquareRecording'][_0xdb45('0x42')]({'where':{'id':_0x2ca3b0[_0xdb45('0x41')]['id']}})['then'](handleEntityNotFound(_0x282a53,null))[_0xdb45('0x21')](saveUpdates(_0x2ca3b0[_0xdb45('0x44')],null))[_0xdb45('0x21')](respondWithResult(_0x282a53,null))[_0xdb45('0x40')](handleError(_0x282a53,null));};exports['download']=function(_0x49fad2,_0x2efba1,_0x523126){var _0x39ac73=require(_0xdb45('0x45'));var _0xc56602=![];var _0x17f225={};if(_0x49fad2[_0xdb45('0x2c')][_0xdb45('0x2a')]&&_0x49fad2[_0xdb45('0x2c')][_0xdb45('0x2a')]===_0xdb45('0x46')){_0x17f225[_0xdb45('0x46')]=_0x49fad2[_0xdb45('0x41')]['id'];}else{_0x17f225['id']=_0x49fad2[_0xdb45('0x41')]['id'];}return db[_0xdb45('0x27')]['find']({'where':_0x17f225,'attributes':['id',_0xdb45('0x47'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x2efba1,null))[_0xdb45('0x21')](function(_0x2c3bca){if(_0x2c3bca){var _0x47e200=_0x2c3bca[_0xdb45('0x47')];var _0x3de066=util[_0xdb45('0x48')]('%s.cypher',_0x47e200);if(fs[_0xdb45('0x49')](_0x3de066)){_0xc56602=!![];return _0x39ac73['decryptFile'](_0x3de066,_0x47e200,config[_0xdb45('0x4a')][_0xdb45('0x4b')])['then'](function(){return _0x2c3bca;});}return _0x2c3bca;}})[_0xdb45('0x21')](function(_0x5c599b){if(_0x5c599b){var _0x9dd078=_0x5c599b[_0xdb45('0x47')];if(!fs['existsSync'](_0x9dd078)){throw new db[(_0xdb45('0x4c'))][(_0xdb45('0x4d'))](_0xdb45('0x4e'));}if(_0x5c599b[_0xdb45('0x4f')]){return _0x2efba1[_0xdb45('0x50')](_0x9dd078,_0x5c599b[_0xdb45('0x4f')]+path[_0xdb45('0x51')](_0x9dd078),function(){if(_0xc56602){fs[_0xdb45('0x52')](_0x9dd078);}});}else{return _0x2efba1[_0xdb45('0x50')](_0x9dd078,function(_0x295790){if(_0xc56602){fs[_0xdb45('0x52')](_0x9dd078);}});}}})[_0xdb45('0x40')](function(_0xab1799){if(_0xab1799['message']===_0xdb45('0x4e')){_0x2efba1[_0xdb45('0x16')](0x194)[_0xdb45('0x53')](_0xdb45('0x54'));}else{return handleError(_0x2efba1,null);}});};exports[_0xdb45('0x22')]=function(_0x316f89,_0x39edd3){return db[_0xdb45('0x27')][_0xdb45('0x42')]({'where':{'id':_0x316f89['params']['id']}})[_0xdb45('0x21')](function(_0x33ab23){if(_[_0xdb45('0x55')](_0x33ab23)){throw new ReferenceError(_0xdb45('0x56'));}return _0x33ab23;})['then'](function(_0x2ded9d){var _0x12945e=_0x2ded9d[_0xdb45('0x47')];logger[_0xdb45('0x57')](_0xdb45('0x58'),_0x12945e);if(!_['isNil'](_0x2ded9d[_0xdb45('0x47')])&&fs[_0xdb45('0x49')](_0x12945e)){logger[_0xdb45('0x57')](_0xdb45('0x59')+_0x12945e+_0xdb45('0x5a'));fs[_0xdb45('0x5b')](_0x12945e);}_0x12945e=_0x12945e+'.cypher';if(!_[_0xdb45('0x55')](_0x2ded9d[_0xdb45('0x47')])&&fs[_0xdb45('0x49')](_0x12945e)){logger['info']('File:\x20\x22'+_0x12945e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdb45('0x5b')](_0x12945e);}return _0x2ded9d;})[_0xdb45('0x21')](function(_0x56c158){if(!_0x56c158)throw new InternalError();return _0x56c158['destroy']();})[_0xdb45('0x21')](function(){_0x39edd3[_0xdb45('0x16')](0xcc)['end']();})[_0xdb45('0x40')](handleError(_0x39edd3,null));}; \ No newline at end of file +var _0xfe3f=['intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','SquareRecording','rawAttributes','key','map','keys','query','filters','model'];(function(_0x52bace,_0x532af6){var _0x244ac7=function(_0x4a7d88){while(--_0x4a7d88){_0x52bace['push'](_0x52bace['shift']());}};_0x244ac7(++_0x532af6);}(_0xfe3f,0xeb));var _0xffe3=function(_0x340a6c,_0x5a0a84){_0x340a6c=_0x340a6c-0x0;var _0x1113be=_0xfe3f[_0x340a6c];return _0x1113be;};'use strict';var emlformat=require(_0xffe3('0x0'));var rimraf=require(_0xffe3('0x1'));var zipdir=require(_0xffe3('0x2'));var jsonpatch=require(_0xffe3('0x3'));var rp=require(_0xffe3('0x4'));var moment=require(_0xffe3('0x5'));var BPromise=require(_0xffe3('0x6'));var Mustache=require(_0xffe3('0x7'));var util=require('util');var path=require(_0xffe3('0x8'));var sox=require(_0xffe3('0x9'));var csv=require(_0xffe3('0xa'));var ejs=require(_0xffe3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffe3('0xc'));var squel=require('squel');var crypto=require(_0xffe3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xffe3('0xe'));var toCsv=require(_0xffe3('0xa'));var querystring=require(_0xffe3('0xf'));var Papa=require(_0xffe3('0x10'));var Redis=require('ioredis');var authService=require(_0xffe3('0x11'));var qs=require(_0xffe3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xffe3('0x13'));var utils=require(_0xffe3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xffe3('0x15'));var db=require(_0xffe3('0x16'))['db'];function respondWithStatusCode(_0x2fbcb2,_0x18ab95){_0x18ab95=_0x18ab95||0xcc;return function(_0x18325b){if(_0x18325b){return _0x2fbcb2[_0xffe3('0x17')](_0x18ab95);}return _0x2fbcb2['status'](_0x18ab95)[_0xffe3('0x18')]();};}function respondWithResult(_0x1f25c3,_0x887f66){_0x887f66=_0x887f66||0xc8;return function(_0x26f2f8){if(_0x26f2f8){return _0x1f25c3[_0xffe3('0x19')](_0x887f66)['json'](_0x26f2f8);}};}function respondWithFilteredResult(_0x515637,_0x11cd1e){return function(_0x13f5fe){if(_0x13f5fe){var _0x3efc26=typeof _0x11cd1e[_0xffe3('0x1a')]===_0xffe3('0x1b')&&typeof _0x11cd1e[_0xffe3('0x1c')]===_0xffe3('0x1b');var _0x196f52=_0x13f5fe[_0xffe3('0x1d')];var _0x1dbc53=_0x3efc26?0x0:_0x11cd1e[_0xffe3('0x1a')];var _0x3c690c=_0x3efc26?_0x13f5fe['count']:_0x11cd1e[_0xffe3('0x1a')]+_0x11cd1e['limit'];var _0x111c4d;if(_0x3c690c>=_0x196f52){_0x3c690c=_0x196f52;_0x111c4d=0xc8;}else{_0x111c4d=0xce;}_0x515637[_0xffe3('0x19')](_0x111c4d);return _0x515637[_0xffe3('0x1e')](_0xffe3('0x1f'),_0x1dbc53+'-'+_0x3c690c+'/'+_0x196f52)[_0xffe3('0x20')](_0x13f5fe);}return null;};}function patchUpdates(_0x3e8585){return function(_0x38d5c3){try{jsonpatch[_0xffe3('0x21')](_0x38d5c3,_0x3e8585,!![]);}catch(_0xcf54f){return BPromise[_0xffe3('0x22')](_0xcf54f);}return _0x38d5c3[_0xffe3('0x23')]();};}function saveUpdates(_0x2e2a62,_0x4c878d){return function(_0x53b1f3){if(_0x53b1f3){return _0x53b1f3[_0xffe3('0x24')](_0x2e2a62)[_0xffe3('0x25')](function(_0x1d8f9b){return _0x1d8f9b;});}return null;};}function removeEntity(_0x166d60,_0x29ab48){return function(_0x17719e){if(_0x17719e){return _0x17719e['destroy']()[_0xffe3('0x25')](function(){_0x166d60[_0xffe3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d809a,_0x2dfdb7){return function(_0x137fd0){if(!_0x137fd0){_0x3d809a[_0xffe3('0x17')](0x194);}return _0x137fd0;};}function handleError(_0x47632b,_0x3ac0ac){_0x3ac0ac=_0x3ac0ac||0x1f4;return function(_0x156b23){logger['error'](_0x156b23[_0xffe3('0x26')]);if(_0x156b23['name']){delete _0x156b23[_0xffe3('0x27')];}_0x47632b['status'](_0x3ac0ac)[_0xffe3('0x28')](_0x156b23);};}exports[_0xffe3('0x29')]=function(_0xff42b,_0xe0ab8e){var _0x1fbf21={},_0x21534d={},_0x322c79={'count':0x0,'rows':[]};var _0x22287f=_['map'](db[_0xffe3('0x2a')][_0xffe3('0x2b')],function(_0x51a0a1){return{'name':_0x51a0a1['fieldName'],'type':_0x51a0a1['type'][_0xffe3('0x2c')]};});_0x21534d['model']=_[_0xffe3('0x2d')](_0x22287f,_0xffe3('0x27'));_0x21534d['query']=_[_0xffe3('0x2e')](_0xff42b[_0xffe3('0x2f')]);_0x21534d[_0xffe3('0x30')]=_['intersection'](_0x21534d[_0xffe3('0x31')],_0x21534d['query']);_0x1fbf21['attributes']=_[_0xffe3('0x32')](_0x21534d[_0xffe3('0x31')],qs[_0xffe3('0x33')](_0xff42b[_0xffe3('0x2f')]['fields']));_0x1fbf21[_0xffe3('0x34')]=_0x1fbf21['attributes'][_0xffe3('0x35')]?_0x1fbf21[_0xffe3('0x34')]:_0x21534d[_0xffe3('0x31')];if(!_0xff42b['query']['hasOwnProperty'](_0xffe3('0x36'))){_0x1fbf21[_0xffe3('0x1c')]=qs[_0xffe3('0x1c')](_0xff42b['query']['limit']);_0x1fbf21[_0xffe3('0x1a')]=qs[_0xffe3('0x1a')](_0xff42b[_0xffe3('0x2f')][_0xffe3('0x1a')]);}_0x1fbf21[_0xffe3('0x37')]=qs['sort'](_0xff42b[_0xffe3('0x2f')][_0xffe3('0x38')]);_0x1fbf21[_0xffe3('0x39')]=qs[_0xffe3('0x30')](_[_0xffe3('0x3a')](_0xff42b['query'],_0x21534d[_0xffe3('0x30')]),_0x22287f);if(_0xff42b['query'][_0xffe3('0x3b')]){_0x1fbf21[_0xffe3('0x39')]=_['merge'](_0x1fbf21[_0xffe3('0x39')],{'$or':_[_0xffe3('0x2d')](_0x22287f,function(_0x579905){if(_0x579905[_0xffe3('0x3c')]!==_0xffe3('0x3d')){var _0x294e85={};_0x294e85[_0x579905['name']]={'$like':'%'+_0xff42b[_0xffe3('0x2f')][_0xffe3('0x3b')]+'%'};return _0x294e85;}})});}_0x1fbf21=_[_0xffe3('0x3e')]({},_0x1fbf21,_0xff42b[_0xffe3('0x3f')]);var _0x51f90f={'where':_0x1fbf21[_0xffe3('0x39')]};return db[_0xffe3('0x2a')][_0xffe3('0x1d')](_0x51f90f)[_0xffe3('0x25')](function(_0x1f9a32){_0x322c79[_0xffe3('0x1d')]=_0x1f9a32;if(_0xff42b['query'][_0xffe3('0x40')]){_0x1fbf21[_0xffe3('0x41')]=[{'all':!![]}];}return db[_0xffe3('0x2a')]['findAll'](_0x1fbf21);})[_0xffe3('0x25')](function(_0x19353e){_0x322c79[_0xffe3('0x42')]=_0x19353e;return _0x322c79;})[_0xffe3('0x25')](respondWithFilteredResult(_0xe0ab8e,_0x1fbf21))[_0xffe3('0x43')](handleError(_0xe0ab8e,null));};exports[_0xffe3('0x44')]=function(_0x47594b,_0x20c89f){var _0x1a4f21={'raw':!![],'where':{'id':_0x47594b[_0xffe3('0x45')]['id']}},_0x67d3b5={};_0x67d3b5[_0xffe3('0x31')]=_['keys'](db['SquareRecording'][_0xffe3('0x2b')]);_0x67d3b5['query']=_[_0xffe3('0x2e')](_0x47594b[_0xffe3('0x2f')]);_0x67d3b5[_0xffe3('0x30')]=_['intersection'](_0x67d3b5[_0xffe3('0x31')],_0x67d3b5['query']);_0x1a4f21[_0xffe3('0x34')]=_[_0xffe3('0x32')](_0x67d3b5[_0xffe3('0x31')],qs[_0xffe3('0x33')](_0x47594b[_0xffe3('0x2f')]['fields']));_0x1a4f21['attributes']=_0x1a4f21[_0xffe3('0x34')][_0xffe3('0x35')]?_0x1a4f21[_0xffe3('0x34')]:_0x67d3b5['model'];if(_0x47594b[_0xffe3('0x2f')][_0xffe3('0x40')]){_0x1a4f21[_0xffe3('0x41')]=[{'all':!![]}];}_0x1a4f21=_[_0xffe3('0x3e')]({},_0x1a4f21,_0x47594b[_0xffe3('0x3f')]);return db[_0xffe3('0x2a')][_0xffe3('0x46')](_0x1a4f21)[_0xffe3('0x25')](handleEntityNotFound(_0x20c89f,null))['then'](respondWithResult(_0x20c89f,null))[_0xffe3('0x43')](handleError(_0x20c89f,null));};exports[_0xffe3('0x47')]=function(_0x45c0c0,_0x397d66){return db[_0xffe3('0x2a')][_0xffe3('0x47')](_0x45c0c0[_0xffe3('0x48')],{})[_0xffe3('0x25')](respondWithResult(_0x397d66,0xc9))[_0xffe3('0x43')](handleError(_0x397d66,null));};exports[_0xffe3('0x24')]=function(_0x51c48f,_0x4e3bfd){if(_0x51c48f[_0xffe3('0x48')]['id']){delete _0x51c48f[_0xffe3('0x48')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x51c48f[_0xffe3('0x45')]['id']}})[_0xffe3('0x25')](handleEntityNotFound(_0x4e3bfd,null))['then'](saveUpdates(_0x51c48f[_0xffe3('0x48')],null))[_0xffe3('0x25')](respondWithResult(_0x4e3bfd,null))[_0xffe3('0x43')](handleError(_0x4e3bfd,null));};exports[_0xffe3('0x49')]=function(_0x2ca115,_0x424730,_0x178d5a){var _0x5bb034=require(_0xffe3('0x4a'));var _0x5c2ff6=![];var _0x2f4827={};if(_0x2ca115[_0xffe3('0x2f')]['type']&&_0x2ca115['query']['type']===_0xffe3('0x4b')){_0x2f4827[_0xffe3('0x4b')]=_0x2ca115[_0xffe3('0x45')]['id'];}else{_0x2f4827['id']=_0x2ca115[_0xffe3('0x45')]['id'];}return db[_0xffe3('0x2a')]['find']({'where':_0x2f4827,'attributes':['id',_0xffe3('0x4c'),_0xffe3('0x4d')],'raw':!![]})[_0xffe3('0x25')](handleEntityNotFound(_0x424730,null))['then'](function(_0x254775){if(_0x254775){var _0x12e381=_0x254775[_0xffe3('0x4c')];var _0x757c9c=util[_0xffe3('0x4e')]('%s.cypher',_0x12e381);if(fs[_0xffe3('0x4f')](_0x757c9c)){_0x5c2ff6=!![];return _0x5bb034[_0xffe3('0x50')](_0x757c9c,_0x12e381,config['secrets'][_0xffe3('0x51')])[_0xffe3('0x25')](function(){return _0x254775;});}return _0x254775;}})[_0xffe3('0x25')](function(_0x37c2a2){if(_0x37c2a2){var _0xa5e51=_0x37c2a2['savePath'];if(!fs['existsSync'](_0xa5e51)){throw new db[(_0xffe3('0x52'))][(_0xffe3('0x53'))](_0xffe3('0x54'));}if(_0x37c2a2[_0xffe3('0x4d')]){return _0x424730[_0xffe3('0x49')](_0xa5e51,_0x37c2a2[_0xffe3('0x4d')]+path['extname'](_0xa5e51),function(){if(_0x5c2ff6){fs[_0xffe3('0x55')](_0xa5e51);}});}else{return _0x424730[_0xffe3('0x49')](_0xa5e51,function(_0x3ba020){if(_0x5c2ff6){fs['unlink'](_0xa5e51);}});}}})['catch'](function(_0x2028a7){if(_0x2028a7['message']==='SquareRecording\x20not\x20found'){_0x424730['status'](0x194)['send'](_0xffe3('0x56'));}else{return handleError(_0x424730,null);}});};exports[_0xffe3('0x57')]=function(_0x4bd2d2,_0x28b779){return db[_0xffe3('0x2a')][_0xffe3('0x46')]({'where':{'id':_0x4bd2d2['params']['id']}})['then'](function(_0x11e4e1){if(_[_0xffe3('0x58')](_0x11e4e1)){throw new ReferenceError(_0xffe3('0x59'));}return _0x11e4e1;})[_0xffe3('0x25')](function(_0x67dcb0){var _0x3f1ee2=_0x67dcb0[_0xffe3('0x4c')];logger[_0xffe3('0x5a')](_0xffe3('0x5b'),_0x3f1ee2);if(!_[_0xffe3('0x58')](_0x67dcb0[_0xffe3('0x4c')])&&fs['existsSync'](_0x3f1ee2)){logger[_0xffe3('0x5a')]('File:\x20\x22'+_0x3f1ee2+_0xffe3('0x5c'));fs[_0xffe3('0x5d')](_0x3f1ee2);}_0x3f1ee2=_0x3f1ee2+_0xffe3('0x5e');if(!_[_0xffe3('0x58')](_0x67dcb0[_0xffe3('0x4c')])&&fs[_0xffe3('0x4f')](_0x3f1ee2)){logger[_0xffe3('0x5a')]('File:\x20\x22'+_0x3f1ee2+_0xffe3('0x5c'));fs[_0xffe3('0x5d')](_0x3f1ee2);}return _0x67dcb0;})[_0xffe3('0x25')](function(_0x1dc9b2){if(!_0x1dc9b2)throw new InternalError();return _0x1dc9b2['destroy']();})[_0xffe3('0x25')](function(){_0x28b779[_0xffe3('0x19')](0xcc)[_0xffe3('0x18')]();})[_0xffe3('0x43')](handleError(_0x28b779,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 20d4505..1bff178 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 _0xf722=['exports','SquareRecording','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareRecording.attributes'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0xf722,0x18f));var _0x2f72=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf722[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x2f72('0x0'));var util=require(_0x2f72('0x1'));var logger=require(_0x2f72('0x2'))(_0x2f72('0x3'));var moment=require('moment');var BPromise=require(_0x2f72('0x4'));var rp=require(_0x2f72('0x5'));var fs=require('fs');var path=require(_0x2f72('0x6'));var rimraf=require(_0x2f72('0x7'));var config=require('../../config/environment');var attributes=require(_0x2f72('0x8'));module[_0x2f72('0x9')]=function(_0x334168,_0x537e3d){return _0x334168['define'](_0x2f72('0xa'),attributes,{'tableName':_0x2f72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf981=['exports','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareRecording.attributes'];(function(_0x28bc34,_0x5dabd2){var _0x87b2e3=function(_0x26ef09){while(--_0x26ef09){_0x28bc34['push'](_0x28bc34['shift']());}};_0x87b2e3(++_0x5dabd2);}(_0xf981,0xe6));var _0x1f98=function(_0x1a267d,_0x24dbe9){_0x1a267d=_0x1a267d-0x0;var _0x2fd328=_0xf981[_0x1a267d];return _0x2fd328;};'use strict';var _=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var logger=require(_0x1f98('0x2'))(_0x1f98('0x3'));var moment=require(_0x1f98('0x4'));var BPromise=require(_0x1f98('0x5'));var rp=require(_0x1f98('0x6'));var fs=require('fs');var path=require(_0x1f98('0x7'));var rimraf=require('rimraf');var config=require(_0x1f98('0x8'));var attributes=require(_0x1f98('0x9'));module[_0x1f98('0xa')]=function(_0x14bb19,_0x285cdc){return _0x14bb19['define']('SquareRecording',attributes,{'tableName':_0x1f98('0xb'),'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 95745f6..60e2a1e 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 _0x3a36=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','CreateSquareRecording','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3a36,0x7e));var _0x63a3=function(_0x300c32,_0x48825a){_0x300c32=_0x300c32-0x0;var _0x35f657=_0x3a36[_0x300c32];return _0x35f657;};'use strict';var _=require('lodash');var util=require(_0x63a3('0x0'));var moment=require(_0x63a3('0x1'));var BPromise=require(_0x63a3('0x2'));var rs=require(_0x63a3('0x3'));var fs=require('fs');var Redis=require(_0x63a3('0x4'));var db=require(_0x63a3('0x5'))['db'];var utils=require(_0x63a3('0x6'));var logger=require('../../config/logger')(_0x63a3('0x7'));var config=require(_0x63a3('0x8'));var jayson=require(_0x63a3('0x9'));var client=jayson[_0x63a3('0xa')][_0x63a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7ff20a,_0x9d93e,_0x71296d){return new BPromise(function(_0x53c548,_0x2d783a){return client['request'](_0x7ff20a,_0x71296d)[_0x63a3('0xc')](function(_0xeb6367){logger[_0x63a3('0xd')](_0x63a3('0xe'),_0x9d93e,_0x63a3('0xf'));logger[_0x63a3('0x10')](_0x63a3('0x11'),_0x9d93e,_0x63a3('0xf'),JSON[_0x63a3('0x12')](_0xeb6367));if(_0xeb6367[_0x63a3('0x13')]){if(_0xeb6367['error'][_0x63a3('0x14')]===0x1f4){logger[_0x63a3('0x13')](_0x63a3('0xe'),_0x9d93e,_0xeb6367['error'][_0x63a3('0x15')]);return _0x2d783a(_0xeb6367[_0x63a3('0x13')][_0x63a3('0x15')]);}logger[_0x63a3('0x13')]('SquareRecording,\x20%s,\x20%s',_0x9d93e,_0xeb6367['error'][_0x63a3('0x15')]);return _0x53c548(_0xeb6367[_0x63a3('0x13')]['message']);}else{logger[_0x63a3('0xd')](_0x63a3('0xe'),_0x9d93e,'request\x20sent');_0x53c548(_0xeb6367[_0x63a3('0x16')][_0x63a3('0x15')]);}})[_0x63a3('0x17')](function(_0x245c84){logger['error']('SquareRecording,\x20%s,\x20%s',_0x9d93e,_0x245c84);_0x2d783a(_0x245c84);});});}exports['CreateSquareRecording']=function(_0x1dd1f4){var _0xdd1e95=this;return new Promise(function(_0x20323e,_0x2d22c5){return db['SquareRecording'][_0x63a3('0x18')](_0x1dd1f4[_0x63a3('0x19')],{'raw':_0x1dd1f4[_0x63a3('0x1a')]?_0x1dd1f4[_0x63a3('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x63a3('0xc')](function(_0xb45b6b){logger['info'](_0x63a3('0x1b'),_0x1dd1f4);logger[_0x63a3('0x10')](_0x63a3('0x1b'),_0x1dd1f4,JSON[_0x63a3('0x12')](_0xb45b6b));_0x20323e(_0xb45b6b);})[_0x63a3('0x17')](function(_0xd62d65){logger[_0x63a3('0x13')](_0x63a3('0x1b'),_0xd62d65[_0x63a3('0x15')],_0x1dd1f4);_0x2d22c5(_0xdd1e95['error'](0x1f4,_0xd62d65[_0x63a3('0x15')]));});});}; \ No newline at end of file +var _0x6de3=['rpc','../../config/environment','jayson/promise','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','body','options','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4d7241,_0x32aa1f){var _0x59d9e2=function(_0x30e273){while(--_0x30e273){_0x4d7241['push'](_0x4d7241['shift']());}};_0x59d9e2(++_0x32aa1f);}(_0x6de3,0x14c));var _0x36de=function(_0x507534,_0x5372ab){_0x507534=_0x507534-0x0;var _0x363749=_0x6de3[_0x507534];return _0x363749;};'use strict';var _=require(_0x36de('0x0'));var util=require('util');var moment=require(_0x36de('0x1'));var BPromise=require('bluebird');var rs=require(_0x36de('0x2'));var fs=require('fs');var Redis=require(_0x36de('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x36de('0x4'));var logger=require(_0x36de('0x5'))(_0x36de('0x6'));var config=require(_0x36de('0x7'));var jayson=require(_0x36de('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x595f2b,_0x2e36d6,_0x58caa1){return new BPromise(function(_0x2fa361,_0xea763e){return client[_0x36de('0x9')](_0x595f2b,_0x58caa1)[_0x36de('0xa')](function(_0xec2484){logger[_0x36de('0xb')](_0x36de('0xc'),_0x2e36d6,'request\x20sent');logger[_0x36de('0xd')](_0x36de('0xe'),_0x2e36d6,'request\x20sent',JSON[_0x36de('0xf')](_0xec2484));if(_0xec2484[_0x36de('0x10')]){if(_0xec2484[_0x36de('0x10')]['code']===0x1f4){logger['error'](_0x36de('0xc'),_0x2e36d6,_0xec2484[_0x36de('0x10')][_0x36de('0x11')]);return _0xea763e(_0xec2484[_0x36de('0x10')][_0x36de('0x11')]);}logger[_0x36de('0x10')](_0x36de('0xc'),_0x2e36d6,_0xec2484['error']['message']);return _0x2fa361(_0xec2484['error'][_0x36de('0x11')]);}else{logger[_0x36de('0xb')]('SquareRecording,\x20%s,\x20%s',_0x2e36d6,_0x36de('0x12'));_0x2fa361(_0xec2484[_0x36de('0x13')][_0x36de('0x11')]);}})[_0x36de('0x14')](function(_0x46cdee){logger[_0x36de('0x10')]('SquareRecording,\x20%s,\x20%s',_0x2e36d6,_0x46cdee);_0xea763e(_0x46cdee);});});}exports[_0x36de('0x15')]=function(_0x9ac554){var _0x500c97=this;return new Promise(function(_0x38a4f4,_0x481a38){return db[_0x36de('0x16')][_0x36de('0x17')](_0x9ac554[_0x36de('0x18')],{'raw':_0x9ac554[_0x36de('0x19')]?_0x9ac554[_0x36de('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x36de('0xa')](function(_0x4ddce9){logger['info'](_0x36de('0x15'),_0x9ac554);logger[_0x36de('0xd')](_0x36de('0x15'),_0x9ac554,JSON[_0x36de('0xf')](_0x4ddce9));_0x38a4f4(_0x4ddce9);})['catch'](function(_0x37ca99){logger[_0x36de('0x10')](_0x36de('0x15'),_0x37ca99[_0x36de('0x11')],_0x9ac554);_0x481a38(_0x500c97[_0x36de('0x10')](0x1f4,_0x37ca99[_0x36de('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 4c4709d..7542b3b 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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xe42d46,_0x2b57ac){var _0x51edae=function(_0x541540){while(--_0x541540){_0xe42d46['push'](_0xe42d46['shift']());}};_0x51edae(++_0x2b57ac);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b26c5,_0x547bea){_0x2b26c5=_0x2b26c5-0x0;var _0xfc7f7f=_0xb10b[_0x2b26c5];return _0xfc7f7f;};'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(_0x101176,_0x1ad975){var _0x4ec27c=function(_0x13b7bb){while(--_0x13b7bb){_0x101176['push'](_0x101176['shift']());}};_0x4ec27c(++_0x1ad975);}(_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 39c3bec..a7123e1 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 _0xe1fc=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x3cadf3,_0xdfacc8){var _0x353c17=function(_0x18b43b){while(--_0x18b43b){_0x3cadf3['push'](_0x3cadf3['shift']());}};_0x353c17(++_0xdfacc8);}(_0xe1fc,0x1e3));var _0xce1f=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xe1fc[_0x5d9867];return _0x7d2118;};'use strict';var Sequelize=require(_0xce1f('0x0'));module['exports']={'network':{'type':Sequelize[_0xce1f('0x1')]},'network_script':{'type':Sequelize[_0xce1f('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xce1f('0x1')]},'language':{'type':Sequelize[_0xce1f('0x1')]},'type':{'type':Sequelize[_0xce1f('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xce1f('0x1')]},'callerid':{'type':Sequelize[_0xce1f('0x1')]},'calleridname':{'type':Sequelize[_0xce1f('0x1')]},'callingpres':{'type':Sequelize[_0xce1f('0x1')]},'callingani2':{'type':Sequelize[_0xce1f('0x1')]},'callington':{'type':Sequelize[_0xce1f('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xce1f('0x1')]},'extension':{'type':Sequelize[_0xce1f('0x1')]},'priority':{'type':Sequelize[_0xce1f('0x1')]},'enhanced':{'type':Sequelize[_0xce1f('0x1')]},'accountcode':{'type':Sequelize[_0xce1f('0x1')]},'threadid':{'type':Sequelize[_0xce1f('0x1')]},'project_name':{'type':Sequelize[_0xce1f('0x1')]},'joinAt':{'type':Sequelize[_0xce1f('0x2')]},'leaveAt':{'type':Sequelize[_0xce1f('0x2')]},'bot':{'type':Sequelize[_0xce1f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xa301=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x56756b,_0x3e8cc7){var _0xa3002=function(_0x5f1386){while(--_0x5f1386){_0x56756b['push'](_0x56756b['shift']());}};_0xa3002(++_0x3e8cc7);}(_0xa301,0xfb));var _0x1a30=function(_0x3a560b,_0x2977b7){_0x3a560b=_0x3a560b-0x0;var _0x165de0=_0xa301[_0x3a560b];return _0x165de0;};'use strict';var Sequelize=require(_0x1a30('0x0'));module[_0x1a30('0x1')]={'network':{'type':Sequelize[_0x1a30('0x2')]},'network_script':{'type':Sequelize[_0x1a30('0x2')]},'request':{'type':Sequelize[_0x1a30('0x2')]},'channel':{'type':Sequelize[_0x1a30('0x2')]},'language':{'type':Sequelize[_0x1a30('0x2')]},'type':{'type':Sequelize[_0x1a30('0x2')]},'uniqueid':{'type':Sequelize[_0x1a30('0x2')]},'version':{'type':Sequelize[_0x1a30('0x2')]},'callerid':{'type':Sequelize[_0x1a30('0x2')]},'calleridname':{'type':Sequelize[_0x1a30('0x2')]},'callingpres':{'type':Sequelize[_0x1a30('0x2')]},'callingani2':{'type':Sequelize[_0x1a30('0x2')]},'callington':{'type':Sequelize[_0x1a30('0x2')]},'callingtns':{'type':Sequelize[_0x1a30('0x2')]},'dnid':{'type':Sequelize[_0x1a30('0x2')]},'rdnis':{'type':Sequelize[_0x1a30('0x2')]},'context':{'type':Sequelize[_0x1a30('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1a30('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x1a30('0x2')]},'project_name':{'type':Sequelize[_0x1a30('0x2')]},'joinAt':{'type':Sequelize[_0x1a30('0x3')]},'leaveAt':{'type':Sequelize[_0x1a30('0x3')]},'bot':{'type':Sequelize[_0x1a30('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 5f07a5c..96ace0e 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 _0x7a9e=['destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','SquareReport','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then'];(function(_0xa77d31,_0x560507){var _0x1a6c6e=function(_0x38e70b){while(--_0x38e70b){_0xa77d31['push'](_0xa77d31['shift']());}};_0x1a6c6e(++_0x560507);}(_0x7a9e,0xc0));var _0xe7a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7a9e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7a9('0x0'));var jsonpatch=require(_0xe7a9('0x1'));var rp=require(_0xe7a9('0x2'));var moment=require(_0xe7a9('0x3'));var BPromise=require(_0xe7a9('0x4'));var Mustache=require('mustache');var util=require(_0xe7a9('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7a9('0x6'));var fs=require('fs');var fs_extra=require(_0xe7a9('0x7'));var _=require(_0xe7a9('0x8'));var squel=require(_0xe7a9('0x9'));var crypto=require(_0xe7a9('0xa'));var jsforce=require(_0xe7a9('0xb'));var deskjs=require(_0xe7a9('0xc'));var toCsv=require(_0xe7a9('0xd'));var querystring=require(_0xe7a9('0xe'));var Papa=require(_0xe7a9('0xf'));var Redis=require(_0xe7a9('0x10'));var authService=require(_0xe7a9('0x11'));var qs=require(_0xe7a9('0x12'));var as=require(_0xe7a9('0x13'));var hardwareService=require(_0xe7a9('0x14'));var logger=require(_0xe7a9('0x15'))(_0xe7a9('0x16'));var utils=require(_0xe7a9('0x17'));var config=require(_0xe7a9('0x18'));var licenseUtil=require(_0xe7a9('0x19'));var db=require(_0xe7a9('0x1a'))['db'];function respondWithStatusCode(_0x6c3cef,_0x46a369){_0x46a369=_0x46a369||0xcc;return function(_0x5b2bd9){if(_0x5b2bd9){return _0x6c3cef[_0xe7a9('0x1b')](_0x46a369);}return _0x6c3cef[_0xe7a9('0x1c')](_0x46a369)['end']();};}function respondWithResult(_0x3c5e9f,_0x1724aa){_0x1724aa=_0x1724aa||0xc8;return function(_0x1e900b){if(_0x1e900b){return _0x3c5e9f[_0xe7a9('0x1c')](_0x1724aa)['json'](_0x1e900b);}};}function respondWithFilteredResult(_0x96bb5e,_0x5923e3){return function(_0x25c0f9){if(_0x25c0f9){var _0x4395be=typeof _0x5923e3[_0xe7a9('0x1d')]===_0xe7a9('0x1e')&&typeof _0x5923e3['limit']===_0xe7a9('0x1e');var _0x42dd81=_0x25c0f9['count'];var _0x324f50=_0x4395be?0x0:_0x5923e3[_0xe7a9('0x1d')];var _0x11d02c=_0x4395be?_0x25c0f9[_0xe7a9('0x1f')]:_0x5923e3[_0xe7a9('0x1d')]+_0x5923e3[_0xe7a9('0x20')];var _0x35d996;if(_0x11d02c>=_0x42dd81){_0x11d02c=_0x42dd81;_0x35d996=0xc8;}else{_0x35d996=0xce;}_0x96bb5e[_0xe7a9('0x1c')](_0x35d996);return _0x96bb5e[_0xe7a9('0x21')](_0xe7a9('0x22'),_0x324f50+'-'+_0x11d02c+'/'+_0x42dd81)['json'](_0x25c0f9);}return null;};}function patchUpdates(_0x2425d0){return function(_0x4d8a8c){try{jsonpatch[_0xe7a9('0x23')](_0x4d8a8c,_0x2425d0,!![]);}catch(_0x652e29){return BPromise[_0xe7a9('0x24')](_0x652e29);}return _0x4d8a8c[_0xe7a9('0x25')]();};}function saveUpdates(_0x2c7fd0,_0x21ca15){return function(_0x3b9aaa){if(_0x3b9aaa){return _0x3b9aaa['update'](_0x2c7fd0)[_0xe7a9('0x26')](function(_0x1a98c0){return _0x1a98c0;});}return null;};}function removeEntity(_0x294322,_0x2e65c7){return function(_0x3fd61e){if(_0x3fd61e){return _0x3fd61e[_0xe7a9('0x27')]()[_0xe7a9('0x26')](function(){_0x294322[_0xe7a9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f1e6a,_0x1b8e90){return function(_0x27c002){if(!_0x27c002){_0x4f1e6a[_0xe7a9('0x1b')](0x194);}return _0x27c002;};}function handleError(_0x5c03e1,_0x431114){_0x431114=_0x431114||0x1f4;return function(_0x692ef9){logger['error'](_0x692ef9['stack']);if(_0x692ef9[_0xe7a9('0x28')]){delete _0x692ef9['name'];}_0x5c03e1['status'](_0x431114)[_0xe7a9('0x29')](_0x692ef9);};}exports[_0xe7a9('0x2a')]=function(_0x3a973c,_0x201604){var _0x1079aa={},_0x18f282={},_0x2842d7={'count':0x0,'rows':[]};var _0x1559dd=_[_0xe7a9('0x2b')](db['SquareReport'][_0xe7a9('0x2c')],function(_0x399db5){return{'name':_0x399db5[_0xe7a9('0x2d')],'type':_0x399db5[_0xe7a9('0x2e')][_0xe7a9('0x2f')]};});_0x18f282[_0xe7a9('0x30')]=_['map'](_0x1559dd,_0xe7a9('0x28'));_0x18f282[_0xe7a9('0x31')]=_['keys'](_0x3a973c[_0xe7a9('0x31')]);_0x18f282[_0xe7a9('0x32')]=_[_0xe7a9('0x33')](_0x18f282[_0xe7a9('0x30')],_0x18f282[_0xe7a9('0x31')]);_0x1079aa[_0xe7a9('0x34')]=_[_0xe7a9('0x33')](_0x18f282[_0xe7a9('0x30')],qs['fields'](_0x3a973c[_0xe7a9('0x31')][_0xe7a9('0x35')]));_0x1079aa['attributes']=_0x1079aa[_0xe7a9('0x34')][_0xe7a9('0x36')]?_0x1079aa[_0xe7a9('0x34')]:_0x18f282[_0xe7a9('0x30')];if(!_0x3a973c[_0xe7a9('0x31')][_0xe7a9('0x37')](_0xe7a9('0x38'))){_0x1079aa[_0xe7a9('0x20')]=qs[_0xe7a9('0x20')](_0x3a973c['query'][_0xe7a9('0x20')]);_0x1079aa[_0xe7a9('0x1d')]=qs[_0xe7a9('0x1d')](_0x3a973c[_0xe7a9('0x31')]['offset']);}_0x1079aa[_0xe7a9('0x39')]=qs[_0xe7a9('0x3a')](_0x3a973c[_0xe7a9('0x31')]['sort']);_0x1079aa[_0xe7a9('0x3b')]=qs[_0xe7a9('0x32')](_[_0xe7a9('0x3c')](_0x3a973c[_0xe7a9('0x31')],_0x18f282[_0xe7a9('0x32')]),_0x1559dd);if(_0x3a973c[_0xe7a9('0x31')][_0xe7a9('0x3d')]){_0x1079aa[_0xe7a9('0x3b')]=_[_0xe7a9('0x3e')](_0x1079aa['where'],{'$or':_[_0xe7a9('0x2b')](_0x1559dd,function(_0x5e8669){if(_0x5e8669[_0xe7a9('0x2e')]!=='VIRTUAL'){var _0x4e8630={};_0x4e8630[_0x5e8669['name']]={'$like':'%'+_0x3a973c[_0xe7a9('0x31')][_0xe7a9('0x3d')]+'%'};return _0x4e8630;}})});}_0x1079aa=_[_0xe7a9('0x3e')]({},_0x1079aa,_0x3a973c['options']);var _0x50e6ac={'where':_0x1079aa['where']};return db[_0xe7a9('0x3f')][_0xe7a9('0x1f')](_0x50e6ac)[_0xe7a9('0x26')](function(_0x2a1288){_0x2842d7['count']=_0x2a1288;if(_0x3a973c['query'][_0xe7a9('0x40')]){_0x1079aa['include']=[{'all':!![]}];}return db[_0xe7a9('0x3f')][_0xe7a9('0x41')](_0x1079aa);})['then'](function(_0x34a6d9){_0x2842d7['rows']=_0x34a6d9;return _0x2842d7;})[_0xe7a9('0x26')](respondWithFilteredResult(_0x201604,_0x1079aa))[_0xe7a9('0x42')](handleError(_0x201604,null));};exports[_0xe7a9('0x43')]=function(_0x54b557,_0x215f6b){var _0x3675ae={'raw':!![],'where':{'id':_0x54b557[_0xe7a9('0x44')]['id']}},_0x646d9c={};_0x646d9c[_0xe7a9('0x30')]=_[_0xe7a9('0x45')](db[_0xe7a9('0x3f')][_0xe7a9('0x2c')]);_0x646d9c[_0xe7a9('0x31')]=_['keys'](_0x54b557[_0xe7a9('0x31')]);_0x646d9c[_0xe7a9('0x32')]=_['intersection'](_0x646d9c[_0xe7a9('0x30')],_0x646d9c[_0xe7a9('0x31')]);_0x3675ae[_0xe7a9('0x34')]=_['intersection'](_0x646d9c[_0xe7a9('0x30')],qs[_0xe7a9('0x35')](_0x54b557[_0xe7a9('0x31')][_0xe7a9('0x35')]));_0x3675ae[_0xe7a9('0x34')]=_0x3675ae['attributes']['length']?_0x3675ae['attributes']:_0x646d9c[_0xe7a9('0x30')];if(_0x54b557[_0xe7a9('0x31')][_0xe7a9('0x40')]){_0x3675ae[_0xe7a9('0x46')]=[{'all':!![]}];}_0x3675ae=_['merge']({},_0x3675ae,_0x54b557[_0xe7a9('0x47')]);return db['SquareReport'][_0xe7a9('0x48')](_0x3675ae)[_0xe7a9('0x26')](handleEntityNotFound(_0x215f6b,null))['then'](respondWithResult(_0x215f6b,null))[_0xe7a9('0x42')](handleError(_0x215f6b,null));};exports[_0xe7a9('0x49')]=function(_0x46da97,_0x1f7bef){return db[_0xe7a9('0x3f')][_0xe7a9('0x49')](_0x46da97[_0xe7a9('0x4a')],{})['then'](respondWithResult(_0x1f7bef,0xc9))[_0xe7a9('0x42')](handleError(_0x1f7bef,null));};exports[_0xe7a9('0x4b')]=function(_0x5d10ff,_0x485796){if(_0x5d10ff[_0xe7a9('0x4a')]['id']){delete _0x5d10ff[_0xe7a9('0x4a')]['id'];}return db['SquareReport'][_0xe7a9('0x48')]({'where':{'id':_0x5d10ff[_0xe7a9('0x44')]['id']}})[_0xe7a9('0x26')](handleEntityNotFound(_0x485796,null))[_0xe7a9('0x26')](saveUpdates(_0x5d10ff[_0xe7a9('0x4a')],null))[_0xe7a9('0x26')](respondWithResult(_0x485796,null))[_0xe7a9('0x42')](handleError(_0x485796,null));};exports['destroy']=function(_0x25091f,_0x2b2de3){return db[_0xe7a9('0x3f')]['find']({'where':{'id':_0x25091f[_0xe7a9('0x44')]['id']}})[_0xe7a9('0x26')](handleEntityNotFound(_0x2b2de3,null))['then'](removeEntity(_0x2b2de3,null))['catch'](handleError(_0x2b2de3,null));};exports['describe']=function(_0x15c688,_0x2b629a){return db[_0xe7a9('0x3f')][_0xe7a9('0x4c')]()[_0xe7a9('0x26')](respondWithResult(_0x2b629a,null))[_0xe7a9('0x42')](handleError(_0x2b629a,null));}; \ No newline at end of file +var _0x095d=['fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','SquareReport','findAll','rows','catch','show','params','find','create','body','describe','bluebird','mustache','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes'];(function(_0x185c76,_0x534cc3){var _0x7820b7=function(_0x3bcd58){while(--_0x3bcd58){_0x185c76['push'](_0x185c76['shift']());}};_0x7820b7(++_0x534cc3);}(_0x095d,0x148));var _0xd095=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x095d[_0x4c2f30];return _0xb8854d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd095('0x0'));var Mustache=require(_0xd095('0x1'));var util=require(_0xd095('0x2'));var path=require('path');var sox=require(_0xd095('0x3'));var csv=require(_0xd095('0x4'));var ejs=require(_0xd095('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd095('0x6'));var squel=require(_0xd095('0x7'));var crypto=require(_0xd095('0x8'));var jsforce=require(_0xd095('0x9'));var deskjs=require(_0xd095('0xa'));var toCsv=require(_0xd095('0x4'));var querystring=require(_0xd095('0xb'));var Papa=require('papaparse');var Redis=require(_0xd095('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd095('0xd'));var as=require(_0xd095('0xe'));var hardwareService=require(_0xd095('0xf'));var logger=require('../../config/logger')(_0xd095('0x10'));var utils=require(_0xd095('0x11'));var config=require(_0xd095('0x12'));var licenseUtil=require(_0xd095('0x13'));var db=require(_0xd095('0x14'))['db'];function respondWithStatusCode(_0x141896,_0x21b02c){_0x21b02c=_0x21b02c||0xcc;return function(_0x3b3eee){if(_0x3b3eee){return _0x141896[_0xd095('0x15')](_0x21b02c);}return _0x141896[_0xd095('0x16')](_0x21b02c)[_0xd095('0x17')]();};}function respondWithResult(_0x2a4e9b,_0x541f70){_0x541f70=_0x541f70||0xc8;return function(_0xf1925b){if(_0xf1925b){return _0x2a4e9b[_0xd095('0x16')](_0x541f70)[_0xd095('0x18')](_0xf1925b);}};}function respondWithFilteredResult(_0x554ba5,_0x294df6){return function(_0x29db2f){if(_0x29db2f){var _0x281985=typeof _0x294df6[_0xd095('0x19')]===_0xd095('0x1a')&&typeof _0x294df6[_0xd095('0x1b')]===_0xd095('0x1a');var _0x33e1b1=_0x29db2f[_0xd095('0x1c')];var _0x11b000=_0x281985?0x0:_0x294df6[_0xd095('0x19')];var _0x1039bd=_0x281985?_0x29db2f[_0xd095('0x1c')]:_0x294df6[_0xd095('0x19')]+_0x294df6['limit'];var _0x8116c4;if(_0x1039bd>=_0x33e1b1){_0x1039bd=_0x33e1b1;_0x8116c4=0xc8;}else{_0x8116c4=0xce;}_0x554ba5[_0xd095('0x16')](_0x8116c4);return _0x554ba5[_0xd095('0x1d')](_0xd095('0x1e'),_0x11b000+'-'+_0x1039bd+'/'+_0x33e1b1)[_0xd095('0x18')](_0x29db2f);}return null;};}function patchUpdates(_0x6baab7){return function(_0x2e48b1){try{jsonpatch[_0xd095('0x1f')](_0x2e48b1,_0x6baab7,!![]);}catch(_0x41a988){return BPromise[_0xd095('0x20')](_0x41a988);}return _0x2e48b1[_0xd095('0x21')]();};}function saveUpdates(_0x79577f,_0x3ea7ad){return function(_0x53605b){if(_0x53605b){return _0x53605b[_0xd095('0x22')](_0x79577f)[_0xd095('0x23')](function(_0x42de13){return _0x42de13;});}return null;};}function removeEntity(_0x2ea895,_0x323759){return function(_0x13c6d5){if(_0x13c6d5){return _0x13c6d5[_0xd095('0x24')]()['then'](function(){_0x2ea895[_0xd095('0x16')](0xcc)[_0xd095('0x17')]();});}};}function handleEntityNotFound(_0xe926c8,_0x12b524){return function(_0x1aed0e){if(!_0x1aed0e){_0xe926c8[_0xd095('0x15')](0x194);}return _0x1aed0e;};}function handleError(_0x57e4e1,_0x1b2f84){_0x1b2f84=_0x1b2f84||0x1f4;return function(_0x486b6b){logger[_0xd095('0x25')](_0x486b6b[_0xd095('0x26')]);if(_0x486b6b[_0xd095('0x27')]){delete _0x486b6b['name'];}_0x57e4e1['status'](_0x1b2f84)['send'](_0x486b6b);};}exports[_0xd095('0x28')]=function(_0x354c9e,_0x45a277){var _0x5090e0={},_0x4e0d69={},_0x3ee10d={'count':0x0,'rows':[]};var _0x8ddafa=_['map'](db['SquareReport'][_0xd095('0x29')],function(_0x1e011c){return{'name':_0x1e011c[_0xd095('0x2a')],'type':_0x1e011c['type'][_0xd095('0x2b')]};});_0x4e0d69[_0xd095('0x2c')]=_['map'](_0x8ddafa,_0xd095('0x27'));_0x4e0d69[_0xd095('0x2d')]=_[_0xd095('0x2e')](_0x354c9e[_0xd095('0x2d')]);_0x4e0d69[_0xd095('0x2f')]=_[_0xd095('0x30')](_0x4e0d69[_0xd095('0x2c')],_0x4e0d69[_0xd095('0x2d')]);_0x5090e0['attributes']=_[_0xd095('0x30')](_0x4e0d69['model'],qs[_0xd095('0x31')](_0x354c9e[_0xd095('0x2d')][_0xd095('0x31')]));_0x5090e0[_0xd095('0x32')]=_0x5090e0[_0xd095('0x32')][_0xd095('0x33')]?_0x5090e0[_0xd095('0x32')]:_0x4e0d69[_0xd095('0x2c')];if(!_0x354c9e[_0xd095('0x2d')]['hasOwnProperty'](_0xd095('0x34'))){_0x5090e0[_0xd095('0x1b')]=qs['limit'](_0x354c9e[_0xd095('0x2d')][_0xd095('0x1b')]);_0x5090e0[_0xd095('0x19')]=qs[_0xd095('0x19')](_0x354c9e[_0xd095('0x2d')][_0xd095('0x19')]);}_0x5090e0[_0xd095('0x35')]=qs[_0xd095('0x36')](_0x354c9e[_0xd095('0x2d')][_0xd095('0x36')]);_0x5090e0['where']=qs['filters'](_[_0xd095('0x37')](_0x354c9e[_0xd095('0x2d')],_0x4e0d69[_0xd095('0x2f')]),_0x8ddafa);if(_0x354c9e[_0xd095('0x2d')][_0xd095('0x38')]){_0x5090e0[_0xd095('0x39')]=_[_0xd095('0x3a')](_0x5090e0['where'],{'$or':_[_0xd095('0x3b')](_0x8ddafa,function(_0xd6b93e){if(_0xd6b93e['type']!==_0xd095('0x3c')){var _0x3d7bba={};_0x3d7bba[_0xd6b93e[_0xd095('0x27')]]={'$like':'%'+_0x354c9e['query'][_0xd095('0x38')]+'%'};return _0x3d7bba;}})});}_0x5090e0=_[_0xd095('0x3a')]({},_0x5090e0,_0x354c9e[_0xd095('0x3d')]);var _0x2e7992={'where':_0x5090e0[_0xd095('0x39')]};return db['SquareReport']['count'](_0x2e7992)[_0xd095('0x23')](function(_0x493e1c){_0x3ee10d[_0xd095('0x1c')]=_0x493e1c;if(_0x354c9e[_0xd095('0x2d')][_0xd095('0x3e')]){_0x5090e0[_0xd095('0x3f')]=[{'all':!![]}];}return db[_0xd095('0x40')][_0xd095('0x41')](_0x5090e0);})[_0xd095('0x23')](function(_0xad100a){_0x3ee10d[_0xd095('0x42')]=_0xad100a;return _0x3ee10d;})['then'](respondWithFilteredResult(_0x45a277,_0x5090e0))[_0xd095('0x43')](handleError(_0x45a277,null));};exports[_0xd095('0x44')]=function(_0x27280a,_0x4759bb){var _0x3770e0={'raw':!![],'where':{'id':_0x27280a[_0xd095('0x45')]['id']}},_0x41442c={};_0x41442c[_0xd095('0x2c')]=_[_0xd095('0x2e')](db[_0xd095('0x40')][_0xd095('0x29')]);_0x41442c[_0xd095('0x2d')]=_[_0xd095('0x2e')](_0x27280a[_0xd095('0x2d')]);_0x41442c[_0xd095('0x2f')]=_[_0xd095('0x30')](_0x41442c[_0xd095('0x2c')],_0x41442c['query']);_0x3770e0[_0xd095('0x32')]=_[_0xd095('0x30')](_0x41442c[_0xd095('0x2c')],qs[_0xd095('0x31')](_0x27280a['query'][_0xd095('0x31')]));_0x3770e0[_0xd095('0x32')]=_0x3770e0[_0xd095('0x32')][_0xd095('0x33')]?_0x3770e0[_0xd095('0x32')]:_0x41442c[_0xd095('0x2c')];if(_0x27280a[_0xd095('0x2d')][_0xd095('0x3e')]){_0x3770e0['include']=[{'all':!![]}];}_0x3770e0=_[_0xd095('0x3a')]({},_0x3770e0,_0x27280a[_0xd095('0x3d')]);return db[_0xd095('0x40')][_0xd095('0x46')](_0x3770e0)[_0xd095('0x23')](handleEntityNotFound(_0x4759bb,null))[_0xd095('0x23')](respondWithResult(_0x4759bb,null))[_0xd095('0x43')](handleError(_0x4759bb,null));};exports[_0xd095('0x47')]=function(_0x3eaa39,_0xac2f80){return db[_0xd095('0x40')]['create'](_0x3eaa39['body'],{})['then'](respondWithResult(_0xac2f80,0xc9))[_0xd095('0x43')](handleError(_0xac2f80,null));};exports[_0xd095('0x22')]=function(_0x2b23eb,_0x3b0c20){if(_0x2b23eb[_0xd095('0x48')]['id']){delete _0x2b23eb[_0xd095('0x48')]['id'];}return db[_0xd095('0x40')][_0xd095('0x46')]({'where':{'id':_0x2b23eb[_0xd095('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b0c20,null))[_0xd095('0x23')](saveUpdates(_0x2b23eb[_0xd095('0x48')],null))[_0xd095('0x23')](respondWithResult(_0x3b0c20,null))[_0xd095('0x43')](handleError(_0x3b0c20,null));};exports['destroy']=function(_0x21ff4e,_0x479c2a){return db[_0xd095('0x40')][_0xd095('0x46')]({'where':{'id':_0x21ff4e[_0xd095('0x45')]['id']}})[_0xd095('0x23')](handleEntityNotFound(_0x479c2a,null))['then'](removeEntity(_0x479c2a,null))[_0xd095('0x43')](handleError(_0x479c2a,null));};exports[_0xd095('0x49')]=function(_0x4476ac,_0x446878){return db[_0xd095('0x40')][_0xd095('0x49')]()['then'](respondWithResult(_0x446878,null))[_0xd095('0x43')](handleError(_0x446878,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 1e7031c..fc7852c 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 _0x9452=['SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define'];(function(_0x5df061,_0x400a05){var _0x5a4ef6=function(_0x224a94){while(--_0x224a94){_0x5df061['push'](_0x5df061['shift']());}};_0x5a4ef6(++_0x400a05);}(_0x9452,0xad));var _0x2945=function(_0x1b8ef6,_0x5d2cfb){_0x1b8ef6=_0x1b8ef6-0x0;var _0x439066=_0x9452[_0x1b8ef6];return _0x439066;};'use strict';var _=require(_0x2945('0x0'));var util=require(_0x2945('0x1'));var logger=require(_0x2945('0x2'))(_0x2945('0x3'));var moment=require('moment');var BPromise=require(_0x2945('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2945('0x5'));var rimraf=require(_0x2945('0x6'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x2945('0x7')]=function(_0x12265e,_0xa40132){return _0x12265e[_0x2945('0x8')](_0x2945('0x9'),attributes,{'tableName':_0x2945('0xa'),'paranoid':![],'indexes':[{'name':_0x2945('0xb'),'fields':[_0x2945('0xc'),'project_name']},{'name':_0x2945('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2983=['leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SquareReport','report_square','uid_pname','uniqueid'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2983,0xd1));var _0x3298=function(_0x2081b0,_0x536e38){_0x2081b0=_0x2081b0-0x0;var _0x98d948=_0x2983[_0x2081b0];return _0x98d948;};'use strict';var _=require(_0x3298('0x0'));var util=require(_0x3298('0x1'));var logger=require(_0x3298('0x2'))(_0x3298('0x3'));var moment=require(_0x3298('0x4'));var BPromise=require(_0x3298('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3298('0x6'));var rimraf=require(_0x3298('0x7'));var config=require(_0x3298('0x8'));var attributes=require('./squareReport.attributes');module[_0x3298('0x9')]=function(_0x2e49c0,_0x365301){return _0x2e49c0[_0x3298('0xa')](_0x3298('0xb'),attributes,{'tableName':_0x3298('0xc'),'paranoid':![],'indexes':[{'name':_0x3298('0xd'),'fields':[_0x3298('0xe'),'project_name']},{'name':'leaveAt','fields':[_0x3298('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 7c35a89..733531e 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 _0x9d23=['http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','CreateSquareReport','SquareReport','options','raw','UpdateSquareReport','update','where','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0x9d23,0x1d6));var _0x39d2=function(_0x5a8240,_0xd95987){_0x5a8240=_0x5a8240-0x0;var _0x3181a0=_0x9d23[_0x5a8240];return _0x3181a0;};'use strict';var _=require(_0x39d2('0x0'));var util=require('util');var moment=require(_0x39d2('0x1'));var BPromise=require(_0x39d2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39d2('0x3'));var db=require(_0x39d2('0x4'))['db'];var utils=require(_0x39d2('0x5'));var logger=require(_0x39d2('0x6'))('rpc');var config=require(_0x39d2('0x7'));var jayson=require(_0x39d2('0x8'));var client=jayson[_0x39d2('0x9')][_0x39d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x375740,_0xbf96f3,_0x370187){return new BPromise(function(_0x16f098,_0x4f3f3a){return client[_0x39d2('0xb')](_0x375740,_0x370187)[_0x39d2('0xc')](function(_0x1a118e){logger['info'](_0x39d2('0xd'),_0xbf96f3,_0x39d2('0xe'));logger[_0x39d2('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0xbf96f3,_0x39d2('0xe'),JSON[_0x39d2('0x10')](_0x1a118e));if(_0x1a118e[_0x39d2('0x11')]){if(_0x1a118e[_0x39d2('0x11')]['code']===0x1f4){logger[_0x39d2('0x11')](_0x39d2('0xd'),_0xbf96f3,_0x1a118e['error']['message']);return _0x4f3f3a(_0x1a118e[_0x39d2('0x11')][_0x39d2('0x12')]);}logger[_0x39d2('0x11')](_0x39d2('0xd'),_0xbf96f3,_0x1a118e[_0x39d2('0x11')]['message']);return _0x16f098(_0x1a118e[_0x39d2('0x11')][_0x39d2('0x12')]);}else{logger[_0x39d2('0x13')]('SquareReport,\x20%s,\x20%s',_0xbf96f3,_0x39d2('0xe'));_0x16f098(_0x1a118e[_0x39d2('0x14')][_0x39d2('0x12')]);}})[_0x39d2('0x15')](function(_0x56f3aa){logger[_0x39d2('0x11')](_0x39d2('0xd'),_0xbf96f3,_0x56f3aa);_0x4f3f3a(_0x56f3aa);});});}exports[_0x39d2('0x16')]=function(_0x986e4d){var _0x4e4e54=this;return new Promise(function(_0x102d1a,_0x595750){return db[_0x39d2('0x17')]['create'](_0x986e4d['body'],{'raw':_0x986e4d['options']?_0x986e4d[_0x39d2('0x18')][_0x39d2('0x19')]===undefined?!![]:![]:!![]})[_0x39d2('0xc')](function(_0xac2b56){logger['info'](_0x39d2('0x16'),_0x986e4d);logger[_0x39d2('0xf')](_0x39d2('0x16'),_0x986e4d,JSON['stringify'](_0xac2b56));_0x102d1a(_0xac2b56);})[_0x39d2('0x15')](function(_0x38f9b9){logger[_0x39d2('0x11')](_0x39d2('0x16'),_0x38f9b9['message'],_0x986e4d);_0x595750(_0x4e4e54[_0x39d2('0x11')](0x1f4,_0x38f9b9[_0x39d2('0x12')]));});});};exports[_0x39d2('0x1a')]=function(_0x26d089){var _0x1f5512=this;return new Promise(function(_0x4179fc,_0xdd4a83){return db['SquareReport'][_0x39d2('0x1b')](_0x26d089['body'],{'raw':_0x26d089[_0x39d2('0x18')]?_0x26d089[_0x39d2('0x18')][_0x39d2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26d089[_0x39d2('0x18')]?_0x26d089[_0x39d2('0x18')][_0x39d2('0x1c')]||null:null,'attributes':_0x26d089['options']?_0x26d089[_0x39d2('0x18')]['attributes']||null:null,'limit':_0x26d089[_0x39d2('0x18')]?_0x26d089['options'][_0x39d2('0x1d')]||null:null})[_0x39d2('0xc')](function(_0xc127eb){logger[_0x39d2('0x13')](_0x39d2('0x1a'),_0x26d089);logger['debug']('UpdateSquareReport',_0x26d089,JSON['stringify'](_0xc127eb));_0x4179fc(_0xc127eb);})['catch'](function(_0x5b42ec){logger[_0x39d2('0x11')]('UpdateSquareReport',_0x5b42ec['message'],_0x26d089);_0xdd4a83(_0x1f5512[_0x39d2('0x11')](0x1f4,_0x5b42ec[_0x39d2('0x12')]));});});}; \ No newline at end of file +var _0x6ed2=['where','attributes','limit','UpdateSquareReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareReport','SquareReport','create','body','options','debug','update','raw'];(function(_0x4d5d08,_0x5ef14d){var _0x3f5675=function(_0x416b36){while(--_0x416b36){_0x4d5d08['push'](_0x4d5d08['shift']());}};_0x3f5675(++_0x5ef14d);}(_0x6ed2,0xc4));var _0x26ed=function(_0x1efbf0,_0x340627){_0x1efbf0=_0x1efbf0-0x0;var _0x188287=_0x6ed2[_0x1efbf0];return _0x188287;};'use strict';var _=require('lodash');var util=require(_0x26ed('0x0'));var moment=require(_0x26ed('0x1'));var BPromise=require(_0x26ed('0x2'));var rs=require(_0x26ed('0x3'));var fs=require('fs');var Redis=require(_0x26ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x26ed('0x5'));var logger=require(_0x26ed('0x6'))(_0x26ed('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ed('0x8'));var client=jayson[_0x26ed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22d8e7,_0x2d95e8,_0x25906f){return new BPromise(function(_0x35ed7e,_0x4015e8){return client[_0x26ed('0xa')](_0x22d8e7,_0x25906f)[_0x26ed('0xb')](function(_0x49f58d){logger[_0x26ed('0xc')](_0x26ed('0xd'),_0x2d95e8,_0x26ed('0xe'));logger['debug'](_0x26ed('0xf'),_0x2d95e8,'request\x20sent',JSON[_0x26ed('0x10')](_0x49f58d));if(_0x49f58d[_0x26ed('0x11')]){if(_0x49f58d[_0x26ed('0x11')]['code']===0x1f4){logger[_0x26ed('0x11')](_0x26ed('0xd'),_0x2d95e8,_0x49f58d[_0x26ed('0x11')][_0x26ed('0x12')]);return _0x4015e8(_0x49f58d[_0x26ed('0x11')][_0x26ed('0x12')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x2d95e8,_0x49f58d[_0x26ed('0x11')][_0x26ed('0x12')]);return _0x35ed7e(_0x49f58d[_0x26ed('0x11')][_0x26ed('0x12')]);}else{logger[_0x26ed('0xc')](_0x26ed('0xd'),_0x2d95e8,_0x26ed('0xe'));_0x35ed7e(_0x49f58d['result'][_0x26ed('0x12')]);}})[_0x26ed('0x13')](function(_0x353a06){logger[_0x26ed('0x11')](_0x26ed('0xd'),_0x2d95e8,_0x353a06);_0x4015e8(_0x353a06);});});}exports[_0x26ed('0x14')]=function(_0x39b21){var _0x17c134=this;return new Promise(function(_0x3e0b7a,_0x631a8){return db[_0x26ed('0x15')][_0x26ed('0x16')](_0x39b21[_0x26ed('0x17')],{'raw':_0x39b21[_0x26ed('0x18')]?_0x39b21[_0x26ed('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x26ed('0xb')](function(_0x3d6a15){logger['info'](_0x26ed('0x14'),_0x39b21);logger[_0x26ed('0x19')](_0x26ed('0x14'),_0x39b21,JSON[_0x26ed('0x10')](_0x3d6a15));_0x3e0b7a(_0x3d6a15);})[_0x26ed('0x13')](function(_0x1a86bc){logger[_0x26ed('0x11')](_0x26ed('0x14'),_0x1a86bc['message'],_0x39b21);_0x631a8(_0x17c134['error'](0x1f4,_0x1a86bc[_0x26ed('0x12')]));});});};exports['UpdateSquareReport']=function(_0x1fd79e){var _0x311973=this;return new Promise(function(_0x49f3f6,_0x20d5ea){return db[_0x26ed('0x15')][_0x26ed('0x1a')](_0x1fd79e[_0x26ed('0x17')],{'raw':_0x1fd79e[_0x26ed('0x18')]?_0x1fd79e[_0x26ed('0x18')][_0x26ed('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fd79e[_0x26ed('0x18')]?_0x1fd79e['options'][_0x26ed('0x1c')]||null:null,'attributes':_0x1fd79e['options']?_0x1fd79e[_0x26ed('0x18')][_0x26ed('0x1d')]||null:null,'limit':_0x1fd79e[_0x26ed('0x18')]?_0x1fd79e['options'][_0x26ed('0x1e')]||null:null})[_0x26ed('0xb')](function(_0x4fcc10){logger[_0x26ed('0xc')](_0x26ed('0x1f'),_0x1fd79e);logger[_0x26ed('0x19')](_0x26ed('0x1f'),_0x1fd79e,JSON[_0x26ed('0x10')](_0x4fcc10));_0x49f3f6(_0x4fcc10);})[_0x26ed('0x13')](function(_0x23d5ce){logger[_0x26ed('0x11')](_0x26ed('0x1f'),_0x23d5ce['message'],_0x1fd79e);_0x20d5ea(_0x311973[_0x26ed('0x11')](0x1f4,_0x23d5ce[_0x26ed('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 770d22b..64587d3 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 _0xc6d9=['/describe','describe','create','/:id','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x878c62,_0x28d71f){var _0x4705d5=function(_0x7eca44){while(--_0x7eca44){_0x878c62['push'](_0x878c62['shift']());}};_0x4705d5(++_0x28d71f);}(_0xc6d9,0x139));var _0x9c6d=function(_0x860128,_0x45912e){_0x860128=_0x860128-0x0;var _0x164a78=_0xc6d9[_0x860128];return _0x164a78;};'use strict';var multer=require(_0x9c6d('0x0'));var util=require(_0x9c6d('0x1'));var path=require(_0x9c6d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9c6d('0x3')]();var fs_extra=require(_0x9c6d('0x4'));var auth=require(_0x9c6d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c6d('0x6'));var controller=require('./squareReportDetail.controller');router[_0x9c6d('0x7')]('/',auth[_0x9c6d('0x8')](),controller[_0x9c6d('0x9')]);router['get'](_0x9c6d('0xa'),auth[_0x9c6d('0x8')](),controller[_0x9c6d('0xb')]);router[_0x9c6d('0x7')]('/:id',auth[_0x9c6d('0x8')](),controller['show']);router['post']('/',auth[_0x9c6d('0x8')](),controller[_0x9c6d('0xc')]);router['put'](_0x9c6d('0xd'),auth[_0x9c6d('0x8')](),controller['update']);router[_0x9c6d('0xe')](_0x9c6d('0xd'),auth[_0x9c6d('0x8')](),controller[_0x9c6d('0xf')]);module[_0x9c6d('0x10')]=router; \ No newline at end of file +var _0xbeea=['post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x4581d2,_0x5a938b){var _0x43315f=function(_0x2c7b43){while(--_0x2c7b43){_0x4581d2['push'](_0x4581d2['shift']());}};_0x43315f(++_0x5a938b);}(_0xbeea,0xd6));var _0xabee=function(_0x544afe,_0x256f92){_0x544afe=_0x544afe-0x0;var _0x12d9e9=_0xbeea[_0x544afe];return _0x12d9e9;};'use strict';var multer=require('multer');var util=require(_0xabee('0x0'));var path=require(_0xabee('0x1'));var timeout=require(_0xabee('0x2'));var express=require(_0xabee('0x3'));var router=express[_0xabee('0x4')]();var fs_extra=require(_0xabee('0x5'));var auth=require(_0xabee('0x6'));var interaction=require(_0xabee('0x7'));var config=require(_0xabee('0x8'));var controller=require(_0xabee('0x9'));router[_0xabee('0xa')]('/',auth[_0xabee('0xb')](),controller[_0xabee('0xc')]);router[_0xabee('0xa')](_0xabee('0xd'),auth[_0xabee('0xb')](),controller['describe']);router[_0xabee('0xa')](_0xabee('0xe'),auth[_0xabee('0xb')](),controller[_0xabee('0xf')]);router[_0xabee('0x10')]('/',auth[_0xabee('0xb')](),controller[_0xabee('0x11')]);router[_0xabee('0x12')](_0xabee('0xe'),auth[_0xabee('0xb')](),controller[_0xabee('0x13')]);router[_0xabee('0x14')](_0xabee('0xe'),auth[_0xabee('0xb')](),controller[_0xabee('0x15')]);module[_0xabee('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 6aba21a..bb654c4 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 _0x2c92=['sequelize','STRING','TEXT'];(function(_0x3ae882,_0x24150d){var _0x3fba86=function(_0xf8a2b0){while(--_0xf8a2b0){_0x3ae882['push'](_0x3ae882['shift']());}};_0x3fba86(++_0x24150d);}(_0x2c92,0x1e6));var _0x22c9=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x2c92[_0x2307fa];return _0x496486;};'use strict';var Sequelize=require(_0x22c9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x22c9('0x1')]},'node':{'type':Sequelize[_0x22c9('0x1')]},'application':{'type':Sequelize[_0x22c9('0x1')]},'data':{'type':Sequelize[_0x22c9('0x2')]},'project_name':{'type':Sequelize[_0x22c9('0x1')]},'callerid':{'type':Sequelize[_0x22c9('0x1')]}}; \ No newline at end of file +var _0xe7e8=['STRING','exports'];(function(_0x32e9e9,_0x3df5aa){var _0x400b63=function(_0x5d0454){while(--_0x5d0454){_0x32e9e9['push'](_0x32e9e9['shift']());}};_0x400b63(++_0x3df5aa);}(_0xe7e8,0xe3));var _0x8e7e=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0xe7e8[_0x3a0ebd];return _0x51a660;};'use strict';var Sequelize=require('sequelize');module[_0x8e7e('0x0')]={'uniqueid':{'type':Sequelize[_0x8e7e('0x1')]},'node':{'type':Sequelize[_0x8e7e('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x8e7e('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4e73a73..11f78c3 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 _0xb50d=['params','options','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xb50d,0xef));var _0xdb50=function(_0x395d84,_0x2e9856){_0x395d84=_0x395d84-0x0;var _0x4471e8=_0xb50d[_0x395d84];return _0x4471e8;};'use strict';var emlformat=require(_0xdb50('0x0'));var rimraf=require(_0xdb50('0x1'));var zipdir=require(_0xdb50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb50('0x3'));var moment=require(_0xdb50('0x4'));var BPromise=require(_0xdb50('0x5'));var Mustache=require(_0xdb50('0x6'));var util=require(_0xdb50('0x7'));var path=require(_0xdb50('0x8'));var sox=require(_0xdb50('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb50('0xa'));var _=require(_0xdb50('0xb'));var squel=require(_0xdb50('0xc'));var crypto=require(_0xdb50('0xd'));var jsforce=require(_0xdb50('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdb50('0xf'));var querystring=require(_0xdb50('0x10'));var Papa=require(_0xdb50('0x11'));var Redis=require(_0xdb50('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdb50('0x13'));var as=require(_0xdb50('0x14'));var hardwareService=require(_0xdb50('0x15'));var logger=require(_0xdb50('0x16'))(_0xdb50('0x17'));var utils=require(_0xdb50('0x18'));var config=require(_0xdb50('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f60cf,_0x687e9c){_0x687e9c=_0x687e9c||0xcc;return function(_0x326542){if(_0x326542){return _0x1f60cf[_0xdb50('0x1a')](_0x687e9c);}return _0x1f60cf[_0xdb50('0x1b')](_0x687e9c)['end']();};}function respondWithResult(_0x5ea41e,_0x1fc449){_0x1fc449=_0x1fc449||0xc8;return function(_0x2abb4e){if(_0x2abb4e){return _0x5ea41e[_0xdb50('0x1b')](_0x1fc449)[_0xdb50('0x1c')](_0x2abb4e);}};}function respondWithFilteredResult(_0x5368b4,_0x218d0c){return function(_0x29f83e){if(_0x29f83e){var _0x5cf56c=typeof _0x218d0c[_0xdb50('0x1d')]===_0xdb50('0x1e')&&typeof _0x218d0c[_0xdb50('0x1f')]==='undefined';var _0x2c1014=_0x29f83e[_0xdb50('0x20')];var _0x494fa8=_0x5cf56c?0x0:_0x218d0c[_0xdb50('0x1d')];var _0x1a149e=_0x5cf56c?_0x29f83e[_0xdb50('0x20')]:_0x218d0c[_0xdb50('0x1d')]+_0x218d0c[_0xdb50('0x1f')];var _0x58a267;if(_0x1a149e>=_0x2c1014){_0x1a149e=_0x2c1014;_0x58a267=0xc8;}else{_0x58a267=0xce;}_0x5368b4[_0xdb50('0x1b')](_0x58a267);return _0x5368b4['set'](_0xdb50('0x21'),_0x494fa8+'-'+_0x1a149e+'/'+_0x2c1014)['json'](_0x29f83e);}return null;};}function patchUpdates(_0x106802){return function(_0x5db0c1){try{jsonpatch[_0xdb50('0x22')](_0x5db0c1,_0x106802,!![]);}catch(_0x15b5b5){return BPromise['reject'](_0x15b5b5);}return _0x5db0c1[_0xdb50('0x23')]();};}function saveUpdates(_0xfc2c3a,_0x1cffb4){return function(_0x2a6bec){if(_0x2a6bec){return _0x2a6bec['update'](_0xfc2c3a)[_0xdb50('0x24')](function(_0x2637c2){return _0x2637c2;});}return null;};}function removeEntity(_0x13a22a,_0x421ee8){return function(_0x5d98f7){if(_0x5d98f7){return _0x5d98f7[_0xdb50('0x25')]()[_0xdb50('0x24')](function(){_0x13a22a[_0xdb50('0x1b')](0xcc)[_0xdb50('0x26')]();});}};}function handleEntityNotFound(_0x19e0a4,_0x3601b7){return function(_0x577df4){if(!_0x577df4){_0x19e0a4[_0xdb50('0x1a')](0x194);}return _0x577df4;};}function handleError(_0x1d95ac,_0x12f8cc){_0x12f8cc=_0x12f8cc||0x1f4;return function(_0x32a36c){logger[_0xdb50('0x27')](_0x32a36c[_0xdb50('0x28')]);if(_0x32a36c[_0xdb50('0x29')]){delete _0x32a36c['name'];}_0x1d95ac[_0xdb50('0x1b')](_0x12f8cc)[_0xdb50('0x2a')](_0x32a36c);};}exports[_0xdb50('0x2b')]=function(_0x49e639,_0x457bb2){var _0x1724e7={},_0x8abfad={},_0x495522={'count':0x0,'rows':[]};var _0x30f663=_[_0xdb50('0x2c')](db[_0xdb50('0x2d')]['rawAttributes'],function(_0x18055f){return{'name':_0x18055f[_0xdb50('0x2e')],'type':_0x18055f[_0xdb50('0x2f')][_0xdb50('0x30')]};});_0x8abfad[_0xdb50('0x31')]=_[_0xdb50('0x2c')](_0x30f663,_0xdb50('0x29'));_0x8abfad[_0xdb50('0x32')]=_[_0xdb50('0x33')](_0x49e639['query']);_0x8abfad[_0xdb50('0x34')]=_[_0xdb50('0x35')](_0x8abfad['model'],_0x8abfad[_0xdb50('0x32')]);_0x1724e7[_0xdb50('0x36')]=_[_0xdb50('0x35')](_0x8abfad['model'],qs[_0xdb50('0x37')](_0x49e639['query'][_0xdb50('0x37')]));_0x1724e7['attributes']=_0x1724e7[_0xdb50('0x36')][_0xdb50('0x38')]?_0x1724e7['attributes']:_0x8abfad['model'];if(!_0x49e639['query'][_0xdb50('0x39')](_0xdb50('0x3a'))){_0x1724e7[_0xdb50('0x1f')]=qs[_0xdb50('0x1f')](_0x49e639[_0xdb50('0x32')][_0xdb50('0x1f')]);_0x1724e7['offset']=qs[_0xdb50('0x1d')](_0x49e639[_0xdb50('0x32')]['offset']);}_0x1724e7[_0xdb50('0x3b')]=qs[_0xdb50('0x3c')](_0x49e639['query'][_0xdb50('0x3c')]);_0x1724e7[_0xdb50('0x3d')]=qs[_0xdb50('0x34')](_[_0xdb50('0x3e')](_0x49e639[_0xdb50('0x32')],_0x8abfad['filters']),_0x30f663);if(_0x49e639[_0xdb50('0x32')][_0xdb50('0x3f')]){_0x1724e7[_0xdb50('0x3d')]=_[_0xdb50('0x40')](_0x1724e7[_0xdb50('0x3d')],{'$or':_[_0xdb50('0x2c')](_0x30f663,function(_0x322fd7){if(_0x322fd7['type']!==_0xdb50('0x41')){var _0x452149={};_0x452149[_0x322fd7[_0xdb50('0x29')]]={'$like':'%'+_0x49e639[_0xdb50('0x32')][_0xdb50('0x3f')]+'%'};return _0x452149;}})});}_0x1724e7=_[_0xdb50('0x40')]({},_0x1724e7,_0x49e639['options']);var _0x129f37={'where':_0x1724e7['where']};return db[_0xdb50('0x2d')]['count'](_0x129f37)[_0xdb50('0x24')](function(_0x2938b3){_0x495522[_0xdb50('0x20')]=_0x2938b3;if(_0x49e639[_0xdb50('0x32')][_0xdb50('0x42')]){_0x1724e7[_0xdb50('0x43')]=[{'all':!![]}];}return db[_0xdb50('0x2d')]['findAll'](_0x1724e7);})[_0xdb50('0x24')](function(_0xf40458){_0x495522['rows']=_0xf40458;return _0x495522;})['then'](respondWithFilteredResult(_0x457bb2,_0x1724e7))['catch'](handleError(_0x457bb2,null));};exports[_0xdb50('0x44')]=function(_0x420ab0,_0x37098e){var _0x60fabb={'raw':!![],'where':{'id':_0x420ab0[_0xdb50('0x45')]['id']}},_0x4efcc3={};_0x4efcc3[_0xdb50('0x31')]=_['keys'](db['SquareDetailsReport']['rawAttributes']);_0x4efcc3[_0xdb50('0x32')]=_[_0xdb50('0x33')](_0x420ab0['query']);_0x4efcc3['filters']=_['intersection'](_0x4efcc3[_0xdb50('0x31')],_0x4efcc3[_0xdb50('0x32')]);_0x60fabb[_0xdb50('0x36')]=_[_0xdb50('0x35')](_0x4efcc3[_0xdb50('0x31')],qs[_0xdb50('0x37')](_0x420ab0[_0xdb50('0x32')][_0xdb50('0x37')]));_0x60fabb['attributes']=_0x60fabb[_0xdb50('0x36')]['length']?_0x60fabb[_0xdb50('0x36')]:_0x4efcc3['model'];if(_0x420ab0[_0xdb50('0x32')][_0xdb50('0x42')]){_0x60fabb[_0xdb50('0x43')]=[{'all':!![]}];}_0x60fabb=_[_0xdb50('0x40')]({},_0x60fabb,_0x420ab0[_0xdb50('0x46')]);return db[_0xdb50('0x2d')][_0xdb50('0x47')](_0x60fabb)[_0xdb50('0x24')](handleEntityNotFound(_0x37098e,null))['then'](respondWithResult(_0x37098e,null))[_0xdb50('0x48')](handleError(_0x37098e,null));};exports[_0xdb50('0x49')]=function(_0x2c9171,_0x33cd2c){return db['SquareDetailsReport']['create'](_0x2c9171[_0xdb50('0x4a')],{})[_0xdb50('0x24')](respondWithResult(_0x33cd2c,0xc9))['catch'](handleError(_0x33cd2c,null));};exports[_0xdb50('0x4b')]=function(_0x4e273c,_0x1d2d98){if(_0x4e273c['body']['id']){delete _0x4e273c[_0xdb50('0x4a')]['id'];}return db['SquareDetailsReport'][_0xdb50('0x47')]({'where':{'id':_0x4e273c[_0xdb50('0x45')]['id']}})[_0xdb50('0x24')](handleEntityNotFound(_0x1d2d98,null))[_0xdb50('0x24')](saveUpdates(_0x4e273c[_0xdb50('0x4a')],null))[_0xdb50('0x24')](respondWithResult(_0x1d2d98,null))[_0xdb50('0x48')](handleError(_0x1d2d98,null));};exports[_0xdb50('0x25')]=function(_0x5307be,_0x38563d){return db[_0xdb50('0x2d')][_0xdb50('0x47')]({'where':{'id':_0x5307be['params']['id']}})[_0xdb50('0x24')](handleEntityNotFound(_0x38563d,null))[_0xdb50('0x24')](removeEntity(_0x38563d,null))[_0xdb50('0x48')](handleError(_0x38563d,null));};exports['describe']=function(_0x224aa3,_0x1d4d97){return db['SquareDetailsReport'][_0xdb50('0x4c')]()[_0xdb50('0x24')](respondWithResult(_0x1d4d97,null))[_0xdb50('0x48')](handleError(_0x1d4d97,null));}; \ No newline at end of file +var _0xfda0=['show','length','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch'];(function(_0x14a52c,_0x2adfba){var _0x19163b=function(_0x312900){while(--_0x312900){_0x14a52c['push'](_0x14a52c['shift']());}};_0x19163b(++_0x2adfba);}(_0xfda0,0x174));var _0x0fda=function(_0x313a13,_0x2bea73){_0x313a13=_0x313a13-0x0;var _0x4a737f=_0xfda0[_0x313a13];return _0x4a737f;};'use strict';var emlformat=require(_0x0fda('0x0'));var rimraf=require(_0x0fda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fda('0x2'));var rp=require(_0x0fda('0x3'));var moment=require(_0x0fda('0x4'));var BPromise=require(_0x0fda('0x5'));var Mustache=require(_0x0fda('0x6'));var util=require('util');var path=require(_0x0fda('0x7'));var sox=require(_0x0fda('0x8'));var csv=require(_0x0fda('0x9'));var ejs=require(_0x0fda('0xa'));var fs=require('fs');var fs_extra=require(_0x0fda('0xb'));var _=require('lodash');var squel=require(_0x0fda('0xc'));var crypto=require(_0x0fda('0xd'));var jsforce=require(_0x0fda('0xe'));var deskjs=require(_0x0fda('0xf'));var toCsv=require(_0x0fda('0x9'));var querystring=require('querystring');var Papa=require(_0x0fda('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0fda('0x11'));var hardwareService=require(_0x0fda('0x12'));var logger=require(_0x0fda('0x13'))(_0x0fda('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fda('0x15'))['db'];function respondWithStatusCode(_0x535788,_0x892e92){_0x892e92=_0x892e92||0xcc;return function(_0x21769d){if(_0x21769d){return _0x535788[_0x0fda('0x16')](_0x892e92);}return _0x535788[_0x0fda('0x17')](_0x892e92)[_0x0fda('0x18')]();};}function respondWithResult(_0x464066,_0x42ca5b){_0x42ca5b=_0x42ca5b||0xc8;return function(_0x1a20fd){if(_0x1a20fd){return _0x464066['status'](_0x42ca5b)[_0x0fda('0x19')](_0x1a20fd);}};}function respondWithFilteredResult(_0x5ba550,_0x19d105){return function(_0x27c3ce){if(_0x27c3ce){var _0x34c84f=typeof _0x19d105[_0x0fda('0x1a')]===_0x0fda('0x1b')&&typeof _0x19d105['limit']===_0x0fda('0x1b');var _0x1d311e=_0x27c3ce[_0x0fda('0x1c')];var _0x32ea7=_0x34c84f?0x0:_0x19d105[_0x0fda('0x1a')];var _0x1cc28a=_0x34c84f?_0x27c3ce['count']:_0x19d105['offset']+_0x19d105['limit'];var _0x2b67e0;if(_0x1cc28a>=_0x1d311e){_0x1cc28a=_0x1d311e;_0x2b67e0=0xc8;}else{_0x2b67e0=0xce;}_0x5ba550[_0x0fda('0x17')](_0x2b67e0);return _0x5ba550[_0x0fda('0x1d')]('Content-Range',_0x32ea7+'-'+_0x1cc28a+'/'+_0x1d311e)['json'](_0x27c3ce);}return null;};}function patchUpdates(_0x4a3804){return function(_0x43d029){try{jsonpatch[_0x0fda('0x1e')](_0x43d029,_0x4a3804,!![]);}catch(_0x2ef039){return BPromise[_0x0fda('0x1f')](_0x2ef039);}return _0x43d029[_0x0fda('0x20')]();};}function saveUpdates(_0x41b724,_0x508c68){return function(_0x4fbfee){if(_0x4fbfee){return _0x4fbfee[_0x0fda('0x21')](_0x41b724)[_0x0fda('0x22')](function(_0x5953a5){return _0x5953a5;});}return null;};}function removeEntity(_0x2eebee,_0x977cab){return function(_0x363625){if(_0x363625){return _0x363625[_0x0fda('0x23')]()[_0x0fda('0x22')](function(){_0x2eebee[_0x0fda('0x17')](0xcc)[_0x0fda('0x18')]();});}};}function handleEntityNotFound(_0x5e1923,_0x3301c4){return function(_0x4d0f43){if(!_0x4d0f43){_0x5e1923[_0x0fda('0x16')](0x194);}return _0x4d0f43;};}function handleError(_0x4ef61a,_0x18c709){_0x18c709=_0x18c709||0x1f4;return function(_0x2e8ef3){logger[_0x0fda('0x24')](_0x2e8ef3[_0x0fda('0x25')]);if(_0x2e8ef3[_0x0fda('0x26')]){delete _0x2e8ef3[_0x0fda('0x26')];}_0x4ef61a[_0x0fda('0x17')](_0x18c709)['send'](_0x2e8ef3);};}exports[_0x0fda('0x27')]=function(_0x364a56,_0x5b9a55){var _0x4fb080={},_0x4f0235={},_0xfc78ce={'count':0x0,'rows':[]};var _0x5ceb0a=_['map'](db[_0x0fda('0x28')][_0x0fda('0x29')],function(_0x3c896b){return{'name':_0x3c896b[_0x0fda('0x2a')],'type':_0x3c896b[_0x0fda('0x2b')]['key']};});_0x4f0235[_0x0fda('0x2c')]=_['map'](_0x5ceb0a,_0x0fda('0x26'));_0x4f0235[_0x0fda('0x2d')]=_[_0x0fda('0x2e')](_0x364a56[_0x0fda('0x2d')]);_0x4f0235[_0x0fda('0x2f')]=_[_0x0fda('0x30')](_0x4f0235[_0x0fda('0x2c')],_0x4f0235[_0x0fda('0x2d')]);_0x4fb080['attributes']=_[_0x0fda('0x30')](_0x4f0235[_0x0fda('0x2c')],qs['fields'](_0x364a56[_0x0fda('0x2d')][_0x0fda('0x31')]));_0x4fb080['attributes']=_0x4fb080[_0x0fda('0x32')]['length']?_0x4fb080[_0x0fda('0x32')]:_0x4f0235['model'];if(!_0x364a56[_0x0fda('0x2d')][_0x0fda('0x33')](_0x0fda('0x34'))){_0x4fb080[_0x0fda('0x35')]=qs['limit'](_0x364a56['query'][_0x0fda('0x35')]);_0x4fb080[_0x0fda('0x1a')]=qs['offset'](_0x364a56['query'][_0x0fda('0x1a')]);}_0x4fb080[_0x0fda('0x36')]=qs[_0x0fda('0x37')](_0x364a56[_0x0fda('0x2d')][_0x0fda('0x37')]);_0x4fb080[_0x0fda('0x38')]=qs[_0x0fda('0x2f')](_[_0x0fda('0x39')](_0x364a56['query'],_0x4f0235[_0x0fda('0x2f')]),_0x5ceb0a);if(_0x364a56[_0x0fda('0x2d')]['filter']){_0x4fb080[_0x0fda('0x38')]=_[_0x0fda('0x3a')](_0x4fb080[_0x0fda('0x38')],{'$or':_['map'](_0x5ceb0a,function(_0x3702af){if(_0x3702af['type']!==_0x0fda('0x3b')){var _0x2e8a07={};_0x2e8a07[_0x3702af[_0x0fda('0x26')]]={'$like':'%'+_0x364a56[_0x0fda('0x2d')][_0x0fda('0x3c')]+'%'};return _0x2e8a07;}})});}_0x4fb080=_[_0x0fda('0x3a')]({},_0x4fb080,_0x364a56[_0x0fda('0x3d')]);var _0x1009cd={'where':_0x4fb080['where']};return db['SquareDetailsReport'][_0x0fda('0x1c')](_0x1009cd)[_0x0fda('0x22')](function(_0x43bec3){_0xfc78ce['count']=_0x43bec3;if(_0x364a56[_0x0fda('0x2d')][_0x0fda('0x3e')]){_0x4fb080['include']=[{'all':!![]}];}return db[_0x0fda('0x28')][_0x0fda('0x3f')](_0x4fb080);})[_0x0fda('0x22')](function(_0x8c97c8){_0xfc78ce[_0x0fda('0x40')]=_0x8c97c8;return _0xfc78ce;})[_0x0fda('0x22')](respondWithFilteredResult(_0x5b9a55,_0x4fb080))[_0x0fda('0x41')](handleError(_0x5b9a55,null));};exports[_0x0fda('0x42')]=function(_0x26e21f,_0x3db142){var _0x5e579c={'raw':!![],'where':{'id':_0x26e21f['params']['id']}},_0x11d0bc={};_0x11d0bc[_0x0fda('0x2c')]=_[_0x0fda('0x2e')](db[_0x0fda('0x28')][_0x0fda('0x29')]);_0x11d0bc[_0x0fda('0x2d')]=_[_0x0fda('0x2e')](_0x26e21f[_0x0fda('0x2d')]);_0x11d0bc[_0x0fda('0x2f')]=_['intersection'](_0x11d0bc['model'],_0x11d0bc[_0x0fda('0x2d')]);_0x5e579c['attributes']=_['intersection'](_0x11d0bc[_0x0fda('0x2c')],qs['fields'](_0x26e21f[_0x0fda('0x2d')][_0x0fda('0x31')]));_0x5e579c['attributes']=_0x5e579c[_0x0fda('0x32')][_0x0fda('0x43')]?_0x5e579c['attributes']:_0x11d0bc[_0x0fda('0x2c')];if(_0x26e21f[_0x0fda('0x2d')][_0x0fda('0x3e')]){_0x5e579c['include']=[{'all':!![]}];}_0x5e579c=_['merge']({},_0x5e579c,_0x26e21f[_0x0fda('0x3d')]);return db[_0x0fda('0x28')]['find'](_0x5e579c)[_0x0fda('0x22')](handleEntityNotFound(_0x3db142,null))['then'](respondWithResult(_0x3db142,null))['catch'](handleError(_0x3db142,null));};exports[_0x0fda('0x44')]=function(_0x1b7d82,_0x3731ac){return db['SquareDetailsReport']['create'](_0x1b7d82[_0x0fda('0x45')],{})[_0x0fda('0x22')](respondWithResult(_0x3731ac,0xc9))['catch'](handleError(_0x3731ac,null));};exports[_0x0fda('0x21')]=function(_0x5a3ff4,_0x247048){if(_0x5a3ff4['body']['id']){delete _0x5a3ff4['body']['id'];}return db['SquareDetailsReport'][_0x0fda('0x46')]({'where':{'id':_0x5a3ff4[_0x0fda('0x47')]['id']}})[_0x0fda('0x22')](handleEntityNotFound(_0x247048,null))[_0x0fda('0x22')](saveUpdates(_0x5a3ff4[_0x0fda('0x45')],null))[_0x0fda('0x22')](respondWithResult(_0x247048,null))[_0x0fda('0x41')](handleError(_0x247048,null));};exports['destroy']=function(_0x3f024b,_0x4a9ac7){return db[_0x0fda('0x28')][_0x0fda('0x46')]({'where':{'id':_0x3f024b[_0x0fda('0x47')]['id']}})[_0x0fda('0x22')](handleEntityNotFound(_0x4a9ac7,null))[_0x0fda('0x22')](removeEntity(_0x4a9ac7,null))[_0x0fda('0x41')](handleError(_0x4a9ac7,null));};exports[_0x0fda('0x48')]=function(_0x16894b,_0x45a065){return db[_0x0fda('0x28')][_0x0fda('0x48')]()[_0x0fda('0x22')](respondWithResult(_0x45a065,null))['catch'](handleError(_0x45a065,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 753930e..1d20e1e 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 _0x95ef=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3e2c88,_0x591433){var _0x55655f=function(_0x46f89a){while(--_0x46f89a){_0x3e2c88['push'](_0x3e2c88['shift']());}};_0x55655f(++_0x591433);}(_0x95ef,0x19e));var _0xf95e=function(_0xf66a5a,_0x4ee889){_0xf66a5a=_0xf66a5a-0x0;var _0x487362=_0x95ef[_0xf66a5a];return _0x487362;};'use strict';var _=require(_0xf95e('0x0'));var util=require(_0xf95e('0x1'));var logger=require(_0xf95e('0x2'))(_0xf95e('0x3'));var moment=require(_0xf95e('0x4'));var BPromise=require(_0xf95e('0x5'));var rp=require(_0xf95e('0x6'));var fs=require('fs');var path=require(_0xf95e('0x7'));var rimraf=require(_0xf95e('0x8'));var config=require(_0xf95e('0x9'));var attributes=require(_0xf95e('0xa'));module[_0xf95e('0xb')]=function(_0x56e3e1,_0x30dcb5){return _0x56e3e1[_0xf95e('0xc')](_0xf95e('0xd'),attributes,{'tableName':_0xf95e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8616=['path','rimraf','./squareReportDetail.attributes','exports','report_square_details','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x45fabc,_0x2f0df7){var _0x3012ac=function(_0x214f0f){while(--_0x214f0f){_0x45fabc['push'](_0x45fabc['shift']());}};_0x3012ac(++_0x2f0df7);}(_0x8616,0x165));var _0x6861=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0x8616[_0x1c510a];return _0x23cedd;};'use strict';var _=require(_0x6861('0x0'));var util=require(_0x6861('0x1'));var logger=require(_0x6861('0x2'))(_0x6861('0x3'));var moment=require('moment');var BPromise=require(_0x6861('0x4'));var rp=require(_0x6861('0x5'));var fs=require('fs');var path=require(_0x6861('0x6'));var rimraf=require(_0x6861('0x7'));var config=require('../../config/environment');var attributes=require(_0x6861('0x8'));module[_0x6861('0x9')]=function(_0x273f81,_0x598138){return _0x273f81['define']('SquareDetailsReport',attributes,{'tableName':_0x6861('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 958f29e..ac7fc22 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ec6=['randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment'];(function(_0xecb9e1,_0x41e798){var _0x25cc38=function(_0x3de198){while(--_0x3de198){_0xecb9e1['push'](_0xecb9e1['shift']());}};_0x25cc38(++_0x41e798);}(_0x5ec6,0x7f));var _0x65ec=function(_0x354721,_0x27f4dd){_0x354721=_0x354721-0x0;var _0x40410e=_0x5ec6[_0x354721];return _0x40410e;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});}exports[_0x65ec('0x14')]=function(_0x1254f8){var _0xb4ed90=this;return new Promise(function(_0x29ebc4,_0xd81ed3){return db[_0x65ec('0x15')][_0x65ec('0x16')](_0x1254f8[_0x65ec('0x17')],{'raw':_0x1254f8[_0x65ec('0x18')]?_0x1254f8[_0x65ec('0x18')][_0x65ec('0x19')]===undefined?!![]:![]:!![]})[_0x65ec('0xa')](function(_0x1467ac){logger[_0x65ec('0x12')](_0x65ec('0x14'),_0x1254f8);logger[_0x65ec('0xc')](_0x65ec('0x14'),_0x1254f8,JSON[_0x65ec('0xe')](_0x1467ac));_0x29ebc4(_0x1467ac);})['catch'](function(_0x170703){logger[_0x65ec('0xf')](_0x65ec('0x14'),_0x170703[_0x65ec('0x11')],_0x1254f8);_0xd81ed3(_0xb4ed90[_0x65ec('0xf')](0x1f4,_0x170703[_0x65ec('0x11')]));});});}; \ No newline at end of file +var _0x4f7b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','raw','CreateSquareDetailsReport','debug','lodash'];(function(_0x41f5c5,_0x295c8f){var _0x493aad=function(_0x47155d){while(--_0x47155d){_0x41f5c5['push'](_0x41f5c5['shift']());}};_0x493aad(++_0x295c8f);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x5c8598,_0x3faf98){_0x5c8598=_0x5c8598-0x0;var _0x3666f7=_0x4f7b[_0x5c8598];return _0x3666f7;};'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['CreateSquareDetailsReport']=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')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b1f6abb..658ed25 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 _0x490d=['exports','express','../../components/auth/service','get','index','isAuthenticated'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x490d,0xeb));var _0xd490=function(_0x598817,_0x519b2f){_0x598817=_0x598817-0x0;var _0x5e7c42=_0x490d[_0x598817];return _0x5e7c42;};'use strict';var express=require(_0xd490('0x0'));var router=express['Router']();var auth=require(_0xd490('0x1'));var controller=require('./system.controller');router[_0xd490('0x2')]('/',auth['isAuthenticated'](),controller[_0xd490('0x3')]);router['get']('/process/:pid/kill',auth[_0xd490('0x4')](),controller['killProcess']);module[_0xd490('0x5')]=router; \ No newline at end of file +var _0x94fa=['killProcess','exports','express','Router','./system.controller','get','isAuthenticated','/process/:pid/kill'];(function(_0x1f155a,_0x4694e9){var _0x410cfb=function(_0x5eeeb2){while(--_0x5eeeb2){_0x1f155a['push'](_0x1f155a['shift']());}};_0x410cfb(++_0x4694e9);}(_0x94fa,0x132));var _0xa94f=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x94fa[_0x18a79d];return _0x4f8848;};'use strict';var express=require(_0xa94f('0x0'));var router=express[_0xa94f('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa94f('0x2'));router[_0xa94f('0x3')]('/',auth[_0xa94f('0x4')](),controller['index']);router[_0xa94f('0x3')](_0xa94f('0x5'),auth[_0xa94f('0x4')](),controller[_0xa94f('0x6')]);module[_0xa94f('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 3215bc3..072e7c5 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 _0x2114=['catch','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','then','json','killProcess','components/import/cm','format','params','pid','split','length','indexOf','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x5bfe94,_0x39eb65){var _0x4834d1=function(_0x384167){while(--_0x384167){_0x5bfe94['push'](_0x5bfe94['shift']());}};_0x4834d1(++_0x39eb65);}(_0x2114,0x12c));var _0x4211=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x2114[_0x81f000];return _0x337aa2;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0x4211('0x0'))(_0x4211('0x1'));var util=require(_0x4211('0x2'));var BPromise=require(_0x4211('0x3'));var _=require(_0x4211('0x4'));function handleError(_0x3a5f63,_0x4ac001,_0x2b5a9e){_0x4ac001=_0x4ac001||0x1f4;return function(_0x53faee){logger[_0x4211('0x5')](_0x4211('0x6'),_0x2b5a9e,_0x4ac001,util[_0x4211('0x7')](_0x53faee,{'showHidden':![],'depth':null}));delete _0x53faee['name'];_0x3a5f63[_0x4211('0x8')](_0x4ac001)[_0x4211('0x9')](_0x53faee);};}exports['index']=function(_0xb1698a,_0x4fe2b0){return info['getAllData']()[_0x4211('0xa')](function(_0x43388c){return _0x4fe2b0[_0x4211('0x8')](0xc8)[_0x4211('0xb')](_0x43388c);})['catch'](function(_0x52dcca){return _0x4fe2b0['status'](0x1f4)[_0x4211('0xb')](_0x52dcca);});};exports[_0x4211('0xc')]=function(_0x873e73,_0x5284a9){var _0x30b077=[_0x4211('0xd')];return new BPromise(function(_0x442c21,_0x63d9bb){return exec(util[_0x4211('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x873e73[_0x4211('0xf')][_0x4211('0x10')]),function(_0x548a5c,_0x2fa5c7,_0x7f5763){if(_0x548a5c){return _0x63d9bb(_0x548a5c);}return _0x442c21(_0x2fa5c7);});})[_0x4211('0xa')](function(_0x502ad5){var _0x14f9af=![];var _0xe612a=_0x502ad5[_0x4211('0x11')](/\n/);for(var _0x193801=0x0,_0x435397=_0x30b077[_0x4211('0x12')];_0x193801<_0x435397,_0x14f9af===![];_0x193801+=0x1){if(_0x502ad5[_0x4211('0x13')](_0x30b077[_0x193801])>=0x0){_0x14f9af=!![];}}if(!_0x14f9af){throw new Error(util[_0x4211('0xe')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x873e73[_0x4211('0xf')][_0x4211('0x10')]));}process[_0x4211('0x14')](_0x873e73[_0x4211('0xf')][_0x4211('0x10')],'SIGINT');return _0x5284a9[_0x4211('0x8')](0xc8)[_0x4211('0xb')]({'message':util[_0x4211('0xe')](_0x4211('0x15'),_0x873e73[_0x4211('0xf')][_0x4211('0x10')])});})[_0x4211('0x16')](handleError(_0x5284a9,null,_0x4211('0xc')));}; \ No newline at end of file +var _0xfcf9=['then','split','length','indexOf','format','kill','SIGINT','killProcess','child_process','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xfcf9,0x182));var _0x9fcf=function(_0x5a2d78,_0x1f0537){_0x5a2d78=_0x5a2d78-0x0;var _0x45d862=_0xfcf9[_0x5a2d78];return _0x45d862;};'use strict';var info=require('systeminformation');var exec=require(_0x9fcf('0x0'))[_0x9fcf('0x1')];var logger=require('../../config/logger')(_0x9fcf('0x2'));var util=require(_0x9fcf('0x3'));var BPromise=require(_0x9fcf('0x4'));var _=require(_0x9fcf('0x5'));function handleError(_0x1a52ab,_0x1e8920,_0x2c7b38){_0x1e8920=_0x1e8920||0x1f4;return function(_0x40d7a9){logger[_0x9fcf('0x6')](_0x9fcf('0x7'),_0x2c7b38,_0x1e8920,util['inspect'](_0x40d7a9,{'showHidden':![],'depth':null}));delete _0x40d7a9[_0x9fcf('0x8')];_0x1a52ab[_0x9fcf('0x9')](_0x1e8920)[_0x9fcf('0xa')](_0x40d7a9);};}exports[_0x9fcf('0xb')]=function(_0x1011dc,_0x405375){return info[_0x9fcf('0xc')]()['then'](function(_0xc612f9){return _0x405375['status'](0xc8)[_0x9fcf('0xd')](_0xc612f9);})[_0x9fcf('0xe')](function(_0x102c86){return _0x405375[_0x9fcf('0x9')](0x1f4)[_0x9fcf('0xd')](_0x102c86);});};exports['killProcess']=function(_0x30808f,_0xa4f6c1){var _0x320f77=[_0x9fcf('0xf')];return new BPromise(function(_0x59eb20,_0x12d3d9){return exec(util['format'](_0x9fcf('0x10'),_0x30808f[_0x9fcf('0x11')][_0x9fcf('0x12')]),function(_0x4291dd,_0x13196f,_0x5d6074){if(_0x4291dd){return _0x12d3d9(_0x4291dd);}return _0x59eb20(_0x13196f);});})[_0x9fcf('0x13')](function(_0x367859){var _0x45bc11=![];var _0x1ae5e6=_0x367859[_0x9fcf('0x14')](/\n/);for(var _0x44c65b=0x0,_0x4971e4=_0x320f77[_0x9fcf('0x15')];_0x44c65b<_0x4971e4,_0x45bc11===![];_0x44c65b+=0x1){if(_0x367859[_0x9fcf('0x16')](_0x320f77[_0x44c65b])>=0x0){_0x45bc11=!![];}}if(!_0x45bc11){throw new Error(util[_0x9fcf('0x17')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x30808f['params'][_0x9fcf('0x12')]));}process[_0x9fcf('0x18')](_0x30808f[_0x9fcf('0x11')][_0x9fcf('0x12')],_0x9fcf('0x19'));return _0xa4f6c1[_0x9fcf('0x9')](0xc8)[_0x9fcf('0xd')]({'message':util[_0x9fcf('0x17')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x30808f[_0x9fcf('0x11')]['pid'])});})[_0x9fcf('0xe')](handleError(_0xa4f6c1,null,_0x9fcf('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a20dde6..0fa8e36 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 _0x0b63=['./tag.controller','get','isAuthenticated','index','/:id','show','create','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b63,0xe7));var _0x30b6=function(_0x1c5c85,_0x17df4c){_0x1c5c85=_0x1c5c85-0x0;var _0x188a88=_0x0b63[_0x1c5c85];return _0x188a88;};'use strict';var multer=require(_0x30b6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x30b6('0x1'));var express=require(_0x30b6('0x2'));var router=express[_0x30b6('0x3')]();var fs_extra=require(_0x30b6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x30b6('0x5'));var config=require(_0x30b6('0x6'));var controller=require(_0x30b6('0x7'));router[_0x30b6('0x8')]('/',auth[_0x30b6('0x9')](),controller[_0x30b6('0xa')]);router['get'](_0x30b6('0xb'),auth['isAuthenticated'](),controller[_0x30b6('0xc')]);router['post']('/',auth[_0x30b6('0x9')](),controller[_0x30b6('0xd')]);router['put'](_0x30b6('0xb'),auth[_0x30b6('0x9')](),controller['update']);router[_0x30b6('0xe')](_0x30b6('0xb'),auth[_0x30b6('0x9')](),controller[_0x30b6('0xf')]);module[_0x30b6('0x10')]=router; \ No newline at end of file +var _0xbc36=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0xc95c63,_0x5f0afb){var _0x174430=function(_0x1fe55a){while(--_0x1fe55a){_0xc95c63['push'](_0xc95c63['shift']());}};_0x174430(++_0x5f0afb);}(_0xbc36,0x169));var _0x6bc3=function(_0x420483,_0x5cd57f){_0x420483=_0x420483-0x0;var _0x2fdbe1=_0xbc36[_0x420483];return _0x2fdbe1;};'use strict';var multer=require(_0x6bc3('0x0'));var util=require('util');var path=require(_0x6bc3('0x1'));var timeout=require(_0x6bc3('0x2'));var express=require(_0x6bc3('0x3'));var router=express[_0x6bc3('0x4')]();var fs_extra=require(_0x6bc3('0x5'));var auth=require(_0x6bc3('0x6'));var interaction=require(_0x6bc3('0x7'));var config=require(_0x6bc3('0x8'));var controller=require(_0x6bc3('0x9'));router['get']('/',auth[_0x6bc3('0xa')](),controller[_0x6bc3('0xb')]);router['get'](_0x6bc3('0xc'),auth[_0x6bc3('0xa')](),controller[_0x6bc3('0xd')]);router['post']('/',auth[_0x6bc3('0xa')](),controller[_0x6bc3('0xe')]);router[_0x6bc3('0xf')](_0x6bc3('0xc'),auth['isAuthenticated'](),controller[_0x6bc3('0x10')]);router[_0x6bc3('0x11')](_0x6bc3('0xc'),auth[_0x6bc3('0xa')](),controller[_0x6bc3('0x12')]);module[_0x6bc3('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 6faaa5e..66ddae8 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 _0xa846=['exports','STRING','name','#0091EA'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0xa846,0x70));var _0x6a84=function(_0x8a912d,_0x53c52b){_0x8a912d=_0x8a912d-0x0;var _0x4fb44b=_0xa846[_0x8a912d];return _0x4fb44b;};'use strict';var Sequelize=require('sequelize');module[_0x6a84('0x0')]={'name':{'type':Sequelize[_0x6a84('0x1')],'unique':_0x6a84('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6a84('0x1')],'defaultValue':_0x6a84('0x3')},'description':{'type':Sequelize[_0x6a84('0x1')]}}; \ No newline at end of file +var _0x3750=['exports','STRING','name','sequelize'];(function(_0x50412e,_0xda6a88){var _0x5545a3=function(_0x4a5167){while(--_0x4a5167){_0x50412e['push'](_0x50412e['shift']());}};_0x5545a3(++_0xda6a88);}(_0x3750,0xbb));var _0x0375=function(_0x5397f4,_0x3f2c05){_0x5397f4=_0x5397f4-0x0;var _0x4cba07=_0x3750[_0x5397f4];return _0x4cba07;};'use strict';var Sequelize=require(_0x0375('0x0'));module[_0x0375('0x1')]={'name':{'type':Sequelize[_0x0375('0x2')],'unique':_0x0375('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x0375('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x0375('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 2458224..ea7a235 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 _0x4fdb=['request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2fda00,_0x82592e){var _0xd8ae2d=function(_0x5e3fd1){while(--_0x5e3fd1){_0x2fda00['push'](_0x2fda00['shift']());}};_0xd8ae2d(++_0x82592e);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x565021,_0x331d6e){_0x565021=_0x565021-0x0;var _0x1d785b=_0x4fdb[_0x565021];return _0x1d785b;};'use strict';var emlformat=require(_0xb4fd('0x0'));var rimraf=require(_0xb4fd('0x1'));var zipdir=require(_0xb4fd('0x2'));var jsonpatch=require(_0xb4fd('0x3'));var rp=require(_0xb4fd('0x4'));var moment=require(_0xb4fd('0x5'));var BPromise=require(_0xb4fd('0x6'));var Mustache=require(_0xb4fd('0x7'));var util=require(_0xb4fd('0x8'));var path=require('path');var sox=require(_0xb4fd('0x9'));var csv=require('to-csv');var ejs=require(_0xb4fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb4fd('0xb'));var crypto=require(_0xb4fd('0xc'));var jsforce=require(_0xb4fd('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb4fd('0xe'));var Papa=require(_0xb4fd('0xf'));var Redis=require(_0xb4fd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4fd('0x11'));var as=require(_0xb4fd('0x12'));var hardwareService=require(_0xb4fd('0x13'));var logger=require(_0xb4fd('0x14'))(_0xb4fd('0x15'));var utils=require('../../config/utils');var config=require(_0xb4fd('0x16'));var licenseUtil=require(_0xb4fd('0x17'));var db=require(_0xb4fd('0x18'))['db'];function respondWithStatusCode(_0x120c2e,_0x5ba7e1){_0x5ba7e1=_0x5ba7e1||0xcc;return function(_0x38173d){if(_0x38173d){return _0x120c2e[_0xb4fd('0x19')](_0x5ba7e1);}return _0x120c2e[_0xb4fd('0x1a')](_0x5ba7e1)['end']();};}function respondWithResult(_0x399756,_0x1234d7){_0x1234d7=_0x1234d7||0xc8;return function(_0xc35d8d){if(_0xc35d8d){return _0x399756[_0xb4fd('0x1a')](_0x1234d7)[_0xb4fd('0x1b')](_0xc35d8d);}};}function respondWithFilteredResult(_0x37801f,_0x3a0872){return function(_0x47e288){if(_0x47e288){var _0x2076d5=typeof _0x3a0872[_0xb4fd('0x1c')]===_0xb4fd('0x1d')&&typeof _0x3a0872[_0xb4fd('0x1e')]===_0xb4fd('0x1d');var _0x137e51=_0x47e288[_0xb4fd('0x1f')];var _0x44f0f0=_0x2076d5?0x0:_0x3a0872[_0xb4fd('0x1c')];var _0x233044=_0x2076d5?_0x47e288[_0xb4fd('0x1f')]:_0x3a0872['offset']+_0x3a0872['limit'];var _0x504e80;if(_0x233044>=_0x137e51){_0x233044=_0x137e51;_0x504e80=0xc8;}else{_0x504e80=0xce;}_0x37801f['status'](_0x504e80);return _0x37801f[_0xb4fd('0x20')](_0xb4fd('0x21'),_0x44f0f0+'-'+_0x233044+'/'+_0x137e51)[_0xb4fd('0x1b')](_0x47e288);}return null;};}function patchUpdates(_0x1392c4){return function(_0x458133){try{jsonpatch[_0xb4fd('0x22')](_0x458133,_0x1392c4,!![]);}catch(_0xedff2f){return BPromise['reject'](_0xedff2f);}return _0x458133['save']();};}function saveUpdates(_0x216307,_0x25bb7d){return function(_0x157fc2){if(_0x157fc2){return _0x157fc2['update'](_0x216307)[_0xb4fd('0x23')](function(_0x49d42c){return _0x49d42c;});}return null;};}function removeEntity(_0x46cba4,_0x4f5032){return function(_0x2a9c8c){if(_0x2a9c8c){return _0x2a9c8c[_0xb4fd('0x24')]()[_0xb4fd('0x23')](function(){var _0x261eda=_0x2a9c8c[_0xb4fd('0x25')]({'plain':!![]});var _0x456f35=_0xb4fd('0x26');return db[_0xb4fd('0x27')]['destroy']({'where':{'type':_0x456f35,'resourceId':_0x261eda['id']}})['then'](function(){return _0x2a9c8c;});})['then'](function(){_0x46cba4[_0xb4fd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3617b2,_0x5e9d2b){return function(_0x5738c2){if(!_0x5738c2){_0x3617b2[_0xb4fd('0x19')](0x194);}return _0x5738c2;};}function handleError(_0x7c5313,_0xda5ea8){_0xda5ea8=_0xda5ea8||0x1f4;return function(_0x4a057d){logger[_0xb4fd('0x28')](_0x4a057d[_0xb4fd('0x29')]);if(_0x4a057d[_0xb4fd('0x2a')]){delete _0x4a057d[_0xb4fd('0x2a')];}_0x7c5313['status'](_0xda5ea8)[_0xb4fd('0x2b')](_0x4a057d);};}exports[_0xb4fd('0x2c')]=function(_0x4836a0,_0x3e5060){var _0x421c89={},_0xbe7d2c={},_0x597874={'count':0x0,'rows':[]};var _0xe73e10=_[_0xb4fd('0x2d')](db[_0xb4fd('0x2e')]['rawAttributes'],function(_0x55eed3){return{'name':_0x55eed3['fieldName'],'type':_0x55eed3['type'][_0xb4fd('0x2f')]};});_0xbe7d2c[_0xb4fd('0x30')]=_[_0xb4fd('0x2d')](_0xe73e10,_0xb4fd('0x2a'));_0xbe7d2c[_0xb4fd('0x31')]=_[_0xb4fd('0x32')](_0x4836a0[_0xb4fd('0x31')]);_0xbe7d2c[_0xb4fd('0x33')]=_[_0xb4fd('0x34')](_0xbe7d2c[_0xb4fd('0x30')],_0xbe7d2c[_0xb4fd('0x31')]);_0x421c89[_0xb4fd('0x35')]=_[_0xb4fd('0x34')](_0xbe7d2c[_0xb4fd('0x30')],qs[_0xb4fd('0x36')](_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x36')]));_0x421c89[_0xb4fd('0x35')]=_0x421c89['attributes']['length']?_0x421c89[_0xb4fd('0x35')]:_0xbe7d2c[_0xb4fd('0x30')];if(!_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x37')](_0xb4fd('0x38'))){_0x421c89['limit']=qs[_0xb4fd('0x1e')](_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x1e')]);_0x421c89[_0xb4fd('0x1c')]=qs[_0xb4fd('0x1c')](_0x4836a0['query'][_0xb4fd('0x1c')]);}_0x421c89['order']=qs[_0xb4fd('0x39')](_0x4836a0[_0xb4fd('0x31')]['sort']);_0x421c89['where']=qs[_0xb4fd('0x33')](_[_0xb4fd('0x3a')](_0x4836a0[_0xb4fd('0x31')],_0xbe7d2c[_0xb4fd('0x33')]),_0xe73e10);if(_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x3b')]){_0x421c89['where']=_[_0xb4fd('0x3c')](_0x421c89[_0xb4fd('0x3d')],{'$or':_['map'](_0xe73e10,function(_0x16d848){if(_0x16d848[_0xb4fd('0x3e')]!==_0xb4fd('0x3f')){var _0x39e607={};_0x39e607[_0x16d848['name']]={'$like':'%'+_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x3b')]+'%'};return _0x39e607;}})});}_0x421c89=_[_0xb4fd('0x3c')]({},_0x421c89,_0x4836a0[_0xb4fd('0x40')]);var _0xcbd37={'where':_0x421c89[_0xb4fd('0x3d')]};return db['Tag'][_0xb4fd('0x1f')](_0xcbd37)[_0xb4fd('0x23')](function(_0x5e11c0){_0x597874[_0xb4fd('0x1f')]=_0x5e11c0;if(_0x4836a0[_0xb4fd('0x31')][_0xb4fd('0x41')]){_0x421c89[_0xb4fd('0x42')]=[{'all':!![]}];}return db[_0xb4fd('0x2e')]['findAll'](_0x421c89);})[_0xb4fd('0x23')](function(_0x661f32){_0x597874[_0xb4fd('0x43')]=_0x661f32;return _0x597874;})['then'](respondWithFilteredResult(_0x3e5060,_0x421c89))[_0xb4fd('0x44')](handleError(_0x3e5060,null));};exports['show']=function(_0x3c1ffa,_0x3d5177){var _0x4d2c7c={'raw':!![],'where':{'id':_0x3c1ffa['params']['id']}},_0x563366={};_0x563366[_0xb4fd('0x30')]=_[_0xb4fd('0x32')](db[_0xb4fd('0x2e')]['rawAttributes']);_0x563366[_0xb4fd('0x31')]=_[_0xb4fd('0x32')](_0x3c1ffa[_0xb4fd('0x31')]);_0x563366[_0xb4fd('0x33')]=_[_0xb4fd('0x34')](_0x563366[_0xb4fd('0x30')],_0x563366[_0xb4fd('0x31')]);_0x4d2c7c['attributes']=_['intersection'](_0x563366[_0xb4fd('0x30')],qs[_0xb4fd('0x36')](_0x3c1ffa[_0xb4fd('0x31')][_0xb4fd('0x36')]));_0x4d2c7c['attributes']=_0x4d2c7c[_0xb4fd('0x35')]['length']?_0x4d2c7c['attributes']:_0x563366[_0xb4fd('0x30')];if(_0x3c1ffa[_0xb4fd('0x31')]['includeAll']){_0x4d2c7c[_0xb4fd('0x42')]=[{'all':!![]}];}_0x4d2c7c=_[_0xb4fd('0x3c')]({},_0x4d2c7c,_0x3c1ffa['options']);return db[_0xb4fd('0x2e')][_0xb4fd('0x45')](_0x4d2c7c)[_0xb4fd('0x23')](handleEntityNotFound(_0x3d5177,null))['then'](respondWithResult(_0x3d5177,null))['catch'](handleError(_0x3d5177,null));};exports[_0xb4fd('0x46')]=function(_0x1b5f2d,_0x17fbc7){return db[_0xb4fd('0x2e')]['create'](_0x1b5f2d[_0xb4fd('0x47')],{})[_0xb4fd('0x23')](function(_0x4f542b){var _0x126225=_0x1b5f2d[_0xb4fd('0x48')][_0xb4fd('0x25')]({'plain':!![]});if(!_0x126225)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x126225[_0xb4fd('0x49')]===_0xb4fd('0x48')){var _0x4ff60b=_0x4f542b[_0xb4fd('0x25')]({'plain':!![]});var _0x4de371='Tags';return db[_0xb4fd('0x4a')][_0xb4fd('0x45')]({'where':{'name':_0x4de371,'userProfileId':_0x126225[_0xb4fd('0x4b')]},'raw':!![]})[_0xb4fd('0x23')](function(_0x23c2a7){if(_0x23c2a7&&_0x23c2a7[_0xb4fd('0x4c')]===0x0){return db[_0xb4fd('0x27')][_0xb4fd('0x46')]({'name':_0x4ff60b[_0xb4fd('0x2a')],'resourceId':_0x4ff60b['id'],'type':_0x23c2a7[_0xb4fd('0x2a')],'sectionId':_0x23c2a7['id']},{})[_0xb4fd('0x23')](function(){return _0x4f542b;});}else{return _0x4f542b;}})[_0xb4fd('0x44')](function(_0x106196){logger[_0xb4fd('0x28')](_0xb4fd('0x4d'),_0x106196);throw _0x106196;});}return _0x4f542b;})['then'](respondWithResult(_0x17fbc7,0xc9))['catch'](handleError(_0x17fbc7,null));};exports[_0xb4fd('0x4e')]=function(_0x7c85e8,_0x39b994){if(_0x7c85e8[_0xb4fd('0x47')]['id']){delete _0x7c85e8[_0xb4fd('0x47')]['id'];}return db['Tag']['find']({'where':{'id':_0x7c85e8[_0xb4fd('0x4f')]['id']}})[_0xb4fd('0x23')](handleEntityNotFound(_0x39b994,null))['then'](saveUpdates(_0x7c85e8['body'],null))['then'](respondWithResult(_0x39b994,null))[_0xb4fd('0x44')](handleError(_0x39b994,null));};exports[_0xb4fd('0x24')]=function(_0x1d18a4,_0xfdc372){return db['Tag']['find']({'where':{'id':_0x1d18a4[_0xb4fd('0x4f')]['id']}})[_0xb4fd('0x23')](handleEntityNotFound(_0xfdc372,null))[_0xb4fd('0x23')](removeEntity(_0xfdc372,null))['catch'](handleError(_0xfdc372,null));}; \ No newline at end of file +var _0x6a24=['reject','save','update','then','destroy','get','Tags','UserProfileResource','error','name','send','index','map','Tag','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6a24,0xd1));var _0x46a2=function(_0x55a1c0,_0x17ae96){_0x55a1c0=_0x55a1c0-0x0;var _0x29001f=_0x6a24[_0x55a1c0];return _0x29001f;};'use strict';var emlformat=require(_0x46a2('0x0'));var rimraf=require(_0x46a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46a2('0x2'));var rp=require(_0x46a2('0x3'));var moment=require(_0x46a2('0x4'));var BPromise=require(_0x46a2('0x5'));var Mustache=require(_0x46a2('0x6'));var util=require('util');var path=require(_0x46a2('0x7'));var sox=require(_0x46a2('0x8'));var csv=require('to-csv');var ejs=require(_0x46a2('0x9'));var fs=require('fs');var fs_extra=require(_0x46a2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x46a2('0xb'));var jsforce=require(_0x46a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x46a2('0xd'));var querystring=require('querystring');var Papa=require(_0x46a2('0xe'));var Redis=require('ioredis');var authService=require(_0x46a2('0xf'));var qs=require(_0x46a2('0x10'));var as=require(_0x46a2('0x11'));var hardwareService=require(_0x46a2('0x12'));var logger=require(_0x46a2('0x13'))(_0x46a2('0x14'));var utils=require(_0x46a2('0x15'));var config=require(_0x46a2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403282,_0x18e584){_0x18e584=_0x18e584||0xcc;return function(_0x5c5d10){if(_0x5c5d10){return _0x403282[_0x46a2('0x17')](_0x18e584);}return _0x403282[_0x46a2('0x18')](_0x18e584)[_0x46a2('0x19')]();};}function respondWithResult(_0x18a038,_0xddc328){_0xddc328=_0xddc328||0xc8;return function(_0x2fd383){if(_0x2fd383){return _0x18a038[_0x46a2('0x18')](_0xddc328)[_0x46a2('0x1a')](_0x2fd383);}};}function respondWithFilteredResult(_0x577591,_0x4a7e7a){return function(_0x3c81e8){if(_0x3c81e8){var _0x2deb20=typeof _0x4a7e7a['offset']===_0x46a2('0x1b')&&typeof _0x4a7e7a[_0x46a2('0x1c')]==='undefined';var _0xa2eb96=_0x3c81e8[_0x46a2('0x1d')];var _0x577f18=_0x2deb20?0x0:_0x4a7e7a[_0x46a2('0x1e')];var _0x24f75f=_0x2deb20?_0x3c81e8['count']:_0x4a7e7a[_0x46a2('0x1e')]+_0x4a7e7a[_0x46a2('0x1c')];var _0x5144c7;if(_0x24f75f>=_0xa2eb96){_0x24f75f=_0xa2eb96;_0x5144c7=0xc8;}else{_0x5144c7=0xce;}_0x577591[_0x46a2('0x18')](_0x5144c7);return _0x577591[_0x46a2('0x1f')](_0x46a2('0x20'),_0x577f18+'-'+_0x24f75f+'/'+_0xa2eb96)[_0x46a2('0x1a')](_0x3c81e8);}return null;};}function patchUpdates(_0x202294){return function(_0x2d65c2){try{jsonpatch[_0x46a2('0x21')](_0x2d65c2,_0x202294,!![]);}catch(_0x473cfb){return BPromise[_0x46a2('0x22')](_0x473cfb);}return _0x2d65c2[_0x46a2('0x23')]();};}function saveUpdates(_0x5c7586,_0xa37d90){return function(_0x504b9e){if(_0x504b9e){return _0x504b9e[_0x46a2('0x24')](_0x5c7586)[_0x46a2('0x25')](function(_0x511ff6){return _0x511ff6;});}return null;};}function removeEntity(_0x43dc69,_0x15e5bb){return function(_0x233c4e){if(_0x233c4e){return _0x233c4e[_0x46a2('0x26')]()['then'](function(){var _0x197230=_0x233c4e[_0x46a2('0x27')]({'plain':!![]});var _0x1e48f5=_0x46a2('0x28');return db[_0x46a2('0x29')][_0x46a2('0x26')]({'where':{'type':_0x1e48f5,'resourceId':_0x197230['id']}})[_0x46a2('0x25')](function(){return _0x233c4e;});})[_0x46a2('0x25')](function(){_0x43dc69[_0x46a2('0x18')](0xcc)[_0x46a2('0x19')]();});}};}function handleEntityNotFound(_0x44ffb4,_0x582ada){return function(_0x2b4d9f){if(!_0x2b4d9f){_0x44ffb4[_0x46a2('0x17')](0x194);}return _0x2b4d9f;};}function handleError(_0x1c059b,_0x35dcbf){_0x35dcbf=_0x35dcbf||0x1f4;return function(_0x435155){logger[_0x46a2('0x2a')](_0x435155['stack']);if(_0x435155[_0x46a2('0x2b')]){delete _0x435155[_0x46a2('0x2b')];}_0x1c059b[_0x46a2('0x18')](_0x35dcbf)[_0x46a2('0x2c')](_0x435155);};}exports[_0x46a2('0x2d')]=function(_0x511bea,_0x4024be){var _0x4bb07e={},_0x20a0a2={},_0x97a3bf={'count':0x0,'rows':[]};var _0x3c1fba=_[_0x46a2('0x2e')](db[_0x46a2('0x2f')][_0x46a2('0x30')],function(_0x4c294a){return{'name':_0x4c294a[_0x46a2('0x31')],'type':_0x4c294a[_0x46a2('0x32')]['key']};});_0x20a0a2[_0x46a2('0x33')]=_[_0x46a2('0x2e')](_0x3c1fba,_0x46a2('0x2b'));_0x20a0a2[_0x46a2('0x34')]=_[_0x46a2('0x35')](_0x511bea['query']);_0x20a0a2['filters']=_[_0x46a2('0x36')](_0x20a0a2[_0x46a2('0x33')],_0x20a0a2[_0x46a2('0x34')]);_0x4bb07e[_0x46a2('0x37')]=_[_0x46a2('0x36')](_0x20a0a2[_0x46a2('0x33')],qs['fields'](_0x511bea['query'][_0x46a2('0x38')]));_0x4bb07e['attributes']=_0x4bb07e[_0x46a2('0x37')][_0x46a2('0x39')]?_0x4bb07e[_0x46a2('0x37')]:_0x20a0a2[_0x46a2('0x33')];if(!_0x511bea['query'][_0x46a2('0x3a')](_0x46a2('0x3b'))){_0x4bb07e[_0x46a2('0x1c')]=qs[_0x46a2('0x1c')](_0x511bea['query'][_0x46a2('0x1c')]);_0x4bb07e[_0x46a2('0x1e')]=qs[_0x46a2('0x1e')](_0x511bea[_0x46a2('0x34')]['offset']);}_0x4bb07e[_0x46a2('0x3c')]=qs['sort'](_0x511bea[_0x46a2('0x34')]['sort']);_0x4bb07e[_0x46a2('0x3d')]=qs[_0x46a2('0x3e')](_['pick'](_0x511bea[_0x46a2('0x34')],_0x20a0a2['filters']),_0x3c1fba);if(_0x511bea['query'][_0x46a2('0x3f')]){_0x4bb07e[_0x46a2('0x3d')]=_[_0x46a2('0x40')](_0x4bb07e[_0x46a2('0x3d')],{'$or':_[_0x46a2('0x2e')](_0x3c1fba,function(_0x3b2c96){if(_0x3b2c96['type']!==_0x46a2('0x41')){var _0x49ace7={};_0x49ace7[_0x3b2c96[_0x46a2('0x2b')]]={'$like':'%'+_0x511bea[_0x46a2('0x34')][_0x46a2('0x3f')]+'%'};return _0x49ace7;}})});}_0x4bb07e=_[_0x46a2('0x40')]({},_0x4bb07e,_0x511bea[_0x46a2('0x42')]);var _0x27cd37={'where':_0x4bb07e[_0x46a2('0x3d')]};return db[_0x46a2('0x2f')]['count'](_0x27cd37)[_0x46a2('0x25')](function(_0x15ec39){_0x97a3bf[_0x46a2('0x1d')]=_0x15ec39;if(_0x511bea[_0x46a2('0x34')]['includeAll']){_0x4bb07e[_0x46a2('0x43')]=[{'all':!![]}];}return db[_0x46a2('0x2f')][_0x46a2('0x44')](_0x4bb07e);})[_0x46a2('0x25')](function(_0x1fcc03){_0x97a3bf['rows']=_0x1fcc03;return _0x97a3bf;})[_0x46a2('0x25')](respondWithFilteredResult(_0x4024be,_0x4bb07e))['catch'](handleError(_0x4024be,null));};exports[_0x46a2('0x45')]=function(_0x20968b,_0x5df93d){var _0x19fcc0={'raw':!![],'where':{'id':_0x20968b[_0x46a2('0x46')]['id']}},_0x1a7e45={};_0x1a7e45[_0x46a2('0x33')]=_[_0x46a2('0x35')](db[_0x46a2('0x2f')][_0x46a2('0x30')]);_0x1a7e45[_0x46a2('0x34')]=_[_0x46a2('0x35')](_0x20968b[_0x46a2('0x34')]);_0x1a7e45['filters']=_[_0x46a2('0x36')](_0x1a7e45[_0x46a2('0x33')],_0x1a7e45[_0x46a2('0x34')]);_0x19fcc0[_0x46a2('0x37')]=_[_0x46a2('0x36')](_0x1a7e45['model'],qs[_0x46a2('0x38')](_0x20968b[_0x46a2('0x34')][_0x46a2('0x38')]));_0x19fcc0[_0x46a2('0x37')]=_0x19fcc0[_0x46a2('0x37')]['length']?_0x19fcc0[_0x46a2('0x37')]:_0x1a7e45['model'];if(_0x20968b[_0x46a2('0x34')][_0x46a2('0x47')]){_0x19fcc0['include']=[{'all':!![]}];}_0x19fcc0=_[_0x46a2('0x40')]({},_0x19fcc0,_0x20968b[_0x46a2('0x42')]);return db[_0x46a2('0x2f')][_0x46a2('0x48')](_0x19fcc0)[_0x46a2('0x25')](handleEntityNotFound(_0x5df93d,null))[_0x46a2('0x25')](respondWithResult(_0x5df93d,null))[_0x46a2('0x49')](handleError(_0x5df93d,null));};exports['create']=function(_0x369015,_0x1f8640){return db[_0x46a2('0x2f')][_0x46a2('0x4a')](_0x369015['body'],{})[_0x46a2('0x25')](function(_0x4c40a6){var _0x12f268=_0x369015[_0x46a2('0x4b')]['get']({'plain':!![]});if(!_0x12f268)throw new Error(_0x46a2('0x4c'));if(_0x12f268['role']===_0x46a2('0x4b')){var _0x76ccd3=_0x4c40a6[_0x46a2('0x27')]({'plain':!![]});var _0x38e4e7=_0x46a2('0x28');return db[_0x46a2('0x4d')]['find']({'where':{'name':_0x38e4e7,'userProfileId':_0x12f268['userProfileId']},'raw':!![]})[_0x46a2('0x25')](function(_0x1a5cf4){if(_0x1a5cf4&&_0x1a5cf4[_0x46a2('0x4e')]===0x0){return db[_0x46a2('0x29')][_0x46a2('0x4a')]({'name':_0x76ccd3[_0x46a2('0x2b')],'resourceId':_0x76ccd3['id'],'type':_0x1a5cf4[_0x46a2('0x2b')],'sectionId':_0x1a5cf4['id']},{})['then'](function(){return _0x4c40a6;});}else{return _0x4c40a6;}})[_0x46a2('0x49')](function(_0x3665db){logger[_0x46a2('0x2a')](_0x46a2('0x4f'),_0x3665db);throw _0x3665db;});}return _0x4c40a6;})[_0x46a2('0x25')](respondWithResult(_0x1f8640,0xc9))[_0x46a2('0x49')](handleError(_0x1f8640,null));};exports[_0x46a2('0x24')]=function(_0x4ff5e6,_0x3ff55a){if(_0x4ff5e6[_0x46a2('0x50')]['id']){delete _0x4ff5e6['body']['id'];}return db[_0x46a2('0x2f')][_0x46a2('0x48')]({'where':{'id':_0x4ff5e6['params']['id']}})[_0x46a2('0x25')](handleEntityNotFound(_0x3ff55a,null))[_0x46a2('0x25')](saveUpdates(_0x4ff5e6['body'],null))[_0x46a2('0x25')](respondWithResult(_0x3ff55a,null))[_0x46a2('0x49')](handleError(_0x3ff55a,null));};exports['destroy']=function(_0x5e926e,_0x48f2c2){return db['Tag'][_0x46a2('0x48')]({'where':{'id':_0x5e926e['params']['id']}})['then'](handleEntityNotFound(_0x48f2c2,null))[_0x46a2('0x25')](removeEntity(_0x48f2c2,null))[_0x46a2('0x49')](handleError(_0x48f2c2,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 205f028..943c608 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 _0x2a59=['request-promise','path','rimraf','./tag.attributes','exports','Tag','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x2a59,0x13a));var _0x92a5=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x2a59[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x92a5('0x0'));var util=require(_0x92a5('0x1'));var logger=require(_0x92a5('0x2'))('api');var moment=require(_0x92a5('0x3'));var BPromise=require(_0x92a5('0x4'));var rp=require(_0x92a5('0x5'));var fs=require('fs');var path=require(_0x92a5('0x6'));var rimraf=require(_0x92a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x92a5('0x8'));module[_0x92a5('0x9')]=function(_0x5af01d,_0x33f55a){return _0x5af01d['define'](_0x92a5('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0dc2=['request-promise','path','../../config/environment','exports','Tag','tools_tags','util','api','moment'];(function(_0x7e8ef5,_0x3117ab){var _0x4857e6=function(_0x313b49){while(--_0x313b49){_0x7e8ef5['push'](_0x7e8ef5['shift']());}};_0x4857e6(++_0x3117ab);}(_0x0dc2,0x1d1));var _0x20dc=function(_0x1e0565,_0x421106){_0x1e0565=_0x1e0565-0x0;var _0x455b90=_0x0dc2[_0x1e0565];return _0x455b90;};'use strict';var _=require('lodash');var util=require(_0x20dc('0x0'));var logger=require('../../config/logger')(_0x20dc('0x1'));var moment=require(_0x20dc('0x2'));var BPromise=require('bluebird');var rp=require(_0x20dc('0x3'));var fs=require('fs');var path=require(_0x20dc('0x4'));var rimraf=require('rimraf');var config=require(_0x20dc('0x5'));var attributes=require('./tag.attributes');module[_0x20dc('0x6')]=function(_0x6b265d,_0x4643e4){return _0x6b265d['define'](_0x20dc('0x7'),attributes,{'tableName':_0x20dc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 20ba16f..44fd219 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 _0xdd0c=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x551ffa,_0x49aa9d){var _0x307e23=function(_0x539bf8){while(--_0x539bf8){_0x551ffa['push'](_0x551ffa['shift']());}};_0x307e23(++_0x49aa9d);}(_0xdd0c,0x165));var _0xcdd0=function(_0x506a28,_0x5adcbf){_0x506a28=_0x506a28-0x0;var _0x326f71=_0xdd0c[_0x506a28];return _0x326f71;};'use strict';var _=require('lodash');var util=require(_0xcdd0('0x0'));var moment=require(_0xcdd0('0x1'));var BPromise=require(_0xcdd0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdd0('0x4'));var logger=require(_0xcdd0('0x5'))(_0xcdd0('0x6'));var config=require(_0xcdd0('0x7'));var jayson=require(_0xcdd0('0x8'));var client=jayson['client'][_0xcdd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b6f5d,_0x1fd3f6,_0x15c402){return new BPromise(function(_0x337496,_0x557a65){return client[_0xcdd0('0xa')](_0x1b6f5d,_0x15c402)['then'](function(_0x5db720){logger[_0xcdd0('0xb')](_0xcdd0('0xc'),_0x1fd3f6,_0xcdd0('0xd'));logger[_0xcdd0('0xe')](_0xcdd0('0xf'),_0x1fd3f6,_0xcdd0('0xd'),JSON[_0xcdd0('0x10')](_0x5db720));if(_0x5db720[_0xcdd0('0x11')]){if(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x12')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x557a65(_0x5db720['error'][_0xcdd0('0x13')]);}logger[_0xcdd0('0x11')]('Tag,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x337496(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);}else{logger[_0xcdd0('0xb')]('Tag,\x20%s,\x20%s',_0x1fd3f6,'request\x20sent');_0x337496(_0x5db720[_0xcdd0('0x14')][_0xcdd0('0x13')]);}})[_0xcdd0('0x15')](function(_0xf7af04){logger[_0xcdd0('0x11')](_0xcdd0('0xc'),_0x1fd3f6,_0xf7af04);_0x557a65(_0xf7af04);});});} \ No newline at end of file +var _0x0faf=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4b05cc,_0x5ad8e){var _0x198ecf=function(_0x381112){while(--_0x381112){_0x4b05cc['push'](_0x4b05cc['shift']());}};_0x198ecf(++_0x5ad8e);}(_0x0faf,0x132));var _0xf0fa=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0x0faf[_0x2b81be];return _0x8ed4a7;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var moment=require(_0xf0fa('0x1'));var BPromise=require(_0xf0fa('0x2'));var rs=require(_0xf0fa('0x3'));var fs=require('fs');var Redis=require(_0xf0fa('0x4'));var db=require(_0xf0fa('0x5'))['db'];var utils=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var config=require(_0xf0fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0fa('0xa')][_0xf0fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25b5c4,_0x3a703b,_0x2db1d9){return new BPromise(function(_0x587865,_0x42f7fd){return client[_0xf0fa('0xc')](_0x25b5c4,_0x2db1d9)['then'](function(_0x4df4d1){logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));logger[_0xf0fa('0x10')](_0xf0fa('0x11'),_0x3a703b,_0xf0fa('0xf'),JSON[_0xf0fa('0x12')](_0x4df4d1));if(_0x4df4d1[_0xf0fa('0x13')]){if(_0x4df4d1['error'][_0xf0fa('0x14')]===0x1f4){logger['error'](_0xf0fa('0xe'),_0x3a703b,_0x4df4d1['error'][_0xf0fa('0x15')]);return _0x42f7fd(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}logger['error']('Tag,\x20%s,\x20%s',_0x3a703b,_0x4df4d1[_0xf0fa('0x13')]['message']);return _0x587865(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}else{logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));_0x587865(_0x4df4d1[_0xf0fa('0x16')][_0xf0fa('0x15')]);}})[_0xf0fa('0x17')](function(_0x497542){logger[_0xf0fa('0x13')](_0xf0fa('0xe'),_0x3a703b,_0x497542);_0x42f7fd(_0x497542);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 301eea2..d0a683e 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 084f2a2..9e6bc9e 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 _0xb7e7=['STRING','sequelize'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb7e7[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x1df3f9,_0x1cd4b2){var _0x113cc9=function(_0x46d73a){while(--_0x46d73a){_0x1df3f9['push'](_0x1df3f9['shift']());}};_0x113cc9(++_0x1cd4b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xb10b[_0x4a747d];return _0x3a5b5c;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 3142c5b..57866c5 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 _0xeb79=['User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','TeamVoiceQueue','all','VoicePrefixId','isArray','Sms','removeAgents','getAgents','filter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','Team','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','merge','includeAll','include','rows','show','params','options','find','catch','create','body','get','role','user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','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','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','add','remove','ids','addAgents','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','penalty','QueueId'];(function(_0x4a3c02,_0x168879){var _0x68077a=function(_0x521d32){while(--_0x521d32){_0x4a3c02['push'](_0x4a3c02['shift']());}};_0x68077a(++_0x168879);}(_0xeb79,0xb4));var _0x9eb7=function(_0x201c34,_0x3ced43){_0x201c34=_0x201c34-0x0;var _0xd87aea=_0xeb79[_0x201c34];return _0xd87aea;};'use strict';var emlformat=require(_0x9eb7('0x0'));var rimraf=require(_0x9eb7('0x1'));var zipdir=require(_0x9eb7('0x2'));var jsonpatch=require(_0x9eb7('0x3'));var rp=require(_0x9eb7('0x4'));var moment=require(_0x9eb7('0x5'));var BPromise=require(_0x9eb7('0x6'));var Mustache=require(_0x9eb7('0x7'));var util=require('util');var path=require(_0x9eb7('0x8'));var sox=require(_0x9eb7('0x9'));var csv=require(_0x9eb7('0xa'));var ejs=require(_0x9eb7('0xb'));var fs=require('fs');var fs_extra=require(_0x9eb7('0xc'));var _=require(_0x9eb7('0xd'));var squel=require('squel');var crypto=require(_0x9eb7('0xe'));var jsforce=require(_0x9eb7('0xf'));var deskjs=require(_0x9eb7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9eb7('0x11'));var Redis=require(_0x9eb7('0x12'));var authService=require(_0x9eb7('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9eb7('0x14'))(_0x9eb7('0x15'));var utils=require(_0x9eb7('0x16'));var config=require(_0x9eb7('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x9eb7('0x18')](config[_0x9eb7('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9eb7('0x1a'))(new Redis(config[_0x9eb7('0x19')]));require(_0x9eb7('0x1b'))[_0x9eb7('0x1c')](socket);function respondWithStatusCode(_0x51923f,_0x34beec){_0x34beec=_0x34beec||0xcc;return function(_0x3520d4){if(_0x3520d4){return _0x51923f[_0x9eb7('0x1d')](_0x34beec);}return _0x51923f['status'](_0x34beec)[_0x9eb7('0x1e')]();};}function respondWithResult(_0x3a512f,_0x3f94f6){_0x3f94f6=_0x3f94f6||0xc8;return function(_0x28531a){if(_0x28531a){return _0x3a512f[_0x9eb7('0x1f')](_0x3f94f6)[_0x9eb7('0x20')](_0x28531a);}};}function respondWithFilteredResult(_0x5b5113,_0x49a6d8){return function(_0x394f7b){if(_0x394f7b){var _0xc21e6b=typeof _0x49a6d8['offset']===_0x9eb7('0x21')&&typeof _0x49a6d8['limit']===_0x9eb7('0x21');var _0x4b9f7d=_0x394f7b['count'];var _0x41251a=_0xc21e6b?0x0:_0x49a6d8[_0x9eb7('0x22')];var _0x49f25a=_0xc21e6b?_0x394f7b[_0x9eb7('0x23')]:_0x49a6d8[_0x9eb7('0x22')]+_0x49a6d8['limit'];var _0x548018;if(_0x49f25a>=_0x4b9f7d){_0x49f25a=_0x4b9f7d;_0x548018=0xc8;}else{_0x548018=0xce;}_0x5b5113[_0x9eb7('0x1f')](_0x548018);return _0x5b5113[_0x9eb7('0x24')](_0x9eb7('0x25'),_0x41251a+'-'+_0x49f25a+'/'+_0x4b9f7d)['json'](_0x394f7b);}return null;};}function patchUpdates(_0x2291ee){return function(_0x5509be){try{jsonpatch[_0x9eb7('0x26')](_0x5509be,_0x2291ee,!![]);}catch(_0x52ecdf){return BPromise[_0x9eb7('0x27')](_0x52ecdf);}return _0x5509be[_0x9eb7('0x28')]();};}function saveUpdates(_0x36b21e,_0x3e8d54){return function(_0x439ecd){if(_0x439ecd){return _0x439ecd[_0x9eb7('0x29')](_0x36b21e)[_0x9eb7('0x2a')](function(_0x4f502e){return _0x4f502e;});}return null;};}function handleEntityNotFound(_0x2cff70,_0x418010){return function(_0x141599){if(!_0x141599){_0x2cff70[_0x9eb7('0x1d')](0x194);}return _0x141599;};}function handleError(_0x10ccb0,_0x2d0cef){_0x2d0cef=_0x2d0cef||0x1f4;return function(_0x49424a){logger[_0x9eb7('0x2b')](_0x49424a[_0x9eb7('0x2c')]);if(_0x49424a[_0x9eb7('0x2d')]){delete _0x49424a[_0x9eb7('0x2d')];}_0x10ccb0[_0x9eb7('0x1f')](_0x2d0cef)[_0x9eb7('0x2e')](_0x49424a);};}exports[_0x9eb7('0x2f')]=function(_0x4b1200,_0x5edd61){var _0x1bb03f={},_0x1b8b39={},_0x1ff594={'count':0x0,'rows':[]};var _0x4d4257=_['map'](db[_0x9eb7('0x30')][_0x9eb7('0x31')],function(_0x13754a){return{'name':_0x13754a[_0x9eb7('0x32')],'type':_0x13754a[_0x9eb7('0x33')][_0x9eb7('0x34')]};});_0x1b8b39[_0x9eb7('0x35')]=_[_0x9eb7('0x36')](_0x4d4257,_0x9eb7('0x2d'));_0x1b8b39[_0x9eb7('0x37')]=_[_0x9eb7('0x38')](_0x4b1200[_0x9eb7('0x37')]);_0x1b8b39[_0x9eb7('0x39')]=_[_0x9eb7('0x3a')](_0x1b8b39[_0x9eb7('0x35')],_0x1b8b39[_0x9eb7('0x37')]);_0x1bb03f[_0x9eb7('0x3b')]=_[_0x9eb7('0x3a')](_0x1b8b39[_0x9eb7('0x35')],qs[_0x9eb7('0x3c')](_0x4b1200['query'][_0x9eb7('0x3c')]));_0x1bb03f['attributes']=_0x1bb03f['attributes'][_0x9eb7('0x3d')]?_0x1bb03f[_0x9eb7('0x3b')]:_0x1b8b39[_0x9eb7('0x35')];if(!_0x4b1200[_0x9eb7('0x37')][_0x9eb7('0x3e')]('nolimit')){_0x1bb03f[_0x9eb7('0x3f')]=qs[_0x9eb7('0x3f')](_0x4b1200[_0x9eb7('0x37')]['limit']);_0x1bb03f['offset']=qs[_0x9eb7('0x22')](_0x4b1200[_0x9eb7('0x37')][_0x9eb7('0x22')]);}_0x1bb03f[_0x9eb7('0x40')]=qs[_0x9eb7('0x41')](_0x4b1200[_0x9eb7('0x37')][_0x9eb7('0x41')]);_0x1bb03f[_0x9eb7('0x42')]=qs[_0x9eb7('0x39')](_['pick'](_0x4b1200['query'],_0x1b8b39[_0x9eb7('0x39')]),_0x4d4257);if(_0x4b1200[_0x9eb7('0x37')]['filter']){_0x1bb03f['where']=_[_0x9eb7('0x43')](_0x1bb03f[_0x9eb7('0x42')],{'$or':_['map'](_0x4d4257,function(_0x26f071){if(_0x26f071['type']!=='VIRTUAL'){var _0x95876a={};_0x95876a[_0x26f071[_0x9eb7('0x2d')]]={'$like':'%'+_0x4b1200[_0x9eb7('0x37')]['filter']+'%'};return _0x95876a;}})});}_0x1bb03f=_[_0x9eb7('0x43')]({},_0x1bb03f,_0x4b1200['options']);var _0x2b0918={'where':_0x1bb03f[_0x9eb7('0x42')]};return db[_0x9eb7('0x30')][_0x9eb7('0x23')](_0x2b0918)[_0x9eb7('0x2a')](function(_0xc18eaf){_0x1ff594[_0x9eb7('0x23')]=_0xc18eaf;if(_0x4b1200[_0x9eb7('0x37')][_0x9eb7('0x44')]){_0x1bb03f[_0x9eb7('0x45')]=[{'all':!![]}];}return db[_0x9eb7('0x30')]['findAll'](_0x1bb03f);})[_0x9eb7('0x2a')](function(_0x2e552e){_0x1ff594[_0x9eb7('0x46')]=_0x2e552e;return _0x1ff594;})[_0x9eb7('0x2a')](respondWithFilteredResult(_0x5edd61,_0x1bb03f))['catch'](handleError(_0x5edd61,null));};exports[_0x9eb7('0x47')]=function(_0x3f5a72,_0xcc2121){var _0x2476d3={'raw':![],'where':{'id':_0x3f5a72[_0x9eb7('0x48')]['id']}},_0x22ca3e={};_0x22ca3e[_0x9eb7('0x35')]=_[_0x9eb7('0x38')](db[_0x9eb7('0x30')][_0x9eb7('0x31')]);_0x22ca3e[_0x9eb7('0x37')]=_[_0x9eb7('0x38')](_0x3f5a72['query']);_0x22ca3e['filters']=_[_0x9eb7('0x3a')](_0x22ca3e[_0x9eb7('0x35')],_0x22ca3e[_0x9eb7('0x37')]);_0x2476d3[_0x9eb7('0x3b')]=_['intersection'](_0x22ca3e[_0x9eb7('0x35')],qs['fields'](_0x3f5a72[_0x9eb7('0x37')][_0x9eb7('0x3c')]));_0x2476d3[_0x9eb7('0x3b')]=_0x2476d3[_0x9eb7('0x3b')][_0x9eb7('0x3d')]?_0x2476d3[_0x9eb7('0x3b')]:_0x22ca3e[_0x9eb7('0x35')];if(_0x3f5a72[_0x9eb7('0x37')][_0x9eb7('0x44')]){_0x2476d3[_0x9eb7('0x45')]=[{'all':!![]}];}_0x2476d3=_[_0x9eb7('0x43')]({},_0x2476d3,_0x3f5a72[_0x9eb7('0x49')]);return db[_0x9eb7('0x30')][_0x9eb7('0x4a')](_0x2476d3)[_0x9eb7('0x2a')](handleEntityNotFound(_0xcc2121,null))[_0x9eb7('0x2a')](respondWithResult(_0xcc2121,null))[_0x9eb7('0x4b')](handleError(_0xcc2121,null));};exports[_0x9eb7('0x4c')]=function(_0x43e03a,_0x4df1f8){return db[_0x9eb7('0x30')]['create'](_0x43e03a[_0x9eb7('0x4d')],{})[_0x9eb7('0x2a')](function(_0x33cbfa){var _0xe2927d=_0x43e03a['user'][_0x9eb7('0x4e')]({'plain':!![]});if(!_0xe2927d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe2927d[_0x9eb7('0x4f')]===_0x9eb7('0x50')){var _0x4b8322=_0x33cbfa[_0x9eb7('0x4e')]({'plain':!![]});var _0x5866c4=_0x9eb7('0x51');return db[_0x9eb7('0x52')][_0x9eb7('0x4a')]({'where':{'name':_0x5866c4,'userProfileId':_0xe2927d[_0x9eb7('0x53')]},'raw':!![]})['then'](function(_0xe09fdd){if(_0xe09fdd&&_0xe09fdd[_0x9eb7('0x54')]===0x0){return db[_0x9eb7('0x55')][_0x9eb7('0x4c')]({'name':_0x4b8322[_0x9eb7('0x2d')],'resourceId':_0x4b8322['id'],'type':_0xe09fdd[_0x9eb7('0x2d')],'sectionId':_0xe09fdd['id']},{})[_0x9eb7('0x2a')](function(){return _0x33cbfa;});}else{return _0x33cbfa;}})['catch'](function(_0x369afb){logger[_0x9eb7('0x2b')](_0x9eb7('0x56'),_0x369afb);throw _0x369afb;});}return _0x33cbfa;})[_0x9eb7('0x2a')](respondWithResult(_0x4df1f8,0xc9))[_0x9eb7('0x4b')](handleError(_0x4df1f8,null));};exports['update']=function(_0x14bf68,_0x56c383){if(_0x14bf68[_0x9eb7('0x4d')]['id']){delete _0x14bf68['body']['id'];}return db[_0x9eb7('0x30')][_0x9eb7('0x4a')]({'where':{'id':_0x14bf68[_0x9eb7('0x48')]['id']}})[_0x9eb7('0x2a')](handleEntityNotFound(_0x56c383,null))[_0x9eb7('0x2a')](saveUpdates(_0x14bf68['body'],null))[_0x9eb7('0x2a')](respondWithResult(_0x56c383,null))['catch'](handleError(_0x56c383,null));};exports[_0x9eb7('0x57')]=function(_0x4d9bb1,_0x5891f1){var _0x46e77e=_0x4d9bb1[_0x9eb7('0x48')]['id'];var _0x4c02a4=[];return db[_0x9eb7('0x58')][_0x9eb7('0x59')](function(_0x896b7f){var _0x284856=_0x9eb7('0x5a')+_0x46e77e;return db['sequelize'][_0x9eb7('0x37')](_0x284856,{'type':db[_0x9eb7('0x5b')][_0x9eb7('0x5c')][_0x9eb7('0x5d')],'raw':!![],'transaction':_0x896b7f})['then'](function(_0x2b476f){_0x4c02a4=_[_0x9eb7('0x36')](_0x2b476f,function(_0x1d8937){return Number(_0x1d8937['UserId']);});})[_0x9eb7('0x2a')](function(){var _0x3b35f3=_0x9eb7('0x5e')+_0x46e77e;return db[_0x9eb7('0x58')][_0x9eb7('0x37')](_0x3b35f3,{'type':db[_0x9eb7('0x5b')]['QueryTypes'][_0x9eb7('0x5d')],'raw':!![],'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(_0xb4458){var _0x469c92=_['map'](_0xb4458,function(_0x1887c6){return Number(_0x1887c6[_0x9eb7('0x5f')]);});return db[_0x9eb7('0x60')][_0x9eb7('0x57')]({'where':{'UserId':{'$in':_0x4c02a4},'VoiceQueueId':{'$in':_0x469c92}},'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(){var _0x3e2e95=_0x9eb7('0x61')+_0x46e77e;return db[_0x9eb7('0x58')]['query'](_0x3e2e95,{'type':db[_0x9eb7('0x5b')][_0x9eb7('0x5c')][_0x9eb7('0x5d')],'raw':!![],'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(_0x6a4f73){var _0x5b3284=_[_0x9eb7('0x36')](_0x6a4f73,function(_0x1bf54a){return Number(_0x1bf54a[_0x9eb7('0x62')]);});return db[_0x9eb7('0x63')][_0x9eb7('0x57')]({'where':{'UserId':{'$in':_0x4c02a4},'MailQueueId':{'$in':_0x5b3284}},'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(){var _0x26b7cc=_0x9eb7('0x64')+_0x46e77e;return db[_0x9eb7('0x58')][_0x9eb7('0x37')](_0x26b7cc,{'type':db[_0x9eb7('0x5b')][_0x9eb7('0x5c')][_0x9eb7('0x5d')],'raw':!![],'transaction':_0x896b7f});})['then'](function(_0x2c1169){var _0x20843d=_['map'](_0x2c1169,function(_0x37e915){return Number(_0x37e915[_0x9eb7('0x65')]);});return db[_0x9eb7('0x66')][_0x9eb7('0x57')]({'where':{'UserId':{'$in':_0x4c02a4},'SmsQueueId':{'$in':_0x20843d}},'transaction':_0x896b7f});})['then'](function(){var _0x542d4d=_0x9eb7('0x67')+_0x46e77e;return db['sequelize'][_0x9eb7('0x37')](_0x542d4d,{'type':db['Sequelize'][_0x9eb7('0x5c')][_0x9eb7('0x5d')],'raw':!![],'transaction':_0x896b7f});})['then'](function(_0x56e8a4){var _0x254d64=_['map'](_0x56e8a4,function(_0x3a6979){return Number(_0x3a6979[_0x9eb7('0x68')]);});return db[_0x9eb7('0x69')]['destroy']({'where':{'UserId':{'$in':_0x4c02a4},'ChatQueueId':{'$in':_0x254d64}},'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(){var _0x3a7867=_0x9eb7('0x6a')+_0x46e77e;return db['sequelize'][_0x9eb7('0x37')](_0x3a7867,{'type':db['Sequelize']['QueryTypes'][_0x9eb7('0x5d')],'raw':!![],'transaction':_0x896b7f});})['then'](function(_0x4707af){var _0x3b1853=_[_0x9eb7('0x36')](_0x4707af,function(_0x576326){return Number(_0x576326[_0x9eb7('0x6b')]);});return db[_0x9eb7('0x6c')][_0x9eb7('0x57')]({'where':{'UserId':{'$in':_0x4c02a4},'FaxQueueId':{'$in':_0x3b1853}},'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(){var _0x1ad45a=_0x9eb7('0x6d')+_0x46e77e;return db['sequelize'][_0x9eb7('0x37')](_0x1ad45a,{'type':db[_0x9eb7('0x5b')][_0x9eb7('0x5c')][_0x9eb7('0x5d')],'raw':!![],'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(_0x2e2f17){var _0x12ec82=_[_0x9eb7('0x36')](_0x2e2f17,function(_0x6f554b){return Number(_0x6f554b['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x9eb7('0x57')]({'where':{'UserId':{'$in':_0x4c02a4},'OpenchannelQueueId':{'$in':_0x12ec82}},'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(){var _0x402aaa=_0x9eb7('0x6e')+_0x46e77e;return db[_0x9eb7('0x58')]['query'](_0x402aaa,{'type':db[_0x9eb7('0x5b')][_0x9eb7('0x5c')][_0x9eb7('0x5d')],'raw':!![],'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(_0x740596){var _0x3e536c=_[_0x9eb7('0x36')](_0x740596,function(_0x7476c6){return Number(_0x7476c6['WhatsappQueueId']);});return db[_0x9eb7('0x6f')][_0x9eb7('0x57')]({'where':{'UserId':{'$in':_0x4c02a4},'WhatsappQueueId':{'$in':_0x3e536c}},'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(){return db[_0x9eb7('0x70')][_0x9eb7('0x4a')]({'where':{'TeamId':_0x46e77e}});})[_0x9eb7('0x2a')](function(_0x7e2ce8){if(_0x7e2ce8===null){return;}return db[_0x9eb7('0x71')][_0x9eb7('0x57')]({'where':{'UserId':{'$in':_0x4c02a4},'VoicePrefixId':_0x7e2ce8['VoicePrefixId']},'transaction':_0x896b7f});})['then'](function(){return db[_0x9eb7('0x30')][_0x9eb7('0x57')]({'where':{'id':_0x46e77e},'cascade':!![],'transaction':_0x896b7f});})[_0x9eb7('0x2a')](function(_0x6f629a){if(_0x6f629a===0x0){_0x5891f1[_0x9eb7('0x1d')](0x194);}else{return db[_0x9eb7('0x55')]['destroy']({'where':{'type':_0x9eb7('0x51'),'resourceId':_0x46e77e},'cascade':!![],'transaction':_0x896b7f})[_0x9eb7('0x2a')](function(){_0x5891f1['status'](0xcc)[_0x9eb7('0x1e')]();});}})[_0x9eb7('0x4b')](function(_0x13d2f2){_0x5891f1[_0x9eb7('0x1f')](0x1f4)[_0x9eb7('0x2e')](_0x13d2f2);});});};exports[_0x9eb7('0x72')]=function(_0x1a136f,_0x5cb9b6,_0x1c9e25){return db[_0x9eb7('0x30')][_0x9eb7('0x73')]({'where':{'id':_0x1a136f[_0x9eb7('0x48')]['id']}})[_0x9eb7('0x2a')](handleEntityNotFound(_0x5cb9b6,null))['then'](function(_0x27f586){if(!_0x1a136f[_0x9eb7('0x37')][_0x9eb7('0x74')]||!utils[_0x9eb7('0x75')](_0x1a136f['query']['channel'])){throw new db[(_0x9eb7('0x5b'))][(_0x9eb7('0x76'))](_0x9eb7('0x77'));}var _0x5ae42a={};var _0x460a79={};_0x460a79[_0x9eb7('0x35')]=_['keys'](db[_[_0x9eb7('0x78')](_0x1a136f['query']['channel'][_0x9eb7('0x79')]())+_0x9eb7('0x7a')][_0x9eb7('0x31')]);_0x460a79[_0x9eb7('0x37')]=_[_0x9eb7('0x38')](_0x1a136f[_0x9eb7('0x37')]);_0x460a79[_0x9eb7('0x39')]=_[_0x9eb7('0x3a')](_0x460a79[_0x9eb7('0x35')],_0x460a79['query']);_0x5ae42a[_0x9eb7('0x3b')]=_[_0x9eb7('0x3a')](_0x460a79['model'],qs['fields'](_0x1a136f['query']['fields']));_0x5ae42a['attributes']=_0x5ae42a[_0x9eb7('0x3b')][_0x9eb7('0x3d')]?_0x5ae42a[_0x9eb7('0x3b')]:_0x460a79[_0x9eb7('0x35')];_0x5ae42a[_0x9eb7('0x3f')]=qs[_0x9eb7('0x3f')](_0x1a136f[_0x9eb7('0x37')]['limit']);_0x5ae42a['offset']=qs[_0x9eb7('0x22')](_0x1a136f['query'][_0x9eb7('0x22')]);_0x5ae42a[_0x9eb7('0x40')]=qs[_0x9eb7('0x41')](_0x1a136f[_0x9eb7('0x37')][_0x9eb7('0x41')]);_0x5ae42a['where']=qs[_0x9eb7('0x39')](_[_0x9eb7('0x7b')](_0x1a136f[_0x9eb7('0x37')],_0x460a79['filters']));_0x5ae42a=_[_0x9eb7('0x43')]({},_0x5ae42a,_0x1a136f[_0x9eb7('0x49')]);return _0x27f586[_0x9eb7('0x4e')+_['capitalize'](_0x1a136f[_0x9eb7('0x37')][_0x9eb7('0x74')]['toLowerCase']())+_0x9eb7('0x7c')](_0x5ae42a);})[_0x9eb7('0x2a')](respondWithResult(_0x5cb9b6,null))[_0x9eb7('0x4b')](handleError(_0x5cb9b6,null));};exports[_0x9eb7('0x7d')]=function(_0x3f0526,_0x3b31d2,_0x431e42){return db[_0x9eb7('0x30')][_0x9eb7('0x73')]({'where':{'id':_0x3f0526[_0x9eb7('0x48')]['id']}})[_0x9eb7('0x2a')](function(_0x1226a7){if(_0x1226a7){if(!_0x3f0526['body'][_0x9eb7('0x74')]||!utils[_0x9eb7('0x75')](_0x3f0526['body'][_0x9eb7('0x74')])){throw new db['Sequelize']['ValidationError'](_0x9eb7('0x77'));}return _0x1226a7[_0x9eb7('0x7e')+_[_0x9eb7('0x78')](_0x3f0526[_0x9eb7('0x4d')][_0x9eb7('0x74')][_0x9eb7('0x79')]())+_0x9eb7('0x7c')](_0x3f0526[_0x9eb7('0x4d')]['ids']);}return null;})[_0x9eb7('0x2a')](handleEntityNotFound(_0x3b31d2,null))[_0x9eb7('0x2a')](respondWithStatusCode(_0x3b31d2,null))['catch'](handleError(_0x3b31d2,null));};exports['removeQueues']=function(_0x505c77,_0x54b8f3,_0x385032){return db[_0x9eb7('0x30')][_0x9eb7('0x73')]({'where':{'id':_0x505c77[_0x9eb7('0x48')]['id']}})[_0x9eb7('0x2a')](function(_0x87ec2d){if(_0x87ec2d){if(!_0x505c77['query']['channel']||!utils['isValidChannel'](_0x505c77[_0x9eb7('0x37')][_0x9eb7('0x74')])){throw new db[(_0x9eb7('0x5b'))]['ValidationError'](_0x9eb7('0x77'));}return _0x87ec2d[_0x9eb7('0x7f')+_[_0x9eb7('0x78')](_0x505c77[_0x9eb7('0x37')]['channel'][_0x9eb7('0x79')]())+_0x9eb7('0x7c')](_0x505c77[_0x9eb7('0x37')][_0x9eb7('0x80')]);}return null;})[_0x9eb7('0x2a')](handleEntityNotFound(_0x54b8f3,null))[_0x9eb7('0x2a')](respondWithStatusCode(_0x54b8f3,null))[_0x9eb7('0x4b')](handleError(_0x54b8f3,null));};exports[_0x9eb7('0x81')]=function(_0x1adfc6,_0x3a17e5){var _0x5bba2d=_['isArray'](_0x1adfc6[_0x9eb7('0x4d')][_0x9eb7('0x80')])?_0x1adfc6['body'][_0x9eb7('0x80')]:[_0x1adfc6['body'][_0x9eb7('0x80')]];var _0x374e71=_0x1adfc6[_0x9eb7('0x48')]['id'];return db[_0x9eb7('0x30')]['find']({'where':{'id':_0x374e71}})[_0x9eb7('0x2a')](handleEntityNotFound(_0x3a17e5,null))['then'](function(_0x43583b){if(_0x43583b){var _0x49a177=[_0x9eb7('0x82'),_0x9eb7('0x83'),_0x9eb7('0x84'),'Sms',_0x9eb7('0x85'),_0x9eb7('0x86'),_0x9eb7('0x87')];return db[_0x9eb7('0x58')]['transaction'](function(_0x464f2f){var _0x48826a=_['map'](_0x49a177,function(_0x5e97ea){var _0x544150={'attributes':['id',_0x9eb7('0x2d')]};if(_0x5e97ea===_0x9eb7('0x82')){_0x544150['through']={'attributes':[_0x9eb7('0x88')]};}return _0x43583b[_0x9eb7('0x4e')+_0x5e97ea+_0x9eb7('0x7c')](_0x544150)[_0x9eb7('0x2a')](function(_0x242cd9){var _0x1c583f=_[_0x9eb7('0x36')](_0x242cd9,function(_0x14f25e){var _0x38a283=_[_0x9eb7('0x36')](_0x5bba2d,function(_0x4b3d2c){var _0x57af16={'where':{'UserId':_0x4b3d2c,[_0x5e97ea+_0x9eb7('0x89')]:_0x14f25e['id']},'transaction':_0x464f2f};if(_0x5e97ea==='Voice'){_0x57af16[_0x9eb7('0x18')]={'penalty':_0x14f25e['TeamVoiceQueue']['penalty']};}return db[_0x9eb7('0x8a')+_0x5e97ea+'Queue'][_0x9eb7('0x8b')](_0x57af16)[_0x9eb7('0x2a')](function(){socket[_0x9eb7('0x8c')](_0x9eb7('0x50')+_0x5e97ea+_0x9eb7('0x8d'),{'UserId':_0x4b3d2c,[_0x5e97ea+_0x9eb7('0x89')]:_0x14f25e['id']});if(_0x5e97ea!==_0x9eb7('0x82')){return;}return db[_0x9eb7('0x8a')][_0x9eb7('0x8e')]({'where':{'id':_0x5bba2d,'online':0x1},'attributes':['id',_0x9eb7('0x2d'),_0x9eb7('0x8f'),_0x9eb7('0x90'),_0x9eb7('0x91')],'raw':!![]})[_0x9eb7('0x2a')](function(_0x396e43){var _0x12d6b6=_[_0x9eb7('0x36')](_0x396e43,function(_0x1444e2){return db[_0x9eb7('0x92')][_0x9eb7('0x93')]({'membername':_0x1444e2[_0x9eb7('0x2d')],'UserId':_0x1444e2['id'],'queue_name':_0x14f25e[_0x9eb7('0x2d')],'VoiceQueueId':_0x14f25e['id'],'interface':_[_0x9eb7('0x94')](_0x1444e2[_0x9eb7('0x91')])?util['format'](_0x9eb7('0x95'),_0x1444e2['name']):_0x1444e2[_0x9eb7('0x91')],'paused':_0x1444e2[_0x9eb7('0x90')]||![],'penalty':_0x14f25e[_0x9eb7('0x96')][_0x9eb7('0x88')]},{'transaction':_0x464f2f});});return Promise[_0x9eb7('0x97')](_0x12d6b6);});});});return Promise['all'](_0x38a283);});return Promise['all'](_0x1c583f);})[_0x9eb7('0x2a')](function(){return db[_0x9eb7('0x70')][_0x9eb7('0x73')]({'where':{'teamId':_0x374e71}})[_0x9eb7('0x2a')](function(_0x4624b6){if(_0x4624b6){var _0x41032a=_[_0x9eb7('0x36')](_0x5bba2d,function(_0x1e93fc){db['UserVoicePrefix'][_0x9eb7('0x93')]({'UserId':_0x1e93fc,'VoicePrefixId':_0x4624b6[_0x9eb7('0x98')]});});return Promise[_0x9eb7('0x97')](_0x41032a);}});});});return Promise['all'](_0x48826a)[_0x9eb7('0x2a')](function(){return _0x43583b[_0x9eb7('0x81')](_0x5bba2d,{'transaction':_0x464f2f})['spread'](function(_0x161402){return _0x161402;});});});}})[_0x9eb7('0x2a')](respondWithResult(_0x3a17e5,null))[_0x9eb7('0x4b')](handleError(_0x3a17e5,null));};exports['removeAgents']=function(_0x328558,_0x5dbc43){var _0x33f9b0=_[_0x9eb7('0x99')](_0x328558['query'][_0x9eb7('0x80')])?_0x328558[_0x9eb7('0x37')][_0x9eb7('0x80')]:[_0x328558[_0x9eb7('0x37')]['ids']];var _0x2c3cc5=_0x328558[_0x9eb7('0x48')]['id'];return db['Team'][_0x9eb7('0x4a')]({'where':{'id':_0x2c3cc5}})['then'](handleEntityNotFound(_0x5dbc43,null))[_0x9eb7('0x2a')](function(_0x389a50){if(_0x389a50){var _0x37323d=[_0x9eb7('0x82'),_0x9eb7('0x83'),_0x9eb7('0x84'),_0x9eb7('0x9a'),'Fax','Openchannel',_0x9eb7('0x87')];return db[_0x9eb7('0x58')][_0x9eb7('0x59')](function(_0x267f74){var _0x1f2765=_['map'](_0x37323d,function(_0x3f43ba){var _0xcf337c={'attributes':['id',_0x9eb7('0x2d')]};return _0x389a50['get'+_0x3f43ba+_0x9eb7('0x7c')](_0xcf337c)[_0x9eb7('0x2a')](function(_0x59f5ab){var _0x243743=_[_0x9eb7('0x36')](_0x59f5ab,function(_0x312fb5){return _0x312fb5[_0x9eb7('0x9b')](_0x33f9b0,{'transaction':_0x267f74})[_0x9eb7('0x2a')](function(){var _0x43dd63=_['map'](_0x33f9b0,function(_0x5c0f23){socket[_0x9eb7('0x8c')](_0x9eb7('0x50')+_0x3f43ba+'Queue:remove',{'UserId':Number(_0x5c0f23),[_0x3f43ba+_0x9eb7('0x89')]:_0x312fb5['id']});if(_0x3f43ba!==_0x9eb7('0x82')){return;}return db[_0x9eb7('0x92')][_0x9eb7('0x57')]({'where':{'VoiceQueueId':_0x312fb5['id'],'UserId':_0x5c0f23},'transaction':_0x267f74});});return Promise[_0x9eb7('0x97')](_0x43dd63);});});return Promise['all'](_0x243743);});});return Promise[_0x9eb7('0x97')](_0x1f2765)['then'](function(){return _0x389a50[_0x9eb7('0x9b')](_0x33f9b0,{'transaction':_0x267f74});})[_0x9eb7('0x2a')](function(){return db[_0x9eb7('0x70')][_0x9eb7('0x73')]({'where':{'teamId':_0x2c3cc5}})[_0x9eb7('0x2a')](function(_0x201aba){if(_0x201aba){var _0xaf3fd1=_[_0x9eb7('0x36')](_0x33f9b0,function(_0x20a2e3){db['UserVoicePrefix'][_0x9eb7('0x57')]({'where':{'UserId':_0x20a2e3,'VoicePrefixId':_0x201aba[_0x9eb7('0x98')]}});});return Promise['all'](_0xaf3fd1);}});});});}})[_0x9eb7('0x2a')](respondWithStatusCode(_0x5dbc43,null))['catch'](handleError(_0x5dbc43,null));};exports[_0x9eb7('0x9c')]=function(_0x4e194c,_0x1267df,_0x51fcf6){var _0x546acf={};var _0x5b9c9a={};var _0x27e908;var _0xe09b0a;return db[_0x9eb7('0x30')][_0x9eb7('0x73')]({'where':{'id':_0x4e194c['params']['id']}})[_0x9eb7('0x2a')](handleEntityNotFound(_0x1267df,null))[_0x9eb7('0x2a')](function(_0x50a59d){if(_0x50a59d){_0x27e908=_0x50a59d;_0x5b9c9a[_0x9eb7('0x35')]=_[_0x9eb7('0x38')](db[_0x9eb7('0x8a')][_0x9eb7('0x31')]);_0x5b9c9a[_0x9eb7('0x37')]=_[_0x9eb7('0x38')](_0x4e194c['query']);_0x5b9c9a[_0x9eb7('0x39')]=_[_0x9eb7('0x3a')](_0x5b9c9a[_0x9eb7('0x35')],_0x5b9c9a[_0x9eb7('0x37')]);_0x546acf[_0x9eb7('0x3b')]=_[_0x9eb7('0x3a')](_0x5b9c9a[_0x9eb7('0x35')],qs[_0x9eb7('0x3c')](_0x4e194c[_0x9eb7('0x37')][_0x9eb7('0x3c')]));_0x546acf['attributes']=_0x546acf[_0x9eb7('0x3b')][_0x9eb7('0x3d')]?_0x546acf[_0x9eb7('0x3b')]:_0x5b9c9a[_0x9eb7('0x35')];_0x546acf[_0x9eb7('0x40')]=qs[_0x9eb7('0x41')](_0x4e194c[_0x9eb7('0x37')][_0x9eb7('0x41')]);_0x546acf['where']=qs[_0x9eb7('0x39')](_[_0x9eb7('0x7b')](_0x4e194c[_0x9eb7('0x37')],_0x5b9c9a[_0x9eb7('0x39')]));if(_0x4e194c[_0x9eb7('0x37')][_0x9eb7('0x9d')]){_0x546acf[_0x9eb7('0x42')]=_[_0x9eb7('0x43')](_0x546acf[_0x9eb7('0x42')],{'$or':_[_0x9eb7('0x36')](_0x546acf[_0x9eb7('0x3b')],function(_0x4f7696){var _0x1fc950={};_0x1fc950[_0x4f7696]={'$like':'%'+_0x4e194c['query'][_0x9eb7('0x9d')]+'%'};return _0x1fc950;})});}_0x546acf=_['merge']({},_0x546acf,_0x4e194c[_0x9eb7('0x49')]);return _0x27e908[_0x9eb7('0x9c')](_0x546acf);}})['then'](function(_0x4455f8){if(_0x4455f8){_0xe09b0a=_0x4455f8[_0x9eb7('0x3d')];if(!_0x4e194c[_0x9eb7('0x37')][_0x9eb7('0x3e')](_0x9eb7('0x9e'))){_0x546acf['limit']=qs[_0x9eb7('0x3f')](_0x4e194c[_0x9eb7('0x37')]['limit']);_0x546acf[_0x9eb7('0x22')]=qs[_0x9eb7('0x22')](_0x4e194c['query'][_0x9eb7('0x22')]);}return _0x27e908[_0x9eb7('0x9c')](_0x546acf);}})[_0x9eb7('0x2a')](function(_0x1e2598){if(_0x1e2598){return _0x1e2598?{'count':_0xe09b0a,'rows':_0x1e2598}:null;}})['then'](respondWithResult(_0x1267df,null))[_0x9eb7('0x4b')](handleError(_0x1267df,null));}; \ No newline at end of file +var _0xa535=['rows','catch','show','params','rawAttributes','intersection','length','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','Teams','end','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','add','ids','removeQueues','remove','isArray','Voice','Chat','Sms','Fax','Whatsapp','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','all','addAgents','spread','removeAgents','Mail','Openchannel','Queue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','index','map','Team','fieldName','key','model','keys','filters','query','attributes','fields','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll'];(function(_0x2db7b6,_0x40ce34){var _0x58e113=function(_0x3e84e1){while(--_0x3e84e1){_0x2db7b6['push'](_0x2db7b6['shift']());}};_0x58e113(++_0x40ce34);}(_0xa535,0x19a));var _0x5a53=function(_0x405458,_0x101ac8){_0x405458=_0x405458-0x0;var _0x319511=_0xa535[_0x405458];return _0x319511;};'use strict';var emlformat=require(_0x5a53('0x0'));var rimraf=require(_0x5a53('0x1'));var zipdir=require(_0x5a53('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a53('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5a53('0x4'));var util=require('util');var path=require(_0x5a53('0x5'));var sox=require(_0x5a53('0x6'));var csv=require('to-csv');var ejs=require(_0x5a53('0x7'));var fs=require('fs');var fs_extra=require(_0x5a53('0x8'));var _=require(_0x5a53('0x9'));var squel=require(_0x5a53('0xa'));var crypto=require(_0x5a53('0xb'));var jsforce=require(_0x5a53('0xc'));var deskjs=require(_0x5a53('0xd'));var toCsv=require(_0x5a53('0xe'));var querystring=require(_0x5a53('0xf'));var Papa=require(_0x5a53('0x10'));var Redis=require('ioredis');var authService=require(_0x5a53('0x11'));var qs=require(_0x5a53('0x12'));var as=require(_0x5a53('0x13'));var hardwareService=require(_0x5a53('0x14'));var logger=require(_0x5a53('0x15'))(_0x5a53('0x16'));var utils=require(_0x5a53('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5a53('0x18'));var db=require(_0x5a53('0x19'))['db'];config[_0x5a53('0x1a')]=_[_0x5a53('0x1b')](config[_0x5a53('0x1a')],{'host':_0x5a53('0x1c'),'port':0x18eb});var socket=require(_0x5a53('0x1d'))(new Redis(config[_0x5a53('0x1a')]));require(_0x5a53('0x1e'))[_0x5a53('0x1f')](socket);function respondWithStatusCode(_0x4d34ca,_0x5031e5){_0x5031e5=_0x5031e5||0xcc;return function(_0x33f97a){if(_0x33f97a){return _0x4d34ca[_0x5a53('0x20')](_0x5031e5);}return _0x4d34ca[_0x5a53('0x21')](_0x5031e5)['end']();};}function respondWithResult(_0x1cbd67,_0x2cfa57){_0x2cfa57=_0x2cfa57||0xc8;return function(_0x4bdb7e){if(_0x4bdb7e){return _0x1cbd67[_0x5a53('0x21')](_0x2cfa57)[_0x5a53('0x22')](_0x4bdb7e);}};}function respondWithFilteredResult(_0xd6f4d3,_0x48e437){return function(_0x26619f){if(_0x26619f){var _0x1a28ab=typeof _0x48e437[_0x5a53('0x23')]===_0x5a53('0x24')&&typeof _0x48e437[_0x5a53('0x25')]===_0x5a53('0x24');var _0x29fe74=_0x26619f[_0x5a53('0x26')];var _0x47af71=_0x1a28ab?0x0:_0x48e437[_0x5a53('0x23')];var _0xc46f22=_0x1a28ab?_0x26619f[_0x5a53('0x26')]:_0x48e437[_0x5a53('0x23')]+_0x48e437['limit'];var _0x37895c;if(_0xc46f22>=_0x29fe74){_0xc46f22=_0x29fe74;_0x37895c=0xc8;}else{_0x37895c=0xce;}_0xd6f4d3[_0x5a53('0x21')](_0x37895c);return _0xd6f4d3[_0x5a53('0x27')](_0x5a53('0x28'),_0x47af71+'-'+_0xc46f22+'/'+_0x29fe74)[_0x5a53('0x22')](_0x26619f);}return null;};}function patchUpdates(_0x2dacb8){return function(_0x15f63b){try{jsonpatch['apply'](_0x15f63b,_0x2dacb8,!![]);}catch(_0x1f4fbe){return BPromise[_0x5a53('0x29')](_0x1f4fbe);}return _0x15f63b[_0x5a53('0x2a')]();};}function saveUpdates(_0x354fbb,_0x3bb080){return function(_0x147e71){if(_0x147e71){return _0x147e71[_0x5a53('0x2b')](_0x354fbb)[_0x5a53('0x2c')](function(_0x477934){return _0x477934;});}return null;};}function handleEntityNotFound(_0x3ca5e4,_0x90e620){return function(_0x2bacd2){if(!_0x2bacd2){_0x3ca5e4[_0x5a53('0x20')](0x194);}return _0x2bacd2;};}function handleError(_0x17088b,_0x3aaa17){_0x3aaa17=_0x3aaa17||0x1f4;return function(_0xefd877){logger['error'](_0xefd877[_0x5a53('0x2d')]);if(_0xefd877[_0x5a53('0x2e')]){delete _0xefd877['name'];}_0x17088b[_0x5a53('0x21')](_0x3aaa17)[_0x5a53('0x2f')](_0xefd877);};}exports[_0x5a53('0x30')]=function(_0x175b46,_0xa0e7ba){var _0x3c0edc={},_0xb6a75b={},_0x428e47={'count':0x0,'rows':[]};var _0x162e30=_[_0x5a53('0x31')](db[_0x5a53('0x32')]['rawAttributes'],function(_0x2af9df){return{'name':_0x2af9df[_0x5a53('0x33')],'type':_0x2af9df['type'][_0x5a53('0x34')]};});_0xb6a75b[_0x5a53('0x35')]=_[_0x5a53('0x31')](_0x162e30,_0x5a53('0x2e'));_0xb6a75b['query']=_[_0x5a53('0x36')](_0x175b46['query']);_0xb6a75b[_0x5a53('0x37')]=_['intersection'](_0xb6a75b[_0x5a53('0x35')],_0xb6a75b[_0x5a53('0x38')]);_0x3c0edc[_0x5a53('0x39')]=_['intersection'](_0xb6a75b['model'],qs[_0x5a53('0x3a')](_0x175b46[_0x5a53('0x38')][_0x5a53('0x3a')]));_0x3c0edc[_0x5a53('0x39')]=_0x3c0edc[_0x5a53('0x39')]['length']?_0x3c0edc[_0x5a53('0x39')]:_0xb6a75b[_0x5a53('0x35')];if(!_0x175b46[_0x5a53('0x38')]['hasOwnProperty'](_0x5a53('0x3b'))){_0x3c0edc[_0x5a53('0x25')]=qs[_0x5a53('0x25')](_0x175b46[_0x5a53('0x38')][_0x5a53('0x25')]);_0x3c0edc[_0x5a53('0x23')]=qs[_0x5a53('0x23')](_0x175b46['query'][_0x5a53('0x23')]);}_0x3c0edc['order']=qs[_0x5a53('0x3c')](_0x175b46[_0x5a53('0x38')][_0x5a53('0x3c')]);_0x3c0edc[_0x5a53('0x3d')]=qs[_0x5a53('0x37')](_[_0x5a53('0x3e')](_0x175b46[_0x5a53('0x38')],_0xb6a75b[_0x5a53('0x37')]),_0x162e30);if(_0x175b46['query'][_0x5a53('0x3f')]){_0x3c0edc[_0x5a53('0x3d')]=_[_0x5a53('0x40')](_0x3c0edc[_0x5a53('0x3d')],{'$or':_['map'](_0x162e30,function(_0x23625c){if(_0x23625c[_0x5a53('0x41')]!==_0x5a53('0x42')){var _0x9b85e4={};_0x9b85e4[_0x23625c[_0x5a53('0x2e')]]={'$like':'%'+_0x175b46['query']['filter']+'%'};return _0x9b85e4;}})});}_0x3c0edc=_[_0x5a53('0x40')]({},_0x3c0edc,_0x175b46[_0x5a53('0x43')]);var _0x585997={'where':_0x3c0edc[_0x5a53('0x3d')]};return db['Team'][_0x5a53('0x26')](_0x585997)[_0x5a53('0x2c')](function(_0x269d88){_0x428e47['count']=_0x269d88;if(_0x175b46[_0x5a53('0x38')]['includeAll']){_0x3c0edc[_0x5a53('0x44')]=[{'all':!![]}];}return db[_0x5a53('0x32')][_0x5a53('0x45')](_0x3c0edc);})[_0x5a53('0x2c')](function(_0x500171){_0x428e47[_0x5a53('0x46')]=_0x500171;return _0x428e47;})['then'](respondWithFilteredResult(_0xa0e7ba,_0x3c0edc))[_0x5a53('0x47')](handleError(_0xa0e7ba,null));};exports[_0x5a53('0x48')]=function(_0xbd3bd3,_0x366cee){var _0x430621={'raw':![],'where':{'id':_0xbd3bd3[_0x5a53('0x49')]['id']}},_0x20c6d6={};_0x20c6d6[_0x5a53('0x35')]=_[_0x5a53('0x36')](db[_0x5a53('0x32')][_0x5a53('0x4a')]);_0x20c6d6['query']=_[_0x5a53('0x36')](_0xbd3bd3[_0x5a53('0x38')]);_0x20c6d6[_0x5a53('0x37')]=_[_0x5a53('0x4b')](_0x20c6d6['model'],_0x20c6d6['query']);_0x430621[_0x5a53('0x39')]=_[_0x5a53('0x4b')](_0x20c6d6[_0x5a53('0x35')],qs[_0x5a53('0x3a')](_0xbd3bd3['query'][_0x5a53('0x3a')]));_0x430621[_0x5a53('0x39')]=_0x430621['attributes'][_0x5a53('0x4c')]?_0x430621[_0x5a53('0x39')]:_0x20c6d6[_0x5a53('0x35')];if(_0xbd3bd3[_0x5a53('0x38')]['includeAll']){_0x430621[_0x5a53('0x44')]=[{'all':!![]}];}_0x430621=_[_0x5a53('0x40')]({},_0x430621,_0xbd3bd3['options']);return db['Team']['find'](_0x430621)[_0x5a53('0x2c')](handleEntityNotFound(_0x366cee,null))[_0x5a53('0x2c')](respondWithResult(_0x366cee,null))[_0x5a53('0x47')](handleError(_0x366cee,null));};exports['create']=function(_0xec3cc6,_0x53697d){return db[_0x5a53('0x32')][_0x5a53('0x4d')](_0xec3cc6[_0x5a53('0x4e')],{})['then'](function(_0x449fa8){var _0x81dd5d=_0xec3cc6[_0x5a53('0x4f')][_0x5a53('0x50')]({'plain':!![]});if(!_0x81dd5d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x81dd5d[_0x5a53('0x51')]===_0x5a53('0x4f')){var _0x5e6fe=_0x449fa8[_0x5a53('0x50')]({'plain':!![]});var _0x10b9a='Teams';return db[_0x5a53('0x52')]['find']({'where':{'name':_0x10b9a,'userProfileId':_0x81dd5d[_0x5a53('0x53')]},'raw':!![]})['then'](function(_0x2f955f){if(_0x2f955f&&_0x2f955f[_0x5a53('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e6fe[_0x5a53('0x2e')],'resourceId':_0x5e6fe['id'],'type':_0x2f955f[_0x5a53('0x2e')],'sectionId':_0x2f955f['id']},{})[_0x5a53('0x2c')](function(){return _0x449fa8;});}else{return _0x449fa8;}})[_0x5a53('0x47')](function(_0x4ee165){logger[_0x5a53('0x55')](_0x5a53('0x56'),_0x4ee165);throw _0x4ee165;});}return _0x449fa8;})[_0x5a53('0x2c')](respondWithResult(_0x53697d,0xc9))['catch'](handleError(_0x53697d,null));};exports['update']=function(_0x46b1ac,_0x158641){if(_0x46b1ac[_0x5a53('0x4e')]['id']){delete _0x46b1ac[_0x5a53('0x4e')]['id'];}return db['Team'][_0x5a53('0x57')]({'where':{'id':_0x46b1ac[_0x5a53('0x49')]['id']}})[_0x5a53('0x2c')](handleEntityNotFound(_0x158641,null))['then'](saveUpdates(_0x46b1ac[_0x5a53('0x4e')],null))['then'](respondWithResult(_0x158641,null))[_0x5a53('0x47')](handleError(_0x158641,null));};exports[_0x5a53('0x58')]=function(_0x348210,_0x3502e9){var _0x18db84=_0x348210[_0x5a53('0x49')]['id'];var _0x571bb8=[];return db[_0x5a53('0x59')]['transaction'](function(_0x19c783){var _0x5a696f=_0x5a53('0x5a')+_0x18db84;return db[_0x5a53('0x59')][_0x5a53('0x38')](_0x5a696f,{'type':db[_0x5a53('0x5b')][_0x5a53('0x5c')][_0x5a53('0x5d')],'raw':!![],'transaction':_0x19c783})[_0x5a53('0x2c')](function(_0x2e0671){_0x571bb8=_[_0x5a53('0x31')](_0x2e0671,function(_0xb99eae){return Number(_0xb99eae[_0x5a53('0x5e')]);});})[_0x5a53('0x2c')](function(){var _0xf62047=_0x5a53('0x5f')+_0x18db84;return db[_0x5a53('0x59')][_0x5a53('0x38')](_0xf62047,{'type':db[_0x5a53('0x5b')][_0x5a53('0x5c')][_0x5a53('0x5d')],'raw':!![],'transaction':_0x19c783});})[_0x5a53('0x2c')](function(_0x42c055){var _0x57f0bd=_['map'](_0x42c055,function(_0x3b3736){return Number(_0x3b3736['VoiceQueueId']);});return db[_0x5a53('0x60')][_0x5a53('0x58')]({'where':{'UserId':{'$in':_0x571bb8},'VoiceQueueId':{'$in':_0x57f0bd}},'transaction':_0x19c783});})[_0x5a53('0x2c')](function(){var _0x5e1684='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x18db84;return db['sequelize'][_0x5a53('0x38')](_0x5e1684,{'type':db[_0x5a53('0x5b')][_0x5a53('0x5c')]['SELECT'],'raw':!![],'transaction':_0x19c783});})[_0x5a53('0x2c')](function(_0x2a1884){var _0x25fdd0=_[_0x5a53('0x31')](_0x2a1884,function(_0x2ec4e6){return Number(_0x2ec4e6[_0x5a53('0x61')]);});return db[_0x5a53('0x62')][_0x5a53('0x58')]({'where':{'UserId':{'$in':_0x571bb8},'MailQueueId':{'$in':_0x25fdd0}},'transaction':_0x19c783});})[_0x5a53('0x2c')](function(){var _0x1fb878=_0x5a53('0x63')+_0x18db84;return db[_0x5a53('0x59')][_0x5a53('0x38')](_0x1fb878,{'type':db[_0x5a53('0x5b')][_0x5a53('0x5c')][_0x5a53('0x5d')],'raw':!![],'transaction':_0x19c783});})[_0x5a53('0x2c')](function(_0x40df1c){var _0x4c180f=_[_0x5a53('0x31')](_0x40df1c,function(_0x43f3e3){return Number(_0x43f3e3[_0x5a53('0x64')]);});return db[_0x5a53('0x65')][_0x5a53('0x58')]({'where':{'UserId':{'$in':_0x571bb8},'SmsQueueId':{'$in':_0x4c180f}},'transaction':_0x19c783});})['then'](function(){var _0x292a17=_0x5a53('0x66')+_0x18db84;return db[_0x5a53('0x59')][_0x5a53('0x38')](_0x292a17,{'type':db[_0x5a53('0x5b')][_0x5a53('0x5c')][_0x5a53('0x5d')],'raw':!![],'transaction':_0x19c783});})[_0x5a53('0x2c')](function(_0x4ce19e){var _0x608691=_['map'](_0x4ce19e,function(_0x26efc3){return Number(_0x26efc3[_0x5a53('0x67')]);});return db[_0x5a53('0x68')]['destroy']({'where':{'UserId':{'$in':_0x571bb8},'ChatQueueId':{'$in':_0x608691}},'transaction':_0x19c783});})['then'](function(){var _0x2770a6='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x18db84;return db[_0x5a53('0x59')]['query'](_0x2770a6,{'type':db[_0x5a53('0x5b')][_0x5a53('0x5c')][_0x5a53('0x5d')],'raw':!![],'transaction':_0x19c783});})[_0x5a53('0x2c')](function(_0x1a971d){var _0x47a42b=_['map'](_0x1a971d,function(_0x14e116){return Number(_0x14e116[_0x5a53('0x69')]);});return db[_0x5a53('0x6a')][_0x5a53('0x58')]({'where':{'UserId':{'$in':_0x571bb8},'FaxQueueId':{'$in':_0x47a42b}},'transaction':_0x19c783});})[_0x5a53('0x2c')](function(){var _0x4fe40e='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x18db84;return db['sequelize'][_0x5a53('0x38')](_0x4fe40e,{'type':db[_0x5a53('0x5b')]['QueryTypes'][_0x5a53('0x5d')],'raw':!![],'transaction':_0x19c783});})[_0x5a53('0x2c')](function(_0x467b49){var _0x29adab=_['map'](_0x467b49,function(_0x2f3d32){return Number(_0x2f3d32[_0x5a53('0x6b')]);});return db[_0x5a53('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x571bb8},'OpenchannelQueueId':{'$in':_0x29adab}},'transaction':_0x19c783});})[_0x5a53('0x2c')](function(){var _0x2a38bd=_0x5a53('0x6d')+_0x18db84;return db['sequelize']['query'](_0x2a38bd,{'type':db[_0x5a53('0x5b')][_0x5a53('0x5c')]['SELECT'],'raw':!![],'transaction':_0x19c783});})['then'](function(_0x1ba383){var _0x105b78=_[_0x5a53('0x31')](_0x1ba383,function(_0x15e1a2){return Number(_0x15e1a2['WhatsappQueueId']);});return db[_0x5a53('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x571bb8},'WhatsappQueueId':{'$in':_0x105b78}},'transaction':_0x19c783});})['then'](function(){return db[_0x5a53('0x6f')][_0x5a53('0x57')]({'where':{'TeamId':_0x18db84}});})[_0x5a53('0x2c')](function(_0x2cbd31){if(_0x2cbd31===null){return;}return db[_0x5a53('0x70')][_0x5a53('0x58')]({'where':{'UserId':{'$in':_0x571bb8},'VoicePrefixId':_0x2cbd31[_0x5a53('0x71')]},'transaction':_0x19c783});})[_0x5a53('0x2c')](function(){return db['Team']['destroy']({'where':{'id':_0x18db84},'cascade':!![],'transaction':_0x19c783});})[_0x5a53('0x2c')](function(_0x1ae1bf){if(_0x1ae1bf===0x0){_0x3502e9[_0x5a53('0x20')](0x194);}else{return db[_0x5a53('0x72')][_0x5a53('0x58')]({'where':{'type':_0x5a53('0x73'),'resourceId':_0x18db84},'cascade':!![],'transaction':_0x19c783})['then'](function(){_0x3502e9[_0x5a53('0x21')](0xcc)[_0x5a53('0x74')]();});}})[_0x5a53('0x47')](function(_0x22c46f){_0x3502e9[_0x5a53('0x21')](0x1f4)[_0x5a53('0x2f')](_0x22c46f);});});};exports['getQueues']=function(_0x239f05,_0x48721a,_0x11e80e){return db[_0x5a53('0x32')][_0x5a53('0x75')]({'where':{'id':_0x239f05['params']['id']}})[_0x5a53('0x2c')](handleEntityNotFound(_0x48721a,null))['then'](function(_0x57655a){if(!_0x239f05[_0x5a53('0x38')][_0x5a53('0x76')]||!utils[_0x5a53('0x77')](_0x239f05[_0x5a53('0x38')][_0x5a53('0x76')])){throw new db['Sequelize'][(_0x5a53('0x78'))](_0x5a53('0x79'));}var _0xae2bf={};var _0x4b1f42={};_0x4b1f42['model']=_[_0x5a53('0x36')](db[_[_0x5a53('0x7a')](_0x239f05['query'][_0x5a53('0x76')][_0x5a53('0x7b')]())+_0x5a53('0x7c')][_0x5a53('0x4a')]);_0x4b1f42[_0x5a53('0x38')]=_[_0x5a53('0x36')](_0x239f05[_0x5a53('0x38')]);_0x4b1f42[_0x5a53('0x37')]=_[_0x5a53('0x4b')](_0x4b1f42[_0x5a53('0x35')],_0x4b1f42['query']);_0xae2bf[_0x5a53('0x39')]=_[_0x5a53('0x4b')](_0x4b1f42[_0x5a53('0x35')],qs[_0x5a53('0x3a')](_0x239f05[_0x5a53('0x38')][_0x5a53('0x3a')]));_0xae2bf[_0x5a53('0x39')]=_0xae2bf[_0x5a53('0x39')][_0x5a53('0x4c')]?_0xae2bf[_0x5a53('0x39')]:_0x4b1f42['model'];_0xae2bf[_0x5a53('0x25')]=qs[_0x5a53('0x25')](_0x239f05[_0x5a53('0x38')][_0x5a53('0x25')]);_0xae2bf[_0x5a53('0x23')]=qs[_0x5a53('0x23')](_0x239f05['query'][_0x5a53('0x23')]);_0xae2bf[_0x5a53('0x7d')]=qs[_0x5a53('0x3c')](_0x239f05['query'][_0x5a53('0x3c')]);_0xae2bf[_0x5a53('0x3d')]=qs['filters'](_[_0x5a53('0x3e')](_0x239f05[_0x5a53('0x38')],_0x4b1f42[_0x5a53('0x37')]));_0xae2bf=_[_0x5a53('0x40')]({},_0xae2bf,_0x239f05[_0x5a53('0x43')]);return _0x57655a[_0x5a53('0x50')+_[_0x5a53('0x7a')](_0x239f05[_0x5a53('0x38')][_0x5a53('0x76')][_0x5a53('0x7b')]())+_0x5a53('0x7e')](_0xae2bf);})['then'](respondWithResult(_0x48721a,null))[_0x5a53('0x47')](handleError(_0x48721a,null));};exports['addQueues']=function(_0xb59b37,_0x5ed45b,_0x35702c){return db[_0x5a53('0x32')][_0x5a53('0x75')]({'where':{'id':_0xb59b37[_0x5a53('0x49')]['id']}})['then'](function(_0x447e98){if(_0x447e98){if(!_0xb59b37[_0x5a53('0x4e')]['channel']||!utils[_0x5a53('0x77')](_0xb59b37[_0x5a53('0x4e')][_0x5a53('0x76')])){throw new db[(_0x5a53('0x5b'))][(_0x5a53('0x78'))]('Unknown\x20channel');}return _0x447e98[_0x5a53('0x7f')+_[_0x5a53('0x7a')](_0xb59b37[_0x5a53('0x4e')][_0x5a53('0x76')]['toLowerCase']())+_0x5a53('0x7e')](_0xb59b37['body'][_0x5a53('0x80')]);}return null;})[_0x5a53('0x2c')](handleEntityNotFound(_0x5ed45b,null))[_0x5a53('0x2c')](respondWithStatusCode(_0x5ed45b,null))['catch'](handleError(_0x5ed45b,null));};exports[_0x5a53('0x81')]=function(_0x11bd6f,_0x4731fa,_0x11ac61){return db['Team']['findOne']({'where':{'id':_0x11bd6f[_0x5a53('0x49')]['id']}})[_0x5a53('0x2c')](function(_0x3ba47a){if(_0x3ba47a){if(!_0x11bd6f[_0x5a53('0x38')]['channel']||!utils[_0x5a53('0x77')](_0x11bd6f[_0x5a53('0x38')]['channel'])){throw new db[(_0x5a53('0x5b'))]['ValidationError'](_0x5a53('0x79'));}return _0x3ba47a[_0x5a53('0x82')+_[_0x5a53('0x7a')](_0x11bd6f[_0x5a53('0x38')][_0x5a53('0x76')][_0x5a53('0x7b')]())+'Queues'](_0x11bd6f[_0x5a53('0x38')][_0x5a53('0x80')]);}return null;})[_0x5a53('0x2c')](handleEntityNotFound(_0x4731fa,null))['then'](respondWithStatusCode(_0x4731fa,null))['catch'](handleError(_0x4731fa,null));};exports['addAgents']=function(_0x1798ee,_0x2ae351){var _0x471ef2=_[_0x5a53('0x83')](_0x1798ee[_0x5a53('0x4e')][_0x5a53('0x80')])?_0x1798ee[_0x5a53('0x4e')][_0x5a53('0x80')]:[_0x1798ee[_0x5a53('0x4e')]['ids']];var _0x25742a=_0x1798ee['params']['id'];return db[_0x5a53('0x32')][_0x5a53('0x57')]({'where':{'id':_0x25742a}})[_0x5a53('0x2c')](handleEntityNotFound(_0x2ae351,null))[_0x5a53('0x2c')](function(_0x577311){if(_0x577311){var _0x1fdbd3=[_0x5a53('0x84'),_0x5a53('0x85'),'Mail',_0x5a53('0x86'),_0x5a53('0x87'),'Openchannel',_0x5a53('0x88')];return db[_0x5a53('0x59')][_0x5a53('0x89')](function(_0x142ca1){var _0x892146=_[_0x5a53('0x31')](_0x1fdbd3,function(_0x2ad56d){var _0x362e2b={'attributes':['id',_0x5a53('0x2e')]};if(_0x2ad56d==='Voice'){_0x362e2b[_0x5a53('0x8a')]={'attributes':['penalty']};}return _0x577311[_0x5a53('0x50')+_0x2ad56d+'Queues'](_0x362e2b)['then'](function(_0x171c6d){var _0x4113de=_[_0x5a53('0x31')](_0x171c6d,function(_0x251ed8){var _0x571c11=_[_0x5a53('0x31')](_0x471ef2,function(_0x302180){var _0x37f5b7={'where':{'UserId':_0x302180,[_0x2ad56d+_0x5a53('0x8b')]:_0x251ed8['id']},'transaction':_0x142ca1};if(_0x2ad56d===_0x5a53('0x84')){_0x37f5b7[_0x5a53('0x1b')]={'penalty':_0x251ed8[_0x5a53('0x8c')][_0x5a53('0x8d')]};}return db[_0x5a53('0x8e')+_0x2ad56d+_0x5a53('0x7c')][_0x5a53('0x8f')](_0x37f5b7)[_0x5a53('0x2c')](function(){socket[_0x5a53('0x90')](_0x5a53('0x4f')+_0x2ad56d+_0x5a53('0x91'),{'UserId':_0x302180,[_0x2ad56d+_0x5a53('0x8b')]:_0x251ed8['id']});if(_0x2ad56d!==_0x5a53('0x84')){return;}return db[_0x5a53('0x8e')][_0x5a53('0x45')]({'where':{'id':_0x471ef2,'online':0x1},'attributes':['id',_0x5a53('0x2e'),_0x5a53('0x92'),_0x5a53('0x93'),_0x5a53('0x94')],'raw':!![]})[_0x5a53('0x2c')](function(_0x381a34){var _0x877a2e=_['map'](_0x381a34,function(_0x2ee778){return db[_0x5a53('0x95')][_0x5a53('0x96')]({'membername':_0x2ee778[_0x5a53('0x2e')],'UserId':_0x2ee778['id'],'queue_name':_0x251ed8[_0x5a53('0x2e')],'VoiceQueueId':_0x251ed8['id'],'interface':_[_0x5a53('0x97')](_0x2ee778['interface'])?util['format']('SIP/%s',_0x2ee778[_0x5a53('0x2e')]):_0x2ee778[_0x5a53('0x94')],'paused':_0x2ee778[_0x5a53('0x93')]||![],'penalty':_0x251ed8[_0x5a53('0x8c')]['penalty']},{'transaction':_0x142ca1});});return Promise[_0x5a53('0x98')](_0x877a2e);});});});return Promise[_0x5a53('0x98')](_0x571c11);});return Promise['all'](_0x4113de);})[_0x5a53('0x2c')](function(){return db[_0x5a53('0x6f')]['findOne']({'where':{'teamId':_0x25742a}})[_0x5a53('0x2c')](function(_0x541841){if(_0x541841){var _0x54d638=_[_0x5a53('0x31')](_0x471ef2,function(_0x4b210f){db[_0x5a53('0x70')]['upsert']({'UserId':_0x4b210f,'VoicePrefixId':_0x541841['VoicePrefixId']});});return Promise[_0x5a53('0x98')](_0x54d638);}});});});return Promise['all'](_0x892146)[_0x5a53('0x2c')](function(){return _0x577311[_0x5a53('0x99')](_0x471ef2,{'transaction':_0x142ca1})[_0x5a53('0x9a')](function(_0x29b126){return _0x29b126;});});});}})[_0x5a53('0x2c')](respondWithResult(_0x2ae351,null))[_0x5a53('0x47')](handleError(_0x2ae351,null));};exports[_0x5a53('0x9b')]=function(_0x2a9bf8,_0x53a5f8){var _0x2edbdb=_[_0x5a53('0x83')](_0x2a9bf8[_0x5a53('0x38')][_0x5a53('0x80')])?_0x2a9bf8[_0x5a53('0x38')][_0x5a53('0x80')]:[_0x2a9bf8[_0x5a53('0x38')]['ids']];var _0x388720=_0x2a9bf8['params']['id'];return db[_0x5a53('0x32')][_0x5a53('0x57')]({'where':{'id':_0x388720}})['then'](handleEntityNotFound(_0x53a5f8,null))[_0x5a53('0x2c')](function(_0x2fcef5){if(_0x2fcef5){var _0x50cbdb=[_0x5a53('0x84'),_0x5a53('0x85'),_0x5a53('0x9c'),'Sms','Fax',_0x5a53('0x9d'),'Whatsapp'];return db[_0x5a53('0x59')][_0x5a53('0x89')](function(_0x456ea4){var _0x33e7ca=_['map'](_0x50cbdb,function(_0x3b4d0b){var _0x125eaa={'attributes':['id',_0x5a53('0x2e')]};return _0x2fcef5[_0x5a53('0x50')+_0x3b4d0b+_0x5a53('0x7e')](_0x125eaa)[_0x5a53('0x2c')](function(_0x392e37){var _0x28bea3=_[_0x5a53('0x31')](_0x392e37,function(_0x313ff3){return _0x313ff3['removeAgents'](_0x2edbdb,{'transaction':_0x456ea4})[_0x5a53('0x2c')](function(){var _0xd695b1=_[_0x5a53('0x31')](_0x2edbdb,function(_0x90911a){socket['emit'](_0x5a53('0x4f')+_0x3b4d0b+_0x5a53('0x9e'),{'UserId':Number(_0x90911a),[_0x3b4d0b+_0x5a53('0x8b')]:_0x313ff3['id']});if(_0x3b4d0b!==_0x5a53('0x84')){return;}return db[_0x5a53('0x95')]['destroy']({'where':{'VoiceQueueId':_0x313ff3['id'],'UserId':_0x90911a},'transaction':_0x456ea4});});return Promise[_0x5a53('0x98')](_0xd695b1);});});return Promise[_0x5a53('0x98')](_0x28bea3);});});return Promise[_0x5a53('0x98')](_0x33e7ca)[_0x5a53('0x2c')](function(){return _0x2fcef5[_0x5a53('0x9b')](_0x2edbdb,{'transaction':_0x456ea4});})[_0x5a53('0x2c')](function(){return db[_0x5a53('0x6f')][_0x5a53('0x75')]({'where':{'teamId':_0x388720}})[_0x5a53('0x2c')](function(_0x4707ed){if(_0x4707ed){var _0x4f54bb=_[_0x5a53('0x31')](_0x2edbdb,function(_0x1a34cf){db[_0x5a53('0x70')][_0x5a53('0x58')]({'where':{'UserId':_0x1a34cf,'VoicePrefixId':_0x4707ed[_0x5a53('0x71')]}});});return Promise[_0x5a53('0x98')](_0x4f54bb);}});});});}})['then'](respondWithStatusCode(_0x53a5f8,null))[_0x5a53('0x47')](handleError(_0x53a5f8,null));};exports['getAgents']=function(_0x442539,_0xe9973a,_0x2d92aa){var _0x39c519={};var _0x4227b2={};var _0x2549bd;var _0x18feb9;return db[_0x5a53('0x32')][_0x5a53('0x75')]({'where':{'id':_0x442539[_0x5a53('0x49')]['id']}})[_0x5a53('0x2c')](handleEntityNotFound(_0xe9973a,null))[_0x5a53('0x2c')](function(_0x58f2b8){if(_0x58f2b8){_0x2549bd=_0x58f2b8;_0x4227b2['model']=_[_0x5a53('0x36')](db['User'][_0x5a53('0x4a')]);_0x4227b2[_0x5a53('0x38')]=_['keys'](_0x442539[_0x5a53('0x38')]);_0x4227b2[_0x5a53('0x37')]=_[_0x5a53('0x4b')](_0x4227b2[_0x5a53('0x35')],_0x4227b2[_0x5a53('0x38')]);_0x39c519[_0x5a53('0x39')]=_['intersection'](_0x4227b2[_0x5a53('0x35')],qs[_0x5a53('0x3a')](_0x442539[_0x5a53('0x38')][_0x5a53('0x3a')]));_0x39c519[_0x5a53('0x39')]=_0x39c519[_0x5a53('0x39')][_0x5a53('0x4c')]?_0x39c519[_0x5a53('0x39')]:_0x4227b2[_0x5a53('0x35')];_0x39c519[_0x5a53('0x7d')]=qs[_0x5a53('0x3c')](_0x442539['query']['sort']);_0x39c519[_0x5a53('0x3d')]=qs['filters'](_[_0x5a53('0x3e')](_0x442539[_0x5a53('0x38')],_0x4227b2[_0x5a53('0x37')]));if(_0x442539[_0x5a53('0x38')][_0x5a53('0x3f')]){_0x39c519['where']=_['merge'](_0x39c519[_0x5a53('0x3d')],{'$or':_[_0x5a53('0x31')](_0x39c519[_0x5a53('0x39')],function(_0x2a9676){var _0x4c678c={};_0x4c678c[_0x2a9676]={'$like':'%'+_0x442539['query'][_0x5a53('0x3f')]+'%'};return _0x4c678c;})});}_0x39c519=_['merge']({},_0x39c519,_0x442539['options']);return _0x2549bd['getAgents'](_0x39c519);}})[_0x5a53('0x2c')](function(_0x52ac2f){if(_0x52ac2f){_0x18feb9=_0x52ac2f['length'];if(!_0x442539[_0x5a53('0x38')]['hasOwnProperty'](_0x5a53('0x3b'))){_0x39c519[_0x5a53('0x25')]=qs[_0x5a53('0x25')](_0x442539[_0x5a53('0x38')][_0x5a53('0x25')]);_0x39c519[_0x5a53('0x23')]=qs['offset'](_0x442539[_0x5a53('0x38')][_0x5a53('0x23')]);}return _0x2549bd[_0x5a53('0x9f')](_0x39c519);}})[_0x5a53('0x2c')](function(_0x1343e5){if(_0x1343e5){return _0x1343e5?{'count':_0x18feb9,'rows':_0x1343e5}:null;}})[_0x5a53('0x2c')](respondWithResult(_0xe9973a,null))['catch'](handleError(_0xe9973a,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index e2c9562..d324f04 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 _0xb3fb=['hook','events','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x299611,_0x2a97ff){var _0x443eae=function(_0x2fd58a){while(--_0x2fd58a){_0x299611['push'](_0x299611['shift']());}};_0x443eae(++_0x2a97ff);}(_0xb3fb,0x120));var _0xbb3f=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0xb3fb[_0x1d1219];return _0x5b5b89;};'use strict';var EventEmitter=require(_0xbb3f('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xbb3f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb3f('0x2'),'afterDestroy':_0xbb3f('0x3')};function emitEvent(_0x4ad58e){return function(_0x263596,_0x157e09,_0x19613f){TeamEvents[_0xbb3f('0x4')](_0x4ad58e+':'+_0x263596['id'],_0x263596);TeamEvents[_0xbb3f('0x4')](_0x4ad58e,_0x263596);_0x19613f(null);};}for(var e in events){if(events[_0xbb3f('0x5')](e)){var event=events[e];Team[_0xbb3f('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x1414=['../../mysqldb','Team','setMaxListeners','update','emit','hook','exports','events'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x1414,0x1af));var _0x4141=function(_0x391e5d,_0x4d81ed){_0x391e5d=_0x391e5d-0x0;var _0xd37ca5=_0x1414[_0x391e5d];return _0xd37ca5;};'use strict';var EventEmitter=require(_0x4141('0x0'));var Team=require(_0x4141('0x1'))['db'][_0x4141('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4141('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4141('0x4'),'afterDestroy':'remove'};function emitEvent(_0x49f5fb){return function(_0x416a57,_0x35bb56,_0x5dca2e){TeamEvents[_0x4141('0x5')](_0x49f5fb+':'+_0x416a57['id'],_0x416a57);TeamEvents[_0x4141('0x5')](_0x49f5fb,_0x416a57);_0x5dca2e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x4141('0x6')](e,emitEvent(event));}}module[_0x4141('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ff23d48..63cf08e 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 _0x01c6=['teams','Chat','Fax','Openchannel','Voice','Whatsapp','then','catch','lodash','./team.attributes','get','Queues','map','setDataValue','exports','define','Team'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x01c6,0x1e4));var _0x601c=function(_0x13945b,_0x289c94){_0x13945b=_0x13945b-0x0;var _0x1b1643=_0x01c6[_0x13945b];return _0x1b1643;};'use strict';var _=require(_0x601c('0x0'));var attributes=require(_0x601c('0x1'));function getQueuesByChannel(_0x5a53a9,_0xeac908){var _0xe1e89b=_0x601c('0x2')+_0xeac908+_0x601c('0x3');return _0x5a53a9[_0xe1e89b]()['then'](function(_0x4e7ff5){return _[_0x601c('0x4')](_0x4e7ff5,function(_0x22d209){_0x22d209[_0x601c('0x5')]('channel',_0xeac908);return _0x22d209;});})['catch'](function(_0x1aac69){throw _0x1aac69;});}module[_0x601c('0x6')]=function(_0x5b1c21){return _0x5b1c21[_0x601c('0x7')](_0x601c('0x8'),attributes,{'tableName':_0x601c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2d33b5=this;var _0x15fa22=[_0x601c('0xa'),_0x601c('0xb'),'Mail',_0x601c('0xc'),'Sms',_0x601c('0xd'),_0x601c('0xe')];return Promise['resolve']()[_0x601c('0xf')](function(){var _0x2acdc1=_[_0x601c('0x4')](_0x15fa22,function(_0x5eee4a){return getQueuesByChannel(_0x2d33b5,_0x5eee4a);});return Promise['all'](_0x2acdc1);})[_0x601c('0x10')](function(_0x3ab942){throw _0x3ab942;});}}});}; \ No newline at end of file +var _0x84a8=['get','then','map','setDataValue','channel','catch','teams','Chat','Fax','Mail','Openchannel','Voice','Whatsapp','resolve','lodash'];(function(_0x4f1369,_0x4c595c){var _0xcd26a4=function(_0x1a8515){while(--_0x1a8515){_0x4f1369['push'](_0x4f1369['shift']());}};_0xcd26a4(++_0x4c595c);}(_0x84a8,0x176));var _0x884a=function(_0x48317f,_0x12895a){_0x48317f=_0x48317f-0x0;var _0x4d1cce=_0x84a8[_0x48317f];return _0x4d1cce;};'use strict';var _=require(_0x884a('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x3c83a6,_0x53fdda){var _0x43ccfa=_0x884a('0x1')+_0x53fdda+'Queues';return _0x3c83a6[_0x43ccfa]()[_0x884a('0x2')](function(_0x184378){return _[_0x884a('0x3')](_0x184378,function(_0x2a7edd){_0x2a7edd[_0x884a('0x4')](_0x884a('0x5'),_0x53fdda);return _0x2a7edd;});})[_0x884a('0x6')](function(_0x376f8a){throw _0x376f8a;});}module['exports']=function(_0x59cd7c){return _0x59cd7c['define']('Team',attributes,{'tableName':_0x884a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xc87e40=this;var _0x23c1eb=[_0x884a('0x8'),_0x884a('0x9'),_0x884a('0xa'),_0x884a('0xb'),'Sms',_0x884a('0xc'),_0x884a('0xd')];return Promise[_0x884a('0xe')]()[_0x884a('0x2')](function(){var _0x215c1e=_[_0x884a('0x3')](_0x23c1eb,function(_0x38518c){return getQueuesByChannel(_0xc87e40,_0x38518c);});return Promise['all'](_0x215c1e);})[_0x884a('0x6')](function(_0x469e71){throw _0x469e71;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 511e484..d976267 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 _0x3127=['request','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket'];(function(_0x3ba7b1,_0x390807){var _0x14b63e=function(_0x24c271){while(--_0x24c271){_0x3ba7b1['push'](_0x3ba7b1['shift']());}};_0x14b63e(++_0x390807);}(_0x3127,0x1d8));var _0x7312=function(_0x3c9c4d,_0x1a2ef0){_0x3c9c4d=_0x3c9c4d-0x0;var _0x189ec2=_0x3127[_0x3c9c4d];return _0x189ec2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7312('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7312('0x1'));var db=require(_0x7312('0x2'))['db'];var utils=require(_0x7312('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7312('0x4')][_0x7312('0x5')]({'port':0x232a});config[_0x7312('0x6')]=_[_0x7312('0x7')](config[_0x7312('0x6')],{'host':_0x7312('0x8'),'port':0x18eb});var socket=require(_0x7312('0x9'))(new Redis(config[_0x7312('0x6')]));require(_0x7312('0xa'))['register'](socket);function respondWithRpcPromise(_0x518a39,_0x3c0658,_0x10215a){return new BPromise(function(_0x31e553,_0x1e462a){return client[_0x7312('0xb')](_0x518a39,_0x10215a)['then'](function(_0x4331b8){logger[_0x7312('0xc')]('Team,\x20%s,\x20%s',_0x3c0658,_0x7312('0xd'));logger[_0x7312('0xe')](_0x7312('0xf'),_0x3c0658,_0x7312('0xd'),JSON[_0x7312('0x10')](_0x4331b8));if(_0x4331b8['error']){if(_0x4331b8[_0x7312('0x11')][_0x7312('0x12')]===0x1f4){logger[_0x7312('0x11')](_0x7312('0x13'),_0x3c0658,_0x4331b8['error'][_0x7312('0x14')]);return _0x1e462a(_0x4331b8[_0x7312('0x11')]['message']);}logger[_0x7312('0x11')](_0x7312('0x13'),_0x3c0658,_0x4331b8[_0x7312('0x11')][_0x7312('0x14')]);return _0x31e553(_0x4331b8[_0x7312('0x11')][_0x7312('0x14')]);}else{logger['info'](_0x7312('0x13'),_0x3c0658,_0x7312('0xd'));_0x31e553(_0x4331b8[_0x7312('0x15')][_0x7312('0x14')]);}})[_0x7312('0x16')](function(_0x17b1e3){logger['error'](_0x7312('0x13'),_0x3c0658,_0x17b1e3);_0x1e462a(_0x17b1e3);});});} \ No newline at end of file +var _0xe1ef=['then','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x1bf8b1,_0x1b11cd){var _0x37fb94=function(_0x33a62c){while(--_0x33a62c){_0x1bf8b1['push'](_0x1bf8b1['shift']());}};_0x37fb94(++_0x1b11cd);}(_0xe1ef,0x72));var _0xfe1e=function(_0x2f140f,_0x235706){_0x2f140f=_0x2f140f-0x0;var _0xe01c51=_0xe1ef[_0x2f140f];return _0xe01c51;};'use strict';var _=require(_0xfe1e('0x0'));var util=require(_0xfe1e('0x1'));var moment=require(_0xfe1e('0x2'));var BPromise=require(_0xfe1e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe1e('0x4'))['db'];var utils=require(_0xfe1e('0x5'));var logger=require(_0xfe1e('0x6'))(_0xfe1e('0x7'));var config=require(_0xfe1e('0x8'));var jayson=require(_0xfe1e('0x9'));var client=jayson['client'][_0xfe1e('0xa')]({'port':0x232a});config[_0xfe1e('0xb')]=_[_0xfe1e('0xc')](config[_0xfe1e('0xb')],{'host':_0xfe1e('0xd'),'port':0x18eb});var socket=require(_0xfe1e('0xe'))(new Redis(config[_0xfe1e('0xb')]));require('./team.socket')[_0xfe1e('0xf')](socket);function respondWithRpcPromise(_0x35b248,_0xdca507,_0x48d608){return new BPromise(function(_0x4d091b,_0x211fec){return client['request'](_0x35b248,_0x48d608)[_0xfe1e('0x10')](function(_0x4ef247){logger['info'](_0xfe1e('0x11'),_0xdca507,'request\x20sent');logger[_0xfe1e('0x12')](_0xfe1e('0x13'),_0xdca507,_0xfe1e('0x14'),JSON[_0xfe1e('0x15')](_0x4ef247));if(_0x4ef247[_0xfe1e('0x16')]){if(_0x4ef247[_0xfe1e('0x16')]['code']===0x1f4){logger[_0xfe1e('0x16')](_0xfe1e('0x11'),_0xdca507,_0x4ef247[_0xfe1e('0x16')][_0xfe1e('0x17')]);return _0x211fec(_0x4ef247[_0xfe1e('0x16')][_0xfe1e('0x17')]);}logger[_0xfe1e('0x16')](_0xfe1e('0x11'),_0xdca507,_0x4ef247[_0xfe1e('0x16')]['message']);return _0x4d091b(_0x4ef247[_0xfe1e('0x16')][_0xfe1e('0x17')]);}else{logger[_0xfe1e('0x18')](_0xfe1e('0x11'),_0xdca507,_0xfe1e('0x14'));_0x4d091b(_0x4ef247[_0xfe1e('0x19')]['message']);}})['catch'](function(_0x4e18ac){logger[_0xfe1e('0x16')](_0xfe1e('0x11'),_0xdca507,_0x4e18ac);_0x211fec(_0x4e18ac);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index fa844c8..f8b5f68 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 _0x58a4=['length','team:','./team.events','save','remove','update','emit','removeListener','register'];(function(_0x3ffdf1,_0x2ef7f3){var _0x8769f9=function(_0x275811){while(--_0x275811){_0x3ffdf1['push'](_0x3ffdf1['shift']());}};_0x8769f9(++_0x2ef7f3);}(_0x58a4,0xbf));var _0x458a=function(_0x46e182,_0x1046a8){_0x46e182=_0x46e182-0x0;var _0x42ade0=_0x58a4[_0x46e182];return _0x42ade0;};'use strict';var TeamEvents=require(_0x458a('0x0'));var events=[_0x458a('0x1'),_0x458a('0x2'),_0x458a('0x3')];function createListener(_0xd2a36e,_0x15239b){return function(_0x2a1838){_0x15239b[_0x458a('0x4')](_0xd2a36e,_0x2a1838);};}function removeListener(_0x362079,_0x1b4d2e){return function(){TeamEvents[_0x458a('0x5')](_0x362079,_0x1b4d2e);};}exports[_0x458a('0x6')]=function(_0x2f5d44){for(var _0x57de3c=0x0,_0x5358c2=events[_0x458a('0x7')];_0x57de3c<_0x5358c2;_0x57de3c++){var _0x11fcaa=events[_0x57de3c];var _0x2029bc=createListener(_0x458a('0x8')+_0x11fcaa,_0x2f5d44);TeamEvents['on'](_0x11fcaa,_0x2029bc);}}; \ No newline at end of file +var _0x6a59=['team:','./team.events','remove','update','emit','removeListener','register'];(function(_0x46804e,_0x9b240c){var _0x27d3ae=function(_0x63d57f){while(--_0x63d57f){_0x46804e['push'](_0x46804e['shift']());}};_0x27d3ae(++_0x9b240c);}(_0x6a59,0x1d6));var _0x96a5=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x6a59[_0x32b542];return _0x554d54;};'use strict';var TeamEvents=require(_0x96a5('0x0'));var events=['save',_0x96a5('0x1'),_0x96a5('0x2')];function createListener(_0x4d8ffa,_0x2eeff6){return function(_0x3a76f9){_0x2eeff6[_0x96a5('0x3')](_0x4d8ffa,_0x3a76f9);};}function removeListener(_0x1f63c1,_0x467abe){return function(){TeamEvents[_0x96a5('0x4')](_0x1f63c1,_0x467abe);};}exports[_0x96a5('0x5')]=function(_0x503d4f){for(var _0xdc370e=0x0,_0x400594=events['length'];_0xdc370e<_0x400594;_0xdc370e++){var _0x2989b8=events[_0xdc370e];var _0x277a8c=createListener(_0x96a5('0x6')+_0x2989b8,_0x503d4f);TeamEvents['on'](_0x2989b8,_0x277a8c);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index edfe35c..65368ce 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 _0x2141=['INTEGER','sequelize','exports'];(function(_0x2474fa,_0x583f72){var _0x1c4c54=function(_0x2dfd9f){while(--_0x2dfd9f){_0x2474fa['push'](_0x2474fa['shift']());}};_0x1c4c54(++_0x583f72);}(_0x2141,0x1ba));var _0x1214=function(_0x586c59,_0x17c583){_0x586c59=_0x586c59-0x0;var _0x3cbb67=_0x2141[_0x586c59];return _0x3cbb67;};'use strict';var Sequelize=require(_0x1214('0x0'));module[_0x1214('0x1')]={'TeamId':{'type':Sequelize[_0x1214('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x1214('0x2')]}}; \ No newline at end of file +var _0xbdb8=['INTEGER','sequelize','exports'];(function(_0x1189bf,_0x20195c){var _0x4236b6=function(_0x2e527f){while(--_0x2e527f){_0x1189bf['push'](_0x1189bf['shift']());}};_0x4236b6(++_0x20195c);}(_0xbdb8,0xe2));var _0x8bdb=function(_0x182cdd,_0x20c7d1){_0x182cdd=_0x182cdd-0x0;var _0x5c4424=_0xbdb8[_0x182cdd];return _0x5c4424;};'use strict';var Sequelize=require(_0x8bdb('0x0'));module[_0x8bdb('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x8bdb('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d7a8105..be5c4f8 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 _0xb921=['../../config/logger','api','moment','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x98e06e,_0x2bbf29){var _0xfc6cb8=function(_0x27b0ba){while(--_0x27b0ba){_0x98e06e['push'](_0x98e06e['shift']());}};_0xfc6cb8(++_0x2bbf29);}(_0xb921,0x16a));var _0x1b92=function(_0x25597e,_0x3cc593){_0x25597e=_0x25597e-0x0;var _0x18f471=_0xb921[_0x25597e];return _0x18f471;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var logger=require(_0x1b92('0x2'))(_0x1b92('0x3'));var moment=require(_0x1b92('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b92('0x5'));var rimraf=require(_0x1b92('0x6'));var config=require(_0x1b92('0x7'));var attributes=require(_0x1b92('0x8'));module[_0x1b92('0x9')]=function(_0x29a1db,_0x4358e3){return _0x29a1db[_0x1b92('0xa')](_0x1b92('0xb'),attributes,{'tableName':_0x1b92('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf089=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','util'];(function(_0x2ded05,_0x5ec1e6){var _0x57b50b=function(_0x5d0a3c){while(--_0x5d0a3c){_0x2ded05['push'](_0x2ded05['shift']());}};_0x57b50b(++_0x5ec1e6);}(_0xf089,0xba));var _0x9f08=function(_0x4d3da9,_0x620173){_0x4d3da9=_0x4d3da9-0x0;var _0x28bae6=_0xf089[_0x4d3da9];return _0x28bae6;};'use strict';var _=require('lodash');var util=require(_0x9f08('0x0'));var logger=require(_0x9f08('0x1'))('api');var moment=require(_0x9f08('0x2'));var BPromise=require(_0x9f08('0x3'));var rp=require(_0x9f08('0x4'));var fs=require('fs');var path=require(_0x9f08('0x5'));var rimraf=require('rimraf');var config=require(_0x9f08('0x6'));var attributes=require(_0x9f08('0x7'));module[_0x9f08('0x8')]=function(_0x13768c,_0x38c9ea){return _0x13768c[_0x9f08('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x9f08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index e1e8045..7cfdde3 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4ba9d7,_0x2ec6cc){var _0x45866e=function(_0x19036a){while(--_0x19036a){_0x4ba9d7['push'](_0x4ba9d7['shift']());}};_0x45866e(++_0x2ec6cc);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4f0d63,_0x11c460){var _0x474011=function(_0x3ba18b){while(--_0x3ba18b){_0x4f0d63['push'](_0x4f0d63['shift']());}};_0x474011(++_0x11c460);}(_0x70e0,0x17b));var _0x070e=function(_0x350f07,_0x448965){_0x350f07=_0x350f07-0x0;var _0x437d0c=_0x70e0[_0x350f07];return _0x437d0c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c37875c..eb38599 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 _0x3dbf=['INTEGER','exports'];(function(_0x28b7ab,_0x16a764){var _0x56791b=function(_0x25d20d){while(--_0x25d20d){_0x28b7ab['push'](_0x28b7ab['shift']());}};_0x56791b(++_0x16a764);}(_0x3dbf,0x8f));var _0xf3db=function(_0x494b4c,_0x30e81e){_0x494b4c=_0x494b4c-0x0;var _0x1687f5=_0x3dbf[_0x494b4c];return _0x1687f5;};'use strict';var Sequelize=require('sequelize');module[_0xf3db('0x0')]={'penalty':{'type':Sequelize[_0xf3db('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3960=['INTEGER','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3960,0x125));var _0x0396=function(_0x3f0d6a,_0xa29f5b){_0x3f0d6a=_0x3f0d6a-0x0;var _0x5af2e0=_0x3960[_0x3f0d6a];return _0x5af2e0;};'use strict';var Sequelize=require(_0x0396('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0396('0x1')],'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 a5286ab..45994fb 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 _0x6631=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0x6631,0x134));var _0x1663=function(_0x8ddaed,_0x48b242){_0x8ddaed=_0x8ddaed-0x0;var _0xf922eb=_0x6631[_0x8ddaed];return _0xf922eb;};'use strict';var _=require(_0x1663('0x0'));var util=require(_0x1663('0x1'));var logger=require(_0x1663('0x2'))(_0x1663('0x3'));var moment=require(_0x1663('0x4'));var BPromise=require(_0x1663('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1663('0x6'));var rimraf=require(_0x1663('0x7'));var config=require(_0x1663('0x8'));var attributes=require(_0x1663('0x9'));module[_0x1663('0xa')]=function(_0x1faf52,_0x23a307){return _0x1faf52[_0x1663('0xb')](_0x1663('0xc'),attributes,{'tableName':_0x1663('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea3=['TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','bluebird','path','./teamVoiceQueue.attributes','exports','define'];(function(_0x838813,_0x448f0f){var _0x2bd32d=function(_0x57b589){while(--_0x57b589){_0x838813['push'](_0x838813['shift']());}};_0x2bd32d(++_0x448f0f);}(_0x4ea3,0x70));var _0x34ea=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x4ea3[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));module[_0x34ea('0x7')]=function(_0x962596,_0x123d48){return _0x962596[_0x34ea('0x8')](_0x34ea('0x9'),attributes,{'tableName':_0x34ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 6641060..eec9e60 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 _0x2d70=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2fb37b,_0x5c1a95){var _0x4d5040=function(_0x356e9f){while(--_0x356e9f){_0x2fb37b['push'](_0x2fb37b['shift']());}};_0x4d5040(++_0x5c1a95);}(_0x2d70,0xd2));var _0x02d7=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x2d70[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0x02d7('0x0'));var util=require('util');var moment=require(_0x02d7('0x1'));var BPromise=require(_0x02d7('0x2'));var rs=require(_0x02d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02d7('0x4'))['db'];var utils=require(_0x02d7('0x5'));var logger=require(_0x02d7('0x6'))(_0x02d7('0x7'));var config=require(_0x02d7('0x8'));var jayson=require(_0x02d7('0x9'));var client=jayson[_0x02d7('0xa')][_0x02d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cb04,_0x452704,_0x2bbbe6){return new BPromise(function(_0x3fb1ff,_0x1577d6){return client['request'](_0x25cb04,_0x2bbbe6)[_0x02d7('0xc')](function(_0x20edb3){logger[_0x02d7('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x452704,_0x02d7('0xe'));logger[_0x02d7('0xf')](_0x02d7('0x10'),_0x452704,_0x02d7('0xe'),JSON[_0x02d7('0x11')](_0x20edb3));if(_0x20edb3[_0x02d7('0x12')]){if(_0x20edb3[_0x02d7('0x12')][_0x02d7('0x13')]===0x1f4){logger[_0x02d7('0x12')](_0x02d7('0x14'),_0x452704,_0x20edb3[_0x02d7('0x12')][_0x02d7('0x15')]);return _0x1577d6(_0x20edb3[_0x02d7('0x12')][_0x02d7('0x15')]);}logger['error'](_0x02d7('0x14'),_0x452704,_0x20edb3[_0x02d7('0x12')][_0x02d7('0x15')]);return _0x3fb1ff(_0x20edb3[_0x02d7('0x12')]['message']);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x452704,_0x02d7('0xe'));_0x3fb1ff(_0x20edb3[_0x02d7('0x16')][_0x02d7('0x15')]);}})[_0x02d7('0x17')](function(_0x49f212){logger[_0x02d7('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x452704,_0x49f212);_0x1577d6(_0x49f212);});});} \ No newline at end of file +var _0xab5c=['error','code','message','catch','util','moment','bluebird','ioredis','rpc','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x343443,_0x24d7cf){var _0x250872=function(_0x58b458){while(--_0x58b458){_0x343443['push'](_0x343443['shift']());}};_0x250872(++_0x24d7cf);}(_0xab5c,0x134));var _0xcab5=function(_0x815d8e,_0x45c2ee){_0x815d8e=_0x815d8e-0x0;var _0x587fe3=_0xab5c[_0x815d8e];return _0x587fe3;};'use strict';var _=require('lodash');var util=require(_0xcab5('0x0'));var moment=require(_0xcab5('0x1'));var BPromise=require(_0xcab5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcab5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcab5('0x4'));var config=require('../../config/environment');var jayson=require(_0xcab5('0x5'));var client=jayson[_0xcab5('0x6')][_0xcab5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b01ae,_0x1b289b,_0xc26c45){return new BPromise(function(_0x3e7d0e,_0x18f24e){return client[_0xcab5('0x8')](_0x3b01ae,_0xc26c45)['then'](function(_0x5ec330){logger[_0xcab5('0x9')](_0xcab5('0xa'),_0x1b289b,_0xcab5('0xb'));logger[_0xcab5('0xc')](_0xcab5('0xd'),_0x1b289b,_0xcab5('0xb'),JSON[_0xcab5('0xe')](_0x5ec330));if(_0x5ec330[_0xcab5('0xf')]){if(_0x5ec330[_0xcab5('0xf')][_0xcab5('0x10')]===0x1f4){logger[_0xcab5('0xf')](_0xcab5('0xa'),_0x1b289b,_0x5ec330[_0xcab5('0xf')][_0xcab5('0x11')]);return _0x18f24e(_0x5ec330['error'][_0xcab5('0x11')]);}logger['error'](_0xcab5('0xa'),_0x1b289b,_0x5ec330['error'][_0xcab5('0x11')]);return _0x3e7d0e(_0x5ec330[_0xcab5('0xf')][_0xcab5('0x11')]);}else{logger[_0xcab5('0x9')](_0xcab5('0xa'),_0x1b289b,_0xcab5('0xb'));_0x3e7d0e(_0x5ec330['result'][_0xcab5('0x11')]);}})[_0xcab5('0x12')](function(_0x529c35){logger[_0xcab5('0xf')](_0xcab5('0xa'),_0x1b289b,_0x529c35);_0x18f24e(_0x529c35);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 2a18e4a..d1549de 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 _0xedf1=['show','post','create','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','index','get','/:id','isAuthenticated'];(function(_0x24065b,_0x1775ba){var _0x88b0b7=function(_0x1143fc){while(--_0x1143fc){_0x24065b['push'](_0x24065b['shift']());}};_0x88b0b7(++_0x1775ba);}(_0xedf1,0xb2));var _0x1edf=function(_0x5af41f,_0x372947){_0x5af41f=_0x5af41f-0x0;var _0x163259=_0xedf1[_0x5af41f];return _0x163259;};'use strict';var multer=require(_0x1edf('0x0'));var util=require(_0x1edf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1edf('0x2'));var router=express[_0x1edf('0x3')]();var fs_extra=require(_0x1edf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1edf('0x5'));var config=require(_0x1edf('0x6'));var controller=require(_0x1edf('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1edf('0x8')]);router[_0x1edf('0x9')](_0x1edf('0xa'),auth[_0x1edf('0xb')](),controller[_0x1edf('0xc')]);router[_0x1edf('0xd')]('/',auth[_0x1edf('0xb')](),controller[_0x1edf('0xe')]);router[_0x1edf('0xf')]('/:id',auth[_0x1edf('0xb')](),controller[_0x1edf('0x10')]);router[_0x1edf('0x11')](_0x1edf('0xa'),auth['isAuthenticated'](),controller[_0x1edf('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5454=['isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x5b311b,_0x3e0280){var _0x4fa0de=function(_0x5363ed){while(--_0x5363ed){_0x5b311b['push'](_0x5b311b['shift']());}};_0x4fa0de(++_0x3e0280);}(_0x5454,0x15b));var _0x4545=function(_0x18095b,_0x1dd198){_0x18095b=_0x18095b-0x0;var _0x579450=_0x5454[_0x18095b];return _0x579450;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4545('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4545('0x1'));var interaction=require(_0x4545('0x2'));var config=require(_0x4545('0x3'));var controller=require(_0x4545('0x4'));router['get']('/',auth[_0x4545('0x5')](),controller[_0x4545('0x6')]);router[_0x4545('0x7')](_0x4545('0x8'),auth[_0x4545('0x5')](),controller[_0x4545('0x9')]);router[_0x4545('0xa')]('/',auth[_0x4545('0x5')](),controller[_0x4545('0xb')]);router[_0x4545('0xc')](_0x4545('0x8'),auth[_0x4545('0x5')](),controller[_0x4545('0xd')]);router['delete'](_0x4545('0x8'),auth[_0x4545('0x5')](),controller[_0x4545('0xe')]);module[_0x4545('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 59ffe1b..2f37e8d 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 _0x8c8b=['exports','STRING','TEXT'];(function(_0x14eed8,_0x3e5df6){var _0x539b59=function(_0x5785ad){while(--_0x5785ad){_0x14eed8['push'](_0x14eed8['shift']());}};_0x539b59(++_0x3e5df6);}(_0x8c8b,0x11a));var _0xb8c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c8b[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xb8c8('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb8c8('0x1')]},'html':{'type':Sequelize[_0xb8c8('0x2')]}}; \ No newline at end of file +var _0x6348=['TEXT','sequelize','exports','STRING'];(function(_0x448f40,_0x382153){var _0x1abee3=function(_0x1301d0){while(--_0x1301d0){_0x448f40['push'](_0x448f40['shift']());}};_0x1abee3(++_0x382153);}(_0x6348,0xb9));var _0x8634=function(_0x2084f3,_0x423d9a){_0x2084f3=_0x2084f3-0x0;var _0x1e0ea3=_0x6348[_0x2084f3];return _0x1e0ea3;};'use strict';var Sequelize=require(_0x8634('0x0'));module[_0x8634('0x1')]={'name':{'type':Sequelize[_0x8634('0x2')]},'description':{'type':Sequelize[_0x8634('0x2')]},'html':{'type':Sequelize[_0x8634('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index fa40b04..0f0f537 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 _0xd64d=['model','keys','filters','intersection','query','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Templates','UserProfileResource','destroy','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key'];(function(_0x8cac51,_0x9b5721){var _0x6f1b73=function(_0x59b118){while(--_0x59b118){_0x8cac51['push'](_0x8cac51['shift']());}};_0x6f1b73(++_0x9b5721);}(_0xd64d,0xc8));var _0xdd64=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd64d[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xdd64('0x0'));var rimraf=require(_0xdd64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd64('0x2'));var moment=require(_0xdd64('0x3'));var BPromise=require(_0xdd64('0x4'));var Mustache=require(_0xdd64('0x5'));var util=require(_0xdd64('0x6'));var path=require(_0xdd64('0x7'));var sox=require(_0xdd64('0x8'));var csv=require(_0xdd64('0x9'));var ejs=require(_0xdd64('0xa'));var fs=require('fs');var fs_extra=require(_0xdd64('0xb'));var _=require(_0xdd64('0xc'));var squel=require(_0xdd64('0xd'));var crypto=require(_0xdd64('0xe'));var jsforce=require(_0xdd64('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdd64('0x10'));var authService=require(_0xdd64('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdd64('0x12'));var hardwareService=require(_0xdd64('0x13'));var logger=require(_0xdd64('0x14'))(_0xdd64('0x15'));var utils=require(_0xdd64('0x16'));var config=require(_0xdd64('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd64('0x18'))['db'];function respondWithStatusCode(_0x434e91,_0x513044){_0x513044=_0x513044||0xcc;return function(_0x28a611){if(_0x28a611){return _0x434e91[_0xdd64('0x19')](_0x513044);}return _0x434e91['status'](_0x513044)[_0xdd64('0x1a')]();};}function respondWithResult(_0x330cf7,_0x3904e0){_0x3904e0=_0x3904e0||0xc8;return function(_0x3d9263){if(_0x3d9263){return _0x330cf7[_0xdd64('0x1b')](_0x3904e0)['json'](_0x3d9263);}};}function respondWithFilteredResult(_0x3cc157,_0x20b322){return function(_0x165b8c){if(_0x165b8c){var _0x5421ec=typeof _0x20b322[_0xdd64('0x1c')]===_0xdd64('0x1d')&&typeof _0x20b322[_0xdd64('0x1e')]===_0xdd64('0x1d');var _0x32b6e1=_0x165b8c[_0xdd64('0x1f')];var _0x42e51c=_0x5421ec?0x0:_0x20b322[_0xdd64('0x1c')];var _0x445500=_0x5421ec?_0x165b8c['count']:_0x20b322['offset']+_0x20b322[_0xdd64('0x1e')];var _0x552f51;if(_0x445500>=_0x32b6e1){_0x445500=_0x32b6e1;_0x552f51=0xc8;}else{_0x552f51=0xce;}_0x3cc157[_0xdd64('0x1b')](_0x552f51);return _0x3cc157[_0xdd64('0x20')]('Content-Range',_0x42e51c+'-'+_0x445500+'/'+_0x32b6e1)['json'](_0x165b8c);}return null;};}function patchUpdates(_0x149932){return function(_0x204e82){try{jsonpatch[_0xdd64('0x21')](_0x204e82,_0x149932,!![]);}catch(_0xde9871){return BPromise[_0xdd64('0x22')](_0xde9871);}return _0x204e82[_0xdd64('0x23')]();};}function saveUpdates(_0x4475c6,_0x336e96){return function(_0x37488e){if(_0x37488e){return _0x37488e[_0xdd64('0x24')](_0x4475c6)[_0xdd64('0x25')](function(_0x197fb8){return _0x197fb8;});}return null;};}function removeEntity(_0x39303f,_0x52fbae){return function(_0x82f2aa){if(_0x82f2aa){return _0x82f2aa['destroy']()['then'](function(){var _0x583741=_0x82f2aa[_0xdd64('0x26')]({'plain':!![]});var _0x269c1a=_0xdd64('0x27');return db[_0xdd64('0x28')][_0xdd64('0x29')]({'where':{'type':_0x269c1a,'resourceId':_0x583741['id']}})[_0xdd64('0x25')](function(){return _0x82f2aa;});})[_0xdd64('0x25')](function(){_0x39303f[_0xdd64('0x1b')](0xcc)[_0xdd64('0x1a')]();});}};}function handleEntityNotFound(_0x262244,_0x449ee2){return function(_0x3b5d99){if(!_0x3b5d99){_0x262244[_0xdd64('0x19')](0x194);}return _0x3b5d99;};}function handleError(_0x34f30c,_0x46e8ff){_0x46e8ff=_0x46e8ff||0x1f4;return function(_0x76e2f5){logger['error'](_0x76e2f5[_0xdd64('0x2a')]);if(_0x76e2f5[_0xdd64('0x2b')]){delete _0x76e2f5[_0xdd64('0x2b')];}_0x34f30c[_0xdd64('0x1b')](_0x46e8ff)[_0xdd64('0x2c')](_0x76e2f5);};}exports[_0xdd64('0x2d')]=function(_0x5be4e0,_0x29c775){var _0x19d611={},_0x42cede={},_0x51231b={'count':0x0,'rows':[]};var _0x8b23f5=_[_0xdd64('0x2e')](db[_0xdd64('0x2f')][_0xdd64('0x30')],function(_0x304498){return{'name':_0x304498[_0xdd64('0x31')],'type':_0x304498[_0xdd64('0x32')][_0xdd64('0x33')]};});_0x42cede[_0xdd64('0x34')]=_[_0xdd64('0x2e')](_0x8b23f5,'name');_0x42cede['query']=_[_0xdd64('0x35')](_0x5be4e0['query']);_0x42cede[_0xdd64('0x36')]=_[_0xdd64('0x37')](_0x42cede[_0xdd64('0x34')],_0x42cede[_0xdd64('0x38')]);_0x19d611[_0xdd64('0x39')]=_[_0xdd64('0x37')](_0x42cede['model'],qs['fields'](_0x5be4e0[_0xdd64('0x38')][_0xdd64('0x3a')]));_0x19d611['attributes']=_0x19d611[_0xdd64('0x39')][_0xdd64('0x3b')]?_0x19d611['attributes']:_0x42cede[_0xdd64('0x34')];if(!_0x5be4e0[_0xdd64('0x38')]['hasOwnProperty'](_0xdd64('0x3c'))){_0x19d611[_0xdd64('0x1e')]=qs[_0xdd64('0x1e')](_0x5be4e0[_0xdd64('0x38')][_0xdd64('0x1e')]);_0x19d611['offset']=qs[_0xdd64('0x1c')](_0x5be4e0[_0xdd64('0x38')][_0xdd64('0x1c')]);}_0x19d611['order']=qs['sort'](_0x5be4e0[_0xdd64('0x38')][_0xdd64('0x3d')]);_0x19d611[_0xdd64('0x3e')]=qs[_0xdd64('0x36')](_[_0xdd64('0x3f')](_0x5be4e0[_0xdd64('0x38')],_0x42cede['filters']),_0x8b23f5);if(_0x5be4e0[_0xdd64('0x38')][_0xdd64('0x40')]){_0x19d611[_0xdd64('0x3e')]=_[_0xdd64('0x41')](_0x19d611[_0xdd64('0x3e')],{'$or':_[_0xdd64('0x2e')](_0x8b23f5,function(_0x1aa01){if(_0x1aa01[_0xdd64('0x32')]!==_0xdd64('0x42')){var _0x21205d={};_0x21205d[_0x1aa01[_0xdd64('0x2b')]]={'$like':'%'+_0x5be4e0['query']['filter']+'%'};return _0x21205d;}})});}_0x19d611=_[_0xdd64('0x41')]({},_0x19d611,_0x5be4e0[_0xdd64('0x43')]);var _0x5d2c6a={'where':_0x19d611[_0xdd64('0x3e')]};return db[_0xdd64('0x2f')]['count'](_0x5d2c6a)[_0xdd64('0x25')](function(_0x490925){_0x51231b[_0xdd64('0x1f')]=_0x490925;if(_0x5be4e0[_0xdd64('0x38')][_0xdd64('0x44')]){_0x19d611['include']=[{'all':!![]}];}return db[_0xdd64('0x2f')][_0xdd64('0x45')](_0x19d611);})[_0xdd64('0x25')](function(_0xac4547){_0x51231b[_0xdd64('0x46')]=_0xac4547;return _0x51231b;})[_0xdd64('0x25')](respondWithFilteredResult(_0x29c775,_0x19d611))['catch'](handleError(_0x29c775,null));};exports[_0xdd64('0x47')]=function(_0x52c679,_0x57463f){var _0x489786={'raw':!![],'where':{'id':_0x52c679['params']['id']}},_0x1f6744={};_0x1f6744['model']=_[_0xdd64('0x35')](db[_0xdd64('0x2f')][_0xdd64('0x30')]);_0x1f6744[_0xdd64('0x38')]=_[_0xdd64('0x35')](_0x52c679[_0xdd64('0x38')]);_0x1f6744['filters']=_[_0xdd64('0x37')](_0x1f6744[_0xdd64('0x34')],_0x1f6744['query']);_0x489786[_0xdd64('0x39')]=_[_0xdd64('0x37')](_0x1f6744[_0xdd64('0x34')],qs['fields'](_0x52c679['query'][_0xdd64('0x3a')]));_0x489786['attributes']=_0x489786[_0xdd64('0x39')][_0xdd64('0x3b')]?_0x489786['attributes']:_0x1f6744[_0xdd64('0x34')];if(_0x52c679[_0xdd64('0x38')][_0xdd64('0x44')]){_0x489786[_0xdd64('0x48')]=[{'all':!![]}];}_0x489786=_[_0xdd64('0x41')]({},_0x489786,_0x52c679[_0xdd64('0x43')]);return db['Template'][_0xdd64('0x49')](_0x489786)[_0xdd64('0x25')](handleEntityNotFound(_0x57463f,null))['then'](respondWithResult(_0x57463f,null))[_0xdd64('0x4a')](handleError(_0x57463f,null));};exports['create']=function(_0x3fb0d9,_0x3b0c6b){return db[_0xdd64('0x2f')][_0xdd64('0x4b')](_0x3fb0d9[_0xdd64('0x4c')],{})[_0xdd64('0x25')](function(_0x5a132a){var _0x318404=_0x3fb0d9[_0xdd64('0x4d')][_0xdd64('0x26')]({'plain':!![]});if(!_0x318404)throw new Error(_0xdd64('0x4e'));if(_0x318404['role']==='user'){var _0x527f95=_0x5a132a[_0xdd64('0x26')]({'plain':!![]});var _0x250db2=_0xdd64('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x250db2,'userProfileId':_0x318404[_0xdd64('0x4f')]},'raw':!![]})[_0xdd64('0x25')](function(_0x560f6d){if(_0x560f6d&&_0x560f6d[_0xdd64('0x50')]===0x0){return db['UserProfileResource'][_0xdd64('0x4b')]({'name':_0x527f95[_0xdd64('0x2b')],'resourceId':_0x527f95['id'],'type':_0x560f6d[_0xdd64('0x2b')],'sectionId':_0x560f6d['id']},{})[_0xdd64('0x25')](function(){return _0x5a132a;});}else{return _0x5a132a;}})[_0xdd64('0x4a')](function(_0x274c86){logger[_0xdd64('0x51')](_0xdd64('0x52'),_0x274c86);throw _0x274c86;});}return _0x5a132a;})['then'](respondWithResult(_0x3b0c6b,0xc9))[_0xdd64('0x4a')](handleError(_0x3b0c6b,null));};exports['update']=function(_0xb0ea1e,_0x404914){if(_0xb0ea1e['body']['id']){delete _0xb0ea1e[_0xdd64('0x4c')]['id'];}return db[_0xdd64('0x2f')][_0xdd64('0x49')]({'where':{'id':_0xb0ea1e[_0xdd64('0x53')]['id']}})[_0xdd64('0x25')](handleEntityNotFound(_0x404914,null))[_0xdd64('0x25')](saveUpdates(_0xb0ea1e['body'],null))[_0xdd64('0x25')](respondWithResult(_0x404914,null))[_0xdd64('0x4a')](handleError(_0x404914,null));};exports[_0xdd64('0x29')]=function(_0x27e3a9,_0x6a817c){return db[_0xdd64('0x2f')][_0xdd64('0x49')]({'where':{'id':_0x27e3a9[_0xdd64('0x53')]['id']}})[_0xdd64('0x25')](handleEntityNotFound(_0x6a817c,null))[_0xdd64('0x25')](removeEntity(_0x6a817c,null))[_0xdd64('0x4a')](handleError(_0x6a817c,null));}; \ No newline at end of file +var _0x1ac0=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','Templates','destroy','end','sendStatus','error','stack','index','Template','rawAttributes','fieldName','type','key','model','map','name','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash'];(function(_0x5ca4d8,_0x436be0){var _0x328566=function(_0x283f3f){while(--_0x283f3f){_0x5ca4d8['push'](_0x5ca4d8['shift']());}};_0x328566(++_0x436be0);}(_0x1ac0,0x8f));var _0x01ac=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1ac0[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x01ac('0x0'));var jsonpatch=require(_0x01ac('0x1'));var rp=require(_0x01ac('0x2'));var moment=require(_0x01ac('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x01ac('0x4'));var util=require('util');var path=require('path');var sox=require(_0x01ac('0x5'));var csv=require(_0x01ac('0x6'));var ejs=require(_0x01ac('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01ac('0x8'));var squel=require(_0x01ac('0x9'));var crypto=require('crypto');var jsforce=require(_0x01ac('0xa'));var deskjs=require(_0x01ac('0xb'));var toCsv=require(_0x01ac('0x6'));var querystring=require(_0x01ac('0xc'));var Papa=require(_0x01ac('0xd'));var Redis=require(_0x01ac('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x01ac('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01ac('0x10'))(_0x01ac('0x11'));var utils=require(_0x01ac('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01ac('0x13'))['db'];function respondWithStatusCode(_0x3ba5cf,_0xcce16){_0xcce16=_0xcce16||0xcc;return function(_0xa6584b){if(_0xa6584b){return _0x3ba5cf['sendStatus'](_0xcce16);}return _0x3ba5cf[_0x01ac('0x14')](_0xcce16)['end']();};}function respondWithResult(_0x414fb4,_0x427d99){_0x427d99=_0x427d99||0xc8;return function(_0x2cf3ff){if(_0x2cf3ff){return _0x414fb4[_0x01ac('0x14')](_0x427d99)[_0x01ac('0x15')](_0x2cf3ff);}};}function respondWithFilteredResult(_0x54c479,_0x17946c){return function(_0x2cb4ad){if(_0x2cb4ad){var _0x34a04a=typeof _0x17946c[_0x01ac('0x16')]===_0x01ac('0x17')&&typeof _0x17946c['limit']===_0x01ac('0x17');var _0x35884d=_0x2cb4ad[_0x01ac('0x18')];var _0x1dda3b=_0x34a04a?0x0:_0x17946c['offset'];var _0x1d86c7=_0x34a04a?_0x2cb4ad[_0x01ac('0x18')]:_0x17946c['offset']+_0x17946c[_0x01ac('0x19')];var _0x3b6696;if(_0x1d86c7>=_0x35884d){_0x1d86c7=_0x35884d;_0x3b6696=0xc8;}else{_0x3b6696=0xce;}_0x54c479[_0x01ac('0x14')](_0x3b6696);return _0x54c479[_0x01ac('0x1a')](_0x01ac('0x1b'),_0x1dda3b+'-'+_0x1d86c7+'/'+_0x35884d)[_0x01ac('0x15')](_0x2cb4ad);}return null;};}function patchUpdates(_0x2efbfe){return function(_0x4f5923){try{jsonpatch[_0x01ac('0x1c')](_0x4f5923,_0x2efbfe,!![]);}catch(_0xdc95f0){return BPromise['reject'](_0xdc95f0);}return _0x4f5923['save']();};}function saveUpdates(_0x34e938,_0xa20d8f){return function(_0x3858d3){if(_0x3858d3){return _0x3858d3[_0x01ac('0x1d')](_0x34e938)[_0x01ac('0x1e')](function(_0x56394e){return _0x56394e;});}return null;};}function removeEntity(_0x3f96e1,_0xe00f2){return function(_0x16d609){if(_0x16d609){return _0x16d609['destroy']()[_0x01ac('0x1e')](function(){var _0x4d49aa=_0x16d609['get']({'plain':!![]});var _0x3c3830=_0x01ac('0x1f');return db['UserProfileResource'][_0x01ac('0x20')]({'where':{'type':_0x3c3830,'resourceId':_0x4d49aa['id']}})[_0x01ac('0x1e')](function(){return _0x16d609;});})[_0x01ac('0x1e')](function(){_0x3f96e1[_0x01ac('0x14')](0xcc)[_0x01ac('0x21')]();});}};}function handleEntityNotFound(_0x178954,_0x1dffc2){return function(_0x2a6e68){if(!_0x2a6e68){_0x178954[_0x01ac('0x22')](0x194);}return _0x2a6e68;};}function handleError(_0x1623d6,_0x599479){_0x599479=_0x599479||0x1f4;return function(_0x362c91){logger[_0x01ac('0x23')](_0x362c91[_0x01ac('0x24')]);if(_0x362c91['name']){delete _0x362c91['name'];}_0x1623d6[_0x01ac('0x14')](_0x599479)['send'](_0x362c91);};}exports[_0x01ac('0x25')]=function(_0x321eed,_0x51a690){var _0x28a716={},_0x1d2da9={},_0x15fcf4={'count':0x0,'rows':[]};var _0x347f72=_['map'](db[_0x01ac('0x26')][_0x01ac('0x27')],function(_0x4a474c){return{'name':_0x4a474c[_0x01ac('0x28')],'type':_0x4a474c[_0x01ac('0x29')][_0x01ac('0x2a')]};});_0x1d2da9[_0x01ac('0x2b')]=_[_0x01ac('0x2c')](_0x347f72,_0x01ac('0x2d'));_0x1d2da9[_0x01ac('0x2e')]=_['keys'](_0x321eed['query']);_0x1d2da9['filters']=_[_0x01ac('0x2f')](_0x1d2da9[_0x01ac('0x2b')],_0x1d2da9[_0x01ac('0x2e')]);_0x28a716['attributes']=_[_0x01ac('0x2f')](_0x1d2da9[_0x01ac('0x2b')],qs[_0x01ac('0x30')](_0x321eed[_0x01ac('0x2e')]['fields']));_0x28a716['attributes']=_0x28a716[_0x01ac('0x31')]['length']?_0x28a716[_0x01ac('0x31')]:_0x1d2da9[_0x01ac('0x2b')];if(!_0x321eed[_0x01ac('0x2e')][_0x01ac('0x32')](_0x01ac('0x33'))){_0x28a716[_0x01ac('0x19')]=qs[_0x01ac('0x19')](_0x321eed['query'][_0x01ac('0x19')]);_0x28a716[_0x01ac('0x16')]=qs['offset'](_0x321eed[_0x01ac('0x2e')]['offset']);}_0x28a716[_0x01ac('0x34')]=qs['sort'](_0x321eed['query']['sort']);_0x28a716[_0x01ac('0x35')]=qs[_0x01ac('0x36')](_[_0x01ac('0x37')](_0x321eed[_0x01ac('0x2e')],_0x1d2da9[_0x01ac('0x36')]),_0x347f72);if(_0x321eed[_0x01ac('0x2e')]['filter']){_0x28a716[_0x01ac('0x35')]=_[_0x01ac('0x38')](_0x28a716[_0x01ac('0x35')],{'$or':_[_0x01ac('0x2c')](_0x347f72,function(_0x2f7ca5){if(_0x2f7ca5[_0x01ac('0x29')]!==_0x01ac('0x39')){var _0x3e94f2={};_0x3e94f2[_0x2f7ca5[_0x01ac('0x2d')]]={'$like':'%'+_0x321eed[_0x01ac('0x2e')][_0x01ac('0x3a')]+'%'};return _0x3e94f2;}})});}_0x28a716=_[_0x01ac('0x38')]({},_0x28a716,_0x321eed[_0x01ac('0x3b')]);var _0x24ddc5={'where':_0x28a716['where']};return db[_0x01ac('0x26')][_0x01ac('0x18')](_0x24ddc5)[_0x01ac('0x1e')](function(_0x5775e0){_0x15fcf4[_0x01ac('0x18')]=_0x5775e0;if(_0x321eed[_0x01ac('0x2e')][_0x01ac('0x3c')]){_0x28a716[_0x01ac('0x3d')]=[{'all':!![]}];}return db[_0x01ac('0x26')][_0x01ac('0x3e')](_0x28a716);})[_0x01ac('0x1e')](function(_0x2f5311){_0x15fcf4['rows']=_0x2f5311;return _0x15fcf4;})[_0x01ac('0x1e')](respondWithFilteredResult(_0x51a690,_0x28a716))[_0x01ac('0x3f')](handleError(_0x51a690,null));};exports[_0x01ac('0x40')]=function(_0x1ce4e2,_0x731db6){var _0x1128b7={'raw':!![],'where':{'id':_0x1ce4e2[_0x01ac('0x41')]['id']}},_0x50022f={};_0x50022f['model']=_[_0x01ac('0x42')](db[_0x01ac('0x26')][_0x01ac('0x27')]);_0x50022f[_0x01ac('0x2e')]=_[_0x01ac('0x42')](_0x1ce4e2[_0x01ac('0x2e')]);_0x50022f[_0x01ac('0x36')]=_[_0x01ac('0x2f')](_0x50022f[_0x01ac('0x2b')],_0x50022f[_0x01ac('0x2e')]);_0x1128b7[_0x01ac('0x31')]=_[_0x01ac('0x2f')](_0x50022f[_0x01ac('0x2b')],qs[_0x01ac('0x30')](_0x1ce4e2[_0x01ac('0x2e')][_0x01ac('0x30')]));_0x1128b7[_0x01ac('0x31')]=_0x1128b7['attributes'][_0x01ac('0x43')]?_0x1128b7[_0x01ac('0x31')]:_0x50022f[_0x01ac('0x2b')];if(_0x1ce4e2[_0x01ac('0x2e')][_0x01ac('0x3c')]){_0x1128b7['include']=[{'all':!![]}];}_0x1128b7=_[_0x01ac('0x38')]({},_0x1128b7,_0x1ce4e2[_0x01ac('0x3b')]);return db[_0x01ac('0x26')][_0x01ac('0x44')](_0x1128b7)['then'](handleEntityNotFound(_0x731db6,null))[_0x01ac('0x1e')](respondWithResult(_0x731db6,null))[_0x01ac('0x3f')](handleError(_0x731db6,null));};exports[_0x01ac('0x45')]=function(_0x34c07a,_0x1b2cd5){return db['Template'][_0x01ac('0x45')](_0x34c07a[_0x01ac('0x46')],{})[_0x01ac('0x1e')](function(_0x51237d){var _0x5c5dc2=_0x34c07a['user']['get']({'plain':!![]});if(!_0x5c5dc2)throw new Error(_0x01ac('0x47'));if(_0x5c5dc2[_0x01ac('0x48')]==='user'){var _0xbf7ebf=_0x51237d['get']({'plain':!![]});var _0x16f1b9='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x16f1b9,'userProfileId':_0x5c5dc2[_0x01ac('0x49')]},'raw':!![]})['then'](function(_0x5ae21b){if(_0x5ae21b&&_0x5ae21b['autoAssociation']===0x0){return db[_0x01ac('0x4a')][_0x01ac('0x45')]({'name':_0xbf7ebf['name'],'resourceId':_0xbf7ebf['id'],'type':_0x5ae21b[_0x01ac('0x2d')],'sectionId':_0x5ae21b['id']},{})[_0x01ac('0x1e')](function(){return _0x51237d;});}else{return _0x51237d;}})[_0x01ac('0x3f')](function(_0x52a690){logger['error'](_0x01ac('0x4b'),_0x52a690);throw _0x52a690;});}return _0x51237d;})[_0x01ac('0x1e')](respondWithResult(_0x1b2cd5,0xc9))['catch'](handleError(_0x1b2cd5,null));};exports[_0x01ac('0x1d')]=function(_0x37f4f4,_0x40adbf){if(_0x37f4f4['body']['id']){delete _0x37f4f4[_0x01ac('0x46')]['id'];}return db[_0x01ac('0x26')]['find']({'where':{'id':_0x37f4f4[_0x01ac('0x41')]['id']}})[_0x01ac('0x1e')](handleEntityNotFound(_0x40adbf,null))[_0x01ac('0x1e')](saveUpdates(_0x37f4f4[_0x01ac('0x46')],null))['then'](respondWithResult(_0x40adbf,null))['catch'](handleError(_0x40adbf,null));};exports[_0x01ac('0x20')]=function(_0x387872,_0x27f72f){return db[_0x01ac('0x26')][_0x01ac('0x44')]({'where':{'id':_0x387872[_0x01ac('0x41')]['id']}})['then'](handleEntityNotFound(_0x27f72f,null))['then'](removeEntity(_0x27f72f,null))[_0x01ac('0x3f')](handleError(_0x27f72f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 9acf855..c3f8a71 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 _0x669f=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','util','../../config/logger','api'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x669f,0x68));var _0xf669=function(_0x134827,_0x21f6ed){_0x134827=_0x134827-0x0;var _0x366671=_0x669f[_0x134827];return _0x366671;};'use strict';var _=require(_0xf669('0x0'));var util=require(_0xf669('0x1'));var logger=require(_0xf669('0x2'))(_0xf669('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf669('0x4'));var fs=require('fs');var path=require(_0xf669('0x5'));var rimraf=require(_0xf669('0x6'));var config=require(_0xf669('0x7'));var attributes=require(_0xf669('0x8'));module[_0xf669('0x9')]=function(_0x4aec03,_0x5ad69f){return _0x4aec03['define'](_0xf669('0xa'),attributes,{'tableName':_0xf669('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c48=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util'];(function(_0x151930,_0x534d26){var _0x743efc=function(_0x14afe8){while(--_0x14afe8){_0x151930['push'](_0x151930['shift']());}};_0x743efc(++_0x534d26);}(_0x8c48,0xb2));var _0x88c4=function(_0x153ee2,_0x4e3570){_0x153ee2=_0x153ee2-0x0;var _0x37db0d=_0x8c48[_0x153ee2];return _0x37db0d;};'use strict';var _=require(_0x88c4('0x0'));var util=require(_0x88c4('0x1'));var logger=require(_0x88c4('0x2'))(_0x88c4('0x3'));var moment=require('moment');var BPromise=require(_0x88c4('0x4'));var rp=require(_0x88c4('0x5'));var fs=require('fs');var path=require(_0x88c4('0x6'));var rimraf=require('rimraf');var config=require(_0x88c4('0x7'));var attributes=require(_0x88c4('0x8'));module[_0x88c4('0x9')]=function(_0xe2e64e,_0x30fe18){return _0xe2e64e[_0x88c4('0xa')]('Template',attributes,{'tableName':_0x88c4('0xb'),'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 3e1f504..d8b5185 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 _0x5ff2=['findAll','options','where','include','attributes','map','model','GetTemplate','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','Template'];(function(_0x56d9ea,_0x1d2bee){var _0x29a6ba=function(_0x1c74b1){while(--_0x1c74b1){_0x56d9ea['push'](_0x56d9ea['shift']());}};_0x29a6ba(++_0x1d2bee);}(_0x5ff2,0x6e));var _0x25ff=function(_0x1ba697,_0x186781){_0x1ba697=_0x1ba697-0x0;var _0x433b23=_0x5ff2[_0x1ba697];return _0x433b23;};'use strict';var _=require(_0x25ff('0x0'));var util=require('util');var moment=require(_0x25ff('0x1'));var BPromise=require(_0x25ff('0x2'));var rs=require(_0x25ff('0x3'));var fs=require('fs');var Redis=require(_0x25ff('0x4'));var db=require(_0x25ff('0x5'))['db'];var utils=require(_0x25ff('0x6'));var logger=require(_0x25ff('0x7'))(_0x25ff('0x8'));var config=require(_0x25ff('0x9'));var jayson=require(_0x25ff('0xa'));var client=jayson[_0x25ff('0xb')][_0x25ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3be5,_0x59b05f,_0x36cd92){return new BPromise(function(_0x1bfdae,_0xb1032e){return client[_0x25ff('0xd')](_0x2e3be5,_0x36cd92)[_0x25ff('0xe')](function(_0x14089c){logger['info'](_0x25ff('0xf'),_0x59b05f,_0x25ff('0x10'));logger[_0x25ff('0x11')](_0x25ff('0x12'),_0x59b05f,_0x25ff('0x10'),JSON[_0x25ff('0x13')](_0x14089c));if(_0x14089c['error']){if(_0x14089c[_0x25ff('0x14')]['code']===0x1f4){logger[_0x25ff('0x14')](_0x25ff('0xf'),_0x59b05f,_0x14089c[_0x25ff('0x14')]['message']);return _0xb1032e(_0x14089c[_0x25ff('0x14')]['message']);}logger[_0x25ff('0x14')](_0x25ff('0xf'),_0x59b05f,_0x14089c['error'][_0x25ff('0x15')]);return _0x1bfdae(_0x14089c[_0x25ff('0x14')][_0x25ff('0x15')]);}else{logger[_0x25ff('0x16')](_0x25ff('0xf'),_0x59b05f,_0x25ff('0x10'));_0x1bfdae(_0x14089c[_0x25ff('0x17')][_0x25ff('0x15')]);}})[_0x25ff('0x18')](function(_0x225a4f){logger[_0x25ff('0x14')](_0x25ff('0xf'),_0x59b05f,_0x225a4f);_0xb1032e(_0x225a4f);});});}exports['GetTemplate']=function(_0x35a8d0){var _0xc07bed=this;return new Promise(function(_0x1e4a4b,_0x46fbe7){return db[_0x25ff('0x19')][_0x25ff('0x1a')]({'raw':_0x35a8d0['options']?_0x35a8d0[_0x25ff('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x35a8d0['options']?_0x35a8d0[_0x25ff('0x1b')][_0x25ff('0x1c')]||null:null,'attributes':_0x35a8d0['options']?_0x35a8d0[_0x25ff('0x1b')]['attributes']||null:null,'limit':_0x35a8d0['options']?_0x35a8d0[_0x25ff('0x1b')]['limit']||null:null,'include':_0x35a8d0[_0x25ff('0x1b')]?_0x35a8d0['options'][_0x25ff('0x1d')]?_['map'](_0x35a8d0[_0x25ff('0x1b')][_0x25ff('0x1d')],function(_0x3114a9){return{'model':db[_0x3114a9['model']],'as':_0x3114a9['as'],'attributes':_0x3114a9[_0x25ff('0x1e')],'include':_0x3114a9[_0x25ff('0x1d')]?_[_0x25ff('0x1f')](_0x3114a9[_0x25ff('0x1d')],function(_0x4d1eb6){return{'model':db[_0x4d1eb6[_0x25ff('0x20')]],'as':_0x4d1eb6['as'],'attributes':_0x4d1eb6[_0x25ff('0x1e')],'include':_0x4d1eb6[_0x25ff('0x1d')]?_[_0x25ff('0x1f')](_0x4d1eb6[_0x25ff('0x1d')],function(_0xf9548a){return{'model':db[_0xf9548a[_0x25ff('0x20')]],'as':_0xf9548a['as'],'attributes':_0xf9548a[_0x25ff('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x25ff('0xe')](function(_0x249482){logger[_0x25ff('0x16')](_0x25ff('0x21'),_0x35a8d0);logger[_0x25ff('0x11')](_0x25ff('0x21'),_0x35a8d0,JSON[_0x25ff('0x13')](_0x249482));_0x1e4a4b(_0x249482);})[_0x25ff('0x18')](function(_0x5f83c){logger[_0x25ff('0x14')](_0x25ff('0x21'),_0x5f83c['message'],_0x35a8d0);_0x46fbe7(_0xc07bed[_0x25ff('0x14')](0x1f4,_0x5f83c['message']));});});}; \ No newline at end of file +var _0x9ec9=['then','info','request\x20sent','debug','stringify','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','options','raw','where','limit','include','map','model','attributes','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x2d508a,_0x219313){var _0x3297bb=function(_0x52139d){while(--_0x52139d){_0x2d508a['push'](_0x2d508a['shift']());}};_0x3297bb(++_0x219313);}(_0x9ec9,0x8d));var _0x99ec=function(_0x110d59,_0x50c4fb){_0x110d59=_0x110d59-0x0;var _0x2fce64=_0x9ec9[_0x110d59];return _0x2fce64;};'use strict';var _=require('lodash');var util=require(_0x99ec('0x0'));var moment=require('moment');var BPromise=require(_0x99ec('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99ec('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x99ec('0x3'));var logger=require(_0x99ec('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x99ec('0x5'));var client=jayson[_0x99ec('0x6')][_0x99ec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5acf6e,_0x2bccfd,_0x4c7885){return new BPromise(function(_0x3c4010,_0x29753a){return client[_0x99ec('0x8')](_0x5acf6e,_0x4c7885)[_0x99ec('0x9')](function(_0x172f24){logger[_0x99ec('0xa')]('Template,\x20%s,\x20%s',_0x2bccfd,_0x99ec('0xb'));logger[_0x99ec('0xc')]('Template,\x20%s,\x20%s,\x20%s',_0x2bccfd,_0x99ec('0xb'),JSON[_0x99ec('0xd')](_0x172f24));if(_0x172f24[_0x99ec('0xe')]){if(_0x172f24['error']['code']===0x1f4){logger['error'](_0x99ec('0xf'),_0x2bccfd,_0x172f24[_0x99ec('0xe')][_0x99ec('0x10')]);return _0x29753a(_0x172f24[_0x99ec('0xe')]['message']);}logger[_0x99ec('0xe')]('Template,\x20%s,\x20%s',_0x2bccfd,_0x172f24[_0x99ec('0xe')][_0x99ec('0x10')]);return _0x3c4010(_0x172f24[_0x99ec('0xe')]['message']);}else{logger['info']('Template,\x20%s,\x20%s',_0x2bccfd,'request\x20sent');_0x3c4010(_0x172f24[_0x99ec('0x11')][_0x99ec('0x10')]);}})[_0x99ec('0x12')](function(_0x2448f4){logger['error'](_0x99ec('0xf'),_0x2bccfd,_0x2448f4);_0x29753a(_0x2448f4);});});}exports[_0x99ec('0x13')]=function(_0x7b3dfd){var _0x1d774a=this;return new Promise(function(_0x263ce7,_0x42197c){return db[_0x99ec('0x14')][_0x99ec('0x15')]({'raw':_0x7b3dfd[_0x99ec('0x16')]?_0x7b3dfd[_0x99ec('0x16')][_0x99ec('0x17')]===undefined?!![]:![]:!![],'where':_0x7b3dfd[_0x99ec('0x16')]?_0x7b3dfd['options'][_0x99ec('0x18')]||null:null,'attributes':_0x7b3dfd[_0x99ec('0x16')]?_0x7b3dfd['options']['attributes']||null:null,'limit':_0x7b3dfd[_0x99ec('0x16')]?_0x7b3dfd[_0x99ec('0x16')][_0x99ec('0x19')]||null:null,'include':_0x7b3dfd['options']?_0x7b3dfd[_0x99ec('0x16')][_0x99ec('0x1a')]?_[_0x99ec('0x1b')](_0x7b3dfd[_0x99ec('0x16')][_0x99ec('0x1a')],function(_0x5e3083){return{'model':db[_0x5e3083['model']],'as':_0x5e3083['as'],'attributes':_0x5e3083['attributes'],'include':_0x5e3083[_0x99ec('0x1a')]?_['map'](_0x5e3083[_0x99ec('0x1a')],function(_0x1cdb1f){return{'model':db[_0x1cdb1f[_0x99ec('0x1c')]],'as':_0x1cdb1f['as'],'attributes':_0x1cdb1f[_0x99ec('0x1d')],'include':_0x1cdb1f[_0x99ec('0x1a')]?_[_0x99ec('0x1b')](_0x1cdb1f[_0x99ec('0x1a')],function(_0x290a3b){return{'model':db[_0x290a3b['model']],'as':_0x290a3b['as'],'attributes':_0x290a3b[_0x99ec('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x99ec('0x9')](function(_0x333ec8){logger[_0x99ec('0xa')]('GetTemplate',_0x7b3dfd);logger[_0x99ec('0xc')](_0x99ec('0x13'),_0x7b3dfd,JSON[_0x99ec('0xd')](_0x333ec8));_0x263ce7(_0x333ec8);})[_0x99ec('0x12')](function(_0x4e9615){logger[_0x99ec('0xe')](_0x99ec('0x13'),_0x4e9615[_0x99ec('0x10')],_0x7b3dfd);_0x42197c(_0x1d774a[_0x99ec('0xe')](0x1f4,_0x4e9615[_0x99ec('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d37926b..28b4991 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 _0xa5a4=['isAuthenticated','/:id/all_conditions','/:id/any_conditions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id'];(function(_0x278776,_0xf09594){var _0x282212=function(_0xbfb547){while(--_0xbfb547){_0x278776['push'](_0x278776['shift']());}};_0x282212(++_0xf09594);}(_0xa5a4,0xaf));var _0x4a5a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa5a4[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x4a5a('0x0'));var util=require(_0x4a5a('0x1'));var path=require(_0x4a5a('0x2'));var timeout=require(_0x4a5a('0x3'));var express=require(_0x4a5a('0x4'));var router=express[_0x4a5a('0x5')]();var fs_extra=require(_0x4a5a('0x6'));var auth=require(_0x4a5a('0x7'));var interaction=require(_0x4a5a('0x8'));var config=require(_0x4a5a('0x9'));var controller=require(_0x4a5a('0xa'));router[_0x4a5a('0xb')]('/',auth['isAuthenticated'](),controller[_0x4a5a('0xc')]);router[_0x4a5a('0xb')](_0x4a5a('0xd'),auth[_0x4a5a('0xe')](),controller['show']);router[_0x4a5a('0xb')](_0x4a5a('0xf'),auth[_0x4a5a('0xe')](),controller['getAllConditions']);router[_0x4a5a('0xb')](_0x4a5a('0x10'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x4a5a('0xb')]('/:id/actions',auth[_0x4a5a('0xe')](),controller['getActions']);router[_0x4a5a('0x11')]('/',auth[_0x4a5a('0xe')](),controller[_0x4a5a('0x12')]);router[_0x4a5a('0x11')]('/:id/all_conditions',auth[_0x4a5a('0xe')](),controller[_0x4a5a('0x13')]);router['post'](_0x4a5a('0x10'),auth[_0x4a5a('0xe')](),controller[_0x4a5a('0x14')]);router[_0x4a5a('0x11')](_0x4a5a('0x15'),auth[_0x4a5a('0xe')](),controller[_0x4a5a('0x16')]);router[_0x4a5a('0x17')](_0x4a5a('0xd'),auth[_0x4a5a('0xe')](),controller[_0x4a5a('0x18')]);router['delete'](_0x4a5a('0xd'),auth['isAuthenticated'](),controller[_0x4a5a('0x19')]);module[_0x4a5a('0x1a')]=router; \ No newline at end of file +var _0x4732=['isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x1a19d8,_0x4f1d04){var _0xe88218=function(_0x43ca13){while(--_0x43ca13){_0x1a19d8['push'](_0x1a19d8['shift']());}};_0xe88218(++_0x4f1d04);}(_0x4732,0xf1));var _0x2473=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x4732[_0x26d6d9];return _0x1b4875;};'use strict';var multer=require(_0x2473('0x0'));var util=require('util');var path=require(_0x2473('0x1'));var timeout=require(_0x2473('0x2'));var express=require(_0x2473('0x3'));var router=express[_0x2473('0x4')]();var fs_extra=require(_0x2473('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2473('0x6'));var config=require(_0x2473('0x7'));var controller=require('./trigger.controller');router[_0x2473('0x8')]('/',auth['isAuthenticated'](),controller[_0x2473('0x9')]);router[_0x2473('0x8')](_0x2473('0xa'),auth[_0x2473('0xb')](),controller[_0x2473('0xc')]);router['get']('/:id/all_conditions',auth[_0x2473('0xb')](),controller[_0x2473('0xd')]);router[_0x2473('0x8')](_0x2473('0xe'),auth['isAuthenticated'](),controller[_0x2473('0xf')]);router[_0x2473('0x8')](_0x2473('0x10'),auth[_0x2473('0xb')](),controller['getActions']);router[_0x2473('0x11')]('/',auth['isAuthenticated'](),controller[_0x2473('0x12')]);router[_0x2473('0x11')](_0x2473('0x13'),auth[_0x2473('0xb')](),controller[_0x2473('0x14')]);router[_0x2473('0x11')](_0x2473('0xe'),auth[_0x2473('0xb')](),controller[_0x2473('0x15')]);router[_0x2473('0x11')](_0x2473('0x10'),auth['isAuthenticated'](),controller[_0x2473('0x16')]);router[_0x2473('0x17')]('/:id',auth[_0x2473('0xb')](),controller[_0x2473('0x18')]);router[_0x2473('0x19')](_0x2473('0xa'),auth[_0x2473('0xb')](),controller[_0x2473('0x1a')]);module[_0x2473('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b89fbe4..045ed82 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 _0xd5b8=['sequelize','exports','STRING'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd5b8,0x150));var _0x8d5b=function(_0x1f2f0f,_0xf1f6a7){_0x1f2f0f=_0x1f2f0f-0x0;var _0x51084c=_0xd5b8[_0x1f2f0f];return _0x51084c;};'use strict';var Sequelize=require(_0x8d5b('0x0'));module[_0x8d5b('0x1')]={'name':{'type':Sequelize[_0x8d5b('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8d5b('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2535=['STRING','exports'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x2535,0xf1));var _0x5253=function(_0x595225,_0x296dfd){_0x595225=_0x595225-0x0;var _0x11cd17=_0x2535[_0x595225];return _0x11cd17;};'use strict';var Sequelize=require('sequelize');module[_0x5253('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5253('0x1')]},'description':{'type':Sequelize[_0x5253('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 77941c7..ac3ed72 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 _0x5e38=['addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','hasOwnProperty','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','index','Trigger','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5e38,0x138));var _0x85e3=function(_0x51084c,_0x54d8f5){_0x51084c=_0x51084c-0x0;var _0x4d36be=_0x5e38[_0x51084c];return _0x4d36be;};'use strict';var emlformat=require(_0x85e3('0x0'));var rimraf=require(_0x85e3('0x1'));var zipdir=require(_0x85e3('0x2'));var jsonpatch=require(_0x85e3('0x3'));var rp=require(_0x85e3('0x4'));var moment=require(_0x85e3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x85e3('0x6'));var util=require(_0x85e3('0x7'));var path=require(_0x85e3('0x8'));var sox=require(_0x85e3('0x9'));var csv=require('to-csv');var ejs=require(_0x85e3('0xa'));var fs=require('fs');var fs_extra=require(_0x85e3('0xb'));var _=require(_0x85e3('0xc'));var squel=require(_0x85e3('0xd'));var crypto=require(_0x85e3('0xe'));var jsforce=require(_0x85e3('0xf'));var deskjs=require(_0x85e3('0x10'));var toCsv=require('to-csv');var querystring=require(_0x85e3('0x11'));var Papa=require(_0x85e3('0x12'));var Redis=require(_0x85e3('0x13'));var authService=require(_0x85e3('0x14'));var qs=require(_0x85e3('0x15'));var as=require(_0x85e3('0x16'));var hardwareService=require(_0x85e3('0x17'));var logger=require(_0x85e3('0x18'))(_0x85e3('0x19'));var utils=require(_0x85e3('0x1a'));var config=require(_0x85e3('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29297b,_0x2d7768){_0x2d7768=_0x2d7768||0xcc;return function(_0x1c138c){if(_0x1c138c){return _0x29297b[_0x85e3('0x1c')](_0x2d7768);}return _0x29297b[_0x85e3('0x1d')](_0x2d7768)[_0x85e3('0x1e')]();};}function respondWithResult(_0x461c21,_0x3650d7){_0x3650d7=_0x3650d7||0xc8;return function(_0x490d64){if(_0x490d64){return _0x461c21['status'](_0x3650d7)[_0x85e3('0x1f')](_0x490d64);}};}function respondWithFilteredResult(_0x3a14a3,_0x6d6a42){return function(_0x554f60){if(_0x554f60){var _0x2c7e54=typeof _0x6d6a42[_0x85e3('0x20')]===_0x85e3('0x21')&&typeof _0x6d6a42[_0x85e3('0x22')]==='undefined';var _0x510ea8=_0x554f60['count'];var _0x4425af=_0x2c7e54?0x0:_0x6d6a42[_0x85e3('0x20')];var _0x5f4b07=_0x2c7e54?_0x554f60['count']:_0x6d6a42[_0x85e3('0x20')]+_0x6d6a42['limit'];var _0x408700;if(_0x5f4b07>=_0x510ea8){_0x5f4b07=_0x510ea8;_0x408700=0xc8;}else{_0x408700=0xce;}_0x3a14a3[_0x85e3('0x1d')](_0x408700);return _0x3a14a3[_0x85e3('0x23')]('Content-Range',_0x4425af+'-'+_0x5f4b07+'/'+_0x510ea8)[_0x85e3('0x1f')](_0x554f60);}return null;};}function patchUpdates(_0x3c9119){return function(_0x4b2e2a){try{jsonpatch[_0x85e3('0x24')](_0x4b2e2a,_0x3c9119,!![]);}catch(_0x2d85b8){return BPromise[_0x85e3('0x25')](_0x2d85b8);}return _0x4b2e2a['save']();};}function saveUpdates(_0x39b8ca,_0xec5290){return function(_0x4beb6d){if(_0x4beb6d){return _0x4beb6d['update'](_0x39b8ca)[_0x85e3('0x26')](function(_0x1b3f20){return _0x1b3f20;});}return null;};}function removeEntity(_0x27bd0b,_0x3cc051){return function(_0x15fdc3){if(_0x15fdc3){return _0x15fdc3[_0x85e3('0x27')]()[_0x85e3('0x26')](function(){var _0x370c19=_0x15fdc3[_0x85e3('0x28')]({'plain':!![]});var _0x1ffe22='Triggers';return db[_0x85e3('0x29')][_0x85e3('0x27')]({'where':{'type':_0x1ffe22,'resourceId':_0x370c19['id']}})[_0x85e3('0x26')](function(){return _0x15fdc3;});})[_0x85e3('0x26')](function(){_0x27bd0b['status'](0xcc)[_0x85e3('0x1e')]();});}};}function handleEntityNotFound(_0x27eb55,_0x26a1d2){return function(_0x5905a7){if(!_0x5905a7){_0x27eb55[_0x85e3('0x1c')](0x194);}return _0x5905a7;};}function handleError(_0x5b54bf,_0x422431){_0x422431=_0x422431||0x1f4;return function(_0x48440a){logger['error'](_0x48440a[_0x85e3('0x2a')]);if(_0x48440a[_0x85e3('0x2b')]){delete _0x48440a[_0x85e3('0x2b')];}_0x5b54bf[_0x85e3('0x1d')](_0x422431)[_0x85e3('0x2c')](_0x48440a);};}exports[_0x85e3('0x2d')]=function(_0x1a7ba6,_0x2df018){var _0x5c3171={},_0x376ea5={},_0x2f0654={'count':0x0,'rows':[]};var _0x3c627f=_['map'](db[_0x85e3('0x2e')][_0x85e3('0x2f')],function(_0xae3821){return{'name':_0xae3821[_0x85e3('0x30')],'type':_0xae3821[_0x85e3('0x31')]['key']};});_0x376ea5[_0x85e3('0x32')]=_[_0x85e3('0x33')](_0x3c627f,_0x85e3('0x2b'));_0x376ea5[_0x85e3('0x34')]=_[_0x85e3('0x35')](_0x1a7ba6['query']);_0x376ea5[_0x85e3('0x36')]=_[_0x85e3('0x37')](_0x376ea5['model'],_0x376ea5['query']);_0x5c3171[_0x85e3('0x38')]=_[_0x85e3('0x37')](_0x376ea5[_0x85e3('0x32')],qs[_0x85e3('0x39')](_0x1a7ba6['query']['fields']));_0x5c3171['attributes']=_0x5c3171[_0x85e3('0x38')][_0x85e3('0x3a')]?_0x5c3171[_0x85e3('0x38')]:_0x376ea5['model'];if(!_0x1a7ba6[_0x85e3('0x34')]['hasOwnProperty'](_0x85e3('0x3b'))){_0x5c3171[_0x85e3('0x22')]=qs['limit'](_0x1a7ba6[_0x85e3('0x34')][_0x85e3('0x22')]);_0x5c3171[_0x85e3('0x20')]=qs[_0x85e3('0x20')](_0x1a7ba6[_0x85e3('0x34')]['offset']);}_0x5c3171[_0x85e3('0x3c')]=qs[_0x85e3('0x3d')](_0x1a7ba6[_0x85e3('0x34')][_0x85e3('0x3d')]);_0x5c3171[_0x85e3('0x3e')]=qs['filters'](_[_0x85e3('0x3f')](_0x1a7ba6[_0x85e3('0x34')],_0x376ea5['filters']),_0x3c627f);if(_0x1a7ba6['query'][_0x85e3('0x40')]){_0x5c3171[_0x85e3('0x3e')]=_[_0x85e3('0x41')](_0x5c3171[_0x85e3('0x3e')],{'$or':_['map'](_0x3c627f,function(_0x1f3c0a){if(_0x1f3c0a[_0x85e3('0x31')]!==_0x85e3('0x42')){var _0xedaacd={};_0xedaacd[_0x1f3c0a[_0x85e3('0x2b')]]={'$like':'%'+_0x1a7ba6['query'][_0x85e3('0x40')]+'%'};return _0xedaacd;}})});}_0x5c3171=_[_0x85e3('0x41')]({},_0x5c3171,_0x1a7ba6[_0x85e3('0x43')]);var _0x29a157={'where':_0x5c3171[_0x85e3('0x3e')]};return db[_0x85e3('0x2e')][_0x85e3('0x44')](_0x29a157)[_0x85e3('0x26')](function(_0x15f64f){_0x2f0654[_0x85e3('0x44')]=_0x15f64f;if(_0x1a7ba6['query'][_0x85e3('0x45')]){_0x5c3171[_0x85e3('0x46')]=[{'all':!![]}];}return db[_0x85e3('0x2e')][_0x85e3('0x47')](_0x5c3171);})[_0x85e3('0x26')](function(_0x2dba1d){_0x2f0654[_0x85e3('0x48')]=_0x2dba1d;return _0x2f0654;})['then'](respondWithFilteredResult(_0x2df018,_0x5c3171))[_0x85e3('0x49')](handleError(_0x2df018,null));};exports['show']=function(_0x1e2a24,_0x56d13a){var _0x65b21e={'raw':![],'where':{'id':_0x1e2a24[_0x85e3('0x4a')]['id']}},_0x3818e3={};_0x3818e3[_0x85e3('0x32')]=_[_0x85e3('0x35')](db[_0x85e3('0x2e')][_0x85e3('0x2f')]);_0x3818e3['query']=_['keys'](_0x1e2a24[_0x85e3('0x34')]);_0x3818e3[_0x85e3('0x36')]=_[_0x85e3('0x37')](_0x3818e3['model'],_0x3818e3[_0x85e3('0x34')]);_0x65b21e[_0x85e3('0x38')]=_['intersection'](_0x3818e3['model'],qs[_0x85e3('0x39')](_0x1e2a24[_0x85e3('0x34')][_0x85e3('0x39')]));_0x65b21e['attributes']=_0x65b21e['attributes'][_0x85e3('0x3a')]?_0x65b21e[_0x85e3('0x38')]:_0x3818e3[_0x85e3('0x32')];if(_0x1e2a24[_0x85e3('0x34')][_0x85e3('0x45')]){_0x65b21e[_0x85e3('0x46')]=[{'all':!![]}];}_0x65b21e=_[_0x85e3('0x41')]({},_0x65b21e,_0x1e2a24['options']);return db['Trigger'][_0x85e3('0x4b')](_0x65b21e)[_0x85e3('0x26')](handleEntityNotFound(_0x56d13a,null))[_0x85e3('0x26')](respondWithResult(_0x56d13a,null))['catch'](handleError(_0x56d13a,null));};exports[_0x85e3('0x4c')]=function(_0x57f4b1,_0x59c035){return db[_0x85e3('0x2e')]['create'](_0x57f4b1[_0x85e3('0x4d')],{})[_0x85e3('0x26')](function(_0x446e1){var _0x21c220=_0x57f4b1[_0x85e3('0x4e')][_0x85e3('0x28')]({'plain':!![]});if(!_0x21c220)throw new Error(_0x85e3('0x4f'));if(_0x21c220[_0x85e3('0x50')]==='user'){var _0x3a759d=_0x446e1[_0x85e3('0x28')]({'plain':!![]});var _0x41881e=_0x85e3('0x51');return db[_0x85e3('0x52')][_0x85e3('0x4b')]({'where':{'name':_0x41881e,'userProfileId':_0x21c220[_0x85e3('0x53')]},'raw':!![]})[_0x85e3('0x26')](function(_0x3a02ce){if(_0x3a02ce&&_0x3a02ce[_0x85e3('0x54')]===0x0){return db[_0x85e3('0x29')][_0x85e3('0x4c')]({'name':_0x3a759d['name'],'resourceId':_0x3a759d['id'],'type':_0x3a02ce['name'],'sectionId':_0x3a02ce['id']},{})['then'](function(){return _0x446e1;});}else{return _0x446e1;}})[_0x85e3('0x49')](function(_0x38f8ec){logger[_0x85e3('0x55')](_0x85e3('0x56'),_0x38f8ec);throw _0x38f8ec;});}return _0x446e1;})['then'](respondWithResult(_0x59c035,0xc9))[_0x85e3('0x49')](handleError(_0x59c035,null));};exports[_0x85e3('0x57')]=function(_0x2a6980,_0x43eaeb){if(_0x2a6980['body']['id']){delete _0x2a6980[_0x85e3('0x4d')]['id'];}return db['Trigger'][_0x85e3('0x4b')]({'where':{'id':_0x2a6980['params']['id']}})['then'](handleEntityNotFound(_0x43eaeb,null))[_0x85e3('0x26')](saveUpdates(_0x2a6980['body'],null))[_0x85e3('0x26')](respondWithResult(_0x43eaeb,null))[_0x85e3('0x49')](handleError(_0x43eaeb,null));};exports[_0x85e3('0x27')]=function(_0xfb9481,_0x494c2c){return db['Trigger'][_0x85e3('0x4b')]({'where':{'id':_0xfb9481[_0x85e3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x494c2c,null))[_0x85e3('0x26')](removeEntity(_0x494c2c,null))[_0x85e3('0x49')](handleError(_0x494c2c,null));};exports[_0x85e3('0x58')]=function(_0x491fce,_0x2db118,_0x1c395a){if(_0x491fce['body']['id']){delete _0x491fce[_0x85e3('0x4d')]['id'];}return db['Trigger'][_0x85e3('0x4b')]({'where':{'id':_0x491fce[_0x85e3('0x4a')]['id']}})[_0x85e3('0x26')](handleEntityNotFound(_0x2db118,null))[_0x85e3('0x26')](function(_0x1319f6){if(_0x1319f6){_0x491fce[_0x85e3('0x4d')][_0x85e3('0x59')]=_0x1319f6['id'];return db[_0x85e3('0x5a')][_0x85e3('0x4c')](_0x491fce[_0x85e3('0x4d')]);}})['then'](respondWithResult(_0x2db118,null))['catch'](handleError(_0x2db118,null));};exports[_0x85e3('0x5b')]=function(_0x4ec798,_0x56451d,_0x5e3cb8){if(_0x4ec798[_0x85e3('0x4d')]['id']){delete _0x4ec798[_0x85e3('0x4d')]['id'];}return db[_0x85e3('0x2e')][_0x85e3('0x4b')]({'where':{'id':_0x4ec798[_0x85e3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56451d,null))[_0x85e3('0x26')](function(_0x36868e){if(_0x36868e){_0x4ec798[_0x85e3('0x4d')]['TriggerAnyId']=_0x36868e['id'];return db[_0x85e3('0x5a')]['create'](_0x4ec798[_0x85e3('0x4d')]);}})[_0x85e3('0x26')](respondWithResult(_0x56451d,null))[_0x85e3('0x49')](handleError(_0x56451d,null));};exports[_0x85e3('0x5c')]=function(_0x5a9fd0,_0x2c8d74,_0x324539){var _0xbd549c={};var _0x2973b1={};var _0x50e99b;var _0x15a158;return db[_0x85e3('0x2e')]['findOne']({'where':{'id':_0x5a9fd0['params']['id']}})['then'](handleEntityNotFound(_0x2c8d74,null))[_0x85e3('0x26')](function(_0x236253){if(_0x236253){_0x50e99b=_0x236253;_0x2973b1[_0x85e3('0x32')]=_['keys'](db[_0x85e3('0x5a')][_0x85e3('0x2f')]);_0x2973b1[_0x85e3('0x34')]=_['keys'](_0x5a9fd0['query']);_0x2973b1[_0x85e3('0x36')]=_[_0x85e3('0x37')](_0x2973b1[_0x85e3('0x32')],_0x2973b1[_0x85e3('0x34')]);_0xbd549c[_0x85e3('0x38')]=_[_0x85e3('0x37')](_0x2973b1['model'],qs[_0x85e3('0x39')](_0x5a9fd0[_0x85e3('0x34')][_0x85e3('0x39')]));_0xbd549c[_0x85e3('0x38')]=_0xbd549c[_0x85e3('0x38')][_0x85e3('0x3a')]?_0xbd549c['attributes']:_0x2973b1[_0x85e3('0x32')];_0xbd549c['order']=qs[_0x85e3('0x3d')](_0x5a9fd0[_0x85e3('0x34')][_0x85e3('0x3d')]);_0xbd549c[_0x85e3('0x3e')]=qs[_0x85e3('0x36')](_[_0x85e3('0x3f')](_0x5a9fd0[_0x85e3('0x34')],_0x2973b1['filters']));if(_0x5a9fd0[_0x85e3('0x34')][_0x85e3('0x40')]){_0xbd549c['where']=_['merge'](_0xbd549c[_0x85e3('0x3e')],{'$or':_[_0x85e3('0x33')](_0xbd549c[_0x85e3('0x38')],function(_0x3259b0){var _0x5fc2cd={};_0x5fc2cd[_0x3259b0]={'$like':'%'+_0x5a9fd0[_0x85e3('0x34')][_0x85e3('0x40')]+'%'};return _0x5fc2cd;})});}_0xbd549c=_[_0x85e3('0x41')]({},_0xbd549c,_0x5a9fd0[_0x85e3('0x43')]);return _0x50e99b['getAllConditions'](_0xbd549c);}})[_0x85e3('0x26')](function(_0x3cbdd5){if(_0x3cbdd5){_0x15a158=_0x3cbdd5[_0x85e3('0x3a')];if(!_0x5a9fd0['query'][_0x85e3('0x5d')](_0x85e3('0x3b'))){_0xbd549c[_0x85e3('0x22')]=qs[_0x85e3('0x22')](_0x5a9fd0[_0x85e3('0x34')]['limit']);_0xbd549c['offset']=qs[_0x85e3('0x20')](_0x5a9fd0['query'][_0x85e3('0x20')]);}return _0x50e99b[_0x85e3('0x5c')](_0xbd549c);}})['then'](function(_0x606290){if(_0x606290){return _0x606290?{'count':_0x15a158,'rows':_0x606290}:null;}})['then'](respondWithResult(_0x2c8d74,null))[_0x85e3('0x49')](handleError(_0x2c8d74,null));};exports[_0x85e3('0x5e')]=function(_0x479d45,_0x558dc2,_0x544401){var _0x4e943f={};var _0x3066a5={};var _0xc08ed1;var _0x4e6437;return db[_0x85e3('0x2e')][_0x85e3('0x5f')]({'where':{'id':_0x479d45[_0x85e3('0x4a')]['id']}})[_0x85e3('0x26')](handleEntityNotFound(_0x558dc2,null))[_0x85e3('0x26')](function(_0x1945ee){if(_0x1945ee){_0xc08ed1=_0x1945ee;_0x3066a5[_0x85e3('0x32')]=_[_0x85e3('0x35')](db[_0x85e3('0x5a')][_0x85e3('0x2f')]);_0x3066a5[_0x85e3('0x34')]=_[_0x85e3('0x35')](_0x479d45['query']);_0x3066a5[_0x85e3('0x36')]=_[_0x85e3('0x37')](_0x3066a5[_0x85e3('0x32')],_0x3066a5[_0x85e3('0x34')]);_0x4e943f[_0x85e3('0x38')]=_[_0x85e3('0x37')](_0x3066a5[_0x85e3('0x32')],qs[_0x85e3('0x39')](_0x479d45['query'][_0x85e3('0x39')]));_0x4e943f['attributes']=_0x4e943f['attributes'][_0x85e3('0x3a')]?_0x4e943f[_0x85e3('0x38')]:_0x3066a5['model'];_0x4e943f[_0x85e3('0x3c')]=qs[_0x85e3('0x3d')](_0x479d45[_0x85e3('0x34')][_0x85e3('0x3d')]);_0x4e943f['where']=qs['filters'](_[_0x85e3('0x3f')](_0x479d45[_0x85e3('0x34')],_0x3066a5['filters']));if(_0x479d45[_0x85e3('0x34')][_0x85e3('0x40')]){_0x4e943f[_0x85e3('0x3e')]=_[_0x85e3('0x41')](_0x4e943f[_0x85e3('0x3e')],{'$or':_[_0x85e3('0x33')](_0x4e943f[_0x85e3('0x38')],function(_0x4947cb){var _0x1605a0={};_0x1605a0[_0x4947cb]={'$like':'%'+_0x479d45[_0x85e3('0x34')][_0x85e3('0x40')]+'%'};return _0x1605a0;})});}_0x4e943f=_['merge']({},_0x4e943f,_0x479d45[_0x85e3('0x43')]);return _0xc08ed1['getAnyConditions'](_0x4e943f);}})[_0x85e3('0x26')](function(_0x36f71e){if(_0x36f71e){_0x4e6437=_0x36f71e['length'];if(!_0x479d45[_0x85e3('0x34')][_0x85e3('0x5d')](_0x85e3('0x3b'))){_0x4e943f['limit']=qs[_0x85e3('0x22')](_0x479d45[_0x85e3('0x34')][_0x85e3('0x22')]);_0x4e943f[_0x85e3('0x20')]=qs[_0x85e3('0x20')](_0x479d45[_0x85e3('0x34')][_0x85e3('0x20')]);}return _0xc08ed1[_0x85e3('0x5e')](_0x4e943f);}})['then'](function(_0x166847){if(_0x166847){return _0x166847?{'count':_0x4e6437,'rows':_0x166847}:null;}})[_0x85e3('0x26')](respondWithResult(_0x558dc2,null))[_0x85e3('0x49')](handleError(_0x558dc2,null));};exports[_0x85e3('0x60')]=function(_0x483f90,_0x2ee6bb,_0x219f97){if(_0x483f90[_0x85e3('0x4d')]['id']){delete _0x483f90['body']['id'];}return db[_0x85e3('0x2e')][_0x85e3('0x4b')]({'where':{'id':_0x483f90[_0x85e3('0x4a')]['id']}})[_0x85e3('0x26')](handleEntityNotFound(_0x2ee6bb,null))[_0x85e3('0x26')](function(_0x17df92){if(_0x17df92){_0x483f90[_0x85e3('0x4d')][_0x85e3('0x61')]=_0x17df92['id'];return db[_0x85e3('0x62')][_0x85e3('0x4c')](_0x483f90[_0x85e3('0x4d')]);}})['then'](respondWithResult(_0x2ee6bb,null))[_0x85e3('0x49')](handleError(_0x2ee6bb,null));};exports['getActions']=function(_0x9e3e60,_0x9a617a,_0x477b24){var _0x47c0b7={};var _0x382fa0={};var _0x48eca5;var _0x24a0e9;return db['Trigger'][_0x85e3('0x5f')]({'where':{'id':_0x9e3e60[_0x85e3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9a617a,null))[_0x85e3('0x26')](function(_0x82bb35){if(_0x82bb35){_0x48eca5=_0x82bb35;_0x382fa0[_0x85e3('0x32')]=_[_0x85e3('0x35')](db['Action'][_0x85e3('0x2f')]);_0x382fa0[_0x85e3('0x34')]=_['keys'](_0x9e3e60[_0x85e3('0x34')]);_0x382fa0[_0x85e3('0x36')]=_[_0x85e3('0x37')](_0x382fa0['model'],_0x382fa0[_0x85e3('0x34')]);_0x47c0b7[_0x85e3('0x38')]=_[_0x85e3('0x37')](_0x382fa0[_0x85e3('0x32')],qs[_0x85e3('0x39')](_0x9e3e60['query'][_0x85e3('0x39')]));_0x47c0b7['attributes']=_0x47c0b7[_0x85e3('0x38')][_0x85e3('0x3a')]?_0x47c0b7[_0x85e3('0x38')]:_0x382fa0[_0x85e3('0x32')];_0x47c0b7[_0x85e3('0x3c')]=qs[_0x85e3('0x3d')](_0x9e3e60['query']['sort']);_0x47c0b7[_0x85e3('0x3e')]=qs['filters'](_[_0x85e3('0x3f')](_0x9e3e60[_0x85e3('0x34')],_0x382fa0['filters']));if(_0x9e3e60[_0x85e3('0x34')][_0x85e3('0x40')]){_0x47c0b7[_0x85e3('0x3e')]=_[_0x85e3('0x41')](_0x47c0b7[_0x85e3('0x3e')],{'$or':_[_0x85e3('0x33')](_0x47c0b7['attributes'],function(_0x5c0a3e){var _0x122543={};_0x122543[_0x5c0a3e]={'$like':'%'+_0x9e3e60[_0x85e3('0x34')][_0x85e3('0x40')]+'%'};return _0x122543;})});}_0x47c0b7=_['merge']({},_0x47c0b7,_0x9e3e60[_0x85e3('0x43')]);return _0x48eca5[_0x85e3('0x63')](_0x47c0b7);}})[_0x85e3('0x26')](function(_0x373c2a){if(_0x373c2a){_0x24a0e9=_0x373c2a[_0x85e3('0x3a')];if(!_0x9e3e60[_0x85e3('0x34')][_0x85e3('0x5d')](_0x85e3('0x3b'))){_0x47c0b7[_0x85e3('0x22')]=qs[_0x85e3('0x22')](_0x9e3e60[_0x85e3('0x34')][_0x85e3('0x22')]);_0x47c0b7[_0x85e3('0x20')]=qs[_0x85e3('0x20')](_0x9e3e60[_0x85e3('0x34')][_0x85e3('0x20')]);}return _0x48eca5['getActions'](_0x47c0b7);}})['then'](function(_0x4bed3e){if(_0x4bed3e){return _0x4bed3e?{'count':_0x24a0e9,'rows':_0x4bed3e}:null;}})[_0x85e3('0x26')](respondWithResult(_0x9a617a,null))[_0x85e3('0x49')](handleError(_0x9a617a,null));}; \ No newline at end of file +var _0xfe24=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','end','stack','name','send','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','Condition','findOne','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xfe24,0x1ab));var _0x4fe2=function(_0x5a6171,_0x576877){_0x5a6171=_0x5a6171-0x0;var _0x3c8e93=_0xfe24[_0x5a6171];return _0x3c8e93;};'use strict';var emlformat=require(_0x4fe2('0x0'));var rimraf=require(_0x4fe2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4fe2('0x2'));var rp=require('request-promise');var moment=require(_0x4fe2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4fe2('0x4'));var path=require(_0x4fe2('0x5'));var sox=require(_0x4fe2('0x6'));var csv=require(_0x4fe2('0x7'));var ejs=require(_0x4fe2('0x8'));var fs=require('fs');var fs_extra=require(_0x4fe2('0x9'));var _=require(_0x4fe2('0xa'));var squel=require(_0x4fe2('0xb'));var crypto=require('crypto');var jsforce=require(_0x4fe2('0xc'));var deskjs=require(_0x4fe2('0xd'));var toCsv=require(_0x4fe2('0x7'));var querystring=require(_0x4fe2('0xe'));var Papa=require(_0x4fe2('0xf'));var Redis=require(_0x4fe2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4fe2('0x11'));var as=require(_0x4fe2('0x12'));var hardwareService=require(_0x4fe2('0x13'));var logger=require('../../config/logger')(_0x4fe2('0x14'));var utils=require(_0x4fe2('0x15'));var config=require(_0x4fe2('0x16'));var licenseUtil=require(_0x4fe2('0x17'));var db=require(_0x4fe2('0x18'))['db'];function respondWithStatusCode(_0x4410bb,_0x3a163c){_0x3a163c=_0x3a163c||0xcc;return function(_0x52c3d0){if(_0x52c3d0){return _0x4410bb[_0x4fe2('0x19')](_0x3a163c);}return _0x4410bb[_0x4fe2('0x1a')](_0x3a163c)['end']();};}function respondWithResult(_0x18eed3,_0xe248ed){_0xe248ed=_0xe248ed||0xc8;return function(_0x4a9bf0){if(_0x4a9bf0){return _0x18eed3[_0x4fe2('0x1a')](_0xe248ed)[_0x4fe2('0x1b')](_0x4a9bf0);}};}function respondWithFilteredResult(_0x4dab34,_0x549baa){return function(_0x269a79){if(_0x269a79){var _0x3eb361=typeof _0x549baa[_0x4fe2('0x1c')]==='undefined'&&typeof _0x549baa['limit']==='undefined';var _0x354b1d=_0x269a79[_0x4fe2('0x1d')];var _0x3f1638=_0x3eb361?0x0:_0x549baa['offset'];var _0x243424=_0x3eb361?_0x269a79['count']:_0x549baa['offset']+_0x549baa[_0x4fe2('0x1e')];var _0x2574b7;if(_0x243424>=_0x354b1d){_0x243424=_0x354b1d;_0x2574b7=0xc8;}else{_0x2574b7=0xce;}_0x4dab34[_0x4fe2('0x1a')](_0x2574b7);return _0x4dab34['set']('Content-Range',_0x3f1638+'-'+_0x243424+'/'+_0x354b1d)[_0x4fe2('0x1b')](_0x269a79);}return null;};}function patchUpdates(_0x3f9ee3){return function(_0x4656dc){try{jsonpatch[_0x4fe2('0x1f')](_0x4656dc,_0x3f9ee3,!![]);}catch(_0xe5680){return BPromise[_0x4fe2('0x20')](_0xe5680);}return _0x4656dc[_0x4fe2('0x21')]();};}function saveUpdates(_0x44b49d,_0x1af3a6){return function(_0x59def6){if(_0x59def6){return _0x59def6['update'](_0x44b49d)[_0x4fe2('0x22')](function(_0x17fe71){return _0x17fe71;});}return null;};}function removeEntity(_0x2fcfd9,_0x310086){return function(_0x109d5f){if(_0x109d5f){return _0x109d5f[_0x4fe2('0x23')]()[_0x4fe2('0x22')](function(){var _0x1febc7=_0x109d5f[_0x4fe2('0x24')]({'plain':!![]});var _0x427750=_0x4fe2('0x25');return db[_0x4fe2('0x26')][_0x4fe2('0x23')]({'where':{'type':_0x427750,'resourceId':_0x1febc7['id']}})[_0x4fe2('0x22')](function(){return _0x109d5f;});})[_0x4fe2('0x22')](function(){_0x2fcfd9[_0x4fe2('0x1a')](0xcc)[_0x4fe2('0x27')]();});}};}function handleEntityNotFound(_0x5c9842,_0x449a76){return function(_0x256924){if(!_0x256924){_0x5c9842['sendStatus'](0x194);}return _0x256924;};}function handleError(_0xff1efc,_0x343eba){_0x343eba=_0x343eba||0x1f4;return function(_0x1cf25f){logger['error'](_0x1cf25f[_0x4fe2('0x28')]);if(_0x1cf25f[_0x4fe2('0x29')]){delete _0x1cf25f[_0x4fe2('0x29')];}_0xff1efc[_0x4fe2('0x1a')](_0x343eba)[_0x4fe2('0x2a')](_0x1cf25f);};}exports['index']=function(_0x1d9c3e,_0x211d1c){var _0x142503={},_0x17d1ff={},_0x2560ae={'count':0x0,'rows':[]};var _0x4264ca=_[_0x4fe2('0x2b')](db[_0x4fe2('0x2c')][_0x4fe2('0x2d')],function(_0x103263){return{'name':_0x103263[_0x4fe2('0x2e')],'type':_0x103263[_0x4fe2('0x2f')]['key']};});_0x17d1ff[_0x4fe2('0x30')]=_['map'](_0x4264ca,_0x4fe2('0x29'));_0x17d1ff[_0x4fe2('0x31')]=_[_0x4fe2('0x32')](_0x1d9c3e[_0x4fe2('0x31')]);_0x17d1ff[_0x4fe2('0x33')]=_[_0x4fe2('0x34')](_0x17d1ff[_0x4fe2('0x30')],_0x17d1ff[_0x4fe2('0x31')]);_0x142503[_0x4fe2('0x35')]=_[_0x4fe2('0x34')](_0x17d1ff['model'],qs[_0x4fe2('0x36')](_0x1d9c3e[_0x4fe2('0x31')][_0x4fe2('0x36')]));_0x142503['attributes']=_0x142503[_0x4fe2('0x35')][_0x4fe2('0x37')]?_0x142503[_0x4fe2('0x35')]:_0x17d1ff[_0x4fe2('0x30')];if(!_0x1d9c3e[_0x4fe2('0x31')][_0x4fe2('0x38')](_0x4fe2('0x39'))){_0x142503[_0x4fe2('0x1e')]=qs[_0x4fe2('0x1e')](_0x1d9c3e[_0x4fe2('0x31')]['limit']);_0x142503[_0x4fe2('0x1c')]=qs[_0x4fe2('0x1c')](_0x1d9c3e[_0x4fe2('0x31')][_0x4fe2('0x1c')]);}_0x142503[_0x4fe2('0x3a')]=qs[_0x4fe2('0x3b')](_0x1d9c3e[_0x4fe2('0x31')][_0x4fe2('0x3b')]);_0x142503[_0x4fe2('0x3c')]=qs[_0x4fe2('0x33')](_[_0x4fe2('0x3d')](_0x1d9c3e[_0x4fe2('0x31')],_0x17d1ff[_0x4fe2('0x33')]),_0x4264ca);if(_0x1d9c3e[_0x4fe2('0x31')]['filter']){_0x142503[_0x4fe2('0x3c')]=_['merge'](_0x142503[_0x4fe2('0x3c')],{'$or':_[_0x4fe2('0x2b')](_0x4264ca,function(_0x170362){if(_0x170362[_0x4fe2('0x2f')]!=='VIRTUAL'){var _0x168c47={};_0x168c47[_0x170362[_0x4fe2('0x29')]]={'$like':'%'+_0x1d9c3e[_0x4fe2('0x31')][_0x4fe2('0x3e')]+'%'};return _0x168c47;}})});}_0x142503=_[_0x4fe2('0x3f')]({},_0x142503,_0x1d9c3e[_0x4fe2('0x40')]);var _0x18f051={'where':_0x142503['where']};return db[_0x4fe2('0x2c')][_0x4fe2('0x1d')](_0x18f051)['then'](function(_0x4bab11){_0x2560ae['count']=_0x4bab11;if(_0x1d9c3e[_0x4fe2('0x31')][_0x4fe2('0x41')]){_0x142503[_0x4fe2('0x42')]=[{'all':!![]}];}return db[_0x4fe2('0x2c')]['findAll'](_0x142503);})[_0x4fe2('0x22')](function(_0x551ddc){_0x2560ae['rows']=_0x551ddc;return _0x2560ae;})['then'](respondWithFilteredResult(_0x211d1c,_0x142503))[_0x4fe2('0x43')](handleError(_0x211d1c,null));};exports[_0x4fe2('0x44')]=function(_0x3989fa,_0x3962ae){var _0x34e9b1={'raw':![],'where':{'id':_0x3989fa[_0x4fe2('0x45')]['id']}},_0x27c4b0={};_0x27c4b0[_0x4fe2('0x30')]=_[_0x4fe2('0x32')](db['Trigger'][_0x4fe2('0x2d')]);_0x27c4b0[_0x4fe2('0x31')]=_['keys'](_0x3989fa[_0x4fe2('0x31')]);_0x27c4b0[_0x4fe2('0x33')]=_[_0x4fe2('0x34')](_0x27c4b0['model'],_0x27c4b0['query']);_0x34e9b1['attributes']=_['intersection'](_0x27c4b0[_0x4fe2('0x30')],qs[_0x4fe2('0x36')](_0x3989fa['query'][_0x4fe2('0x36')]));_0x34e9b1[_0x4fe2('0x35')]=_0x34e9b1[_0x4fe2('0x35')][_0x4fe2('0x37')]?_0x34e9b1['attributes']:_0x27c4b0['model'];if(_0x3989fa[_0x4fe2('0x31')][_0x4fe2('0x41')]){_0x34e9b1[_0x4fe2('0x42')]=[{'all':!![]}];}_0x34e9b1=_[_0x4fe2('0x3f')]({},_0x34e9b1,_0x3989fa[_0x4fe2('0x40')]);return db[_0x4fe2('0x2c')][_0x4fe2('0x46')](_0x34e9b1)[_0x4fe2('0x22')](handleEntityNotFound(_0x3962ae,null))[_0x4fe2('0x22')](respondWithResult(_0x3962ae,null))[_0x4fe2('0x43')](handleError(_0x3962ae,null));};exports['create']=function(_0x491740,_0x5878d4){return db[_0x4fe2('0x2c')][_0x4fe2('0x47')](_0x491740[_0x4fe2('0x48')],{})[_0x4fe2('0x22')](function(_0x5dcf3f){var _0x4d1a17=_0x491740['user'][_0x4fe2('0x24')]({'plain':!![]});if(!_0x4d1a17)throw new Error(_0x4fe2('0x49'));if(_0x4d1a17[_0x4fe2('0x4a')]===_0x4fe2('0x4b')){var _0x476eeb=_0x5dcf3f[_0x4fe2('0x24')]({'plain':!![]});var _0x402d7e=_0x4fe2('0x25');return db[_0x4fe2('0x4c')][_0x4fe2('0x46')]({'where':{'name':_0x402d7e,'userProfileId':_0x4d1a17[_0x4fe2('0x4d')]},'raw':!![]})[_0x4fe2('0x22')](function(_0x4bea7a){if(_0x4bea7a&&_0x4bea7a['autoAssociation']===0x0){return db[_0x4fe2('0x26')][_0x4fe2('0x47')]({'name':_0x476eeb[_0x4fe2('0x29')],'resourceId':_0x476eeb['id'],'type':_0x4bea7a['name'],'sectionId':_0x4bea7a['id']},{})[_0x4fe2('0x22')](function(){return _0x5dcf3f;});}else{return _0x5dcf3f;}})['catch'](function(_0x5a5484){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a5484);throw _0x5a5484;});}return _0x5dcf3f;})[_0x4fe2('0x22')](respondWithResult(_0x5878d4,0xc9))['catch'](handleError(_0x5878d4,null));};exports[_0x4fe2('0x4e')]=function(_0x6fb06d,_0x6965af){if(_0x6fb06d[_0x4fe2('0x48')]['id']){delete _0x6fb06d[_0x4fe2('0x48')]['id'];}return db[_0x4fe2('0x2c')]['find']({'where':{'id':_0x6fb06d[_0x4fe2('0x45')]['id']}})[_0x4fe2('0x22')](handleEntityNotFound(_0x6965af,null))[_0x4fe2('0x22')](saveUpdates(_0x6fb06d[_0x4fe2('0x48')],null))[_0x4fe2('0x22')](respondWithResult(_0x6965af,null))[_0x4fe2('0x43')](handleError(_0x6965af,null));};exports['destroy']=function(_0x5a9bd9,_0x3d34cf){return db[_0x4fe2('0x2c')]['find']({'where':{'id':_0x5a9bd9[_0x4fe2('0x45')]['id']}})[_0x4fe2('0x22')](handleEntityNotFound(_0x3d34cf,null))['then'](removeEntity(_0x3d34cf,null))[_0x4fe2('0x43')](handleError(_0x3d34cf,null));};exports['addAllCondition']=function(_0x152ace,_0xaeefa3,_0x29c410){if(_0x152ace[_0x4fe2('0x48')]['id']){delete _0x152ace['body']['id'];}return db[_0x4fe2('0x2c')][_0x4fe2('0x46')]({'where':{'id':_0x152ace[_0x4fe2('0x45')]['id']}})[_0x4fe2('0x22')](handleEntityNotFound(_0xaeefa3,null))['then'](function(_0x8329a5){if(_0x8329a5){_0x152ace[_0x4fe2('0x48')]['TriggerAllId']=_0x8329a5['id'];return db[_0x4fe2('0x4f')][_0x4fe2('0x47')](_0x152ace[_0x4fe2('0x48')]);}})[_0x4fe2('0x22')](respondWithResult(_0xaeefa3,null))[_0x4fe2('0x43')](handleError(_0xaeefa3,null));};exports['addAnyCondition']=function(_0x2ab51b,_0x56de90,_0x1abc02){if(_0x2ab51b[_0x4fe2('0x48')]['id']){delete _0x2ab51b[_0x4fe2('0x48')]['id'];}return db[_0x4fe2('0x2c')][_0x4fe2('0x46')]({'where':{'id':_0x2ab51b[_0x4fe2('0x45')]['id']}})[_0x4fe2('0x22')](handleEntityNotFound(_0x56de90,null))['then'](function(_0x244152){if(_0x244152){_0x2ab51b['body']['TriggerAnyId']=_0x244152['id'];return db['Condition'][_0x4fe2('0x47')](_0x2ab51b[_0x4fe2('0x48')]);}})[_0x4fe2('0x22')](respondWithResult(_0x56de90,null))[_0x4fe2('0x43')](handleError(_0x56de90,null));};exports['getAllConditions']=function(_0x4f72a3,_0x564868,_0xd025b3){var _0x44cc9c={};var _0x18a6e5={};var _0xb21aeb;var _0x3d8712;return db[_0x4fe2('0x2c')][_0x4fe2('0x50')]({'where':{'id':_0x4f72a3['params']['id']}})[_0x4fe2('0x22')](handleEntityNotFound(_0x564868,null))[_0x4fe2('0x22')](function(_0x2dfd59){if(_0x2dfd59){_0xb21aeb=_0x2dfd59;_0x18a6e5['model']=_['keys'](db[_0x4fe2('0x4f')][_0x4fe2('0x2d')]);_0x18a6e5[_0x4fe2('0x31')]=_[_0x4fe2('0x32')](_0x4f72a3['query']);_0x18a6e5[_0x4fe2('0x33')]=_['intersection'](_0x18a6e5[_0x4fe2('0x30')],_0x18a6e5['query']);_0x44cc9c[_0x4fe2('0x35')]=_[_0x4fe2('0x34')](_0x18a6e5[_0x4fe2('0x30')],qs['fields'](_0x4f72a3[_0x4fe2('0x31')][_0x4fe2('0x36')]));_0x44cc9c[_0x4fe2('0x35')]=_0x44cc9c[_0x4fe2('0x35')][_0x4fe2('0x37')]?_0x44cc9c[_0x4fe2('0x35')]:_0x18a6e5['model'];_0x44cc9c[_0x4fe2('0x3a')]=qs[_0x4fe2('0x3b')](_0x4f72a3[_0x4fe2('0x31')][_0x4fe2('0x3b')]);_0x44cc9c['where']=qs[_0x4fe2('0x33')](_[_0x4fe2('0x3d')](_0x4f72a3[_0x4fe2('0x31')],_0x18a6e5[_0x4fe2('0x33')]));if(_0x4f72a3[_0x4fe2('0x31')]['filter']){_0x44cc9c[_0x4fe2('0x3c')]=_[_0x4fe2('0x3f')](_0x44cc9c[_0x4fe2('0x3c')],{'$or':_['map'](_0x44cc9c[_0x4fe2('0x35')],function(_0x38607a){var _0x39b7bc={};_0x39b7bc[_0x38607a]={'$like':'%'+_0x4f72a3[_0x4fe2('0x31')]['filter']+'%'};return _0x39b7bc;})});}_0x44cc9c=_[_0x4fe2('0x3f')]({},_0x44cc9c,_0x4f72a3['options']);return _0xb21aeb['getAllConditions'](_0x44cc9c);}})[_0x4fe2('0x22')](function(_0x15942a){if(_0x15942a){_0x3d8712=_0x15942a[_0x4fe2('0x37')];if(!_0x4f72a3[_0x4fe2('0x31')][_0x4fe2('0x38')](_0x4fe2('0x39'))){_0x44cc9c[_0x4fe2('0x1e')]=qs['limit'](_0x4f72a3['query'][_0x4fe2('0x1e')]);_0x44cc9c[_0x4fe2('0x1c')]=qs[_0x4fe2('0x1c')](_0x4f72a3[_0x4fe2('0x31')][_0x4fe2('0x1c')]);}return _0xb21aeb[_0x4fe2('0x51')](_0x44cc9c);}})[_0x4fe2('0x22')](function(_0xc627a3){if(_0xc627a3){return _0xc627a3?{'count':_0x3d8712,'rows':_0xc627a3}:null;}})[_0x4fe2('0x22')](respondWithResult(_0x564868,null))[_0x4fe2('0x43')](handleError(_0x564868,null));};exports['getAnyConditions']=function(_0x50673c,_0x1087e9,_0x559ca4){var _0x10f6df={};var _0x48bea3={};var _0x350327;var _0x27cc08;return db[_0x4fe2('0x2c')][_0x4fe2('0x50')]({'where':{'id':_0x50673c[_0x4fe2('0x45')]['id']}})[_0x4fe2('0x22')](handleEntityNotFound(_0x1087e9,null))[_0x4fe2('0x22')](function(_0x23f5e9){if(_0x23f5e9){_0x350327=_0x23f5e9;_0x48bea3[_0x4fe2('0x30')]=_[_0x4fe2('0x32')](db['Condition']['rawAttributes']);_0x48bea3[_0x4fe2('0x31')]=_[_0x4fe2('0x32')](_0x50673c[_0x4fe2('0x31')]);_0x48bea3[_0x4fe2('0x33')]=_[_0x4fe2('0x34')](_0x48bea3[_0x4fe2('0x30')],_0x48bea3['query']);_0x10f6df['attributes']=_[_0x4fe2('0x34')](_0x48bea3[_0x4fe2('0x30')],qs[_0x4fe2('0x36')](_0x50673c[_0x4fe2('0x31')][_0x4fe2('0x36')]));_0x10f6df[_0x4fe2('0x35')]=_0x10f6df[_0x4fe2('0x35')][_0x4fe2('0x37')]?_0x10f6df['attributes']:_0x48bea3[_0x4fe2('0x30')];_0x10f6df['order']=qs[_0x4fe2('0x3b')](_0x50673c[_0x4fe2('0x31')]['sort']);_0x10f6df[_0x4fe2('0x3c')]=qs['filters'](_['pick'](_0x50673c[_0x4fe2('0x31')],_0x48bea3[_0x4fe2('0x33')]));if(_0x50673c['query'][_0x4fe2('0x3e')]){_0x10f6df[_0x4fe2('0x3c')]=_[_0x4fe2('0x3f')](_0x10f6df[_0x4fe2('0x3c')],{'$or':_[_0x4fe2('0x2b')](_0x10f6df[_0x4fe2('0x35')],function(_0x46f14){var _0x28a78f={};_0x28a78f[_0x46f14]={'$like':'%'+_0x50673c['query'][_0x4fe2('0x3e')]+'%'};return _0x28a78f;})});}_0x10f6df=_[_0x4fe2('0x3f')]({},_0x10f6df,_0x50673c['options']);return _0x350327['getAnyConditions'](_0x10f6df);}})[_0x4fe2('0x22')](function(_0x34291c){if(_0x34291c){_0x27cc08=_0x34291c[_0x4fe2('0x37')];if(!_0x50673c[_0x4fe2('0x31')][_0x4fe2('0x38')](_0x4fe2('0x39'))){_0x10f6df[_0x4fe2('0x1e')]=qs[_0x4fe2('0x1e')](_0x50673c[_0x4fe2('0x31')][_0x4fe2('0x1e')]);_0x10f6df[_0x4fe2('0x1c')]=qs[_0x4fe2('0x1c')](_0x50673c[_0x4fe2('0x31')]['offset']);}return _0x350327[_0x4fe2('0x52')](_0x10f6df);}})[_0x4fe2('0x22')](function(_0x5da9ee){if(_0x5da9ee){return _0x5da9ee?{'count':_0x27cc08,'rows':_0x5da9ee}:null;}})[_0x4fe2('0x22')](respondWithResult(_0x1087e9,null))[_0x4fe2('0x43')](handleError(_0x1087e9,null));};exports[_0x4fe2('0x53')]=function(_0x429c52,_0x2323ce,_0x4559e9){if(_0x429c52[_0x4fe2('0x48')]['id']){delete _0x429c52[_0x4fe2('0x48')]['id'];}return db[_0x4fe2('0x2c')][_0x4fe2('0x46')]({'where':{'id':_0x429c52['params']['id']}})[_0x4fe2('0x22')](handleEntityNotFound(_0x2323ce,null))['then'](function(_0x52199a){if(_0x52199a){_0x429c52['body'][_0x4fe2('0x54')]=_0x52199a['id'];return db[_0x4fe2('0x55')][_0x4fe2('0x47')](_0x429c52[_0x4fe2('0x48')]);}})[_0x4fe2('0x22')](respondWithResult(_0x2323ce,null))[_0x4fe2('0x43')](handleError(_0x2323ce,null));};exports[_0x4fe2('0x56')]=function(_0x26a2bd,_0x265199,_0xb799e3){var _0x4f0ae4={};var _0x3cc090={};var _0x1b5997;var _0x223b4d;return db['Trigger'][_0x4fe2('0x50')]({'where':{'id':_0x26a2bd[_0x4fe2('0x45')]['id']}})[_0x4fe2('0x22')](handleEntityNotFound(_0x265199,null))[_0x4fe2('0x22')](function(_0x1a9d92){if(_0x1a9d92){_0x1b5997=_0x1a9d92;_0x3cc090['model']=_[_0x4fe2('0x32')](db[_0x4fe2('0x55')][_0x4fe2('0x2d')]);_0x3cc090[_0x4fe2('0x31')]=_[_0x4fe2('0x32')](_0x26a2bd['query']);_0x3cc090[_0x4fe2('0x33')]=_[_0x4fe2('0x34')](_0x3cc090['model'],_0x3cc090['query']);_0x4f0ae4[_0x4fe2('0x35')]=_[_0x4fe2('0x34')](_0x3cc090[_0x4fe2('0x30')],qs[_0x4fe2('0x36')](_0x26a2bd['query'][_0x4fe2('0x36')]));_0x4f0ae4[_0x4fe2('0x35')]=_0x4f0ae4['attributes'][_0x4fe2('0x37')]?_0x4f0ae4[_0x4fe2('0x35')]:_0x3cc090[_0x4fe2('0x30')];_0x4f0ae4[_0x4fe2('0x3a')]=qs[_0x4fe2('0x3b')](_0x26a2bd[_0x4fe2('0x31')]['sort']);_0x4f0ae4['where']=qs[_0x4fe2('0x33')](_[_0x4fe2('0x3d')](_0x26a2bd[_0x4fe2('0x31')],_0x3cc090[_0x4fe2('0x33')]));if(_0x26a2bd[_0x4fe2('0x31')]['filter']){_0x4f0ae4[_0x4fe2('0x3c')]=_['merge'](_0x4f0ae4['where'],{'$or':_[_0x4fe2('0x2b')](_0x4f0ae4[_0x4fe2('0x35')],function(_0x449a2a){var _0x53a51f={};_0x53a51f[_0x449a2a]={'$like':'%'+_0x26a2bd['query'][_0x4fe2('0x3e')]+'%'};return _0x53a51f;})});}_0x4f0ae4=_[_0x4fe2('0x3f')]({},_0x4f0ae4,_0x26a2bd[_0x4fe2('0x40')]);return _0x1b5997['getActions'](_0x4f0ae4);}})[_0x4fe2('0x22')](function(_0x116721){if(_0x116721){_0x223b4d=_0x116721['length'];if(!_0x26a2bd[_0x4fe2('0x31')][_0x4fe2('0x38')](_0x4fe2('0x39'))){_0x4f0ae4[_0x4fe2('0x1e')]=qs[_0x4fe2('0x1e')](_0x26a2bd[_0x4fe2('0x31')]['limit']);_0x4f0ae4[_0x4fe2('0x1c')]=qs[_0x4fe2('0x1c')](_0x26a2bd[_0x4fe2('0x31')]['offset']);}return _0x1b5997[_0x4fe2('0x56')](_0x4f0ae4);}})[_0x4fe2('0x22')](function(_0x4e97e7){if(_0x4e97e7){return _0x4e97e7?{'count':_0x223b4d,'rows':_0x4e97e7}:null;}})[_0x4fe2('0x22')](respondWithResult(_0x265199,null))[_0x4fe2('0x43')](handleError(_0x265199,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 4eb6a1b..20089a3 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 _0xa4ba=['../../config/logger','api','moment','request-promise','../../config/environment','./trigger.attributes','exports','define','tools_triggers','util'];(function(_0x3e9003,_0x4ed882){var _0x172c0a=function(_0x314224){while(--_0x314224){_0x3e9003['push'](_0x3e9003['shift']());}};_0x172c0a(++_0x4ed882);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xa4ba[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var moment=require(_0xaa4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa4b('0x5'));var attributes=require(_0xaa4b('0x6'));module[_0xaa4b('0x7')]=function(_0x146035,_0x4809a9){return _0x146035[_0xaa4b('0x8')]('Trigger',attributes,{'tableName':_0xaa4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b04=['./trigger.attributes','exports','define','tools_triggers','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x575313,_0x332159){var _0x44d907=function(_0x35d921){while(--_0x35d921){_0x575313['push'](_0x575313['shift']());}};_0x44d907(++_0x332159);}(_0x8b04,0x130));var _0x48b0=function(_0x295fff,_0x507dcc){_0x295fff=_0x295fff-0x0;var _0x247843=_0x8b04[_0x295fff];return _0x247843;};'use strict';var _=require(_0x48b0('0x0'));var util=require(_0x48b0('0x1'));var logger=require('../../config/logger')(_0x48b0('0x2'));var moment=require('moment');var BPromise=require(_0x48b0('0x3'));var rp=require(_0x48b0('0x4'));var fs=require('fs');var path=require(_0x48b0('0x5'));var rimraf=require(_0x48b0('0x6'));var config=require(_0x48b0('0x7'));var attributes=require(_0x48b0('0x8'));module[_0x48b0('0x9')]=function(_0x43e21c,_0x357849){return _0x43e21c[_0x48b0('0xa')]('Trigger',attributes,{'tableName':_0x48b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index f39d36b..4e28720 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 _0x9c94=['Trigger','findAll','options','where','attributes','limit','include','model','map','debug','find','raw','ShowTrigger','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrigger'];(function(_0x3c9737,_0x560d1b){var _0x599c42=function(_0x3bde00){while(--_0x3bde00){_0x3c9737['push'](_0x3c9737['shift']());}};_0x599c42(++_0x560d1b);}(_0x9c94,0x99));var _0x49c9=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x9c94[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require(_0x49c9('0x0'));var util=require(_0x49c9('0x1'));var moment=require('moment');var BPromise=require(_0x49c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49c9('0x3'));var db=require(_0x49c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x49c9('0x5'))(_0x49c9('0x6'));var config=require(_0x49c9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x49c9('0x8')][_0x49c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d3e26,_0x50f3fb,_0x47758a){return new BPromise(function(_0x1cf938,_0x3eb9bf){return client[_0x49c9('0xa')](_0x7d3e26,_0x47758a)[_0x49c9('0xb')](function(_0x359ec1){logger[_0x49c9('0xc')](_0x49c9('0xd'),_0x50f3fb,_0x49c9('0xe'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x50f3fb,_0x49c9('0xe'),JSON[_0x49c9('0xf')](_0x359ec1));if(_0x359ec1[_0x49c9('0x10')]){if(_0x359ec1[_0x49c9('0x10')][_0x49c9('0x11')]===0x1f4){logger['error'](_0x49c9('0xd'),_0x50f3fb,_0x359ec1[_0x49c9('0x10')][_0x49c9('0x12')]);return _0x3eb9bf(_0x359ec1[_0x49c9('0x10')]['message']);}logger[_0x49c9('0x10')](_0x49c9('0xd'),_0x50f3fb,_0x359ec1[_0x49c9('0x10')][_0x49c9('0x12')]);return _0x1cf938(_0x359ec1['error']['message']);}else{logger['info'](_0x49c9('0xd'),_0x50f3fb,'request\x20sent');_0x1cf938(_0x359ec1[_0x49c9('0x13')][_0x49c9('0x12')]);}})[_0x49c9('0x14')](function(_0x10e5d0){logger[_0x49c9('0x10')](_0x49c9('0xd'),_0x50f3fb,_0x10e5d0);_0x3eb9bf(_0x10e5d0);});});}exports[_0x49c9('0x15')]=function(_0x5be9c5){var _0x538c56=this;return new Promise(function(_0x45a5dc,_0x1556d8){return db[_0x49c9('0x16')][_0x49c9('0x17')]({'raw':_0x5be9c5[_0x49c9('0x18')]?_0x5be9c5[_0x49c9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5be9c5[_0x49c9('0x18')]?_0x5be9c5[_0x49c9('0x18')][_0x49c9('0x19')]||null:null,'attributes':_0x5be9c5['options']?_0x5be9c5[_0x49c9('0x18')][_0x49c9('0x1a')]||null:null,'limit':_0x5be9c5[_0x49c9('0x18')]?_0x5be9c5[_0x49c9('0x18')][_0x49c9('0x1b')]||null:null,'include':_0x5be9c5[_0x49c9('0x18')]?_0x5be9c5[_0x49c9('0x18')][_0x49c9('0x1c')]?_['map'](_0x5be9c5[_0x49c9('0x18')]['include'],function(_0x2bf5da){return{'model':db[_0x2bf5da[_0x49c9('0x1d')]],'as':_0x2bf5da['as'],'attributes':_0x2bf5da[_0x49c9('0x1a')],'include':_0x2bf5da[_0x49c9('0x1c')]?_[_0x49c9('0x1e')](_0x2bf5da[_0x49c9('0x1c')],function(_0x57fdc5){return{'model':db[_0x57fdc5[_0x49c9('0x1d')]],'as':_0x57fdc5['as'],'attributes':_0x57fdc5[_0x49c9('0x1a')],'include':_0x57fdc5[_0x49c9('0x1c')]?_[_0x49c9('0x1e')](_0x57fdc5[_0x49c9('0x1c')],function(_0x2bcd54){return{'model':db[_0x2bcd54[_0x49c9('0x1d')]],'as':_0x2bcd54['as'],'attributes':_0x2bcd54[_0x49c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x49c9('0xb')](function(_0x9fe7b0){logger[_0x49c9('0xc')](_0x49c9('0x15'),_0x5be9c5);logger[_0x49c9('0x1f')](_0x49c9('0x15'),_0x5be9c5,JSON['stringify'](_0x9fe7b0));_0x45a5dc(_0x9fe7b0);})[_0x49c9('0x14')](function(_0x4c7840){logger['error'](_0x49c9('0x15'),_0x4c7840[_0x49c9('0x12')],_0x5be9c5);_0x1556d8(_0x538c56[_0x49c9('0x10')](0x1f4,_0x4c7840[_0x49c9('0x12')]));});});};exports['ShowTrigger']=function(_0x2ba9a6){var _0x53c7e2=this;return new Promise(function(_0xba9481,_0x2d20da){return db['Trigger'][_0x49c9('0x20')]({'raw':_0x2ba9a6[_0x49c9('0x18')]?_0x2ba9a6[_0x49c9('0x18')][_0x49c9('0x21')]===undefined?!![]:![]:!![],'where':_0x2ba9a6[_0x49c9('0x18')]?_0x2ba9a6[_0x49c9('0x18')][_0x49c9('0x19')]||null:null,'attributes':_0x2ba9a6['options']?_0x2ba9a6[_0x49c9('0x18')][_0x49c9('0x1a')]||null:null,'include':_0x2ba9a6[_0x49c9('0x18')]?_0x2ba9a6[_0x49c9('0x18')]['include']?_[_0x49c9('0x1e')](_0x2ba9a6[_0x49c9('0x18')][_0x49c9('0x1c')],function(_0x23e13a){return{'model':db[_0x23e13a['model']],'as':_0x23e13a['as'],'attributes':_0x23e13a['attributes'],'include':_0x23e13a['include']?_['map'](_0x23e13a[_0x49c9('0x1c')],function(_0x41b650){return{'model':db[_0x41b650['model']],'as':_0x41b650['as'],'attributes':_0x41b650['attributes'],'include':_0x41b650['include']?_[_0x49c9('0x1e')](_0x41b650['include'],function(_0x17fb51){return{'model':db[_0x17fb51['model']],'as':_0x17fb51['as'],'attributes':_0x17fb51['attributes']};}):[]};}):[]};}):[]:[]})[_0x49c9('0xb')](function(_0x4348f5){logger['info'](_0x49c9('0x22'),_0x2ba9a6);logger[_0x49c9('0x1f')]('ShowTrigger',_0x2ba9a6,JSON[_0x49c9('0xf')](_0x4348f5));_0xba9481(_0x4348f5);})['catch'](function(_0xa6da0c){logger[_0x49c9('0x10')]('ShowTrigger',_0xa6da0c[_0x49c9('0x12')],_0x2ba9a6);_0x2d20da(_0x53c7e2[_0x49c9('0x10')](0x1f4,_0xa6da0c[_0x49c9('0x12')]));});});}; \ No newline at end of file +var _0x3a75=['options','raw','where','limit','include','map','model','attributes','debug','find','ShowTrigger','lodash','util','moment','ioredis','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','findAll'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x3a75,0xe4));var _0x53a7=function(_0x58518c,_0x246ed6){_0x58518c=_0x58518c-0x0;var _0x4192c8=_0x3a75[_0x58518c];return _0x4192c8;};'use strict';var _=require(_0x53a7('0x0'));var util=require(_0x53a7('0x1'));var moment=require(_0x53a7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53a7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x53a7('0x4'));var config=require(_0x53a7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x53a7('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d76f,_0x9659be,_0x8b32de){return new BPromise(function(_0x3f7ea8,_0x5dd2cb){return client[_0x53a7('0x7')](_0x53d76f,_0x8b32de)[_0x53a7('0x8')](function(_0x577156){logger[_0x53a7('0x9')]('Trigger,\x20%s,\x20%s',_0x9659be,_0x53a7('0xa'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x9659be,_0x53a7('0xa'),JSON[_0x53a7('0xb')](_0x577156));if(_0x577156[_0x53a7('0xc')]){if(_0x577156[_0x53a7('0xc')][_0x53a7('0xd')]===0x1f4){logger['error'](_0x53a7('0xe'),_0x9659be,_0x577156[_0x53a7('0xc')][_0x53a7('0xf')]);return _0x5dd2cb(_0x577156['error'][_0x53a7('0xf')]);}logger[_0x53a7('0xc')](_0x53a7('0xe'),_0x9659be,_0x577156['error'][_0x53a7('0xf')]);return _0x3f7ea8(_0x577156[_0x53a7('0xc')][_0x53a7('0xf')]);}else{logger[_0x53a7('0x9')](_0x53a7('0xe'),_0x9659be,_0x53a7('0xa'));_0x3f7ea8(_0x577156[_0x53a7('0x10')][_0x53a7('0xf')]);}})[_0x53a7('0x11')](function(_0x35b3c0){logger[_0x53a7('0xc')]('Trigger,\x20%s,\x20%s',_0x9659be,_0x35b3c0);_0x5dd2cb(_0x35b3c0);});});}exports[_0x53a7('0x12')]=function(_0x337a64){var _0x5cf3f1=this;return new Promise(function(_0x29cd73,_0x331aa7){return db['Trigger'][_0x53a7('0x13')]({'raw':_0x337a64[_0x53a7('0x14')]?_0x337a64[_0x53a7('0x14')][_0x53a7('0x15')]===undefined?!![]:![]:!![],'where':_0x337a64[_0x53a7('0x14')]?_0x337a64['options'][_0x53a7('0x16')]||null:null,'attributes':_0x337a64[_0x53a7('0x14')]?_0x337a64[_0x53a7('0x14')]['attributes']||null:null,'limit':_0x337a64[_0x53a7('0x14')]?_0x337a64[_0x53a7('0x14')][_0x53a7('0x17')]||null:null,'include':_0x337a64[_0x53a7('0x14')]?_0x337a64[_0x53a7('0x14')][_0x53a7('0x18')]?_[_0x53a7('0x19')](_0x337a64[_0x53a7('0x14')]['include'],function(_0x837eb1){return{'model':db[_0x837eb1[_0x53a7('0x1a')]],'as':_0x837eb1['as'],'attributes':_0x837eb1[_0x53a7('0x1b')],'include':_0x837eb1['include']?_[_0x53a7('0x19')](_0x837eb1['include'],function(_0x143474){return{'model':db[_0x143474[_0x53a7('0x1a')]],'as':_0x143474['as'],'attributes':_0x143474[_0x53a7('0x1b')],'include':_0x143474[_0x53a7('0x18')]?_['map'](_0x143474[_0x53a7('0x18')],function(_0x5c4e58){return{'model':db[_0x5c4e58[_0x53a7('0x1a')]],'as':_0x5c4e58['as'],'attributes':_0x5c4e58[_0x53a7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x516611){logger['info'](_0x53a7('0x12'),_0x337a64);logger[_0x53a7('0x1c')](_0x53a7('0x12'),_0x337a64,JSON['stringify'](_0x516611));_0x29cd73(_0x516611);})['catch'](function(_0x458b52){logger[_0x53a7('0xc')](_0x53a7('0x12'),_0x458b52[_0x53a7('0xf')],_0x337a64);_0x331aa7(_0x5cf3f1[_0x53a7('0xc')](0x1f4,_0x458b52[_0x53a7('0xf')]));});});};exports['ShowTrigger']=function(_0x11eac5){var _0x49cf64=this;return new Promise(function(_0x87f552,_0x375fa2){return db['Trigger'][_0x53a7('0x1d')]({'raw':_0x11eac5[_0x53a7('0x14')]?_0x11eac5['options'][_0x53a7('0x15')]===undefined?!![]:![]:!![],'where':_0x11eac5[_0x53a7('0x14')]?_0x11eac5[_0x53a7('0x14')]['where']||null:null,'attributes':_0x11eac5[_0x53a7('0x14')]?_0x11eac5['options'][_0x53a7('0x1b')]||null:null,'include':_0x11eac5[_0x53a7('0x14')]?_0x11eac5[_0x53a7('0x14')][_0x53a7('0x18')]?_[_0x53a7('0x19')](_0x11eac5[_0x53a7('0x14')][_0x53a7('0x18')],function(_0x2e9bc7){return{'model':db[_0x2e9bc7[_0x53a7('0x1a')]],'as':_0x2e9bc7['as'],'attributes':_0x2e9bc7[_0x53a7('0x1b')],'include':_0x2e9bc7['include']?_[_0x53a7('0x19')](_0x2e9bc7[_0x53a7('0x18')],function(_0x490881){return{'model':db[_0x490881[_0x53a7('0x1a')]],'as':_0x490881['as'],'attributes':_0x490881[_0x53a7('0x1b')],'include':_0x490881[_0x53a7('0x18')]?_[_0x53a7('0x19')](_0x490881[_0x53a7('0x18')],function(_0x89a1fc){return{'model':db[_0x89a1fc[_0x53a7('0x1a')]],'as':_0x89a1fc['as'],'attributes':_0x89a1fc[_0x53a7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x53a7('0x8')](function(_0x3feb98){logger['info']('ShowTrigger',_0x11eac5);logger[_0x53a7('0x1c')]('ShowTrigger',_0x11eac5,JSON[_0x53a7('0xb')](_0x3feb98));_0x87f552(_0x3feb98);})['catch'](function(_0x19dfae){logger[_0x53a7('0xc')](_0x53a7('0x1e'),_0x19dfae['message'],_0x11eac5);_0x375fa2(_0x49cf64['error'](0x1f4,_0x19dfae[_0x53a7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 184d1de..51f5ce6 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 _0xca01=['Router','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4e0482,_0x13e7f2){var _0xfc3bcb=function(_0x55007b){while(--_0x55007b){_0x4e0482['push'](_0x4e0482['shift']());}};_0xfc3bcb(++_0x13e7f2);}(_0xca01,0xed));var _0x1ca0=function(_0x670bdc,_0x56adc1){_0x670bdc=_0x670bdc-0x0;var _0x3a5cb6=_0xca01[_0x670bdc];return _0x3a5cb6;};'use strict';var multer=require(_0x1ca0('0x0'));var util=require('util');var path=require(_0x1ca0('0x1'));var timeout=require(_0x1ca0('0x2'));var express=require('express');var router=express[_0x1ca0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1ca0('0x4'));var interaction=require(_0x1ca0('0x5'));var config=require('../../config/environment');var controller=require(_0x1ca0('0x6'));router[_0x1ca0('0x7')]('/',auth[_0x1ca0('0x8')](),controller['index']);router[_0x1ca0('0x7')](_0x1ca0('0x9'),auth['isAuthenticated'](),controller[_0x1ca0('0xa')]);router[_0x1ca0('0xb')]('/:id/clone',auth[_0x1ca0('0x8')](),controller['clone']);router[_0x1ca0('0xb')]('/',auth[_0x1ca0('0x8')](),controller['create']);router[_0x1ca0('0xc')](_0x1ca0('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x1ca0('0xd')](_0x1ca0('0x9'),auth[_0x1ca0('0x8')](),controller[_0x1ca0('0xe')]);module[_0x1ca0('0xf')]=router; \ No newline at end of file +var _0x4797=['update','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','clone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4797,0x1c5));var _0x7479=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4797[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x7479('0x0'));var path=require(_0x7479('0x1'));var timeout=require(_0x7479('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7479('0x3'));var auth=require(_0x7479('0x4'));var interaction=require(_0x7479('0x5'));var config=require(_0x7479('0x6'));var controller=require(_0x7479('0x7'));router[_0x7479('0x8')]('/',auth[_0x7479('0x9')](),controller['index']);router[_0x7479('0x8')](_0x7479('0xa'),auth[_0x7479('0x9')](),controller[_0x7479('0xb')]);router[_0x7479('0xc')](_0x7479('0xd'),auth['isAuthenticated'](),controller[_0x7479('0xe')]);router[_0x7479('0xc')]('/',auth[_0x7479('0x9')](),controller['create']);router['put'](_0x7479('0xa'),auth[_0x7479('0x9')](),controller[_0x7479('0xf')]);router['delete'](_0x7479('0xa'),auth[_0x7479('0x9')](),controller[_0x7479('0x10')]);module[_0x7479('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index e93189d..b0c5bcd 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 _0xb474=['STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','INTEGER','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update','BOOLEAN','exports'];(function(_0x42ab3f,_0x2fdccc){var _0x471b91=function(_0x30139d){while(--_0x30139d){_0x42ab3f['push'](_0x42ab3f['shift']());}};_0x471b91(++_0x2fdccc);}(_0xb474,0x18f));var _0x4b47=function(_0x3739e5,_0x50a4cd){_0x3739e5=_0x3739e5-0x0;var _0x1a1adc=_0xb474[_0x3739e5];return _0x1a1adc;};'use strict';var Sequelize=require('sequelize');module[_0x4b47('0x0')]={'name':{'type':Sequelize[_0x4b47('0x1')],'allowNull':![],'unique':_0x4b47('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x4'),_0x4b47('0x5'),_0x4b47('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4b47('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x4b47('0x8'),_0x4b47('0x9'),'ALLOWED_FAILED_SCREEN',_0x4b47('0xa'),'PROHIB_NOT_SCREENED',_0x4b47('0xb'),_0x4b47('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0x4b47('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x4b47('0x1')]},'md5secret':{'type':Sequelize[_0x4b47('0x1')]},'remotesecret':{'type':Sequelize[_0x4b47('0x1')]},'transport':{'type':Sequelize[_0x4b47('0x1')],'defaultValue':_0x4b47('0xd'),'set':function(_0x5a382f){this[_0x4b47('0xe')]('transport',_0x5a382f?_0x5a382f[_0x4b47('0xf')](','):null);},'get':function(){return this[_0x4b47('0x10')](_0x4b47('0x11'))?this[_0x4b47('0x10')](_0x4b47('0x11'))[_0x4b47('0x12')](','):null;},'comment':_0x4b47('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x4b47('0x14'),'info',_0x4b47('0x15'),_0x4b47('0x16'),_0x4b47('0x17')),'defaultValue':_0x4b47('0x14')},'directmedia':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4b47('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4b47('0x1')]},'directmediadeny':{'type':Sequelize[_0x4b47('0x1')]},'nat':{'type':Sequelize[_0x4b47('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x4c77cf){this[_0x4b47('0xe')](_0x4b47('0x19'),_0x4c77cf?_0x4c77cf['join'](','):null);},'get':function(){return this['getDataValue'](_0x4b47('0x19'))?this[_0x4b47('0x10')](_0x4b47('0x19'))[_0x4b47('0x12')](','):null;},'comment':_0x4b47('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x4b47('0x1')]},'pickupgroup':{'type':Sequelize[_0x4b47('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x4b47('0x1')]},'language':{'type':Sequelize[_0x4b47('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4b47('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4b47('0x1')],'defaultValue':_0x4b47('0x1b')},'allow':{'type':Sequelize[_0x4b47('0x1')],'allowNull':![],'defaultValue':_0x4b47('0x1c'),'set':function(_0x4e710d){this[_0x4b47('0xe')](_0x4b47('0x1d'),_0x4e710d?_0x4e710d[_0x4b47('0xf')](';'):_0x4b47('0x1c'));},'get':function(){return this['getDataValue']('allow')?this[_0x4b47('0x10')](_0x4b47('0x1d'))[_0x4b47('0x12')](';'):null;},'comment':_0x4b47('0x1e')},'autoframing':{'type':Sequelize[_0x4b47('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x4b47('0x1')],'defaultValue':'port,invite','set':function(_0x17d739){this[_0x4b47('0xe')](_0x4b47('0x1f'),_0x17d739?_0x17d739['join'](','):null);},'get':function(){return this['getDataValue'](_0x4b47('0x1f'))?this[_0x4b47('0x10')](_0x4b47('0x1f'))['split'](','):null;},'comment':_0x4b47('0x20')},'trustrpid':{'type':Sequelize['ENUM'](_0x4b47('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4b47('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no',_0x4b47('0x21'))},'promiscredir':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x4b47('0x1')]},'callerid':{'type':Sequelize[_0x4b47('0x1')],'defaultValue':_0x4b47('0x22')},'amaflags':{'type':Sequelize[_0x4b47('0x1')]},'callcounter':{'type':Sequelize[_0x4b47('0x3')]('yes','no'),'defaultValue':_0x4b47('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x4b47('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x4b47('0x1')]},'template':{'type':Sequelize[_0x4b47('0x1')]},'videosupport':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no',_0x4b47('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'mailbox':{'type':Sequelize[_0x4b47('0x1')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x4b47('0x24'),_0x4b47('0x25'))},'session_expires':{'type':Sequelize[_0x4b47('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x4b47('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x4b47('0x3')]('uac',_0x4b47('0x27')),'defaultValue':_0x4b47('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x4b47('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x4b47('0x1')]},'fromuser':{'type':Sequelize[_0x4b47('0x1')]},'port':{'type':Sequelize[_0x4b47('0x26')](0x5)},'qualify':{'type':Sequelize[_0x4b47('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x4b47('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x4b47('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4b47('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no',_0x4b47('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x4b47('0x26')](0xb)},'timerb':{'type':Sequelize[_0x4b47('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4b47('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x4b47('0x1')]},'contactdeny':{'type':Sequelize[_0x4b47('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x4b47('0x1')]},'use_q850_reason':{'type':Sequelize[_0x4b47('0x1')]},'maxforwards':{'type':Sequelize[_0x4b47('0x26')](0xb)},'encryption':{'type':Sequelize[_0x4b47('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x4b47('0x18'),'no')},'icesupport':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x4b47('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no',_0x4b47('0x29'),_0x4b47('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x4b47('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x4b47('0x1')]},'dtlscafile':{'type':Sequelize[_0x4b47('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x2b'),_0x4b47('0x2c'),_0x4b47('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4b47('0x1')]},'recordofffeature':{'type':Sequelize[_0x4b47('0x1')]},'call_limit':{'type':Sequelize[_0x4b47('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x4b47('0x3')](_0x4b47('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x4b47('0x1')]},'parkinglot':{'type':Sequelize[_0x4b47('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x4b47('0x2e')},'canreinvite':{'type':Sequelize[_0x4b47('0x3')]('yes','no',_0x4b47('0x2f'),_0x4b47('0x30'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x4b47('0x1')]},'active':{'type':Sequelize[_0x4b47('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4b47('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x6593=['shortinfo','inband','auto','rfc2833','yes','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','accept','refuse','uac','uas','pai','fingerprint','active','passive','actpass','update,nonat','BOOLEAN','exports','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info'];(function(_0x4fb306,_0x2c94a4){var _0x3110d6=function(_0xbb4fc1){while(--_0xbb4fc1){_0x4fb306['push'](_0x4fb306['shift']());}};_0x3110d6(++_0x2c94a4);}(_0x6593,0x1c4));var _0x3659=function(_0x7880d2,_0x32e7d6){_0x7880d2=_0x7880d2-0x0;var _0x35ebbe=_0x6593[_0x7880d2];return _0x35ebbe;};'use strict';var Sequelize=require('sequelize');module[_0x3659('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3659('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x3'),'user',_0x3659('0x4')),'allowNull':![],'defaultValue':_0x3659('0x3')},'context':{'type':Sequelize[_0x3659('0x5')],'allowNull':![],'defaultValue':_0x3659('0x6')},'callingpres':{'type':Sequelize[_0x3659('0x2')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x3659('0x7'),'ALLOWED',_0x3659('0x8'),_0x3659('0x9'),_0x3659('0xa'),_0x3659('0xb'))},'deny':{'type':Sequelize[_0x3659('0x5')]},'permit':{'type':Sequelize[_0x3659('0x5')]},'secret':{'type':Sequelize[_0x3659('0x5')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x3659('0x5')]},'transport':{'type':Sequelize[_0x3659('0x5')],'defaultValue':_0x3659('0xc'),'set':function(_0x128548){this[_0x3659('0xd')]('transport',_0x128548?_0x128548['join'](','):null);},'get':function(){return this[_0x3659('0xe')]('transport')?this['getDataValue'](_0x3659('0xf'))['split'](','):null;},'comment':_0x3659('0x10')},'dtmfmode':{'type':Sequelize[_0x3659('0x2')]('rfc2833',_0x3659('0x11'),_0x3659('0x12'),_0x3659('0x13'),_0x3659('0x14')),'defaultValue':_0x3659('0x15')},'directmedia':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no',_0x3659('0x17'),_0x3659('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3659('0x5')]},'directmediadeny':{'type':Sequelize[_0x3659('0x5')]},'nat':{'type':Sequelize[_0x3659('0x5')],'defaultValue':'force_rport,comedia','set':function(_0x5d298e){this[_0x3659('0xd')](_0x3659('0x19'),_0x5d298e?_0x5d298e['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x3659('0xe')](_0x3659('0x19'))['split'](','):null;},'comment':_0x3659('0x1a')},'callgroup':{'type':Sequelize[_0x3659('0x5')]},'namedcallgroup':{'type':Sequelize[_0x3659('0x5')]},'pickupgroup':{'type':Sequelize[_0x3659('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3659('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3659('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3659('0x5')],'defaultValue':_0x3659('0x1b')},'allow':{'type':Sequelize[_0x3659('0x5')],'allowNull':![],'defaultValue':_0x3659('0x1c'),'set':function(_0x5a46f4){this['setDataValue'](_0x3659('0x1d'),_0x5a46f4?_0x5a46f4[_0x3659('0x1e')](';'):_0x3659('0x1c'));},'get':function(){return this[_0x3659('0xe')](_0x3659('0x1d'))?this[_0x3659('0xe')](_0x3659('0x1d'))[_0x3659('0x1f')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x1f9aee){this[_0x3659('0xd')]('insecure',_0x1f9aee?_0x1f9aee[_0x3659('0x1e')](','):null);},'get':function(){return this[_0x3659('0xe')](_0x3659('0x20'))?this['getDataValue'](_0x3659('0x20'))[_0x3659('0x1f')](','):null;},'comment':_0x3659('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0x3659('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x3659('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0x3659('0x2')]('yes','no')},'useclientcode':{'type':Sequelize[_0x3659('0x2')]('yes','no')},'accountcode':{'type':Sequelize[_0x3659('0x22')](0xb)},'setvar':{'type':Sequelize[_0x3659('0x5')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x3659('0x23')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x3659('0x16'),'no'),'defaultValue':_0x3659('0x16')},'busylevel':{'type':Sequelize[_0x3659('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x3659('0x5')]},'template':{'type':Sequelize[_0x3659('0x5')]},'videosupport':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3659('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3659('0x2')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x24'),_0x3659('0x25'),'originate')},'session_expires':{'type':Sequelize[_0x3659('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x3659('0x22')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x3659('0x26'),'uas'),'defaultValue':_0x3659('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x3659('0x5')]},'regexten':{'type':Sequelize[_0x3659('0x5')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x3659('0x5')]},'port':{'type':Sequelize[_0x3659('0x22')](0x5)},'qualify':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no'),'defaultValue':_0x3659('0x16')},'keepalive':{'type':Sequelize[_0x3659('0x22')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x3659('0x5')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3659('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3659('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no',_0x3659('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3659('0x5')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x3659('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3659('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x3659('0x5')]},'contactdeny':{'type':Sequelize[_0x3659('0x5')]},'contactacl':{'type':Sequelize[_0x3659('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x3659('0x5')]},'use_q850_reason':{'type':Sequelize[_0x3659('0x5')]},'maxforwards':{'type':Sequelize[_0x3659('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x3659('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x3659('0x16'),'no')},'force_avp':{'type':Sequelize[_0x3659('0x2')]('yes','no')},'icesupport':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x3659('0x2')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x3659('0x16'),'no',_0x3659('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x3659('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3659('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x3659('0x5')]},'dtlscipher':{'type':Sequelize[_0x3659('0x5')]},'dtlscafile':{'type':Sequelize[_0x3659('0x5')]},'dtlscapath':{'type':Sequelize[_0x3659('0x5')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x3659('0x2a'),_0x3659('0x2b'),_0x3659('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3659('0x5')]},'usereqphone':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x3659('0x5')]},'call_limit':{'type':Sequelize[_0x3659('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3659('0x2')](_0x3659('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x3659('0x2')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x3659('0x5')]},'mohsuggest':{'type':Sequelize[_0x3659('0x5')]},'parkinglot':{'type':Sequelize[_0x3659('0x5')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3659('0x5')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x3659('0x2')]('yes','no',_0x3659('0x17'),_0x3659('0x18'),_0x3659('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x3659('0x5')]},'active':{'type':Sequelize[_0x3659('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3659('0x5')],'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 1bfe763..d3c2369 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 _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0xe5b3,0x133));var _0x3e5b=function(_0x21235e,_0x3b40e3){_0x21235e=_0x21235e-0x0;var _0x479e51=_0xe5b3[_0x21235e];return _0x479e51;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file +var _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x84ab,0x12f));var _0xb84a=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x84ab[_0x21b359];return _0x57b8e7;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index cece1b5..1ca6d8f 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 _0x1799=['request-promise','rimraf','../../config/environment','./trunk.attributes','exports','tools_trunks','moment','bluebird'];(function(_0x43dd9a,_0x1fa3bd){var _0x16ecbd=function(_0x22052b){while(--_0x22052b){_0x43dd9a['push'](_0x43dd9a['shift']());}};_0x16ecbd(++_0x1fa3bd);}(_0x1799,0x186));var _0x9179=function(_0x268068,_0x5effeb){_0x268068=_0x268068-0x0;var _0x344d9b=_0x1799[_0x268068];return _0x344d9b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9179('0x0'));var BPromise=require(_0x9179('0x1'));var rp=require(_0x9179('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9179('0x3'));var config=require(_0x9179('0x4'));var attributes=require(_0x9179('0x5'));module[_0x9179('0x6')]=function(_0x236f23,_0x54b319){return _0x236f23['define']('Trunk',attributes,{'tableName':_0x9179('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52df=['rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger','api','bluebird'];(function(_0x34b6aa,_0x5ddd29){var _0x3ead29=function(_0x53979c){while(--_0x53979c){_0x34b6aa['push'](_0x34b6aa['shift']());}};_0x3ead29(++_0x5ddd29);}(_0x52df,0x13b));var _0xf52d=function(_0x4c797d,_0x4960ac){_0x4c797d=_0x4c797d-0x0;var _0x286e7a=_0x52df[_0x4c797d];return _0x286e7a;};'use strict';var _=require('lodash');var util=require(_0xf52d('0x0'));var logger=require(_0xf52d('0x1'))(_0xf52d('0x2'));var moment=require('moment');var BPromise=require(_0xf52d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf52d('0x4'));var config=require(_0xf52d('0x5'));var attributes=require(_0xf52d('0x6'));module[_0xf52d('0x7')]=function(_0xacf881,_0x2af19c){return _0xacf881[_0xf52d('0x8')](_0xf52d('0x9'),attributes,{'tableName':_0xf52d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index e6aec5e..2ee142c 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 _0x3124=['request\x20sent','error','message','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','then','debug','stringify','ShowTrunk','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Trunk,\x20%s,\x20%s'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x3124,0x15d));var _0x4312=function(_0x4344f6,_0x229389){_0x4344f6=_0x4344f6-0x0;var _0x14d563=_0x3124[_0x4344f6];return _0x14d563;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4312('0x0'));var BPromise=require(_0x4312('0x1'));var rs=require(_0x4312('0x2'));var fs=require('fs');var Redis=require(_0x4312('0x3'));var db=require(_0x4312('0x4'))['db'];var utils=require(_0x4312('0x5'));var logger=require(_0x4312('0x6'))(_0x4312('0x7'));var config=require(_0x4312('0x8'));var jayson=require(_0x4312('0x9'));var client=jayson[_0x4312('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c86b8,_0x14555b,_0x165f48){return new BPromise(function(_0x49ab0f,_0x58e206){return client[_0x4312('0xb')](_0x3c86b8,_0x165f48)['then'](function(_0x2609eb){logger[_0x4312('0xc')](_0x4312('0xd'),_0x14555b,_0x4312('0xe'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x14555b,'request\x20sent',JSON['stringify'](_0x2609eb));if(_0x2609eb['error']){if(_0x2609eb[_0x4312('0xf')]['code']===0x1f4){logger[_0x4312('0xf')](_0x4312('0xd'),_0x14555b,_0x2609eb[_0x4312('0xf')][_0x4312('0x10')]);return _0x58e206(_0x2609eb[_0x4312('0xf')][_0x4312('0x10')]);}logger[_0x4312('0xf')](_0x4312('0xd'),_0x14555b,_0x2609eb['error']['message']);return _0x49ab0f(_0x2609eb['error'][_0x4312('0x10')]);}else{logger['info'](_0x4312('0xd'),_0x14555b,'request\x20sent');_0x49ab0f(_0x2609eb['result'][_0x4312('0x10')]);}})[_0x4312('0x11')](function(_0x5a4886){logger['error'](_0x4312('0xd'),_0x14555b,_0x5a4886);_0x58e206(_0x5a4886);});});}exports[_0x4312('0x12')]=function(_0x43fada){var _0x36d72f=this;return new Promise(function(_0x22292b,_0x140413){return db[_0x4312('0x13')][_0x4312('0x14')]({'raw':_0x43fada['options']?_0x43fada[_0x4312('0x15')][_0x4312('0x16')]===undefined?!![]:![]:!![],'where':_0x43fada[_0x4312('0x15')]?_0x43fada['options'][_0x4312('0x17')]||null:null,'attributes':_0x43fada[_0x4312('0x15')]?_0x43fada['options'][_0x4312('0x18')]||null:null,'limit':_0x43fada[_0x4312('0x15')]?_0x43fada[_0x4312('0x15')]['limit']||null:null,'include':_0x43fada['options']?_0x43fada['options'][_0x4312('0x19')]?_[_0x4312('0x1a')](_0x43fada[_0x4312('0x15')][_0x4312('0x19')],function(_0x9817e1){return{'model':db[_0x9817e1[_0x4312('0x1b')]],'as':_0x9817e1['as'],'attributes':_0x9817e1[_0x4312('0x18')],'include':_0x9817e1['include']?_['map'](_0x9817e1[_0x4312('0x19')],function(_0x21314f){return{'model':db[_0x21314f[_0x4312('0x1b')]],'as':_0x21314f['as'],'attributes':_0x21314f[_0x4312('0x18')],'include':_0x21314f[_0x4312('0x19')]?_[_0x4312('0x1a')](_0x21314f[_0x4312('0x19')],function(_0x118554){return{'model':db[_0x118554[_0x4312('0x1b')]],'as':_0x118554['as'],'attributes':_0x118554['attributes']};}):[]};}):[]};}):[]:[]})[_0x4312('0x1c')](function(_0x12a829){logger['info']('GetTrunk',_0x43fada);logger[_0x4312('0x1d')](_0x4312('0x12'),_0x43fada,JSON[_0x4312('0x1e')](_0x12a829));_0x22292b(_0x12a829);})[_0x4312('0x11')](function(_0x5f2319){logger[_0x4312('0xf')](_0x4312('0x12'),_0x5f2319['message'],_0x43fada);_0x140413(_0x36d72f['error'](0x1f4,_0x5f2319[_0x4312('0x10')]));});});};exports[_0x4312('0x1f')]=function(_0x591f06){var _0x5ba289=this;return new Promise(function(_0x56a705,_0x4f2162){return db[_0x4312('0x13')][_0x4312('0x20')]({'raw':_0x591f06[_0x4312('0x15')]?_0x591f06[_0x4312('0x15')][_0x4312('0x16')]===undefined?!![]:![]:!![],'where':_0x591f06[_0x4312('0x15')]?_0x591f06[_0x4312('0x15')][_0x4312('0x17')]||null:null,'attributes':_0x591f06['options']?_0x591f06[_0x4312('0x15')]['attributes']||null:null,'include':_0x591f06[_0x4312('0x15')]?_0x591f06[_0x4312('0x15')][_0x4312('0x19')]?_[_0x4312('0x1a')](_0x591f06['options']['include'],function(_0x5e85b7){return{'model':db[_0x5e85b7['model']],'as':_0x5e85b7['as'],'attributes':_0x5e85b7[_0x4312('0x18')],'include':_0x5e85b7[_0x4312('0x19')]?_[_0x4312('0x1a')](_0x5e85b7[_0x4312('0x19')],function(_0x29be53){return{'model':db[_0x29be53[_0x4312('0x1b')]],'as':_0x29be53['as'],'attributes':_0x29be53[_0x4312('0x18')],'include':_0x29be53['include']?_[_0x4312('0x1a')](_0x29be53[_0x4312('0x19')],function(_0x44dd91){return{'model':db[_0x44dd91[_0x4312('0x1b')]],'as':_0x44dd91['as'],'attributes':_0x44dd91['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57c192){logger[_0x4312('0xc')](_0x4312('0x1f'),_0x591f06);logger[_0x4312('0x1d')](_0x4312('0x1f'),_0x591f06,JSON[_0x4312('0x1e')](_0x57c192));_0x56a705(_0x57c192);})['catch'](function(_0x8dc5f1){logger[_0x4312('0xf')](_0x4312('0x1f'),_0x8dc5f1[_0x4312('0x10')],_0x591f06);_0x4f2162(_0x5ba289['error'](0x1f4,_0x8dc5f1[_0x4312('0x10')]));});});}; \ No newline at end of file +var _0x11b8=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Trunk','options','raw','where','attributes','limit','map','include','model','then','debug','GetTrunk','ShowTrunk','find','catch','lodash','util'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0x11b8,0x142));var _0x811b=function(_0x421021,_0xf42b18){_0x421021=_0x421021-0x0;var _0x1b9d18=_0x11b8[_0x421021];return _0x1b9d18;};'use strict';var _=require(_0x811b('0x0'));var util=require(_0x811b('0x1'));var moment=require('moment');var BPromise=require(_0x811b('0x2'));var rs=require(_0x811b('0x3'));var fs=require('fs');var Redis=require(_0x811b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x811b('0x5'));var logger=require(_0x811b('0x6'))(_0x811b('0x7'));var config=require(_0x811b('0x8'));var jayson=require(_0x811b('0x9'));var client=jayson[_0x811b('0xa')][_0x811b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x412d2d,_0x1dc0d7,_0x196b78){return new BPromise(function(_0x1b7d1b,_0x214ce9){return client[_0x811b('0xc')](_0x412d2d,_0x196b78)['then'](function(_0x53f2cc){logger[_0x811b('0xd')](_0x811b('0xe'),_0x1dc0d7,_0x811b('0xf'));logger['debug'](_0x811b('0x10'),_0x1dc0d7,_0x811b('0xf'),JSON[_0x811b('0x11')](_0x53f2cc));if(_0x53f2cc[_0x811b('0x12')]){if(_0x53f2cc[_0x811b('0x12')]['code']===0x1f4){logger[_0x811b('0x12')]('Trunk,\x20%s,\x20%s',_0x1dc0d7,_0x53f2cc[_0x811b('0x12')][_0x811b('0x13')]);return _0x214ce9(_0x53f2cc[_0x811b('0x12')]['message']);}logger[_0x811b('0x12')](_0x811b('0xe'),_0x1dc0d7,_0x53f2cc['error'][_0x811b('0x13')]);return _0x1b7d1b(_0x53f2cc['error'][_0x811b('0x13')]);}else{logger[_0x811b('0xd')](_0x811b('0xe'),_0x1dc0d7,'request\x20sent');_0x1b7d1b(_0x53f2cc[_0x811b('0x14')]['message']);}})['catch'](function(_0x17498){logger[_0x811b('0x12')]('Trunk,\x20%s,\x20%s',_0x1dc0d7,_0x17498);_0x214ce9(_0x17498);});});}exports['GetTrunk']=function(_0x4958ec){var _0x99f60c=this;return new Promise(function(_0x77b274,_0x566e24){return db[_0x811b('0x15')]['findAll']({'raw':_0x4958ec[_0x811b('0x16')]?_0x4958ec[_0x811b('0x16')][_0x811b('0x17')]===undefined?!![]:![]:!![],'where':_0x4958ec[_0x811b('0x16')]?_0x4958ec[_0x811b('0x16')][_0x811b('0x18')]||null:null,'attributes':_0x4958ec[_0x811b('0x16')]?_0x4958ec[_0x811b('0x16')][_0x811b('0x19')]||null:null,'limit':_0x4958ec[_0x811b('0x16')]?_0x4958ec[_0x811b('0x16')][_0x811b('0x1a')]||null:null,'include':_0x4958ec[_0x811b('0x16')]?_0x4958ec['options']['include']?_[_0x811b('0x1b')](_0x4958ec['options'][_0x811b('0x1c')],function(_0x450353){return{'model':db[_0x450353['model']],'as':_0x450353['as'],'attributes':_0x450353['attributes'],'include':_0x450353['include']?_['map'](_0x450353['include'],function(_0x644ecf){return{'model':db[_0x644ecf[_0x811b('0x1d')]],'as':_0x644ecf['as'],'attributes':_0x644ecf[_0x811b('0x19')],'include':_0x644ecf['include']?_[_0x811b('0x1b')](_0x644ecf[_0x811b('0x1c')],function(_0x270a89){return{'model':db[_0x270a89[_0x811b('0x1d')]],'as':_0x270a89['as'],'attributes':_0x270a89[_0x811b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x811b('0x1e')](function(_0x1adb4c){logger[_0x811b('0xd')]('GetTrunk',_0x4958ec);logger[_0x811b('0x1f')](_0x811b('0x20'),_0x4958ec,JSON[_0x811b('0x11')](_0x1adb4c));_0x77b274(_0x1adb4c);})['catch'](function(_0x1f551b){logger['error'](_0x811b('0x20'),_0x1f551b[_0x811b('0x13')],_0x4958ec);_0x566e24(_0x99f60c[_0x811b('0x12')](0x1f4,_0x1f551b[_0x811b('0x13')]));});});};exports[_0x811b('0x21')]=function(_0x2fc7c0){var _0x43506e=this;return new Promise(function(_0xbf9f7b,_0x2ff20f){return db['Trunk'][_0x811b('0x22')]({'raw':_0x2fc7c0[_0x811b('0x16')]?_0x2fc7c0[_0x811b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2fc7c0[_0x811b('0x16')]?_0x2fc7c0['options'][_0x811b('0x18')]||null:null,'attributes':_0x2fc7c0[_0x811b('0x16')]?_0x2fc7c0[_0x811b('0x16')][_0x811b('0x19')]||null:null,'include':_0x2fc7c0[_0x811b('0x16')]?_0x2fc7c0[_0x811b('0x16')][_0x811b('0x1c')]?_[_0x811b('0x1b')](_0x2fc7c0[_0x811b('0x16')][_0x811b('0x1c')],function(_0x37156b){return{'model':db[_0x37156b[_0x811b('0x1d')]],'as':_0x37156b['as'],'attributes':_0x37156b[_0x811b('0x19')],'include':_0x37156b[_0x811b('0x1c')]?_[_0x811b('0x1b')](_0x37156b['include'],function(_0x536c26){return{'model':db[_0x536c26[_0x811b('0x1d')]],'as':_0x536c26['as'],'attributes':_0x536c26[_0x811b('0x19')],'include':_0x536c26[_0x811b('0x1c')]?_[_0x811b('0x1b')](_0x536c26[_0x811b('0x1c')],function(_0x2d520f){return{'model':db[_0x2d520f['model']],'as':_0x2d520f['as'],'attributes':_0x2d520f['attributes']};}):[]};}):[]};}):[]:[]})[_0x811b('0x1e')](function(_0x133427){logger[_0x811b('0xd')](_0x811b('0x21'),_0x2fc7c0);logger['debug'](_0x811b('0x21'),_0x2fc7c0,JSON[_0x811b('0x11')](_0x133427));_0xbf9f7b(_0x133427);})[_0x811b('0x23')](function(_0x2caf08){logger[_0x811b('0x12')](_0x811b('0x21'),_0x2caf08['message'],_0x2fc7c0);_0x2ff20f(_0x43506e[_0x811b('0x12')](0x1f4,_0x2caf08['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 4657b41..5a915eb 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 _0xe645=['../../components/auth/service','./user-setting.controller','put','/:id','update','exports','express'];(function(_0x27c1f2,_0x3a3b9d){var _0x5ea234=function(_0x1e5de8){while(--_0x1e5de8){_0x27c1f2['push'](_0x27c1f2['shift']());}};_0x5ea234(++_0x3a3b9d);}(_0xe645,0x1e2));var _0x5e64=function(_0x57fa92,_0x270ffa){_0x57fa92=_0x57fa92-0x0;var _0x24cb0e=_0xe645[_0x57fa92];return _0x24cb0e;};'use strict';var express=require(_0x5e64('0x0'));var router=express['Router']();var auth=require(_0x5e64('0x1'));var controller=require(_0x5e64('0x2'));router[_0x5e64('0x3')](_0x5e64('0x4'),auth['isAuthenticated'](),controller[_0x5e64('0x5')]);module[_0x5e64('0x6')]=router; \ No newline at end of file +var _0xebf1=['../../components/auth/service','./user-setting.controller','put','isAuthenticated','update','express','Router'];(function(_0x505000,_0x2869b1){var _0x246266=function(_0x1ea8de){while(--_0x1ea8de){_0x505000['push'](_0x505000['shift']());}};_0x246266(++_0x2869b1);}(_0xebf1,0x98));var _0x1ebf=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0xebf1[_0xfc0976];return _0x23579f;};'use strict';var express=require(_0x1ebf('0x0'));var router=express[_0x1ebf('0x1')]();var auth=require(_0x1ebf('0x2'));var controller=require(_0x1ebf('0x3'));router[_0x1ebf('0x4')]('/:id',auth[_0x1ebf('0x5')](),controller[_0x1ebf('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 346f476..0ebdc75 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 _0xe396=['debug','exports','BOOLEAN','DATE','INTEGER','UserId','sequelize','error','warning','info'];(function(_0x4bac88,_0x4b6d66){var _0x407fd6=function(_0x5bd74e){while(--_0x5bd74e){_0x4bac88['push'](_0x4bac88['shift']());}};_0x407fd6(++_0x4b6d66);}(_0xe396,0x100));var _0x6e39=function(_0x31baa8,_0x2bd431){_0x31baa8=_0x31baa8-0x0;var _0x241afd=_0xe396[_0x31baa8];return _0x241afd;};'use strict';var Sequelize=require(_0x6e39('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x6e39('0x1'),_0x6e39('0x2'),_0x6e39('0x3'),_0x6e39('0x4')];module[_0x6e39('0x5')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x6e39('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x6e39('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x6e39('0x8')],'unique':_0x6e39('0x9')}}; \ No newline at end of file +var _0xc498=['UserId','sequelize','error','warning','info','BOOLEAN','TEXT','DATE'];(function(_0x2d6d25,_0x5c8736){var _0x176a23=function(_0x423afa){while(--_0x423afa){_0x2d6d25['push'](_0x2d6d25['shift']());}};_0x176a23(++_0x5c8736);}(_0xc498,0x1e1));var _0x8c49=function(_0x13fa33,_0x5cb8b2){_0x13fa33=_0x13fa33-0x0;var _0xdd7bd6=_0xc498[_0x13fa33];return _0xdd7bd6;};'use strict';var Sequelize=require(_0x8c49('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x8c49('0x1'),_0x8c49('0x2'),_0x8c49('0x3'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x8c49('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x8c49('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x8c49('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x8c49('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x8c49('0x7')}}; \ 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 a7f4653..0224241 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 _0x6898=['socket.io-emitter','redis','./user-setting.socket','defaults','status','json','sendStatus','error','name','update','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','then','body','catch','lodash','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x6898,0x11b));var _0x8689=function(_0x426079,_0x1d779e){_0x426079=_0x426079-0x0;var _0xf1347d=_0x6898[_0x426079];return _0xf1347d;};'use strict';var _=require(_0x8689('0x0'));var Redis=require('ioredis');var logger=require(_0x8689('0x1'))(_0x8689('0x2'));var config=require(_0x8689('0x3'));var db=require(_0x8689('0x4'))['db'];var socket=require(_0x8689('0x5'))(new Redis(config[_0x8689('0x6')]));require(_0x8689('0x7'))['register'](socket);config[_0x8689('0x6')]=_[_0x8689('0x8')](config[_0x8689('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0xbc1b52,_0x2eb27c){_0x2eb27c=_0x2eb27c||0xc8;return function(_0x9ab197){if(_0x9ab197){return _0xbc1b52[_0x8689('0x9')](_0x2eb27c)[_0x8689('0xa')](_0x9ab197);}};}function saveUpdates(_0x44d979){return function(_0x48b70f){if(_0x48b70f){return _0x48b70f['update'](_0x44d979)['then'](function(_0x39fb70){return _0x39fb70;});}return null;};}function handleEntityNotFound(_0x573c98){return function(_0x24e15a){if(!_0x24e15a){_0x573c98[_0x8689('0xb')](0x194);}return _0x24e15a;};}function handleError(_0x5b091c,_0x54a94e){_0x54a94e=_0x54a94e||0x1f4;return function(_0x22549b){logger[_0x8689('0xc')](_0x22549b['stack']);if(_0x22549b[_0x8689('0xd')]){delete _0x22549b[_0x8689('0xd')];}_0x5b091c[_0x8689('0x9')](_0x54a94e)['send'](_0x22549b);};}exports[_0x8689('0xe')]=function(_0x478f0c,_0x5e89d8){if(_0x478f0c['user'][_0x8689('0xf')]!==_0x8689('0x10'))throw new Error(_0x8689('0x11'));if(isNaN(Number(_0x478f0c[_0x8689('0x12')]['id'])))throw new Error(_0x8689('0x13'));return db[_0x8689('0x14')]['find']({'where':{'id':_0x478f0c[_0x8689('0x12')]['id']}})['then'](handleEntityNotFound(_0x5e89d8,null))[_0x8689('0x15')](saveUpdates(_0x478f0c[_0x8689('0x16')],null))['then'](respondWithResult(_0x5e89d8,null))[_0x8689('0x17')](handleError(_0x5e89d8,null));}; \ No newline at end of file +var _0x292e=['Invalid\x20user\x20setting\x20id','UserSetting','body','lodash','ioredis','../../config/logger','api','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','error','stack','name','user','role','admin','Unauthorized'];(function(_0x20be74,_0x7790fa){var _0x2d9039=function(_0x305025){while(--_0x305025){_0x20be74['push'](_0x20be74['shift']());}};_0x2d9039(++_0x7790fa);}(_0x292e,0xcb));var _0xe292=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x292e[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xe292('0x0'));var Redis=require(_0xe292('0x1'));var logger=require(_0xe292('0x2'))(_0xe292('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0xe292('0x4'))(new Redis(config[_0xe292('0x5')]));require(_0xe292('0x6'))[_0xe292('0x7')](socket);config['redis']=_[_0xe292('0x8')](config['redis'],{'host':_0xe292('0x9'),'port':0x18eb});function respondWithResult(_0x3de36e,_0x3fe83c){_0x3fe83c=_0x3fe83c||0xc8;return function(_0x11fd14){if(_0x11fd14){return _0x3de36e[_0xe292('0xa')](_0x3fe83c)[_0xe292('0xb')](_0x11fd14);}};}function saveUpdates(_0x4e9918){return function(_0x4af6e1){if(_0x4af6e1){return _0x4af6e1[_0xe292('0xc')](_0x4e9918)[_0xe292('0xd')](function(_0x36086d){return _0x36086d;});}return null;};}function handleEntityNotFound(_0x188913){return function(_0x55da61){if(!_0x55da61){_0x188913[_0xe292('0xe')](0x194);}return _0x55da61;};}function handleError(_0x3aa319,_0x58e84d){_0x58e84d=_0x58e84d||0x1f4;return function(_0x16e8f4){logger[_0xe292('0xf')](_0x16e8f4[_0xe292('0x10')]);if(_0x16e8f4[_0xe292('0x11')]){delete _0x16e8f4[_0xe292('0x11')];}_0x3aa319[_0xe292('0xa')](_0x58e84d)['send'](_0x16e8f4);};}exports[_0xe292('0xc')]=function(_0x1394f0,_0x22b178){if(_0x1394f0[_0xe292('0x12')][_0xe292('0x13')]!==_0xe292('0x14'))throw new Error(_0xe292('0x15'));if(isNaN(Number(_0x1394f0['params']['id'])))throw new Error(_0xe292('0x16'));return db[_0xe292('0x17')]['find']({'where':{'id':_0x1394f0['params']['id']}})[_0xe292('0xd')](handleEntityNotFound(_0x22b178,null))[_0xe292('0xd')](saveUpdates(_0x1394f0[_0xe292('0x18')],null))[_0xe292('0xd')](respondWithResult(_0x22b178,null))['catch'](handleError(_0x22b178,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 5bac52f..c1d7b73 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 _0x12d2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3a1a67,_0x1773ad){var _0x59a2ac=function(_0x3c6fb5){while(--_0x3c6fb5){_0x3a1a67['push'](_0x3a1a67['shift']());}};_0x59a2ac(++_0x1773ad);}(_0x12d2,0x1bc));var _0x212d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x12d2[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x212d('0x0'));var UserSetting=require(_0x212d('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x212d('0x2')](0x0);var events={'afterCreate':_0x212d('0x3'),'afterUpdate':_0x212d('0x4'),'afterDestroy':_0x212d('0x5')};function emitEvent(_0x51242d){return function(_0x460d6b,_0x15b02b,_0x283fb3){UserSettingEvents[_0x212d('0x6')](_0x51242d+':'+_0x460d6b['id'],_0x460d6b);UserSettingEvents[_0x212d('0x6')](_0x51242d,_0x460d6b);_0x283fb3(null);};}for(var e in events){if(events[_0x212d('0x7')](e)){var event=events[e];UserSetting[_0x212d('0x8')](e,emitEvent(event));}}module[_0x212d('0x9')]=UserSettingEvents; \ No newline at end of file +var _0x68de=['events','UserSetting','setMaxListeners','update','remove','hasOwnProperty','hook','exports'];(function(_0x46f22e,_0x90c15){var _0xe1a9f=function(_0x2f46c5){while(--_0x2f46c5){_0x46f22e['push'](_0x46f22e['shift']());}};_0xe1a9f(++_0x90c15);}(_0x68de,0x98));var _0xe68d=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x68de[_0x49052b];return _0x48c045;};'use strict';var EventEmitter=require(_0xe68d('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xe68d('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xe68d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe68d('0x3'),'afterDestroy':_0xe68d('0x4')};function emitEvent(_0xa31857){return function(_0x32329d,_0x1d92e1,_0x1b21a5){UserSettingEvents['emit'](_0xa31857+':'+_0x32329d['id'],_0x32329d);UserSettingEvents['emit'](_0xa31857,_0x32329d);_0x1b21a5(null);};}for(var e in events){if(events[_0xe68d('0x5')](e)){var event=events[e];UserSetting[_0xe68d('0x6')](e,emitEvent(event));}}module[_0xe68d('0x7')]=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 abfb615..73229cf 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 _0x4a1d=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x57574f,_0x239859){var _0x136fe3=function(_0x25f4ad){while(--_0x25f4ad){_0x57574f['push'](_0x57574f['shift']());}};_0x136fe3(++_0x239859);}(_0x4a1d,0x77));var _0xd4a1=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x4a1d[_0x138adb];return _0x1b27f2;};'use strict';var attributes=require(_0xd4a1('0x0'));module[_0xd4a1('0x1')]=function(_0x213963){return _0x213963[_0xd4a1('0x2')](_0xd4a1('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43ae3f){if(!_0x43ae3f[_0xd4a1('0x4')])_0x43ae3f[_0xd4a1('0x5')]=null;else if(_0x43ae3f[_0xd4a1('0x5')]===null)_0x43ae3f[_0xd4a1('0x5')]=new Date();}}});}; \ No newline at end of file +var _0xd523=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x31b338,_0x48dff4){var _0x461c6f=function(_0x3934d2){while(--_0x3934d2){_0x31b338['push'](_0x31b338['shift']());}};_0x461c6f(++_0x48dff4);}(_0xd523,0x153));var _0x3d52=function(_0x563317,_0x3c9404){_0x563317=_0x563317-0x0;var _0x22dca1=_0xd523[_0x563317];return _0x22dca1;};'use strict';var attributes=require(_0x3d52('0x0'));module[_0x3d52('0x1')]=function(_0x3d35b0){return _0x3d35b0[_0x3d52('0x2')]('UserSetting',attributes,{'tableName':_0x3d52('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b5ea1){if(!_0x1b5ea1[_0x3d52('0x4')])_0x1b5ea1['clientSideLoggingEnabledSince']=null;else if(_0x1b5ea1[_0x3d52('0x5')]===null)_0x1b5ea1[_0x3d52('0x5')]=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 d3eb6a1..05620e1 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 _0x28c6=['emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove','update'];(function(_0x104377,_0x54b94c){var _0x1fac22=function(_0xfd1f7f){while(--_0xfd1f7f){_0x104377['push'](_0x104377['shift']());}};_0x1fac22(++_0x54b94c);}(_0x28c6,0xac));var _0x628c=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x28c6[_0x4907de];return _0x482054;};'use strict';var UserSettingEvents=require(_0x628c('0x0'));var events=[_0x628c('0x1'),_0x628c('0x2'),_0x628c('0x3')];function createListener(_0x17a3a6,_0x189346){return function(_0xa9345e){_0x189346[_0x628c('0x4')](_0x17a3a6,_0xa9345e);if(_0x17a3a6===_0x628c('0x5')){_0x189346[_0x628c('0x4')](_0x628c('0x6')+_0xa9345e[_0x628c('0x7')],_0xa9345e);}};}exports[_0x628c('0x8')]=function(_0x408fe2){for(var _0x1bef8a=0x0,_0x2216f0=events[_0x628c('0x9')];_0x1bef8a<_0x2216f0;_0x1bef8a++){var _0x38e0d4=events[_0x1bef8a];var _0x32e932=createListener(_0x628c('0xa')+_0x38e0d4,_0x408fe2);UserSettingEvents['on'](_0x38e0d4,_0x32e932);}}; \ No newline at end of file +var _0xeaf2=['register','save','emit','user-setting:update','user-setting:update:user-'];(function(_0x1bd111,_0x42d5f9){var _0x1c0ebb=function(_0x46e26d){while(--_0x46e26d){_0x1bd111['push'](_0x1bd111['shift']());}};_0x1c0ebb(++_0x42d5f9);}(_0xeaf2,0x83));var _0x2eaf=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0xeaf2[_0x53b133];return _0x5647e0;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x2eaf('0x0'),'remove','update'];function createListener(_0x1b17ec,_0x16532f){return function(_0x1a06bd){_0x16532f[_0x2eaf('0x1')](_0x1b17ec,_0x1a06bd);if(_0x1b17ec===_0x2eaf('0x2')){_0x16532f[_0x2eaf('0x1')](_0x2eaf('0x3')+_0x1a06bd['UserId'],_0x1a06bd);}};}exports[_0x2eaf('0x4')]=function(_0xa90827){for(var _0xe6471e=0x0,_0x241f67=events['length'];_0xe6471e<_0x241f67;_0xe6471e++){var _0x35cd45=events[_0xe6471e];var _0x3e938a=createListener('user-setting:'+_0x35cd45,_0xa90827);UserSettingEvents['on'](_0x35cd45,_0x3e938a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 09beda0..cb9ba4e 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 _0x4edf=['getTeams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','single','/:id/login','login','/:id/logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4edf,0x196));var _0xf4ed=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x4edf[_0x149083];return _0x4dc74e;};'use strict';var multer=require(_0xf4ed('0x0'));var util=require(_0xf4ed('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf4ed('0x2'));var router=express[_0xf4ed('0x3')]();var fs_extra=require(_0xf4ed('0x4'));var auth=require(_0xf4ed('0x5'));var interaction=require(_0xf4ed('0x6'));var config=require(_0xf4ed('0x7'));var controller=require(_0xf4ed('0x8'));router[_0xf4ed('0x9')]('/',auth['isAuthenticated'](),controller[_0xf4ed('0xa')]);router[_0xf4ed('0x9')](_0xf4ed('0xb'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0xd')]);router[_0xf4ed('0x9')](_0xf4ed('0xe'),auth[_0xf4ed('0xc')](),controller['whoami']);router[_0xf4ed('0x9')]('/presence',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0xf')]);router[_0xf4ed('0x9')](_0xf4ed('0x10'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x11')]);router[_0xf4ed('0x9')](_0xf4ed('0x12'),controller[_0xf4ed('0x13')]);router[_0xf4ed('0x9')](_0xf4ed('0x14'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0xf4ed('0x9')](_0xf4ed('0x15'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x16')]);router[_0xf4ed('0x9')](_0xf4ed('0x17'),auth[_0xf4ed('0xc')](),controller['getQueues']);router['get'](_0xf4ed('0x18'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x19')]);router[_0xf4ed('0x9')](_0xf4ed('0x1a'),auth['isAuthenticated'](),controller[_0xf4ed('0x1b')]);router['get']('/:id/recordings',auth[_0xf4ed('0xc')](),controller['getRecordings']);router['get']('/:id/screen_recordings',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x1c')]);router[_0xf4ed('0x9')](_0xf4ed('0x1d'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x1e')]);router[_0xf4ed('0x9')](_0xf4ed('0x1f'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x20')]);router[_0xf4ed('0x9')]('/:id/mail/interactions',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x21')]);router[_0xf4ed('0x9')](_0xf4ed('0x22'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0xf4ed('0x9')](_0xf4ed('0x23'),auth[_0xf4ed('0xc')](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x24')]);router[_0xf4ed('0x9')](_0xf4ed('0x25'),auth['isAuthenticated'](),controller[_0xf4ed('0x26')]);router['get'](_0xf4ed('0x27'),auth['isAuthenticated'](),controller[_0xf4ed('0x28')]);router['get']('/:id/agents',auth[_0xf4ed('0xc')](),controller['getAgents']);router['get'](_0xf4ed('0x29'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x2a')]);router['get'](_0xf4ed('0x2b'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x2c')]);router['get'](_0xf4ed('0x2d'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x2e')]);router[_0xf4ed('0x9')](_0xf4ed('0x2f'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x30')]);router[_0xf4ed('0x9')](_0xf4ed('0x31'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x32')]);router[_0xf4ed('0x9')]('/:id/chat_websites',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x33')]);router[_0xf4ed('0x9')](_0xf4ed('0x34'),auth[_0xf4ed('0xc')](),controller['getWhatsappAccounts']);router[_0xf4ed('0x9')]('/:id/scheduled_calls',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x35')]);router[_0xf4ed('0x9')](_0xf4ed('0x36'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x37')]);router[_0xf4ed('0x38')](_0xf4ed('0x15'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x39')]);router[_0xf4ed('0x38')]('/',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x3a')]);router['post']('/create_many',auth['isAuthenticated'](),controller[_0xf4ed('0x3b')]);router[_0xf4ed('0x38')]('/:id/queues',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x3c')]);var upload=multer({'storage':multer[_0xf4ed('0x3d')]({'destination':function(_0x2a14e2,_0x76edf1,_0x241ebd){_0x241ebd(null,path['join'](config[_0xf4ed('0x3e')],_0xf4ed('0x3f')));},'filename':function(_0x1f56b4,_0x2ac0ba,_0x47fcf2){_0x47fcf2(null,util[_0xf4ed('0x40')](_0xf4ed('0x41'),Date[_0xf4ed('0x42')](),_0x2ac0ba[_0xf4ed('0x43')]));}})});router[_0xf4ed('0x38')](_0xf4ed('0x12'),upload[_0xf4ed('0x44')]('file'),controller['addAvatar']);router[_0xf4ed('0x38')](_0xf4ed('0x45'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x46')]);router[_0xf4ed('0x38')](_0xf4ed('0x47'),auth['isAuthenticated'](),controller['logout']);router[_0xf4ed('0x38')](_0xf4ed('0x48'),auth[_0xf4ed('0xc')](),controller['pause']);router[_0xf4ed('0x38')](_0xf4ed('0x49'),auth['isAuthenticated'](),controller[_0xf4ed('0x4a')]);router['post']('/:id/teams',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x4b')]);router[_0xf4ed('0x38')](_0xf4ed('0x4c'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x4d')]);router[_0xf4ed('0x38')](_0xf4ed('0x4e'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x4f')]);router[_0xf4ed('0x38')](_0xf4ed('0x50'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x51')]);router[_0xf4ed('0x38')](_0xf4ed('0x52'),auth['isAuthenticated'](),controller[_0xf4ed('0x53')]);router[_0xf4ed('0x38')]('/:id/openchannel_interactions',auth[_0xf4ed('0xc')](),controller['addOpenchannelInteractions']);router[_0xf4ed('0x38')](_0xf4ed('0x54'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x55')]);router['post'](_0xf4ed('0x2b'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x56')]);router[_0xf4ed('0x38')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xf4ed('0x57')]);router[_0xf4ed('0x38')](_0xf4ed('0x2f'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x58')]);router[_0xf4ed('0x38')](_0xf4ed('0x31'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x59')]);router[_0xf4ed('0x38')](_0xf4ed('0x5a'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x5b')]);router[_0xf4ed('0x38')](_0xf4ed('0x34'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x5c')]);router[_0xf4ed('0x38')]('/:id/api_key',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x5d')]);router[_0xf4ed('0x5e')](_0xf4ed('0x10'),auth['isAuthenticated'](),controller[_0xf4ed('0x5f')]);router['put'](_0xf4ed('0x60'),auth['isAuthenticated'](),controller['changePassword']);router[_0xf4ed('0x61')]('/:id/queues',auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x62')]);router['delete'](_0xf4ed('0x25'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x63')]);router[_0xf4ed('0x61')](_0xf4ed('0x10'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x64')]);router[_0xf4ed('0x61')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xf4ed('0x65')]);router[_0xf4ed('0x61')](_0xf4ed('0x4e'),auth['isAuthenticated'](),controller[_0xf4ed('0x66')]);router[_0xf4ed('0x61')](_0xf4ed('0x50'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x67')]);router[_0xf4ed('0x61')](_0xf4ed('0x52'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x68')]);router[_0xf4ed('0x61')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xf4ed('0x61')](_0xf4ed('0x54'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x69')]);router[_0xf4ed('0x61')](_0xf4ed('0x2b'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xf4ed('0x61')](_0xf4ed('0x2d'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x6a')]);router[_0xf4ed('0x61')](_0xf4ed('0x2f'),auth['isAuthenticated'](),controller[_0xf4ed('0x6b')]);router['delete'](_0xf4ed('0x31'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x6c')]);router[_0xf4ed('0x61')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xf4ed('0x6d')]);router[_0xf4ed('0x61')](_0xf4ed('0x34'),auth[_0xf4ed('0xc')](),controller['removeWhatsappAccounts']);router[_0xf4ed('0x61')](_0xf4ed('0x36'),auth[_0xf4ed('0xc')](),controller[_0xf4ed('0x6e')]);module['exports']=router; \ No newline at end of file +var _0x8978=['/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id','destroy','removeChatInteractions','removeFaxInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','get','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','bulkCreate','addQueues','join','root','file','addAvatar','/:id/login','login','/:id/pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x8978,0x1cc));var _0x8897=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8978[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8897('0x0'));var timeout=require('connect-timeout');var express=require(_0x8897('0x1'));var router=express['Router']();var fs_extra=require(_0x8897('0x2'));var auth=require(_0x8897('0x3'));var interaction=require(_0x8897('0x4'));var config=require(_0x8897('0x5'));var controller=require(_0x8897('0x6'));router['get']('/',auth[_0x8897('0x7')](),controller[_0x8897('0x8')]);router['get'](_0x8897('0x9'),auth[_0x8897('0x7')](),controller[_0x8897('0xa')]);router['get'](_0x8897('0xb'),auth['isAuthenticated'](),controller[_0x8897('0xc')]);router['get'](_0x8897('0xd'),auth[_0x8897('0x7')](),controller[_0x8897('0xe')]);router[_0x8897('0xf')]('/:id',auth[_0x8897('0x7')](),controller[_0x8897('0x10')]);router[_0x8897('0xf')](_0x8897('0x11'),controller[_0x8897('0x12')]);router[_0x8897('0xf')](_0x8897('0x13'),auth['isAuthenticated'](),controller[_0x8897('0x14')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x8897('0xf')](_0x8897('0x15'),auth[_0x8897('0x7')](),controller[_0x8897('0x16')]);router[_0x8897('0xf')](_0x8897('0x17'),auth[_0x8897('0x7')](),controller[_0x8897('0x18')]);router[_0x8897('0xf')](_0x8897('0x19'),auth['isAuthenticated'](),controller['getGroups']);router['get'](_0x8897('0x1a'),auth['isAuthenticated'](),controller[_0x8897('0x1b')]);router['get']('/:id/screen_recordings',auth[_0x8897('0x7')](),controller['getScreenRecordings']);router[_0x8897('0xf')](_0x8897('0x1c'),auth[_0x8897('0x7')](),controller['getChatInteractions']);router[_0x8897('0xf')](_0x8897('0x1d'),auth[_0x8897('0x7')](),controller[_0x8897('0x1e')]);router[_0x8897('0xf')](_0x8897('0x1f'),auth[_0x8897('0x7')](),controller[_0x8897('0x20')]);router[_0x8897('0xf')](_0x8897('0x21'),auth[_0x8897('0x7')](),controller['getSmsInteractions']);router[_0x8897('0xf')](_0x8897('0x22'),auth[_0x8897('0x7')](),controller[_0x8897('0x23')]);router['get'](_0x8897('0x24'),auth[_0x8897('0x7')](),controller[_0x8897('0x25')]);router[_0x8897('0xf')](_0x8897('0x26'),auth['isAuthenticated'](),controller[_0x8897('0x27')]);router[_0x8897('0xf')](_0x8897('0x28'),auth['isAuthenticated'](),controller['getLists']);router[_0x8897('0xf')]('/:id/agents',auth[_0x8897('0x7')](),controller[_0x8897('0x29')]);router[_0x8897('0xf')](_0x8897('0x2a'),auth['isAuthenticated'](),controller[_0x8897('0x2b')]);router[_0x8897('0xf')](_0x8897('0x2c'),auth[_0x8897('0x7')](),controller[_0x8897('0x2d')]);router[_0x8897('0xf')](_0x8897('0x2e'),auth[_0x8897('0x7')](),controller['getMailAccounts']);router[_0x8897('0xf')]('/:id/openchannel_accounts',auth[_0x8897('0x7')](),controller[_0x8897('0x2f')]);router[_0x8897('0xf')]('/:id/sms_accounts',auth[_0x8897('0x7')](),controller[_0x8897('0x30')]);router[_0x8897('0xf')](_0x8897('0x31'),auth[_0x8897('0x7')](),controller[_0x8897('0x32')]);router[_0x8897('0xf')](_0x8897('0x33'),auth[_0x8897('0x7')](),controller[_0x8897('0x34')]);router['get'](_0x8897('0x35'),auth[_0x8897('0x7')](),controller[_0x8897('0x36')]);router[_0x8897('0xf')](_0x8897('0x37'),auth[_0x8897('0x7')](),controller['getApiKey']);router[_0x8897('0x38')](_0x8897('0x39'),auth[_0x8897('0x7')](),controller[_0x8897('0x3a')]);router[_0x8897('0x38')]('/',auth['isAuthenticated'](),controller[_0x8897('0x3b')]);router['post']('/create_many',auth[_0x8897('0x7')](),controller[_0x8897('0x3c')]);router['post'](_0x8897('0x15'),auth[_0x8897('0x7')](),controller[_0x8897('0x3d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f484b,_0x1196a9,_0x2cf1b1){_0x2cf1b1(null,path[_0x8897('0x3e')](config[_0x8897('0x3f')],'server/files/images/'));},'filename':function(_0x15d6fe,_0x3b4aa3,_0x5c168d){_0x5c168d(null,util['format']('%s-%s',Date['now'](),_0x3b4aa3['originalname']));}})});router[_0x8897('0x38')](_0x8897('0x11'),upload['single'](_0x8897('0x40')),controller[_0x8897('0x41')]);router['post'](_0x8897('0x42'),auth['isAuthenticated'](),controller[_0x8897('0x43')]);router[_0x8897('0x38')]('/:id/logout',auth[_0x8897('0x7')](),controller['logout']);router[_0x8897('0x38')](_0x8897('0x44'),auth[_0x8897('0x7')](),controller['pause']);router[_0x8897('0x38')]('/:id/unpause',auth[_0x8897('0x7')](),controller[_0x8897('0x45')]);router[_0x8897('0x38')](_0x8897('0x26'),auth[_0x8897('0x7')](),controller[_0x8897('0x46')]);router['post'](_0x8897('0x47'),auth[_0x8897('0x7')](),controller[_0x8897('0x48')]);router[_0x8897('0x38')](_0x8897('0x49'),auth[_0x8897('0x7')](),controller['addMailInteractions']);router[_0x8897('0x38')](_0x8897('0x4a'),auth[_0x8897('0x7')](),controller[_0x8897('0x4b')]);router[_0x8897('0x38')](_0x8897('0x4c'),auth[_0x8897('0x7')](),controller[_0x8897('0x4d')]);router[_0x8897('0x38')](_0x8897('0x4e'),auth[_0x8897('0x7')](),controller[_0x8897('0x4f')]);router[_0x8897('0x38')]('/:id/whatsapp_interactions',auth[_0x8897('0x7')](),controller[_0x8897('0x50')]);router[_0x8897('0x38')](_0x8897('0x2c'),auth['isAuthenticated'](),controller[_0x8897('0x51')]);router[_0x8897('0x38')](_0x8897('0x2e'),auth[_0x8897('0x7')](),controller[_0x8897('0x52')]);router['post'](_0x8897('0x53'),auth['isAuthenticated'](),controller[_0x8897('0x54')]);router[_0x8897('0x38')](_0x8897('0x55'),auth[_0x8897('0x7')](),controller[_0x8897('0x56')]);router[_0x8897('0x38')](_0x8897('0x31'),auth[_0x8897('0x7')](),controller[_0x8897('0x57')]);router[_0x8897('0x38')](_0x8897('0x33'),auth[_0x8897('0x7')](),controller[_0x8897('0x58')]);router['post']('/:id/api_key',auth[_0x8897('0x7')](),controller[_0x8897('0x59')]);router[_0x8897('0x5a')]('/:id',auth[_0x8897('0x7')](),controller[_0x8897('0x5b')]);router[_0x8897('0x5a')](_0x8897('0x5c'),auth['isAuthenticated'](),controller[_0x8897('0x5d')]);router[_0x8897('0x5e')](_0x8897('0x15'),auth[_0x8897('0x7')](),controller[_0x8897('0x5f')]);router[_0x8897('0x5e')](_0x8897('0x26'),auth[_0x8897('0x7')](),controller[_0x8897('0x60')]);router[_0x8897('0x5e')](_0x8897('0x61'),auth[_0x8897('0x7')](),controller[_0x8897('0x62')]);router[_0x8897('0x5e')](_0x8897('0x47'),auth['isAuthenticated'](),controller[_0x8897('0x63')]);router[_0x8897('0x5e')](_0x8897('0x49'),auth[_0x8897('0x7')](),controller['removeMailInteractions']);router[_0x8897('0x5e')](_0x8897('0x4a'),auth[_0x8897('0x7')](),controller[_0x8897('0x64')]);router[_0x8897('0x5e')](_0x8897('0x4c'),auth[_0x8897('0x7')](),controller['removeSmsInteractions']);router['delete'](_0x8897('0x4e'),auth[_0x8897('0x7')](),controller[_0x8897('0x65')]);router[_0x8897('0x5e')](_0x8897('0x66'),auth[_0x8897('0x7')](),controller[_0x8897('0x67')]);router[_0x8897('0x5e')]('/:id/fax_accounts',auth[_0x8897('0x7')](),controller[_0x8897('0x68')]);router['delete']('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete'](_0x8897('0x53'),auth[_0x8897('0x7')](),controller[_0x8897('0x69')]);router[_0x8897('0x5e')](_0x8897('0x55'),auth['isAuthenticated'](),controller[_0x8897('0x6a')]);router[_0x8897('0x5e')]('/:id/chat_websites',auth[_0x8897('0x7')](),controller['removeChatWebsites']);router[_0x8897('0x5e')](_0x8897('0x33'),auth[_0x8897('0x7')](),controller['removeWhatsappAccounts']);router[_0x8897('0x5e')](_0x8897('0x37'),auth[_0x8897('0x7')](),controller[_0x8897('0x6b')]);module[_0x8897('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 4435763..22240c6 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 _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_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','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x3da727,_0x47f373){var _0x508e63=function(_0x4856d2){while(--_0x4856d2){_0x3da727['push'](_0x3da727['shift']());}};_0x508e63(++_0x47f373);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xcb91[_0x15876a];return _0xbd900f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_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','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x1c3892,_0x4f5eef){var _0x388819=function(_0x2d0495){while(--_0x2d0495){_0x1c3892['push'](_0x1c3892['shift']());}};_0x388819(++_0x4f5eef);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xcb91[_0x79b649];return _0x1af9b1;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b992664..b8c4cc7 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 _0x2c10=['MemberReport','concat','isMiddleware','resolve','pause','QueuePause','updateAttributes','unpause','mailPause','chatPause','faxPause','whatsappPause','pauseType','lastPauseAt','Team','getTeams','addTeams','transaction','getAssociatedQueues','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','removeTeams','isArray','removeAgent','VoicePrefixId','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','CmContact','Contact','dialActive','VoiceQueue','getApiKey','token','createApiKey','generateApiKey','iat','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','teams','queues','flatten','col','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','ringing','busy','slice','select','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','moment','util','path','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','role','userNotification:recalc:','get','Users','Telephones','telephone','filter','ignore','map','value','includes','name','UserProfileResource','stack','send','User','rawAttributes','fieldName','type','key','password','salt','getOptions','query','includeAll','include','userSetting','true','UserSetting','findAll','rows','length','push','dataValues','sms','fax','mail','openchannel','whatsapp','all','show','model','differenceBy','keys','filters','intersection','attributes','fields','find','openTabs','update','body','params','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','max','min_internal','isNil','sequelize','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','permissions','101','102','103','113','105','106','107','109','100','111','114','115','create','agent','Unauthorized','user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','changePassword','oldPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','voicePause','interface','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Unknown\x20channel','remove','Queue:remove','destroy','addAvatar','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','chat','CHAT','createdAt','FAX','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','Tags','color','tag','order','sort','where','options','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','pick','merge','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x2c10,0x87));var _0x02c1=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2c10[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0x02c1('0x0'));var util=require(_0x02c1('0x1'));var path=require(_0x02c1('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x02c1('0x3'));var jayson=require('jayson/promise');var Redis=require(_0x02c1('0x4'));var authService=require(_0x02c1('0x5'));var contacts=require(_0x02c1('0x6'));var qs=require(_0x02c1('0x7'));var logger=require(_0x02c1('0x8'))('api');var utils=require(_0x02c1('0x9'));var config=require(_0x02c1('0xa'));var licenseUtil=require(_0x02c1('0xb'));var APIBadRequestError=require(_0x02c1('0xc'))[_0x02c1('0xd')];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0x02c1('0xe')];var db=require(_0x02c1('0xf'))['db'];var socket=require(_0x02c1('0x10'))(new Redis(config[_0x02c1('0x11')]));require(_0x02c1('0x12'))[_0x02c1('0x13')](socket);config[_0x02c1('0x11')]=_[_0x02c1('0x14')](config[_0x02c1('0x11')],{'host':_0x02c1('0x15'),'port':0x18eb});var amiClient=jayson[_0x02c1('0x16')][_0x02c1('0x17')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2849b4,_0x28669f,_0x3f49e1,_0x205217){return new Promise(function(_0x4b7e41,_0x443f93){var _0x436278=_0x205217||amiClient;return _0x436278[_0x02c1('0x18')](_0x2849b4,_0x3f49e1)[_0x02c1('0x19')](function(_0x367d01){logger[_0x02c1('0x1a')](_0x02c1('0x1b'),_0x28669f,_0x02c1('0x1c'));logger['debug'](_0x02c1('0x1d'),_0x28669f,'request\x20sent',JSON['stringify'](_0x367d01));if(_0x367d01[_0x02c1('0x1e')]){if(_0x367d01[_0x02c1('0x1e')]['code']===0x1f4){logger[_0x02c1('0x1e')](_0x02c1('0x1b'),_0x28669f,_0x367d01['error'][_0x02c1('0x1f')]);return _0x443f93(_0x367d01[_0x02c1('0x1e')][_0x02c1('0x1f')]);}logger[_0x02c1('0x1e')](_0x02c1('0x1b'),_0x28669f,_0x367d01[_0x02c1('0x1e')][_0x02c1('0x1f')]);return _0x4b7e41(_0x367d01[_0x02c1('0x1e')]['message']);}else{logger[_0x02c1('0x1a')](_0x02c1('0x1b'),_0x28669f,_0x02c1('0x1c'));_0x4b7e41(_0x367d01['result'][_0x02c1('0x1f')]);}})[_0x02c1('0x20')](function(_0x5e8c17){logger[_0x02c1('0x1e')](_0x02c1('0x1b'),_0x28669f,_0x5e8c17);_0x443f93(_0x5e8c17);});});}function respondWithStatusCode(_0x28d739,_0xee54c7){_0xee54c7=_0xee54c7||0xcc;return function(_0x2ce86b){if(_0x2ce86b){return _0x28d739[_0x02c1('0x21')](_0xee54c7);}return _0x28d739[_0x02c1('0x22')](_0xee54c7)[_0x02c1('0x23')]();};}function respondWithResult(_0x28d6d3,_0x12922f){_0x12922f=_0x12922f||0xc8;return function(_0x3a6d6b){if(_0x3a6d6b){return _0x28d6d3[_0x02c1('0x22')](_0x12922f)[_0x02c1('0x24')](_0x3a6d6b);}};}function respondWithFilteredResult(_0x45383a,_0x1512b4){return function(_0x5f202c){if(_0x5f202c){var _0x2f02b2=typeof _0x1512b4[_0x02c1('0x25')]==='undefined'&&typeof _0x1512b4[_0x02c1('0x26')]===_0x02c1('0x27');var _0x1228f5=_0x5f202c[_0x02c1('0x28')];var _0x2c2e50=_0x2f02b2?0x0:_0x1512b4[_0x02c1('0x25')];var _0x2c57f2=_0x2f02b2?_0x5f202c[_0x02c1('0x28')]:_0x1512b4[_0x02c1('0x25')]+_0x1512b4[_0x02c1('0x26')];var _0x1db80d;if(_0x2c57f2>=_0x1228f5){_0x2c57f2=_0x1228f5;_0x1db80d=0xc8;}else{_0x1db80d=0xce;}_0x45383a['status'](_0x1db80d);return _0x45383a[_0x02c1('0x29')](_0x02c1('0x2a'),_0x2c2e50+'-'+_0x2c57f2+'/'+_0x1228f5)['json'](_0x5f202c);}return null;};}function saveUpdates(_0x1abe31){return function(_0x1eef70){if(_0x1eef70){return _0x1eef70['update'](_0x1abe31)[_0x02c1('0x19')](function(_0x397a28){if(_0x397a28[_0x02c1('0x2b')]==='agent'){socket['emit'](_0x02c1('0x2c')+_0x397a28['id'],_0x397a28);}return _0x397a28;});}return null;};}function removeEntity(_0x5005df){return function(_0x26c095){if(_0x26c095){return _0x26c095['destroy']()[_0x02c1('0x19')](function(){var _0x31f895=_0x26c095[_0x02c1('0x2d')]({'plain':!![]});if(_0x31f895['role']==='admin')return;var _0x5b52d7=[{'name':_0x02c1('0x2e'),'value':'user','ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x02c1('0x2f'),'value':_0x02c1('0x30'),'ignore':![]}];var _0x39198c=_(_0x5b52d7)[_0x02c1('0x31')](_0x02c1('0x32'))[_0x02c1('0x33')](_0x02c1('0x34'))[_0x02c1('0x34')]();if(_[_0x02c1('0x35')](_0x39198c,_0x31f895[_0x02c1('0x2b')])){return;}var _0x2a75b7=_['find'](_0x5b52d7,[_0x02c1('0x34'),_0x31f895[_0x02c1('0x2b')]])[_0x02c1('0x36')];return db[_0x02c1('0x37')]['destroy']({'where':{'type':_0x2a75b7,'resourceId':_0x31f895['id']}})[_0x02c1('0x19')](function(){return _0x26c095;});})['then'](function(){_0x5005df[_0x02c1('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bf7b6){return function(_0x38307f){if(!_0x38307f){_0x2bf7b6[_0x02c1('0x21')](0x194);}return _0x38307f;};}function handleError(_0x4bf19c,_0xd73f32){_0xd73f32=_0xd73f32||0x1f4;return function(_0x948036){logger[_0x02c1('0x1e')](_0x948036[_0x02c1('0x38')]);if(_0x948036[_0x02c1('0x36')]){delete _0x948036[_0x02c1('0x36')];}_0x4bf19c['status'](_0xd73f32)[_0x02c1('0x39')](_0x948036);};}exports['index']=function(_0x3a17c2,_0x274bd4){var _0x118226={},_0x39f44e={'count':0x0,'rows':[]};var _0x5c2448=_(db[_0x02c1('0x3a')][_0x02c1('0x3b')])[_0x02c1('0x33')](function(_0x2d5ff1){return{'name':_0x2d5ff1[_0x02c1('0x3c')],'type':_0x2d5ff1[_0x02c1('0x3d')][_0x02c1('0x3e')]};})['filter'](function(_0x4bded9){return!_['includes']([_0x02c1('0x3f'),_0x02c1('0x40')],_0x4bded9[_0x02c1('0x36')]);})[_0x02c1('0x34')]();_0x118226=qs[_0x02c1('0x41')](_0x5c2448,_0x3a17c2);var _0x590769={'where':_0x118226['where']};return db[_0x02c1('0x3a')][_0x02c1('0x28')](_0x590769)['then'](function(_0x5bc0f1){_0x39f44e[_0x02c1('0x28')]=_0x5bc0f1;if(_0x3a17c2[_0x02c1('0x42')][_0x02c1('0x43')]){_0x118226[_0x02c1('0x44')]=[{'all':!![]}];}if(_0x3a17c2['query'][_0x02c1('0x45')]===_0x02c1('0x46')){_0x118226[_0x02c1('0x44')]=[{'model':db[_0x02c1('0x47')],'as':_0x02c1('0x45')}];}if(!_[_0x02c1('0x35')](_0x118226['attributes'],'id')){_0x118226['attributes']['push']('id');}return db['User'][_0x02c1('0x48')](_0x118226);})[_0x02c1('0x19')](function(_0x282ad8){_0x39f44e[_0x02c1('0x49')]=_0x282ad8;if(_0x3a17c2['query']['openTabs']===_0x02c1('0x46')){var _0x19fc43=[];for(var _0x4fe3b9=0x0;_0x4fe3b9<_0x39f44e[_0x02c1('0x49')][_0x02c1('0x4a')];_0x4fe3b9++){_0x19fc43[_0x02c1('0x4b')](get_open_tabs('chat',_0x39f44e['rows'][_0x4fe3b9][_0x02c1('0x4c')]));_0x19fc43['push'](get_open_tabs(_0x02c1('0x4d'),_0x39f44e[_0x02c1('0x49')][_0x4fe3b9][_0x02c1('0x4c')]));_0x19fc43[_0x02c1('0x4b')](get_open_tabs(_0x02c1('0x4e'),_0x39f44e[_0x02c1('0x49')][_0x4fe3b9]['dataValues']));_0x19fc43[_0x02c1('0x4b')](get_open_tabs(_0x02c1('0x4f'),_0x39f44e[_0x02c1('0x49')][_0x4fe3b9]['dataValues']));_0x19fc43['push'](get_open_tabs(_0x02c1('0x50'),_0x39f44e[_0x02c1('0x49')][_0x4fe3b9][_0x02c1('0x4c')]));_0x19fc43['push'](get_open_tabs(_0x02c1('0x51'),_0x39f44e[_0x02c1('0x49')][_0x4fe3b9][_0x02c1('0x4c')]));}return Promise[_0x02c1('0x52')](_0x19fc43)[_0x02c1('0x19')](function(){return _0x39f44e;});}else{return _0x39f44e;}})[_0x02c1('0x19')](respondWithFilteredResult(_0x274bd4,_0x118226))[_0x02c1('0x20')](handleError(_0x274bd4,null));};exports[_0x02c1('0x53')]=function(_0x591708,_0xde201e){var _0x5a25d2={'raw':![],'where':{'id':_0x591708['params']['id']}},_0x1fdd21={};_0x1fdd21[_0x02c1('0x54')]=_[_0x02c1('0x55')](_[_0x02c1('0x56')](db[_0x02c1('0x3a')][_0x02c1('0x3b')]),['password',_0x02c1('0x40')]);_0x1fdd21[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0x591708[_0x02c1('0x42')]);_0x1fdd21[_0x02c1('0x57')]=_[_0x02c1('0x58')](_0x1fdd21[_0x02c1('0x54')],_0x1fdd21[_0x02c1('0x42')]);_0x5a25d2[_0x02c1('0x59')]=_['intersection'](_0x1fdd21[_0x02c1('0x54')],qs[_0x02c1('0x5a')](_0x591708[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x5a25d2[_0x02c1('0x59')]=_0x5a25d2[_0x02c1('0x59')][_0x02c1('0x4a')]?_0x5a25d2[_0x02c1('0x59')]:_0x1fdd21['model'];if(_0x591708['query'][_0x02c1('0x43')]){_0x5a25d2['include']=[{'all':!![]}];}if(_0x591708[_0x02c1('0x42')]['userSetting']==='true'){_0x5a25d2['include']=[{'model':db[_0x02c1('0x47')],'as':_0x02c1('0x45')}];}_0x5a25d2=_['merge']({},_0x5a25d2,_0x591708['options']);if(!_[_0x02c1('0x35')](_0x5a25d2[_0x02c1('0x59')],'id')){_0x5a25d2[_0x02c1('0x59')][_0x02c1('0x4b')]('id');}return db[_0x02c1('0x3a')][_0x02c1('0x5b')](_0x5a25d2)[_0x02c1('0x19')](handleEntityNotFound(_0xde201e,null))[_0x02c1('0x19')](function(_0xfadbe6){var _0x4b44df=[];values=_0xfadbe6;if(_0x591708[_0x02c1('0x42')][_0x02c1('0x5c')]===_0x02c1('0x46')){_0x4b44df[_0x02c1('0x4b')](get_open_tabs('chat',_0xfadbe6[_0x02c1('0x4c')]));_0x4b44df[_0x02c1('0x4b')](get_open_tabs('sms',_0xfadbe6['dataValues']));_0x4b44df[_0x02c1('0x4b')](get_open_tabs(_0x02c1('0x50'),_0xfadbe6[_0x02c1('0x4c')]));_0x4b44df[_0x02c1('0x4b')](get_open_tabs(_0x02c1('0x51'),_0xfadbe6[_0x02c1('0x4c')]));_0x4b44df['push'](get_open_tabs('fax',_0xfadbe6[_0x02c1('0x4c')]));_0x4b44df[_0x02c1('0x4b')](get_open_tabs(_0x02c1('0x4f'),_0xfadbe6[_0x02c1('0x4c')]));return Promise[_0x02c1('0x52')](_0x4b44df);}else{return values;}})['then'](function(){return values;})[_0x02c1('0x19')](respondWithResult(_0xde201e,null))[_0x02c1('0x20')](handleError(_0xde201e,null));};exports[_0x02c1('0x5d')]=function(_0x265285,_0x26ba98){if(_0x265285[_0x02c1('0x5e')]['id']){delete _0x265285[_0x02c1('0x5e')]['id'];}delete _0x265285[_0x02c1('0x5e')][_0x02c1('0x2b')];return db['User'][_0x02c1('0x5b')]({'where':{'id':_0x265285[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x26ba98,null))[_0x02c1('0x19')](saveUpdates(_0x265285[_0x02c1('0x5e')],null))['then'](respondWithResult(_0x26ba98,null))[_0x02c1('0x20')](handleError(_0x26ba98,null));};exports[_0x02c1('0x60')]=function(_0x34474e,_0x292f9e){return db[_0x02c1('0x3a')][_0x02c1('0x60')]()[_0x02c1('0x19')](respondWithResult(_0x292f9e,null))[_0x02c1('0x20')](handleError(_0x292f9e,null));};exports[_0x02c1('0x61')]=function(_0x267e5c,_0x11b1c4){return db[_0x02c1('0x3a')][_0x02c1('0x5b')]({'where':{'id':_0x267e5c['params']['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x11b1c4,null))[_0x02c1('0x19')](function(_0x59f7b4){if(_0x59f7b4){return _0x59f7b4['addContacts'](_0x267e5c[_0x02c1('0x5e')][_0x02c1('0x62')],_[_0x02c1('0x63')](_0x267e5c[_0x02c1('0x5e')],[_0x02c1('0x62'),'id'])||{});}})['then'](respondWithResult(_0x11b1c4,null))[_0x02c1('0x20')](handleError(_0x11b1c4,null));};function validateUser(_0x59f85){return new Promise(function(_0x4e0141,_0x18e1a3){if(_0x59f85[_0x02c1('0x64')])return _0x4e0141(_0x59f85);return db[_0x02c1('0x65')][_0x02c1('0x66')](0x1)[_0x02c1('0x19')](function(_0x595840){if(_0x595840[_0x02c1('0x67')])authService['validatePasswordPattern'](_0x59f85[_0x02c1('0x3f')]);db[_0x02c1('0x3a')][_0x02c1('0x68')](_0x02c1('0x64'))[_0x02c1('0x19')](function(_0x43474c){if(_['isNil'](_0x43474c)){_0x59f85[_0x02c1('0x64')]=_0x595840[_0x02c1('0x69')]||0x1;return;}if(_[_0x02c1('0x6a')](_0x595840[_0x02c1('0x69')])||_0x595840[_0x02c1('0x69')]===_0x43474c){_0x59f85['internal']=_0x43474c+0x1;return;}if(_0x595840['min_internal']>_0x43474c){_0x59f85[_0x02c1('0x64')]=_0x595840[_0x02c1('0x69')];return;}return db[_0x02c1('0x6b')][_0x02c1('0x42')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x02c1('0x6b')][_0x02c1('0x6c')][_0x02c1('0x6d')]})[_0x02c1('0x19')](function(_0x49b9df){if(_0x49b9df&&_0x49b9df['length']){for(var _0x807680=0x0,_0x20b680=_0x49b9df[_0x02c1('0x4a')];_0x807680<_0x20b680&&_['isNil'](_0x59f85[_0x02c1('0x64')]);_0x807680++){if(_0x595840[_0x02c1('0x69')]<=_0x49b9df[_0x807680][_0x02c1('0x6e')]){_0x59f85['internal']=_0x49b9df[_0x807680][_0x02c1('0x6e')];}else if(_0x595840['min_internal']>_0x49b9df[_0x807680]['from']&&_0x595840['min_internal']<=_0x49b9df[_0x807680]['to']){_0x59f85[_0x02c1('0x64')]=_0x595840['min_internal'];}}}if(_['isNil'](_0x59f85[_0x02c1('0x64')])){_0x59f85['internal']=_0x43474c+0x1;}return _0x4e0141(_0x59f85);});});})[_0x02c1('0x20')](function(_0xac8a86){_0x18e1a3(_0xac8a86);});});}function updateUser(_0x15c3a2){return new Promise(function(_0x2d1a29,_0x699c1){try{if(_0x15c3a2['voicemail']){_0x15c3a2[_0x02c1('0x6f')]=_0x15c3a2[_0x02c1('0x64')];_0x15c3a2[_0x02c1('0x70')]={'mailbox':_0x15c3a2[_0x02c1('0x64')],'password':_0x15c3a2[_0x02c1('0x3f')],'fullname':_0x15c3a2[_0x02c1('0x71')],'email':_0x15c3a2['email']};}if(_0x15c3a2['role']==='agent'){if(!_0x15c3a2[_0x02c1('0x72')])_0x15c3a2[_0x02c1('0x72')]=[_0x02c1('0x73'),_0x02c1('0x74'),_0x02c1('0x75'),_0x02c1('0x76'),'110','104',_0x02c1('0x77'),_0x02c1('0x78'),_0x02c1('0x79'),'108',_0x02c1('0x7a'),_0x02c1('0x7b'),_0x02c1('0x7c'),_0x02c1('0x7d'),_0x02c1('0x7e')];}_0x2d1a29(_0x15c3a2);}catch(_0x10d8d4){_0x699c1(_0x10d8d4);}});}exports[_0x02c1('0x7f')]=function(_0x86ab0e,_0xc9cd01){if(_0x86ab0e['user'][_0x02c1('0x2b')]===_0x02c1('0x80'))throw new Error(_0x02c1('0x81'));if(_0x86ab0e[_0x02c1('0x5e')][_0x02c1('0x2b')]===_0x02c1('0x82')&&_0x86ab0e[_0x02c1('0x82')][_0x02c1('0x2b')]!==_0x02c1('0x83')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x86ab0e['body'][_0x02c1('0x2b')]===_0x02c1('0x83')&&_0x86ab0e[_0x02c1('0x82')][_0x02c1('0x2b')]!==_0x02c1('0x83')){throw new Error(_0x02c1('0x84'));}return licenseUtil['checkUserLimits']([_0x86ab0e[_0x02c1('0x5e')]])[_0x02c1('0x19')](function(){return validateUser(_0x86ab0e['body']);})[_0x02c1('0x19')](function(_0x55c55b){return updateUser(_0x55c55b)[_0x02c1('0x19')](function(_0x49c479){if(_0x49c479[_0x02c1('0x2b')]===_0x02c1('0x83')){_0x49c479[_0x02c1('0x85')]=_0x86ab0e[_0x02c1('0x82')][_0x02c1('0x85')];delete _0x49c479[_0x02c1('0x86')];}return _0x49c479;});})['then'](function(_0x6737bf){return db[_0x02c1('0x3a')]['create'](_0x6737bf,{'include':[{'model':db[_0x02c1('0x70')],'as':_0x02c1('0x70')}]});})[_0x02c1('0x19')](function(_0x4371ea){if(_0x86ab0e[_0x02c1('0x5e')][_0x02c1('0x2b')]===_0x02c1('0x82'))return _0x4371ea;if(_0x86ab0e[_0x02c1('0x82')][_0x02c1('0x2b')]!=='user')return _0x4371ea;return db[_0x02c1('0x87')]['find']({'where':{'name':_0x4371ea[_0x02c1('0x2b')]==='agent'?_0x02c1('0x88'):_0x02c1('0x2f'),'userProfileId':_0x86ab0e[_0x02c1('0x82')][_0x02c1('0x86')]},'raw':!![]})[_0x02c1('0x19')](function(_0x4e8ec4){if(!_0x4e8ec4||_0x4e8ec4[_0x02c1('0x89')]!=0x0)return _0x4371ea;return db[_0x02c1('0x37')][_0x02c1('0x7f')]({'name':_0x4371ea['name'],'resourceId':_0x4371ea['id'],'type':_0x4e8ec4['name'],'sectionId':_0x4e8ec4['id']},{})[_0x02c1('0x19')](function(){return _0x4371ea;});})[_0x02c1('0x20')](function(_0x212f54){logger[_0x02c1('0x1e')](_0x02c1('0x8a'),_0x212f54);throw _0x212f54;});})['then'](respondWithResult(_0xc9cd01,0xc9))[_0x02c1('0x20')](handleError(_0xc9cd01,null));};exports[_0x02c1('0x8b')]=function(_0x1ef68f,_0x2b582b){var _0x3ced0c=_0x1ef68f[_0x02c1('0x5e')];var _0x5b8de1=[];if(_0x1ef68f[_0x02c1('0x82')]['role']===_0x02c1('0x80'))throw new Error(_0x02c1('0x81'));if(_[_0x02c1('0x8c')](_0x3ced0c,['role','user'])&&_0x1ef68f['user'][_0x02c1('0x2b')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x02c1('0x8c')](_0x3ced0c,[_0x02c1('0x2b'),_0x02c1('0x83')])&&_0x1ef68f[_0x02c1('0x82')]['role']!==_0x02c1('0x83')){throw new Error(_0x02c1('0x8d'));}return licenseUtil['checkUserLimits'](_0x3ced0c)[_0x02c1('0x19')](function(){return validateUser(_0x3ced0c[0x0]);})[_0x02c1('0x19')](function(){for(var _0x4ed29b=0x1;_0x4ed29b<_0x3ced0c[_0x02c1('0x4a')];_0x4ed29b++){var _0xc8e289=_0x3ced0c[_0x4ed29b-0x1][_0x02c1('0x64')];if(!_0x3ced0c[_0x4ed29b][_0x02c1('0x64')])_0x3ced0c[_0x4ed29b][_0x02c1('0x64')]=_0xc8e289+0x1;_0x5b8de1[_0x02c1('0x4b')](validateUser(_0x3ced0c[_0x4ed29b]));}return Promise['all'](_0x5b8de1);})[_0x02c1('0x19')](function(){_0x5b8de1=[];for(var _0x28ca2f=0x0;_0x28ca2f<_0x3ced0c[_0x02c1('0x4a')];_0x28ca2f++){_0x5b8de1[_0x02c1('0x4b')](updateUser(_0x3ced0c[_0x28ca2f]));}return Promise['all'](_0x5b8de1);})[_0x02c1('0x19')](function(){_0x5b8de1=_0x3ced0c[_0x02c1('0x33')](function(_0x12854b){return db[_0x02c1('0x3a')]['create'](_0x12854b,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})['then'](function(_0xc99d1d){_0x12854b['id']=_0xc99d1d['id'];return _0x12854b;});});return Promise['all'](_0x5b8de1);})[_0x02c1('0x19')](function(_0x163845){if(_0x1ef68f[_0x02c1('0x5e')][_0x02c1('0x2b')]===_0x02c1('0x82'))return _0x163845;if(_0x1ef68f[_0x02c1('0x82')][_0x02c1('0x2b')]!=='user')return _0x163845;var _0x45b674=_['some'](_0x163845,function(_0x1188ad){return _0x1188ad['role']===_0x02c1('0x80')||_0x1188ad[_0x02c1('0x2b')]===_0x02c1('0x30');});if(!_0x45b674)return _0x163845;return db[_0x02c1('0x87')][_0x02c1('0x48')]({'where':{'name':{'$or':[_0x02c1('0x88'),_0x02c1('0x2f')]},'userProfileId':_0x1ef68f['user'][_0x02c1('0x86')]},'raw':!![]})[_0x02c1('0x19')](function(_0x10ed34){if(_[_0x02c1('0x8e')](_0x10ed34)||!_['some'](_0x10ed34,[_0x02c1('0x89'),0x0]))return _0x163845;_0x5b8de1=[];var _0x25bfc4=_(_0x10ed34)['map'](function(_0x5306c8){if(_0x5306c8[_0x02c1('0x89')]===0x1)return;return _0x5306c8[_0x02c1('0x36')]===_0x02c1('0x88')?_0x02c1('0x80'):_0x02c1('0x30');})['compact']()[_0x02c1('0x34')]();for(var _0x3c2669=0x0;_0x3c2669<_0x163845['length'];_0x3c2669++){if(!_[_0x02c1('0x35')](_0x25bfc4,_0x163845[_0x3c2669][_0x02c1('0x2b')]))return;var _0x18b105=_0x163845[_0x3c2669][_0x02c1('0x2b')]===_0x02c1('0x80')?'Agents':_0x02c1('0x2f');_0x5b8de1[_0x02c1('0x4b')](db['UserProfileResource'][_0x02c1('0x7f')]({'name':_0x163845[_0x3c2669][_0x02c1('0x36')],'resourceId':_0x163845[_0x3c2669]['id'],'type':_0x18b105,'sectionId':_['find'](_0x10ed34,[_0x02c1('0x36'),_0x18b105])['id']},{}));}return Promise['all'](_0x5b8de1);});})[_0x02c1('0x19')](respondWithResult(_0x2b582b,0xc9))[_0x02c1('0x20')](handleError(_0x2b582b,null));};exports[_0x02c1('0x8f')]=function(_0x12bb2b,_0x3e5a45){if(_0x12bb2b[_0x02c1('0x5e')]['id']){delete _0x12bb2b[_0x02c1('0x5e')]['id'];}return db[_0x02c1('0x3a')]['find']({'where':{'id':_0x12bb2b[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](function(_0x2946be){if(!_0x2946be)return null;if(_0x2946be['id']===_0x12bb2b[_0x02c1('0x82')]['id']){if(!_0x12bb2b[_0x02c1('0x5e')][_0x02c1('0x90')]||!_0x12bb2b['body']['newPassword']){throw new db[(_0x02c1('0x91'))][(_0x02c1('0x92'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x2946be[_0x02c1('0x93')](_0x12bb2b['body']['oldPassword'])){throw new db['Sequelize']['ValidationError'](_0x02c1('0x94'));}if(_0x12bb2b[_0x02c1('0x5e')][_0x02c1('0x90')]===_0x12bb2b[_0x02c1('0x5e')][_0x02c1('0x95')]){throw new db[(_0x02c1('0x91'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x12bb2b[_0x02c1('0x82')][_0x02c1('0x2b')]===_0x02c1('0x83')){if(!_0x12bb2b[_0x02c1('0x5e')]['newPassword']){throw new db[(_0x02c1('0x91'))][(_0x02c1('0x92'))](_0x02c1('0x96'));}}else if(_0x12bb2b[_0x02c1('0x82')][_0x02c1('0x2b')]==='user'){if(!_0x12bb2b[_0x02c1('0x5e')][_0x02c1('0x95')]){throw new db[(_0x02c1('0x91'))][(_0x02c1('0x92'))](_0x02c1('0x96'));}if(_0x2946be[_0x02c1('0x2b')]!==_0x02c1('0x80')){throw new db[(_0x02c1('0x91'))][(_0x02c1('0x92'))](_0x02c1('0x81'));}}else{throw new db[(_0x02c1('0x91'))][(_0x02c1('0x92'))]('Unauthorized');}return _0x2946be;})[_0x02c1('0x19')](handleEntityNotFound(_0x3e5a45,null))['then'](function(_0x205986){return db[_0x02c1('0x65')][_0x02c1('0x97')]({'attributes':['id',_0x02c1('0x67'),'enforcePasswordHistory',_0x02c1('0x98')]})[_0x02c1('0x19')](function(_0x49443f){if(_0x49443f[_0x02c1('0x67')])authService['validatePasswordPattern'](_0x12bb2b[_0x02c1('0x5e')][_0x02c1('0x95')]);if(!_0x49443f[_0x02c1('0x99')]||!_0x205986[_0x02c1('0x9a')])return _0x205986;authService[_0x02c1('0x9b')](_0x12bb2b['body'][_0x02c1('0x95')],_0x205986[_0x02c1('0x9a')],_0x49443f[_0x02c1('0x98')]);return _0x205986;})[_0x02c1('0x19')](saveUpdates({'password':_0x12bb2b[_0x02c1('0x5e')][_0x02c1('0x95')],'passwordResetAt':_0x12bb2b[_0x02c1('0x82')]['id']==_0x12bb2b[_0x02c1('0x5f')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x12bb2b['body'][_0x02c1('0x95')],_0x205986[_0x02c1('0x9a')])},null));})[_0x02c1('0x19')](respondWithResult(_0x3e5a45,null))[_0x02c1('0x20')](handleError(_0x3e5a45,null));};exports[_0x02c1('0x9c')]=function(_0x3de350,_0x3a5b7a){var _0x574001=_0x3de350[_0x02c1('0x5e')][_0x02c1('0x9d')];return db[_0x02c1('0x3a')]['find']({'where':{'id':_0x3de350['params']['id']},'attributes':['id',_0x02c1('0x36'),_0x02c1('0x2b'),_0x02c1('0x9e'),_0x02c1('0x9f'),_0x02c1('0xa0'),_0x02c1('0xa1')]})[_0x02c1('0x19')](handleEntityNotFound(_0x3a5b7a,null))[_0x02c1('0x19')](function(_0x16032b){if(_0x16032b){if(!utils['isValidChannel'](_0x574001)){throw new db['Sequelize'][(_0x02c1('0x92'))]('Unknown\x20channel');}return _0x16032b[_0x02c1('0xa2')+_[_0x02c1('0xa3')](_0x574001[_0x02c1('0xa4')]())+_0x02c1('0xa5')](_0x3de350['body'][_0x02c1('0x62')],{'penalty':_0x3de350['body'][_0x02c1('0xa6')]||0x0})[_0x02c1('0xa7')](function(_0x4b762f){for(var _0x3e13bf=0x0;_0x3e13bf<_0x3de350[_0x02c1('0x5e')][_0x02c1('0x62')][_0x02c1('0x4a')];_0x3e13bf+=0x1){var _0xfbd43f={'UserId':Number(_0x3de350[_0x02c1('0x5f')]['id'])};_0xfbd43f[_['capitalize'](_0x574001[_0x02c1('0xa4')]())+_0x02c1('0xa8')]=Number(_0x3de350['body']['ids'][_0x3e13bf]);socket[_0x02c1('0xa9')](_0x02c1('0x82')+_[_0x02c1('0xa3')](_0x574001[_0x02c1('0xa4')]())+_0x02c1('0xaa'),_0xfbd43f);}return _0x4b762f;})[_0x02c1('0x19')](function(){if(_0x574001==='voice'){return db['VoiceQueue'][_0x02c1('0x48')]({'where':{'id':_0x3de350[_0x02c1('0x5e')][_0x02c1('0x62')]||[]},'raw':!![],'attributes':['id',_0x02c1('0x36')]});}})['then'](function(_0x2461f1){var _0x2759b9=_0x16032b[_0x02c1('0x2d')]({'plain':!![]});var _0x6024d7=[];if(_0x574001===_0x02c1('0xab')&&_0x2759b9[_0x02c1('0x2b')]===_0x02c1('0x80')&&_0x2759b9[_0x02c1('0x9e')]){for(let _0x1df7ba=0x0;_0x1df7ba<_0x2461f1[_0x02c1('0x4a')];_0x1df7ba+=0x1){_0x6024d7[_0x02c1('0x4b')]({'membername':_0x2759b9[_0x02c1('0x36')],'UserId':_0x2759b9['id'],'queue_name':_0x2461f1[_0x1df7ba][_0x02c1('0x36')],'VoiceQueueId':_0x2461f1[_0x1df7ba]['id'],'interface':_[_0x02c1('0x6a')](_0x2759b9['interface'])?util[_0x02c1('0xac')](_0x02c1('0xad'),_0x2759b9['name']):_0x2759b9['interface'],'paused':_0x2759b9['voicePause']||![],'penalty':_0x3de350[_0x02c1('0x5e')][_0x02c1('0xa6')]||0x0});}return Promise[_0x02c1('0x52')](_0x6024d7[_0x02c1('0x33')](function(_0x20f049){return db[_0x02c1('0xae')][_0x02c1('0xaf')](_0x20f049);}));}return _0x16032b;});}})['then'](respondWithStatusCode(_0x3a5b7a,null))['catch'](handleError(_0x3a5b7a,null));};exports[_0x02c1('0xb0')]=function(_0x37bf7a,_0x3ffb9e){var _0x258c8e,_0x1c8547;return db[_0x02c1('0x3a')][_0x02c1('0x5b')]({'where':{'id':_0x37bf7a[_0x02c1('0x5f')]['id']},'attributes':['id',_0x02c1('0x36'),_0x02c1('0x2b')]})[_0x02c1('0x19')](handleEntityNotFound(_0x3ffb9e,null))[_0x02c1('0x19')](function(_0x1004e1){if(_0x1004e1){_0x258c8e=_0x1004e1;if(!_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x9d')]||!utils[_0x02c1('0xb1')](_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x9d')])){throw new db[(_0x02c1('0x91'))][(_0x02c1('0x92'))](_0x02c1('0xb2'));}return _0x1004e1[_0x02c1('0xb3')+_[_0x02c1('0xa3')](_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x9d')][_0x02c1('0xa4')]())+'Queues'](_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x62')]);}})[_0x02c1('0x19')](function(_0x36e7bc){if(_['isArray'](_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x62')])){for(var _0x4f8525=0x0;_0x4f8525<_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x62')][_0x02c1('0x4a')];_0x4f8525+=0x1){_0x1c8547={'UserId':Number(_0x37bf7a[_0x02c1('0x5f')]['id'])};_0x1c8547[_['capitalize'](_0x37bf7a['query'][_0x02c1('0x9d')][_0x02c1('0xa4')]())+'QueueId']=Number(_0x37bf7a[_0x02c1('0x42')]['ids'][_0x4f8525]);socket[_0x02c1('0xa9')]('user'+_[_0x02c1('0xa3')](_0x37bf7a['query']['channel'][_0x02c1('0xa4')]())+_0x02c1('0xb4'),_0x1c8547);}}else{_0x1c8547={'UserId':Number(_0x37bf7a['params']['id'])};_0x1c8547[_[_0x02c1('0xa3')](_0x37bf7a['query'][_0x02c1('0x9d')][_0x02c1('0xa4')]())+_0x02c1('0xa8')]=Number(_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x62')]);socket['emit'](_0x02c1('0x82')+_[_0x02c1('0xa3')](_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x9d')][_0x02c1('0xa4')]())+_0x02c1('0xb4'),_0x1c8547);}return _0x36e7bc;})[_0x02c1('0x19')](function(){if(_0x37bf7a['query']['channel']===_0x02c1('0xab')){return db[_0x02c1('0xae')][_0x02c1('0xb5')]({'where':{'UserId':_0x37bf7a[_0x02c1('0x5f')]['id'],'VoiceQueueId':_0x37bf7a[_0x02c1('0x42')][_0x02c1('0x62')]},'individualHooks':!![]})['then'](function(){return _0x258c8e;});}return _0x258c8e;})[_0x02c1('0x19')](respondWithStatusCode(_0x3ffb9e,null))['catch'](handleError(_0x3ffb9e,null));};exports[_0x02c1('0xb6')]=function(_0x39920e,_0x1f8e9d){_0x39920e[_0x02c1('0x5e')][_0x02c1('0xb7')]=_0x39920e[_0x02c1('0xb8')][_0x02c1('0xb9')];return db[_0x02c1('0x3a')]['find']({'where':{'id':_0x39920e['params']['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x1f8e9d,null))[_0x02c1('0x19')](saveUpdates(_0x39920e['body'],null))[_0x02c1('0x19')](respondWithResult(_0x1f8e9d,null))[_0x02c1('0x20')](handleError(_0x1f8e9d,null));};exports[_0x02c1('0xba')]=function(_0x116cfb,_0x276cc5){var _0x2a5486=path['join'](config[_0x02c1('0xbb')],_0x02c1('0xbc'));return db['User'][_0x02c1('0x5b')]({'where':{'id':_0x116cfb[_0x02c1('0x5f')]['id']},'attributes':['id',_0x02c1('0xb7')],'raw':!![]})[_0x02c1('0x19')](handleEntityNotFound(_0x276cc5,null))['then'](function(_0x3fce93){if(_0x3fce93){if(_[_0x02c1('0x6a')](_0x3fce93['userpic'])){return _0x276cc5[_0x02c1('0xbd')](_0x2a5486);}else{if(!fs[_0x02c1('0xbe')](path[_0x02c1('0xbf')](config[_0x02c1('0xbb')],_0x02c1('0xc0'),_0x3fce93[_0x02c1('0xb7')]))){return _0x276cc5[_0x02c1('0xbd')](_0x2a5486);}return _0x276cc5[_0x02c1('0xbd')](path[_0x02c1('0xbf')](config[_0x02c1('0xbb')],'server/files/images/',_0x3fce93['userpic']));}}})[_0x02c1('0x20')](handleError(_0x276cc5,null));};exports[_0x02c1('0xc1')]=function(_0xc65352,_0x58462c){return db[_0x02c1('0x3a')][_0x02c1('0x5b')]({'where':{'id':_0xc65352['params']['id']},'attributes':['id']})[_0x02c1('0x19')](handleEntityNotFound(_0x58462c,null))[_0x02c1('0x19')](function(_0x7358fb){var _0x2051b2=[];values=_0x7358fb['dataValues'];_0x2051b2['push'](get_open_tabs(_0x02c1('0xc2'),_0x7358fb[_0x02c1('0x4c')]));_0x2051b2[_0x02c1('0x4b')](get_open_tabs('sms',_0x7358fb[_0x02c1('0x4c')]));_0x2051b2[_0x02c1('0x4b')](get_open_tabs(_0x02c1('0x50'),_0x7358fb[_0x02c1('0x4c')]));_0x2051b2['push'](get_open_tabs(_0x02c1('0x51'),_0x7358fb[_0x02c1('0x4c')]));_0x2051b2[_0x02c1('0x4b')](get_open_tabs(_0x02c1('0x4e'),_0x7358fb[_0x02c1('0x4c')]));_0x2051b2[_0x02c1('0x4b')](get_open_tabs(_0x02c1('0x4f'),_0x7358fb[_0x02c1('0x4c')]));return Promise[_0x02c1('0x52')](_0x2051b2);})[_0x02c1('0x19')](function(_0x39dc30){if(_0x39dc30){var _0x1779de=_[_0x02c1('0x33')](values['ChatOpenTabs'],function(_0x2d1004){return{'channel':_0x02c1('0xc3'),'id':_0x2d1004['id'],'createdAt':_0x2d1004[_0x02c1('0xc4')]};});var _0x5344dd=_[_0x02c1('0x33')](values['FaxOpenTabs'],function(_0x2ba1e9){return{'channel':_0x02c1('0xc5'),'id':_0x2ba1e9['id'],'createdAt':_0x2ba1e9[_0x02c1('0xc4')]};});var _0x5129b0=_[_0x02c1('0x33')](values['OpenchannelOpenTabs'],function(_0x5a9122){return{'channel':'OPENCHANNEL','id':_0x5a9122['id'],'createdAt':_0x5a9122[_0x02c1('0xc4')]};});var _0x1ee71d=_[_0x02c1('0x33')](values['MailOpenTabs'],function(_0xea2848){return{'channel':_0x02c1('0xc6'),'id':_0xea2848['id'],'createdAt':_0xea2848[_0x02c1('0xc4')]};});var _0x5cad7d=_['map'](values[_0x02c1('0xc7')],function(_0x31e359){return{'channel':'SMS','id':_0x31e359['id'],'createdAt':_0x31e359[_0x02c1('0xc4')]};});var _0x1d956f=_['map'](values[_0x02c1('0xc8')],function(_0x38e85a){return{'channel':_0x02c1('0xc9'),'id':_0x38e85a['id'],'createdAt':_0x38e85a[_0x02c1('0xc4')]};});var _0x252359=_['concat'](_0x1779de,_0x5344dd,_0x5129b0,_0x1ee71d,_0x5cad7d,_0x1d956f);var _0x2abf81={'count':_0x252359['length'],'rows':_0x252359};return _0x2abf81;}else return null;})['then'](respondWithResult(_0x58462c,null))[_0x02c1('0x20')](handleError(_0x58462c,null));};exports[_0x02c1('0xca')]=function(_0x47fef6,_0x129e37){var _0x24d4c0={};return db[_0x02c1('0x3a')]['findOne']({'where':{'id':_0x47fef6[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](function(_0x1cdd1c){if(!_0x1cdd1c){throw new APINotFoundError(util['format'](_0x02c1('0xcb'),_0x47fef6[_0x02c1('0x5f')]['id']));}return contacts[_0x02c1('0x60')]();})[_0x02c1('0x19')](function(_0x5013b1){_0x47fef6[_0x02c1('0x42')][_0x02c1('0x3a')]=_0x47fef6[_0x02c1('0x5f')]['id'];_0x24d4c0=qs['getOptions'](_0x5013b1,_0x47fef6);if(_0x47fef6[_0x02c1('0x42')][_0x02c1('0xcc')](_0x02c1('0x43'))){_0x24d4c0[_0x02c1('0x44')]=[{'model':db[_0x02c1('0xcd')],'as':_0x02c1('0xce'),'required':![]},{'model':db[_0x02c1('0xcf')],'as':_0x02c1('0xd0'),'attributes':['id',_0x02c1('0x36'),_0x02c1('0xd1')],'where':_0x47fef6[_0x02c1('0x42')][_0x02c1('0xd2')]?{'id':_0x47fef6[_0x02c1('0x42')]['tag']}:undefined,'required':_0x47fef6[_0x02c1('0x42')][_0x02c1('0xd2')]?!![]:![]}];}return contacts[_0x02c1('0x48')](_0x47fef6['query'],_0x47fef6[_0x02c1('0x82')],_0x24d4c0,_0x5013b1);})[_0x02c1('0x19')](respondWithFilteredResult(_0x129e37,_0x24d4c0))[_0x02c1('0x20')](APIHandleError(_0x129e37));};exports['getQueues']=function(_0x4f04ba,_0x1cf0a8){var _0x35bebf;var _0x176d0d={};var _0x319963;return db[_0x02c1('0x3a')]['findOne']({'where':{'id':_0x4f04ba['params']['id']},'attributes':['id',_0x02c1('0x36'),_0x02c1('0x2b')]})['then'](handleEntityNotFound(_0x1cf0a8,null))[_0x02c1('0x19')](function(_0x412853){if(!utils[_0x02c1('0xb1')](_0x4f04ba[_0x02c1('0x42')][_0x02c1('0x9d')])){throw new db['Sequelize'][(_0x02c1('0x92'))](_0x02c1('0xb2'));}_0x35bebf=_0x412853;var _0x2732eb={};_0x2732eb[_0x02c1('0x54')]=_[_0x02c1('0x56')](db[_[_0x02c1('0xa3')](_0x4f04ba[_0x02c1('0x42')]['channel'])+'Queue'][_0x02c1('0x3b')]);_0x2732eb[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0x4f04ba[_0x02c1('0x42')]);_0x2732eb[_0x02c1('0x57')]=_[_0x02c1('0x58')](_0x2732eb[_0x02c1('0x54')],_0x2732eb[_0x02c1('0x42')]);_0x176d0d['attributes']=_[_0x02c1('0x58')](_0x2732eb['model'],qs[_0x02c1('0x5a')](_0x4f04ba[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x176d0d[_0x02c1('0x59')]=_0x176d0d[_0x02c1('0x59')]['length']?_0x176d0d['attributes']:_0x2732eb[_0x02c1('0x54')];_0x176d0d[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0x4f04ba[_0x02c1('0x42')][_0x02c1('0xd4')]);_0x176d0d[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_['pick'](_0x4f04ba['query'],_0x2732eb[_0x02c1('0x57')]));if(_0x4f04ba[_0x02c1('0x42')]['filter']){_0x176d0d[_0x02c1('0xd5')]=_['merge'](_0x176d0d[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x176d0d[_0x02c1('0x59')],function(_0x189b0a){var _0x226c40={};_0x226c40[_0x189b0a]={'$like':'%'+_0x4f04ba['query']['filter']+'%'};return _0x226c40;})});}_0x176d0d=_['merge']({},_0x176d0d,_0x4f04ba[_0x02c1('0xd6')]);switch(_0x35bebf[_0x02c1('0x2b')]){case'admin':return db[_[_0x02c1('0xa3')](_0x4f04ba[_0x02c1('0x42')][_0x02c1('0x9d')])+_0x02c1('0xd7')][_0x02c1('0x48')](_0x176d0d);case _0x02c1('0x82'):case _0x02c1('0x80'):return _0x35bebf['get'+_[_0x02c1('0xa3')](_0x4f04ba['query'][_0x02c1('0x9d')])+_0x02c1('0xa5')](_0x176d0d);default:throw new db[(_0x02c1('0x91'))][(_0x02c1('0x92'))](_0x02c1('0xd8'));}})[_0x02c1('0x19')](function(_0x1c5373){_0x319963=_0x1c5373[_0x02c1('0x4a')];if(!_0x4f04ba['query']['hasOwnProperty'](_0x02c1('0xd9'))){_0x176d0d['limit']=qs[_0x02c1('0x26')](_0x4f04ba[_0x02c1('0x42')]['limit']);_0x176d0d[_0x02c1('0x25')]=qs[_0x02c1('0x25')](_0x4f04ba['query'][_0x02c1('0x25')]);}switch(_0x35bebf['role']){case _0x02c1('0x83'):return db[_[_0x02c1('0xa3')](_0x4f04ba[_0x02c1('0x42')]['channel'])+_0x02c1('0xd7')][_0x02c1('0x48')](_0x176d0d);case _0x02c1('0x82'):case _0x02c1('0x80'):return _0x35bebf[_0x02c1('0x2d')+_[_0x02c1('0xa3')](_0x4f04ba['query'][_0x02c1('0x9d')])+_0x02c1('0xa5')](_0x176d0d);}})[_0x02c1('0x19')](function(_0x5b7ad1){return{'count':_0x319963,'rows':_0x5b7ad1};})['then'](respondWithResult(_0x1cf0a8,null))['catch'](handleError(_0x1cf0a8,null));};exports[_0x02c1('0xda')]=function(_0x2f072b,_0x473033){var _0x20bdc0={};var _0x13fe69={};var _0x33e8c2;var _0x33df92;return db[_0x02c1('0x3a')][_0x02c1('0x97')]({'where':{'id':_0x2f072b[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x473033,null))['then'](function(_0x270b39){if(_0x270b39){_0x33e8c2=_0x270b39;_0x13fe69[_0x02c1('0x54')]=_[_0x02c1('0x56')](db[_0x02c1('0xae')][_0x02c1('0x3b')]);_0x13fe69[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0x2f072b[_0x02c1('0x42')]);_0x13fe69[_0x02c1('0x57')]=_['intersection'](_0x13fe69[_0x02c1('0x54')],_0x13fe69['query']);_0x20bdc0[_0x02c1('0x59')]=_[_0x02c1('0x58')](_0x13fe69['model'],qs[_0x02c1('0x5a')](_0x2f072b[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x20bdc0[_0x02c1('0x59')]=_0x20bdc0[_0x02c1('0x59')]['length']?_0x20bdc0['attributes']:_0x13fe69[_0x02c1('0x54')];_0x20bdc0['order']=qs['sort'](_0x2f072b[_0x02c1('0x42')]['sort']);_0x20bdc0[_0x02c1('0xd5')]=qs['filters'](_[_0x02c1('0xdb')](_0x2f072b['query'],_0x13fe69[_0x02c1('0x57')]));if(_0x2f072b[_0x02c1('0x42')]['filter']){_0x20bdc0[_0x02c1('0xd5')]=_['merge'](_0x20bdc0['where'],{'$or':_[_0x02c1('0x33')](_0x20bdc0[_0x02c1('0x59')],function(_0x4f30ba){var _0x2a1546={};_0x2a1546[_0x4f30ba]={'$like':'%'+_0x2f072b[_0x02c1('0x42')]['filter']+'%'};return _0x2a1546;})});}_0x20bdc0=_[_0x02c1('0xdc')]({},_0x20bdc0,_0x2f072b[_0x02c1('0xd6')]);return _0x33e8c2[_0x02c1('0xda')](_0x20bdc0);}})[_0x02c1('0x19')](function(_0x14adaf){if(_0x14adaf){_0x33df92=_0x14adaf[_0x02c1('0x4a')];if(!_0x2f072b[_0x02c1('0x42')][_0x02c1('0xcc')](_0x02c1('0xd9'))){_0x20bdc0[_0x02c1('0x26')]=qs[_0x02c1('0x26')](_0x2f072b['query'][_0x02c1('0x26')]);_0x20bdc0[_0x02c1('0x25')]=qs[_0x02c1('0x25')](_0x2f072b['query'][_0x02c1('0x25')]);}return _0x33e8c2[_0x02c1('0xda')](_0x20bdc0);}})[_0x02c1('0x19')](function(_0x584835){if(_0x584835){return _0x584835?{'count':_0x33df92,'rows':_0x584835}:null;}})['then'](respondWithResult(_0x473033,null))[_0x02c1('0x20')](handleError(_0x473033,null));};exports[_0x02c1('0xdd')]=function(_0x20a413,_0x17a2e0){var _0x48e40d={};var _0x2f9c5a={};var _0x2ef173;var _0x450bd9;return db[_0x02c1('0x3a')]['findOne']({'where':{'id':_0x20a413[_0x02c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x17a2e0,null))[_0x02c1('0x19')](function(_0x53ccba){if(_0x53ccba){_0x2ef173=_0x53ccba;_0x2f9c5a[_0x02c1('0x54')]=_[_0x02c1('0x56')](db[_0x02c1('0xde')][_0x02c1('0x3b')]);_0x2f9c5a['query']=_['keys'](_0x20a413[_0x02c1('0x42')]);_0x2f9c5a[_0x02c1('0x57')]=_['intersection'](_0x2f9c5a['model'],_0x2f9c5a[_0x02c1('0x42')]);_0x48e40d[_0x02c1('0x59')]=_[_0x02c1('0x58')](_0x2f9c5a['model'],qs[_0x02c1('0x5a')](_0x20a413['query']['fields']));_0x48e40d['attributes']=_0x48e40d['attributes'][_0x02c1('0x4a')]?_0x48e40d[_0x02c1('0x59')]:_0x2f9c5a['model'];_0x48e40d[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0x20a413[_0x02c1('0x42')][_0x02c1('0xd4')]);_0x48e40d[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_['pick'](_0x20a413[_0x02c1('0x42')],_0x2f9c5a['filters']));if(_0x20a413[_0x02c1('0x42')]['filter']){_0x48e40d[_0x02c1('0xd5')]=_[_0x02c1('0xdc')](_0x48e40d[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x48e40d[_0x02c1('0x59')],function(_0xe6dd7c){var _0xdf0e78={};_0xdf0e78[_0xe6dd7c]={'$like':'%'+_0x20a413[_0x02c1('0x42')][_0x02c1('0x31')]+'%'};return _0xdf0e78;})});}_0x48e40d=_[_0x02c1('0xdc')]({},_0x48e40d,_0x20a413[_0x02c1('0xd6')]);return _0x2ef173[_0x02c1('0xdd')](_0x48e40d);}})[_0x02c1('0x19')](function(_0x264bd8){if(_0x264bd8){_0x450bd9=_0x264bd8['length'];if(!_0x20a413[_0x02c1('0x42')][_0x02c1('0xcc')](_0x02c1('0xd9'))){_0x48e40d['limit']=qs[_0x02c1('0x26')](_0x20a413[_0x02c1('0x42')][_0x02c1('0x26')]);_0x48e40d[_0x02c1('0x25')]=qs[_0x02c1('0x25')](_0x20a413[_0x02c1('0x42')][_0x02c1('0x25')]);}return _0x2ef173[_0x02c1('0xdd')](_0x48e40d);}})[_0x02c1('0x19')](function(_0x56af95){if(_0x56af95){return _0x56af95?{'count':_0x450bd9,'rows':_0x56af95}:null;}})['then'](respondWithResult(_0x17a2e0,null))[_0x02c1('0x20')](handleError(_0x17a2e0,null));};exports[_0x02c1('0xdf')]=function(_0x3adcca,_0x26420e){var _0x5a43c9={'raw':!![],'where':{}};var _0x59c740={};var _0x421c97={'count':0x0,'rows':[]};return db['User'][_0x02c1('0x97')]({'where':{'id':_0x3adcca['params']['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x26420e,null))[_0x02c1('0x19')](function(_0x4c5cde){if(_0x4c5cde){_0x59c740['model']=_['keys'](db[_0x02c1('0xe0')][_0x02c1('0x3b')]);_0x59c740[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0x3adcca[_0x02c1('0x42')]);_0x59c740[_0x02c1('0x57')]=_[_0x02c1('0x58')](_0x59c740[_0x02c1('0x54')],_0x59c740[_0x02c1('0x42')]);_0x5a43c9['attributes']=_[_0x02c1('0x58')](_0x59c740['model'],qs[_0x02c1('0x5a')](_0x3adcca[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x5a43c9[_0x02c1('0x59')]=_0x5a43c9[_0x02c1('0x59')]['length']?_0x5a43c9[_0x02c1('0x59')]:_0x59c740[_0x02c1('0x54')];if(!_0x3adcca[_0x02c1('0x42')][_0x02c1('0xcc')](_0x02c1('0xd9'))){_0x5a43c9[_0x02c1('0x26')]=qs[_0x02c1('0x26')](_0x3adcca[_0x02c1('0x42')][_0x02c1('0x26')]);_0x5a43c9[_0x02c1('0x25')]=qs[_0x02c1('0x25')](_0x3adcca[_0x02c1('0x42')]['offset']);}_0x5a43c9[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0x3adcca[_0x02c1('0x42')][_0x02c1('0xd4')]);_0x5a43c9[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_[_0x02c1('0xdb')](_0x3adcca[_0x02c1('0x42')],_0x59c740[_0x02c1('0x57')]));_0x5a43c9[_0x02c1('0xd5')][_0x02c1('0xe1')]=_0x4c5cde['id'];if(_0x3adcca[_0x02c1('0x42')][_0x02c1('0x31')]){_0x5a43c9['where']=_['merge'](_0x5a43c9[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x5a43c9['attributes'],function(_0x243875){var _0x405cde={};_0x405cde[_0x243875]={'$like':'%'+_0x3adcca[_0x02c1('0x42')][_0x02c1('0x31')]+'%'};return _0x405cde;})});}_0x5a43c9=_[_0x02c1('0xdc')]({},_0x5a43c9,_0x3adcca[_0x02c1('0xd6')]);return db[_0x02c1('0xe0')][_0x02c1('0x28')]({'where':_0x5a43c9[_0x02c1('0xd5')]})[_0x02c1('0x19')](function(_0x2e51b0){_0x421c97[_0x02c1('0x28')]=_0x2e51b0;if(_0x3adcca[_0x02c1('0x42')][_0x02c1('0x43')]){_0x5a43c9[_0x02c1('0x44')]=[{'all':!![]}];}return db[_0x02c1('0xe0')][_0x02c1('0x48')](_0x5a43c9);})[_0x02c1('0x19')](function(_0x4103fa){_0x421c97[_0x02c1('0x49')]=_0x4103fa;return _0x421c97;});}})[_0x02c1('0x19')](respondWithFilteredResult(_0x26420e,_0x5a43c9))[_0x02c1('0x20')](handleError(_0x26420e,null));};exports[_0x02c1('0xe2')]=function(_0xb96e62,_0x10a563){var _0x55b7d8={'raw':!![],'where':{}};var _0x25c501={};var _0x299cea={'count':0x0,'rows':[]};return db[_0x02c1('0x3a')]['findOne']({'where':{'id':_0xb96e62[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x10a563,null))[_0x02c1('0x19')](function(_0x358da4){if(_0x358da4){_0x25c501[_0x02c1('0x54')]=_['keys'](db[_0x02c1('0xe3')][_0x02c1('0x3b')]);_0x25c501[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0xb96e62['query']);_0x25c501[_0x02c1('0x57')]=_[_0x02c1('0x58')](_0x25c501[_0x02c1('0x54')],_0x25c501[_0x02c1('0x42')]);_0x55b7d8['attributes']=_[_0x02c1('0x58')](_0x25c501['model'],qs['fields'](_0xb96e62[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x55b7d8[_0x02c1('0x59')]=_0x55b7d8[_0x02c1('0x59')][_0x02c1('0x4a')]?_0x55b7d8[_0x02c1('0x59')]:_0x25c501[_0x02c1('0x54')];if(!_0xb96e62['query'][_0x02c1('0xcc')]('nolimit')){_0x55b7d8[_0x02c1('0x26')]=qs[_0x02c1('0x26')](_0xb96e62[_0x02c1('0x42')]['limit']);_0x55b7d8[_0x02c1('0x25')]=qs['offset'](_0xb96e62[_0x02c1('0x42')][_0x02c1('0x25')]);}_0x55b7d8[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0xb96e62[_0x02c1('0x42')][_0x02c1('0xd4')]);_0x55b7d8[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_[_0x02c1('0xdb')](_0xb96e62[_0x02c1('0x42')],_0x25c501[_0x02c1('0x57')]));_0x55b7d8[_0x02c1('0xd5')]['UserId']=_0x358da4['id'];if(_0xb96e62[_0x02c1('0x42')]['filter']){_0x55b7d8[_0x02c1('0xd5')]=_['merge'](_0x55b7d8[_0x02c1('0xd5')],{'$or':_['map'](_0x55b7d8['attributes'],function(_0x2c29ff){var _0x5b0199={};_0x5b0199[_0x2c29ff]={'$like':'%'+_0xb96e62[_0x02c1('0x42')][_0x02c1('0x31')]+'%'};return _0x5b0199;})});}_0x55b7d8=_[_0x02c1('0xdc')]({},_0x55b7d8,_0xb96e62[_0x02c1('0xd6')]);return db[_0x02c1('0xe3')][_0x02c1('0x28')]({'where':_0x55b7d8[_0x02c1('0xd5')]})['then'](function(_0xace3d0){_0x299cea[_0x02c1('0x28')]=_0xace3d0;if(_0xb96e62[_0x02c1('0x42')][_0x02c1('0x43')]){_0x55b7d8[_0x02c1('0x44')]=[{'all':!![]}];}return db[_0x02c1('0xe3')][_0x02c1('0x48')](_0x55b7d8);})[_0x02c1('0x19')](function(_0x3cdbb9){_0x299cea[_0x02c1('0x49')]=_0x3cdbb9;return _0x299cea;});}})[_0x02c1('0x19')](respondWithFilteredResult(_0x10a563,_0x55b7d8))[_0x02c1('0x20')](handleError(_0x10a563,null));};exports[_0x02c1('0xe4')]=function(_0xcdb2e9,_0x16662b){var _0x304d69={};var _0x401b5a={};var _0x40e6e6;var _0x5e18b0;return db[_0x02c1('0x3a')][_0x02c1('0x97')]({'where':{'id':_0xcdb2e9[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x16662b,null))[_0x02c1('0x19')](function(_0x4d3b0c){if(_0x4d3b0c){_0x40e6e6=_0x4d3b0c;_0x401b5a[_0x02c1('0x54')]=_[_0x02c1('0x56')](db[_0x02c1('0xe5')][_0x02c1('0x3b')]);_0x401b5a[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0xcdb2e9[_0x02c1('0x42')]);_0x401b5a['filters']=_[_0x02c1('0x58')](_0x401b5a[_0x02c1('0x54')],_0x401b5a['query']);_0x304d69[_0x02c1('0x59')]=_[_0x02c1('0x58')](_0x401b5a['model'],qs[_0x02c1('0x5a')](_0xcdb2e9[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x304d69[_0x02c1('0x59')]=_0x304d69[_0x02c1('0x59')][_0x02c1('0x4a')]?_0x304d69[_0x02c1('0x59')]:_0x401b5a[_0x02c1('0x54')];_0x304d69[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0xcdb2e9['query'][_0x02c1('0xd4')]);_0x304d69['where']=qs[_0x02c1('0x57')](_['pick'](_0xcdb2e9['query'],_0x401b5a[_0x02c1('0x57')]));if(_0xcdb2e9[_0x02c1('0x42')]['filter']){_0x304d69[_0x02c1('0xd5')]=_[_0x02c1('0xdc')](_0x304d69[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x304d69[_0x02c1('0x59')],function(_0x4e8477){var _0x3cc730={};_0x3cc730[_0x4e8477]={'$like':'%'+_0xcdb2e9['query']['filter']+'%'};return _0x3cc730;})});}_0x304d69=_[_0x02c1('0xdc')]({},_0x304d69,_0xcdb2e9[_0x02c1('0xd6')]);return _0x40e6e6['getChatInteractions'](_0x304d69);}})[_0x02c1('0x19')](function(_0x4b4473){if(_0x4b4473){_0x5e18b0=_0x4b4473[_0x02c1('0x4a')];if(!_0xcdb2e9[_0x02c1('0x42')][_0x02c1('0xcc')](_0x02c1('0xd9'))){_0x304d69[_0x02c1('0x26')]=qs[_0x02c1('0x26')](_0xcdb2e9[_0x02c1('0x42')][_0x02c1('0x26')]);_0x304d69[_0x02c1('0x25')]=qs[_0x02c1('0x25')](_0xcdb2e9[_0x02c1('0x42')]['offset']);}return _0x40e6e6[_0x02c1('0xe4')](_0x304d69);}})[_0x02c1('0x19')](function(_0x36083c){if(_0x36083c){return _0x36083c?{'count':_0x5e18b0,'rows':_0x36083c}:null;}})['then'](respondWithResult(_0x16662b,null))[_0x02c1('0x20')](handleError(_0x16662b,null));};exports[_0x02c1('0xe6')]=function(_0x3ba456,_0x462220){var _0x2817e0={};var _0x3ea5ed={};var _0x3c1e91;var _0x3c6529;return db['User']['findOne']({'where':{'id':_0x3ba456[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x462220,null))[_0x02c1('0x19')](function(_0x173063){if(_0x173063){_0x3c1e91=_0x173063;_0x3ea5ed[_0x02c1('0x54')]=_[_0x02c1('0x56')](db[_0x02c1('0xe7')][_0x02c1('0x3b')]);_0x3ea5ed['query']=_[_0x02c1('0x56')](_0x3ba456[_0x02c1('0x42')]);_0x3ea5ed['filters']=_['intersection'](_0x3ea5ed[_0x02c1('0x54')],_0x3ea5ed[_0x02c1('0x42')]);_0x2817e0['attributes']=_[_0x02c1('0x58')](_0x3ea5ed[_0x02c1('0x54')],qs[_0x02c1('0x5a')](_0x3ba456[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x2817e0['attributes']=_0x2817e0[_0x02c1('0x59')][_0x02c1('0x4a')]?_0x2817e0[_0x02c1('0x59')]:_0x3ea5ed['model'];_0x2817e0[_0x02c1('0xd3')]=qs['sort'](_0x3ba456['query'][_0x02c1('0xd4')]);_0x2817e0[_0x02c1('0xd5')]=qs['filters'](_['pick'](_0x3ba456['query'],_0x3ea5ed[_0x02c1('0x57')]));if(_0x3ba456['query'][_0x02c1('0x31')]){_0x2817e0[_0x02c1('0xd5')]=_['merge'](_0x2817e0[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x2817e0[_0x02c1('0x59')],function(_0x5d1be1){var _0x15532e={};_0x15532e[_0x5d1be1]={'$like':'%'+_0x3ba456[_0x02c1('0x42')][_0x02c1('0x31')]+'%'};return _0x15532e;})});}_0x2817e0=_[_0x02c1('0xdc')]({},_0x2817e0,_0x3ba456[_0x02c1('0xd6')]);return _0x3c1e91[_0x02c1('0xe6')](_0x2817e0);}})[_0x02c1('0x19')](function(_0xec8392){if(_0xec8392){_0x3c6529=_0xec8392[_0x02c1('0x4a')];if(!_0x3ba456['query'][_0x02c1('0xcc')]('nolimit')){_0x2817e0[_0x02c1('0x26')]=qs[_0x02c1('0x26')](_0x3ba456[_0x02c1('0x42')][_0x02c1('0x26')]);_0x2817e0[_0x02c1('0x25')]=qs[_0x02c1('0x25')](_0x3ba456['query'][_0x02c1('0x25')]);}return _0x3c1e91[_0x02c1('0xe6')](_0x2817e0);}})[_0x02c1('0x19')](function(_0x5c3a5d){if(_0x5c3a5d){return _0x5c3a5d?{'count':_0x3c6529,'rows':_0x5c3a5d}:null;}})[_0x02c1('0x19')](respondWithResult(_0x462220,null))[_0x02c1('0x20')](handleError(_0x462220,null));};exports[_0x02c1('0xe8')]=function(_0xef6cca,_0x1c5246){var _0x20a697={'raw':!![],'where':{}};var _0x54f395={};var _0x1ca1ad={'count':0x0,'rows':[]};return db[_0x02c1('0x3a')][_0x02c1('0x97')]({'where':{'id':_0xef6cca[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x1c5246,null))['then'](function(_0x398219){if(_0x398219){_0x54f395['model']=_[_0x02c1('0x56')](db[_0x02c1('0xe9')][_0x02c1('0x3b')]);_0x54f395[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0xef6cca[_0x02c1('0x42')]);_0x54f395[_0x02c1('0x57')]=_['intersection'](_0x54f395[_0x02c1('0x54')],_0x54f395[_0x02c1('0x42')]);_0x20a697[_0x02c1('0x59')]=_[_0x02c1('0x58')](_0x54f395['model'],qs[_0x02c1('0x5a')](_0xef6cca['query'][_0x02c1('0x5a')]));_0x20a697[_0x02c1('0x59')]=_0x20a697[_0x02c1('0x59')][_0x02c1('0x4a')]?_0x20a697[_0x02c1('0x59')]:_0x54f395[_0x02c1('0x54')];if(!_0xef6cca[_0x02c1('0x42')]['hasOwnProperty'](_0x02c1('0xd9'))){_0x20a697['limit']=qs['limit'](_0xef6cca[_0x02c1('0x42')][_0x02c1('0x26')]);_0x20a697['offset']=qs[_0x02c1('0x25')](_0xef6cca[_0x02c1('0x42')]['offset']);}_0x20a697['order']=qs[_0x02c1('0xd4')](_0xef6cca[_0x02c1('0x42')][_0x02c1('0xd4')]);_0x20a697[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_[_0x02c1('0xdb')](_0xef6cca['query'],_0x54f395[_0x02c1('0x57')]));_0x20a697['where'][_0x02c1('0xe1')]=_0x398219['id'];if(_0xef6cca[_0x02c1('0x42')]['filter']){_0x20a697[_0x02c1('0xd5')]=_['merge'](_0x20a697[_0x02c1('0xd5')],{'$or':_['map'](_0x20a697[_0x02c1('0x59')],function(_0x2edd69){var _0x1edb9c={};_0x1edb9c[_0x2edd69]={'$like':'%'+_0xef6cca[_0x02c1('0x42')][_0x02c1('0x31')]+'%'};return _0x1edb9c;})});}_0x20a697=_['merge']({},_0x20a697,_0xef6cca[_0x02c1('0xd6')]);return db[_0x02c1('0xe9')][_0x02c1('0x28')]({'where':_0x20a697[_0x02c1('0xd5')]})['then'](function(_0x573296){_0x1ca1ad[_0x02c1('0x28')]=_0x573296;if(_0xef6cca[_0x02c1('0x42')][_0x02c1('0x43')]){_0x20a697['include']=[{'all':!![]}];}return db['MailInteraction'][_0x02c1('0x48')](_0x20a697);})[_0x02c1('0x19')](function(_0x11707a){_0x1ca1ad['rows']=_0x11707a;return _0x1ca1ad;});}})[_0x02c1('0x19')](respondWithFilteredResult(_0x1c5246,_0x20a697))[_0x02c1('0x20')](handleError(_0x1c5246,null));};exports[_0x02c1('0xea')]=function(_0x4b4ff2,_0x4910cb){var _0x3addb6={};var _0x40b75c={};var _0x44a624;var _0x521516;return db['User'][_0x02c1('0x97')]({'where':{'id':_0x4b4ff2[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x4910cb,null))[_0x02c1('0x19')](function(_0xb48c59){if(_0xb48c59){_0x44a624=_0xb48c59;_0x40b75c[_0x02c1('0x54')]=_[_0x02c1('0x56')](db[_0x02c1('0xeb')][_0x02c1('0x3b')]);_0x40b75c[_0x02c1('0x42')]=_['keys'](_0x4b4ff2['query']);_0x40b75c[_0x02c1('0x57')]=_[_0x02c1('0x58')](_0x40b75c['model'],_0x40b75c['query']);_0x3addb6[_0x02c1('0x59')]=_[_0x02c1('0x58')](_0x40b75c[_0x02c1('0x54')],qs['fields'](_0x4b4ff2['query'][_0x02c1('0x5a')]));_0x3addb6['attributes']=_0x3addb6[_0x02c1('0x59')][_0x02c1('0x4a')]?_0x3addb6[_0x02c1('0x59')]:_0x40b75c[_0x02c1('0x54')];_0x3addb6[_0x02c1('0xd3')]=qs['sort'](_0x4b4ff2[_0x02c1('0x42')][_0x02c1('0xd4')]);_0x3addb6[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_[_0x02c1('0xdb')](_0x4b4ff2[_0x02c1('0x42')],_0x40b75c[_0x02c1('0x57')]));if(_0x4b4ff2[_0x02c1('0x42')][_0x02c1('0x31')]){_0x3addb6[_0x02c1('0xd5')]=_[_0x02c1('0xdc')](_0x3addb6[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x3addb6[_0x02c1('0x59')],function(_0x1550ee){var _0x3aa24a={};_0x3aa24a[_0x1550ee]={'$like':'%'+_0x4b4ff2['query'][_0x02c1('0x31')]+'%'};return _0x3aa24a;})});}_0x3addb6=_[_0x02c1('0xdc')]({},_0x3addb6,_0x4b4ff2[_0x02c1('0xd6')]);return _0x44a624[_0x02c1('0xea')](_0x3addb6);}})[_0x02c1('0x19')](function(_0x4629d0){if(_0x4629d0){_0x521516=_0x4629d0[_0x02c1('0x4a')];if(!_0x4b4ff2[_0x02c1('0x42')][_0x02c1('0xcc')](_0x02c1('0xd9'))){_0x3addb6['limit']=qs[_0x02c1('0x26')](_0x4b4ff2['query']['limit']);_0x3addb6[_0x02c1('0x25')]=qs['offset'](_0x4b4ff2['query'][_0x02c1('0x25')]);}return _0x44a624['getSmsInteractions'](_0x3addb6);}})[_0x02c1('0x19')](function(_0x39ee69){if(_0x39ee69){return _0x39ee69?{'count':_0x521516,'rows':_0x39ee69}:null;}})[_0x02c1('0x19')](respondWithResult(_0x4910cb,null))[_0x02c1('0x20')](handleError(_0x4910cb,null));};exports['getFaxInteractions']=function(_0x3b3f95,_0x5ed72d){var _0x1f76cf={};var _0x4dab10={};var _0x5c2311;var _0x14b17f;return db[_0x02c1('0x3a')][_0x02c1('0x97')]({'where':{'id':_0x3b3f95['params']['id']}})['then'](handleEntityNotFound(_0x5ed72d,null))[_0x02c1('0x19')](function(_0x5d7bf1){if(_0x5d7bf1){_0x5c2311=_0x5d7bf1;_0x4dab10[_0x02c1('0x54')]=_[_0x02c1('0x56')](db[_0x02c1('0xec')][_0x02c1('0x3b')]);_0x4dab10[_0x02c1('0x42')]=_['keys'](_0x3b3f95[_0x02c1('0x42')]);_0x4dab10[_0x02c1('0x57')]=_['intersection'](_0x4dab10[_0x02c1('0x54')],_0x4dab10[_0x02c1('0x42')]);_0x1f76cf[_0x02c1('0x59')]=_[_0x02c1('0x58')](_0x4dab10[_0x02c1('0x54')],qs['fields'](_0x3b3f95[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x1f76cf[_0x02c1('0x59')]=_0x1f76cf[_0x02c1('0x59')][_0x02c1('0x4a')]?_0x1f76cf[_0x02c1('0x59')]:_0x4dab10[_0x02c1('0x54')];_0x1f76cf[_0x02c1('0xd3')]=qs['sort'](_0x3b3f95['query']['sort']);_0x1f76cf[_0x02c1('0xd5')]=qs['filters'](_['pick'](_0x3b3f95[_0x02c1('0x42')],_0x4dab10['filters']));if(_0x3b3f95[_0x02c1('0x42')][_0x02c1('0x31')]){_0x1f76cf['where']=_[_0x02c1('0xdc')](_0x1f76cf[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x1f76cf[_0x02c1('0x59')],function(_0x263d22){var _0x17475a={};_0x17475a[_0x263d22]={'$like':'%'+_0x3b3f95['query'][_0x02c1('0x31')]+'%'};return _0x17475a;})});}_0x1f76cf=_[_0x02c1('0xdc')]({},_0x1f76cf,_0x3b3f95[_0x02c1('0xd6')]);return _0x5c2311[_0x02c1('0xed')](_0x1f76cf);}})[_0x02c1('0x19')](function(_0x469907){if(_0x469907){_0x14b17f=_0x469907[_0x02c1('0x4a')];if(!_0x3b3f95[_0x02c1('0x42')]['hasOwnProperty'](_0x02c1('0xd9'))){_0x1f76cf[_0x02c1('0x26')]=qs[_0x02c1('0x26')](_0x3b3f95['query'][_0x02c1('0x26')]);_0x1f76cf[_0x02c1('0x25')]=qs[_0x02c1('0x25')](_0x3b3f95[_0x02c1('0x42')][_0x02c1('0x25')]);}return _0x5c2311[_0x02c1('0xed')](_0x1f76cf);}})['then'](function(_0x41eac7){if(_0x41eac7){return _0x41eac7?{'count':_0x14b17f,'rows':_0x41eac7}:null;}})[_0x02c1('0x19')](respondWithResult(_0x5ed72d,null))[_0x02c1('0x20')](handleError(_0x5ed72d,null));};exports[_0x02c1('0xee')]=function(_0x4d27b5,_0x1cc33c){var _0x1e2eaa={};var _0xd7b3e={};var _0x196e91;var _0xd6b290;return db[_0x02c1('0x3a')]['findOne']({'where':{'id':_0x4d27b5[_0x02c1('0x5f')]['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x1cc33c,null))['then'](function(_0x2aef64){if(_0x2aef64){_0x196e91=_0x2aef64;_0xd7b3e[_0x02c1('0x54')]=_[_0x02c1('0x56')](db[_0x02c1('0xef')][_0x02c1('0x3b')]);_0xd7b3e[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0x4d27b5['query']);_0xd7b3e['filters']=_['intersection'](_0xd7b3e[_0x02c1('0x54')],_0xd7b3e[_0x02c1('0x42')]);_0x1e2eaa[_0x02c1('0x59')]=_['intersection'](_0xd7b3e['model'],qs[_0x02c1('0x5a')](_0x4d27b5[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x1e2eaa[_0x02c1('0x59')]=_0x1e2eaa['attributes'][_0x02c1('0x4a')]?_0x1e2eaa['attributes']:_0xd7b3e['model'];_0x1e2eaa[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0x4d27b5['query'][_0x02c1('0xd4')]);_0x1e2eaa[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_[_0x02c1('0xdb')](_0x4d27b5['query'],_0xd7b3e[_0x02c1('0x57')]));if(_0x4d27b5[_0x02c1('0x42')][_0x02c1('0x31')]){_0x1e2eaa[_0x02c1('0xd5')]=_[_0x02c1('0xdc')](_0x1e2eaa[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x1e2eaa[_0x02c1('0x59')],function(_0x517092){var _0x3a9a16={};_0x3a9a16[_0x517092]={'$like':'%'+_0x4d27b5['query']['filter']+'%'};return _0x3a9a16;})});}_0x1e2eaa=_['merge']({},_0x1e2eaa,_0x4d27b5[_0x02c1('0xd6')]);return _0x196e91['getWhatsappInteractions'](_0x1e2eaa);}})[_0x02c1('0x19')](function(_0x5d6222){if(_0x5d6222){_0xd6b290=_0x5d6222[_0x02c1('0x4a')];if(!_0x4d27b5['query'][_0x02c1('0xcc')](_0x02c1('0xd9'))){_0x1e2eaa['limit']=qs[_0x02c1('0x26')](_0x4d27b5[_0x02c1('0x42')][_0x02c1('0x26')]);_0x1e2eaa[_0x02c1('0x25')]=qs['offset'](_0x4d27b5['query'][_0x02c1('0x25')]);}return _0x196e91[_0x02c1('0xee')](_0x1e2eaa);}})[_0x02c1('0x19')](function(_0x19f287){if(_0x19f287){return _0x19f287?{'count':_0xd6b290,'rows':_0x19f287}:null;}})['then'](respondWithResult(_0x1cc33c,null))[_0x02c1('0x20')](handleError(_0x1cc33c,null));};exports[_0x02c1('0xf0')]=function(_0x56f451,_0x5dd9a3,_0x3ca6c4){var _0x536862;var _0xe9e583;var _0x4031fd;var _0x46bb1c=!_['isNil'](_0x56f451[_0x02c1('0x5f')]['id'])?_0x56f451[_0x02c1('0x5f')]['id']:!_[_0x02c1('0x6a')](_0x56f451[_0x02c1('0x82')]['id'])?_0x56f451[_0x02c1('0x82')]['id']:null;return db[_0x02c1('0x3a')]['find']({'where':{'id':_0x46bb1c,'role':{'$or':[_0x02c1('0x83'),'user',_0x02c1('0x80')]}},'attributes':['id',_0x02c1('0x36'),'phone','mobile',_0x02c1('0x2b'),_0x02c1('0x64'),'loginInPause']})[_0x02c1('0x19')](function(_0x42f071){if(_0x42f071){if(_0x42f071[_0x02c1('0x2b')]===_0x02c1('0x80')){_0x536862=_0x42f071;if(_0x56f451[_0x02c1('0x5e')]['interface']){_0x4031fd=util[_0x02c1('0xac')](_0x02c1('0xf1'),_0x536862[_0x56f451[_0x02c1('0x5e')][_0x02c1('0xa1')]]);}else if(_0x56f451[_0x02c1('0x5e')][_0x02c1('0xf2')]){_0x4031fd=util[_0x02c1('0xac')](_0x02c1('0xad'),_0x56f451['body']['intrf']);}else{_0x4031fd=util[_0x02c1('0xac')](_0x02c1('0xad'),_0x536862[_0x02c1('0x36')]);}socket['to'](util[_0x02c1('0xac')](_0x02c1('0xf3'),_0x536862[_0x02c1('0x36')]))[_0x02c1('0xa9')](_0x02c1('0xf4'),{'user':{'id':_0x536862['id'],'name':_0x536862['name']},'ip':_0x56f451[_0x02c1('0xf5')][_0x02c1('0xf6')]||_0x56f451[_0x02c1('0xf7')]['remoteAddress']||_0x56f451[_0x02c1('0xf8')]['remoteAddress']||_0x56f451['connection'][_0x02c1('0xf8')]['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x536862[_0x02c1('0x36')]},'individualHooks':!![]});}}else{throw new db[(_0x02c1('0x91'))]['ValidationError'](_0x02c1('0xf9'));}})['then'](function(){if(_0x536862){return _0x536862[_0x02c1('0xfa')]({'raw':!![]});}})[_0x02c1('0x19')](function(_0x359b33){if(_0x536862){if(_0x359b33){_0xe9e583=_0x359b33;if(_0xe9e583[_0x02c1('0x4a')]){var _0xc6ac38=_0xe9e583['map'](function(_0x4fde4e){var _0x2915b8={'membername':_0x536862[_0x02c1('0x36')],'UserId':_0x536862['id'],'queue_name':_0x4fde4e[_0x02c1('0x36')],'VoiceQueueId':_0x4fde4e['id'],'interface':_0x4031fd,'paused':_0x536862[_0x02c1('0x9f')]||![],'penalty':_0x4fde4e[_0x02c1('0xfb')]||0x0};return db[_0x02c1('0xae')][_0x02c1('0xaf')](_0x2915b8);});return Promise[_0x02c1('0x52')](_0xc6ac38);}}}})[_0x02c1('0x19')](function(){if(_0x536862){return db['MemberReport'][_0x02c1('0x48')]({'where':{'membername':_0x536862[_0x02c1('0x36')],'exitAt':null}});}})[_0x02c1('0x19')](function(_0x76797d){if(_0x536862){var _0x4bf281=[];_0x76797d['forEach'](function(_0x5d573d){_0x4bf281['push'](_0x5d573d['update']({'exitAt':moment()[_0x02c1('0xac')](_0x02c1('0xfc'))}));});return Promise[_0x02c1('0x52')](_0x4bf281);}})[_0x02c1('0x19')](function(){if(_0x536862){var _0x5dde8c=[];var _0x5bbcbd=[];var _0x298fba=utils[_0x02c1('0xfd')]();var _0x52cc5a={'membername':_0x536862[_0x02c1('0x36')],'interface':_0x4031fd,'enterAt':moment()['format'](_0x02c1('0xfc')),'role':_0x536862[_0x02c1('0x2b')],'internal':_0x536862['internal']};_0x298fba[_0x02c1('0xfe')](function(_0x13d194){_0x5dde8c[_0x02c1('0x4b')](_['merge']({'channel':_0x13d194,'type':_0x02c1('0xff'),'data1':_0x56f451[_0x02c1('0x5e')][_0x02c1('0x100')],'data2':_0x4031fd},_0x52cc5a));if(_0x536862[_0x02c1('0x9f')]){_0x5bbcbd[_0x02c1('0x4b')](_[_0x02c1('0xdc')]({'channel':_0x13d194,'type':_0x02c1('0x101'),'data1':_0x02c1('0x102')},_0x52cc5a));}});return db[_0x02c1('0x103')][_0x02c1('0x8b')](_0x5dde8c[_0x02c1('0x104')](_0x5bbcbd),{'individualHooks':!![]});}})[_0x02c1('0x19')](function(){if(_0x536862){return _0x536862['update']({'online':!![],'lastLoginAt':moment()[_0x02c1('0xac')](_0x02c1('0xfc')),'voicePause':_0x536862[_0x02c1('0x9f')]||![],'mailPause':_0x536862['loginInPause']||![],'chatPause':_0x536862[_0x02c1('0x9f')]||![],'faxPause':_0x536862[_0x02c1('0x9f')]||![],'smsPause':_0x536862[_0x02c1('0x9f')]||![],'openchannelPause':_0x536862[_0x02c1('0x9f')]||![],'whatsappPause':_0x536862['loginInPause']||![],'pauseType':_0x536862[_0x02c1('0x9f')]?_0x02c1('0x102'):null,'interface':_0x4031fd,'lastPauseAt':moment()['format'](_0x02c1('0xfc'))});}})[_0x02c1('0x19')](function(_0x5c28e9){if(_0x56f451[_0x02c1('0x105')]){return _0x3ca6c4();}else{return Promise[_0x02c1('0x106')](_0x5c28e9)[_0x02c1('0x19')](respondWithResult(_0x5dd9a3,null));}})['catch'](handleError(_0x5dd9a3,null));};exports['logout']=function(_0x5f0eba,_0x38c374){var _0xe3da0c;return db[_0x02c1('0x3a')][_0x02c1('0x5b')]({'where':{'id':_0x5f0eba[_0x02c1('0x5f')]['id'],'role':_0x02c1('0x80')},'attributes':['id',_0x02c1('0x36'),_0x02c1('0x2b')]})[_0x02c1('0x19')](handleEntityNotFound(_0x38c374,null))[_0x02c1('0x19')](function(_0x178a82){if(_0x178a82){_0xe3da0c=_0x178a82;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xe3da0c[_0x02c1('0x36')]},'individualHooks':!![]});}})[_0x02c1('0x19')](function(){return db['MemberReport'][_0x02c1('0x48')]({'where':{'membername':_0xe3da0c['name'],'exitAt':null}});})[_0x02c1('0x19')](function(_0x4733d8){var _0x3bcc07=[];_0x4733d8[_0x02c1('0xfe')](function(_0x55866e){_0x3bcc07[_0x02c1('0x4b')](_0x55866e['update']({'exitAt':moment()[_0x02c1('0xac')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x02c1('0x52')](_0x3bcc07);})[_0x02c1('0x19')](function(){return _0xe3da0c[_0x02c1('0x5d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x02c1('0x19')](respondWithResult(_0x38c374,null))[_0x02c1('0x20')](handleError(_0x38c374,null));};exports[_0x02c1('0x107')]=function(_0x25baf5,_0x176ab2){var _0x7373b0;return db[_0x02c1('0xae')]['update']({'paused':0x1},{'where':{'UserId':_0x25baf5[_0x02c1('0x5f')]['id']},'individualHooks':!![]})[_0x02c1('0x19')](function(){return db[_0x02c1('0x3a')]['find']({'where':{'id':_0x25baf5[_0x02c1('0x5f')]['id'],'role':'agent'},'attributes':['id','name',_0x02c1('0x2b'),_0x02c1('0x64'),_0x02c1('0xa1'),_0x02c1('0x9e')]});})[_0x02c1('0x19')](handleEntityNotFound(_0x176ab2,null))['then'](function(_0x14c210){if(_0x14c210){_0x7373b0=_0x14c210;return respondWithRpcPromise(_0x02c1('0x108'),_0x02c1('0x107'),{'id':_0x7373b0['id'],'name':_0x7373b0[_0x02c1('0x36')],'pause':!![]});}})['then'](function(){if(_0x7373b0){return db[_0x02c1('0x103')][_0x02c1('0x48')]({'where':{'membername':_0x7373b0[_0x02c1('0x36')],'type':_0x02c1('0x101'),'exitAt':null}});}})['then'](function(_0x3111f4){if(_0x3111f4['length']){var _0x3c35a5=moment()['format'](_0x02c1('0xfc'));for(var _0x42eeb6=0x0,_0x167f3e=_0x3111f4[_0x02c1('0x4a')];_0x42eeb6<_0x167f3e;_0x42eeb6++){_0x3111f4[_0x42eeb6][_0x02c1('0x109')]({'exitAt':_0x3c35a5});}}})[_0x02c1('0x19')](function(){var _0x5b976c=[];var _0x302576=utils['getChannels']();_0x302576[_0x02c1('0xfe')](function(_0x22479f){_0x5b976c[_0x02c1('0x4b')]({'channel':_0x22479f,'membername':_0x7373b0[_0x02c1('0x36')],'interface':_['isNil'](_0x7373b0['interface'])?util[_0x02c1('0xac')](_0x02c1('0xad'),_0x7373b0['name']):_0x7373b0[_0x02c1('0xa1')],'type':_0x02c1('0x101'),'enterAt':moment()['format'](_0x02c1('0xfc')),'data1':_0x25baf5[_0x02c1('0x5e')][_0x02c1('0x3d')]||'DEFAULT\x20PAUSE','role':_0x7373b0[_0x02c1('0x2b')],'internal':_0x7373b0[_0x02c1('0x64')]});});return db['MemberReport'][_0x02c1('0x8b')](_0x5b976c,{'individualHooks':!![]});})[_0x02c1('0x19')](function(){return _0x7373b0[_0x02c1('0x5d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x25baf5[_0x02c1('0x5e')][_0x02c1('0x3d')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x02c1('0xac')](_0x02c1('0xfc'))});})[_0x02c1('0x19')](respondWithResult(_0x176ab2,null))[_0x02c1('0x20')](handleError(_0x176ab2,null));};exports[_0x02c1('0x10a')]=function(_0x3c23d6,_0x25364c){if(_0x3c23d6['body'][_0x02c1('0x9d')]&&!utils[_0x02c1('0xb1')](_0x3c23d6[_0x02c1('0x5e')][_0x02c1('0x9d')])){throw new APIBadRequestError(util[_0x02c1('0xac')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x3c23d6[_0x02c1('0x5e')][_0x02c1('0x9d')]));}return db[_0x02c1('0x3a')][_0x02c1('0x5b')]({'where':{'id':_0x3c23d6[_0x02c1('0x5f')]['id']},'attributes':['id',_0x02c1('0x36'),_0x02c1('0x2b'),_0x02c1('0x64'),_0x02c1('0xa1'),'online',_0x02c1('0xa0'),_0x02c1('0x10b'),_0x02c1('0x10c'),_0x02c1('0x10d'),'openchannelPause','smsPause',_0x02c1('0x10e'),_0x02c1('0x10f'),_0x02c1('0x110')]})[_0x02c1('0x19')](function(_0x439a0c){if(!_0x439a0c){throw new APINotFoundError(util[_0x02c1('0xac')](_0x02c1('0xcb'),_0x3c23d6[_0x02c1('0x5f')]['id']));}return _0x439a0c[_0x02c1('0x10a')](_0x3c23d6['body']['channel']);})[_0x02c1('0x19')](respondWithResult(_0x25364c,null))[_0x02c1('0x20')](APIHandleError(_0x25364c));};exports['getTeams']=function(_0x5877bf,_0x11a8b8){var _0x151a7a={};var _0x432356={};var _0x3d9e30;var _0x2f0f1b;return db[_0x02c1('0x3a')][_0x02c1('0x97')]({'where':{'id':_0x5877bf[_0x02c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x11a8b8,null))[_0x02c1('0x19')](function(_0xfafbd4){if(_0xfafbd4){_0x3d9e30=_0xfafbd4;_0x432356[_0x02c1('0x54')]=_['keys'](db[_0x02c1('0x111')][_0x02c1('0x3b')]);_0x432356['query']=_[_0x02c1('0x56')](_0x5877bf[_0x02c1('0x42')]);_0x432356['filters']=_[_0x02c1('0x58')](_0x432356[_0x02c1('0x54')],_0x432356[_0x02c1('0x42')]);_0x151a7a['attributes']=_[_0x02c1('0x58')](_0x432356['model'],qs[_0x02c1('0x5a')](_0x5877bf[_0x02c1('0x42')]['fields']));_0x151a7a['attributes']=_0x151a7a['attributes']['length']?_0x151a7a[_0x02c1('0x59')]:_0x432356['model'];_0x151a7a[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0x5877bf[_0x02c1('0x42')][_0x02c1('0xd4')]);_0x151a7a[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_['pick'](_0x5877bf[_0x02c1('0x42')],_0x432356[_0x02c1('0x57')]));if(_0x5877bf['query'][_0x02c1('0x31')]){_0x151a7a[_0x02c1('0xd5')]=_[_0x02c1('0xdc')](_0x151a7a[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x151a7a[_0x02c1('0x59')],function(_0x46f50f){var _0x140632={};_0x140632[_0x46f50f]={'$like':'%'+_0x5877bf['query'][_0x02c1('0x31')]+'%'};return _0x140632;})});}_0x151a7a=_[_0x02c1('0xdc')]({},_0x151a7a,_0x5877bf[_0x02c1('0xd6')]);return _0x3d9e30[_0x02c1('0x112')](_0x151a7a);}})[_0x02c1('0x19')](function(_0xacb0ba){if(_0xacb0ba){_0x2f0f1b=_0xacb0ba[_0x02c1('0x4a')];if(!_0x5877bf[_0x02c1('0x42')][_0x02c1('0xcc')]('nolimit')){_0x151a7a[_0x02c1('0x26')]=qs[_0x02c1('0x26')](_0x5877bf[_0x02c1('0x42')][_0x02c1('0x26')]);_0x151a7a[_0x02c1('0x25')]=qs['offset'](_0x5877bf[_0x02c1('0x42')][_0x02c1('0x25')]);}return _0x3d9e30[_0x02c1('0x112')](_0x151a7a);}})[_0x02c1('0x19')](function(_0x4e8a36){if(_0x4e8a36){return _0x4e8a36?{'count':_0x2f0f1b,'rows':_0x4e8a36}:null;}})[_0x02c1('0x19')](respondWithResult(_0x11a8b8,null))[_0x02c1('0x20')](handleError(_0x11a8b8,null));};exports[_0x02c1('0x113')]=function(_0x34718e,_0x2166e4){var _0x13a1c7=_0x34718e[_0x02c1('0x5f')]['id'];var _0x2950ea=_0x34718e[_0x02c1('0x5e')]?_0x34718e[_0x02c1('0x5e')][_0x02c1('0x62')]:null;var _0x19649a=[];return Promise[_0x02c1('0x106')]()['then'](function(){if(!_0x2950ea)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x02c1('0x3a')]['findOne']({'where':{'id':_0x13a1c7}});})['then'](function(_0x587e14){if(!_0x587e14)throw new APINotFoundError(util[_0x02c1('0xac')]('User\x20with\x20id\x20%s\x20not\x20found',_0x34718e[_0x02c1('0x5f')]['id']));return db[_0x02c1('0x6b')][_0x02c1('0x114')](function(_0x2f6985){return _0x587e14[_0x02c1('0x113')](_0x2950ea,{'transaction':_0x2f6985})[_0x02c1('0x19')](function(){return db['Team'][_0x02c1('0x48')]({'where':{'id':{'$in':_0x2950ea}}});})[_0x02c1('0x19')](function(_0x37c1cb){var _0x4062d1=_[_0x02c1('0x33')](_0x37c1cb,function(_0x5a1eeb){return _0x5a1eeb[_0x02c1('0x115')]();});return Promise[_0x02c1('0x52')](_0x4062d1);})[_0x02c1('0x19')](function(_0x5488fe){_0x19649a=_[_0x02c1('0x116')](_0x5488fe);var _0x58a310=_[_0x02c1('0x33')](_0x19649a,function(_0x5a27af){return _0x5a27af['addAgent'](_0x587e14['id'],{'transaction':_0x2f6985});});return Promise['all'](_0x58a310);})[_0x02c1('0x19')](function(){if(!_0x587e14[_0x02c1('0x9e')])return;var _0xc1fd80=_[_0x02c1('0x31')](_0x19649a,function(_0x3299b2){return _0x3299b2[_0x02c1('0x117')](_0x02c1('0x9d'))===_0x02c1('0x118');});var _0x3d7f1c=_[_0x02c1('0x33')](_0xc1fd80,function(_0x54c2d2){return db[_0x02c1('0xae')][_0x02c1('0xaf')]({'membername':_0x587e14[_0x02c1('0x36')],'UserId':_0x587e14['id'],'queue_name':_0x54c2d2['name'],'VoiceQueueId':_0x54c2d2['id'],'interface':_[_0x02c1('0x6a')](_0x587e14[_0x02c1('0xa1')])?util['format'](_0x02c1('0xad'),_0x587e14[_0x02c1('0x36')]):_0x587e14['interface'],'paused':_0x587e14['voicePause']||![],'penalty':_0x587e14[_0x02c1('0xa6')]},{'transaction':_0x2f6985});});return Promise[_0x02c1('0x52')](_0x3d7f1c);})[_0x02c1('0x19')](function(){return db[_0x02c1('0x119')]['findAll']({'where':{'teamId':{'$in':_0x2950ea}}});})[_0x02c1('0x19')](function(_0x360991){var _0x32b49a=_[_0x02c1('0x33')](_0x360991,function(_0x4c805b){return db[_0x02c1('0x11a')]['create']({'UserId':_0x587e14['id'],'VoicePrefixId':_0x4c805b['VoicePrefixId']},{'transaction':_0x2f6985});});return Promise[_0x02c1('0x52')](_0x32b49a);});});})[_0x02c1('0x19')](function(){for(var _0x543dc6=0x0;_0x543dc6<_0x19649a[_0x02c1('0x4a')];_0x543dc6++){var _0x571089=_0x19649a[_0x543dc6][_0x02c1('0x117')]('channel');var _0x321eaf=_0x571089+_0x02c1('0xa8');socket[_0x02c1('0xa9')](_0x02c1('0x82')+_0x571089+_0x02c1('0xaa'),{'UserId':_0x13a1c7,['queueField']:_0x19649a[_0x543dc6]['id']});}})[_0x02c1('0x19')](respondWithStatusCode(_0x2166e4,null))[_0x02c1('0x20')](APIHandleError(_0x2166e4));};exports[_0x02c1('0x11b')]=function(_0x2e8c9b,_0x10fc03){var _0x40a740=_0x2e8c9b[_0x02c1('0x5f')]['id'];var _0x15d883=null;if(_0x2e8c9b['query'][_0x02c1('0x62')]){_0x15d883=_[_0x02c1('0x11c')](_0x2e8c9b[_0x02c1('0x42')][_0x02c1('0x62')])?_0x2e8c9b[_0x02c1('0x42')][_0x02c1('0x62')]:[_0x2e8c9b[_0x02c1('0x42')][_0x02c1('0x62')]];}var _0x3ecdfc=[];return Promise[_0x02c1('0x106')]()[_0x02c1('0x19')](function(){if(!_0x15d883)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x02c1('0x3a')][_0x02c1('0x97')]({'where':{'id':_0x40a740}});})[_0x02c1('0x19')](function(_0x6dcfac){if(!_0x6dcfac)throw new APINotFoundError(util['format'](_0x02c1('0xcb'),_0x2e8c9b[_0x02c1('0x5f')]['id']));return db[_0x02c1('0x6b')][_0x02c1('0x114')](function(_0x9af6cc){return _0x6dcfac[_0x02c1('0x11b')](_0x15d883,{'transaction':_0x9af6cc})[_0x02c1('0x19')](function(){return db[_0x02c1('0x111')][_0x02c1('0x48')]({'where':{'id':{'$in':_0x15d883}}});})[_0x02c1('0x19')](function(_0x440165){var _0x4dc1f2=_[_0x02c1('0x33')](_0x440165,function(_0x5355c2){return _0x5355c2['getAssociatedQueues']();});return Promise['all'](_0x4dc1f2);})[_0x02c1('0x19')](function(_0x3a9a49){_0x3ecdfc=_[_0x02c1('0x116')](_0x3a9a49);var _0x371239=_[_0x02c1('0x33')](_0x3ecdfc,function(_0x164ca3){return _0x164ca3[_0x02c1('0x11d')](_0x6dcfac['id'],{'transaction':_0x9af6cc});});return Promise[_0x02c1('0x52')](_0x371239);})[_0x02c1('0x19')](function(){if(!_0x6dcfac[_0x02c1('0x9e')])return;var _0x30acd7=_['filter'](_0x3ecdfc,function(_0x3ea090){return _0x3ea090[_0x02c1('0x117')]('channel')===_0x02c1('0x118');});var _0x32a427=_[_0x02c1('0x33')](_0x30acd7,function(_0x2a7545){return db[_0x02c1('0xae')]['destroy']({'where':{'VoiceQueueId':_0x2a7545['id'],'UserId':_0x6dcfac['id']},'transaction':_0x9af6cc});});return Promise[_0x02c1('0x52')](_0x32a427);})['then'](function(){return db[_0x02c1('0x119')][_0x02c1('0x48')]({'where':{'teamId':{'$in':_0x15d883}}});})[_0x02c1('0x19')](function(_0x5e705d){var _0x2bb6b2=_[_0x02c1('0x33')](_0x5e705d,function(_0x5e7602){return db[_0x02c1('0x11a')][_0x02c1('0xb5')]({'where':{'UserId':_0x6dcfac['id'],'VoicePrefixId':_0x5e7602[_0x02c1('0x11e')]}},{'transaction':_0x9af6cc});});return Promise['all'](_0x2bb6b2);});});})['then'](function(){for(var _0x333bd8=0x0;_0x333bd8<_0x3ecdfc[_0x02c1('0x4a')];_0x333bd8++){var _0x28e02f=_0x3ecdfc[_0x333bd8][_0x02c1('0x117')](_0x02c1('0x9d'));var _0x2d1f88=_0x28e02f+'QueueId';socket['emit']('user'+_0x28e02f+'Queue:remove',{'UserId':_0x40a740,['queueField']:_0x3ecdfc[_0x333bd8]['id']});}})['then'](respondWithStatusCode(_0x10fc03,null))[_0x02c1('0x20')](APIHandleError(_0x10fc03));};exports['getLists']=function(_0x465059,_0x135afd){var _0x5ecffb={};var _0x4752fd={};var _0x5d0dbc;var _0x696ec0;return db['User']['findOne']({'where':{'id':_0x465059['params']['id']}})[_0x02c1('0x19')](handleEntityNotFound(_0x135afd,null))[_0x02c1('0x19')](function(_0x1f518b){if(_0x1f518b){_0x5d0dbc=_0x1f518b;_0x4752fd['model']=_['keys'](db['CmList'][_0x02c1('0x3b')]);_0x4752fd[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0x465059[_0x02c1('0x42')]);_0x4752fd['filters']=_['intersection'](_0x4752fd['model'],_0x4752fd[_0x02c1('0x42')]);_0x5ecffb[_0x02c1('0x59')]=_[_0x02c1('0x58')](_0x4752fd[_0x02c1('0x54')],qs[_0x02c1('0x5a')](_0x465059[_0x02c1('0x42')][_0x02c1('0x5a')]));_0x5ecffb[_0x02c1('0x59')]=_0x5ecffb[_0x02c1('0x59')][_0x02c1('0x4a')]?_0x5ecffb['attributes']:_0x4752fd[_0x02c1('0x54')];_0x5ecffb[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0x465059['query'][_0x02c1('0xd4')]);_0x5ecffb[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_['pick'](_0x465059[_0x02c1('0x42')],_0x4752fd[_0x02c1('0x57')]));if(_0x465059[_0x02c1('0x42')][_0x02c1('0x31')]){_0x5ecffb['where']=_['merge'](_0x5ecffb[_0x02c1('0xd5')],{'$or':_[_0x02c1('0x33')](_0x5ecffb[_0x02c1('0x59')],function(_0x1d2499){var _0x316641={};_0x316641[_0x1d2499]={'$like':'%'+_0x465059['query'][_0x02c1('0x31')]+'%'};return _0x316641;})});}_0x5ecffb=_[_0x02c1('0xdc')]({},_0x5ecffb,_0x465059[_0x02c1('0xd6')]);return _0x5d0dbc['getLists'](_0x5ecffb);}})[_0x02c1('0x19')](function(_0x5c9c20){if(_0x5c9c20){_0x696ec0=_0x5c9c20[_0x02c1('0x4a')];if(!_0x465059[_0x02c1('0x42')][_0x02c1('0xcc')](_0x02c1('0xd9'))){_0x5ecffb[_0x02c1('0x26')]=qs[_0x02c1('0x26')](_0x465059[_0x02c1('0x42')][_0x02c1('0x26')]);_0x5ecffb['offset']=qs[_0x02c1('0x25')](_0x465059['query'][_0x02c1('0x25')]);}return _0x5d0dbc[_0x02c1('0x11f')](_0x5ecffb);}})['then'](function(_0x48059b){if(_0x48059b){return _0x48059b?{'count':_0x696ec0,'rows':_0x48059b}:null;}})[_0x02c1('0x19')](respondWithResult(_0x135afd,null))['catch'](handleError(_0x135afd,null));};exports[_0x02c1('0x120')]=function(_0x198b4a,_0x3ae2b5){var _0x3d914e={};var _0xf1cfbb={};var _0x394e14;return db[_0x02c1('0x3a')][_0x02c1('0x97')]({'where':{'id':_0x198b4a[_0x02c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3ae2b5,null))['then'](function(_0x417e18){if(_0x417e18){_0x394e14=_0x417e18;_0xf1cfbb[_0x02c1('0x54')]=_[_0x02c1('0x56')](db['User'][_0x02c1('0x3b')]);_0xf1cfbb[_0x02c1('0x42')]=_[_0x02c1('0x56')](_0x198b4a['query']);_0xf1cfbb[_0x02c1('0x57')]=_[_0x02c1('0x58')](_0xf1cfbb[_0x02c1('0x54')],_0xf1cfbb['query']);_0x3d914e[_0x02c1('0x59')]=_[_0x02c1('0x58')](_0xf1cfbb[_0x02c1('0x54')],qs[_0x02c1('0x5a')](_0x198b4a[_0x02c1('0x42')]['fields']));_0x3d914e['attributes']=_0x3d914e['attributes'][_0x02c1('0x4a')]?_0x3d914e[_0x02c1('0x59')]:_0xf1cfbb['model'];_0x3d914e[_0x02c1('0xd3')]=qs[_0x02c1('0xd4')](_0x198b4a[_0x02c1('0x42')][_0x02c1('0xd4')]);_0x3d914e[_0x02c1('0xd5')]=qs[_0x02c1('0x57')](_[_0x02c1('0xdb')](_0x198b4a[_0x02c1('0x42')],_0xf1cfbb['filters']));if(_0x198b4a[_0x02c1('0x42')][_0x02c1('0x31')]){_0x3d914e[_0x02c1('0xd5')]=_[_0x02c1('0xdc')](_0x3d914e[_0x02c1('0xd5')],{'$or':_['map'](_0x3d914e[_0x02c1('0x59')],function(_0x4c16f1){var _0x4f1042={};_0x4f1042[_0x4c16f1]={'$like':'%'+_0x198b4a[_0x02c1('0x42')][_0x02c1('0x31')]+'%'};return _0x4f1042;})});}_0x3d914e[_0x02c1('0x54')]=db[_0x02c1('0x3a')];_0x3d914e['as']=_0x02c1('0x88');_0x3d914e=_[_0x02c1('0xdc')]({},_0x3d914e,_0x198b4a[_0x02c1('0xd6')]);return _0x394e14[_0x02c1('0xfa')]({'include':[_0x3d914e]});}})[_0x02c1('0x19')](function(_0x542f26){if(_0x542f26){var _0x523635={},_0x77ab56=[];for(var _0x3d7939=0x0;_0x3d7939<_0x542f26['length'];_0x3d7939+=0x1){for(var _0xfc591f=0x0,_0xe19119;_0xfc591f<_0x542f26[_0x3d7939][_0x02c1('0x88')][_0x02c1('0x4a')];_0xfc591f+=0x1){_0xe19119=_0x542f26[_0x3d7939][_0x02c1('0x88')][_0xfc591f][_0x02c1('0x2d')]({'plain':!![]});_0x523635[_0xe19119['id']]=_0xe19119;}}_0x523635=_[_0x02c1('0x121')](_0x523635);for(var _0x292f6a=qs[_0x02c1('0x25')](_0x198b4a[_0x02c1('0x42')][_0x02c1('0x25')]);_0x292f6a<_0x523635[_0x02c1('0x4a')]&&_0x77ab56[_0x02c1('0x4a')]=_0x3bb8a4){_0x4773ec=_0x3bb8a4;_0xf5af97=0xc8;}else{_0xf5af97=0xce;}_0xcd38b[_0xddd6('0x22')](_0xf5af97);return _0xcd38b[_0xddd6('0x29')](_0xddd6('0x2a'),_0x4a395e+'-'+_0x4773ec+'/'+_0x3bb8a4)[_0xddd6('0x24')](_0x3f3245);}return null;};}function saveUpdates(_0x299d5b){return function(_0x2006db){if(_0x2006db){return _0x2006db[_0xddd6('0x2b')](_0x299d5b)[_0xddd6('0x2c')](function(_0x278750){if(_0x278750[_0xddd6('0x2d')]===_0xddd6('0x2e')){socket['emit'](_0xddd6('0x2f')+_0x278750['id'],_0x278750);}return _0x278750;});}return null;};}function removeEntity(_0x1b0d2f){return function(_0x523b63){if(_0x523b63){return _0x523b63[_0xddd6('0x30')]()[_0xddd6('0x2c')](function(){var _0x269089=_0x523b63['get']({'plain':!![]});if(_0x269089['role']==='admin')return;var _0x3dc41d=[{'name':_0xddd6('0x31'),'value':'user','ignore':!![]},{'name':_0xddd6('0x32'),'value':_0xddd6('0x2e'),'ignore':![]},{'name':_0xddd6('0x33'),'value':_0xddd6('0x34'),'ignore':![]}];var _0x6d8759=_(_0x3dc41d)['filter'](_0xddd6('0x35'))[_0xddd6('0x36')](_0xddd6('0x37'))[_0xddd6('0x37')]();if(_['includes'](_0x6d8759,_0x269089[_0xddd6('0x2d')])){return;}var _0x5ec3f4=_[_0xddd6('0x38')](_0x3dc41d,[_0xddd6('0x37'),_0x269089[_0xddd6('0x2d')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x5ec3f4,'resourceId':_0x269089['id']}})['then'](function(){return _0x523b63;});})[_0xddd6('0x2c')](function(){_0x1b0d2f[_0xddd6('0x22')](0xcc)[_0xddd6('0x23')]();});}};}function handleEntityNotFound(_0x177f53){return function(_0xaee4b0){if(!_0xaee4b0){_0x177f53[_0xddd6('0x39')](0x194);}return _0xaee4b0;};}function handleError(_0x71ad2f,_0x1cf18f){_0x1cf18f=_0x1cf18f||0x1f4;return function(_0x5ba5de){logger[_0xddd6('0x1d')](_0x5ba5de[_0xddd6('0x3a')]);if(_0x5ba5de[_0xddd6('0x3b')]){delete _0x5ba5de[_0xddd6('0x3b')];}_0x71ad2f['status'](_0x1cf18f)[_0xddd6('0x3c')](_0x5ba5de);};}exports[_0xddd6('0x3d')]=function(_0x11c72a,_0x33513b){var _0x5e1100={},_0x50635d={'count':0x0,'rows':[]};var _0x546f0e=_(db[_0xddd6('0x3e')][_0xddd6('0x3f')])[_0xddd6('0x36')](function(_0x5f14a2){return{'name':_0x5f14a2[_0xddd6('0x40')],'type':_0x5f14a2[_0xddd6('0x41')]['key']};})[_0xddd6('0x42')](function(_0x371bde){return!_[_0xddd6('0x43')]([_0xddd6('0x44'),_0xddd6('0x45')],_0x371bde[_0xddd6('0x3b')]);})[_0xddd6('0x37')]();_0x5e1100=qs['getOptions'](_0x546f0e,_0x11c72a);var _0x26cbb2={'where':_0x5e1100[_0xddd6('0x46')]};return db[_0xddd6('0x3e')]['count'](_0x26cbb2)[_0xddd6('0x2c')](function(_0x4f2477){_0x50635d[_0xddd6('0x28')]=_0x4f2477;if(_0x11c72a['query'][_0xddd6('0x47')]){_0x5e1100[_0xddd6('0x48')]=[{'all':!![]}];}if(_0x11c72a[_0xddd6('0x49')][_0xddd6('0x4a')]===_0xddd6('0x4b')){_0x5e1100[_0xddd6('0x48')]=[{'model':db[_0xddd6('0x4c')],'as':_0xddd6('0x4a')}];}if(!_[_0xddd6('0x43')](_0x5e1100['attributes'],'id')){_0x5e1100[_0xddd6('0x4d')][_0xddd6('0x4e')]('id');}return db['User'][_0xddd6('0x4f')](_0x5e1100);})[_0xddd6('0x2c')](function(_0x4a304b){_0x50635d[_0xddd6('0x50')]=_0x4a304b;if(_0x11c72a[_0xddd6('0x49')][_0xddd6('0x51')]===_0xddd6('0x4b')){var _0x280842=[];for(var _0x29cd6d=0x0;_0x29cd6d<_0x50635d['rows'][_0xddd6('0x52')];_0x29cd6d++){_0x280842[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x53'),_0x50635d[_0xddd6('0x50')][_0x29cd6d][_0xddd6('0x54')]));_0x280842['push'](get_open_tabs(_0xddd6('0x55'),_0x50635d[_0xddd6('0x50')][_0x29cd6d][_0xddd6('0x54')]));_0x280842[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x56'),_0x50635d[_0xddd6('0x50')][_0x29cd6d]['dataValues']));_0x280842['push'](get_open_tabs(_0xddd6('0x57'),_0x50635d[_0xddd6('0x50')][_0x29cd6d][_0xddd6('0x54')]));_0x280842[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x58'),_0x50635d[_0xddd6('0x50')][_0x29cd6d][_0xddd6('0x54')]));_0x280842[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x59'),_0x50635d[_0xddd6('0x50')][_0x29cd6d][_0xddd6('0x54')]));}return Promise[_0xddd6('0x5a')](_0x280842)[_0xddd6('0x2c')](function(){return _0x50635d;});}else{return _0x50635d;}})[_0xddd6('0x2c')](respondWithFilteredResult(_0x33513b,_0x5e1100))[_0xddd6('0x5b')](handleError(_0x33513b,null));};exports['show']=function(_0x24d158,_0x27b219){var _0x5764a8={'raw':![],'where':{'id':_0x24d158['params']['id']}},_0x3ac8e8={};_0x3ac8e8[_0xddd6('0x5c')]=_[_0xddd6('0x5d')](_[_0xddd6('0x5e')](db['User'][_0xddd6('0x3f')]),[_0xddd6('0x44'),_0xddd6('0x45')]);_0x3ac8e8['query']=_[_0xddd6('0x5e')](_0x24d158[_0xddd6('0x49')]);_0x3ac8e8[_0xddd6('0x5f')]=_['intersection'](_0x3ac8e8['model'],_0x3ac8e8[_0xddd6('0x49')]);_0x5764a8[_0xddd6('0x4d')]=_[_0xddd6('0x60')](_0x3ac8e8['model'],qs[_0xddd6('0x61')](_0x24d158[_0xddd6('0x49')]['fields']));_0x5764a8[_0xddd6('0x4d')]=_0x5764a8[_0xddd6('0x4d')]['length']?_0x5764a8[_0xddd6('0x4d')]:_0x3ac8e8[_0xddd6('0x5c')];if(_0x24d158['query'][_0xddd6('0x47')]){_0x5764a8[_0xddd6('0x48')]=[{'all':!![]}];}if(_0x24d158[_0xddd6('0x49')][_0xddd6('0x4a')]===_0xddd6('0x4b')){_0x5764a8[_0xddd6('0x48')]=[{'model':db[_0xddd6('0x4c')],'as':_0xddd6('0x4a')}];}_0x5764a8=_[_0xddd6('0x62')]({},_0x5764a8,_0x24d158[_0xddd6('0x63')]);if(!_[_0xddd6('0x43')](_0x5764a8['attributes'],'id')){_0x5764a8[_0xddd6('0x4d')]['push']('id');}return db[_0xddd6('0x3e')]['find'](_0x5764a8)['then'](handleEntityNotFound(_0x27b219,null))[_0xddd6('0x2c')](function(_0x2d1c19){var _0x2495b1=[];values=_0x2d1c19;if(_0x24d158[_0xddd6('0x49')][_0xddd6('0x51')]==='true'){_0x2495b1[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x53'),_0x2d1c19['dataValues']));_0x2495b1[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x55'),_0x2d1c19['dataValues']));_0x2495b1['push'](get_open_tabs(_0xddd6('0x58'),_0x2d1c19[_0xddd6('0x54')]));_0x2495b1[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x59'),_0x2d1c19['dataValues']));_0x2495b1[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x56'),_0x2d1c19[_0xddd6('0x54')]));_0x2495b1['push'](get_open_tabs('mail',_0x2d1c19[_0xddd6('0x54')]));return Promise[_0xddd6('0x5a')](_0x2495b1);}else{return values;}})[_0xddd6('0x2c')](function(){return values;})[_0xddd6('0x2c')](respondWithResult(_0x27b219,null))[_0xddd6('0x5b')](handleError(_0x27b219,null));};exports[_0xddd6('0x2b')]=function(_0x2a2d0c,_0x429d93){if(_0x2a2d0c[_0xddd6('0x64')]['id']){delete _0x2a2d0c[_0xddd6('0x64')]['id'];}delete _0x2a2d0c[_0xddd6('0x64')][_0xddd6('0x2d')];return db['User']['find']({'where':{'id':_0x2a2d0c[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x429d93,null))[_0xddd6('0x2c')](saveUpdates(_0x2a2d0c[_0xddd6('0x64')],null))['then'](respondWithResult(_0x429d93,null))[_0xddd6('0x5b')](handleError(_0x429d93,null));};exports['describe']=function(_0x468017,_0x159ba7){return db[_0xddd6('0x3e')][_0xddd6('0x66')]()[_0xddd6('0x2c')](respondWithResult(_0x159ba7,null))['catch'](handleError(_0x159ba7,null));};exports['addContacts']=function(_0x2e26b6,_0x335c9d){return db['User'][_0xddd6('0x38')]({'where':{'id':_0x2e26b6[_0xddd6('0x65')]['id']}})['then'](handleEntityNotFound(_0x335c9d,null))['then'](function(_0x4c7e0b){if(_0x4c7e0b){return _0x4c7e0b['addContacts'](_0x2e26b6[_0xddd6('0x64')][_0xddd6('0x67')],_[_0xddd6('0x68')](_0x2e26b6[_0xddd6('0x64')],[_0xddd6('0x67'),'id'])||{});}})['then'](respondWithResult(_0x335c9d,null))[_0xddd6('0x5b')](handleError(_0x335c9d,null));};function validateUser(_0x35b674){return new Promise(function(_0x423279,_0x1df9c7){if(_0x35b674[_0xddd6('0x69')])return _0x423279(_0x35b674);return db[_0xddd6('0x6a')][_0xddd6('0x6b')](0x1)[_0xddd6('0x2c')](function(_0x515ca6){if(_0x515ca6['securePassword'])authService['validatePasswordPattern'](_0x35b674[_0xddd6('0x44')]);db['User']['max']('internal')['then'](function(_0x41ecef){if(_[_0xddd6('0x6c')](_0x41ecef)){_0x35b674['internal']=_0x515ca6['min_internal']||0x1;return;}if(_[_0xddd6('0x6c')](_0x515ca6[_0xddd6('0x6d')])||_0x515ca6[_0xddd6('0x6d')]===_0x41ecef){_0x35b674[_0xddd6('0x69')]=_0x41ecef+0x1;return;}if(_0x515ca6[_0xddd6('0x6d')]>_0x41ecef){_0x35b674[_0xddd6('0x69')]=_0x515ca6[_0xddd6('0x6d')];return;}return db[_0xddd6('0x6e')]['query'](_0xddd6('0x6f'),{'type':db['sequelize'][_0xddd6('0x70')][_0xddd6('0x71')]})[_0xddd6('0x2c')](function(_0x2d7d6d){if(_0x2d7d6d&&_0x2d7d6d[_0xddd6('0x52')]){for(var _0x7d20bc=0x0,_0x5ce630=_0x2d7d6d[_0xddd6('0x52')];_0x7d20bc<_0x5ce630&&_[_0xddd6('0x6c')](_0x35b674[_0xddd6('0x69')]);_0x7d20bc++){if(_0x515ca6['min_internal']<=_0x2d7d6d[_0x7d20bc][_0xddd6('0x72')]){_0x35b674[_0xddd6('0x69')]=_0x2d7d6d[_0x7d20bc][_0xddd6('0x72')];}else if(_0x515ca6[_0xddd6('0x6d')]>_0x2d7d6d[_0x7d20bc][_0xddd6('0x72')]&&_0x515ca6[_0xddd6('0x6d')]<=_0x2d7d6d[_0x7d20bc]['to']){_0x35b674[_0xddd6('0x69')]=_0x515ca6[_0xddd6('0x6d')];}}}if(_[_0xddd6('0x6c')](_0x35b674[_0xddd6('0x69')])){_0x35b674[_0xddd6('0x69')]=_0x41ecef+0x1;}return _0x423279(_0x35b674);});});})[_0xddd6('0x5b')](function(_0x229158){_0x1df9c7(_0x229158);});});}function updateUser(_0xb40de0){return new Promise(function(_0x268cd3,_0x48c031){try{if(_0xb40de0[_0xddd6('0x73')]){_0xb40de0[_0xddd6('0x74')]=_0xb40de0[_0xddd6('0x69')];_0xb40de0[_0xddd6('0x75')]={'mailbox':_0xb40de0[_0xddd6('0x69')],'password':_0xb40de0['password'],'fullname':_0xb40de0[_0xddd6('0x76')],'email':_0xb40de0[_0xddd6('0x77')]};}if(_0xb40de0[_0xddd6('0x2d')]===_0xddd6('0x2e')){if(!_0xb40de0[_0xddd6('0x78')])_0xb40de0[_0xddd6('0x78')]=[_0xddd6('0x79'),_0xddd6('0x7a'),'103',_0xddd6('0x7b'),_0xddd6('0x7c'),_0xddd6('0x7d'),_0xddd6('0x7e'),_0xddd6('0x7f'),_0xddd6('0x80'),_0xddd6('0x81'),'109','100','111','114','115'];}_0x268cd3(_0xb40de0);}catch(_0x1bb1b0){_0x48c031(_0x1bb1b0);}});}exports['create']=function(_0x5b6983,_0x2fb8ef){if(_0x5b6983[_0xddd6('0x82')][_0xddd6('0x2d')]===_0xddd6('0x2e'))throw new Error('Unauthorized');if(_0x5b6983[_0xddd6('0x64')]['role']===_0xddd6('0x82')&&_0x5b6983[_0xddd6('0x82')]['role']!==_0xddd6('0x83')){throw new Error(_0xddd6('0x84'));}if(_0x5b6983[_0xddd6('0x64')][_0xddd6('0x2d')]==='admin'&&_0x5b6983[_0xddd6('0x82')][_0xddd6('0x2d')]!==_0xddd6('0x83')){throw new Error(_0xddd6('0x85'));}return licenseUtil[_0xddd6('0x86')]([_0x5b6983[_0xddd6('0x64')]])[_0xddd6('0x2c')](function(){return validateUser(_0x5b6983[_0xddd6('0x64')]);})[_0xddd6('0x2c')](function(_0x28229f){return updateUser(_0x28229f)[_0xddd6('0x2c')](function(_0x5474c7){if(_0x5474c7['role']===_0xddd6('0x83')){_0x5474c7['settingsEnabled']=_0x5b6983[_0xddd6('0x82')][_0xddd6('0x87')];delete _0x5474c7[_0xddd6('0x88')];}return _0x5474c7;});})[_0xddd6('0x2c')](function(_0xbab0b){return db['User'][_0xddd6('0x89')](_0xbab0b,{'include':[{'model':db[_0xddd6('0x75')],'as':_0xddd6('0x75')}]});})[_0xddd6('0x2c')](function(_0x169992){if(_0x5b6983[_0xddd6('0x64')][_0xddd6('0x2d')]==='user')return _0x169992;if(_0x5b6983[_0xddd6('0x82')][_0xddd6('0x2d')]!==_0xddd6('0x82'))return _0x169992;return db[_0xddd6('0x8a')]['find']({'where':{'name':_0x169992[_0xddd6('0x2d')]===_0xddd6('0x2e')?_0xddd6('0x32'):'Telephones','userProfileId':_0x5b6983[_0xddd6('0x82')][_0xddd6('0x88')]},'raw':!![]})[_0xddd6('0x2c')](function(_0x2cc092){if(!_0x2cc092||_0x2cc092[_0xddd6('0x8b')]!=0x0)return _0x169992;return db[_0xddd6('0x8c')][_0xddd6('0x89')]({'name':_0x169992[_0xddd6('0x3b')],'resourceId':_0x169992['id'],'type':_0x2cc092[_0xddd6('0x3b')],'sectionId':_0x2cc092['id']},{})[_0xddd6('0x2c')](function(){return _0x169992;});})['catch'](function(_0x4acdf5){logger[_0xddd6('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4acdf5);throw _0x4acdf5;});})[_0xddd6('0x2c')](respondWithResult(_0x2fb8ef,0xc9))[_0xddd6('0x5b')](handleError(_0x2fb8ef,null));};exports[_0xddd6('0x8d')]=function(_0x4731e8,_0x78f142){var _0x505516=_0x4731e8['body'];var _0x66c8f6=[];if(_0x4731e8[_0xddd6('0x82')][_0xddd6('0x2d')]===_0xddd6('0x2e'))throw new Error(_0xddd6('0x8e'));if(_[_0xddd6('0x8f')](_0x505516,[_0xddd6('0x2d'),_0xddd6('0x82')])&&_0x4731e8[_0xddd6('0x82')][_0xddd6('0x2d')]!==_0xddd6('0x83')){throw new Error(_0xddd6('0x84'));}if(_[_0xddd6('0x8f')](_0x505516,[_0xddd6('0x2d'),_0xddd6('0x83')])&&_0x4731e8['user']['role']!==_0xddd6('0x83')){throw new Error(_0xddd6('0x90'));}return licenseUtil['checkUserLimits'](_0x505516)[_0xddd6('0x2c')](function(){return validateUser(_0x505516[0x0]);})[_0xddd6('0x2c')](function(){for(var _0x3f5c85=0x1;_0x3f5c85<_0x505516[_0xddd6('0x52')];_0x3f5c85++){var _0x4f4c25=_0x505516[_0x3f5c85-0x1][_0xddd6('0x69')];if(!_0x505516[_0x3f5c85][_0xddd6('0x69')])_0x505516[_0x3f5c85][_0xddd6('0x69')]=_0x4f4c25+0x1;_0x66c8f6[_0xddd6('0x4e')](validateUser(_0x505516[_0x3f5c85]));}return Promise['all'](_0x66c8f6);})[_0xddd6('0x2c')](function(){_0x66c8f6=[];for(var _0x1dcc64=0x0;_0x1dcc64<_0x505516[_0xddd6('0x52')];_0x1dcc64++){_0x66c8f6[_0xddd6('0x4e')](updateUser(_0x505516[_0x1dcc64]));}return Promise[_0xddd6('0x5a')](_0x66c8f6);})[_0xddd6('0x2c')](function(){_0x66c8f6=_0x505516['map'](function(_0x30e4c7){return db[_0xddd6('0x3e')][_0xddd6('0x89')](_0x30e4c7,{'include':[{'model':db[_0xddd6('0x75')],'as':_0xddd6('0x75')}]})[_0xddd6('0x2c')](function(_0x522132){_0x30e4c7['id']=_0x522132['id'];return _0x30e4c7;});});return Promise[_0xddd6('0x5a')](_0x66c8f6);})[_0xddd6('0x2c')](function(_0x30a43f){if(_0x4731e8['body'][_0xddd6('0x2d')]===_0xddd6('0x82'))return _0x30a43f;if(_0x4731e8[_0xddd6('0x82')][_0xddd6('0x2d')]!==_0xddd6('0x82'))return _0x30a43f;var _0x4b5037=_[_0xddd6('0x8f')](_0x30a43f,function(_0x159572){return _0x159572[_0xddd6('0x2d')]===_0xddd6('0x2e')||_0x159572[_0xddd6('0x2d')]===_0xddd6('0x34');});if(!_0x4b5037)return _0x30a43f;return db[_0xddd6('0x8a')][_0xddd6('0x4f')]({'where':{'name':{'$or':[_0xddd6('0x32'),_0xddd6('0x33')]},'userProfileId':_0x4731e8[_0xddd6('0x82')]['userProfileId']},'raw':!![]})['then'](function(_0xae6ee2){if(_[_0xddd6('0x91')](_0xae6ee2)||!_[_0xddd6('0x8f')](_0xae6ee2,[_0xddd6('0x8b'),0x0]))return _0x30a43f;_0x66c8f6=[];var _0x4a6e60=_(_0xae6ee2)[_0xddd6('0x36')](function(_0x4da5c0){if(_0x4da5c0['autoAssociation']===0x1)return;return _0x4da5c0[_0xddd6('0x3b')]==='Agents'?'agent':'telephone';})['compact']()[_0xddd6('0x37')]();for(var _0x364588=0x0;_0x364588<_0x30a43f[_0xddd6('0x52')];_0x364588++){if(!_[_0xddd6('0x43')](_0x4a6e60,_0x30a43f[_0x364588][_0xddd6('0x2d')]))return;var _0x11162a=_0x30a43f[_0x364588][_0xddd6('0x2d')]===_0xddd6('0x2e')?_0xddd6('0x32'):_0xddd6('0x33');_0x66c8f6[_0xddd6('0x4e')](db[_0xddd6('0x8c')][_0xddd6('0x89')]({'name':_0x30a43f[_0x364588][_0xddd6('0x3b')],'resourceId':_0x30a43f[_0x364588]['id'],'type':_0x11162a,'sectionId':_[_0xddd6('0x38')](_0xae6ee2,[_0xddd6('0x3b'),_0x11162a])['id']},{}));}return Promise[_0xddd6('0x5a')](_0x66c8f6);});})['then'](respondWithResult(_0x78f142,0xc9))['catch'](handleError(_0x78f142,null));};exports['changePassword']=function(_0x3828d1,_0xa270aa){if(_0x3828d1['body']['id']){delete _0x3828d1[_0xddd6('0x64')]['id'];}return db[_0xddd6('0x3e')][_0xddd6('0x38')]({'where':{'id':_0x3828d1[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](function(_0x56de52){if(!_0x56de52)return null;if(_0x56de52['id']===_0x3828d1[_0xddd6('0x82')]['id']){if(!_0x3828d1[_0xddd6('0x64')][_0xddd6('0x92')]||!_0x3828d1[_0xddd6('0x64')][_0xddd6('0x93')]){throw new db[(_0xddd6('0x94'))]['ValidationError'](_0xddd6('0x95'));}if(!_0x56de52[_0xddd6('0x96')](_0x3828d1[_0xddd6('0x64')][_0xddd6('0x92')])){throw new db['Sequelize']['ValidationError'](_0xddd6('0x97'));}if(_0x3828d1[_0xddd6('0x64')][_0xddd6('0x92')]===_0x3828d1[_0xddd6('0x64')][_0xddd6('0x93')]){throw new db[(_0xddd6('0x94'))][(_0xddd6('0x98'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x3828d1[_0xddd6('0x82')]['role']===_0xddd6('0x83')){if(!_0x3828d1[_0xddd6('0x64')][_0xddd6('0x93')]){throw new db[(_0xddd6('0x94'))][(_0xddd6('0x98'))](_0xddd6('0x99'));}}else if(_0x3828d1[_0xddd6('0x82')][_0xddd6('0x2d')]===_0xddd6('0x82')){if(!_0x3828d1['body'][_0xddd6('0x93')]){throw new db[(_0xddd6('0x94'))]['ValidationError'](_0xddd6('0x99'));}if(_0x56de52['role']!=='agent'){throw new db[(_0xddd6('0x94'))][(_0xddd6('0x98'))](_0xddd6('0x8e'));}}else{throw new db['Sequelize']['ValidationError'](_0xddd6('0x8e'));}return _0x56de52;})[_0xddd6('0x2c')](handleEntityNotFound(_0xa270aa,null))[_0xddd6('0x2c')](function(_0x524e65){return db[_0xddd6('0x6a')][_0xddd6('0x9a')]({'attributes':['id',_0xddd6('0x9b'),_0xddd6('0x9c'),_0xddd6('0x9d')]})[_0xddd6('0x2c')](function(_0x5057d4){if(_0x5057d4[_0xddd6('0x9b')])authService[_0xddd6('0x9e')](_0x3828d1[_0xddd6('0x64')][_0xddd6('0x93')]);if(!_0x5057d4['enforcePasswordHistory']||!_0x524e65[_0xddd6('0x9f')])return _0x524e65;authService[_0xddd6('0xa0')](_0x3828d1[_0xddd6('0x64')][_0xddd6('0x93')],_0x524e65[_0xddd6('0x9f')],_0x5057d4[_0xddd6('0x9d')]);return _0x524e65;})[_0xddd6('0x2c')](saveUpdates({'password':_0x3828d1[_0xddd6('0x64')][_0xddd6('0x93')],'passwordResetAt':_0x3828d1[_0xddd6('0x82')]['id']==_0x3828d1[_0xddd6('0x65')]['id']?moment():null,'previousPasswords':authService[_0xddd6('0xa1')](_0x3828d1[_0xddd6('0x64')][_0xddd6('0x93')],_0x524e65[_0xddd6('0x9f')])},null));})[_0xddd6('0x2c')](respondWithResult(_0xa270aa,null))[_0xddd6('0x5b')](handleError(_0xa270aa,null));};exports[_0xddd6('0xa2')]=function(_0xc312fd,_0x4497b1){var _0x48075a=_0xc312fd[_0xddd6('0x64')][_0xddd6('0xa3')];return db[_0xddd6('0x3e')][_0xddd6('0x38')]({'where':{'id':_0xc312fd['params']['id']},'attributes':['id',_0xddd6('0x3b'),'role',_0xddd6('0xa4'),'loginInPause',_0xddd6('0xa5'),_0xddd6('0xa6')]})[_0xddd6('0x2c')](handleEntityNotFound(_0x4497b1,null))[_0xddd6('0x2c')](function(_0x40196f){if(_0x40196f){if(!utils[_0xddd6('0xa7')](_0x48075a)){throw new db[(_0xddd6('0x94'))]['ValidationError'](_0xddd6('0xa8'));}return _0x40196f[_0xddd6('0xa9')+_[_0xddd6('0xaa')](_0x48075a[_0xddd6('0xab')]())+_0xddd6('0xac')](_0xc312fd[_0xddd6('0x64')][_0xddd6('0x67')],{'penalty':_0xc312fd[_0xddd6('0x64')]['penalty']||0x0})[_0xddd6('0xad')](function(_0x7fdff7){for(var _0x3f70a8=0x0;_0x3f70a8<_0xc312fd[_0xddd6('0x64')]['ids']['length'];_0x3f70a8+=0x1){var _0x3a65c7={'UserId':Number(_0xc312fd[_0xddd6('0x65')]['id'])};_0x3a65c7[_[_0xddd6('0xaa')](_0x48075a[_0xddd6('0xab')]())+_0xddd6('0xae')]=Number(_0xc312fd['body'][_0xddd6('0x67')][_0x3f70a8]);socket[_0xddd6('0xaf')](_0xddd6('0x82')+_[_0xddd6('0xaa')](_0x48075a[_0xddd6('0xab')]())+_0xddd6('0xb0'),_0x3a65c7);}return _0x7fdff7;})['then'](function(){if(_0x48075a===_0xddd6('0xb1')){return db['VoiceQueue'][_0xddd6('0x4f')]({'where':{'id':_0xc312fd[_0xddd6('0x64')][_0xddd6('0x67')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xddd6('0x2c')](function(_0x1217a7){var _0x3414f4=_0x40196f[_0xddd6('0xb2')]({'plain':!![]});var _0x153150=[];if(_0x48075a==='voice'&&_0x3414f4['role']===_0xddd6('0x2e')&&_0x3414f4['online']){for(let _0x1371d4=0x0;_0x1371d4<_0x1217a7[_0xddd6('0x52')];_0x1371d4+=0x1){_0x153150[_0xddd6('0x4e')]({'membername':_0x3414f4['name'],'UserId':_0x3414f4['id'],'queue_name':_0x1217a7[_0x1371d4]['name'],'VoiceQueueId':_0x1217a7[_0x1371d4]['id'],'interface':_[_0xddd6('0x6c')](_0x3414f4[_0xddd6('0xa6')])?util[_0xddd6('0xb3')]('SIP/%s',_0x3414f4['name']):_0x3414f4['interface'],'paused':_0x3414f4[_0xddd6('0xa5')]||![],'penalty':_0xc312fd[_0xddd6('0x64')][_0xddd6('0xb4')]||0x0});}return Promise[_0xddd6('0x5a')](_0x153150[_0xddd6('0x36')](function(_0x1d18bc){return db[_0xddd6('0xb5')]['upsert'](_0x1d18bc);}));}return _0x40196f;});}})[_0xddd6('0x2c')](respondWithStatusCode(_0x4497b1,null))['catch'](handleError(_0x4497b1,null));};exports[_0xddd6('0xb6')]=function(_0x34b4b2,_0x140e86){var _0x21563b,_0x79aea5;return db[_0xddd6('0x3e')]['find']({'where':{'id':_0x34b4b2[_0xddd6('0x65')]['id']},'attributes':['id',_0xddd6('0x3b'),_0xddd6('0x2d')]})['then'](handleEntityNotFound(_0x140e86,null))[_0xddd6('0x2c')](function(_0x33b8a6){if(_0x33b8a6){_0x21563b=_0x33b8a6;if(!_0x34b4b2[_0xddd6('0x49')][_0xddd6('0xa3')]||!utils['isValidChannel'](_0x34b4b2[_0xddd6('0x49')][_0xddd6('0xa3')])){throw new db[(_0xddd6('0x94'))][(_0xddd6('0x98'))](_0xddd6('0xa8'));}return _0x33b8a6[_0xddd6('0xb7')+_[_0xddd6('0xaa')](_0x34b4b2[_0xddd6('0x49')][_0xddd6('0xa3')]['toLowerCase']())+_0xddd6('0xac')](_0x34b4b2[_0xddd6('0x49')][_0xddd6('0x67')]);}})[_0xddd6('0x2c')](function(_0x2a851b){if(_[_0xddd6('0xb8')](_0x34b4b2[_0xddd6('0x49')][_0xddd6('0x67')])){for(var _0x591721=0x0;_0x591721<_0x34b4b2[_0xddd6('0x49')]['ids'][_0xddd6('0x52')];_0x591721+=0x1){_0x79aea5={'UserId':Number(_0x34b4b2['params']['id'])};_0x79aea5[_[_0xddd6('0xaa')](_0x34b4b2[_0xddd6('0x49')][_0xddd6('0xa3')][_0xddd6('0xab')]())+_0xddd6('0xae')]=Number(_0x34b4b2['query']['ids'][_0x591721]);socket[_0xddd6('0xaf')](_0xddd6('0x82')+_[_0xddd6('0xaa')](_0x34b4b2[_0xddd6('0x49')]['channel']['toLowerCase']())+_0xddd6('0xb9'),_0x79aea5);}}else{_0x79aea5={'UserId':Number(_0x34b4b2[_0xddd6('0x65')]['id'])};_0x79aea5[_['capitalize'](_0x34b4b2[_0xddd6('0x49')][_0xddd6('0xa3')]['toLowerCase']())+'QueueId']=Number(_0x34b4b2[_0xddd6('0x49')][_0xddd6('0x67')]);socket[_0xddd6('0xaf')]('user'+_[_0xddd6('0xaa')](_0x34b4b2['query'][_0xddd6('0xa3')][_0xddd6('0xab')]())+'Queue:remove',_0x79aea5);}return _0x2a851b;})[_0xddd6('0x2c')](function(){if(_0x34b4b2[_0xddd6('0x49')][_0xddd6('0xa3')]===_0xddd6('0xb1')){return db['UserVoiceQueueRt'][_0xddd6('0x30')]({'where':{'UserId':_0x34b4b2[_0xddd6('0x65')]['id'],'VoiceQueueId':_0x34b4b2[_0xddd6('0x49')][_0xddd6('0x67')]},'individualHooks':!![]})[_0xddd6('0x2c')](function(){return _0x21563b;});}return _0x21563b;})[_0xddd6('0x2c')](respondWithStatusCode(_0x140e86,null))['catch'](handleError(_0x140e86,null));};exports[_0xddd6('0xba')]=function(_0x20cf97,_0x59810c){_0x20cf97[_0xddd6('0x64')][_0xddd6('0xbb')]=_0x20cf97['file'][_0xddd6('0xbc')];return db['User'][_0xddd6('0x38')]({'where':{'id':_0x20cf97[_0xddd6('0x65')]['id']}})['then'](handleEntityNotFound(_0x59810c,null))[_0xddd6('0x2c')](saveUpdates(_0x20cf97[_0xddd6('0x64')],null))[_0xddd6('0x2c')](respondWithResult(_0x59810c,null))[_0xddd6('0x5b')](handleError(_0x59810c,null));};exports[_0xddd6('0xbd')]=function(_0x23cd25,_0x4c767d){var _0x198669=path[_0xddd6('0xbe')](config[_0xddd6('0xbf')],_0xddd6('0xc0'));return db[_0xddd6('0x3e')]['find']({'where':{'id':_0x23cd25[_0xddd6('0x65')]['id']},'attributes':['id',_0xddd6('0xbb')],'raw':!![]})['then'](handleEntityNotFound(_0x4c767d,null))['then'](function(_0x30ccfb){if(_0x30ccfb){if(_[_0xddd6('0x6c')](_0x30ccfb[_0xddd6('0xbb')])){return _0x4c767d[_0xddd6('0xc1')](_0x198669);}else{if(!fs[_0xddd6('0xc2')](path[_0xddd6('0xbe')](config['root'],_0xddd6('0xc3'),_0x30ccfb[_0xddd6('0xbb')]))){return _0x4c767d[_0xddd6('0xc1')](_0x198669);}return _0x4c767d[_0xddd6('0xc1')](path[_0xddd6('0xbe')](config[_0xddd6('0xbf')],_0xddd6('0xc3'),_0x30ccfb[_0xddd6('0xbb')]));}}})['catch'](handleError(_0x4c767d,null));};exports[_0xddd6('0xc4')]=function(_0x90f91a,_0x1eb051){return db[_0xddd6('0x3e')]['find']({'where':{'id':_0x90f91a['params']['id']},'attributes':['id']})[_0xddd6('0x2c')](handleEntityNotFound(_0x1eb051,null))['then'](function(_0x15c51a){var _0x5d5a2d=[];values=_0x15c51a[_0xddd6('0x54')];_0x5d5a2d[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x53'),_0x15c51a[_0xddd6('0x54')]));_0x5d5a2d[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x55'),_0x15c51a['dataValues']));_0x5d5a2d[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x58'),_0x15c51a[_0xddd6('0x54')]));_0x5d5a2d[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x59'),_0x15c51a[_0xddd6('0x54')]));_0x5d5a2d['push'](get_open_tabs(_0xddd6('0x56'),_0x15c51a[_0xddd6('0x54')]));_0x5d5a2d[_0xddd6('0x4e')](get_open_tabs(_0xddd6('0x57'),_0x15c51a['dataValues']));return Promise[_0xddd6('0x5a')](_0x5d5a2d);})['then'](function(_0x28ce66){if(_0x28ce66){var _0x31f792=_[_0xddd6('0x36')](values[_0xddd6('0xc5')],function(_0x395702){return{'channel':_0xddd6('0xc6'),'id':_0x395702['id'],'createdAt':_0x395702[_0xddd6('0xc7')]};});var _0x4424f9=_[_0xddd6('0x36')](values[_0xddd6('0xc8')],function(_0x37cc69){return{'channel':'FAX','id':_0x37cc69['id'],'createdAt':_0x37cc69[_0xddd6('0xc7')]};});var _0x356a60=_[_0xddd6('0x36')](values[_0xddd6('0xc9')],function(_0x3945bb){return{'channel':_0xddd6('0xca'),'id':_0x3945bb['id'],'createdAt':_0x3945bb[_0xddd6('0xc7')]};});var _0x37e6a7=_[_0xddd6('0x36')](values[_0xddd6('0xcb')],function(_0x13c7ed){return{'channel':_0xddd6('0xcc'),'id':_0x13c7ed['id'],'createdAt':_0x13c7ed[_0xddd6('0xc7')]};});var _0x180765=_[_0xddd6('0x36')](values[_0xddd6('0xcd')],function(_0x4ba3c3){return{'channel':_0xddd6('0xce'),'id':_0x4ba3c3['id'],'createdAt':_0x4ba3c3[_0xddd6('0xc7')]};});var _0x49ec9a=_[_0xddd6('0x36')](values[_0xddd6('0xcf')],function(_0x342eb3){return{'channel':_0xddd6('0xd0'),'id':_0x342eb3['id'],'createdAt':_0x342eb3['createdAt']};});var _0x3b54d3=_[_0xddd6('0xd1')](_0x31f792,_0x4424f9,_0x356a60,_0x37e6a7,_0x180765,_0x49ec9a);var _0x593189={'count':_0x3b54d3[_0xddd6('0x52')],'rows':_0x3b54d3};return _0x593189;}else return null;})['then'](respondWithResult(_0x1eb051,null))[_0xddd6('0x5b')](handleError(_0x1eb051,null));};exports['getContacts']=function(_0x241219,_0x56bac4){var _0x43ae44={};return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x241219['params']['id']}})[_0xddd6('0x2c')](function(_0x453cf3){if(!_0x453cf3){throw new APINotFoundError(util[_0xddd6('0xb3')](_0xddd6('0xd2'),_0x241219[_0xddd6('0x65')]['id']));}return contacts[_0xddd6('0x66')]();})[_0xddd6('0x2c')](function(_0x3c54ca){_0x241219[_0xddd6('0x49')]['User']=_0x241219[_0xddd6('0x65')]['id'];_0x43ae44=qs['getOptions'](_0x3c54ca,_0x241219);if(_0x241219['query'][_0xddd6('0xd3')](_0xddd6('0x47'))){_0x43ae44[_0xddd6('0x48')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xddd6('0xd4')],'as':_0xddd6('0xd5'),'attributes':['id',_0xddd6('0x3b'),_0xddd6('0xd6')],'where':_0x241219['query'][_0xddd6('0xd7')]?{'id':_0x241219[_0xddd6('0x49')][_0xddd6('0xd7')]}:undefined,'required':_0x241219[_0xddd6('0x49')][_0xddd6('0xd7')]?!![]:![]}];}return contacts[_0xddd6('0x4f')](_0x241219['query'],_0x241219['user'],_0x43ae44,_0x3c54ca);})['then'](respondWithFilteredResult(_0x56bac4,_0x43ae44))['catch'](APIHandleError(_0x56bac4));};exports[_0xddd6('0xd8')]=function(_0x82ea6,_0x1aa27b){var _0x44cb7f;var _0x65b099={};var _0x2a26ed;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x82ea6['params']['id']},'attributes':['id',_0xddd6('0x3b'),_0xddd6('0x2d')]})[_0xddd6('0x2c')](handleEntityNotFound(_0x1aa27b,null))['then'](function(_0x2b1c43){if(!utils['isValidChannel'](_0x82ea6[_0xddd6('0x49')][_0xddd6('0xa3')])){throw new db[(_0xddd6('0x94'))][(_0xddd6('0x98'))](_0xddd6('0xa8'));}_0x44cb7f=_0x2b1c43;var _0x5db397={};_0x5db397[_0xddd6('0x5c')]=_[_0xddd6('0x5e')](db[_['capitalize'](_0x82ea6[_0xddd6('0x49')][_0xddd6('0xa3')])+_0xddd6('0xd9')]['rawAttributes']);_0x5db397[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0x82ea6['query']);_0x5db397[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0x5db397['model'],_0x5db397[_0xddd6('0x49')]);_0x65b099[_0xddd6('0x4d')]=_['intersection'](_0x5db397[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0x82ea6[_0xddd6('0x49')][_0xddd6('0x61')]));_0x65b099[_0xddd6('0x4d')]=_0x65b099['attributes']['length']?_0x65b099['attributes']:_0x5db397[_0xddd6('0x5c')];_0x65b099[_0xddd6('0xda')]=qs['sort'](_0x82ea6[_0xddd6('0x49')][_0xddd6('0xdb')]);_0x65b099[_0xddd6('0x46')]=qs[_0xddd6('0x5f')](_[_0xddd6('0xdc')](_0x82ea6[_0xddd6('0x49')],_0x5db397[_0xddd6('0x5f')]));if(_0x82ea6[_0xddd6('0x49')]['filter']){_0x65b099['where']=_['merge'](_0x65b099[_0xddd6('0x46')],{'$or':_['map'](_0x65b099[_0xddd6('0x4d')],function(_0x3cfe96){var _0x34f158={};_0x34f158[_0x3cfe96]={'$like':'%'+_0x82ea6['query']['filter']+'%'};return _0x34f158;})});}_0x65b099=_[_0xddd6('0x62')]({},_0x65b099,_0x82ea6[_0xddd6('0x63')]);switch(_0x44cb7f[_0xddd6('0x2d')]){case'admin':return db[_[_0xddd6('0xaa')](_0x82ea6['query'][_0xddd6('0xa3')])+_0xddd6('0xd9')][_0xddd6('0x4f')](_0x65b099);case _0xddd6('0x82'):case _0xddd6('0x2e'):return _0x44cb7f[_0xddd6('0xb2')+_[_0xddd6('0xaa')](_0x82ea6[_0xddd6('0x49')][_0xddd6('0xa3')])+_0xddd6('0xac')](_0x65b099);default:throw new db[(_0xddd6('0x94'))][(_0xddd6('0x98'))](_0xddd6('0xdd'));}})[_0xddd6('0x2c')](function(_0x571006){_0x2a26ed=_0x571006[_0xddd6('0x52')];if(!_0x82ea6['query'][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x65b099[_0xddd6('0x27')]=qs['limit'](_0x82ea6[_0xddd6('0x49')][_0xddd6('0x27')]);_0x65b099[_0xddd6('0x25')]=qs[_0xddd6('0x25')](_0x82ea6[_0xddd6('0x49')]['offset']);}switch(_0x44cb7f['role']){case _0xddd6('0x83'):return db[_[_0xddd6('0xaa')](_0x82ea6['query'][_0xddd6('0xa3')])+_0xddd6('0xd9')]['findAll'](_0x65b099);case _0xddd6('0x82'):case _0xddd6('0x2e'):return _0x44cb7f['get'+_[_0xddd6('0xaa')](_0x82ea6[_0xddd6('0x49')]['channel'])+'Queues'](_0x65b099);}})[_0xddd6('0x2c')](function(_0x353736){return{'count':_0x2a26ed,'rows':_0x353736};})[_0xddd6('0x2c')](respondWithResult(_0x1aa27b,null))[_0xddd6('0x5b')](handleError(_0x1aa27b,null));};exports[_0xddd6('0xdf')]=function(_0x1e568c,_0x17bd08){var _0x5a6a79={};var _0x4b80ca={};var _0x1f350f;var _0xc8ac77;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x1e568c[_0xddd6('0x65')]['id']}})['then'](handleEntityNotFound(_0x17bd08,null))[_0xddd6('0x2c')](function(_0x1afaca){if(_0x1afaca){_0x1f350f=_0x1afaca;_0x4b80ca[_0xddd6('0x5c')]=_[_0xddd6('0x5e')](db[_0xddd6('0xb5')][_0xddd6('0x3f')]);_0x4b80ca['query']=_[_0xddd6('0x5e')](_0x1e568c[_0xddd6('0x49')]);_0x4b80ca[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0x4b80ca['model'],_0x4b80ca[_0xddd6('0x49')]);_0x5a6a79[_0xddd6('0x4d')]=_[_0xddd6('0x60')](_0x4b80ca[_0xddd6('0x5c')],qs['fields'](_0x1e568c[_0xddd6('0x49')][_0xddd6('0x61')]));_0x5a6a79[_0xddd6('0x4d')]=_0x5a6a79[_0xddd6('0x4d')][_0xddd6('0x52')]?_0x5a6a79['attributes']:_0x4b80ca[_0xddd6('0x5c')];_0x5a6a79[_0xddd6('0xda')]=qs['sort'](_0x1e568c[_0xddd6('0x49')][_0xddd6('0xdb')]);_0x5a6a79[_0xddd6('0x46')]=qs[_0xddd6('0x5f')](_[_0xddd6('0xdc')](_0x1e568c[_0xddd6('0x49')],_0x4b80ca['filters']));if(_0x1e568c[_0xddd6('0x49')]['filter']){_0x5a6a79[_0xddd6('0x46')]=_[_0xddd6('0x62')](_0x5a6a79['where'],{'$or':_['map'](_0x5a6a79[_0xddd6('0x4d')],function(_0x84dc64){var _0x2ff68c={};_0x2ff68c[_0x84dc64]={'$like':'%'+_0x1e568c[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0x2ff68c;})});}_0x5a6a79=_['merge']({},_0x5a6a79,_0x1e568c[_0xddd6('0x63')]);return _0x1f350f[_0xddd6('0xdf')](_0x5a6a79);}})[_0xddd6('0x2c')](function(_0x4bc9d8){if(_0x4bc9d8){_0xc8ac77=_0x4bc9d8[_0xddd6('0x52')];if(!_0x1e568c[_0xddd6('0x49')][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x5a6a79[_0xddd6('0x27')]=qs[_0xddd6('0x27')](_0x1e568c[_0xddd6('0x49')][_0xddd6('0x27')]);_0x5a6a79[_0xddd6('0x25')]=qs[_0xddd6('0x25')](_0x1e568c[_0xddd6('0x49')]['offset']);}return _0x1f350f[_0xddd6('0xdf')](_0x5a6a79);}})['then'](function(_0x445ae3){if(_0x445ae3){return _0x445ae3?{'count':_0xc8ac77,'rows':_0x445ae3}:null;}})[_0xddd6('0x2c')](respondWithResult(_0x17bd08,null))[_0xddd6('0x5b')](handleError(_0x17bd08,null));};exports[_0xddd6('0xe0')]=function(_0x3008c4,_0x419cad){var _0x2a27c0={};var _0x6b964e={};var _0x4d2aeb;var _0x126297;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x3008c4[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x419cad,null))[_0xddd6('0x2c')](function(_0x1c5d75){if(_0x1c5d75){_0x4d2aeb=_0x1c5d75;_0x6b964e[_0xddd6('0x5c')]=_['keys'](db['ChatGroup'][_0xddd6('0x3f')]);_0x6b964e[_0xddd6('0x49')]=_['keys'](_0x3008c4[_0xddd6('0x49')]);_0x6b964e[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0x6b964e[_0xddd6('0x5c')],_0x6b964e[_0xddd6('0x49')]);_0x2a27c0[_0xddd6('0x4d')]=_['intersection'](_0x6b964e[_0xddd6('0x5c')],qs['fields'](_0x3008c4['query']['fields']));_0x2a27c0[_0xddd6('0x4d')]=_0x2a27c0[_0xddd6('0x4d')]['length']?_0x2a27c0[_0xddd6('0x4d')]:_0x6b964e[_0xddd6('0x5c')];_0x2a27c0['order']=qs[_0xddd6('0xdb')](_0x3008c4['query']['sort']);_0x2a27c0[_0xddd6('0x46')]=qs[_0xddd6('0x5f')](_['pick'](_0x3008c4[_0xddd6('0x49')],_0x6b964e[_0xddd6('0x5f')]));if(_0x3008c4[_0xddd6('0x49')][_0xddd6('0x42')]){_0x2a27c0['where']=_[_0xddd6('0x62')](_0x2a27c0[_0xddd6('0x46')],{'$or':_[_0xddd6('0x36')](_0x2a27c0['attributes'],function(_0x2fb019){var _0x22c6e5={};_0x22c6e5[_0x2fb019]={'$like':'%'+_0x3008c4[_0xddd6('0x49')]['filter']+'%'};return _0x22c6e5;})});}_0x2a27c0=_[_0xddd6('0x62')]({},_0x2a27c0,_0x3008c4[_0xddd6('0x63')]);return _0x4d2aeb[_0xddd6('0xe0')](_0x2a27c0);}})[_0xddd6('0x2c')](function(_0x18625b){if(_0x18625b){_0x126297=_0x18625b['length'];if(!_0x3008c4[_0xddd6('0x49')][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x2a27c0[_0xddd6('0x27')]=qs['limit'](_0x3008c4[_0xddd6('0x49')][_0xddd6('0x27')]);_0x2a27c0[_0xddd6('0x25')]=qs['offset'](_0x3008c4[_0xddd6('0x49')]['offset']);}return _0x4d2aeb[_0xddd6('0xe0')](_0x2a27c0);}})[_0xddd6('0x2c')](function(_0x230fe4){if(_0x230fe4){return _0x230fe4?{'count':_0x126297,'rows':_0x230fe4}:null;}})[_0xddd6('0x2c')](respondWithResult(_0x419cad,null))[_0xddd6('0x5b')](handleError(_0x419cad,null));};exports[_0xddd6('0xe1')]=function(_0xf33433,_0x561343){var _0x21cee6={'raw':!![],'where':{}};var _0x227679={};var _0x250934={'count':0x0,'rows':[]};return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0xf33433[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x561343,null))['then'](function(_0x1a5b7c){if(_0x1a5b7c){_0x227679[_0xddd6('0x5c')]=_[_0xddd6('0x5e')](db[_0xddd6('0xe2')][_0xddd6('0x3f')]);_0x227679[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0xf33433[_0xddd6('0x49')]);_0x227679['filters']=_['intersection'](_0x227679[_0xddd6('0x5c')],_0x227679[_0xddd6('0x49')]);_0x21cee6[_0xddd6('0x4d')]=_[_0xddd6('0x60')](_0x227679[_0xddd6('0x5c')],qs['fields'](_0xf33433[_0xddd6('0x49')]['fields']));_0x21cee6[_0xddd6('0x4d')]=_0x21cee6[_0xddd6('0x4d')][_0xddd6('0x52')]?_0x21cee6[_0xddd6('0x4d')]:_0x227679[_0xddd6('0x5c')];if(!_0xf33433[_0xddd6('0x49')][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x21cee6[_0xddd6('0x27')]=qs['limit'](_0xf33433['query'][_0xddd6('0x27')]);_0x21cee6[_0xddd6('0x25')]=qs['offset'](_0xf33433['query'][_0xddd6('0x25')]);}_0x21cee6[_0xddd6('0xda')]=qs['sort'](_0xf33433[_0xddd6('0x49')][_0xddd6('0xdb')]);_0x21cee6['where']=qs[_0xddd6('0x5f')](_[_0xddd6('0xdc')](_0xf33433[_0xddd6('0x49')],_0x227679['filters']));_0x21cee6[_0xddd6('0x46')][_0xddd6('0xe3')]=_0x1a5b7c['id'];if(_0xf33433[_0xddd6('0x49')][_0xddd6('0x42')]){_0x21cee6[_0xddd6('0x46')]=_[_0xddd6('0x62')](_0x21cee6[_0xddd6('0x46')],{'$or':_[_0xddd6('0x36')](_0x21cee6[_0xddd6('0x4d')],function(_0x36402e){var _0x46f294={};_0x46f294[_0x36402e]={'$like':'%'+_0xf33433[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0x46f294;})});}_0x21cee6=_[_0xddd6('0x62')]({},_0x21cee6,_0xf33433[_0xddd6('0x63')]);return db[_0xddd6('0xe2')][_0xddd6('0x28')]({'where':_0x21cee6['where']})[_0xddd6('0x2c')](function(_0x1095ad){_0x250934[_0xddd6('0x28')]=_0x1095ad;if(_0xf33433['query'][_0xddd6('0x47')]){_0x21cee6[_0xddd6('0x48')]=[{'all':!![]}];}return db['VoiceRecording'][_0xddd6('0x4f')](_0x21cee6);})[_0xddd6('0x2c')](function(_0x58c950){_0x250934['rows']=_0x58c950;return _0x250934;});}})[_0xddd6('0x2c')](respondWithFilteredResult(_0x561343,_0x21cee6))['catch'](handleError(_0x561343,null));};exports[_0xddd6('0xe4')]=function(_0x145a0e,_0x1ae54f){var _0x56a646={'raw':!![],'where':{}};var _0x40398a={};var _0x59471a={'count':0x0,'rows':[]};return db['User'][_0xddd6('0x9a')]({'where':{'id':_0x145a0e[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x1ae54f,null))[_0xddd6('0x2c')](function(_0x276969){if(_0x276969){_0x40398a[_0xddd6('0x5c')]=_['keys'](db[_0xddd6('0xe5')]['rawAttributes']);_0x40398a[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0x145a0e[_0xddd6('0x49')]);_0x40398a['filters']=_[_0xddd6('0x60')](_0x40398a[_0xddd6('0x5c')],_0x40398a[_0xddd6('0x49')]);_0x56a646['attributes']=_[_0xddd6('0x60')](_0x40398a[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0x145a0e[_0xddd6('0x49')][_0xddd6('0x61')]));_0x56a646[_0xddd6('0x4d')]=_0x56a646[_0xddd6('0x4d')][_0xddd6('0x52')]?_0x56a646['attributes']:_0x40398a[_0xddd6('0x5c')];if(!_0x145a0e['query']['hasOwnProperty'](_0xddd6('0xde'))){_0x56a646[_0xddd6('0x27')]=qs[_0xddd6('0x27')](_0x145a0e[_0xddd6('0x49')][_0xddd6('0x27')]);_0x56a646[_0xddd6('0x25')]=qs[_0xddd6('0x25')](_0x145a0e[_0xddd6('0x49')][_0xddd6('0x25')]);}_0x56a646[_0xddd6('0xda')]=qs[_0xddd6('0xdb')](_0x145a0e['query'][_0xddd6('0xdb')]);_0x56a646[_0xddd6('0x46')]=qs['filters'](_[_0xddd6('0xdc')](_0x145a0e[_0xddd6('0x49')],_0x40398a[_0xddd6('0x5f')]));_0x56a646[_0xddd6('0x46')][_0xddd6('0xe3')]=_0x276969['id'];if(_0x145a0e[_0xddd6('0x49')][_0xddd6('0x42')]){_0x56a646[_0xddd6('0x46')]=_[_0xddd6('0x62')](_0x56a646['where'],{'$or':_[_0xddd6('0x36')](_0x56a646['attributes'],function(_0x4e51b3){var _0x14e0db={};_0x14e0db[_0x4e51b3]={'$like':'%'+_0x145a0e[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0x14e0db;})});}_0x56a646=_[_0xddd6('0x62')]({},_0x56a646,_0x145a0e[_0xddd6('0x63')]);return db[_0xddd6('0xe5')]['count']({'where':_0x56a646[_0xddd6('0x46')]})[_0xddd6('0x2c')](function(_0x221650){_0x59471a['count']=_0x221650;if(_0x145a0e['query']['includeAll']){_0x56a646['include']=[{'all':!![]}];}return db[_0xddd6('0xe5')][_0xddd6('0x4f')](_0x56a646);})[_0xddd6('0x2c')](function(_0x30d639){_0x59471a[_0xddd6('0x50')]=_0x30d639;return _0x59471a;});}})[_0xddd6('0x2c')](respondWithFilteredResult(_0x1ae54f,_0x56a646))[_0xddd6('0x5b')](handleError(_0x1ae54f,null));};exports[_0xddd6('0xe6')]=function(_0x1dfd56,_0x1ee100){var _0xec3a65={};var _0x39a306={};var _0x126939;var _0x5267d6;return db['User'][_0xddd6('0x9a')]({'where':{'id':_0x1dfd56['params']['id']}})['then'](handleEntityNotFound(_0x1ee100,null))[_0xddd6('0x2c')](function(_0x4fda17){if(_0x4fda17){_0x126939=_0x4fda17;_0x39a306['model']=_[_0xddd6('0x5e')](db[_0xddd6('0xe7')][_0xddd6('0x3f')]);_0x39a306['query']=_[_0xddd6('0x5e')](_0x1dfd56[_0xddd6('0x49')]);_0x39a306[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0x39a306[_0xddd6('0x5c')],_0x39a306['query']);_0xec3a65['attributes']=_[_0xddd6('0x60')](_0x39a306['model'],qs[_0xddd6('0x61')](_0x1dfd56['query'][_0xddd6('0x61')]));_0xec3a65[_0xddd6('0x4d')]=_0xec3a65[_0xddd6('0x4d')][_0xddd6('0x52')]?_0xec3a65[_0xddd6('0x4d')]:_0x39a306[_0xddd6('0x5c')];_0xec3a65[_0xddd6('0xda')]=qs[_0xddd6('0xdb')](_0x1dfd56[_0xddd6('0x49')][_0xddd6('0xdb')]);_0xec3a65[_0xddd6('0x46')]=qs['filters'](_['pick'](_0x1dfd56[_0xddd6('0x49')],_0x39a306[_0xddd6('0x5f')]));if(_0x1dfd56[_0xddd6('0x49')][_0xddd6('0x42')]){_0xec3a65[_0xddd6('0x46')]=_[_0xddd6('0x62')](_0xec3a65[_0xddd6('0x46')],{'$or':_[_0xddd6('0x36')](_0xec3a65[_0xddd6('0x4d')],function(_0x57e18f){var _0x33eca5={};_0x33eca5[_0x57e18f]={'$like':'%'+_0x1dfd56[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0x33eca5;})});}_0xec3a65=_['merge']({},_0xec3a65,_0x1dfd56[_0xddd6('0x63')]);return _0x126939[_0xddd6('0xe6')](_0xec3a65);}})['then'](function(_0x164ddc){if(_0x164ddc){_0x5267d6=_0x164ddc[_0xddd6('0x52')];if(!_0x1dfd56[_0xddd6('0x49')]['hasOwnProperty'](_0xddd6('0xde'))){_0xec3a65[_0xddd6('0x27')]=qs['limit'](_0x1dfd56[_0xddd6('0x49')]['limit']);_0xec3a65['offset']=qs['offset'](_0x1dfd56['query']['offset']);}return _0x126939['getChatInteractions'](_0xec3a65);}})[_0xddd6('0x2c')](function(_0x5aef98){if(_0x5aef98){return _0x5aef98?{'count':_0x5267d6,'rows':_0x5aef98}:null;}})[_0xddd6('0x2c')](respondWithResult(_0x1ee100,null))['catch'](handleError(_0x1ee100,null));};exports[_0xddd6('0xe8')]=function(_0x239cfb,_0x26c91c){var _0x57d524={};var _0x5e360c={};var _0x136b12;var _0x1ab278;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x239cfb[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x26c91c,null))[_0xddd6('0x2c')](function(_0x42bbfd){if(_0x42bbfd){_0x136b12=_0x42bbfd;_0x5e360c[_0xddd6('0x5c')]=_['keys'](db[_0xddd6('0xe9')][_0xddd6('0x3f')]);_0x5e360c['query']=_['keys'](_0x239cfb[_0xddd6('0x49')]);_0x5e360c[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0x5e360c[_0xddd6('0x5c')],_0x5e360c[_0xddd6('0x49')]);_0x57d524[_0xddd6('0x4d')]=_[_0xddd6('0x60')](_0x5e360c[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0x239cfb[_0xddd6('0x49')]['fields']));_0x57d524['attributes']=_0x57d524[_0xddd6('0x4d')][_0xddd6('0x52')]?_0x57d524[_0xddd6('0x4d')]:_0x5e360c['model'];_0x57d524[_0xddd6('0xda')]=qs['sort'](_0x239cfb[_0xddd6('0x49')][_0xddd6('0xdb')]);_0x57d524[_0xddd6('0x46')]=qs['filters'](_[_0xddd6('0xdc')](_0x239cfb[_0xddd6('0x49')],_0x5e360c[_0xddd6('0x5f')]));if(_0x239cfb[_0xddd6('0x49')][_0xddd6('0x42')]){_0x57d524[_0xddd6('0x46')]=_['merge'](_0x57d524['where'],{'$or':_['map'](_0x57d524[_0xddd6('0x4d')],function(_0x16ec29){var _0x1e3c9e={};_0x1e3c9e[_0x16ec29]={'$like':'%'+_0x239cfb[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0x1e3c9e;})});}_0x57d524=_[_0xddd6('0x62')]({},_0x57d524,_0x239cfb['options']);return _0x136b12[_0xddd6('0xe8')](_0x57d524);}})[_0xddd6('0x2c')](function(_0x1d09fc){if(_0x1d09fc){_0x1ab278=_0x1d09fc['length'];if(!_0x239cfb[_0xddd6('0x49')][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x57d524[_0xddd6('0x27')]=qs[_0xddd6('0x27')](_0x239cfb[_0xddd6('0x49')]['limit']);_0x57d524[_0xddd6('0x25')]=qs[_0xddd6('0x25')](_0x239cfb['query'][_0xddd6('0x25')]);}return _0x136b12[_0xddd6('0xe8')](_0x57d524);}})['then'](function(_0x2aa028){if(_0x2aa028){return _0x2aa028?{'count':_0x1ab278,'rows':_0x2aa028}:null;}})[_0xddd6('0x2c')](respondWithResult(_0x26c91c,null))[_0xddd6('0x5b')](handleError(_0x26c91c,null));};exports['getMailInteractions']=function(_0x449e33,_0x5eb80a){var _0x43ab2e={'raw':!![],'where':{}};var _0x82b82c={};var _0x256fa5={'count':0x0,'rows':[]};return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x449e33['params']['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x5eb80a,null))[_0xddd6('0x2c')](function(_0x49df1c){if(_0x49df1c){_0x82b82c[_0xddd6('0x5c')]=_[_0xddd6('0x5e')](db[_0xddd6('0xea')][_0xddd6('0x3f')]);_0x82b82c[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0x449e33['query']);_0x82b82c['filters']=_['intersection'](_0x82b82c[_0xddd6('0x5c')],_0x82b82c[_0xddd6('0x49')]);_0x43ab2e['attributes']=_['intersection'](_0x82b82c[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0x449e33[_0xddd6('0x49')][_0xddd6('0x61')]));_0x43ab2e['attributes']=_0x43ab2e['attributes'][_0xddd6('0x52')]?_0x43ab2e[_0xddd6('0x4d')]:_0x82b82c[_0xddd6('0x5c')];if(!_0x449e33['query']['hasOwnProperty'](_0xddd6('0xde'))){_0x43ab2e[_0xddd6('0x27')]=qs[_0xddd6('0x27')](_0x449e33['query']['limit']);_0x43ab2e['offset']=qs[_0xddd6('0x25')](_0x449e33[_0xddd6('0x49')][_0xddd6('0x25')]);}_0x43ab2e[_0xddd6('0xda')]=qs['sort'](_0x449e33['query']['sort']);_0x43ab2e['where']=qs[_0xddd6('0x5f')](_[_0xddd6('0xdc')](_0x449e33['query'],_0x82b82c[_0xddd6('0x5f')]));_0x43ab2e[_0xddd6('0x46')][_0xddd6('0xe3')]=_0x49df1c['id'];if(_0x449e33[_0xddd6('0x49')][_0xddd6('0x42')]){_0x43ab2e[_0xddd6('0x46')]=_[_0xddd6('0x62')](_0x43ab2e[_0xddd6('0x46')],{'$or':_[_0xddd6('0x36')](_0x43ab2e[_0xddd6('0x4d')],function(_0x2cedc9){var _0x13e62d={};_0x13e62d[_0x2cedc9]={'$like':'%'+_0x449e33[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0x13e62d;})});}_0x43ab2e=_[_0xddd6('0x62')]({},_0x43ab2e,_0x449e33[_0xddd6('0x63')]);return db[_0xddd6('0xea')][_0xddd6('0x28')]({'where':_0x43ab2e[_0xddd6('0x46')]})[_0xddd6('0x2c')](function(_0x5113e7){_0x256fa5[_0xddd6('0x28')]=_0x5113e7;if(_0x449e33[_0xddd6('0x49')][_0xddd6('0x47')]){_0x43ab2e[_0xddd6('0x48')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x43ab2e);})[_0xddd6('0x2c')](function(_0x424aac){_0x256fa5[_0xddd6('0x50')]=_0x424aac;return _0x256fa5;});}})[_0xddd6('0x2c')](respondWithFilteredResult(_0x5eb80a,_0x43ab2e))['catch'](handleError(_0x5eb80a,null));};exports[_0xddd6('0xeb')]=function(_0x35c298,_0x3ab1eb){var _0x387a7d={};var _0x137ba1={};var _0xbf66dd;var _0x477108;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x35c298[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x3ab1eb,null))[_0xddd6('0x2c')](function(_0x285d43){if(_0x285d43){_0xbf66dd=_0x285d43;_0x137ba1[_0xddd6('0x5c')]=_['keys'](db[_0xddd6('0xec')][_0xddd6('0x3f')]);_0x137ba1[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0x35c298['query']);_0x137ba1[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0x137ba1[_0xddd6('0x5c')],_0x137ba1[_0xddd6('0x49')]);_0x387a7d['attributes']=_['intersection'](_0x137ba1[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0x35c298[_0xddd6('0x49')][_0xddd6('0x61')]));_0x387a7d[_0xddd6('0x4d')]=_0x387a7d['attributes']['length']?_0x387a7d[_0xddd6('0x4d')]:_0x137ba1[_0xddd6('0x5c')];_0x387a7d[_0xddd6('0xda')]=qs[_0xddd6('0xdb')](_0x35c298[_0xddd6('0x49')]['sort']);_0x387a7d[_0xddd6('0x46')]=qs['filters'](_[_0xddd6('0xdc')](_0x35c298[_0xddd6('0x49')],_0x137ba1[_0xddd6('0x5f')]));if(_0x35c298[_0xddd6('0x49')]['filter']){_0x387a7d[_0xddd6('0x46')]=_[_0xddd6('0x62')](_0x387a7d['where'],{'$or':_[_0xddd6('0x36')](_0x387a7d[_0xddd6('0x4d')],function(_0x1bfb6b){var _0xf9866b={};_0xf9866b[_0x1bfb6b]={'$like':'%'+_0x35c298[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0xf9866b;})});}_0x387a7d=_[_0xddd6('0x62')]({},_0x387a7d,_0x35c298[_0xddd6('0x63')]);return _0xbf66dd[_0xddd6('0xeb')](_0x387a7d);}})[_0xddd6('0x2c')](function(_0x49e994){if(_0x49e994){_0x477108=_0x49e994[_0xddd6('0x52')];if(!_0x35c298[_0xddd6('0x49')][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x387a7d[_0xddd6('0x27')]=qs[_0xddd6('0x27')](_0x35c298[_0xddd6('0x49')][_0xddd6('0x27')]);_0x387a7d['offset']=qs[_0xddd6('0x25')](_0x35c298[_0xddd6('0x49')]['offset']);}return _0xbf66dd[_0xddd6('0xeb')](_0x387a7d);}})['then'](function(_0x1c113a){if(_0x1c113a){return _0x1c113a?{'count':_0x477108,'rows':_0x1c113a}:null;}})[_0xddd6('0x2c')](respondWithResult(_0x3ab1eb,null))['catch'](handleError(_0x3ab1eb,null));};exports[_0xddd6('0xed')]=function(_0x181d63,_0x3944b1){var _0x184d51={};var _0x30a3dd={};var _0xb4301d;var _0x4c1ceb;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x181d63[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x3944b1,null))['then'](function(_0x22b938){if(_0x22b938){_0xb4301d=_0x22b938;_0x30a3dd[_0xddd6('0x5c')]=_[_0xddd6('0x5e')](db[_0xddd6('0xee')][_0xddd6('0x3f')]);_0x30a3dd[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0x181d63[_0xddd6('0x49')]);_0x30a3dd['filters']=_['intersection'](_0x30a3dd[_0xddd6('0x5c')],_0x30a3dd[_0xddd6('0x49')]);_0x184d51['attributes']=_[_0xddd6('0x60')](_0x30a3dd['model'],qs[_0xddd6('0x61')](_0x181d63[_0xddd6('0x49')][_0xddd6('0x61')]));_0x184d51[_0xddd6('0x4d')]=_0x184d51[_0xddd6('0x4d')][_0xddd6('0x52')]?_0x184d51[_0xddd6('0x4d')]:_0x30a3dd[_0xddd6('0x5c')];_0x184d51[_0xddd6('0xda')]=qs['sort'](_0x181d63[_0xddd6('0x49')][_0xddd6('0xdb')]);_0x184d51['where']=qs[_0xddd6('0x5f')](_[_0xddd6('0xdc')](_0x181d63[_0xddd6('0x49')],_0x30a3dd[_0xddd6('0x5f')]));if(_0x181d63[_0xddd6('0x49')][_0xddd6('0x42')]){_0x184d51[_0xddd6('0x46')]=_['merge'](_0x184d51[_0xddd6('0x46')],{'$or':_[_0xddd6('0x36')](_0x184d51[_0xddd6('0x4d')],function(_0x2a4d37){var _0x5bf257={};_0x5bf257[_0x2a4d37]={'$like':'%'+_0x181d63[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0x5bf257;})});}_0x184d51=_[_0xddd6('0x62')]({},_0x184d51,_0x181d63[_0xddd6('0x63')]);return _0xb4301d[_0xddd6('0xed')](_0x184d51);}})[_0xddd6('0x2c')](function(_0x535993){if(_0x535993){_0x4c1ceb=_0x535993[_0xddd6('0x52')];if(!_0x181d63[_0xddd6('0x49')][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x184d51[_0xddd6('0x27')]=qs[_0xddd6('0x27')](_0x181d63['query'][_0xddd6('0x27')]);_0x184d51[_0xddd6('0x25')]=qs[_0xddd6('0x25')](_0x181d63['query'][_0xddd6('0x25')]);}return _0xb4301d[_0xddd6('0xed')](_0x184d51);}})[_0xddd6('0x2c')](function(_0x435310){if(_0x435310){return _0x435310?{'count':_0x4c1ceb,'rows':_0x435310}:null;}})[_0xddd6('0x2c')](respondWithResult(_0x3944b1,null))['catch'](handleError(_0x3944b1,null));};exports[_0xddd6('0xef')]=function(_0x13b50a,_0x3d0582){var _0x4571d7={};var _0x1b027b={};var _0x1f6f3e;var _0x29c77f;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x13b50a[_0xddd6('0x65')]['id']}})[_0xddd6('0x2c')](handleEntityNotFound(_0x3d0582,null))[_0xddd6('0x2c')](function(_0x12ff6e){if(_0x12ff6e){_0x1f6f3e=_0x12ff6e;_0x1b027b[_0xddd6('0x5c')]=_[_0xddd6('0x5e')](db[_0xddd6('0xf0')][_0xddd6('0x3f')]);_0x1b027b[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0x13b50a[_0xddd6('0x49')]);_0x1b027b[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0x1b027b[_0xddd6('0x5c')],_0x1b027b[_0xddd6('0x49')]);_0x4571d7[_0xddd6('0x4d')]=_[_0xddd6('0x60')](_0x1b027b[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0x13b50a[_0xddd6('0x49')][_0xddd6('0x61')]));_0x4571d7[_0xddd6('0x4d')]=_0x4571d7[_0xddd6('0x4d')]['length']?_0x4571d7[_0xddd6('0x4d')]:_0x1b027b['model'];_0x4571d7[_0xddd6('0xda')]=qs[_0xddd6('0xdb')](_0x13b50a['query']['sort']);_0x4571d7[_0xddd6('0x46')]=qs['filters'](_[_0xddd6('0xdc')](_0x13b50a[_0xddd6('0x49')],_0x1b027b['filters']));if(_0x13b50a[_0xddd6('0x49')][_0xddd6('0x42')]){_0x4571d7['where']=_[_0xddd6('0x62')](_0x4571d7[_0xddd6('0x46')],{'$or':_[_0xddd6('0x36')](_0x4571d7[_0xddd6('0x4d')],function(_0x129726){var _0x47337f={};_0x47337f[_0x129726]={'$like':'%'+_0x13b50a[_0xddd6('0x49')]['filter']+'%'};return _0x47337f;})});}_0x4571d7=_[_0xddd6('0x62')]({},_0x4571d7,_0x13b50a[_0xddd6('0x63')]);return _0x1f6f3e[_0xddd6('0xef')](_0x4571d7);}})[_0xddd6('0x2c')](function(_0x2f7e01){if(_0x2f7e01){_0x29c77f=_0x2f7e01[_0xddd6('0x52')];if(!_0x13b50a['query'][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x4571d7[_0xddd6('0x27')]=qs[_0xddd6('0x27')](_0x13b50a['query'][_0xddd6('0x27')]);_0x4571d7[_0xddd6('0x25')]=qs[_0xddd6('0x25')](_0x13b50a['query']['offset']);}return _0x1f6f3e[_0xddd6('0xef')](_0x4571d7);}})[_0xddd6('0x2c')](function(_0xcc9dea){if(_0xcc9dea){return _0xcc9dea?{'count':_0x29c77f,'rows':_0xcc9dea}:null;}})[_0xddd6('0x2c')](respondWithResult(_0x3d0582,null))[_0xddd6('0x5b')](handleError(_0x3d0582,null));};exports[_0xddd6('0xf1')]=function(_0x1a5831,_0x20c8db,_0x5baefd){var _0x884607;var _0x25d30c;var _0x35ab53;var _0x631a7a=!_[_0xddd6('0x6c')](_0x1a5831['params']['id'])?_0x1a5831['params']['id']:!_[_0xddd6('0x6c')](_0x1a5831[_0xddd6('0x82')]['id'])?_0x1a5831[_0xddd6('0x82')]['id']:null;return db[_0xddd6('0x3e')][_0xddd6('0x38')]({'where':{'id':_0x631a7a,'role':{'$or':[_0xddd6('0x83'),_0xddd6('0x82'),_0xddd6('0x2e')]}},'attributes':['id',_0xddd6('0x3b'),_0xddd6('0xf2'),_0xddd6('0xf3'),'role','internal','loginInPause']})[_0xddd6('0x2c')](function(_0x1d01e6){if(_0x1d01e6){if(_0x1d01e6[_0xddd6('0x2d')]===_0xddd6('0x2e')){_0x884607=_0x1d01e6;if(_0x1a5831[_0xddd6('0x64')][_0xddd6('0xa6')]){_0x35ab53=util[_0xddd6('0xb3')](_0xddd6('0xf4'),_0x884607[_0x1a5831[_0xddd6('0x64')][_0xddd6('0xa6')]]);}else if(_0x1a5831[_0xddd6('0x64')]['intrf']){_0x35ab53=util[_0xddd6('0xb3')](_0xddd6('0xf5'),_0x1a5831[_0xddd6('0x64')][_0xddd6('0xf6')]);}else{_0x35ab53=util[_0xddd6('0xb3')](_0xddd6('0xf5'),_0x884607[_0xddd6('0x3b')]);}socket['to'](util['format'](_0xddd6('0xf7'),_0x884607[_0xddd6('0x3b')]))[_0xddd6('0xaf')](_0xddd6('0xf8'),{'user':{'id':_0x884607['id'],'name':_0x884607[_0xddd6('0x3b')]},'ip':_0x1a5831[_0xddd6('0xf9')][_0xddd6('0xfa')]||_0x1a5831['connection']['remoteAddress']||_0x1a5831['socket']['remoteAddress']||_0x1a5831['connection']['socket'][_0xddd6('0xfb')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x884607[_0xddd6('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0xddd6('0x94'))][(_0xddd6('0x98'))](_0xddd6('0xfc'));}})[_0xddd6('0x2c')](function(){if(_0x884607){return _0x884607['getVoiceQueues']({'raw':!![]});}})[_0xddd6('0x2c')](function(_0x3129f2){if(_0x884607){if(_0x3129f2){_0x25d30c=_0x3129f2;if(_0x25d30c['length']){var _0x364e60=_0x25d30c['map'](function(_0x55b0c5){var _0x4dff16={'membername':_0x884607[_0xddd6('0x3b')],'UserId':_0x884607['id'],'queue_name':_0x55b0c5[_0xddd6('0x3b')],'VoiceQueueId':_0x55b0c5['id'],'interface':_0x35ab53,'paused':_0x884607[_0xddd6('0xfd')]||![],'penalty':_0x55b0c5[_0xddd6('0xfe')]||0x0};return db[_0xddd6('0xb5')][_0xddd6('0xff')](_0x4dff16);});return Promise[_0xddd6('0x5a')](_0x364e60);}}}})[_0xddd6('0x2c')](function(){if(_0x884607){return db[_0xddd6('0x100')][_0xddd6('0x4f')]({'where':{'membername':_0x884607['name'],'exitAt':null}});}})['then'](function(_0x15999f){if(_0x884607){var _0x216456=[];_0x15999f[_0xddd6('0x101')](function(_0x4caa84){_0x216456[_0xddd6('0x4e')](_0x4caa84[_0xddd6('0x2b')]({'exitAt':moment()['format'](_0xddd6('0x102'))}));});return Promise['all'](_0x216456);}})[_0xddd6('0x2c')](function(){if(_0x884607){var _0x1df430=[];var _0x2ab5c0=[];var _0xdb3205=utils[_0xddd6('0x103')]();var _0x331d6c={'membername':_0x884607['name'],'interface':_0x35ab53,'enterAt':moment()[_0xddd6('0xb3')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x884607[_0xddd6('0x2d')],'internal':_0x884607[_0xddd6('0x69')]};_0xdb3205['forEach'](function(_0x161e5a){_0x1df430[_0xddd6('0x4e')](_[_0xddd6('0x62')]({'channel':_0x161e5a,'type':_0xddd6('0x104'),'data1':_0x1a5831[_0xddd6('0x64')][_0xddd6('0x105')],'data2':_0x35ab53},_0x331d6c));if(_0x884607['loginInPause']){_0x2ab5c0[_0xddd6('0x4e')](_[_0xddd6('0x62')]({'channel':_0x161e5a,'type':_0xddd6('0x106'),'data1':_0xddd6('0x107')},_0x331d6c));}});return db[_0xddd6('0x100')][_0xddd6('0x8d')](_0x1df430[_0xddd6('0xd1')](_0x2ab5c0),{'individualHooks':!![]});}})[_0xddd6('0x2c')](function(){if(_0x884607){return _0x884607[_0xddd6('0x2b')]({'online':!![],'lastLoginAt':moment()[_0xddd6('0xb3')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x884607[_0xddd6('0xfd')]||![],'mailPause':_0x884607['loginInPause']||![],'chatPause':_0x884607['loginInPause']||![],'faxPause':_0x884607[_0xddd6('0xfd')]||![],'smsPause':_0x884607['loginInPause']||![],'openchannelPause':_0x884607[_0xddd6('0xfd')]||![],'whatsappPause':_0x884607[_0xddd6('0xfd')]||![],'pauseType':_0x884607['loginInPause']?_0xddd6('0x107'):null,'interface':_0x35ab53,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xddd6('0x2c')](function(_0x34b09c){if(_0x1a5831[_0xddd6('0x108')]){return _0x5baefd();}else{return Promise['resolve'](_0x34b09c)[_0xddd6('0x2c')](respondWithResult(_0x20c8db,null));}})['catch'](handleError(_0x20c8db,null));};exports[_0xddd6('0x109')]=function(_0xd789a,_0x396781){var _0x281531;return db[_0xddd6('0x3e')]['find']({'where':{'id':_0xd789a['params']['id'],'role':_0xddd6('0x2e')},'attributes':['id',_0xddd6('0x3b'),_0xddd6('0x2d')]})[_0xddd6('0x2c')](handleEntityNotFound(_0x396781,null))[_0xddd6('0x2c')](function(_0x297248){if(_0x297248){_0x281531=_0x297248;return db[_0xddd6('0xb5')][_0xddd6('0x30')]({'where':{'membername':_0x281531[_0xddd6('0x3b')]},'individualHooks':!![]});}})[_0xddd6('0x2c')](function(){return db['MemberReport'][_0xddd6('0x4f')]({'where':{'membername':_0x281531[_0xddd6('0x3b')],'exitAt':null}});})[_0xddd6('0x2c')](function(_0x1e5267){var _0x19bc19=[];_0x1e5267[_0xddd6('0x101')](function(_0x4b1d16){_0x19bc19[_0xddd6('0x4e')](_0x4b1d16['update']({'exitAt':moment()['format'](_0xddd6('0x102'))}));});return Promise[_0xddd6('0x5a')](_0x19bc19);})[_0xddd6('0x2c')](function(){return _0x281531[_0xddd6('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xddd6('0x2c')](respondWithResult(_0x396781,null))[_0xddd6('0x5b')](handleError(_0x396781,null));};exports['pause']=function(_0x118210,_0x28fe0f){var _0x3898cf;return db['UserVoiceQueueRt'][_0xddd6('0x2b')]({'paused':0x1},{'where':{'UserId':_0x118210[_0xddd6('0x65')]['id']},'individualHooks':!![]})[_0xddd6('0x2c')](function(){return db['User']['find']({'where':{'id':_0x118210['params']['id'],'role':'agent'},'attributes':['id',_0xddd6('0x3b'),_0xddd6('0x2d'),'internal',_0xddd6('0xa6'),_0xddd6('0xa4')]});})[_0xddd6('0x2c')](handleEntityNotFound(_0x28fe0f,null))[_0xddd6('0x2c')](function(_0x18aa67){if(_0x18aa67){_0x3898cf=_0x18aa67;return respondWithRpcPromise(_0xddd6('0x10a'),_0xddd6('0x10b'),{'id':_0x3898cf['id'],'name':_0x3898cf['name'],'pause':!![]});}})['then'](function(){if(_0x3898cf){return db[_0xddd6('0x100')][_0xddd6('0x4f')]({'where':{'membername':_0x3898cf[_0xddd6('0x3b')],'type':_0xddd6('0x106'),'exitAt':null}});}})[_0xddd6('0x2c')](function(_0x5b0745){if(_0x5b0745[_0xddd6('0x52')]){var _0x4727f9=moment()[_0xddd6('0xb3')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4bf01a=0x0,_0x5327e3=_0x5b0745['length'];_0x4bf01a<_0x5327e3;_0x4bf01a++){_0x5b0745[_0x4bf01a][_0xddd6('0x10c')]({'exitAt':_0x4727f9});}}})['then'](function(){var _0xc86d64=[];var _0x504cbf=utils['getChannels']();_0x504cbf['forEach'](function(_0x22fcd1){_0xc86d64['push']({'channel':_0x22fcd1,'membername':_0x3898cf['name'],'interface':_[_0xddd6('0x6c')](_0x3898cf[_0xddd6('0xa6')])?util[_0xddd6('0xb3')](_0xddd6('0xf5'),_0x3898cf[_0xddd6('0x3b')]):_0x3898cf[_0xddd6('0xa6')],'type':'PAUSE','enterAt':moment()['format'](_0xddd6('0x102')),'data1':_0x118210[_0xddd6('0x64')][_0xddd6('0x41')]||_0xddd6('0x10d'),'role':_0x3898cf[_0xddd6('0x2d')],'internal':_0x3898cf[_0xddd6('0x69')]});});return db['MemberReport'][_0xddd6('0x8d')](_0xc86d64,{'individualHooks':!![]});})[_0xddd6('0x2c')](function(){return _0x3898cf[_0xddd6('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x118210[_0xddd6('0x64')][_0xddd6('0x41')]||_0xddd6('0x10d'),'lastPauseAt':moment()['format'](_0xddd6('0x102'))});})[_0xddd6('0x2c')](respondWithResult(_0x28fe0f,null))[_0xddd6('0x5b')](handleError(_0x28fe0f,null));};exports[_0xddd6('0x10e')]=function(_0x1e7f45,_0x840c19){if(_0x1e7f45[_0xddd6('0x64')][_0xddd6('0xa3')]&&!utils[_0xddd6('0xa7')](_0x1e7f45[_0xddd6('0x64')]['channel'])){throw new APIBadRequestError(util[_0xddd6('0xb3')](_0xddd6('0x10f'),_0x1e7f45['body'][_0xddd6('0xa3')]));}return db[_0xddd6('0x3e')][_0xddd6('0x38')]({'where':{'id':_0x1e7f45['params']['id']},'attributes':['id',_0xddd6('0x3b'),'role','internal','interface',_0xddd6('0xa4'),_0xddd6('0xa5'),_0xddd6('0x110'),_0xddd6('0x111'),_0xddd6('0x112'),'openchannelPause',_0xddd6('0x113'),_0xddd6('0x114'),_0xddd6('0x115'),'lastPauseAt']})[_0xddd6('0x2c')](function(_0x58760a){if(!_0x58760a){throw new APINotFoundError(util[_0xddd6('0xb3')](_0xddd6('0xd2'),_0x1e7f45[_0xddd6('0x65')]['id']));}return _0x58760a[_0xddd6('0x10e')](_0x1e7f45[_0xddd6('0x64')][_0xddd6('0xa3')]);})[_0xddd6('0x2c')](respondWithResult(_0x840c19,null))[_0xddd6('0x5b')](APIHandleError(_0x840c19));};exports[_0xddd6('0x116')]=function(_0xa3145a,_0xa0d442){var _0x10fbb9={};var _0xb53e7d={};var _0x297363;var _0x5cfc5a;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0xa3145a['params']['id']}})['then'](handleEntityNotFound(_0xa0d442,null))[_0xddd6('0x2c')](function(_0xaac96a){if(_0xaac96a){_0x297363=_0xaac96a;_0xb53e7d[_0xddd6('0x5c')]=_[_0xddd6('0x5e')](db[_0xddd6('0x117')][_0xddd6('0x3f')]);_0xb53e7d[_0xddd6('0x49')]=_['keys'](_0xa3145a['query']);_0xb53e7d[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0xb53e7d[_0xddd6('0x5c')],_0xb53e7d[_0xddd6('0x49')]);_0x10fbb9['attributes']=_[_0xddd6('0x60')](_0xb53e7d[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0xa3145a[_0xddd6('0x49')][_0xddd6('0x61')]));_0x10fbb9[_0xddd6('0x4d')]=_0x10fbb9[_0xddd6('0x4d')][_0xddd6('0x52')]?_0x10fbb9[_0xddd6('0x4d')]:_0xb53e7d['model'];_0x10fbb9['order']=qs[_0xddd6('0xdb')](_0xa3145a[_0xddd6('0x49')][_0xddd6('0xdb')]);_0x10fbb9[_0xddd6('0x46')]=qs[_0xddd6('0x5f')](_['pick'](_0xa3145a['query'],_0xb53e7d[_0xddd6('0x5f')]));if(_0xa3145a[_0xddd6('0x49')][_0xddd6('0x42')]){_0x10fbb9['where']=_[_0xddd6('0x62')](_0x10fbb9['where'],{'$or':_[_0xddd6('0x36')](_0x10fbb9[_0xddd6('0x4d')],function(_0x1f46b5){var _0x5e48b4={};_0x5e48b4[_0x1f46b5]={'$like':'%'+_0xa3145a[_0xddd6('0x49')][_0xddd6('0x42')]+'%'};return _0x5e48b4;})});}_0x10fbb9=_[_0xddd6('0x62')]({},_0x10fbb9,_0xa3145a['options']);return _0x297363[_0xddd6('0x116')](_0x10fbb9);}})[_0xddd6('0x2c')](function(_0x45bc5b){if(_0x45bc5b){_0x5cfc5a=_0x45bc5b[_0xddd6('0x52')];if(!_0xa3145a[_0xddd6('0x49')][_0xddd6('0xd3')]('nolimit')){_0x10fbb9['limit']=qs[_0xddd6('0x27')](_0xa3145a[_0xddd6('0x49')][_0xddd6('0x27')]);_0x10fbb9[_0xddd6('0x25')]=qs[_0xddd6('0x25')](_0xa3145a[_0xddd6('0x49')][_0xddd6('0x25')]);}return _0x297363['getTeams'](_0x10fbb9);}})['then'](function(_0x98ab20){if(_0x98ab20){return _0x98ab20?{'count':_0x5cfc5a,'rows':_0x98ab20}:null;}})[_0xddd6('0x2c')](respondWithResult(_0xa0d442,null))['catch'](handleError(_0xa0d442,null));};exports['addTeams']=function(_0x3f723d,_0x589be4){var _0x2e9965=_0x3f723d[_0xddd6('0x65')]['id'];var _0x3d7968=_0x3f723d[_0xddd6('0x64')]?_0x3f723d['body']['ids']:null;var _0x4ebf3f=[];return Promise['resolve']()[_0xddd6('0x2c')](function(){if(!_0x3d7968)throw new APIBadRequestError(_0xddd6('0x118'));})[_0xddd6('0x2c')](function(){return db['User'][_0xddd6('0x9a')]({'where':{'id':_0x2e9965}});})['then'](function(_0x4c151e){if(!_0x4c151e)throw new APINotFoundError(util[_0xddd6('0xb3')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3f723d[_0xddd6('0x65')]['id']));return db[_0xddd6('0x6e')][_0xddd6('0x119')](function(_0x129f0a){return _0x4c151e[_0xddd6('0x11a')](_0x3d7968,{'transaction':_0x129f0a})[_0xddd6('0x2c')](function(){return db[_0xddd6('0x117')][_0xddd6('0x4f')]({'where':{'id':{'$in':_0x3d7968}}});})['then'](function(_0x49efc3){var _0x53b9bf=_[_0xddd6('0x36')](_0x49efc3,function(_0x34ce7e){return _0x34ce7e[_0xddd6('0x11b')]();});return Promise[_0xddd6('0x5a')](_0x53b9bf);})[_0xddd6('0x2c')](function(_0x14483a){_0x4ebf3f=_[_0xddd6('0x11c')](_0x14483a);var _0x10a6df=_[_0xddd6('0x36')](_0x4ebf3f,function(_0x9d6b4a){return _0x9d6b4a[_0xddd6('0x11d')](_0x4c151e['id'],{'transaction':_0x129f0a});});return Promise['all'](_0x10a6df);})[_0xddd6('0x2c')](function(){if(!_0x4c151e[_0xddd6('0xa4')])return;var _0x376b99=_[_0xddd6('0x42')](_0x4ebf3f,function(_0x5c31c3){return _0x5c31c3[_0xddd6('0x11e')](_0xddd6('0xa3'))===_0xddd6('0x11f');});var _0x1ad3b1=_['map'](_0x376b99,function(_0x260a4e){return db['UserVoiceQueueRt'][_0xddd6('0xff')]({'membername':_0x4c151e[_0xddd6('0x3b')],'UserId':_0x4c151e['id'],'queue_name':_0x260a4e[_0xddd6('0x3b')],'VoiceQueueId':_0x260a4e['id'],'interface':_[_0xddd6('0x6c')](_0x4c151e[_0xddd6('0xa6')])?util[_0xddd6('0xb3')](_0xddd6('0xf5'),_0x4c151e[_0xddd6('0x3b')]):_0x4c151e['interface'],'paused':_0x4c151e[_0xddd6('0xa5')]||![],'penalty':_0x4c151e[_0xddd6('0xb4')]},{'transaction':_0x129f0a});});return Promise['all'](_0x1ad3b1);})[_0xddd6('0x2c')](function(){return db[_0xddd6('0x120')][_0xddd6('0x4f')]({'where':{'teamId':{'$in':_0x3d7968}}});})[_0xddd6('0x2c')](function(_0x36c719){var _0x422ddd=_[_0xddd6('0x36')](_0x36c719,function(_0x53f2c7){return db['UserVoicePrefix'][_0xddd6('0x89')]({'UserId':_0x4c151e['id'],'VoicePrefixId':_0x53f2c7[_0xddd6('0x121')]},{'transaction':_0x129f0a});});return Promise[_0xddd6('0x5a')](_0x422ddd);});});})['then'](function(){for(var _0x4f8d26=0x0;_0x4f8d26<_0x4ebf3f[_0xddd6('0x52')];_0x4f8d26++){var _0x2d0295=_0x4ebf3f[_0x4f8d26][_0xddd6('0x11e')]('channel');var _0x98e0fe=_0x2d0295+_0xddd6('0xae');socket[_0xddd6('0xaf')](_0xddd6('0x82')+_0x2d0295+_0xddd6('0xb0'),{'UserId':_0x2e9965,['queueField']:_0x4ebf3f[_0x4f8d26]['id']});}})[_0xddd6('0x2c')](respondWithStatusCode(_0x589be4,null))[_0xddd6('0x5b')](APIHandleError(_0x589be4));};exports['removeTeams']=function(_0x16bd7c,_0x225707){var _0x494522=_0x16bd7c[_0xddd6('0x65')]['id'];var _0x2c02ff=null;if(_0x16bd7c['query'][_0xddd6('0x67')]){_0x2c02ff=_[_0xddd6('0xb8')](_0x16bd7c[_0xddd6('0x49')][_0xddd6('0x67')])?_0x16bd7c['query'][_0xddd6('0x67')]:[_0x16bd7c[_0xddd6('0x49')][_0xddd6('0x67')]];}var _0x28cbde=[];return Promise['resolve']()[_0xddd6('0x2c')](function(){if(!_0x2c02ff)throw new APIBadRequestError(_0xddd6('0x122'));})[_0xddd6('0x2c')](function(){return db[_0xddd6('0x3e')]['findOne']({'where':{'id':_0x494522}});})[_0xddd6('0x2c')](function(_0x281b10){if(!_0x281b10)throw new APINotFoundError(util[_0xddd6('0xb3')](_0xddd6('0xd2'),_0x16bd7c[_0xddd6('0x65')]['id']));return db['sequelize'][_0xddd6('0x119')](function(_0x2b93e2){return _0x281b10[_0xddd6('0x123')](_0x2c02ff,{'transaction':_0x2b93e2})['then'](function(){return db[_0xddd6('0x117')][_0xddd6('0x4f')]({'where':{'id':{'$in':_0x2c02ff}}});})['then'](function(_0x1fe2f2){var _0x4376f3=_[_0xddd6('0x36')](_0x1fe2f2,function(_0x4c47ea){return _0x4c47ea[_0xddd6('0x11b')]();});return Promise['all'](_0x4376f3);})[_0xddd6('0x2c')](function(_0x34808f){_0x28cbde=_[_0xddd6('0x11c')](_0x34808f);var _0x5d9333=_['map'](_0x28cbde,function(_0x5d96e0){return _0x5d96e0[_0xddd6('0x124')](_0x281b10['id'],{'transaction':_0x2b93e2});});return Promise['all'](_0x5d9333);})[_0xddd6('0x2c')](function(){if(!_0x281b10['online'])return;var _0x27f228=_[_0xddd6('0x42')](_0x28cbde,function(_0x360c19){return _0x360c19[_0xddd6('0x11e')](_0xddd6('0xa3'))===_0xddd6('0x11f');});var _0x22a667=_[_0xddd6('0x36')](_0x27f228,function(_0x2ebe0e){return db[_0xddd6('0xb5')][_0xddd6('0x30')]({'where':{'VoiceQueueId':_0x2ebe0e['id'],'UserId':_0x281b10['id']},'transaction':_0x2b93e2});});return Promise[_0xddd6('0x5a')](_0x22a667);})[_0xddd6('0x2c')](function(){return db[_0xddd6('0x120')][_0xddd6('0x4f')]({'where':{'teamId':{'$in':_0x2c02ff}}});})[_0xddd6('0x2c')](function(_0x391598){var _0x4d0a8b=_['map'](_0x391598,function(_0x1f4737){return db[_0xddd6('0x125')][_0xddd6('0x30')]({'where':{'UserId':_0x281b10['id'],'VoicePrefixId':_0x1f4737[_0xddd6('0x121')]}},{'transaction':_0x2b93e2});});return Promise['all'](_0x4d0a8b);});});})[_0xddd6('0x2c')](function(){for(var _0x50e316=0x0;_0x50e316<_0x28cbde[_0xddd6('0x52')];_0x50e316++){var _0x2b35f2=_0x28cbde[_0x50e316][_0xddd6('0x11e')](_0xddd6('0xa3'));var _0x32c605=_0x2b35f2+_0xddd6('0xae');socket['emit'](_0xddd6('0x82')+_0x2b35f2+'Queue:remove',{'UserId':_0x494522,['queueField']:_0x28cbde[_0x50e316]['id']});}})[_0xddd6('0x2c')](respondWithStatusCode(_0x225707,null))[_0xddd6('0x5b')](APIHandleError(_0x225707));};exports['getLists']=function(_0x3d827c,_0x77be7d){var _0x141e67={};var _0x3a3888={};var _0x233e12;var _0x2ec8a9;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x3d827c[_0xddd6('0x65')]['id']}})['then'](handleEntityNotFound(_0x77be7d,null))['then'](function(_0x5f5648){if(_0x5f5648){_0x233e12=_0x5f5648;_0x3a3888['model']=_[_0xddd6('0x5e')](db['CmList'][_0xddd6('0x3f')]);_0x3a3888[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0x3d827c[_0xddd6('0x49')]);_0x3a3888[_0xddd6('0x5f')]=_[_0xddd6('0x60')](_0x3a3888[_0xddd6('0x5c')],_0x3a3888[_0xddd6('0x49')]);_0x141e67['attributes']=_[_0xddd6('0x60')](_0x3a3888[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0x3d827c[_0xddd6('0x49')][_0xddd6('0x61')]));_0x141e67[_0xddd6('0x4d')]=_0x141e67[_0xddd6('0x4d')]['length']?_0x141e67['attributes']:_0x3a3888[_0xddd6('0x5c')];_0x141e67[_0xddd6('0xda')]=qs[_0xddd6('0xdb')](_0x3d827c[_0xddd6('0x49')][_0xddd6('0xdb')]);_0x141e67[_0xddd6('0x46')]=qs['filters'](_[_0xddd6('0xdc')](_0x3d827c[_0xddd6('0x49')],_0x3a3888['filters']));if(_0x3d827c['query']['filter']){_0x141e67['where']=_[_0xddd6('0x62')](_0x141e67[_0xddd6('0x46')],{'$or':_[_0xddd6('0x36')](_0x141e67['attributes'],function(_0x1336aa){var _0x324acd={};_0x324acd[_0x1336aa]={'$like':'%'+_0x3d827c[_0xddd6('0x49')]['filter']+'%'};return _0x324acd;})});}_0x141e67=_[_0xddd6('0x62')]({},_0x141e67,_0x3d827c[_0xddd6('0x63')]);return _0x233e12['getLists'](_0x141e67);}})['then'](function(_0x525a5c){if(_0x525a5c){_0x2ec8a9=_0x525a5c[_0xddd6('0x52')];if(!_0x3d827c[_0xddd6('0x49')][_0xddd6('0xd3')](_0xddd6('0xde'))){_0x141e67['limit']=qs['limit'](_0x3d827c['query'][_0xddd6('0x27')]);_0x141e67[_0xddd6('0x25')]=qs[_0xddd6('0x25')](_0x3d827c[_0xddd6('0x49')][_0xddd6('0x25')]);}return _0x233e12[_0xddd6('0x126')](_0x141e67);}})[_0xddd6('0x2c')](function(_0x4e04be){if(_0x4e04be){return _0x4e04be?{'count':_0x2ec8a9,'rows':_0x4e04be}:null;}})[_0xddd6('0x2c')](respondWithResult(_0x77be7d,null))['catch'](handleError(_0x77be7d,null));};exports[_0xddd6('0x127')]=function(_0x516e27,_0x4facc7){var _0x44cdd4={};var _0x2e51e3={};var _0x1188c8;return db[_0xddd6('0x3e')][_0xddd6('0x9a')]({'where':{'id':_0x516e27['params']['id']}})['then'](handleEntityNotFound(_0x4facc7,null))[_0xddd6('0x2c')](function(_0x23959b){if(_0x23959b){_0x1188c8=_0x23959b;_0x2e51e3[_0xddd6('0x5c')]=_[_0xddd6('0x5e')](db[_0xddd6('0x3e')][_0xddd6('0x3f')]);_0x2e51e3[_0xddd6('0x49')]=_[_0xddd6('0x5e')](_0x516e27[_0xddd6('0x49')]);_0x2e51e3['filters']=_[_0xddd6('0x60')](_0x2e51e3[_0xddd6('0x5c')],_0x2e51e3[_0xddd6('0x49')]);_0x44cdd4[_0xddd6('0x4d')]=_[_0xddd6('0x60')](_0x2e51e3[_0xddd6('0x5c')],qs[_0xddd6('0x61')](_0x516e27[_0xddd6('0x49')][_0xddd6('0x61')]));_0x44cdd4[_0xddd6('0x4d')]=_0x44cdd4['attributes'][_0xddd6('0x52')]?_0x44cdd4[_0xddd6('0x4d')]:_0x2e51e3['model'];_0x44cdd4['order']=qs[_0xddd6('0xdb')](_0x516e27[_0xddd6('0x49')]['sort']);_0x44cdd4[_0xddd6('0x46')]=qs[_0xddd6('0x5f')](_[_0xddd6('0xdc')](_0x516e27[_0xddd6('0x49')],_0x2e51e3[_0xddd6('0x5f')]));if(_0x516e27[_0xddd6('0x49')][_0xddd6('0x42')]){_0x44cdd4[_0xddd6('0x46')]=_[_0xddd6('0x62')](_0x44cdd4[_0xddd6('0x46')],{'$or':_[_0xddd6('0x36')](_0x44cdd4[_0xddd6('0x4d')],function(_0x213a25){var _0xa9a0ff={};_0xa9a0ff[_0x213a25]={'$like':'%'+_0x516e27[_0xddd6('0x49')]['filter']+'%'};return _0xa9a0ff;})});}_0x44cdd4[_0xddd6('0x5c')]=db[_0xddd6('0x3e')];_0x44cdd4['as']=_0xddd6('0x32');_0x44cdd4=_['merge']({},_0x44cdd4,_0x516e27[_0xddd6('0x63')]);return _0x1188c8[_0xddd6('0x128')]({'include':[_0x44cdd4]});}})[_0xddd6('0x2c')](function(_0x5920da){if(_0x5920da){var _0x2cb0d6={},_0x34bce7=[];for(var _0xd833c1=0x0;_0xd833c1<_0x5920da['length'];_0xd833c1+=0x1){for(var _0x22a36b=0x0,_0x1b0304;_0x22a36b<_0x5920da[_0xd833c1]['Agents'][_0xddd6('0x52')];_0x22a36b+=0x1){_0x1b0304=_0x5920da[_0xd833c1][_0xddd6('0x32')][_0x22a36b][_0xddd6('0xb2')]({'plain':!![]});_0x2cb0d6[_0x1b0304['id']]=_0x1b0304;}}_0x2cb0d6=_[_0xddd6('0x129')](_0x2cb0d6);for(var _0x2612fa=qs[_0xddd6('0x25')](_0x516e27['query'][_0xddd6('0x25')]);_0x2612fa<_0x2cb0d6[_0xddd6('0x52')]&&_0x34bce7[_0xddd6('0x52')]=_0x158a08[_0x1c15('0x4e')]){throw new Error(_0x1c15('0x4f'));}})['then'](function(){if(_0x29f1c0){return db[_0x1c15('0x29')][_0x1c15('0x44')]({'where':{'membername':_0x29f1c0[_0x1c15('0x22')]},'individualHooks':!![]});}})[_0x1c15('0x18')](function(){if(_0x29f1c0){return _0x29f1c0[_0x1c15('0x50')]({'raw':!![]});}})[_0x1c15('0x18')](function(_0x3f9433){if(_0x29f1c0){if(_0x3f9433){var _0x28193f=[];_0xd8d3de=_0x3f9433;if(_0xd8d3de['length']){for(var _0x2e5f5c=0x0;_0x2e5f5c<_0xd8d3de[_0x1c15('0x2c')];_0x2e5f5c++){_0x28193f[_0x1c15('0x31')](db['UserVoiceQueueRt'][_0x1c15('0x51')]({'membername':_0x29f1c0['name'],'UserId':_0x29f1c0['id'],'queue_name':_0xd8d3de[_0x2e5f5c]['name'],'VoiceQueueId':_0xd8d3de[_0x2e5f5c]['id'],'interface':_0x34807b,'paused':_0x29f1c0[_0x1c15('0x49')]||![],'penalty':_0xd8d3de[_0x2e5f5c][_0x1c15('0x52')]||0x0}));}return BPromise[_0x1c15('0x45')](_0x28193f);}}}})[_0x1c15('0x18')](function(){if(_0x29f1c0){return db[_0x1c15('0x2b')]['findAll']({'where':{'membername':_0x29f1c0[_0x1c15('0x22')],'exitAt':null}});}})['then'](function(_0x4c257a){if(_0x29f1c0){if(_0x4c257a&&_0x4c257a['length']){var _0x3ac4af=[];_0x4c257a[_0x1c15('0x30')](function(_0x84eaad){_0x3ac4af['push'](_0x84eaad[_0x1c15('0x2a')]({'exitAt':moment()[_0x1c15('0x26')](_0x1c15('0x2d'))}));});return BPromise[_0x1c15('0x45')](_0x3ac4af);}}})['then'](function(){if(_0x29f1c0){var _0x1e5a1e=[];var _0x4a5f5d=[];var _0x102462=utils['getChannels']();var _0x396c09={'membername':_0x29f1c0[_0x1c15('0x22')],'interface':_0x34807b,'enterAt':moment()[_0x1c15('0x26')](_0x1c15('0x2d')),'role':_0x29f1c0[_0x1c15('0x23')],'internal':_0x29f1c0[_0x1c15('0x24')]};_0x102462[_0x1c15('0x30')](function(_0x3537e6){_0x1e5a1e[_0x1c15('0x31')](_[_0x1c15('0x53')]({'channel':_0x3537e6,'type':_0x1c15('0x54'),'data1':_0x1c15('0x55'),'data2':_0x34807b},_0x396c09));if(_0x29f1c0[_0x1c15('0x49')]){_0x4a5f5d['push'](_[_0x1c15('0x53')]({'channel':_0x3537e6,'type':_0x1c15('0x56'),'data1':_0x1c15('0x57')},_0x396c09));}});return db['MemberReport'][_0x1c15('0x38')](_0x1e5a1e[_0x1c15('0x58')](_0x4a5f5d),{'individualHooks':!![]});}})['then'](function(){if(_0x29f1c0){return _0x29f1c0[_0x1c15('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x1c15('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x29f1c0[_0x1c15('0x49')]||![],'mailPause':_0x29f1c0[_0x1c15('0x49')]||![],'chatPause':_0x29f1c0[_0x1c15('0x49')]||![],'faxPause':_0x29f1c0[_0x1c15('0x49')]||![],'smsPause':_0x29f1c0[_0x1c15('0x49')]||![],'openchannelPause':_0x29f1c0[_0x1c15('0x49')]||![],'pauseType':_0x29f1c0['loginInPause']?_0x1c15('0x57'):null,'lastPauseAt':moment()[_0x1c15('0x26')](_0x1c15('0x2d')),'interface':_0x34807b});}})[_0x1c15('0x18')](function(_0x19c08c){_0x1d08c3(_0x19c08c);})['catch'](function(_0x12a556){_0x3a50c7(_0x5e564f[_0x1c15('0x1b')](0x1f4,_0x12a556['message']));});});}; \ No newline at end of file +var _0x88e5=['limit','include','model','map','info','debug','error','message','ShowUser','User','then','stringify','catch','PauseUser','find','role','internal','interface','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','name','isNil','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','update','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','unpause','system','LogoutUser','destroy','findAll','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','options','raw','where','attributes'];(function(_0xfb4e7f,_0x387fd4){var _0x235ed5=function(_0x515329){while(--_0x515329){_0xfb4e7f['push'](_0xfb4e7f['shift']());}};_0x235ed5(++_0x387fd4);}(_0x88e5,0xa4));var _0x588e=function(_0x597e39,_0x26f975){_0x597e39=_0x597e39-0x0;var _0x2cfc99=_0x88e5[_0x597e39];return _0x2cfc99;};'use strict';var _=require(_0x588e('0x0'));var util=require(_0x588e('0x1'));var moment=require(_0x588e('0x2'));var BPromise=require(_0x588e('0x3'));var Redis=require(_0x588e('0x4'));var db=require(_0x588e('0x5'))['db'];var utils=require(_0x588e('0x6'));var logger=require(_0x588e('0x7'))('rpc');var config=require(_0x588e('0x8'));config[_0x588e('0x9')]=_[_0x588e('0xa')](config['redis'],{'host':_0x588e('0xb'),'port':0x18eb});var socket=require(_0x588e('0xc'))(new Redis(config[_0x588e('0x9')]));require(_0x588e('0xd'))[_0x588e('0xe')](socket);exports[_0x588e('0xf')]=function(_0x5e4b09){var _0x9abb61=this;return new Promise(function(_0x35f146,_0x3ae404){return db['User']['findAll']({'raw':_0x5e4b09[_0x588e('0x10')]?_0x5e4b09[_0x588e('0x10')][_0x588e('0x11')]===undefined?!![]:![]:!![],'where':_0x5e4b09[_0x588e('0x10')]?_0x5e4b09[_0x588e('0x10')][_0x588e('0x12')]||null:null,'attributes':_0x5e4b09[_0x588e('0x10')]?_0x5e4b09[_0x588e('0x10')][_0x588e('0x13')]||null:null,'limit':_0x5e4b09[_0x588e('0x10')]?_0x5e4b09['options'][_0x588e('0x14')]||null:null,'include':_0x5e4b09['options']?_0x5e4b09['options'][_0x588e('0x15')]?_['map'](_0x5e4b09[_0x588e('0x10')][_0x588e('0x15')],function(_0x27c912){return{'model':db[_0x27c912[_0x588e('0x16')]],'as':_0x27c912['as'],'attributes':_0x27c912[_0x588e('0x13')],'include':_0x27c912['include']?_[_0x588e('0x17')](_0x27c912['include'],function(_0x14679d){return{'model':db[_0x14679d['model']],'as':_0x14679d['as'],'attributes':_0x14679d[_0x588e('0x13')],'include':_0x14679d[_0x588e('0x15')]?_[_0x588e('0x17')](_0x14679d['include'],function(_0x3828dd){return{'model':db[_0x3828dd[_0x588e('0x16')]],'as':_0x3828dd['as'],'attributes':_0x3828dd[_0x588e('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3583f7){logger[_0x588e('0x18')](_0x588e('0xf'),_0x5e4b09);logger[_0x588e('0x19')]('GetUser',_0x5e4b09,JSON['stringify'](_0x3583f7));_0x35f146(_0x3583f7);})['catch'](function(_0x314385){logger[_0x588e('0x1a')](_0x588e('0xf'),_0x314385[_0x588e('0x1b')],_0x5e4b09);_0x3ae404(_0x9abb61['error'](0x1f4,_0x314385[_0x588e('0x1b')]));});});};exports[_0x588e('0x1c')]=function(_0x2c1dcc){var _0x54e0bb=this;return new Promise(function(_0xac5b1b,_0x39155b){return db[_0x588e('0x1d')]['find']({'raw':_0x2c1dcc['options']?_0x2c1dcc['options'][_0x588e('0x11')]===undefined?!![]:![]:!![],'where':_0x2c1dcc[_0x588e('0x10')]?_0x2c1dcc['options'][_0x588e('0x12')]||null:null,'attributes':_0x2c1dcc[_0x588e('0x10')]?_0x2c1dcc[_0x588e('0x10')][_0x588e('0x13')]||null:null,'include':_0x2c1dcc[_0x588e('0x10')]?_0x2c1dcc[_0x588e('0x10')]['include']?_[_0x588e('0x17')](_0x2c1dcc[_0x588e('0x10')][_0x588e('0x15')],function(_0x108a75){return{'model':db[_0x108a75['model']],'as':_0x108a75['as'],'attributes':_0x108a75[_0x588e('0x13')],'include':_0x108a75[_0x588e('0x15')]?_['map'](_0x108a75[_0x588e('0x15')],function(_0x169a94){return{'model':db[_0x169a94['model']],'as':_0x169a94['as'],'attributes':_0x169a94[_0x588e('0x13')],'include':_0x169a94[_0x588e('0x15')]?_[_0x588e('0x17')](_0x169a94[_0x588e('0x15')],function(_0xab920c){return{'model':db[_0xab920c[_0x588e('0x16')]],'as':_0xab920c['as'],'attributes':_0xab920c[_0x588e('0x13')]};}):[]};}):[]};}):[]:[]})[_0x588e('0x1e')](function(_0x150db1){logger[_0x588e('0x18')](_0x588e('0x1c'),_0x2c1dcc);logger['debug'](_0x588e('0x1c'),_0x2c1dcc,JSON[_0x588e('0x1f')](_0x150db1));_0xac5b1b(_0x150db1);})[_0x588e('0x20')](function(_0x37a070){logger[_0x588e('0x1a')](_0x588e('0x1c'),_0x37a070[_0x588e('0x1b')],_0x2c1dcc);_0x39155b(_0x54e0bb[_0x588e('0x1a')](0x1f4,_0x37a070['message']));});});};exports[_0x588e('0x21')]=function(_0x33424b){var _0x9aebbe;return db[_0x588e('0x1d')][_0x588e('0x22')]({'where':_0x33424b['options'][_0x588e('0x12')]||{},'attributes':['id','name',_0x588e('0x23'),_0x588e('0x24'),_0x588e('0x25')]})[_0x588e('0x1e')](function(_0x271688){if(!_0x271688){throw new Error(util['format'](_0x588e('0x26'),_0x33424b[_0x588e('0x27')]['id']));}_0x9aebbe=_0x271688;return db[_0x588e('0x28')]['update']({'paused':0x1},{'where':{'UserId':_0x9aebbe['id']},'individualHooks':!![]});})[_0x588e('0x1e')](function(){return db[_0x588e('0x29')]['findAll']({'where':{'membername':_0x9aebbe['name'],'type':_0x588e('0x2a'),'exitAt':null}});})['then'](function(_0x4025ca){if(_0x4025ca&&_0x4025ca[_0x588e('0x2b')]){var _0x476aa6=moment()[_0x588e('0x2c')](_0x588e('0x2d'));for(var _0x381512=0x0,_0x541061=_0x4025ca['length'];_0x381512<_0x541061;_0x381512++){_0x4025ca[_0x381512][_0x588e('0x2e')]({'exitAt':_0x476aa6});}}})[_0x588e('0x1e')](function(){var _0x653841=[];var _0x49f754=utils[_0x588e('0x2f')]();_0x49f754[_0x588e('0x30')](function(_0x118f63){_0x653841[_0x588e('0x31')]({'channel':_0x118f63,'membername':_0x9aebbe[_0x588e('0x32')],'interface':_[_0x588e('0x33')](_0x9aebbe['interface'])?util[_0x588e('0x2c')]('SIP/%s',_0x9aebbe[_0x588e('0x32')]):_0x9aebbe[_0x588e('0x25')],'type':_0x588e('0x2a'),'enterAt':moment()[_0x588e('0x2c')](_0x588e('0x2d')),'data1':_0x33424b[_0x588e('0x34')][_0x588e('0x35')]||_0x588e('0x36'),'role':_0x9aebbe['role'],'internal':_0x9aebbe[_0x588e('0x24')],'uniqueid':_0x33424b[_0x588e('0x34')][_0x588e('0x37')]||null});});return db[_0x588e('0x29')][_0x588e('0x38')](_0x653841,{'individualHooks':!![]});})[_0x588e('0x1e')](function(){return _0x9aebbe[_0x588e('0x39')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x33424b[_0x588e('0x34')][_0x588e('0x35')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x588e('0x2c')](_0x588e('0x2d'))});})[_0x588e('0x20')](function(_0x43fe9a){throw _0x43fe9a;});};exports[_0x588e('0x3a')]=function(_0x549c80){return Promise[_0x588e('0x3b')]()[_0x588e('0x1e')](function(){if(_0x549c80[_0x588e('0x34')][_0x588e('0x3c')]&&!utils[_0x588e('0x3d')](_0x549c80[_0x588e('0x34')]['channel'])){throw new Error(util[_0x588e('0x2c')](_0x588e('0x3e'),_0x549c80['body'][_0x588e('0x3c')]));}return db[_0x588e('0x1d')][_0x588e('0x3f')]({'where':_0x549c80[_0x588e('0x10')]['where']||{},'attributes':['id',_0x588e('0x32'),_0x588e('0x23'),_0x588e('0x24'),'interface',_0x588e('0x40'),_0x588e('0x41'),_0x588e('0x42'),'chatPause',_0x588e('0x43'),_0x588e('0x44'),_0x588e('0x45'),_0x588e('0x46'),_0x588e('0x47'),'lastPauseAt']});})[_0x588e('0x1e')](function(_0x2bb208){if(!_0x2bb208){throw new Error(util[_0x588e('0x2c')](_0x588e('0x26'),_0x549c80[_0x588e('0x27')]['id']));}return _0x2bb208[_0x588e('0x48')](_0x549c80[_0x588e('0x34')][_0x588e('0x3c')],_0x588e('0x49'));})[_0x588e('0x20')](function(_0x146c89){throw _0x146c89;});};exports[_0x588e('0x4a')]=function(_0x275e54){var _0x2fe450=this;return new Promise(function(_0x3425c9,_0x46abef){var _0xfa5e87;return db['User'][_0x588e('0x3f')]({'where':_0x275e54[_0x588e('0x10')]['where']||{},'attributes':['id','name']})[_0x588e('0x1e')](function(_0x5d43f9){if(_0x5d43f9){_0xfa5e87=_0x5d43f9;return db[_0x588e('0x28')][_0x588e('0x4b')]({'where':{'membername':_0xfa5e87[_0x588e('0x32')]},'individualHooks':!![]});}})[_0x588e('0x1e')](function(){if(_0xfa5e87){return db[_0x588e('0x29')][_0x588e('0x4c')]({'where':{'membername':_0xfa5e87[_0x588e('0x32')],'exitAt':null}});}})[_0x588e('0x1e')](function(_0xbcc405){if(_0xfa5e87){if(_0xbcc405&&_0xbcc405['length']){var _0x22e17a=[];_0xbcc405[_0x588e('0x30')](function(_0x4a28e9){_0x22e17a[_0x588e('0x31')](_0x4a28e9[_0x588e('0x39')]({'exitAt':moment()['format'](_0x588e('0x2d'))}));});return BPromise['all'](_0x22e17a);}}})['then'](function(){if(_0xfa5e87){return _0xfa5e87[_0x588e('0x39')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x588e('0x1e')](function(_0x1ef3e9){_0x3425c9(_0x1ef3e9);})['catch'](function(_0x516dbf){_0x46abef(_0x2fe450['error'](0x1f4,_0x516dbf[_0x588e('0x1b')]));});});};exports['LoginUser']=function(_0x22315f){var _0x3cc065=this;return new Promise(function(_0x53e305,_0x3c4fc3){var _0x59f244;var _0x59629e;var _0x288c8c;var _0x1fbc67;return db[_0x588e('0x1d')]['findOne']({'where':_0x22315f[_0x588e('0x10')][_0x588e('0x12')]||{},'attributes':['id','name',_0x588e('0x23'),'mobile','phone',_0x588e('0x24'),_0x588e('0x4d'),_0x588e('0x25')]})['then'](function(_0x1503a6){if(_0x1503a6){_0x59f244=_0x1503a6;_0x1fbc67=_0x22315f[_0x588e('0x34')][_0x588e('0x25')]?_0x22315f[_0x588e('0x34')][_0x588e('0x25')]:util[_0x588e('0x2c')]('SIP/%s',_0x59f244[_0x588e('0x32')]);return db[_0x588e('0x1d')][_0x588e('0x4e')]({'where':{'role':_0x588e('0x4f'),'online':!![],'id':{'$ne':_0x59f244['id']}}});}})['then'](function(_0x4affeb){if(_0x4affeb){_0x288c8c=_0x4affeb;return require('../../config/license/util')[_0x588e('0x50')]();}})[_0x588e('0x1e')](function(_0xf7806f){if(_0xf7806f&&_0xf7806f['agents']&&_0x288c8c>=_0xf7806f[_0x588e('0x51')]){throw new Error(_0x588e('0x52'));}})[_0x588e('0x1e')](function(){if(_0x59f244){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x59f244['name']},'individualHooks':!![]});}})[_0x588e('0x1e')](function(){if(_0x59f244){return _0x59f244[_0x588e('0x53')]({'raw':!![]});}})[_0x588e('0x1e')](function(_0x49ad92){if(_0x59f244){if(_0x49ad92){var _0x16b2e5=[];_0x59629e=_0x49ad92;if(_0x59629e[_0x588e('0x2b')]){for(var _0x392b58=0x0;_0x392b58<_0x59629e[_0x588e('0x2b')];_0x392b58++){_0x16b2e5[_0x588e('0x31')](db[_0x588e('0x28')][_0x588e('0x54')]({'membername':_0x59f244[_0x588e('0x32')],'UserId':_0x59f244['id'],'queue_name':_0x59629e[_0x392b58][_0x588e('0x32')],'VoiceQueueId':_0x59629e[_0x392b58]['id'],'interface':_0x1fbc67,'paused':_0x59f244[_0x588e('0x4d')]||![],'penalty':_0x59629e[_0x392b58][_0x588e('0x55')]||0x0}));}return BPromise['all'](_0x16b2e5);}}}})[_0x588e('0x1e')](function(){if(_0x59f244){return db[_0x588e('0x29')][_0x588e('0x4c')]({'where':{'membername':_0x59f244['name'],'exitAt':null}});}})['then'](function(_0x1076fe){if(_0x59f244){if(_0x1076fe&&_0x1076fe['length']){var _0x156872=[];_0x1076fe['forEach'](function(_0xf69154){_0x156872[_0x588e('0x31')](_0xf69154[_0x588e('0x39')]({'exitAt':moment()[_0x588e('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x588e('0x56')](_0x156872);}}})[_0x588e('0x1e')](function(){if(_0x59f244){var _0x5b78e6=[];var _0x27adf1=[];var _0x34aad1=utils[_0x588e('0x2f')]();var _0x27863f={'membername':_0x59f244['name'],'interface':_0x1fbc67,'enterAt':moment()['format'](_0x588e('0x2d')),'role':_0x59f244[_0x588e('0x23')],'internal':_0x59f244[_0x588e('0x24')]};_0x34aad1['forEach'](function(_0x37e304){_0x5b78e6[_0x588e('0x31')](_['merge']({'channel':_0x37e304,'type':_0x588e('0x57'),'data1':_0x588e('0x58'),'data2':_0x1fbc67},_0x27863f));if(_0x59f244[_0x588e('0x4d')]){_0x27adf1[_0x588e('0x31')](_[_0x588e('0x59')]({'channel':_0x37e304,'type':_0x588e('0x2a'),'data1':_0x588e('0x5a')},_0x27863f));}});return db[_0x588e('0x29')][_0x588e('0x38')](_0x5b78e6[_0x588e('0x5b')](_0x27adf1),{'individualHooks':!![]});}})[_0x588e('0x1e')](function(){if(_0x59f244){return _0x59f244[_0x588e('0x39')]({'online':!![],'lastLoginAt':moment()[_0x588e('0x2c')](_0x588e('0x2d')),'voicePause':_0x59f244[_0x588e('0x4d')]||![],'mailPause':_0x59f244[_0x588e('0x4d')]||![],'chatPause':_0x59f244[_0x588e('0x4d')]||![],'faxPause':_0x59f244['loginInPause']||![],'smsPause':_0x59f244[_0x588e('0x4d')]||![],'openchannelPause':_0x59f244['loginInPause']||![],'pauseType':_0x59f244[_0x588e('0x4d')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x588e('0x2d')),'interface':_0x1fbc67});}})['then'](function(_0x18ea27){_0x53e305(_0x18ea27);})[_0x588e('0x20')](function(_0x113f9d){_0x3c4fc3(_0x3cc065['error'](0x1f4,_0x113f9d['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 055836e..1d09a90 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 _0x2610=['update','emit','removeListener','register','length','user:','save','remove'];(function(_0x5cddba,_0x2b4773){var _0x7ef702=function(_0x56f35f){while(--_0x56f35f){_0x5cddba['push'](_0x5cddba['shift']());}};_0x7ef702(++_0x2b4773);}(_0x2610,0x1b6));var _0x0261=function(_0x236e4b,_0x136c92){_0x236e4b=_0x236e4b-0x0;var _0x5cce4e=_0x2610[_0x236e4b];return _0x5cce4e;};'use strict';var UserEvents=require('./user.events');var events=[_0x0261('0x0'),_0x0261('0x1'),_0x0261('0x2')];function createListener(_0x2b3682,_0x21bd66){return function(_0x2f7dbd){_0x21bd66[_0x0261('0x3')](_0x2b3682,_0x2f7dbd);};}function removeListener(_0x3e9130,_0x55a59b){return function(){UserEvents[_0x0261('0x4')](_0x3e9130,_0x55a59b);};}exports[_0x0261('0x5')]=function(_0x4580c5){for(var _0x1c3d1f=0x0,_0x459af1=events[_0x0261('0x6')];_0x1c3d1f<_0x459af1;_0x1c3d1f++){var _0xfb83d5=events[_0x1c3d1f];var _0x4f0663=createListener(_0x0261('0x7')+_0xfb83d5,_0x4580c5);UserEvents['on'](_0xfb83d5,_0x4f0663);}}; \ No newline at end of file +var _0xf4a7=['update','register','user:','./user.events','remove'];(function(_0x3aba75,_0x231d0b){var _0xf00e69=function(_0x36d82c){while(--_0x36d82c){_0x3aba75['push'](_0x3aba75['shift']());}};_0xf00e69(++_0x231d0b);}(_0xf4a7,0x1d9));var _0x7f4a=function(_0x3b10b8,_0x56296e){_0x3b10b8=_0x3b10b8-0x0;var _0x5997ba=_0xf4a7[_0x3b10b8];return _0x5997ba;};'use strict';var UserEvents=require(_0x7f4a('0x0'));var events=['save',_0x7f4a('0x1'),_0x7f4a('0x2')];function createListener(_0x208c05,_0x475fea){return function(_0x560fba){_0x475fea['emit'](_0x208c05,_0x560fba);};}function removeListener(_0x2d9db5,_0x387052){return function(){UserEvents['removeListener'](_0x2d9db5,_0x387052);};}exports[_0x7f4a('0x3')]=function(_0x2fcf93){for(var _0xae4c30=0x0,_0xeb98a8=events['length'];_0xae4c30<_0xeb98a8;_0xae4c30++){var _0xe221c0=events[_0xae4c30];var _0x279277=createListener(_0x7f4a('0x4')+_0xe221c0,_0x2fcf93);UserEvents['on'](_0xe221c0,_0x279277);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index a084fc6..aed0588 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x34ecb6,_0x7e484b){var _0x209e66=function(_0xa6055e){while(--_0xa6055e){_0x34ecb6['push'](_0x34ecb6['shift']());}};_0x209e66(++_0x7e484b);}(_0x70e0,0x17b));var _0x070e=function(_0x348ca1,_0x429707){_0x348ca1=_0x348ca1-0x0;var _0x466322=_0x70e0[_0x348ca1];return _0x466322;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x14270b,_0x4d10f6){var _0x392388=function(_0x24b1be){while(--_0x24b1be){_0x14270b['push'](_0x14270b['shift']());}};_0x392388(++_0x4d10f6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xcb91[_0x67f95e];return _0x538f5a;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 83f2e0b..af5dd12 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 _0x1f28=['INTEGER'];(function(_0x5c47b6,_0x354b66){var _0x4bed82=function(_0x1cc30f){while(--_0x1cc30f){_0x5c47b6['push'](_0x5c47b6['shift']());}};_0x4bed82(++_0x354b66);}(_0x1f28,0x1db));var _0x81f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1f28[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x81f2('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3981=['sequelize','INTEGER'];(function(_0x4f7393,_0x337b2c){var _0x262904=function(_0x327049){while(--_0x327049){_0x4f7393['push'](_0x4f7393['shift']());}};_0x262904(++_0x337b2c);}(_0x3981,0x144));var _0x1398=function(_0x18dcdf,_0x41808c){_0x18dcdf=_0x18dcdf-0x0;var _0x34a6b4=_0x3981[_0x18dcdf];return _0x34a6b4;};'use strict';var Sequelize=require(_0x1398('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1398('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 f0512b4..c672886 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 _0xadcc=['path','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0xb351f6,_0x27660f){var _0x2516e8=function(_0x68ab1f){while(--_0x68ab1f){_0xb351f6['push'](_0xb351f6['shift']());}};_0x2516e8(++_0x27660f);}(_0xadcc,0x11a));var _0xcadc=function(_0x442217,_0x204b10){_0x442217=_0x442217-0x0;var _0x2d22a5=_0xadcc[_0x442217];return _0x2d22a5;};'use strict';var _=require(_0xcadc('0x0'));var util=require(_0xcadc('0x1'));var logger=require('../../config/logger')(_0xcadc('0x2'));var moment=require(_0xcadc('0x3'));var BPromise=require(_0xcadc('0x4'));var rp=require(_0xcadc('0x5'));var fs=require('fs');var path=require(_0xcadc('0x6'));var rimraf=require('rimraf');var config=require(_0xcadc('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xcadc('0x8')]=function(_0x4a9320,_0x48f336){return _0x4a9320[_0xcadc('0x9')](_0xcadc('0xa'),attributes,{'tableName':_0xcadc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06ff=['api','moment','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger'];(function(_0x587cbf,_0x5ac394){var _0x1abe6e=function(_0x4f583f){while(--_0x4f583f){_0x587cbf['push'](_0x587cbf['shift']());}};_0x1abe6e(++_0x5ac394);}(_0x06ff,0x9a));var _0xf06f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x06ff[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xf06f('0x0'));var logger=require(_0xf06f('0x1'))(_0xf06f('0x2'));var moment=require(_0xf06f('0x3'));var BPromise=require(_0xf06f('0x4'));var rp=require(_0xf06f('0x5'));var fs=require('fs');var path=require(_0xf06f('0x6'));var rimraf=require(_0xf06f('0x7'));var config=require('../../config/environment');var attributes=require(_0xf06f('0x8'));module[_0xf06f('0x9')]=function(_0x1a42e8,_0x4cb1e5){return _0x1a42e8[_0xf06f('0xa')](_0xf06f('0xb'),attributes,{'tableName':_0xf06f('0xc'),'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 e259d8e..b170fe0 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 _0x3a26=['client','http','request','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x3a26,0x142));var _0x63a2=function(_0x54e883,_0x484291){_0x54e883=_0x54e883-0x0;var _0x235120=_0x3a26[_0x54e883];return _0x235120;};'use strict';var _=require('lodash');var util=require(_0x63a2('0x0'));var moment=require(_0x63a2('0x1'));var BPromise=require(_0x63a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63a2('0x3'));var db=require(_0x63a2('0x4'))['db'];var utils=require(_0x63a2('0x5'));var logger=require('../../config/logger')(_0x63a2('0x6'));var config=require(_0x63a2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x63a2('0x8')][_0x63a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1294b0,_0x17f43c,_0x2a3020){return new BPromise(function(_0x285aa5,_0x2fbd6e){return client[_0x63a2('0xa')](_0x1294b0,_0x2a3020)[_0x63a2('0xb')](function(_0x12fbfd){logger[_0x63a2('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x17f43c,'request\x20sent');logger[_0x63a2('0xd')](_0x63a2('0xe'),_0x17f43c,_0x63a2('0xf'),JSON[_0x63a2('0x10')](_0x12fbfd));if(_0x12fbfd[_0x63a2('0x11')]){if(_0x12fbfd[_0x63a2('0x11')][_0x63a2('0x12')]===0x1f4){logger[_0x63a2('0x11')](_0x63a2('0x13'),_0x17f43c,_0x12fbfd[_0x63a2('0x11')][_0x63a2('0x14')]);return _0x2fbd6e(_0x12fbfd[_0x63a2('0x11')][_0x63a2('0x14')]);}logger[_0x63a2('0x11')](_0x63a2('0x13'),_0x17f43c,_0x12fbfd[_0x63a2('0x11')][_0x63a2('0x14')]);return _0x285aa5(_0x12fbfd[_0x63a2('0x11')]['message']);}else{logger['info'](_0x63a2('0x13'),_0x17f43c,'request\x20sent');_0x285aa5(_0x12fbfd['result'][_0x63a2('0x14')]);}})[_0x63a2('0x15')](function(_0x50bf93){logger[_0x63a2('0x11')](_0x63a2('0x13'),_0x17f43c,_0x50bf93);_0x2fbd6e(_0x50bf93);});});} \ No newline at end of file +var _0x48a8=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x163742,_0x467e36){var _0x1152ac=function(_0x40a83d){while(--_0x40a83d){_0x163742['push'](_0x163742['shift']());}};_0x1152ac(++_0x467e36);}(_0x48a8,0x163));var _0x848a=function(_0x194099,_0x313873){_0x194099=_0x194099-0x0;var _0x8a7b9b=_0x48a8[_0x194099];return _0x8a7b9b;};'use strict';var _=require(_0x848a('0x0'));var util=require('util');var moment=require(_0x848a('0x1'));var BPromise=require(_0x848a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x848a('0x3'));var db=require(_0x848a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x848a('0x5'))(_0x848a('0x6'));var config=require(_0x848a('0x7'));var jayson=require(_0x848a('0x8'));var client=jayson['client'][_0x848a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26ec46,_0x4b6108,_0x5d5a26){return new BPromise(function(_0x4a1e58,_0x79e7fa){return client[_0x848a('0xa')](_0x26ec46,_0x5d5a26)[_0x848a('0xb')](function(_0x26ef31){logger[_0x848a('0xc')](_0x848a('0xd'),_0x4b6108,_0x848a('0xe'));logger[_0x848a('0xf')](_0x848a('0x10'),_0x4b6108,_0x848a('0xe'),JSON[_0x848a('0x11')](_0x26ef31));if(_0x26ef31['error']){if(_0x26ef31['error'][_0x848a('0x12')]===0x1f4){logger['error'](_0x848a('0xd'),_0x4b6108,_0x26ef31[_0x848a('0x13')][_0x848a('0x14')]);return _0x79e7fa(_0x26ef31[_0x848a('0x13')]['message']);}logger[_0x848a('0x13')](_0x848a('0xd'),_0x4b6108,_0x26ef31[_0x848a('0x13')]['message']);return _0x4a1e58(_0x26ef31[_0x848a('0x13')][_0x848a('0x14')]);}else{logger[_0x848a('0xc')](_0x848a('0xd'),_0x4b6108,'request\x20sent');_0x4a1e58(_0x26ef31[_0x848a('0x15')][_0x848a('0x14')]);}})[_0x848a('0x16')](function(_0x19a203){logger[_0x848a('0x13')](_0x848a('0xd'),_0x4b6108,_0x19a203);_0x79e7fa(_0x19a203);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index d80fe37..3fc91cd 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2b716b,_0x9001ae){var _0x4b4499=function(_0x3faaea){while(--_0x3faaea){_0x2b716b['push'](_0x2b716b['shift']());}};_0x4b4499(++_0x9001ae);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x72b6b9,_0x15c6fe){var _0x1103fa=function(_0x2e6836){while(--_0x2e6836){_0x72b6b9['push'](_0x72b6b9['shift']());}};_0x1103fa(++_0x15c6fe);}(_0xedd9,0xfc));var _0x9edd=function(_0x4676b9,_0x55fcd1){_0x4676b9=_0x4676b9-0x0;var _0x3a6e12=_0xedd9[_0x4676b9];return _0x3a6e12;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 9e09bc5..f4c608f 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 _0x5ff8=['exports','INTEGER','STRING','sequelize'];(function(_0x43bb1a,_0x35b77e){var _0x4dc103=function(_0x39c2c3){while(--_0x39c2c3){_0x43bb1a['push'](_0x43bb1a['shift']());}};_0x4dc103(++_0x35b77e);}(_0x5ff8,0xc7));var _0x85ff=function(_0x295066,_0x857bb9){_0x295066=_0x295066-0x0;var _0xc40dca=_0x5ff8[_0x295066];return _0xc40dca;};'use strict';var Sequelize=require(_0x85ff('0x0'));module[_0x85ff('0x1')]={'penalty':{'type':Sequelize[_0x85ff('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x85ff('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x85ff('0x3')]}}; \ No newline at end of file +var _0xdae6=['INTEGER','STRING','sequelize','exports'];(function(_0x169836,_0x405907){var _0x2928f1=function(_0x332a81){while(--_0x332a81){_0x169836['push'](_0x169836['shift']());}};_0x2928f1(++_0x405907);}(_0xdae6,0x7a));var _0x6dae=function(_0x20d853,_0x15fc27){_0x20d853=_0x20d853-0x0;var _0x508734=_0xdae6[_0x20d853];return _0x508734;};'use strict';var Sequelize=require(_0x6dae('0x0'));module[_0x6dae('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6dae('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6dae('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 4d5c245..8833291 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 _0xd012=['../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xd012,0x93));var _0x2d01=function(_0x1cb6bc,_0x97e540){_0x1cb6bc=_0x1cb6bc-0x0;var _0x5487f0=_0xd012[_0x1cb6bc];return _0x5487f0;};'use strict';var _=require(_0x2d01('0x0'));var util=require(_0x2d01('0x1'));var logger=require(_0x2d01('0x2'))(_0x2d01('0x3'));var moment=require('moment');var BPromise=require(_0x2d01('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d01('0x5'));var rimraf=require(_0x2d01('0x6'));var config=require(_0x2d01('0x7'));var attributes=require(_0x2d01('0x8'));module[_0x2d01('0x9')]=function(_0x15905d,_0x5f5364){return _0x15905d['define'](_0x2d01('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2a5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','api'];(function(_0x2eb66a,_0x1b5883){var _0x4abfef=function(_0x43979f){while(--_0x43979f){_0x2eb66a['push'](_0x2eb66a['shift']());}};_0x4abfef(++_0x1b5883);}(_0xf2a5,0xee));var _0x5f2a=function(_0x35432b,_0x55a7ab){_0x35432b=_0x35432b-0x0;var _0x1fdb00=_0xf2a5[_0x35432b];return _0x1fdb00;};'use strict';var _=require(_0x5f2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5f2a('0x1'));var moment=require(_0x5f2a('0x2'));var BPromise=require(_0x5f2a('0x3'));var rp=require(_0x5f2a('0x4'));var fs=require('fs');var path=require(_0x5f2a('0x5'));var rimraf=require(_0x5f2a('0x6'));var config=require(_0x5f2a('0x7'));var attributes=require(_0x5f2a('0x8'));module[_0x5f2a('0x9')]=function(_0x957668,_0x34c794){return _0x957668[_0x5f2a('0xa')]('UserFaxQueue',attributes,{'tableName':_0x5f2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 4b29b93..801622b 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 _0xca94=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xca94,0x128));var _0x4ca9=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xca94[_0x420f2a];return _0x28f802;};'use strict';var _=require(_0x4ca9('0x0'));var util=require(_0x4ca9('0x1'));var moment=require(_0x4ca9('0x2'));var BPromise=require(_0x4ca9('0x3'));var rs=require(_0x4ca9('0x4'));var fs=require('fs');var Redis=require(_0x4ca9('0x5'));var db=require(_0x4ca9('0x6'))['db'];var utils=require(_0x4ca9('0x7'));var logger=require(_0x4ca9('0x8'))(_0x4ca9('0x9'));var config=require(_0x4ca9('0xa'));var jayson=require(_0x4ca9('0xb'));var client=jayson[_0x4ca9('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3559af,_0x422043,_0x355865){return new BPromise(function(_0x38dc3b,_0x382f9d){return client[_0x4ca9('0xd')](_0x3559af,_0x355865)[_0x4ca9('0xe')](function(_0x37aeb7){logger[_0x4ca9('0xf')](_0x4ca9('0x10'),_0x422043,_0x4ca9('0x11'));logger[_0x4ca9('0x12')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x422043,_0x4ca9('0x11'),JSON[_0x4ca9('0x13')](_0x37aeb7));if(_0x37aeb7[_0x4ca9('0x14')]){if(_0x37aeb7[_0x4ca9('0x14')]['code']===0x1f4){logger[_0x4ca9('0x14')](_0x4ca9('0x10'),_0x422043,_0x37aeb7[_0x4ca9('0x14')][_0x4ca9('0x15')]);return _0x382f9d(_0x37aeb7[_0x4ca9('0x14')][_0x4ca9('0x15')]);}logger[_0x4ca9('0x14')](_0x4ca9('0x10'),_0x422043,_0x37aeb7['error'][_0x4ca9('0x15')]);return _0x38dc3b(_0x37aeb7['error'][_0x4ca9('0x15')]);}else{logger[_0x4ca9('0xf')](_0x4ca9('0x10'),_0x422043,_0x4ca9('0x11'));_0x38dc3b(_0x37aeb7[_0x4ca9('0x16')][_0x4ca9('0x15')]);}})[_0x4ca9('0x17')](function(_0x48c3e4){logger[_0x4ca9('0x14')](_0x4ca9('0x10'),_0x422043,_0x48c3e4);_0x382f9d(_0x48c3e4);});});} \ No newline at end of file +var _0xc7aa=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x11835b,_0x19a49a){var _0x2a9ee4=function(_0x4c3ada){while(--_0x4c3ada){_0x11835b['push'](_0x11835b['shift']());}};_0x2a9ee4(++_0x19a49a);}(_0xc7aa,0x189));var _0xac7a=function(_0x4934e4,_0x3ddf80){_0x4934e4=_0x4934e4-0x0;var _0x11a8f4=_0xc7aa[_0x4934e4];return _0x11a8f4;};'use strict';var _=require(_0xac7a('0x0'));var util=require(_0xac7a('0x1'));var moment=require(_0xac7a('0x2'));var BPromise=require(_0xac7a('0x3'));var rs=require(_0xac7a('0x4'));var fs=require('fs');var Redis=require(_0xac7a('0x5'));var db=require(_0xac7a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xac7a('0x7'))(_0xac7a('0x8'));var config=require('../../config/environment');var jayson=require(_0xac7a('0x9'));var client=jayson['client'][_0xac7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27d7fb,_0x3f37e0,_0x6ca4dd){return new BPromise(function(_0x6324ab,_0x33069f){return client[_0xac7a('0xb')](_0x27d7fb,_0x6ca4dd)[_0xac7a('0xc')](function(_0x37eb61){logger[_0xac7a('0xd')](_0xac7a('0xe'),_0x3f37e0,_0xac7a('0xf'));logger[_0xac7a('0x10')](_0xac7a('0x11'),_0x3f37e0,'request\x20sent',JSON[_0xac7a('0x12')](_0x37eb61));if(_0x37eb61['error']){if(_0x37eb61[_0xac7a('0x13')]['code']===0x1f4){logger['error'](_0xac7a('0xe'),_0x3f37e0,_0x37eb61['error'][_0xac7a('0x14')]);return _0x33069f(_0x37eb61['error'][_0xac7a('0x14')]);}logger['error'](_0xac7a('0xe'),_0x3f37e0,_0x37eb61[_0xac7a('0x13')][_0xac7a('0x14')]);return _0x6324ab(_0x37eb61['error'][_0xac7a('0x14')]);}else{logger['info'](_0xac7a('0xe'),_0x3f37e0,_0xac7a('0xf'));_0x6324ab(_0x37eb61[_0xac7a('0x15')][_0xac7a('0x14')]);}})[_0xac7a('0x16')](function(_0x79e07a){logger['error'](_0xac7a('0xe'),_0x3f37e0,_0x79e07a);_0x33069f(_0x79e07a);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8ec6c7a..307bc96 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4aaee3,_0x197d84){var _0x2c0791=function(_0x2931c8){while(--_0x2931c8){_0x4aaee3['push'](_0x4aaee3['shift']());}};_0x2c0791(++_0x197d84);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x411ce1,_0x5bbb1c){var _0x51bed0=function(_0x1d3e8f){while(--_0x1d3e8f){_0x411ce1['push'](_0x411ce1['shift']());}};_0x51bed0(++_0x5bbb1c);}(_0xedd9,0xfc));var _0x9edd=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xedd9[_0x403c20];return _0x2b271a;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 7b9a4a3..9d35623 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 _0xa67a=['sequelize','exports','INTEGER'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xa67a,0x114));var _0xaa67=function(_0x5cd7d9,_0x28fdcd){_0x5cd7d9=_0x5cd7d9-0x0;var _0xb6a3ec=_0xa67a[_0x5cd7d9];return _0xb6a3ec;};'use strict';var Sequelize=require(_0xaa67('0x0'));module[_0xaa67('0x1')]={'penalty':{'type':Sequelize[_0xaa67('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e20=['sequelize','exports'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x3e20,0xa0));var _0x03e2=function(_0xe8baba,_0x2a3830){_0xe8baba=_0xe8baba-0x0;var _0xbe157b=_0x3e20[_0xe8baba];return _0xbe157b;};'use strict';var Sequelize=require(_0x03e2('0x0'));module[_0x03e2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 27d668e..205a96c 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 _0x93cf=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0xa91e85,_0x49b891){var _0x41daed=function(_0x3dd19a){while(--_0x3dd19a){_0xa91e85['push'](_0xa91e85['shift']());}};_0x41daed(++_0x49b891);}(_0x93cf,0x16b));var _0xf93c=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x93cf[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xf93c('0x0'));var util=require(_0xf93c('0x1'));var logger=require(_0xf93c('0x2'))(_0xf93c('0x3'));var moment=require(_0xf93c('0x4'));var BPromise=require(_0xf93c('0x5'));var rp=require(_0xf93c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf93c('0x7'));var config=require(_0xf93c('0x8'));var attributes=require(_0xf93c('0x9'));module[_0xf93c('0xa')]=function(_0x36602a,_0x5e86c0){return _0x36602a[_0xf93c('0xb')](_0xf93c('0xc'),attributes,{'tableName':_0xf93c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9260=['UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes','exports','define'];(function(_0x1b87aa,_0x8ea857){var _0x834140=function(_0x3725b9){while(--_0x3725b9){_0x1b87aa['push'](_0x1b87aa['shift']());}};_0x834140(++_0x8ea857);}(_0x9260,0x17b));var _0x0926=function(_0x103ffc,_0x34565f){_0x103ffc=_0x103ffc-0x0;var _0x85d023=_0x9260[_0x103ffc];return _0x85d023;};'use strict';var _=require(_0x0926('0x0'));var util=require(_0x0926('0x1'));var logger=require('../../config/logger')(_0x0926('0x2'));var moment=require(_0x0926('0x3'));var BPromise=require(_0x0926('0x4'));var rp=require(_0x0926('0x5'));var fs=require('fs');var path=require(_0x0926('0x6'));var rimraf=require('rimraf');var config=require(_0x0926('0x7'));var attributes=require(_0x0926('0x8'));module[_0x0926('0x9')]=function(_0x415591,_0x12949b){return _0x415591[_0x0926('0xa')](_0x0926('0xb'),attributes,{'tableName':_0x0926('0xc'),'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 e773d7b..8953ced 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x50f6b3,_0x4db501){var _0x4c34e9=function(_0x3edfeb){while(--_0x3edfeb){_0x50f6b3['push'](_0x50f6b3['shift']());}};_0x4c34e9(++_0x4db501);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2cd918,_0x5735f8){_0x2cd918=_0x2cd918-0x0;var _0x4401b6=_0x8ef6[_0x2cd918];return _0x4401b6;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x576040,_0x39fb56){var _0x7c2205=function(_0x23abd9){while(--_0x23abd9){_0x576040['push'](_0x576040['shift']());}};_0x7c2205(++_0x39fb56);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x00bb[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index e0918e0..7693356 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 _0xf737=['./userNotification.controller','post','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf737,0x1a5));var _0x7f73=function(_0x4135dc,_0x396acc){_0x4135dc=_0x4135dc-0x0;var _0x14fa7e=_0xf737[_0x4135dc];return _0x14fa7e;};'use strict';var multer=require(_0x7f73('0x0'));var util=require(_0x7f73('0x1'));var path=require('path');var timeout=require(_0x7f73('0x2'));var express=require(_0x7f73('0x3'));var router=express[_0x7f73('0x4')]();var fs_extra=require(_0x7f73('0x5'));var auth=require(_0x7f73('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7f73('0x7'));var controller=require(_0x7f73('0x8'));router[_0x7f73('0x9')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0x7f73('0xa')]=router; \ No newline at end of file +var _0x6224=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util'];(function(_0x5a8f37,_0x3f06d9){var _0x5b6d7c=function(_0x1a99fb){while(--_0x1a99fb){_0x5a8f37['push'](_0x5a8f37['shift']());}};_0x5b6d7c(++_0x3f06d9);}(_0x6224,0x1ed));var _0x4622=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0x6224[_0x148c09];return _0x18e613;};'use strict';var multer=require(_0x4622('0x0'));var util=require(_0x4622('0x1'));var path=require(_0x4622('0x2'));var timeout=require('connect-timeout');var express=require(_0x4622('0x3'));var router=express['Router']();var fs_extra=require(_0x4622('0x4'));var auth=require(_0x4622('0x5'));var interaction=require(_0x4622('0x6'));var config=require('../../config/environment');var controller=require(_0x4622('0x7'));router[_0x4622('0x8')]('/',auth[_0x4622('0x9')](),controller[_0x4622('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 4175cdf..2198ab3 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 _0xee1a=['exports','TEXT','STRING'];(function(_0xdf75e0,_0x47855d){var _0x3c7926=function(_0x5fb2ae){while(--_0x5fb2ae){_0xdf75e0['push'](_0xdf75e0['shift']());}};_0x3c7926(++_0x47855d);}(_0xee1a,0x9f));var _0xaee1=function(_0x28c59e,_0x34f905){_0x28c59e=_0x28c59e-0x0;var _0x5d8179=_0xee1a[_0x28c59e];return _0x5d8179;};'use strict';var Sequelize=require('sequelize');module[_0xaee1('0x0')]={'body':{'type':Sequelize[_0xaee1('0x1')]},'senderName':{'type':Sequelize[_0xaee1('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xaee1('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x0d33=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x28b62e,_0x28fbe2){var _0x16b4a9=function(_0x39611c){while(--_0x39611c){_0x28b62e['push'](_0x28b62e['shift']());}};_0x16b4a9(++_0x28fbe2);}(_0x0d33,0x6f));var _0x30d3=function(_0x542063,_0x423b71){_0x542063=_0x542063-0x0;var _0x36f4d7=_0x0d33[_0x542063];return _0x36f4d7;};'use strict';var Sequelize=require(_0x30d3('0x0'));module[_0x30d3('0x1')]={'body':{'type':Sequelize[_0x30d3('0x2')]},'senderName':{'type':Sequelize[_0x30d3('0x3')]},'recipientsId':{'type':Sequelize[_0x30d3('0x2')]},'recipientsDescription':{'type':Sequelize[_0x30d3('0x3')]},'beep':{'type':Sequelize[_0x30d3('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index e00f10e..d1c9972 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 _0xb893=['TemplateId','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','toLowerCase','senderName','user','fullname','recipientsDescription','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','union','ids','replace','push','all','getAgents','map','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','sendUserNotification','hasOwnProperty','body','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xb893,0x1be));var _0x3b89=function(_0x349ac1,_0x443243){_0x349ac1=_0x349ac1-0x0;var _0x77840a=_0xb893[_0x349ac1];return _0x77840a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3b89('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b89('0x1'));var BPromise=require(_0x3b89('0x2'));var Mustache=require(_0x3b89('0x3'));var util=require(_0x3b89('0x4'));var path=require(_0x3b89('0x5'));var sox=require(_0x3b89('0x6'));var csv=require(_0x3b89('0x7'));var ejs=require(_0x3b89('0x8'));var fs=require('fs');var fs_extra=require(_0x3b89('0x9'));var _=require(_0x3b89('0xa'));var squel=require(_0x3b89('0xb'));var crypto=require(_0x3b89('0xc'));var jsforce=require(_0x3b89('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3b89('0x7'));var querystring=require(_0x3b89('0xe'));var Papa=require('papaparse');var Redis=require(_0x3b89('0xf'));var authService=require(_0x3b89('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3b89('0x11'));var hardwareService=require(_0x3b89('0x12'));var logger=require(_0x3b89('0x13'))(_0x3b89('0x14'));var utils=require(_0x3b89('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3b89('0x16'));var db=require('../../mysqldb')['db'];config[_0x3b89('0x17')]=_[_0x3b89('0x18')](config[_0x3b89('0x17')],{'host':_0x3b89('0x19'),'port':0x18eb});var socket=require(_0x3b89('0x1a'))(new Redis(config[_0x3b89('0x17')]));require(_0x3b89('0x1b'))['register'](socket);function respondWithStatusCode(_0x6fead8,_0x2f0d4c){_0x2f0d4c=_0x2f0d4c||0xcc;return function(_0x3f1853){if(_0x3f1853){return _0x6fead8['sendStatus'](_0x2f0d4c);}return _0x6fead8[_0x3b89('0x1c')](_0x2f0d4c)[_0x3b89('0x1d')]();};}function respondWithResult(_0x336eec,_0x335594){_0x335594=_0x335594||0xc8;return function(_0xbb66bf){if(_0xbb66bf){return _0x336eec[_0x3b89('0x1c')](_0x335594)[_0x3b89('0x1e')](_0xbb66bf);}};}function respondWithFilteredResult(_0x1c9e59,_0x416099){return function(_0x47bb1c){if(_0x47bb1c){var _0x1ddd1d=typeof _0x416099[_0x3b89('0x1f')]===_0x3b89('0x20')&&typeof _0x416099[_0x3b89('0x21')]===_0x3b89('0x20');var _0x37a465=_0x47bb1c[_0x3b89('0x22')];var _0x28b0bd=_0x1ddd1d?0x0:_0x416099[_0x3b89('0x1f')];var _0x290504=_0x1ddd1d?_0x47bb1c[_0x3b89('0x22')]:_0x416099['offset']+_0x416099[_0x3b89('0x21')];var _0x65576;if(_0x290504>=_0x37a465){_0x290504=_0x37a465;_0x65576=0xc8;}else{_0x65576=0xce;}_0x1c9e59[_0x3b89('0x1c')](_0x65576);return _0x1c9e59[_0x3b89('0x23')](_0x3b89('0x24'),_0x28b0bd+'-'+_0x290504+'/'+_0x37a465)[_0x3b89('0x1e')](_0x47bb1c);}return null;};}function patchUpdates(_0x201c0f){return function(_0x4d05ec){try{jsonpatch[_0x3b89('0x25')](_0x4d05ec,_0x201c0f,!![]);}catch(_0x44722c){return BPromise['reject'](_0x44722c);}return _0x4d05ec[_0x3b89('0x26')]();};}function saveUpdates(_0x20612b,_0x1e3b1a){return function(_0x17c5fb){if(_0x17c5fb){return _0x17c5fb['update'](_0x20612b)['then'](function(_0x4d3343){return _0x4d3343;});}return null;};}function removeEntity(_0x47986c,_0x4fe7b9){return function(_0x4edf01){if(_0x4edf01){return _0x4edf01['destroy']()[_0x3b89('0x27')](function(){_0x47986c[_0x3b89('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c68d0,_0x350e9c){return function(_0x1dfca7){if(!_0x1dfca7){_0x3c68d0['sendStatus'](0x194);}return _0x1dfca7;};}function handleError(_0x21a5e0,_0x2766a8){_0x2766a8=_0x2766a8||0x1f4;return function(_0x5772b9){logger[_0x3b89('0x28')](_0x5772b9[_0x3b89('0x29')]);if(_0x5772b9[_0x3b89('0x2a')]){delete _0x5772b9[_0x3b89('0x2a')];}_0x21a5e0[_0x3b89('0x1c')](_0x2766a8)[_0x3b89('0x2b')](_0x5772b9);};}exports[_0x3b89('0x2c')]=function(_0x26fe9c,_0x6aa302,_0x55a841){if(!_0x26fe9c['body'][_0x3b89('0x2d')]('text')&&!_0x26fe9c[_0x3b89('0x2e')][_0x3b89('0x2d')]('TemplateId')){throw new db['Sequelize'][(_0x3b89('0x2f'))](_0x3b89('0x30'));}else{if(_0x26fe9c[_0x3b89('0x2e')][_0x3b89('0x2d')](_0x3b89('0x31'))&&!_0x26fe9c[_0x3b89('0x2e')]['hasOwnProperty'](_0x3b89('0x32'))){throw new db[(_0x3b89('0x33'))][(_0x3b89('0x2f'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x26fe9c['body'][_0x3b89('0x2d')](_0x3b89('0x34'))){throw new db[(_0x3b89('0x33'))][(_0x3b89('0x2f'))](_0x3b89('0x35'));}else{try{var _0x1bdc97=JSON[_0x3b89('0x36')](_0x26fe9c['body'][_0x3b89('0x34')]);}catch(_0x2e19b4){logger[_0x3b89('0x28')](_0x2e19b4);throw new db[(_0x3b89('0x33'))][(_0x3b89('0x2f'))](_0x3b89('0x37'));}var _0x49a3c1=[_0x3b89('0x38'),_0x3b89('0x39'),_0x3b89('0x3a'),_0x3b89('0x3b'),_0x3b89('0x3c'),_0x3b89('0x3d'),_0x3b89('0x3e'),_0x3b89('0x3f'),'user'];if(_[_0x3b89('0x40')](_0x1bdc97,function(_0x445598){return!_[_0x3b89('0x41')](_0x49a3c1,_0x445598['model'][_0x3b89('0x42')]());})){throw new db[(_0x3b89('0x33'))][(_0x3b89('0x2f'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x1578c9={};_0x1578c9[_0x3b89('0x43')]=_0x26fe9c[_0x3b89('0x2e')][_0x3b89('0x2d')]('senderName')?_0x26fe9c[_0x3b89('0x2e')][_0x3b89('0x43')]:_0x26fe9c[_0x3b89('0x44')][_0x3b89('0x45')];_0x1578c9['recipientsDescription']=_['isEmpty'](_0x26fe9c[_0x3b89('0x2e')][_0x3b89('0x46')])?null:_0x26fe9c[_0x3b89('0x2e')][_0x3b89('0x46')];_0x1578c9[_0x3b89('0x47')]=_0x26fe9c[_0x3b89('0x2e')][_0x3b89('0x47')]||![];_0x1578c9['SenderId']=_0x26fe9c[_0x3b89('0x44')]['id'];return getContent(_0x26fe9c[_0x3b89('0x2e')])['then'](function(_0xf382d5){_0x1578c9[_0x3b89('0x2e')]=_0xf382d5;return getRecipients(_0x1bdc97);})[_0x3b89('0x27')](function(_0x4cf8eb){_0x1578c9[_0x3b89('0x48')]=_[_0x3b89('0x49')](_0x4cf8eb)[_0x3b89('0x4a')](',');return db[_0x3b89('0x4b')][_0x3b89('0x4c')](function(_0xcec609){return db[_0x3b89('0x4d')][_0x3b89('0x4e')](_0x1578c9,{'raw':!![],'transaction':_0xcec609})[_0x3b89('0x27')](function(_0x56a1f5){var _0x464ef5={'sender':_0x1578c9['senderName'],'description':_0x1578c9['recipientsDescription'],'content':_0x1578c9['body'],'beep':_0x1578c9[_0x3b89('0x47')]};_0x4cf8eb[_0x3b89('0x4f')](function(_0x751e54){_0x464ef5[_0x3b89('0x50')]=_0x751e54;socket[_0x3b89('0x51')](_0x3b89('0x52'),_0x464ef5);});return _0x56a1f5;});});})[_0x3b89('0x27')](respondWithResult(_0x6aa302,0xc9))[_0x3b89('0x53')](handleError(_0x6aa302,null));};function getContent(_0x172f49){return new BPromise(function(_0x47ffc9,_0x3ba062){if(_0x172f49['text']){_0x47ffc9(_0x172f49['text']);return;}return db[_0x3b89('0x54')][_0x3b89('0x55')]({'attributes':[_0x3b89('0x56')],'where':{'id':_0x172f49['TemplateId']},'raw':!![]})[_0x3b89('0x27')](function(_0x550a71){if(!_0x550a71)throw new db[(_0x3b89('0x33'))][(_0x3b89('0x2f'))](_0x3b89('0x57'));var _0x5d56c8=Mustache[_0x3b89('0x58')](_0x550a71[_0x3b89('0x56')],_0x172f49[_0x3b89('0x32')]);_0x47ffc9(_0x5d56c8);})['catch'](function(_0x2d52aa){_0x3ba062(_0x2d52aa);});});}function getRecipients(_0x2792f5){return new BPromise(function(_0x31dbc2,_0x14e275){var _0x23ea95=[];var _0x284dd5=[];_0x2792f5[_0x3b89('0x4f')](function(_0x4168fd){var _0x2bd598=_[_0x3b89('0x59')](_0x4168fd[_0x3b89('0x5a')][_0x3b89('0x42')]());if(_0x2bd598===_0x3b89('0x5b')){_0x23ea95=_[_0x3b89('0x5c')](_0x23ea95,_0x4168fd[_0x3b89('0x5d')]);}else{if(_[_0x3b89('0x41')](_0x2bd598,'queue'))_0x2bd598=_0x2bd598[_0x3b89('0x5e')]('queue','Queue');_0x4168fd['ids'][_0x3b89('0x4f')](function(_0x338d1e){_0x284dd5[_0x3b89('0x5f')](getAgents(_0x2bd598,_0x338d1e));});}});return BPromise[_0x3b89('0x60')](_0x284dd5)[_0x3b89('0x27')](function(_0x2179ff){_0x23ea95=_['union'](_0x23ea95,_['flatten'](_0x2179ff));_0x31dbc2(_0x23ea95);})[_0x3b89('0x53')](function(_0x58405e){_0x14e275(_0x58405e);});});}function getAgents(_0x53da2,_0x58ab63){return new BPromise(function(_0x4112b5,_0x5dff67){return db[_0x53da2][_0x3b89('0x55')]({'where':{'id':_0x58ab63}})[_0x3b89('0x27')](function(_0x3802fc){return _0x3802fc[_0x3b89('0x61')]({'attributes':['id'],'raw':!![]})['then'](function(_0x35997e){var _0x341e6f=_[_0x3b89('0x62')](_0x35997e,'id');_0x4112b5(_0x341e6f);});})[_0x3b89('0x53')](function(_0x39b9bb){_0x5dff67(_0x39b9bb);});});} \ No newline at end of file +var _0x66b5=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','openchannelqueue','smsqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','toLowerCase','replace','queue','ids','push','all','union','flatten','catch','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x66b5,0x1ea));var _0x566b=function(_0x3ca813,_0x24482a){_0x3ca813=_0x3ca813-0x0;var _0xf454e9=_0x66b5[_0x3ca813];return _0xf454e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x566b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x566b('0x1'));var rp=require(_0x566b('0x2'));var moment=require(_0x566b('0x3'));var BPromise=require(_0x566b('0x4'));var Mustache=require('mustache');var util=require(_0x566b('0x5'));var path=require(_0x566b('0x6'));var sox=require('sox');var csv=require(_0x566b('0x7'));var ejs=require(_0x566b('0x8'));var fs=require('fs');var fs_extra=require(_0x566b('0x9'));var _=require(_0x566b('0xa'));var squel=require(_0x566b('0xb'));var crypto=require('crypto');var jsforce=require(_0x566b('0xc'));var deskjs=require(_0x566b('0xd'));var toCsv=require(_0x566b('0x7'));var querystring=require(_0x566b('0xe'));var Papa=require(_0x566b('0xf'));var Redis=require(_0x566b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x566b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x566b('0x12'));var logger=require('../../config/logger')(_0x566b('0x13'));var utils=require(_0x566b('0x14'));var config=require(_0x566b('0x15'));var licenseUtil=require(_0x566b('0x16'));var db=require(_0x566b('0x17'))['db'];config['redis']=_[_0x566b('0x18')](config[_0x566b('0x19')],{'host':_0x566b('0x1a'),'port':0x18eb});var socket=require(_0x566b('0x1b'))(new Redis(config[_0x566b('0x19')]));require(_0x566b('0x1c'))[_0x566b('0x1d')](socket);function respondWithStatusCode(_0x231b5f,_0x13b36e){_0x13b36e=_0x13b36e||0xcc;return function(_0xe9fa59){if(_0xe9fa59){return _0x231b5f[_0x566b('0x1e')](_0x13b36e);}return _0x231b5f[_0x566b('0x1f')](_0x13b36e)[_0x566b('0x20')]();};}function respondWithResult(_0x4bf204,_0x22ffa0){_0x22ffa0=_0x22ffa0||0xc8;return function(_0x40356a){if(_0x40356a){return _0x4bf204[_0x566b('0x1f')](_0x22ffa0)['json'](_0x40356a);}};}function respondWithFilteredResult(_0x359cec,_0x4eb55e){return function(_0x1712fd){if(_0x1712fd){var _0x59fc4e=typeof _0x4eb55e[_0x566b('0x21')]===_0x566b('0x22')&&typeof _0x4eb55e[_0x566b('0x23')]===_0x566b('0x22');var _0x3c21ac=_0x1712fd[_0x566b('0x24')];var _0x12d9fc=_0x59fc4e?0x0:_0x4eb55e['offset'];var _0x2cef94=_0x59fc4e?_0x1712fd[_0x566b('0x24')]:_0x4eb55e['offset']+_0x4eb55e[_0x566b('0x23')];var _0x2549aa;if(_0x2cef94>=_0x3c21ac){_0x2cef94=_0x3c21ac;_0x2549aa=0xc8;}else{_0x2549aa=0xce;}_0x359cec[_0x566b('0x1f')](_0x2549aa);return _0x359cec[_0x566b('0x25')](_0x566b('0x26'),_0x12d9fc+'-'+_0x2cef94+'/'+_0x3c21ac)[_0x566b('0x27')](_0x1712fd);}return null;};}function patchUpdates(_0x6d5b57){return function(_0x3429da){try{jsonpatch['apply'](_0x3429da,_0x6d5b57,!![]);}catch(_0x43d47c){return BPromise[_0x566b('0x28')](_0x43d47c);}return _0x3429da[_0x566b('0x29')]();};}function saveUpdates(_0x1442e7,_0x5b085e){return function(_0x29a363){if(_0x29a363){return _0x29a363[_0x566b('0x2a')](_0x1442e7)[_0x566b('0x2b')](function(_0x5e08d8){return _0x5e08d8;});}return null;};}function removeEntity(_0x25f514,_0x96d131){return function(_0x5e965d){if(_0x5e965d){return _0x5e965d[_0x566b('0x2c')]()[_0x566b('0x2b')](function(){_0x25f514[_0x566b('0x1f')](0xcc)[_0x566b('0x20')]();});}};}function handleEntityNotFound(_0x227b84,_0x3ce8e3){return function(_0x3e1131){if(!_0x3e1131){_0x227b84[_0x566b('0x1e')](0x194);}return _0x3e1131;};}function handleError(_0x43a2bb,_0x5557c1){_0x5557c1=_0x5557c1||0x1f4;return function(_0x47a101){logger[_0x566b('0x2d')](_0x47a101[_0x566b('0x2e')]);if(_0x47a101[_0x566b('0x2f')]){delete _0x47a101[_0x566b('0x2f')];}_0x43a2bb[_0x566b('0x1f')](_0x5557c1)[_0x566b('0x30')](_0x47a101);};}exports[_0x566b('0x31')]=function(_0xa50eb,_0x4b354a,_0x267ea2){if(!_0xa50eb[_0x566b('0x32')][_0x566b('0x33')](_0x566b('0x34'))&&!_0xa50eb['body']['hasOwnProperty'](_0x566b('0x35'))){throw new db[(_0x566b('0x36'))][(_0x566b('0x37'))](_0x566b('0x38'));}else{if(_0xa50eb[_0x566b('0x32')]['hasOwnProperty']('TemplateId')&&!_0xa50eb[_0x566b('0x32')]['hasOwnProperty'](_0x566b('0x39'))){throw new db[(_0x566b('0x36'))]['ValidationError'](_0x566b('0x3a'));}if(!_0xa50eb['body'][_0x566b('0x33')](_0x566b('0x3b'))){throw new db[(_0x566b('0x36'))][(_0x566b('0x37'))](_0x566b('0x3c'));}else{try{var _0x36b7b1=JSON['parse'](_0xa50eb[_0x566b('0x32')]['recipients']);}catch(_0x2b0478){logger[_0x566b('0x2d')](_0x2b0478);throw new db[(_0x566b('0x36'))][(_0x566b('0x37'))](_0x566b('0x3d'));}var _0x4def86=['chatqueue','faxqueue','mailqueue',_0x566b('0x3e'),_0x566b('0x3f'),'voicequeue','whatsappqueue',_0x566b('0x40'),_0x566b('0x41')];if(_[_0x566b('0x42')](_0x36b7b1,function(_0x5562ab){return!_[_0x566b('0x43')](_0x4def86,_0x5562ab[_0x566b('0x44')]['toLowerCase']());})){throw new db[(_0x566b('0x36'))][(_0x566b('0x37'))](_0x566b('0x45'));}}}var _0x7c54f0={};_0x7c54f0[_0x566b('0x46')]=_0xa50eb['body']['hasOwnProperty'](_0x566b('0x46'))?_0xa50eb[_0x566b('0x32')][_0x566b('0x46')]:_0xa50eb[_0x566b('0x41')][_0x566b('0x47')];_0x7c54f0[_0x566b('0x48')]=_[_0x566b('0x49')](_0xa50eb[_0x566b('0x32')][_0x566b('0x48')])?null:_0xa50eb[_0x566b('0x32')][_0x566b('0x48')];_0x7c54f0[_0x566b('0x4a')]=_0xa50eb['body']['beep']||![];_0x7c54f0[_0x566b('0x4b')]=_0xa50eb[_0x566b('0x41')]['id'];return getContent(_0xa50eb[_0x566b('0x32')])[_0x566b('0x2b')](function(_0x342ae6){_0x7c54f0[_0x566b('0x32')]=_0x342ae6;return getRecipients(_0x36b7b1);})[_0x566b('0x2b')](function(_0x30656b){_0x7c54f0[_0x566b('0x4c')]=_[_0x566b('0x4d')](_0x30656b)[_0x566b('0x4e')](',');return db[_0x566b('0x4f')][_0x566b('0x50')](function(_0x263ac9){return db[_0x566b('0x51')]['create'](_0x7c54f0,{'raw':!![],'transaction':_0x263ac9})[_0x566b('0x2b')](function(_0xae84b8){var _0xa1840e={'sender':_0x7c54f0[_0x566b('0x46')],'description':_0x7c54f0['recipientsDescription'],'content':_0x7c54f0['body'],'beep':_0x7c54f0[_0x566b('0x4a')]};_0x30656b['forEach'](function(_0x1dd97d){_0xa1840e[_0x566b('0x52')]=_0x1dd97d;socket[_0x566b('0x53')](_0x566b('0x54'),_0xa1840e);});return _0xae84b8;});});})[_0x566b('0x2b')](respondWithResult(_0x4b354a,0xc9))['catch'](handleError(_0x4b354a,null));};function getContent(_0x5420a7){return new BPromise(function(_0x2be033,_0x2d366a){if(_0x5420a7['text']){_0x2be033(_0x5420a7[_0x566b('0x34')]);return;}return db[_0x566b('0x55')][_0x566b('0x56')]({'attributes':[_0x566b('0x57')],'where':{'id':_0x5420a7[_0x566b('0x35')]},'raw':!![]})[_0x566b('0x2b')](function(_0x2d12b2){if(!_0x2d12b2)throw new db[(_0x566b('0x36'))]['ValidationError'](_0x566b('0x58'));var _0xb58143=Mustache[_0x566b('0x59')](_0x2d12b2[_0x566b('0x57')],_0x5420a7[_0x566b('0x39')]);_0x2be033(_0xb58143);})['catch'](function(_0x1ff1cc){_0x2d366a(_0x1ff1cc);});});}function getRecipients(_0xc8abf6){return new BPromise(function(_0x5d8336,_0x1733d5){var _0x1f754b=[];var _0x4505eb=[];_0xc8abf6[_0x566b('0x5a')](function(_0x38a235){var _0x2e2e6c=_['startCase'](_0x38a235['model'][_0x566b('0x5b')]());if(_0x2e2e6c==='User'){_0x1f754b=_['union'](_0x1f754b,_0x38a235['ids']);}else{if(_['includes'](_0x2e2e6c,'queue'))_0x2e2e6c=_0x2e2e6c[_0x566b('0x5c')](_0x566b('0x5d'),'Queue');_0x38a235[_0x566b('0x5e')][_0x566b('0x5a')](function(_0x29e4a4){_0x4505eb[_0x566b('0x5f')](getAgents(_0x2e2e6c,_0x29e4a4));});}});return BPromise[_0x566b('0x60')](_0x4505eb)[_0x566b('0x2b')](function(_0x4dbf35){_0x1f754b=_[_0x566b('0x61')](_0x1f754b,_[_0x566b('0x62')](_0x4dbf35));_0x5d8336(_0x1f754b);})[_0x566b('0x63')](function(_0x136596){_0x1733d5(_0x136596);});});}function getAgents(_0x5b58b0,_0x21624b){return new BPromise(function(_0x559367,_0x4d0e5f){return db[_0x5b58b0]['findOne']({'where':{'id':_0x21624b}})[_0x566b('0x2b')](function(_0x4b9158){return _0x4b9158[_0x566b('0x64')]({'attributes':['id'],'raw':!![]})[_0x566b('0x2b')](function(_0x1413ca){var _0x7d1f2c=_['map'](_0x1413ca,'id');_0x559367(_0x7d1f2c);});})[_0x566b('0x63')](function(_0x292319){_0x4d0e5f(_0x292319);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 7d149d8..0212ef0 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 _0xc082=['update','remove','emit','exports','events','UserNotification','setMaxListeners','save'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc082,0x134));var _0x2c08=function(_0x502188,_0x272cea){_0x502188=_0x502188-0x0;var _0x208080=_0xc082[_0x502188];return _0x208080;};'use strict';var EventEmitter=require(_0x2c08('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x2c08('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x2c08('0x2')](0x0);var events={'afterCreate':_0x2c08('0x3'),'afterUpdate':_0x2c08('0x4'),'afterDestroy':_0x2c08('0x5')};function emitEvent(_0x24b9a5){return function(_0x57632d,_0x444d6e,_0x3a1cd8){UserNotificationEvents[_0x2c08('0x6')](_0x24b9a5+':'+_0x57632d['id'],_0x57632d);UserNotificationEvents[_0x2c08('0x6')](_0x24b9a5,_0x57632d);_0x3a1cd8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x2c08('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xff3b=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xff3b,0x139));var _0xbff3=function(_0x29326a,_0x97a415){_0x29326a=_0x29326a-0x0;var _0x26e7da=_0xff3b[_0x29326a];return _0x26e7da;};'use strict';var EventEmitter=require(_0xbff3('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xbff3('0x1')](0x0);var events={'afterCreate':_0xbff3('0x2'),'afterUpdate':_0xbff3('0x3'),'afterDestroy':_0xbff3('0x4')};function emitEvent(_0x543c5a){return function(_0x4e33cc,_0x380c2c,_0x1b815a){UserNotificationEvents[_0xbff3('0x5')](_0x543c5a+':'+_0x4e33cc['id'],_0x4e33cc);UserNotificationEvents[_0xbff3('0x5')](_0x543c5a,_0x4e33cc);_0x1b815a(null);};}for(var e in events){if(events[_0xbff3('0x6')](e)){var event=events[e];UserNotification[_0xbff3('0x7')](e,emitEvent(event));}}module[_0xbff3('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 9eb5539..48a0660 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 _0x60c7=['request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x60c7,0x19e));var _0x760c=function(_0x4769c2,_0x2fd5bc){_0x4769c2=_0x4769c2-0x0;var _0x238ff8=_0x60c7[_0x4769c2];return _0x238ff8;};'use strict';var _=require(_0x760c('0x0'));var util=require('util');var logger=require(_0x760c('0x1'))(_0x760c('0x2'));var moment=require('moment');var BPromise=require(_0x760c('0x3'));var rp=require(_0x760c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x760c('0x5'));var config=require(_0x760c('0x6'));var attributes=require(_0x760c('0x7'));module[_0x760c('0x8')]=function(_0x5d0b3c,_0x48c74f){return _0x5d0b3c['define']('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x760c('0x9'),'collate':_0x760c('0xa')});}; \ No newline at end of file +var _0xea54=['userNotifications','utf8mb4_unicode_ci','../../config/logger','path','../../config/environment','exports','define','UserNotification'];(function(_0x43d1db,_0x5204dc){var _0x5e4558=function(_0x3f4f83){while(--_0x3f4f83){_0x43d1db['push'](_0x43d1db['shift']());}};_0x5e4558(++_0x5204dc);}(_0xea54,0x142));var _0x4ea5=function(_0x44bfe7,_0x265f7a){_0x44bfe7=_0x44bfe7-0x0;var _0x565d5d=_0xea54[_0x44bfe7];return _0x565d5d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ea5('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ea5('0x1'));var rimraf=require('rimraf');var config=require(_0x4ea5('0x2'));var attributes=require('./userNotification.attributes');module[_0x4ea5('0x3')]=function(_0xc3e1b4,_0x57b36e){return _0xc3e1b4[_0x4ea5('0x4')](_0x4ea5('0x5'),attributes,{'tableName':_0x4ea5('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4ea5('0x7')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 3a7c49a..7f5cd4b 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 _0x502f=['UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','request','then','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2468b5,_0x506b9e){var _0x1056e4=function(_0x26da1c){while(--_0x26da1c){_0x2468b5['push'](_0x2468b5['shift']());}};_0x1056e4(++_0x506b9e);}(_0x502f,0x170));var _0xf502=function(_0x10b775,_0x23a015){_0x10b775=_0x10b775-0x0;var _0x39a697=_0x502f[_0x10b775];return _0x39a697;};'use strict';var _=require(_0xf502('0x0'));var util=require(_0xf502('0x1'));var moment=require('moment');var BPromise=require(_0xf502('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf502('0x3'));var db=require(_0xf502('0x4'))['db'];var utils=require(_0xf502('0x5'));var logger=require(_0xf502('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf502('0x7')][_0xf502('0x8')]({'port':0x232a});config['redis']=_[_0xf502('0x9')](config[_0xf502('0xa')],{'host':_0xf502('0xb'),'port':0x18eb});var socket=require(_0xf502('0xc'))(new Redis(config[_0xf502('0xa')]));require(_0xf502('0xd'))['register'](socket);function respondWithRpcPromise(_0x3d913b,_0x477fea,_0x2b201c){return new BPromise(function(_0x3c5aaf,_0x2bca19){return client[_0xf502('0xe')](_0x3d913b,_0x2b201c)[_0xf502('0xf')](function(_0x5493cb){logger['info']('UserNotification,\x20%s,\x20%s',_0x477fea,_0xf502('0x10'));logger[_0xf502('0x11')](_0xf502('0x12'),_0x477fea,_0xf502('0x10'),JSON[_0xf502('0x13')](_0x5493cb));if(_0x5493cb[_0xf502('0x14')]){if(_0x5493cb[_0xf502('0x14')][_0xf502('0x15')]===0x1f4){logger[_0xf502('0x14')](_0xf502('0x16'),_0x477fea,_0x5493cb[_0xf502('0x14')]['message']);return _0x2bca19(_0x5493cb[_0xf502('0x14')]['message']);}logger['error']('UserNotification,\x20%s,\x20%s',_0x477fea,_0x5493cb[_0xf502('0x14')]['message']);return _0x3c5aaf(_0x5493cb[_0xf502('0x14')][_0xf502('0x17')]);}else{logger['info'](_0xf502('0x16'),_0x477fea,_0xf502('0x10'));_0x3c5aaf(_0x5493cb[_0xf502('0x18')][_0xf502('0x17')]);}})[_0xf502('0x19')](function(_0x280249){logger[_0xf502('0x14')](_0xf502('0x16'),_0x477fea,_0x280249);_0x2bca19(_0x280249);});});} \ No newline at end of file +var _0x9902=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x4b1434,_0x1fa900){var _0x9870da=function(_0x1e9432){while(--_0x1e9432){_0x4b1434['push'](_0x4b1434['shift']());}};_0x9870da(++_0x1fa900);}(_0x9902,0xac));var _0x2990=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x9902[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x2990('0x0'));var util=require('util');var moment=require(_0x2990('0x1'));var BPromise=require(_0x2990('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2990('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2990('0x4'));var logger=require(_0x2990('0x5'))(_0x2990('0x6'));var config=require('../../config/environment');var jayson=require(_0x2990('0x7'));var client=jayson[_0x2990('0x8')][_0x2990('0x9')]({'port':0x232a});config[_0x2990('0xa')]=_[_0x2990('0xb')](config[_0x2990('0xa')],{'host':_0x2990('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2990('0xa')]));require(_0x2990('0xd'))[_0x2990('0xe')](socket);function respondWithRpcPromise(_0x40d6e2,_0x41ab25,_0x9b06fb){return new BPromise(function(_0x2c7319,_0x46a2bd){return client[_0x2990('0xf')](_0x40d6e2,_0x9b06fb)[_0x2990('0x10')](function(_0x56928d){logger['info'](_0x2990('0x11'),_0x41ab25,_0x2990('0x12'));logger['debug'](_0x2990('0x13'),_0x41ab25,_0x2990('0x12'),JSON['stringify'](_0x56928d));if(_0x56928d['error']){if(_0x56928d[_0x2990('0x14')][_0x2990('0x15')]===0x1f4){logger[_0x2990('0x14')](_0x2990('0x11'),_0x41ab25,_0x56928d[_0x2990('0x14')][_0x2990('0x16')]);return _0x46a2bd(_0x56928d[_0x2990('0x14')][_0x2990('0x16')]);}logger['error'](_0x2990('0x11'),_0x41ab25,_0x56928d[_0x2990('0x14')]['message']);return _0x2c7319(_0x56928d[_0x2990('0x14')][_0x2990('0x16')]);}else{logger['info'](_0x2990('0x11'),_0x41ab25,_0x2990('0x12'));_0x2c7319(_0x56928d[_0x2990('0x17')]['message']);}})[_0x2990('0x18')](function(_0x3643e9){logger['error'](_0x2990('0x11'),_0x41ab25,_0x3643e9);_0x46a2bd(_0x3643e9);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index d3c77cb..8a3d6f5 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 _0xeda6=['userNotification:','./userNotification.events','save','emit','removeListener','register','length'];(function(_0x2ddfae,_0x323c2f){var _0x1a43eb=function(_0x54f7ee){while(--_0x54f7ee){_0x2ddfae['push'](_0x2ddfae['shift']());}};_0x1a43eb(++_0x323c2f);}(_0xeda6,0x1dd));var _0x6eda=function(_0x107552,_0x8eaea3){_0x107552=_0x107552-0x0;var _0x4e3331=_0xeda6[_0x107552];return _0x4e3331;};'use strict';var UserNotificationEvents=require(_0x6eda('0x0'));var events=[_0x6eda('0x1'),'remove','update'];function createListener(_0x275e13,_0x571640){return function(_0x3dcffc){_0x571640[_0x6eda('0x2')](_0x275e13,_0x3dcffc);};}function removeListener(_0x8fe415,_0x495d4b){return function(){UserNotificationEvents[_0x6eda('0x3')](_0x8fe415,_0x495d4b);};}exports[_0x6eda('0x4')]=function(_0x33d51){for(var _0x89b6f8=0x0,_0x35e7c8=events[_0x6eda('0x5')];_0x89b6f8<_0x35e7c8;_0x89b6f8++){var _0x5aa775=events[_0x89b6f8];var _0x5dfa1d=createListener(_0x6eda('0x6')+_0x5aa775,_0x33d51);UserNotificationEvents['on'](_0x5aa775,_0x5dfa1d);}}; \ No newline at end of file +var _0xd8e1=['emit','removeListener','length','userNotification:','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd8e1,0xee));var _0x1d8e=function(_0x3f0c05,_0xc35686){_0x3f0c05=_0x3f0c05-0x0;var _0x1642af=_0xd8e1[_0x3f0c05];return _0x1642af;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x1d8e('0x0'),_0x1d8e('0x1'),'update'];function createListener(_0x2ef48c,_0x32e5da){return function(_0x22e2da){_0x32e5da[_0x1d8e('0x2')](_0x2ef48c,_0x22e2da);};}function removeListener(_0x27b4cd,_0x5672e3){return function(){UserNotificationEvents[_0x1d8e('0x3')](_0x27b4cd,_0x5672e3);};}exports['register']=function(_0x5e90c9){for(var _0x42521b=0x0,_0xdbc50d=events[_0x1d8e('0x4')];_0x42521b<_0xdbc50d;_0x42521b++){var _0xce0faf=events[_0x42521b];var _0x2b399e=createListener(_0x1d8e('0x5')+_0xce0faf,_0x5e90c9);UserNotificationEvents['on'](_0xce0faf,_0x2b399e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 76d50b4..026c0ee 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x488bee,_0x231fa5){var _0x4c31e2=function(_0x29063a){while(--_0x29063a){_0x488bee['push'](_0x488bee['shift']());}};_0x4c31e2(++_0x231fa5);}(_0xe706,0xa3));var _0x6e70=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xe706[_0x3ceb54];return _0x26d8a6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x22f2e9,_0x475d3c){var _0xc9f7cd=function(_0x3a1555){while(--_0x3a1555){_0x22f2e9['push'](_0x22f2e9['shift']());}};_0xc9f7cd(++_0x475d3c);}(_0xedd9,0xfc));var _0x9edd=function(_0x3351f0,_0x7b3fbe){_0x3351f0=_0x3351f0-0x0;var _0x56228b=_0xedd9[_0x3351f0];return _0x56228b;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 5821f16..0e702ed 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 _0xecc8=['sequelize','exports'];(function(_0x29c298,_0x49689e){var _0x15c5ba=function(_0x36014e){while(--_0x36014e){_0x29c298['push'](_0x29c298['shift']());}};_0x15c5ba(++_0x49689e);}(_0xecc8,0xea));var _0x8ecc=function(_0x3c0713,_0x118272){_0x3c0713=_0x3c0713-0x0;var _0xda81d3=_0xecc8[_0x3c0713];return _0xda81d3;};'use strict';var Sequelize=require(_0x8ecc('0x0'));module[_0x8ecc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7631=['sequelize','INTEGER'];(function(_0x304fd7,_0x34e584){var _0x407ed8=function(_0x7fa10f){while(--_0x7fa10f){_0x304fd7['push'](_0x304fd7['shift']());}};_0x407ed8(++_0x34e584);}(_0x7631,0x108));var _0x1763=function(_0x91953d,_0x4565e7){_0x91953d=_0x91953d-0x0;var _0x365cd8=_0x7631[_0x91953d];return _0x365cd8;};'use strict';var Sequelize=require(_0x1763('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1763('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 6701657..b546079 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 _0x59b3=['user_has_openchannel_queues','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x458e3e,_0x576c7f){var _0x4bb0ee=function(_0x1ae0b1){while(--_0x1ae0b1){_0x458e3e['push'](_0x458e3e['shift']());}};_0x4bb0ee(++_0x576c7f);}(_0x59b3,0xfe));var _0x359b=function(_0x2a8384,_0x515571){_0x2a8384=_0x2a8384-0x0;var _0x4010a2=_0x59b3[_0x2a8384];return _0x4010a2;};'use strict';var _=require(_0x359b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x359b('0x1'));var rp=require(_0x359b('0x2'));var fs=require('fs');var path=require(_0x359b('0x3'));var rimraf=require(_0x359b('0x4'));var config=require(_0x359b('0x5'));var attributes=require(_0x359b('0x6'));module[_0x359b('0x7')]=function(_0x1f5d07,_0x21efd6){return _0x1f5d07[_0x359b('0x8')](_0x359b('0x9'),attributes,{'tableName':_0x359b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x936e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x936e,0xb6));var _0xe936=function(_0x3f4875,_0x1eee06){_0x3f4875=_0x3f4875-0x0;var _0x1727cf=_0x936e[_0x3f4875];return _0x1727cf;};'use strict';var _=require(_0xe936('0x0'));var util=require(_0xe936('0x1'));var logger=require('../../config/logger')(_0xe936('0x2'));var moment=require(_0xe936('0x3'));var BPromise=require(_0xe936('0x4'));var rp=require(_0xe936('0x5'));var fs=require('fs');var path=require(_0xe936('0x6'));var rimraf=require(_0xe936('0x7'));var config=require(_0xe936('0x8'));var attributes=require(_0xe936('0x9'));module[_0xe936('0xa')]=function(_0x149141,_0x191a23){return _0x149141[_0xe936('0xb')](_0xe936('0xc'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 6d44dc7..d5d4f9a 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 _0x4116=['bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x4116,0x1cb));var _0x6411=function(_0x45adaf,_0x21c3c1){_0x45adaf=_0x45adaf-0x0;var _0x15d189=_0x4116[_0x45adaf];return _0x15d189;};'use strict';var _=require(_0x6411('0x0'));var util=require(_0x6411('0x1'));var moment=require(_0x6411('0x2'));var BPromise=require(_0x6411('0x3'));var rs=require(_0x6411('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6411('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6411('0x6'))('rpc');var config=require(_0x6411('0x7'));var jayson=require(_0x6411('0x8'));var client=jayson[_0x6411('0x9')][_0x6411('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x530a57,_0x4ac59e,_0xa05d2e){return new BPromise(function(_0x447af2,_0x4f04df){return client[_0x6411('0xb')](_0x530a57,_0xa05d2e)[_0x6411('0xc')](function(_0x4f0426){logger[_0x6411('0xd')](_0x6411('0xe'),_0x4ac59e,_0x6411('0xf'));logger['debug'](_0x6411('0x10'),_0x4ac59e,_0x6411('0xf'),JSON['stringify'](_0x4f0426));if(_0x4f0426['error']){if(_0x4f0426[_0x6411('0x11')][_0x6411('0x12')]===0x1f4){logger[_0x6411('0x11')](_0x6411('0xe'),_0x4ac59e,_0x4f0426[_0x6411('0x11')][_0x6411('0x13')]);return _0x4f04df(_0x4f0426[_0x6411('0x11')][_0x6411('0x13')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4ac59e,_0x4f0426[_0x6411('0x11')][_0x6411('0x13')]);return _0x447af2(_0x4f0426[_0x6411('0x11')][_0x6411('0x13')]);}else{logger[_0x6411('0xd')](_0x6411('0xe'),_0x4ac59e,_0x6411('0xf'));_0x447af2(_0x4f0426[_0x6411('0x14')][_0x6411('0x13')]);}})[_0x6411('0x15')](function(_0x1c3bef){logger['error'](_0x6411('0xe'),_0x4ac59e,_0x1c3bef);_0x4f04df(_0x1c3bef);});});} \ No newline at end of file +var _0xd524=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash'];(function(_0xa41d25,_0x16df43){var _0x3278de=function(_0x4e0001){while(--_0x4e0001){_0xa41d25['push'](_0xa41d25['shift']());}};_0x3278de(++_0x16df43);}(_0xd524,0x11c));var _0x4d52=function(_0xa24477,_0x224ba5){_0xa24477=_0xa24477-0x0;var _0x3ade21=_0xd524[_0xa24477];return _0x3ade21;};'use strict';var _=require(_0x4d52('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d52('0x2'));var db=require(_0x4d52('0x3'))['db'];var utils=require(_0x4d52('0x4'));var logger=require(_0x4d52('0x5'))('rpc');var config=require(_0x4d52('0x6'));var jayson=require(_0x4d52('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x581490,_0x15cb57,_0x56654b){return new BPromise(function(_0x19965c,_0x115368){return client[_0x4d52('0x8')](_0x581490,_0x56654b)[_0x4d52('0x9')](function(_0x19a05f){logger['info'](_0x4d52('0xa'),_0x15cb57,_0x4d52('0xb'));logger[_0x4d52('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x15cb57,_0x4d52('0xb'),JSON[_0x4d52('0xd')](_0x19a05f));if(_0x19a05f[_0x4d52('0xe')]){if(_0x19a05f[_0x4d52('0xe')][_0x4d52('0xf')]===0x1f4){logger[_0x4d52('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x15cb57,_0x19a05f[_0x4d52('0xe')][_0x4d52('0x10')]);return _0x115368(_0x19a05f[_0x4d52('0xe')][_0x4d52('0x10')]);}logger['error'](_0x4d52('0xa'),_0x15cb57,_0x19a05f[_0x4d52('0xe')][_0x4d52('0x10')]);return _0x19965c(_0x19a05f[_0x4d52('0xe')]['message']);}else{logger[_0x4d52('0x11')](_0x4d52('0xa'),_0x15cb57,_0x4d52('0xb'));_0x19965c(_0x19a05f['result']['message']);}})[_0x4d52('0x12')](function(_0x314e3b){logger[_0x4d52('0xe')](_0x4d52('0xa'),_0x15cb57,_0x314e3b);_0x115368(_0x314e3b);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 559edde..7565e2c 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 _0x1099=['/describe','/:id','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index'];(function(_0x1aca6f,_0xd03dba){var _0x2ffe4d=function(_0x14d088){while(--_0x14d088){_0x1aca6f['push'](_0x1aca6f['shift']());}};_0x2ffe4d(++_0xd03dba);}(_0x1099,0x1b5));var _0x9109=function(_0xdec671,_0x65e132){_0xdec671=_0xdec671-0x0;var _0xcfbf4=_0x1099[_0xdec671];return _0xcfbf4;};'use strict';var multer=require(_0x9109('0x0'));var util=require(_0x9109('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9109('0x2'));var router=express[_0x9109('0x3')]();var fs_extra=require(_0x9109('0x4'));var auth=require(_0x9109('0x5'));var interaction=require(_0x9109('0x6'));var config=require('../../config/environment');var controller=require(_0x9109('0x7'));router[_0x9109('0x8')]('/',auth[_0x9109('0x9')](),controller[_0x9109('0xa')]);router[_0x9109('0x8')](_0x9109('0xb'),auth[_0x9109('0x9')](),controller['describe']);router[_0x9109('0x8')](_0x9109('0xc'),auth[_0x9109('0x9')](),controller['show']);router[_0x9109('0x8')](_0x9109('0xd'),auth[_0x9109('0x9')](),controller[_0x9109('0xe')]);router[_0x9109('0x8')]('/:id/resources',auth['isAuthenticated'](),controller[_0x9109('0xf')]);router[_0x9109('0x10')]('/',auth['isAuthenticated'](),controller[_0x9109('0x11')]);router[_0x9109('0x10')](_0x9109('0x12'),auth[_0x9109('0x9')](),controller[_0x9109('0x13')]);router[_0x9109('0x10')]('/:id/sections',auth[_0x9109('0x9')](),controller[_0x9109('0x14')]);router[_0x9109('0x10')]('/:id/resources',auth['isAuthenticated'](),controller['addResources']);router[_0x9109('0x15')](_0x9109('0xc'),auth[_0x9109('0x9')](),controller[_0x9109('0x16')]);router[_0x9109('0x17')]('/:id',auth[_0x9109('0x9')](),controller[_0x9109('0x18')]);router['delete']('/:id/sections',auth['isAuthenticated'](),controller[_0x9109('0x19')]);router['delete']('/:id/resources',auth[_0x9109('0x9')](),controller[_0x9109('0x1a')]);module[_0x9109('0x1b')]=router; \ No newline at end of file +var _0x2d5c=['get','index','isAuthenticated','show','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','/:id','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x2d5c,0x88));var _0xc2d5=function(_0xd03260,_0x25260a){_0xd03260=_0xd03260-0x0;var _0x19101e=_0x2d5c[_0xd03260];return _0x19101e;};'use strict';var multer=require(_0xc2d5('0x0'));var util=require(_0xc2d5('0x1'));var path=require(_0xc2d5('0x2'));var timeout=require(_0xc2d5('0x3'));var express=require(_0xc2d5('0x4'));var router=express[_0xc2d5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc2d5('0x6'));var config=require(_0xc2d5('0x7'));var controller=require(_0xc2d5('0x8'));router[_0xc2d5('0x9')]('/',auth['isAuthenticated'](),controller[_0xc2d5('0xa')]);router[_0xc2d5('0x9')]('/describe',auth[_0xc2d5('0xb')](),controller['describe']);router[_0xc2d5('0x9')]('/:id',auth[_0xc2d5('0xb')](),controller[_0xc2d5('0xc')]);router[_0xc2d5('0x9')](_0xc2d5('0xd'),auth[_0xc2d5('0xb')](),controller[_0xc2d5('0xe')]);router[_0xc2d5('0x9')](_0xc2d5('0xf'),auth[_0xc2d5('0xb')](),controller[_0xc2d5('0x10')]);router[_0xc2d5('0x11')]('/',auth[_0xc2d5('0xb')](),controller['create']);router['post'](_0xc2d5('0x12'),auth[_0xc2d5('0xb')](),controller[_0xc2d5('0x13')]);router[_0xc2d5('0x11')](_0xc2d5('0xd'),auth[_0xc2d5('0xb')](),controller[_0xc2d5('0x14')]);router['post'](_0xc2d5('0xf'),auth[_0xc2d5('0xb')](),controller[_0xc2d5('0x15')]);router['put'](_0xc2d5('0x16'),auth['isAuthenticated'](),controller[_0xc2d5('0x17')]);router[_0xc2d5('0x18')](_0xc2d5('0x16'),auth[_0xc2d5('0xb')](),controller[_0xc2d5('0x19')]);router[_0xc2d5('0x18')](_0xc2d5('0xd'),auth[_0xc2d5('0xb')](),controller[_0xc2d5('0x1a')]);router[_0xc2d5('0x18')](_0xc2d5('0xf'),auth['isAuthenticated'](),controller[_0xc2d5('0x1b')]);module[_0xc2d5('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 8762918..05dd83f 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 _0x3b72=['crudPermissions','split','BOOLEAN','sequelize','STRING','name','setDataValue','getDataValue'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0x3b72,0x93));var _0x23b7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3b72[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x23b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x23b7('0x1')],'allowNull':![],'unique':_0x23b7('0x2')},'crudPermissions':{'type':Sequelize[_0x23b7('0x1')],'set':function(_0x37cb55){this[_0x23b7('0x3')]('crudPermissions',_0x37cb55?_0x37cb55['join'](''):[]);},'get':function(){return this[_0x23b7('0x4')](_0x23b7('0x5'))?this[_0x23b7('0x4')](_0x23b7('0x5'))[_0x23b7('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x23b7('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x23b7('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x23b7('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x23b7('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x23b7('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x23b7('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x23b7('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x23b7('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xb38c=['split','BOOLEAN','sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x10e275,_0x38bddd){var _0x5007c7=function(_0x35ae4d){while(--_0x35ae4d){_0x10e275['push'](_0x10e275['shift']());}};_0x5007c7(++_0x38bddd);}(_0xb38c,0x12b));var _0xcb38=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0xb38c[_0xe1a3a5];return _0x362646;};'use strict';var Sequelize=require(_0xcb38('0x0'));module[_0xcb38('0x1')]={'name':{'type':Sequelize[_0xcb38('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xc77b55){this[_0xcb38('0x3')](_0xcb38('0x4'),_0xc77b55?_0xc77b55[_0xcb38('0x5')](''):[]);},'get':function(){return this[_0xcb38('0x6')](_0xcb38('0x4'))?this[_0xcb38('0x6')](_0xcb38('0x4'))[_0xcb38('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xcb38('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xcb38('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xcb38('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xcb38('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xcb38('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcb38('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcb38('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 d491b88..24755ae 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 _0xc323=['body','updatedAt','crudPermissions','createdAt','sequelize','transaction','create','UserProfileSection','each','autoAssociation','sectionId','omit','userProfileId','Resources','UserProfileResource','update','destroy','describe','push','removeSections','getSections','includes','isEmpty','subsections','enabled','concat','Dashboard','forEach','Plugin','resourceId','bulkCreate','get','removeResources','ids','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','stack','name','index','fieldName','type','key','map','query','filters','intersection','attributes','length','model','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','UserProfile','findAll','catch','show','params','keys','rawAttributes','fields','find'];(function(_0x559cb3,_0x1bafe1){var _0x3308cd=function(_0xd9f96){while(--_0xd9f96){_0x559cb3['push'](_0x559cb3['shift']());}};_0x3308cd(++_0x1bafe1);}(_0xc323,0x10b));var _0x3c32=function(_0x15f961,_0x7ce76a){_0x15f961=_0x15f961-0x0;var _0x203d38=_0xc323[_0x15f961];return _0x203d38;};'use strict';var emlformat=require(_0x3c32('0x0'));var rimraf=require(_0x3c32('0x1'));var zipdir=require(_0x3c32('0x2'));var jsonpatch=require(_0x3c32('0x3'));var rp=require(_0x3c32('0x4'));var moment=require(_0x3c32('0x5'));var BPromise=require(_0x3c32('0x6'));var Mustache=require(_0x3c32('0x7'));var util=require(_0x3c32('0x8'));var path=require(_0x3c32('0x9'));var sox=require(_0x3c32('0xa'));var csv=require(_0x3c32('0xb'));var ejs=require(_0x3c32('0xc'));var fs=require('fs');var fs_extra=require(_0x3c32('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3c32('0xe'));var jsforce=require(_0x3c32('0xf'));var deskjs=require(_0x3c32('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3c32('0x11'));var Papa=require(_0x3c32('0x12'));var Redis=require(_0x3c32('0x13'));var authService=require(_0x3c32('0x14'));var qs=require(_0x3c32('0x15'));var as=require(_0x3c32('0x16'));var hardwareService=require(_0x3c32('0x17'));var logger=require(_0x3c32('0x18'))(_0x3c32('0x19'));var utils=require(_0x3c32('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3c32('0x1b'))['db'];config['redis']=_['defaults'](config[_0x3c32('0x1c')],{'host':_0x3c32('0x1d'),'port':0x18eb});var socket=require(_0x3c32('0x1e'))(new Redis(config[_0x3c32('0x1c')]));require(_0x3c32('0x1f'))['register'](socket);function respondWithStatusCode(_0x18a5ce,_0x369e8e){_0x369e8e=_0x369e8e||0xcc;return function(_0x200282){if(_0x200282){return _0x18a5ce['sendStatus'](_0x369e8e);}return _0x18a5ce[_0x3c32('0x20')](_0x369e8e)[_0x3c32('0x21')]();};}function respondWithResult(_0x4e0749,_0x1f7d1a){_0x1f7d1a=_0x1f7d1a||0xc8;return function(_0x1a5b88){if(_0x1a5b88){return _0x4e0749[_0x3c32('0x20')](_0x1f7d1a)[_0x3c32('0x22')](_0x1a5b88);}};}function respondWithFilteredResult(_0x5b7270,_0x58dba8){return function(_0xb54972){if(_0xb54972){var _0x3852d8=typeof _0x58dba8[_0x3c32('0x23')]===_0x3c32('0x24')&&typeof _0x58dba8[_0x3c32('0x25')]===_0x3c32('0x24');var _0x248080=_0xb54972[_0x3c32('0x26')];var _0x51c00d=_0x3852d8?0x0:_0x58dba8[_0x3c32('0x23')];var _0xe3ba4c=_0x3852d8?_0xb54972[_0x3c32('0x26')]:_0x58dba8[_0x3c32('0x23')]+_0x58dba8[_0x3c32('0x25')];var _0x9c3361;if(_0xe3ba4c>=_0x248080){_0xe3ba4c=_0x248080;_0x9c3361=0xc8;}else{_0x9c3361=0xce;}_0x5b7270[_0x3c32('0x20')](_0x9c3361);return _0x5b7270[_0x3c32('0x27')](_0x3c32('0x28'),_0x51c00d+'-'+_0xe3ba4c+'/'+_0x248080)[_0x3c32('0x22')](_0xb54972);}return null;};}function patchUpdates(_0x1c9c29){return function(_0x55589b){try{jsonpatch[_0x3c32('0x29')](_0x55589b,_0x1c9c29,!![]);}catch(_0x2b35b8){return BPromise[_0x3c32('0x2a')](_0x2b35b8);}return _0x55589b[_0x3c32('0x2b')]();};}function saveUpdates(_0x1b10b0,_0x24a7ab){return function(_0x2ac31c){if(_0x2ac31c){return _0x2ac31c['update'](_0x1b10b0)['then'](function(_0x4f0420){return _0x4f0420;});}return null;};}function removeEntity(_0x3e98aa,_0x11684d){return function(_0x4d0759){if(_0x4d0759){return _0x4d0759['destroy']()[_0x3c32('0x2c')](function(){_0x3e98aa[_0x3c32('0x20')](0xcc)[_0x3c32('0x21')]();});}};}function handleEntityNotFound(_0x56d4d5,_0x4f1798){return function(_0x33e40c){if(!_0x33e40c){_0x56d4d5[_0x3c32('0x2d')](0x194);}return _0x33e40c;};}function handleError(_0x18c703,_0x4a501c){_0x4a501c=_0x4a501c||0x1f4;return function(_0x15fd78){logger['error'](_0x15fd78[_0x3c32('0x2e')]);if(_0x15fd78[_0x3c32('0x2f')]){delete _0x15fd78[_0x3c32('0x2f')];}_0x18c703['status'](_0x4a501c)['send'](_0x15fd78);};}exports[_0x3c32('0x30')]=function(_0x2ebe46,_0x39844b){var _0x1c08da={},_0x309e93={},_0xcc6bba={'count':0x0,'rows':[]};var _0x49a8fe=_['map'](db['UserProfile']['rawAttributes'],function(_0x2843b7){return{'name':_0x2843b7[_0x3c32('0x31')],'type':_0x2843b7[_0x3c32('0x32')][_0x3c32('0x33')]};});_0x309e93['model']=_[_0x3c32('0x34')](_0x49a8fe,_0x3c32('0x2f'));_0x309e93[_0x3c32('0x35')]=_['keys'](_0x2ebe46[_0x3c32('0x35')]);_0x309e93[_0x3c32('0x36')]=_[_0x3c32('0x37')](_0x309e93['model'],_0x309e93[_0x3c32('0x35')]);_0x1c08da['attributes']=_[_0x3c32('0x37')](_0x309e93['model'],qs['fields'](_0x2ebe46[_0x3c32('0x35')]['fields']));_0x1c08da[_0x3c32('0x38')]=_0x1c08da[_0x3c32('0x38')][_0x3c32('0x39')]?_0x1c08da[_0x3c32('0x38')]:_0x309e93[_0x3c32('0x3a')];if(!_0x2ebe46[_0x3c32('0x35')][_0x3c32('0x3b')](_0x3c32('0x3c'))){_0x1c08da['limit']=qs['limit'](_0x2ebe46[_0x3c32('0x35')][_0x3c32('0x25')]);_0x1c08da[_0x3c32('0x23')]=qs[_0x3c32('0x23')](_0x2ebe46[_0x3c32('0x35')][_0x3c32('0x23')]);}_0x1c08da['order']=qs[_0x3c32('0x3d')](_0x2ebe46['query'][_0x3c32('0x3d')]);_0x1c08da[_0x3c32('0x3e')]=qs[_0x3c32('0x36')](_[_0x3c32('0x3f')](_0x2ebe46['query'],_0x309e93[_0x3c32('0x36')]),_0x49a8fe);if(_0x2ebe46['query']['filter']){_0x1c08da['where']=_[_0x3c32('0x40')](_0x1c08da[_0x3c32('0x3e')],{'$or':_[_0x3c32('0x34')](_0x49a8fe,function(_0x2f057a){if(_0x2f057a[_0x3c32('0x32')]!=='VIRTUAL'){var _0x45a741={};_0x45a741[_0x2f057a[_0x3c32('0x2f')]]={'$like':'%'+_0x2ebe46[_0x3c32('0x35')][_0x3c32('0x41')]+'%'};return _0x45a741;}})});}_0x1c08da=_['merge']({},_0x1c08da,_0x2ebe46[_0x3c32('0x42')]);var _0x4f8a62={'where':_0x1c08da['where']};return db['UserProfile'][_0x3c32('0x26')](_0x4f8a62)[_0x3c32('0x2c')](function(_0x1e68bb){_0xcc6bba[_0x3c32('0x26')]=_0x1e68bb;if(_0x2ebe46[_0x3c32('0x35')][_0x3c32('0x43')]){_0x1c08da[_0x3c32('0x44')]=[{'all':!![]}];}return db[_0x3c32('0x45')][_0x3c32('0x46')](_0x1c08da);})[_0x3c32('0x2c')](function(_0x494168){_0xcc6bba['rows']=_0x494168;return _0xcc6bba;})['then'](respondWithFilteredResult(_0x39844b,_0x1c08da))[_0x3c32('0x47')](handleError(_0x39844b,null));};exports[_0x3c32('0x48')]=function(_0x4b8e23,_0x478978){var _0x133755={'raw':![],'where':{'id':_0x4b8e23[_0x3c32('0x49')]['id']}},_0x2e3f33={};_0x2e3f33[_0x3c32('0x3a')]=_[_0x3c32('0x4a')](db[_0x3c32('0x45')][_0x3c32('0x4b')]);_0x2e3f33['query']=_[_0x3c32('0x4a')](_0x4b8e23['query']);_0x2e3f33[_0x3c32('0x36')]=_[_0x3c32('0x37')](_0x2e3f33[_0x3c32('0x3a')],_0x2e3f33[_0x3c32('0x35')]);_0x133755[_0x3c32('0x38')]=_['intersection'](_0x2e3f33[_0x3c32('0x3a')],qs[_0x3c32('0x4c')](_0x4b8e23[_0x3c32('0x35')][_0x3c32('0x4c')]));_0x133755[_0x3c32('0x38')]=_0x133755[_0x3c32('0x38')][_0x3c32('0x39')]?_0x133755[_0x3c32('0x38')]:_0x2e3f33['model'];if(_0x4b8e23[_0x3c32('0x35')]['includeAll']){_0x133755['include']=[{'all':!![]}];}_0x133755=_[_0x3c32('0x40')]({},_0x133755,_0x4b8e23[_0x3c32('0x42')]);return db['UserProfile'][_0x3c32('0x4d')](_0x133755)[_0x3c32('0x2c')](handleEntityNotFound(_0x478978,null))[_0x3c32('0x2c')](respondWithResult(_0x478978,null))[_0x3c32('0x47')](handleError(_0x478978,null));};exports['create']=function(_0x126f1a,_0x3c30b6){return db[_0x3c32('0x45')]['create'](_0x126f1a[_0x3c32('0x4e')],{})[_0x3c32('0x2c')](respondWithResult(_0x3c30b6,0xc9))[_0x3c32('0x47')](handleError(_0x3c30b6,null));};exports['clone']=function(_0x368185,_0x4b6a6e){var _0x3a15a1={'where':{'id':_0x368185[_0x3c32('0x49')]['id']}},_0x4b75fc={};_0x4b75fc[_0x3c32('0x3a')]=_[_0x3c32('0x4a')](db[_0x3c32('0x45')]['rawAttributes']);_0x3a15a1[_0x3c32('0x38')]=_[_0x3c32('0x37')](_0x4b75fc[_0x3c32('0x3a')],qs[_0x3c32('0x4c')](_0x368185[_0x3c32('0x35')][_0x3c32('0x4c')]));_0x3a15a1[_0x3c32('0x38')]=_0x3a15a1[_0x3c32('0x38')][_0x3c32('0x39')]?_0x3a15a1[_0x3c32('0x38')]:_0x4b75fc[_0x3c32('0x3a')];if(_0x368185[_0x3c32('0x35')][_0x3c32('0x43')]){_0x3a15a1[_0x3c32('0x44')]=[{'all':!![]}];}_0x3a15a1=_[_0x3c32('0x40')]({},_0x3a15a1,_0x368185['options']);return db[_0x3c32('0x45')][_0x3c32('0x4d')](_0x3a15a1)[_0x3c32('0x2c')](handleEntityNotFound(_0x4b6a6e,null))['then'](function(_0x55819a){if(_0x55819a){var _0x430ac7=_0x55819a['get']({'plain':!![]});_0x430ac7=qs['omit'](_0x430ac7,['id','createdAt',_0x3c32('0x4f'),_0x3c32('0x50')]);_0x368185['body']=_['omit'](_0x368185[_0x3c32('0x4e')],['id',_0x3c32('0x51'),_0x3c32('0x4f')]);return db[_0x3c32('0x52')][_0x3c32('0x53')](function(_0x39a142){return db['UserProfile'][_0x3c32('0x54')](_[_0x3c32('0x40')](_0x430ac7,_0x368185['body']),{'include':_0x368185[_0x3c32('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x39a142})[_0x3c32('0x2c')](function(_0x5af1f0){var _0x29e7e5=_0x5af1f0['get']({'plain':!![]});return db[_0x3c32('0x55')][_0x3c32('0x46')]({'where':{'userProfileId':_0x368185[_0x3c32('0x49')]['id']},'raw':!![]})[_0x3c32('0x2c')](function(_0x5e47e0){if(_0x5e47e0){return BPromise[_0x3c32('0x56')](_0x5e47e0,function(_0x23f53c){return new BPromise(function(_0x2bda47,_0x1f31f4){if(_0x23f53c[_0x3c32('0x57')]===null||_0x23f53c[_0x3c32('0x57')]===0x1)_0x2bda47(null);return db['UserProfileResource'][_0x3c32('0x46')]({'where':{'sectionId':_0x23f53c['id']},'raw':!![]})[_0x3c32('0x2c')](function(_0x533136){var _0x5ec238=_[_0x3c32('0x34')](_0x533136,function(_0x48cb58){return qs['omit'](_0x48cb58,['id','createdAt',_0x3c32('0x4f'),_0x3c32('0x58')]);});_0x2bda47(_0x5ec238);})[_0x3c32('0x47')](function(_0x50bf36){_0x1f31f4(_0x50bf36);});})[_0x3c32('0x2c')](function(_0x32f269){var _0x5c07f6=qs[_0x3c32('0x59')](_0x23f53c,['id',_0x3c32('0x51'),'updatedAt']);_0x5c07f6[_0x3c32('0x5a')]=_0x29e7e5['id'];if(_0x32f269)_0x5c07f6[_0x3c32('0x5b')]=_0x32f269;return _0x5c07f6;})['then'](function(_0x5e0f3f){return db['UserProfileSection']['create'](_0x5e0f3f,{'include':[{'model':db[_0x3c32('0x5c')],'as':_0x3c32('0x5b')}],'raw':!![],'transaction':_0x39a142});});})['then'](function(){return _0x29e7e5;});}});});});}})['then'](respondWithResult(_0x4b6a6e,0xc9))['catch'](handleError(_0x4b6a6e,null));};exports[_0x3c32('0x5d')]=function(_0x5ea5aa,_0x2411c0){if(_0x5ea5aa['body']['id']){delete _0x5ea5aa[_0x3c32('0x4e')]['id'];}return db[_0x3c32('0x45')][_0x3c32('0x4d')]({'where':{'id':_0x5ea5aa[_0x3c32('0x49')]['id']}})['then'](handleEntityNotFound(_0x2411c0,null))[_0x3c32('0x2c')](saveUpdates(_0x5ea5aa[_0x3c32('0x4e')],null))[_0x3c32('0x2c')](respondWithResult(_0x2411c0,null))[_0x3c32('0x47')](handleError(_0x2411c0,null));};exports[_0x3c32('0x5e')]=function(_0x33d9d2,_0x287f77){return db[_0x3c32('0x45')][_0x3c32('0x4d')]({'where':{'id':_0x33d9d2[_0x3c32('0x49')]['id']}})[_0x3c32('0x2c')](handleEntityNotFound(_0x287f77,null))[_0x3c32('0x2c')](removeEntity(_0x287f77,null))[_0x3c32('0x47')](handleError(_0x287f77,null));};exports['describe']=function(_0x192014,_0x124c75){return db[_0x3c32('0x45')][_0x3c32('0x5f')]()[_0x3c32('0x2c')](respondWithResult(_0x124c75,null))[_0x3c32('0x47')](handleError(_0x124c75,null));};exports['addSections']=function(_0x191d30,_0x4b20d9){var _0x23b4b7=_0x191d30['body'];return db[_0x3c32('0x45')]['find']({'where':{'id':_0x191d30[_0x3c32('0x49')]['id']}})[_0x3c32('0x2c')](handleEntityNotFound(_0x4b20d9,null))[_0x3c32('0x2c')](function(_0x5d635e){if(_0x5d635e){return db[_0x3c32('0x52')][_0x3c32('0x53')](function(_0x1fff91){return db['UserProfileSection'][_0x3c32('0x5e')]({'where':{'userProfileId':_0x191d30[_0x3c32('0x49')]['id'],'sectionId':_[_0x3c32('0x34')](_0x23b4b7,function(_0x1b83a5){return _0x1b83a5[_0x3c32('0x58')];})},'transaction':_0x1fff91})[_0x3c32('0x2c')](function(){var _0x13aa21=_[_0x3c32('0x34')](_0x23b4b7,function(_0x114fea){_0x114fea[_0x3c32('0x5a')]=_0x191d30[_0x3c32('0x49')]['id'];return _0x114fea;});var _0x5d079b=[];return BPromise[_0x3c32('0x56')](_0x13aa21,function(_0x2f9734){return db[_0x3c32('0x55')][_0x3c32('0x54')](_0x2f9734,{'include':[{'model':db[_0x3c32('0x5c')],'as':'Resources'}],'raw':!![],'transaction':_0x1fff91})[_0x3c32('0x2c')](function(_0x5baa82){_0x5d079b[_0x3c32('0x60')](_0x5baa82['get']({'plain':!![]}));});})[_0x3c32('0x2c')](function(){return _0x5d079b;});});});}})[_0x3c32('0x2c')](function(_0x37ad74){return _0x37ad74;})[_0x3c32('0x2c')](respondWithResult(_0x4b20d9,null))['catch'](handleError(_0x4b20d9,null));};exports[_0x3c32('0x61')]=function(_0x1b0c8b,_0x219bb8){var _0x25950d;return db[_0x3c32('0x45')]['find']({'where':{'id':_0x1b0c8b[_0x3c32('0x49')]['id']},'attributes':['id',_0x3c32('0x2f')]})[_0x3c32('0x2c')](handleEntityNotFound(_0x219bb8,null))[_0x3c32('0x2c')](function(_0xe806fb){if(_0xe806fb){_0x25950d=_0xe806fb;return db[_0x3c32('0x55')][_0x3c32('0x5e')]({'where':{'userProfileId':_0x1b0c8b[_0x3c32('0x49')]['id'],'sectionId':_0x1b0c8b[_0x3c32('0x35')]['ids']}});}})[_0x3c32('0x2c')](function(){return _0x25950d;})[_0x3c32('0x2c')](respondWithStatusCode(_0x219bb8,null))[_0x3c32('0x47')](handleError(_0x219bb8,null));};exports[_0x3c32('0x62')]=function(_0x1f5ba7,_0x18b169){var _0x3f29fe=[];var _0x13eb93=[];return db[_0x3c32('0x55')][_0x3c32('0x46')]({'where':{'userProfileId':_0x1f5ba7[_0x3c32('0x49')]['id']},'raw':!![]})[_0x3c32('0x2c')](function(_0x34bae6){_0x3f29fe=_[_0x3c32('0x41')](_0x34bae6,function(_0x2ca33d){return _0x2ca33d['enabled']===0x1||_[_0x3c32('0x63')]([0x3eb,0x709],_0x2ca33d[_0x3c32('0x58')]);});if(!_[_0x3c32('0x64')](_0x3f29fe)){return _[_0x3c32('0x34')](_0x3f29fe,function(_0x176ebe){return _0x176ebe[_0x3c32('0x58')];});}else{return;}})[_0x3c32('0x2c')](function(_0x140a45){if(_0x140a45)_0x13eb93=_0x140a45;if(_[_0x3c32('0x63')](_0x13eb93,0x64)){var _0x5a6c3b=_[_0x3c32('0x4d')](_0x3f29fe,{'sectionId':0x64});return hasDefaultDashboard(_0x5a6c3b)[_0x3c32('0x2c')](function(_0xe4d81f){return _['map'](_0x3f29fe,function(_0x1f8a7b){if(_0x1f8a7b['sectionId']===0x64){_0x1f8a7b[_0x3c32('0x65')]=_0xe4d81f;}return _0x1f8a7b;});});}else{return;}})[_0x3c32('0x2c')](function(_0x5f3ab4){if(_0x5f3ab4)_0x3f29fe=_0x5f3ab4;if(_[_0x3c32('0x63')](_0x13eb93,0x3eb)){var _0xe7cc56=_[_0x3c32('0x4d')](_0x3f29fe,{'sectionId':0x3eb});return getCustomDashboards(_0xe7cc56)[_0x3c32('0x2c')](function(_0x5104dd){return _[_0x3c32('0x34')](_0x3f29fe,function(_0x4f86fc){if(_0xe7cc56[_0x3c32('0x66')]){if(_0x4f86fc['sectionId']===0x3eb){_0x4f86fc[_0x3c32('0x65')]=_0x5104dd;}}else{if(_0x4f86fc['sectionId']===0x64){if(!_0x4f86fc[_0x3c32('0x65')]){_0x4f86fc[_0x3c32('0x65')]=[];}_0x4f86fc['subsections']=_0x4f86fc[_0x3c32('0x65')][_0x3c32('0x67')](_0x5104dd);}}return _0x4f86fc;});});}else{return;}})[_0x3c32('0x2c')](function(_0x90135d){if(_0x90135d)_0x3f29fe=_0x90135d;if(_[_0x3c32('0x63')](_0x13eb93,0x709)){var _0x311b0a=_[_0x3c32('0x4d')](_0x3f29fe,{'sectionId':0x709});return getPlugins(_0x311b0a)[_0x3c32('0x2c')](function(_0x326f18){if(_0x311b0a['enabled']){return _[_0x3c32('0x34')](_0x3f29fe,function(_0x33cca7){if(_0x33cca7[_0x3c32('0x58')]===0x709){_0x33cca7[_0x3c32('0x65')]=_0x326f18;}return _0x33cca7;});}else{var _0x149227={'sectionId':0x76c,'enabled':0x1,'subsections':_0x326f18};var _0x5d8a9b=_[_0x3c32('0x34')](_0x3f29fe);_0x5d8a9b['push'](_0x149227);return _0x5d8a9b;}});}else{return;}})['then'](function(_0x507892){if(_0x507892)_0x3f29fe=_0x507892;return _[_0x3c32('0x41')](_0x3f29fe,['enabled',0x1]);})[_0x3c32('0x2c')](respondWithResult(_0x18b169,null))['catch'](handleError(_0x18b169,null));};function hasDefaultDashboard(_0x28e25c){var _0x31499a=[0x65];return new BPromise(function(_0x2a6db4,_0x377b4c){try{if(_0x28e25c[_0x3c32('0x57')]){_0x2a6db4(_0x31499a);}else{return db[_0x3c32('0x5c')]['findOne']({'where':{'sectionId':_0x28e25c['id']},'raw':!![]})[_0x3c32('0x2c')](function(_0x37065e){_0x37065e?_0x2a6db4(_0x31499a):_0x2a6db4();});}}catch(_0x3cbe5a){_0x377b4c(_0x3cbe5a);}});}function getCustomDashboards(_0x17f0d4){var _0xf04bd8=[];return new BPromise(function(_0x36247f,_0x2f32ae){try{if(_0x17f0d4[_0x3c32('0x57')]){return db[_0x3c32('0x68')]['findAll']({'raw':!![]})[_0x3c32('0x2c')](function(_0xa3dd21){_0xa3dd21[_0x3c32('0x69')](function(_0x5b2d6f){_0xf04bd8['push'](_0x5b2d6f['id']+0x1869f);});_0x36247f(_0xf04bd8);});}else{return db['UserProfileResource'][_0x3c32('0x46')]({'where':{'sectionId':_0x17f0d4['id']},'raw':!![]})[_0x3c32('0x2c')](function(_0x4cfa69){_0x4cfa69[_0x3c32('0x69')](function(_0x266825){_0xf04bd8[_0x3c32('0x60')](_0x266825['resourceId']+0x1869f);});_0x36247f(_0xf04bd8);});}}catch(_0x37a593){_0x2f32ae(_0x37a593);}});}function getPlugins(_0x2cfc73){var _0xeebb7e=[];return new BPromise(function(_0x2f86be,_0x5a9b8b){try{if(_0x2cfc73[_0x3c32('0x57')]){return db[_0x3c32('0x6a')][_0x3c32('0x46')]({'raw':!![]})['then'](function(_0x5927aa){_0x5927aa[_0x3c32('0x69')](function(_0x3dd8a3){_0xeebb7e[_0x3c32('0x60')](_0x3dd8a3['id']+0x15b38);});_0x2f86be(_0xeebb7e);});}else{return db[_0x3c32('0x5c')]['findAll']({'where':{'sectionId':_0x2cfc73['id']},'raw':!![]})['then'](function(_0x28c4d3){_0x28c4d3['forEach'](function(_0xf0bc50){_0xeebb7e[_0x3c32('0x60')](_0xf0bc50[_0x3c32('0x6b')]+0x15b38);});_0x2f86be(_0xeebb7e);});}}catch(_0x1a8647){_0x5a9b8b(_0x1a8647);}});}exports['addResources']=function(_0x3c64f7,_0x33e1b2){return db['UserProfile']['find']({'where':{'id':_0x3c64f7[_0x3c32('0x49')]['id']}})[_0x3c32('0x2c')](handleEntityNotFound(_0x33e1b2,null))[_0x3c32('0x2c')](function(_0xd3d8f7){if(_0xd3d8f7){return db[_0x3c32('0x52')][_0x3c32('0x53')](function(_0x4f6bff){return db['UserProfileSection'][_0x3c32('0x46')]({'where':{'userProfileId':_0x3c64f7[_0x3c32('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x3c32('0x2c')](function(_0x159598){if(_0x159598){return db[_0x3c32('0x55')][_0x3c32('0x5e')]({'where':{'userProfileId':_0x3c64f7[_0x3c32('0x49')]['id'],'id':_[_0x3c32('0x34')](_0x159598,function(_0x1da818){return _0x1da818['id'];})},'transaction':_0x4f6bff});}})[_0x3c32('0x2c')](function(_0x4d80e9){var _0x136179=_['map'](_0x3c64f7[_0x3c32('0x4e')],function(_0x3ea210){_0x3ea210['userProfileId']=_0x3c64f7['params']['id'];return _0x3ea210;});return db[_0x3c32('0x55')][_0x3c32('0x6c')](_0x136179,{'raw':!![],'transaction':_0x4f6bff});})[_0x3c32('0x2c')](function(_0x5b4c8d){var _0x4ecec4=_['filter'](_[_0x3c32('0x34')](_0x5b4c8d,function(_0x56cb6c){return _0x56cb6c[_0x3c32('0x6d')]({'plain':!![]});}),{'includeAll':![]});if(_0x4ecec4){return db[_0x3c32('0x55')]['findAll']({'where':{'userProfileId':_0x3c64f7['params']['id'],'sectionId':_[_0x3c32('0x34')](_0x4ecec4,function(_0x3be32f){return _0x3be32f['sectionId'];})},'attributes':['id',_0x3c32('0x58')],'raw':!![]})[_0x3c32('0x2c')](function(_0x573a73){var _0x2aa870=_[_0x3c32('0x34')](_0x3c64f7['body'],function(_0x4ae085){_0x4ae085[_0x3c32('0x5a')]=_0x3c64f7[_0x3c32('0x49')]['id'];return _0x4ae085;});return db['UserProfileResource']['bulkCreate'](_0x2aa870,{'raw':!![],'transaction':_0x4f6bff});});}})['catch'](handleError(_0x33e1b2,null));});}})['then'](function(_0x53f768){var _0x630016=_[_0x3c32('0x34')](_0x53f768,function(_0xf054aa){return _0xf054aa['get']({'plain':!![]});});})[_0x3c32('0x2c')](respondWithResult(_0x33e1b2,null))[_0x3c32('0x47')](handleError(_0x33e1b2,null));};exports[_0x3c32('0x6e')]=function(_0xcbbafc,_0x176f06,_0x40f1a9){return db[_0x3c32('0x45')][_0x3c32('0x4d')]({'where':{'id':_0xcbbafc['params']['id']}})[_0x3c32('0x2c')](handleEntityNotFound(_0x176f06,null))['then'](function(_0x33a1eb){if(_0x33a1eb){return _0x33a1eb[_0x3c32('0x6e')](_0xcbbafc[_0x3c32('0x35')][_0x3c32('0x6f')]);}})[_0x3c32('0x2c')](respondWithStatusCode(_0x176f06,null))['catch'](handleError(_0x176f06,null));};exports[_0x3c32('0x70')]=function(_0x383145,_0x27db27){var _0x20bd0e={};if(!_0x383145[_0x3c32('0x35')][_0x3c32('0x71')])throw new Error('Missing\x20section\x20parameter');if(!_0x383145[_0x3c32('0x35')][_0x3c32('0x3b')]('nolimit')){_0x20bd0e[_0x3c32('0x25')]=qs['limit'](_0x383145['query'][_0x3c32('0x25')]);_0x20bd0e[_0x3c32('0x23')]=qs[_0x3c32('0x23')](_0x383145[_0x3c32('0x35')]['offset']);}return db['UserProfile'][_0x3c32('0x4d')]({'where':{'id':_0x383145[_0x3c32('0x49')]['id']}})[_0x3c32('0x2c')](function(_0x5c3696){if(!_0x5c3696)throw new Error(_0x3c32('0x72')+_0x383145['params']['id']);return db[_0x3c32('0x45')][_0x3c32('0x70')](_0x383145);})[_0x3c32('0x2c')](respondWithFilteredResult(_0x27db27,_0x20bd0e))[_0x3c32('0x47')](handleError(_0x27db27,null));}; \ No newline at end of file +var _0x6e9a=['describe','addSections','sequelize','push','removeSections','ids','getSections','enabled','includes','subsections','concat','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','reject','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update'];(function(_0x3b4493,_0x106e71){var _0x28fc72=function(_0x1c6ec5){while(--_0x1c6ec5){_0x3b4493['push'](_0x3b4493['shift']());}};_0x28fc72(++_0x106e71);}(_0x6e9a,0xfd));var _0xa6e9=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x6e9a[_0x5a8aa3];return _0x5d0458;};'use strict';var emlformat=require(_0xa6e9('0x0'));var rimraf=require(_0xa6e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6e9('0x2'));var rp=require(_0xa6e9('0x3'));var moment=require(_0xa6e9('0x4'));var BPromise=require(_0xa6e9('0x5'));var Mustache=require(_0xa6e9('0x6'));var util=require('util');var path=require(_0xa6e9('0x7'));var sox=require(_0xa6e9('0x8'));var csv=require(_0xa6e9('0x9'));var ejs=require(_0xa6e9('0xa'));var fs=require('fs');var fs_extra=require(_0xa6e9('0xb'));var _=require(_0xa6e9('0xc'));var squel=require(_0xa6e9('0xd'));var crypto=require(_0xa6e9('0xe'));var jsforce=require(_0xa6e9('0xf'));var deskjs=require(_0xa6e9('0x10'));var toCsv=require(_0xa6e9('0x9'));var querystring=require(_0xa6e9('0x11'));var Papa=require(_0xa6e9('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6e9('0x14'))(_0xa6e9('0x15'));var utils=require(_0xa6e9('0x16'));var config=require(_0xa6e9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa6e9('0x18'))['db'];config['redis']=_[_0xa6e9('0x19')](config['redis'],{'host':_0xa6e9('0x1a'),'port':0x18eb});var socket=require(_0xa6e9('0x1b'))(new Redis(config['redis']));require(_0xa6e9('0x1c'))['register'](socket);function respondWithStatusCode(_0xb6495e,_0x7e6683){_0x7e6683=_0x7e6683||0xcc;return function(_0xb77b03){if(_0xb77b03){return _0xb6495e[_0xa6e9('0x1d')](_0x7e6683);}return _0xb6495e[_0xa6e9('0x1e')](_0x7e6683)[_0xa6e9('0x1f')]();};}function respondWithResult(_0x5146b7,_0x19a401){_0x19a401=_0x19a401||0xc8;return function(_0x70ada2){if(_0x70ada2){return _0x5146b7[_0xa6e9('0x1e')](_0x19a401)[_0xa6e9('0x20')](_0x70ada2);}};}function respondWithFilteredResult(_0x5cfa12,_0x5573b2){return function(_0xd897a){if(_0xd897a){var _0x46077c=typeof _0x5573b2['offset']===_0xa6e9('0x21')&&typeof _0x5573b2['limit']==='undefined';var _0x213a5b=_0xd897a['count'];var _0x5ea45b=_0x46077c?0x0:_0x5573b2[_0xa6e9('0x22')];var _0x47aa00=_0x46077c?_0xd897a['count']:_0x5573b2[_0xa6e9('0x22')]+_0x5573b2[_0xa6e9('0x23')];var _0x34fb64;if(_0x47aa00>=_0x213a5b){_0x47aa00=_0x213a5b;_0x34fb64=0xc8;}else{_0x34fb64=0xce;}_0x5cfa12[_0xa6e9('0x1e')](_0x34fb64);return _0x5cfa12[_0xa6e9('0x24')](_0xa6e9('0x25'),_0x5ea45b+'-'+_0x47aa00+'/'+_0x213a5b)['json'](_0xd897a);}return null;};}function patchUpdates(_0x30d53c){return function(_0x558653){try{jsonpatch['apply'](_0x558653,_0x30d53c,!![]);}catch(_0x1f8567){return BPromise[_0xa6e9('0x26')](_0x1f8567);}return _0x558653['save']();};}function saveUpdates(_0x230113,_0x29240b){return function(_0x2a9a6b){if(_0x2a9a6b){return _0x2a9a6b['update'](_0x230113)[_0xa6e9('0x27')](function(_0x3138bf){return _0x3138bf;});}return null;};}function removeEntity(_0x3141df,_0x15bd82){return function(_0x398647){if(_0x398647){return _0x398647[_0xa6e9('0x28')]()[_0xa6e9('0x27')](function(){_0x3141df[_0xa6e9('0x1e')](0xcc)[_0xa6e9('0x1f')]();});}};}function handleEntityNotFound(_0xd9400c,_0x91aa8b){return function(_0x27357c){if(!_0x27357c){_0xd9400c[_0xa6e9('0x1d')](0x194);}return _0x27357c;};}function handleError(_0x5c7d98,_0x393666){_0x393666=_0x393666||0x1f4;return function(_0x3c1894){logger[_0xa6e9('0x29')](_0x3c1894[_0xa6e9('0x2a')]);if(_0x3c1894[_0xa6e9('0x2b')]){delete _0x3c1894[_0xa6e9('0x2b')];}_0x5c7d98['status'](_0x393666)['send'](_0x3c1894);};}exports[_0xa6e9('0x2c')]=function(_0x4ef450,_0x3a637c){var _0x5ec61b={},_0x53e12a={},_0xfd9a30={'count':0x0,'rows':[]};var _0x22c162=_[_0xa6e9('0x2d')](db[_0xa6e9('0x2e')][_0xa6e9('0x2f')],function(_0x413f77){return{'name':_0x413f77['fieldName'],'type':_0x413f77[_0xa6e9('0x30')][_0xa6e9('0x31')]};});_0x53e12a['model']=_[_0xa6e9('0x2d')](_0x22c162,'name');_0x53e12a[_0xa6e9('0x32')]=_['keys'](_0x4ef450[_0xa6e9('0x32')]);_0x53e12a[_0xa6e9('0x33')]=_[_0xa6e9('0x34')](_0x53e12a[_0xa6e9('0x35')],_0x53e12a[_0xa6e9('0x32')]);_0x5ec61b[_0xa6e9('0x36')]=_[_0xa6e9('0x34')](_0x53e12a[_0xa6e9('0x35')],qs[_0xa6e9('0x37')](_0x4ef450[_0xa6e9('0x32')][_0xa6e9('0x37')]));_0x5ec61b[_0xa6e9('0x36')]=_0x5ec61b[_0xa6e9('0x36')]['length']?_0x5ec61b['attributes']:_0x53e12a[_0xa6e9('0x35')];if(!_0x4ef450['query'][_0xa6e9('0x38')]('nolimit')){_0x5ec61b[_0xa6e9('0x23')]=qs[_0xa6e9('0x23')](_0x4ef450[_0xa6e9('0x32')]['limit']);_0x5ec61b[_0xa6e9('0x22')]=qs['offset'](_0x4ef450[_0xa6e9('0x32')]['offset']);}_0x5ec61b[_0xa6e9('0x39')]=qs[_0xa6e9('0x3a')](_0x4ef450[_0xa6e9('0x32')]['sort']);_0x5ec61b[_0xa6e9('0x3b')]=qs[_0xa6e9('0x33')](_[_0xa6e9('0x3c')](_0x4ef450[_0xa6e9('0x32')],_0x53e12a[_0xa6e9('0x33')]),_0x22c162);if(_0x4ef450['query'][_0xa6e9('0x3d')]){_0x5ec61b[_0xa6e9('0x3b')]=_['merge'](_0x5ec61b['where'],{'$or':_[_0xa6e9('0x2d')](_0x22c162,function(_0x3481ee){if(_0x3481ee[_0xa6e9('0x30')]!=='VIRTUAL'){var _0x466ef5={};_0x466ef5[_0x3481ee[_0xa6e9('0x2b')]]={'$like':'%'+_0x4ef450[_0xa6e9('0x32')]['filter']+'%'};return _0x466ef5;}})});}_0x5ec61b=_[_0xa6e9('0x3e')]({},_0x5ec61b,_0x4ef450['options']);var _0x1944e3={'where':_0x5ec61b[_0xa6e9('0x3b')]};return db[_0xa6e9('0x2e')][_0xa6e9('0x3f')](_0x1944e3)[_0xa6e9('0x27')](function(_0x4730a5){_0xfd9a30[_0xa6e9('0x3f')]=_0x4730a5;if(_0x4ef450[_0xa6e9('0x32')][_0xa6e9('0x40')]){_0x5ec61b[_0xa6e9('0x41')]=[{'all':!![]}];}return db[_0xa6e9('0x2e')][_0xa6e9('0x42')](_0x5ec61b);})[_0xa6e9('0x27')](function(_0x2136b6){_0xfd9a30[_0xa6e9('0x43')]=_0x2136b6;return _0xfd9a30;})['then'](respondWithFilteredResult(_0x3a637c,_0x5ec61b))[_0xa6e9('0x44')](handleError(_0x3a637c,null));};exports[_0xa6e9('0x45')]=function(_0x19946c,_0x1a552a){var _0x4f7a1d={'raw':![],'where':{'id':_0x19946c[_0xa6e9('0x46')]['id']}},_0xbe7d41={};_0xbe7d41[_0xa6e9('0x35')]=_[_0xa6e9('0x47')](db['UserProfile'][_0xa6e9('0x2f')]);_0xbe7d41[_0xa6e9('0x32')]=_['keys'](_0x19946c['query']);_0xbe7d41[_0xa6e9('0x33')]=_['intersection'](_0xbe7d41[_0xa6e9('0x35')],_0xbe7d41[_0xa6e9('0x32')]);_0x4f7a1d[_0xa6e9('0x36')]=_['intersection'](_0xbe7d41[_0xa6e9('0x35')],qs[_0xa6e9('0x37')](_0x19946c['query'][_0xa6e9('0x37')]));_0x4f7a1d[_0xa6e9('0x36')]=_0x4f7a1d[_0xa6e9('0x36')][_0xa6e9('0x48')]?_0x4f7a1d[_0xa6e9('0x36')]:_0xbe7d41[_0xa6e9('0x35')];if(_0x19946c[_0xa6e9('0x32')]['includeAll']){_0x4f7a1d[_0xa6e9('0x41')]=[{'all':!![]}];}_0x4f7a1d=_[_0xa6e9('0x3e')]({},_0x4f7a1d,_0x19946c[_0xa6e9('0x49')]);return db[_0xa6e9('0x2e')][_0xa6e9('0x4a')](_0x4f7a1d)[_0xa6e9('0x27')](handleEntityNotFound(_0x1a552a,null))[_0xa6e9('0x27')](respondWithResult(_0x1a552a,null))[_0xa6e9('0x44')](handleError(_0x1a552a,null));};exports['create']=function(_0xae4991,_0x570b7c){return db['UserProfile'][_0xa6e9('0x4b')](_0xae4991[_0xa6e9('0x4c')],{})[_0xa6e9('0x27')](respondWithResult(_0x570b7c,0xc9))[_0xa6e9('0x44')](handleError(_0x570b7c,null));};exports[_0xa6e9('0x4d')]=function(_0x5764ec,_0x44d577){var _0xc2dd1c={'where':{'id':_0x5764ec[_0xa6e9('0x46')]['id']}},_0x6107ea={};_0x6107ea[_0xa6e9('0x35')]=_['keys'](db[_0xa6e9('0x2e')][_0xa6e9('0x2f')]);_0xc2dd1c['attributes']=_['intersection'](_0x6107ea[_0xa6e9('0x35')],qs['fields'](_0x5764ec['query'][_0xa6e9('0x37')]));_0xc2dd1c['attributes']=_0xc2dd1c[_0xa6e9('0x36')]['length']?_0xc2dd1c['attributes']:_0x6107ea[_0xa6e9('0x35')];if(_0x5764ec[_0xa6e9('0x32')][_0xa6e9('0x40')]){_0xc2dd1c[_0xa6e9('0x41')]=[{'all':!![]}];}_0xc2dd1c=_[_0xa6e9('0x3e')]({},_0xc2dd1c,_0x5764ec[_0xa6e9('0x49')]);return db[_0xa6e9('0x2e')][_0xa6e9('0x4a')](_0xc2dd1c)[_0xa6e9('0x27')](handleEntityNotFound(_0x44d577,null))[_0xa6e9('0x27')](function(_0x245441){if(_0x245441){var _0x2c37e3=_0x245441[_0xa6e9('0x4e')]({'plain':!![]});_0x2c37e3=qs[_0xa6e9('0x4f')](_0x2c37e3,['id',_0xa6e9('0x50'),_0xa6e9('0x51'),_0xa6e9('0x52')]);_0x5764ec[_0xa6e9('0x4c')]=_[_0xa6e9('0x4f')](_0x5764ec['body'],['id',_0xa6e9('0x50'),'updatedAt']);return db['sequelize'][_0xa6e9('0x53')](function(_0x19a415){return db[_0xa6e9('0x2e')]['create'](_[_0xa6e9('0x3e')](_0x2c37e3,_0x5764ec[_0xa6e9('0x4c')]),{'include':_0x5764ec[_0xa6e9('0x32')][_0xa6e9('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x19a415})['then'](function(_0x13b356){var _0x16002d=_0x13b356[_0xa6e9('0x4e')]({'plain':!![]});return db[_0xa6e9('0x54')]['findAll']({'where':{'userProfileId':_0x5764ec[_0xa6e9('0x46')]['id']},'raw':!![]})[_0xa6e9('0x27')](function(_0xed3bae){if(_0xed3bae){return BPromise[_0xa6e9('0x55')](_0xed3bae,function(_0x54c63c){return new BPromise(function(_0x54c69d,_0x123a81){if(_0x54c63c[_0xa6e9('0x56')]===null||_0x54c63c[_0xa6e9('0x56')]===0x1)_0x54c69d(null);return db[_0xa6e9('0x57')][_0xa6e9('0x42')]({'where':{'sectionId':_0x54c63c['id']},'raw':!![]})[_0xa6e9('0x27')](function(_0x547325){var _0x327632=_[_0xa6e9('0x2d')](_0x547325,function(_0x337218){return qs[_0xa6e9('0x4f')](_0x337218,['id',_0xa6e9('0x50'),_0xa6e9('0x51'),_0xa6e9('0x58')]);});_0x54c69d(_0x327632);})['catch'](function(_0x5b29ba){_0x123a81(_0x5b29ba);});})['then'](function(_0x374225){var _0x5994c2=qs[_0xa6e9('0x4f')](_0x54c63c,['id',_0xa6e9('0x50'),_0xa6e9('0x51')]);_0x5994c2[_0xa6e9('0x59')]=_0x16002d['id'];if(_0x374225)_0x5994c2[_0xa6e9('0x5a')]=_0x374225;return _0x5994c2;})['then'](function(_0x2d78fe){return db['UserProfileSection'][_0xa6e9('0x4b')](_0x2d78fe,{'include':[{'model':db[_0xa6e9('0x57')],'as':_0xa6e9('0x5a')}],'raw':!![],'transaction':_0x19a415});});})[_0xa6e9('0x27')](function(){return _0x16002d;});}});});});}})['then'](respondWithResult(_0x44d577,0xc9))[_0xa6e9('0x44')](handleError(_0x44d577,null));};exports[_0xa6e9('0x5b')]=function(_0x51e618,_0x197757){if(_0x51e618[_0xa6e9('0x4c')]['id']){delete _0x51e618[_0xa6e9('0x4c')]['id'];}return db[_0xa6e9('0x2e')][_0xa6e9('0x4a')]({'where':{'id':_0x51e618[_0xa6e9('0x46')]['id']}})[_0xa6e9('0x27')](handleEntityNotFound(_0x197757,null))[_0xa6e9('0x27')](saveUpdates(_0x51e618[_0xa6e9('0x4c')],null))[_0xa6e9('0x27')](respondWithResult(_0x197757,null))[_0xa6e9('0x44')](handleError(_0x197757,null));};exports['destroy']=function(_0x2ae581,_0x267f35){return db[_0xa6e9('0x2e')]['find']({'where':{'id':_0x2ae581['params']['id']}})[_0xa6e9('0x27')](handleEntityNotFound(_0x267f35,null))[_0xa6e9('0x27')](removeEntity(_0x267f35,null))[_0xa6e9('0x44')](handleError(_0x267f35,null));};exports['describe']=function(_0x6e4b99,_0x6ceb85){return db[_0xa6e9('0x2e')][_0xa6e9('0x5c')]()[_0xa6e9('0x27')](respondWithResult(_0x6ceb85,null))['catch'](handleError(_0x6ceb85,null));};exports[_0xa6e9('0x5d')]=function(_0x3c9463,_0x288169){var _0x3f4418=_0x3c9463['body'];return db['UserProfile'][_0xa6e9('0x4a')]({'where':{'id':_0x3c9463[_0xa6e9('0x46')]['id']}})[_0xa6e9('0x27')](handleEntityNotFound(_0x288169,null))['then'](function(_0x17f297){if(_0x17f297){return db[_0xa6e9('0x5e')]['transaction'](function(_0x2ec72f){return db[_0xa6e9('0x54')][_0xa6e9('0x28')]({'where':{'userProfileId':_0x3c9463['params']['id'],'sectionId':_[_0xa6e9('0x2d')](_0x3f4418,function(_0x3a813c){return _0x3a813c['sectionId'];})},'transaction':_0x2ec72f})[_0xa6e9('0x27')](function(){var _0x2ffe8b=_[_0xa6e9('0x2d')](_0x3f4418,function(_0x498c18){_0x498c18['userProfileId']=_0x3c9463[_0xa6e9('0x46')]['id'];return _0x498c18;});var _0x336793=[];return BPromise[_0xa6e9('0x55')](_0x2ffe8b,function(_0x531dc9){return db[_0xa6e9('0x54')]['create'](_0x531dc9,{'include':[{'model':db[_0xa6e9('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x2ec72f})['then'](function(_0x4be2f8){_0x336793[_0xa6e9('0x5f')](_0x4be2f8[_0xa6e9('0x4e')]({'plain':!![]}));});})[_0xa6e9('0x27')](function(){return _0x336793;});});});}})[_0xa6e9('0x27')](function(_0x1977f2){return _0x1977f2;})[_0xa6e9('0x27')](respondWithResult(_0x288169,null))[_0xa6e9('0x44')](handleError(_0x288169,null));};exports[_0xa6e9('0x60')]=function(_0x3352df,_0x506342){var _0x5b3434;return db['UserProfile'][_0xa6e9('0x4a')]({'where':{'id':_0x3352df[_0xa6e9('0x46')]['id']},'attributes':['id','name']})[_0xa6e9('0x27')](handleEntityNotFound(_0x506342,null))[_0xa6e9('0x27')](function(_0x460f7a){if(_0x460f7a){_0x5b3434=_0x460f7a;return db[_0xa6e9('0x54')][_0xa6e9('0x28')]({'where':{'userProfileId':_0x3352df[_0xa6e9('0x46')]['id'],'sectionId':_0x3352df['query'][_0xa6e9('0x61')]}});}})[_0xa6e9('0x27')](function(){return _0x5b3434;})['then'](respondWithStatusCode(_0x506342,null))[_0xa6e9('0x44')](handleError(_0x506342,null));};exports[_0xa6e9('0x62')]=function(_0x4348e4,_0x25449d){var _0xcf4525=[];var _0x37488f=[];return db[_0xa6e9('0x54')]['findAll']({'where':{'userProfileId':_0x4348e4[_0xa6e9('0x46')]['id']},'raw':!![]})['then'](function(_0x3c67dd){_0xcf4525=_[_0xa6e9('0x3d')](_0x3c67dd,function(_0x1a31b9){return _0x1a31b9[_0xa6e9('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x1a31b9[_0xa6e9('0x58')]);});if(!_['isEmpty'](_0xcf4525)){return _['map'](_0xcf4525,function(_0x4bfbb9){return _0x4bfbb9['sectionId'];});}else{return;}})['then'](function(_0x2cb4de){if(_0x2cb4de)_0x37488f=_0x2cb4de;if(_[_0xa6e9('0x64')](_0x37488f,0x64)){var _0x531acf=_[_0xa6e9('0x4a')](_0xcf4525,{'sectionId':0x64});return hasDefaultDashboard(_0x531acf)[_0xa6e9('0x27')](function(_0x5287b6){return _['map'](_0xcf4525,function(_0x381cae){if(_0x381cae[_0xa6e9('0x58')]===0x64){_0x381cae['subsections']=_0x5287b6;}return _0x381cae;});});}else{return;}})[_0xa6e9('0x27')](function(_0x243eb4){if(_0x243eb4)_0xcf4525=_0x243eb4;if(_[_0xa6e9('0x64')](_0x37488f,0x3eb)){var _0x2f95c6=_['find'](_0xcf4525,{'sectionId':0x3eb});return getCustomDashboards(_0x2f95c6)['then'](function(_0x275ffe){return _[_0xa6e9('0x2d')](_0xcf4525,function(_0xc8904){if(_0x2f95c6[_0xa6e9('0x63')]){if(_0xc8904['sectionId']===0x3eb){_0xc8904[_0xa6e9('0x65')]=_0x275ffe;}}else{if(_0xc8904['sectionId']===0x64){if(!_0xc8904[_0xa6e9('0x65')]){_0xc8904[_0xa6e9('0x65')]=[];}_0xc8904[_0xa6e9('0x65')]=_0xc8904[_0xa6e9('0x65')][_0xa6e9('0x66')](_0x275ffe);}}return _0xc8904;});});}else{return;}})['then'](function(_0x27436e){if(_0x27436e)_0xcf4525=_0x27436e;if(_['includes'](_0x37488f,0x709)){var _0x817d0e=_[_0xa6e9('0x4a')](_0xcf4525,{'sectionId':0x709});return getPlugins(_0x817d0e)['then'](function(_0x5d2078){if(_0x817d0e[_0xa6e9('0x63')]){return _['map'](_0xcf4525,function(_0x5b98fa){if(_0x5b98fa[_0xa6e9('0x58')]===0x709){_0x5b98fa[_0xa6e9('0x65')]=_0x5d2078;}return _0x5b98fa;});}else{var _0x22459b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5d2078};var _0x8d3b29=_[_0xa6e9('0x2d')](_0xcf4525);_0x8d3b29['push'](_0x22459b);return _0x8d3b29;}});}else{return;}})[_0xa6e9('0x27')](function(_0x55b8ba){if(_0x55b8ba)_0xcf4525=_0x55b8ba;return _[_0xa6e9('0x3d')](_0xcf4525,[_0xa6e9('0x63'),0x1]);})[_0xa6e9('0x27')](respondWithResult(_0x25449d,null))[_0xa6e9('0x44')](handleError(_0x25449d,null));};function hasDefaultDashboard(_0x4c6660){var _0x349e8=[0x65];return new BPromise(function(_0x90761b,_0x8aa29){try{if(_0x4c6660[_0xa6e9('0x56')]){_0x90761b(_0x349e8);}else{return db[_0xa6e9('0x57')][_0xa6e9('0x67')]({'where':{'sectionId':_0x4c6660['id']},'raw':!![]})[_0xa6e9('0x27')](function(_0x58d49e){_0x58d49e?_0x90761b(_0x349e8):_0x90761b();});}}catch(_0x131e48){_0x8aa29(_0x131e48);}});}function getCustomDashboards(_0x348667){var _0x553f16=[];return new BPromise(function(_0x444a4e,_0x57871b){try{if(_0x348667[_0xa6e9('0x56')]){return db[_0xa6e9('0x68')]['findAll']({'raw':!![]})[_0xa6e9('0x27')](function(_0xbe9024){_0xbe9024[_0xa6e9('0x69')](function(_0x3a2d91){_0x553f16[_0xa6e9('0x5f')](_0x3a2d91['id']+0x1869f);});_0x444a4e(_0x553f16);});}else{return db[_0xa6e9('0x57')]['findAll']({'where':{'sectionId':_0x348667['id']},'raw':!![]})['then'](function(_0x33126b){_0x33126b[_0xa6e9('0x69')](function(_0x31a0b6){_0x553f16[_0xa6e9('0x5f')](_0x31a0b6['resourceId']+0x1869f);});_0x444a4e(_0x553f16);});}}catch(_0x59aeb4){_0x57871b(_0x59aeb4);}});}function getPlugins(_0x1ba737){var _0x3ca376=[];return new BPromise(function(_0x51e04d,_0x4cc832){try{if(_0x1ba737['autoAssociation']){return db[_0xa6e9('0x6a')]['findAll']({'raw':!![]})[_0xa6e9('0x27')](function(_0x3f07c5){_0x3f07c5[_0xa6e9('0x69')](function(_0x3aaef4){_0x3ca376['push'](_0x3aaef4['id']+0x15b38);});_0x51e04d(_0x3ca376);});}else{return db[_0xa6e9('0x57')][_0xa6e9('0x42')]({'where':{'sectionId':_0x1ba737['id']},'raw':!![]})[_0xa6e9('0x27')](function(_0x456ff6){_0x456ff6[_0xa6e9('0x69')](function(_0x432408){_0x3ca376[_0xa6e9('0x5f')](_0x432408[_0xa6e9('0x6b')]+0x15b38);});_0x51e04d(_0x3ca376);});}}catch(_0x14a363){_0x4cc832(_0x14a363);}});}exports[_0xa6e9('0x6c')]=function(_0x11f28c,_0x3270c5){return db['UserProfile']['find']({'where':{'id':_0x11f28c[_0xa6e9('0x46')]['id']}})[_0xa6e9('0x27')](handleEntityNotFound(_0x3270c5,null))[_0xa6e9('0x27')](function(_0x2a69af){if(_0x2a69af){return db[_0xa6e9('0x5e')]['transaction'](function(_0x514d01){return db['UserProfileSection'][_0xa6e9('0x42')]({'where':{'userProfileId':_0x11f28c[_0xa6e9('0x46')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x64a48d){if(_0x64a48d){return db[_0xa6e9('0x54')][_0xa6e9('0x28')]({'where':{'userProfileId':_0x11f28c[_0xa6e9('0x46')]['id'],'id':_['map'](_0x64a48d,function(_0x59afff){return _0x59afff['id'];})},'transaction':_0x514d01});}})[_0xa6e9('0x27')](function(_0x5c672b){var _0xa82bab=_['map'](_0x11f28c[_0xa6e9('0x4c')],function(_0x2351f7){_0x2351f7[_0xa6e9('0x59')]=_0x11f28c[_0xa6e9('0x46')]['id'];return _0x2351f7;});return db[_0xa6e9('0x54')][_0xa6e9('0x6d')](_0xa82bab,{'raw':!![],'transaction':_0x514d01});})['then'](function(_0x3d1200){var _0x416207=_[_0xa6e9('0x3d')](_['map'](_0x3d1200,function(_0x2577b2){return _0x2577b2[_0xa6e9('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x416207){return db[_0xa6e9('0x54')]['findAll']({'where':{'userProfileId':_0x11f28c[_0xa6e9('0x46')]['id'],'sectionId':_['map'](_0x416207,function(_0x2e0b07){return _0x2e0b07[_0xa6e9('0x58')];})},'attributes':['id',_0xa6e9('0x58')],'raw':!![]})[_0xa6e9('0x27')](function(_0xa9ebab){var _0x4a2f01=_[_0xa6e9('0x2d')](_0x11f28c[_0xa6e9('0x4c')],function(_0x3b5ce1){_0x3b5ce1['userProfileId']=_0x11f28c[_0xa6e9('0x46')]['id'];return _0x3b5ce1;});return db[_0xa6e9('0x57')][_0xa6e9('0x6d')](_0x4a2f01,{'raw':!![],'transaction':_0x514d01});});}})[_0xa6e9('0x44')](handleError(_0x3270c5,null));});}})[_0xa6e9('0x27')](function(_0x430864){var _0x3ddf88=_[_0xa6e9('0x2d')](_0x430864,function(_0x2dd237){return _0x2dd237[_0xa6e9('0x4e')]({'plain':!![]});});})['then'](respondWithResult(_0x3270c5,null))[_0xa6e9('0x44')](handleError(_0x3270c5,null));};exports[_0xa6e9('0x6e')]=function(_0x4f0a8c,_0x120688,_0x200380){return db[_0xa6e9('0x2e')][_0xa6e9('0x4a')]({'where':{'id':_0x4f0a8c[_0xa6e9('0x46')]['id']}})[_0xa6e9('0x27')](handleEntityNotFound(_0x120688,null))['then'](function(_0x4ab7ff){if(_0x4ab7ff){return _0x4ab7ff['removeResources'](_0x4f0a8c[_0xa6e9('0x32')][_0xa6e9('0x61')]);}})[_0xa6e9('0x27')](respondWithStatusCode(_0x120688,null))['catch'](handleError(_0x120688,null));};exports[_0xa6e9('0x6f')]=function(_0x562f5b,_0x1da8e4){var _0xd9f8ce={};if(!_0x562f5b['query']['section'])throw new Error(_0xa6e9('0x70'));if(!_0x562f5b[_0xa6e9('0x32')][_0xa6e9('0x38')](_0xa6e9('0x71'))){_0xd9f8ce[_0xa6e9('0x23')]=qs[_0xa6e9('0x23')](_0x562f5b[_0xa6e9('0x32')][_0xa6e9('0x23')]);_0xd9f8ce[_0xa6e9('0x22')]=qs['offset'](_0x562f5b[_0xa6e9('0x32')][_0xa6e9('0x22')]);}return db[_0xa6e9('0x2e')][_0xa6e9('0x4a')]({'where':{'id':_0x562f5b[_0xa6e9('0x46')]['id']}})[_0xa6e9('0x27')](function(_0x53f0e4){if(!_0x53f0e4)throw new Error(_0xa6e9('0x72')+_0x562f5b[_0xa6e9('0x46')]['id']);return db[_0xa6e9('0x2e')]['getResources'](_0x562f5b);})['then'](respondWithFilteredResult(_0x1da8e4,_0xd9f8ce))[_0xa6e9('0x44')](handleError(_0x1da8e4,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 3eaf1bb..6d7a114 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 _0x6829=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','update','remove'];(function(_0xb8b7ed,_0x3c8900){var _0x5b4989=function(_0x1a7285){while(--_0x1a7285){_0xb8b7ed['push'](_0xb8b7ed['shift']());}};_0x5b4989(++_0x3c8900);}(_0x6829,0x14c));var _0x9682=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x6829[_0x16d10f];return _0x50c823;};'use strict';var EventEmitter=require(_0x9682('0x0'));var UserProfile=require(_0x9682('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9682('0x2'),'afterDestroy':_0x9682('0x3')};function emitEvent(_0x1bfe61){return function(_0x3b8d4a,_0x3b721e,_0x1b0e5f){UserProfileEvents[_0x9682('0x4')](_0x1bfe61+':'+_0x3b8d4a['id'],_0x3b8d4a);UserProfileEvents[_0x9682('0x4')](_0x1bfe61,_0x3b8d4a);_0x1b0e5f(null);};}for(var e in events){if(events[_0x9682('0x5')](e)){var event=events[e];UserProfile[_0x9682('0x6')](e,emitEvent(event));}}module[_0x9682('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xd959=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','save','update'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xd959,0x94));var _0x9d95=function(_0x4f5f52,_0x3438eb){_0x4f5f52=_0x4f5f52-0x0;var _0xc65bc=_0xd959[_0x4f5f52];return _0xc65bc;};'use strict';var EventEmitter=require(_0x9d95('0x0'));var UserProfile=require(_0x9d95('0x1'))['db'][_0x9d95('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9d95('0x3'),'afterUpdate':_0x9d95('0x4'),'afterDestroy':_0x9d95('0x5')};function emitEvent(_0x261f81){return function(_0x2d997b,_0x5567d7,_0x277e44){UserProfileEvents[_0x9d95('0x6')](_0x261f81+':'+_0x2d997b['id'],_0x2d997b);UserProfileEvents[_0x9d95('0x6')](_0x261f81,_0x2d997b);_0x277e44(null);};}for(var e in events){if(events[_0x9d95('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x9d95('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 691e901..6c373ec 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 _0xf204=['squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','projectName','projects','JscriptyProject','contacts','CmContact','parentSections','ListId','CmList','companies','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','role','Telephones','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','Pause','scheduler','sounds','tags','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','isEmpty','length','push','find','params','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','key','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tag','Tags','color','tag','ThroughTags','openTabs','true','chat','fax','dataValues','mail','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','value','findAll','associatedResources','map','catch','model','then','name','resolve','field','AnalyticExtractedReport','resourceId'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf204,0x16a));var _0x4f20=function(_0x541a36,_0x5adc64){_0x541a36=_0x541a36-0x0;var _0x195843=_0xf204[_0x541a36];return _0x195843;};'use strict';var _=require(_0x4f20('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x4f20('0x1'));var squel=require(_0x4f20('0x2'));module[_0x4f20('0x3')]=function(_0x4cd6e8){var _0x18ce5d=_0x4cd6e8[_0x4f20('0x4')];function _0x47884a(_0x39bf2f,_0x52bfd5){return new Promise(function(_0x105f71,_0xd194f1){if(!_0x52bfd5)return _0x105f71(null);var _0x3d4cba=_0x52bfd5[_0x4f20('0x5')]?{[_0x52bfd5[_0x4f20('0x5')]['field']]:_0x52bfd5['filter'][_0x4f20('0x6')]}:undefined;return _0x18ce5d[_0x39bf2f][_0x4f20('0x7')]({'where':_0x3d4cba,'raw':!![]})['then'](function(_0x5e4bbd){_0x52bfd5[_0x4f20('0x8')]=_[_0x4f20('0x9')](_0x5e4bbd,'id');_0x105f71(_0x52bfd5);})[_0x4f20('0xa')](function(_0x3c80a6){_0xd194f1(_0x3c80a6);});});}function _0x114565(_0xa53ea0,_0xbf8f09){return new Promise(function(_0xbd9f5c,_0x32f3d1){var _0x3be8f1=_0xa53ea0[_0x4f20('0x5')]?{[_0xa53ea0[_0x4f20('0x5')]['field']]:_0xa53ea0[_0x4f20('0x5')][_0x4f20('0x6')]}:undefined;return _0x18ce5d[_0xa53ea0[_0x4f20('0xb')]][_0x4f20('0x7')]({'where':_0x3be8f1,'raw':!![]})[_0x4f20('0xc')](function(_0x32c8e2){_0xbf8f09[_0x4f20('0x8')]=_[_0x4f20('0x9')](_0x32c8e2,function(_0x22ae90){return _0x22ae90[_0x4f20('0xd')];});_0xbd9f5c(_0xbf8f09);})[_0x4f20('0xa')](function(_0x442cdb){_0x32f3d1(_0x442cdb);});});}function _0x1d6a51(_0x4afaab,_0x5ab318,_0x35561e){if(!_0x5ab318)return Promise[_0x4f20('0xe')](null);return new Promise(function(_0x53d3d7,_0x43ab22){return _0x18ce5d['UserProfileResource'][_0x4f20('0x7')]({'where':{'sectionId':_0x5ab318['id']},'raw':!![]})[_0x4f20('0xc')](function(_0x476fac){if(_0x4afaab[_0x4f20('0xf')]&&_0x4afaab[_0x4f20('0xf')]!=='id'){_0x5ab318[_0x4f20('0x8')]=_[_0x4f20('0x9')](_0x476fac,function(_0x217003){return _0x217003[_0x4afaab[_0x4f20('0xf')]];});}else{if(_0x35561e===_0x4f20('0x10')){_0x5ab318[_0x4f20('0x8')]=_[_0x4f20('0x9')](_0x476fac,function(_0x147d58){return{'id':_0x147d58[_0x4f20('0x11')],'type':_0x147d58['type']};});}else{_0x5ab318[_0x4f20('0x8')]=_[_0x4f20('0x9')](_0x476fac,function(_0x525b94){return _0x525b94[_0x4f20('0x11')];});}}_0x53d3d7(_0x5ab318);})[_0x4f20('0xa')](function(_0x59c6e4){_0x43ab22(_0x59c6e4);});});}function _0x581d10(_0x413061,_0x1ed010){var _0x5007f0={'parentSections':[]};switch(_0x413061['toLowerCase']()){case _0x4f20('0x12'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x14');break;case'odbc':_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x15');break;case _0x4f20('0x16'):_0x5007f0[_0x4f20('0x13')]='SquareRecording';_0x5007f0['parentSections']=[{'name':'SquareProjects','field':'name','foreignKey':_0x4f20('0x17')}];break;case _0x4f20('0x18'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x19');break;case _0x4f20('0x1a'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x1b');_0x5007f0[_0x4f20('0x1c')]=[{'name':'Lists','field':'id','foreignKey':_0x4f20('0x1d')}];break;case'lists':_0x5007f0['childModel']=_0x4f20('0x1e');break;case _0x4f20('0x1f'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x20');break;case'globalcustomfields':_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x21');break;case _0x4f20('0x22'):_0x5007f0[_0x4f20('0x13')]='ChatQueue';break;case _0x4f20('0x23'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x24');break;case _0x4f20('0x25'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x26');break;case'faxaccounts':_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x27');break;case _0x4f20('0x28'):case _0x4f20('0x29'):case'outboundroutes':_0x5007f0['childModel']=_0x4f20('0x2a');break;case _0x4f20('0x2b'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x2c');break;case _0x4f20('0x2d'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x2e');break;case'voicerecordings':_0x5007f0['childModel']=_0x4f20('0x2f');_0x5007f0['parentSections']=[{'name':_0x4f20('0x30'),'field':_0x4f20('0xd'),'foreignKey':_0x4f20('0x31'),'model':_0x4f20('0x32'),'filter':{'field':_0x4f20('0x33'),'value':['agent']}},{'name':_0x4f20('0x34'),'field':_0x4f20('0xd'),'foreignKey':'membername','model':_0x4f20('0x32'),'filter':{'field':_0x4f20('0x33'),'value':['telephone']}},{'name':_0x4f20('0x35'),'field':_0x4f20('0xd'),'foreignKey':_0x4f20('0x36'),'model':_0x4f20('0x37'),'filter':{'field':_0x4f20('0x38'),'value':[_0x4f20('0x39')]}},{'name':_0x4f20('0x3a'),'field':_0x4f20('0xd'),'foreignKey':_0x4f20('0x36'),'model':_0x4f20('0x37'),'filter':{'field':_0x4f20('0x38'),'value':[_0x4f20('0x3b')]}}];break;case _0x4f20('0x3c'):_0x5007f0['childModel']=_0x4f20('0x3d');break;case _0x4f20('0x3e'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x3f');break;case _0x4f20('0x40'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x41');break;case _0x4f20('0x42'):_0x5007f0[_0x4f20('0x13')]='Campaign';break;case _0x4f20('0x43'):_0x5007f0[_0x4f20('0x13')]='MailQueue';break;case _0x4f20('0x44'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x45');break;case _0x4f20('0x46'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x47');break;case'openchannelqueues':_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x48');break;case _0x4f20('0x49'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x4a');break;case _0x4f20('0x4b'):_0x5007f0[_0x4f20('0x13')]='SmsQueue';break;case'smsaccounts':_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x4c');break;case _0x4f20('0x4d'):_0x5007f0['childModel']=_0x4f20('0x4e');break;case _0x4f20('0x4f'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x50');break;case'teams':_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x51');break;case _0x4f20('0x52'):case _0x4f20('0x53'):_0x5007f0['childModel']='VoiceQueue';if(_0x1ed010){_0x5007f0[_0x4f20('0x1c')]=[{'name':'VoiceQueues'},{'name':_0x4f20('0x3a')}];}break;case _0x4f20('0x54'):case _0x4f20('0x55'):case'telephones':_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x32');if(_0x1ed010){_0x5007f0[_0x4f20('0x1c')]=[{'name':_0x4f20('0x56'),'filter':{'field':'role','value':[_0x4f20('0x57'),_0x4f20('0x58')]},'ignore':!![]},{'name':_0x4f20('0x30')},{'name':_0x4f20('0x34')}];}break;case _0x4f20('0x59'):_0x5007f0[_0x4f20('0x13')]='ZendeskAccount';break;case _0x4f20('0x5a'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x5b');break;case _0x4f20('0x5c'):_0x5007f0['childModel']=_0x4f20('0x5d');break;case _0x4f20('0x5e'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x5f');break;case'deskaccounts':_0x5007f0[_0x4f20('0x13')]='DeskAccount';break;case'zohoaccounts':_0x5007f0[_0x4f20('0x13')]='ZohoAccount';break;case _0x4f20('0x60'):_0x5007f0[_0x4f20('0x13')]='User';break;case _0x4f20('0x61'):_0x5007f0['childModel']=_0x4f20('0x62');break;case _0x4f20('0x63'):_0x5007f0['childModel']=_0x4f20('0x64');break;case _0x4f20('0x65'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x66');break;case _0x4f20('0x67'):_0x5007f0[_0x4f20('0x13')]='Interval';break;case _0x4f20('0x68'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x69');break;case _0x4f20('0x6a'):_0x5007f0[_0x4f20('0x13')]='Schedule';break;case _0x4f20('0x6b'):_0x5007f0[_0x4f20('0x13')]='Sound';break;case _0x4f20('0x6c'):_0x5007f0['childModel']='Tag';break;case _0x4f20('0x6d'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x6e');break;case'triggers':_0x5007f0['childModel']=_0x4f20('0x6f');break;case _0x4f20('0x70'):_0x5007f0['childModel']=_0x4f20('0x71');break;case _0x4f20('0x72'):_0x5007f0['childModel']=_0x4f20('0x73');break;case _0x4f20('0x74'):_0x5007f0[_0x4f20('0x13')]='Plugin';break;case _0x4f20('0x75'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x10');_0x5007f0[_0x4f20('0x1c')]=[{'name':_0x4f20('0x76'),'field':'id','foreignKey':_0x4f20('0x77')}];break;case _0x4f20('0x78'):_0x5007f0[_0x4f20('0x13')]=_0x4f20('0x79');break;}return _0x5007f0;}function _0x355317(_0x52733a,_0x1d7332){var _0x2cf0e8=_0x52733a[_0x4f20('0x7a')](0x0)[_0x4f20('0x7b')]()+_0x52733a['slice'](0x1);var _0x4813c5={'type':_0x18ce5d[_0x4f20('0x7c')][_0x4f20('0x7d')][_0x4f20('0x7e')],'raw':!![]};return new Promise(function(_0x4e97b1,_0x360245){var _0xca560d=squel['select']()[_0x4f20('0xf')]('ui.'+_0x2cf0e8+_0x4f20('0x7f'),'id')['field']('ui.createdAt')[_0x4f20('0x80')](_0x4f20('0x81')+_0x52733a+_0x4f20('0x82'),'ui')['where'](_0x4f20('0x83'),_0x1d7332['id']);return _0x18ce5d['sequelize'][_0x4f20('0x84')](_0xca560d[_0x4f20('0x85')](),_0x4813c5)['then'](function(_0x3e298f){_0x1d7332[_0x2cf0e8+_0x4f20('0x86')]=_0x3e298f;_0x4e97b1(_0x3e298f);})[_0x4f20('0xa')](function(_0x305223){_0x360245(_0x305223);});});}return _0x4cd6e8[_0x4f20('0x87')](_0x4f20('0x88'),attributes,{'tableName':_0x4f20('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x109002){var _0x29c73e={'raw':_0x109002[_0x4f20('0x84')][_0x4f20('0x8a')],'where':{}};var _0x49612b={};var _0xe37687={'count':0x0,'rows':[]};var _0x273303=_0x109002[_0x4f20('0x84')][_0x4f20('0x8b')];var _0x455301=_0x109002[_0x4f20('0x84')][_0x4f20('0x8c')]||![];var _0x5bb2ae=_0x581d10(_0x273303,_0x455301);if(!_0x5bb2ae[_0x4f20('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x273303+'\x27');var _0x490503=[{'name':_0x273303}];if(!_[_0x4f20('0x8d')](_0x5bb2ae[_0x4f20('0x1c')]))_0x490503=_0x5bb2ae['parentSections'];var _0x4a8f85=[];for(var _0x35b826=0x0;_0x35b826<_0x490503[_0x4f20('0x8e')];_0x35b826++){_0x4a8f85[_0x4f20('0x8f')](_0x18ce5d['UserProfileSection'][_0x4f20('0x90')]({'where':{'userProfileId':_0x109002[_0x4f20('0x91')]['id'],'name':_0x490503[_0x35b826][_0x4f20('0xd')]},'raw':!![]}));}return Promise[_0x4f20('0x92')](_0x4a8f85)[_0x4f20('0xc')](function(_0x247a3c){var _0x7d8e2b=_[_0x4f20('0x5')](_0x247a3c,function(_0x699f92){return _0x699f92?_0x699f92:undefined;});var _0x1b692c=_[_0x4f20('0x5')](_0x490503,['ignore',!![]]);var _0x2a7d45=_['isEmpty'](_0x7d8e2b)&&_[_0x4f20('0x8d')](_0x1b692c)?null:_['union'](_0x1b692c,_0x7d8e2b);if(!_0x2a7d45)return null;var _0x1d0cee=[];for(var _0x333baa=0x0;_0x333baa<_0x2a7d45[_0x4f20('0x8e')];_0x333baa++){var _0x5530de=_[_0x4f20('0x90')](_0x490503,function(_0x301fed){return _0x2a7d45[_0x333baa]?_0x301fed[_0x4f20('0xd')]===_0x2a7d45[_0x333baa][_0x4f20('0xd')]:null;});if(_0x5530de){if(_0x2a7d45[_0x333baa]['ignore']){_0x1d0cee[_0x4f20('0x8f')](_0x47884a(_0x5bb2ae[_0x4f20('0x13')],_0x2a7d45[_0x333baa]));}else{if(!_0x2a7d45[_0x333baa]['autoAssociation']){_0x1d0cee[_0x4f20('0x8f')](_0x1d6a51(_0x5530de,_0x2a7d45[_0x333baa],_0x5bb2ae[_0x4f20('0x13')]));}else{if(_0x5530de[_0x4f20('0xb')]){_0x1d0cee['push'](_0x114565(_0x5530de,_0x2a7d45[_0x333baa]));}}}}}return Promise['all'](_0x1d0cee);})[_0x4f20('0xc')](function(_0x3a6acf){var _0x48585e=_0x3a6acf;var _0x2b6702=null;if(_0x48585e){_0x2b6702=_0x48585e['length']===0x1?_0x48585e[0x0]:null;}if(!_0x2b6702&&!_0x48585e)return _0xe37687;var _0x5d4fa0=_0x18ce5d[_0x5bb2ae[_0x4f20('0x13')]][_0x4f20('0x93')];_0x49612b[_0x4f20('0xb')]=_[_0x4f20('0x94')](_0x5d4fa0);_0x49612b[_0x4f20('0x84')]=_[_0x4f20('0x94')](_0x109002[_0x4f20('0x84')]);_0x49612b[_0x4f20('0x95')]=_[_0x4f20('0x96')](_0x49612b[_0x4f20('0xb')],_0x49612b[_0x4f20('0x84')]);_0x29c73e[_0x4f20('0x97')]=_[_0x4f20('0x96')](_0x49612b[_0x4f20('0xb')],qs['fields'](_0x109002[_0x4f20('0x84')][_0x4f20('0x98')]));_0x29c73e[_0x4f20('0x97')]=_0x29c73e[_0x4f20('0x97')]['length']?_0x29c73e[_0x4f20('0x97')]:_0x49612b['model'];if(!_0x109002[_0x4f20('0x84')][_0x4f20('0x99')](_0x4f20('0x9a'))){_0x29c73e[_0x4f20('0x9b')]=qs[_0x4f20('0x9b')](_0x109002['query']['limit']);_0x29c73e[_0x4f20('0x9c')]=qs['offset'](_0x109002[_0x4f20('0x84')][_0x4f20('0x9c')]);}_0x29c73e[_0x4f20('0x9d')]=qs['sort'](_0x109002[_0x4f20('0x84')][_0x4f20('0x9e')]);_0x29c73e[_0x4f20('0x9f')]=qs[_0x4f20('0x95')](_['pick'](_0x109002['query'],_0x49612b[_0x4f20('0x95')]));if(_0x109002[_0x4f20('0x84')][_0x4f20('0x5')]){_0x29c73e[_0x4f20('0x9f')]=_[_0x4f20('0xa0')](_0x29c73e[_0x4f20('0x9f')],{'$or':_[_0x4f20('0x9')](_0x5d4fa0,function(_0x47bb40){if(_0x47bb40[_0x4f20('0x38')][_0x4f20('0xa1')]!==_0x4f20('0xa2')){var _0x3af524={};_0x3af524[_0x47bb40[_0x4f20('0xf')]]={'$like':'%'+_0x109002[_0x4f20('0x84')][_0x4f20('0x5')]+'%'};return _0x3af524;}})});}var _0x39378e=[];var _0xeab906=null;var _0x4816ca={};if(_0x2b6702){_0xeab906=_[_0x4f20('0x90')](_0x490503,[_0x4f20('0xd'),_0x2b6702[_0x4f20('0xd')]]);if(_0xeab906['field']){_0x4816ca={};if(_0x5bb2ae[_0x4f20('0x13')]==='AnalyticExtractedReport'){_0x4816ca[_0xeab906[_0x4f20('0xa3')]]=_[_0x4f20('0x9')](_0x2b6702['associatedResources'],'id');}else{_0x4816ca[_0xeab906[_0x4f20('0xa3')]]=_0x2b6702[_0x4f20('0x8')];}_0x39378e[_0x4f20('0x8f')](_0x4816ca);}else{_0x29c73e[_0x4f20('0x9f')]['id']=_0x2b6702[_0x4f20('0x8')];}}else{for(var _0x38ef86=0x0;_0x38ef86<_0x48585e[_0x4f20('0x8e')];_0x38ef86++){_0xeab906=_[_0x4f20('0x90')](_0x490503,[_0x4f20('0xd'),_0x48585e[_0x38ef86][_0x4f20('0xd')]]);if(_0xeab906[_0x4f20('0xf')]){_0x4816ca={};_0x4816ca[_0xeab906[_0x4f20('0xa3')]]=_0x48585e[_0x38ef86]['associatedResources'];_0x39378e['push'](_0x4816ca);}else{if(!_0x29c73e[_0x4f20('0x9f')]['id'])_0x29c73e[_0x4f20('0x9f')]['id']=[];_0x48585e[_0x38ef86][_0x4f20('0x8')][_0x4f20('0xa4')](function(_0x3da86c){_0x29c73e['where']['id'][_0x4f20('0x8f')](_0x3da86c);});}}}if(!_[_0x4f20('0x8d')](_0x39378e)){_0x29c73e['where']=_['merge'](_0x29c73e['where'],{'$and':{'$or':_0x39378e}});}_0x29c73e=_['merge']({},_0x29c73e,_0x109002[_0x4f20('0xa5')]);if(_0x2b6702&&!_0x2b6702[_0x4f20('0xa6')]&&_0x5bb2ae[_0x4f20('0x13')]===_0x4f20('0x10')){if(_0x109002['query'][_0x4f20('0xa7')]){_0x29c73e[_0x4f20('0xa8')]=[{'all':!![]}];}return _0x18ce5d[_0x5bb2ae[_0x4f20('0x13')]]['findAll'](_0x29c73e)[_0x4f20('0xc')](function(_0x45739e){var _0x329f1a=[];_0x45739e['forEach'](function(_0x5d3f1d){var _0x2dccf2;switch(_0x5d3f1d[_0x4f20('0xa9')]){case _0x4f20('0xaa'):_0x2dccf2=_[_0x4f20('0x90')](_0x2b6702[_0x4f20('0x8')],function(_0x494ee8){return _0x494ee8['id']===_0x5d3f1d[_0x4f20('0x77')]&&_0x494ee8[_0x4f20('0x38')]==='DefaultReports';});break;case _0x4f20('0xab'):_0x2dccf2=_['find'](_0x2b6702[_0x4f20('0x8')],function(_0x28c85e){return _0x28c85e['id']===_0x5d3f1d[_0x4f20('0x77')]&&_0x28c85e[_0x4f20('0x38')]===_0x4f20('0xac');});break;}if(_0x2dccf2)_0x329f1a['push'](_0x5d3f1d);});_0xe37687[_0x4f20('0xad')]=_0x329f1a[_0x4f20('0x8e')];_0xe37687[_0x4f20('0xae')]=_0x329f1a;return _0xe37687;});}else{if(!_['isEmpty'](_0x109002[_0x4f20('0x84')]['ids'])){_0x29c73e[_0x4f20('0x9f')]['id']=_0x29c73e['where']['id']?_['intersection'](_0x29c73e[_0x4f20('0x9f')]['id'],_0x109002['query'][_0x4f20('0xaf')]):_0x109002['query'][_0x4f20('0xaf')];if(_0x109002[_0x4f20('0x84')][_0x4f20('0xb0')]){_0x29c73e[_0x4f20('0x9d')]=_0x109002[_0x4f20('0x84')]['customSorting'];}}if(_0x109002['query'][_0x4f20('0xb1')]){_0x29c73e[_0x4f20('0x9f')]=_['merge'](_0x29c73e['where'],{'$and':_0x109002[_0x4f20('0x84')][_0x4f20('0xb1')]});}return _0x18ce5d[_0x5bb2ae['childModel']]['count']({'where':_0x29c73e[_0x4f20('0x9f')]})['then'](function(_0x2ecac0){_0xe37687[_0x4f20('0xad')]=_0x2ecac0;if(_0x109002[_0x4f20('0x84')][_0x4f20('0xa7')]){if(_0x5bb2ae[_0x4f20('0x13')]===_0x4f20('0x1b')){_0x29c73e[_0x4f20('0xa8')]=[{'model':_0x18ce5d[_0x4f20('0xb2')],'as':_0x4f20('0xb3'),'attributes':['id',_0x4f20('0xd'),_0x4f20('0xb4')],'required':_0x109002[_0x4f20('0x84')][_0x4f20('0xb5')]?!![]:![]},{'model':_0x18ce5d[_0x4f20('0xb2')],'as':_0x4f20('0xb6'),'attributes':['id','name','color'],'through':_0x109002['query'][_0x4f20('0xb5')]?{'attributes':[],'where':{'TagId':_0x109002[_0x4f20('0x84')][_0x4f20('0xb5')]||undefined}}:{},'required':_0x109002[_0x4f20('0x84')]['tag']?!![]:![]}];}else{_0x29c73e[_0x4f20('0xa8')]=[{'all':!![]}];}}return _0x18ce5d[_0x5bb2ae[_0x4f20('0x13')]][_0x4f20('0x7')](_0x29c73e);})[_0x4f20('0xc')](function(_0x15a287){_0xe37687[_0x4f20('0xae')]=_0x15a287;if(_0x273303===_0x4f20('0x30')&&_0x109002[_0x4f20('0x84')][_0x4f20('0xb7')]===_0x4f20('0xb8')){var _0x2f8df3=[];for(var _0x23e59f=0x0;_0x23e59f<_0xe37687[_0x4f20('0xae')][_0x4f20('0x8e')];_0x23e59f++){_0x2f8df3[_0x4f20('0x8f')](_0x355317(_0x4f20('0xb9'),_0xe37687[_0x4f20('0xae')][_0x23e59f]['dataValues']));_0x2f8df3[_0x4f20('0x8f')](_0x355317('sms',_0xe37687[_0x4f20('0xae')][_0x23e59f]['dataValues']));_0x2f8df3['push'](_0x355317(_0x4f20('0xba'),_0xe37687[_0x4f20('0xae')][_0x23e59f][_0x4f20('0xbb')]));_0x2f8df3[_0x4f20('0x8f')](_0x355317(_0x4f20('0xbc'),_0xe37687[_0x4f20('0xae')][_0x23e59f][_0x4f20('0xbb')]));_0x2f8df3[_0x4f20('0x8f')](_0x355317('openchannel',_0xe37687[_0x4f20('0xae')][_0x23e59f][_0x4f20('0xbb')]));_0x2f8df3[_0x4f20('0x8f')](_0x355317(_0x4f20('0xbd'),_0xe37687[_0x4f20('0xae')][_0x23e59f][_0x4f20('0xbb')]));}return Promise[_0x4f20('0x92')](_0x2f8df3)[_0x4f20('0xc')](function(){return _0xe37687;});}return _0xe37687;});}});}}});}; \ No newline at end of file +var _0x0617=['childModel','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','JscriptyProject','contacts','CmContact','ListId','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','role','agent','Telephones','membername','User','telephone','queue','VoiceQueue','type','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','users','agents','telephones','Users','user','zendeskaccounts','salesforceaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Template','triggers','trunks','Trunk','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','UserProfile','user_profiles','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','keys','filters','intersection','fields','attributes','nolimit','limit','offset','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','count','rows','ids','customSorting','order','extraQueryConditions','Tag','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','filter','findAll','then','map','catch','field','value','model','associatedResources','name','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects'];(function(_0x22423d,_0x1188f3){var _0x3ad626=function(_0xb472d2){while(--_0xb472d2){_0x22423d['push'](_0x22423d['shift']());}};_0x3ad626(++_0x1188f3);}(_0x0617,0x16d));var _0x7061=function(_0x4930ee,_0x442983){_0x4930ee=_0x4930ee-0x0;var _0x24f2b3=_0x0617[_0x4930ee];return _0x24f2b3;};'use strict';var _=require(_0x7061('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x7061('0x1'));var squel=require(_0x7061('0x2'));module[_0x7061('0x3')]=function(_0xf8e90a){var _0x1fc255=_0xf8e90a['models'];function _0x35c155(_0x4c512a,_0x1eb5a4){return new Promise(function(_0x1473f3,_0x3844fa){if(!_0x1eb5a4)return _0x1473f3(null);var _0x205a4a=_0x1eb5a4[_0x7061('0x4')]?{[_0x1eb5a4['filter']['field']]:_0x1eb5a4[_0x7061('0x4')]['value']}:undefined;return _0x1fc255[_0x4c512a][_0x7061('0x5')]({'where':_0x205a4a,'raw':!![]})[_0x7061('0x6')](function(_0x5d273f){_0x1eb5a4['associatedResources']=_[_0x7061('0x7')](_0x5d273f,'id');_0x1473f3(_0x1eb5a4);})[_0x7061('0x8')](function(_0x1bd97c){_0x3844fa(_0x1bd97c);});});}function _0xedb4a8(_0x215a95,_0x50721f){return new Promise(function(_0x218ddd,_0x275992){var _0xfab499=_0x215a95[_0x7061('0x4')]?{[_0x215a95['filter'][_0x7061('0x9')]]:_0x215a95[_0x7061('0x4')][_0x7061('0xa')]}:undefined;return _0x1fc255[_0x215a95[_0x7061('0xb')]][_0x7061('0x5')]({'where':_0xfab499,'raw':!![]})[_0x7061('0x6')](function(_0x46b254){_0x50721f[_0x7061('0xc')]=_[_0x7061('0x7')](_0x46b254,function(_0x423c4e){return _0x423c4e[_0x7061('0xd')];});_0x218ddd(_0x50721f);})['catch'](function(_0x5c0fdf){_0x275992(_0x5c0fdf);});});}function _0x4fe5a2(_0x489a4f,_0x2cdd14,_0x2e4c6f){if(!_0x2cdd14)return Promise['resolve'](null);return new Promise(function(_0x56878d,_0x2ef4c2){return _0x1fc255[_0x7061('0xe')][_0x7061('0x5')]({'where':{'sectionId':_0x2cdd14['id']},'raw':!![]})['then'](function(_0x1ee93b){if(_0x489a4f['field']&&_0x489a4f[_0x7061('0x9')]!=='id'){_0x2cdd14[_0x7061('0xc')]=_[_0x7061('0x7')](_0x1ee93b,function(_0x5d9223){return _0x5d9223[_0x489a4f[_0x7061('0x9')]];});}else{if(_0x2e4c6f===_0x7061('0xf')){_0x2cdd14[_0x7061('0xc')]=_[_0x7061('0x7')](_0x1ee93b,function(_0x4cec44){return{'id':_0x4cec44[_0x7061('0x10')],'type':_0x4cec44['type']};});}else{_0x2cdd14[_0x7061('0xc')]=_['map'](_0x1ee93b,function(_0x537ff9){return _0x537ff9['resourceId'];});}}_0x56878d(_0x2cdd14);})[_0x7061('0x8')](function(_0x4780f4){_0x2ef4c2(_0x4780f4);});});}function _0x39dd99(_0x13f2e8,_0x1b307d){var _0x14fed3={'parentSections':[]};switch(_0x13f2e8[_0x7061('0x11')]()){case _0x7061('0x12'):_0x14fed3[_0x7061('0x13')]='SquareProject';break;case _0x7061('0x14'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x15');break;case'squarerecordings':_0x14fed3['childModel']=_0x7061('0x16');_0x14fed3[_0x7061('0x17')]=[{'name':_0x7061('0x18'),'field':_0x7061('0xd'),'foreignKey':'projectName'}];break;case'projects':_0x14fed3[_0x7061('0x13')]=_0x7061('0x19');break;case _0x7061('0x1a'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x1b');_0x14fed3[_0x7061('0x17')]=[{'name':'Lists','field':'id','foreignKey':_0x7061('0x1c')}];break;case'lists':_0x14fed3[_0x7061('0x13')]=_0x7061('0x1d');break;case _0x7061('0x1e'):_0x14fed3[_0x7061('0x13')]='CmCompany';break;case _0x7061('0x1f'):_0x14fed3['childModel']=_0x7061('0x20');break;case _0x7061('0x21'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x22');break;case _0x7061('0x23'):_0x14fed3[_0x7061('0x13')]='ChatWebsite';break;case _0x7061('0x24'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x25');break;case _0x7061('0x26'):_0x14fed3['childModel']=_0x7061('0x27');break;case _0x7061('0x28'):case _0x7061('0x29'):case _0x7061('0x2a'):_0x14fed3[_0x7061('0x13')]='VoiceExtension';break;case _0x7061('0x2b'):_0x14fed3['childModel']=_0x7061('0x2c');break;case _0x7061('0x2d'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x2e');break;case _0x7061('0x2f'):_0x14fed3[_0x7061('0x13')]='VoiceRecording';_0x14fed3[_0x7061('0x17')]=[{'name':_0x7061('0x30'),'field':_0x7061('0xd'),'foreignKey':'membername','model':'User','filter':{'field':_0x7061('0x31'),'value':[_0x7061('0x32')]}},{'name':_0x7061('0x33'),'field':_0x7061('0xd'),'foreignKey':_0x7061('0x34'),'model':_0x7061('0x35'),'filter':{'field':'role','value':[_0x7061('0x36')]}},{'name':'VoiceQueues','field':_0x7061('0xd'),'foreignKey':_0x7061('0x37'),'model':_0x7061('0x38'),'filter':{'field':_0x7061('0x39'),'value':[_0x7061('0x3a')]}},{'name':'QueueCampaigns','field':_0x7061('0xd'),'foreignKey':_0x7061('0x37'),'model':_0x7061('0x38'),'filter':{'field':_0x7061('0x39'),'value':[_0x7061('0x3b')]}}];break;case _0x7061('0x3c'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x3d');break;case _0x7061('0x3e'):_0x14fed3[_0x7061('0x13')]='VoiceChanSpy';break;case _0x7061('0x3f'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x40');break;case _0x7061('0x41'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x42');break;case _0x7061('0x43'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x44');break;case _0x7061('0x45'):_0x14fed3[_0x7061('0x13')]='MailAccount';break;case'mailsubstatuses':_0x14fed3[_0x7061('0x13')]=_0x7061('0x46');break;case _0x7061('0x47'):_0x14fed3[_0x7061('0x13')]='OpenchannelQueue';break;case _0x7061('0x48'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x49');break;case _0x7061('0x4a'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x4b');break;case'smsaccounts':_0x14fed3[_0x7061('0x13')]='SmsAccount';break;case'whatsappqueues':_0x14fed3[_0x7061('0x13')]='WhatsappQueue';break;case _0x7061('0x4c'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x4d');break;case _0x7061('0x4e'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x4f');break;case _0x7061('0x50'):case _0x7061('0x51'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x38');if(_0x1b307d){_0x14fed3[_0x7061('0x17')]=[{'name':_0x7061('0x52')},{'name':'QueueCampaigns'}];}break;case _0x7061('0x53'):case _0x7061('0x54'):case _0x7061('0x55'):_0x14fed3['childModel']=_0x7061('0x35');if(_0x1b307d){_0x14fed3[_0x7061('0x17')]=[{'name':_0x7061('0x56'),'filter':{'field':_0x7061('0x31'),'value':['admin',_0x7061('0x57')]},'ignore':!![]},{'name':_0x7061('0x30')},{'name':'Telephones'}];}break;case _0x7061('0x58'):_0x14fed3[_0x7061('0x13')]='ZendeskAccount';break;case _0x7061('0x59'):_0x14fed3['childModel']='SalesforceAccount';break;case'freshdeskaccounts':_0x14fed3[_0x7061('0x13')]='FreshdeskAccount';break;case _0x7061('0x5a'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x5b');break;case _0x7061('0x5c'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x5d');break;case _0x7061('0x5e'):_0x14fed3['childModel']='ZohoAccount';break;case _0x7061('0x5f'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x35');break;case _0x7061('0x60'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x61');break;case _0x7061('0x62'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x63');break;case _0x7061('0x64'):_0x14fed3['childModel']=_0x7061('0x65');break;case _0x7061('0x66'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x67');break;case _0x7061('0x68'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x69');break;case'scheduler':_0x14fed3[_0x7061('0x13')]=_0x7061('0x6a');break;case _0x7061('0x6b'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x6c');break;case _0x7061('0x6d'):_0x14fed3[_0x7061('0x13')]='Tag';break;case'templates':_0x14fed3['childModel']=_0x7061('0x6e');break;case _0x7061('0x6f'):_0x14fed3[_0x7061('0x13')]='Trigger';break;case _0x7061('0x70'):_0x14fed3['childModel']=_0x7061('0x71');break;case'variables':_0x14fed3[_0x7061('0x13')]=_0x7061('0x72');break;case'plugins':_0x14fed3[_0x7061('0x13')]=_0x7061('0x73');break;case _0x7061('0x74'):_0x14fed3[_0x7061('0x13')]=_0x7061('0xf');_0x14fed3[_0x7061('0x17')]=[{'name':_0x7061('0x75'),'field':'id','foreignKey':_0x7061('0x76')}];break;case _0x7061('0x77'):_0x14fed3[_0x7061('0x13')]=_0x7061('0x78');break;}return _0x14fed3;}function _0x1bcd2d(_0x3d7e4b,_0x46177f){var _0x5521ab=_0x3d7e4b[_0x7061('0x79')](0x0)[_0x7061('0x7a')]()+_0x3d7e4b[_0x7061('0x7b')](0x1);var _0x1095ad={'type':_0x1fc255[_0x7061('0x7c')][_0x7061('0x7d')][_0x7061('0x7e')],'raw':!![]};return new Promise(function(_0x4753d9,_0x4fdd91){var _0x5cb634=squel[_0x7061('0x7f')]()[_0x7061('0x9')](_0x7061('0x80')+_0x5521ab+_0x7061('0x81'),'id')[_0x7061('0x9')](_0x7061('0x82'))[_0x7061('0x83')](_0x7061('0x84')+_0x3d7e4b+_0x7061('0x85'),'ui')[_0x7061('0x86')](_0x7061('0x87'),_0x46177f['id']);return _0x1fc255[_0x7061('0x88')][_0x7061('0x89')](_0x5cb634['toString'](),_0x1095ad)[_0x7061('0x6')](function(_0x4db535){_0x46177f[_0x5521ab+'OpenTabs']=_0x4db535;_0x4753d9(_0x4db535);})['catch'](function(_0x5b0ca8){_0x4fdd91(_0x5b0ca8);});});}return _0xf8e90a['define'](_0x7061('0x8a'),attributes,{'tableName':_0x7061('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x28fea9){var _0x2c62cd={'raw':_0x28fea9['query'][_0x7061('0x8c')],'where':{}};var _0x40ee5e={};var _0x2e87ca={'count':0x0,'rows':[]};var _0x1a7da2=_0x28fea9[_0x7061('0x89')]['section'];var _0x515513=_0x28fea9['query'][_0x7061('0x8d')]||![];var _0x34b2ba=_0x39dd99(_0x1a7da2,_0x515513);if(!_0x34b2ba[_0x7061('0x13')])throw new Error(_0x7061('0x8e')+_0x1a7da2+'\x27');var _0x155b65=[{'name':_0x1a7da2}];if(!_[_0x7061('0x8f')](_0x34b2ba['parentSections']))_0x155b65=_0x34b2ba['parentSections'];var _0x52587d=[];for(var _0x4ab193=0x0;_0x4ab193<_0x155b65[_0x7061('0x90')];_0x4ab193++){_0x52587d[_0x7061('0x91')](_0x1fc255[_0x7061('0x92')][_0x7061('0x93')]({'where':{'userProfileId':_0x28fea9[_0x7061('0x94')]['id'],'name':_0x155b65[_0x4ab193]['name']},'raw':!![]}));}return Promise[_0x7061('0x95')](_0x52587d)[_0x7061('0x6')](function(_0x30ea26){var _0x2f49f7=_['filter'](_0x30ea26,function(_0xf4301d){return _0xf4301d?_0xf4301d:undefined;});var _0x481743=_['filter'](_0x155b65,[_0x7061('0x96'),!![]]);var _0x5a2c9e=_[_0x7061('0x8f')](_0x2f49f7)&&_['isEmpty'](_0x481743)?null:_[_0x7061('0x97')](_0x481743,_0x2f49f7);if(!_0x5a2c9e)return null;var _0x2fe5ac=[];for(var _0x29a31b=0x0;_0x29a31b<_0x5a2c9e[_0x7061('0x90')];_0x29a31b++){var _0x5a05b3=_['find'](_0x155b65,function(_0x5fce6a){return _0x5a2c9e[_0x29a31b]?_0x5fce6a[_0x7061('0xd')]===_0x5a2c9e[_0x29a31b][_0x7061('0xd')]:null;});if(_0x5a05b3){if(_0x5a2c9e[_0x29a31b]['ignore']){_0x2fe5ac['push'](_0x35c155(_0x34b2ba[_0x7061('0x13')],_0x5a2c9e[_0x29a31b]));}else{if(!_0x5a2c9e[_0x29a31b][_0x7061('0x98')]){_0x2fe5ac[_0x7061('0x91')](_0x4fe5a2(_0x5a05b3,_0x5a2c9e[_0x29a31b],_0x34b2ba[_0x7061('0x13')]));}else{if(_0x5a05b3[_0x7061('0xb')]){_0x2fe5ac[_0x7061('0x91')](_0xedb4a8(_0x5a05b3,_0x5a2c9e[_0x29a31b]));}}}}}return Promise['all'](_0x2fe5ac);})[_0x7061('0x6')](function(_0xd0838){var _0x45a412=_0xd0838;var _0x57509e=null;if(_0x45a412){_0x57509e=_0x45a412['length']===0x1?_0x45a412[0x0]:null;}if(!_0x57509e&&!_0x45a412)return _0x2e87ca;var _0x5ed10b=_0x1fc255[_0x34b2ba[_0x7061('0x13')]]['rawAttributes'];_0x40ee5e['model']=_[_0x7061('0x99')](_0x5ed10b);_0x40ee5e[_0x7061('0x89')]=_[_0x7061('0x99')](_0x28fea9[_0x7061('0x89')]);_0x40ee5e[_0x7061('0x9a')]=_[_0x7061('0x9b')](_0x40ee5e[_0x7061('0xb')],_0x40ee5e[_0x7061('0x89')]);_0x2c62cd['attributes']=_['intersection'](_0x40ee5e[_0x7061('0xb')],qs[_0x7061('0x9c')](_0x28fea9[_0x7061('0x89')]['fields']));_0x2c62cd[_0x7061('0x9d')]=_0x2c62cd[_0x7061('0x9d')][_0x7061('0x90')]?_0x2c62cd['attributes']:_0x40ee5e['model'];if(!_0x28fea9['query']['hasOwnProperty'](_0x7061('0x9e'))){_0x2c62cd[_0x7061('0x9f')]=qs[_0x7061('0x9f')](_0x28fea9[_0x7061('0x89')][_0x7061('0x9f')]);_0x2c62cd[_0x7061('0xa0')]=qs['offset'](_0x28fea9['query']['offset']);}_0x2c62cd['order']=qs[_0x7061('0xa1')](_0x28fea9[_0x7061('0x89')][_0x7061('0xa1')]);_0x2c62cd[_0x7061('0x86')]=qs[_0x7061('0x9a')](_['pick'](_0x28fea9['query'],_0x40ee5e['filters']));if(_0x28fea9[_0x7061('0x89')][_0x7061('0x4')]){_0x2c62cd[_0x7061('0x86')]=_[_0x7061('0xa2')](_0x2c62cd[_0x7061('0x86')],{'$or':_[_0x7061('0x7')](_0x5ed10b,function(_0x2c9404){if(_0x2c9404['type'][_0x7061('0xa3')]!==_0x7061('0xa4')){var _0x2b9938={};_0x2b9938[_0x2c9404[_0x7061('0x9')]]={'$like':'%'+_0x28fea9[_0x7061('0x89')][_0x7061('0x4')]+'%'};return _0x2b9938;}})});}var _0x4e2e83=[];var _0x16d722=null;var _0x19e2b2={};if(_0x57509e){_0x16d722=_[_0x7061('0x93')](_0x155b65,['name',_0x57509e[_0x7061('0xd')]]);if(_0x16d722[_0x7061('0x9')]){_0x19e2b2={};if(_0x34b2ba[_0x7061('0x13')]==='AnalyticExtractedReport'){_0x19e2b2[_0x16d722[_0x7061('0xa5')]]=_['map'](_0x57509e[_0x7061('0xc')],'id');}else{_0x19e2b2[_0x16d722[_0x7061('0xa5')]]=_0x57509e[_0x7061('0xc')];}_0x4e2e83[_0x7061('0x91')](_0x19e2b2);}else{_0x2c62cd[_0x7061('0x86')]['id']=_0x57509e[_0x7061('0xc')];}}else{for(var _0x5833bf=0x0;_0x5833bf<_0x45a412[_0x7061('0x90')];_0x5833bf++){_0x16d722=_[_0x7061('0x93')](_0x155b65,[_0x7061('0xd'),_0x45a412[_0x5833bf][_0x7061('0xd')]]);if(_0x16d722[_0x7061('0x9')]){_0x19e2b2={};_0x19e2b2[_0x16d722[_0x7061('0xa5')]]=_0x45a412[_0x5833bf]['associatedResources'];_0x4e2e83[_0x7061('0x91')](_0x19e2b2);}else{if(!_0x2c62cd['where']['id'])_0x2c62cd[_0x7061('0x86')]['id']=[];_0x45a412[_0x5833bf][_0x7061('0xc')][_0x7061('0xa6')](function(_0xcb9d12){_0x2c62cd[_0x7061('0x86')]['id'][_0x7061('0x91')](_0xcb9d12);});}}}if(!_['isEmpty'](_0x4e2e83)){_0x2c62cd[_0x7061('0x86')]=_[_0x7061('0xa2')](_0x2c62cd[_0x7061('0x86')],{'$and':{'$or':_0x4e2e83}});}_0x2c62cd=_[_0x7061('0xa2')]({},_0x2c62cd,_0x28fea9[_0x7061('0xa7')]);if(_0x57509e&&!_0x57509e[_0x7061('0x98')]&&_0x34b2ba[_0x7061('0x13')]==='AnalyticExtractedReport'){if(_0x28fea9[_0x7061('0x89')][_0x7061('0xa8')]){_0x2c62cd[_0x7061('0xa9')]=[{'all':!![]}];}return _0x1fc255[_0x34b2ba[_0x7061('0x13')]][_0x7061('0x5')](_0x2c62cd)['then'](function(_0x392e7d){var _0x2f4a5d=[];_0x392e7d['forEach'](function(_0x112af2){var _0x4f8ef4;switch(_0x112af2[_0x7061('0xaa')]){case _0x7061('0xab'):_0x4f8ef4=_[_0x7061('0x93')](_0x57509e[_0x7061('0xc')],function(_0x275574){return _0x275574['id']===_0x112af2['reportId']&&_0x275574['type']===_0x7061('0xac');});break;case'custom':_0x4f8ef4=_[_0x7061('0x93')](_0x57509e[_0x7061('0xc')],function(_0x287d7f){return _0x287d7f['id']===_0x112af2[_0x7061('0x76')]&&_0x287d7f['type']==='CustomReports';});break;}if(_0x4f8ef4)_0x2f4a5d[_0x7061('0x91')](_0x112af2);});_0x2e87ca[_0x7061('0xad')]=_0x2f4a5d['length'];_0x2e87ca[_0x7061('0xae')]=_0x2f4a5d;return _0x2e87ca;});}else{if(!_[_0x7061('0x8f')](_0x28fea9['query'][_0x7061('0xaf')])){_0x2c62cd[_0x7061('0x86')]['id']=_0x2c62cd[_0x7061('0x86')]['id']?_['intersection'](_0x2c62cd[_0x7061('0x86')]['id'],_0x28fea9[_0x7061('0x89')][_0x7061('0xaf')]):_0x28fea9['query'][_0x7061('0xaf')];if(_0x28fea9['query'][_0x7061('0xb0')]){_0x2c62cd[_0x7061('0xb1')]=_0x28fea9['query']['customSorting'];}}if(_0x28fea9[_0x7061('0x89')]['extraQueryConditions']){_0x2c62cd['where']=_['merge'](_0x2c62cd[_0x7061('0x86')],{'$and':_0x28fea9['query'][_0x7061('0xb2')]});}return _0x1fc255[_0x34b2ba[_0x7061('0x13')]][_0x7061('0xad')]({'where':_0x2c62cd[_0x7061('0x86')]})[_0x7061('0x6')](function(_0x573ca8){_0x2e87ca[_0x7061('0xad')]=_0x573ca8;if(_0x28fea9[_0x7061('0x89')][_0x7061('0xa8')]){if(_0x34b2ba[_0x7061('0x13')]===_0x7061('0x1b')){_0x2c62cd['include']=[{'model':_0x1fc255[_0x7061('0xb3')],'as':_0x7061('0xb4'),'attributes':['id',_0x7061('0xd'),_0x7061('0xb5')],'required':_0x28fea9[_0x7061('0x89')][_0x7061('0xb6')]?!![]:![]},{'model':_0x1fc255[_0x7061('0xb3')],'as':_0x7061('0xb7'),'attributes':['id','name',_0x7061('0xb5')],'through':_0x28fea9['query'][_0x7061('0xb6')]?{'attributes':[],'where':{'TagId':_0x28fea9[_0x7061('0x89')][_0x7061('0xb6')]||undefined}}:{},'required':_0x28fea9[_0x7061('0x89')]['tag']?!![]:![]}];}else{_0x2c62cd['include']=[{'all':!![]}];}}return _0x1fc255[_0x34b2ba[_0x7061('0x13')]][_0x7061('0x5')](_0x2c62cd);})[_0x7061('0x6')](function(_0x2b9de7){_0x2e87ca[_0x7061('0xae')]=_0x2b9de7;if(_0x1a7da2===_0x7061('0x30')&&_0x28fea9[_0x7061('0x89')][_0x7061('0xb8')]===_0x7061('0xb9')){var _0x469976=[];for(var _0x2da69a=0x0;_0x2da69a<_0x2e87ca[_0x7061('0xae')][_0x7061('0x90')];_0x2da69a++){_0x469976[_0x7061('0x91')](_0x1bcd2d(_0x7061('0xba'),_0x2e87ca[_0x7061('0xae')][_0x2da69a][_0x7061('0xbb')]));_0x469976[_0x7061('0x91')](_0x1bcd2d(_0x7061('0xbc'),_0x2e87ca[_0x7061('0xae')][_0x2da69a]['dataValues']));_0x469976[_0x7061('0x91')](_0x1bcd2d('fax',_0x2e87ca[_0x7061('0xae')][_0x2da69a][_0x7061('0xbb')]));_0x469976[_0x7061('0x91')](_0x1bcd2d(_0x7061('0xbd'),_0x2e87ca['rows'][_0x2da69a][_0x7061('0xbb')]));_0x469976[_0x7061('0x91')](_0x1bcd2d(_0x7061('0xbe'),_0x2e87ca['rows'][_0x2da69a][_0x7061('0xbb')]));_0x469976['push'](_0x1bcd2d(_0x7061('0xbf'),_0x2e87ca[_0x7061('0xae')][_0x2da69a][_0x7061('0xbb')]));}return Promise[_0x7061('0x95')](_0x469976)[_0x7061('0x6')](function(){return _0x2e87ca;});}return _0x2e87ca;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 91b1647..f3b5500 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 _0xc43c=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x3e1b28,_0x5d4145){var _0x1cf80a=function(_0x134c8d){while(--_0x134c8d){_0x3e1b28['push'](_0x3e1b28['shift']());}};_0x1cf80a(++_0x5d4145);}(_0xc43c,0xd4));var _0xcc43=function(_0x1a8fac,_0x4c1903){_0x1a8fac=_0x1a8fac-0x0;var _0x35d812=_0xc43c[_0x1a8fac];return _0x35d812;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var moment=require(_0xcc43('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc43('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcc43('0x4'));var jayson=require(_0xcc43('0x5'));var client=jayson[_0xcc43('0x6')]['http']({'port':0x232a});config[_0xcc43('0x7')]=_[_0xcc43('0x8')](config[_0xcc43('0x7')],{'host':_0xcc43('0x9'),'port':0x18eb});var socket=require(_0xcc43('0xa'))(new Redis(config[_0xcc43('0x7')]));require(_0xcc43('0xb'))[_0xcc43('0xc')](socket);function respondWithRpcPromise(_0x4b11dc,_0x3ddc64,_0x1a825b){return new BPromise(function(_0x2656bc,_0x3bc51e){return client[_0xcc43('0xd')](_0x4b11dc,_0x1a825b)[_0xcc43('0xe')](function(_0x439c43){logger[_0xcc43('0xf')](_0xcc43('0x10'),_0x3ddc64,_0xcc43('0x11'));logger[_0xcc43('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x3ddc64,_0xcc43('0x11'),JSON[_0xcc43('0x13')](_0x439c43));if(_0x439c43[_0xcc43('0x14')]){if(_0x439c43[_0xcc43('0x14')]['code']===0x1f4){logger[_0xcc43('0x14')](_0xcc43('0x10'),_0x3ddc64,_0x439c43[_0xcc43('0x14')][_0xcc43('0x15')]);return _0x3bc51e(_0x439c43[_0xcc43('0x14')]['message']);}logger[_0xcc43('0x14')](_0xcc43('0x10'),_0x3ddc64,_0x439c43['error'][_0xcc43('0x15')]);return _0x2656bc(_0x439c43['error'][_0xcc43('0x15')]);}else{logger[_0xcc43('0xf')](_0xcc43('0x10'),_0x3ddc64,'request\x20sent');_0x2656bc(_0x439c43[_0xcc43('0x16')][_0xcc43('0x15')]);}})[_0xcc43('0x17')](function(_0x326851){logger['error'](_0xcc43('0x10'),_0x3ddc64,_0x326851);_0x3bc51e(_0x326851);});});} \ No newline at end of file +var _0x095b=['UserProfile,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','info','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x36f353,_0x1b2dee){var _0x5961eb=function(_0x47512f){while(--_0x47512f){_0x36f353['push'](_0x36f353['shift']());}};_0x5961eb(++_0x1b2dee);}(_0x095b,0x6e));var _0xb095=function(_0x530987,_0x448881){_0x530987=_0x530987-0x0;var _0x2cd406=_0x095b[_0x530987];return _0x2cd406;};'use strict';var _=require(_0xb095('0x0'));var util=require('util');var moment=require(_0xb095('0x1'));var BPromise=require(_0xb095('0x2'));var rs=require(_0xb095('0x3'));var fs=require('fs');var Redis=require(_0xb095('0x4'));var db=require(_0xb095('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb095('0x6'))(_0xb095('0x7'));var config=require(_0xb095('0x8'));var jayson=require(_0xb095('0x9'));var client=jayson[_0xb095('0xa')][_0xb095('0xb')]({'port':0x232a});config[_0xb095('0xc')]=_[_0xb095('0xd')](config[_0xb095('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb095('0xe'))(new Redis(config[_0xb095('0xc')]));require(_0xb095('0xf'))[_0xb095('0x10')](socket);function respondWithRpcPromise(_0x10efbe,_0x311c57,_0x5c3522){return new BPromise(function(_0x47f74d,_0x2e510a){return client[_0xb095('0x11')](_0x10efbe,_0x5c3522)['then'](function(_0x192d2){logger[_0xb095('0x12')]('UserProfile,\x20%s,\x20%s',_0x311c57,_0xb095('0x13'));logger['debug'](_0xb095('0x14'),_0x311c57,_0xb095('0x13'),JSON[_0xb095('0x15')](_0x192d2));if(_0x192d2[_0xb095('0x16')]){if(_0x192d2[_0xb095('0x16')][_0xb095('0x17')]===0x1f4){logger[_0xb095('0x16')]('UserProfile,\x20%s,\x20%s',_0x311c57,_0x192d2[_0xb095('0x16')][_0xb095('0x18')]);return _0x2e510a(_0x192d2[_0xb095('0x16')][_0xb095('0x18')]);}logger[_0xb095('0x16')](_0xb095('0x19'),_0x311c57,_0x192d2['error']['message']);return _0x47f74d(_0x192d2['error'][_0xb095('0x18')]);}else{logger[_0xb095('0x12')](_0xb095('0x19'),_0x311c57,_0xb095('0x13'));_0x47f74d(_0x192d2[_0xb095('0x1a')][_0xb095('0x18')]);}})['catch'](function(_0x7f9045){logger[_0xb095('0x16')](_0xb095('0x19'),_0x311c57,_0x7f9045);_0x2e510a(_0x7f9045);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 52cef8a..c466ebf 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 _0x8e61=['update','removeListener','register','length','userProfile:','save','remove'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x8e61,0xd7));var _0x18e6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x8e61[_0x422905];return _0x33dc6c;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x18e6('0x0'),_0x18e6('0x1'),_0x18e6('0x2')];function createListener(_0x50fe2a,_0x2e252d){return function(_0x16d314){_0x2e252d['emit'](_0x50fe2a,_0x16d314);};}function removeListener(_0x3c2dce,_0x47946f){return function(){UserProfileEvents[_0x18e6('0x3')](_0x3c2dce,_0x47946f);};}exports[_0x18e6('0x4')]=function(_0x1ba03b){for(var _0x3ec6e3=0x0,_0x33bc67=events[_0x18e6('0x5')];_0x3ec6e3<_0x33bc67;_0x3ec6e3++){var _0x5ab2c5=events[_0x3ec6e3];var _0x1e1af9=createListener(_0x18e6('0x6')+_0x5ab2c5,_0x1ba03b);UserProfileEvents['on'](_0x5ab2c5,_0x1e1af9);}}; \ No newline at end of file +var _0x6e2b=['emit','removeListener','register','length','./userProfile.events','save','update'];(function(_0x3e7e5e,_0x4e55e3){var _0x2a0636=function(_0x5df80b){while(--_0x5df80b){_0x3e7e5e['push'](_0x3e7e5e['shift']());}};_0x2a0636(++_0x4e55e3);}(_0x6e2b,0x1a8));var _0xb6e2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e2b[_0x321bb2];return _0x9c12ed;};'use strict';var UserProfileEvents=require(_0xb6e2('0x0'));var events=[_0xb6e2('0x1'),'remove',_0xb6e2('0x2')];function createListener(_0x50f9ef,_0x980123){return function(_0x29bdae){_0x980123[_0xb6e2('0x3')](_0x50f9ef,_0x29bdae);};}function removeListener(_0x5f5a15,_0x4c683a){return function(){UserProfileEvents[_0xb6e2('0x4')](_0x5f5a15,_0x4c683a);};}exports[_0xb6e2('0x5')]=function(_0xbcc4b3){for(var _0xdf4e21=0x0,_0x3fb7e8=events[_0xb6e2('0x6')];_0xdf4e21<_0x3fb7e8;_0xdf4e21++){var _0x2c5ba4=events[_0xdf4e21];var _0xaa119b=createListener('userProfile:'+_0x2c5ba4,_0xbcc4b3);UserProfileEvents['on'](_0x2c5ba4,_0xaa119b);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 68f34ba..fcf8b39 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 _0x821a=['destroy','util','path','Router','fs-extra','get','isAuthenticated','index','describe','/:id','show','create','put','update'];(function(_0x17ad86,_0x314671){var _0x54f8af=function(_0x49676c){while(--_0x49676c){_0x17ad86['push'](_0x17ad86['shift']());}};_0x54f8af(++_0x314671);}(_0x821a,0x9b));var _0xa821=function(_0x2a363a,_0x2b9e57){_0x2a363a=_0x2a363a-0x0;var _0x4ca306=_0x821a[_0x2a363a];return _0x4ca306;};'use strict';var multer=require('multer');var util=require(_0xa821('0x0'));var path=require(_0xa821('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa821('0x2')]();var fs_extra=require(_0xa821('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xa821('0x4')]('/',auth[_0xa821('0x5')](),controller[_0xa821('0x6')]);router[_0xa821('0x4')]('/describe',auth[_0xa821('0x5')](),controller[_0xa821('0x7')]);router[_0xa821('0x4')](_0xa821('0x8'),auth[_0xa821('0x5')](),controller[_0xa821('0x9')]);router['post']('/',auth[_0xa821('0x5')](),controller[_0xa821('0xa')]);router[_0xa821('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xa821('0xc')]);router['delete'](_0xa821('0x8'),auth[_0xa821('0x5')](),controller[_0xa821('0xd')]);module['exports']=router; \ No newline at end of file +var _0xa87e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','create','update','delete','/:id','util','path','connect-timeout'];(function(_0x4a8f8d,_0x58bfe9){var _0x39e20d=function(_0x1f8a89){while(--_0x1f8a89){_0x4a8f8d['push'](_0x4a8f8d['shift']());}};_0x39e20d(++_0x58bfe9);}(_0xa87e,0x173));var _0xea87=function(_0x452ae3,_0x9e166b){_0x452ae3=_0x452ae3-0x0;var _0x6683d2=_0xa87e[_0x452ae3];return _0x6683d2;};'use strict';var multer=require('multer');var util=require(_0xea87('0x0'));var path=require(_0xea87('0x1'));var timeout=require(_0xea87('0x2'));var express=require('express');var router=express[_0xea87('0x3')]();var fs_extra=require(_0xea87('0x4'));var auth=require(_0xea87('0x5'));var interaction=require(_0xea87('0x6'));var config=require(_0xea87('0x7'));var controller=require('./userProfileResource.controller');router[_0xea87('0x8')]('/',auth[_0xea87('0x9')](),controller['index']);router[_0xea87('0x8')](_0xea87('0xa'),auth[_0xea87('0x9')](),controller[_0xea87('0xb')]);router[_0xea87('0x8')]('/:id',auth[_0xea87('0x9')](),controller[_0xea87('0xc')]);router['post']('/',auth[_0xea87('0x9')](),controller[_0xea87('0xd')]);router['put']('/:id',auth[_0xea87('0x9')](),controller[_0xea87('0xe')]);router[_0xea87('0xf')](_0xea87('0x10'),auth[_0xea87('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5ca779e..a95fee2 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 _0x4317=['sequelize','exports','STRING','INTEGER'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x4317,0x1ec));var _0x7431=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4317[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7431('0x0'));module[_0x7431('0x1')]={'name':{'type':Sequelize[_0x7431('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7431('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd476=['exports','STRING','sequelize'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0xd476,0x1c4));var _0x6d47=function(_0x21abd4,_0x38a273){_0x21abd4=_0x21abd4-0x0;var _0x24398a=_0xd476[_0x21abd4];return _0x24398a;};'use strict';var Sequelize=require(_0x6d47('0x0'));module[_0x6d47('0x1')]={'name':{'type':Sequelize[_0x6d47('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x6d47('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 f2814e5..595453c 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 _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileResource','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0x1afaad,_0xa73d27){var _0x311d24=function(_0x52b0e2){while(--_0x52b0e2){_0x1afaad['push'](_0x1afaad['shift']());}};_0x311d24(++_0xa73d27);}(_0xd943,0x15d));var _0x3d94=function(_0x2e0c7a,_0x438e5e){_0x2e0c7a=_0x2e0c7a-0x0;var _0x887d77=_0xd943[_0x2e0c7a];return _0x887d77;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['UserProfileResource']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file +var _0x7880=['destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x3d784f,_0x100ef1){var _0x32340e=function(_0xfd0c00){while(--_0xfd0c00){_0x3d784f['push'](_0x3d784f['shift']());}};_0x32340e(++_0x100ef1);}(_0x7880,0x1f4));var _0x0788=function(_0x324f55,_0x2e6ca4){_0x324f55=_0x324f55-0x0;var _0x284952=_0x7880[_0x324f55];return _0x284952;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['UserProfileResource'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};exports['describe']=function(_0x1693d0,_0x5d32ae){return db['UserProfileResource'][_0x0788('0x4c')]()[_0x0788('0x26')](respondWithResult(_0x5d32ae,null))[_0x0788('0x44')](handleError(_0x5d32ae,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 0734213..b0233a2 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 _0xbaa9=['bluebird','path','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','api','moment'];(function(_0x481366,_0x41e46b){var _0x229649=function(_0x508ecc){while(--_0x508ecc){_0x481366['push'](_0x481366['shift']());}};_0x229649(++_0x41e46b);}(_0xbaa9,0x100));var _0x9baa=function(_0xfed070,_0x4482fb){_0xfed070=_0xfed070-0x0;var _0x35d66d=_0xbaa9[_0xfed070];return _0x35d66d;};'use strict';var _=require(_0x9baa('0x0'));var util=require(_0x9baa('0x1'));var logger=require('../../config/logger')(_0x9baa('0x2'));var moment=require(_0x9baa('0x3'));var BPromise=require(_0x9baa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9baa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9baa('0x6'));module[_0x9baa('0x7')]=function(_0x371884,_0x4cb9d7){return _0x371884[_0x9baa('0x8')]('UserProfileResource',attributes,{'tableName':_0x9baa('0x9'),'paranoid':![],'indexes':[{'name':_0x9baa('0xa'),'fields':[_0x9baa('0xb'),_0x9baa('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe512=['user_profile_has_resources','sectionId','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource'];(function(_0x56c2c7,_0x5f4831){var _0x2a9dfb=function(_0x48de17){while(--_0x48de17){_0x56c2c7['push'](_0x56c2c7['shift']());}};_0x2a9dfb(++_0x5f4831);}(_0xe512,0x116));var _0x2e51=function(_0xe7ded6,_0x422156){_0xe7ded6=_0xe7ded6-0x0;var _0x23312b=_0xe512[_0xe7ded6];return _0x23312b;};'use strict';var _=require(_0x2e51('0x0'));var util=require(_0x2e51('0x1'));var logger=require('../../config/logger')(_0x2e51('0x2'));var moment=require(_0x2e51('0x3'));var BPromise=require(_0x2e51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e51('0x5'));var config=require(_0x2e51('0x6'));var attributes=require(_0x2e51('0x7'));module[_0x2e51('0x8')]=function(_0x3ad517,_0x566593){return _0x3ad517['define'](_0x2e51('0x9'),attributes,{'tableName':_0x2e51('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x2e51('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index ac777a4..ffac34a 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 _0x765f=['http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x340c00,_0x529279){var _0x2a138b=function(_0x93b71c){while(--_0x93b71c){_0x340c00['push'](_0x340c00['shift']());}};_0x2a138b(++_0x529279);}(_0x765f,0x146));var _0xf765=function(_0x3396b8,_0x17f961){_0x3396b8=_0x3396b8-0x0;var _0x1b8ba9=_0x765f[_0x3396b8];return _0x1b8ba9;};'use strict';var _=require('lodash');var util=require(_0xf765('0x0'));var moment=require(_0xf765('0x1'));var BPromise=require(_0xf765('0x2'));var rs=require(_0xf765('0x3'));var fs=require('fs');var Redis=require(_0xf765('0x4'));var db=require(_0xf765('0x5'))['db'];var utils=require(_0xf765('0x6'));var logger=require(_0xf765('0x7'))(_0xf765('0x8'));var config=require(_0xf765('0x9'));var jayson=require(_0xf765('0xa'));var client=jayson[_0xf765('0xb')][_0xf765('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x941ea7,_0x357e88,_0x39352e){return new BPromise(function(_0x51831d,_0x16dfe9){return client[_0xf765('0xd')](_0x941ea7,_0x39352e)[_0xf765('0xe')](function(_0x2a9148){logger['info'](_0xf765('0xf'),_0x357e88,_0xf765('0x10'));logger[_0xf765('0x11')](_0xf765('0x12'),_0x357e88,_0xf765('0x10'),JSON[_0xf765('0x13')](_0x2a9148));if(_0x2a9148[_0xf765('0x14')]){if(_0x2a9148['error'][_0xf765('0x15')]===0x1f4){logger[_0xf765('0x14')](_0xf765('0xf'),_0x357e88,_0x2a9148[_0xf765('0x14')][_0xf765('0x16')]);return _0x16dfe9(_0x2a9148['error'][_0xf765('0x16')]);}logger[_0xf765('0x14')](_0xf765('0xf'),_0x357e88,_0x2a9148['error'][_0xf765('0x16')]);return _0x51831d(_0x2a9148['error'][_0xf765('0x16')]);}else{logger[_0xf765('0x17')](_0xf765('0xf'),_0x357e88,_0xf765('0x10'));_0x51831d(_0x2a9148[_0xf765('0x18')][_0xf765('0x16')]);}})[_0xf765('0x19')](function(_0x2a72a1){logger[_0xf765('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x357e88,_0x2a72a1);_0x16dfe9(_0x2a72a1);});});} \ No newline at end of file +var _0xf458=['../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x467ef6,_0x932cef){var _0x3e4aa2=function(_0xb56bb5){while(--_0xb56bb5){_0x467ef6['push'](_0x467ef6['shift']());}};_0x3e4aa2(++_0x932cef);}(_0xf458,0x1e9));var _0x8f45=function(_0xdef75a,_0x278770){_0xdef75a=_0xdef75a-0x0;var _0x36a968=_0xf458[_0xdef75a];return _0x36a968;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8f45('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f45('0x1'))['db'];var utils=require(_0x8f45('0x2'));var logger=require('../../config/logger')(_0x8f45('0x3'));var config=require(_0x8f45('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8f45('0x5')][_0x8f45('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3d4bdc,_0x59a80c,_0x126dca){return new BPromise(function(_0x45531d,_0x1c7efa){return client[_0x8f45('0x7')](_0x3d4bdc,_0x126dca)[_0x8f45('0x8')](function(_0x43ffc4){logger[_0x8f45('0x9')](_0x8f45('0xa'),_0x59a80c,_0x8f45('0xb'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x59a80c,'request\x20sent',JSON[_0x8f45('0xc')](_0x43ffc4));if(_0x43ffc4['error']){if(_0x43ffc4[_0x8f45('0xd')]['code']===0x1f4){logger[_0x8f45('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x59a80c,_0x43ffc4['error'][_0x8f45('0xe')]);return _0x1c7efa(_0x43ffc4[_0x8f45('0xd')][_0x8f45('0xe')]);}logger[_0x8f45('0xd')](_0x8f45('0xa'),_0x59a80c,_0x43ffc4[_0x8f45('0xd')][_0x8f45('0xe')]);return _0x45531d(_0x43ffc4['error'][_0x8f45('0xe')]);}else{logger['info'](_0x8f45('0xa'),_0x59a80c,_0x8f45('0xb'));_0x45531d(_0x43ffc4[_0x8f45('0xf')]['message']);}})[_0x8f45('0x10')](function(_0x52f747){logger[_0x8f45('0xd')](_0x8f45('0xa'),_0x59a80c,_0x52f747);_0x1c7efa(_0x52f747);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 809318c..31c588b 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 _0x143f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x24692d,_0x27ce54){var _0x28b758=function(_0x31b948){while(--_0x31b948){_0x24692d['push'](_0x24692d['shift']());}};_0x28b758(++_0x27ce54);}(_0x143f,0x87));var _0xf143=function(_0x5c2941,_0x3ff747){_0x5c2941=_0x5c2941-0x0;var _0x403a0e=_0x143f[_0x5c2941];return _0x403a0e;};'use strict';var multer=require(_0xf143('0x0'));var util=require(_0xf143('0x1'));var path=require(_0xf143('0x2'));var timeout=require(_0xf143('0x3'));var express=require(_0xf143('0x4'));var router=express[_0xf143('0x5')]();var fs_extra=require(_0xf143('0x6'));var auth=require(_0xf143('0x7'));var interaction=require(_0xf143('0x8'));var config=require('../../config/environment');var controller=require(_0xf143('0x9'));router[_0xf143('0xa')]('/',auth[_0xf143('0xb')](),controller['index']);router['get']('/describe',auth[_0xf143('0xb')](),controller[_0xf143('0xc')]);router['get'](_0xf143('0xd'),auth[_0xf143('0xb')](),controller[_0xf143('0xe')]);router[_0xf143('0xf')]('/',auth[_0xf143('0xb')](),controller[_0xf143('0x10')]);router['put'](_0xf143('0xd'),auth['isAuthenticated'](),controller[_0xf143('0x11')]);router[_0xf143('0x12')](_0xf143('0xd'),auth[_0xf143('0xb')](),controller[_0xf143('0x13')]);module['exports']=router; \ No newline at end of file +var _0x01d7=['describe','/:id','show','create','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','./userProfileSection.controller','get','isAuthenticated','index','/describe'];(function(_0x288f3d,_0x53316c){var _0x18d679=function(_0x481cd7){while(--_0x481cd7){_0x288f3d['push'](_0x288f3d['shift']());}};_0x18d679(++_0x53316c);}(_0x01d7,0x14b));var _0x701d=function(_0x4973a7,_0x15466c){_0x4973a7=_0x4973a7-0x0;var _0x922942=_0x01d7[_0x4973a7];return _0x922942;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x701d('0x0'));var express=require(_0x701d('0x1'));var router=express[_0x701d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x701d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x701d('0x4'));router[_0x701d('0x5')]('/',auth[_0x701d('0x6')](),controller[_0x701d('0x7')]);router['get'](_0x701d('0x8'),auth['isAuthenticated'](),controller[_0x701d('0x9')]);router[_0x701d('0x5')](_0x701d('0xa'),auth[_0x701d('0x6')](),controller[_0x701d('0xb')]);router['post']('/',auth[_0x701d('0x6')](),controller[_0x701d('0xc')]);router['put'](_0x701d('0xa'),auth[_0x701d('0x6')](),controller[_0x701d('0xd')]);router[_0x701d('0xe')]('/:id',auth[_0x701d('0x6')](),controller[_0x701d('0xf')]);module[_0x701d('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 577f32a..04e362f 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 _0xe511=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x3d7ea9,_0x1f3192){var _0xd8535=function(_0xba7efa){while(--_0xba7efa){_0x3d7ea9['push'](_0x3d7ea9['shift']());}};_0xd8535(++_0x1f3192);}(_0xe511,0x16f));var _0x1e51=function(_0x49d27a,_0x166543){_0x49d27a=_0x49d27a-0x0;var _0x3f0b62=_0xe511[_0x49d27a];return _0x3f0b62;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x1e51('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x42e242){this[_0x1e51('0x4')](_0x1e51('0x5'),_0x42e242?_0x42e242[_0x1e51('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x1e51('0x5'))?this[_0x1e51('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x6cb4=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x5d1ce1,_0x106716){var _0x282ee4=function(_0x250a2d){while(--_0x250a2d){_0x5d1ce1['push'](_0x5d1ce1['shift']());}};_0x282ee4(++_0x106716);}(_0x6cb4,0xff));var _0x46cb=function(_0xd43768,_0x553c8c){_0xd43768=_0xd43768-0x0;var _0x4b6a89=_0x6cb4[_0xd43768];return _0x4b6a89;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'name':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x46cb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x46cb('0x2')],'set':function(_0x2efd19){this['setDataValue'](_0x46cb('0x5'),_0x2efd19?_0x2efd19['join'](''):[]);},'get':function(){return this[_0x46cb('0x6')]('crudPermissions')?this[_0x46cb('0x6')](_0x46cb('0x5'))[_0x46cb('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 75724be..d513b9e 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 _0x6627=['filter','where','VIRTUAL','name','options','includeAll','include','findAll','rows','keys','rawAttributes','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','error','UserProfileSection','fieldName','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick'];(function(_0x2158ed,_0x59182f){var _0x476b73=function(_0x226298){while(--_0x226298){_0x2158ed['push'](_0x2158ed['shift']());}};_0x476b73(++_0x59182f);}(_0x6627,0x17f));var _0x7662=function(_0x52cbe2,_0x5afefb){_0x52cbe2=_0x52cbe2-0x0;var _0x277141=_0x6627[_0x52cbe2];return _0x277141;};'use strict';var emlformat=require(_0x7662('0x0'));var rimraf=require(_0x7662('0x1'));var zipdir=require(_0x7662('0x2'));var jsonpatch=require(_0x7662('0x3'));var rp=require(_0x7662('0x4'));var moment=require(_0x7662('0x5'));var BPromise=require(_0x7662('0x6'));var Mustache=require(_0x7662('0x7'));var util=require(_0x7662('0x8'));var path=require(_0x7662('0x9'));var sox=require(_0x7662('0xa'));var csv=require(_0x7662('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7662('0xc'));var _=require(_0x7662('0xd'));var squel=require(_0x7662('0xe'));var crypto=require(_0x7662('0xf'));var jsforce=require(_0x7662('0x10'));var deskjs=require(_0x7662('0x11'));var toCsv=require('to-csv');var querystring=require(_0x7662('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7662('0x13'));var as=require(_0x7662('0x14'));var hardwareService=require(_0x7662('0x15'));var logger=require(_0x7662('0x16'))('api');var utils=require(_0x7662('0x17'));var config=require(_0x7662('0x18'));var licenseUtil=require(_0x7662('0x19'));var db=require(_0x7662('0x1a'))['db'];function respondWithStatusCode(_0x5e274a,_0x187180){_0x187180=_0x187180||0xcc;return function(_0x589b16){if(_0x589b16){return _0x5e274a['sendStatus'](_0x187180);}return _0x5e274a['status'](_0x187180)['end']();};}function respondWithResult(_0x1b535c,_0xeb1763){_0xeb1763=_0xeb1763||0xc8;return function(_0x5ca215){if(_0x5ca215){return _0x1b535c[_0x7662('0x1b')](_0xeb1763)['json'](_0x5ca215);}};}function respondWithFilteredResult(_0x14cd61,_0x39ec0c){return function(_0x3e820b){if(_0x3e820b){var _0x21e833=typeof _0x39ec0c[_0x7662('0x1c')]===_0x7662('0x1d')&&typeof _0x39ec0c[_0x7662('0x1e')]==='undefined';var _0x56a9b8=_0x3e820b[_0x7662('0x1f')];var _0x2c458c=_0x21e833?0x0:_0x39ec0c[_0x7662('0x1c')];var _0x1bbf7e=_0x21e833?_0x3e820b[_0x7662('0x1f')]:_0x39ec0c[_0x7662('0x1c')]+_0x39ec0c[_0x7662('0x1e')];var _0x59811f;if(_0x1bbf7e>=_0x56a9b8){_0x1bbf7e=_0x56a9b8;_0x59811f=0xc8;}else{_0x59811f=0xce;}_0x14cd61['status'](_0x59811f);return _0x14cd61[_0x7662('0x20')](_0x7662('0x21'),_0x2c458c+'-'+_0x1bbf7e+'/'+_0x56a9b8)[_0x7662('0x22')](_0x3e820b);}return null;};}function patchUpdates(_0x4d8eb5){return function(_0x397b69){try{jsonpatch[_0x7662('0x23')](_0x397b69,_0x4d8eb5,!![]);}catch(_0x55114e){return BPromise[_0x7662('0x24')](_0x55114e);}return _0x397b69['save']();};}function saveUpdates(_0x344ace,_0x4fc778){return function(_0x32bba0){if(_0x32bba0){return _0x32bba0[_0x7662('0x25')](_0x344ace)['then'](function(_0x4281a1){return _0x4281a1;});}return null;};}function removeEntity(_0x5eeeb5,_0x351564){return function(_0x120fc9){if(_0x120fc9){return _0x120fc9['destroy']()[_0x7662('0x26')](function(){_0x5eeeb5[_0x7662('0x1b')](0xcc)[_0x7662('0x27')]();});}};}function handleEntityNotFound(_0x3ad2bc,_0x565cc3){return function(_0x3d1240){if(!_0x3d1240){_0x3ad2bc['sendStatus'](0x194);}return _0x3d1240;};}function handleError(_0x2cff0f,_0x208966){_0x208966=_0x208966||0x1f4;return function(_0x26ae32){logger[_0x7662('0x28')](_0x26ae32['stack']);if(_0x26ae32['name']){delete _0x26ae32['name'];}_0x2cff0f['status'](_0x208966)['send'](_0x26ae32);};}exports['index']=function(_0x128b65,_0x292c6a){var _0x3e76f9={},_0x5b8d13={},_0x4ede57={'count':0x0,'rows':[]};var _0x556937=_['map'](db[_0x7662('0x29')]['rawAttributes'],function(_0x5e784d){return{'name':_0x5e784d[_0x7662('0x2a')],'type':_0x5e784d['type']['key']};});_0x5b8d13['model']=_[_0x7662('0x2b')](_0x556937,'name');_0x5b8d13[_0x7662('0x2c')]=_['keys'](_0x128b65[_0x7662('0x2c')]);_0x5b8d13[_0x7662('0x2d')]=_[_0x7662('0x2e')](_0x5b8d13[_0x7662('0x2f')],_0x5b8d13[_0x7662('0x2c')]);_0x3e76f9[_0x7662('0x30')]=_[_0x7662('0x2e')](_0x5b8d13[_0x7662('0x2f')],qs['fields'](_0x128b65['query'][_0x7662('0x31')]));_0x3e76f9['attributes']=_0x3e76f9['attributes'][_0x7662('0x32')]?_0x3e76f9[_0x7662('0x30')]:_0x5b8d13['model'];if(!_0x128b65[_0x7662('0x2c')][_0x7662('0x33')](_0x7662('0x34'))){_0x3e76f9[_0x7662('0x1e')]=qs[_0x7662('0x1e')](_0x128b65['query'][_0x7662('0x1e')]);_0x3e76f9['offset']=qs[_0x7662('0x1c')](_0x128b65[_0x7662('0x2c')][_0x7662('0x1c')]);}_0x3e76f9['order']=qs['sort'](_0x128b65[_0x7662('0x2c')][_0x7662('0x35')]);_0x3e76f9['where']=qs['filters'](_[_0x7662('0x36')](_0x128b65[_0x7662('0x2c')],_0x5b8d13['filters']),_0x556937);if(_0x128b65['query'][_0x7662('0x37')]){_0x3e76f9[_0x7662('0x38')]=_['merge'](_0x3e76f9[_0x7662('0x38')],{'$or':_['map'](_0x556937,function(_0xda195f){if(_0xda195f['type']!==_0x7662('0x39')){var _0x1d34e5={};_0x1d34e5[_0xda195f[_0x7662('0x3a')]]={'$like':'%'+_0x128b65[_0x7662('0x2c')]['filter']+'%'};return _0x1d34e5;}})});}_0x3e76f9=_['merge']({},_0x3e76f9,_0x128b65[_0x7662('0x3b')]);var _0x33b08a={'where':_0x3e76f9[_0x7662('0x38')]};return db[_0x7662('0x29')][_0x7662('0x1f')](_0x33b08a)[_0x7662('0x26')](function(_0xc5ac8){_0x4ede57[_0x7662('0x1f')]=_0xc5ac8;if(_0x128b65[_0x7662('0x2c')][_0x7662('0x3c')]){_0x3e76f9[_0x7662('0x3d')]=[{'all':!![]}];}return db[_0x7662('0x29')][_0x7662('0x3e')](_0x3e76f9);})['then'](function(_0x2a7386){_0x4ede57[_0x7662('0x3f')]=_0x2a7386;return _0x4ede57;})[_0x7662('0x26')](respondWithFilteredResult(_0x292c6a,_0x3e76f9))['catch'](handleError(_0x292c6a,null));};exports['show']=function(_0x25ff0b,_0x350a1e){var _0x413dd0={'raw':![],'where':{'id':_0x25ff0b['params']['id']}},_0xc6a874={};_0xc6a874[_0x7662('0x2f')]=_[_0x7662('0x40')](db[_0x7662('0x29')][_0x7662('0x41')]);_0xc6a874[_0x7662('0x2c')]=_['keys'](_0x25ff0b['query']);_0xc6a874[_0x7662('0x2d')]=_[_0x7662('0x2e')](_0xc6a874[_0x7662('0x2f')],_0xc6a874['query']);_0x413dd0['attributes']=_[_0x7662('0x2e')](_0xc6a874[_0x7662('0x2f')],qs['fields'](_0x25ff0b[_0x7662('0x2c')]['fields']));_0x413dd0[_0x7662('0x30')]=_0x413dd0[_0x7662('0x30')][_0x7662('0x32')]?_0x413dd0['attributes']:_0xc6a874[_0x7662('0x2f')];if(_0x25ff0b[_0x7662('0x2c')][_0x7662('0x3c')]){_0x413dd0[_0x7662('0x3d')]=[{'all':!![]}];}_0x413dd0=_['merge']({},_0x413dd0,_0x25ff0b[_0x7662('0x3b')]);return db[_0x7662('0x29')][_0x7662('0x42')](_0x413dd0)['then'](handleEntityNotFound(_0x350a1e,null))['then'](respondWithResult(_0x350a1e,null))[_0x7662('0x43')](handleError(_0x350a1e,null));};exports[_0x7662('0x44')]=function(_0x2241a2,_0x214cb1){return db[_0x7662('0x29')][_0x7662('0x44')](_0x2241a2['body'],{})['then'](respondWithResult(_0x214cb1,0xc9))['catch'](handleError(_0x214cb1,null));};exports['update']=function(_0x2f1960,_0x307e06){if(_0x2f1960[_0x7662('0x45')]['id']){delete _0x2f1960['body']['id'];}return db[_0x7662('0x29')]['find']({'where':{'id':_0x2f1960[_0x7662('0x46')]['id']}})[_0x7662('0x26')](handleEntityNotFound(_0x307e06,null))['then'](saveUpdates(_0x2f1960[_0x7662('0x45')],null))[_0x7662('0x26')](respondWithResult(_0x307e06,null))['catch'](handleError(_0x307e06,null));};exports[_0x7662('0x47')]=function(_0x2455ef,_0x1723bf){return db[_0x7662('0x29')]['find']({'where':{'id':_0x2455ef[_0x7662('0x46')]['id']}})[_0x7662('0x26')](handleEntityNotFound(_0x1723bf,null))[_0x7662('0x26')](removeEntity(_0x1723bf,null))['catch'](handleError(_0x1723bf,null));};exports['describe']=function(_0x5a3f4a,_0x14b34a){return db['UserProfileSection'][_0x7662('0x48')]()[_0x7662('0x26')](respondWithResult(_0x14b34a,null))[_0x7662('0x43')](handleError(_0x14b34a,null));}; \ No newline at end of file +var _0xba0d=['order','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xba0d,0x142));var _0xdba0=function(_0x5901e2,_0x11b970){_0x5901e2=_0x5901e2-0x0;var _0x14ebba=_0xba0d[_0x5901e2];return _0x14ebba;};'use strict';var emlformat=require(_0xdba0('0x0'));var rimraf=require(_0xdba0('0x1'));var zipdir=require(_0xdba0('0x2'));var jsonpatch=require(_0xdba0('0x3'));var rp=require('request-promise');var moment=require(_0xdba0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdba0('0x5'));var util=require(_0xdba0('0x6'));var path=require(_0xdba0('0x7'));var sox=require(_0xdba0('0x8'));var csv=require(_0xdba0('0x9'));var ejs=require(_0xdba0('0xa'));var fs=require('fs');var fs_extra=require(_0xdba0('0xb'));var _=require(_0xdba0('0xc'));var squel=require('squel');var crypto=require(_0xdba0('0xd'));var jsforce=require(_0xdba0('0xe'));var deskjs=require(_0xdba0('0xf'));var toCsv=require(_0xdba0('0x9'));var querystring=require(_0xdba0('0x10'));var Papa=require('papaparse');var Redis=require(_0xdba0('0x11'));var authService=require(_0xdba0('0x12'));var qs=require(_0xdba0('0x13'));var as=require(_0xdba0('0x14'));var hardwareService=require(_0xdba0('0x15'));var logger=require('../../config/logger')(_0xdba0('0x16'));var utils=require('../../config/utils');var config=require(_0xdba0('0x17'));var licenseUtil=require(_0xdba0('0x18'));var db=require(_0xdba0('0x19'))['db'];function respondWithStatusCode(_0x3d805e,_0x156cf6){_0x156cf6=_0x156cf6||0xcc;return function(_0x2e76d5){if(_0x2e76d5){return _0x3d805e[_0xdba0('0x1a')](_0x156cf6);}return _0x3d805e[_0xdba0('0x1b')](_0x156cf6)['end']();};}function respondWithResult(_0x5b506a,_0x1876b6){_0x1876b6=_0x1876b6||0xc8;return function(_0x1cd6ea){if(_0x1cd6ea){return _0x5b506a[_0xdba0('0x1b')](_0x1876b6)[_0xdba0('0x1c')](_0x1cd6ea);}};}function respondWithFilteredResult(_0x2c0ccf,_0x4240ae){return function(_0x5349a9){if(_0x5349a9){var _0x2ca541=typeof _0x4240ae[_0xdba0('0x1d')]===_0xdba0('0x1e')&&typeof _0x4240ae[_0xdba0('0x1f')]===_0xdba0('0x1e');var _0x592e52=_0x5349a9[_0xdba0('0x20')];var _0x42ea42=_0x2ca541?0x0:_0x4240ae[_0xdba0('0x1d')];var _0x5db68b=_0x2ca541?_0x5349a9['count']:_0x4240ae[_0xdba0('0x1d')]+_0x4240ae[_0xdba0('0x1f')];var _0x5940b7;if(_0x5db68b>=_0x592e52){_0x5db68b=_0x592e52;_0x5940b7=0xc8;}else{_0x5940b7=0xce;}_0x2c0ccf[_0xdba0('0x1b')](_0x5940b7);return _0x2c0ccf['set'](_0xdba0('0x21'),_0x42ea42+'-'+_0x5db68b+'/'+_0x592e52)[_0xdba0('0x1c')](_0x5349a9);}return null;};}function patchUpdates(_0x2ee491){return function(_0xb007ce){try{jsonpatch[_0xdba0('0x22')](_0xb007ce,_0x2ee491,!![]);}catch(_0x2598f7){return BPromise[_0xdba0('0x23')](_0x2598f7);}return _0xb007ce[_0xdba0('0x24')]();};}function saveUpdates(_0x5b6be9,_0x19a65c){return function(_0x582874){if(_0x582874){return _0x582874[_0xdba0('0x25')](_0x5b6be9)['then'](function(_0x3ed3df){return _0x3ed3df;});}return null;};}function removeEntity(_0x157bb0,_0x77689b){return function(_0x4cb1ea){if(_0x4cb1ea){return _0x4cb1ea[_0xdba0('0x26')]()[_0xdba0('0x27')](function(){_0x157bb0['status'](0xcc)[_0xdba0('0x28')]();});}};}function handleEntityNotFound(_0x2c5c7b,_0x50a616){return function(_0x4e7ca3){if(!_0x4e7ca3){_0x2c5c7b['sendStatus'](0x194);}return _0x4e7ca3;};}function handleError(_0x486cea,_0x8c0a4c){_0x8c0a4c=_0x8c0a4c||0x1f4;return function(_0xe15e11){logger['error'](_0xe15e11[_0xdba0('0x29')]);if(_0xe15e11['name']){delete _0xe15e11[_0xdba0('0x2a')];}_0x486cea[_0xdba0('0x1b')](_0x8c0a4c)[_0xdba0('0x2b')](_0xe15e11);};}exports[_0xdba0('0x2c')]=function(_0x3a0a3c,_0xdca2f1){var _0x4ec7b0={},_0x5d7dd8={},_0x1539c3={'count':0x0,'rows':[]};var _0x51fd95=_['map'](db[_0xdba0('0x2d')][_0xdba0('0x2e')],function(_0x36403d){return{'name':_0x36403d[_0xdba0('0x2f')],'type':_0x36403d[_0xdba0('0x30')][_0xdba0('0x31')]};});_0x5d7dd8['model']=_[_0xdba0('0x32')](_0x51fd95,_0xdba0('0x2a'));_0x5d7dd8[_0xdba0('0x33')]=_[_0xdba0('0x34')](_0x3a0a3c[_0xdba0('0x33')]);_0x5d7dd8['filters']=_[_0xdba0('0x35')](_0x5d7dd8[_0xdba0('0x36')],_0x5d7dd8['query']);_0x4ec7b0[_0xdba0('0x37')]=_['intersection'](_0x5d7dd8[_0xdba0('0x36')],qs[_0xdba0('0x38')](_0x3a0a3c[_0xdba0('0x33')][_0xdba0('0x38')]));_0x4ec7b0[_0xdba0('0x37')]=_0x4ec7b0[_0xdba0('0x37')]['length']?_0x4ec7b0[_0xdba0('0x37')]:_0x5d7dd8[_0xdba0('0x36')];if(!_0x3a0a3c[_0xdba0('0x33')][_0xdba0('0x39')]('nolimit')){_0x4ec7b0[_0xdba0('0x1f')]=qs[_0xdba0('0x1f')](_0x3a0a3c[_0xdba0('0x33')][_0xdba0('0x1f')]);_0x4ec7b0[_0xdba0('0x1d')]=qs[_0xdba0('0x1d')](_0x3a0a3c[_0xdba0('0x33')][_0xdba0('0x1d')]);}_0x4ec7b0[_0xdba0('0x3a')]=qs['sort'](_0x3a0a3c[_0xdba0('0x33')]['sort']);_0x4ec7b0[_0xdba0('0x3b')]=qs[_0xdba0('0x3c')](_[_0xdba0('0x3d')](_0x3a0a3c[_0xdba0('0x33')],_0x5d7dd8['filters']),_0x51fd95);if(_0x3a0a3c['query'][_0xdba0('0x3e')]){_0x4ec7b0[_0xdba0('0x3b')]=_[_0xdba0('0x3f')](_0x4ec7b0[_0xdba0('0x3b')],{'$or':_['map'](_0x51fd95,function(_0x4d3bf3){if(_0x4d3bf3[_0xdba0('0x30')]!==_0xdba0('0x40')){var _0x227f4f={};_0x227f4f[_0x4d3bf3[_0xdba0('0x2a')]]={'$like':'%'+_0x3a0a3c['query']['filter']+'%'};return _0x227f4f;}})});}_0x4ec7b0=_[_0xdba0('0x3f')]({},_0x4ec7b0,_0x3a0a3c[_0xdba0('0x41')]);var _0x17ead0={'where':_0x4ec7b0[_0xdba0('0x3b')]};return db[_0xdba0('0x2d')][_0xdba0('0x20')](_0x17ead0)[_0xdba0('0x27')](function(_0x359062){_0x1539c3[_0xdba0('0x20')]=_0x359062;if(_0x3a0a3c[_0xdba0('0x33')]['includeAll']){_0x4ec7b0[_0xdba0('0x42')]=[{'all':!![]}];}return db[_0xdba0('0x2d')][_0xdba0('0x43')](_0x4ec7b0);})[_0xdba0('0x27')](function(_0x3a178c){_0x1539c3[_0xdba0('0x44')]=_0x3a178c;return _0x1539c3;})[_0xdba0('0x27')](respondWithFilteredResult(_0xdca2f1,_0x4ec7b0))['catch'](handleError(_0xdca2f1,null));};exports['show']=function(_0x1d8b88,_0x170d96){var _0x50efed={'raw':![],'where':{'id':_0x1d8b88[_0xdba0('0x45')]['id']}},_0x291cc5={};_0x291cc5[_0xdba0('0x36')]=_[_0xdba0('0x34')](db['UserProfileSection'][_0xdba0('0x2e')]);_0x291cc5[_0xdba0('0x33')]=_[_0xdba0('0x34')](_0x1d8b88[_0xdba0('0x33')]);_0x291cc5[_0xdba0('0x3c')]=_[_0xdba0('0x35')](_0x291cc5[_0xdba0('0x36')],_0x291cc5['query']);_0x50efed[_0xdba0('0x37')]=_['intersection'](_0x291cc5[_0xdba0('0x36')],qs[_0xdba0('0x38')](_0x1d8b88[_0xdba0('0x33')][_0xdba0('0x38')]));_0x50efed[_0xdba0('0x37')]=_0x50efed[_0xdba0('0x37')][_0xdba0('0x46')]?_0x50efed[_0xdba0('0x37')]:_0x291cc5[_0xdba0('0x36')];if(_0x1d8b88['query'][_0xdba0('0x47')]){_0x50efed[_0xdba0('0x42')]=[{'all':!![]}];}_0x50efed=_[_0xdba0('0x3f')]({},_0x50efed,_0x1d8b88[_0xdba0('0x41')]);return db[_0xdba0('0x2d')][_0xdba0('0x48')](_0x50efed)[_0xdba0('0x27')](handleEntityNotFound(_0x170d96,null))[_0xdba0('0x27')](respondWithResult(_0x170d96,null))[_0xdba0('0x49')](handleError(_0x170d96,null));};exports['create']=function(_0x2ae6d9,_0x11443d){return db['UserProfileSection']['create'](_0x2ae6d9[_0xdba0('0x4a')],{})['then'](respondWithResult(_0x11443d,0xc9))[_0xdba0('0x49')](handleError(_0x11443d,null));};exports[_0xdba0('0x25')]=function(_0x3e4573,_0x250b25){if(_0x3e4573[_0xdba0('0x4a')]['id']){delete _0x3e4573[_0xdba0('0x4a')]['id'];}return db[_0xdba0('0x2d')][_0xdba0('0x48')]({'where':{'id':_0x3e4573[_0xdba0('0x45')]['id']}})[_0xdba0('0x27')](handleEntityNotFound(_0x250b25,null))[_0xdba0('0x27')](saveUpdates(_0x3e4573[_0xdba0('0x4a')],null))[_0xdba0('0x27')](respondWithResult(_0x250b25,null))[_0xdba0('0x49')](handleError(_0x250b25,null));};exports[_0xdba0('0x26')]=function(_0x220e28,_0x48b2b6){return db[_0xdba0('0x2d')][_0xdba0('0x48')]({'where':{'id':_0x220e28[_0xdba0('0x45')]['id']}})[_0xdba0('0x27')](handleEntityNotFound(_0x48b2b6,null))[_0xdba0('0x27')](removeEntity(_0x48b2b6,null))[_0xdba0('0x49')](handleError(_0x48b2b6,null));};exports['describe']=function(_0xcabcd4,_0x4f0589){return db['UserProfileSection'][_0xdba0('0x4b')]()[_0xdba0('0x27')](respondWithResult(_0x4f0589,null))[_0xdba0('0x49')](handleError(_0x4f0589,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 827977d..f1a0f2a 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 _0xace4=['path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xace4,0x172));var _0x4ace=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0xace4[_0x82140];return _0x2b15a6;};'use strict';var _=require('lodash');var util=require(_0x4ace('0x0'));var logger=require(_0x4ace('0x1'))('api');var moment=require(_0x4ace('0x2'));var BPromise=require(_0x4ace('0x3'));var rp=require(_0x4ace('0x4'));var fs=require('fs');var path=require(_0x4ace('0x5'));var rimraf=require(_0x4ace('0x6'));var config=require(_0x4ace('0x7'));var attributes=require(_0x4ace('0x8'));module[_0x4ace('0x9')]=function(_0x58f62a,_0x3021bd){return _0x58f62a[_0x4ace('0xa')](_0x4ace('0xb'),attributes,{'tableName':_0x4ace('0xc'),'paranoid':![],'indexes':[{'name':_0x4ace('0xd'),'fields':[_0x4ace('0xe'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa343=['userProfileId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId'];(function(_0x3cbe21,_0x43fada){var _0x42adcb=function(_0x4c8209){while(--_0x4c8209){_0x3cbe21['push'](_0x3cbe21['shift']());}};_0x42adcb(++_0x43fada);}(_0xa343,0x1a1));var _0x3a34=function(_0x1266f9,_0xbba76f){_0x1266f9=_0x1266f9-0x0;var _0x282acb=_0xa343[_0x1266f9];return _0x282acb;};'use strict';var _=require(_0x3a34('0x0'));var util=require(_0x3a34('0x1'));var logger=require(_0x3a34('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3a34('0x3'));var rp=require(_0x3a34('0x4'));var fs=require('fs');var path=require(_0x3a34('0x5'));var rimraf=require(_0x3a34('0x6'));var config=require(_0x3a34('0x7'));var attributes=require(_0x3a34('0x8'));module[_0x3a34('0x9')]=function(_0x2ad51b,_0xbb8daf){return _0x2ad51b[_0x3a34('0xa')](_0x3a34('0xb'),attributes,{'tableName':_0x3a34('0xc'),'paranoid':![],'indexes':[{'name':_0x3a34('0xd'),'fields':[_0x3a34('0xe'),_0x3a34('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index b483042..19bfdfb 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 _0x03c8=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x241bd4,_0x2d838f){var _0x4649aa=function(_0x90f404){while(--_0x90f404){_0x241bd4['push'](_0x241bd4['shift']());}};_0x4649aa(++_0x2d838f);}(_0x03c8,0x9a));var _0x803c=function(_0x71e0a0,_0x535202){_0x71e0a0=_0x71e0a0-0x0;var _0x3c9254=_0x03c8[_0x71e0a0];return _0x3c9254;};'use strict';var _=require(_0x803c('0x0'));var util=require(_0x803c('0x1'));var moment=require(_0x803c('0x2'));var BPromise=require(_0x803c('0x3'));var rs=require(_0x803c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x803c('0x5'))['db'];var utils=require(_0x803c('0x6'));var logger=require(_0x803c('0x7'))(_0x803c('0x8'));var config=require(_0x803c('0x9'));var jayson=require(_0x803c('0xa'));var client=jayson[_0x803c('0xb')][_0x803c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33670f,_0x585eba,_0x5b826f){return new BPromise(function(_0x60578c,_0x5907cf){return client[_0x803c('0xd')](_0x33670f,_0x5b826f)[_0x803c('0xe')](function(_0x55fb7e){logger[_0x803c('0xf')](_0x803c('0x10'),_0x585eba,_0x803c('0x11'));logger[_0x803c('0x12')](_0x803c('0x13'),_0x585eba,_0x803c('0x11'),JSON[_0x803c('0x14')](_0x55fb7e));if(_0x55fb7e[_0x803c('0x15')]){if(_0x55fb7e[_0x803c('0x15')]['code']===0x1f4){logger['error'](_0x803c('0x10'),_0x585eba,_0x55fb7e[_0x803c('0x15')][_0x803c('0x16')]);return _0x5907cf(_0x55fb7e[_0x803c('0x15')]['message']);}logger[_0x803c('0x15')](_0x803c('0x10'),_0x585eba,_0x55fb7e[_0x803c('0x15')][_0x803c('0x16')]);return _0x60578c(_0x55fb7e[_0x803c('0x15')]['message']);}else{logger[_0x803c('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x585eba,_0x803c('0x11'));_0x60578c(_0x55fb7e[_0x803c('0x17')][_0x803c('0x16')]);}})[_0x803c('0x18')](function(_0x46add1){logger[_0x803c('0x15')]('UserProfileSection,\x20%s,\x20%s',_0x585eba,_0x46add1);_0x5907cf(_0x46add1);});});} \ No newline at end of file +var _0xf2a0=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x503641,_0x33a3cf){var _0x17757d=function(_0xc2ba4e){while(--_0xc2ba4e){_0x503641['push'](_0x503641['shift']());}};_0x17757d(++_0x33a3cf);}(_0xf2a0,0x7d));var _0x0f2a=function(_0xcf82b2,_0x49ab9a){_0xcf82b2=_0xcf82b2-0x0;var _0x4275e9=_0xf2a0[_0xcf82b2];return _0x4275e9;};'use strict';var _=require('lodash');var util=require(_0x0f2a('0x0'));var moment=require(_0x0f2a('0x1'));var BPromise=require(_0x0f2a('0x2'));var rs=require(_0x0f2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f2a('0x4'))['db'];var utils=require(_0x0f2a('0x5'));var logger=require(_0x0f2a('0x6'))('rpc');var config=require(_0x0f2a('0x7'));var jayson=require(_0x0f2a('0x8'));var client=jayson['client'][_0x0f2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bba9e,_0x4c685e,_0xbeb280){return new BPromise(function(_0x4259f4,_0xcca97){return client['request'](_0x3bba9e,_0xbeb280)[_0x0f2a('0xa')](function(_0x45a74b){logger[_0x0f2a('0xb')](_0x0f2a('0xc'),_0x4c685e,_0x0f2a('0xd'));logger['debug'](_0x0f2a('0xe'),_0x4c685e,'request\x20sent',JSON[_0x0f2a('0xf')](_0x45a74b));if(_0x45a74b[_0x0f2a('0x10')]){if(_0x45a74b[_0x0f2a('0x10')][_0x0f2a('0x11')]===0x1f4){logger[_0x0f2a('0x10')](_0x0f2a('0xc'),_0x4c685e,_0x45a74b[_0x0f2a('0x10')][_0x0f2a('0x12')]);return _0xcca97(_0x45a74b[_0x0f2a('0x10')][_0x0f2a('0x12')]);}logger[_0x0f2a('0x10')](_0x0f2a('0xc'),_0x4c685e,_0x45a74b[_0x0f2a('0x10')][_0x0f2a('0x12')]);return _0x4259f4(_0x45a74b[_0x0f2a('0x10')][_0x0f2a('0x12')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x4c685e,_0x0f2a('0xd'));_0x4259f4(_0x45a74b['result'][_0x0f2a('0x12')]);}})[_0x0f2a('0x13')](function(_0x246b43){logger[_0x0f2a('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x4c685e,_0x246b43);_0xcca97(_0x246b43);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 742fc93..f014d28 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x28212b,_0x5badc7){var _0x52dc3c=function(_0x1b3264){while(--_0x1b3264){_0x28212b['push'](_0x28212b['shift']());}};_0x52dc3c(++_0x5badc7);}(_0x70e0,0x17b));var _0x070e=function(_0x1dc32c,_0x505a73){_0x1dc32c=_0x1dc32c-0x0;var _0x4bd5ec=_0x70e0[_0x1dc32c];return _0x4bd5ec;};'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(_0x12dfdd,_0x2fc66c){var _0x17b8c0=function(_0x2f7932){while(--_0x2f7932){_0x12dfdd['push'](_0x12dfdd['shift']());}};_0x17b8c0(++_0x2fc66c);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 933eac7..efc4bc7 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 _0xaaab=['exports','INTEGER','sequelize'];(function(_0x5a0d68,_0x3b661a){var _0x2dee4f=function(_0x3deedc){while(--_0x3deedc){_0x5a0d68['push'](_0x5a0d68['shift']());}};_0x2dee4f(++_0x3b661a);}(_0xaaab,0x11c));var _0xbaaa=function(_0x223a30,_0xc512bc){_0x223a30=_0x223a30-0x0;var _0x11f13e=_0xaaab[_0x223a30];return _0x11f13e;};'use strict';var Sequelize=require(_0xbaaa('0x0'));module[_0xbaaa('0x1')]={'penalty':{'type':Sequelize[_0xbaaa('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd1bd=['sequelize','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1bd,0x8a));var _0xdd1b=function(_0x425d57,_0x4826c8){_0x425d57=_0x425d57-0x0;var _0x254d05=_0xd1bd[_0x425d57];return _0x254d05;};'use strict';var Sequelize=require(_0xdd1b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 12885f6..fc64fe0 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 _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','UserSmsQueue','user_has_sms_queues'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9206,0x176));var _0x6920=function(_0x122747,_0x2234ee){_0x122747=_0x122747-0x0;var _0x4bc06f=_0x9206[_0x122747];return _0x4bc06f;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1a79e3,_0x3ba6b5){var _0x2ec90b=function(_0x591b8e){while(--_0x591b8e){_0x1a79e3['push'](_0x1a79e3['shift']());}};_0x2ec90b(++_0x3ba6b5);}(_0x6050,0x196));var _0x0605=function(_0x1ca34e,_0x3b7269){_0x1ca34e=_0x1ca34e-0x0;var _0x2bd22f=_0x6050[_0x1ca34e];return _0x2bd22f;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 0b0f75d..cfad7dd 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 _0x3c31=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28ee72,_0x25d469){var _0x353553=function(_0x21fbca){while(--_0x21fbca){_0x28ee72['push'](_0x28ee72['shift']());}};_0x353553(++_0x25d469);}(_0x3c31,0x1be));var _0x13c3=function(_0x540269,_0x31c070){_0x540269=_0x540269-0x0;var _0x26713b=_0x3c31[_0x540269];return _0x26713b;};'use strict';var _=require(_0x13c3('0x0'));var util=require(_0x13c3('0x1'));var moment=require(_0x13c3('0x2'));var BPromise=require(_0x13c3('0x3'));var rs=require(_0x13c3('0x4'));var fs=require('fs');var Redis=require(_0x13c3('0x5'));var db=require(_0x13c3('0x6'))['db'];var utils=require(_0x13c3('0x7'));var logger=require(_0x13c3('0x8'))(_0x13c3('0x9'));var config=require(_0x13c3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x13c3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d31d7,_0x4a17b5,_0x10d88a){return new BPromise(function(_0x131bf1,_0x5594d6){return client['request'](_0x5d31d7,_0x10d88a)['then'](function(_0x17f9b9){logger[_0x13c3('0xc')](_0x13c3('0xd'),_0x4a17b5,_0x13c3('0xe'));logger[_0x13c3('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4a17b5,_0x13c3('0xe'),JSON[_0x13c3('0x10')](_0x17f9b9));if(_0x17f9b9['error']){if(_0x17f9b9[_0x13c3('0x11')][_0x13c3('0x12')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x4a17b5,_0x17f9b9[_0x13c3('0x11')][_0x13c3('0x13')]);return _0x5594d6(_0x17f9b9[_0x13c3('0x11')][_0x13c3('0x13')]);}logger[_0x13c3('0x11')](_0x13c3('0xd'),_0x4a17b5,_0x17f9b9['error'][_0x13c3('0x13')]);return _0x131bf1(_0x17f9b9['error']['message']);}else{logger[_0x13c3('0xc')](_0x13c3('0xd'),_0x4a17b5,_0x13c3('0xe'));_0x131bf1(_0x17f9b9[_0x13c3('0x14')]['message']);}})[_0x13c3('0x15')](function(_0x5969ac){logger[_0x13c3('0x11')](_0x13c3('0xd'),_0x4a17b5,_0x5969ac);_0x5594d6(_0x5969ac);});});} \ No newline at end of file +var _0xd18a=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2eefad,_0x378913){var _0x431c35=function(_0x2d504f){while(--_0x2d504f){_0x2eefad['push'](_0x2eefad['shift']());}};_0x431c35(++_0x378913);}(_0xd18a,0x161));var _0xad18=function(_0x506f57,_0x1310b7){_0x506f57=_0x506f57-0x0;var _0x359c6c=_0xd18a[_0x506f57];return _0x359c6c;};'use strict';var _=require(_0xad18('0x0'));var util=require(_0xad18('0x1'));var moment=require('moment');var BPromise=require(_0xad18('0x2'));var rs=require(_0xad18('0x3'));var fs=require('fs');var Redis=require(_0xad18('0x4'));var db=require(_0xad18('0x5'))['db'];var utils=require(_0xad18('0x6'));var logger=require(_0xad18('0x7'))(_0xad18('0x8'));var config=require(_0xad18('0x9'));var jayson=require(_0xad18('0xa'));var client=jayson['client'][_0xad18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4586da,_0x288860,_0x2996fd){return new BPromise(function(_0x10c971,_0xb5db44){return client[_0xad18('0xc')](_0x4586da,_0x2996fd)[_0xad18('0xd')](function(_0xf70997){logger[_0xad18('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x288860,_0xad18('0xf'));logger['debug'](_0xad18('0x10'),_0x288860,_0xad18('0xf'),JSON[_0xad18('0x11')](_0xf70997));if(_0xf70997[_0xad18('0x12')]){if(_0xf70997[_0xad18('0x12')][_0xad18('0x13')]===0x1f4){logger[_0xad18('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x288860,_0xf70997[_0xad18('0x12')][_0xad18('0x14')]);return _0xb5db44(_0xf70997[_0xad18('0x12')]['message']);}logger[_0xad18('0x12')](_0xad18('0x15'),_0x288860,_0xf70997[_0xad18('0x12')][_0xad18('0x14')]);return _0x10c971(_0xf70997[_0xad18('0x12')]['message']);}else{logger[_0xad18('0xe')](_0xad18('0x15'),_0x288860,_0xad18('0xf'));_0x10c971(_0xf70997[_0xad18('0x16')][_0xad18('0x14')]);}})[_0xad18('0x17')](function(_0x251e7a){logger[_0xad18('0x12')](_0xad18('0x15'),_0x288860,_0x251e7a);_0xb5db44(_0x251e7a);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index a6520a2..0c86f52 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 _0x68f9=['INTEGER','sequelize','exports'];(function(_0x5cd7c3,_0x70f967){var _0x3e6e67=function(_0x22d705){while(--_0x22d705){_0x5cd7c3['push'](_0x5cd7c3['shift']());}};_0x3e6e67(++_0x70f967);}(_0x68f9,0x1a5));var _0x968f=function(_0x14c10a,_0x2dbe63){_0x14c10a=_0x14c10a-0x0;var _0x1161bc=_0x68f9[_0x14c10a];return _0x1161bc;};'use strict';var Sequelize=require(_0x968f('0x0'));module[_0x968f('0x1')]={'UserId':{'type':Sequelize[_0x968f('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x968f('0x2')]}}; \ No newline at end of file +var _0xb86f=['sequelize','INTEGER'];(function(_0x22aa48,_0x4f917c){var _0x51dce0=function(_0x15847b){while(--_0x15847b){_0x22aa48['push'](_0x22aa48['shift']());}};_0x51dce0(++_0x4f917c);}(_0xb86f,0x10e));var _0xfb86=function(_0x5d5265,_0x416f73){_0x5d5265=_0x5d5265-0x0;var _0x183831=_0xb86f[_0x5d5265];return _0x183831;};'use strict';var Sequelize=require(_0xfb86('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xfb86('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 1a0e0da..0f340fa 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(_0x3c73c0,_0x35a9ad){var _0x471df8=function(_0x548c1a){while(--_0x548c1a){_0x3c73c0['push'](_0x3c73c0['shift']());}};_0x471df8(++_0x35a9ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x2282ac,_0x3e51b5){var _0x37322b=function(_0x181079){while(--_0x181079){_0x2282ac['push'](_0x2282ac['shift']());}};_0x37322b(++_0x3e51b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 5c13df8..f9c7bcc 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x418f91,_0xea6d17){var _0x455156=function(_0x190707){while(--_0x190707){_0x418f91['push'](_0x418f91['shift']());}};_0x455156(++_0xea6d17);}(_0xedd9,0xfc));var _0x9edd=function(_0x86f0ec,_0x293318){_0x86f0ec=_0x86f0ec-0x0;var _0x1ab5e9=_0xedd9[_0x86f0ec];return _0x1ab5e9;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x11dbbe,_0x7b04d3){var _0x475061=function(_0x3677d3){while(--_0x3677d3){_0x11dbbe['push'](_0x11dbbe['shift']());}};_0x475061(++_0x7b04d3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 6690412..6d175c7 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 _0x737d=['sequelize','exports'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x737d,0xbc));var _0xd737=function(_0xf6215f,_0x156db1){_0xf6215f=_0xf6215f-0x0;var _0x1b99f3=_0x737d[_0xf6215f];return _0x1b99f3;};'use strict';var Sequelize=require(_0xd737('0x0'));module[_0xd737('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3d94=['INTEGER','exports'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x3d94,0xd7));var _0x43d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d94[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x43d9('0x0')]={'penalty':{'type':Sequelize[_0x43d9('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 b5dc429..c276f9b 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 _0xb013=['exports','define','user_has_voice_queues','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb013,0x1a7));var _0x3b01=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xb013[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3b01('0x0'))(_0x3b01('0x1'));var moment=require('moment');var BPromise=require(_0x3b01('0x2'));var rp=require(_0x3b01('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b01('0x4'));var config=require(_0x3b01('0x5'));var attributes=require(_0x3b01('0x6'));module[_0x3b01('0x7')]=function(_0x127a94,_0x39cfb6){return _0x127a94[_0x3b01('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x3b01('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8347=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x2b3023,_0x194fe6){var _0x24a20e=function(_0x3bc312){while(--_0x3bc312){_0x2b3023['push'](_0x2b3023['shift']());}};_0x24a20e(++_0x194fe6);}(_0x8347,0x1ad));var _0x7834=function(_0x3d11bd,_0x3534e7){_0x3d11bd=_0x3d11bd-0x0;var _0x1c1e0e=_0x8347[_0x3d11bd];return _0x1c1e0e;};'use strict';var _=require(_0x7834('0x0'));var util=require(_0x7834('0x1'));var logger=require(_0x7834('0x2'))(_0x7834('0x3'));var moment=require(_0x7834('0x4'));var BPromise=require(_0x7834('0x5'));var rp=require(_0x7834('0x6'));var fs=require('fs');var path=require(_0x7834('0x7'));var rimraf=require(_0x7834('0x8'));var config=require(_0x7834('0x9'));var attributes=require('./userVoiceQueue.attributes');module[_0x7834('0xa')]=function(_0x2360bf,_0xbfb40f){return _0x2360bf[_0x7834('0xb')](_0x7834('0xc'),attributes,{'tableName':_0x7834('0xd'),'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 c5123c3..44af248 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 _0xff16=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff16,0x14e));var _0x6ff1=function(_0x3d3656,_0x1d8ba4){_0x3d3656=_0x3d3656-0x0;var _0xdf80b4=_0xff16[_0x3d3656];return _0xdf80b4;};'use strict';var _=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var moment=require('moment');var BPromise=require(_0x6ff1('0x2'));var rs=require(_0x6ff1('0x3'));var fs=require('fs');var Redis=require(_0x6ff1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ff1('0x5'));var logger=require(_0x6ff1('0x6'))(_0x6ff1('0x7'));var config=require('../../config/environment');var jayson=require(_0x6ff1('0x8'));var client=jayson[_0x6ff1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e59d3,_0x4b7d67,_0x250a43){return new BPromise(function(_0x3c8901,_0x55ddea){return client[_0x6ff1('0xa')](_0x3e59d3,_0x250a43)['then'](function(_0x24928e){logger[_0x6ff1('0xb')](_0x6ff1('0xc'),_0x4b7d67,_0x6ff1('0xd'));logger[_0x6ff1('0xe')](_0x6ff1('0xf'),_0x4b7d67,_0x6ff1('0xd'),JSON[_0x6ff1('0x10')](_0x24928e));if(_0x24928e[_0x6ff1('0x11')]){if(_0x24928e[_0x6ff1('0x11')][_0x6ff1('0x12')]===0x1f4){logger['error'](_0x6ff1('0xc'),_0x4b7d67,_0x24928e[_0x6ff1('0x11')][_0x6ff1('0x13')]);return _0x55ddea(_0x24928e[_0x6ff1('0x11')][_0x6ff1('0x13')]);}logger[_0x6ff1('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x4b7d67,_0x24928e[_0x6ff1('0x11')][_0x6ff1('0x13')]);return _0x3c8901(_0x24928e['error']['message']);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x4b7d67,_0x6ff1('0xd'));_0x3c8901(_0x24928e[_0x6ff1('0x14')][_0x6ff1('0x13')]);}})[_0x6ff1('0x15')](function(_0x4ae9d8){logger['error'](_0x6ff1('0xc'),_0x4b7d67,_0x4ae9d8);_0x55ddea(_0x4ae9d8);});});} \ No newline at end of file +var _0xf24b=['UserVoiceQueue,\x20%s,\x20%s','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0xf24b,0xad));var _0xbf24=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xf24b[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0xbf24('0x0'));var util=require(_0xbf24('0x1'));var moment=require(_0xbf24('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf24('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf24('0x4'))['db'];var utils=require(_0xbf24('0x5'));var logger=require('../../config/logger')(_0xbf24('0x6'));var config=require(_0xbf24('0x7'));var jayson=require(_0xbf24('0x8'));var client=jayson[_0xbf24('0x9')][_0xbf24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dd757,_0x10ae5f,_0x3e983e){return new BPromise(function(_0x455e1e,_0x519ad7){return client['request'](_0x4dd757,_0x3e983e)[_0xbf24('0xb')](function(_0x3a94e7){logger[_0xbf24('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x10ae5f,_0xbf24('0xd'));logger['debug'](_0xbf24('0xe'),_0x10ae5f,'request\x20sent',JSON['stringify'](_0x3a94e7));if(_0x3a94e7[_0xbf24('0xf')]){if(_0x3a94e7[_0xbf24('0xf')]['code']===0x1f4){logger[_0xbf24('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x10ae5f,_0x3a94e7[_0xbf24('0xf')][_0xbf24('0x10')]);return _0x519ad7(_0x3a94e7[_0xbf24('0xf')][_0xbf24('0x10')]);}logger['error'](_0xbf24('0x11'),_0x10ae5f,_0x3a94e7[_0xbf24('0xf')]['message']);return _0x455e1e(_0x3a94e7['error'][_0xbf24('0x10')]);}else{logger[_0xbf24('0xc')](_0xbf24('0x11'),_0x10ae5f,_0xbf24('0xd'));_0x455e1e(_0x3a94e7[_0xbf24('0x12')][_0xbf24('0x10')]);}})['catch'](function(_0x188217){logger['error'](_0xbf24('0x11'),_0x10ae5f,_0x188217);_0x519ad7(_0x188217);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 7c1b2e6..7199a43 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xc376e1,_0x1a2b83){var _0x63e01c=function(_0x3cd0f8){while(--_0x3cd0f8){_0xc376e1['push'](_0xc376e1['shift']());}};_0x63e01c(++_0x1a2b83);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x411c2e,_0x4ece66){var _0x5ed361=function(_0x193b6c){while(--_0x193b6c){_0x411c2e['push'](_0x411c2e['shift']());}};_0x5ed361(++_0x4ece66);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 3288c89..0eb03b9 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 _0x711a=['sequelize','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x4f0159,_0xaf2d85){var _0x2b53a8=function(_0x34e528){while(--_0x34e528){_0x4f0159['push'](_0x4f0159['shift']());}};_0x2b53a8(++_0xaf2d85);}(_0x711a,0x14a));var _0xa711=function(_0x37ca5a,_0xd4ca7c){_0x37ca5a=_0x37ca5a-0x0;var _0x8ef34d=_0x711a[_0x37ca5a];return _0x8ef34d;};'use strict';var Sequelize=require(_0xa711('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa711('0x1')},'membername':{'type':Sequelize[_0xa711('0x2')],'allowNull':![],'comment':_0xa711('0x1')},'UserId':{'type':Sequelize[_0xa711('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa711('0x2')],'allowNull':![],'unique':_0xa711('0x4'),'comment':_0xa711('0x1')},'VoiceQueueId':{'type':Sequelize[_0xa711('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xa711('0x2')],'allowNull':![],'unique':_0xa711('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xa711('0x3')](0xb),'defaultValue':0x0,'comment':_0xa711('0x1')},'paused':{'type':Sequelize[_0xa711('0x3')](0xb),'defaultValue':0x0,'comment':_0xa711('0x1')}}; \ No newline at end of file +var _0x15cd=['queue_interface','sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15cd,0xfd));var _0xd15c=function(_0x5bb488,_0x405570){_0x5bb488=_0x5bb488-0x0;var _0x3a541a=_0x15cd[_0x5bb488];return _0x3a541a;};'use strict';var Sequelize=require(_0xd15c('0x0'));module[_0xd15c('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd15c('0x2')},'membername':{'type':Sequelize[_0xd15c('0x3')],'allowNull':![],'comment':_0xd15c('0x2')},'UserId':{'type':Sequelize[_0xd15c('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd15c('0x3')],'allowNull':![],'unique':_0xd15c('0x5'),'comment':_0xd15c('0x2')},'VoiceQueueId':{'type':Sequelize[_0xd15c('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0xd15c('0x3')],'allowNull':![],'unique':_0xd15c('0x5'),'comment':_0xd15c('0x2')},'penalty':{'type':Sequelize[_0xd15c('0x4')](0xb),'defaultValue':0x0,'comment':_0xd15c('0x2')},'paused':{'type':Sequelize[_0xd15c('0x4')](0xb),'defaultValue':0x0,'comment':_0xd15c('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index c756f1b..c6229a2 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 _0x41b7=['emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','save','update','remove'];(function(_0x5a89ec,_0xe05b7d){var _0x27fb02=function(_0x2406ed){while(--_0x2406ed){_0x5a89ec['push'](_0x5a89ec['shift']());}};_0x27fb02(++_0xe05b7d);}(_0x41b7,0x186));var _0x741b=function(_0xd4ea1d,_0x4502ff){_0xd4ea1d=_0xd4ea1d-0x0;var _0xd28cc7=_0x41b7[_0xd4ea1d];return _0xd28cc7;};'use strict';var EventEmitter=require(_0x741b('0x0'));var UserVoiceQueueRt=require(_0x741b('0x1'))['db'][_0x741b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x741b('0x3'),'afterUpdate':_0x741b('0x4'),'afterDestroy':_0x741b('0x5')};function emitEvent(_0x34a24a){return function(_0x3bfe03,_0x35eb6e,_0x239870){UserVoiceQueueRtEvents[_0x741b('0x6')](_0x34a24a+':'+_0x3bfe03['id'],_0x3bfe03);UserVoiceQueueRtEvents['emit'](_0x34a24a,_0x3bfe03);_0x239870(null);};}for(var e in events){if(events[_0x741b('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x741b('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x01c3=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x01c3,0xc5));var _0x301c=function(_0x3b836e,_0x1071de){_0x3b836e=_0x3b836e-0x0;var _0x171999=_0x01c3[_0x3b836e];return _0x171999;};'use strict';var EventEmitter=require(_0x301c('0x0'));var UserVoiceQueueRt=require(_0x301c('0x1'))['db'][_0x301c('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x301c('0x3')](0x0);var events={'afterCreate':_0x301c('0x4'),'afterUpdate':_0x301c('0x5'),'afterDestroy':_0x301c('0x6')};function emitEvent(_0x18d229){return function(_0x20c02e,_0x1d2331,_0xc5f68f){UserVoiceQueueRtEvents[_0x301c('0x7')](_0x18d229+':'+_0x20c02e['id'],_0x20c02e);UserVoiceQueueRtEvents[_0x301c('0x7')](_0x18d229,_0x20c02e);_0xc5f68f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x301c('0x8')](e,emitEvent(event));}}module[_0x301c('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 deb9b14..3fba496 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 _0x629d=['UserVoiceQueueRt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x629d,0x155));var _0xd629=function(_0x3e0600,_0x9bb3c9){_0x3e0600=_0x3e0600-0x0;var _0x5e1117=_0x629d[_0x3e0600];return _0x5e1117;};'use strict';var _=require(_0xd629('0x0'));var util=require(_0xd629('0x1'));var logger=require(_0xd629('0x2'))('api');var moment=require(_0xd629('0x3'));var BPromise=require(_0xd629('0x4'));var rp=require(_0xd629('0x5'));var fs=require('fs');var path=require(_0xd629('0x6'));var rimraf=require('rimraf');var config=require(_0xd629('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xd629('0x8')]=function(_0x565629,_0x3b0b3b){return _0x565629['define'](_0xd629('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3397=['path','rimraf','../../config/environment','define','UserVoiceQueueRt','lodash','moment','bluebird'];(function(_0x5271af,_0x1bdaf9){var _0xa07929=function(_0x46ba1a){while(--_0x46ba1a){_0x5271af['push'](_0x5271af['shift']());}};_0xa07929(++_0x1bdaf9);}(_0x3397,0x1c5));var _0x7339=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0x3397[_0x5550b3];return _0x4b8fc4;};'use strict';var _=require(_0x7339('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7339('0x1'));var BPromise=require(_0x7339('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7339('0x3'));var rimraf=require(_0x7339('0x4'));var config=require(_0x7339('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x395b36,_0x1ab592){return _0x395b36[_0x7339('0x6')](_0x7339('0x7'),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 3132588..c32a1d5 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 _0xc5b9=['stringify','error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','sequelize','`paused`\x20=\x201,\x201,\x20null','debug','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2f6dfe,_0x115dab){var _0x5e5c9c=function(_0x502840){while(--_0x502840){_0x2f6dfe['push'](_0x2f6dfe['shift']());}};_0x5e5c9c(++_0x115dab);}(_0xc5b9,0x96));var _0x9c5b=function(_0x36e62e,_0x5ce95e){_0x36e62e=_0x36e62e-0x0;var _0x5abf1f=_0xc5b9[_0x36e62e];return _0x5abf1f;};'use strict';var _=require(_0x9c5b('0x0'));var util=require(_0x9c5b('0x1'));var moment=require(_0x9c5b('0x2'));var BPromise=require(_0x9c5b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c5b('0x4'))['db'];var utils=require(_0x9c5b('0x5'));var logger=require(_0x9c5b('0x6'))(_0x9c5b('0x7'));var config=require(_0x9c5b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c5b('0x9')][_0x9c5b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x9c5b('0xb'),'port':0x18eb});var socket=require(_0x9c5b('0xc'))(new Redis(config[_0x9c5b('0xd')]));require(_0x9c5b('0xe'))['register'](socket);function respondWithRpcPromise(_0x5af351,_0x2c5392,_0x23d59a){return new BPromise(function(_0x34f440,_0x15babc){return client['request'](_0x5af351,_0x23d59a)[_0x9c5b('0xf')](function(_0x14ff25){logger[_0x9c5b('0x10')](_0x9c5b('0x11'),_0x2c5392,'request\x20sent');logger['debug'](_0x9c5b('0x12'),_0x2c5392,_0x9c5b('0x13'),JSON[_0x9c5b('0x14')](_0x14ff25));if(_0x14ff25[_0x9c5b('0x15')]){if(_0x14ff25[_0x9c5b('0x15')][_0x9c5b('0x16')]===0x1f4){logger[_0x9c5b('0x15')](_0x9c5b('0x11'),_0x2c5392,_0x14ff25[_0x9c5b('0x15')][_0x9c5b('0x17')]);return _0x15babc(_0x14ff25['error']['message']);}logger[_0x9c5b('0x15')](_0x9c5b('0x11'),_0x2c5392,_0x14ff25[_0x9c5b('0x15')][_0x9c5b('0x17')]);return _0x34f440(_0x14ff25[_0x9c5b('0x15')][_0x9c5b('0x17')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2c5392,'request\x20sent');_0x34f440(_0x14ff25[_0x9c5b('0x18')]['message']);}})[_0x9c5b('0x19')](function(_0x55ff81){logger[_0x9c5b('0x15')](_0x9c5b('0x11'),_0x2c5392,_0x55ff81);_0x15babc(_0x55ff81);});});}exports['GetVoiceQueueRtPauses']=function(_0x18d43f){var _0xaf33c4=this;return new Promise(function(_0x6d7075,_0x18fe10){return db[_0x9c5b('0x1a')][_0x9c5b('0x1b')]({'raw':_0x18d43f[_0x9c5b('0x1c')]?_0x18d43f['options'][_0x9c5b('0x1d')]===undefined?!![]:![]:!![],'where':_0x18d43f[_0x9c5b('0x1c')]?_0x18d43f['options']['where']||null:null,'attributes':[[db[_0x9c5b('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x9c5b('0x1f')))),'outboundQueuePauses']]})[_0x9c5b('0xf')](function(_0x3742d6){logger[_0x9c5b('0x10')]('GetVoiceQueueRtPauses',_0x18d43f);logger[_0x9c5b('0x20')](_0x9c5b('0x21'),_0x18d43f,JSON[_0x9c5b('0x14')](_0x3742d6));_0x6d7075(_0x3742d6);})[_0x9c5b('0x19')](function(_0x21ccaa){logger[_0x9c5b('0x15')](_0x9c5b('0x21'),_0x21ccaa[_0x9c5b('0x17')],_0x18d43f);_0x18fe10(_0xaf33c4[_0x9c5b('0x15')](0x1f4,_0x21ccaa[_0x9c5b('0x17')]));});});}; \ No newline at end of file +var _0x1972=['client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x23516c,_0x16ea34){var _0x591310=function(_0x428292){while(--_0x428292){_0x23516c['push'](_0x23516c['shift']());}};_0x591310(++_0x16ea34);}(_0x1972,0x1c0));var _0x2197=function(_0x30fb43,_0x5b4cfb){_0x30fb43=_0x30fb43-0x0;var _0x56f3b5=_0x1972[_0x30fb43];return _0x56f3b5;};'use strict';var _=require('lodash');var util=require(_0x2197('0x0'));var moment=require(_0x2197('0x1'));var BPromise=require(_0x2197('0x2'));var rs=require(_0x2197('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2197('0x4'))['db'];var utils=require(_0x2197('0x5'));var logger=require(_0x2197('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2197('0x7')][_0x2197('0x8')]({'port':0x232a});config[_0x2197('0x9')]=_[_0x2197('0xa')](config[_0x2197('0x9')],{'host':_0x2197('0xb'),'port':0x18eb});var socket=require(_0x2197('0xc'))(new Redis(config['redis']));require(_0x2197('0xd'))[_0x2197('0xe')](socket);function respondWithRpcPromise(_0x3811ff,_0x11f49b,_0x37da4e){return new BPromise(function(_0x7ac217,_0x321ae2){return client[_0x2197('0xf')](_0x3811ff,_0x37da4e)[_0x2197('0x10')](function(_0x596b2c){logger[_0x2197('0x11')](_0x2197('0x12'),_0x11f49b,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x11f49b,_0x2197('0x13'),JSON[_0x2197('0x14')](_0x596b2c));if(_0x596b2c[_0x2197('0x15')]){if(_0x596b2c[_0x2197('0x15')][_0x2197('0x16')]===0x1f4){logger['error'](_0x2197('0x12'),_0x11f49b,_0x596b2c[_0x2197('0x15')]['message']);return _0x321ae2(_0x596b2c[_0x2197('0x15')][_0x2197('0x17')]);}logger[_0x2197('0x15')](_0x2197('0x12'),_0x11f49b,_0x596b2c[_0x2197('0x15')][_0x2197('0x17')]);return _0x7ac217(_0x596b2c['error'][_0x2197('0x17')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x11f49b,'request\x20sent');_0x7ac217(_0x596b2c[_0x2197('0x18')][_0x2197('0x17')]);}})[_0x2197('0x19')](function(_0x131c49){logger[_0x2197('0x15')](_0x2197('0x12'),_0x11f49b,_0x131c49);_0x321ae2(_0x131c49);});});}exports[_0x2197('0x1a')]=function(_0x41c28b){var _0xa0f38=this;return new Promise(function(_0x4dc295,_0x3d8a26){return db[_0x2197('0x1b')]['findAll']({'raw':_0x41c28b[_0x2197('0x1c')]?_0x41c28b[_0x2197('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x41c28b[_0x2197('0x1c')]?_0x41c28b['options'][_0x2197('0x1d')]||null:null,'attributes':[[db[_0x2197('0x1e')]['fn'](_0x2197('0x1f'),db['sequelize']['fn']('IF',db[_0x2197('0x1e')]['literal'](_0x2197('0x20')))),_0x2197('0x21')]]})[_0x2197('0x10')](function(_0x1fcd31){logger['info']('GetVoiceQueueRtPauses',_0x41c28b);logger[_0x2197('0x22')]('GetVoiceQueueRtPauses',_0x41c28b,JSON[_0x2197('0x14')](_0x1fcd31));_0x4dc295(_0x1fcd31);})[_0x2197('0x19')](function(_0x93804e){logger['error'](_0x2197('0x1a'),_0x93804e['message'],_0x41c28b);_0x3d8a26(_0xa0f38['error'](0x1f4,_0x93804e[_0x2197('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 3a4daa8..6f95283 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 _0x9ab0=['save','remove','update','emit','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x1b3e99,_0x27994d){var _0x268957=function(_0x11fd51){while(--_0x11fd51){_0x1b3e99['push'](_0x1b3e99['shift']());}};_0x268957(++_0x27994d);}(_0x9ab0,0x195));var _0x09ab=function(_0x3224b4,_0x504d64){_0x3224b4=_0x3224b4-0x0;var _0x4c2412=_0x9ab0[_0x3224b4];return _0x4c2412;};'use strict';var UserVoiceQueueRtEvents=require(_0x09ab('0x0'));var events=[_0x09ab('0x1'),_0x09ab('0x2'),_0x09ab('0x3')];function createListener(_0x38fee4,_0x428fc1){return function(_0x38c30a){_0x428fc1[_0x09ab('0x4')](_0x38fee4,_0x38c30a);};}function removeListener(_0x3c0cd0,_0x4bb59a){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3c0cd0,_0x4bb59a);};}exports['register']=function(_0x3144ec){for(var _0x387ac8=0x0,_0x241bd1=events[_0x09ab('0x5')];_0x387ac8<_0x241bd1;_0x387ac8++){var _0x610663=events[_0x387ac8];var _0x464d64=createListener(_0x09ab('0x6')+_0x610663,_0x3144ec);UserVoiceQueueRtEvents['on'](_0x610663,_0x464d64);}}; \ No newline at end of file +var _0x2d95=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2d95,0xca));var _0x52d9=function(_0x368d4c,_0x168710){_0x368d4c=_0x368d4c-0x0;var _0x16bca8=_0x2d95[_0x368d4c];return _0x16bca8;};'use strict';var UserVoiceQueueRtEvents=require(_0x52d9('0x0'));var events=['save',_0x52d9('0x1'),'update'];function createListener(_0x2d961b,_0x14ee56){return function(_0x4206cb){_0x14ee56['emit'](_0x2d961b,_0x4206cb);};}function removeListener(_0x323dcd,_0x7aff8f){return function(){UserVoiceQueueRtEvents[_0x52d9('0x2')](_0x323dcd,_0x7aff8f);};}exports[_0x52d9('0x3')]=function(_0x16eb99){for(var _0x2735cc=0x0,_0x3b3202=events[_0x52d9('0x4')];_0x2735cc<_0x3b3202;_0x2735cc++){var _0x27d7cd=events[_0x2735cc];var _0x45cf52=createListener(_0x52d9('0x5')+_0x27d7cd,_0x16eb99);UserVoiceQueueRtEvents['on'](_0x27d7cd,_0x45cf52);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 6e38b1c..4911072 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x38a958,_0x11a0a5){var _0x52008b=function(_0xccbeb3){while(--_0xccbeb3){_0x38a958['push'](_0x38a958['shift']());}};_0x52008b(++_0x11a0a5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0xcb91[_0x1ebe90];return _0x447c82;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x49c7dc,_0xd081b6){var _0xba7793=function(_0x462fb2){while(--_0x462fb2){_0x49c7dc['push'](_0x49c7dc['shift']());}};_0xba7793(++_0xd081b6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 1bdfcee..7f22b78 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 _0x6b93=['exports','INTEGER','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6b93,0x146));var _0x36b9=function(_0x51f080,_0x49393b){_0x51f080=_0x51f080-0x0;var _0x2e787e=_0x6b93[_0x51f080];return _0x2e787e;};'use strict';var Sequelize=require(_0x36b9('0x0'));module[_0x36b9('0x1')]={'penalty':{'type':Sequelize[_0x36b9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5aaa=['exports'];(function(_0x91644a,_0x49d2c2){var _0x852339=function(_0x38d717){while(--_0x38d717){_0x91644a['push'](_0x91644a['shift']());}};_0x852339(++_0x49d2c2);}(_0x5aaa,0x119));var _0xa5aa=function(_0x3eb8ed,_0x544fbd){_0x3eb8ed=_0x3eb8ed-0x0;var _0x589ad4=_0x5aaa[_0x3eb8ed];return _0x589ad4;};'use strict';var Sequelize=require('sequelize');module[_0xa5aa('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index e54122c..9d8bf9c 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 _0x090b=['path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','lodash','util','../../config/logger','api','bluebird'];(function(_0x11ce0d,_0xd96861){var _0x420590=function(_0x411567){while(--_0x411567){_0x11ce0d['push'](_0x11ce0d['shift']());}};_0x420590(++_0xd96861);}(_0x090b,0x69));var _0xb090=function(_0x5af018,_0x2602b0){_0x5af018=_0x5af018-0x0;var _0x8dc3c2=_0x090b[_0x5af018];return _0x8dc3c2;};'use strict';var _=require(_0xb090('0x0'));var util=require(_0xb090('0x1'));var logger=require(_0xb090('0x2'))(_0xb090('0x3'));var moment=require('moment');var BPromise=require(_0xb090('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb090('0x5'));var rimraf=require(_0xb090('0x6'));var config=require(_0xb090('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xb090('0x8')]=function(_0x7f7ebb,_0x170765){return _0x7f7ebb[_0xb090('0x9')](_0xb090('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2096=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x2096,0x8c));var _0x6209=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x2096[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require(_0x6209('0x0'));var logger=require(_0x6209('0x1'))(_0x6209('0x2'));var moment=require(_0x6209('0x3'));var BPromise=require(_0x6209('0x4'));var rp=require(_0x6209('0x5'));var fs=require('fs');var path=require(_0x6209('0x6'));var rimraf=require(_0x6209('0x7'));var config=require('../../config/environment');var attributes=require(_0x6209('0x8'));module[_0x6209('0x9')]=function(_0x1d1dca,_0x24989e){return _0x1d1dca['define']('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','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 38eb564..862581d 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 _0x9357=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x21dc56,_0x421fd3){var _0x296f3d=function(_0x28a4ec){while(--_0x28a4ec){_0x21dc56['push'](_0x21dc56['shift']());}};_0x296f3d(++_0x421fd3);}(_0x9357,0x1e1));var _0x7935=function(_0x405824,_0x384cef){_0x405824=_0x405824-0x0;var _0x1da731=_0x9357[_0x405824];return _0x1da731;};'use strict';var _=require(_0x7935('0x0'));var util=require(_0x7935('0x1'));var moment=require(_0x7935('0x2'));var BPromise=require(_0x7935('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7935('0x4'));var db=require(_0x7935('0x5'))['db'];var utils=require(_0x7935('0x6'));var logger=require(_0x7935('0x7'))(_0x7935('0x8'));var config=require(_0x7935('0x9'));var jayson=require(_0x7935('0xa'));var client=jayson[_0x7935('0xb')][_0x7935('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe62b4f,_0x50fb3a,_0x205c04){return new BPromise(function(_0x1b7d68,_0x36469d){return client[_0x7935('0xd')](_0xe62b4f,_0x205c04)[_0x7935('0xe')](function(_0x2fce37){logger[_0x7935('0xf')](_0x7935('0x10'),_0x50fb3a,_0x7935('0x11'));logger[_0x7935('0x12')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x50fb3a,_0x7935('0x11'),JSON[_0x7935('0x13')](_0x2fce37));if(_0x2fce37['error']){if(_0x2fce37[_0x7935('0x14')][_0x7935('0x15')]===0x1f4){logger[_0x7935('0x14')](_0x7935('0x10'),_0x50fb3a,_0x2fce37['error'][_0x7935('0x16')]);return _0x36469d(_0x2fce37['error'][_0x7935('0x16')]);}logger[_0x7935('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x50fb3a,_0x2fce37[_0x7935('0x14')][_0x7935('0x16')]);return _0x1b7d68(_0x2fce37[_0x7935('0x14')][_0x7935('0x16')]);}else{logger[_0x7935('0xf')](_0x7935('0x10'),_0x50fb3a,'request\x20sent');_0x1b7d68(_0x2fce37[_0x7935('0x17')][_0x7935('0x16')]);}})[_0x7935('0x18')](function(_0x11baa0){logger[_0x7935('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x50fb3a,_0x11baa0);_0x36469d(_0x11baa0);});});} \ No newline at end of file +var _0x47f9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x1ca634,_0x5e6c10){var _0x10dc1e=function(_0x5acf48){while(--_0x5acf48){_0x1ca634['push'](_0x1ca634['shift']());}};_0x10dc1e(++_0x5e6c10);}(_0x47f9,0x85));var _0x947f=function(_0x486df7,_0x5f803a){_0x486df7=_0x486df7-0x0;var _0x3c0d43=_0x47f9[_0x486df7];return _0x3c0d43;};'use strict';var _=require(_0x947f('0x0'));var util=require(_0x947f('0x1'));var moment=require(_0x947f('0x2'));var BPromise=require(_0x947f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x947f('0x4'));var db=require(_0x947f('0x5'))['db'];var utils=require(_0x947f('0x6'));var logger=require(_0x947f('0x7'))(_0x947f('0x8'));var config=require(_0x947f('0x9'));var jayson=require(_0x947f('0xa'));var client=jayson[_0x947f('0xb')][_0x947f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d0dd0,_0x30af14,_0x1e47c6){return new BPromise(function(_0x677360,_0xe93d0c){return client['request'](_0x3d0dd0,_0x1e47c6)[_0x947f('0xd')](function(_0x27a71d){logger[_0x947f('0xe')](_0x947f('0xf'),_0x30af14,_0x947f('0x10'));logger[_0x947f('0x11')](_0x947f('0x12'),_0x30af14,_0x947f('0x10'),JSON['stringify'](_0x27a71d));if(_0x27a71d[_0x947f('0x13')]){if(_0x27a71d[_0x947f('0x13')][_0x947f('0x14')]===0x1f4){logger[_0x947f('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x30af14,_0x27a71d[_0x947f('0x13')][_0x947f('0x15')]);return _0xe93d0c(_0x27a71d[_0x947f('0x13')][_0x947f('0x15')]);}logger[_0x947f('0x13')](_0x947f('0xf'),_0x30af14,_0x27a71d[_0x947f('0x13')][_0x947f('0x15')]);return _0x677360(_0x27a71d['error'][_0x947f('0x15')]);}else{logger[_0x947f('0xe')](_0x947f('0xf'),_0x30af14,'request\x20sent');_0x677360(_0x27a71d['result'][_0x947f('0x15')]);}})[_0x947f('0x16')](function(_0x1101eb){logger['error'](_0x947f('0xf'),_0x30af14,_0x1101eb);_0xe93d0c(_0x1101eb);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ed0bc7f..74611c4 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 _0x86dd=['isAuthenticated','index','show','create','put','/:id','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get'];(function(_0x4e713e,_0x1ac682){var _0x296ac0=function(_0x26a297){while(--_0x26a297){_0x4e713e['push'](_0x4e713e['shift']());}};_0x296ac0(++_0x1ac682);}(_0x86dd,0x1ee));var _0xd86d=function(_0x3b33b1,_0x3494bc){_0x3b33b1=_0x3b33b1-0x0;var _0x4330ab=_0x86dd[_0x3b33b1];return _0x4330ab;};'use strict';var multer=require('multer');var util=require(_0xd86d('0x0'));var path=require('path');var timeout=require(_0xd86d('0x1'));var express=require(_0xd86d('0x2'));var router=express[_0xd86d('0x3')]();var fs_extra=require(_0xd86d('0x4'));var auth=require(_0xd86d('0x5'));var interaction=require(_0xd86d('0x6'));var config=require(_0xd86d('0x7'));var controller=require(_0xd86d('0x8'));router[_0xd86d('0x9')]('/',auth[_0xd86d('0xa')](),controller[_0xd86d('0xb')]);router[_0xd86d('0x9')]('/:id',auth[_0xd86d('0xa')](),controller[_0xd86d('0xc')]);router['post']('/',auth[_0xd86d('0xa')](),controller[_0xd86d('0xd')]);router[_0xd86d('0xe')](_0xd86d('0xf'),auth['isAuthenticated'](),controller[_0xd86d('0x10')]);router[_0xd86d('0x11')](_0xd86d('0xf'),auth[_0xd86d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd4d1=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./variable.controller','isAuthenticated','index','get','post','create'];(function(_0xa049b2,_0x176ae0){var _0x10c432=function(_0x4174fc){while(--_0x4174fc){_0xa049b2['push'](_0xa049b2['shift']());}};_0x10c432(++_0x176ae0);}(_0xd4d1,0x123));var _0x1d4d=function(_0x196553,_0x125e14){_0x196553=_0x196553-0x0;var _0x347c85=_0xd4d1[_0x196553];return _0x347c85;};'use strict';var multer=require(_0x1d4d('0x0'));var util=require(_0x1d4d('0x1'));var path=require(_0x1d4d('0x2'));var timeout=require(_0x1d4d('0x3'));var express=require(_0x1d4d('0x4'));var router=express['Router']();var fs_extra=require(_0x1d4d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1d4d('0x6'));var config=require('../../config/environment');var controller=require(_0x1d4d('0x7'));router['get']('/',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x9')]);router[_0x1d4d('0xa')]('/:id',auth[_0x1d4d('0x8')](),controller['show']);router[_0x1d4d('0xb')]('/',auth['isAuthenticated'](),controller[_0x1d4d('0xc')]);router[_0x1d4d('0xd')](_0x1d4d('0xe'),auth['isAuthenticated'](),controller[_0x1d4d('0xf')]);router[_0x1d4d('0x10')](_0x1d4d('0xe'),auth['isAuthenticated'](),controller[_0x1d4d('0x11')]);module[_0x1d4d('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index b8f216e..8c2e939 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 _0x0631=['name','sequelize','STRING'];(function(_0x5d92d2,_0x399d73){var _0x5e6d11=function(_0x5029a2){while(--_0x5029a2){_0x5d92d2['push'](_0x5d92d2['shift']());}};_0x5e6d11(++_0x399d73);}(_0x0631,0xcd));var _0x1063=function(_0x5a4b2b,_0x210f4e){_0x5a4b2b=_0x5a4b2b-0x0;var _0x290f97=_0x0631[_0x5a4b2b];return _0x290f97;};'use strict';var Sequelize=require(_0x1063('0x0'));module['exports']={'name':{'type':Sequelize[_0x1063('0x1')],'unique':_0x1063('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe476=['STRING'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xe476,0x95));var _0x6e47=function(_0x9c84a2,_0x5bfa5b){_0x9c84a2=_0x9c84a2-0x0;var _0x5580db=_0xe476[_0x9c84a2];return _0x5580db;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6e47('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6e47('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 37a5b97..c093846 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 _0xa781=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','Variable','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','find'];(function(_0x2b6fa4,_0x405df5){var _0x4cbfc3=function(_0x262771){while(--_0x262771){_0x2b6fa4['push'](_0x2b6fa4['shift']());}};_0x4cbfc3(++_0x405df5);}(_0xa781,0x154));var _0x1a78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa781[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1a78('0x0'));var rimraf=require(_0x1a78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a78('0x2'));var rp=require(_0x1a78('0x3'));var moment=require(_0x1a78('0x4'));var BPromise=require(_0x1a78('0x5'));var Mustache=require(_0x1a78('0x6'));var util=require(_0x1a78('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1a78('0x8'));var ejs=require(_0x1a78('0x9'));var fs=require('fs');var fs_extra=require(_0x1a78('0xa'));var _=require(_0x1a78('0xb'));var squel=require(_0x1a78('0xc'));var crypto=require(_0x1a78('0xd'));var jsforce=require(_0x1a78('0xe'));var deskjs=require(_0x1a78('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1a78('0x10'));var Papa=require(_0x1a78('0x11'));var Redis=require(_0x1a78('0x12'));var authService=require(_0x1a78('0x13'));var qs=require(_0x1a78('0x14'));var as=require(_0x1a78('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a78('0x16'))(_0x1a78('0x17'));var utils=require(_0x1a78('0x18'));var config=require(_0x1a78('0x19'));var licenseUtil=require(_0x1a78('0x1a'));var db=require(_0x1a78('0x1b'))['db'];function respondWithStatusCode(_0x16d7d4,_0x3cd457){_0x3cd457=_0x3cd457||0xcc;return function(_0x5eabbd){if(_0x5eabbd){return _0x16d7d4['sendStatus'](_0x3cd457);}return _0x16d7d4[_0x1a78('0x1c')](_0x3cd457)[_0x1a78('0x1d')]();};}function respondWithResult(_0x358689,_0x4d84af){_0x4d84af=_0x4d84af||0xc8;return function(_0x4f6ac6){if(_0x4f6ac6){return _0x358689[_0x1a78('0x1c')](_0x4d84af)['json'](_0x4f6ac6);}};}function respondWithFilteredResult(_0x5751c4,_0x4c78bb){return function(_0xed516e){if(_0xed516e){var _0x45063d=typeof _0x4c78bb['offset']===_0x1a78('0x1e')&&typeof _0x4c78bb[_0x1a78('0x1f')]==='undefined';var _0x55c180=_0xed516e[_0x1a78('0x20')];var _0x17a6db=_0x45063d?0x0:_0x4c78bb[_0x1a78('0x21')];var _0x313ed2=_0x45063d?_0xed516e['count']:_0x4c78bb['offset']+_0x4c78bb[_0x1a78('0x1f')];var _0x11c8a2;if(_0x313ed2>=_0x55c180){_0x313ed2=_0x55c180;_0x11c8a2=0xc8;}else{_0x11c8a2=0xce;}_0x5751c4[_0x1a78('0x1c')](_0x11c8a2);return _0x5751c4[_0x1a78('0x22')](_0x1a78('0x23'),_0x17a6db+'-'+_0x313ed2+'/'+_0x55c180)[_0x1a78('0x24')](_0xed516e);}return null;};}function patchUpdates(_0xcdc3bf){return function(_0x93a7){try{jsonpatch[_0x1a78('0x25')](_0x93a7,_0xcdc3bf,!![]);}catch(_0x4fb28){return BPromise[_0x1a78('0x26')](_0x4fb28);}return _0x93a7[_0x1a78('0x27')]();};}function saveUpdates(_0x116517,_0x5c466e){return function(_0x2fa387){if(_0x2fa387){return _0x2fa387[_0x1a78('0x28')](_0x116517)[_0x1a78('0x29')](function(_0x4e5d46){return _0x4e5d46;});}return null;};}function removeEntity(_0x171477,_0x43fc5f){return function(_0x3fb73d){if(_0x3fb73d){return _0x3fb73d[_0x1a78('0x2a')]()[_0x1a78('0x29')](function(){var _0x32f2e6=_0x3fb73d[_0x1a78('0x2b')]({'plain':!![]});var _0x319250='Variables';return db[_0x1a78('0x2c')]['destroy']({'where':{'type':_0x319250,'resourceId':_0x32f2e6['id']}})[_0x1a78('0x29')](function(){return _0x3fb73d;});})['then'](function(){_0x171477[_0x1a78('0x1c')](0xcc)[_0x1a78('0x1d')]();});}};}function handleEntityNotFound(_0x1ef0b7,_0x216877){return function(_0x4eecc2){if(!_0x4eecc2){_0x1ef0b7[_0x1a78('0x2d')](0x194);}return _0x4eecc2;};}function handleError(_0xc6314f,_0x5ed6e3){_0x5ed6e3=_0x5ed6e3||0x1f4;return function(_0x2b296f){logger[_0x1a78('0x2e')](_0x2b296f['stack']);if(_0x2b296f[_0x1a78('0x2f')]){delete _0x2b296f[_0x1a78('0x2f')];}_0xc6314f[_0x1a78('0x1c')](_0x5ed6e3)[_0x1a78('0x30')](_0x2b296f);};}exports[_0x1a78('0x31')]=function(_0x5d9e87,_0x27a288){var _0x5a04bf={},_0x2cb63f={},_0x386fc9={'count':0x0,'rows':[]};var _0x27eb5a=_['map'](db[_0x1a78('0x32')][_0x1a78('0x33')],function(_0x2afd02){return{'name':_0x2afd02[_0x1a78('0x34')],'type':_0x2afd02[_0x1a78('0x35')]['key']};});_0x2cb63f[_0x1a78('0x36')]=_[_0x1a78('0x37')](_0x27eb5a,_0x1a78('0x2f'));_0x2cb63f[_0x1a78('0x38')]=_[_0x1a78('0x39')](_0x5d9e87['query']);_0x2cb63f[_0x1a78('0x3a')]=_[_0x1a78('0x3b')](_0x2cb63f[_0x1a78('0x36')],_0x2cb63f[_0x1a78('0x38')]);_0x5a04bf[_0x1a78('0x3c')]=_['intersection'](_0x2cb63f[_0x1a78('0x36')],qs[_0x1a78('0x3d')](_0x5d9e87['query'][_0x1a78('0x3d')]));_0x5a04bf[_0x1a78('0x3c')]=_0x5a04bf[_0x1a78('0x3c')]['length']?_0x5a04bf['attributes']:_0x2cb63f[_0x1a78('0x36')];if(!_0x5d9e87[_0x1a78('0x38')]['hasOwnProperty']('nolimit')){_0x5a04bf[_0x1a78('0x1f')]=qs['limit'](_0x5d9e87[_0x1a78('0x38')][_0x1a78('0x1f')]);_0x5a04bf[_0x1a78('0x21')]=qs[_0x1a78('0x21')](_0x5d9e87[_0x1a78('0x38')]['offset']);}_0x5a04bf[_0x1a78('0x3e')]=qs['sort'](_0x5d9e87[_0x1a78('0x38')][_0x1a78('0x3f')]);_0x5a04bf[_0x1a78('0x40')]=qs[_0x1a78('0x3a')](_['pick'](_0x5d9e87[_0x1a78('0x38')],_0x2cb63f['filters']),_0x27eb5a);if(_0x5d9e87[_0x1a78('0x38')][_0x1a78('0x41')]){_0x5a04bf[_0x1a78('0x40')]=_[_0x1a78('0x42')](_0x5a04bf[_0x1a78('0x40')],{'$or':_[_0x1a78('0x37')](_0x27eb5a,function(_0x4bb27f){if(_0x4bb27f[_0x1a78('0x35')]!==_0x1a78('0x43')){var _0x3be38b={};_0x3be38b[_0x4bb27f[_0x1a78('0x2f')]]={'$like':'%'+_0x5d9e87[_0x1a78('0x38')][_0x1a78('0x41')]+'%'};return _0x3be38b;}})});}_0x5a04bf=_[_0x1a78('0x42')]({},_0x5a04bf,_0x5d9e87[_0x1a78('0x44')]);var _0x3bf335={'where':_0x5a04bf[_0x1a78('0x40')]};return db['Variable'][_0x1a78('0x20')](_0x3bf335)[_0x1a78('0x29')](function(_0x207eb6){_0x386fc9[_0x1a78('0x20')]=_0x207eb6;if(_0x5d9e87['query'][_0x1a78('0x45')]){_0x5a04bf['include']=[{'all':!![]}];}return db[_0x1a78('0x32')][_0x1a78('0x46')](_0x5a04bf);})[_0x1a78('0x29')](function(_0x1e8954){_0x386fc9['rows']=_0x1e8954;return _0x386fc9;})['then'](respondWithFilteredResult(_0x27a288,_0x5a04bf))[_0x1a78('0x47')](handleError(_0x27a288,null));};exports['show']=function(_0x27f78e,_0x3a5b46){var _0x1a3d50={'raw':!![],'where':{'id':_0x27f78e[_0x1a78('0x48')]['id']}},_0x272719={};_0x272719['model']=_[_0x1a78('0x39')](db[_0x1a78('0x32')][_0x1a78('0x33')]);_0x272719[_0x1a78('0x38')]=_['keys'](_0x27f78e[_0x1a78('0x38')]);_0x272719[_0x1a78('0x3a')]=_['intersection'](_0x272719['model'],_0x272719['query']);_0x1a3d50[_0x1a78('0x3c')]=_[_0x1a78('0x3b')](_0x272719[_0x1a78('0x36')],qs[_0x1a78('0x3d')](_0x27f78e[_0x1a78('0x38')][_0x1a78('0x3d')]));_0x1a3d50[_0x1a78('0x3c')]=_0x1a3d50['attributes']['length']?_0x1a3d50[_0x1a78('0x3c')]:_0x272719[_0x1a78('0x36')];if(_0x27f78e['query'][_0x1a78('0x45')]){_0x1a3d50[_0x1a78('0x49')]=[{'all':!![]}];}_0x1a3d50=_[_0x1a78('0x42')]({},_0x1a3d50,_0x27f78e['options']);return db[_0x1a78('0x32')][_0x1a78('0x4a')](_0x1a3d50)['then'](handleEntityNotFound(_0x3a5b46,null))['then'](respondWithResult(_0x3a5b46,null))[_0x1a78('0x47')](handleError(_0x3a5b46,null));};exports['create']=function(_0x18965d,_0x1e7188){return db[_0x1a78('0x32')][_0x1a78('0x4b')](_0x18965d[_0x1a78('0x4c')],{})['then'](function(_0x24b4c1){var _0x2ad268=_0x18965d[_0x1a78('0x4d')][_0x1a78('0x2b')]({'plain':!![]});if(!_0x2ad268)throw new Error(_0x1a78('0x4e'));if(_0x2ad268[_0x1a78('0x4f')]===_0x1a78('0x4d')){var _0x2c69eb=_0x24b4c1[_0x1a78('0x2b')]({'plain':!![]});var _0x29368e=_0x1a78('0x50');return db['UserProfileSection'][_0x1a78('0x4a')]({'where':{'name':_0x29368e,'userProfileId':_0x2ad268['userProfileId']},'raw':!![]})[_0x1a78('0x29')](function(_0x1542c5){if(_0x1542c5&&_0x1542c5[_0x1a78('0x51')]===0x0){return db['UserProfileResource'][_0x1a78('0x4b')]({'name':_0x2c69eb[_0x1a78('0x2f')],'resourceId':_0x2c69eb['id'],'type':_0x1542c5[_0x1a78('0x2f')],'sectionId':_0x1542c5['id']},{})[_0x1a78('0x29')](function(){return _0x24b4c1;});}else{return _0x24b4c1;}})[_0x1a78('0x47')](function(_0x26f378){logger[_0x1a78('0x2e')](_0x1a78('0x52'),_0x26f378);throw _0x26f378;});}return _0x24b4c1;})['then'](respondWithResult(_0x1e7188,0xc9))['catch'](handleError(_0x1e7188,null));};exports[_0x1a78('0x28')]=function(_0x3674d7,_0x35157f){if(_0x3674d7[_0x1a78('0x4c')]['id']){delete _0x3674d7[_0x1a78('0x4c')]['id'];}return db[_0x1a78('0x32')]['find']({'where':{'id':_0x3674d7[_0x1a78('0x48')]['id']}})[_0x1a78('0x29')](handleEntityNotFound(_0x35157f,null))[_0x1a78('0x29')](saveUpdates(_0x3674d7[_0x1a78('0x4c')],null))['then'](respondWithResult(_0x35157f,null))[_0x1a78('0x47')](handleError(_0x35157f,null));};exports[_0x1a78('0x2a')]=function(_0x1bb2a6,_0x2a7b06){return db[_0x1a78('0x32')][_0x1a78('0x4a')]({'where':{'id':_0x1bb2a6[_0x1a78('0x48')]['id']}})[_0x1a78('0x29')](handleEntityNotFound(_0x2a7b06,null))['then'](removeEntity(_0x2a7b06,null))[_0x1a78('0x47')](handleError(_0x2a7b06,null));}; \ No newline at end of file +var _0xcdd1=['then','destroy','Variables','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','options','Variable','includeAll','include','findAll','rows','catch','show','params','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','update'];(function(_0x192cd8,_0x39edf4){var _0x5be47b=function(_0x5ba4f2){while(--_0x5ba4f2){_0x192cd8['push'](_0x192cd8['shift']());}};_0x5be47b(++_0x39edf4);}(_0xcdd1,0x87));var _0x1cdd=function(_0x22cb10,_0x20db4f){_0x22cb10=_0x22cb10-0x0;var _0x38a6f8=_0xcdd1[_0x22cb10];return _0x38a6f8;};'use strict';var emlformat=require(_0x1cdd('0x0'));var rimraf=require(_0x1cdd('0x1'));var zipdir=require(_0x1cdd('0x2'));var jsonpatch=require(_0x1cdd('0x3'));var rp=require('request-promise');var moment=require(_0x1cdd('0x4'));var BPromise=require(_0x1cdd('0x5'));var Mustache=require(_0x1cdd('0x6'));var util=require(_0x1cdd('0x7'));var path=require(_0x1cdd('0x8'));var sox=require(_0x1cdd('0x9'));var csv=require(_0x1cdd('0xa'));var ejs=require(_0x1cdd('0xb'));var fs=require('fs');var fs_extra=require(_0x1cdd('0xc'));var _=require('lodash');var squel=require(_0x1cdd('0xd'));var crypto=require(_0x1cdd('0xe'));var jsforce=require(_0x1cdd('0xf'));var deskjs=require(_0x1cdd('0x10'));var toCsv=require(_0x1cdd('0xa'));var querystring=require(_0x1cdd('0x11'));var Papa=require(_0x1cdd('0x12'));var Redis=require(_0x1cdd('0x13'));var authService=require(_0x1cdd('0x14'));var qs=require(_0x1cdd('0x15'));var as=require(_0x1cdd('0x16'));var hardwareService=require(_0x1cdd('0x17'));var logger=require(_0x1cdd('0x18'))(_0x1cdd('0x19'));var utils=require(_0x1cdd('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x1cdd('0x1b'));var db=require(_0x1cdd('0x1c'))['db'];function respondWithStatusCode(_0xbdbd05,_0x9c5afb){_0x9c5afb=_0x9c5afb||0xcc;return function(_0xd2464e){if(_0xd2464e){return _0xbdbd05['sendStatus'](_0x9c5afb);}return _0xbdbd05[_0x1cdd('0x1d')](_0x9c5afb)['end']();};}function respondWithResult(_0x16a11c,_0x135d60){_0x135d60=_0x135d60||0xc8;return function(_0x5105ce){if(_0x5105ce){return _0x16a11c[_0x1cdd('0x1d')](_0x135d60)[_0x1cdd('0x1e')](_0x5105ce);}};}function respondWithFilteredResult(_0x17c490,_0x198bbe){return function(_0x12841f){if(_0x12841f){var _0x288246=typeof _0x198bbe['offset']===_0x1cdd('0x1f')&&typeof _0x198bbe[_0x1cdd('0x20')]===_0x1cdd('0x1f');var _0x5dcd46=_0x12841f['count'];var _0x3918e8=_0x288246?0x0:_0x198bbe[_0x1cdd('0x21')];var _0x4496c4=_0x288246?_0x12841f[_0x1cdd('0x22')]:_0x198bbe[_0x1cdd('0x21')]+_0x198bbe[_0x1cdd('0x20')];var _0x440585;if(_0x4496c4>=_0x5dcd46){_0x4496c4=_0x5dcd46;_0x440585=0xc8;}else{_0x440585=0xce;}_0x17c490['status'](_0x440585);return _0x17c490[_0x1cdd('0x23')]('Content-Range',_0x3918e8+'-'+_0x4496c4+'/'+_0x5dcd46)[_0x1cdd('0x1e')](_0x12841f);}return null;};}function patchUpdates(_0x25df40){return function(_0x586538){try{jsonpatch[_0x1cdd('0x24')](_0x586538,_0x25df40,!![]);}catch(_0x335753){return BPromise[_0x1cdd('0x25')](_0x335753);}return _0x586538['save']();};}function saveUpdates(_0xf34176,_0x214529){return function(_0xe17b42){if(_0xe17b42){return _0xe17b42[_0x1cdd('0x26')](_0xf34176)[_0x1cdd('0x27')](function(_0x3ab91d){return _0x3ab91d;});}return null;};}function removeEntity(_0x175576,_0x5815a5){return function(_0x4cf72f){if(_0x4cf72f){return _0x4cf72f[_0x1cdd('0x28')]()[_0x1cdd('0x27')](function(){var _0x2c9ecf=_0x4cf72f['get']({'plain':!![]});var _0x21d842=_0x1cdd('0x29');return db[_0x1cdd('0x2a')]['destroy']({'where':{'type':_0x21d842,'resourceId':_0x2c9ecf['id']}})[_0x1cdd('0x27')](function(){return _0x4cf72f;});})[_0x1cdd('0x27')](function(){_0x175576['status'](0xcc)[_0x1cdd('0x2b')]();});}};}function handleEntityNotFound(_0x1b8be6,_0x21c561){return function(_0x11424f){if(!_0x11424f){_0x1b8be6['sendStatus'](0x194);}return _0x11424f;};}function handleError(_0x2c05ec,_0x4088c0){_0x4088c0=_0x4088c0||0x1f4;return function(_0x293916){logger[_0x1cdd('0x2c')](_0x293916[_0x1cdd('0x2d')]);if(_0x293916[_0x1cdd('0x2e')]){delete _0x293916[_0x1cdd('0x2e')];}_0x2c05ec[_0x1cdd('0x1d')](_0x4088c0)[_0x1cdd('0x2f')](_0x293916);};}exports[_0x1cdd('0x30')]=function(_0x5a8780,_0x86a824){var _0x36360d={},_0x4f5dda={},_0x5687b0={'count':0x0,'rows':[]};var _0xab7578=_[_0x1cdd('0x31')](db['Variable'][_0x1cdd('0x32')],function(_0xb431a1){return{'name':_0xb431a1[_0x1cdd('0x33')],'type':_0xb431a1[_0x1cdd('0x34')][_0x1cdd('0x35')]};});_0x4f5dda[_0x1cdd('0x36')]=_['map'](_0xab7578,'name');_0x4f5dda[_0x1cdd('0x37')]=_[_0x1cdd('0x38')](_0x5a8780['query']);_0x4f5dda[_0x1cdd('0x39')]=_[_0x1cdd('0x3a')](_0x4f5dda['model'],_0x4f5dda['query']);_0x36360d[_0x1cdd('0x3b')]=_[_0x1cdd('0x3a')](_0x4f5dda[_0x1cdd('0x36')],qs[_0x1cdd('0x3c')](_0x5a8780[_0x1cdd('0x37')][_0x1cdd('0x3c')]));_0x36360d[_0x1cdd('0x3b')]=_0x36360d[_0x1cdd('0x3b')][_0x1cdd('0x3d')]?_0x36360d[_0x1cdd('0x3b')]:_0x4f5dda[_0x1cdd('0x36')];if(!_0x5a8780[_0x1cdd('0x37')]['hasOwnProperty'](_0x1cdd('0x3e'))){_0x36360d[_0x1cdd('0x20')]=qs['limit'](_0x5a8780[_0x1cdd('0x37')][_0x1cdd('0x20')]);_0x36360d[_0x1cdd('0x21')]=qs[_0x1cdd('0x21')](_0x5a8780[_0x1cdd('0x37')]['offset']);}_0x36360d[_0x1cdd('0x3f')]=qs[_0x1cdd('0x40')](_0x5a8780[_0x1cdd('0x37')][_0x1cdd('0x40')]);_0x36360d[_0x1cdd('0x41')]=qs[_0x1cdd('0x39')](_[_0x1cdd('0x42')](_0x5a8780[_0x1cdd('0x37')],_0x4f5dda[_0x1cdd('0x39')]),_0xab7578);if(_0x5a8780[_0x1cdd('0x37')][_0x1cdd('0x43')]){_0x36360d[_0x1cdd('0x41')]=_['merge'](_0x36360d[_0x1cdd('0x41')],{'$or':_[_0x1cdd('0x31')](_0xab7578,function(_0x452851){if(_0x452851[_0x1cdd('0x34')]!=='VIRTUAL'){var _0x35c93f={};_0x35c93f[_0x452851[_0x1cdd('0x2e')]]={'$like':'%'+_0x5a8780[_0x1cdd('0x37')][_0x1cdd('0x43')]+'%'};return _0x35c93f;}})});}_0x36360d=_['merge']({},_0x36360d,_0x5a8780[_0x1cdd('0x44')]);var _0x200399={'where':_0x36360d['where']};return db[_0x1cdd('0x45')][_0x1cdd('0x22')](_0x200399)[_0x1cdd('0x27')](function(_0x4b3d24){_0x5687b0['count']=_0x4b3d24;if(_0x5a8780[_0x1cdd('0x37')][_0x1cdd('0x46')]){_0x36360d[_0x1cdd('0x47')]=[{'all':!![]}];}return db[_0x1cdd('0x45')][_0x1cdd('0x48')](_0x36360d);})[_0x1cdd('0x27')](function(_0x58ba71){_0x5687b0[_0x1cdd('0x49')]=_0x58ba71;return _0x5687b0;})[_0x1cdd('0x27')](respondWithFilteredResult(_0x86a824,_0x36360d))[_0x1cdd('0x4a')](handleError(_0x86a824,null));};exports[_0x1cdd('0x4b')]=function(_0x4a2c1e,_0x42762a){var _0x430013={'raw':!![],'where':{'id':_0x4a2c1e[_0x1cdd('0x4c')]['id']}},_0x433327={};_0x433327[_0x1cdd('0x36')]=_['keys'](db[_0x1cdd('0x45')]['rawAttributes']);_0x433327[_0x1cdd('0x37')]=_[_0x1cdd('0x38')](_0x4a2c1e[_0x1cdd('0x37')]);_0x433327[_0x1cdd('0x39')]=_[_0x1cdd('0x3a')](_0x433327['model'],_0x433327['query']);_0x430013[_0x1cdd('0x3b')]=_['intersection'](_0x433327['model'],qs[_0x1cdd('0x3c')](_0x4a2c1e[_0x1cdd('0x37')][_0x1cdd('0x3c')]));_0x430013[_0x1cdd('0x3b')]=_0x430013['attributes'][_0x1cdd('0x3d')]?_0x430013['attributes']:_0x433327[_0x1cdd('0x36')];if(_0x4a2c1e[_0x1cdd('0x37')][_0x1cdd('0x46')]){_0x430013[_0x1cdd('0x47')]=[{'all':!![]}];}_0x430013=_[_0x1cdd('0x4d')]({},_0x430013,_0x4a2c1e[_0x1cdd('0x44')]);return db[_0x1cdd('0x45')][_0x1cdd('0x4e')](_0x430013)['then'](handleEntityNotFound(_0x42762a,null))[_0x1cdd('0x27')](respondWithResult(_0x42762a,null))['catch'](handleError(_0x42762a,null));};exports[_0x1cdd('0x4f')]=function(_0x13371a,_0x26f598){return db[_0x1cdd('0x45')][_0x1cdd('0x4f')](_0x13371a['body'],{})['then'](function(_0x46cff5){var _0x9d7864=_0x13371a[_0x1cdd('0x50')]['get']({'plain':!![]});if(!_0x9d7864)throw new Error(_0x1cdd('0x51'));if(_0x9d7864[_0x1cdd('0x52')]===_0x1cdd('0x50')){var _0x81ec76=_0x46cff5['get']({'plain':!![]});var _0x4844a9=_0x1cdd('0x29');return db[_0x1cdd('0x53')][_0x1cdd('0x4e')]({'where':{'name':_0x4844a9,'userProfileId':_0x9d7864[_0x1cdd('0x54')]},'raw':!![]})[_0x1cdd('0x27')](function(_0x2552e8){if(_0x2552e8&&_0x2552e8[_0x1cdd('0x55')]===0x0){return db[_0x1cdd('0x2a')]['create']({'name':_0x81ec76[_0x1cdd('0x2e')],'resourceId':_0x81ec76['id'],'type':_0x2552e8[_0x1cdd('0x2e')],'sectionId':_0x2552e8['id']},{})[_0x1cdd('0x27')](function(){return _0x46cff5;});}else{return _0x46cff5;}})['catch'](function(_0x4cd8a9){logger[_0x1cdd('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cd8a9);throw _0x4cd8a9;});}return _0x46cff5;})[_0x1cdd('0x27')](respondWithResult(_0x26f598,0xc9))[_0x1cdd('0x4a')](handleError(_0x26f598,null));};exports['update']=function(_0x17c9c9,_0x23845d){if(_0x17c9c9[_0x1cdd('0x56')]['id']){delete _0x17c9c9['body']['id'];}return db[_0x1cdd('0x45')][_0x1cdd('0x4e')]({'where':{'id':_0x17c9c9[_0x1cdd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23845d,null))['then'](saveUpdates(_0x17c9c9[_0x1cdd('0x56')],null))[_0x1cdd('0x27')](respondWithResult(_0x23845d,null))['catch'](handleError(_0x23845d,null));};exports[_0x1cdd('0x28')]=function(_0x2a3179,_0x31562d){return db['Variable'][_0x1cdd('0x4e')]({'where':{'id':_0x2a3179['params']['id']}})[_0x1cdd('0x27')](handleEntityNotFound(_0x31562d,null))[_0x1cdd('0x27')](removeEntity(_0x31562d,null))[_0x1cdd('0x4a')](handleError(_0x31562d,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5c3faf8..5446379 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 _0xae47=['Variable','tools_variables','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0x44eeef,_0x22bfe8){var _0x5a6d40=function(_0x3a8373){while(--_0x3a8373){_0x44eeef['push'](_0x44eeef['shift']());}};_0x5a6d40(++_0x22bfe8);}(_0xae47,0x17c));var _0x7ae4=function(_0x2feb02,_0x2cc867){_0x2feb02=_0x2feb02-0x0;var _0x3c40c5=_0xae47[_0x2feb02];return _0x3c40c5;};'use strict';var _=require(_0x7ae4('0x0'));var util=require(_0x7ae4('0x1'));var logger=require(_0x7ae4('0x2'))('api');var moment=require(_0x7ae4('0x3'));var BPromise=require(_0x7ae4('0x4'));var rp=require(_0x7ae4('0x5'));var fs=require('fs');var path=require(_0x7ae4('0x6'));var rimraf=require(_0x7ae4('0x7'));var config=require(_0x7ae4('0x8'));var attributes=require(_0x7ae4('0x9'));module[_0x7ae4('0xa')]=function(_0x3dd5ae,_0x383c19){return _0x3dd5ae[_0x7ae4('0xb')](_0x7ae4('0xc'),attributes,{'tableName':_0x7ae4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0852=['../../config/environment','./variable.attributes','exports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x543d3c,_0x509981){var _0xf5fb6d=function(_0x28c53a){while(--_0x28c53a){_0x543d3c['push'](_0x543d3c['shift']());}};_0xf5fb6d(++_0x509981);}(_0x0852,0xd5));var _0x2085=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x0852[_0x5f309e];return _0x487b5e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2085('0x0'))(_0x2085('0x1'));var moment=require(_0x2085('0x2'));var BPromise=require(_0x2085('0x3'));var rp=require(_0x2085('0x4'));var fs=require('fs');var path=require(_0x2085('0x5'));var rimraf=require(_0x2085('0x6'));var config=require(_0x2085('0x7'));var attributes=require(_0x2085('0x8'));module[_0x2085('0x9')]=function(_0x33c531,_0x2b4404){return _0x33c531['define']('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index f116e1c..54d2cbd 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 _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x326f,0xd1));var _0xf326=function(_0x355575,_0x2be17b){_0x355575=_0x355575-0x0;var _0x452d5b=_0x326f[_0x355575];return _0x452d5b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});}; \ 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(_0xb98e6e,_0xe56cbc){var _0x26751c=function(_0x123ccc){while(--_0x123ccc){_0xb98e6e['push'](_0xb98e6e['shift']());}};_0x26751c(++_0xe56cbc);}(_0x55ca,0x126));var _0xa55c=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x55ca[_0x320b8e];return _0x55a10a;};'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 bfec2b9..c8c6d8e 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 _0xa6b0=['/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','restart','/migrations','exports','express','../../components/auth/service','./version.controller','get','index'];(function(_0x4e84d6,_0x300a27){var _0x5b440b=function(_0x35eaa4){while(--_0x35eaa4){_0x4e84d6['push'](_0x4e84d6['shift']());}};_0x5b440b(++_0x300a27);}(_0xa6b0,0x79));var _0x0a6b=function(_0x2e99e2,_0x27104e){_0x2e99e2=_0x2e99e2-0x0;var _0x438b2e=_0xa6b0[_0x2e99e2];return _0x438b2e;};'use strict';var express=require(_0x0a6b('0x0'));var router=express['Router']();var auth=require(_0x0a6b('0x1'));var controller=require(_0x0a6b('0x2'));router[_0x0a6b('0x3')]('/',controller[_0x0a6b('0x4')]);router[_0x0a6b('0x3')](_0x0a6b('0x5'),auth[_0x0a6b('0x6')](),auth[_0x0a6b('0x7')](),controller['fetch']);router[_0x0a6b('0x3')](_0x0a6b('0x8'),auth[_0x0a6b('0x6')](),auth[_0x0a6b('0x7')](),controller[_0x0a6b('0x9')]);router['get'](_0x0a6b('0xa'),auth[_0x0a6b('0x6')](),auth[_0x0a6b('0x7')](),controller['pull']);router[_0x0a6b('0x3')]('/restart',auth[_0x0a6b('0x6')](),controller[_0x0a6b('0xb')]);router[_0x0a6b('0x3')](_0x0a6b('0xc'),controller['migrations']);module[_0x0a6b('0xd')]=router; \ No newline at end of file +var _0x980a=['./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','pull','restart','/migrations','migrations','exports','express','Router','../../components/auth/service'];(function(_0x4bd626,_0x2dc566){var _0x29a074=function(_0x406a4e){while(--_0x406a4e){_0x4bd626['push'](_0x4bd626['shift']());}};_0x29a074(++_0x2dc566);}(_0x980a,0x74));var _0xa980=function(_0x3cc897,_0x1d0c16){_0x3cc897=_0x3cc897-0x0;var _0x4fb315=_0x980a[_0x3cc897];return _0x4fb315;};'use strict';var express=require(_0xa980('0x0'));var router=express[_0xa980('0x1')]();var auth=require(_0xa980('0x2'));var controller=require(_0xa980('0x3'));router[_0xa980('0x4')]('/',controller[_0xa980('0x5')]);router[_0xa980('0x4')](_0xa980('0x6'),auth[_0xa980('0x7')](),auth[_0xa980('0x8')](),controller[_0xa980('0x9')]);router[_0xa980('0x4')](_0xa980('0xa'),auth[_0xa980('0x7')](),auth['canUpdate'](),controller[_0xa980('0xb')]);router[_0xa980('0x4')]('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xa980('0xc')]);router[_0xa980('0x4')]('/restart',auth[_0xa980('0x7')](),controller[_0xa980('0xd')]);router[_0xa980('0x4')](_0xa980('0xe'),controller[_0xa980('0xf')]);module[_0xa980('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index c19f851..9dba097 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 _0x05bd=['join','server','migrations','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.','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','info','restart','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync'];(function(_0x4a95f4,_0x22e6ea){var _0x21b8dd=function(_0x3a70a7){while(--_0x3a70a7){_0x4a95f4['push'](_0x4a95f4['shift']());}};_0x21b8dd(++_0x22e6ea);}(_0x05bd,0x148));var _0xd05b=function(_0x21cffc,_0x386d53){_0x21cffc=_0x21cffc-0x0;var _0x5818f3=_0x05bd[_0x21cffc];return _0x5818f3;};'use strict';var Umzug=require(_0xd05b('0x0'));var path=require(_0xd05b('0x1'));var fs=require('fs');var _=require(_0xd05b('0x2'));var pkginfo=require(_0xd05b('0x3'))(module,_0xd05b('0x4'));var compareVersions=require(_0xd05b('0x5'));var exec=require(_0xd05b('0x6'))[_0xd05b('0x7')];var db=require(_0xd05b('0x8'))['db'];var config=require(_0xd05b('0x9'));var pm2=require(_0xd05b('0xa'));var logger=require(_0xd05b('0xb'))(_0xd05b('0xc'));var git=require(_0xd05b('0xd'))(config[_0xd05b('0xe')]);exports[_0xd05b('0xf')]=function(_0x54ec1d,_0xd9a23){var _0x414ae5={'current':module[_0xd05b('0x10')][_0xd05b('0x4')],'phonebar':0x2};if(_0x54ec1d[_0xd05b('0x11')]&&_0x54ec1d[_0xd05b('0x11')][_0xd05b('0x12')]){return git['fetch']()[_0xd05b('0x13')](function(_0x423074,_0x59c92f){_0x414ae5['latest']=(_0x423074?module[_0xd05b('0x10')]['version']:_0x59c92f[_0xd05b('0x12')])||_0xd05b('0x14');return _0xd9a23[_0xd05b('0x15')](0xc8)[_0xd05b('0x16')](_0x414ae5);});}else{return _0xd9a23[_0xd05b('0x15')](0xc8)['json'](_0x414ae5);}};exports['fetch']=function(_0x4a3a5e,_0xdd5740){return git[_0xd05b('0x17')]([_0xd05b('0x18'),_0xd05b('0x19')],function(_0x26fae7){if(_0x26fae7){logger[_0xd05b('0x1a')](_0x26fae7);return _0xdd5740['status'](0x1f4)['json'](_0x26fae7);}logger['info']('git\x20fetch');return _0xdd5740[_0xd05b('0x15')](0xc8)['json']({'output':_0xd05b('0x1b')});});};exports[_0xd05b('0x1c')]=function(_0x13f446,_0xb81c0e){return git[_0xd05b('0x1c')](['--hard',_0xd05b('0x1d')],function(_0x38dcae){if(_0x38dcae){logger[_0xd05b('0x1a')](_0x38dcae);return _0xb81c0e[_0xd05b('0x15')](0x1f4)[_0xd05b('0x16')](_0x38dcae);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xb81c0e['status'](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x3c7ddd,_0x55b05f){exec('npm\x20install\x20--production',function(_0x2afee4,_0x428849,_0x39c6f3){logger[_0xd05b('0x1e')](_0x428849);logger['info'](_0x39c6f3);if(_0x2afee4){logger['error'](_0x2afee4);return _0x55b05f[_0xd05b('0x15')](0x1f4)[_0xd05b('0x16')](_0x2afee4);}return _0x55b05f[_0xd05b('0x15')](0xc8)[_0xd05b('0x16')]({'output':_0x428849});});};exports[_0xd05b('0x1f')]=function(_0x54743a,_0x1c4239){return pm2[_0xd05b('0x1f')]('motion2')['then'](function(_0x236bdb){logger[_0xd05b('0x1e')](_0xd05b('0x20'),_0x236bdb);return _0x1c4239[_0xd05b('0x15')](0xc8)[_0xd05b('0x16')]({'output':_0xd05b('0x21')});})[_0xd05b('0x22')](function(_0x4d1157){logger['error'](_0x4d1157);return _0x1c4239['status'](0x1f4)[_0xd05b('0x16')](_0x4d1157);});};exports['migrations']=function(_0x4169ba,_0x261ca0){var _0x3164f8=fs[_0xd05b('0x23')](path[_0xd05b('0x24')](config[_0xd05b('0xe')],_0xd05b('0x25'),_0xd05b('0x26')));var _0x2829d7=[];for(var _0x3203c2=0x0;_0x3203c2<_0x3164f8[_0xd05b('0x27')];_0x3203c2++){var _0x79d0d6=_0x3164f8[_0x3203c2]['replace'](_0xd05b('0x28'),'');if(compareVersions(module[_0xd05b('0x10')]['version'],_0x79d0d6)===-0x1){_0x2829d7[_0xd05b('0x29')](_0x79d0d6);}}if(_0x2829d7[_0xd05b('0x27')]){var _0x2f6a8d=_0x2829d7[_0xd05b('0x2a')](compareVersions);var _0x44c847=new Umzug({'storage':_0xd05b('0x2b'),'storageOptions':{'model':db[_0xd05b('0x2c')],'modelName':_0xd05b('0x2c'),'columnName':_0xd05b('0x4')},'migrations':{'params':[db[_0xd05b('0x2b')][_0xd05b('0x2d')](),db[_0xd05b('0x2b')][_0xd05b('0x2e')],function(){throw new Error(_0xd05b('0x2f'));}],'path':path[_0xd05b('0x24')](config[_0xd05b('0xe')],_0xd05b('0x25'),_0xd05b('0x26')),'pattern':/\.js$/}});_0x44c847['up']({'migrations':_['map'](_0x2f6a8d,function(_0x331e80){return _0x331e80+'.js';})})[_0xd05b('0x30')](function(){return _0x261ca0[_0xd05b('0x15')](0xc8)[_0xd05b('0x16')]({'output':_0xd05b('0x31')+module[_0xd05b('0x10')][_0xd05b('0x4')]+_0xd05b('0x32')+_['last'](_0x2f6a8d),'migrations':_[_0xd05b('0x24')](_0x2f6a8d)});})[_0xd05b('0x22')](function(_0x518d39){if(_0x518d39 instanceof db['sequelize']['UniqueConstraintError']){return _0x261ca0[_0xd05b('0x15')](0xc8)[_0xd05b('0x16')]({'output':_0xd05b('0x33')});}else{return _0x261ca0['status'](0x1f4)[_0xd05b('0x16')](_0x518d39);}});}else{return _0x261ca0[_0xd05b('0x15')](0xc8)[_0xd05b('0x16')]({'output':_0xd05b('0x33')});}}; \ No newline at end of file +var _0x3277=['fetch','tags','version','2.0.0','status','json','origin','info','git\x20fetch','reset','--hard','error','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','.js','push','length','sort','Migration','getQueryInterface','sequelize','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','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../config/environment','../../config/pm2','../../config/logger','root','index','exports','query','latest'];(function(_0x1f6fe9,_0x20c7c2){var _0x4a6b71=function(_0x3b86e8){while(--_0x3b86e8){_0x1f6fe9['push'](_0x1f6fe9['shift']());}};_0x4a6b71(++_0x20c7c2);}(_0x3277,0x93));var _0x7327=function(_0x3b3a8c,_0x78cec9){_0x3b3a8c=_0x3b3a8c-0x0;var _0x3b4ba6=_0x3277[_0x3b3a8c];return _0x3b4ba6;};'use strict';var Umzug=require(_0x7327('0x0'));var path=require(_0x7327('0x1'));var fs=require('fs');var _=require(_0x7327('0x2'));var pkginfo=require(_0x7327('0x3'))(module,'version');var compareVersions=require(_0x7327('0x4'));var exec=require(_0x7327('0x5'))[_0x7327('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x7327('0x7'));var pm2=require(_0x7327('0x8'));var logger=require(_0x7327('0x9'))('update');var git=require('simple-git')(config[_0x7327('0xa')]);exports[_0x7327('0xb')]=function(_0x15874c,_0x4aa9ba){var _0x1207f3={'current':module[_0x7327('0xc')]['version'],'phonebar':0x2};if(_0x15874c[_0x7327('0xd')]&&_0x15874c['query'][_0x7327('0xe')]){return git[_0x7327('0xf')]()[_0x7327('0x10')](function(_0x72a264,_0x5f3666){_0x1207f3[_0x7327('0xe')]=(_0x72a264?module['exports'][_0x7327('0x11')]:_0x5f3666[_0x7327('0xe')])||_0x7327('0x12');return _0x4aa9ba[_0x7327('0x13')](0xc8)[_0x7327('0x14')](_0x1207f3);});}else{return _0x4aa9ba[_0x7327('0x13')](0xc8)[_0x7327('0x14')](_0x1207f3);}};exports[_0x7327('0xf')]=function(_0x450226,_0x5c8736){return git[_0x7327('0xf')]([_0x7327('0x15'),'master'],function(_0x842200){if(_0x842200){logger['error'](_0x842200);return _0x5c8736['status'](0x1f4)['json'](_0x842200);}logger[_0x7327('0x16')](_0x7327('0x17'));return _0x5c8736[_0x7327('0x13')](0xc8)[_0x7327('0x14')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x7327('0x18')]=function(_0x43b28e,_0x382618){return git[_0x7327('0x18')]([_0x7327('0x19'),'FETCH_HEAD'],function(_0x580d6f){if(_0x580d6f){logger[_0x7327('0x1a')](_0x580d6f);return _0x382618['status'](0x1f4)['json'](_0x580d6f);}logger[_0x7327('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x382618['status'](0xc8)[_0x7327('0x14')]({'output':_0x7327('0x1b')});});};exports[_0x7327('0x1c')]=function(_0x3dd3d7,_0x4ffb74){exec(_0x7327('0x1d'),function(_0x5df6b9,_0x567ddc,_0x59f115){logger[_0x7327('0x16')](_0x567ddc);logger[_0x7327('0x16')](_0x59f115);if(_0x5df6b9){logger[_0x7327('0x1a')](_0x5df6b9);return _0x4ffb74[_0x7327('0x13')](0x1f4)[_0x7327('0x14')](_0x5df6b9);}return _0x4ffb74['status'](0xc8)['json']({'output':_0x567ddc});});};exports['restart']=function(_0x1f179a,_0x1f6875){return pm2[_0x7327('0x1e')](_0x7327('0x1f'))[_0x7327('0x20')](function(_0x50fbe6){logger[_0x7327('0x16')]('pm2\x20restart\x20motion\x20%s',_0x50fbe6);return _0x1f6875[_0x7327('0x13')](0xc8)[_0x7327('0x14')]({'output':_0x7327('0x21')});})['catch'](function(_0x189349){logger['error'](_0x189349);return _0x1f6875['status'](0x1f4)[_0x7327('0x14')](_0x189349);});};exports[_0x7327('0x22')]=function(_0x2a3d8e,_0x18e8a2){var _0x155fa0=fs[_0x7327('0x23')](path[_0x7327('0x24')](config[_0x7327('0xa')],_0x7327('0x25'),_0x7327('0x22')));var _0x3f07b5=[];for(var _0x4cf28f=0x0;_0x4cf28f<_0x155fa0['length'];_0x4cf28f++){var _0x1c50aa=_0x155fa0[_0x4cf28f]['replace'](_0x7327('0x26'),'');if(compareVersions(module[_0x7327('0xc')][_0x7327('0x11')],_0x1c50aa)===-0x1){_0x3f07b5[_0x7327('0x27')](_0x1c50aa);}}if(_0x3f07b5[_0x7327('0x28')]){var _0x44c0bc=_0x3f07b5[_0x7327('0x29')](compareVersions);var _0x201010=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x7327('0x2a'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0x7327('0x2b')](),db[_0x7327('0x2c')][_0x7327('0x2d')],function(){throw new Error(_0x7327('0x2e'));}],'path':path['join'](config[_0x7327('0xa')],'server','migrations'),'pattern':/\.js$/}});_0x201010['up']({'migrations':_[_0x7327('0x2f')](_0x44c0bc,function(_0x22a46f){return _0x22a46f+_0x7327('0x26');})})['then'](function(){return _0x18e8a2[_0x7327('0x13')](0xc8)[_0x7327('0x14')]({'output':_0x7327('0x30')+module[_0x7327('0xc')][_0x7327('0x11')]+_0x7327('0x31')+_[_0x7327('0x32')](_0x44c0bc),'migrations':_['join'](_0x44c0bc)});})[_0x7327('0x33')](function(_0x2ddd62){if(_0x2ddd62 instanceof db[_0x7327('0x2c')][_0x7327('0x34')]){return _0x18e8a2['status'](0xc8)['json']({'output':_0x7327('0x35')});}else{return _0x18e8a2[_0x7327('0x13')](0x1f4)[_0x7327('0x14')](_0x2ddd62);}});}else{return _0x18e8a2[_0x7327('0x13')](0xc8)[_0x7327('0x14')]({'output':_0x7327('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 7228179..23b64c9 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 _0x63c4=['get','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2fd6b8,_0x5ec5da){var _0x545f47=function(_0x24928e){while(--_0x24928e){_0x2fd6b8['push'](_0x2fd6b8['shift']());}};_0x545f47(++_0x5ec5da);}(_0x63c4,0x14f));var _0x463c=function(_0x307a4d,_0xc5c881){_0x307a4d=_0x307a4d-0x0;var _0x41ff5e=_0x63c4[_0x307a4d];return _0x41ff5e;};'use strict';var multer=require(_0x463c('0x0'));var util=require(_0x463c('0x1'));var path=require(_0x463c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x463c('0x3')]();var fs_extra=require(_0x463c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x463c('0x5'));var config=require(_0x463c('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x463c('0x7')]('/',auth[_0x463c('0x8')](),controller['index']);router[_0x463c('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x463c('0x9')]);router[_0x463c('0x7')](_0x463c('0xa'),auth[_0x463c('0x8')](),controller['show']);router[_0x463c('0xb')]('/',auth[_0x463c('0x8')](),controller[_0x463c('0xc')]);router[_0x463c('0xd')]('/:id',auth[_0x463c('0x8')](),controller[_0x463c('0xe')]);router[_0x463c('0xf')](_0x463c('0xa'),auth[_0x463c('0x8')](),controller[_0x463c('0x10')]);module[_0x463c('0x11')]=router; \ No newline at end of file +var _0x8bca=['/describe','isAuthenticated','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','index','get'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x8bca,0x145));var _0xa8bc=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8bca[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0xa8bc('0x0'));var path=require(_0xa8bc('0x1'));var timeout=require(_0xa8bc('0x2'));var express=require('express');var router=express[_0xa8bc('0x3')]();var fs_extra=require(_0xa8bc('0x4'));var auth=require(_0xa8bc('0x5'));var interaction=require(_0xa8bc('0x6'));var config=require(_0xa8bc('0x7'));var controller=require(_0xa8bc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa8bc('0x9')]);router[_0xa8bc('0xa')](_0xa8bc('0xb'),auth[_0xa8bc('0xc')](),controller[_0xa8bc('0xd')]);router[_0xa8bc('0xa')](_0xa8bc('0xe'),auth['isAuthenticated'](),controller[_0xa8bc('0xf')]);router[_0xa8bc('0x10')]('/',auth[_0xa8bc('0xc')](),controller['create']);router['put'](_0xa8bc('0xe'),auth['isAuthenticated'](),controller[_0xa8bc('0x11')]);router[_0xa8bc('0x12')](_0xa8bc('0xe'),auth[_0xa8bc('0xc')](),controller[_0xa8bc('0x13')]);module[_0xa8bc('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 5c2b7f4..47bc848 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 _0x761c=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x59846f,_0x66b55c){var _0x33f48c=function(_0x53b4af){while(--_0x53b4af){_0x59846f['push'](_0x59846f['shift']());}};_0x33f48c(++_0x66b55c);}(_0x761c,0x18a));var _0xc761=function(_0x2651e1,_0x17623d){_0x2651e1=_0x2651e1-0x0;var _0x2b10df=_0x761c[_0x2651e1];return _0x2b10df;};'use strict';var Sequelize=require(_0xc761('0x0'));module['exports']={'type':{'type':Sequelize[_0xc761('0x1')]},'uniqueid':{'type':Sequelize[_0xc761('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc761('0x1')]},'queue':{'type':Sequelize[_0xc761('0x1')]},'interface':{'type':Sequelize[_0xc761('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xc761('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xc761('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xc761('0x2')]},'agentdumpAt':{'type':Sequelize[_0xc761('0x2')]},'holdtime':{'type':Sequelize[_0xc761('0x3')]},'agentcomplete':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc761('0x3')]},'reason':{'type':Sequelize[_0xc761('0x1')]},'lastevent':{'type':Sequelize[_0xc761('0x1')]},'channel':{'type':Sequelize[_0xc761('0x1')]},'channelstate':{'type':Sequelize[_0xc761('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc761('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc761('0x1')]},'accountcode':{'type':Sequelize[_0xc761('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc761('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc761('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc761('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xc761('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xc761('0x1')]},'destlanguage':{'type':Sequelize[_0xc761('0x1')]},'destaccountcode':{'type':Sequelize[_0xc761('0x1')]},'destcontext':{'type':Sequelize[_0xc761('0x1')]},'destexten':{'type':Sequelize[_0xc761('0x1')]},'destpriority':{'type':Sequelize[_0xc761('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xc761('0x1')]},'transfer':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc761('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xc761('0x1')]},'transferuniqueid':{'type':Sequelize[_0xc761('0x1')]},'agententerreason':{'type':Sequelize[_0xc761('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x14a0=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING'];(function(_0x3da01e,_0x1823fd){var _0x553703=function(_0x205526){while(--_0x205526){_0x3da01e['push'](_0x3da01e['shift']());}};_0x553703(++_0x1823fd);}(_0x14a0,0x8e));var _0x014a=function(_0x4de29d,_0x10a255){_0x4de29d=_0x4de29d-0x0;var _0x37013b=_0x14a0[_0x4de29d];return _0x37013b;};'use strict';var Sequelize=require('sequelize');module[_0x014a('0x0')]={'type':{'type':Sequelize[_0x014a('0x1')]},'uniqueid':{'type':Sequelize[_0x014a('0x1')]},'calleridnum':{'type':Sequelize[_0x014a('0x1')]},'calleridname':{'type':Sequelize[_0x014a('0x1')]},'queue':{'type':Sequelize[_0x014a('0x1')]},'interface':{'type':Sequelize[_0x014a('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x014a('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x014a('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x014a('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x014a('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x014a('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x014a('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x014a('0x1')]},'language':{'type':Sequelize[_0x014a('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x014a('0x1')]},'exten':{'type':Sequelize[_0x014a('0x1')]},'priority':{'type':Sequelize[_0x014a('0x1')]},'destchannel':{'type':Sequelize[_0x014a('0x1')]},'destchannelstate':{'type':Sequelize[_0x014a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x014a('0x1')]},'destcalleridnum':{'type':Sequelize[_0x014a('0x1')]},'destcalleridname':{'type':Sequelize[_0x014a('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x014a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x014a('0x1')]},'destlanguage':{'type':Sequelize[_0x014a('0x1')]},'destaccountcode':{'type':Sequelize[_0x014a('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x014a('0x1')]},'destpriority':{'type':Sequelize[_0x014a('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x014a('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x014a('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x014a('0x1')],'comment':_0x014a('0x5')},'transferexten':{'type':Sequelize[_0x014a('0x1')]},'transferuniqueid':{'type':Sequelize[_0x014a('0x1')]},'agententerreason':{'type':Sequelize[_0x014a('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 8f2a768..6f314cb 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(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 823514b..f90c793 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 _0x6aa7=['define','VoiceAgentReport','report_agent','destuniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0x6aa7,0x178));var _0x76aa=function(_0x3dbcdf,_0x5a9567){_0x3dbcdf=_0x3dbcdf-0x0;var _0x148447=_0x6aa7[_0x3dbcdf];return _0x148447;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x76aa('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x425d=['define','VoiceAgentReport','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x425d,0x1e0));var _0xd425=function(_0x7642c,_0x2ec4b0){_0x7642c=_0x7642c-0x0;var _0x5412fd=_0x425d[_0x7642c];return _0x5412fd;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var logger=require(_0xd425('0x1'))(_0xd425('0x2'));var moment=require(_0xd425('0x3'));var BPromise=require(_0xd425('0x4'));var rp=require(_0xd425('0x5'));var fs=require('fs');var path=require(_0xd425('0x6'));var rimraf=require(_0xd425('0x7'));var config=require('../../config/environment');var attributes=require(_0xd425('0x8'));module[_0xd425('0x9')]=function(_0xc4e080,_0x36866e){return _0xc4e080[_0xd425('0xa')](_0xd425('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd425('0xc'),_0xd425('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index b86a83b..b62f16f 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 _0xcf46=['body','options','raw','stringify','UpdateVoiceAgentReport','update','where','attributes','limit','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create'];(function(_0x111494,_0x1d73da){var _0x1d0d8b=function(_0x344935){while(--_0x344935){_0x111494['push'](_0x111494['shift']());}};_0x1d0d8b(++_0x1d73da);}(_0xcf46,0x69));var _0x6cf4=function(_0x1b924c,_0x14ebf9){_0x1b924c=_0x1b924c-0x0;var _0x11b4f0=_0xcf46[_0x1b924c];return _0x11b4f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6cf4('0x0'));var BPromise=require('bluebird');var rs=require(_0x6cf4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6cf4('0x2'));var logger=require(_0x6cf4('0x3'))(_0x6cf4('0x4'));var config=require(_0x6cf4('0x5'));var jayson=require(_0x6cf4('0x6'));var client=jayson[_0x6cf4('0x7')][_0x6cf4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52b47b,_0xe51f03,_0x51c281){return new BPromise(function(_0x231f45,_0x35722c){return client['request'](_0x52b47b,_0x51c281)[_0x6cf4('0x9')](function(_0x2763a4){logger[_0x6cf4('0xa')](_0x6cf4('0xb'),_0xe51f03,_0x6cf4('0xc'));logger[_0x6cf4('0xd')](_0x6cf4('0xe'),_0xe51f03,'request\x20sent',JSON['stringify'](_0x2763a4));if(_0x2763a4[_0x6cf4('0xf')]){if(_0x2763a4['error'][_0x6cf4('0x10')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xe51f03,_0x2763a4[_0x6cf4('0xf')][_0x6cf4('0x11')]);return _0x35722c(_0x2763a4[_0x6cf4('0xf')][_0x6cf4('0x11')]);}logger[_0x6cf4('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0xe51f03,_0x2763a4[_0x6cf4('0xf')][_0x6cf4('0x11')]);return _0x231f45(_0x2763a4[_0x6cf4('0xf')][_0x6cf4('0x11')]);}else{logger[_0x6cf4('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0xe51f03,_0x6cf4('0xc'));_0x231f45(_0x2763a4[_0x6cf4('0x12')][_0x6cf4('0x11')]);}})[_0x6cf4('0x13')](function(_0x43d416){logger[_0x6cf4('0xf')](_0x6cf4('0xb'),_0xe51f03,_0x43d416);_0x35722c(_0x43d416);});});}exports[_0x6cf4('0x14')]=function(_0x30ba37){var _0x2a6d85=this;return new Promise(function(_0xab5ec4,_0x199993){return db[_0x6cf4('0x15')][_0x6cf4('0x16')](_0x30ba37[_0x6cf4('0x17')],{'raw':_0x30ba37[_0x6cf4('0x18')]?_0x30ba37[_0x6cf4('0x18')][_0x6cf4('0x19')]===undefined?!![]:![]:!![]})[_0x6cf4('0x9')](function(_0x127331){logger['info'](_0x6cf4('0x14'),_0x30ba37);logger[_0x6cf4('0xd')]('CreateVoiceAgentReport',_0x30ba37,JSON[_0x6cf4('0x1a')](_0x127331));_0xab5ec4(_0x127331);})[_0x6cf4('0x13')](function(_0x526042){logger['error'](_0x6cf4('0x14'),_0x526042['message'],_0x30ba37);_0x199993(_0x2a6d85[_0x6cf4('0xf')](0x1f4,_0x526042[_0x6cf4('0x11')]));});});};exports[_0x6cf4('0x1b')]=function(_0x2fad6e){var _0x2c01a9=this;return new Promise(function(_0x584fb1,_0x4b9d69){return db[_0x6cf4('0x15')][_0x6cf4('0x1c')](_0x2fad6e[_0x6cf4('0x17')],{'raw':_0x2fad6e[_0x6cf4('0x18')]?_0x2fad6e[_0x6cf4('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fad6e['options']?_0x2fad6e[_0x6cf4('0x18')][_0x6cf4('0x1d')]||null:null,'attributes':_0x2fad6e[_0x6cf4('0x18')]?_0x2fad6e[_0x6cf4('0x18')][_0x6cf4('0x1e')]||null:null,'limit':_0x2fad6e[_0x6cf4('0x18')]?_0x2fad6e[_0x6cf4('0x18')][_0x6cf4('0x1f')]||null:null})[_0x6cf4('0x9')](function(_0xb844be){logger[_0x6cf4('0xa')](_0x6cf4('0x1b'),_0x2fad6e);logger[_0x6cf4('0xd')](_0x6cf4('0x1b'),_0x2fad6e,JSON[_0x6cf4('0x1a')](_0xb844be));_0x584fb1(_0xb844be);})[_0x6cf4('0x13')](function(_0x3817ff){logger[_0x6cf4('0xf')]('UpdateVoiceAgentReport',_0x3817ff['message'],_0x2fad6e);_0x4b9d69(_0x2c01a9[_0x6cf4('0xf')](0x1f4,_0x3817ff['message']));});});}; \ No newline at end of file +var _0x9ff5=['VoiceAgentReport','create','body','options','stringify','catch','CreateVoiceAgentReport','UpdateVoiceAgentReport','raw','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x56975e,_0x587d46){var _0x16c8d2=function(_0x2b52e6){while(--_0x2b52e6){_0x56975e['push'](_0x56975e['shift']());}};_0x16c8d2(++_0x587d46);}(_0x9ff5,0x1aa));var _0x59ff=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x9ff5[_0x261522];return _0x98a25a;};'use strict';var _=require(_0x59ff('0x0'));var util=require(_0x59ff('0x1'));var moment=require(_0x59ff('0x2'));var BPromise=require(_0x59ff('0x3'));var rs=require(_0x59ff('0x4'));var fs=require('fs');var Redis=require(_0x59ff('0x5'));var db=require(_0x59ff('0x6'))['db'];var utils=require(_0x59ff('0x7'));var logger=require(_0x59ff('0x8'))('rpc');var config=require(_0x59ff('0x9'));var jayson=require(_0x59ff('0xa'));var client=jayson[_0x59ff('0xb')][_0x59ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x265e66,_0x360496,_0x383f08){return new BPromise(function(_0x402f2d,_0x597393){return client['request'](_0x265e66,_0x383f08)['then'](function(_0x4eb627){logger[_0x59ff('0xd')](_0x59ff('0xe'),_0x360496,_0x59ff('0xf'));logger[_0x59ff('0x10')](_0x59ff('0x11'),_0x360496,_0x59ff('0xf'),JSON['stringify'](_0x4eb627));if(_0x4eb627[_0x59ff('0x12')]){if(_0x4eb627['error'][_0x59ff('0x13')]===0x1f4){logger[_0x59ff('0x12')](_0x59ff('0xe'),_0x360496,_0x4eb627[_0x59ff('0x12')][_0x59ff('0x14')]);return _0x597393(_0x4eb627[_0x59ff('0x12')][_0x59ff('0x14')]);}logger[_0x59ff('0x12')](_0x59ff('0xe'),_0x360496,_0x4eb627['error'][_0x59ff('0x14')]);return _0x402f2d(_0x4eb627[_0x59ff('0x12')][_0x59ff('0x14')]);}else{logger[_0x59ff('0xd')](_0x59ff('0xe'),_0x360496,_0x59ff('0xf'));_0x402f2d(_0x4eb627[_0x59ff('0x15')][_0x59ff('0x14')]);}})['catch'](function(_0x15b9b9){logger[_0x59ff('0x12')](_0x59ff('0xe'),_0x360496,_0x15b9b9);_0x597393(_0x15b9b9);});});}exports['CreateVoiceAgentReport']=function(_0x505ec2){var _0x15d295=this;return new Promise(function(_0xc251ef,_0x29b73b){return db[_0x59ff('0x16')][_0x59ff('0x17')](_0x505ec2[_0x59ff('0x18')],{'raw':_0x505ec2['options']?_0x505ec2[_0x59ff('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5171b5){logger[_0x59ff('0xd')]('CreateVoiceAgentReport',_0x505ec2);logger['debug']('CreateVoiceAgentReport',_0x505ec2,JSON[_0x59ff('0x1a')](_0x5171b5));_0xc251ef(_0x5171b5);})[_0x59ff('0x1b')](function(_0x59aa13){logger[_0x59ff('0x12')](_0x59ff('0x1c'),_0x59aa13[_0x59ff('0x14')],_0x505ec2);_0x29b73b(_0x15d295[_0x59ff('0x12')](0x1f4,_0x59aa13[_0x59ff('0x14')]));});});};exports[_0x59ff('0x1d')]=function(_0x482b32){var _0x2afde2=this;return new Promise(function(_0x32d070,_0x22daf4){return db[_0x59ff('0x16')]['update'](_0x482b32[_0x59ff('0x18')],{'raw':_0x482b32[_0x59ff('0x19')]?_0x482b32[_0x59ff('0x19')][_0x59ff('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x482b32[_0x59ff('0x19')]?_0x482b32[_0x59ff('0x19')]['where']||null:null,'attributes':_0x482b32['options']?_0x482b32[_0x59ff('0x19')][_0x59ff('0x1f')]||null:null,'limit':_0x482b32['options']?_0x482b32[_0x59ff('0x19')]['limit']||null:null})['then'](function(_0x8f78f4){logger[_0x59ff('0xd')](_0x59ff('0x1d'),_0x482b32);logger[_0x59ff('0x10')]('UpdateVoiceAgentReport',_0x482b32,JSON[_0x59ff('0x1a')](_0x8f78f4));_0x32d070(_0x8f78f4);})[_0x59ff('0x1b')](function(_0x585380){logger['error'](_0x59ff('0x1d'),_0x585380['message'],_0x482b32);_0x22daf4(_0x2afde2[_0x59ff('0x12')](0x1f4,_0x585380['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index ff6caff..6139d51 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 _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','delete','destroy'];(function(_0x57f8f6,_0x418b27){var _0x26b8c5=function(_0x49ae13){while(--_0x49ae13){_0x57f8f6['push'](_0x57f8f6['shift']());}};_0x26b8c5(++_0x418b27);}(_0x2bd8,0x130));var _0x82bd=function(_0xeb5a9e,_0x449a3c){_0xeb5a9e=_0xeb5a9e-0x0;var _0x353010=_0x2bd8[_0xeb5a9e];return _0x353010;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['put'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x82bd('0xe')](_0x82bd('0xd'),auth['isAuthenticated'](),controller[_0x82bd('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x508fb1,_0x5da7c5){var _0x3e73fe=function(_0x5bde79){while(--_0x5bde79){_0x508fb1['push'](_0x508fb1['shift']());}};_0x3e73fe(++_0x5da7c5);}(_0x4bc3,0x16e));var _0x34bc=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x4bc3[_0x1969a7];return _0x3d665f;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 79f9746..d8a9b54 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 _0xd65c=['TEXT','DATE','INTEGER','sequelize','exports','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','STRING'];(function(_0x1f7ea1,_0x3e128a){var _0x2e618f=function(_0x20d7fc){while(--_0x20d7fc){_0x1f7ea1['push'](_0x1f7ea1['shift']());}};_0x2e618f(++_0x3e128a);}(_0xd65c,0x177));var _0xcd65=function(_0x374672,_0x4f495a){_0x374672=_0x374672-0x0;var _0x2318e1=_0xd65c[_0x374672];return _0x2318e1;};'use strict';var Sequelize=require(_0xcd65('0x0'));module[_0xcd65('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xcd65('0x2'),_0xcd65('0x3'),_0xcd65('0x4'),_0xcd65('0x5'),_0xcd65('0x6'),_0xcd65('0x7'))},'tag':{'type':Sequelize[_0xcd65('0x8')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xcd65('0x8')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xcd65('0x8')]},'callerid':{'type':Sequelize[_0xcd65('0x8')]},'channel':{'type':Sequelize[_0xcd65('0x8')]},'destinationchannel':{'type':Sequelize[_0xcd65('0x8')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xcd65('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xcd65('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xcd65('0xa')]},'duration':{'type':Sequelize[_0xcd65('0xb')]},'billableseconds':{'type':Sequelize[_0xcd65('0xb')]},'mohtime':{'type':Sequelize[_0xcd65('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xcd65('0x8')]},'userfield':{'type':Sequelize[_0xcd65('0x8')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xcd65('0x8')]},'userThirdDisposition':{'type':Sequelize[_0xcd65('0x8')]},'note':{'type':Sequelize[_0xcd65('0x8')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xcd65('0x8')]}}; \ No newline at end of file +var _0x9140=['outbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound','inbound-fax'];(function(_0x3b00b4,_0x413db0){var _0x1f83a4=function(_0x5f1a3b){while(--_0x5f1a3b){_0x3b00b4['push'](_0x3b00b4['shift']());}};_0x1f83a4(++_0x413db0);}(_0x9140,0x185));var _0x0914=function(_0x2aba20,_0x1852fb){_0x2aba20=_0x2aba20-0x0;var _0x326961=_0x9140[_0x2aba20];return _0x326961;};'use strict';var Sequelize=require(_0x0914('0x0'));module[_0x0914('0x1')]={'uniqueid':{'type':Sequelize[_0x0914('0x2')]},'type':{'type':Sequelize[_0x0914('0x3')](_0x0914('0x4'),'internal',_0x0914('0x5'),_0x0914('0x6'),_0x0914('0x7'),'dialer')},'tag':{'type':Sequelize[_0x0914('0x2')]},'accountcode':{'type':Sequelize[_0x0914('0x2')]},'source':{'type':Sequelize[_0x0914('0x2')]},'destination':{'type':Sequelize[_0x0914('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0914('0x2')]},'channel':{'type':Sequelize[_0x0914('0x2')]},'destinationchannel':{'type':Sequelize[_0x0914('0x2')]},'lastapplication':{'type':Sequelize[_0x0914('0x2')]},'lastdata':{'type':Sequelize[_0x0914('0x8')]},'starttime':{'type':Sequelize[_0x0914('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0914('0x9')]},'endtime':{'type':Sequelize[_0x0914('0x9')]},'duration':{'type':Sequelize[_0x0914('0xa')]},'billableseconds':{'type':Sequelize[_0x0914('0xa')]},'mohtime':{'type':Sequelize[_0x0914('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0914('0x2')]},'userfield':{'type':Sequelize[_0x0914('0x2')]},'userDisposition':{'type':Sequelize[_0x0914('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x0914('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x0914('0x2')]},'note':{'type':Sequelize[_0x0914('0x2')]},'prefix':{'type':Sequelize[_0x0914('0x2')]},'routeid':{'type':Sequelize[_0x0914('0xa')]},'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 a389169..70445ab 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x34a63b,_0x3c8734){var _0x58f5dc=function(_0x5b3d2e){while(--_0x5b3d2e){_0x34a63b['push'](_0x34a63b['shift']());}};_0x58f5dc(++_0x3c8734);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d50b4,_0x314aaa){_0x4d50b4=_0x4d50b4-0x0;var _0x18bcbf=_0xb10b[_0x4d50b4];return _0x18bcbf;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0xadb5,0xad));var _0x5adb=function(_0x32049a,_0x1d8838){_0x32049a=_0x32049a-0x0;var _0xc657c0=_0xadb5[_0x32049a];return _0xc657c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index dead830..187d044 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 _0x8404=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x8404,0x17b));var _0x4840=function(_0x31bd87,_0x2e35a7){_0x31bd87=_0x31bd87-0x0;var _0x9f069b=_0x8404[_0x31bd87];return _0x9f069b;};'use strict';var _=require(_0x4840('0x0'));var util=require(_0x4840('0x1'));var logger=require(_0x4840('0x2'))(_0x4840('0x3'));var moment=require(_0x4840('0x4'));var BPromise=require(_0x4840('0x5'));var rp=require(_0x4840('0x6'));var fs=require('fs');var path=require(_0x4840('0x7'));var rimraf=require(_0x4840('0x8'));var config=require(_0x4840('0x9'));var attributes=require(_0x4840('0xa'));module[_0x4840('0xb')]=function(_0x47950e,_0x5221e8){return _0x47950e[_0x4840('0xc')](_0x4840('0xd'),attributes,{'tableName':_0x4840('0xe'),'paranoid':![],'indexes':[{'fields':[_0x4840('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bc9=['../../config/environment','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x26f444,_0x4cc2dc){var _0x2c1afa=function(_0x4b0781){while(--_0x4b0781){_0x26f444['push'](_0x26f444['shift']());}};_0x2c1afa(++_0x4cc2dc);}(_0x6bc9,0x1cc));var _0x96bc=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x6bc9[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x96bc('0x0'));var util=require(_0x96bc('0x1'));var logger=require(_0x96bc('0x2'))(_0x96bc('0x3'));var moment=require(_0x96bc('0x4'));var BPromise=require('bluebird');var rp=require(_0x96bc('0x5'));var fs=require('fs');var path=require(_0x96bc('0x6'));var rimraf=require(_0x96bc('0x7'));var config=require(_0x96bc('0x8'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x44bc83,_0x1b2f9c){return _0x44bc83[_0x96bc('0x9')](_0x96bc('0xa'),attributes,{'tableName':_0x96bc('0xb'),'paranoid':![],'indexes':[{'fields':[_0x96bc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 3a9b0c3..c27903e 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 _0x16bc=['http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','VoiceCallReport','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1e5516,_0x5b9430){var _0x2caed7=function(_0x408b5c){while(--_0x408b5c){_0x1e5516['push'](_0x1e5516['shift']());}};_0x2caed7(++_0x5b9430);}(_0x16bc,0x169));var _0xc16b=function(_0x1667e8,_0x369eaf){_0x1667e8=_0x1667e8-0x0;var _0x4be155=_0x16bc[_0x1667e8];return _0x4be155;};'use strict';var _=require(_0xc16b('0x0'));var util=require(_0xc16b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc16b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc16b('0x3'))['db'];var utils=require(_0xc16b('0x4'));var logger=require(_0xc16b('0x5'))(_0xc16b('0x6'));var config=require(_0xc16b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc16b('0x8')][_0xc16b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f946f,_0x281b2e,_0x3d6695){return new BPromise(function(_0x4162b4,_0x3e23af){return client['request'](_0x2f946f,_0x3d6695)[_0xc16b('0xa')](function(_0x3b5175){logger[_0xc16b('0xb')](_0xc16b('0xc'),_0x281b2e,_0xc16b('0xd'));logger[_0xc16b('0xe')](_0xc16b('0xf'),_0x281b2e,_0xc16b('0xd'),JSON[_0xc16b('0x10')](_0x3b5175));if(_0x3b5175[_0xc16b('0x11')]){if(_0x3b5175['error'][_0xc16b('0x12')]===0x1f4){logger[_0xc16b('0x11')](_0xc16b('0xc'),_0x281b2e,_0x3b5175[_0xc16b('0x11')][_0xc16b('0x13')]);return _0x3e23af(_0x3b5175[_0xc16b('0x11')][_0xc16b('0x13')]);}logger[_0xc16b('0x11')](_0xc16b('0xc'),_0x281b2e,_0x3b5175[_0xc16b('0x11')][_0xc16b('0x13')]);return _0x4162b4(_0x3b5175['error'][_0xc16b('0x13')]);}else{logger[_0xc16b('0xb')](_0xc16b('0xc'),_0x281b2e,_0xc16b('0xd'));_0x4162b4(_0x3b5175[_0xc16b('0x14')][_0xc16b('0x13')]);}})[_0xc16b('0x15')](function(_0x5ca715){logger[_0xc16b('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x281b2e,_0x5ca715);_0x3e23af(_0x5ca715);});});}exports['GetVoiceCallReport']=function(_0x496e6e){var _0x3ab086=this;return new Promise(function(_0x532abc,_0x51604){return db['VoiceCallReport'][_0xc16b('0x16')]({'raw':_0x496e6e[_0xc16b('0x17')]?_0x496e6e[_0xc16b('0x17')][_0xc16b('0x18')]===undefined?!![]:![]:!![],'where':_0x496e6e[_0xc16b('0x17')]?_0x496e6e[_0xc16b('0x17')][_0xc16b('0x19')]||null:null,'attributes':_0x496e6e['options']?_0x496e6e['options'][_0xc16b('0x1a')]||null:null,'limit':_0x496e6e[_0xc16b('0x17')]?_0x496e6e[_0xc16b('0x17')][_0xc16b('0x1b')]||null:null,'include':_0x496e6e['options']?_0x496e6e[_0xc16b('0x17')][_0xc16b('0x1c')]?_[_0xc16b('0x1d')](_0x496e6e[_0xc16b('0x17')][_0xc16b('0x1c')],function(_0x5ee119){return{'model':db[_0x5ee119[_0xc16b('0x1e')]],'as':_0x5ee119['as'],'attributes':_0x5ee119[_0xc16b('0x1a')],'include':_0x5ee119[_0xc16b('0x1c')]?_[_0xc16b('0x1d')](_0x5ee119[_0xc16b('0x1c')],function(_0x16d772){return{'model':db[_0x16d772[_0xc16b('0x1e')]],'as':_0x16d772['as'],'attributes':_0x16d772[_0xc16b('0x1a')],'include':_0x16d772[_0xc16b('0x1c')]?_[_0xc16b('0x1d')](_0x16d772[_0xc16b('0x1c')],function(_0x2645ad){return{'model':db[_0x2645ad[_0xc16b('0x1e')]],'as':_0x2645ad['as'],'attributes':_0x2645ad['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xce6f3b){logger[_0xc16b('0xb')]('GetVoiceCallReport',_0x496e6e);logger['debug'](_0xc16b('0x1f'),_0x496e6e,JSON[_0xc16b('0x10')](_0xce6f3b));_0x532abc(_0xce6f3b);})[_0xc16b('0x15')](function(_0x105fd1){logger[_0xc16b('0x11')](_0xc16b('0x1f'),_0x105fd1['message'],_0x496e6e);_0x51604(_0x3ab086[_0xc16b('0x11')](0x1f4,_0x105fd1[_0xc16b('0x13')]));});});};exports[_0xc16b('0x20')]=function(_0x72c329){var _0x154038=this;return new Promise(function(_0x41e8b0,_0x4be519){return db['VoiceCallReport'][_0xc16b('0x21')](_0x72c329[_0xc16b('0x22')],{'raw':_0x72c329['options']?_0x72c329['options'][_0xc16b('0x18')]===undefined?!![]:![]:!![]})[_0xc16b('0xa')](function(_0x17e98c){logger[_0xc16b('0xb')](_0xc16b('0x20'),_0x72c329);logger[_0xc16b('0xe')]('CreateVoiceCallReport',_0x72c329,JSON[_0xc16b('0x10')](_0x17e98c));_0x41e8b0(_0x17e98c);})['catch'](function(_0x16ceae){logger['error'](_0xc16b('0x20'),_0x16ceae[_0xc16b('0x13')],_0x72c329);_0x4be519(_0x154038[_0xc16b('0x11')](0x1f4,_0x16ceae['message']));});});};exports[_0xc16b('0x23')]=function(_0x1011f7){var _0x3b6e7a=this;return new Promise(function(_0x35f123,_0x1f80d3){return db[_0xc16b('0x24')]['update'](_0x1011f7['body'],{'raw':_0x1011f7[_0xc16b('0x17')]?_0x1011f7[_0xc16b('0x17')][_0xc16b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1011f7[_0xc16b('0x17')]?_0x1011f7['options']['where']||null:null,'attributes':_0x1011f7['options']?_0x1011f7[_0xc16b('0x17')][_0xc16b('0x1a')]||null:null,'limit':_0x1011f7[_0xc16b('0x17')]?_0x1011f7[_0xc16b('0x17')][_0xc16b('0x1b')]||null:null})[_0xc16b('0xa')](function(_0x2645e3){logger[_0xc16b('0xb')](_0xc16b('0x23'),_0x1011f7);logger['debug'](_0xc16b('0x23'),_0x1011f7,JSON[_0xc16b('0x10')](_0x2645e3));_0x35f123(_0x2645e3);})[_0xc16b('0x15')](function(_0x566d6b){logger[_0xc16b('0x11')](_0xc16b('0x23'),_0x566d6b[_0xc16b('0x13')],_0x1011f7);_0x1f80d3(_0x3b6e7a[_0xc16b('0x11')](0x1f4,_0x566d6b[_0xc16b('0x13')]));});});}; \ No newline at end of file +var _0x8758=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','limit','include','map','model','attributes','CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','update','body','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x8758,0x151));var _0x8875=function(_0x9e8f96,_0x4f83e8){_0x9e8f96=_0x9e8f96-0x0;var _0x45bed3=_0x8758[_0x9e8f96];return _0x45bed3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8875('0x0'));var rs=require(_0x8875('0x1'));var fs=require('fs');var Redis=require(_0x8875('0x2'));var db=require(_0x8875('0x3'))['db'];var utils=require(_0x8875('0x4'));var logger=require(_0x8875('0x5'))(_0x8875('0x6'));var config=require(_0x8875('0x7'));var jayson=require(_0x8875('0x8'));var client=jayson[_0x8875('0x9')][_0x8875('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1298cd,_0x5c9bbc,_0x4b0204){return new BPromise(function(_0x1d8a68,_0x8eadb2){return client['request'](_0x1298cd,_0x4b0204)[_0x8875('0xb')](function(_0x19ca7f){logger['info'](_0x8875('0xc'),_0x5c9bbc,_0x8875('0xd'));logger[_0x8875('0xe')](_0x8875('0xf'),_0x5c9bbc,_0x8875('0xd'),JSON[_0x8875('0x10')](_0x19ca7f));if(_0x19ca7f[_0x8875('0x11')]){if(_0x19ca7f[_0x8875('0x11')]['code']===0x1f4){logger[_0x8875('0x11')](_0x8875('0xc'),_0x5c9bbc,_0x19ca7f[_0x8875('0x11')][_0x8875('0x12')]);return _0x8eadb2(_0x19ca7f[_0x8875('0x11')][_0x8875('0x12')]);}logger[_0x8875('0x11')](_0x8875('0xc'),_0x5c9bbc,_0x19ca7f['error'][_0x8875('0x12')]);return _0x1d8a68(_0x19ca7f['error']['message']);}else{logger[_0x8875('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x5c9bbc,_0x8875('0xd'));_0x1d8a68(_0x19ca7f[_0x8875('0x14')]['message']);}})[_0x8875('0x15')](function(_0x531908){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x5c9bbc,_0x531908);_0x8eadb2(_0x531908);});});}exports[_0x8875('0x16')]=function(_0x21538a){var _0x2b41be=this;return new Promise(function(_0x4444cf,_0x5f362c){return db[_0x8875('0x17')][_0x8875('0x18')]({'raw':_0x21538a['options']?_0x21538a['options']['raw']===undefined?!![]:![]:!![],'where':_0x21538a['options']?_0x21538a[_0x8875('0x19')][_0x8875('0x1a')]||null:null,'attributes':_0x21538a[_0x8875('0x19')]?_0x21538a[_0x8875('0x19')]['attributes']||null:null,'limit':_0x21538a['options']?_0x21538a[_0x8875('0x19')][_0x8875('0x1b')]||null:null,'include':_0x21538a['options']?_0x21538a['options'][_0x8875('0x1c')]?_[_0x8875('0x1d')](_0x21538a['options'][_0x8875('0x1c')],function(_0x227fa1){return{'model':db[_0x227fa1[_0x8875('0x1e')]],'as':_0x227fa1['as'],'attributes':_0x227fa1[_0x8875('0x1f')],'include':_0x227fa1[_0x8875('0x1c')]?_['map'](_0x227fa1[_0x8875('0x1c')],function(_0x51a9e9){return{'model':db[_0x51a9e9['model']],'as':_0x51a9e9['as'],'attributes':_0x51a9e9[_0x8875('0x1f')],'include':_0x51a9e9['include']?_[_0x8875('0x1d')](_0x51a9e9[_0x8875('0x1c')],function(_0x48d297){return{'model':db[_0x48d297[_0x8875('0x1e')]],'as':_0x48d297['as'],'attributes':_0x48d297[_0x8875('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8875('0xb')](function(_0x1b420d){logger[_0x8875('0x13')](_0x8875('0x16'),_0x21538a);logger[_0x8875('0xe')](_0x8875('0x16'),_0x21538a,JSON[_0x8875('0x10')](_0x1b420d));_0x4444cf(_0x1b420d);})['catch'](function(_0x5235cb){logger[_0x8875('0x11')](_0x8875('0x16'),_0x5235cb[_0x8875('0x12')],_0x21538a);_0x5f362c(_0x2b41be[_0x8875('0x11')](0x1f4,_0x5235cb[_0x8875('0x12')]));});});};exports[_0x8875('0x20')]=function(_0x5203e1){var _0x58021d=this;return new Promise(function(_0x194a7a,_0x476283){return db['VoiceCallReport'][_0x8875('0x21')](_0x5203e1['body'],{'raw':_0x5203e1[_0x8875('0x19')]?_0x5203e1[_0x8875('0x19')][_0x8875('0x22')]===undefined?!![]:![]:!![]})[_0x8875('0xb')](function(_0x2a0205){logger[_0x8875('0x13')](_0x8875('0x20'),_0x5203e1);logger[_0x8875('0xe')](_0x8875('0x20'),_0x5203e1,JSON['stringify'](_0x2a0205));_0x194a7a(_0x2a0205);})[_0x8875('0x15')](function(_0x23c70f){logger[_0x8875('0x11')](_0x8875('0x20'),_0x23c70f[_0x8875('0x12')],_0x5203e1);_0x476283(_0x58021d[_0x8875('0x11')](0x1f4,_0x23c70f[_0x8875('0x12')]));});});};exports[_0x8875('0x23')]=function(_0x4d65d0){var _0x5f274c=this;return new Promise(function(_0x248783,_0x57c587){return db[_0x8875('0x17')][_0x8875('0x24')](_0x4d65d0[_0x8875('0x25')],{'raw':_0x4d65d0[_0x8875('0x19')]?_0x4d65d0[_0x8875('0x19')][_0x8875('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d65d0[_0x8875('0x19')]?_0x4d65d0['options'][_0x8875('0x1a')]||null:null,'attributes':_0x4d65d0[_0x8875('0x19')]?_0x4d65d0[_0x8875('0x19')][_0x8875('0x1f')]||null:null,'limit':_0x4d65d0[_0x8875('0x19')]?_0x4d65d0[_0x8875('0x19')][_0x8875('0x1b')]||null:null})['then'](function(_0x38e7a4){logger[_0x8875('0x13')](_0x8875('0x23'),_0x4d65d0);logger[_0x8875('0xe')](_0x8875('0x23'),_0x4d65d0,JSON['stringify'](_0x38e7a4));_0x248783(_0x38e7a4);})['catch'](function(_0xc54905){logger[_0x8875('0x11')](_0x8875('0x23'),_0xc54905[_0x8875('0x12')],_0x4d65d0);_0x57c587(_0x5f274c[_0x8875('0x11')](0x1f4,_0xc54905[_0x8875('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 5cd4e67..da0df79 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 _0x9b1a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5eb736,_0x5dcac5){var _0x183a13=function(_0x25ab83){while(--_0x25ab83){_0x5eb736['push'](_0x5eb736['shift']());}};_0x183a13(++_0x5dcac5);}(_0x9b1a,0x12e));var _0xa9b1=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x9b1a[_0x25701b];return _0x3a8a2c;};'use strict';var multer=require(_0xa9b1('0x0'));var util=require(_0xa9b1('0x1'));var path=require(_0xa9b1('0x2'));var timeout=require(_0xa9b1('0x3'));var express=require(_0xa9b1('0x4'));var router=express[_0xa9b1('0x5')]();var fs_extra=require(_0xa9b1('0x6'));var auth=require(_0xa9b1('0x7'));var interaction=require(_0xa9b1('0x8'));var config=require(_0xa9b1('0x9'));var controller=require(_0xa9b1('0xa'));router[_0xa9b1('0xb')]('/',auth[_0xa9b1('0xc')](),controller[_0xa9b1('0xd')]);router[_0xa9b1('0xb')](_0xa9b1('0xe'),auth[_0xa9b1('0xc')](),controller[_0xa9b1('0xf')]);router[_0xa9b1('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa9b1('0x11')](_0xa9b1('0xe'),auth[_0xa9b1('0xc')](),controller[_0xa9b1('0x12')]);router[_0xa9b1('0x13')](_0xa9b1('0xe'),auth[_0xa9b1('0xc')](),controller[_0xa9b1('0x14')]);module[_0xa9b1('0x15')]=router; \ No newline at end of file +var _0x351f=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x214a14,_0xd2ff16){var _0x4c2e6c=function(_0x2a42d4){while(--_0x2a42d4){_0x214a14['push'](_0x214a14['shift']());}};_0x4c2e6c(++_0xd2ff16);}(_0x351f,0x16a));var _0xf351=function(_0x3f93b8,_0x5112e0){_0x3f93b8=_0x3f93b8-0x0;var _0x523876=_0x351f[_0x3f93b8];return _0x523876;};'use strict';var multer=require(_0xf351('0x0'));var util=require(_0xf351('0x1'));var path=require(_0xf351('0x2'));var timeout=require('connect-timeout');var express=require(_0xf351('0x3'));var router=express[_0xf351('0x4')]();var fs_extra=require(_0xf351('0x5'));var auth=require(_0xf351('0x6'));var interaction=require(_0xf351('0x7'));var config=require(_0xf351('0x8'));var controller=require(_0xf351('0x9'));router[_0xf351('0xa')]('/',auth[_0xf351('0xb')](),controller[_0xf351('0xc')]);router[_0xf351('0xa')](_0xf351('0xd'),auth[_0xf351('0xb')](),controller[_0xf351('0xe')]);router['post']('/',auth[_0xf351('0xb')](),controller[_0xf351('0xf')]);router[_0xf351('0x10')](_0xf351('0xd'),auth[_0xf351('0xb')](),controller[_0xf351('0x11')]);router[_0xf351('0x12')](_0xf351('0xd'),auth['isAuthenticated'](),controller[_0xf351('0x13')]);module[_0xf351('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8a6ed52..a6d3378 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 _0x9bae=['name','setDataValue','options','join','getDataValue','BOOLEAN','sequelize','exports','STRING'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9bae,0x165));var _0xe9ba=function(_0x113efb,_0x435a07){_0x113efb=_0x113efb-0x0;var _0x1c8b0e=_0x9bae[_0x113efb];return _0x1c8b0e;};'use strict';var Sequelize=require(_0xe9ba('0x0'));module[_0xe9ba('0x1')]={'name':{'type':Sequelize[_0xe9ba('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xe9ba('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xe9ba('0x2')],'set':function(_0x5a1124){this[_0xe9ba('0x4')](_0xe9ba('0x5'),_0x5a1124?_0x5a1124[_0xe9ba('0x6')](''):[]);},'get':function(){return this[_0xe9ba('0x7')](_0xe9ba('0x5'))?this[_0xe9ba('0x7')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0xe9ba('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xe9ba('0x2')]},'record':{'type':Sequelize[_0xe9ba('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe9ba('0x2')]},'description':{'type':Sequelize[_0xe9ba('0x2')]}}; \ No newline at end of file +var _0xef20=['join','options','getDataValue','split','BOOLEAN','sequelize','STRING','name','setDataValue'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xef20,0x191));var _0x0ef2=function(_0x36b611,_0x307a18){_0x36b611=_0x36b611-0x0;var _0x18e148=_0xef20[_0x36b611];return _0x18e148;};'use strict';var Sequelize=require(_0x0ef2('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ef2('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x0ef2('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x0ef2('0x1')],'set':function(_0x2651fe){this[_0x0ef2('0x3')]('options',_0x2651fe?_0x2651fe[_0x0ef2('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x0ef2('0x5'))?this[_0x0ef2('0x6')](_0x0ef2('0x5'))[_0x0ef2('0x7')](''):[];}},'auth':{'type':Sequelize[_0x0ef2('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x0ef2('0x1')]},'record':{'type':Sequelize[_0x0ef2('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0ef2('0x1')]},'description':{'type':Sequelize[_0x0ef2('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 501d3ce..4c9db63 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 _0x1cf3=['model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','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/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ChanSpies','error','name','send','index','map','VoiceChanSpy','rawAttributes','type','key'];(function(_0x3f59b1,_0x25cdbe){var _0x11d2e8=function(_0x37b3fc){while(--_0x37b3fc){_0x3f59b1['push'](_0x3f59b1['shift']());}};_0x11d2e8(++_0x25cdbe);}(_0x1cf3,0x1be));var _0x31cf=function(_0x11d894,_0x1f7fa2){_0x11d894=_0x11d894-0x0;var _0xb33e5a=_0x1cf3[_0x11d894];return _0xb33e5a;};'use strict';var emlformat=require(_0x31cf('0x0'));var rimraf=require(_0x31cf('0x1'));var zipdir=require(_0x31cf('0x2'));var jsonpatch=require(_0x31cf('0x3'));var rp=require('request-promise');var moment=require(_0x31cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x31cf('0x5'));var util=require(_0x31cf('0x6'));var path=require(_0x31cf('0x7'));var sox=require(_0x31cf('0x8'));var csv=require(_0x31cf('0x9'));var ejs=require(_0x31cf('0xa'));var fs=require('fs');var fs_extra=require(_0x31cf('0xb'));var _=require(_0x31cf('0xc'));var squel=require(_0x31cf('0xd'));var crypto=require(_0x31cf('0xe'));var jsforce=require(_0x31cf('0xf'));var deskjs=require(_0x31cf('0x10'));var toCsv=require(_0x31cf('0x9'));var querystring=require(_0x31cf('0x11'));var Papa=require('papaparse');var Redis=require(_0x31cf('0x12'));var authService=require(_0x31cf('0x13'));var qs=require(_0x31cf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31cf('0x15'));var logger=require(_0x31cf('0x16'))(_0x31cf('0x17'));var utils=require(_0x31cf('0x18'));var config=require(_0x31cf('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15c5ef,_0x34e202){_0x34e202=_0x34e202||0xcc;return function(_0xfc40c9){if(_0xfc40c9){return _0x15c5ef[_0x31cf('0x1a')](_0x34e202);}return _0x15c5ef['status'](_0x34e202)[_0x31cf('0x1b')]();};}function respondWithResult(_0x106949,_0x41f3df){_0x41f3df=_0x41f3df||0xc8;return function(_0x492d3d){if(_0x492d3d){return _0x106949[_0x31cf('0x1c')](_0x41f3df)[_0x31cf('0x1d')](_0x492d3d);}};}function respondWithFilteredResult(_0x28be97,_0x1f6470){return function(_0x4ae41f){if(_0x4ae41f){var _0x54af12=typeof _0x1f6470[_0x31cf('0x1e')]===_0x31cf('0x1f')&&typeof _0x1f6470[_0x31cf('0x20')]==='undefined';var _0x1d4830=_0x4ae41f[_0x31cf('0x21')];var _0x54b753=_0x54af12?0x0:_0x1f6470['offset'];var _0x3c1bca=_0x54af12?_0x4ae41f['count']:_0x1f6470[_0x31cf('0x1e')]+_0x1f6470['limit'];var _0x4fd305;if(_0x3c1bca>=_0x1d4830){_0x3c1bca=_0x1d4830;_0x4fd305=0xc8;}else{_0x4fd305=0xce;}_0x28be97[_0x31cf('0x1c')](_0x4fd305);return _0x28be97[_0x31cf('0x22')](_0x31cf('0x23'),_0x54b753+'-'+_0x3c1bca+'/'+_0x1d4830)[_0x31cf('0x1d')](_0x4ae41f);}return null;};}function patchUpdates(_0x337447){return function(_0x2499e7){try{jsonpatch[_0x31cf('0x24')](_0x2499e7,_0x337447,!![]);}catch(_0x1a1864){return BPromise['reject'](_0x1a1864);}return _0x2499e7[_0x31cf('0x25')]();};}function saveUpdates(_0x134f75,_0x247a48){return function(_0xfa517f){if(_0xfa517f){return _0xfa517f[_0x31cf('0x26')](_0x134f75)[_0x31cf('0x27')](function(_0x462b83){return _0x462b83;});}return null;};}function removeEntity(_0x5cb51b,_0x33e6e1){return function(_0x3f09d3){if(_0x3f09d3){return _0x3f09d3[_0x31cf('0x28')]()[_0x31cf('0x27')](function(){var _0x29779f=_0x3f09d3[_0x31cf('0x29')]({'plain':!![]});var _0x34c383=_0x31cf('0x2a');return db['UserProfileResource'][_0x31cf('0x28')]({'where':{'type':_0x34c383,'resourceId':_0x29779f['id']}})[_0x31cf('0x27')](function(){return _0x3f09d3;});})[_0x31cf('0x27')](function(){_0x5cb51b[_0x31cf('0x1c')](0xcc)[_0x31cf('0x1b')]();});}};}function handleEntityNotFound(_0x1398cf,_0x2f8ed5){return function(_0x3cc40f){if(!_0x3cc40f){_0x1398cf[_0x31cf('0x1a')](0x194);}return _0x3cc40f;};}function handleError(_0x42fe15,_0x4babeb){_0x4babeb=_0x4babeb||0x1f4;return function(_0x128606){logger[_0x31cf('0x2b')](_0x128606['stack']);if(_0x128606[_0x31cf('0x2c')]){delete _0x128606['name'];}_0x42fe15[_0x31cf('0x1c')](_0x4babeb)[_0x31cf('0x2d')](_0x128606);};}exports[_0x31cf('0x2e')]=function(_0x31585a,_0x80372c){var _0x3daa30={},_0x1ee622={},_0x468dee={'count':0x0,'rows':[]};var _0x3449f3=_[_0x31cf('0x2f')](db[_0x31cf('0x30')][_0x31cf('0x31')],function(_0x5d18a8){return{'name':_0x5d18a8['fieldName'],'type':_0x5d18a8[_0x31cf('0x32')][_0x31cf('0x33')]};});_0x1ee622[_0x31cf('0x34')]=_[_0x31cf('0x2f')](_0x3449f3,_0x31cf('0x2c'));_0x1ee622[_0x31cf('0x35')]=_['keys'](_0x31585a[_0x31cf('0x35')]);_0x1ee622[_0x31cf('0x36')]=_[_0x31cf('0x37')](_0x1ee622['model'],_0x1ee622[_0x31cf('0x35')]);_0x3daa30[_0x31cf('0x38')]=_['intersection'](_0x1ee622['model'],qs[_0x31cf('0x39')](_0x31585a[_0x31cf('0x35')][_0x31cf('0x39')]));_0x3daa30[_0x31cf('0x38')]=_0x3daa30['attributes'][_0x31cf('0x3a')]?_0x3daa30[_0x31cf('0x38')]:_0x1ee622[_0x31cf('0x34')];if(!_0x31585a['query']['hasOwnProperty']('nolimit')){_0x3daa30[_0x31cf('0x20')]=qs[_0x31cf('0x20')](_0x31585a[_0x31cf('0x35')][_0x31cf('0x20')]);_0x3daa30[_0x31cf('0x1e')]=qs['offset'](_0x31585a['query']['offset']);}_0x3daa30[_0x31cf('0x3b')]=qs[_0x31cf('0x3c')](_0x31585a[_0x31cf('0x35')]['sort']);_0x3daa30[_0x31cf('0x3d')]=qs[_0x31cf('0x36')](_[_0x31cf('0x3e')](_0x31585a[_0x31cf('0x35')],_0x1ee622[_0x31cf('0x36')]),_0x3449f3);if(_0x31585a[_0x31cf('0x35')]['filter']){_0x3daa30[_0x31cf('0x3d')]=_[_0x31cf('0x3f')](_0x3daa30[_0x31cf('0x3d')],{'$or':_[_0x31cf('0x2f')](_0x3449f3,function(_0x2b5735){if(_0x2b5735[_0x31cf('0x32')]!==_0x31cf('0x40')){var _0x40ef88={};_0x40ef88[_0x2b5735[_0x31cf('0x2c')]]={'$like':'%'+_0x31585a['query'][_0x31cf('0x41')]+'%'};return _0x40ef88;}})});}_0x3daa30=_['merge']({},_0x3daa30,_0x31585a['options']);var _0x35966f={'where':_0x3daa30[_0x31cf('0x3d')]};return db[_0x31cf('0x30')][_0x31cf('0x21')](_0x35966f)['then'](function(_0x25704f){_0x468dee[_0x31cf('0x21')]=_0x25704f;if(_0x31585a[_0x31cf('0x35')][_0x31cf('0x42')]){_0x3daa30[_0x31cf('0x43')]=[{'all':!![]}];}return db[_0x31cf('0x30')]['findAll'](_0x3daa30);})['then'](function(_0x44c1b2){_0x468dee[_0x31cf('0x44')]=_0x44c1b2;return _0x468dee;})[_0x31cf('0x27')](respondWithFilteredResult(_0x80372c,_0x3daa30))[_0x31cf('0x45')](handleError(_0x80372c,null));};exports[_0x31cf('0x46')]=function(_0x8e2f81,_0x430ee5){var _0x464667={'raw':![],'where':{'id':_0x8e2f81[_0x31cf('0x47')]['id']}},_0x3615da={};_0x3615da[_0x31cf('0x34')]=_[_0x31cf('0x48')](db[_0x31cf('0x30')][_0x31cf('0x31')]);_0x3615da[_0x31cf('0x35')]=_['keys'](_0x8e2f81[_0x31cf('0x35')]);_0x3615da[_0x31cf('0x36')]=_['intersection'](_0x3615da[_0x31cf('0x34')],_0x3615da[_0x31cf('0x35')]);_0x464667[_0x31cf('0x38')]=_[_0x31cf('0x37')](_0x3615da[_0x31cf('0x34')],qs[_0x31cf('0x39')](_0x8e2f81[_0x31cf('0x35')][_0x31cf('0x39')]));_0x464667[_0x31cf('0x38')]=_0x464667[_0x31cf('0x38')][_0x31cf('0x3a')]?_0x464667[_0x31cf('0x38')]:_0x3615da[_0x31cf('0x34')];if(_0x8e2f81[_0x31cf('0x35')][_0x31cf('0x42')]){_0x464667['include']=[{'all':!![]}];}_0x464667=_['merge']({},_0x464667,_0x8e2f81['options']);return db['VoiceChanSpy'][_0x31cf('0x49')](_0x464667)[_0x31cf('0x27')](handleEntityNotFound(_0x430ee5,null))[_0x31cf('0x27')](respondWithResult(_0x430ee5,null))['catch'](handleError(_0x430ee5,null));};exports[_0x31cf('0x4a')]=function(_0x1d01be,_0x1c96f1){return db['VoiceChanSpy'][_0x31cf('0x4a')](_0x1d01be[_0x31cf('0x4b')],{})[_0x31cf('0x27')](function(_0x53f7ee){var _0x533cc9=_0x1d01be[_0x31cf('0x4c')][_0x31cf('0x29')]({'plain':!![]});if(!_0x533cc9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x533cc9[_0x31cf('0x4d')]===_0x31cf('0x4c')){var _0x533a5b=_0x53f7ee['get']({'plain':!![]});var _0x1ee5b1=_0x31cf('0x2a');return db[_0x31cf('0x4e')][_0x31cf('0x49')]({'where':{'name':_0x1ee5b1,'userProfileId':_0x533cc9[_0x31cf('0x4f')]},'raw':!![]})[_0x31cf('0x27')](function(_0x433fef){if(_0x433fef&&_0x433fef[_0x31cf('0x50')]===0x0){return db[_0x31cf('0x51')][_0x31cf('0x4a')]({'name':_0x533a5b[_0x31cf('0x2c')],'resourceId':_0x533a5b['id'],'type':_0x433fef['name'],'sectionId':_0x433fef['id']},{})['then'](function(){return _0x53f7ee;});}else{return _0x53f7ee;}})[_0x31cf('0x45')](function(_0x5b3002){logger['error'](_0x31cf('0x52'),_0x5b3002);throw _0x5b3002;});}return _0x53f7ee;})['then'](respondWithResult(_0x1c96f1,0xc9))[_0x31cf('0x45')](handleError(_0x1c96f1,null));};exports[_0x31cf('0x26')]=function(_0x4a2ac1,_0x3ada08){if(_0x4a2ac1[_0x31cf('0x4b')]['id']){delete _0x4a2ac1['body']['id'];}return db['VoiceChanSpy'][_0x31cf('0x49')]({'where':{'id':_0x4a2ac1[_0x31cf('0x47')]['id']}})[_0x31cf('0x27')](handleEntityNotFound(_0x3ada08,null))['then'](saveUpdates(_0x4a2ac1['body'],null))[_0x31cf('0x27')](respondWithResult(_0x3ada08,null))[_0x31cf('0x45')](handleError(_0x3ada08,null));};exports[_0x31cf('0x28')]=function(_0x1a5960,_0x2c7de0){return db[_0x31cf('0x30')]['find']({'where':{'id':_0x1a5960['params']['id']}})[_0x31cf('0x27')](handleEntityNotFound(_0x2c7de0,null))[_0x31cf('0x27')](removeEntity(_0x2c7de0,null))[_0x31cf('0x45')](handleError(_0x2c7de0,null));}; \ No newline at end of file +var _0x32c0=['model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','options','include','findAll','catch','params','intersection','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','key'];(function(_0x3d53da,_0x3f0d17){var _0x153388=function(_0x3b9a30){while(--_0x3b9a30){_0x3d53da['push'](_0x3d53da['shift']());}};_0x153388(++_0x3f0d17);}(_0x32c0,0x1f3));var _0x032c=function(_0x12b1f8,_0xf1ef6e){_0x12b1f8=_0x12b1f8-0x0;var _0x53ae5d=_0x32c0[_0x12b1f8];return _0x53ae5d;};'use strict';var emlformat=require(_0x032c('0x0'));var rimraf=require(_0x032c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x032c('0x2'));var rp=require(_0x032c('0x3'));var moment=require('moment');var BPromise=require(_0x032c('0x4'));var Mustache=require(_0x032c('0x5'));var util=require(_0x032c('0x6'));var path=require(_0x032c('0x7'));var sox=require('sox');var csv=require(_0x032c('0x8'));var ejs=require(_0x032c('0x9'));var fs=require('fs');var fs_extra=require(_0x032c('0xa'));var _=require(_0x032c('0xb'));var squel=require('squel');var crypto=require(_0x032c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x032c('0xd'));var toCsv=require(_0x032c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x032c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x032c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x032c('0x10'));var logger=require(_0x032c('0x11'))(_0x032c('0x12'));var utils=require(_0x032c('0x13'));var config=require(_0x032c('0x14'));var licenseUtil=require(_0x032c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25af77,_0xc88e78){_0xc88e78=_0xc88e78||0xcc;return function(_0x364605){if(_0x364605){return _0x25af77[_0x032c('0x16')](_0xc88e78);}return _0x25af77['status'](_0xc88e78)[_0x032c('0x17')]();};}function respondWithResult(_0x2650d6,_0x1ec9d8){_0x1ec9d8=_0x1ec9d8||0xc8;return function(_0x216984){if(_0x216984){return _0x2650d6[_0x032c('0x18')](_0x1ec9d8)[_0x032c('0x19')](_0x216984);}};}function respondWithFilteredResult(_0x51266f,_0xb678d5){return function(_0x15ddb8){if(_0x15ddb8){var _0x3ebda8=typeof _0xb678d5[_0x032c('0x1a')]===_0x032c('0x1b')&&typeof _0xb678d5[_0x032c('0x1c')]==='undefined';var _0x1444bb=_0x15ddb8[_0x032c('0x1d')];var _0x4435ad=_0x3ebda8?0x0:_0xb678d5[_0x032c('0x1a')];var _0x2b2693=_0x3ebda8?_0x15ddb8[_0x032c('0x1d')]:_0xb678d5[_0x032c('0x1a')]+_0xb678d5[_0x032c('0x1c')];var _0x3a6f71;if(_0x2b2693>=_0x1444bb){_0x2b2693=_0x1444bb;_0x3a6f71=0xc8;}else{_0x3a6f71=0xce;}_0x51266f[_0x032c('0x18')](_0x3a6f71);return _0x51266f[_0x032c('0x1e')](_0x032c('0x1f'),_0x4435ad+'-'+_0x2b2693+'/'+_0x1444bb)[_0x032c('0x19')](_0x15ddb8);}return null;};}function patchUpdates(_0x515409){return function(_0x8a8f30){try{jsonpatch['apply'](_0x8a8f30,_0x515409,!![]);}catch(_0x5341e6){return BPromise['reject'](_0x5341e6);}return _0x8a8f30['save']();};}function saveUpdates(_0x2a24f7,_0x4c0c4b){return function(_0x2ce758){if(_0x2ce758){return _0x2ce758[_0x032c('0x20')](_0x2a24f7)[_0x032c('0x21')](function(_0x51ad8c){return _0x51ad8c;});}return null;};}function removeEntity(_0x135612,_0x16d40f){return function(_0x28ae24){if(_0x28ae24){return _0x28ae24[_0x032c('0x22')]()[_0x032c('0x21')](function(){var _0x54a46=_0x28ae24[_0x032c('0x23')]({'plain':!![]});var _0x58894b=_0x032c('0x24');return db[_0x032c('0x25')][_0x032c('0x22')]({'where':{'type':_0x58894b,'resourceId':_0x54a46['id']}})['then'](function(){return _0x28ae24;});})[_0x032c('0x21')](function(){_0x135612[_0x032c('0x18')](0xcc)[_0x032c('0x17')]();});}};}function handleEntityNotFound(_0x12e3df,_0x58de77){return function(_0x37a292){if(!_0x37a292){_0x12e3df[_0x032c('0x16')](0x194);}return _0x37a292;};}function handleError(_0x1a38e1,_0x3403b3){_0x3403b3=_0x3403b3||0x1f4;return function(_0x51d679){logger[_0x032c('0x26')](_0x51d679[_0x032c('0x27')]);if(_0x51d679[_0x032c('0x28')]){delete _0x51d679[_0x032c('0x28')];}_0x1a38e1[_0x032c('0x18')](_0x3403b3)[_0x032c('0x29')](_0x51d679);};}exports[_0x032c('0x2a')]=function(_0x5a2297,_0x50a3f8){var _0x3e99b1={},_0x5d0503={},_0x6f72ba={'count':0x0,'rows':[]};var _0x3bb5e3=_['map'](db[_0x032c('0x2b')][_0x032c('0x2c')],function(_0x3488f1){return{'name':_0x3488f1[_0x032c('0x2d')],'type':_0x3488f1['type'][_0x032c('0x2e')]};});_0x5d0503[_0x032c('0x2f')]=_['map'](_0x3bb5e3,_0x032c('0x28'));_0x5d0503[_0x032c('0x30')]=_[_0x032c('0x31')](_0x5a2297[_0x032c('0x30')]);_0x5d0503[_0x032c('0x32')]=_['intersection'](_0x5d0503[_0x032c('0x2f')],_0x5d0503['query']);_0x3e99b1[_0x032c('0x33')]=_['intersection'](_0x5d0503[_0x032c('0x2f')],qs[_0x032c('0x34')](_0x5a2297[_0x032c('0x30')][_0x032c('0x34')]));_0x3e99b1[_0x032c('0x33')]=_0x3e99b1[_0x032c('0x33')]['length']?_0x3e99b1[_0x032c('0x33')]:_0x5d0503[_0x032c('0x2f')];if(!_0x5a2297['query'][_0x032c('0x35')](_0x032c('0x36'))){_0x3e99b1[_0x032c('0x1c')]=qs['limit'](_0x5a2297[_0x032c('0x30')][_0x032c('0x1c')]);_0x3e99b1[_0x032c('0x1a')]=qs[_0x032c('0x1a')](_0x5a2297[_0x032c('0x30')][_0x032c('0x1a')]);}_0x3e99b1[_0x032c('0x37')]=qs['sort'](_0x5a2297[_0x032c('0x30')][_0x032c('0x38')]);_0x3e99b1[_0x032c('0x39')]=qs[_0x032c('0x32')](_[_0x032c('0x3a')](_0x5a2297[_0x032c('0x30')],_0x5d0503[_0x032c('0x32')]),_0x3bb5e3);if(_0x5a2297[_0x032c('0x30')]['filter']){_0x3e99b1[_0x032c('0x39')]=_['merge'](_0x3e99b1[_0x032c('0x39')],{'$or':_['map'](_0x3bb5e3,function(_0x5f1881){if(_0x5f1881[_0x032c('0x3b')]!==_0x032c('0x3c')){var _0x5ef439={};_0x5ef439[_0x5f1881['name']]={'$like':'%'+_0x5a2297[_0x032c('0x30')]['filter']+'%'};return _0x5ef439;}})});}_0x3e99b1=_['merge']({},_0x3e99b1,_0x5a2297[_0x032c('0x3d')]);var _0x6a9676={'where':_0x3e99b1[_0x032c('0x39')]};return db[_0x032c('0x2b')][_0x032c('0x1d')](_0x6a9676)[_0x032c('0x21')](function(_0x49b83a){_0x6f72ba[_0x032c('0x1d')]=_0x49b83a;if(_0x5a2297['query']['includeAll']){_0x3e99b1[_0x032c('0x3e')]=[{'all':!![]}];}return db[_0x032c('0x2b')][_0x032c('0x3f')](_0x3e99b1);})[_0x032c('0x21')](function(_0x47360a){_0x6f72ba['rows']=_0x47360a;return _0x6f72ba;})['then'](respondWithFilteredResult(_0x50a3f8,_0x3e99b1))[_0x032c('0x40')](handleError(_0x50a3f8,null));};exports['show']=function(_0x3ed5c9,_0x43ba20){var _0x3f3891={'raw':![],'where':{'id':_0x3ed5c9[_0x032c('0x41')]['id']}},_0x2e2df8={};_0x2e2df8[_0x032c('0x2f')]=_[_0x032c('0x31')](db[_0x032c('0x2b')][_0x032c('0x2c')]);_0x2e2df8['query']=_[_0x032c('0x31')](_0x3ed5c9['query']);_0x2e2df8['filters']=_[_0x032c('0x42')](_0x2e2df8[_0x032c('0x2f')],_0x2e2df8[_0x032c('0x30')]);_0x3f3891[_0x032c('0x33')]=_[_0x032c('0x42')](_0x2e2df8['model'],qs['fields'](_0x3ed5c9['query'][_0x032c('0x34')]));_0x3f3891['attributes']=_0x3f3891[_0x032c('0x33')][_0x032c('0x43')]?_0x3f3891['attributes']:_0x2e2df8[_0x032c('0x2f')];if(_0x3ed5c9[_0x032c('0x30')][_0x032c('0x44')]){_0x3f3891[_0x032c('0x3e')]=[{'all':!![]}];}_0x3f3891=_[_0x032c('0x45')]({},_0x3f3891,_0x3ed5c9[_0x032c('0x3d')]);return db[_0x032c('0x2b')][_0x032c('0x46')](_0x3f3891)[_0x032c('0x21')](handleEntityNotFound(_0x43ba20,null))['then'](respondWithResult(_0x43ba20,null))[_0x032c('0x40')](handleError(_0x43ba20,null));};exports['create']=function(_0x367638,_0x13f1a7){return db[_0x032c('0x2b')][_0x032c('0x47')](_0x367638[_0x032c('0x48')],{})[_0x032c('0x21')](function(_0x1eed24){var _0x110a5f=_0x367638[_0x032c('0x49')]['get']({'plain':!![]});if(!_0x110a5f)throw new Error(_0x032c('0x4a'));if(_0x110a5f['role']===_0x032c('0x49')){var _0x2f1032=_0x1eed24['get']({'plain':!![]});var _0x3fd7dc=_0x032c('0x24');return db['UserProfileSection'][_0x032c('0x46')]({'where':{'name':_0x3fd7dc,'userProfileId':_0x110a5f[_0x032c('0x4b')]},'raw':!![]})[_0x032c('0x21')](function(_0x4ff7f7){if(_0x4ff7f7&&_0x4ff7f7[_0x032c('0x4c')]===0x0){return db[_0x032c('0x25')][_0x032c('0x47')]({'name':_0x2f1032[_0x032c('0x28')],'resourceId':_0x2f1032['id'],'type':_0x4ff7f7[_0x032c('0x28')],'sectionId':_0x4ff7f7['id']},{})[_0x032c('0x21')](function(){return _0x1eed24;});}else{return _0x1eed24;}})[_0x032c('0x40')](function(_0x3d6749){logger[_0x032c('0x26')](_0x032c('0x4d'),_0x3d6749);throw _0x3d6749;});}return _0x1eed24;})['then'](respondWithResult(_0x13f1a7,0xc9))[_0x032c('0x40')](handleError(_0x13f1a7,null));};exports[_0x032c('0x20')]=function(_0x28bb7c,_0x100d0b){if(_0x28bb7c[_0x032c('0x48')]['id']){delete _0x28bb7c[_0x032c('0x48')]['id'];}return db[_0x032c('0x2b')][_0x032c('0x46')]({'where':{'id':_0x28bb7c['params']['id']}})[_0x032c('0x21')](handleEntityNotFound(_0x100d0b,null))[_0x032c('0x21')](saveUpdates(_0x28bb7c[_0x032c('0x48')],null))[_0x032c('0x21')](respondWithResult(_0x100d0b,null))[_0x032c('0x40')](handleError(_0x100d0b,null));};exports['destroy']=function(_0x3ca559,_0x157324){return db[_0x032c('0x2b')][_0x032c('0x46')]({'where':{'id':_0x3ca559[_0x032c('0x41')]['id']}})[_0x032c('0x21')](handleEntityNotFound(_0x157324,null))[_0x032c('0x21')](removeEntity(_0x157324,null))[_0x032c('0x40')](handleError(_0x157324,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 1f241bc..660c40c 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 _0x84c0=['SIP/%s,%s','name','options','StopMixMonitor','concat','internal','User','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','length','bulkCreate','VoiceExtension','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','system','Set','format','CDR(type)=%s','chanspy','record','push','merge','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy'];(function(_0x1a5284,_0x23d1c0){var _0x444cee=function(_0x44b0ab){while(--_0x44b0ab){_0x1a5284['push'](_0x1a5284['shift']());}};_0x444cee(++_0x23d1c0);}(_0x84c0,0x143));var _0x084c=function(_0x58666a,_0x33d8b7){_0x58666a=_0x58666a-0x0;var _0x4d2990=_0x84c0[_0x58666a];return _0x4d2990;};'use strict';var _=require('lodash');var util=require(_0x084c('0x0'));var BPromise=require(_0x084c('0x1'));var attributes=require(_0x084c('0x2'));var getUserApplications=function(_0x595c09,_0x144e43,_0x33f2ef){var _0x7bfae9=0x1;var _0x53f852=[];var _0x383a8d={'context':_0x144e43[_0x084c('0x3')]||_0x084c('0x4'),'exten':util['format'](_0x084c('0x5'),_0x595c09['prefix'],_0x33f2ef),'type':_0x084c('0x6'),'isApp':![],'ChanSpyId':_0x595c09['id'],'UserId':_0x144e43['id']};_0x53f852['push'](_['merge']({'app':_0x084c('0x7'),'appdata':util[_0x084c('0x8')](_0x084c('0x9'),_0x084c('0xa')),'priority':_0x7bfae9++},_0x383a8d));if(_0x595c09[_0x084c('0xb')]){_0x53f852[_0x084c('0xc')](_[_0x084c('0xd')]({'app':'MixMonitor','appdata':util[_0x084c('0x8')](_0x084c('0xe'),_0x595c09[_0x084c('0xf')]),'priority':_0x7bfae9++},_0x383a8d));}if(_0x595c09['auth']){_0x53f852[_0x084c('0xc')](_[_0x084c('0xd')]({'app':_0x084c('0x10'),'appdata':_0x595c09[_0x084c('0x11')],'priority':_0x7bfae9++},_0x383a8d));}_0x53f852[_0x084c('0xc')](_[_0x084c('0xd')]({'app':_0x084c('0x12'),'appdata':util['format'](_0x084c('0x13'),_0x144e43[_0x084c('0x14')],_0x595c09['options']?_0x595c09[_0x084c('0x15')]['join'](''):''),'priority':_0x7bfae9++},_0x383a8d));if(_0x595c09[_0x084c('0xb')]){_0x53f852[_0x084c('0xc')](_[_0x084c('0xd')]({'app':_0x084c('0x16'),'priority':_0x7bfae9++},_0x383a8d));}return _0x53f852;};var getChanSpyApplications=function(_0x39be5f,_0x879b11){var _0x4c0699=[];for(var _0x1b94d2=0x0,_0x21d0cb=0x1;_0x1b94d2<_0x879b11['length'];_0x1b94d2++,_0x21d0cb=0x1){_0x4c0699=_0x4c0699[_0x084c('0x17')](getUserApplications(_0x39be5f,_0x879b11[_0x1b94d2],_0x879b11[_0x1b94d2][_0x084c('0x18')]));if(_0x879b11[_0x1b94d2][_0x084c('0x18')]!=_0x879b11[_0x1b94d2][_0x084c('0x14')]){_0x4c0699=_0x4c0699[_0x084c('0x17')](getUserApplications(_0x39be5f,_0x879b11[_0x1b94d2],_0x879b11[_0x1b94d2][_0x084c('0x14')]));}}return _0x4c0699;};var getChanSpyPromise=function(_0x3ad36e,_0x33641f){return new BPromise(function(_0x48455d,_0x2223a5){return _0x3ad36e[_0x084c('0x19')]['findAll']({'attributes':['id',_0x084c('0x14'),'internal'],'where':{'role':_0x084c('0x1a'),'chanspy':!![]},'raw':!![]})[_0x084c('0x1b')](function(_0x4362de){if(_0x4362de){return _0x48455d(getChanSpyApplications(_0x33641f,_0x4362de));}return _0x48455d([]);})[_0x084c('0x1c')](function(_0x26ebc9){_0x2223a5(_0x26ebc9);});});};module[_0x084c('0x1d')]=function(_0xa13c37,_0x181d2d){var _0x225771=_0xa13c37[_0x084c('0x1e')];return _0xa13c37[_0x084c('0x1f')](_0x084c('0x20'),attributes,{'tableName':_0x084c('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a961a,_0x59fd29,_0x12edb9){return getChanSpyPromise(_0x225771,_0x2a961a)['then'](function(_0x1112eb){if(_0x1112eb&&_0x1112eb[_0x084c('0x22')]){return _0x225771['VoiceExtension'][_0x084c('0x23')](_0x1112eb);}})[_0x084c('0x1b')](function(){_0x12edb9();})['catch'](function(_0x3d47f2){_0x12edb9(_0x3d47f2);});},'afterUpdate':function(_0x1bbe54,_0x1065ae,_0x4c8a56){return _0x225771[_0x084c('0x24')][_0x084c('0x25')]({'where':{'ChanSpyId':_0x1bbe54['id']}})['then'](function(){return getChanSpyPromise(_0x225771,_0x1bbe54);})[_0x084c('0x1b')](function(_0x36038b){if(_0x36038b&&_0x36038b[_0x084c('0x22')]){return _0x225771[_0x084c('0x24')]['bulkCreate'](_0x36038b);}})['then'](function(){_0x4c8a56();})[_0x084c('0x1c')](function(_0x386bc5){_0x4c8a56(_0x386bc5);});},'afterDestroy':function(_0x4d612b,_0x128d15,_0x17c25f){return _0x225771[_0x084c('0x24')][_0x084c('0x25')]({'where':{'ChanSpyId':_0x4d612b['id']}})[_0x084c('0x1b')](function(){_0x17c25f();})['catch'](function(_0x17d91e){_0x17c25f(_0x17d91e);});}}});}; \ No newline at end of file +var _0xa3c1=['length','concat','internal','findAll','agent','then','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','prefix','system','merge','Set','CDR(type)=%s','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','SIP/%s,%s','name','options','join','record','StopMixMonitor'];(function(_0x38c908,_0x5b07c4){var _0x4f6ffd=function(_0x317c89){while(--_0x317c89){_0x38c908['push'](_0x38c908['shift']());}};_0x4f6ffd(++_0x5b07c4);}(_0xa3c1,0xa2));var _0x1a3c=function(_0x237e70,_0x217052){_0x237e70=_0x237e70-0x0;var _0x5d93e6=_0xa3c1[_0x237e70];return _0x5d93e6;};'use strict';var _=require(_0x1a3c('0x0'));var util=require(_0x1a3c('0x1'));var BPromise=require(_0x1a3c('0x2'));var attributes=require(_0x1a3c('0x3'));var getUserApplications=function(_0x32295c,_0x5c38d6,_0xf6f70b){var _0x222047=0x1;var _0x51dbaf=[];var _0x19da88={'context':_0x5c38d6[_0x1a3c('0x4')]||'from-sip','exten':util[_0x1a3c('0x5')]('%s%s',_0x32295c[_0x1a3c('0x6')],_0xf6f70b),'type':_0x1a3c('0x7'),'isApp':![],'ChanSpyId':_0x32295c['id'],'UserId':_0x5c38d6['id']};_0x51dbaf['push'](_[_0x1a3c('0x8')]({'app':_0x1a3c('0x9'),'appdata':util[_0x1a3c('0x5')](_0x1a3c('0xa'),'chanspy'),'priority':_0x222047++},_0x19da88));if(_0x32295c['record']){_0x51dbaf[_0x1a3c('0xb')](_[_0x1a3c('0x8')]({'app':_0x1a3c('0xc'),'appdata':util['format'](_0x1a3c('0xd'),_0x32295c[_0x1a3c('0xe')]),'priority':_0x222047++},_0x19da88));}if(_0x32295c[_0x1a3c('0xf')]){_0x51dbaf[_0x1a3c('0xb')](_[_0x1a3c('0x8')]({'app':'Authenticate','appdata':_0x32295c[_0x1a3c('0x10')],'priority':_0x222047++},_0x19da88));}_0x51dbaf[_0x1a3c('0xb')](_[_0x1a3c('0x8')]({'app':'ChanSpy','appdata':util['format'](_0x1a3c('0x11'),_0x5c38d6[_0x1a3c('0x12')],_0x32295c[_0x1a3c('0x13')]?_0x32295c['options'][_0x1a3c('0x14')](''):''),'priority':_0x222047++},_0x19da88));if(_0x32295c[_0x1a3c('0x15')]){_0x51dbaf['push'](_[_0x1a3c('0x8')]({'app':_0x1a3c('0x16'),'priority':_0x222047++},_0x19da88));}return _0x51dbaf;};var getChanSpyApplications=function(_0x9bbe1c,_0x5e81c2){var _0x3907b7=[];for(var _0x4e03d7=0x0,_0x245883=0x1;_0x4e03d7<_0x5e81c2[_0x1a3c('0x17')];_0x4e03d7++,_0x245883=0x1){_0x3907b7=_0x3907b7[_0x1a3c('0x18')](getUserApplications(_0x9bbe1c,_0x5e81c2[_0x4e03d7],_0x5e81c2[_0x4e03d7][_0x1a3c('0x19')]));if(_0x5e81c2[_0x4e03d7]['internal']!=_0x5e81c2[_0x4e03d7][_0x1a3c('0x12')]){_0x3907b7=_0x3907b7[_0x1a3c('0x18')](getUserApplications(_0x9bbe1c,_0x5e81c2[_0x4e03d7],_0x5e81c2[_0x4e03d7][_0x1a3c('0x12')]));}}return _0x3907b7;};var getChanSpyPromise=function(_0x145c00,_0x515774){return new BPromise(function(_0x1a426a,_0x2f9aa0){return _0x145c00['User'][_0x1a3c('0x1a')]({'attributes':['id',_0x1a3c('0x12'),_0x1a3c('0x19')],'where':{'role':_0x1a3c('0x1b'),'chanspy':!![]},'raw':!![]})[_0x1a3c('0x1c')](function(_0x400b9c){if(_0x400b9c){return _0x1a426a(getChanSpyApplications(_0x515774,_0x400b9c));}return _0x1a426a([]);})['catch'](function(_0x4debc3){_0x2f9aa0(_0x4debc3);});});};module[_0x1a3c('0x1d')]=function(_0x3e555b,_0x3e466e){var _0x2d9e24=_0x3e555b[_0x1a3c('0x1e')];return _0x3e555b['define'](_0x1a3c('0x1f'),attributes,{'tableName':_0x1a3c('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xa4afe4,_0x2d84a8,_0x43edb9){return getChanSpyPromise(_0x2d9e24,_0xa4afe4)['then'](function(_0x10b858){if(_0x10b858&&_0x10b858[_0x1a3c('0x17')]){return _0x2d9e24[_0x1a3c('0x21')][_0x1a3c('0x22')](_0x10b858);}})[_0x1a3c('0x1c')](function(){_0x43edb9();})[_0x1a3c('0x23')](function(_0x21ef1b){_0x43edb9(_0x21ef1b);});},'afterUpdate':function(_0xcdd704,_0x42b2c7,_0x55f574){return _0x2d9e24[_0x1a3c('0x21')][_0x1a3c('0x24')]({'where':{'ChanSpyId':_0xcdd704['id']}})['then'](function(){return getChanSpyPromise(_0x2d9e24,_0xcdd704);})['then'](function(_0x2fe762){if(_0x2fe762&&_0x2fe762[_0x1a3c('0x17')]){return _0x2d9e24[_0x1a3c('0x21')][_0x1a3c('0x22')](_0x2fe762);}})[_0x1a3c('0x1c')](function(){_0x55f574();})[_0x1a3c('0x23')](function(_0x17670c){_0x55f574(_0x17670c);});},'afterDestroy':function(_0x298441,_0x230050,_0x3f2fdf){return _0x2d9e24[_0x1a3c('0x21')][_0x1a3c('0x24')]({'where':{'ChanSpyId':_0x298441['id']}})['then'](function(){_0x3f2fdf();})[_0x1a3c('0x23')](function(_0x19c0e1){_0x3f2fdf(_0x19c0e1);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 848fdff..064d561 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 _0x1306=['client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x32d7d6,_0x1ed1f0){var _0x14f8a1=function(_0x59d907){while(--_0x59d907){_0x32d7d6['push'](_0x32d7d6['shift']());}};_0x14f8a1(++_0x1ed1f0);}(_0x1306,0x17a));var _0x6130=function(_0x53c428,_0x29116b){_0x53c428=_0x53c428-0x0;var _0x1ef208=_0x1306[_0x53c428];return _0x1ef208;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db089,_0x25469a,_0x354501){return new BPromise(function(_0x288b1d,_0x13163f){return client[_0x6130('0xe')](_0x1db089,_0x354501)[_0x6130('0xf')](function(_0x33b116){logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));logger[_0x6130('0x13')](_0x6130('0x14'),_0x25469a,_0x6130('0x12'),JSON[_0x6130('0x15')](_0x33b116));if(_0x33b116['error']){if(_0x33b116[_0x6130('0x16')]['code']===0x1f4){logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116['error'][_0x6130('0x17')]);return _0x13163f(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);return _0x288b1d(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}else{logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));_0x288b1d(_0x33b116[_0x6130('0x18')][_0x6130('0x17')]);}})[_0x6130('0x19')](function(_0x46c2e3){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x25469a,_0x46c2e3);_0x13163f(_0x46c2e3);});});} \ No newline at end of file +var _0x19ea=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x50f2a2,_0x1e5f90){var _0x3b6449=function(_0x3469a9){while(--_0x3469a9){_0x50f2a2['push'](_0x50f2a2['shift']());}};_0x3b6449(++_0x1e5f90);}(_0x19ea,0xfe));var _0xa19e=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x19ea[_0x484c03];return _0x294127;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 80c5074..8db835c 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 _0x56e5=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x359f78,_0x1599e9){var _0x1fec1d=function(_0x423de6){while(--_0x423de6){_0x359f78['push'](_0x359f78['shift']());}};_0x1fec1d(++_0x1599e9);}(_0x56e5,0x10e));var _0x556e=function(_0x352580,_0x40db47){_0x352580=_0x352580-0x0;var _0x459385=_0x56e5[_0x352580];return _0x459385;};'use strict';var multer=require(_0x556e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x556e('0x1'));var express=require(_0x556e('0x2'));var router=express[_0x556e('0x3')]();var fs_extra=require(_0x556e('0x4'));var auth=require(_0x556e('0x5'));var interaction=require(_0x556e('0x6'));var config=require(_0x556e('0x7'));var controller=require('./voiceContext.controller');router[_0x556e('0x8')]('/',auth['isAuthenticated'](),controller[_0x556e('0x9')]);router[_0x556e('0x8')](_0x556e('0xa'),auth[_0x556e('0xb')](),controller[_0x556e('0xc')]);router[_0x556e('0xd')]('/',auth['isAuthenticated'](),controller[_0x556e('0xe')]);router[_0x556e('0xf')](_0x556e('0xa'),auth[_0x556e('0xb')](),controller[_0x556e('0x10')]);router[_0x556e('0x11')]('/:id',auth[_0x556e('0xb')](),controller[_0x556e('0x12')]);module[_0x556e('0x13')]=router; \ No newline at end of file +var _0x1c7f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','Router'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x1c7f,0x1e2));var _0xf1c7=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x1c7f[_0x532112];return _0x23e5fb;};'use strict';var multer=require(_0xf1c7('0x0'));var util=require('util');var path=require(_0xf1c7('0x1'));var timeout=require(_0xf1c7('0x2'));var express=require('express');var router=express[_0xf1c7('0x3')]();var fs_extra=require(_0xf1c7('0x4'));var auth=require(_0xf1c7('0x5'));var interaction=require(_0xf1c7('0x6'));var config=require(_0xf1c7('0x7'));var controller=require(_0xf1c7('0x8'));router[_0xf1c7('0x9')]('/',auth[_0xf1c7('0xa')](),controller['index']);router[_0xf1c7('0x9')](_0xf1c7('0xb'),auth[_0xf1c7('0xa')](),controller['show']);router[_0xf1c7('0xc')]('/',auth[_0xf1c7('0xa')](),controller[_0xf1c7('0xd')]);router[_0xf1c7('0xe')](_0xf1c7('0xb'),auth[_0xf1c7('0xa')](),controller[_0xf1c7('0xf')]);router[_0xf1c7('0x10')]('/:id',auth[_0xf1c7('0xa')](),controller['destroy']);module[_0xf1c7('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index dd3cc56..83d4ed3 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 _0x9ced=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x28177d,_0x310874){var _0x1f097e=function(_0x139588){while(--_0x139588){_0x28177d['push'](_0x28177d['shift']());}};_0x1f097e(++_0x310874);}(_0x9ced,0x167));var _0xd9ce=function(_0x1eadfb,_0xc1e08b){_0x1eadfb=_0x1eadfb-0x0;var _0x5500fc=_0x9ced[_0x1eadfb];return _0x5500fc;};'use strict';var Sequelize=require(_0xd9ce('0x0'));module[_0xd9ce('0x1')]={'name':{'type':Sequelize[_0xd9ce('0x2')],'unique':_0xd9ce('0x3')},'description':{'type':Sequelize[_0xd9ce('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd9ce('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbad6=['BOOLEAN','exports','STRING'];(function(_0x5a6503,_0x4935fd){var _0x3692ab=function(_0x27c9ee){while(--_0x27c9ee){_0x5a6503['push'](_0x5a6503['shift']());}};_0x3692ab(++_0x4935fd);}(_0xbad6,0x1f0));var _0x6bad=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbad6[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x6bad('0x0')]={'name':{'type':Sequelize[_0x6bad('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x6bad('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6bad('0x2')],'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 3efcb90..63f8c6b 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 _0xef50=['save','update','then','destroy','get','UserProfileResource','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','VoiceContext','include','show','params','length','includeAll','find','create','findAll','join','root','server/files/templates/context.ejs','utf8','render','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','readFileSync','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','client','http','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x56989c,_0x6781f0){var _0x22ab27=function(_0x390034){while(--_0x390034){_0x56989c['push'](_0x56989c['shift']());}};_0x22ab27(++_0x6781f0);}(_0xef50,0x175));var _0x0ef5=function(_0xacaaf1,_0x2a5d9e){_0xacaaf1=_0xacaaf1-0x0;var _0xe60f12=_0xef50[_0xacaaf1];return _0xe60f12;};'use strict';var emlformat=require(_0x0ef5('0x0'));var rimraf=require(_0x0ef5('0x1'));var zipdir=require(_0x0ef5('0x2'));var jsonpatch=require(_0x0ef5('0x3'));var rp=require(_0x0ef5('0x4'));var moment=require(_0x0ef5('0x5'));var BPromise=require(_0x0ef5('0x6'));var Mustache=require(_0x0ef5('0x7'));var util=require(_0x0ef5('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x0ef5('0x9'));var ejs=require(_0x0ef5('0xa'));var fs=require('fs');var fs_extra=require(_0x0ef5('0xb'));var _=require(_0x0ef5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0ef5('0xd'));var deskjs=require(_0x0ef5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ef5('0xf'));var Papa=require(_0x0ef5('0x10'));var Redis=require(_0x0ef5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0ef5('0x12'));var as=require(_0x0ef5('0x13'));var hardwareService=require(_0x0ef5('0x14'));var logger=require('../../config/logger')(_0x0ef5('0x15'));var utils=require(_0x0ef5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0ef5('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x0ef5('0x18')][_0x0ef5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x276ef8,_0x5028bc,_0x5160ef,_0x3756dd){return new BPromise(function(_0x659145,_0x31a10b){var _0x2a4f86=_0x3756dd||client;return _0x2a4f86[_0x0ef5('0x1a')](_0x276ef8,_0x5160ef)['then'](function(_0x47cebc){logger[_0x0ef5('0x1b')](_0x0ef5('0x1c'),_0x5028bc,'request\x20sent');logger[_0x0ef5('0x1d')](_0x0ef5('0x1e'),_0x5028bc,_0x0ef5('0x1f'),JSON['stringify'](_0x47cebc));if(_0x47cebc[_0x0ef5('0x20')]){if(_0x47cebc['error'][_0x0ef5('0x21')]===0x1f4){logger[_0x0ef5('0x20')](_0x0ef5('0x1c'),_0x5028bc,_0x47cebc[_0x0ef5('0x20')][_0x0ef5('0x22')]);return _0x31a10b(_0x47cebc[_0x0ef5('0x20')][_0x0ef5('0x22')]);}logger[_0x0ef5('0x20')](_0x0ef5('0x1c'),_0x5028bc,_0x47cebc['error'][_0x0ef5('0x22')]);return _0x659145(_0x47cebc[_0x0ef5('0x20')][_0x0ef5('0x22')]);}else{logger['info'](_0x0ef5('0x1c'),_0x5028bc,_0x0ef5('0x1f'));_0x659145(_0x47cebc['result']['message']);}})[_0x0ef5('0x23')](function(_0x3c4c8e){logger[_0x0ef5('0x20')](_0x0ef5('0x1c'),_0x5028bc,_0x3c4c8e);_0x31a10b(_0x3c4c8e);});});}function respondWithStatusCode(_0xdbd748,_0x407ced){_0x407ced=_0x407ced||0xcc;return function(_0x75e2ba){if(_0x75e2ba){return _0xdbd748[_0x0ef5('0x24')](_0x407ced);}return _0xdbd748[_0x0ef5('0x25')](_0x407ced)['end']();};}function respondWithResult(_0x54aa58,_0x401082){_0x401082=_0x401082||0xc8;return function(_0x2e61a6){if(_0x2e61a6){return _0x54aa58[_0x0ef5('0x25')](_0x401082)[_0x0ef5('0x26')](_0x2e61a6);}};}function respondWithFilteredResult(_0x562360,_0x212e21){return function(_0x16bfd2){if(_0x16bfd2){var _0x54d9ae=typeof _0x212e21[_0x0ef5('0x27')]===_0x0ef5('0x28')&&typeof _0x212e21[_0x0ef5('0x29')]===_0x0ef5('0x28');var _0x158ed3=_0x16bfd2[_0x0ef5('0x2a')];var _0x29ea4a=_0x54d9ae?0x0:_0x212e21[_0x0ef5('0x27')];var _0x255a5f=_0x54d9ae?_0x16bfd2[_0x0ef5('0x2a')]:_0x212e21[_0x0ef5('0x27')]+_0x212e21['limit'];var _0x4cbc1a;if(_0x255a5f>=_0x158ed3){_0x255a5f=_0x158ed3;_0x4cbc1a=0xc8;}else{_0x4cbc1a=0xce;}_0x562360[_0x0ef5('0x25')](_0x4cbc1a);return _0x562360[_0x0ef5('0x2b')](_0x0ef5('0x2c'),_0x29ea4a+'-'+_0x255a5f+'/'+_0x158ed3)[_0x0ef5('0x26')](_0x16bfd2);}return null;};}function patchUpdates(_0x57684f){return function(_0x3dae0e){try{jsonpatch[_0x0ef5('0x2d')](_0x3dae0e,_0x57684f,!![]);}catch(_0x1eaca4){return BPromise[_0x0ef5('0x2e')](_0x1eaca4);}return _0x3dae0e[_0x0ef5('0x2f')]();};}function saveUpdates(_0x484fd5,_0x1392ef){return function(_0x12d9c8){if(_0x12d9c8){return _0x12d9c8[_0x0ef5('0x30')](_0x484fd5)[_0x0ef5('0x31')](function(_0x28c989){return _0x28c989;});}return null;};}function removeEntity(_0x5643b1,_0x3dd7f3){return function(_0x15794d){if(_0x15794d){return _0x15794d[_0x0ef5('0x32')]()['then'](function(){var _0x2c4d66=_0x15794d[_0x0ef5('0x33')]({'plain':!![]});var _0x209b31='Contexts';return db[_0x0ef5('0x34')]['destroy']({'where':{'type':_0x209b31,'resourceId':_0x2c4d66['id']}})[_0x0ef5('0x31')](function(){return _0x15794d;});})[_0x0ef5('0x31')](function(){_0x5643b1['status'](0xcc)[_0x0ef5('0x35')]();});}};}function handleEntityNotFound(_0x366083,_0x22a126){return function(_0x46aa08){if(!_0x46aa08){_0x366083[_0x0ef5('0x24')](0x194);}return _0x46aa08;};}function handleError(_0x15ca83,_0x1acc07){_0x1acc07=_0x1acc07||0x1f4;return function(_0x3b5526){logger['error'](_0x3b5526[_0x0ef5('0x36')]);if(_0x3b5526[_0x0ef5('0x37')]){delete _0x3b5526[_0x0ef5('0x37')];}_0x15ca83[_0x0ef5('0x25')](_0x1acc07)[_0x0ef5('0x38')](_0x3b5526);};}exports['index']=function(_0x3b3326,_0x5464c0){var _0x5e0118={},_0x35cb7c={},_0x352527={'count':0x0,'rows':[]};var _0x3379de=_[_0x0ef5('0x39')](db['VoiceContext'][_0x0ef5('0x3a')],function(_0x359232){return{'name':_0x359232[_0x0ef5('0x3b')],'type':_0x359232[_0x0ef5('0x3c')][_0x0ef5('0x3d')]};});_0x35cb7c[_0x0ef5('0x3e')]=_[_0x0ef5('0x39')](_0x3379de,_0x0ef5('0x37'));_0x35cb7c[_0x0ef5('0x3f')]=_[_0x0ef5('0x40')](_0x3b3326['query']);_0x35cb7c[_0x0ef5('0x41')]=_[_0x0ef5('0x42')](_0x35cb7c[_0x0ef5('0x3e')],_0x35cb7c[_0x0ef5('0x3f')]);_0x5e0118['attributes']=_[_0x0ef5('0x42')](_0x35cb7c[_0x0ef5('0x3e')],qs['fields'](_0x3b3326[_0x0ef5('0x3f')][_0x0ef5('0x43')]));_0x5e0118['attributes']=_0x5e0118['attributes']['length']?_0x5e0118[_0x0ef5('0x44')]:_0x35cb7c[_0x0ef5('0x3e')];if(!_0x3b3326[_0x0ef5('0x3f')][_0x0ef5('0x45')](_0x0ef5('0x46'))){_0x5e0118[_0x0ef5('0x29')]=qs[_0x0ef5('0x29')](_0x3b3326[_0x0ef5('0x3f')]['limit']);_0x5e0118[_0x0ef5('0x27')]=qs[_0x0ef5('0x27')](_0x3b3326[_0x0ef5('0x3f')][_0x0ef5('0x27')]);}_0x5e0118[_0x0ef5('0x47')]=qs[_0x0ef5('0x48')](_0x3b3326['query'][_0x0ef5('0x48')]);_0x5e0118['where']=qs[_0x0ef5('0x41')](_[_0x0ef5('0x49')](_0x3b3326[_0x0ef5('0x3f')],_0x35cb7c[_0x0ef5('0x41')]),_0x3379de);if(_0x3b3326[_0x0ef5('0x3f')][_0x0ef5('0x4a')]){_0x5e0118[_0x0ef5('0x4b')]=_['merge'](_0x5e0118[_0x0ef5('0x4b')],{'$or':_['map'](_0x3379de,function(_0x4003c7){if(_0x4003c7['type']!==_0x0ef5('0x4c')){var _0x572f8e={};_0x572f8e[_0x4003c7[_0x0ef5('0x37')]]={'$like':'%'+_0x3b3326[_0x0ef5('0x3f')][_0x0ef5('0x4a')]+'%'};return _0x572f8e;}})});}_0x5e0118=_[_0x0ef5('0x4d')]({},_0x5e0118,_0x3b3326['options']);var _0x56484c={'where':_0x5e0118[_0x0ef5('0x4b')]};return db[_0x0ef5('0x4e')][_0x0ef5('0x2a')](_0x56484c)[_0x0ef5('0x31')](function(_0x3a7471){_0x352527['count']=_0x3a7471;if(_0x3b3326[_0x0ef5('0x3f')]['includeAll']){_0x5e0118[_0x0ef5('0x4f')]=[{'all':!![]}];}return db[_0x0ef5('0x4e')]['findAll'](_0x5e0118);})[_0x0ef5('0x31')](function(_0x527666){_0x352527['rows']=_0x527666;return _0x352527;})[_0x0ef5('0x31')](respondWithFilteredResult(_0x5464c0,_0x5e0118))[_0x0ef5('0x23')](handleError(_0x5464c0,null));};exports[_0x0ef5('0x50')]=function(_0x53b07c,_0x150e47){var _0x5822b5={'raw':![],'where':{'id':_0x53b07c[_0x0ef5('0x51')]['id']}},_0x4f936b={};_0x4f936b[_0x0ef5('0x3e')]=_['keys'](db[_0x0ef5('0x4e')]['rawAttributes']);_0x4f936b['query']=_[_0x0ef5('0x40')](_0x53b07c[_0x0ef5('0x3f')]);_0x4f936b[_0x0ef5('0x41')]=_['intersection'](_0x4f936b[_0x0ef5('0x3e')],_0x4f936b[_0x0ef5('0x3f')]);_0x5822b5[_0x0ef5('0x44')]=_[_0x0ef5('0x42')](_0x4f936b[_0x0ef5('0x3e')],qs[_0x0ef5('0x43')](_0x53b07c['query'][_0x0ef5('0x43')]));_0x5822b5[_0x0ef5('0x44')]=_0x5822b5[_0x0ef5('0x44')][_0x0ef5('0x52')]?_0x5822b5['attributes']:_0x4f936b['model'];if(_0x53b07c[_0x0ef5('0x3f')][_0x0ef5('0x53')]){_0x5822b5[_0x0ef5('0x4f')]=[{'all':!![]}];}_0x5822b5=_['merge']({},_0x5822b5,_0x53b07c['options']);return db['VoiceContext'][_0x0ef5('0x54')](_0x5822b5)[_0x0ef5('0x31')](handleEntityNotFound(_0x150e47,null))['then'](respondWithResult(_0x150e47,null))[_0x0ef5('0x23')](handleError(_0x150e47,null));};exports[_0x0ef5('0x55')]=function(_0x580952,_0x53aaab,_0x535477){var _0x27339f;return db[_0x0ef5('0x4e')][_0x0ef5('0x55')](_0x580952['body'],{'raw':!![]})[_0x0ef5('0x31')](function(_0x481055){_0x27339f=_0x481055;return db['VoiceContext'][_0x0ef5('0x56')]({'raw':!![]});})['then'](function(_0x390298){var _0x563e5b=fs['readFileSync'](path[_0x0ef5('0x57')](config[_0x0ef5('0x58')],_0x0ef5('0x59')),_0x0ef5('0x5a'));var _0x25240e=ejs[_0x0ef5('0x5b')](_0x563e5b,{'contexts':_0x390298||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x25240e);})['then'](function(){return respondWithRpcPromise(_0x0ef5('0x5c'),_0x0ef5('0x55'),{'module':'chan_sip.so'});})['then'](function(){var _0x257436=_0x580952[_0x0ef5('0x5d')]['get']({'plain':!![]});if(!_0x257436)throw new Error(_0x0ef5('0x5e'));if(_0x257436[_0x0ef5('0x5f')]===_0x0ef5('0x5d')){var _0x202ef8=_0x27339f[_0x0ef5('0x33')]({'plain':!![]});return db['UserProfileSection'][_0x0ef5('0x54')]({'where':{'name':_0x0ef5('0x60'),'userProfileId':_0x257436[_0x0ef5('0x61')]},'raw':!![]})[_0x0ef5('0x31')](function(_0x11ab6a){if(_0x11ab6a&&_0x11ab6a[_0x0ef5('0x62')]===0x0){return db[_0x0ef5('0x34')]['create']({'name':_0x202ef8['name'],'resourceId':_0x202ef8['id'],'type':_0x11ab6a[_0x0ef5('0x37')],'sectionId':_0x11ab6a['id']},{})[_0x0ef5('0x31')](function(){return _0x27339f;});}else{return _0x27339f;}})[_0x0ef5('0x23')](function(_0x23f914){logger[_0x0ef5('0x20')](_0x0ef5('0x63'),_0x23f914);throw _0x23f914;});}return _0x27339f;})[_0x0ef5('0x31')](respondWithResult(_0x53aaab,0xc9))[_0x0ef5('0x23')](handleError(_0x53aaab,null));};exports[_0x0ef5('0x30')]=function(_0x4be64f,_0x3473de,_0x216671){var _0x559e76;return db[_0x0ef5('0x4e')]['find']({'where':{'id':_0x4be64f[_0x0ef5('0x51')]['id']}})[_0x0ef5('0x31')](handleEntityNotFound(_0x3473de,null))[_0x0ef5('0x31')](saveUpdates(_0x4be64f[_0x0ef5('0x64')],null))[_0x0ef5('0x31')](function(_0x41e913){if(_0x41e913){_0x559e76=_0x41e913;return db[_0x0ef5('0x4e')][_0x0ef5('0x56')]({'raw':!![]});}})[_0x0ef5('0x31')](function(_0x2ae965){var _0x2b8557=fs[_0x0ef5('0x65')](path[_0x0ef5('0x57')](config[_0x0ef5('0x58')],_0x0ef5('0x59')),_0x0ef5('0x5a'));var _0x237382=ejs[_0x0ef5('0x5b')](_0x2b8557,{'contexts':_0x2ae965||[]});fs[_0x0ef5('0x66')](_0x0ef5('0x67'),_0x237382);})[_0x0ef5('0x31')](function(){return respondWithRpcPromise(_0x0ef5('0x5c'),_0x0ef5('0x30'),{'module':_0x0ef5('0x68')});})[_0x0ef5('0x31')](function(){return _0x559e76;})[_0x0ef5('0x31')](respondWithResult(_0x3473de,null))[_0x0ef5('0x23')](handleError(_0x3473de,null));};exports[_0x0ef5('0x32')]=function(_0x582aa0,_0x338794,_0x44a1cd){var _0x13124a;return db[_0x0ef5('0x4e')][_0x0ef5('0x54')]({'where':{'id':_0x582aa0[_0x0ef5('0x51')]['id']}})['then'](handleEntityNotFound(_0x338794,null))[_0x0ef5('0x31')](removeEntity(_0x338794,null))['then'](function(){return db[_0x0ef5('0x4e')][_0x0ef5('0x56')]({'raw':!![]});})['then'](function(_0x1817e1){var _0x34f71d=fs[_0x0ef5('0x65')](path[_0x0ef5('0x57')](config['root'],_0x0ef5('0x59')),_0x0ef5('0x5a'));var _0x1e3ae3=ejs[_0x0ef5('0x5b')](_0x34f71d,{'contexts':_0x1817e1});fs[_0x0ef5('0x66')](_0x0ef5('0x67'),_0x1e3ae3);return respondWithRpcPromise(_0x0ef5('0x5c'),'destroy',{'module':_0x0ef5('0x68')});})[_0x0ef5('0x23')](handleError(_0x338794,null));}; \ No newline at end of file +var _0x1d68=['stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','filters','intersection','model','query','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','Contexts','UserProfileResource','sendStatus'];(function(_0x41aacc,_0x182b3){var _0x2962c7=function(_0xb7c11){while(--_0xb7c11){_0x41aacc['push'](_0x41aacc['shift']());}};_0x2962c7(++_0x182b3);}(_0x1d68,0x108));var _0x81d6=function(_0x35a9fd,_0x540c82){_0x35a9fd=_0x35a9fd-0x0;var _0x26242e=_0x1d68[_0x35a9fd];return _0x26242e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81d6('0x0'));var zipdir=require(_0x81d6('0x1'));var jsonpatch=require(_0x81d6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x81d6('0x3'));var Mustache=require(_0x81d6('0x4'));var util=require(_0x81d6('0x5'));var path=require(_0x81d6('0x6'));var sox=require('sox');var csv=require(_0x81d6('0x7'));var ejs=require(_0x81d6('0x8'));var fs=require('fs');var fs_extra=require(_0x81d6('0x9'));var _=require(_0x81d6('0xa'));var squel=require(_0x81d6('0xb'));var crypto=require(_0x81d6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x81d6('0xd'));var toCsv=require(_0x81d6('0x7'));var querystring=require(_0x81d6('0xe'));var Papa=require(_0x81d6('0xf'));var Redis=require(_0x81d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x81d6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81d6('0x12'));var logger=require(_0x81d6('0x13'))(_0x81d6('0x14'));var utils=require(_0x81d6('0x15'));var config=require(_0x81d6('0x16'));var licenseUtil=require(_0x81d6('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x81d6('0x18'));var client=jayson[_0x81d6('0x19')][_0x81d6('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x38edd4,_0x1d1ebe,_0x2a00f5,_0x5b467c){return new BPromise(function(_0x485814,_0x4cf98e){var _0x5ee0a5=_0x5b467c||client;return _0x5ee0a5['request'](_0x38edd4,_0x2a00f5)[_0x81d6('0x1b')](function(_0x477110){logger[_0x81d6('0x1c')](_0x81d6('0x1d'),_0x1d1ebe,_0x81d6('0x1e'));logger[_0x81d6('0x1f')](_0x81d6('0x20'),_0x1d1ebe,_0x81d6('0x1e'),JSON['stringify'](_0x477110));if(_0x477110[_0x81d6('0x21')]){if(_0x477110['error'][_0x81d6('0x22')]===0x1f4){logger[_0x81d6('0x21')]('VoiceContext,\x20%s,\x20%s',_0x1d1ebe,_0x477110[_0x81d6('0x21')][_0x81d6('0x23')]);return _0x4cf98e(_0x477110[_0x81d6('0x21')][_0x81d6('0x23')]);}logger['error'](_0x81d6('0x1d'),_0x1d1ebe,_0x477110['error']['message']);return _0x485814(_0x477110[_0x81d6('0x21')][_0x81d6('0x23')]);}else{logger[_0x81d6('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x1d1ebe,_0x81d6('0x1e'));_0x485814(_0x477110[_0x81d6('0x24')][_0x81d6('0x23')]);}})[_0x81d6('0x25')](function(_0xe10b90){logger[_0x81d6('0x21')](_0x81d6('0x1d'),_0x1d1ebe,_0xe10b90);_0x4cf98e(_0xe10b90);});});}function respondWithStatusCode(_0x331d20,_0x2b5b53){_0x2b5b53=_0x2b5b53||0xcc;return function(_0x4e5566){if(_0x4e5566){return _0x331d20['sendStatus'](_0x2b5b53);}return _0x331d20[_0x81d6('0x26')](_0x2b5b53)[_0x81d6('0x27')]();};}function respondWithResult(_0x5409a1,_0x54bc51){_0x54bc51=_0x54bc51||0xc8;return function(_0xef2963){if(_0xef2963){return _0x5409a1[_0x81d6('0x26')](_0x54bc51)[_0x81d6('0x28')](_0xef2963);}};}function respondWithFilteredResult(_0x5bd8a4,_0x7bf108){return function(_0x3e3aaa){if(_0x3e3aaa){var _0x18131e=typeof _0x7bf108[_0x81d6('0x29')]===_0x81d6('0x2a')&&typeof _0x7bf108[_0x81d6('0x2b')]===_0x81d6('0x2a');var _0x3036d6=_0x3e3aaa[_0x81d6('0x2c')];var _0x467483=_0x18131e?0x0:_0x7bf108['offset'];var _0x3d4a1d=_0x18131e?_0x3e3aaa[_0x81d6('0x2c')]:_0x7bf108[_0x81d6('0x29')]+_0x7bf108[_0x81d6('0x2b')];var _0x478a05;if(_0x3d4a1d>=_0x3036d6){_0x3d4a1d=_0x3036d6;_0x478a05=0xc8;}else{_0x478a05=0xce;}_0x5bd8a4[_0x81d6('0x26')](_0x478a05);return _0x5bd8a4['set'](_0x81d6('0x2d'),_0x467483+'-'+_0x3d4a1d+'/'+_0x3036d6)[_0x81d6('0x28')](_0x3e3aaa);}return null;};}function patchUpdates(_0x136e3a){return function(_0x367cba){try{jsonpatch[_0x81d6('0x2e')](_0x367cba,_0x136e3a,!![]);}catch(_0xa933b2){return BPromise[_0x81d6('0x2f')](_0xa933b2);}return _0x367cba[_0x81d6('0x30')]();};}function saveUpdates(_0x6ede7d,_0x5f221f){return function(_0x21f940){if(_0x21f940){return _0x21f940[_0x81d6('0x31')](_0x6ede7d)[_0x81d6('0x1b')](function(_0x517a16){return _0x517a16;});}return null;};}function removeEntity(_0x354604,_0x35f2b3){return function(_0x53e31a){if(_0x53e31a){return _0x53e31a[_0x81d6('0x32')]()[_0x81d6('0x1b')](function(){var _0x1f552e=_0x53e31a['get']({'plain':!![]});var _0x1f09b3=_0x81d6('0x33');return db[_0x81d6('0x34')][_0x81d6('0x32')]({'where':{'type':_0x1f09b3,'resourceId':_0x1f552e['id']}})[_0x81d6('0x1b')](function(){return _0x53e31a;});})[_0x81d6('0x1b')](function(){_0x354604[_0x81d6('0x26')](0xcc)[_0x81d6('0x27')]();});}};}function handleEntityNotFound(_0x119a1d,_0x5252ce){return function(_0xd12377){if(!_0xd12377){_0x119a1d[_0x81d6('0x35')](0x194);}return _0xd12377;};}function handleError(_0x442936,_0x38875e){_0x38875e=_0x38875e||0x1f4;return function(_0x5dc19d){logger[_0x81d6('0x21')](_0x5dc19d[_0x81d6('0x36')]);if(_0x5dc19d['name']){delete _0x5dc19d[_0x81d6('0x37')];}_0x442936[_0x81d6('0x26')](_0x38875e)[_0x81d6('0x38')](_0x5dc19d);};}exports[_0x81d6('0x39')]=function(_0x57d702,_0x456ae0){var _0x26bb99={},_0x4662a8={},_0x5aa865={'count':0x0,'rows':[]};var _0x33bfc0=_[_0x81d6('0x3a')](db[_0x81d6('0x3b')][_0x81d6('0x3c')],function(_0x378cb){return{'name':_0x378cb[_0x81d6('0x3d')],'type':_0x378cb[_0x81d6('0x3e')][_0x81d6('0x3f')]};});_0x4662a8['model']=_[_0x81d6('0x3a')](_0x33bfc0,'name');_0x4662a8['query']=_['keys'](_0x57d702['query']);_0x4662a8[_0x81d6('0x40')]=_[_0x81d6('0x41')](_0x4662a8[_0x81d6('0x42')],_0x4662a8[_0x81d6('0x43')]);_0x26bb99[_0x81d6('0x44')]=_[_0x81d6('0x41')](_0x4662a8[_0x81d6('0x42')],qs[_0x81d6('0x45')](_0x57d702[_0x81d6('0x43')][_0x81d6('0x45')]));_0x26bb99['attributes']=_0x26bb99[_0x81d6('0x44')]['length']?_0x26bb99[_0x81d6('0x44')]:_0x4662a8[_0x81d6('0x42')];if(!_0x57d702[_0x81d6('0x43')][_0x81d6('0x46')]('nolimit')){_0x26bb99['limit']=qs[_0x81d6('0x2b')](_0x57d702[_0x81d6('0x43')]['limit']);_0x26bb99['offset']=qs[_0x81d6('0x29')](_0x57d702[_0x81d6('0x43')][_0x81d6('0x29')]);}_0x26bb99[_0x81d6('0x47')]=qs['sort'](_0x57d702['query'][_0x81d6('0x48')]);_0x26bb99[_0x81d6('0x49')]=qs[_0x81d6('0x40')](_[_0x81d6('0x4a')](_0x57d702[_0x81d6('0x43')],_0x4662a8[_0x81d6('0x40')]),_0x33bfc0);if(_0x57d702[_0x81d6('0x43')]['filter']){_0x26bb99['where']=_[_0x81d6('0x4b')](_0x26bb99[_0x81d6('0x49')],{'$or':_[_0x81d6('0x3a')](_0x33bfc0,function(_0x19f81b){if(_0x19f81b['type']!==_0x81d6('0x4c')){var _0x139d0f={};_0x139d0f[_0x19f81b[_0x81d6('0x37')]]={'$like':'%'+_0x57d702[_0x81d6('0x43')]['filter']+'%'};return _0x139d0f;}})});}_0x26bb99=_['merge']({},_0x26bb99,_0x57d702[_0x81d6('0x4d')]);var _0x264f39={'where':_0x26bb99[_0x81d6('0x49')]};return db[_0x81d6('0x3b')][_0x81d6('0x2c')](_0x264f39)['then'](function(_0x26ae44){_0x5aa865[_0x81d6('0x2c')]=_0x26ae44;if(_0x57d702[_0x81d6('0x43')][_0x81d6('0x4e')]){_0x26bb99[_0x81d6('0x4f')]=[{'all':!![]}];}return db[_0x81d6('0x3b')][_0x81d6('0x50')](_0x26bb99);})[_0x81d6('0x1b')](function(_0x575005){_0x5aa865[_0x81d6('0x51')]=_0x575005;return _0x5aa865;})['then'](respondWithFilteredResult(_0x456ae0,_0x26bb99))[_0x81d6('0x25')](handleError(_0x456ae0,null));};exports[_0x81d6('0x52')]=function(_0x7d2f30,_0x436c1d){var _0xc4e5fc={'raw':![],'where':{'id':_0x7d2f30['params']['id']}},_0x380645={};_0x380645['model']=_['keys'](db['VoiceContext']['rawAttributes']);_0x380645[_0x81d6('0x43')]=_[_0x81d6('0x53')](_0x7d2f30[_0x81d6('0x43')]);_0x380645[_0x81d6('0x40')]=_[_0x81d6('0x41')](_0x380645[_0x81d6('0x42')],_0x380645[_0x81d6('0x43')]);_0xc4e5fc[_0x81d6('0x44')]=_['intersection'](_0x380645[_0x81d6('0x42')],qs[_0x81d6('0x45')](_0x7d2f30['query']['fields']));_0xc4e5fc[_0x81d6('0x44')]=_0xc4e5fc[_0x81d6('0x44')]['length']?_0xc4e5fc[_0x81d6('0x44')]:_0x380645[_0x81d6('0x42')];if(_0x7d2f30[_0x81d6('0x43')][_0x81d6('0x4e')]){_0xc4e5fc[_0x81d6('0x4f')]=[{'all':!![]}];}_0xc4e5fc=_[_0x81d6('0x4b')]({},_0xc4e5fc,_0x7d2f30[_0x81d6('0x4d')]);return db[_0x81d6('0x3b')]['find'](_0xc4e5fc)[_0x81d6('0x1b')](handleEntityNotFound(_0x436c1d,null))[_0x81d6('0x1b')](respondWithResult(_0x436c1d,null))[_0x81d6('0x25')](handleError(_0x436c1d,null));};exports[_0x81d6('0x54')]=function(_0x58c0be,_0xb2b68c,_0x3efa6a){var _0x2e642e;return db[_0x81d6('0x3b')][_0x81d6('0x54')](_0x58c0be[_0x81d6('0x55')],{'raw':!![]})[_0x81d6('0x1b')](function(_0x7da283){_0x2e642e=_0x7da283;return db[_0x81d6('0x3b')][_0x81d6('0x50')]({'raw':!![]});})[_0x81d6('0x1b')](function(_0x26e6c9){var _0x5cfccf=fs[_0x81d6('0x56')](path[_0x81d6('0x57')](config[_0x81d6('0x58')],_0x81d6('0x59')),'utf8');var _0x5c1574=ejs[_0x81d6('0x5a')](_0x5cfccf,{'contexts':_0x26e6c9||[]});fs[_0x81d6('0x5b')](_0x81d6('0x5c'),_0x5c1574);})[_0x81d6('0x1b')](function(){return respondWithRpcPromise(_0x81d6('0x5d'),'create',{'module':_0x81d6('0x5e')});})[_0x81d6('0x1b')](function(){var _0x2ee216=_0x58c0be[_0x81d6('0x5f')][_0x81d6('0x60')]({'plain':!![]});if(!_0x2ee216)throw new Error(_0x81d6('0x61'));if(_0x2ee216[_0x81d6('0x62')]==='user'){var _0xbb1212=_0x2e642e['get']({'plain':!![]});return db[_0x81d6('0x63')][_0x81d6('0x64')]({'where':{'name':_0x81d6('0x33'),'userProfileId':_0x2ee216[_0x81d6('0x65')]},'raw':!![]})[_0x81d6('0x1b')](function(_0x1c456f){if(_0x1c456f&&_0x1c456f[_0x81d6('0x66')]===0x0){return db['UserProfileResource'][_0x81d6('0x54')]({'name':_0xbb1212[_0x81d6('0x37')],'resourceId':_0xbb1212['id'],'type':_0x1c456f[_0x81d6('0x37')],'sectionId':_0x1c456f['id']},{})[_0x81d6('0x1b')](function(){return _0x2e642e;});}else{return _0x2e642e;}})[_0x81d6('0x25')](function(_0x550fe7){logger[_0x81d6('0x21')](_0x81d6('0x67'),_0x550fe7);throw _0x550fe7;});}return _0x2e642e;})[_0x81d6('0x1b')](respondWithResult(_0xb2b68c,0xc9))['catch'](handleError(_0xb2b68c,null));};exports[_0x81d6('0x31')]=function(_0x5a3307,_0x395c4a,_0x36a167){var _0x15eb71;return db[_0x81d6('0x3b')][_0x81d6('0x64')]({'where':{'id':_0x5a3307[_0x81d6('0x68')]['id']}})[_0x81d6('0x1b')](handleEntityNotFound(_0x395c4a,null))['then'](saveUpdates(_0x5a3307[_0x81d6('0x55')],null))[_0x81d6('0x1b')](function(_0x122998){if(_0x122998){_0x15eb71=_0x122998;return db[_0x81d6('0x3b')][_0x81d6('0x50')]({'raw':!![]});}})[_0x81d6('0x1b')](function(_0xd5789b){var _0x40ccff=fs['readFileSync'](path[_0x81d6('0x57')](config[_0x81d6('0x58')],_0x81d6('0x59')),_0x81d6('0x69'));var _0x2097d1=ejs['render'](_0x40ccff,{'contexts':_0xd5789b||[]});fs[_0x81d6('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2097d1);})[_0x81d6('0x1b')](function(){return respondWithRpcPromise(_0x81d6('0x5d'),_0x81d6('0x31'),{'module':_0x81d6('0x5e')});})[_0x81d6('0x1b')](function(){return _0x15eb71;})[_0x81d6('0x1b')](respondWithResult(_0x395c4a,null))['catch'](handleError(_0x395c4a,null));};exports['destroy']=function(_0x4d703a,_0x2d1290,_0x1cf2a3){var _0x1ba5fe;return db['VoiceContext']['find']({'where':{'id':_0x4d703a['params']['id']}})[_0x81d6('0x1b')](handleEntityNotFound(_0x2d1290,null))[_0x81d6('0x1b')](removeEntity(_0x2d1290,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x81d6('0x1b')](function(_0x1cf060){var _0xbd12c1=fs[_0x81d6('0x56')](path[_0x81d6('0x57')](config[_0x81d6('0x58')],'server/files/templates/context.ejs'),'utf8');var _0x41b89b=ejs[_0x81d6('0x5a')](_0xbd12c1,{'contexts':_0x1cf060});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x41b89b);return respondWithRpcPromise('Reload','destroy',{'module':_0x81d6('0x5e')});})[_0x81d6('0x25')](handleError(_0x2d1290,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 5103469..40c3bf3 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 _0x5490=['moment','request-promise','path','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','util','../../config/logger','api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5490,0x152));var _0x0549=function(_0x56340a,_0x3bbf46){_0x56340a=_0x56340a-0x0;var _0x49e0af=_0x5490[_0x56340a];return _0x49e0af;};'use strict';var _=require('lodash');var util=require(_0x0549('0x0'));var logger=require(_0x0549('0x1'))(_0x0549('0x2'));var moment=require(_0x0549('0x3'));var BPromise=require('bluebird');var rp=require(_0x0549('0x4'));var fs=require('fs');var path=require(_0x0549('0x5'));var rimraf=require('rimraf');var config=require(_0x0549('0x6'));var attributes=require(_0x0549('0x7'));module[_0x0549('0x8')]=function(_0x162a20,_0x851433){return _0x162a20['define'](_0x0549('0x9'),attributes,{'tableName':_0x0549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41a9=['moment','request-promise','path','../../config/environment','define','VoiceContext','voice_contexts','util','api'];(function(_0x1fe53b,_0x3c0fd6){var _0x3d8cb2=function(_0x24b463){while(--_0x24b463){_0x1fe53b['push'](_0x1fe53b['shift']());}};_0x3d8cb2(++_0x3c0fd6);}(_0x41a9,0x1a5));var _0x941a=function(_0x565ed6,_0x426675){_0x565ed6=_0x565ed6-0x0;var _0x37cada=_0x41a9[_0x565ed6];return _0x37cada;};'use strict';var _=require('lodash');var util=require(_0x941a('0x0'));var logger=require('../../config/logger')(_0x941a('0x1'));var moment=require(_0x941a('0x2'));var BPromise=require('bluebird');var rp=require(_0x941a('0x3'));var fs=require('fs');var path=require(_0x941a('0x4'));var rimraf=require('rimraf');var config=require(_0x941a('0x5'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x32ed03,_0x370266){return _0x32ed03[_0x941a('0x6')](_0x941a('0x7'),attributes,{'tableName':_0x941a('0x8'),'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 869352d..2eae119 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 _0xba26=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba26,0x1c9));var _0x6ba2=function(_0x216155,_0x500c88){_0x216155=_0x216155-0x0;var _0x3019e7=_0xba26[_0x216155];return _0x3019e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6ba2('0x0'));var BPromise=require(_0x6ba2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ba2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ba2('0x3'));var logger=require(_0x6ba2('0x4'))('rpc');var config=require(_0x6ba2('0x5'));var jayson=require(_0x6ba2('0x6'));var client=jayson[_0x6ba2('0x7')][_0x6ba2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27a456,_0x4c10eb,_0x3768fb){return new BPromise(function(_0x3990d5,_0x44adc2){return client[_0x6ba2('0x9')](_0x27a456,_0x3768fb)[_0x6ba2('0xa')](function(_0x365506){logger[_0x6ba2('0xb')](_0x6ba2('0xc'),_0x4c10eb,'request\x20sent');logger[_0x6ba2('0xd')](_0x6ba2('0xe'),_0x4c10eb,'request\x20sent',JSON['stringify'](_0x365506));if(_0x365506['error']){if(_0x365506[_0x6ba2('0xf')][_0x6ba2('0x10')]===0x1f4){logger[_0x6ba2('0xf')](_0x6ba2('0xc'),_0x4c10eb,_0x365506['error']['message']);return _0x44adc2(_0x365506[_0x6ba2('0xf')][_0x6ba2('0x11')]);}logger[_0x6ba2('0xf')](_0x6ba2('0xc'),_0x4c10eb,_0x365506[_0x6ba2('0xf')]['message']);return _0x3990d5(_0x365506[_0x6ba2('0xf')][_0x6ba2('0x11')]);}else{logger['info'](_0x6ba2('0xc'),_0x4c10eb,_0x6ba2('0x12'));_0x3990d5(_0x365506[_0x6ba2('0x13')][_0x6ba2('0x11')]);}})[_0x6ba2('0x14')](function(_0x4107af){logger[_0x6ba2('0xf')]('VoiceContext,\x20%s,\x20%s',_0x4c10eb,_0x4107af);_0x44adc2(_0x4107af);});});} \ No newline at end of file +var _0x6f2f=['lodash','util','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','code','error','VoiceContext,\x20%s,\x20%s','message','result','catch'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x6f2f[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6f2('0x3'))(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6f2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c94ad,_0x26cd28,_0x774922){return new BPromise(function(_0x15a71c,_0x1873c8){return client[_0xf6f2('0x7')](_0x1c94ad,_0x774922)[_0xf6f2('0x8')](function(_0x294a85){logger[_0xf6f2('0x9')]('VoiceContext,\x20%s,\x20%s',_0x26cd28,_0xf6f2('0xa'));logger[_0xf6f2('0xb')](_0xf6f2('0xc'),_0x26cd28,_0xf6f2('0xa'),JSON['stringify'](_0x294a85));if(_0x294a85['error']){if(_0x294a85['error'][_0xf6f2('0xd')]===0x1f4){logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x294a85[_0xf6f2('0xe')][_0xf6f2('0x10')]);return _0x1873c8(_0x294a85[_0xf6f2('0xe')]['message']);}logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x294a85[_0xf6f2('0xe')][_0xf6f2('0x10')]);return _0x15a71c(_0x294a85[_0xf6f2('0xe')]['message']);}else{logger[_0xf6f2('0x9')](_0xf6f2('0xf'),_0x26cd28,_0xf6f2('0xa'));_0x15a71c(_0x294a85[_0xf6f2('0x11')][_0xf6f2('0x10')]);}})[_0xf6f2('0x12')](function(_0x17dec3){logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x17dec3);_0x1873c8(_0x17dec3);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index e1e4cfc..68907e0 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 _0xb7ef=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3c8ad1,_0x509796){var _0x3d309b=function(_0x33b56c){while(--_0x33b56c){_0x3c8ad1['push'](_0x3c8ad1['shift']());}};_0x3d309b(++_0x509796);}(_0xb7ef,0x1ac));var _0xfb7e=function(_0x728a40,_0x5dc4e5){_0x728a40=_0x728a40-0x0;var _0x22ab04=_0xb7ef[_0x728a40];return _0x22ab04;};'use strict';var multer=require(_0xfb7e('0x0'));var util=require(_0xfb7e('0x1'));var path=require(_0xfb7e('0x2'));var timeout=require(_0xfb7e('0x3'));var express=require(_0xfb7e('0x4'));var router=express[_0xfb7e('0x5')]();var fs_extra=require(_0xfb7e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfb7e('0x7'));var config=require(_0xfb7e('0x8'));var controller=require('./voiceDialReport.controller');router[_0xfb7e('0x9')]('/',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0xb')]);router[_0xfb7e('0x9')](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller['describe']);router[_0xfb7e('0x9')](_0xfb7e('0xd'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0xe')]);router[_0xfb7e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfb7e('0x10')](_0xfb7e('0xd'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x11')]);router[_0xfb7e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xfb7e('0x13')]);module[_0xfb7e('0x14')]=router; \ No newline at end of file +var _0xa382=['./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','update','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0xa382,0x1cd));var _0x2a38=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xa382[_0x5f3f88];return _0xd08119;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2a38('0x0'));var timeout=require(_0x2a38('0x1'));var express=require('express');var router=express[_0x2a38('0x2')]();var fs_extra=require(_0x2a38('0x3'));var auth=require(_0x2a38('0x4'));var interaction=require(_0x2a38('0x5'));var config=require(_0x2a38('0x6'));var controller=require(_0x2a38('0x7'));router[_0x2a38('0x8')]('/',auth['isAuthenticated'](),controller[_0x2a38('0x9')]);router[_0x2a38('0x8')](_0x2a38('0xa'),auth[_0x2a38('0xb')](),controller[_0x2a38('0xc')]);router[_0x2a38('0x8')](_0x2a38('0xd'),auth[_0x2a38('0xb')](),controller[_0x2a38('0xe')]);router[_0x2a38('0xf')]('/',auth[_0x2a38('0xb')](),controller['create']);router['put']('/:id',auth[_0x2a38('0xb')](),controller[_0x2a38('0x10')]);router['delete'](_0x2a38('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a38('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 716fe69..7e3ff9d 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 _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x16577c,_0x30f235){var _0x12dc5b=function(_0x3cb7ee){while(--_0x3cb7ee){_0x16577c['push'](_0x16577c['shift']());}};_0x12dc5b(++_0x30f235);}(_0x34e8,0x12c));var _0x834e=function(_0xea7be8,_0x4d2203){_0xea7be8=_0xea7be8-0x0;var _0xf9279b=_0x34e8[_0xea7be8];return _0xf9279b;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}}; \ No newline at end of file +var _0x8ef6=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x8ef6,0xf2));var _0x68ef=function(_0x53919d,_0x5cd5f5){_0x53919d=_0x53919d-0x0;var _0x1dd1af=_0x8ef6[_0x53919d];return _0x1dd1af;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'privilege':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68ef('0x3')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'linkedid':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x68ef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize[_0x68ef('0x2')]},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x3')]},'destuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x68ef('0x2')]},'dialstatus':{'type':Sequelize[_0x68ef('0x2')]},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x68ef('0x3')]},'duration':{'type':Sequelize[_0x68ef('0x3')]},'holdtime':{'type':Sequelize[_0x68ef('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 5b4d4f8..40f90fe 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 _0x173a=['error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x173a,0xc1));var _0xa173=function(_0x3169d1,_0x524b22){_0x3169d1=_0x3169d1-0x0;var _0x256faa=_0x173a[_0x3169d1];return _0x256faa;};'use strict';var emlformat=require(_0xa173('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa173('0x1'));var jsonpatch=require(_0xa173('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa173('0x3'));var Mustache=require(_0xa173('0x4'));var util=require(_0xa173('0x5'));var path=require(_0xa173('0x6'));var sox=require(_0xa173('0x7'));var csv=require(_0xa173('0x8'));var ejs=require(_0xa173('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa173('0xa'));var squel=require('squel');var crypto=require(_0xa173('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa173('0xc'));var toCsv=require(_0xa173('0x8'));var querystring=require('querystring');var Papa=require(_0xa173('0xd'));var Redis=require(_0xa173('0xe'));var authService=require(_0xa173('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa173('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa173('0x11'))(_0xa173('0x12'));var utils=require('../../config/utils');var config=require(_0xa173('0x13'));var licenseUtil=require(_0xa173('0x14'));var db=require(_0xa173('0x15'))['db'];function respondWithStatusCode(_0x4c0113,_0x4b1090){_0x4b1090=_0x4b1090||0xcc;return function(_0x4746d5){if(_0x4746d5){return _0x4c0113[_0xa173('0x16')](_0x4b1090);}return _0x4c0113[_0xa173('0x17')](_0x4b1090)[_0xa173('0x18')]();};}function respondWithResult(_0xa06816,_0x447c26){_0x447c26=_0x447c26||0xc8;return function(_0x5aae85){if(_0x5aae85){return _0xa06816['status'](_0x447c26)['json'](_0x5aae85);}};}function respondWithFilteredResult(_0x3b042d,_0x3d2c26){return function(_0x1ef168){if(_0x1ef168){var _0x378212=typeof _0x3d2c26[_0xa173('0x19')]===_0xa173('0x1a')&&typeof _0x3d2c26[_0xa173('0x1b')]==='undefined';var _0x5d038e=_0x1ef168[_0xa173('0x1c')];var _0x11246f=_0x378212?0x0:_0x3d2c26[_0xa173('0x19')];var _0x57872d=_0x378212?_0x1ef168[_0xa173('0x1c')]:_0x3d2c26[_0xa173('0x19')]+_0x3d2c26[_0xa173('0x1b')];var _0x22e4f1;if(_0x57872d>=_0x5d038e){_0x57872d=_0x5d038e;_0x22e4f1=0xc8;}else{_0x22e4f1=0xce;}_0x3b042d[_0xa173('0x17')](_0x22e4f1);return _0x3b042d[_0xa173('0x1d')](_0xa173('0x1e'),_0x11246f+'-'+_0x57872d+'/'+_0x5d038e)[_0xa173('0x1f')](_0x1ef168);}return null;};}function patchUpdates(_0x51bf5b){return function(_0x59e388){try{jsonpatch[_0xa173('0x20')](_0x59e388,_0x51bf5b,!![]);}catch(_0x199867){return BPromise[_0xa173('0x21')](_0x199867);}return _0x59e388[_0xa173('0x22')]();};}function saveUpdates(_0x36e867,_0x34c2e0){return function(_0x47a348){if(_0x47a348){return _0x47a348[_0xa173('0x23')](_0x36e867)['then'](function(_0x547759){return _0x547759;});}return null;};}function removeEntity(_0x24dc71,_0x3153c9){return function(_0x46c4ce){if(_0x46c4ce){return _0x46c4ce[_0xa173('0x24')]()[_0xa173('0x25')](function(){_0x24dc71[_0xa173('0x17')](0xcc)[_0xa173('0x18')]();});}};}function handleEntityNotFound(_0x1a1f1f,_0x2761f8){return function(_0x39ea7c){if(!_0x39ea7c){_0x1a1f1f[_0xa173('0x16')](0x194);}return _0x39ea7c;};}function handleError(_0x258400,_0x3f6f87){_0x3f6f87=_0x3f6f87||0x1f4;return function(_0x39872d){logger[_0xa173('0x26')](_0x39872d[_0xa173('0x27')]);if(_0x39872d[_0xa173('0x28')]){delete _0x39872d['name'];}_0x258400[_0xa173('0x17')](_0x3f6f87)[_0xa173('0x29')](_0x39872d);};}exports[_0xa173('0x2a')]=function(_0xf46c45,_0x14accd){var _0x2eecaf={},_0x100e13={},_0x8ae67a={'count':0x0,'rows':[]};var _0x98e677=_[_0xa173('0x2b')](db[_0xa173('0x2c')][_0xa173('0x2d')],function(_0x1433fa){return{'name':_0x1433fa[_0xa173('0x2e')],'type':_0x1433fa[_0xa173('0x2f')][_0xa173('0x30')]};});_0x100e13[_0xa173('0x31')]=_['map'](_0x98e677,'name');_0x100e13[_0xa173('0x32')]=_[_0xa173('0x33')](_0xf46c45['query']);_0x100e13[_0xa173('0x34')]=_[_0xa173('0x35')](_0x100e13[_0xa173('0x31')],_0x100e13[_0xa173('0x32')]);_0x2eecaf[_0xa173('0x36')]=_[_0xa173('0x35')](_0x100e13[_0xa173('0x31')],qs['fields'](_0xf46c45[_0xa173('0x32')][_0xa173('0x37')]));_0x2eecaf[_0xa173('0x36')]=_0x2eecaf['attributes'][_0xa173('0x38')]?_0x2eecaf[_0xa173('0x36')]:_0x100e13['model'];if(!_0xf46c45['query'][_0xa173('0x39')](_0xa173('0x3a'))){_0x2eecaf['limit']=qs['limit'](_0xf46c45[_0xa173('0x32')]['limit']);_0x2eecaf[_0xa173('0x19')]=qs[_0xa173('0x19')](_0xf46c45[_0xa173('0x32')][_0xa173('0x19')]);}_0x2eecaf[_0xa173('0x3b')]=qs['sort'](_0xf46c45[_0xa173('0x32')][_0xa173('0x3c')]);_0x2eecaf['where']=qs[_0xa173('0x34')](_[_0xa173('0x3d')](_0xf46c45[_0xa173('0x32')],_0x100e13['filters']),_0x98e677);if(_0xf46c45[_0xa173('0x32')][_0xa173('0x3e')]){_0x2eecaf[_0xa173('0x3f')]=_['merge'](_0x2eecaf[_0xa173('0x3f')],{'$or':_[_0xa173('0x2b')](_0x98e677,function(_0x584987){if(_0x584987[_0xa173('0x2f')]!==_0xa173('0x40')){var _0x29b064={};_0x29b064[_0x584987[_0xa173('0x28')]]={'$like':'%'+_0xf46c45['query']['filter']+'%'};return _0x29b064;}})});}_0x2eecaf=_[_0xa173('0x41')]({},_0x2eecaf,_0xf46c45[_0xa173('0x42')]);var _0x15e049={'where':_0x2eecaf['where']};return db[_0xa173('0x2c')]['count'](_0x15e049)[_0xa173('0x25')](function(_0x592a01){_0x8ae67a[_0xa173('0x1c')]=_0x592a01;if(_0xf46c45['query'][_0xa173('0x43')]){_0x2eecaf[_0xa173('0x44')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xa173('0x45')](_0x2eecaf);})[_0xa173('0x25')](function(_0x576b60){_0x8ae67a['rows']=_0x576b60;return _0x8ae67a;})['then'](respondWithFilteredResult(_0x14accd,_0x2eecaf))[_0xa173('0x46')](handleError(_0x14accd,null));};exports[_0xa173('0x47')]=function(_0x233767,_0x248672){var _0x5e9b8e={'raw':!![],'where':{'id':_0x233767[_0xa173('0x48')]['id']}},_0x48aade={};_0x48aade[_0xa173('0x31')]=_['keys'](db[_0xa173('0x2c')][_0xa173('0x2d')]);_0x48aade[_0xa173('0x32')]=_[_0xa173('0x33')](_0x233767[_0xa173('0x32')]);_0x48aade[_0xa173('0x34')]=_[_0xa173('0x35')](_0x48aade[_0xa173('0x31')],_0x48aade[_0xa173('0x32')]);_0x5e9b8e['attributes']=_['intersection'](_0x48aade[_0xa173('0x31')],qs[_0xa173('0x37')](_0x233767[_0xa173('0x32')][_0xa173('0x37')]));_0x5e9b8e[_0xa173('0x36')]=_0x5e9b8e[_0xa173('0x36')][_0xa173('0x38')]?_0x5e9b8e[_0xa173('0x36')]:_0x48aade[_0xa173('0x31')];if(_0x233767[_0xa173('0x32')][_0xa173('0x43')]){_0x5e9b8e['include']=[{'all':!![]}];}_0x5e9b8e=_['merge']({},_0x5e9b8e,_0x233767[_0xa173('0x42')]);return db[_0xa173('0x2c')]['find'](_0x5e9b8e)['then'](handleEntityNotFound(_0x248672,null))['then'](respondWithResult(_0x248672,null))[_0xa173('0x46')](handleError(_0x248672,null));};exports[_0xa173('0x49')]=function(_0xe8356,_0x55592a){return db['VoiceDialReport'][_0xa173('0x49')](_0xe8356[_0xa173('0x4a')],{})[_0xa173('0x25')](respondWithResult(_0x55592a,0xc9))[_0xa173('0x46')](handleError(_0x55592a,null));};exports[_0xa173('0x23')]=function(_0x16f215,_0x2320df){if(_0x16f215[_0xa173('0x4a')]['id']){delete _0x16f215['body']['id'];}return db['VoiceDialReport'][_0xa173('0x4b')]({'where':{'id':_0x16f215['params']['id']}})['then'](handleEntityNotFound(_0x2320df,null))['then'](saveUpdates(_0x16f215['body'],null))[_0xa173('0x25')](respondWithResult(_0x2320df,null))[_0xa173('0x46')](handleError(_0x2320df,null));};exports[_0xa173('0x24')]=function(_0x1c7696,_0xf20afc){return db[_0xa173('0x2c')][_0xa173('0x4b')]({'where':{'id':_0x1c7696['params']['id']}})[_0xa173('0x25')](handleEntityNotFound(_0xf20afc,null))[_0xa173('0x25')](removeEntity(_0xf20afc,null))[_0xa173('0x46')](handleError(_0xf20afc,null));};exports[_0xa173('0x4c')]=function(_0x139a95,_0x8fc3db){return db['VoiceDialReport'][_0xa173('0x4c')]()[_0xa173('0x25')](respondWithResult(_0x8fc3db,null))['catch'](handleError(_0x8fc3db,null));}; \ No newline at end of file +var _0x3dfa=['sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x11d005,_0x323675){var _0x34734c=function(_0x3ea3ab){while(--_0x3ea3ab){_0x11d005['push'](_0x11d005['shift']());}};_0x34734c(++_0x323675);}(_0x3dfa,0x183));var _0xa3df=function(_0x44c8a3,_0x30e450){_0x44c8a3=_0x44c8a3-0x0;var _0x3b3e5b=_0x3dfa[_0x44c8a3];return _0x3b3e5b;};'use strict';var emlformat=require(_0xa3df('0x0'));var rimraf=require(_0xa3df('0x1'));var zipdir=require(_0xa3df('0x2'));var jsonpatch=require(_0xa3df('0x3'));var rp=require(_0xa3df('0x4'));var moment=require(_0xa3df('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa3df('0x6'));var path=require(_0xa3df('0x7'));var sox=require(_0xa3df('0x8'));var csv=require(_0xa3df('0x9'));var ejs=require(_0xa3df('0xa'));var fs=require('fs');var fs_extra=require(_0xa3df('0xb'));var _=require(_0xa3df('0xc'));var squel=require('squel');var crypto=require(_0xa3df('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa3df('0xe'));var Papa=require(_0xa3df('0xf'));var Redis=require(_0xa3df('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa3df('0x11'));var as=require(_0xa3df('0x12'));var hardwareService=require(_0xa3df('0x13'));var logger=require(_0xa3df('0x14'))('api');var utils=require(_0xa3df('0x15'));var config=require(_0xa3df('0x16'));var licenseUtil=require(_0xa3df('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc67793,_0x487b8d){_0x487b8d=_0x487b8d||0xcc;return function(_0x555f59){if(_0x555f59){return _0xc67793[_0xa3df('0x18')](_0x487b8d);}return _0xc67793[_0xa3df('0x19')](_0x487b8d)[_0xa3df('0x1a')]();};}function respondWithResult(_0x6c74cb,_0xaf0122){_0xaf0122=_0xaf0122||0xc8;return function(_0x42d760){if(_0x42d760){return _0x6c74cb[_0xa3df('0x19')](_0xaf0122)['json'](_0x42d760);}};}function respondWithFilteredResult(_0x472f20,_0x2eff74){return function(_0x486476){if(_0x486476){var _0x329050=typeof _0x2eff74['offset']===_0xa3df('0x1b')&&typeof _0x2eff74[_0xa3df('0x1c')]===_0xa3df('0x1b');var _0x2bfa56=_0x486476['count'];var _0x15c08d=_0x329050?0x0:_0x2eff74[_0xa3df('0x1d')];var _0x254f76=_0x329050?_0x486476[_0xa3df('0x1e')]:_0x2eff74[_0xa3df('0x1d')]+_0x2eff74[_0xa3df('0x1c')];var _0x1a3034;if(_0x254f76>=_0x2bfa56){_0x254f76=_0x2bfa56;_0x1a3034=0xc8;}else{_0x1a3034=0xce;}_0x472f20[_0xa3df('0x19')](_0x1a3034);return _0x472f20[_0xa3df('0x1f')]('Content-Range',_0x15c08d+'-'+_0x254f76+'/'+_0x2bfa56)[_0xa3df('0x20')](_0x486476);}return null;};}function patchUpdates(_0x534226){return function(_0x3f2886){try{jsonpatch['apply'](_0x3f2886,_0x534226,!![]);}catch(_0x5919c7){return BPromise[_0xa3df('0x21')](_0x5919c7);}return _0x3f2886[_0xa3df('0x22')]();};}function saveUpdates(_0xfaa076,_0x1f67d7){return function(_0x4a4bf4){if(_0x4a4bf4){return _0x4a4bf4[_0xa3df('0x23')](_0xfaa076)[_0xa3df('0x24')](function(_0x3101bb){return _0x3101bb;});}return null;};}function removeEntity(_0x566e1f,_0x1bdf9b){return function(_0x1d48e3){if(_0x1d48e3){return _0x1d48e3[_0xa3df('0x25')]()[_0xa3df('0x24')](function(){_0x566e1f[_0xa3df('0x19')](0xcc)[_0xa3df('0x1a')]();});}};}function handleEntityNotFound(_0x274693,_0x24df38){return function(_0x1df40d){if(!_0x1df40d){_0x274693['sendStatus'](0x194);}return _0x1df40d;};}function handleError(_0x61e0fb,_0x548f6c){_0x548f6c=_0x548f6c||0x1f4;return function(_0x5a071e){logger[_0xa3df('0x26')](_0x5a071e['stack']);if(_0x5a071e['name']){delete _0x5a071e[_0xa3df('0x27')];}_0x61e0fb[_0xa3df('0x19')](_0x548f6c)[_0xa3df('0x28')](_0x5a071e);};}exports[_0xa3df('0x29')]=function(_0x464bd5,_0x3be8dc){var _0x16260a={},_0x2a13d1={},_0x2bc83e={'count':0x0,'rows':[]};var _0x571cd6=_[_0xa3df('0x2a')](db[_0xa3df('0x2b')][_0xa3df('0x2c')],function(_0x2a32bf){return{'name':_0x2a32bf['fieldName'],'type':_0x2a32bf[_0xa3df('0x2d')][_0xa3df('0x2e')]};});_0x2a13d1[_0xa3df('0x2f')]=_['map'](_0x571cd6,_0xa3df('0x27'));_0x2a13d1['query']=_[_0xa3df('0x30')](_0x464bd5[_0xa3df('0x31')]);_0x2a13d1['filters']=_[_0xa3df('0x32')](_0x2a13d1[_0xa3df('0x2f')],_0x2a13d1[_0xa3df('0x31')]);_0x16260a['attributes']=_[_0xa3df('0x32')](_0x2a13d1['model'],qs[_0xa3df('0x33')](_0x464bd5[_0xa3df('0x31')][_0xa3df('0x33')]));_0x16260a[_0xa3df('0x34')]=_0x16260a[_0xa3df('0x34')][_0xa3df('0x35')]?_0x16260a[_0xa3df('0x34')]:_0x2a13d1[_0xa3df('0x2f')];if(!_0x464bd5[_0xa3df('0x31')][_0xa3df('0x36')](_0xa3df('0x37'))){_0x16260a[_0xa3df('0x1c')]=qs['limit'](_0x464bd5[_0xa3df('0x31')][_0xa3df('0x1c')]);_0x16260a[_0xa3df('0x1d')]=qs[_0xa3df('0x1d')](_0x464bd5[_0xa3df('0x31')][_0xa3df('0x1d')]);}_0x16260a[_0xa3df('0x38')]=qs[_0xa3df('0x39')](_0x464bd5[_0xa3df('0x31')][_0xa3df('0x39')]);_0x16260a[_0xa3df('0x3a')]=qs[_0xa3df('0x3b')](_[_0xa3df('0x3c')](_0x464bd5['query'],_0x2a13d1['filters']),_0x571cd6);if(_0x464bd5[_0xa3df('0x31')][_0xa3df('0x3d')]){_0x16260a[_0xa3df('0x3a')]=_['merge'](_0x16260a[_0xa3df('0x3a')],{'$or':_['map'](_0x571cd6,function(_0x1ff352){if(_0x1ff352[_0xa3df('0x2d')]!=='VIRTUAL'){var _0x1bd33a={};_0x1bd33a[_0x1ff352[_0xa3df('0x27')]]={'$like':'%'+_0x464bd5['query']['filter']+'%'};return _0x1bd33a;}})});}_0x16260a=_[_0xa3df('0x3e')]({},_0x16260a,_0x464bd5['options']);var _0x22502d={'where':_0x16260a[_0xa3df('0x3a')]};return db[_0xa3df('0x2b')][_0xa3df('0x1e')](_0x22502d)[_0xa3df('0x24')](function(_0x414926){_0x2bc83e[_0xa3df('0x1e')]=_0x414926;if(_0x464bd5[_0xa3df('0x31')][_0xa3df('0x3f')]){_0x16260a[_0xa3df('0x40')]=[{'all':!![]}];}return db[_0xa3df('0x2b')][_0xa3df('0x41')](_0x16260a);})[_0xa3df('0x24')](function(_0x19c436){_0x2bc83e[_0xa3df('0x42')]=_0x19c436;return _0x2bc83e;})[_0xa3df('0x24')](respondWithFilteredResult(_0x3be8dc,_0x16260a))[_0xa3df('0x43')](handleError(_0x3be8dc,null));};exports[_0xa3df('0x44')]=function(_0x1ce2d5,_0x143e52){var _0x19291f={'raw':!![],'where':{'id':_0x1ce2d5[_0xa3df('0x45')]['id']}},_0x44e486={};_0x44e486[_0xa3df('0x2f')]=_['keys'](db[_0xa3df('0x2b')]['rawAttributes']);_0x44e486[_0xa3df('0x31')]=_[_0xa3df('0x30')](_0x1ce2d5[_0xa3df('0x31')]);_0x44e486[_0xa3df('0x3b')]=_['intersection'](_0x44e486['model'],_0x44e486['query']);_0x19291f[_0xa3df('0x34')]=_[_0xa3df('0x32')](_0x44e486[_0xa3df('0x2f')],qs[_0xa3df('0x33')](_0x1ce2d5[_0xa3df('0x31')][_0xa3df('0x33')]));_0x19291f['attributes']=_0x19291f[_0xa3df('0x34')][_0xa3df('0x35')]?_0x19291f[_0xa3df('0x34')]:_0x44e486['model'];if(_0x1ce2d5[_0xa3df('0x31')][_0xa3df('0x3f')]){_0x19291f[_0xa3df('0x40')]=[{'all':!![]}];}_0x19291f=_[_0xa3df('0x3e')]({},_0x19291f,_0x1ce2d5['options']);return db[_0xa3df('0x2b')][_0xa3df('0x46')](_0x19291f)[_0xa3df('0x24')](handleEntityNotFound(_0x143e52,null))[_0xa3df('0x24')](respondWithResult(_0x143e52,null))[_0xa3df('0x43')](handleError(_0x143e52,null));};exports[_0xa3df('0x47')]=function(_0xd4a3e6,_0x1ecf2b){return db[_0xa3df('0x2b')][_0xa3df('0x47')](_0xd4a3e6[_0xa3df('0x48')],{})[_0xa3df('0x24')](respondWithResult(_0x1ecf2b,0xc9))[_0xa3df('0x43')](handleError(_0x1ecf2b,null));};exports[_0xa3df('0x23')]=function(_0x2b348e,_0x2e0e36){if(_0x2b348e[_0xa3df('0x48')]['id']){delete _0x2b348e[_0xa3df('0x48')]['id'];}return db['VoiceDialReport'][_0xa3df('0x46')]({'where':{'id':_0x2b348e[_0xa3df('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e0e36,null))[_0xa3df('0x24')](saveUpdates(_0x2b348e[_0xa3df('0x48')],null))[_0xa3df('0x24')](respondWithResult(_0x2e0e36,null))[_0xa3df('0x43')](handleError(_0x2e0e36,null));};exports[_0xa3df('0x25')]=function(_0x374d5d,_0x13a24b){return db[_0xa3df('0x2b')][_0xa3df('0x46')]({'where':{'id':_0x374d5d['params']['id']}})[_0xa3df('0x24')](handleEntityNotFound(_0x13a24b,null))[_0xa3df('0x24')](removeEntity(_0x13a24b,null))[_0xa3df('0x43')](handleError(_0x13a24b,null));};exports[_0xa3df('0x49')]=function(_0x527a39,_0x48ac53){return db[_0xa3df('0x2b')][_0xa3df('0x49')]()[_0xa3df('0x24')](respondWithResult(_0x48ac53,null))[_0xa3df('0x43')](handleError(_0x48ac53,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ac1cb27..31ce61e 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 _0x6b76=['moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','uniqueid','lodash','../../config/logger','api'];(function(_0x2e6afe,_0x24f645){var _0x21917f=function(_0x6358c3){while(--_0x6358c3){_0x2e6afe['push'](_0x2e6afe['shift']());}};_0x21917f(++_0x24f645);}(_0x6b76,0xa5));var _0x66b7=function(_0x2f2d04,_0x208f29){_0x2f2d04=_0x2f2d04-0x0;var _0x2d9e9d=_0x6b76[_0x2f2d04];return _0x2d9e9d;};'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':'report_dial','paranoid':![],'indexes':[{'fields':[_0x66b7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe87a=['moment','bluebird','request-promise','path','../../config/environment','exports','define','report_dial','uniqueid','util','../../config/logger','api'];(function(_0x5afab7,_0x32fbc3){var _0x3b15e4=function(_0x58f7d2){while(--_0x58f7d2){_0x5afab7['push'](_0x5afab7['shift']());}};_0x3b15e4(++_0x32fbc3);}(_0xe87a,0xed));var _0xae87=function(_0x43f528,_0x3b1c32){_0x43f528=_0x43f528-0x0;var _0xe0c481=_0xe87a[_0x43f528];return _0xe0c481;};'use strict';var _=require('lodash');var util=require(_0xae87('0x0'));var logger=require(_0xae87('0x1'))(_0xae87('0x2'));var moment=require(_0xae87('0x3'));var BPromise=require(_0xae87('0x4'));var rp=require(_0xae87('0x5'));var fs=require('fs');var path=require(_0xae87('0x6'));var rimraf=require('rimraf');var config=require(_0xae87('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0xae87('0x8')]=function(_0x24023c,_0x5d16be){return _0x24023c[_0xae87('0x9')]('VoiceDialReport',attributes,{'tableName':_0xae87('0xa'),'paranoid':![],'indexes':[{'fields':[_0xae87('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index e6783c7..aadd267 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 _0x3a09=['then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceDialReport','VoiceDialReport','create','options','raw','catch','UpdateVoiceDialReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x11f083,_0x38a7dd){var _0x1a41f3=function(_0x4570b5){while(--_0x4570b5){_0x11f083['push'](_0x11f083['shift']());}};_0x1a41f3(++_0x38a7dd);}(_0x3a09,0x12c));var _0x93a0=function(_0xf2fda2,_0x192fdc){_0xf2fda2=_0xf2fda2-0x0;var _0x23f003=_0x3a09[_0xf2fda2];return _0x23f003;};'use strict';var _=require('lodash');var util=require(_0x93a0('0x0'));var moment=require(_0x93a0('0x1'));var BPromise=require(_0x93a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x93a0('0x4'));var logger=require(_0x93a0('0x5'))('rpc');var config=require(_0x93a0('0x6'));var jayson=require(_0x93a0('0x7'));var client=jayson[_0x93a0('0x8')][_0x93a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36e984,_0x5c4872,_0x3165f4){return new BPromise(function(_0x24fa48,_0x3736ef){return client['request'](_0x36e984,_0x3165f4)[_0x93a0('0xa')](function(_0x529b5f){logger[_0x93a0('0xb')](_0x93a0('0xc'),_0x5c4872,_0x93a0('0xd'));logger[_0x93a0('0xe')](_0x93a0('0xf'),_0x5c4872,_0x93a0('0xd'),JSON[_0x93a0('0x10')](_0x529b5f));if(_0x529b5f[_0x93a0('0x11')]){if(_0x529b5f[_0x93a0('0x11')]['code']===0x1f4){logger[_0x93a0('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x5c4872,_0x529b5f[_0x93a0('0x11')][_0x93a0('0x12')]);return _0x3736ef(_0x529b5f[_0x93a0('0x11')][_0x93a0('0x12')]);}logger[_0x93a0('0x11')](_0x93a0('0xc'),_0x5c4872,_0x529b5f[_0x93a0('0x11')][_0x93a0('0x12')]);return _0x24fa48(_0x529b5f[_0x93a0('0x11')][_0x93a0('0x12')]);}else{logger[_0x93a0('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x5c4872,'request\x20sent');_0x24fa48(_0x529b5f[_0x93a0('0x13')][_0x93a0('0x12')]);}})['catch'](function(_0x301234){logger[_0x93a0('0x11')](_0x93a0('0xc'),_0x5c4872,_0x301234);_0x3736ef(_0x301234);});});}exports[_0x93a0('0x14')]=function(_0x38068a){var _0x2404ac=this;return new Promise(function(_0x1b18cc,_0x3c9557){return db[_0x93a0('0x15')][_0x93a0('0x16')](_0x38068a['body'],{'raw':_0x38068a[_0x93a0('0x17')]?_0x38068a['options'][_0x93a0('0x18')]===undefined?!![]:![]:!![]})[_0x93a0('0xa')](function(_0x33e5b6){logger[_0x93a0('0xb')](_0x93a0('0x14'),_0x38068a);logger[_0x93a0('0xe')](_0x93a0('0x14'),_0x38068a,JSON[_0x93a0('0x10')](_0x33e5b6));_0x1b18cc(_0x33e5b6);})[_0x93a0('0x19')](function(_0x301403){logger[_0x93a0('0x11')](_0x93a0('0x14'),_0x301403[_0x93a0('0x12')],_0x38068a);_0x3c9557(_0x2404ac[_0x93a0('0x11')](0x1f4,_0x301403['message']));});});};exports[_0x93a0('0x1a')]=function(_0x1e1108){var _0x308423=this;return new Promise(function(_0x3f40ab,_0x436ada){return db['VoiceDialReport'][_0x93a0('0x1b')](_0x1e1108['body'],{'raw':_0x1e1108[_0x93a0('0x17')]?_0x1e1108[_0x93a0('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e1108['options']?_0x1e1108[_0x93a0('0x17')][_0x93a0('0x1c')]||null:null,'attributes':_0x1e1108[_0x93a0('0x17')]?_0x1e1108[_0x93a0('0x17')][_0x93a0('0x1d')]||null:null,'limit':_0x1e1108['options']?_0x1e1108['options'][_0x93a0('0x1e')]||null:null})[_0x93a0('0xa')](function(_0x146187){logger[_0x93a0('0xb')](_0x93a0('0x1a'),_0x1e1108);logger[_0x93a0('0xe')](_0x93a0('0x1a'),_0x1e1108,JSON[_0x93a0('0x10')](_0x146187));_0x3f40ab(_0x146187);})[_0x93a0('0x19')](function(_0x11a010){logger[_0x93a0('0x11')](_0x93a0('0x1a'),_0x11a010[_0x93a0('0x12')],_0x1e1108);_0x436ada(_0x308423[_0x93a0('0x11')](0x1f4,_0x11a010[_0x93a0('0x12')]));});});}; \ No newline at end of file +var _0x800a=['where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateVoiceDialReport','create','options','debug','VoiceDialReport','update','body','raw'];(function(_0x507c8f,_0x312b56){var _0x408fd5=function(_0x478863){while(--_0x478863){_0x507c8f['push'](_0x507c8f['shift']());}};_0x408fd5(++_0x312b56);}(_0x800a,0xb8));var _0xa800=function(_0x58d551,_0x4d6f41){_0x58d551=_0x58d551-0x0;var _0x2080e9=_0x800a[_0x58d551];return _0x2080e9;};'use strict';var _=require(_0xa800('0x0'));var util=require(_0xa800('0x1'));var moment=require(_0xa800('0x2'));var BPromise=require('bluebird');var rs=require(_0xa800('0x3'));var fs=require('fs');var Redis=require(_0xa800('0x4'));var db=require(_0xa800('0x5'))['db'];var utils=require(_0xa800('0x6'));var logger=require(_0xa800('0x7'))(_0xa800('0x8'));var config=require(_0xa800('0x9'));var jayson=require(_0xa800('0xa'));var client=jayson[_0xa800('0xb')][_0xa800('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x514555,_0x11219b,_0x128232){return new BPromise(function(_0x132d5d,_0x3831a2){return client[_0xa800('0xd')](_0x514555,_0x128232)[_0xa800('0xe')](function(_0x47be72){logger[_0xa800('0xf')](_0xa800('0x10'),_0x11219b,'request\x20sent');logger['debug'](_0xa800('0x11'),_0x11219b,'request\x20sent',JSON[_0xa800('0x12')](_0x47be72));if(_0x47be72[_0xa800('0x13')]){if(_0x47be72['error'][_0xa800('0x14')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x11219b,_0x47be72[_0xa800('0x13')][_0xa800('0x15')]);return _0x3831a2(_0x47be72[_0xa800('0x13')][_0xa800('0x15')]);}logger[_0xa800('0x13')](_0xa800('0x10'),_0x11219b,_0x47be72[_0xa800('0x13')][_0xa800('0x15')]);return _0x132d5d(_0x47be72[_0xa800('0x13')][_0xa800('0x15')]);}else{logger['info'](_0xa800('0x10'),_0x11219b,_0xa800('0x16'));_0x132d5d(_0x47be72['result'][_0xa800('0x15')]);}})[_0xa800('0x17')](function(_0x26e7ec){logger[_0xa800('0x13')](_0xa800('0x10'),_0x11219b,_0x26e7ec);_0x3831a2(_0x26e7ec);});});}exports[_0xa800('0x18')]=function(_0x1c9b2c){var _0x399580=this;return new Promise(function(_0x1ff44a,_0x22f754){return db['VoiceDialReport'][_0xa800('0x19')](_0x1c9b2c['body'],{'raw':_0x1c9b2c[_0xa800('0x1a')]?_0x1c9b2c[_0xa800('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x791056){logger[_0xa800('0xf')]('CreateVoiceDialReport',_0x1c9b2c);logger[_0xa800('0x1b')](_0xa800('0x18'),_0x1c9b2c,JSON['stringify'](_0x791056));_0x1ff44a(_0x791056);})[_0xa800('0x17')](function(_0x143dee){logger[_0xa800('0x13')](_0xa800('0x18'),_0x143dee[_0xa800('0x15')],_0x1c9b2c);_0x22f754(_0x399580[_0xa800('0x13')](0x1f4,_0x143dee['message']));});});};exports['UpdateVoiceDialReport']=function(_0xe9dc9a){var _0x2c82f3=this;return new Promise(function(_0x3f6d7f,_0x3db405){return db[_0xa800('0x1c')][_0xa800('0x1d')](_0xe9dc9a[_0xa800('0x1e')],{'raw':_0xe9dc9a[_0xa800('0x1a')]?_0xe9dc9a[_0xa800('0x1a')][_0xa800('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe9dc9a[_0xa800('0x1a')]?_0xe9dc9a['options'][_0xa800('0x20')]||null:null,'attributes':_0xe9dc9a['options']?_0xe9dc9a[_0xa800('0x1a')][_0xa800('0x21')]||null:null,'limit':_0xe9dc9a[_0xa800('0x1a')]?_0xe9dc9a[_0xa800('0x1a')][_0xa800('0x22')]||null:null})['then'](function(_0x5bdc29){logger[_0xa800('0xf')](_0xa800('0x23'),_0xe9dc9a);logger['debug']('UpdateVoiceDialReport',_0xe9dc9a,JSON['stringify'](_0x5bdc29));_0x3f6d7f(_0x5bdc29);})[_0xa800('0x17')](function(_0x42c9cc){logger['error'](_0xa800('0x23'),_0x42c9cc[_0xa800('0x15')],_0xe9dc9a);_0x3db405(_0x2c82f3[_0xa800('0x13')](0x1f4,_0x42c9cc[_0xa800('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 26450ba..27c9236 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 _0xe7a8=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/applications','put','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe7a8,0x1e9));var _0x8e7a=function(_0x13ed6f,_0x515c3c){_0x13ed6f=_0x13ed6f-0x0;var _0x3b42dd=_0xe7a8[_0x13ed6f];return _0x3b42dd;};'use strict';var multer=require(_0x8e7a('0x0'));var util=require('util');var path=require(_0x8e7a('0x1'));var timeout=require(_0x8e7a('0x2'));var express=require(_0x8e7a('0x3'));var router=express[_0x8e7a('0x4')]();var fs_extra=require(_0x8e7a('0x5'));var auth=require(_0x8e7a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8e7a('0x7'));var controller=require('./voiceExtension.controller');router[_0x8e7a('0x8')]('/',auth[_0x8e7a('0x9')](),controller[_0x8e7a('0xa')]);router[_0x8e7a('0x8')](_0x8e7a('0xb'),auth[_0x8e7a('0x9')](),controller[_0x8e7a('0xc')]);router['post']('/',auth[_0x8e7a('0x9')](),controller['create']);router[_0x8e7a('0xd')](_0x8e7a('0xe'),auth[_0x8e7a('0x9')](),controller['addApplications']);router[_0x8e7a('0xf')](_0x8e7a('0xb'),auth[_0x8e7a('0x9')](),controller['update']);router[_0x8e7a('0x10')]('/:id',auth[_0x8e7a('0x9')](),controller[_0x8e7a('0x11')]);module[_0x8e7a('0x12')]=router; \ No newline at end of file +var _0x68ca=['/:id/applications','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68ca,0xb9));var _0xa68c=function(_0x1aeef0,_0x2b89eb){_0x1aeef0=_0x1aeef0-0x0;var _0x117217=_0x68ca[_0x1aeef0];return _0x117217;};'use strict';var multer=require(_0xa68c('0x0'));var util=require(_0xa68c('0x1'));var path=require('path');var timeout=require(_0xa68c('0x2'));var express=require(_0xa68c('0x3'));var router=express[_0xa68c('0x4')]();var fs_extra=require(_0xa68c('0x5'));var auth=require(_0xa68c('0x6'));var interaction=require(_0xa68c('0x7'));var config=require('../../config/environment');var controller=require(_0xa68c('0x8'));router[_0xa68c('0x9')]('/',auth[_0xa68c('0xa')](),controller['index']);router[_0xa68c('0x9')](_0xa68c('0xb'),auth[_0xa68c('0xa')](),controller[_0xa68c('0xc')]);router[_0xa68c('0xd')]('/',auth[_0xa68c('0xa')](),controller[_0xa68c('0xe')]);router[_0xa68c('0xd')](_0xa68c('0xf'),auth[_0xa68c('0xa')](),controller['addApplications']);router['put'](_0xa68c('0xb'),auth['isAuthenticated'](),controller[_0xa68c('0x10')]);router[_0xa68c('0x11')](_0xa68c('0xb'),auth[_0xa68c('0xa')](),controller[_0xa68c('0x12')]);module[_0xa68c('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ee7472e..4f3e886 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 _0x7742=['INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','internal','inbound-fax','outbound-fax','system','any','*,*,*,*'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7742,0xf5));var _0x2774=function(_0x45aa5f,_0x5b4ee8){_0x45aa5f=_0x45aa5f-0x0;var _0x471c3d=_0x7742[_0x45aa5f];return _0x471c3d;};'use strict';var Sequelize=require(_0x2774('0x0'));module[_0x2774('0x1')]={'context':{'type':Sequelize[_0x2774('0x2')],'allowNull':![],'unique':_0x2774('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2774('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x2774('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x2774('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2774('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x2774('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound','outbound',_0x2774('0x4'),_0x2774('0x5'),_0x2774('0x6'),_0x2774('0x7'),_0x2774('0x8')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2774('0x9')},'IntervalId':{'type':Sequelize[_0x2774('0xa')]},'isApp':{'type':Sequelize[_0x2774('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x2774('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x2774('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x2774('0xa')]},'recordingFormat':{'type':Sequelize[_0x2774('0x2')],'defaultValue':_0x2774('0xc')},'answer':{'type':Sequelize[_0x2774('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x2774('0xd')],'get':function(_0x4f812e){return this['getDataValue'](_0x2774('0xe'));}},'alias':{'type':Sequelize[_0x2774('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x64f7=['inbound','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM'];(function(_0x191fb4,_0x2f7dc7){var _0x1474bb=function(_0x50d02e){while(--_0x50d02e){_0x191fb4['push'](_0x191fb4['shift']());}};_0x1474bb(++_0x2f7dc7);}(_0x64f7,0xd8));var _0x764f=function(_0x145201,_0xe5a96a){_0x145201=_0x145201-0x0;var _0x675a29=_0x64f7[_0x145201];return _0x675a29;};'use strict';var Sequelize=require(_0x764f('0x0'));module['exports']={'context':{'type':Sequelize[_0x764f('0x1')],'allowNull':![],'unique':_0x764f('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x764f('0x2')},'priority':{'type':Sequelize[_0x764f('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x764f('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x764f('0x1')],'allowNull':![],'defaultValue':_0x764f('0x3')},'appdata':{'type':Sequelize[_0x764f('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x764f('0x4')](_0x764f('0x5'),_0x764f('0x6'),'internal',_0x764f('0x7'),_0x764f('0x8'),_0x764f('0x9'),_0x764f('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x764f('0x1')]},'interval':{'type':Sequelize[_0x764f('0x1')],'allowNull':![],'defaultValue':_0x764f('0xb')},'IntervalId':{'type':Sequelize[_0x764f('0xc')]},'isApp':{'type':Sequelize[_0x764f('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x764f('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x764f('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x764f('0xc')]},'recordingFormat':{'type':Sequelize[_0x764f('0x1')],'defaultValue':_0x764f('0xe')},'answer':{'type':Sequelize[_0x764f('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f50cb){return this[_0x764f('0xf')](_0x764f('0x10'));}},'alias':{'type':Sequelize[_0x764f('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 250566d..ec57d95 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 _0xd9ac=['send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','params','body','outbound','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','userProfileId','autoAssociation','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','destroy','then','InboundRoutes','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','error','stack'];(function(_0x1e5b84,_0x1667b0){var _0x53715b=function(_0x1a0ba2){while(--_0x1a0ba2){_0x1e5b84['push'](_0x1e5b84['shift']());}};_0x53715b(++_0x1667b0);}(_0xd9ac,0x14b));var _0xcd9a=function(_0x50ea7e,_0x1e6100){_0x50ea7e=_0x50ea7e-0x0;var _0x2fdb44=_0xd9ac[_0x50ea7e];return _0x2fdb44;};'use strict';var _=require(_0xcd9a('0x0'));var Redis=require(_0xcd9a('0x1'));var qs=require(_0xcd9a('0x2'));var logger=require(_0xcd9a('0x3'))(_0xcd9a('0x4'));var config=require(_0xcd9a('0x5'));var db=require(_0xcd9a('0x6'))['db'];config['redis']=_[_0xcd9a('0x7')](config[_0xcd9a('0x8')],{'host':_0xcd9a('0x9'),'port':0x18eb});var socket=require(_0xcd9a('0xa'))(new Redis(config[_0xcd9a('0x8')]));require('./voiceExtension.socket')[_0xcd9a('0xb')](socket);function respondWithStatusCode(_0x23ebb5,_0x2bd3eb){_0x2bd3eb=_0x2bd3eb||0xcc;return function(_0xb97f86){if(_0xb97f86){return _0x23ebb5[_0xcd9a('0xc')](_0x2bd3eb);}return _0x23ebb5[_0xcd9a('0xd')](_0x2bd3eb)[_0xcd9a('0xe')]();};}function respondWithResult(_0x4f5c33,_0x34037b){_0x34037b=_0x34037b||0xc8;return function(_0x1cc5e1){if(_0x1cc5e1){return _0x4f5c33['status'](_0x34037b)[_0xcd9a('0xf')](_0x1cc5e1);}};}function respondWithFilteredResult(_0x349d82,_0x5c6dbb){return function(_0x56383c){if(_0x56383c){var _0x47ec1b=typeof _0x5c6dbb['offset']===_0xcd9a('0x10')&&typeof _0x5c6dbb['limit']===_0xcd9a('0x10');var _0x3c0bd2=_0x56383c[_0xcd9a('0x11')];var _0x56ee5a=_0x47ec1b?0x0:_0x5c6dbb['offset'];var _0x5a55e3=_0x47ec1b?_0x56383c[_0xcd9a('0x11')]:_0x5c6dbb[_0xcd9a('0x12')]+_0x5c6dbb[_0xcd9a('0x13')];var _0x58f374;if(_0x5a55e3>=_0x3c0bd2){_0x5a55e3=_0x3c0bd2;_0x58f374=0xc8;}else{_0x58f374=0xce;}_0x349d82[_0xcd9a('0xd')](_0x58f374);return _0x349d82[_0xcd9a('0x14')](_0xcd9a('0x15'),_0x56ee5a+'-'+_0x5a55e3+'/'+_0x3c0bd2)[_0xcd9a('0xf')](_0x56383c);}return null;};}function removeEntity(_0x1dcb30){return function(_0x3f9425){if(_0x3f9425){return _0x3f9425[_0xcd9a('0x16')]()[_0xcd9a('0x17')](function(){var _0x54e380=_0x3f9425['get']({'plain':!![]});var _0x2a3ef3=[{'name':_0xcd9a('0x18'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0xcd9a('0x19'),'value':_0xcd9a('0x1a'),'ignore':![]}];var _0x234254=_(_0x2a3ef3)[_0xcd9a('0x1b')]('ignore')[_0xcd9a('0x1c')]('value')[_0xcd9a('0x1d')]();if(_[_0xcd9a('0x1e')](_0x234254,_0x54e380[_0xcd9a('0x1f')])){return;}var _0x4dbbd9=_[_0xcd9a('0x20')](_0x2a3ef3,[_0xcd9a('0x1d'),_0x54e380['type']])[_0xcd9a('0x21')];return db[_0xcd9a('0x22')]['destroy']({'where':{'type':_0x4dbbd9,'resourceId':_0x54e380['id']}})[_0xcd9a('0x17')](function(){return _0x3f9425;});})[_0xcd9a('0x17')](function(){_0x1dcb30[_0xcd9a('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24b555){return function(_0x397d75){if(!_0x397d75){_0x24b555[_0xcd9a('0xc')](0x194);}return _0x397d75;};}function handleError(_0xc2b3f5,_0x2a79d4){_0x2a79d4=_0x2a79d4||0x1f4;return function(_0x535fc6){logger[_0xcd9a('0x23')](_0x535fc6[_0xcd9a('0x24')]);if(_0x535fc6['name']){delete _0x535fc6['name'];}_0xc2b3f5[_0xcd9a('0xd')](_0x2a79d4)[_0xcd9a('0x25')](_0x535fc6);};}exports[_0xcd9a('0x26')]=function(_0x5928ea,_0x51e1f4){var _0x5d4f28={},_0x2c080={},_0x555ad5={'count':0x0,'rows':[]};var _0xe0b775=_[_0xcd9a('0x1c')](db[_0xcd9a('0x27')][_0xcd9a('0x28')],function(_0x3d5416){return{'name':_0x3d5416[_0xcd9a('0x29')],'type':_0x3d5416[_0xcd9a('0x1f')][_0xcd9a('0x2a')]};});_0x2c080[_0xcd9a('0x2b')]=_['map'](_0xe0b775,_0xcd9a('0x21'));_0x2c080[_0xcd9a('0x2c')]=_[_0xcd9a('0x2d')](_0x5928ea[_0xcd9a('0x2c')]);_0x2c080['filters']=_[_0xcd9a('0x2e')](_0x2c080['model'],_0x2c080['query']);_0x5d4f28['attributes']=_[_0xcd9a('0x2e')](_0x2c080[_0xcd9a('0x2b')],qs[_0xcd9a('0x2f')](_0x5928ea['query'][_0xcd9a('0x2f')]));_0x5d4f28[_0xcd9a('0x30')]=_0x5d4f28[_0xcd9a('0x30')][_0xcd9a('0x31')]?_0x5d4f28[_0xcd9a('0x30')]:_0x2c080['model'];if(!_0x5928ea[_0xcd9a('0x2c')][_0xcd9a('0x32')]('nolimit')){_0x5d4f28[_0xcd9a('0x13')]=qs['limit'](_0x5928ea[_0xcd9a('0x2c')][_0xcd9a('0x13')]);_0x5d4f28[_0xcd9a('0x12')]=qs[_0xcd9a('0x12')](_0x5928ea[_0xcd9a('0x2c')][_0xcd9a('0x12')]);}_0x5d4f28['order']=qs['sort'](_0x5928ea[_0xcd9a('0x2c')][_0xcd9a('0x33')]);_0x5d4f28[_0xcd9a('0x34')]=qs[_0xcd9a('0x35')](_[_0xcd9a('0x36')](_0x5928ea[_0xcd9a('0x2c')],_0x2c080['filters']),_0xe0b775);if(_0x5928ea[_0xcd9a('0x2c')][_0xcd9a('0x1b')]){_0x5d4f28['where']=_[_0xcd9a('0x37')](_0x5d4f28[_0xcd9a('0x34')],{'$or':_['map'](_0xe0b775,function(_0x23aa93){if(_0x23aa93[_0xcd9a('0x1f')]!==_0xcd9a('0x38')){var _0x36619f={};_0x36619f[_0x23aa93[_0xcd9a('0x21')]]={'$like':'%'+_0x5928ea[_0xcd9a('0x2c')][_0xcd9a('0x1b')]+'%'};return _0x36619f;}})});}_0x5d4f28=_[_0xcd9a('0x37')]({},_0x5d4f28,_0x5928ea[_0xcd9a('0x39')]);var _0x498033={'where':_0x5d4f28[_0xcd9a('0x34')]};return db[_0xcd9a('0x27')][_0xcd9a('0x11')](_0x498033)['then'](function(_0x527469){_0x555ad5[_0xcd9a('0x11')]=_0x527469;if(_0x5928ea[_0xcd9a('0x2c')][_0xcd9a('0x3a')]){_0x5d4f28[_0xcd9a('0x3b')]=[{'all':!![]}];}return db[_0xcd9a('0x27')][_0xcd9a('0x3c')](_0x5d4f28);})[_0xcd9a('0x17')](function(_0x16856c){_0x555ad5['rows']=_0x16856c;return _0x555ad5;})['then'](respondWithFilteredResult(_0x51e1f4,_0x5d4f28))['catch'](handleError(_0x51e1f4,null));};exports[_0xcd9a('0x3d')]=function(_0x3334cb,_0x36b986){var _0x25eeb2={'raw':![],'where':{'id':_0x3334cb['params']['id']}},_0x1d018c={};_0x1d018c[_0xcd9a('0x2b')]=_[_0xcd9a('0x2d')](db[_0xcd9a('0x27')]['rawAttributes']);_0x1d018c['query']=_[_0xcd9a('0x2d')](_0x3334cb[_0xcd9a('0x2c')]);_0x1d018c[_0xcd9a('0x35')]=_[_0xcd9a('0x2e')](_0x1d018c[_0xcd9a('0x2b')],_0x1d018c['query']);_0x25eeb2[_0xcd9a('0x30')]=_[_0xcd9a('0x2e')](_0x1d018c[_0xcd9a('0x2b')],qs[_0xcd9a('0x2f')](_0x3334cb['query'][_0xcd9a('0x2f')]));_0x25eeb2[_0xcd9a('0x30')]=_0x25eeb2[_0xcd9a('0x30')][_0xcd9a('0x31')]?_0x25eeb2['attributes']:_0x1d018c[_0xcd9a('0x2b')];if(_0x3334cb[_0xcd9a('0x2c')]['includeAll']){_0x25eeb2[_0xcd9a('0x3b')]=[{'all':!![]}];}_0x25eeb2=_['merge']({},_0x25eeb2,_0x3334cb[_0xcd9a('0x39')]);return db[_0xcd9a('0x27')]['find'](_0x25eeb2)[_0xcd9a('0x17')](handleEntityNotFound(_0x36b986,null))[_0xcd9a('0x17')](respondWithResult(_0x36b986,null))[_0xcd9a('0x3e')](handleError(_0x36b986,null));};exports[_0xcd9a('0x16')]=function(_0x597781,_0x3bcd47){return db['VoiceExtension'][_0xcd9a('0x20')]({'where':{'id':_0x597781[_0xcd9a('0x3f')]['id']}})[_0xcd9a('0x17')](handleEntityNotFound(_0x3bcd47,null))[_0xcd9a('0x17')](removeEntity(_0x3bcd47,null))[_0xcd9a('0x3e')](handleError(_0x3bcd47,null));};exports['create']=function(_0x4d36b8,_0xd8d9aa){if(_0x4d36b8[_0xcd9a('0x40')][_0xcd9a('0x1f')]===_0xcd9a('0x41')&&!_['startsWith'](_0x4d36b8[_0xcd9a('0x40')][_0xcd9a('0x42')],'_')){_0x4d36b8[_0xcd9a('0x40')]['exten']='_'[_0xcd9a('0x43')](_0x4d36b8[_0xcd9a('0x40')]['exten']);}return db['VoiceExtension']['create'](_0x4d36b8['body'],{'raw':![]})[_0xcd9a('0x17')](function(_0x5b77d1){var _0x5362c8=_0x4d36b8[_0xcd9a('0x44')][_0xcd9a('0x45')]({'plain':!![]});if(!_0x5362c8)throw new Error(_0xcd9a('0x46'));if(_0x5362c8[_0xcd9a('0x47')]===_0xcd9a('0x44')){var _0x328885=_0x5b77d1['get']({'plain':!![]});var _0x585dbb=[{'name':_0xcd9a('0x18'),'value':'inbound'},{'name':_0xcd9a('0x48'),'value':_0xcd9a('0x41')},{'name':_0xcd9a('0x19'),'value':_0xcd9a('0x1a')}];var _0x58f9fc=_[_0xcd9a('0x20')](_0x585dbb,[_0xcd9a('0x1d'),_0x328885['type']])[_0xcd9a('0x21')];return db['UserProfileSection'][_0xcd9a('0x20')]({'where':{'name':_0x58f9fc,'userProfileId':_0x5362c8[_0xcd9a('0x49')]},'raw':!![]})[_0xcd9a('0x17')](function(_0x41d05f){if(_0x41d05f&&_0x41d05f[_0xcd9a('0x4a')]===0x0){return db[_0xcd9a('0x22')]['create']({'name':_0x328885[_0xcd9a('0x21')],'resourceId':_0x328885['id'],'type':_0x41d05f[_0xcd9a('0x21')],'sectionId':_0x41d05f['id']},{})['then'](function(){return _0x5b77d1;});}else{return _0x5b77d1;}})[_0xcd9a('0x3e')](function(_0x92dbb7){logger[_0xcd9a('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x92dbb7);throw _0x92dbb7;});}return _0x5b77d1;})[_0xcd9a('0x17')](respondWithResult(_0xd8d9aa,0xc9))['catch'](handleError(_0xd8d9aa,null));};exports[_0xcd9a('0x4b')]=function(_0x1f3545,_0xbc9cbb){if(_0x1f3545[_0xcd9a('0x40')]['id']){delete _0x1f3545[_0xcd9a('0x40')]['id'];}return db[_0xcd9a('0x27')][_0xcd9a('0x20')]({'where':{'id':_0x1f3545[_0xcd9a('0x3f')]['id']}})[_0xcd9a('0x17')](handleEntityNotFound(_0xbc9cbb,null))[_0xcd9a('0x17')](function(_0x36de6f){if(_0x36de6f){return db['VoiceExtension'][_0xcd9a('0x4b')](_[_0xcd9a('0x36')](_0x1f3545[_0xcd9a('0x40')],[_0xcd9a('0x42'),_0xcd9a('0x4c'),_0xcd9a('0x4d'),_0xcd9a('0x4e'),_0xcd9a('0x4f'),_0xcd9a('0x50'),_0xcd9a('0x51')]),{'where':{'context':_0x36de6f[_0xcd9a('0x4c')],'exten':_0x36de6f[_0xcd9a('0x42')]},'individualHooks':!![]})[_0xcd9a('0x17')](function(_0x283edb){return _0x283edb;});}return null;})['then'](respondWithStatusCode(_0xbc9cbb,null))[_0xcd9a('0x3e')](handleError(_0xbc9cbb,null));};exports[_0xcd9a('0x52')]=function(_0x1c9036,_0xeba92){var _0x42743c=_0x1c9036[_0xcd9a('0x3f')]['id'];var _0x190ae4=_0x1c9036[_0xcd9a('0x40')];var _0xafe33a=0xc8;var _0x203624=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xcd9a('0x53')][_0xcd9a('0x54')][_0xcd9a('0x55')]},function(_0x402762){return db['VoiceExtension'][_0xcd9a('0x56')]({'where':{'id':_0x42743c},'transaction':_0x402762})[_0xcd9a('0x17')](function(_0x539e2f){if(_0x539e2f){return db[_0xcd9a('0x27')][_0xcd9a('0x16')]({'where':{'VoiceExtensionId':_0x42743c},'transaction':_0x402762})[_0xcd9a('0x17')](function(){var _0x3ab42b=_[_0xcd9a('0x1c')](_0x190ae4,function(_0x34f076){_0x34f076['VoiceExtensionId']=_0x42743c;_0x34f076[_0xcd9a('0x57')]=!![];return _0x34f076;});return _0x539e2f[_0xcd9a('0x58')](_0x3ab42b);})[_0xcd9a('0x17')](function(_0x88587b){return db['VoiceExtension']['bulkCreate'](_0x88587b,{'transaction':_0x402762});});}else{_0xafe33a=0x194;_0x203624=[];}});})['then'](function(){if(_0xafe33a!==0x194){return db[_0xcd9a('0x27')][_0xcd9a('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x42743c},'order':_0xcd9a('0x5a')})[_0xcd9a('0x17')](function(_0xc023ff){_0x203624=_0xc023ff;});}})[_0xcd9a('0x3e')](function(_0x2a0bf2){_0xafe33a=0x1f4;logger[_0xcd9a('0x23')](_0x2a0bf2['stack']);if(_0x2a0bf2[_0xcd9a('0x21')]){delete _0x2a0bf2['name'];}_0x203624=_0x2a0bf2;})[_0xcd9a('0x5b')](function(){if(_0x203624===null){_0xeba92[_0xcd9a('0xc')](_0xafe33a);}else{if(_0xafe33a===0x1f4){_0xeba92['status'](_0xafe33a)[_0xcd9a('0x25')](_0x203624);}else{_0xeba92[_0xcd9a('0xd')](_0xafe33a)[_0xcd9a('0xf')](_0x203624);}}});}; \ No newline at end of file +var _0x8bc5=['findAndCountAll','stack','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','destroy','outbound','InternalRoutes','internal','filter','ignore','includes','type','find','value','name','UserProfileResource','then','end','sendStatus','error','send','index','fieldName','key','map','keys','query','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filters','VIRTUAL','options','VoiceExtension','includeAll','include','rows','catch','show','rawAttributes','length','merge','params','startsWith','exten','body','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','inbound','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate'];(function(_0x509eea,_0x3ab965){var _0x29024e=function(_0x42b894){while(--_0x42b894){_0x509eea['push'](_0x509eea['shift']());}};_0x29024e(++_0x3ab965);}(_0x8bc5,0xc2));var _0x58bc=function(_0x514fcb,_0x55f11e){_0x514fcb=_0x514fcb-0x0;var _0x4c2897=_0x8bc5[_0x514fcb];return _0x4c2897;};'use strict';var _=require(_0x58bc('0x0'));var Redis=require(_0x58bc('0x1'));var qs=require(_0x58bc('0x2'));var logger=require('../../config/logger')('api');var config=require(_0x58bc('0x3'));var db=require(_0x58bc('0x4'))['db'];config[_0x58bc('0x5')]=_[_0x58bc('0x6')](config[_0x58bc('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x58bc('0x7'))(new Redis(config[_0x58bc('0x5')]));require(_0x58bc('0x8'))[_0x58bc('0x9')](socket);function respondWithStatusCode(_0x39b670,_0x25c9c2){_0x25c9c2=_0x25c9c2||0xcc;return function(_0xc87d26){if(_0xc87d26){return _0x39b670['sendStatus'](_0x25c9c2);}return _0x39b670[_0x58bc('0xa')](_0x25c9c2)['end']();};}function respondWithResult(_0x94f734,_0x151e57){_0x151e57=_0x151e57||0xc8;return function(_0x5248ca){if(_0x5248ca){return _0x94f734[_0x58bc('0xa')](_0x151e57)[_0x58bc('0xb')](_0x5248ca);}};}function respondWithFilteredResult(_0xb853dd,_0x5e61a6){return function(_0x1ceff4){if(_0x1ceff4){var _0x33d3c8=typeof _0x5e61a6[_0x58bc('0xc')]===_0x58bc('0xd')&&typeof _0x5e61a6[_0x58bc('0xe')]===_0x58bc('0xd');var _0x420fa5=_0x1ceff4[_0x58bc('0xf')];var _0x384953=_0x33d3c8?0x0:_0x5e61a6[_0x58bc('0xc')];var _0x341de6=_0x33d3c8?_0x1ceff4[_0x58bc('0xf')]:_0x5e61a6[_0x58bc('0xc')]+_0x5e61a6[_0x58bc('0xe')];var _0x61e632;if(_0x341de6>=_0x420fa5){_0x341de6=_0x420fa5;_0x61e632=0xc8;}else{_0x61e632=0xce;}_0xb853dd[_0x58bc('0xa')](_0x61e632);return _0xb853dd[_0x58bc('0x10')](_0x58bc('0x11'),_0x384953+'-'+_0x341de6+'/'+_0x420fa5)[_0x58bc('0xb')](_0x1ceff4);}return null;};}function removeEntity(_0x36690b){return function(_0x39f3da){if(_0x39f3da){return _0x39f3da[_0x58bc('0x12')]()['then'](function(){var _0x19b6a8=_0x39f3da['get']({'plain':!![]});var _0x3d456b=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x58bc('0x13'),'ignore':![]},{'name':_0x58bc('0x14'),'value':_0x58bc('0x15'),'ignore':![]}];var _0x441163=_(_0x3d456b)[_0x58bc('0x16')](_0x58bc('0x17'))['map']('value')['value']();if(_[_0x58bc('0x18')](_0x441163,_0x19b6a8[_0x58bc('0x19')])){return;}var _0x7fee8d=_[_0x58bc('0x1a')](_0x3d456b,[_0x58bc('0x1b'),_0x19b6a8[_0x58bc('0x19')]])[_0x58bc('0x1c')];return db[_0x58bc('0x1d')][_0x58bc('0x12')]({'where':{'type':_0x7fee8d,'resourceId':_0x19b6a8['id']}})[_0x58bc('0x1e')](function(){return _0x39f3da;});})[_0x58bc('0x1e')](function(){_0x36690b[_0x58bc('0xa')](0xcc)[_0x58bc('0x1f')]();});}};}function handleEntityNotFound(_0x5eeca2){return function(_0x4063cb){if(!_0x4063cb){_0x5eeca2[_0x58bc('0x20')](0x194);}return _0x4063cb;};}function handleError(_0x17daf0,_0x5274ca){_0x5274ca=_0x5274ca||0x1f4;return function(_0x477faf){logger[_0x58bc('0x21')](_0x477faf['stack']);if(_0x477faf[_0x58bc('0x1c')]){delete _0x477faf['name'];}_0x17daf0[_0x58bc('0xa')](_0x5274ca)[_0x58bc('0x22')](_0x477faf);};}exports[_0x58bc('0x23')]=function(_0x151907,_0x15c5f0){var _0x403c65={},_0x3a7967={},_0xea1b51={'count':0x0,'rows':[]};var _0x83344e=_['map'](db['VoiceExtension']['rawAttributes'],function(_0xc0a366){return{'name':_0xc0a366[_0x58bc('0x24')],'type':_0xc0a366[_0x58bc('0x19')][_0x58bc('0x25')]};});_0x3a7967['model']=_[_0x58bc('0x26')](_0x83344e,_0x58bc('0x1c'));_0x3a7967['query']=_[_0x58bc('0x27')](_0x151907[_0x58bc('0x28')]);_0x3a7967['filters']=_[_0x58bc('0x29')](_0x3a7967['model'],_0x3a7967[_0x58bc('0x28')]);_0x403c65[_0x58bc('0x2a')]=_[_0x58bc('0x29')](_0x3a7967[_0x58bc('0x2b')],qs[_0x58bc('0x2c')](_0x151907[_0x58bc('0x28')][_0x58bc('0x2c')]));_0x403c65[_0x58bc('0x2a')]=_0x403c65[_0x58bc('0x2a')]['length']?_0x403c65[_0x58bc('0x2a')]:_0x3a7967[_0x58bc('0x2b')];if(!_0x151907[_0x58bc('0x28')][_0x58bc('0x2d')]('nolimit')){_0x403c65[_0x58bc('0xe')]=qs[_0x58bc('0xe')](_0x151907['query'][_0x58bc('0xe')]);_0x403c65[_0x58bc('0xc')]=qs['offset'](_0x151907['query'][_0x58bc('0xc')]);}_0x403c65[_0x58bc('0x2e')]=qs[_0x58bc('0x2f')](_0x151907[_0x58bc('0x28')][_0x58bc('0x2f')]);_0x403c65[_0x58bc('0x30')]=qs[_0x58bc('0x31')](_['pick'](_0x151907['query'],_0x3a7967[_0x58bc('0x31')]),_0x83344e);if(_0x151907['query']['filter']){_0x403c65[_0x58bc('0x30')]=_['merge'](_0x403c65['where'],{'$or':_['map'](_0x83344e,function(_0x27405b){if(_0x27405b['type']!==_0x58bc('0x32')){var _0x57b03b={};_0x57b03b[_0x27405b['name']]={'$like':'%'+_0x151907[_0x58bc('0x28')]['filter']+'%'};return _0x57b03b;}})});}_0x403c65=_['merge']({},_0x403c65,_0x151907[_0x58bc('0x33')]);var _0x62b8e7={'where':_0x403c65[_0x58bc('0x30')]};return db[_0x58bc('0x34')][_0x58bc('0xf')](_0x62b8e7)[_0x58bc('0x1e')](function(_0x2b0555){_0xea1b51[_0x58bc('0xf')]=_0x2b0555;if(_0x151907[_0x58bc('0x28')][_0x58bc('0x35')]){_0x403c65[_0x58bc('0x36')]=[{'all':!![]}];}return db[_0x58bc('0x34')]['findAll'](_0x403c65);})['then'](function(_0x1a9b90){_0xea1b51[_0x58bc('0x37')]=_0x1a9b90;return _0xea1b51;})['then'](respondWithFilteredResult(_0x15c5f0,_0x403c65))[_0x58bc('0x38')](handleError(_0x15c5f0,null));};exports[_0x58bc('0x39')]=function(_0x2a4310,_0x3b5007){var _0x1bb693={'raw':![],'where':{'id':_0x2a4310['params']['id']}},_0x477934={};_0x477934[_0x58bc('0x2b')]=_[_0x58bc('0x27')](db[_0x58bc('0x34')][_0x58bc('0x3a')]);_0x477934[_0x58bc('0x28')]=_[_0x58bc('0x27')](_0x2a4310[_0x58bc('0x28')]);_0x477934[_0x58bc('0x31')]=_[_0x58bc('0x29')](_0x477934['model'],_0x477934[_0x58bc('0x28')]);_0x1bb693[_0x58bc('0x2a')]=_[_0x58bc('0x29')](_0x477934[_0x58bc('0x2b')],qs[_0x58bc('0x2c')](_0x2a4310[_0x58bc('0x28')]['fields']));_0x1bb693[_0x58bc('0x2a')]=_0x1bb693['attributes'][_0x58bc('0x3b')]?_0x1bb693[_0x58bc('0x2a')]:_0x477934[_0x58bc('0x2b')];if(_0x2a4310[_0x58bc('0x28')][_0x58bc('0x35')]){_0x1bb693[_0x58bc('0x36')]=[{'all':!![]}];}_0x1bb693=_[_0x58bc('0x3c')]({},_0x1bb693,_0x2a4310[_0x58bc('0x33')]);return db['VoiceExtension'][_0x58bc('0x1a')](_0x1bb693)[_0x58bc('0x1e')](handleEntityNotFound(_0x3b5007,null))[_0x58bc('0x1e')](respondWithResult(_0x3b5007,null))[_0x58bc('0x38')](handleError(_0x3b5007,null));};exports[_0x58bc('0x12')]=function(_0x1eba08,_0x36d157){return db[_0x58bc('0x34')][_0x58bc('0x1a')]({'where':{'id':_0x1eba08[_0x58bc('0x3d')]['id']}})['then'](handleEntityNotFound(_0x36d157,null))[_0x58bc('0x1e')](removeEntity(_0x36d157,null))[_0x58bc('0x38')](handleError(_0x36d157,null));};exports['create']=function(_0x1907d4,_0x1b1856){if(_0x1907d4['body'][_0x58bc('0x19')]===_0x58bc('0x13')&&!_[_0x58bc('0x3e')](_0x1907d4['body'][_0x58bc('0x3f')],'_')){_0x1907d4[_0x58bc('0x40')][_0x58bc('0x3f')]='_'[_0x58bc('0x41')](_0x1907d4['body']['exten']);}return db[_0x58bc('0x34')][_0x58bc('0x42')](_0x1907d4[_0x58bc('0x40')],{'raw':![]})[_0x58bc('0x1e')](function(_0x1880df){var _0x352032=_0x1907d4[_0x58bc('0x43')][_0x58bc('0x44')]({'plain':!![]});if(!_0x352032)throw new Error(_0x58bc('0x45'));if(_0x352032[_0x58bc('0x46')]===_0x58bc('0x43')){var _0x1925e1=_0x1880df[_0x58bc('0x44')]({'plain':!![]});var _0x672927=[{'name':_0x58bc('0x47'),'value':_0x58bc('0x48')},{'name':_0x58bc('0x49'),'value':_0x58bc('0x13')},{'name':_0x58bc('0x14'),'value':'internal'}];var _0x2ccf87=_['find'](_0x672927,['value',_0x1925e1[_0x58bc('0x19')]])[_0x58bc('0x1c')];return db[_0x58bc('0x4a')]['find']({'where':{'name':_0x2ccf87,'userProfileId':_0x352032[_0x58bc('0x4b')]},'raw':!![]})[_0x58bc('0x1e')](function(_0x1af7be){if(_0x1af7be&&_0x1af7be[_0x58bc('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x1925e1[_0x58bc('0x1c')],'resourceId':_0x1925e1['id'],'type':_0x1af7be['name'],'sectionId':_0x1af7be['id']},{})[_0x58bc('0x1e')](function(){return _0x1880df;});}else{return _0x1880df;}})[_0x58bc('0x38')](function(_0x268001){logger[_0x58bc('0x21')](_0x58bc('0x4d'),_0x268001);throw _0x268001;});}return _0x1880df;})[_0x58bc('0x1e')](respondWithResult(_0x1b1856,0xc9))[_0x58bc('0x38')](handleError(_0x1b1856,null));};exports['update']=function(_0x5be6c9,_0x45d70b){if(_0x5be6c9[_0x58bc('0x40')]['id']){delete _0x5be6c9['body']['id'];}return db[_0x58bc('0x34')][_0x58bc('0x1a')]({'where':{'id':_0x5be6c9[_0x58bc('0x3d')]['id']}})[_0x58bc('0x1e')](handleEntityNotFound(_0x45d70b,null))[_0x58bc('0x1e')](function(_0x3b6878){if(_0x3b6878){return db[_0x58bc('0x34')][_0x58bc('0x4e')](_[_0x58bc('0x4f')](_0x5be6c9[_0x58bc('0x40')],['exten',_0x58bc('0x50'),_0x58bc('0x51'),'recordingFormat',_0x58bc('0x52'),_0x58bc('0x53'),_0x58bc('0x54')]),{'where':{'context':_0x3b6878[_0x58bc('0x50')],'exten':_0x3b6878[_0x58bc('0x3f')]},'individualHooks':!![]})[_0x58bc('0x1e')](function(_0x5778f3){return _0x5778f3;});}return null;})[_0x58bc('0x1e')](respondWithStatusCode(_0x45d70b,null))[_0x58bc('0x38')](handleError(_0x45d70b,null));};exports[_0x58bc('0x55')]=function(_0x319d8c,_0x18ea73){var _0x5a587f=_0x319d8c[_0x58bc('0x3d')]['id'];var _0x5aed6a=_0x319d8c['body'];var _0x2509ea=0xc8;var _0x85f852=null;return db[_0x58bc('0x56')][_0x58bc('0x57')]({'isolationLevel':db[_0x58bc('0x56')]['Transaction']['ISOLATION_LEVELS'][_0x58bc('0x58')]},function(_0x2f5ebd){return db[_0x58bc('0x34')][_0x58bc('0x59')]({'where':{'id':_0x5a587f},'transaction':_0x2f5ebd})[_0x58bc('0x1e')](function(_0x4d1234){if(_0x4d1234){return db[_0x58bc('0x34')]['destroy']({'where':{'VoiceExtensionId':_0x5a587f},'transaction':_0x2f5ebd})[_0x58bc('0x1e')](function(){var _0x5dbf02=_[_0x58bc('0x26')](_0x5aed6a,function(_0xd8570c){_0xd8570c[_0x58bc('0x5a')]=_0x5a587f;_0xd8570c[_0x58bc('0x5b')]=!![];return _0xd8570c;});return _0x4d1234[_0x58bc('0x5c')](_0x5dbf02);})['then'](function(_0xa8a01b){return db[_0x58bc('0x34')][_0x58bc('0x5d')](_0xa8a01b,{'transaction':_0x2f5ebd});});}else{_0x2509ea=0x194;_0x85f852=[];}});})[_0x58bc('0x1e')](function(){if(_0x2509ea!==0x194){return db[_0x58bc('0x34')][_0x58bc('0x5e')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5a587f},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x6dcebd){_0x85f852=_0x6dcebd;});}})[_0x58bc('0x38')](function(_0x1d09a4){_0x2509ea=0x1f4;logger['error'](_0x1d09a4[_0x58bc('0x5f')]);if(_0x1d09a4['name']){delete _0x1d09a4[_0x58bc('0x1c')];}_0x85f852=_0x1d09a4;})['finally'](function(){if(_0x85f852===null){_0x18ea73[_0x58bc('0x20')](_0x2509ea);}else{if(_0x2509ea===0x1f4){_0x18ea73['status'](_0x2509ea)['send'](_0x85f852);}else{_0x18ea73[_0x58bc('0xa')](_0x2509ea)['json'](_0x85f852);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index becd406..cd3506a 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 _0x30f1=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x30f1,0x18f));var _0x130f=function(_0x45025c,_0x5c5628){_0x45025c=_0x45025c-0x0;var _0x37925c=_0x30f1[_0x45025c];return _0x37925c;};'use strict';var EventEmitter=require(_0x130f('0x0'));var VoiceExtension=require(_0x130f('0x1'))['db'][_0x130f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x130f('0x3')](0x0);var events={'afterCreate':_0x130f('0x4'),'afterUpdate':_0x130f('0x5'),'afterDestroy':_0x130f('0x6')};function emitEvent(_0x22f6eb){return function(_0x42fd3c,_0x3911e8,_0x27a007){VoiceExtensionEvents[_0x130f('0x7')](_0x22f6eb+':'+_0x42fd3c['id'],_0x42fd3c);VoiceExtensionEvents[_0x130f('0x7')](_0x22f6eb,_0x42fd3c);_0x27a007(null);};}for(var e in events){if(events[_0x130f('0x8')](e)){var event=events[e];VoiceExtension[_0x130f('0x9')](e,emitEvent(event));}}module[_0x130f('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0x6bd2=['emit','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove'];(function(_0x44b5e1,_0x3d2933){var _0x435099=function(_0x1d7ea4){while(--_0x1d7ea4){_0x44b5e1['push'](_0x44b5e1['shift']());}};_0x435099(++_0x3d2933);}(_0x6bd2,0xf6));var _0x26bd=function(_0x3b67e4,_0x2a5d46){_0x3b67e4=_0x3b67e4-0x0;var _0x21adcf=_0x6bd2[_0x3b67e4];return _0x21adcf;};'use strict';var EventEmitter=require(_0x26bd('0x0'));var VoiceExtension=require(_0x26bd('0x1'))['db'][_0x26bd('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x26bd('0x3')](0x0);var events={'afterCreate':_0x26bd('0x4'),'afterUpdate':'update','afterDestroy':_0x26bd('0x5')};function emitEvent(_0x40277d){return function(_0x3b2f30,_0x3a5492,_0x57cef6){VoiceExtensionEvents[_0x26bd('0x6')](_0x40277d+':'+_0x3b2f30['id'],_0x3b2f30);VoiceExtensionEvents[_0x26bd('0x6')](_0x40277d,_0x3b2f30);_0x57cef6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x26bd('0x7')](e,emitEvent(event));}}module[_0x26bd('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 6a706ae..a31f491 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 _0x3de9=['then','concat','Hangup','lodash','./voiceExtension.attributes','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','Set','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','name','param','split','phone','prefix','${EXTEN:','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','IntervalId','interval','*,*,*,*','intervals','map','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','outboundDial','appdata','priority','last','catch','define','VoiceExtension','get'];(function(_0x4866ac,_0x15ebf4){var _0x4b6430=function(_0x137d4d){while(--_0x137d4d){_0x4866ac['push'](_0x4866ac['shift']());}};_0x4b6430(++_0x15ebf4);}(_0x3de9,0x147));var _0x93de=function(_0x3fb008,_0x32fb7a){_0x3fb008=_0x3fb008-0x0;var _0x4e9f46=_0x3de9[_0x3fb008];return _0x4e9f46;};'use strict';var _=require(_0x93de('0x0'));var attributes=require(_0x93de('0x1'));module['exports']=function(_0x15edb1){var _0x4e4bd2=_0x15edb1['models'];function _0x2520c0(_0x5efc01){var _0x3132d7=0x2;var _0x3c8335=[{'type':_0x5efc01[_0x93de('0x2')],'app':'Set','appdata':'CDR(type)='+_0x5efc01[_0x93de('0x2')],'context':_0x5efc01[_0x93de('0x3')],'exten':_0x5efc01[_0x93de('0x4')],'priority':_0x3132d7++,'VoiceExtensionId':_0x5efc01['id']},{'type':_0x5efc01[_0x93de('0x2')],'app':_0x5efc01[_0x93de('0x5')]?'Set':_0x93de('0x6'),'appdata':_0x5efc01[_0x93de('0x5')]?_0x93de('0x7')+_0x5efc01[_0x93de('0x5')]:_0x93de('0x8'),'context':_0x5efc01[_0x93de('0x3')],'exten':_0x5efc01[_0x93de('0x4')],'priority':_0x3132d7++,'VoiceExtensionId':_0x5efc01['id']}];if(_0x5efc01[_0x93de('0x2')]===_0x93de('0x9')){_0x3c8335[_0x93de('0xa')]({'type':_0x93de('0x9'),'app':_0x93de('0xb'),'appdata':_0x93de('0xc')+_0x5efc01['id'],'context':_0x5efc01[_0x93de('0x3')],'exten':_0x5efc01[_0x93de('0x4')],'priority':_0x3132d7++,'VoiceExtensionId':_0x5efc01['id']});}_0x3c8335[_0x93de('0xa')]({'type':_0x5efc01[_0x93de('0x2')],'app':_0x93de('0xb'),'appdata':_0x93de('0xd'),'context':_0x5efc01[_0x93de('0x3')],'exten':_0x5efc01[_0x93de('0x4')],'priority':_0x3132d7++,'VoiceExtensionId':_0x5efc01['id']},{'type':_0x5efc01[_0x93de('0x2')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5efc01[_0x93de('0x3')],'exten':_0x5efc01[_0x93de('0x4')],'priority':_0x3132d7++,'VoiceExtensionId':_0x5efc01['id']},{'type':_0x5efc01['type'],'app':'Set','appdata':_0x93de('0xe'),'context':_0x5efc01[_0x93de('0x3')],'exten':_0x5efc01[_0x93de('0x4')],'priority':_0x3132d7++,'VoiceExtensionId':_0x5efc01['id']});return _0x3c8335;}function _0x322547(_0x35851f){var _0xa984d4=0x2;var _0x109d97=[{'type':_0x93de('0xf'),'app':_0x93de('0xb'),'appdata':_0x93de('0x10'),'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f[_0x93de('0x4')],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':_0x35851f[_0x93de('0x5')]?_0x93de('0xb'):_0x93de('0x6'),'appdata':_0x35851f[_0x93de('0x5')]?_0x93de('0x7')+_0x35851f[_0x93de('0x5')]:_0x93de('0x8'),'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f['exten'],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':_0x93de('0xb'),'appdata':_0x93de('0x11')+(_0x35851f[_0x93de('0x12')]?'${EXTEN:'+_0x35851f[_0x93de('0x12')]+'}':_0x93de('0x13')),'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f[_0x93de('0x4')],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':'Set','appdata':_0x93de('0xc')+_0x35851f['id'],'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f['exten'],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':_0x93de('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0xa984d4+0x2)+'):Goto('+(_0xa984d4+0x1)+')','context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f[_0x93de('0x4')],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':_0x93de('0xb'),'appdata':_0x35851f['cutdigits']?_0x93de('0x15')+_0x35851f[_0x93de('0x12')]+'}':_0x93de('0x16'),'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f[_0x93de('0x4')],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':'outbound','app':_0x93de('0xb'),'appdata':_0x93de('0xd'),'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f[_0x93de('0x4')],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':_0x93de('0xb'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f['exten'],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':_0x93de('0xb'),'appdata':_0x93de('0xe'),'context':_0x35851f['context'],'exten':_0x35851f['exten'],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':_0x93de('0xb'),'appdata':'outboundrouteid='+_0x35851f['id'],'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f['exten'],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']}];if(_0x35851f[_0x93de('0x17')](_0x93de('0x18'))&&_0x35851f[_0x93de('0x18')]!=='none'){_0x109d97[_0x93de('0xa')]({'type':_0x93de('0xf'),'app':_0x93de('0xb'),'appdata':_0x93de('0x19'),'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f[_0x93de('0x4')],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']},{'type':_0x93de('0xf'),'app':_0x93de('0xb'),'appdata':_0x93de('0x1a')+_0x35851f[_0x93de('0x18')]||_0x93de('0x1b'),'context':_0x35851f[_0x93de('0x3')],'exten':_0x35851f[_0x93de('0x4')],'priority':_0xa984d4++,'VoiceExtensionId':_0x35851f['id']});}return _0x109d97;}function _0x16b1c6(_0x371908,_0x473a75){var _0x29716d=[{'name':_0x93de('0x1c'),'param':0x0},{'name':_0x93de('0x1d'),'param':0x1},{'name':_0x93de('0x1e'),'param':0x2},{'name':_0x93de('0x1f'),'param':0x3}];var _0x5c6c95={};var _0x26cef5=_0x473a75['split'](',');var _0x2b0f58=[];for(var _0x5d7004=0x0;_0x5d7004<_0x29716d[_0x93de('0x20')];_0x5d7004++){switch(_0x29716d[_0x5d7004][_0x93de('0x21')]){case _0x93de('0x1c'):_0x5c6c95[_0x93de('0x1c')]=_0x26cef5[_0x29716d[_0x5d7004][_0x93de('0x22')]][_0x93de('0x23')]('/')[0x1];_0x5c6c95[_0x93de('0x24')]=_0x26cef5[_0x29716d[_0x5d7004][_0x93de('0x22')]][_0x93de('0x23')]('/')[0x2];_0x5c6c95[_0x93de('0x25')]=_0x5c6c95['phone']?_0x5c6c95['phone'][_0x93de('0x23')]('$')[0x0]:undefined;_0x5c6c95[_0x93de('0x24')]=_0x371908[_0x93de('0x12')]?(_0x5c6c95[_0x93de('0x25')]||'')+_0x93de('0x26')+_0x371908['cutdigits']+'}':(_0x5c6c95[_0x93de('0x25')]||'')+'${EXTEN}';_0x2b0f58[_0x29716d[_0x5d7004][_0x93de('0x22')]]=['SIP',_0x5c6c95[_0x93de('0x1c')],_0x5c6c95[_0x93de('0x24')]][_0x93de('0x27')]('/');break;case _0x93de('0x1e'):_0x5c6c95[_0x93de('0x1e')]=_0x26cef5[_0x29716d[_0x5d7004][_0x93de('0x22')]];if(_0x371908[_0x93de('0x18')]!==_0x93de('0x28')){if(_0x5c6c95['options'][_0x93de('0x29')](_0x93de('0x2a'))<0x0){_0x5c6c95[_0x93de('0x1e')]+=_0x93de('0x2a');}}else{_0x5c6c95[_0x93de('0x1e')]=_0x5c6c95[_0x93de('0x1e')]['replace'](_0x93de('0x2a'),'');}_0x2b0f58[_0x29716d[_0x5d7004]['param']]=_0x5c6c95[_0x93de('0x1e')];break;default:_0x2b0f58[_0x29716d[_0x5d7004][_0x93de('0x22')]]=_0x26cef5[_0x29716d[_0x5d7004]['param']];}}return _0x2b0f58[_0x93de('0x27')](',');}function _0x9a37b0(_0x4fa38d,_0x1090e9,_0xc2ecef){return new Promise(function(_0x49df42,_0x3fd6ff){var _0x4f8392=[];if(_[_0x93de('0x2b')](_0x1090e9))return _0x49df42(_0x4f8392);_0x4e4bd2[_0x93de('0x2c')][_0x93de('0x2d')]({'attributes':['id','interval',_0x93de('0x2e')],'raw':!![]})['then'](function(_0x7cde91){for(var _0x6af46c=0x0,_0x492fce=0x0;_0x6af46c<_0x1090e9[_0x93de('0x20')];_0x6af46c++,_0x492fce=0x0){var _0x5a226f=_0x1090e9[_0x6af46c];var _0x2cf41b=[];var _0x2595d0=[];delete _0x5a226f['id'];if(_0x5a226f[_0x93de('0x2f')]!==_0x93de('0x30')){_0x5a226f[_0x93de('0x31')]=[_0x5a226f[_0x93de('0x2f')]];}else{_0x5a226f['intervals']=_0x5a226f['IntervalId']?_[_0x93de('0x32')](_['filter'](_0x7cde91,{'IntervalId':_0x5a226f['IntervalId']}),_0x93de('0x2f')):[];}_0x5a226f[_0x93de('0x3')]=_0x4fa38d['context'];_0x5a226f[_0x93de('0x4')]=_0x4fa38d[_0x93de('0x4')];if(_0x5a226f[_0x93de('0x2')])_0x5a226f[_0x93de('0x2')]=_0x5a226f[_0x93de('0x2')]['toLowerCase']();if(_0x4fa38d[_0x93de('0x2')]===_0x93de('0xf')){if(_0x5a226f[_0x93de('0x17')](_0x93de('0x33'))&&_0x5a226f[_0x93de('0x33')]&&_0x5a226f['tag']!=='--'){_0x2cf41b['push']({'type':_0x5a226f[_0x93de('0x2')][_0x93de('0x34')](),'app':_0x93de('0xb'),'appdata':_0x93de('0x35')+_0x5a226f['tag'],'context':_0x4fa38d['context'],'exten':_0x4fa38d[_0x93de('0x4')],'priority':_0x5a226f['intervals'][_0x93de('0x20')]+_0xc2ecef+_0x492fce++,'VoiceExtensionId':_0x4fa38d['id']});}_0x2cf41b[_0x93de('0xa')]({'type':_0x5a226f['type']['toLowerCase'](),'app':_0x93de('0x14'),'appdata':_0x93de('0x36')+(_0x5a226f[_0x93de('0x37')]?_0x93de('0x38')+_0x5a226f[_0x93de('0x37')]+')':_0x93de('0x39')),'context':_0x4fa38d[_0x93de('0x3')],'exten':_0x4fa38d[_0x93de('0x4')],'priority':_0x5a226f['intervals']['length']+_0xc2ecef+_0x492fce++,'VoiceExtensionId':_0x4fa38d['id']});}else{if(_0x5a226f[_0x93de('0x17')](_0x93de('0x3a'))){if([_0x93de('0x3b'),_0x93de('0x3c')][_0x93de('0x3d')](_0x5a226f[_0x93de('0x3e')][_0x93de('0x34')]())&&_0x5a226f['appType']!==_0x93de('0x3f')){if(_0x5a226f[_0x93de('0x3a')]){_0x2cf41b[_0x93de('0xa')]({'type':_0x5a226f['type'][_0x93de('0x34')](),'app':_0x93de('0x14'),'appdata':_0x93de('0x40'),'context':_0x4fa38d[_0x93de('0x3')],'exten':_0x4fa38d[_0x93de('0x4')],'priority':_0x5a226f[_0x93de('0x31')][_0x93de('0x20')]+_0xc2ecef+_0x492fce++,'VoiceExtensionId':_0x4fa38d['id']});_0x2cf41b['push']({'type':_0x5a226f['type'][_0x93de('0x34')](),'app':_0x93de('0xb'),'appdata':_0x93de('0x41'),'context':_0x4fa38d['context'],'exten':_0x4fa38d[_0x93de('0x4')],'priority':_0x5a226f[_0x93de('0x31')]['length']+_0xc2ecef+_0x492fce++,'VoiceExtensionId':_0x4fa38d['id']});}else{_0x2cf41b['push']({'type':_0x5a226f[_0x93de('0x2')][_0x93de('0x34')](),'app':_0x93de('0x14'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4fa38d[_0x93de('0x3')],'exten':_0x4fa38d[_0x93de('0x4')],'priority':_0x5a226f[_0x93de('0x31')][_0x93de('0x20')]+_0xc2ecef+_0x492fce++,'VoiceExtensionId':_0x4fa38d['id']});_0x2cf41b['push']({'type':_0x5a226f[_0x93de('0x2')][_0x93de('0x34')](),'app':_0x93de('0xb'),'appdata':_0x93de('0x42'),'context':_0x4fa38d[_0x93de('0x3')],'exten':_0x4fa38d['exten'],'priority':_0x5a226f[_0x93de('0x31')][_0x93de('0x20')]+_0xc2ecef+_0x492fce++,'VoiceExtensionId':_0x4fa38d['id']});}}}}for(var _0x19f9c2=0x0;_0x19f9c2<_0x5a226f[_0x93de('0x31')][_0x93de('0x20')];_0x19f9c2++){var _0x311b2=_0xc2ecef+_0x5a226f[_0x93de('0x31')][_0x93de('0x20')];var _0x25fbc0=_0x19f9c2===_0x5a226f[_0x93de('0x31')][_0x93de('0x20')]-0x1?_0xc2ecef+_0x2cf41b[_0x93de('0x20')]+_0x2595d0['length']+0x2:_0xc2ecef+_0x19f9c2+0x1;_0x2cf41b[_0x93de('0x43')](_0x19f9c2,0x0,{'type':_0x4fa38d[_0x93de('0x2')],'app':'GotoIfTime','appdata':_0x5a226f[_0x93de('0x31')][_0x19f9c2]+'?'+_0x4fa38d[_0x93de('0x3')]+_0x93de('0x44')+_0x311b2+':'+_0x4fa38d['context']+_0x93de('0x44')+_0x25fbc0,'exten':_0x4fa38d[_0x93de('0x4')],'context':_0x4fa38d[_0x93de('0x3')],'priority':_0xc2ecef+_0x19f9c2,'VoiceExtensionId':_0x4fa38d['id']});}if(_0x5a226f[_0x93de('0x45')]===_0x93de('0x46'))_0x5a226f[_0x93de('0x47')]=_0x16b1c6(_0x4fa38d,_0x5a226f[_0x93de('0x47')]);_0x5a226f[_0x93de('0x48')]=_0x2cf41b[_0x93de('0x20')]?_[_0x93de('0x49')](_0x2cf41b)['priority']+0x1:_0xc2ecef;_0x4f8392=_['concat'](_0x4f8392,_0x2cf41b,[_0x5a226f],_0x2595d0);_0xc2ecef=_[_0x93de('0x49')](_0x4f8392)[_0x93de('0x48')]+0x1;}return _0x49df42(_0x4f8392);})[_0x93de('0x4a')](function(_0x1b3d80){_0x3fd6ff(_0x1b3d80);});});}return _0x15edb1[_0x93de('0x4b')](_0x93de('0x4c'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xc4a286){var _0x4918a1=this[_0x93de('0x4d')]({'plain':!![]});var _0x53be5c=_0x4918a1[_0x93de('0x2')]==='outbound'?_0x322547(_0x4918a1):_0x2520c0(_0x4918a1);return _0x9a37b0(_0x4918a1,_0xc4a286,_[_0x93de('0x49')](_0x53be5c)[_0x93de('0x48')]+0x1)[_0x93de('0x4e')](function(_0x55b525){var _0xca9e9f=_[_0x93de('0x4f')](_0x53be5c,_0x55b525);_0xca9e9f[_0x93de('0xa')]({'type':_0x4918a1['type'],'app':_0x93de('0x50'),'exten':_0x4918a1[_0x93de('0x4')],'context':_0x4918a1[_0x93de('0x3')],'priority':_[_0x93de('0x49')](_0xca9e9f)[_0x93de('0x48')]+0x1,'VoiceExtensionId':_0x4918a1['id']});return _0xca9e9f;});}}});}; \ No newline at end of file +var _0x528f=['./voiceExtension.attributes','exports','models','type','CDR(type)=','exten','alias','Set','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','context','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','options','url','split','length','name','trunk','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','then','intervals','IntervalId','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','define','voice_extensions','concat','Hangup'];(function(_0x5d4f9f,_0x25ab08){var _0x4c7afa=function(_0x218a93){while(--_0x218a93){_0x5d4f9f['push'](_0x5d4f9f['shift']());}};_0x4c7afa(++_0x25ab08);}(_0x528f,0x140));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var attributes=require(_0xf528('0x0'));module[_0xf528('0x1')]=function(_0x303dad){var _0x42142d=_0x303dad[_0xf528('0x2')];function _0x5a32b9(_0x1265fe){var _0x4c9c0e=0x2;var _0x4b2bda=[{'type':_0x1265fe[_0xf528('0x3')],'app':'Set','appdata':_0xf528('0x4')+_0x1265fe[_0xf528('0x3')],'context':_0x1265fe['context'],'exten':_0x1265fe[_0xf528('0x5')],'priority':_0x4c9c0e++,'VoiceExtensionId':_0x1265fe['id']},{'type':_0x1265fe[_0xf528('0x3')],'app':_0x1265fe[_0xf528('0x6')]?_0xf528('0x7'):'NoOp','appdata':_0x1265fe['alias']?_0xf528('0x8')+_0x1265fe['alias']:_0xf528('0x9'),'context':_0x1265fe['context'],'exten':_0x1265fe['exten'],'priority':_0x4c9c0e++,'VoiceExtensionId':_0x1265fe['id']}];if(_0x1265fe[_0xf528('0x3')]==='inbound'){_0x4b2bda[_0xf528('0xa')]({'type':_0xf528('0xb'),'app':_0xf528('0x7'),'appdata':_0xf528('0xc')+_0x1265fe['id'],'context':_0x1265fe[_0xf528('0xd')],'exten':_0x1265fe[_0xf528('0x5')],'priority':_0x4c9c0e++,'VoiceExtensionId':_0x1265fe['id']});}_0x4b2bda['push']({'type':_0x1265fe[_0xf528('0x3')],'app':_0xf528('0x7'),'appdata':_0xf528('0xe'),'context':_0x1265fe[_0xf528('0xd')],'exten':_0x1265fe[_0xf528('0x5')],'priority':_0x4c9c0e++,'VoiceExtensionId':_0x1265fe['id']},{'type':_0x1265fe[_0xf528('0x3')],'app':_0xf528('0x7'),'appdata':_0xf528('0xf'),'context':_0x1265fe[_0xf528('0xd')],'exten':_0x1265fe[_0xf528('0x5')],'priority':_0x4c9c0e++,'VoiceExtensionId':_0x1265fe['id']},{'type':_0x1265fe['type'],'app':_0xf528('0x7'),'appdata':_0xf528('0x10'),'context':_0x1265fe[_0xf528('0xd')],'exten':_0x1265fe[_0xf528('0x5')],'priority':_0x4c9c0e++,'VoiceExtensionId':_0x1265fe['id']});return _0x4b2bda;}function _0x2712f9(_0x1470f4){var _0x4bae1a=0x2;var _0x5ebb50=[{'type':_0xf528('0x11'),'app':_0xf528('0x7'),'appdata':_0xf528('0x12'),'context':_0x1470f4['context'],'exten':_0x1470f4['exten'],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':_0xf528('0x11'),'app':_0x1470f4['alias']?_0xf528('0x7'):_0xf528('0x13'),'appdata':_0x1470f4[_0xf528('0x6')]?_0xf528('0x8')+_0x1470f4[_0xf528('0x6')]:_0xf528('0x9'),'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':'outbound','app':_0xf528('0x7'),'appdata':_0xf528('0x14')+(_0x1470f4[_0xf528('0x15')]?_0xf528('0x16')+_0x1470f4[_0xf528('0x15')]+'}':_0xf528('0x17')),'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':'outbound','app':_0xf528('0x7'),'appdata':_0xf528('0xc')+_0x1470f4['id'],'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':_0xf528('0x11'),'app':_0xf528('0x18'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4bae1a+0x2)+_0xf528('0x19')+(_0x4bae1a+0x1)+')','context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4['exten'],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':_0xf528('0x11'),'app':_0xf528('0x7'),'appdata':_0x1470f4['cutdigits']?_0xf528('0x1a')+_0x1470f4['cutdigits']+'}':_0xf528('0x1b'),'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':'outbound','app':'Set','appdata':_0xf528('0xe'),'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':_0xf528('0x11'),'app':_0xf528('0x7'),'appdata':_0xf528('0xf'),'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':_0xf528('0x11'),'app':_0xf528('0x7'),'appdata':_0xf528('0x10'),'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':_0xf528('0x11'),'app':_0xf528('0x7'),'appdata':_0xf528('0x1c')+_0x1470f4['id'],'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4['exten'],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']}];if(_0x1470f4[_0xf528('0x1d')](_0xf528('0x1e'))&&_0x1470f4[_0xf528('0x1e')]!==_0xf528('0x1f')){_0x5ebb50[_0xf528('0xa')]({'type':_0xf528('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']},{'type':_0xf528('0x11'),'app':_0xf528('0x7'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1470f4[_0xf528('0x1e')]||_0xf528('0x20'),'context':_0x1470f4[_0xf528('0xd')],'exten':_0x1470f4[_0xf528('0x5')],'priority':_0x4bae1a++,'VoiceExtensionId':_0x1470f4['id']});}return _0x5ebb50;}function _0x1a9849(_0x143849,_0x41b9e2){var _0x122597=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0xf528('0x21'),'param':0x2},{'name':_0xf528('0x22'),'param':0x3}];var _0x7c24b1={};var _0x67e6da=_0x41b9e2[_0xf528('0x23')](',');var _0x228eea=[];for(var _0x1940ef=0x0;_0x1940ef<_0x122597[_0xf528('0x24')];_0x1940ef++){switch(_0x122597[_0x1940ef][_0xf528('0x25')]){case _0xf528('0x26'):_0x7c24b1['trunk']=_0x67e6da[_0x122597[_0x1940ef][_0xf528('0x27')]]['split']('/')[0x1];_0x7c24b1[_0xf528('0x28')]=_0x67e6da[_0x122597[_0x1940ef][_0xf528('0x27')]][_0xf528('0x23')]('/')[0x2];_0x7c24b1['prefix']=_0x7c24b1[_0xf528('0x28')]?_0x7c24b1[_0xf528('0x28')][_0xf528('0x23')]('$')[0x0]:undefined;_0x7c24b1[_0xf528('0x28')]=_0x143849['cutdigits']?(_0x7c24b1[_0xf528('0x29')]||'')+'${EXTEN:'+_0x143849[_0xf528('0x15')]+'}':(_0x7c24b1[_0xf528('0x29')]||'')+_0xf528('0x17');_0x228eea[_0x122597[_0x1940ef][_0xf528('0x27')]]=['SIP',_0x7c24b1[_0xf528('0x26')],_0x7c24b1[_0xf528('0x28')]][_0xf528('0x2a')]('/');break;case'options':_0x7c24b1[_0xf528('0x21')]=_0x67e6da[_0x122597[_0x1940ef]['param']];if(_0x143849[_0xf528('0x1e')]!==_0xf528('0x1f')){if(_0x7c24b1[_0xf528('0x21')][_0xf528('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x7c24b1[_0xf528('0x21')]+=_0xf528('0x2c');}}else{_0x7c24b1['options']=_0x7c24b1[_0xf528('0x21')][_0xf528('0x2d')]('U(xcally-mixmonitor-context)','');}_0x228eea[_0x122597[_0x1940ef][_0xf528('0x27')]]=_0x7c24b1[_0xf528('0x21')];break;default:_0x228eea[_0x122597[_0x1940ef]['param']]=_0x67e6da[_0x122597[_0x1940ef][_0xf528('0x27')]];}}return _0x228eea[_0xf528('0x2a')](',');}function _0x493f5e(_0x4d3ed3,_0x1188b9,_0x2cb7ac){return new Promise(function(_0xb1bbe2,_0x201b90){var _0x80897b=[];if(_[_0xf528('0x2e')](_0x1188b9))return _0xb1bbe2(_0x80897b);_0x42142d['Interval'][_0xf528('0x2f')]({'attributes':['id',_0xf528('0x30'),'IntervalId'],'raw':!![]})[_0xf528('0x31')](function(_0x21cbec){for(var _0x76f9c5=0x0,_0x47a3ff=0x0;_0x76f9c5<_0x1188b9['length'];_0x76f9c5++,_0x47a3ff=0x0){var _0x22d410=_0x1188b9[_0x76f9c5];var _0x55f25d=[];var _0x24b720=[];delete _0x22d410['id'];if(_0x22d410[_0xf528('0x30')]!=='*,*,*,*'){_0x22d410[_0xf528('0x32')]=[_0x22d410[_0xf528('0x30')]];}else{_0x22d410[_0xf528('0x32')]=_0x22d410[_0xf528('0x33')]?_[_0xf528('0x34')](_[_0xf528('0x35')](_0x21cbec,{'IntervalId':_0x22d410[_0xf528('0x33')]}),'interval'):[];}_0x22d410[_0xf528('0xd')]=_0x4d3ed3[_0xf528('0xd')];_0x22d410[_0xf528('0x5')]=_0x4d3ed3[_0xf528('0x5')];if(_0x22d410[_0xf528('0x3')])_0x22d410[_0xf528('0x3')]=_0x22d410[_0xf528('0x3')]['toLowerCase']();if(_0x4d3ed3['type']===_0xf528('0x11')){if(_0x22d410[_0xf528('0x1d')]('tag')&&_0x22d410[_0xf528('0x36')]&&_0x22d410[_0xf528('0x36')]!=='--'){_0x55f25d[_0xf528('0xa')]({'type':_0x22d410[_0xf528('0x3')][_0xf528('0x37')](),'app':_0xf528('0x7'),'appdata':_0xf528('0x38')+_0x22d410[_0xf528('0x36')],'context':_0x4d3ed3[_0xf528('0xd')],'exten':_0x4d3ed3[_0xf528('0x5')],'priority':_0x22d410[_0xf528('0x32')][_0xf528('0x24')]+_0x2cb7ac+_0x47a3ff++,'VoiceExtensionId':_0x4d3ed3['id']});}_0x55f25d[_0xf528('0xa')]({'type':_0x22d410[_0xf528('0x3')][_0xf528('0x37')](),'app':'ExecIf','appdata':_0xf528('0x39')+(_0x22d410[_0xf528('0x3a')]?_0xf528('0x3b')+_0x22d410[_0xf528('0x3a')]+')':_0xf528('0x3c')),'context':_0x4d3ed3[_0xf528('0xd')],'exten':_0x4d3ed3[_0xf528('0x5')],'priority':_0x22d410[_0xf528('0x32')][_0xf528('0x24')]+_0x2cb7ac+_0x47a3ff++,'VoiceExtensionId':_0x4d3ed3['id']});}else{if(_0x22d410[_0xf528('0x1d')](_0xf528('0x3d'))){if(['queue',_0xf528('0x3e')][_0xf528('0x3f')](_0x22d410[_0xf528('0x40')][_0xf528('0x37')]())&&_0x22d410[_0xf528('0x41')]!=='custom'){if(_0x22d410['answer']){_0x55f25d[_0xf528('0xa')]({'type':_0x22d410[_0xf528('0x3')][_0xf528('0x37')](),'app':_0xf528('0x18'),'appdata':_0xf528('0x42'),'context':_0x4d3ed3[_0xf528('0xd')],'exten':_0x4d3ed3[_0xf528('0x5')],'priority':_0x22d410[_0xf528('0x32')]['length']+_0x2cb7ac+_0x47a3ff++,'VoiceExtensionId':_0x4d3ed3['id']});_0x55f25d[_0xf528('0xa')]({'type':_0x22d410[_0xf528('0x3')][_0xf528('0x37')](),'app':'Set','appdata':_0xf528('0x43'),'context':_0x4d3ed3[_0xf528('0xd')],'exten':_0x4d3ed3[_0xf528('0x5')],'priority':_0x22d410[_0xf528('0x32')][_0xf528('0x24')]+_0x2cb7ac+_0x47a3ff++,'VoiceExtensionId':_0x4d3ed3['id']});}else{_0x55f25d[_0xf528('0xa')]({'type':_0x22d410['type'][_0xf528('0x37')](),'app':_0xf528('0x18'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4d3ed3[_0xf528('0xd')],'exten':_0x4d3ed3[_0xf528('0x5')],'priority':_0x22d410[_0xf528('0x32')]['length']+_0x2cb7ac+_0x47a3ff++,'VoiceExtensionId':_0x4d3ed3['id']});_0x55f25d[_0xf528('0xa')]({'type':_0x22d410['type'][_0xf528('0x37')](),'app':_0xf528('0x7'),'appdata':_0xf528('0x44'),'context':_0x4d3ed3[_0xf528('0xd')],'exten':_0x4d3ed3[_0xf528('0x5')],'priority':_0x22d410[_0xf528('0x32')]['length']+_0x2cb7ac+_0x47a3ff++,'VoiceExtensionId':_0x4d3ed3['id']});}}}}for(var _0xfd78ce=0x0;_0xfd78ce<_0x22d410[_0xf528('0x32')][_0xf528('0x24')];_0xfd78ce++){var _0x563d10=_0x2cb7ac+_0x22d410[_0xf528('0x32')][_0xf528('0x24')];var _0xb3922d=_0xfd78ce===_0x22d410[_0xf528('0x32')][_0xf528('0x24')]-0x1?_0x2cb7ac+_0x55f25d['length']+_0x24b720[_0xf528('0x24')]+0x2:_0x2cb7ac+_0xfd78ce+0x1;_0x55f25d[_0xf528('0x45')](_0xfd78ce,0x0,{'type':_0x4d3ed3[_0xf528('0x3')],'app':_0xf528('0x46'),'appdata':_0x22d410[_0xf528('0x32')][_0xfd78ce]+'?'+_0x4d3ed3['context']+_0xf528('0x47')+_0x563d10+':'+_0x4d3ed3['context']+_0xf528('0x47')+_0xb3922d,'exten':_0x4d3ed3[_0xf528('0x5')],'context':_0x4d3ed3[_0xf528('0xd')],'priority':_0x2cb7ac+_0xfd78ce,'VoiceExtensionId':_0x4d3ed3['id']});}if(_0x22d410[_0xf528('0x41')]===_0xf528('0x48'))_0x22d410[_0xf528('0x49')]=_0x1a9849(_0x4d3ed3,_0x22d410[_0xf528('0x49')]);_0x22d410['priority']=_0x55f25d['length']?_[_0xf528('0x4a')](_0x55f25d)[_0xf528('0x4b')]+0x1:_0x2cb7ac;_0x80897b=_['concat'](_0x80897b,_0x55f25d,[_0x22d410],_0x24b720);_0x2cb7ac=_['last'](_0x80897b)[_0xf528('0x4b')]+0x1;}return _0xb1bbe2(_0x80897b);})['catch'](function(_0x4fae01){_0x201b90(_0x4fae01);});});}return _0x303dad[_0xf528('0x4c')]('VoiceExtension',attributes,{'tableName':_0xf528('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x357573){var _0x39b8ba=this['get']({'plain':!![]});var _0x5bd9ae=_0x39b8ba[_0xf528('0x3')]===_0xf528('0x11')?_0x2712f9(_0x39b8ba):_0x5a32b9(_0x39b8ba);return _0x493f5e(_0x39b8ba,_0x357573,_[_0xf528('0x4a')](_0x5bd9ae)['priority']+0x1)[_0xf528('0x31')](function(_0x52d36a){var _0x1234b9=_[_0xf528('0x4e')](_0x5bd9ae,_0x52d36a);_0x1234b9[_0xf528('0xa')]({'type':_0x39b8ba[_0xf528('0x3')],'app':_0xf528('0x4f'),'exten':_0x39b8ba[_0xf528('0x5')],'context':_0x39b8ba['context'],'priority':_['last'](_0x1234b9)[_0xf528('0x4b')]+0x1,'VoiceExtensionId':_0x39b8ba['id']});return _0x1234b9;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 49e86d5..6f2cb5e 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 _0x04e7=['raw','where','attributes','limit','include','map','model','GetVoiceExtension','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceExtension','options'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x04e7,0x121));var _0x704e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x04e7[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x704e('0x0'));var util=require(_0x704e('0x1'));var moment=require(_0x704e('0x2'));var BPromise=require(_0x704e('0x3'));var rs=require(_0x704e('0x4'));var fs=require('fs');var Redis=require(_0x704e('0x5'));var db=require(_0x704e('0x6'))['db'];var utils=require(_0x704e('0x7'));var logger=require(_0x704e('0x8'))(_0x704e('0x9'));var config=require(_0x704e('0xa'));var jayson=require(_0x704e('0xb'));var client=jayson['client'][_0x704e('0xc')]({'port':0x232a});config[_0x704e('0xd')]=_[_0x704e('0xe')](config[_0x704e('0xd')],{'host':_0x704e('0xf'),'port':0x18eb});var socket=require(_0x704e('0x10'))(new Redis(config[_0x704e('0xd')]));require(_0x704e('0x11'))[_0x704e('0x12')](socket);function respondWithRpcPromise(_0xc0d178,_0x1a2f74,_0x458537){return new BPromise(function(_0x48dc9b,_0x3c80dd){return client[_0x704e('0x13')](_0xc0d178,_0x458537)[_0x704e('0x14')](function(_0x42c150){logger[_0x704e('0x15')](_0x704e('0x16'),_0x1a2f74,_0x704e('0x17'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x1a2f74,_0x704e('0x17'),JSON[_0x704e('0x18')](_0x42c150));if(_0x42c150[_0x704e('0x19')]){if(_0x42c150[_0x704e('0x19')][_0x704e('0x1a')]===0x1f4){logger[_0x704e('0x19')](_0x704e('0x16'),_0x1a2f74,_0x42c150[_0x704e('0x19')]['message']);return _0x3c80dd(_0x42c150[_0x704e('0x19')][_0x704e('0x1b')]);}logger[_0x704e('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x1a2f74,_0x42c150[_0x704e('0x19')][_0x704e('0x1b')]);return _0x48dc9b(_0x42c150[_0x704e('0x19')]['message']);}else{logger[_0x704e('0x15')](_0x704e('0x16'),_0x1a2f74,_0x704e('0x17'));_0x48dc9b(_0x42c150[_0x704e('0x1c')][_0x704e('0x1b')]);}})['catch'](function(_0x333524){logger['error'](_0x704e('0x16'),_0x1a2f74,_0x333524);_0x3c80dd(_0x333524);});});}exports['GetVoiceExtension']=function(_0x5e0542){var _0x5bd786=this;return new Promise(function(_0x295d5a,_0x361cb7){return db[_0x704e('0x1d')]['findAll']({'raw':_0x5e0542['options']?_0x5e0542[_0x704e('0x1e')][_0x704e('0x1f')]===undefined?!![]:![]:!![],'where':_0x5e0542[_0x704e('0x1e')]?_0x5e0542[_0x704e('0x1e')][_0x704e('0x20')]||null:null,'attributes':_0x5e0542[_0x704e('0x1e')]?_0x5e0542[_0x704e('0x1e')][_0x704e('0x21')]||null:null,'limit':_0x5e0542[_0x704e('0x1e')]?_0x5e0542[_0x704e('0x1e')][_0x704e('0x22')]||null:null,'include':_0x5e0542['options']?_0x5e0542['options'][_0x704e('0x23')]?_[_0x704e('0x24')](_0x5e0542[_0x704e('0x1e')][_0x704e('0x23')],function(_0x36b851){return{'model':db[_0x36b851[_0x704e('0x25')]],'as':_0x36b851['as'],'attributes':_0x36b851[_0x704e('0x21')],'include':_0x36b851[_0x704e('0x23')]?_['map'](_0x36b851[_0x704e('0x23')],function(_0x31acdc){return{'model':db[_0x31acdc[_0x704e('0x25')]],'as':_0x31acdc['as'],'attributes':_0x31acdc['attributes'],'include':_0x31acdc[_0x704e('0x23')]?_['map'](_0x31acdc[_0x704e('0x23')],function(_0x123e61){return{'model':db[_0x123e61[_0x704e('0x25')]],'as':_0x123e61['as'],'attributes':_0x123e61[_0x704e('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56573a){logger[_0x704e('0x15')]('GetVoiceExtension',_0x5e0542);logger['debug'](_0x704e('0x26'),_0x5e0542,JSON[_0x704e('0x18')](_0x56573a));_0x295d5a(_0x56573a);})[_0x704e('0x27')](function(_0x3b430c){logger[_0x704e('0x19')]('GetVoiceExtension',_0x3b430c['message'],_0x5e0542);_0x361cb7(_0x5bd786[_0x704e('0x19')](0x1f4,_0x3b430c['message']));});});}; \ No newline at end of file +var _0x5024=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','options','where','attributes','limit','map','include','model','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x5c93aa,_0x129d04){var _0xa5e311=function(_0x517237){while(--_0x517237){_0x5c93aa['push'](_0x5c93aa['shift']());}};_0xa5e311(++_0x129d04);}(_0x5024,0xf7));var _0x4502=function(_0xaf9828,_0x3670be){_0xaf9828=_0xaf9828-0x0;var _0x55e448=_0x5024[_0xaf9828];return _0x55e448;};'use strict';var _=require(_0x4502('0x0'));var util=require(_0x4502('0x1'));var moment=require(_0x4502('0x2'));var BPromise=require(_0x4502('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4502('0x4'));var db=require(_0x4502('0x5'))['db'];var utils=require(_0x4502('0x6'));var logger=require(_0x4502('0x7'))(_0x4502('0x8'));var config=require(_0x4502('0x9'));var jayson=require(_0x4502('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x4502('0xb')]=_['defaults'](config[_0x4502('0xb')],{'host':_0x4502('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4502('0xd'))[_0x4502('0xe')](socket);function respondWithRpcPromise(_0x5e3297,_0x391152,_0x19ae0c){return new BPromise(function(_0x4ae910,_0x367b85){return client[_0x4502('0xf')](_0x5e3297,_0x19ae0c)[_0x4502('0x10')](function(_0x16236b){logger[_0x4502('0x11')](_0x4502('0x12'),_0x391152,'request\x20sent');logger[_0x4502('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x391152,_0x4502('0x14'),JSON[_0x4502('0x15')](_0x16236b));if(_0x16236b['error']){if(_0x16236b[_0x4502('0x16')][_0x4502('0x17')]===0x1f4){logger[_0x4502('0x16')](_0x4502('0x12'),_0x391152,_0x16236b[_0x4502('0x16')][_0x4502('0x18')]);return _0x367b85(_0x16236b['error'][_0x4502('0x18')]);}logger[_0x4502('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x391152,_0x16236b[_0x4502('0x16')][_0x4502('0x18')]);return _0x4ae910(_0x16236b[_0x4502('0x16')][_0x4502('0x18')]);}else{logger['info'](_0x4502('0x12'),_0x391152,_0x4502('0x14'));_0x4ae910(_0x16236b[_0x4502('0x19')]['message']);}})['catch'](function(_0x1217a4){logger[_0x4502('0x16')](_0x4502('0x12'),_0x391152,_0x1217a4);_0x367b85(_0x1217a4);});});}exports[_0x4502('0x1a')]=function(_0x8ecd0b){var _0x4ae9e8=this;return new Promise(function(_0x5616c6,_0x80f964){return db[_0x4502('0x1b')]['findAll']({'raw':_0x8ecd0b['options']?_0x8ecd0b[_0x4502('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x8ecd0b[_0x4502('0x1c')]?_0x8ecd0b[_0x4502('0x1c')][_0x4502('0x1d')]||null:null,'attributes':_0x8ecd0b[_0x4502('0x1c')]?_0x8ecd0b[_0x4502('0x1c')][_0x4502('0x1e')]||null:null,'limit':_0x8ecd0b[_0x4502('0x1c')]?_0x8ecd0b[_0x4502('0x1c')][_0x4502('0x1f')]||null:null,'include':_0x8ecd0b[_0x4502('0x1c')]?_0x8ecd0b[_0x4502('0x1c')]['include']?_[_0x4502('0x20')](_0x8ecd0b[_0x4502('0x1c')][_0x4502('0x21')],function(_0x46a560){return{'model':db[_0x46a560[_0x4502('0x22')]],'as':_0x46a560['as'],'attributes':_0x46a560[_0x4502('0x1e')],'include':_0x46a560[_0x4502('0x21')]?_[_0x4502('0x20')](_0x46a560[_0x4502('0x21')],function(_0xeb30d3){return{'model':db[_0xeb30d3[_0x4502('0x22')]],'as':_0xeb30d3['as'],'attributes':_0xeb30d3[_0x4502('0x1e')],'include':_0xeb30d3[_0x4502('0x21')]?_[_0x4502('0x20')](_0xeb30d3['include'],function(_0x4bcb5f){return{'model':db[_0x4bcb5f[_0x4502('0x22')]],'as':_0x4bcb5f['as'],'attributes':_0x4bcb5f[_0x4502('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4502('0x10')](function(_0x54597c){logger[_0x4502('0x11')](_0x4502('0x1a'),_0x8ecd0b);logger[_0x4502('0x13')]('GetVoiceExtension',_0x8ecd0b,JSON[_0x4502('0x15')](_0x54597c));_0x5616c6(_0x54597c);})[_0x4502('0x23')](function(_0x3f212b){logger[_0x4502('0x16')](_0x4502('0x1a'),_0x3f212b[_0x4502('0x18')],_0x8ecd0b);_0x80f964(_0x4ae9e8[_0x4502('0x16')](0x1f4,_0x3f212b[_0x4502('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 917622b..e76bec0 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x49554d,_0x2f57a8){var _0x2ead18=function(_0x343f82){while(--_0x343f82){_0x49554d['push'](_0x49554d['shift']());}};_0x2ead18(++_0x2f57a8);}(_0xe14b,0x93));var _0xbe14=function(_0x3f8f58,_0x549f2d){_0x3f8f58=_0x3f8f58-0x0;var _0x2665bb=_0xe14b[_0x3f8f58];return _0x2665bb;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x814b,0x1a2));var _0xb814=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0x814b[_0x55fa03];return _0x2cd7cd;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 3eb2475..d719687 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 _0xb016=['get','isAuthenticated','index','show','getMessages','post','create','update','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29d87d,_0x23dc31){var _0x1fd84b=function(_0x4e2aa1){while(--_0x4e2aa1){_0x29d87d['push'](_0x29d87d['shift']());}};_0x1fd84b(++_0x23dc31);}(_0xb016,0x159));var _0x6b01=function(_0x42c780,_0x59ee71){_0x42c780=_0x42c780-0x0;var _0x4182d4=_0xb016[_0x42c780];return _0x4182d4;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./voiceMail.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id/messages',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0xd')]);router['put']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/:id',auth[_0x6b01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd046=['get','show','getMessages','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMail.controller','index'];(function(_0x33d9c0,_0x9f9a2f){var _0x1b4de9=function(_0x15e496){while(--_0x15e496){_0x33d9c0['push'](_0x33d9c0['shift']());}};_0x1b4de9(++_0x9f9a2f);}(_0xd046,0x129));var _0x6d04=function(_0x1bcb69,_0x2aa047){_0x1bcb69=_0x1bcb69-0x0;var _0xbcc0b7=_0xd046[_0x1bcb69];return _0xbcc0b7;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['post']('/',auth[_0x6d04('0xa')](),controller['create']);router['put']('/:id',auth[_0x6d04('0xa')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')](_0x6d04('0xd'),auth['isAuthenticated'](),controller[_0x6d04('0xe')]);module[_0x6d04('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index ebf308e..ec57191 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 _0x7cba=['TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','string','trim','ENUM','yes','TINYINT(4)'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7cba,0x126));var _0xa7cb=function(_0x114d32,_0x5521ab){_0x114d32=_0x114d32-0x0;var _0x42288f=_0x7cba[_0x114d32];return _0x42288f;};'use strict';var Sequelize=require(_0xa7cb('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa7cb('0x1')],'defaultValue':_0xa7cb('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xa7cb('0x1')],'defaultValue':'','allowNull':![],'unique':_0xa7cb('0x3')},'password':{'type':Sequelize[_0xa7cb('0x1')]},'fullname':{'type':Sequelize[_0xa7cb('0x1')]},'email':{'type':Sequelize[_0xa7cb('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5b400b){this['setDataValue'](_0xa7cb('0x4'),typeof _0x5b400b===_0xa7cb('0x5')&&_0x5b400b[_0xa7cb('0x6')]()?_0x5b400b[_0xa7cb('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xa7cb('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xa7cb('0x7')](_0xa7cb('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xa7cb('0x8'),'no'),'defaultValue':_0xa7cb('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xa7cb('0x1')]},'callback':{'type':Sequelize[_0xa7cb('0x1')]},'review':{'type':Sequelize[_0xa7cb('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xa7cb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xa7cb('0x7')](_0xa7cb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xa7cb('0x7')](_0xa7cb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xa7cb('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xa7cb('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xa7cb('0x7')](_0xa7cb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xa7cb('0x8'),'no'),'defaultValue':_0xa7cb('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xa7cb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xa7cb('0x7')](_0xa7cb('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xa7cb('0x7')](_0xa7cb('0x8'),'no'),'defaultValue':_0xa7cb('0x8'),'allowNull':![]},'stamp':{'type':_0xa7cb('0xa')},'emailsubject':{'type':Sequelize[_0xa7cb('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xa7cb('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa7cb('0xc')](_0xa7cb('0xd'))+_0xa7cb('0xe')+this[_0xa7cb('0xc')](_0xa7cb('0xf'));}}}; \ No newline at end of file +var _0x91fb=['VIRTUAL','getDataValue','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x29c3a0,_0x32be87){var _0x430f8a=function(_0x4143d9){while(--_0x4143d9){_0x29c3a0['push'](_0x29c3a0['shift']());}};_0x430f8a(++_0x32be87);}(_0x91fb,0x9b));var _0xb91f=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0x91fb[_0x25a42a];return _0x1129b1;};'use strict';var Sequelize=require(_0xb91f('0x0'));module[_0xb91f('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb91f('0x2')],'defaultValue':_0xb91f('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xb91f('0x2')],'defaultValue':'','allowNull':![],'unique':_0xb91f('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xb91f('0x2')]},'email':{'type':Sequelize[_0xb91f('0x2')],'validate':{'isEmail':!![]},'set':function(_0xe26684){this[_0xb91f('0x5')](_0xb91f('0x6'),typeof _0xe26684===_0xb91f('0x7')&&_0xe26684[_0xb91f('0x8')]()?_0xe26684[_0xb91f('0x8')]():null);}},'pager':{'type':Sequelize[_0xb91f('0x2')]},'tz':{'type':Sequelize[_0xb91f('0x2')],'defaultValue':_0xb91f('0x9')},'attach':{'type':Sequelize[_0xb91f('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xb91f('0xa')](_0xb91f('0xb'),'no'),'defaultValue':_0xb91f('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xb91f('0x2')]},'callback':{'type':Sequelize[_0xb91f('0x2')]},'review':{'type':Sequelize[_0xb91f('0xa')](_0xb91f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xb91f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xb91f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xb91f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xb91f('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xb91f('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xb91f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xb91f('0xa')](_0xb91f('0xb'),'no'),'defaultValue':_0xb91f('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0xb91f('0xa')](_0xb91f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xb91f('0xa')](_0xb91f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xb91f('0xa')]('yes','no'),'defaultValue':_0xb91f('0xb'),'allowNull':![]},'stamp':{'type':_0xb91f('0xd')},'emailsubject':{'type':Sequelize[_0xb91f('0x2')]},'emailbody':{'type':Sequelize[_0xb91f('0x2')]},'maxsecs':{'type':Sequelize[_0xb91f('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xb91f('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xb91f('0xf')],'get':function(){return this[_0xb91f('0x10')]('fullname')+'\x20-\x20'+this[_0xb91f('0x10')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 73454bf..a73bef9 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 _0x96cc=['find','userProfileId','UserProfileResource','getMessages','findOne','mailbox','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Voicemails','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x96cc,0x16c));var _0xc96c=function(_0x51361c,_0x3ac7f6){_0x51361c=_0x51361c-0x0;var _0xafa94b=_0x96cc[_0x51361c];return _0xafa94b;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc96c('0x2'));var moment=require(_0xc96c('0x3'));var BPromise=require(_0xc96c('0x4'));var Mustache=require(_0xc96c('0x5'));var util=require(_0xc96c('0x6'));var path=require(_0xc96c('0x7'));var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require(_0xc96c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];function respondWithStatusCode(_0x246a95,_0x5f27f3){_0x5f27f3=_0x5f27f3||0xcc;return function(_0x3fe3d5){if(_0x3fe3d5){return _0x246a95[_0xc96c('0x19')](_0x5f27f3);}return _0x246a95[_0xc96c('0x1a')](_0x5f27f3)[_0xc96c('0x1b')]();};}function respondWithResult(_0x48de8d,_0x35da94){_0x35da94=_0x35da94||0xc8;return function(_0xbed0c9){if(_0xbed0c9){return _0x48de8d[_0xc96c('0x1a')](_0x35da94)[_0xc96c('0x1c')](_0xbed0c9);}};}function respondWithFilteredResult(_0x377dbc,_0x46455a){return function(_0x1765d9){if(_0x1765d9){var _0x23e357=typeof _0x46455a[_0xc96c('0x1d')]===_0xc96c('0x1e')&&typeof _0x46455a[_0xc96c('0x1f')]==='undefined';var _0x509376=_0x1765d9[_0xc96c('0x20')];var _0x99c402=_0x23e357?0x0:_0x46455a[_0xc96c('0x1d')];var _0x2ae19a=_0x23e357?_0x1765d9['count']:_0x46455a[_0xc96c('0x1d')]+_0x46455a[_0xc96c('0x1f')];var _0x2a361c;if(_0x2ae19a>=_0x509376){_0x2ae19a=_0x509376;_0x2a361c=0xc8;}else{_0x2a361c=0xce;}_0x377dbc[_0xc96c('0x1a')](_0x2a361c);return _0x377dbc[_0xc96c('0x21')](_0xc96c('0x22'),_0x99c402+'-'+_0x2ae19a+'/'+_0x509376)[_0xc96c('0x1c')](_0x1765d9);}return null;};}function patchUpdates(_0x41daba){return function(_0x28d762){try{jsonpatch[_0xc96c('0x23')](_0x28d762,_0x41daba,!![]);}catch(_0x2bb397){return BPromise[_0xc96c('0x24')](_0x2bb397);}return _0x28d762[_0xc96c('0x25')]();};}function saveUpdates(_0x45edee,_0x325c54){return function(_0x3b5c6c){if(_0x3b5c6c){return _0x3b5c6c[_0xc96c('0x26')](_0x45edee)['then'](function(_0xd63951){return _0xd63951;});}return null;};}function removeEntity(_0x4be783,_0x4456bf){return function(_0x10ae21){if(_0x10ae21){return _0x10ae21[_0xc96c('0x27')]()[_0xc96c('0x28')](function(){var _0x40f23d=_0x10ae21[_0xc96c('0x29')]({'plain':!![]});var _0x1a77df=_0xc96c('0x2a');return db['UserProfileResource'][_0xc96c('0x27')]({'where':{'type':_0x1a77df,'resourceId':_0x40f23d['id']}})[_0xc96c('0x28')](function(){return _0x10ae21;});})[_0xc96c('0x28')](function(){_0x4be783[_0xc96c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c00b6,_0x39c191){return function(_0x12c293){if(!_0x12c293){_0x5c00b6[_0xc96c('0x19')](0x194);}return _0x12c293;};}function handleError(_0x1ef845,_0x3c0eb1){_0x3c0eb1=_0x3c0eb1||0x1f4;return function(_0x5e1727){logger[_0xc96c('0x2b')](_0x5e1727[_0xc96c('0x2c')]);if(_0x5e1727[_0xc96c('0x2d')]){delete _0x5e1727[_0xc96c('0x2d')];}_0x1ef845[_0xc96c('0x1a')](_0x3c0eb1)[_0xc96c('0x2e')](_0x5e1727);};}exports[_0xc96c('0x2f')]=function(_0x328ee4,_0x556108){var _0x3aa436={},_0x53c994={},_0x3f4b0e={'count':0x0,'rows':[]};var _0x442c7f=_[_0xc96c('0x30')](db['VoiceMail'][_0xc96c('0x31')],function(_0x3240ba){return{'name':_0x3240ba[_0xc96c('0x32')],'type':_0x3240ba[_0xc96c('0x33')]['key']};});_0x53c994['model']=_[_0xc96c('0x30')](_0x442c7f,_0xc96c('0x2d'));_0x53c994[_0xc96c('0x34')]=_['keys'](_0x328ee4[_0xc96c('0x34')]);_0x53c994[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x53c994[_0xc96c('0x37')],_0x53c994['query']);_0x3aa436[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x53c994['model'],qs[_0xc96c('0x39')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x39')]));_0x3aa436[_0xc96c('0x38')]=_0x3aa436[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x3aa436['attributes']:_0x53c994[_0xc96c('0x37')];if(!_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x3aa436[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x328ee4['query']['limit']);_0x3aa436[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x328ee4['query']['offset']);}_0x3aa436[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3e')]);_0x3aa436[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x328ee4[_0xc96c('0x34')],_0x53c994[_0xc96c('0x35')]),_0x442c7f);if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x41')]){_0x3aa436['where']=_[_0xc96c('0x42')](_0x3aa436[_0xc96c('0x3f')],{'$or':_[_0xc96c('0x30')](_0x442c7f,function(_0x16b1f1){if(_0x16b1f1['type']!==_0xc96c('0x43')){var _0x3a0848={};_0x3a0848[_0x16b1f1[_0xc96c('0x2d')]]={'$like':'%'+_0x328ee4['query']['filter']+'%'};return _0x3a0848;}})});}_0x3aa436=_[_0xc96c('0x42')]({},_0x3aa436,_0x328ee4[_0xc96c('0x44')]);var _0x2e3bc3={'where':_0x3aa436['where']};return db[_0xc96c('0x45')][_0xc96c('0x20')](_0x2e3bc3)[_0xc96c('0x28')](function(_0x2a8ea7){_0x3f4b0e[_0xc96c('0x20')]=_0x2a8ea7;if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x46')]){_0x3aa436[_0xc96c('0x47')]=[{'all':!![]}];}return db[_0xc96c('0x45')]['findAll'](_0x3aa436);})['then'](function(_0x30b3ac){_0x3f4b0e[_0xc96c('0x48')]=_0x30b3ac;return _0x3f4b0e;})[_0xc96c('0x28')](respondWithFilteredResult(_0x556108,_0x3aa436))[_0xc96c('0x49')](handleError(_0x556108,null));};exports['show']=function(_0x5ee6ac,_0x14b712){var _0x1c18c1={'raw':!![],'where':{'id':_0x5ee6ac[_0xc96c('0x4a')]['id']}},_0x44eb20={};_0x44eb20[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db[_0xc96c('0x45')]['rawAttributes']);_0x44eb20[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x5ee6ac[_0xc96c('0x34')]);_0x44eb20[_0xc96c('0x35')]=_['intersection'](_0x44eb20['model'],_0x44eb20[_0xc96c('0x34')]);_0x1c18c1[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x44eb20[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x5ee6ac[_0xc96c('0x34')][_0xc96c('0x39')]));_0x1c18c1[_0xc96c('0x38')]=_0x1c18c1[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x1c18c1[_0xc96c('0x38')]:_0x44eb20[_0xc96c('0x37')];if(_0x5ee6ac[_0xc96c('0x34')]['includeAll']){_0x1c18c1[_0xc96c('0x47')]=[{'all':!![]}];}_0x1c18c1=_[_0xc96c('0x42')]({},_0x1c18c1,_0x5ee6ac[_0xc96c('0x44')]);return db[_0xc96c('0x45')]['find'](_0x1c18c1)[_0xc96c('0x28')](handleEntityNotFound(_0x14b712,null))['then'](respondWithResult(_0x14b712,null))[_0xc96c('0x49')](handleError(_0x14b712,null));};exports[_0xc96c('0x4c')]=function(_0x565812,_0x2581ae){return db[_0xc96c('0x45')][_0xc96c('0x4c')](_0x565812[_0xc96c('0x4d')],{})[_0xc96c('0x28')](function(_0x1bd694){var _0x57e699=_0x565812['user']['get']({'plain':!![]});if(!_0x57e699)throw new Error(_0xc96c('0x4e'));if(_0x57e699['role']===_0xc96c('0x4f')){var _0x22b2e3=_0x1bd694[_0xc96c('0x29')]({'plain':!![]});var _0x17c764=_0xc96c('0x2a');return db[_0xc96c('0x50')][_0xc96c('0x51')]({'where':{'name':_0x17c764,'userProfileId':_0x57e699[_0xc96c('0x52')]},'raw':!![]})[_0xc96c('0x28')](function(_0xd78e10){if(_0xd78e10&&_0xd78e10['autoAssociation']===0x0){return db[_0xc96c('0x53')][_0xc96c('0x4c')]({'name':_0x22b2e3[_0xc96c('0x2d')],'resourceId':_0x22b2e3['id'],'type':_0xd78e10[_0xc96c('0x2d')],'sectionId':_0xd78e10['id']},{})[_0xc96c('0x28')](function(){return _0x1bd694;});}else{return _0x1bd694;}})[_0xc96c('0x49')](function(_0xad88c3){logger[_0xc96c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad88c3);throw _0xad88c3;});}return _0x1bd694;})['then'](respondWithResult(_0x2581ae,0xc9))['catch'](handleError(_0x2581ae,null));};exports['update']=function(_0x356ef3,_0x46c6fb){if(_0x356ef3[_0xc96c('0x4d')]['id']){delete _0x356ef3[_0xc96c('0x4d')]['id'];}return db[_0xc96c('0x45')][_0xc96c('0x51')]({'where':{'id':_0x356ef3[_0xc96c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46c6fb,null))[_0xc96c('0x28')](saveUpdates(_0x356ef3[_0xc96c('0x4d')],null))[_0xc96c('0x28')](respondWithResult(_0x46c6fb,null))[_0xc96c('0x49')](handleError(_0x46c6fb,null));};exports[_0xc96c('0x27')]=function(_0x1dbea5,_0x3aa216){return db['VoiceMail'][_0xc96c('0x51')]({'where':{'id':_0x1dbea5[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x3aa216,null))[_0xc96c('0x28')](removeEntity(_0x3aa216,null))[_0xc96c('0x49')](handleError(_0x3aa216,null));};exports[_0xc96c('0x54')]=function(_0x258f79,_0x34bb98,_0x10b1b8){return db[_0xc96c('0x45')][_0xc96c('0x55')]({'where':{'id':_0x258f79[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x34bb98,null))[_0xc96c('0x28')](function(_0x5a6e3e){var _0xb1629c;var _0x183211={},_0x3d879a={};_0x3d879a[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db['VoiceMailMessage'][_0xc96c('0x31')]);_0x3d879a[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x258f79[_0xc96c('0x34')]);_0x3d879a['filters']=_[_0xc96c('0x36')](_0x3d879a[_0xc96c('0x37')],_0x3d879a['query']);_0x183211['attributes']=_['intersection'](_0x3d879a[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x258f79[_0xc96c('0x34')][_0xc96c('0x39')]));_0x183211[_0xc96c('0x38')]=_0x183211['attributes']['length']?_0x183211[_0xc96c('0x38')]:_0x3d879a[_0xc96c('0x37')];if(!_0x258f79[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x183211['limit']=qs[_0xc96c('0x1f')](_0x258f79[_0xc96c('0x34')][_0xc96c('0x1f')]);_0x183211[_0xc96c('0x1d')]=qs['offset'](_0x258f79['query'][_0xc96c('0x1d')]);}_0x183211[_0xc96c('0x3d')]=qs['sort'](_0x258f79[_0xc96c('0x34')]['sort']);_0x183211[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x258f79[_0xc96c('0x34')],_0x3d879a[_0xc96c('0x35')]));if(_0x258f79[_0xc96c('0x34')][_0xc96c('0x41')]){_0x183211[_0xc96c('0x3f')]=_[_0xc96c('0x42')](_0x183211[_0xc96c('0x3f')],{'$or':_['map'](_0x183211[_0xc96c('0x38')],function(_0x5e94fa){var _0xe34ef={};_0xe34ef[_0x5e94fa]={'$like':'%'+_0x258f79[_0xc96c('0x34')]['filter']+'%'};return _0xe34ef;})});}_0x183211[_0xc96c('0x3f')]=_['merge'](_0x183211[_0xc96c('0x3f')],{'mailboxuser':_0x5a6e3e[_0xc96c('0x56')]});_0x183211=_[_0xc96c('0x42')]({},_0x183211,_0x258f79[_0xc96c('0x44')]);return db[_0xc96c('0x57')][_0xc96c('0x58')](_0x183211)[_0xc96c('0x28')](respondWithFilteredResult(_0x34bb98,_0x183211));})[_0xc96c('0x49')](handleError(_0x34bb98,null));}; \ No newline at end of file +var _0x1339=['../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','get','Voicemails','UserProfileResource','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VoiceMail','count','includeAll','include','findAll','catch','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','VoiceMailMessage','pick','findAndCountAll','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'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1339,0x1ed));var _0x9133=function(_0x2fb3d7,_0x363767){_0x2fb3d7=_0x2fb3d7-0x0;var _0xfafe56=_0x1339[_0x2fb3d7];return _0xfafe56;};'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(){var _0x187e32=_0x4f26e8[_0x9133('0x22')]({'plain':!![]});var _0x3f278d=_0x9133('0x23');return db[_0x9133('0x24')][_0x9133('0x21')]({'where':{'type':_0x3f278d,'resourceId':_0x187e32['id']}})[_0x9133('0x20')](function(){return _0x4f26e8;});})[_0x9133('0x20')](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x25')]();});}};}function handleEntityNotFound(_0x51de62,_0x517e7b){return function(_0x477bf1){if(!_0x477bf1){_0x51de62[_0x9133('0x26')](0x194);}return _0x477bf1;};}function handleError(_0x428e18,_0x348486){_0x348486=_0x348486||0x1f4;return function(_0x4de894){logger['error'](_0x4de894[_0x9133('0x27')]);if(_0x4de894[_0x9133('0x28')]){delete _0x4de894[_0x9133('0x28')];}_0x428e18[_0x9133('0x1a')](_0x348486)[_0x9133('0x29')](_0x4de894);};}exports[_0x9133('0x2a')]=function(_0x48c713,_0x58afe0){var _0x5a27c1={},_0x1ad222={},_0x4a4a8e={'count':0x0,'rows':[]};var _0x43b5f3=_[_0x9133('0x2b')](db['VoiceMail'][_0x9133('0x2c')],function(_0x5dd90b){return{'name':_0x5dd90b[_0x9133('0x2d')],'type':_0x5dd90b[_0x9133('0x2e')][_0x9133('0x2f')]};});_0x1ad222['model']=_[_0x9133('0x2b')](_0x43b5f3,_0x9133('0x28'));_0x1ad222[_0x9133('0x30')]=_['keys'](_0x48c713[_0x9133('0x30')]);_0x1ad222[_0x9133('0x31')]=_[_0x9133('0x32')](_0x1ad222['model'],_0x1ad222[_0x9133('0x30')]);_0x5a27c1[_0x9133('0x33')]=_[_0x9133('0x32')](_0x1ad222[_0x9133('0x34')],qs['fields'](_0x48c713[_0x9133('0x30')][_0x9133('0x35')]));_0x5a27c1['attributes']=_0x5a27c1[_0x9133('0x33')][_0x9133('0x36')]?_0x5a27c1[_0x9133('0x33')]:_0x1ad222[_0x9133('0x34')];if(!_0x48c713[_0x9133('0x30')][_0x9133('0x37')](_0x9133('0x38'))){_0x5a27c1[_0x9133('0x1d')]=qs[_0x9133('0x1d')](_0x48c713[_0x9133('0x30')][_0x9133('0x1d')]);_0x5a27c1['offset']=qs[_0x9133('0x1e')](_0x48c713[_0x9133('0x30')]['offset']);}_0x5a27c1[_0x9133('0x39')]=qs[_0x9133('0x3a')](_0x48c713[_0x9133('0x30')][_0x9133('0x3a')]);_0x5a27c1[_0x9133('0x3b')]=qs[_0x9133('0x31')](_['pick'](_0x48c713['query'],_0x1ad222[_0x9133('0x31')]),_0x43b5f3);if(_0x48c713[_0x9133('0x30')][_0x9133('0x3c')]){_0x5a27c1[_0x9133('0x3b')]=_[_0x9133('0x3d')](_0x5a27c1[_0x9133('0x3b')],{'$or':_[_0x9133('0x2b')](_0x43b5f3,function(_0x2ee83e){if(_0x2ee83e[_0x9133('0x2e')]!=='VIRTUAL'){var _0xafd8f9={};_0xafd8f9[_0x2ee83e[_0x9133('0x28')]]={'$like':'%'+_0x48c713[_0x9133('0x30')][_0x9133('0x3c')]+'%'};return _0xafd8f9;}})});}_0x5a27c1=_[_0x9133('0x3d')]({},_0x5a27c1,_0x48c713['options']);var _0x3c691e={'where':_0x5a27c1[_0x9133('0x3b')]};return db[_0x9133('0x3e')][_0x9133('0x3f')](_0x3c691e)['then'](function(_0x146734){_0x4a4a8e[_0x9133('0x3f')]=_0x146734;if(_0x48c713[_0x9133('0x30')][_0x9133('0x40')]){_0x5a27c1[_0x9133('0x41')]=[{'all':!![]}];}return db[_0x9133('0x3e')][_0x9133('0x42')](_0x5a27c1);})['then'](function(_0x7f6cd9){_0x4a4a8e['rows']=_0x7f6cd9;return _0x4a4a8e;})['then'](respondWithFilteredResult(_0x58afe0,_0x5a27c1))[_0x9133('0x43')](handleError(_0x58afe0,null));};exports[_0x9133('0x44')]=function(_0x46156d,_0x264df4){var _0xdd485f={'raw':!![],'where':{'id':_0x46156d[_0x9133('0x45')]['id']}},_0x2d2bf7={};_0x2d2bf7[_0x9133('0x34')]=_[_0x9133('0x46')](db['VoiceMail'][_0x9133('0x2c')]);_0x2d2bf7[_0x9133('0x30')]=_[_0x9133('0x46')](_0x46156d['query']);_0x2d2bf7['filters']=_[_0x9133('0x32')](_0x2d2bf7[_0x9133('0x34')],_0x2d2bf7['query']);_0xdd485f[_0x9133('0x33')]=_[_0x9133('0x32')](_0x2d2bf7[_0x9133('0x34')],qs[_0x9133('0x35')](_0x46156d[_0x9133('0x30')]['fields']));_0xdd485f[_0x9133('0x33')]=_0xdd485f[_0x9133('0x33')][_0x9133('0x36')]?_0xdd485f['attributes']:_0x2d2bf7[_0x9133('0x34')];if(_0x46156d[_0x9133('0x30')]['includeAll']){_0xdd485f['include']=[{'all':!![]}];}_0xdd485f=_[_0x9133('0x3d')]({},_0xdd485f,_0x46156d[_0x9133('0x47')]);return db[_0x9133('0x3e')][_0x9133('0x48')](_0xdd485f)[_0x9133('0x20')](handleEntityNotFound(_0x264df4,null))[_0x9133('0x20')](respondWithResult(_0x264df4,null))[_0x9133('0x43')](handleError(_0x264df4,null));};exports[_0x9133('0x49')]=function(_0x23f134,_0xf07fbb){return db[_0x9133('0x3e')][_0x9133('0x49')](_0x23f134['body'],{})['then'](function(_0xf2e098){var _0x4dc2f3=_0x23f134[_0x9133('0x4a')][_0x9133('0x22')]({'plain':!![]});if(!_0x4dc2f3)throw new Error(_0x9133('0x4b'));if(_0x4dc2f3[_0x9133('0x4c')]==='user'){var _0x2a3848=_0xf2e098[_0x9133('0x22')]({'plain':!![]});var _0x799772='Voicemails';return db[_0x9133('0x4d')][_0x9133('0x48')]({'where':{'name':_0x799772,'userProfileId':_0x4dc2f3[_0x9133('0x4e')]},'raw':!![]})['then'](function(_0x14c825){if(_0x14c825&&_0x14c825['autoAssociation']===0x0){return db[_0x9133('0x24')][_0x9133('0x49')]({'name':_0x2a3848[_0x9133('0x28')],'resourceId':_0x2a3848['id'],'type':_0x14c825[_0x9133('0x28')],'sectionId':_0x14c825['id']},{})['then'](function(){return _0xf2e098;});}else{return _0xf2e098;}})['catch'](function(_0x2f09f6){logger[_0x9133('0x4f')](_0x9133('0x50'),_0x2f09f6);throw _0x2f09f6;});}return _0xf2e098;})[_0x9133('0x20')](respondWithResult(_0xf07fbb,0xc9))[_0x9133('0x43')](handleError(_0xf07fbb,null));};exports['update']=function(_0x554bb9,_0x33599b){if(_0x554bb9[_0x9133('0x51')]['id']){delete _0x554bb9['body']['id'];}return db[_0x9133('0x3e')][_0x9133('0x48')]({'where':{'id':_0x554bb9['params']['id']}})['then'](handleEntityNotFound(_0x33599b,null))['then'](saveUpdates(_0x554bb9[_0x9133('0x51')],null))['then'](respondWithResult(_0x33599b,null))[_0x9133('0x43')](handleError(_0x33599b,null));};exports[_0x9133('0x21')]=function(_0x439258,_0x3d6daa){return db['VoiceMail'][_0x9133('0x48')]({'where':{'id':_0x439258['params']['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x3d6daa,null))[_0x9133('0x20')](removeEntity(_0x3d6daa,null))[_0x9133('0x43')](handleError(_0x3d6daa,null));};exports[_0x9133('0x52')]=function(_0x3b9927,_0x3534bf,_0x56861c){return db['VoiceMail']['findOne']({'where':{'id':_0x3b9927[_0x9133('0x45')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x3534bf,null))[_0x9133('0x20')](function(_0x54a330){var _0x3f4cd7;var _0x1f6684={},_0x415d55={};_0x415d55[_0x9133('0x34')]=_[_0x9133('0x46')](db[_0x9133('0x53')][_0x9133('0x2c')]);_0x415d55[_0x9133('0x30')]=_['keys'](_0x3b9927[_0x9133('0x30')]);_0x415d55['filters']=_[_0x9133('0x32')](_0x415d55['model'],_0x415d55[_0x9133('0x30')]);_0x1f6684[_0x9133('0x33')]=_['intersection'](_0x415d55['model'],qs[_0x9133('0x35')](_0x3b9927[_0x9133('0x30')][_0x9133('0x35')]));_0x1f6684[_0x9133('0x33')]=_0x1f6684[_0x9133('0x33')][_0x9133('0x36')]?_0x1f6684[_0x9133('0x33')]:_0x415d55[_0x9133('0x34')];if(!_0x3b9927[_0x9133('0x30')][_0x9133('0x37')](_0x9133('0x38'))){_0x1f6684['limit']=qs[_0x9133('0x1d')](_0x3b9927['query'][_0x9133('0x1d')]);_0x1f6684[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x3b9927[_0x9133('0x30')][_0x9133('0x1e')]);}_0x1f6684['order']=qs[_0x9133('0x3a')](_0x3b9927[_0x9133('0x30')][_0x9133('0x3a')]);_0x1f6684[_0x9133('0x3b')]=qs['filters'](_[_0x9133('0x54')](_0x3b9927[_0x9133('0x30')],_0x415d55[_0x9133('0x31')]));if(_0x3b9927[_0x9133('0x30')]['filter']){_0x1f6684['where']=_[_0x9133('0x3d')](_0x1f6684[_0x9133('0x3b')],{'$or':_[_0x9133('0x2b')](_0x1f6684[_0x9133('0x33')],function(_0x28cc46){var _0x2cfaf8={};_0x2cfaf8[_0x28cc46]={'$like':'%'+_0x3b9927['query'][_0x9133('0x3c')]+'%'};return _0x2cfaf8;})});}_0x1f6684[_0x9133('0x3b')]=_[_0x9133('0x3d')](_0x1f6684[_0x9133('0x3b')],{'mailboxuser':_0x54a330['mailbox']});_0x1f6684=_[_0x9133('0x3d')]({},_0x1f6684,_0x3b9927['options']);return db[_0x9133('0x53')][_0x9133('0x55')](_0x1f6684)[_0x9133('0x20')](respondWithFilteredResult(_0x3534bf,_0x1f6684));})[_0x9133('0x43')](handleError(_0x3534bf,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index ebc17b7..1289857 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 _0x88b7=['mailbox','context','util','api','bluebird','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x37beb4,_0x4f207b){var _0x130c12=function(_0x1e8cf1){while(--_0x1e8cf1){_0x37beb4['push'](_0x37beb4['shift']());}};_0x130c12(++_0x4f207b);}(_0x88b7,0x1be));var _0x788b=function(_0x2014c3,_0x5241af){_0x2014c3=_0x2014c3-0x0;var _0x2d71f2=_0x88b7[_0x2014c3];return _0x2d71f2;};'use strict';var _=require('lodash');var util=require(_0x788b('0x0'));var logger=require('../../config/logger')(_0x788b('0x1'));var moment=require('moment');var BPromise=require(_0x788b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x788b('0x3'));var config=require(_0x788b('0x4'));var attributes=require(_0x788b('0x5'));module['exports']=function(_0x224c82,_0x2b96a4){return _0x224c82[_0x788b('0x6')](_0x788b('0x7'),attributes,{'tableName':_0x788b('0x8'),'paranoid':![],'indexes':[{'name':_0x788b('0x9'),'fields':[_0x788b('0xa'),_0x788b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x99dd=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','context'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x99dd,0x188));var _0xd99d=function(_0x2a3d74,_0x487ab5){_0x2a3d74=_0x2a3d74-0x0;var _0x219489=_0x99dd[_0x2a3d74];return _0x219489;};'use strict';var _=require(_0xd99d('0x0'));var util=require(_0xd99d('0x1'));var logger=require(_0xd99d('0x2'))('api');var moment=require(_0xd99d('0x3'));var BPromise=require('bluebird');var rp=require(_0xd99d('0x4'));var fs=require('fs');var path=require(_0xd99d('0x5'));var rimraf=require(_0xd99d('0x6'));var config=require(_0xd99d('0x7'));var attributes=require(_0xd99d('0x8'));module[_0xd99d('0x9')]=function(_0x264208,_0x55b60a){return _0x264208[_0xd99d('0xa')](_0xd99d('0xb'),attributes,{'tableName':_0xd99d('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xd99d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 5ca0523..4a0df22 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 _0x5dc0=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3cf5a3,_0x5a4492){var _0x39ba2d=function(_0x3ed989){while(--_0x3ed989){_0x3cf5a3['push'](_0x3cf5a3['shift']());}};_0x39ba2d(++_0x5a4492);}(_0x5dc0,0x103));var _0x05dc=function(_0x478830,_0x266465){_0x478830=_0x478830-0x0;var _0x1f2420=_0x5dc0[_0x478830];return _0x1f2420;};'use strict';var _=require(_0x05dc('0x0'));var util=require(_0x05dc('0x1'));var moment=require(_0x05dc('0x2'));var BPromise=require(_0x05dc('0x3'));var rs=require(_0x05dc('0x4'));var fs=require('fs');var Redis=require(_0x05dc('0x5'));var db=require(_0x05dc('0x6'))['db'];var utils=require(_0x05dc('0x7'));var logger=require('../../config/logger')(_0x05dc('0x8'));var config=require(_0x05dc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x05dc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33b8e9,_0x9d061,_0x36afcc){return new BPromise(function(_0x3100bc,_0x29b485){return client[_0x05dc('0xb')](_0x33b8e9,_0x36afcc)['then'](function(_0x48a876){logger[_0x05dc('0xc')](_0x05dc('0xd'),_0x9d061,_0x05dc('0xe'));logger[_0x05dc('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x9d061,_0x05dc('0xe'),JSON[_0x05dc('0x10')](_0x48a876));if(_0x48a876['error']){if(_0x48a876[_0x05dc('0x11')][_0x05dc('0x12')]===0x1f4){logger[_0x05dc('0x11')](_0x05dc('0xd'),_0x9d061,_0x48a876[_0x05dc('0x11')][_0x05dc('0x13')]);return _0x29b485(_0x48a876[_0x05dc('0x11')][_0x05dc('0x13')]);}logger[_0x05dc('0x11')](_0x05dc('0xd'),_0x9d061,_0x48a876[_0x05dc('0x11')][_0x05dc('0x13')]);return _0x3100bc(_0x48a876['error']['message']);}else{logger[_0x05dc('0xc')](_0x05dc('0xd'),_0x9d061,'request\x20sent');_0x3100bc(_0x48a876[_0x05dc('0x14')][_0x05dc('0x13')]);}})[_0x05dc('0x15')](function(_0x32028a){logger['error'](_0x05dc('0xd'),_0x9d061,_0x32028a);_0x29b485(_0x32028a);});});} \ No newline at end of file +var _0x4b8d=['request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4b8d,0x1ed));var _0xd4b8=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x4b8d[_0x3a2e49];return _0x257140;};'use strict';var _=require(_0xd4b8('0x0'));var util=require(_0xd4b8('0x1'));var moment=require(_0xd4b8('0x2'));var BPromise=require(_0xd4b8('0x3'));var rs=require(_0xd4b8('0x4'));var fs=require('fs');var Redis=require(_0xd4b8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4b8('0x6'));var logger=require('../../config/logger')(_0xd4b8('0x7'));var config=require(_0xd4b8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd4b8('0x9')][_0xd4b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x689c14,_0x1593cb,_0xff75e7){return new BPromise(function(_0x3685e6,_0x1708b8){return client[_0xd4b8('0xb')](_0x689c14,_0xff75e7)[_0xd4b8('0xc')](function(_0x4bb0cb){logger[_0xd4b8('0xd')]('VoiceMail,\x20%s,\x20%s',_0x1593cb,_0xd4b8('0xe'));logger[_0xd4b8('0xf')](_0xd4b8('0x10'),_0x1593cb,_0xd4b8('0xe'),JSON[_0xd4b8('0x11')](_0x4bb0cb));if(_0x4bb0cb[_0xd4b8('0x12')]){if(_0x4bb0cb[_0xd4b8('0x12')][_0xd4b8('0x13')]===0x1f4){logger[_0xd4b8('0x12')](_0xd4b8('0x14'),_0x1593cb,_0x4bb0cb[_0xd4b8('0x12')][_0xd4b8('0x15')]);return _0x1708b8(_0x4bb0cb[_0xd4b8('0x12')]['message']);}logger[_0xd4b8('0x12')](_0xd4b8('0x14'),_0x1593cb,_0x4bb0cb[_0xd4b8('0x12')][_0xd4b8('0x15')]);return _0x3685e6(_0x4bb0cb[_0xd4b8('0x12')][_0xd4b8('0x15')]);}else{logger[_0xd4b8('0xd')](_0xd4b8('0x14'),_0x1593cb,_0xd4b8('0xe'));_0x3685e6(_0x4bb0cb[_0xd4b8('0x16')][_0xd4b8('0x15')]);}})[_0xd4b8('0x17')](function(_0x1bd3dd){logger[_0xd4b8('0x12')](_0xd4b8('0x14'),_0x1593cb,_0x1bd3dd);_0x1708b8(_0x1bd3dd);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index c73955e..ef1c724 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 _0x181a=['/:id','show','download','post','create','update','delete','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index'];(function(_0x2739ed,_0x5271f3){var _0x28041f=function(_0x326b72){while(--_0x326b72){_0x2739ed['push'](_0x2739ed['shift']());}};_0x28041f(++_0x5271f3);}(_0x181a,0xbb));var _0xa181=function(_0x1f9f01,_0x1e1d99){_0x1f9f01=_0x1f9f01-0x0;var _0x54f146=_0x181a[_0x1f9f01];return _0x54f146;};'use strict';var multer=require(_0xa181('0x0'));var util=require(_0xa181('0x1'));var path=require(_0xa181('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa181('0x3')]();var fs_extra=require(_0xa181('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa181('0x5'));var config=require(_0xa181('0x6'));var controller=require(_0xa181('0x7'));router[_0xa181('0x8')]('/',auth[_0xa181('0x9')](),controller[_0xa181('0xa')]);router[_0xa181('0x8')](_0xa181('0xb'),auth[_0xa181('0x9')](),controller[_0xa181('0xc')]);router['get']('/:id/download',auth[_0xa181('0x9')](),controller[_0xa181('0xd')]);router[_0xa181('0xe')]('/',auth['isAuthenticated'](),controller[_0xa181('0xf')]);router['put'](_0xa181('0xb'),auth['isAuthenticated'](),controller[_0xa181('0x10')]);router[_0xa181('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc24f=['delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','update'];(function(_0x43f853,_0x7d78b){var _0x438270=function(_0x5d74e8){while(--_0x5d74e8){_0x43f853['push'](_0x43f853['shift']());}};_0x438270(++_0x7d78b);}(_0xc24f,0x1a7));var _0xfc24=function(_0x53cd30,_0x41dc3e){_0x53cd30=_0x53cd30-0x0;var _0x21a342=_0xc24f[_0x53cd30];return _0x21a342;};'use strict';var multer=require('multer');var util=require(_0xfc24('0x0'));var path=require('path');var timeout=require(_0xfc24('0x1'));var express=require('express');var router=express[_0xfc24('0x2')]();var fs_extra=require(_0xfc24('0x3'));var auth=require(_0xfc24('0x4'));var interaction=require(_0xfc24('0x5'));var config=require(_0xfc24('0x6'));var controller=require(_0xfc24('0x7'));router[_0xfc24('0x8')]('/',auth[_0xfc24('0x9')](),controller[_0xfc24('0xa')]);router[_0xfc24('0x8')]('/:id',auth[_0xfc24('0x9')](),controller[_0xfc24('0xb')]);router[_0xfc24('0x8')](_0xfc24('0xc'),auth[_0xfc24('0x9')](),controller[_0xfc24('0xd')]);router[_0xfc24('0xe')]('/',auth[_0xfc24('0x9')](),controller[_0xfc24('0xf')]);router['put'](_0xfc24('0x10'),auth[_0xfc24('0x9')](),controller[_0xfc24('0x11')]);router[_0xfc24('0x12')](_0xfc24('0x10'),auth[_0xfc24('0x9')](),controller[_0xfc24('0x13')]);module[_0xfc24('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 144bb81..4601014 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 _0xbc09=['TIMESTAMP','literal','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xbc09,0x1e8));var _0x9bc0=function(_0x45b9c0,_0x33322d){_0x45b9c0=_0x45b9c0-0x0;var _0x77bdd7=_0xbc09[_0x45b9c0];return _0x77bdd7;};'use strict';var Sequelize=require('sequelize');module[_0x9bc0('0x0')]={'name':{'type':Sequelize[_0x9bc0('0x1')],'get':function(_0x480f64){return this[_0x9bc0('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x9bc0('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x9bc0('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x9bc0('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x9bc0('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x9bc0('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9bc0('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9bc0('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x9bc0('0x5')](_0x9bc0('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x9bc0('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x9bc0('0x7'),'defaultValue':Sequelize[_0x9bc0('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x488d=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','STRING','BLOB','TIMESTAMP'];(function(_0x73acf8,_0x5e2655){var _0x58a2b4=function(_0x31b37e){while(--_0x31b37e){_0x73acf8['push'](_0x73acf8['shift']());}};_0x58a2b4(++_0x5e2655);}(_0x488d,0x13a));var _0xd488=function(_0x41e3bc,_0x1c137f){_0x41e3bc=_0x41e3bc-0x0;var _0x116b05=_0x488d[_0x41e3bc];return _0x116b05;};'use strict';var Sequelize=require('sequelize');module[_0xd488('0x0')]={'name':{'type':Sequelize[_0xd488('0x1')],'get':function(_0x997b5){return this[_0xd488('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd488('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xd488('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xd488('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd488('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd488('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xd488('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xd488('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd488('0x3')],'defaultValue':''},'stamp':{'type':_0xd488('0x5'),'defaultValue':Sequelize[_0xd488('0x6')](_0xd488('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 75fba9f..759ad8f 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 _0x16f2=['apply','update','then','destroy','error','stack','name','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','fields','length','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','attributes','find','catch','create','body','params','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x1edf32,_0x1246c7){var _0x291779=function(_0x1fc985){while(--_0x1fc985){_0x1edf32['push'](_0x1edf32['shift']());}};_0x291779(++_0x1246c7);}(_0x16f2,0xd7));var _0x216f=function(_0x51cd34,_0x1486f7){_0x51cd34=_0x51cd34-0x0;var _0x345c33=_0x16f2[_0x51cd34];return _0x345c33;};'use strict';var emlformat=require(_0x216f('0x0'));var rimraf=require(_0x216f('0x1'));var zipdir=require(_0x216f('0x2'));var jsonpatch=require(_0x216f('0x3'));var rp=require(_0x216f('0x4'));var moment=require('moment');var BPromise=require(_0x216f('0x5'));var Mustache=require(_0x216f('0x6'));var util=require(_0x216f('0x7'));var path=require('path');var sox=require(_0x216f('0x8'));var csv=require('to-csv');var ejs=require(_0x216f('0x9'));var fs=require('fs');var fs_extra=require(_0x216f('0xa'));var _=require(_0x216f('0xb'));var squel=require(_0x216f('0xc'));var crypto=require(_0x216f('0xd'));var jsforce=require(_0x216f('0xe'));var deskjs=require(_0x216f('0xf'));var toCsv=require(_0x216f('0x10'));var querystring=require(_0x216f('0x11'));var Papa=require(_0x216f('0x12'));var Redis=require(_0x216f('0x13'));var authService=require(_0x216f('0x14'));var qs=require(_0x216f('0x15'));var as=require(_0x216f('0x16'));var hardwareService=require(_0x216f('0x17'));var logger=require(_0x216f('0x18'))(_0x216f('0x19'));var utils=require('../../config/utils');var config=require(_0x216f('0x1a'));var licenseUtil=require(_0x216f('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4174c0,_0x4c362f){_0x4c362f=_0x4c362f||0xcc;return function(_0x2a8365){if(_0x2a8365){return _0x4174c0[_0x216f('0x1c')](_0x4c362f);}return _0x4174c0[_0x216f('0x1d')](_0x4c362f)[_0x216f('0x1e')]();};}function respondWithResult(_0x2fe247,_0x237a10){_0x237a10=_0x237a10||0xc8;return function(_0xcac814){if(_0xcac814){return _0x2fe247[_0x216f('0x1d')](_0x237a10)[_0x216f('0x1f')](_0xcac814);}};}function respondWithFilteredResult(_0x1c3cb6,_0x19ba67){return function(_0x344152){if(_0x344152){var _0x2dcb57=typeof _0x19ba67['offset']===_0x216f('0x20')&&typeof _0x19ba67[_0x216f('0x21')]==='undefined';var _0x44c99d=_0x344152[_0x216f('0x22')];var _0x1c40ce=_0x2dcb57?0x0:_0x19ba67[_0x216f('0x23')];var _0x320e5d=_0x2dcb57?_0x344152[_0x216f('0x22')]:_0x19ba67[_0x216f('0x23')]+_0x19ba67[_0x216f('0x21')];var _0x2c9007;if(_0x320e5d>=_0x44c99d){_0x320e5d=_0x44c99d;_0x2c9007=0xc8;}else{_0x2c9007=0xce;}_0x1c3cb6[_0x216f('0x1d')](_0x2c9007);return _0x1c3cb6[_0x216f('0x24')]('Content-Range',_0x1c40ce+'-'+_0x320e5d+'/'+_0x44c99d)[_0x216f('0x1f')](_0x344152);}return null;};}function patchUpdates(_0x26aa1e){return function(_0x1049ca){try{jsonpatch[_0x216f('0x25')](_0x1049ca,_0x26aa1e,!![]);}catch(_0x25dfa7){return BPromise['reject'](_0x25dfa7);}return _0x1049ca['save']();};}function saveUpdates(_0x4fdb66,_0x59b250){return function(_0x150f0b){if(_0x150f0b){return _0x150f0b[_0x216f('0x26')](_0x4fdb66)[_0x216f('0x27')](function(_0x58b686){return _0x58b686;});}return null;};}function removeEntity(_0x53e627,_0x25597d){return function(_0x11b9da){if(_0x11b9da){return _0x11b9da[_0x216f('0x28')]()[_0x216f('0x27')](function(){_0x53e627['status'](0xcc)[_0x216f('0x1e')]();});}};}function handleEntityNotFound(_0x244947,_0x3d1ed9){return function(_0x550a24){if(!_0x550a24){_0x244947[_0x216f('0x1c')](0x194);}return _0x550a24;};}function handleError(_0x37e82c,_0x4d646a){_0x4d646a=_0x4d646a||0x1f4;return function(_0x10b9c7){logger[_0x216f('0x29')](_0x10b9c7[_0x216f('0x2a')]);if(_0x10b9c7['name']){delete _0x10b9c7[_0x216f('0x2b')];}_0x37e82c[_0x216f('0x1d')](_0x4d646a)['send'](_0x10b9c7);};}exports['index']=function(_0x1c60c6,_0x33f335){var _0x39b5e6={},_0x534830={},_0x24e018={'count':0x0,'rows':[]};var _0x4f9276=_[_0x216f('0x2c')](db[_0x216f('0x2d')][_0x216f('0x2e')],function(_0x5552cd){return{'name':_0x5552cd[_0x216f('0x2f')],'type':_0x5552cd[_0x216f('0x30')][_0x216f('0x31')]};});_0x534830['model']=_[_0x216f('0x32')](_['map'](_0x4f9276,_0x216f('0x2b')),[_0x216f('0x2b')]);_0x534830[_0x216f('0x33')]=_[_0x216f('0x34')](_0x1c60c6['query']);_0x534830[_0x216f('0x35')]=_[_0x216f('0x36')](_0x534830[_0x216f('0x37')],_0x534830[_0x216f('0x33')]);_0x39b5e6['attributes']=_['intersection'](_0x534830[_0x216f('0x37')],qs[_0x216f('0x38')](_0x1c60c6[_0x216f('0x33')][_0x216f('0x38')]));_0x39b5e6['attributes']=_0x39b5e6['attributes'][_0x216f('0x39')]?_0x39b5e6['attributes']:_0x534830['model'];if(!_0x1c60c6[_0x216f('0x33')][_0x216f('0x3a')](_0x216f('0x3b'))){_0x39b5e6[_0x216f('0x21')]=qs['limit'](_0x1c60c6[_0x216f('0x33')]['limit']);_0x39b5e6[_0x216f('0x23')]=qs[_0x216f('0x23')](_0x1c60c6[_0x216f('0x33')][_0x216f('0x23')]);}_0x39b5e6['order']=qs['sort'](_0x1c60c6[_0x216f('0x33')]['sort']);_0x39b5e6[_0x216f('0x3c')]=qs[_0x216f('0x35')](_[_0x216f('0x3d')](_0x1c60c6[_0x216f('0x33')],_0x534830[_0x216f('0x35')]),_0x4f9276);if(_0x1c60c6['query']['filter']){_0x39b5e6['where']=_[_0x216f('0x3e')](_0x39b5e6[_0x216f('0x3c')],{'$or':_[_0x216f('0x2c')](_0x4f9276,function(_0x207f04){if(_0x207f04['type']!==_0x216f('0x3f')){var _0x270165={};_0x270165[_0x207f04[_0x216f('0x2b')]]={'$like':'%'+_0x1c60c6[_0x216f('0x33')][_0x216f('0x40')]+'%'};return _0x270165;}})});}_0x39b5e6=_['merge']({},_0x39b5e6,_0x1c60c6[_0x216f('0x41')]);var _0x33549c={'where':_0x39b5e6[_0x216f('0x3c')]};return db[_0x216f('0x2d')]['count'](_0x33549c)[_0x216f('0x27')](function(_0x4ef379){_0x24e018['count']=_0x4ef379;if(_0x1c60c6[_0x216f('0x33')][_0x216f('0x42')]){_0x39b5e6[_0x216f('0x43')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x39b5e6);})[_0x216f('0x27')](function(_0x13e9ed){_0x24e018[_0x216f('0x44')]=_0x13e9ed;return _0x24e018;})['then'](respondWithFilteredResult(_0x33f335,_0x39b5e6))['catch'](handleError(_0x33f335,null));};exports['show']=function(_0x4e62c4,_0x28377b){var _0x32f029={'raw':!![],'where':{'id':_0x4e62c4['params']['id']}},_0x355279={};_0x355279[_0x216f('0x37')]=_[_0x216f('0x34')](db[_0x216f('0x2d')][_0x216f('0x2e')]);_0x355279[_0x216f('0x33')]=_['keys'](_0x4e62c4[_0x216f('0x33')]);_0x355279[_0x216f('0x35')]=_['intersection'](_0x355279[_0x216f('0x37')],_0x355279[_0x216f('0x33')]);_0x32f029[_0x216f('0x45')]=_[_0x216f('0x36')](_0x355279[_0x216f('0x37')],qs[_0x216f('0x38')](_0x4e62c4[_0x216f('0x33')][_0x216f('0x38')]));_0x32f029[_0x216f('0x45')]=_0x32f029[_0x216f('0x45')][_0x216f('0x39')]?_0x32f029[_0x216f('0x45')]:_0x355279[_0x216f('0x37')];if(_0x4e62c4[_0x216f('0x33')][_0x216f('0x42')]){_0x32f029[_0x216f('0x43')]=[{'all':!![]}];}_0x32f029=_[_0x216f('0x3e')]({},_0x32f029,_0x4e62c4['options']);return db['VoiceMailMessage'][_0x216f('0x46')](_0x32f029)[_0x216f('0x27')](handleEntityNotFound(_0x28377b,null))[_0x216f('0x27')](respondWithResult(_0x28377b,null))[_0x216f('0x47')](handleError(_0x28377b,null));};exports[_0x216f('0x48')]=function(_0x235165,_0xcbce19){return db[_0x216f('0x2d')][_0x216f('0x48')](_0x235165['body'],{})[_0x216f('0x27')](respondWithResult(_0xcbce19,0xc9))['catch'](handleError(_0xcbce19,null));};exports[_0x216f('0x26')]=function(_0x20289e,_0x1bba20){if(_0x20289e[_0x216f('0x49')]['id']){delete _0x20289e[_0x216f('0x49')]['id'];}return db[_0x216f('0x2d')]['find']({'where':{'id':_0x20289e[_0x216f('0x4a')]['id']}})[_0x216f('0x27')](handleEntityNotFound(_0x1bba20,null))[_0x216f('0x27')](saveUpdates(_0x20289e[_0x216f('0x49')],null))['then'](respondWithResult(_0x1bba20,null))[_0x216f('0x47')](handleError(_0x1bba20,null));};exports['destroy']=function(_0x31a83c,_0x5542c4){return db[_0x216f('0x2d')][_0x216f('0x46')]({'where':{'id':_0x31a83c['params']['id']}})['then'](handleEntityNotFound(_0x5542c4,null))[_0x216f('0x27')](removeEntity(_0x5542c4,null))[_0x216f('0x47')](handleError(_0x5542c4,null));};exports['download']=function(_0x4fe7ca,_0x40d365,_0x161ff5){return db[_0x216f('0x2d')][_0x216f('0x46')]({'where':{'id':_0x4fe7ca[_0x216f('0x4a')]['id']},'attributes':['id',_0x216f('0x4b'),_0x216f('0x4c')]})[_0x216f('0x27')](handleEntityNotFound(_0x40d365,null))[_0x216f('0x27')](function(_0x20e8b1){if(_0x20e8b1){if(!_0x20e8b1[_0x216f('0x4b')]){throw new db[(_0x216f('0x4d'))][(_0x216f('0x4e'))](_0x216f('0x4f'));}var _0x21b200={'Content-Type':'audio/wav','Content-Disposition':_0x216f('0x50')};if(_0x20e8b1[_0x216f('0x4c')]){_0x21b200[_0x216f('0x51')]=_0x216f('0x52')+_0x20e8b1[_0x216f('0x4c')]+_0x216f('0x53');}_0x40d365['set'](_0x21b200);return _0x40d365['send'](new Buffer(_0x20e8b1[_0x216f('0x4b')]));}})[_0x216f('0x47')](handleError(_0x40d365,null));}; \ No newline at end of file +var _0x6e19=['map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','download','msg_id','recording','ValidationError','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x30f5e3,_0x41d3ba){var _0x22ed90=function(_0x1b2020){while(--_0x1b2020){_0x30f5e3['push'](_0x30f5e3['shift']());}};_0x22ed90(++_0x41d3ba);}(_0x6e19,0x16c));var _0x96e1=function(_0xbae42b,_0x288fc5){_0xbae42b=_0xbae42b-0x0;var _0x408e41=_0x6e19[_0xbae42b];return _0x408e41;};'use strict';var emlformat=require(_0x96e1('0x0'));var rimraf=require(_0x96e1('0x1'));var zipdir=require(_0x96e1('0x2'));var jsonpatch=require(_0x96e1('0x3'));var rp=require(_0x96e1('0x4'));var moment=require('moment');var BPromise=require(_0x96e1('0x5'));var Mustache=require('mustache');var util=require(_0x96e1('0x6'));var path=require('path');var sox=require(_0x96e1('0x7'));var csv=require(_0x96e1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96e1('0x9'));var _=require(_0x96e1('0xa'));var squel=require(_0x96e1('0xb'));var crypto=require(_0x96e1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x96e1('0xd'));var toCsv=require(_0x96e1('0x8'));var querystring=require(_0x96e1('0xe'));var Papa=require('papaparse');var Redis=require(_0x96e1('0xf'));var authService=require(_0x96e1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96e1('0x11'));var logger=require(_0x96e1('0x12'))('api');var utils=require(_0x96e1('0x13'));var config=require(_0x96e1('0x14'));var licenseUtil=require(_0x96e1('0x15'));var db=require(_0x96e1('0x16'))['db'];function respondWithStatusCode(_0x474142,_0x119b38){_0x119b38=_0x119b38||0xcc;return function(_0x5687e8){if(_0x5687e8){return _0x474142[_0x96e1('0x17')](_0x119b38);}return _0x474142['status'](_0x119b38)[_0x96e1('0x18')]();};}function respondWithResult(_0x1c82d3,_0x2a19d1){_0x2a19d1=_0x2a19d1||0xc8;return function(_0x4100c2){if(_0x4100c2){return _0x1c82d3[_0x96e1('0x19')](_0x2a19d1)[_0x96e1('0x1a')](_0x4100c2);}};}function respondWithFilteredResult(_0x2182ea,_0x2634cd){return function(_0x15415c){if(_0x15415c){var _0x167d05=typeof _0x2634cd[_0x96e1('0x1b')]===_0x96e1('0x1c')&&typeof _0x2634cd[_0x96e1('0x1d')]===_0x96e1('0x1c');var _0x195843=_0x15415c[_0x96e1('0x1e')];var _0x69090f=_0x167d05?0x0:_0x2634cd[_0x96e1('0x1b')];var _0x16eab4=_0x167d05?_0x15415c[_0x96e1('0x1e')]:_0x2634cd[_0x96e1('0x1b')]+_0x2634cd[_0x96e1('0x1d')];var _0x1c56e0;if(_0x16eab4>=_0x195843){_0x16eab4=_0x195843;_0x1c56e0=0xc8;}else{_0x1c56e0=0xce;}_0x2182ea['status'](_0x1c56e0);return _0x2182ea['set']('Content-Range',_0x69090f+'-'+_0x16eab4+'/'+_0x195843)[_0x96e1('0x1a')](_0x15415c);}return null;};}function patchUpdates(_0x30b3bc){return function(_0x1c026e){try{jsonpatch[_0x96e1('0x1f')](_0x1c026e,_0x30b3bc,!![]);}catch(_0x49532c){return BPromise[_0x96e1('0x20')](_0x49532c);}return _0x1c026e[_0x96e1('0x21')]();};}function saveUpdates(_0x52cb5e,_0x17c8e1){return function(_0x2fb4ce){if(_0x2fb4ce){return _0x2fb4ce[_0x96e1('0x22')](_0x52cb5e)[_0x96e1('0x23')](function(_0x38fe1e){return _0x38fe1e;});}return null;};}function removeEntity(_0x8f91e6,_0x3ba085){return function(_0x64017b){if(_0x64017b){return _0x64017b['destroy']()[_0x96e1('0x23')](function(){_0x8f91e6[_0x96e1('0x19')](0xcc)[_0x96e1('0x18')]();});}};}function handleEntityNotFound(_0x1e95d2,_0x2d3c04){return function(_0x2ce86a){if(!_0x2ce86a){_0x1e95d2[_0x96e1('0x17')](0x194);}return _0x2ce86a;};}function handleError(_0x5a2b60,_0x16609a){_0x16609a=_0x16609a||0x1f4;return function(_0xf54cab){logger[_0x96e1('0x24')](_0xf54cab[_0x96e1('0x25')]);if(_0xf54cab[_0x96e1('0x26')]){delete _0xf54cab[_0x96e1('0x26')];}_0x5a2b60[_0x96e1('0x19')](_0x16609a)[_0x96e1('0x27')](_0xf54cab);};}exports[_0x96e1('0x28')]=function(_0x2e547c,_0x1dce62){var _0x509b22={},_0xf6e4a5={},_0x30c4ae={'count':0x0,'rows':[]};var _0x539822=_[_0x96e1('0x29')](db[_0x96e1('0x2a')][_0x96e1('0x2b')],function(_0x5e13d0){return{'name':_0x5e13d0[_0x96e1('0x2c')],'type':_0x5e13d0[_0x96e1('0x2d')][_0x96e1('0x2e')]};});_0xf6e4a5['model']=_[_0x96e1('0x2f')](_[_0x96e1('0x29')](_0x539822,_0x96e1('0x26')),['name']);_0xf6e4a5[_0x96e1('0x30')]=_[_0x96e1('0x31')](_0x2e547c[_0x96e1('0x30')]);_0xf6e4a5[_0x96e1('0x32')]=_[_0x96e1('0x33')](_0xf6e4a5[_0x96e1('0x34')],_0xf6e4a5[_0x96e1('0x30')]);_0x509b22[_0x96e1('0x35')]=_[_0x96e1('0x33')](_0xf6e4a5[_0x96e1('0x34')],qs[_0x96e1('0x36')](_0x2e547c['query']['fields']));_0x509b22['attributes']=_0x509b22['attributes'][_0x96e1('0x37')]?_0x509b22['attributes']:_0xf6e4a5[_0x96e1('0x34')];if(!_0x2e547c[_0x96e1('0x30')][_0x96e1('0x38')](_0x96e1('0x39'))){_0x509b22['limit']=qs[_0x96e1('0x1d')](_0x2e547c['query']['limit']);_0x509b22[_0x96e1('0x1b')]=qs[_0x96e1('0x1b')](_0x2e547c[_0x96e1('0x30')][_0x96e1('0x1b')]);}_0x509b22[_0x96e1('0x3a')]=qs[_0x96e1('0x3b')](_0x2e547c['query']['sort']);_0x509b22[_0x96e1('0x3c')]=qs[_0x96e1('0x32')](_['pick'](_0x2e547c['query'],_0xf6e4a5[_0x96e1('0x32')]),_0x539822);if(_0x2e547c[_0x96e1('0x30')]['filter']){_0x509b22[_0x96e1('0x3c')]=_[_0x96e1('0x3d')](_0x509b22['where'],{'$or':_['map'](_0x539822,function(_0x11499c){if(_0x11499c[_0x96e1('0x2d')]!==_0x96e1('0x3e')){var _0xcae90={};_0xcae90[_0x11499c[_0x96e1('0x26')]]={'$like':'%'+_0x2e547c['query']['filter']+'%'};return _0xcae90;}})});}_0x509b22=_['merge']({},_0x509b22,_0x2e547c[_0x96e1('0x3f')]);var _0xffc3b9={'where':_0x509b22[_0x96e1('0x3c')]};return db['VoiceMailMessage']['count'](_0xffc3b9)[_0x96e1('0x23')](function(_0x937a53){_0x30c4ae[_0x96e1('0x1e')]=_0x937a53;if(_0x2e547c['query'][_0x96e1('0x40')]){_0x509b22[_0x96e1('0x41')]=[{'all':!![]}];}return db[_0x96e1('0x2a')][_0x96e1('0x42')](_0x509b22);})[_0x96e1('0x23')](function(_0x1e0b77){_0x30c4ae[_0x96e1('0x43')]=_0x1e0b77;return _0x30c4ae;})['then'](respondWithFilteredResult(_0x1dce62,_0x509b22))['catch'](handleError(_0x1dce62,null));};exports[_0x96e1('0x44')]=function(_0x315121,_0x2c09f1){var _0xdfb8a2={'raw':!![],'where':{'id':_0x315121[_0x96e1('0x45')]['id']}},_0x2b9f2e={};_0x2b9f2e['model']=_['keys'](db['VoiceMailMessage'][_0x96e1('0x2b')]);_0x2b9f2e['query']=_[_0x96e1('0x31')](_0x315121[_0x96e1('0x30')]);_0x2b9f2e[_0x96e1('0x32')]=_[_0x96e1('0x33')](_0x2b9f2e['model'],_0x2b9f2e[_0x96e1('0x30')]);_0xdfb8a2['attributes']=_[_0x96e1('0x33')](_0x2b9f2e[_0x96e1('0x34')],qs[_0x96e1('0x36')](_0x315121[_0x96e1('0x30')][_0x96e1('0x36')]));_0xdfb8a2[_0x96e1('0x35')]=_0xdfb8a2['attributes'][_0x96e1('0x37')]?_0xdfb8a2[_0x96e1('0x35')]:_0x2b9f2e[_0x96e1('0x34')];if(_0x315121['query']['includeAll']){_0xdfb8a2[_0x96e1('0x41')]=[{'all':!![]}];}_0xdfb8a2=_['merge']({},_0xdfb8a2,_0x315121[_0x96e1('0x3f')]);return db[_0x96e1('0x2a')][_0x96e1('0x46')](_0xdfb8a2)['then'](handleEntityNotFound(_0x2c09f1,null))[_0x96e1('0x23')](respondWithResult(_0x2c09f1,null))[_0x96e1('0x47')](handleError(_0x2c09f1,null));};exports[_0x96e1('0x48')]=function(_0x31a1f3,_0x16b3e9){return db[_0x96e1('0x2a')][_0x96e1('0x48')](_0x31a1f3[_0x96e1('0x49')],{})[_0x96e1('0x23')](respondWithResult(_0x16b3e9,0xc9))[_0x96e1('0x47')](handleError(_0x16b3e9,null));};exports[_0x96e1('0x22')]=function(_0x8544c,_0x16fef4){if(_0x8544c[_0x96e1('0x49')]['id']){delete _0x8544c['body']['id'];}return db[_0x96e1('0x2a')]['find']({'where':{'id':_0x8544c['params']['id']}})[_0x96e1('0x23')](handleEntityNotFound(_0x16fef4,null))[_0x96e1('0x23')](saveUpdates(_0x8544c[_0x96e1('0x49')],null))[_0x96e1('0x23')](respondWithResult(_0x16fef4,null))['catch'](handleError(_0x16fef4,null));};exports[_0x96e1('0x4a')]=function(_0x536251,_0x372f5f){return db[_0x96e1('0x2a')][_0x96e1('0x46')]({'where':{'id':_0x536251[_0x96e1('0x45')]['id']}})[_0x96e1('0x23')](handleEntityNotFound(_0x372f5f,null))['then'](removeEntity(_0x372f5f,null))[_0x96e1('0x47')](handleError(_0x372f5f,null));};exports[_0x96e1('0x4b')]=function(_0x313344,_0x3ac8cb,_0x123a36){return db[_0x96e1('0x2a')][_0x96e1('0x46')]({'where':{'id':_0x313344[_0x96e1('0x45')]['id']},'attributes':['id','recording',_0x96e1('0x4c')]})[_0x96e1('0x23')](handleEntityNotFound(_0x3ac8cb,null))['then'](function(_0x280283){if(_0x280283){if(!_0x280283[_0x96e1('0x4d')]){throw new db['Sequelize'][(_0x96e1('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0x5a9c4c={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x280283[_0x96e1('0x4c')]){_0x5a9c4c[_0x96e1('0x4f')]='attachment;\x20filename=\x22'+_0x280283['msg_id']+_0x96e1('0x50');}_0x3ac8cb['set'](_0x5a9c4c);return _0x3ac8cb['send'](new Buffer(_0x280283[_0x96e1('0x4d')]));}})['catch'](handleError(_0x3ac8cb,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index bc80c48..4831136 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 _0xac46=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x2e785e,_0x232c0a){var _0x230f26=function(_0x55570a){while(--_0x55570a){_0x2e785e['push'](_0x2e785e['shift']());}};_0x230f26(++_0x232c0a);}(_0xac46,0x197));var _0x6ac4=function(_0x2dbedc,_0x402eb4){_0x2dbedc=_0x2dbedc-0x0;var _0x56f0c3=_0xac46[_0x2dbedc];return _0x56f0c3;};'use strict';var _=require(_0x6ac4('0x0'));var util=require(_0x6ac4('0x1'));var logger=require(_0x6ac4('0x2'))(_0x6ac4('0x3'));var moment=require(_0x6ac4('0x4'));var BPromise=require(_0x6ac4('0x5'));var rp=require(_0x6ac4('0x6'));var fs=require('fs');var path=require(_0x6ac4('0x7'));var rimraf=require('rimraf');var config=require(_0x6ac4('0x8'));var attributes=require(_0x6ac4('0x9'));module['exports']=function(_0xe61b5d,_0x904154){return _0xe61b5d[_0x6ac4('0xa')](_0x6ac4('0xb'),attributes,{'tableName':_0x6ac4('0xc'),'paranoid':![],'indexes':[{'name':_0x6ac4('0xd'),'fields':[_0x6ac4('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1514=['exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0xd5d454,_0x5397e4){var _0x2415d0=function(_0x137c7b){while(--_0x137c7b){_0xd5d454['push'](_0xd5d454['shift']());}};_0x2415d0(++_0x5397e4);}(_0x1514,0x122));var _0x4151=function(_0x1ee5ab,_0x4f8777){_0x1ee5ab=_0x1ee5ab-0x0;var _0x3305b2=_0x1514[_0x1ee5ab];return _0x3305b2;};'use strict';var _=require(_0x4151('0x0'));var util=require(_0x4151('0x1'));var logger=require('../../config/logger')(_0x4151('0x2'));var moment=require(_0x4151('0x3'));var BPromise=require('bluebird');var rp=require(_0x4151('0x4'));var fs=require('fs');var path=require(_0x4151('0x5'));var rimraf=require(_0x4151('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x4151('0x7')]=function(_0x55d610,_0x2a4774){return _0x55d610['define'](_0x4151('0x8'),attributes,{'tableName':_0x4151('0x9'),'paranoid':![],'indexes':[{'name':_0x4151('0xa'),'fields':[_0x4151('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 3f82f43..78bb99b 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 _0xe5b7=['code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x242bd0,_0x3d8679){var _0x526ca1=function(_0x41a4c0){while(--_0x41a4c0){_0x242bd0['push'](_0x242bd0['shift']());}};_0x526ca1(++_0x3d8679);}(_0xe5b7,0x1bd));var _0x7e5b=function(_0x12029c,_0x3b391a){_0x12029c=_0x12029c-0x0;var _0x561497=_0xe5b7[_0x12029c];return _0x561497;};'use strict';var _=require(_0x7e5b('0x0'));var util=require(_0x7e5b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7e5b('0x2'));var fs=require('fs');var Redis=require(_0x7e5b('0x3'));var db=require(_0x7e5b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e5b('0x5'))(_0x7e5b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e5b('0x7')][_0x7e5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x230d95,_0x40556d,_0x541d0a){return new BPromise(function(_0x28895a,_0x12a929){return client['request'](_0x230d95,_0x541d0a)[_0x7e5b('0x9')](function(_0x2632a0){logger[_0x7e5b('0xa')](_0x7e5b('0xb'),_0x40556d,'request\x20sent');logger[_0x7e5b('0xc')](_0x7e5b('0xd'),_0x40556d,_0x7e5b('0xe'),JSON[_0x7e5b('0xf')](_0x2632a0));if(_0x2632a0['error']){if(_0x2632a0[_0x7e5b('0x10')][_0x7e5b('0x11')]===0x1f4){logger['error'](_0x7e5b('0xb'),_0x40556d,_0x2632a0['error']['message']);return _0x12a929(_0x2632a0[_0x7e5b('0x10')][_0x7e5b('0x12')]);}logger['error'](_0x7e5b('0xb'),_0x40556d,_0x2632a0[_0x7e5b('0x10')]['message']);return _0x28895a(_0x2632a0[_0x7e5b('0x10')][_0x7e5b('0x12')]);}else{logger[_0x7e5b('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x40556d,_0x7e5b('0xe'));_0x28895a(_0x2632a0[_0x7e5b('0x13')][_0x7e5b('0x12')]);}})[_0x7e5b('0x14')](function(_0x3b1d6f){logger[_0x7e5b('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x40556d,_0x3b1d6f);_0x12a929(_0x3b1d6f);});});} \ No newline at end of file +var _0x220b=['request\x20sent','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x40650c,_0x4344e5){var _0x2efa5a=function(_0x3e6267){while(--_0x3e6267){_0x40650c['push'](_0x40650c['shift']());}};_0x2efa5a(++_0x4344e5);}(_0x220b,0x1a1));var _0xb220=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x220b[_0x4ae625];return _0x31accf;};'use strict';var _=require('lodash');var util=require(_0xb220('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb220('0x1'));var fs=require('fs');var Redis=require(_0xb220('0x2'));var db=require(_0xb220('0x3'))['db'];var utils=require(_0xb220('0x4'));var logger=require('../../config/logger')(_0xb220('0x5'));var config=require(_0xb220('0x6'));var jayson=require(_0xb220('0x7'));var client=jayson[_0xb220('0x8')][_0xb220('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2aef73,_0x46b617,_0x4ab250){return new BPromise(function(_0x12b4a1,_0x353bc2){return client[_0xb220('0xa')](_0x2aef73,_0x4ab250)[_0xb220('0xb')](function(_0x53f980){logger['info'](_0xb220('0xc'),_0x46b617,'request\x20sent');logger[_0xb220('0xd')](_0xb220('0xe'),_0x46b617,'request\x20sent',JSON[_0xb220('0xf')](_0x53f980));if(_0x53f980[_0xb220('0x10')]){if(_0x53f980[_0xb220('0x10')][_0xb220('0x11')]===0x1f4){logger[_0xb220('0x10')](_0xb220('0xc'),_0x46b617,_0x53f980[_0xb220('0x10')][_0xb220('0x12')]);return _0x353bc2(_0x53f980[_0xb220('0x10')]['message']);}logger[_0xb220('0x10')](_0xb220('0xc'),_0x46b617,_0x53f980[_0xb220('0x10')][_0xb220('0x12')]);return _0x12b4a1(_0x53f980[_0xb220('0x10')][_0xb220('0x12')]);}else{logger[_0xb220('0x13')](_0xb220('0xc'),_0x46b617,_0xb220('0x14'));_0x12b4a1(_0x53f980[_0xb220('0x15')][_0xb220('0x12')]);}})[_0xb220('0x16')](function(_0x328984){logger[_0xb220('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x46b617,_0x328984);_0x353bc2(_0x328984);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 7646999..de5fd65 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 _0x09e5=['exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','addSound','put','update','delete','/:id/sounds/:id2','removeSound'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0x09e5,0x1b9));var _0x509e=function(_0xb8da7d,_0xe8252){_0xb8da7d=_0xb8da7d-0x0;var _0x596b7e=_0x09e5[_0xb8da7d];return _0x596b7e;};'use strict';var multer=require(_0x509e('0x0'));var util=require(_0x509e('0x1'));var path=require(_0x509e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x509e('0x3'));var auth=require(_0x509e('0x4'));var interaction=require(_0x509e('0x5'));var config=require(_0x509e('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x509e('0x7')]('/',auth[_0x509e('0x8')](),controller['index']);router[_0x509e('0x7')](_0x509e('0x9'),auth[_0x509e('0x8')](),controller['show']);router[_0x509e('0x7')](_0x509e('0xa'),auth[_0x509e('0x8')](),controller[_0x509e('0xb')]);router[_0x509e('0xc')]('/',auth[_0x509e('0x8')](),controller['create']);router[_0x509e('0xc')](_0x509e('0xa'),auth[_0x509e('0x8')](),controller[_0x509e('0xd')]);router[_0x509e('0xe')]('/:id',auth[_0x509e('0x8')](),controller[_0x509e('0xf')]);router[_0x509e('0x10')](_0x509e('0x9'),auth[_0x509e('0x8')](),controller['destroy']);router['delete'](_0x509e('0x11'),auth['isAuthenticated'](),controller[_0x509e('0x12')]);module[_0x509e('0x13')]=router; \ No newline at end of file +var _0x0a1b=['destroy','/:id/sounds/:id2','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds','post','create','addSound','put','update','delete'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0a1b,0x9d));var _0xb0a1=function(_0x170633,_0x2a65f0){_0x170633=_0x170633-0x0;var _0x1419a7=_0x0a1b[_0x170633];return _0x1419a7;};'use strict';var multer=require(_0xb0a1('0x0'));var util=require(_0xb0a1('0x1'));var path=require(_0xb0a1('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0a1('0x3'));var router=express['Router']();var fs_extra=require(_0xb0a1('0x4'));var auth=require(_0xb0a1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb0a1('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xb0a1('0x7')]('/',auth[_0xb0a1('0x8')](),controller[_0xb0a1('0x9')]);router[_0xb0a1('0x7')](_0xb0a1('0xa'),auth[_0xb0a1('0x8')](),controller[_0xb0a1('0xb')]);router[_0xb0a1('0x7')](_0xb0a1('0xc'),auth[_0xb0a1('0x8')](),controller['getSounds']);router[_0xb0a1('0xd')]('/',auth[_0xb0a1('0x8')](),controller[_0xb0a1('0xe')]);router['post'](_0xb0a1('0xc'),auth[_0xb0a1('0x8')](),controller[_0xb0a1('0xf')]);router[_0xb0a1('0x10')](_0xb0a1('0xa'),auth[_0xb0a1('0x8')](),controller[_0xb0a1('0x11')]);router[_0xb0a1('0x12')]('/:id',auth[_0xb0a1('0x8')](),controller[_0xb0a1('0x13')]);router[_0xb0a1('0x12')](_0xb0a1('0x14'),auth[_0xb0a1('0x8')](),controller['removeSound']);module[_0xb0a1('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 493af4c..17a6982 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 _0x5eef=['quietmp3','mp3','files','STRING','alpha','BOOLEAN','sequelize','name','ENUM','custom','quietmp3nb'];(function(_0x2aa733,_0xcde568){var _0x2bcf85=function(_0x5d9358){while(--_0x5d9358){_0x2aa733['push'](_0x2aa733['shift']());}};_0x2bcf85(++_0xcde568);}(_0x5eef,0x7f));var _0xf5ee=function(_0x33d07d,_0x563047){_0x33d07d=_0x33d07d-0x0;var _0x2c5ea4=_0x5eef[_0x33d07d];return _0x2c5ea4;};'use strict';var Sequelize=require(_0xf5ee('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf5ee('0x1')},'mode':{'type':Sequelize[_0xf5ee('0x2')](_0xf5ee('0x3'),'files','mp3nb',_0xf5ee('0x4'),_0xf5ee('0x5'),_0xf5ee('0x6')),'allowNull':!![],'defaultValue':_0xf5ee('0x7')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xf5ee('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf5ee('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf5ee('0x8')],'allowNull':!![],'defaultValue':_0xf5ee('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xf5ee('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa083=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','mp3','alpha'];(function(_0x100331,_0x296d8b){var _0x3b43d1=function(_0x505ac8){while(--_0x505ac8){_0x100331['push'](_0x100331['shift']());}};_0x3b43d1(++_0x296d8b);}(_0xa083,0x120));var _0x3a08=function(_0x3ff0ca,_0x1f9755){_0x3ff0ca=_0x3ff0ca-0x0;var _0x2e444c=_0xa083[_0x3ff0ca];return _0x2e444c;};'use strict';var Sequelize=require(_0x3a08('0x0'));module[_0x3a08('0x1')]={'name':{'type':Sequelize[_0x3a08('0x2')],'allowNull':![],'unique':_0x3a08('0x3')},'mode':{'type':Sequelize[_0x3a08('0x4')](_0x3a08('0x5'),_0x3a08('0x6'),_0x3a08('0x7'),_0x3a08('0x8'),'quietmp3',_0x3a08('0x9')),'allowNull':!![],'defaultValue':_0x3a08('0x6')},'directory':{'type':Sequelize[_0x3a08('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x3a08('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x3a08('0x2')],'allowNull':!![],'defaultValue':_0x3a08('0xa')},'format':{'type':Sequelize[_0x3a08('0x2')],'allowNull':!![]},'stamp':{'type':_0x3a08('0xb')},'defaultEntry':{'type':Sequelize[_0x3a08('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 c377857..8f02639 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 _0x0ce5=['stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceMusicOnHold','count','includeAll','include','findAll','show','options','catch','body','find','params','create','sequelize','transaction','mode','files','server/files/moh','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MusicOnHolds','autoAssociation','readdirSync','directory','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','removeSound','id2','findOne','getSounds','pick','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','error'];(function(_0x32debd,_0x256dc7){var _0x4f92c8=function(_0x42d073){while(--_0x42d073){_0x32debd['push'](_0x32debd['shift']());}};_0x4f92c8(++_0x256dc7);}(_0x0ce5,0x1a7));var _0x50ce=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x0ce5[_0xd22d95];return _0x15d7a3;};'use strict';var emlformat=require(_0x50ce('0x0'));var rimraf=require(_0x50ce('0x1'));var zipdir=require(_0x50ce('0x2'));var jsonpatch=require(_0x50ce('0x3'));var rp=require('request-promise');var moment=require(_0x50ce('0x4'));var BPromise=require(_0x50ce('0x5'));var Mustache=require(_0x50ce('0x6'));var util=require(_0x50ce('0x7'));var path=require('path');var sox=require(_0x50ce('0x8'));var csv=require(_0x50ce('0x9'));var ejs=require(_0x50ce('0xa'));var fs=require('fs');var fs_extra=require(_0x50ce('0xb'));var _=require(_0x50ce('0xc'));var squel=require(_0x50ce('0xd'));var crypto=require(_0x50ce('0xe'));var jsforce=require(_0x50ce('0xf'));var deskjs=require(_0x50ce('0x10'));var toCsv=require('to-csv');var querystring=require(_0x50ce('0x11'));var Papa=require(_0x50ce('0x12'));var Redis=require(_0x50ce('0x13'));var authService=require(_0x50ce('0x14'));var qs=require(_0x50ce('0x15'));var as=require(_0x50ce('0x16'));var hardwareService=require(_0x50ce('0x17'));var logger=require(_0x50ce('0x18'))(_0x50ce('0x19'));var utils=require(_0x50ce('0x1a'));var config=require(_0x50ce('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x50ce('0x1c'))['db'];function respondWithStatusCode(_0x250db0,_0x5ae0aa){_0x5ae0aa=_0x5ae0aa||0xcc;return function(_0x6b9998){if(_0x6b9998){return _0x250db0[_0x50ce('0x1d')](_0x5ae0aa);}return _0x250db0[_0x50ce('0x1e')](_0x5ae0aa)[_0x50ce('0x1f')]();};}function respondWithResult(_0x9f81e9,_0x277ecb){_0x277ecb=_0x277ecb||0xc8;return function(_0x2952a7){if(_0x2952a7){return _0x9f81e9[_0x50ce('0x1e')](_0x277ecb)['json'](_0x2952a7);}};}function respondWithFilteredResult(_0x4e6f91,_0x5c728d){return function(_0x27bfbb){if(_0x27bfbb){var _0xa3d5b5=typeof _0x5c728d['offset']===_0x50ce('0x20')&&typeof _0x5c728d[_0x50ce('0x21')]===_0x50ce('0x20');var _0x134c7f=_0x27bfbb['count'];var _0x413674=_0xa3d5b5?0x0:_0x5c728d[_0x50ce('0x22')];var _0x8680b7=_0xa3d5b5?_0x27bfbb['count']:_0x5c728d['offset']+_0x5c728d[_0x50ce('0x21')];var _0xaeed50;if(_0x8680b7>=_0x134c7f){_0x8680b7=_0x134c7f;_0xaeed50=0xc8;}else{_0xaeed50=0xce;}_0x4e6f91[_0x50ce('0x1e')](_0xaeed50);return _0x4e6f91[_0x50ce('0x23')](_0x50ce('0x24'),_0x413674+'-'+_0x8680b7+'/'+_0x134c7f)[_0x50ce('0x25')](_0x27bfbb);}return null;};}function patchUpdates(_0x1e766e){return function(_0x47255e){try{jsonpatch[_0x50ce('0x26')](_0x47255e,_0x1e766e,!![]);}catch(_0xbbcfbe){return BPromise[_0x50ce('0x27')](_0xbbcfbe);}return _0x47255e[_0x50ce('0x28')]();};}function saveUpdates(_0x2a3184,_0x59c314){return function(_0x1fef69){if(_0x1fef69){return _0x1fef69[_0x50ce('0x29')](_0x2a3184)['then'](function(_0x3263ae){return _0x3263ae;});}return null;};}function removeEntity(_0xdc35ae,_0x5ea942){return function(_0x3b9f89){if(_0x3b9f89){return _0x3b9f89[_0x50ce('0x2a')]()[_0x50ce('0x2b')](function(){var _0x45865a=_0x3b9f89['get']({'plain':!![]});var _0x1256d6='MusicOnHolds';return db['UserProfileResource'][_0x50ce('0x2a')]({'where':{'type':_0x1256d6,'resourceId':_0x45865a['id']}})[_0x50ce('0x2b')](function(){return _0x3b9f89;});})[_0x50ce('0x2b')](function(){_0xdc35ae[_0x50ce('0x1e')](0xcc)[_0x50ce('0x1f')]();});}};}function handleEntityNotFound(_0x52ff46,_0xd16cc9){return function(_0x2a9c72){if(!_0x2a9c72){_0x52ff46[_0x50ce('0x1d')](0x194);}return _0x2a9c72;};}function handleError(_0x2956db,_0x175460){_0x175460=_0x175460||0x1f4;return function(_0x224afb){logger[_0x50ce('0x2c')](_0x224afb[_0x50ce('0x2d')]);if(_0x224afb[_0x50ce('0x2e')]){delete _0x224afb['name'];}_0x2956db[_0x50ce('0x1e')](_0x175460)[_0x50ce('0x2f')](_0x224afb);};}exports['index']=function(_0x365a6c,_0x1b5abb){var _0xebb10b={},_0x194a99={},_0x469bc1={'count':0x0,'rows':[]};var _0x11c64c=_[_0x50ce('0x30')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x4e7b5b){return{'name':_0x4e7b5b[_0x50ce('0x31')],'type':_0x4e7b5b[_0x50ce('0x32')][_0x50ce('0x33')]};});_0x194a99[_0x50ce('0x34')]=_['map'](_0x11c64c,'name');_0x194a99[_0x50ce('0x35')]=_[_0x50ce('0x36')](_0x365a6c['query']);_0x194a99[_0x50ce('0x37')]=_[_0x50ce('0x38')](_0x194a99[_0x50ce('0x34')],_0x194a99[_0x50ce('0x35')]);_0xebb10b[_0x50ce('0x39')]=_[_0x50ce('0x38')](_0x194a99[_0x50ce('0x34')],qs[_0x50ce('0x3a')](_0x365a6c[_0x50ce('0x35')][_0x50ce('0x3a')]));_0xebb10b[_0x50ce('0x39')]=_0xebb10b['attributes'][_0x50ce('0x3b')]?_0xebb10b[_0x50ce('0x39')]:_0x194a99['model'];if(!_0x365a6c[_0x50ce('0x35')]['hasOwnProperty'](_0x50ce('0x3c'))){_0xebb10b[_0x50ce('0x21')]=qs['limit'](_0x365a6c[_0x50ce('0x35')][_0x50ce('0x21')]);_0xebb10b[_0x50ce('0x22')]=qs['offset'](_0x365a6c[_0x50ce('0x35')]['offset']);}_0xebb10b[_0x50ce('0x3d')]=qs[_0x50ce('0x3e')](_0x365a6c[_0x50ce('0x35')][_0x50ce('0x3e')]);delete _0x365a6c[_0x50ce('0x35')][_0x50ce('0x3e')];_0xebb10b[_0x50ce('0x3f')]=qs['filters'](_['pick'](_0x365a6c['query'],_0x194a99[_0x50ce('0x37')]),_0x11c64c);if(_0x365a6c[_0x50ce('0x35')][_0x50ce('0x40')]){_0xebb10b[_0x50ce('0x3f')]=_[_0x50ce('0x41')](_0xebb10b['where'],{'$or':_['map'](_0x11c64c,function(_0x2c9cd8){if(_0x2c9cd8['type']!==_0x50ce('0x42')){var _0x15a4ff={};_0x15a4ff[_0x2c9cd8[_0x50ce('0x2e')]]={'$like':'%'+_0x365a6c[_0x50ce('0x35')]['filter']+'%'};return _0x15a4ff;}})});}_0xebb10b=_[_0x50ce('0x41')]({},_0xebb10b,_0x365a6c['options']);var _0x4fcd0d={'where':_0xebb10b['where']};return db[_0x50ce('0x43')][_0x50ce('0x44')](_0x4fcd0d)[_0x50ce('0x2b')](function(_0x46998d){_0x469bc1['count']=_0x46998d;if(_0x365a6c[_0x50ce('0x35')][_0x50ce('0x45')]){_0xebb10b[_0x50ce('0x46')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x50ce('0x47')](_0xebb10b);})['then'](function(_0x5ccecd){_0x469bc1['rows']=_0x5ccecd;return _0x469bc1;})[_0x50ce('0x2b')](respondWithFilteredResult(_0x1b5abb,_0xebb10b))['catch'](handleError(_0x1b5abb,null));};exports[_0x50ce('0x48')]=function(_0x1ec199,_0x382926){var _0x2e6e9f={'raw':![],'where':{'id':_0x1ec199['params']['id']}},_0x16b4a6={};_0x16b4a6[_0x50ce('0x34')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x16b4a6[_0x50ce('0x35')]=_[_0x50ce('0x36')](_0x1ec199[_0x50ce('0x35')]);_0x16b4a6[_0x50ce('0x37')]=_[_0x50ce('0x38')](_0x16b4a6[_0x50ce('0x34')],_0x16b4a6[_0x50ce('0x35')]);_0x2e6e9f[_0x50ce('0x39')]=_[_0x50ce('0x38')](_0x16b4a6[_0x50ce('0x34')],qs[_0x50ce('0x3a')](_0x1ec199[_0x50ce('0x35')][_0x50ce('0x3a')]));_0x2e6e9f['attributes']=_0x2e6e9f[_0x50ce('0x39')][_0x50ce('0x3b')]?_0x2e6e9f['attributes']:_0x16b4a6['model'];if(_0x1ec199[_0x50ce('0x35')][_0x50ce('0x45')]){_0x2e6e9f['include']=[{'all':!![]}];}_0x2e6e9f=_[_0x50ce('0x41')]({},_0x2e6e9f,_0x1ec199[_0x50ce('0x49')]);return db[_0x50ce('0x43')]['find'](_0x2e6e9f)[_0x50ce('0x2b')](handleEntityNotFound(_0x382926,null))[_0x50ce('0x2b')](respondWithResult(_0x382926,null))[_0x50ce('0x4a')](handleError(_0x382926,null));};exports[_0x50ce('0x29')]=function(_0x386a4a,_0x22452a){if(_0x386a4a[_0x50ce('0x4b')]['id']){delete _0x386a4a[_0x50ce('0x4b')]['id'];}return db[_0x50ce('0x43')][_0x50ce('0x4c')]({'where':{'id':_0x386a4a[_0x50ce('0x4d')]['id']}})[_0x50ce('0x2b')](handleEntityNotFound(_0x22452a,null))[_0x50ce('0x2b')](saveUpdates(_0x386a4a[_0x50ce('0x4b')],null))[_0x50ce('0x2b')](respondWithResult(_0x22452a,null))[_0x50ce('0x4a')](handleError(_0x22452a,null));};exports[_0x50ce('0x4e')]=function(_0x373a6a,_0x4186da,_0x17863b){return db[_0x50ce('0x4f')][_0x50ce('0x50')](function(_0x505dff){if(_0x373a6a[_0x50ce('0x4b')][_0x50ce('0x51')]===_0x50ce('0x52')){_0x373a6a[_0x50ce('0x4b')]['directory']=path['join'](config['root'],_0x50ce('0x53'),_0x373a6a[_0x50ce('0x4b')]['name']);}return db[_0x50ce('0x43')][_0x50ce('0x4e')](_0x373a6a[_0x50ce('0x4b')],{'transaction':_0x505dff})[_0x50ce('0x2b')](function(_0x198c5d){if(_0x373a6a[_0x50ce('0x4b')][_0x50ce('0x51')]==='files'){fs['mkdirSync'](_0x198c5d['directory'],parseInt(_0x50ce('0x54'),0x8));}var _0x3e04f0=_0x373a6a[_0x50ce('0x55')][_0x50ce('0x56')]({'plain':!![]});if(!_0x3e04f0)throw new Error(_0x50ce('0x57'));if(_0x3e04f0['role']===_0x50ce('0x55')){var _0x30845b=_0x198c5d[_0x50ce('0x56')]({'plain':!![]});return db[_0x50ce('0x58')][_0x50ce('0x4c')]({'where':{'name':_0x50ce('0x59'),'userProfileId':_0x3e04f0['userProfileId']},'raw':!![]})[_0x50ce('0x2b')](function(_0x4a851a){if(_0x4a851a&&_0x4a851a[_0x50ce('0x5a')]===0x0){return db['UserProfileResource'][_0x50ce('0x4e')]({'name':_0x30845b[_0x50ce('0x2e')],'resourceId':_0x30845b['id'],'type':_0x4a851a['name'],'sectionId':_0x4a851a['id']},{})['then'](function(){return _0x198c5d;});}else{return _0x198c5d;}})[_0x50ce('0x4a')](function(_0x8f1842){logger[_0x50ce('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8f1842);});}return _0x198c5d;});})[_0x50ce('0x2b')](respondWithResult(_0x4186da,0xc9))[_0x50ce('0x4a')](handleError(_0x4186da,null));};exports['destroy']=function(_0x3ead89,_0x308995,_0x42608c){var _0x51bd6b;return db[_0x50ce('0x43')][_0x50ce('0x4c')]({'where':{'id':_0x3ead89[_0x50ce('0x4d')]['id']}})[_0x50ce('0x2b')](function(_0x15b704){if(_0x15b704){return db[_0x50ce('0x4f')][_0x50ce('0x50')](function(_0x320753){return _0x15b704['destroy']({'transaction':_0x320753,'raw':!![]})[_0x50ce('0x2b')](function(_0x2588e5){if(_0x2588e5['directory']){fs[_0x50ce('0x5b')](_0x2588e5[_0x50ce('0x5c')])[_0x50ce('0x5d')](function(_0x6705c1){fs[_0x50ce('0x5e')](path[_0x50ce('0x5f')](_0x2588e5[_0x50ce('0x5c')],_0x6705c1));});fs[_0x50ce('0x60')](_0x2588e5['directory']);}return _0x2588e5;});})['catch'](function(_0x185c5b){throw new db[(_0x50ce('0x61'))][(_0x50ce('0x62'))](_0x185c5b[_0x50ce('0x63')]);});}})[_0x50ce('0x2b')](handleEntityNotFound(_0x308995,null))[_0x50ce('0x2b')](removeEntity(_0x308995,null))[_0x50ce('0x4a')](handleError(_0x308995,null));};exports[_0x50ce('0x64')]=function(_0x3c28cc,_0x5631ef,_0x2fd513){return db[_0x50ce('0x4f')]['transaction'](function(_0x61a15f){var _0x418d25;return db[_0x50ce('0x43')][_0x50ce('0x4c')]({'where':{'id':_0x3c28cc[_0x50ce('0x4d')]['id']}})[_0x50ce('0x2b')](function(_0x3d209a){if(_0x3d209a){_0x418d25=_0x3d209a;return _0x3d209a['addSound'](_0x3c28cc[_0x50ce('0x4b')]['id'],{'transaction':_0x61a15f});}})[_0x50ce('0x2b')](function(_0x3e6f25){if(_0x3e6f25){return db[_0x50ce('0x65')]['findOne']({'where':{'id':_0x3c28cc[_0x50ce('0x4b')]['id']},'attributes':['id',_0x50ce('0x2e'),'save_name',_0x50ce('0x66'),_0x50ce('0x67')],'raw':!![]});}})[_0x50ce('0x2b')](function(_0x33cef4){if(_0x33cef4){var _0x2721bc=path[_0x50ce('0x5f')](config[_0x50ce('0x68')],_0x50ce('0x69'),util[_0x50ce('0x6a')](_0x50ce('0x6b'),path[_0x50ce('0x6c')](_0x33cef4[_0x50ce('0x6d')],path[_0x50ce('0x6e')](_0x33cef4[_0x50ce('0x6d')])),_0x33cef4[_0x50ce('0x66')]));var _0x5358e3=path[_0x50ce('0x5f')](config[_0x50ce('0x68')],_0x50ce('0x53'),_0x418d25[_0x50ce('0x2e')],util[_0x50ce('0x6a')](_0x50ce('0x6b'),_0x33cef4['name'],_0x33cef4[_0x50ce('0x66')]));fs['symlinkSync'](_0x2721bc,_0x5358e3);return _0x33cef4;}})[_0x50ce('0x4a')](function(_0x8bfaab){throw new db[(_0x50ce('0x61'))]['ValidationError'](_0x8bfaab['message']);});})[_0x50ce('0x2b')](handleEntityNotFound(_0x5631ef,null))[_0x50ce('0x2b')](respondWithResult(_0x5631ef,0xc9))[_0x50ce('0x4a')](handleError(_0x5631ef,null));};exports[_0x50ce('0x6f')]=function(_0x7527a1,_0x1cdc95,_0x4fd25f){return db[_0x50ce('0x4f')][_0x50ce('0x50')](function(_0x3bd072){var _0x53212a;return db[_0x50ce('0x43')]['findOne']({'where':{'id':_0x7527a1[_0x50ce('0x4d')]['id']}})[_0x50ce('0x2b')](handleEntityNotFound(_0x1cdc95,null))['then'](function(_0x31758d){if(_0x31758d){_0x53212a=_0x31758d;return _0x31758d['removeSound'](_0x7527a1[_0x50ce('0x4d')][_0x50ce('0x70')]);}})[_0x50ce('0x2b')](function(_0x48dd1b){if(_0x48dd1b){return db[_0x50ce('0x65')][_0x50ce('0x71')]({'where':{'id':_0x7527a1[_0x50ce('0x4d')][_0x50ce('0x70')]},'attributes':['id',_0x50ce('0x2e'),_0x50ce('0x6d'),_0x50ce('0x66'),_0x50ce('0x67')],'raw':!![]});}})['then'](function(_0xed8e8c){if(_0xed8e8c){fs['unlinkSync'](path[_0x50ce('0x5f')](_0x53212a[_0x50ce('0x5c')],util[_0x50ce('0x6a')](_0x50ce('0x6b'),_0xed8e8c[_0x50ce('0x2e')],_0xed8e8c[_0x50ce('0x66')])));return _0xed8e8c;}})[_0x50ce('0x4a')](function(_0x44035a){throw new db[(_0x50ce('0x61'))][(_0x50ce('0x62'))](_0x44035a[_0x50ce('0x63')]);});})[_0x50ce('0x2b')](handleEntityNotFound(_0x1cdc95,null))['then'](respondWithStatusCode(_0x1cdc95,0xcc))[_0x50ce('0x4a')](handleError(_0x1cdc95,null));};exports[_0x50ce('0x72')]=function(_0x2d648e,_0x3a9999,_0x415829){var _0xd4cef8={};var _0x58a82b={};var _0xd99db9;var _0x177470;return db[_0x50ce('0x43')][_0x50ce('0x71')]({'where':{'id':_0x2d648e[_0x50ce('0x4d')]['id']}})[_0x50ce('0x2b')](handleEntityNotFound(_0x3a9999,null))[_0x50ce('0x2b')](function(_0x5b1311){if(_0x5b1311){_0xd99db9=_0x5b1311;_0x58a82b[_0x50ce('0x34')]=_[_0x50ce('0x36')](db[_0x50ce('0x65')]['rawAttributes']);_0x58a82b[_0x50ce('0x35')]=_['keys'](_0x2d648e[_0x50ce('0x35')]);_0x58a82b[_0x50ce('0x37')]=_[_0x50ce('0x38')](_0x58a82b[_0x50ce('0x34')],_0x58a82b[_0x50ce('0x35')]);_0xd4cef8['attributes']=_['intersection'](_0x58a82b[_0x50ce('0x34')],qs[_0x50ce('0x3a')](_0x2d648e[_0x50ce('0x35')][_0x50ce('0x3a')]));_0xd4cef8[_0x50ce('0x39')]=_0xd4cef8[_0x50ce('0x39')][_0x50ce('0x3b')]?_0xd4cef8[_0x50ce('0x39')]:_0x58a82b[_0x50ce('0x34')];_0xd4cef8[_0x50ce('0x3d')]=qs['sort'](_0x2d648e[_0x50ce('0x35')][_0x50ce('0x3e')]);_0xd4cef8['where']=qs[_0x50ce('0x37')](_[_0x50ce('0x73')](_0x2d648e[_0x50ce('0x35')],_0x58a82b[_0x50ce('0x37')]));if(_0x2d648e[_0x50ce('0x35')][_0x50ce('0x40')]){_0xd4cef8[_0x50ce('0x3f')]=_[_0x50ce('0x41')](_0xd4cef8[_0x50ce('0x3f')],{'$or':_[_0x50ce('0x30')](_0xd4cef8[_0x50ce('0x39')],function(_0x153571){var _0x5558b1={};_0x5558b1[_0x153571]={'$like':'%'+_0x2d648e['query'][_0x50ce('0x40')]+'%'};return _0x5558b1;})});}_0xd4cef8=_[_0x50ce('0x41')]({},_0xd4cef8,_0x2d648e['options']);return _0xd99db9[_0x50ce('0x72')](_0xd4cef8);}})[_0x50ce('0x2b')](function(_0x524c51){if(_0x524c51){_0x177470=_0x524c51[_0x50ce('0x3b')];if(!_0x2d648e[_0x50ce('0x35')][_0x50ce('0x74')](_0x50ce('0x3c'))){_0xd4cef8['limit']=qs[_0x50ce('0x21')](_0x2d648e[_0x50ce('0x35')][_0x50ce('0x21')]);_0xd4cef8['offset']=qs[_0x50ce('0x22')](_0x2d648e[_0x50ce('0x35')][_0x50ce('0x22')]);}return _0xd99db9[_0x50ce('0x72')](_0xd4cef8);}})[_0x50ce('0x2b')](function(_0x1c9553){if(_0x1c9553){return _0x1c9553?{'count':_0x177470,'rows':_0x1c9553}:null;}})[_0x50ce('0x2b')](respondWithResult(_0x3a9999,null))[_0x50ce('0x4a')](handleError(_0x3a9999,null));}; \ No newline at end of file +var _0x80d4=['0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','root','%s.%s','basename','extname','server/files/moh','format','converted_format','symlinkSync','removeSound','getSounds','length','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','rows','catch','show','body','find','params','create','transaction','files','directory','join','mkdirSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80d4,0x100));var _0x480d=function(_0x5aa6b2,_0x153315){_0x5aa6b2=_0x5aa6b2-0x0;var _0x37ac98=_0x80d4[_0x5aa6b2];return _0x37ac98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x480d('0x0'));var zipdir=require(_0x480d('0x1'));var jsonpatch=require(_0x480d('0x2'));var rp=require(_0x480d('0x3'));var moment=require(_0x480d('0x4'));var BPromise=require(_0x480d('0x5'));var Mustache=require(_0x480d('0x6'));var util=require(_0x480d('0x7'));var path=require('path');var sox=require(_0x480d('0x8'));var csv=require('to-csv');var ejs=require(_0x480d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x480d('0xa'));var crypto=require(_0x480d('0xb'));var jsforce=require(_0x480d('0xc'));var deskjs=require(_0x480d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x480d('0xe'));var authService=require(_0x480d('0xf'));var qs=require(_0x480d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x480d('0x11'));var logger=require(_0x480d('0x12'))(_0x480d('0x13'));var utils=require(_0x480d('0x14'));var config=require(_0x480d('0x15'));var licenseUtil=require(_0x480d('0x16'));var db=require(_0x480d('0x17'))['db'];function respondWithStatusCode(_0x5a2e37,_0x3ab8af){_0x3ab8af=_0x3ab8af||0xcc;return function(_0x3e8e21){if(_0x3e8e21){return _0x5a2e37['sendStatus'](_0x3ab8af);}return _0x5a2e37[_0x480d('0x18')](_0x3ab8af)['end']();};}function respondWithResult(_0xb09b76,_0x392d01){_0x392d01=_0x392d01||0xc8;return function(_0x28c01f){if(_0x28c01f){return _0xb09b76[_0x480d('0x18')](_0x392d01)[_0x480d('0x19')](_0x28c01f);}};}function respondWithFilteredResult(_0x207e8d,_0x143147){return function(_0x4b66d7){if(_0x4b66d7){var _0x3dd0cf=typeof _0x143147[_0x480d('0x1a')]===_0x480d('0x1b')&&typeof _0x143147[_0x480d('0x1c')]===_0x480d('0x1b');var _0x448bba=_0x4b66d7[_0x480d('0x1d')];var _0x28bd09=_0x3dd0cf?0x0:_0x143147[_0x480d('0x1a')];var _0x1ba1ff=_0x3dd0cf?_0x4b66d7['count']:_0x143147[_0x480d('0x1a')]+_0x143147['limit'];var _0x2d5a5e;if(_0x1ba1ff>=_0x448bba){_0x1ba1ff=_0x448bba;_0x2d5a5e=0xc8;}else{_0x2d5a5e=0xce;}_0x207e8d[_0x480d('0x18')](_0x2d5a5e);return _0x207e8d[_0x480d('0x1e')](_0x480d('0x1f'),_0x28bd09+'-'+_0x1ba1ff+'/'+_0x448bba)['json'](_0x4b66d7);}return null;};}function patchUpdates(_0x1a11af){return function(_0x2f8445){try{jsonpatch['apply'](_0x2f8445,_0x1a11af,!![]);}catch(_0x3bb388){return BPromise['reject'](_0x3bb388);}return _0x2f8445[_0x480d('0x20')]();};}function saveUpdates(_0x49738f,_0x1ce857){return function(_0x3af71e){if(_0x3af71e){return _0x3af71e[_0x480d('0x21')](_0x49738f)[_0x480d('0x22')](function(_0x569876){return _0x569876;});}return null;};}function removeEntity(_0x148646,_0x1edf1b){return function(_0x4f5eda){if(_0x4f5eda){return _0x4f5eda[_0x480d('0x23')]()[_0x480d('0x22')](function(){var _0x2d842c=_0x4f5eda['get']({'plain':!![]});var _0x2f0f21='MusicOnHolds';return db[_0x480d('0x24')]['destroy']({'where':{'type':_0x2f0f21,'resourceId':_0x2d842c['id']}})['then'](function(){return _0x4f5eda;});})[_0x480d('0x22')](function(){_0x148646[_0x480d('0x18')](0xcc)[_0x480d('0x25')]();});}};}function handleEntityNotFound(_0x2bc93b,_0x46b8a3){return function(_0x4acce2){if(!_0x4acce2){_0x2bc93b['sendStatus'](0x194);}return _0x4acce2;};}function handleError(_0x2ea0dd,_0x25b3dd){_0x25b3dd=_0x25b3dd||0x1f4;return function(_0x56813c){logger[_0x480d('0x26')](_0x56813c[_0x480d('0x27')]);if(_0x56813c[_0x480d('0x28')]){delete _0x56813c[_0x480d('0x28')];}_0x2ea0dd['status'](_0x25b3dd)[_0x480d('0x29')](_0x56813c);};}exports[_0x480d('0x2a')]=function(_0x34e481,_0x286cc4){var _0x3c5fdf={},_0x5ef96b={},_0x8126fe={'count':0x0,'rows':[]};var _0x2a4c97=_['map'](db['VoiceMusicOnHold'][_0x480d('0x2b')],function(_0x19d631){return{'name':_0x19d631['fieldName'],'type':_0x19d631['type'][_0x480d('0x2c')]};});_0x5ef96b['model']=_[_0x480d('0x2d')](_0x2a4c97,_0x480d('0x28'));_0x5ef96b[_0x480d('0x2e')]=_[_0x480d('0x2f')](_0x34e481[_0x480d('0x2e')]);_0x5ef96b[_0x480d('0x30')]=_[_0x480d('0x31')](_0x5ef96b[_0x480d('0x32')],_0x5ef96b[_0x480d('0x2e')]);_0x3c5fdf[_0x480d('0x33')]=_['intersection'](_0x5ef96b[_0x480d('0x32')],qs['fields'](_0x34e481['query'][_0x480d('0x34')]));_0x3c5fdf[_0x480d('0x33')]=_0x3c5fdf[_0x480d('0x33')]['length']?_0x3c5fdf[_0x480d('0x33')]:_0x5ef96b[_0x480d('0x32')];if(!_0x34e481[_0x480d('0x2e')][_0x480d('0x35')](_0x480d('0x36'))){_0x3c5fdf[_0x480d('0x1c')]=qs[_0x480d('0x1c')](_0x34e481['query']['limit']);_0x3c5fdf[_0x480d('0x1a')]=qs[_0x480d('0x1a')](_0x34e481['query'][_0x480d('0x1a')]);}_0x3c5fdf[_0x480d('0x37')]=qs['sort'](_0x34e481[_0x480d('0x2e')]['sort']);delete _0x34e481[_0x480d('0x2e')][_0x480d('0x38')];_0x3c5fdf[_0x480d('0x39')]=qs[_0x480d('0x30')](_[_0x480d('0x3a')](_0x34e481[_0x480d('0x2e')],_0x5ef96b[_0x480d('0x30')]),_0x2a4c97);if(_0x34e481[_0x480d('0x2e')][_0x480d('0x3b')]){_0x3c5fdf[_0x480d('0x39')]=_[_0x480d('0x3c')](_0x3c5fdf['where'],{'$or':_[_0x480d('0x2d')](_0x2a4c97,function(_0x49b011){if(_0x49b011[_0x480d('0x3d')]!==_0x480d('0x3e')){var _0x3aa498={};_0x3aa498[_0x49b011[_0x480d('0x28')]]={'$like':'%'+_0x34e481[_0x480d('0x2e')][_0x480d('0x3b')]+'%'};return _0x3aa498;}})});}_0x3c5fdf=_['merge']({},_0x3c5fdf,_0x34e481[_0x480d('0x3f')]);var _0x198813={'where':_0x3c5fdf[_0x480d('0x39')]};return db[_0x480d('0x40')]['count'](_0x198813)[_0x480d('0x22')](function(_0x52df0d){_0x8126fe[_0x480d('0x1d')]=_0x52df0d;if(_0x34e481[_0x480d('0x2e')][_0x480d('0x41')]){_0x3c5fdf[_0x480d('0x42')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x480d('0x43')](_0x3c5fdf);})[_0x480d('0x22')](function(_0x140d03){_0x8126fe[_0x480d('0x44')]=_0x140d03;return _0x8126fe;})[_0x480d('0x22')](respondWithFilteredResult(_0x286cc4,_0x3c5fdf))[_0x480d('0x45')](handleError(_0x286cc4,null));};exports[_0x480d('0x46')]=function(_0x421a04,_0xb07e56){var _0x341136={'raw':![],'where':{'id':_0x421a04['params']['id']}},_0x1e1b69={};_0x1e1b69[_0x480d('0x32')]=_[_0x480d('0x2f')](db[_0x480d('0x40')]['rawAttributes']);_0x1e1b69[_0x480d('0x2e')]=_['keys'](_0x421a04['query']);_0x1e1b69['filters']=_[_0x480d('0x31')](_0x1e1b69[_0x480d('0x32')],_0x1e1b69[_0x480d('0x2e')]);_0x341136[_0x480d('0x33')]=_[_0x480d('0x31')](_0x1e1b69['model'],qs[_0x480d('0x34')](_0x421a04[_0x480d('0x2e')]['fields']));_0x341136[_0x480d('0x33')]=_0x341136[_0x480d('0x33')]['length']?_0x341136[_0x480d('0x33')]:_0x1e1b69[_0x480d('0x32')];if(_0x421a04[_0x480d('0x2e')][_0x480d('0x41')]){_0x341136[_0x480d('0x42')]=[{'all':!![]}];}_0x341136=_[_0x480d('0x3c')]({},_0x341136,_0x421a04[_0x480d('0x3f')]);return db[_0x480d('0x40')]['find'](_0x341136)[_0x480d('0x22')](handleEntityNotFound(_0xb07e56,null))['then'](respondWithResult(_0xb07e56,null))[_0x480d('0x45')](handleError(_0xb07e56,null));};exports[_0x480d('0x21')]=function(_0x368cad,_0x3ad3cd){if(_0x368cad[_0x480d('0x47')]['id']){delete _0x368cad[_0x480d('0x47')]['id'];}return db[_0x480d('0x40')][_0x480d('0x48')]({'where':{'id':_0x368cad[_0x480d('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ad3cd,null))[_0x480d('0x22')](saveUpdates(_0x368cad[_0x480d('0x47')],null))['then'](respondWithResult(_0x3ad3cd,null))['catch'](handleError(_0x3ad3cd,null));};exports[_0x480d('0x4a')]=function(_0x3b5e6c,_0xdf164d,_0x4ca07f){return db['sequelize'][_0x480d('0x4b')](function(_0x1a79eb){if(_0x3b5e6c[_0x480d('0x47')]['mode']===_0x480d('0x4c')){_0x3b5e6c['body'][_0x480d('0x4d')]=path[_0x480d('0x4e')](config['root'],'server/files/moh',_0x3b5e6c[_0x480d('0x47')]['name']);}return db[_0x480d('0x40')][_0x480d('0x4a')](_0x3b5e6c['body'],{'transaction':_0x1a79eb})['then'](function(_0x2f9044){if(_0x3b5e6c['body']['mode']==='files'){fs[_0x480d('0x4f')](_0x2f9044[_0x480d('0x4d')],parseInt(_0x480d('0x50'),0x8));}var _0x5be7c6=_0x3b5e6c[_0x480d('0x51')][_0x480d('0x52')]({'plain':!![]});if(!_0x5be7c6)throw new Error(_0x480d('0x53'));if(_0x5be7c6[_0x480d('0x54')]===_0x480d('0x51')){var _0x492403=_0x2f9044[_0x480d('0x52')]({'plain':!![]});return db[_0x480d('0x55')][_0x480d('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x5be7c6[_0x480d('0x56')]},'raw':!![]})[_0x480d('0x22')](function(_0xfd97ac){if(_0xfd97ac&&_0xfd97ac[_0x480d('0x57')]===0x0){return db[_0x480d('0x24')][_0x480d('0x4a')]({'name':_0x492403[_0x480d('0x28')],'resourceId':_0x492403['id'],'type':_0xfd97ac[_0x480d('0x28')],'sectionId':_0xfd97ac['id']},{})[_0x480d('0x22')](function(){return _0x2f9044;});}else{return _0x2f9044;}})[_0x480d('0x45')](function(_0x5d5dc6){logger[_0x480d('0x26')](_0x480d('0x58'),_0x5d5dc6);});}return _0x2f9044;});})[_0x480d('0x22')](respondWithResult(_0xdf164d,0xc9))['catch'](handleError(_0xdf164d,null));};exports[_0x480d('0x23')]=function(_0x40a359,_0x44e257,_0x4d0015){var _0x4c93b6;return db[_0x480d('0x40')][_0x480d('0x48')]({'where':{'id':_0x40a359[_0x480d('0x49')]['id']}})['then'](function(_0x61ed2e){if(_0x61ed2e){return db[_0x480d('0x59')]['transaction'](function(_0x50ede9){return _0x61ed2e['destroy']({'transaction':_0x50ede9,'raw':!![]})[_0x480d('0x22')](function(_0x34f50f){if(_0x34f50f[_0x480d('0x4d')]){fs[_0x480d('0x5a')](_0x34f50f[_0x480d('0x4d')])['forEach'](function(_0x4fb94e){fs[_0x480d('0x5b')](path[_0x480d('0x4e')](_0x34f50f['directory'],_0x4fb94e));});fs[_0x480d('0x5c')](_0x34f50f[_0x480d('0x4d')]);}return _0x34f50f;});})['catch'](function(_0x179fa8){throw new db[(_0x480d('0x5d'))][(_0x480d('0x5e'))](_0x179fa8[_0x480d('0x5f')]);});}})[_0x480d('0x22')](handleEntityNotFound(_0x44e257,null))[_0x480d('0x22')](removeEntity(_0x44e257,null))[_0x480d('0x45')](handleError(_0x44e257,null));};exports[_0x480d('0x60')]=function(_0x176154,_0x382c0b,_0x5e66d1){return db[_0x480d('0x59')][_0x480d('0x4b')](function(_0x4eb01c){var _0x5195a3;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x176154['params']['id']}})['then'](function(_0x2a4f27){if(_0x2a4f27){_0x5195a3=_0x2a4f27;return _0x2a4f27[_0x480d('0x60')](_0x176154[_0x480d('0x47')]['id'],{'transaction':_0x4eb01c});}})[_0x480d('0x22')](function(_0xee93bf){if(_0xee93bf){return db[_0x480d('0x61')][_0x480d('0x62')]({'where':{'id':_0x176154['body']['id']},'attributes':['id','name',_0x480d('0x63'),'converted_format',_0x480d('0x64')],'raw':!![]});}})[_0x480d('0x22')](function(_0x42e012){if(_0x42e012){var _0x1e477d=path[_0x480d('0x4e')](config[_0x480d('0x65')],'server/files/sounds/converted',util['format'](_0x480d('0x66'),path[_0x480d('0x67')](_0x42e012[_0x480d('0x63')],path[_0x480d('0x68')](_0x42e012[_0x480d('0x63')])),_0x42e012['converted_format']));var _0x531eb1=path[_0x480d('0x4e')](config[_0x480d('0x65')],_0x480d('0x69'),_0x5195a3['name'],util[_0x480d('0x6a')]('%s.%s',_0x42e012[_0x480d('0x28')],_0x42e012[_0x480d('0x6b')]));fs[_0x480d('0x6c')](_0x1e477d,_0x531eb1);return _0x42e012;}})[_0x480d('0x45')](function(_0x219088){throw new db[(_0x480d('0x5d'))][(_0x480d('0x5e'))](_0x219088[_0x480d('0x5f')]);});})['then'](handleEntityNotFound(_0x382c0b,null))[_0x480d('0x22')](respondWithResult(_0x382c0b,0xc9))['catch'](handleError(_0x382c0b,null));};exports[_0x480d('0x6d')]=function(_0x4aa308,_0x1e65e3,_0x62c374){return db[_0x480d('0x59')]['transaction'](function(_0x965213){var _0x11e632;return db[_0x480d('0x40')][_0x480d('0x62')]({'where':{'id':_0x4aa308[_0x480d('0x49')]['id']}})[_0x480d('0x22')](handleEntityNotFound(_0x1e65e3,null))[_0x480d('0x22')](function(_0x448a97){if(_0x448a97){_0x11e632=_0x448a97;return _0x448a97[_0x480d('0x6d')](_0x4aa308['params']['id2']);}})[_0x480d('0x22')](function(_0x4c06db){if(_0x4c06db){return db[_0x480d('0x61')][_0x480d('0x62')]({'where':{'id':_0x4aa308[_0x480d('0x49')]['id2']},'attributes':['id','name','save_name',_0x480d('0x6b'),_0x480d('0x64')],'raw':!![]});}})[_0x480d('0x22')](function(_0x26871e){if(_0x26871e){fs['unlinkSync'](path[_0x480d('0x4e')](_0x11e632[_0x480d('0x4d')],util[_0x480d('0x6a')](_0x480d('0x66'),_0x26871e[_0x480d('0x28')],_0x26871e[_0x480d('0x6b')])));return _0x26871e;}})['catch'](function(_0x1e2958){throw new db[(_0x480d('0x5d'))][(_0x480d('0x5e'))](_0x1e2958[_0x480d('0x5f')]);});})[_0x480d('0x22')](handleEntityNotFound(_0x1e65e3,null))[_0x480d('0x22')](respondWithStatusCode(_0x1e65e3,0xcc))[_0x480d('0x45')](handleError(_0x1e65e3,null));};exports[_0x480d('0x6e')]=function(_0x26bdb8,_0x1b6df0,_0x38c918){var _0x3b047d={};var _0x3059d8={};var _0xe96923;var _0x12572b;return db[_0x480d('0x40')][_0x480d('0x62')]({'where':{'id':_0x26bdb8['params']['id']}})[_0x480d('0x22')](handleEntityNotFound(_0x1b6df0,null))['then'](function(_0x535002){if(_0x535002){_0xe96923=_0x535002;_0x3059d8[_0x480d('0x32')]=_[_0x480d('0x2f')](db['Sound'][_0x480d('0x2b')]);_0x3059d8[_0x480d('0x2e')]=_[_0x480d('0x2f')](_0x26bdb8[_0x480d('0x2e')]);_0x3059d8[_0x480d('0x30')]=_[_0x480d('0x31')](_0x3059d8[_0x480d('0x32')],_0x3059d8[_0x480d('0x2e')]);_0x3b047d[_0x480d('0x33')]=_[_0x480d('0x31')](_0x3059d8[_0x480d('0x32')],qs[_0x480d('0x34')](_0x26bdb8[_0x480d('0x2e')][_0x480d('0x34')]));_0x3b047d[_0x480d('0x33')]=_0x3b047d[_0x480d('0x33')][_0x480d('0x6f')]?_0x3b047d[_0x480d('0x33')]:_0x3059d8[_0x480d('0x32')];_0x3b047d[_0x480d('0x37')]=qs[_0x480d('0x38')](_0x26bdb8[_0x480d('0x2e')][_0x480d('0x38')]);_0x3b047d[_0x480d('0x39')]=qs[_0x480d('0x30')](_[_0x480d('0x3a')](_0x26bdb8[_0x480d('0x2e')],_0x3059d8['filters']));if(_0x26bdb8[_0x480d('0x2e')][_0x480d('0x3b')]){_0x3b047d[_0x480d('0x39')]=_[_0x480d('0x3c')](_0x3b047d[_0x480d('0x39')],{'$or':_[_0x480d('0x2d')](_0x3b047d['attributes'],function(_0x500594){var _0x21dd7a={};_0x21dd7a[_0x500594]={'$like':'%'+_0x26bdb8['query'][_0x480d('0x3b')]+'%'};return _0x21dd7a;})});}_0x3b047d=_[_0x480d('0x3c')]({},_0x3b047d,_0x26bdb8['options']);return _0xe96923[_0x480d('0x6e')](_0x3b047d);}})[_0x480d('0x22')](function(_0x5763b3){if(_0x5763b3){_0x12572b=_0x5763b3[_0x480d('0x6f')];if(!_0x26bdb8[_0x480d('0x2e')][_0x480d('0x35')]('nolimit')){_0x3b047d[_0x480d('0x1c')]=qs['limit'](_0x26bdb8[_0x480d('0x2e')][_0x480d('0x1c')]);_0x3b047d[_0x480d('0x1a')]=qs['offset'](_0x26bdb8[_0x480d('0x2e')][_0x480d('0x1a')]);}return _0xe96923[_0x480d('0x6e')](_0x3b047d);}})[_0x480d('0x22')](function(_0x58e031){if(_0x58e031){return _0x58e031?{'count':_0x12572b,'rows':_0x58e031}:null;}})[_0x480d('0x22')](respondWithResult(_0x1b6df0,null))[_0x480d('0x45')](handleError(_0x1b6df0,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 58d59af..904e618 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 _0x0aab=['./voiceMusicOnHold.attributes','define','voice_musiconhold','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x150e4e,_0x5adc54){var _0x1b2486=function(_0x169b5e){while(--_0x169b5e){_0x150e4e['push'](_0x150e4e['shift']());}};_0x1b2486(++_0x5adc54);}(_0x0aab,0x121));var _0xb0aa=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0aab[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xb0aa('0x0'));var logger=require(_0xb0aa('0x1'))(_0xb0aa('0x2'));var moment=require(_0xb0aa('0x3'));var BPromise=require(_0xb0aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0aa('0x5'));var rimraf=require(_0xb0aa('0x6'));var config=require(_0xb0aa('0x7'));var attributes=require(_0xb0aa('0x8'));module['exports']=function(_0x4afa99,_0x5ea025){return _0x4afa99[_0xb0aa('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0xb0aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0e9=['lodash','util','api','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0x2fb136,_0x31d182){var _0x170aa0=function(_0x573c82){while(--_0x573c82){_0x2fb136['push'](_0x2fb136['shift']());}};_0x170aa0(++_0x31d182);}(_0xd0e9,0xe1));var _0x9d0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0e9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d0e('0x0'));var util=require(_0x9d0e('0x1'));var logger=require('../../config/logger')(_0x9d0e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d0e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d0e('0x4'));var config=require(_0x9d0e('0x5'));var attributes=require(_0x9d0e('0x6'));module['exports']=function(_0xac5727,_0x501ed5){return _0xac5727[_0x9d0e('0x7')](_0x9d0e('0x8'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index a29626b..96b7ea6 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 _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x37166a,_0x286754){var _0x1224a8=function(_0x43d2ff){while(--_0x43d2ff){_0x37166a['push'](_0x37166a['shift']());}};_0x1224a8(++_0x286754);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 _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(_0x5b6102,_0x151ea4){var _0x4aea90=function(_0x569785){while(--_0x569785){_0x5b6102['push'](_0x5b6102['shift']());}};_0x4aea90(++_0x151ea4);}(_0x34e8,0x12c));var _0x834e=function(_0x5adc15,_0x36d22a){_0x5adc15=_0x5adc15-0x0;var _0x54271b=_0x34e8[_0x5adc15];return _0x54271b;};'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 3416bc9..b37a462 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 _0x6ec9=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/users','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','/:id','destroy','removeAgents','exports','multer','path','express'];(function(_0x32ddcc,_0x324359){var _0x2f2f76=function(_0x23b02e){while(--_0x23b02e){_0x32ddcc['push'](_0x32ddcc['shift']());}};_0x2f2f76(++_0x324359);}(_0x6ec9,0x174));var _0x96ec=function(_0x5c1ad7,_0x4ab705){_0x5c1ad7=_0x5c1ad7-0x0;var _0x2e9c7c=_0x6ec9[_0x5c1ad7];return _0x2e9c7c;};'use strict';var multer=require(_0x96ec('0x0'));var util=require('util');var path=require(_0x96ec('0x1'));var timeout=require('connect-timeout');var express=require(_0x96ec('0x2'));var router=express['Router']();var fs_extra=require(_0x96ec('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x96ec('0x4'));var config=require(_0x96ec('0x5'));var controller=require('./voicePrefix.controller');router[_0x96ec('0x6')]('/',auth[_0x96ec('0x7')](),controller[_0x96ec('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x96ec('0x9')]);router[_0x96ec('0x6')]('/:id',auth[_0x96ec('0x7')](),controller[_0x96ec('0xa')]);router[_0x96ec('0x6')](_0x96ec('0xb'),auth['isAuthenticated'](),controller['getAgents']);router[_0x96ec('0x6')](_0x96ec('0xc'),auth[_0x96ec('0x7')](),controller[_0x96ec('0xd')]);router[_0x96ec('0xe')]('/',auth[_0x96ec('0x7')](),controller[_0x96ec('0xf')]);router['post'](_0x96ec('0xb'),auth[_0x96ec('0x7')](),controller[_0x96ec('0x10')]);router[_0x96ec('0xe')](_0x96ec('0xc'),auth[_0x96ec('0x7')](),controller[_0x96ec('0x11')]);router[_0x96ec('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x96ec('0x13')]);router[_0x96ec('0x14')](_0x96ec('0x15'),auth[_0x96ec('0x7')](),controller[_0x96ec('0x16')]);router[_0x96ec('0x14')]('/:id/users',auth[_0x96ec('0x7')](),controller[_0x96ec('0x17')]);router[_0x96ec('0x14')]('/:id/teams',auth[_0x96ec('0x7')](),controller['removeTeams']);module[_0x96ec('0x18')]=router; \ No newline at end of file +var _0xd847=['/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','post','create','/:id/users','addAgents','addTeams','put','update','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','get'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0xd847,0x18a));var _0x7d84=function(_0x560964,_0x2c0ad6){_0x560964=_0x560964-0x0;var _0xe78f82=_0xd847[_0x560964];return _0xe78f82;};'use strict';var multer=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var path=require(_0x7d84('0x2'));var timeout=require(_0x7d84('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7d84('0x4'));var auth=require(_0x7d84('0x5'));var interaction=require(_0x7d84('0x6'));var config=require(_0x7d84('0x7'));var controller=require(_0x7d84('0x8'));router['get']('/',auth[_0x7d84('0x9')](),controller['index']);router[_0x7d84('0xa')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0xc')]);router[_0x7d84('0xa')](_0x7d84('0xd'),auth['isAuthenticated'](),controller[_0x7d84('0xe')]);router['get']('/:id/users',auth[_0x7d84('0x9')](),controller[_0x7d84('0xf')]);router[_0x7d84('0xa')](_0x7d84('0x10'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x11')]);router[_0x7d84('0x12')]('/',auth[_0x7d84('0x9')](),controller[_0x7d84('0x13')]);router[_0x7d84('0x12')](_0x7d84('0x14'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x15')]);router[_0x7d84('0x12')](_0x7d84('0x10'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x16')]);router[_0x7d84('0x17')](_0x7d84('0xd'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x18')]);router['delete'](_0x7d84('0xd'),auth[_0x7d84('0x9')](),controller['destroy']);router['delete']('/:id/users',auth[_0x7d84('0x9')](),controller[_0x7d84('0x19')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);module[_0x7d84('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index dc5a76b..4da47c3 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 _0xecf1=['STRING','name','VIRTUAL','getDataValue','INTEGER','sequelize','exports'];(function(_0xf33b72,_0x3e796e){var _0x5a9868=function(_0x6f5c12){while(--_0x6f5c12){_0xf33b72['push'](_0xf33b72['shift']());}};_0x5a9868(++_0x3e796e);}(_0xecf1,0x163));var _0x1ecf=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xecf1[_0x16771d];return _0x386f11;};'use strict';var Sequelize=require(_0x1ecf('0x0'));module[_0x1ecf('0x1')]={'name':{'type':Sequelize[_0x1ecf('0x2')],'allowNull':![],'unique':_0x1ecf('0x3')},'prefix':{'type':Sequelize[_0x1ecf('0x4')],'get':function(_0x56a505){return'system-'+this[_0x1ecf('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x1ecf('0x2')]},'callerIdAll':{'type':Sequelize[_0x1ecf('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x1ecf('0x6')]}}; \ No newline at end of file +var _0x757a=['VIRTUAL','INTEGER','sequelize','exports','STRING','name'];(function(_0xfbc9ca,_0x2ed120){var _0xe8f463=function(_0x1953cf){while(--_0x1953cf){_0xfbc9ca['push'](_0xfbc9ca['shift']());}};_0xe8f463(++_0x2ed120);}(_0x757a,0x17c));var _0xa757=function(_0x31cc71,_0x382caf){_0x31cc71=_0x31cc71-0x0;var _0x3c268a=_0x757a[_0x31cc71];return _0x3c268a;};'use strict';var Sequelize=require(_0xa757('0x0'));module[_0xa757('0x1')]={'name':{'type':Sequelize[_0xa757('0x2')],'allowNull':![],'unique':_0xa757('0x3')},'prefix':{'type':Sequelize[_0xa757('0x4')],'get':function(_0x57dd91){return'system-'+this['getDataValue'](_0xa757('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xa757('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xa757('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 9050289..79f2896 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 _0x583c=['fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','VoicePrefix','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','length','include','find','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','exten','app','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','system-','VoiceExtension','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','filter','Team','hasOwnProperty','getTeams','addTeams','Agents','online','voicePause','flatMap','each','UserVoicePrefix','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','zip-dir'];(function(_0x3c5219,_0x555810){var _0x23171b=function(_0x475fe1){while(--_0x475fe1){_0x3c5219['push'](_0x3c5219['shift']());}};_0x23171b(++_0x555810);}(_0x583c,0x12b));var _0xc583=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x583c[_0x22b8a3];return _0x199a0c;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require(_0xc583('0x1'));var zipdir=require(_0xc583('0x2'));var jsonpatch=require(_0xc583('0x3'));var rp=require('request-promise');var moment=require(_0xc583('0x4'));var BPromise=require(_0xc583('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc583('0x6'));var sox=require(_0xc583('0x7'));var csv=require('to-csv');var ejs=require(_0xc583('0x8'));var fs=require('fs');var fs_extra=require(_0xc583('0x9'));var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc583('0x17'))['db'];config[_0xc583('0x18')]=_[_0xc583('0x19')](config[_0xc583('0x18')],{'host':_0xc583('0x1a'),'port':0x18eb});var socket=require(_0xc583('0x1b'))(new Redis(config[_0xc583('0x18')]));require(_0xc583('0x1c'))[_0xc583('0x1d')](socket);function respondWithStatusCode(_0x5403a3,_0x21cf25){_0x21cf25=_0x21cf25||0xcc;return function(_0x51ecd7){if(_0x51ecd7){return _0x5403a3[_0xc583('0x1e')](_0x21cf25);}return _0x5403a3[_0xc583('0x1f')](_0x21cf25)['end']();};}function respondWithResult(_0x263552,_0x311ad5){_0x311ad5=_0x311ad5||0xc8;return function(_0x5b1871){if(_0x5b1871){return _0x263552[_0xc583('0x1f')](_0x311ad5)[_0xc583('0x20')](_0x5b1871);}};}function respondWithFilteredResult(_0x5127fa,_0x21cf22){return function(_0x8a2d84){if(_0x8a2d84){var _0x12aac2=typeof _0x21cf22[_0xc583('0x21')]==='undefined'&&typeof _0x21cf22[_0xc583('0x22')]==='undefined';var _0x227ec2=_0x8a2d84[_0xc583('0x23')];var _0xfd9a60=_0x12aac2?0x0:_0x21cf22[_0xc583('0x21')];var _0x1052b5=_0x12aac2?_0x8a2d84[_0xc583('0x23')]:_0x21cf22[_0xc583('0x21')]+_0x21cf22[_0xc583('0x22')];var _0x37fcd4;if(_0x1052b5>=_0x227ec2){_0x1052b5=_0x227ec2;_0x37fcd4=0xc8;}else{_0x37fcd4=0xce;}_0x5127fa[_0xc583('0x1f')](_0x37fcd4);return _0x5127fa[_0xc583('0x24')](_0xc583('0x25'),_0xfd9a60+'-'+_0x1052b5+'/'+_0x227ec2)[_0xc583('0x20')](_0x8a2d84);}return null;};}function patchUpdates(_0x478ee1){return function(_0x542256){try{jsonpatch[_0xc583('0x26')](_0x542256,_0x478ee1,!![]);}catch(_0x3e075c){return BPromise[_0xc583('0x27')](_0x3e075c);}return _0x542256['save']();};}function saveUpdates(_0x1521e2,_0x959500){return function(_0x37f156){if(_0x37f156){return _0x37f156[_0xc583('0x28')](_0x1521e2)[_0xc583('0x29')](function(_0x48c95e){return _0x48c95e;});}return null;};}function removeEntity(_0x4cad36,_0x45871c){return function(_0x4f366b){if(_0x4f366b){return _0x4f366b[_0xc583('0x2a')]()[_0xc583('0x29')](function(){var _0xbabf24=_0x4f366b[_0xc583('0x2b')]({'plain':!![]});var _0x24aab5='VoicePrefixes';return db[_0xc583('0x2c')][_0xc583('0x2a')]({'where':{'type':_0x24aab5,'resourceId':_0xbabf24['id']}})['then'](function(){return _0x4f366b;});})[_0xc583('0x29')](function(){_0x4cad36['status'](0xcc)[_0xc583('0x2d')]();});}};}function handleEntityNotFound(_0x8d4ecb,_0x1c80b1){return function(_0x3ed083){if(!_0x3ed083){_0x8d4ecb[_0xc583('0x1e')](0x194);}return _0x3ed083;};}function handleError(_0x19079b,_0x113b39){_0x113b39=_0x113b39||0x1f4;return function(_0x4a87b5){logger[_0xc583('0x2e')](_0x4a87b5[_0xc583('0x2f')]);if(_0x4a87b5[_0xc583('0x30')]){delete _0x4a87b5[_0xc583('0x30')];}_0x19079b[_0xc583('0x1f')](_0x113b39)[_0xc583('0x31')](_0x4a87b5);};}exports['index']=function(_0x2246dd,_0x58d97f){var _0x510931={},_0x299551={},_0x2df18d={'count':0x0,'rows':[]};var _0x20bbce=_[_0xc583('0x32')](db[_0xc583('0x33')]['rawAttributes'],function(_0x3e41c0){return{'name':_0x3e41c0[_0xc583('0x34')],'type':_0x3e41c0[_0xc583('0x35')]['key']};});_0x299551[_0xc583('0x36')]=_['map'](_0x20bbce,_0xc583('0x30'));_0x299551[_0xc583('0x37')]=_[_0xc583('0x38')](_0x2246dd[_0xc583('0x37')]);_0x299551[_0xc583('0x39')]=_['intersection'](_0x299551[_0xc583('0x36')],_0x299551['query']);_0x510931[_0xc583('0x3a')]=_['intersection'](_0x299551[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x2246dd[_0xc583('0x37')][_0xc583('0x3b')]));_0x510931[_0xc583('0x3a')]=_0x510931[_0xc583('0x3a')]['length']?_0x510931['attributes']:_0x299551[_0xc583('0x36')];if(!_0x2246dd[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x510931[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x2246dd[_0xc583('0x37')][_0xc583('0x22')]);_0x510931[_0xc583('0x21')]=qs['offset'](_0x2246dd[_0xc583('0x37')]['offset']);}_0x510931[_0xc583('0x3d')]=qs[_0xc583('0x3e')](_0x2246dd[_0xc583('0x37')]['sort']);_0x510931['where']=qs['filters'](_[_0xc583('0x3f')](_0x2246dd[_0xc583('0x37')],_0x299551[_0xc583('0x39')]),_0x20bbce);if(_0x2246dd[_0xc583('0x37')]['filter']){_0x510931[_0xc583('0x40')]=_[_0xc583('0x41')](_0x510931['where'],{'$or':_['map'](_0x20bbce,function(_0x1ea5da){if(_0x1ea5da['type']!==_0xc583('0x42')){var _0x1ec6f9={};_0x1ec6f9[_0x1ea5da[_0xc583('0x30')]]={'$like':'%'+_0x2246dd[_0xc583('0x37')]['filter']+'%'};return _0x1ec6f9;}})});}_0x510931=_[_0xc583('0x41')]({},_0x510931,_0x2246dd[_0xc583('0x43')]);var _0x39c5ab={'where':_0x510931[_0xc583('0x40')]};return db[_0xc583('0x33')]['count'](_0x39c5ab)[_0xc583('0x29')](function(_0x5f5a97){_0x2df18d['count']=_0x5f5a97;if(_0x2246dd[_0xc583('0x37')][_0xc583('0x44')]){_0x510931['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xc583('0x45')](_0x510931);})[_0xc583('0x29')](function(_0x7d1b29){_0x2df18d[_0xc583('0x46')]=_0x7d1b29;return _0x2df18d;})['then'](respondWithFilteredResult(_0x58d97f,_0x510931))[_0xc583('0x47')](handleError(_0x58d97f,null));};exports['show']=function(_0x8c8209,_0x4edac2){var _0x28ab1a={'raw':![],'where':{'id':_0x8c8209[_0xc583('0x48')]['id']}},_0x14e9ad={};_0x14e9ad[_0xc583('0x36')]=_[_0xc583('0x38')](db['VoicePrefix'][_0xc583('0x49')]);_0x14e9ad[_0xc583('0x37')]=_[_0xc583('0x38')](_0x8c8209['query']);_0x14e9ad['filters']=_['intersection'](_0x14e9ad[_0xc583('0x36')],_0x14e9ad['query']);_0x28ab1a[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x14e9ad[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x8c8209[_0xc583('0x37')][_0xc583('0x3b')]));_0x28ab1a[_0xc583('0x3a')]=_0x28ab1a[_0xc583('0x3a')][_0xc583('0x4b')]?_0x28ab1a[_0xc583('0x3a')]:_0x14e9ad[_0xc583('0x36')];if(_0x8c8209['query'][_0xc583('0x44')]){_0x28ab1a[_0xc583('0x4c')]=[{'all':!![]}];}_0x28ab1a=_[_0xc583('0x41')]({},_0x28ab1a,_0x8c8209[_0xc583('0x43')]);return db['VoicePrefix'][_0xc583('0x4d')](_0x28ab1a)[_0xc583('0x29')](handleEntityNotFound(_0x4edac2,null))[_0xc583('0x29')](respondWithResult(_0x4edac2,null))[_0xc583('0x47')](handleError(_0x4edac2,null));};exports[_0xc583('0x2a')]=function(_0x22da88,_0x3f60ae){return db[_0xc583('0x33')][_0xc583('0x4d')]({'where':{'id':_0x22da88['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3f60ae,null))[_0xc583('0x29')](removeEntity(_0x3f60ae,null))[_0xc583('0x47')](handleError(_0x3f60ae,null));};exports[_0xc583('0x4e')]=function(_0x3c442e,_0xc42b2a){return db[_0xc583('0x33')][_0xc583('0x4e')]()[_0xc583('0x29')](respondWithResult(_0xc42b2a,null))[_0xc583('0x47')](handleError(_0xc42b2a,null));};exports[_0xc583('0x4f')]=function(_0x7be0b3,_0x305239){var _0x4c486b;return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x44413e){return db[_0xc583('0x33')][_0xc583('0x4f')](_0x7be0b3[_0xc583('0x52')],{'transaction':_0x44413e})[_0xc583('0x29')](function(_0x1aff76){_0x4c486b=_0x1aff76[_0xc583('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0xc583('0x4d')]({'where':{'id':_0x4c486b[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x59ce34){return createVoicePrefixExtensions(_0x4c486b,_0x59ce34,_0x44413e);});});})['then'](function(){var _0x2bb764=_0x7be0b3['user'][_0xc583('0x2b')]({'plain':!![]});if(!_0x2bb764)throw new Error(_0xc583('0x54'));if(_0x2bb764['role']==='user'){var _0x282290=_0x4c486b;return db[_0xc583('0x55')][_0xc583('0x4d')]({'where':{'name':_0xc583('0x56'),'userProfileId':_0x2bb764[_0xc583('0x57')]},'raw':!![]})[_0xc583('0x29')](function(_0x3e2758){if(_0x3e2758&&_0x3e2758[_0xc583('0x58')]===0x0){return db['UserProfileResource'][_0xc583('0x4f')]({'name':_0x282290[_0xc583('0x30')],'resourceId':_0x282290['id'],'type':_0x3e2758[_0xc583('0x30')],'sectionId':_0x3e2758['id']},{})[_0xc583('0x29')](function(){return _0x4c486b;});}else{return _0x4c486b;}})['catch'](function(_0x43fda1){logger[_0xc583('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43fda1);throw _0x43fda1;});}return _0x4c486b;})['then'](respondWithResult(_0x305239,null))[_0xc583('0x47')](handleError(_0x305239,null));};function Extension(_0x5ccfe7,_0x30b1e0,_0x1ba5cc,_0x40e8a6){this['context']='from-sip';this[_0xc583('0x59')]=_0x5ccfe7;this[_0xc583('0x5a')]=_0x1ba5cc;this[_0xc583('0x35')]=_0xc583('0x5b');this['description']=_0xc583('0x5c');this[_0xc583('0x5d')]=_0x30b1e0;this['appdata']=_0x40e8a6;}function createVoicePrefixExtensions(_0x508f4b,_0x28013a,_0x579c62){return new BPromise(function(_0x5df37d,_0x507f18){var _0x415b0f=new Extension(formatPrefixName(_0x508f4b[_0xc583('0x5e')]),0x1,_0xc583('0x5f'),_0xc583('0x60'));_0x415b0f['VoicePrefixId']=_0x508f4b['id'];return db['VoiceExtension'][_0xc583('0x4f')](_0x415b0f,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x599663){var _0x52cd21=_0x599663[_0xc583('0x2b')]({'plain':!![]});var _0x48f217=_[_0xc583('0x32')](addVoicePrefixExtensions(_0x508f4b,_0x28013a),function(_0x43f208){_0x43f208['VoiceExtensionId']=_0x52cd21['id'];_0x43f208[_0xc583('0x61')]=_0x508f4b['id'];return _0x43f208;});return db['VoiceExtension'][_0xc583('0x62')](_0x48f217,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x4b3f49){if(!_0x4b3f49){return _0x507f18(_0xc583('0x63'));}else{return _0x5df37d(_0x4b3f49);}})[_0xc583('0x47')](function(_0x20783b){return _0x507f18(_0x20783b);});});;});};function addVoicePrefixExtensions(_0xf4bc67,_0x1b5003){var _0x330a8e=[];var _0x37613c=formatPrefixName(_0xf4bc67[_0xc583('0x5e')]);_0x330a8e['push'](new Extension(_0x37613c,0x2,'Set','CDR(prefix)='+_0xf4bc67[_0xc583('0x30')]));if(_0xf4bc67['callerIdAll']){_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x65'),_0xc583('0x66')+_0xf4bc67[_0xc583('0x67')]));}else{_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x5f'),_0xc583('0x68')));}_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x4,'goto',_0x1b5003[_0xc583('0x69')]+','+_0xc583('0x6a')+(0x8+_0xf4bc67[_0xc583('0x30')][_0xc583('0x4b')])+'}'+','+0x1));return _0x330a8e;}function formatPrefixName(_0x41a064){var _0xb243ac='_';for(var _0x548f1c=0x0;_0x548f1c<_0x41a064[_0xc583('0x4b')];_0x548f1c++){if(_0x41a064[_0xc583('0x6b')](_0x548f1c)=='-'){_0xb243ac+=_0x41a064[_0xc583('0x6b')](_0x548f1c);}else{_0xb243ac+='['+_0x41a064[_0xc583('0x6b')](_0x548f1c)+']';}}_0xb243ac+='.';return _0xb243ac;}exports[_0xc583('0x28')]=function(_0x2b719f,_0x547d2f,_0x3e4616){var _0x1b6948=_0x2b719f[_0xc583('0x52')];_0x1b6948['prefix']=_0xc583('0x6c')+_0x1b6948['name']+'-';return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x240174){return db[_0xc583('0x33')][_0xc583('0x28')](_0x1b6948,{'where':{'id':_0x1b6948['id']},'transaction':_0x240174})[_0xc583('0x29')](function(){return db[_0xc583('0x6d')]['destroy']({'where':{'VoicePrefixId':_0x1b6948['id']},'transaction':_0x240174})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x1b6948[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x3a2a5c){return createVoicePrefixExtensions(_0x1b6948,_0x3a2a5c,_0x240174);});});});})[_0xc583('0x29')](function(){return db[_0xc583('0x33')][_0xc583('0x6e')](_0x1b6948['id']);})[_0xc583('0x29')](respondWithResult(_0x547d2f,null))[_0xc583('0x47')](handleError(_0x547d2f,null));};exports[_0xc583('0x6f')]=function(_0x1b8304,_0x4c9516,_0x22b75d){return db[_0xc583('0x33')]['find']({'where':{'id':_0x1b8304['params']['id']}})['then'](handleEntityNotFound(_0x4c9516,null))[_0xc583('0x29')](function(_0x10037e){if(_0x10037e){return _0x10037e[_0xc583('0x6f')](_0x1b8304[_0xc583('0x52')][_0xc583('0x70')],_[_0xc583('0x71')](_0x1b8304[_0xc583('0x52')],[_0xc583('0x70'),'id'])||{})[_0xc583('0x72')](function(_0x516fcb){for(var _0x442844=0x0;_0x442844<_0x1b8304[_0xc583('0x52')]['ids'][_0xc583('0x4b')];_0x442844+=0x1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':Number(_0x1b8304[_0xc583('0x52')][_0xc583('0x70')][_0x442844]),'VoicePrefixId':Number(_0x1b8304['params']['id'])});}return _0x516fcb;});}})[_0xc583('0x29')](respondWithResult(_0x4c9516,null))[_0xc583('0x47')](handleError(_0x4c9516,null));};exports[_0xc583('0x75')]=function(_0x2f0aa9,_0x50ef13,_0x4d6582){return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x2f0aa9['params']['id']}})['then'](handleEntityNotFound(_0x50ef13,null))['then'](function(_0x1c7323){if(_0x1c7323){return _0x1c7323[_0xc583('0x75')](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])[_0xc583('0x29')](function(){if(_['isArray'](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])){for(var _0x9a09b0=0x0;_0x9a09b0<_0x2f0aa9['query'][_0xc583('0x70')][_0xc583('0x4b')];_0x9a09b0+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')][_0x9a09b0]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}}else{socket[_0xc583('0x73')](_0xc583('0x76'),{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x50ef13,null))[_0xc583('0x47')](handleError(_0x50ef13,null));};exports[_0xc583('0x77')]=function(_0x3ea593,_0x3eabb9,_0x674d99){var _0x2b98b7={};var _0x20c4e6={};var _0x149051;var _0x1f0ab4;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x3ea593[_0xc583('0x48')]['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3eabb9,null))[_0xc583('0x29')](function(_0x42ff52){if(_0x42ff52){_0x149051=_0x42ff52;_0x20c4e6[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x79')][_0xc583('0x49')]);_0x20c4e6[_0xc583('0x37')]=_[_0xc583('0x38')](_0x3ea593[_0xc583('0x37')]);_0x20c4e6[_0xc583('0x39')]=_[_0xc583('0x4a')](_0x20c4e6['model'],_0x20c4e6['query']);_0x2b98b7[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x20c4e6['model'],qs['fields'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3b')]));_0x2b98b7['attributes']=_0x2b98b7['attributes'][_0xc583('0x4b')]?_0x2b98b7[_0xc583('0x3a')]:_0x20c4e6[_0xc583('0x36')];_0x2b98b7['order']=qs['sort'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3e')]);_0x2b98b7[_0xc583('0x40')]=qs['filters'](_[_0xc583('0x3f')](_0x3ea593[_0xc583('0x37')],_0x20c4e6['filters']));if(_0x3ea593[_0xc583('0x37')][_0xc583('0x7a')]){_0x2b98b7[_0xc583('0x40')]=_[_0xc583('0x41')](_0x2b98b7[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0x2b98b7[_0xc583('0x3a')],function(_0x47e7f8){var _0x4a2671={};_0x4a2671[_0x47e7f8]={'$like':'%'+_0x3ea593['query'][_0xc583('0x7a')]+'%'};return _0x4a2671;})});}_0x2b98b7=_[_0xc583('0x41')]({},_0x2b98b7,_0x3ea593[_0xc583('0x43')]);return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3ab1a1){if(_0x3ab1a1){_0x1f0ab4=_0x3ab1a1[_0xc583('0x4b')];if(!_0x3ea593[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x2b98b7[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x3ea593[_0xc583('0x37')]['limit']);_0x2b98b7['offset']=qs['offset'](_0x3ea593[_0xc583('0x37')][_0xc583('0x21')]);}return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3a04a6){if(_0x3a04a6){return _0x3a04a6?{'count':_0x1f0ab4,'rows':_0x3a04a6}:null;}})[_0xc583('0x29')](respondWithResult(_0x3eabb9,null))['catch'](handleError(_0x3eabb9,null));};exports['getTeams']=function(_0x1907ff,_0x422848,_0x492e13){var _0xc11b2e={};var _0x1a2a0d={};var _0x2f6ea4;var _0x3e4c37;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x1907ff['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x422848,null))[_0xc583('0x29')](function(_0x3eb4a8){if(_0x3eb4a8){_0x2f6ea4=_0x3eb4a8;_0x1a2a0d[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x7b')][_0xc583('0x49')]);_0x1a2a0d[_0xc583('0x37')]=_[_0xc583('0x38')](_0x1907ff[_0xc583('0x37')]);_0x1a2a0d['filters']=_[_0xc583('0x4a')](_0x1a2a0d[_0xc583('0x36')],_0x1a2a0d[_0xc583('0x37')]);_0xc11b2e['attributes']=_[_0xc583('0x4a')](_0x1a2a0d['model'],qs[_0xc583('0x3b')](_0x1907ff[_0xc583('0x37')][_0xc583('0x3b')]));_0xc11b2e[_0xc583('0x3a')]=_0xc11b2e[_0xc583('0x3a')][_0xc583('0x4b')]?_0xc11b2e[_0xc583('0x3a')]:_0x1a2a0d['model'];_0xc11b2e[_0xc583('0x3d')]=qs['sort'](_0x1907ff[_0xc583('0x37')]['sort']);_0xc11b2e[_0xc583('0x40')]=qs[_0xc583('0x39')](_[_0xc583('0x3f')](_0x1907ff[_0xc583('0x37')],_0x1a2a0d[_0xc583('0x39')]));if(_0x1907ff[_0xc583('0x37')][_0xc583('0x7a')]){_0xc11b2e[_0xc583('0x40')]=_['merge'](_0xc11b2e[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0xc11b2e[_0xc583('0x3a')],function(_0x3ae684){var _0x424cd7={};_0x424cd7[_0x3ae684]={'$like':'%'+_0x1907ff['query'][_0xc583('0x7a')]+'%'};return _0x424cd7;})});}_0xc11b2e=_[_0xc583('0x41')]({},_0xc11b2e,_0x1907ff[_0xc583('0x43')]);return _0x2f6ea4['getTeams'](_0xc11b2e);}})['then'](function(_0xbbdcc4){if(_0xbbdcc4){_0x3e4c37=_0xbbdcc4[_0xc583('0x4b')];if(!_0x1907ff[_0xc583('0x37')][_0xc583('0x7c')](_0xc583('0x3c'))){_0xc11b2e[_0xc583('0x22')]=qs['limit'](_0x1907ff[_0xc583('0x37')][_0xc583('0x22')]);_0xc11b2e[_0xc583('0x21')]=qs[_0xc583('0x21')](_0x1907ff[_0xc583('0x37')]['offset']);}return _0x2f6ea4[_0xc583('0x7d')](_0xc11b2e);}})['then'](function(_0x1371a2){if(_0x1371a2){return _0x1371a2?{'count':_0x3e4c37,'rows':_0x1371a2}:null;}})['then'](respondWithResult(_0x422848,null))[_0xc583('0x47')](handleError(_0x422848,null));};exports[_0xc583('0x7e')]=function(_0x5b9b20,_0x5ebdb6,_0x1f1dfc){var _0x3f8a4e=_0x5b9b20[_0xc583('0x52')][_0xc583('0x70')];var _0x43e533;return db['Team'][_0xc583('0x45')]({'where':{'id':_0x3f8a4e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x30'),_0xc583('0x80'),_0xc583('0x81'),'interface'],'raw':!![]}]})['then'](function(_0x54f43b){if(_0x54f43b){_0x43e533=_0x54f43b;var _0x1cbdea=_[_0xc583('0x82')](_0x54f43b,function(_0x2afb8c){var _0x5252a8=_0x2afb8c[_0xc583('0x2b')]({'plain':!![]});return _0x5252a8[_0xc583('0x7f')];});return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x5b9b20['params']['id']}})[_0xc583('0x29')](function(_0x3d1570){return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x48e574){return _0x3d1570[_0xc583('0x7e')](_0x3f8a4e,{'transaction':_0x48e574})[_0xc583('0x29')](function(){return BPromise[_0xc583('0x83')](_0x43e533,function(_0x499821){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x499821['id'],'VoicePrefixId':_0x5b9b20[_0xc583('0x48')]['id']},{'transaction':_0x48e574});});})[_0xc583('0x29')](function(){return BPromise['each'](_0x1cbdea,function(_0x363a8e){return db[_0xc583('0x84')]['findOrCreate']({'where':{'UserId':_0x363a8e['id'],'VoicePrefixId':_0x5b9b20['params']['id']},'transaction':_0x48e574});});})[_0xc583('0x29')](function(){_0x1cbdea['forEach'](function(_0x790cd1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':_0x790cd1['id'],'VoicePrefixId':_0x3d1570['id']});});});});});}})[_0xc583('0x29')](respondWithStatusCode(_0x5ebdb6,null))[_0xc583('0x47')](handleError(_0x5ebdb6,null));};exports[_0xc583('0x85')]=function(_0x59781d,_0x3bcbce,_0x1628f4){return db[_0xc583('0x7b')][_0xc583('0x45')]({'where':{'id':_0x59781d[_0xc583('0x37')][_0xc583('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3bcbce,null))[_0xc583('0x29')](function(_0x146b9c){var _0x4a6c7c=_['map'](_0x146b9c,'id');var _0x42b5a5=[];var _0x583588=[];var _0x564e57=squel[_0xc583('0x86')]();_0x564e57['field'](_0xc583('0x87'))[_0xc583('0x88')](_0xc583('0x89'),'tq')[_0xc583('0x8a')]('user_has_teams','ut',_0xc583('0x8b'))[_0xc583('0x40')](_0xc583('0x8c'),_0x59781d[_0xc583('0x48')]['id']);for(var _0x162607=0x0;_0x162607<_0x146b9c[_0xc583('0x4b')];_0x162607+=0x1){let _0x39a000=_0x146b9c[_0x162607];for(var _0x63eee8=0x0;_0x63eee8<_0x39a000[_0xc583('0x7f')][_0xc583('0x4b')];_0x63eee8+=0x1){let _0x459caf=_0x39a000[_0xc583('0x7f')][_0x63eee8];var _0x4075bd=_0x564e57['clone']();_0x4075bd[_0xc583('0x40')](_0xc583('0x8d'),_0x459caf['id']);_0x583588[_0xc583('0x64')](db[_0xc583('0x50')][_0xc583('0x37')](_0x4075bd[_0xc583('0x8e')](),{'type':db[_0xc583('0x50')][_0xc583('0x8f')]['SELECT']})[_0xc583('0x29')](function(_0x7ac229){if(_0x7ac229['length']===0x1){return _0x459caf['id'];}else{var _0x56cc96=_[_0xc583('0x90')](_[_0xc583('0x32')](_0x7ac229,'TeamId'),function(_0x25dde6){return _['includes'](_0x4a6c7c,_0x25dde6);});if(_0x56cc96){return _0x459caf['id'];}}}));}}return BPromise[_0xc583('0x91')](_0x583588)[_0xc583('0x29')](function(_0x1de88f){_0x42b5a5=_(_0x42b5a5)[_0xc583('0x92')](_0x1de88f)[_0xc583('0x93')]()[_0xc583('0x94')]();return db[_0xc583('0x33')]['find']({'where':{'id':_0x59781d['params']['id']}})[_0xc583('0x29')](function(_0x592b63){return db[_0xc583('0x50')]['transaction'](function(_0x440079){return _0x592b63[_0xc583('0x85')](_0x59781d['query'][_0xc583('0x70')],{'transaction':_0x440079})[_0xc583('0x29')](function(){if(!_[_0xc583('0x95')](_0x42b5a5)){return _0x592b63[_0xc583('0x75')](_0x42b5a5,{'transaction':_0x440079});}})['then'](function(){_0x42b5a5[_0xc583('0x96')](function(_0x182c40){socket[_0xc583('0x73')]('userVoicePrefix:remove',{'UserId':_0x182c40,'VoicePrefixId':_0x592b63['id']});});});});});});})[_0xc583('0x29')](respondWithStatusCode(_0x3bcbce,null))[_0xc583('0x47')](handleError(_0x3bcbce,null));}; \ No newline at end of file +var _0x93e9=['VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','${EXTEN:','length','charAt','body','system-','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','options','addTeams','Agents','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','compact','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','catch','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','appdata','prefix','NoOp'];(function(_0x1e5243,_0x3d6959){var _0x459137=function(_0x1d7a10){while(--_0x1d7a10){_0x1e5243['push'](_0x1e5243['shift']());}};_0x459137(++_0x3d6959);}(_0x93e9,0xcc));var _0x993e=function(_0x23e5ce,_0x57584d){_0x23e5ce=_0x23e5ce-0x0;var _0x2ce19b=_0x93e9[_0x23e5ce];return _0x2ce19b;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];config['redis']=_['defaults'](config[_0x993e('0x19')],{'host':_0x993e('0x1a'),'port':0x18eb});var socket=require(_0x993e('0x1b'))(new Redis(config[_0x993e('0x19')]));require(_0x993e('0x1c'))[_0x993e('0x1d')](socket);function respondWithStatusCode(_0x34ddda,_0x20f32a){_0x20f32a=_0x20f32a||0xcc;return function(_0x2a184b){if(_0x2a184b){return _0x34ddda[_0x993e('0x1e')](_0x20f32a);}return _0x34ddda[_0x993e('0x1f')](_0x20f32a)[_0x993e('0x20')]();};}function respondWithResult(_0x3df0e7,_0x125322){_0x125322=_0x125322||0xc8;return function(_0x1f267f){if(_0x1f267f){return _0x3df0e7[_0x993e('0x1f')](_0x125322)[_0x993e('0x21')](_0x1f267f);}};}function respondWithFilteredResult(_0x526e06,_0x22f7cc){return function(_0x1acd21){if(_0x1acd21){var _0x3cc2b9=typeof _0x22f7cc[_0x993e('0x22')]===_0x993e('0x23')&&typeof _0x22f7cc[_0x993e('0x24')]==='undefined';var _0x11cd41=_0x1acd21[_0x993e('0x25')];var _0x1eaf57=_0x3cc2b9?0x0:_0x22f7cc[_0x993e('0x22')];var _0x130a8a=_0x3cc2b9?_0x1acd21[_0x993e('0x25')]:_0x22f7cc[_0x993e('0x22')]+_0x22f7cc[_0x993e('0x24')];var _0x4bbe9c;if(_0x130a8a>=_0x11cd41){_0x130a8a=_0x11cd41;_0x4bbe9c=0xc8;}else{_0x4bbe9c=0xce;}_0x526e06[_0x993e('0x1f')](_0x4bbe9c);return _0x526e06['set'](_0x993e('0x26'),_0x1eaf57+'-'+_0x130a8a+'/'+_0x11cd41)[_0x993e('0x21')](_0x1acd21);}return null;};}function patchUpdates(_0x32b09e){return function(_0x5ba2a1){try{jsonpatch[_0x993e('0x27')](_0x5ba2a1,_0x32b09e,!![]);}catch(_0x13db4e){return BPromise[_0x993e('0x28')](_0x13db4e);}return _0x5ba2a1[_0x993e('0x29')]();};}function saveUpdates(_0x3b45ef,_0x328d22){return function(_0xa1c83e){if(_0xa1c83e){return _0xa1c83e[_0x993e('0x2a')](_0x3b45ef)[_0x993e('0x2b')](function(_0x18f6ac){return _0x18f6ac;});}return null;};}function removeEntity(_0x3fe099,_0x3603fa){return function(_0x4fe471){if(_0x4fe471){return _0x4fe471[_0x993e('0x2c')]()[_0x993e('0x2b')](function(){var _0x52b727=_0x4fe471[_0x993e('0x2d')]({'plain':!![]});var _0x4f5cc1=_0x993e('0x2e');return db[_0x993e('0x2f')][_0x993e('0x2c')]({'where':{'type':_0x4f5cc1,'resourceId':_0x52b727['id']}})[_0x993e('0x2b')](function(){return _0x4fe471;});})['then'](function(){_0x3fe099['status'](0xcc)[_0x993e('0x20')]();});}};}function handleEntityNotFound(_0x466d63,_0x4a4f00){return function(_0x223af0){if(!_0x223af0){_0x466d63[_0x993e('0x1e')](0x194);}return _0x223af0;};}function handleError(_0x248354,_0x4c5ee3){_0x4c5ee3=_0x4c5ee3||0x1f4;return function(_0x2495b7){logger[_0x993e('0x30')](_0x2495b7[_0x993e('0x31')]);if(_0x2495b7[_0x993e('0x32')]){delete _0x2495b7[_0x993e('0x32')];}_0x248354['status'](_0x4c5ee3)[_0x993e('0x33')](_0x2495b7);};}exports['index']=function(_0x782298,_0x5ba163){var _0x1da357={},_0x567ed4={},_0x3b9c3c={'count':0x0,'rows':[]};var _0x2ce5d5=_[_0x993e('0x34')](db[_0x993e('0x35')][_0x993e('0x36')],function(_0x360e2d){return{'name':_0x360e2d['fieldName'],'type':_0x360e2d[_0x993e('0x37')]['key']};});_0x567ed4['model']=_[_0x993e('0x34')](_0x2ce5d5,'name');_0x567ed4[_0x993e('0x38')]=_[_0x993e('0x39')](_0x782298[_0x993e('0x38')]);_0x567ed4[_0x993e('0x3a')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],_0x567ed4[_0x993e('0x38')]);_0x1da357[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x782298[_0x993e('0x38')][_0x993e('0x3e')]));_0x1da357[_0x993e('0x3d')]=_0x1da357[_0x993e('0x3d')]['length']?_0x1da357[_0x993e('0x3d')]:_0x567ed4[_0x993e('0x3c')];if(!_0x782298[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1da357[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x782298[_0x993e('0x38')][_0x993e('0x24')]);_0x1da357['offset']=qs[_0x993e('0x22')](_0x782298['query'][_0x993e('0x22')]);}_0x1da357[_0x993e('0x41')]=qs[_0x993e('0x42')](_0x782298[_0x993e('0x38')][_0x993e('0x42')]);_0x1da357[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x782298['query'],_0x567ed4[_0x993e('0x3a')]),_0x2ce5d5);if(_0x782298['query'][_0x993e('0x45')]){_0x1da357['where']=_[_0x993e('0x46')](_0x1da357[_0x993e('0x43')],{'$or':_[_0x993e('0x34')](_0x2ce5d5,function(_0x1f1327){if(_0x1f1327[_0x993e('0x37')]!==_0x993e('0x47')){var _0xb728cf={};_0xb728cf[_0x1f1327[_0x993e('0x32')]]={'$like':'%'+_0x782298['query'][_0x993e('0x45')]+'%'};return _0xb728cf;}})});}_0x1da357=_['merge']({},_0x1da357,_0x782298['options']);var _0x1a2712={'where':_0x1da357[_0x993e('0x43')]};return db[_0x993e('0x35')]['count'](_0x1a2712)[_0x993e('0x2b')](function(_0x40719d){_0x3b9c3c[_0x993e('0x25')]=_0x40719d;if(_0x782298['query']['includeAll']){_0x1da357['include']=[{'all':!![]}];}return db[_0x993e('0x35')][_0x993e('0x48')](_0x1da357);})[_0x993e('0x2b')](function(_0x539c9d){_0x3b9c3c[_0x993e('0x49')]=_0x539c9d;return _0x3b9c3c;})[_0x993e('0x2b')](respondWithFilteredResult(_0x5ba163,_0x1da357))['catch'](handleError(_0x5ba163,null));};exports[_0x993e('0x4a')]=function(_0x5f7563,_0x5074a6){var _0x258795={'raw':![],'where':{'id':_0x5f7563[_0x993e('0x4b')]['id']}},_0x576ea={};_0x576ea['model']=_['keys'](db['VoicePrefix'][_0x993e('0x36')]);_0x576ea[_0x993e('0x38')]=_[_0x993e('0x39')](_0x5f7563[_0x993e('0x38')]);_0x576ea['filters']=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],_0x576ea[_0x993e('0x38')]);_0x258795[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],qs['fields'](_0x5f7563['query'][_0x993e('0x3e')]));_0x258795[_0x993e('0x3d')]=_0x258795['attributes']['length']?_0x258795[_0x993e('0x3d')]:_0x576ea[_0x993e('0x3c')];if(_0x5f7563[_0x993e('0x38')][_0x993e('0x4c')]){_0x258795[_0x993e('0x4d')]=[{'all':!![]}];}_0x258795=_[_0x993e('0x46')]({},_0x258795,_0x5f7563['options']);return db[_0x993e('0x35')]['find'](_0x258795)[_0x993e('0x2b')](handleEntityNotFound(_0x5074a6,null))[_0x993e('0x2b')](respondWithResult(_0x5074a6,null))[_0x993e('0x4e')](handleError(_0x5074a6,null));};exports[_0x993e('0x2c')]=function(_0x2cba37,_0x276b99){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x2cba37['params']['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x276b99,null))[_0x993e('0x2b')](removeEntity(_0x276b99,null))[_0x993e('0x4e')](handleError(_0x276b99,null));};exports['describe']=function(_0x355912,_0x53c1e9){return db[_0x993e('0x35')][_0x993e('0x50')]()['then'](respondWithResult(_0x53c1e9,null))[_0x993e('0x4e')](handleError(_0x53c1e9,null));};exports[_0x993e('0x51')]=function(_0x579c43,_0x3809ef){var _0x207e27;return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x2e368e){return db['VoicePrefix']['create'](_0x579c43['body'],{'transaction':_0x2e368e})[_0x993e('0x2b')](function(_0x29f8a5){_0x207e27=_0x29f8a5[_0x993e('0x2d')]({'plain':!![]});return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x207e27[_0x993e('0x55')]},'raw':!![]})['then'](function(_0x3a897d){return createVoicePrefixExtensions(_0x207e27,_0x3a897d,_0x2e368e);});});})[_0x993e('0x2b')](function(){var _0x15c8ed=_0x579c43['user'][_0x993e('0x2d')]({'plain':!![]});if(!_0x15c8ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c8ed['role']===_0x993e('0x56')){var _0x37d7b1=_0x207e27;return db['UserProfileSection'][_0x993e('0x4f')]({'where':{'name':'VoicePrefixes','userProfileId':_0x15c8ed[_0x993e('0x57')]},'raw':!![]})[_0x993e('0x2b')](function(_0x4a0dbd){if(_0x4a0dbd&&_0x4a0dbd['autoAssociation']===0x0){return db[_0x993e('0x2f')][_0x993e('0x51')]({'name':_0x37d7b1[_0x993e('0x32')],'resourceId':_0x37d7b1['id'],'type':_0x4a0dbd[_0x993e('0x32')],'sectionId':_0x4a0dbd['id']},{})[_0x993e('0x2b')](function(){return _0x207e27;});}else{return _0x207e27;}})[_0x993e('0x4e')](function(_0x4f9225){logger[_0x993e('0x30')](_0x993e('0x58'),_0x4f9225);throw _0x4f9225;});}return _0x207e27;})['then'](respondWithResult(_0x3809ef,null))[_0x993e('0x4e')](handleError(_0x3809ef,null));};function Extension(_0x473e00,_0x1b2113,_0x5ebaec,_0x426341){this[_0x993e('0x59')]=_0x993e('0x5a');this['exten']=_0x473e00;this[_0x993e('0x5b')]=_0x5ebaec;this[_0x993e('0x37')]=_0x993e('0x5c');this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x1b2113;this[_0x993e('0x5d')]=_0x426341;}function createVoicePrefixExtensions(_0x98d16c,_0x3a3d29,_0x411484){return new BPromise(function(_0xc62106,_0x55a347){var _0x18367f=new Extension(formatPrefixName(_0x98d16c[_0x993e('0x5e')]),0x1,_0x993e('0x5f'),'Voice\x20Prefix');_0x18367f[_0x993e('0x60')]=_0x98d16c['id'];return db[_0x993e('0x54')][_0x993e('0x51')](_0x18367f,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x5e4ab1){var _0x54417b=_0x5e4ab1[_0x993e('0x2d')]({'plain':!![]});var _0x51cec9=_['map'](addVoicePrefixExtensions(_0x98d16c,_0x3a3d29),function(_0x17c7f7){_0x17c7f7[_0x993e('0x55')]=_0x54417b['id'];_0x17c7f7[_0x993e('0x60')]=_0x98d16c['id'];return _0x17c7f7;});return db[_0x993e('0x54')][_0x993e('0x61')](_0x51cec9,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x211204){if(!_0x211204){return _0x55a347(_0x993e('0x62'));}else{return _0xc62106(_0x211204);}})[_0x993e('0x4e')](function(_0x113395){return _0x55a347(_0x113395);});});;});};function addVoicePrefixExtensions(_0x300a93,_0x44def2){var _0x2ddc16=[];var _0x609430=formatPrefixName(_0x300a93[_0x993e('0x5e')]);_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x2,'Set',_0x993e('0x64')+_0x300a93[_0x993e('0x32')]));if(_0x300a93['callerIdAll']){_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'Set',_0x993e('0x65')+_0x300a93[_0x993e('0x66')]));}else{_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'NoOp',_0x993e('0x67')));}_0x2ddc16['push'](new Extension(_0x609430,0x4,'goto',_0x44def2[_0x993e('0x59')]+','+_0x993e('0x68')+(0x8+_0x300a93[_0x993e('0x32')][_0x993e('0x69')])+'}'+','+0x1));return _0x2ddc16;}function formatPrefixName(_0x2a243a){var _0x5194de='_';for(var _0x120d51=0x0;_0x120d51<_0x2a243a[_0x993e('0x69')];_0x120d51++){if(_0x2a243a[_0x993e('0x6a')](_0x120d51)=='-'){_0x5194de+=_0x2a243a['charAt'](_0x120d51);}else{_0x5194de+='['+_0x2a243a[_0x993e('0x6a')](_0x120d51)+']';}}_0x5194de+='.';return _0x5194de;}exports['update']=function(_0x1ab10e,_0x6ef96,_0x42288d){var _0x5afba1=_0x1ab10e[_0x993e('0x6b')];_0x5afba1[_0x993e('0x5e')]=_0x993e('0x6c')+_0x5afba1[_0x993e('0x32')]+'-';return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x108cad){return db[_0x993e('0x35')][_0x993e('0x2a')](_0x5afba1,{'where':{'id':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db['VoiceExtension'][_0x993e('0x2c')]({'where':{'VoicePrefixId':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x5afba1[_0x993e('0x55')]},'raw':!![]})[_0x993e('0x2b')](function(_0x282c53){return createVoicePrefixExtensions(_0x5afba1,_0x282c53,_0x108cad);});});});})[_0x993e('0x2b')](function(){return db['VoicePrefix']['findById'](_0x5afba1['id']);})[_0x993e('0x2b')](respondWithResult(_0x6ef96,null))['catch'](handleError(_0x6ef96,null));};exports[_0x993e('0x6d')]=function(_0x444da6,_0x2ce913,_0x49788e){return db[_0x993e('0x35')]['find']({'where':{'id':_0x444da6[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x2ce913,null))[_0x993e('0x2b')](function(_0x40768a){if(_0x40768a){return _0x40768a[_0x993e('0x6d')](_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')],_[_0x993e('0x6f')](_0x444da6['body'],['ids','id'])||{})[_0x993e('0x70')](function(_0x5a70ff){for(var _0x2fb182=0x0;_0x2fb182<_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x993e('0x69')];_0x2fb182+=0x1){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':Number(_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x2fb182]),'VoicePrefixId':Number(_0x444da6[_0x993e('0x4b')]['id'])});}return _0x5a70ff;});}})[_0x993e('0x2b')](respondWithResult(_0x2ce913,null))['catch'](handleError(_0x2ce913,null));};exports[_0x993e('0x73')]=function(_0x14347f,_0x4a0002,_0x4742d9){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x14347f[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x4a0002,null))[_0x993e('0x2b')](function(_0x4157b6){if(_0x4157b6){return _0x4157b6[_0x993e('0x73')](_0x14347f[_0x993e('0x38')]['ids'])[_0x993e('0x2b')](function(){if(_[_0x993e('0x74')](_0x14347f[_0x993e('0x38')][_0x993e('0x6e')])){for(var _0x53ce16=0x0;_0x53ce16<_0x14347f['query'][_0x993e('0x6e')]['length'];_0x53ce16+=0x1){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')][_0x53ce16]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}}else{socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a0002,null))[_0x993e('0x4e')](handleError(_0x4a0002,null));};exports[_0x993e('0x76')]=function(_0x3abd3a,_0x278c2a,_0x3f6347){var _0x1a3967={};var _0x1079e7={};var _0x5c634a;var _0x47c3b6;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x3abd3a[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x278c2a,null))[_0x993e('0x2b')](function(_0x53b0c8){if(_0x53b0c8){_0x5c634a=_0x53b0c8;_0x1079e7['model']=_['keys'](db[_0x993e('0x78')][_0x993e('0x36')]);_0x1079e7[_0x993e('0x38')]=_[_0x993e('0x39')](_0x3abd3a[_0x993e('0x38')]);_0x1079e7['filters']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],_0x1079e7[_0x993e('0x38')]);_0x1a3967['attributes']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x3e')]));_0x1a3967[_0x993e('0x3d')]=_0x1a3967['attributes'][_0x993e('0x69')]?_0x1a3967['attributes']:_0x1079e7['model'];_0x1a3967['order']=qs['sort'](_0x3abd3a[_0x993e('0x38')][_0x993e('0x42')]);_0x1a3967[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x3abd3a[_0x993e('0x38')],_0x1079e7[_0x993e('0x3a')]));if(_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]){_0x1a3967['where']=_[_0x993e('0x46')](_0x1a3967['where'],{'$or':_[_0x993e('0x34')](_0x1a3967[_0x993e('0x3d')],function(_0x3e7793){var _0x65c6f0={};_0x65c6f0[_0x3e7793]={'$like':'%'+_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x65c6f0;})});}_0x1a3967=_[_0x993e('0x46')]({},_0x1a3967,_0x3abd3a['options']);return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})[_0x993e('0x2b')](function(_0x285c93){if(_0x285c93){_0x47c3b6=_0x285c93['length'];if(!_0x3abd3a[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1a3967['limit']=qs[_0x993e('0x24')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x24')]);_0x1a3967[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x22')]);}return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})['then'](function(_0x412d21){if(_0x412d21){return _0x412d21?{'count':_0x47c3b6,'rows':_0x412d21}:null;}})['then'](respondWithResult(_0x278c2a,null))[_0x993e('0x4e')](handleError(_0x278c2a,null));};exports[_0x993e('0x79')]=function(_0x4d6d94,_0x505f28,_0x4e2ccf){var _0x4506cb={};var _0x31e947={};var _0x7800d4;var _0x4e1fcf;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x4d6d94[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x505f28,null))['then'](function(_0xc35545){if(_0xc35545){_0x7800d4=_0xc35545;_0x31e947['model']=_[_0x993e('0x39')](db['Team']['rawAttributes']);_0x31e947[_0x993e('0x38')]=_[_0x993e('0x39')](_0x4d6d94[_0x993e('0x38')]);_0x31e947[_0x993e('0x3a')]=_['intersection'](_0x31e947['model'],_0x31e947['query']);_0x4506cb[_0x993e('0x3d')]=_['intersection'](_0x31e947[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x3e')]));_0x4506cb[_0x993e('0x3d')]=_0x4506cb['attributes'][_0x993e('0x69')]?_0x4506cb[_0x993e('0x3d')]:_0x31e947['model'];_0x4506cb[_0x993e('0x41')]=qs['sort'](_0x4d6d94[_0x993e('0x38')][_0x993e('0x42')]);_0x4506cb[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x4d6d94[_0x993e('0x38')],_0x31e947[_0x993e('0x3a')]));if(_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]){_0x4506cb['where']=_[_0x993e('0x46')](_0x4506cb['where'],{'$or':_[_0x993e('0x34')](_0x4506cb[_0x993e('0x3d')],function(_0x50dd66){var _0x48acd5={};_0x48acd5[_0x50dd66]={'$like':'%'+_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x48acd5;})});}_0x4506cb=_['merge']({},_0x4506cb,_0x4d6d94[_0x993e('0x7a')]);return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0xc56e5a){if(_0xc56e5a){_0x4e1fcf=_0xc56e5a['length'];if(!_0x4d6d94[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x4506cb[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x4d6d94['query'][_0x993e('0x24')]);_0x4506cb[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x22')]);}return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0x5d2b00){if(_0x5d2b00){return _0x5d2b00?{'count':_0x4e1fcf,'rows':_0x5d2b00}:null;}})[_0x993e('0x2b')](respondWithResult(_0x505f28,null))['catch'](handleError(_0x505f28,null));};exports[_0x993e('0x7b')]=function(_0x8dc65,_0x4a5755,_0x43b5c5){var _0x4d53d1=_0x8dc65['body'][_0x993e('0x6e')];var _0x371be2;return db['Team'][_0x993e('0x48')]({'where':{'id':_0x4d53d1},'attributes':['id'],'include':[{'model':db[_0x993e('0x78')],'as':_0x993e('0x7c'),'attributes':['id',_0x993e('0x32'),'online',_0x993e('0x7d'),'interface'],'raw':!![]}]})[_0x993e('0x2b')](function(_0x5c9960){if(_0x5c9960){_0x371be2=_0x5c9960;var _0x4286a0=_[_0x993e('0x7e')](_0x5c9960,function(_0x2540e4){var _0x56a23a=_0x2540e4['get']({'plain':!![]});return _0x56a23a[_0x993e('0x7c')];});return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x8dc65[_0x993e('0x4b')]['id']}})['then'](function(_0x37409f){return db['sequelize'][_0x993e('0x53')](function(_0xa16043){return _0x37409f[_0x993e('0x7b')](_0x4d53d1,{'transaction':_0xa16043})['then'](function(){return BPromise[_0x993e('0x7f')](_0x371be2,function(_0x30f7a3){return db[_0x993e('0x80')][_0x993e('0x81')]({'TeamId':_0x30f7a3['id'],'VoicePrefixId':_0x8dc65[_0x993e('0x4b')]['id']},{'transaction':_0xa16043});});})[_0x993e('0x2b')](function(){return BPromise[_0x993e('0x7f')](_0x4286a0,function(_0x3e61d2){return db[_0x993e('0x82')]['findOrCreate']({'where':{'UserId':_0x3e61d2['id'],'VoicePrefixId':_0x8dc65['params']['id']},'transaction':_0xa16043});});})['then'](function(){_0x4286a0[_0x993e('0x83')](function(_0x47c230){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':_0x47c230['id'],'VoicePrefixId':_0x37409f['id']});});});});});}})[_0x993e('0x2b')](respondWithStatusCode(_0x4a5755,null))[_0x993e('0x4e')](handleError(_0x4a5755,null));};exports['removeTeams']=function(_0x548dfb,_0x123dcd,_0x4e7340){return db[_0x993e('0x84')][_0x993e('0x48')]({'where':{'id':_0x548dfb[_0x993e('0x38')][_0x993e('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x993e('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x123dcd,null))['then'](function(_0x242374){var _0x1a3779=_[_0x993e('0x34')](_0x242374,'id');var _0x366809=[];var _0x11ba3a=[];var _0x1b2ca0=squel[_0x993e('0x85')]();_0x1b2ca0[_0x993e('0x86')](_0x993e('0x87'))[_0x993e('0x88')](_0x993e('0x89'),'tq')[_0x993e('0x8a')]('user_has_teams','ut',_0x993e('0x8b'))[_0x993e('0x43')](_0x993e('0x8c'),_0x548dfb[_0x993e('0x4b')]['id']);for(var _0x23ecf0=0x0;_0x23ecf0<_0x242374[_0x993e('0x69')];_0x23ecf0+=0x1){let _0x2fcfaa=_0x242374[_0x23ecf0];for(var _0x5303c9=0x0;_0x5303c9<_0x2fcfaa[_0x993e('0x7c')]['length'];_0x5303c9+=0x1){let _0x5d5dc8=_0x2fcfaa[_0x993e('0x7c')][_0x5303c9];var _0x102393=_0x1b2ca0[_0x993e('0x8d')]();_0x102393['where'](_0x993e('0x8e'),_0x5d5dc8['id']);_0x11ba3a[_0x993e('0x63')](db[_0x993e('0x52')][_0x993e('0x38')](_0x102393[_0x993e('0x8f')](),{'type':db[_0x993e('0x52')][_0x993e('0x90')]['SELECT']})[_0x993e('0x2b')](function(_0x6ee3c0){if(_0x6ee3c0['length']===0x1){return _0x5d5dc8['id'];}else{var _0x58fee1=_[_0x993e('0x91')](_[_0x993e('0x34')](_0x6ee3c0,_0x993e('0x92')),function(_0x2f0669){return _[_0x993e('0x93')](_0x1a3779,_0x2f0669);});if(_0x58fee1){return _0x5d5dc8['id'];}}}));}}return BPromise['all'](_0x11ba3a)[_0x993e('0x2b')](function(_0x3725b5){_0x366809=_(_0x366809)['union'](_0x3725b5)[_0x993e('0x94')]()['value']();return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x548dfb['params']['id']}})[_0x993e('0x2b')](function(_0x5ee2e0){return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x289772){return _0x5ee2e0['removeTeams'](_0x548dfb['query'][_0x993e('0x6e')],{'transaction':_0x289772})[_0x993e('0x2b')](function(){if(!_[_0x993e('0x95')](_0x366809)){return _0x5ee2e0[_0x993e('0x73')](_0x366809,{'transaction':_0x289772});}})[_0x993e('0x2b')](function(){_0x366809[_0x993e('0x83')](function(_0x366f8f){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':_0x366f8f,'VoicePrefixId':_0x5ee2e0['id']});});});});});});})['then'](respondWithStatusCode(_0x123dcd,null))[_0x993e('0x4e')](handleError(_0x123dcd,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c125ad7..01728f2 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 _0x3566=['events','../../mysqldb','save','update','remove','emit'];(function(_0x36ad90,_0x15b1f9){var _0x710ae7=function(_0x40743e){while(--_0x40743e){_0x36ad90['push'](_0x36ad90['shift']());}};_0x710ae7(++_0x15b1f9);}(_0x3566,0x198));var _0x6356=function(_0x39d867,_0x212a32){_0x39d867=_0x39d867-0x0;var _0x51e577=_0x3566[_0x39d867];return _0x51e577;};'use strict';var EventEmitter=require(_0x6356('0x0'));var VoicePrefix=require(_0x6356('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6356('0x2'),'afterUpdate':_0x6356('0x3'),'afterDestroy':_0x6356('0x4')};function emitEvent(_0x537655){return function(_0x5db393,_0x74cd2c,_0x248d0c){VoicePrefixEvents[_0x6356('0x5')](_0x537655+':'+_0x5db393['id'],_0x5db393);VoicePrefixEvents[_0x6356('0x5')](_0x537655,_0x5db393);_0x248d0c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x2f5b=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x1c9348,_0xac86cd){var _0x3f567d=function(_0x119dcc){while(--_0x119dcc){_0x1c9348['push'](_0x1c9348['shift']());}};_0x3f567d(++_0xac86cd);}(_0x2f5b,0xd1));var _0xb2f5=function(_0x2d4cec,_0x19500c){_0x2d4cec=_0x2d4cec-0x0;var _0x32f0ca=_0x2f5b[_0x2d4cec];return _0x32f0ca;};'use strict';var EventEmitter=require(_0xb2f5('0x0'));var VoicePrefix=require(_0xb2f5('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xb2f5('0x2')](0x0);var events={'afterCreate':_0xb2f5('0x3'),'afterUpdate':_0xb2f5('0x4'),'afterDestroy':_0xb2f5('0x5')};function emitEvent(_0x22dd08){return function(_0x9dd2a2,_0x4055f4,_0x2c863f){VoicePrefixEvents[_0xb2f5('0x6')](_0x22dd08+':'+_0x9dd2a2['id'],_0x9dd2a2);VoicePrefixEvents[_0xb2f5('0x6')](_0x22dd08,_0x9dd2a2);_0x2c863f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xb2f5('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 96fc2b8..65a1d17 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 _0xa7fe=['VoicePrefix','voice_prefixes','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xa7fe,0x16a));var _0xea7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xea7f('0x0'));var util=require(_0xea7f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xea7f('0x2'));var BPromise=require(_0xea7f('0x3'));var rp=require(_0xea7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea7f('0x5'));var config=require(_0xea7f('0x6'));var attributes=require('./voicePrefix.attributes');module[_0xea7f('0x7')]=function(_0x54cfda,_0x3ea23a){return _0x54cfda['define'](_0xea7f('0x8'),attributes,{'tableName':_0xea7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd9c=['voice_prefixes','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0xa650fb,_0x104a00){var _0x99f4de=function(_0x5f4d31){while(--_0x5f4d31){_0xa650fb['push'](_0xa650fb['shift']());}};_0x99f4de(++_0x104a00);}(_0xdd9c,0x18d));var _0xcdd9=function(_0x2928bc,_0x4f5a2f){_0x2928bc=_0x2928bc-0x0;var _0x4aae60=_0xdd9c[_0x2928bc];return _0x4aae60;};'use strict';var _=require(_0xcdd9('0x0'));var util=require('util');var logger=require(_0xcdd9('0x1'))(_0xcdd9('0x2'));var moment=require('moment');var BPromise=require(_0xcdd9('0x3'));var rp=require(_0xcdd9('0x4'));var fs=require('fs');var path=require(_0xcdd9('0x5'));var rimraf=require(_0xcdd9('0x6'));var config=require('../../config/environment');var attributes=require(_0xcdd9('0x7'));module[_0xcdd9('0x8')]=function(_0x29ce8c,_0x4586a7){return _0x29ce8c[_0xcdd9('0x9')](_0xcdd9('0xa'),attributes,{'tableName':_0xcdd9('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 57a5c78..afb8007 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 _0x8a9a=['VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x8a9a[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var moment=require(_0xa8a9('0x1'));var BPromise=require(_0xa8a9('0x2'));var rs=require(_0xa8a9('0x3'));var fs=require('fs');var Redis=require(_0xa8a9('0x4'));var db=require(_0xa8a9('0x5'))['db'];var utils=require(_0xa8a9('0x6'));var logger=require(_0xa8a9('0x7'))(_0xa8a9('0x8'));var config=require(_0xa8a9('0x9'));var jayson=require(_0xa8a9('0xa'));var client=jayson[_0xa8a9('0xb')]['http']({'port':0x232a});config[_0xa8a9('0xc')]=_['defaults'](config[_0xa8a9('0xc')],{'host':_0xa8a9('0xd'),'port':0x18eb});var socket=require(_0xa8a9('0xe'))(new Redis(config[_0xa8a9('0xc')]));require(_0xa8a9('0xf'))['register'](socket);function respondWithRpcPromise(_0x2f9391,_0x50071a,_0x58e265){return new BPromise(function(_0x2743ed,_0x4f4af8){return client[_0xa8a9('0x10')](_0x2f9391,_0x58e265)[_0xa8a9('0x11')](function(_0x5815e4){logger[_0xa8a9('0x12')](_0xa8a9('0x13'),_0x50071a,_0xa8a9('0x14'));logger[_0xa8a9('0x15')](_0xa8a9('0x16'),_0x50071a,_0xa8a9('0x14'),JSON['stringify'](_0x5815e4));if(_0x5815e4[_0xa8a9('0x17')]){if(_0x5815e4[_0xa8a9('0x17')][_0xa8a9('0x18')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x50071a,_0x5815e4[_0xa8a9('0x17')][_0xa8a9('0x19')]);return _0x4f4af8(_0x5815e4[_0xa8a9('0x17')]['message']);}logger[_0xa8a9('0x17')](_0xa8a9('0x13'),_0x50071a,_0x5815e4['error']['message']);return _0x2743ed(_0x5815e4[_0xa8a9('0x17')][_0xa8a9('0x19')]);}else{logger[_0xa8a9('0x12')](_0xa8a9('0x13'),_0x50071a,_0xa8a9('0x14'));_0x2743ed(_0x5815e4[_0xa8a9('0x1a')]['message']);}})['catch'](function(_0x3a7ae7){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x50071a,_0x3a7ae7);_0x4f4af8(_0x3a7ae7);});});} \ No newline at end of file +var _0x288a=['info','result','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1efb6b,_0x1547a3){var _0x44cce2=function(_0x5a5d28){while(--_0x5a5d28){_0x1efb6b['push'](_0x1efb6b['shift']());}};_0x44cce2(++_0x1547a3);}(_0x288a,0x188));var _0xa288=function(_0x189589,_0x129a36){_0x189589=_0x189589-0x0;var _0x10a4b4=_0x288a[_0x189589];return _0x10a4b4;};'use strict';var _=require('lodash');var util=require(_0xa288('0x0'));var moment=require(_0xa288('0x1'));var BPromise=require(_0xa288('0x2'));var rs=require(_0xa288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa288('0x4'));var logger=require('../../config/logger')(_0xa288('0x5'));var config=require(_0xa288('0x6'));var jayson=require(_0xa288('0x7'));var client=jayson['client'][_0xa288('0x8')]({'port':0x232a});config[_0xa288('0x9')]=_[_0xa288('0xa')](config['redis'],{'host':_0xa288('0xb'),'port':0x18eb});var socket=require(_0xa288('0xc'))(new Redis(config[_0xa288('0x9')]));require(_0xa288('0xd'))[_0xa288('0xe')](socket);function respondWithRpcPromise(_0x3181e6,_0x3095cf,_0x360396){return new BPromise(function(_0x4eafe2,_0x5cf5f1){return client['request'](_0x3181e6,_0x360396)[_0xa288('0xf')](function(_0x34a4ec){logger['info'](_0xa288('0x10'),_0x3095cf,_0xa288('0x11'));logger[_0xa288('0x12')](_0xa288('0x13'),_0x3095cf,_0xa288('0x11'),JSON[_0xa288('0x14')](_0x34a4ec));if(_0x34a4ec[_0xa288('0x15')]){if(_0x34a4ec[_0xa288('0x15')][_0xa288('0x16')]===0x1f4){logger[_0xa288('0x15')](_0xa288('0x10'),_0x3095cf,_0x34a4ec[_0xa288('0x15')][_0xa288('0x17')]);return _0x5cf5f1(_0x34a4ec[_0xa288('0x15')][_0xa288('0x17')]);}logger[_0xa288('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x3095cf,_0x34a4ec[_0xa288('0x15')][_0xa288('0x17')]);return _0x4eafe2(_0x34a4ec[_0xa288('0x15')][_0xa288('0x17')]);}else{logger[_0xa288('0x18')](_0xa288('0x10'),_0x3095cf,'request\x20sent');_0x4eafe2(_0x34a4ec[_0xa288('0x19')][_0xa288('0x17')]);}})['catch'](function(_0x58fa1a){logger[_0xa288('0x15')](_0xa288('0x10'),_0x3095cf,_0x58fa1a);_0x5cf5f1(_0x58fa1a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 097dd5f..66058c5 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 _0x6b24=['save','remove','update','removeListener','length','voicePrefix:'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6b24,0x1ce));var _0x46b2=function(_0x5538a4,_0xe0b8b0){_0x5538a4=_0x5538a4-0x0;var _0x530a52=_0x6b24[_0x5538a4];return _0x530a52;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x46b2('0x0'),_0x46b2('0x1'),_0x46b2('0x2')];function createListener(_0x3eeaae,_0x4afaba){return function(_0x529a0c){_0x4afaba['emit'](_0x3eeaae,_0x529a0c);};}function removeListener(_0x304ab5,_0x53ee5c){return function(){VoicePrefixEvents[_0x46b2('0x3')](_0x304ab5,_0x53ee5c);};}exports['register']=function(_0x2e5227){for(var _0x5598df=0x0,_0x512905=events[_0x46b2('0x4')];_0x5598df<_0x512905;_0x5598df++){var _0x233ccf=events[_0x5598df];var _0x1f81b8=createListener(_0x46b2('0x5')+_0x233ccf,_0x2e5227);VoicePrefixEvents['on'](_0x233ccf,_0x1f81b8);}}; \ No newline at end of file +var _0xd957=['register','length','voicePrefix:','./voicePrefix.events','save','update','emit','removeListener'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var VoicePrefixEvents=require(_0x7d95('0x0'));var events=[_0x7d95('0x1'),'remove',_0x7d95('0x2')];function createListener(_0x2035b7,_0x5d0023){return function(_0xf7608a){_0x5d0023[_0x7d95('0x3')](_0x2035b7,_0xf7608a);};}function removeListener(_0x291309,_0x9750e1){return function(){VoicePrefixEvents[_0x7d95('0x4')](_0x291309,_0x9750e1);};}exports[_0x7d95('0x5')]=function(_0x2de581){for(var _0x514355=0x0,_0x181ca5=events[_0x7d95('0x6')];_0x514355<_0x181ca5;_0x514355++){var _0x4f10ec=events[_0x514355];var _0xfd14f6=createListener(_0x7d95('0x7')+_0x4f10ec,_0x2de581);VoicePrefixEvents['on'](_0x4f10ec,_0xfd14f6);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 0fa6c7d..4981d71 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(_0x182a0a,_0x536d9e){var _0x2a1fd6=function(_0xcfe41){while(--_0xcfe41){_0x182a0a['push'](_0x182a0a['shift']());}};_0x2a1fd6(++_0x536d9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x31b31b,_0x5f044e){var _0x2c8fc2=function(_0x5438aa){while(--_0x5438aa){_0x31b31b['push'](_0x31b31b['shift']());}};_0x2c8fc2(++_0x5f044e);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0xb10b[_0x3d00db];return _0x41f115;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index b5e677b..94cf14a 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 _0x3d89=['preview','booked','includes','INTEGER','yes','once','periodic_announce','joinempty','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','ENUM','inbound','outbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue','type','dialMethod'];(function(_0x51677b,_0x4da680){var _0x40aa74=function(_0x170663){while(--_0x170663){_0x51677b['push'](_0x51677b['shift']());}};_0x40aa74(++_0x4da680);}(_0x3d89,0xcd));var _0x93d8=function(_0x480689,_0x3b9c7c){_0x480689=_0x480689-0x0;var _0x858b56=_0x3d89[_0x480689];return _0x858b56;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x93d8('0x0')],'allowNull':![],'unique':_0x93d8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x3'),_0x93d8('0x4')),'allowNull':![],'defaultValue':_0x93d8('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x93d8('0x5')},'announce':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x93d8('0x2')]('rr',_0x93d8('0x6'),'leastrecent',_0x93d8('0x7'),_0x93d8('0x8'),_0x93d8('0x9'),_0x93d8('0xa'),_0x93d8('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0x93d8('0x6'),'set':function(_0x467b1e){this[_0x93d8('0xc')](_0x93d8('0xd'),_0x467b1e?_0x467b1e:_0x93d8('0x9'));},'get':function(){var _0x1f145c=this[_0x93d8('0xe')](_0x93d8('0xf'));var _0x23b151=this[_0x93d8('0xe')](_0x93d8('0x10'));var _0x347987=this[_0x93d8('0xe')](_0x93d8('0xd'));if(_0x1f145c===_0x93d8('0x4')){if(_0x23b151===_0x93d8('0x11')){return null;}if(_0x23b151===_0x93d8('0x12')&&![_0x93d8('0x9'),'roundrobin'][_0x93d8('0x13')](_0x347987)){this[_0x93d8('0xc')](_0x93d8('0xd'),_0x93d8('0x9'));}}return _0x347987;}},'servicelevel':{'type':Sequelize[_0x93d8('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x93d8('0x14')](0xb)},'timeout':{'type':Sequelize[_0x93d8('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x93d8('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x93d8('0x0')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x15'),'no'),'defaultValue':_0x93d8('0x15')},'autopause':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x93d8('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x93d8('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x93d8('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x93d8('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x93d8('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x93d8('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x93d8('0x14')](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[_0x93d8('0x2')](_0x93d8('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x93d8('0x15')},'announce_holdtime':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x15'),'no',_0x93d8('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x93d8('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x93d8('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x93d8('0x0')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x93d8('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x93d8('0x0')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x93d8('0x0')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1be717){this[_0x93d8('0xc')](_0x93d8('0x17'),_0x1be717?_0x1be717['join'](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x93d8('0xe')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x3d6e98){this[_0x93d8('0xc')](_0x93d8('0x18'),_0x3d6e98?_0x3d6e98[_0x93d8('0x19')](','):undefined);},'get':function(){return this[_0x93d8('0xe')](_0x93d8('0x18'))?this[_0x93d8('0xe')](_0x93d8('0x18'))[_0x93d8('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':'no','set':function(_0x37e5f4){this[_0x93d8('0xc')]('leavewhenempty',_0x37e5f4?_0x37e5f4[_0x93d8('0x19')](','):undefined);},'get':function(){return this[_0x93d8('0xe')](_0x93d8('0x1b'))?this[_0x93d8('0xe')](_0x93d8('0x1b'))[_0x93d8('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x93d8('0x0')]},'description':{'type':Sequelize[_0x93d8('0x0')]},'acw':{'type':Sequelize[_0x93d8('0x1c')],'defaultValue':0x0,'set':function(_0x59e9ae){this[_0x93d8('0xc')](_0x93d8('0x1d'),_0x59e9ae);if(_0x59e9ae){if(this[_0x93d8('0xe')](_0x93d8('0x1e'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x93d8('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x93d8('0x1c')],'defaultValue':0x0,'comment':_0x93d8('0x1f')},'dialMethod':{'type':Sequelize['ENUM'](_0x93d8('0x11'),_0x93d8('0x20'),_0x93d8('0x21'),_0x93d8('0x22'),_0x93d8('0x12')),'defaultValue':_0x93d8('0x20'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x93d8('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x93d8('0x24')},'dialLimitQueue':{'type':Sequelize[_0x93d8('0x14')](0x4)[_0x93d8('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x93d8('0x25')](0x2)[_0x93d8('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x93d8('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x27'),_0x93d8('0x28')),'defaultValue':_0x93d8('0x28'),'comment':_0x93d8('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x93d8('0x25')](0x2)[_0x93d8('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x93d8('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x93d8('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x93d8('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x93d8('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x93d8('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x93d8('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x93d8('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':'tTxX','comment':_0x93d8('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x93d8('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x93d8('0x2e')},'dialQueueProject':{'type':Sequelize[_0x93d8('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x93d8('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x93d8('0x14')](0x5)[_0x93d8('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x93d8('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x93d8('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'defaultValue':0x3,'comment':_0x93d8('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x93d8('0x14')](0x5)[_0x93d8('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x93d8('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':_0x93d8('0x32')},'dialPrefix':{'type':Sequelize[_0x93d8('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x33'),_0x93d8('0x34'),_0x93d8('0x35')),'defaultValue':_0x93d8('0x33')},'dialAMDActive':{'type':Sequelize[_0x93d8('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x93d8('0x14')](0x9)[_0x93d8('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x93d8('0x14')](0x9)[_0x93d8('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x93d8('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x93d8('0x14')](0x9)[_0x93d8('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x93d8('0x14')](0x9)[_0x93d8('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x93d8('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x93d8('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x93d8('0x14')](0x9)[_0x93d8('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x93d8('0x38')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x93d8('0x14')](0x5)[_0x93d8('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x93d8('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x93d8('0x14')](0x9)[_0x93d8('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x93d8('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0x93d8('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x93d8('0x3b')},'dialRecallInQueue':{'type':Sequelize[_0x93d8('0x1c')],'defaultValue':0x0,'comment':_0x93d8('0x3c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x93d8('0x2')](_0x93d8('0x3d'),'ASC'),'defaultValue':_0x93d8('0x3d')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x93d8('0x3e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x93d8('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x93d8('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x93d8('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x93d8('0x14')](0x5)[_0x93d8('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x93d8('0x3f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x93d8('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x93d8('0x40')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x93d8('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x93d8('0x41')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x93d8('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x93d8('0x42')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x93d8('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x93d8('0x43')},'dialMachineMaxRetry':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x93d8('0x44')},'dialMachineRetryFrequency':{'type':Sequelize[_0x93d8('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x93d8('0x45')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x93d8('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x93d8('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x93d8('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x93d8('0x1c')],'defaultValue':![],'comment':_0x93d8('0x47'),'set':function(_0x84a13){if(!_0x84a13)this[_0x93d8('0xc')](_0x93d8('0x48'),null);this['setDataValue'](_0x93d8('0x49'),_0x84a13);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x93d8('0x14')](0x3)[_0x93d8('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1839=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','DESC','#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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','outbound','inbound','default','ringall','leastrecent','fewestcalls','rrmemory','wrandom','rrordered','type','getDataValue','dialMethod','strategy','preview','booked','roundrobin','INTEGER','yes','all','once','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x424231,_0x2139fb){var _0x49b278=function(_0x3ad0c3){while(--_0x3ad0c3){_0x424231['push'](_0x424231['shift']());}};_0x49b278(++_0x2139fb);}(_0x1839,0xbd));var _0x9183=function(_0x5a72e3,_0x2cdde8){_0x5a72e3=_0x5a72e3-0x0;var _0x3b2c74=_0x1839[_0x5a72e3];return _0x3b2c74;};'use strict';var Sequelize=require('sequelize');module[_0x9183('0x0')]={'name':{'type':Sequelize[_0x9183('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9183('0x2')]('inbound',_0x9183('0x3')),'allowNull':![],'defaultValue':_0x9183('0x4')},'musiconhold':{'type':Sequelize[_0x9183('0x1')],'defaultValue':_0x9183('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x9183('0x2')]('rr',_0x9183('0x6'),_0x9183('0x7'),_0x9183('0x8'),'random',_0x9183('0x9'),'linear',_0x9183('0xa'),_0x9183('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x3e13d9){this['setDataValue']('strategy',_0x3e13d9?_0x3e13d9:_0x9183('0x9'));},'get':function(){var _0x216cd=this['getDataValue'](_0x9183('0xc'));var _0x33bff9=this[_0x9183('0xd')](_0x9183('0xe'));var _0x36dd05=this[_0x9183('0xd')](_0x9183('0xf'));if(_0x216cd==='outbound'){if(_0x33bff9===_0x9183('0x10')){return null;}if(_0x33bff9===_0x9183('0x11')&&![_0x9183('0x9'),_0x9183('0x12')]['includes'](_0x36dd05)){this['setDataValue']('strategy',_0x9183('0x9'));}}return _0x36dd05;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9183('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9183('0x1')]},'weight':{'type':Sequelize[_0x9183('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9183('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x9183('0x14'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x9183('0x2')](_0x9183('0x14'),'no',_0x9183('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9183('0x13')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x9183('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9183('0x2')](_0x9183('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x9183('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9183('0x2')](_0x9183('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9183('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9183('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9183('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9183('0x2')](_0x9183('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9183('0x2')](_0x9183('0x14'),'no'),'defaultValue':_0x9183('0x14')},'announce_holdtime':{'type':Sequelize[_0x9183('0x2')](_0x9183('0x14'),'no',_0x9183('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x9183('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x9183('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9183('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9183('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x9183('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9183('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9183('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9183('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9183('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9183('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9183('0x1')]},'queue_quantity1':{'type':Sequelize[_0x9183('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x5cede2){this[_0x9183('0x17')](_0x9183('0x18'),_0x5cede2?_0x5cede2[_0x9183('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x9183('0x18'))?this['getDataValue'](_0x9183('0x18'))[_0x9183('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x9183('0x1')],'defaultValue':_0x9183('0x14'),'set':function(_0x41a440){this[_0x9183('0x17')](_0x9183('0x1b'),_0x41a440?_0x41a440[_0x9183('0x19')](','):undefined);},'get':function(){return this[_0x9183('0xd')](_0x9183('0x1b'))?this[_0x9183('0xd')](_0x9183('0x1b'))[_0x9183('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9183('0x1')],'defaultValue':'no','set':function(_0x27b05f){this[_0x9183('0x17')](_0x9183('0x1c'),_0x27b05f?_0x27b05f[_0x9183('0x19')](','):undefined);},'get':function(){return this[_0x9183('0xd')](_0x9183('0x1c'))?this['getDataValue']('leavewhenempty')[_0x9183('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9183('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9183('0x2')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9183('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9183('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x9183('0x1d')],'defaultValue':0x0,'set':function(_0x39b19a){this[_0x9183('0x17')](_0x9183('0x1e'),_0x39b19a);if(_0x39b19a){if(this[_0x9183('0xd')](_0x9183('0x1f'))<0x2){this[_0x9183('0x17')](_0x9183('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9183('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9183('0x1d')],'defaultValue':0x0,'comment':_0x9183('0x20')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x9183('0x21'),'power',_0x9183('0x22'),_0x9183('0x11')),'defaultValue':'progressive','comment':_0x9183('0x23')},'dialLimitChannel':{'type':Sequelize[_0x9183('0x13')](0x4)[_0x9183('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x9183('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9183('0x25')},'dialPowerLevel':{'type':Sequelize[_0x9183('0x26')](0x2)[_0x9183('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9183('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x9183('0x2')](_0x9183('0x28'),_0x9183('0x29')),'defaultValue':_0x9183('0x29'),'comment':_0x9183('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9183('0x26')](0x2)[_0x9183('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9183('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x9183('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9183('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x9183('0x1')],'defaultValue':_0x9183('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9183('0x2e')},'dialQueueProject':{'type':Sequelize[_0x9183('0x1')],'comment':_0x9183('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9183('0x13')](0x5)[_0x9183('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9183('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9183('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9183('0x13')](0x5)[_0x9183('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9183('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x3,'comment':_0x9183('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9183('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9183('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9183('0x35')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9183('0x1')],'defaultValue':_0x9183('0x36')},'dialPrefix':{'type':Sequelize[_0x9183('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9183('0x2')](_0x9183('0x37'),'never',_0x9183('0x38')),'defaultValue':_0x9183('0x37')},'dialAMDActive':{'type':Sequelize[_0x9183('0x1d')],'defaultValue':0x0,'comment':_0x9183('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x9183('0x13')](0x9)[_0x9183('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9183('0x13')](0x9)[_0x9183('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9183('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9183('0x13')](0x9)[_0x9183('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9183('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9183('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9183('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x9183('0x13')](0x9)[_0x9183('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9183('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9183('0x13')](0x9)[_0x9183('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9183('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9183('0x13')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9183('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9183('0x13')](0x5)[_0x9183('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9183('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9183('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x9183('0x13')](0x5)[_0x9183('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9183('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x9183('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x9183('0x2')]('DESC','ASC'),'defaultValue':_0x9183('0x42')},'dialQueueProject2':{'type':Sequelize[_0x9183('0x1')],'comment':_0x9183('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9183('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9183('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9183('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9183('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9183('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9183('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9183('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x9183('0x13')](0x5)[_0x9183('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9183('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9183('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9183('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9183('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x9183('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9183('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9183('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9183('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9183('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9183('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9183('0x13')],'allowNull':!![],'comment':_0x9183('0x4c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9183('0x4d'),'set':function(_0x36d391){if(!_0x36d391)this[_0x9183('0x17')](_0x9183('0x4e'),null);this[_0x9183('0x17')](_0x9183('0x4f'),_0x36d391);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x9183('0x13')](0x3)[_0x9183('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x9183('0x1d')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 09a20dc..c630abc 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 _0x0b3d=['includeAll','findAll','rows','show','params','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','addTeams','teams','Agents','voicePause','flatMap','penalty','sequelize','transaction','TeamVoiceQueue','each','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','forEach','emit','userVoiceQueue:save','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','ids','removeAgents','userVoiceQueue:remove','addAgents','spread','online','isEmpty','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','value','includes','find','type','name','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','VoiceQueue'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x0b3d,0x76));var _0xd0b3=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0x0b3d[_0xfad1a7];return _0x571012;};'use strict';var emlformat=require(_0xd0b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0b3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0b3('0x2'));var moment=require('moment');var BPromise=require(_0xd0b3('0x3'));var Mustache=require('mustache');var util=require(_0xd0b3('0x4'));var path=require('path');var sox=require(_0xd0b3('0x5'));var csv=require(_0xd0b3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0b3('0x7'));var _=require('lodash');var squel=require(_0xd0b3('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0b3('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd0b3('0xa'));var Redis=require('ioredis');var authService=require(_0xd0b3('0xb'));var qs=require(_0xd0b3('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0b3('0xd'))(_0xd0b3('0xe'));var utils=require(_0xd0b3('0xf'));var config=require(_0xd0b3('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd0b3('0x11')]=_[_0xd0b3('0x12')](config[_0xd0b3('0x11')],{'host':_0xd0b3('0x13'),'port':0x18eb});var socket=require(_0xd0b3('0x14'))(new Redis(config[_0xd0b3('0x11')]));require(_0xd0b3('0x15'))['register'](socket);function respondWithStatusCode(_0x2d1376,_0xbd5d4){_0xbd5d4=_0xbd5d4||0xcc;return function(_0x452136){if(_0x452136){return _0x2d1376[_0xd0b3('0x16')](_0xbd5d4);}return _0x2d1376['status'](_0xbd5d4)[_0xd0b3('0x17')]();};}function respondWithResult(_0x1426cc,_0x7a7fcc){_0x7a7fcc=_0x7a7fcc||0xc8;return function(_0x51dbc8){if(_0x51dbc8){return _0x1426cc[_0xd0b3('0x18')](_0x7a7fcc)[_0xd0b3('0x19')](_0x51dbc8);}};}function respondWithFilteredResult(_0x50ea99,_0xd4c8cb){return function(_0x232e6a){if(_0x232e6a){var _0x5045b4=typeof _0xd4c8cb[_0xd0b3('0x1a')]===_0xd0b3('0x1b')&&typeof _0xd4c8cb[_0xd0b3('0x1c')]==='undefined';var _0x8176e2=_0x232e6a[_0xd0b3('0x1d')];var _0x1b411e=_0x5045b4?0x0:_0xd4c8cb['offset'];var _0x5595a1=_0x5045b4?_0x232e6a[_0xd0b3('0x1d')]:_0xd4c8cb['offset']+_0xd4c8cb[_0xd0b3('0x1c')];var _0x1d023d;if(_0x5595a1>=_0x8176e2){_0x5595a1=_0x8176e2;_0x1d023d=0xc8;}else{_0x1d023d=0xce;}_0x50ea99[_0xd0b3('0x18')](_0x1d023d);return _0x50ea99[_0xd0b3('0x1e')](_0xd0b3('0x1f'),_0x1b411e+'-'+_0x5595a1+'/'+_0x8176e2)['json'](_0x232e6a);}return null;};}function patchUpdates(_0x55261e){return function(_0x557937){try{jsonpatch[_0xd0b3('0x20')](_0x557937,_0x55261e,!![]);}catch(_0x40a637){return BPromise[_0xd0b3('0x21')](_0x40a637);}return _0x557937[_0xd0b3('0x22')]();};}function saveUpdates(_0x1ac0cd,_0x500f48){return function(_0x30cb8d){if(_0x30cb8d){return _0x30cb8d[_0xd0b3('0x23')](_0x1ac0cd)[_0xd0b3('0x24')](function(_0x2e0dcc){return _0x2e0dcc;});}return null;};}function removeEntity(_0x550d35,_0x259e05){return function(_0x17836c){if(_0x17836c){return _0x17836c[_0xd0b3('0x25')]()['then'](function(){var _0x48fb43=_0x17836c[_0xd0b3('0x26')]({'plain':!![]});var _0x2a90cf=[{'name':_0xd0b3('0x27'),'value':'inbound','ignore':![]},{'name':_0xd0b3('0x28'),'value':_0xd0b3('0x29'),'ignore':![]}];var _0x5a8cbd=_(_0x2a90cf)[_0xd0b3('0x2a')](_0xd0b3('0x2b'))['map'](_0xd0b3('0x2c'))['value']();if(_[_0xd0b3('0x2d')](_0x5a8cbd,_0x48fb43['type'])){return;}var _0x2c4bca=_[_0xd0b3('0x2e')](_0x2a90cf,[_0xd0b3('0x2c'),_0x48fb43[_0xd0b3('0x2f')]])[_0xd0b3('0x30')];return db[_0xd0b3('0x31')][_0xd0b3('0x25')]({'where':{'type':_0x2c4bca,'resourceId':_0x48fb43['id']}})['then'](function(){return _0x17836c;});})[_0xd0b3('0x24')](function(){_0x550d35[_0xd0b3('0x18')](0xcc)[_0xd0b3('0x17')]();});}};}function handleEntityNotFound(_0x280c2b,_0x51cd8b){return function(_0x32c6f2){if(!_0x32c6f2){_0x280c2b[_0xd0b3('0x16')](0x194);}return _0x32c6f2;};}function handleError(_0x2194e1,_0x337348){_0x337348=_0x337348||0x1f4;return function(_0x51db75){logger[_0xd0b3('0x32')](_0x51db75[_0xd0b3('0x33')]);if(_0x51db75[_0xd0b3('0x30')]){delete _0x51db75[_0xd0b3('0x30')];}_0x2194e1[_0xd0b3('0x18')](_0x337348)[_0xd0b3('0x34')](_0x51db75);};}exports[_0xd0b3('0x35')]=function(_0x3d36c9,_0x18a67d){var _0x1db5dc={},_0x22de39={},_0xa53787={'count':0x0,'rows':[]};var _0x1926ca=_[_0xd0b3('0x36')](db['VoiceQueue'][_0xd0b3('0x37')],function(_0x33df78){return{'name':_0x33df78[_0xd0b3('0x38')],'type':_0x33df78[_0xd0b3('0x2f')]['key']};});_0x22de39['model']=_['map'](_0x1926ca,_0xd0b3('0x30'));_0x22de39[_0xd0b3('0x39')]=_[_0xd0b3('0x3a')](_0x3d36c9[_0xd0b3('0x39')]);_0x22de39[_0xd0b3('0x3b')]=_[_0xd0b3('0x3c')](_0x22de39['model'],_0x22de39[_0xd0b3('0x39')]);_0x1db5dc[_0xd0b3('0x3d')]=_[_0xd0b3('0x3c')](_0x22de39[_0xd0b3('0x3e')],qs[_0xd0b3('0x3f')](_0x3d36c9[_0xd0b3('0x39')][_0xd0b3('0x3f')]));_0x1db5dc[_0xd0b3('0x3d')]=_0x1db5dc[_0xd0b3('0x3d')][_0xd0b3('0x40')]?_0x1db5dc[_0xd0b3('0x3d')]:_0x22de39['model'];if(!_0x3d36c9['query'][_0xd0b3('0x41')](_0xd0b3('0x42'))){_0x1db5dc[_0xd0b3('0x1c')]=qs[_0xd0b3('0x1c')](_0x3d36c9[_0xd0b3('0x39')][_0xd0b3('0x1c')]);_0x1db5dc['offset']=qs[_0xd0b3('0x1a')](_0x3d36c9['query'][_0xd0b3('0x1a')]);}_0x1db5dc[_0xd0b3('0x43')]=qs[_0xd0b3('0x44')](_0x3d36c9[_0xd0b3('0x39')][_0xd0b3('0x44')]);_0x1db5dc['where']=qs['filters'](_[_0xd0b3('0x45')](_0x3d36c9[_0xd0b3('0x39')],_0x22de39['filters']),_0x1926ca);if(_0x3d36c9['query']['filter']){_0x1db5dc[_0xd0b3('0x46')]=_[_0xd0b3('0x47')](_0x1db5dc[_0xd0b3('0x46')],{'$or':_['map'](_0x1926ca,function(_0x49f47e){if(_0x49f47e[_0xd0b3('0x2f')]!==_0xd0b3('0x48')){var _0x24489e={};_0x24489e[_0x49f47e[_0xd0b3('0x30')]]={'$like':'%'+_0x3d36c9['query'][_0xd0b3('0x2a')]+'%'};return _0x24489e;}})});}_0x1db5dc=_['merge']({},_0x1db5dc,_0x3d36c9[_0xd0b3('0x49')]);var _0x5ec72d={'where':_0x1db5dc[_0xd0b3('0x46')]};return db[_0xd0b3('0x4a')]['count'](_0x5ec72d)['then'](function(_0x4a0df4){_0xa53787[_0xd0b3('0x1d')]=_0x4a0df4;if(_0x3d36c9[_0xd0b3('0x39')][_0xd0b3('0x4b')]){_0x1db5dc['include']=[{'all':!![]}];}return db[_0xd0b3('0x4a')][_0xd0b3('0x4c')](_0x1db5dc);})[_0xd0b3('0x24')](function(_0x125cc0){_0xa53787[_0xd0b3('0x4d')]=_0x125cc0;return _0xa53787;})[_0xd0b3('0x24')](respondWithFilteredResult(_0x18a67d,_0x1db5dc))['catch'](handleError(_0x18a67d,null));};exports[_0xd0b3('0x4e')]=function(_0x5b77c0,_0x432c7f){var _0x29502={'raw':![],'where':{'id':_0x5b77c0[_0xd0b3('0x4f')]['id']}},_0x380bb6={};_0x380bb6[_0xd0b3('0x3e')]=_[_0xd0b3('0x3a')](db[_0xd0b3('0x4a')][_0xd0b3('0x37')]);_0x380bb6['query']=_[_0xd0b3('0x3a')](_0x5b77c0[_0xd0b3('0x39')]);_0x380bb6[_0xd0b3('0x3b')]=_[_0xd0b3('0x3c')](_0x380bb6[_0xd0b3('0x3e')],_0x380bb6[_0xd0b3('0x39')]);_0x29502[_0xd0b3('0x3d')]=_[_0xd0b3('0x3c')](_0x380bb6['model'],qs['fields'](_0x5b77c0[_0xd0b3('0x39')]['fields']));_0x29502['attributes']=_0x29502[_0xd0b3('0x3d')][_0xd0b3('0x40')]?_0x29502[_0xd0b3('0x3d')]:_0x380bb6[_0xd0b3('0x3e')];if(_0x5b77c0[_0xd0b3('0x39')][_0xd0b3('0x4b')]){_0x29502[_0xd0b3('0x50')]=[{'all':!![]}];}_0x29502=_[_0xd0b3('0x47')]({},_0x29502,_0x5b77c0[_0xd0b3('0x49')]);return db['VoiceQueue']['find'](_0x29502)['then'](handleEntityNotFound(_0x432c7f,null))['then'](respondWithResult(_0x432c7f,null))[_0xd0b3('0x51')](handleError(_0x432c7f,null));};exports['create']=function(_0x4d5955,_0xbdb21a){return db[_0xd0b3('0x4a')][_0xd0b3('0x52')](_0x4d5955[_0xd0b3('0x53')],{})['then'](function(_0x79d9d5){var _0x3648d1=_0x4d5955[_0xd0b3('0x54')][_0xd0b3('0x26')]({'plain':!![]});if(!_0x3648d1)throw new Error(_0xd0b3('0x55'));if(_0x3648d1['role']===_0xd0b3('0x54')){var _0x1cbf00=_0x79d9d5[_0xd0b3('0x26')]({'plain':!![]});var _0x34d4b6=[{'name':_0xd0b3('0x27'),'value':_0xd0b3('0x56')},{'name':'QueueCampaigns','value':'outbound'}];var _0x1371b8=_[_0xd0b3('0x2e')](_0x34d4b6,['value',_0x1cbf00[_0xd0b3('0x2f')]])['name'];return db[_0xd0b3('0x57')][_0xd0b3('0x2e')]({'where':{'name':_0x1371b8,'userProfileId':_0x3648d1[_0xd0b3('0x58')]},'raw':!![]})[_0xd0b3('0x24')](function(_0x5855a8){if(_0x5855a8&&_0x5855a8[_0xd0b3('0x59')]===0x0){return db[_0xd0b3('0x31')][_0xd0b3('0x52')]({'name':_0x1cbf00[_0xd0b3('0x30')],'resourceId':_0x1cbf00['id'],'type':_0x5855a8[_0xd0b3('0x30')],'sectionId':_0x5855a8['id']},{})[_0xd0b3('0x24')](function(){return _0x79d9d5;});}else{return _0x79d9d5;}})['catch'](function(_0xba6580){logger[_0xd0b3('0x32')](_0xd0b3('0x5a'),_0xba6580);throw _0xba6580;});}return _0x79d9d5;})[_0xd0b3('0x24')](respondWithResult(_0xbdb21a,0xc9))[_0xd0b3('0x51')](handleError(_0xbdb21a,null));};exports[_0xd0b3('0x5b')]=function(_0x428f56,_0xefe47c){var _0x1317c6={'where':{'id':_0x428f56[_0xd0b3('0x4f')]['id']}},_0x355475={};_0x355475['model']=_['keys'](db['VoiceQueue'][_0xd0b3('0x37')]);_0x1317c6[_0xd0b3('0x3d')]=_[_0xd0b3('0x3c')](_0x355475[_0xd0b3('0x3e')],qs[_0xd0b3('0x3f')](_0x428f56[_0xd0b3('0x39')][_0xd0b3('0x3f')]));_0x1317c6[_0xd0b3('0x3d')]=_0x1317c6[_0xd0b3('0x3d')][_0xd0b3('0x40')]?_0x1317c6[_0xd0b3('0x3d')]:_0x355475[_0xd0b3('0x3e')];if(_0x428f56['query']['includeAll']){_0x1317c6[_0xd0b3('0x50')]=[{'all':!![]}];}_0x1317c6=_[_0xd0b3('0x47')]({},_0x1317c6,_0x428f56[_0xd0b3('0x49')]);return db['VoiceQueue']['find'](_0x1317c6)[_0xd0b3('0x24')](handleEntityNotFound(_0xefe47c,null))[_0xd0b3('0x24')](function(_0x1d2c33){if(_0x1d2c33){var _0x464070=_0x1d2c33[_0xd0b3('0x26')]({'plain':!![]});_0x464070=qs[_0xd0b3('0x5c')](_0x464070,['id',_0xd0b3('0x5d'),'updatedAt']);_0x428f56[_0xd0b3('0x53')]=_[_0xd0b3('0x5c')](_0x428f56[_0xd0b3('0x53')],['id','createdAt',_0xd0b3('0x5e')]);return db['VoiceQueue'][_0xd0b3('0x52')](_[_0xd0b3('0x47')](_0x464070,_0x428f56[_0xd0b3('0x53')]),{'include':_0x428f56[_0xd0b3('0x39')][_0xd0b3('0x4b')]?[{'all':!![]}]:undefined})[_0xd0b3('0x24')](function(_0x4f34d4){var _0x4f975a=_0x428f56[_0xd0b3('0x54')][_0xd0b3('0x26')]({'plain':!![]});if(!_0x4f975a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f975a[_0xd0b3('0x5f')]==='user'){var _0x5d7031=_0x4f34d4[_0xd0b3('0x26')]({'plain':!![]});var _0x497998=[{'name':_0xd0b3('0x27'),'value':_0xd0b3('0x56')},{'name':'QueueCampaigns','value':_0xd0b3('0x29')}];var _0x50e285=_[_0xd0b3('0x2e')](_0x497998,[_0xd0b3('0x2c'),_0x5d7031[_0xd0b3('0x2f')]])[_0xd0b3('0x30')];return db['UserProfileSection'][_0xd0b3('0x2e')]({'where':{'name':_0x50e285,'userProfileId':_0x4f975a['userProfileId']},'raw':!![]})[_0xd0b3('0x24')](function(_0x549fd3){if(_0x549fd3&&_0x549fd3['autoAssociation']===0x0){return db[_0xd0b3('0x31')][_0xd0b3('0x52')]({'name':_0x5d7031[_0xd0b3('0x30')],'resourceId':_0x5d7031['id'],'type':_0x549fd3['name'],'sectionId':_0x549fd3['id']},{})['then'](function(){return _0x4f34d4;});}else{return _0x4f34d4;}})[_0xd0b3('0x51')](function(_0x1dd5b3){logger[_0xd0b3('0x32')](_0xd0b3('0x5a'),_0x1dd5b3);throw _0x1dd5b3;});}return _0x4f34d4;});}})['then'](respondWithResult(_0xefe47c,0xc9))['catch'](handleError(_0xefe47c,null));};exports[_0xd0b3('0x23')]=function(_0x1f078d,_0x1b861b){if(_0x1f078d[_0xd0b3('0x53')]['id']){delete _0x1f078d['body']['id'];}return db['VoiceQueue'][_0xd0b3('0x2e')]({'where':{'id':_0x1f078d[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x1b861b,null))[_0xd0b3('0x24')](saveUpdates(_0x1f078d['body'],null))[_0xd0b3('0x24')](respondWithResult(_0x1b861b,null))[_0xd0b3('0x51')](handleError(_0x1b861b,null));};exports[_0xd0b3('0x25')]=function(_0x56f45b,_0x435a9b){return db[_0xd0b3('0x4a')][_0xd0b3('0x2e')]({'where':{'id':_0x56f45b[_0xd0b3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x435a9b,null))[_0xd0b3('0x24')](removeEntity(_0x435a9b,null))['catch'](handleError(_0x435a9b,null));};exports[_0xd0b3('0x60')]=function(_0x19da85,_0x1b8fbe,_0x534ce7){var _0xfcc685={'raw':![],'where':{}};var _0x19c5e4={};var _0x55d45a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd0b3('0x61')]({'where':{'id':_0x19da85[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x1b8fbe,null))[_0xd0b3('0x24')](function(_0x22f8e5){if(_0x22f8e5){_0x19c5e4[_0xd0b3('0x3e')]=_['keys'](db[_0xd0b3('0x62')][_0xd0b3('0x37')]);_0x19c5e4['query']=_[_0xd0b3('0x3a')](_0x19da85[_0xd0b3('0x39')]);_0x19c5e4['filters']=_[_0xd0b3('0x3c')](_0x19c5e4[_0xd0b3('0x3e')],_0x19c5e4['query']);_0xfcc685[_0xd0b3('0x3d')]=_['intersection'](_0x19c5e4['model'],qs[_0xd0b3('0x3f')](_0x19da85[_0xd0b3('0x39')]['fields']));_0xfcc685[_0xd0b3('0x3d')]=_0xfcc685[_0xd0b3('0x3d')][_0xd0b3('0x40')]?_0xfcc685[_0xd0b3('0x3d')]:_0x19c5e4['model'];if(!_0x19da85['query']['hasOwnProperty']('nolimit')){_0xfcc685[_0xd0b3('0x1c')]=qs['limit'](_0x19da85[_0xd0b3('0x39')][_0xd0b3('0x1c')]);_0xfcc685['offset']=qs['offset'](_0x19da85[_0xd0b3('0x39')]['offset']);}_0xfcc685[_0xd0b3('0x43')]=qs['sort'](_0x19da85[_0xd0b3('0x39')]['sort']);_0xfcc685[_0xd0b3('0x46')]=qs['filters'](_[_0xd0b3('0x45')](_0x19da85[_0xd0b3('0x39')],_0x19c5e4[_0xd0b3('0x3b')]));_0xfcc685[_0xd0b3('0x46')][_0xd0b3('0x63')]=_0x22f8e5['id'];if(_0x19da85[_0xd0b3('0x39')][_0xd0b3('0x2a')]){_0xfcc685[_0xd0b3('0x46')]=_[_0xd0b3('0x47')](_0xfcc685[_0xd0b3('0x46')],{'$or':_[_0xd0b3('0x36')](_0xfcc685[_0xd0b3('0x3d')],function(_0x1d2637){var _0x60d7d1={};_0x60d7d1[_0x1d2637]={'$like':'%'+_0x19da85['query']['filter']+'%'};return _0x60d7d1;})});}_0xfcc685=_[_0xd0b3('0x47')]({},_0xfcc685,_0x19da85['options']);return db[_0xd0b3('0x62')][_0xd0b3('0x1d')]({'where':_0xfcc685[_0xd0b3('0x46')]})[_0xd0b3('0x24')](function(_0x4a32f8){_0x55d45a[_0xd0b3('0x1d')]=_0x4a32f8;if(_0x19da85[_0xd0b3('0x39')][_0xd0b3('0x4b')]){_0xfcc685[_0xd0b3('0x50')]=[{'all':!![]}];}return db['CmHopper'][_0xd0b3('0x4c')](_0xfcc685);})['then'](function(_0x3bf700){_0x55d45a['rows']=_0x3bf700;return _0x55d45a;});}})['then'](respondWithFilteredResult(_0x1b8fbe,_0xfcc685))[_0xd0b3('0x51')](handleError(_0x1b8fbe,null));};exports[_0xd0b3('0x64')]=function(_0x14cc2a,_0x17b321,_0x5a53f4){var _0x4898b9={'raw':!![],'where':{}};var _0x34b488={};var _0x734ad0={'count':0x0,'rows':[]};return db[_0xd0b3('0x4a')][_0xd0b3('0x61')]({'where':{'id':_0x14cc2a[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x17b321,null))[_0xd0b3('0x24')](function(_0x1665c1){if(_0x1665c1){_0x34b488[_0xd0b3('0x3e')]=_[_0xd0b3('0x3a')](db[_0xd0b3('0x65')][_0xd0b3('0x37')]);_0x34b488[_0xd0b3('0x39')]=_[_0xd0b3('0x3a')](_0x14cc2a[_0xd0b3('0x39')]);_0x34b488[_0xd0b3('0x3b')]=_[_0xd0b3('0x3c')](_0x34b488[_0xd0b3('0x3e')],_0x34b488[_0xd0b3('0x39')]);_0x4898b9[_0xd0b3('0x3d')]=_[_0xd0b3('0x3c')](_0x34b488[_0xd0b3('0x3e')],qs['fields'](_0x14cc2a[_0xd0b3('0x39')][_0xd0b3('0x3f')]));_0x4898b9[_0xd0b3('0x3d')]=_0x4898b9['attributes'][_0xd0b3('0x40')]?_0x4898b9[_0xd0b3('0x3d')]:_0x34b488[_0xd0b3('0x3e')];if(!_0x14cc2a['query'][_0xd0b3('0x41')]('nolimit')){_0x4898b9['limit']=qs[_0xd0b3('0x1c')](_0x14cc2a['query'][_0xd0b3('0x1c')]);_0x4898b9[_0xd0b3('0x1a')]=qs['offset'](_0x14cc2a[_0xd0b3('0x39')][_0xd0b3('0x1a')]);}_0x4898b9[_0xd0b3('0x43')]=qs['sort'](_0x14cc2a[_0xd0b3('0x39')][_0xd0b3('0x44')]);_0x4898b9[_0xd0b3('0x46')]=qs[_0xd0b3('0x3b')](_[_0xd0b3('0x45')](_0x14cc2a[_0xd0b3('0x39')],_0x34b488[_0xd0b3('0x3b')]));_0x4898b9[_0xd0b3('0x46')][_0xd0b3('0x63')]=_0x1665c1['id'];if(_0x14cc2a[_0xd0b3('0x39')][_0xd0b3('0x2a')]){_0x4898b9[_0xd0b3('0x46')]=_[_0xd0b3('0x47')](_0x4898b9[_0xd0b3('0x46')],{'$or':_[_0xd0b3('0x36')](_0x4898b9[_0xd0b3('0x3d')],function(_0xc87046){var _0x913c93={};_0x913c93[_0xc87046]={'$like':'%'+_0x14cc2a[_0xd0b3('0x39')][_0xd0b3('0x2a')]+'%'};return _0x913c93;})});}_0x4898b9=_['merge']({},_0x4898b9,_0x14cc2a[_0xd0b3('0x49')]);return db[_0xd0b3('0x65')][_0xd0b3('0x1d')]({'where':_0x4898b9['where']})[_0xd0b3('0x24')](function(_0x43494c){_0x734ad0[_0xd0b3('0x1d')]=_0x43494c;if(_0x14cc2a[_0xd0b3('0x39')][_0xd0b3('0x4b')]){_0x4898b9['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xd0b3('0x4c')](_0x4898b9);})[_0xd0b3('0x24')](function(_0x5545dd){_0x734ad0[_0xd0b3('0x4d')]=_0x5545dd;return _0x734ad0;});}})[_0xd0b3('0x24')](respondWithFilteredResult(_0x17b321,_0x4898b9))[_0xd0b3('0x51')](handleError(_0x17b321,null));};exports[_0xd0b3('0x66')]=function(_0x39b2b2,_0x11c9df,_0x5b946a){var _0x28f27a={'raw':!![],'where':{}};var _0xc4b115={};var _0x3e4f9d={'count':0x0,'rows':[]};return db[_0xd0b3('0x4a')][_0xd0b3('0x61')]({'where':{'id':_0x39b2b2['params']['id']}})['then'](handleEntityNotFound(_0x11c9df,null))[_0xd0b3('0x24')](function(_0x14c8b5){if(_0x14c8b5){_0xc4b115[_0xd0b3('0x3e')]=_[_0xd0b3('0x3a')](db[_0xd0b3('0x67')][_0xd0b3('0x37')]);_0xc4b115[_0xd0b3('0x39')]=_[_0xd0b3('0x3a')](_0x39b2b2[_0xd0b3('0x39')]);_0xc4b115[_0xd0b3('0x3b')]=_[_0xd0b3('0x3c')](_0xc4b115['model'],_0xc4b115[_0xd0b3('0x39')]);_0x28f27a['attributes']=_['intersection'](_0xc4b115[_0xd0b3('0x3e')],qs['fields'](_0x39b2b2[_0xd0b3('0x39')][_0xd0b3('0x3f')]));_0x28f27a['attributes']=_0x28f27a['attributes'][_0xd0b3('0x40')]?_0x28f27a[_0xd0b3('0x3d')]:_0xc4b115[_0xd0b3('0x3e')];if(!_0x39b2b2[_0xd0b3('0x39')][_0xd0b3('0x41')](_0xd0b3('0x42'))){_0x28f27a[_0xd0b3('0x1c')]=qs[_0xd0b3('0x1c')](_0x39b2b2[_0xd0b3('0x39')][_0xd0b3('0x1c')]);_0x28f27a['offset']=qs[_0xd0b3('0x1a')](_0x39b2b2[_0xd0b3('0x39')][_0xd0b3('0x1a')]);}_0x28f27a[_0xd0b3('0x43')]=qs[_0xd0b3('0x44')](_0x39b2b2[_0xd0b3('0x39')][_0xd0b3('0x44')]);_0x28f27a['where']=qs[_0xd0b3('0x3b')](_['pick'](_0x39b2b2[_0xd0b3('0x39')],_0xc4b115[_0xd0b3('0x3b')]));_0x28f27a[_0xd0b3('0x46')]['VoiceQueueId']=_0x14c8b5['id'];if(_0x39b2b2[_0xd0b3('0x39')]['filter']){_0x28f27a[_0xd0b3('0x46')]=_[_0xd0b3('0x47')](_0x28f27a[_0xd0b3('0x46')],{'$or':_['map'](_0x28f27a[_0xd0b3('0x3d')],function(_0x339eac){var _0x1e216e={};_0x1e216e[_0x339eac]={'$like':'%'+_0x39b2b2[_0xd0b3('0x39')][_0xd0b3('0x2a')]+'%'};return _0x1e216e;})});}_0x28f27a=_[_0xd0b3('0x47')]({},_0x28f27a,_0x39b2b2[_0xd0b3('0x49')]);return db[_0xd0b3('0x67')]['count']({'where':_0x28f27a[_0xd0b3('0x46')]})[_0xd0b3('0x24')](function(_0x2dba3d){_0x3e4f9d[_0xd0b3('0x1d')]=_0x2dba3d;if(_0x39b2b2[_0xd0b3('0x39')][_0xd0b3('0x4b')]){_0x28f27a[_0xd0b3('0x50')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd0b3('0x4c')](_0x28f27a);})[_0xd0b3('0x24')](function(_0x183cf4){_0x3e4f9d[_0xd0b3('0x4d')]=_0x183cf4;return _0x3e4f9d;});}})[_0xd0b3('0x24')](respondWithFilteredResult(_0x11c9df,_0x28f27a))[_0xd0b3('0x51')](handleError(_0x11c9df,null));};exports[_0xd0b3('0x68')]=function(_0x2a22f4,_0x2d2f1c,_0x5162fb){var _0x5ab19f={'raw':!![],'where':{}};var _0xf96948={};var _0x567cf0={'count':0x0,'rows':[]};return db[_0xd0b3('0x4a')]['findOne']({'where':{'id':_0x2a22f4['params']['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x2d2f1c,null))[_0xd0b3('0x24')](function(_0x2d7b17){if(_0x2d7b17){_0xf96948[_0xd0b3('0x3e')]=_[_0xd0b3('0x3a')](db[_0xd0b3('0x69')][_0xd0b3('0x37')]);_0xf96948['query']=_['keys'](_0x2a22f4[_0xd0b3('0x39')]);_0xf96948[_0xd0b3('0x3b')]=_['intersection'](_0xf96948[_0xd0b3('0x3e')],_0xf96948[_0xd0b3('0x39')]);_0x5ab19f['attributes']=_['intersection'](_0xf96948[_0xd0b3('0x3e')],qs[_0xd0b3('0x3f')](_0x2a22f4['query'][_0xd0b3('0x3f')]));_0x5ab19f['attributes']=_0x5ab19f['attributes'][_0xd0b3('0x40')]?_0x5ab19f[_0xd0b3('0x3d')]:_0xf96948[_0xd0b3('0x3e')];if(!_0x2a22f4['query'][_0xd0b3('0x41')](_0xd0b3('0x42'))){_0x5ab19f['limit']=qs[_0xd0b3('0x1c')](_0x2a22f4[_0xd0b3('0x39')][_0xd0b3('0x1c')]);_0x5ab19f['offset']=qs[_0xd0b3('0x1a')](_0x2a22f4[_0xd0b3('0x39')][_0xd0b3('0x1a')]);}_0x5ab19f[_0xd0b3('0x43')]=qs[_0xd0b3('0x44')](_0x2a22f4[_0xd0b3('0x39')][_0xd0b3('0x44')]);_0x5ab19f['where']=qs[_0xd0b3('0x3b')](_[_0xd0b3('0x45')](_0x2a22f4[_0xd0b3('0x39')],_0xf96948['filters']));_0x5ab19f['where'][_0xd0b3('0x63')]=_0x2d7b17['id'];if(_0x2a22f4['query'][_0xd0b3('0x2a')]){_0x5ab19f[_0xd0b3('0x46')]=_['merge'](_0x5ab19f[_0xd0b3('0x46')],{'$or':_[_0xd0b3('0x36')](_0x5ab19f['attributes'],function(_0x55ae17){var _0x55a507={};_0x55a507[_0x55ae17]={'$like':'%'+_0x2a22f4[_0xd0b3('0x39')]['filter']+'%'};return _0x55a507;})});}_0x5ab19f=_[_0xd0b3('0x47')]({},_0x5ab19f,_0x2a22f4['options']);return db[_0xd0b3('0x69')][_0xd0b3('0x1d')]({'where':_0x5ab19f[_0xd0b3('0x46')]})['then'](function(_0x6cf52c){_0x567cf0[_0xd0b3('0x1d')]=_0x6cf52c;if(_0x2a22f4[_0xd0b3('0x39')][_0xd0b3('0x4b')]){_0x5ab19f[_0xd0b3('0x50')]=[{'all':!![]}];}return db[_0xd0b3('0x69')][_0xd0b3('0x4c')](_0x5ab19f);})['then'](function(_0x57e13d){_0x567cf0[_0xd0b3('0x4d')]=_0x57e13d;return _0x567cf0;});}})['then'](respondWithFilteredResult(_0x2d2f1c,_0x5ab19f))['catch'](handleError(_0x2d2f1c,null));};exports['getTeams']=function(_0x163e85,_0x493825,_0x23dd23){var _0x160b5f={};var _0x461f6b={};var _0x480a84;var _0x3bee14;return db['VoiceQueue'][_0xd0b3('0x61')]({'where':{'id':_0x163e85[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x493825,null))[_0xd0b3('0x24')](function(_0x5ef736){if(_0x5ef736){_0x480a84=_0x5ef736;_0x461f6b['model']=_[_0xd0b3('0x3a')](db[_0xd0b3('0x6a')]['rawAttributes']);_0x461f6b[_0xd0b3('0x39')]=_['keys'](_0x163e85[_0xd0b3('0x39')]);_0x461f6b[_0xd0b3('0x3b')]=_[_0xd0b3('0x3c')](_0x461f6b[_0xd0b3('0x3e')],_0x461f6b[_0xd0b3('0x39')]);_0x160b5f[_0xd0b3('0x3d')]=_['intersection'](_0x461f6b[_0xd0b3('0x3e')],qs['fields'](_0x163e85[_0xd0b3('0x39')][_0xd0b3('0x3f')]));_0x160b5f[_0xd0b3('0x3d')]=_0x160b5f[_0xd0b3('0x3d')][_0xd0b3('0x40')]?_0x160b5f[_0xd0b3('0x3d')]:_0x461f6b['model'];_0x160b5f[_0xd0b3('0x43')]=qs[_0xd0b3('0x44')](_0x163e85['query']['sort']);_0x160b5f[_0xd0b3('0x46')]=qs['filters'](_[_0xd0b3('0x45')](_0x163e85[_0xd0b3('0x39')],_0x461f6b[_0xd0b3('0x3b')]));if(_0x163e85[_0xd0b3('0x39')][_0xd0b3('0x2a')]){_0x160b5f[_0xd0b3('0x46')]=_['merge'](_0x160b5f['where'],{'$or':_[_0xd0b3('0x36')](_0x160b5f[_0xd0b3('0x3d')],function(_0x490dbe){var _0x553da9={};_0x553da9[_0x490dbe]={'$like':'%'+_0x163e85[_0xd0b3('0x39')][_0xd0b3('0x2a')]+'%'};return _0x553da9;})});}_0x160b5f=_[_0xd0b3('0x47')]({},_0x160b5f,_0x163e85[_0xd0b3('0x49')]);return _0x480a84['getTeams'](_0x160b5f);}})[_0xd0b3('0x24')](function(_0x1ead2a){if(_0x1ead2a){_0x3bee14=_0x1ead2a[_0xd0b3('0x40')];if(!_0x163e85['query']['hasOwnProperty']('nolimit')){_0x160b5f[_0xd0b3('0x1c')]=qs[_0xd0b3('0x1c')](_0x163e85['query'][_0xd0b3('0x1c')]);_0x160b5f[_0xd0b3('0x1a')]=qs['offset'](_0x163e85[_0xd0b3('0x39')]['offset']);}return _0x480a84['getTeams'](_0x160b5f);}})['then'](function(_0x5f4ced){if(_0x5f4ced){return _0x5f4ced?{'count':_0x3bee14,'rows':_0x5f4ced}:null;}})['then'](respondWithResult(_0x493825,null))['catch'](handleError(_0x493825,null));};exports[_0xd0b3('0x6b')]=function(_0x38aa5d,_0x5150d9,_0x5d055f){var _0x49e765=_0x38aa5d[_0xd0b3('0x53')][_0xd0b3('0x6c')];var _0x352de2=_[_0xd0b3('0x36')](_0x49e765,'id');return db[_0xd0b3('0x6a')][_0xd0b3('0x4c')]({'where':{'id':_0x352de2},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd0b3('0x6d'),'attributes':['id',_0xd0b3('0x30'),'online',_0xd0b3('0x6e'),'interface'],'raw':!![]}]})[_0xd0b3('0x24')](function(_0x1646f1){if(_0x1646f1){var _0x3562c2=_[_0xd0b3('0x6f')](_0x1646f1,function(_0x1224b7){var _0x7bb2e4=_0x1224b7['get']({'plain':!![]});_0x7bb2e4[_0xd0b3('0x6d')]['forEach'](function(_0x410f25){_0x410f25['penalty']=_[_0xd0b3('0x2e')](_0x49e765,{'id':_0x7bb2e4['id']})[_0xd0b3('0x70')];});return _0x7bb2e4[_0xd0b3('0x6d')];});return db[_0xd0b3('0x4a')]['find']({'where':{'id':_0x38aa5d[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](function(_0x2f45eb){return db[_0xd0b3('0x71')][_0xd0b3('0x72')](function(_0x47cc61){return _0x2f45eb[_0xd0b3('0x6b')](_0x352de2,{'transaction':_0x47cc61})[_0xd0b3('0x24')](function(){return BPromise['each'](_0x49e765,function(_0xcf30a7){return db[_0xd0b3('0x73')]['upsert']({'TeamId':_0xcf30a7['id'],'VoiceQueueId':_0x38aa5d[_0xd0b3('0x4f')]['id'],'penalty':_0xcf30a7[_0xd0b3('0x70')]},{'transaction':_0x47cc61});});})[_0xd0b3('0x24')](function(){return BPromise[_0xd0b3('0x74')](_0x3562c2,function(_0x39d997){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x39d997['id'],'VoiceQueueId':_0x38aa5d[_0xd0b3('0x4f')]['id']},'defaults':{'penalty':_0x39d997['penalty']},'transaction':_0x47cc61});});})[_0xd0b3('0x24')](function(){return BPromise['each'](_[_0xd0b3('0x2a')](_0x3562c2,{'online':!![]}),function(_0x34ec48){return db[_0xd0b3('0x75')][_0xd0b3('0x76')]({'membername':_0x34ec48[_0xd0b3('0x30')],'UserId':_0x34ec48['id'],'queue_name':_0x2f45eb[_0xd0b3('0x30')],'VoiceQueueId':_0x2f45eb['id'],'interface':_[_0xd0b3('0x77')](_0x34ec48[_0xd0b3('0x78')])?util[_0xd0b3('0x79')](_0xd0b3('0x7a'),_0x34ec48['name']):_0x34ec48['interface'],'paused':_0x34ec48[_0xd0b3('0x6e')]||![],'penalty':_0x34ec48[_0xd0b3('0x70')]},{'transaction':_0x47cc61});});})[_0xd0b3('0x24')](function(){_0x3562c2[_0xd0b3('0x7b')](function(_0x189ea1){socket[_0xd0b3('0x7c')](_0xd0b3('0x7d'),{'UserId':_0x189ea1['id'],'VoiceQueueId':_0x2f45eb['id']});});});});});}})[_0xd0b3('0x24')](respondWithStatusCode(_0x5150d9,null))[_0xd0b3('0x51')](handleError(_0x5150d9,null));};exports['removeTeams']=function(_0x1fcabd,_0x1a95f3,_0x334751){return db[_0xd0b3('0x6a')][_0xd0b3('0x4c')]({'where':{'id':_0x1fcabd[_0xd0b3('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd0b3('0x7e')],'as':_0xd0b3('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xd0b3('0x24')](handleEntityNotFound(_0x1a95f3,null))['then'](function(_0x435056){var _0x117b4a=_['map'](_0x435056,'id');var _0x58a58d=[];var _0x38b529=[];var _0x23abd3=squel[_0xd0b3('0x7f')]();_0x23abd3[_0xd0b3('0x80')](_0xd0b3('0x81'))[_0xd0b3('0x82')](_0xd0b3('0x83'),'tq')[_0xd0b3('0x84')](_0xd0b3('0x85'),'ut',_0xd0b3('0x86'))['where'](_0xd0b3('0x87'),_0x1fcabd[_0xd0b3('0x4f')]['id']);for(var _0xb7cbce=0x0;_0xb7cbce<_0x435056[_0xd0b3('0x40')];_0xb7cbce+=0x1){let _0x47bfe9=_0x435056[_0xb7cbce];for(var _0x3f0037=0x0;_0x3f0037<_0x47bfe9['Agents'][_0xd0b3('0x40')];_0x3f0037+=0x1){let _0x423ef7=_0x47bfe9['Agents'][_0x3f0037];var _0x5b1aaf=_0x23abd3[_0xd0b3('0x5b')]();_0x5b1aaf[_0xd0b3('0x46')](_0xd0b3('0x88'),_0x423ef7['id']);_0x38b529[_0xd0b3('0x89')](db[_0xd0b3('0x71')][_0xd0b3('0x39')](_0x5b1aaf[_0xd0b3('0x8a')](),{'type':db[_0xd0b3('0x71')]['QueryTypes'][_0xd0b3('0x8b')]})[_0xd0b3('0x24')](function(_0x3ab5ce){if(_0x3ab5ce[_0xd0b3('0x40')]===0x1){return _0x423ef7['id'];}else{var _0x164878=_[_0xd0b3('0x8c')](_[_0xd0b3('0x36')](_0x3ab5ce,_0xd0b3('0x8d')),function(_0x2385a2){return _[_0xd0b3('0x2d')](_0x117b4a,_0x2385a2);});if(_0x164878){return _0x423ef7['id'];}}}));}}return BPromise[_0xd0b3('0x8e')](_0x38b529)[_0xd0b3('0x24')](function(_0x23f044){_0x58a58d=_(_0x58a58d)[_0xd0b3('0x8f')](_0x23f044)[_0xd0b3('0x90')]()[_0xd0b3('0x2c')]();return db[_0xd0b3('0x4a')][_0xd0b3('0x2e')]({'where':{'id':_0x1fcabd[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](function(_0x11809c){return db[_0xd0b3('0x71')][_0xd0b3('0x72')](function(_0x2a8bae){return _0x11809c['removeTeams'](_0x1fcabd[_0xd0b3('0x39')][_0xd0b3('0x91')],{'transaction':_0x2a8bae})[_0xd0b3('0x24')](function(){if(!_['isEmpty'](_0x58a58d)){return _0x11809c[_0xd0b3('0x92')](_0x58a58d,{'transaction':_0x2a8bae})[_0xd0b3('0x24')](function(){return db['UserVoiceQueueRt'][_0xd0b3('0x25')]({'where':{'VoiceQueueId':_0x1fcabd[_0xd0b3('0x4f')]['id'],'UserId':_0x58a58d},'transaction':_0x2a8bae});});}})['then'](function(){_0x58a58d[_0xd0b3('0x7b')](function(_0x345068){socket[_0xd0b3('0x7c')](_0xd0b3('0x93'),{'UserId':_0x345068,'VoiceQueueId':_0x11809c['id']});});});});});});})[_0xd0b3('0x24')](respondWithStatusCode(_0x1a95f3,null))[_0xd0b3('0x51')](handleError(_0x1a95f3,null));};exports[_0xd0b3('0x94')]=function(_0x4e1151,_0x3be42d,_0x49a35c){var _0x5c2f85,_0x43eca3;return db[_0xd0b3('0x4a')][_0xd0b3('0x2e')]({'where':{'id':_0x4e1151[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x3be42d,null))[_0xd0b3('0x24')](function(_0x3819fe){if(_0x3819fe){_0x43eca3=_0x3819fe;return _0x3819fe[_0xd0b3('0x94')](_0x4e1151[_0xd0b3('0x53')]['ids'],_[_0xd0b3('0x5c')](_0x4e1151[_0xd0b3('0x53')],[_0xd0b3('0x91'),'id'])||{})[_0xd0b3('0x95')](function(_0x1873e9){for(var _0x523a63=0x0;_0x523a63<_0x4e1151[_0xd0b3('0x53')][_0xd0b3('0x91')][_0xd0b3('0x40')];_0x523a63+=0x1){socket['emit'](_0xd0b3('0x7d'),{'UserId':Number(_0x4e1151[_0xd0b3('0x53')]['ids'][_0x523a63]),'VoiceQueueId':Number(_0x4e1151[_0xd0b3('0x4f')]['id'])});}return _0x1873e9;});}})['then'](function(_0x2fa775){_0x5c2f85=_0x2fa775||[];if(_0x43eca3){return db[_0xd0b3('0x7e')]['findAll']({'where':{'id':_0x4e1151['body'][_0xd0b3('0x91')]},'attributes':['id',_0xd0b3('0x30'),_0xd0b3('0x96'),'voicePause',_0xd0b3('0x78')],'raw':!![]});}})[_0xd0b3('0x24')](function(_0x509ffd){if(!_[_0xd0b3('0x97')](_0x509ffd)){var _0x1f44a2=[];for(var _0x6e06bc=0x0;_0x6e06bc<_0x509ffd[_0xd0b3('0x40')];_0x6e06bc++){if(_0x509ffd[_0x6e06bc][_0xd0b3('0x96')]){_0x1f44a2[_0xd0b3('0x89')](db['UserVoiceQueueRt'][_0xd0b3('0x76')]({'membername':_0x509ffd[_0x6e06bc]['name'],'UserId':_0x509ffd[_0x6e06bc]['id'],'queue_name':_0x43eca3[_0xd0b3('0x30')],'VoiceQueueId':_0x43eca3['id'],'interface':_[_0xd0b3('0x77')](_0x509ffd[_0x6e06bc][_0xd0b3('0x78')])?util[_0xd0b3('0x79')](_0xd0b3('0x7a'),_0x509ffd[_0x6e06bc]['name']):_0x509ffd[_0x6e06bc]['interface'],'paused':_0x509ffd[_0x6e06bc][_0xd0b3('0x6e')]||![],'penalty':_0x4e1151[_0xd0b3('0x53')][_0xd0b3('0x70')]||0x0}));}}return BPromise[_0xd0b3('0x8e')](_0x1f44a2);}})[_0xd0b3('0x24')](function(){return _0x5c2f85;})[_0xd0b3('0x24')](respondWithResult(_0x3be42d,null))[_0xd0b3('0x51')](handleError(_0x3be42d,null));};exports[_0xd0b3('0x92')]=function(_0x58d381,_0x3ad5af,_0x48cf21){return db[_0xd0b3('0x4a')][_0xd0b3('0x2e')]({'where':{'id':_0x58d381[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x3ad5af,null))[_0xd0b3('0x24')](function(_0x28ae0e){if(_0x28ae0e){return _0x28ae0e[_0xd0b3('0x92')](_0x58d381['query']['ids'])['then'](function(){if(_[_0xd0b3('0x98')](_0x58d381[_0xd0b3('0x39')]['ids'])){for(var _0x413d60=0x0;_0x413d60<_0x58d381[_0xd0b3('0x39')]['ids'][_0xd0b3('0x40')];_0x413d60+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x58d381[_0xd0b3('0x39')][_0xd0b3('0x91')][_0x413d60]),'VoiceQueueId':Number(_0x58d381['params']['id'])});}}else{socket[_0xd0b3('0x7c')](_0xd0b3('0x93'),{'UserId':Number(_0x58d381[_0xd0b3('0x39')][_0xd0b3('0x91')]),'VoiceQueueId':Number(_0x58d381[_0xd0b3('0x4f')]['id'])});}});}})[_0xd0b3('0x24')](function(_0x49452b){return db[_0xd0b3('0x75')][_0xd0b3('0x25')]({'where':{'VoiceQueueId':_0x58d381[_0xd0b3('0x4f')]['id'],'UserId':_0x58d381['query'][_0xd0b3('0x91')]}})[_0xd0b3('0x24')](function(){return _0x49452b;});})[_0xd0b3('0x24')](respondWithStatusCode(_0x3ad5af,null))[_0xd0b3('0x51')](handleError(_0x3ad5af,null));};exports[_0xd0b3('0x99')]=function(_0x43fe9d,_0x5d5e7c,_0x4170f4){var _0x25dccb={};var _0x51f836={};var _0x53777b;var _0x2db2b0;return db['VoiceQueue'][_0xd0b3('0x61')]({'where':{'id':_0x43fe9d[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x5d5e7c,null))[_0xd0b3('0x24')](function(_0x529593){if(_0x529593){_0x53777b=_0x529593;_0x51f836['model']=_[_0xd0b3('0x3a')](db[_0xd0b3('0x7e')][_0xd0b3('0x37')]);_0x51f836[_0xd0b3('0x39')]=_[_0xd0b3('0x3a')](_0x43fe9d[_0xd0b3('0x39')]);_0x51f836[_0xd0b3('0x3b')]=_[_0xd0b3('0x3c')](_0x51f836[_0xd0b3('0x3e')],_0x51f836['query']);_0x25dccb['attributes']=_[_0xd0b3('0x3c')](_0x51f836['model'],qs[_0xd0b3('0x3f')](_0x43fe9d[_0xd0b3('0x39')][_0xd0b3('0x3f')]));_0x25dccb[_0xd0b3('0x3d')]=_0x25dccb[_0xd0b3('0x3d')][_0xd0b3('0x40')]?_0x25dccb['attributes']:_0x51f836[_0xd0b3('0x3e')];_0x25dccb[_0xd0b3('0x43')]=qs[_0xd0b3('0x44')](_0x43fe9d[_0xd0b3('0x39')][_0xd0b3('0x44')]);_0x25dccb['where']=qs[_0xd0b3('0x3b')](_[_0xd0b3('0x45')](_0x43fe9d[_0xd0b3('0x39')],_0x51f836[_0xd0b3('0x3b')]));if(_0x43fe9d[_0xd0b3('0x39')][_0xd0b3('0x2a')]){_0x25dccb['where']=_[_0xd0b3('0x47')](_0x25dccb['where'],{'$or':_[_0xd0b3('0x36')](_0x25dccb[_0xd0b3('0x3d')],function(_0x414a48){var _0x2116de={};_0x2116de[_0x414a48]={'$like':'%'+_0x43fe9d[_0xd0b3('0x39')][_0xd0b3('0x2a')]+'%'};return _0x2116de;})});}_0x25dccb=_['merge']({},_0x25dccb,_0x43fe9d[_0xd0b3('0x49')]);return _0x53777b[_0xd0b3('0x99')](_0x25dccb);}})[_0xd0b3('0x24')](function(_0x49330f){if(_0x49330f){_0x2db2b0=_0x49330f[_0xd0b3('0x40')];if(!_0x43fe9d[_0xd0b3('0x39')]['hasOwnProperty'](_0xd0b3('0x42'))){_0x25dccb[_0xd0b3('0x1c')]=qs[_0xd0b3('0x1c')](_0x43fe9d['query']['limit']);_0x25dccb[_0xd0b3('0x1a')]=qs[_0xd0b3('0x1a')](_0x43fe9d['query']['offset']);}return _0x53777b[_0xd0b3('0x99')](_0x25dccb);}})[_0xd0b3('0x24')](function(_0x1837b8){if(_0x1837b8){return _0x1837b8?{'count':_0x2db2b0,'rows':_0x1837b8}:null;}})['then'](respondWithResult(_0x5d5e7c,null))[_0xd0b3('0x51')](handleError(_0x5d5e7c,null));};exports[_0xd0b3('0x9a')]=function(_0x42f72d,_0x5174f0,_0x4ebf8e){var _0x148de5={};var _0x1643c3={};var _0x4d56a8;var _0x267310;return db[_0xd0b3('0x4a')][_0xd0b3('0x61')]({'where':{'id':_0x42f72d[_0xd0b3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5174f0,null))['then'](function(_0x576b9e){if(_0x576b9e){_0x4d56a8=_0x576b9e;_0x1643c3[_0xd0b3('0x3e')]=_[_0xd0b3('0x3a')](db[_0xd0b3('0x75')][_0xd0b3('0x37')]);_0x1643c3['query']=_['keys'](_0x42f72d[_0xd0b3('0x39')]);_0x1643c3[_0xd0b3('0x3b')]=_[_0xd0b3('0x3c')](_0x1643c3['model'],_0x1643c3[_0xd0b3('0x39')]);_0x148de5['attributes']=_[_0xd0b3('0x3c')](_0x1643c3['model'],qs['fields'](_0x42f72d['query'][_0xd0b3('0x3f')]));_0x148de5['attributes']=_0x148de5[_0xd0b3('0x3d')]['length']?_0x148de5['attributes']:_0x1643c3[_0xd0b3('0x3e')];_0x148de5[_0xd0b3('0x43')]=qs['sort'](_0x42f72d[_0xd0b3('0x39')][_0xd0b3('0x44')]);_0x148de5[_0xd0b3('0x46')]=qs[_0xd0b3('0x3b')](_[_0xd0b3('0x45')](_0x42f72d[_0xd0b3('0x39')],_0x1643c3[_0xd0b3('0x3b')]));if(_0x42f72d[_0xd0b3('0x39')][_0xd0b3('0x2a')]){_0x148de5['where']=_[_0xd0b3('0x47')](_0x148de5[_0xd0b3('0x46')],{'$or':_[_0xd0b3('0x36')](_0x148de5[_0xd0b3('0x3d')],function(_0x1e3076){var _0x35364f={};_0x35364f[_0x1e3076]={'$like':'%'+_0x42f72d[_0xd0b3('0x39')][_0xd0b3('0x2a')]+'%'};return _0x35364f;})});}_0x148de5=_[_0xd0b3('0x47')]({},_0x148de5,_0x42f72d[_0xd0b3('0x49')]);return _0x4d56a8[_0xd0b3('0x9a')](_0x148de5);}})['then'](function(_0x12ca2d){if(_0x12ca2d){_0x267310=_0x12ca2d[_0xd0b3('0x40')];if(!_0x42f72d[_0xd0b3('0x39')]['hasOwnProperty']('nolimit')){_0x148de5[_0xd0b3('0x1c')]=qs[_0xd0b3('0x1c')](_0x42f72d[_0xd0b3('0x39')][_0xd0b3('0x1c')]);_0x148de5['offset']=qs['offset'](_0x42f72d[_0xd0b3('0x39')]['offset']);}return _0x4d56a8[_0xd0b3('0x9a')](_0x148de5);}})[_0xd0b3('0x24')](function(_0x31b91f){return _0x31b91f?{'count':_0x267310,'rows':_0x31b91f}:null;})[_0xd0b3('0x24')](respondWithResult(_0x5174f0,null))[_0xd0b3('0x51')](handleError(_0x5174f0,null));};exports[_0xd0b3('0x9b')]=function(_0x787b4c,_0x3d3c0b,_0x2285b6){var _0x2e3b1d={};var _0x321e0d={};var _0x1fbf92;var _0x1cddcb;return db[_0xd0b3('0x4a')][_0xd0b3('0x61')]({'where':{'id':_0x787b4c[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x3d3c0b,null))[_0xd0b3('0x24')](function(_0x29a9ef){if(_0x29a9ef){_0x1fbf92=_0x29a9ef;_0x321e0d[_0xd0b3('0x3e')]=_['keys'](db[_0xd0b3('0x9c')][_0xd0b3('0x37')]);_0x321e0d[_0xd0b3('0x39')]=_['keys'](_0x787b4c[_0xd0b3('0x39')]);_0x321e0d[_0xd0b3('0x3b')]=_[_0xd0b3('0x3c')](_0x321e0d['model'],_0x321e0d[_0xd0b3('0x39')]);_0x2e3b1d[_0xd0b3('0x3d')]=_['intersection'](_0x321e0d[_0xd0b3('0x3e')],qs[_0xd0b3('0x3f')](_0x787b4c[_0xd0b3('0x39')][_0xd0b3('0x3f')]));_0x2e3b1d['attributes']=_0x2e3b1d['attributes'][_0xd0b3('0x40')]?_0x2e3b1d[_0xd0b3('0x3d')]:_0x321e0d[_0xd0b3('0x3e')];_0x2e3b1d[_0xd0b3('0x43')]=qs['sort'](_0x787b4c[_0xd0b3('0x39')][_0xd0b3('0x44')]);_0x2e3b1d['where']=qs[_0xd0b3('0x3b')](_[_0xd0b3('0x45')](_0x787b4c[_0xd0b3('0x39')],_0x321e0d['filters']));if(_0x787b4c[_0xd0b3('0x39')][_0xd0b3('0x2a')]){_0x2e3b1d[_0xd0b3('0x46')]=_[_0xd0b3('0x47')](_0x2e3b1d['where'],{'$or':_['map'](_0x2e3b1d[_0xd0b3('0x3d')],function(_0x151512){var _0x2c306e={};_0x2c306e[_0x151512]={'$like':'%'+_0x787b4c[_0xd0b3('0x39')][_0xd0b3('0x2a')]+'%'};return _0x2c306e;})});}_0x2e3b1d=_[_0xd0b3('0x47')]({},_0x2e3b1d,_0x787b4c['options']);return _0x1fbf92[_0xd0b3('0x9b')](_0x2e3b1d);}})['then'](function(_0x3c6217){if(_0x3c6217){_0x1cddcb=_0x3c6217[_0xd0b3('0x40')];if(!_0x787b4c[_0xd0b3('0x39')][_0xd0b3('0x41')](_0xd0b3('0x42'))){_0x2e3b1d[_0xd0b3('0x1c')]=qs[_0xd0b3('0x1c')](_0x787b4c[_0xd0b3('0x39')][_0xd0b3('0x1c')]);_0x2e3b1d[_0xd0b3('0x1a')]=qs[_0xd0b3('0x1a')](_0x787b4c[_0xd0b3('0x39')]['offset']);}return _0x1fbf92[_0xd0b3('0x9b')](_0x2e3b1d);}})['then'](function(_0x1e56e5){if(_0x1e56e5){return _0x1e56e5?{'count':_0x1cddcb,'rows':_0x1e56e5}:null;}})[_0xd0b3('0x24')](respondWithResult(_0x3d3c0b,null))['catch'](handleError(_0x3d3c0b,null));};exports[_0xd0b3('0x9d')]=function(_0x4d69bf,_0x278c48,_0xc91874){var _0x392030=moment()['format'](_0xd0b3('0x9e'));var _0x31687f,_0x5c7c53;return db['VoiceQueue']['find']({'where':{'id':_0x4d69bf[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x278c48,null))[_0xd0b3('0x24')](function(_0x9289a4){if(_0x9289a4){_0x5c7c53=_0x9289a4;return _0x9289a4[_0xd0b3('0x9d')](_0x4d69bf[_0xd0b3('0x53')][_0xd0b3('0x91')],_[_0xd0b3('0x5c')](_0x4d69bf[_0xd0b3('0x53')],['ids','id'])||{});}return null;})[_0xd0b3('0x95')](function(_0x4dd4ac){var _0x14ca0a;_0x31687f=_0x4dd4ac||[];var _0x343eec=[];if(_0x4dd4ac){for(var _0x535736=0x0;_0x535736<_0x4dd4ac[_0xd0b3('0x40')];_0x535736+=0x1){var _0x3bf4c4=_0x4dd4ac[_0x535736]['get']({'plain':!![]});_0x5c7c53['dialCheckDuplicateType']=_0x4d69bf[_0xd0b3('0x53')][_0xd0b3('0x9f')]?_0x4d69bf['body'][_0xd0b3('0x9f')]:_0x5c7c53[_0xd0b3('0x9f')];switch(_0x5c7c53['dialCheckDuplicateType']){case _0xd0b3('0xa0'):_0x14ca0a=squel[_0xd0b3('0xa1')]()[_0xd0b3('0xa2')]('cm_hopper')[_0xd0b3('0xa3')]([_0xd0b3('0xa4'),_0xd0b3('0xa5'),_0xd0b3('0xa6'),_0xd0b3('0xa7'),'VoiceQueueId',_0xd0b3('0x5d'),_0xd0b3('0x5e')],squel[_0xd0b3('0x7f')]()[_0xd0b3('0x80')](_0xd0b3('0xa4'),_0xd0b3('0xa4'))[_0xd0b3('0x80')]('\x27'+_0x392030+'\x27',_0xd0b3('0xa5'))[_0xd0b3('0x80')]('id','ContactId')['field'](_0x3bf4c4[_0xd0b3('0xa8')][_0xd0b3('0x8a')](),_0xd0b3('0xa7'))['field'](_0x4d69bf[_0xd0b3('0x4f')]['id'][_0xd0b3('0x8a')](),_0xd0b3('0x63'))['field']('\x27'+_0x392030+'\x27',_0xd0b3('0x5d'))['field']('\x27'+_0x392030+'\x27',_0xd0b3('0x5e'))[_0xd0b3('0x82')](_0xd0b3('0xa9'))[_0xd0b3('0x46')]('deletedAt\x20IS\x20NULL')[_0xd0b3('0x46')](_0xd0b3('0xaa'),_0x3bf4c4[_0xd0b3('0xa8')]['toString']())['where'](_0xd0b3('0xab'))['where'](_0xd0b3('0xac'),squel['select']()[_0xd0b3('0x80')](_0xd0b3('0xad'))[_0xd0b3('0x82')]('cm_hopper_final')[_0xd0b3('0x46')]('VoiceQueueId\x20=\x20?',_0x4d69bf[_0xd0b3('0x4f')]['id'][_0xd0b3('0x8a')]()))[_0xd0b3('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd0b3('0x7f')]()[_0xd0b3('0x80')](_0xd0b3('0xae'))[_0xd0b3('0x82')](_0xd0b3('0xaf'))['where'](_0xd0b3('0x87'),_0x4d69bf[_0xd0b3('0x4f')]['id']['toString']())))[_0xd0b3('0x8a')]();break;case _0xd0b3('0xb0'):_0x14ca0a=squel[_0xd0b3('0xa1')]()['into'](_0xd0b3('0xaf'))[_0xd0b3('0xa3')]([_0xd0b3('0xa4'),_0xd0b3('0xa5'),'ContactId',_0xd0b3('0xa7'),_0xd0b3('0x63'),'createdAt',_0xd0b3('0x5e')],squel[_0xd0b3('0x7f')]()['field'](_0xd0b3('0xa4'),_0xd0b3('0xa4'))[_0xd0b3('0x80')]('\x27'+_0x392030+'\x27',_0xd0b3('0xa5'))['field']('id',_0xd0b3('0xa6'))[_0xd0b3('0x80')](_0x3bf4c4[_0xd0b3('0xa8')]['toString'](),_0xd0b3('0xa7'))['field'](_0x4d69bf['params']['id'][_0xd0b3('0x8a')](),_0xd0b3('0x63'))['field']('\x27'+_0x392030+'\x27',_0xd0b3('0x5d'))[_0xd0b3('0x80')]('\x27'+_0x392030+'\x27',_0xd0b3('0x5e'))[_0xd0b3('0x82')](_0xd0b3('0xa9'))[_0xd0b3('0x46')](_0xd0b3('0xb1'))['where'](_0xd0b3('0xaa'),_0x3bf4c4[_0xd0b3('0xa8')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0xd0b3('0x46')](_0xd0b3('0xac'),squel[_0xd0b3('0x7f')]()[_0xd0b3('0x80')](_0xd0b3('0xae'))[_0xd0b3('0x82')](_0xd0b3('0xaf'))[_0xd0b3('0x46')](_0xd0b3('0x87'),_0x4d69bf[_0xd0b3('0x4f')]['id'][_0xd0b3('0x8a')]())))[_0xd0b3('0x8a')]();break;default:_0x14ca0a=squel['insert']()[_0xd0b3('0xa2')](_0xd0b3('0xaf'))[_0xd0b3('0xa3')]([_0xd0b3('0xa4'),_0xd0b3('0xa5'),_0xd0b3('0xa6'),_0xd0b3('0xa7'),_0xd0b3('0x63'),_0xd0b3('0x5d'),'updatedAt'],squel[_0xd0b3('0x7f')]()['field'](_0xd0b3('0xa4'),_0xd0b3('0xa4'))[_0xd0b3('0x80')]('\x27'+_0x392030+'\x27',_0xd0b3('0xa5'))['field']('id',_0xd0b3('0xa6'))[_0xd0b3('0x80')](_0x3bf4c4[_0xd0b3('0xa8')]['toString'](),_0xd0b3('0xa7'))['field'](_0x4d69bf[_0xd0b3('0x4f')]['id']['toString'](),'VoiceQueueId')[_0xd0b3('0x80')]('\x27'+_0x392030+'\x27',_0xd0b3('0x5d'))[_0xd0b3('0x80')]('\x27'+_0x392030+'\x27',_0xd0b3('0x5e'))[_0xd0b3('0x82')](_0xd0b3('0xa9'))[_0xd0b3('0x46')](_0xd0b3('0xb1'))[_0xd0b3('0x46')]('ListId\x20=\x20?',_0x3bf4c4['CmListId']['toString']())[_0xd0b3('0x46')](_0xd0b3('0xab')))['toString']();}_0x343eec[_0xd0b3('0x89')](db[_0xd0b3('0x71')][_0xd0b3('0x39')](_0x14ca0a));}return BPromise[_0xd0b3('0x8e')](_0x343eec);}})[_0xd0b3('0x24')](function(){var _0x587d7b=[];var _0x26239a=squel[_0xd0b3('0xa1')]()[_0xd0b3('0xa2')](_0xd0b3('0xb2'))[_0xd0b3('0xa3')]([_0xd0b3('0xb3'),_0xd0b3('0xa4'),_0xd0b3('0xb4'),_0xd0b3('0x5d'),'updatedAt'],squel[_0xd0b3('0x7f')]()[_0xd0b3('0x80')](_0xd0b3('0xb5'))['field'](_0xd0b3('0xb6'))[_0xd0b3('0x80')]('ci.OrderBy+1')['field']('\x27'+_0x392030+'\x27',_0xd0b3('0x5d'))['field']('\x27'+_0x392030+'\x27','updatedAt')['from'](_0xd0b3('0xb7'),'ci')[_0xd0b3('0x84')](_0xd0b3('0xaf'),'h',_0xd0b3('0xb8'))['where'](_0xd0b3('0xb9'),_0x392030)[_0xd0b3('0x46')](_0xd0b3('0xba'),_0xd0b3('0xbb')))[_0xd0b3('0x8a')]();_0x587d7b[_0xd0b3('0x89')](db[_0xd0b3('0x71')][_0xd0b3('0x39')](_0x26239a));return BPromise[_0xd0b3('0x8e')](_0x587d7b);})[_0xd0b3('0x24')](function(){return _0x31687f;})[_0xd0b3('0x24')](respondWithResult(_0x278c48,null))[_0xd0b3('0x51')](handleError(_0x278c48,null));};exports[_0xd0b3('0xbc')]=function(_0x5e86f6,_0x117e75,_0x2238bf){return db[_0xd0b3('0x4a')][_0xd0b3('0x2e')]({'where':{'id':_0x5e86f6[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0x117e75,null))[_0xd0b3('0x24')](function(_0x2a25d2){if(_0x2a25d2){return _0x2a25d2[_0xd0b3('0xbc')](_0x5e86f6[_0xd0b3('0x39')][_0xd0b3('0x91')]);}})[_0xd0b3('0x24')](function(_0x278abf){if(_0x278abf){return db[_0xd0b3('0x62')][_0xd0b3('0x25')]({'where':{'ListId':_0x5e86f6[_0xd0b3('0x39')][_0xd0b3('0x91')],'VoiceQueueId':_0x5e86f6[_0xd0b3('0x4f')]['id']}})['then'](function(){return _0x278abf;});}})[_0xd0b3('0x24')](respondWithStatusCode(_0x117e75,null))['catch'](handleError(_0x117e75,null));};exports[_0xd0b3('0xbd')]=function(_0x62a60a,_0x2d201d,_0xd1eee9){var _0x207bad={};var _0x136a69={};var _0x6e877b;var _0x1d714f;return db[_0xd0b3('0x4a')][_0xd0b3('0x61')]({'where':{'id':_0x62a60a[_0xd0b3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2d201d,null))[_0xd0b3('0x24')](function(_0x5ab02e){if(_0x5ab02e){_0x6e877b=_0x5ab02e;_0x136a69[_0xd0b3('0x3e')]=_[_0xd0b3('0x3a')](db['CmList']['rawAttributes']);_0x136a69[_0xd0b3('0x39')]=_[_0xd0b3('0x3a')](_0x62a60a[_0xd0b3('0x39')]);_0x136a69[_0xd0b3('0x3b')]=_['intersection'](_0x136a69[_0xd0b3('0x3e')],_0x136a69[_0xd0b3('0x39')]);_0x207bad[_0xd0b3('0x3d')]=_['intersection'](_0x136a69[_0xd0b3('0x3e')],qs[_0xd0b3('0x3f')](_0x62a60a['query'][_0xd0b3('0x3f')]));_0x207bad[_0xd0b3('0x3d')]=_0x207bad['attributes'][_0xd0b3('0x40')]?_0x207bad['attributes']:_0x136a69[_0xd0b3('0x3e')];_0x207bad[_0xd0b3('0x43')]=qs['sort'](_0x62a60a['query']['sort']);_0x207bad[_0xd0b3('0x46')]=qs['filters'](_['pick'](_0x62a60a[_0xd0b3('0x39')],_0x136a69[_0xd0b3('0x3b')]));if(_0x62a60a[_0xd0b3('0x39')][_0xd0b3('0x2a')]){_0x207bad['where']=_[_0xd0b3('0x47')](_0x207bad[_0xd0b3('0x46')],{'$or':_[_0xd0b3('0x36')](_0x207bad[_0xd0b3('0x3d')],function(_0xa4a879){var _0x5671c9={};_0x5671c9[_0xa4a879]={'$like':'%'+_0x62a60a['query']['filter']+'%'};return _0x5671c9;})});}_0x207bad=_['merge']({},_0x207bad,_0x62a60a[_0xd0b3('0x49')]);return _0x6e877b[_0xd0b3('0xbd')](_0x207bad);}})[_0xd0b3('0x24')](function(_0x18c7ac){if(_0x18c7ac){_0x1d714f=_0x18c7ac[_0xd0b3('0x40')];if(!_0x62a60a[_0xd0b3('0x39')][_0xd0b3('0x41')](_0xd0b3('0x42'))){_0x207bad[_0xd0b3('0x1c')]=qs['limit'](_0x62a60a['query'][_0xd0b3('0x1c')]);_0x207bad['offset']=qs[_0xd0b3('0x1a')](_0x62a60a[_0xd0b3('0x39')]['offset']);}return _0x6e877b[_0xd0b3('0xbd')](_0x207bad);}})[_0xd0b3('0x24')](function(_0x21f223){if(_0x21f223){return _0x21f223?{'count':_0x1d714f,'rows':_0x21f223}:null;}})[_0xd0b3('0x24')](respondWithResult(_0x2d201d,null))[_0xd0b3('0x51')](handleError(_0x2d201d,null));};exports['addBlackLists']=function(_0xf528c7,_0xf64a36,_0x5f3774){var _0x38d2fe,_0x5888e9;return db[_0xd0b3('0x4a')][_0xd0b3('0x2e')]({'where':{'id':_0xf528c7['params']['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0xf64a36,null))[_0xd0b3('0x24')](function(_0xa72a0a){if(_0xa72a0a){_0x5888e9=_0xa72a0a;return _0xa72a0a[_0xd0b3('0xbe')](_0xf528c7[_0xd0b3('0x53')][_0xd0b3('0x91')],_[_0xd0b3('0x5c')](_0xf528c7[_0xd0b3('0x53')],['ids','id'])||{});}return null;})[_0xd0b3('0x95')](function(_0x340738){var _0x1eaba9;_0x38d2fe=_0x340738||[];var _0x398534=[];if(_0x340738){for(var _0x1c8631=0x0;_0x1c8631<_0x340738[_0xd0b3('0x40')];_0x1c8631+=0x1){var _0x58074f=_0x340738[_0x1c8631][_0xd0b3('0x26')]({'plain':!![]});_0x1eaba9=squel[_0xd0b3('0xa1')]()[_0xd0b3('0xa2')]('cm_hopper_black')[_0xd0b3('0xa3')]([_0xd0b3('0xa4'),'ContactId','ListId','VoiceQueueId',_0xd0b3('0x5d'),_0xd0b3('0x5e')],squel[_0xd0b3('0x7f')]()[_0xd0b3('0x80')](_0xd0b3('0xa4'),_0xd0b3('0xa4'))[_0xd0b3('0x80')]('id',_0xd0b3('0xa6'))[_0xd0b3('0x80')](_0x58074f['CmListId'][_0xd0b3('0x8a')](),_0xd0b3('0xa7'))['field'](_0xf528c7[_0xd0b3('0x4f')]['id'][_0xd0b3('0x8a')](),_0xd0b3('0x63'))['field'](_0xd0b3('0xbf'),_0xd0b3('0x5d'))[_0xd0b3('0x80')](_0xd0b3('0xbf'),'updatedAt')[_0xd0b3('0x82')](_0xd0b3('0xa9'))[_0xd0b3('0x46')](_0xd0b3('0xb1'))[_0xd0b3('0x46')]('ListId\x20=\x20?',_0x58074f[_0xd0b3('0xa8')][_0xd0b3('0x8a')]())[_0xd0b3('0x46')](_0xd0b3('0xab')))[_0xd0b3('0x8a')]();_0x398534[_0xd0b3('0x89')](db[_0xd0b3('0x71')][_0xd0b3('0x39')](_0x1eaba9));}return BPromise[_0xd0b3('0x8e')](_0x398534);}})[_0xd0b3('0x24')](function(){return _0x38d2fe;})[_0xd0b3('0x24')](respondWithResult(_0xf64a36,null))['catch'](handleError(_0xf64a36,null));};exports['removeBlackLists']=function(_0x64f894,_0xfec0cf,_0x578b8b){return db[_0xd0b3('0x4a')][_0xd0b3('0x2e')]({'where':{'id':_0x64f894[_0xd0b3('0x4f')]['id']}})[_0xd0b3('0x24')](handleEntityNotFound(_0xfec0cf,null))[_0xd0b3('0x24')](function(_0xbafa90){if(_0xbafa90){return _0xbafa90[_0xd0b3('0xc0')](_0x64f894[_0xd0b3('0x39')]['ids']);}})[_0xd0b3('0x24')](function(_0x14bdce){if(_0x14bdce){return db[_0xd0b3('0x69')][_0xd0b3('0x25')]({'where':{'ListId':_0x64f894[_0xd0b3('0x39')]['ids'],'VoiceQueueId':_0x64f894['params']['id']}})[_0xd0b3('0x24')](function(){return _0x14bdce;});}})['then'](respondWithStatusCode(_0xfec0cf,null))['catch'](handleError(_0xfec0cf,null));}; \ No newline at end of file +var _0xcedf=['join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','transaction','ids','removeAgents','addAgents','spread','User','isEmpty','upsert','isArray','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','updatedAt','select','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','push','CmHopperId','OrderBy','h.id','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','fs-extra','squel','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','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','inbound','QueueCampaigns','ignore','map','value','type','find','name','UserProfileResource','error','stack','index','VoiceQueue','rawAttributes','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','outbound','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','SIP/%s','interface','emit','userVoiceQueue:save','removeTeams','field','tq.TeamId','from'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xcedf,0x1b6));var _0xfced=function(_0x34baa4,_0x3b683b){_0x34baa4=_0x34baa4-0x0;var _0x26b3fc=_0xcedf[_0x34baa4];return _0x26b3fc;};'use strict';var emlformat=require(_0xfced('0x0'));var rimraf=require(_0xfced('0x1'));var zipdir=require(_0xfced('0x2'));var jsonpatch=require(_0xfced('0x3'));var rp=require('request-promise');var moment=require(_0xfced('0x4'));var BPromise=require(_0xfced('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfced('0x6'));var sox=require('sox');var csv=require(_0xfced('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfced('0x8'));var _=require('lodash');var squel=require(_0xfced('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfced('0xa'));var toCsv=require(_0xfced('0x7'));var querystring=require(_0xfced('0xb'));var Papa=require(_0xfced('0xc'));var Redis=require('ioredis');var authService=require(_0xfced('0xd'));var qs=require(_0xfced('0xe'));var as=require(_0xfced('0xf'));var hardwareService=require(_0xfced('0x10'));var logger=require(_0xfced('0x11'))(_0xfced('0x12'));var utils=require(_0xfced('0x13'));var config=require(_0xfced('0x14'));var licenseUtil=require(_0xfced('0x15'));var db=require('../../mysqldb')['db'];config[_0xfced('0x16')]=_['defaults'](config[_0xfced('0x16')],{'host':_0xfced('0x17'),'port':0x18eb});var socket=require(_0xfced('0x18'))(new Redis(config[_0xfced('0x16')]));require('./voiceQueue.socket')[_0xfced('0x19')](socket);function respondWithStatusCode(_0x28cc02,_0x26a0d8){_0x26a0d8=_0x26a0d8||0xcc;return function(_0xf35a7f){if(_0xf35a7f){return _0x28cc02[_0xfced('0x1a')](_0x26a0d8);}return _0x28cc02[_0xfced('0x1b')](_0x26a0d8)[_0xfced('0x1c')]();};}function respondWithResult(_0xe3a203,_0x486519){_0x486519=_0x486519||0xc8;return function(_0x95b06f){if(_0x95b06f){return _0xe3a203['status'](_0x486519)[_0xfced('0x1d')](_0x95b06f);}};}function respondWithFilteredResult(_0x2111ce,_0x194805){return function(_0x2d00dc){if(_0x2d00dc){var _0x38528a=typeof _0x194805[_0xfced('0x1e')]===_0xfced('0x1f')&&typeof _0x194805[_0xfced('0x20')]===_0xfced('0x1f');var _0x16d442=_0x2d00dc['count'];var _0x29494c=_0x38528a?0x0:_0x194805[_0xfced('0x1e')];var _0x409f38=_0x38528a?_0x2d00dc[_0xfced('0x21')]:_0x194805[_0xfced('0x1e')]+_0x194805['limit'];var _0x595036;if(_0x409f38>=_0x16d442){_0x409f38=_0x16d442;_0x595036=0xc8;}else{_0x595036=0xce;}_0x2111ce[_0xfced('0x1b')](_0x595036);return _0x2111ce[_0xfced('0x22')]('Content-Range',_0x29494c+'-'+_0x409f38+'/'+_0x16d442)[_0xfced('0x1d')](_0x2d00dc);}return null;};}function patchUpdates(_0x445862){return function(_0x2732cc){try{jsonpatch[_0xfced('0x23')](_0x2732cc,_0x445862,!![]);}catch(_0xbc5ed4){return BPromise[_0xfced('0x24')](_0xbc5ed4);}return _0x2732cc['save']();};}function saveUpdates(_0x16d9a3,_0x2722d9){return function(_0xe2c4e0){if(_0xe2c4e0){return _0xe2c4e0[_0xfced('0x25')](_0x16d9a3)[_0xfced('0x26')](function(_0x56a26e){return _0x56a26e;});}return null;};}function removeEntity(_0x4edb87,_0x3c6fdb){return function(_0x3c9eb8){if(_0x3c9eb8){return _0x3c9eb8[_0xfced('0x27')]()[_0xfced('0x26')](function(){var _0x4d67bf=_0x3c9eb8[_0xfced('0x28')]({'plain':!![]});var _0x4ef6a0=[{'name':'VoiceQueues','value':_0xfced('0x29'),'ignore':![]},{'name':_0xfced('0x2a'),'value':'outbound','ignore':![]}];var _0x1adea4=_(_0x4ef6a0)['filter'](_0xfced('0x2b'))[_0xfced('0x2c')](_0xfced('0x2d'))[_0xfced('0x2d')]();if(_['includes'](_0x1adea4,_0x4d67bf[_0xfced('0x2e')])){return;}var _0x3431ea=_[_0xfced('0x2f')](_0x4ef6a0,[_0xfced('0x2d'),_0x4d67bf['type']])[_0xfced('0x30')];return db[_0xfced('0x31')][_0xfced('0x27')]({'where':{'type':_0x3431ea,'resourceId':_0x4d67bf['id']}})['then'](function(){return _0x3c9eb8;});})[_0xfced('0x26')](function(){_0x4edb87[_0xfced('0x1b')](0xcc)[_0xfced('0x1c')]();});}};}function handleEntityNotFound(_0xed15c9,_0x513ba8){return function(_0x1131d2){if(!_0x1131d2){_0xed15c9[_0xfced('0x1a')](0x194);}return _0x1131d2;};}function handleError(_0x13f42c,_0x46df0f){_0x46df0f=_0x46df0f||0x1f4;return function(_0x10c5da){logger[_0xfced('0x32')](_0x10c5da[_0xfced('0x33')]);if(_0x10c5da[_0xfced('0x30')]){delete _0x10c5da['name'];}_0x13f42c['status'](_0x46df0f)['send'](_0x10c5da);};}exports[_0xfced('0x34')]=function(_0x1a72cb,_0x3d462d){var _0x421f09={},_0xe017fd={},_0x5bba5c={'count':0x0,'rows':[]};var _0x173c1f=_[_0xfced('0x2c')](db[_0xfced('0x35')][_0xfced('0x36')],function(_0x34e759){return{'name':_0x34e759['fieldName'],'type':_0x34e759['type'][_0xfced('0x37')]};});_0xe017fd['model']=_[_0xfced('0x2c')](_0x173c1f,_0xfced('0x30'));_0xe017fd['query']=_[_0xfced('0x38')](_0x1a72cb['query']);_0xe017fd[_0xfced('0x39')]=_[_0xfced('0x3a')](_0xe017fd[_0xfced('0x3b')],_0xe017fd[_0xfced('0x3c')]);_0x421f09[_0xfced('0x3d')]=_[_0xfced('0x3a')](_0xe017fd[_0xfced('0x3b')],qs[_0xfced('0x3e')](_0x1a72cb[_0xfced('0x3c')]['fields']));_0x421f09[_0xfced('0x3d')]=_0x421f09[_0xfced('0x3d')][_0xfced('0x3f')]?_0x421f09[_0xfced('0x3d')]:_0xe017fd[_0xfced('0x3b')];if(!_0x1a72cb[_0xfced('0x3c')][_0xfced('0x40')](_0xfced('0x41'))){_0x421f09[_0xfced('0x20')]=qs[_0xfced('0x20')](_0x1a72cb[_0xfced('0x3c')][_0xfced('0x20')]);_0x421f09[_0xfced('0x1e')]=qs[_0xfced('0x1e')](_0x1a72cb[_0xfced('0x3c')][_0xfced('0x1e')]);}_0x421f09[_0xfced('0x42')]=qs[_0xfced('0x43')](_0x1a72cb[_0xfced('0x3c')][_0xfced('0x43')]);_0x421f09[_0xfced('0x44')]=qs[_0xfced('0x39')](_[_0xfced('0x45')](_0x1a72cb[_0xfced('0x3c')],_0xe017fd[_0xfced('0x39')]),_0x173c1f);if(_0x1a72cb[_0xfced('0x3c')][_0xfced('0x46')]){_0x421f09[_0xfced('0x44')]=_[_0xfced('0x47')](_0x421f09[_0xfced('0x44')],{'$or':_['map'](_0x173c1f,function(_0x4dad70){if(_0x4dad70['type']!=='VIRTUAL'){var _0x438ea5={};_0x438ea5[_0x4dad70['name']]={'$like':'%'+_0x1a72cb[_0xfced('0x3c')]['filter']+'%'};return _0x438ea5;}})});}_0x421f09=_[_0xfced('0x47')]({},_0x421f09,_0x1a72cb[_0xfced('0x48')]);var _0x4d5e72={'where':_0x421f09[_0xfced('0x44')]};return db[_0xfced('0x35')][_0xfced('0x21')](_0x4d5e72)[_0xfced('0x26')](function(_0x19da77){_0x5bba5c[_0xfced('0x21')]=_0x19da77;if(_0x1a72cb[_0xfced('0x3c')][_0xfced('0x49')]){_0x421f09[_0xfced('0x4a')]=[{'all':!![]}];}return db['VoiceQueue'][_0xfced('0x4b')](_0x421f09);})[_0xfced('0x26')](function(_0x42758f){_0x5bba5c[_0xfced('0x4c')]=_0x42758f;return _0x5bba5c;})[_0xfced('0x26')](respondWithFilteredResult(_0x3d462d,_0x421f09))[_0xfced('0x4d')](handleError(_0x3d462d,null));};exports[_0xfced('0x4e')]=function(_0xb9c2b6,_0x5dc9c5){var _0x4120a6={'raw':![],'where':{'id':_0xb9c2b6[_0xfced('0x4f')]['id']}},_0x322dca={};_0x322dca[_0xfced('0x3b')]=_['keys'](db[_0xfced('0x35')][_0xfced('0x36')]);_0x322dca[_0xfced('0x3c')]=_[_0xfced('0x38')](_0xb9c2b6[_0xfced('0x3c')]);_0x322dca['filters']=_[_0xfced('0x3a')](_0x322dca['model'],_0x322dca[_0xfced('0x3c')]);_0x4120a6['attributes']=_[_0xfced('0x3a')](_0x322dca['model'],qs[_0xfced('0x3e')](_0xb9c2b6['query']['fields']));_0x4120a6['attributes']=_0x4120a6[_0xfced('0x3d')][_0xfced('0x3f')]?_0x4120a6[_0xfced('0x3d')]:_0x322dca[_0xfced('0x3b')];if(_0xb9c2b6[_0xfced('0x3c')]['includeAll']){_0x4120a6['include']=[{'all':!![]}];}_0x4120a6=_[_0xfced('0x47')]({},_0x4120a6,_0xb9c2b6[_0xfced('0x48')]);return db[_0xfced('0x35')][_0xfced('0x2f')](_0x4120a6)[_0xfced('0x26')](handleEntityNotFound(_0x5dc9c5,null))['then'](respondWithResult(_0x5dc9c5,null))[_0xfced('0x4d')](handleError(_0x5dc9c5,null));};exports['create']=function(_0x2be71d,_0x4f0a1f){return db[_0xfced('0x35')][_0xfced('0x50')](_0x2be71d[_0xfced('0x51')],{})[_0xfced('0x26')](function(_0x57e410){var _0x24f1c8=_0x2be71d[_0xfced('0x52')][_0xfced('0x28')]({'plain':!![]});if(!_0x24f1c8)throw new Error(_0xfced('0x53'));if(_0x24f1c8[_0xfced('0x54')]===_0xfced('0x52')){var _0x12217c=_0x57e410[_0xfced('0x28')]({'plain':!![]});var _0x28c8b8=[{'name':_0xfced('0x55'),'value':'inbound'},{'name':_0xfced('0x2a'),'value':'outbound'}];var _0x16caec=_[_0xfced('0x2f')](_0x28c8b8,['value',_0x12217c[_0xfced('0x2e')]])[_0xfced('0x30')];return db[_0xfced('0x56')][_0xfced('0x2f')]({'where':{'name':_0x16caec,'userProfileId':_0x24f1c8[_0xfced('0x57')]},'raw':!![]})[_0xfced('0x26')](function(_0x120612){if(_0x120612&&_0x120612[_0xfced('0x58')]===0x0){return db[_0xfced('0x31')][_0xfced('0x50')]({'name':_0x12217c[_0xfced('0x30')],'resourceId':_0x12217c['id'],'type':_0x120612[_0xfced('0x30')],'sectionId':_0x120612['id']},{})[_0xfced('0x26')](function(){return _0x57e410;});}else{return _0x57e410;}})[_0xfced('0x4d')](function(_0x527dc8){logger[_0xfced('0x32')](_0xfced('0x59'),_0x527dc8);throw _0x527dc8;});}return _0x57e410;})[_0xfced('0x26')](respondWithResult(_0x4f0a1f,0xc9))['catch'](handleError(_0x4f0a1f,null));};exports[_0xfced('0x5a')]=function(_0x5c5790,_0x33d456){var _0x28e002={'where':{'id':_0x5c5790[_0xfced('0x4f')]['id']}},_0xcbecee={};_0xcbecee[_0xfced('0x3b')]=_[_0xfced('0x38')](db[_0xfced('0x35')][_0xfced('0x36')]);_0x28e002[_0xfced('0x3d')]=_[_0xfced('0x3a')](_0xcbecee[_0xfced('0x3b')],qs[_0xfced('0x3e')](_0x5c5790[_0xfced('0x3c')][_0xfced('0x3e')]));_0x28e002[_0xfced('0x3d')]=_0x28e002[_0xfced('0x3d')]['length']?_0x28e002[_0xfced('0x3d')]:_0xcbecee[_0xfced('0x3b')];if(_0x5c5790[_0xfced('0x3c')][_0xfced('0x49')]){_0x28e002[_0xfced('0x4a')]=[{'all':!![]}];}_0x28e002=_[_0xfced('0x47')]({},_0x28e002,_0x5c5790[_0xfced('0x48')]);return db[_0xfced('0x35')][_0xfced('0x2f')](_0x28e002)[_0xfced('0x26')](handleEntityNotFound(_0x33d456,null))[_0xfced('0x26')](function(_0x5a434b){if(_0x5a434b){var _0x10e9b0=_0x5a434b[_0xfced('0x28')]({'plain':!![]});_0x10e9b0=qs[_0xfced('0x5b')](_0x10e9b0,['id',_0xfced('0x5c'),'updatedAt']);_0x5c5790[_0xfced('0x51')]=_[_0xfced('0x5b')](_0x5c5790[_0xfced('0x51')],['id','createdAt','updatedAt']);return db[_0xfced('0x35')][_0xfced('0x50')](_[_0xfced('0x47')](_0x10e9b0,_0x5c5790[_0xfced('0x51')]),{'include':_0x5c5790[_0xfced('0x3c')][_0xfced('0x49')]?[{'all':!![]}]:undefined})[_0xfced('0x26')](function(_0x4b03ed){var _0x1f50d5=_0x5c5790[_0xfced('0x52')][_0xfced('0x28')]({'plain':!![]});if(!_0x1f50d5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f50d5['role']===_0xfced('0x52')){var _0x8d7d9b=_0x4b03ed[_0xfced('0x28')]({'plain':!![]});var _0x21a837=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':_0xfced('0x5d')}];var _0x3f4d1b=_[_0xfced('0x2f')](_0x21a837,['value',_0x8d7d9b['type']])['name'];return db['UserProfileSection'][_0xfced('0x2f')]({'where':{'name':_0x3f4d1b,'userProfileId':_0x1f50d5['userProfileId']},'raw':!![]})[_0xfced('0x26')](function(_0x9c7ac6){if(_0x9c7ac6&&_0x9c7ac6[_0xfced('0x58')]===0x0){return db[_0xfced('0x31')][_0xfced('0x50')]({'name':_0x8d7d9b[_0xfced('0x30')],'resourceId':_0x8d7d9b['id'],'type':_0x9c7ac6[_0xfced('0x30')],'sectionId':_0x9c7ac6['id']},{})['then'](function(){return _0x4b03ed;});}else{return _0x4b03ed;}})[_0xfced('0x4d')](function(_0x4e4c89){logger[_0xfced('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e4c89);throw _0x4e4c89;});}return _0x4b03ed;});}})[_0xfced('0x26')](respondWithResult(_0x33d456,0xc9))['catch'](handleError(_0x33d456,null));};exports[_0xfced('0x25')]=function(_0x8eedf8,_0x470b42){if(_0x8eedf8[_0xfced('0x51')]['id']){delete _0x8eedf8[_0xfced('0x51')]['id'];}return db[_0xfced('0x35')][_0xfced('0x2f')]({'where':{'id':_0x8eedf8['params']['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x470b42,null))[_0xfced('0x26')](saveUpdates(_0x8eedf8[_0xfced('0x51')],null))[_0xfced('0x26')](respondWithResult(_0x470b42,null))[_0xfced('0x4d')](handleError(_0x470b42,null));};exports[_0xfced('0x27')]=function(_0x3c6c9e,_0x1c9c8c){return db[_0xfced('0x35')]['find']({'where':{'id':_0x3c6c9e[_0xfced('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c9c8c,null))[_0xfced('0x26')](removeEntity(_0x1c9c8c,null))[_0xfced('0x4d')](handleError(_0x1c9c8c,null));};exports[_0xfced('0x5e')]=function(_0x3e2491,_0x302cdb,_0x237ccd){var _0x5a0d6d={'raw':![],'where':{}};var _0x18a921={};var _0x20868b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xfced('0x5f')]({'where':{'id':_0x3e2491[_0xfced('0x4f')]['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x302cdb,null))[_0xfced('0x26')](function(_0x32b4ba){if(_0x32b4ba){_0x18a921[_0xfced('0x3b')]=_['keys'](db[_0xfced('0x60')][_0xfced('0x36')]);_0x18a921[_0xfced('0x3c')]=_[_0xfced('0x38')](_0x3e2491[_0xfced('0x3c')]);_0x18a921['filters']=_[_0xfced('0x3a')](_0x18a921[_0xfced('0x3b')],_0x18a921[_0xfced('0x3c')]);_0x5a0d6d[_0xfced('0x3d')]=_[_0xfced('0x3a')](_0x18a921[_0xfced('0x3b')],qs['fields'](_0x3e2491[_0xfced('0x3c')][_0xfced('0x3e')]));_0x5a0d6d[_0xfced('0x3d')]=_0x5a0d6d[_0xfced('0x3d')]['length']?_0x5a0d6d['attributes']:_0x18a921[_0xfced('0x3b')];if(!_0x3e2491[_0xfced('0x3c')][_0xfced('0x40')](_0xfced('0x41'))){_0x5a0d6d[_0xfced('0x20')]=qs[_0xfced('0x20')](_0x3e2491[_0xfced('0x3c')][_0xfced('0x20')]);_0x5a0d6d[_0xfced('0x1e')]=qs[_0xfced('0x1e')](_0x3e2491[_0xfced('0x3c')]['offset']);}_0x5a0d6d[_0xfced('0x42')]=qs[_0xfced('0x43')](_0x3e2491['query']['sort']);_0x5a0d6d[_0xfced('0x44')]=qs['filters'](_[_0xfced('0x45')](_0x3e2491[_0xfced('0x3c')],_0x18a921['filters']));_0x5a0d6d['where'][_0xfced('0x61')]=_0x32b4ba['id'];if(_0x3e2491['query'][_0xfced('0x46')]){_0x5a0d6d[_0xfced('0x44')]=_[_0xfced('0x47')](_0x5a0d6d[_0xfced('0x44')],{'$or':_[_0xfced('0x2c')](_0x5a0d6d[_0xfced('0x3d')],function(_0x1e9038){var _0x30b408={};_0x30b408[_0x1e9038]={'$like':'%'+_0x3e2491[_0xfced('0x3c')][_0xfced('0x46')]+'%'};return _0x30b408;})});}_0x5a0d6d=_[_0xfced('0x47')]({},_0x5a0d6d,_0x3e2491[_0xfced('0x48')]);return db[_0xfced('0x60')]['count']({'where':_0x5a0d6d['where']})['then'](function(_0x1c666c){_0x20868b[_0xfced('0x21')]=_0x1c666c;if(_0x3e2491['query'][_0xfced('0x49')]){_0x5a0d6d[_0xfced('0x4a')]=[{'all':!![]}];}return db[_0xfced('0x60')]['findAll'](_0x5a0d6d);})[_0xfced('0x26')](function(_0x4e8227){_0x20868b['rows']=_0x4e8227;return _0x20868b;});}})[_0xfced('0x26')](respondWithFilteredResult(_0x302cdb,_0x5a0d6d))[_0xfced('0x4d')](handleError(_0x302cdb,null));};exports[_0xfced('0x62')]=function(_0x4af702,_0x98f0a,_0x443f23){var _0x1bb789={'raw':!![],'where':{}};var _0x32f3a7={};var _0x1f4ffc={'count':0x0,'rows':[]};return db[_0xfced('0x35')][_0xfced('0x5f')]({'where':{'id':_0x4af702[_0xfced('0x4f')]['id']}})['then'](handleEntityNotFound(_0x98f0a,null))[_0xfced('0x26')](function(_0x569e48){if(_0x569e48){_0x32f3a7[_0xfced('0x3b')]=_[_0xfced('0x38')](db[_0xfced('0x63')][_0xfced('0x36')]);_0x32f3a7[_0xfced('0x3c')]=_[_0xfced('0x38')](_0x4af702[_0xfced('0x3c')]);_0x32f3a7['filters']=_[_0xfced('0x3a')](_0x32f3a7[_0xfced('0x3b')],_0x32f3a7[_0xfced('0x3c')]);_0x1bb789['attributes']=_[_0xfced('0x3a')](_0x32f3a7['model'],qs[_0xfced('0x3e')](_0x4af702['query'][_0xfced('0x3e')]));_0x1bb789[_0xfced('0x3d')]=_0x1bb789[_0xfced('0x3d')]['length']?_0x1bb789[_0xfced('0x3d')]:_0x32f3a7['model'];if(!_0x4af702['query'][_0xfced('0x40')]('nolimit')){_0x1bb789['limit']=qs[_0xfced('0x20')](_0x4af702[_0xfced('0x3c')][_0xfced('0x20')]);_0x1bb789[_0xfced('0x1e')]=qs[_0xfced('0x1e')](_0x4af702[_0xfced('0x3c')][_0xfced('0x1e')]);}_0x1bb789['order']=qs[_0xfced('0x43')](_0x4af702['query']['sort']);_0x1bb789[_0xfced('0x44')]=qs[_0xfced('0x39')](_[_0xfced('0x45')](_0x4af702['query'],_0x32f3a7[_0xfced('0x39')]));_0x1bb789['where'][_0xfced('0x61')]=_0x569e48['id'];if(_0x4af702['query'][_0xfced('0x46')]){_0x1bb789['where']=_['merge'](_0x1bb789[_0xfced('0x44')],{'$or':_['map'](_0x1bb789[_0xfced('0x3d')],function(_0x40e2a6){var _0x59f32a={};_0x59f32a[_0x40e2a6]={'$like':'%'+_0x4af702[_0xfced('0x3c')]['filter']+'%'};return _0x59f32a;})});}_0x1bb789=_[_0xfced('0x47')]({},_0x1bb789,_0x4af702[_0xfced('0x48')]);return db['CmHopperHistory'][_0xfced('0x21')]({'where':_0x1bb789[_0xfced('0x44')]})['then'](function(_0x167cb2){_0x1f4ffc[_0xfced('0x21')]=_0x167cb2;if(_0x4af702[_0xfced('0x3c')][_0xfced('0x49')]){_0x1bb789['include']=[{'all':!![]}];}return db[_0xfced('0x63')][_0xfced('0x4b')](_0x1bb789);})[_0xfced('0x26')](function(_0x145188){_0x1f4ffc[_0xfced('0x4c')]=_0x145188;return _0x1f4ffc;});}})[_0xfced('0x26')](respondWithFilteredResult(_0x98f0a,_0x1bb789))[_0xfced('0x4d')](handleError(_0x98f0a,null));};exports['getHopperFinals']=function(_0x5c6a6e,_0x1761bc,_0x1af41b){var _0x1a0b3e={'raw':!![],'where':{}};var _0x9ee373={};var _0x3f7744={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5c6a6e[_0xfced('0x4f')]['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x1761bc,null))[_0xfced('0x26')](function(_0x3c56c1){if(_0x3c56c1){_0x9ee373['model']=_[_0xfced('0x38')](db[_0xfced('0x64')][_0xfced('0x36')]);_0x9ee373[_0xfced('0x3c')]=_[_0xfced('0x38')](_0x5c6a6e[_0xfced('0x3c')]);_0x9ee373[_0xfced('0x39')]=_[_0xfced('0x3a')](_0x9ee373[_0xfced('0x3b')],_0x9ee373[_0xfced('0x3c')]);_0x1a0b3e[_0xfced('0x3d')]=_['intersection'](_0x9ee373[_0xfced('0x3b')],qs[_0xfced('0x3e')](_0x5c6a6e[_0xfced('0x3c')][_0xfced('0x3e')]));_0x1a0b3e[_0xfced('0x3d')]=_0x1a0b3e[_0xfced('0x3d')][_0xfced('0x3f')]?_0x1a0b3e[_0xfced('0x3d')]:_0x9ee373[_0xfced('0x3b')];if(!_0x5c6a6e[_0xfced('0x3c')]['hasOwnProperty']('nolimit')){_0x1a0b3e['limit']=qs[_0xfced('0x20')](_0x5c6a6e['query'][_0xfced('0x20')]);_0x1a0b3e[_0xfced('0x1e')]=qs[_0xfced('0x1e')](_0x5c6a6e[_0xfced('0x3c')][_0xfced('0x1e')]);}_0x1a0b3e[_0xfced('0x42')]=qs['sort'](_0x5c6a6e[_0xfced('0x3c')][_0xfced('0x43')]);_0x1a0b3e[_0xfced('0x44')]=qs['filters'](_['pick'](_0x5c6a6e[_0xfced('0x3c')],_0x9ee373[_0xfced('0x39')]));_0x1a0b3e[_0xfced('0x44')][_0xfced('0x61')]=_0x3c56c1['id'];if(_0x5c6a6e[_0xfced('0x3c')]['filter']){_0x1a0b3e[_0xfced('0x44')]=_['merge'](_0x1a0b3e[_0xfced('0x44')],{'$or':_['map'](_0x1a0b3e[_0xfced('0x3d')],function(_0x3812ea){var _0x39d185={};_0x39d185[_0x3812ea]={'$like':'%'+_0x5c6a6e[_0xfced('0x3c')][_0xfced('0x46')]+'%'};return _0x39d185;})});}_0x1a0b3e=_[_0xfced('0x47')]({},_0x1a0b3e,_0x5c6a6e[_0xfced('0x48')]);return db[_0xfced('0x64')][_0xfced('0x21')]({'where':_0x1a0b3e[_0xfced('0x44')]})[_0xfced('0x26')](function(_0x3d6c5b){_0x3f7744[_0xfced('0x21')]=_0x3d6c5b;if(_0x5c6a6e['query']['includeAll']){_0x1a0b3e[_0xfced('0x4a')]=[{'all':!![]}];}return db[_0xfced('0x64')][_0xfced('0x4b')](_0x1a0b3e);})[_0xfced('0x26')](function(_0x25f436){_0x3f7744['rows']=_0x25f436;return _0x3f7744;});}})[_0xfced('0x26')](respondWithFilteredResult(_0x1761bc,_0x1a0b3e))[_0xfced('0x4d')](handleError(_0x1761bc,null));};exports['getHopperBlacks']=function(_0x3437df,_0x412a34,_0x3e1f3c){var _0x4b1d6e={'raw':!![],'where':{}};var _0x44c0fe={};var _0x5d4ae5={'count':0x0,'rows':[]};return db[_0xfced('0x35')]['findOne']({'where':{'id':_0x3437df['params']['id']}})['then'](handleEntityNotFound(_0x412a34,null))[_0xfced('0x26')](function(_0x597eaa){if(_0x597eaa){_0x44c0fe['model']=_[_0xfced('0x38')](db[_0xfced('0x65')][_0xfced('0x36')]);_0x44c0fe[_0xfced('0x3c')]=_[_0xfced('0x38')](_0x3437df[_0xfced('0x3c')]);_0x44c0fe['filters']=_[_0xfced('0x3a')](_0x44c0fe[_0xfced('0x3b')],_0x44c0fe[_0xfced('0x3c')]);_0x4b1d6e['attributes']=_[_0xfced('0x3a')](_0x44c0fe[_0xfced('0x3b')],qs[_0xfced('0x3e')](_0x3437df['query'][_0xfced('0x3e')]));_0x4b1d6e['attributes']=_0x4b1d6e[_0xfced('0x3d')][_0xfced('0x3f')]?_0x4b1d6e[_0xfced('0x3d')]:_0x44c0fe['model'];if(!_0x3437df['query'][_0xfced('0x40')](_0xfced('0x41'))){_0x4b1d6e[_0xfced('0x20')]=qs[_0xfced('0x20')](_0x3437df[_0xfced('0x3c')][_0xfced('0x20')]);_0x4b1d6e['offset']=qs[_0xfced('0x1e')](_0x3437df[_0xfced('0x3c')]['offset']);}_0x4b1d6e[_0xfced('0x42')]=qs[_0xfced('0x43')](_0x3437df[_0xfced('0x3c')][_0xfced('0x43')]);_0x4b1d6e[_0xfced('0x44')]=qs['filters'](_[_0xfced('0x45')](_0x3437df[_0xfced('0x3c')],_0x44c0fe[_0xfced('0x39')]));_0x4b1d6e['where'][_0xfced('0x61')]=_0x597eaa['id'];if(_0x3437df[_0xfced('0x3c')][_0xfced('0x46')]){_0x4b1d6e['where']=_['merge'](_0x4b1d6e['where'],{'$or':_['map'](_0x4b1d6e[_0xfced('0x3d')],function(_0x2637cc){var _0x37cccf={};_0x37cccf[_0x2637cc]={'$like':'%'+_0x3437df[_0xfced('0x3c')]['filter']+'%'};return _0x37cccf;})});}_0x4b1d6e=_[_0xfced('0x47')]({},_0x4b1d6e,_0x3437df[_0xfced('0x48')]);return db['CmHopperBlack'][_0xfced('0x21')]({'where':_0x4b1d6e[_0xfced('0x44')]})[_0xfced('0x26')](function(_0x4e529c){_0x5d4ae5[_0xfced('0x21')]=_0x4e529c;if(_0x3437df[_0xfced('0x3c')][_0xfced('0x49')]){_0x4b1d6e[_0xfced('0x4a')]=[{'all':!![]}];}return db[_0xfced('0x65')]['findAll'](_0x4b1d6e);})['then'](function(_0x32b622){_0x5d4ae5[_0xfced('0x4c')]=_0x32b622;return _0x5d4ae5;});}})[_0xfced('0x26')](respondWithFilteredResult(_0x412a34,_0x4b1d6e))[_0xfced('0x4d')](handleError(_0x412a34,null));};exports[_0xfced('0x66')]=function(_0xef3879,_0x2ba891,_0x43f98a){var _0x611a9f={};var _0x5879c7={};var _0x72a40e;var _0x54de38;return db[_0xfced('0x35')][_0xfced('0x5f')]({'where':{'id':_0xef3879['params']['id']}})['then'](handleEntityNotFound(_0x2ba891,null))[_0xfced('0x26')](function(_0x892968){if(_0x892968){_0x72a40e=_0x892968;_0x5879c7['model']=_[_0xfced('0x38')](db['Team'][_0xfced('0x36')]);_0x5879c7['query']=_[_0xfced('0x38')](_0xef3879[_0xfced('0x3c')]);_0x5879c7['filters']=_['intersection'](_0x5879c7[_0xfced('0x3b')],_0x5879c7[_0xfced('0x3c')]);_0x611a9f[_0xfced('0x3d')]=_['intersection'](_0x5879c7[_0xfced('0x3b')],qs[_0xfced('0x3e')](_0xef3879[_0xfced('0x3c')][_0xfced('0x3e')]));_0x611a9f['attributes']=_0x611a9f[_0xfced('0x3d')][_0xfced('0x3f')]?_0x611a9f['attributes']:_0x5879c7[_0xfced('0x3b')];_0x611a9f[_0xfced('0x42')]=qs[_0xfced('0x43')](_0xef3879[_0xfced('0x3c')][_0xfced('0x43')]);_0x611a9f[_0xfced('0x44')]=qs['filters'](_[_0xfced('0x45')](_0xef3879[_0xfced('0x3c')],_0x5879c7['filters']));if(_0xef3879[_0xfced('0x3c')][_0xfced('0x46')]){_0x611a9f[_0xfced('0x44')]=_[_0xfced('0x47')](_0x611a9f[_0xfced('0x44')],{'$or':_[_0xfced('0x2c')](_0x611a9f['attributes'],function(_0x3c2c8b){var _0x55bb5d={};_0x55bb5d[_0x3c2c8b]={'$like':'%'+_0xef3879['query'][_0xfced('0x46')]+'%'};return _0x55bb5d;})});}_0x611a9f=_['merge']({},_0x611a9f,_0xef3879[_0xfced('0x48')]);return _0x72a40e[_0xfced('0x66')](_0x611a9f);}})['then'](function(_0x3bb5e4){if(_0x3bb5e4){_0x54de38=_0x3bb5e4[_0xfced('0x3f')];if(!_0xef3879['query'][_0xfced('0x40')](_0xfced('0x41'))){_0x611a9f[_0xfced('0x20')]=qs['limit'](_0xef3879['query'][_0xfced('0x20')]);_0x611a9f['offset']=qs[_0xfced('0x1e')](_0xef3879[_0xfced('0x3c')][_0xfced('0x1e')]);}return _0x72a40e[_0xfced('0x66')](_0x611a9f);}})['then'](function(_0x46bc5c){if(_0x46bc5c){return _0x46bc5c?{'count':_0x54de38,'rows':_0x46bc5c}:null;}})[_0xfced('0x26')](respondWithResult(_0x2ba891,null))[_0xfced('0x4d')](handleError(_0x2ba891,null));};exports[_0xfced('0x67')]=function(_0x4133af,_0x16aa75,_0x21d7b7){var _0xf0212a=_0x4133af['body'][_0xfced('0x68')];var _0x5a2787=_[_0xfced('0x2c')](_0xf0212a,'id');return db[_0xfced('0x69')][_0xfced('0x4b')]({'where':{'id':_0x5a2787},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfced('0x6a'),'attributes':['id',_0xfced('0x30'),_0xfced('0x6b'),_0xfced('0x6c'),'interface'],'raw':!![]}]})['then'](function(_0x5e5a74){if(_0x5e5a74){var _0x318e7a=_[_0xfced('0x6d')](_0x5e5a74,function(_0xd69e22){var _0x302035=_0xd69e22[_0xfced('0x28')]({'plain':!![]});_0x302035[_0xfced('0x6a')][_0xfced('0x6e')](function(_0x1c631c){_0x1c631c['penalty']=_['find'](_0xf0212a,{'id':_0x302035['id']})[_0xfced('0x6f')];});return _0x302035['Agents'];});return db[_0xfced('0x35')][_0xfced('0x2f')]({'where':{'id':_0x4133af['params']['id']}})[_0xfced('0x26')](function(_0x4aa7a7){return db[_0xfced('0x70')]['transaction'](function(_0x399345){return _0x4aa7a7[_0xfced('0x67')](_0x5a2787,{'transaction':_0x399345})[_0xfced('0x26')](function(){return BPromise[_0xfced('0x71')](_0xf0212a,function(_0x22135d){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x22135d['id'],'VoiceQueueId':_0x4133af[_0xfced('0x4f')]['id'],'penalty':_0x22135d['penalty']},{'transaction':_0x399345});});})[_0xfced('0x26')](function(){return BPromise[_0xfced('0x71')](_0x318e7a,function(_0x30aab4){return db[_0xfced('0x72')][_0xfced('0x73')]({'where':{'UserId':_0x30aab4['id'],'VoiceQueueId':_0x4133af['params']['id']},'defaults':{'penalty':_0x30aab4[_0xfced('0x6f')]},'transaction':_0x399345});});})[_0xfced('0x26')](function(){return BPromise[_0xfced('0x71')](_[_0xfced('0x46')](_0x318e7a,{'online':!![]}),function(_0x36cfd6){return db[_0xfced('0x74')]['upsert']({'membername':_0x36cfd6[_0xfced('0x30')],'UserId':_0x36cfd6['id'],'queue_name':_0x4aa7a7['name'],'VoiceQueueId':_0x4aa7a7['id'],'interface':_[_0xfced('0x75')](_0x36cfd6['interface'])?util['format'](_0xfced('0x76'),_0x36cfd6['name']):_0x36cfd6[_0xfced('0x77')],'paused':_0x36cfd6[_0xfced('0x6c')]||![],'penalty':_0x36cfd6[_0xfced('0x6f')]},{'transaction':_0x399345});});})[_0xfced('0x26')](function(){_0x318e7a[_0xfced('0x6e')](function(_0x2f48d4){socket[_0xfced('0x78')](_0xfced('0x79'),{'UserId':_0x2f48d4['id'],'VoiceQueueId':_0x4aa7a7['id']});});});});});}})['then'](respondWithStatusCode(_0x16aa75,null))[_0xfced('0x4d')](handleError(_0x16aa75,null));};exports[_0xfced('0x7a')]=function(_0x38ce64,_0xcdf30,_0x2f4759){return db['Team']['findAll']({'where':{'id':_0x38ce64['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfced('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xcdf30,null))[_0xfced('0x26')](function(_0x4608f9){var _0x21df1e=_[_0xfced('0x2c')](_0x4608f9,'id');var _0x5d344e=[];var _0x4831ed=[];var _0x443ec3=squel['select']();_0x443ec3[_0xfced('0x7b')](_0xfced('0x7c'))[_0xfced('0x7d')]('team_has_voice_queues','tq')[_0xfced('0x7e')](_0xfced('0x7f'),'ut',_0xfced('0x80'))[_0xfced('0x44')](_0xfced('0x81'),_0x38ce64['params']['id']);for(var _0x55ffe9=0x0;_0x55ffe9<_0x4608f9[_0xfced('0x3f')];_0x55ffe9+=0x1){let _0x3fcb6f=_0x4608f9[_0x55ffe9];for(var _0x233f15=0x0;_0x233f15<_0x3fcb6f[_0xfced('0x6a')][_0xfced('0x3f')];_0x233f15+=0x1){let _0x10f2a4=_0x3fcb6f[_0xfced('0x6a')][_0x233f15];var _0x48f209=_0x443ec3[_0xfced('0x5a')]();_0x48f209[_0xfced('0x44')]('ut.UserId\x20=\x20?',_0x10f2a4['id']);_0x4831ed['push'](db[_0xfced('0x70')][_0xfced('0x3c')](_0x48f209[_0xfced('0x82')](),{'type':db['sequelize'][_0xfced('0x83')][_0xfced('0x84')]})[_0xfced('0x26')](function(_0xbf7a1b){if(_0xbf7a1b[_0xfced('0x3f')]===0x1){return _0x10f2a4['id'];}else{var _0x299d3b=_[_0xfced('0x85')](_[_0xfced('0x2c')](_0xbf7a1b,_0xfced('0x86')),function(_0x220413){return _[_0xfced('0x87')](_0x21df1e,_0x220413);});if(_0x299d3b){return _0x10f2a4['id'];}}}));}}return BPromise[_0xfced('0x88')](_0x4831ed)[_0xfced('0x26')](function(_0x2d2a61){_0x5d344e=_(_0x5d344e)[_0xfced('0x89')](_0x2d2a61)['compact']()['value']();return db['VoiceQueue'][_0xfced('0x2f')]({'where':{'id':_0x38ce64['params']['id']}})[_0xfced('0x26')](function(_0x4def54){return db['sequelize'][_0xfced('0x8a')](function(_0x23aa77){return _0x4def54[_0xfced('0x7a')](_0x38ce64['query'][_0xfced('0x8b')],{'transaction':_0x23aa77})[_0xfced('0x26')](function(){if(!_['isEmpty'](_0x5d344e)){return _0x4def54[_0xfced('0x8c')](_0x5d344e,{'transaction':_0x23aa77})[_0xfced('0x26')](function(){return db[_0xfced('0x74')]['destroy']({'where':{'VoiceQueueId':_0x38ce64[_0xfced('0x4f')]['id'],'UserId':_0x5d344e},'transaction':_0x23aa77});});}})[_0xfced('0x26')](function(){_0x5d344e[_0xfced('0x6e')](function(_0x38691f){socket['emit']('userVoiceQueue:remove',{'UserId':_0x38691f,'VoiceQueueId':_0x4def54['id']});});});});});});})[_0xfced('0x26')](respondWithStatusCode(_0xcdf30,null))[_0xfced('0x4d')](handleError(_0xcdf30,null));};exports[_0xfced('0x8d')]=function(_0x1e7e75,_0x3023e6,_0x1b3ab6){var _0x57d7b0,_0x1f8552;return db[_0xfced('0x35')][_0xfced('0x2f')]({'where':{'id':_0x1e7e75[_0xfced('0x4f')]['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x3023e6,null))[_0xfced('0x26')](function(_0x4c4e34){if(_0x4c4e34){_0x1f8552=_0x4c4e34;return _0x4c4e34[_0xfced('0x8d')](_0x1e7e75[_0xfced('0x51')][_0xfced('0x8b')],_['omit'](_0x1e7e75[_0xfced('0x51')],[_0xfced('0x8b'),'id'])||{})[_0xfced('0x8e')](function(_0x60232){for(var _0xc7b278=0x0;_0xc7b278<_0x1e7e75[_0xfced('0x51')][_0xfced('0x8b')]['length'];_0xc7b278+=0x1){socket[_0xfced('0x78')](_0xfced('0x79'),{'UserId':Number(_0x1e7e75[_0xfced('0x51')][_0xfced('0x8b')][_0xc7b278]),'VoiceQueueId':Number(_0x1e7e75['params']['id'])});}return _0x60232;});}})[_0xfced('0x26')](function(_0x235b70){_0x57d7b0=_0x235b70||[];if(_0x1f8552){return db[_0xfced('0x8f')][_0xfced('0x4b')]({'where':{'id':_0x1e7e75[_0xfced('0x51')][_0xfced('0x8b')]},'attributes':['id','name',_0xfced('0x6b'),_0xfced('0x6c'),_0xfced('0x77')],'raw':!![]});}})['then'](function(_0x2c1b67){if(!_[_0xfced('0x90')](_0x2c1b67)){var _0x3a063a=[];for(var _0x3b08d6=0x0;_0x3b08d6<_0x2c1b67[_0xfced('0x3f')];_0x3b08d6++){if(_0x2c1b67[_0x3b08d6]['online']){_0x3a063a['push'](db[_0xfced('0x74')][_0xfced('0x91')]({'membername':_0x2c1b67[_0x3b08d6][_0xfced('0x30')],'UserId':_0x2c1b67[_0x3b08d6]['id'],'queue_name':_0x1f8552[_0xfced('0x30')],'VoiceQueueId':_0x1f8552['id'],'interface':_[_0xfced('0x75')](_0x2c1b67[_0x3b08d6][_0xfced('0x77')])?util['format']('SIP/%s',_0x2c1b67[_0x3b08d6][_0xfced('0x30')]):_0x2c1b67[_0x3b08d6]['interface'],'paused':_0x2c1b67[_0x3b08d6]['voicePause']||![],'penalty':_0x1e7e75[_0xfced('0x51')]['penalty']||0x0}));}}return BPromise[_0xfced('0x88')](_0x3a063a);}})['then'](function(){return _0x57d7b0;})[_0xfced('0x26')](respondWithResult(_0x3023e6,null))['catch'](handleError(_0x3023e6,null));};exports['removeAgents']=function(_0x1f91bc,_0x5731bb,_0xc1a885){return db['VoiceQueue']['find']({'where':{'id':_0x1f91bc['params']['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x5731bb,null))[_0xfced('0x26')](function(_0x265316){if(_0x265316){return _0x265316[_0xfced('0x8c')](_0x1f91bc[_0xfced('0x3c')][_0xfced('0x8b')])[_0xfced('0x26')](function(){if(_[_0xfced('0x92')](_0x1f91bc[_0xfced('0x3c')][_0xfced('0x8b')])){for(var _0x7d7965=0x0;_0x7d7965<_0x1f91bc['query']['ids'][_0xfced('0x3f')];_0x7d7965+=0x1){socket[_0xfced('0x78')]('userVoiceQueue:remove',{'UserId':Number(_0x1f91bc[_0xfced('0x3c')][_0xfced('0x8b')][_0x7d7965]),'VoiceQueueId':Number(_0x1f91bc[_0xfced('0x4f')]['id'])});}}else{socket[_0xfced('0x78')]('userVoiceQueue:remove',{'UserId':Number(_0x1f91bc[_0xfced('0x3c')]['ids']),'VoiceQueueId':Number(_0x1f91bc[_0xfced('0x4f')]['id'])});}});}})['then'](function(_0x4725ea){return db[_0xfced('0x74')][_0xfced('0x27')]({'where':{'VoiceQueueId':_0x1f91bc['params']['id'],'UserId':_0x1f91bc['query'][_0xfced('0x8b')]}})[_0xfced('0x26')](function(){return _0x4725ea;});})['then'](respondWithStatusCode(_0x5731bb,null))[_0xfced('0x4d')](handleError(_0x5731bb,null));};exports[_0xfced('0x93')]=function(_0x1cdebc,_0x9e47fe,_0x22ee6e){var _0x3845d3={};var _0xe9e6fc={};var _0x599b5c;var _0x3f6f21;return db[_0xfced('0x35')][_0xfced('0x5f')]({'where':{'id':_0x1cdebc[_0xfced('0x4f')]['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x9e47fe,null))['then'](function(_0x76227a){if(_0x76227a){_0x599b5c=_0x76227a;_0xe9e6fc[_0xfced('0x3b')]=_[_0xfced('0x38')](db[_0xfced('0x8f')][_0xfced('0x36')]);_0xe9e6fc[_0xfced('0x3c')]=_[_0xfced('0x38')](_0x1cdebc[_0xfced('0x3c')]);_0xe9e6fc[_0xfced('0x39')]=_['intersection'](_0xe9e6fc[_0xfced('0x3b')],_0xe9e6fc['query']);_0x3845d3[_0xfced('0x3d')]=_[_0xfced('0x3a')](_0xe9e6fc[_0xfced('0x3b')],qs[_0xfced('0x3e')](_0x1cdebc[_0xfced('0x3c')][_0xfced('0x3e')]));_0x3845d3[_0xfced('0x3d')]=_0x3845d3[_0xfced('0x3d')]['length']?_0x3845d3[_0xfced('0x3d')]:_0xe9e6fc[_0xfced('0x3b')];_0x3845d3[_0xfced('0x42')]=qs['sort'](_0x1cdebc['query'][_0xfced('0x43')]);_0x3845d3[_0xfced('0x44')]=qs[_0xfced('0x39')](_[_0xfced('0x45')](_0x1cdebc[_0xfced('0x3c')],_0xe9e6fc['filters']));if(_0x1cdebc[_0xfced('0x3c')][_0xfced('0x46')]){_0x3845d3[_0xfced('0x44')]=_[_0xfced('0x47')](_0x3845d3[_0xfced('0x44')],{'$or':_[_0xfced('0x2c')](_0x3845d3[_0xfced('0x3d')],function(_0x405864){var _0x326498={};_0x326498[_0x405864]={'$like':'%'+_0x1cdebc[_0xfced('0x3c')]['filter']+'%'};return _0x326498;})});}_0x3845d3=_['merge']({},_0x3845d3,_0x1cdebc[_0xfced('0x48')]);return _0x599b5c[_0xfced('0x93')](_0x3845d3);}})[_0xfced('0x26')](function(_0xf8963c){if(_0xf8963c){_0x3f6f21=_0xf8963c[_0xfced('0x3f')];if(!_0x1cdebc[_0xfced('0x3c')]['hasOwnProperty'](_0xfced('0x41'))){_0x3845d3[_0xfced('0x20')]=qs[_0xfced('0x20')](_0x1cdebc[_0xfced('0x3c')][_0xfced('0x20')]);_0x3845d3[_0xfced('0x1e')]=qs[_0xfced('0x1e')](_0x1cdebc['query'][_0xfced('0x1e')]);}return _0x599b5c[_0xfced('0x93')](_0x3845d3);}})[_0xfced('0x26')](function(_0x2be67f){if(_0x2be67f){return _0x2be67f?{'count':_0x3f6f21,'rows':_0x2be67f}:null;}})['then'](respondWithResult(_0x9e47fe,null))[_0xfced('0x4d')](handleError(_0x9e47fe,null));};exports[_0xfced('0x94')]=function(_0x53de26,_0x147a56,_0x3a0e85){var _0x13364d={};var _0x4d7d4f={};var _0x1f32b6;var _0x67cf9a;return db[_0xfced('0x35')][_0xfced('0x5f')]({'where':{'id':_0x53de26['params']['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x147a56,null))[_0xfced('0x26')](function(_0x2f46e6){if(_0x2f46e6){_0x1f32b6=_0x2f46e6;_0x4d7d4f[_0xfced('0x3b')]=_[_0xfced('0x38')](db[_0xfced('0x74')]['rawAttributes']);_0x4d7d4f['query']=_['keys'](_0x53de26[_0xfced('0x3c')]);_0x4d7d4f['filters']=_[_0xfced('0x3a')](_0x4d7d4f[_0xfced('0x3b')],_0x4d7d4f[_0xfced('0x3c')]);_0x13364d[_0xfced('0x3d')]=_[_0xfced('0x3a')](_0x4d7d4f['model'],qs[_0xfced('0x3e')](_0x53de26[_0xfced('0x3c')][_0xfced('0x3e')]));_0x13364d[_0xfced('0x3d')]=_0x13364d[_0xfced('0x3d')][_0xfced('0x3f')]?_0x13364d[_0xfced('0x3d')]:_0x4d7d4f['model'];_0x13364d['order']=qs[_0xfced('0x43')](_0x53de26['query'][_0xfced('0x43')]);_0x13364d[_0xfced('0x44')]=qs[_0xfced('0x39')](_[_0xfced('0x45')](_0x53de26[_0xfced('0x3c')],_0x4d7d4f['filters']));if(_0x53de26[_0xfced('0x3c')][_0xfced('0x46')]){_0x13364d[_0xfced('0x44')]=_[_0xfced('0x47')](_0x13364d[_0xfced('0x44')],{'$or':_[_0xfced('0x2c')](_0x13364d[_0xfced('0x3d')],function(_0x4e25ee){var _0x779186={};_0x779186[_0x4e25ee]={'$like':'%'+_0x53de26[_0xfced('0x3c')]['filter']+'%'};return _0x779186;})});}_0x13364d=_['merge']({},_0x13364d,_0x53de26['options']);return _0x1f32b6[_0xfced('0x94')](_0x13364d);}})[_0xfced('0x26')](function(_0x381ce6){if(_0x381ce6){_0x67cf9a=_0x381ce6[_0xfced('0x3f')];if(!_0x53de26[_0xfced('0x3c')]['hasOwnProperty']('nolimit')){_0x13364d[_0xfced('0x20')]=qs['limit'](_0x53de26['query'][_0xfced('0x20')]);_0x13364d['offset']=qs[_0xfced('0x1e')](_0x53de26[_0xfced('0x3c')][_0xfced('0x1e')]);}return _0x1f32b6[_0xfced('0x94')](_0x13364d);}})['then'](function(_0x5a5d2f){return _0x5a5d2f?{'count':_0x67cf9a,'rows':_0x5a5d2f}:null;})[_0xfced('0x26')](respondWithResult(_0x147a56,null))[_0xfced('0x4d')](handleError(_0x147a56,null));};exports[_0xfced('0x95')]=function(_0x41d616,_0x5e33e1,_0x5c197c){var _0x4e6a2c={};var _0x115d46={};var _0x24eb84;var _0x4698e7;return db[_0xfced('0x35')][_0xfced('0x5f')]({'where':{'id':_0x41d616['params']['id']}})['then'](handleEntityNotFound(_0x5e33e1,null))[_0xfced('0x26')](function(_0x5aa831){if(_0x5aa831){_0x24eb84=_0x5aa831;_0x115d46[_0xfced('0x3b')]=_[_0xfced('0x38')](db[_0xfced('0x96')][_0xfced('0x36')]);_0x115d46[_0xfced('0x3c')]=_[_0xfced('0x38')](_0x41d616[_0xfced('0x3c')]);_0x115d46[_0xfced('0x39')]=_['intersection'](_0x115d46[_0xfced('0x3b')],_0x115d46[_0xfced('0x3c')]);_0x4e6a2c[_0xfced('0x3d')]=_[_0xfced('0x3a')](_0x115d46[_0xfced('0x3b')],qs[_0xfced('0x3e')](_0x41d616[_0xfced('0x3c')][_0xfced('0x3e')]));_0x4e6a2c[_0xfced('0x3d')]=_0x4e6a2c[_0xfced('0x3d')][_0xfced('0x3f')]?_0x4e6a2c[_0xfced('0x3d')]:_0x115d46['model'];_0x4e6a2c[_0xfced('0x42')]=qs[_0xfced('0x43')](_0x41d616[_0xfced('0x3c')][_0xfced('0x43')]);_0x4e6a2c[_0xfced('0x44')]=qs[_0xfced('0x39')](_['pick'](_0x41d616[_0xfced('0x3c')],_0x115d46[_0xfced('0x39')]));if(_0x41d616[_0xfced('0x3c')][_0xfced('0x46')]){_0x4e6a2c['where']=_['merge'](_0x4e6a2c[_0xfced('0x44')],{'$or':_[_0xfced('0x2c')](_0x4e6a2c[_0xfced('0x3d')],function(_0x2e2b30){var _0x3d3900={};_0x3d3900[_0x2e2b30]={'$like':'%'+_0x41d616['query'][_0xfced('0x46')]+'%'};return _0x3d3900;})});}_0x4e6a2c=_[_0xfced('0x47')]({},_0x4e6a2c,_0x41d616[_0xfced('0x48')]);return _0x24eb84[_0xfced('0x95')](_0x4e6a2c);}})[_0xfced('0x26')](function(_0x45d2c4){if(_0x45d2c4){_0x4698e7=_0x45d2c4[_0xfced('0x3f')];if(!_0x41d616[_0xfced('0x3c')]['hasOwnProperty'](_0xfced('0x41'))){_0x4e6a2c['limit']=qs[_0xfced('0x20')](_0x41d616[_0xfced('0x3c')][_0xfced('0x20')]);_0x4e6a2c[_0xfced('0x1e')]=qs['offset'](_0x41d616['query'][_0xfced('0x1e')]);}return _0x24eb84[_0xfced('0x95')](_0x4e6a2c);}})[_0xfced('0x26')](function(_0x48d529){if(_0x48d529){return _0x48d529?{'count':_0x4698e7,'rows':_0x48d529}:null;}})[_0xfced('0x26')](respondWithResult(_0x5e33e1,null))[_0xfced('0x4d')](handleError(_0x5e33e1,null));};exports['addLists']=function(_0x44bae0,_0x30d71d,_0x6abd63){var _0xccda05=moment()['format'](_0xfced('0x97'));var _0x217359,_0x5a401e;return db[_0xfced('0x35')][_0xfced('0x2f')]({'where':{'id':_0x44bae0['params']['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x30d71d,null))[_0xfced('0x26')](function(_0x5e3875){if(_0x5e3875){_0x5a401e=_0x5e3875;return _0x5e3875[_0xfced('0x98')](_0x44bae0['body']['ids'],_[_0xfced('0x5b')](_0x44bae0[_0xfced('0x51')],[_0xfced('0x8b'),'id'])||{});}return null;})['spread'](function(_0x5ca414){var _0x162fb3;_0x217359=_0x5ca414||[];var _0x5c3622=[];if(_0x5ca414){for(var _0x221677=0x0;_0x221677<_0x5ca414[_0xfced('0x3f')];_0x221677+=0x1){var _0x47bcf5=_0x5ca414[_0x221677][_0xfced('0x28')]({'plain':!![]});_0x5a401e['dialCheckDuplicateType']=_0x44bae0[_0xfced('0x51')][_0xfced('0x99')]?_0x44bae0[_0xfced('0x51')]['dialCheckDuplicateType']:_0x5a401e[_0xfced('0x99')];switch(_0x5a401e[_0xfced('0x99')]){case _0xfced('0x9a'):_0x162fb3=squel['insert']()[_0xfced('0x9b')](_0xfced('0x9c'))[_0xfced('0x9d')]([_0xfced('0x9e'),_0xfced('0x9f'),'ContactId',_0xfced('0xa0'),'VoiceQueueId',_0xfced('0x5c'),_0xfced('0xa1')],squel[_0xfced('0xa2')]()[_0xfced('0x7b')]('phone',_0xfced('0x9e'))[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27','scheduledAt')['field']('id',_0xfced('0xa3'))[_0xfced('0x7b')](_0x47bcf5[_0xfced('0xa4')][_0xfced('0x82')](),_0xfced('0xa0'))[_0xfced('0x7b')](_0x44bae0[_0xfced('0x4f')]['id'][_0xfced('0x82')](),'VoiceQueueId')[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27',_0xfced('0x5c'))[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27','updatedAt')[_0xfced('0x7d')](_0xfced('0xa5'))['where'](_0xfced('0xa6'))[_0xfced('0x44')](_0xfced('0xa7'),_0x47bcf5[_0xfced('0xa4')][_0xfced('0x82')]())['where'](_0xfced('0xa8'))[_0xfced('0x44')](_0xfced('0xa9'),squel['select']()[_0xfced('0x7b')]('COALESCE(calleridnum,\x27\x27)')[_0xfced('0x7d')]('cm_hopper_final')[_0xfced('0x44')](_0xfced('0x81'),_0x44bae0[_0xfced('0x4f')]['id']['toString']()))[_0xfced('0x44')](_0xfced('0xa9'),squel[_0xfced('0xa2')]()['field'](_0xfced('0xaa'))[_0xfced('0x7d')](_0xfced('0x9c'))[_0xfced('0x44')](_0xfced('0x81'),_0x44bae0['params']['id'][_0xfced('0x82')]())))[_0xfced('0x82')]();break;case _0xfced('0xab'):_0x162fb3=squel[_0xfced('0xac')]()['into']('cm_hopper')[_0xfced('0x9d')]([_0xfced('0x9e'),'scheduledAt',_0xfced('0xa3'),'ListId','VoiceQueueId',_0xfced('0x5c'),_0xfced('0xa1')],squel['select']()[_0xfced('0x7b')](_0xfced('0x9e'),'phone')[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27',_0xfced('0x9f'))[_0xfced('0x7b')]('id',_0xfced('0xa3'))['field'](_0x47bcf5[_0xfced('0xa4')][_0xfced('0x82')](),'ListId')[_0xfced('0x7b')](_0x44bae0[_0xfced('0x4f')]['id'][_0xfced('0x82')](),_0xfced('0x61'))['field']('\x27'+_0xccda05+'\x27',_0xfced('0x5c'))[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27','updatedAt')[_0xfced('0x7d')]('cm_contacts')[_0xfced('0x44')](_0xfced('0xa6'))['where']('ListId\x20=\x20?',_0x47bcf5[_0xfced('0xa4')][_0xfced('0x82')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xfced('0x44')](_0xfced('0xa9'),squel['select']()[_0xfced('0x7b')]('COALESCE(phone,\x27\x27)')['from'](_0xfced('0x9c'))[_0xfced('0x44')](_0xfced('0x81'),_0x44bae0[_0xfced('0x4f')]['id']['toString']())))['toString']();break;default:_0x162fb3=squel[_0xfced('0xac')]()[_0xfced('0x9b')](_0xfced('0x9c'))[_0xfced('0x9d')]([_0xfced('0x9e'),_0xfced('0x9f'),_0xfced('0xa3'),_0xfced('0xa0'),_0xfced('0x61'),_0xfced('0x5c'),_0xfced('0xa1')],squel[_0xfced('0xa2')]()['field'](_0xfced('0x9e'),_0xfced('0x9e'))[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27',_0xfced('0x9f'))[_0xfced('0x7b')]('id',_0xfced('0xa3'))['field'](_0x47bcf5[_0xfced('0xa4')]['toString'](),'ListId')[_0xfced('0x7b')](_0x44bae0['params']['id'][_0xfced('0x82')](),_0xfced('0x61'))[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27','createdAt')['field']('\x27'+_0xccda05+'\x27','updatedAt')[_0xfced('0x7d')]('cm_contacts')[_0xfced('0x44')](_0xfced('0xa6'))[_0xfced('0x44')](_0xfced('0xa7'),_0x47bcf5[_0xfced('0xa4')][_0xfced('0x82')]())[_0xfced('0x44')](_0xfced('0xa8')))['toString']();}_0x5c3622[_0xfced('0xad')](db[_0xfced('0x70')]['query'](_0x162fb3));}return BPromise[_0xfced('0x88')](_0x5c3622);}})[_0xfced('0x26')](function(){var _0x4754d4=[];var _0x408ac0=squel[_0xfced('0xac')]()[_0xfced('0x9b')]('cm_hopper_additional_phones')[_0xfced('0x9d')]([_0xfced('0xae'),'phone',_0xfced('0xaf'),_0xfced('0x5c'),_0xfced('0xa1')],squel['select']()[_0xfced('0x7b')](_0xfced('0xb0'))[_0xfced('0x7b')]('ci.item')['field'](_0xfced('0xb1'))[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27',_0xfced('0x5c'))[_0xfced('0x7b')]('\x27'+_0xccda05+'\x27',_0xfced('0xa1'))['from']('cm_contact_has_items','ci')[_0xfced('0x7e')](_0xfced('0x9c'),'h',_0xfced('0xb2'))['where'](_0xfced('0xb3'),_0xccda05)[_0xfced('0x44')](_0xfced('0xb4'),_0xfced('0xb5')))[_0xfced('0x82')]();_0x4754d4['push'](db[_0xfced('0x70')][_0xfced('0x3c')](_0x408ac0));return BPromise[_0xfced('0x88')](_0x4754d4);})[_0xfced('0x26')](function(){return _0x217359;})[_0xfced('0x26')](respondWithResult(_0x30d71d,null))['catch'](handleError(_0x30d71d,null));};exports['removeLists']=function(_0x5af6cb,_0x5e7acc,_0x1fbe64){return db[_0xfced('0x35')][_0xfced('0x2f')]({'where':{'id':_0x5af6cb[_0xfced('0x4f')]['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x5e7acc,null))[_0xfced('0x26')](function(_0xa2fb86){if(_0xa2fb86){return _0xa2fb86[_0xfced('0xb6')](_0x5af6cb[_0xfced('0x3c')][_0xfced('0x8b')]);}})[_0xfced('0x26')](function(_0x116574){if(_0x116574){return db['CmHopper'][_0xfced('0x27')]({'where':{'ListId':_0x5af6cb[_0xfced('0x3c')]['ids'],'VoiceQueueId':_0x5af6cb[_0xfced('0x4f')]['id']}})['then'](function(){return _0x116574;});}})[_0xfced('0x26')](respondWithStatusCode(_0x5e7acc,null))[_0xfced('0x4d')](handleError(_0x5e7acc,null));};exports[_0xfced('0xb7')]=function(_0x449952,_0x2586d8,_0x371a36){var _0x1efaec={};var _0x47a3be={};var _0x4fc613;var _0x4f974a;return db[_0xfced('0x35')][_0xfced('0x5f')]({'where':{'id':_0x449952[_0xfced('0x4f')]['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x2586d8,null))[_0xfced('0x26')](function(_0x34a320){if(_0x34a320){_0x4fc613=_0x34a320;_0x47a3be['model']=_[_0xfced('0x38')](db['CmList']['rawAttributes']);_0x47a3be[_0xfced('0x3c')]=_[_0xfced('0x38')](_0x449952['query']);_0x47a3be[_0xfced('0x39')]=_[_0xfced('0x3a')](_0x47a3be[_0xfced('0x3b')],_0x47a3be[_0xfced('0x3c')]);_0x1efaec['attributes']=_[_0xfced('0x3a')](_0x47a3be[_0xfced('0x3b')],qs['fields'](_0x449952[_0xfced('0x3c')][_0xfced('0x3e')]));_0x1efaec['attributes']=_0x1efaec[_0xfced('0x3d')][_0xfced('0x3f')]?_0x1efaec['attributes']:_0x47a3be[_0xfced('0x3b')];_0x1efaec['order']=qs[_0xfced('0x43')](_0x449952[_0xfced('0x3c')]['sort']);_0x1efaec[_0xfced('0x44')]=qs[_0xfced('0x39')](_['pick'](_0x449952[_0xfced('0x3c')],_0x47a3be[_0xfced('0x39')]));if(_0x449952[_0xfced('0x3c')][_0xfced('0x46')]){_0x1efaec[_0xfced('0x44')]=_[_0xfced('0x47')](_0x1efaec[_0xfced('0x44')],{'$or':_[_0xfced('0x2c')](_0x1efaec[_0xfced('0x3d')],function(_0x5db59e){var _0x2837af={};_0x2837af[_0x5db59e]={'$like':'%'+_0x449952[_0xfced('0x3c')]['filter']+'%'};return _0x2837af;})});}_0x1efaec=_[_0xfced('0x47')]({},_0x1efaec,_0x449952[_0xfced('0x48')]);return _0x4fc613['getBlackLists'](_0x1efaec);}})[_0xfced('0x26')](function(_0x27178b){if(_0x27178b){_0x4f974a=_0x27178b[_0xfced('0x3f')];if(!_0x449952[_0xfced('0x3c')]['hasOwnProperty'](_0xfced('0x41'))){_0x1efaec[_0xfced('0x20')]=qs[_0xfced('0x20')](_0x449952[_0xfced('0x3c')][_0xfced('0x20')]);_0x1efaec[_0xfced('0x1e')]=qs['offset'](_0x449952['query']['offset']);}return _0x4fc613['getBlackLists'](_0x1efaec);}})['then'](function(_0x240d25){if(_0x240d25){return _0x240d25?{'count':_0x4f974a,'rows':_0x240d25}:null;}})['then'](respondWithResult(_0x2586d8,null))[_0xfced('0x4d')](handleError(_0x2586d8,null));};exports[_0xfced('0xb8')]=function(_0x4a6270,_0x58b4e5,_0x34cb3e){var _0x7516d4,_0x221e7b;return db[_0xfced('0x35')][_0xfced('0x2f')]({'where':{'id':_0x4a6270[_0xfced('0x4f')]['id']}})['then'](handleEntityNotFound(_0x58b4e5,null))['then'](function(_0x1cf072){if(_0x1cf072){_0x221e7b=_0x1cf072;return _0x1cf072[_0xfced('0xb8')](_0x4a6270[_0xfced('0x51')][_0xfced('0x8b')],_['omit'](_0x4a6270[_0xfced('0x51')],[_0xfced('0x8b'),'id'])||{});}return null;})['spread'](function(_0x17884a){var _0xa3c0eb;_0x7516d4=_0x17884a||[];var _0x17671b=[];if(_0x17884a){for(var _0x3e76d7=0x0;_0x3e76d7<_0x17884a['length'];_0x3e76d7+=0x1){var _0x5caeb7=_0x17884a[_0x3e76d7]['get']({'plain':!![]});_0xa3c0eb=squel[_0xfced('0xac')]()[_0xfced('0x9b')](_0xfced('0xb9'))[_0xfced('0x9d')]([_0xfced('0x9e'),_0xfced('0xa3'),'ListId',_0xfced('0x61'),_0xfced('0x5c'),_0xfced('0xa1')],squel[_0xfced('0xa2')]()[_0xfced('0x7b')](_0xfced('0x9e'),_0xfced('0x9e'))[_0xfced('0x7b')]('id',_0xfced('0xa3'))[_0xfced('0x7b')](_0x5caeb7[_0xfced('0xa4')][_0xfced('0x82')](),_0xfced('0xa0'))['field'](_0x4a6270[_0xfced('0x4f')]['id'][_0xfced('0x82')](),'VoiceQueueId')['field'](_0xfced('0xba'),'createdAt')[_0xfced('0x7b')]('NOW()',_0xfced('0xa1'))[_0xfced('0x7d')](_0xfced('0xa5'))['where'](_0xfced('0xa6'))[_0xfced('0x44')]('ListId\x20=\x20?',_0x5caeb7[_0xfced('0xa4')][_0xfced('0x82')]())[_0xfced('0x44')](_0xfced('0xa8')))[_0xfced('0x82')]();_0x17671b[_0xfced('0xad')](db[_0xfced('0x70')][_0xfced('0x3c')](_0xa3c0eb));}return BPromise[_0xfced('0x88')](_0x17671b);}})[_0xfced('0x26')](function(){return _0x7516d4;})[_0xfced('0x26')](respondWithResult(_0x58b4e5,null))[_0xfced('0x4d')](handleError(_0x58b4e5,null));};exports['removeBlackLists']=function(_0x48906e,_0x261513,_0x28b616){return db[_0xfced('0x35')]['find']({'where':{'id':_0x48906e[_0xfced('0x4f')]['id']}})[_0xfced('0x26')](handleEntityNotFound(_0x261513,null))[_0xfced('0x26')](function(_0x17970c){if(_0x17970c){return _0x17970c[_0xfced('0xbb')](_0x48906e[_0xfced('0x3c')][_0xfced('0x8b')]);}})[_0xfced('0x26')](function(_0x8aa1e0){if(_0x8aa1e0){return db[_0xfced('0x65')][_0xfced('0x27')]({'where':{'ListId':_0x48906e[_0xfced('0x3c')]['ids'],'VoiceQueueId':_0x48906e[_0xfced('0x4f')]['id']}})[_0xfced('0x26')](function(){return _0x8aa1e0;});}})[_0xfced('0x26')](respondWithStatusCode(_0x261513,null))[_0xfced('0x4d')](handleError(_0x261513,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index e7195e9..6effdff 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 _0xd755=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x441b25,_0x4a0241){var _0x52fe76=function(_0x131906){while(--_0x131906){_0x441b25['push'](_0x441b25['shift']());}};_0x52fe76(++_0x4a0241);}(_0xd755,0x130));var _0x5d75=function(_0x5a84d1,_0x4a330f){_0x5a84d1=_0x5a84d1-0x0;var _0x4b656c=_0xd755[_0x5a84d1];return _0x4b656c;};'use strict';var EventEmitter=require(_0x5d75('0x0'));var VoiceQueue=require(_0x5d75('0x1'))['db'][_0x5d75('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x5d75('0x3')](0x0);var events={'afterCreate':_0x5d75('0x4'),'afterUpdate':_0x5d75('0x5'),'afterDestroy':'remove'};function emitEvent(_0x278d93){return function(_0x174f45,_0x1f4d30,_0x1fda78){VoiceQueueEvents['emit'](_0x278d93+':'+_0x174f45['id'],_0x174f45);VoiceQueueEvents[_0x5d75('0x6')](_0x278d93,_0x174f45);_0x1fda78(null);};}for(var e in events){if(events[_0x5d75('0x7')](e)){var event=events[e];VoiceQueue[_0x5d75('0x8')](e,emitEvent(event));}}module[_0x5d75('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x517b=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x517b,0x1f3));var _0xb517=function(_0x14d7b8,_0x2419b6){_0x14d7b8=_0x14d7b8-0x0;var _0x35c7cc=_0x517b[_0x14d7b8];return _0x35c7cc;};'use strict';var EventEmitter=require(_0xb517('0x0'));var VoiceQueue=require(_0xb517('0x1'))['db'][_0xb517('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb517('0x3')](0x0);var events={'afterCreate':_0xb517('0x4'),'afterUpdate':_0xb517('0x5'),'afterDestroy':'remove'};function emitEvent(_0x66ca8a){return function(_0x1495db,_0x7c2e26,_0x20fef7){VoiceQueueEvents[_0xb517('0x6')](_0x66ca8a+':'+_0x1495db['id'],_0x1495db);VoiceQueueEvents['emit'](_0x66ca8a,_0x1495db);_0x20fef7(null);};}for(var e in events){if(events[_0xb517('0x7')](e)){var event=events[e];VoiceQueue[_0xb517('0x8')](e,emitEvent(event));}}module[_0xb517('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index a650dc2..5d196a4 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(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x70e0,0x17b));var _0x070e=function(_0x3411be,_0x1153b2){_0x3411be=_0x3411be-0x0;var _0x59f2ab=_0x70e0[_0x3411be];return _0x59f2ab;};'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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x3f6f78,_0x222d85){var _0x534963=function(_0x42a95b){while(--_0x42a95b){_0x3f6f78['push'](_0x3f6f78['shift']());}};_0x534963(++_0x222d85);}(_0x3e74,0x175));var _0x43e7=function(_0x2a2b04,_0x3a81bc){_0x2a2b04=_0x2a2b04-0x0;var _0x7bd707=_0x3e74[_0x2a2b04];return _0x7bd707;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index eac44c6..1935194 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 _0x720b=['find','ShowVoiceQueue','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetVoiceQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug'];(function(_0x54adda,_0x23a19b){var _0x388ad1=function(_0x548b46){while(--_0x548b46){_0x54adda['push'](_0x54adda['shift']());}};_0x388ad1(++_0x23a19b);}(_0x720b,0x114));var _0xb720=function(_0x1a14da,_0x4d7f60){_0x1a14da=_0x1a14da-0x0;var _0x1a0f35=_0x720b[_0x1a14da];return _0x1a0f35;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb720('0x0'));var BPromise=require(_0xb720('0x1'));var rs=require(_0xb720('0x2'));var fs=require('fs');var Redis=require(_0xb720('0x3'));var db=require(_0xb720('0x4'))['db'];var utils=require(_0xb720('0x5'));var logger=require(_0xb720('0x6'))(_0xb720('0x7'));var config=require(_0xb720('0x8'));var jayson=require(_0xb720('0x9'));var client=jayson[_0xb720('0xa')][_0xb720('0xb')]({'port':0x232a});config[_0xb720('0xc')]=_[_0xb720('0xd')](config[_0xb720('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb720('0xe'))(new Redis(config['redis']));require(_0xb720('0xf'))['register'](socket);function respondWithRpcPromise(_0x47564a,_0x55f665,_0x590fc3){return new BPromise(function(_0x7cad9,_0x500cbd){return client[_0xb720('0x10')](_0x47564a,_0x590fc3)[_0xb720('0x11')](function(_0x41e1ae){logger[_0xb720('0x12')](_0xb720('0x13'),_0x55f665,_0xb720('0x14'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x55f665,_0xb720('0x14'),JSON[_0xb720('0x15')](_0x41e1ae));if(_0x41e1ae['error']){if(_0x41e1ae[_0xb720('0x16')][_0xb720('0x17')]===0x1f4){logger[_0xb720('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x55f665,_0x41e1ae['error']['message']);return _0x500cbd(_0x41e1ae[_0xb720('0x16')][_0xb720('0x18')]);}logger[_0xb720('0x16')](_0xb720('0x13'),_0x55f665,_0x41e1ae[_0xb720('0x16')]['message']);return _0x7cad9(_0x41e1ae[_0xb720('0x16')]['message']);}else{logger['info'](_0xb720('0x13'),_0x55f665,_0xb720('0x14'));_0x7cad9(_0x41e1ae['result']['message']);}})['catch'](function(_0x3a2d11){logger[_0xb720('0x16')](_0xb720('0x13'),_0x55f665,_0x3a2d11);_0x500cbd(_0x3a2d11);});});}exports[_0xb720('0x19')]=function(_0x3c266c){var _0x362a4f=this;return new Promise(function(_0x29b798,_0x33a69e){return db['VoiceQueue'][_0xb720('0x1a')]({'raw':_0x3c266c[_0xb720('0x1b')]?_0x3c266c['options'][_0xb720('0x1c')]===undefined?!![]:![]:!![],'where':_0x3c266c[_0xb720('0x1b')]?_0x3c266c['options'][_0xb720('0x1d')]||null:null,'attributes':_0x3c266c[_0xb720('0x1b')]?_0x3c266c['options']['attributes']||null:null,'limit':_0x3c266c[_0xb720('0x1b')]?_0x3c266c['options'][_0xb720('0x1e')]||null:null,'include':_0x3c266c['options']?_0x3c266c[_0xb720('0x1b')]['include']?_[_0xb720('0x1f')](_0x3c266c[_0xb720('0x1b')][_0xb720('0x20')],function(_0x3d797e){return{'model':db[_0x3d797e[_0xb720('0x21')]],'as':_0x3d797e['as'],'attributes':_0x3d797e['attributes'],'include':_0x3d797e[_0xb720('0x20')]?_['map'](_0x3d797e[_0xb720('0x20')],function(_0x44e02e){return{'model':db[_0x44e02e[_0xb720('0x21')]],'as':_0x44e02e['as'],'attributes':_0x44e02e[_0xb720('0x22')],'include':_0x44e02e['include']?_[_0xb720('0x1f')](_0x44e02e[_0xb720('0x20')],function(_0x9310fe){return{'model':db[_0x9310fe[_0xb720('0x21')]],'as':_0x9310fe['as'],'attributes':_0x9310fe[_0xb720('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb720('0x11')](function(_0x51a691){logger[_0xb720('0x12')](_0xb720('0x19'),_0x3c266c);logger[_0xb720('0x23')](_0xb720('0x19'),_0x3c266c,JSON[_0xb720('0x15')](_0x51a691));_0x29b798(_0x51a691);})['catch'](function(_0x3e31d0){logger[_0xb720('0x16')]('GetVoiceQueue',_0x3e31d0['message'],_0x3c266c);_0x33a69e(_0x362a4f['error'](0x1f4,_0x3e31d0['message']));});});};exports['ShowVoiceQueue']=function(_0xc4c0d){var _0x1d05b1=this;return new Promise(function(_0x7c5d02,_0x1de34f){return db['VoiceQueue'][_0xb720('0x24')]({'raw':_0xc4c0d[_0xb720('0x1b')]?_0xc4c0d[_0xb720('0x1b')][_0xb720('0x1c')]===undefined?!![]:![]:!![],'where':_0xc4c0d[_0xb720('0x1b')]?_0xc4c0d[_0xb720('0x1b')][_0xb720('0x1d')]||null:null,'attributes':_0xc4c0d['options']?_0xc4c0d['options'][_0xb720('0x22')]||null:null,'include':_0xc4c0d[_0xb720('0x1b')]?_0xc4c0d[_0xb720('0x1b')][_0xb720('0x20')]?_['map'](_0xc4c0d[_0xb720('0x1b')]['include'],function(_0x9f40e3){return{'model':db[_0x9f40e3['model']],'as':_0x9f40e3['as'],'attributes':_0x9f40e3['attributes'],'include':_0x9f40e3['include']?_[_0xb720('0x1f')](_0x9f40e3[_0xb720('0x20')],function(_0x4afbbc){return{'model':db[_0x4afbbc[_0xb720('0x21')]],'as':_0x4afbbc['as'],'attributes':_0x4afbbc['attributes'],'include':_0x4afbbc[_0xb720('0x20')]?_[_0xb720('0x1f')](_0x4afbbc['include'],function(_0x5efdcb){return{'model':db[_0x5efdcb[_0xb720('0x21')]],'as':_0x5efdcb['as'],'attributes':_0x5efdcb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18d411){logger[_0xb720('0x12')](_0xb720('0x25'),_0xc4c0d);logger['debug'](_0xb720('0x25'),_0xc4c0d,JSON['stringify'](_0x18d411));_0x7c5d02(_0x18d411);})[_0xb720('0x26')](function(_0x4c6a11){logger['error'](_0xb720('0x25'),_0x4c6a11[_0xb720('0x18')],_0xc4c0d);_0x1de34f(_0x1d05b1[_0xb720('0x16')](0x1f4,_0x4c6a11[_0xb720('0x18')]));});});}; \ No newline at end of file +var _0x3c0e=['options','raw','attributes','limit','include','model','map','GetVoiceQueue','debug','catch','ShowVoiceQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','info','request\x20sent','findAll'];(function(_0x21fe87,_0x1cf583){var _0x4f2b4d=function(_0x287762){while(--_0x287762){_0x21fe87['push'](_0x21fe87['shift']());}};_0x4f2b4d(++_0x1cf583);}(_0x3c0e,0x192));var _0xe3c0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3c0e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe3c0('0x0'));var util=require('util');var moment=require(_0xe3c0('0x1'));var BPromise=require(_0xe3c0('0x2'));var rs=require(_0xe3c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3c0('0x4'))['db'];var utils=require(_0xe3c0('0x5'));var logger=require(_0xe3c0('0x6'))(_0xe3c0('0x7'));var config=require(_0xe3c0('0x8'));var jayson=require(_0xe3c0('0x9'));var client=jayson[_0xe3c0('0xa')]['http']({'port':0x232a});config[_0xe3c0('0xb')]=_['defaults'](config[_0xe3c0('0xb')],{'host':_0xe3c0('0xc'),'port':0x18eb});var socket=require(_0xe3c0('0xd'))(new Redis(config['redis']));require(_0xe3c0('0xe'))[_0xe3c0('0xf')](socket);function respondWithRpcPromise(_0x4ab2a4,_0x47bab2,_0x1dfe0c){return new BPromise(function(_0xfe0cb,_0x55f173){return client[_0xe3c0('0x10')](_0x4ab2a4,_0x1dfe0c)[_0xe3c0('0x11')](function(_0x63c06d){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x47bab2,'request\x20sent');logger['debug'](_0xe3c0('0x12'),_0x47bab2,'request\x20sent',JSON[_0xe3c0('0x13')](_0x63c06d));if(_0x63c06d['error']){if(_0x63c06d[_0xe3c0('0x14')][_0xe3c0('0x15')]===0x1f4){logger[_0xe3c0('0x14')](_0xe3c0('0x16'),_0x47bab2,_0x63c06d[_0xe3c0('0x14')][_0xe3c0('0x17')]);return _0x55f173(_0x63c06d[_0xe3c0('0x14')]['message']);}logger[_0xe3c0('0x14')](_0xe3c0('0x16'),_0x47bab2,_0x63c06d['error'][_0xe3c0('0x17')]);return _0xfe0cb(_0x63c06d['error']['message']);}else{logger[_0xe3c0('0x18')](_0xe3c0('0x16'),_0x47bab2,_0xe3c0('0x19'));_0xfe0cb(_0x63c06d['result'][_0xe3c0('0x17')]);}})['catch'](function(_0x4997d5){logger[_0xe3c0('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x47bab2,_0x4997d5);_0x55f173(_0x4997d5);});});}exports['GetVoiceQueue']=function(_0x50baff){var _0x411c4e=this;return new Promise(function(_0x488f94,_0x3937d5){return db['VoiceQueue'][_0xe3c0('0x1a')]({'raw':_0x50baff[_0xe3c0('0x1b')]?_0x50baff['options'][_0xe3c0('0x1c')]===undefined?!![]:![]:!![],'where':_0x50baff[_0xe3c0('0x1b')]?_0x50baff[_0xe3c0('0x1b')]['where']||null:null,'attributes':_0x50baff[_0xe3c0('0x1b')]?_0x50baff['options'][_0xe3c0('0x1d')]||null:null,'limit':_0x50baff[_0xe3c0('0x1b')]?_0x50baff['options'][_0xe3c0('0x1e')]||null:null,'include':_0x50baff['options']?_0x50baff[_0xe3c0('0x1b')][_0xe3c0('0x1f')]?_['map'](_0x50baff[_0xe3c0('0x1b')]['include'],function(_0x18f624){return{'model':db[_0x18f624[_0xe3c0('0x20')]],'as':_0x18f624['as'],'attributes':_0x18f624[_0xe3c0('0x1d')],'include':_0x18f624['include']?_['map'](_0x18f624[_0xe3c0('0x1f')],function(_0x3379b5){return{'model':db[_0x3379b5['model']],'as':_0x3379b5['as'],'attributes':_0x3379b5['attributes'],'include':_0x3379b5[_0xe3c0('0x1f')]?_[_0xe3c0('0x21')](_0x3379b5[_0xe3c0('0x1f')],function(_0xb179c4){return{'model':db[_0xb179c4[_0xe3c0('0x20')]],'as':_0xb179c4['as'],'attributes':_0xb179c4[_0xe3c0('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42d67b){logger[_0xe3c0('0x18')](_0xe3c0('0x22'),_0x50baff);logger[_0xe3c0('0x23')](_0xe3c0('0x22'),_0x50baff,JSON[_0xe3c0('0x13')](_0x42d67b));_0x488f94(_0x42d67b);})[_0xe3c0('0x24')](function(_0x1d730a){logger[_0xe3c0('0x14')]('GetVoiceQueue',_0x1d730a['message'],_0x50baff);_0x3937d5(_0x411c4e[_0xe3c0('0x14')](0x1f4,_0x1d730a[_0xe3c0('0x17')]));});});};exports[_0xe3c0('0x25')]=function(_0x4d095c){var _0x5a7855=this;return new Promise(function(_0x3646c5,_0x51037d){return db['VoiceQueue'][_0xe3c0('0x26')]({'raw':_0x4d095c[_0xe3c0('0x1b')]?_0x4d095c['options'][_0xe3c0('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d095c['options']?_0x4d095c[_0xe3c0('0x1b')]['where']||null:null,'attributes':_0x4d095c[_0xe3c0('0x1b')]?_0x4d095c[_0xe3c0('0x1b')][_0xe3c0('0x1d')]||null:null,'include':_0x4d095c[_0xe3c0('0x1b')]?_0x4d095c[_0xe3c0('0x1b')][_0xe3c0('0x1f')]?_[_0xe3c0('0x21')](_0x4d095c[_0xe3c0('0x1b')][_0xe3c0('0x1f')],function(_0x5d6d35){return{'model':db[_0x5d6d35[_0xe3c0('0x20')]],'as':_0x5d6d35['as'],'attributes':_0x5d6d35[_0xe3c0('0x1d')],'include':_0x5d6d35[_0xe3c0('0x1f')]?_[_0xe3c0('0x21')](_0x5d6d35['include'],function(_0x557631){return{'model':db[_0x557631[_0xe3c0('0x20')]],'as':_0x557631['as'],'attributes':_0x557631['attributes'],'include':_0x557631[_0xe3c0('0x1f')]?_[_0xe3c0('0x21')](_0x557631['include'],function(_0x230681){return{'model':db[_0x230681[_0xe3c0('0x20')]],'as':_0x230681['as'],'attributes':_0x230681[_0xe3c0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe3c0('0x11')](function(_0x14e328){logger[_0xe3c0('0x18')](_0xe3c0('0x25'),_0x4d095c);logger[_0xe3c0('0x23')](_0xe3c0('0x25'),_0x4d095c,JSON[_0xe3c0('0x13')](_0x14e328));_0x3646c5(_0x14e328);})[_0xe3c0('0x24')](function(_0x2f10b2){logger[_0xe3c0('0x14')](_0xe3c0('0x25'),_0x2f10b2[_0xe3c0('0x17')],_0x4d095c);_0x51037d(_0x5a7855[_0xe3c0('0x14')](0x1f4,_0x2f10b2[_0xe3c0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 7dfff1b..4508739 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 _0x60bc=['voiceQueue:','./voiceQueue.events','remove','update','register','length'];(function(_0x1bfd8a,_0x376704){var _0x6f4800=function(_0x470ba5){while(--_0x470ba5){_0x1bfd8a['push'](_0x1bfd8a['shift']());}};_0x6f4800(++_0x376704);}(_0x60bc,0xfd));var _0xc60b=function(_0x370338,_0x4178ec){_0x370338=_0x370338-0x0;var _0x2e10df=_0x60bc[_0x370338];return _0x2e10df;};'use strict';var VoiceQueueEvents=require(_0xc60b('0x0'));var events=['save',_0xc60b('0x1'),_0xc60b('0x2')];function createListener(_0x2e828c,_0xb84489){return function(_0x4e7835){_0xb84489['emit'](_0x2e828c,_0x4e7835);};}function removeListener(_0xb9ecca,_0xfec847){return function(){VoiceQueueEvents['removeListener'](_0xb9ecca,_0xfec847);};}exports[_0xc60b('0x3')]=function(_0x4f7be8){for(var _0x3783a5=0x0,_0x1fec76=events[_0xc60b('0x4')];_0x3783a5<_0x1fec76;_0x3783a5++){var _0x3b6c9b=events[_0x3783a5];var _0x2de232=createListener(_0xc60b('0x5')+_0x3b6c9b,_0x4f7be8);VoiceQueueEvents['on'](_0x3b6c9b,_0x2de232);}}; \ No newline at end of file +var _0x1e0c=['save','remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x1e0c,0xe9));var _0xc1e0=function(_0x581bdf,_0x11d27f){_0x581bdf=_0x581bdf-0x0;var _0x44e862=_0x1e0c[_0x581bdf];return _0x44e862;};'use strict';var VoiceQueueEvents=require(_0xc1e0('0x0'));var events=[_0xc1e0('0x1'),_0xc1e0('0x2'),_0xc1e0('0x3')];function createListener(_0x240e98,_0x530e8a){return function(_0x3a9f89){_0x530e8a[_0xc1e0('0x4')](_0x240e98,_0x3a9f89);};}function removeListener(_0x11e56c,_0x543918){return function(){VoiceQueueEvents[_0xc1e0('0x5')](_0x11e56c,_0x543918);};}exports[_0xc1e0('0x6')]=function(_0x3d493b){for(var _0x3c283d=0x0,_0x5ba0a5=events[_0xc1e0('0x7')];_0x3c283d<_0x5ba0a5;_0x3c283d++){var _0x26a689=events[_0x3c283d];var _0x4550cb=createListener(_0xc1e0('0x8')+_0x26a689,_0x3d493b);VoiceQueueEvents['on'](_0x26a689,_0x4550cb);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 164a46b..789e6af 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 _0x491c=['/index','getVoiceQueuesReport','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x491c,0x185));var _0xc491=function(_0x2accd6,_0x4257a7){_0x2accd6=_0x2accd6-0x0;var _0x132deb=_0x491c[_0x2accd6];return _0x132deb;};'use strict';var multer=require(_0xc491('0x0'));var util=require('util');var path=require(_0xc491('0x1'));var timeout=require('connect-timeout');var express=require(_0xc491('0x2'));var router=express[_0xc491('0x3')]();var fs_extra=require(_0xc491('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc491('0x5'));var config=require(_0xc491('0x6'));var controller=require('./voiceQueueReport.controller');router[_0xc491('0x7')]('/',auth['isAuthenticated'](),controller[_0xc491('0x8')]);router[_0xc491('0x7')](_0xc491('0x9'),auth[_0xc491('0xa')](),controller['describe']);router['get'](_0xc491('0xb'),auth['isAuthenticated'](),controller[_0xc491('0xc')]);router[_0xc491('0x7')](_0xc491('0xd'),auth[_0xc491('0xa')](),controller['show']);router[_0xc491('0xe')]('/',auth[_0xc491('0xa')](),controller['create']);router[_0xc491('0xf')](_0xc491('0xd'),auth[_0xc491('0xa')](),controller[_0xc491('0x10')]);router[_0xc491('0x11')](_0xc491('0xd'),auth[_0xc491('0xa')](),controller[_0xc491('0x12')]);module[_0xc491('0x13')]=router; \ No newline at end of file +var _0x864b=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','/:id','create','put','update','delete','destroy','exports','multer','path'];(function(_0x3cb30b,_0x504b3e){var _0x2ca717=function(_0x32a3d9){while(--_0x32a3d9){_0x3cb30b['push'](_0x3cb30b['shift']());}};_0x2ca717(++_0x504b3e);}(_0x864b,0x19c));var _0xb864=function(_0x202a26,_0x5612f3){_0x202a26=_0x202a26-0x0;var _0x3b2f19=_0x864b[_0x202a26];return _0x3b2f19;};'use strict';var multer=require(_0xb864('0x0'));var util=require('util');var path=require(_0xb864('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb864('0x2')]();var fs_extra=require(_0xb864('0x3'));var auth=require(_0xb864('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xb864('0x5')]('/',auth[_0xb864('0x6')](),controller[_0xb864('0x7')]);router['get'](_0xb864('0x8'),auth[_0xb864('0x6')](),controller[_0xb864('0x9')]);router[_0xb864('0x5')]('/index',auth[_0xb864('0x6')](),controller[_0xb864('0xa')]);router[_0xb864('0x5')](_0xb864('0xb'),auth[_0xb864('0x6')](),controller['show']);router['post']('/',auth[_0xb864('0x6')](),controller[_0xb864('0xc')]);router[_0xb864('0xd')](_0xb864('0xb'),auth['isAuthenticated'](),controller[_0xb864('0xe')]);router[_0xb864('0xf')](_0xb864('0xb'),auth[_0xb864('0x6')](),controller[_0xb864('0x10')]);module[_0xb864('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 7ac1aa7..e3dd48d 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 _0x0f92=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','queuecallerleaveAt','setDataValue'];(function(_0x257e85,_0x17549e){var _0x4c0f25=function(_0x259962){while(--_0x259962){_0x257e85['push'](_0x257e85['shift']());}};_0x4c0f25(++_0x17549e);}(_0x0f92,0x87));var _0x20f9=function(_0x170417,_0x4b0e62){_0x170417=_0x170417-0x0;var _0x42ec28=_0x0f92[_0x170417];return _0x42ec28;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x20f9('0x0')]},'uniqueid':{'type':Sequelize[_0x20f9('0x0')]},'calleridnum':{'type':Sequelize[_0x20f9('0x0')]},'calleridname':{'type':Sequelize[_0x20f9('0x0')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x20f9('0x1')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x137b0a){var _0x6a1c7f=moment(_0x137b0a);var _0x443efe=moment(this[_0x20f9('0x2')](_0x20f9('0x3')))[_0x20f9('0x4')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1e1475=_0x6a1c7f[_0x20f9('0x5')](_0x443efe,_0x20f9('0x6'));this['setDataValue'](_0x20f9('0x7'),_0x137b0a);this[_0x20f9('0x8')]('holdtime',_0x1e1475||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x20f9('0x9')]},'queuecallerabandon':{'type':Sequelize[_0x20f9('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x20f9('0x1')]},'queuecallercomplete':{'type':Sequelize[_0x20f9('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x20f9('0x1')]},'queuecallerexit':{'type':Sequelize[_0x20f9('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x20f9('0x1')]},'queuecallerexitreason':{'type':Sequelize[_0x20f9('0x0')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x20f9('0x0')]},'connectedlinenum':{'type':Sequelize[_0x20f9('0x0')]},'connectedlinename':{'type':Sequelize[_0x20f9('0x0')]},'accountcode':{'type':Sequelize[_0x20f9('0x0')]},'context':{'type':Sequelize[_0x20f9('0x0')]},'exten':{'type':Sequelize[_0x20f9('0x0')]},'priority':{'type':Sequelize[_0x20f9('0x0')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x20f9('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x20f9('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x20f9('0x0')]},'transfer':{'type':Sequelize[_0x20f9('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x20f9('0x0')],'comment':_0x20f9('0xb')},'transferexten':{'type':Sequelize[_0x20f9('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x20f9('0x0')]},'secondDisposition':{'type':Sequelize[_0x20f9('0x0')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x20f9('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0x20f9('0x0')]}}; \ No newline at end of file +var _0xd938=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER'];(function(_0x1d6d91,_0xbd3395){var _0x374d64=function(_0x2d3872){while(--_0x2d3872){_0x1d6d91['push'](_0x1d6d91['shift']());}};_0x374d64(++_0xbd3395);}(_0xd938,0x8a));var _0x8d93=function(_0x4a1fb8,_0x244265){_0x4a1fb8=_0x4a1fb8-0x0;var _0x33ddf9=_0xd938[_0x4a1fb8];return _0x33ddf9;};'use strict';var Sequelize=require(_0x8d93('0x0'));var moment=require(_0x8d93('0x1'));module['exports']={'type':{'type':Sequelize[_0x8d93('0x2')]},'uniqueid':{'type':Sequelize[_0x8d93('0x2')]},'calleridnum':{'type':Sequelize[_0x8d93('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8d93('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x8d93('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x28fb5e){var _0x55824b=moment(_0x28fb5e);var _0x306520=moment(this[_0x8d93('0x4')]('queuecallerjoinAt'))[_0x8d93('0x5')](_0x8d93('0x6'));var _0x175d76=_0x55824b[_0x8d93('0x7')](_0x306520,_0x8d93('0x8'));this[_0x8d93('0x9')]('queuecallerleaveAt',_0x28fb5e);this[_0x8d93('0x9')](_0x8d93('0xa'),_0x175d76||null);}},'position':{'type':Sequelize[_0x8d93('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x8d93('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8d93('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x8d93('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8d93('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8d93('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x8d93('0x2')],'comment':_0x8d93('0xd')},'originalposition':{'type':Sequelize[_0x8d93('0xb')]},'channel':{'type':Sequelize[_0x8d93('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8d93('0x2')]},'connectedlinename':{'type':Sequelize[_0x8d93('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8d93('0x2')]},'exten':{'type':Sequelize[_0x8d93('0x2')]},'priority':{'type':Sequelize[_0x8d93('0x2')]},'holdtime':{'type':Sequelize[_0x8d93('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8d93('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8d93('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8d93('0x2')],'comment':_0x8d93('0xe')},'transferexten':{'type':Sequelize[_0x8d93('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8d93('0x2')]},'disposition':{'type':Sequelize[_0x8d93('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8d93('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x8d93('0xb')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 010f42a..8a1a0a6 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 _0x35a2=['sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueueReport','include','findAll','rows','catch','includeAll','find','create','update','body','params','describe','getVoiceQueuesReport','hasOwnProperty','order','eml-format','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x295df8,_0x1f9924){var _0x1c4b61=function(_0x55f262){while(--_0x55f262){_0x295df8['push'](_0x295df8['shift']());}};_0x1c4b61(++_0x1f9924);}(_0x35a2,0xfd));var _0x235a=function(_0x2aba2c,_0x4884be){_0x2aba2c=_0x2aba2c-0x0;var _0x7692de=_0x35a2[_0x2aba2c];return _0x7692de;};'use strict';var emlformat=require(_0x235a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x235a('0x1'));var rp=require(_0x235a('0x2'));var moment=require(_0x235a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x235a('0x4'));var util=require(_0x235a('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x235a('0x6'));var fs=require('fs');var fs_extra=require(_0x235a('0x7'));var _=require(_0x235a('0x8'));var squel=require(_0x235a('0x9'));var crypto=require(_0x235a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x235a('0xb'));var Papa=require(_0x235a('0xc'));var Redis=require('ioredis');var authService=require(_0x235a('0xd'));var qs=require(_0x235a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x235a('0xf'))('api');var utils=require(_0x235a('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x235a('0x11'));var db=require(_0x235a('0x12'))['db'];config[_0x235a('0x13')]=_[_0x235a('0x14')](config[_0x235a('0x13')],{'host':_0x235a('0x15'),'port':0x18eb});var socket=require(_0x235a('0x16'))(new Redis(config[_0x235a('0x13')]));require(_0x235a('0x17'))[_0x235a('0x18')](socket);function respondWithStatusCode(_0x1135a2,_0x3deb40){_0x3deb40=_0x3deb40||0xcc;return function(_0x235d74){if(_0x235d74){return _0x1135a2[_0x235a('0x19')](_0x3deb40);}return _0x1135a2[_0x235a('0x1a')](_0x3deb40)[_0x235a('0x1b')]();};}function respondWithResult(_0x2e244e,_0x2362bc){_0x2362bc=_0x2362bc||0xc8;return function(_0x1bf3eb){if(_0x1bf3eb){return _0x2e244e['status'](_0x2362bc)[_0x235a('0x1c')](_0x1bf3eb);}};}function respondWithFilteredResult(_0x27a207,_0x5befcd){return function(_0x849528){if(_0x849528){var _0x473a1a=typeof _0x5befcd[_0x235a('0x1d')]==='undefined'&&typeof _0x5befcd[_0x235a('0x1e')]===_0x235a('0x1f');var _0x3bdb1c=_0x849528[_0x235a('0x20')];var _0x50f5b7=_0x473a1a?0x0:_0x5befcd[_0x235a('0x1d')];var _0x5103cc=_0x473a1a?_0x849528[_0x235a('0x20')]:_0x5befcd['offset']+_0x5befcd[_0x235a('0x1e')];var _0x1b7219;if(_0x5103cc>=_0x3bdb1c){_0x5103cc=_0x3bdb1c;_0x1b7219=0xc8;}else{_0x1b7219=0xce;}_0x27a207[_0x235a('0x1a')](_0x1b7219);return _0x27a207['set'](_0x235a('0x21'),_0x50f5b7+'-'+_0x5103cc+'/'+_0x3bdb1c)['json'](_0x849528);}return null;};}function patchUpdates(_0x19cadd){return function(_0x21519a){try{jsonpatch[_0x235a('0x22')](_0x21519a,_0x19cadd,!![]);}catch(_0x23d36c){return BPromise['reject'](_0x23d36c);}return _0x21519a[_0x235a('0x23')]();};}function saveUpdates(_0x5d8ef9,_0x393975){return function(_0x5c171d){if(_0x5c171d){return _0x5c171d['update'](_0x5d8ef9)['then'](function(_0x364b9d){return _0x364b9d;});}return null;};}function removeEntity(_0x197161,_0x292311){return function(_0x3c7486){if(_0x3c7486){return _0x3c7486[_0x235a('0x24')]()[_0x235a('0x25')](function(){_0x197161[_0x235a('0x1a')](0xcc)[_0x235a('0x1b')]();});}};}function handleEntityNotFound(_0x2e3319,_0x4b7dcc){return function(_0x33ab8d){if(!_0x33ab8d){_0x2e3319[_0x235a('0x19')](0x194);}return _0x33ab8d;};}function handleError(_0x5d2457,_0x4525a9){_0x4525a9=_0x4525a9||0x1f4;return function(_0x414c8c){logger[_0x235a('0x26')](_0x414c8c[_0x235a('0x27')]);if(_0x414c8c[_0x235a('0x28')]){delete _0x414c8c[_0x235a('0x28')];}_0x5d2457[_0x235a('0x1a')](_0x4525a9)['send'](_0x414c8c);};}exports[_0x235a('0x29')]=function(_0x4e22db,_0x345b3f){var _0x443f7a={},_0x5e8c4b={},_0x227dc8={'count':0x0,'rows':[]};var _0x33d4ec=_[_0x235a('0x2a')](db['VoiceQueueReport'][_0x235a('0x2b')],function(_0x103946){return{'name':_0x103946[_0x235a('0x2c')],'type':_0x103946['type'][_0x235a('0x2d')]};});_0x5e8c4b[_0x235a('0x2e')]=_['map'](_0x33d4ec,_0x235a('0x28'));_0x5e8c4b[_0x235a('0x2f')]=_[_0x235a('0x30')](_0x4e22db['query']);_0x5e8c4b[_0x235a('0x31')]=_[_0x235a('0x32')](_0x5e8c4b[_0x235a('0x2e')],_0x5e8c4b[_0x235a('0x2f')]);_0x443f7a[_0x235a('0x33')]=_[_0x235a('0x32')](_0x5e8c4b[_0x235a('0x2e')],qs[_0x235a('0x34')](_0x4e22db[_0x235a('0x2f')]['fields']));_0x443f7a['attributes']=_0x443f7a[_0x235a('0x33')][_0x235a('0x35')]?_0x443f7a['attributes']:_0x5e8c4b[_0x235a('0x2e')];if(!_0x4e22db['query']['hasOwnProperty'](_0x235a('0x36'))){_0x443f7a[_0x235a('0x1e')]=qs[_0x235a('0x1e')](_0x4e22db[_0x235a('0x2f')][_0x235a('0x1e')]);_0x443f7a['offset']=qs[_0x235a('0x1d')](_0x4e22db['query'][_0x235a('0x1d')]);}_0x443f7a['order']=qs[_0x235a('0x37')](_0x4e22db[_0x235a('0x2f')]['sort']);_0x443f7a[_0x235a('0x38')]=qs[_0x235a('0x31')](_[_0x235a('0x39')](_0x4e22db[_0x235a('0x2f')],_0x5e8c4b[_0x235a('0x31')]),_0x33d4ec);if(_0x4e22db['query'][_0x235a('0x3a')]){_0x443f7a[_0x235a('0x38')]=_[_0x235a('0x3b')](_0x443f7a[_0x235a('0x38')],{'$or':_['map'](_0x33d4ec,function(_0x49c783){if(_0x49c783['type']!==_0x235a('0x3c')){var _0x45dbcc={};_0x45dbcc[_0x49c783[_0x235a('0x28')]]={'$like':'%'+_0x4e22db[_0x235a('0x2f')][_0x235a('0x3a')]+'%'};return _0x45dbcc;}})});}_0x443f7a=_[_0x235a('0x3b')]({},_0x443f7a,_0x4e22db[_0x235a('0x3d')]);var _0x1a9201={'where':_0x443f7a[_0x235a('0x38')]};return db[_0x235a('0x3e')][_0x235a('0x20')](_0x1a9201)['then'](function(_0x3ed24b){_0x227dc8[_0x235a('0x20')]=_0x3ed24b;if(_0x4e22db['query']['includeAll']){_0x443f7a[_0x235a('0x3f')]=[{'all':!![]}];}return db[_0x235a('0x3e')][_0x235a('0x40')](_0x443f7a);})[_0x235a('0x25')](function(_0x25ea60){_0x227dc8[_0x235a('0x41')]=_0x25ea60;return _0x227dc8;})[_0x235a('0x25')](respondWithFilteredResult(_0x345b3f,_0x443f7a))[_0x235a('0x42')](handleError(_0x345b3f,null));};exports['show']=function(_0x462456,_0xeae740){var _0x2e92ff={'raw':![],'where':{'id':_0x462456['params']['id']}},_0x22b240={};_0x22b240[_0x235a('0x2e')]=_[_0x235a('0x30')](db[_0x235a('0x3e')]['rawAttributes']);_0x22b240[_0x235a('0x2f')]=_[_0x235a('0x30')](_0x462456[_0x235a('0x2f')]);_0x22b240[_0x235a('0x31')]=_[_0x235a('0x32')](_0x22b240[_0x235a('0x2e')],_0x22b240[_0x235a('0x2f')]);_0x2e92ff[_0x235a('0x33')]=_[_0x235a('0x32')](_0x22b240[_0x235a('0x2e')],qs[_0x235a('0x34')](_0x462456[_0x235a('0x2f')]['fields']));_0x2e92ff['attributes']=_0x2e92ff['attributes'][_0x235a('0x35')]?_0x2e92ff['attributes']:_0x22b240[_0x235a('0x2e')];if(_0x462456[_0x235a('0x2f')][_0x235a('0x43')]){_0x2e92ff[_0x235a('0x3f')]=[{'all':!![]}];}_0x2e92ff=_[_0x235a('0x3b')]({},_0x2e92ff,_0x462456[_0x235a('0x3d')]);return db[_0x235a('0x3e')][_0x235a('0x44')](_0x2e92ff)[_0x235a('0x25')](handleEntityNotFound(_0xeae740,null))['then'](respondWithResult(_0xeae740,null))['catch'](handleError(_0xeae740,null));};exports[_0x235a('0x45')]=function(_0x1cd116,_0x343f7b){return db['VoiceQueueReport'][_0x235a('0x45')](_0x1cd116['body'],{})[_0x235a('0x25')](respondWithResult(_0x343f7b,0xc9))['catch'](handleError(_0x343f7b,null));};exports[_0x235a('0x46')]=function(_0xd9de6f,_0xc70ff8){if(_0xd9de6f[_0x235a('0x47')]['id']){delete _0xd9de6f[_0x235a('0x47')]['id'];}return db[_0x235a('0x3e')][_0x235a('0x44')]({'where':{'id':_0xd9de6f[_0x235a('0x48')]['id']}})[_0x235a('0x25')](handleEntityNotFound(_0xc70ff8,null))['then'](saveUpdates(_0xd9de6f[_0x235a('0x47')],null))[_0x235a('0x25')](respondWithResult(_0xc70ff8,null))['catch'](handleError(_0xc70ff8,null));};exports[_0x235a('0x24')]=function(_0x38aec6,_0x245272){return db[_0x235a('0x3e')]['find']({'where':{'id':_0x38aec6[_0x235a('0x48')]['id']}})[_0x235a('0x25')](handleEntityNotFound(_0x245272,null))[_0x235a('0x25')](removeEntity(_0x245272,null))[_0x235a('0x42')](handleError(_0x245272,null));};exports[_0x235a('0x49')]=function(_0x137e54,_0xc1a53b){return db[_0x235a('0x3e')]['describe']()['then'](respondWithResult(_0xc1a53b,null))[_0x235a('0x42')](handleError(_0xc1a53b,null));};exports[_0x235a('0x4a')]=function(_0x3efd85,_0x163420){var _0x3ce89c={},_0x1bbae8={},_0x3b0d3e={'count':0x0,'rows':[]};_0x1bbae8[_0x235a('0x2e')]=_[_0x235a('0x30')](db['VoiceQueueReport'][_0x235a('0x2b')]);_0x1bbae8[_0x235a('0x2f')]=_[_0x235a('0x30')](_0x3efd85[_0x235a('0x2f')]);_0x1bbae8[_0x235a('0x31')]=_[_0x235a('0x32')](_0x1bbae8['model'],_0x1bbae8[_0x235a('0x2f')]);_0x3ce89c['attributes']=_[_0x235a('0x32')](_0x1bbae8[_0x235a('0x2e')],qs[_0x235a('0x34')](_0x3efd85['query'][_0x235a('0x34')]));_0x3ce89c[_0x235a('0x33')]=_0x3ce89c['attributes'][_0x235a('0x35')]?_0x3ce89c[_0x235a('0x33')]:_0x1bbae8[_0x235a('0x2e')];if(!_0x3efd85[_0x235a('0x2f')][_0x235a('0x4b')]('nolimit')){_0x3ce89c[_0x235a('0x1e')]=qs[_0x235a('0x1e')](_0x3efd85[_0x235a('0x2f')]['limit']);_0x3ce89c['offset']=qs['offset'](_0x3efd85[_0x235a('0x2f')][_0x235a('0x1d')]);}_0x3ce89c[_0x235a('0x4c')]=qs['sort'](_0x3efd85[_0x235a('0x2f')]['sort']);_0x3ce89c[_0x235a('0x38')]=qs['filters'](_[_0x235a('0x39')](_0x3efd85[_0x235a('0x2f')],_0x1bbae8[_0x235a('0x31')]));if(_0x3efd85[_0x235a('0x2f')][_0x235a('0x3a')]){_0x3ce89c[_0x235a('0x38')]=_['merge'](_0x3ce89c[_0x235a('0x38')],{'$or':_['map'](_0x3ce89c[_0x235a('0x33')],function(_0xbeec01){var _0x3f722c={};_0x3f722c[_0xbeec01]={'$like':'%'+_0x3efd85[_0x235a('0x2f')][_0x235a('0x3a')]+'%'};return _0x3f722c;})});}_0x3ce89c=_[_0x235a('0x3b')]({},_0x3ce89c,_0x3efd85[_0x235a('0x3d')]);var _0x3f90bc={'where':_0x3ce89c['where']};return db[_0x235a('0x3e')][_0x235a('0x20')](_0x3f90bc)[_0x235a('0x25')](function(_0x3dbf7e){_0x3b0d3e['count']=_0x3dbf7e;if(_0x3efd85[_0x235a('0x2f')]['includeAll']){_0x3ce89c[_0x235a('0x3f')]=[{'all':!![]}];}return db[_0x235a('0x3e')]['findAll'](_0x3ce89c);})[_0x235a('0x25')](function(_0xd05a39){_0x3b0d3e[_0x235a('0x41')]=_0xd05a39;return _0x3b0d3e;})['then'](respondWithFilteredResult(_0x163420,_0x3ce89c,_0x235a('0x4a')))['catch'](handleError(_0x163420,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x8803=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','status','end','json','undefined','count','offset','Content-Range','save','update','then','destroy','sendStatus','error','name','send','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','describe','nolimit','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x8803,0xa0));var _0x3880=function(_0x308616,_0x1dd844){_0x308616=_0x308616-0x0;var _0x47ce3c=_0x8803[_0x308616];return _0x47ce3c;};'use strict';var emlformat=require(_0x3880('0x0'));var rimraf=require(_0x3880('0x1'));var zipdir=require(_0x3880('0x2'));var jsonpatch=require(_0x3880('0x3'));var rp=require(_0x3880('0x4'));var moment=require('moment');var BPromise=require(_0x3880('0x5'));var Mustache=require('mustache');var util=require(_0x3880('0x6'));var path=require('path');var sox=require(_0x3880('0x7'));var csv=require(_0x3880('0x8'));var ejs=require(_0x3880('0x9'));var fs=require('fs');var fs_extra=require(_0x3880('0xa'));var _=require(_0x3880('0xb'));var squel=require(_0x3880('0xc'));var crypto=require(_0x3880('0xd'));var jsforce=require(_0x3880('0xe'));var deskjs=require(_0x3880('0xf'));var toCsv=require(_0x3880('0x8'));var querystring=require(_0x3880('0x10'));var Papa=require(_0x3880('0x11'));var Redis=require(_0x3880('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3880('0x13'));var hardwareService=require(_0x3880('0x14'));var logger=require(_0x3880('0x15'))(_0x3880('0x16'));var utils=require(_0x3880('0x17'));var config=require(_0x3880('0x18'));var licenseUtil=require(_0x3880('0x19'));var db=require(_0x3880('0x1a'))['db'];config[_0x3880('0x1b')]=_[_0x3880('0x1c')](config[_0x3880('0x1b')],{'host':_0x3880('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3880('0x1e'))[_0x3880('0x1f')](socket);function respondWithStatusCode(_0x347bbb,_0x5c0da2){_0x5c0da2=_0x5c0da2||0xcc;return function(_0x235257){if(_0x235257){return _0x347bbb['sendStatus'](_0x5c0da2);}return _0x347bbb[_0x3880('0x20')](_0x5c0da2)[_0x3880('0x21')]();};}function respondWithResult(_0x2af258,_0x228cbd){_0x228cbd=_0x228cbd||0xc8;return function(_0x18de7d){if(_0x18de7d){return _0x2af258[_0x3880('0x20')](_0x228cbd)[_0x3880('0x22')](_0x18de7d);}};}function respondWithFilteredResult(_0x16b4e2,_0x4eac26){return function(_0xb43ce1){if(_0xb43ce1){var _0x5b1d43=typeof _0x4eac26['offset']==='undefined'&&typeof _0x4eac26['limit']===_0x3880('0x23');var _0x283a3f=_0xb43ce1[_0x3880('0x24')];var _0x5c4170=_0x5b1d43?0x0:_0x4eac26[_0x3880('0x25')];var _0x14b5f5=_0x5b1d43?_0xb43ce1[_0x3880('0x24')]:_0x4eac26[_0x3880('0x25')]+_0x4eac26['limit'];var _0xcfb7a0;if(_0x14b5f5>=_0x283a3f){_0x14b5f5=_0x283a3f;_0xcfb7a0=0xc8;}else{_0xcfb7a0=0xce;}_0x16b4e2[_0x3880('0x20')](_0xcfb7a0);return _0x16b4e2['set'](_0x3880('0x26'),_0x5c4170+'-'+_0x14b5f5+'/'+_0x283a3f)['json'](_0xb43ce1);}return null;};}function patchUpdates(_0x40be7d){return function(_0x2f383e){try{jsonpatch['apply'](_0x2f383e,_0x40be7d,!![]);}catch(_0x9f0caa){return BPromise['reject'](_0x9f0caa);}return _0x2f383e[_0x3880('0x27')]();};}function saveUpdates(_0x2939e5,_0x9c0234){return function(_0x20868f){if(_0x20868f){return _0x20868f[_0x3880('0x28')](_0x2939e5)[_0x3880('0x29')](function(_0x80e647){return _0x80e647;});}return null;};}function removeEntity(_0x41a22f,_0x77da5d){return function(_0x3732d6){if(_0x3732d6){return _0x3732d6[_0x3880('0x2a')]()[_0x3880('0x29')](function(){_0x41a22f[_0x3880('0x20')](0xcc)[_0x3880('0x21')]();});}};}function handleEntityNotFound(_0x56c926,_0x1577ec){return function(_0x484b7c){if(!_0x484b7c){_0x56c926[_0x3880('0x2b')](0x194);}return _0x484b7c;};}function handleError(_0x8405a,_0x31a1d9){_0x31a1d9=_0x31a1d9||0x1f4;return function(_0xefbeed){logger[_0x3880('0x2c')](_0xefbeed['stack']);if(_0xefbeed[_0x3880('0x2d')]){delete _0xefbeed['name'];}_0x8405a[_0x3880('0x20')](_0x31a1d9)[_0x3880('0x2e')](_0xefbeed);};}exports['index']=function(_0x82d70f,_0x22a693){var _0x5906b9={},_0x13a9d8={},_0x92553e={'count':0x0,'rows':[]};var _0x224f7a=_[_0x3880('0x2f')](db[_0x3880('0x30')][_0x3880('0x31')],function(_0x2639e8){return{'name':_0x2639e8[_0x3880('0x32')],'type':_0x2639e8['type'][_0x3880('0x33')]};});_0x13a9d8[_0x3880('0x34')]=_[_0x3880('0x2f')](_0x224f7a,_0x3880('0x2d'));_0x13a9d8[_0x3880('0x35')]=_[_0x3880('0x36')](_0x82d70f['query']);_0x13a9d8[_0x3880('0x37')]=_['intersection'](_0x13a9d8[_0x3880('0x34')],_0x13a9d8[_0x3880('0x35')]);_0x5906b9[_0x3880('0x38')]=_['intersection'](_0x13a9d8[_0x3880('0x34')],qs['fields'](_0x82d70f['query'][_0x3880('0x39')]));_0x5906b9[_0x3880('0x38')]=_0x5906b9['attributes'][_0x3880('0x3a')]?_0x5906b9[_0x3880('0x38')]:_0x13a9d8[_0x3880('0x34')];if(!_0x82d70f[_0x3880('0x35')][_0x3880('0x3b')]('nolimit')){_0x5906b9[_0x3880('0x3c')]=qs[_0x3880('0x3c')](_0x82d70f['query']['limit']);_0x5906b9['offset']=qs[_0x3880('0x25')](_0x82d70f[_0x3880('0x35')]['offset']);}_0x5906b9[_0x3880('0x3d')]=qs[_0x3880('0x3e')](_0x82d70f[_0x3880('0x35')][_0x3880('0x3e')]);_0x5906b9['where']=qs[_0x3880('0x37')](_[_0x3880('0x3f')](_0x82d70f['query'],_0x13a9d8[_0x3880('0x37')]),_0x224f7a);if(_0x82d70f[_0x3880('0x35')][_0x3880('0x40')]){_0x5906b9['where']=_['merge'](_0x5906b9[_0x3880('0x41')],{'$or':_[_0x3880('0x2f')](_0x224f7a,function(_0xb35089){if(_0xb35089[_0x3880('0x42')]!==_0x3880('0x43')){var _0x58a27e={};_0x58a27e[_0xb35089[_0x3880('0x2d')]]={'$like':'%'+_0x82d70f[_0x3880('0x35')]['filter']+'%'};return _0x58a27e;}})});}_0x5906b9=_[_0x3880('0x44')]({},_0x5906b9,_0x82d70f['options']);var _0x3ec561={'where':_0x5906b9[_0x3880('0x41')]};return db[_0x3880('0x30')][_0x3880('0x24')](_0x3ec561)[_0x3880('0x29')](function(_0x681431){_0x92553e[_0x3880('0x24')]=_0x681431;if(_0x82d70f[_0x3880('0x35')][_0x3880('0x45')]){_0x5906b9[_0x3880('0x46')]=[{'all':!![]}];}return db[_0x3880('0x30')][_0x3880('0x47')](_0x5906b9);})[_0x3880('0x29')](function(_0x2bb51c){_0x92553e[_0x3880('0x48')]=_0x2bb51c;return _0x92553e;})[_0x3880('0x29')](respondWithFilteredResult(_0x22a693,_0x5906b9))[_0x3880('0x49')](handleError(_0x22a693,null));};exports[_0x3880('0x4a')]=function(_0x37c75c,_0x2b4c64){var _0x473448={'raw':![],'where':{'id':_0x37c75c[_0x3880('0x4b')]['id']}},_0x2654bc={};_0x2654bc[_0x3880('0x34')]=_[_0x3880('0x36')](db[_0x3880('0x30')]['rawAttributes']);_0x2654bc[_0x3880('0x35')]=_[_0x3880('0x36')](_0x37c75c[_0x3880('0x35')]);_0x2654bc[_0x3880('0x37')]=_[_0x3880('0x4c')](_0x2654bc['model'],_0x2654bc['query']);_0x473448['attributes']=_['intersection'](_0x2654bc[_0x3880('0x34')],qs[_0x3880('0x39')](_0x37c75c[_0x3880('0x35')][_0x3880('0x39')]));_0x473448['attributes']=_0x473448['attributes'][_0x3880('0x3a')]?_0x473448[_0x3880('0x38')]:_0x2654bc[_0x3880('0x34')];if(_0x37c75c[_0x3880('0x35')][_0x3880('0x45')]){_0x473448[_0x3880('0x46')]=[{'all':!![]}];}_0x473448=_[_0x3880('0x44')]({},_0x473448,_0x37c75c[_0x3880('0x4d')]);return db[_0x3880('0x30')][_0x3880('0x4e')](_0x473448)[_0x3880('0x29')](handleEntityNotFound(_0x2b4c64,null))[_0x3880('0x29')](respondWithResult(_0x2b4c64,null))[_0x3880('0x49')](handleError(_0x2b4c64,null));};exports[_0x3880('0x4f')]=function(_0x11f1c3,_0x24a7c8){return db[_0x3880('0x30')]['create'](_0x11f1c3[_0x3880('0x50')],{})[_0x3880('0x29')](respondWithResult(_0x24a7c8,0xc9))[_0x3880('0x49')](handleError(_0x24a7c8,null));};exports[_0x3880('0x28')]=function(_0x10189e,_0x323a12){if(_0x10189e[_0x3880('0x50')]['id']){delete _0x10189e[_0x3880('0x50')]['id'];}return db[_0x3880('0x30')][_0x3880('0x4e')]({'where':{'id':_0x10189e[_0x3880('0x4b')]['id']}})[_0x3880('0x29')](handleEntityNotFound(_0x323a12,null))[_0x3880('0x29')](saveUpdates(_0x10189e[_0x3880('0x50')],null))[_0x3880('0x29')](respondWithResult(_0x323a12,null))[_0x3880('0x49')](handleError(_0x323a12,null));};exports[_0x3880('0x2a')]=function(_0x1a4718,_0x4d064f){return db['VoiceQueueReport'][_0x3880('0x4e')]({'where':{'id':_0x1a4718[_0x3880('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4d064f,null))[_0x3880('0x29')](removeEntity(_0x4d064f,null))['catch'](handleError(_0x4d064f,null));};exports[_0x3880('0x51')]=function(_0x489d64,_0xf111a1){return db['VoiceQueueReport'][_0x3880('0x51')]()[_0x3880('0x29')](respondWithResult(_0xf111a1,null))[_0x3880('0x49')](handleError(_0xf111a1,null));};exports['getVoiceQueuesReport']=function(_0x296eba,_0xd508a3){var _0x7f8d33={},_0x4d51b9={},_0x24da3b={'count':0x0,'rows':[]};_0x4d51b9[_0x3880('0x34')]=_['keys'](db[_0x3880('0x30')]['rawAttributes']);_0x4d51b9[_0x3880('0x35')]=_['keys'](_0x296eba[_0x3880('0x35')]);_0x4d51b9[_0x3880('0x37')]=_[_0x3880('0x4c')](_0x4d51b9[_0x3880('0x34')],_0x4d51b9[_0x3880('0x35')]);_0x7f8d33[_0x3880('0x38')]=_[_0x3880('0x4c')](_0x4d51b9['model'],qs[_0x3880('0x39')](_0x296eba[_0x3880('0x35')]['fields']));_0x7f8d33[_0x3880('0x38')]=_0x7f8d33[_0x3880('0x38')]['length']?_0x7f8d33[_0x3880('0x38')]:_0x4d51b9[_0x3880('0x34')];if(!_0x296eba[_0x3880('0x35')][_0x3880('0x3b')](_0x3880('0x52'))){_0x7f8d33['limit']=qs['limit'](_0x296eba[_0x3880('0x35')][_0x3880('0x3c')]);_0x7f8d33[_0x3880('0x25')]=qs['offset'](_0x296eba[_0x3880('0x35')][_0x3880('0x25')]);}_0x7f8d33[_0x3880('0x3d')]=qs[_0x3880('0x3e')](_0x296eba['query']['sort']);_0x7f8d33[_0x3880('0x41')]=qs[_0x3880('0x37')](_[_0x3880('0x3f')](_0x296eba['query'],_0x4d51b9[_0x3880('0x37')]));if(_0x296eba['query'][_0x3880('0x40')]){_0x7f8d33[_0x3880('0x41')]=_[_0x3880('0x44')](_0x7f8d33[_0x3880('0x41')],{'$or':_['map'](_0x7f8d33[_0x3880('0x38')],function(_0x465d4b){var _0x5e1746={};_0x5e1746[_0x465d4b]={'$like':'%'+_0x296eba[_0x3880('0x35')][_0x3880('0x40')]+'%'};return _0x5e1746;})});}_0x7f8d33=_['merge']({},_0x7f8d33,_0x296eba['options']);var _0x36fdfa={'where':_0x7f8d33[_0x3880('0x41')]};return db[_0x3880('0x30')][_0x3880('0x24')](_0x36fdfa)['then'](function(_0x362910){_0x24da3b['count']=_0x362910;if(_0x296eba['query'][_0x3880('0x45')]){_0x7f8d33[_0x3880('0x46')]=[{'all':!![]}];}return db[_0x3880('0x30')][_0x3880('0x47')](_0x7f8d33);})['then'](function(_0x51fddf){_0x24da3b[_0x3880('0x48')]=_0x51fddf;return _0x24da3b;})[_0x3880('0x29')](respondWithFilteredResult(_0xd508a3,_0x7f8d33,_0x3880('0x53')))[_0x3880('0x49')](handleError(_0xd508a3,null,_0x3880('0x53')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 704715c..24d8199 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 _0x65fa=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65fa,0x196));var _0xa65f=function(_0x6136eb,_0x2ee1cc){_0x6136eb=_0x6136eb-0x0;var _0x80533c=_0x65fa[_0x6136eb];return _0x80533c;};'use strict';var EventEmitter=require(_0xa65f('0x0'));var VoiceQueueReport=require(_0xa65f('0x1'))['db'][_0xa65f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa65f('0x3')](0x0);var events={'afterCreate':_0xa65f('0x4'),'afterUpdate':_0xa65f('0x5'),'afterDestroy':_0xa65f('0x6')};function emitEvent(_0x3af84a){return function(_0x47f293,_0x15fd5f,_0x29f927){VoiceQueueReportEvents['emit'](_0x3af84a+':'+_0x47f293['id'],_0x47f293);VoiceQueueReportEvents[_0xa65f('0x7')](_0x3af84a,_0x47f293);_0x29f927(null);};}for(var e in events){if(events[_0xa65f('0x8')](e)){var event=events[e];VoiceQueueReport[_0xa65f('0x9')](e,emitEvent(event));}}module[_0xa65f('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x6b9a=['events','../../mysqldb','VoiceQueueReport','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0x6b9a,0x10e));var _0xa6b9=function(_0x4c3641,_0x168c09){_0x4c3641=_0x4c3641-0x0;var _0x166f37=_0x6b9a[_0x4c3641];return _0x166f37;};'use strict';var EventEmitter=require(_0xa6b9('0x0'));var VoiceQueueReport=require(_0xa6b9('0x1'))['db'][_0xa6b9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6b9('0x3'),'afterDestroy':_0xa6b9('0x4')};function emitEvent(_0x2fa7f3){return function(_0x4a3df3,_0x5a1502,_0x4fb65b){VoiceQueueReportEvents['emit'](_0x2fa7f3+':'+_0x4a3df3['id'],_0x4a3df3);VoiceQueueReportEvents[_0xa6b9('0x5')](_0x2fa7f3,_0x4a3df3);_0x4fb65b(null);};}for(var e in events){if(events[_0xa6b9('0x6')](e)){var event=events[e];VoiceQueueReport[_0xa6b9('0x7')](e,emitEvent(event));}}module[_0xa6b9('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 a8ac0f4..69b05ef 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 _0x257b=['rimraf','../../config/environment','define','VoiceQueueReport','uniqueid','calleridnum','../../config/logger','api','moment','bluebird','path'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0x257b,0xf8));var _0xb257=function(_0x5d64f3,_0x374d1a){_0x5d64f3=_0x5d64f3-0x0;var _0x2e5c81=_0x257b[_0x5d64f3];return _0x2e5c81;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb257('0x0'))(_0xb257('0x1'));var moment=require(_0xb257('0x2'));var BPromise=require(_0xb257('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb257('0x4'));var rimraf=require(_0xb257('0x5'));var config=require(_0xb257('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x3a946c,_0x161b70){return _0x3a946c[_0xb257('0x7')](_0xb257('0x8'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xb257('0x9')]},{'fields':[_0xb257('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6110=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','report_queue','uniqueid','calleridnum'];(function(_0x389e11,_0x4e3f3b){var _0x1613b7=function(_0xc42a2f){while(--_0xc42a2f){_0x389e11['push'](_0x389e11['shift']());}};_0x1613b7(++_0x4e3f3b);}(_0x6110,0x12b));var _0x0611=function(_0x3abf41,_0x496a68){_0x3abf41=_0x3abf41-0x0;var _0x3255f2=_0x6110[_0x3abf41];return _0x3255f2;};'use strict';var _=require(_0x0611('0x0'));var util=require(_0x0611('0x1'));var logger=require(_0x0611('0x2'))(_0x0611('0x3'));var moment=require(_0x0611('0x4'));var BPromise=require(_0x0611('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0611('0x6'));var config=require(_0x0611('0x7'));var attributes=require(_0x0611('0x8'));module[_0x0611('0x9')]=function(_0x4cefdc,_0x4487db){return _0x4cefdc['define']('VoiceQueueReport',attributes,{'tableName':_0x0611('0xa'),'paranoid':![],'indexes':[{'fields':[_0x0611('0xb')]},{'fields':[_0x0611('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 7e7c9fb..65b82ca 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 _0xc0f9=['http','redis','defaults','./voiceQueueReport.socket','register','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','info','result','VoiceQueueReport','options','raw','attributes','map','include','model','then','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xc0f9,0x186));var _0x9c0f=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xc0f9[_0x186376];return _0x2dbdd9;};'use strict';var _=require(_0x9c0f('0x0'));var util=require(_0x9c0f('0x1'));var moment=require('moment');var BPromise=require(_0x9c0f('0x2'));var rs=require(_0x9c0f('0x3'));var fs=require('fs');var Redis=require(_0x9c0f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c0f('0x5'));var logger=require(_0x9c0f('0x6'))(_0x9c0f('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c0f('0x8'));var client=jayson[_0x9c0f('0x9')][_0x9c0f('0xa')]({'port':0x232a});config[_0x9c0f('0xb')]=_[_0x9c0f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9c0f('0xd'))[_0x9c0f('0xe')](socket);function respondWithRpcPromise(_0x5bece1,_0x580465,_0x1c600e){return new BPromise(function(_0x3b77b7,_0x5003df){return client['request'](_0x5bece1,_0x1c600e)['then'](function(_0x19b0fe){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x580465,_0x9c0f('0xf'));logger[_0x9c0f('0x10')](_0x9c0f('0x11'),_0x580465,'request\x20sent',JSON[_0x9c0f('0x12')](_0x19b0fe));if(_0x19b0fe[_0x9c0f('0x13')]){if(_0x19b0fe[_0x9c0f('0x13')][_0x9c0f('0x14')]===0x1f4){logger[_0x9c0f('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x580465,_0x19b0fe[_0x9c0f('0x13')][_0x9c0f('0x15')]);return _0x5003df(_0x19b0fe[_0x9c0f('0x13')]['message']);}logger[_0x9c0f('0x13')](_0x9c0f('0x16'),_0x580465,_0x19b0fe['error']['message']);return _0x3b77b7(_0x19b0fe['error'][_0x9c0f('0x15')]);}else{logger[_0x9c0f('0x17')](_0x9c0f('0x16'),_0x580465,'request\x20sent');_0x3b77b7(_0x19b0fe[_0x9c0f('0x18')][_0x9c0f('0x15')]);}})['catch'](function(_0xb91876){logger[_0x9c0f('0x13')](_0x9c0f('0x16'),_0x580465,_0xb91876);_0x5003df(_0xb91876);});});}exports['GetVoiceQueueReport']=function(_0x4a3454){var _0x27882b=this;return new Promise(function(_0x23fca4,_0x23e033){return db[_0x9c0f('0x19')]['findAll']({'raw':_0x4a3454['options']?_0x4a3454[_0x9c0f('0x1a')][_0x9c0f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a3454[_0x9c0f('0x1a')]?_0x4a3454[_0x9c0f('0x1a')]['where']||null:null,'attributes':_0x4a3454[_0x9c0f('0x1a')]?_0x4a3454[_0x9c0f('0x1a')][_0x9c0f('0x1c')]||null:null,'limit':_0x4a3454[_0x9c0f('0x1a')]?_0x4a3454[_0x9c0f('0x1a')]['limit']||null:null,'include':_0x4a3454[_0x9c0f('0x1a')]?_0x4a3454[_0x9c0f('0x1a')]['include']?_[_0x9c0f('0x1d')](_0x4a3454['options'][_0x9c0f('0x1e')],function(_0x14aaf6){return{'model':db[_0x14aaf6[_0x9c0f('0x1f')]],'as':_0x14aaf6['as'],'attributes':_0x14aaf6[_0x9c0f('0x1c')],'include':_0x14aaf6[_0x9c0f('0x1e')]?_[_0x9c0f('0x1d')](_0x14aaf6[_0x9c0f('0x1e')],function(_0x395292){return{'model':db[_0x395292[_0x9c0f('0x1f')]],'as':_0x395292['as'],'attributes':_0x395292[_0x9c0f('0x1c')],'include':_0x395292['include']?_[_0x9c0f('0x1d')](_0x395292[_0x9c0f('0x1e')],function(_0x7c28dc){return{'model':db[_0x7c28dc[_0x9c0f('0x1f')]],'as':_0x7c28dc['as'],'attributes':_0x7c28dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c0f('0x20')](function(_0xa7d484){logger[_0x9c0f('0x17')]('GetVoiceQueueReport',_0x4a3454);logger['debug'](_0x9c0f('0x21'),_0x4a3454,JSON[_0x9c0f('0x12')](_0xa7d484));_0x23fca4(_0xa7d484);})[_0x9c0f('0x22')](function(_0x3d4c9d){logger[_0x9c0f('0x13')](_0x9c0f('0x21'),_0x3d4c9d[_0x9c0f('0x15')],_0x4a3454);_0x23e033(_0x27882b[_0x9c0f('0x13')](0x1f4,_0x3d4c9d[_0x9c0f('0x15')]));});});};exports[_0x9c0f('0x23')]=function(_0x2ab0cb){var _0x1c2248=this;return new Promise(function(_0x1f197d,_0x39bc74){return db[_0x9c0f('0x19')][_0x9c0f('0x24')](_0x2ab0cb['body'],{'raw':_0x2ab0cb[_0x9c0f('0x1a')]?_0x2ab0cb['options'][_0x9c0f('0x1b')]===undefined?!![]:![]:!![]})[_0x9c0f('0x20')](function(_0x1c6fd0){logger[_0x9c0f('0x17')](_0x9c0f('0x23'),_0x2ab0cb);logger[_0x9c0f('0x10')](_0x9c0f('0x23'),_0x2ab0cb,JSON['stringify'](_0x1c6fd0));_0x1f197d(_0x1c6fd0);})[_0x9c0f('0x22')](function(_0x58676f){logger[_0x9c0f('0x13')](_0x9c0f('0x23'),_0x58676f[_0x9c0f('0x15')],_0x2ab0cb);_0x39bc74(_0x1c2248[_0x9c0f('0x13')](0x1f4,_0x58676f[_0x9c0f('0x15')]));});});};exports[_0x9c0f('0x25')]=function(_0x25b636){var _0x5e798d=this;return new Promise(function(_0x423817,_0x112be4){return db['VoiceQueueReport'][_0x9c0f('0x26')](_0x25b636['body'],{'raw':_0x25b636[_0x9c0f('0x1a')]?_0x25b636[_0x9c0f('0x1a')][_0x9c0f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25b636['options']?_0x25b636['options'][_0x9c0f('0x27')]||null:null,'attributes':_0x25b636[_0x9c0f('0x1a')]?_0x25b636[_0x9c0f('0x1a')]['attributes']||null:null,'limit':_0x25b636['options']?_0x25b636[_0x9c0f('0x1a')]['limit']||null:null})[_0x9c0f('0x20')](function(_0x2bfe5d){logger[_0x9c0f('0x17')](_0x9c0f('0x25'),_0x25b636);logger['debug'](_0x9c0f('0x25'),_0x25b636,JSON[_0x9c0f('0x12')](_0x2bfe5d));_0x423817(_0x2bfe5d);})[_0x9c0f('0x22')](function(_0x19de40){logger[_0x9c0f('0x13')](_0x9c0f('0x25'),_0x19de40['message'],_0x25b636);_0x112be4(_0x5e798d[_0x9c0f('0x13')](0x1f4,_0x19de40[_0x9c0f('0x15')]));});});}; \ No newline at end of file +var _0x072d=['defaults','localhost','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','info','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x172f5d,_0x2bff0f){var _0x268a72=function(_0x3dba89){while(--_0x3dba89){_0x172f5d['push'](_0x172f5d['shift']());}};_0x268a72(++_0x2bff0f);}(_0x072d,0x1b6));var _0xd072=function(_0x2df79e,_0x25ec37){_0x2df79e=_0x2df79e-0x0;var _0x4b2df7=_0x072d[_0x2df79e];return _0x4b2df7;};'use strict';var _=require(_0xd072('0x0'));var util=require(_0xd072('0x1'));var moment=require(_0xd072('0x2'));var BPromise=require(_0xd072('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd072('0x4'));var db=require(_0xd072('0x5'))['db'];var utils=require(_0xd072('0x6'));var logger=require(_0xd072('0x7'))(_0xd072('0x8'));var config=require(_0xd072('0x9'));var jayson=require(_0xd072('0xa'));var client=jayson['client'][_0xd072('0xb')]({'port':0x232a});config[_0xd072('0xc')]=_[_0xd072('0xd')](config[_0xd072('0xc')],{'host':_0xd072('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd072('0xc')]));require(_0xd072('0xf'))[_0xd072('0x10')](socket);function respondWithRpcPromise(_0x3343c4,_0x5d51e2,_0x394479){return new BPromise(function(_0x4bf72e,_0x69ca4e){return client['request'](_0x3343c4,_0x394479)[_0xd072('0x11')](function(_0x3a5646){logger['info'](_0xd072('0x12'),_0x5d51e2,'request\x20sent');logger[_0xd072('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x5d51e2,_0xd072('0x14'),JSON[_0xd072('0x15')](_0x3a5646));if(_0x3a5646['error']){if(_0x3a5646['error'][_0xd072('0x16')]===0x1f4){logger[_0xd072('0x17')](_0xd072('0x12'),_0x5d51e2,_0x3a5646[_0xd072('0x17')][_0xd072('0x18')]);return _0x69ca4e(_0x3a5646[_0xd072('0x17')]['message']);}logger[_0xd072('0x17')](_0xd072('0x12'),_0x5d51e2,_0x3a5646[_0xd072('0x17')]['message']);return _0x4bf72e(_0x3a5646[_0xd072('0x17')][_0xd072('0x18')]);}else{logger[_0xd072('0x19')](_0xd072('0x12'),_0x5d51e2,_0xd072('0x14'));_0x4bf72e(_0x3a5646['result'][_0xd072('0x18')]);}})[_0xd072('0x1a')](function(_0x2cf4b9){logger[_0xd072('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x5d51e2,_0x2cf4b9);_0x69ca4e(_0x2cf4b9);});});}exports[_0xd072('0x1b')]=function(_0x1cb605){var _0x1d1caa=this;return new Promise(function(_0x3a8a67,_0x1937ee){return db[_0xd072('0x1c')]['findAll']({'raw':_0x1cb605[_0xd072('0x1d')]?_0x1cb605[_0xd072('0x1d')][_0xd072('0x1e')]===undefined?!![]:![]:!![],'where':_0x1cb605[_0xd072('0x1d')]?_0x1cb605['options'][_0xd072('0x1f')]||null:null,'attributes':_0x1cb605[_0xd072('0x1d')]?_0x1cb605[_0xd072('0x1d')][_0xd072('0x20')]||null:null,'limit':_0x1cb605[_0xd072('0x1d')]?_0x1cb605[_0xd072('0x1d')]['limit']||null:null,'include':_0x1cb605['options']?_0x1cb605[_0xd072('0x1d')][_0xd072('0x21')]?_['map'](_0x1cb605[_0xd072('0x1d')][_0xd072('0x21')],function(_0x949408){return{'model':db[_0x949408['model']],'as':_0x949408['as'],'attributes':_0x949408[_0xd072('0x20')],'include':_0x949408[_0xd072('0x21')]?_[_0xd072('0x22')](_0x949408['include'],function(_0x47b935){return{'model':db[_0x47b935[_0xd072('0x23')]],'as':_0x47b935['as'],'attributes':_0x47b935[_0xd072('0x20')],'include':_0x47b935['include']?_[_0xd072('0x22')](_0x47b935[_0xd072('0x21')],function(_0x15171d){return{'model':db[_0x15171d[_0xd072('0x23')]],'as':_0x15171d['as'],'attributes':_0x15171d[_0xd072('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39f61b){logger[_0xd072('0x19')]('GetVoiceQueueReport',_0x1cb605);logger[_0xd072('0x13')](_0xd072('0x1b'),_0x1cb605,JSON[_0xd072('0x15')](_0x39f61b));_0x3a8a67(_0x39f61b);})['catch'](function(_0x18e099){logger[_0xd072('0x17')](_0xd072('0x1b'),_0x18e099[_0xd072('0x18')],_0x1cb605);_0x1937ee(_0x1d1caa['error'](0x1f4,_0x18e099['message']));});});};exports[_0xd072('0x24')]=function(_0x3291ae){var _0x398cab=this;return new Promise(function(_0x4295d9,_0xc0afdc){return db['VoiceQueueReport']['create'](_0x3291ae[_0xd072('0x25')],{'raw':_0x3291ae['options']?_0x3291ae[_0xd072('0x1d')][_0xd072('0x1e')]===undefined?!![]:![]:!![]})[_0xd072('0x11')](function(_0x839620){logger[_0xd072('0x19')](_0xd072('0x24'),_0x3291ae);logger[_0xd072('0x13')](_0xd072('0x24'),_0x3291ae,JSON[_0xd072('0x15')](_0x839620));_0x4295d9(_0x839620);})[_0xd072('0x1a')](function(_0xb81151){logger['error']('CreateVoiceQueueReport',_0xb81151['message'],_0x3291ae);_0xc0afdc(_0x398cab[_0xd072('0x17')](0x1f4,_0xb81151[_0xd072('0x18')]));});});};exports[_0xd072('0x26')]=function(_0xda14ec){var _0x3fa086=this;return new Promise(function(_0x167c26,_0x18012d){return db[_0xd072('0x1c')][_0xd072('0x27')](_0xda14ec['body'],{'raw':_0xda14ec[_0xd072('0x1d')]?_0xda14ec[_0xd072('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xda14ec[_0xd072('0x1d')]?_0xda14ec[_0xd072('0x1d')][_0xd072('0x1f')]||null:null,'attributes':_0xda14ec[_0xd072('0x1d')]?_0xda14ec[_0xd072('0x1d')][_0xd072('0x20')]||null:null,'limit':_0xda14ec['options']?_0xda14ec[_0xd072('0x1d')][_0xd072('0x28')]||null:null})[_0xd072('0x11')](function(_0x51f021){logger[_0xd072('0x19')](_0xd072('0x26'),_0xda14ec);logger[_0xd072('0x13')](_0xd072('0x26'),_0xda14ec,JSON[_0xd072('0x15')](_0x51f021));_0x167c26(_0x51f021);})[_0xd072('0x1a')](function(_0x426a1e){logger[_0xd072('0x17')]('UpdateVoiceQueueReport',_0x426a1e[_0xd072('0x18')],_0xda14ec);_0x18012d(_0x3fa086[_0xd072('0x17')](0x1f4,_0x426a1e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e313f55..02743ff 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 _0x27bf=['save','remove','update','emit','removeListener','length','./voiceQueueReport.events'];(function(_0x453156,_0x23583f){var _0x3eb9dc=function(_0x1f090a){while(--_0x1f090a){_0x453156['push'](_0x453156['shift']());}};_0x3eb9dc(++_0x23583f);}(_0x27bf,0x117));var _0xf27b=function(_0x3a6500,_0x37acb2){_0x3a6500=_0x3a6500-0x0;var _0x5a03ea=_0x27bf[_0x3a6500];return _0x5a03ea;};'use strict';var VoiceQueueReportEvents=require(_0xf27b('0x0'));var events=[_0xf27b('0x1'),_0xf27b('0x2'),_0xf27b('0x3')];function createListener(_0x18005f,_0xd157a4){return function(_0x430f3a){_0xd157a4[_0xf27b('0x4')](_0x18005f,_0x430f3a);};}function removeListener(_0x339bb9,_0x1542e3){return function(){VoiceQueueReportEvents[_0xf27b('0x5')](_0x339bb9,_0x1542e3);};}exports['register']=function(_0x1a18b4){for(var _0x39bf1b=0x0,_0x2476ab=events[_0xf27b('0x6')];_0x39bf1b<_0x2476ab;_0x39bf1b++){var _0x1fdc28=events[_0x39bf1b];var _0x36d178=createListener('voiceQueueReport:'+_0x1fdc28,_0x1a18b4);VoiceQueueReportEvents['on'](_0x1fdc28,_0x36d178);}}; \ No newline at end of file +var _0xe157=['emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x4f61a1,_0x35820b){var _0xae8b64=function(_0x4f784c){while(--_0x4f784c){_0x4f61a1['push'](_0x4f61a1['shift']());}};_0xae8b64(++_0x35820b);}(_0xe157,0x13c));var _0x7e15=function(_0x308ed8,_0x385254){_0x308ed8=_0x308ed8-0x0;var _0x21bfc9=_0xe157[_0x308ed8];return _0x21bfc9;};'use strict';var VoiceQueueReportEvents=require(_0x7e15('0x0'));var events=[_0x7e15('0x1'),_0x7e15('0x2'),_0x7e15('0x3')];function createListener(_0x47cf94,_0x4a8e73){return function(_0x5d4a3d){_0x4a8e73[_0x7e15('0x4')](_0x47cf94,_0x5d4a3d);};}function removeListener(_0x1d57f0,_0x1d90ea){return function(){VoiceQueueReportEvents[_0x7e15('0x5')](_0x1d57f0,_0x1d90ea);};}exports[_0x7e15('0x6')]=function(_0x331934){for(var _0x422932=0x0,_0x324e63=events['length'];_0x422932<_0x324e63;_0x422932++){var _0x2bf5e2=events[_0x422932];var _0x3532cb=createListener(_0x7e15('0x7')+_0x2bf5e2,_0x331934);VoiceQueueReportEvents['on'](_0x2bf5e2,_0x3532cb);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index a82e091..7e59909 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 _0xb2ff=['show','post','create','update','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0xb2ff,0x123));var _0xfb2f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2ff[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var path=require('path');var timeout=require(_0xfb2f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb2f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfb2f('0x4'));var controller=require(_0xfb2f('0x5'));router[_0xfb2f('0x6')]('/',auth[_0xfb2f('0x7')](),controller['index']);router['get'](_0xfb2f('0x8'),auth['isAuthenticated'](),controller[_0xfb2f('0x9')]);router[_0xfb2f('0xa')]('/',auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xb')]);router['put'](_0xfb2f('0x8'),auth['isAuthenticated'](),controller[_0xfb2f('0xc')]);router['delete'](_0xfb2f('0x8'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xd')]);module[_0xfb2f('0xe')]=router; \ No newline at end of file +var _0x2feb=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x2944b1,_0x729496){var _0xcabfeb=function(_0x46dd9e){while(--_0x46dd9e){_0x2944b1['push'](_0x2944b1['shift']());}};_0xcabfeb(++_0x729496);}(_0x2feb,0x10c));var _0xb2fe=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x2feb[_0x43b08];return _0x5e05f4;};'use strict';var multer=require(_0xb2fe('0x0'));var util=require('util');var path=require(_0xb2fe('0x1'));var timeout=require(_0xb2fe('0x2'));var express=require(_0xb2fe('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2fe('0x4'));var interaction=require(_0xb2fe('0x5'));var config=require(_0xb2fe('0x6'));var controller=require(_0xb2fe('0x7'));router[_0xb2fe('0x8')]('/',auth[_0xb2fe('0x9')](),controller['index']);router[_0xb2fe('0x8')](_0xb2fe('0xa'),auth[_0xb2fe('0x9')](),controller[_0xb2fe('0xb')]);router[_0xb2fe('0xc')]('/',auth[_0xb2fe('0x9')](),controller[_0xb2fe('0xd')]);router[_0xb2fe('0xe')](_0xb2fe('0xa'),auth[_0xb2fe('0x9')](),controller[_0xb2fe('0xf')]);router[_0xb2fe('0x10')](_0xb2fe('0xa'),auth[_0xb2fe('0x9')](),controller[_0xb2fe('0x11')]);module[_0xb2fe('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 1a18956..2de6b53 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 _0x2687=['moment','exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x18f1bc,_0x49592a){var _0x1b62a6=function(_0x3d411a){while(--_0x3d411a){_0x18f1bc['push'](_0x18f1bc['shift']());}};_0x1b62a6(++_0x49592a);}(_0x2687,0x133));var _0x7268=function(_0x2ea857,_0x466b31){_0x2ea857=_0x2ea857-0x0;var _0x20429a=_0x2687[_0x2ea857];return _0x20429a;};'use strict';var Sequelize=require(_0x7268('0x0'));var moment=require(_0x7268('0x1'));module[_0x7268('0x2')]={'time':{'type':Sequelize[_0x7268('0x3')]},'callid':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7268('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7268('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x7268('0x5')](_0x7268('0x6'))}}; \ No newline at end of file +var _0xf752=['moment','exports','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0xf752,0xdc));var _0x2f75=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf752[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2f75('0x0'));module[_0x2f75('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x2f75('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x2f75('0x3')](_0x2f75('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 9abf9f6..6d323bf 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 _0xac21=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','squel','jsforce','desk.js','../../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','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','query','keys'];(function(_0x3a308b,_0x21ba90){var _0x3dc08e=function(_0x3cd64f){while(--_0x3cd64f){_0x3a308b['push'](_0x3a308b['shift']());}};_0x3dc08e(++_0x21ba90);}(_0xac21,0xed));var _0x1ac2=function(_0x28ef62,_0x3e19bd){_0x28ef62=_0x28ef62-0x0;var _0x14341e=_0xac21[_0x28ef62];return _0x14341e;};'use strict';var emlformat=require(_0x1ac2('0x0'));var rimraf=require(_0x1ac2('0x1'));var zipdir=require(_0x1ac2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ac2('0x3'));var moment=require(_0x1ac2('0x4'));var BPromise=require(_0x1ac2('0x5'));var Mustache=require(_0x1ac2('0x6'));var util=require(_0x1ac2('0x7'));var path=require(_0x1ac2('0x8'));var sox=require(_0x1ac2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1ac2('0xa'));var crypto=require('crypto');var jsforce=require(_0x1ac2('0xb'));var deskjs=require(_0x1ac2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1ac2('0xd'));var qs=require(_0x1ac2('0xe'));var as=require(_0x1ac2('0xf'));var hardwareService=require(_0x1ac2('0x10'));var logger=require(_0x1ac2('0x11'))('api');var utils=require(_0x1ac2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac2('0x13'));var db=require(_0x1ac2('0x14'))['db'];function respondWithStatusCode(_0x207052,_0x403a40){_0x403a40=_0x403a40||0xcc;return function(_0x1aa40e){if(_0x1aa40e){return _0x207052[_0x1ac2('0x15')](_0x403a40);}return _0x207052[_0x1ac2('0x16')](_0x403a40)[_0x1ac2('0x17')]();};}function respondWithResult(_0x4a62fb,_0x168b93){_0x168b93=_0x168b93||0xc8;return function(_0x305fa1){if(_0x305fa1){return _0x4a62fb[_0x1ac2('0x16')](_0x168b93)[_0x1ac2('0x18')](_0x305fa1);}};}function respondWithFilteredResult(_0x55695b,_0x5485f8){return function(_0x337fa5){if(_0x337fa5){var _0x565b1e=typeof _0x5485f8[_0x1ac2('0x19')]===_0x1ac2('0x1a')&&typeof _0x5485f8[_0x1ac2('0x1b')]===_0x1ac2('0x1a');var _0x9123b3=_0x337fa5['count'];var _0xb18cb=_0x565b1e?0x0:_0x5485f8[_0x1ac2('0x19')];var _0x3c404e=_0x565b1e?_0x337fa5[_0x1ac2('0x1c')]:_0x5485f8[_0x1ac2('0x19')]+_0x5485f8[_0x1ac2('0x1b')];var _0x44e6a6;if(_0x3c404e>=_0x9123b3){_0x3c404e=_0x9123b3;_0x44e6a6=0xc8;}else{_0x44e6a6=0xce;}_0x55695b[_0x1ac2('0x16')](_0x44e6a6);return _0x55695b['set'](_0x1ac2('0x1d'),_0xb18cb+'-'+_0x3c404e+'/'+_0x9123b3)[_0x1ac2('0x18')](_0x337fa5);}return null;};}function patchUpdates(_0x725083){return function(_0x234aa7){try{jsonpatch[_0x1ac2('0x1e')](_0x234aa7,_0x725083,!![]);}catch(_0x112091){return BPromise['reject'](_0x112091);}return _0x234aa7[_0x1ac2('0x1f')]();};}function saveUpdates(_0x2b9739,_0xf31751){return function(_0x3e93b7){if(_0x3e93b7){return _0x3e93b7[_0x1ac2('0x20')](_0x2b9739)[_0x1ac2('0x21')](function(_0x4c9b13){return _0x4c9b13;});}return null;};}function removeEntity(_0x543b3e,_0x5b4570){return function(_0xef5302){if(_0xef5302){return _0xef5302[_0x1ac2('0x22')]()['then'](function(){_0x543b3e[_0x1ac2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6e16,_0xfc9841){return function(_0x298938){if(!_0x298938){_0x1e6e16['sendStatus'](0x194);}return _0x298938;};}function handleError(_0xf74551,_0x16f763){_0x16f763=_0x16f763||0x1f4;return function(_0x55fe71){logger[_0x1ac2('0x23')](_0x55fe71[_0x1ac2('0x24')]);if(_0x55fe71['name']){delete _0x55fe71[_0x1ac2('0x25')];}_0xf74551[_0x1ac2('0x16')](_0x16f763)[_0x1ac2('0x26')](_0x55fe71);};}exports[_0x1ac2('0x27')]=function(_0x555473,_0x1dcfed){var _0x2ebc4e={},_0x10d679={},_0x2cc95f={'count':0x0,'rows':[]};var _0x3343d9=_[_0x1ac2('0x28')](db[_0x1ac2('0x29')][_0x1ac2('0x2a')],function(_0x2e5442){return{'name':_0x2e5442['fieldName'],'type':_0x2e5442[_0x1ac2('0x2b')][_0x1ac2('0x2c')]};});_0x10d679['model']=_[_0x1ac2('0x28')](_0x3343d9,_0x1ac2('0x25'));_0x10d679[_0x1ac2('0x2d')]=_[_0x1ac2('0x2e')](_0x555473[_0x1ac2('0x2d')]);_0x10d679[_0x1ac2('0x2f')]=_['intersection'](_0x10d679['model'],_0x10d679['query']);_0x2ebc4e['attributes']=_[_0x1ac2('0x30')](_0x10d679[_0x1ac2('0x31')],qs[_0x1ac2('0x32')](_0x555473['query'][_0x1ac2('0x32')]));_0x2ebc4e['attributes']=_0x2ebc4e[_0x1ac2('0x33')][_0x1ac2('0x34')]?_0x2ebc4e[_0x1ac2('0x33')]:_0x10d679[_0x1ac2('0x31')];if(!_0x555473[_0x1ac2('0x2d')][_0x1ac2('0x35')](_0x1ac2('0x36'))){_0x2ebc4e[_0x1ac2('0x1b')]=qs['limit'](_0x555473['query']['limit']);_0x2ebc4e[_0x1ac2('0x19')]=qs[_0x1ac2('0x19')](_0x555473[_0x1ac2('0x2d')]['offset']);}_0x2ebc4e['order']=qs[_0x1ac2('0x37')](_0x555473[_0x1ac2('0x2d')][_0x1ac2('0x37')]);_0x2ebc4e[_0x1ac2('0x38')]=qs[_0x1ac2('0x2f')](_[_0x1ac2('0x39')](_0x555473[_0x1ac2('0x2d')],_0x10d679[_0x1ac2('0x2f')]),_0x3343d9);if(_0x555473[_0x1ac2('0x2d')][_0x1ac2('0x3a')]){_0x2ebc4e[_0x1ac2('0x38')]=_[_0x1ac2('0x3b')](_0x2ebc4e['where'],{'$or':_[_0x1ac2('0x28')](_0x3343d9,function(_0x280647){if(_0x280647[_0x1ac2('0x2b')]!=='VIRTUAL'){var _0x1e88c9={};_0x1e88c9[_0x280647[_0x1ac2('0x25')]]={'$like':'%'+_0x555473[_0x1ac2('0x2d')][_0x1ac2('0x3a')]+'%'};return _0x1e88c9;}})});}_0x2ebc4e=_[_0x1ac2('0x3b')]({},_0x2ebc4e,_0x555473[_0x1ac2('0x3c')]);var _0x449151={'where':_0x2ebc4e['where']};return db['VoiceQueuesLog']['count'](_0x449151)[_0x1ac2('0x21')](function(_0x29806f){_0x2cc95f['count']=_0x29806f;if(_0x555473[_0x1ac2('0x2d')][_0x1ac2('0x3d')]){_0x2ebc4e['include']=[{'all':!![]}];}return db[_0x1ac2('0x29')][_0x1ac2('0x3e')](_0x2ebc4e);})['then'](function(_0x4fcfbd){_0x2cc95f[_0x1ac2('0x3f')]=_0x4fcfbd;return _0x2cc95f;})['then'](respondWithFilteredResult(_0x1dcfed,_0x2ebc4e))['catch'](handleError(_0x1dcfed,null));};exports[_0x1ac2('0x40')]=function(_0x2e3390,_0x579999){var _0x3e2802={'raw':!![],'where':{'id':_0x2e3390[_0x1ac2('0x41')]['id']}},_0x2be600={};_0x2be600[_0x1ac2('0x31')]=_['keys'](db['VoiceQueuesLog']['rawAttributes']);_0x2be600['query']=_[_0x1ac2('0x2e')](_0x2e3390[_0x1ac2('0x2d')]);_0x2be600[_0x1ac2('0x2f')]=_['intersection'](_0x2be600['model'],_0x2be600[_0x1ac2('0x2d')]);_0x3e2802[_0x1ac2('0x33')]=_[_0x1ac2('0x30')](_0x2be600[_0x1ac2('0x31')],qs[_0x1ac2('0x32')](_0x2e3390[_0x1ac2('0x2d')]['fields']));_0x3e2802[_0x1ac2('0x33')]=_0x3e2802[_0x1ac2('0x33')]['length']?_0x3e2802[_0x1ac2('0x33')]:_0x2be600[_0x1ac2('0x31')];if(_0x2e3390['query'][_0x1ac2('0x3d')]){_0x3e2802[_0x1ac2('0x42')]=[{'all':!![]}];}_0x3e2802=_[_0x1ac2('0x3b')]({},_0x3e2802,_0x2e3390[_0x1ac2('0x3c')]);return db[_0x1ac2('0x29')][_0x1ac2('0x43')](_0x3e2802)[_0x1ac2('0x21')](handleEntityNotFound(_0x579999,null))['then'](respondWithResult(_0x579999,null))[_0x1ac2('0x44')](handleError(_0x579999,null));};exports['create']=function(_0x21c31c,_0x1f3145){return db['VoiceQueuesLog'][_0x1ac2('0x45')](_0x21c31c['body'],{})['then'](respondWithResult(_0x1f3145,0xc9))['catch'](handleError(_0x1f3145,null));};exports[_0x1ac2('0x20')]=function(_0x375353,_0x3f080d){if(_0x375353[_0x1ac2('0x46')]['id']){delete _0x375353[_0x1ac2('0x46')]['id'];}return db[_0x1ac2('0x29')][_0x1ac2('0x43')]({'where':{'id':_0x375353[_0x1ac2('0x41')]['id']}})[_0x1ac2('0x21')](handleEntityNotFound(_0x3f080d,null))[_0x1ac2('0x21')](saveUpdates(_0x375353[_0x1ac2('0x46')],null))[_0x1ac2('0x21')](respondWithResult(_0x3f080d,null))[_0x1ac2('0x44')](handleError(_0x3f080d,null));};exports[_0x1ac2('0x22')]=function(_0x8d7e66,_0x4689ce){return db['VoiceQueuesLog']['find']({'where':{'id':_0x8d7e66[_0x1ac2('0x41')]['id']}})[_0x1ac2('0x21')](handleEntityNotFound(_0x4689ce,null))['then'](removeEntity(_0x4689ce,null))['catch'](handleError(_0x4689ce,null));}; \ No newline at end of file +var _0xcf83=['order','sort','pick','filter','where','merge','type','include','rows','show','params','includeAll','options','VoiceQueuesLog','find','create','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset'];(function(_0x230a82,_0x505225){var _0x64d7fc=function(_0x5ece6d){while(--_0x5ece6d){_0x230a82['push'](_0x230a82['shift']());}};_0x64d7fc(++_0x505225);}(_0xcf83,0x1c8));var _0x3cf8=function(_0x51a6a5,_0x48ec9c){_0x51a6a5=_0x51a6a5-0x0;var _0x30b481=_0xcf83[_0x51a6a5];return _0x30b481;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3cf8('0x0'));var zipdir=require(_0x3cf8('0x1'));var jsonpatch=require(_0x3cf8('0x2'));var rp=require(_0x3cf8('0x3'));var moment=require(_0x3cf8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3cf8('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3cf8('0x6'));var csv=require('to-csv');var ejs=require(_0x3cf8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3cf8('0x8'));var squel=require(_0x3cf8('0x9'));var crypto=require(_0x3cf8('0xa'));var jsforce=require(_0x3cf8('0xb'));var deskjs=require(_0x3cf8('0xc'));var toCsv=require(_0x3cf8('0xd'));var querystring=require(_0x3cf8('0xe'));var Papa=require(_0x3cf8('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3cf8('0x10'));var as=require(_0x3cf8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cf8('0x12'))(_0x3cf8('0x13'));var utils=require(_0x3cf8('0x14'));var config=require(_0x3cf8('0x15'));var licenseUtil=require(_0x3cf8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x179101,_0x2e7c46){_0x2e7c46=_0x2e7c46||0xcc;return function(_0x435e55){if(_0x435e55){return _0x179101['sendStatus'](_0x2e7c46);}return _0x179101[_0x3cf8('0x17')](_0x2e7c46)[_0x3cf8('0x18')]();};}function respondWithResult(_0x363282,_0x2e2844){_0x2e2844=_0x2e2844||0xc8;return function(_0x5cf17f){if(_0x5cf17f){return _0x363282[_0x3cf8('0x17')](_0x2e2844)[_0x3cf8('0x19')](_0x5cf17f);}};}function respondWithFilteredResult(_0x579bdc,_0x1debfd){return function(_0x51ae85){if(_0x51ae85){var _0x25fb70=typeof _0x1debfd['offset']===_0x3cf8('0x1a')&&typeof _0x1debfd[_0x3cf8('0x1b')]===_0x3cf8('0x1a');var _0x106875=_0x51ae85[_0x3cf8('0x1c')];var _0x5d884e=_0x25fb70?0x0:_0x1debfd['offset'];var _0x4a88c4=_0x25fb70?_0x51ae85['count']:_0x1debfd['offset']+_0x1debfd['limit'];var _0x2c2e22;if(_0x4a88c4>=_0x106875){_0x4a88c4=_0x106875;_0x2c2e22=0xc8;}else{_0x2c2e22=0xce;}_0x579bdc['status'](_0x2c2e22);return _0x579bdc[_0x3cf8('0x1d')](_0x3cf8('0x1e'),_0x5d884e+'-'+_0x4a88c4+'/'+_0x106875)[_0x3cf8('0x19')](_0x51ae85);}return null;};}function patchUpdates(_0x480afa){return function(_0x305e20){try{jsonpatch[_0x3cf8('0x1f')](_0x305e20,_0x480afa,!![]);}catch(_0x3ae3ef){return BPromise[_0x3cf8('0x20')](_0x3ae3ef);}return _0x305e20['save']();};}function saveUpdates(_0x3af73,_0x354f99){return function(_0x2acf76){if(_0x2acf76){return _0x2acf76[_0x3cf8('0x21')](_0x3af73)['then'](function(_0x5cb015){return _0x5cb015;});}return null;};}function removeEntity(_0x1467f1,_0x6d24c0){return function(_0x2eb8c7){if(_0x2eb8c7){return _0x2eb8c7[_0x3cf8('0x22')]()[_0x3cf8('0x23')](function(){_0x1467f1[_0x3cf8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42374b,_0x951d95){return function(_0x28e755){if(!_0x28e755){_0x42374b[_0x3cf8('0x24')](0x194);}return _0x28e755;};}function handleError(_0x6d36a5,_0x248b19){_0x248b19=_0x248b19||0x1f4;return function(_0x5dcea4){logger[_0x3cf8('0x25')](_0x5dcea4[_0x3cf8('0x26')]);if(_0x5dcea4['name']){delete _0x5dcea4[_0x3cf8('0x27')];}_0x6d36a5[_0x3cf8('0x17')](_0x248b19)[_0x3cf8('0x28')](_0x5dcea4);};}exports['index']=function(_0x4ec6e2,_0x1f75fb){var _0x511203={},_0x51de2e={},_0x20e739={'count':0x0,'rows':[]};var _0x5b4413=_[_0x3cf8('0x29')](db['VoiceQueuesLog'][_0x3cf8('0x2a')],function(_0x3bd83a){return{'name':_0x3bd83a[_0x3cf8('0x2b')],'type':_0x3bd83a['type']['key']};});_0x51de2e[_0x3cf8('0x2c')]=_[_0x3cf8('0x29')](_0x5b4413,_0x3cf8('0x27'));_0x51de2e[_0x3cf8('0x2d')]=_[_0x3cf8('0x2e')](_0x4ec6e2['query']);_0x51de2e[_0x3cf8('0x2f')]=_[_0x3cf8('0x30')](_0x51de2e[_0x3cf8('0x2c')],_0x51de2e[_0x3cf8('0x2d')]);_0x511203[_0x3cf8('0x31')]=_[_0x3cf8('0x30')](_0x51de2e[_0x3cf8('0x2c')],qs['fields'](_0x4ec6e2[_0x3cf8('0x2d')][_0x3cf8('0x32')]));_0x511203[_0x3cf8('0x31')]=_0x511203['attributes'][_0x3cf8('0x33')]?_0x511203[_0x3cf8('0x31')]:_0x51de2e['model'];if(!_0x4ec6e2[_0x3cf8('0x2d')][_0x3cf8('0x34')](_0x3cf8('0x35'))){_0x511203[_0x3cf8('0x1b')]=qs[_0x3cf8('0x1b')](_0x4ec6e2[_0x3cf8('0x2d')]['limit']);_0x511203[_0x3cf8('0x36')]=qs[_0x3cf8('0x36')](_0x4ec6e2[_0x3cf8('0x2d')][_0x3cf8('0x36')]);}_0x511203[_0x3cf8('0x37')]=qs[_0x3cf8('0x38')](_0x4ec6e2[_0x3cf8('0x2d')][_0x3cf8('0x38')]);_0x511203['where']=qs[_0x3cf8('0x2f')](_[_0x3cf8('0x39')](_0x4ec6e2[_0x3cf8('0x2d')],_0x51de2e[_0x3cf8('0x2f')]),_0x5b4413);if(_0x4ec6e2[_0x3cf8('0x2d')][_0x3cf8('0x3a')]){_0x511203[_0x3cf8('0x3b')]=_[_0x3cf8('0x3c')](_0x511203['where'],{'$or':_['map'](_0x5b4413,function(_0x322813){if(_0x322813[_0x3cf8('0x3d')]!=='VIRTUAL'){var _0x876b55={};_0x876b55[_0x322813['name']]={'$like':'%'+_0x4ec6e2[_0x3cf8('0x2d')][_0x3cf8('0x3a')]+'%'};return _0x876b55;}})});}_0x511203=_['merge']({},_0x511203,_0x4ec6e2['options']);var _0x4e84b7={'where':_0x511203[_0x3cf8('0x3b')]};return db['VoiceQueuesLog']['count'](_0x4e84b7)[_0x3cf8('0x23')](function(_0x515959){_0x20e739[_0x3cf8('0x1c')]=_0x515959;if(_0x4ec6e2[_0x3cf8('0x2d')]['includeAll']){_0x511203[_0x3cf8('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x511203);})[_0x3cf8('0x23')](function(_0x1650fb){_0x20e739[_0x3cf8('0x3f')]=_0x1650fb;return _0x20e739;})[_0x3cf8('0x23')](respondWithFilteredResult(_0x1f75fb,_0x511203))['catch'](handleError(_0x1f75fb,null));};exports[_0x3cf8('0x40')]=function(_0x1fdfb2,_0x11bc0b){var _0x2efd61={'raw':!![],'where':{'id':_0x1fdfb2[_0x3cf8('0x41')]['id']}},_0x3767ad={};_0x3767ad[_0x3cf8('0x2c')]=_[_0x3cf8('0x2e')](db['VoiceQueuesLog'][_0x3cf8('0x2a')]);_0x3767ad[_0x3cf8('0x2d')]=_[_0x3cf8('0x2e')](_0x1fdfb2[_0x3cf8('0x2d')]);_0x3767ad[_0x3cf8('0x2f')]=_[_0x3cf8('0x30')](_0x3767ad[_0x3cf8('0x2c')],_0x3767ad['query']);_0x2efd61['attributes']=_[_0x3cf8('0x30')](_0x3767ad[_0x3cf8('0x2c')],qs[_0x3cf8('0x32')](_0x1fdfb2[_0x3cf8('0x2d')]['fields']));_0x2efd61[_0x3cf8('0x31')]=_0x2efd61['attributes'][_0x3cf8('0x33')]?_0x2efd61[_0x3cf8('0x31')]:_0x3767ad[_0x3cf8('0x2c')];if(_0x1fdfb2[_0x3cf8('0x2d')][_0x3cf8('0x42')]){_0x2efd61[_0x3cf8('0x3e')]=[{'all':!![]}];}_0x2efd61=_[_0x3cf8('0x3c')]({},_0x2efd61,_0x1fdfb2[_0x3cf8('0x43')]);return db[_0x3cf8('0x44')][_0x3cf8('0x45')](_0x2efd61)[_0x3cf8('0x23')](handleEntityNotFound(_0x11bc0b,null))[_0x3cf8('0x23')](respondWithResult(_0x11bc0b,null))['catch'](handleError(_0x11bc0b,null));};exports[_0x3cf8('0x46')]=function(_0x4dea0b,_0x2aaffc){return db[_0x3cf8('0x44')][_0x3cf8('0x46')](_0x4dea0b['body'],{})[_0x3cf8('0x23')](respondWithResult(_0x2aaffc,0xc9))[_0x3cf8('0x47')](handleError(_0x2aaffc,null));};exports[_0x3cf8('0x21')]=function(_0x3ac9ae,_0x4c5362){if(_0x3ac9ae['body']['id']){delete _0x3ac9ae[_0x3cf8('0x48')]['id'];}return db[_0x3cf8('0x44')]['find']({'where':{'id':_0x3ac9ae['params']['id']}})[_0x3cf8('0x23')](handleEntityNotFound(_0x4c5362,null))[_0x3cf8('0x23')](saveUpdates(_0x3ac9ae['body'],null))[_0x3cf8('0x23')](respondWithResult(_0x4c5362,null))[_0x3cf8('0x47')](handleError(_0x4c5362,null));};exports[_0x3cf8('0x22')]=function(_0xd83b5d,_0x4cd423){return db[_0x3cf8('0x44')][_0x3cf8('0x45')]({'where':{'id':_0xd83b5d[_0x3cf8('0x41')]['id']}})[_0x3cf8('0x23')](handleEntityNotFound(_0x4cd423,null))[_0x3cf8('0x23')](removeEntity(_0x4cd423,null))[_0x3cf8('0x47')](handleError(_0x4cd423,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 48340de..2a56460 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 _0x9c64=['event','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','event_dtm'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9c64,0x16a));var _0x49c6=function(_0x2860b5,_0x86910f){_0x2860b5=_0x2860b5-0x0;var _0x2a9113=_0x9c64[_0x2860b5];return _0x2a9113;};'use strict';var _=require('lodash');var util=require(_0x49c6('0x0'));var logger=require(_0x49c6('0x1'))(_0x49c6('0x2'));var moment=require(_0x49c6('0x3'));var BPromise=require(_0x49c6('0x4'));var rp=require(_0x49c6('0x5'));var fs=require('fs');var path=require(_0x49c6('0x6'));var rimraf=require(_0x49c6('0x7'));var config=require(_0x49c6('0x8'));var attributes=require(_0x49c6('0x9'));module[_0x49c6('0xa')]=function(_0x2b7375,_0x26881d){return _0x2b7375[_0x49c6('0xb')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x49c6('0xc'),'fields':[_0x49c6('0xd'),_0x49c6('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf579=['path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','../../config/logger','moment','bluebird'];(function(_0x2dd83b,_0x3a09a1){var _0x4c356c=function(_0x459ae0){while(--_0x459ae0){_0x2dd83b['push'](_0x2dd83b['shift']());}};_0x4c356c(++_0x3a09a1);}(_0xf579,0x1bc));var _0x9f57=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xf579[_0x16d10f];return _0x50c823;};'use strict';var _=require('lodash');var util=require(_0x9f57('0x0'));var logger=require(_0x9f57('0x1'))('api');var moment=require(_0x9f57('0x2'));var BPromise=require(_0x9f57('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f57('0x4'));var rimraf=require(_0x9f57('0x5'));var config=require(_0x9f57('0x6'));var attributes=require(_0x9f57('0x7'));module['exports']=function(_0x43f7d4,_0x4a8c49){return _0x43f7d4[_0x9f57('0x8')](_0x9f57('0x9'),attributes,{'tableName':_0x9f57('0xa'),'paranoid':![],'indexes':[{'name':_0x9f57('0xb'),'fields':[_0x9f57('0xc'),_0x9f57('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 3210607..0325884 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 _0x97f4=['http','then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x64dd28,_0x387502){var _0x571761=function(_0x20c1d2){while(--_0x20c1d2){_0x64dd28['push'](_0x64dd28['shift']());}};_0x571761(++_0x387502);}(_0x97f4,0x166));var _0x497f=function(_0x2d7751,_0x5bbaaf){_0x2d7751=_0x2d7751-0x0;var _0x140fa0=_0x97f4[_0x2d7751];return _0x140fa0;};'use strict';var _=require(_0x497f('0x0'));var util=require(_0x497f('0x1'));var moment=require(_0x497f('0x2'));var BPromise=require(_0x497f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x497f('0x4'));var db=require(_0x497f('0x5'))['db'];var utils=require(_0x497f('0x6'));var logger=require(_0x497f('0x7'))(_0x497f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x497f('0x9')][_0x497f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19b15d,_0x3b23df,_0x134614){return new BPromise(function(_0x1b5224,_0x2e6ad0){return client['request'](_0x19b15d,_0x134614)[_0x497f('0xb')](function(_0x401948){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x3b23df,_0x497f('0xc'));logger[_0x497f('0xd')](_0x497f('0xe'),_0x3b23df,_0x497f('0xc'),JSON[_0x497f('0xf')](_0x401948));if(_0x401948[_0x497f('0x10')]){if(_0x401948[_0x497f('0x10')][_0x497f('0x11')]===0x1f4){logger[_0x497f('0x10')](_0x497f('0x12'),_0x3b23df,_0x401948[_0x497f('0x10')][_0x497f('0x13')]);return _0x2e6ad0(_0x401948['error'][_0x497f('0x13')]);}logger[_0x497f('0x10')](_0x497f('0x12'),_0x3b23df,_0x401948[_0x497f('0x10')]['message']);return _0x1b5224(_0x401948[_0x497f('0x10')][_0x497f('0x13')]);}else{logger[_0x497f('0x14')](_0x497f('0x12'),_0x3b23df,'request\x20sent');_0x1b5224(_0x401948[_0x497f('0x15')][_0x497f('0x13')]);}})[_0x497f('0x16')](function(_0x3b45c6){logger['error'](_0x497f('0x12'),_0x3b23df,_0x3b45c6);_0x2e6ad0(_0x3b45c6);});});} \ No newline at end of file +var _0x0689=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x26e062,_0x16c30a){var _0x31067b=function(_0x673bad){while(--_0x673bad){_0x26e062['push'](_0x26e062['shift']());}};_0x31067b(++_0x16c30a);}(_0x0689,0x10f));var _0x9068=function(_0x1e660a,_0x5bb483){_0x1e660a=_0x1e660a-0x0;var _0x11507b=_0x0689[_0x1e660a];return _0x11507b;};'use strict';var _=require(_0x9068('0x0'));var util=require('util');var moment=require(_0x9068('0x1'));var BPromise=require('bluebird');var rs=require(_0x9068('0x2'));var fs=require('fs');var Redis=require(_0x9068('0x3'));var db=require(_0x9068('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9068('0x5'))('rpc');var config=require(_0x9068('0x6'));var jayson=require(_0x9068('0x7'));var client=jayson[_0x9068('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554a90,_0xea1f21,_0x3a7c67){return new BPromise(function(_0x34e96b,_0x1169e6){return client[_0x9068('0x9')](_0x554a90,_0x3a7c67)[_0x9068('0xa')](function(_0x3ed4ab){logger[_0x9068('0xb')](_0x9068('0xc'),_0xea1f21,_0x9068('0xd'));logger[_0x9068('0xe')](_0x9068('0xf'),_0xea1f21,_0x9068('0xd'),JSON[_0x9068('0x10')](_0x3ed4ab));if(_0x3ed4ab[_0x9068('0x11')]){if(_0x3ed4ab[_0x9068('0x11')]['code']===0x1f4){logger[_0x9068('0x11')](_0x9068('0xc'),_0xea1f21,_0x3ed4ab[_0x9068('0x11')]['message']);return _0x1169e6(_0x3ed4ab['error'][_0x9068('0x12')]);}logger[_0x9068('0x11')](_0x9068('0xc'),_0xea1f21,_0x3ed4ab[_0x9068('0x11')][_0x9068('0x12')]);return _0x34e96b(_0x3ed4ab[_0x9068('0x11')][_0x9068('0x12')]);}else{logger[_0x9068('0xb')](_0x9068('0xc'),_0xea1f21,_0x9068('0xd'));_0x34e96b(_0x3ed4ab['result'][_0x9068('0x12')]);}})[_0x9068('0x13')](function(_0x3f02bb){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0xea1f21,_0x3f02bb);_0x1169e6(_0x3f02bb);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d5bbb89..c3e6655 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 _0x1272=['/:id/downloads','downloads','downloadTranscribe','create','post','/:id/transcribe','put','delete','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','download'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x1272,0x188));var _0x2127=function(_0x5d16fb,_0x4fcc7a){_0x5d16fb=_0x5d16fb-0x0;var _0x8b5e9d=_0x1272[_0x5d16fb];return _0x8b5e9d;};'use strict';var multer=require('multer');var util=require(_0x2127('0x0'));var path=require(_0x2127('0x1'));var timeout=require(_0x2127('0x2'));var express=require(_0x2127('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2127('0x4'));var interaction=require(_0x2127('0x5'));var config=require('../../config/environment');var controller=require(_0x2127('0x6'));router['get']('/',auth[_0x2127('0x7')](),controller[_0x2127('0x8')]);router['get'](_0x2127('0x9'),auth[_0x2127('0x7')](),controller[_0x2127('0xa')]);router[_0x2127('0xb')](_0x2127('0xc'),auth['isAuthenticated'](),controller[_0x2127('0xd')]);router[_0x2127('0xb')](_0x2127('0xe'),auth[_0x2127('0x7')](),controller[_0x2127('0xf')]);router['get'](_0x2127('0x10'),controller[_0x2127('0x11')]);router[_0x2127('0xb')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x2127('0x12')]);router['post']('/',auth[_0x2127('0x7')](),controller[_0x2127('0x13')]);router[_0x2127('0x14')](_0x2127('0x15'),auth[_0x2127('0x7')](),controller['runTranscribe']);router[_0x2127('0x16')](_0x2127('0xc'),auth[_0x2127('0x7')](),controller['update']);router[_0x2127('0x17')](_0x2127('0xc'),auth[_0x2127('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5ef9=['downloadTranscribe','post','create','runTranscribe','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/download','download','downloads','/:id/transcribe'];(function(_0x53ef36,_0x3ca663){var _0x1546e9=function(_0x5ca783){while(--_0x5ca783){_0x53ef36['push'](_0x53ef36['shift']());}};_0x1546e9(++_0x3ca663);}(_0x5ef9,0x198));var _0x95ef=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x5ef9[_0x4063a4];return _0x17908d;};'use strict';var multer=require(_0x95ef('0x0'));var util=require(_0x95ef('0x1'));var path=require(_0x95ef('0x2'));var timeout=require(_0x95ef('0x3'));var express=require(_0x95ef('0x4'));var router=express[_0x95ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x95ef('0x6'));var interaction=require(_0x95ef('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x95ef('0x8')]('/',auth[_0x95ef('0x9')](),controller[_0x95ef('0xa')]);router[_0x95ef('0x8')]('/describe',auth[_0x95ef('0x9')](),controller[_0x95ef('0xb')]);router[_0x95ef('0x8')](_0x95ef('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x95ef('0x8')](_0x95ef('0xd'),auth[_0x95ef('0x9')](),controller[_0x95ef('0xe')]);router['get']('/:id/downloads',controller[_0x95ef('0xf')]);router[_0x95ef('0x8')](_0x95ef('0x10'),auth[_0x95ef('0x9')](),controller[_0x95ef('0x11')]);router[_0x95ef('0x12')]('/',auth['isAuthenticated'](),controller[_0x95ef('0x13')]);router[_0x95ef('0x12')](_0x95ef('0x10'),auth[_0x95ef('0x9')](),controller[_0x95ef('0x14')]);router[_0x95ef('0x15')]('/:id',auth[_0x95ef('0x9')](),controller[_0x95ef('0x16')]);router['delete'](_0x95ef('0xc'),auth[_0x95ef('0x9')](),controller[_0x95ef('0x17')]);module[_0x95ef('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a2c8f05..f510431 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(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 7161500..aff1394 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 _0x9dc2=['name','map','VoiceRecording','rawAttributes','fieldName','type','differenceBy','format','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','params','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','recording','filename','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','zip-dir','request-promise','moment','bluebird','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','error'];(function(_0x4e288a,_0x2f8c90){var _0x168cb2=function(_0x72cd52){while(--_0x72cd52){_0x4e288a['push'](_0x4e288a['shift']());}};_0x168cb2(++_0x2f8c90);}(_0x9dc2,0x100));var _0x29dc=function(_0x26c003,_0xa9c7e2){_0x26c003=_0x26c003-0x0;var _0x11f343=_0x9dc2[_0x26c003];return _0x11f343;};'use strict';var emlformat=require(_0x29dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29dc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29dc('0x2'));var moment=require(_0x29dc('0x3'));var BPromise=require(_0x29dc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x29dc('0x5'));var ejs=require(_0x29dc('0x6'));var fs=require('fs');var fs_extra=require(_0x29dc('0x7'));var _=require('lodash');var squel=require(_0x29dc('0x8'));var crypto=require('crypto');var jsforce=require(_0x29dc('0x9'));var deskjs=require(_0x29dc('0xa'));var toCsv=require(_0x29dc('0x5'));var querystring=require(_0x29dc('0xb'));var Papa=require(_0x29dc('0xc'));var AWS=require(_0x29dc('0xd'));var uuidv4=require('uuid/v4');var Redis=require(_0x29dc('0xe'));var authService=require(_0x29dc('0xf'));var qs=require(_0x29dc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29dc('0x11'));var logger=require('../../config/logger')(_0x29dc('0x12'));var utils=require('../../config/utils');var config=require(_0x29dc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x29dc('0x14'))['db'];function respondWithStatusCode(_0x433a1d,_0x32f898){_0x32f898=_0x32f898||0xcc;return function(_0x52ba2e){if(_0x52ba2e){return _0x433a1d[_0x29dc('0x15')](_0x32f898);}return _0x433a1d[_0x29dc('0x16')](_0x32f898)['end']();};}function respondWithResult(_0x3b79f8,_0x5b7e8b){_0x5b7e8b=_0x5b7e8b||0xc8;return function(_0xd0d1c1){if(_0xd0d1c1){return _0x3b79f8[_0x29dc('0x16')](_0x5b7e8b)[_0x29dc('0x17')](_0xd0d1c1);}};}function respondWithFilteredResult(_0xe38473,_0x124588){return function(_0x2f5921){if(_0x2f5921){var _0x4cf01a=typeof _0x124588[_0x29dc('0x18')]===_0x29dc('0x19')&&typeof _0x124588[_0x29dc('0x1a')]==='undefined';var _0xd02493=_0x2f5921[_0x29dc('0x1b')];var _0x51e9f2=_0x4cf01a?0x0:_0x124588[_0x29dc('0x18')];var _0x29e77e=_0x4cf01a?_0x2f5921['count']:_0x124588['offset']+_0x124588['limit'];var _0x532be3;if(_0x29e77e>=_0xd02493){_0x29e77e=_0xd02493;_0x532be3=0xc8;}else{_0x532be3=0xce;}_0xe38473[_0x29dc('0x16')](_0x532be3);return _0xe38473[_0x29dc('0x1c')]('Content-Range',_0x51e9f2+'-'+_0x29e77e+'/'+_0xd02493)[_0x29dc('0x17')](_0x2f5921);}return null;};}function patchUpdates(_0x1db138){return function(_0x1d0384){try{jsonpatch[_0x29dc('0x1d')](_0x1d0384,_0x1db138,!![]);}catch(_0x46bc9f){return BPromise[_0x29dc('0x1e')](_0x46bc9f);}return _0x1d0384[_0x29dc('0x1f')]();};}function saveUpdates(_0x1304a8,_0x2a8635){return function(_0x48d11d){if(_0x48d11d){return _0x48d11d[_0x29dc('0x20')](_0x1304a8)['then'](function(_0x567c92){return _0x567c92;});}return null;};}function removeEntity(_0x4389d0,_0x54d7b8){return function(_0x3bd38c){if(_0x3bd38c){return _0x3bd38c[_0x29dc('0x21')]()['then'](function(){_0x4389d0['status'](0xcc)[_0x29dc('0x22')]();});}};}function handleEntityNotFound(_0xfe3044,_0x56c33a){return function(_0x519810){if(!_0x519810){_0xfe3044['sendStatus'](0x194);}return _0x519810;};}function handleError(_0x2eb3aa,_0x1712c6){_0x1712c6=_0x1712c6||0x1f4;return function(_0x5c118f){logger[_0x29dc('0x23')](_0x5c118f['stack']);if(_0x5c118f['name']){delete _0x5c118f[_0x29dc('0x24')];}_0x2eb3aa[_0x29dc('0x16')](_0x1712c6)['send'](_0x5c118f);};}exports['index']=function(_0x3edea1,_0x2d7d96){var _0x5f3bb6={},_0x16ef76={},_0xa92e5={'count':0x0,'rows':[]};var _0x57895b=_[_0x29dc('0x25')](db[_0x29dc('0x26')][_0x29dc('0x27')],function(_0x326975){return{'name':_0x326975[_0x29dc('0x28')],'type':_0x326975[_0x29dc('0x29')]['key']};});_0x16ef76['model']=_[_0x29dc('0x2a')](_[_0x29dc('0x25')](_0x57895b,_0x29dc('0x24')),[_0x29dc('0x2b')]);_0x16ef76[_0x29dc('0x2c')]=_[_0x29dc('0x2d')](_0x3edea1[_0x29dc('0x2c')]);_0x16ef76['filters']=_[_0x29dc('0x2e')](_0x16ef76[_0x29dc('0x2f')],_0x16ef76[_0x29dc('0x2c')]);_0x5f3bb6['attributes']=_[_0x29dc('0x2e')](_0x16ef76[_0x29dc('0x2f')],qs[_0x29dc('0x30')](_0x3edea1[_0x29dc('0x2c')][_0x29dc('0x30')]));_0x5f3bb6[_0x29dc('0x31')]=_0x5f3bb6['attributes'][_0x29dc('0x32')]?_0x5f3bb6[_0x29dc('0x31')]:_0x16ef76[_0x29dc('0x2f')];if(!_0x3edea1[_0x29dc('0x2c')][_0x29dc('0x33')](_0x29dc('0x34'))){_0x5f3bb6[_0x29dc('0x1a')]=qs['limit'](_0x3edea1['query'][_0x29dc('0x1a')]);_0x5f3bb6[_0x29dc('0x18')]=qs['offset'](_0x3edea1['query'][_0x29dc('0x18')]);}_0x5f3bb6[_0x29dc('0x35')]=qs[_0x29dc('0x36')](_0x3edea1[_0x29dc('0x2c')][_0x29dc('0x36')]);_0x5f3bb6['where']=qs[_0x29dc('0x37')](_[_0x29dc('0x38')](_0x3edea1['query'],_0x16ef76[_0x29dc('0x37')]),_0x57895b);if(_0x3edea1[_0x29dc('0x2c')][_0x29dc('0x39')]){_0x5f3bb6[_0x29dc('0x3a')]=_[_0x29dc('0x3b')](_0x5f3bb6[_0x29dc('0x3a')],{'$or':_[_0x29dc('0x25')](_0x57895b,function(_0x2ba422){if(_0x2ba422['type']!==_0x29dc('0x3c')){var _0x40d8b5={};_0x40d8b5[_0x2ba422['name']]={'$like':'%'+_0x3edea1[_0x29dc('0x2c')]['filter']+'%'};return _0x40d8b5;}})});}_0x5f3bb6=_['merge']({},_0x5f3bb6,_0x3edea1[_0x29dc('0x3d')]);var _0x415d0f={'where':_0x5f3bb6[_0x29dc('0x3a')]};return db[_0x29dc('0x26')][_0x29dc('0x1b')](_0x415d0f)[_0x29dc('0x3e')](function(_0x273110){_0xa92e5['count']=_0x273110;if(_0x3edea1['query'][_0x29dc('0x3f')]){_0x5f3bb6[_0x29dc('0x40')]=[{'all':!![]}];}return db[_0x29dc('0x26')][_0x29dc('0x41')](_0x5f3bb6);})['then'](function(_0x52ec08){_0xa92e5['rows']=_0x52ec08;return _0xa92e5;})[_0x29dc('0x3e')](respondWithFilteredResult(_0x2d7d96,_0x5f3bb6))[_0x29dc('0x42')](handleError(_0x2d7d96,null));};exports['show']=function(_0x4f5a84,_0x14ae76){var _0x41c4f8={'raw':![],'where':{'id':_0x4f5a84[_0x29dc('0x43')]['id']}},_0x4c31f7={};_0x4c31f7[_0x29dc('0x2f')]=_[_0x29dc('0x2d')](db[_0x29dc('0x26')][_0x29dc('0x27')]);_0x4c31f7['query']=_[_0x29dc('0x2d')](_0x4f5a84[_0x29dc('0x2c')]);_0x4c31f7[_0x29dc('0x37')]=_[_0x29dc('0x2e')](_0x4c31f7[_0x29dc('0x2f')],_0x4c31f7['query']);_0x41c4f8['attributes']=_[_0x29dc('0x2e')](_0x4c31f7[_0x29dc('0x2f')],qs[_0x29dc('0x30')](_0x4f5a84[_0x29dc('0x2c')][_0x29dc('0x30')]));_0x41c4f8[_0x29dc('0x31')]=_0x41c4f8[_0x29dc('0x31')][_0x29dc('0x32')]?_0x41c4f8['attributes']:_0x4c31f7[_0x29dc('0x2f')];if(_0x4f5a84[_0x29dc('0x2c')][_0x29dc('0x3f')]){_0x41c4f8[_0x29dc('0x40')]=[{'all':!![]}];}_0x41c4f8=_[_0x29dc('0x3b')]({},_0x41c4f8,_0x4f5a84[_0x29dc('0x3d')]);return db[_0x29dc('0x26')]['find'](_0x41c4f8)['then'](handleEntityNotFound(_0x14ae76,null))[_0x29dc('0x3e')](respondWithResult(_0x14ae76,null))[_0x29dc('0x42')](handleError(_0x14ae76,null));};exports[_0x29dc('0x44')]=function(_0x549eeb,_0x2ecc33){return db[_0x29dc('0x26')][_0x29dc('0x44')](_0x549eeb['body'],{})['then'](respondWithResult(_0x2ecc33,0xc9))[_0x29dc('0x42')](handleError(_0x2ecc33,null));};exports[_0x29dc('0x20')]=function(_0x48b958,_0x360d52){if(_0x48b958[_0x29dc('0x45')]['id']){delete _0x48b958[_0x29dc('0x45')]['id'];}return db[_0x29dc('0x26')][_0x29dc('0x46')]({'where':{'id':_0x48b958[_0x29dc('0x43')]['id']}})[_0x29dc('0x3e')](handleEntityNotFound(_0x360d52,null))['then'](saveUpdates(_0x48b958['body'],null))[_0x29dc('0x3e')](respondWithResult(_0x360d52,null))[_0x29dc('0x42')](handleError(_0x360d52,null));};exports[_0x29dc('0x47')]=function(_0x5b99a2,_0x911ad2){return db['VoiceRecording'][_0x29dc('0x47')]()[_0x29dc('0x3e')](respondWithResult(_0x911ad2,null))[_0x29dc('0x42')](handleError(_0x911ad2,null));};exports[_0x29dc('0x48')]=function(_0x90623e,_0xdc8f2b,_0x537e61){var _0xf16875=require(_0x29dc('0x49'));var _0x38d7ad=![];var _0x256705={};if(_0x90623e['query'][_0x29dc('0x29')]&&_0x90623e['query'][_0x29dc('0x29')]===_0x29dc('0x4a')){_0x256705[_0x29dc('0x4a')]=_0x90623e[_0x29dc('0x43')]['id'];}else{_0x256705['id']=_0x90623e[_0x29dc('0x43')]['id'];}return db[_0x29dc('0x26')][_0x29dc('0x46')]({'where':_0x256705,'attributes':['id',_0x29dc('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0xdc8f2b,null))['then'](function(_0x31dc8e){if(_0x31dc8e){var _0x497c5d=_0x31dc8e[_0x29dc('0x4b')];var _0x170a02=util[_0x29dc('0x2b')](_0x29dc('0x4c'),_0x497c5d);if(fs[_0x29dc('0x4d')](_0x170a02)){_0x38d7ad=!![];return _0xf16875[_0x29dc('0x4e')](_0x170a02,_0x497c5d,config[_0x29dc('0x4f')]['recording'])[_0x29dc('0x3e')](function(){return _0x31dc8e;});}return _0x31dc8e;}})[_0x29dc('0x3e')](function(_0x4cc419){if(_0x4cc419){var _0xe5a854=_0x4cc419['value'];if(!fs['existsSync'](_0xe5a854)){throw new db[(_0x29dc('0x50'))][(_0x29dc('0x51'))](_0x29dc('0x52'));}if(_0x4cc419['filename']){return _0xdc8f2b[_0x29dc('0x48')](_0xe5a854,_0x4cc419['filename']+path[_0x29dc('0x53')](_0xe5a854),function(){if(_0x38d7ad){fs[_0x29dc('0x54')](_0xe5a854);}});}else{return _0xdc8f2b[_0x29dc('0x48')](_0xe5a854,function(_0x121d10){if(_0x38d7ad){fs[_0x29dc('0x54')](_0xe5a854);}});}}})[_0x29dc('0x42')](function(_0x4ff0a0){if(_0x4ff0a0[_0x29dc('0x55')]===_0x29dc('0x52')){_0xdc8f2b['status'](0x194)[_0x29dc('0x56')](_0x29dc('0x57'));}else{return handleError(_0xdc8f2b,null);}});};exports[_0x29dc('0x58')]=function(_0x27535e,_0x39609c,_0x225f82){var _0x553bf1=require(_0x29dc('0x49'));var _0x2ffdee=![];var _0x1c951c={'$and':[db[_0x29dc('0x59')][_0x29dc('0x3a')](db[_0x29dc('0x59')]['fn'](_0x29dc('0x5a'),db[_0x29dc('0x59')][_0x29dc('0x5b')](_0x29dc('0x4a'))),_0x27535e['query'][_0x29dc('0x5c')])]};if(_0x27535e[_0x29dc('0x2c')][_0x29dc('0x29')]&&_0x27535e['query'][_0x29dc('0x29')]===_0x29dc('0x4a')){_0x1c951c['$and'][_0x29dc('0x5d')]({'uniqueid':_0x27535e[_0x29dc('0x43')]['id']});}else{_0x1c951c[_0x29dc('0x5e')]['push']({'id':_0x27535e[_0x29dc('0x43')]['id']});}return db[_0x29dc('0x26')]['find']({'where':_0x1c951c,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x39609c,null))[_0x29dc('0x3e')](function(_0x54cde0){if(_0x54cde0){var _0x332dab=util[_0x29dc('0x2b')](_0x29dc('0x4c'),_0x54cde0[_0x29dc('0x4b')]);if(fs[_0x29dc('0x4d')](_0x332dab)){_0x2ffdee=!![];return _0x553bf1[_0x29dc('0x4e')](_0x332dab,_0x54cde0[_0x29dc('0x4b')],config['secrets'][_0x29dc('0x5f')])[_0x29dc('0x3e')](function(){return _0x54cde0;});}return _0x54cde0;}})[_0x29dc('0x3e')](function(_0x817bfc){if(_0x817bfc){if(!fs[_0x29dc('0x4d')](_0x817bfc[_0x29dc('0x4b')])){throw new db[(_0x29dc('0x50'))][(_0x29dc('0x51'))](_0x29dc('0x52'));}if(_0x817bfc[_0x29dc('0x60')]){return _0x39609c['download'](_0x817bfc['value'],_0x817bfc['filename']+path['extname'](_0x817bfc[_0x29dc('0x4b')]),function(){if(_0x2ffdee){fs[_0x29dc('0x54')](_0x817bfc[_0x29dc('0x4b')]);}});}else{return _0x39609c[_0x29dc('0x48')](_0x817bfc[_0x29dc('0x4b')],function(_0x4d7ba5){if(_0x2ffdee){fs[_0x29dc('0x54')](_0x817bfc['value']);}});}}})[_0x29dc('0x42')](handleError(_0x39609c,null));};exports['destroy']=function(_0x479c73,_0x41cf99){return db[_0x29dc('0x26')][_0x29dc('0x46')]({'where':{'id':_0x479c73[_0x29dc('0x43')]['id']}})[_0x29dc('0x3e')](function(_0x233788){if(_[_0x29dc('0x61')](_0x233788)){throw new ReferenceError(_0x29dc('0x62'));}return _0x233788;})['then'](function(_0xc6308d){var _0x26147e=_0xc6308d[_0x29dc('0x4b')];logger[_0x29dc('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x26147e);if(!_[_0x29dc('0x61')](_0xc6308d[_0x29dc('0x4b')])&&fs[_0x29dc('0x4d')](_0x26147e)){logger[_0x29dc('0x63')](_0x29dc('0x64')+_0x26147e+_0x29dc('0x65'));fs['unlinkSync'](_0x26147e);}_0x26147e=_0x26147e+_0x29dc('0x66');if(!_[_0x29dc('0x61')](_0xc6308d[_0x29dc('0x4b')])&&fs[_0x29dc('0x4d')](_0x26147e)){logger[_0x29dc('0x63')](_0x29dc('0x64')+_0x26147e+_0x29dc('0x65'));fs['unlinkSync'](_0x26147e);}return _0xc6308d;})['then'](function(_0x400da7){if(!_0x400da7)throw new InternalError();return _0x400da7[_0x29dc('0x21')]();})['then'](function(){_0x41cf99[_0x29dc('0x16')](0xcc)[_0x29dc('0x22')]();})[_0x29dc('0x42')](handleError(_0x41cf99,null));};function getBucketslist(_0x100c95,_0x38a3a4,_0x448948){return new Promise(function(_0x391922,_0x195e7c){var _0x223f4c=new AWS['S3']({'accessKeyId':_0x38a3a4,'secretAccessKey':_0x100c95,'region':_0x448948});_0x223f4c['listBuckets']({},function(_0x44f7eb,_0x2e31a0){if(_0x44f7eb){return _0x195e7c(_0x44f7eb);}else{return _0x391922(_0x2e31a0);}});});}function createBucket(_0x3093ab,_0x5e6294,_0x2f9165,_0x16b378){return new Promise(function(_0x20f741,_0x5629d5){var _0x33362d=new AWS['S3']({'accessKeyId':_0x5e6294,'secretAccessKey':_0x3093ab,'region':_0x2f9165});_0x33362d[_0x29dc('0x67')]({'Bucket':_0x16b378},function(_0x20be5f,_0x5bb7d3){if(_0x20be5f){return _0x5629d5(_0x20be5f);}else{return _0x20f741(_0x5bb7d3);}});});}function uploadFile(_0x1faec4,_0x463963,_0x5a4433,_0x344bf7,_0x5c6065,_0x3fc161){return new Promise(function(_0x4b8375,_0x2b5544){var _0x2873bc=new AWS['S3']({'accessKeyId':_0x463963,'secretAccessKey':_0x1faec4,'region':_0x5a4433});_0x2873bc[_0x29dc('0x68')]({'Bucket':_0x344bf7,'Key':_0x5c6065,'Body':_0x3fc161},function(_0x5ade6f,_0x3a8bfe){if(_0x5ade6f){return _0x2b5544(_0x5ade6f);}else{return _0x4b8375(_0x3a8bfe);}});});}function startTranscribe(_0x43ffd2,_0x3a38c8,_0x4d8391,_0x596c5c,_0x513a20,_0x503453){return new Promise(function(_0xf298db,_0x34b15c){var _0x334028=new AWS[(_0x29dc('0x69'))]({'accessKeyId':_0x3a38c8,'secretAccessKey':_0x43ffd2,'region':_0x4d8391});_0x334028[_0x29dc('0x6a')]({'TranscriptionJobName':_0x596c5c,'LanguageCode':_0x513a20,'Media':{'MediaFileUri':_0x503453}},function(_0x29e0e8,_0x433650){if(_0x29e0e8){return _0x34b15c(_0x29e0e8);}else{return _0xf298db(_0x433650);}});});}function transcribe(_0x112f22,_0x1d6dba,_0x49e6fa,_0x5b55f4,_0x527df8,_0x3086e6,_0x625eea){return new Promise(function(_0x51eddd,_0x16e874){var _0x3c2639={};logger[_0x29dc('0x63')](util[_0x29dc('0x2b')](_0x29dc('0x6b'),_0x112f22,_0x527df8));return uploadFile(_0x1d6dba,_0x49e6fa,_0x5b55f4,_0x527df8,path[_0x29dc('0x6c')](_0x3086e6),fs[_0x29dc('0x6d')](_0x3086e6))[_0x29dc('0x3e')](function(_0x24ff59){logger['info'](util[_0x29dc('0x2b')](_0x29dc('0x6e'),_0x112f22,_0x527df8,_0x24ff59[_0x29dc('0x6f')]));_0x3c2639[_0x29dc('0x70')]=_0x24ff59['Bucket'];_0x3c2639['location']=_0x24ff59['Location'];logger[_0x29dc('0x63')](util[_0x29dc('0x2b')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x112f22));return startTranscribe(_0x1d6dba,_0x49e6fa,_0x5b55f4,uuidv4(),_0x625eea,_0x24ff59[_0x29dc('0x6f')]);})[_0x29dc('0x3e')](function(_0x24be40){logger['info'](util[_0x29dc('0x2b')](_0x29dc('0x71'),_0x112f22,_0x24be40[_0x29dc('0x72')][_0x29dc('0x73')]));_0x3c2639[_0x29dc('0x74')]=_0x24be40['TranscriptionJob'][_0x29dc('0x73')];_0x3c2639['transcribeStatus']=_0x24be40[_0x29dc('0x72')][_0x29dc('0x75')];return _0x51eddd(_0x3c2639);})['catch'](function(_0x3ca693){return _0x16e874(_0x3ca693);});});}exports[_0x29dc('0x76')]=function(_0x31509b,_0x22acab,_0x439229){var _0x4d8bbc;var _0x24c84e;var _0x24c925;var _0x5b5d93=require(_0x29dc('0x49'));return db[_0x29dc('0x26')][_0x29dc('0x77')]({'where':{'id':_0x31509b[_0x29dc('0x43')]['id']}})[_0x29dc('0x3e')](function(_0x2c81e9){if(_0x2c81e9){var _0x1d152b=util[_0x29dc('0x2b')]('%s.cypher',_0x2c81e9[_0x29dc('0x4b')]);if(fs[_0x29dc('0x4d')](_0x1d152b)){cypher=!![];return _0x5b5d93[_0x29dc('0x4e')](_0x1d152b,_0x2c81e9[_0x29dc('0x4b')],config[_0x29dc('0x4f')][_0x29dc('0x5f')])[_0x29dc('0x3e')](function(){return _0x2c81e9;});}return _0x2c81e9;}})[_0x29dc('0x3e')](function(_0x21b793){if(!_0x21b793){throw new db[(_0x29dc('0x50'))][(_0x29dc('0x51'))]('Voice\x20Recording\x20not\x20found');}_0x24c84e=_0x21b793;return db[_0x29dc('0x78')][_0x29dc('0x77')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x22acab,null))[_0x29dc('0x3e')](function(_0x41c10c){if(_0x41c10c){_0x4d8bbc=_0x41c10c;if(!_0x4d8bbc[_0x29dc('0x79')]||!_0x4d8bbc[_0x29dc('0x7a')]||!_0x4d8bbc[_0x29dc('0x7b')]||!_0x4d8bbc[_0x29dc('0x7c')]||!_0x4d8bbc[_0x29dc('0x70')]){throw new db[(_0x29dc('0x50'))][(_0x29dc('0x51'))](_0x29dc('0x7d'));}if(_0x31509b[_0x29dc('0x45')]['runSentiment']&&(!_0x4d8bbc[_0x29dc('0x7e')]||!_0x4d8bbc[_0x29dc('0x7f')]||!_0x4d8bbc[_0x29dc('0x80')]||!_0x4d8bbc[_0x29dc('0x7c')]||!_0x4d8bbc[_0x29dc('0x70')])){throw new db[(_0x29dc('0x50'))][(_0x29dc('0x51'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x29dc('0x81')][_0x29dc('0x77')]({'where':{'id':_0x4d8bbc['transcribeAccountId']}});}})['then'](function(_0x4a2903){if(!_0x4a2903){throw new db[(_0x29dc('0x50'))][(_0x29dc('0x51'))](_0x29dc('0x82'));}if(!_0x4a2903['data1']||!_0x4a2903['data2']){throw new db['Sequelize']['ValidationError'](_0x29dc('0x83'));}_0x24c925=_0x4a2903;return getBucketslist(_0x24c925[_0x29dc('0x84')],_0x24c925[_0x29dc('0x85')],_0x4d8bbc[_0x29dc('0x7b')]);})[_0x29dc('0x3e')](function(_0x16482d){if(_0x16482d&&_0x16482d['Buckets']){var _0x3229ee=_['find'](_0x16482d['Buckets'],function(_0x544064){return _0x544064['Name']===_0x4d8bbc[_0x29dc('0x70')];});if(!_0x3229ee){logger[_0x29dc('0x63')](util[_0x29dc('0x2b')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x31509b[_0x29dc('0x43')]['id'],_0x4d8bbc[_0x29dc('0x70')]));return createBucket(_0x24c925[_0x29dc('0x84')],_0x24c925[_0x29dc('0x85')],_0x4d8bbc[_0x29dc('0x7b')],_0x4d8bbc['bucket']);}logger[_0x29dc('0x63')](util['format'](_0x29dc('0x86'),_0x31509b['params']['id'],_0x4d8bbc['bucket']));return;}})[_0x29dc('0x3e')](function(_0x3ff8d4){if(_0x24c84e[_0x29dc('0x87')]===_0x29dc('0x88')){return transcribe(_0x31509b['params']['id'],_0x24c925[_0x29dc('0x84')],_0x24c925[_0x29dc('0x85')],_0x4d8bbc[_0x29dc('0x7b')],_0x4d8bbc[_0x29dc('0x70')],_0x24c84e[_0x29dc('0x4b')],_0x4d8bbc[_0x29dc('0x7c')]);}else{logger[_0x29dc('0x63')](util[_0x29dc('0x2b')](_0x29dc('0x89'),_0x31509b[_0x29dc('0x43')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x612144){if(_0x612144){_0x612144[_0x29dc('0x8a')]=_0x31509b[_0x29dc('0x45')][_0x29dc('0x8b')];return _0x24c84e[_0x29dc('0x8c')](_0x612144);}})[_0x29dc('0x3e')](respondWithResult(_0x22acab,null))['catch'](handleError(_0x22acab,null));};function writeFile(_0x38510a,_0x4e27b6){return new Promise(function(_0x26d613,_0x1da6a6){fs['writeFile'](_0x4e27b6,_0x38510a,function(_0x1bb5e0,_0x4ba613){if(_0x1bb5e0){return _0x1da6a6(_0x1bb5e0);}else{return _0x26d613(_0x4ba613);}});});}exports[_0x29dc('0x8d')]=function(_0x5ee1ba,_0x4a88cc,_0x1b013f){return db[_0x29dc('0x26')]['findOne']({'where':{'id':_0x5ee1ba[_0x29dc('0x43')]['id']}})['then'](handleEntityNotFound(_0x4a88cc))[_0x29dc('0x3e')](function(_0x1769cf){if(_0x1769cf&&_0x1769cf[_0x29dc('0x8e')]){var _0x330fb1=_0x1769cf['fileText'];var _0x72d45b=config[_0x29dc('0x8f')]+_0x29dc('0x90')+_0x1769cf['id']+_0x29dc('0x91');if(fs[_0x29dc('0x4d')](_0x72d45b)){return _0x72d45b;}return writeFile(_0x330fb1,_0x72d45b)[_0x29dc('0x3e')](function(){return _0x72d45b;});}else{throw new db[(_0x29dc('0x50'))][(_0x29dc('0x51'))]('Transcript\x20not\x20available');}})[_0x29dc('0x3e')](function(_0x429f49){return _0x4a88cc['download'](_0x429f49);})['catch'](handleError(_0x4a88cc));}; \ No newline at end of file +var _0x13da=['[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','transcribe','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','data2','Cloud\x20Provider\x20not\x20configured','data1','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','stack','index','map','VoiceRecording','rawAttributes','key','model','differenceBy','name','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','type','filter','options','includeAll','include','rows','catch','show','params','merge','find','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','send','downloads','sequelize','MD5','col','$and','push','%s.cypher','recording','ValidationError','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','.cypher','listBuckets','createBucket','upload'];(function(_0x1daafa,_0x5562d5){var _0x421f30=function(_0x348eea){while(--_0x348eea){_0x1daafa['push'](_0x1daafa['shift']());}};_0x421f30(++_0x5562d5);}(_0x13da,0x1e2));var _0xa13d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x13da[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xa13d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa13d('0x1'));var jsonpatch=require(_0xa13d('0x2'));var rp=require(_0xa13d('0x3'));var moment=require(_0xa13d('0x4'));var BPromise=require(_0xa13d('0x5'));var Mustache=require(_0xa13d('0x6'));var util=require(_0xa13d('0x7'));var path=require(_0xa13d('0x8'));var sox=require(_0xa13d('0x9'));var csv=require('to-csv');var ejs=require(_0xa13d('0xa'));var fs=require('fs');var fs_extra=require(_0xa13d('0xb'));var _=require(_0xa13d('0xc'));var squel=require(_0xa13d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa13d('0xe'));var toCsv=require(_0xa13d('0xf'));var querystring=require(_0xa13d('0x10'));var Papa=require(_0xa13d('0x11'));var AWS=require(_0xa13d('0x12'));var uuidv4=require(_0xa13d('0x13'));var Redis=require('ioredis');var authService=require(_0xa13d('0x14'));var qs=require(_0xa13d('0x15'));var as=require(_0xa13d('0x16'));var hardwareService=require(_0xa13d('0x17'));var logger=require(_0xa13d('0x18'))(_0xa13d('0x19'));var utils=require(_0xa13d('0x1a'));var config=require(_0xa13d('0x1b'));var licenseUtil=require(_0xa13d('0x1c'));var db=require(_0xa13d('0x1d'))['db'];function respondWithStatusCode(_0x307148,_0x31b97f){_0x31b97f=_0x31b97f||0xcc;return function(_0x3d1ea1){if(_0x3d1ea1){return _0x307148[_0xa13d('0x1e')](_0x31b97f);}return _0x307148['status'](_0x31b97f)[_0xa13d('0x1f')]();};}function respondWithResult(_0x4874a7,_0x2b6927){_0x2b6927=_0x2b6927||0xc8;return function(_0x19fbc0){if(_0x19fbc0){return _0x4874a7[_0xa13d('0x20')](_0x2b6927)[_0xa13d('0x21')](_0x19fbc0);}};}function respondWithFilteredResult(_0x54910a,_0x38a288){return function(_0x4d0995){if(_0x4d0995){var _0x1b600d=typeof _0x38a288[_0xa13d('0x22')]===_0xa13d('0x23')&&typeof _0x38a288[_0xa13d('0x24')]===_0xa13d('0x23');var _0x3cb1c5=_0x4d0995[_0xa13d('0x25')];var _0x3b57b=_0x1b600d?0x0:_0x38a288[_0xa13d('0x22')];var _0x2f32de=_0x1b600d?_0x4d0995[_0xa13d('0x25')]:_0x38a288[_0xa13d('0x22')]+_0x38a288[_0xa13d('0x24')];var _0xa662fd;if(_0x2f32de>=_0x3cb1c5){_0x2f32de=_0x3cb1c5;_0xa662fd=0xc8;}else{_0xa662fd=0xce;}_0x54910a[_0xa13d('0x20')](_0xa662fd);return _0x54910a[_0xa13d('0x26')]('Content-Range',_0x3b57b+'-'+_0x2f32de+'/'+_0x3cb1c5)[_0xa13d('0x21')](_0x4d0995);}return null;};}function patchUpdates(_0x2ceb70){return function(_0x146281){try{jsonpatch['apply'](_0x146281,_0x2ceb70,!![]);}catch(_0x1675fc){return BPromise[_0xa13d('0x27')](_0x1675fc);}return _0x146281[_0xa13d('0x28')]();};}function saveUpdates(_0x12d8ea,_0x4416c6){return function(_0x37d4b3){if(_0x37d4b3){return _0x37d4b3[_0xa13d('0x29')](_0x12d8ea)['then'](function(_0x25fef2){return _0x25fef2;});}return null;};}function removeEntity(_0x2b0ad2,_0x5c2c77){return function(_0x2b2880){if(_0x2b2880){return _0x2b2880[_0xa13d('0x2a')]()[_0xa13d('0x2b')](function(){_0x2b0ad2[_0xa13d('0x20')](0xcc)[_0xa13d('0x1f')]();});}};}function handleEntityNotFound(_0xb84912,_0x5baa4c){return function(_0x188e12){if(!_0x188e12){_0xb84912[_0xa13d('0x1e')](0x194);}return _0x188e12;};}function handleError(_0x4ffefc,_0x24d5b1){_0x24d5b1=_0x24d5b1||0x1f4;return function(_0x3e6251){logger['error'](_0x3e6251[_0xa13d('0x2c')]);if(_0x3e6251['name']){delete _0x3e6251['name'];}_0x4ffefc['status'](_0x24d5b1)['send'](_0x3e6251);};}exports[_0xa13d('0x2d')]=function(_0x35cff8,_0x570e03){var _0x255def={},_0x3766d1={},_0x1aa0bc={'count':0x0,'rows':[]};var _0x2f8bb3=_[_0xa13d('0x2e')](db[_0xa13d('0x2f')][_0xa13d('0x30')],function(_0x563bfd){return{'name':_0x563bfd['fieldName'],'type':_0x563bfd['type'][_0xa13d('0x31')]};});_0x3766d1[_0xa13d('0x32')]=_[_0xa13d('0x33')](_[_0xa13d('0x2e')](_0x2f8bb3,_0xa13d('0x34')),[_0xa13d('0x35')]);_0x3766d1['query']=_[_0xa13d('0x36')](_0x35cff8[_0xa13d('0x37')]);_0x3766d1[_0xa13d('0x38')]=_[_0xa13d('0x39')](_0x3766d1[_0xa13d('0x32')],_0x3766d1['query']);_0x255def['attributes']=_[_0xa13d('0x39')](_0x3766d1['model'],qs[_0xa13d('0x3a')](_0x35cff8[_0xa13d('0x37')][_0xa13d('0x3a')]));_0x255def[_0xa13d('0x3b')]=_0x255def[_0xa13d('0x3b')][_0xa13d('0x3c')]?_0x255def[_0xa13d('0x3b')]:_0x3766d1[_0xa13d('0x32')];if(!_0x35cff8[_0xa13d('0x37')][_0xa13d('0x3d')]('nolimit')){_0x255def['limit']=qs[_0xa13d('0x24')](_0x35cff8[_0xa13d('0x37')][_0xa13d('0x24')]);_0x255def[_0xa13d('0x22')]=qs['offset'](_0x35cff8[_0xa13d('0x37')][_0xa13d('0x22')]);}_0x255def[_0xa13d('0x3e')]=qs[_0xa13d('0x3f')](_0x35cff8['query'][_0xa13d('0x3f')]);_0x255def[_0xa13d('0x40')]=qs['filters'](_['pick'](_0x35cff8[_0xa13d('0x37')],_0x3766d1[_0xa13d('0x38')]),_0x2f8bb3);if(_0x35cff8[_0xa13d('0x37')]['filter']){_0x255def[_0xa13d('0x40')]=_['merge'](_0x255def[_0xa13d('0x40')],{'$or':_[_0xa13d('0x2e')](_0x2f8bb3,function(_0x5d7c8c){if(_0x5d7c8c[_0xa13d('0x41')]!=='VIRTUAL'){var _0x52bb74={};_0x52bb74[_0x5d7c8c[_0xa13d('0x34')]]={'$like':'%'+_0x35cff8[_0xa13d('0x37')][_0xa13d('0x42')]+'%'};return _0x52bb74;}})});}_0x255def=_['merge']({},_0x255def,_0x35cff8[_0xa13d('0x43')]);var _0x9f66fc={'where':_0x255def[_0xa13d('0x40')]};return db[_0xa13d('0x2f')]['count'](_0x9f66fc)[_0xa13d('0x2b')](function(_0x4fed35){_0x1aa0bc[_0xa13d('0x25')]=_0x4fed35;if(_0x35cff8['query'][_0xa13d('0x44')]){_0x255def[_0xa13d('0x45')]=[{'all':!![]}];}return db[_0xa13d('0x2f')]['findAll'](_0x255def);})[_0xa13d('0x2b')](function(_0x3a2d5a){_0x1aa0bc[_0xa13d('0x46')]=_0x3a2d5a;return _0x1aa0bc;})[_0xa13d('0x2b')](respondWithFilteredResult(_0x570e03,_0x255def))[_0xa13d('0x47')](handleError(_0x570e03,null));};exports[_0xa13d('0x48')]=function(_0x2bf7f0,_0x2e0ad4){var _0x47c9ad={'raw':![],'where':{'id':_0x2bf7f0[_0xa13d('0x49')]['id']}},_0x3ad338={};_0x3ad338[_0xa13d('0x32')]=_['keys'](db[_0xa13d('0x2f')][_0xa13d('0x30')]);_0x3ad338['query']=_[_0xa13d('0x36')](_0x2bf7f0['query']);_0x3ad338['filters']=_['intersection'](_0x3ad338[_0xa13d('0x32')],_0x3ad338[_0xa13d('0x37')]);_0x47c9ad['attributes']=_[_0xa13d('0x39')](_0x3ad338[_0xa13d('0x32')],qs[_0xa13d('0x3a')](_0x2bf7f0[_0xa13d('0x37')][_0xa13d('0x3a')]));_0x47c9ad['attributes']=_0x47c9ad[_0xa13d('0x3b')][_0xa13d('0x3c')]?_0x47c9ad[_0xa13d('0x3b')]:_0x3ad338[_0xa13d('0x32')];if(_0x2bf7f0[_0xa13d('0x37')][_0xa13d('0x44')]){_0x47c9ad['include']=[{'all':!![]}];}_0x47c9ad=_[_0xa13d('0x4a')]({},_0x47c9ad,_0x2bf7f0['options']);return db[_0xa13d('0x2f')][_0xa13d('0x4b')](_0x47c9ad)[_0xa13d('0x2b')](handleEntityNotFound(_0x2e0ad4,null))['then'](respondWithResult(_0x2e0ad4,null))[_0xa13d('0x47')](handleError(_0x2e0ad4,null));};exports[_0xa13d('0x4c')]=function(_0x4ab6ad,_0x350ef9){return db[_0xa13d('0x2f')][_0xa13d('0x4c')](_0x4ab6ad['body'],{})['then'](respondWithResult(_0x350ef9,0xc9))[_0xa13d('0x47')](handleError(_0x350ef9,null));};exports[_0xa13d('0x29')]=function(_0x598f6,_0x2533fc){if(_0x598f6[_0xa13d('0x4d')]['id']){delete _0x598f6[_0xa13d('0x4d')]['id'];}return db[_0xa13d('0x2f')][_0xa13d('0x4b')]({'where':{'id':_0x598f6[_0xa13d('0x49')]['id']}})[_0xa13d('0x2b')](handleEntityNotFound(_0x2533fc,null))['then'](saveUpdates(_0x598f6[_0xa13d('0x4d')],null))[_0xa13d('0x2b')](respondWithResult(_0x2533fc,null))['catch'](handleError(_0x2533fc,null));};exports[_0xa13d('0x4e')]=function(_0xa562df,_0x12c4c4){return db[_0xa13d('0x2f')][_0xa13d('0x4e')]()['then'](respondWithResult(_0x12c4c4,null))[_0xa13d('0x47')](handleError(_0x12c4c4,null));};exports[_0xa13d('0x4f')]=function(_0xa5dd8,_0xec69f8,_0x4333c9){var _0xe9e71f=require(_0xa13d('0x50'));var _0x3d7f26=![];var _0x3345ee={};if(_0xa5dd8[_0xa13d('0x37')][_0xa13d('0x41')]&&_0xa5dd8[_0xa13d('0x37')]['type']==='uniqueid'){_0x3345ee[_0xa13d('0x51')]=_0xa5dd8[_0xa13d('0x49')]['id'];}else{_0x3345ee['id']=_0xa5dd8[_0xa13d('0x49')]['id'];}return db['VoiceRecording'][_0xa13d('0x4b')]({'where':_0x3345ee,'attributes':['id',_0xa13d('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0xec69f8,null))[_0xa13d('0x2b')](function(_0x2bc04d){if(_0x2bc04d){var _0x4788e7=_0x2bc04d[_0xa13d('0x52')];var _0xd4f768=util[_0xa13d('0x35')]('%s.cypher',_0x4788e7);if(fs[_0xa13d('0x53')](_0xd4f768)){_0x3d7f26=!![];return _0xe9e71f[_0xa13d('0x54')](_0xd4f768,_0x4788e7,config[_0xa13d('0x55')]['recording'])[_0xa13d('0x2b')](function(){return _0x2bc04d;});}return _0x2bc04d;}})[_0xa13d('0x2b')](function(_0x38c941){if(_0x38c941){var _0x464f2d=_0x38c941[_0xa13d('0x52')];if(!fs[_0xa13d('0x53')](_0x464f2d)){throw new db[(_0xa13d('0x56'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x38c941[_0xa13d('0x57')]){return _0xec69f8['download'](_0x464f2d,_0x38c941[_0xa13d('0x57')]+path[_0xa13d('0x58')](_0x464f2d),function(){if(_0x3d7f26){fs['unlink'](_0x464f2d);}});}else{return _0xec69f8[_0xa13d('0x4f')](_0x464f2d,function(_0x26a836){if(_0x3d7f26){fs[_0xa13d('0x59')](_0x464f2d);}});}}})[_0xa13d('0x47')](function(_0x532975){if(_0x532975[_0xa13d('0x5a')]===_0xa13d('0x5b')){_0xec69f8[_0xa13d('0x20')](0x194)[_0xa13d('0x5c')]('Not\x20found');}else{return handleError(_0xec69f8,null);}});};exports[_0xa13d('0x5d')]=function(_0x3cfcd0,_0x1d9be9,_0x2d1507){var _0x54ed43=require(_0xa13d('0x50'));var _0x3d0f16=![];var _0x4793b3={'$and':[db[_0xa13d('0x5e')]['where'](db[_0xa13d('0x5e')]['fn'](_0xa13d('0x5f'),db[_0xa13d('0x5e')][_0xa13d('0x60')](_0xa13d('0x51'))),_0x3cfcd0[_0xa13d('0x37')]['token'])]};if(_0x3cfcd0[_0xa13d('0x37')][_0xa13d('0x41')]&&_0x3cfcd0['query']['type']===_0xa13d('0x51')){_0x4793b3[_0xa13d('0x61')]['push']({'uniqueid':_0x3cfcd0['params']['id']});}else{_0x4793b3['$and'][_0xa13d('0x62')]({'id':_0x3cfcd0[_0xa13d('0x49')]['id']});}return db[_0xa13d('0x2f')][_0xa13d('0x4b')]({'where':_0x4793b3,'attributes':['id','value'],'raw':!![]})[_0xa13d('0x2b')](handleEntityNotFound(_0x1d9be9,null))[_0xa13d('0x2b')](function(_0x4076fb){if(_0x4076fb){var _0x5cd0bd=util['format'](_0xa13d('0x63'),_0x4076fb[_0xa13d('0x52')]);if(fs['existsSync'](_0x5cd0bd)){_0x3d0f16=!![];return _0x54ed43[_0xa13d('0x54')](_0x5cd0bd,_0x4076fb[_0xa13d('0x52')],config[_0xa13d('0x55')][_0xa13d('0x64')])[_0xa13d('0x2b')](function(){return _0x4076fb;});}return _0x4076fb;}})['then'](function(_0x49da8d){if(_0x49da8d){if(!fs[_0xa13d('0x53')](_0x49da8d[_0xa13d('0x52')])){throw new db['Sequelize'][(_0xa13d('0x65'))](_0xa13d('0x5b'));}if(_0x49da8d[_0xa13d('0x57')]){return _0x1d9be9[_0xa13d('0x4f')](_0x49da8d[_0xa13d('0x52')],_0x49da8d[_0xa13d('0x57')]+path[_0xa13d('0x58')](_0x49da8d[_0xa13d('0x52')]),function(){if(_0x3d0f16){fs['unlink'](_0x49da8d[_0xa13d('0x52')]);}});}else{return _0x1d9be9[_0xa13d('0x4f')](_0x49da8d[_0xa13d('0x52')],function(_0x4d6369){if(_0x3d0f16){fs[_0xa13d('0x59')](_0x49da8d[_0xa13d('0x52')]);}});}}})[_0xa13d('0x47')](handleError(_0x1d9be9,null));};exports[_0xa13d('0x2a')]=function(_0x12bcec,_0x4d7551){return db[_0xa13d('0x2f')][_0xa13d('0x4b')]({'where':{'id':_0x12bcec[_0xa13d('0x49')]['id']}})[_0xa13d('0x2b')](function(_0x3e7cbc){if(_['isNil'](_0x3e7cbc)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3e7cbc;})[_0xa13d('0x2b')](function(_0xec27b1){var _0x2145f2=_0xec27b1[_0xa13d('0x52')];logger['info'](_0xa13d('0x66'),_0x2145f2);if(!_['isNil'](_0xec27b1['value'])&&fs[_0xa13d('0x53')](_0x2145f2)){logger[_0xa13d('0x67')](_0xa13d('0x68')+_0x2145f2+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa13d('0x69')](_0x2145f2);}_0x2145f2=_0x2145f2+_0xa13d('0x6a');if(!_['isNil'](_0xec27b1[_0xa13d('0x52')])&&fs['existsSync'](_0x2145f2)){logger[_0xa13d('0x67')](_0xa13d('0x68')+_0x2145f2+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2145f2);}return _0xec27b1;})[_0xa13d('0x2b')](function(_0x27cfd8){if(!_0x27cfd8)throw new InternalError();return _0x27cfd8['destroy']();})[_0xa13d('0x2b')](function(){_0x4d7551[_0xa13d('0x20')](0xcc)['end']();})[_0xa13d('0x47')](handleError(_0x4d7551,null));};function getBucketslist(_0x4a8322,_0x575284,_0x585a61){return new Promise(function(_0x3e68d6,_0x32fa96){var _0x42ecb6=new AWS['S3']({'accessKeyId':_0x575284,'secretAccessKey':_0x4a8322,'region':_0x585a61});_0x42ecb6[_0xa13d('0x6b')]({},function(_0x565573,_0x22871a){if(_0x565573){return _0x32fa96(_0x565573);}else{return _0x3e68d6(_0x22871a);}});});}function createBucket(_0x412d5b,_0x3fb1bb,_0x35e769,_0x259ed7){return new Promise(function(_0x108e89,_0x35facf){var _0x27376c=new AWS['S3']({'accessKeyId':_0x3fb1bb,'secretAccessKey':_0x412d5b,'region':_0x35e769});_0x27376c[_0xa13d('0x6c')]({'Bucket':_0x259ed7},function(_0x56f2bf,_0x16445a){if(_0x56f2bf){return _0x35facf(_0x56f2bf);}else{return _0x108e89(_0x16445a);}});});}function uploadFile(_0x4b0b31,_0x1ab663,_0x406b0a,_0x2f621f,_0x5e187f,_0x131630){return new Promise(function(_0x79f77,_0x4c8a98){var _0x5df40c=new AWS['S3']({'accessKeyId':_0x1ab663,'secretAccessKey':_0x4b0b31,'region':_0x406b0a});_0x5df40c[_0xa13d('0x6d')]({'Bucket':_0x2f621f,'Key':_0x5e187f,'Body':_0x131630},function(_0x343c4b,_0x2fdf64){if(_0x343c4b){return _0x4c8a98(_0x343c4b);}else{return _0x79f77(_0x2fdf64);}});});}function startTranscribe(_0x26fc3f,_0x1dc7d9,_0x4226b3,_0x6bbe0,_0x1fc706,_0xd69fd8){return new Promise(function(_0x1ccd5a,_0x405551){var _0x4a8b01=new AWS['TranscribeService']({'accessKeyId':_0x1dc7d9,'secretAccessKey':_0x26fc3f,'region':_0x4226b3});_0x4a8b01['startTranscriptionJob']({'TranscriptionJobName':_0x6bbe0,'LanguageCode':_0x1fc706,'Media':{'MediaFileUri':_0xd69fd8}},function(_0x4dad83,_0x2b5035){if(_0x4dad83){return _0x405551(_0x4dad83);}else{return _0x1ccd5a(_0x2b5035);}});});}function transcribe(_0xe0ecbc,_0x1fe95f,_0x38747d,_0x124a35,_0x7d2d9f,_0x46d6f0,_0x210e60){return new Promise(function(_0x2fec48,_0x589f16){var _0x147410={};logger[_0xa13d('0x67')](util[_0xa13d('0x35')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0xe0ecbc,_0x7d2d9f));return uploadFile(_0x1fe95f,_0x38747d,_0x124a35,_0x7d2d9f,path['basename'](_0x46d6f0),fs['readFileSync'](_0x46d6f0))[_0xa13d('0x2b')](function(_0xe608b5){logger[_0xa13d('0x67')](util[_0xa13d('0x35')](_0xa13d('0x6e'),_0xe0ecbc,_0x7d2d9f,_0xe608b5[_0xa13d('0x6f')]));_0x147410[_0xa13d('0x70')]=_0xe608b5[_0xa13d('0x71')];_0x147410[_0xa13d('0x72')]=_0xe608b5[_0xa13d('0x6f')];logger[_0xa13d('0x67')](util[_0xa13d('0x35')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xe0ecbc));return startTranscribe(_0x1fe95f,_0x38747d,_0x124a35,uuidv4(),_0x210e60,_0xe608b5[_0xa13d('0x6f')]);})[_0xa13d('0x2b')](function(_0x249675){logger['info'](util[_0xa13d('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0xe0ecbc,_0x249675[_0xa13d('0x73')][_0xa13d('0x74')]));_0x147410[_0xa13d('0x75')]=_0x249675[_0xa13d('0x73')][_0xa13d('0x74')];_0x147410[_0xa13d('0x76')]=_0x249675[_0xa13d('0x73')][_0xa13d('0x77')];return _0x2fec48(_0x147410);})[_0xa13d('0x47')](function(_0x5b472c){return _0x589f16(_0x5b472c);});});}exports[_0xa13d('0x78')]=function(_0x7182aa,_0xf038ae,_0x30436c){var _0x2ab221;var _0x51f147;var _0x38785e;var _0x3ee78b=require(_0xa13d('0x50'));return db[_0xa13d('0x2f')][_0xa13d('0x79')]({'where':{'id':_0x7182aa[_0xa13d('0x49')]['id']}})[_0xa13d('0x2b')](function(_0x594748){if(_0x594748){var _0xe8c9e2=util['format']('%s.cypher',_0x594748[_0xa13d('0x52')]);if(fs[_0xa13d('0x53')](_0xe8c9e2)){cypher=!![];return _0x3ee78b[_0xa13d('0x54')](_0xe8c9e2,_0x594748[_0xa13d('0x52')],config[_0xa13d('0x55')][_0xa13d('0x64')])[_0xa13d('0x2b')](function(){return _0x594748;});}return _0x594748;}})[_0xa13d('0x2b')](function(_0x205ec1){if(!_0x205ec1){throw new db[(_0xa13d('0x56'))][(_0xa13d('0x65'))]('Voice\x20Recording\x20not\x20found');}_0x51f147=_0x205ec1;return db['Setting'][_0xa13d('0x79')]({'where':{'id':0x1}});})[_0xa13d('0x2b')](handleEntityNotFound(_0xf038ae,null))['then'](function(_0x6a2ea7){if(_0x6a2ea7){_0x2ab221=_0x6a2ea7;if(!_0x2ab221[_0xa13d('0x7a')]||!_0x2ab221['transcribeAccountId']||!_0x2ab221['transcribeRegion']||!_0x2ab221[_0xa13d('0x7b')]||!_0x2ab221[_0xa13d('0x70')]){throw new db[(_0xa13d('0x56'))][(_0xa13d('0x65'))](_0xa13d('0x7c'));}if(_0x7182aa[_0xa13d('0x4d')][_0xa13d('0x7d')]&&(!_0x2ab221[_0xa13d('0x7e')]||!_0x2ab221[_0xa13d('0x7f')]||!_0x2ab221[_0xa13d('0x80')]||!_0x2ab221[_0xa13d('0x7b')]||!_0x2ab221[_0xa13d('0x70')])){throw new db[(_0xa13d('0x56'))][(_0xa13d('0x65'))](_0xa13d('0x81'));}return db[_0xa13d('0x82')][_0xa13d('0x79')]({'where':{'id':_0x2ab221[_0xa13d('0x83')]}});}})[_0xa13d('0x2b')](function(_0x371302){if(!_0x371302){throw new db[(_0xa13d('0x56'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x371302['data1']||!_0x371302[_0xa13d('0x84')]){throw new db[(_0xa13d('0x56'))][(_0xa13d('0x65'))](_0xa13d('0x85'));}_0x38785e=_0x371302;return getBucketslist(_0x38785e[_0xa13d('0x86')],_0x38785e[_0xa13d('0x84')],_0x2ab221[_0xa13d('0x87')]);})['then'](function(_0x39755d){if(_0x39755d&&_0x39755d[_0xa13d('0x88')]){var _0x4ed276=_[_0xa13d('0x4b')](_0x39755d[_0xa13d('0x88')],function(_0x424dbf){return _0x424dbf['Name']===_0x2ab221[_0xa13d('0x70')];});if(!_0x4ed276){logger[_0xa13d('0x67')](util['format'](_0xa13d('0x89'),_0x7182aa[_0xa13d('0x49')]['id'],_0x2ab221['bucket']));return createBucket(_0x38785e['data1'],_0x38785e[_0xa13d('0x84')],_0x2ab221[_0xa13d('0x87')],_0x2ab221[_0xa13d('0x70')]);}logger[_0xa13d('0x67')](util[_0xa13d('0x35')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x7182aa['params']['id'],_0x2ab221['bucket']));return;}})[_0xa13d('0x2b')](function(_0x4e9d5c){if(_0x51f147[_0xa13d('0x76')]===_0xa13d('0x8a')){return transcribe(_0x7182aa[_0xa13d('0x49')]['id'],_0x38785e[_0xa13d('0x86')],_0x38785e[_0xa13d('0x84')],_0x2ab221[_0xa13d('0x87')],_0x2ab221[_0xa13d('0x70')],_0x51f147[_0xa13d('0x52')],_0x2ab221['language']);}else{logger[_0xa13d('0x67')](util[_0xa13d('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x7182aa['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xa13d('0x2b')](function(_0x1a1699){if(_0x1a1699){_0x1a1699[_0xa13d('0x8b')]=_0x7182aa[_0xa13d('0x4d')]['runSentiment'];return _0x51f147[_0xa13d('0x8c')](_0x1a1699);}})[_0xa13d('0x2b')](respondWithResult(_0xf038ae,null))['catch'](handleError(_0xf038ae,null));};function writeFile(_0x57434d,_0x391112){return new Promise(function(_0x446644,_0x227346){fs[_0xa13d('0x8d')](_0x391112,_0x57434d,function(_0x403772,_0x286e14){if(_0x403772){return _0x227346(_0x403772);}else{return _0x446644(_0x286e14);}});});}exports[_0xa13d('0x8e')]=function(_0x4cfd75,_0x3bda4b,_0xc6612d){return db[_0xa13d('0x2f')][_0xa13d('0x79')]({'where':{'id':_0x4cfd75[_0xa13d('0x49')]['id']}})[_0xa13d('0x2b')](handleEntityNotFound(_0x3bda4b))[_0xa13d('0x2b')](function(_0x4e5762){if(_0x4e5762&&_0x4e5762[_0xa13d('0x8f')]){var _0x20923b=_0x4e5762[_0xa13d('0x8f')];var _0x44584f=config[_0xa13d('0x90')]+_0xa13d('0x91')+_0x4e5762['id']+_0xa13d('0x92');if(fs[_0xa13d('0x53')](_0x44584f)){return _0x44584f;}return writeFile(_0x20923b,_0x44584f)[_0xa13d('0x2b')](function(){return _0x44584f;});}else{throw new db[(_0xa13d('0x56'))][(_0xa13d('0x65'))](_0xa13d('0x93'));}})[_0xa13d('0x2b')](function(_0x4ddf2b){return _0x3bda4b['download'](_0x4ddf2b);})[_0xa13d('0x47')](handleError(_0x3bda4b));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index ae15b50..97b3484 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 _0x559a=['exports','define','VoiceRecording','voice_recordings','uniqueid','./voiceRecording.attributes'];(function(_0x47565d,_0x38ee54){var _0x55b2f6=function(_0x8d5d28){while(--_0x8d5d28){_0x47565d['push'](_0x47565d['shift']());}};_0x55b2f6(++_0x38ee54);}(_0x559a,0xb3));var _0xa559=function(_0x3285da,_0x35b03d){_0x3285da=_0x3285da-0x0;var _0x3a594e=_0x559a[_0x3285da];return _0x3a594e;};'use strict';var attributes=require(_0xa559('0x0'));module[_0xa559('0x1')]=function(_0x4c626e,_0x318517){return _0x4c626e[_0xa559('0x2')](_0xa559('0x3'),attributes,{'tableName':_0xa559('0x4'),'paranoid':![],'indexes':[{'name':_0xa559('0x5'),'fields':[_0xa559('0x5')]},{'name':'transcribeStatus','fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f17=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','VoiceRecording'];(function(_0xe43a3c,_0x3600b3){var _0x50e76a=function(_0x4f0eb3){while(--_0x4f0eb3){_0xe43a3c['push'](_0xe43a3c['shift']());}};_0x50e76a(++_0x3600b3);}(_0x4f17,0x9e));var _0x74f1=function(_0x5c6c64,_0x12d4cb){_0x5c6c64=_0x5c6c64-0x0;var _0x172174=_0x4f17[_0x5c6c64];return _0x172174;};'use strict';var attributes=require(_0x74f1('0x0'));module['exports']=function(_0xc7f009,_0xfcf99c){return _0xc7f009['define'](_0x74f1('0x1'),attributes,{'tableName':_0x74f1('0x2'),'paranoid':![],'indexes':[{'name':_0x74f1('0x3'),'fields':[_0x74f1('0x3')]},{'name':_0x74f1('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 60671a4..33966b6 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 _0x524e=['UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','%s.cypher','recording','unlink','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording','update','options','where','attributes','limit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x524e,0x15e));var _0xe524=function(_0x2ab99f,_0x17158e){_0x2ab99f=_0x2ab99f-0x0;var _0x48357e=_0x524e[_0x2ab99f];return _0x48357e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['UpdateVoiceRecording']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')](_0x3a4027['body'],{'raw':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x19')]||null:null,'attributes':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'limit':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1b')]||null:null})['then'](function(_0x7d1f92){logger['info']('UpdateVoiceRecording',_0x3a4027);logger[_0xe524('0x10')](_0xe524('0x1c'),_0x3a4027,JSON[_0xe524('0x12')](_0x7d1f92));_0x11b2a1(_0x7d1f92);})[_0xe524('0x1d')](function(_0x599d5d){logger[_0xe524('0x13')]('UpdateVoiceRecording',_0x599d5d[_0xe524('0x15')],_0x3a4027);_0x238f8f(_0x4f1dfb[_0xe524('0x13')](0x1f4,_0x599d5d[_0xe524('0x15')]));});});};exports[_0xe524('0x1e')]=function(_0x4102d9){var _0xfd5965=this;return new Promise(function(_0x2141db,_0x583cc3){var _0x58a896=require(_0xe524('0x1f'));var _0x45abad;return db[_0xe524('0x20')][_0xe524('0x21')]({'attributes':['id',_0xe524('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x52f140){_0x45abad=_0x52f140;return db[_0xe524('0x16')][_0xe524('0x23')](_0x4102d9[_0xe524('0x24')]);})[_0xe524('0xc')](function(_0x25c0a1){if(_0x45abad['callRecordingEncryption']&&fs[_0xe524('0x25')](_0x25c0a1[_0xe524('0x26')])){var _0x4a4e15=util['format'](_0xe524('0x27'),_0x25c0a1[_0xe524('0x26')]);return _0x58a896['encryptFile'](_0x25c0a1[_0xe524('0x26')],_0x4a4e15,config['secrets'][_0xe524('0x28')])['then'](function(){fs[_0xe524('0x29')](_0x25c0a1[_0xe524('0x26')]);logger[_0xe524('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x25c0a1;});}return _0x25c0a1;})[_0xe524('0xc')](function(_0x5238c9){logger[_0xe524('0xd')](_0xe524('0x1e'),_0x4102d9);logger[_0xe524('0x10')]('CreateVoiceRecording',_0x4102d9,JSON[_0xe524('0x12')](_0x5238c9));_0x2141db(_0x5238c9);})[_0xe524('0x1d')](function(_0x49c43e){logger[_0xe524('0x13')](_0xe524('0x1e'),_0x49c43e[_0xe524('0x15')],_0x4102d9);_0x583cc3(_0xfd5965[_0xe524('0x13')](0x1f4,_0x49c43e['message']));});});}; \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','body','options','where','limit','UpdateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x8591ff,_0x26a0d9){var _0x91ae2=function(_0x327001){while(--_0x327001){_0x8591ff['push'](_0x8591ff['shift']());}};_0x91ae2(++_0x26a0d9);}(_0x0295,0x1f0));var _0x5029=function(_0x4b3300,_0x1137f1){_0x4b3300=_0x4b3300-0x0;var _0x2d26d3=_0x0295[_0x4b3300];return _0x2d26d3;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}exports['UpdateVoiceRecording']=function(_0x1ed567){var _0x31a155=this;return new Promise(function(_0x35de81,_0x4902f3){return db[_0x5029('0x15')][_0x5029('0x16')](_0x1ed567[_0x5029('0x17')],{'raw':_0x1ed567['options']?_0x1ed567[_0x5029('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed567[_0x5029('0x18')]?_0x1ed567[_0x5029('0x18')][_0x5029('0x19')]||null:null,'attributes':_0x1ed567[_0x5029('0x18')]?_0x1ed567['options']['attributes']||null:null,'limit':_0x1ed567[_0x5029('0x18')]?_0x1ed567['options'][_0x5029('0x1a')]||null:null})[_0x5029('0xa')](function(_0x1eb228){logger[_0x5029('0xb')](_0x5029('0x1b'),_0x1ed567);logger[_0x5029('0xd')](_0x5029('0x1b'),_0x1ed567,JSON[_0x5029('0xf')](_0x1eb228));_0x35de81(_0x1eb228);})[_0x5029('0x14')](function(_0x4ceaae){logger['error']('UpdateVoiceRecording',_0x4ceaae[_0x5029('0x12')],_0x1ed567);_0x4902f3(_0x31a155[_0x5029('0x10')](0x1f4,_0x4ceaae['message']));});});};exports['CreateVoiceRecording']=function(_0x181da0){var _0x1e7e61=this;return new Promise(function(_0x36d810,_0x5527fc){var _0x2c501f=require(_0x5029('0x1c'));var _0x5e45c4;return db[_0x5029('0x1d')][_0x5029('0x1e')]({'attributes':['id',_0x5029('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x32da06){_0x5e45c4=_0x32da06;return db[_0x5029('0x15')][_0x5029('0x20')](_0x181da0['body']);})[_0x5029('0xa')](function(_0x2bb398){if(_0x5e45c4['callRecordingEncryption']&&fs[_0x5029('0x21')](_0x2bb398[_0x5029('0x22')])){var _0x4434ff=util[_0x5029('0x23')](_0x5029('0x24'),_0x2bb398[_0x5029('0x22')]);return _0x2c501f[_0x5029('0x25')](_0x2bb398[_0x5029('0x22')],_0x4434ff,config[_0x5029('0x26')][_0x5029('0x27')])[_0x5029('0xa')](function(){fs[_0x5029('0x28')](_0x2bb398['value']);logger[_0x5029('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2bb398;});}return _0x2bb398;})[_0x5029('0xa')](function(_0x4f672e){logger['info'](_0x5029('0x29'),_0x181da0);logger[_0x5029('0xd')](_0x5029('0x29'),_0x181da0,JSON['stringify'](_0x4f672e));_0x36d810(_0x4f672e);})[_0x5029('0x14')](function(_0x15d882){logger[_0x5029('0x10')](_0x5029('0x29'),_0x15d882[_0x5029('0x12')],_0x181da0);_0x5527fc(_0x1e7e61[_0x5029('0x10')](0x1f4,_0x15d882[_0x5029('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c78a3aa..0195c61 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 _0x64bc=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','exports','multer','util'];(function(_0x1f44c5,_0x5067dd){var _0x1b31a5=function(_0x38885a){while(--_0x38885a){_0x1f44c5['push'](_0x1f44c5['shift']());}};_0x1b31a5(++_0x5067dd);}(_0x64bc,0x83));var _0xc64b=function(_0x52e129,_0x21975e){_0x52e129=_0x52e129-0x0;var _0x1acfc6=_0x64bc[_0x52e129];return _0x1acfc6;};'use strict';var multer=require(_0xc64b('0x0'));var util=require(_0xc64b('0x1'));var path=require(_0xc64b('0x2'));var timeout=require(_0xc64b('0x3'));var express=require(_0xc64b('0x4'));var router=express['Router']();var fs_extra=require(_0xc64b('0x5'));var auth=require(_0xc64b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc64b('0x7'));var controller=require(_0xc64b('0x8'));router[_0xc64b('0x9')]('/',auth[_0xc64b('0xa')](),controller[_0xc64b('0xb')]);router[_0xc64b('0x9')](_0xc64b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xc64b('0x9')](_0xc64b('0xd'),auth['isAuthenticated'](),controller[_0xc64b('0xe')]);router['post']('/',auth[_0xc64b('0xa')](),controller['create']);router[_0xc64b('0xf')](_0xc64b('0xd'),auth['isAuthenticated'](),controller[_0xc64b('0x10')]);router[_0xc64b('0x11')](_0xc64b('0xd'),auth[_0xc64b('0xa')](),controller['destroy']);module[_0xc64b('0x12')]=router; \ No newline at end of file +var _0x6575=['../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x124bb6,_0x382802){var _0x5531e2=function(_0x299bf5){while(--_0x299bf5){_0x124bb6['push'](_0x124bb6['shift']());}};_0x5531e2(++_0x382802);}(_0x6575,0x11c));var _0x5657=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x6575[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x5657('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5657('0x1'));var express=require(_0x5657('0x2'));var router=express[_0x5657('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5657('0x4'));var interaction=require(_0x5657('0x5'));var config=require('../../config/environment');var controller=require(_0x5657('0x6'));router[_0x5657('0x7')]('/',auth[_0x5657('0x8')](),controller[_0x5657('0x9')]);router[_0x5657('0x7')](_0x5657('0xa'),auth[_0x5657('0x8')](),controller[_0x5657('0xb')]);router[_0x5657('0x7')](_0x5657('0xc'),auth[_0x5657('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5657('0xd')](_0x5657('0xc'),auth[_0x5657('0x8')](),controller[_0x5657('0xe')]);router[_0x5657('0xf')](_0x5657('0xc'),auth[_0x5657('0x8')](),controller['destroy']);module[_0x5657('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d5fbd21..1272e6e 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 _0xcf4f=['Yes','sequelize','moment','exports','ENUM','blind','attended','STRING'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0xcf4f,0xd1));var _0xfcf4=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xcf4f[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0xfcf4('0x0'));var moment=require(_0xfcf4('0x1'));module[_0xfcf4('0x2')]={'type':{'type':Sequelize[_0xfcf4('0x3')](_0xfcf4('0x4'),_0xfcf4('0x5'))},'result':{'type':Sequelize[_0xfcf4('0x6')]},'transfererchannel':{'type':Sequelize[_0xfcf4('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xfcf4('0x6')]},'transferercalleridname':{'type':Sequelize[_0xfcf4('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xfcf4('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xfcf4('0x6')]},'transferercontext':{'type':Sequelize[_0xfcf4('0x6')]},'transfererexten':{'type':Sequelize[_0xfcf4('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xfcf4('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xfcf4('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xfcf4('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xfcf4('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xfcf4('0x6')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xfcf4('0x6')]},'isexternal':{'type':Sequelize[_0xfcf4('0x3')](_0xfcf4('0x7'),'No')},'context':{'type':Sequelize[_0xfcf4('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x84c0=['exports','ENUM','blind','attended','STRING','Yes','moment'];(function(_0x3780dc,_0x196bff){var _0x4ae839=function(_0x45f6dc){while(--_0x45f6dc){_0x3780dc['push'](_0x3780dc['shift']());}};_0x4ae839(++_0x196bff);}(_0x84c0,0x1e9));var _0x084c=function(_0x2ce2e9,_0x516733){_0x2ce2e9=_0x2ce2e9-0x0;var _0x51c0a1=_0x84c0[_0x2ce2e9];return _0x51c0a1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x084c('0x0'));module[_0x084c('0x1')]={'type':{'type':Sequelize[_0x084c('0x2')](_0x084c('0x3'),_0x084c('0x4'))},'result':{'type':Sequelize[_0x084c('0x5')]},'transfererchannel':{'type':Sequelize[_0x084c('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x084c('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x084c('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x084c('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x084c('0x5')]},'transferercontext':{'type':Sequelize[_0x084c('0x5')]},'transfererexten':{'type':Sequelize[_0x084c('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x084c('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x084c('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x084c('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x084c('0x5')]},'transfereecontext':{'type':Sequelize[_0x084c('0x5')]},'transfereeexten':{'type':Sequelize[_0x084c('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x084c('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x084c('0x6'),'No')},'context':{'type':Sequelize[_0x084c('0x5')]},'extension':{'type':Sequelize[_0x084c('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 405a0e6..360fbc7 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 _0x75cf=['catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll'];(function(_0x34e320,_0x239340){var _0x1fe558=function(_0xaeb847){while(--_0xaeb847){_0x34e320['push'](_0x34e320['shift']());}};_0x1fe558(++_0x239340);}(_0x75cf,0x136));var _0xf75c=function(_0x299edc,_0x40d918){_0x299edc=_0x299edc-0x0;var _0x23f46c=_0x75cf[_0x299edc];return _0x23f46c;};'use strict';var emlformat=require(_0xf75c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf75c('0x1'));var jsonpatch=require(_0xf75c('0x2'));var rp=require(_0xf75c('0x3'));var moment=require(_0xf75c('0x4'));var BPromise=require(_0xf75c('0x5'));var Mustache=require(_0xf75c('0x6'));var util=require(_0xf75c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf75c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf75c('0x9'));var _=require(_0xf75c('0xa'));var squel=require(_0xf75c('0xb'));var crypto=require(_0xf75c('0xc'));var jsforce=require(_0xf75c('0xd'));var deskjs=require(_0xf75c('0xe'));var toCsv=require(_0xf75c('0x8'));var querystring=require(_0xf75c('0xf'));var Papa=require(_0xf75c('0x10'));var Redis=require('ioredis');var authService=require(_0xf75c('0x11'));var qs=require(_0xf75c('0x12'));var as=require(_0xf75c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf75c('0x14'))(_0xf75c('0x15'));var utils=require(_0xf75c('0x16'));var config=require(_0xf75c('0x17'));var licenseUtil=require(_0xf75c('0x18'));var db=require(_0xf75c('0x19'))['db'];function respondWithStatusCode(_0x5a26a4,_0x56db33){_0x56db33=_0x56db33||0xcc;return function(_0x7f5bb3){if(_0x7f5bb3){return _0x5a26a4['sendStatus'](_0x56db33);}return _0x5a26a4[_0xf75c('0x1a')](_0x56db33)[_0xf75c('0x1b')]();};}function respondWithResult(_0x3ad883,_0x3f6c78){_0x3f6c78=_0x3f6c78||0xc8;return function(_0x1b5009){if(_0x1b5009){return _0x3ad883[_0xf75c('0x1a')](_0x3f6c78)[_0xf75c('0x1c')](_0x1b5009);}};}function respondWithFilteredResult(_0x2ced8a,_0x5948bb){return function(_0x572b68){if(_0x572b68){var _0x3ae3a8=typeof _0x5948bb[_0xf75c('0x1d')]===_0xf75c('0x1e')&&typeof _0x5948bb[_0xf75c('0x1f')]==='undefined';var _0x858e10=_0x572b68[_0xf75c('0x20')];var _0x329431=_0x3ae3a8?0x0:_0x5948bb[_0xf75c('0x1d')];var _0x34c96c=_0x3ae3a8?_0x572b68[_0xf75c('0x20')]:_0x5948bb[_0xf75c('0x1d')]+_0x5948bb[_0xf75c('0x1f')];var _0x1d29d1;if(_0x34c96c>=_0x858e10){_0x34c96c=_0x858e10;_0x1d29d1=0xc8;}else{_0x1d29d1=0xce;}_0x2ced8a['status'](_0x1d29d1);return _0x2ced8a[_0xf75c('0x21')](_0xf75c('0x22'),_0x329431+'-'+_0x34c96c+'/'+_0x858e10)[_0xf75c('0x1c')](_0x572b68);}return null;};}function patchUpdates(_0x170f70){return function(_0xd617cd){try{jsonpatch[_0xf75c('0x23')](_0xd617cd,_0x170f70,!![]);}catch(_0xb8fe44){return BPromise[_0xf75c('0x24')](_0xb8fe44);}return _0xd617cd[_0xf75c('0x25')]();};}function saveUpdates(_0x436a70,_0x303cd7){return function(_0x7de3a4){if(_0x7de3a4){return _0x7de3a4[_0xf75c('0x26')](_0x436a70)[_0xf75c('0x27')](function(_0x561d51){return _0x561d51;});}return null;};}function removeEntity(_0x9bb47e,_0x50c35c){return function(_0x11b46e){if(_0x11b46e){return _0x11b46e[_0xf75c('0x28')]()[_0xf75c('0x27')](function(){_0x9bb47e[_0xf75c('0x1a')](0xcc)[_0xf75c('0x1b')]();});}};}function handleEntityNotFound(_0x281fe1,_0x4965e0){return function(_0x21cc51){if(!_0x21cc51){_0x281fe1[_0xf75c('0x29')](0x194);}return _0x21cc51;};}function handleError(_0x791211,_0x427206){_0x427206=_0x427206||0x1f4;return function(_0x12dd53){logger[_0xf75c('0x2a')](_0x12dd53[_0xf75c('0x2b')]);if(_0x12dd53[_0xf75c('0x2c')]){delete _0x12dd53[_0xf75c('0x2c')];}_0x791211['status'](_0x427206)[_0xf75c('0x2d')](_0x12dd53);};}exports[_0xf75c('0x2e')]=function(_0x2c5ba5,_0x46d6b1){var _0x16e841={},_0x225a3f={},_0x299476={'count':0x0,'rows':[]};var _0x127fcc=_[_0xf75c('0x2f')](db[_0xf75c('0x30')][_0xf75c('0x31')],function(_0x431d71){return{'name':_0x431d71[_0xf75c('0x32')],'type':_0x431d71[_0xf75c('0x33')]['key']};});_0x225a3f[_0xf75c('0x34')]=_[_0xf75c('0x2f')](_0x127fcc,_0xf75c('0x2c'));_0x225a3f['query']=_[_0xf75c('0x35')](_0x2c5ba5[_0xf75c('0x36')]);_0x225a3f[_0xf75c('0x37')]=_['intersection'](_0x225a3f[_0xf75c('0x34')],_0x225a3f[_0xf75c('0x36')]);_0x16e841['attributes']=_[_0xf75c('0x38')](_0x225a3f[_0xf75c('0x34')],qs[_0xf75c('0x39')](_0x2c5ba5[_0xf75c('0x36')][_0xf75c('0x39')]));_0x16e841[_0xf75c('0x3a')]=_0x16e841[_0xf75c('0x3a')]['length']?_0x16e841[_0xf75c('0x3a')]:_0x225a3f[_0xf75c('0x34')];if(!_0x2c5ba5['query'][_0xf75c('0x3b')](_0xf75c('0x3c'))){_0x16e841[_0xf75c('0x1f')]=qs['limit'](_0x2c5ba5['query'][_0xf75c('0x1f')]);_0x16e841[_0xf75c('0x1d')]=qs[_0xf75c('0x1d')](_0x2c5ba5[_0xf75c('0x36')][_0xf75c('0x1d')]);}_0x16e841[_0xf75c('0x3d')]=qs[_0xf75c('0x3e')](_0x2c5ba5[_0xf75c('0x36')][_0xf75c('0x3e')]);_0x16e841['where']=qs['filters'](_['pick'](_0x2c5ba5['query'],_0x225a3f[_0xf75c('0x37')]),_0x127fcc);if(_0x2c5ba5[_0xf75c('0x36')][_0xf75c('0x3f')]){_0x16e841[_0xf75c('0x40')]=_[_0xf75c('0x41')](_0x16e841[_0xf75c('0x40')],{'$or':_[_0xf75c('0x2f')](_0x127fcc,function(_0x110753){if(_0x110753['type']!=='VIRTUAL'){var _0x59e831={};_0x59e831[_0x110753[_0xf75c('0x2c')]]={'$like':'%'+_0x2c5ba5['query'][_0xf75c('0x3f')]+'%'};return _0x59e831;}})});}_0x16e841=_['merge']({},_0x16e841,_0x2c5ba5[_0xf75c('0x42')]);var _0x29d926={'where':_0x16e841[_0xf75c('0x40')]};return db[_0xf75c('0x30')]['count'](_0x29d926)['then'](function(_0x14d5cb){_0x299476[_0xf75c('0x20')]=_0x14d5cb;if(_0x2c5ba5[_0xf75c('0x36')][_0xf75c('0x43')]){_0x16e841[_0xf75c('0x44')]=[{'all':!![]}];}return db[_0xf75c('0x30')][_0xf75c('0x45')](_0x16e841);})[_0xf75c('0x27')](function(_0x2fe683){_0x299476['rows']=_0x2fe683;return _0x299476;})['then'](respondWithFilteredResult(_0x46d6b1,_0x16e841))[_0xf75c('0x46')](handleError(_0x46d6b1,null));};exports['show']=function(_0x19f661,_0x4e3890){var _0x20d1cf={'raw':!![],'where':{'id':_0x19f661[_0xf75c('0x47')]['id']}},_0x9099={};_0x9099[_0xf75c('0x34')]=_[_0xf75c('0x35')](db['VoiceTransferReport']['rawAttributes']);_0x9099[_0xf75c('0x36')]=_[_0xf75c('0x35')](_0x19f661[_0xf75c('0x36')]);_0x9099[_0xf75c('0x37')]=_['intersection'](_0x9099['model'],_0x9099[_0xf75c('0x36')]);_0x20d1cf[_0xf75c('0x3a')]=_['intersection'](_0x9099[_0xf75c('0x34')],qs[_0xf75c('0x39')](_0x19f661[_0xf75c('0x36')][_0xf75c('0x39')]));_0x20d1cf[_0xf75c('0x3a')]=_0x20d1cf[_0xf75c('0x3a')]['length']?_0x20d1cf[_0xf75c('0x3a')]:_0x9099[_0xf75c('0x34')];if(_0x19f661['query']['includeAll']){_0x20d1cf[_0xf75c('0x44')]=[{'all':!![]}];}_0x20d1cf=_['merge']({},_0x20d1cf,_0x19f661['options']);return db[_0xf75c('0x30')][_0xf75c('0x48')](_0x20d1cf)[_0xf75c('0x27')](handleEntityNotFound(_0x4e3890,null))[_0xf75c('0x27')](respondWithResult(_0x4e3890,null))['catch'](handleError(_0x4e3890,null));};exports[_0xf75c('0x49')]=function(_0x577cf6,_0x46c8af){return db[_0xf75c('0x30')][_0xf75c('0x49')](_0x577cf6[_0xf75c('0x4a')],{})[_0xf75c('0x27')](respondWithResult(_0x46c8af,0xc9))['catch'](handleError(_0x46c8af,null));};exports[_0xf75c('0x26')]=function(_0x5d26f8,_0x2b2210){if(_0x5d26f8[_0xf75c('0x4a')]['id']){delete _0x5d26f8['body']['id'];}return db[_0xf75c('0x30')][_0xf75c('0x48')]({'where':{'id':_0x5d26f8['params']['id']}})[_0xf75c('0x27')](handleEntityNotFound(_0x2b2210,null))['then'](saveUpdates(_0x5d26f8['body'],null))['then'](respondWithResult(_0x2b2210,null))[_0xf75c('0x46')](handleError(_0x2b2210,null));};exports[_0xf75c('0x28')]=function(_0x4029bb,_0x1bd06e){return db[_0xf75c('0x30')]['find']({'where':{'id':_0x4029bb[_0xf75c('0x47')]['id']}})[_0xf75c('0x27')](handleEntityNotFound(_0x1bd06e,null))[_0xf75c('0x27')](removeEntity(_0x1bd06e,null))[_0xf75c('0x46')](handleError(_0x1bd06e,null));};exports['describe']=function(_0x5c01ce,_0x243a47){return db['VoiceTransferReport'][_0xf75c('0x4b')]()['then'](respondWithResult(_0x243a47,null))[_0xf75c('0x46')](handleError(_0x243a47,null));}; \ No newline at end of file +var _0xa984=['VIRTUAL','VoiceTransferReport','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge'];(function(_0x547c57,_0x5b52bb){var _0x3dc551=function(_0x3815d7){while(--_0x3815d7){_0x547c57['push'](_0x547c57['shift']());}};_0x3dc551(++_0x5b52bb);}(_0xa984,0xf0));var _0x4a98=function(_0x2b7806,_0x3b0257){_0x2b7806=_0x2b7806-0x0;var _0x162485=_0xa984[_0x2b7806];return _0x162485;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a98('0x0'));var zipdir=require(_0x4a98('0x1'));var jsonpatch=require(_0x4a98('0x2'));var rp=require(_0x4a98('0x3'));var moment=require(_0x4a98('0x4'));var BPromise=require(_0x4a98('0x5'));var Mustache=require(_0x4a98('0x6'));var util=require('util');var path=require(_0x4a98('0x7'));var sox=require(_0x4a98('0x8'));var csv=require(_0x4a98('0x9'));var ejs=require(_0x4a98('0xa'));var fs=require('fs');var fs_extra=require(_0x4a98('0xb'));var _=require('lodash');var squel=require(_0x4a98('0xc'));var crypto=require(_0x4a98('0xd'));var jsforce=require(_0x4a98('0xe'));var deskjs=require(_0x4a98('0xf'));var toCsv=require(_0x4a98('0x9'));var querystring=require(_0x4a98('0x10'));var Papa=require('papaparse');var Redis=require(_0x4a98('0x11'));var authService=require(_0x4a98('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4a98('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a98('0x14'));var utils=require('../../config/utils');var config=require(_0x4a98('0x15'));var licenseUtil=require(_0x4a98('0x16'));var db=require(_0x4a98('0x17'))['db'];function respondWithStatusCode(_0x5d5360,_0x13b11f){_0x13b11f=_0x13b11f||0xcc;return function(_0x149d8d){if(_0x149d8d){return _0x5d5360['sendStatus'](_0x13b11f);}return _0x5d5360[_0x4a98('0x18')](_0x13b11f)[_0x4a98('0x19')]();};}function respondWithResult(_0x4db43f,_0xc87c43){_0xc87c43=_0xc87c43||0xc8;return function(_0x44eb9c){if(_0x44eb9c){return _0x4db43f['status'](_0xc87c43)[_0x4a98('0x1a')](_0x44eb9c);}};}function respondWithFilteredResult(_0x2408fa,_0x4c00a6){return function(_0x463d72){if(_0x463d72){var _0x2d335e=typeof _0x4c00a6[_0x4a98('0x1b')]===_0x4a98('0x1c')&&typeof _0x4c00a6[_0x4a98('0x1d')]===_0x4a98('0x1c');var _0x41c765=_0x463d72['count'];var _0x3d0c39=_0x2d335e?0x0:_0x4c00a6[_0x4a98('0x1b')];var _0x46baa0=_0x2d335e?_0x463d72[_0x4a98('0x1e')]:_0x4c00a6[_0x4a98('0x1b')]+_0x4c00a6[_0x4a98('0x1d')];var _0x55ea92;if(_0x46baa0>=_0x41c765){_0x46baa0=_0x41c765;_0x55ea92=0xc8;}else{_0x55ea92=0xce;}_0x2408fa[_0x4a98('0x18')](_0x55ea92);return _0x2408fa[_0x4a98('0x1f')](_0x4a98('0x20'),_0x3d0c39+'-'+_0x46baa0+'/'+_0x41c765)[_0x4a98('0x1a')](_0x463d72);}return null;};}function patchUpdates(_0x17949e){return function(_0x3d42af){try{jsonpatch[_0x4a98('0x21')](_0x3d42af,_0x17949e,!![]);}catch(_0x227d72){return BPromise[_0x4a98('0x22')](_0x227d72);}return _0x3d42af['save']();};}function saveUpdates(_0x11b8a5,_0x3db4df){return function(_0x405de7){if(_0x405de7){return _0x405de7[_0x4a98('0x23')](_0x11b8a5)[_0x4a98('0x24')](function(_0x7eadf1){return _0x7eadf1;});}return null;};}function removeEntity(_0x5b79ef,_0x4172c9){return function(_0x32d2f3){if(_0x32d2f3){return _0x32d2f3['destroy']()['then'](function(){_0x5b79ef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f1d4d,_0x2bc800){return function(_0x48707){if(!_0x48707){_0x5f1d4d[_0x4a98('0x25')](0x194);}return _0x48707;};}function handleError(_0x1f1489,_0xf3d37d){_0xf3d37d=_0xf3d37d||0x1f4;return function(_0x2a6ce3){logger['error'](_0x2a6ce3[_0x4a98('0x26')]);if(_0x2a6ce3['name']){delete _0x2a6ce3[_0x4a98('0x27')];}_0x1f1489['status'](_0xf3d37d)[_0x4a98('0x28')](_0x2a6ce3);};}exports[_0x4a98('0x29')]=function(_0x652380,_0x57bb2e){var _0x124cf7={},_0x5b28cd={},_0x4438df={'count':0x0,'rows':[]};var _0x322783=_[_0x4a98('0x2a')](db['VoiceTransferReport'][_0x4a98('0x2b')],function(_0x5c792e){return{'name':_0x5c792e[_0x4a98('0x2c')],'type':_0x5c792e[_0x4a98('0x2d')]['key']};});_0x5b28cd[_0x4a98('0x2e')]=_[_0x4a98('0x2a')](_0x322783,'name');_0x5b28cd[_0x4a98('0x2f')]=_[_0x4a98('0x30')](_0x652380[_0x4a98('0x2f')]);_0x5b28cd['filters']=_['intersection'](_0x5b28cd['model'],_0x5b28cd[_0x4a98('0x2f')]);_0x124cf7[_0x4a98('0x31')]=_[_0x4a98('0x32')](_0x5b28cd[_0x4a98('0x2e')],qs['fields'](_0x652380[_0x4a98('0x2f')]['fields']));_0x124cf7['attributes']=_0x124cf7['attributes'][_0x4a98('0x33')]?_0x124cf7[_0x4a98('0x31')]:_0x5b28cd[_0x4a98('0x2e')];if(!_0x652380[_0x4a98('0x2f')][_0x4a98('0x34')](_0x4a98('0x35'))){_0x124cf7[_0x4a98('0x1d')]=qs[_0x4a98('0x1d')](_0x652380['query'][_0x4a98('0x1d')]);_0x124cf7[_0x4a98('0x1b')]=qs[_0x4a98('0x1b')](_0x652380[_0x4a98('0x2f')][_0x4a98('0x1b')]);}_0x124cf7[_0x4a98('0x36')]=qs['sort'](_0x652380[_0x4a98('0x2f')]['sort']);_0x124cf7['where']=qs[_0x4a98('0x37')](_[_0x4a98('0x38')](_0x652380['query'],_0x5b28cd[_0x4a98('0x37')]),_0x322783);if(_0x652380[_0x4a98('0x2f')][_0x4a98('0x39')]){_0x124cf7[_0x4a98('0x3a')]=_[_0x4a98('0x3b')](_0x124cf7[_0x4a98('0x3a')],{'$or':_[_0x4a98('0x2a')](_0x322783,function(_0x4ea21c){if(_0x4ea21c[_0x4a98('0x2d')]!==_0x4a98('0x3c')){var _0x3614c0={};_0x3614c0[_0x4ea21c[_0x4a98('0x27')]]={'$like':'%'+_0x652380[_0x4a98('0x2f')]['filter']+'%'};return _0x3614c0;}})});}_0x124cf7=_[_0x4a98('0x3b')]({},_0x124cf7,_0x652380['options']);var _0x321caf={'where':_0x124cf7['where']};return db[_0x4a98('0x3d')][_0x4a98('0x1e')](_0x321caf)[_0x4a98('0x24')](function(_0x3b0b2b){_0x4438df[_0x4a98('0x1e')]=_0x3b0b2b;if(_0x652380[_0x4a98('0x2f')]['includeAll']){_0x124cf7[_0x4a98('0x3e')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x4a98('0x3f')](_0x124cf7);})['then'](function(_0x828ade){_0x4438df[_0x4a98('0x40')]=_0x828ade;return _0x4438df;})['then'](respondWithFilteredResult(_0x57bb2e,_0x124cf7))[_0x4a98('0x41')](handleError(_0x57bb2e,null));};exports[_0x4a98('0x42')]=function(_0x3bb215,_0x2f4bed){var _0x20364d={'raw':!![],'where':{'id':_0x3bb215['params']['id']}},_0x3e7f3c={};_0x3e7f3c[_0x4a98('0x2e')]=_['keys'](db[_0x4a98('0x3d')][_0x4a98('0x2b')]);_0x3e7f3c['query']=_[_0x4a98('0x30')](_0x3bb215['query']);_0x3e7f3c[_0x4a98('0x37')]=_[_0x4a98('0x32')](_0x3e7f3c[_0x4a98('0x2e')],_0x3e7f3c[_0x4a98('0x2f')]);_0x20364d[_0x4a98('0x31')]=_['intersection'](_0x3e7f3c[_0x4a98('0x2e')],qs[_0x4a98('0x43')](_0x3bb215[_0x4a98('0x2f')]['fields']));_0x20364d[_0x4a98('0x31')]=_0x20364d[_0x4a98('0x31')][_0x4a98('0x33')]?_0x20364d['attributes']:_0x3e7f3c[_0x4a98('0x2e')];if(_0x3bb215[_0x4a98('0x2f')][_0x4a98('0x44')]){_0x20364d[_0x4a98('0x3e')]=[{'all':!![]}];}_0x20364d=_[_0x4a98('0x3b')]({},_0x20364d,_0x3bb215['options']);return db[_0x4a98('0x3d')][_0x4a98('0x45')](_0x20364d)['then'](handleEntityNotFound(_0x2f4bed,null))[_0x4a98('0x24')](respondWithResult(_0x2f4bed,null))[_0x4a98('0x41')](handleError(_0x2f4bed,null));};exports[_0x4a98('0x46')]=function(_0x412bc6,_0x4efd64){return db[_0x4a98('0x3d')]['create'](_0x412bc6['body'],{})[_0x4a98('0x24')](respondWithResult(_0x4efd64,0xc9))[_0x4a98('0x41')](handleError(_0x4efd64,null));};exports[_0x4a98('0x23')]=function(_0x34ca45,_0x31e9a4){if(_0x34ca45[_0x4a98('0x47')]['id']){delete _0x34ca45['body']['id'];}return db['VoiceTransferReport'][_0x4a98('0x45')]({'where':{'id':_0x34ca45[_0x4a98('0x48')]['id']}})[_0x4a98('0x24')](handleEntityNotFound(_0x31e9a4,null))['then'](saveUpdates(_0x34ca45[_0x4a98('0x47')],null))[_0x4a98('0x24')](respondWithResult(_0x31e9a4,null))[_0x4a98('0x41')](handleError(_0x31e9a4,null));};exports[_0x4a98('0x49')]=function(_0x96022b,_0x12f746){return db['VoiceTransferReport']['find']({'where':{'id':_0x96022b[_0x4a98('0x48')]['id']}})[_0x4a98('0x24')](handleEntityNotFound(_0x12f746,null))['then'](removeEntity(_0x12f746,null))['catch'](handleError(_0x12f746,null));};exports[_0x4a98('0x4a')]=function(_0x473ea1,_0x311077){return db['VoiceTransferReport'][_0x4a98('0x4a')]()[_0x4a98('0x24')](respondWithResult(_0x311077,null))[_0x4a98('0x41')](handleError(_0x311077,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index d2d50d5..6e5fbde 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 _0x2b66=['VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x2b66,0x15e));var _0x62b6=function(_0x31ea51,_0x58c5f2){_0x31ea51=_0x31ea51-0x0;var _0x30f82b=_0x2b66[_0x31ea51];return _0x30f82b;};'use strict';var _=require(_0x62b6('0x0'));var util=require(_0x62b6('0x1'));var logger=require(_0x62b6('0x2'))('api');var moment=require(_0x62b6('0x3'));var BPromise=require(_0x62b6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62b6('0x5'));var rimraf=require(_0x62b6('0x6'));var config=require(_0x62b6('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x62b6('0x8')]=function(_0x4a898a,_0x55da2c){return _0x4a898a[_0x62b6('0x9')](_0x62b6('0xa'),attributes,{'tableName':_0x62b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed46=['request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x29492d,_0x4152e9){var _0x2b9592=function(_0x4cdd06){while(--_0x4cdd06){_0x29492d['push'](_0x29492d['shift']());}};_0x2b9592(++_0x4152e9);}(_0xed46,0x1ce));var _0x6ed4=function(_0x43d604,_0x38a6d3){_0x43d604=_0x43d604-0x0;var _0x2f0f74=_0xed46[_0x43d604];return _0x2f0f74;};'use strict';var _=require(_0x6ed4('0x0'));var util=require(_0x6ed4('0x1'));var logger=require(_0x6ed4('0x2'))(_0x6ed4('0x3'));var moment=require(_0x6ed4('0x4'));var BPromise=require(_0x6ed4('0x5'));var rp=require(_0x6ed4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ed4('0x7'));var config=require(_0x6ed4('0x8'));var attributes=require(_0x6ed4('0x9'));module[_0x6ed4('0xa')]=function(_0x14bad4,_0x282d82){return _0x14bad4[_0x6ed4('0xb')]('VoiceTransferReport',attributes,{'tableName':_0x6ed4('0xc'),'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 acbc63e..79f69b3 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 _0xcfe7=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xcfe7,0x158));var _0x7cfe=function(_0x3163bf,_0x17eee9){_0x3163bf=_0x3163bf-0x0;var _0x173775=_0xcfe7[_0x3163bf];return _0x173775;};'use strict';var _=require('lodash');var util=require(_0x7cfe('0x0'));var moment=require(_0x7cfe('0x1'));var BPromise=require(_0x7cfe('0x2'));var rs=require(_0x7cfe('0x3'));var fs=require('fs');var Redis=require(_0x7cfe('0x4'));var db=require(_0x7cfe('0x5'))['db'];var utils=require(_0x7cfe('0x6'));var logger=require(_0x7cfe('0x7'))(_0x7cfe('0x8'));var config=require(_0x7cfe('0x9'));var jayson=require(_0x7cfe('0xa'));var client=jayson[_0x7cfe('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x309a08,_0x4aadb5,_0x7d4666){return new BPromise(function(_0x22d549,_0x5c54c2){return client[_0x7cfe('0xc')](_0x309a08,_0x7d4666)['then'](function(_0x2bbcbb){logger[_0x7cfe('0xd')](_0x7cfe('0xe'),_0x4aadb5,_0x7cfe('0xf'));logger[_0x7cfe('0x10')](_0x7cfe('0x11'),_0x4aadb5,_0x7cfe('0xf'),JSON[_0x7cfe('0x12')](_0x2bbcbb));if(_0x2bbcbb[_0x7cfe('0x13')]){if(_0x2bbcbb['error'][_0x7cfe('0x14')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x4aadb5,_0x2bbcbb['error'][_0x7cfe('0x15')]);return _0x5c54c2(_0x2bbcbb['error']['message']);}logger[_0x7cfe('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x4aadb5,_0x2bbcbb[_0x7cfe('0x13')][_0x7cfe('0x15')]);return _0x22d549(_0x2bbcbb[_0x7cfe('0x13')]['message']);}else{logger[_0x7cfe('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x4aadb5,_0x7cfe('0xf'));_0x22d549(_0x2bbcbb[_0x7cfe('0x16')][_0x7cfe('0x15')]);}})[_0x7cfe('0x17')](function(_0xd48f24){logger[_0x7cfe('0x13')](_0x7cfe('0xe'),_0x4aadb5,_0xd48f24);_0x5c54c2(_0xd48f24);});});}exports[_0x7cfe('0x18')]=function(_0x571adf){var _0x4cba73=this;return new Promise(function(_0x2de8cd,_0x3e9613){return db[_0x7cfe('0x19')]['create'](_0x571adf[_0x7cfe('0x1a')],{'raw':_0x571adf[_0x7cfe('0x1b')]?_0x571adf[_0x7cfe('0x1b')][_0x7cfe('0x1c')]===undefined?!![]:![]:!![]})[_0x7cfe('0x1d')](function(_0x3264ad){logger[_0x7cfe('0xd')]('CreateVoiceTransferReport',_0x571adf);logger[_0x7cfe('0x10')]('CreateVoiceTransferReport',_0x571adf,JSON[_0x7cfe('0x12')](_0x3264ad));_0x2de8cd(_0x3264ad);})['catch'](function(_0x145289){logger[_0x7cfe('0x13')]('CreateVoiceTransferReport',_0x145289[_0x7cfe('0x15')],_0x571adf);_0x3e9613(_0x4cba73[_0x7cfe('0x13')](0x1f4,_0x145289['message']));});});}; \ No newline at end of file +var _0xeec1=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','VoiceTransferReport','body','options','then','CreateVoiceTransferReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0xeec1,0xd7));var _0x1eec=function(_0x5ce6f1,_0x23d85b){_0x5ce6f1=_0x5ce6f1-0x0;var _0x3e70f6=_0xeec1[_0x5ce6f1];return _0x3e70f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1eec('0x0'));var rs=require(_0x1eec('0x1'));var fs=require('fs');var Redis=require(_0x1eec('0x2'));var db=require(_0x1eec('0x3'))['db'];var utils=require(_0x1eec('0x4'));var logger=require('../../config/logger')(_0x1eec('0x5'));var config=require('../../config/environment');var jayson=require(_0x1eec('0x6'));var client=jayson['client'][_0x1eec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2ca0,_0x50ddb4,_0x4f6bb3){return new BPromise(function(_0x1ee530,_0x34c400){return client[_0x1eec('0x8')](_0x5e2ca0,_0x4f6bb3)['then'](function(_0x4b4117){logger['info'](_0x1eec('0x9'),_0x50ddb4,'request\x20sent');logger[_0x1eec('0xa')](_0x1eec('0xb'),_0x50ddb4,'request\x20sent',JSON[_0x1eec('0xc')](_0x4b4117));if(_0x4b4117[_0x1eec('0xd')]){if(_0x4b4117['error'][_0x1eec('0xe')]===0x1f4){logger['error'](_0x1eec('0x9'),_0x50ddb4,_0x4b4117[_0x1eec('0xd')][_0x1eec('0xf')]);return _0x34c400(_0x4b4117[_0x1eec('0xd')][_0x1eec('0xf')]);}logger[_0x1eec('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x50ddb4,_0x4b4117['error'][_0x1eec('0xf')]);return _0x1ee530(_0x4b4117['error'][_0x1eec('0xf')]);}else{logger[_0x1eec('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x50ddb4,_0x1eec('0x11'));_0x1ee530(_0x4b4117[_0x1eec('0x12')][_0x1eec('0xf')]);}})[_0x1eec('0x13')](function(_0x1c9d07){logger[_0x1eec('0xd')](_0x1eec('0x9'),_0x50ddb4,_0x1c9d07);_0x34c400(_0x1c9d07);});});}exports['CreateVoiceTransferReport']=function(_0x2468fa){var _0x495ebe=this;return new Promise(function(_0x4d0df1,_0x41a4e1){return db[_0x1eec('0x14')]['create'](_0x2468fa[_0x1eec('0x15')],{'raw':_0x2468fa[_0x1eec('0x16')]?_0x2468fa[_0x1eec('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x1eec('0x17')](function(_0x1cd4a9){logger[_0x1eec('0x10')](_0x1eec('0x18'),_0x2468fa);logger[_0x1eec('0xa')]('CreateVoiceTransferReport',_0x2468fa,JSON[_0x1eec('0xc')](_0x1cd4a9));_0x4d0df1(_0x1cd4a9);})[_0x1eec('0x13')](function(_0x3b8f0d){logger[_0x1eec('0xd')](_0x1eec('0x18'),_0x3b8f0d[_0x1eec('0xf')],_0x2468fa);_0x41a4e1(_0x495ebe[_0x1eec('0xd')](0x1f4,_0x3b8f0d[_0x1eec('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ed390ac..9e11ff0 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 _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0xffb922,_0x5c722a){var _0x1b5770=function(_0x381ce5){while(--_0x381ce5){_0xffb922['push'](_0xffb922['shift']());}};_0x1b5770(++_0x5c722a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file +var _0xcb91=['/unhold','unhold','/calls','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','isAuthenticated','hangup','hold'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xcb91[_0x455c6c];return _0x488242;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1cb9('0x0'));var controller=require(_0x1cb9('0x1'));router[_0x1cb9('0x2')](_0x1cb9('0x3'),auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x5')]);router['post'](_0x1cb9('0x6'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x2')]('/answer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['answer']);router[_0x1cb9('0x2')]('/hold',auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x2')](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x2')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['calls']);router['post']('/transfer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0xd')]);module[_0x1cb9('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 8ffe95d..851eceb 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 _0x57d4=['filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','catch','hangup\x20fired:','json','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','webbar:conference','conference\x20executed!','transfer','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','log','handleError:','stack','status','send','name','NotFound','request','error','code','message','result','findOne','agent','then','VoiceChannels'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0x57d4,0x78));var _0x457d=function(_0x360e92,_0x39c73e){_0x360e92=_0x360e92-0x0;var _0x28a4cb=_0x57d4[_0x360e92];return _0x28a4cb;};'use strict';var path=require(_0x457d('0x0'));var fs=require('fs');var _=require(_0x457d('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x457d('0x2'));var util=require(_0x457d('0x3'));var BPromise=require(_0x457d('0x4'));var jayson=require(_0x457d('0x5'));var amiClient=jayson[_0x457d('0x6')][_0x457d('0x7')]({'port':0x232a});var logger=require(_0x457d('0x8'))(_0x457d('0x9'));var Redis=require(_0x457d('0xa'));config[_0x457d('0xb')]=_[_0x457d('0xc')](config['redis'],{'host':_0x457d('0xd'),'port':0x18eb});var io=require(_0x457d('0xe'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'callNumber':{'type':_0x457d('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'sessionId':{'type':_0x457d('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'sessionId':{'type':_0x457d('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'sessionId':{'type':_0x457d('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x457d('0x11'),'required':[!![],_0x457d('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x457d('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]},'sessionId':{'type':_0x457d('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x457d('0xf'),'required':[!![],_0x457d('0x10')]}});function emit(_0x55c6e4,_0xc9b3f8,_0x1ebc33){logger[_0x457d('0x13')](_0x55c6e4,_0xc9b3f8,JSON['stringify'](_0x1ebc33));io['to'](_0x55c6e4)['emit'](_0xc9b3f8,_0x1ebc33);}function handleError(_0xc0751f){return function(_0x4d988f){console[_0x457d('0x14')](_0x457d('0x15'),_0x4d988f,_0x4d988f instanceof RangeError);logger['error'](_0x4d988f[_0x457d('0x16')]);if(_0x4d988f instanceof RangeError){if(_0x4d988f['name']){delete _0x4d988f['name'];}_0xc0751f[_0x457d('0x17')](0x194)[_0x457d('0x18')](_0x4d988f);}else{if(_0x4d988f[_0x457d('0x19')]){delete _0x4d988f[_0x457d('0x19')];}_0xc0751f[_0x457d('0x17')](0x1f4)[_0x457d('0x18')](_0x4d988f);}};}function checkError(){return function(_0x1cc0ba){if(!_0x1cc0ba){throw new RangeError(_0x457d('0x1a'));}return _0x1cc0ba;};}function respondWithRpcPromise(_0x2087a5,_0x46fe6a){return new BPromise(function(_0x57f229,_0x4bf90d){var _0x4e2dff=amiClient;return _0x4e2dff[_0x457d('0x1b')](_0x2087a5,_0x46fe6a)['then'](function(_0x5177cf){if(_0x5177cf['error']){if(_0x5177cf[_0x457d('0x1c')][_0x457d('0x1d')]===0x1f4){return _0x4bf90d(_0x5177cf['error'][_0x457d('0x1e')]);}return _0x57f229(_0x5177cf[_0x457d('0x1c')][_0x457d('0x1e')]);}else{_0x57f229(_0x5177cf[_0x457d('0x1f')]);}})['catch'](function(_0x5d6554){_0x4bf90d(_0x5d6554);});});}function getAgent(_0x556a8){return db['User'][_0x457d('0x20')]({'where':{'id':_0x556a8,'role':_0x457d('0x21')}})[_0x457d('0x22')](checkError());}function getAgentCheckSession(_0x1bc311,_0x54de66){return new BPromise(function(_0x298dd4,_0x57a47f){var _0x4eb5ca=respondWithRpcPromise(_0x457d('0x23'));var _0x3f696d=getAgent(_0x1bc311);Promise['all']([_0x4eb5ca,_0x3f696d])[_0x457d('0x22')](function(_0x2d69d2){var _0x5b5b31=_0x2d69d2[0x0];var _0xec380b=_0x2d69d2[0x1];var _0x41f012=_[_0x457d('0x24')](_0x5b5b31[_0x457d('0x25')],function(_0x381a9d){return _0x381a9d[_0x457d('0x26')]==_0xec380b['id']&&_0x381a9d[_0x457d('0x27')]==_0x54de66;});if(_0x41f012[_0x457d('0x28')]==0x1){_0x298dd4(_0xec380b);}else{_0x57a47f(new RangeError(_0x457d('0x29')+_0x54de66+_0x457d('0x2a')));}});});}exports[_0x457d('0x2b')]=function(_0x5782ce,_0xf668ff){logger[_0x457d('0x13')](_0x457d('0x2c'),_0x5782ce[_0x457d('0x2d')]);var _0xf8b8dc=originateValidation[_0x457d('0x2e')](_0x5782ce['body']);if(_0xf8b8dc[_0x457d('0x28')]>0x0){return _0xf668ff[_0x457d('0x17')](0x190)['json'](_0xf8b8dc);}var _0x47b7e8=_0x5782ce[_0x457d('0x2d')][_0x457d('0x2f')];var _0x5b4622=_0x5782ce[_0x457d('0x2d')][_0x457d('0x30')];var _0x1acf15=_0x5782ce[_0x457d('0x2d')][_0x457d('0x31')];var _0x36a90b=_0x5782ce[_0x457d('0x2d')][_0x457d('0x32')];return getAgent(_0x47b7e8)[_0x457d('0x22')](function(_0xde9836){logger[_0x457d('0x13')](_0x457d('0x33'),_0xde9836[_0x457d('0x19')]);emit(util[_0x457d('0x34')](_0x457d('0x35'),_0xde9836['name']),_0x457d('0x36'),{'callNumber':_0x5b4622,'callerId':_0x1acf15,'callbackUrl':_0x36a90b});return _0xf668ff['status'](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x457d('0x37')](handleError(_0xf668ff));};exports['hangup']=function(_0x18ed88,_0x55e580){logger['info'](_0x457d('0x38'),_0x18ed88[_0x457d('0x2d')]);var _0x2618f4=hangupValidation[_0x457d('0x2e')](_0x18ed88[_0x457d('0x2d')]);if(_0x2618f4[_0x457d('0x28')]>0x0){return _0x55e580[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x2618f4);}var _0x41a4a3=_0x18ed88[_0x457d('0x2d')][_0x457d('0x2f')];var _0x160755=_0x18ed88[_0x457d('0x2d')][_0x457d('0x27')];return getAgent(_0x41a4a3)[_0x457d('0x22')](function(_0x1bbd9d){logger[_0x457d('0x13')]('entityFound:',_0x1bbd9d[_0x457d('0x19')]);emit(util['format'](_0x457d('0x35'),_0x1bbd9d[_0x457d('0x19')]),_0x457d('0x3a'),{'sessionId':_0x160755});return _0x55e580[_0x457d('0x17')](0xc8)[_0x457d('0x39')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x55e580));};exports[_0x457d('0x3b')]=function(_0x4f7bad,_0x2db2ca){logger[_0x457d('0x13')](_0x457d('0x3c'),_0x4f7bad['body']);var _0x73e45d=answerValidation[_0x457d('0x2e')](_0x4f7bad[_0x457d('0x2d')]);if(_0x73e45d[_0x457d('0x28')]>0x0){return _0x2db2ca[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x73e45d);}var _0x34fdc0=_0x4f7bad[_0x457d('0x2d')][_0x457d('0x2f')];var _0x4a9896=_0x4f7bad['body'][_0x457d('0x27')];return getAgent(_0x34fdc0)[_0x457d('0x22')](function(_0x3bfce4){logger[_0x457d('0x13')](_0x457d('0x33'),_0x3bfce4[_0x457d('0x19')]);emit(util['format'](_0x457d('0x35'),_0x3bfce4[_0x457d('0x19')]),_0x457d('0x3d'),{'sessionId':_0x4a9896});return _0x2db2ca['status'](0xc8)[_0x457d('0x39')]({'error':![],'message':_0x457d('0x3e')});})[_0x457d('0x37')](handleError(_0x2db2ca));};exports['hold']=function(_0x1b8072,_0x57b0a5){logger[_0x457d('0x13')](_0x457d('0x3f'),_0x1b8072['body']);var _0xdc984c=holdValidation[_0x457d('0x2e')](_0x1b8072[_0x457d('0x2d')]);if(_0xdc984c[_0x457d('0x28')]>0x0){return _0x57b0a5[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0xdc984c);}var _0x13787f=_0x1b8072[_0x457d('0x2d')][_0x457d('0x2f')];var _0x15ae26=_0x1b8072['body'][_0x457d('0x27')];return getAgent(_0x13787f)[_0x457d('0x22')](function(_0x7abdf1){logger[_0x457d('0x13')]('entityFound:',_0x7abdf1[_0x457d('0x19')]);emit(util[_0x457d('0x34')](_0x457d('0x35'),_0x7abdf1[_0x457d('0x19')]),_0x457d('0x40'),{'sessionId':_0x15ae26});return _0x57b0a5[_0x457d('0x17')](0xc8)[_0x457d('0x39')]({'error':![],'message':_0x457d('0x41')});})['catch'](handleError(_0x57b0a5));};exports['unhold']=function(_0xec7449,_0x3e31cb){logger[_0x457d('0x13')](_0x457d('0x42'),_0xec7449[_0x457d('0x2d')]);var _0x10610a=unholdValidation[_0x457d('0x2e')](_0xec7449[_0x457d('0x2d')]);if(_0x10610a[_0x457d('0x28')]>0x0){return _0x3e31cb[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x10610a);}var _0x101afc=_0xec7449[_0x457d('0x2d')][_0x457d('0x2f')];var _0x4fe2f3=_0xec7449[_0x457d('0x2d')][_0x457d('0x27')];return getAgent(_0x101afc)[_0x457d('0x22')](function(_0x379a09){logger['info'](_0x457d('0x33'),_0x379a09[_0x457d('0x19')]);emit(util['format'](_0x457d('0x35'),_0x379a09[_0x457d('0x19')]),_0x457d('0x43'),{'sessionId':_0x4fe2f3});return _0x3e31cb['status'](0xc8)['json']({'error':![],'message':_0x457d('0x44')});})['catch'](handleError(_0x3e31cb));};exports[_0x457d('0x45')]=function(_0x3daf2c,_0xbed708){logger[_0x457d('0x13')](_0x457d('0x46'),_0xbed708[_0x457d('0x2d')]);var _0x2485bd=callsValidation[_0x457d('0x2e')](_0x3daf2c[_0x457d('0x2d')]);if(_0x2485bd[_0x457d('0x28')]>0x0){return _0xbed708[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x2485bd);}var _0x1d661e=_0x3daf2c[_0x457d('0x2d')]['userId'];var _0x2969b4=respondWithRpcPromise(_0x457d('0x23'));var _0x4e865a=getAgent(_0x1d661e);return Promise[_0x457d('0x47')]([_0x2969b4,_0x4e865a])['then'](function(_0x125f6f){var _0x1bec33=_0x125f6f[0x0];var _0x57a690=_0x125f6f[0x1];var _0x5ca847=_[_0x457d('0x24')](_0x1bec33[_0x457d('0x25')],function(_0x56de45){return _0x56de45['UserId']==_0x57a690['id'];});return _0xbed708[_0x457d('0x17')](0xc8)['json']({'count':_0x5ca847[_0x457d('0x28')],'rows':_0x5ca847});})['catch'](handleError(_0xbed708));};exports[_0x457d('0x48')]=function(_0x4786c4,_0x5a6d2d){logger[_0x457d('0x13')]('conference\x20fired:',_0x4786c4['body']);var _0x55ab65=conferenceValidation[_0x457d('0x2e')](_0x4786c4[_0x457d('0x2d')]);if(_0x55ab65['length']>0x0){return _0x5a6d2d[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x55ab65);}var _0x43dc83=_0x4786c4[_0x457d('0x2d')][_0x457d('0x2f')];return getAgent(_0x43dc83)[_0x457d('0x22')](function(_0x3c9a87){logger[_0x457d('0x13')](_0x457d('0x33'),_0x3c9a87['name']);emit(util['format'](_0x457d('0x35'),_0x3c9a87[_0x457d('0x19')]),_0x457d('0x49'));return _0x5a6d2d[_0x457d('0x17')](0xc8)[_0x457d('0x39')]({'error':![],'message':_0x457d('0x4a')});})[_0x457d('0x37')](handleError(_0x5a6d2d));};exports[_0x457d('0x4b')]=function(_0x1931e3,_0x270086){logger['info']('transfer\x20fired:',_0x1931e3[_0x457d('0x2d')]);var _0x4dc307=transferValidation[_0x457d('0x2e')](_0x1931e3['body']);if(_0x4dc307[_0x457d('0x28')]>0x0){return _0x270086[_0x457d('0x17')](0x190)[_0x457d('0x39')](_0x4dc307);}var _0x54a1e4=_0x1931e3['body'][_0x457d('0x2f')];var _0x155a2a=_0x1931e3['body']['sessionId'];var _0x1fd860=_0x1931e3[_0x457d('0x2d')]['transferNumber'];return getAgent(_0x54a1e4)[_0x457d('0x22')](function(_0x270cd5){logger[_0x457d('0x13')](_0x457d('0x33'),_0x270cd5['name']);emit(util[_0x457d('0x34')](_0x457d('0x35'),_0x270cd5[_0x457d('0x19')]),_0x457d('0x4c'),{'sessionId':_0x155a2a,'transferNumber':_0x1fd860});return _0x270086[_0x457d('0x17')](0xc8)['json']({'error':![],'message':_0x457d('0x4d')});})[_0x457d('0x37')](handleError(_0x270086));}; \ No newline at end of file +var _0x24cf=['userId','callbackUrl','entityFound:','format','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','user:%s','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','all','filter','UserId','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','ioredis','localhost','redis','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','agent','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json'];(function(_0x6f16b9,_0x91743){var _0xdccdaa=function(_0x951aa3){while(--_0x951aa3){_0x6f16b9['push'](_0x6f16b9['shift']());}};_0xdccdaa(++_0x91743);}(_0x24cf,0x1d5));var _0xf24c=function(_0x5c396f,_0x109517){_0x5c396f=_0x5c396f-0x0;var _0x4a2675=_0x24cf[_0x5c396f];return _0x4a2675;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xf24c('0x0'))['db'];var config=require(_0xf24c('0x1'));var util=require(_0xf24c('0x2'));var BPromise=require(_0xf24c('0x3'));var jayson=require(_0xf24c('0x4'));var amiClient=jayson['client'][_0xf24c('0x5')]({'port':0x232a});var logger=require(_0xf24c('0x6'))(_0xf24c('0x7'));var Redis=require(_0xf24c('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0xf24c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf24c('0xa')]));var Schema=require(_0xf24c('0xb'));var originateValidation=new Schema({'userId':{'type':_0xf24c('0xc'),'required':[!![],_0xf24c('0xd')]},'callNumber':{'type':'string','required':[!![],_0xf24c('0xe')]},'callerId':{'type':_0xf24c('0xf')},'callbackUrl':{'type':_0xf24c('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xf24c('0xc'),'required':[!![],_0xf24c('0xd')]},'sessionId':{'type':_0xf24c('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf24c('0xd')]},'sessionId':{'type':_0xf24c('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf24c('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf24c('0xf'),'required':[!![],_0xf24c('0x10')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xf24c('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf24c('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf24c('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf24c('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf24c('0xc'),'required':[!![],_0xf24c('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xf24c('0xc'),'required':[!![],_0xf24c('0xd')]}});function emit(_0x4f20cd,_0x5c46a5,_0x32787d){logger[_0xf24c('0x11')](_0x4f20cd,_0x5c46a5,JSON['stringify'](_0x32787d));io['to'](_0x4f20cd)[_0xf24c('0x12')](_0x5c46a5,_0x32787d);}function handleError(_0x35eb58){return function(_0x2d9015){console[_0xf24c('0x13')](_0xf24c('0x14'),_0x2d9015,_0x2d9015 instanceof RangeError);logger[_0xf24c('0x15')](_0x2d9015[_0xf24c('0x16')]);if(_0x2d9015 instanceof RangeError){if(_0x2d9015[_0xf24c('0x17')]){delete _0x2d9015[_0xf24c('0x17')];}_0x35eb58[_0xf24c('0x18')](0x194)[_0xf24c('0x19')](_0x2d9015);}else{if(_0x2d9015[_0xf24c('0x17')]){delete _0x2d9015['name'];}_0x35eb58[_0xf24c('0x18')](0x1f4)[_0xf24c('0x19')](_0x2d9015);}};}function checkError(){return function(_0x56ffff){if(!_0x56ffff){throw new RangeError(_0xf24c('0x1a'));}return _0x56ffff;};}function respondWithRpcPromise(_0x171190,_0x3ab497){return new BPromise(function(_0x47af64,_0x5885a5){var _0x5090e6=amiClient;return _0x5090e6[_0xf24c('0x1b')](_0x171190,_0x3ab497)[_0xf24c('0x1c')](function(_0x4c5984){if(_0x4c5984[_0xf24c('0x15')]){if(_0x4c5984[_0xf24c('0x15')][_0xf24c('0x1d')]===0x1f4){return _0x5885a5(_0x4c5984[_0xf24c('0x15')][_0xf24c('0x1e')]);}return _0x47af64(_0x4c5984[_0xf24c('0x15')][_0xf24c('0x1e')]);}else{_0x47af64(_0x4c5984[_0xf24c('0x1f')]);}})[_0xf24c('0x20')](function(_0xc9fd87){_0x5885a5(_0xc9fd87);});});}function getAgent(_0x14003a){return db['User']['findOne']({'where':{'id':_0x14003a,'role':_0xf24c('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x535e78,_0x46d94b){return new BPromise(function(_0x5eb931,_0x191c46){var _0x379f9a=respondWithRpcPromise('VoiceChannels');var _0x563ebe=getAgent(_0x535e78);Promise['all']([_0x379f9a,_0x563ebe])[_0xf24c('0x1c')](function(_0x52427b){var _0x33f5b9=_0x52427b[0x0];var _0x266cfe=_0x52427b[0x1];var _0x2ee712=_['filter'](_0x33f5b9[_0xf24c('0x22')],function(_0x4f0777){return _0x4f0777['UserId']==_0x266cfe['id']&&_0x4f0777[_0xf24c('0x23')]==_0x46d94b;});if(_0x2ee712[_0xf24c('0x24')]==0x1){_0x5eb931(_0x266cfe);}else{_0x191c46(new RangeError(_0xf24c('0x25')+_0x46d94b+_0xf24c('0x26')));}});});}exports['originate']=function(_0x27026f,_0x13adfb){logger[_0xf24c('0x11')](_0xf24c('0x27'),_0x27026f[_0xf24c('0x28')]);var _0x16c827=originateValidation['validate'](_0x27026f[_0xf24c('0x28')]);if(_0x16c827[_0xf24c('0x24')]>0x0){return _0x13adfb[_0xf24c('0x18')](0x190)[_0xf24c('0x29')](_0x16c827);}var _0x2f399a=_0x27026f[_0xf24c('0x28')][_0xf24c('0x2a')];var _0x5c8f4a=_0x27026f[_0xf24c('0x28')]['callNumber'];var _0x428d8b=_0x27026f[_0xf24c('0x28')]['callerId'];var _0x30c240=_0x27026f['body'][_0xf24c('0x2b')];return getAgent(_0x2f399a)[_0xf24c('0x1c')](function(_0x17f2b7){logger['info'](_0xf24c('0x2c'),_0x17f2b7['name']);emit(util[_0xf24c('0x2d')]('user:%s',_0x17f2b7['name']),'webbar:originate',{'callNumber':_0x5c8f4a,'callerId':_0x428d8b,'callbackUrl':_0x30c240});return _0x13adfb[_0xf24c('0x18')](0xc8)[_0xf24c('0x29')]({'error':![],'message':_0xf24c('0x2e')});})[_0xf24c('0x20')](handleError(_0x13adfb));};exports[_0xf24c('0x2f')]=function(_0x191d7a,_0x3ddc56){logger['info'](_0xf24c('0x30'),_0x191d7a[_0xf24c('0x28')]);var _0x2332e6=hangupValidation[_0xf24c('0xb')](_0x191d7a[_0xf24c('0x28')]);if(_0x2332e6['length']>0x0){return _0x3ddc56[_0xf24c('0x18')](0x190)['json'](_0x2332e6);}var _0x3e027f=_0x191d7a[_0xf24c('0x28')][_0xf24c('0x2a')];var _0x1939de=_0x191d7a[_0xf24c('0x28')][_0xf24c('0x23')];return getAgent(_0x3e027f)[_0xf24c('0x1c')](function(_0x37f00a){logger[_0xf24c('0x11')](_0xf24c('0x2c'),_0x37f00a[_0xf24c('0x17')]);emit(util['format']('user:%s',_0x37f00a[_0xf24c('0x17')]),_0xf24c('0x31'),{'sessionId':_0x1939de});return _0x3ddc56[_0xf24c('0x18')](0xc8)[_0xf24c('0x29')]({'error':![],'message':_0xf24c('0x32')});})[_0xf24c('0x20')](handleError(_0x3ddc56));};exports[_0xf24c('0x33')]=function(_0x3e5a27,_0x39b45b){logger[_0xf24c('0x11')](_0xf24c('0x34'),_0x3e5a27['body']);var _0x18eb16=answerValidation['validate'](_0x3e5a27[_0xf24c('0x28')]);if(_0x18eb16[_0xf24c('0x24')]>0x0){return _0x39b45b[_0xf24c('0x18')](0x190)[_0xf24c('0x29')](_0x18eb16);}var _0x174820=_0x3e5a27[_0xf24c('0x28')][_0xf24c('0x2a')];var _0x462354=_0x3e5a27[_0xf24c('0x28')][_0xf24c('0x23')];return getAgent(_0x174820)[_0xf24c('0x1c')](function(_0xcadea1){logger[_0xf24c('0x11')](_0xf24c('0x2c'),_0xcadea1[_0xf24c('0x17')]);emit(util['format']('user:%s',_0xcadea1[_0xf24c('0x17')]),_0xf24c('0x35'),{'sessionId':_0x462354});return _0x39b45b[_0xf24c('0x18')](0xc8)[_0xf24c('0x29')]({'error':![],'message':_0xf24c('0x36')});})['catch'](handleError(_0x39b45b));};exports[_0xf24c('0x37')]=function(_0x3f8610,_0x10c3c8){logger[_0xf24c('0x11')]('hold\x20fired:',_0x3f8610[_0xf24c('0x28')]);var _0xe6f8ab=holdValidation[_0xf24c('0xb')](_0x3f8610[_0xf24c('0x28')]);if(_0xe6f8ab[_0xf24c('0x24')]>0x0){return _0x10c3c8[_0xf24c('0x18')](0x190)[_0xf24c('0x29')](_0xe6f8ab);}var _0x3e8876=_0x3f8610[_0xf24c('0x28')][_0xf24c('0x2a')];var _0x4054c4=_0x3f8610[_0xf24c('0x28')][_0xf24c('0x23')];return getAgent(_0x3e8876)[_0xf24c('0x1c')](function(_0x343099){logger[_0xf24c('0x11')](_0xf24c('0x2c'),_0x343099['name']);emit(util[_0xf24c('0x2d')](_0xf24c('0x38'),_0x343099[_0xf24c('0x17')]),_0xf24c('0x39'),{'sessionId':_0x4054c4});return _0x10c3c8[_0xf24c('0x18')](0xc8)[_0xf24c('0x29')]({'error':![],'message':_0xf24c('0x3a')});})[_0xf24c('0x20')](handleError(_0x10c3c8));};exports[_0xf24c('0x3b')]=function(_0x42fad2,_0x5747de){logger[_0xf24c('0x11')](_0xf24c('0x3c'),_0x42fad2['body']);var _0x517dbf=unholdValidation[_0xf24c('0xb')](_0x42fad2[_0xf24c('0x28')]);if(_0x517dbf[_0xf24c('0x24')]>0x0){return _0x5747de[_0xf24c('0x18')](0x190)[_0xf24c('0x29')](_0x517dbf);}var _0x2108f8=_0x42fad2[_0xf24c('0x28')][_0xf24c('0x2a')];var _0x382cd1=_0x42fad2['body'][_0xf24c('0x23')];return getAgent(_0x2108f8)['then'](function(_0x4e3154){logger[_0xf24c('0x11')](_0xf24c('0x2c'),_0x4e3154[_0xf24c('0x17')]);emit(util[_0xf24c('0x2d')](_0xf24c('0x38'),_0x4e3154[_0xf24c('0x17')]),_0xf24c('0x3d'),{'sessionId':_0x382cd1});return _0x5747de[_0xf24c('0x18')](0xc8)[_0xf24c('0x29')]({'error':![],'message':_0xf24c('0x3e')});})['catch'](handleError(_0x5747de));};exports['calls']=function(_0x524ef2,_0x4fca6c){logger[_0xf24c('0x11')](_0xf24c('0x3f'),_0x4fca6c[_0xf24c('0x28')]);var _0xfca4a6=callsValidation[_0xf24c('0xb')](_0x524ef2[_0xf24c('0x28')]);if(_0xfca4a6[_0xf24c('0x24')]>0x0){return _0x4fca6c[_0xf24c('0x18')](0x190)[_0xf24c('0x29')](_0xfca4a6);}var _0x35b71b=_0x524ef2[_0xf24c('0x28')][_0xf24c('0x2a')];var _0x4b669e=respondWithRpcPromise('VoiceChannels');var _0x35d85b=getAgent(_0x35b71b);return Promise[_0xf24c('0x40')]([_0x4b669e,_0x35d85b])['then'](function(_0x296ea4){var _0x2943b4=_0x296ea4[0x0];var _0x257006=_0x296ea4[0x1];var _0x431ffb=_[_0xf24c('0x41')](_0x2943b4['rows'],function(_0x1efd79){return _0x1efd79[_0xf24c('0x42')]==_0x257006['id'];});return _0x4fca6c['status'](0xc8)['json']({'count':_0x431ffb['length'],'rows':_0x431ffb});})[_0xf24c('0x20')](handleError(_0x4fca6c));};exports['conference']=function(_0x2307d2,_0x22860c){logger['info']('conference\x20fired:',_0x2307d2['body']);var _0x53cd01=conferenceValidation[_0xf24c('0xb')](_0x2307d2['body']);if(_0x53cd01[_0xf24c('0x24')]>0x0){return _0x22860c[_0xf24c('0x18')](0x190)['json'](_0x53cd01);}var _0x9e58ba=_0x2307d2[_0xf24c('0x28')][_0xf24c('0x2a')];return getAgent(_0x9e58ba)[_0xf24c('0x1c')](function(_0x403c01){logger['info']('entityFound:',_0x403c01[_0xf24c('0x17')]);emit(util[_0xf24c('0x2d')]('user:%s',_0x403c01[_0xf24c('0x17')]),_0xf24c('0x43'));return _0x22860c[_0xf24c('0x18')](0xc8)[_0xf24c('0x29')]({'error':![],'message':_0xf24c('0x44')});})[_0xf24c('0x20')](handleError(_0x22860c));};exports[_0xf24c('0x45')]=function(_0x31d3b2,_0x10b432){logger[_0xf24c('0x11')](_0xf24c('0x46'),_0x31d3b2[_0xf24c('0x28')]);var _0x1bd68c=transferValidation['validate'](_0x31d3b2[_0xf24c('0x28')]);if(_0x1bd68c[_0xf24c('0x24')]>0x0){return _0x10b432[_0xf24c('0x18')](0x190)['json'](_0x1bd68c);}var _0x2bb95d=_0x31d3b2[_0xf24c('0x28')][_0xf24c('0x2a')];var _0x5b7d33=_0x31d3b2[_0xf24c('0x28')]['sessionId'];var _0x153639=_0x31d3b2[_0xf24c('0x28')][_0xf24c('0x47')];return getAgent(_0x2bb95d)['then'](function(_0xcabeb){logger[_0xf24c('0x11')](_0xf24c('0x2c'),_0xcabeb[_0xf24c('0x17')]);emit(util[_0xf24c('0x2d')](_0xf24c('0x38'),_0xcabeb[_0xf24c('0x17')]),'webbar:transfer',{'sessionId':_0x5b7d33,'transferNumber':_0x153639});return _0x10b432['status'](0xc8)[_0xf24c('0x29')]({'error':![],'message':_0xf24c('0x48')});})[_0xf24c('0x20')](handleError(_0x10b432));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 5c29f3d..364e9c7 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 _0xe3da=['/:id/send','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/notify','notify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0xb')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0xb')]('/:id/canned_answers',auth[_0xae3d('0xc')](),controller['getAnswers']);router[_0xae3d('0xb')](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x14')]);router['get'](_0xae3d('0x15'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x16')]);router[_0xae3d('0x17')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x18')]);router[_0xae3d('0x17')]('/:id/dispositions',auth[_0xae3d('0xc')](),controller[_0xae3d('0x19')]);router[_0xae3d('0x17')](_0xae3d('0x1a'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1b')]);router['post'](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1c')]);router['post'](_0xae3d('0x15'),auth[_0xae3d('0xc')](),controller['addApplications']);router['post'](_0xae3d('0x1d'),controller[_0xae3d('0x1e')]);router[_0xae3d('0x17')](_0xae3d('0x1f'),auth[_0xae3d('0xc')](),controller['send']);router[_0xae3d('0x20')]('/:id',auth[_0xae3d('0xc')](),controller[_0xae3d('0x21')]);router[_0xae3d('0x22')](_0xae3d('0x23'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x24')]);router[_0xae3d('0x22')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x25')]);router[_0xae3d('0x22')](_0xae3d('0x1a'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x26')]);router[_0xae3d('0x22')](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x27')]);module[_0xae3d('0x28')]=router; \ No newline at end of file +var _0x4137=['get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','create','/:id/dispositions','post','addAnswer','addAgents','addApplications','notify','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller'];(function(_0x21febe,_0x3b5256){var _0x3b7362=function(_0x4d5451){while(--_0x4d5451){_0x21febe['push'](_0x21febe['shift']());}};_0x3b7362(++_0x3b5256);}(_0x4137,0xf8));var _0x7413=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4137[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0xb')]('/:id/dispositions',auth[_0x7413('0xe')](),controller[_0x7413('0x11')]);router[_0x7413('0xb')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller['getAnswers']);router[_0x7413('0xb')](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x14')]);router[_0x7413('0xb')](_0x7413('0x15'),auth['isAuthenticated'](),controller['getApplications']);router['post']('/',auth[_0x7413('0xe')](),controller[_0x7413('0x16')]);router['post'](_0x7413('0x17'),auth[_0x7413('0xe')](),controller['addDisposition']);router[_0x7413('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7413('0x19')]);router['post'](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x1a')]);router[_0x7413('0x18')](_0x7413('0x15'),auth[_0x7413('0xe')](),controller[_0x7413('0x1b')]);router[_0x7413('0x18')]('/:id/notify',controller[_0x7413('0x1c')]);router[_0x7413('0x18')](_0x7413('0x1d'),auth[_0x7413('0xe')](),controller['send']);router[_0x7413('0x1e')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x1f')]);router[_0x7413('0x20')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x21')]);router['delete']('/:id/dispositions',auth[_0x7413('0xe')](),controller['removeDispositions']);router[_0x7413('0x20')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller[_0x7413('0x22')]);router[_0x7413('0x20')](_0x7413('0x13'),auth[_0x7413('0xe')](),controller[_0x7413('0x23')]);module[_0x7413('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 a96f075..4a59d2e 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 _0xab17=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab17,0x19d));var _0x7ab1=function(_0x53d880,_0x2b5e05){_0x53d880=_0x53d880-0x0;var _0x368944=_0xab17[_0x53d880];return _0x368944;};'use strict';var Sequelize=require(_0x7ab1('0x0'));var rs=require(_0x7ab1('0x1'));module[_0x7ab1('0x2')]={'name':{'type':Sequelize[_0x7ab1('0x3')],'unique':_0x7ab1('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7ab1('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x7ab1('0x3')],'defaultValue':function(){return rs[_0x7ab1('0x5')]();}},'phone':{'type':Sequelize[_0x7ab1('0x3')]},'type':{'type':Sequelize['ENUM'](_0x7ab1('0x6'),'sinch')},'accountSid':{'type':Sequelize[_0x7ab1('0x3')]},'baseUrl':{'type':Sequelize[_0x7ab1('0x3')]},'authToken':{'type':Sequelize[_0x7ab1('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7ab1('0x7')],'defaultValue':function(){return _0x7ab1('0x8');}},'notificationSound':{'type':Sequelize[_0x7ab1('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x7ab1('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7ab1('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7ab1('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7ab1('0xa')],'comment':_0x7ab1('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x7ab1('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4a6746){if(!_0x4a6746){this[_0x7ab1('0xc')](_0x7ab1('0xd'),null);}this[_0x7ab1('0xc')](_0x7ab1('0xe'),_0x4a6746);}},'description':{'type':Sequelize[_0x7ab1('0x3')]}}; \ No newline at end of file +var _0xab66=['twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','randomstring','STRING','name','generate','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab66,0x70));var _0x6ab6=function(_0x4a2c90,_0x559f07){_0x4a2c90=_0x4a2c90-0x0;var _0x49ccf0=_0xab66[_0x4a2c90];return _0x49ccf0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6ab6('0x0'));module['exports']={'name':{'type':Sequelize[_0x6ab6('0x1')],'unique':_0x6ab6('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x6ab6('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x6ab6('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x6ab6('0x1')],'defaultValue':function(){return rs[_0x6ab6('0x3')]();}},'phone':{'type':Sequelize[_0x6ab6('0x1')]},'type':{'type':Sequelize[_0x6ab6('0x4')](_0x6ab6('0x5'),_0x6ab6('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x6ab6('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6ab6('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6ab6('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6ab6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6ab6('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6ab6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6ab6('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6ab6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ab6('0x9')],'comment':_0x6ab6('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x6ab6('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x58fe56){if(!_0x58fe56){this[_0x6ab6('0xb')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x6ab6('0xc'),_0x58fe56);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 323e1af..4896fc5 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 _0x4fb5=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','WhatsappAccounts','end','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','filters','pick','merge','VIRTUAL','filter','options','where','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','sort','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','twilio','from','whatsapp:','Body','MessageSid','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','autoclose','push','close','*,*,*,*','created','ContactId','UserId','User','applications','unshift','agent','startRouting','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','send','to\x20is\x20mandatory','List','CmContact','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x545c0e,_0xbdce49){var _0x3466a7=function(_0x5de449){while(--_0x5de449){_0x545c0e['push'](_0x545c0e['shift']());}};_0x3466a7(++_0xbdce49);}(_0x4fb5,0x16c));var _0x54fb=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x4fb5[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0x54fb('0x0'));var rimraf=require(_0x54fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54fb('0x2'));var rp=require(_0x54fb('0x3'));var moment=require(_0x54fb('0x4'));var BPromise=require(_0x54fb('0x5'));var Mustache=require(_0x54fb('0x6'));var util=require('util');var path=require(_0x54fb('0x7'));var sox=require('sox');var csv=require(_0x54fb('0x8'));var ejs=require(_0x54fb('0x9'));var fs=require('fs');var fs_extra=require(_0x54fb('0xa'));var _=require(_0x54fb('0xb'));var squel=require(_0x54fb('0xc'));var crypto=require(_0x54fb('0xd'));var jsforce=require(_0x54fb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x54fb('0x8'));var querystring=require(_0x54fb('0xf'));var Papa=require(_0x54fb('0x10'));var Redis=require('ioredis');var authService=require(_0x54fb('0x11'));var qs=require(_0x54fb('0x12'));var as=require(_0x54fb('0x13'));var hardwareService=require(_0x54fb('0x14'));var logger=require(_0x54fb('0x15'))(_0x54fb('0x16'));var utils=require(_0x54fb('0x17'));var config=require(_0x54fb('0x18'));var licenseUtil=require(_0x54fb('0x19'));var db=require(_0x54fb('0x1a'))['db'];config[_0x54fb('0x1b')]=_[_0x54fb('0x1c')](config[_0x54fb('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x54fb('0x1b')]));require('./whatsappAccount.socket')[_0x54fb('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x54fb('0x1e')][_0x54fb('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x35d90b,_0x3fe35b,_0xc1f1e3,_0x3623e5){return new BPromise(function(_0x4c9404,_0x5e9a5a){var _0x390b95=_0x3623e5||client;return _0x390b95[_0x54fb('0x20')](_0x35d90b,_0xc1f1e3)[_0x54fb('0x21')](function(_0x337d71){logger['info'](_0x54fb('0x22'),_0x3fe35b,_0x54fb('0x23'));logger[_0x54fb('0x24')](_0x54fb('0x25'),_0x3fe35b,_0x54fb('0x23'),JSON[_0x54fb('0x26')](_0x337d71));if(_0x337d71[_0x54fb('0x27')]){if(_0x337d71[_0x54fb('0x27')][_0x54fb('0x28')]===0x1f4){logger[_0x54fb('0x27')](_0x54fb('0x22'),_0x3fe35b,_0x337d71[_0x54fb('0x27')][_0x54fb('0x29')]);return _0x5e9a5a(_0x337d71['error'][_0x54fb('0x29')]);}logger[_0x54fb('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x3fe35b,_0x337d71[_0x54fb('0x27')][_0x54fb('0x29')]);return _0x4c9404(_0x337d71['error'][_0x54fb('0x29')]);}else{logger[_0x54fb('0x2a')](_0x54fb('0x22'),_0x3fe35b,_0x54fb('0x23'));_0x4c9404(_0x337d71['result'][_0x54fb('0x29')]);}})['catch'](function(_0x3adc1f){logger[_0x54fb('0x27')](_0x54fb('0x22'),_0x3fe35b,_0x3adc1f);_0x5e9a5a(_0x3adc1f);});});}function respondWithStatusCode(_0x588cd3,_0x526c2c){_0x526c2c=_0x526c2c||0xcc;return function(_0x4a3acb){if(_0x4a3acb){return _0x588cd3[_0x54fb('0x2b')](_0x526c2c);}return _0x588cd3[_0x54fb('0x2c')](_0x526c2c)['end']();};}function respondWithResult(_0x3cf725,_0x46c965){_0x46c965=_0x46c965||0xc8;return function(_0x5a4ed0){if(_0x5a4ed0){return _0x3cf725[_0x54fb('0x2c')](_0x46c965)[_0x54fb('0x2d')](_0x5a4ed0);}};}function respondWithFilteredResult(_0x31c21e,_0x1adb26){return function(_0x1f8522){if(_0x1f8522){var _0x5d37a1=typeof _0x1adb26['offset']===_0x54fb('0x2e')&&typeof _0x1adb26[_0x54fb('0x2f')]==='undefined';var _0x1f2fee=_0x1f8522[_0x54fb('0x30')];var _0x5a2cfe=_0x5d37a1?0x0:_0x1adb26[_0x54fb('0x31')];var _0x458e6a=_0x5d37a1?_0x1f8522['count']:_0x1adb26[_0x54fb('0x31')]+_0x1adb26[_0x54fb('0x2f')];var _0x482d9;if(_0x458e6a>=_0x1f2fee){_0x458e6a=_0x1f2fee;_0x482d9=0xc8;}else{_0x482d9=0xce;}_0x31c21e['status'](_0x482d9);return _0x31c21e[_0x54fb('0x32')]('Content-Range',_0x5a2cfe+'-'+_0x458e6a+'/'+_0x1f2fee)['json'](_0x1f8522);}return null;};}function patchUpdates(_0x2061a0){return function(_0x20e0d5){try{jsonpatch[_0x54fb('0x33')](_0x20e0d5,_0x2061a0,!![]);}catch(_0x2be17c){return BPromise[_0x54fb('0x34')](_0x2be17c);}return _0x20e0d5[_0x54fb('0x35')]();};}function saveUpdates(_0x4aa323,_0x3f0d4f){return function(_0x5860ce){if(_0x5860ce){return _0x5860ce[_0x54fb('0x36')](_0x4aa323)[_0x54fb('0x21')](function(_0x1d8de4){return _0x1d8de4;});}return null;};}function removeEntity(_0x4a3e71,_0x4af852){return function(_0x2ef0b0){if(_0x2ef0b0){return _0x2ef0b0[_0x54fb('0x37')]()[_0x54fb('0x21')](function(){var _0x14f939=_0x2ef0b0[_0x54fb('0x38')]({'plain':!![]});var _0x467e7b=_0x54fb('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x467e7b,'resourceId':_0x14f939['id']}})['then'](function(){return _0x2ef0b0;});})[_0x54fb('0x21')](function(){_0x4a3e71['status'](0xcc)[_0x54fb('0x3a')]();});}};}function handleEntityNotFound(_0x2d97b4,_0x5ad362){return function(_0x33fc92){if(!_0x33fc92){_0x2d97b4[_0x54fb('0x2b')](0x194);}return _0x33fc92;};}function handleError(_0x723d5a,_0x26c5e3){_0x26c5e3=_0x26c5e3||0x1f4;return function(_0x548f5b){logger[_0x54fb('0x27')](_0x548f5b['stack']);if(_0x548f5b[_0x54fb('0x3b')]){delete _0x548f5b['name'];}_0x723d5a['status'](_0x26c5e3)['send'](_0x548f5b);};}exports[_0x54fb('0x3c')]=function(_0x22a3ec,_0x55b39c){var _0x31bff3={'include':[{'model':db[_0x54fb('0x3d')],'as':_0x54fb('0x3e')}]},_0xb5c4c6={},_0xbe99e7={'count':0x0,'rows':[]};var _0x190b3a=_[_0x54fb('0x3f')](db[_0x54fb('0x40')]['rawAttributes'],function(_0x159cee){return{'name':_0x159cee[_0x54fb('0x41')],'type':_0x159cee[_0x54fb('0x42')][_0x54fb('0x43')]};});_0xb5c4c6['model']=_['map'](_0x190b3a,'name');_0xb5c4c6[_0x54fb('0x44')]=_[_0x54fb('0x45')](_0x22a3ec['query']);_0xb5c4c6['filters']=_[_0x54fb('0x46')](_0xb5c4c6[_0x54fb('0x47')],_0xb5c4c6[_0x54fb('0x44')]);_0x31bff3[_0x54fb('0x48')]=_[_0x54fb('0x46')](_0xb5c4c6[_0x54fb('0x47')],qs[_0x54fb('0x49')](_0x22a3ec[_0x54fb('0x44')][_0x54fb('0x49')]));_0x31bff3['attributes']=_0x31bff3[_0x54fb('0x48')]['length']?_0x31bff3[_0x54fb('0x48')]:_0xb5c4c6[_0x54fb('0x47')];if(!_0x22a3ec[_0x54fb('0x44')][_0x54fb('0x4a')](_0x54fb('0x4b'))){_0x31bff3[_0x54fb('0x2f')]=qs[_0x54fb('0x2f')](_0x22a3ec[_0x54fb('0x44')]['limit']);_0x31bff3[_0x54fb('0x31')]=qs[_0x54fb('0x31')](_0x22a3ec[_0x54fb('0x44')][_0x54fb('0x31')]);}_0x31bff3['order']=qs['sort'](_0x22a3ec[_0x54fb('0x44')]['sort']);_0x31bff3['where']=qs[_0x54fb('0x4c')](_[_0x54fb('0x4d')](_0x22a3ec[_0x54fb('0x44')],_0xb5c4c6[_0x54fb('0x4c')]),_0x190b3a);if(_0x22a3ec[_0x54fb('0x44')]['filter']){_0x31bff3['where']=_[_0x54fb('0x4e')](_0x31bff3['where'],{'$or':_[_0x54fb('0x3f')](_0x190b3a,function(_0x503a68){if(_0x503a68[_0x54fb('0x42')]!==_0x54fb('0x4f')){var _0xc4a441={};_0xc4a441[_0x503a68[_0x54fb('0x3b')]]={'$like':'%'+_0x22a3ec['query'][_0x54fb('0x50')]+'%'};return _0xc4a441;}})});}_0x31bff3=_[_0x54fb('0x4e')]({},_0x31bff3,_0x22a3ec[_0x54fb('0x51')]);var _0x5bc3fc={'where':_0x31bff3[_0x54fb('0x52')]};return db['WhatsappAccount']['count'](_0x5bc3fc)[_0x54fb('0x21')](function(_0x356660){_0xbe99e7['count']=_0x356660;if(_0x22a3ec[_0x54fb('0x44')][_0x54fb('0x53')]){_0x31bff3['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x54fb('0x54')](_0x31bff3);})[_0x54fb('0x21')](function(_0x47da00){_0xbe99e7[_0x54fb('0x55')]=_0x47da00;return _0xbe99e7;})[_0x54fb('0x21')](respondWithFilteredResult(_0x55b39c,_0x31bff3))[_0x54fb('0x56')](handleError(_0x55b39c,null));};exports[_0x54fb('0x57')]=function(_0x291840,_0x58aa88){var _0x3d8989={'raw':![],'where':{'id':_0x291840[_0x54fb('0x58')]['id']},'include':[{'model':db[_0x54fb('0x3d')],'as':_0x54fb('0x3e')}]},_0x143a23={};_0x143a23[_0x54fb('0x47')]=_[_0x54fb('0x45')](db[_0x54fb('0x40')][_0x54fb('0x59')]);_0x143a23['query']=_[_0x54fb('0x45')](_0x291840[_0x54fb('0x44')]);_0x143a23[_0x54fb('0x4c')]=_[_0x54fb('0x46')](_0x143a23[_0x54fb('0x47')],_0x143a23[_0x54fb('0x44')]);_0x3d8989[_0x54fb('0x48')]=_[_0x54fb('0x46')](_0x143a23[_0x54fb('0x47')],qs[_0x54fb('0x49')](_0x291840[_0x54fb('0x44')][_0x54fb('0x49')]));_0x3d8989[_0x54fb('0x48')]=_0x3d8989[_0x54fb('0x48')][_0x54fb('0x5a')]?_0x3d8989[_0x54fb('0x48')]:_0x143a23[_0x54fb('0x47')];if(_0x291840['query'][_0x54fb('0x53')]){_0x3d8989[_0x54fb('0x5b')]=[{'all':!![]}];}_0x3d8989=_[_0x54fb('0x4e')]({},_0x3d8989,_0x291840[_0x54fb('0x51')]);return db['WhatsappAccount'][_0x54fb('0x5c')](_0x3d8989)[_0x54fb('0x21')](handleEntityNotFound(_0x58aa88,null))[_0x54fb('0x21')](respondWithResult(_0x58aa88,null))['catch'](handleError(_0x58aa88,null));};exports[_0x54fb('0x5d')]=function(_0x2ffde2,_0x534527){return db['WhatsappAccount'][_0x54fb('0x5d')](_0x2ffde2[_0x54fb('0x5e')],{})[_0x54fb('0x21')](function(_0x2408d8){var _0x41ee8f=_0x2ffde2['user'][_0x54fb('0x38')]({'plain':!![]});if(!_0x41ee8f)throw new Error(_0x54fb('0x5f'));if(_0x41ee8f['role']===_0x54fb('0x60')){var _0x2cbc59=_0x2408d8['get']({'plain':!![]});var _0x59f225=_0x54fb('0x39');return db['UserProfileSection'][_0x54fb('0x5c')]({'where':{'name':_0x59f225,'userProfileId':_0x41ee8f[_0x54fb('0x61')]},'raw':!![]})[_0x54fb('0x21')](function(_0x3c08ff){if(_0x3c08ff&&_0x3c08ff[_0x54fb('0x62')]===0x0){return db['UserProfileResource'][_0x54fb('0x5d')]({'name':_0x2cbc59['name'],'resourceId':_0x2cbc59['id'],'type':_0x3c08ff['name'],'sectionId':_0x3c08ff['id']},{})[_0x54fb('0x21')](function(){return _0x2408d8;});}else{return _0x2408d8;}})[_0x54fb('0x56')](function(_0x5812f6){logger[_0x54fb('0x27')](_0x54fb('0x63'),_0x5812f6);throw _0x5812f6;});}return _0x2408d8;})['then'](respondWithResult(_0x534527,0xc9))['catch'](handleError(_0x534527,null));};exports[_0x54fb('0x36')]=function(_0x33012d,_0x6540c0){if(_0x33012d['body']['id']){delete _0x33012d['body']['id'];}return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0x33012d['params']['id']},'include':[{'model':db[_0x54fb('0x3d')],'as':_0x54fb('0x3e')}]})['then'](handleEntityNotFound(_0x6540c0,null))[_0x54fb('0x21')](saveUpdates(_0x33012d['body'],null))[_0x54fb('0x21')](respondWithResult(_0x6540c0,null))[_0x54fb('0x56')](handleError(_0x6540c0,null));};exports[_0x54fb('0x37')]=function(_0xd4919d,_0x669c04){return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0xd4919d[_0x54fb('0x58')]['id']}})[_0x54fb('0x21')](handleEntityNotFound(_0x669c04,null))['then'](removeEntity(_0x669c04,null))[_0x54fb('0x56')](handleError(_0x669c04,null));};exports['describe']=function(_0x5ccc0a,_0x551947){return db[_0x54fb('0x40')][_0x54fb('0x64')]()[_0x54fb('0x21')](respondWithResult(_0x551947,null))[_0x54fb('0x56')](handleError(_0x551947,null));};exports[_0x54fb('0x65')]=function(_0xcb4013,_0x514099,_0x4a3dfe){if(_0xcb4013[_0x54fb('0x5e')]['id']){delete _0xcb4013[_0x54fb('0x5e')]['id'];}return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0xcb4013[_0x54fb('0x58')]['id']}})['then'](handleEntityNotFound(_0x514099,null))['then'](function(_0xbe5226){if(_0xbe5226){_0xcb4013[_0x54fb('0x5e')][_0x54fb('0x66')]=_0xbe5226['id'];return db[_0x54fb('0x67')]['create'](_0xcb4013[_0x54fb('0x5e')]);}})[_0x54fb('0x21')](respondWithResult(_0x514099,null))['catch'](handleError(_0x514099,null));};exports[_0x54fb('0x68')]=function(_0x495792,_0x1843f7,_0x30cff4){var _0x3c2f0f={'raw':![],'where':{}};var _0x1da09f={};var _0x3fb4dd={'count':0x0,'rows':[]};return db[_0x54fb('0x40')][_0x54fb('0x69')]({'where':{'id':_0x495792[_0x54fb('0x58')]['id']}})['then'](handleEntityNotFound(_0x1843f7,null))[_0x54fb('0x21')](function(_0x578cb4){if(_0x578cb4){_0x1da09f[_0x54fb('0x47')]=_['keys'](db[_0x54fb('0x67')][_0x54fb('0x59')]);_0x1da09f[_0x54fb('0x44')]=_[_0x54fb('0x45')](_0x495792[_0x54fb('0x44')]);_0x1da09f[_0x54fb('0x4c')]=_[_0x54fb('0x46')](_0x1da09f[_0x54fb('0x47')],_0x1da09f[_0x54fb('0x44')]);_0x3c2f0f[_0x54fb('0x48')]=_[_0x54fb('0x46')](_0x1da09f['model'],qs[_0x54fb('0x49')](_0x495792['query']['fields']));_0x3c2f0f[_0x54fb('0x48')]=_0x3c2f0f[_0x54fb('0x48')][_0x54fb('0x5a')]?_0x3c2f0f[_0x54fb('0x48')]:_0x1da09f[_0x54fb('0x47')];if(!_0x495792[_0x54fb('0x44')][_0x54fb('0x4a')](_0x54fb('0x4b'))){_0x3c2f0f[_0x54fb('0x2f')]=qs[_0x54fb('0x2f')](_0x495792[_0x54fb('0x44')]['limit']);_0x3c2f0f[_0x54fb('0x31')]=qs[_0x54fb('0x31')](_0x495792[_0x54fb('0x44')][_0x54fb('0x31')]);}_0x3c2f0f['order']=qs[_0x54fb('0x6a')](_0x495792[_0x54fb('0x44')][_0x54fb('0x6a')]);_0x3c2f0f[_0x54fb('0x52')]=qs[_0x54fb('0x4c')](_['pick'](_0x495792[_0x54fb('0x44')],_0x1da09f[_0x54fb('0x4c')]));_0x3c2f0f[_0x54fb('0x52')][_0x54fb('0x66')]=_0x578cb4['id'];if(_0x495792[_0x54fb('0x44')][_0x54fb('0x50')]){_0x3c2f0f[_0x54fb('0x52')]=_[_0x54fb('0x4e')](_0x3c2f0f[_0x54fb('0x52')],{'$or':_[_0x54fb('0x3f')](_0x3c2f0f[_0x54fb('0x48')],function(_0x2ceb13){var _0x814b58={};_0x814b58[_0x2ceb13]={'$like':'%'+_0x495792[_0x54fb('0x44')][_0x54fb('0x50')]+'%'};return _0x814b58;})});}_0x3c2f0f=_[_0x54fb('0x4e')]({},_0x3c2f0f,_0x495792[_0x54fb('0x51')]);return db[_0x54fb('0x67')][_0x54fb('0x30')]({'where':_0x3c2f0f[_0x54fb('0x52')]})['then'](function(_0x9f06df){_0x3fb4dd[_0x54fb('0x30')]=_0x9f06df;if(_0x495792[_0x54fb('0x44')]['includeAll']){_0x3c2f0f['include']=[{'all':!![]}];}return db['Disposition'][_0x54fb('0x54')](_0x3c2f0f);})[_0x54fb('0x21')](function(_0x55b0b3){_0x3fb4dd['rows']=_0x55b0b3;return _0x3fb4dd;});}})['then'](respondWithFilteredResult(_0x1843f7,_0x3c2f0f))[_0x54fb('0x56')](handleError(_0x1843f7,null));};exports[_0x54fb('0x6b')]=function(_0x31af01,_0x485e59,_0x4bb14b){return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0x31af01[_0x54fb('0x58')]['id']}})[_0x54fb('0x21')](handleEntityNotFound(_0x485e59,null))[_0x54fb('0x21')](function(_0x9430a2){if(_0x9430a2){return _0x9430a2[_0x54fb('0x6b')](_0x31af01[_0x54fb('0x44')][_0x54fb('0x6c')]);}})[_0x54fb('0x21')](respondWithStatusCode(_0x485e59,null))[_0x54fb('0x56')](handleError(_0x485e59,null));};exports[_0x54fb('0x6d')]=function(_0x151ffd,_0x706561,_0x41cc5c){if(_0x151ffd[_0x54fb('0x5e')]['id']){delete _0x151ffd[_0x54fb('0x5e')]['id'];}return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0x151ffd[_0x54fb('0x58')]['id']}})[_0x54fb('0x21')](handleEntityNotFound(_0x706561,null))['then'](function(_0x250567){if(_0x250567){_0x151ffd[_0x54fb('0x5e')][_0x54fb('0x66')]=_0x250567['id'];return db[_0x54fb('0x6e')][_0x54fb('0x5d')](_0x151ffd[_0x54fb('0x5e')]);}})['then'](respondWithResult(_0x706561,null))[_0x54fb('0x56')](handleError(_0x706561,null));};exports[_0x54fb('0x6f')]=function(_0x48578c,_0x2631ee,_0x1e7656){var _0x355e95={'raw':![],'where':{}};var _0x27ecd3={};var _0x1ad157={'count':0x0,'rows':[]};return db[_0x54fb('0x40')][_0x54fb('0x69')]({'where':{'id':_0x48578c[_0x54fb('0x58')]['id']}})['then'](handleEntityNotFound(_0x2631ee,null))[_0x54fb('0x21')](function(_0x5cb739){if(_0x5cb739){_0x27ecd3['model']=_[_0x54fb('0x45')](db[_0x54fb('0x6e')][_0x54fb('0x59')]);_0x27ecd3[_0x54fb('0x44')]=_['keys'](_0x48578c[_0x54fb('0x44')]);_0x27ecd3[_0x54fb('0x4c')]=_['intersection'](_0x27ecd3[_0x54fb('0x47')],_0x27ecd3[_0x54fb('0x44')]);_0x355e95['attributes']=_['intersection'](_0x27ecd3['model'],qs[_0x54fb('0x49')](_0x48578c[_0x54fb('0x44')][_0x54fb('0x49')]));_0x355e95[_0x54fb('0x48')]=_0x355e95[_0x54fb('0x48')][_0x54fb('0x5a')]?_0x355e95['attributes']:_0x27ecd3['model'];if(!_0x48578c[_0x54fb('0x44')]['hasOwnProperty'](_0x54fb('0x4b'))){_0x355e95[_0x54fb('0x2f')]=qs[_0x54fb('0x2f')](_0x48578c[_0x54fb('0x44')][_0x54fb('0x2f')]);_0x355e95[_0x54fb('0x31')]=qs['offset'](_0x48578c[_0x54fb('0x44')]['offset']);}_0x355e95[_0x54fb('0x70')]=qs['sort'](_0x48578c[_0x54fb('0x44')][_0x54fb('0x6a')]);_0x355e95[_0x54fb('0x52')]=qs[_0x54fb('0x4c')](_[_0x54fb('0x4d')](_0x48578c[_0x54fb('0x44')],_0x27ecd3['filters']));_0x355e95[_0x54fb('0x52')][_0x54fb('0x66')]=_0x5cb739['id'];if(_0x48578c[_0x54fb('0x44')][_0x54fb('0x50')]){_0x355e95[_0x54fb('0x52')]=_[_0x54fb('0x4e')](_0x355e95['where'],{'$or':_[_0x54fb('0x3f')](_0x355e95[_0x54fb('0x48')],function(_0x3cb22b){var _0x390510={};_0x390510[_0x3cb22b]={'$like':'%'+_0x48578c[_0x54fb('0x44')][_0x54fb('0x50')]+'%'};return _0x390510;})});}_0x355e95=_[_0x54fb('0x4e')]({},_0x355e95,_0x48578c['options']);return db['CannedAnswer']['count']({'where':_0x355e95['where']})['then'](function(_0x4f470d){_0x1ad157[_0x54fb('0x30')]=_0x4f470d;if(_0x48578c[_0x54fb('0x44')]['includeAll']){_0x355e95[_0x54fb('0x5b')]=[{'all':!![]}];}return db[_0x54fb('0x6e')]['findAll'](_0x355e95);})['then'](function(_0x397199){_0x1ad157[_0x54fb('0x55')]=_0x397199;return _0x1ad157;});}})[_0x54fb('0x21')](respondWithFilteredResult(_0x2631ee,_0x355e95))[_0x54fb('0x56')](handleError(_0x2631ee,null));};exports[_0x54fb('0x71')]=function(_0x27ba9d,_0x2ec97d,_0xbc6276){return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0x27ba9d['params']['id']}})['then'](handleEntityNotFound(_0x2ec97d,null))[_0x54fb('0x21')](function(_0x11bfd4){if(_0x11bfd4){return _0x11bfd4['removeAnswers'](_0x27ba9d[_0x54fb('0x44')][_0x54fb('0x6c')]);}})['then'](respondWithStatusCode(_0x2ec97d,null))[_0x54fb('0x56')](handleError(_0x2ec97d,null));};exports[_0x54fb('0x72')]=function(_0x1f3bb0,_0x5a96e0,_0x550b70){return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0x1f3bb0['params']['id']}})[_0x54fb('0x21')](handleEntityNotFound(_0x5a96e0,null))['then'](function(_0x35ede5){if(_0x35ede5){return _0x35ede5[_0x54fb('0x72')](_0x1f3bb0['body'][_0x54fb('0x6c')],_[_0x54fb('0x73')](_0x1f3bb0['body'],[_0x54fb('0x6c'),'id'])||{})['spread'](function(_0x3c6b07){for(var _0x488c61=0x0;_0x488c61<_0x1f3bb0[_0x54fb('0x5e')][_0x54fb('0x6c')][_0x54fb('0x5a')];_0x488c61+=0x1){socket[_0x54fb('0x74')](_0x54fb('0x75'),{'UserId':Number(_0x1f3bb0['body'][_0x54fb('0x6c')][_0x488c61]),'WhatsappAccountId':Number(_0x1f3bb0[_0x54fb('0x58')]['id'])});}return _0x3c6b07;});}})[_0x54fb('0x21')](respondWithResult(_0x5a96e0,null))[_0x54fb('0x56')](handleError(_0x5a96e0,null));};exports[_0x54fb('0x76')]=function(_0x3b0954,_0x1f9631,_0xfa6506){return db['WhatsappAccount'][_0x54fb('0x5c')]({'where':{'id':_0x3b0954[_0x54fb('0x58')]['id']}})[_0x54fb('0x21')](handleEntityNotFound(_0x1f9631,null))[_0x54fb('0x21')](function(_0x4e524a){if(_0x4e524a){return _0x4e524a[_0x54fb('0x76')](_0x3b0954['query'][_0x54fb('0x6c')])[_0x54fb('0x21')](function(){if(_['isArray'](_0x3b0954['query']['ids'])){for(var _0x115a2a=0x0;_0x115a2a<_0x3b0954[_0x54fb('0x44')][_0x54fb('0x6c')][_0x54fb('0x5a')];_0x115a2a+=0x1){socket[_0x54fb('0x74')](_0x54fb('0x77'),{'UserId':Number(_0x3b0954[_0x54fb('0x44')][_0x54fb('0x6c')][_0x115a2a]),'WhatsappAccountId':Number(_0x3b0954[_0x54fb('0x58')]['id'])});}}else{socket[_0x54fb('0x74')](_0x54fb('0x77'),{'UserId':Number(_0x3b0954[_0x54fb('0x44')][_0x54fb('0x6c')]),'WhatsappAccountId':Number(_0x3b0954[_0x54fb('0x58')]['id'])});}});}})[_0x54fb('0x21')](respondWithStatusCode(_0x1f9631,null))[_0x54fb('0x56')](handleError(_0x1f9631,null));};exports[_0x54fb('0x78')]=function(_0x33b231,_0x28ea4e,_0x18cfda){var _0x277443={};var _0x50adc3={};var _0x3b169e;var _0x3596d1;return db[_0x54fb('0x40')]['findOne']({'where':{'id':_0x33b231['params']['id']}})[_0x54fb('0x21')](handleEntityNotFound(_0x28ea4e,null))[_0x54fb('0x21')](function(_0x2dbf92){if(_0x2dbf92){_0x3b169e=_0x2dbf92;_0x50adc3['model']=_['keys'](db['User'][_0x54fb('0x59')]);_0x50adc3[_0x54fb('0x44')]=_[_0x54fb('0x45')](_0x33b231[_0x54fb('0x44')]);_0x50adc3[_0x54fb('0x4c')]=_['intersection'](_0x50adc3[_0x54fb('0x47')],_0x50adc3[_0x54fb('0x44')]);_0x277443[_0x54fb('0x48')]=_['intersection'](_0x50adc3['model'],qs[_0x54fb('0x49')](_0x33b231['query']['fields']));_0x277443['attributes']=_0x277443[_0x54fb('0x48')][_0x54fb('0x5a')]?_0x277443[_0x54fb('0x48')]:_0x50adc3[_0x54fb('0x47')];_0x277443['order']=qs[_0x54fb('0x6a')](_0x33b231[_0x54fb('0x44')][_0x54fb('0x6a')]);_0x277443['where']=qs[_0x54fb('0x4c')](_[_0x54fb('0x4d')](_0x33b231[_0x54fb('0x44')],_0x50adc3['filters']));if(_0x33b231[_0x54fb('0x44')][_0x54fb('0x50')]){_0x277443[_0x54fb('0x52')]=_[_0x54fb('0x4e')](_0x277443[_0x54fb('0x52')],{'$or':_[_0x54fb('0x3f')](_0x277443[_0x54fb('0x48')],function(_0x20b510){var _0x1a387e={};_0x1a387e[_0x20b510]={'$like':'%'+_0x33b231[_0x54fb('0x44')][_0x54fb('0x50')]+'%'};return _0x1a387e;})});}_0x277443=_[_0x54fb('0x4e')]({},_0x277443,_0x33b231['options']);return _0x3b169e[_0x54fb('0x78')](_0x277443);}})[_0x54fb('0x21')](function(_0x3d81ab){if(_0x3d81ab){_0x3596d1=_0x3d81ab[_0x54fb('0x5a')];if(!_0x33b231[_0x54fb('0x44')]['hasOwnProperty'](_0x54fb('0x4b'))){_0x277443[_0x54fb('0x2f')]=qs[_0x54fb('0x2f')](_0x33b231['query'][_0x54fb('0x2f')]);_0x277443[_0x54fb('0x31')]=qs[_0x54fb('0x31')](_0x33b231['query'][_0x54fb('0x31')]);}return _0x3b169e[_0x54fb('0x78')](_0x277443);}})[_0x54fb('0x21')](function(_0x1c1065){if(_0x1c1065){return _0x1c1065?{'count':_0x3596d1,'rows':_0x1c1065}:null;}})[_0x54fb('0x21')](respondWithResult(_0x28ea4e,null))[_0x54fb('0x56')](handleError(_0x28ea4e,null));};exports[_0x54fb('0x79')]=function(_0x5367e1,_0x3f0f9c){var _0x42672f=_0x5367e1[_0x54fb('0x58')]['id'];var _0x40b873=_0x5367e1[_0x54fb('0x5e')];var _0x5c3d72=0xc8;var _0xdf2601=null;return db[_0x54fb('0x7a')][_0x54fb('0x7b')]({'isolationLevel':db['sequelize'][_0x54fb('0x7c')]['ISOLATION_LEVELS'][_0x54fb('0x7d')]},function(_0x4e6f06){return db[_0x54fb('0x40')]['findOne']({'where':{'id':_0x42672f},'transaction':_0x4e6f06})[_0x54fb('0x21')](function(_0x50d3e3){if(_0x50d3e3){return db[_0x54fb('0x7e')][_0x54fb('0x37')]({'where':{'WhatsappAccountId':_0x42672f},'transaction':_0x4e6f06})[_0x54fb('0x21')](function(){var _0x22e680=_[_0x54fb('0x3f')](_0x40b873,function(_0x5c5949){_0x5c5949[_0x54fb('0x66')]=_0x42672f;return _0x5c5949;});return db['WhatsappApplication'][_0x54fb('0x7f')](_0x22e680,{'transaction':_0x4e6f06});});}else{_0x5c3d72=0x194;_0xdf2601=[];}});})[_0x54fb('0x21')](function(){if(_0x5c3d72!==0x194){return db[_0x54fb('0x7e')][_0x54fb('0x80')]({'where':{'WhatsappAccountId':_0x42672f},'order':_0x54fb('0x81')})[_0x54fb('0x21')](function(_0x23f524){_0xdf2601=_0x23f524;});}})['catch'](function(_0x4d7192){_0x5c3d72=0x1f4;logger[_0x54fb('0x27')](_0x4d7192[_0x54fb('0x82')]);if(_0x4d7192[_0x54fb('0x3b')]){delete _0x4d7192[_0x54fb('0x3b')];}_0xdf2601=_0x4d7192;})[_0x54fb('0x83')](function(){if(_0xdf2601===null){_0x3f0f9c[_0x54fb('0x2b')](_0x5c3d72);}else{if(_0x5c3d72===0x1f4){_0x3f0f9c[_0x54fb('0x2c')](_0x5c3d72)['send'](_0xdf2601);}else{_0x3f0f9c[_0x54fb('0x2c')](_0x5c3d72)[_0x54fb('0x2d')](_0xdf2601);}}});};exports[_0x54fb('0x84')]=function(_0x44aa18,_0x41d0a9,_0x567e50){var _0x107b51={};var _0x2a46e7={};var _0x5d14ec;var _0x53b956;return db[_0x54fb('0x40')][_0x54fb('0x69')]({'where':{'id':_0x44aa18['params']['id']}})[_0x54fb('0x21')](handleEntityNotFound(_0x41d0a9,null))['then'](function(_0x3b1039){if(_0x3b1039){_0x5d14ec=_0x3b1039;_0x2a46e7[_0x54fb('0x47')]=_['keys'](db[_0x54fb('0x7e')][_0x54fb('0x59')]);_0x2a46e7[_0x54fb('0x44')]=_[_0x54fb('0x45')](_0x44aa18[_0x54fb('0x44')]);_0x2a46e7['filters']=_[_0x54fb('0x46')](_0x2a46e7[_0x54fb('0x47')],_0x2a46e7[_0x54fb('0x44')]);_0x107b51[_0x54fb('0x48')]=_[_0x54fb('0x46')](_0x2a46e7[_0x54fb('0x47')],qs[_0x54fb('0x49')](_0x44aa18[_0x54fb('0x44')][_0x54fb('0x49')]));_0x107b51['attributes']=_0x107b51[_0x54fb('0x48')][_0x54fb('0x5a')]?_0x107b51[_0x54fb('0x48')]:_0x2a46e7[_0x54fb('0x47')];_0x107b51[_0x54fb('0x70')]=qs[_0x54fb('0x6a')](_0x44aa18[_0x54fb('0x44')]['sort']);_0x107b51['where']=qs['filters'](_[_0x54fb('0x4d')](_0x44aa18[_0x54fb('0x44')],_0x2a46e7['filters']));if(_0x44aa18[_0x54fb('0x44')][_0x54fb('0x50')]){_0x107b51['where']=_[_0x54fb('0x4e')](_0x107b51[_0x54fb('0x52')],{'$or':_[_0x54fb('0x3f')](_0x107b51['attributes'],function(_0x5c1dd0){var _0x5c739a={};_0x5c739a[_0x5c1dd0]={'$like':'%'+_0x44aa18['query'][_0x54fb('0x50')]+'%'};return _0x5c739a;})});}_0x107b51=_[_0x54fb('0x4e')]({},_0x107b51,_0x44aa18[_0x54fb('0x51')]);return _0x5d14ec['getApplications'](_0x107b51);}})[_0x54fb('0x21')](function(_0x3ffcd8){if(_0x3ffcd8){_0x53b956=_0x3ffcd8['length'];if(!_0x44aa18[_0x54fb('0x44')][_0x54fb('0x4a')](_0x54fb('0x4b'))){_0x107b51[_0x54fb('0x2f')]=qs['limit'](_0x44aa18[_0x54fb('0x44')][_0x54fb('0x2f')]);_0x107b51['offset']=qs[_0x54fb('0x31')](_0x44aa18[_0x54fb('0x44')][_0x54fb('0x31')]);}return _0x5d14ec[_0x54fb('0x84')](_0x107b51);}})[_0x54fb('0x21')](function(_0xbe6c89){if(_0xbe6c89){return _0xbe6c89?{'count':_0x53b956,'rows':_0xbe6c89}:null;}})['then'](respondWithResult(_0x41d0a9,null))['catch'](handleError(_0x41d0a9,null));};exports['notify']=function(_0xadb21f,_0x1a2231,_0x101db9){var _0x5af22b={'channel':_0x54fb('0x85')};var _0x28d41d=[];var _0x434d9c=[];var _0x4eb617={};return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0xadb21f[_0x54fb('0x58')]['id']},'include':[{'model':db[_0x54fb('0x7e')],'as':_0x54fb('0x86')}]})[_0x54fb('0x21')](handleEntityNotFound(_0x1a2231,null))[_0x54fb('0x21')](function(_0x475260){_0x5af22b['account']=_0x475260;if(_0x5af22b[_0x54fb('0x87')]&&_0x5af22b['account']['type']===_0x54fb('0x88')&&_0xadb21f[_0x54fb('0x5e')][_0x54fb('0x89')]){if(_0xadb21f[_0x54fb('0x5e')]['statuses'][_0x54fb('0x5a')]===0x0)return;if(_0xadb21f[_0x54fb('0x5e')][_0x54fb('0x89')][0x0]['state']!==_0x54fb('0x8a'))return;return db[_0x54fb('0x8b')][_0x54fb('0x36')]({'read':!![],'readAt':_0xadb21f[_0x54fb('0x5e')][_0x54fb('0x89')][0x0][_0x54fb('0x8c')]},{'where':{'messageId':_0xadb21f[_0x54fb('0x5e')][_0x54fb('0x89')][0x0][_0x54fb('0x8d')]},'individualHooks':!![]})[_0x54fb('0x21')](function(_0x43bc48){return _0x1a2231[_0x54fb('0x2c')](0xc8)['json'](_0x43bc48);});}_0x5af22b['applications']=_['orderBy'](_0x475260[_0x54fb('0x86')],[_0x54fb('0x81')],[_0x54fb('0x8e')]);if(_0x5af22b[_0x54fb('0x87')][_0x54fb('0x86')]){delete _0x5af22b[_0x54fb('0x87')]['Applications'];}return db['CmContact'][_0x54fb('0x64')]()['then'](function(_0x553cc0){if(!_0x553cc0){throw new db[(_0x54fb('0x8f'))][(_0x54fb('0x90'))](_0x54fb('0x91'));}_0x28d41d=_[_0x54fb('0x92')](_[_0x54fb('0x45')](_0x553cc0),['createdAt',_0x54fb('0x93')]);_0x434d9c=_[_0x54fb('0x92')](_[_0x54fb('0x45')](_0x553cc0),[_0x54fb('0x94'),_0x54fb('0x93'),'CompanyId',_0x54fb('0x95')]);_0x5af22b[_0x54fb('0x5e')]={'mapKey':'mobile'};if(_0x5af22b[_0x54fb('0x87')]&&_0x5af22b[_0x54fb('0x87')][_0x54fb('0x42')]===_0x54fb('0x96')){_0x5af22b['body'][_0x54fb('0x97')]=_0xadb21f[_0x54fb('0x5e')]['From']['replace'](_0x54fb('0x98'),'');_0x5af22b[_0x54fb('0x5e')]['body']=_0xadb21f[_0x54fb('0x5e')][_0x54fb('0x99')];_0x5af22b[_0x54fb('0x5e')]['messageId']=_0xadb21f['body'][_0x54fb('0x9a')];}if(_0x5af22b[_0x54fb('0x87')]&&_0x5af22b[_0x54fb('0x87')][_0x54fb('0x42')]===_0x54fb('0x88')){_0x5af22b['body'][_0x54fb('0x97')]=_0xadb21f[_0x54fb('0x5e')][_0x54fb('0x9b')][0x0][_0x54fb('0x97')];_0x5af22b[_0x54fb('0x5e')]['body']=_0xadb21f[_0x54fb('0x5e')]['notifications'][0x0][_0x54fb('0x29')][_0x54fb('0x5e')];_0x5af22b[_0x54fb('0x5e')][_0x54fb('0x9c')]=_0xadb21f[_0x54fb('0x5e')]['notifications'][0x0][_0x54fb('0x8d')];}if(_0x5af22b[_0x54fb('0x5e')]['id']){delete _0x5af22b['body']['id'];}if(_[_0x54fb('0x9d')](_0x5af22b[_0x54fb('0x5e')][_0x54fb('0x97')])){throw new db[(_0x54fb('0x8f'))]['ValidationError'](_0x54fb('0x9e'));}if(_[_0x54fb('0x9d')](_0x5af22b['body']['body'])||_0x5af22b[_0x54fb('0x5e')][_0x54fb('0x5e')]===''){throw new db[(_0x54fb('0x8f'))][(_0x54fb('0x90'))](_0x54fb('0x9f'));}if(_[_0x54fb('0x9d')](_0x5af22b[_0x54fb('0x5e')][_0x54fb('0xa0')])){throw new db[(_0x54fb('0x8f'))][(_0x54fb('0x90'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x434d9c);}if(!_[_0x54fb('0xa1')](_0x434d9c,_0x5af22b[_0x54fb('0x5e')][_0x54fb('0xa0')])){throw new db[(_0x54fb('0x8f'))][(_0x54fb('0x90'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x434d9c);}_0x4eb617[_0x5af22b[_0x54fb('0x5e')][_0x54fb('0xa0')]]=_0x5af22b[_0x54fb('0x5e')][_0x54fb('0x97')];return db[_0x54fb('0xa2')]['find']({'where':{'id':_0x5af22b['account'][_0x54fb('0x95')]},'include':[{'model':db['CmContact'],'as':_0x54fb('0xa3'),'where':_0x4eb617,'limit':0x1,'order':[['updatedAt',_0x54fb('0xa4')]]}]});})[_0x54fb('0x21')](handleEntityNotFound(_0x1a2231,null))[_0x54fb('0x21')](function(_0x36ee21){if(_0x36ee21){_0x5af22b[_0x54fb('0xa5')]=_[_0x54fb('0x73')](_0x36ee21,[_0x54fb('0xa3')]);if(_0x36ee21[_0x54fb('0xa3')][_0x54fb('0x5a')]){return _0x36ee21[_0x54fb('0xa3')][0x0];}var _0x54a6c0=_[_0x54fb('0x1c')](_0x5af22b[_0x54fb('0x5e')],{'firstName':_0x5af22b[_0x54fb('0x5e')][_0x54fb('0x97')],'ListId':_0x36ee21['id']});_0x54a6c0[_0x5af22b[_0x54fb('0x5e')]['mapKey']]=_0x5af22b[_0x54fb('0x5e')][_0x54fb('0x97')];return db['CmContact'][_0x54fb('0x5d')](_0x54a6c0,{'fields':_0x28d41d,'raw':!![]});}})[_0x54fb('0x21')](handleEntityNotFound(_0x1a2231,null))[_0x54fb('0x21')](function(_0x3e63b6){if(_0x3e63b6){_0x5af22b[_0x54fb('0xa6')]=_0x3e63b6;var _0x3cc332={'ContactId':_0x3e63b6['id'],'phone':_0x5af22b[_0x54fb('0x5e')][_0x54fb('0x97')],'WhatsappAccountId':_0xadb21f[_0x54fb('0x58')]['id']};var _0x4b716c={'ContactId':_0x3e63b6['id'],'WhatsappAccountId':_0xadb21f[_0x54fb('0x58')]['id'],'closed':![]};return db[_0x54fb('0xa7')][_0x54fb('0x5c')]({'where':_0x4b716c})[_0x54fb('0x21')](function(_0x53aeba){if(_0x53aeba){return[_0x53aeba,![]];}return db[_0x54fb('0xa7')][_0x54fb('0x5d')](_0x3cc332)[_0x54fb('0x21')](function(_0x27b3f8){return[_0x27b3f8,!![]];});});}})['spread'](function(_0x99719d,_0x2a6293){_0x5af22b[_0x54fb('0xa8')]=_0x99719d[_0x54fb('0x38')]({'plain':!![]});_0x5af22b[_0x54fb('0xa8')]['created']=![];if(_0x2a6293){if(_0x5af22b[_0x54fb('0x87')][_0x54fb('0xa9')]){_0x5af22b['applications'][_0x54fb('0xaa')]({'id':0x0,'priority':_0x5af22b['applications'][_0x54fb('0x5a')]+0x1,'app':_0x54fb('0xab'),'appdata':'unmanaged','interval':_0x54fb('0xac')});}_0x5af22b[_0x54fb('0xa8')][_0x54fb('0xad')]=!![];}return db[_0x54fb('0x8b')][_0x54fb('0x5d')]({'phone':_0x5af22b[_0x54fb('0x5e')][_0x54fb('0x97')],'messageId':_0x5af22b['body'][_0x54fb('0x9c')],'body':_0x5af22b[_0x54fb('0x5e')]['body'],'WhatsappAccountId':_0xadb21f[_0x54fb('0x58')]['id'],'WhatsappInteractionId':_0x99719d['id'],'direction':'in','ContactId':_0x99719d[_0x54fb('0xae')],'AttachmentId':_0x5af22b[_0x54fb('0x5e')]['AttachmentId']});})[_0x54fb('0x21')](function(_0x3bd365){_0x5af22b['message']=_0x3bd365;if(_0x5af22b[_0x54fb('0xa8')][_0x54fb('0xaf')]){return db[_0x54fb('0xb0')][_0x54fb('0x5c')]({'attributes':['id',_0x54fb('0x3b')],'where':{'id':_0x5af22b[_0x54fb('0xa8')][_0x54fb('0xaf')]}})['then'](function(_0x270dd2){if(_0x270dd2){_0x5af22b[_0x54fb('0xb1')][_0x54fb('0xb2')]({'id':0x0,'priority':0x0,'app':_0x54fb('0xb3'),'appdata':_0x270dd2[_0x54fb('0x3b')]+','+(_0x5af22b[_0x54fb('0x87')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x54fb('0xb4'),_0x5af22b);});}return respondWithRpcPromise(_0x54fb('0xb5'),_0x54fb('0xb4'),_0x5af22b);})['then'](function(_0x42e498){if(_0x42e498){var _0x54433f=0xc8;var _0x58afcf='receiveMessage';logger[_0x54fb('0x2a')](_0x54fb('0x25'),_0x58afcf,_0x54433f,_0x54fb('0xb6'));logger[_0x54fb('0x24')](_0x54fb('0xb7'),_0x58afcf,_0x54433f,_0x54fb('0xb6'),JSON[_0x54fb('0x26')](_0x42e498));if(_0x5af22b[_0x54fb('0x87')][_0x54fb('0x42')]===_0x54fb('0x96')){return _0x1a2231[_0x54fb('0x2c')](_0x54433f)[_0x54fb('0x32')](_0x54fb('0xb8'),'text/xml')['send'](_0x54fb('0xb9'));}else{return _0x1a2231[_0x54fb('0x2c')](_0x54433f)[_0x54fb('0x2d')](_0x42e498);}}});})[_0x54fb('0x56')](handleError(_0x1a2231,null));};exports[_0x54fb('0xba')]=function(_0x222e95,_0x43ca67,_0x2ce686){var _0x156777,_0x18d8cc,_0x288b3e;if(_[_0x54fb('0x9d')](_0x222e95[_0x54fb('0x5e')]['body'])||_0x222e95[_0x54fb('0x5e')][_0x54fb('0x5e')]===''){throw new db[(_0x54fb('0x8f'))]['ValidationError'](_0x54fb('0x9f'));}if(_[_0x54fb('0x9d')](_0x222e95['body']['to'])){throw new db[(_0x54fb('0x8f'))][(_0x54fb('0x90'))](_0x54fb('0xbb'));}_0x156777=_0x222e95['body']['to'];return db[_0x54fb('0x40')][_0x54fb('0x5c')]({'where':{'id':_0x222e95[_0x54fb('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x54fb('0xbc'),'include':[{'model':db[_0x54fb('0xbd')],'as':'Contacts','where':{'mobile':_0x156777},'limit':0x1,'order':[[_0x54fb('0x93'),_0x54fb('0xa4')]]}]}]})[_0x54fb('0x21')](handleEntityNotFound(_0x43ca67,null))[_0x54fb('0x21')](function(_0x3a5dc1){if(_0x3a5dc1&&_0x3a5dc1[_0x54fb('0xbc')]){_0x18d8cc=_0x3a5dc1[_0x54fb('0x38')]({'plain':!![]});if(_0x18d8cc[_0x54fb('0xbc')]&&_0x18d8cc[_0x54fb('0xbc')]['Contacts']['length']){return _0x18d8cc[_0x54fb('0xbc')][_0x54fb('0xa3')][0x0];}return db[_0x54fb('0xbd')]['create'](_[_0x54fb('0x1c')](_0x222e95['body'],{'firstName':_0x156777,'mobile':_0x156777,'phone':_0x156777,'ListId':_0x18d8cc[_0x54fb('0x95')]}));}})['then'](handleEntityNotFound(_0x43ca67,null))[_0x54fb('0x21')](function(_0xb73a4d){if(_0xb73a4d){_0x288b3e=_0xb73a4d;return db['WhatsappInteraction'][_0x54fb('0x5c')]({'where':{'ContactId':_0x288b3e['id'],'closed':![],'WhatsappAccountId':_0x18d8cc['id']}})[_0x54fb('0x21')](function(_0x5179d9){if(_0x5179d9){return[_0x5179d9,![]];}return db[_0x54fb('0xa7')][_0x54fb('0x5d')]({'UserId':_0x222e95[_0x54fb('0x60')]['id'],'ContactId':_0x288b3e['id'],'WhatsappAccountId':_0x18d8cc['id'],'phone':_0x156777,'firstMsgDirection':'out','Messages':[_['merge'](_0x222e95['body'],{'read':![],'body':_0x222e95['body']['body'],'phone':_0x156777,'WhatsappAccountId':_0x18d8cc['id'],'UserId':_0x222e95[_0x54fb('0x60')]['id'],'ContactId':_0x288b3e['id']})]},{'include':[{'model':db[_0x54fb('0x8b')],'as':_0x54fb('0xbe')}]})['then'](function(_0x321272){return[_0x321272,!![]];});});}})['spread'](function(_0x27e739,_0x59f29d){if(_0x59f29d){return _0x27e739;}return db[_0x54fb('0x8b')][_0x54fb('0x5d')](_[_0x54fb('0x4e')](_0x222e95['body'],{'read':![],'body':_0x222e95[_0x54fb('0x5e')]['body'],'phone':_0x156777,'WhatsappAccountId':_0x18d8cc['id'],'WhatsappInteractionId':_0x27e739['id'],'UserId':_0x222e95[_0x54fb('0x60')]['id'],'ContactId':_0x288b3e['id']}))[_0x54fb('0x21')](function(_0x153bc0){_0x27e739[_0x54fb('0xbf')]['Messages']=[];_0x27e739[_0x54fb('0xbf')][_0x54fb('0xbe')][_0x54fb('0xaa')](_0x153bc0['dataValues']);return _0x27e739;});})[_0x54fb('0x21')](respondWithResult(_0x43ca67,null))[_0x54fb('0x56')](handleError(_0x43ca67,null));}; \ No newline at end of file +var _0x9ae5=['whatsapp:','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','\x0a','to\x20is\x20mandatory','List','defaults','out','spread','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','VIRTUAL','options','show','params','Pause','includeAll','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','order','findAll','rows','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','message_id','applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','from','replace'];(function(_0x1f2d53,_0x1fa718){var _0x3c7450=function(_0x3e6dd4){while(--_0x3e6dd4){_0x1f2d53['push'](_0x1f2d53['shift']());}};_0x3c7450(++_0x1fa718);}(_0x9ae5,0xf1));var _0x59ae=function(_0x510715,_0x3c0d3f){_0x510715=_0x510715-0x0;var _0x56c811=_0x9ae5[_0x510715];return _0x56c811;};'use strict';var emlformat=require(_0x59ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59ae('0x1'));var jsonpatch=require(_0x59ae('0x2'));var rp=require(_0x59ae('0x3'));var moment=require(_0x59ae('0x4'));var BPromise=require(_0x59ae('0x5'));var Mustache=require(_0x59ae('0x6'));var util=require(_0x59ae('0x7'));var path=require(_0x59ae('0x8'));var sox=require(_0x59ae('0x9'));var csv=require(_0x59ae('0xa'));var ejs=require(_0x59ae('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x59ae('0xc'));var crypto=require('crypto');var jsforce=require(_0x59ae('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x59ae('0xa'));var querystring=require(_0x59ae('0xe'));var Papa=require(_0x59ae('0xf'));var Redis=require(_0x59ae('0x10'));var authService=require(_0x59ae('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x59ae('0x12'));var hardwareService=require(_0x59ae('0x13'));var logger=require(_0x59ae('0x14'))(_0x59ae('0x15'));var utils=require(_0x59ae('0x16'));var config=require(_0x59ae('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x59ae('0x18'))['db'];config['redis']=_['defaults'](config[_0x59ae('0x19')],{'host':_0x59ae('0x1a'),'port':0x18eb});var socket=require(_0x59ae('0x1b'))(new Redis(config['redis']));require(_0x59ae('0x1c'))[_0x59ae('0x1d')](socket);var jayson=require(_0x59ae('0x1e'));var client=jayson['client'][_0x59ae('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x12a915,_0x35427a,_0x2bfcfb,_0x1c97d3){return new BPromise(function(_0x3d3f8a,_0x3cb2d4){var _0x141a2a=_0x1c97d3||client;return _0x141a2a['request'](_0x12a915,_0x2bfcfb)['then'](function(_0x1e5538){logger[_0x59ae('0x20')](_0x59ae('0x21'),_0x35427a,_0x59ae('0x22'));logger[_0x59ae('0x23')](_0x59ae('0x24'),_0x35427a,'request\x20sent',JSON['stringify'](_0x1e5538));if(_0x1e5538['error']){if(_0x1e5538[_0x59ae('0x25')][_0x59ae('0x26')]===0x1f4){logger[_0x59ae('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x35427a,_0x1e5538[_0x59ae('0x25')][_0x59ae('0x27')]);return _0x3cb2d4(_0x1e5538[_0x59ae('0x25')]['message']);}logger[_0x59ae('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x35427a,_0x1e5538[_0x59ae('0x25')][_0x59ae('0x27')]);return _0x3d3f8a(_0x1e5538[_0x59ae('0x25')][_0x59ae('0x27')]);}else{logger['info'](_0x59ae('0x21'),_0x35427a,'request\x20sent');_0x3d3f8a(_0x1e5538[_0x59ae('0x28')][_0x59ae('0x27')]);}})['catch'](function(_0xd26bf7){logger[_0x59ae('0x25')](_0x59ae('0x21'),_0x35427a,_0xd26bf7);_0x3cb2d4(_0xd26bf7);});});}function respondWithStatusCode(_0x10b0bf,_0x5280ae){_0x5280ae=_0x5280ae||0xcc;return function(_0x51096f){if(_0x51096f){return _0x10b0bf[_0x59ae('0x29')](_0x5280ae);}return _0x10b0bf[_0x59ae('0x2a')](_0x5280ae)[_0x59ae('0x2b')]();};}function respondWithResult(_0x3f1591,_0x319706){_0x319706=_0x319706||0xc8;return function(_0x5d544e){if(_0x5d544e){return _0x3f1591['status'](_0x319706)['json'](_0x5d544e);}};}function respondWithFilteredResult(_0x2a6fcf,_0xc15e1c){return function(_0x3e95f6){if(_0x3e95f6){var _0x548a25=typeof _0xc15e1c[_0x59ae('0x2c')]===_0x59ae('0x2d')&&typeof _0xc15e1c['limit']===_0x59ae('0x2d');var _0x11300b=_0x3e95f6['count'];var _0x341e4a=_0x548a25?0x0:_0xc15e1c[_0x59ae('0x2c')];var _0x323c64=_0x548a25?_0x3e95f6[_0x59ae('0x2e')]:_0xc15e1c[_0x59ae('0x2c')]+_0xc15e1c['limit'];var _0x472629;if(_0x323c64>=_0x11300b){_0x323c64=_0x11300b;_0x472629=0xc8;}else{_0x472629=0xce;}_0x2a6fcf['status'](_0x472629);return _0x2a6fcf[_0x59ae('0x2f')](_0x59ae('0x30'),_0x341e4a+'-'+_0x323c64+'/'+_0x11300b)[_0x59ae('0x31')](_0x3e95f6);}return null;};}function patchUpdates(_0x58632d){return function(_0x201776){try{jsonpatch[_0x59ae('0x32')](_0x201776,_0x58632d,!![]);}catch(_0x8ccb4){return BPromise[_0x59ae('0x33')](_0x8ccb4);}return _0x201776['save']();};}function saveUpdates(_0x1ab0ca,_0x1e9e74){return function(_0x54bd1c){if(_0x54bd1c){return _0x54bd1c[_0x59ae('0x34')](_0x1ab0ca)[_0x59ae('0x35')](function(_0x5a27b0){return _0x5a27b0;});}return null;};}function removeEntity(_0x2ca116,_0x35e301){return function(_0xb590ca){if(_0xb590ca){return _0xb590ca[_0x59ae('0x36')]()[_0x59ae('0x35')](function(){var _0x2300a7=_0xb590ca['get']({'plain':!![]});var _0x1fe1d9=_0x59ae('0x37');return db[_0x59ae('0x38')]['destroy']({'where':{'type':_0x1fe1d9,'resourceId':_0x2300a7['id']}})[_0x59ae('0x35')](function(){return _0xb590ca;});})[_0x59ae('0x35')](function(){_0x2ca116['status'](0xcc)[_0x59ae('0x2b')]();});}};}function handleEntityNotFound(_0x5f2db8,_0x179341){return function(_0x47f053){if(!_0x47f053){_0x5f2db8[_0x59ae('0x29')](0x194);}return _0x47f053;};}function handleError(_0x7cfe4c,_0x423b78){_0x423b78=_0x423b78||0x1f4;return function(_0x59dd85){logger[_0x59ae('0x25')](_0x59dd85[_0x59ae('0x39')]);if(_0x59dd85[_0x59ae('0x3a')]){delete _0x59dd85[_0x59ae('0x3a')];}_0x7cfe4c[_0x59ae('0x2a')](_0x423b78)[_0x59ae('0x3b')](_0x59dd85);};}exports['index']=function(_0xfb74d6,_0x2d4f74){var _0x27cb54={'include':[{'model':db['Pause'],'as':_0x59ae('0x3c')}]},_0x1efcca={},_0x40f20c={'count':0x0,'rows':[]};var _0x590264=_['map'](db[_0x59ae('0x3d')][_0x59ae('0x3e')],function(_0x4102c9){return{'name':_0x4102c9[_0x59ae('0x3f')],'type':_0x4102c9[_0x59ae('0x40')][_0x59ae('0x41')]};});_0x1efcca['model']=_['map'](_0x590264,_0x59ae('0x3a'));_0x1efcca[_0x59ae('0x42')]=_[_0x59ae('0x43')](_0xfb74d6['query']);_0x1efcca[_0x59ae('0x44')]=_['intersection'](_0x1efcca[_0x59ae('0x45')],_0x1efcca[_0x59ae('0x42')]);_0x27cb54[_0x59ae('0x46')]=_[_0x59ae('0x47')](_0x1efcca[_0x59ae('0x45')],qs['fields'](_0xfb74d6[_0x59ae('0x42')][_0x59ae('0x48')]));_0x27cb54[_0x59ae('0x46')]=_0x27cb54['attributes'][_0x59ae('0x49')]?_0x27cb54[_0x59ae('0x46')]:_0x1efcca[_0x59ae('0x45')];if(!_0xfb74d6[_0x59ae('0x42')][_0x59ae('0x4a')](_0x59ae('0x4b'))){_0x27cb54[_0x59ae('0x4c')]=qs[_0x59ae('0x4c')](_0xfb74d6[_0x59ae('0x42')][_0x59ae('0x4c')]);_0x27cb54[_0x59ae('0x2c')]=qs[_0x59ae('0x2c')](_0xfb74d6[_0x59ae('0x42')][_0x59ae('0x2c')]);}_0x27cb54['order']=qs['sort'](_0xfb74d6[_0x59ae('0x42')][_0x59ae('0x4d')]);_0x27cb54[_0x59ae('0x4e')]=qs['filters'](_[_0x59ae('0x4f')](_0xfb74d6[_0x59ae('0x42')],_0x1efcca[_0x59ae('0x44')]),_0x590264);if(_0xfb74d6[_0x59ae('0x42')][_0x59ae('0x50')]){_0x27cb54['where']=_[_0x59ae('0x51')](_0x27cb54['where'],{'$or':_[_0x59ae('0x52')](_0x590264,function(_0x18c8cf){if(_0x18c8cf[_0x59ae('0x40')]!==_0x59ae('0x53')){var _0x153bf9={};_0x153bf9[_0x18c8cf[_0x59ae('0x3a')]]={'$like':'%'+_0xfb74d6[_0x59ae('0x42')]['filter']+'%'};return _0x153bf9;}})});}_0x27cb54=_[_0x59ae('0x51')]({},_0x27cb54,_0xfb74d6[_0x59ae('0x54')]);var _0x67de7e={'where':_0x27cb54[_0x59ae('0x4e')]};return db['WhatsappAccount'][_0x59ae('0x2e')](_0x67de7e)['then'](function(_0x51e05a){_0x40f20c[_0x59ae('0x2e')]=_0x51e05a;if(_0xfb74d6['query']['includeAll']){_0x27cb54['include']=[{'all':!![]}];}return db[_0x59ae('0x3d')]['findAll'](_0x27cb54);})[_0x59ae('0x35')](function(_0x388345){_0x40f20c['rows']=_0x388345;return _0x40f20c;})[_0x59ae('0x35')](respondWithFilteredResult(_0x2d4f74,_0x27cb54))['catch'](handleError(_0x2d4f74,null));};exports[_0x59ae('0x55')]=function(_0x560b9f,_0x23542d){var _0x1af51f={'raw':![],'where':{'id':_0x560b9f[_0x59ae('0x56')]['id']},'include':[{'model':db[_0x59ae('0x57')],'as':_0x59ae('0x3c')}]},_0x535d04={};_0x535d04[_0x59ae('0x45')]=_['keys'](db[_0x59ae('0x3d')]['rawAttributes']);_0x535d04[_0x59ae('0x42')]=_[_0x59ae('0x43')](_0x560b9f[_0x59ae('0x42')]);_0x535d04[_0x59ae('0x44')]=_['intersection'](_0x535d04[_0x59ae('0x45')],_0x535d04['query']);_0x1af51f[_0x59ae('0x46')]=_['intersection'](_0x535d04['model'],qs[_0x59ae('0x48')](_0x560b9f['query'][_0x59ae('0x48')]));_0x1af51f[_0x59ae('0x46')]=_0x1af51f['attributes'][_0x59ae('0x49')]?_0x1af51f['attributes']:_0x535d04[_0x59ae('0x45')];if(_0x560b9f[_0x59ae('0x42')][_0x59ae('0x58')]){_0x1af51f[_0x59ae('0x59')]=[{'all':!![]}];}_0x1af51f=_[_0x59ae('0x51')]({},_0x1af51f,_0x560b9f[_0x59ae('0x54')]);return db[_0x59ae('0x3d')]['find'](_0x1af51f)['then'](handleEntityNotFound(_0x23542d,null))['then'](respondWithResult(_0x23542d,null))['catch'](handleError(_0x23542d,null));};exports[_0x59ae('0x5a')]=function(_0x11dfc6,_0xc6d8f0){return db[_0x59ae('0x3d')]['create'](_0x11dfc6['body'],{})[_0x59ae('0x35')](function(_0x118479){var _0x349da7=_0x11dfc6[_0x59ae('0x5b')][_0x59ae('0x5c')]({'plain':!![]});if(!_0x349da7)throw new Error(_0x59ae('0x5d'));if(_0x349da7['role']===_0x59ae('0x5b')){var _0xe7aed3=_0x118479[_0x59ae('0x5c')]({'plain':!![]});var _0x23f4a8=_0x59ae('0x37');return db['UserProfileSection'][_0x59ae('0x5e')]({'where':{'name':_0x23f4a8,'userProfileId':_0x349da7[_0x59ae('0x5f')]},'raw':!![]})['then'](function(_0x56e22b){if(_0x56e22b&&_0x56e22b['autoAssociation']===0x0){return db['UserProfileResource'][_0x59ae('0x5a')]({'name':_0xe7aed3[_0x59ae('0x3a')],'resourceId':_0xe7aed3['id'],'type':_0x56e22b[_0x59ae('0x3a')],'sectionId':_0x56e22b['id']},{})[_0x59ae('0x35')](function(){return _0x118479;});}else{return _0x118479;}})[_0x59ae('0x60')](function(_0x2209b4){logger[_0x59ae('0x25')](_0x59ae('0x61'),_0x2209b4);throw _0x2209b4;});}return _0x118479;})['then'](respondWithResult(_0xc6d8f0,0xc9))[_0x59ae('0x60')](handleError(_0xc6d8f0,null));};exports[_0x59ae('0x34')]=function(_0x4e5edc,_0x2cc86c){if(_0x4e5edc['body']['id']){delete _0x4e5edc[_0x59ae('0x62')]['id'];}return db['WhatsappAccount'][_0x59ae('0x5e')]({'where':{'id':_0x4e5edc[_0x59ae('0x56')]['id']},'include':[{'model':db[_0x59ae('0x57')],'as':_0x59ae('0x3c')}]})['then'](handleEntityNotFound(_0x2cc86c,null))[_0x59ae('0x35')](saveUpdates(_0x4e5edc[_0x59ae('0x62')],null))[_0x59ae('0x35')](respondWithResult(_0x2cc86c,null))[_0x59ae('0x60')](handleError(_0x2cc86c,null));};exports[_0x59ae('0x36')]=function(_0x497620,_0x120e37){return db[_0x59ae('0x3d')][_0x59ae('0x5e')]({'where':{'id':_0x497620[_0x59ae('0x56')]['id']}})[_0x59ae('0x35')](handleEntityNotFound(_0x120e37,null))[_0x59ae('0x35')](removeEntity(_0x120e37,null))[_0x59ae('0x60')](handleError(_0x120e37,null));};exports[_0x59ae('0x63')]=function(_0x46525d,_0x2bcb68){return db['WhatsappAccount'][_0x59ae('0x63')]()[_0x59ae('0x35')](respondWithResult(_0x2bcb68,null))[_0x59ae('0x60')](handleError(_0x2bcb68,null));};exports[_0x59ae('0x64')]=function(_0x1b2f12,_0x571df1,_0x1ce46a){if(_0x1b2f12['body']['id']){delete _0x1b2f12[_0x59ae('0x62')]['id'];}return db[_0x59ae('0x3d')][_0x59ae('0x5e')]({'where':{'id':_0x1b2f12[_0x59ae('0x56')]['id']}})[_0x59ae('0x35')](handleEntityNotFound(_0x571df1,null))[_0x59ae('0x35')](function(_0x9e02ad){if(_0x9e02ad){_0x1b2f12[_0x59ae('0x62')][_0x59ae('0x65')]=_0x9e02ad['id'];return db[_0x59ae('0x66')][_0x59ae('0x5a')](_0x1b2f12['body']);}})[_0x59ae('0x35')](respondWithResult(_0x571df1,null))[_0x59ae('0x60')](handleError(_0x571df1,null));};exports['getDispositions']=function(_0x4e5d52,_0x1aa28a,_0x1bc422){var _0x5f0dd6={'raw':![],'where':{}};var _0x5984e3={};var _0x1915b6={'count':0x0,'rows':[]};return db[_0x59ae('0x3d')]['findOne']({'where':{'id':_0x4e5d52[_0x59ae('0x56')]['id']}})[_0x59ae('0x35')](handleEntityNotFound(_0x1aa28a,null))[_0x59ae('0x35')](function(_0x24c8b5){if(_0x24c8b5){_0x5984e3[_0x59ae('0x45')]=_[_0x59ae('0x43')](db[_0x59ae('0x66')]['rawAttributes']);_0x5984e3[_0x59ae('0x42')]=_[_0x59ae('0x43')](_0x4e5d52[_0x59ae('0x42')]);_0x5984e3['filters']=_[_0x59ae('0x47')](_0x5984e3[_0x59ae('0x45')],_0x5984e3[_0x59ae('0x42')]);_0x5f0dd6[_0x59ae('0x46')]=_[_0x59ae('0x47')](_0x5984e3['model'],qs[_0x59ae('0x48')](_0x4e5d52['query'][_0x59ae('0x48')]));_0x5f0dd6[_0x59ae('0x46')]=_0x5f0dd6[_0x59ae('0x46')][_0x59ae('0x49')]?_0x5f0dd6[_0x59ae('0x46')]:_0x5984e3[_0x59ae('0x45')];if(!_0x4e5d52[_0x59ae('0x42')][_0x59ae('0x4a')]('nolimit')){_0x5f0dd6[_0x59ae('0x4c')]=qs[_0x59ae('0x4c')](_0x4e5d52['query'][_0x59ae('0x4c')]);_0x5f0dd6['offset']=qs[_0x59ae('0x2c')](_0x4e5d52[_0x59ae('0x42')][_0x59ae('0x2c')]);}_0x5f0dd6['order']=qs[_0x59ae('0x4d')](_0x4e5d52[_0x59ae('0x42')][_0x59ae('0x4d')]);_0x5f0dd6[_0x59ae('0x4e')]=qs['filters'](_[_0x59ae('0x4f')](_0x4e5d52[_0x59ae('0x42')],_0x5984e3[_0x59ae('0x44')]));_0x5f0dd6['where'][_0x59ae('0x65')]=_0x24c8b5['id'];if(_0x4e5d52[_0x59ae('0x42')][_0x59ae('0x50')]){_0x5f0dd6[_0x59ae('0x4e')]=_['merge'](_0x5f0dd6[_0x59ae('0x4e')],{'$or':_[_0x59ae('0x52')](_0x5f0dd6[_0x59ae('0x46')],function(_0x1421fd){var _0x4e8664={};_0x4e8664[_0x1421fd]={'$like':'%'+_0x4e5d52[_0x59ae('0x42')][_0x59ae('0x50')]+'%'};return _0x4e8664;})});}_0x5f0dd6=_[_0x59ae('0x51')]({},_0x5f0dd6,_0x4e5d52[_0x59ae('0x54')]);return db['Disposition'][_0x59ae('0x2e')]({'where':_0x5f0dd6[_0x59ae('0x4e')]})[_0x59ae('0x35')](function(_0x203926){_0x1915b6['count']=_0x203926;if(_0x4e5d52[_0x59ae('0x42')][_0x59ae('0x58')]){_0x5f0dd6['include']=[{'all':!![]}];}return db[_0x59ae('0x66')]['findAll'](_0x5f0dd6);})['then'](function(_0x17eaa6){_0x1915b6['rows']=_0x17eaa6;return _0x1915b6;});}})['then'](respondWithFilteredResult(_0x1aa28a,_0x5f0dd6))[_0x59ae('0x60')](handleError(_0x1aa28a,null));};exports[_0x59ae('0x67')]=function(_0x4526c1,_0x10948b,_0x244d67){return db[_0x59ae('0x3d')]['find']({'where':{'id':_0x4526c1[_0x59ae('0x56')]['id']}})[_0x59ae('0x35')](handleEntityNotFound(_0x10948b,null))[_0x59ae('0x35')](function(_0x2fdcc9){if(_0x2fdcc9){return _0x2fdcc9['removeDispositions'](_0x4526c1['query'][_0x59ae('0x68')]);}})['then'](respondWithStatusCode(_0x10948b,null))[_0x59ae('0x60')](handleError(_0x10948b,null));};exports[_0x59ae('0x69')]=function(_0x2d3402,_0x3deea8,_0x5242bd){if(_0x2d3402['body']['id']){delete _0x2d3402[_0x59ae('0x62')]['id'];}return db[_0x59ae('0x3d')][_0x59ae('0x5e')]({'where':{'id':_0x2d3402[_0x59ae('0x56')]['id']}})[_0x59ae('0x35')](handleEntityNotFound(_0x3deea8,null))[_0x59ae('0x35')](function(_0x1e2a26){if(_0x1e2a26){_0x2d3402[_0x59ae('0x62')]['WhatsappAccountId']=_0x1e2a26['id'];return db[_0x59ae('0x6a')][_0x59ae('0x5a')](_0x2d3402[_0x59ae('0x62')]);}})['then'](respondWithResult(_0x3deea8,null))[_0x59ae('0x60')](handleError(_0x3deea8,null));};exports[_0x59ae('0x6b')]=function(_0x5f40eb,_0x2bc756,_0x37dc50){var _0x14b4d1={'raw':![],'where':{}};var _0x42ef1d={};var _0x120779={'count':0x0,'rows':[]};return db[_0x59ae('0x3d')][_0x59ae('0x6c')]({'where':{'id':_0x5f40eb['params']['id']}})[_0x59ae('0x35')](handleEntityNotFound(_0x2bc756,null))[_0x59ae('0x35')](function(_0x530386){if(_0x530386){_0x42ef1d[_0x59ae('0x45')]=_[_0x59ae('0x43')](db[_0x59ae('0x6a')][_0x59ae('0x3e')]);_0x42ef1d['query']=_[_0x59ae('0x43')](_0x5f40eb[_0x59ae('0x42')]);_0x42ef1d[_0x59ae('0x44')]=_[_0x59ae('0x47')](_0x42ef1d[_0x59ae('0x45')],_0x42ef1d[_0x59ae('0x42')]);_0x14b4d1[_0x59ae('0x46')]=_[_0x59ae('0x47')](_0x42ef1d[_0x59ae('0x45')],qs[_0x59ae('0x48')](_0x5f40eb[_0x59ae('0x42')][_0x59ae('0x48')]));_0x14b4d1[_0x59ae('0x46')]=_0x14b4d1[_0x59ae('0x46')][_0x59ae('0x49')]?_0x14b4d1[_0x59ae('0x46')]:_0x42ef1d[_0x59ae('0x45')];if(!_0x5f40eb[_0x59ae('0x42')][_0x59ae('0x4a')](_0x59ae('0x4b'))){_0x14b4d1[_0x59ae('0x4c')]=qs['limit'](_0x5f40eb['query'][_0x59ae('0x4c')]);_0x14b4d1[_0x59ae('0x2c')]=qs[_0x59ae('0x2c')](_0x5f40eb[_0x59ae('0x42')][_0x59ae('0x2c')]);}_0x14b4d1[_0x59ae('0x6d')]=qs[_0x59ae('0x4d')](_0x5f40eb[_0x59ae('0x42')]['sort']);_0x14b4d1['where']=qs['filters'](_['pick'](_0x5f40eb[_0x59ae('0x42')],_0x42ef1d[_0x59ae('0x44')]));_0x14b4d1[_0x59ae('0x4e')][_0x59ae('0x65')]=_0x530386['id'];if(_0x5f40eb[_0x59ae('0x42')][_0x59ae('0x50')]){_0x14b4d1['where']=_[_0x59ae('0x51')](_0x14b4d1[_0x59ae('0x4e')],{'$or':_[_0x59ae('0x52')](_0x14b4d1[_0x59ae('0x46')],function(_0x41be9a){var _0xe45ec5={};_0xe45ec5[_0x41be9a]={'$like':'%'+_0x5f40eb[_0x59ae('0x42')]['filter']+'%'};return _0xe45ec5;})});}_0x14b4d1=_[_0x59ae('0x51')]({},_0x14b4d1,_0x5f40eb[_0x59ae('0x54')]);return db[_0x59ae('0x6a')][_0x59ae('0x2e')]({'where':_0x14b4d1['where']})[_0x59ae('0x35')](function(_0x1d4522){_0x120779[_0x59ae('0x2e')]=_0x1d4522;if(_0x5f40eb[_0x59ae('0x42')][_0x59ae('0x58')]){_0x14b4d1[_0x59ae('0x59')]=[{'all':!![]}];}return db[_0x59ae('0x6a')][_0x59ae('0x6e')](_0x14b4d1);})[_0x59ae('0x35')](function(_0x4de287){_0x120779[_0x59ae('0x6f')]=_0x4de287;return _0x120779;});}})[_0x59ae('0x35')](respondWithFilteredResult(_0x2bc756,_0x14b4d1))[_0x59ae('0x60')](handleError(_0x2bc756,null));};exports[_0x59ae('0x70')]=function(_0x3002a0,_0x218175,_0x44a0fa){return db['WhatsappAccount'][_0x59ae('0x5e')]({'where':{'id':_0x3002a0['params']['id']}})[_0x59ae('0x35')](handleEntityNotFound(_0x218175,null))['then'](function(_0x38c1c8){if(_0x38c1c8){return _0x38c1c8[_0x59ae('0x70')](_0x3002a0[_0x59ae('0x42')][_0x59ae('0x68')]);}})['then'](respondWithStatusCode(_0x218175,null))[_0x59ae('0x60')](handleError(_0x218175,null));};exports['addAgents']=function(_0x420bfe,_0x5bb767,_0x17a3b9){return db[_0x59ae('0x3d')][_0x59ae('0x5e')]({'where':{'id':_0x420bfe['params']['id']}})['then'](handleEntityNotFound(_0x5bb767,null))[_0x59ae('0x35')](function(_0x272570){if(_0x272570){return _0x272570[_0x59ae('0x71')](_0x420bfe[_0x59ae('0x62')][_0x59ae('0x68')],_[_0x59ae('0x72')](_0x420bfe[_0x59ae('0x62')],['ids','id'])||{})['spread'](function(_0x44befe){for(var _0x3a34c3=0x0;_0x3a34c3<_0x420bfe[_0x59ae('0x62')][_0x59ae('0x68')][_0x59ae('0x49')];_0x3a34c3+=0x1){socket[_0x59ae('0x73')](_0x59ae('0x74'),{'UserId':Number(_0x420bfe['body'][_0x59ae('0x68')][_0x3a34c3]),'WhatsappAccountId':Number(_0x420bfe[_0x59ae('0x56')]['id'])});}return _0x44befe;});}})[_0x59ae('0x35')](respondWithResult(_0x5bb767,null))['catch'](handleError(_0x5bb767,null));};exports[_0x59ae('0x75')]=function(_0x1733e7,_0xe3f7c4,_0x2e294a){return db[_0x59ae('0x3d')][_0x59ae('0x5e')]({'where':{'id':_0x1733e7['params']['id']}})['then'](handleEntityNotFound(_0xe3f7c4,null))[_0x59ae('0x35')](function(_0x35d2ea){if(_0x35d2ea){return _0x35d2ea[_0x59ae('0x75')](_0x1733e7['query'][_0x59ae('0x68')])[_0x59ae('0x35')](function(){if(_['isArray'](_0x1733e7[_0x59ae('0x42')]['ids'])){for(var _0x32f04a=0x0;_0x32f04a<_0x1733e7['query']['ids'][_0x59ae('0x49')];_0x32f04a+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x1733e7[_0x59ae('0x42')][_0x59ae('0x68')][_0x32f04a]),'WhatsappAccountId':Number(_0x1733e7[_0x59ae('0x56')]['id'])});}}else{socket[_0x59ae('0x73')](_0x59ae('0x76'),{'UserId':Number(_0x1733e7[_0x59ae('0x42')][_0x59ae('0x68')]),'WhatsappAccountId':Number(_0x1733e7['params']['id'])});}});}})[_0x59ae('0x35')](respondWithStatusCode(_0xe3f7c4,null))[_0x59ae('0x60')](handleError(_0xe3f7c4,null));};exports['getAgents']=function(_0x1ebe94,_0x3d2661,_0x44a684){var _0x36e8ad={};var _0x777678={};var _0x366d40;var _0x204498;return db[_0x59ae('0x3d')]['findOne']({'where':{'id':_0x1ebe94[_0x59ae('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d2661,null))[_0x59ae('0x35')](function(_0x4869da){if(_0x4869da){_0x366d40=_0x4869da;_0x777678[_0x59ae('0x45')]=_[_0x59ae('0x43')](db['User'][_0x59ae('0x3e')]);_0x777678['query']=_[_0x59ae('0x43')](_0x1ebe94[_0x59ae('0x42')]);_0x777678['filters']=_[_0x59ae('0x47')](_0x777678[_0x59ae('0x45')],_0x777678[_0x59ae('0x42')]);_0x36e8ad[_0x59ae('0x46')]=_['intersection'](_0x777678['model'],qs['fields'](_0x1ebe94[_0x59ae('0x42')][_0x59ae('0x48')]));_0x36e8ad[_0x59ae('0x46')]=_0x36e8ad[_0x59ae('0x46')][_0x59ae('0x49')]?_0x36e8ad[_0x59ae('0x46')]:_0x777678['model'];_0x36e8ad[_0x59ae('0x6d')]=qs[_0x59ae('0x4d')](_0x1ebe94[_0x59ae('0x42')]['sort']);_0x36e8ad[_0x59ae('0x4e')]=qs[_0x59ae('0x44')](_[_0x59ae('0x4f')](_0x1ebe94['query'],_0x777678[_0x59ae('0x44')]));if(_0x1ebe94[_0x59ae('0x42')]['filter']){_0x36e8ad[_0x59ae('0x4e')]=_[_0x59ae('0x51')](_0x36e8ad['where'],{'$or':_[_0x59ae('0x52')](_0x36e8ad[_0x59ae('0x46')],function(_0x5c7dd3){var _0x46ade5={};_0x46ade5[_0x5c7dd3]={'$like':'%'+_0x1ebe94['query'][_0x59ae('0x50')]+'%'};return _0x46ade5;})});}_0x36e8ad=_[_0x59ae('0x51')]({},_0x36e8ad,_0x1ebe94[_0x59ae('0x54')]);return _0x366d40['getAgents'](_0x36e8ad);}})[_0x59ae('0x35')](function(_0x40eca8){if(_0x40eca8){_0x204498=_0x40eca8[_0x59ae('0x49')];if(!_0x1ebe94[_0x59ae('0x42')][_0x59ae('0x4a')](_0x59ae('0x4b'))){_0x36e8ad[_0x59ae('0x4c')]=qs[_0x59ae('0x4c')](_0x1ebe94[_0x59ae('0x42')][_0x59ae('0x4c')]);_0x36e8ad[_0x59ae('0x2c')]=qs[_0x59ae('0x2c')](_0x1ebe94[_0x59ae('0x42')][_0x59ae('0x2c')]);}return _0x366d40['getAgents'](_0x36e8ad);}})['then'](function(_0x237c24){if(_0x237c24){return _0x237c24?{'count':_0x204498,'rows':_0x237c24}:null;}})[_0x59ae('0x35')](respondWithResult(_0x3d2661,null))['catch'](handleError(_0x3d2661,null));};exports['addApplications']=function(_0x46b92d,_0x2c9441){var _0x5e6370=_0x46b92d[_0x59ae('0x56')]['id'];var _0x18a94c=_0x46b92d[_0x59ae('0x62')];var _0x3ca9dc=0xc8;var _0x4e9566=null;return db[_0x59ae('0x77')][_0x59ae('0x78')]({'isolationLevel':db[_0x59ae('0x77')][_0x59ae('0x79')][_0x59ae('0x7a')]['READ_COMMITTED']},function(_0x35a567){return db[_0x59ae('0x3d')][_0x59ae('0x6c')]({'where':{'id':_0x5e6370},'transaction':_0x35a567})[_0x59ae('0x35')](function(_0x21d168){if(_0x21d168){return db[_0x59ae('0x7b')][_0x59ae('0x36')]({'where':{'WhatsappAccountId':_0x5e6370},'transaction':_0x35a567})[_0x59ae('0x35')](function(){var _0x201c9b=_[_0x59ae('0x52')](_0x18a94c,function(_0x38d959){_0x38d959[_0x59ae('0x65')]=_0x5e6370;return _0x38d959;});return db[_0x59ae('0x7b')][_0x59ae('0x7c')](_0x201c9b,{'transaction':_0x35a567});});}else{_0x3ca9dc=0x194;_0x4e9566=[];}});})[_0x59ae('0x35')](function(){if(_0x3ca9dc!==0x194){return db[_0x59ae('0x7b')][_0x59ae('0x7d')]({'where':{'WhatsappAccountId':_0x5e6370},'order':'priority'})[_0x59ae('0x35')](function(_0x2110e7){_0x4e9566=_0x2110e7;});}})[_0x59ae('0x60')](function(_0x491f3f){_0x3ca9dc=0x1f4;logger[_0x59ae('0x25')](_0x491f3f['stack']);if(_0x491f3f[_0x59ae('0x3a')]){delete _0x491f3f[_0x59ae('0x3a')];}_0x4e9566=_0x491f3f;})['finally'](function(){if(_0x4e9566===null){_0x2c9441[_0x59ae('0x29')](_0x3ca9dc);}else{if(_0x3ca9dc===0x1f4){_0x2c9441[_0x59ae('0x2a')](_0x3ca9dc)[_0x59ae('0x3b')](_0x4e9566);}else{_0x2c9441['status'](_0x3ca9dc)['json'](_0x4e9566);}}});};exports[_0x59ae('0x7e')]=function(_0x442755,_0x3b5d0b,_0x159baa){var _0x18462a={};var _0x5734c1={};var _0x4240ea;var _0x6e0706;return db['WhatsappAccount'][_0x59ae('0x6c')]({'where':{'id':_0x442755[_0x59ae('0x56')]['id']}})[_0x59ae('0x35')](handleEntityNotFound(_0x3b5d0b,null))[_0x59ae('0x35')](function(_0x5da79b){if(_0x5da79b){_0x4240ea=_0x5da79b;_0x5734c1[_0x59ae('0x45')]=_[_0x59ae('0x43')](db[_0x59ae('0x7b')][_0x59ae('0x3e')]);_0x5734c1['query']=_[_0x59ae('0x43')](_0x442755[_0x59ae('0x42')]);_0x5734c1['filters']=_[_0x59ae('0x47')](_0x5734c1[_0x59ae('0x45')],_0x5734c1[_0x59ae('0x42')]);_0x18462a[_0x59ae('0x46')]=_[_0x59ae('0x47')](_0x5734c1[_0x59ae('0x45')],qs['fields'](_0x442755['query']['fields']));_0x18462a[_0x59ae('0x46')]=_0x18462a['attributes'][_0x59ae('0x49')]?_0x18462a[_0x59ae('0x46')]:_0x5734c1['model'];_0x18462a['order']=qs[_0x59ae('0x4d')](_0x442755[_0x59ae('0x42')]['sort']);_0x18462a[_0x59ae('0x4e')]=qs[_0x59ae('0x44')](_[_0x59ae('0x4f')](_0x442755[_0x59ae('0x42')],_0x5734c1['filters']));if(_0x442755[_0x59ae('0x42')][_0x59ae('0x50')]){_0x18462a[_0x59ae('0x4e')]=_[_0x59ae('0x51')](_0x18462a[_0x59ae('0x4e')],{'$or':_[_0x59ae('0x52')](_0x18462a['attributes'],function(_0x1896f2){var _0x2b63a0={};_0x2b63a0[_0x1896f2]={'$like':'%'+_0x442755[_0x59ae('0x42')][_0x59ae('0x50')]+'%'};return _0x2b63a0;})});}_0x18462a=_[_0x59ae('0x51')]({},_0x18462a,_0x442755[_0x59ae('0x54')]);return _0x4240ea[_0x59ae('0x7e')](_0x18462a);}})['then'](function(_0x417824){if(_0x417824){_0x6e0706=_0x417824[_0x59ae('0x49')];if(!_0x442755[_0x59ae('0x42')][_0x59ae('0x4a')](_0x59ae('0x4b'))){_0x18462a[_0x59ae('0x4c')]=qs[_0x59ae('0x4c')](_0x442755[_0x59ae('0x42')][_0x59ae('0x4c')]);_0x18462a['offset']=qs['offset'](_0x442755['query']['offset']);}return _0x4240ea[_0x59ae('0x7e')](_0x18462a);}})['then'](function(_0x2fafd9){if(_0x2fafd9){return _0x2fafd9?{'count':_0x6e0706,'rows':_0x2fafd9}:null;}})[_0x59ae('0x35')](respondWithResult(_0x3b5d0b,null))['catch'](handleError(_0x3b5d0b,null));};exports[_0x59ae('0x7f')]=function(_0x37fed2,_0x3bef78,_0x5483ee){var _0x23bbcf={'channel':_0x59ae('0x80')};var _0x3458a0=[];var _0x1f910d=[];var _0x445a9c={};return db[_0x59ae('0x3d')][_0x59ae('0x5e')]({'where':{'id':_0x37fed2[_0x59ae('0x56')]['id']},'include':[{'model':db[_0x59ae('0x7b')],'as':_0x59ae('0x81')}]})['then'](handleEntityNotFound(_0x3bef78,null))['then'](function(_0x17aecd){_0x23bbcf[_0x59ae('0x82')]=_0x17aecd;if(_0x23bbcf[_0x59ae('0x82')]&&_0x23bbcf[_0x59ae('0x82')]['type']===_0x59ae('0x83')&&_0x37fed2[_0x59ae('0x62')][_0x59ae('0x84')]){if(_0x37fed2[_0x59ae('0x62')][_0x59ae('0x84')][_0x59ae('0x49')]===0x0)return;if(_0x37fed2[_0x59ae('0x62')][_0x59ae('0x84')][0x0]['state']!==_0x59ae('0x85'))return;return db['WhatsappMessage'][_0x59ae('0x34')]({'read':!![],'readAt':_0x37fed2[_0x59ae('0x62')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x37fed2['body'][_0x59ae('0x84')][0x0][_0x59ae('0x86')]},'individualHooks':!![]})[_0x59ae('0x35')](function(_0x2e339a){return _0x3bef78[_0x59ae('0x2a')](0xc8)[_0x59ae('0x31')](_0x2e339a);});}_0x23bbcf[_0x59ae('0x87')]=_[_0x59ae('0x88')](_0x17aecd[_0x59ae('0x81')],[_0x59ae('0x89')],['asc']);if(_0x23bbcf[_0x59ae('0x82')][_0x59ae('0x81')]){delete _0x23bbcf['account']['Applications'];}return db[_0x59ae('0x8a')][_0x59ae('0x63')]()[_0x59ae('0x35')](function(_0x1b7db6){if(!_0x1b7db6){throw new db[(_0x59ae('0x8b'))][(_0x59ae('0x8c'))](_0x59ae('0x8d'));}_0x3458a0=_[_0x59ae('0x8e')](_[_0x59ae('0x43')](_0x1b7db6),[_0x59ae('0x8f'),_0x59ae('0x90')]);_0x1f910d=_['difference'](_[_0x59ae('0x43')](_0x1b7db6),[_0x59ae('0x8f'),'updatedAt',_0x59ae('0x91'),'ListId']);_0x23bbcf[_0x59ae('0x62')]={'mapKey':'mobile'};if(_0x23bbcf[_0x59ae('0x82')]&&_0x23bbcf[_0x59ae('0x82')]['type']===_0x59ae('0x92')){_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x93')]=_0x37fed2[_0x59ae('0x62')]['From'][_0x59ae('0x94')](_0x59ae('0x95'),'');_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x62')]=_0x37fed2[_0x59ae('0x62')]['Body'];_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x96')]=_0x37fed2[_0x59ae('0x62')][_0x59ae('0x97')];}if(_0x23bbcf[_0x59ae('0x82')]&&_0x23bbcf[_0x59ae('0x82')][_0x59ae('0x40')]===_0x59ae('0x83')){_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x93')]=_0x37fed2[_0x59ae('0x62')][_0x59ae('0x98')][0x0][_0x59ae('0x93')];_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x62')]=_0x37fed2[_0x59ae('0x62')]['notifications'][0x0][_0x59ae('0x27')][_0x59ae('0x62')];_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x96')]=_0x37fed2[_0x59ae('0x62')][_0x59ae('0x98')][0x0]['message_id'];}if(_0x23bbcf[_0x59ae('0x62')]['id']){delete _0x23bbcf[_0x59ae('0x62')]['id'];}if(_[_0x59ae('0x99')](_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x93')])){throw new db[(_0x59ae('0x8b'))][(_0x59ae('0x8c'))](_0x59ae('0x9a'));}if(_[_0x59ae('0x99')](_0x23bbcf[_0x59ae('0x62')]['body'])||_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x62')]===''){throw new db[(_0x59ae('0x8b'))][(_0x59ae('0x8c'))](_0x59ae('0x9b'));}if(_['isNil'](_0x23bbcf[_0x59ae('0x62')]['mapKey'])){throw new db[(_0x59ae('0x8b'))][(_0x59ae('0x8c'))](_0x59ae('0x9c')+_0x1f910d);}if(!_[_0x59ae('0x9d')](_0x1f910d,_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x9e')])){throw new db[(_0x59ae('0x8b'))][(_0x59ae('0x8c'))](_0x59ae('0x9f')+_0x1f910d);}_0x445a9c[_0x23bbcf[_0x59ae('0x62')]['mapKey']]=_0x23bbcf[_0x59ae('0x62')]['from'];return db[_0x59ae('0xa0')][_0x59ae('0x5e')]({'where':{'id':_0x23bbcf[_0x59ae('0x82')][_0x59ae('0xa1')]},'include':[{'model':db[_0x59ae('0x8a')],'as':_0x59ae('0xa2'),'where':_0x445a9c,'limit':0x1,'order':[[_0x59ae('0x90'),_0x59ae('0xa3')]]}]});})[_0x59ae('0x35')](handleEntityNotFound(_0x3bef78,null))[_0x59ae('0x35')](function(_0x1af053){if(_0x1af053){_0x23bbcf[_0x59ae('0xa4')]=_[_0x59ae('0x72')](_0x1af053,[_0x59ae('0xa2')]);if(_0x1af053[_0x59ae('0xa2')][_0x59ae('0x49')]){return _0x1af053[_0x59ae('0xa2')][0x0];}var _0x4faf9c=_['defaults'](_0x23bbcf[_0x59ae('0x62')],{'firstName':_0x23bbcf[_0x59ae('0x62')]['from'],'ListId':_0x1af053['id']});_0x4faf9c[_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x9e')]]=_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x93')];return db[_0x59ae('0x8a')][_0x59ae('0x5a')](_0x4faf9c,{'fields':_0x3458a0,'raw':!![]});}})[_0x59ae('0x35')](handleEntityNotFound(_0x3bef78,null))[_0x59ae('0x35')](function(_0xf7ca52){if(_0xf7ca52){_0x23bbcf['contact']=_0xf7ca52;var _0x257057={'ContactId':_0xf7ca52['id'],'phone':_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x93')],'WhatsappAccountId':_0x37fed2[_0x59ae('0x56')]['id']};var _0x3dc1a2={'ContactId':_0xf7ca52['id'],'WhatsappAccountId':_0x37fed2[_0x59ae('0x56')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x59ae('0x5e')]({'where':_0x3dc1a2})['then'](function(_0x3ac65e){if(_0x3ac65e){return[_0x3ac65e,![]];}return db[_0x59ae('0xa5')]['create'](_0x257057)[_0x59ae('0x35')](function(_0x25734b){return[_0x25734b,!![]];});});}})['spread'](function(_0x20f2b2,_0x5628df){_0x23bbcf[_0x59ae('0xa6')]=_0x20f2b2[_0x59ae('0x5c')]({'plain':!![]});_0x23bbcf[_0x59ae('0xa6')][_0x59ae('0xa7')]=![];if(_0x5628df){if(_0x23bbcf[_0x59ae('0x82')][_0x59ae('0xa8')]){_0x23bbcf[_0x59ae('0x87')][_0x59ae('0xa9')]({'id':0x0,'priority':_0x23bbcf[_0x59ae('0x87')][_0x59ae('0x49')]+0x1,'app':_0x59ae('0xaa'),'appdata':_0x59ae('0xab'),'interval':_0x59ae('0xac')});}_0x23bbcf[_0x59ae('0xa6')][_0x59ae('0xa7')]=!![];}return db[_0x59ae('0xad')][_0x59ae('0x5a')]({'phone':_0x23bbcf[_0x59ae('0x62')][_0x59ae('0x93')],'messageId':_0x23bbcf['body'][_0x59ae('0x96')],'body':_0x23bbcf[_0x59ae('0x62')]['body'],'WhatsappAccountId':_0x37fed2[_0x59ae('0x56')]['id'],'WhatsappInteractionId':_0x20f2b2['id'],'direction':'in','ContactId':_0x20f2b2[_0x59ae('0xae')],'AttachmentId':_0x23bbcf[_0x59ae('0x62')]['AttachmentId']});})[_0x59ae('0x35')](function(_0x4bc8a8){_0x23bbcf['message']=_0x4bc8a8;if(_0x23bbcf[_0x59ae('0xa6')]['UserId']){return db[_0x59ae('0xaf')]['find']({'attributes':['id',_0x59ae('0x3a')],'where':{'id':_0x23bbcf[_0x59ae('0xa6')][_0x59ae('0xb0')]}})['then'](function(_0x25af5e){if(_0x25af5e){_0x23bbcf['applications'][_0x59ae('0xb1')]({'id':0x0,'priority':0x0,'app':_0x59ae('0xb2'),'appdata':_0x25af5e[_0x59ae('0x3a')]+','+(_0x23bbcf[_0x59ae('0x82')][_0x59ae('0xb3')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x59ae('0xb4'),_0x59ae('0xb5'),_0x23bbcf);});}return respondWithRpcPromise(_0x59ae('0xb4'),'startRouting',_0x23bbcf);})[_0x59ae('0x35')](function(_0xf4a331){if(_0xf4a331){var _0x50f096=0xc8;var _0x5509cd=_0x59ae('0xb6');logger['info'](_0x59ae('0x24'),_0x5509cd,_0x50f096,_0x59ae('0xb7'));logger['debug'](_0x59ae('0xb8'),_0x5509cd,_0x50f096,_0x59ae('0xb7'),JSON[_0x59ae('0xb9')](_0xf4a331));if(_0x23bbcf['account'][_0x59ae('0x40')]===_0x59ae('0x92')){return _0x3bef78['status'](_0x50f096)['set'](_0x59ae('0xba'),'text/xml')['send'](_0x59ae('0xbb'));}else{return _0x3bef78[_0x59ae('0x2a')](_0x50f096)[_0x59ae('0x31')](_0xf4a331);}}});})['catch'](handleError(_0x3bef78,null));};exports['send']=function(_0x275e77,_0x453a74,_0x15cfa3){var _0x1d9fd0,_0x5c05f3,_0x4f1a5c;if(_[_0x59ae('0x99')](_0x275e77['body'][_0x59ae('0x62')])||_0x275e77[_0x59ae('0x62')][_0x59ae('0x62')]===''){throw new db['Sequelize'][(_0x59ae('0x8c'))](_0x59ae('0x9b'));}if(_[_0x59ae('0x99')](_0x275e77['body']['to'])){throw new db[(_0x59ae('0x8b'))][(_0x59ae('0x8c'))](_0x59ae('0xbc'));}_0x1d9fd0=_0x275e77['body']['to'];return db[_0x59ae('0x3d')][_0x59ae('0x5e')]({'where':{'id':_0x275e77['params']['id']},'include':[{'model':db[_0x59ae('0xa0')],'as':_0x59ae('0xbd'),'include':[{'model':db[_0x59ae('0x8a')],'as':_0x59ae('0xa2'),'where':{'mobile':_0x1d9fd0},'limit':0x1,'order':[[_0x59ae('0x90'),'DESC']]}]}]})[_0x59ae('0x35')](handleEntityNotFound(_0x453a74,null))['then'](function(_0x399e10){if(_0x399e10&&_0x399e10[_0x59ae('0xbd')]){_0x5c05f3=_0x399e10[_0x59ae('0x5c')]({'plain':!![]});if(_0x5c05f3[_0x59ae('0xbd')]&&_0x5c05f3[_0x59ae('0xbd')][_0x59ae('0xa2')]['length']){return _0x5c05f3[_0x59ae('0xbd')][_0x59ae('0xa2')][0x0];}return db[_0x59ae('0x8a')][_0x59ae('0x5a')](_[_0x59ae('0xbe')](_0x275e77['body'],{'firstName':_0x1d9fd0,'mobile':_0x1d9fd0,'phone':_0x1d9fd0,'ListId':_0x5c05f3[_0x59ae('0xa1')]}));}})[_0x59ae('0x35')](handleEntityNotFound(_0x453a74,null))[_0x59ae('0x35')](function(_0x546650){if(_0x546650){_0x4f1a5c=_0x546650;return db[_0x59ae('0xa5')][_0x59ae('0x5e')]({'where':{'ContactId':_0x4f1a5c['id'],'closed':![],'WhatsappAccountId':_0x5c05f3['id']}})[_0x59ae('0x35')](function(_0x595fc8){if(_0x595fc8){return[_0x595fc8,![]];}return db['WhatsappInteraction'][_0x59ae('0x5a')]({'UserId':_0x275e77['user']['id'],'ContactId':_0x4f1a5c['id'],'WhatsappAccountId':_0x5c05f3['id'],'phone':_0x1d9fd0,'firstMsgDirection':_0x59ae('0xbf'),'Messages':[_[_0x59ae('0x51')](_0x275e77[_0x59ae('0x62')],{'read':![],'body':_0x275e77[_0x59ae('0x62')]['body'],'phone':_0x1d9fd0,'WhatsappAccountId':_0x5c05f3['id'],'UserId':_0x275e77[_0x59ae('0x5b')]['id'],'ContactId':_0x4f1a5c['id']})]},{'include':[{'model':db[_0x59ae('0xad')],'as':'Messages'}]})[_0x59ae('0x35')](function(_0x425912){return[_0x425912,!![]];});});}})[_0x59ae('0xc0')](function(_0x2d6830,_0x406c85){if(_0x406c85){return _0x2d6830;}return db['WhatsappMessage'][_0x59ae('0x5a')](_[_0x59ae('0x51')](_0x275e77['body'],{'read':![],'body':_0x275e77[_0x59ae('0x62')][_0x59ae('0x62')],'phone':_0x1d9fd0,'WhatsappAccountId':_0x5c05f3['id'],'WhatsappInteractionId':_0x2d6830['id'],'UserId':_0x275e77[_0x59ae('0x5b')]['id'],'ContactId':_0x4f1a5c['id']}))[_0x59ae('0x35')](function(_0x52c136){_0x2d6830['dataValues'][_0x59ae('0xc1')]=[];_0x2d6830[_0x59ae('0xc2')][_0x59ae('0xc1')][_0x59ae('0xa9')](_0x52c136[_0x59ae('0xc2')]);return _0x2d6830;});})[_0x59ae('0x35')](respondWithResult(_0x453a74,null))[_0x59ae('0x60')](handleError(_0x453a74,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 7f7fa9d..a051ad9 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 _0xd5bb=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd5bb,0x122));var _0xbd5b=function(_0x3894ae,_0x336f83){_0x3894ae=_0x3894ae-0x0;var _0x55de0d=_0xd5bb[_0x3894ae];return _0x55de0d;};'use strict';var EventEmitter=require(_0xbd5b('0x0'));var WhatsappAccount=require(_0xbd5b('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbd5b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd5b('0x3'),'afterDestroy':_0xbd5b('0x4')};function emitEvent(_0x1474c0){return function(_0x2b197a,_0x126f1b,_0x956f04){WhatsappAccountEvents[_0xbd5b('0x5')](_0x1474c0+':'+_0x2b197a['id'],_0x2b197a);WhatsappAccountEvents['emit'](_0x1474c0,_0x2b197a);_0x956f04(null);};}for(var e in events){if(events[_0xbd5b('0x6')](e)){var event=events[e];WhatsappAccount[_0xbd5b('0x7')](e,emitEvent(event));}}module[_0xbd5b('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xfbaf=['update','remove','emit','exports','WhatsappAccount','setMaxListeners','save'];(function(_0x15f6a0,_0x5b34fc){var _0x10f8c7=function(_0x5b7d95){while(--_0x5b7d95){_0x15f6a0['push'](_0x15f6a0['shift']());}};_0x10f8c7(++_0x5b34fc);}(_0xfbaf,0xc8));var _0xffba=function(_0x5e1cdc,_0x206724){_0x5e1cdc=_0x5e1cdc-0x0;var _0x40f50f=_0xfbaf[_0x5e1cdc];return _0x40f50f;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0xffba('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xffba('0x1')](0x0);var events={'afterCreate':_0xffba('0x2'),'afterUpdate':_0xffba('0x3'),'afterDestroy':_0xffba('0x4')};function emitEvent(_0x5a2e41){return function(_0x4ca24a,_0x106c61,_0xe86037){WhatsappAccountEvents[_0xffba('0x5')](_0x5a2e41+':'+_0x4ca24a['id'],_0x4ca24a);WhatsappAccountEvents['emit'](_0x5a2e41,_0x4ca24a);_0xe86037(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xffba('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 a3ce6c3..1a5ac8e 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 _0x1712=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x1712,0x172));var _0x2171=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x1712[_0x5f1cf8];return _0x27d0fa;};'use strict';var _=require(_0x2171('0x0'));var util=require(_0x2171('0x1'));var logger=require(_0x2171('0x2'))(_0x2171('0x3'));var moment=require(_0x2171('0x4'));var BPromise=require(_0x2171('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2171('0x6'));var rimraf=require(_0x2171('0x7'));var config=require(_0x2171('0x8'));var attributes=require(_0x2171('0x9'));module[_0x2171('0xa')]=function(_0x4fe0c4,_0x465ebc){return _0x4fe0c4['define'](_0x2171('0xb'),attributes,{'tableName':_0x2171('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d5a=['path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2a6885,_0x12293c){var _0x344c08=function(_0x2bf62a){while(--_0x2bf62a){_0x2a6885['push'](_0x2a6885['shift']());}};_0x344c08(++_0x12293c);}(_0x4d5a,0x132));var _0xa4d5=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x4d5a[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xa4d5('0x0'));var util=require(_0xa4d5('0x1'));var logger=require(_0xa4d5('0x2'))('api');var moment=require(_0xa4d5('0x3'));var BPromise=require(_0xa4d5('0x4'));var rp=require(_0xa4d5('0x5'));var fs=require('fs');var path=require(_0xa4d5('0x6'));var rimraf=require(_0xa4d5('0x7'));var config=require(_0xa4d5('0x8'));var attributes=require(_0xa4d5('0x9'));module[_0xa4d5('0xa')]=function(_0x2bf9ee,_0x3816f7){return _0x2bf9ee['define'](_0xa4d5('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 7d9e665..6c39f70 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 _0xff11=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','request','info','request\x20sent','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x17ce96,_0x37b98e){var _0x4165b2=function(_0x25a4d2){while(--_0x25a4d2){_0x17ce96['push'](_0x17ce96['shift']());}};_0x4165b2(++_0x37b98e);}(_0xff11,0x186));var _0x1ff1=function(_0x45a28a,_0x25fef3){_0x45a28a=_0x45a28a-0x0;var _0x5c0f22=_0xff11[_0x45a28a];return _0x5c0f22;};'use strict';var _=require(_0x1ff1('0x0'));var util=require(_0x1ff1('0x1'));var moment=require(_0x1ff1('0x2'));var BPromise=require(_0x1ff1('0x3'));var rs=require(_0x1ff1('0x4'));var fs=require('fs');var Redis=require(_0x1ff1('0x5'));var db=require(_0x1ff1('0x6'))['db'];var utils=require(_0x1ff1('0x7'));var logger=require(_0x1ff1('0x8'))(_0x1ff1('0x9'));var config=require(_0x1ff1('0xa'));var jayson=require(_0x1ff1('0xb'));var client=jayson[_0x1ff1('0xc')][_0x1ff1('0xd')]({'port':0x232a});config[_0x1ff1('0xe')]=_['defaults'](config[_0x1ff1('0xe')],{'host':_0x1ff1('0xf'),'port':0x18eb});var socket=require(_0x1ff1('0x10'))(new Redis(config[_0x1ff1('0xe')]));require(_0x1ff1('0x11'))['register'](socket);function respondWithRpcPromise(_0x43ef4b,_0x57d547,_0x546112){return new BPromise(function(_0x28c4e6,_0x583e1a){return client[_0x1ff1('0x12')](_0x43ef4b,_0x546112)['then'](function(_0x459ec2){logger[_0x1ff1('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x57d547,_0x1ff1('0x14'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x57d547,_0x1ff1('0x14'),JSON[_0x1ff1('0x15')](_0x459ec2));if(_0x459ec2[_0x1ff1('0x16')]){if(_0x459ec2[_0x1ff1('0x16')][_0x1ff1('0x17')]===0x1f4){logger[_0x1ff1('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x57d547,_0x459ec2[_0x1ff1('0x16')][_0x1ff1('0x18')]);return _0x583e1a(_0x459ec2[_0x1ff1('0x16')][_0x1ff1('0x18')]);}logger[_0x1ff1('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x57d547,_0x459ec2[_0x1ff1('0x16')][_0x1ff1('0x18')]);return _0x28c4e6(_0x459ec2[_0x1ff1('0x16')][_0x1ff1('0x18')]);}else{logger['info'](_0x1ff1('0x19'),_0x57d547,_0x1ff1('0x14'));_0x28c4e6(_0x459ec2[_0x1ff1('0x1a')][_0x1ff1('0x18')]);}})[_0x1ff1('0x1b')](function(_0x51469b){logger[_0x1ff1('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x57d547,_0x51469b);_0x583e1a(_0x51469b);});});}exports[_0x1ff1('0x1c')]=function(_0x4a4314){var _0x53f3f0=this;return new Promise(function(_0x39c24a,_0x34a239){return db[_0x1ff1('0x1d')][_0x1ff1('0x1e')]({'raw':_0x4a4314[_0x1ff1('0x1f')]?_0x4a4314[_0x1ff1('0x1f')][_0x1ff1('0x20')]===undefined?!![]:![]:!![],'where':_0x4a4314[_0x1ff1('0x1f')]?_0x4a4314[_0x1ff1('0x1f')][_0x1ff1('0x21')]||null:null,'attributes':_0x4a4314[_0x1ff1('0x1f')]?_0x4a4314[_0x1ff1('0x1f')][_0x1ff1('0x22')]||null:null,'include':_0x4a4314[_0x1ff1('0x1f')]?_0x4a4314['options'][_0x1ff1('0x23')]?_[_0x1ff1('0x24')](_0x4a4314['options'][_0x1ff1('0x23')],function(_0x393422){return{'model':db[_0x393422['model']],'as':_0x393422['as'],'attributes':_0x393422[_0x1ff1('0x22')],'include':_0x393422[_0x1ff1('0x23')]?_['map'](_0x393422[_0x1ff1('0x23')],function(_0x3ac412){return{'model':db[_0x3ac412[_0x1ff1('0x25')]],'as':_0x3ac412['as'],'attributes':_0x3ac412['attributes'],'include':_0x3ac412[_0x1ff1('0x23')]?_[_0x1ff1('0x24')](_0x3ac412['include'],function(_0xcecae9){return{'model':db[_0xcecae9[_0x1ff1('0x25')]],'as':_0xcecae9['as'],'attributes':_0xcecae9[_0x1ff1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ff1('0x26')](function(_0x5b73da){logger['info'](_0x1ff1('0x1c'),_0x4a4314);logger[_0x1ff1('0x27')]('ShowWhatsappAccount',_0x4a4314,JSON[_0x1ff1('0x15')](_0x5b73da));_0x39c24a(_0x5b73da);})['catch'](function(_0x31cdc2){logger[_0x1ff1('0x16')](_0x1ff1('0x1c'),_0x31cdc2[_0x1ff1('0x18')],_0x4a4314);_0x34a239(_0x53f3f0[_0x1ff1('0x16')](0x1f4,_0x31cdc2[_0x1ff1('0x18')]));});});}; \ No newline at end of file +var _0xc2ab=['debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x37bd46,_0x2cd9de){var _0x560101=function(_0x447878){while(--_0x447878){_0x37bd46['push'](_0x37bd46['shift']());}};_0x560101(++_0x2cd9de);}(_0xc2ab,0x1cd));var _0xbc2a=function(_0x3eddab,_0x2179e6){_0x3eddab=_0x3eddab-0x0;var _0x2c6877=_0xc2ab[_0x3eddab];return _0x2c6877;};'use strict';var _=require(_0xbc2a('0x0'));var util=require(_0xbc2a('0x1'));var moment=require(_0xbc2a('0x2'));var BPromise=require(_0xbc2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc2a('0x4'));var db=require(_0xbc2a('0x5'))['db'];var utils=require(_0xbc2a('0x6'));var logger=require(_0xbc2a('0x7'))(_0xbc2a('0x8'));var config=require(_0xbc2a('0x9'));var jayson=require(_0xbc2a('0xa'));var client=jayson[_0xbc2a('0xb')][_0xbc2a('0xc')]({'port':0x232a});config[_0xbc2a('0xd')]=_['defaults'](config[_0xbc2a('0xd')],{'host':_0xbc2a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc2a('0xd')]));require('./whatsappAccount.socket')[_0xbc2a('0xf')](socket);function respondWithRpcPromise(_0x30e35f,_0x548c68,_0x20d00c){return new BPromise(function(_0x2c5f6e,_0x3a6e53){return client['request'](_0x30e35f,_0x20d00c)[_0xbc2a('0x10')](function(_0x396adf){logger[_0xbc2a('0x11')](_0xbc2a('0x12'),_0x548c68,_0xbc2a('0x13'));logger[_0xbc2a('0x14')](_0xbc2a('0x15'),_0x548c68,'request\x20sent',JSON[_0xbc2a('0x16')](_0x396adf));if(_0x396adf[_0xbc2a('0x17')]){if(_0x396adf[_0xbc2a('0x17')][_0xbc2a('0x18')]===0x1f4){logger[_0xbc2a('0x17')](_0xbc2a('0x12'),_0x548c68,_0x396adf[_0xbc2a('0x17')][_0xbc2a('0x19')]);return _0x3a6e53(_0x396adf[_0xbc2a('0x17')][_0xbc2a('0x19')]);}logger[_0xbc2a('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x548c68,_0x396adf[_0xbc2a('0x17')][_0xbc2a('0x19')]);return _0x2c5f6e(_0x396adf[_0xbc2a('0x17')]['message']);}else{logger[_0xbc2a('0x11')](_0xbc2a('0x12'),_0x548c68,_0xbc2a('0x13'));_0x2c5f6e(_0x396adf[_0xbc2a('0x1a')][_0xbc2a('0x19')]);}})[_0xbc2a('0x1b')](function(_0x5262a0){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x548c68,_0x5262a0);_0x3a6e53(_0x5262a0);});});}exports[_0xbc2a('0x1c')]=function(_0x2168f9){var _0xe7c5f3=this;return new Promise(function(_0x3f75c3,_0x113282){return db[_0xbc2a('0x1d')][_0xbc2a('0x1e')]({'raw':_0x2168f9[_0xbc2a('0x1f')]?_0x2168f9[_0xbc2a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2168f9[_0xbc2a('0x1f')]?_0x2168f9[_0xbc2a('0x1f')][_0xbc2a('0x20')]||null:null,'attributes':_0x2168f9[_0xbc2a('0x1f')]?_0x2168f9[_0xbc2a('0x1f')][_0xbc2a('0x21')]||null:null,'include':_0x2168f9[_0xbc2a('0x1f')]?_0x2168f9[_0xbc2a('0x1f')][_0xbc2a('0x22')]?_[_0xbc2a('0x23')](_0x2168f9['options']['include'],function(_0xf0b0c4){return{'model':db[_0xf0b0c4['model']],'as':_0xf0b0c4['as'],'attributes':_0xf0b0c4[_0xbc2a('0x21')],'include':_0xf0b0c4['include']?_[_0xbc2a('0x23')](_0xf0b0c4[_0xbc2a('0x22')],function(_0x3fb556){return{'model':db[_0x3fb556[_0xbc2a('0x24')]],'as':_0x3fb556['as'],'attributes':_0x3fb556['attributes'],'include':_0x3fb556['include']?_[_0xbc2a('0x23')](_0x3fb556[_0xbc2a('0x22')],function(_0xe816a2){return{'model':db[_0xe816a2[_0xbc2a('0x24')]],'as':_0xe816a2['as'],'attributes':_0xe816a2[_0xbc2a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c274c){logger[_0xbc2a('0x11')]('ShowWhatsappAccount',_0x2168f9);logger[_0xbc2a('0x14')](_0xbc2a('0x1c'),_0x2168f9,JSON[_0xbc2a('0x16')](_0x5c274c));_0x3f75c3(_0x5c274c);})['catch'](function(_0x22b273){logger['error']('ShowWhatsappAccount',_0x22b273[_0xbc2a('0x19')],_0x2168f9);_0x113282(_0xe7c5f3[_0xbc2a('0x17')](0x1f4,_0x22b273[_0xbc2a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 2e4fbdc..d59a4c4 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 _0xf25f=['register','length','whatsappAccount:','remove','emit','removeListener'];(function(_0x301064,_0x1985aa){var _0x5bc841=function(_0x57dffc){while(--_0x57dffc){_0x301064['push'](_0x301064['shift']());}};_0x5bc841(++_0x1985aa);}(_0xf25f,0x17d));var _0xff25=function(_0x582539,_0x2b6cea){_0x582539=_0x582539-0x0;var _0x2bc7e6=_0xf25f[_0x582539];return _0x2bc7e6;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0xff25('0x0'),'update'];function createListener(_0x17c446,_0x363801){return function(_0x39bbc2){_0x363801[_0xff25('0x1')](_0x17c446,_0x39bbc2);};}function removeListener(_0x362087,_0x24271c){return function(){WhatsappAccountEvents[_0xff25('0x2')](_0x362087,_0x24271c);};}exports[_0xff25('0x3')]=function(_0x44699c){for(var _0x359071=0x0,_0x360d81=events[_0xff25('0x4')];_0x359071<_0x360d81;_0x359071++){var _0x529168=events[_0x359071];var _0x413719=createListener(_0xff25('0x5')+_0x529168,_0x44699c);WhatsappAccountEvents['on'](_0x529168,_0x413719);}}; \ No newline at end of file +var _0x2f72=['whatsappAccount:','./whatsappAccount.events','remove','update','removeListener','register','length'];(function(_0x27efcf,_0x320952){var _0xdb0237=function(_0x2a7389){while(--_0x2a7389){_0x27efcf['push'](_0x27efcf['shift']());}};_0xdb0237(++_0x320952);}(_0x2f72,0x9b));var _0x22f7=function(_0x437c87,_0x15c6ce){_0x437c87=_0x437c87-0x0;var _0x31293c=_0x2f72[_0x437c87];return _0x31293c;};'use strict';var WhatsappAccountEvents=require(_0x22f7('0x0'));var events=['save',_0x22f7('0x1'),_0x22f7('0x2')];function createListener(_0x451fa2,_0x43bd82){return function(_0x4104da){_0x43bd82['emit'](_0x451fa2,_0x4104da);};}function removeListener(_0x433e78,_0xcf5199){return function(){WhatsappAccountEvents[_0x22f7('0x3')](_0x433e78,_0xcf5199);};}exports[_0x22f7('0x4')]=function(_0x294edd){for(var _0x5d210b=0x0,_0x2847ef=events[_0x22f7('0x5')];_0x5d210b<_0x2847ef;_0x5d210b++){var _0x42206a=events[_0x5d210b];var _0x10e663=createListener(_0x22f7('0x6')+_0x42206a,_0x294edd);WhatsappAccountEvents['on'](_0x42206a,_0x10e663);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index b6d09e7..37210c9 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 _0x023f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x023f,0xbf));var _0xf023=function(_0xe05f09,_0x4fdb36){_0xe05f09=_0xe05f09-0x0;var _0x51f72d=_0x023f[_0xe05f09];return _0x51f72d;};'use strict';var multer=require(_0xf023('0x0'));var util=require(_0xf023('0x1'));var path=require(_0xf023('0x2'));var timeout=require(_0xf023('0x3'));var express=require(_0xf023('0x4'));var router=express[_0xf023('0x5')]();var fs_extra=require(_0xf023('0x6'));var auth=require(_0xf023('0x7'));var interaction=require(_0xf023('0x8'));var config=require(_0xf023('0x9'));var controller=require(_0xf023('0xa'));router[_0xf023('0xb')]('/',auth[_0xf023('0xc')](),controller[_0xf023('0xd')]);router[_0xf023('0xb')](_0xf023('0xe'),auth[_0xf023('0xc')](),controller['show']);router[_0xf023('0xf')]('/',auth[_0xf023('0xc')](),controller[_0xf023('0x10')]);router[_0xf023('0x11')](_0xf023('0xe'),auth[_0xf023('0xc')](),controller[_0xf023('0x12')]);router[_0xf023('0x13')]('/:id',auth[_0xf023('0xc')](),controller[_0xf023('0x14')]);module[_0xf023('0x15')]=router; \ No newline at end of file +var _0x49ce=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','put','update'];(function(_0x45ceb6,_0x2feeac){var _0xa9296d=function(_0x56d85a){while(--_0x56d85a){_0x45ceb6['push'](_0x45ceb6['shift']());}};_0xa9296d(++_0x2feeac);}(_0x49ce,0x145));var _0xe49c=function(_0x4dda69,_0x2a0fe4){_0x4dda69=_0x4dda69-0x0;var _0x9014a9=_0x49ce[_0x4dda69];return _0x9014a9;};'use strict';var multer=require(_0xe49c('0x0'));var util=require(_0xe49c('0x1'));var path=require(_0xe49c('0x2'));var timeout=require(_0xe49c('0x3'));var express=require(_0xe49c('0x4'));var router=express['Router']();var fs_extra=require(_0xe49c('0x5'));var auth=require(_0xe49c('0x6'));var interaction=require(_0xe49c('0x7'));var config=require(_0xe49c('0x8'));var controller=require(_0xe49c('0x9'));router[_0xe49c('0xa')]('/',auth[_0xe49c('0xb')](),controller['index']);router[_0xe49c('0xa')](_0xe49c('0xc'),auth['isAuthenticated'](),controller[_0xe49c('0xd')]);router[_0xe49c('0xe')]('/',auth[_0xe49c('0xb')](),controller['create']);router[_0xe49c('0xf')](_0xe49c('0xc'),auth['isAuthenticated'](),controller[_0xe49c('0x10')]);router['delete'](_0xe49c('0xc'),auth[_0xe49c('0xb')](),controller[_0xe49c('0x11')]);module[_0xe49c('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d5caafc..3b3282c 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 _0xa848=['sequelize','exports','noop','TEXT','STRING','*,*,*,*'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa848,0x78));var _0x8a84=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa848[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x8a84('0x0'));module[_0x8a84('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a84('0x2')},'appdata':{'type':Sequelize[_0x8a84('0x3')]()},'description':{'type':Sequelize[_0x8a84('0x4')]},'interval':{'type':Sequelize[_0x8a84('0x4')],'defaultValue':_0x8a84('0x5')}}; \ No newline at end of file +var _0x8572=['*,*,*,*','sequelize','exports','STRING','TEXT'];(function(_0x2ee65b,_0x1386d8){var _0x220cc2=function(_0x44c66f){while(--_0x44c66f){_0x2ee65b['push'](_0x2ee65b['shift']());}};_0x220cc2(++_0x1386d8);}(_0x8572,0x1f0));var _0x2857=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x8572[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0x2857('0x0'));module[_0x2857('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2857('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2857('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2857('0x2')],'defaultValue':_0x2857('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e5ec408..acd5e86 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 _0xd824=['../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','WhatsappApplication','rawAttributes','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x991e52,_0x147831){var _0x227537=function(_0x36becc){while(--_0x36becc){_0x991e52['push'](_0x991e52['shift']());}};_0x227537(++_0x147831);}(_0xd824,0xc2));var _0x4d82=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd824[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x4d82('0x0'));var rimraf=require(_0x4d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d82('0x2'));var moment=require(_0x4d82('0x3'));var BPromise=require(_0x4d82('0x4'));var Mustache=require(_0x4d82('0x5'));var util=require(_0x4d82('0x6'));var path=require(_0x4d82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d82('0x9'));var crypto=require(_0x4d82('0xa'));var jsforce=require(_0x4d82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4d82('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d82('0xd'));var authService=require(_0x4d82('0xe'));var qs=require(_0x4d82('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d82('0x10'));var logger=require('../../config/logger')(_0x4d82('0x11'));var utils=require(_0x4d82('0x12'));var config=require(_0x4d82('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x346394,_0x248eed){_0x248eed=_0x248eed||0xcc;return function(_0x319ba8){if(_0x319ba8){return _0x346394[_0x4d82('0x14')](_0x248eed);}return _0x346394['status'](_0x248eed)[_0x4d82('0x15')]();};}function respondWithResult(_0x2094bc,_0x41f5b2){_0x41f5b2=_0x41f5b2||0xc8;return function(_0x486152){if(_0x486152){return _0x2094bc[_0x4d82('0x16')](_0x41f5b2)['json'](_0x486152);}};}function respondWithFilteredResult(_0x3382c4,_0x5012db){return function(_0x469e09){if(_0x469e09){var _0x496f3b=typeof _0x5012db[_0x4d82('0x17')]===_0x4d82('0x18')&&typeof _0x5012db[_0x4d82('0x19')]===_0x4d82('0x18');var _0x2648a8=_0x469e09[_0x4d82('0x1a')];var _0x258c59=_0x496f3b?0x0:_0x5012db[_0x4d82('0x17')];var _0x2f2127=_0x496f3b?_0x469e09['count']:_0x5012db[_0x4d82('0x17')]+_0x5012db[_0x4d82('0x19')];var _0x1b1e39;if(_0x2f2127>=_0x2648a8){_0x2f2127=_0x2648a8;_0x1b1e39=0xc8;}else{_0x1b1e39=0xce;}_0x3382c4[_0x4d82('0x16')](_0x1b1e39);return _0x3382c4[_0x4d82('0x1b')](_0x4d82('0x1c'),_0x258c59+'-'+_0x2f2127+'/'+_0x2648a8)[_0x4d82('0x1d')](_0x469e09);}return null;};}function patchUpdates(_0x64669c){return function(_0x19832f){try{jsonpatch[_0x4d82('0x1e')](_0x19832f,_0x64669c,!![]);}catch(_0xf2f5a5){return BPromise['reject'](_0xf2f5a5);}return _0x19832f[_0x4d82('0x1f')]();};}function saveUpdates(_0x748ee7,_0x5e5bdf){return function(_0x1a419f){if(_0x1a419f){return _0x1a419f[_0x4d82('0x20')](_0x748ee7)[_0x4d82('0x21')](function(_0x14a2d4){return _0x14a2d4;});}return null;};}function removeEntity(_0xe17d70,_0x15f5d1){return function(_0x11c043){if(_0x11c043){return _0x11c043[_0x4d82('0x22')]()[_0x4d82('0x21')](function(){_0xe17d70[_0x4d82('0x16')](0xcc)[_0x4d82('0x15')]();});}};}function handleEntityNotFound(_0x395efc,_0x7404ba){return function(_0x284c66){if(!_0x284c66){_0x395efc[_0x4d82('0x14')](0x194);}return _0x284c66;};}function handleError(_0x4af6da,_0x5e0b03){_0x5e0b03=_0x5e0b03||0x1f4;return function(_0x3dcb0f){logger[_0x4d82('0x23')](_0x3dcb0f[_0x4d82('0x24')]);if(_0x3dcb0f[_0x4d82('0x25')]){delete _0x3dcb0f['name'];}_0x4af6da[_0x4d82('0x16')](_0x5e0b03)[_0x4d82('0x26')](_0x3dcb0f);};}exports[_0x4d82('0x27')]=function(_0x11d022,_0x5ce98b){var _0x4081f6={},_0x4a7444={},_0x4d9ac4={'count':0x0,'rows':[]};var _0x487581=_['map'](db[_0x4d82('0x28')][_0x4d82('0x29')],function(_0x88318c){return{'name':_0x88318c['fieldName'],'type':_0x88318c[_0x4d82('0x2a')][_0x4d82('0x2b')]};});_0x4a7444['model']=_['map'](_0x487581,_0x4d82('0x25'));_0x4a7444[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x11d022[_0x4d82('0x2c')]);_0x4a7444['filters']=_[_0x4d82('0x2e')](_0x4a7444['model'],_0x4a7444[_0x4d82('0x2c')]);_0x4081f6[_0x4d82('0x2f')]=_['intersection'](_0x4a7444['model'],qs[_0x4d82('0x30')](_0x11d022[_0x4d82('0x2c')][_0x4d82('0x30')]));_0x4081f6[_0x4d82('0x2f')]=_0x4081f6[_0x4d82('0x2f')][_0x4d82('0x31')]?_0x4081f6[_0x4d82('0x2f')]:_0x4a7444[_0x4d82('0x32')];if(!_0x11d022[_0x4d82('0x2c')][_0x4d82('0x33')]('nolimit')){_0x4081f6[_0x4d82('0x19')]=qs[_0x4d82('0x19')](_0x11d022[_0x4d82('0x2c')]['limit']);_0x4081f6[_0x4d82('0x17')]=qs[_0x4d82('0x17')](_0x11d022['query'][_0x4d82('0x17')]);}_0x4081f6[_0x4d82('0x34')]=qs[_0x4d82('0x35')](_0x11d022['query'][_0x4d82('0x35')]);_0x4081f6[_0x4d82('0x36')]=qs['filters'](_[_0x4d82('0x37')](_0x11d022['query'],_0x4a7444[_0x4d82('0x38')]),_0x487581);if(_0x11d022[_0x4d82('0x2c')]['filter']){_0x4081f6[_0x4d82('0x36')]=_['merge'](_0x4081f6[_0x4d82('0x36')],{'$or':_['map'](_0x487581,function(_0x51c705){if(_0x51c705[_0x4d82('0x2a')]!=='VIRTUAL'){var _0x2528d7={};_0x2528d7[_0x51c705['name']]={'$like':'%'+_0x11d022[_0x4d82('0x2c')][_0x4d82('0x39')]+'%'};return _0x2528d7;}})});}_0x4081f6=_['merge']({},_0x4081f6,_0x11d022[_0x4d82('0x3a')]);var _0x5d9444={'where':_0x4081f6[_0x4d82('0x36')]};return db[_0x4d82('0x28')]['count'](_0x5d9444)[_0x4d82('0x21')](function(_0x5521f1){_0x4d9ac4[_0x4d82('0x1a')]=_0x5521f1;if(_0x11d022[_0x4d82('0x2c')][_0x4d82('0x3b')]){_0x4081f6[_0x4d82('0x3c')]=[{'all':!![]}];}return db[_0x4d82('0x28')][_0x4d82('0x3d')](_0x4081f6);})['then'](function(_0x222b35){_0x4d9ac4[_0x4d82('0x3e')]=_0x222b35;return _0x4d9ac4;})[_0x4d82('0x21')](respondWithFilteredResult(_0x5ce98b,_0x4081f6))[_0x4d82('0x3f')](handleError(_0x5ce98b,null));};exports[_0x4d82('0x40')]=function(_0x363158,_0x37498b){var _0x4c474b={'raw':!![],'where':{'id':_0x363158[_0x4d82('0x41')]['id']}},_0x3c80d6={};_0x3c80d6[_0x4d82('0x32')]=_[_0x4d82('0x2d')](db[_0x4d82('0x28')]['rawAttributes']);_0x3c80d6[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x363158[_0x4d82('0x2c')]);_0x3c80d6[_0x4d82('0x38')]=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],_0x3c80d6[_0x4d82('0x2c')]);_0x4c474b['attributes']=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],qs['fields'](_0x363158[_0x4d82('0x2c')]['fields']));_0x4c474b[_0x4d82('0x2f')]=_0x4c474b[_0x4d82('0x2f')]['length']?_0x4c474b[_0x4d82('0x2f')]:_0x3c80d6[_0x4d82('0x32')];if(_0x363158['query'][_0x4d82('0x3b')]){_0x4c474b[_0x4d82('0x3c')]=[{'all':!![]}];}_0x4c474b=_[_0x4d82('0x42')]({},_0x4c474b,_0x363158['options']);return db[_0x4d82('0x28')][_0x4d82('0x43')](_0x4c474b)['then'](handleEntityNotFound(_0x37498b,null))['then'](respondWithResult(_0x37498b,null))[_0x4d82('0x3f')](handleError(_0x37498b,null));};exports[_0x4d82('0x44')]=function(_0x40c5ed,_0xb9d3bd){return db[_0x4d82('0x28')][_0x4d82('0x44')](_0x40c5ed[_0x4d82('0x45')],{})['then'](respondWithResult(_0xb9d3bd,0xc9))[_0x4d82('0x3f')](handleError(_0xb9d3bd,null));};exports[_0x4d82('0x20')]=function(_0x2e4083,_0x234ce3){if(_0x2e4083['body']['id']){delete _0x2e4083['body']['id'];}return db['WhatsappApplication'][_0x4d82('0x43')]({'where':{'id':_0x2e4083[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x234ce3,null))[_0x4d82('0x21')](saveUpdates(_0x2e4083[_0x4d82('0x45')],null))[_0x4d82('0x21')](respondWithResult(_0x234ce3,null))['catch'](handleError(_0x234ce3,null));};exports[_0x4d82('0x22')]=function(_0x1c022d,_0x3c0ffc){return db[_0x4d82('0x28')][_0x4d82('0x43')]({'where':{'id':_0x1c022d[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x3c0ffc,null))[_0x4d82('0x21')](removeEntity(_0x3c0ffc,null))[_0x4d82('0x3f')](handleError(_0x3c0ffc,null));}; \ No newline at end of file +var _0x8fcd=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','merge','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','end','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','fields'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x5819ba,_0x231913){_0x5819ba=_0x5819ba-0x0;var _0x13642c=_0x8fcd[_0x5819ba];return _0x13642c;};'use strict';var emlformat=require(_0xd8fc('0x0'));var rimraf=require(_0xd8fc('0x1'));var zipdir=require(_0xd8fc('0x2'));var jsonpatch=require(_0xd8fc('0x3'));var rp=require(_0xd8fc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd8fc('0x5'));var util=require(_0xd8fc('0x6'));var path=require(_0xd8fc('0x7'));var sox=require(_0xd8fc('0x8'));var csv=require(_0xd8fc('0x9'));var ejs=require(_0xd8fc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd8fc('0xb'));var crypto=require('crypto');var jsforce=require(_0xd8fc('0xc'));var deskjs=require(_0xd8fc('0xd'));var toCsv=require(_0xd8fc('0x9'));var querystring=require(_0xd8fc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd8fc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8fc('0x10'));var logger=require(_0xd8fc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd8fc('0x12'));var licenseUtil=require(_0xd8fc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c41e9,_0x955550){_0x955550=_0x955550||0xcc;return function(_0x2b9d7e){if(_0x2b9d7e){return _0x3c41e9[_0xd8fc('0x14')](_0x955550);}return _0x3c41e9[_0xd8fc('0x15')](_0x955550)['end']();};}function respondWithResult(_0x32b375,_0x4f1064){_0x4f1064=_0x4f1064||0xc8;return function(_0x4761f){if(_0x4761f){return _0x32b375[_0xd8fc('0x15')](_0x4f1064)[_0xd8fc('0x16')](_0x4761f);}};}function respondWithFilteredResult(_0x524bac,_0x426e56){return function(_0x233c7e){if(_0x233c7e){var _0x57838b=typeof _0x426e56['offset']===_0xd8fc('0x17')&&typeof _0x426e56[_0xd8fc('0x18')]===_0xd8fc('0x17');var _0x4daf69=_0x233c7e[_0xd8fc('0x19')];var _0x1c744d=_0x57838b?0x0:_0x426e56[_0xd8fc('0x1a')];var _0x1cb0d4=_0x57838b?_0x233c7e[_0xd8fc('0x19')]:_0x426e56[_0xd8fc('0x1a')]+_0x426e56[_0xd8fc('0x18')];var _0x1d7e77;if(_0x1cb0d4>=_0x4daf69){_0x1cb0d4=_0x4daf69;_0x1d7e77=0xc8;}else{_0x1d7e77=0xce;}_0x524bac[_0xd8fc('0x15')](_0x1d7e77);return _0x524bac['set'](_0xd8fc('0x1b'),_0x1c744d+'-'+_0x1cb0d4+'/'+_0x4daf69)[_0xd8fc('0x16')](_0x233c7e);}return null;};}function patchUpdates(_0x24001d){return function(_0x3f9d57){try{jsonpatch[_0xd8fc('0x1c')](_0x3f9d57,_0x24001d,!![]);}catch(_0xd24b3f){return BPromise['reject'](_0xd24b3f);}return _0x3f9d57[_0xd8fc('0x1d')]();};}function saveUpdates(_0x3f0196,_0x5cd1f9){return function(_0x37a93b){if(_0x37a93b){return _0x37a93b['update'](_0x3f0196)[_0xd8fc('0x1e')](function(_0x370a62){return _0x370a62;});}return null;};}function removeEntity(_0x59b0ef,_0x5c852a){return function(_0x47ccff){if(_0x47ccff){return _0x47ccff[_0xd8fc('0x1f')]()[_0xd8fc('0x1e')](function(){_0x59b0ef[_0xd8fc('0x15')](0xcc)[_0xd8fc('0x20')]();});}};}function handleEntityNotFound(_0x495bd2,_0x71dcc1){return function(_0x45ac21){if(!_0x45ac21){_0x495bd2['sendStatus'](0x194);}return _0x45ac21;};}function handleError(_0x270204,_0x5e50c4){_0x5e50c4=_0x5e50c4||0x1f4;return function(_0x200a2b){logger[_0xd8fc('0x21')](_0x200a2b[_0xd8fc('0x22')]);if(_0x200a2b[_0xd8fc('0x23')]){delete _0x200a2b['name'];}_0x270204[_0xd8fc('0x15')](_0x5e50c4)['send'](_0x200a2b);};}exports[_0xd8fc('0x24')]=function(_0x1692d0,_0x4e823d){var _0x4a5383={},_0x56a980={},_0x3bec97={'count':0x0,'rows':[]};var _0x2081ca=_[_0xd8fc('0x25')](db[_0xd8fc('0x26')][_0xd8fc('0x27')],function(_0x281559){return{'name':_0x281559[_0xd8fc('0x28')],'type':_0x281559[_0xd8fc('0x29')][_0xd8fc('0x2a')]};});_0x56a980['model']=_[_0xd8fc('0x25')](_0x2081ca,_0xd8fc('0x23'));_0x56a980['query']=_[_0xd8fc('0x2b')](_0x1692d0[_0xd8fc('0x2c')]);_0x56a980[_0xd8fc('0x2d')]=_['intersection'](_0x56a980[_0xd8fc('0x2e')],_0x56a980[_0xd8fc('0x2c')]);_0x4a5383[_0xd8fc('0x2f')]=_['intersection'](_0x56a980['model'],qs['fields'](_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x30')]));_0x4a5383[_0xd8fc('0x2f')]=_0x4a5383[_0xd8fc('0x2f')][_0xd8fc('0x31')]?_0x4a5383[_0xd8fc('0x2f')]:_0x56a980[_0xd8fc('0x2e')];if(!_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x32')](_0xd8fc('0x33'))){_0x4a5383['limit']=qs[_0xd8fc('0x18')](_0x1692d0['query'][_0xd8fc('0x18')]);_0x4a5383['offset']=qs['offset'](_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x1a')]);}_0x4a5383[_0xd8fc('0x34')]=qs[_0xd8fc('0x35')](_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x35')]);_0x4a5383['where']=qs[_0xd8fc('0x2d')](_[_0xd8fc('0x36')](_0x1692d0[_0xd8fc('0x2c')],_0x56a980['filters']),_0x2081ca);if(_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x37')]){_0x4a5383['where']=_['merge'](_0x4a5383[_0xd8fc('0x38')],{'$or':_['map'](_0x2081ca,function(_0x1ac864){if(_0x1ac864['type']!==_0xd8fc('0x39')){var _0x2cd726={};_0x2cd726[_0x1ac864[_0xd8fc('0x23')]]={'$like':'%'+_0x1692d0['query'][_0xd8fc('0x37')]+'%'};return _0x2cd726;}})});}_0x4a5383=_['merge']({},_0x4a5383,_0x1692d0[_0xd8fc('0x3a')]);var _0x16f411={'where':_0x4a5383['where']};return db[_0xd8fc('0x26')][_0xd8fc('0x19')](_0x16f411)[_0xd8fc('0x1e')](function(_0x17dba2){_0x3bec97['count']=_0x17dba2;if(_0x1692d0[_0xd8fc('0x2c')][_0xd8fc('0x3b')]){_0x4a5383[_0xd8fc('0x3c')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x4a5383);})['then'](function(_0x17ffbb){_0x3bec97[_0xd8fc('0x3d')]=_0x17ffbb;return _0x3bec97;})[_0xd8fc('0x1e')](respondWithFilteredResult(_0x4e823d,_0x4a5383))[_0xd8fc('0x3e')](handleError(_0x4e823d,null));};exports['show']=function(_0x32c555,_0x145f37){var _0xaaa4b2={'raw':!![],'where':{'id':_0x32c555[_0xd8fc('0x3f')]['id']}},_0x126ff4={};_0x126ff4[_0xd8fc('0x2e')]=_[_0xd8fc('0x2b')](db['WhatsappApplication'][_0xd8fc('0x27')]);_0x126ff4[_0xd8fc('0x2c')]=_['keys'](_0x32c555[_0xd8fc('0x2c')]);_0x126ff4[_0xd8fc('0x2d')]=_[_0xd8fc('0x40')](_0x126ff4[_0xd8fc('0x2e')],_0x126ff4[_0xd8fc('0x2c')]);_0xaaa4b2[_0xd8fc('0x2f')]=_[_0xd8fc('0x40')](_0x126ff4[_0xd8fc('0x2e')],qs[_0xd8fc('0x30')](_0x32c555[_0xd8fc('0x2c')][_0xd8fc('0x30')]));_0xaaa4b2[_0xd8fc('0x2f')]=_0xaaa4b2[_0xd8fc('0x2f')][_0xd8fc('0x31')]?_0xaaa4b2['attributes']:_0x126ff4['model'];if(_0x32c555['query'][_0xd8fc('0x3b')]){_0xaaa4b2[_0xd8fc('0x3c')]=[{'all':!![]}];}_0xaaa4b2=_[_0xd8fc('0x41')]({},_0xaaa4b2,_0x32c555[_0xd8fc('0x3a')]);return db['WhatsappApplication'][_0xd8fc('0x42')](_0xaaa4b2)[_0xd8fc('0x1e')](handleEntityNotFound(_0x145f37,null))[_0xd8fc('0x1e')](respondWithResult(_0x145f37,null))[_0xd8fc('0x3e')](handleError(_0x145f37,null));};exports[_0xd8fc('0x43')]=function(_0x19b43e,_0xc12ace){return db['WhatsappApplication']['create'](_0x19b43e['body'],{})[_0xd8fc('0x1e')](respondWithResult(_0xc12ace,0xc9))[_0xd8fc('0x3e')](handleError(_0xc12ace,null));};exports[_0xd8fc('0x44')]=function(_0x13cd5d,_0x2dd8e0){if(_0x13cd5d[_0xd8fc('0x45')]['id']){delete _0x13cd5d[_0xd8fc('0x45')]['id'];}return db[_0xd8fc('0x26')][_0xd8fc('0x42')]({'where':{'id':_0x13cd5d['params']['id']}})['then'](handleEntityNotFound(_0x2dd8e0,null))[_0xd8fc('0x1e')](saveUpdates(_0x13cd5d['body'],null))[_0xd8fc('0x1e')](respondWithResult(_0x2dd8e0,null))['catch'](handleError(_0x2dd8e0,null));};exports[_0xd8fc('0x1f')]=function(_0x3d913a,_0x57206c){return db[_0xd8fc('0x26')][_0xd8fc('0x42')]({'where':{'id':_0x3d913a[_0xd8fc('0x3f')]['id']}})[_0xd8fc('0x1e')](handleEntityNotFound(_0x57206c,null))[_0xd8fc('0x1e')](removeEntity(_0x57206c,null))[_0xd8fc('0x3e')](handleError(_0x57206c,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7f95c36..6215c23 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 _0x1e69=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0xd66b2b,_0x3f6f87){var _0x124b48=function(_0x553d2b){while(--_0x553d2b){_0xd66b2b['push'](_0xd66b2b['shift']());}};_0x124b48(++_0x3f6f87);}(_0x1e69,0x85));var _0x91e6=function(_0x20522a,_0x11bb0){_0x20522a=_0x20522a-0x0;var _0x3105e0=_0x1e69[_0x20522a];return _0x3105e0;};'use strict';var _=require('lodash');var util=require(_0x91e6('0x0'));var logger=require(_0x91e6('0x1'))(_0x91e6('0x2'));var moment=require(_0x91e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x91e6('0x4'));var rimraf=require(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var attributes=require(_0x91e6('0x7'));module[_0x91e6('0x8')]=function(_0x42fe90,_0x4091b8){return _0x42fe90[_0x91e6('0x9')](_0x91e6('0xa'),attributes,{'tableName':_0x91e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x91e6('0xc'),'collate':_0x91e6('0xd')});}; \ No newline at end of file +var _0xe015=['path','rimraf','../../config/environment','./whatsappApplication.attributes','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird'];(function(_0x4054cc,_0x57d25b){var _0x548965=function(_0x54fb07){while(--_0x54fb07){_0x4054cc['push'](_0x4054cc['shift']());}};_0x548965(++_0x57d25b);}(_0xe015,0x13b));var _0x5e01=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe015[_0x432682];return _0x463d05;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('WhatsappApplication',attributes,{'tableName':_0x5e01('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5e01('0x9'),'collate':_0x5e01('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 6b7a94c..3b6fc81 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 _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2372d3,_0x571f4c){var _0x741723=function(_0x50ecb5){while(--_0x50ecb5){_0x2372d3['push'](_0x2372d3['shift']());}};_0x741723(++_0x571f4c);}(_0x4c4e,0x152));var _0xe4c4=function(_0xc16fc5,_0x3a5e97){_0xc16fc5=_0xc16fc5-0x0;var _0x2acb94=_0x4c4e[_0xc16fc5];return _0x2acb94;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x367ea9,_0x290a63){var _0x5cb616=function(_0x5c9a22){while(--_0x5c9a22){_0x367ea9['push'](_0x367ea9['shift']());}};_0x5cb616(++_0x290a63);}(_0x54ef,0x112));var _0xf54e=function(_0x2f11fd,_0x7992b7){_0x2f11fd=_0x2f11fd-0x0;var _0x424ed1=_0x54ef[_0x2f11fd];return _0x424ed1;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index c307e09..cb848ae 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 _0x444e=['addTags','put','tracked','whatsappinteraction:update','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','post','create','/:id/tags','whatsapp'];(function(_0x1dbd98,_0x22b969){var _0x1ae2ea=function(_0x763ce1){while(--_0x763ce1){_0x1dbd98['push'](_0x1dbd98['shift']());}};_0x1ae2ea(++_0x22b969);}(_0x444e,0xe8));var _0xe444=function(_0x418452,_0x17b24f){_0x418452=_0x418452-0x0;var _0x7f36e5=_0x444e[_0x418452];return _0x7f36e5;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var fs_extra=require(_0xe444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var controller=require(_0xe444('0x6'));router[_0xe444('0x7')]('/',auth[_0xe444('0x8')](),controller[_0xe444('0x9')]);router['get'](_0xe444('0xa'),auth['isAuthenticated'](),controller[_0xe444('0xb')]);router['get'](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0xd')]);router['get']('/:id/messages',auth[_0xe444('0x8')](),controller[_0xe444('0xe')]);router['get'](_0xe444('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xe444('0x10')]('/',auth['isAuthenticated'](),controller[_0xe444('0x11')]);router[_0xe444('0x10')]('/:id/messages',auth[_0xe444('0x8')](),controller['addMessage']);router['post'](_0xe444('0x12'),auth[_0xe444('0x8')](),interaction['tracked'](_0xe444('0x13'),'whatsappinteraction:addtags'),controller[_0xe444('0x14')]);router[_0xe444('0x15')](_0xe444('0xc'),auth[_0xe444('0x8')](),interaction[_0xe444('0x16')](_0xe444('0x13'),_0xe444('0x17')),controller[_0xe444('0x18')]);router[_0xe444('0x19')](_0xe444('0xc'),auth[_0xe444('0x8')](),interaction[_0xe444('0x16')](_0xe444('0x13'),'whatsappinteraction:destroy'),controller[_0xe444('0x1a')]);router[_0xe444('0x19')](_0xe444('0x12'),auth[_0xe444('0x8')](),controller['removeTags']);module[_0xe444('0x1b')]=router; \ No newline at end of file +var _0xfd87=['index','/describe','describe','get','/:id','show','/:id/messages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated'];(function(_0x5a645b,_0x1d42bd){var _0x4420c4=function(_0x3fad18){while(--_0x3fad18){_0x5a645b['push'](_0x5a645b['shift']());}};_0x4420c4(++_0x1d42bd);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var fs_extra=require(_0x7fd8('0x6'));var auth=require(_0x7fd8('0x7'));var interaction=require(_0x7fd8('0x8'));var config=require(_0x7fd8('0x9'));var controller=require(_0x7fd8('0xa'));router['get']('/',auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xc')]);router['get'](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xf')](_0x7fd8('0x10'),auth['isAuthenticated'](),controller[_0x7fd8('0x11')]);router[_0x7fd8('0xf')](_0x7fd8('0x12'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x7fd8('0x13'),auth['isAuthenticated'](),controller[_0x7fd8('0x14')]);router[_0x7fd8('0x15')]('/',auth[_0x7fd8('0xb')](),controller['create']);router[_0x7fd8('0x15')](_0x7fd8('0x12'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0x16')]);router[_0x7fd8('0x15')]('/:id/tags',auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')](_0x7fd8('0x18'),_0x7fd8('0x19')),controller[_0x7fd8('0x1a')]);router[_0x7fd8('0x1b')](_0x7fd8('0x10'),auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')](_0x7fd8('0x18'),_0x7fd8('0x1c')),controller['update']);router['delete']('/:id',auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')]('whatsapp',_0x7fd8('0x1d')),controller[_0x7fd8('0x1e')]);router[_0x7fd8('0x1f')](_0x7fd8('0x20'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0x21')]);module[_0x7fd8('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index d4f2e56..9b345b4 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 _0x44ff=['out','DATE','ENUM','moment','exports','BOOLEAN','STRING'];(function(_0x31842e,_0xc822e3){var _0x102c8d=function(_0x2ef332){while(--_0x2ef332){_0x31842e['push'](_0x31842e['shift']());}};_0x102c8d(++_0xc822e3);}(_0x44ff,0x1c3));var _0xf44f=function(_0x2cdadd,_0x40d6d0){_0x2cdadd=_0x2cdadd-0x0;var _0x3dd479=_0x44ff[_0x2cdadd];return _0x3dd479;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf44f('0x0'));module[_0xf44f('0x1')]={'closed':{'type':Sequelize[_0xf44f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf44f('0x3')]},'phone':{'type':Sequelize[_0xf44f('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf44f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf44f('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xf44f('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf44f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xfb82=['moment','exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x510f44,_0x401207){var _0x4c8a33=function(_0x283924){while(--_0x283924){_0x510f44['push'](_0x510f44['shift']());}};_0x4c8a33(++_0x401207);}(_0xfb82,0x17f));var _0x2fb8=function(_0x268f60,_0x24a661){_0x268f60=_0x268f60-0x0;var _0x172f4b=_0xfb82[_0x268f60];return _0x172f4b;};'use strict';var Sequelize=require(_0x2fb8('0x0'));var moment=require(_0x2fb8('0x1'));module[_0x2fb8('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2fb8('0x3')]},'disposition':{'type':Sequelize[_0x2fb8('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2fb8('0x4')]},'note':{'type':Sequelize[_0x2fb8('0x4')]},'phone':{'type':Sequelize[_0x2fb8('0x4')]},'read1stAt':{'type':Sequelize[_0x2fb8('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2fb8('0x5')]('in',_0x2fb8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2fb8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2fb8('0x5')]('in',_0x2fb8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2fb8('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 72e3a00..fbe9324 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 _0x9a1c=['update','then','destroy','name','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','query','user','catch','show','params','keys','intersection','attributes','fields','model','includeAll','include','merge','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','findOne','filters','length','nolimit','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','read','WhatsappAccount','Account','User','Owner','get','Whatsapp','N.A.','closed','closedAt','basename','existsSync','pipe','out','System','value','renderFile','views','createPdfFromHTML','log','err','unlinkSync','zip-dir','util','ejs','lodash','../../components/interaction/service','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','limit','undefined','count','offset','Content-Range','json'];(function(_0x274491,_0x17eaf2){var _0x44c9b4=function(_0x20ed3c){while(--_0x20ed3c){_0x274491['push'](_0x274491['shift']());}};_0x44c9b4(++_0x17eaf2);}(_0x9a1c,0x150));var _0xc9a1=function(_0x1ac924,_0x12b284){_0x1ac924=_0x1ac924-0x0;var _0x599f5d=_0x9a1c[_0x1ac924];return _0x599f5d;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc9a1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xc9a1('0x1'));var path=require('path');var ejs=require(_0xc9a1('0x2'));var fs=require('fs');var _=require(_0xc9a1('0x3'));var Redis=require('ioredis');var interaction=require(_0xc9a1('0x4'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xc9a1('0x5'))('api');var config=require('../../config/environment');var db=require(_0xc9a1('0x6'))['db'];config[_0xc9a1('0x7')]=_[_0xc9a1('0x8')](config[_0xc9a1('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xc9a1('0x9'))(new Redis(config[_0xc9a1('0x7')]));require(_0xc9a1('0xa'))[_0xc9a1('0xb')](socket);function respondWithStatusCode(_0xca2ee5,_0x49a425){_0x49a425=_0x49a425||0xcc;return function(_0x5791f9){if(_0x5791f9){return _0xca2ee5[_0xc9a1('0xc')](_0x49a425);}return _0xca2ee5['status'](_0x49a425)[_0xc9a1('0xd')]();};}function respondWithResult(_0x339deb,_0x33f04b){_0x33f04b=_0x33f04b||0xc8;return function(_0x42dd2b){if(_0x42dd2b){return _0x339deb[_0xc9a1('0xe')](_0x33f04b)['json'](_0x42dd2b);}};}function respondWithFilteredResult(_0xe9d81f,_0x2ae732){return function(_0x1e3c92){if(_0x1e3c92){var _0x4fa955=typeof _0x2ae732['offset']==='undefined'&&typeof _0x2ae732[_0xc9a1('0xf')]===_0xc9a1('0x10');var _0x3aac45=_0x1e3c92[_0xc9a1('0x11')];var _0x50bbd1=_0x4fa955?0x0:_0x2ae732['offset'];var _0x5d4cf1=_0x4fa955?_0x1e3c92[_0xc9a1('0x11')]:_0x2ae732[_0xc9a1('0x12')]+_0x2ae732['limit'];var _0xfd3f3a;if(_0x5d4cf1>=_0x3aac45){_0x5d4cf1=_0x3aac45;_0xfd3f3a=0xc8;}else{_0xfd3f3a=0xce;}_0xe9d81f[_0xc9a1('0xe')](_0xfd3f3a);return _0xe9d81f['set'](_0xc9a1('0x13'),_0x50bbd1+'-'+_0x5d4cf1+'/'+_0x3aac45)[_0xc9a1('0x14')](_0x1e3c92);}return null;};}function saveUpdates(_0x179874){return function(_0x4132da){if(_0x4132da){return _0x4132da[_0xc9a1('0x15')](_0x179874)[_0xc9a1('0x16')](function(_0x8fd0f1){return _0x8fd0f1;});}return null;};}function removeEntity(_0x481bad){return function(_0x4650e6){if(_0x4650e6){return _0x4650e6[_0xc9a1('0x17')]()[_0xc9a1('0x16')](function(){_0x481bad[_0xc9a1('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b6b0f){return function(_0x4f818d){if(!_0x4f818d){_0x5b6b0f['sendStatus'](0x194);}return _0x4f818d;};}function handleError(_0x23fc98,_0x593c8d){_0x593c8d=_0x593c8d||0x1f4;return function(_0x5a6c26){logger['error'](_0x5a6c26['stack']);if(_0x5a6c26[_0xc9a1('0x18')]){delete _0x5a6c26[_0xc9a1('0x18')];}_0x23fc98[_0xc9a1('0xe')](_0x593c8d)['send'](_0x5a6c26);};}exports[_0xc9a1('0x19')]=function(_0x921602,_0x190ddb){var _0x37b54d={};var _0x29d30a=_[_0xc9a1('0x1a')](db[_0xc9a1('0x1b')][_0xc9a1('0x1c')],function(_0x2eaf64){return{'name':_0x2eaf64[_0xc9a1('0x1d')],'type':_0x2eaf64[_0xc9a1('0x1e')]['key']};});_0x37b54d=qs[_0xc9a1('0x1f')](_0x29d30a,_0x921602);return interaction[_0xc9a1('0x20')](_0xc9a1('0x21'),_0x921602[_0xc9a1('0x22')],_0x921602[_0xc9a1('0x23')],_0x37b54d,_0x29d30a)[_0xc9a1('0x16')](respondWithFilteredResult(_0x190ddb,_0x37b54d))[_0xc9a1('0x24')](handleError(_0x190ddb,null));};exports[_0xc9a1('0x25')]=function(_0x43c46d,_0x296f63){var _0x3cc8e4={'raw':![],'where':{'id':_0x43c46d[_0xc9a1('0x26')]['id']}},_0x476eaa={};_0x476eaa['model']=_[_0xc9a1('0x27')](db['WhatsappInteraction'][_0xc9a1('0x1c')]);_0x476eaa[_0xc9a1('0x22')]=_['keys'](_0x43c46d[_0xc9a1('0x22')]);_0x476eaa['filters']=_[_0xc9a1('0x28')](_0x476eaa['model'],_0x476eaa[_0xc9a1('0x22')]);_0x3cc8e4[_0xc9a1('0x29')]=_[_0xc9a1('0x28')](_0x476eaa['model'],qs[_0xc9a1('0x2a')](_0x43c46d[_0xc9a1('0x22')]['fields']));_0x3cc8e4['attributes']=_0x3cc8e4[_0xc9a1('0x29')]['length']?_0x3cc8e4[_0xc9a1('0x29')]:_0x476eaa[_0xc9a1('0x2b')];if(_0x43c46d[_0xc9a1('0x22')][_0xc9a1('0x2c')]){_0x3cc8e4[_0xc9a1('0x2d')]=[{'all':!![]}];}_0x3cc8e4=_[_0xc9a1('0x2e')]({},_0x3cc8e4,_0x43c46d['options']);return db[_0xc9a1('0x1b')][_0xc9a1('0x2f')](_0x3cc8e4)[_0xc9a1('0x16')](handleEntityNotFound(_0x296f63,null))[_0xc9a1('0x16')](respondWithResult(_0x296f63,null))[_0xc9a1('0x24')](handleError(_0x296f63,null));};exports[_0xc9a1('0x30')]=function(_0xc6f228,_0x392cf0){return db[_0xc9a1('0x1b')][_0xc9a1('0x30')](_0xc6f228[_0xc9a1('0x31')],{})['then'](respondWithResult(_0x392cf0,0xc9))[_0xc9a1('0x24')](handleError(_0x392cf0,null));};exports['update']=function(_0x56de8a,_0x59abe4){if(_0x56de8a[_0xc9a1('0x31')]['id']){delete _0x56de8a['body']['id'];}return db[_0xc9a1('0x1b')][_0xc9a1('0x2f')]({'where':{'id':_0x56de8a[_0xc9a1('0x26')]['id']}})[_0xc9a1('0x16')](handleEntityNotFound(_0x59abe4,null))['then'](saveUpdates(_0x56de8a[_0xc9a1('0x31')],null))[_0xc9a1('0x16')](respondWithResult(_0x59abe4,null))[_0xc9a1('0x24')](handleError(_0x59abe4,null));};exports[_0xc9a1('0x17')]=function(_0x37b937,_0xc348d7){return db[_0xc9a1('0x1b')][_0xc9a1('0x2f')]({'where':{'id':_0x37b937[_0xc9a1('0x26')]['id']}})[_0xc9a1('0x16')](handleEntityNotFound(_0xc348d7,null))['then'](removeEntity(_0xc348d7,null))[_0xc9a1('0x24')](handleError(_0xc348d7,null));};exports['describe']=function(_0x244c68,_0x36fef6){return db[_0xc9a1('0x1b')][_0xc9a1('0x32')]()[_0xc9a1('0x16')](respondWithResult(_0x36fef6,null))[_0xc9a1('0x24')](handleError(_0x36fef6,null));};exports[_0xc9a1('0x33')]=function(_0x5bb6d7,_0x36255f){return db[_0xc9a1('0x34')][_0xc9a1('0x2f')]({'where':{'id':_0x5bb6d7[_0xc9a1('0x26')]['id']}})[_0xc9a1('0x16')](handleEntityNotFound(_0x36255f,null))['then'](function(_0x133041){if(_0x133041){return _0x133041['addMessage'](_0x5bb6d7['body'][_0xc9a1('0x35')],_[_0xc9a1('0x36')](_0x5bb6d7[_0xc9a1('0x31')],[_0xc9a1('0x35'),'id'])||{});}})[_0xc9a1('0x16')](respondWithResult(_0x36255f,null))[_0xc9a1('0x24')](handleError(_0x36255f,null));};exports['getMessages']=function(_0x2e80e1,_0x25d738){var _0x2befdf={'raw':![],'where':{}};var _0x578c52={};var _0x3a43f0={'count':0x0,'rows':[]};return db[_0xc9a1('0x1b')][_0xc9a1('0x37')]({'where':{'id':_0x2e80e1['params']['id']}})[_0xc9a1('0x16')](handleEntityNotFound(_0x25d738,null))['then'](function(_0x542503){if(_0x542503){_0x578c52[_0xc9a1('0x2b')]=_[_0xc9a1('0x27')](db[_0xc9a1('0x34')]['rawAttributes']);_0x578c52[_0xc9a1('0x22')]=_[_0xc9a1('0x27')](_0x2e80e1[_0xc9a1('0x22')]);_0x578c52[_0xc9a1('0x38')]=_['intersection'](_0x578c52[_0xc9a1('0x2b')],_0x578c52[_0xc9a1('0x22')]);_0x2befdf['attributes']=_[_0xc9a1('0x28')](_0x578c52[_0xc9a1('0x2b')],qs[_0xc9a1('0x2a')](_0x2e80e1[_0xc9a1('0x22')][_0xc9a1('0x2a')]));_0x2befdf[_0xc9a1('0x29')]=_0x2befdf['attributes'][_0xc9a1('0x39')]?_0x2befdf[_0xc9a1('0x29')]:_0x578c52[_0xc9a1('0x2b')];if(!_0x2e80e1[_0xc9a1('0x22')]['hasOwnProperty'](_0xc9a1('0x3a'))){_0x2befdf[_0xc9a1('0xf')]=qs[_0xc9a1('0xf')](_0x2e80e1[_0xc9a1('0x22')][_0xc9a1('0xf')]);_0x2befdf[_0xc9a1('0x12')]=qs['offset'](_0x2e80e1['query'][_0xc9a1('0x12')]);}_0x2befdf['order']=qs[_0xc9a1('0x3b')](_0x2e80e1[_0xc9a1('0x22')]['sort']);_0x2befdf[_0xc9a1('0x3c')]=qs[_0xc9a1('0x38')](_[_0xc9a1('0x3d')](_0x2e80e1[_0xc9a1('0x22')],_0x578c52[_0xc9a1('0x38')]));_0x2befdf['where'][_0xc9a1('0x3e')]=_0x542503['id'];if(_0x2e80e1[_0xc9a1('0x22')][_0xc9a1('0x3f')]){_0x2befdf['where']=_['merge'](_0x2befdf[_0xc9a1('0x3c')],{'$or':_[_0xc9a1('0x1a')](_0x2befdf[_0xc9a1('0x29')],function(_0x23f2e0){var _0x24b929={};_0x24b929[_0x23f2e0]={'$like':'%'+_0x2e80e1[_0xc9a1('0x22')]['filter']+'%'};return _0x24b929;})});}if(_0x2e80e1[_0xc9a1('0x22')][_0xc9a1('0x40')]){var _0x57ddb2=_0x2e80e1['query'][_0xc9a1('0x40')][_0xc9a1('0x41')](',');var _0x26c5e6={};_0x26c5e6[_0x57ddb2[0x0]]={'$gte':moment(_0x57ddb2[0x1])[_0xc9a1('0x42')](_0xc9a1('0x43'))};_0x2befdf['where']=_['merge'](_0x2befdf[_0xc9a1('0x3c')],_0x26c5e6);}_0x2befdf=_[_0xc9a1('0x2e')]({},_0x2befdf,_0x2e80e1[_0xc9a1('0x44')]);return db['WhatsappMessage']['count']({'where':_0x2befdf[_0xc9a1('0x3c')]})['then'](function(_0xca3a80){_0x3a43f0[_0xc9a1('0x11')]=_0xca3a80;if(_0x2e80e1[_0xc9a1('0x22')][_0xc9a1('0x2c')]){_0x2befdf[_0xc9a1('0x2d')]=[{'all':!![]}];}return db[_0xc9a1('0x34')]['findAll'](_0x2befdf);})['then'](function(_0x511863){_0x3a43f0[_0xc9a1('0x45')]=_0x511863;return _0x3a43f0;});}})[_0xc9a1('0x16')](respondWithFilteredResult(_0x25d738,_0x2befdf))['catch'](handleError(_0x25d738,null));};exports[_0xc9a1('0x46')]=function(_0x547dcf,_0x3a614f){return db['WhatsappInteraction'][_0xc9a1('0x2f')]({'where':{'id':_0x547dcf['params']['id']}})[_0xc9a1('0x16')](handleEntityNotFound(_0x3a614f,null))[_0xc9a1('0x16')](function(_0x534620){if(_0x534620){return _0x534620[_0xc9a1('0x47')](_0x547dcf[_0xc9a1('0x31')][_0xc9a1('0x35')],_[_0xc9a1('0x36')](_0x547dcf['body'],[_0xc9a1('0x35'),'id'])||{})[_0xc9a1('0x48')](function(){return db[_0xc9a1('0x49')][_0xc9a1('0x20')]({'attributes':['id',_0xc9a1('0x18'),_0xc9a1('0x4a')],'where':{'id':_0x547dcf[_0xc9a1('0x31')]['ids']}});})[_0xc9a1('0x16')](function(_0x388549){socket[_0xc9a1('0x4b')](_0xc9a1('0x4c'),{'id':Number(_0x547dcf[_0xc9a1('0x26')]['id']),'tags':_0x388549||[]});return{'id':Number(_0x547dcf['params']['id']),'tags':_0x388549||[]};});}})[_0xc9a1('0x16')](respondWithResult(_0x3a614f,null))[_0xc9a1('0x24')](handleError(_0x3a614f,null));};exports[_0xc9a1('0x4d')]=function(_0x5650f1,_0x5a4ad3){return db[_0xc9a1('0x1b')]['find']({'where':{'id':_0x5650f1[_0xc9a1('0x26')]['id']}})[_0xc9a1('0x16')](handleEntityNotFound(_0x5a4ad3,null))[_0xc9a1('0x16')](function(_0x421637){if(_0x421637){return _0x421637[_0xc9a1('0x4d')](_0x5650f1[_0xc9a1('0x22')][_0xc9a1('0x35')]);}})[_0xc9a1('0x16')](respondWithStatusCode(_0x5a4ad3,null))[_0xc9a1('0x24')](handleError(_0x5a4ad3,null));};exports[_0xc9a1('0x4e')]=function(_0xff0c0,_0x3f78a6){var _0x1cea8b=moment()[_0xc9a1('0x4f')]()[_0xc9a1('0x50')]();var _0x35fc5e=path[_0xc9a1('0x51')](config[_0xc9a1('0x52')],_0xc9a1('0x53'),_0xc9a1('0x54'),_0xc9a1('0x55'));var _0x11a3cb=path['join'](config['root'],_0xc9a1('0x53'),_0xc9a1('0x54'),_0xc9a1('0x56'));var _0x4f956f=path[_0xc9a1('0x51')](_0x35fc5e,_0x1cea8b);var _0x19b5b8=util[_0xc9a1('0x42')](_0xc9a1('0x57'),_0xff0c0[_0xc9a1('0x26')]['id'],_0x1cea8b);var _0xfea873=path['join'](_0x35fc5e,_0x19b5b8);var _0x276c7f=[];_0x276c7f[_0xc9a1('0x58')]({'model':db['User'],'as':'User','attributes':['id',_0xc9a1('0x59')],'raw':!![]});_0x276c7f[_0xc9a1('0x58')]({'model':db[_0xc9a1('0x5a')],'as':_0xc9a1('0x5b'),'attributes':['id',_0xc9a1('0x5c'),_0xc9a1('0x5d')],'raw':!![]});if(_0xff0c0[_0xc9a1('0x22')][_0xc9a1('0x56')]){_0x276c7f[_0xc9a1('0x58')]({'model':db['Attachment'],'as':_0xc9a1('0x5e'),'raw':!![]});}var _0xfdabc4=[{'model':db[_0xc9a1('0x34')],'as':'Messages','attributes':['id',_0xc9a1('0x31'),_0xc9a1('0x5f'),_0xc9a1('0x60'),'secret',_0xc9a1('0x61')],'include':_0x276c7f}];_0xfdabc4[_0xc9a1('0x58')]({'model':db[_0xc9a1('0x62')],'as':_0xc9a1('0x63'),'attributes':['id',_0xc9a1('0x18')]});_0xfdabc4['push']({'model':db[_0xc9a1('0x64')],'as':_0xc9a1('0x65'),'attributes':['id',_0xc9a1('0x59')]});return db[_0xc9a1('0x1b')][_0xc9a1('0x2f')]({'where':{'id':_0xff0c0[_0xc9a1('0x26')]['id']},'include':_0xfdabc4})[_0xc9a1('0x16')](handleEntityNotFound(_0x3f78a6,null))[_0xc9a1('0x16')](function(_0x212b06){if(_0x212b06){var _0x510f03=_0x212b06[_0xc9a1('0x66')]({'plain':!![]});fs['mkdirSync'](_0x4f956f);var _0x178d73={'channel':_0xc9a1('0x67'),'account':_0x510f03[_0xc9a1('0x63')]['name'],'agent':_0x510f03[_0xc9a1('0x65')]?_0x510f03[_0xc9a1('0x65')][_0xc9a1('0x59')]:_0xc9a1('0x68'),'createdAt':moment(_0x510f03['createdAt'])[_0xc9a1('0x42')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x510f03[_0xc9a1('0x69')]?moment(_0x510f03[_0xc9a1('0x6a')])['format'](_0xc9a1('0x43'))[_0xc9a1('0x50')]():'','disposition':_0x510f03['disposition'],'messages':_(_0x510f03['Messages'])[_0xc9a1('0x3f')]({'secret':![]})[_0xc9a1('0x1a')](function(_0x1426fc){if(_0x1426fc[_0xc9a1('0x5e')]){var _0x5cbb54=path[_0xc9a1('0x51')](_0x11a3cb,_0x1426fc[_0xc9a1('0x5e')][_0xc9a1('0x6b')]);if(fs[_0xc9a1('0x6c')](_0x5cbb54)){fs['createReadStream'](_0x5cbb54)[_0xc9a1('0x6d')](fs['createWriteStream'](path[_0xc9a1('0x51')](_0x4f956f,_0x1426fc[_0xc9a1('0x5e')][_0xc9a1('0x6b')])));}}return{'date':moment(_0x1426fc['createdAt'])[_0xc9a1('0x42')](_0xc9a1('0x43'))['toString'](),'sender':_0x1426fc[_0xc9a1('0x60')]===_0xc9a1('0x6e')?_0x1426fc['User']?_0x1426fc[_0xc9a1('0x64')]['fullname']:_0xc9a1('0x6f'):_0x1426fc[_0xc9a1('0x5b')][_0xc9a1('0x5c')]+(_0x1426fc[_0xc9a1('0x5b')][_0xc9a1('0x5d')]?'\x20'+_0x1426fc['Contact'][_0xc9a1('0x5d')]:''),'body':_0x1426fc[_0xc9a1('0x5e')]?_0x1426fc[_0xc9a1('0x5e')][_0xc9a1('0x6b')]:_0x1426fc[_0xc9a1('0x31')],'direction':_0x1426fc[_0xc9a1('0x60')]===_0xc9a1('0x6e')?'A':'C','secret':_0x1426fc['secret'],'read':_0x1426fc['read'],'attachment':_0x1426fc['Attachment']};})[_0xc9a1('0x70')]()};return ejs[_0xc9a1('0x71')](path[_0xc9a1('0x51')](config[_0xc9a1('0x52')],_0xc9a1('0x53'),_0xc9a1('0x72'),'downloadInteraction.ejs'),{'interaction':_0x178d73})[_0xc9a1('0x16')](function(_0x4d940d){var _0x198841=path['join'](_0x4f956f,'transcript-'+_0x510f03['id']+'-'+_0x1cea8b+'.pdf');var _0x5953db={'path':_0x198841,'channel':_0xc9a1('0x67'),'interactionId':_0x510f03['id']};return pdf[_0xc9a1('0x73')](_0x4d940d,_0x5953db);})[_0xc9a1('0x16')](function(){return new BPromise(function(_0x8d3c4,_0x3e5a23){zipdir(_0x4f956f,{'saveTo':_0xfea873},function(_0x27b3be,_0xb8889c){if(_0x27b3be)return _0x3e5a23(_0x27b3be);return _0x8d3c4(_0xb8889c);});})[_0xc9a1('0x16')](function(){return new BPromise(function(_0xb05109,_0x4eb64a){rimraf(_0x4f956f,function(_0xce8347){if(_0xce8347)_0x4eb64a(_0xce8347);return _0xb05109();});});})['then'](function(){return _0x3f78a6['download'](_0xfea873,_0x19b5b8,function(_0x72f35c){if(_0x72f35c){console[_0xc9a1('0x74')](_0xc9a1('0x75'),_0x72f35c);}else{fs[_0xc9a1('0x76')](_0xfea873);}});});});}else{return _0x3f78a6['sendStatus'](0xc8);}})['catch'](handleError(_0x3f78a6,null));}; \ No newline at end of file +var _0x86f8=['./whatsappInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','getOptions','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','create','body','find','describe','WhatsappMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','options','findAll','rows','addTags','setTags','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','toString','join','root','server','tmp','files','format','push','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','createdAt','secret','read','Account','Owner','fullname','get','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','createReadStream','createWriteStream','basename','direction','out','User','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','log','unlinkSync','zip-dir','bluebird','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0xdb951d,_0x1dc42b){var _0x5e789e=function(_0x1056cd){while(--_0x1056cd){_0xdb951d['push'](_0xdb951d['shift']());}};_0x5e789e(++_0x1dc42b);}(_0x86f8,0xed));var _0x886f=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0x86f8[_0x3c6b7d];return _0x1d3ed2;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x886f('0x0'));var moment=require('moment');var BPromise=require(_0x886f('0x1'));var util=require('util');var path=require('path');var ejs=require(_0x886f('0x2'));var fs=require('fs');var _=require(_0x886f('0x3'));var Redis=require(_0x886f('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0x886f('0x5'));var pdf=require(_0x886f('0x6'));var logger=require(_0x886f('0x7'))(_0x886f('0x8'));var config=require(_0x886f('0x9'));var db=require(_0x886f('0xa'))['db'];config[_0x886f('0xb')]=_[_0x886f('0xc')](config['redis'],{'host':_0x886f('0xd'),'port':0x18eb});var socket=require(_0x886f('0xe'))(new Redis(config[_0x886f('0xb')]));require(_0x886f('0xf'))[_0x886f('0x10')](socket);function respondWithStatusCode(_0x3358e4,_0x5e9e45){_0x5e9e45=_0x5e9e45||0xcc;return function(_0x2447c8){if(_0x2447c8){return _0x3358e4[_0x886f('0x11')](_0x5e9e45);}return _0x3358e4['status'](_0x5e9e45)[_0x886f('0x12')]();};}function respondWithResult(_0x91e50e,_0x5c1f8c){_0x5c1f8c=_0x5c1f8c||0xc8;return function(_0x3a4521){if(_0x3a4521){return _0x91e50e[_0x886f('0x13')](_0x5c1f8c)[_0x886f('0x14')](_0x3a4521);}};}function respondWithFilteredResult(_0x533df9,_0x291056){return function(_0x2dfda3){if(_0x2dfda3){var _0x550090=typeof _0x291056[_0x886f('0x15')]==='undefined'&&typeof _0x291056[_0x886f('0x16')]===_0x886f('0x17');var _0x4ad246=_0x2dfda3[_0x886f('0x18')];var _0x41f002=_0x550090?0x0:_0x291056['offset'];var _0x4ddaeb=_0x550090?_0x2dfda3[_0x886f('0x18')]:_0x291056[_0x886f('0x15')]+_0x291056[_0x886f('0x16')];var _0x4bc944;if(_0x4ddaeb>=_0x4ad246){_0x4ddaeb=_0x4ad246;_0x4bc944=0xc8;}else{_0x4bc944=0xce;}_0x533df9[_0x886f('0x13')](_0x4bc944);return _0x533df9[_0x886f('0x19')](_0x886f('0x1a'),_0x41f002+'-'+_0x4ddaeb+'/'+_0x4ad246)[_0x886f('0x14')](_0x2dfda3);}return null;};}function saveUpdates(_0x2f7b4c){return function(_0x363ec1){if(_0x363ec1){return _0x363ec1[_0x886f('0x1b')](_0x2f7b4c)[_0x886f('0x1c')](function(_0x50003b){return _0x50003b;});}return null;};}function removeEntity(_0x2836d4){return function(_0x528570){if(_0x528570){return _0x528570[_0x886f('0x1d')]()[_0x886f('0x1c')](function(){_0x2836d4[_0x886f('0x13')](0xcc)[_0x886f('0x12')]();});}};}function handleEntityNotFound(_0x412a34){return function(_0x54a684){if(!_0x54a684){_0x412a34['sendStatus'](0x194);}return _0x54a684;};}function handleError(_0x23b99b,_0x1ab079){_0x1ab079=_0x1ab079||0x1f4;return function(_0x1f41d9){logger[_0x886f('0x1e')](_0x1f41d9[_0x886f('0x1f')]);if(_0x1f41d9['name']){delete _0x1f41d9[_0x886f('0x20')];}_0x23b99b[_0x886f('0x13')](_0x1ab079)[_0x886f('0x21')](_0x1f41d9);};}exports[_0x886f('0x22')]=function(_0x2a90f4,_0x55b0cf){var _0xf6d94d={};var _0x3a69e7=_[_0x886f('0x23')](db[_0x886f('0x24')][_0x886f('0x25')],function(_0xedd352){return{'name':_0xedd352['fieldName'],'type':_0xedd352['type']['key']};});_0xf6d94d=qs[_0x886f('0x26')](_0x3a69e7,_0x2a90f4);return interaction['findAll']('whatsapp',_0x2a90f4[_0x886f('0x27')],_0x2a90f4[_0x886f('0x28')],_0xf6d94d,_0x3a69e7)['then'](respondWithFilteredResult(_0x55b0cf,_0xf6d94d))[_0x886f('0x29')](handleError(_0x55b0cf,null));};exports[_0x886f('0x2a')]=function(_0x3dba25,_0x6eee0c){var _0x146eac={'raw':![],'where':{'id':_0x3dba25[_0x886f('0x2b')]['id']}},_0x49fbe1={};_0x49fbe1[_0x886f('0x2c')]=_[_0x886f('0x2d')](db['WhatsappInteraction'][_0x886f('0x25')]);_0x49fbe1[_0x886f('0x27')]=_['keys'](_0x3dba25[_0x886f('0x27')]);_0x49fbe1[_0x886f('0x2e')]=_[_0x886f('0x2f')](_0x49fbe1[_0x886f('0x2c')],_0x49fbe1[_0x886f('0x27')]);_0x146eac['attributes']=_[_0x886f('0x2f')](_0x49fbe1['model'],qs[_0x886f('0x30')](_0x3dba25[_0x886f('0x27')][_0x886f('0x30')]));_0x146eac[_0x886f('0x31')]=_0x146eac['attributes'][_0x886f('0x32')]?_0x146eac[_0x886f('0x31')]:_0x49fbe1[_0x886f('0x2c')];if(_0x3dba25[_0x886f('0x27')][_0x886f('0x33')]){_0x146eac[_0x886f('0x34')]=[{'all':!![]}];}_0x146eac=_[_0x886f('0x35')]({},_0x146eac,_0x3dba25['options']);return db['WhatsappInteraction']['find'](_0x146eac)[_0x886f('0x1c')](handleEntityNotFound(_0x6eee0c,null))['then'](respondWithResult(_0x6eee0c,null))[_0x886f('0x29')](handleError(_0x6eee0c,null));};exports[_0x886f('0x36')]=function(_0x3d7986,_0x495ebc){return db['WhatsappInteraction'][_0x886f('0x36')](_0x3d7986[_0x886f('0x37')],{})[_0x886f('0x1c')](respondWithResult(_0x495ebc,0xc9))['catch'](handleError(_0x495ebc,null));};exports[_0x886f('0x1b')]=function(_0x5dfd09,_0x19ef5c){if(_0x5dfd09[_0x886f('0x37')]['id']){delete _0x5dfd09[_0x886f('0x37')]['id'];}return db['WhatsappInteraction'][_0x886f('0x38')]({'where':{'id':_0x5dfd09['params']['id']}})[_0x886f('0x1c')](handleEntityNotFound(_0x19ef5c,null))[_0x886f('0x1c')](saveUpdates(_0x5dfd09[_0x886f('0x37')],null))['then'](respondWithResult(_0x19ef5c,null))[_0x886f('0x29')](handleError(_0x19ef5c,null));};exports[_0x886f('0x1d')]=function(_0x2068c,_0x301310){return db[_0x886f('0x24')][_0x886f('0x38')]({'where':{'id':_0x2068c['params']['id']}})['then'](handleEntityNotFound(_0x301310,null))[_0x886f('0x1c')](removeEntity(_0x301310,null))[_0x886f('0x29')](handleError(_0x301310,null));};exports[_0x886f('0x39')]=function(_0x421841,_0x1cc6f9){return db[_0x886f('0x24')]['describe']()[_0x886f('0x1c')](respondWithResult(_0x1cc6f9,null))[_0x886f('0x29')](handleError(_0x1cc6f9,null));};exports['addMessage']=function(_0x53917f,_0x3b79cf){return db[_0x886f('0x3a')]['find']({'where':{'id':_0x53917f[_0x886f('0x2b')]['id']}})[_0x886f('0x1c')](handleEntityNotFound(_0x3b79cf,null))[_0x886f('0x1c')](function(_0x3f1716){if(_0x3f1716){return _0x3f1716['addMessage'](_0x53917f['body']['ids'],_[_0x886f('0x3b')](_0x53917f[_0x886f('0x37')],[_0x886f('0x3c'),'id'])||{});}})[_0x886f('0x1c')](respondWithResult(_0x3b79cf,null))[_0x886f('0x29')](handleError(_0x3b79cf,null));};exports[_0x886f('0x3d')]=function(_0x14e3a6,_0x4357ea){var _0x355d90={'raw':![],'where':{}};var _0x26d329={};var _0x36fbaa={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x886f('0x3e')]({'where':{'id':_0x14e3a6[_0x886f('0x2b')]['id']}})[_0x886f('0x1c')](handleEntityNotFound(_0x4357ea,null))[_0x886f('0x1c')](function(_0x3d41bd){if(_0x3d41bd){_0x26d329[_0x886f('0x2c')]=_[_0x886f('0x2d')](db[_0x886f('0x3a')]['rawAttributes']);_0x26d329[_0x886f('0x27')]=_[_0x886f('0x2d')](_0x14e3a6[_0x886f('0x27')]);_0x26d329['filters']=_['intersection'](_0x26d329[_0x886f('0x2c')],_0x26d329['query']);_0x355d90[_0x886f('0x31')]=_['intersection'](_0x26d329[_0x886f('0x2c')],qs[_0x886f('0x30')](_0x14e3a6[_0x886f('0x27')][_0x886f('0x30')]));_0x355d90[_0x886f('0x31')]=_0x355d90[_0x886f('0x31')][_0x886f('0x32')]?_0x355d90[_0x886f('0x31')]:_0x26d329['model'];if(!_0x14e3a6[_0x886f('0x27')][_0x886f('0x3f')](_0x886f('0x40'))){_0x355d90[_0x886f('0x16')]=qs[_0x886f('0x16')](_0x14e3a6[_0x886f('0x27')][_0x886f('0x16')]);_0x355d90['offset']=qs[_0x886f('0x15')](_0x14e3a6[_0x886f('0x27')][_0x886f('0x15')]);}_0x355d90[_0x886f('0x41')]=qs['sort'](_0x14e3a6['query'][_0x886f('0x42')]);_0x355d90[_0x886f('0x43')]=qs[_0x886f('0x2e')](_[_0x886f('0x44')](_0x14e3a6[_0x886f('0x27')],_0x26d329['filters']));_0x355d90['where']['WhatsappInteractionId']=_0x3d41bd['id'];if(_0x14e3a6['query'][_0x886f('0x45')]){_0x355d90[_0x886f('0x43')]=_[_0x886f('0x35')](_0x355d90[_0x886f('0x43')],{'$or':_['map'](_0x355d90[_0x886f('0x31')],function(_0x4fc7ac){var _0x17da2d={};_0x17da2d[_0x4fc7ac]={'$like':'%'+_0x14e3a6[_0x886f('0x27')][_0x886f('0x45')]+'%'};return _0x17da2d;})});}if(_0x14e3a6[_0x886f('0x27')][_0x886f('0x46')]){var _0x5eec2d=_0x14e3a6[_0x886f('0x27')][_0x886f('0x46')][_0x886f('0x47')](',');var _0x51a190={};_0x51a190[_0x5eec2d[0x0]]={'$gte':moment(_0x5eec2d[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x355d90[_0x886f('0x43')]=_['merge'](_0x355d90[_0x886f('0x43')],_0x51a190);}_0x355d90=_['merge']({},_0x355d90,_0x14e3a6[_0x886f('0x48')]);return db[_0x886f('0x3a')][_0x886f('0x18')]({'where':_0x355d90[_0x886f('0x43')]})[_0x886f('0x1c')](function(_0x3b55a9){_0x36fbaa['count']=_0x3b55a9;if(_0x14e3a6[_0x886f('0x27')][_0x886f('0x33')]){_0x355d90[_0x886f('0x34')]=[{'all':!![]}];}return db[_0x886f('0x3a')][_0x886f('0x49')](_0x355d90);})[_0x886f('0x1c')](function(_0x241c4c){_0x36fbaa[_0x886f('0x4a')]=_0x241c4c;return _0x36fbaa;});}})['then'](respondWithFilteredResult(_0x4357ea,_0x355d90))[_0x886f('0x29')](handleError(_0x4357ea,null));};exports[_0x886f('0x4b')]=function(_0x30f5aa,_0x2d4a5e){return db['WhatsappInteraction'][_0x886f('0x38')]({'where':{'id':_0x30f5aa[_0x886f('0x2b')]['id']}})[_0x886f('0x1c')](handleEntityNotFound(_0x2d4a5e,null))[_0x886f('0x1c')](function(_0x2563bb){if(_0x2563bb){return _0x2563bb[_0x886f('0x4c')](_0x30f5aa[_0x886f('0x37')][_0x886f('0x3c')],_['omit'](_0x30f5aa[_0x886f('0x37')],['ids','id'])||{})['spread'](function(){return db[_0x886f('0x4d')][_0x886f('0x49')]({'attributes':['id',_0x886f('0x20'),_0x886f('0x4e')],'where':{'id':_0x30f5aa[_0x886f('0x37')][_0x886f('0x3c')]}});})[_0x886f('0x1c')](function(_0x4f611e){socket[_0x886f('0x4f')](_0x886f('0x50'),{'id':Number(_0x30f5aa[_0x886f('0x2b')]['id']),'tags':_0x4f611e||[]});return{'id':Number(_0x30f5aa[_0x886f('0x2b')]['id']),'tags':_0x4f611e||[]};});}})[_0x886f('0x1c')](respondWithResult(_0x2d4a5e,null))[_0x886f('0x29')](handleError(_0x2d4a5e,null));};exports[_0x886f('0x51')]=function(_0x29db94,_0x55b416){return db[_0x886f('0x24')][_0x886f('0x38')]({'where':{'id':_0x29db94[_0x886f('0x2b')]['id']}})[_0x886f('0x1c')](handleEntityNotFound(_0x55b416,null))['then'](function(_0x563947){if(_0x563947){return _0x563947[_0x886f('0x51')](_0x29db94[_0x886f('0x27')][_0x886f('0x3c')]);}})[_0x886f('0x1c')](respondWithStatusCode(_0x55b416,null))[_0x886f('0x29')](handleError(_0x55b416,null));};exports[_0x886f('0x52')]=function(_0x2f22aa,_0xc07b76){var _0x1e9471=moment()['unix']()[_0x886f('0x53')]();var _0x26cf7a=path[_0x886f('0x54')](config[_0x886f('0x55')],_0x886f('0x56'),'files',_0x886f('0x57'));var _0x20b322=path['join'](config['root'],_0x886f('0x56'),_0x886f('0x58'),'attachments');var _0x34142a=path['join'](_0x26cf7a,_0x1e9471);var _0x52cab8=util[_0x886f('0x59')]('transcript-%d-%s.zip',_0x2f22aa[_0x886f('0x2b')]['id'],_0x1e9471);var _0x4fdf72=path[_0x886f('0x54')](_0x26cf7a,_0x52cab8);var _0x44ee94=[];_0x44ee94[_0x886f('0x5a')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x44ee94[_0x886f('0x5a')]({'model':db[_0x886f('0x5b')],'as':_0x886f('0x5c'),'attributes':['id',_0x886f('0x5d'),_0x886f('0x5e')],'raw':!![]});if(_0x2f22aa[_0x886f('0x27')][_0x886f('0x5f')]){_0x44ee94[_0x886f('0x5a')]({'model':db[_0x886f('0x60')],'as':_0x886f('0x60'),'raw':!![]});}var _0x13e50a=[{'model':db[_0x886f('0x3a')],'as':_0x886f('0x61'),'attributes':['id',_0x886f('0x37'),_0x886f('0x62'),'direction',_0x886f('0x63'),_0x886f('0x64')],'include':_0x44ee94}];_0x13e50a[_0x886f('0x5a')]({'model':db['WhatsappAccount'],'as':_0x886f('0x65'),'attributes':['id',_0x886f('0x20')]});_0x13e50a[_0x886f('0x5a')]({'model':db['User'],'as':_0x886f('0x66'),'attributes':['id',_0x886f('0x67')]});return db['WhatsappInteraction'][_0x886f('0x38')]({'where':{'id':_0x2f22aa[_0x886f('0x2b')]['id']},'include':_0x13e50a})[_0x886f('0x1c')](handleEntityNotFound(_0xc07b76,null))[_0x886f('0x1c')](function(_0x3589c7){if(_0x3589c7){var _0x22be2f=_0x3589c7[_0x886f('0x68')]({'plain':!![]});fs[_0x886f('0x69')](_0x34142a);var _0x12ff40={'channel':'Whatsapp','account':_0x22be2f[_0x886f('0x65')][_0x886f('0x20')],'agent':_0x22be2f[_0x886f('0x66')]?_0x22be2f[_0x886f('0x66')][_0x886f('0x67')]:_0x886f('0x6a'),'createdAt':moment(_0x22be2f['createdAt'])[_0x886f('0x59')](_0x886f('0x6b'))['toString'](),'closedAt':_0x22be2f[_0x886f('0x6c')]?moment(_0x22be2f['closedAt'])[_0x886f('0x59')](_0x886f('0x6b'))['toString']():'','disposition':_0x22be2f[_0x886f('0x6d')],'messages':_(_0x22be2f[_0x886f('0x61')])['filter']({'secret':![]})['map'](function(_0x44c312){if(_0x44c312[_0x886f('0x60')]){var _0x2a79e7=path[_0x886f('0x54')](_0x20b322,_0x44c312['Attachment']['basename']);if(fs['existsSync'](_0x2a79e7)){fs[_0x886f('0x6e')](_0x2a79e7)['pipe'](fs[_0x886f('0x6f')](path['join'](_0x34142a,_0x44c312[_0x886f('0x60')][_0x886f('0x70')])));}}return{'date':moment(_0x44c312[_0x886f('0x62')])['format'](_0x886f('0x6b'))[_0x886f('0x53')](),'sender':_0x44c312[_0x886f('0x71')]===_0x886f('0x72')?_0x44c312[_0x886f('0x73')]?_0x44c312[_0x886f('0x73')][_0x886f('0x67')]:_0x886f('0x74'):_0x44c312[_0x886f('0x5c')][_0x886f('0x5d')]+(_0x44c312['Contact'][_0x886f('0x5e')]?'\x20'+_0x44c312[_0x886f('0x5c')]['lastName']:''),'body':_0x44c312[_0x886f('0x60')]?_0x44c312[_0x886f('0x60')]['basename']:_0x44c312[_0x886f('0x37')],'direction':_0x44c312['direction']===_0x886f('0x72')?'A':'C','secret':_0x44c312[_0x886f('0x63')],'read':_0x44c312[_0x886f('0x64')],'attachment':_0x44c312[_0x886f('0x60')]};})[_0x886f('0x75')]()};return ejs[_0x886f('0x76')](path[_0x886f('0x54')](config[_0x886f('0x55')],_0x886f('0x56'),_0x886f('0x77'),_0x886f('0x78')),{'interaction':_0x12ff40})['then'](function(_0x3e3353){var _0x346057=path[_0x886f('0x54')](_0x34142a,_0x886f('0x79')+_0x22be2f['id']+'-'+_0x1e9471+_0x886f('0x7a'));var _0xdb8a69={'path':_0x346057,'channel':_0x886f('0x7b'),'interactionId':_0x22be2f['id']};return pdf['createPdfFromHTML'](_0x3e3353,_0xdb8a69);})[_0x886f('0x1c')](function(){return new BPromise(function(_0x98651d,_0x121904){zipdir(_0x34142a,{'saveTo':_0x4fdf72},function(_0x3dfa59,_0x47eb54){if(_0x3dfa59)return _0x121904(_0x3dfa59);return _0x98651d(_0x47eb54);});})[_0x886f('0x1c')](function(){return new BPromise(function(_0x4032f6,_0x3babb2){rimraf(_0x34142a,function(_0x551d63){if(_0x551d63)_0x3babb2(_0x551d63);return _0x4032f6();});});})[_0x886f('0x1c')](function(){return _0xc07b76[_0x886f('0x52')](_0x4fdf72,_0x52cab8,function(_0x38fbff){if(_0x38fbff){console[_0x886f('0x7c')]('err',_0x38fbff);}else{fs[_0x886f('0x7d')](_0x4fdf72);}});});});}else{return _0xc07b76[_0x886f('0x11')](0xc8);}})['catch'](handleError(_0xc07b76,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index e11bcf7..a9ac814 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 _0x105b=['setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x537f86,_0x36c4b7){var _0x211d95=function(_0x337199){while(--_0x337199){_0x537f86['push'](_0x537f86['shift']());}};_0x211d95(++_0x36c4b7);}(_0x105b,0x1a7));var _0xb105=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x105b[_0x42245d];return _0x4b211a;};'use strict';var EventEmitter=require(_0xb105('0x0'));var WhatsappInteraction=require(_0xb105('0x1'))['db'][_0xb105('0x2')];var WhatsappMessage=require(_0xb105('0x1'))['db'][_0xb105('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb105('0x4')](0x0);var events={'afterCreate':_0xb105('0x5'),'afterUpdate':'update','afterDestroy':_0xb105('0x6')};function emitEvent(_0xd09bee){return function(_0x1c12d6,_0x49802f,_0x33602c){_0x1c12d6[_0xb105('0x7')]({'attributes':['id'],'raw':!![]})[_0xb105('0x8')](function(_0x285b2a){_0x1c12d6[_0xb105('0x9')](_0xb105('0xa'),_0x285b2a[_0xb105('0xb')](function(_0x534364){return{'id':_0x534364['id']};}));return WhatsappMessage[_0xb105('0xc')]({'where':{'WhatsappInteractionId':_0x1c12d6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb105('0x8')](function(_0x5b6689){_0x1c12d6[_0xb105('0x9')](_0xb105('0xd'),_0x5b6689[_0xb105('0xe')]);WhatsappInteractionEvents[_0xb105('0xf')](_0xd09bee+':'+_0x1c12d6['id'],_0x1c12d6);WhatsappInteractionEvents[_0xb105('0xf')](_0xd09bee,_0x1c12d6);_0x33602c(null);})['catch'](_0x33602c(null));};}for(var e in events){if(events[_0xb105('0x10')](e)){var event=events[e];WhatsappInteraction[_0xb105('0x11')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xc737=['events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x58e8eb,_0x2ac0c7){var _0x168540=function(_0x47ad20){while(--_0x47ad20){_0x58e8eb['push'](_0x58e8eb['shift']());}};_0x168540(++_0x2ac0c7);}(_0xc737,0x154));var _0x7c73=function(_0x5aae05,_0x128e99){_0x5aae05=_0x5aae05-0x0;var _0x5a2dfd=_0xc737[_0x5aae05];return _0x5a2dfd;};'use strict';var EventEmitter=require(_0x7c73('0x0'));var WhatsappInteraction=require(_0x7c73('0x1'))['db'][_0x7c73('0x2')];var WhatsappMessage=require(_0x7c73('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7c73('0x3')](0x0);var events={'afterCreate':_0x7c73('0x4'),'afterUpdate':_0x7c73('0x5'),'afterDestroy':'remove'};function emitEvent(_0x36583e){return function(_0xe6e9b8,_0x58d01c,_0x5ad227){_0xe6e9b8[_0x7c73('0x6')]({'attributes':['id'],'raw':!![]})[_0x7c73('0x7')](function(_0x57e442){_0xe6e9b8[_0x7c73('0x8')](_0x7c73('0x9'),_0x57e442['map'](function(_0x4f73d8){return{'id':_0x4f73d8['id']};}));return WhatsappMessage[_0x7c73('0xa')]({'where':{'WhatsappInteractionId':_0xe6e9b8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c73('0x7')](function(_0x378c59){_0xe6e9b8['setDataValue'](_0x7c73('0xb'),_0x378c59[_0x7c73('0xc')]);WhatsappInteractionEvents['emit'](_0x36583e+':'+_0xe6e9b8['id'],_0xe6e9b8);WhatsappInteractionEvents[_0x7c73('0xd')](_0x36583e,_0xe6e9b8);_0x5ad227(null);})['catch'](_0x5ad227(null));};}for(var e in events){if(events[_0x7c73('0xe')](e)){var event=events[e];WhatsappInteraction[_0x7c73('0xf')](e,emitEvent(event));}}module[_0x7c73('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 5ed11cc..8eb9fe2 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 _0x29d2=['rimraf','./whatsappInteraction.attributes','exports','define','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1ae0fd,_0x3f0a13){var _0x4ed24b=function(_0x3527d5){while(--_0x3527d5){_0x1ae0fd['push'](_0x1ae0fd['shift']());}};_0x4ed24b(++_0x3f0a13);}(_0x29d2,0x67));var _0x229d=function(_0x4d1828,_0x103c6b){_0x4d1828=_0x4d1828-0x0;var _0x32a374=_0x29d2[_0x4d1828];return _0x32a374;};'use strict';var _=require(_0x229d('0x0'));var util=require('util');var logger=require(_0x229d('0x1'))('api');var moment=require(_0x229d('0x2'));var BPromise=require(_0x229d('0x3'));var rp=require(_0x229d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x229d('0x5'));var config=require('../../config/environment');var attributes=require(_0x229d('0x6'));module[_0x229d('0x7')]=function(_0x33f443,_0x24d4e7){return _0x33f443[_0x229d('0x8')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54affc,_0x11dcdb,_0x2df508){if(_0x54affc['changed'](_0x229d('0x9'))){_0x54affc['closedAt']=moment()[_0x229d('0xa')](_0x229d('0xb'));}_0x2df508(null,_0x54affc);}}});}; \ No newline at end of file +var _0xeff5=['path','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xdf25b2,_0xcb05d0){var _0x226517=function(_0x7a41d5){while(--_0x7a41d5){_0xdf25b2['push'](_0xdf25b2['shift']());}};_0x226517(++_0xcb05d0);}(_0xeff5,0x182));var _0x5eff=function(_0x1d721d,_0x3e29e1){_0x1d721d=_0x1d721d-0x0;var _0x3859fe=_0xeff5[_0x1d721d];return _0x3859fe;};'use strict';var _=require(_0x5eff('0x0'));var util=require(_0x5eff('0x1'));var logger=require(_0x5eff('0x2'))(_0x5eff('0x3'));var moment=require(_0x5eff('0x4'));var BPromise=require(_0x5eff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5eff('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5eff('0x7'));module[_0x5eff('0x8')]=function(_0xad75ca,_0x5c523d){return _0xad75ca[_0x5eff('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x5eff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11038e,_0xbcb023,_0x51ab63){if(_0x11038e['changed'](_0x5eff('0xb'))){_0x11038e[_0x5eff('0xc')]=moment()[_0x5eff('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x51ab63(null,_0x11038e);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 78d5227..1f9196d 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 _0xb1a8=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','omit','ids','AddTags','lodash','util','bluebird','randomstring','ioredis'];(function(_0x25b680,_0x3cb041){var _0x44bad8=function(_0x41efc3){while(--_0x41efc3){_0x25b680['push'](_0x25b680['shift']());}};_0x44bad8(++_0x3cb041);}(_0xb1a8,0x113));var _0x8b1a=function(_0x3d2831,_0x3e2ab7){_0x3d2831=_0x3d2831-0x0;var _0x437ab7=_0xb1a8[_0x3d2831];return _0x437ab7;};'use strict';var _=require(_0x8b1a('0x0'));var util=require(_0x8b1a('0x1'));var moment=require('moment');var BPromise=require(_0x8b1a('0x2'));var rs=require(_0x8b1a('0x3'));var fs=require('fs');var Redis=require(_0x8b1a('0x4'));var db=require(_0x8b1a('0x5'))['db'];var utils=require(_0x8b1a('0x6'));var logger=require(_0x8b1a('0x7'))('rpc');var config=require(_0x8b1a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b1a('0x9')][_0x8b1a('0xa')]({'port':0x232a});config[_0x8b1a('0xb')]=_['defaults'](config['redis'],{'host':_0x8b1a('0xc'),'port':0x18eb});var socket=require(_0x8b1a('0xd'))(new Redis(config[_0x8b1a('0xb')]));require(_0x8b1a('0xe'))['register'](socket);function respondWithRpcPromise(_0x2974d1,_0x13f902,_0x560ef4){return new BPromise(function(_0x46c834,_0x50981b){return client[_0x8b1a('0xf')](_0x2974d1,_0x560ef4)[_0x8b1a('0x10')](function(_0x2bf341){logger[_0x8b1a('0x11')](_0x8b1a('0x12'),_0x13f902,_0x8b1a('0x13'));logger[_0x8b1a('0x14')](_0x8b1a('0x15'),_0x13f902,'request\x20sent',JSON[_0x8b1a('0x16')](_0x2bf341));if(_0x2bf341[_0x8b1a('0x17')]){if(_0x2bf341[_0x8b1a('0x17')][_0x8b1a('0x18')]===0x1f4){logger['error'](_0x8b1a('0x12'),_0x13f902,_0x2bf341['error'][_0x8b1a('0x19')]);return _0x50981b(_0x2bf341[_0x8b1a('0x17')][_0x8b1a('0x19')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x13f902,_0x2bf341[_0x8b1a('0x17')][_0x8b1a('0x19')]);return _0x46c834(_0x2bf341[_0x8b1a('0x17')][_0x8b1a('0x19')]);}else{logger[_0x8b1a('0x11')](_0x8b1a('0x12'),_0x13f902,_0x8b1a('0x13'));_0x46c834(_0x2bf341['result'][_0x8b1a('0x19')]);}})[_0x8b1a('0x1a')](function(_0x62b42a){logger[_0x8b1a('0x17')](_0x8b1a('0x12'),_0x13f902,_0x62b42a);_0x50981b(_0x62b42a);});});}exports[_0x8b1a('0x1b')]=function(_0x138f78){var _0x3a62d6=this;return new Promise(function(_0x21a83c,_0x7a2bbb){return db[_0x8b1a('0x1c')]['update'](_0x138f78[_0x8b1a('0x1d')],{'raw':_0x138f78[_0x8b1a('0x1e')]?_0x138f78[_0x8b1a('0x1e')][_0x8b1a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x138f78[_0x8b1a('0x1e')]?_0x138f78[_0x8b1a('0x1e')][_0x8b1a('0x20')]||null:null,'attributes':_0x138f78[_0x8b1a('0x1e')]?_0x138f78[_0x8b1a('0x1e')][_0x8b1a('0x21')]||null:null,'limit':_0x138f78[_0x8b1a('0x1e')]?_0x138f78[_0x8b1a('0x1e')][_0x8b1a('0x22')]||null:null})[_0x8b1a('0x10')](function(_0x217125){logger['info'](_0x8b1a('0x1b'),_0x138f78);logger[_0x8b1a('0x14')](_0x8b1a('0x1b'),_0x138f78,JSON[_0x8b1a('0x16')](_0x217125));_0x21a83c(_0x217125);})[_0x8b1a('0x1a')](function(_0xf6c904){logger[_0x8b1a('0x17')](_0x8b1a('0x1b'),_0xf6c904[_0x8b1a('0x19')],_0x138f78);_0x7a2bbb(_0x3a62d6[_0x8b1a('0x17')](0x1f4,_0xf6c904[_0x8b1a('0x19')]));});});};exports[_0x8b1a('0x23')]=function(_0x5e28ef){return new Promise(function(_0x1c56a6,_0x23d541){return db[_0x8b1a('0x1c')][_0x8b1a('0x24')]({'where':_0x5e28ef[_0x8b1a('0x1e')]?_0x5e28ef[_0x8b1a('0x1e')]['where']||null:null})['then'](function(_0x365382){if(_0x365382){return _0x365382['addTags'](_0x5e28ef[_0x8b1a('0x1d')]['ids'],_[_0x8b1a('0x25')](_0x5e28ef['body'],[_0x8b1a('0x26'),'id'])||{});}})['spread'](function(_0x53c0e0){logger[_0x8b1a('0x11')](_0x8b1a('0x27'),_0x5e28ef);logger['debug']('AddTags',_0x5e28ef,JSON[_0x8b1a('0x16')](_0x53c0e0));_0x1c56a6(_0x53c0e0);})['catch'](function(_0x1fdd21){logger[_0x8b1a('0x17')](_0x8b1a('0x27'),_0x1fdd21[_0x8b1a('0x19')],_0x5e28ef);_0x23d541(_this[_0x8b1a('0x17')](0x1f4,_0x1fdd21[_0x8b1a('0x19')]));});});}; \ No newline at end of file +var _0x0e95=['raw','attributes','limit','then','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','AddTags','debug','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','body','options'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x0e95,0x116));var _0x50e9=function(_0x27f002,_0x5a0715){_0x27f002=_0x27f002-0x0;var _0x511094=_0x0e95[_0x27f002];return _0x511094;};'use strict';var _=require('lodash');var util=require(_0x50e9('0x0'));var moment=require('moment');var BPromise=require(_0x50e9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x50e9('0x2'));var logger=require(_0x50e9('0x3'))('rpc');var config=require(_0x50e9('0x4'));var jayson=require(_0x50e9('0x5'));var client=jayson[_0x50e9('0x6')][_0x50e9('0x7')]({'port':0x232a});config[_0x50e9('0x8')]=_[_0x50e9('0x9')](config[_0x50e9('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x50e9('0xa'))(new Redis(config[_0x50e9('0x8')]));require(_0x50e9('0xb'))[_0x50e9('0xc')](socket);function respondWithRpcPromise(_0x5c8fc1,_0x4fdc5,_0x38e647){return new BPromise(function(_0x3701ec,_0x5799bd){return client[_0x50e9('0xd')](_0x5c8fc1,_0x38e647)['then'](function(_0x2d415f){logger[_0x50e9('0xe')](_0x50e9('0xf'),_0x4fdc5,'request\x20sent');logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4fdc5,_0x50e9('0x10'),JSON[_0x50e9('0x11')](_0x2d415f));if(_0x2d415f[_0x50e9('0x12')]){if(_0x2d415f['error'][_0x50e9('0x13')]===0x1f4){logger['error'](_0x50e9('0xf'),_0x4fdc5,_0x2d415f['error'][_0x50e9('0x14')]);return _0x5799bd(_0x2d415f[_0x50e9('0x12')][_0x50e9('0x14')]);}logger[_0x50e9('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x4fdc5,_0x2d415f[_0x50e9('0x12')][_0x50e9('0x14')]);return _0x3701ec(_0x2d415f['error'][_0x50e9('0x14')]);}else{logger[_0x50e9('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0x4fdc5,_0x50e9('0x10'));_0x3701ec(_0x2d415f[_0x50e9('0x15')]['message']);}})[_0x50e9('0x16')](function(_0x3b28ab){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x4fdc5,_0x3b28ab);_0x5799bd(_0x3b28ab);});});}exports[_0x50e9('0x17')]=function(_0x1638a5){var _0x3865be=this;return new Promise(function(_0x1fa107,_0x27f751){return db['WhatsappInteraction']['update'](_0x1638a5[_0x50e9('0x18')],{'raw':_0x1638a5[_0x50e9('0x19')]?_0x1638a5[_0x50e9('0x19')][_0x50e9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1638a5[_0x50e9('0x19')]?_0x1638a5[_0x50e9('0x19')]['where']||null:null,'attributes':_0x1638a5[_0x50e9('0x19')]?_0x1638a5[_0x50e9('0x19')][_0x50e9('0x1b')]||null:null,'limit':_0x1638a5[_0x50e9('0x19')]?_0x1638a5[_0x50e9('0x19')][_0x50e9('0x1c')]||null:null})[_0x50e9('0x1d')](function(_0x347546){logger[_0x50e9('0xe')](_0x50e9('0x17'),_0x1638a5);logger['debug'](_0x50e9('0x17'),_0x1638a5,JSON['stringify'](_0x347546));_0x1fa107(_0x347546);})['catch'](function(_0x45b1eb){logger['error']('UpdateWhatsappInteraction',_0x45b1eb[_0x50e9('0x14')],_0x1638a5);_0x27f751(_0x3865be[_0x50e9('0x12')](0x1f4,_0x45b1eb[_0x50e9('0x14')]));});});};exports[_0x50e9('0x1e')]=function(_0x2c869a){return new Promise(function(_0x52bac6,_0x415af6){return db[_0x50e9('0x1f')][_0x50e9('0x20')]({'where':_0x2c869a[_0x50e9('0x19')]?_0x2c869a[_0x50e9('0x19')]['where']||null:null})[_0x50e9('0x1d')](function(_0x511deb){if(_0x511deb){return _0x511deb[_0x50e9('0x21')](_0x2c869a[_0x50e9('0x18')][_0x50e9('0x22')],_[_0x50e9('0x23')](_0x2c869a['body'],[_0x50e9('0x22'),'id'])||{});}})['spread'](function(_0x402597){logger['info'](_0x50e9('0x24'),_0x2c869a);logger[_0x50e9('0x25')](_0x50e9('0x24'),_0x2c869a,JSON[_0x50e9('0x11')](_0x402597));_0x52bac6(_0x402597);})[_0x50e9('0x16')](function(_0x2e3f0e){logger['error'](_0x50e9('0x24'),_0x2e3f0e[_0x50e9('0x14')],_0x2c869a);_0x415af6(_this[_0x50e9('0x12')](0x1f4,_0x2e3f0e[_0x50e9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 84cdec6..0c1073e 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 _0xd48f=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','removeListener','register'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xd48f,0xfd));var _0xfd48=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xd48f[_0x1762b4];return _0x29beda;};'use strict';var WhatsappInteractionEvents=require(_0xfd48('0x0'));var events=[_0xfd48('0x1'),_0xfd48('0x2'),_0xfd48('0x3')];function createListener(_0x191ce3,_0x25a90f){return function(_0x5c9ae3){_0x25a90f['emit'](_0x191ce3,_0x5c9ae3);};}function removeListener(_0x2b2359,_0x24869e){return function(){WhatsappInteractionEvents[_0xfd48('0x4')](_0x2b2359,_0x24869e);};}exports[_0xfd48('0x5')]=function(_0x1f69af){for(var _0x5cbbf0=0x0,_0x382e97=events['length'];_0x5cbbf0<_0x382e97;_0x5cbbf0++){var _0xa009c8=events[_0x5cbbf0];var _0x4ff3b2=createListener(_0xfd48('0x6')+_0xa009c8,_0x1f69af);WhatsappInteractionEvents['on'](_0xa009c8,_0x4ff3b2);}}; \ No newline at end of file +var _0x654b=['update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x361bd6,_0x3c03ee){var _0x56956f=function(_0xe37e03){while(--_0xe37e03){_0x361bd6['push'](_0x361bd6['shift']());}};_0x56956f(++_0x3c03ee);}(_0x654b,0xcc));var _0xb654=function(_0x236906,_0x1c2803){_0x236906=_0x236906-0x0;var _0x21199e=_0x654b[_0x236906];return _0x21199e;};'use strict';var WhatsappInteractionEvents=require(_0xb654('0x0'));var events=[_0xb654('0x1'),_0xb654('0x2'),_0xb654('0x3')];function createListener(_0x6395c5,_0x5acfa4){return function(_0x1075de){_0x5acfa4[_0xb654('0x4')](_0x6395c5,_0x1075de);};}function removeListener(_0x437536,_0x568cde){return function(){WhatsappInteractionEvents[_0xb654('0x5')](_0x437536,_0x568cde);};}exports[_0xb654('0x6')]=function(_0x2c912e){for(var _0x25da29=0x0,_0x1212c0=events[_0xb654('0x7')];_0x25da29<_0x1212c0;_0x25da29++){var _0x295ecc=events[_0x25da29];var _0x1fe245=createListener(_0xb654('0x8')+_0x295ecc,_0x2c912e);WhatsappInteractionEvents['on'](_0x295ecc,_0x1fe245);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index cf8a9fa..62582a5 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 _0xf60c=['post','create','/:id/status','status','update','/:id/accept','accept','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x12ac18,_0xa3b2ef){var _0x27f718=function(_0x145326){while(--_0x145326){_0x12ac18['push'](_0x12ac18['shift']());}};_0x27f718(++_0xa3b2ef);}(_0xf60c,0x185));var _0xcf60=function(_0x2ec04a,_0x41a645){_0x2ec04a=_0x2ec04a-0x0;var _0x23741f=_0xf60c[_0x2ec04a];return _0x23741f;};'use strict';var multer=require(_0xcf60('0x0'));var util=require(_0xcf60('0x1'));var path=require(_0xcf60('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf60('0x3'));var router=express[_0xcf60('0x4')]();var fs_extra=require(_0xcf60('0x5'));var auth=require(_0xcf60('0x6'));var interaction=require(_0xcf60('0x7'));var config=require(_0xcf60('0x8'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xcf60('0x9')](),controller[_0xcf60('0xa')]);router[_0xcf60('0xb')](_0xcf60('0xc'),auth[_0xcf60('0x9')](),controller[_0xcf60('0xd')]);router[_0xcf60('0xb')](_0xcf60('0xe'),auth[_0xcf60('0x9')](),controller[_0xcf60('0xf')]);router[_0xcf60('0x10')]('/',auth[_0xcf60('0x9')](),interaction['tracked']('whatsapp','whatsappmessage:create'),controller[_0xcf60('0x11')]);router['post'](_0xcf60('0x12'),controller[_0xcf60('0x13')]);router['put'](_0xcf60('0xe'),auth[_0xcf60('0x9')](),controller[_0xcf60('0x14')]);router['put'](_0xcf60('0x15'),auth[_0xcf60('0x9')](),controller[_0xcf60('0x16')]);router[_0xcf60('0x17')]('/:id/reject',auth[_0xcf60('0x9')](),controller['reject']);router[_0xcf60('0x18')](_0xcf60('0xe'),auth[_0xcf60('0x9')](),controller[_0xcf60('0x19')]);module[_0xcf60('0x1a')]=router; \ No newline at end of file +var _0xaafc=['reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject'];(function(_0xcc376e,_0x427228){var _0x39fb84=function(_0xebc24){while(--_0xebc24){_0xcc376e['push'](_0xcc376e['shift']());}};_0x39fb84(++_0x427228);}(_0xaafc,0x143));var _0xcaaf=function(_0x4b6a12,_0x48aca0){_0x4b6a12=_0x4b6a12-0x0;var _0x4e1847=_0xaafc[_0x4b6a12];return _0x4e1847;};'use strict';var multer=require('multer');var util=require(_0xcaaf('0x0'));var path=require(_0xcaaf('0x1'));var timeout=require(_0xcaaf('0x2'));var express=require(_0xcaaf('0x3'));var router=express[_0xcaaf('0x4')]();var fs_extra=require(_0xcaaf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcaaf('0x6'));var config=require(_0xcaaf('0x7'));var controller=require(_0xcaaf('0x8'));router[_0xcaaf('0x9')]('/',auth[_0xcaaf('0xa')](),controller[_0xcaaf('0xb')]);router[_0xcaaf('0x9')](_0xcaaf('0xc'),auth[_0xcaaf('0xa')](),controller['describe']);router[_0xcaaf('0x9')](_0xcaaf('0xd'),auth[_0xcaaf('0xa')](),controller[_0xcaaf('0xe')]);router[_0xcaaf('0xf')]('/',auth['isAuthenticated'](),interaction[_0xcaaf('0x10')]('whatsapp',_0xcaaf('0x11')),controller['create']);router[_0xcaaf('0xf')](_0xcaaf('0x12'),controller[_0xcaaf('0x13')]);router[_0xcaaf('0x14')]('/:id',auth[_0xcaaf('0xa')](),controller[_0xcaaf('0x15')]);router['put'](_0xcaaf('0x16'),auth[_0xcaaf('0xa')](),controller[_0xcaaf('0x17')]);router[_0xcaaf('0x14')](_0xcaaf('0x18'),auth[_0xcaaf('0xa')](),controller[_0xcaaf('0x19')]);router[_0xcaaf('0x1a')](_0xcaaf('0xd'),auth[_0xcaaf('0xa')](),controller[_0xcaaf('0x1b')]);module[_0xcaaf('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index ee5fd74..04ff4e6 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 _0xf45b=['TEXT','medium','out','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0xf45b,0x13e));var _0xbf45=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0xf45b[_0x28407a];return _0x8bd6ef;};'use strict';var Sequelize=require(_0xbf45('0x0'));module[_0xbf45('0x1')]={'body':{'type':Sequelize[_0xbf45('0x2')](_0xbf45('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xbf45('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbf45('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xbf45('0x6')]},'secret':{'type':Sequelize[_0xbf45('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbf45('0x2')]}}; \ No newline at end of file +var _0x5e3c=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x5aed32,_0x2a5832){var _0x4d897f=function(_0x4486cc){while(--_0x4486cc){_0x5aed32['push'](_0x5aed32['shift']());}};_0x4d897f(++_0x2a5832);}(_0x5e3c,0x16b));var _0xc5e3=function(_0x58baf9,_0x175ba5){_0x58baf9=_0x58baf9-0x0;var _0x5f4471=_0x5e3c[_0x58baf9];return _0x5f4471;};'use strict';var Sequelize=require(_0xc5e3('0x0'));module[_0xc5e3('0x1')]={'body':{'type':Sequelize[_0xc5e3('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc5e3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc5e3('0x4')]('in','out'),'defaultValue':_0xc5e3('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc5e3('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc5e3('0x6')]},'readAt':{'type':Sequelize[_0xc5e3('0x7')]},'secret':{'type':Sequelize[_0xc5e3('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc5e3('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 8eeab8b..c06bedf 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 _0xec64=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','WhatsappMessage','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','create','body','find','describe','../../config/logger','whatsapp-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','reject','whatsapp','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','motionChannel','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec64,0x18a));var _0x4ec6=function(_0x5712f8,_0x17156b){_0x5712f8=_0x5712f8-0x0;var _0x14a364=_0xec64[_0x5712f8];return _0x14a364;};'use strict';var emlformat=require(_0x4ec6('0x0'));var rimraf=require(_0x4ec6('0x1'));var zipdir=require(_0x4ec6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ec6('0x3'));var moment=require(_0x4ec6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4ec6('0x5'));var util=require(_0x4ec6('0x6'));var path=require(_0x4ec6('0x7'));var sox=require(_0x4ec6('0x8'));var csv=require(_0x4ec6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ec6('0xa'));var squel=require(_0x4ec6('0xb'));var crypto=require(_0x4ec6('0xc'));var jsforce=require(_0x4ec6('0xd'));var deskjs=require(_0x4ec6('0xe'));var toCsv=require(_0x4ec6('0x9'));var querystring=require(_0x4ec6('0xf'));var Papa=require(_0x4ec6('0x10'));var Redis=require(_0x4ec6('0x11'));var authService=require(_0x4ec6('0x12'));var qs=require(_0x4ec6('0x13'));var as=require(_0x4ec6('0x14'));var hardwareService=require(_0x4ec6('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4ec6('0x16'));var config=require(_0x4ec6('0x17'));var licenseUtil=require(_0x4ec6('0x18'));var db=require(_0x4ec6('0x19'))['db'];config[_0x4ec6('0x1a')]=_[_0x4ec6('0x1b')](config[_0x4ec6('0x1a')],{'host':_0x4ec6('0x1c'),'port':0x18eb});var socket=require(_0x4ec6('0x1d'))(new Redis(config['redis']));require(_0x4ec6('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4ec6('0x1f')][_0x4ec6('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xd1d421,_0x456279,_0x1922d4,_0x5074d9){return new BPromise(function(_0x27dee4,_0x2e907f){var _0xdd5e6d=_0x5074d9||client;return _0xdd5e6d[_0x4ec6('0x21')](_0xd1d421,_0x1922d4)[_0x4ec6('0x22')](function(_0xc0c5d0){logger[_0x4ec6('0x23')](_0x4ec6('0x24'),_0x456279,_0x4ec6('0x25'));logger[_0x4ec6('0x26')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x456279,_0x4ec6('0x25'),JSON[_0x4ec6('0x27')](_0xc0c5d0));if(_0xc0c5d0[_0x4ec6('0x28')]){if(_0xc0c5d0['error'][_0x4ec6('0x29')]===0x1f4){logger[_0x4ec6('0x28')](_0x4ec6('0x24'),_0x456279,_0xc0c5d0['error']['message']);return _0x2e907f(_0xc0c5d0['error'][_0x4ec6('0x2a')]);}logger[_0x4ec6('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x456279,_0xc0c5d0[_0x4ec6('0x28')][_0x4ec6('0x2a')]);return _0x27dee4(_0xc0c5d0[_0x4ec6('0x28')][_0x4ec6('0x2a')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x456279,_0x4ec6('0x25'));_0x27dee4(_0xc0c5d0[_0x4ec6('0x2b')][_0x4ec6('0x2a')]);}})[_0x4ec6('0x2c')](function(_0x4b4caa){logger['error'](_0x4ec6('0x24'),_0x456279,_0x4b4caa);_0x2e907f(_0x4b4caa);});});}function respondWithStatusCode(_0x2f705f,_0x5c6a44){_0x5c6a44=_0x5c6a44||0xcc;return function(_0x6a169e){if(_0x6a169e){return _0x2f705f['sendStatus'](_0x5c6a44);}return _0x2f705f[_0x4ec6('0x2d')](_0x5c6a44)[_0x4ec6('0x2e')]();};}function respondWithResult(_0x292213,_0x2a3452){_0x2a3452=_0x2a3452||0xc8;return function(_0x464668){if(_0x464668){return _0x292213[_0x4ec6('0x2d')](_0x2a3452)[_0x4ec6('0x2f')](_0x464668);}};}function respondWithFilteredResult(_0x135b97,_0x3519d9){return function(_0x11217f){if(_0x11217f){var _0x1ac006=typeof _0x3519d9[_0x4ec6('0x30')]==='undefined'&&typeof _0x3519d9[_0x4ec6('0x31')]===_0x4ec6('0x32');var _0x41f9bb=_0x11217f[_0x4ec6('0x33')];var _0xdf7341=_0x1ac006?0x0:_0x3519d9[_0x4ec6('0x30')];var _0x1f751b=_0x1ac006?_0x11217f[_0x4ec6('0x33')]:_0x3519d9[_0x4ec6('0x30')]+_0x3519d9[_0x4ec6('0x31')];var _0x5557b1;if(_0x1f751b>=_0x41f9bb){_0x1f751b=_0x41f9bb;_0x5557b1=0xc8;}else{_0x5557b1=0xce;}_0x135b97[_0x4ec6('0x2d')](_0x5557b1);return _0x135b97[_0x4ec6('0x34')](_0x4ec6('0x35'),_0xdf7341+'-'+_0x1f751b+'/'+_0x41f9bb)[_0x4ec6('0x2f')](_0x11217f);}return null;};}function patchUpdates(_0x5c4938){return function(_0x484b2a){try{jsonpatch[_0x4ec6('0x36')](_0x484b2a,_0x5c4938,!![]);}catch(_0x1029be){return BPromise['reject'](_0x1029be);}return _0x484b2a[_0x4ec6('0x37')]();};}function saveUpdates(_0x18107b,_0x2409d1){return function(_0x4320b6){if(_0x4320b6){return _0x4320b6[_0x4ec6('0x38')](_0x18107b)[_0x4ec6('0x22')](function(_0x4eb0aa){return _0x4eb0aa;});}return null;};}function removeEntity(_0x36ba44,_0x5c1cc9){return function(_0x324028){if(_0x324028){return _0x324028[_0x4ec6('0x39')]()['then'](function(){_0x36ba44[_0x4ec6('0x2d')](0xcc)[_0x4ec6('0x2e')]();});}};}function handleEntityNotFound(_0x2228a8,_0x4ba75a){return function(_0x221123){if(!_0x221123){_0x2228a8['sendStatus'](0x194);}return _0x221123;};}function handleError(_0x21f3cf,_0x2d4492){_0x2d4492=_0x2d4492||0x1f4;return function(_0x12c5c3){logger['error'](_0x12c5c3['stack']);if(_0x12c5c3['name']){delete _0x12c5c3['name'];}_0x21f3cf[_0x4ec6('0x2d')](_0x2d4492)['send'](_0x12c5c3);};}exports['index']=function(_0x375604,_0x34c810){var _0x46a5eb={},_0x17e02e={},_0x445171={'count':0x0,'rows':[]};var _0xc73346=_['map'](db[_0x4ec6('0x3a')]['rawAttributes'],function(_0x543514){return{'name':_0x543514[_0x4ec6('0x3b')],'type':_0x543514[_0x4ec6('0x3c')][_0x4ec6('0x3d')]};});_0x17e02e['model']=_['map'](_0xc73346,_0x4ec6('0x3e'));_0x17e02e[_0x4ec6('0x3f')]=_[_0x4ec6('0x40')](_0x375604['query']);_0x17e02e[_0x4ec6('0x41')]=_[_0x4ec6('0x42')](_0x17e02e[_0x4ec6('0x43')],_0x17e02e[_0x4ec6('0x3f')]);_0x46a5eb['attributes']=_[_0x4ec6('0x42')](_0x17e02e[_0x4ec6('0x43')],qs[_0x4ec6('0x44')](_0x375604[_0x4ec6('0x3f')][_0x4ec6('0x44')]));_0x46a5eb[_0x4ec6('0x45')]=_0x46a5eb[_0x4ec6('0x45')][_0x4ec6('0x46')]?_0x46a5eb[_0x4ec6('0x45')]:_0x17e02e[_0x4ec6('0x43')];if(!_0x375604['query']['hasOwnProperty'](_0x4ec6('0x47'))){_0x46a5eb[_0x4ec6('0x31')]=qs[_0x4ec6('0x31')](_0x375604[_0x4ec6('0x3f')][_0x4ec6('0x31')]);_0x46a5eb[_0x4ec6('0x30')]=qs[_0x4ec6('0x30')](_0x375604[_0x4ec6('0x3f')][_0x4ec6('0x30')]);}_0x46a5eb[_0x4ec6('0x48')]=qs['sort'](_0x375604[_0x4ec6('0x3f')][_0x4ec6('0x49')]);_0x46a5eb[_0x4ec6('0x4a')]=qs[_0x4ec6('0x41')](_[_0x4ec6('0x4b')](_0x375604[_0x4ec6('0x3f')],_0x17e02e['filters']),_0xc73346);if(_0x375604[_0x4ec6('0x3f')][_0x4ec6('0x4c')]){_0x46a5eb[_0x4ec6('0x4a')]=_['merge'](_0x46a5eb['where'],{'$or':_[_0x4ec6('0x4d')](_0xc73346,function(_0x489415){if(_0x489415[_0x4ec6('0x3c')]!==_0x4ec6('0x4e')){var _0x372ba4={};_0x372ba4[_0x489415['name']]={'$like':'%'+_0x375604[_0x4ec6('0x3f')][_0x4ec6('0x4c')]+'%'};return _0x372ba4;}})});}_0x46a5eb=_[_0x4ec6('0x4f')]({},_0x46a5eb,_0x375604[_0x4ec6('0x50')]);var _0x3130d6={'where':_0x46a5eb[_0x4ec6('0x4a')]};return db[_0x4ec6('0x3a')][_0x4ec6('0x33')](_0x3130d6)['then'](function(_0x56e243){_0x445171[_0x4ec6('0x33')]=_0x56e243;if(_0x375604[_0x4ec6('0x3f')]['includeAll']){_0x46a5eb[_0x4ec6('0x51')]=[{'all':!![]}];}return db[_0x4ec6('0x3a')][_0x4ec6('0x52')](_0x46a5eb);})[_0x4ec6('0x22')](function(_0x421c5e){_0x445171[_0x4ec6('0x53')]=_0x421c5e;return _0x445171;})[_0x4ec6('0x22')](respondWithFilteredResult(_0x34c810,_0x46a5eb))[_0x4ec6('0x2c')](handleError(_0x34c810,null));};exports[_0x4ec6('0x54')]=function(_0x404ff2,_0x3996ce){var _0x5398ed={'raw':!![],'where':{'id':_0x404ff2[_0x4ec6('0x55')]['id']}},_0x1a4fbb={};_0x1a4fbb[_0x4ec6('0x43')]=_[_0x4ec6('0x40')](db['WhatsappMessage']['rawAttributes']);_0x1a4fbb[_0x4ec6('0x3f')]=_[_0x4ec6('0x40')](_0x404ff2[_0x4ec6('0x3f')]);_0x1a4fbb[_0x4ec6('0x41')]=_['intersection'](_0x1a4fbb[_0x4ec6('0x43')],_0x1a4fbb[_0x4ec6('0x3f')]);_0x5398ed[_0x4ec6('0x45')]=_['intersection'](_0x1a4fbb[_0x4ec6('0x43')],qs[_0x4ec6('0x44')](_0x404ff2[_0x4ec6('0x3f')]['fields']));_0x5398ed[_0x4ec6('0x45')]=_0x5398ed[_0x4ec6('0x45')]['length']?_0x5398ed[_0x4ec6('0x45')]:_0x1a4fbb['model'];if(_0x404ff2[_0x4ec6('0x3f')][_0x4ec6('0x56')]){_0x5398ed[_0x4ec6('0x51')]=[{'all':!![]}];}_0x5398ed=_['merge']({},_0x5398ed,_0x404ff2[_0x4ec6('0x50')]);return db[_0x4ec6('0x3a')]['find'](_0x5398ed)[_0x4ec6('0x22')](handleEntityNotFound(_0x3996ce,null))[_0x4ec6('0x22')](respondWithResult(_0x3996ce,null))[_0x4ec6('0x2c')](handleError(_0x3996ce,null));};exports[_0x4ec6('0x57')]=function(_0x1cf57b,_0x39d502){return db['WhatsappMessage'][_0x4ec6('0x57')](_0x1cf57b['body'],{})[_0x4ec6('0x22')](respondWithResult(_0x39d502,0xc9))[_0x4ec6('0x2c')](handleError(_0x39d502,null));};exports[_0x4ec6('0x38')]=function(_0x2a7874,_0x367ed9){if(_0x2a7874[_0x4ec6('0x58')]['id']){delete _0x2a7874['body']['id'];}return db[_0x4ec6('0x3a')]['find']({'where':{'id':_0x2a7874[_0x4ec6('0x55')]['id']}})[_0x4ec6('0x22')](handleEntityNotFound(_0x367ed9,null))[_0x4ec6('0x22')](saveUpdates(_0x2a7874[_0x4ec6('0x58')],null))['then'](respondWithResult(_0x367ed9,null))['catch'](handleError(_0x367ed9,null));};exports[_0x4ec6('0x39')]=function(_0x142925,_0x44aa35){return db['WhatsappMessage'][_0x4ec6('0x59')]({'where':{'id':_0x142925[_0x4ec6('0x55')]['id']}})[_0x4ec6('0x22')](handleEntityNotFound(_0x44aa35,null))['then'](removeEntity(_0x44aa35,null))[_0x4ec6('0x2c')](handleError(_0x44aa35,null));};exports[_0x4ec6('0x5a')]=function(_0x5b39d1,_0x46eb46){return db[_0x4ec6('0x3a')][_0x4ec6('0x5a')]()[_0x4ec6('0x22')](respondWithResult(_0x46eb46,null))['catch'](handleError(_0x46eb46,null));};var interaction_log=require(_0x4ec6('0x5b'))(_0x4ec6('0x5c'));exports[_0x4ec6('0x5d')]=function(_0x28b90d,_0x450389,_0x3c63e5){var _0x370685={'agent':{},'channel':'whatsapp'};if(_0x28b90d[_0x4ec6('0x58')]['id']){delete _0x28b90d[_0x4ec6('0x58')]['id'];}_0x28b90d[_0x4ec6('0x58')][_0x4ec6('0x5e')]=!![];_0x28b90d['body']['readAt']=moment()[_0x4ec6('0x5f')](_0x4ec6('0x60'));_0x28b90d[_0x4ec6('0x58')][_0x4ec6('0x61')]=_0x28b90d[_0x4ec6('0x58')][_0x4ec6('0x61')]||_0x28b90d[_0x4ec6('0x62')]['id'];_0x370685['agent']['id']=_0x28b90d[_0x4ec6('0x58')][_0x4ec6('0x61')];return db[_0x4ec6('0x3a')][_0x4ec6('0x59')]({'where':{'id':_0x28b90d['params']['id'],'UserId':null}})[_0x4ec6('0x22')](handleEntityNotFound(_0x450389,null))[_0x4ec6('0x22')](saveUpdates(_0x28b90d[_0x4ec6('0x58')],null))[_0x4ec6('0x22')](function(_0x31c48c){if(_0x31c48c){_0x370685[_0x4ec6('0x2a')]=_0x31c48c['get']({'plain':!![]});return db[_0x4ec6('0x63')][_0x4ec6('0x59')]({'where':{'id':_0x31c48c[_0x4ec6('0x64')]}});}return null;})[_0x4ec6('0x22')](handleEntityNotFound(_0x450389,null))[_0x4ec6('0x22')](function(_0x45fbcb){if(_0x45fbcb){return _0x45fbcb[_0x4ec6('0x38')]({'UserId':_0x28b90d['body'][_0x4ec6('0x61')],'read1stAt':_[_0x4ec6('0x65')](_0x45fbcb[_0x4ec6('0x66')])?moment()[_0x4ec6('0x5f')](_0x4ec6('0x60')):undefined});}return null;})[_0x4ec6('0x22')](function(_0x2603ac){if(_0x2603ac){_0x370685[_0x4ec6('0x67')]=_0x2603ac[_0x4ec6('0x68')]({'plain':!![]});interaction_log[_0x4ec6('0x23')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x28b90d[_0x4ec6('0x62')]['id'],_0x28b90d[_0x4ec6('0x62')][_0x4ec6('0x3e')],_0x28b90d[_0x4ec6('0x62')]['role'],_0x370685[_0x4ec6('0x67')]['id'],_0x28b90d[_0x4ec6('0x58')]?JSON[_0x4ec6('0x27')](_0x28b90d[_0x4ec6('0x58')]):_0x4ec6('0x69'));return respondWithRpcPromise(_0x4ec6('0x6a'),_0x4ec6('0x6b'),_0x370685);}return null;})[_0x4ec6('0x22')](function(_0x48c303){var _0x548ef5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x48c303[_0x4ec6('0x2a')]['ContactId'];return db[_0x4ec6('0x6c')][_0x4ec6('0x3f')](_0x548ef5,{'type':db['Sequelize'][_0x4ec6('0x6d')][_0x4ec6('0x6e')],'raw':!![]})['then'](function(_0x28989f){return _0x28989f;});})[_0x4ec6('0x22')](function(_0x16239f){if(_0x16239f){_0x370685[_0x4ec6('0x2a')]['contact']=_0x16239f[0x0];if(!_0x28b90d[_0x4ec6('0x58')][_0x4ec6('0x61')])return;return db[_0x4ec6('0x6f')][_0x4ec6('0x59')]({'where':{'id':_0x28b90d[_0x4ec6('0x58')][_0x4ec6('0x61')],'role':_0x4ec6('0x70')},'attributes':['id',_0x4ec6('0x3e'),_0x4ec6('0x71'),_0x4ec6('0x72'),_0x4ec6('0x73')],'raw':!![]});}return null;})[_0x4ec6('0x22')](function(_0x7d6b2c){if(!_0x7d6b2c)return null;_0x370685[_0x4ec6('0x2a')][_0x4ec6('0x70')]=_0x7d6b2c;return _0x370685;})['then'](function(_0x52cf56){if(_0x52cf56){if(_0x28b90d[_0x4ec6('0x58')][_0x4ec6('0x74')]){_0x370685['message'][_0x4ec6('0x75')]=util[_0x4ec6('0x5f')](_0x4ec6('0x76'),_0x28b90d[_0x4ec6('0x62')][_0x4ec6('0x3e')]);_0x370685['message'][_0x4ec6('0x77')]=_0x370685[_0x4ec6('0x77')];_0x370685['message']['motionChannel']=_0x370685[_0x4ec6('0x77')];_0x370685['message'][_0x4ec6('0x78')]=_0x4ec6('0x5d');return respondWithRpcPromise(_0x4ec6('0x79'),_0x4ec6('0x79'),{'event':'acceptmessage','message':_0x370685[_0x4ec6('0x2a')]},client9002)[_0x4ec6('0x22')](function(){return _0x370685;});}return _0x370685;}return null;})[_0x4ec6('0x22')](respondWithResult(_0x450389,null))['catch'](handleError(_0x450389,null));};var interaction_log=require(_0x4ec6('0x5b'))(_0x4ec6('0x5c'));exports[_0x4ec6('0x7a')]=function(_0x2cdfb8,_0x1635b9,_0x4a2bf8){var _0x4546ef={'agent':{},'channel':_0x4ec6('0x7b')};if(_0x2cdfb8[_0x4ec6('0x58')]['id']){delete _0x2cdfb8[_0x4ec6('0x58')]['id'];}_0x2cdfb8[_0x4ec6('0x58')][_0x4ec6('0x61')]=_0x2cdfb8[_0x4ec6('0x58')][_0x4ec6('0x61')]||_0x2cdfb8['user']['id'];_0x4546ef[_0x4ec6('0x70')]['id']=_0x2cdfb8['body'][_0x4ec6('0x61')];return db[_0x4ec6('0x3a')][_0x4ec6('0x59')]({'where':{'id':_0x2cdfb8['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1635b9,null))[_0x4ec6('0x22')](function(_0x1086cf){if(_0x1086cf){_0x4546ef[_0x4ec6('0x2a')]=_0x1086cf[_0x4ec6('0x68')]({'plain':!![]});return db[_0x4ec6('0x63')][_0x4ec6('0x59')]({'where':{'id':_0x1086cf[_0x4ec6('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x1635b9,null))['then'](function(_0x4e6a18){if(_0x4e6a18){_0x4546ef['interaction']=_0x4e6a18[_0x4ec6('0x68')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2cdfb8['user']['id'],_0x2cdfb8[_0x4ec6('0x62')][_0x4ec6('0x3e')],_0x2cdfb8[_0x4ec6('0x62')]['role'],_0x4546ef[_0x4ec6('0x67')]['id'],_0x2cdfb8[_0x4ec6('0x58')]?JSON[_0x4ec6('0x27')](_0x2cdfb8[_0x4ec6('0x58')]):_0x4ec6('0x69'));return respondWithRpcPromise(_0x4ec6('0x7c'),'rejectMessage',_0x4546ef);}return null;})[_0x4ec6('0x22')](function(_0x58e3ba){var _0x4f28bd=_0x4ec6('0x7d')+_0x58e3ba[_0x4ec6('0x2a')][_0x4ec6('0x7e')];return db[_0x4ec6('0x6c')][_0x4ec6('0x3f')](_0x4f28bd,{'type':db[_0x4ec6('0x7f')][_0x4ec6('0x6d')][_0x4ec6('0x6e')],'raw':!![]})[_0x4ec6('0x22')](function(_0x1be62a){return _0x1be62a;});})['then'](function(_0xe422b9){if(_0xe422b9){_0x4546ef[_0x4ec6('0x2a')]['contact']=_0xe422b9[0x0];if(!_0x2cdfb8[_0x4ec6('0x58')][_0x4ec6('0x61')])return;return db['User'][_0x4ec6('0x59')]({'where':{'id':_0x2cdfb8[_0x4ec6('0x58')][_0x4ec6('0x61')],'role':_0x4ec6('0x70')},'attributes':['id','name',_0x4ec6('0x71'),_0x4ec6('0x72'),_0x4ec6('0x73')],'raw':!![]});}return null;})['then'](function(_0x311fc5){if(!_0x311fc5)return null;_0x4546ef['message']['agent']=_0x311fc5;return _0x4546ef;})[_0x4ec6('0x22')](function(_0x2eb724){if(_0x2eb724){_0x2eb724[_0x4ec6('0x2a')][_0x4ec6('0x75')]=util['format'](_0x4ec6('0x76'),_0x2cdfb8['user']['name']);_0x2eb724['message']['channel']=_0x4546ef[_0x4ec6('0x77')];_0x2eb724[_0x4ec6('0x2a')][_0x4ec6('0x80')]=_0x4546ef[_0x4ec6('0x77')];_0x2eb724['message']['event']=_0x4ec6('0x7a');respondWithRpcPromise(_0x4ec6('0x79'),_0x4ec6('0x79'),{'event':_0x4ec6('0x81'),'message':_0x2eb724[_0x4ec6('0x2a')]},client9002);return _0x4546ef;}return null;})[_0x4ec6('0x22')](respondWithResult(_0x1635b9,null))[_0x4ec6('0x2c')](handleError(_0x1635b9,null));};exports['status']=function(_0x5e52e9,_0x572ea0,_0x166c14){if(_0x5e52e9['body']['id']){delete _0x5e52e9[_0x4ec6('0x58')]['id'];}var _0x38795c;return db['WhatsappMessage'][_0x4ec6('0x59')]({'where':{'id':_0x5e52e9[_0x4ec6('0x55')]['id']}})[_0x4ec6('0x22')](handleEntityNotFound(_0x572ea0,null))[_0x4ec6('0x22')](function(_0x3aeb63){if(_0x3aeb63){_0x38795c=_0x3aeb63;return db['WhatsappAccount']['find']({'where':{'id':_0x3aeb63[_0x4ec6('0x82')]}});}})[_0x4ec6('0x22')](handleEntityNotFound(_0x572ea0,null))['then'](function(_0x57d8d9){if(_0x57d8d9){logger['debug'](_0x4ec6('0x83'),'status',_0x4ec6('0x84'),_0x57d8d9[_0x4ec6('0x3c')],util[_0x4ec6('0x85')](_0x5e52e9[_0x4ec6('0x58')],{'showHidden':![],'depth':null}));switch(_0x57d8d9[_0x4ec6('0x3c')]){case _0x4ec6('0x86'):if(_0x5e52e9[_0x4ec6('0x58')][_0x4ec6('0x87')]&&_0x5e52e9[_0x4ec6('0x58')]['MessageSid']===_0x38795c[_0x4ec6('0x88')]&&_0x5e52e9[_0x4ec6('0x58')]['MessageStatus']&&_0x5e52e9[_0x4ec6('0x58')][_0x4ec6('0x89')]===_0x4ec6('0x5e')){return _0x38795c[_0x4ec6('0x38')]({'read':!![]});}else{logger[_0x4ec6('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x4ec6('0x86'),util['inspect'](_0x5e52e9['body'],{'showHidden':![],'depth':null}));}break;}return _0x38795c;}})[_0x4ec6('0x22')](respondWithResult(_0x572ea0,null))['catch'](handleError(_0x572ea0,null));}; \ No newline at end of file +var _0x6486=['undefined','limit','count','set','Content-Range','save','update','destroy','index','WhatsappMessage','rawAttributes','fieldName','key','map','name','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','create','body','find','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','null','RejectMessage','rejectMessage','ContactId','sequelize','WhatsappAccount','debug','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset'];(function(_0x5d76cc,_0x195736){var _0x4acce4=function(_0x3b889d){while(--_0x3b889d){_0x5d76cc['push'](_0x5d76cc['shift']());}};_0x4acce4(++_0x195736);}(_0x6486,0x1e8));var _0x6648=function(_0x5e4cc1,_0x5af8ab){_0x5e4cc1=_0x5e4cc1-0x0;var _0x5f4c56=_0x6486[_0x5e4cc1];return _0x5f4c56;};'use strict';var emlformat=require(_0x6648('0x0'));var rimraf=require(_0x6648('0x1'));var zipdir=require(_0x6648('0x2'));var jsonpatch=require(_0x6648('0x3'));var rp=require(_0x6648('0x4'));var moment=require(_0x6648('0x5'));var BPromise=require(_0x6648('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6648('0x7'));var csv=require(_0x6648('0x8'));var ejs=require(_0x6648('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6648('0xa'));var squel=require('squel');var crypto=require(_0x6648('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6648('0xc'));var toCsv=require(_0x6648('0x8'));var querystring=require(_0x6648('0xd'));var Papa=require(_0x6648('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6648('0xf'));var as=require(_0x6648('0x10'));var hardwareService=require(_0x6648('0x11'));var logger=require(_0x6648('0x12'))(_0x6648('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6648('0x14'));var db=require(_0x6648('0x15'))['db'];config['redis']=_['defaults'](config[_0x6648('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x6648('0x17'))(new Redis(config[_0x6648('0x16')]));require(_0x6648('0x18'))[_0x6648('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6648('0x1a')][_0x6648('0x1b')]({'port':0x232c});var client9002=jayson[_0x6648('0x1a')][_0x6648('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x263088,_0x49aca8,_0x331145,_0x407814){return new BPromise(function(_0x5a29b8,_0x17221c){var _0xba6528=_0x407814||client;return _0xba6528[_0x6648('0x1c')](_0x263088,_0x331145)[_0x6648('0x1d')](function(_0x5ee248){logger[_0x6648('0x1e')](_0x6648('0x1f'),_0x49aca8,_0x6648('0x20'));logger['debug'](_0x6648('0x21'),_0x49aca8,_0x6648('0x20'),JSON[_0x6648('0x22')](_0x5ee248));if(_0x5ee248[_0x6648('0x23')]){if(_0x5ee248['error']['code']===0x1f4){logger[_0x6648('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x49aca8,_0x5ee248[_0x6648('0x23')][_0x6648('0x24')]);return _0x17221c(_0x5ee248[_0x6648('0x23')]['message']);}logger[_0x6648('0x23')](_0x6648('0x1f'),_0x49aca8,_0x5ee248['error'][_0x6648('0x24')]);return _0x5a29b8(_0x5ee248[_0x6648('0x23')][_0x6648('0x24')]);}else{logger[_0x6648('0x1e')](_0x6648('0x1f'),_0x49aca8,_0x6648('0x20'));_0x5a29b8(_0x5ee248[_0x6648('0x25')][_0x6648('0x24')]);}})[_0x6648('0x26')](function(_0x3b02b7){logger[_0x6648('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x49aca8,_0x3b02b7);_0x17221c(_0x3b02b7);});});}function respondWithStatusCode(_0x50036e,_0x474b0d){_0x474b0d=_0x474b0d||0xcc;return function(_0x127b82){if(_0x127b82){return _0x50036e[_0x6648('0x27')](_0x474b0d);}return _0x50036e[_0x6648('0x28')](_0x474b0d)[_0x6648('0x29')]();};}function respondWithResult(_0x31115a,_0xacd8d0){_0xacd8d0=_0xacd8d0||0xc8;return function(_0x4639ac){if(_0x4639ac){return _0x31115a[_0x6648('0x28')](_0xacd8d0)[_0x6648('0x2a')](_0x4639ac);}};}function respondWithFilteredResult(_0x47219d,_0x410d13){return function(_0x459ac9){if(_0x459ac9){var _0x180740=typeof _0x410d13[_0x6648('0x2b')]===_0x6648('0x2c')&&typeof _0x410d13[_0x6648('0x2d')]===_0x6648('0x2c');var _0x301d95=_0x459ac9[_0x6648('0x2e')];var _0x52c47d=_0x180740?0x0:_0x410d13[_0x6648('0x2b')];var _0x719f04=_0x180740?_0x459ac9[_0x6648('0x2e')]:_0x410d13[_0x6648('0x2b')]+_0x410d13[_0x6648('0x2d')];var _0x1596fb;if(_0x719f04>=_0x301d95){_0x719f04=_0x301d95;_0x1596fb=0xc8;}else{_0x1596fb=0xce;}_0x47219d[_0x6648('0x28')](_0x1596fb);return _0x47219d[_0x6648('0x2f')](_0x6648('0x30'),_0x52c47d+'-'+_0x719f04+'/'+_0x301d95)[_0x6648('0x2a')](_0x459ac9);}return null;};}function patchUpdates(_0xd8d20a){return function(_0x2cc77e){try{jsonpatch['apply'](_0x2cc77e,_0xd8d20a,!![]);}catch(_0x4bcae1){return BPromise['reject'](_0x4bcae1);}return _0x2cc77e[_0x6648('0x31')]();};}function saveUpdates(_0x2474d4,_0x2aa184){return function(_0x497317){if(_0x497317){return _0x497317[_0x6648('0x32')](_0x2474d4)[_0x6648('0x1d')](function(_0x1646c6){return _0x1646c6;});}return null;};}function removeEntity(_0x30d9bd,_0xc7cad7){return function(_0x494a42){if(_0x494a42){return _0x494a42[_0x6648('0x33')]()[_0x6648('0x1d')](function(){_0x30d9bd[_0x6648('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2be905,_0x3ec7a2){return function(_0x1905c8){if(!_0x1905c8){_0x2be905[_0x6648('0x27')](0x194);}return _0x1905c8;};}function handleError(_0x12bebf,_0xbd8409){_0xbd8409=_0xbd8409||0x1f4;return function(_0x5cb9ad){logger[_0x6648('0x23')](_0x5cb9ad['stack']);if(_0x5cb9ad['name']){delete _0x5cb9ad['name'];}_0x12bebf[_0x6648('0x28')](_0xbd8409)['send'](_0x5cb9ad);};}exports[_0x6648('0x34')]=function(_0x22077c,_0x38262e){var _0x591eec={},_0x4b7f26={},_0x33c35a={'count':0x0,'rows':[]};var _0x8c7e3c=_['map'](db[_0x6648('0x35')][_0x6648('0x36')],function(_0x4a3550){return{'name':_0x4a3550[_0x6648('0x37')],'type':_0x4a3550['type'][_0x6648('0x38')]};});_0x4b7f26['model']=_[_0x6648('0x39')](_0x8c7e3c,_0x6648('0x3a'));_0x4b7f26['query']=_[_0x6648('0x3b')](_0x22077c[_0x6648('0x3c')]);_0x4b7f26['filters']=_[_0x6648('0x3d')](_0x4b7f26[_0x6648('0x3e')],_0x4b7f26['query']);_0x591eec['attributes']=_[_0x6648('0x3d')](_0x4b7f26[_0x6648('0x3e')],qs[_0x6648('0x3f')](_0x22077c[_0x6648('0x3c')][_0x6648('0x3f')]));_0x591eec[_0x6648('0x40')]=_0x591eec[_0x6648('0x40')]['length']?_0x591eec['attributes']:_0x4b7f26[_0x6648('0x3e')];if(!_0x22077c['query'][_0x6648('0x41')](_0x6648('0x42'))){_0x591eec[_0x6648('0x2d')]=qs[_0x6648('0x2d')](_0x22077c['query']['limit']);_0x591eec[_0x6648('0x2b')]=qs['offset'](_0x22077c[_0x6648('0x3c')][_0x6648('0x2b')]);}_0x591eec[_0x6648('0x43')]=qs['sort'](_0x22077c[_0x6648('0x3c')]['sort']);_0x591eec[_0x6648('0x44')]=qs['filters'](_[_0x6648('0x45')](_0x22077c['query'],_0x4b7f26[_0x6648('0x46')]),_0x8c7e3c);if(_0x22077c[_0x6648('0x3c')]['filter']){_0x591eec['where']=_[_0x6648('0x47')](_0x591eec[_0x6648('0x44')],{'$or':_[_0x6648('0x39')](_0x8c7e3c,function(_0x52cf7d){if(_0x52cf7d['type']!==_0x6648('0x48')){var _0x47976d={};_0x47976d[_0x52cf7d[_0x6648('0x3a')]]={'$like':'%'+_0x22077c[_0x6648('0x3c')][_0x6648('0x49')]+'%'};return _0x47976d;}})});}_0x591eec=_[_0x6648('0x47')]({},_0x591eec,_0x22077c[_0x6648('0x4a')]);var _0x8d940={'where':_0x591eec['where']};return db[_0x6648('0x35')]['count'](_0x8d940)[_0x6648('0x1d')](function(_0x153016){_0x33c35a[_0x6648('0x2e')]=_0x153016;if(_0x22077c[_0x6648('0x3c')][_0x6648('0x4b')]){_0x591eec[_0x6648('0x4c')]=[{'all':!![]}];}return db[_0x6648('0x35')][_0x6648('0x4d')](_0x591eec);})[_0x6648('0x1d')](function(_0x2b882e){_0x33c35a[_0x6648('0x4e')]=_0x2b882e;return _0x33c35a;})[_0x6648('0x1d')](respondWithFilteredResult(_0x38262e,_0x591eec))['catch'](handleError(_0x38262e,null));};exports['show']=function(_0x27108c,_0x372031){var _0x275e45={'raw':!![],'where':{'id':_0x27108c[_0x6648('0x4f')]['id']}},_0x5646b2={};_0x5646b2[_0x6648('0x3e')]=_[_0x6648('0x3b')](db[_0x6648('0x35')][_0x6648('0x36')]);_0x5646b2[_0x6648('0x3c')]=_['keys'](_0x27108c[_0x6648('0x3c')]);_0x5646b2[_0x6648('0x46')]=_[_0x6648('0x3d')](_0x5646b2[_0x6648('0x3e')],_0x5646b2['query']);_0x275e45[_0x6648('0x40')]=_['intersection'](_0x5646b2[_0x6648('0x3e')],qs[_0x6648('0x3f')](_0x27108c[_0x6648('0x3c')][_0x6648('0x3f')]));_0x275e45[_0x6648('0x40')]=_0x275e45['attributes'][_0x6648('0x50')]?_0x275e45[_0x6648('0x40')]:_0x5646b2[_0x6648('0x3e')];if(_0x27108c[_0x6648('0x3c')][_0x6648('0x4b')]){_0x275e45['include']=[{'all':!![]}];}_0x275e45=_[_0x6648('0x47')]({},_0x275e45,_0x27108c[_0x6648('0x4a')]);return db[_0x6648('0x35')]['find'](_0x275e45)[_0x6648('0x1d')](handleEntityNotFound(_0x372031,null))[_0x6648('0x1d')](respondWithResult(_0x372031,null))[_0x6648('0x26')](handleError(_0x372031,null));};exports[_0x6648('0x51')]=function(_0x25ba21,_0xcd6428){return db[_0x6648('0x35')][_0x6648('0x51')](_0x25ba21['body'],{})[_0x6648('0x1d')](respondWithResult(_0xcd6428,0xc9))[_0x6648('0x26')](handleError(_0xcd6428,null));};exports['update']=function(_0x124140,_0x1cc194){if(_0x124140[_0x6648('0x52')]['id']){delete _0x124140['body']['id'];}return db[_0x6648('0x35')][_0x6648('0x53')]({'where':{'id':_0x124140[_0x6648('0x4f')]['id']}})[_0x6648('0x1d')](handleEntityNotFound(_0x1cc194,null))[_0x6648('0x1d')](saveUpdates(_0x124140['body'],null))[_0x6648('0x1d')](respondWithResult(_0x1cc194,null))['catch'](handleError(_0x1cc194,null));};exports[_0x6648('0x33')]=function(_0x24ca35,_0x21efa5){return db['WhatsappMessage'][_0x6648('0x53')]({'where':{'id':_0x24ca35['params']['id']}})[_0x6648('0x1d')](handleEntityNotFound(_0x21efa5,null))[_0x6648('0x1d')](removeEntity(_0x21efa5,null))[_0x6648('0x26')](handleError(_0x21efa5,null));};exports[_0x6648('0x54')]=function(_0x18fa34,_0x5de24f){return db[_0x6648('0x35')]['describe']()['then'](respondWithResult(_0x5de24f,null))[_0x6648('0x26')](handleError(_0x5de24f,null));};var interaction_log=require(_0x6648('0x12'))(_0x6648('0x55'));exports[_0x6648('0x56')]=function(_0x7e959f,_0x51e526,_0x5b3a68){var _0x58527f={'agent':{},'channel':_0x6648('0x57')};if(_0x7e959f[_0x6648('0x52')]['id']){delete _0x7e959f[_0x6648('0x52')]['id'];}_0x7e959f[_0x6648('0x52')][_0x6648('0x58')]=!![];_0x7e959f[_0x6648('0x52')][_0x6648('0x59')]=moment()[_0x6648('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x7e959f[_0x6648('0x52')][_0x6648('0x5b')]=_0x7e959f['body'][_0x6648('0x5b')]||_0x7e959f['user']['id'];_0x58527f[_0x6648('0x5c')]['id']=_0x7e959f[_0x6648('0x52')][_0x6648('0x5b')];return db['WhatsappMessage'][_0x6648('0x53')]({'where':{'id':_0x7e959f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x51e526,null))['then'](saveUpdates(_0x7e959f['body'],null))[_0x6648('0x1d')](function(_0x146b63){if(_0x146b63){_0x58527f[_0x6648('0x24')]=_0x146b63[_0x6648('0x5d')]({'plain':!![]});return db[_0x6648('0x5e')][_0x6648('0x53')]({'where':{'id':_0x146b63[_0x6648('0x5f')]}});}return null;})[_0x6648('0x1d')](handleEntityNotFound(_0x51e526,null))[_0x6648('0x1d')](function(_0xbae3b2){if(_0xbae3b2){return _0xbae3b2[_0x6648('0x32')]({'UserId':_0x7e959f[_0x6648('0x52')][_0x6648('0x5b')],'read1stAt':_[_0x6648('0x60')](_0xbae3b2['read1stAt'])?moment()[_0x6648('0x5a')](_0x6648('0x61')):undefined});}return null;})[_0x6648('0x1d')](function(_0x4b1b02){if(_0x4b1b02){_0x58527f['interaction']=_0x4b1b02[_0x6648('0x5d')]({'plain':!![]});interaction_log[_0x6648('0x1e')](_0x6648('0x62'),_0x7e959f['user']['id'],_0x7e959f['user'][_0x6648('0x3a')],_0x7e959f[_0x6648('0x63')][_0x6648('0x64')],_0x58527f[_0x6648('0x65')]['id'],_0x7e959f[_0x6648('0x52')]?JSON[_0x6648('0x22')](_0x7e959f[_0x6648('0x52')]):'null');return respondWithRpcPromise(_0x6648('0x66'),_0x6648('0x67'),_0x58527f);}return null;})[_0x6648('0x1d')](function(_0x4e471c){var _0x5ec8ab='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e471c['message']['ContactId'];return db['sequelize'][_0x6648('0x3c')](_0x5ec8ab,{'type':db[_0x6648('0x68')][_0x6648('0x69')][_0x6648('0x6a')],'raw':!![]})['then'](function(_0x55ad74){return _0x55ad74;});})['then'](function(_0x32caba){if(_0x32caba){_0x58527f[_0x6648('0x24')]['contact']=_0x32caba[0x0];if(!_0x7e959f[_0x6648('0x52')][_0x6648('0x5b')])return;return db[_0x6648('0x6b')][_0x6648('0x53')]({'where':{'id':_0x7e959f['body']['UserId'],'role':_0x6648('0x5c')},'attributes':['id',_0x6648('0x3a'),_0x6648('0x6c'),_0x6648('0x6d'),_0x6648('0x6e')],'raw':!![]});}return null;})[_0x6648('0x1d')](function(_0x4d3524){if(!_0x4d3524)return null;_0x58527f[_0x6648('0x24')][_0x6648('0x5c')]=_0x4d3524;return _0x58527f;})[_0x6648('0x1d')](function(_0xa13d8a){if(_0xa13d8a){if(_0x7e959f[_0x6648('0x52')][_0x6648('0x6f')]){_0x58527f[_0x6648('0x24')][_0x6648('0x70')]=util['format'](_0x6648('0x71'),_0x7e959f[_0x6648('0x63')][_0x6648('0x3a')]);_0x58527f[_0x6648('0x24')][_0x6648('0x72')]=_0x58527f[_0x6648('0x72')];_0x58527f[_0x6648('0x24')][_0x6648('0x73')]=_0x58527f[_0x6648('0x72')];_0x58527f[_0x6648('0x24')][_0x6648('0x74')]=_0x6648('0x56');return respondWithRpcPromise(_0x6648('0x75'),'EventManager',{'event':_0x6648('0x76'),'message':_0x58527f[_0x6648('0x24')]},client9002)[_0x6648('0x1d')](function(){return _0x58527f;});}return _0x58527f;}return null;})[_0x6648('0x1d')](respondWithResult(_0x51e526,null))[_0x6648('0x26')](handleError(_0x51e526,null));};var interaction_log=require(_0x6648('0x12'))(_0x6648('0x55'));exports[_0x6648('0x77')]=function(_0x125e45,_0x3ee0c4,_0x53f2c2){var _0x53510b={'agent':{},'channel':_0x6648('0x57')};if(_0x125e45[_0x6648('0x52')]['id']){delete _0x125e45[_0x6648('0x52')]['id'];}_0x125e45[_0x6648('0x52')]['UserId']=_0x125e45[_0x6648('0x52')]['UserId']||_0x125e45[_0x6648('0x63')]['id'];_0x53510b[_0x6648('0x5c')]['id']=_0x125e45['body'][_0x6648('0x5b')];return db[_0x6648('0x35')]['find']({'where':{'id':_0x125e45[_0x6648('0x4f')]['id'],'UserId':null}})[_0x6648('0x1d')](handleEntityNotFound(_0x3ee0c4,null))[_0x6648('0x1d')](function(_0x8f05e9){if(_0x8f05e9){_0x53510b[_0x6648('0x24')]=_0x8f05e9[_0x6648('0x5d')]({'plain':!![]});return db['WhatsappInteraction'][_0x6648('0x53')]({'where':{'id':_0x8f05e9[_0x6648('0x5f')]}});}return null;})[_0x6648('0x1d')](handleEntityNotFound(_0x3ee0c4,null))['then'](function(_0x3cc6f3){if(_0x3cc6f3){_0x53510b[_0x6648('0x65')]=_0x3cc6f3[_0x6648('0x5d')]({'plain':!![]});interaction_log[_0x6648('0x1e')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x125e45[_0x6648('0x63')]['id'],_0x125e45[_0x6648('0x63')][_0x6648('0x3a')],_0x125e45[_0x6648('0x63')][_0x6648('0x64')],_0x53510b['interaction']['id'],_0x125e45[_0x6648('0x52')]?JSON[_0x6648('0x22')](_0x125e45[_0x6648('0x52')]):_0x6648('0x78'));return respondWithRpcPromise(_0x6648('0x79'),_0x6648('0x7a'),_0x53510b);}return null;})[_0x6648('0x1d')](function(_0x47a0dc){var _0x59dd85='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x47a0dc['message'][_0x6648('0x7b')];return db[_0x6648('0x7c')]['query'](_0x59dd85,{'type':db[_0x6648('0x68')][_0x6648('0x69')][_0x6648('0x6a')],'raw':!![]})[_0x6648('0x1d')](function(_0x9a5b8f){return _0x9a5b8f;});})[_0x6648('0x1d')](function(_0x5513c9){if(_0x5513c9){_0x53510b[_0x6648('0x24')]['contact']=_0x5513c9[0x0];if(!_0x125e45[_0x6648('0x52')][_0x6648('0x5b')])return;return db['User'][_0x6648('0x53')]({'where':{'id':_0x125e45[_0x6648('0x52')][_0x6648('0x5b')],'role':_0x6648('0x5c')},'attributes':['id',_0x6648('0x3a'),_0x6648('0x6c'),_0x6648('0x6d'),'internal'],'raw':!![]});}return null;})[_0x6648('0x1d')](function(_0x443e91){if(!_0x443e91)return null;_0x53510b[_0x6648('0x24')][_0x6648('0x5c')]=_0x443e91;return _0x53510b;})[_0x6648('0x1d')](function(_0x1c0bf5){if(_0x1c0bf5){_0x1c0bf5[_0x6648('0x24')][_0x6648('0x70')]=util['format'](_0x6648('0x71'),_0x125e45['user']['name']);_0x1c0bf5[_0x6648('0x24')][_0x6648('0x72')]=_0x53510b['channel'];_0x1c0bf5['message'][_0x6648('0x73')]=_0x53510b['channel'];_0x1c0bf5[_0x6648('0x24')][_0x6648('0x74')]=_0x6648('0x77');respondWithRpcPromise('EventManager',_0x6648('0x75'),{'event':'rejectmessage','message':_0x1c0bf5['message']},client9002);return _0x53510b;}return null;})[_0x6648('0x1d')](respondWithResult(_0x3ee0c4,null))[_0x6648('0x26')](handleError(_0x3ee0c4,null));};exports[_0x6648('0x28')]=function(_0x527a2e,_0x2deca2,_0x154c66){if(_0x527a2e[_0x6648('0x52')]['id']){delete _0x527a2e[_0x6648('0x52')]['id'];}var _0x3a763d;return db[_0x6648('0x35')]['find']({'where':{'id':_0x527a2e[_0x6648('0x4f')]['id']}})[_0x6648('0x1d')](handleEntityNotFound(_0x2deca2,null))[_0x6648('0x1d')](function(_0x51b85f){if(_0x51b85f){_0x3a763d=_0x51b85f;return db[_0x6648('0x7d')][_0x6648('0x53')]({'where':{'id':_0x51b85f['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x2deca2,null))['then'](function(_0x340b77){if(_0x340b77){logger[_0x6648('0x7e')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x6648('0x28'),'received\x20delivery\x20report\x20from',_0x340b77['type'],util[_0x6648('0x7f')](_0x527a2e['body'],{'showHidden':![],'depth':null}));switch(_0x340b77['type']){case _0x6648('0x80'):if(_0x527a2e[_0x6648('0x52')][_0x6648('0x81')]&&_0x527a2e[_0x6648('0x52')][_0x6648('0x81')]===_0x3a763d[_0x6648('0x82')]&&_0x527a2e[_0x6648('0x52')]['MessageStatus']&&_0x527a2e['body'][_0x6648('0x83')]===_0x6648('0x58')){return _0x3a763d[_0x6648('0x32')]({'read':!![]});}else{logger[_0x6648('0x23')](_0x6648('0x84'),'status',_0x6648('0x80'),util[_0x6648('0x7f')](_0x527a2e['body'],{'showHidden':![],'depth':null}));}break;}return _0x3a763d;}})[_0x6648('0x1d')](respondWithResult(_0x2deca2,null))[_0x6648('0x26')](handleError(_0x2deca2,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 622c8d0..3e8fa0e 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 _0x0565=['hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit'];(function(_0x575085,_0x3ac67d){var _0x4b7a82=function(_0x5da5ec){while(--_0x5da5ec){_0x575085['push'](_0x575085['shift']());}};_0x4b7a82(++_0x3ac67d);}(_0x0565,0xf2));var _0x5056=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x0565[_0x220f3f];return _0x1f170e;};'use strict';var EventEmitter=require(_0x5056('0x0'));var WhatsappMessage=require(_0x5056('0x1'))['db'][_0x5056('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x5056('0x3')](0x0);var events={'afterCreate':_0x5056('0x4'),'afterUpdate':_0x5056('0x5'),'afterDestroy':_0x5056('0x6')};function emitEvent(_0x300055){return function(_0x3657a8,_0x2b0883,_0x554040){WhatsappMessageEvents[_0x5056('0x7')](_0x300055+':'+_0x3657a8['id'],_0x3657a8);WhatsappMessageEvents[_0x5056('0x7')](_0x300055,_0x3657a8);_0x554040(null);};}for(var e in events){if(events[_0x5056('0x8')](e)){var event=events[e];WhatsappMessage[_0x5056('0x9')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x7894=['WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x7894,0x170));var _0x4789=function(_0x25eee3,_0x401901){_0x25eee3=_0x25eee3-0x0;var _0x525d80=_0x7894[_0x25eee3];return _0x525d80;};'use strict';var EventEmitter=require(_0x4789('0x0'));var WhatsappMessage=require(_0x4789('0x1'))['db'][_0x4789('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4789('0x3')](0x0);var events={'afterCreate':_0x4789('0x4'),'afterUpdate':_0x4789('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd4bd76){return function(_0x2b2dd3,_0x4e2393,_0x3394f6){WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76+':'+_0x2b2dd3['id'],_0x2b2dd3);WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76,_0x2b2dd3);_0x3394f6(null);};}for(var e in events){if(events[_0x4789('0x7')](e)){var event=events[e];WhatsappMessage[_0x4789('0x8')](e,emitEvent(event));}}module[_0x4789('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 8a9a39b..c8f30c0 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 _0xe476=['error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','update','catch'];(function(_0x4dfc0a,_0x22fb71){var _0x3513f6=function(_0x41de58){while(--_0x41de58){_0x4dfc0a['push'](_0x4dfc0a['shift']());}};_0x3513f6(++_0x22fb71);}(_0xe476,0x95));var _0x6e47=function(_0x168315,_0x4303b1){_0x168315=_0x168315-0x0;var _0x5efbe4=_0xe476[_0x168315];return _0x5efbe4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e47('0x0'))('api');var moment=require(_0x6e47('0x1'));var BPromise=require(_0x6e47('0x2'));var rp=require(_0x6e47('0x3'));var fetch=require(_0x6e47('0x4'));var fs=require('fs');var path=require(_0x6e47('0x5'));var rimraf=require('rimraf');var config=require(_0x6e47('0x6'));var attributes=require(_0x6e47('0x7'));module[_0x6e47('0x8')]=function(_0x439a47,_0x27d42f){return _0x439a47['define'](_0x6e47('0x9'),attributes,{'tableName':_0x6e47('0xa'),'paranoid':![],'indexes':[{'name':_0x6e47('0xb'),'fields':[_0x6e47('0xb')]},{'name':_0x6e47('0xc'),'fields':[_0x6e47('0xd')],'type':_0x6e47('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b71a1,_0x2239e1,_0x5bb12a){var _0x1b9ef5=_0x439a47['models'];var _0x9637db=_0x2b71a1[_0x6e47('0xf')]({'plain':!![]});if(_0x9637db[_0x6e47('0x10')][_0x6e47('0x11')]()==='in'||_0x9637db[_0x6e47('0x10')]['toLowerCase']()===_0x6e47('0x12')&&!_0x9637db[_0x6e47('0x13')]&&!_['isNil'](_0x9637db[_0x6e47('0x14')])){_0x1b9ef5[_0x6e47('0x15')][_0x6e47('0x16')]({'where':{'id':_0x9637db['WhatsappInteractionId']}})['then'](function(_0x1a2cd6){if(_0x1a2cd6){_0x1a2cd6[_0x6e47('0x17')]({'lastMsgAt':_0x9637db['createdAt'],'lastMsgDirection':_0x9637db[_0x6e47('0x10')][_0x6e47('0x11')]()});}})[_0x6e47('0x18')](function(_0x5a0c43){console[_0x6e47('0x19')](_0x5a0c43);});}if(_0x9637db[_0x6e47('0x10')]==='out'&&!_0x9637db['secret']){var _0xb76adb;_0x1b9ef5[_0x6e47('0x1a')][_0x6e47('0x1b')]({'where':{'id':_0x9637db[_0x6e47('0x1c')]},'raw':!![]})[_0x6e47('0x1d')](function(_0x21e608){_0xb76adb=_0x21e608;if(_0xb76adb&&_0xb76adb[_0x6e47('0x1e')]){switch(_0xb76adb['type']){case'twilio':var _0x4a5ebb=require(_0x6e47('0x1f'));if(_0xb76adb[_0x6e47('0x20')]&&_0xb76adb[_0x6e47('0x21')]&&_0xb76adb[_0x6e47('0x22')]){var _0x282ec5=new _0x4a5ebb(_0xb76adb[_0x6e47('0x20')],_0xb76adb[_0x6e47('0x21')]);_0x282ec5[_0x6e47('0x23')][_0x6e47('0x24')]({'body':_0x9637db[_0x6e47('0xd')],'to':_0x6e47('0x25')+_0x9637db[_0x6e47('0x22')],'from':_0x6e47('0x25')+_0xb76adb[_0x6e47('0x22')],'statusCallback':_0xb76adb[_0x6e47('0x26')]+_0x6e47('0x27')+_0x9637db['id']+_0x6e47('0x28')+_0xb76adb[_0x6e47('0x29')]})[_0x6e47('0x1d')](function(_0x4cfce7){if(_0x4cfce7[_0x6e47('0x2a')]){return _0x2b71a1[_0x6e47('0x17')]({'messageId':_0x4cfce7[_0x6e47('0x2a')]});}})[_0x6e47('0x18')](function(_0x47abc4){logger['error'](_0x6e47('0x2b'),'afterCreate',_0x6e47('0x1f'),util['inspect'](_0x47abc4,{'showHidden':![],'depth':null}));});}else{logger[_0x6e47('0x19')](_0x6e47('0x2b'),_0x6e47('0x2c'),_0x6e47('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x6e47('0x2d'):var _0x23c0a3=_0xb76adb[_0x6e47('0x20')];var _0x102519=_0xb76adb[_0x6e47('0x21')];var _0x2ca622=_0xb76adb[_0x6e47('0x2e')]+_0x6e47('0x2f')+_0x23c0a3+_0x6e47('0x30');var _0xb95015={'to':[_0x9637db['phone']],'message':{'type':'text','text':_0x9637db['body']}};var _0x5250c4={'method':_0x6e47('0x31'),'uri':_0x2ca622,'headers':{'Authorization':'Bearer\x20'+_0x102519,'Content-Type':_0x6e47('0x32')},'body':_0xb95015,'json':!![]};rp(_0x5250c4)[_0x6e47('0x1d')](function(_0x5d8a2e){if(_0x5d8a2e[_0x6e47('0x33')][0x0][_0x6e47('0x34')]){return _0x2b71a1[_0x6e47('0x17')]({'messageId':_0x5d8a2e[_0x6e47('0x33')][0x0]['message_id']});}})[_0x6e47('0x18')](function(_0x14b3fb){logger[_0x6e47('0x35')](_0x6e47('0x36'),_0x14b3fb);});break;}}})[_0x6e47('0x37')](function(){_0x5bb12a();});}else{_0x5bb12a();}}},'charset':_0x6e47('0x38'),'collate':_0x6e47('0x39')});}; \ No newline at end of file +var _0xd9a0=['../../config/logger','api','moment','node-fetch','path','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','UserId','WhatsappInteraction','then','update','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','phone','authToken','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','/whatsapp/v1/','/messages/','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dae49,_0x300a62){var _0x1d5745=function(_0x436772){while(--_0x436772){_0x3dae49['push'](_0x3dae49['shift']());}};_0x1d5745(++_0x300a62);}(_0xd9a0,0x68));var _0x0d9a=function(_0xb63d93,_0x1fb747){_0xb63d93=_0xb63d93-0x0;var _0x27979d=_0xd9a0[_0xb63d93];return _0x27979d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d9a('0x0'))(_0x0d9a('0x1'));var moment=require(_0x0d9a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x0d9a('0x3'));var fs=require('fs');var path=require(_0x0d9a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0d9a('0x5'));module[_0x0d9a('0x6')]=function(_0x491fb9,_0x59bca5){return _0x491fb9[_0x0d9a('0x7')](_0x0d9a('0x8'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x0d9a('0x9'),'fields':[_0x0d9a('0x9')]},{'name':'fti_whatsapp_messages','fields':[_0x0d9a('0xa')],'type':_0x0d9a('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38b457,_0x3825f3,_0x5e222f){var _0x577880=_0x491fb9[_0x0d9a('0xc')];var _0x25f116=_0x38b457[_0x0d9a('0xd')]({'plain':!![]});if(_0x25f116[_0x0d9a('0xe')][_0x0d9a('0xf')]()==='in'||_0x25f116[_0x0d9a('0xe')][_0x0d9a('0xf')]()==='out'&&!_0x25f116['secret']&&!_['isNil'](_0x25f116[_0x0d9a('0x10')])){_0x577880[_0x0d9a('0x11')]['findOne']({'where':{'id':_0x25f116['WhatsappInteractionId']}})[_0x0d9a('0x12')](function(_0x2df179){if(_0x2df179){_0x2df179[_0x0d9a('0x13')]({'lastMsgAt':_0x25f116[_0x0d9a('0x14')],'lastMsgDirection':_0x25f116[_0x0d9a('0xe')][_0x0d9a('0xf')]()});}})[_0x0d9a('0x15')](function(_0x59e168){console[_0x0d9a('0x16')](_0x59e168);});}if(_0x25f116[_0x0d9a('0xe')]==='out'&&!_0x25f116[_0x0d9a('0x17')]){var _0x57ddf6;_0x577880[_0x0d9a('0x18')][_0x0d9a('0x19')]({'where':{'id':_0x25f116[_0x0d9a('0x1a')]},'raw':!![]})['then'](function(_0x593443){_0x57ddf6=_0x593443;if(_0x57ddf6&&_0x57ddf6[_0x0d9a('0x1b')]){switch(_0x57ddf6[_0x0d9a('0x1b')]){case _0x0d9a('0x1c'):var _0x86d084=require(_0x0d9a('0x1c'));if(_0x57ddf6['accountSid']&&_0x57ddf6['authToken']&&_0x57ddf6[_0x0d9a('0x1d')]){var _0x3c8e8e=new _0x86d084(_0x57ddf6['accountSid'],_0x57ddf6[_0x0d9a('0x1e')]);_0x3c8e8e['messages'][_0x0d9a('0x1f')]({'body':_0x25f116[_0x0d9a('0xa')],'to':_0x0d9a('0x20')+_0x25f116[_0x0d9a('0x1d')],'from':_0x0d9a('0x20')+_0x57ddf6[_0x0d9a('0x1d')],'statusCallback':_0x57ddf6[_0x0d9a('0x21')]+_0x0d9a('0x22')+_0x25f116['id']+_0x0d9a('0x23')+_0x57ddf6[_0x0d9a('0x24')]})[_0x0d9a('0x12')](function(_0x45a7bf){if(_0x45a7bf[_0x0d9a('0x25')]){return _0x38b457[_0x0d9a('0x13')]({'messageId':_0x45a7bf[_0x0d9a('0x25')]});}})[_0x0d9a('0x15')](function(_0xc83ca1){logger['error'](_0x0d9a('0x26'),'afterCreate','twilio',util['inspect'](_0xc83ca1,{'showHidden':![],'depth':null}));});}else{logger[_0x0d9a('0x16')](_0x0d9a('0x26'),'afterCreate',_0x0d9a('0x1c'),_0x0d9a('0x27'));}break;case _0x0d9a('0x28'):var _0x39393b=_0x57ddf6[_0x0d9a('0x29')];var _0x502d2e=_0x57ddf6[_0x0d9a('0x1e')];var _0x278d5a=_0x57ddf6['baseUrl']+_0x0d9a('0x2a')+_0x39393b+_0x0d9a('0x2b');var _0x27e4ba={'to':[_0x25f116[_0x0d9a('0x1d')]],'message':{'type':'text','text':_0x25f116[_0x0d9a('0xa')]}};var _0x31c20d={'method':_0x0d9a('0x2c'),'uri':_0x278d5a,'headers':{'Authorization':'Bearer\x20'+_0x502d2e,'Content-Type':_0x0d9a('0x2d')},'body':_0x27e4ba,'json':!![]};rp(_0x31c20d)['then'](function(_0x30152f){if(_0x30152f[_0x0d9a('0x2e')][0x0][_0x0d9a('0x2f')]){return _0x38b457[_0x0d9a('0x13')]({'messageId':_0x30152f[_0x0d9a('0x2e')][0x0][_0x0d9a('0x2f')]});}})['catch'](function(_0x310e44){logger[_0x0d9a('0x30')](_0x0d9a('0x31'),_0x310e44);});break;}}})['finally'](function(){_0x5e222f();});}else{_0x5e222f();}}},'charset':_0x0d9a('0x32'),'collate':_0x0d9a('0x33')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f4e47bb..fedd535 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 _0xdfe7=['create','body','options','raw','then','CreateWhatsappMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','WhatsappMessage'];(function(_0x12e356,_0x117be8){var _0x5049a9=function(_0x3b3aa3){while(--_0x3b3aa3){_0x12e356['push'](_0x12e356['shift']());}};_0x5049a9(++_0x117be8);}(_0xdfe7,0x12f));var _0x7dfe=function(_0x5d708f,_0xc72d86){_0x5d708f=_0x5d708f-0x0;var _0x438c53=_0xdfe7[_0x5d708f];return _0x438c53;};'use strict';var _=require(_0x7dfe('0x0'));var util=require('util');var moment=require(_0x7dfe('0x1'));var BPromise=require(_0x7dfe('0x2'));var rs=require(_0x7dfe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dfe('0x4'))['db'];var utils=require(_0x7dfe('0x5'));var logger=require(_0x7dfe('0x6'))(_0x7dfe('0x7'));var config=require(_0x7dfe('0x8'));var jayson=require(_0x7dfe('0x9'));var client=jayson['client'][_0x7dfe('0xa')]({'port':0x232a});config[_0x7dfe('0xb')]=_['defaults'](config[_0x7dfe('0xb')],{'host':_0x7dfe('0xc'),'port':0x18eb});var socket=require(_0x7dfe('0xd'))(new Redis(config['redis']));require(_0x7dfe('0xe'))[_0x7dfe('0xf')](socket);function respondWithRpcPromise(_0xc51c4e,_0x3d567a,_0x37c1d0){return new BPromise(function(_0x44ecba,_0x40635e){return client[_0x7dfe('0x10')](_0xc51c4e,_0x37c1d0)['then'](function(_0x3d503a){logger['info'](_0x7dfe('0x11'),_0x3d567a,_0x7dfe('0x12'));logger[_0x7dfe('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3d567a,_0x7dfe('0x12'),JSON[_0x7dfe('0x14')](_0x3d503a));if(_0x3d503a[_0x7dfe('0x15')]){if(_0x3d503a[_0x7dfe('0x15')][_0x7dfe('0x16')]===0x1f4){logger[_0x7dfe('0x15')](_0x7dfe('0x11'),_0x3d567a,_0x3d503a[_0x7dfe('0x15')]['message']);return _0x40635e(_0x3d503a[_0x7dfe('0x15')]['message']);}logger['error'](_0x7dfe('0x11'),_0x3d567a,_0x3d503a[_0x7dfe('0x15')][_0x7dfe('0x17')]);return _0x44ecba(_0x3d503a[_0x7dfe('0x15')]['message']);}else{logger[_0x7dfe('0x18')](_0x7dfe('0x11'),_0x3d567a,_0x7dfe('0x12'));_0x44ecba(_0x3d503a['result']['message']);}})[_0x7dfe('0x19')](function(_0x5f4eaa){logger['error'](_0x7dfe('0x11'),_0x3d567a,_0x5f4eaa);_0x40635e(_0x5f4eaa);});});}exports['CreateWhatsappMessage']=function(_0x504339){var _0x1edefe=this;return new Promise(function(_0xd15c16,_0x20f7fa){return db[_0x7dfe('0x1a')][_0x7dfe('0x1b')](_0x504339[_0x7dfe('0x1c')],{'raw':_0x504339[_0x7dfe('0x1d')]?_0x504339[_0x7dfe('0x1d')][_0x7dfe('0x1e')]===undefined?!![]:![]:!![]})[_0x7dfe('0x1f')](function(_0x47e1f8){logger[_0x7dfe('0x18')](_0x7dfe('0x20'),_0x504339);logger['debug'](_0x7dfe('0x20'),_0x504339,JSON[_0x7dfe('0x14')](_0x47e1f8));_0xd15c16(_0x47e1f8);})[_0x7dfe('0x19')](function(_0x5dcad8){logger[_0x7dfe('0x15')](_0x7dfe('0x20'),_0x5dcad8['message'],_0x504339);_0x20f7fa(_0x1edefe[_0x7dfe('0x15')](0x1f4,_0x5dcad8[_0x7dfe('0x17')]));});});}; \ No newline at end of file +var _0x4210=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','then','lodash','moment','bluebird','randomstring'];(function(_0x1995da,_0x570dec){var _0x47a138=function(_0x649b70){while(--_0x649b70){_0x1995da['push'](_0x1995da['shift']());}};_0x47a138(++_0x570dec);}(_0x4210,0xa1));var _0x0421=function(_0x394e29,_0x1ca037){_0x394e29=_0x394e29-0x0;var _0x21f585=_0x4210[_0x394e29];return _0x21f585;};'use strict';var _=require(_0x0421('0x0'));var util=require('util');var moment=require(_0x0421('0x1'));var BPromise=require(_0x0421('0x2'));var rs=require(_0x0421('0x3'));var fs=require('fs');var Redis=require(_0x0421('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0421('0x5'));var logger=require(_0x0421('0x6'))(_0x0421('0x7'));var config=require(_0x0421('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0421('0x9')]({'port':0x232a});config[_0x0421('0xa')]=_[_0x0421('0xb')](config[_0x0421('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0421('0xc'))(new Redis(config[_0x0421('0xa')]));require(_0x0421('0xd'))[_0x0421('0xe')](socket);function respondWithRpcPromise(_0x344fbe,_0x455d2f,_0x92612d){return new BPromise(function(_0x559421,_0x6c5c2f){return client[_0x0421('0xf')](_0x344fbe,_0x92612d)['then'](function(_0x15da1c){logger[_0x0421('0x10')](_0x0421('0x11'),_0x455d2f,_0x0421('0x12'));logger[_0x0421('0x13')](_0x0421('0x14'),_0x455d2f,_0x0421('0x12'),JSON[_0x0421('0x15')](_0x15da1c));if(_0x15da1c[_0x0421('0x16')]){if(_0x15da1c[_0x0421('0x16')][_0x0421('0x17')]===0x1f4){logger[_0x0421('0x16')](_0x0421('0x11'),_0x455d2f,_0x15da1c[_0x0421('0x16')][_0x0421('0x18')]);return _0x6c5c2f(_0x15da1c[_0x0421('0x16')][_0x0421('0x18')]);}logger['error'](_0x0421('0x11'),_0x455d2f,_0x15da1c['error']['message']);return _0x559421(_0x15da1c['error']['message']);}else{logger[_0x0421('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x455d2f,_0x0421('0x12'));_0x559421(_0x15da1c[_0x0421('0x19')][_0x0421('0x18')]);}})[_0x0421('0x1a')](function(_0x699355){logger[_0x0421('0x16')](_0x0421('0x11'),_0x455d2f,_0x699355);_0x6c5c2f(_0x699355);});});}exports[_0x0421('0x1b')]=function(_0x17c809){var _0x4b21f2=this;return new Promise(function(_0x2e429a,_0x47b5a0){return db[_0x0421('0x1c')][_0x0421('0x1d')](_0x17c809['body'],{'raw':_0x17c809[_0x0421('0x1e')]?_0x17c809[_0x0421('0x1e')][_0x0421('0x1f')]===undefined?!![]:![]:!![]})[_0x0421('0x20')](function(_0x3612aa){logger[_0x0421('0x10')](_0x0421('0x1b'),_0x17c809);logger['debug']('CreateWhatsappMessage',_0x17c809,JSON['stringify'](_0x3612aa));_0x2e429a(_0x3612aa);})[_0x0421('0x1a')](function(_0x2f3300){logger[_0x0421('0x16')](_0x0421('0x1b'),_0x2f3300[_0x0421('0x18')],_0x17c809);_0x47b5a0(_0x4b21f2[_0x0421('0x16')](0x1f4,_0x2f3300[_0x0421('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 03a5bd1..bcbdfe4 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 _0x3464=['emit','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','update'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x3464,0x177));var _0x4346=function(_0x2e4522,_0x1b9a4f){_0x2e4522=_0x2e4522-0x0;var _0x2ffc86=_0x3464[_0x2e4522];return _0x2ffc86;};'use strict';var WhatsappMessageEvents=require(_0x4346('0x0'));var events=[_0x4346('0x1'),'remove',_0x4346('0x2')];function createListener(_0x10b743,_0x547bd2){return function(_0x400a68){_0x547bd2[_0x4346('0x3')](_0x10b743,_0x400a68);};}function removeListener(_0x4e32a2,_0x20e243){return function(){WhatsappMessageEvents[_0x4346('0x4')](_0x4e32a2,_0x20e243);};}exports[_0x4346('0x5')]=function(_0x402ff6){for(var _0x5b2342=0x0,_0x41c934=events['length'];_0x5b2342<_0x41c934;_0x5b2342++){var _0x417b84=events[_0x5b2342];var _0x1424d7=createListener(_0x4346('0x6')+_0x417b84,_0x402ff6);WhatsappMessageEvents['on'](_0x417b84,_0x1424d7);}}; \ No newline at end of file +var _0xa721=['removeListener','register','./whatsappMessage.events','save','remove','emit'];(function(_0x3c4a4f,_0x19eb56){var _0x6c7fc0=function(_0x1064b9){while(--_0x1064b9){_0x3c4a4f['push'](_0x3c4a4f['shift']());}};_0x6c7fc0(++_0x19eb56);}(_0xa721,0x12e));var _0x1a72=function(_0x3a93dd,_0x3d9241){_0x3a93dd=_0x3a93dd-0x0;var _0x1994e7=_0xa721[_0x3a93dd];return _0x1994e7;};'use strict';var WhatsappMessageEvents=require(_0x1a72('0x0'));var events=[_0x1a72('0x1'),_0x1a72('0x2'),'update'];function createListener(_0x526a04,_0x31bf5c){return function(_0x561b1d){_0x31bf5c[_0x1a72('0x3')](_0x526a04,_0x561b1d);};}function removeListener(_0x58d767,_0x33e78e){return function(){WhatsappMessageEvents[_0x1a72('0x4')](_0x58d767,_0x33e78e);};}exports[_0x1a72('0x5')]=function(_0x51cda9){for(var _0x379249=0x0,_0x17d46b=events['length'];_0x379249<_0x17d46b;_0x379249++){var _0x100654=events[_0x379249];var _0x57e84f=createListener('whatsappMessage:'+_0x100654,_0x51cda9);WhatsappMessageEvents['on'](_0x100654,_0x57e84f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 8ea39df..c1666f1 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 _0x373e=['/:id','getMembers','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','/:id/teams','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x43753e,_0x270349){var _0x28c15b=function(_0x446ef0){while(--_0x446ef0){_0x43753e['push'](_0x43753e['shift']());}};_0x28c15b(++_0x270349);}(_0x373e,0xb7));var _0xe373=function(_0x3b17d9,_0xf99a3c){_0x3b17d9=_0x3b17d9-0x0;var _0x185fb3=_0x373e[_0x3b17d9];return _0x185fb3;};'use strict';var multer=require(_0xe373('0x0'));var util=require(_0xe373('0x1'));var path=require(_0xe373('0x2'));var timeout=require(_0xe373('0x3'));var express=require(_0xe373('0x4'));var router=express[_0xe373('0x5')]();var fs_extra=require(_0xe373('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe373('0x7'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0xe373('0x8')]('/',auth[_0xe373('0x9')](),controller[_0xe373('0xa')]);router['get'](_0xe373('0xb'),auth['isAuthenticated'](),controller[_0xe373('0xc')]);router[_0xe373('0x8')](_0xe373('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe373('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0xe373('0xe')]);router[_0xe373('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe373('0xf')]);router[_0xe373('0x8')](_0xe373('0x10'),auth[_0xe373('0x9')](),controller['getAgents']);router[_0xe373('0x11')]('/',auth['isAuthenticated'](),controller[_0xe373('0x12')]);router[_0xe373('0x11')]('/:id/teams',auth[_0xe373('0x9')](),controller[_0xe373('0x13')]);router[_0xe373('0x11')](_0xe373('0x10'),auth[_0xe373('0x9')](),controller[_0xe373('0x14')]);router[_0xe373('0x15')](_0xe373('0xd'),auth[_0xe373('0x9')](),controller[_0xe373('0x16')]);router['delete'](_0xe373('0xd'),auth[_0xe373('0x9')](),controller[_0xe373('0x17')]);router[_0xe373('0x18')](_0xe373('0x19'),auth[_0xe373('0x9')](),controller[_0xe373('0x1a')]);router['delete'](_0xe373('0x10'),auth[_0xe373('0x9')](),controller['removeAgents']);module[_0xe373('0x1b')]=router; \ No newline at end of file +var _0xfc5d=['get','isAuthenticated','/describe','describe','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','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller'];(function(_0x4d4690,_0x553bf8){var _0x5f32d1=function(_0x383771){while(--_0x383771){_0x4d4690['push'](_0x4d4690['shift']());}};_0x5f32d1(++_0x553bf8);}(_0xfc5d,0x116));var _0xdfc5=function(_0x485161,_0x3a5d6f){_0x485161=_0x485161-0x0;var _0x2c9dc0=_0xfc5d[_0x485161];return _0x2c9dc0;};'use strict';var multer=require(_0xdfc5('0x0'));var util=require(_0xdfc5('0x1'));var path=require(_0xdfc5('0x2'));var timeout=require(_0xdfc5('0x3'));var express=require(_0xdfc5('0x4'));var router=express[_0xdfc5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdfc5('0x6'));var interaction=require(_0xdfc5('0x7'));var config=require(_0xdfc5('0x8'));var controller=require(_0xdfc5('0x9'));router[_0xdfc5('0xa')]('/',auth[_0xdfc5('0xb')](),controller['index']);router[_0xdfc5('0xa')](_0xdfc5('0xc'),auth[_0xdfc5('0xb')](),controller[_0xdfc5('0xd')]);router['get']('/:id',auth[_0xdfc5('0xb')](),controller[_0xdfc5('0xe')]);router[_0xdfc5('0xa')](_0xdfc5('0xf'),auth[_0xdfc5('0xb')](),controller[_0xdfc5('0x10')]);router[_0xdfc5('0xa')](_0xdfc5('0x11'),auth[_0xdfc5('0xb')](),controller['getTeams']);router[_0xdfc5('0xa')](_0xdfc5('0x12'),auth[_0xdfc5('0xb')](),controller[_0xdfc5('0x13')]);router[_0xdfc5('0x14')]('/',auth[_0xdfc5('0xb')](),controller[_0xdfc5('0x15')]);router[_0xdfc5('0x14')](_0xdfc5('0x11'),auth['isAuthenticated'](),controller[_0xdfc5('0x16')]);router[_0xdfc5('0x14')](_0xdfc5('0x12'),auth[_0xdfc5('0xb')](),controller[_0xdfc5('0x17')]);router[_0xdfc5('0x18')](_0xdfc5('0x19'),auth['isAuthenticated'](),controller[_0xdfc5('0x1a')]);router[_0xdfc5('0x1b')](_0xdfc5('0x19'),auth[_0xdfc5('0xb')](),controller[_0xdfc5('0x1c')]);router[_0xdfc5('0x1b')](_0xdfc5('0x11'),auth['isAuthenticated'](),controller[_0xdfc5('0x1d')]);router[_0xdfc5('0x1b')](_0xdfc5('0x12'),auth[_0xdfc5('0xb')](),controller[_0xdfc5('0x1e')]);module[_0xdfc5('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index bf921f2..4ecf9da 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 _0xdfe9=['rrmemory','beepall','roundrobin','sequelize','STRING','ENUM'];(function(_0x153c35,_0x555fb5){var _0x53d021=function(_0x298a4f){while(--_0x298a4f){_0x153c35['push'](_0x153c35['shift']());}};_0x53d021(++_0x555fb5);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x493843,_0x3364c9){_0x493843=_0x493843-0x0;var _0x3fa5b0=_0xdfe9[_0x493843];return _0x3fa5b0;};'use strict';var Sequelize=require(_0x9dfe('0x0'));module['exports']={'name':{'type':Sequelize[_0x9dfe('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9dfe('0x2')](_0x9dfe('0x3'),_0x9dfe('0x4'),_0x9dfe('0x5'))},'description':{'type':Sequelize[_0x9dfe('0x1')]}}; \ No newline at end of file +var _0xbc9d=['sequelize','exports','STRING','name','INTEGER','roundrobin'];(function(_0x1b40a6,_0x529535){var _0x310ae0=function(_0x58a555){while(--_0x58a555){_0x1b40a6['push'](_0x1b40a6['shift']());}};_0x310ae0(++_0x529535);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x2da1ef,_0x4c0fbd){_0x2da1ef=_0x2da1ef-0x0;var _0x5900a4=_0xbc9d[_0x2da1ef];return _0x5900a4;};'use strict';var Sequelize=require(_0xdbc9('0x0'));module[_0xdbc9('0x1')]={'name':{'type':Sequelize[_0xdbc9('0x2')],'unique':_0xdbc9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xdbc9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xdbc9('0x5'))},'description':{'type':Sequelize[_0xdbc9('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index b1ab858..d79fedb 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 _0xa26a=['whatsappPause','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','addAgents','omit','removeAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','fs-extra','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','send','map','WhatsappQueue','rawAttributes','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','userProfileId','autoAssociation','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','User','findAndCountAll','agent'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0xa26a,0x144));var _0xaa26=function(_0x26779d,_0x5acde7){_0x26779d=_0x26779d-0x0;var _0x44dd93=_0xa26a[_0x26779d];return _0x44dd93;};'use strict';var emlformat=require(_0xaa26('0x0'));var rimraf=require(_0xaa26('0x1'));var zipdir=require(_0xaa26('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa26('0x3'));var BPromise=require(_0xaa26('0x4'));var Mustache=require(_0xaa26('0x5'));var util=require(_0xaa26('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaa26('0x7'));var fs=require('fs');var fs_extra=require(_0xaa26('0x8'));var _=require('lodash');var squel=require(_0xaa26('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa26('0xa'));var toCsv=require(_0xaa26('0xb'));var querystring=require('querystring');var Papa=require(_0xaa26('0xc'));var Redis=require('ioredis');var authService=require(_0xaa26('0xd'));var qs=require(_0xaa26('0xe'));var as=require(_0xaa26('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa26('0x10'))(_0xaa26('0x11'));var utils=require(_0xaa26('0x12'));var config=require(_0xaa26('0x13'));var licenseUtil=require(_0xaa26('0x14'));var db=require(_0xaa26('0x15'))['db'];config[_0xaa26('0x16')]=_['defaults'](config[_0xaa26('0x16')],{'host':_0xaa26('0x17'),'port':0x18eb});var socket=require(_0xaa26('0x18'))(new Redis(config[_0xaa26('0x16')]));require(_0xaa26('0x19'))['register'](socket);function respondWithStatusCode(_0x308dee,_0x568236){_0x568236=_0x568236||0xcc;return function(_0xd9875d){if(_0xd9875d){return _0x308dee[_0xaa26('0x1a')](_0x568236);}return _0x308dee[_0xaa26('0x1b')](_0x568236)[_0xaa26('0x1c')]();};}function respondWithResult(_0x3463ef,_0x24cfe8){_0x24cfe8=_0x24cfe8||0xc8;return function(_0x2aa886){if(_0x2aa886){return _0x3463ef[_0xaa26('0x1b')](_0x24cfe8)[_0xaa26('0x1d')](_0x2aa886);}};}function respondWithFilteredResult(_0x5c8b0a,_0x4b3db9){return function(_0xe8600f){if(_0xe8600f){var _0x158696=typeof _0x4b3db9[_0xaa26('0x1e')]==='undefined'&&typeof _0x4b3db9[_0xaa26('0x1f')]===_0xaa26('0x20');var _0x597b75=_0xe8600f[_0xaa26('0x21')];var _0x36e6dc=_0x158696?0x0:_0x4b3db9[_0xaa26('0x1e')];var _0x2da17b=_0x158696?_0xe8600f[_0xaa26('0x21')]:_0x4b3db9['offset']+_0x4b3db9[_0xaa26('0x1f')];var _0x4438a1;if(_0x2da17b>=_0x597b75){_0x2da17b=_0x597b75;_0x4438a1=0xc8;}else{_0x4438a1=0xce;}_0x5c8b0a[_0xaa26('0x1b')](_0x4438a1);return _0x5c8b0a[_0xaa26('0x22')](_0xaa26('0x23'),_0x36e6dc+'-'+_0x2da17b+'/'+_0x597b75)[_0xaa26('0x1d')](_0xe8600f);}return null;};}function patchUpdates(_0x130d3d){return function(_0x167cfd){try{jsonpatch['apply'](_0x167cfd,_0x130d3d,!![]);}catch(_0x45b53d){return BPromise[_0xaa26('0x24')](_0x45b53d);}return _0x167cfd[_0xaa26('0x25')]();};}function saveUpdates(_0x5b35a9,_0x21cf9d){return function(_0x2fc924){if(_0x2fc924){return _0x2fc924[_0xaa26('0x26')](_0x5b35a9)[_0xaa26('0x27')](function(_0xbb984a){return _0xbb984a;});}return null;};}function removeEntity(_0xeb9027,_0x34736b){return function(_0x235fc1){if(_0x235fc1){return _0x235fc1[_0xaa26('0x28')]()['then'](function(){var _0x142c45=_0x235fc1[_0xaa26('0x29')]({'plain':!![]});var _0x3f3e2c='WhatsappQueues';return db[_0xaa26('0x2a')][_0xaa26('0x28')]({'where':{'type':_0x3f3e2c,'resourceId':_0x142c45['id']}})[_0xaa26('0x27')](function(){return _0x235fc1;});})[_0xaa26('0x27')](function(){_0xeb9027[_0xaa26('0x1b')](0xcc)[_0xaa26('0x1c')]();});}};}function handleEntityNotFound(_0x5142fc,_0x19f2eb){return function(_0x47de4c){if(!_0x47de4c){_0x5142fc[_0xaa26('0x1a')](0x194);}return _0x47de4c;};}function handleError(_0x39be16,_0x309576){_0x309576=_0x309576||0x1f4;return function(_0x1e4fe6){logger[_0xaa26('0x2b')](_0x1e4fe6['stack']);if(_0x1e4fe6['name']){delete _0x1e4fe6['name'];}_0x39be16[_0xaa26('0x1b')](_0x309576)[_0xaa26('0x2c')](_0x1e4fe6);};}exports['index']=function(_0x5755ea,_0x1e9dd1){var _0x6448ac={},_0x280af0={},_0x332a46={'count':0x0,'rows':[]};var _0x3056a3=_[_0xaa26('0x2d')](db[_0xaa26('0x2e')][_0xaa26('0x2f')],function(_0x2a62bd){return{'name':_0x2a62bd['fieldName'],'type':_0x2a62bd[_0xaa26('0x30')]['key']};});_0x280af0[_0xaa26('0x31')]=_[_0xaa26('0x2d')](_0x3056a3,_0xaa26('0x32'));_0x280af0[_0xaa26('0x33')]=_[_0xaa26('0x34')](_0x5755ea[_0xaa26('0x33')]);_0x280af0[_0xaa26('0x35')]=_[_0xaa26('0x36')](_0x280af0[_0xaa26('0x31')],_0x280af0['query']);_0x6448ac[_0xaa26('0x37')]=_[_0xaa26('0x36')](_0x280af0[_0xaa26('0x31')],qs[_0xaa26('0x38')](_0x5755ea[_0xaa26('0x33')]['fields']));_0x6448ac[_0xaa26('0x37')]=_0x6448ac[_0xaa26('0x37')][_0xaa26('0x39')]?_0x6448ac[_0xaa26('0x37')]:_0x280af0['model'];if(!_0x5755ea['query']['hasOwnProperty'](_0xaa26('0x3a'))){_0x6448ac['limit']=qs[_0xaa26('0x1f')](_0x5755ea[_0xaa26('0x33')][_0xaa26('0x1f')]);_0x6448ac[_0xaa26('0x1e')]=qs[_0xaa26('0x1e')](_0x5755ea[_0xaa26('0x33')]['offset']);}_0x6448ac[_0xaa26('0x3b')]=qs[_0xaa26('0x3c')](_0x5755ea[_0xaa26('0x33')][_0xaa26('0x3c')]);_0x6448ac['where']=qs[_0xaa26('0x35')](_[_0xaa26('0x3d')](_0x5755ea[_0xaa26('0x33')],_0x280af0[_0xaa26('0x35')]),_0x3056a3);if(_0x5755ea[_0xaa26('0x33')][_0xaa26('0x3e')]){_0x6448ac[_0xaa26('0x3f')]=_['merge'](_0x6448ac[_0xaa26('0x3f')],{'$or':_['map'](_0x3056a3,function(_0x973b24){if(_0x973b24['type']!=='VIRTUAL'){var _0x5c81dd={};_0x5c81dd[_0x973b24[_0xaa26('0x32')]]={'$like':'%'+_0x5755ea[_0xaa26('0x33')][_0xaa26('0x3e')]+'%'};return _0x5c81dd;}})});}_0x6448ac=_[_0xaa26('0x40')]({},_0x6448ac,_0x5755ea['options']);var _0x31017b={'where':_0x6448ac[_0xaa26('0x3f')]};return db[_0xaa26('0x2e')][_0xaa26('0x21')](_0x31017b)[_0xaa26('0x27')](function(_0x2358f9){_0x332a46[_0xaa26('0x21')]=_0x2358f9;if(_0x5755ea['query']['includeAll']){_0x6448ac[_0xaa26('0x41')]=[{'all':!![]}];}return db[_0xaa26('0x2e')][_0xaa26('0x42')](_0x6448ac);})[_0xaa26('0x27')](function(_0x25d9f0){_0x332a46[_0xaa26('0x43')]=_0x25d9f0;return _0x332a46;})[_0xaa26('0x27')](respondWithFilteredResult(_0x1e9dd1,_0x6448ac))[_0xaa26('0x44')](handleError(_0x1e9dd1,null));};exports['show']=function(_0x119f87,_0x50a72d){var _0x3c7939={'raw':!![],'where':{'id':_0x119f87[_0xaa26('0x45')]['id']}},_0x12938a={};_0x12938a['model']=_[_0xaa26('0x34')](db['WhatsappQueue']['rawAttributes']);_0x12938a[_0xaa26('0x33')]=_[_0xaa26('0x34')](_0x119f87['query']);_0x12938a['filters']=_[_0xaa26('0x36')](_0x12938a['model'],_0x12938a['query']);_0x3c7939[_0xaa26('0x37')]=_[_0xaa26('0x36')](_0x12938a[_0xaa26('0x31')],qs['fields'](_0x119f87[_0xaa26('0x33')]['fields']));_0x3c7939[_0xaa26('0x37')]=_0x3c7939['attributes'][_0xaa26('0x39')]?_0x3c7939[_0xaa26('0x37')]:_0x12938a[_0xaa26('0x31')];if(_0x119f87[_0xaa26('0x33')][_0xaa26('0x46')]){_0x3c7939['include']=[{'all':!![]}];}_0x3c7939=_[_0xaa26('0x40')]({},_0x3c7939,_0x119f87[_0xaa26('0x47')]);return db[_0xaa26('0x2e')][_0xaa26('0x48')](_0x3c7939)[_0xaa26('0x27')](handleEntityNotFound(_0x50a72d,null))[_0xaa26('0x27')](respondWithResult(_0x50a72d,null))['catch'](handleError(_0x50a72d,null));};exports['create']=function(_0x3aa166,_0x1f0aba){return db['WhatsappQueue'][_0xaa26('0x49')](_0x3aa166[_0xaa26('0x4a')],{})[_0xaa26('0x27')](function(_0x402d02){var _0x48ead8=_0x3aa166[_0xaa26('0x4b')]['get']({'plain':!![]});if(!_0x48ead8)throw new Error(_0xaa26('0x4c'));if(_0x48ead8[_0xaa26('0x4d')]==='user'){var _0x3a3f8a=_0x402d02[_0xaa26('0x29')]({'plain':!![]});var _0x1193ef=_0xaa26('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x1193ef,'userProfileId':_0x48ead8[_0xaa26('0x4f')]},'raw':!![]})[_0xaa26('0x27')](function(_0x444c9c){if(_0x444c9c&&_0x444c9c[_0xaa26('0x50')]===0x0){return db[_0xaa26('0x2a')][_0xaa26('0x49')]({'name':_0x3a3f8a[_0xaa26('0x32')],'resourceId':_0x3a3f8a['id'],'type':_0x444c9c[_0xaa26('0x32')],'sectionId':_0x444c9c['id']},{})[_0xaa26('0x27')](function(){return _0x402d02;});}else{return _0x402d02;}})['catch'](function(_0xad2861){logger[_0xaa26('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad2861);throw _0xad2861;});}return _0x402d02;})[_0xaa26('0x27')](respondWithResult(_0x1f0aba,0xc9))[_0xaa26('0x44')](handleError(_0x1f0aba,null));};exports[_0xaa26('0x26')]=function(_0x2e11d2,_0x1fafa0){if(_0x2e11d2['body']['id']){delete _0x2e11d2[_0xaa26('0x4a')]['id'];}return db[_0xaa26('0x2e')]['find']({'where':{'id':_0x2e11d2[_0xaa26('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fafa0,null))['then'](saveUpdates(_0x2e11d2[_0xaa26('0x4a')],null))[_0xaa26('0x27')](respondWithResult(_0x1fafa0,null))['catch'](handleError(_0x1fafa0,null));};exports[_0xaa26('0x28')]=function(_0x201f87,_0x253c55){return db[_0xaa26('0x2e')][_0xaa26('0x48')]({'where':{'id':_0x201f87[_0xaa26('0x45')]['id']}})[_0xaa26('0x27')](handleEntityNotFound(_0x253c55,null))['then'](removeEntity(_0x253c55,null))[_0xaa26('0x44')](handleError(_0x253c55,null));};exports[_0xaa26('0x51')]=function(_0x3a50f4,_0x2c3a52){return db[_0xaa26('0x2e')]['describe']()[_0xaa26('0x27')](respondWithResult(_0x2c3a52,null))[_0xaa26('0x44')](handleError(_0x2c3a52,null));};exports[_0xaa26('0x52')]=function(_0x2a77a1,_0x1ad31a,_0x465627){var _0x481134={'raw':!![],'where':{}},_0x503dd0={},_0x49cacb;return db[_0xaa26('0x2e')][_0xaa26('0x53')]({'where':{'id':_0x2a77a1[_0xaa26('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ad31a,null))[_0xaa26('0x27')](function(_0x353a66){if(_0x353a66){_0x49cacb=_0x353a66['get']({'plain':!![]});_0x503dd0['model']=_['keys'](db[_0xaa26('0x54')][_0xaa26('0x2f')]);_0x503dd0[_0xaa26('0x33')]=_[_0xaa26('0x34')](_0x2a77a1[_0xaa26('0x33')]);_0x503dd0[_0xaa26('0x35')]=_[_0xaa26('0x36')](_0x503dd0[_0xaa26('0x31')],_0x503dd0[_0xaa26('0x33')]);_0x481134[_0xaa26('0x37')]=_[_0xaa26('0x36')](_0x503dd0[_0xaa26('0x31')],qs[_0xaa26('0x38')](_0x2a77a1[_0xaa26('0x33')][_0xaa26('0x38')]));_0x481134[_0xaa26('0x37')]=_0x481134['attributes'][_0xaa26('0x39')]?_0x481134[_0xaa26('0x37')]:_0x503dd0[_0xaa26('0x31')];if(!_0x2a77a1[_0xaa26('0x33')][_0xaa26('0x55')](_0xaa26('0x3a'))){_0x481134[_0xaa26('0x1f')]=qs[_0xaa26('0x1f')](_0x2a77a1[_0xaa26('0x33')][_0xaa26('0x1f')]);_0x481134[_0xaa26('0x1e')]=qs[_0xaa26('0x1e')](_0x2a77a1['query'][_0xaa26('0x1e')]);}_0x481134['order']=qs[_0xaa26('0x3c')](_0x2a77a1[_0xaa26('0x33')][_0xaa26('0x3c')]);_0x481134[_0xaa26('0x3f')]=qs[_0xaa26('0x35')](_[_0xaa26('0x3d')](_0x2a77a1['query'],_0x503dd0[_0xaa26('0x35')]));_0x481134[_0xaa26('0x3f')][_0xaa26('0x56')]=_0x353a66['id'];if(_0x2a77a1[_0xaa26('0x33')][_0xaa26('0x3e')]){_0x481134[_0xaa26('0x3f')]=_['merge'](_0x481134[_0xaa26('0x3f')],{'$or':_[_0xaa26('0x2d')](_0x481134[_0xaa26('0x37')],function(_0x1b5f40){var _0x1a13f4={};_0x1a13f4[_0x1b5f40]={'$like':'%'+_0x2a77a1[_0xaa26('0x33')][_0xaa26('0x3e')]+'%'};return _0x1a13f4;})});}_0x481134=_[_0xaa26('0x40')]({},_0x481134,_0x2a77a1[_0xaa26('0x47')]);return db[_0xaa26('0x54')][_0xaa26('0x42')](_0x481134);}})[_0xaa26('0x27')](function(_0x2df88e){if(_0x2df88e){return db[_0xaa26('0x57')][_0xaa26('0x58')]({'where':{'id':_[_0xaa26('0x2d')](_0x2df88e,'UserId'),'role':_0xaa26('0x59')},'attributes':['id',_0xaa26('0x32'),_0xaa26('0x5a'),'updatedAt',_0xaa26('0x5b')]});}})[_0xaa26('0x27')](function(_0x287768){if(_0x287768){return{'count':_0x287768[_0xaa26('0x21')],'rows':_[_0xaa26('0x2d')](_0x287768[_0xaa26('0x43')],function(_0x30679a){return{'membername':_0x30679a[_0xaa26('0x32')],'UserId':_0x30679a['id'],'queue_name':_0x49cacb[_0xaa26('0x32')],'WhatsappQueueId':_0x49cacb['id'],'interface':util[_0xaa26('0x5c')](_0xaa26('0x5d'),_0xaa26('0x5e'),_0x30679a[_0xaa26('0x32')]),'penalty':0x0,'paused':_0x30679a[_0xaa26('0x5a')],'createdAt':_0x30679a[_0xaa26('0x5b')],'updatedAt':_0x30679a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xaa26('0x27')](respondWithFilteredResult(_0x1ad31a,_0x481134))['catch'](handleError(_0x1ad31a,null));};exports[_0xaa26('0x5f')]=function(_0x217fce,_0x277eae,_0x5f17ad){var _0x2f8a8e={};var _0x7e23d6={};var _0x490573;var _0x2fca41;return db[_0xaa26('0x2e')][_0xaa26('0x53')]({'where':{'id':_0x217fce[_0xaa26('0x45')]['id']}})[_0xaa26('0x27')](handleEntityNotFound(_0x277eae,null))[_0xaa26('0x27')](function(_0x4ca246){if(_0x4ca246){_0x490573=_0x4ca246;_0x7e23d6[_0xaa26('0x31')]=_['keys'](db['Team'][_0xaa26('0x2f')]);_0x7e23d6[_0xaa26('0x33')]=_[_0xaa26('0x34')](_0x217fce[_0xaa26('0x33')]);_0x7e23d6[_0xaa26('0x35')]=_[_0xaa26('0x36')](_0x7e23d6[_0xaa26('0x31')],_0x7e23d6['query']);_0x2f8a8e['attributes']=_['intersection'](_0x7e23d6['model'],qs[_0xaa26('0x38')](_0x217fce['query'][_0xaa26('0x38')]));_0x2f8a8e['attributes']=_0x2f8a8e[_0xaa26('0x37')][_0xaa26('0x39')]?_0x2f8a8e[_0xaa26('0x37')]:_0x7e23d6[_0xaa26('0x31')];_0x2f8a8e['order']=qs[_0xaa26('0x3c')](_0x217fce[_0xaa26('0x33')]['sort']);_0x2f8a8e['where']=qs['filters'](_[_0xaa26('0x3d')](_0x217fce[_0xaa26('0x33')],_0x7e23d6[_0xaa26('0x35')]));if(_0x217fce[_0xaa26('0x33')][_0xaa26('0x3e')]){_0x2f8a8e['where']=_[_0xaa26('0x40')](_0x2f8a8e[_0xaa26('0x3f')],{'$or':_[_0xaa26('0x2d')](_0x2f8a8e[_0xaa26('0x37')],function(_0xc26176){var _0x4f3ca8={};_0x4f3ca8[_0xc26176]={'$like':'%'+_0x217fce[_0xaa26('0x33')][_0xaa26('0x3e')]+'%'};return _0x4f3ca8;})});}_0x2f8a8e=_[_0xaa26('0x40')]({},_0x2f8a8e,_0x217fce[_0xaa26('0x47')]);return _0x490573[_0xaa26('0x5f')](_0x2f8a8e);}})[_0xaa26('0x27')](function(_0x36d8aa){if(_0x36d8aa){_0x2fca41=_0x36d8aa['length'];if(!_0x217fce[_0xaa26('0x33')]['hasOwnProperty'](_0xaa26('0x3a'))){_0x2f8a8e[_0xaa26('0x1f')]=qs['limit'](_0x217fce['query'][_0xaa26('0x1f')]);_0x2f8a8e['offset']=qs[_0xaa26('0x1e')](_0x217fce[_0xaa26('0x33')][_0xaa26('0x1e')]);}return _0x490573['getTeams'](_0x2f8a8e);}})['then'](function(_0x282f30){if(_0x282f30){return _0x282f30?{'count':_0x2fca41,'rows':_0x282f30}:null;}})[_0xaa26('0x27')](respondWithResult(_0x277eae,null))[_0xaa26('0x44')](handleError(_0x277eae,null));};exports[_0xaa26('0x60')]=function(_0x548264,_0x198480,_0x87d923){var _0x1f920d=_0x548264['body'][_0xaa26('0x61')];return db[_0xaa26('0x62')][_0xaa26('0x42')]({'where':{'id':_0x1f920d},'attributes':['id'],'include':[{'model':db[_0xaa26('0x57')],'as':'Agents','attributes':['id',_0xaa26('0x32'),_0xaa26('0x63'),_0xaa26('0x64'),_0xaa26('0x65')],'raw':!![]}]})[_0xaa26('0x27')](function(_0x47e24b){if(_0x47e24b){var _0x383757=_[_0xaa26('0x66')](_0x47e24b,function(_0x5aedf8){var _0x144d83=_0x5aedf8[_0xaa26('0x29')]({'plain':!![]});return _0x144d83[_0xaa26('0x67')];});return db[_0xaa26('0x2e')][_0xaa26('0x48')]({'where':{'id':_0x548264['params']['id']}})[_0xaa26('0x27')](function(_0x57cfed){return db[_0xaa26('0x68')][_0xaa26('0x69')](function(_0x26726f){return _0x57cfed[_0xaa26('0x60')](_0x1f920d,{'transaction':_0x26726f})[_0xaa26('0x27')](function(){return BPromise[_0xaa26('0x6a')](_0x383757,function(_0x49507a){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x49507a['id'],'WhatsappQueueId':_0x548264[_0xaa26('0x45')]['id']},'transaction':_0x26726f});});})[_0xaa26('0x27')](function(){_0x383757[_0xaa26('0x6b')](function(_0x3204c3){socket[_0xaa26('0x6c')](_0xaa26('0x6d'),{'UserId':_0x3204c3['id'],'WhatsappQueueId':_0x57cfed['id']});});});});});}})['then'](respondWithStatusCode(_0x198480,null))[_0xaa26('0x44')](handleError(_0x198480,null));};exports[_0xaa26('0x6e')]=function(_0x164e8f,_0x241ada,_0x1cb418){return db[_0xaa26('0x62')][_0xaa26('0x42')]({'where':{'id':_0x164e8f[_0xaa26('0x33')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xaa26('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x241ada,null))[_0xaa26('0x27')](function(_0x2e80d6){var _0x497412=_[_0xaa26('0x2d')](_0x2e80d6,'id');var _0xc74b03=[];var _0x3c32db=[];var _0x28b480=squel[_0xaa26('0x6f')]();_0x28b480[_0xaa26('0x70')](_0xaa26('0x71'))['from'](_0xaa26('0x72'),'tq')[_0xaa26('0x73')](_0xaa26('0x74'),'ut',_0xaa26('0x75'))[_0xaa26('0x3f')](_0xaa26('0x76'),_0x164e8f[_0xaa26('0x45')]['id']);for(var _0xf0932e=0x0;_0xf0932e<_0x2e80d6['length'];_0xf0932e+=0x1){let _0x3cb317=_0x2e80d6[_0xf0932e];for(var _0x26a76f=0x0;_0x26a76f<_0x3cb317[_0xaa26('0x67')]['length'];_0x26a76f+=0x1){let _0x35573f=_0x3cb317['Agents'][_0x26a76f];var _0x56925a=_0x28b480[_0xaa26('0x77')]();_0x56925a[_0xaa26('0x3f')](_0xaa26('0x78'),_0x35573f['id']);_0x3c32db['push'](db[_0xaa26('0x68')][_0xaa26('0x33')](_0x56925a[_0xaa26('0x79')](),{'type':db[_0xaa26('0x68')][_0xaa26('0x7a')][_0xaa26('0x7b')]})[_0xaa26('0x27')](function(_0x19d5b7){if(_0x19d5b7['length']===0x1){return _0x35573f['id'];}else{var _0x3e3409=_[_0xaa26('0x7c')](_[_0xaa26('0x2d')](_0x19d5b7,_0xaa26('0x7d')),function(_0x211948){return _[_0xaa26('0x7e')](_0x497412,_0x211948);});if(_0x3e3409){return _0x35573f['id'];}}}));}}return BPromise[_0xaa26('0x7f')](_0x3c32db)[_0xaa26('0x27')](function(_0x23f65b){_0xc74b03=_(_0xc74b03)[_0xaa26('0x80')](_0x23f65b)[_0xaa26('0x81')]()[_0xaa26('0x82')]();return db[_0xaa26('0x2e')]['find']({'where':{'id':_0x164e8f[_0xaa26('0x45')]['id']}})[_0xaa26('0x27')](function(_0x37ad89){return db['sequelize'][_0xaa26('0x69')](function(_0x5721dd){return _0x37ad89['removeTeams'](_0x164e8f['query'][_0xaa26('0x61')],{'transaction':_0x5721dd})[_0xaa26('0x27')](function(){if(!_[_0xaa26('0x83')](_0xc74b03)){return _0x37ad89['removeAgents'](_0xc74b03,{'transaction':_0x5721dd});}})[_0xaa26('0x27')](function(){_0xc74b03[_0xaa26('0x6b')](function(_0x563957){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x563957,'WhatsappQueueId':_0x37ad89['id']});});});});});});})['then'](respondWithStatusCode(_0x241ada,null))[_0xaa26('0x44')](handleError(_0x241ada,null));};exports[_0xaa26('0x84')]=function(_0x3059aa,_0x4683d7,_0x46edf8){return db[_0xaa26('0x2e')][_0xaa26('0x48')]({'where':{'id':_0x3059aa[_0xaa26('0x45')]['id']}})[_0xaa26('0x27')](handleEntityNotFound(_0x4683d7,null))[_0xaa26('0x27')](function(_0x5a9ad1){if(_0x5a9ad1){return _0x5a9ad1[_0xaa26('0x84')](_0x3059aa[_0xaa26('0x4a')][_0xaa26('0x61')],_[_0xaa26('0x85')](_0x3059aa[_0xaa26('0x4a')],['ids','id'])||{})['spread'](function(_0x185fee){for(var _0x55f819=0x0;_0x55f819<_0x3059aa[_0xaa26('0x4a')][_0xaa26('0x61')]['length'];_0x55f819+=0x1){socket[_0xaa26('0x6c')](_0xaa26('0x6d'),{'UserId':Number(_0x3059aa[_0xaa26('0x4a')][_0xaa26('0x61')][_0x55f819]),'WhatsappQueueId':Number(_0x3059aa[_0xaa26('0x45')]['id'])});}return _0x185fee;});}})[_0xaa26('0x27')](respondWithResult(_0x4683d7,null))['catch'](handleError(_0x4683d7,null));};exports[_0xaa26('0x86')]=function(_0x1e5baf,_0x3ffc07,_0x488b06){return db['WhatsappQueue'][_0xaa26('0x48')]({'where':{'id':_0x1e5baf[_0xaa26('0x45')]['id']}})[_0xaa26('0x27')](handleEntityNotFound(_0x3ffc07,null))[_0xaa26('0x27')](function(_0x41302e){if(_0x41302e){return _0x41302e['removeAgents'](_0x1e5baf['query'][_0xaa26('0x61')])[_0xaa26('0x27')](function(){if(_[_0xaa26('0x87')](_0x1e5baf[_0xaa26('0x33')][_0xaa26('0x61')])){for(var _0x12aba1=0x0;_0x12aba1<_0x1e5baf[_0xaa26('0x33')][_0xaa26('0x61')]['length'];_0x12aba1+=0x1){socket['emit'](_0xaa26('0x88'),{'UserId':Number(_0x1e5baf[_0xaa26('0x33')][_0xaa26('0x61')][_0x12aba1]),'WhatsappQueueId':Number(_0x1e5baf[_0xaa26('0x45')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x1e5baf[_0xaa26('0x33')]['ids']),'WhatsappQueueId':Number(_0x1e5baf[_0xaa26('0x45')]['id'])});}});}})[_0xaa26('0x27')](respondWithStatusCode(_0x3ffc07,null))['catch'](handleError(_0x3ffc07,null));};exports[_0xaa26('0x89')]=function(_0x7c6133,_0x2e60fe,_0xa949c5){var _0x42d569={};var _0x5edf52={};var _0x5cfafd;var _0x362d6f;return db[_0xaa26('0x2e')][_0xaa26('0x53')]({'where':{'id':_0x7c6133[_0xaa26('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e60fe,null))[_0xaa26('0x27')](function(_0x48b2a9){if(_0x48b2a9){_0x5cfafd=_0x48b2a9;_0x5edf52[_0xaa26('0x31')]=_['keys'](db[_0xaa26('0x57')][_0xaa26('0x2f')]);_0x5edf52[_0xaa26('0x33')]=_['keys'](_0x7c6133[_0xaa26('0x33')]);_0x5edf52[_0xaa26('0x35')]=_[_0xaa26('0x36')](_0x5edf52[_0xaa26('0x31')],_0x5edf52['query']);_0x42d569['attributes']=_[_0xaa26('0x36')](_0x5edf52[_0xaa26('0x31')],qs[_0xaa26('0x38')](_0x7c6133[_0xaa26('0x33')][_0xaa26('0x38')]));_0x42d569[_0xaa26('0x37')]=_0x42d569[_0xaa26('0x37')]['length']?_0x42d569[_0xaa26('0x37')]:_0x5edf52['model'];_0x42d569['order']=qs['sort'](_0x7c6133['query'][_0xaa26('0x3c')]);_0x42d569[_0xaa26('0x3f')]=qs[_0xaa26('0x35')](_[_0xaa26('0x3d')](_0x7c6133['query'],_0x5edf52['filters']));if(_0x7c6133[_0xaa26('0x33')]['filter']){_0x42d569[_0xaa26('0x3f')]=_[_0xaa26('0x40')](_0x42d569[_0xaa26('0x3f')],{'$or':_[_0xaa26('0x2d')](_0x42d569[_0xaa26('0x37')],function(_0x2aa6d7){var _0x464fc8={};_0x464fc8[_0x2aa6d7]={'$like':'%'+_0x7c6133[_0xaa26('0x33')]['filter']+'%'};return _0x464fc8;})});}_0x42d569=_['merge']({},_0x42d569,_0x7c6133[_0xaa26('0x47')]);return _0x5cfafd[_0xaa26('0x89')](_0x42d569);}})['then'](function(_0x3d1550){if(_0x3d1550){_0x362d6f=_0x3d1550[_0xaa26('0x39')];if(!_0x7c6133[_0xaa26('0x33')][_0xaa26('0x55')](_0xaa26('0x3a'))){_0x42d569[_0xaa26('0x1f')]=qs[_0xaa26('0x1f')](_0x7c6133[_0xaa26('0x33')][_0xaa26('0x1f')]);_0x42d569['offset']=qs[_0xaa26('0x1e')](_0x7c6133['query']['offset']);}return _0x5cfafd['getAgents'](_0x42d569);}})[_0xaa26('0x27')](function(_0x12f7cd){if(_0x12f7cd){return _0x12f7cd?{'count':_0x362d6f,'rows':_0x12f7cd}:null;}})[_0xaa26('0x27')](respondWithResult(_0x2e60fe,null))[_0xaa26('0x44')](handleError(_0x2e60fe,null));}; \ No newline at end of file +var _0x98d3=['map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','UserWhatsappQueue','order','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','createdAt','%s/%s','SIP','updatedAt','Team','getTeams','User','Agents','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','ids','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','WhatsappQueues','UserProfileResource','destroy','end','error','stack','name','send'];(function(_0x9ddcfd,_0x53c5e9){var _0x572d20=function(_0x1db8a2){while(--_0x1db8a2){_0x9ddcfd['push'](_0x9ddcfd['shift']());}};_0x572d20(++_0x53c5e9);}(_0x98d3,0xf0));var _0x398d=function(_0x3adf2f,_0x454485){_0x3adf2f=_0x3adf2f-0x0;var _0x2ead70=_0x98d3[_0x3adf2f];return _0x2ead70;};'use strict';var emlformat=require(_0x398d('0x0'));var rimraf=require(_0x398d('0x1'));var zipdir=require(_0x398d('0x2'));var jsonpatch=require(_0x398d('0x3'));var rp=require(_0x398d('0x4'));var moment=require(_0x398d('0x5'));var BPromise=require(_0x398d('0x6'));var Mustache=require(_0x398d('0x7'));var util=require('util');var path=require(_0x398d('0x8'));var sox=require(_0x398d('0x9'));var csv=require(_0x398d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x398d('0xb'));var _=require('lodash');var squel=require(_0x398d('0xc'));var crypto=require(_0x398d('0xd'));var jsforce=require(_0x398d('0xe'));var deskjs=require(_0x398d('0xf'));var toCsv=require(_0x398d('0xa'));var querystring=require(_0x398d('0x10'));var Papa=require('papaparse');var Redis=require(_0x398d('0x11'));var authService=require(_0x398d('0x12'));var qs=require(_0x398d('0x13'));var as=require(_0x398d('0x14'));var hardwareService=require(_0x398d('0x15'));var logger=require('../../config/logger')(_0x398d('0x16'));var utils=require(_0x398d('0x17'));var config=require(_0x398d('0x18'));var licenseUtil=require(_0x398d('0x19'));var db=require('../../mysqldb')['db'];config[_0x398d('0x1a')]=_[_0x398d('0x1b')](config[_0x398d('0x1a')],{'host':_0x398d('0x1c'),'port':0x18eb});var socket=require(_0x398d('0x1d'))(new Redis(config[_0x398d('0x1a')]));require(_0x398d('0x1e'))[_0x398d('0x1f')](socket);function respondWithStatusCode(_0x5c9fe7,_0xd3ea46){_0xd3ea46=_0xd3ea46||0xcc;return function(_0x2c4d1e){if(_0x2c4d1e){return _0x5c9fe7[_0x398d('0x20')](_0xd3ea46);}return _0x5c9fe7[_0x398d('0x21')](_0xd3ea46)['end']();};}function respondWithResult(_0x1fbd6f,_0x3c2475){_0x3c2475=_0x3c2475||0xc8;return function(_0x5d8859){if(_0x5d8859){return _0x1fbd6f[_0x398d('0x21')](_0x3c2475)[_0x398d('0x22')](_0x5d8859);}};}function respondWithFilteredResult(_0x2f59ed,_0x35b2b3){return function(_0x21b792){if(_0x21b792){var _0xa51dfc=typeof _0x35b2b3[_0x398d('0x23')]===_0x398d('0x24')&&typeof _0x35b2b3[_0x398d('0x25')]===_0x398d('0x24');var _0x144b49=_0x21b792['count'];var _0xb2e1c5=_0xa51dfc?0x0:_0x35b2b3[_0x398d('0x23')];var _0x386816=_0xa51dfc?_0x21b792[_0x398d('0x26')]:_0x35b2b3[_0x398d('0x23')]+_0x35b2b3[_0x398d('0x25')];var _0x684d4f;if(_0x386816>=_0x144b49){_0x386816=_0x144b49;_0x684d4f=0xc8;}else{_0x684d4f=0xce;}_0x2f59ed[_0x398d('0x21')](_0x684d4f);return _0x2f59ed[_0x398d('0x27')]('Content-Range',_0xb2e1c5+'-'+_0x386816+'/'+_0x144b49)['json'](_0x21b792);}return null;};}function patchUpdates(_0x5adc50){return function(_0x4672b8){try{jsonpatch[_0x398d('0x28')](_0x4672b8,_0x5adc50,!![]);}catch(_0x3d8f8d){return BPromise[_0x398d('0x29')](_0x3d8f8d);}return _0x4672b8[_0x398d('0x2a')]();};}function saveUpdates(_0x2583b1,_0x3aa9cb){return function(_0x4cb9d8){if(_0x4cb9d8){return _0x4cb9d8[_0x398d('0x2b')](_0x2583b1)[_0x398d('0x2c')](function(_0x1a87a9){return _0x1a87a9;});}return null;};}function removeEntity(_0x2cc61f,_0x281e64){return function(_0x5670a9){if(_0x5670a9){return _0x5670a9['destroy']()[_0x398d('0x2c')](function(){var _0x22581c=_0x5670a9[_0x398d('0x2d')]({'plain':!![]});var _0x301964=_0x398d('0x2e');return db[_0x398d('0x2f')][_0x398d('0x30')]({'where':{'type':_0x301964,'resourceId':_0x22581c['id']}})['then'](function(){return _0x5670a9;});})[_0x398d('0x2c')](function(){_0x2cc61f[_0x398d('0x21')](0xcc)[_0x398d('0x31')]();});}};}function handleEntityNotFound(_0x23f010,_0x4366dc){return function(_0x42ea58){if(!_0x42ea58){_0x23f010[_0x398d('0x20')](0x194);}return _0x42ea58;};}function handleError(_0x44e5f4,_0x5ae847){_0x5ae847=_0x5ae847||0x1f4;return function(_0x1c927e){logger[_0x398d('0x32')](_0x1c927e[_0x398d('0x33')]);if(_0x1c927e[_0x398d('0x34')]){delete _0x1c927e[_0x398d('0x34')];}_0x44e5f4[_0x398d('0x21')](_0x5ae847)[_0x398d('0x35')](_0x1c927e);};}exports['index']=function(_0x46cba3,_0x2a69d4){var _0x1b90e5={},_0x28a29c={},_0x14a6c2={'count':0x0,'rows':[]};var _0x22ef44=_[_0x398d('0x36')](db[_0x398d('0x37')][_0x398d('0x38')],function(_0xc3582a){return{'name':_0xc3582a[_0x398d('0x39')],'type':_0xc3582a[_0x398d('0x3a')][_0x398d('0x3b')]};});_0x28a29c[_0x398d('0x3c')]=_[_0x398d('0x36')](_0x22ef44,'name');_0x28a29c[_0x398d('0x3d')]=_[_0x398d('0x3e')](_0x46cba3[_0x398d('0x3d')]);_0x28a29c[_0x398d('0x3f')]=_[_0x398d('0x40')](_0x28a29c['model'],_0x28a29c[_0x398d('0x3d')]);_0x1b90e5[_0x398d('0x41')]=_['intersection'](_0x28a29c[_0x398d('0x3c')],qs['fields'](_0x46cba3[_0x398d('0x3d')][_0x398d('0x42')]));_0x1b90e5[_0x398d('0x41')]=_0x1b90e5[_0x398d('0x41')][_0x398d('0x43')]?_0x1b90e5['attributes']:_0x28a29c[_0x398d('0x3c')];if(!_0x46cba3[_0x398d('0x3d')][_0x398d('0x44')](_0x398d('0x45'))){_0x1b90e5['limit']=qs[_0x398d('0x25')](_0x46cba3[_0x398d('0x3d')][_0x398d('0x25')]);_0x1b90e5[_0x398d('0x23')]=qs['offset'](_0x46cba3[_0x398d('0x3d')][_0x398d('0x23')]);}_0x1b90e5['order']=qs[_0x398d('0x46')](_0x46cba3[_0x398d('0x3d')][_0x398d('0x46')]);_0x1b90e5[_0x398d('0x47')]=qs[_0x398d('0x3f')](_[_0x398d('0x48')](_0x46cba3[_0x398d('0x3d')],_0x28a29c['filters']),_0x22ef44);if(_0x46cba3[_0x398d('0x3d')][_0x398d('0x49')]){_0x1b90e5[_0x398d('0x47')]=_['merge'](_0x1b90e5[_0x398d('0x47')],{'$or':_[_0x398d('0x36')](_0x22ef44,function(_0x43bb72){if(_0x43bb72['type']!==_0x398d('0x4a')){var _0x4d9e38={};_0x4d9e38[_0x43bb72[_0x398d('0x34')]]={'$like':'%'+_0x46cba3['query'][_0x398d('0x49')]+'%'};return _0x4d9e38;}})});}_0x1b90e5=_[_0x398d('0x4b')]({},_0x1b90e5,_0x46cba3[_0x398d('0x4c')]);var _0x30321e={'where':_0x1b90e5[_0x398d('0x47')]};return db['WhatsappQueue'][_0x398d('0x26')](_0x30321e)['then'](function(_0x4cf061){_0x14a6c2[_0x398d('0x26')]=_0x4cf061;if(_0x46cba3['query']['includeAll']){_0x1b90e5[_0x398d('0x4d')]=[{'all':!![]}];}return db[_0x398d('0x37')][_0x398d('0x4e')](_0x1b90e5);})[_0x398d('0x2c')](function(_0x5db6b2){_0x14a6c2[_0x398d('0x4f')]=_0x5db6b2;return _0x14a6c2;})[_0x398d('0x2c')](respondWithFilteredResult(_0x2a69d4,_0x1b90e5))[_0x398d('0x50')](handleError(_0x2a69d4,null));};exports[_0x398d('0x51')]=function(_0x48a1e4,_0x4a2999){var _0x66eb1={'raw':!![],'where':{'id':_0x48a1e4[_0x398d('0x52')]['id']}},_0x387c7b={};_0x387c7b[_0x398d('0x3c')]=_[_0x398d('0x3e')](db['WhatsappQueue'][_0x398d('0x38')]);_0x387c7b[_0x398d('0x3d')]=_[_0x398d('0x3e')](_0x48a1e4[_0x398d('0x3d')]);_0x387c7b[_0x398d('0x3f')]=_[_0x398d('0x40')](_0x387c7b[_0x398d('0x3c')],_0x387c7b[_0x398d('0x3d')]);_0x66eb1[_0x398d('0x41')]=_[_0x398d('0x40')](_0x387c7b[_0x398d('0x3c')],qs[_0x398d('0x42')](_0x48a1e4[_0x398d('0x3d')][_0x398d('0x42')]));_0x66eb1[_0x398d('0x41')]=_0x66eb1['attributes'][_0x398d('0x43')]?_0x66eb1[_0x398d('0x41')]:_0x387c7b[_0x398d('0x3c')];if(_0x48a1e4[_0x398d('0x3d')][_0x398d('0x53')]){_0x66eb1[_0x398d('0x4d')]=[{'all':!![]}];}_0x66eb1=_[_0x398d('0x4b')]({},_0x66eb1,_0x48a1e4[_0x398d('0x4c')]);return db[_0x398d('0x37')]['find'](_0x66eb1)[_0x398d('0x2c')](handleEntityNotFound(_0x4a2999,null))[_0x398d('0x2c')](respondWithResult(_0x4a2999,null))[_0x398d('0x50')](handleError(_0x4a2999,null));};exports['create']=function(_0x2c4728,_0x4b56b6){return db[_0x398d('0x37')]['create'](_0x2c4728[_0x398d('0x54')],{})['then'](function(_0x505eee){var _0x3233ec=_0x2c4728[_0x398d('0x55')][_0x398d('0x2d')]({'plain':!![]});if(!_0x3233ec)throw new Error(_0x398d('0x56'));if(_0x3233ec[_0x398d('0x57')]===_0x398d('0x55')){var _0x15b0e0=_0x505eee['get']({'plain':!![]});var _0xcbf686=_0x398d('0x2e');return db[_0x398d('0x58')]['find']({'where':{'name':_0xcbf686,'userProfileId':_0x3233ec[_0x398d('0x59')]},'raw':!![]})['then'](function(_0x2c4fb8){if(_0x2c4fb8&&_0x2c4fb8[_0x398d('0x5a')]===0x0){return db[_0x398d('0x2f')]['create']({'name':_0x15b0e0['name'],'resourceId':_0x15b0e0['id'],'type':_0x2c4fb8['name'],'sectionId':_0x2c4fb8['id']},{})[_0x398d('0x2c')](function(){return _0x505eee;});}else{return _0x505eee;}})[_0x398d('0x50')](function(_0x4c7c3a){logger['error'](_0x398d('0x5b'),_0x4c7c3a);throw _0x4c7c3a;});}return _0x505eee;})[_0x398d('0x2c')](respondWithResult(_0x4b56b6,0xc9))['catch'](handleError(_0x4b56b6,null));};exports[_0x398d('0x2b')]=function(_0x1efc8b,_0xc374cf){if(_0x1efc8b['body']['id']){delete _0x1efc8b[_0x398d('0x54')]['id'];}return db[_0x398d('0x37')][_0x398d('0x5c')]({'where':{'id':_0x1efc8b[_0x398d('0x52')]['id']}})[_0x398d('0x2c')](handleEntityNotFound(_0xc374cf,null))[_0x398d('0x2c')](saveUpdates(_0x1efc8b['body'],null))[_0x398d('0x2c')](respondWithResult(_0xc374cf,null))[_0x398d('0x50')](handleError(_0xc374cf,null));};exports['destroy']=function(_0x33106f,_0x47db75){return db[_0x398d('0x37')]['find']({'where':{'id':_0x33106f[_0x398d('0x52')]['id']}})[_0x398d('0x2c')](handleEntityNotFound(_0x47db75,null))[_0x398d('0x2c')](removeEntity(_0x47db75,null))[_0x398d('0x50')](handleError(_0x47db75,null));};exports[_0x398d('0x5d')]=function(_0x18c755,_0x46e965){return db['WhatsappQueue'][_0x398d('0x5d')]()[_0x398d('0x2c')](respondWithResult(_0x46e965,null))[_0x398d('0x50')](handleError(_0x46e965,null));};exports['getMembers']=function(_0xd62919,_0x3f0392,_0x52e69c){var _0x1e4763={'raw':!![],'where':{}},_0x41347f={},_0x133283;return db[_0x398d('0x37')][_0x398d('0x5e')]({'where':{'id':_0xd62919[_0x398d('0x52')]['id']}})[_0x398d('0x2c')](handleEntityNotFound(_0x3f0392,null))[_0x398d('0x2c')](function(_0x21bee8){if(_0x21bee8){_0x133283=_0x21bee8['get']({'plain':!![]});_0x41347f[_0x398d('0x3c')]=_[_0x398d('0x3e')](db[_0x398d('0x5f')][_0x398d('0x38')]);_0x41347f[_0x398d('0x3d')]=_[_0x398d('0x3e')](_0xd62919[_0x398d('0x3d')]);_0x41347f[_0x398d('0x3f')]=_['intersection'](_0x41347f[_0x398d('0x3c')],_0x41347f['query']);_0x1e4763[_0x398d('0x41')]=_['intersection'](_0x41347f['model'],qs[_0x398d('0x42')](_0xd62919[_0x398d('0x3d')][_0x398d('0x42')]));_0x1e4763[_0x398d('0x41')]=_0x1e4763[_0x398d('0x41')]['length']?_0x1e4763['attributes']:_0x41347f[_0x398d('0x3c')];if(!_0xd62919['query'][_0x398d('0x44')]('nolimit')){_0x1e4763['limit']=qs[_0x398d('0x25')](_0xd62919[_0x398d('0x3d')]['limit']);_0x1e4763[_0x398d('0x23')]=qs[_0x398d('0x23')](_0xd62919[_0x398d('0x3d')][_0x398d('0x23')]);}_0x1e4763[_0x398d('0x60')]=qs[_0x398d('0x46')](_0xd62919[_0x398d('0x3d')][_0x398d('0x46')]);_0x1e4763[_0x398d('0x47')]=qs[_0x398d('0x3f')](_['pick'](_0xd62919[_0x398d('0x3d')],_0x41347f['filters']));_0x1e4763[_0x398d('0x47')][_0x398d('0x61')]=_0x21bee8['id'];if(_0xd62919[_0x398d('0x3d')][_0x398d('0x49')]){_0x1e4763[_0x398d('0x47')]=_[_0x398d('0x4b')](_0x1e4763['where'],{'$or':_[_0x398d('0x36')](_0x1e4763[_0x398d('0x41')],function(_0x580581){var _0x1ac7ba={};_0x1ac7ba[_0x580581]={'$like':'%'+_0xd62919['query']['filter']+'%'};return _0x1ac7ba;})});}_0x1e4763=_['merge']({},_0x1e4763,_0xd62919[_0x398d('0x4c')]);return db[_0x398d('0x5f')]['findAll'](_0x1e4763);}})[_0x398d('0x2c')](function(_0x50bae3){if(_0x50bae3){return db['User'][_0x398d('0x62')]({'where':{'id':_['map'](_0x50bae3,_0x398d('0x63')),'role':_0x398d('0x64')},'attributes':['id',_0x398d('0x34'),_0x398d('0x65'),'updatedAt',_0x398d('0x66')]});}})['then'](function(_0x5d0f7a){if(_0x5d0f7a){return{'count':_0x5d0f7a[_0x398d('0x26')],'rows':_[_0x398d('0x36')](_0x5d0f7a[_0x398d('0x4f')],function(_0x20ded8){return{'membername':_0x20ded8['name'],'UserId':_0x20ded8['id'],'queue_name':_0x133283[_0x398d('0x34')],'WhatsappQueueId':_0x133283['id'],'interface':util['format'](_0x398d('0x67'),_0x398d('0x68'),_0x20ded8[_0x398d('0x34')]),'penalty':0x0,'paused':_0x20ded8[_0x398d('0x65')],'createdAt':_0x20ded8[_0x398d('0x66')],'updatedAt':_0x20ded8[_0x398d('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x398d('0x2c')](respondWithFilteredResult(_0x3f0392,_0x1e4763))[_0x398d('0x50')](handleError(_0x3f0392,null));};exports['getTeams']=function(_0xe12e22,_0x365090,_0x522dd0){var _0x47e9ba={};var _0xdfa500={};var _0x45bcc5;var _0x509b88;return db[_0x398d('0x37')]['findOne']({'where':{'id':_0xe12e22[_0x398d('0x52')]['id']}})[_0x398d('0x2c')](handleEntityNotFound(_0x365090,null))['then'](function(_0x17c818){if(_0x17c818){_0x45bcc5=_0x17c818;_0xdfa500[_0x398d('0x3c')]=_[_0x398d('0x3e')](db[_0x398d('0x6a')][_0x398d('0x38')]);_0xdfa500['query']=_['keys'](_0xe12e22[_0x398d('0x3d')]);_0xdfa500[_0x398d('0x3f')]=_[_0x398d('0x40')](_0xdfa500['model'],_0xdfa500['query']);_0x47e9ba['attributes']=_[_0x398d('0x40')](_0xdfa500[_0x398d('0x3c')],qs[_0x398d('0x42')](_0xe12e22[_0x398d('0x3d')][_0x398d('0x42')]));_0x47e9ba[_0x398d('0x41')]=_0x47e9ba[_0x398d('0x41')]['length']?_0x47e9ba[_0x398d('0x41')]:_0xdfa500[_0x398d('0x3c')];_0x47e9ba['order']=qs[_0x398d('0x46')](_0xe12e22['query']['sort']);_0x47e9ba[_0x398d('0x47')]=qs['filters'](_[_0x398d('0x48')](_0xe12e22[_0x398d('0x3d')],_0xdfa500[_0x398d('0x3f')]));if(_0xe12e22[_0x398d('0x3d')][_0x398d('0x49')]){_0x47e9ba[_0x398d('0x47')]=_[_0x398d('0x4b')](_0x47e9ba[_0x398d('0x47')],{'$or':_[_0x398d('0x36')](_0x47e9ba[_0x398d('0x41')],function(_0x55394e){var _0x2e0d38={};_0x2e0d38[_0x55394e]={'$like':'%'+_0xe12e22[_0x398d('0x3d')]['filter']+'%'};return _0x2e0d38;})});}_0x47e9ba=_[_0x398d('0x4b')]({},_0x47e9ba,_0xe12e22[_0x398d('0x4c')]);return _0x45bcc5['getTeams'](_0x47e9ba);}})['then'](function(_0x5bb973){if(_0x5bb973){_0x509b88=_0x5bb973[_0x398d('0x43')];if(!_0xe12e22[_0x398d('0x3d')][_0x398d('0x44')]('nolimit')){_0x47e9ba[_0x398d('0x25')]=qs[_0x398d('0x25')](_0xe12e22[_0x398d('0x3d')][_0x398d('0x25')]);_0x47e9ba[_0x398d('0x23')]=qs[_0x398d('0x23')](_0xe12e22[_0x398d('0x3d')][_0x398d('0x23')]);}return _0x45bcc5[_0x398d('0x6b')](_0x47e9ba);}})[_0x398d('0x2c')](function(_0x2e9a8a){if(_0x2e9a8a){return _0x2e9a8a?{'count':_0x509b88,'rows':_0x2e9a8a}:null;}})[_0x398d('0x2c')](respondWithResult(_0x365090,null))['catch'](handleError(_0x365090,null));};exports['addTeams']=function(_0x3bac7a,_0x30fd7c,_0x2d075c){var _0x1c5ad5=_0x3bac7a[_0x398d('0x54')]['ids'];return db[_0x398d('0x6a')][_0x398d('0x4e')]({'where':{'id':_0x1c5ad5},'attributes':['id'],'include':[{'model':db[_0x398d('0x6c')],'as':_0x398d('0x6d'),'attributes':['id',_0x398d('0x34'),'online','voicePause',_0x398d('0x6e')],'raw':!![]}]})[_0x398d('0x2c')](function(_0x4dec23){if(_0x4dec23){var _0x2169ba=_[_0x398d('0x6f')](_0x4dec23,function(_0x5d880d){var _0x179bf9=_0x5d880d['get']({'plain':!![]});return _0x179bf9[_0x398d('0x6d')];});return db[_0x398d('0x37')]['find']({'where':{'id':_0x3bac7a[_0x398d('0x52')]['id']}})[_0x398d('0x2c')](function(_0xc53fd7){return db[_0x398d('0x70')][_0x398d('0x71')](function(_0x3d16ec){return _0xc53fd7[_0x398d('0x72')](_0x1c5ad5,{'transaction':_0x3d16ec})['then'](function(){return BPromise[_0x398d('0x73')](_0x2169ba,function(_0x49d445){return db[_0x398d('0x5f')][_0x398d('0x74')]({'where':{'UserId':_0x49d445['id'],'WhatsappQueueId':_0x3bac7a[_0x398d('0x52')]['id']},'transaction':_0x3d16ec});});})[_0x398d('0x2c')](function(){_0x2169ba[_0x398d('0x75')](function(_0x472f0f){socket[_0x398d('0x76')](_0x398d('0x77'),{'UserId':_0x472f0f['id'],'WhatsappQueueId':_0xc53fd7['id']});});});});});}})[_0x398d('0x2c')](respondWithStatusCode(_0x30fd7c,null))[_0x398d('0x50')](handleError(_0x30fd7c,null));};exports['removeTeams']=function(_0x165a0e,_0x377121,_0x31a393){return db[_0x398d('0x6a')]['findAll']({'where':{'id':_0x165a0e[_0x398d('0x3d')][_0x398d('0x78')]},'attributes':['id'],'include':[{'model':db[_0x398d('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x398d('0x2c')](handleEntityNotFound(_0x377121,null))[_0x398d('0x2c')](function(_0x26d333){var _0x289036=_[_0x398d('0x36')](_0x26d333,'id');var _0xad2e03=[];var _0x5033d0=[];var _0x884be=squel[_0x398d('0x79')]();_0x884be[_0x398d('0x7a')]('tq.TeamId')[_0x398d('0x7b')]('team_has_whatsapp_queues','tq')[_0x398d('0x7c')](_0x398d('0x7d'),'ut',_0x398d('0x7e'))['where'](_0x398d('0x7f'),_0x165a0e[_0x398d('0x52')]['id']);for(var _0xf6b6c1=0x0;_0xf6b6c1<_0x26d333[_0x398d('0x43')];_0xf6b6c1+=0x1){let _0x420459=_0x26d333[_0xf6b6c1];for(var _0x575a11=0x0;_0x575a11<_0x420459['Agents'][_0x398d('0x43')];_0x575a11+=0x1){let _0x3a86a0=_0x420459[_0x398d('0x6d')][_0x575a11];var _0x24de8d=_0x884be[_0x398d('0x80')]();_0x24de8d[_0x398d('0x47')](_0x398d('0x81'),_0x3a86a0['id']);_0x5033d0[_0x398d('0x82')](db[_0x398d('0x70')][_0x398d('0x3d')](_0x24de8d[_0x398d('0x83')](),{'type':db['sequelize'][_0x398d('0x84')][_0x398d('0x85')]})['then'](function(_0x473fb5){if(_0x473fb5['length']===0x1){return _0x3a86a0['id'];}else{var _0x412566=_[_0x398d('0x86')](_[_0x398d('0x36')](_0x473fb5,_0x398d('0x87')),function(_0x4fe0d0){return _[_0x398d('0x88')](_0x289036,_0x4fe0d0);});if(_0x412566){return _0x3a86a0['id'];}}}));}}return BPromise[_0x398d('0x89')](_0x5033d0)[_0x398d('0x2c')](function(_0x5f40a7){_0xad2e03=_(_0xad2e03)[_0x398d('0x8a')](_0x5f40a7)[_0x398d('0x8b')]()['value']();return db[_0x398d('0x37')][_0x398d('0x5c')]({'where':{'id':_0x165a0e[_0x398d('0x52')]['id']}})[_0x398d('0x2c')](function(_0x1683c2){return db[_0x398d('0x70')][_0x398d('0x71')](function(_0x41805b){return _0x1683c2[_0x398d('0x8c')](_0x165a0e[_0x398d('0x3d')][_0x398d('0x78')],{'transaction':_0x41805b})[_0x398d('0x2c')](function(){if(!_[_0x398d('0x8d')](_0xad2e03)){return _0x1683c2[_0x398d('0x8e')](_0xad2e03,{'transaction':_0x41805b});}})['then'](function(){_0xad2e03['forEach'](function(_0x3cf67f){socket[_0x398d('0x76')](_0x398d('0x8f'),{'UserId':_0x3cf67f,'WhatsappQueueId':_0x1683c2['id']});});});});});});})[_0x398d('0x2c')](respondWithStatusCode(_0x377121,null))[_0x398d('0x50')](handleError(_0x377121,null));};exports['addAgents']=function(_0x5deb0a,_0x416b3e,_0x49b020){return db['WhatsappQueue'][_0x398d('0x5c')]({'where':{'id':_0x5deb0a[_0x398d('0x52')]['id']}})[_0x398d('0x2c')](handleEntityNotFound(_0x416b3e,null))[_0x398d('0x2c')](function(_0x33d148){if(_0x33d148){return _0x33d148['addAgents'](_0x5deb0a['body'][_0x398d('0x78')],_[_0x398d('0x90')](_0x5deb0a['body'],[_0x398d('0x78'),'id'])||{})[_0x398d('0x91')](function(_0xc1e75){for(var _0xbdf7c=0x0;_0xbdf7c<_0x5deb0a[_0x398d('0x54')][_0x398d('0x78')][_0x398d('0x43')];_0xbdf7c+=0x1){socket[_0x398d('0x76')](_0x398d('0x77'),{'UserId':Number(_0x5deb0a[_0x398d('0x54')][_0x398d('0x78')][_0xbdf7c]),'WhatsappQueueId':Number(_0x5deb0a[_0x398d('0x52')]['id'])});}return _0xc1e75;});}})[_0x398d('0x2c')](respondWithResult(_0x416b3e,null))[_0x398d('0x50')](handleError(_0x416b3e,null));};exports[_0x398d('0x8e')]=function(_0x5e3b0d,_0x14d281,_0x24d1b5){return db[_0x398d('0x37')][_0x398d('0x5c')]({'where':{'id':_0x5e3b0d[_0x398d('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d281,null))['then'](function(_0xe177d0){if(_0xe177d0){return _0xe177d0[_0x398d('0x8e')](_0x5e3b0d[_0x398d('0x3d')][_0x398d('0x78')])[_0x398d('0x2c')](function(){if(_['isArray'](_0x5e3b0d[_0x398d('0x3d')]['ids'])){for(var _0x261602=0x0;_0x261602<_0x5e3b0d[_0x398d('0x3d')][_0x398d('0x78')][_0x398d('0x43')];_0x261602+=0x1){socket[_0x398d('0x76')](_0x398d('0x8f'),{'UserId':Number(_0x5e3b0d['query']['ids'][_0x261602]),'WhatsappQueueId':Number(_0x5e3b0d[_0x398d('0x52')]['id'])});}}else{socket[_0x398d('0x76')](_0x398d('0x8f'),{'UserId':Number(_0x5e3b0d[_0x398d('0x3d')][_0x398d('0x78')]),'WhatsappQueueId':Number(_0x5e3b0d['params']['id'])});}});}})[_0x398d('0x2c')](respondWithStatusCode(_0x14d281,null))['catch'](handleError(_0x14d281,null));};exports['getAgents']=function(_0x555814,_0x331204,_0x543cf8){var _0x11c431={};var _0xa65fdb={};var _0x1ab74b;var _0x131ef1;return db[_0x398d('0x37')][_0x398d('0x5e')]({'where':{'id':_0x555814[_0x398d('0x52')]['id']}})[_0x398d('0x2c')](handleEntityNotFound(_0x331204,null))['then'](function(_0x4dce51){if(_0x4dce51){_0x1ab74b=_0x4dce51;_0xa65fdb['model']=_[_0x398d('0x3e')](db[_0x398d('0x6c')][_0x398d('0x38')]);_0xa65fdb[_0x398d('0x3d')]=_[_0x398d('0x3e')](_0x555814['query']);_0xa65fdb[_0x398d('0x3f')]=_['intersection'](_0xa65fdb[_0x398d('0x3c')],_0xa65fdb[_0x398d('0x3d')]);_0x11c431[_0x398d('0x41')]=_[_0x398d('0x40')](_0xa65fdb['model'],qs[_0x398d('0x42')](_0x555814[_0x398d('0x3d')]['fields']));_0x11c431['attributes']=_0x11c431['attributes'][_0x398d('0x43')]?_0x11c431[_0x398d('0x41')]:_0xa65fdb[_0x398d('0x3c')];_0x11c431['order']=qs[_0x398d('0x46')](_0x555814['query'][_0x398d('0x46')]);_0x11c431[_0x398d('0x47')]=qs[_0x398d('0x3f')](_['pick'](_0x555814['query'],_0xa65fdb[_0x398d('0x3f')]));if(_0x555814[_0x398d('0x3d')]['filter']){_0x11c431[_0x398d('0x47')]=_['merge'](_0x11c431[_0x398d('0x47')],{'$or':_[_0x398d('0x36')](_0x11c431[_0x398d('0x41')],function(_0x2eb0db){var _0x3d0844={};_0x3d0844[_0x2eb0db]={'$like':'%'+_0x555814[_0x398d('0x3d')][_0x398d('0x49')]+'%'};return _0x3d0844;})});}_0x11c431=_[_0x398d('0x4b')]({},_0x11c431,_0x555814[_0x398d('0x4c')]);return _0x1ab74b['getAgents'](_0x11c431);}})[_0x398d('0x2c')](function(_0x409b99){if(_0x409b99){_0x131ef1=_0x409b99[_0x398d('0x43')];if(!_0x555814[_0x398d('0x3d')][_0x398d('0x44')]('nolimit')){_0x11c431[_0x398d('0x25')]=qs[_0x398d('0x25')](_0x555814['query']['limit']);_0x11c431[_0x398d('0x23')]=qs[_0x398d('0x23')](_0x555814[_0x398d('0x3d')][_0x398d('0x23')]);}return _0x1ab74b[_0x398d('0x92')](_0x11c431);}})['then'](function(_0xef69df){if(_0xef69df){return _0xef69df?{'count':_0x131ef1,'rows':_0xef69df}:null;}})['then'](respondWithResult(_0x331204,null))[_0x398d('0x50')](handleError(_0x331204,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 4022803..f0eaff3 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 _0x0c91=['update','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','save'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0c91,0x18c));var _0x10c9=function(_0x5eb079,_0x358d5e){_0x5eb079=_0x5eb079-0x0;var _0x421392=_0x0c91[_0x5eb079];return _0x421392;};'use strict';var EventEmitter=require(_0x10c9('0x0'));var WhatsappQueue=require(_0x10c9('0x1'))['db'][_0x10c9('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x10c9('0x3'),'afterUpdate':_0x10c9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x286410){return function(_0x5da431,_0x4aff51,_0x2db4ff){WhatsappQueueEvents[_0x10c9('0x5')](_0x286410+':'+_0x5da431['id'],_0x5da431);WhatsappQueueEvents[_0x10c9('0x5')](_0x286410,_0x5da431);_0x2db4ff(null);};}for(var e in events){if(events[_0x10c9('0x6')](e)){var event=events[e];WhatsappQueue[_0x10c9('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xf15a=['remove','emit','hasOwnProperty','exports','events','WhatsappQueue','setMaxListeners','save','update'];(function(_0x1267b2,_0x2e5c67){var _0x1dcd4d=function(_0x174daf){while(--_0x174daf){_0x1267b2['push'](_0x1267b2['shift']());}};_0x1dcd4d(++_0x2e5c67);}(_0xf15a,0x15a));var _0xaf15=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf15a[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xaf15('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xaf15('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xaf15('0x2')](0x0);var events={'afterCreate':_0xaf15('0x3'),'afterUpdate':_0xaf15('0x4'),'afterDestroy':_0xaf15('0x5')};function emitEvent(_0x4c78d3){return function(_0x19a3d5,_0x4cae84,_0x5e10df){WhatsappQueueEvents[_0xaf15('0x6')](_0x4c78d3+':'+_0x19a3d5['id'],_0x19a3d5);WhatsappQueueEvents[_0xaf15('0x6')](_0x4c78d3,_0x19a3d5);_0x5e10df(null);};}for(var e in events){if(events[_0xaf15('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xaf15('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 de83615..c800884 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 _0xd6c3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues'];(function(_0x456ad1,_0x55209b){var _0x5da9a4=function(_0x4110a0){while(--_0x4110a0){_0x456ad1['push'](_0x456ad1['shift']());}};_0x5da9a4(++_0x55209b);}(_0xd6c3,0x142));var _0x3d6c=function(_0x12f80c,_0x22233b){_0x12f80c=_0x12f80c-0x0;var _0x482780=_0xd6c3[_0x12f80c];return _0x482780;};'use strict';var _=require(_0x3d6c('0x0'));var util=require(_0x3d6c('0x1'));var logger=require(_0x3d6c('0x2'))(_0x3d6c('0x3'));var moment=require(_0x3d6c('0x4'));var BPromise=require(_0x3d6c('0x5'));var rp=require(_0x3d6c('0x6'));var fs=require('fs');var path=require(_0x3d6c('0x7'));var rimraf=require(_0x3d6c('0x8'));var config=require(_0x3d6c('0x9'));var attributes=require(_0x3d6c('0xa'));module['exports']=function(_0x7e3a3a,_0x1ed28c){return _0x7e3a3a[_0x3d6c('0xb')](_0x3d6c('0xc'),attributes,{'tableName':_0x3d6c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5953=['request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0xee4d22,_0x27f86c){var _0xa77379=function(_0x27dae6){while(--_0x27dae6){_0xee4d22['push'](_0xee4d22['shift']());}};_0xa77379(++_0x27f86c);}(_0x5953,0x121));var _0x3595=function(_0xebbc39,_0x427a35){_0xebbc39=_0xebbc39-0x0;var _0x5892df=_0x5953[_0xebbc39];return _0x5892df;};'use strict';var _=require(_0x3595('0x0'));var util=require(_0x3595('0x1'));var logger=require(_0x3595('0x2'))(_0x3595('0x3'));var moment=require('moment');var BPromise=require(_0x3595('0x4'));var rp=require(_0x3595('0x5'));var fs=require('fs');var path=require(_0x3595('0x6'));var rimraf=require(_0x3595('0x7'));var config=require(_0x3595('0x8'));var attributes=require(_0x3595('0x9'));module[_0x3595('0xa')]=function(_0x46e78a,_0x323dd2){return _0x46e78a[_0x3595('0xb')](_0x3595('0xc'),attributes,{'tableName':_0x3595('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 8dc7c6e..0d27045 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 _0x529e=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','GetWhatsappQueue','raw','options','where','attributes','limit','include','map','model','catch','ShowWhatsappQueue','WhatsappQueue','find','util','moment','bluebird'];(function(_0x3c94df,_0x522b16){var _0xd68f4b=function(_0x2834fd){while(--_0x2834fd){_0x3c94df['push'](_0x3c94df['shift']());}};_0xd68f4b(++_0x522b16);}(_0x529e,0x11d));var _0xe529=function(_0x2e950c,_0x361f27){_0x2e950c=_0x2e950c-0x0;var _0x17fc61=_0x529e[_0x2e950c];return _0x17fc61;};'use strict';var _=require('lodash');var util=require(_0xe529('0x0'));var moment=require(_0xe529('0x1'));var BPromise=require(_0xe529('0x2'));var rs=require(_0xe529('0x3'));var fs=require('fs');var Redis=require(_0xe529('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe529('0x5'));var logger=require('../../config/logger')(_0xe529('0x6'));var config=require(_0xe529('0x7'));var jayson=require(_0xe529('0x8'));var client=jayson['client'][_0xe529('0x9')]({'port':0x232a});config[_0xe529('0xa')]=_['defaults'](config[_0xe529('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe529('0xa')]));require(_0xe529('0xb'))[_0xe529('0xc')](socket);function respondWithRpcPromise(_0x29c8d8,_0x8a236f,_0x41ff99){return new BPromise(function(_0x1e20f3,_0x363cab){return client[_0xe529('0xd')](_0x29c8d8,_0x41ff99)[_0xe529('0xe')](function(_0x13081f){logger['info'](_0xe529('0xf'),_0x8a236f,'request\x20sent');logger[_0xe529('0x10')](_0xe529('0x11'),_0x8a236f,_0xe529('0x12'),JSON[_0xe529('0x13')](_0x13081f));if(_0x13081f[_0xe529('0x14')]){if(_0x13081f[_0xe529('0x14')]['code']===0x1f4){logger[_0xe529('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x8a236f,_0x13081f['error']['message']);return _0x363cab(_0x13081f[_0xe529('0x14')][_0xe529('0x15')]);}logger['error'](_0xe529('0xf'),_0x8a236f,_0x13081f[_0xe529('0x14')][_0xe529('0x15')]);return _0x1e20f3(_0x13081f['error'][_0xe529('0x15')]);}else{logger[_0xe529('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x8a236f,_0xe529('0x12'));_0x1e20f3(_0x13081f['result'][_0xe529('0x15')]);}})['catch'](function(_0x4ad6e8){logger[_0xe529('0x14')](_0xe529('0xf'),_0x8a236f,_0x4ad6e8);_0x363cab(_0x4ad6e8);});});}exports[_0xe529('0x17')]=function(_0x12474f){var _0x11b296=this;return new Promise(function(_0x5a373d,_0x43bd36){return db['WhatsappQueue']['findAll']({'raw':_0x12474f['options']?_0x12474f['options'][_0xe529('0x18')]===undefined?!![]:![]:!![],'where':_0x12474f['options']?_0x12474f[_0xe529('0x19')][_0xe529('0x1a')]||null:null,'attributes':_0x12474f[_0xe529('0x19')]?_0x12474f[_0xe529('0x19')][_0xe529('0x1b')]||null:null,'limit':_0x12474f[_0xe529('0x19')]?_0x12474f['options'][_0xe529('0x1c')]||null:null,'include':_0x12474f[_0xe529('0x19')]?_0x12474f['options'][_0xe529('0x1d')]?_[_0xe529('0x1e')](_0x12474f[_0xe529('0x19')][_0xe529('0x1d')],function(_0x4848aa){return{'model':db[_0x4848aa[_0xe529('0x1f')]],'as':_0x4848aa['as'],'attributes':_0x4848aa[_0xe529('0x1b')],'include':_0x4848aa[_0xe529('0x1d')]?_[_0xe529('0x1e')](_0x4848aa['include'],function(_0x4edb5f){return{'model':db[_0x4edb5f[_0xe529('0x1f')]],'as':_0x4edb5f['as'],'attributes':_0x4edb5f[_0xe529('0x1b')],'include':_0x4edb5f[_0xe529('0x1d')]?_[_0xe529('0x1e')](_0x4edb5f[_0xe529('0x1d')],function(_0x474093){return{'model':db[_0x474093[_0xe529('0x1f')]],'as':_0x474093['as'],'attributes':_0x474093[_0xe529('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe529('0xe')](function(_0x546d8f){logger['info'](_0xe529('0x17'),_0x12474f);logger[_0xe529('0x10')]('GetWhatsappQueue',_0x12474f,JSON['stringify'](_0x546d8f));_0x5a373d(_0x546d8f);})[_0xe529('0x20')](function(_0x3a51a0){logger[_0xe529('0x14')](_0xe529('0x17'),_0x3a51a0[_0xe529('0x15')],_0x12474f);_0x43bd36(_0x11b296[_0xe529('0x14')](0x1f4,_0x3a51a0['message']));});});};exports[_0xe529('0x21')]=function(_0x9b0ba3){var _0x3d0135=this;return new Promise(function(_0x4b3245,_0x50477d){return db[_0xe529('0x22')][_0xe529('0x23')]({'raw':_0x9b0ba3['options']?_0x9b0ba3['options']['raw']===undefined?!![]:![]:!![],'where':_0x9b0ba3[_0xe529('0x19')]?_0x9b0ba3['options'][_0xe529('0x1a')]||null:null,'attributes':_0x9b0ba3[_0xe529('0x19')]?_0x9b0ba3[_0xe529('0x19')][_0xe529('0x1b')]||null:null,'include':_0x9b0ba3['options']?_0x9b0ba3[_0xe529('0x19')][_0xe529('0x1d')]?_[_0xe529('0x1e')](_0x9b0ba3['options']['include'],function(_0x4f4777){return{'model':db[_0x4f4777[_0xe529('0x1f')]],'as':_0x4f4777['as'],'attributes':_0x4f4777[_0xe529('0x1b')],'include':_0x4f4777['include']?_[_0xe529('0x1e')](_0x4f4777[_0xe529('0x1d')],function(_0x25b3ed){return{'model':db[_0x25b3ed[_0xe529('0x1f')]],'as':_0x25b3ed['as'],'attributes':_0x25b3ed[_0xe529('0x1b')],'include':_0x25b3ed[_0xe529('0x1d')]?_[_0xe529('0x1e')](_0x25b3ed['include'],function(_0x2cd168){return{'model':db[_0x2cd168[_0xe529('0x1f')]],'as':_0x2cd168['as'],'attributes':_0x2cd168[_0xe529('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe529('0xe')](function(_0x178a61){logger[_0xe529('0x16')](_0xe529('0x21'),_0x9b0ba3);logger[_0xe529('0x10')](_0xe529('0x21'),_0x9b0ba3,JSON['stringify'](_0x178a61));_0x4b3245(_0x178a61);})[_0xe529('0x20')](function(_0x404fdf){logger[_0xe529('0x14')](_0xe529('0x21'),_0x404fdf[_0xe529('0x15')],_0x9b0ba3);_0x50477d(_0x3d0135[_0xe529('0x14')](0x1f4,_0x404fdf['message']));});});}; \ No newline at end of file +var _0x9894=['code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowWhatsappQueue','find','where','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4f76e1,_0x3a18e0){var _0x2f9cf6=function(_0x1b4846){while(--_0x1b4846){_0x4f76e1['push'](_0x4f76e1['shift']());}};_0x2f9cf6(++_0x3a18e0);}(_0x9894,0x68));var _0x4989=function(_0x5ab726,_0x939fca){_0x5ab726=_0x5ab726-0x0;var _0x45b745=_0x9894[_0x5ab726];return _0x45b745;};'use strict';var _=require(_0x4989('0x0'));var util=require(_0x4989('0x1'));var moment=require(_0x4989('0x2'));var BPromise=require(_0x4989('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4989('0x4'))['db'];var utils=require(_0x4989('0x5'));var logger=require(_0x4989('0x6'))(_0x4989('0x7'));var config=require(_0x4989('0x8'));var jayson=require(_0x4989('0x9'));var client=jayson[_0x4989('0xa')][_0x4989('0xb')]({'port':0x232a});config[_0x4989('0xc')]=_[_0x4989('0xd')](config[_0x4989('0xc')],{'host':_0x4989('0xe'),'port':0x18eb});var socket=require(_0x4989('0xf'))(new Redis(config['redis']));require(_0x4989('0x10'))[_0x4989('0x11')](socket);function respondWithRpcPromise(_0x13b5c0,_0x269224,_0xfc3ff6){return new BPromise(function(_0x4055ea,_0x3e9a51){return client[_0x4989('0x12')](_0x13b5c0,_0xfc3ff6)[_0x4989('0x13')](function(_0x44a49d){logger[_0x4989('0x14')](_0x4989('0x15'),_0x269224,_0x4989('0x16'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x269224,'request\x20sent',JSON[_0x4989('0x17')](_0x44a49d));if(_0x44a49d[_0x4989('0x18')]){if(_0x44a49d[_0x4989('0x18')][_0x4989('0x19')]===0x1f4){logger['error'](_0x4989('0x15'),_0x269224,_0x44a49d['error'][_0x4989('0x1a')]);return _0x3e9a51(_0x44a49d['error']['message']);}logger[_0x4989('0x18')](_0x4989('0x15'),_0x269224,_0x44a49d['error'][_0x4989('0x1a')]);return _0x4055ea(_0x44a49d[_0x4989('0x18')][_0x4989('0x1a')]);}else{logger[_0x4989('0x14')](_0x4989('0x15'),_0x269224,_0x4989('0x16'));_0x4055ea(_0x44a49d[_0x4989('0x1b')][_0x4989('0x1a')]);}})[_0x4989('0x1c')](function(_0x32310d){logger[_0x4989('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x269224,_0x32310d);_0x3e9a51(_0x32310d);});});}exports[_0x4989('0x1d')]=function(_0x18526a){var _0x477f44=this;return new Promise(function(_0x133866,_0x321ea6){return db[_0x4989('0x1e')][_0x4989('0x1f')]({'raw':_0x18526a[_0x4989('0x20')]?_0x18526a[_0x4989('0x20')][_0x4989('0x21')]===undefined?!![]:![]:!![],'where':_0x18526a[_0x4989('0x20')]?_0x18526a[_0x4989('0x20')]['where']||null:null,'attributes':_0x18526a[_0x4989('0x20')]?_0x18526a[_0x4989('0x20')][_0x4989('0x22')]||null:null,'limit':_0x18526a[_0x4989('0x20')]?_0x18526a[_0x4989('0x20')][_0x4989('0x23')]||null:null,'include':_0x18526a[_0x4989('0x20')]?_0x18526a[_0x4989('0x20')][_0x4989('0x24')]?_[_0x4989('0x25')](_0x18526a[_0x4989('0x20')][_0x4989('0x24')],function(_0x1a6fb8){return{'model':db[_0x1a6fb8[_0x4989('0x26')]],'as':_0x1a6fb8['as'],'attributes':_0x1a6fb8[_0x4989('0x22')],'include':_0x1a6fb8[_0x4989('0x24')]?_[_0x4989('0x25')](_0x1a6fb8[_0x4989('0x24')],function(_0x58ef93){return{'model':db[_0x58ef93[_0x4989('0x26')]],'as':_0x58ef93['as'],'attributes':_0x58ef93[_0x4989('0x22')],'include':_0x58ef93[_0x4989('0x24')]?_[_0x4989('0x25')](_0x58ef93[_0x4989('0x24')],function(_0x371526){return{'model':db[_0x371526[_0x4989('0x26')]],'as':_0x371526['as'],'attributes':_0x371526['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f06c6){logger[_0x4989('0x14')]('GetWhatsappQueue',_0x18526a);logger[_0x4989('0x27')](_0x4989('0x1d'),_0x18526a,JSON[_0x4989('0x17')](_0x1f06c6));_0x133866(_0x1f06c6);})[_0x4989('0x1c')](function(_0x9e6cfb){logger['error'](_0x4989('0x1d'),_0x9e6cfb[_0x4989('0x1a')],_0x18526a);_0x321ea6(_0x477f44[_0x4989('0x18')](0x1f4,_0x9e6cfb['message']));});});};exports[_0x4989('0x28')]=function(_0x4f4676){var _0xe4dd4a=this;return new Promise(function(_0x428a54,_0x32bdee){return db[_0x4989('0x1e')][_0x4989('0x29')]({'raw':_0x4f4676['options']?_0x4f4676['options'][_0x4989('0x21')]===undefined?!![]:![]:!![],'where':_0x4f4676[_0x4989('0x20')]?_0x4f4676['options'][_0x4989('0x2a')]||null:null,'attributes':_0x4f4676['options']?_0x4f4676['options'][_0x4989('0x22')]||null:null,'include':_0x4f4676[_0x4989('0x20')]?_0x4f4676[_0x4989('0x20')][_0x4989('0x24')]?_[_0x4989('0x25')](_0x4f4676[_0x4989('0x20')][_0x4989('0x24')],function(_0x481394){return{'model':db[_0x481394[_0x4989('0x26')]],'as':_0x481394['as'],'attributes':_0x481394[_0x4989('0x22')],'include':_0x481394[_0x4989('0x24')]?_[_0x4989('0x25')](_0x481394['include'],function(_0x45541b){return{'model':db[_0x45541b[_0x4989('0x26')]],'as':_0x45541b['as'],'attributes':_0x45541b[_0x4989('0x22')],'include':_0x45541b[_0x4989('0x24')]?_[_0x4989('0x25')](_0x45541b[_0x4989('0x24')],function(_0x590555){return{'model':db[_0x590555[_0x4989('0x26')]],'as':_0x590555['as'],'attributes':_0x590555[_0x4989('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4989('0x13')](function(_0x55f1ab){logger['info'](_0x4989('0x28'),_0x4f4676);logger[_0x4989('0x27')]('ShowWhatsappQueue',_0x4f4676,JSON[_0x4989('0x17')](_0x55f1ab));_0x428a54(_0x55f1ab);})['catch'](function(_0x2d583f){logger[_0x4989('0x18')](_0x4989('0x28'),_0x2d583f[_0x4989('0x1a')],_0x4f4676);_0x32bdee(_0xe4dd4a['error'](0x1f4,_0x2d583f[_0x4989('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 557dbd5..4a5ec48 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 _0x254d=['emit','register','length','whatsappQueue:','./whatsappQueue.events','save','update'];(function(_0x8eb045,_0x3c8aca){var _0x17e436=function(_0x46ba22){while(--_0x46ba22){_0x8eb045['push'](_0x8eb045['shift']());}};_0x17e436(++_0x3c8aca);}(_0x254d,0x9e));var _0xd254=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x254d[_0x5ec454];return _0x5ebf50;};'use strict';var WhatsappQueueEvents=require(_0xd254('0x0'));var events=[_0xd254('0x1'),'remove',_0xd254('0x2')];function createListener(_0xcf012a,_0x57a620){return function(_0x16d167){_0x57a620[_0xd254('0x3')](_0xcf012a,_0x16d167);};}function removeListener(_0x2dbcf0,_0x4b04ed){return function(){WhatsappQueueEvents['removeListener'](_0x2dbcf0,_0x4b04ed);};}exports[_0xd254('0x4')]=function(_0xea8964){for(var _0x5db125=0x0,_0x1ce014=events[_0xd254('0x5')];_0x5db125<_0x1ce014;_0x5db125++){var _0x348e16=events[_0x5db125];var _0x18e4a7=createListener(_0xd254('0x6')+_0x348e16,_0xea8964);WhatsappQueueEvents['on'](_0x348e16,_0x18e4a7);}}; \ No newline at end of file +var _0x0c74=['whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','register'];(function(_0x32bf30,_0x593c48){var _0x100c8f=function(_0x30d91e){while(--_0x30d91e){_0x32bf30['push'](_0x32bf30['shift']());}};_0x100c8f(++_0x593c48);}(_0x0c74,0xa2));var _0x40c7=function(_0x1e486a,_0x10047e){_0x1e486a=_0x1e486a-0x0;var _0x22d8ca=_0x0c74[_0x1e486a];return _0x22d8ca;};'use strict';var WhatsappQueueEvents=require(_0x40c7('0x0'));var events=[_0x40c7('0x1'),_0x40c7('0x2'),_0x40c7('0x3')];function createListener(_0x34462e,_0x262f39){return function(_0x1c91c1){_0x262f39[_0x40c7('0x4')](_0x34462e,_0x1c91c1);};}function removeListener(_0x258df7,_0x92423b){return function(){WhatsappQueueEvents['removeListener'](_0x258df7,_0x92423b);};}exports[_0x40c7('0x5')]=function(_0x1356c9){for(var _0x5966ba=0x0,_0x13f268=events['length'];_0x5966ba<_0x13f268;_0x5966ba++){var _0x1dd82d=events[_0x5966ba];var _0x1e7256=createListener(_0x40c7('0x6')+_0x1dd82d,_0x1356c9);WhatsappQueueEvents['on'](_0x1dd82d,_0x1e7256);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 102d977..42d1f38 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 _0xe844=['post','create','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x26ee05,_0x4ca2cf){var _0x4df30b=function(_0x2128d3){while(--_0x2128d3){_0x26ee05['push'](_0x26ee05['shift']());}};_0x4df30b(++_0x4ca2cf);}(_0xe844,0xba));var _0x4e84=function(_0x1e6d05,_0x3acd75){_0x1e6d05=_0x1e6d05-0x0;var _0x405b4e=_0xe844[_0x1e6d05];return _0x405b4e;};'use strict';var multer=require(_0x4e84('0x0'));var util=require(_0x4e84('0x1'));var path=require(_0x4e84('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e84('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e84('0x4'));var interaction=require(_0x4e84('0x5'));var config=require(_0x4e84('0x6'));var controller=require(_0x4e84('0x7'));router['get']('/',auth[_0x4e84('0x8')](),controller[_0x4e84('0x9')]);router[_0x4e84('0xa')](_0x4e84('0xb'),auth[_0x4e84('0x8')](),controller[_0x4e84('0xc')]);router[_0x4e84('0xa')](_0x4e84('0xd'),auth[_0x4e84('0x8')](),controller['show']);router[_0x4e84('0xe')]('/',auth[_0x4e84('0x8')](),controller[_0x4e84('0xf')]);router[_0x4e84('0x10')]('/:id',auth[_0x4e84('0x8')](),controller[_0x4e84('0x11')]);router[_0x4e84('0x12')](_0x4e84('0xd'),auth[_0x4e84('0x8')](),controller[_0x4e84('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf2d7=['exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy'];(function(_0x4c746e,_0x113d7b){var _0x547efd=function(_0x1f2bb3){while(--_0x1f2bb3){_0x4c746e['push'](_0x4c746e['shift']());}};_0x547efd(++_0x113d7b);}(_0xf2d7,0x157));var _0x7f2d=function(_0x30c57f,_0x4e26ca){_0x30c57f=_0x30c57f-0x0;var _0x570756=_0xf2d7[_0x30c57f];return _0x570756;};'use strict';var multer=require(_0x7f2d('0x0'));var util=require(_0x7f2d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7f2d('0x2')]();var fs_extra=require(_0x7f2d('0x3'));var auth=require(_0x7f2d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7f2d('0x5'));var controller=require(_0x7f2d('0x6'));router[_0x7f2d('0x7')]('/',auth[_0x7f2d('0x8')](),controller[_0x7f2d('0x9')]);router['get'](_0x7f2d('0xa'),auth[_0x7f2d('0x8')](),controller['describe']);router[_0x7f2d('0x7')](_0x7f2d('0xb'),auth[_0x7f2d('0x8')](),controller[_0x7f2d('0xc')]);router[_0x7f2d('0xd')]('/',auth[_0x7f2d('0x8')](),controller['create']);router[_0x7f2d('0xe')](_0x7f2d('0xb'),auth[_0x7f2d('0x8')](),controller[_0x7f2d('0xf')]);router[_0x7f2d('0x10')](_0x7f2d('0xb'),auth[_0x7f2d('0x8')](),controller[_0x7f2d('0x11')]);module[_0x7f2d('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 221c327..39b5eec 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(_0x381ba1,_0x107cc5){var _0x47bcf0=function(_0x592846){while(--_0x592846){_0x381ba1['push'](_0x381ba1['shift']());}};_0x47bcf0(++_0x107cc5);}(_0x7a54,0x106));var _0x47a5=function(_0x5663f6,_0x479748){_0x5663f6=_0x5663f6-0x0;var _0x1589d5=_0x7a54[_0x5663f6];return _0x1589d5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x26e69e,_0x3c640f){var _0x248bb3=function(_0x374ea){while(--_0x374ea){_0x26e69e['push'](_0x26e69e['shift']());}};_0x248bb3(++_0x3c640f);}(_0x7a54,0x106));var _0x47a5=function(_0x2c7774,_0x3884d9){_0x2c7774=_0x2c7774-0x0;var _0x4dd683=_0x7a54[_0x2c7774];return _0x4dd683;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index c0b337b..4ff212e 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 _0x13f6=['catch','params','rawAttributes','intersection','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x13f6,0x124));var _0x613f=function(_0x251fa9,_0x458b2e){_0x251fa9=_0x251fa9-0x0;var _0x49b60d=_0x13f6[_0x251fa9];return _0x49b60d;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x542230,_0x4c2a85){_0x4c2a85=_0x4c2a85||0xcc;return function(_0x517f57){if(_0x517f57){return _0x542230[_0x613f('0x16')](_0x4c2a85);}return _0x542230[_0x613f('0x17')](_0x4c2a85)[_0x613f('0x18')]();};}function respondWithResult(_0x375db1,_0x329fcf){_0x329fcf=_0x329fcf||0xc8;return function(_0x4a6fc){if(_0x4a6fc){return _0x375db1[_0x613f('0x17')](_0x329fcf)[_0x613f('0x19')](_0x4a6fc);}};}function respondWithFilteredResult(_0x2eee4d,_0x1d68fd){return function(_0x548218){if(_0x548218){var _0x3c9edf=typeof _0x1d68fd['offset']==='undefined'&&typeof _0x1d68fd[_0x613f('0x1a')]===_0x613f('0x1b');var _0x544eca=_0x548218[_0x613f('0x1c')];var _0x4f9dae=_0x3c9edf?0x0:_0x1d68fd[_0x613f('0x1d')];var _0x1e5a11=_0x3c9edf?_0x548218[_0x613f('0x1c')]:_0x1d68fd[_0x613f('0x1d')]+_0x1d68fd[_0x613f('0x1a')];var _0x1ba35f;if(_0x1e5a11>=_0x544eca){_0x1e5a11=_0x544eca;_0x1ba35f=0xc8;}else{_0x1ba35f=0xce;}_0x2eee4d['status'](_0x1ba35f);return _0x2eee4d['set'](_0x613f('0x1e'),_0x4f9dae+'-'+_0x1e5a11+'/'+_0x544eca)['json'](_0x548218);}return null;};}function patchUpdates(_0x48493c){return function(_0x3c9b58){try{jsonpatch[_0x613f('0x1f')](_0x3c9b58,_0x48493c,!![]);}catch(_0x4f5a5a){return BPromise[_0x613f('0x20')](_0x4f5a5a);}return _0x3c9b58[_0x613f('0x21')]();};}function saveUpdates(_0x2aa14b,_0x48b28a){return function(_0x5401c2){if(_0x5401c2){return _0x5401c2[_0x613f('0x22')](_0x2aa14b)[_0x613f('0x23')](function(_0x2acfcf){return _0x2acfcf;});}return null;};}function removeEntity(_0x51f376,_0x41104e){return function(_0x33e0c6){if(_0x33e0c6){return _0x33e0c6[_0x613f('0x24')]()[_0x613f('0x23')](function(){_0x51f376[_0x613f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fb15,_0x204185){return function(_0x51bba1){if(!_0x51bba1){_0x30fb15[_0x613f('0x16')](0x194);}return _0x51bba1;};}function handleError(_0x5d4ff6,_0x32e747){_0x32e747=_0x32e747||0x1f4;return function(_0x4a878d){logger['error'](_0x4a878d['stack']);if(_0x4a878d[_0x613f('0x25')]){delete _0x4a878d['name'];}_0x5d4ff6[_0x613f('0x17')](_0x32e747)[_0x613f('0x26')](_0x4a878d);};}exports['index']=function(_0x121241,_0x2551c1){var _0x4c8aa1={},_0x4cff5d={},_0x4f892d={'count':0x0,'rows':[]};var _0x24be7c=_[_0x613f('0x27')](db[_0x613f('0x28')]['rawAttributes'],function(_0x23eda8){return{'name':_0x23eda8[_0x613f('0x29')],'type':_0x23eda8[_0x613f('0x2a')][_0x613f('0x2b')]};});_0x4cff5d['model']=_[_0x613f('0x27')](_0x24be7c,_0x613f('0x25'));_0x4cff5d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x121241[_0x613f('0x2c')]);_0x4cff5d[_0x613f('0x2e')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],_0x4cff5d[_0x613f('0x2c')]);_0x4c8aa1[_0x613f('0x30')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],qs['fields'](_0x121241[_0x613f('0x2c')][_0x613f('0x31')]));_0x4c8aa1[_0x613f('0x30')]=_0x4c8aa1[_0x613f('0x30')][_0x613f('0x32')]?_0x4c8aa1[_0x613f('0x30')]:_0x4cff5d['model'];if(!_0x121241[_0x613f('0x2c')][_0x613f('0x33')](_0x613f('0x34'))){_0x4c8aa1[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x121241['query']['limit']);_0x4c8aa1['offset']=qs[_0x613f('0x1d')](_0x121241[_0x613f('0x2c')][_0x613f('0x1d')]);}_0x4c8aa1[_0x613f('0x35')]=qs['sort'](_0x121241[_0x613f('0x2c')][_0x613f('0x36')]);_0x4c8aa1['where']=qs[_0x613f('0x2e')](_['pick'](_0x121241[_0x613f('0x2c')],_0x4cff5d['filters']),_0x24be7c);if(_0x121241[_0x613f('0x2c')]['filter']){_0x4c8aa1[_0x613f('0x37')]=_[_0x613f('0x38')](_0x4c8aa1[_0x613f('0x37')],{'$or':_['map'](_0x24be7c,function(_0x36eaa0){if(_0x36eaa0[_0x613f('0x2a')]!==_0x613f('0x39')){var _0x2fb3a6={};_0x2fb3a6[_0x36eaa0[_0x613f('0x25')]]={'$like':'%'+_0x121241[_0x613f('0x2c')][_0x613f('0x3a')]+'%'};return _0x2fb3a6;}})});}_0x4c8aa1=_[_0x613f('0x38')]({},_0x4c8aa1,_0x121241[_0x613f('0x3b')]);var _0x3313c1={'where':_0x4c8aa1['where']};return db[_0x613f('0x28')][_0x613f('0x1c')](_0x3313c1)[_0x613f('0x23')](function(_0x1e5af0){_0x4f892d[_0x613f('0x1c')]=_0x1e5af0;if(_0x121241[_0x613f('0x2c')][_0x613f('0x3c')]){_0x4c8aa1['include']=[{'all':!![]}];}return db[_0x613f('0x28')][_0x613f('0x3d')](_0x4c8aa1);})[_0x613f('0x23')](function(_0x3d2d7b){_0x4f892d[_0x613f('0x3e')]=_0x3d2d7b;return _0x4f892d;})[_0x613f('0x23')](respondWithFilteredResult(_0x2551c1,_0x4c8aa1))[_0x613f('0x3f')](handleError(_0x2551c1,null));};exports['show']=function(_0x343a59,_0x18f427){var _0x3bb605={'raw':!![],'where':{'id':_0x343a59[_0x613f('0x40')]['id']}},_0x2f584e={};_0x2f584e[_0x613f('0x2f')]=_[_0x613f('0x2d')](db[_0x613f('0x28')][_0x613f('0x41')]);_0x2f584e[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x343a59[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x2e')]=_['intersection'](_0x2f584e[_0x613f('0x2f')],_0x2f584e[_0x613f('0x2c')]);_0x3bb605[_0x613f('0x30')]=_[_0x613f('0x42')](_0x2f584e['model'],qs[_0x613f('0x31')](_0x343a59[_0x613f('0x2c')][_0x613f('0x31')]));_0x3bb605[_0x613f('0x30')]=_0x3bb605[_0x613f('0x30')][_0x613f('0x32')]?_0x3bb605[_0x613f('0x30')]:_0x2f584e[_0x613f('0x2f')];if(_0x343a59[_0x613f('0x2c')][_0x613f('0x3c')]){_0x3bb605['include']=[{'all':!![]}];}_0x3bb605=_['merge']({},_0x3bb605,_0x343a59[_0x613f('0x3b')]);return db[_0x613f('0x28')]['find'](_0x3bb605)[_0x613f('0x23')](handleEntityNotFound(_0x18f427,null))[_0x613f('0x23')](respondWithResult(_0x18f427,null))[_0x613f('0x3f')](handleError(_0x18f427,null));};exports[_0x613f('0x43')]=function(_0x39b8b2,_0x1c0b07){return db[_0x613f('0x28')][_0x613f('0x43')](_0x39b8b2[_0x613f('0x44')],{})[_0x613f('0x23')](respondWithResult(_0x1c0b07,0xc9))[_0x613f('0x3f')](handleError(_0x1c0b07,null));};exports[_0x613f('0x22')]=function(_0x174e22,_0x17f8e5){if(_0x174e22[_0x613f('0x44')]['id']){delete _0x174e22[_0x613f('0x44')]['id'];}return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x174e22['params']['id']}})['then'](handleEntityNotFound(_0x17f8e5,null))[_0x613f('0x23')](saveUpdates(_0x174e22[_0x613f('0x44')],null))['then'](respondWithResult(_0x17f8e5,null))['catch'](handleError(_0x17f8e5,null));};exports[_0x613f('0x24')]=function(_0x51729a,_0x513bf1){return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x51729a[_0x613f('0x40')]['id']}})['then'](handleEntityNotFound(_0x513bf1,null))[_0x613f('0x23')](removeEntity(_0x513bf1,null))[_0x613f('0x3f')](handleError(_0x513bf1,null));};exports['describe']=function(_0x55e878,_0x1c0c8e){return db[_0x613f('0x28')][_0x613f('0x46')]()[_0x613f('0x23')](respondWithResult(_0x1c0c8e,null))[_0x613f('0x3f')](handleError(_0x1c0c8e,null));}; \ No newline at end of file +var _0x1d2d=['options','WhatsappQueueReport','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x3e6333,_0x1317b0){var _0x3ed97b=function(_0x3029ca){while(--_0x3029ca){_0x3e6333['push'](_0x3e6333['shift']());}};_0x3ed97b(++_0x1317b0);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x79b195,_0x51d04c){_0x79b195=_0x79b195-0x0;var _0x5520b3=_0x1d2d[_0x79b195];return _0x5520b3;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){_0x19d535['status'](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x42da6d,_0x41330f){return function(_0x2e1709){if(!_0x2e1709){_0x42da6d[_0xd1d2('0x1b')](0x194);}return _0x2e1709;};}function handleError(_0x39e991,_0x28b8be){_0x28b8be=_0x28b8be||0x1f4;return function(_0x34faf7){logger[_0xd1d2('0x28')](_0x34faf7[_0xd1d2('0x29')]);if(_0x34faf7[_0xd1d2('0x2a')]){delete _0x34faf7['name'];}_0x39e991['status'](_0x28b8be)[_0xd1d2('0x2b')](_0x34faf7);};}exports[_0xd1d2('0x2c')]=function(_0x1e6072,_0x2b4c1f){var _0xc815ea={},_0x48ade1={},_0x39d694={'count':0x0,'rows':[]};var _0x41171c=_[_0xd1d2('0x2d')](db['WhatsappQueueReport'][_0xd1d2('0x2e')],function(_0x1db17f){return{'name':_0x1db17f[_0xd1d2('0x2f')],'type':_0x1db17f['type'][_0xd1d2('0x30')]};});_0x48ade1[_0xd1d2('0x31')]=_[_0xd1d2('0x2d')](_0x41171c,_0xd1d2('0x2a'));_0x48ade1[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x1e6072[_0xd1d2('0x32')]);_0x48ade1[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],_0x48ade1[_0xd1d2('0x32')]);_0xc815ea[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],qs[_0xd1d2('0x37')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x37')]));_0xc815ea[_0xd1d2('0x36')]=_0xc815ea['attributes'][_0xd1d2('0x38')]?_0xc815ea[_0xd1d2('0x36')]:_0x48ade1[_0xd1d2('0x31')];if(!_0x1e6072['query'][_0xd1d2('0x39')]('nolimit')){_0xc815ea['limit']=qs[_0xd1d2('0x21')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x21')]);_0xc815ea[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1e6072[_0xd1d2('0x32')]['offset']);}_0xc815ea[_0xd1d2('0x3a')]=qs[_0xd1d2('0x3b')](_0x1e6072['query'][_0xd1d2('0x3b')]);_0xc815ea[_0xd1d2('0x3c')]=qs[_0xd1d2('0x34')](_[_0xd1d2('0x3d')](_0x1e6072['query'],_0x48ade1['filters']),_0x41171c);if(_0x1e6072[_0xd1d2('0x32')]['filter']){_0xc815ea['where']=_['merge'](_0xc815ea[_0xd1d2('0x3c')],{'$or':_['map'](_0x41171c,function(_0x3f4fd7){if(_0x3f4fd7['type']!=='VIRTUAL'){var _0x4bcea4={};_0x4bcea4[_0x3f4fd7[_0xd1d2('0x2a')]]={'$like':'%'+_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x3e')]+'%'};return _0x4bcea4;}})});}_0xc815ea=_[_0xd1d2('0x3f')]({},_0xc815ea,_0x1e6072[_0xd1d2('0x40')]);var _0xb5bec2={'where':_0xc815ea[_0xd1d2('0x3c')]};return db[_0xd1d2('0x41')][_0xd1d2('0x22')](_0xb5bec2)[_0xd1d2('0x26')](function(_0x2cedb4){_0x39d694[_0xd1d2('0x22')]=_0x2cedb4;if(_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x42')]){_0xc815ea['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xd1d2('0x43')](_0xc815ea);})[_0xd1d2('0x26')](function(_0x24fc93){_0x39d694['rows']=_0x24fc93;return _0x39d694;})['then'](respondWithFilteredResult(_0x2b4c1f,_0xc815ea))[_0xd1d2('0x44')](handleError(_0x2b4c1f,null));};exports[_0xd1d2('0x45')]=function(_0x4dc730,_0x2fe92a){var _0x4c5d49={'raw':!![],'where':{'id':_0x4dc730[_0xd1d2('0x46')]['id']}},_0x5a3790={};_0x5a3790['model']=_['keys'](db[_0xd1d2('0x41')][_0xd1d2('0x2e')]);_0x5a3790[_0xd1d2('0x32')]=_['keys'](_0x4dc730[_0xd1d2('0x32')]);_0x5a3790[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x5a3790[_0xd1d2('0x31')],_0x5a3790['query']);_0x4c5d49[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x5a3790['model'],qs[_0xd1d2('0x37')](_0x4dc730['query'][_0xd1d2('0x37')]));_0x4c5d49[_0xd1d2('0x36')]=_0x4c5d49[_0xd1d2('0x36')][_0xd1d2('0x38')]?_0x4c5d49[_0xd1d2('0x36')]:_0x5a3790['model'];if(_0x4dc730['query'][_0xd1d2('0x42')]){_0x4c5d49[_0xd1d2('0x47')]=[{'all':!![]}];}_0x4c5d49=_['merge']({},_0x4c5d49,_0x4dc730[_0xd1d2('0x40')]);return db[_0xd1d2('0x41')][_0xd1d2('0x48')](_0x4c5d49)[_0xd1d2('0x26')](handleEntityNotFound(_0x2fe92a,null))[_0xd1d2('0x26')](respondWithResult(_0x2fe92a,null))[_0xd1d2('0x44')](handleError(_0x2fe92a,null));};exports[_0xd1d2('0x49')]=function(_0x57c668,_0xed9e9){return db[_0xd1d2('0x41')]['create'](_0x57c668[_0xd1d2('0x4a')],{})[_0xd1d2('0x26')](respondWithResult(_0xed9e9,0xc9))['catch'](handleError(_0xed9e9,null));};exports['update']=function(_0x3d4fe3,_0x182ea8){if(_0x3d4fe3['body']['id']){delete _0x3d4fe3[_0xd1d2('0x4a')]['id'];}return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0x3d4fe3[_0xd1d2('0x46')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x182ea8,null))['then'](saveUpdates(_0x3d4fe3['body'],null))[_0xd1d2('0x26')](respondWithResult(_0x182ea8,null))['catch'](handleError(_0x182ea8,null));};exports[_0xd1d2('0x27')]=function(_0xcd4b70,_0x4f4cb9){return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0xcd4b70['params']['id']}})['then'](handleEntityNotFound(_0x4f4cb9,null))[_0xd1d2('0x26')](removeEntity(_0x4f4cb9,null))[_0xd1d2('0x44')](handleError(_0x4f4cb9,null));};exports[_0xd1d2('0x4b')]=function(_0xfd8024,_0xa013ce){return db[_0xd1d2('0x41')][_0xd1d2('0x4b')]()[_0xd1d2('0x26')](respondWithResult(_0xa013ce,null))[_0xd1d2('0x44')](handleError(_0xa013ce,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index dbcde48..462ca8a 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 _0xda50=['rimraf','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x22800e,_0x3b1712){var _0x1f4de3=function(_0x164077){while(--_0x164077){_0x22800e['push'](_0x22800e['shift']());}};_0x1f4de3(++_0x3b1712);}(_0xda50,0xf0));var _0x0da5=function(_0x77dc7a,_0x499aab){_0x77dc7a=_0x77dc7a-0x0;var _0x58275a=_0xda50[_0x77dc7a];return _0x58275a;};'use strict';var _=require('lodash');var util=require(_0x0da5('0x0'));var logger=require(_0x0da5('0x1'))(_0x0da5('0x2'));var moment=require(_0x0da5('0x3'));var BPromise=require(_0x0da5('0x4'));var rp=require(_0x0da5('0x5'));var fs=require('fs');var path=require(_0x0da5('0x6'));var rimraf=require(_0x0da5('0x7'));var config=require('../../config/environment');var attributes=require(_0x0da5('0x8'));module[_0x0da5('0x9')]=function(_0x43e5c4,_0x3297e4){return _0x43e5c4[_0x0da5('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x0da5('0xb'),'paranoid':![],'indexes':[{'name':_0x0da5('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e39=['lodash','api','bluebird','path','rimraf','../../config/environment','WhatsappQueueReport','uniqueid'];(function(_0x579133,_0x256982){var _0x3f7a4f=function(_0x40c498){while(--_0x40c498){_0x579133['push'](_0x579133['shift']());}};_0x3f7a4f(++_0x256982);}(_0x9e39,0xf8));var _0x99e3=function(_0x3a9aa9,_0x395763){_0x3a9aa9=_0x3a9aa9-0x0;var _0x13e0c9=_0x9e39[_0x3a9aa9];return _0x13e0c9;};'use strict';var _=require(_0x99e3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x99e3('0x1'));var moment=require('moment');var BPromise=require(_0x99e3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99e3('0x3'));var rimraf=require(_0x99e3('0x4'));var config=require(_0x99e3('0x5'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x335840,_0x570dd5){return _0x335840['define'](_0x99e3('0x6'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x99e3('0x7'),'fields':[_0x99e3('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 6937405..091fa10 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 _0xa860=['message','result','WhatsappQueueReport','create','body','options','raw','debug','CreateWhatsappQueueReport','catch','update','attributes','UpdateWhatsappQueueReport','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3e7d74,_0x3ae6ba){var _0x4a8893=function(_0x4fe957){while(--_0x4fe957){_0x3e7d74['push'](_0x3e7d74['shift']());}};_0x4a8893(++_0x3ae6ba);}(_0xa860,0x1b2));var _0x0a86=function(_0x50b82b,_0xcb797e){_0x50b82b=_0x50b82b-0x0;var _0x2cc02d=_0xa860[_0x50b82b];return _0x2cc02d;};'use strict';var _=require(_0x0a86('0x0'));var util=require(_0x0a86('0x1'));var moment=require(_0x0a86('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a86('0x3'));var fs=require('fs');var Redis=require(_0x0a86('0x4'));var db=require(_0x0a86('0x5'))['db'];var utils=require(_0x0a86('0x6'));var logger=require(_0x0a86('0x7'))(_0x0a86('0x8'));var config=require(_0x0a86('0x9'));var jayson=require(_0x0a86('0xa'));var client=jayson[_0x0a86('0xb')][_0x0a86('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32d0f4,_0x3ecfad,_0x1ecd08){return new BPromise(function(_0x2cca67,_0x15c83b){return client[_0x0a86('0xd')](_0x32d0f4,_0x1ecd08)[_0x0a86('0xe')](function(_0x1dd18b){logger[_0x0a86('0xf')](_0x0a86('0x10'),_0x3ecfad,_0x0a86('0x11'));logger['debug'](_0x0a86('0x12'),_0x3ecfad,'request\x20sent',JSON['stringify'](_0x1dd18b));if(_0x1dd18b[_0x0a86('0x13')]){if(_0x1dd18b[_0x0a86('0x13')][_0x0a86('0x14')]===0x1f4){logger['error'](_0x0a86('0x10'),_0x3ecfad,_0x1dd18b[_0x0a86('0x13')]['message']);return _0x15c83b(_0x1dd18b[_0x0a86('0x13')][_0x0a86('0x15')]);}logger['error'](_0x0a86('0x10'),_0x3ecfad,_0x1dd18b[_0x0a86('0x13')][_0x0a86('0x15')]);return _0x2cca67(_0x1dd18b[_0x0a86('0x13')]['message']);}else{logger[_0x0a86('0xf')](_0x0a86('0x10'),_0x3ecfad,_0x0a86('0x11'));_0x2cca67(_0x1dd18b[_0x0a86('0x16')][_0x0a86('0x15')]);}})['catch'](function(_0x57b6bd){logger[_0x0a86('0x13')](_0x0a86('0x10'),_0x3ecfad,_0x57b6bd);_0x15c83b(_0x57b6bd);});});}exports['CreateWhatsappQueueReport']=function(_0x25a040){var _0x407918=this;return new Promise(function(_0x172da8,_0x27806a){return db[_0x0a86('0x17')][_0x0a86('0x18')](_0x25a040[_0x0a86('0x19')],{'raw':_0x25a040[_0x0a86('0x1a')]?_0x25a040[_0x0a86('0x1a')][_0x0a86('0x1b')]===undefined?!![]:![]:!![]})[_0x0a86('0xe')](function(_0x242767){logger[_0x0a86('0xf')]('CreateWhatsappQueueReport',_0x25a040);logger[_0x0a86('0x1c')](_0x0a86('0x1d'),_0x25a040,JSON['stringify'](_0x242767));_0x172da8(_0x242767);})[_0x0a86('0x1e')](function(_0x328932){logger[_0x0a86('0x13')](_0x0a86('0x1d'),_0x328932[_0x0a86('0x15')],_0x25a040);_0x27806a(_0x407918[_0x0a86('0x13')](0x1f4,_0x328932[_0x0a86('0x15')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x2626f3){var _0x28f2e2=this;return new Promise(function(_0x5a110f,_0x509dac){return db[_0x0a86('0x17')][_0x0a86('0x1f')](_0x2626f3['body'],{'raw':_0x2626f3[_0x0a86('0x1a')]?_0x2626f3['options'][_0x0a86('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2626f3[_0x0a86('0x1a')]?_0x2626f3[_0x0a86('0x1a')]['where']||null:null,'attributes':_0x2626f3[_0x0a86('0x1a')]?_0x2626f3[_0x0a86('0x1a')][_0x0a86('0x20')]||null:null,'limit':_0x2626f3[_0x0a86('0x1a')]?_0x2626f3[_0x0a86('0x1a')]['limit']||null:null})[_0x0a86('0xe')](function(_0x3b2a43){logger['info']('UpdateWhatsappQueueReport',_0x2626f3);logger[_0x0a86('0x1c')](_0x0a86('0x21'),_0x2626f3,JSON[_0x0a86('0x22')](_0x3b2a43));_0x5a110f(_0x3b2a43);})[_0x0a86('0x1e')](function(_0x35eaf2){logger[_0x0a86('0x13')](_0x0a86('0x21'),_0x35eaf2[_0x0a86('0x15')],_0x2626f3);_0x509dac(_0x28f2e2[_0x0a86('0x13')](0x1f4,_0x35eaf2['message']));});});}; \ No newline at end of file +var _0x2528=['jayson/promise','client','http','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','debug','UpdateWhatsappQueueReport','where','attributes','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2f888d,_0x597d3c){var _0x40f285=function(_0x225c27){while(--_0x225c27){_0x2f888d['push'](_0x2f888d['shift']());}};_0x40f285(++_0x597d3c);}(_0x2528,0x1ab));var _0x8252=function(_0x111c8b,_0x5a57bf){_0x111c8b=_0x111c8b-0x0;var _0x116b91=_0x2528[_0x111c8b];return _0x116b91;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8252('0x0'));var BPromise=require(_0x8252('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8252('0x2'))['db'];var utils=require(_0x8252('0x3'));var logger=require(_0x8252('0x4'))(_0x8252('0x5'));var config=require(_0x8252('0x6'));var jayson=require(_0x8252('0x7'));var client=jayson[_0x8252('0x8')][_0x8252('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x595b4f,_0x1b4306,_0x49ff2f){return new BPromise(function(_0x40f055,_0x33d60a){return client['request'](_0x595b4f,_0x49ff2f)['then'](function(_0x24ce22){logger[_0x8252('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1b4306,_0x8252('0xb'));logger['debug'](_0x8252('0xc'),_0x1b4306,_0x8252('0xb'),JSON[_0x8252('0xd')](_0x24ce22));if(_0x24ce22[_0x8252('0xe')]){if(_0x24ce22[_0x8252('0xe')][_0x8252('0xf')]===0x1f4){logger['error'](_0x8252('0x10'),_0x1b4306,_0x24ce22['error']['message']);return _0x33d60a(_0x24ce22[_0x8252('0xe')][_0x8252('0x11')]);}logger[_0x8252('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1b4306,_0x24ce22['error'][_0x8252('0x11')]);return _0x40f055(_0x24ce22[_0x8252('0xe')][_0x8252('0x11')]);}else{logger[_0x8252('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1b4306,_0x8252('0xb'));_0x40f055(_0x24ce22[_0x8252('0x12')][_0x8252('0x11')]);}})[_0x8252('0x13')](function(_0x51d3e8){logger['error'](_0x8252('0x10'),_0x1b4306,_0x51d3e8);_0x33d60a(_0x51d3e8);});});}exports[_0x8252('0x14')]=function(_0x91e890){var _0x492a78=this;return new Promise(function(_0x1d1f26,_0x46fe9e){return db[_0x8252('0x15')][_0x8252('0x16')](_0x91e890[_0x8252('0x17')],{'raw':_0x91e890[_0x8252('0x18')]?_0x91e890[_0x8252('0x18')][_0x8252('0x19')]===undefined?!![]:![]:!![]})[_0x8252('0x1a')](function(_0x2e2c06){logger['info'](_0x8252('0x14'),_0x91e890);logger[_0x8252('0x1b')](_0x8252('0x14'),_0x91e890,JSON[_0x8252('0xd')](_0x2e2c06));_0x1d1f26(_0x2e2c06);})[_0x8252('0x13')](function(_0x22f84d){logger[_0x8252('0xe')](_0x8252('0x14'),_0x22f84d[_0x8252('0x11')],_0x91e890);_0x46fe9e(_0x492a78[_0x8252('0xe')](0x1f4,_0x22f84d[_0x8252('0x11')]));});});};exports[_0x8252('0x1c')]=function(_0x358870){var _0x510efc=this;return new Promise(function(_0x162cb3,_0x3b6c04){return db['WhatsappQueueReport']['update'](_0x358870[_0x8252('0x17')],{'raw':_0x358870[_0x8252('0x18')]?_0x358870[_0x8252('0x18')][_0x8252('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x358870[_0x8252('0x18')]?_0x358870[_0x8252('0x18')][_0x8252('0x1d')]||null:null,'attributes':_0x358870[_0x8252('0x18')]?_0x358870[_0x8252('0x18')][_0x8252('0x1e')]||null:null,'limit':_0x358870[_0x8252('0x18')]?_0x358870[_0x8252('0x18')]['limit']||null:null})[_0x8252('0x1a')](function(_0x546dbe){logger[_0x8252('0xa')](_0x8252('0x1c'),_0x358870);logger['debug'](_0x8252('0x1c'),_0x358870,JSON[_0x8252('0xd')](_0x546dbe));_0x162cb3(_0x546dbe);})[_0x8252('0x13')](function(_0x15b2fb){logger[_0x8252('0xe')](_0x8252('0x1c'),_0x15b2fb['message'],_0x358870);_0x3b6c04(_0x510efc[_0x8252('0xe')](0x1f4,_0x15b2fb[_0x8252('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index d1c1d9b..aa85a63 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 _0x0e83=['fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','path','express','Router'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0x0e83,0x184));var _0x30e8=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x0e83[_0x35885a];return _0xe86249;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x30e8('0x0'));var timeout=require('connect-timeout');var express=require(_0x30e8('0x1'));var router=express[_0x30e8('0x2')]();var fs_extra=require(_0x30e8('0x3'));var auth=require(_0x30e8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x30e8('0x5'));var controller=require(_0x30e8('0x6'));router[_0x30e8('0x7')]('/',auth[_0x30e8('0x8')](),controller[_0x30e8('0x9')]);router['get'](_0x30e8('0xa'),auth['isAuthenticated'](),controller[_0x30e8('0xb')]);router['get'](_0x30e8('0xc'),auth[_0x30e8('0x8')](),controller[_0x30e8('0xd')]);router[_0x30e8('0xe')]('/',auth[_0x30e8('0x8')](),controller[_0x30e8('0xf')]);router['put']('/:id',auth[_0x30e8('0x8')](),controller['update']);router[_0x30e8('0x10')](_0x30e8('0xc'),auth[_0x30e8('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xde2b=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x5196b3,_0x5aa592){var _0x48d88d=function(_0x3286e2){while(--_0x3286e2){_0x5196b3['push'](_0x5196b3['shift']());}};_0x48d88d(++_0x5aa592);}(_0xde2b,0x7c));var _0xbde2=function(_0x529d6f,_0x4c93ce){_0x529d6f=_0x529d6f-0x0;var _0x33716a=_0xde2b[_0x529d6f];return _0x33716a;};'use strict';var multer=require(_0xbde2('0x0'));var util=require(_0xbde2('0x1'));var path=require(_0xbde2('0x2'));var timeout=require(_0xbde2('0x3'));var express=require(_0xbde2('0x4'));var router=express[_0xbde2('0x5')]();var fs_extra=require(_0xbde2('0x6'));var auth=require(_0xbde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbde2('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0xbde2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbde2('0x9')](_0xbde2('0xa'),auth[_0xbde2('0xb')](),controller[_0xbde2('0xc')]);router[_0xbde2('0x9')](_0xbde2('0xd'),auth[_0xbde2('0xb')](),controller[_0xbde2('0xe')]);router[_0xbde2('0xf')]('/',auth['isAuthenticated'](),controller[_0xbde2('0x10')]);router['put'](_0xbde2('0xd'),auth[_0xbde2('0xb')](),controller[_0xbde2('0x11')]);router[_0xbde2('0x12')]('/:id',auth[_0xbde2('0xb')](),controller[_0xbde2('0x13')]);module[_0xbde2('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 4471ebd..32dbb9f 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 _0xccef=['exports','ENUM','account','agent','queue','DATE'];(function(_0x464cde,_0x383009){var _0x190615=function(_0x12c029){while(--_0x12c029){_0x464cde['push'](_0x464cde['shift']());}};_0x190615(++_0x383009);}(_0xccef,0x1d4));var _0xfcce=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xccef[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0xfcce('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfcce('0x1')](_0xfcce('0x2'),_0xfcce('0x3'),_0xfcce('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfcce('0x5')]}}; \ No newline at end of file +var _0xb240=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0xb240,0x7e));var _0x0b24=function(_0xb7ce3e,_0x282f49){_0xb7ce3e=_0xb7ce3e-0x0;var _0x5ad9d2=_0xb240[_0xb7ce3e];return _0x5ad9d2;};'use strict';var Sequelize=require(_0x0b24('0x0'));module[_0x0b24('0x1')]={'uniqueid':{'type':Sequelize[_0x0b24('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0b24('0x3')](_0x0b24('0x4'),_0x0b24('0x5'),_0x0b24('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0b24('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 65f87a4..a04173e 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 _0x6aa1=['merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where'];(function(_0x16d369,_0xbbaa52){var _0x53c1ca=function(_0x49908d){while(--_0x49908d){_0x16d369['push'](_0x16d369['shift']());}};_0x53c1ca(++_0xbbaa52);}(_0x6aa1,0x1b5));var _0x16aa=function(_0xea35,_0x1d14ea){_0xea35=_0xea35-0x0;var _0x2d08e1=_0x6aa1[_0xea35];return _0x2d08e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x16aa('0x0'));var jsonpatch=require(_0x16aa('0x1'));var rp=require(_0x16aa('0x2'));var moment=require(_0x16aa('0x3'));var BPromise=require(_0x16aa('0x4'));var Mustache=require('mustache');var util=require(_0x16aa('0x5'));var path=require(_0x16aa('0x6'));var sox=require(_0x16aa('0x7'));var csv=require(_0x16aa('0x8'));var ejs=require(_0x16aa('0x9'));var fs=require('fs');var fs_extra=require(_0x16aa('0xa'));var _=require(_0x16aa('0xb'));var squel=require(_0x16aa('0xc'));var crypto=require(_0x16aa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16aa('0x8'));var querystring=require('querystring');var Papa=require(_0x16aa('0xe'));var Redis=require(_0x16aa('0xf'));var authService=require(_0x16aa('0x10'));var qs=require(_0x16aa('0x11'));var as=require(_0x16aa('0x12'));var hardwareService=require(_0x16aa('0x13'));var logger=require(_0x16aa('0x14'))('api');var utils=require(_0x16aa('0x15'));var config=require(_0x16aa('0x16'));var licenseUtil=require(_0x16aa('0x17'));var db=require(_0x16aa('0x18'))['db'];function respondWithStatusCode(_0x13d812,_0x2fbae7){_0x2fbae7=_0x2fbae7||0xcc;return function(_0x4e56b1){if(_0x4e56b1){return _0x13d812['sendStatus'](_0x2fbae7);}return _0x13d812[_0x16aa('0x19')](_0x2fbae7)[_0x16aa('0x1a')]();};}function respondWithResult(_0x50f9bd,_0x276fe2){_0x276fe2=_0x276fe2||0xc8;return function(_0xe108fd){if(_0xe108fd){return _0x50f9bd[_0x16aa('0x19')](_0x276fe2)[_0x16aa('0x1b')](_0xe108fd);}};}function respondWithFilteredResult(_0x5afc10,_0x337608){return function(_0x58dd9a){if(_0x58dd9a){var _0x478849=typeof _0x337608[_0x16aa('0x1c')]===_0x16aa('0x1d')&&typeof _0x337608[_0x16aa('0x1e')]===_0x16aa('0x1d');var _0x18b65d=_0x58dd9a[_0x16aa('0x1f')];var _0x358d53=_0x478849?0x0:_0x337608[_0x16aa('0x1c')];var _0x3ec33d=_0x478849?_0x58dd9a[_0x16aa('0x1f')]:_0x337608[_0x16aa('0x1c')]+_0x337608[_0x16aa('0x1e')];var _0x2be220;if(_0x3ec33d>=_0x18b65d){_0x3ec33d=_0x18b65d;_0x2be220=0xc8;}else{_0x2be220=0xce;}_0x5afc10[_0x16aa('0x19')](_0x2be220);return _0x5afc10['set'](_0x16aa('0x20'),_0x358d53+'-'+_0x3ec33d+'/'+_0x18b65d)[_0x16aa('0x1b')](_0x58dd9a);}return null;};}function patchUpdates(_0x90e5a7){return function(_0x20666b){try{jsonpatch[_0x16aa('0x21')](_0x20666b,_0x90e5a7,!![]);}catch(_0x33c2d4){return BPromise['reject'](_0x33c2d4);}return _0x20666b[_0x16aa('0x22')]();};}function saveUpdates(_0x24b71c,_0x4f5eba){return function(_0x3ddeb6){if(_0x3ddeb6){return _0x3ddeb6[_0x16aa('0x23')](_0x24b71c)[_0x16aa('0x24')](function(_0x41dcfc){return _0x41dcfc;});}return null;};}function removeEntity(_0x14bd43,_0x3c12a5){return function(_0x21482c){if(_0x21482c){return _0x21482c[_0x16aa('0x25')]()['then'](function(){_0x14bd43[_0x16aa('0x19')](0xcc)[_0x16aa('0x1a')]();});}};}function handleEntityNotFound(_0x4c2b92,_0x5cb05e){return function(_0x117d52){if(!_0x117d52){_0x4c2b92[_0x16aa('0x26')](0x194);}return _0x117d52;};}function handleError(_0x25cc91,_0xb01076){_0xb01076=_0xb01076||0x1f4;return function(_0x1d121b){logger['error'](_0x1d121b['stack']);if(_0x1d121b[_0x16aa('0x27')]){delete _0x1d121b[_0x16aa('0x27')];}_0x25cc91[_0x16aa('0x19')](_0xb01076)[_0x16aa('0x28')](_0x1d121b);};}exports[_0x16aa('0x29')]=function(_0x26a018,_0x295605){var _0x48c4ba={},_0x50437c={},_0x1c658f={'count':0x0,'rows':[]};var _0x1da0d7=_[_0x16aa('0x2a')](db[_0x16aa('0x2b')][_0x16aa('0x2c')],function(_0x61ecae){return{'name':_0x61ecae[_0x16aa('0x2d')],'type':_0x61ecae[_0x16aa('0x2e')][_0x16aa('0x2f')]};});_0x50437c[_0x16aa('0x30')]=_[_0x16aa('0x2a')](_0x1da0d7,'name');_0x50437c[_0x16aa('0x31')]=_[_0x16aa('0x32')](_0x26a018[_0x16aa('0x31')]);_0x50437c[_0x16aa('0x33')]=_[_0x16aa('0x34')](_0x50437c[_0x16aa('0x30')],_0x50437c[_0x16aa('0x31')]);_0x48c4ba['attributes']=_[_0x16aa('0x34')](_0x50437c[_0x16aa('0x30')],qs[_0x16aa('0x35')](_0x26a018['query'][_0x16aa('0x35')]));_0x48c4ba['attributes']=_0x48c4ba[_0x16aa('0x36')][_0x16aa('0x37')]?_0x48c4ba[_0x16aa('0x36')]:_0x50437c[_0x16aa('0x30')];if(!_0x26a018[_0x16aa('0x31')]['hasOwnProperty'](_0x16aa('0x38'))){_0x48c4ba[_0x16aa('0x1e')]=qs[_0x16aa('0x1e')](_0x26a018[_0x16aa('0x31')]['limit']);_0x48c4ba[_0x16aa('0x1c')]=qs['offset'](_0x26a018[_0x16aa('0x31')][_0x16aa('0x1c')]);}_0x48c4ba[_0x16aa('0x39')]=qs[_0x16aa('0x3a')](_0x26a018[_0x16aa('0x31')]['sort']);_0x48c4ba[_0x16aa('0x3b')]=qs[_0x16aa('0x33')](_['pick'](_0x26a018[_0x16aa('0x31')],_0x50437c[_0x16aa('0x33')]),_0x1da0d7);if(_0x26a018[_0x16aa('0x31')]['filter']){_0x48c4ba['where']=_[_0x16aa('0x3c')](_0x48c4ba[_0x16aa('0x3b')],{'$or':_[_0x16aa('0x2a')](_0x1da0d7,function(_0x518b49){if(_0x518b49[_0x16aa('0x2e')]!==_0x16aa('0x3d')){var _0x2c66b1={};_0x2c66b1[_0x518b49[_0x16aa('0x27')]]={'$like':'%'+_0x26a018[_0x16aa('0x31')]['filter']+'%'};return _0x2c66b1;}})});}_0x48c4ba=_['merge']({},_0x48c4ba,_0x26a018[_0x16aa('0x3e')]);var _0xedbf1a={'where':_0x48c4ba['where']};return db[_0x16aa('0x2b')]['count'](_0xedbf1a)[_0x16aa('0x24')](function(_0x3418fa){_0x1c658f['count']=_0x3418fa;if(_0x26a018[_0x16aa('0x31')][_0x16aa('0x3f')]){_0x48c4ba['include']=[{'all':!![]}];}return db[_0x16aa('0x2b')]['findAll'](_0x48c4ba);})[_0x16aa('0x24')](function(_0x376e0d){_0x1c658f[_0x16aa('0x40')]=_0x376e0d;return _0x1c658f;})[_0x16aa('0x24')](respondWithFilteredResult(_0x295605,_0x48c4ba))[_0x16aa('0x41')](handleError(_0x295605,null));};exports['show']=function(_0x2cc068,_0x3d428f){var _0x3baa51={'raw':!![],'where':{'id':_0x2cc068[_0x16aa('0x42')]['id']}},_0x1b0c05={};_0x1b0c05[_0x16aa('0x30')]=_['keys'](db[_0x16aa('0x2b')][_0x16aa('0x2c')]);_0x1b0c05['query']=_['keys'](_0x2cc068[_0x16aa('0x31')]);_0x1b0c05[_0x16aa('0x33')]=_[_0x16aa('0x34')](_0x1b0c05['model'],_0x1b0c05[_0x16aa('0x31')]);_0x3baa51[_0x16aa('0x36')]=_['intersection'](_0x1b0c05[_0x16aa('0x30')],qs[_0x16aa('0x35')](_0x2cc068[_0x16aa('0x31')]['fields']));_0x3baa51['attributes']=_0x3baa51['attributes'][_0x16aa('0x37')]?_0x3baa51['attributes']:_0x1b0c05['model'];if(_0x2cc068[_0x16aa('0x31')][_0x16aa('0x3f')]){_0x3baa51[_0x16aa('0x43')]=[{'all':!![]}];}_0x3baa51=_['merge']({},_0x3baa51,_0x2cc068[_0x16aa('0x3e')]);return db['WhatsappTransferReport'][_0x16aa('0x44')](_0x3baa51)[_0x16aa('0x24')](handleEntityNotFound(_0x3d428f,null))[_0x16aa('0x24')](respondWithResult(_0x3d428f,null))[_0x16aa('0x41')](handleError(_0x3d428f,null));};exports['create']=function(_0x3fa01e,_0x2d44ce){return db[_0x16aa('0x2b')]['create'](_0x3fa01e[_0x16aa('0x45')],{})[_0x16aa('0x24')](respondWithResult(_0x2d44ce,0xc9))[_0x16aa('0x41')](handleError(_0x2d44ce,null));};exports['update']=function(_0x3cdcd7,_0x1a82a4){if(_0x3cdcd7[_0x16aa('0x45')]['id']){delete _0x3cdcd7[_0x16aa('0x45')]['id'];}return db[_0x16aa('0x2b')][_0x16aa('0x44')]({'where':{'id':_0x3cdcd7[_0x16aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a82a4,null))['then'](saveUpdates(_0x3cdcd7[_0x16aa('0x45')],null))[_0x16aa('0x24')](respondWithResult(_0x1a82a4,null))[_0x16aa('0x41')](handleError(_0x1a82a4,null));};exports['destroy']=function(_0x2f6cb9,_0x2b117e){return db[_0x16aa('0x2b')][_0x16aa('0x44')]({'where':{'id':_0x2f6cb9[_0x16aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b117e,null))[_0x16aa('0x24')](removeEntity(_0x2b117e,null))['catch'](handleError(_0x2b117e,null));};exports[_0x16aa('0x46')]=function(_0x178b4e,_0x13791d){return db[_0x16aa('0x2b')][_0x16aa('0x46')]()[_0x16aa('0x24')](respondWithResult(_0x13791d,null))[_0x16aa('0x41')](handleError(_0x13791d,null));}; \ No newline at end of file +var _0x9bc1=['sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','create','body','find','destroy','params','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path'];(function(_0x39b04e,_0xcd3c5){var _0xb39132=function(_0x35ed80){while(--_0x35ed80){_0x39b04e['push'](_0x39b04e['shift']());}};_0xb39132(++_0xcd3c5);}(_0x9bc1,0x1c1));var _0x19bc=function(_0x33df84,_0x5825d1){_0x33df84=_0x33df84-0x0;var _0x42e95e=_0x9bc1[_0x33df84];return _0x42e95e;};'use strict';var emlformat=require(_0x19bc('0x0'));var rimraf=require(_0x19bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x19bc('0x2'));var moment=require(_0x19bc('0x3'));var BPromise=require(_0x19bc('0x4'));var Mustache=require('mustache');var util=require(_0x19bc('0x5'));var path=require(_0x19bc('0x6'));var sox=require(_0x19bc('0x7'));var csv=require(_0x19bc('0x8'));var ejs=require(_0x19bc('0x9'));var fs=require('fs');var fs_extra=require(_0x19bc('0xa'));var _=require('lodash');var squel=require(_0x19bc('0xb'));var crypto=require(_0x19bc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x19bc('0xd'));var toCsv=require(_0x19bc('0x8'));var querystring=require(_0x19bc('0xe'));var Papa=require(_0x19bc('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19bc('0x10'));var as=require(_0x19bc('0x11'));var hardwareService=require(_0x19bc('0x12'));var logger=require(_0x19bc('0x13'))(_0x19bc('0x14'));var utils=require(_0x19bc('0x15'));var config=require(_0x19bc('0x16'));var licenseUtil=require(_0x19bc('0x17'));var db=require(_0x19bc('0x18'))['db'];function respondWithStatusCode(_0x48f9f1,_0x5b5bc8){_0x5b5bc8=_0x5b5bc8||0xcc;return function(_0x194af1){if(_0x194af1){return _0x48f9f1[_0x19bc('0x19')](_0x5b5bc8);}return _0x48f9f1[_0x19bc('0x1a')](_0x5b5bc8)[_0x19bc('0x1b')]();};}function respondWithResult(_0x466c42,_0xc6c72){_0xc6c72=_0xc6c72||0xc8;return function(_0xdb47db){if(_0xdb47db){return _0x466c42[_0x19bc('0x1a')](_0xc6c72)['json'](_0xdb47db);}};}function respondWithFilteredResult(_0x2934fa,_0x36726f){return function(_0x43d05c){if(_0x43d05c){var _0x298071=typeof _0x36726f[_0x19bc('0x1c')]==='undefined'&&typeof _0x36726f['limit']===_0x19bc('0x1d');var _0x56877a=_0x43d05c[_0x19bc('0x1e')];var _0x4890e8=_0x298071?0x0:_0x36726f[_0x19bc('0x1c')];var _0x2d8d18=_0x298071?_0x43d05c[_0x19bc('0x1e')]:_0x36726f[_0x19bc('0x1c')]+_0x36726f[_0x19bc('0x1f')];var _0x2a1d64;if(_0x2d8d18>=_0x56877a){_0x2d8d18=_0x56877a;_0x2a1d64=0xc8;}else{_0x2a1d64=0xce;}_0x2934fa[_0x19bc('0x1a')](_0x2a1d64);return _0x2934fa[_0x19bc('0x20')](_0x19bc('0x21'),_0x4890e8+'-'+_0x2d8d18+'/'+_0x56877a)['json'](_0x43d05c);}return null;};}function patchUpdates(_0x2c5fc0){return function(_0x42b598){try{jsonpatch[_0x19bc('0x22')](_0x42b598,_0x2c5fc0,!![]);}catch(_0x510652){return BPromise[_0x19bc('0x23')](_0x510652);}return _0x42b598[_0x19bc('0x24')]();};}function saveUpdates(_0xf733f2,_0x331d67){return function(_0x304ae0){if(_0x304ae0){return _0x304ae0[_0x19bc('0x25')](_0xf733f2)[_0x19bc('0x26')](function(_0x418163){return _0x418163;});}return null;};}function removeEntity(_0x486604,_0x590bc2){return function(_0xafa7c8){if(_0xafa7c8){return _0xafa7c8['destroy']()[_0x19bc('0x26')](function(){_0x486604[_0x19bc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1842de,_0x268533){return function(_0x12412e){if(!_0x12412e){_0x1842de[_0x19bc('0x19')](0x194);}return _0x12412e;};}function handleError(_0x4ec718,_0x5b474d){_0x5b474d=_0x5b474d||0x1f4;return function(_0x6f7cd1){logger[_0x19bc('0x27')](_0x6f7cd1[_0x19bc('0x28')]);if(_0x6f7cd1['name']){delete _0x6f7cd1[_0x19bc('0x29')];}_0x4ec718[_0x19bc('0x1a')](_0x5b474d)['send'](_0x6f7cd1);};}exports['index']=function(_0x214783,_0x265a8c){var _0x1ef242={},_0x39bc0a={},_0x5351e5={'count':0x0,'rows':[]};var _0x331ed1=_[_0x19bc('0x2a')](db[_0x19bc('0x2b')][_0x19bc('0x2c')],function(_0x8a3d24){return{'name':_0x8a3d24[_0x19bc('0x2d')],'type':_0x8a3d24[_0x19bc('0x2e')][_0x19bc('0x2f')]};});_0x39bc0a[_0x19bc('0x30')]=_[_0x19bc('0x2a')](_0x331ed1,_0x19bc('0x29'));_0x39bc0a[_0x19bc('0x31')]=_[_0x19bc('0x32')](_0x214783[_0x19bc('0x31')]);_0x39bc0a[_0x19bc('0x33')]=_[_0x19bc('0x34')](_0x39bc0a[_0x19bc('0x30')],_0x39bc0a[_0x19bc('0x31')]);_0x1ef242['attributes']=_['intersection'](_0x39bc0a[_0x19bc('0x30')],qs[_0x19bc('0x35')](_0x214783[_0x19bc('0x31')][_0x19bc('0x35')]));_0x1ef242[_0x19bc('0x36')]=_0x1ef242[_0x19bc('0x36')][_0x19bc('0x37')]?_0x1ef242[_0x19bc('0x36')]:_0x39bc0a[_0x19bc('0x30')];if(!_0x214783[_0x19bc('0x31')][_0x19bc('0x38')]('nolimit')){_0x1ef242['limit']=qs[_0x19bc('0x1f')](_0x214783[_0x19bc('0x31')][_0x19bc('0x1f')]);_0x1ef242[_0x19bc('0x1c')]=qs[_0x19bc('0x1c')](_0x214783[_0x19bc('0x31')][_0x19bc('0x1c')]);}_0x1ef242[_0x19bc('0x39')]=qs[_0x19bc('0x3a')](_0x214783[_0x19bc('0x31')][_0x19bc('0x3a')]);_0x1ef242[_0x19bc('0x3b')]=qs['filters'](_['pick'](_0x214783[_0x19bc('0x31')],_0x39bc0a[_0x19bc('0x33')]),_0x331ed1);if(_0x214783[_0x19bc('0x31')][_0x19bc('0x3c')]){_0x1ef242[_0x19bc('0x3b')]=_[_0x19bc('0x3d')](_0x1ef242[_0x19bc('0x3b')],{'$or':_[_0x19bc('0x2a')](_0x331ed1,function(_0x25862c){if(_0x25862c[_0x19bc('0x2e')]!==_0x19bc('0x3e')){var _0x4e9fe6={};_0x4e9fe6[_0x25862c['name']]={'$like':'%'+_0x214783[_0x19bc('0x31')][_0x19bc('0x3c')]+'%'};return _0x4e9fe6;}})});}_0x1ef242=_[_0x19bc('0x3d')]({},_0x1ef242,_0x214783[_0x19bc('0x3f')]);var _0xaa389={'where':_0x1ef242[_0x19bc('0x3b')]};return db['WhatsappTransferReport'][_0x19bc('0x1e')](_0xaa389)[_0x19bc('0x26')](function(_0x388e15){_0x5351e5[_0x19bc('0x1e')]=_0x388e15;if(_0x214783[_0x19bc('0x31')][_0x19bc('0x40')]){_0x1ef242[_0x19bc('0x41')]=[{'all':!![]}];}return db[_0x19bc('0x2b')][_0x19bc('0x42')](_0x1ef242);})[_0x19bc('0x26')](function(_0x56caa9){_0x5351e5[_0x19bc('0x43')]=_0x56caa9;return _0x5351e5;})[_0x19bc('0x26')](respondWithFilteredResult(_0x265a8c,_0x1ef242))['catch'](handleError(_0x265a8c,null));};exports[_0x19bc('0x44')]=function(_0x153bdb,_0x37677d){var _0x384d46={'raw':!![],'where':{'id':_0x153bdb['params']['id']}},_0x579b97={};_0x579b97[_0x19bc('0x30')]=_['keys'](db[_0x19bc('0x2b')][_0x19bc('0x2c')]);_0x579b97['query']=_[_0x19bc('0x32')](_0x153bdb[_0x19bc('0x31')]);_0x579b97[_0x19bc('0x33')]=_[_0x19bc('0x34')](_0x579b97[_0x19bc('0x30')],_0x579b97['query']);_0x384d46[_0x19bc('0x36')]=_[_0x19bc('0x34')](_0x579b97[_0x19bc('0x30')],qs[_0x19bc('0x35')](_0x153bdb[_0x19bc('0x31')][_0x19bc('0x35')]));_0x384d46[_0x19bc('0x36')]=_0x384d46[_0x19bc('0x36')][_0x19bc('0x37')]?_0x384d46[_0x19bc('0x36')]:_0x579b97[_0x19bc('0x30')];if(_0x153bdb[_0x19bc('0x31')]['includeAll']){_0x384d46[_0x19bc('0x41')]=[{'all':!![]}];}_0x384d46=_[_0x19bc('0x3d')]({},_0x384d46,_0x153bdb[_0x19bc('0x3f')]);return db[_0x19bc('0x2b')]['find'](_0x384d46)['then'](handleEntityNotFound(_0x37677d,null))[_0x19bc('0x26')](respondWithResult(_0x37677d,null))[_0x19bc('0x45')](handleError(_0x37677d,null));};exports[_0x19bc('0x46')]=function(_0x354513,_0x3fea12){return db[_0x19bc('0x2b')][_0x19bc('0x46')](_0x354513[_0x19bc('0x47')],{})['then'](respondWithResult(_0x3fea12,0xc9))[_0x19bc('0x45')](handleError(_0x3fea12,null));};exports['update']=function(_0x21db65,_0x12da2f){if(_0x21db65[_0x19bc('0x47')]['id']){delete _0x21db65[_0x19bc('0x47')]['id'];}return db[_0x19bc('0x2b')][_0x19bc('0x48')]({'where':{'id':_0x21db65['params']['id']}})[_0x19bc('0x26')](handleEntityNotFound(_0x12da2f,null))[_0x19bc('0x26')](saveUpdates(_0x21db65['body'],null))['then'](respondWithResult(_0x12da2f,null))[_0x19bc('0x45')](handleError(_0x12da2f,null));};exports[_0x19bc('0x49')]=function(_0x73be6f,_0x37e5e1){return db[_0x19bc('0x2b')]['find']({'where':{'id':_0x73be6f[_0x19bc('0x4a')]['id']}})[_0x19bc('0x26')](handleEntityNotFound(_0x37e5e1,null))[_0x19bc('0x26')](removeEntity(_0x37e5e1,null))['catch'](handleError(_0x37e5e1,null));};exports[_0x19bc('0x4b')]=function(_0x3aa9cb,_0x5980e8){return db[_0x19bc('0x2b')][_0x19bc('0x4b')]()[_0x19bc('0x26')](respondWithResult(_0x5980e8,null))[_0x19bc('0x45')](handleError(_0x5980e8,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index f112b5e..c22e187 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 _0x977d=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','api','moment'];(function(_0x2bd41d,_0x272d00){var _0x51fdf6=function(_0x523855){while(--_0x523855){_0x2bd41d['push'](_0x2bd41d['shift']());}};_0x51fdf6(++_0x272d00);}(_0x977d,0xfb));var _0xd977=function(_0x1a529d,_0x4b3ad4){_0x1a529d=_0x1a529d-0x0;var _0x5e92eb=_0x977d[_0x1a529d];return _0x5e92eb;};'use strict';var _=require(_0xd977('0x0'));var util=require(_0xd977('0x1'));var logger=require('../../config/logger')(_0xd977('0x2'));var moment=require(_0xd977('0x3'));var BPromise=require(_0xd977('0x4'));var rp=require(_0xd977('0x5'));var fs=require('fs');var path=require(_0xd977('0x6'));var rimraf=require(_0xd977('0x7'));var config=require(_0xd977('0x8'));var attributes=require(_0xd977('0x9'));module[_0xd977('0xa')]=function(_0x12bcad,_0x22409c){return _0x12bcad[_0xd977('0xb')](_0xd977('0xc'),attributes,{'tableName':_0xd977('0xd'),'paranoid':![],'indexes':[{'name':_0xd977('0xe'),'fields':[_0xd977('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf41=['./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xaf41,0x1bf));var _0x1af4=function(_0x397220,_0x5f1296){_0x397220=_0x397220-0x0;var _0x59e335=_0xaf41[_0x397220];return _0x59e335;};'use strict';var _=require(_0x1af4('0x0'));var util=require(_0x1af4('0x1'));var logger=require(_0x1af4('0x2'))(_0x1af4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1af4('0x4'));var fs=require('fs');var path=require(_0x1af4('0x5'));var rimraf=require(_0x1af4('0x6'));var config=require(_0x1af4('0x7'));var attributes=require(_0x1af4('0x8'));module[_0x1af4('0x9')]=function(_0x3289d0,_0x17fe59){return _0x3289d0[_0x1af4('0xa')](_0x1af4('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x1af4('0xc'),'fields':[_0x1af4('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 884ca57..ffe03b1 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 _0xf698=['ioredis','../../mysqldb','../../config/logger','jayson/promise','then','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x4884e2,_0x4b4910){var _0x7d5c40=function(_0x53e8ce){while(--_0x53e8ce){_0x4884e2['push'](_0x4884e2['shift']());}};_0x7d5c40(++_0x4b4910);}(_0xf698,0x152));var _0x8f69=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0xf698[_0x545b71];return _0x26e587;};'use strict';var _=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var moment=require('moment');var BPromise=require(_0x8f69('0x2'));var rs=require(_0x8f69('0x3'));var fs=require('fs');var Redis=require(_0x8f69('0x4'));var db=require(_0x8f69('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f69('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f69('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc838b4,_0x4d06e9,_0x49fce9){return new BPromise(function(_0x1c6d4a,_0x383925){return client['request'](_0xc838b4,_0x49fce9)[_0x8f69('0x8')](function(_0x3a9020){logger[_0x8f69('0x9')](_0x8f69('0xa'),_0x4d06e9,'request\x20sent');logger['debug'](_0x8f69('0xb'),_0x4d06e9,_0x8f69('0xc'),JSON[_0x8f69('0xd')](_0x3a9020));if(_0x3a9020[_0x8f69('0xe')]){if(_0x3a9020[_0x8f69('0xe')][_0x8f69('0xf')]===0x1f4){logger['error'](_0x8f69('0xa'),_0x4d06e9,_0x3a9020[_0x8f69('0xe')][_0x8f69('0x10')]);return _0x383925(_0x3a9020['error']['message']);}logger[_0x8f69('0xe')](_0x8f69('0xa'),_0x4d06e9,_0x3a9020['error'][_0x8f69('0x10')]);return _0x1c6d4a(_0x3a9020[_0x8f69('0xe')][_0x8f69('0x10')]);}else{logger[_0x8f69('0x9')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4d06e9,'request\x20sent');_0x1c6d4a(_0x3a9020[_0x8f69('0x11')][_0x8f69('0x10')]);}})['catch'](function(_0x2cd4e9){logger[_0x8f69('0xe')](_0x8f69('0xa'),_0x4d06e9,_0x2cd4e9);_0x383925(_0x2cd4e9);});});} \ No newline at end of file +var _0xc532=['../../config/utils','../../config/logger','rpc','jayson/promise','http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x449000,_0x4bd8e5){var _0x5d08f9=function(_0x291978){while(--_0x291978){_0x449000['push'](_0x449000['shift']());}};_0x5d08f9(++_0x4bd8e5);}(_0xc532,0x160));var _0x2c53=function(_0x27bccd,_0x3bd6c9){_0x27bccd=_0x27bccd-0x0;var _0x590a28=_0xc532[_0x27bccd];return _0x590a28;};'use strict';var _=require(_0x2c53('0x0'));var util=require(_0x2c53('0x1'));var moment=require('moment');var BPromise=require(_0x2c53('0x2'));var rs=require(_0x2c53('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c53('0x4'))['db'];var utils=require(_0x2c53('0x5'));var logger=require(_0x2c53('0x6'))(_0x2c53('0x7'));var config=require('../../config/environment');var jayson=require(_0x2c53('0x8'));var client=jayson['client'][_0x2c53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a2edf,_0x55862e,_0x2694b8){return new BPromise(function(_0x22f3d8,_0x283554){return client['request'](_0x3a2edf,_0x2694b8)['then'](function(_0x490e07){logger[_0x2c53('0xa')](_0x2c53('0xb'),_0x55862e,_0x2c53('0xc'));logger[_0x2c53('0xd')](_0x2c53('0xe'),_0x55862e,_0x2c53('0xc'),JSON[_0x2c53('0xf')](_0x490e07));if(_0x490e07[_0x2c53('0x10')]){if(_0x490e07[_0x2c53('0x10')][_0x2c53('0x11')]===0x1f4){logger[_0x2c53('0x10')](_0x2c53('0xb'),_0x55862e,_0x490e07['error']['message']);return _0x283554(_0x490e07[_0x2c53('0x10')]['message']);}logger[_0x2c53('0x10')](_0x2c53('0xb'),_0x55862e,_0x490e07[_0x2c53('0x10')][_0x2c53('0x12')]);return _0x22f3d8(_0x490e07[_0x2c53('0x10')][_0x2c53('0x12')]);}else{logger['info'](_0x2c53('0xb'),_0x55862e,_0x2c53('0xc'));_0x22f3d8(_0x490e07[_0x2c53('0x13')][_0x2c53('0x12')]);}})[_0x2c53('0x14')](function(_0x1beae6){logger[_0x2c53('0x10')](_0x2c53('0xb'),_0x55862e,_0x1beae6);_0x283554(_0x1beae6);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index e822ed6..33e5880 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x302c=['online','join','status','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','app','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','start','info','filter','exitCode','number','length','map','name','Online\x20apps:'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x302c,0x15c));var _0xc302=function(_0x5e8bcd,_0x36c611){_0x5e8bcd=_0x5e8bcd-0x0;var _0x285369=_0x302c[_0x5e8bcd];return _0x285369;};'use strict';var _=require(_0xc302('0x0'));var db=require(_0xc302('0x1'))['db'];var seedDb=require(_0xc302('0x2'));var checkLicense=require(_0xc302('0x3'));var rpc=require(_0xc302('0x4'));var config=require('./config/environment');var logger=require('./config/logger')(_0xc302('0x5'));var pm2=require(_0xc302('0x6'));var pm2Config=require(_0xc302('0x7'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xc302('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0xc302('0x9'));function main(){return db[_0xc302('0xa')][_0xc302('0xb')]()[_0xc302('0xc')](function(){if(config[_0xc302('0xd')]){return seedDb[_0xc302('0xe')]();}})['then'](function(){return checkLicense[_0xc302('0xe')]();})[_0xc302('0xc')](function(){return rpc['listen']();})['then'](function(_0x2f0a4f){logger['info'](_0x2f0a4f);return chat['start']();})['then'](function(){return whatsapp[_0xc302('0xf')]();})[_0xc302('0xc')](function(){return schedule[_0xc302('0xf')]();})[_0xc302('0xc')](function(){return transcribe[_0xc302('0xf')]();})[_0xc302('0xc')](function(){return provider[_0xc302('0xf')]();})[_0xc302('0xc')](function(_0x2aec31){logger[_0xc302('0x10')](_0x2aec31);return pm2['start'](pm2Config);})[_0xc302('0xc')](function(_0x2f9a3a){var _0x54a865=_0x2f9a3a[_0xc302('0x11')](function(_0x3184d3){return typeof _0x3184d3[_0xc302('0x12')]===_0xc302('0x13')&&_0x3184d3[_0xc302('0x12')]>=0x0;});if(_0x54a865['length']>0x0){throw new Error(_0x54a865[_0xc302('0x14')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xc302('0x15')](_0x54a865,function(_0x337d22){return'\x22'+_0x337d22['pm2_env'][_0xc302('0x16')]+'\x22';}));}logger[_0xc302('0x10')](_0xc302('0x17'),_[_0xc302('0x15')](_[_0xc302('0x11')](_0x2f9a3a,{'status':_0xc302('0x18')}),'name')[_0xc302('0x19')]());logger[_0xc302('0x10')]('Offline\x20apps:',_[_0xc302('0x15')](_[_0xc302('0x11')](_0x2f9a3a,function(_0x51537c){return _0x51537c[_0xc302('0x1a')]!==_0xc302('0x18');}),_0xc302('0x16'))['join']()||_0xc302('0x1b'));console[_0xc302('0x1c')](_0xc302('0x1d'));})['catch'](function(_0x38ad27){console['log'](_0xc302('0x1e'),_0x38ad27);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x38ad27);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xe548=['log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/schedule','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','filter','online','join','Offline\x20apps:','status','App\x20Ready!','catch'];(function(_0x46941b,_0xc3e071){var _0x3308b6=function(_0x2725f8){while(--_0x2725f8){_0x46941b['push'](_0x46941b['shift']());}};_0x3308b6(++_0xc3e071);}(_0xe548,0x184));var _0x8e54=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0xe548[_0x54bac5];return _0xc15971;};'use strict';var _=require(_0x8e54('0x0'));var db=require(_0x8e54('0x1'))['db'];var seedDb=require(_0x8e54('0x2'));var checkLicense=require(_0x8e54('0x3'));var rpc=require(_0x8e54('0x4'));var config=require('./config/environment');var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x8e54('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x8e54('0x6'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x8e54('0x7'));function main(){return db[_0x8e54('0x8')][_0x8e54('0x9')]()[_0x8e54('0xa')](function(){if(config[_0x8e54('0xb')]){return seedDb[_0x8e54('0xc')]();}})[_0x8e54('0xa')](function(){return checkLicense['default']();})[_0x8e54('0xa')](function(){return rpc[_0x8e54('0xd')]();})[_0x8e54('0xa')](function(_0x305327){logger[_0x8e54('0xe')](_0x305327);return chat['start']();})[_0x8e54('0xa')](function(){return whatsapp[_0x8e54('0xf')]();})['then'](function(){return schedule['start']();})['then'](function(){return transcribe['start']();})[_0x8e54('0xa')](function(){return provider[_0x8e54('0xf')]();})[_0x8e54('0xa')](function(_0x48d210){logger[_0x8e54('0xe')](_0x48d210);return pm2[_0x8e54('0xf')](pm2Config);})['then'](function(_0x5848e5){var _0x2e48d5=_0x5848e5['filter'](function(_0x4e66f4){return typeof _0x4e66f4['exitCode']==='number'&&_0x4e66f4[_0x8e54('0x10')]>=0x0;});if(_0x2e48d5[_0x8e54('0x11')]>0x0){throw new Error(_0x2e48d5['length']+_0x8e54('0x12')+_[_0x8e54('0x13')](_0x2e48d5,function(_0x20caac){return'\x22'+_0x20caac['pm2_env'][_0x8e54('0x14')]+'\x22';}));}logger[_0x8e54('0xe')]('Online\x20apps:',_[_0x8e54('0x13')](_[_0x8e54('0x15')](_0x5848e5,{'status':_0x8e54('0x16')}),_0x8e54('0x14'))[_0x8e54('0x17')]());logger['info'](_0x8e54('0x18'),_[_0x8e54('0x13')](_[_0x8e54('0x15')](_0x5848e5,function(_0x5d065f){return _0x5d065f[_0x8e54('0x19')]!==_0x8e54('0x16');}),_0x8e54('0x14'))['join']()||'None');console['log'](_0x8e54('0x1a'));})[_0x8e54('0x1b')](function(_0x5d56f1){console[_0x8e54('0x1c')](_0x8e54('0x1d'),_0x5d56f1);logger[_0x8e54('0x1e')](_0x8e54('0x1f'),_0x5d56f1);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 599bba7..3e22816 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 _0x4b84=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','secrets','payload','randomBytes','hex','now','toString','HS512','../../mysqldb','../../config/environment','../encryptor','express-jwt','composable-middleware','basic-auth','moment','session','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key'];(function(_0xfe919,_0x56f9dd){var _0x476326=function(_0x3752dc){while(--_0x3752dc){_0xfe919['push'](_0xfe919['shift']());}};_0x476326(++_0x56f9dd);}(_0x4b84,0x1cc));var _0x44b8=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x4b84[_0x836465];return _0x2150ea;};'use strict';var db=require(_0x44b8('0x0'))['db'];var config=require(_0x44b8('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x44b8('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x44b8('0x3'));var compose=require(_0x44b8('0x4'));var basicAuth=require(_0x44b8('0x5'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0x44b8('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x44b8('0x7')]});var userAttributes=['id','role',_0x44b8('0x8'),'name','internal',_0x44b8('0x9'),_0x44b8('0xa'),_0x44b8('0xb'),'md5secret',_0x44b8('0xc'),_0x44b8('0xd'),_0x44b8('0xe'),_0x44b8('0xf'),_0x44b8('0x10'),_0x44b8('0x11'),_0x44b8('0x12'),'showWebBar',_0x44b8('0x13'),_0x44b8('0x14'),'crudPermissions',_0x44b8('0x15'),'passwordResetAt',_0x44b8('0x16'),_0x44b8('0x17'),'phoneBarAutoAnswerDelay',_0x44b8('0x18'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x44b8('0x19'),_0x44b8('0x1a'),_0x44b8('0x1b'),_0x44b8('0x1c'),'phoneBarRemoteControlPort','hotdesk','interface',_0x44b8('0x1d'),'privacyEnabled',_0x44b8('0x1e'),_0x44b8('0x1f'),'downloadVoiceRecordings',_0x44b8('0x20'),_0x44b8('0x21'),'ignorePauseForPreviewCalls',_0x44b8('0x22'),_0x44b8('0x23'),'chatAutoanswerDelay',_0x44b8('0x24'),_0x44b8('0x25'),_0x44b8('0x26'),_0x44b8('0x27'),_0x44b8('0x28'),_0x44b8('0x29'),_0x44b8('0x2a'),_0x44b8('0x2b'),_0x44b8('0x2c'),_0x44b8('0x2d')];exports[_0x44b8('0x2e')]=function(){return this[_0x44b8('0x2f')](!![])['use'](function(_0x56549a,_0x3a8aa4,_0x416b34){if(_0x56549a[_0x44b8('0x30')]){_0x416b34();}else{return db[_0x44b8('0x31')]['findOne']({'where':{'id':_0x56549a[_0x44b8('0x32')]['id']},'attributes':['id','closed',_0x44b8('0x33')],'raw':!![]})[_0x44b8('0x34')](function(_0x25a0c1){if(_0x25a0c1&&_0x25a0c1[_0x44b8('0x35')]){return _0x3a8aa4[_0x44b8('0x36')](_0x25a0c1['disposition']===_0x44b8('0x37')?0x195:0x193)['json']({'message':_0x25a0c1[_0x44b8('0x33')]===_0x44b8('0x37')?'Unmanaged.':_0x44b8('0x38')});}else{_0x416b34();}})[_0x44b8('0x39')](function(_0x2656d7){_0x416b34(_0x2656d7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xb22107){return compose()[_0x44b8('0x3a')](function(_0x53d9c7,_0x2e0174,_0x4a182d){var _0xfb0028;if(_0x53d9c7['headers']['authorization']){if(_['startsWith'](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x3d'))){var _0x1bd1be=basicAuth(_0x53d9c7);db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'name':_0x1bd1be[_0x44b8('0x40')]}})[_0x44b8('0x34')](function(_0xd1d320){if(!_0xd1d320||!_0xd1d320[_0x44b8('0x41')](_0x1bd1be[_0x44b8('0x42')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Wrong\x20credentials.'});}_0x53d9c7[_0x44b8('0x30')]={'id':_0xd1d320['id']};_0x4a182d();})['catch'](function(_0x212983){_0x4a182d(_0x212983);});}else if(_[_0x44b8('0x44')](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x45'))){validateJwt(_0x53d9c7,_0x2e0174,_0x4a182d);}else{if(_0xb22107){_0x4a182d();}else{return _0x2e0174['status'](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}}}else if(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')]){try{var _0x46b008={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x44b8('0x49')]()};verifyJwt(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')],_0x46b008)[_0x44b8('0x34')](function(_0x140a79){return db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x140a79[_0x44b8('0x4a')]}})[_0x44b8('0x34')](function(_0x181761){_0xfb0028=_0x181761;return db[_0x44b8('0x4b')][_0x44b8('0x4c')]({'where':{'id':0x1},'attributes':[_0x44b8('0x4d'),_0x44b8('0x4e')],'raw':!![]});})[_0x44b8('0x34')](function(_0x1becb0){if(!_0xfb0028||!_[_0x44b8('0x4f')](_0xfb0028[_0x44b8('0x50')],_0x140a79[_0x44b8('0x51')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x52')});}if(_0xfb0028['disabled']){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xfb0028[_0x44b8('0x53')]){if(_0x1becb0[_0x44b8('0x4e')]>0x0){if(moment(_0xfb0028[_0x44b8('0x54')])[_0x44b8('0x55')](_0x1becb0['blockDuration'],_0x44b8('0x56'))>moment()){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}else{return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}_0x53d9c7[_0x44b8('0x30')]={'id':_0xfb0028['id']};_0x4a182d();});})[_0x44b8('0x39')](function(){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});});}catch(_0xd69398){_0x4a182d(_0xd69398);}}else if(_0xb22107){_0x4a182d();}else{return _0x2e0174[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}})['use'](function(_0x12a0a4,_0x43e43a,_0xbf444f){if(_0x12a0a4['user']){db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x12a0a4[_0x44b8('0x30')]['id']},'attributes':userAttributes})['then'](function(_0xbad4bb){if(!_0xbad4bb){return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x58')});}_0x12a0a4[_0x44b8('0x30')]=_0xbad4bb;_0xbf444f();})['catch'](function(_0x5ae5f9){_0xbf444f(_0x5ae5f9);});}else if(_0xb22107){_0xbf444f();}else{return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x59')});}});};exports[_0x44b8('0x5a')]=function canUpdate(){return compose()[_0x44b8('0x3a')](function(_0x26e1f1,_0x3fc41b,_0x457348){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x197782){if(_0x197782[_0x44b8('0x5c')]){_0x457348();}else{return _0x3fc41b[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x5d')});}})[_0x44b8('0x39')](function(_0xce06dc){_0x457348(_0xce06dc);});});};exports[_0x44b8('0x5e')]=function isWebrtcLicence(){return compose()[_0x44b8('0x3a')](function(_0x49c507,_0x547dc1,_0x3b1b12){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x269284){if(_0x269284[_0x44b8('0x5f')]){_0x3b1b12();}else{return _0x547dc1[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':'Forbidden'});}})[_0x44b8('0x39')](function(_0x53edca){_0x3b1b12(_0x53edca);});});};exports[_0x44b8('0x60')]=function(_0x3ef886,_0x1dbc28,_0x9207bf){_0x3ef886[_0x44b8('0x60')]=!![];return _0x9207bf();};exports[_0x44b8('0x61')]=function signToken(_0x491600){return signJwt(_0x491600);};exports[_0x44b8('0x62')]=function(_0xff92fb,_0x10602c){if(!_0xff92fb[_0x44b8('0x30')]){return _0x10602c['status'](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x63')});}var _0x36afa9={'payload':{'id':_0xff92fb[_0x44b8('0x30')]['id'],'role':_0xff92fb[_0x44b8('0x30')][_0x44b8('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36afa9)['then'](function(_0x19d95d){_0x10602c[_0x44b8('0x65')](_0x44b8('0x66'),_0x19d95d);_0x10602c[_0x44b8('0x67')](_0x44b8('0x68'));})['catch'](function(_0x493840){return _0x10602c[_0x44b8('0x36')](0x1f4)['send'](_0x493840);});};exports[_0x44b8('0x69')]=function(_0x5785ef){if(_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x50')])||_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x6b')])){return null;}else{return createJwt(_0x5785ef);}};exports[_0x44b8('0x6c')]=function(_0x32f588){_0x32f588[_0x44b8('0x50')]=generateNonce();_0x32f588['apiKeyIat']=generateIssuedAt();return createJwt(_0x32f588);};exports[_0x44b8('0x6d')]=function(_0x37b2c2,_0x1e6a5e){var _0x492be6=_0x37b2c2[_0x44b8('0x47')][_0x44b8('0x48')];if(_0x492be6){var _0x45f9a0={'nonce':_0x1e6a5e[_0x44b8('0x50')],'iat':_0x1e6a5e['apiKeyIat'],'audience':hardwareConf[_0x44b8('0x49')](),'issuer':hardwareConf[_0x44b8('0x49')]()};return verifyJwt(_0x492be6,_0x45f9a0)['then'](function(){return generateApiKey(_0x1e6a5e);});}else{throw{'message':_0x44b8('0x6e')};}};exports[_0x44b8('0x6f')]=function(_0x35136e){var _0x3df6aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3df6aa[_0x44b8('0x70')](_0x35136e))throw new db['Sequelize']['ValidationError'](_0x44b8('0x71'));return;};exports[_0x44b8('0x72')]=function(_0xa30834,_0x4358aa,_0x765e45){var _0x3f6b92=encryptor[_0x44b8('0x73')](_0x4358aa)[_0x44b8('0x74')](',');for(var _0x10bbd9=0x0;_0x10bbd9<_0x765e45;_0x10bbd9++){if(!_0x3f6b92[_0x10bbd9])break;if(_0xa30834[_0x44b8('0x75')]()===_0x3f6b92[_0x10bbd9][_0x44b8('0x75')]()){var _0x3f7576=util['format'](_0x44b8('0x76'),_0x765e45);if(_0x765e45===0x1){_0x3f7576=_0x44b8('0x77');}throw new db[(_0x44b8('0x78'))][(_0x44b8('0x79'))](_0x3f7576);}}return;};exports[_0x44b8('0x7a')]=function(_0x1df915,_0x426a6a){var _0x172ff3=_0x426a6a?encryptor[_0x44b8('0x73')](_0x426a6a)[_0x44b8('0x74')](','):[];if(_0x172ff3[_0x44b8('0x7b')]===0x5){_0x172ff3[_0x44b8('0x7c')](-0x1,0x1);}_0x172ff3[_0x44b8('0x7d')](_0x1df915);return encryptor[_0x44b8('0x7e')](_0x172ff3[_0x44b8('0x7f')](','));};function signJwt(_0x293c2e){var _0x25f91c=BPromise[_0x44b8('0x80')](jwt['sign'],{'context':jwt});var _0x1ec516=_0x293c2e[_0x44b8('0x81')]||config[_0x44b8('0x82')][_0x44b8('0x7')];return new BPromise(function(_0x51f763,_0x29ed5d){_0x25f91c(_0x293c2e[_0x44b8('0x83')],_0x1ec516,_0x293c2e['options'])[_0x44b8('0x34')](function(_0xc4d667){_0x51f763(_0xc4d667);})['catch'](function(_0x2a95f6){_0x29ed5d(_0x2a95f6);});});}function verifyJwt(_0x3354bd,_0x520929,_0x37e42e){var _0x454fe6=BPromise[_0x44b8('0x80')](jwt['verify'],{'context':jwt});var _0x16e790=_0x37e42e||config['secrets'][_0x44b8('0x7')];return new BPromise(function(_0x5161ea,_0x176536){_0x454fe6(_0x3354bd,_0x16e790,_0x520929)[_0x44b8('0x34')](function(_0xf4d81f){_0x5161ea(_0xf4d81f);})[_0x44b8('0x39')](function(_0x3c6aad){_0x176536(_0x3c6aad);});});}function generateNonce(){return crypto[_0x44b8('0x84')](0x10)['toString'](_0x44b8('0x85'));}function generateIssuedAt(){return Math['floor'](Date[_0x44b8('0x86')]()/0x3e8)[_0x44b8('0x87')]();}function createJwt(_0x4c1a7c){var _0x3f9438={'payload':{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')]},'options':{'algorithm':_0x44b8('0x88'),'subject':_0x4c1a7c['id'][_0x44b8('0x87')](),'issuer':hardwareConf[_0x44b8('0x49')](),'audience':hardwareConf[_0x44b8('0x49')]()}};return signJwt(_0x3f9438)[_0x44b8('0x34')](function(_0x3f9102){return{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')],'token':_0x3f9102};});} \ No newline at end of file +var _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','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.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x7f848a,_0x4e4549){var _0x345844=function(_0x1af1f4){while(--_0x1af1f4){_0x7f848a['push'](_0x7f848a['shift']());}};_0x345844(++_0x4e4549);}(_0x55ca,0x126));var _0xa55c=function(_0x2f163c,_0x27bd79){_0x2f163c=_0x2f163c-0x0;var _0x3dd996=_0x55ca[_0x2f163c];return _0x3dd996;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 4af8237..4861c2e 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 _0xbb70=['parseAdvancedSearchFilter','where','fields','filter','user','tags','checkListsRestrictions','ids','tag','count','User','buildContactsQuery','clause','catch','describe','CmContact','keys','cf_','map','findOne','slice','all','length','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search'];(function(_0x8dec24,_0x903de0){var _0x381de1=function(_0x1aceb4){while(--_0x1aceb4){_0x8dec24['push'](_0x8dec24['shift']());}};_0x381de1(++_0x903de0);}(_0xbb70,0xdf));var _0x0bb7=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xbb70[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x0bb7('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x0bb7('0x1'))['db'];exports[_0x0bb7('0x2')]=function(_0x5ccceb,_0x44cd2c,_0x47a980,_0x2efecd){var _0xa5daca={'count':0x0,'rows':[]};var _0x2ec9ac=sqlUtils[_0x0bb7('0x3')](_0x44cd2c,_0x5ccceb);if(_0x2ec9ac){return Promise[_0x0bb7('0x4')](_0xa5daca);}var _0x509dc4=sqlUtils[_0x0bb7('0x5')]();var _0x55922b={};var _0x36e65e=![];var _0x57ec0f=![];return Promise['resolve']()[_0x0bb7('0x6')](function(){if(_0x5ccceb[_0x0bb7('0x7')]){return sqlUtils[_0x0bb7('0x8')](_0x5ccceb[_0x0bb7('0x7')],_0x2efecd);}else{return sqlUtils['parseQueryParameters'](_0x5ccceb,_0x2efecd);}})['then'](function(_0x3715bd){_0x509dc4[_0x0bb7('0x9')](_0x3715bd['default']);_0x509dc4['where'](_0x3715bd[_0x0bb7('0xa')]);_0x509dc4[_0x0bb7('0x9')](_0x3715bd[_0x0bb7('0xb')]);_0x509dc4[_0x0bb7('0x9')](_0x3715bd[_0x0bb7('0xc')]['clause']);_0x55922b=_0x3715bd[_0x0bb7('0xd')];_0x57ec0f=_0x3715bd[_0x0bb7('0xc')]['skip'];return sqlUtils[_0x0bb7('0xe')](_0x44cd2c,_0x5ccceb,_0x57ec0f);})[_0x0bb7('0x6')](function(_0xfb41a){_0x509dc4[_0x0bb7('0x9')](_0xfb41a);var _0x2084d3=_0x5ccceb['search']?_0x55922b[_0x0bb7('0xf')]:_0x5ccceb[_0x0bb7('0x10')];_0x36e65e=_0x2084d3?!![]:![];return sqlUtils['countFilteredContacts'](_0x509dc4,_0x2084d3);})['then'](function(_0x1807ae){_0xa5daca[_0x0bb7('0x11')]=_0x1807ae;if(_0xa5daca[_0x0bb7('0x11')]===0x0){return;}if(_0x5ccceb[_0x0bb7('0x12')]){_0x57ec0f=!![];}return sqlUtils[_0x0bb7('0x13')](_0x509dc4,_0x5ccceb[_0x0bb7('0xa')],_0x47a980,_0x36e65e,_0x55922b[_0x0bb7('0x14')],_0x57ec0f);})['then'](function(_0x27617b){if(!_0x27617b){return[];}return sqlUtils['getFilteredContacts'](_0x27617b,_0x5ccceb,_0x47a980);})[_0x0bb7('0x6')](function(_0x3553fa){_0xa5daca['rows']=_0x3553fa;return _0xa5daca;})[_0x0bb7('0x15')](function(_0x110da5){throw _0x110da5;});};exports[_0x0bb7('0x16')]=function(){var _0x6c130f={};var _0x2394cd=[];return db[_0x0bb7('0x17')]['describe']()[_0x0bb7('0x6')](function(_0x4895c2){_0x6c130f=_0x4895c2;var _0x35c5de=Object[_0x0bb7('0x18')](_0x6c130f)[_0x0bb7('0xb')](function(_0x447ddd){return _['startsWith'](_0x447ddd,_0x0bb7('0x19'))?_0x447ddd:undefined;});var _0x4fe4ca=_0x35c5de[_0x0bb7('0x1a')](function(_0x573cbd){return db['CmCustomField'][_0x0bb7('0x1b')]({'where':{'id':_0x573cbd[_0x0bb7('0x1c')](0x3)},'raw':!![]});});return Promise[_0x0bb7('0x1d')](_0x4fe4ca);})[_0x0bb7('0x6')](function(_0x4cc41f){for(var _0x339552=0x0;_0x339552<_0x4cc41f[_0x0bb7('0x1e')];_0x339552++){if(_0x4cc41f[_0x339552]){var _0x79a659=_0x0bb7('0x19')+_0x4cc41f[_0x339552]['id'];_0x6c130f[_0x79a659][_0x0bb7('0x1f')]=_0x4cc41f[_0x339552][_0x0bb7('0x20')];}}_0x2394cd=_[_0x0bb7('0x1a')](Object['keys'](_0x6c130f),function(_0x566e0f){return{'name':_0x566e0f,'type':_0x6c130f[_0x566e0f]['type']};});return _0x2394cd;})[_0x0bb7('0x15')](function(_0x14f51a){throw _0x14f51a;});}; \ No newline at end of file +var _0x25d4=['parseQueryParameters','default','where','user','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery','fields','clause','getFilteredContacts','catch','CmContact','keys','startsWith','map','CmCustomField','findOne','slice','all','length','cf_','type','lodash','./sql-utils','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter'];(function(_0x1c6bcd,_0xeb4faa){var _0xd68c32=function(_0x1b9950){while(--_0x1b9950){_0x1c6bcd['push'](_0x1c6bcd['shift']());}};_0xd68c32(++_0xeb4faa);}(_0x25d4,0x81));var _0x425d=function(_0x417ce2,_0x5d27ae){_0x417ce2=_0x417ce2-0x0;var _0x4677b8=_0x25d4[_0x417ce2];return _0x4677b8;};'use strict';var _=require(_0x425d('0x0'));var sqlUtils=require(_0x425d('0x1'));var db=require('../../mysqldb')['db'];exports['findAll']=function(_0x9597ea,_0x3daa95,_0x10d533,_0x3a0e09){var _0x4c1900={'count':0x0,'rows':[]};var _0x7f117c=sqlUtils['skipContactsQuery'](_0x3daa95,_0x9597ea);if(_0x7f117c){return Promise['resolve'](_0x4c1900);}var _0x394775=sqlUtils[_0x425d('0x2')]();var _0x3be8f1={};var _0x4c9dde=![];var _0x55b707=![];return Promise[_0x425d('0x3')]()[_0x425d('0x4')](function(){if(_0x9597ea[_0x425d('0x5')]){return sqlUtils[_0x425d('0x6')](_0x9597ea[_0x425d('0x5')],_0x3a0e09);}else{return sqlUtils[_0x425d('0x7')](_0x9597ea,_0x3a0e09);}})[_0x425d('0x4')](function(_0x3963a4){_0x394775['where'](_0x3963a4[_0x425d('0x8')]);_0x394775[_0x425d('0x9')](_0x3963a4['fields']);_0x394775[_0x425d('0x9')](_0x3963a4['filter']);_0x394775[_0x425d('0x9')](_0x3963a4[_0x425d('0xa')]['clause']);_0x3be8f1=_0x3963a4['tags'];_0x55b707=_0x3963a4[_0x425d('0xa')][_0x425d('0xb')];return sqlUtils[_0x425d('0xc')](_0x3daa95,_0x9597ea,_0x55b707);})['then'](function(_0x1392a3){_0x394775[_0x425d('0x9')](_0x1392a3);var _0x4d82f1=_0x9597ea[_0x425d('0x5')]?_0x3be8f1[_0x425d('0xd')]:_0x9597ea[_0x425d('0xe')];_0x4c9dde=_0x4d82f1?!![]:![];return sqlUtils[_0x425d('0xf')](_0x394775,_0x4d82f1);})[_0x425d('0x4')](function(_0x3e8b0f){_0x4c1900[_0x425d('0x10')]=_0x3e8b0f;if(_0x4c1900[_0x425d('0x10')]===0x0){return;}if(_0x9597ea[_0x425d('0x11')]){_0x55b707=!![];}return sqlUtils[_0x425d('0x12')](_0x394775,_0x9597ea[_0x425d('0x13')],_0x10d533,_0x4c9dde,_0x3be8f1[_0x425d('0x14')],_0x55b707);})[_0x425d('0x4')](function(_0x4488c1){if(!_0x4488c1){return[];}return sqlUtils[_0x425d('0x15')](_0x4488c1,_0x9597ea,_0x10d533);})[_0x425d('0x4')](function(_0x520a45){_0x4c1900['rows']=_0x520a45;return _0x4c1900;})[_0x425d('0x16')](function(_0x2da8aa){throw _0x2da8aa;});};exports['describe']=function(){var _0x43d056={};var _0xfc1a26=[];return db[_0x425d('0x17')]['describe']()['then'](function(_0x49459f){_0x43d056=_0x49459f;var _0x181233=Object[_0x425d('0x18')](_0x43d056)['filter'](function(_0x23317b){return _[_0x425d('0x19')](_0x23317b,'cf_')?_0x23317b:undefined;});var _0x8a4fc=_0x181233[_0x425d('0x1a')](function(_0x56a97c){return db[_0x425d('0x1b')][_0x425d('0x1c')]({'where':{'id':_0x56a97c[_0x425d('0x1d')](0x3)},'raw':!![]});});return Promise[_0x425d('0x1e')](_0x8a4fc);})['then'](function(_0x3be65e){for(var _0x176d16=0x0;_0x176d16<_0x3be65e[_0x425d('0x1f')];_0x176d16++){if(_0x3be65e[_0x176d16]){var _0x209574=_0x425d('0x20')+_0x3be65e[_0x176d16]['id'];_0x43d056[_0x209574]['fieldType']=_0x3be65e[_0x176d16][_0x425d('0x21')];}}_0xfc1a26=_[_0x425d('0x1a')](Object[_0x425d('0x18')](_0x43d056),function(_0x25e94a){return{'name':_0x25e94a,'type':_0x43d056[_0x25e94a]['type']};});return _0xfc1a26;})['catch'](function(_0x4dae43){throw _0x4dae43;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index b59214f..3788937 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 _0xed3f=['user','clause','and','skip','keys','name','Contact','push','c.ListId\x20IN\x20?','concat','then','fields','tag','filter','resolve','role','getLists','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','keyBy','QueryTypes','SELECT','CmContact','sequelize','query','COUNT(*)','isEmpty','t.id\x20IN\x20?','toString','lodash','squel','../parsers/advancedSearch','../interaction/utils','agent','search','autocomplete','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','ListId','CompanyId','updatedAt','deletedAt','TagIds','includes','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','dateOfBirth','datetime','DATE','default','text','start','value','end','Tag','map','ids','User'];(function(_0x4e774b,_0x57ab24){var _0x3c0e94=function(_0x5bcc98){while(--_0x5bcc98){_0x4e774b['push'](_0x4e774b['shift']());}};_0x3c0e94(++_0x57ab24);}(_0xed3f,0x85));var _0xfed3=function(_0x113566,_0x78c52a){_0x113566=_0x113566-0x0;var _0x359407=_0xed3f[_0x113566];return _0x359407;};'use strict';var _=require(_0xfed3('0x0'));var squel=require(_0xfed3('0x1'));var as=require(_0xfed3('0x2'));var qs=require('../parsers/qs');var utils=require(_0xfed3('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x452601,_0x5c16de){var _0x5b1f23=![];if(_0x452601['role']===_0xfed3('0x4')&&!_0x5c16de[_0xfed3('0x5')]&&!_0x5c16de['ListId']&&_0x5c16de[_0xfed3('0x6')]!=='true'){_0x5b1f23=!![];}return _0x5b1f23;}function getContactsSubquery(){return squel['select']()[_0xfed3('0x7')](_0xfed3('0x8'),'c')[_0xfed3('0x9')](_0xfed3('0xa'));}function applyJoinClauses(_0x5d19c6,_0x1aef1c){var _0x4155b5=_0x1aef1c?'c':'subqry';_0x5d19c6[_0xfed3('0xb')]('cm_user_has_contacts','uc',_0xfed3('0xc')+_0x4155b5+_0xfed3('0xd'))[_0xfed3('0xb')](_0xfed3('0xe'),'ct','ct.CmContactId\x20=\x20'+_0x4155b5+_0xfed3('0xd'))[_0xfed3('0xb')](_0xfed3('0xf'),'t',_0xfed3('0x10'));return _0x5d19c6;}function addFieldsToQuery(_0x408cdc,_0x254d18,_0x2e1150,_0x15b425,_0x9594f7){var _0x48a6f3=_0x9594f7?'c':'subqry';if(!_0x254d18){_0x254d18=['id',_0xfed3('0x11'),_0xfed3('0x12'),_0xfed3('0x13'),_0xfed3('0x14'),_0xfed3('0x15'),'email',_0xfed3('0x16'),_0xfed3('0x17'),'createdAt',_0xfed3('0x18'),_0xfed3('0x19'),_0xfed3('0x1a')];}else if(!_0x254d18[_0xfed3('0x1b')]('id')){_0x254d18['push']('id');}var _0x3c49ee=_0x2e1150&&_0x9594f7||!_0x2e1150&&!_0x9594f7;if(_0x15b425){_0x3c49ee=_0x15b425&&_0x9594f7||!_0x15b425&&!_0x9594f7;}_0x254d18[_0xfed3('0x1c')](function(_0x3aae39){if(_0x3aae39===_0xfed3('0x1a')){if(_0x3c49ee){_0x408cdc[_0xfed3('0x1d')](_0xfed3('0x1e'),_0x3aae39);}else if(_0x2e1150||_0x15b425){_0x408cdc[_0xfed3('0x1d')](_0x48a6f3+'.'+_0x3aae39);}}else{_0x408cdc['field'](_0x48a6f3+'.'+_0x3aae39);}});return _0x408cdc;}function getSqlClauses(){var _0x25d903={'default':squel[_0xfed3('0x1f')](),'fields':squel[_0xfed3('0x1f')](),'filter':squel[_0xfed3('0x1f')](),'tags':{'clause':squel[_0xfed3('0x1f')](),'ids':null},'user':{'clause':squel[_0xfed3('0x1f')](),'skip':![]}};return _0x25d903;}function parseTagParameter(_0xad13c4){var _0x3d7865=squel[_0xfed3('0x1f')]();if(_0xad13c4){var _0x101f15=utils['getSelectedTags'](_0xad13c4);_0x101f15[_0xfed3('0x1c')](function(_0x2bd8d7){_0x3d7865['or'](_0xfed3('0x20'),'%,'+_0x2bd8d7+',%');});}return _0x3d7865;}function parseSearchFilter(_0x1375c0){var _0x22bf9f=squel['expr']();if(_0x1375c0){var _0x14087e=_0x1375c0[_0xfed3('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x14087e[_0xfed3('0x22')]('\x20')[_0xfed3('0x23')]>0x1){_0x22bf9f['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfed3('0x24')](_0x14087e,!![]),null);}else{if(qs[_0xfed3('0x25')](_0x14087e)){_0x22bf9f['or'](_0xfed3('0x26'),_0x14087e+'%');_0x22bf9f['or']('c.phone\x20LIKE\x20?',_0x14087e+'%');_0x22bf9f['or'](_0xfed3('0x27'),_0x14087e+'%');_0x22bf9f['or'](_0xfed3('0x28'),_0x14087e+'%');}else if(qs[_0xfed3('0x29')](_0x14087e)){_0x22bf9f['or'](_0xfed3('0x2a'),_0x14087e+'%');}else{_0x22bf9f['or'](_0xfed3('0x2b'),'%'+_0x14087e+'%');_0x22bf9f['or'](_0xfed3('0x2c'),'%'+_0x14087e+'%');_0x22bf9f['or'](_0xfed3('0x2a'),'%'+_0x14087e+'%');}}}return _0x22bf9f;}function parseAdvancedSearchFilter(_0x3ae699,_0x3b0796){var _0x235552=getSqlClauses();var _0x513309=as[_0xfed3('0x2d')](_0x3ae699);var _0x4d024a=_0x513309[_0xfed3('0x2e')];for(var _0x514d3c=0x0;_0x514d3c<_0x513309[_0xfed3('0x2f')][_0xfed3('0x23')];_0x514d3c++){var _0x35f211=_0x513309[_0xfed3('0x2f')][_0x514d3c];var _0x5c753a='c';var _0x53876a=_[_0xfed3('0x30')](_0x3b0796,['name',_0x35f211[_0xfed3('0x1d')]]);if(_0x53876a){if(_0x35f211['field']===_0xfed3('0x31')||_0x53876a['fieldType']===_0xfed3('0x32')){_0x35f211['castTo']=_0xfed3('0x33');}var _0xb78d13=as['buildExpression'](_0x5c753a,_0x53876a['type'],_0x35f211);_0x235552[_0xfed3('0x34')][_0x4d024a](_0xb78d13[_0xfed3('0x35')],_0xb78d13['value'][_0xfed3('0x36')],_0xb78d13[_0xfed3('0x37')][_0xfed3('0x38')]);}else{if(_0x35f211[_0xfed3('0x1d')]===_0xfed3('0x39')){var _0x2fa766=_0x35f211['value']['split'](',')[_0xfed3('0x3a')](function(_0x199437){return Number(_0x199437);});var _0x1e1bdd=parseTagParameter(_0x2fa766);_0x235552['tags']['clause']['and'](_0x1e1bdd);_0x235552['tags'][_0xfed3('0x3b')]=_0x2fa766;}else if(_0x35f211['field']===_0xfed3('0x3c')){_0x235552[_0xfed3('0x3d')][_0xfed3('0x3e')][_0xfed3('0x3f')]('uc.UserId\x20=\x20?',_0x35f211[_0xfed3('0x37')]);_0x235552[_0xfed3('0x3d')][_0xfed3('0x40')]=!![];}}}return _0x235552;}function parseModelFields(_0x402669,_0x23c419){var _0x12996a=squel[_0xfed3('0x1f')]();var _0x25fb0a=_(_0x402669)[_0xfed3('0x41')]()[_0xfed3('0x3a')](function(_0x5b798b){return _['some'](_0x23c419,[_0xfed3('0x42'),_0x5b798b])?_0x5b798b:undefined;})['compact']()[_0xfed3('0x37')]();if(_0x402669[_0xfed3('0x43')]){_0x25fb0a[_0xfed3('0x44')](_0xfed3('0x43'));}if(_0x402669[_0xfed3('0x3c')]){_0x25fb0a['push']('User');}if(_0x25fb0a[_0xfed3('0x23')]>0x0){_0x25fb0a[_0xfed3('0x1c')](function(_0x305cc1){if(_0x305cc1===_0xfed3('0x16')){_0x12996a[_0xfed3('0x3f')](_0xfed3('0x45'),[][_0xfed3('0x46')](_0x402669[_0x305cc1]));}else if(_0x305cc1==='Contact'){var _0x3a331c='%'+_0x402669[_0x305cc1]+'%';_0x12996a[_0xfed3('0x3f')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x3a331c);}else if(_0x305cc1===_0xfed3('0x3c')){_0x12996a['and']('uc.UserId\x20=\x20?',_0x402669[_0x305cc1]);}else{_0x12996a['and']('c.'+_0x305cc1+'\x20=\x20?',_0x402669[_0x305cc1]);}});}return _0x12996a;}function parseQueryParameters(_0x3376f9,_0x1b1be9){var _0x5e5904=getSqlClauses();return Promise['resolve']()[_0xfed3('0x47')](function(){return parseModelFields(_0x3376f9,_0x1b1be9);})[_0xfed3('0x47')](function(_0x11ca05){_0x5e5904[_0xfed3('0x48')][_0xfed3('0x3f')](_0x11ca05);return parseTagParameter(_0x3376f9[_0xfed3('0x49')]);})[_0xfed3('0x47')](function(_0x24ab53){_0x5e5904['tags'][_0xfed3('0x3e')][_0xfed3('0x3f')](_0x24ab53);return parseSearchFilter(_0x3376f9[_0xfed3('0x4a')]);})[_0xfed3('0x47')](function(_0x5e35dd){_0x5e5904[_0xfed3('0x4a')]=_0x5e35dd;return _0x5e5904;});}function checkListsRestrictions(_0x22fd1b,_0x4ebd4a,_0x376547){var _0x20a980=squel[_0xfed3('0x1f')]();return Promise[_0xfed3('0x4b')]()[_0xfed3('0x47')](function(){if(_0x4ebd4a['search']&&_0x22fd1b[_0xfed3('0x4c')]===_0xfed3('0x4')&&!_0x376547){return _0x22fd1b[_0xfed3('0x4d')]({'attributes':['id'],'raw':!![]});}})[_0xfed3('0x47')](function(_0x5363ec){if(_0x5363ec){if(_0x5363ec['length']===0x0){_0x20a980[_0xfed3('0x3f')]('c.ListId\x20IS\x20NULL');}else{_0x20a980[_0xfed3('0x3f')](_0xfed3('0x45'),_['map'](_0x5363ec,'id'));}}})[_0xfed3('0x47')](function(){return _0x20a980;});}function buildContactsQuery(_0x1f8218,_0xeedb3b,_0x58facf,_0x490747,_0x11436f,_0x3eec2a){if(_0xeedb3b){_0xeedb3b=_0x58facf['attributes'];}_0x1f8218=addFieldsToQuery(_0x1f8218,_0xeedb3b,_0x490747,_0x3eec2a,!![]);var _0x568621=squel['select']();_0x568621=addFieldsToQuery(_0x568621,_0xeedb3b,_0x490747,_0x3eec2a,![]);if(_0x490747||_0x3eec2a){_0x1f8218=applyJoinClauses(_0x1f8218,!![]);_0x1f8218[_0xfed3('0x4e')](_0xfed3('0x4f'));if(_0x58facf[_0xfed3('0x50')]){_0x568621[_0xfed3('0x50')](_0x58facf['limit']);}if(_0x58facf['offset']){_0x568621[_0xfed3('0x51')](_0x58facf[_0xfed3('0x51')]);}}else{_0x568621=applyJoinClauses(_0x568621,![]);_0x568621[_0xfed3('0x4e')](_0xfed3('0x52'));if(_0x58facf[_0xfed3('0x50')]){_0x1f8218['limit'](_0x58facf['limit']);}if(_0x58facf[_0xfed3('0x51')]){_0x1f8218[_0xfed3('0x51')](_0x58facf['offset']);}}_0x568621[_0xfed3('0x53')](_0x11436f);if(_0x58facf[_0xfed3('0x54')]){_0x58facf['order']['forEach'](function(_0x3cd4d2){_0x1f8218['order']('c.'+_0x3cd4d2[0x0],_0x3cd4d2[0x1]===_0xfed3('0x55')?![]:!![]);_0x568621[_0xfed3('0x54')](_0xfed3('0x56')+_0x3cd4d2[0x0],_0x3cd4d2[0x1]===_0xfed3('0x55')?![]:!![]);});}_0x568621['from'](_0x1f8218,'subqry');return _0x568621;}function getFilteredContacts(_0x44f721){var _0xf2608b=[];return db[_0xfed3('0x39')]['findAll']({'attributes':['id',_0xfed3('0x42'),'color'],'raw':!![]})[_0xfed3('0x47')](function(_0x1b8b49){_0xf2608b=_[_0xfed3('0x57')](_0x1b8b49,'id');var _0x48a5b3={'type':db['Sequelize'][_0xfed3('0x58')][_0xfed3('0x59')],'model':db[_0xfed3('0x5a')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xfed3('0x5b')][_0xfed3('0x5c')](_0x44f721['toString'](),_0x48a5b3);})['then'](function(_0xc89729){_0xc89729[_0xfed3('0x1c')](function(_0x53ab98){if(_0x53ab98['TagIds']){_0x53ab98['Tags']=[];_0x53ab98['TagIds'][_0xfed3('0x22')](',')['forEach'](function(_0x3fdd18){_0x53ab98['Tags'][_0xfed3('0x44')](_0xf2608b[_0x3fdd18]);});}delete _0x53ab98[_0xfed3('0x1a')];});return _0xc89729;});}function countFilteredContacts(_0x5570af,_0x577dbf){var _0x528be2=_0x5570af['clone']();_0x528be2[_0xfed3('0x1d')](_0xfed3('0x5d'));_0x528be2=applyJoinClauses(_0x528be2,!![]);_0x5570af['group'](_0xfed3('0x4f'));var _0x202e0c=utils['getSelectedTags'](_0x577dbf);if(!_[_0xfed3('0x5e')](_0x202e0c)){_0x528be2[_0xfed3('0x9')](_0xfed3('0x5f'),_0x202e0c);}var _0x3e3390={'type':db['Sequelize'][_0xfed3('0x58')][_0xfed3('0x59')],'raw':!![]};return db[_0xfed3('0x5b')][_0xfed3('0x5c')](_0x528be2[_0xfed3('0x60')](),_0x3e3390)['then'](function(_0x52b71f){return _0x52b71f[0x0][_0xfed3('0x5d')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x5775=['resolve','then','filter','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','subqry','findAll','color','Sequelize','QueryTypes','SELECT','query','split','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','sequelize','toString','lodash','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','search','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','email','ListId','CompanyId','createdAt','updatedAt','deletedAt','includes','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','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?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','text','value','start','end','Tag','map','tags','clause','and','ids','User','uc.UserId\x20=\x20?','user','name','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?'];(function(_0x327e57,_0x3342a1){var _0x3279f6=function(_0x70ed4d){while(--_0x70ed4d){_0x327e57['push'](_0x327e57['shift']());}};_0x3279f6(++_0x3342a1);}(_0x5775,0x1d2));var _0x5577=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x5775[_0x2ca9d4];return _0x258956;};'use strict';var _=require(_0x5577('0x0'));var squel=require(_0x5577('0x1'));var as=require(_0x5577('0x2'));var qs=require(_0x5577('0x3'));var utils=require('../interaction/utils');var db=require(_0x5577('0x4'))['db'];function skipContactsQuery(_0x2fc7b2,_0x1522c4){var _0xedc404=![];if(_0x2fc7b2[_0x5577('0x5')]===_0x5577('0x6')&&!_0x1522c4[_0x5577('0x7')]&&!_0x1522c4['ListId']&&_0x1522c4['autocomplete']!==_0x5577('0x8')){_0xedc404=!![];}return _0xedc404;}function getContactsSubquery(){return squel[_0x5577('0x9')]()[_0x5577('0xa')](_0x5577('0xb'),'c')[_0x5577('0xc')](_0x5577('0xd'));}function applyJoinClauses(_0x5a419a,_0x3af54a){var _0x109946=_0x3af54a?'c':'subqry';_0x5a419a['left_join'](_0x5577('0xe'),'uc',_0x5577('0xf')+_0x109946+_0x5577('0x10'))[_0x5577('0x11')]('cm_contact_has_tags','ct',_0x5577('0x12')+_0x109946+_0x5577('0x10'))[_0x5577('0x11')](_0x5577('0x13'),'t',_0x5577('0x14'));return _0x5a419a;}function addFieldsToQuery(_0x13d9af,_0x2ea210,_0x2de042,_0x59a887,_0x2373ce){var _0x3db006=_0x2373ce?'c':'subqry';if(!_0x2ea210){_0x2ea210=['id',_0x5577('0x15'),_0x5577('0x16'),_0x5577('0x17'),_0x5577('0x18'),'fax',_0x5577('0x19'),_0x5577('0x1a'),_0x5577('0x1b'),_0x5577('0x1c'),_0x5577('0x1d'),_0x5577('0x1e'),'TagIds'];}else if(!_0x2ea210[_0x5577('0x1f')]('id')){_0x2ea210[_0x5577('0x20')]('id');}var _0x30fd79=_0x2de042&&_0x2373ce||!_0x2de042&&!_0x2373ce;if(_0x59a887){_0x30fd79=_0x59a887&&_0x2373ce||!_0x59a887&&!_0x2373ce;}_0x2ea210[_0x5577('0x21')](function(_0x175995){if(_0x175995===_0x5577('0x22')){if(_0x30fd79){_0x13d9af[_0x5577('0x23')](_0x5577('0x24'),_0x175995);}else if(_0x2de042||_0x59a887){_0x13d9af['field'](_0x3db006+'.'+_0x175995);}}else{_0x13d9af[_0x5577('0x23')](_0x3db006+'.'+_0x175995);}});return _0x13d9af;}function getSqlClauses(){var _0x177d13={'default':squel[_0x5577('0x25')](),'fields':squel[_0x5577('0x25')](),'filter':squel[_0x5577('0x25')](),'tags':{'clause':squel[_0x5577('0x25')](),'ids':null},'user':{'clause':squel[_0x5577('0x25')](),'skip':![]}};return _0x177d13;}function parseTagParameter(_0x421ca6){var _0x33a8cb=squel[_0x5577('0x25')]();if(_0x421ca6){var _0x3503ea=utils[_0x5577('0x26')](_0x421ca6);_0x3503ea['forEach'](function(_0x24d211){_0x33a8cb['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x24d211+',%');});}return _0x33a8cb;}function parseSearchFilter(_0x4e16ff){var _0x5725f8=squel[_0x5577('0x25')]();if(_0x4e16ff){var _0x544b21=_0x4e16ff[_0x5577('0x27')]('\x5c','\x5c\x5c')[_0x5577('0x27')](/'/g,'\x27\x27');if(_0x544b21['split']('\x20')[_0x5577('0x28')]>0x1){_0x5725f8['or'](_0x5577('0x29'),qs[_0x5577('0x2a')](_0x544b21,!![]),null);}else{if(qs[_0x5577('0x2b')](_0x544b21)){_0x5725f8['or'](_0x5577('0x2c'),_0x544b21+'%');_0x5725f8['or'](_0x5577('0x2d'),_0x544b21+'%');_0x5725f8['or'](_0x5577('0x2e'),_0x544b21+'%');_0x5725f8['or'](_0x5577('0x2f'),_0x544b21+'%');}else if(qs['isEmail'](_0x544b21)){_0x5725f8['or'](_0x5577('0x30'),_0x544b21+'%');}else{_0x5725f8['or']('c.firstName\x20LIKE\x20?','%'+_0x544b21+'%');_0x5725f8['or'](_0x5577('0x31'),'%'+_0x544b21+'%');_0x5725f8['or']('c.email\x20LIKE\x20?','%'+_0x544b21+'%');}}}return _0x5725f8;}function parseAdvancedSearchFilter(_0x5bec8f,_0xda96d4){var _0x523591=getSqlClauses();var _0x4818c4=as[_0x5577('0x32')](_0x5bec8f);var _0x127ca7=_0x4818c4['sqlOperator'];for(var _0xd3aabd=0x0;_0xd3aabd<_0x4818c4[_0x5577('0x33')][_0x5577('0x28')];_0xd3aabd++){var _0x5dce53=_0x4818c4[_0x5577('0x33')][_0xd3aabd];var _0x119079='c';var _0x4e9bea=_['find'](_0xda96d4,['name',_0x5dce53[_0x5577('0x23')]]);if(_0x4e9bea){if(_0x5dce53['field']===_0x5577('0x34')||_0x4e9bea[_0x5577('0x35')]===_0x5577('0x36')){_0x5dce53[_0x5577('0x37')]=_0x5577('0x38');}var _0x2fca5f=as[_0x5577('0x39')](_0x119079,_0x4e9bea[_0x5577('0x3a')],_0x5dce53);_0x523591['default'][_0x127ca7](_0x2fca5f[_0x5577('0x3b')],_0x2fca5f[_0x5577('0x3c')][_0x5577('0x3d')],_0x2fca5f[_0x5577('0x3c')][_0x5577('0x3e')]);}else{if(_0x5dce53['field']===_0x5577('0x3f')){var _0x4834b6=_0x5dce53['value']['split'](',')[_0x5577('0x40')](function(_0x313e95){return Number(_0x313e95);});var _0x34fa46=parseTagParameter(_0x4834b6);_0x523591[_0x5577('0x41')][_0x5577('0x42')][_0x5577('0x43')](_0x34fa46);_0x523591[_0x5577('0x41')][_0x5577('0x44')]=_0x4834b6;}else if(_0x5dce53[_0x5577('0x23')]===_0x5577('0x45')){_0x523591['user'][_0x5577('0x42')][_0x5577('0x43')](_0x5577('0x46'),_0x5dce53[_0x5577('0x3c')]);_0x523591[_0x5577('0x47')]['skip']=!![];}}}return _0x523591;}function parseModelFields(_0x48e058,_0x2e1fc8){var _0x5d1e89=squel[_0x5577('0x25')]();var _0x4dc419=_(_0x48e058)['keys']()[_0x5577('0x40')](function(_0xce3366){return _['some'](_0x2e1fc8,[_0x5577('0x48'),_0xce3366])?_0xce3366:undefined;})[_0x5577('0x49')]()[_0x5577('0x3c')]();if(_0x48e058[_0x5577('0x4a')]){_0x4dc419[_0x5577('0x20')]('Contact');}if(_0x48e058[_0x5577('0x45')]){_0x4dc419[_0x5577('0x20')]('User');}if(_0x4dc419[_0x5577('0x28')]>0x0){_0x4dc419[_0x5577('0x21')](function(_0x477790){if(_0x477790===_0x5577('0x1a')){_0x5d1e89['and'](_0x5577('0x4b'),[][_0x5577('0x4c')](_0x48e058[_0x477790]));}else if(_0x477790===_0x5577('0x4a')){var _0x3f65ef='%'+_0x48e058[_0x477790]+'%';_0x5d1e89[_0x5577('0x43')](_0x5577('0x4d'),_0x3f65ef);}else if(_0x477790===_0x5577('0x45')){_0x5d1e89[_0x5577('0x43')](_0x5577('0x46'),_0x48e058[_0x477790]);}else{_0x5d1e89[_0x5577('0x43')]('c.'+_0x477790+_0x5577('0x4e'),_0x48e058[_0x477790]);}});}return _0x5d1e89;}function parseQueryParameters(_0x4baca9,_0x145d76){var _0x32722a=getSqlClauses();return Promise[_0x5577('0x4f')]()[_0x5577('0x50')](function(){return parseModelFields(_0x4baca9,_0x145d76);})['then'](function(_0x2cc4f8){_0x32722a['fields']['and'](_0x2cc4f8);return parseTagParameter(_0x4baca9['tag']);})['then'](function(_0x44aa22){_0x32722a[_0x5577('0x41')][_0x5577('0x42')]['and'](_0x44aa22);return parseSearchFilter(_0x4baca9[_0x5577('0x51')]);})['then'](function(_0x31a73a){_0x32722a['filter']=_0x31a73a;return _0x32722a;});}function checkListsRestrictions(_0x5d6017,_0x36d77f,_0x5c2f88){var _0x3e7223=squel[_0x5577('0x25')]();return Promise[_0x5577('0x4f')]()[_0x5577('0x50')](function(){if(_0x36d77f[_0x5577('0x7')]&&_0x5d6017[_0x5577('0x5')]==='agent'&&!_0x5c2f88){return _0x5d6017[_0x5577('0x52')]({'attributes':['id'],'raw':!![]});}})[_0x5577('0x50')](function(_0x554a14){if(_0x554a14){if(_0x554a14[_0x5577('0x28')]===0x0){_0x3e7223[_0x5577('0x43')](_0x5577('0x53'));}else{_0x3e7223['and']('c.ListId\x20IN\x20?',_[_0x5577('0x40')](_0x554a14,'id'));}}})[_0x5577('0x50')](function(){return _0x3e7223;});}function buildContactsQuery(_0x165660,_0x3dd991,_0x45fa2c,_0xfce125,_0x9acae5,_0x4c1877){if(_0x3dd991){_0x3dd991=_0x45fa2c[_0x5577('0x54')];}_0x165660=addFieldsToQuery(_0x165660,_0x3dd991,_0xfce125,_0x4c1877,!![]);var _0x48b5c3=squel[_0x5577('0x9')]();_0x48b5c3=addFieldsToQuery(_0x48b5c3,_0x3dd991,_0xfce125,_0x4c1877,![]);if(_0xfce125||_0x4c1877){_0x165660=applyJoinClauses(_0x165660,!![]);_0x165660[_0x5577('0x55')](_0x5577('0x56'));if(_0x45fa2c[_0x5577('0x57')]){_0x48b5c3['limit'](_0x45fa2c[_0x5577('0x57')]);}if(_0x45fa2c['offset']){_0x48b5c3[_0x5577('0x58')](_0x45fa2c['offset']);}}else{_0x48b5c3=applyJoinClauses(_0x48b5c3,![]);_0x48b5c3[_0x5577('0x55')](_0x5577('0x59'));if(_0x45fa2c[_0x5577('0x57')]){_0x165660[_0x5577('0x57')](_0x45fa2c[_0x5577('0x57')]);}if(_0x45fa2c[_0x5577('0x58')]){_0x165660[_0x5577('0x58')](_0x45fa2c[_0x5577('0x58')]);}}_0x48b5c3[_0x5577('0x5a')](_0x9acae5);if(_0x45fa2c[_0x5577('0x5b')]){_0x45fa2c[_0x5577('0x5b')]['forEach'](function(_0x7d5d75){_0x165660[_0x5577('0x5b')]('c.'+_0x7d5d75[0x0],_0x7d5d75[0x1]===_0x5577('0x5c')?![]:!![]);_0x48b5c3[_0x5577('0x5b')](_0x5577('0x5d')+_0x7d5d75[0x0],_0x7d5d75[0x1]===_0x5577('0x5c')?![]:!![]);});}_0x48b5c3[_0x5577('0xa')](_0x165660,_0x5577('0x5e'));return _0x48b5c3;}function getFilteredContacts(_0x3c8033){var _0x241a7d=[];return db[_0x5577('0x3f')][_0x5577('0x5f')]({'attributes':['id',_0x5577('0x48'),_0x5577('0x60')],'raw':!![]})[_0x5577('0x50')](function(_0x3c1f2d){_0x241a7d=_['keyBy'](_0x3c1f2d,'id');var _0xb6fc45={'type':db[_0x5577('0x61')][_0x5577('0x62')][_0x5577('0x63')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x5577('0x64')](_0x3c8033['toString'](),_0xb6fc45);})[_0x5577('0x50')](function(_0x3e4f52){_0x3e4f52[_0x5577('0x21')](function(_0x249d69){if(_0x249d69[_0x5577('0x22')]){_0x249d69['Tags']=[];_0x249d69['TagIds'][_0x5577('0x65')](',')['forEach'](function(_0x22cdd3){_0x249d69[_0x5577('0x66')][_0x5577('0x20')](_0x241a7d[_0x22cdd3]);});}delete _0x249d69[_0x5577('0x22')];});return _0x3e4f52;});}function countFilteredContacts(_0xb0c08c,_0x4a91cc){var _0x3b6d4e=_0xb0c08c[_0x5577('0x67')]();_0x3b6d4e[_0x5577('0x23')](_0x5577('0x68'));_0x3b6d4e=applyJoinClauses(_0x3b6d4e,!![]);_0xb0c08c[_0x5577('0x55')](_0x5577('0x56'));var _0xc3db4f=utils[_0x5577('0x26')](_0x4a91cc);if(!_[_0x5577('0x69')](_0xc3db4f)){_0x3b6d4e[_0x5577('0xc')](_0x5577('0x6a'),_0xc3db4f);}var _0x24677a={'type':db[_0x5577('0x61')]['QueryTypes']['SELECT'],'raw':!![]};return db[_0x5577('0x6b')]['query'](_0x3b6d4e[_0x5577('0x6c')](),_0x24677a)[_0x5577('0x50')](function(_0x31470a){return _0x31470a[0x0][_0x5577('0x68')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b705e17..6ebe1b0 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 _0x254f=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','createReadStream','createCipher','update','binary','write','end','close','unlink','decryptFile','createDecipher','data','final','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x254f,0x104));var _0xf254=function(_0x465ced,_0x2f32da){_0x465ced=_0x465ced-0x0;var _0x45ead2=_0x254f[_0x465ced];return _0x45ead2;};'use strict';var crypto=require(_0xf254('0x0'));var fs=require('fs');var BPromise=require(_0xf254('0x1'));var _=require(_0xf254('0x2'));var config=require(_0xf254('0x3'));var logger=require('../../config/logger')(_0xf254('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xf254('0x5')][_0xf254('0x6')],'algorithm':_0xf254('0x7')};const fileOptions={'algorithm':_0xf254('0x8')};if(config['encrypt']&&config[_0xf254('0x9')][_0xf254('0xa')]){var isSupported=isAlgorithmSupported(config[_0xf254('0x9')][_0xf254('0xa')]);if(isSupported){fileOptions[_0xf254('0xa')]=config[_0xf254('0x9')][_0xf254('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xf254('0xb')](config[_0xf254('0x9')]['algorithm'],_0xf254('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2415eb){return AES_SUPPORTED_RX[_0xf254('0xd')](_0x2415eb);}function getSupportedCiphers(){return crypto[_0xf254('0xe')]()[_0xf254('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x48b672){return getSupportedCiphers()['indexOf'](_0x48b672)>-0x1;}function combineOptions(_0x275758){var _0x3d10b8={};for(var _0x418940 in fileOptions){if(fileOptions[_0xf254('0x10')](_0x418940)){_0x3d10b8[_0x418940]=fileOptions[_0x418940];}}if(_0x275758){for(var _0x3d1b0d in _0x275758){if(_0x275758[_0xf254('0x10')](_0x3d1b0d)){_0x3d10b8[_0x3d1b0d]=_0x275758[_0x3d1b0d];}}}return _0x3d10b8;}exports['encryptFile']=function(_0x40ac08,_0x15db3b,_0x46d415,_0x5aad79){return new BPromise(function(_0x1c87e4,_0x2c04a4){_0x5aad79=combineOptions(_0x5aad79);var _0xacb735=new Buffer(_0x46d415);var _0x3469ea=fs[_0xf254('0x11')](_0x40ac08);var _0x2623da=fs['createWriteStream'](_0x15db3b);var _0x480897=crypto[_0xf254('0x12')](_0x5aad79['algorithm'],_0xacb735);_0x3469ea['on']('data',function(_0x2f9714){var _0x1e3298=new Buffer(_0x480897[_0xf254('0x13')](_0x2f9714),_0xf254('0x14'));_0x2623da[_0xf254('0x15')](_0x1e3298);});_0x3469ea['on'](_0xf254('0x16'),function(){try{var _0x38944e=new Buffer(_0x480897['final'](_0xf254('0x14')),_0xf254('0x14'));_0x2623da[_0xf254('0x15')](_0x38944e);_0x2623da[_0xf254('0x16')]();_0x2623da['on'](_0xf254('0x17'),function(){return _0x1c87e4(_0x15db3b);});}catch(_0x5bb541){fs[_0xf254('0x18')](_0x15db3b);return _0x2c04a4(_0x5bb541);}});});};exports[_0xf254('0x19')]=function(_0x1be065,_0x36487f,_0x20d024,_0x4427f1){return new BPromise(function(_0x5e2822,_0x233d99){_0x4427f1=combineOptions(_0x4427f1);var _0x158a8d=new Buffer(_0x20d024);var _0x28fde8=fs[_0xf254('0x11')](_0x1be065);var _0x792c78=fs['createWriteStream'](_0x36487f);var _0x59ed53=crypto[_0xf254('0x1a')](_0x4427f1[_0xf254('0xa')],_0x158a8d);_0x28fde8['on'](_0xf254('0x1b'),function(_0xd604cd){var _0x5c49be=new Buffer(_0x59ed53['update'](_0xd604cd),_0xf254('0x14'));_0x792c78['write'](_0x5c49be);});_0x28fde8['on'](_0xf254('0x16'),function(){try{var _0x4ff65b=new Buffer(_0x59ed53[_0xf254('0x1c')](_0xf254('0x14')),_0xf254('0x14'));_0x792c78[_0xf254('0x15')](_0x4ff65b);_0x792c78['end']();_0x792c78['on'](_0xf254('0x17'),function(){return _0x5e2822(_0x36487f);});}catch(_0x520409){fs[_0xf254('0x18')](_0x36487f);return _0x233d99(_0x520409);}});});};exports[_0xf254('0x1d')]=function(_0x32604c,_0x9a6bd9,_0x32b850){var _0x3d4570=_0x32b850||stringOptions[_0xf254('0xa')];var _0x2d6147=_0x9a6bd9||stringOptions[_0xf254('0x1e')];var _0x4fce98=crypto[_0xf254('0x12')](_0x3d4570,_0x2d6147);var _0x568620=_0x4fce98[_0xf254('0x13')](_0x32604c,_0xf254('0x1f'),_0xf254('0x20'));_0x568620+=_0x4fce98['final'](_0xf254('0x20'));return _0x568620;};exports[_0xf254('0x21')]=function(_0x1897b6,_0x5546c0,_0x21b58e){var _0x48a9e4=_0x21b58e||stringOptions[_0xf254('0xa')];var _0x118a77=_0x5546c0||stringOptions[_0xf254('0x1e')];var _0x3cba4b=crypto[_0xf254('0x1a')](_0x48a9e4,_0x118a77);var _0x15a558=_0x3cba4b[_0xf254('0x13')](_0x1897b6,_0xf254('0x20'),_0xf254('0x1f'));_0x15a558+=_0x3cba4b[_0xf254('0x1c')](_0xf254('0x1f'));return _0x15a558;}; \ No newline at end of file +var _0xffb3=['write','end','encryptString','secret','utf8','base64','decryptString','createDecipher','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','binary','final','close','unlink','decryptFile','update'];(function(_0x58d002,_0x3abdf6){var _0x4ee940=function(_0x3c2070){while(--_0x3c2070){_0x58d002['push'](_0x58d002['shift']());}};_0x4ee940(++_0x3abdf6);}(_0xffb3,0x6b));var _0x3ffb=function(_0x334155,_0x518572){_0x334155=_0x334155-0x0;var _0x393928=_0xffb3[_0x334155];return _0x393928;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x3ffb('0x0'));var config=require(_0x3ffb('0x1'));var logger=require(_0x3ffb('0x2'))(_0x3ffb('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3ffb('0x4')][_0x3ffb('0x5')],'algorithm':_0x3ffb('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0x3ffb('0x7')]&&config['encrypt'][_0x3ffb('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x3ffb('0x8')]=config[_0x3ffb('0x7')][_0x3ffb('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x3ffb('0x9')](config[_0x3ffb('0x7')][_0x3ffb('0x8')],_0x3ffb('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x24749c){return AES_SUPPORTED_RX['test'](_0x24749c);}function getSupportedCiphers(){return crypto[_0x3ffb('0xb')]()[_0x3ffb('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x4572e0){return getSupportedCiphers()[_0x3ffb('0xd')](_0x4572e0)>-0x1;}function combineOptions(_0x1784ff){var _0x4ff240={};for(var _0x24331c in fileOptions){if(fileOptions[_0x3ffb('0xe')](_0x24331c)){_0x4ff240[_0x24331c]=fileOptions[_0x24331c];}}if(_0x1784ff){for(var _0x3b0875 in _0x1784ff){if(_0x1784ff['hasOwnProperty'](_0x3b0875)){_0x4ff240[_0x3b0875]=_0x1784ff[_0x3b0875];}}}return _0x4ff240;}exports['encryptFile']=function(_0x69dc37,_0x569b51,_0x54ec2c,_0x3c3396){return new BPromise(function(_0x3405d1,_0x3b30c1){_0x3c3396=combineOptions(_0x3c3396);var _0x155f72=new Buffer(_0x54ec2c);var _0x53b76b=fs[_0x3ffb('0xf')](_0x69dc37);var _0x11f18c=fs[_0x3ffb('0x10')](_0x569b51);var _0x4136f3=crypto[_0x3ffb('0x11')](_0x3c3396[_0x3ffb('0x8')],_0x155f72);_0x53b76b['on'](_0x3ffb('0x12'),function(_0x7adff){var _0x152f48=new Buffer(_0x4136f3['update'](_0x7adff),_0x3ffb('0x13'));_0x11f18c['write'](_0x152f48);});_0x53b76b['on']('end',function(){try{var _0x11a3f0=new Buffer(_0x4136f3[_0x3ffb('0x14')](_0x3ffb('0x13')),_0x3ffb('0x13'));_0x11f18c['write'](_0x11a3f0);_0x11f18c['end']();_0x11f18c['on'](_0x3ffb('0x15'),function(){return _0x3405d1(_0x569b51);});}catch(_0x4f6ab9){fs[_0x3ffb('0x16')](_0x569b51);return _0x3b30c1(_0x4f6ab9);}});});};exports[_0x3ffb('0x17')]=function(_0x5605d0,_0x4aa538,_0x599b34,_0x1b4922){return new BPromise(function(_0x5c1345,_0x2da400){_0x1b4922=combineOptions(_0x1b4922);var _0x257628=new Buffer(_0x599b34);var _0x139cc3=fs[_0x3ffb('0xf')](_0x5605d0);var _0x222d38=fs['createWriteStream'](_0x4aa538);var _0x3ea2c8=crypto['createDecipher'](_0x1b4922[_0x3ffb('0x8')],_0x257628);_0x139cc3['on'](_0x3ffb('0x12'),function(_0x4571f4){var _0x1f8ca3=new Buffer(_0x3ea2c8[_0x3ffb('0x18')](_0x4571f4),_0x3ffb('0x13'));_0x222d38[_0x3ffb('0x19')](_0x1f8ca3);});_0x139cc3['on'](_0x3ffb('0x1a'),function(){try{var _0x46f96b=new Buffer(_0x3ea2c8[_0x3ffb('0x14')](_0x3ffb('0x13')),_0x3ffb('0x13'));_0x222d38[_0x3ffb('0x19')](_0x46f96b);_0x222d38[_0x3ffb('0x1a')]();_0x222d38['on'](_0x3ffb('0x15'),function(){return _0x5c1345(_0x4aa538);});}catch(_0x16116c){fs[_0x3ffb('0x16')](_0x4aa538);return _0x2da400(_0x16116c);}});});};exports[_0x3ffb('0x1b')]=function(_0x56d35e,_0x35c831,_0x56edd7){var _0x411c5d=_0x56edd7||stringOptions[_0x3ffb('0x8')];var _0x119c68=_0x35c831||stringOptions[_0x3ffb('0x1c')];var _0x24cd9a=crypto[_0x3ffb('0x11')](_0x411c5d,_0x119c68);var _0x387deb=_0x24cd9a[_0x3ffb('0x18')](_0x56d35e,_0x3ffb('0x1d'),_0x3ffb('0x1e'));_0x387deb+=_0x24cd9a[_0x3ffb('0x14')](_0x3ffb('0x1e'));return _0x387deb;};exports[_0x3ffb('0x1f')]=function(_0x5141ae,_0x465d30,_0x4b2d92){var _0x19d8d2=_0x4b2d92||stringOptions[_0x3ffb('0x8')];var _0x1771f7=_0x465d30||stringOptions[_0x3ffb('0x1c')];var _0x20e0d0=crypto[_0x3ffb('0x20')](_0x19d8d2,_0x1771f7);var _0x7c0fe9=_0x20e0d0[_0x3ffb('0x18')](_0x5141ae,_0x3ffb('0x1e'),'utf8');_0x7c0fe9+=_0x20e0d0[_0x3ffb('0x14')](_0x3ffb('0x1d'));return _0x7c0fe9;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 8b38677..b16bd70 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 _0xa16e=['sequelize','query','num','Empty','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','existsSync','join','mkdirSync','push','length','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then'];(function(_0xe5efcb,_0x473f01){var _0x782d72=function(_0x44bf97){while(--_0x44bf97){_0xe5efcb['push'](_0xe5efcb['shift']());}};_0x782d72(++_0x473f01);}(_0xa16e,0x13b));var _0xea16=function(_0x308319,_0x470254){_0x308319=_0x308319-0x0;var _0x36df3f=_0xa16e[_0x308319];return _0x36df3f;};'use strict';var util=require(_0xea16('0x0'));var path=require(_0xea16('0x1'));var _=require(_0xea16('0x2'));var csv=require(_0xea16('0x3'));var fs=require('fs');var BPromise=require(_0xea16('0x4'));var zipdir=require(_0xea16('0x5'));var rimraf=require(_0xea16('0x6'));var db=require(_0xea16('0x7'))['db'];var dbH=require(_0xea16('0x7'))[_0xea16('0x8')];var logger=require(_0xea16('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xea16('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4f04cd,_0x35081e){var _0x2b4588={'status':_0x4f04cd};var _0xcc159f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x35081e){_0x2b4588['savename']=_0x35081e;}return db['AnalyticExtractedReport'][_0xea16('0xb')](_0x2b4588,_0xcc159f);}function main(){var _0x326161=0x1388;var _0x3c51ba;logger[_0xea16('0xc')](util[_0xea16('0xd')](_0xea16('0xe'),EXTRACTED_REPORT_ID,_0xea16('0xf')));return db[_0xea16('0x10')][_0xea16('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xea16('0x12'),_0xea16('0x13')]})[_0xea16('0x14')](function(_0x406963){if(_0x406963){_0x3c51ba=_0x406963;_0x326161=_0x3c51ba[_0xea16('0x13')]||0x1388;}})[_0xea16('0x14')](function(){return dbH[_0xea16('0x15')][_0xea16('0x16')](util[_0xea16('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xea16('0x15')]['QueryTypes']['SELECT']});})[_0xea16('0x14')](function(_0x3ab8e6){if(!_0x3ab8e6[0x0][_0xea16('0x17')]){return analyticExtractedReport(_0xea16('0x18'));}var _0x22dd61=[];var _0x3750bb=0x0;if(_0x3c51ba[_0xea16('0x12')]){if(_0x3ab8e6&&_0x3ab8e6['length']){var _0x511f6e=_[_0xea16('0x19')](_0x3ab8e6[0x0][_0xea16('0x17')]/_0x326161);var _0x1a8db9=Number[_0xea16('0x1a')](_0x3ab8e6[0x0][_0xea16('0x17')]/_0x326161)?_0x3ab8e6[0x0][_0xea16('0x17')]%_0x326161:0x0;_0x511f6e[_0xea16('0x1b')](function(_0x9c34a5){if(_0x9c34a5>0x0){_0x3750bb+=_0x326161;}_0x22dd61['push'](dbH['sequelize']['query'](util['format'](_0xea16('0x1c'),QUERY,_0x326161,_0x3750bb),{'type':dbH[_0xea16('0x15')]['QueryTypes'][_0xea16('0x1d')]}));});if(_0x1a8db9>0x0){_0x3750bb+=_0x326161;_0x22dd61['push'](dbH[_0xea16('0x15')]['query'](util['format'](_0xea16('0x1c'),QUERY,_0x1a8db9,_0x3750bb),{'type':dbH[_0xea16('0x15')][_0xea16('0x1e')][_0xea16('0x1d')]}));}}}else{_0x22dd61['push'](dbH[_0xea16('0x15')][_0xea16('0x16')](QUERY,{'type':dbH['sequelize'][_0xea16('0x1e')][_0xea16('0x1d')]}));}var _0x1e3216=path['dirname'](PATH);var _0x972cbd=path['basename'](PATH,'.csv');var _0x1c2993=_0x3c51ba[_0xea16('0x12')]&&_0x22dd61['length']>0x1;var _0x5a8e6e=[];if(!fs[_0xea16('0x1f')](path[_0xea16('0x20')](_0x1e3216,_0x972cbd))&&_0x1c2993){fs[_0xea16('0x21')](path[_0xea16('0x20')](_0x1e3216,_0x972cbd));}return BPromise['each'](_0x22dd61,function(_0x5e627e){_0x5a8e6e[_0xea16('0x22')](_0x5e627e);})[_0xea16('0x14')](function(){for(var _0x3d6b77=0x0;_0x3d6b77<_0x5a8e6e[_0xea16('0x23')];_0x3d6b77+=0x1){var _0x3d426a;var _0x24d42c=_0x5a8e6e[_0x3d6b77];if(_0x1c2993){_0x3d426a=path[_0xea16('0x20')](_0x1e3216,_0x972cbd,util[_0xea16('0xd')](_0xea16('0x24'),_0x972cbd,_0x3d6b77,_0xea16('0x25')));}else{_0x3d426a=path[_0xea16('0x20')](_0x1e3216,util['format'](_0xea16('0x26'),_0x972cbd,_0xea16('0x25')));}fs[_0xea16('0x27')](_0x3d426a,csv(_0x24d42c));}})[_0xea16('0x14')](function(){if(_0x1c2993){return new Promise(function(_0x2b0a51){zipdir(path[_0xea16('0x20')](_0x1e3216,_0x972cbd),{'saveTo':path['join'](_0x1e3216,util[_0xea16('0xd')](_0xea16('0x26'),_0x972cbd,'zip'))},function(_0x4af04e,_0x4e534e){rimraf(path[_0xea16('0x20')](_0x1e3216,_0x972cbd),function(){});_0x2b0a51(_0xea16('0x28'));});});}})[_0xea16('0x14')](function(){logger['info'](util[_0xea16('0xd')](_0xea16('0x29'),EXTRACTED_REPORT_ID,_0xea16('0xf')));return analyticExtractedReport('Completed',_0x1c2993?util[_0xea16('0xd')](_0xea16('0x26'),_0x972cbd,_0x1c2993?_0xea16('0x2a'):_0xea16('0x25')):null);});})[_0xea16('0x2b')](function(_0x443950){logger[_0xea16('0xc')](util[_0xea16('0xd')](_0xea16('0x2c'),EXTRACTED_REPORT_ID,_0xea16('0xf')),util[_0xea16('0x2d')](_0x443950,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xea16('0x2e'));})[_0xea16('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd0bc=['CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','writeFileSync','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','to-csv','bluebird','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x28f881,_0x50fc96){var _0x494140=function(_0xf1f763){while(--_0xf1f763){_0x28f881['push'](_0x28f881['shift']());}};_0x494140(++_0x50fc96);}(_0xd0bc,0x13d));var _0xcd0b=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xd0bc[_0x15cbce];return _0x257f29;};'use strict';var util=require(_0xcd0b('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0xcd0b('0x1'));var fs=require('fs');var BPromise=require(_0xcd0b('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xcd0b('0x3'))['db'];var dbH=require(_0xcd0b('0x3'))[_0xcd0b('0x4')];var logger=require(_0xcd0b('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcd0b('0x6')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xcd0b('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x40f5b1,_0x245a61){var _0x6f347b={'status':_0x40f5b1};var _0x58897e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x245a61){_0x6f347b[_0xcd0b('0x7')]=_0x245a61;}return db[_0xcd0b('0x8')][_0xcd0b('0x9')](_0x6f347b,_0x58897e);}function main(){var _0x3f581d=0x1388;var _0x5aede4;logger['info'](util[_0xcd0b('0xa')](_0xcd0b('0xb'),EXTRACTED_REPORT_ID,_0xcd0b('0xc')));return db[_0xcd0b('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcd0b('0xe'),_0xcd0b('0xf')]})['then'](function(_0x2bb79a){if(_0x2bb79a){_0x5aede4=_0x2bb79a;_0x3f581d=_0x5aede4[_0xcd0b('0xf')]||0x1388;}})[_0xcd0b('0x10')](function(){return dbH[_0xcd0b('0x11')][_0xcd0b('0x12')](util['format'](_0xcd0b('0x13'),QUERY),{'type':dbH[_0xcd0b('0x11')][_0xcd0b('0x14')][_0xcd0b('0x15')]});})[_0xcd0b('0x10')](function(_0x136428){if(!_0x136428[0x0][_0xcd0b('0x16')]){return analyticExtractedReport(_0xcd0b('0x17'));}var _0x3a6de8=[];var _0x3365c3=0x0;if(_0x5aede4['split']){if(_0x136428&&_0x136428[_0xcd0b('0x18')]){var _0x58959b=_[_0xcd0b('0x19')](_0x136428[0x0]['num']/_0x3f581d);var _0x468c92=Number[_0xcd0b('0x1a')](_0x136428[0x0][_0xcd0b('0x16')]/_0x3f581d)?_0x136428[0x0][_0xcd0b('0x16')]%_0x3f581d:0x0;_0x58959b[_0xcd0b('0x1b')](function(_0x5b4b5e){if(_0x5b4b5e>0x0){_0x3365c3+=_0x3f581d;}_0x3a6de8['push'](dbH['sequelize'][_0xcd0b('0x12')](util[_0xcd0b('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3f581d,_0x3365c3),{'type':dbH[_0xcd0b('0x11')][_0xcd0b('0x14')][_0xcd0b('0x15')]}));});if(_0x468c92>0x0){_0x3365c3+=_0x3f581d;_0x3a6de8[_0xcd0b('0x1c')](dbH['sequelize'][_0xcd0b('0x12')](util[_0xcd0b('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x468c92,_0x3365c3),{'type':dbH['sequelize'][_0xcd0b('0x14')]['SELECT']}));}}}else{_0x3a6de8['push'](dbH['sequelize'][_0xcd0b('0x12')](QUERY,{'type':dbH[_0xcd0b('0x11')]['QueryTypes']['SELECT']}));}var _0xc5b33a=path[_0xcd0b('0x1d')](PATH);var _0x3af7c8=path[_0xcd0b('0x1e')](PATH,_0xcd0b('0x1f'));var _0x3c3f8d=_0x5aede4[_0xcd0b('0xe')]&&_0x3a6de8[_0xcd0b('0x18')]>0x1;var _0x4eb4ed=[];if(!fs[_0xcd0b('0x20')](path[_0xcd0b('0x21')](_0xc5b33a,_0x3af7c8))&&_0x3c3f8d){fs[_0xcd0b('0x22')](path[_0xcd0b('0x21')](_0xc5b33a,_0x3af7c8));}return BPromise[_0xcd0b('0x23')](_0x3a6de8,function(_0x46e046){_0x4eb4ed[_0xcd0b('0x1c')](_0x46e046);})[_0xcd0b('0x10')](function(){for(var _0x987e56=0x0;_0x987e56<_0x4eb4ed[_0xcd0b('0x18')];_0x987e56+=0x1){var _0x5d7c5d;var _0x2a47bc=_0x4eb4ed[_0x987e56];if(_0x3c3f8d){_0x5d7c5d=path['join'](_0xc5b33a,_0x3af7c8,util['format']('%s%d.%s',_0x3af7c8,_0x987e56,_0xcd0b('0x24')));}else{_0x5d7c5d=path[_0xcd0b('0x21')](_0xc5b33a,util[_0xcd0b('0xa')]('%s.%s',_0x3af7c8,_0xcd0b('0x24')));}fs[_0xcd0b('0x25')](_0x5d7c5d,csv(_0x2a47bc));}})[_0xcd0b('0x10')](function(){if(_0x3c3f8d){return new Promise(function(_0x425ad9){zipdir(path['join'](_0xc5b33a,_0x3af7c8),{'saveTo':path[_0xcd0b('0x21')](_0xc5b33a,util['format'](_0xcd0b('0x26'),_0x3af7c8,'zip'))},function(_0x301257,_0x58500f){rimraf(path['join'](_0xc5b33a,_0x3af7c8),function(){});_0x425ad9(_0xcd0b('0x27'));});});}})[_0xcd0b('0x10')](function(){logger[_0xcd0b('0x28')](util[_0xcd0b('0xa')](_0xcd0b('0x29'),EXTRACTED_REPORT_ID,_0xcd0b('0xc')));return analyticExtractedReport(_0xcd0b('0x2a'),_0x3c3f8d?util['format'](_0xcd0b('0x26'),_0x3af7c8,_0x3c3f8d?'zip':'csv'):null);});})['catch'](function(_0x4ea6e2){logger['info'](util[_0xcd0b('0xa')](_0xcd0b('0x2b'),EXTRACTED_REPORT_ID,_0xcd0b('0xc')),util[_0xcd0b('0x2c')](_0x4ea6e2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcd0b('0x2d'));})['finally'](function(){process[_0xcd0b('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 6b7b6d5..2c4b43d 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 _0x1359=['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','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','map','tableHeader','pick','value','fill','length','auto','body','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split','splitSizePdf','then','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info'];(function(_0x5b5616,_0x29e59a){var _0x48fd7d=function(_0x302c6e){while(--_0x302c6e){_0x5b5616['push'](_0x5b5616['shift']());}};_0x48fd7d(++_0x29e59a);}(_0x1359,0x70));var _0x9135=function(_0x23d66c,_0x3215b3){_0x23d66c=_0x23d66c-0x0;var _0x1e9c80=_0x1359[_0x23d66c];return _0x1e9c80;};'use strict';var _=require(_0x9135('0x0'));var fs=require('fs');var util=require(_0x9135('0x1'));var path=require(_0x9135('0x2'));var moment=require(_0x9135('0x3'));var htmlToPdfmake=require(_0x9135('0x4'));var PdfPrinter=require(_0x9135('0x5'));var zipdir=require(_0x9135('0x6'));var rimraf=require(_0x9135('0x7'));var JSDOM=require(_0x9135('0x8'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x9135('0x9'));var db=require(_0x9135('0xa'))['db'];var dbH=require(_0x9135('0xa'))[_0x9135('0xb')];var logger=require(_0x9135('0xc'))(_0x9135('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x9135('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x9135('0xe')][0x4];var NAME=process[_0x9135('0xe')][0x5];var FORMAT=_0x9135('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5c4c42,_0x204978){var _0x113cf0={'status':_0x5c4c42};var _0x28fb3a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x204978){_0x113cf0[_0x9135('0x10')]=_0x204978;}return db['AnalyticExtractedReport']['update'](_0x113cf0,_0x28fb3a);}function getHeaders(_0x552a21){return _[_0x9135('0x11')](_0x552a21,function(_0x3ca7ff){return{'text':_0x3ca7ff,'style':_0x9135('0x12')};});}function getRows(_0x5ce4ee,_0x187999){return _[_0x9135('0x11')](_0x187999,function(_0x146f0f){return _(_0x146f0f)[_0x9135('0x13')](_0x5ce4ee)['map'](function(_0xbb874){return _0xbb874?_['toString'](_0xbb874):'';})[_0x9135('0x14')]();});}function createTable(_0x4bb3f7,_0x1e5835){var _0x22d1f5={'widths':_[_0x9135('0x15')](Array(_0x4bb3f7[_0x9135('0x16')]),0x91),'heights':function(_0x26fe31){return _0x26fe31===0x0?_0x9135('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x267e66=getHeaders(_0x4bb3f7);_0x22d1f5[_0x9135('0x18')][_0x9135('0x19')](_0x267e66);var _0x6f7671=getRows(_0x4bb3f7,_0x1e5835);_0x22d1f5[_0x9135('0x18')]=_0x22d1f5[_0x9135('0x18')][_0x9135('0x1a')](_0x6f7671);return _0x22d1f5;}function createTables(_0x5332cf){var _0xa1a98b=[];var _0x43e165=_['chunk'](Object[_0x9135('0x1b')](_0x5332cf[0x0]),0x5);_0x43e165[_0x9135('0x1c')](function(_0x2db53c){_0xa1a98b['push'](createTable(_0x2db53c,_0x5332cf));});return _0xa1a98b;}function getPDFDocDefinition(_0x2da313){var _0x27eb9d=util[_0x9135('0x1d')](_0x9135('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x9135('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x9135('0x20')])[_0x9135('0x1d')](FORMAT));var _0x40d897=[];for(var _0x262812=0x0;_0x262812<_0x2da313['length'];_0x262812++){var _0xefb3f1=[];if(_0x262812===0x0){_0xefb3f1[_0x9135('0x19')]({'text':_0x27eb9d,'style':_0x9135('0x21')});}var _0x2b2f59={'table':_0x2da313[_0x262812]};if(_0x262812>0x0){_0x2b2f59[_0x9135('0x22')]='before';_0x2b2f59[_0x9135('0x23')]=[0x0,0x46,0x0,0x0];}_0xefb3f1[_0x9135('0x19')](_0x2b2f59);_0x40d897['push'](_0xefb3f1);}return{'pageSize':'A4','pageOrientation':_0x9135('0x24'),'content':_0x40d897,'footer':function(_0x422dd6,_0x28c1a4){return{'text':_0x422dd6['toString']()+_0x9135('0x25')+_0x28c1a4,'style':_0x9135('0x26')};},'defaultStyle':{'font':_0x9135('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9135('0x28')},'footer':{'alignment':_0x9135('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x16b4c3){var _0xa6c2db=0x1388;var _0x2e7ab0;if(!_0x16b4c3[0x0]['num']){return analyticExtractedReport(_0x9135('0x2a'));}return db[_0x9135('0x2b')][_0x9135('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9135('0x2d'),_0x9135('0x2e')]})['then'](function(_0xd05688){if(_0xd05688){_0x2e7ab0=_0xd05688;_0xa6c2db=_0x2e7ab0[_0x9135('0x2e')]||0x3e8;}})[_0x9135('0x2f')](function(){var _0x23a39d=[];var _0x5e3a98=0x0;if(_0x2e7ab0[_0x9135('0x2d')]){if(_0x16b4c3&&_0x16b4c3[_0x9135('0x16')]){var _0x359b00=_['range'](_0x16b4c3[0x0][_0x9135('0x30')]/_0xa6c2db);var _0x5ea914=Number[_0x9135('0x31')](_0x16b4c3[0x0][_0x9135('0x30')]/_0xa6c2db)?_0x16b4c3[0x0][_0x9135('0x30')]%_0xa6c2db:0x0;_0x359b00['forEach'](function(_0x57db89){if(_0x57db89>0x0){_0x5e3a98+=_0xa6c2db;}_0x23a39d[_0x9135('0x19')](dbH[_0x9135('0x32')][_0x9135('0x33')](util[_0x9135('0x1d')](_0x9135('0x34'),QUERY,_0xa6c2db,_0x5e3a98),{'type':dbH['sequelize'][_0x9135('0x35')][_0x9135('0x36')]}));});if(_0x5ea914>0x0){_0x5e3a98+=_0xa6c2db;_0x23a39d[_0x9135('0x19')](dbH[_0x9135('0x32')][_0x9135('0x33')](util[_0x9135('0x1d')](_0x9135('0x34'),QUERY,_0x5ea914,_0x5e3a98),{'type':dbH[_0x9135('0x32')]['QueryTypes'][_0x9135('0x36')]}));}}}else{_0x23a39d[_0x9135('0x19')](dbH[_0x9135('0x32')][_0x9135('0x33')](QUERY,{'type':dbH[_0x9135('0x32')]['QueryTypes'][_0x9135('0x36')]}));}var _0x4c668a=path[_0x9135('0x37')](PATH);var _0x33dbd6=path['basename'](PATH,_0x9135('0x38'));var _0x572469=_0x2e7ab0['split']&&_0x23a39d['length']>0x1;var _0x2b7871=[];if(!fs['existsSync'](path['join'](_0x4c668a,_0x33dbd6))&&_0x572469){fs[_0x9135('0x39')](path[_0x9135('0x3a')](_0x4c668a,_0x33dbd6));}return BPromise[_0x9135('0x3b')](_0x23a39d,function(_0x4958fc){_0x2b7871['push'](_0x4958fc);})[_0x9135('0x2f')](function(){var _0x9a412f=[];for(var _0x413ebe=0x0;_0x413ebe<_0x2b7871[_0x9135('0x16')];_0x413ebe+=0x1){var _0x1d6d00=_0x2b7871[_0x413ebe];var _0x5330d1=createTables(_[_0x9135('0x3c')](_0x1d6d00));var _0xb723dd;var _0x1bafc8=getPDFDocDefinition(_0x5330d1);var _0x3d07a3=getPDFPrinter();var _0x1afdba=_0x3d07a3[_0x9135('0x3d')](_0x1bafc8);if(_0x572469){_0xb723dd=path[_0x9135('0x3a')](_0x4c668a,_0x33dbd6,util[_0x9135('0x1d')](_0x9135('0x3e'),_0x33dbd6,_0x413ebe,_0x9135('0x3f')));}else{_0xb723dd=path[_0x9135('0x3a')](_0x4c668a,util[_0x9135('0x1d')]('%s.%s',_0x33dbd6,_0x9135('0x3f')));}_0x9a412f[_0x9135('0x19')](writePDFDocument(_0x1afdba,_0xb723dd));}return Promise['all'](_0x9a412f);})[_0x9135('0x2f')](function(){if(_0x572469){return new Promise(function(_0x33d103){zipdir(path[_0x9135('0x3a')](_0x4c668a,_0x33dbd6),{'saveTo':path[_0x9135('0x3a')](_0x4c668a,util[_0x9135('0x1d')](_0x9135('0x40'),_0x33dbd6,_0x9135('0x41')))},function(){rimraf(path[_0x9135('0x3a')](_0x4c668a,_0x33dbd6),function(){});_0x33d103(_0x9135('0x42'));});});}})[_0x9135('0x2f')](function(){if(!_0x572469)return;rimraf(path[_0x9135('0x3a')](_0x4c668a,_0x33dbd6),function(){});})[_0x9135('0x2f')](function(){logger[_0x9135('0x43')](util[_0x9135('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x9135('0x44')));return analyticExtractedReport('Completed',_0x572469?util[_0x9135('0x1d')](_0x9135('0x40'),_0x33dbd6,_0x572469?_0x9135('0x41'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9135('0x43')](util[_0x9135('0x1d')](_0x9135('0x45'),EXTRACTED_REPORT_ID,_0x9135('0x44')));return db['AnalyticExtractedReport'][_0x9135('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9135('0x2f')](function(_0x2ca57c){EXTRACTED_REPORT=_0x2ca57c;return dbH[_0x9135('0x32')][_0x9135('0x33')](util['format'](_0x9135('0x47'),QUERY),{'type':dbH[_0x9135('0x32')][_0x9135('0x35')][_0x9135('0x36')]});})[_0x9135('0x2f')](extractReport)[_0x9135('0x48')](function(_0x43ea5b){logger['info'](util[_0x9135('0x1d')](_0x9135('0x49'),EXTRACTED_REPORT_ID,_0x9135('0x44')),util[_0x9135('0x4a')](_0x43ea5b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9135('0x4b'));})[_0x9135('0x4c')](function(){process[_0x9135('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1f9462=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x9135('0x4e'),'italics':__dirname+_0x9135('0x4f'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x1f9462;}function getPDFDocDefinitionFromHTML(_0x635ed1,_0x2c0d79){var _0x2dc45e=util[_0x9135('0x1d')]('%s\x20#%d',_0x2c0d79[_0x9135('0x50')],_0x2c0d79['interactionId']);var _0x2d5078=moment()[_0x9135('0x1d')](_0x9135('0x51'))['toString']();var _0xae798d=htmlToPdfmake(_0x635ed1,{'window':window,'tableAutoSize':!![]});return{'content':[_0xae798d],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9135('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9135('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9135('0x52')}},'header':function(){return[{'text':_0x9135('0x53'),'style':_0x9135('0x21')}];},'footer':function(_0x5369ae,_0x34ee96){return[{'text':util[_0x9135('0x1d')](_0x9135('0x54'),_0x2dc45e,_0x5369ae,_0x34ee96,_0x2d5078),'style':'footer'}];}};}function writePDFDocument(_0x214bbf,_0x1fdc07){return new Promise(function(_0x321401,_0x381c0b){var _0x141da4=_0x214bbf[_0x9135('0x55')](fs['createWriteStream'](_0x1fdc07));_0x141da4['on']('finish',function(){_0x321401(_0x9135('0x56'));});_0x141da4['on'](_0x9135('0x57'),function(_0x46061c){_0x381c0b(_0x46061c);});_0x214bbf[_0x9135('0x58')]();});}exports[_0x9135('0x59')]=function(_0x2a99a6,_0x1ed45b){var _0xc8114a=getPDFPrinter();var _0xe69e43=getPDFDocDefinitionFromHTML(_0x2a99a6,_0x1ed45b);var _0x35c912=_0xc8114a[_0x9135('0x3d')](_0xe69e43);return writePDFDocument(_0x35c912,_0x1ed45b[_0x9135('0x2')])[_0x9135('0x48')](function(_0x5ee821){throw _0x5ee821;});}; \ No newline at end of file +var _0xb30a=['all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','%s.%s','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','finish','error','createPdfFromHTML','path','lodash','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','fill','length','auto','body','push','concat','chunk','keys','forEach','format','name','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','Arial','black','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf'];(function(_0x3e7871,_0x444efb){var _0x1af655=function(_0x71282f){while(--_0x71282f){_0x3e7871['push'](_0x3e7871['shift']());}};_0x1af655(++_0x444efb);}(_0xb30a,0xd9));var _0xab30=function(_0x583c56,_0x5cc77c){_0x583c56=_0x583c56-0x0;var _0x4794ce=_0xb30a[_0x583c56];return _0x4794ce;};'use strict';var _=require(_0xab30('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0xab30('0x1'));var htmlToPdfmake=require(_0xab30('0x2'));var PdfPrinter=require(_0xab30('0x3'));var zipdir=require(_0xab30('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0xab30('0x5'))[_0xab30('0x6')];var window=new JSDOM('')[_0xab30('0x7')];var BPromise=require(_0xab30('0x8'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xab30('0x9')];var logger=require(_0xab30('0xa'))(_0xab30('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xab30('0xc')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xab30('0xc')][0x5];var FORMAT=_0xab30('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4dd4cc,_0x1dc8a7){var _0x1a2a91={'status':_0x4dd4cc};var _0x5bdee0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1dc8a7){_0x1a2a91[_0xab30('0xe')]=_0x1dc8a7;}return db['AnalyticExtractedReport'][_0xab30('0xf')](_0x1a2a91,_0x5bdee0);}function getHeaders(_0x2b0f4b){return _[_0xab30('0x10')](_0x2b0f4b,function(_0x260ff5){return{'text':_0x260ff5,'style':_0xab30('0x11')};});}function getRows(_0x5df100,_0x2873c3){return _[_0xab30('0x10')](_0x2873c3,function(_0x15a0c0){return _(_0x15a0c0)[_0xab30('0x12')](_0x5df100)[_0xab30('0x10')](function(_0x5d855c){return _0x5d855c?_['toString'](_0x5d855c):'';})['value']();});}function createTable(_0xd449f9,_0x13fff0){var _0x297231={'widths':_[_0xab30('0x13')](Array(_0xd449f9[_0xab30('0x14')]),0x91),'heights':function(_0x2b2291){return _0x2b2291===0x0?_0xab30('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5df949=getHeaders(_0xd449f9);_0x297231[_0xab30('0x16')][_0xab30('0x17')](_0x5df949);var _0x3f4384=getRows(_0xd449f9,_0x13fff0);_0x297231[_0xab30('0x16')]=_0x297231['body'][_0xab30('0x18')](_0x3f4384);return _0x297231;}function createTables(_0xe0d892){var _0x4bab43=[];var _0x516de5=_[_0xab30('0x19')](Object[_0xab30('0x1a')](_0xe0d892[0x0]),0x5);_0x516de5[_0xab30('0x1b')](function(_0x4722dd){_0x4bab43[_0xab30('0x17')](createTable(_0x4722dd,_0xe0d892));});return _0x4bab43;}function getPDFDocDefinition(_0x2eb9ce){var _0x2c2a45=util[_0xab30('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xab30('0x1d')],moment(EXTRACTED_REPORT[_0xab30('0x1e')])[_0xab30('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xab30('0x1f')])[_0xab30('0x1c')](FORMAT));var _0x3b7a84=[];for(var _0xd41c1c=0x0;_0xd41c1c<_0x2eb9ce[_0xab30('0x14')];_0xd41c1c++){var _0x2dc206=[];if(_0xd41c1c===0x0){_0x2dc206[_0xab30('0x17')]({'text':_0x2c2a45,'style':_0xab30('0x20')});}var _0x295f5={'table':_0x2eb9ce[_0xd41c1c]};if(_0xd41c1c>0x0){_0x295f5[_0xab30('0x21')]=_0xab30('0x22');_0x295f5[_0xab30('0x23')]=[0x0,0x46,0x0,0x0];}_0x2dc206[_0xab30('0x17')](_0x295f5);_0x3b7a84[_0xab30('0x17')](_0x2dc206);}return{'pageSize':'A4','pageOrientation':_0xab30('0x24'),'content':_0x3b7a84,'footer':function(_0x2161c8,_0x17b0ee){return{'text':_0x2161c8[_0xab30('0x25')]()+_0xab30('0x26')+_0x17b0ee,'style':'footer'};},'defaultStyle':{'font':_0xab30('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xab30('0x28')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2ba9c9){var _0x9e7ffa=0x1388;var _0x29742;if(!_0x2ba9c9[0x0][_0xab30('0x29')]){return analyticExtractedReport(_0xab30('0x2a'));}return db[_0xab30('0x2b')][_0xab30('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xab30('0x2d')]})['then'](function(_0x13e5f2){if(_0x13e5f2){_0x29742=_0x13e5f2;_0x9e7ffa=_0x29742['splitSizePdf']||0x3e8;}})[_0xab30('0x2e')](function(){var _0x5a1e93=[];var _0x33f825=0x0;if(_0x29742[_0xab30('0x2f')]){if(_0x2ba9c9&&_0x2ba9c9['length']){var _0x1e9f38=_[_0xab30('0x30')](_0x2ba9c9[0x0][_0xab30('0x29')]/_0x9e7ffa);var _0x1b4532=Number[_0xab30('0x31')](_0x2ba9c9[0x0][_0xab30('0x29')]/_0x9e7ffa)?_0x2ba9c9[0x0][_0xab30('0x29')]%_0x9e7ffa:0x0;_0x1e9f38[_0xab30('0x1b')](function(_0x27264f){if(_0x27264f>0x0){_0x33f825+=_0x9e7ffa;}_0x5a1e93['push'](dbH['sequelize'][_0xab30('0x32')](util[_0xab30('0x1c')](_0xab30('0x33'),QUERY,_0x9e7ffa,_0x33f825),{'type':dbH[_0xab30('0x34')][_0xab30('0x35')][_0xab30('0x36')]}));});if(_0x1b4532>0x0){_0x33f825+=_0x9e7ffa;_0x5a1e93[_0xab30('0x17')](dbH[_0xab30('0x34')]['query'](util[_0xab30('0x1c')](_0xab30('0x33'),QUERY,_0x1b4532,_0x33f825),{'type':dbH['sequelize']['QueryTypes'][_0xab30('0x36')]}));}}}else{_0x5a1e93[_0xab30('0x17')](dbH[_0xab30('0x34')][_0xab30('0x32')](QUERY,{'type':dbH[_0xab30('0x34')][_0xab30('0x35')][_0xab30('0x36')]}));}var _0x28fca0=path[_0xab30('0x37')](PATH);var _0x1f30bc=path[_0xab30('0x38')](PATH,_0xab30('0x39'));var _0x571bf5=_0x29742[_0xab30('0x2f')]&&_0x5a1e93['length']>0x1;var _0xc63f0a=[];if(!fs['existsSync'](path['join'](_0x28fca0,_0x1f30bc))&&_0x571bf5){fs[_0xab30('0x3a')](path[_0xab30('0x3b')](_0x28fca0,_0x1f30bc));}return BPromise[_0xab30('0x3c')](_0x5a1e93,function(_0x583f95){_0xc63f0a[_0xab30('0x17')](_0x583f95);})['then'](function(){var _0xc90569=[];for(var _0x565766=0x0;_0x565766<_0xc63f0a[_0xab30('0x14')];_0x565766+=0x1){var _0x166590=_0xc63f0a[_0x565766];var _0x21a63c=createTables(_[_0xab30('0x3d')](_0x166590));var _0x77314f;var _0x5505ae=getPDFDocDefinition(_0x21a63c);var _0x3a9dd5=getPDFPrinter();var _0x86c72c=_0x3a9dd5[_0xab30('0x3e')](_0x5505ae);if(_0x571bf5){_0x77314f=path[_0xab30('0x3b')](_0x28fca0,_0x1f30bc,util[_0xab30('0x1c')](_0xab30('0x3f'),_0x1f30bc,_0x565766,_0xab30('0x40')));}else{_0x77314f=path['join'](_0x28fca0,util[_0xab30('0x1c')]('%s.%s',_0x1f30bc,_0xab30('0x40')));}_0xc90569[_0xab30('0x17')](writePDFDocument(_0x86c72c,_0x77314f));}return Promise[_0xab30('0x41')](_0xc90569);})[_0xab30('0x2e')](function(){if(_0x571bf5){return new Promise(function(_0x2059ce){zipdir(path[_0xab30('0x3b')](_0x28fca0,_0x1f30bc),{'saveTo':path[_0xab30('0x3b')](_0x28fca0,util[_0xab30('0x1c')]('%s.%s',_0x1f30bc,_0xab30('0x42')))},function(){rimraf(path['join'](_0x28fca0,_0x1f30bc),function(){});_0x2059ce('zip\x20finished');});});}})['then'](function(){if(!_0x571bf5)return;rimraf(path['join'](_0x28fca0,_0x1f30bc),function(){});})[_0xab30('0x2e')](function(){logger[_0xab30('0x43')](util[_0xab30('0x1c')](_0xab30('0x44'),EXTRACTED_REPORT_ID,_0xab30('0x45')));return analyticExtractedReport(_0xab30('0x46'),_0x571bf5?util[_0xab30('0x1c')](_0xab30('0x47'),_0x1f30bc,_0x571bf5?_0xab30('0x42'):_0xab30('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xab30('0x43')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xab30('0x45')));return db[_0xab30('0x48')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x53b6ed){EXTRACTED_REPORT=_0x53b6ed;return dbH[_0xab30('0x34')]['query'](util[_0xab30('0x1c')](_0xab30('0x49'),QUERY),{'type':dbH[_0xab30('0x34')][_0xab30('0x35')][_0xab30('0x36')]});})[_0xab30('0x2e')](extractReport)[_0xab30('0x4a')](function(_0x3453d1){logger[_0xab30('0x43')](util['format'](_0xab30('0x4b'),EXTRACTED_REPORT_ID,'PDF'),util[_0xab30('0x4c')](_0x3453d1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xab30('0x4d'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3b8dc6=new PdfPrinter({'Arial':{'normal':__dirname+_0xab30('0x4e'),'bold':__dirname+_0xab30('0x4f'),'italics':__dirname+_0xab30('0x50'),'bolditalics':__dirname+_0xab30('0x51')}});return _0x3b8dc6;}function getPDFDocDefinitionFromHTML(_0x4ccdd9,_0x40774e){var _0x45129e=util['format'](_0xab30('0x52'),_0x40774e[_0xab30('0x53')],_0x40774e[_0xab30('0x54')]);var _0x4c0bc4=moment()[_0xab30('0x1c')](_0xab30('0x55'))[_0xab30('0x25')]();var _0x4fd63a=htmlToPdfmake(_0x4ccdd9,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4fd63a],'defaultStyle':{'font':_0xab30('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xab30('0x56'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xab30('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xab30('0x20')}];},'footer':function(_0x34319e,_0x4eed79){return[{'text':util[_0xab30('0x1c')](_0xab30('0x57'),_0x45129e,_0x34319e,_0x4eed79,_0x4c0bc4),'style':_0xab30('0x58')}];}};}function writePDFDocument(_0xc1e61a,_0x365905){return new Promise(function(_0xf01d86,_0x4b9380){var _0x25ccfa=_0xc1e61a[_0xab30('0x59')](fs['createWriteStream'](_0x365905));_0x25ccfa['on']('finish',function(){_0xf01d86(_0xab30('0x5a'));});_0x25ccfa['on'](_0xab30('0x5b'),function(_0x540d04){_0x4b9380(_0x540d04);});_0xc1e61a['end']();});}exports[_0xab30('0x5c')]=function(_0xae5f09,_0x3c50f5){var _0x88001b=getPDFPrinter();var _0x64e582=getPDFDocDefinitionFromHTML(_0xae5f09,_0x3c50f5);var _0x24d31c=_0x88001b[_0xab30('0x3e')](_0x64e582);return writePDFDocument(_0x24d31c,_0x3c50f5[_0xab30('0x5d')])[_0xab30('0x4a')](function(_0xaba5ac){throw _0xaba5ac;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index c12ed0a..d13e49a 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 _0x52b8=['Setting','split','splitSizeXlsx','sequelize','query','QueryTypes','SELECT','then','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','each','join','xlsx','binary','%s.%s','zip\x20finished','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','path','json2xls','bluebird','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX'];(function(_0x35b87c,_0x166a8c){var _0x24795b=function(_0x2cb112){while(--_0x2cb112){_0x35b87c['push'](_0x35b87c['shift']());}};_0x24795b(++_0x166a8c);}(_0x52b8,0xd3));var _0x852b=function(_0x3f562c,_0x14be7b){_0x3f562c=_0x3f562c-0x0;var _0x2c41cc=_0x52b8[_0x3f562c];return _0x2c41cc;};'use strict';var util=require('util');var path=require(_0x852b('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x852b('0x1'));var BPromise=require(_0x852b('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x852b('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0x852b('0x4'))['dbH'];var logger=require('../../config/logger')(_0x852b('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x852b('0x6')][0x3];var PATH=process[_0x852b('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4f7e7e,_0x51aaf5){var _0x480294={'status':_0x4f7e7e};var _0x375f86={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51aaf5){_0x480294[_0x852b('0x7')]=_0x51aaf5;}return db[_0x852b('0x8')][_0x852b('0x9')](_0x480294,_0x375f86);}function main(){var _0x1d5387=0x1388;var _0x5d4c6a;logger[_0x852b('0xa')](util[_0x852b('0xb')](_0x852b('0xc'),EXTRACTED_REPORT_ID,_0x852b('0xd')));return db[_0x852b('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x852b('0xf'),_0x852b('0x10')]})['then'](function(_0x4190a1){if(_0x4190a1){_0x5d4c6a=_0x4190a1;_0x1d5387=_0x5d4c6a[_0x852b('0x10')]||0x1388;}})['then'](function(){return dbH[_0x852b('0x11')][_0x852b('0x12')](util[_0x852b('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x852b('0x11')][_0x852b('0x13')][_0x852b('0x14')]});})[_0x852b('0x15')](function(_0x18c602){if(!_0x18c602[0x0][_0x852b('0x16')]){return analyticExtractedReport(_0x852b('0x17'));}var _0x15e51d=[];var _0x5743c2=0x0;if(_0x5d4c6a['split']){if(_0x18c602&&_0x18c602[_0x852b('0x18')]){var _0x45455b=_[_0x852b('0x19')](_0x18c602[0x0]['num']/_0x1d5387);var _0x406a0b=Number[_0x852b('0x1a')](_0x18c602[0x0][_0x852b('0x16')]/_0x1d5387)?_0x18c602[0x0][_0x852b('0x16')]%_0x1d5387:0x0;_0x45455b[_0x852b('0x1b')](function(_0x3e4f21){if(_0x3e4f21>0x0){_0x5743c2+=_0x1d5387;}_0x15e51d[_0x852b('0x1c')](dbH[_0x852b('0x11')][_0x852b('0x12')](util[_0x852b('0xb')](_0x852b('0x1d'),QUERY,_0x1d5387,_0x5743c2),{'type':dbH[_0x852b('0x11')][_0x852b('0x13')][_0x852b('0x14')]}));});if(_0x406a0b>0x0){_0x5743c2+=_0x1d5387;_0x15e51d[_0x852b('0x1c')](dbH[_0x852b('0x11')][_0x852b('0x12')](util[_0x852b('0xb')](_0x852b('0x1d'),QUERY,_0x406a0b,_0x5743c2),{'type':dbH[_0x852b('0x11')][_0x852b('0x13')][_0x852b('0x14')]}));}}}else{_0x15e51d[_0x852b('0x1c')](dbH[_0x852b('0x11')]['query'](QUERY,{'type':dbH['sequelize'][_0x852b('0x13')][_0x852b('0x14')]}));}var _0x110e34=path[_0x852b('0x1e')](PATH);var _0x1e525d=path[_0x852b('0x1f')](PATH,_0x852b('0x20'));var _0x1f5ac1=_0x5d4c6a[_0x852b('0xf')]&&_0x15e51d[_0x852b('0x18')]>0x1;var _0x3b3201=[];if(!fs[_0x852b('0x21')](path['join'](_0x110e34,_0x1e525d))&&_0x1f5ac1){fs['mkdirSync'](path['join'](_0x110e34,_0x1e525d));}return BPromise[_0x852b('0x22')](_0x15e51d,function(_0xce3709){_0x3b3201[_0x852b('0x1c')](_0xce3709);})[_0x852b('0x15')](function(){for(var _0x831773=0x0;_0x831773<_0x3b3201[_0x852b('0x18')];_0x831773+=0x1){var _0xe8b4f9;var _0x450838=_0x3b3201[_0x831773];if(_0x1f5ac1){_0xe8b4f9=path[_0x852b('0x23')](_0x110e34,_0x1e525d,util[_0x852b('0xb')]('%s%d.%s',_0x1e525d,_0x831773,'xlsx'));}else{_0xe8b4f9=path['join'](_0x110e34,util['format']('%s.%s',_0x1e525d,_0x852b('0x24')));}fs['writeFileSync'](_0xe8b4f9,json2xls(_0x450838),_0x852b('0x25'));}})[_0x852b('0x15')](function(){if(_0x1f5ac1){return new Promise(function(_0x70d1fb){zipdir(path[_0x852b('0x23')](_0x110e34,_0x1e525d),{'saveTo':path[_0x852b('0x23')](_0x110e34,util[_0x852b('0xb')](_0x852b('0x26'),_0x1e525d,'zip'))},function(_0x2e895c,_0x2161de){rimraf(path[_0x852b('0x23')](_0x110e34,_0x1e525d),function(){});_0x70d1fb(_0x852b('0x27'));});});}})[_0x852b('0x15')](function(){logger[_0x852b('0xa')](util[_0x852b('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x852b('0xd')));return analyticExtractedReport(_0x852b('0x28'),_0x1f5ac1?util[_0x852b('0xb')](_0x852b('0x26'),_0x1e525d,_0x1f5ac1?_0x852b('0x29'):'xlsx'):null);});})[_0x852b('0x2a')](function(_0x120cdf){logger[_0x852b('0xa')](util[_0x852b('0xb')](_0x852b('0x2b'),EXTRACTED_REPORT_ID,_0x852b('0xd')),util['inspect'](_0x120cdf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x852b('0x2c'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x57cc=['Empty','split','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x57cc,0x14b));var _0xc57c=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x57cc[_0x19b84f];return _0x18067b;};'use strict';var util=require(_0xc57c('0x0'));var path=require(_0xc57c('0x1'));var _=require(_0xc57c('0x2'));var fs=require('fs');var json2xls=require(_0xc57c('0x3'));var BPromise=require('bluebird');var zipdir=require(_0xc57c('0x4'));var rimraf=require(_0xc57c('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xc57c('0x6'))[_0xc57c('0x7')];var logger=require(_0xc57c('0x8'))(_0xc57c('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xc57c('0xa')][0x2]);var QUERY=process[_0xc57c('0xa')][0x3];var PATH=process[_0xc57c('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1c285d,_0xb5e673){var _0x2b9e57={'status':_0x1c285d};var _0x1f48f5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb5e673){_0x2b9e57[_0xc57c('0xb')]=_0xb5e673;}return db[_0xc57c('0xc')][_0xc57c('0xd')](_0x2b9e57,_0x1f48f5);}function main(){var _0x4eecff=0x1388;var _0x5a1520;logger['info'](util[_0xc57c('0xe')](_0xc57c('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xc57c('0x10')][_0xc57c('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xc57c('0x12')]})[_0xc57c('0x13')](function(_0x597c99){if(_0x597c99){_0x5a1520=_0x597c99;_0x4eecff=_0x5a1520[_0xc57c('0x12')]||0x1388;}})[_0xc57c('0x13')](function(){return dbH[_0xc57c('0x14')][_0xc57c('0x15')](util[_0xc57c('0xe')](_0xc57c('0x16'),QUERY),{'type':dbH[_0xc57c('0x14')][_0xc57c('0x17')][_0xc57c('0x18')]});})[_0xc57c('0x13')](function(_0x5c4616){if(!_0x5c4616[0x0][_0xc57c('0x19')]){return analyticExtractedReport(_0xc57c('0x1a'));}var _0x51e152=[];var _0x37614d=0x0;if(_0x5a1520[_0xc57c('0x1b')]){if(_0x5c4616&&_0x5c4616[_0xc57c('0x1c')]){var _0x1b6260=_['range'](_0x5c4616[0x0][_0xc57c('0x19')]/_0x4eecff);var _0x145ab1=Number[_0xc57c('0x1d')](_0x5c4616[0x0]['num']/_0x4eecff)?_0x5c4616[0x0][_0xc57c('0x19')]%_0x4eecff:0x0;_0x1b6260['forEach'](function(_0x169730){if(_0x169730>0x0){_0x37614d+=_0x4eecff;}_0x51e152[_0xc57c('0x1e')](dbH[_0xc57c('0x14')][_0xc57c('0x15')](util[_0xc57c('0xe')](_0xc57c('0x1f'),QUERY,_0x4eecff,_0x37614d),{'type':dbH[_0xc57c('0x14')][_0xc57c('0x17')]['SELECT']}));});if(_0x145ab1>0x0){_0x37614d+=_0x4eecff;_0x51e152[_0xc57c('0x1e')](dbH[_0xc57c('0x14')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x145ab1,_0x37614d),{'type':dbH[_0xc57c('0x14')][_0xc57c('0x17')][_0xc57c('0x18')]}));}}}else{_0x51e152[_0xc57c('0x1e')](dbH[_0xc57c('0x14')][_0xc57c('0x15')](QUERY,{'type':dbH[_0xc57c('0x14')][_0xc57c('0x17')]['SELECT']}));}var _0x1e339a=path[_0xc57c('0x20')](PATH);var _0x1a0e13=path['basename'](PATH,_0xc57c('0x21'));var _0x8a338=_0x5a1520['split']&&_0x51e152[_0xc57c('0x1c')]>0x1;var _0x1ab0f4=[];if(!fs[_0xc57c('0x22')](path['join'](_0x1e339a,_0x1a0e13))&&_0x8a338){fs[_0xc57c('0x23')](path[_0xc57c('0x24')](_0x1e339a,_0x1a0e13));}return BPromise[_0xc57c('0x25')](_0x51e152,function(_0x18f14b){_0x1ab0f4[_0xc57c('0x1e')](_0x18f14b);})[_0xc57c('0x13')](function(){for(var _0x35828d=0x0;_0x35828d<_0x1ab0f4[_0xc57c('0x1c')];_0x35828d+=0x1){var _0x31c1a7;var _0x4de09f=_0x1ab0f4[_0x35828d];if(_0x8a338){_0x31c1a7=path[_0xc57c('0x24')](_0x1e339a,_0x1a0e13,util[_0xc57c('0xe')](_0xc57c('0x26'),_0x1a0e13,_0x35828d,_0xc57c('0x27')));}else{_0x31c1a7=path[_0xc57c('0x24')](_0x1e339a,util[_0xc57c('0xe')]('%s.%s',_0x1a0e13,'xlsx'));}fs['writeFileSync'](_0x31c1a7,json2xls(_0x4de09f),_0xc57c('0x28'));}})[_0xc57c('0x13')](function(){if(_0x8a338){return new Promise(function(_0x113bfc){zipdir(path['join'](_0x1e339a,_0x1a0e13),{'saveTo':path[_0xc57c('0x24')](_0x1e339a,util[_0xc57c('0xe')](_0xc57c('0x29'),_0x1a0e13,_0xc57c('0x2a')))},function(_0x2fa741,_0x4c3120){rimraf(path[_0xc57c('0x24')](_0x1e339a,_0x1a0e13),function(){});_0x113bfc(_0xc57c('0x2b'));});});}})[_0xc57c('0x13')](function(){logger[_0xc57c('0x2c')](util[_0xc57c('0xe')](_0xc57c('0x2d'),EXTRACTED_REPORT_ID,_0xc57c('0x2e')));return analyticExtractedReport('Completed',_0x8a338?util[_0xc57c('0xe')](_0xc57c('0x29'),_0x1a0e13,_0x8a338?_0xc57c('0x2a'):_0xc57c('0x27')):null);});})['catch'](function(_0x5d661a){logger[_0xc57c('0x2c')](util[_0xc57c('0xe')](_0xc57c('0x2f'),EXTRACTED_REPORT_ID,_0xc57c('0x2e')),util[_0xc57c('0x30')](_0x5d661a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc57c('0x31'));})[_0xc57c('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 630607f..c9f059f 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 _0x6eb8=['Set','format','CDR(type)=%s','context','VoiceExtensionId','CDR(routeid)=','outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','error','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','extensions','find','push','type'];(function(_0x467d82,_0x4b2698){var _0x5efbc4=function(_0x33cf13){while(--_0x33cf13){_0x467d82['push'](_0x467d82['shift']());}};_0x5efbc4(++_0x4b2698);}(_0x6eb8,0x79));var _0x86eb=function(_0x1146f7,_0x475356){_0x1146f7=_0x1146f7-0x0;var _0x2e5725=_0x6eb8[_0x1146f7];return _0x2e5725;};'use strict';var _=require(_0x86eb('0x0'));var util=require('util');function rewrite(_0x219cf5,_0x4f730e){var _0x31a55b=this;return _0x219cf5[_0x86eb('0x1')][_0x86eb('0x2')][_0x86eb('0x3')]({'raw':!![]})[_0x86eb('0x4')](function(_0x287734){_0x31a55b[_0x86eb('0x5')]=_0x287734;return _0x219cf5[_0x86eb('0x1')][_0x86eb('0x6')][_0x86eb('0x3')]({'where':{'IntervalId':_0x4f730e[_0x86eb('0x7')]},'raw':!![]});})[_0x86eb('0x4')](function(_0x132b56){return _0x219cf5[_0x86eb('0x1')][_0x86eb('0x6')]['findAll']({'where':{'exten':{'$in':_[_0x86eb('0x8')](_[_0x86eb('0x9')](_0x132b56,_0x86eb('0xa')))}},'order':[{'raw':_0x86eb('0xb')}],'raw':!![]});})[_0x86eb('0x4')](function(_0xc85c4b){var _0x409771=_['filter'](_0xc85c4b,{'priority':'1'});var _0x531a5e=_[_0x86eb('0xc')](_0xc85c4b,{'isApp':0x1});var _0x5bc37f=_['groupBy'](_0x531a5e,'exten');var _0x4edba1=[_0x86eb('0xd'),_0x86eb('0xe')];var _0x209f2a=[];var _0x337eb1=[];for(var _0x422a0b in _0x5bc37f){if(_0x5bc37f[_0x86eb('0xf')](_0x422a0b)){_0x31a55b[_0x86eb('0x10')]=0x2;_0x31a55b[_0x86eb('0x11')]=[];_0x31a55b['extension']=_[_0x86eb('0x12')](_0x409771,{'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')]});_0x31a55b['extensions'][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')],'app':_0x86eb('0x15'),'appdata':util[_0x86eb('0x16')](_0x86eb('0x17'),_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')]),'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x31a55b[_0x86eb('0x10')]++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});if(_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')]==='inbound'){_0x31a55b[_0x86eb('0x11')]['push']({'type':_0x5bc37f[_0x422a0b][0x0]['type'],'app':_0x86eb('0x15'),'appdata':_0x86eb('0x1a')+_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')],'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x31a55b[_0x86eb('0x10')]++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});}else if(_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')]===_0x86eb('0x1b')){if(_0x31a55b[_0x86eb('0x1c')]){_0x31a55b['extensions'][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0]['type'],'app':'Set','appdata':_0x86eb('0x1d')+(_0x31a55b['extension']['cutdigits']?_0x86eb('0x1e')+_0x31a55b[_0x86eb('0x1c')][_0x86eb('0x1f')]+'}':'${EXTEN}'),'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x31a55b['priority']++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});}_0x31a55b[_0x86eb('0x11')][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')],'app':_0x86eb('0x15'),'appdata':'CDR(routeid)='+_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')],'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x31a55b['priority']++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0]['VoiceExtensionId']});var _0x36c544=_0x31a55b[_0x86eb('0x10')]++;_0x31a55b[_0x86eb('0x11')][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')],'app':_0x86eb('0x20'),'appdata':_0x86eb('0x21')+(_0x36c544+0x2)+_0x86eb('0x22')+(_0x36c544+0x1)+')','context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x36c544,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});if(_0x31a55b[_0x86eb('0x1c')]){_0x31a55b[_0x86eb('0x11')]['push']({'type':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')],'app':_0x86eb('0x15'),'appdata':_0x31a55b[_0x86eb('0x1c')]['cutdigits']?_0x86eb('0x23')+_0x31a55b[_0x86eb('0x1c')]['cutdigits']+'}':_0x86eb('0x24'),'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0]['exten'],'priority':_0x31a55b[_0x86eb('0x10')]++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0]['VoiceExtensionId']});}_0x31a55b[_0x86eb('0x11')][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')],'app':_0x86eb('0x15'),'appdata':'outboundrouteid='+_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')],'context':_0x5bc37f[_0x422a0b][0x0]['context'],'exten':_0x5bc37f[_0x422a0b][0x0]['exten'],'priority':_0x31a55b[_0x86eb('0x10')]++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0]['VoiceExtensionId']});if(_0x31a55b['extension']&&_0x31a55b[_0x86eb('0x1c')][_0x86eb('0xf')]('recordingFormat')&&_0x31a55b['extension'][_0x86eb('0x25')]!==_0x86eb('0x26')){_0x31a55b['extensions'][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0]['type'],'app':_0x86eb('0x15'),'appdata':_0x86eb('0x27'),'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x31a55b[_0x86eb('0x10')]++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});_0x31a55b['extensions']['push']({'type':_0x5bc37f[_0x422a0b][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x31a55b[_0x86eb('0x1c')][_0x86eb('0x25')]||_0x86eb('0x28'),'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x31a55b[_0x86eb('0x10')]++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});}}_0x31a55b[_0x86eb('0x11')]['push']({'type':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')],'app':_0x86eb('0x15'),'appdata':_0x86eb('0x29'),'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x31a55b['priority']++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0]['VoiceExtensionId']});_0x31a55b[_0x86eb('0x11')][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')],'app':_0x86eb('0x15'),'appdata':_0x86eb('0x2a'),'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'exten':_0x5bc37f[_0x422a0b][0x0]['exten'],'priority':_0x31a55b[_0x86eb('0x10')]++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0]['VoiceExtensionId']});_0x31a55b[_0x86eb('0x11')][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0]['type'],'app':_0x86eb('0x15'),'appdata':_0x86eb('0x2b'),'context':_0x5bc37f[_0x422a0b][0x0]['context'],'exten':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0xa')],'priority':_0x31a55b['priority']++,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});for(var _0x277957=0x0,_0x6861b1=0x0;_0x277957<_0x5bc37f[_0x422a0b][_0x86eb('0x2c')];_0x277957+=0x1,_0x6861b1=0x0){var _0x3a04d5=_0x5bc37f[_0x422a0b][_0x277957];if(_0x3a04d5[_0x86eb('0x14')]){_0x3a04d5[_0x86eb('0x14')]=_0x3a04d5[_0x86eb('0x14')][_0x86eb('0x2d')]();}var _0x3e6e84=[];var _0x2cdb2c=[];delete _0x3a04d5['id'];delete _0x3a04d5[_0x86eb('0x2e')];delete _0x3a04d5[_0x86eb('0x2f')];var _0x53e4aa=_0x3a04d5[_0x86eb('0x30')]!==_0x86eb('0x31')?[_0x3a04d5[_0x86eb('0x30')]]:_0x3a04d5[_0x86eb('0x7')]?_['map'](_[_0x86eb('0xc')](_0x31a55b[_0x86eb('0x5')],{'IntervalId':_0x3a04d5['IntervalId']}),_0x86eb('0x30')):[];if(_0x3a04d5[_0x86eb('0xf')]('tag')){if(_0x3a04d5['tag']&&_0x3a04d5[_0x86eb('0x32')]!=='--'){_0x3e6e84['push']({'type':_0x3a04d5['type'],'app':'Set','appdata':'CDR(tag)='+_0x3a04d5[_0x86eb('0x32')],'context':_0x3a04d5[_0x86eb('0x18')],'exten':_0x3a04d5[_0x86eb('0xa')],'priority':_0x53e4aa[_0x86eb('0x2c')]+_0x31a55b[_0x86eb('0x10')]+_0x6861b1++,'VoiceExtensionId':_0x3a04d5[_0x86eb('0x19')]});}}if(_0x3a04d5[_0x86eb('0x14')]===_0x86eb('0x1b')&&_0x3a04d5[_0x86eb('0xf')](_0x86eb('0x33'))){if(_0x3a04d5[_0x86eb('0x33')]){_0x3e6e84[_0x86eb('0x13')]({'type':_0x3a04d5[_0x86eb('0x14')],'app':_0x86eb('0x20'),'appdata':_0x86eb('0x34')+_0x3a04d5[_0x86eb('0x33')]+')','context':_0x3a04d5[_0x86eb('0x18')],'exten':_0x3a04d5[_0x86eb('0xa')],'priority':_0x53e4aa[_0x86eb('0x2c')]+_0x31a55b[_0x86eb('0x10')]+_0x6861b1++,'VoiceExtensionId':_0x3a04d5['VoiceExtensionId']});}else{_0x3e6e84[_0x86eb('0x13')]({'type':_0x3a04d5['type'],'app':_0x86eb('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x3a04d5[_0x86eb('0x18')],'exten':_0x3a04d5['exten'],'priority':_0x53e4aa[_0x86eb('0x2c')]+_0x31a55b[_0x86eb('0x10')]+_0x6861b1++,'VoiceExtensionId':_0x3a04d5[_0x86eb('0x19')]});}}if(_0x3a04d5[_0x86eb('0xf')](_0x86eb('0x35'))){if(_0x4edba1['indexOf'](_0x3a04d5[_0x86eb('0x36')]['toLowerCase']())>=0x0&&_0x3a04d5[_0x86eb('0x37')]!==_0x86eb('0x38')){if(_0x3a04d5[_0x86eb('0x35')]){_0x3e6e84[_0x86eb('0x13')]({'type':_0x3a04d5[_0x86eb('0x14')],'app':'ExecIf','appdata':_0x86eb('0x39'),'context':_0x3a04d5['context'],'exten':_0x3a04d5[_0x86eb('0xa')],'priority':_0x53e4aa[_0x86eb('0x2c')]+_0x31a55b['priority']+_0x6861b1++,'VoiceExtensionId':_0x3a04d5[_0x86eb('0x19')]});_0x3e6e84[_0x86eb('0x13')]({'type':_0x3a04d5['type'],'app':_0x86eb('0x15'),'appdata':_0x86eb('0x3a'),'context':_0x3a04d5['context'],'exten':_0x3a04d5['exten'],'priority':_0x53e4aa[_0x86eb('0x2c')]+_0x31a55b[_0x86eb('0x10')]+_0x6861b1++,'VoiceExtensionId':_0x3a04d5[_0x86eb('0x19')]});}else{_0x3e6e84[_0x86eb('0x13')]({'type':_0x3a04d5[_0x86eb('0x14')],'app':_0x86eb('0x20'),'appdata':_0x86eb('0x3b'),'context':_0x3a04d5['context'],'exten':_0x3a04d5['exten'],'priority':_0x53e4aa[_0x86eb('0x2c')]+_0x31a55b[_0x86eb('0x10')]+_0x6861b1++,'VoiceExtensionId':_0x3a04d5[_0x86eb('0x19')]});_0x3e6e84[_0x86eb('0x13')]({'type':_0x3a04d5[_0x86eb('0x14')],'app':_0x86eb('0x15'),'appdata':_0x86eb('0x3c'),'context':_0x3a04d5['context'],'exten':_0x3a04d5[_0x86eb('0xa')],'priority':_0x53e4aa[_0x86eb('0x2c')]+_0x31a55b[_0x86eb('0x10')]+_0x6861b1++,'VoiceExtensionId':_0x3a04d5[_0x86eb('0x19')]});}}}for(var _0xa96dfc=0x0;_0xa96dfc<_0x53e4aa['length'];_0xa96dfc+=0x1){var _0x56d7c1=_0x31a55b[_0x86eb('0x10')]+_0x53e4aa[_0x86eb('0x2c')];var _0xd4dcec=_0xa96dfc===_0x53e4aa['length']-0x1?_0x31a55b[_0x86eb('0x10')]+_0x3e6e84['length']+_0x2cdb2c[_0x86eb('0x2c')]+0x2:_0x31a55b[_0x86eb('0x10')]+_0xa96dfc+0x1;_0x3e6e84[_0x86eb('0x3d')](_0xa96dfc,0x0,{'type':_0x3a04d5[_0x86eb('0x14')],'app':_0x86eb('0x3e'),'appdata':_0x53e4aa[_0xa96dfc]+'?'+_0x3a04d5[_0x86eb('0x18')]+_0x86eb('0x3f')+_0x56d7c1+':'+_0x3a04d5[_0x86eb('0x18')]+_0x86eb('0x3f')+_0xd4dcec,'exten':_0x3a04d5[_0x86eb('0xa')],'context':_0x3a04d5[_0x86eb('0x18')],'priority':_0x31a55b[_0x86eb('0x10')]+_0xa96dfc,'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});}_0x3a04d5[_0x86eb('0x10')]=_0x3e6e84[_0x86eb('0x2c')]?_[_0x86eb('0x40')](_0x3e6e84)['priority']+0x1:_0x31a55b[_0x86eb('0x10')];_0x31a55b['priority']=(_0x2cdb2c[_0x86eb('0x2c')]?_[_0x86eb('0x40')](_0x2cdb2c)[_0x86eb('0x10')]:_0x3a04d5[_0x86eb('0x10')])+0x1;_0x31a55b['extensions']=_[_0x86eb('0x41')](_0x31a55b[_0x86eb('0x11')],_0x3e6e84,[_0x3a04d5],_0x2cdb2c);}_0x31a55b[_0x86eb('0x11')][_0x86eb('0x13')]({'type':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x14')],'app':_0x86eb('0x42'),'exten':_0x5bc37f[_0x422a0b][0x0]['exten'],'context':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x18')],'priority':_0x31a55b[_0x86eb('0x10')],'VoiceExtensionId':_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]});_0x209f2a[_0x86eb('0x13')](_0x5bc37f[_0x422a0b][0x0][_0x86eb('0x19')]);_0x337eb1=_[_0x86eb('0x41')](_0x337eb1,_0x31a55b['extensions']);}}return _0x219cf5[_0x86eb('0x43')](function(_0x5f430d){return _0x219cf5['models'][_0x86eb('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x209f2a}},'transaction':_0x5f430d})[_0x86eb('0x4')](function(_0x5d62ac){return _0x219cf5[_0x86eb('0x1')][_0x86eb('0x6')][_0x86eb('0x44')](_[_0x86eb('0x45')](_0x337eb1,_0x86eb('0x10')),{'transaction':_0x5f430d});});});})['catch'](function(_0x3bd418){console[_0x86eb('0x46')](_0x3bd418);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xb53a=['find','push','type','format','CDR(type)=%s','context','inbound','Set','CDR(routeid)=','VoiceExtensionId','outbound','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','catch','lodash','util','models','then','VoiceExtension','findAll','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0xb53a,0x18d));var _0xab53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb53a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab53('0x0'));var util=require(_0xab53('0x1'));function rewrite(_0x5a89a0,_0x13f9cf){var _0x588e09=this;return _0x5a89a0[_0xab53('0x2')]['Interval']['findAll']({'raw':!![]})[_0xab53('0x3')](function(_0x5484df){_0x588e09['intervals']=_0x5484df;return _0x5a89a0[_0xab53('0x2')][_0xab53('0x4')][_0xab53('0x5')]({'where':{'IntervalId':_0x13f9cf[_0xab53('0x6')]},'raw':!![]});})['then'](function(_0xd0fa28){return _0x5a89a0[_0xab53('0x2')]['VoiceExtension'][_0xab53('0x5')]({'where':{'exten':{'$in':_['uniq'](_[_0xab53('0x7')](_0xd0fa28,_0xab53('0x8')))}},'order':[{'raw':_0xab53('0x9')}],'raw':!![]});})[_0xab53('0x3')](function(_0x1c89b8){var _0x202c7c=_[_0xab53('0xa')](_0x1c89b8,{'priority':'1'});var _0x2f9e21=_[_0xab53('0xa')](_0x1c89b8,{'isApp':0x1});var _0x37d3c5=_[_0xab53('0xb')](_0x2f9e21,_0xab53('0x8'));var _0x5c2288=['queue',_0xab53('0xc')];var _0x476f1f=[];var _0x5529a9=[];for(var _0x5ee33d in _0x37d3c5){if(_0x37d3c5[_0xab53('0xd')](_0x5ee33d)){_0x588e09[_0xab53('0xe')]=0x2;_0x588e09[_0xab53('0xf')]=[];_0x588e09[_0xab53('0x10')]=_[_0xab53('0x11')](_0x202c7c,{'exten':_0x37d3c5[_0x5ee33d][0x0]['exten']});_0x588e09[_0xab53('0xf')][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':'Set','appdata':util[_0xab53('0x14')](_0xab53('0x15'),_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')]),'context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0]['exten'],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0]['VoiceExtensionId']});if(_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')]===_0xab53('0x17')){_0x588e09['extensions'][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0xab53('0x19')+_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')],'context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x8')],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});}else if(_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')]===_0xab53('0x1b')){if(_0x588e09['extension']){_0x588e09[_0xab53('0xf')]['push']({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':'CDR(destination)='+(_0x588e09[_0xab53('0x10')][_0xab53('0x1c')]?'${EXTEN:'+_0x588e09[_0xab53('0x10')][_0xab53('0x1c')]+'}':_0xab53('0x1d')),'context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0]['exten'],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0]['VoiceExtensionId']});}_0x588e09[_0xab53('0xf')][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0xab53('0x19')+_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')],'context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x8')],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0]['VoiceExtensionId']});var _0x4cbd22=_0x588e09[_0xab53('0xe')]++;_0x588e09['extensions'][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':'ExecIf','appdata':_0xab53('0x1e')+(_0x4cbd22+0x2)+_0xab53('0x1f')+(_0x4cbd22+0x1)+')','context':_0x37d3c5[_0x5ee33d][0x0]['context'],'exten':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x8')],'priority':_0x4cbd22,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});if(_0x588e09[_0xab53('0x10')]){_0x588e09[_0xab53('0xf')][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0x588e09['extension']['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x588e09['extension'][_0xab53('0x1c')]+'}':_0xab53('0x20'),'context':_0x37d3c5[_0x5ee33d][0x0]['context'],'exten':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x8')],'priority':_0x588e09['priority']++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});}_0x588e09[_0xab53('0xf')][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0]['type'],'app':'Set','appdata':_0xab53('0x21')+_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')],'context':_0x37d3c5[_0x5ee33d][0x0]['context'],'exten':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x8')],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});if(_0x588e09[_0xab53('0x10')]&&_0x588e09[_0xab53('0x10')][_0xab53('0xd')](_0xab53('0x22'))&&_0x588e09[_0xab53('0x10')]['recordingFormat']!==_0xab53('0x23')){_0x588e09[_0xab53('0xf')]['push']({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0]['exten'],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});_0x588e09[_0xab53('0xf')][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0xab53('0x24')+_0x588e09['extension'][_0xab53('0x22')]||'wav','context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x8')],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});}}_0x588e09['extensions'][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0xab53('0x25'),'context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0]['exten'],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});_0x588e09[_0xab53('0xf')][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0xab53('0x26'),'context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0]['exten'],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0]['VoiceExtensionId']});_0x588e09['extensions'][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':'Set','appdata':_0xab53('0x27'),'context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'exten':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x8')],'priority':_0x588e09[_0xab53('0xe')]++,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0]['VoiceExtensionId']});for(var _0x1051ea=0x0,_0x1f2015=0x0;_0x1051ea<_0x37d3c5[_0x5ee33d][_0xab53('0x28')];_0x1051ea+=0x1,_0x1f2015=0x0){var _0x421468=_0x37d3c5[_0x5ee33d][_0x1051ea];if(_0x421468[_0xab53('0x13')]){_0x421468[_0xab53('0x13')]=_0x421468['type'][_0xab53('0x29')]();}var _0xc16139=[];var _0x369d21=[];delete _0x421468['id'];delete _0x421468[_0xab53('0x2a')];delete _0x421468[_0xab53('0x2b')];var _0x8a5958=_0x421468[_0xab53('0x2c')]!==_0xab53('0x2d')?[_0x421468[_0xab53('0x2c')]]:_0x421468['IntervalId']?_[_0xab53('0x7')](_[_0xab53('0xa')](_0x588e09['intervals'],{'IntervalId':_0x421468[_0xab53('0x6')]}),_0xab53('0x2c')):[];if(_0x421468['hasOwnProperty'](_0xab53('0x2e'))){if(_0x421468['tag']&&_0x421468[_0xab53('0x2e')]!=='--'){_0xc16139[_0xab53('0x12')]({'type':_0x421468[_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0xab53('0x2f')+_0x421468[_0xab53('0x2e')],'context':_0x421468[_0xab53('0x16')],'exten':_0x421468[_0xab53('0x8')],'priority':_0x8a5958[_0xab53('0x28')]+_0x588e09[_0xab53('0xe')]+_0x1f2015++,'VoiceExtensionId':_0x421468['VoiceExtensionId']});}}if(_0x421468[_0xab53('0x13')]===_0xab53('0x1b')&&_0x421468[_0xab53('0xd')](_0xab53('0x30'))){if(_0x421468[_0xab53('0x30')]){_0xc16139[_0xab53('0x12')]({'type':_0x421468[_0xab53('0x13')],'app':_0xab53('0x31'),'appdata':_0xab53('0x32')+_0x421468[_0xab53('0x30')]+')','context':_0x421468[_0xab53('0x16')],'exten':_0x421468[_0xab53('0x8')],'priority':_0x8a5958[_0xab53('0x28')]+_0x588e09[_0xab53('0xe')]+_0x1f2015++,'VoiceExtensionId':_0x421468[_0xab53('0x1a')]});}else{_0xc16139['push']({'type':_0x421468[_0xab53('0x13')],'app':_0xab53('0x31'),'appdata':_0xab53('0x33'),'context':_0x421468['context'],'exten':_0x421468[_0xab53('0x8')],'priority':_0x8a5958['length']+_0x588e09[_0xab53('0xe')]+_0x1f2015++,'VoiceExtensionId':_0x421468[_0xab53('0x1a')]});}}if(_0x421468[_0xab53('0xd')](_0xab53('0x34'))){if(_0x5c2288[_0xab53('0x35')](_0x421468[_0xab53('0x36')]['toLowerCase']())>=0x0&&_0x421468[_0xab53('0x37')]!==_0xab53('0x38')){if(_0x421468['answer']){_0xc16139[_0xab53('0x12')]({'type':_0x421468[_0xab53('0x13')],'app':_0xab53('0x31'),'appdata':_0xab53('0x39'),'context':_0x421468[_0xab53('0x16')],'exten':_0x421468['exten'],'priority':_0x8a5958[_0xab53('0x28')]+_0x588e09[_0xab53('0xe')]+_0x1f2015++,'VoiceExtensionId':_0x421468[_0xab53('0x1a')]});_0xc16139[_0xab53('0x12')]({'type':_0x421468[_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0xab53('0x3a'),'context':_0x421468[_0xab53('0x16')],'exten':_0x421468[_0xab53('0x8')],'priority':_0x8a5958[_0xab53('0x28')]+_0x588e09[_0xab53('0xe')]+_0x1f2015++,'VoiceExtensionId':_0x421468[_0xab53('0x1a')]});}else{_0xc16139['push']({'type':_0x421468[_0xab53('0x13')],'app':_0xab53('0x31'),'appdata':_0xab53('0x3b'),'context':_0x421468['context'],'exten':_0x421468[_0xab53('0x8')],'priority':_0x8a5958[_0xab53('0x28')]+_0x588e09[_0xab53('0xe')]+_0x1f2015++,'VoiceExtensionId':_0x421468[_0xab53('0x1a')]});_0xc16139[_0xab53('0x12')]({'type':_0x421468[_0xab53('0x13')],'app':_0xab53('0x18'),'appdata':_0xab53('0x3c'),'context':_0x421468['context'],'exten':_0x421468['exten'],'priority':_0x8a5958[_0xab53('0x28')]+_0x588e09[_0xab53('0xe')]+_0x1f2015++,'VoiceExtensionId':_0x421468[_0xab53('0x1a')]});}}}for(var _0x6e3e27=0x0;_0x6e3e27<_0x8a5958[_0xab53('0x28')];_0x6e3e27+=0x1){var _0x220b3e=_0x588e09[_0xab53('0xe')]+_0x8a5958[_0xab53('0x28')];var _0x122322=_0x6e3e27===_0x8a5958[_0xab53('0x28')]-0x1?_0x588e09['priority']+_0xc16139[_0xab53('0x28')]+_0x369d21[_0xab53('0x28')]+0x2:_0x588e09[_0xab53('0xe')]+_0x6e3e27+0x1;_0xc16139[_0xab53('0x3d')](_0x6e3e27,0x0,{'type':_0x421468[_0xab53('0x13')],'app':_0xab53('0x3e'),'appdata':_0x8a5958[_0x6e3e27]+'?'+_0x421468[_0xab53('0x16')]+_0xab53('0x3f')+_0x220b3e+':'+_0x421468[_0xab53('0x16')]+_0xab53('0x3f')+_0x122322,'exten':_0x421468['exten'],'context':_0x421468['context'],'priority':_0x588e09[_0xab53('0xe')]+_0x6e3e27,'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});}_0x421468[_0xab53('0xe')]=_0xc16139[_0xab53('0x28')]?_['last'](_0xc16139)['priority']+0x1:_0x588e09[_0xab53('0xe')];_0x588e09['priority']=(_0x369d21[_0xab53('0x28')]?_[_0xab53('0x40')](_0x369d21)[_0xab53('0xe')]:_0x421468[_0xab53('0xe')])+0x1;_0x588e09[_0xab53('0xf')]=_[_0xab53('0x41')](_0x588e09['extensions'],_0xc16139,[_0x421468],_0x369d21);}_0x588e09[_0xab53('0xf')][_0xab53('0x12')]({'type':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x13')],'app':_0xab53('0x42'),'exten':_0x37d3c5[_0x5ee33d][0x0]['exten'],'context':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x16')],'priority':_0x588e09[_0xab53('0xe')],'VoiceExtensionId':_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]});_0x476f1f[_0xab53('0x12')](_0x37d3c5[_0x5ee33d][0x0][_0xab53('0x1a')]);_0x5529a9=_[_0xab53('0x41')](_0x5529a9,_0x588e09[_0xab53('0xf')]);}}return _0x5a89a0[_0xab53('0x43')](function(_0x3f3106){return _0x5a89a0[_0xab53('0x2')][_0xab53('0x4')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x476f1f}},'transaction':_0x3f3106})['then'](function(_0x42ca52){return _0x5a89a0['models'][_0xab53('0x4')]['bulkCreate'](_['sortBy'](_0x5529a9,_0xab53('0xe')),{'transaction':_0x3f3106});});});})[_0xab53('0x44')](function(_0x22f2a3){console['error'](_0x22f2a3);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 60e8257..2629a04 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 _0xf053=['toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','into','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','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','find','duplicate','CmContact','create','keys','then','push','pick','catch','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()'];(function(_0x5a67fa,_0x6fdba4){var _0x35b6e8=function(_0x3d9222){while(--_0x3d9222){_0x5a67fa['push'](_0x5a67fa['shift']());}};_0x35b6e8(++_0x6fdba4);}(_0xf053,0x9a));var _0x3f05=function(_0x1c5680,_0x9a7e81){_0x1c5680=_0x1c5680-0x0;var _0x554704=_0xf053[_0x1c5680];return _0x554704;};'use strict';var BPromise=require(_0x3f05('0x0'));var util=require(_0x3f05('0x1'));var _=require(_0x3f05('0x2'));var fs=require('fs');var squel=require(_0x3f05('0x3'));var Papa=require('papaparse');var Redis=require(_0x3f05('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x3f05('0x5'));var logger=require(_0x3f05('0x6'))(_0x3f05('0x7'));config[_0x3f05('0x8')]=_[_0x3f05('0x9')](config[_0x3f05('0x8')],{'host':_0x3f05('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x3f05('0xb')](socket);try{if(!process[_0x3f05('0xc')][0x2]||process['argv'][0x2]===_0x3f05('0xd')||process['argv'][0x2]===_0x3f05('0xe')){throw new Error(_0x3f05('0xf'));}var FILEPATH=process[_0x3f05('0xc')][0x2];if(!process[_0x3f05('0xc')][0x3]||process[_0x3f05('0xc')][0x3]===_0x3f05('0xd')||process[_0x3f05('0xc')][0x3]===_0x3f05('0xe')||!process['argv'][0x4]||process['argv'][0x4]===_0x3f05('0xd')||process[_0x3f05('0xc')][0x4]===_0x3f05('0xe')){throw new Error(_0x3f05('0x10'));}var FIELDS=_[_0x3f05('0x11')](process[_0x3f05('0xc')][0x3][_0x3f05('0x12')](','),process[_0x3f05('0xc')][0x4][_0x3f05('0x12')](','));if(!process['argv'][0x5]||process[_0x3f05('0xc')][0x5]===_0x3f05('0xd')||process['argv'][0x5]==='null'){throw new Error(_0x3f05('0x13'));}var LISTID=process[_0x3f05('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x3f05('0xc')][0x6]!=='undefined'&&process[_0x3f05('0xc')][0x6]!==_0x3f05('0xe')?process[_0x3f05('0xc')][0x6]:null;var DUPLICATES=process[_0x3f05('0xc')][0x7]&&process[_0x3f05('0xc')][0x7]!==_0x3f05('0xd')&&process['argv'][0x7]!==_0x3f05('0xe')?process[_0x3f05('0xc')][0x7]:null;if(!process[_0x3f05('0xc')][0x8]||process[_0x3f05('0xc')][0x8]===_0x3f05('0xd')||process[_0x3f05('0xc')][0x8]===_0x3f05('0xe')){throw new Error(_0x3f05('0x14'));}var SOCKET_TIMESTAMP=process[_0x3f05('0xc')][0x8];}catch(_0x20c8e9){logger[_0x3f05('0x15')](_0x20c8e9);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(_0xf84be0,_0x22ef9b,_0x237b44,_0x3b1ed1){var _0x2c9243={'message':_0x22ef9b};_0x2c9243[_0xf84be0]=!![];if(_0x237b44){_0x2c9243[_0x3f05('0x16')]=_0x237b44;}if(_0x3b1ed1){_0x2c9243['index']=_0x3b1ed1;}return _0x2c9243;}function isEmail(_0x5ccfd9){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'](_0x5ccfd9);}function checkRow(_0x3439ef,_0xfaea09,_0x11d77f){return new BPromise(function(_0x385090,_0x58b0a0){if(_[_0x3f05('0x17')](_0x3439ef)){return _0x58b0a0(handleCheckRowError(_0x3f05('0x15'),_0x3f05('0x18'),null,_0x11d77f));}if(_0x3439ef[_0x3f05('0x19')]&&_0x3439ef['errors'][_0x3f05('0x1a')]){var _0x19dbd0=_[_0x3f05('0x1b')](_0x3439ef[_0x3f05('0x19')],_0x3f05('0x1c'))['join'](';');return _0x58b0a0(handleCheckRowError('error',_0x19dbd0,null,_0x11d77f));}var _0x1e5068={};for(var _0x408abb in FIELDS){if(FIELDS['hasOwnProperty'](_0x408abb)&&FIELDS[_0x408abb]){_0x1e5068[_0x408abb]=_0x3439ef[_0x3f05('0x1d')][0x0][FIELDS[_0x408abb]]||_0x3439ef[_0x3f05('0x1d')][0x0]['\ufeff'+FIELDS[_0x408abb]];}}if(!_0x1e5068[_0x3f05('0x1e')]){return _0x58b0a0(handleCheckRowError(_0x3f05('0x15'),_0x3f05('0x1f'),null,_0x11d77f));}if(!_0x1e5068[_0x3f05('0x20')]){return _0x58b0a0(handleCheckRowError(_0x3f05('0x15'),_0x3f05('0x21'),null,_0x11d77f));}if(_0x1e5068[_0x3f05('0x22')]){var _0x1b3f16=moment(_0x1e5068[_0x3f05('0x22')],_0x3f05('0x23'));if(!_0x1b3f16['isValid']()){return _0x58b0a0(handleCheckRowError('error',_0x3f05('0x24'),null,_0x11d77f));}}if(_0x1e5068[_0x3f05('0x25')]){if(!isEmail(_0x1e5068[_0x3f05('0x25')])){return _0x58b0a0(handleCheckRowError('error',_0x3f05('0x26'),null,_0x11d77f));}}_0x1e5068[_0x3f05('0x27')]=LISTID;_0x1e5068[_0x3f05('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3f05('0x1a')]&&_0xfaea09){var _0x47b5e6={};for(var _0xabccdc=0x0,_0x490c5b=DUPLICATES[_0x3f05('0x1a')];_0xabccdc<_0x490c5b;_0xabccdc+=0x1){_0x47b5e6[DUPLICATES[_0xabccdc]]=_0x1e5068[DUPLICATES[_0xabccdc]];}var _0x331265=_[_0x3f05('0x29')](_0xfaea09,_0x47b5e6);if(_0x331265){return _0x58b0a0(handleCheckRowError(_0x3f05('0x2a'),'Duplicate\x20Contact',_0x331265,_0x11d77f));}}return db[_0x3f05('0x2b')][_0x3f05('0x2c')](_0x1e5068,{'raw':!![],'hooks':![],'fields':_[_0x3f05('0x2d')](_0x1e5068)})[_0x3f05('0x2e')](function(_0x2249f0){if(DUPLICATES&&DUPLICATES[_0x3f05('0x1a')]&&_0xfaea09){_0xfaea09[_0x3f05('0x2f')](_[_0x3f05('0x30')](_0x1e5068,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2249f0['id'];return _0x385090();})[_0x3f05('0x31')](function(_0x75d4e7){return _0x58b0a0(handleCheckRowError(_0x3f05('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x75d4e7['message']||JSON[_0x3f05('0x32')](_0x75d4e7)),null,_0x11d77f));});});}function checkHopper(){function _0x4d48aa(){return function(_0x415e4f){logger[_0x3f05('0x15')]('cmContact',_0x3f05('0x33'),util[_0x3f05('0x34')](_0x415e4f,{'showHidden':![],'depth':null}));};}var _0x3ad0ae=function(_0x2a98ae,_0x37ed9b){var _0x16a4ad=squel[_0x3f05('0x35')]()['into'](_0x3f05('0x36'))[_0x3f05('0x37')]([_0x3f05('0x20'),_0x3f05('0x38'),_0x3f05('0x39'),_0x3f05('0x27'),_0x37ed9b,_0x3f05('0x3a'),_0x3f05('0x3b')],squel['select']()[_0x3f05('0x3c')]('phone',_0x3f05('0x20'))[_0x3f05('0x3c')](_0x3f05('0x3d'),'scheduledAt')[_0x3f05('0x3c')]('id','ContactId')[_0x3f05('0x3c')](LISTID[_0x3f05('0x3e')](),_0x3f05('0x27'))[_0x3f05('0x3c')](_0x2a98ae['id'][_0x3f05('0x3e')](),_0x37ed9b)['field'](_0x3f05('0x3d'),_0x3f05('0x3a'))[_0x3f05('0x3c')](_0x3f05('0x3d'),_0x3f05('0x3b'))[_0x3f05('0x3f')](_0x3f05('0x40'))[_0x3f05('0x41')](_0x3f05('0x42'))[_0x3f05('0x41')](_0x3f05('0x43'),LISTID[_0x3f05('0x3e')]())['where'](_0x3f05('0x44'))[_0x3f05('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3f05('0x45')]()[_0x3f05('0x3c')](_0x3f05('0x20'))[_0x3f05('0x3f')]('cm_hopper')[_0x3f05('0x41')](_0x37ed9b+'\x20=\x20?',_0x2a98ae['id'][_0x3f05('0x3e')]())))[_0x3f05('0x3e')]();return _0x16a4ad;};var _0x26d277=function(_0x2da8e2,_0x538823){var _0x33523c=squel[_0x3f05('0x35')]()[_0x3f05('0x46')](_0x3f05('0x36'))[_0x3f05('0x37')]([_0x3f05('0x20'),'scheduledAt',_0x3f05('0x39'),_0x3f05('0x27'),_0x538823,'createdAt',_0x3f05('0x3b')],squel[_0x3f05('0x45')]()[_0x3f05('0x3c')]('phone',_0x3f05('0x20'))[_0x3f05('0x3c')](_0x3f05('0x3d'),_0x3f05('0x38'))[_0x3f05('0x3c')]('id','ContactId')[_0x3f05('0x3c')](LISTID[_0x3f05('0x3e')](),'ListId')['field'](_0x2da8e2['id'][_0x3f05('0x3e')](),_0x538823)['field'](_0x3f05('0x3d'),_0x3f05('0x3a'))[_0x3f05('0x3c')](_0x3f05('0x3d'),_0x3f05('0x3b'))[_0x3f05('0x3f')](_0x3f05('0x40'))['where']('deletedAt\x20IS\x20NULL')[_0x3f05('0x41')](_0x3f05('0x43'),LISTID[_0x3f05('0x3e')]())[_0x3f05('0x41')](_0x3f05('0x47'),squel[_0x3f05('0x48')](hopperContacts))[_0x3f05('0x41')](_0x3f05('0x44'))[_0x3f05('0x41')](_0x3f05('0x49'),squel[_0x3f05('0x45')]()[_0x3f05('0x3c')]('calleridnum')['from'](_0x3f05('0x4a'))[_0x3f05('0x41')](_0x538823+_0x3f05('0x4b'),_0x2da8e2['id'][_0x3f05('0x3e')]()))[_0x3f05('0x41')](_0x3f05('0x49'),squel[_0x3f05('0x45')]()[_0x3f05('0x3c')](_0x3f05('0x20'))['from'](_0x3f05('0x36'))[_0x3f05('0x41')](_0x538823+_0x3f05('0x4b'),_0x2da8e2['id'][_0x3f05('0x3e')]())))[_0x3f05('0x3e')]();return _0x33523c;};function _0xf26fe6(_0x4e85ff,_0x4589e7){var _0x2b0a46=squel[_0x3f05('0x35')]()['into'](_0x3f05('0x36'))[_0x3f05('0x37')]([_0x3f05('0x20'),_0x3f05('0x38'),_0x3f05('0x39'),_0x3f05('0x27'),_0x4589e7,_0x3f05('0x3a'),_0x3f05('0x3b')],squel[_0x3f05('0x45')]()[_0x3f05('0x3c')](_0x3f05('0x20'),'phone')[_0x3f05('0x3c')]('NOW()','scheduledAt')[_0x3f05('0x3c')]('id',_0x3f05('0x39'))[_0x3f05('0x3c')](LISTID[_0x3f05('0x3e')](),_0x3f05('0x27'))['field'](_0x4e85ff['id']['toString'](),_0x4589e7)[_0x3f05('0x3c')](_0x3f05('0x3d'),_0x3f05('0x3a'))[_0x3f05('0x3c')](_0x3f05('0x3d'),_0x3f05('0x3b'))[_0x3f05('0x3f')](_0x3f05('0x40'))[_0x3f05('0x41')](_0x3f05('0x42'))['where'](_0x3f05('0x43'),LISTID[_0x3f05('0x3e')]())[_0x3f05('0x41')]('id\x20IN\x20?',squel[_0x3f05('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x2b0a46;}function _0x42460f(_0x278049,_0x1678b2){var _0x5a3960=squel[_0x3f05('0x35')]()[_0x3f05('0x46')](_0x3f05('0x4c'))[_0x3f05('0x37')]([_0x3f05('0x20'),_0x3f05('0x39'),_0x3f05('0x27'),_0x1678b2,_0x3f05('0x3a'),'updatedAt'],squel['select']()['field']('phone','phone')['field']('id',_0x3f05('0x39'))[_0x3f05('0x3c')](LISTID[_0x3f05('0x3e')](),_0x3f05('0x27'))['field'](_0x278049['id'][_0x3f05('0x3e')](),_0x1678b2)[_0x3f05('0x3c')]('NOW()',_0x3f05('0x3a'))['field']('NOW()','updatedAt')[_0x3f05('0x3f')](_0x3f05('0x40'))['where'](_0x3f05('0x42'))[_0x3f05('0x41')](_0x3f05('0x43'),LISTID['toString']())[_0x3f05('0x41')](_0x3f05('0x47'),squel[_0x3f05('0x48')](hopperContacts))[_0x3f05('0x41')](_0x3f05('0x44')))[_0x3f05('0x3e')]();return _0x5a3960;}return db[_0x3f05('0x4d')][_0x3f05('0x4e')]({'where':{'type':_0x3f05('0x4f')},'attributes':['id',_0x3f05('0x50')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x3f05('0x2e')](function(_0x38cfbd){var _0x1b8eef=[];if(_0x38cfbd){var _0x347cf5;for(var _0x5e8b71=0x0,_0x1f404c;_0x5e8b71<_0x38cfbd[_0x3f05('0x1a')];_0x5e8b71+=0x1){_0x1f404c=_0x38cfbd[_0x5e8b71][_0x3f05('0x51')]({'plain':!![]});switch(_0x1f404c[_0x3f05('0x50')]){case _0x3f05('0x52'):_0x1b8eef[_0x3f05('0x2f')](db[_0x3f05('0x53')][_0x3f05('0x54')](_0x26d277(_0x1f404c,_0x3f05('0x55')))[_0x3f05('0x2e')](function(){})['catch'](_0x4d48aa()));break;case _0x3f05('0x56'):_0x1b8eef['push'](db['sequelize'][_0x3f05('0x54')](_0x3ad0ae(_0x1f404c,_0x3f05('0x55')))['then'](function(){})[_0x3f05('0x31')](_0x4d48aa()));break;default:_0x1b8eef['push'](db['sequelize'][_0x3f05('0x54')](_0xf26fe6(_0x1f404c,_0x3f05('0x55')))[_0x3f05('0x2e')](function(){})[_0x3f05('0x31')](_0x4d48aa()));}}}return _0x1b8eef;})[_0x3f05('0x57')]()['then'](function(){return db[_0x3f05('0x4d')][_0x3f05('0x4e')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x3f05('0x58')],'as':_0x3f05('0x59'),'where':{'id':LISTID}}]})[_0x3f05('0x2e')](function(_0x37e1ef){var _0x3a2fd2=[];if(_0x37e1ef){var _0x16d2b6;for(var _0x27681c=0x0,_0x2f4403;_0x27681c<_0x37e1ef[_0x3f05('0x1a')];_0x27681c+=0x1){_0x2f4403=_0x37e1ef[_0x27681c][_0x3f05('0x51')]({'plain':!![]});_0x3a2fd2['push'](db[_0x3f05('0x53')][_0x3f05('0x54')](_0x42460f(_0x2f4403,'VoiceQueueId'))[_0x3f05('0x2e')](function(){})[_0x3f05('0x31')](_0x4d48aa()));}}return _0x3a2fd2;})[_0x3f05('0x57')]();})[_0x3f05('0x2e')](function(){return db[_0x3f05('0x5a')]['findAll']({'attributes':['id',_0x3f05('0x50')],'include':[{'model':db[_0x3f05('0x58')],'as':'Lists','where':{'id':LISTID}}]})[_0x3f05('0x2e')](function(_0x1bd968){var _0xda6f7d=[];if(_0x1bd968){for(var _0x51c964=0x0,_0xcf47e1;_0x51c964<_0x1bd968[_0x3f05('0x1a')];_0x51c964+=0x1){_0xcf47e1=_0x1bd968[_0x51c964]['get']({'plain':!![]});switch(_0xcf47e1[_0x3f05('0x50')]){case'always':_0xda6f7d[_0x3f05('0x2f')](db[_0x3f05('0x53')][_0x3f05('0x54')](_0x26d277(_0xcf47e1,'CampaignId'))[_0x3f05('0x2e')](function(){})['catch'](_0x4d48aa()));break;case'onlyIfOpen':_0xda6f7d['push'](db[_0x3f05('0x53')]['query'](_0x3ad0ae(_0xcf47e1,_0x3f05('0x5b')))[_0x3f05('0x2e')](function(){})[_0x3f05('0x31')](_0x4d48aa()));break;default:_0xda6f7d[_0x3f05('0x2f')](db[_0x3f05('0x53')][_0x3f05('0x54')](_0xf26fe6(_0xcf47e1,_0x3f05('0x5b')))[_0x3f05('0x2e')](function(){})[_0x3f05('0x31')](_0x4d48aa()));}}}return _0xda6f7d;})[_0x3f05('0x57')]();})['then'](function(){return db[_0x3f05('0x5a')][_0x3f05('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x3f05('0x58')],'as':_0x3f05('0x59'),'where':{'id':LISTID}}]})[_0x3f05('0x2e')](function(_0x2f0924){var _0x33af45=[];if(_0x2f0924){for(var _0x2fa960=0x0,_0x4b5a8f;_0x2fa960<_0x2f0924[_0x3f05('0x1a')];_0x2fa960+=0x1){_0x4b5a8f=_0x2f0924[_0x2fa960][_0x3f05('0x51')]({'plain':!![]});_0x33af45[_0x3f05('0x2f')](db[_0x3f05('0x53')][_0x3f05('0x54')](_0x42460f(_0x4b5a8f,_0x3f05('0x5b')))[_0x3f05('0x2e')](function(){})['catch'](_0x4d48aa()));}}return _0x33af45;})[_0x3f05('0x57')]();})[_0x3f05('0x31')](function(_0x26c169){logger['error'](_0x3f05('0x5c'),_0x3f05('0x5d'),_0x26c169[_0x3f05('0x1c')]);});}var processPromises=function(_0x3a619f){return BPromise[_0x3f05('0x57')](promises)[_0x3f05('0x2e')](function(_0xe90f55){})[_0x3f05('0x31')](function(_0x5debd9){logger['error'](_0x3f05('0x5e'),JSON['stringify'](_0x5debd9));})[_0x3f05('0x5f')](function(){socket[_0x3f05('0x60')](_0x3f05('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3a619f){return _0x3a619f[_0x3f05('0x62')]();}});};var endCsv=function(){return BPromise[_0x3f05('0x63')]()[_0x3f05('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x3f05('0x2e')](function(){socket[_0x3f05('0x60')](_0x3f05('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x47d0c8){logger[_0x3f05('0x15')](_0x3f05('0x64'),JSON[_0x3f05('0x32')](_0x47d0c8));}finally{process['exit'](0x0);}});};process['on'](_0x3f05('0x65'),function(){logger['info'](_0x3f05('0x66'));endCsv();});function main(){return BPromise[_0x3f05('0x63')]()[_0x3f05('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3f05('0x12')](',');return db[_0x3f05('0x2b')][_0x3f05('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3f05('0x2e')](function(_0x16c895){var _0x15e929=fs[_0x3f05('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3f05('0x68')](_0x15e929,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4dc6c0,_0x4b7fc5){total+=0x1;var _0x263a37=total;promises['push'](checkRow(_0x4dc6c0,_0x16c895,_0x263a37)[_0x3f05('0x2e')](function(){success+=0x1;})[_0x3f05('0x31')](function(_0x5df5e4){if(_0x5df5e4[_0x3f05('0x15')]){errors+=0x1;delete _0x5df5e4['error'];}else if(_0x5df5e4[_0x3f05('0x2a')]){duplicates+=0x1;delete _0x5df5e4[_0x3f05('0x2a')];}rows[_0x3f05('0x2f')](_0x5df5e4);}));if(total%0xc8===0x0){_0x4b7fc5[_0x3f05('0x69')]();return processPromises(_0x4b7fc5);}},'complete':function(){return processPromises()[_0x3f05('0x2e')](function(){logger[_0x3f05('0x6a')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x24d38a,_0x4a3471){logger[_0x3f05('0x6a')]('CSV\x20parse\x20error',JSON[_0x3f05('0x32')](_0x24d38a));endCsv();}});})[_0x3f05('0x31')](function(_0xaf57b8){logger[_0x3f05('0x15')](_0x3f05('0x6b'),JSON[_0x3f05('0x32')](_0xaf57b8));});}main(); \ No newline at end of file +var _0x3435=['phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','insert','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','get','always','sequelize','VoiceQueueId','onlyIfOpen','push','query','all','CmList','BlackLists','Lists','CampaignId','generalCheckHopper','emit','contact:csv_','resolve','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL'];(function(_0x3ed8bc,_0x13b967){var _0x3ca73f=function(_0x1167e4){while(--_0x1167e4){_0x3ed8bc['push'](_0x3ed8bc['shift']());}};_0x3ca73f(++_0x13b967);}(_0x3435,0x1c1));var _0x5343=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x3435[_0x580647];return _0x5f0792;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x5343('0x0'));var fs=require('fs');var squel=require(_0x5343('0x1'));var Papa=require(_0x5343('0x2'));var Redis=require(_0x5343('0x3'));var db=require(_0x5343('0x4'))['db'];var config=require(_0x5343('0x5'));var logger=require(_0x5343('0x6'))(_0x5343('0x7'));config[_0x5343('0x8')]=_['defaults'](config[_0x5343('0x8')],{'host':_0x5343('0x9'),'port':0x18eb});var socket=require(_0x5343('0xa'))(new Redis(config[_0x5343('0x8')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x5343('0xb')][0x2]||process['argv'][0x2]===_0x5343('0xc')||process[_0x5343('0xb')][0x2]===_0x5343('0xd')){throw new Error(_0x5343('0xe'));}var FILEPATH=process[_0x5343('0xb')][0x2];if(!process[_0x5343('0xb')][0x3]||process[_0x5343('0xb')][0x3]===_0x5343('0xc')||process[_0x5343('0xb')][0x3]===_0x5343('0xd')||!process[_0x5343('0xb')][0x4]||process[_0x5343('0xb')][0x4]===_0x5343('0xc')||process[_0x5343('0xb')][0x4]===_0x5343('0xd')){throw new Error(_0x5343('0xf'));}var FIELDS=_['zipObject'](process[_0x5343('0xb')][0x3][_0x5343('0x10')](','),process[_0x5343('0xb')][0x4][_0x5343('0x10')](','));if(!process[_0x5343('0xb')][0x5]||process[_0x5343('0xb')][0x5]===_0x5343('0xc')||process[_0x5343('0xb')][0x5]===_0x5343('0xd')){throw new Error(_0x5343('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x5343('0xb')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x5343('0xd')?process[_0x5343('0xb')][0x6]:null;var DUPLICATES=process[_0x5343('0xb')][0x7]&&process[_0x5343('0xb')][0x7]!==_0x5343('0xc')&&process[_0x5343('0xb')][0x7]!=='null'?process[_0x5343('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0x5343('0xb')][0x8]===_0x5343('0xc')||process[_0x5343('0xb')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x5343('0xb')][0x8];}catch(_0x39d856){logger[_0x5343('0x12')](_0x39d856);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(_0x4dce14,_0x30d875,_0x35e386,_0x103d28){var _0x36d0fb={'message':_0x30d875};_0x36d0fb[_0x4dce14]=!![];if(_0x35e386){_0x36d0fb[_0x5343('0x13')]=_0x35e386;}if(_0x103d28){_0x36d0fb[_0x5343('0x14')]=_0x103d28;}return _0x36d0fb;}function isEmail(_0x3d81a0){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'](_0x3d81a0);}function checkRow(_0x139bc8,_0x38b102,_0x2b8fd1){return new BPromise(function(_0x26e58f,_0xf219bd){if(_[_0x5343('0x15')](_0x139bc8)){return _0xf219bd(handleCheckRowError(_0x5343('0x12'),_0x5343('0x16'),null,_0x2b8fd1));}if(_0x139bc8[_0x5343('0x17')]&&_0x139bc8[_0x5343('0x17')][_0x5343('0x18')]){var _0xe689cf=_[_0x5343('0x19')](_0x139bc8[_0x5343('0x17')],_0x5343('0x1a'))['join'](';');return _0xf219bd(handleCheckRowError('error',_0xe689cf,null,_0x2b8fd1));}var _0x1c3189={};for(var _0xfe0cd0 in FIELDS){if(FIELDS[_0x5343('0x1b')](_0xfe0cd0)&&FIELDS[_0xfe0cd0]){_0x1c3189[_0xfe0cd0]=_0x139bc8['data'][0x0][FIELDS[_0xfe0cd0]]||_0x139bc8[_0x5343('0x1c')][0x0]['\ufeff'+FIELDS[_0xfe0cd0]];}}if(!_0x1c3189['firstName']){return _0xf219bd(handleCheckRowError(_0x5343('0x12'),_0x5343('0x1d'),null,_0x2b8fd1));}if(!_0x1c3189[_0x5343('0x1e')]){return _0xf219bd(handleCheckRowError('error',_0x5343('0x1f'),null,_0x2b8fd1));}if(_0x1c3189[_0x5343('0x20')]){var _0x353b6c=moment(_0x1c3189['birthDate'],_0x5343('0x21'));if(!_0x353b6c[_0x5343('0x22')]()){return _0xf219bd(handleCheckRowError(_0x5343('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x2b8fd1));}}if(_0x1c3189[_0x5343('0x23')]){if(!isEmail(_0x1c3189['email'])){return _0xf219bd(handleCheckRowError('error',_0x5343('0x24'),null,_0x2b8fd1));}}_0x1c3189[_0x5343('0x25')]=LISTID;_0x1c3189[_0x5343('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5343('0x18')]&&_0x38b102){var _0x32985a={};for(var _0x14437f=0x0,_0x26af79=DUPLICATES[_0x5343('0x18')];_0x14437f<_0x26af79;_0x14437f+=0x1){_0x32985a[DUPLICATES[_0x14437f]]=_0x1c3189[DUPLICATES[_0x14437f]];}var _0xd0713=_['find'](_0x38b102,_0x32985a);if(_0xd0713){return _0xf219bd(handleCheckRowError('duplicate',_0x5343('0x27'),_0xd0713,_0x2b8fd1));}}return db[_0x5343('0x28')][_0x5343('0x29')](_0x1c3189,{'raw':!![],'hooks':![],'fields':_[_0x5343('0x2a')](_0x1c3189)})[_0x5343('0x2b')](function(_0x23259c){if(DUPLICATES&&DUPLICATES[_0x5343('0x18')]&&_0x38b102){_0x38b102['push'](_['pick'](_0x1c3189,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x23259c['id'];return _0x26e58f();})[_0x5343('0x2c')](function(_0x350552){return _0xf219bd(handleCheckRowError(_0x5343('0x12'),_0x5343('0x2d')+(_0x350552[_0x5343('0x1a')]||JSON[_0x5343('0x2e')](_0x350552)),null,_0x2b8fd1));});});}function checkHopper(){function _0x444f02(){return function(_0x4ae464){logger['error'](_0x5343('0x2f'),'checkHopper',util[_0x5343('0x30')](_0x4ae464,{'showHidden':![],'depth':null}));};}var _0x5adf06=function(_0x4a2c14,_0x1adb9a){var _0x3e0728=squel['insert']()[_0x5343('0x31')](_0x5343('0x32'))[_0x5343('0x33')]([_0x5343('0x1e'),_0x5343('0x34'),_0x5343('0x35'),'ListId',_0x1adb9a,_0x5343('0x36'),_0x5343('0x37')],squel[_0x5343('0x38')]()['field']('phone','phone')['field']('NOW()',_0x5343('0x34'))[_0x5343('0x39')]('id',_0x5343('0x35'))[_0x5343('0x39')](LISTID[_0x5343('0x3a')](),'ListId')[_0x5343('0x39')](_0x4a2c14['id']['toString'](),_0x1adb9a)[_0x5343('0x39')](_0x5343('0x3b'),'createdAt')[_0x5343('0x39')]('NOW()','updatedAt')[_0x5343('0x3c')](_0x5343('0x3d'))[_0x5343('0x3e')](_0x5343('0x3f'))[_0x5343('0x3e')](_0x5343('0x40'),LISTID[_0x5343('0x3a')]())[_0x5343('0x3e')](_0x5343('0x41'))[_0x5343('0x3e')](_0x5343('0x42'),squel['select']()[_0x5343('0x39')](_0x5343('0x1e'))[_0x5343('0x3c')](_0x5343('0x32'))[_0x5343('0x3e')](_0x1adb9a+_0x5343('0x43'),_0x4a2c14['id'][_0x5343('0x3a')]())))[_0x5343('0x3a')]();return _0x3e0728;};var _0x3429a3=function(_0x13a453,_0x132fe7){var _0x1a7aac=squel['insert']()[_0x5343('0x31')](_0x5343('0x32'))[_0x5343('0x33')]([_0x5343('0x1e'),'scheduledAt','ContactId',_0x5343('0x25'),_0x132fe7,_0x5343('0x36'),'updatedAt'],squel[_0x5343('0x38')]()[_0x5343('0x39')]('phone',_0x5343('0x1e'))[_0x5343('0x39')](_0x5343('0x3b'),_0x5343('0x34'))['field']('id',_0x5343('0x35'))[_0x5343('0x39')](LISTID[_0x5343('0x3a')](),'ListId')['field'](_0x13a453['id']['toString'](),_0x132fe7)[_0x5343('0x39')](_0x5343('0x3b'),_0x5343('0x36'))[_0x5343('0x39')](_0x5343('0x3b'),_0x5343('0x37'))['from'](_0x5343('0x3d'))[_0x5343('0x3e')](_0x5343('0x3f'))[_0x5343('0x3e')](_0x5343('0x40'),LISTID['toString']())[_0x5343('0x3e')](_0x5343('0x44'),squel[_0x5343('0x45')](hopperContacts))[_0x5343('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x5343('0x42'),squel[_0x5343('0x38')]()[_0x5343('0x39')]('calleridnum')[_0x5343('0x3c')](_0x5343('0x46'))[_0x5343('0x3e')](_0x132fe7+_0x5343('0x43'),_0x13a453['id'][_0x5343('0x3a')]()))[_0x5343('0x3e')](_0x5343('0x42'),squel[_0x5343('0x38')]()[_0x5343('0x39')](_0x5343('0x1e'))[_0x5343('0x3c')](_0x5343('0x32'))[_0x5343('0x3e')](_0x132fe7+_0x5343('0x43'),_0x13a453['id'][_0x5343('0x3a')]())))[_0x5343('0x3a')]();return _0x1a7aac;};function _0x596a07(_0xe86c94,_0x3ae451){var _0x339d4f=squel[_0x5343('0x47')]()[_0x5343('0x31')](_0x5343('0x32'))['fromQuery']([_0x5343('0x1e'),'scheduledAt',_0x5343('0x35'),_0x5343('0x25'),_0x3ae451,'createdAt',_0x5343('0x37')],squel[_0x5343('0x38')]()[_0x5343('0x39')](_0x5343('0x1e'),_0x5343('0x1e'))['field'](_0x5343('0x3b'),_0x5343('0x34'))[_0x5343('0x39')]('id','ContactId')['field'](LISTID['toString'](),'ListId')[_0x5343('0x39')](_0xe86c94['id'][_0x5343('0x3a')](),_0x3ae451)[_0x5343('0x39')](_0x5343('0x3b'),_0x5343('0x36'))[_0x5343('0x39')](_0x5343('0x3b'),_0x5343('0x37'))[_0x5343('0x3c')](_0x5343('0x3d'))[_0x5343('0x3e')]('deletedAt\x20IS\x20NULL')[_0x5343('0x3e')](_0x5343('0x40'),LISTID[_0x5343('0x3a')]())[_0x5343('0x3e')](_0x5343('0x44'),squel[_0x5343('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5343('0x3a')]();return _0x339d4f;}function _0x48794f(_0x4dd2eb,_0x11f44c){var _0x4ffc82=squel[_0x5343('0x47')]()[_0x5343('0x31')](_0x5343('0x48'))['fromQuery']([_0x5343('0x1e'),_0x5343('0x35'),'ListId',_0x11f44c,_0x5343('0x36'),'updatedAt'],squel['select']()['field'](_0x5343('0x1e'),_0x5343('0x1e'))[_0x5343('0x39')]('id','ContactId')['field'](LISTID['toString'](),'ListId')[_0x5343('0x39')](_0x4dd2eb['id'][_0x5343('0x3a')](),_0x11f44c)[_0x5343('0x39')]('NOW()',_0x5343('0x36'))[_0x5343('0x39')](_0x5343('0x3b'),_0x5343('0x37'))[_0x5343('0x3c')](_0x5343('0x3d'))['where'](_0x5343('0x3f'))[_0x5343('0x3e')]('ListId\x20=\x20?',LISTID[_0x5343('0x3a')]())['where'](_0x5343('0x44'),squel[_0x5343('0x45')](hopperContacts))[_0x5343('0x3e')](_0x5343('0x41')))[_0x5343('0x3a')]();return _0x4ffc82;}return db[_0x5343('0x49')][_0x5343('0x4a')]({'where':{'type':_0x5343('0x4b')},'attributes':['id',_0x5343('0x4c')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x5343('0x2b')](function(_0x525665){var _0x19a2f1=[];if(_0x525665){var _0x43b9a1;for(var _0x18fe30=0x0,_0x30a1f7;_0x18fe30<_0x525665[_0x5343('0x18')];_0x18fe30+=0x1){_0x30a1f7=_0x525665[_0x18fe30][_0x5343('0x4d')]({'plain':!![]});switch(_0x30a1f7['dialCheckDuplicateType']){case _0x5343('0x4e'):_0x19a2f1['push'](db[_0x5343('0x4f')]['query'](_0x3429a3(_0x30a1f7,_0x5343('0x50')))[_0x5343('0x2b')](function(){})[_0x5343('0x2c')](_0x444f02()));break;case _0x5343('0x51'):_0x19a2f1[_0x5343('0x52')](db[_0x5343('0x4f')][_0x5343('0x53')](_0x5adf06(_0x30a1f7,'VoiceQueueId'))['then'](function(){})['catch'](_0x444f02()));break;default:_0x19a2f1[_0x5343('0x52')](db['sequelize'][_0x5343('0x53')](_0x596a07(_0x30a1f7,_0x5343('0x50')))[_0x5343('0x2b')](function(){})[_0x5343('0x2c')](_0x444f02()));}}}return _0x19a2f1;})[_0x5343('0x54')]()[_0x5343('0x2b')](function(){return db[_0x5343('0x49')][_0x5343('0x4a')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x5343('0x55')],'as':_0x5343('0x56'),'where':{'id':LISTID}}]})[_0x5343('0x2b')](function(_0x5ecd84){var _0x41fa0b=[];if(_0x5ecd84){var _0x1496a8;for(var _0x37ef4a=0x0,_0xa1f8b7;_0x37ef4a<_0x5ecd84[_0x5343('0x18')];_0x37ef4a+=0x1){_0xa1f8b7=_0x5ecd84[_0x37ef4a][_0x5343('0x4d')]({'plain':!![]});_0x41fa0b[_0x5343('0x52')](db['sequelize'][_0x5343('0x53')](_0x48794f(_0xa1f8b7,_0x5343('0x50')))[_0x5343('0x2b')](function(){})['catch'](_0x444f02()));}}return _0x41fa0b;})['all']();})['then'](function(){return db['Campaign'][_0x5343('0x4a')]({'attributes':['id',_0x5343('0x4c')],'include':[{'model':db[_0x5343('0x55')],'as':_0x5343('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x264322){var _0x3e47c2=[];if(_0x264322){for(var _0x44fa8d=0x0,_0x4004f7;_0x44fa8d<_0x264322['length'];_0x44fa8d+=0x1){_0x4004f7=_0x264322[_0x44fa8d][_0x5343('0x4d')]({'plain':!![]});switch(_0x4004f7[_0x5343('0x4c')]){case _0x5343('0x4e'):_0x3e47c2[_0x5343('0x52')](db[_0x5343('0x4f')]['query'](_0x3429a3(_0x4004f7,_0x5343('0x58')))[_0x5343('0x2b')](function(){})[_0x5343('0x2c')](_0x444f02()));break;case _0x5343('0x51'):_0x3e47c2[_0x5343('0x52')](db[_0x5343('0x4f')][_0x5343('0x53')](_0x5adf06(_0x4004f7,_0x5343('0x58')))[_0x5343('0x2b')](function(){})[_0x5343('0x2c')](_0x444f02()));break;default:_0x3e47c2[_0x5343('0x52')](db[_0x5343('0x4f')][_0x5343('0x53')](_0x596a07(_0x4004f7,_0x5343('0x58')))['then'](function(){})[_0x5343('0x2c')](_0x444f02()));}}}return _0x3e47c2;})[_0x5343('0x54')]();})[_0x5343('0x2b')](function(){return db['Campaign'][_0x5343('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x5343('0x55')],'as':_0x5343('0x56'),'where':{'id':LISTID}}]})[_0x5343('0x2b')](function(_0x1ea2d0){var _0x21b058=[];if(_0x1ea2d0){for(var _0x20abe5=0x0,_0x52f166;_0x20abe5<_0x1ea2d0[_0x5343('0x18')];_0x20abe5+=0x1){_0x52f166=_0x1ea2d0[_0x20abe5]['get']({'plain':!![]});_0x21b058[_0x5343('0x52')](db[_0x5343('0x4f')][_0x5343('0x53')](_0x48794f(_0x52f166,_0x5343('0x58')))[_0x5343('0x2b')](function(){})[_0x5343('0x2c')](_0x444f02()));}}return _0x21b058;})[_0x5343('0x54')]();})[_0x5343('0x2c')](function(_0x1472e7){logger[_0x5343('0x12')]('cmContact,\x20%s,\x20%s',_0x5343('0x59'),_0x1472e7['message']);});}var processPromises=function(_0x38d9f0){return BPromise[_0x5343('0x54')](promises)[_0x5343('0x2b')](function(_0x31d70b){})[_0x5343('0x2c')](function(_0x419cd1){logger[_0x5343('0x12')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x419cd1));})['finally'](function(){socket[_0x5343('0x5a')](_0x5343('0x5b')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x38d9f0){return _0x38d9f0['resume']();}});};var endCsv=function(){return BPromise[_0x5343('0x5c')]()[_0x5343('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x5343('0x2b')](function(){socket[_0x5343('0x5a')](_0x5343('0x5b')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5343('0x5d')](FILEPATH);}catch(_0x24c175){logger[_0x5343('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x5343('0x2e')](_0x24c175));}finally{process[_0x5343('0x5e')](0x0);}});};process['on']('SIGINT',function(){logger[_0x5343('0x5f')](_0x5343('0x60'));endCsv();});function main(){return BPromise[_0x5343('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5343('0x10')](',');return db['CmContact'][_0x5343('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5343('0x2b')](function(_0x4615f3){var _0xad9594=fs[_0x5343('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5343('0x62')](_0xad9594,{'header':!![],'skipEmptyLines':!![],'step':function(_0x42a2a5,_0x43ebc9){total+=0x1;var _0x324ef5=total;promises[_0x5343('0x52')](checkRow(_0x42a2a5,_0x4615f3,_0x324ef5)['then'](function(){success+=0x1;})[_0x5343('0x2c')](function(_0x294e9a){if(_0x294e9a[_0x5343('0x12')]){errors+=0x1;delete _0x294e9a[_0x5343('0x12')];}else if(_0x294e9a['duplicate']){duplicates+=0x1;delete _0x294e9a[_0x5343('0x63')];}rows[_0x5343('0x52')](_0x294e9a);}));if(total%0xc8===0x0){_0x43ebc9[_0x5343('0x64')]();return processPromises(_0x43ebc9);}},'complete':function(){return processPromises()[_0x5343('0x2b')](function(){logger[_0x5343('0x5f')](_0x5343('0x65'));endCsv();});},'error':function(_0x3ba814,_0x25b6c2){logger['info']('CSV\x20parse\x20error',JSON[_0x5343('0x2e')](_0x3ba814));endCsv();}});})[_0x5343('0x2c')](function(_0x38c8ff){logger[_0x5343('0x12')](_0x5343('0x66'),JSON[_0x5343('0x2e')](_0x38c8ff));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 35182f7..53cdb27 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 _0x2929=['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','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','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','Received\x20SIGINT','error','message','errors','query','spread','catch','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','dialTimezone','utcOffset','set','offset','info','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','keys','includes','header','ContactItemType','name','_description','parse','createReadStream','rows','data','find','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','hasOwnProperty','trim','itemTypeId','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','\x20LIKE\x20cm_contacts;','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','phone\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','update','updated','create','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','createdAt','updatedAt','priority','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','toString','cm_contacts.phone','cm_hopper_black','ContactId','ListId','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.createdAt','fromQuery','UserId','field'];(function(_0x355b15,_0x51becb){var _0x50a588=function(_0x507474){while(--_0x507474){_0x355b15['push'](_0x355b15['shift']());}};_0x50a588(++_0x51becb);}(_0x2929,0x130));var _0x9292=function(_0x54ac59,_0x4e140e){_0x54ac59=_0x54ac59-0x0;var _0x43a462=_0x2929[_0x54ac59];return _0x43a462;};'use strict';var fs=require('fs');var path=require(_0x9292('0x0'));var _=require(_0x9292('0x1'));var Papa=require(_0x9292('0x2'));var util=require('util');var BPromise=require(_0x9292('0x3'));var moment=require(_0x9292('0x4'));var squel=require(_0x9292('0x5'));var Redis=require(_0x9292('0x6'));var db=require(_0x9292('0x7'))['db'];var config=require(_0x9292('0x8'));var shared=require(_0x9292('0x9'));var logger=require(_0x9292('0xa'))(_0x9292('0xb'));config[_0x9292('0xc')]=_[_0x9292('0xd')](config[_0x9292('0xc')],{'host':_0x9292('0xe'),'port':0x18eb});var socket=require(_0x9292('0xf'))(new Redis(config[_0x9292('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x9292('0x10')](_0x9292('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x9292('0x10')](_0x9292('0x11'));function isEmail(_0x12104e){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))*$/[_0x9292('0x12')](_0x12104e);}function selectNotIn(_0x57af97,_0x220bca,_0x19660c,_0x2bdc48,_0x3d17b2){return squel[_0x9292('0x13')]()['field'](_0x9292('0x14'))[_0x9292('0x15')](_0x2bdc48)[_0x9292('0x16')](_0x220bca,null,_0x220bca+_0x9292('0x17')+_0x2bdc48+'.'+_0x19660c)[_0x9292('0x18')](_0x2bdc48+'.'+_0x19660c+_0x9292('0x19')+_0x57af97+'.'+_0x19660c)[_0x9292('0x18')](_0x220bca+_0x9292('0x1a')+_0x3d17b2['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x373c3e,_0x3f9415){promisesAdditionalPhones=[];return db[_0x9292('0x1b')]['findAll']({'raw':!![],'attributes':['id',_0x9292('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x9292('0x1d')](function(_0x4e90a3){if(_0x4e90a3!==null){var _0x3fb73e=[];for(var _0x83cfc6=0x0;_0x83cfc6<_0x4e90a3[_0x9292('0x1e')];_0x83cfc6++){var _0x14342d=_0x4e90a3[_0x83cfc6];_0x3fb73e[_0x9292('0x1f')](insertAdditionalPhones(_0x14342d));}}Promise[_0x9292('0x20')](_0x3fb73e)[_0x9292('0x1d')](function(){_0x373c3e({'val':0x1});});});});}function insertAdditionalPhones(_0x552ff8){return new Promise(function(_0x138f99,_0x4db9ea){var _0x1880c4=_0x552ff8['AdditionalPhones'];var _0x73e126=_0x1880c4['split'](';');var _0xb5c42e=[];orderBy=0x0;for(var _0x4e7621=0x0;_0x4e7621<_0x73e126[_0x9292('0x1e')];_0x4e7621++){_0xb5c42e[_0x9292('0x1f')](splitAdditionalPhone(_0x552ff8['id'],_0x73e126[_0x4e7621]));}Promise['all'](_0xb5c42e)[_0x9292('0x1d')](function(){_0x138f99({'val':_0x73e126[_0x9292('0x1e')]});});});}function splitAdditionalPhone(_0x17b3b3,_0x54b38e){return new Promise(function(_0x10c208,_0x1d33ea){var _0x3b0e5e=_0x54b38e[_0x9292('0x21')](':');var _0x4ab294=_0x3b0e5e[0x0];var _0x234f45=_0x3b0e5e[0x1];if(!_[_0x9292('0x22')](_0x234f45)){var _0xd35526=_0x234f45[_0x9292('0x21')]('|');var _0x260832=[];for(var _0x33fb57=0x0;_0x33fb57<_0xd35526[_0x9292('0x1e')];_0x33fb57++){if(_0xd35526[_0x33fb57]!==''){var _0x2d3c4b=_['filter'](promisesAdditionalPhones,{'contactId':_0x17b3b3,'phone':_0xd35526[_0x33fb57]});if(_0x2d3c4b[_0x9292('0x1e')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x17b3b3,'contactTypeId':_0x4ab294,'phone':_0xd35526[_0x33fb57],'orderBy':orderBy});}}}_0x10c208({'ok':0x1});}else _0x10c208({'res':0x0});});}function createAdditionalPhone(_0x339070,_0x3a6b91,_0x5b85d3,_0x5dd1f5){var _0x5ca343='';var _0x352c98='';var _0x1832e8=_0x5b85d3[_0x9292('0x21')]('§');_0x5ca343=_0x1832e8[0x0];if(_0x1832e8['length']==0x2)_0x352c98=_0x1832e8[0x1];return new Promise(function(_0x5147ac,_0x494691){return db[_0x9292('0x23')]['findOne']({'where':{'CmContactId':_0x339070,'item':_0x5ca343}})['then'](function(_0x33bbcc){if(_0x33bbcc){return db[_0x9292('0x23')][_0x9292('0x24')]({'ItemTypeId':_0x3a6b91,'description':_0x352c98,'OrderBy':_0x5dd1f5},{'where':{'CmContactId':_0x339070,'item':_0x5ca343}})[_0x9292('0x1d')](function(_0x299eb7){_0x5147ac({'res':_0x9292('0x25')});});}else{return db['CmContactHasItem'][_0x9292('0x26')]({'CmContactId':_0x339070,'item':_0x5ca343,'description':_0x352c98,'ItemTypeId':_0x3a6b91,'OrderBy':_0x5dd1f5,'ItemClass':'PHONE'})['then'](function(_0x521caa){_0x5147ac({'res':_0x9292('0x27')});});}});});}function insertCmHopper(_0x41bb82,_0x3aa304,_0x59d9cb,_0x2e970a,_0x3585d7){var _0x5bf150=['cm_contacts.phone',_0x9292('0x28'),_0x9292('0x29'),_0x9292('0x2a'),_0x3aa304+'.'+_0x2e970a,'cm_contacts.createdAt',_0x9292('0x2b'),_0x9292('0x2c'),_0x9292('0x2d'),'\x22'+_0x3585d7+'\x22'];return squel[_0x9292('0x2e')]()[_0x9292('0x2f')](_0x9292('0x30'))['fromQuery']([_0x9292('0x14'),_0x9292('0x31'),'ContactId','ListId',_0x2e970a,_0x9292('0x32'),_0x9292('0x33'),_0x9292('0x34'),'UserId',_0x9292('0x35')],squel['select']()[_0x9292('0x36')](_0x5bf150)[_0x9292('0x15')](_0x3aa304)[_0x9292('0x16')](_0x9292('0x37'),null,_0x9292('0x38')+_0x3aa304+_0x9292('0x39'))[_0x9292('0x16')](_0x59d9cb,null,_0x59d9cb+_0x9292('0x17')+_0x3aa304+'.'+_0x2e970a)[_0x9292('0x18')](_0x3aa304+_0x9292('0x3a'),_0x41bb82)['where'](_0x9292('0x3b'),NOW)[_0x9292('0x18')](_0x9292('0x3c'),selectNotIn(_0x3aa304,_0x59d9cb,_0x2e970a,_0x9292('0x30'),[_0x9292('0x3d'),_0x9292('0x3e')]))[_0x9292('0x18')](_0x9292('0x3c'),selectNotIn(_0x3aa304,_0x59d9cb,_0x2e970a,_0x9292('0x30'),['\x22always\x22'])))[_0x9292('0x3f')]();}function insertCmHopperBlack(_0x75811d,_0x4757a4,_0x2b5571,_0x4a20ca){var _0x529658=[_0x9292('0x40'),'cm_contacts.id','cm_contacts.ListId',_0x4757a4+'.'+_0x4a20ca,'cm_contacts.createdAt',_0x9292('0x2b')];return squel[_0x9292('0x2e')]()['into'](_0x9292('0x41'))['fromQuery']([_0x9292('0x14'),_0x9292('0x42'),_0x9292('0x43'),_0x4a20ca,_0x9292('0x32'),_0x9292('0x33')],squel[_0x9292('0x13')]()[_0x9292('0x36')](_0x529658)['from'](_0x4757a4)['join']('cm_contacts',null,_0x9292('0x38')+_0x4757a4+'.CmListId')[_0x9292('0x16')](_0x2b5571,null,_0x2b5571+_0x9292('0x17')+_0x4757a4+'.'+_0x4a20ca)[_0x9292('0x18')](_0x4757a4+_0x9292('0x3a'),_0x75811d)[_0x9292('0x18')](_0x9292('0x3b'),NOW)[_0x9292('0x18')](_0x9292('0x3c'),squel[_0x9292('0x13')]()['field'](_0x9292('0x14'))[_0x9292('0x15')](_0x9292('0x41'))[_0x9292('0x18')](_0x9292('0x44'),_0x75811d)['where'](_0x4a20ca+_0x9292('0x19')+_0x4757a4+'.'+_0x4a20ca)))[_0x9292('0x3f')]();}function insertTzCmHopper(_0x507824,_0x19e413,_0x6be32,_0x1e0fde,_0xccab69,_0x3d3107){var _0x128b0c=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x3d3107+_0x9292('0x45'),_0x9292('0x29'),_0x9292('0x2a'),_0x19e413+'.'+_0x1e0fde,_0x9292('0x46'),_0x9292('0x2b'),_0x9292('0x2c'),_0x9292('0x2d'),'\x22'+_0xccab69+'\x22'];var _0x50f723=squel['insert']()[_0x9292('0x2f')](_0x9292('0x30'))[_0x9292('0x47')]([_0x9292('0x14'),'scheduledat',_0x9292('0x42'),_0x9292('0x43'),_0x1e0fde,_0x9292('0x32'),'updatedAt',_0x9292('0x34'),_0x9292('0x48'),_0x9292('0x35')],squel[_0x9292('0x13')]()[_0x9292('0x36')](_0x128b0c)[_0x9292('0x15')](_0x19e413)[_0x9292('0x16')](_0x9292('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0x19e413+_0x9292('0x39'))[_0x9292('0x16')](_0x6be32,null,_0x6be32+_0x9292('0x17')+_0x19e413+'.'+_0x1e0fde)[_0x9292('0x16')](_0x3d3107,null,_0x3d3107+_0x9292('0x17')+_0x19e413+'.'+_0x1e0fde)['where'](_0x19e413+_0x9292('0x3a'),_0x507824)[_0x9292('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x9292('0x18')](_0x9292('0x3c'),selectNotIn(_0x19e413,_0x6be32,_0x1e0fde,_0x9292('0x30'),[_0x9292('0x3d'),_0x9292('0x3e')]))['where'](_0x9292('0x3c'),selectNotIn(_0x19e413,_0x6be32,_0x1e0fde,_0x9292('0x30'),[_0x9292('0x3d')])))[_0x9292('0x3f')]();return _0x50f723;}function insertTzCmHopperBlack(_0x268858,_0xacc1c0,_0x45f67c,_0x18fb10){var _0x578a92=[_0x9292('0x40'),_0x9292('0x29'),'cm_contacts.ListId',_0xacc1c0+'.'+_0x18fb10,_0x9292('0x46'),_0x9292('0x2b')];return squel[_0x9292('0x2e')]()['into'](_0x9292('0x41'))[_0x9292('0x47')](['phone',_0x9292('0x42'),'ListId',_0x18fb10,'createdAt',_0x9292('0x33')],squel[_0x9292('0x13')]()[_0x9292('0x36')](_0x578a92)[_0x9292('0x15')](_0xacc1c0)[_0x9292('0x16')](_0x9292('0x37'),null,_0x9292('0x38')+_0xacc1c0+_0x9292('0x39'))[_0x9292('0x16')](_0x45f67c,null,_0x45f67c+_0x9292('0x17')+_0xacc1c0+'.'+_0x18fb10)[_0x9292('0x18')](_0xacc1c0+_0x9292('0x3a'),_0x268858)[_0x9292('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x9292('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x9292('0x13')]()[_0x9292('0x49')]('phone')[_0x9292('0x15')](_0x9292('0x41'))[_0x9292('0x18')](_0x9292('0x44'),_0x268858)['where'](_0x18fb10+_0x9292('0x19')+_0xacc1c0+'.'+_0x18fb10)))['toString']();}function insertCmHopperAdditionalPhones(_0x41fbf1){var _0x3c0324=[_0x9292('0x4a'),_0x9292('0x4b'),_0x9292('0x4c'),_0x9292('0x4d'),_0x9292('0x4e')];return squel[_0x9292('0x2e')]()['into'](_0x9292('0x4f'))['fromQuery'](['CmHopperId',_0x9292('0x14'),_0x9292('0x50'),_0x9292('0x32'),_0x9292('0x33')],squel['select']()[_0x9292('0x36')](_0x3c0324)[_0x9292('0x15')](_0x9292('0x30'))[_0x9292('0x16')](_0x9292('0x37'),null,_0x9292('0x51'))[_0x9292('0x16')](_0x9292('0x52'),null,_0x9292('0x53'))[_0x9292('0x18')](_0x9292('0x54'),_0x41fbf1)[_0x9292('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x273017,_0x4bd050,_0x12d067,_0x44217d){var _0x3d29d2=_[_0x9292('0x55')](_['keys'](_0x44217d),['ListId',_0x9292('0x56'),'createdAt','updatedAt',_0x9292('0x57')]);return squel[_0x9292('0x2e')]()[_0x9292('0x2f')](_0x9292('0x37'))['fromQuery'](_0x3d29d2,squel['select']()[_0x9292('0x36')](_0x3d29d2)[_0x9292('0x15')](_0x4bd050)[_0x9292('0x18')]('('+_0x12d067[_0x9292('0x16')](',')+_0x9292('0x58'),squel[_0x9292('0x13')]()['fields'](_0x12d067)['from'](_0x9292('0x37'))['where'](_0x9292('0x44'),_0x273017)['where']('deletedAt\x20IS\x20NULL'))[_0x9292('0x18')](_0x9292('0x59'),squel[_0x9292('0x13')]()[_0x9292('0x49')](_0x9292('0x5a'),_0x9292('0x5b'))[_0x9292('0x15')](_0x4bd050)['group'](_0x12d067[_0x9292('0x16')](','))))['toString']();}function handleStop(){logger['info'](_0x9292('0x5c'));stopped=!![];}function handleUncaughtException(_0x494a61){logger[_0x9292('0x5d')](_0x494a61[_0x9292('0x5e')]);process['exit'](0x1);}function handleError(_0xaaef42,_0x814121){stats[_0x9292('0x5f')]['push']({'name':_0x814121['code'],'message':_0x814121[_0x9292('0x5e')],'row':_0xaaef42});}function handleQuery(_0x1faf51){logger['info'](_0x1faf51);return db['sequelize'][_0x9292('0x60')](_0x1faf51)[_0x9292('0x61')](function(_0x1dc7d5){results['push'](_0x1dc7d5);})[_0x9292('0x62')](function(_0x5c791b){logger[_0x9292('0x5d')](_0x5c791b[_0x9292('0x5e')]);});}function updateTzCampaigns(_0x286101){return new Promise(function(_0x288423,_0x533cd9){var _0x3fa620=squel['select']()['fields']([_0x9292('0x63'),'campaigns.dialTimezone'])[_0x9292('0x15')](_0x9292('0x64'))[_0x9292('0x16')](_0x9292('0x65'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x9292('0x18')](_0x9292('0x66')+_0x286101);db[_0x9292('0x67')]['query'](_0x3fa620[_0x9292('0x3f')]())[_0x9292('0x61')](function(_0x543bb6){var _0x3ed208=[];for(var _0x3151ea=0x0;_0x3151ea<_0x543bb6[_0x9292('0x1e')];_0x3151ea++){_0x3ed208[_0x9292('0x1f')](getTimezoneData(_0x543bb6[_0x3151ea],tmp_campaigns));}BPromise[_0x9292('0x20')](_0x3ed208)[_0x9292('0x1d')](function(){_0x288423({'val':0x1});});})[_0x9292('0x62')](function(_0x5cf67d){logger['error'](_0x5cf67d['message']);_0x288423({'val':0x0});});});}function updateTzVoiceQueues(_0x4b80ed){return new Promise(function(_0x292021,_0x1389dd){var _0x20c5bb=squel['select']()[_0x9292('0x36')]([_0x9292('0x68'),_0x9292('0x69')])[_0x9292('0x15')](_0x9292('0x6a'))[_0x9292('0x16')](_0x9292('0x6b'),null,_0x9292('0x6c'))['where']('voice_queues_has_cm_lists.CmListId='+_0x4b80ed);db[_0x9292('0x67')][_0x9292('0x60')](_0x20c5bb[_0x9292('0x3f')]())['spread'](function(_0x12d436){var _0x48105f=[];for(var _0x290bb4=0x0;_0x290bb4<_0x12d436[_0x9292('0x1e')];_0x290bb4++){_0x48105f[_0x9292('0x1f')](getTimezoneData(_0x12d436[_0x290bb4],tmp_voice_queues));}BPromise[_0x9292('0x20')](_0x48105f)[_0x9292('0x1d')](function(){_0x292021({'val':0x1});});})['catch'](function(_0x310093){logger[_0x9292('0x5d')](_0x310093['message']);_0x292021({'val':0x0});});});}function getTimezoneData(_0x4288bf,_0x5ba0f0){return new Promise(function(_0x3f4fe3,_0x6a5c39){var _0x27d97f=shared[_0x9292('0x6d')];var _0x50b35b=_0x27d97f[_0x4288bf[_0x9292('0x6e')]];if(_[_0x9292('0x22')](_0x50b35b)){_0x3f4fe3({'ret':0x1});}else{var _0x31596a=_0x50b35b[_0x9292('0x6f')];var _0x3f4533=squel['insert']()['into'](_0x5ba0f0)[_0x9292('0x70')]('id',_0x4288bf['id'])[_0x9292('0x70')](_0x9292('0x71'),_0x31596a)[_0x9292('0x70')](_0x9292('0x6e'),_0x4288bf[_0x9292('0x6e')])['toString']();return db[_0x9292('0x67')][_0x9292('0x60')](_0x3f4533)['spread'](function(_0x3c3439){_0x3f4fe3({'ret':0x1});})[_0x9292('0x62')](function(_0x3ffb47){logger[_0x9292('0x5d')](_0x3ffb47[_0x9292('0x5e')]);_0x6a5c39({'ret':0x1});});}});}function handleTZQuery(_0x50e521){logger[_0x9292('0x72')](_0x50e521);return db['sequelize']['query'](_0x50e521)[_0x9292('0x61')](function(_0x56e53c){})[_0x9292('0x62')](function(_0x54be28){logger[_0x9292('0x5d')](_0x54be28[_0x9292('0x5e')]);});}function main(_0x4bd268,_0x396509,_0x18091f,_0x305a16){logger[_0x9292('0x72')](_0x9292('0x73'),_0x4bd268,JSON[_0x9292('0x74')](_0x396509));process[_0x9292('0x75')](_0x9292('0x76'));var _0x490cc2=_0x396509[_0x9292('0x77')];var _0x4ca5a4=_[_0x9292('0x78')](_0x490cc2);var _0x5a67db=_0x396509[_0x9292('0x79')];var _0x4edfb6=path[_0x9292('0x16')](config[_0x9292('0x7a')],_0x9292('0x7b'),_0x5a67db+_0x9292('0x7c'));hasTZ=_[_0x9292('0x7d')](_0x490cc2)[_0x9292('0x7e')]('dialTimezone');var _0xa5c723=_[_0x9292('0x7d')](_0x490cc2)[_0x9292('0x16')]();logger['info'](_0x9292('0x7f'),_0xa5c723);db[_0x9292('0x80')]['findAll']({'raw':!![],'attributes':['id',_0x9292('0x81')]})[_0x9292('0x1d')](function(_0x47357b){for(var _0x584795=0x0;_0x584795<_0x47357b[_0x9292('0x1e')];_0x584795++){if(_0x47357b[_0x584795]['name']in _0x490cc2){contactItemTypes[_0x9292('0x1f')](_0x47357b[_0x584795]);delete _0x4ca5a4[_0x47357b[_0x584795][_0x9292('0x81')]];hasAdditionalPhones=!![];}for(var _0x5ea03d in _0x490cc2){if(_0x47357b[_0x584795]['name']+_0x9292('0x82')===_0x5ea03d){phoneDescriptions[_0x9292('0x1f')]({'itemTypeId':_0x47357b[_0x584795]['id'],'description':_0x5ea03d});delete _0x4ca5a4[_0x5ea03d];}}}if(hasAdditionalPhones)_0x4ca5a4[_0x9292('0x1c')]='';var _0x2ca901=_[_0x9292('0x7d')](_0x4ca5a4)[_0x9292('0x16')]();logger[_0x9292('0x72')](_0x9292('0x7f'),_0x2ca901);fs['writeFileSync'](_0x4edfb6,_0x2ca901+'\x0a');Papa[_0x9292('0x83')](fs[_0x9292('0x84')](_0x4bd268),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5cab38,_0x2bf511){try{for(var _0x24c0d3=0x0,_0x1af097=[];_0x24c0d3<_0x5cab38['data'][_0x9292('0x1e')];_0x24c0d3++){stats[_0x9292('0x85')]+=0x1;if(_0x5cab38['errors'][_0x24c0d3]){handleError(_0x5cab38[_0x9292('0x86')][_0x24c0d3],_0x5cab38[_0x9292('0x5f')][_0x24c0d3]);}else{var _0x2e6315=[];var _0x499a29=[];var _0xef6d7a={};for(var _0x87d80f in _0x490cc2){let _0x1fa849=contactItemTypes[_0x9292('0x87')](_0x1f7232=>_0x1f7232['name']===_0x87d80f);let _0x30d996=contactItemTypes[_0x9292('0x87')](_0x5583ec=>_0x5583ec['name']+_0x9292('0x82')===_0x87d80f);if(_['isNil'](_0x1fa849)&&_[_0x9292('0x22')](_0x30d996)){if(_0x490cc2['hasOwnProperty'](_0x87d80f)){if(_0x5cab38[_0x9292('0x86')][_0x24c0d3][_0x490cc2[_0x87d80f]]){var _0x355183=_['trim'](_0x5cab38[_0x9292('0x86')][_0x24c0d3][_0x490cc2[_0x87d80f]][_0x9292('0x88')](/"/g,'\x27'));switch(_0x87d80f){case _0x9292('0x31'):var _0x4b7485=moment(_0x355183,_0x9292('0x11'),!![]);if(_0x4b7485['isValid']()){_0x1af097[_0x9292('0x1f')]('\x22'+_0x355183+'\x22');}else{_0x2e6315[_0x9292('0x1f')](_0x9292('0x89'));}break;case'priority':var _0x35a1cf=parseInt(_0x355183);_0x355183=_[_0x9292('0x8a')](_0x35a1cf)||_0x35a1cf<0x0||_0x35a1cf>0x4?_0x305a16?0x3:0x2:_0x35a1cf;_0x1af097[_0x9292('0x1f')]('\x22'+_0x355183+'\x22');break;case _0x9292('0x48'):var _0x5f0d9e=parseInt(_0x355183);if(_[_0x9292('0x8b')](_0x5f0d9e)&&_['includes'](_0x18091f,_0x5f0d9e)){_0x1af097[_0x9292('0x1f')]('\x22'+_0x5f0d9e+'\x22');}else{_0x2e6315[_0x9292('0x1f')](_0x9292('0x8c'));}break;case _0x9292('0x8d'):if(isEmail(_0x355183)){_0x1af097[_0x9292('0x1f')]('\x22'+_0x355183+'\x22');}else{_0x2e6315[_0x9292('0x1f')](_0x9292('0x8e'));}break;case _0x9292('0x8f'):var _0x118127=moment(_0x355183,_0x9292('0x90'),!![]);if(_0x118127[_0x9292('0x91')]()){_0x1af097[_0x9292('0x1f')]('\x22'+_0x355183+'\x22');}else{_0x2e6315[_0x9292('0x1f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x9292('0x6e'):var _0x470b79=shared[_0x9292('0x6d')];var _0x5f0e1a=_0x470b79[_0x355183];if(!_[_0x9292('0x22')](_0x5f0e1a)){var _0x4e887e=_0x5f0e1a[_0x9292('0x6f')];_0x1af097[_0x9292('0x1f')]('\x22'+_0x355183+'\x22');_0x1af097[_0x9292('0x1f')]('\x22'+_0x4e887e+'\x22');}break;default:_0x1af097[_0x9292('0x1f')]('\x22'+_0x355183+'\x22');}}else{switch(_0x87d80f){case _0x9292('0x92'):case _0x9292('0x14'):_0x2e6315[_0x9292('0x1f')](_0x87d80f+'\x20not\x20specified');break;default:_0x1af097[_0x9292('0x1f')]('\x22\x22');}}}}else{var _0x5c8b3c='';if(!_[_0x9292('0x22')](_0x1fa849)){if(!_0xef6d7a[_0x9292('0x93')](_0x1fa849['id'])){if(!_[_0x9292('0x22')](_0x5cab38['data'][_0x24c0d3][_0x490cc2[_0x87d80f]])){var _0x355183=_[_0x9292('0x94')](_0x5cab38[_0x9292('0x86')][_0x24c0d3][_0x490cc2[_0x87d80f]]['replace'](/"/g,'\x27'));var _0x33ad25=phoneDescriptions['find'](_0x52c199=>_0x52c199[_0x9292('0x95')]===_0x1fa849['id']);if(!_['isNil'](_0x33ad25)){var _0x4cda42=_[_0x9292('0x94')](_0x5cab38[_0x9292('0x86')][_0x24c0d3][_0x490cc2[_0x33ad25['description']]][_0x9292('0x88')](/"/g,'\x27'));if(!_[_0x9292('0x22')](_0x4cda42))_0x355183=_0x355183+'§'+_0x4cda42;}if(_0x5c8b3c=='')_0x5c8b3c=_0x355183;else _0x5c8b3c+='|'+_0x355183;}_0x499a29[_0x9292('0x1f')](_0x1fa849['id']+':'+_0x5c8b3c);_0xef6d7a[_0x1fa849['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1af097['push']('\x22'+_0x499a29[_0x9292('0x16')](';')+'\x22');}if(_0x2e6315[_0x9292('0x1e')]){handleError(_0x5cab38[_0x9292('0x86')][_0x24c0d3],{'code':_0x9292('0x96'),'message':_0x2e6315[_0x9292('0x16')]()});}else{fs[_0x9292('0x97')](_0x4edfb6,_0x1af097[_0x9292('0x16')]()+'\x0a');}_0x1af097=[];}if(!(stats['rows']%0xc8)){socket[_0x9292('0x98')](_0x9292('0x99')+_0x5a67db,stats);stats[_0x9292('0x5f')]=[];}}if(stopped){logger[_0x9292('0x72')](_0x9292('0x9a'));_0x2bf511[_0x9292('0x9b')]();}}catch(_0x4e2d16){handleError(_0x5cab38[_0x9292('0x86')][_0x24c0d3],{'code':_0x9292('0x9c'),'message':_0x4e2d16['message']});logger['error'](_0x9292('0x9d'),_0x4e2d16['message']);}},'complete':function(){try{var _0x422e7e=[];var _0x4247a7=[];var _0x5ba489=_0x9292('0x37');if(_0x396509[_0x9292('0x9e')]&&_0x396509[_0x9292('0x9e')][_0x9292('0x1e')]){_0x5ba489='cm_contacts_'+_0x5a67db;_0x422e7e[_0x9292('0x1f')]('CREATE\x20TABLE\x20'+_0x5ba489+_0x9292('0x9f'));}tmp_campaigns='campaigns_'+_0x5a67db;tmp_voice_queues=_0x9292('0xa0')+_0x5a67db;_0x4247a7['push'](_0x9292('0xa1')+tmp_campaigns+_0x9292('0xa2'));_0x4247a7[_0x9292('0x1f')](_0x9292('0xa1')+tmp_voice_queues+_0x9292('0xa2'));BPromise[_0x9292('0xa3')](_0x4247a7,handleTZQuery)['then'](function(_0x39bd3c){updateTzCampaigns(_0x396509[_0x9292('0x43')])[_0x9292('0x1d')](function(_0xc3aed1){updateTzVoiceQueues(_0x396509['ListId'])['then'](function(_0x4a6f10){if(hasTZ)_0x2ca901=_0x2ca901[_0x9292('0x88')]('dialTimezone',_0x9292('0xa4'));var _0x3d77b1=util['format'](_0x9292('0xa5'),_0x4edfb6,_0x5ba489,_0x2ca901,_0x396509[_0x9292('0x43')],_0x396509[_0x9292('0x56')]||null,NOW,NOW);if(_['isNil'](_0x490cc2[_0x9292('0x31')])){_0x3d77b1+=_0x9292('0xa6');}_0x422e7e[_0x9292('0x1f')](_0x3d77b1);if(_0x396509[_0x9292('0x9e')]&&_0x396509[_0x9292('0x9e')][_0x9292('0x1e')]){_0x422e7e[_0x9292('0x1f')](insertCmContact(_0x396509[_0x9292('0x43')],_0x5ba489,_0x396509[_0x9292('0x9e')],_0x490cc2));_0x422e7e['push'](_0x9292('0xa7')+_0x5ba489+';');}BPromise[_0x9292('0xa3')](_0x422e7e,handleQuery)[_0x9292('0x1d')](function(_0x11793a){BPromise['all']([handleAdditionalPhones()])[_0x9292('0x1d')](function(){_0x422e7e=[];for(var _0x3f508c=0x0;_0x3f508c_0x5d027b[_0x145e('0x77')]===_0x24cc73);let _0x280ee3=contactItemTypes[_0x145e('0x7d')](_0x333d02=>_0x333d02['name']+'_description'===_0x24cc73);if(_[_0x145e('0x7e')](_0x106e7a)&&_['isNil'](_0x280ee3)){if(_0x54869c[_0x145e('0x7f')](_0x24cc73)){if(_0x3ee3c5[_0x145e('0x7b')][_0x54b600][_0x54869c[_0x24cc73]]){var _0x23c649=_['trim'](_0x3ee3c5[_0x145e('0x7b')][_0x54b600][_0x54869c[_0x24cc73]][_0x145e('0x80')](/"/g,'\x27'));switch(_0x24cc73){case _0x145e('0x2e'):var _0x5c8a8d=moment(_0x23c649,_0x145e('0xf'),!![]);if(_0x5c8a8d['isValid']()){_0x427397['push']('\x22'+_0x23c649+'\x22');}else{_0x1ece03[_0x145e('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x145e('0x33'):var _0x133990=parseInt(_0x23c649);_0x23c649=_[_0x145e('0x81')](_0x133990)||_0x133990<0x0||_0x133990>0x4?_0xf94755?0x3:0x2:_0x133990;_0x427397[_0x145e('0x1d')]('\x22'+_0x23c649+'\x22');break;case _0x145e('0x44'):var _0x305f86=parseInt(_0x23c649);if(_[_0x145e('0x82')](_0x305f86)&&_[_0x145e('0x83')](_0x5f4175,_0x305f86)){_0x427397[_0x145e('0x1d')]('\x22'+_0x305f86+'\x22');}else{_0x1ece03[_0x145e('0x1d')](_0x145e('0x84'));}break;case _0x145e('0x85'):if(isEmail(_0x23c649)){_0x427397[_0x145e('0x1d')]('\x22'+_0x23c649+'\x22');}else{_0x1ece03[_0x145e('0x1d')](_0x145e('0x86'));}break;case _0x145e('0x87'):var _0x19034b=moment(_0x23c649,_0x145e('0x88'),!![]);if(_0x19034b[_0x145e('0x89')]()){_0x427397[_0x145e('0x1d')]('\x22'+_0x23c649+'\x22');}else{_0x1ece03[_0x145e('0x1d')](_0x145e('0x8a'));}break;case _0x145e('0x6d'):var _0x5ced12=shared[_0x145e('0x69')];var _0x33fc8e=_0x5ced12[_0x23c649];if(!_[_0x145e('0x7e')](_0x33fc8e)){var _0x18a6ac=_0x33fc8e[_0x145e('0x6a')];_0x427397['push']('\x22'+_0x23c649+'\x22');_0x427397[_0x145e('0x1d')]('\x22'+_0x18a6ac+'\x22');}break;default:_0x427397[_0x145e('0x1d')]('\x22'+_0x23c649+'\x22');}}else{switch(_0x24cc73){case _0x145e('0x8b'):case'phone':_0x1ece03[_0x145e('0x1d')](_0x24cc73+_0x145e('0x8c'));break;default:_0x427397[_0x145e('0x1d')]('\x22\x22');}}}}else{var _0x5a818d='';if(!_[_0x145e('0x7e')](_0x106e7a)){if(!_0x57ce30[_0x145e('0x7f')](_0x106e7a['id'])){if(!_[_0x145e('0x7e')](_0x3ee3c5[_0x145e('0x7b')][_0x54b600][_0x54869c[_0x24cc73]])){var _0x23c649=_[_0x145e('0x8d')](_0x3ee3c5['data'][_0x54b600][_0x54869c[_0x24cc73]][_0x145e('0x80')](/"/g,'\x27'));var _0x3882cb=phoneDescriptions[_0x145e('0x7d')](_0x543697=>_0x543697[_0x145e('0x8e')]===_0x106e7a['id']);if(!_[_0x145e('0x7e')](_0x3882cb)){var _0x4c83ca=_[_0x145e('0x8d')](_0x3ee3c5[_0x145e('0x7b')][_0x54b600][_0x54869c[_0x3882cb[_0x145e('0x8f')]]][_0x145e('0x80')](/"/g,'\x27'));if(!_[_0x145e('0x7e')](_0x4c83ca))_0x23c649=_0x23c649+'§'+_0x4c83ca;}if(_0x5a818d=='')_0x5a818d=_0x23c649;else _0x5a818d+='|'+_0x23c649;}_0x12630f[_0x145e('0x1d')](_0x106e7a['id']+':'+_0x5a818d);_0x57ce30[_0x106e7a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x427397[_0x145e('0x1d')]('\x22'+_0x12630f[_0x145e('0x14')](';')+'\x22');}if(_0x1ece03[_0x145e('0x1c')]){handleError(_0x3ee3c5[_0x145e('0x7b')][_0x54b600],{'code':'SystemRow','message':_0x1ece03[_0x145e('0x14')]()});}else{fs[_0x145e('0x90')](_0x42f50f,_0x427397['join']()+'\x0a');}_0x427397=[];}if(!(stats[_0x145e('0x7a')]%0xc8)){socket['emit'](_0x145e('0x91')+_0x3a599c,stats);stats[_0x145e('0x7c')]=[];}}if(stopped){logger[_0x145e('0x57')](_0x145e('0x92'));_0x40b8e8[_0x145e('0x93')]();}}catch(_0x1dd9c0){handleError(_0x3ee3c5[_0x145e('0x7b')][_0x54b600],{'code':_0x145e('0x94'),'message':_0x1dd9c0[_0x145e('0x59')]});logger[_0x145e('0x58')](_0x145e('0x95'),_0x1dd9c0['message']);}},'complete':function(){try{var _0x6ff610=[];var _0x345cda=[];var _0x158be5='cm_contacts';if(_0x32b3d4['duplicates']&&_0x32b3d4[_0x145e('0x96')][_0x145e('0x1c')]){_0x158be5=_0x145e('0x97')+_0x3a599c;_0x6ff610[_0x145e('0x1d')](_0x145e('0x98')+_0x158be5+_0x145e('0x99'));}tmp_campaigns=_0x145e('0x9a')+_0x3a599c;tmp_voice_queues='voice_queues_'+_0x3a599c;_0x345cda[_0x145e('0x1d')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x345cda[_0x145e('0x1d')](_0x145e('0x98')+tmp_voice_queues+_0x145e('0x9b'));BPromise[_0x145e('0x9c')](_0x345cda,handleTZQuery)[_0x145e('0x1b')](function(_0x436c6e){updateTzCampaigns(_0x32b3d4[_0x145e('0x30')])[_0x145e('0x1b')](function(_0x69d8bd){updateTzVoiceQueues(_0x32b3d4[_0x145e('0x30')])[_0x145e('0x1b')](function(_0x521f76){if(hasTZ)_0x555735=_0x555735['replace'](_0x145e('0x6d'),_0x145e('0x9d'));var _0x46bd1e=util['format'](_0x145e('0x9e'),_0x42f50f,_0x158be5,_0x555735,_0x32b3d4[_0x145e('0x30')],_0x32b3d4['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x54869c[_0x145e('0x2e')])){_0x46bd1e+=',\x20scheduledAt\x20=\x20NOW()';}_0x6ff610[_0x145e('0x1d')](_0x46bd1e);if(_0x32b3d4[_0x145e('0x96')]&&_0x32b3d4[_0x145e('0x96')]['length']){_0x6ff610[_0x145e('0x1d')](insertCmContact(_0x32b3d4[_0x145e('0x30')],_0x158be5,_0x32b3d4['duplicates'],_0x54869c));_0x6ff610[_0x145e('0x1d')](_0x145e('0x9f')+_0x158be5+';');}BPromise['each'](_0x6ff610,handleQuery)['then'](function(_0xd5f216){BPromise[_0x145e('0x1f')]([handleAdditionalPhones()])[_0x145e('0x1b')](function(){_0x6ff610=[];for(var _0x2f86b3=0x0;_0x2f86b3\x20\x20');}var _0x1f2de0=path[_0x145e('0x14')](config['root'],_0x145e('0x73'),process['argv'][0x2]);if(!fs[_0x145e('0xaa')](_0x1f2de0)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x4f64ff={};try{_0x4f64ff=JSON['parse'](process[_0x145e('0xa9')][0x3]);if(!_0x4f64ff['binding']){throw new Error(_0x145e('0xab'));}if(!_0x4f64ff[_0x145e('0x70')][_0x145e('0x12')]){throw new Error(_0x145e('0xac'));}if(!_0x4f64ff['binding'][_0x145e('0x8b')]){throw new Error('firstName\x20is\x20mandatory');}var _0x4242c6=0x0;if(_0x4f64ff[_0x145e('0x70')]['UserId']){_0x4242c6=0x1;}if(!_0x4f64ff[_0x145e('0x30')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x50f33a){throw new Error('body\x20id\x20mandatory');}var _0x5da6fc=[];try{_0x5da6fc=_[_0x145e('0xad')](JSON['parse'](process[_0x145e('0xa9')][0x4]),'id');}catch(_0x545f76){logger['info']('No\x20agent\x20available');}main(_0x1f2de0,_0x4f64ff,_0x5da6fc,_0x4242c6);}validate();process['on'](_0x145e('0xae'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 3441ba7..aea6c2d 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb58=['writeFileSync','createReadStream','rows','find','data','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','trim','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','query','select\x20*\x20from\x20','spread','length','isNil','phone','push','all','then','catch','error','message','split','CmContactHasItem','findOne','create','PHONE','CmContact','update','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','ContactId','ListId','updatedAt','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_hopper_black','createdAt','cm_contacts','cm_contacts.createdAt\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','CompanyId','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','exit','errors','code','sequelize','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','name','_description','keys','header'];(function(_0x542b18,_0x3ad953){var _0x218de3=function(_0xbb1c99){while(--_0xbb1c99){_0x542b18['push'](_0x542b18['shift']());}};_0x218de3(++_0x3ad953);}(_0xbb58,0x17b));var _0x8bb5=function(_0x79bab3,_0x2f38a6){_0x79bab3=_0x79bab3-0x0;var _0x5b86a8=_0xbb58[_0x79bab3];return _0x5b86a8;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x8bb5('0x0'));var Papa=require(_0x8bb5('0x1'));var util=require(_0x8bb5('0x2'));var BPromise=require(_0x8bb5('0x3'));var moment=require(_0x8bb5('0x4'));var squel=require('squel');var Redis=require(_0x8bb5('0x5'));var db=require(_0x8bb5('0x6'))['db'];var config=require(_0x8bb5('0x7'));var logger=require(_0x8bb5('0x8'))(_0x8bb5('0x9'));config['redis']=_['defaults'](config[_0x8bb5('0xa')],{'host':_0x8bb5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8bb5('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()[_0x8bb5('0xc')](_0x8bb5('0xd'));var tempTableName=_0x8bb5('0xe')+moment()[_0x8bb5('0xc')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x46cf73){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))*$/[_0x8bb5('0xf')](_0x46cf73);}function selectNotIn(_0x49fae9,_0x411b78,_0x1db8db,_0x39f734,_0x50d818){return squel[_0x8bb5('0x10')]()[_0x8bb5('0x11')]('phone')[_0x8bb5('0x12')](_0x39f734)[_0x8bb5('0x13')](_0x411b78,null,_0x411b78+_0x8bb5('0x14')+_0x39f734+'.'+_0x1db8db)[_0x8bb5('0x15')](_0x39f734+'.'+_0x1db8db+_0x8bb5('0x16')+_0x49fae9+'.'+_0x1db8db)[_0x8bb5('0x15')](_0x411b78+'.dialCheckDuplicateType\x20IN\x20('+_0x50d818['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3c2fde,_0x129ced){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x8bb5('0x17')](_0x8bb5('0x18')+tempTableName)[_0x8bb5('0x19')](function(_0x3960fd){if(_0x3960fd!==null){var _0x2fb420=[];for(var _0x51bf7b=0x0;_0x51bf7b<_0x3960fd[_0x8bb5('0x1a')];_0x51bf7b++){var _0x472d30=_0x3960fd[_0x51bf7b];if(!_[_0x8bb5('0x1b')](_0x472d30[_0x8bb5('0x1c')])){if(!_[_0x8bb5('0x1b')](_0x472d30['AdditionalPhones']))_0x2fb420[_0x8bb5('0x1d')](insertAdditionalPhones(_0x472d30));promisesContact[_0x8bb5('0x1d')]({'contact':_0x472d30});}}}Promise[_0x8bb5('0x1e')](_0x2fb420)[_0x8bb5('0x1f')](function(){_0x3c2fde({'val':0x1});});})[_0x8bb5('0x20')](function(_0x5b98ef){logger[_0x8bb5('0x21')](_0x5b98ef[_0x8bb5('0x22')]);});});}function insertAdditionalPhones(_0x1b1bef){return new Promise(function(_0x3dc753,_0x10e23c){var _0x1503b8=_0x1b1bef['AdditionalPhones'];if(_['isNil'](_0x1503b8))_0x10e23c({'val':0x0});else{var _0x5df20d=_0x1503b8[_0x8bb5('0x23')](';');var _0x389018=[];orderBy=0x0;for(var _0x541afa=0x0;_0x541afa<_0x5df20d['length'];_0x541afa++){_0x389018[_0x8bb5('0x1d')](splitAdditionalPhone(_0x1b1bef['id'],_0x5df20d[_0x541afa]));}Promise[_0x8bb5('0x1e')](_0x389018)['then'](function(){_0x3dc753({'val':_0x5df20d[_0x8bb5('0x1a')]});});}});}function splitAdditionalPhone(_0xb29f16,_0x56e4d3){return new Promise(function(_0x170b8a,_0x3c5f01){var _0x2a3339=_0x56e4d3[_0x8bb5('0x23')](':');var _0x2cc575=_0x2a3339[0x0];var _0x14e762=_0x2a3339[0x1];if(_0x14e762!==''){var _0x4c514e=_0x14e762[_0x8bb5('0x23')]('|');var _0x2f5eda=[];for(var _0x53bb4e=0x0;_0x53bb4e<_0x4c514e[_0x8bb5('0x1a')];_0x53bb4e++){if(_0x4c514e[_0x53bb4e]!==''){var _0xfc438c=_['filter'](promisesAdditionalPhones,{'contactId':_0xb29f16,'phone':_0x4c514e[_0x53bb4e]});if(_0xfc438c[_0x8bb5('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x8bb5('0x1d')]({'contactId':_0xb29f16,'contactTypeId':_0x2cc575,'phone':_0x4c514e[_0x53bb4e],'orderBy':orderBy});}}}_0x170b8a({'ok':0x1});}else _0x170b8a({'res':0x0});});}function createAdditionalPhone(_0x35106a,_0x40f31a,_0x40a628,_0x33115a){var _0x205aa0='';var _0x179f27='';var _0x4be499=_0x40a628[_0x8bb5('0x23')]('§');_0x205aa0=_0x4be499[0x0];if(_0x4be499['length']==0x2)_0x179f27=_0x4be499[0x1];return new Promise(function(_0x3cd789,_0x1f8e39){return db[_0x8bb5('0x24')][_0x8bb5('0x25')]({'where':{'CmContactId':_0x35106a,'item':_0x205aa0}})['then'](function(_0x4d21f1){if(_0x4d21f1){return db[_0x8bb5('0x24')]['update']({'ItemTypeId':_0x40f31a,'description':_0x179f27,'OrderBy':_0x33115a},{'where':{'CmContactId':_0x35106a,'item':_0x205aa0}})[_0x8bb5('0x1f')](function(_0x501d24){_0x3cd789({'res':'updated'});});}else{return db[_0x8bb5('0x24')][_0x8bb5('0x26')]({'CmContactId':_0x35106a,'item':_0x205aa0,'ItemTypeId':_0x40f31a,'description':_0x179f27,'OrderBy':_0x33115a,'ItemClass':_0x8bb5('0x27')})['then'](function(_0x175526){_0x3cd789({'res':'inserted'});});}});});}function updateContact(_0x5c6073){return new Promise(function(_0x40ca0d,_0x2b5717){var _0x257023=_0x5c6073['id'];delete _0x5c6073['id'];return db[_0x8bb5('0x28')][_0x8bb5('0x29')](_0x5c6073,{'where':{'id':_0x257023}})[_0x8bb5('0x1f')](function(_0x1f740e){updatedRows+=0x1;return db[_0x8bb5('0x2a')]['update']({'phone':_0x5c6073[_0x8bb5('0x1c')]},{'where':{'ContactId':_0x257023}})[_0x8bb5('0x1f')](function(_0x557a31){_0x40ca0d({'ret':'OK'});});});});}function insertCmHopper(_0xda25d8,_0x223f9f,_0x49c946,_0x431cd8,_0x2cae68){var _0x2216ac=[_0x8bb5('0x2b'),_0x8bb5('0x2c'),'cm_contacts.id',_0x8bb5('0x2d'),_0x223f9f+'.'+_0x431cd8,_0x8bb5('0x2e'),_0x8bb5('0x2f'),_0x8bb5('0x30'),_0x8bb5('0x31'),'\x22'+_0x2cae68+'\x22'];return squel[_0x8bb5('0x32')]()[_0x8bb5('0x33')]('cm_hopper')[_0x8bb5('0x34')]([_0x8bb5('0x1c'),'scheduledat',_0x8bb5('0x35'),_0x8bb5('0x36'),_0x431cd8,'createdAt',_0x8bb5('0x37'),'priority','UserId',_0x8bb5('0x38')],squel['select']()[_0x8bb5('0x39')](_0x2216ac)[_0x8bb5('0x12')](_0x223f9f)[_0x8bb5('0x13')]('cm_contacts',null,_0x8bb5('0x3a')+_0x223f9f+_0x8bb5('0x3b'))[_0x8bb5('0x13')](_0x49c946,null,_0x49c946+'.id\x20=\x20'+_0x223f9f+'.'+_0x431cd8)[_0x8bb5('0x15')](_0x223f9f+_0x8bb5('0x3c'),_0xda25d8)[_0x8bb5('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8bb5('0x15')](_0x8bb5('0x3d'),selectNotIn(_0x223f9f,_0x49c946,_0x431cd8,_0x8bb5('0x3e'),[_0x8bb5('0x3f'),_0x8bb5('0x40')]))[_0x8bb5('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x223f9f,_0x49c946,_0x431cd8,_0x8bb5('0x3e'),[_0x8bb5('0x3f')])))[_0x8bb5('0x41')]();}function insertCmHopperBlack(_0x31d93c,_0x47f9c0,_0x1c700e,_0x400a6a){var _0x1eb40b=[_0x8bb5('0x2b'),_0x8bb5('0x42'),_0x8bb5('0x2d'),_0x47f9c0+'.'+_0x400a6a,_0x8bb5('0x2e'),_0x8bb5('0x2f')];return squel[_0x8bb5('0x32')]()[_0x8bb5('0x33')](_0x8bb5('0x43'))[_0x8bb5('0x34')]([_0x8bb5('0x1c'),_0x8bb5('0x35'),'ListId',_0x400a6a,_0x8bb5('0x44'),'updatedAt'],squel[_0x8bb5('0x10')]()[_0x8bb5('0x39')](_0x1eb40b)[_0x8bb5('0x12')](_0x47f9c0)[_0x8bb5('0x13')](_0x8bb5('0x45'),null,_0x8bb5('0x3a')+_0x47f9c0+_0x8bb5('0x3b'))[_0x8bb5('0x13')](_0x1c700e,null,_0x1c700e+_0x8bb5('0x14')+_0x47f9c0+'.'+_0x400a6a)[_0x8bb5('0x15')](_0x47f9c0+_0x8bb5('0x3c'),_0x31d93c)['where'](_0x8bb5('0x46'),NOW)['where'](_0x8bb5('0x3d'),squel[_0x8bb5('0x10')]()[_0x8bb5('0x11')]('phone')['from'](_0x8bb5('0x43'))[_0x8bb5('0x15')]('ListId\x20=\x20?',_0x31d93c)[_0x8bb5('0x15')](_0x400a6a+'\x20=\x20?',_0x47f9c0+'.'+_0x400a6a)))[_0x8bb5('0x41')]();}function insertCmHopperAdditionalPhones(_0x4cd8a1){var _0x325b7d=[_0x8bb5('0x47'),_0x8bb5('0x48'),_0x8bb5('0x49'),'cm_contact_has_items.createdAt',_0x8bb5('0x4a')];return squel[_0x8bb5('0x32')]()[_0x8bb5('0x33')](_0x8bb5('0x4b'))['fromQuery'](['CmHopperId',_0x8bb5('0x1c'),_0x8bb5('0x4c'),_0x8bb5('0x44'),'updatedAt'],squel[_0x8bb5('0x10')]()[_0x8bb5('0x39')](_0x325b7d)[_0x8bb5('0x12')](_0x8bb5('0x3e'))[_0x8bb5('0x13')](_0x8bb5('0x45'),null,_0x8bb5('0x4d'))[_0x8bb5('0x13')](_0x8bb5('0x4e'),null,_0x8bb5('0x4f'))[_0x8bb5('0x15')]('cm_hopper.ListId\x20=\x20?',_0x4cd8a1)[_0x8bb5('0x15')](_0x8bb5('0x46'),NOW))[_0x8bb5('0x41')]();}function insertCmContact(_0x400973,_0x50a29c,_0x4b6964,_0xe00c76){var _0x39d8da=_['concat'](_['keys'](_0xe00c76),[_0x8bb5('0x36'),_0x8bb5('0x50'),_0x8bb5('0x44'),_0x8bb5('0x37')]);return squel[_0x8bb5('0x32')]()[_0x8bb5('0x33')](_0x8bb5('0x45'))['fromQuery'](_0x39d8da,squel['select']()[_0x8bb5('0x39')](_0x39d8da)['from'](_0x50a29c)[_0x8bb5('0x15')]('('+_0x4b6964['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x8bb5('0x10')]()[_0x8bb5('0x39')](_0x4b6964)['from'](_0x8bb5('0x45'))[_0x8bb5('0x15')]('ListId\x20=\x20?',_0x400973))['where'](_0x8bb5('0x51'),squel['select']()[_0x8bb5('0x11')]('MIN(id)',_0x8bb5('0x52'))['from'](_0x50a29c)[_0x8bb5('0x53')](_0x4b6964[_0x8bb5('0x13')](','))))[_0x8bb5('0x41')]();}function handleStop(){logger[_0x8bb5('0x54')](_0x8bb5('0x55'));stopped=!![];}function handleUncaughtException(_0x9376b){logger[_0x8bb5('0x21')](_0x9376b[_0x8bb5('0x22')]);process[_0x8bb5('0x56')](0x1);}function handleError(_0x276bad,_0x3d7145){stats[_0x8bb5('0x57')]['push']({'name':_0x3d7145[_0x8bb5('0x58')],'message':_0x3d7145[_0x8bb5('0x22')],'row':_0x276bad});}function handleQuery(_0x5a6ce8){logger[_0x8bb5('0x54')](_0x5a6ce8);return db[_0x8bb5('0x59')][_0x8bb5('0x17')](_0x5a6ce8)[_0x8bb5('0x19')](function(_0x309a91){results[_0x8bb5('0x1d')](_0x309a91);})[_0x8bb5('0x20')](function(_0x33aaba){logger[_0x8bb5('0x21')](_0x33aaba['message']);});}function main(_0x16ae7f,_0x366740,_0x66dd38,_0x269736){logger[_0x8bb5('0x54')](_0x8bb5('0x5a'),_0x16ae7f,JSON[_0x8bb5('0x5b')](_0x366740));process[_0x8bb5('0x5c')]('start');var _0x4688bb=_0x366740[_0x8bb5('0x5d')];var _0x4dcf3e=_['clone'](_0x4688bb);var _0xd666e5=_0x366740[_0x8bb5('0x5e')];var _0x1c8211=path['join'](config[_0x8bb5('0x5f')],_0x8bb5('0x60'),_0xd666e5+_0x8bb5('0x61'));logger[_0x8bb5('0x54')](_0x8bb5('0x62'),_0x366740);db[_0x8bb5('0x63')]['findAll']({'raw':!![],'attributes':['id',_0x8bb5('0x64')]})['then'](function(_0x3fb76d){for(var _0x31d74b=0x0;_0x31d74b<_0x3fb76d[_0x8bb5('0x1a')];_0x31d74b++){if(_0x3fb76d[_0x31d74b][_0x8bb5('0x64')]in _0x4688bb){contactItemTypes[_0x8bb5('0x1d')](_0x3fb76d[_0x31d74b]);delete _0x4dcf3e[_0x3fb76d[_0x31d74b][_0x8bb5('0x64')]];hasAdditionalPhones=!![];}for(var _0x55baea in _0x4688bb){if(_0x3fb76d[_0x31d74b]['name']+_0x8bb5('0x65')===_0x55baea){phoneDescriptions[_0x8bb5('0x1d')]({'itemTypeId':_0x3fb76d[_0x31d74b]['id'],'description':_0x55baea});delete _0x4dcf3e[_0x55baea];}}}if(hasAdditionalPhones)_0x4dcf3e['AdditionalPhones']='';var _0x3adc88=_[_0x8bb5('0x66')](_0x4dcf3e)[_0x8bb5('0x13')]();logger[_0x8bb5('0x54')](_0x8bb5('0x67'),_0x3adc88);fs[_0x8bb5('0x68')](_0x1c8211,_0x3adc88+'\x0a');Papa['parse'](fs[_0x8bb5('0x69')](_0x16ae7f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x58b613,_0x5cd7fd){try{for(var _0x15e055=0x0,_0x1d6350=[];_0x15e055<_0x58b613['data']['length'];_0x15e055++){stats[_0x8bb5('0x6a')]+=0x1;if(_0x58b613[_0x8bb5('0x57')][_0x15e055]){handleError(_0x58b613['data'][_0x15e055],_0x58b613['errors'][_0x15e055]);}else{var _0x286d50=[];var _0x2515b5=[];var _0x1abbb0={};for(var _0x280548 in _0x4688bb){let _0x20aca0=contactItemTypes[_0x8bb5('0x6b')](_0x4255da=>_0x4255da[_0x8bb5('0x64')]===_0x280548);let _0x74001d=contactItemTypes[_0x8bb5('0x6b')](_0x2f1f6b=>_0x2f1f6b[_0x8bb5('0x64')]+_0x8bb5('0x65')===_0x280548);if(_['isNil'](_0x20aca0)&&_[_0x8bb5('0x1b')](_0x74001d)){if(_0x4688bb['hasOwnProperty'](_0x280548)){if(_0x58b613[_0x8bb5('0x6c')][_0x15e055][_0x4688bb[_0x280548]]){var _0x1b64a2=_['trim'](_0x58b613[_0x8bb5('0x6c')][_0x15e055][_0x4688bb[_0x280548]][_0x8bb5('0x6d')](/"/g,'\x27'));switch(_0x280548){case _0x8bb5('0x6e'):var _0x2c786b=moment(_0x1b64a2,_0x8bb5('0xd'),!![]);if(_0x2c786b[_0x8bb5('0x6f')]()){_0x1d6350['push']('\x22'+_0x1b64a2+'\x22');}else{_0x286d50[_0x8bb5('0x1d')](_0x8bb5('0x70'));}break;case _0x8bb5('0x71'):var _0x48daf3=parseInt(_0x1b64a2);_0x1b64a2=_[_0x8bb5('0x72')](_0x48daf3)||_0x48daf3<0x0||_0x48daf3>0x4?_0x269736?0x3:0x2:_0x48daf3;_0x1d6350[_0x8bb5('0x1d')]('\x22'+_0x1b64a2+'\x22');break;case _0x8bb5('0x73'):var _0x58dac9=parseInt(_0x1b64a2);if(_[_0x8bb5('0x74')](_0x58dac9)&&_[_0x8bb5('0x75')](_0x66dd38,_0x58dac9)){_0x1d6350[_0x8bb5('0x1d')]('\x22'+_0x58dac9+'\x22');}else{_0x286d50['push'](_0x8bb5('0x76'));}break;case _0x8bb5('0x77'):if(isEmail(_0x1b64a2)){_0x1d6350[_0x8bb5('0x1d')]('\x22'+_0x1b64a2+'\x22');}else{_0x286d50[_0x8bb5('0x1d')](_0x8bb5('0x78'));}break;case _0x8bb5('0x79'):var _0x2a9a14=moment(_0x1b64a2,'YYYY-MM-DD',!![]);if(_0x2a9a14['isValid']()){_0x1d6350[_0x8bb5('0x1d')]('\x22'+_0x1b64a2+'\x22');}else{_0x286d50['push'](_0x8bb5('0x7a'));}break;default:_0x1d6350[_0x8bb5('0x1d')]('\x22'+_0x1b64a2+'\x22');}}else{switch(_0x280548){case _0x8bb5('0x7b'):case _0x8bb5('0x1c'):_0x286d50['push'](_0x280548+_0x8bb5('0x7c'));break;default:_0x1d6350['push']('\x22\x22');}}}}else{var _0x3ef358='';if(!_['isNil'](_0x20aca0)){if(!_0x1abbb0[_0x8bb5('0x7d')](_0x20aca0['id'])){for(var _0x408bb5=0x0;_0x408bb5<_0x4688bb[_0x280548][_0x8bb5('0x1a')];_0x408bb5++){var _0x1b64a2=_[_0x8bb5('0x7e')](_0x58b613['data'][_0x15e055][_0x4688bb[_0x280548][_0x408bb5]][_0x8bb5('0x6d')](/"/g,'\x27'));var _0x29cc44=phoneDescriptions['find'](_0x23e1f1=>_0x23e1f1['itemTypeId']===_0x20aca0['id']);if(!_['isNil'](_0x29cc44)){var _0x40d710=_[_0x8bb5('0x7e')](_0x58b613['data'][_0x15e055][_0x4688bb[_0x29cc44[_0x8bb5('0x7f')]][0x0]][_0x8bb5('0x6d')](/"/g,'\x27'));if(!_[_0x8bb5('0x1b')](_0x40d710))_0x1b64a2=_0x1b64a2+'§'+_0x40d710;}if(_0x3ef358=='')_0x3ef358=_0x1b64a2;else _0x3ef358+='|'+_0x1b64a2;}_0x2515b5['push'](_0x20aca0['id']+':'+_0x3ef358);_0x1abbb0[_0x20aca0['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1d6350[_0x8bb5('0x1d')]('\x22'+_0x2515b5[_0x8bb5('0x13')](';')+'\x22');}if(_0x286d50[_0x8bb5('0x1a')]){handleError(_0x58b613[_0x8bb5('0x6c')][_0x15e055],{'code':_0x8bb5('0x80'),'message':_0x286d50[_0x8bb5('0x13')]()});}else{fs[_0x8bb5('0x81')](_0x1c8211,_0x1d6350[_0x8bb5('0x13')]()+'\x0a');}_0x1d6350=[];}if(!(stats[_0x8bb5('0x6a')]%0xc8)){socket[_0x8bb5('0x82')](_0x8bb5('0x83')+_0xd666e5,stats);stats[_0x8bb5('0x57')]=[];}}if(stopped){logger[_0x8bb5('0x54')]('Abort\x20parser');_0x5cd7fd[_0x8bb5('0x84')]();}}catch(_0x275e48){handleError(_0x58b613['data'][_0x15e055],{'code':_0x8bb5('0x85'),'message':_0x275e48[_0x8bb5('0x22')]});logger[_0x8bb5('0x21')](_0x8bb5('0x86'),_0x275e48[_0x8bb5('0x22')]);}},'complete':function(){try{var _0x3cd299=[];var _0xdf15a=tempTableName;_0x3cd299[_0x8bb5('0x1d')](_0x8bb5('0x87')+_0xdf15a+_0x8bb5('0x88'));logger[_0x8bb5('0x54')](_0x8bb5('0x89'),contactItemTypes[_0x8bb5('0x1a')]);var _0x308d25=util['format'](_0x8bb5('0x8a'),_0x1c8211,_0xdf15a,_0x3adc88,_0x366740['ListId'],_0x366740[_0x8bb5('0x50')]||null,NOW,NOW);if(_[_0x8bb5('0x1b')](_0x4688bb['scheduledat'])){_0x308d25+=_0x8bb5('0x8b');}_0x3cd299[_0x8bb5('0x1d')](_0x308d25);BPromise[_0x8bb5('0x8c')](_0x3cd299,handleQuery)['then'](function(_0x23e5c3){BPromise[_0x8bb5('0x1e')]([handleAdditionalPhones()])[_0x8bb5('0x1f')](function(){_0x3cd299=[];for(var _0x477c97=0x0;_0x477c97\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger'];(function(_0x284e85,_0x1bfec9){var _0x59ba3d=function(_0x559559){while(--_0x559559){_0x284e85['push'](_0x284e85['shift']());}};_0x59ba3d(++_0x1bfec9);}(_0x8a5c,0x136));var _0xc8a5=function(_0x363a1e,_0x282481){_0x363a1e=_0x363a1e-0x0;var _0x58fa03=_0x8a5c[_0x363a1e];return _0x58fa03;};'use strict';var fs=require('fs');var path=require(_0xc8a5('0x0'));var _=require(_0xc8a5('0x1'));var Papa=require(_0xc8a5('0x2'));var util=require(_0xc8a5('0x3'));var BPromise=require(_0xc8a5('0x4'));var moment=require(_0xc8a5('0x5'));var squel=require(_0xc8a5('0x6'));var Redis=require(_0xc8a5('0x7'));var db=require(_0xc8a5('0x8'))['db'];var config=require('../../../config/environment');var logger=require(_0xc8a5('0x9'))(_0xc8a5('0xa'));config['redis']=_[_0xc8a5('0xb')](config[_0xc8a5('0xc')],{'host':_0xc8a5('0xd'),'port':0x18eb});var socket=require(_0xc8a5('0xe'))(new Redis(config['redis']));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()[_0xc8a5('0xf')](_0xc8a5('0x10'));var tempTableName=_0xc8a5('0x11')+moment()[_0xc8a5('0xf')](_0xc8a5('0x12'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x3b2ba3){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))*$/[_0xc8a5('0x13')](_0x3b2ba3);}function selectNotIn(_0x16fd9a,_0xea6d98,_0x533509,_0x566833,_0x15d9a0){return squel['select']()[_0xc8a5('0x14')](_0xc8a5('0x15'))[_0xc8a5('0x16')](_0x566833)[_0xc8a5('0x17')](_0xea6d98,null,_0xea6d98+_0xc8a5('0x18')+_0x566833+'.'+_0x533509)['where'](_0x566833+'.'+_0x533509+_0xc8a5('0x19')+_0x16fd9a+'.'+_0x533509)[_0xc8a5('0x1a')](_0xea6d98+'.dialCheckDuplicateType\x20IN\x20('+_0x15d9a0[_0xc8a5('0x17')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x33062b,_0x197ea9){promisesAdditionalPhones=[];promisesContact=[];return db[_0xc8a5('0x1b')][_0xc8a5('0x1c')](_0xc8a5('0x1d')+tempTableName)['spread'](function(_0xbc4806){if(_0xbc4806!==null){var _0x44d436=[];for(var _0x5cb7ff=0x0;_0x5cb7ff<_0xbc4806[_0xc8a5('0x1e')];_0x5cb7ff++){var _0x44179e=_0xbc4806[_0x5cb7ff];if(!_['isNil'](_0x44179e[_0xc8a5('0x15')])){if(!_[_0xc8a5('0x1f')](_0x44179e[_0xc8a5('0x20')]))_0x44d436[_0xc8a5('0x21')](insertAdditionalPhones(_0x44179e));promisesContact[_0xc8a5('0x21')]({'contact':_0x44179e});}}}Promise['all'](_0x44d436)[_0xc8a5('0x22')](function(){_0x33062b({'val':0x1});});})['catch'](function(_0xb4e8ae){logger[_0xc8a5('0x23')](_0xb4e8ae['message']);});});}function insertAdditionalPhones(_0x4c7c8a){return new Promise(function(_0x866737,_0x388c4e){var _0x1322da=_0x4c7c8a[_0xc8a5('0x20')];if(_[_0xc8a5('0x1f')](_0x1322da))_0x388c4e({'val':0x0});else{var _0x5411a7=_0x1322da['split'](';');var _0x3e2058=[];orderBy=0x0;for(var _0x3c7fe9=0x0;_0x3c7fe9<_0x5411a7[_0xc8a5('0x1e')];_0x3c7fe9++){_0x3e2058[_0xc8a5('0x21')](splitAdditionalPhone(_0x4c7c8a['id'],_0x5411a7[_0x3c7fe9]));}Promise[_0xc8a5('0x24')](_0x3e2058)[_0xc8a5('0x22')](function(){_0x866737({'val':_0x5411a7['length']});});}});}function splitAdditionalPhone(_0x1b3870,_0x3beb20){return new Promise(function(_0x266c59,_0x1e522c){var _0x276e3c=_0x3beb20[_0xc8a5('0x25')](':');var _0x3b325d=_0x276e3c[0x0];var _0x3bbbdc=_0x276e3c[0x1];if(_0x3bbbdc!==''){var _0x1ac715=_0x3bbbdc['split']('|');var _0x11e162=[];for(var _0x58576e=0x0;_0x58576e<_0x1ac715[_0xc8a5('0x1e')];_0x58576e++){if(_0x1ac715[_0x58576e]!==''){var _0x3539fd=_[_0xc8a5('0x26')](promisesAdditionalPhones,{'contactId':_0x1b3870,'phone':_0x1ac715[_0x58576e]});if(_0x3539fd[_0xc8a5('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0xc8a5('0x21')]({'contactId':_0x1b3870,'contactTypeId':_0x3b325d,'phone':_0x1ac715[_0x58576e],'orderBy':orderBy});}}}_0x266c59({'ok':0x1});}else _0x266c59({'res':0x0});});}function createAdditionalPhone(_0x483011,_0x4aa944,_0x9886,_0x4e0a4b){var _0x4ef3d7='';var _0x1d1513='';var _0x10972d=_0x9886[_0xc8a5('0x25')]('§');_0x4ef3d7=_0x10972d[0x0];if(_0x10972d[_0xc8a5('0x1e')]==0x2)_0x1d1513=_0x10972d[0x1];return new Promise(function(_0x16fa00,_0x31c416){return db['CmContactHasItem'][_0xc8a5('0x27')]({'where':{'CmContactId':_0x483011,'item':_0x4ef3d7}})[_0xc8a5('0x22')](function(_0x1c713f){if(_0x1c713f){return db[_0xc8a5('0x28')][_0xc8a5('0x29')]({'ItemTypeId':_0x4aa944,'description':_0x1d1513,'OrderBy':_0x4e0a4b},{'where':{'CmContactId':_0x483011,'item':_0x4ef3d7}})[_0xc8a5('0x22')](function(_0x4b47dc){_0x16fa00({'res':_0xc8a5('0x2a')});});}else{return db[_0xc8a5('0x28')][_0xc8a5('0x2b')]({'CmContactId':_0x483011,'item':_0x4ef3d7,'ItemTypeId':_0x4aa944,'description':_0x1d1513,'OrderBy':_0x4e0a4b,'ItemClass':_0xc8a5('0x2c')})['then'](function(_0x4d159f){_0x16fa00({'res':_0xc8a5('0x2d')});});}});});}function updateContact(_0x141fee){return new Promise(function(_0xe0efee,_0x127ea2){var _0x3824bf=_0x141fee['id'];delete _0x141fee['id'];return db['CmContact'][_0xc8a5('0x29')](_0x141fee,{'where':{'id':_0x3824bf}})['then'](function(_0x1c016c){updatedRows+=0x1;return db[_0xc8a5('0x2e')][_0xc8a5('0x29')]({'phone':_0x141fee['phone']},{'where':{'ContactId':_0x3824bf}})[_0xc8a5('0x22')](function(_0x290a9a){_0xe0efee({'ret':'OK'});});});});}function insertCmHopper(_0x3c4eb7,_0x575e39,_0xe5ec,_0x30f316,_0x5b6a8a){var _0x3424b2=['cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x575e39+'.'+_0x30f316,'cm_contacts.createdAt',_0xc8a5('0x2f'),'cm_contacts.priority',_0xc8a5('0x30'),'\x22'+_0x5b6a8a+'\x22'];return squel[_0xc8a5('0x31')]()[_0xc8a5('0x32')](_0xc8a5('0x33'))[_0xc8a5('0x34')]([_0xc8a5('0x15'),_0xc8a5('0x35'),'ContactId',_0xc8a5('0x36'),_0x30f316,_0xc8a5('0x37'),'updatedAt',_0xc8a5('0x38'),'UserId','recallme'],squel[_0xc8a5('0x39')]()[_0xc8a5('0x3a')](_0x3424b2)[_0xc8a5('0x16')](_0x575e39)['join']('cm_contacts',null,_0xc8a5('0x3b')+_0x575e39+_0xc8a5('0x3c'))[_0xc8a5('0x17')](_0xe5ec,null,_0xe5ec+_0xc8a5('0x18')+_0x575e39+'.'+_0x30f316)['where'](_0x575e39+_0xc8a5('0x3d'),_0x3c4eb7)[_0xc8a5('0x1a')](_0xc8a5('0x3e'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x575e39,_0xe5ec,_0x30f316,_0xc8a5('0x33'),[_0xc8a5('0x3f'),_0xc8a5('0x40')]))[_0xc8a5('0x1a')](_0xc8a5('0x41'),selectNotIn(_0x575e39,_0xe5ec,_0x30f316,'cm_hopper',[_0xc8a5('0x3f')])))['toString']();}function insertCmHopperBlack(_0x4b57f5,_0x4e5fb2,_0xda7b11,_0x3a5f8f){var _0x21aa6a=[_0xc8a5('0x42'),_0xc8a5('0x43'),_0xc8a5('0x44'),_0x4e5fb2+'.'+_0x3a5f8f,_0xc8a5('0x45'),_0xc8a5('0x2f')];return squel[_0xc8a5('0x31')]()[_0xc8a5('0x32')](_0xc8a5('0x46'))[_0xc8a5('0x34')]([_0xc8a5('0x15'),_0xc8a5('0x47'),'ListId',_0x3a5f8f,_0xc8a5('0x37'),_0xc8a5('0x48')],squel[_0xc8a5('0x39')]()[_0xc8a5('0x3a')](_0x21aa6a)[_0xc8a5('0x16')](_0x4e5fb2)[_0xc8a5('0x17')](_0xc8a5('0x49'),null,_0xc8a5('0x3b')+_0x4e5fb2+'.CmListId')['join'](_0xda7b11,null,_0xda7b11+_0xc8a5('0x18')+_0x4e5fb2+'.'+_0x3a5f8f)[_0xc8a5('0x1a')](_0x4e5fb2+_0xc8a5('0x3d'),_0x4b57f5)['where'](_0xc8a5('0x3e'),NOW)[_0xc8a5('0x1a')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xc8a5('0x39')]()[_0xc8a5('0x14')](_0xc8a5('0x15'))[_0xc8a5('0x16')]('cm_hopper_black')[_0xc8a5('0x1a')](_0xc8a5('0x4a'),_0x4b57f5)[_0xc8a5('0x1a')](_0x3a5f8f+_0xc8a5('0x4b'),_0x4e5fb2+'.'+_0x3a5f8f)))[_0xc8a5('0x4c')]();}function insertCmHopperAdditionalPhones(_0x45dddf){var _0x5d2435=[_0xc8a5('0x4d'),_0xc8a5('0x4e'),_0xc8a5('0x4f'),_0xc8a5('0x50'),_0xc8a5('0x51')];return squel[_0xc8a5('0x31')]()[_0xc8a5('0x32')](_0xc8a5('0x52'))[_0xc8a5('0x34')]([_0xc8a5('0x53'),_0xc8a5('0x15'),_0xc8a5('0x54'),_0xc8a5('0x37'),'updatedAt'],squel[_0xc8a5('0x39')]()['fields'](_0x5d2435)['from']('cm_hopper')[_0xc8a5('0x17')]('cm_contacts',null,_0xc8a5('0x55'))[_0xc8a5('0x17')](_0xc8a5('0x56'),null,_0xc8a5('0x57'))[_0xc8a5('0x1a')](_0xc8a5('0x58'),_0x45dddf)[_0xc8a5('0x1a')](_0xc8a5('0x3e'),NOW))[_0xc8a5('0x4c')]();}function insertCmContact(_0x4f9b24,_0x2c9d39,_0x3bbc46,_0x45d2da){var _0x229972=_[_0xc8a5('0x59')](_['keys'](_0x45d2da),[_0xc8a5('0x36'),_0xc8a5('0x5a'),_0xc8a5('0x37'),_0xc8a5('0x48')]);return squel[_0xc8a5('0x31')]()['into'](_0xc8a5('0x49'))['fromQuery'](_0x229972,squel[_0xc8a5('0x39')]()[_0xc8a5('0x3a')](_0x229972)['from'](_0x2c9d39)[_0xc8a5('0x1a')]('('+_0x3bbc46['join'](',')+_0xc8a5('0x5b'),squel[_0xc8a5('0x39')]()[_0xc8a5('0x3a')](_0x3bbc46)[_0xc8a5('0x16')](_0xc8a5('0x49'))[_0xc8a5('0x1a')](_0xc8a5('0x4a'),_0x4f9b24))[_0xc8a5('0x1a')]('id\x20IN\x20?',squel[_0xc8a5('0x39')]()[_0xc8a5('0x14')](_0xc8a5('0x5c'),_0xc8a5('0x5d'))['from'](_0x2c9d39)[_0xc8a5('0x5e')](_0x3bbc46[_0xc8a5('0x17')](','))))[_0xc8a5('0x4c')]();}function handleStop(){logger[_0xc8a5('0x5f')](_0xc8a5('0x60'));stopped=!![];}function handleUncaughtException(_0x31d636){logger[_0xc8a5('0x23')](_0x31d636[_0xc8a5('0x61')]);process['exit'](0x1);}function handleError(_0x8c7224,_0x4f6ff5){stats[_0xc8a5('0x62')]['push']({'name':_0x4f6ff5[_0xc8a5('0x63')],'message':_0x4f6ff5[_0xc8a5('0x61')],'row':_0x8c7224});}function handleQuery(_0x54ceb4){logger[_0xc8a5('0x5f')](_0x54ceb4);return db[_0xc8a5('0x1b')][_0xc8a5('0x1c')](_0x54ceb4)[_0xc8a5('0x64')](function(_0x199a3e){results[_0xc8a5('0x21')](_0x199a3e);})[_0xc8a5('0x65')](function(_0x1e52c2){logger['error'](_0x1e52c2['message']);});}function main(_0x177878,_0x43460b,_0x41d6e9,_0x515441){logger[_0xc8a5('0x5f')](_0xc8a5('0x66'),_0x177878,JSON['stringify'](_0x43460b));process['send'](_0xc8a5('0x67'));var _0x291cd1=_0x43460b['binding'];var _0x5cdb14=_[_0xc8a5('0x68')](_0x291cd1);var _0x23803c=_0x43460b[_0xc8a5('0x69')];var _0x43ffa5=path[_0xc8a5('0x17')](config[_0xc8a5('0x6a')],'server/files/tmp',_0x23803c+'.csv');logger[_0xc8a5('0x5f')](_0xc8a5('0x6b'),_0x43460b);db[_0xc8a5('0x6c')][_0xc8a5('0x6d')]({'raw':!![],'attributes':['id',_0xc8a5('0x6e')]})[_0xc8a5('0x22')](function(_0x22726e){for(var _0x3a3132=0x0;_0x3a3132<_0x22726e['length'];_0x3a3132++){if(_0x22726e[_0x3a3132][_0xc8a5('0x6e')]in _0x291cd1){contactItemTypes[_0xc8a5('0x21')](_0x22726e[_0x3a3132]);delete _0x5cdb14[_0x22726e[_0x3a3132][_0xc8a5('0x6e')]];hasAdditionalPhones=!![];}for(var _0x4a0fac in _0x291cd1){if(_0x22726e[_0x3a3132][_0xc8a5('0x6e')]+'_description'===_0x4a0fac){phoneDescriptions['push']({'itemTypeId':_0x22726e[_0x3a3132]['id'],'description':_0x4a0fac});delete _0x5cdb14[_0x4a0fac];}}}if(hasAdditionalPhones)_0x5cdb14['AdditionalPhones']='';var _0x15be7e=_['keys'](_0x5cdb14)[_0xc8a5('0x17')]();logger['info'](_0xc8a5('0x6f'),_0x15be7e);fs['writeFileSync'](_0x43ffa5,_0x15be7e+'\x0a');Papa[_0xc8a5('0x70')](fs['createReadStream'](_0x177878),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5aabf5,_0x3a92ea){try{for(var _0x40677c=0x0,_0x2147a7=[];_0x40677c<_0x5aabf5[_0xc8a5('0x71')][_0xc8a5('0x1e')];_0x40677c++){stats[_0xc8a5('0x72')]+=0x1;if(_0x5aabf5[_0xc8a5('0x62')][_0x40677c]){handleError(_0x5aabf5['data'][_0x40677c],_0x5aabf5[_0xc8a5('0x62')][_0x40677c]);}else{var _0x23f2cc=[];var _0x208ae1=[];var _0x24aed1={};for(var _0x3f2cce in _0x291cd1){let _0x5db36f=contactItemTypes[_0xc8a5('0x73')](_0x3bcf19=>_0x3bcf19['name']===_0x3f2cce);let _0x2cf07e=contactItemTypes[_0xc8a5('0x73')](_0x395d1b=>_0x395d1b[_0xc8a5('0x6e')]+_0xc8a5('0x74')===_0x3f2cce);if(_[_0xc8a5('0x1f')](_0x5db36f)&&_['isNil'](_0x2cf07e)){if(_0x291cd1[_0xc8a5('0x75')](_0x3f2cce)){if(_0x5aabf5[_0xc8a5('0x71')][_0x40677c][_0x291cd1[_0x3f2cce]]){var _0x51e069=_['trim'](_0x5aabf5[_0xc8a5('0x71')][_0x40677c][_0x291cd1[_0x3f2cce]]['replace'](/"/g,'\x27'));switch(_0x3f2cce){case _0xc8a5('0x35'):var _0x2ff188=moment(_0x51e069,_0xc8a5('0x10'),!![]);if(_0x2ff188[_0xc8a5('0x76')]()){_0x2147a7['push']('\x22'+_0x51e069+'\x22');}else{_0x23f2cc[_0xc8a5('0x21')](_0xc8a5('0x77'));}break;case _0xc8a5('0x38'):var _0x35f818=parseInt(_0x51e069);_0x51e069=_[_0xc8a5('0x78')](_0x35f818)||_0x35f818<0x0||_0x35f818>0x4?_0x515441?0x3:0x2:_0x35f818;_0x2147a7[_0xc8a5('0x21')]('\x22'+_0x51e069+'\x22');break;case _0xc8a5('0x79'):var _0x340bef=parseInt(_0x51e069);if(_[_0xc8a5('0x7a')](_0x340bef)&&_[_0xc8a5('0x7b')](_0x41d6e9,_0x340bef)){_0x2147a7[_0xc8a5('0x21')]('\x22'+_0x340bef+'\x22');}else{_0x23f2cc[_0xc8a5('0x21')](_0xc8a5('0x7c'));}break;case _0xc8a5('0x7d'):if(isEmail(_0x51e069)){_0x2147a7[_0xc8a5('0x21')]('\x22'+_0x51e069+'\x22');}else{_0x23f2cc['push'](_0xc8a5('0x7e'));}break;case _0xc8a5('0x7f'):var _0x272321=moment(_0x51e069,_0xc8a5('0x80'),!![]);if(_0x272321['isValid']()){_0x2147a7['push']('\x22'+_0x51e069+'\x22');}else{_0x23f2cc[_0xc8a5('0x21')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2147a7['push']('\x22'+_0x51e069+'\x22');}}else{switch(_0x3f2cce){case'firstName':case'phone':_0x23f2cc[_0xc8a5('0x21')](_0x3f2cce+'\x20not\x20specified');break;default:_0x2147a7[_0xc8a5('0x21')]('\x22\x22');}}}}else{var _0x3a69a0='';if(!_[_0xc8a5('0x1f')](_0x5db36f)){if(!_0x24aed1['hasOwnProperty'](_0x5db36f['id'])){for(var _0x295408=0x0;_0x295408<_0x291cd1[_0x3f2cce][_0xc8a5('0x1e')];_0x295408++){var _0x51e069=_[_0xc8a5('0x81')](_0x5aabf5[_0xc8a5('0x71')][_0x40677c][_0x291cd1[_0x3f2cce][_0x295408]][_0xc8a5('0x82')](/"/g,'\x27'));var _0x26ce18=phoneDescriptions[_0xc8a5('0x73')](_0x19331c=>_0x19331c['itemTypeId']===_0x5db36f['id']);if(!_['isNil'](_0x26ce18)){var _0x121cae=_[_0xc8a5('0x81')](_0x5aabf5[_0xc8a5('0x71')][_0x40677c][_0x291cd1[_0x26ce18[_0xc8a5('0x83')]][0x0]][_0xc8a5('0x82')](/"/g,'\x27'));if(!_[_0xc8a5('0x1f')](_0x121cae))_0x51e069=_0x51e069+'§'+_0x121cae;}if(_0x3a69a0=='')_0x3a69a0=_0x51e069;else _0x3a69a0+='|'+_0x51e069;}_0x208ae1[_0xc8a5('0x21')](_0x5db36f['id']+':'+_0x3a69a0);_0x24aed1[_0x5db36f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2147a7['push']('\x22'+_0x208ae1['join'](';')+'\x22');}if(_0x23f2cc[_0xc8a5('0x1e')]){handleError(_0x5aabf5[_0xc8a5('0x71')][_0x40677c],{'code':_0xc8a5('0x84'),'message':_0x23f2cc[_0xc8a5('0x17')]()});}else{fs[_0xc8a5('0x85')](_0x43ffa5,_0x2147a7[_0xc8a5('0x17')]()+'\x0a');}_0x2147a7=[];}if(!(stats['rows']%0xc8)){socket[_0xc8a5('0x86')](_0xc8a5('0x87')+_0x23803c,stats);stats[_0xc8a5('0x62')]=[];}}if(stopped){logger[_0xc8a5('0x5f')](_0xc8a5('0x88'));_0x3a92ea[_0xc8a5('0x89')]();}}catch(_0x325948){handleError(_0x5aabf5['data'][_0x40677c],{'code':'SystemError','message':_0x325948[_0xc8a5('0x61')]});logger['error'](_0xc8a5('0x8a'),_0x325948[_0xc8a5('0x61')]);}},'complete':function(){try{var _0x2c9948=[];var _0x545c95=tempTableName;_0x2c9948['push'](_0xc8a5('0x8b')+_0x545c95+_0xc8a5('0x8c'));logger[_0xc8a5('0x5f')](_0xc8a5('0x8d'),contactItemTypes[_0xc8a5('0x1e')]);var _0x1e4979=util[_0xc8a5('0xf')](_0xc8a5('0x8e'),_0x43ffa5,_0x545c95,_0x15be7e,_0x43460b['ListId'],_0x43460b[_0xc8a5('0x5a')]||null,NOW,NOW);if(_[_0xc8a5('0x1f')](_0x291cd1['scheduledat'])){_0x1e4979+=',\x20scheduledAt\x20=\x20NOW()';}_0x2c9948['push'](_0x1e4979);BPromise['each'](_0x2c9948,handleQuery)[_0xc8a5('0x22')](function(_0x5a480c){BPromise[_0xc8a5('0x24')]([handleAdditionalPhones()])[_0xc8a5('0x22')](function(){_0x2c9948=[];for(var _0x376991=0x0;_0x376991\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.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','enableEmailPreview','clone','COUNT(*)','where','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','select','field','name','color','tools_tags','_interactions','u.id','u.fullname','ui.','from','left_join','users','length','\x20IN\x20?','map','getInteractionsTables','getInteractionFK','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','buildExpression','type','text','value','start','end','unreadMessages','read','and','Contact','operator','$substring','split','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?','find','ContactId','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','compact','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','resolve','then','fields','tag','filter','get','capitalize','chat','search','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus'];(function(_0x55e5c8,_0x4949e3){var _0x4e7fe2=function(_0x511370){while(--_0x511370){_0x55e5c8['push'](_0x55e5c8['shift']());}};_0x4e7fe2(++_0x4949e3);}(_0xd9b8,0xd6));var _0x8d9b=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0xd9b8[_0x2c3a8f];return _0x189412;};'use strict';var _=require(_0x8d9b('0x0'));var squel=require(_0x8d9b('0x1'));var as=require(_0x8d9b('0x2'));var qs=require('../parsers/qs');var updateInteraction=require(_0x8d9b('0x3'))[_0x8d9b('0x4')];var utils=require(_0x8d9b('0x5'));var db=require(_0x8d9b('0x6'))['db'];function skipInteractionsQuery(_0x1660d5,_0x4963fa,_0x1bc4d4){var _0x44626c=![];var _0x1bb419=utils[_0x8d9b('0x7')](_0x1660d5);if(_0x4963fa[_0x8d9b('0x8')]===_0x8d9b('0x9')&&!_0x1bc4d4['search']&&!_0x1bc4d4[_0x1bb419]){_0x44626c=!![];}return _0x44626c;}function getTagsQuery(){return squel[_0x8d9b('0xa')]()[_0x8d9b('0xb')]('id')[_0x8d9b('0xb')](_0x8d9b('0xc'))[_0x8d9b('0xb')](_0x8d9b('0xd'))['from'](_0x8d9b('0xe'));}function getUsersQuery(_0x5a6309,_0x36fd25){var _0x2802b1=utils['getInteractionFK'](_0x5a6309);var _0x2732e9='user_has_'+_0x5a6309+_0x8d9b('0xf');var _0x2d4958=squel[_0x8d9b('0xa')]()[_0x8d9b('0xb')](_0x8d9b('0x10'))[_0x8d9b('0xb')](_0x8d9b('0x11'))[_0x8d9b('0xb')](_0x8d9b('0x12')+_0x2802b1)[_0x8d9b('0x13')](_0x2732e9,'ui')[_0x8d9b('0x14')](_0x8d9b('0x15'),'u','u.id\x20=\x20ui.UserId');if(_0x36fd25[_0x8d9b('0x16')]>0x0){_0x2d4958['where']('ui.'+_0x2802b1+_0x8d9b('0x17'),_[_0x8d9b('0x18')](_0x36fd25,'id'));}return _0x2d4958;}function getInteractionsQuery(_0x46cba4){var _0x5e1bff=utils[_0x8d9b('0x19')](_0x46cba4);var _0x51cdb6=utils[_0x8d9b('0x7')](_0x46cba4);var _0x48573d=utils[_0x8d9b('0x1a')](_0x46cba4);return squel[_0x8d9b('0xa')]()[_0x8d9b('0x13')](_0x5e1bff[_0x8d9b('0x1b')],'i')[_0x8d9b('0x14')]('cm_contacts','c',_0x8d9b('0x1c'))[_0x8d9b('0x14')]('users','o',_0x8d9b('0x1d'))[_0x8d9b('0x14')](_0x5e1bff[_0x8d9b('0x1e')],'a','a.id\x20=\x20i.'+_0x51cdb6)['left_join'](_0x5e1bff[_0x8d9b('0x1f')],'me',_0x8d9b('0x20')+_0x48573d+_0x8d9b('0x21'))[_0x8d9b('0x14')](_0x5e1bff[_0x8d9b('0x22')],'it',_0x8d9b('0x23')+_0x48573d+'\x20=\x20i.id')[_0x8d9b('0x14')](_0x8d9b('0xe'),'t',_0x8d9b('0x24'));}function getSqlClauses(){var _0x555b7a={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0x8d9b('0x25')](),'fields':squel['expr'](),'filter':squel[_0x8d9b('0x25')](),'read':squel[_0x8d9b('0x25')](),'tags':{'clause':squel[_0x8d9b('0x25')](),'ids':null},'user':squel[_0x8d9b('0x25')]()};return _0x555b7a;}function parseTagParameter(_0x496c94){var _0x3144da=squel[_0x8d9b('0x25')]();if(_0x496c94){var _0x487009=utils[_0x8d9b('0x26')](_0x496c94);_0x487009['forEach'](function(_0x5d71a0){_0x3144da['or'](_0x8d9b('0x27'),'%,'+_0x5d71a0+',%');});}return _0x3144da;}function parseReadParameter(_0x478bef){var _0x31bb93='';if(_0x478bef){_0x31bb93='unreadMessages\x20{OPERATOR}\x200';if(_0x478bef==='1'){_0x31bb93=_0x31bb93[_0x8d9b('0x28')](_0x8d9b('0x29'),'=');}else{_0x31bb93=_0x31bb93[_0x8d9b('0x28')](_0x8d9b('0x29'),'>');}}return _0x31bb93;}function parseSearchFilter(_0x5d3897,_0x18225a){var _0xa91c67=squel['expr']();if(_0x18225a){var _0x37371e=_0x18225a['replace']('\x5c','\x5c\x5c')[_0x8d9b('0x28')](/'/g,'\x27\x27');if(qs[_0x8d9b('0x2a')](_0x37371e)){_0xa91c67['or'](_0x8d9b('0x2b'),_0x37371e+'%');if([_0x8d9b('0x2c'),_0x8d9b('0x2d')]['includes'](_0x5d3897)){_0xa91c67['or'](_0x8d9b('0x2e'),_0x37371e+'%');}else if(_0x5d3897===_0x8d9b('0x2f')){_0xa91c67['or'](_0x8d9b('0x30'),_0x37371e+'%');}else if(_0x5d3897===_0x8d9b('0x31')){_0xa91c67['or'](_0x8d9b('0x32'),_0x37371e+'%');}}else if(_0x5d3897===_0x8d9b('0x33')&&qs['isEmail'](_0x37371e)){_0xa91c67['or'](_0x8d9b('0x34'),_0x37371e+'%');}else{if(_0x5d3897==='mail'){_0xa91c67['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x37371e,!![]))['or'](_0x8d9b('0x35'),qs[_0x8d9b('0x36')](_0x37371e));}else if(_0x5d3897!=='fax'){_0xa91c67['or'](_0x8d9b('0x37'),qs[_0x8d9b('0x36')](_0x37371e));}_0xa91c67['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8d9b('0x36')](_0x37371e,!![]),null);}}return _0xa91c67;}function parseAdvancedSearchFilter(_0x460165,_0x328f4f){var _0x4b62f1=getSqlClauses();var _0x462ba6=as[_0x8d9b('0x38')](_0x460165);var _0x49a843=_0x462ba6[_0x8d9b('0x39')];for(var _0x3e10ea=0x0;_0x3e10ea<_0x462ba6[_0x8d9b('0x3a')][_0x8d9b('0x16')];_0x3e10ea++){var _0x259153=_0x462ba6[_0x8d9b('0x3a')][_0x3e10ea];var _0x36668f='i';var _0x47f5bc=_['find'](_0x328f4f,[_0x8d9b('0xc'),_0x259153[_0x8d9b('0xb')]]);if(_0x47f5bc){var _0x320b0b=as[_0x8d9b('0x3b')](_0x36668f,_0x47f5bc[_0x8d9b('0x3c')],_0x259153);_0x4b62f1['default'][_0x49a843](_0x320b0b[_0x8d9b('0x3d')],_0x320b0b[_0x8d9b('0x3e')][_0x8d9b('0x3f')],_0x320b0b[_0x8d9b('0x3e')][_0x8d9b('0x40')]);}else{switch(_0x259153[_0x8d9b('0xb')]){case _0x8d9b('0x41'):var _0x274bcc=parseReadParameter(_0x259153[_0x8d9b('0x3e')]);_0x4b62f1[_0x8d9b('0x42')][_0x8d9b('0x43')](_0x274bcc);break;case _0x8d9b('0x44'):if(_0x259153[_0x8d9b('0x45')]===_0x8d9b('0x46')){if(_0x259153[_0x8d9b('0x3e')][_0x8d9b('0x47')]('\x20')[_0x8d9b('0x16')]>0x1){_0x4b62f1['contact'][_0x49a843](_0x8d9b('0x48'),qs[_0x8d9b('0x36')](_0x259153['value'],!![]),null);}else{var _0x167874='%'+_0x259153['value']+'%';_0x4b62f1['contact'][_0x49a843](_0x8d9b('0x49'),_0x167874,_0x167874,_0x167874);}}else{_0x47f5bc=_[_0x8d9b('0x4a')](_0x328f4f,[_0x8d9b('0xc'),_0x8d9b('0x4b')]);_0x259153[_0x8d9b('0xb')]=_0x8d9b('0x4b');_0x320b0b=as['buildExpression'](_0x36668f,_0x47f5bc[_0x8d9b('0x3c')],_0x259153);_0x4b62f1['contact'][_0x49a843](_0x320b0b[_0x8d9b('0x3d')],_0x320b0b[_0x8d9b('0x3e')][_0x8d9b('0x3f')],_0x320b0b[_0x8d9b('0x3e')][_0x8d9b('0x40')]);}break;case _0x8d9b('0x4c'):var _0x3c38b8=_0x259153[_0x8d9b('0x3e')][_0x8d9b('0x47')](',')['map'](function(_0x377866){return Number(_0x377866);});var _0x3b9248=parseTagParameter(_0x3c38b8);_0x4b62f1[_0x8d9b('0x4d')][_0x8d9b('0x4e')][_0x8d9b('0x43')](_0x3b9248);_0x4b62f1['tags'][_0x8d9b('0x4f')]=_0x3c38b8;break;case _0x8d9b('0x50'):if(_0x259153[_0x8d9b('0x45')]===_0x8d9b('0x46')){_0x4b62f1[_0x8d9b('0x51')][_0x49a843](_0x8d9b('0x52'),'%'+_0x259153[_0x8d9b('0x3e')]+'%',null);}else{_0x47f5bc=_[_0x8d9b('0x4a')](_0x328f4f,['name','UserId']);_0x259153[_0x8d9b('0xb')]=_0x8d9b('0x53');_0x320b0b=as[_0x8d9b('0x3b')](_0x36668f,_0x47f5bc[_0x8d9b('0x3c')],_0x259153);_0x4b62f1[_0x8d9b('0x51')][_0x49a843](_0x320b0b[_0x8d9b('0x3d')],_0x320b0b[_0x8d9b('0x3e')][_0x8d9b('0x3f')],_0x320b0b['value'][_0x8d9b('0x40')]);}break;case'body':case'plainBody':_0x320b0b=as['buildExpression']('me',null,_0x259153);_0x4b62f1[_0x8d9b('0x54')][_0x49a843](_0x320b0b[_0x8d9b('0x3d')],_0x320b0b['value'][_0x8d9b('0x3f')],_0x320b0b[_0x8d9b('0x3e')][_0x8d9b('0x40')]);break;}}}return _0x4b62f1;}function parseModelFields(_0x3b42bc,_0x1cf090,_0x3954a5){var _0x568e1a=utils['getAccountFK'](_0x3b42bc);var _0x532fc7=squel['expr']();var _0xa3824c=_(_0x1cf090)[_0x8d9b('0x55')]()[_0x8d9b('0x18')](function(_0x3e3a99){return _['some'](_0x3954a5,[_0x8d9b('0xc'),_0x3e3a99])?_0x3e3a99:undefined;})[_0x8d9b('0x56')]()[_0x8d9b('0x3e')]();if(_0xa3824c[_0x8d9b('0x16')]>0x0){_0xa3824c['forEach'](function(_0x48ce76){if(_0x48ce76===_0x568e1a){_0x532fc7[_0x8d9b('0x43')]('i.'+_0x568e1a+'\x20IN\x20?',[][_0x8d9b('0x57')](_0x1cf090[_0x48ce76]));}else if(_0x48ce76===_0x8d9b('0x58')){var _0x173a91=JSON[_0x8d9b('0x59')](_0x1cf090[_0x48ce76])['$gte'];var _0x53a19f=JSON[_0x8d9b('0x59')](_0x1cf090[_0x48ce76])['$lte'];_0x532fc7['and'](_0x8d9b('0x5a'),_0x173a91,_0x53a19f);}else{if(_0x1cf090[_0x48ce76]==='null'){_0x532fc7[_0x8d9b('0x43')]('i.'+_0x48ce76+'\x20IS\x20NULL');}else{_0x532fc7['and']('i.'+_0x48ce76+_0x8d9b('0x5b'),_0x1cf090[_0x48ce76]);}}});}return _0x532fc7;}function parseQueryParameters(_0x9c4402,_0x2efcfc,_0x1ea757){var _0x59c0ed=getSqlClauses();return Promise[_0x8d9b('0x5c')]()[_0x8d9b('0x5d')](function(){return parseModelFields(_0x9c4402,_0x2efcfc,_0x1ea757);})['then'](function(_0x5f39b6){_0x59c0ed[_0x8d9b('0x5e')][_0x8d9b('0x43')](_0x5f39b6);return parseReadParameter(_0x2efcfc[_0x8d9b('0x42')]);})[_0x8d9b('0x5d')](function(_0x53705b){_0x59c0ed[_0x8d9b('0x42')][_0x8d9b('0x43')](_0x53705b);return parseTagParameter(_0x2efcfc[_0x8d9b('0x5f')]);})[_0x8d9b('0x5d')](function(_0x57f0fc){_0x59c0ed[_0x8d9b('0x4d')][_0x8d9b('0x4e')][_0x8d9b('0x43')](_0x57f0fc);return parseSearchFilter(_0x9c4402,_0x2efcfc[_0x8d9b('0x60')]);})[_0x8d9b('0x5d')](function(_0x537529){_0x59c0ed[_0x8d9b('0x60')]=_0x537529;return _0x59c0ed;});}function checkAccountsRestrictions(_0x2180e2,_0x1c7685,_0xfc99fd){var _0x3af8ef=utils[_0x8d9b('0x7')](_0x2180e2);var _0xaafd5=_0x8d9b('0x61')+_[_0x8d9b('0x62')](_0x2180e2)+(_0x2180e2===_0x8d9b('0x63')?'Websites':'Accounts');var _0x3fff4d=squel[_0x8d9b('0x25')]();return Promise[_0x8d9b('0x5c')]()[_0x8d9b('0x5d')](function(){if(_0xfc99fd[_0x8d9b('0x64')]&&_0x1c7685[_0x8d9b('0x8')]===_0x8d9b('0x9')){return _0x1c7685[_0xaafd5]({'attributes':['id'],'raw':!![]});}})[_0x8d9b('0x5d')](function(_0x9c8aef){if(_0x9c8aef){if(_0x9c8aef[_0x8d9b('0x16')]===0x0){_0x3fff4d['and']('i.'+_0x3af8ef+_0x8d9b('0x65'));}else{_0x3fff4d['and']('i.'+_0x3af8ef+_0x8d9b('0x17'),_[_0x8d9b('0x18')](_0x9c8aef,'id'));}}else if(!_0xfc99fd[_0x3af8ef]){_0x3fff4d[_0x8d9b('0x43')]('i.'+_0x3af8ef+_0x8d9b('0x66'));}})[_0x8d9b('0x5d')](function(){return _0x3fff4d;});}function getClosedOrderClause(_0x3ccc6e,_0x347aac){var _0x33c5d7='';var _0x580beb=[_0x8d9b('0x67'),_0x8d9b('0x68'),_0x8d9b('0x69')];if(_0x3ccc6e===_0x8d9b('0x33')){_0x580beb[_0x8d9b('0x6a')](_0x8d9b('0x6b'));}if(_0x347aac[_0x8d9b('0x6c')]==='0'&&_0x3ccc6e==='mail'){_0x33c5d7=_0x8d9b('0x6b');}else{if(_0x347aac['closed']==='1'){_0x580beb[_0x8d9b('0x6d')]();}_0x33c5d7=_0x8d9b('0x6e')+_0x580beb[_0x8d9b('0x6f')](',\x20')+')';}return _0x33c5d7;}function getFilteredInteractions(_0x365ad5,_0x573bb4,_0x266058,_0x2c0cc0){var _0x200dd0=utils['getInteractionFK'](_0x365ad5);var _0x11bc68=_[_0x8d9b('0x62')](_0x365ad5)+_0x8d9b('0x70');var _0x3cc87a=[];var _0x1aec0a=getTagsQuery();var _0x2bbbea={'type':db[_0x8d9b('0x71')]['QueryTypes']['SELECT'],'raw':!![]};var _0x38a3be=[];var _0x5e82b4=[];return db[_0x8d9b('0x72')][_0x8d9b('0x73')](_0x1aec0a['toString'](),_0x2bbbea)[_0x8d9b('0x5d')](function(_0x1147a){_0x3cc87a=_[_0x8d9b('0x74')](_0x1147a,'id');_0x2bbbea=_['merge'](_0x2bbbea,{'model':db[_0x11bc68],'mapToModel':!![],'nest':!![]});if(_0x266058[_0x8d9b('0x5e')]){_0x2c0cc0[_0x8d9b('0x75')][_0x8d9b('0x76')](function(_0x50f520){_0x573bb4['field']('i.'+_0x50f520);});}else{_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x77'),_0x8d9b('0x41'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x78'),_0x8d9b('0x79'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x7a'),'Account.mandatoryDisposition');if(_0x365ad5==='mail'){_0x573bb4['field'](_0x8d9b('0x7b'),'Account.email');_0x573bb4['field']('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',_0x8d9b('0x7c'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x7d'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x7e'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x7f'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x80'));_0x573bb4['field']('i.closedAt');_0x573bb4['field'](_0x8d9b('0x81'));_0x573bb4[_0x8d9b('0xb')]('i.lastMsgAt');_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x82'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x83'));_0x573bb4['field']('i.disposition');_0x573bb4[_0x8d9b('0xb')]('i.secondDisposition');_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x67'));_0x573bb4['field'](_0x8d9b('0x6b'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x84'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x85'));_0x573bb4['field'](_0x8d9b('0x86'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x87'));}else if(_0x365ad5===_0x8d9b('0x31')){_0x573bb4['field'](_0x8d9b('0x88'),_0x8d9b('0x7c'));}else{_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x89'),_0x8d9b('0x7c'));}if(_0x365ad5!==_0x8d9b('0x33')){_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x8a'));}_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x8b'),'Contact.firstName');_0x573bb4['field']('c.lastName',_0x8d9b('0x8c'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x8d'),_0x8d9b('0x8e'));_0x573bb4['field']('c.phone',_0x8d9b('0x8f'));_0x573bb4[_0x8d9b('0xb')](_0x8d9b('0x90'),'Contact.mobile');_0x573bb4[_0x8d9b('0xb')]('c.fax',_0x8d9b('0x91'));_0x573bb4[_0x8d9b('0xb')]('o.fullname',_0x8d9b('0x92'));_0x573bb4['field'](_0x8d9b('0x93'),_0x8d9b('0x94'));_0x573bb4['field'](_0x8d9b('0x95'),_0x8d9b('0x96'));}if(_0x2c0cc0[_0x8d9b('0x97')]){_0x573bb4[_0x8d9b('0x97')](_0x2c0cc0[_0x8d9b('0x97')]);}if(_0x2c0cc0[_0x8d9b('0x98')]){_0x573bb4['offset'](_0x2c0cc0[_0x8d9b('0x98')]);}return db['sequelize'][_0x8d9b('0x73')](_0x573bb4[_0x8d9b('0x99')](),_0x2bbbea);})[_0x8d9b('0x5d')](function(_0x248f62){_0x38a3be=_0x248f62;var _0x216c53=getUsersQuery(_0x365ad5,_0x38a3be);return db[_0x8d9b('0x72')]['query'](_0x216c53['toString'](),_0x2bbbea);})[_0x8d9b('0x5d')](function(_0x1ded29){_0x5e82b4=_['groupBy'](_0x1ded29,_0x200dd0);if(_0x365ad5===_0x8d9b('0x33')){return db['Setting']['findOne']({'attributes':[_0x8d9b('0x9a')],'raw':!![]});}})[_0x8d9b('0x5d')](function(_0x5a4b46){var _0x3977a5=_0x5a4b46?_0x5a4b46['enableEmailPreview']:undefined;var _0x222062=_0x38a3be[_0x8d9b('0x18')](function(_0xf3e77a){return updateInteraction(_0xf3e77a,_0x3cc87a,_0x5e82b4,_0x3977a5);});return Promise['all'](_0x222062);});}function countFilteredInteractions(_0x1a85b9,_0x2a7039){var _0x12b150=_0x1a85b9[_0x8d9b('0x9b')]();_0x12b150[_0x8d9b('0xb')](_0x8d9b('0x9c'));_0x12b150[_0x8d9b('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8d9b('0x41'));var _0x8c9fa8=utils[_0x8d9b('0x26')](_0x2a7039);if(!_['isEmpty'](_0x8c9fa8)){_0x12b150[_0x8d9b('0x9d')](_0x8d9b('0x9e'),_0x8c9fa8);}var _0x5cfeab={'type':db[_0x8d9b('0x71')]['QueryTypes'][_0x8d9b('0x9f')],'raw':!![]};return db[_0x8d9b('0x72')]['query'](_0x12b150['toString'](),_0x5cfeab);}module[_0x8d9b('0xa0')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x460e=['MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','buildExpression','type','text','value','start','end','unreadMessages','read','and','Contact','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','Tag','split','tags','clause','ids','User','user','UserId','body','plainBody','keys','some','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','resolve','then','fields','tag','filter','get','Websites','Accounts','agent','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','join','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Account.email','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.to','i.ContactId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','TagIds','limit','offset','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','sms','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x460e,0x1b5));var _0xe460=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x460e[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xe460('0x0'));var squel=require(_0xe460('0x1'));var as=require(_0xe460('0x2'));var qs=require(_0xe460('0x3'));var updateInteraction=require(_0xe460('0x4'))['updateInteraction'];var utils=require(_0xe460('0x5'));var db=require(_0xe460('0x6'))['db'];function skipInteractionsQuery(_0x20755c,_0x427275,_0x23d94b){var _0x8389a3=![];var _0x47e032=utils[_0xe460('0x7')](_0x20755c);if(_0x427275[_0xe460('0x8')]==='agent'&&!_0x23d94b[_0xe460('0x9')]&&!_0x23d94b[_0x47e032]){_0x8389a3=!![];}return _0x8389a3;}function getTagsQuery(){return squel[_0xe460('0xa')]()[_0xe460('0xb')]('id')[_0xe460('0xb')](_0xe460('0xc'))[_0xe460('0xb')](_0xe460('0xd'))[_0xe460('0xe')](_0xe460('0xf'));}function getUsersQuery(_0x28e014,_0x40d324){var _0x4d4c05=utils[_0xe460('0x10')](_0x28e014);var _0x9545b5=_0xe460('0x11')+_0x28e014+_0xe460('0x12');var _0x5ea829=squel[_0xe460('0xa')]()['field'](_0xe460('0x13'))[_0xe460('0xb')](_0xe460('0x14'))[_0xe460('0xb')](_0xe460('0x15')+_0x4d4c05)[_0xe460('0xe')](_0x9545b5,'ui')[_0xe460('0x16')](_0xe460('0x17'),'u',_0xe460('0x18'));if(_0x40d324[_0xe460('0x19')]>0x0){_0x5ea829[_0xe460('0x1a')](_0xe460('0x15')+_0x4d4c05+_0xe460('0x1b'),_[_0xe460('0x1c')](_0x40d324,'id'));}return _0x5ea829;}function getInteractionsQuery(_0x5eec01){var _0x3598f5=utils[_0xe460('0x1d')](_0x5eec01);var _0x5dcba2=utils[_0xe460('0x7')](_0x5eec01);var _0xeab527=utils[_0xe460('0x10')](_0x5eec01);return squel[_0xe460('0xa')]()['from'](_0x3598f5[_0xe460('0x1e')],'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe460('0x16')]('users','o','o.id\x20=\x20i.UserId')[_0xe460('0x16')](_0x3598f5[_0xe460('0x1f')],'a',_0xe460('0x20')+_0x5dcba2)[_0xe460('0x16')](_0x3598f5[_0xe460('0x21')],'me',_0xe460('0x22')+_0xeab527+_0xe460('0x23'))['left_join'](_0x3598f5[_0xe460('0x24')],'it',_0xe460('0x25')+_0xeab527+_0xe460('0x23'))[_0xe460('0x16')](_0xe460('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x27fc0c={'body':squel[_0xe460('0x26')](),'contact':squel[_0xe460('0x26')](),'default':squel[_0xe460('0x26')](),'fields':squel[_0xe460('0x26')](),'filter':squel[_0xe460('0x26')](),'read':squel[_0xe460('0x26')](),'tags':{'clause':squel[_0xe460('0x26')](),'ids':null},'user':squel[_0xe460('0x26')]()};return _0x27fc0c;}function parseTagParameter(_0x2f1a51){var _0x32858d=squel['expr']();if(_0x2f1a51){var _0x3728c7=utils[_0xe460('0x27')](_0x2f1a51);_0x3728c7['forEach'](function(_0x398cbd){_0x32858d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x398cbd+',%');});}return _0x32858d;}function parseReadParameter(_0x29db36){var _0x21005a='';if(_0x29db36){_0x21005a=_0xe460('0x28');if(_0x29db36==='1'){_0x21005a=_0x21005a[_0xe460('0x29')](_0xe460('0x2a'),'=');}else{_0x21005a=_0x21005a['replace'](_0xe460('0x2a'),'>');}}return _0x21005a;}function parseSearchFilter(_0xb3077f,_0x4b59be){var _0x25275c=squel[_0xe460('0x26')]();if(_0x4b59be){var _0x57d0ee=_0x4b59be[_0xe460('0x29')]('\x5c','\x5c\x5c')[_0xe460('0x29')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x57d0ee)){_0x25275c['or']('i.id\x20LIKE\x20?',_0x57d0ee+'%');if([_0xe460('0x2b'),_0xe460('0x2c')]['includes'](_0xb3077f)){_0x25275c['or'](_0xe460('0x2d'),_0x57d0ee+'%');}else if(_0xb3077f===_0xe460('0x2e')){_0x25275c['or'](_0xe460('0x2f'),_0x57d0ee+'%');}else if(_0xb3077f==='openchannel'){_0x25275c['or'](_0xe460('0x30'),_0x57d0ee+'%');}}else if(_0xb3077f===_0xe460('0x31')&&qs[_0xe460('0x32')](_0x57d0ee)){_0x25275c['or'](_0xe460('0x33'),_0x57d0ee+'%');}else{if(_0xb3077f==='mail'){_0x25275c['or'](_0xe460('0x34'),qs[_0xe460('0x35')](_0x57d0ee,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x57d0ee));}else if(_0xb3077f!==_0xe460('0x2e')){_0x25275c['or'](_0xe460('0x36'),qs['getFullTextValue'](_0x57d0ee));}_0x25275c['or'](_0xe460('0x37'),qs['getFullTextValue'](_0x57d0ee,!![]),null);}}return _0x25275c;}function parseAdvancedSearchFilter(_0x145d77,_0x2b8104){var _0x536bef=getSqlClauses();var _0x2015a7=as['parseSearch'](_0x145d77);var _0x4fe8a6=_0x2015a7[_0xe460('0x38')];for(var _0x5f0ced=0x0;_0x5f0ced<_0x2015a7['conditions'][_0xe460('0x19')];_0x5f0ced++){var _0xbf3484=_0x2015a7[_0xe460('0x39')][_0x5f0ced];var _0x338ed0='i';var _0xe936e0=_['find'](_0x2b8104,[_0xe460('0xc'),_0xbf3484[_0xe460('0xb')]]);if(_0xe936e0){var _0x32926d=as[_0xe460('0x3a')](_0x338ed0,_0xe936e0[_0xe460('0x3b')],_0xbf3484);_0x536bef['default'][_0x4fe8a6](_0x32926d[_0xe460('0x3c')],_0x32926d[_0xe460('0x3d')][_0xe460('0x3e')],_0x32926d['value'][_0xe460('0x3f')]);}else{switch(_0xbf3484[_0xe460('0xb')]){case _0xe460('0x40'):var _0x52976c=parseReadParameter(_0xbf3484['value']);_0x536bef[_0xe460('0x41')][_0xe460('0x42')](_0x52976c);break;case _0xe460('0x43'):if(_0xbf3484['operator']===_0xe460('0x44')){if(_0xbf3484[_0xe460('0x3d')]['split']('\x20')[_0xe460('0x19')]>0x1){_0x536bef[_0xe460('0x45')][_0x4fe8a6](_0xe460('0x37'),qs[_0xe460('0x35')](_0xbf3484[_0xe460('0x3d')],!![]),null);}else{var _0x87cb3d='%'+_0xbf3484[_0xe460('0x3d')]+'%';_0x536bef[_0xe460('0x45')][_0x4fe8a6](_0xe460('0x46'),_0x87cb3d,_0x87cb3d,_0x87cb3d);}}else{_0xe936e0=_[_0xe460('0x47')](_0x2b8104,[_0xe460('0xc'),'ContactId']);_0xbf3484[_0xe460('0xb')]=_0xe460('0x48');_0x32926d=as[_0xe460('0x3a')](_0x338ed0,_0xe936e0[_0xe460('0x3b')],_0xbf3484);_0x536bef['contact'][_0x4fe8a6](_0x32926d[_0xe460('0x3c')],_0x32926d[_0xe460('0x3d')][_0xe460('0x3e')],_0x32926d['value'][_0xe460('0x3f')]);}break;case _0xe460('0x49'):var _0x1731bb=_0xbf3484[_0xe460('0x3d')][_0xe460('0x4a')](',')[_0xe460('0x1c')](function(_0x4ad865){return Number(_0x4ad865);});var _0x8e96b=parseTagParameter(_0x1731bb);_0x536bef[_0xe460('0x4b')][_0xe460('0x4c')]['and'](_0x8e96b);_0x536bef[_0xe460('0x4b')][_0xe460('0x4d')]=_0x1731bb;break;case _0xe460('0x4e'):if(_0xbf3484['operator']==='$substring'){_0x536bef[_0xe460('0x4f')][_0x4fe8a6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xbf3484[_0xe460('0x3d')]+'%',null);}else{_0xe936e0=_[_0xe460('0x47')](_0x2b8104,[_0xe460('0xc'),_0xe460('0x50')]);_0xbf3484[_0xe460('0xb')]=_0xe460('0x50');_0x32926d=as['buildExpression'](_0x338ed0,_0xe936e0[_0xe460('0x3b')],_0xbf3484);_0x536bef[_0xe460('0x4f')][_0x4fe8a6](_0x32926d['text'],_0x32926d[_0xe460('0x3d')][_0xe460('0x3e')],_0x32926d[_0xe460('0x3d')][_0xe460('0x3f')]);}break;case _0xe460('0x51'):case _0xe460('0x52'):_0x32926d=as[_0xe460('0x3a')]('me',null,_0xbf3484);_0x536bef[_0xe460('0x51')][_0x4fe8a6](_0x32926d[_0xe460('0x3c')],_0x32926d[_0xe460('0x3d')]['start'],_0x32926d[_0xe460('0x3d')][_0xe460('0x3f')]);break;}}}return _0x536bef;}function parseModelFields(_0x2f9041,_0x3d1b29,_0x3df416){var _0x338200=utils['getAccountFK'](_0x2f9041);var _0x5e0f46=squel[_0xe460('0x26')]();var _0x2b5449=_(_0x3d1b29)[_0xe460('0x53')]()[_0xe460('0x1c')](function(_0x40fe99){return _[_0xe460('0x54')](_0x3df416,[_0xe460('0xc'),_0x40fe99])?_0x40fe99:undefined;})[_0xe460('0x55')]()[_0xe460('0x3d')]();if(_0x2b5449['length']>0x0){_0x2b5449['forEach'](function(_0xe68297){if(_0xe68297===_0x338200){_0x5e0f46[_0xe460('0x42')]('i.'+_0x338200+_0xe460('0x1b'),[][_0xe460('0x56')](_0x3d1b29[_0xe68297]));}else if(_0xe68297===_0xe460('0x57')){var _0x12a680=JSON[_0xe460('0x58')](_0x3d1b29[_0xe68297])[_0xe460('0x59')];var _0x10a5ef=JSON[_0xe460('0x58')](_0x3d1b29[_0xe68297])[_0xe460('0x5a')];_0x5e0f46[_0xe460('0x42')](_0xe460('0x5b'),_0x12a680,_0x10a5ef);}else{if(_0x3d1b29[_0xe68297]===_0xe460('0x5c')){_0x5e0f46[_0xe460('0x42')]('i.'+_0xe68297+_0xe460('0x5d'));}else{_0x5e0f46['and']('i.'+_0xe68297+'\x20=\x20?',_0x3d1b29[_0xe68297]);}}});}return _0x5e0f46;}function parseQueryParameters(_0x11563c,_0x4757b8,_0x54556e){var _0x1e1f91=getSqlClauses();return Promise[_0xe460('0x5e')]()[_0xe460('0x5f')](function(){return parseModelFields(_0x11563c,_0x4757b8,_0x54556e);})['then'](function(_0x4be11a){_0x1e1f91[_0xe460('0x60')][_0xe460('0x42')](_0x4be11a);return parseReadParameter(_0x4757b8['read']);})[_0xe460('0x5f')](function(_0x5003af){_0x1e1f91[_0xe460('0x41')][_0xe460('0x42')](_0x5003af);return parseTagParameter(_0x4757b8[_0xe460('0x61')]);})['then'](function(_0x50cffb){_0x1e1f91[_0xe460('0x4b')][_0xe460('0x4c')][_0xe460('0x42')](_0x50cffb);return parseSearchFilter(_0x11563c,_0x4757b8['filter']);})[_0xe460('0x5f')](function(_0x471294){_0x1e1f91[_0xe460('0x62')]=_0x471294;return _0x1e1f91;});}function checkAccountsRestrictions(_0x4bcc09,_0x542543,_0x205303){var _0x44483f=utils[_0xe460('0x7')](_0x4bcc09);var _0x585c05=_0xe460('0x63')+_['capitalize'](_0x4bcc09)+(_0x4bcc09==='chat'?_0xe460('0x64'):_0xe460('0x65'));var _0x27625d=squel[_0xe460('0x26')]();return Promise[_0xe460('0x5e')]()['then'](function(){if(_0x205303[_0xe460('0x9')]&&_0x542543[_0xe460('0x8')]===_0xe460('0x66')){return _0x542543[_0x585c05]({'attributes':['id'],'raw':!![]});}})[_0xe460('0x5f')](function(_0x5b2b41){if(_0x5b2b41){if(_0x5b2b41[_0xe460('0x19')]===0x0){_0x27625d[_0xe460('0x42')]('i.'+_0x44483f+_0xe460('0x5d'));}else{_0x27625d[_0xe460('0x42')]('i.'+_0x44483f+'\x20IN\x20?',_[_0xe460('0x1c')](_0x5b2b41,'id'));}}else if(!_0x205303[_0x44483f]){_0x27625d['and']('i.'+_0x44483f+_0xe460('0x67'));}})['then'](function(){return _0x27625d;});}function getClosedOrderClause(_0xad4c1a,_0x4efb37){var _0x493621='';var _0x1d8baf=['i.thirdDisposition',_0xe460('0x68'),_0xe460('0x69')];if(_0xad4c1a===_0xe460('0x31')){_0x1d8baf['unshift']('i.substatus');}if(_0x4efb37['closed']==='0'&&_0xad4c1a==='mail'){_0x493621=_0xe460('0x6a');}else{if(_0x4efb37['closed']==='1'){_0x1d8baf[_0xe460('0x6b')]();}_0x493621=_0xe460('0x6c')+_0x1d8baf[_0xe460('0x6d')](',\x20')+')';}return _0x493621;}function getFilteredInteractions(_0x171920,_0x5cb914,_0x574343,_0x6625ea){var _0x2e3177=utils[_0xe460('0x10')](_0x171920);var _0x1812d4=_[_0xe460('0x6e')](_0x171920)+_0xe460('0x6f');var _0x40538e=[];var _0x536e51=getTagsQuery();var _0x33e564={'type':db[_0xe460('0x70')][_0xe460('0x71')][_0xe460('0x72')],'raw':!![]};var _0x8c11b1=[];var _0x393dcc=[];return db[_0xe460('0x73')][_0xe460('0x74')](_0x536e51[_0xe460('0x75')](),_0x33e564)['then'](function(_0x3d6220){_0x40538e=_['keyBy'](_0x3d6220,'id');_0x33e564=_[_0xe460('0x76')](_0x33e564,{'model':db[_0x1812d4],'mapToModel':!![],'nest':!![]});if(_0x574343[_0xe460('0x60')]){_0x6625ea[_0xe460('0x77')]['forEach'](function(_0x4f5187){_0x5cb914[_0xe460('0xb')]('i.'+_0x4f5187);});}else{_0x5cb914[_0xe460('0xb')](_0xe460('0x78'),'unreadMessages');_0x5cb914['field']('a.key',_0xe460('0x79'));_0x5cb914[_0xe460('0xb')](_0xe460('0x7a'),_0xe460('0x7b'));if(_0x171920===_0xe460('0x31')){_0x5cb914[_0xe460('0xb')]('a.email',_0xe460('0x7c'));_0x5cb914['field']('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',_0xe460('0x7d'));_0x5cb914[_0xe460('0xb')](_0xe460('0x7e'));_0x5cb914[_0xe460('0xb')]('i.createdAt');_0x5cb914['field'](_0xe460('0x7f'));_0x5cb914['field'](_0xe460('0x80'));_0x5cb914[_0xe460('0xb')](_0xe460('0x81'));_0x5cb914['field'](_0xe460('0x82'));_0x5cb914[_0xe460('0xb')](_0xe460('0x83'));_0x5cb914[_0xe460('0xb')](_0xe460('0x84'));_0x5cb914['field']('i.subject');_0x5cb914[_0xe460('0xb')](_0xe460('0x69'));_0x5cb914[_0xe460('0xb')]('i.secondDisposition');_0x5cb914[_0xe460('0xb')]('i.thirdDisposition');_0x5cb914[_0xe460('0xb')](_0xe460('0x6a'));_0x5cb914[_0xe460('0xb')](_0xe460('0x85'));_0x5cb914['field'](_0xe460('0x86'));_0x5cb914[_0xe460('0xb')]('i.MailAccountId');_0x5cb914[_0xe460('0xb')](_0xe460('0x87'));}else if(_0x171920===_0xe460('0x88')){_0x5cb914[_0xe460('0xb')](_0xe460('0x89'),'contactName');}else{_0x5cb914[_0xe460('0xb')](_0xe460('0x8a'),_0xe460('0x7d'));}if(_0x171920!==_0xe460('0x31')){_0x5cb914['field'](_0xe460('0x8b'));}_0x5cb914[_0xe460('0xb')](_0xe460('0x8c'),_0xe460('0x8d'));_0x5cb914['field'](_0xe460('0x8e'),_0xe460('0x8f'));_0x5cb914[_0xe460('0xb')](_0xe460('0x90'),_0xe460('0x91'));_0x5cb914[_0xe460('0xb')](_0xe460('0x92'),_0xe460('0x93'));_0x5cb914[_0xe460('0xb')](_0xe460('0x94'),'Contact.mobile');_0x5cb914[_0xe460('0xb')](_0xe460('0x95'),_0xe460('0x96'));_0x5cb914[_0xe460('0xb')]('o.fullname',_0xe460('0x97'));_0x5cb914[_0xe460('0xb')]('o.internal',_0xe460('0x98'));_0x5cb914[_0xe460('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe460('0x99'));}if(_0x6625ea['limit']){_0x5cb914[_0xe460('0x9a')](_0x6625ea[_0xe460('0x9a')]);}if(_0x6625ea[_0xe460('0x9b')]){_0x5cb914[_0xe460('0x9b')](_0x6625ea[_0xe460('0x9b')]);}return db[_0xe460('0x73')][_0xe460('0x74')](_0x5cb914[_0xe460('0x75')](),_0x33e564);})[_0xe460('0x5f')](function(_0x3a3e79){_0x8c11b1=_0x3a3e79;var _0x10601b=getUsersQuery(_0x171920,_0x8c11b1);return db[_0xe460('0x73')][_0xe460('0x74')](_0x10601b[_0xe460('0x75')](),_0x33e564);})[_0xe460('0x5f')](function(_0xb1264f){_0x393dcc=_[_0xe460('0x9c')](_0xb1264f,_0x2e3177);if(_0x171920==='mail'){return db['Setting'][_0xe460('0x9d')]({'attributes':[_0xe460('0x9e')],'raw':!![]});}})[_0xe460('0x5f')](function(_0x16448f){var _0xab8477=_0x16448f?_0x16448f[_0xe460('0x9e')]:undefined;var _0x32861b=_0x8c11b1[_0xe460('0x1c')](function(_0x1b4b50){return updateInteraction(_0x1b4b50,_0x40538e,_0x393dcc,_0xab8477);});return Promise[_0xe460('0x9f')](_0x32861b);});}function countFilteredInteractions(_0x338e65,_0x4d2e72){var _0x568833=_0x338e65[_0xe460('0xa0')]();_0x568833[_0xe460('0xb')](_0xe460('0xa1'));_0x568833['field'](_0xe460('0x78'),_0xe460('0x40'));var _0x4e0c8d=utils[_0xe460('0x27')](_0x4d2e72);if(!_[_0xe460('0xa2')](_0x4e0c8d)){_0x568833[_0xe460('0x1a')](_0xe460('0xa3'),_0x4e0c8d);}var _0xdb0ae6={'type':db[_0xe460('0x70')][_0xe460('0x71')][_0xe460('0x72')],'raw':!![]};return db[_0xe460('0x73')][_0xe460('0x74')](_0x568833[_0xe460('0x75')](),_0xdb0ae6);}module['exports']={'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 0be6718..9a42b88 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 _0xeaa2=['out','plainBody','then','lastMsgText','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','forEach','push','waiting','talking','unmanaged','abandoned','total','closed','disposition','UserId','answered','MailMessage','findOne'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xeaa2,0x10f));var _0x2eaa=function(_0x4217e5,_0x4b69e6){_0x4217e5=_0x4217e5-0x0;var _0xb02bc5=_0xeaa2[_0x4217e5];return _0xb02bc5;};'use strict';var _=require(_0x2eaa('0x0'));var db=require(_0x2eaa('0x1'))['db'];function getInteractionUsers(_0x4f57eb,_0x56ef75){return new Promise(function(_0x3550a9,_0x4c3a23){try{var _0x54699b=[];if(_0x56ef75[_0x4f57eb]){_0x54699b=_0x56ef75[_0x4f57eb][_0x2eaa('0x2')](function(_0x234c70){return{'id':_0x234c70['id'],'fullname':_0x234c70[_0x2eaa('0x3')]};});}return _0x3550a9(_0x54699b);}catch(_0xdde83a){_0x4c3a23(_0xdde83a);}});}function getInteractionTags(_0x129773,_0x308cfa){var _0x255e15=[];if(_0x129773){_0x129773['split'](',')[_0x2eaa('0x4')](function(_0x34a956){_0x255e15[_0x2eaa('0x5')](_0x308cfa[_0x34a956]);});}return _0x255e15;}function updateWaitingCounter(_0x51c087){if(_0x51c087[_0x2eaa('0x6')]){_0x51c087[_0x2eaa('0x6')]-=0x1;}}function updateInteractionCounters(_0x591b0b){_0x591b0b[_0x2eaa('0x6')]=0x0;_0x591b0b[_0x2eaa('0x7')]=0x0;_0x591b0b['answered']=0x0;_0x591b0b[_0x2eaa('0x8')]=0x0;_0x591b0b[_0x2eaa('0x9')]=0x0;_0x591b0b[_0x2eaa('0xa')]=0x0;if(_0x591b0b[_0x2eaa('0xb')]){if(_0x591b0b[_0x2eaa('0xc')]===_0x2eaa('0x9')){_0x591b0b[_0x2eaa('0x9')]+=0x1;updateWaitingCounter(_0x591b0b);}if(_0x591b0b[_0x2eaa('0xd')]){_0x591b0b[_0x2eaa('0xe')]+=0x1;if(_0x591b0b[_0x2eaa('0x7')]){_0x591b0b[_0x2eaa('0x7')]-=0x1;}}else{if(_0x591b0b[_0x2eaa('0xc')]){_0x591b0b[_0x2eaa('0x8')]+=0x1;updateWaitingCounter(_0x591b0b);}}}else{if(!_0x591b0b['UserId']){_0x591b0b[_0x2eaa('0x6')]+=0x1;}if(_0x591b0b[_0x2eaa('0xd')]){_0x591b0b[_0x2eaa('0x7')]+=0x1;updateWaitingCounter(_0x591b0b);}}_0x591b0b[_0x2eaa('0xa')]+=0x1;return _0x591b0b;}function getLastMessageText(_0x11af13){return db[_0x2eaa('0xf')][_0x2eaa('0x10')]({'where':{'$and':[{'MailInteractionId':_0x11af13['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2eaa('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2eaa('0x12')],'order':'-id','raw':!![]})[_0x2eaa('0x13')](function(_0x3328ba){if(_0x3328ba&&_0x3328ba[_0x2eaa('0x12')]){_0x11af13[_0x2eaa('0x14')]=_['trimStart'](_0x3328ba['plainBody']);}return _0x11af13;})['catch'](function(_0x466886){throw _0x466886;});}exports['updateInteraction']=function(_0x1d4325,_0x417f99,_0x532514,_0x2db450){return new Promise(function(_0x38f92f,_0x5a042a){return getInteractionUsers(_0x1d4325['id'],_0x532514)[_0x2eaa('0x13')](function(_0x390fd2){_0x1d4325[_0x2eaa('0x15')]=_0x390fd2;return getInteractionTags(_0x1d4325[_0x2eaa('0x16')],_0x417f99);})['then'](function(_0x527d1a){_0x1d4325[_0x2eaa('0x17')]=_0x527d1a;delete _0x1d4325[_0x2eaa('0x16')];return updateInteractionCounters(_0x1d4325);})[_0x2eaa('0x13')](function(_0x4f609f){if(_0x2db450){return getLastMessageText(_0x4f609f);}else{return _0x4f609f;}})[_0x2eaa('0x13')](function(_0x1d4742){_0x38f92f(_0x1d4742);})['catch'](function(_0x199407){_0x5a042a(_0x199407);});});}; \ No newline at end of file +var _0xd057=['answered','talking','total','MailMessage','out','plainBody','-id','then','trimStart','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','push','waiting','unmanaged','abandoned','disposition','UserId'];(function(_0x2af160,_0x765b1){var _0x439d67=function(_0x4d26af){while(--_0x4d26af){_0x2af160['push'](_0x2af160['shift']());}};_0x439d67(++_0x765b1);}(_0xd057,0x12d));var _0x7d05=function(_0x19fe48,_0x3031c7){_0x19fe48=_0x19fe48-0x0;var _0x4358fd=_0xd057[_0x19fe48];return _0x4358fd;};'use strict';var _=require(_0x7d05('0x0'));var db=require(_0x7d05('0x1'))['db'];function getInteractionUsers(_0x127e9f,_0x1316e6){return new Promise(function(_0x226d00,_0x440043){try{var _0x28f968=[];if(_0x1316e6[_0x127e9f]){_0x28f968=_0x1316e6[_0x127e9f][_0x7d05('0x2')](function(_0x4860db){return{'id':_0x4860db['id'],'fullname':_0x4860db[_0x7d05('0x3')]};});}return _0x226d00(_0x28f968);}catch(_0x1fd28d){_0x440043(_0x1fd28d);}});}function getInteractionTags(_0x35a53c,_0x59275e){var _0x15beb4=[];if(_0x35a53c){_0x35a53c[_0x7d05('0x4')](',')['forEach'](function(_0x43bba8){_0x15beb4[_0x7d05('0x5')](_0x59275e[_0x43bba8]);});}return _0x15beb4;}function updateWaitingCounter(_0xc5ef6a){if(_0xc5ef6a[_0x7d05('0x6')]){_0xc5ef6a[_0x7d05('0x6')]-=0x1;}}function updateInteractionCounters(_0x263a66){_0x263a66[_0x7d05('0x6')]=0x0;_0x263a66['talking']=0x0;_0x263a66['answered']=0x0;_0x263a66[_0x7d05('0x7')]=0x0;_0x263a66[_0x7d05('0x8')]=0x0;_0x263a66['total']=0x0;if(_0x263a66['closed']){if(_0x263a66[_0x7d05('0x9')]===_0x7d05('0x8')){_0x263a66[_0x7d05('0x8')]+=0x1;updateWaitingCounter(_0x263a66);}if(_0x263a66[_0x7d05('0xa')]){_0x263a66[_0x7d05('0xb')]+=0x1;if(_0x263a66[_0x7d05('0xc')]){_0x263a66[_0x7d05('0xc')]-=0x1;}}else{if(_0x263a66[_0x7d05('0x9')]){_0x263a66[_0x7d05('0x7')]+=0x1;updateWaitingCounter(_0x263a66);}}}else{if(!_0x263a66[_0x7d05('0xa')]){_0x263a66[_0x7d05('0x6')]+=0x1;}if(_0x263a66[_0x7d05('0xa')]){_0x263a66['talking']+=0x1;updateWaitingCounter(_0x263a66);}}_0x263a66[_0x7d05('0xd')]+=0x1;return _0x263a66;}function getLastMessageText(_0x555b50){return db[_0x7d05('0xe')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x555b50['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x7d05('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x7d05('0x10')],'order':_0x7d05('0x11'),'raw':!![]})[_0x7d05('0x12')](function(_0x3771dd){if(_0x3771dd&&_0x3771dd[_0x7d05('0x10')]){_0x555b50['lastMsgText']=_[_0x7d05('0x13')](_0x3771dd[_0x7d05('0x10')]);}return _0x555b50;})[_0x7d05('0x14')](function(_0x5b85ac){throw _0x5b85ac;});}exports[_0x7d05('0x15')]=function(_0x1b89f8,_0x1d8799,_0x1d0c53,_0x5d7fd5){return new Promise(function(_0x49f2e6,_0x38c46d){return getInteractionUsers(_0x1b89f8['id'],_0x1d0c53)['then'](function(_0x1164f8){_0x1b89f8['Users']=_0x1164f8;return getInteractionTags(_0x1b89f8[_0x7d05('0x16')],_0x1d8799);})[_0x7d05('0x12')](function(_0x46f882){_0x1b89f8[_0x7d05('0x17')]=_0x46f882;delete _0x1b89f8[_0x7d05('0x16')];return updateInteractionCounters(_0x1b89f8);})[_0x7d05('0x12')](function(_0x3f6cf1){if(_0x5d7fd5){return getLastMessageText(_0x3f6cf1);}else{return _0x3f6cf1;}})['then'](function(_0x6d0229){_0x49f2e6(_0x6d0229);})[_0x7d05('0x14')](function(_0x311ec6){_0x38c46d(_0x311ec6);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 1128c45..aac6080 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 _0x6cf4=['exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','_interactions','user_has_','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','Interaction','then','update','info','error'];(function(_0x54b129,_0x2ce2b7){var _0x465d5d=function(_0x18e5ff){while(--_0x18e5ff){_0x54b129['push'](_0x54b129['shift']());}};_0x465d5d(++_0x2ce2b7);}(_0x6cf4,0xa9));var _0x46cf=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x6cf4[_0x170772];return _0x3ef69c;};'use strict';var _=require(_0x46cf('0x0'));var db=require(_0x46cf('0x1'))['db'];var loggers={'openchannel':require(_0x46cf('0x2'))(_0x46cf('0x3')),'mail':require(_0x46cf('0x2'))(_0x46cf('0x4')),'fax':require(_0x46cf('0x2'))('fax-interactions'),'sms':require(_0x46cf('0x2'))(_0x46cf('0x5')),'chat':require(_0x46cf('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x1e0d38){return _[_0x46cf('0x6')](_0x1e0d38)+(_0x1e0d38===_0x46cf('0x7')?_0x46cf('0x8'):_0x46cf('0x9'))+'Id';}function getInteractionFK(_0x91e63e){return _[_0x46cf('0x6')](_0x91e63e)+_0x46cf('0xa');}function getInteractionId(_0x2e0ddc,_0x5cc76e,_0x57570b){if(_0x2e0ddc&&_0x2e0ddc[_[_0x46cf('0xb')](_0x57570b)+_0x46cf('0xa')]){return _0x2e0ddc[_[_0x46cf('0xb')](_0x57570b)+_0x46cf('0xa')];}else if(_0x2e0ddc&&_0x2e0ddc['id']){return _0x2e0ddc['id'];}else if(_0x5cc76e&&_0x5cc76e['id']){return _0x5cc76e['id'];}else{return _0x46cf('0xc');}}function getInteractionsTables(_0x6f2ac1){return{'accounts':_0x6f2ac1+'_'+(_0x6f2ac1===_0x46cf('0x7')?'websites':'accounts'),'interactions':_0x6f2ac1+_0x46cf('0xd'),'interactionsTags':_0x6f2ac1+'_interaction_has_tags','messages':_0x6f2ac1+'_messages','userInteractions':_0x46cf('0xe')+_0x6f2ac1+_0x46cf('0xd')};}function getSelectedTags(_0x7a6fa4){var _0x3daa9f=[];if(_0x7a6fa4){_0x3daa9f=Array['isArray'](_0x7a6fa4)?_0x7a6fa4:[_0x7a6fa4];}return _0x3daa9f;}function log(_0xba9fb0,_0x4a7793,_0x2ace2c,_0xa12282,_0x2ff2dc,_0x806832){loggers[_0x2ff2dc[_0x46cf('0xf')]()][_0xba9fb0](_0x46cf('0x10'),_0x806832['toUpperCase'](),_0x4a7793?_0x4a7793['id']:null,_0x4a7793?_0x4a7793['name']:null,_0x4a7793?_0x4a7793['role']:null,getInteractionId(_0x2ace2c,_0xa12282,_0x2ff2dc),_0x2ace2c?JSON[_0x46cf('0x11')](_0x2ace2c):'null');}function updateUser(_0x1ba903,_0xc3500d,_0x4f3505,_0x1e0de9,_0x20c12a){db[_[_0x46cf('0xb')](_0x1e0de9)+_0x46cf('0x12')]['findOne']({'where':{'id':getInteractionId(_0xc3500d,_0x4f3505,_0x1e0de9)}})[_0x46cf('0x13')](function(_0x3310b7){if(_0x3310b7){return _0x3310b7[_0x46cf('0x14')]({'UserId':_0x1ba903?_0x1ba903['id']:null});}})[_0x46cf('0x13')](function(_0x4e0be2){if(_0x4e0be2){log(_0x46cf('0x15'),_0x1ba903,_0xc3500d,_0x4f3505,_0x1e0de9,_0x20c12a);}})['catch'](function(){log(_0x46cf('0x16'),_0x1ba903,_0xc3500d,_0x4f3505,_0x1e0de9,_0x20c12a);});}module[_0x46cf('0x17')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xd806=['InteractionId','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','whatsapp-interactions','capitalize','chat','Website','Account'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd806,0x1d5));var _0x6d80=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xd806[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x6d80('0x0'));var db=require(_0x6d80('0x1'))['db'];var loggers={'openchannel':require(_0x6d80('0x2'))(_0x6d80('0x3')),'mail':require(_0x6d80('0x2'))(_0x6d80('0x4')),'fax':require(_0x6d80('0x2'))(_0x6d80('0x5')),'sms':require(_0x6d80('0x2'))('sms-interactions'),'chat':require(_0x6d80('0x2'))('chat-interactions'),'whatsapp':require(_0x6d80('0x2'))(_0x6d80('0x6'))};function getAccountFK(_0x26ed57){return _[_0x6d80('0x7')](_0x26ed57)+(_0x26ed57===_0x6d80('0x8')?_0x6d80('0x9'):_0x6d80('0xa'))+'Id';}function getInteractionFK(_0x1d28df){return _['capitalize'](_0x1d28df)+_0x6d80('0xb');}function getInteractionId(_0x218429,_0x47c2c2,_0x2d0dc2){if(_0x218429&&_0x218429[_['upperFirst'](_0x2d0dc2)+'InteractionId']){return _0x218429[_['upperFirst'](_0x2d0dc2)+'InteractionId'];}else if(_0x218429&&_0x218429['id']){return _0x218429['id'];}else if(_0x47c2c2&&_0x47c2c2['id']){return _0x47c2c2['id'];}else{return _0x6d80('0xc');}}function getInteractionsTables(_0x4b11ae){return{'accounts':_0x4b11ae+'_'+(_0x4b11ae==='chat'?_0x6d80('0xd'):_0x6d80('0xe')),'interactions':_0x4b11ae+_0x6d80('0xf'),'interactionsTags':_0x4b11ae+_0x6d80('0x10'),'messages':_0x4b11ae+_0x6d80('0x11'),'userInteractions':_0x6d80('0x12')+_0x4b11ae+_0x6d80('0xf')};}function getSelectedTags(_0x12d83e){var _0x582ac5=[];if(_0x12d83e){_0x582ac5=Array[_0x6d80('0x13')](_0x12d83e)?_0x12d83e:[_0x12d83e];}return _0x582ac5;}function log(_0x46ecfc,_0x52f598,_0x26d1d4,_0x51a388,_0x3354b7,_0x15c9e3){loggers[_0x3354b7[_0x6d80('0x14')]()][_0x46ecfc](_0x6d80('0x15'),_0x15c9e3['toUpperCase'](),_0x52f598?_0x52f598['id']:null,_0x52f598?_0x52f598['name']:null,_0x52f598?_0x52f598[_0x6d80('0x16')]:null,getInteractionId(_0x26d1d4,_0x51a388,_0x3354b7),_0x26d1d4?JSON[_0x6d80('0x17')](_0x26d1d4):_0x6d80('0x18'));}function updateUser(_0x48a91e,_0x5f1bc6,_0x180fe6,_0x4c3eaf,_0x421823){db[_['upperFirst'](_0x4c3eaf)+'Interaction'][_0x6d80('0x19')]({'where':{'id':getInteractionId(_0x5f1bc6,_0x180fe6,_0x4c3eaf)}})[_0x6d80('0x1a')](function(_0x117420){if(_0x117420){return _0x117420[_0x6d80('0x1b')]({'UserId':_0x48a91e?_0x48a91e['id']:null});}})['then'](function(_0x51e2e5){if(_0x51e2e5){log(_0x6d80('0x1c'),_0x48a91e,_0x5f1bc6,_0x180fe6,_0x4c3eaf,_0x421823);}})[_0x6d80('0x1d')](function(){log(_0x6d80('0x1e'),_0x48a91e,_0x5f1bc6,_0x180fe6,_0x4c3eaf,_0x421823);});}module[_0x6d80('0x1f')]={'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 3b03fd8..59bb12b 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 _0x4ca9=['util','composable-middleware','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','admin','user','isUserLimit','crypto'];(function(_0x1cabe1,_0x209019){var _0x4ac6e5=function(_0x4832c5){while(--_0x4832c5){_0x1cabe1['push'](_0x1cabe1['shift']());}};_0x4ac6e5(++_0x209019);}(_0x4ca9,0x1ca));var _0x94ca=function(_0x1f774c,_0x51a701){_0x1f774c=_0x1f774c-0x0;var _0x5855c3=_0x4ca9[_0x1f774c];return _0x5855c3;};'use strict';var crypto=require(_0x94ca('0x0'));var util=require(_0x94ca('0x1'));var compose=require(_0x94ca('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x94ca('0x3'));function getValueFromLicense(_0xee127d,_0x475b67){if(_0xee127d&&_0x475b67){if(_0x475b67[_0x94ca('0x4')]&&_0x475b67[_0x94ca('0x5')]){var _0x53ed05=_0x475b67[_0x94ca('0x4')];var _0x5baf07=_0x475b67[_0x94ca('0x5')];var _0x5c74ba=_0x53ed05[_0x94ca('0x6')]('-')[0x4];var _0x484e0f=_0x53ed05[_0x94ca('0x6')]('-')[0x0];var _0x236e91=crypto[_0x94ca('0x7')](_0x94ca('0x8'),util[_0x94ca('0x9')](_0x94ca('0xa'),_0x5c74ba,_0x53ed05,_0x484e0f));var _0x5c4cf4=_0x236e91[_0x94ca('0xb')](_0x5baf07,_0x94ca('0xc'),_0x94ca('0xd'));_0x5c4cf4+=_0x236e91[_0x94ca('0xe')](_0x94ca('0xd'));var _0x50350b=JSON[_0x94ca('0xf')](_0x5c4cf4);return _0x50350b[_0x94ca('0x10')](_0xee127d)?_0x50350b[_0xee127d]:null;}}return null;}function isLimit(_0xb51c5c,_0x3fb492,_0x5e2c17,_0xd7ce01){var _0x5cb02a=_0x3fb492;return compose()[_0x94ca('0x11')](function(_0x57a987,_0x112543,_0x2f82a5){return db[_0x94ca('0x12')][_0x94ca('0x13')]({'where':{'id':0x1},'raw':!![]})[_0x94ca('0x14')](function(_0x2def52){var _0x3580ec=getValueFromLicense(_0xb51c5c,_0x2def52);return _0x3580ec?_0x3580ec:_0x5cb02a;})['then'](function(_0x35be42){_0x5cb02a=_0x35be42;return _0x5e2c17['count'](_0xd7ce01);})['then'](function(_0x15cc8e){if(_0x15cc8e>=_0x5cb02a){return _0x112543[_0x94ca('0x15')](0x193)['json']({'message':util[_0x94ca('0x9')](_0x94ca('0x16'),_0xb51c5c)});}_0x2f82a5();})['catch'](function(_0x38a48b){_0x2f82a5(_0x38a48b);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x94ca('0x17')],{'where':{'$or':[{'role':_0x94ca('0x18')},{'role':_0x94ca('0x19')}]}});}exports[_0x94ca('0x1a')]=isUserLimit; \ No newline at end of file +var _0xac0f=['base64','utf8','final','parse','use','License','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','util','../../config/environment','data1','split','createDecipher','format','update'];(function(_0x541a78,_0x219591){var _0x3107f3=function(_0x153053){while(--_0x153053){_0x541a78['push'](_0x541a78['shift']());}};_0x3107f3(++_0x219591);}(_0xac0f,0x11f));var _0xfac0=function(_0x39a5a3,_0xc92a9f){_0x39a5a3=_0x39a5a3-0x0;var _0x526aee=_0xac0f[_0x39a5a3];return _0x526aee;};'use strict';var crypto=require('crypto');var util=require(_0xfac0('0x0'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0xfac0('0x1'));function getValueFromLicense(_0x31c00a,_0x2a5c2a){if(_0x31c00a&&_0x2a5c2a){if(_0x2a5c2a['data1']&&_0x2a5c2a['license']){var _0x3b130e=_0x2a5c2a[_0xfac0('0x2')];var _0xeaa6f2=_0x2a5c2a['license'];var _0x4736ca=_0x3b130e[_0xfac0('0x3')]('-')[0x4];var _0x2c8ba2=_0x3b130e[_0xfac0('0x3')]('-')[0x0];var _0x5b9c41=crypto[_0xfac0('0x4')]('aes-256-ctr',util[_0xfac0('0x5')]('%s:%s:%s',_0x4736ca,_0x3b130e,_0x2c8ba2));var _0x353d26=_0x5b9c41[_0xfac0('0x6')](_0xeaa6f2,_0xfac0('0x7'),_0xfac0('0x8'));_0x353d26+=_0x5b9c41[_0xfac0('0x9')](_0xfac0('0x8'));var _0xb47f77=JSON[_0xfac0('0xa')](_0x353d26);return _0xb47f77['hasOwnProperty'](_0x31c00a)?_0xb47f77[_0x31c00a]:null;}}return null;}function isLimit(_0xdc03b5,_0x54ced8,_0x63b78a,_0xa6281){var _0x2479c5=_0x54ced8;return compose()[_0xfac0('0xb')](function(_0x3586af,_0x265342,_0x4ff5a5){return db[_0xfac0('0xc')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xfac0('0xd')](function(_0x466bdf){var _0x3f8bbb=getValueFromLicense(_0xdc03b5,_0x466bdf);return _0x3f8bbb?_0x3f8bbb:_0x2479c5;})[_0xfac0('0xd')](function(_0x67cb23){_0x2479c5=_0x67cb23;return _0x63b78a['count'](_0xa6281);})[_0xfac0('0xd')](function(_0x27cb13){if(_0x27cb13>=_0x2479c5){return _0x265342[_0xfac0('0xe')](0x193)['json']({'message':util[_0xfac0('0x5')](_0xfac0('0xf'),_0xdc03b5)});}_0x4ff5a5();})[_0xfac0('0x10')](function(_0x12b514){_0x4ff5a5(_0x12b514);});});}function isUserLimit(){return isLimit(_0xfac0('0x11'),0x1,db['User'],{'where':{'$or':[{'role':_0xfac0('0x12')},{'role':_0xfac0('0x13')}]}});}exports[_0xfac0('0x14')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 2694d08..2e021cb 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 _0x7255=['castTo','CAST(','field','text','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$between','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','forEach','shift','match','filter','map','push','buildExpression','operator','value','includes','$gt','$lte','add','format','YYYY-MM-DD'];(function(_0x5a1724,_0x5830cc){var _0x2bfecf=function(_0x4424db){while(--_0x4424db){_0x5a1724['push'](_0x5a1724['shift']());}};_0x2bfecf(++_0x5830cc);}(_0x7255,0xf0));var _0x5725=function(_0x55f5bc,_0x4c54c2){_0x55f5bc=_0x55f5bc-0x0;var _0x576bf9=_0x7255[_0x55f5bc];return _0x576bf9;};'use strict';var _=require(_0x5725('0x0'));var moment=require(_0x5725('0x1'));exports[_0x5725('0x2')]=function(_0x317e62){var _0x2e6b84={'conditions':[]};_0x2e6b84[_0x5725('0x3')]=_[_0x5725('0x4')](_0x317e62,_0x5725('0x5'))?'or':_0x5725('0x6');var _0x2a5351=_0x317e62[_0x5725('0x7')]('[$and]','')[_0x5725('0x7')](_0x5725('0x5'),'')[_0x5725('0x8')]('||');for(var _0x343016=0x0;_0x343016<_0x2a5351[_0x5725('0x9')];_0x343016++){var _0x3d2847=_0x2a5351[_0x343016][_0x5725('0x8')](':=');var _0x5b34f4=_0x3d2847[0x0];var _0x548f38=_0x3d2847['slice'](0x1);_0x548f38[_0x5725('0xa')](function(_0x4f1d00){var _0x594735=_0x4f1d00['split']('[')[_0x5725('0xb')]();var _0x565622=_0x4f1d00[_0x5725('0xc')](/\[(.*?)\]/g);_0x565622[_0x5725('0xa')](function(_0x28cd27){var _0x17ff93=_0x28cd27['split']('[')[_0x5725('0xd')](function(_0x171f3e){return _0x171f3e['indexOf'](']')>-0x1;})[_0x5725('0xe')](function(_0x59c201){return _0x59c201[_0x5725('0x8')](']')[0x0];})[0x0];_0x2e6b84['conditions'][_0x5725('0xf')]({'field':_0x5b34f4,'operator':_0x594735,'value':_0x17ff93});});});}return _0x2e6b84;};exports[_0x5725('0x10')]=function(_0x4383fd,_0x1aabfb,_0x339632){var _0x3af8b7={};if(_0x1aabfb==='DATE'){if(_0x339632['operator']==='$eq'){_0x339632[_0x5725('0x11')]='$between';_0x339632['value']+=','+_0x339632[_0x5725('0x12')];}else if(_[_0x5725('0x13')]([_0x5725('0x14'),_0x5725('0x15')],_0x339632[_0x5725('0x11')])){_0x339632[_0x5725('0x12')]=moment(_0x339632['value'])[_0x5725('0x16')](0x1,'days')[_0x5725('0x17')](_0x5725('0x18'));}}if(_0x339632[_0x5725('0x19')]){_0x1aabfb=_0x339632[_0x5725('0x19')];_0x3af8b7['text']=_0x5725('0x1a')+_0x4383fd+'.'+_0x339632[_0x5725('0x1b')]+'\x20AS\x20'+_0x339632[_0x5725('0x19')]+')\x20'+parseOperator(_0x339632[_0x5725('0x11')]);}else{_0x3af8b7[_0x5725('0x1c')]=_0x4383fd+'.'+_0x339632[_0x5725('0x1b')]+'\x20'+parseOperator(_0x339632[_0x5725('0x11')]);}if(_['includes'](['$ne',_0x5725('0x1d')],_0x339632[_0x5725('0x11')]))_0x3af8b7[_0x5725('0x1c')]='('+_0x3af8b7[_0x5725('0x1c')]+_0x5725('0x1e')+_0x4383fd+'.'+_0x339632[_0x5725('0x1b')]+_0x5725('0x1f');_0x3af8b7[_0x5725('0x12')]=parseValue(_0x1aabfb,_0x339632['operator'],_0x339632[_0x5725('0x12')]);return _0x3af8b7;};function parseOperator(_0x33b475){var _0x1de2a3;switch(_0x33b475){case _0x5725('0x20'):_0x1de2a3='IN\x20?';break;case _0x5725('0x1d'):_0x1de2a3=_0x5725('0x21');break;case'$eq':_0x1de2a3=_0x5725('0x22');break;case _0x5725('0x23'):_0x1de2a3=_0x5725('0x24');break;case _0x5725('0x25'):case _0x5725('0x26'):case'$endsWith':_0x1de2a3=_0x5725('0x27');break;case _0x5725('0x28'):_0x1de2a3=_0x5725('0x29');break;case _0x5725('0x14'):_0x1de2a3=_0x5725('0x2a');break;case _0x5725('0x15'):_0x1de2a3=_0x5725('0x2b');break;case _0x5725('0x2c'):_0x1de2a3=_0x5725('0x2d');break;case _0x5725('0x2e'):_0x1de2a3='BETWEEN\x20?\x20AND\x20?';break;}return _0x1de2a3;}function parseValue(_0x64efc7,_0x122959,_0x5324ca){var _0x4382a2={'start':undefined,'end':undefined};switch(_0x122959){case _0x5725('0x20'):case'$notIn':_0x4382a2[_0x5725('0x2f')]=_0x5324ca[_0x5725('0x8')](',');break;case _0x5725('0x25'):_0x4382a2['start']='%'+_0x5324ca+'%';break;case _0x5725('0x26'):_0x4382a2[_0x5725('0x2f')]=_0x5324ca+'%';break;case'$endsWith':_0x4382a2[_0x5725('0x2f')]='%'+_0x5324ca;break;case _0x5725('0x2e'):var _0x47bc60=_0x5324ca[_0x5725('0x8')](',');var _0x5324ca=_0x47bc60['shift']();var _0x16b3c0=_0x47bc60[_0x5725('0x30')]();if(_0x64efc7==='DATE'){_0x5324ca=moment(_0x5324ca)[_0x5725('0x31')](0x0,!![])[_0x5725('0x17')]();_0x16b3c0=moment(_0x16b3c0)['utcOffset'](0x0,!![])[_0x5725('0x16')](0x17,_0x5725('0x32'))[_0x5725('0x16')](0x3b,_0x5725('0x33'))['add'](0x3b,_0x5725('0x34'))['format']();}_0x4382a2={'start':_0x5324ca,'end':_0x16b3c0};break;default:_0x4382a2['start']=_0x5324ca;break;}return _0x4382a2;} \ No newline at end of file +var _0xa112=['push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','hours','add','lodash','moment','parseSearch','sqlOperator','[$or]','and','[$and]','replace','split','length','slice','forEach','shift','match','map','conditions'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa112,0x13a));var _0x2a11=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xa112[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x2a11('0x0'));var moment=require(_0x2a11('0x1'));exports[_0x2a11('0x2')]=function(_0xdfb99d){var _0x70022b={'conditions':[]};_0x70022b[_0x2a11('0x3')]=_['startsWith'](_0xdfb99d,_0x2a11('0x4'))?'or':_0x2a11('0x5');var _0x251644=_0xdfb99d['replace'](_0x2a11('0x6'),'')[_0x2a11('0x7')]('[$or]','')[_0x2a11('0x8')]('||');for(var _0x29ea11=0x0;_0x29ea11<_0x251644[_0x2a11('0x9')];_0x29ea11++){var _0x3a20c5=_0x251644[_0x29ea11]['split'](':=');var _0x365467=_0x3a20c5[0x0];var _0x31827f=_0x3a20c5[_0x2a11('0xa')](0x1);_0x31827f[_0x2a11('0xb')](function(_0x4a83e8){var _0x5a0845=_0x4a83e8[_0x2a11('0x8')]('[')[_0x2a11('0xc')]();var _0x583328=_0x4a83e8[_0x2a11('0xd')](/\[(.*?)\]/g);_0x583328['forEach'](function(_0x2ba52e){var _0x463776=_0x2ba52e[_0x2a11('0x8')]('[')['filter'](function(_0x3c8526){return _0x3c8526['indexOf'](']')>-0x1;})[_0x2a11('0xe')](function(_0x13bf0d){return _0x13bf0d[_0x2a11('0x8')](']')[0x0];})[0x0];_0x70022b[_0x2a11('0xf')][_0x2a11('0x10')]({'field':_0x365467,'operator':_0x5a0845,'value':_0x463776});});});}return _0x70022b;};exports[_0x2a11('0x11')]=function(_0x2f38ec,_0x2b3b97,_0x321e9c){var _0x2174e6={};if(_0x2b3b97===_0x2a11('0x12')){if(_0x321e9c[_0x2a11('0x13')]===_0x2a11('0x14')){_0x321e9c[_0x2a11('0x13')]=_0x2a11('0x15');_0x321e9c[_0x2a11('0x16')]+=','+_0x321e9c[_0x2a11('0x16')];}else if(_[_0x2a11('0x17')]([_0x2a11('0x18'),_0x2a11('0x19')],_0x321e9c[_0x2a11('0x13')])){_0x321e9c[_0x2a11('0x16')]=moment(_0x321e9c['value'])['add'](0x1,'days')['format']('YYYY-MM-DD');}}if(_0x321e9c[_0x2a11('0x1a')]){_0x2b3b97=_0x321e9c[_0x2a11('0x1a')];_0x2174e6[_0x2a11('0x1b')]=_0x2a11('0x1c')+_0x2f38ec+'.'+_0x321e9c['field']+_0x2a11('0x1d')+_0x321e9c['castTo']+')\x20'+parseOperator(_0x321e9c[_0x2a11('0x13')]);}else{_0x2174e6['text']=_0x2f38ec+'.'+_0x321e9c[_0x2a11('0x1e')]+'\x20'+parseOperator(_0x321e9c['operator']);}if(_[_0x2a11('0x17')]([_0x2a11('0x1f'),_0x2a11('0x20')],_0x321e9c['operator']))_0x2174e6[_0x2a11('0x1b')]='('+_0x2174e6[_0x2a11('0x1b')]+_0x2a11('0x21')+_0x2f38ec+'.'+_0x321e9c[_0x2a11('0x1e')]+_0x2a11('0x22');_0x2174e6[_0x2a11('0x16')]=parseValue(_0x2b3b97,_0x321e9c[_0x2a11('0x13')],_0x321e9c['value']);return _0x2174e6;};function parseOperator(_0x2b218a){var _0xca3aba;switch(_0x2b218a){case _0x2a11('0x23'):_0xca3aba=_0x2a11('0x24');break;case _0x2a11('0x20'):_0xca3aba=_0x2a11('0x25');break;case _0x2a11('0x14'):_0xca3aba=_0x2a11('0x26');break;case _0x2a11('0x1f'):_0xca3aba=_0x2a11('0x27');break;case'$substring':case _0x2a11('0x28'):case _0x2a11('0x29'):_0xca3aba=_0x2a11('0x2a');break;case _0x2a11('0x2b'):_0xca3aba=_0x2a11('0x2c');break;case _0x2a11('0x18'):_0xca3aba=_0x2a11('0x2d');break;case'$lte':_0xca3aba='<=\x20?';break;case _0x2a11('0x2e'):_0xca3aba=_0x2a11('0x2f');break;case _0x2a11('0x15'):_0xca3aba=_0x2a11('0x30');break;}return _0xca3aba;}function parseValue(_0x47b51f,_0x2f561a,_0x3872df){var _0x109536={'start':undefined,'end':undefined};switch(_0x2f561a){case _0x2a11('0x23'):case'$notIn':_0x109536[_0x2a11('0x31')]=_0x3872df['split'](',');break;case _0x2a11('0x32'):_0x109536[_0x2a11('0x31')]='%'+_0x3872df+'%';break;case'$startsWith':_0x109536[_0x2a11('0x31')]=_0x3872df+'%';break;case _0x2a11('0x29'):_0x109536[_0x2a11('0x31')]='%'+_0x3872df;break;case _0x2a11('0x15'):var _0x541459=_0x3872df[_0x2a11('0x8')](',');var _0x3872df=_0x541459[_0x2a11('0xc')]();var _0x284e1b=_0x541459[_0x2a11('0x33')]();if(_0x47b51f===_0x2a11('0x12')){_0x3872df=moment(_0x3872df)[_0x2a11('0x34')](0x0,!![])['format']();_0x284e1b=moment(_0x284e1b)[_0x2a11('0x34')](0x0,!![])['add'](0x17,_0x2a11('0x35'))[_0x2a11('0x36')](0x3b,'minutes')['add'](0x3b,'seconds')['format']();}_0x109536={'start':_0x3872df,'end':_0x284e1b};break;default:_0x109536[_0x2a11('0x31')]=_0x3872df;break;}return _0x109536;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 26a2709..70fbab4 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 _0x2af7=['split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','utc','format','YYYY-MM-DD','subtract','name','isArray','limit','offset','sort','map','indexOf','priority','cast','col','substr','DESC','ASC','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','match','\x22{EXPR}\x22','replace','push','{EXPR}','join','getOptions','$id','query','model','intersection','attributes','order','pick','filter','object','value','where','merge','lower','lodash','sequelize','moment','parse','keys','includes','fields'];(function(_0x1be4b5,_0x3db99c){var _0xf494d0=function(_0x1d2d81){while(--_0x1d2d81){_0x1be4b5['push'](_0x1be4b5['shift']());}};_0xf494d0(++_0x3db99c);}(_0x2af7,0x125));var _0x72af=function(_0x977b8a,_0x8f7a63){_0x977b8a=_0x977b8a-0x0;var _0x3b782b=_0x2af7[_0x977b8a];return _0x3b782b;};'use strict';var _=require(_0x72af('0x0'));var sequelize=require(_0x72af('0x1'));var moment=require(_0x72af('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x7ac55e){var _0x5ee948=['ne'];try{var _0x1e20b4=JSON[_0x72af('0x3')](_0x7ac55e);var _0x585d2b=Object[_0x72af('0x4')](_0x1e20b4)[0x0];return _0x5ee948[_0x72af('0x5')](_0x585d2b);}catch(_0x4fb644){return![];}}function getOperatorValue(_0x5617e1){var _0x175482=JSON['parse'](_0x5617e1);var _0x2f4de8=Object[_0x72af('0x4')](_0x175482)[0x0];var _0x4dd7b5=_0x175482[_0x2f4de8];return{['$'+_0x2f4de8]:_0x4dd7b5};}exports[_0x72af('0x6')]=function(_0x5ba9eb){var _0x4f519c=null;if(_0x5ba9eb){_0x4f519c=_0x5ba9eb[_0x72af('0x7')](',');}return _0x4f519c;};exports[_0x72af('0x8')]=function(_0x11b8cc,_0x5b9500){var _0x529d94={};if(!_[_0x72af('0x9')](_0x11b8cc)){_[_0x72af('0xa')](_0x11b8cc,function(_0x1679b4,_0x31ebe9){try{if(_0x5b9500){var _0x533119=_[_0x72af('0xb')](_0x5b9500,{'name':_0x31ebe9})||{};if(hasSequelizeOperator(_0x1679b4)){_0x529d94[_0x31ebe9]=getOperatorValue(_0x1679b4);}else if(_0x533119[_0x72af('0xc')]===_0x72af('0xd')&&_[_0x72af('0xe')](_0x1679b4)){var _0xc5b03f=JSON[_0x72af('0x3')](_0x1679b4);var _0x8fb6d3={'$gte':moment(moment(_0xc5b03f[_0x72af('0xf')])['format']('YYYY-MM-DD'))[_0x72af('0x10')]()[_0x72af('0x11')](),'$lte':moment(moment(_0xc5b03f['$lte'])['format'](_0x72af('0x12')))['utc']()[_0x72af('0x13')](0x1,'s')['format']()};_0x529d94[_0x31ebe9]=_0x8fb6d3;}else if(_0x533119[_0x72af('0x14')]==='uniqueid'){_0x529d94[_0x31ebe9]=_0x1679b4;}else{_0x529d94[_0x31ebe9]=_[_0x72af('0x15')](_0x1679b4)?_0x1679b4:JSON[_0x72af('0x3')](_0x1679b4);}}else{_0x529d94[_0x31ebe9]=_[_0x72af('0x15')](_0x1679b4)?_0x1679b4:JSON[_0x72af('0x3')](_0x1679b4);}}catch(_0x1b26a4){_0x529d94[_0x31ebe9]=_0x1679b4['split'](',');}});}return _0x529d94;};exports[_0x72af('0x16')]=function(_0x3f2453){_0x3f2453=parseInt(_0x3f2453,0xa);if(!_0x3f2453||_0x3f2453<0x0){_0x3f2453=LIMIT_VALUE;}return _0x3f2453;};exports[_0x72af('0x17')]=function(_0xc3ca96){_0xc3ca96=parseInt(_0xc3ca96,0xa);if(!_0xc3ca96||_0xc3ca96<0x0){_0xc3ca96=0x0;}return _0xc3ca96;};exports[_0x72af('0x18')]=function(_0x18f415){var _0x4e3e22,_0x4aaf34=null;if(_0x18f415){_0x4e3e22=_0x18f415['split'](',');_0x4aaf34=_[_0x72af('0x19')](_0x4e3e22,function(_0x257714){if(_0x257714[_0x72af('0x1a')]('-')===0x0){return[_0x257714===_0x72af('0x1b')?sequelize[_0x72af('0x1c')](sequelize[_0x72af('0x1d')]('priority'),'unsigned'):_0x257714[_0x72af('0x1e')](0x1),_0x72af('0x1f')];}else{return[_0x257714===_0x72af('0x1b')?sequelize[_0x72af('0x1c')](sequelize[_0x72af('0x1d')](_0x72af('0x1b')),'unsigned'):_0x257714,_0x72af('0x20')];}});}return _0x4aaf34;};exports['omit']=function(_0x1d3bda,_0x2e28c7){if(_['isEmpty'](_0x1d3bda)){return _0x1d3bda;}if(_[_0x72af('0x15')](_0x1d3bda)){for(var _0x27d5b1=0x0;_0x27d5b1<_0x1d3bda[_0x72af('0x21')];_0x27d5b1+=0x1){_0x1d3bda[_0x27d5b1]=this['omit'](_0x1d3bda[_0x27d5b1],_0x2e28c7);}return _0x1d3bda;}if(!_[_0x72af('0x22')](_0x1d3bda)){return _0x1d3bda;}if(_[_0x72af('0x23')](_0x2e28c7)){_0x2e28c7=[_0x2e28c7];}if(!_[_0x72af('0x15')](_0x2e28c7)){return _0x1d3bda;}for(var _0x11608e=0x0;_0x11608e<_0x2e28c7[_0x72af('0x21')];_0x11608e+=0x1){_[_0x72af('0x24')](_0x1d3bda,_0x2e28c7[_0x11608e]);}for(var _0x3da778 in _0x1d3bda){if(_0x1d3bda[_0x72af('0x25')](_0x3da778)){_0x1d3bda[_0x3da778]=this['omit'](_0x1d3bda[_0x3da778],_0x2e28c7);}}return _0x1d3bda;};exports[_0x72af('0x26')]=function(_0x4ae149){return _0x4ae149['match'](RegExp(_0x72af('0x27')))?!![]:![];};exports['isEmail']=function(_0x516f2f){return _0x516f2f[_0x72af('0x28')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x21329b,_0x43654d){var _0xf607fd=[];var _0x79e5fe=/[ `!@#$%^&*()_\-?~]/;var _0x5b7dce=_0x43654d?_0x72af('0x29'):'{EXPR}';_0x21329b['split'](/[ ,]+/)['forEach'](function(_0x1c3567){_0x1c3567=_0x1c3567[_0x72af('0x2a')](/([^:]")"+/g,'$1');_0x1c3567='+'+_0x1c3567+'*';var _0x27e721=_0x1c3567[_0x72af('0x28')](_0x79e5fe);if(_0x27e721){_0x1c3567='\x22'+_0x1c3567+'\x22';}_0xf607fd[_0x72af('0x2b')](_0x1c3567);});_0x5b7dce=_0x5b7dce['replace'](_0x72af('0x2c'),_0xf607fd[_0x72af('0x2d')]('\x20'));return _0x5b7dce;};exports[_0x72af('0x2e')]=function(_0x998c4c,_0x2de2b3,_0x10e32a){var _0x92c556={},_0x3235a1={};if(_0x2de2b3['query'][_0x72af('0x2f')]){_0x2de2b3[_0x72af('0x30')]['id']=_0x2de2b3[_0x72af('0x30')][_0x72af('0x2f')];delete _0x2de2b3[_0x72af('0x30')]['$id'];}_0x92c556[_0x72af('0x31')]=_[_0x72af('0x19')](_0x998c4c,_0x72af('0x14'));_0x92c556[_0x72af('0x30')]=_['keys'](_0x2de2b3[_0x72af('0x30')]);_0x92c556[_0x72af('0x8')]=_[_0x72af('0x32')](_0x92c556[_0x72af('0x31')],_0x92c556[_0x72af('0x30')]);_0x3235a1[_0x72af('0x33')]=_[_0x72af('0x32')](_0x92c556[_0x72af('0x31')],this[_0x72af('0x6')](_0x2de2b3['query'][_0x72af('0x6')]));_0x3235a1[_0x72af('0x33')]=_0x3235a1[_0x72af('0x33')]['length']?_0x3235a1['attributes']:_0x92c556[_0x72af('0x31')];if(!_0x2de2b3[_0x72af('0x30')]['hasOwnProperty']('nolimit')){_0x3235a1['limit']=this[_0x72af('0x16')](_0x2de2b3['query']['limit']);_0x3235a1['offset']=this[_0x72af('0x17')](_0x2de2b3['query']['offset']);}_0x3235a1[_0x72af('0x34')]=this[_0x72af('0x18')](_0x2de2b3[_0x72af('0x30')][_0x72af('0x18')]);_0x3235a1['where']=this[_0x72af('0x8')](_[_0x72af('0x35')](_0x2de2b3[_0x72af('0x30')],_0x92c556[_0x72af('0x8')]),_0x998c4c);if(_0x2de2b3[_0x72af('0x30')][_0x72af('0x36')]){var _0x6c2e8b=_0x998c4c;var _0x17e057=_0x2de2b3[_0x72af('0x30')][_0x72af('0x36')];if(typeof _0x17e057===_0x72af('0x37')){_0x6c2e8b=_[_0x72af('0x36')](_0x998c4c,function(_0x2950b6){return _[_0x72af('0x5')](_0x17e057['columns'],_0x2950b6[_0x72af('0x14')]);});_0x17e057=_0x17e057[_0x72af('0x38')];}_0x3235a1[_0x72af('0x39')]=_[_0x72af('0x3a')](_0x3235a1[_0x72af('0x39')],{'$or':_['map'](_0x6c2e8b,function(_0x188310){if(_0x188310[_0x72af('0xc')]!=='VIRTUAL'){if(_0x10e32a){return sequelize[_0x72af('0x39')](sequelize['fn'](_0x72af('0x3b'),sequelize[_0x72af('0x1d')](_0x188310['name'])),{'$like':sequelize['fn'](_0x72af('0x3b'),'%'+_0x2de2b3[_0x72af('0x30')][_0x72af('0x36')]+'%')});}else{var _0x3a0159={};_0x3a0159[_0x188310[_0x72af('0x14')]]={'$like':'%'+_0x2de2b3[_0x72af('0x30')][_0x72af('0x36')]+'%'};return _0x3a0159;}}})});}_0x3235a1=_['merge']({},_0x3235a1,_0x2de2b3['options']);return _0x3235a1;}; \ No newline at end of file +var _0xc82a=['fields','filters','isEmpty','forOwn','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','isArray','split','priority','cast','unsigned','substr','DESC','ASC','omit','length','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','\x22{EXPR}\x22','{EXPR}','forEach','replace','join','getOptions','query','$id','map','intersection','model','attributes','nolimit','limit','offset','order','sort','filter','object','value','where','merge','VIRTUAL','lodash','moment','parse','includes','keys'];(function(_0xade2e4,_0x1b7403){var _0x2ef0d1=function(_0x403591){while(--_0x403591){_0xade2e4['push'](_0xade2e4['shift']());}};_0x2ef0d1(++_0x1b7403);}(_0xc82a,0x191));var _0xac82=function(_0x3e32d6,_0x37c0bb){_0x3e32d6=_0x3e32d6-0x0;var _0x52af90=_0xc82a[_0x3e32d6];return _0x52af90;};'use strict';var _=require(_0xac82('0x0'));var sequelize=require('sequelize');var moment=require(_0xac82('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1b016c){var _0x16e0b5=['ne'];try{var _0x568c48=JSON[_0xac82('0x2')](_0x1b016c);var _0x5464f7=Object['keys'](_0x568c48)[0x0];return _0x16e0b5[_0xac82('0x3')](_0x5464f7);}catch(_0x3c07f9){return![];}}function getOperatorValue(_0x3e321f){var _0x40e918=JSON[_0xac82('0x2')](_0x3e321f);var _0x57f698=Object[_0xac82('0x4')](_0x40e918)[0x0];var _0x4da8d2=_0x40e918[_0x57f698];return{['$'+_0x57f698]:_0x4da8d2};}exports[_0xac82('0x5')]=function(_0x5e697c){var _0x35bbd6=null;if(_0x5e697c){_0x35bbd6=_0x5e697c['split'](',');}return _0x35bbd6;};exports[_0xac82('0x6')]=function(_0x1c1b90,_0x2cd4d9){var _0x5310d0={};if(!_[_0xac82('0x7')](_0x1c1b90)){_[_0xac82('0x8')](_0x1c1b90,function(_0x44cad8,_0x446b40){try{if(_0x2cd4d9){var _0x5d93f9=_['find'](_0x2cd4d9,{'name':_0x446b40})||{};if(hasSequelizeOperator(_0x44cad8)){_0x5310d0[_0x446b40]=getOperatorValue(_0x44cad8);}else if(_0x5d93f9[_0xac82('0x9')]==='DATE'&&_[_0xac82('0xa')](_0x44cad8)){var _0x15bf81=JSON[_0xac82('0x2')](_0x44cad8);var _0x919371={'$gte':moment(moment(_0x15bf81[_0xac82('0xb')])[_0xac82('0xc')](_0xac82('0xd')))[_0xac82('0xe')]()[_0xac82('0xc')](),'$lte':moment(moment(_0x15bf81[_0xac82('0xf')])[_0xac82('0xc')]('YYYY-MM-DD'))[_0xac82('0xe')]()[_0xac82('0x10')](0x1,'s')[_0xac82('0xc')]()};_0x5310d0[_0x446b40]=_0x919371;}else if(_0x5d93f9[_0xac82('0x11')]==='uniqueid'){_0x5310d0[_0x446b40]=_0x44cad8;}else{_0x5310d0[_0x446b40]=_[_0xac82('0x12')](_0x44cad8)?_0x44cad8:JSON[_0xac82('0x2')](_0x44cad8);}}else{_0x5310d0[_0x446b40]=_['isArray'](_0x44cad8)?_0x44cad8:JSON['parse'](_0x44cad8);}}catch(_0x114928){_0x5310d0[_0x446b40]=_0x44cad8[_0xac82('0x13')](',');}});}return _0x5310d0;};exports['limit']=function(_0x17b26a){_0x17b26a=parseInt(_0x17b26a,0xa);if(!_0x17b26a||_0x17b26a<0x0){_0x17b26a=LIMIT_VALUE;}return _0x17b26a;};exports['offset']=function(_0x4810c6){_0x4810c6=parseInt(_0x4810c6,0xa);if(!_0x4810c6||_0x4810c6<0x0){_0x4810c6=0x0;}return _0x4810c6;};exports['sort']=function(_0x3df93c){var _0x55f590,_0x1b617c=null;if(_0x3df93c){_0x55f590=_0x3df93c[_0xac82('0x13')](',');_0x1b617c=_['map'](_0x55f590,function(_0x403fc9){if(_0x403fc9['indexOf']('-')===0x0){return[_0x403fc9===_0xac82('0x14')?sequelize[_0xac82('0x15')](sequelize['col'](_0xac82('0x14')),_0xac82('0x16')):_0x403fc9[_0xac82('0x17')](0x1),_0xac82('0x18')];}else{return[_0x403fc9===_0xac82('0x14')?sequelize[_0xac82('0x15')](sequelize['col']('priority'),_0xac82('0x16')):_0x403fc9,_0xac82('0x19')];}});}return _0x1b617c;};exports[_0xac82('0x1a')]=function(_0x3b146a,_0x17618a){if(_['isEmpty'](_0x3b146a)){return _0x3b146a;}if(_[_0xac82('0x12')](_0x3b146a)){for(var _0x23db5a=0x0;_0x23db5a<_0x3b146a[_0xac82('0x1b')];_0x23db5a+=0x1){_0x3b146a[_0x23db5a]=this[_0xac82('0x1a')](_0x3b146a[_0x23db5a],_0x17618a);}return _0x3b146a;}if(!_['isObject'](_0x3b146a)){return _0x3b146a;}if(_[_0xac82('0x1c')](_0x17618a)){_0x17618a=[_0x17618a];}if(!_['isArray'](_0x17618a)){return _0x3b146a;}for(var _0x56f7e0=0x0;_0x56f7e0<_0x17618a[_0xac82('0x1b')];_0x56f7e0+=0x1){_[_0xac82('0x1d')](_0x3b146a,_0x17618a[_0x56f7e0]);}for(var _0x229c3b in _0x3b146a){if(_0x3b146a[_0xac82('0x1e')](_0x229c3b)){_0x3b146a[_0x229c3b]=this[_0xac82('0x1a')](_0x3b146a[_0x229c3b],_0x17618a);}}return _0x3b146a;};exports[_0xac82('0x1f')]=function(_0x41d08e){return _0x41d08e[_0xac82('0x20')](RegExp(_0xac82('0x21')))?!![]:![];};exports[_0xac82('0x22')]=function(_0x433021){return _0x433021[_0xac82('0x20')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x5ab7e5,_0x480c42){var _0x5cda4e=[];var _0x435dc2=/[ `!@#$%^&*()_\-?~]/;var _0x56180b=_0x480c42?_0xac82('0x23'):_0xac82('0x24');_0x5ab7e5[_0xac82('0x13')](/[ ,]+/)[_0xac82('0x25')](function(_0x5c4505){_0x5c4505=_0x5c4505[_0xac82('0x26')](/([^:]")"+/g,'$1');_0x5c4505='+'+_0x5c4505+'*';var _0x341396=_0x5c4505['match'](_0x435dc2);if(_0x341396){_0x5c4505='\x22'+_0x5c4505+'\x22';}_0x5cda4e['push'](_0x5c4505);});_0x56180b=_0x56180b[_0xac82('0x26')]('{EXPR}',_0x5cda4e[_0xac82('0x27')]('\x20'));return _0x56180b;};exports[_0xac82('0x28')]=function(_0x68c7b1,_0x18c6e0,_0x1a0afa){var _0x58f5e1={},_0xe444ec={};if(_0x18c6e0[_0xac82('0x29')][_0xac82('0x2a')]){_0x18c6e0[_0xac82('0x29')]['id']=_0x18c6e0[_0xac82('0x29')][_0xac82('0x2a')];delete _0x18c6e0['query']['$id'];}_0x58f5e1['model']=_[_0xac82('0x2b')](_0x68c7b1,_0xac82('0x11'));_0x58f5e1[_0xac82('0x29')]=_[_0xac82('0x4')](_0x18c6e0['query']);_0x58f5e1[_0xac82('0x6')]=_[_0xac82('0x2c')](_0x58f5e1[_0xac82('0x2d')],_0x58f5e1[_0xac82('0x29')]);_0xe444ec[_0xac82('0x2e')]=_[_0xac82('0x2c')](_0x58f5e1['model'],this[_0xac82('0x5')](_0x18c6e0[_0xac82('0x29')][_0xac82('0x5')]));_0xe444ec['attributes']=_0xe444ec[_0xac82('0x2e')][_0xac82('0x1b')]?_0xe444ec[_0xac82('0x2e')]:_0x58f5e1[_0xac82('0x2d')];if(!_0x18c6e0[_0xac82('0x29')][_0xac82('0x1e')](_0xac82('0x2f'))){_0xe444ec[_0xac82('0x30')]=this[_0xac82('0x30')](_0x18c6e0['query'][_0xac82('0x30')]);_0xe444ec[_0xac82('0x31')]=this[_0xac82('0x31')](_0x18c6e0['query'][_0xac82('0x31')]);}_0xe444ec[_0xac82('0x32')]=this[_0xac82('0x33')](_0x18c6e0['query'][_0xac82('0x33')]);_0xe444ec['where']=this[_0xac82('0x6')](_['pick'](_0x18c6e0[_0xac82('0x29')],_0x58f5e1[_0xac82('0x6')]),_0x68c7b1);if(_0x18c6e0[_0xac82('0x29')][_0xac82('0x34')]){var _0x4aea7b=_0x68c7b1;var _0x56ecdd=_0x18c6e0[_0xac82('0x29')][_0xac82('0x34')];if(typeof _0x56ecdd===_0xac82('0x35')){_0x4aea7b=_[_0xac82('0x34')](_0x68c7b1,function(_0x10294c){return _[_0xac82('0x3')](_0x56ecdd['columns'],_0x10294c[_0xac82('0x11')]);});_0x56ecdd=_0x56ecdd[_0xac82('0x36')];}_0xe444ec[_0xac82('0x37')]=_[_0xac82('0x38')](_0xe444ec[_0xac82('0x37')],{'$or':_[_0xac82('0x2b')](_0x4aea7b,function(_0x4c0373){if(_0x4c0373[_0xac82('0x9')]!==_0xac82('0x39')){if(_0x1a0afa){return sequelize[_0xac82('0x37')](sequelize['fn']('lower',sequelize['col'](_0x4c0373['name'])),{'$like':sequelize['fn']('lower','%'+_0x18c6e0[_0xac82('0x29')][_0xac82('0x34')]+'%')});}else{var _0x4040d7={};_0x4040d7[_0x4c0373[_0xac82('0x11')]]={'$like':'%'+_0x18c6e0[_0xac82('0x29')][_0xac82('0x34')]+'%'};return _0x4040d7;}}})});}_0xe444ec=_[_0xac82('0x38')]({},_0xe444ec,_0x18c6e0['options']);return _0xe444ec;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 2a6d214..5a7fd80 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 _0xfd44=['error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','unknown','*pause','busy','getAgentStatus','startCase','Queue','map','findOne','getAgents','flatten','uniq','value','getAgentIdsByQueues','getAgentIdsByStatus','includes','User','findAll','fullname','chatPause','mailPause','whatsappPause','pauseType','find','globalStatus','fields','startsWith','DESC','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatus','smsStatus','faxStatus','chatStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','openchannelPause','online','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','http','client','faxPause','smsPause','voicePause','every','filter','length','idle','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','openchannelStatus','whatsappStatus','request','Agents','then'];(function(_0x7a6b2c,_0x270878){var _0x2bca44=function(_0x318433){while(--_0x318433){_0x7a6b2c['push'](_0x7a6b2c['shift']());}};_0x2bca44(++_0x270878);}(_0xfd44,0x19c));var _0x4fd4=function(_0x4ab842,_0x171c09){_0x4ab842=_0x4ab842-0x0;var _0x3dee3a=_0xfd44[_0x4ab842];return _0x3dee3a;};'use strict';var _=require(_0x4fd4('0x0'));var jayson=require(_0x4fd4('0x1'));var db=require(_0x4fd4('0x2'))['db'];var amiClient=jayson['client'][_0x4fd4('0x3')]({'port':0x232a});var routingClient=jayson[_0x4fd4('0x4')]['http']({'port':0x232c});function isAgentPaused(_0x591a9e,_0x515b39){var _0x2019d9=[_0x591a9e['chatPause'],_0x591a9e[_0x4fd4('0x5')],_0x591a9e['mailPause'],_0x591a9e['openchannelPause'],_0x591a9e[_0x4fd4('0x6')],_0x591a9e[_0x4fd4('0x7')],_0x591a9e['whatsappPause']];if(!_0x515b39)return _[_0x4fd4('0x8')](_0x2019d9);var _0x483455=_[_0x4fd4('0x9')](_0x2019d9);return _0x483455[_0x4fd4('0xa')]>0x0&&_0x483455[_0x4fd4('0xa')]<_0x2019d9['length']?!![]:![];}function isIdle(_0x25ea38){return _0x25ea38===_0x4fd4('0xb')||_0x25ea38==='unknown'||_0x25ea38===_0x4fd4('0xc')||_0x25ea38===_0x4fd4('0xd')||_[_0x4fd4('0xe')](_0x25ea38);}function isAgentIdle(_0x4a35bb){if(_0x4a35bb[_0x4fd4('0xf')]!==_0x4fd4('0xb')&&_0x4a35bb[_0x4fd4('0x7')]){_0x4a35bb[_0x4fd4('0xf')]=_0x4fd4('0x10');return![];}return _[_0x4fd4('0x8')]([_0x4a35bb[_0x4fd4('0x11')],_0x4a35bb['faxStatus'],_0x4a35bb['mailStatus'],_0x4a35bb[_0x4fd4('0x12')],_0x4a35bb['smsStatus'],_0x4a35bb[_0x4fd4('0xf')],_0x4a35bb[_0x4fd4('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x4fd4('0x14')](_0x4fd4('0x15'),{})[_0x4fd4('0x16')](function(_0xefe9c3){if(_0xefe9c3[_0x4fd4('0x17')]){throw new Error(_0x4fd4('0x18'));}var _0x482d81=_0xefe9c3[_0x4fd4('0x19')];return routingClient[_0x4fd4('0x14')]('Agents',{})['then'](function(_0x26c9eb){if(_0x26c9eb[_0x4fd4('0x17')]){throw new Error(_0x4fd4('0x1a'));}var _0x2f8c20=_0x26c9eb[_0x4fd4('0x19')];return _[_0x4fd4('0x1b')]({},_0x482d81,_0x2f8c20);});})[_0x4fd4('0x1c')](function(_0x2eab50){throw _0x2eab50;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x2516cf){var _0x287b1d=_0x4fd4('0x1d');if(isAgentPaused(_0x2516cf))_0x287b1d=_0x4fd4('0x10');else if(isAgentPaused(_0x2516cf,!![]))_0x287b1d=_0x4fd4('0x1e');else if(isAgentIdle(_0x2516cf))_0x287b1d=_0x4fd4('0xb');else _0x287b1d=_0x4fd4('0x1f');return _0x287b1d;}exports[_0x4fd4('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x3e262e,_0x56d147){var _0x45fa01=_['isArray'](_0x3e262e)?_0x3e262e:[_0x3e262e];var _0x30aada=_[_0x4fd4('0x21')](_0x56d147)+_0x4fd4('0x22');var _0x41e707=_[_0x4fd4('0x23')](_0x45fa01,function(_0x3bdb13){return db[_0x30aada][_0x4fd4('0x24')]({'where':{'id':_0x3bdb13}})[_0x4fd4('0x16')](function(_0x172723){if(!_0x172723)return[];return _0x172723[_0x4fd4('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x41e707)[_0x4fd4('0x16')](function(_0x133ec0){var _0x33d59a=_(_0x133ec0)[_0x4fd4('0x26')]()[_0x4fd4('0x23')]('id')[_0x4fd4('0x27')]()[_0x4fd4('0x28')]();return _0x33d59a;});}exports[_0x4fd4('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5b9f0c,_0x467959,_0x3cec64){try{if(_0x467959[_0x4fd4('0xa')]>0x0){_0x5b9f0c=_0x5b9f0c[_0x4fd4('0x9')](function(_0x535e22){return _0x467959['includes'](_0x535e22['id']);});}var _0x51584e=_0x5b9f0c[_0x4fd4('0x9')](function(_0x4fb6dc){var _0x51ce0c=_0x4fd4('0x1f');if(isAgentIdle(_0x4fb6dc)){_0x51ce0c=_0x4fd4('0xb');}return _0x51ce0c===_0x3cec64;});return _['map'](_0x51584e,'id');}catch(_0x2c99b6){throw _0x2c99b6;}}exports[_0x4fd4('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1c8b89,_0x321f29,_0x1d5e3c){return Promise['resolve']()[_0x4fd4('0x16')](function(){if(_0x321f29[_0x4fd4('0xa')]>0x0){_0x1c8b89=_0x1c8b89['filter'](function(_0x49dd6d){return _0x321f29[_0x4fd4('0x2b')](_0x49dd6d['id']);});}return _0x1c8b89;})[_0x4fd4('0x16')](function(){return db[_0x4fd4('0x2c')][_0x4fd4('0x2d')]({'attributes':['id','name',_0x4fd4('0x2e'),_0x4fd4('0x2f'),_0x4fd4('0x5'),_0x4fd4('0x30'),'openchannelPause',_0x4fd4('0x6'),'voicePause',_0x4fd4('0x31'),_0x4fd4('0x32')],'where':{'id':{'$in':_[_0x4fd4('0x23')](_0x1c8b89,'id')}},'raw':!![]});})[_0x4fd4('0x16')](function(_0x483045){return _0x483045[_0x4fd4('0x23')](function(_0x16d202){var _0x1eb577=_[_0x4fd4('0x33')](_0x1c8b89,['id',_0x16d202['id']]);var _0x4f306b=filterAgentAttributes(_0x1eb577);_[_0x4fd4('0x1b')](_0x16d202,_0x4f306b);_0x16d202[_0x4fd4('0x34')]=getAgentStatus(_0x16d202);return _0x16d202;});})[_0x4fd4('0x16')](function(_0x2de17a){var _0x3b36af=sortAgentsByStatus(_0x2de17a,_0x1d5e3c);return _['map'](_0x3b36af,'id');})['catch'](function(_0x1bbc96){throw _0x1bbc96;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x498362){var _0x1c739e={'fields':[],'order':null};var _0x9499ef=_0x498362['split'](',');_0x1c739e[_0x4fd4('0x35')]=_[_0x4fd4('0x9')](_0x9499ef,function(_0x2517b8){if(!_0x2517b8[_0x4fd4('0x2b')](_0x4fd4('0x34'))){return!![];}_0x1c739e['order']=_[_0x4fd4('0x36')](_0x2517b8,'-')?_0x4fd4('0x37'):'ASC';return![];});return _0x1c739e;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x4f58f6){if(_0x4f58f6[_0x4fd4('0x2b')](_0x4fd4('0x2e'))&&!_0x4f58f6[_0x4fd4('0x2b')](_0x4fd4('0x38'))){var _0xcdd2c9=_0x4f58f6[_0x4fd4('0x39')](0x0,_0x4f58f6[_0x4fd4('0x3a')](_0x4fd4('0x2e')));_0x4f58f6+=','+_0xcdd2c9+_0x4fd4('0x38');}return _0x4f58f6;}exports[_0x4fd4('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x16548f,_0x9acd96){var _0x42d3c1=_0x16548f[_0x4fd4('0x3c')](function(_0x13a156,_0x1c0760){if(_0x13a156[_0x4fd4('0x34')]===_0x1c0760[_0x4fd4('0x34')]){if(_0x13a156[_0x4fd4('0x34')]===_0x4fd4('0x10')){if(_0x9acd96===_0x4fd4('0x37')){return(_0x13a156['pauseType']||'')<(_0x1c0760['pauseType']||'')||_0x13a156['fullname']['toLowerCase']()>_0x1c0760[_0x4fd4('0x2e')][_0x4fd4('0x3d')]()?0x1:-0x1;}else{return(_0x13a156[_0x4fd4('0x32')]||'')<(_0x1c0760[_0x4fd4('0x32')]||'')||_0x13a156['fullname'][_0x4fd4('0x3d')]()>_0x1c0760[_0x4fd4('0x2e')][_0x4fd4('0x3d')]()?-0x1:0x1;}}else{if(_0x9acd96==='DESC'){return _0x13a156[_0x4fd4('0x2e')][_0x4fd4('0x3d')]()<_0x1c0760['fullname'][_0x4fd4('0x3d')]()?0x1:-0x1;}else{return _0x13a156[_0x4fd4('0x2e')][_0x4fd4('0x3d')]()<_0x1c0760[_0x4fd4('0x2e')][_0x4fd4('0x3d')]()?-0x1:0x1;}}}else{if(_0x9acd96===_0x4fd4('0x37')){return _0x13a156['globalStatus']<_0x1c0760['globalStatus']?0x1:-0x1;}else{return _0x13a156[_0x4fd4('0x34')]<_0x1c0760['globalStatus']?-0x1:0x1;}}});return _0x42d3c1;}exports[_0x4fd4('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0xa0f549){var _0x4428e0=[_0x4fd4('0x3f'),'online',_0x4fd4('0x40'),_0x4fd4('0x41'),_0x4fd4('0x32'),_0x4fd4('0x41'),_0x4fd4('0x38'),_0x4fd4('0x42'),'chatPause','openchannelPause',_0x4fd4('0x30'),_0x4fd4('0x6'),_0x4fd4('0x31'),_0x4fd4('0x5'),_0x4fd4('0x7'),_0x4fd4('0x43'),_0x4fd4('0x44'),'mailCapacity',_0x4fd4('0x45'),'whatsappCapacity',_0x4fd4('0x46'),_0x4fd4('0x47'),'openchannelCurrentCapacity','mailCurrentCapacity',_0x4fd4('0x48'),_0x4fd4('0x49'),'faxCurrentCapacity',_0x4fd4('0x11'),_0x4fd4('0x12'),_0x4fd4('0x4a'),_0x4fd4('0x4b'),_0x4fd4('0x13'),_0x4fd4('0x4c'),_0x4fd4('0xf'),_0x4fd4('0x4d'),'openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime',_0x4fd4('0x4e'),'voiceStatusTime','queue',_0x4fd4('0x4f'),_0x4fd4('0x50'),_0x4fd4('0x51'),_0x4fd4('0x52'),_0x4fd4('0x53')];var _0x4607d7=[_0x4fd4('0x2f'),_0x4fd4('0x54'),_0x4fd4('0x30'),_0x4fd4('0x6'),'whatsappPause',_0x4fd4('0x5'),_0x4fd4('0x7'),_0x4fd4('0x55')];var _0x36fc86=_(_0xa0f549)['omit'](_0x4607d7)['pick'](_0x4428e0)[_0x4fd4('0x28')]();return _0x36fc86;}exports[_0x4fd4('0x56')]=filterAgentAttributes; \ No newline at end of file +var _0x2071=['voiceStatus','voicePause','pause','every','chatStatus','faxStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','unknown','busy','getAgentStatus','isArray','startCase','Queue','findOne','all','map','uniq','value','getAgentIdsByQueues','length','filter','includes','resolve','User','name','pauseType','find','catch','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','ASC','getUpdatedSortOptions','fullname','substring','indexOf','internal','toLowerCase','DESC','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatPause','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','lodash','jayson/promise','http','client','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','idle','unavailable','isNil'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0x2071,0xb0));var _0x1207=function(_0x451d04,_0x999e7d){_0x451d04=_0x451d04-0x0;var _0x32c6fe=_0x2071[_0x451d04];return _0x32c6fe;};'use strict';var _=require(_0x1207('0x0'));var jayson=require(_0x1207('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x1207('0x2')]({'port':0x232a});var routingClient=jayson[_0x1207('0x3')][_0x1207('0x2')]({'port':0x232c});function isAgentPaused(_0x3a8d21,_0x728511){var _0x2dd8a8=[_0x3a8d21['chatPause'],_0x3a8d21[_0x1207('0x4')],_0x3a8d21[_0x1207('0x5')],_0x3a8d21[_0x1207('0x6')],_0x3a8d21[_0x1207('0x7')],_0x3a8d21['voicePause'],_0x3a8d21[_0x1207('0x8')]];if(!_0x728511)return _['every'](_0x2dd8a8);var _0x247b2d=_['filter'](_0x2dd8a8);return _0x247b2d['length']>0x0&&_0x247b2d['length']<_0x2dd8a8['length']?!![]:![];}function isIdle(_0x270767){return _0x270767===_0x1207('0x9')||_0x270767==='unknown'||_0x270767===_0x1207('0xa')||_0x270767==='ringing'||_[_0x1207('0xb')](_0x270767);}function isAgentIdle(_0x5a0eb2){if(_0x5a0eb2[_0x1207('0xc')]!==_0x1207('0x9')&&_0x5a0eb2[_0x1207('0xd')]){_0x5a0eb2['voiceStatus']=_0x1207('0xe');return![];}return _[_0x1207('0xf')]([_0x5a0eb2[_0x1207('0x10')],_0x5a0eb2[_0x1207('0x11')],_0x5a0eb2['mailStatus'],_0x5a0eb2['openchannelStatus'],_0x5a0eb2[_0x1207('0x12')],_0x5a0eb2['voiceStatus'],_0x5a0eb2[_0x1207('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x1207('0x14')](_0x1207('0x15'),{})[_0x1207('0x16')](function(_0x5cd133){if(_0x5cd133[_0x1207('0x17')]){throw new Error(_0x1207('0x18'));}var _0x2b5052=_0x5cd133[_0x1207('0x19')];return routingClient[_0x1207('0x14')]('Agents',{})[_0x1207('0x16')](function(_0x209739){if(_0x209739[_0x1207('0x17')]){throw new Error(_0x1207('0x1a'));}var _0x558e26=_0x209739[_0x1207('0x19')];return _[_0x1207('0x1b')]({},_0x2b5052,_0x558e26);});})['catch'](function(_0x1211f7){throw _0x1211f7;});}exports[_0x1207('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x4baa6f){var _0x5ada66=_0x1207('0x1d');if(isAgentPaused(_0x4baa6f))_0x5ada66=_0x1207('0xe');else if(isAgentPaused(_0x4baa6f,!![]))_0x5ada66='*pause';else if(isAgentIdle(_0x4baa6f))_0x5ada66=_0x1207('0x9');else _0x5ada66=_0x1207('0x1e');return _0x5ada66;}exports[_0x1207('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x567816,_0x329e84){var _0x13832d=_[_0x1207('0x20')](_0x567816)?_0x567816:[_0x567816];var _0x116e72=_[_0x1207('0x21')](_0x329e84)+_0x1207('0x22');var _0x140a4c=_['map'](_0x13832d,function(_0x1febb5){return db[_0x116e72][_0x1207('0x23')]({'where':{'id':_0x1febb5}})[_0x1207('0x16')](function(_0x3709d0){if(!_0x3709d0)return[];return _0x3709d0['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x1207('0x24')](_0x140a4c)[_0x1207('0x16')](function(_0x3f6d98){var _0x41bd93=_(_0x3f6d98)['flatten']()[_0x1207('0x25')]('id')[_0x1207('0x26')]()[_0x1207('0x27')]();return _0x41bd93;});}exports[_0x1207('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x442dcf,_0x100389,_0x3d317d){try{if(_0x100389[_0x1207('0x29')]>0x0){_0x442dcf=_0x442dcf[_0x1207('0x2a')](function(_0xc8921b){return _0x100389[_0x1207('0x2b')](_0xc8921b['id']);});}var _0x3eec8f=_0x442dcf[_0x1207('0x2a')](function(_0x158b3e){var _0x550e8b='busy';if(isAgentIdle(_0x158b3e)){_0x550e8b='idle';}return _0x550e8b===_0x3d317d;});return _[_0x1207('0x25')](_0x3eec8f,'id');}catch(_0x38cd71){throw _0x38cd71;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x3351c5,_0x2c6ad6,_0x4eb703){return Promise[_0x1207('0x2c')]()[_0x1207('0x16')](function(){if(_0x2c6ad6[_0x1207('0x29')]>0x0){_0x3351c5=_0x3351c5[_0x1207('0x2a')](function(_0x14039){return _0x2c6ad6['includes'](_0x14039['id']);});}return _0x3351c5;})[_0x1207('0x16')](function(){return db[_0x1207('0x2d')]['findAll']({'attributes':['id',_0x1207('0x2e'),'fullname','chatPause',_0x1207('0x4'),_0x1207('0x5'),_0x1207('0x6'),'smsPause',_0x1207('0xd'),'whatsappPause',_0x1207('0x2f')],'where':{'id':{'$in':_[_0x1207('0x25')](_0x3351c5,'id')}},'raw':!![]});})['then'](function(_0x1b422e){return _0x1b422e[_0x1207('0x25')](function(_0x5b9d8e){var _0x213b55=_[_0x1207('0x30')](_0x3351c5,['id',_0x5b9d8e['id']]);var _0x26a726=filterAgentAttributes(_0x213b55);_[_0x1207('0x1b')](_0x5b9d8e,_0x26a726);_0x5b9d8e['globalStatus']=getAgentStatus(_0x5b9d8e);return _0x5b9d8e;});})['then'](function(_0x1c8618){var _0x654021=sortAgentsByStatus(_0x1c8618,_0x4eb703);return _[_0x1207('0x25')](_0x654021,'id');})[_0x1207('0x31')](function(_0x4b03c4){throw _0x4b03c4;});}exports[_0x1207('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x280682){var _0x34d104={'fields':[],'order':null};var _0x474192=_0x280682[_0x1207('0x33')](',');_0x34d104[_0x1207('0x34')]=_[_0x1207('0x2a')](_0x474192,function(_0x5c226e){if(!_0x5c226e[_0x1207('0x2b')](_0x1207('0x35'))){return!![];}_0x34d104[_0x1207('0x36')]=_[_0x1207('0x37')](_0x5c226e,'-')?'DESC':_0x1207('0x38');return![];});return _0x34d104;}exports[_0x1207('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0xaacef2){if(_0xaacef2['includes'](_0x1207('0x3a'))&&!_0xaacef2[_0x1207('0x2b')]('internal')){var _0x31c3ab=_0xaacef2[_0x1207('0x3b')](0x0,_0xaacef2[_0x1207('0x3c')](_0x1207('0x3a')));_0xaacef2+=','+_0x31c3ab+_0x1207('0x3d');}return _0xaacef2;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x3a1d15,_0x19a674){var _0x20ed4d=_0x3a1d15['sort'](function(_0x32064a,_0x3b5756){if(_0x32064a[_0x1207('0x35')]===_0x3b5756[_0x1207('0x35')]){if(_0x32064a[_0x1207('0x35')]===_0x1207('0xe')){if(_0x19a674==='DESC'){return(_0x32064a[_0x1207('0x2f')]||'')<(_0x3b5756[_0x1207('0x2f')]||'')||_0x32064a[_0x1207('0x3a')][_0x1207('0x3e')]()>_0x3b5756[_0x1207('0x3a')][_0x1207('0x3e')]()?0x1:-0x1;}else{return(_0x32064a[_0x1207('0x2f')]||'')<(_0x3b5756[_0x1207('0x2f')]||'')||_0x32064a['fullname'][_0x1207('0x3e')]()>_0x3b5756['fullname'][_0x1207('0x3e')]()?-0x1:0x1;}}else{if(_0x19a674===_0x1207('0x3f')){return _0x32064a[_0x1207('0x3a')][_0x1207('0x3e')]()<_0x3b5756[_0x1207('0x3a')]['toLowerCase']()?0x1:-0x1;}else{return _0x32064a['fullname'][_0x1207('0x3e')]()<_0x3b5756[_0x1207('0x3a')][_0x1207('0x3e')]()?-0x1:0x1;}}}else{if(_0x19a674===_0x1207('0x3f')){return _0x32064a['globalStatus']<_0x3b5756['globalStatus']?0x1:-0x1;}else{return _0x32064a[_0x1207('0x35')]<_0x3b5756[_0x1207('0x35')]?-0x1:0x1;}}});return _0x20ed4d;}exports[_0x1207('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x197e6c){var _0x1d8a47=[_0x1207('0x41'),_0x1207('0x42'),_0x1207('0x43'),_0x1207('0x44'),_0x1207('0x2f'),_0x1207('0x44'),_0x1207('0x3d'),_0x1207('0x45'),_0x1207('0x46'),'openchannelPause',_0x1207('0x5'),'smsPause',_0x1207('0x8'),_0x1207('0x4'),_0x1207('0xd'),_0x1207('0x47'),_0x1207('0x48'),_0x1207('0x49'),'smsCapacity','whatsappCapacity',_0x1207('0x4a'),_0x1207('0x4b'),_0x1207('0x4c'),_0x1207('0x4d'),_0x1207('0x4e'),_0x1207('0x4f'),_0x1207('0x50'),'chatStatus',_0x1207('0x51'),_0x1207('0x52'),_0x1207('0x12'),_0x1207('0x13'),_0x1207('0x11'),'voiceStatus',_0x1207('0x53'),_0x1207('0x54'),_0x1207('0x55'),'smsStatusTime','whatsappStatusTime',_0x1207('0x56'),'voiceStatusTime','queue',_0x1207('0x57'),_0x1207('0x58'),_0x1207('0x59'),_0x1207('0x5a'),'routealias'];var _0x3a4826=['chatPause',_0x1207('0x6'),_0x1207('0x5'),_0x1207('0x7'),_0x1207('0x8'),_0x1207('0x4'),_0x1207('0xd'),'online'];var _0x297ac2=_(_0x197e6c)[_0x1207('0x5b')](_0x3a4826)[_0x1207('0x5c')](_0x1d8a47)['value']();return _0x297ac2;}exports[_0x1207('0x5d')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 577d079..e8dc3b0 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 _0x5764=['inUse','loggedInDb','notInUse','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','Queues','error','format','result','inbound','outbound','concat','get','busy','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5764,0x14e));var _0x4576=function(_0x1a812e,_0x3c1672){_0x1a812e=_0x1a812e-0x0;var _0x21d7c5=_0x5764[_0x1a812e];return _0x21d7c5;};'use strict';var _=require(_0x4576('0x0'));var jayson=require(_0x4576('0x1'));var util=require(_0x4576('0x2'));var amiClient=jayson[_0x4576('0x3')][_0x4576('0x4')]({'port':0x232a});var routingClient=jayson[_0x4576('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x4576('0x5'),_0x4576('0x6'),_0x4576('0x7'),_0x4576('0x8')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x4576('0x9'),'invalid',_0x4576('0xa'),_0x4576('0xb'),'onHold','ringing',_0x4576('0xc'),_0x4576('0xd'),_0x4576('0xe'),_0x4576('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x4576('0x10'),_0x4576('0x11'),'message',_0x4576('0x12'),_0x4576('0x13'),_0x4576('0x14'),_0x4576('0x15'),_0x4576('0x16'),'startProgressive',_0x4576('0x17'),_0x4576('0x18'),_0x4576('0x19'),_0x4576('0x1a'),_0x4576('0x1b'),'dialPredictiveIntervalMaxThreshold',_0x4576('0x1c'),_0x4576('0x1d'),_0x4576('0x1e'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x4576('0x1f'),_0x4576('0x20'),_0x4576('0x21')];function getRealtimeQueues(_0x26b0f8,_0x41f1c0){var _0x42e763=_0x41f1c0===_0x4576('0x22')?amiClient:routingClient;return _0x42e763['request'](_[_0x4576('0x23')](_0x41f1c0)+_0x4576('0x24'),_0x26b0f8)['then'](function(_0x106e9b){if(_0x106e9b[_0x4576('0x25')])throw new Error(util[_0x4576('0x26')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x41f1c0));return _0x106e9b[_0x4576('0x27')];})['catch'](function(_0x59696c){throw _0x59696c;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x1e4817,_0x35a1cc,_0x55cb2d,_0x2ab158){var _0x1f0ae0=DEFAULT_QUEUE_ATTRIBUTES;if(_0x55cb2d===_0x4576('0x22')){if(_0x2ab158===_0x4576('0x28')){_0x1f0ae0=_0x1f0ae0['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2ab158===_0x4576('0x29')){_0x1f0ae0=_0x1f0ae0[_0x4576('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1e4817['map'](function(_0x4925f6){var _0x3c395f=_0x4925f6[_0x4576('0x2b')]({'plain':!![]});_0x3c395f[_0x4576('0x7')]=0x0;_0x3c395f[_0x4576('0xa')]=0x0;_0x3c395f[_0x4576('0x6')]=0x0;_0x3c395f[_0x4576('0x5')]=0x0;_0x3c395f['waiting']=0x0;if(_0x55cb2d===_0x4576('0x22')){_0x3c395f[_0x4576('0xd')]=0x0;_0x3c395f[_0x4576('0x2c')]=0x0;if(_0x2ab158===_0x4576('0x29')){_0x3c395f[_0x4576('0x10')]=0x0;_0x3c395f[_0x4576('0x11')]=0x0;}}var _0x300010=_[_0x4576('0x2d')](_0x35a1cc,['id',_0x3c395f['id']]);if(_0x300010){_[_0x4576('0x2e')](_0x3c395f,_[_0x4576('0x2f')](_0x300010,_0x1f0ae0));}return _0x3c395f;});}exports[_0x4576('0x30')]=initializeQueues; \ No newline at end of file +var _0x622a=['initializeQueues','lodash','util','http','client','loggedIn','paused','busy','inUse','invalid','loggedInDb','onHold','ringInUse','unavailable','unknown','originated','message','statusMessage','dialActive','dialMethod','Trunk','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','concat','map','get','available','waiting','pTalking','merge','pick'];(function(_0x3c6b09,_0x574850){var _0x2ee44b=function(_0x33403e){while(--_0x33403e){_0x3c6b09['push'](_0x3c6b09['shift']());}};_0x2ee44b(++_0x574850);}(_0x622a,0x1d7));var _0xa622=function(_0xb0e43e,_0x403521){_0xb0e43e=_0xb0e43e-0x0;var _0x37c003=_0x622a[_0xb0e43e];return _0x37c003;};'use strict';var _=require(_0xa622('0x0'));var jayson=require('jayson/promise');var util=require(_0xa622('0x1'));var amiClient=jayson['client'][_0xa622('0x2')]({'port':0x232a});var routingClient=jayson[_0xa622('0x3')][_0xa622('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0xa622('0x4'),_0xa622('0x5'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xa622('0x6'),_0xa622('0x7'),_0xa622('0x8'),_0xa622('0x9'),'notInUse',_0xa622('0xa'),'ringing',_0xa622('0xb'),'talking',_0xa622('0xc'),_0xa622('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xa622('0xe'),_0xa622('0xf'),_0xa622('0x10'),_0xa622('0x11'),_0xa622('0x12'),_0xa622('0x13'),'startPredictive','startProgressive',_0xa622('0x14'),_0xa622('0x15'),_0xa622('0x16'),'erlangBusyFactor','dialPredictiveInterval',_0xa622('0x17'),_0xa622('0x18'),_0xa622('0x19'),_0xa622('0x1a'),_0xa622('0x1b'),_0xa622('0x1c'),_0xa622('0x1d'),_0xa622('0x1e'),_0xa622('0x1f')];function getRealtimeQueues(_0x21d9b1,_0x24f114){var _0x5b6fdf=_0x24f114===_0xa622('0x20')?amiClient:routingClient;return _0x5b6fdf[_0xa622('0x21')](_[_0xa622('0x22')](_0x24f114)+_0xa622('0x23'),_0x21d9b1)['then'](function(_0x1bea61){if(_0x1bea61['error'])throw new Error(util[_0xa622('0x24')](_0xa622('0x25'),_0x24f114));return _0x1bea61['result'];})['catch'](function(_0x1bad49){throw _0x1bad49;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x51f732,_0x427a27,_0x3a58c1,_0x10fcd5){var _0xcfaf6e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3a58c1===_0xa622('0x20')){if(_0x10fcd5==='inbound'){_0xcfaf6e=_0xcfaf6e[_0xa622('0x26')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x10fcd5==='outbound'){_0xcfaf6e=_0xcfaf6e['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x51f732[_0xa622('0x27')](function(_0x534196){var _0x536306=_0x534196[_0xa622('0x28')]({'plain':!![]});_0x536306[_0xa622('0x5')]=0x0;_0x536306['loggedInDb']=0x0;_0x536306['loggedIn']=0x0;_0x536306[_0xa622('0x29')]=0x0;_0x536306[_0xa622('0x2a')]=0x0;if(_0x3a58c1===_0xa622('0x20')){_0x536306['talking']=0x0;_0x536306['busy']=0x0;if(_0x10fcd5==='outbound'){_0x536306[_0xa622('0x2b')]=0x0;_0x536306[_0xa622('0xe')]=0x0;}}var _0x5a03a1=_['find'](_0x427a27,['id',_0x536306['id']]);if(_0x5a03a1){_[_0xa622('0x2c')](_0x536306,_[_0xa622('0x2d')](_0x5a03a1,_0xcfaf6e));}return _0x536306;});}exports[_0xa622('0x2e')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index af2ec55..a6658ca 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(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 _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(_0x22fe5c,_0x28645c){var _0x17a217=function(_0x1306f0){while(--_0x1306f0){_0x22fe5c['push'](_0x22fe5c['shift']());}};_0x17a217(++_0x28645c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 80a0b2e..c629487 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 _0x2814=['hostname','macAddress','ipAddress','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','createHash','update','digest','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2814,0x115));var _0x4281=function(_0xab8ffa,_0x29179d){_0xab8ffa=_0xab8ffa-0x0;var _0x173c69=_0x2814[_0xab8ffa];return _0x173c69;};'use strict';var _=require(_0x4281('0x0'));var os=require('os');var crypto=require(_0x4281('0x1'));var machine=require(_0x4281('0x2'));var exec=require(_0x4281('0x3'))[_0x4281('0x4')];var config=require(_0x4281('0x5'));function getInterfaces(){var _0x4ce955=[];var _0x36a3af=os[_0x4281('0x6')]();var _0x4815b0=_[_0x4281('0x7')](_[_0x4281('0x8')](_0x36a3af));for(var _0x47e444=0x0;_0x47e444<_0x4815b0[_0x4281('0x9')];_0x47e444++){var _0x438df3=_0x36a3af[_0x4815b0[_0x47e444]][_0x4281('0xa')](function(_0x6f0675){return _0x6f0675[_0x4281('0xb')]==='IPv4'&&_0x6f0675[_0x4281('0xc')]===![];});_0x4ce955=_0x4ce955['concat'](_0x438df3);}return _0x4ce955;}function getFirstInterface(){var _0x45f4eb=_[_0x4281('0xd')](getInterfaces());return{'macAddress':_0x45f4eb&&_0x45f4eb[_0x4281('0xe')]?_0x45f4eb[_0x4281('0xe')]:_0x4281('0xf'),'ipAddress':_0x45f4eb&&_0x45f4eb[_0x4281('0x10')]?_0x45f4eb[_0x4281('0x10')]:_0x4281('0x11')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x50ca4d=_[_0x4281('0x7')](os[_0x4281('0x12')]()[_0x4281('0x13')](function(_0x5e1f22){return _0x5e1f22[_0x4281('0x14')];}))['join'](':');return crypto[_0x4281('0x15')]('md5')[_0x4281('0x16')](_0x50ca4d)[_0x4281('0x17')]('hex');}exports[_0x4281('0x18')]=function(){var _0x1b172c=os[_0x4281('0x19')]();var _0x5c94f6=/[0-9a-f-]{36}/;if(config[_0x4281('0x1a')]&&_0x5c94f6[_0x4281('0x1b')](config[_0x4281('0x1a')])){return config[_0x4281('0x1a')];}else if(_0x1b172c==='win32'){return exec(_0x4281('0x1c'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x3d1eae=getFirstInterface();var _0x5dddad=getCPUhash();var _0x4f9793=_0x5dddad+'|'+os[_0x4281('0x1d')]()+'|'+_0x3d1eae[_0x4281('0x1e')]+'|'+_0x3d1eae[_0x4281('0x1f')];var _0x38ee3b=crypto['createHash']('md5')['update'](_0x4f9793)[_0x4281('0x17')](_0x4281('0x20'));return _0x38ee3b['substring'](0x0,0x8)+'-'+_0x38ee3b['substring'](0x8,0xc)+'-'+_0x38ee3b[_0x4281('0x21')](0xc,0x10)+'-'+_0x38ee3b['substring'](0x10,0x14)+'-'+_0x38ee3b[_0x4281('0x21')](0x14);}}; \ No newline at end of file +var _0x7f92=['md5','update','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','hex','substring','lodash','child_process','execSync','../environment','orderBy','length','filter','family','IPv4','internal','concat','mac','address','getFirstInterface','map','join'];(function(_0x2dad51,_0x1c260a){var _0x308c85=function(_0x15a37c){while(--_0x15a37c){_0x2dad51['push'](_0x2dad51['shift']());}};_0x308c85(++_0x1c260a);}(_0x7f92,0x74));var _0x27f9=function(_0xd6ba7e,_0x353a59){_0xd6ba7e=_0xd6ba7e-0x0;var _0x23d01d=_0x7f92[_0xd6ba7e];return _0x23d01d;};'use strict';var _=require(_0x27f9('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x27f9('0x1'))[_0x27f9('0x2')];var config=require(_0x27f9('0x3'));function getInterfaces(){var _0x540104=[];var _0x427591=os['networkInterfaces']();var _0x9eb72e=_[_0x27f9('0x4')](_['keys'](_0x427591));for(var _0x5ec7eb=0x0;_0x5ec7eb<_0x9eb72e[_0x27f9('0x5')];_0x5ec7eb++){var _0x2843b6=_0x427591[_0x9eb72e[_0x5ec7eb]][_0x27f9('0x6')](function(_0x175307){return _0x175307[_0x27f9('0x7')]===_0x27f9('0x8')&&_0x175307[_0x27f9('0x9')]===![];});_0x540104=_0x540104[_0x27f9('0xa')](_0x2843b6);}return _0x540104;}function getFirstInterface(){var _0x235686=_['head'](getInterfaces());return{'macAddress':_0x235686&&_0x235686[_0x27f9('0xb')]?_0x235686[_0x27f9('0xb')]:'00:00:00:00:00:00','ipAddress':_0x235686&&_0x235686['address']?_0x235686[_0x27f9('0xc')]:'127.0.0.1'};}exports[_0x27f9('0xd')]=getFirstInterface;function getCPUhash(){var _0x171606=_['orderBy'](os['cpus']()[_0x27f9('0xe')](function(_0x3c54d7){return _0x3c54d7['model'];}))[_0x27f9('0xf')](':');return crypto['createHash'](_0x27f9('0x10'))[_0x27f9('0x11')](_0x171606)[_0x27f9('0x12')]('hex');}exports[_0x27f9('0x13')]=function(){var _0x39b06c=os[_0x27f9('0x14')]();var _0x19936d=/[0-9a-f-]{36}/;if(config[_0x27f9('0x15')]&&_0x19936d[_0x27f9('0x16')](config['licenseToken'])){return config[_0x27f9('0x15')];}else if(_0x39b06c===_0x27f9('0x17')){return exec(_0x27f9('0x18'),{'encoding':_0x27f9('0x19')})[_0x27f9('0x1a')]('\x0d\x0a','');}else{var _0x18d148=getFirstInterface();var _0x50950e=getCPUhash();var _0x386cfa=_0x50950e+'|'+os[_0x27f9('0x1b')]()+'|'+_0x18d148[_0x27f9('0x1c')]+'|'+_0x18d148[_0x27f9('0x1d')];var _0x352824=crypto[_0x27f9('0x1e')]('md5')[_0x27f9('0x11')](_0x386cfa)[_0x27f9('0x12')](_0x27f9('0x1f'));return _0x352824[_0x27f9('0x20')](0x0,0x8)+'-'+_0x352824['substring'](0x8,0xc)+'-'+_0x352824[_0x27f9('0x20')](0xc,0x10)+'-'+_0x352824[_0x27f9('0x20')](0x10,0x14)+'-'+_0x352824['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 4d58689..a0a733c 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 _0xac8a=['version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','moment','request-promise','../../mysqldb','../../components/encryptor','license','https://www.xcallymotion.com','format','exports'];(function(_0x578909,_0xfccf01){var _0x390723=function(_0x4c7b65){while(--_0x4c7b65){_0x578909['push'](_0x578909['shift']());}};_0x390723(++_0xfccf01);}(_0xac8a,0x1c0));var _0xaac8=function(_0x3e374e,_0x1bae81){_0x3e374e=_0x3e374e-0x0;var _0x55286f=_0xac8a[_0x3e374e];return _0x55286f;};'use strict';var util=require('util');var moment=require(_0xaac8('0x0'));var rp=require(_0xaac8('0x1'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require(_0xaac8('0x2'))['db'];var encryptor=require(_0xaac8('0x3'));var hardware=require('./hardware');var logger=require('../logger')(_0xaac8('0x4'));var HOST=_0xaac8('0x5');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xb07caa){return new BPromise(function(_0x2c7148,_0x52f630){var _0x26ca92=util[_0xaac8('0x6')]('%s/api/servers/%s/check?version=%s',HOST,_0xb07caa,module[_0xaac8('0x7')][_0xaac8('0x8')]);if(oldToken){_0x26ca92=util['format'](_0xaac8('0x9'),HOST,_0xb07caa,module['exports'][_0xaac8('0x8')],oldToken);}var _0x458e41={'uri':_0x26ca92,'method':_0xaac8('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x458e41)['then'](function(_0xa4f3b4){_0x2c7148(_0xa4f3b4);})[_0xaac8('0xb')](function(_0x558e84){_0x52f630(_0x558e84);});});}function manageLicense(_0xf433ed,_0x27382f){var _0x3e090c=_0x27382f[_0xaac8('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x3e090c[_0xaac8('0xd')]!==_0xf433ed&&!_0x3e090c[_0xaac8('0xe')]){oldToken=_0x3e090c[_0xaac8('0xd')];}httpRequest(_0xf433ed)['then'](function(_0x3aaef5){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3aaef5[_0xaac8('0xf')]){isOldTokenSent=![];if(!_0x3e090c[_0xaac8('0x4')]&&_0x3e090c[_0xaac8('0x4')]!=_0x3aaef5['license']||_0x3e090c[_0xaac8('0x4')]&&_0x3e090c[_0xaac8('0xe')]){logger[_0xaac8('0x10')](_0xaac8('0x11'));}if(_0x3e090c[_0xaac8('0x4')]&&!_0x3e090c['data2']&&_0x3e090c[_0xaac8('0x4')]!=_0x3aaef5['license']){logger['info'](_0xaac8('0x12'));}if(_0x3e090c[_0xaac8('0x4')]&&!_0x3e090c[_0xaac8('0xe')]&&_0x3e090c[_0xaac8('0x4')]==_0x3aaef5[_0xaac8('0x4')]){return _0x27382f;}return _0x27382f[_0xaac8('0x13')]({'data1':_0xf433ed,'data2':null,'license':_0x3aaef5[_0xaac8('0x4')]});}else{if(_0x3aaef5[_0xaac8('0x4')]||_0x3e090c['license']){if(!_0x3e090c['data2']){if(_0x3e090c[_0xaac8('0xd')]==_0xf433ed){GRAY_PERIOD_REASON=_0xaac8('0x14');logger['info'](_0xaac8('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xaac8('0x10')](_0xaac8('0x16'),_0x3e090c['data1'],_0xf433ed);}logger[_0xaac8('0x10')](_0xaac8('0x17'),GRAY_PERIOD_REASON[_0xaac8('0x18')](),moment()[_0xaac8('0x6')](_0xaac8('0x19')));return _0x27382f['update']({'data2':encryptor[_0xaac8('0x1a')](moment()['format'](_0xaac8('0x19')))});}else{if(moment()[_0xaac8('0x1b')](encryptor[_0xaac8('0x1c')](_0x3e090c[_0xaac8('0xe')]),'days')>DAYS){logger['info'](_0xaac8('0x1d'),moment()[_0xaac8('0x6')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x27382f[_0xaac8('0x13')]({'data1':_0xf433ed,'data2':null,'license':null});}}}else{if(_0x3e090c[_0xaac8('0xd')]!=_0xf433ed){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3e090c[_0xaac8('0xd')],_0xf433ed);return _0x27382f[_0xaac8('0x13')]({'data1':_0xf433ed,'data2':null,'license':null});}}}return _0x27382f;})['then'](function(_0x1f0f89){_0x27382f=_0x1f0f89;})['catch'](function(_0x48727b){logger[_0xaac8('0x1e')](_0x48727b['message']);})[_0xaac8('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0xaac8('0x20')](),_0x27382f);},TIME);});}function defaultLicense(){var _0x23adfe=hardware[_0xaac8('0x20')]();if(_0x23adfe){return db[_0xaac8('0x21')][_0xaac8('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x23adfe}})['spread'](function(_0xb8ca0b,_0x5cfc26){logger[_0xaac8('0x10')](_0xaac8('0x23'),_0x23adfe);manageLicense(_0x23adfe,_0xb8ca0b);})[_0xaac8('0xb')](function(_0x32dbbc){logger['error'](_0x32dbbc[_0xaac8('0x24')]);});}}exports[_0xaac8('0x25')]=defaultLicense; \ No newline at end of file +var _0x96c4=['data2','active','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','util','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','../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','then','catch','get','data1'];(function(_0x4dbe4a,_0x4d9156){var _0x17dbd8=function(_0x13d216){while(--_0x13d216){_0x4dbe4a['push'](_0x4dbe4a['shift']());}};_0x17dbd8(++_0x4d9156);}(_0x96c4,0x12e));var _0x496c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x96c4[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x496c('0x0'));var moment=require('moment');var rp=require(_0x496c('0x1'));var BPromise=require(_0x496c('0x2'));var pkginfo=require(_0x496c('0x3'))(module,'version');var db=require(_0x496c('0x4'))['db'];var encryptor=require(_0x496c('0x5'));var hardware=require('./hardware');var logger=require(_0x496c('0x6'))(_0x496c('0x7'));var HOST=_0x496c('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x242c67){return new BPromise(function(_0x14f9dc,_0x531d3f){var _0x2a2706=util[_0x496c('0x9')](_0x496c('0xa'),HOST,_0x242c67,module[_0x496c('0xb')][_0x496c('0xc')]);if(oldToken){_0x2a2706=util[_0x496c('0x9')](_0x496c('0xd'),HOST,_0x242c67,module[_0x496c('0xb')][_0x496c('0xc')],oldToken);}var _0x3fed70={'uri':_0x2a2706,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3fed70)[_0x496c('0xe')](function(_0x3401bd){_0x14f9dc(_0x3401bd);})[_0x496c('0xf')](function(_0x27c662){_0x531d3f(_0x27c662);});});}function manageLicense(_0x972bba,_0x1afd85){var _0x2b36c5=_0x1afd85[_0x496c('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x2b36c5[_0x496c('0x11')]!==_0x972bba&&!_0x2b36c5[_0x496c('0x12')]){oldToken=_0x2b36c5[_0x496c('0x11')];}httpRequest(_0x972bba)[_0x496c('0xe')](function(_0x20c3b0){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x20c3b0[_0x496c('0x13')]){isOldTokenSent=![];if(!_0x2b36c5[_0x496c('0x7')]&&_0x2b36c5[_0x496c('0x7')]!=_0x20c3b0[_0x496c('0x7')]||_0x2b36c5[_0x496c('0x7')]&&_0x2b36c5['data2']){logger[_0x496c('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2b36c5[_0x496c('0x7')]&&!_0x2b36c5[_0x496c('0x12')]&&_0x2b36c5[_0x496c('0x7')]!=_0x20c3b0[_0x496c('0x7')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2b36c5['license']&&!_0x2b36c5[_0x496c('0x12')]&&_0x2b36c5['license']==_0x20c3b0['license']){return _0x1afd85;}return _0x1afd85[_0x496c('0x15')]({'data1':_0x972bba,'data2':null,'license':_0x20c3b0[_0x496c('0x7')]});}else{if(_0x20c3b0[_0x496c('0x7')]||_0x2b36c5[_0x496c('0x7')]){if(!_0x2b36c5[_0x496c('0x12')]){if(_0x2b36c5[_0x496c('0x11')]==_0x972bba){GRAY_PERIOD_REASON=_0x496c('0x16');logger[_0x496c('0x14')](_0x496c('0x17'));}else{GRAY_PERIOD_REASON=_0x496c('0x18');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2b36c5[_0x496c('0x11')],_0x972bba);}logger['info'](_0x496c('0x19'),GRAY_PERIOD_REASON[_0x496c('0x1a')](),moment()[_0x496c('0x9')](_0x496c('0x1b')));return _0x1afd85[_0x496c('0x15')]({'data2':encryptor[_0x496c('0x1c')](moment()[_0x496c('0x9')](_0x496c('0x1b')))});}else{if(moment()[_0x496c('0x1d')](encryptor[_0x496c('0x1e')](_0x2b36c5[_0x496c('0x12')]),_0x496c('0x1f'))>DAYS){logger[_0x496c('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x496c('0x9')](_0x496c('0x1b')));isOldTokenSent=![];return _0x1afd85[_0x496c('0x15')]({'data1':_0x972bba,'data2':null,'license':null});}}}else{if(_0x2b36c5[_0x496c('0x11')]!=_0x972bba){logger[_0x496c('0x14')](_0x496c('0x20'),_0x2b36c5[_0x496c('0x11')],_0x972bba);return _0x1afd85[_0x496c('0x15')]({'data1':_0x972bba,'data2':null,'license':null});}}}return _0x1afd85;})[_0x496c('0xe')](function(_0x36fc26){_0x1afd85=_0x36fc26;})[_0x496c('0xf')](function(_0x27f611){logger[_0x496c('0x21')](_0x27f611[_0x496c('0x22')]);})[_0x496c('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x496c('0x24')](),_0x1afd85);},TIME);});}function defaultLicense(){var _0x5ed304=hardware[_0x496c('0x24')]();if(_0x5ed304){return db[_0x496c('0x25')][_0x496c('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x5ed304}})[_0x496c('0x27')](function(_0x54f7e0,_0x25cb24){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x5ed304);manageLicense(_0x5ed304,_0x54f7e0);})['catch'](function(_0x846c72){logger[_0x496c('0x21')](_0x846c72[_0x496c('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 34b53f6..627f0c2 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 _0x93e8=['license','data2','split','decryptString','format','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','changed','message','User','findAll','role','COUNT','sequelize','col','admin','user','telephone','users','telephones','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','License','find','then','catch','uuid','data1'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x93e8,0x162));var _0x893e=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x93e8[_0x369151];return _0x4292d5;};'use strict';var util=require(_0x893e('0x0'));var _=require(_0x893e('0x1'));var moment=require(_0x893e('0x2'));var BPromise=require(_0x893e('0x3'));var hardware=require('./hardware');var encryptor=require(_0x893e('0x4'));var db=require(_0x893e('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x893e('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x893e('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x893e('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xf0f73){return new BPromise(function(_0x31b0e9,_0x17d202){return db[_0x893e('0x8')][_0x893e('0x9')](_['defaults'](_0xf0f73,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x22621d){return checkLicense(_0x22621d,null);})[_0x893e('0xa')](function(_0x44ef67){_0x31b0e9(_0x44ef67);return;})[_0x893e('0xb')](function(_0x424725){_0x17d202(_0x424725);});});}function checkLicense(_0x5d21da,_0x50508e){if(!_0x5d21da){demoLicense[_0x893e('0xc')]=_0x5d21da[_0x893e('0xd')];return demoLicense;}try{var _0xf57b68=_0x50508e||_0x5d21da[_0x893e('0xe')];if(_['isEmpty'](_0xf57b68)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x42f2ce=_0x5d21da['data1'];var _0x1a3faa=_0x5d21da[_0x893e('0xf')];var _0x2ad447=_0x42f2ce[_0x893e('0x10')]('-')[0x4];var _0x4c4b4b=_0x42f2ce[_0x893e('0x10')]('-')[0x0];var _0x3cc4a4=encryptor[_0x893e('0x11')](_0xf57b68,util[_0x893e('0x12')](_0x893e('0x13'),_0x2ad447,_0x42f2ce,_0x4c4b4b));var _0x49c0b9=JSON[_0x893e('0x14')](_0x3cc4a4);_0x49c0b9['demo']=![];_0x49c0b9['uuid']=_0x42f2ce;_0x49c0b9[_0x893e('0x15')]=hardware[_0x893e('0x7')]();if(_0x1a3faa){var _0x3f768e=encryptor[_0x893e('0x11')](_0x1a3faa);_0x49c0b9[_0x893e('0x16')]=_0x3f768e;_0x49c0b9[_0x893e('0x17')]=moment(_0x3f768e)[_0x893e('0x18')](0x7,_0x893e('0x19'))[_0x893e('0x12')]();_0x49c0b9['grayReason']=_0x49c0b9['uuid']!=_0x49c0b9[_0x893e('0x15')]?_0x893e('0x1a'):'disabled';}return _0x49c0b9;}catch(_0x2e8105){breakingLicense['uuid']=_0x5d21da[_0x893e('0xd')];breakingLicense[_0x893e('0x1b')]=_0x2e8105[_0x893e('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x30fb37,_0x300de4){getLicense()[_0x893e('0xa')](function(_0x339dfd){return db[_0x893e('0x1c')][_0x893e('0x1d')]({'attributes':[_0x893e('0x1e'),[db['sequelize']['fn'](_0x893e('0x1f'),db[_0x893e('0x20')][_0x893e('0x21')](_0x893e('0x1e'))),'count']],'group':_0x893e('0x1e'),'where':{'role':{'$or':[_0x893e('0x22'),_0x893e('0x23'),_0x893e('0x24')]}},'raw':!![]})[_0x893e('0xa')](function(_0x5f0466){var _0x19590b={'user':_0x339dfd[_0x893e('0x25')]||0x0,'telephone':_0x339dfd[_0x893e('0x26')]||0x0};_0x5f0466[_0x893e('0x27')](function(_0x2ffa78){var _0x126e2b=_0x2ffa78['role']==='admin'?_0x893e('0x23'):_0x2ffa78[_0x893e('0x1e')];_0x19590b[_0x126e2b]-=_0x2ffa78[_0x893e('0x28')];if(_0x19590b[_0x126e2b]<0x0)_0x19590b[_0x126e2b]=0x0;});_0x30fb37(_0x19590b);return;});})[_0x893e('0xb')](function(_0x39d979){_0x300de4(_0x39d979);});});}function checkUserLimits(_0x538564){return new BPromise(function(_0x24e50d,_0x3b39a2){getLimits()[_0x893e('0xa')](function(_0x2faf7f){var _0x27171e=_[_0x893e('0x29')](_[_0x893e('0x2a')](_0x538564,_0x893e('0x1e')),['admin','user',_0x893e('0x24')]);var _0x5a9bc6=(_0x27171e[_0x893e('0x22')]||0x0)+(_0x27171e[_0x893e('0x23')]||0x0);var _0xc186c2=_0x27171e[_0x893e('0x24')]||0x0;if(_0x5a9bc6>_0x2faf7f['user'])return _0x3b39a2(_0x893e('0x2b'));if(_0xc186c2>_0x2faf7f[_0x893e('0x24')])return _0x3b39a2(_0x893e('0x2c'));return _0x24e50d();})['catch'](function(_0x445959){_0x3b39a2(_0x445959);});});}module[_0x893e('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x896d=['sequelize','count','role','admin','telephone','users','telephones','forEach','user','catch','pick','countBy','exports','util','lodash','moment','bluebird','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','then','uuid','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','grayReason','machineUuid','disabled','message','User','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x896d,0x88));var _0xd896=function(_0x236c67,_0x319a31){_0x236c67=_0x236c67-0x0;var _0x5b71e8=_0x896d[_0x236c67];return _0x5b71e8;};'use strict';var util=require(_0xd896('0x0'));var _=require(_0xd896('0x1'));var moment=require(_0xd896('0x2'));var BPromise=require(_0xd896('0x3'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd896('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd896('0x5'),'machineUuid':hardware[_0xd896('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd896('0x7'),'machineUuid':hardware[_0xd896('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1f91d6){return new BPromise(function(_0x24de26,_0x63a4fb){return db[_0xd896('0x8')][_0xd896('0x9')](_['defaults'](_0x1f91d6,{'raw':!![],'where':{'id':0x1}}))[_0xd896('0xa')](function(_0x456715){return checkLicense(_0x456715,null);})[_0xd896('0xa')](function(_0x4a49ae){_0x24de26(_0x4a49ae);return;})['catch'](function(_0x18f005){_0x63a4fb(_0x18f005);});});}function checkLicense(_0x2daea2,_0xaf36d7){if(!_0x2daea2){demoLicense[_0xd896('0xb')]=_0x2daea2[_0xd896('0xc')];return demoLicense;}try{var _0x6b2552=_0xaf36d7||_0x2daea2[_0xd896('0xd')];if(_[_0xd896('0xe')](_0x6b2552)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xc8af75=_0x2daea2['data1'];var _0x2838da=_0x2daea2[_0xd896('0xf')];var _0x4ecc10=_0xc8af75[_0xd896('0x10')]('-')[0x4];var _0x2a6c97=_0xc8af75[_0xd896('0x10')]('-')[0x0];var _0x4f1f13=encryptor[_0xd896('0x11')](_0x6b2552,util[_0xd896('0x12')](_0xd896('0x13'),_0x4ecc10,_0xc8af75,_0x2a6c97));var _0x4562cf=JSON[_0xd896('0x14')](_0x4f1f13);_0x4562cf[_0xd896('0x15')]=![];_0x4562cf['uuid']=_0xc8af75;_0x4562cf['machineUuid']=hardware[_0xd896('0x6')]();if(_0x2838da){var _0xb92406=encryptor[_0xd896('0x11')](_0x2838da);_0x4562cf['gray']=_0xb92406;_0x4562cf['deadline']=moment(_0xb92406)['add'](0x7,'days')['format']();_0x4562cf[_0xd896('0x16')]=_0x4562cf[_0xd896('0xb')]!=_0x4562cf[_0xd896('0x17')]?'changed':_0xd896('0x18');}return _0x4562cf;}catch(_0x26868f){breakingLicense[_0xd896('0xb')]=_0x2daea2[_0xd896('0xc')];breakingLicense[_0xd896('0x19')]=_0x26868f['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3fb97f,_0x1b71d2){getLicense()[_0xd896('0xa')](function(_0x45580b){return db[_0xd896('0x1a')][_0xd896('0x1b')]({'attributes':['role',[db['sequelize']['fn']('COUNT',db[_0xd896('0x1c')]['col']('role')),_0xd896('0x1d')]],'group':_0xd896('0x1e'),'where':{'role':{'$or':[_0xd896('0x1f'),'user',_0xd896('0x20')]}},'raw':!![]})['then'](function(_0x3a5882){var _0x142dd5={'user':_0x45580b[_0xd896('0x21')]||0x0,'telephone':_0x45580b[_0xd896('0x22')]||0x0};_0x3a5882[_0xd896('0x23')](function(_0x366f79){var _0x12b1ef=_0x366f79[_0xd896('0x1e')]===_0xd896('0x1f')?_0xd896('0x24'):_0x366f79[_0xd896('0x1e')];_0x142dd5[_0x12b1ef]-=_0x366f79[_0xd896('0x1d')];if(_0x142dd5[_0x12b1ef]<0x0)_0x142dd5[_0x12b1ef]=0x0;});_0x3fb97f(_0x142dd5);return;});})[_0xd896('0x25')](function(_0x5086dc){_0x1b71d2(_0x5086dc);});});}function checkUserLimits(_0x2fa69b){return new BPromise(function(_0x49f6b4,_0x4fd641){getLimits()['then'](function(_0x451ea0){var _0x46940f=_[_0xd896('0x26')](_[_0xd896('0x27')](_0x2fa69b,_0xd896('0x1e')),['admin',_0xd896('0x24'),_0xd896('0x20')]);var _0x3928b7=(_0x46940f[_0xd896('0x1f')]||0x0)+(_0x46940f['user']||0x0);var _0x10b3aa=_0x46940f[_0xd896('0x20')]||0x0;if(_0x3928b7>_0x451ea0[_0xd896('0x24')])return _0x4fd641('License\x20limit\x20reached\x20for\x20users');if(_0x10b3aa>_0x451ea0[_0xd896('0x20')])return _0x4fd641('License\x20limit\x20reached\x20for\x20telephones');return _0x49f6b4();})[_0xd896('0x25')](function(_0x4af9df){_0x4fd641(_0x4af9df);});});}module[_0xd896('0x28')]={'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 8333f88..1a79cb5 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 _0x0424=['myappanuglar-secret','app-id','secret'];(function(_0x4bff1e,_0x57c25f){var _0x2251bd=function(_0x460fad){while(--_0x460fad){_0x4bff1e['push'](_0x4bff1e['shift']());}};_0x2251bd(++_0x57c25f);}(_0x0424,0x159));var _0x4042=function(_0x315add,_0x5e9ace){_0x315add=_0x315add-0x0;var _0x40956b=_0x0424[_0x315add];return _0x40956b;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x4042('0x0'),'GOOGLE_ID':_0x4042('0x1'),'GOOGLE_SECRET':_0x4042('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x4991=['secret','exports','myappanuglar-secret'];(function(_0x5149da,_0x17be74){var _0x560b50=function(_0x210270){while(--_0x210270){_0x5149da['push'](_0x5149da['shift']());}};_0x560b50(++_0x17be74);}(_0x4991,0xf7));var _0x1499=function(_0x58692f,_0x2cc27a){_0x58692f=_0x58692f-0x0;var _0x3718c5=_0x4991[_0x58692f];return _0x3718c5;};'use strict';module[_0x1499('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1499('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x1499('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 4db20f8..865f43b 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd489=['fileLogger','exports','../utils/loggers'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0xd489,0x74));var _0x9d48=function(_0x12389b,_0x3c4f6e){_0x12389b=_0x12389b-0x0;var _0xe985a2=_0xd489[_0x12389b];return _0xe985a2;};'use strict';var fileLogger=require(_0x9d48('0x0'))[_0x9d48('0x1')];module[_0x9d48('0x2')]=fileLogger; \ No newline at end of file +var _0xa0bd=['exports','../utils/loggers','fileLogger'];(function(_0x201a9f,_0x53160a){var _0x504b82=function(_0x6a4637){while(--_0x6a4637){_0x201a9f['push'](_0x201a9f['shift']());}};_0x504b82(++_0x53160a);}(_0xa0bd,0x15a));var _0xda0b=function(_0x451439,_0x1186fe){_0x451439=_0x451439-0x0;var _0x488e51=_0xa0bd[_0x451439];return _0x488e51;};'use strict';var fileLogger=require(_0xda0b('0x0'))[_0xda0b('0x1')];module[_0xda0b('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4ad2f40..d86a313 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 _0xdfd0=['join','root','legacy-libs','express','../../services/express/index.js','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','path','../../config/environment','resolve'];(function(_0x21e864,_0x18d0d7){var _0x112588=function(_0x2e4528){while(--_0x2e4528){_0x21e864['push'](_0x21e864['shift']());}};_0x112588(++_0x18d0d7);}(_0xdfd0,0x169));var _0x0dfd=function(_0xf97ceb,_0x457ab8){_0xf97ceb=_0xf97ceb-0x0;var _0x3f997c=_0xdfd0[_0xf97ceb];return _0x3f997c;};'use strict';var path=require(_0x0dfd('0x0'));var cfg=require(_0x0dfd('0x1'));var env={'NODE_PATH':path[_0x0dfd('0x2')](path[_0x0dfd('0x3')](cfg[_0x0dfd('0x4')],_0x0dfd('0x5')))};var pm2config={'apps':[{'name':_0x0dfd('0x6'),'script':path['join'](__dirname,_0x0dfd('0x7')),'env':env},{'name':'ami','script':path[_0x0dfd('0x3')](__dirname,_0x0dfd('0x8')),'env':env},{'name':'agi','script':path[_0x0dfd('0x3')](__dirname,_0x0dfd('0x9')),'env':env},{'name':'email','script':path[_0x0dfd('0x3')](__dirname,_0x0dfd('0xa')),'env':env},{'name':_0x0dfd('0xb'),'script':path[_0x0dfd('0x3')](__dirname,_0x0dfd('0xc')),'env':env},{'name':_0x0dfd('0xd'),'script':path[_0x0dfd('0x3')](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x7b0c=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','join','legacy-libs','express','../../services/express/index.js','ami'];(function(_0x3ab741,_0x26b9f5){var _0x2f6774=function(_0x2abe2a){while(--_0x2abe2a){_0x3ab741['push'](_0x3ab741['shift']());}};_0x2f6774(++_0x26b9f5);}(_0x7b0c,0x117));var _0xc7b0=function(_0xeae77d,_0x1ad801){_0xeae77d=_0xeae77d-0x0;var _0x27cc0a=_0x7b0c[_0xeae77d];return _0x27cc0a;};'use strict';var path=require(_0xc7b0('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path['resolve'](path[_0xc7b0('0x1')](cfg['root'],_0xc7b0('0x2')))};var pm2config={'apps':[{'name':_0xc7b0('0x3'),'script':path['join'](__dirname,_0xc7b0('0x4')),'env':env},{'name':_0xc7b0('0x5'),'script':path[_0xc7b0('0x1')](__dirname,_0xc7b0('0x6')),'env':env},{'name':_0xc7b0('0x7'),'script':path[_0xc7b0('0x1')](__dirname,_0xc7b0('0x8')),'env':env},{'name':_0xc7b0('0x9'),'script':path['join'](__dirname,_0xc7b0('0xa')),'env':env},{'name':_0xc7b0('0xb'),'script':path[_0xc7b0('0x1')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0xc7b0('0xc'),'script':path['join'](__dirname,_0xc7b0('0xd')),'env':env}]};module[_0xc7b0('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8440153..0d20463 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 _0x7fdc=['connected','start','then','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','connect'];(function(_0x3e1415,_0x2ad5ee){var _0x2e1ec7=function(_0x4beb31){while(--_0x4beb31){_0x3e1415['push'](_0x3e1415['shift']());}};_0x2e1ec7(++_0x2ad5ee);}(_0x7fdc,0x15b));var _0xc7fd=function(_0x1ff2ee,_0x3e93b6){_0x1ff2ee=_0x1ff2ee-0x0;var _0x21b1b7=_0x7fdc[_0x1ff2ee];return _0x21b1b7;};'use strict';var pm2=require(_0xc7fd('0x0'));var BPromise=require(_0xc7fd('0x1'));var config=require(_0xc7fd('0x2'));function connect(){return new BPromise(function(_0x41f526,_0x34348b){return pm2[_0xc7fd('0x3')](function(_0x56e374){if(_0x56e374){return _0x34348b(_0x56e374);}return _0x41f526(_0xc7fd('0x4'));});});};exports[_0xc7fd('0x5')]=function(_0x5b5186){return connect()[_0xc7fd('0x6')](function(){return new BPromise(function(_0x4d84ba,_0x1722ab){return pm2['start'](_0x5b5186,function(_0x5c18b9,_0x304c8c){if(_0x5c18b9){return _0x1722ab(_0x5c18b9);}pm2[_0xc7fd('0x7')]();return _0x4d84ba(_0x304c8c);});});});};exports['stop']=function(_0x1d7fb3){return connect()[_0xc7fd('0x6')](function(){return new BPromise(function(_0xa06ea9,_0x4a06ac){return pm2['stop'](_0x1d7fb3,function(_0x3612a0,_0x4f7aae){if(_0x3612a0){return _0x4a06ac(_0x3612a0);}pm2[_0xc7fd('0x7')]();return _0xa06ea9(_0x4f7aae);});});});};exports[_0xc7fd('0x8')]=function(_0x10ab11){return connect()['then'](function(){return new BPromise(function(_0x39f18d,_0x410a7a){return pm2['restart'](_0x10ab11,function(_0x2551d6,_0x1bf258){if(_0x2551d6){return _0x410a7a(_0x2551d6);}pm2['disconnect']();return _0x39f18d(_0x1bf258);});});});};exports[_0xc7fd('0x9')]=function(){return connect()[_0xc7fd('0x6')](function(){return new BPromise(function(_0x5ab0c9,_0x25fd08){return pm2[_0xc7fd('0x9')](function(_0xa84051,_0x381955){if(_0xa84051){return _0x25fd08(_0xa84051);}pm2[_0xc7fd('0x7')]();return _0x5ab0c9(_0x381955);});});});};exports[_0xc7fd('0xa')]=function(_0x373a13){return connect()['then'](function(){return new BPromise(function(_0x21b45a,_0x44f818){return pm2['describe'](_0x373a13,function(_0x226d6a,_0x14b5df){if(_0x226d6a){return _0x44f818(_0x226d6a);}pm2[_0xc7fd('0x7')]();return _0x21b45a(_0x14b5df);});});});};exports[_0xc7fd('0xb')]=function(_0x5a2f13){return connect()['then'](function(){return new BPromise(function(_0x514658,_0x166959){return pm2[_0xc7fd('0xb')](_0x5a2f13,function(_0x17d0dd,_0x2c3cae){if(_0x17d0dd){return _0x166959(_0x17d0dd);}pm2[_0xc7fd('0x7')]();return _0x514658(_0x2c3cae);});});});};exports[_0xc7fd('0xc')]=function(){return connect()[_0xc7fd('0x6')](function(){return new BPromise(function(_0xcbf90f,_0x39813){return pm2[_0xc7fd('0xc')](function(_0x338e78){if(_0x338e78){return _0x39813(_0x338e78);}return _0xcbf90f('saved');});});});}; \ No newline at end of file +var _0x4dae=['dump','saved','pm2','connected','then','start','stop','disconnect','restart','list','describe','delete'];(function(_0x113fec,_0x382076){var _0x17b19b=function(_0x53de70){while(--_0x53de70){_0x113fec['push'](_0x113fec['shift']());}};_0x17b19b(++_0x382076);}(_0x4dae,0x1d6));var _0xe4da=function(_0x12fe5c,_0x5d54a1){_0x12fe5c=_0x12fe5c-0x0;var _0x118323=_0x4dae[_0x12fe5c];return _0x118323;};'use strict';var pm2=require(_0xe4da('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x1ad756,_0x1e8c88){return pm2['connect'](function(_0x29445e){if(_0x29445e){return _0x1e8c88(_0x29445e);}return _0x1ad756(_0xe4da('0x1'));});});};exports['start']=function(_0x4d4209){return connect()[_0xe4da('0x2')](function(){return new BPromise(function(_0x3e2040,_0x39a6e6){return pm2[_0xe4da('0x3')](_0x4d4209,function(_0x50d4bf,_0x26807b){if(_0x50d4bf){return _0x39a6e6(_0x50d4bf);}pm2['disconnect']();return _0x3e2040(_0x26807b);});});});};exports['stop']=function(_0x48acc0){return connect()['then'](function(){return new BPromise(function(_0x5d6978,_0x109a08){return pm2[_0xe4da('0x4')](_0x48acc0,function(_0x51d175,_0xada038){if(_0x51d175){return _0x109a08(_0x51d175);}pm2[_0xe4da('0x5')]();return _0x5d6978(_0xada038);});});});};exports[_0xe4da('0x6')]=function(_0x1b824e){return connect()[_0xe4da('0x2')](function(){return new BPromise(function(_0x33f4b8,_0x3415d4){return pm2[_0xe4da('0x6')](_0x1b824e,function(_0x219d61,_0x408e89){if(_0x219d61){return _0x3415d4(_0x219d61);}pm2[_0xe4da('0x5')]();return _0x33f4b8(_0x408e89);});});});};exports[_0xe4da('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3efefc,_0x492402){return pm2['list'](function(_0x49c4de,_0x493115){if(_0x49c4de){return _0x492402(_0x49c4de);}pm2[_0xe4da('0x5')]();return _0x3efefc(_0x493115);});});});};exports[_0xe4da('0x8')]=function(_0x46615d){return connect()[_0xe4da('0x2')](function(){return new BPromise(function(_0x21479c,_0x3031c2){return pm2[_0xe4da('0x8')](_0x46615d,function(_0x53edf9,_0x200dc1){if(_0x53edf9){return _0x3031c2(_0x53edf9);}pm2[_0xe4da('0x5')]();return _0x21479c(_0x200dc1);});});});};exports[_0xe4da('0x9')]=function(_0x2ce812){return connect()['then'](function(){return new BPromise(function(_0x12635e,_0x42142a){return pm2[_0xe4da('0x9')](_0x2ce812,function(_0x53123f,_0x2d1e32){if(_0x53123f){return _0x42142a(_0x53123f);}pm2['disconnect']();return _0x12635e(_0x2d1e32);});});});};exports[_0xe4da('0xa')]=function(){return connect()[_0xe4da('0x2')](function(){return new BPromise(function(_0x3247e8,_0x4abe85){return pm2[_0xe4da('0xa')](function(_0x215e5d){if(_0x215e5d){return _0x4abe85(_0x215e5d);}return _0x3247e8(_0xe4da('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f64fc96..b3067f2 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 _0xbea4=['info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','lodash','moment','util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','length','map','join','update','system','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xbea4,0xde));var _0x4bea=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xbea4[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x4bea('0x0'));var moment=require(_0x4bea('0x1'));var Redis=require('ioredis');var util=require(_0x4bea('0x2'));var config=require('../../config/environment');var db=require(_0x4bea('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x4bea('0x4')]=_[_0x4bea('0x5')](config[_0x4bea('0x4')],{'host':_0x4bea('0x6'),'port':0x18eb});var io=require(_0x4bea('0x7'))(new Redis(config[_0x4bea('0x4')]));function closeInteractions(){var _0x1efd2c=0x0;var _0x7ab0b8=[];return db[_0x4bea('0x8')]['find']({'raw':!![],'attributes':['id',_0x4bea('0x9')],'where':{'id':0x1}})[_0x4bea('0xa')](function(_0x478ab5){_0x1efd2c=_0x478ab5[_0x4bea('0x9')];if(_0x1efd2c){return db[_0x4bea('0xb')][_0x4bea('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4bea('0xd')](_0x478ab5[_0x4bea('0x9')],_0x4bea('0xe'))}}});}else{return[];}})[_0x4bea('0xa')](function(_0x4c74f8){if(_0x4c74f8&&_0x4c74f8[_0x4bea('0xf')]){_0x7ab0b8=_[_0x4bea('0x10')](_0x4c74f8||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x7ab0b8[_0x4bea('0x11')]());return db[_0x4bea('0xb')][_0x4bea('0x12')]({'closeReason':_0x4bea('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x4bea('0x14'))},{'where':{'id':_0x7ab0b8}});}})[_0x4bea('0xa')](function(){if(_0x7ab0b8&&_0x7ab0b8[_0x4bea('0xf')]){logger[_0x4bea('0x15')](_0x4bea('0x16'),_0x7ab0b8[_0x4bea('0x11')]());for(var _0x45bb50=0x0;_0x45bb50<_0x7ab0b8[_0x4bea('0xf')];_0x45bb50++){io[_0x4bea('0x17')](_0x4bea('0x18'),{'id':_0x7ab0b8[_0x45bb50],'closed':!![]});}}})[_0x4bea('0x19')](function(_0x101beb){logger['error'](_0x4bea('0x1a'),_0x101beb?util['inspect'](_0x101beb,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd56f=['then','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:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','Setting','chatTimeout'];(function(_0x1a00b8,_0x5363fb){var _0x664a54=function(_0xaadc0c){while(--_0xaadc0c){_0x1a00b8['push'](_0x1a00b8['shift']());}};_0x664a54(++_0x5363fb);}(_0xd56f,0x7f));var _0xfd56=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0xd56f[_0x1b02bb];return _0x131245;};'use strict';var _=require(_0xfd56('0x0'));var moment=require(_0xfd56('0x1'));var Redis=require(_0xfd56('0x2'));var util=require(_0xfd56('0x3'));var config=require(_0xfd56('0x4'));var db=require(_0xfd56('0x5'))['db'];var logger=require(_0xfd56('0x6'))(_0xfd56('0x7'));config['redis']=_['defaults'](config[_0xfd56('0x8')],{'host':_0xfd56('0x9'),'port':0x18eb});var io=require(_0xfd56('0xa'))(new Redis(config[_0xfd56('0x8')]));function closeInteractions(){var _0x12b560=0x0;var _0x15408e=[];return db[_0xfd56('0xb')]['find']({'raw':!![],'attributes':['id',_0xfd56('0xc')],'where':{'id':0x1}})[_0xfd56('0xd')](function(_0x32b9e0){_0x12b560=_0x32b9e0['chatTimeout'];if(_0x12b560){return db['ChatInteraction'][_0xfd56('0xe')]({'raw':!![],'attributes':['id',_0xfd56('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xfd56('0x10')](_0x32b9e0[_0xfd56('0xc')],_0xfd56('0x11'))}}});}else{return[];}})[_0xfd56('0xd')](function(_0x4e6d63){if(_0x4e6d63&&_0x4e6d63[_0xfd56('0x12')]){_0x15408e=_[_0xfd56('0x13')](_0x4e6d63||[],'id');logger[_0xfd56('0x14')](_0xfd56('0x15'),_0x15408e[_0xfd56('0x16')]());return db['ChatInteraction'][_0xfd56('0x17')]({'closeReason':_0xfd56('0x18'),'disposition':_0xfd56('0x19'),'closed':!![],'closedAt':moment()[_0xfd56('0x1a')](_0xfd56('0x1b'))},{'where':{'id':_0x15408e}});}})[_0xfd56('0xd')](function(){if(_0x15408e&&_0x15408e[_0xfd56('0x12')]){logger[_0xfd56('0x14')](_0xfd56('0x1c'),_0x15408e[_0xfd56('0x16')]());for(var _0x4734d0=0x0;_0x4734d0<_0x15408e[_0xfd56('0x12')];_0x4734d0++){io['emit'](_0xfd56('0x1d'),{'id':_0x15408e[_0x4734d0],'closed':!![]});}}})[_0xfd56('0x1e')](function(_0x36ffd4){logger[_0xfd56('0x1f')](_0xfd56('0x20'),_0x36ffd4?util[_0xfd56('0x21')](_0x36ffd4,{'showHidden':![],'depth':null}):'');});}exports[_0xfd56('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 49fcc3b..8ffa037 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 _0x6e8d=['exports','startAllRefreshIntervals'];(function(_0x4cbb7a,_0x3b3542){var _0x44a697=function(_0xdf218e){while(--_0xdf218e){_0x4cbb7a['push'](_0x4cbb7a['shift']());}};_0x44a697(++_0x3b3542);}(_0x6e8d,0x10b));var _0xd6e8=function(_0x1604e8,_0x3f9af3){_0x1604e8=_0x1604e8-0x0;var _0x5ebe51=_0x6e8d[_0x1604e8];return _0x5ebe51;};'use strict';function start(){var _0x13d049=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x13d049[_0xd6e8('0x0')]();}module[_0xd6e8('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x5560=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x4e96c7,_0x1887e9){var _0x3ee359=function(_0x303d5e){while(--_0x303d5e){_0x4e96c7['push'](_0x4e96c7['shift']());}};_0x3ee359(++_0x1887e9);}(_0x5560,0xf2));var _0x0556=function(_0x1273d4,_0x3e97cc){_0x1273d4=_0x1273d4-0x0;var _0xef9f55=_0x5560[_0x1273d4];return _0xef9f55;};'use strict';function start(){var _0x4506b8=require(_0x0556('0x0'));return _0x4506b8[_0x0556('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 69f5e04..cd410c6 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 _0x6827=['status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','SendMail','error','error\x20mail','stringify','email\x20sent','catch','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','MailServerOut','CloudProvider','keys','map','keyBy','intersection','difference','length','exists','deleteJob','delete\x20cron','toRun','toString','resolve','run\x20job','cron','active','isBetween','startAt','start','stop','stop\x20cron','endAt','update','update\x20cron','run','util','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','format','%s.%s','basename','zip'];(function(_0xdb9eee,_0x2e81c1){var _0x40e2e5=function(_0x518754){while(--_0x518754){_0xdb9eee['push'](_0xdb9eee['shift']());}};_0x40e2e5(++_0x2e81c1);}(_0x6827,0x120));var _0x7682=function(_0x588b79,_0x54a0cf){_0x588b79=_0x588b79-0x0;var _0x5d3b3c=_0x6827[_0x588b79];return _0x5d3b3c;};'use strict';var fs=require('fs');var util=require(_0x7682('0x0'));var path=require('path');var _=require(_0x7682('0x1'));var moment=require('moment');var CronJobManager=require(_0x7682('0x2'));var jayson=require(_0x7682('0x3'));var BPromise=require('bluebird');var logger=require(_0x7682('0x4'))(_0x7682('0x5'));var db=require(_0x7682('0x6'))['db'];var analyticCustomReportController=require(_0x7682('0x7'));var analyticDefaultReportController=require(_0x7682('0x8'));var client=jayson[_0x7682('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x31b065,_0x3414f1){return function(){logger[_0x7682('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x31b065[_0x7682('0xb')]);var _0x3e4226=!![];var _0x30128b=_0x31b065[_0x7682('0xc')][_0x7682('0xd')]();var _0x50676c={'account':_0x30128b,'message':{'from':util['format'](_0x7682('0xe'),_0x31b065[_0x7682('0xc')][_0x7682('0xf')],_0x31b065[_0x7682('0xc')]['email']||_0x31b065[_0x7682('0xc')][_0x7682('0x10')]['user']),'to':_0x31b065[_0x7682('0xb')],'cc':_0x31b065['cc'],'bcc':_0x31b065[_0x7682('0x11')],'subject':util['format'](_0x7682('0x12'),_0x3414f1['name'],_0x31b065[_0x7682('0x13')],_0x31b065[_0x7682('0x14')])}};var _0x2a054b=path[_0x7682('0x15')](__dirname,_0x7682('0x16'));var _0x55d4a6=_0x3414f1[_0x7682('0x17')];var _0x3aa4e1=util[_0x7682('0x18')](_0x7682('0x19'),path[_0x7682('0x1a')](_0x3414f1[_0x7682('0x17')],path['extname'](_0x3414f1[_0x7682('0x17')])),_0x7682('0x1b'));var _0x2e9349=path[_0x7682('0x15')](_0x2a054b,_0x55d4a6);var _0xb878eb=path[_0x7682('0x15')](_0x2a054b,_0x3aa4e1);if(fs['existsSync'](_0x2e9349)){_0x3414f1[_0x7682('0x1c')]=_0x7682('0x1d');_0x50676c['message'][_0x7682('0x1e')]=[{'filename':_0x55d4a6,'path':_0x2e9349}];_0x50676c[_0x7682('0x1f')][_0x7682('0x20')]=util[_0x7682('0x18')](_0x7682('0x21'),JSON['stringify'](_0x3414f1,null,0x2));}else if(fs[_0x7682('0x22')](_0xb878eb)){_0x3414f1['status']='Sent';_0x50676c[_0x7682('0x1f')][_0x7682('0x1e')]=[{'filename':_0x3aa4e1,'path':_0xb878eb}];}else{_0x50676c[_0x7682('0x1f')][_0x7682('0x20')]=_0x7682('0x23');if(!_0x31b065['sendIfEmpty']){_0x3e4226=![];logger[_0x7682('0xa')](_0x7682('0x24'));}}if(_0x3e4226){return client['request'](_0x7682('0x25'),_0x50676c)['then'](function(_0x49fa1d){if(_0x49fa1d[_0x7682('0x26')]){return logger['error'](_0x7682('0x27'),JSON[_0x7682('0x28')](_0x49fa1d));}return logger[_0x7682('0xa')](_0x7682('0x29'));})[_0x7682('0x2a')](function(_0x74431a){return logger[_0x7682('0x26')](_0x7682('0x27'),JSON[_0x7682('0x28')](_0x74431a));});}};}function handleError(){return function(_0x37f869){return logger['error'](JSON[_0x7682('0x28')](_0x37f869));};}function handleResult(_0x38c4f4){return function(_0x12fd0b){logger[_0x7682('0xa')]('data',JSON[_0x7682('0x28')](_0x12fd0b));if(_0x38c4f4[_0x7682('0xc')]&&_0x38c4f4[_0x7682('0xc')][_0x7682('0x10')]&&!_['isNil'](_0x38c4f4[_0x7682('0xb')])){setTimeout(handleSendEmail(_0x38c4f4,_0x12fd0b),0x3c*0x3e8);}};}function handleJob(_0x4f9a57){return function(){try{if(_[_0x7682('0x2b')](_0x4f9a57[_0x7682('0x13')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x7682('0x2b')](_0x4f9a57[_0x7682('0x14')])){return logger[_0x7682('0xa')](_0x7682('0x2c'));}var _0x408770={'startDate':moment()[_0x7682('0x2d')](_0x4f9a57[_0x7682('0x13')],_0x4f9a57[_0x7682('0x14')])['format'](_0x7682('0x2e')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x7682('0x2f'),'output':_0x4f9a57['output'],'name':_0x4f9a57[_0x7682('0xf')]};if(!_[_0x7682('0x2b')](_0x4f9a57[_0x7682('0x30')])){logger[_0x7682('0xa')](_0x7682('0x31'),_0x4f9a57[_0x7682('0x30')]);return analyticDefaultReportController[_0x7682('0x32')]({'id':_0x4f9a57['DefaultReportId']},_0x408770)[_0x7682('0x33')](handleResult(_0x4f9a57))[_0x7682('0x2a')](handleError());}if(!_[_0x7682('0x2b')](_0x4f9a57[_0x7682('0x34')])){logger[_0x7682('0xa')]('exec\x20custom\x20report\x20id:%s',_0x4f9a57[_0x7682('0x34')]);return analyticCustomReportController[_0x7682('0x32')]({'id':_0x4f9a57[_0x7682('0x34')]},_0x408770)['then'](handleResult(_0x4f9a57))[_0x7682('0x2a')](handleError());}}catch(_0x252100){logger[_0x7682('0x26')](JSON['stringify'](_0x252100));}return logger[_0x7682('0xa')]('no\x20report\x20id');};}function getJobs(_0x20fbea){var _0x296974={};if(_0x20fbea){_0x296974['id']=_0x20fbea;}return db['Schedule']['findAll']({'where':_0x296974,'include':[{'model':db[_0x7682('0xc')],'attributes':['id','name',_0x7682('0xb')],'include':[{'model':db[_0x7682('0x35')],'as':_0x7682('0x10'),'include':[{'model':db[_0x7682('0x36')],'as':_0x7682('0x36')}]}]}]})[_0x7682('0x33')](function(_0x3c572f){var _0x33b8e5=_[_0x7682('0x37')](manager['jobs']);var _0x1252d9=_[_0x7682('0x38')](_0x3c572f,function(_0x179eb8){return _0x179eb8['id']['toString']();});var _0x25af01=_[_0x7682('0x39')](_0x3c572f,function(_0x13b719){return _0x13b719['id']['toString']();});var _0x10aa25=_0x20fbea?_0x1252d9:_['difference'](_0x1252d9,_0x33b8e5);var _0xe5b890=_[_0x7682('0x3a')](_0x1252d9,_0x33b8e5);var _0x3a225b=_[_0x7682('0x3b')](_0x33b8e5,_0x1252d9);var _0x4d74e7;var _0x51f673;for(_0x4d74e7=0x0;_0x4d74e7<_0x3a225b[_0x7682('0x3c')]&&!_0x20fbea;_0x4d74e7+=0x1){_0x51f673=_0x3a225b[_0x4d74e7]['toString']();if(manager[_0x7682('0x3d')](_0x51f673)){manager['stop'](_0x51f673);manager[_0x7682('0x3e')](_0x51f673);logger[_0x7682('0xa')](_0x7682('0x3f'),_0x51f673);}}logger[_0x7682('0xa')](_0x7682('0x40'),JSON[_0x7682('0x28')](_0x10aa25));for(_0x4d74e7=0x0;_0x4d74e7<_0x10aa25[_0x7682('0x3c')];_0x4d74e7+=0x1){_0x51f673=_0x10aa25[_0x4d74e7][_0x7682('0x41')]();logger[_0x7682('0xa')]('index',_0x51f673);if(_0x20fbea){logger[_0x7682('0xa')]('my\x20id',_0x20fbea);logger[_0x7682('0xa')](JSON['stringify'](_0x25af01[_0x51f673]));BPromise[_0x7682('0x42')]()[_0x7682('0x33')](handleJob(_0x25af01[_0x51f673]));logger[_0x7682('0xa')](_0x7682('0x43'),_0x25af01[_0x51f673][_0x7682('0xf')],_0x25af01[_0x51f673]['cron']);}else if(_0x25af01[_0x51f673][_0x7682('0x44')]&&_0x25af01[_0x51f673][_0x7682('0x45')]&&moment()[_0x7682('0x46')](_0x25af01[_0x51f673][_0x7682('0x47')],_0x25af01[_0x51f673]['endAt'])){manager['add'](_0x51f673,_0x25af01[_0x51f673]['cron'],handleJob(_0x25af01[_0x51f673]));manager[_0x7682('0x48')](_0x51f673);logger[_0x7682('0xa')]('add\x20cron',_0x25af01[_0x51f673][_0x7682('0xf')],_0x25af01[_0x51f673][_0x7682('0x44')]);}else if(manager['exists'](_0x51f673)){manager[_0x7682('0x49')](_0x51f673);manager[_0x7682('0x3e')](_0x51f673);logger[_0x7682('0xa')](_0x7682('0x4a'),_0x25af01[_0x51f673][_0x7682('0xf')],_0x25af01[_0x51f673][_0x7682('0x44')]);}}for(_0x4d74e7=0x0,_0x51f673;_0x4d74e7<_0xe5b890[_0x7682('0x3c')]&&!_0x20fbea;_0x4d74e7+=0x1){_0x51f673=_0xe5b890[_0x4d74e7][_0x7682('0x41')]();if(manager[_0x7682('0x3d')](_0x51f673)){if(_0x25af01[_0x51f673][_0x7682('0x44')]&&_0x25af01[_0x51f673][_0x7682('0x45')]&&moment()[_0x7682('0x46')](_0x25af01[_0x51f673][_0x7682('0x47')],_0x25af01[_0x51f673][_0x7682('0x4b')])){manager[_0x7682('0x4c')](_0x51f673,_0x25af01[_0x51f673][_0x7682('0x44')],handleJob(_0x25af01[_0x51f673]));logger[_0x7682('0xa')](_0x7682('0x4d'),_0x25af01[_0x51f673][_0x7682('0xf')],_0x25af01[_0x51f673][_0x7682('0x44')]);}else{manager[_0x7682('0x49')](_0x51f673);manager[_0x7682('0x3e')](_0x51f673);logger['info'](_0x7682('0x4a'),_0x25af01[_0x51f673][_0x7682('0xf')],_0x25af01[_0x51f673][_0x7682('0x44')]);}}}})['catch'](function(_0x4ab93b){logger['error'](JSON['stringify'](_0x4ab93b));});}exports[_0x7682('0x4e')]=function(_0x64cfcb){return getJobs(_0x64cfcb);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xe4f3=['client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','Smtp','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','join','../../files/reports','%s.%s','savename','extname','existsSync','status','Sent','message','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber','subtract','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','then','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','map','toString','keyBy','intersection','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','cron','isBetween','endAt','start','add\x20cron','stop\x20cron','active','startAt','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller'];(function(_0x1c5630,_0x3094b5){var _0x153d50=function(_0x3070fc){while(--_0x3070fc){_0x1c5630['push'](_0x1c5630['shift']());}};_0x153d50(++_0x3094b5);}(_0xe4f3,0xf3));var _0x3e4f=function(_0x375c7e,_0x399947){_0x375c7e=_0x375c7e-0x0;var _0x337e78=_0xe4f3[_0x375c7e];return _0x337e78;};'use strict';var fs=require('fs');var util=require(_0x3e4f('0x0'));var path=require(_0x3e4f('0x1'));var _=require(_0x3e4f('0x2'));var moment=require(_0x3e4f('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x3e4f('0x4'));var BPromise=require(_0x3e4f('0x5'));var logger=require(_0x3e4f('0x6'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x3e4f('0x7'));var analyticDefaultReportController=require(_0x3e4f('0x8'));var client=jayson[_0x3e4f('0x9')][_0x3e4f('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3d3d12,_0x2b640d){return function(){logger[_0x3e4f('0xb')](_0x3e4f('0xc'),_0x3d3d12[_0x3e4f('0xd')]);var _0x2dd633=!![];var _0x30cbae=_0x3d3d12[_0x3e4f('0xe')][_0x3e4f('0xf')]();var _0xcb764e={'account':_0x30cbae,'message':{'from':util['format'](_0x3e4f('0x10'),_0x3d3d12[_0x3e4f('0xe')]['name'],_0x3d3d12[_0x3e4f('0xe')]['email']||_0x3d3d12[_0x3e4f('0xe')][_0x3e4f('0x11')][_0x3e4f('0x12')]),'to':_0x3d3d12[_0x3e4f('0xd')],'cc':_0x3d3d12['cc'],'bcc':_0x3d3d12[_0x3e4f('0x13')],'subject':util[_0x3e4f('0x14')](_0x3e4f('0x15'),_0x2b640d[_0x3e4f('0x16')],_0x3d3d12['subtractNumber'],_0x3d3d12[_0x3e4f('0x17')])}};var _0x49e8b0=path[_0x3e4f('0x18')](__dirname,_0x3e4f('0x19'));var _0x419698=_0x2b640d['savename'];var _0x18549e=util['format'](_0x3e4f('0x1a'),path['basename'](_0x2b640d[_0x3e4f('0x1b')],path[_0x3e4f('0x1c')](_0x2b640d[_0x3e4f('0x1b')])),'zip');var _0x644054=path[_0x3e4f('0x18')](_0x49e8b0,_0x419698);var _0x5f2b84=path[_0x3e4f('0x18')](_0x49e8b0,_0x18549e);if(fs[_0x3e4f('0x1d')](_0x644054)){_0x2b640d[_0x3e4f('0x1e')]=_0x3e4f('0x1f');_0xcb764e[_0x3e4f('0x20')]['attachments']=[{'filename':_0x419698,'path':_0x644054}];_0xcb764e[_0x3e4f('0x20')]['text']=util[_0x3e4f('0x14')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x3e4f('0x21')](_0x2b640d,null,0x2));}else if(fs[_0x3e4f('0x1d')](_0x5f2b84)){_0x2b640d[_0x3e4f('0x1e')]=_0x3e4f('0x1f');_0xcb764e[_0x3e4f('0x20')]['attachments']=[{'filename':_0x18549e,'path':_0x5f2b84}];}else{_0xcb764e[_0x3e4f('0x20')][_0x3e4f('0x22')]=_0x3e4f('0x23');if(!_0x3d3d12['sendIfEmpty']){_0x2dd633=![];logger[_0x3e4f('0xb')](_0x3e4f('0x24'));}}if(_0x2dd633){return client[_0x3e4f('0x25')](_0x3e4f('0x26'),_0xcb764e)['then'](function(_0x525999){if(_0x525999[_0x3e4f('0x27')]){return logger[_0x3e4f('0x27')](_0x3e4f('0x28'),JSON['stringify'](_0x525999));}return logger['info'](_0x3e4f('0x29'));})[_0x3e4f('0x2a')](function(_0x55d3f3){return logger['error'](_0x3e4f('0x28'),JSON[_0x3e4f('0x21')](_0x55d3f3));});}};}function handleError(){return function(_0x3cfc4f){return logger[_0x3e4f('0x27')](JSON['stringify'](_0x3cfc4f));};}function handleResult(_0x3a465a){return function(_0x38d412){logger[_0x3e4f('0xb')]('data',JSON[_0x3e4f('0x21')](_0x38d412));if(_0x3a465a[_0x3e4f('0xe')]&&_0x3a465a[_0x3e4f('0xe')][_0x3e4f('0x11')]&&!_['isNil'](_0x3a465a[_0x3e4f('0xd')])){setTimeout(handleSendEmail(_0x3a465a,_0x38d412),0x3c*0x3e8);}};}function handleJob(_0x3b5947){return function(){try{if(_[_0x3e4f('0x2b')](_0x3b5947[_0x3e4f('0x2c')])){return logger[_0x3e4f('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x3b5947['subtractUnit'])){return logger[_0x3e4f('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x3e4742={'startDate':moment()[_0x3e4f('0x2d')](_0x3b5947[_0x3e4f('0x2c')],_0x3b5947['subtractUnit'])[_0x3e4f('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x3e4f('0x2e'),'output':_0x3b5947[_0x3e4f('0x2f')],'name':_0x3b5947[_0x3e4f('0x16')]};if(!_['isNil'](_0x3b5947['DefaultReportId'])){logger[_0x3e4f('0xb')](_0x3e4f('0x30'),_0x3b5947[_0x3e4f('0x31')]);return analyticDefaultReportController[_0x3e4f('0x32')]({'id':_0x3b5947[_0x3e4f('0x31')]},_0x3e4742)['then'](handleResult(_0x3b5947))[_0x3e4f('0x2a')](handleError());}if(!_[_0x3e4f('0x2b')](_0x3b5947[_0x3e4f('0x33')])){logger[_0x3e4f('0xb')]('exec\x20custom\x20report\x20id:%s',_0x3b5947[_0x3e4f('0x33')]);return analyticCustomReportController[_0x3e4f('0x32')]({'id':_0x3b5947['CustomReportId']},_0x3e4742)[_0x3e4f('0x34')](handleResult(_0x3b5947))[_0x3e4f('0x2a')](handleError());}}catch(_0x27ebc7){logger['error'](JSON['stringify'](_0x27ebc7));}return logger[_0x3e4f('0xb')](_0x3e4f('0x35'));};}function getJobs(_0x27e78d){var _0x155c47={};if(_0x27e78d){_0x155c47['id']=_0x27e78d;}return db[_0x3e4f('0x36')][_0x3e4f('0x37')]({'where':_0x155c47,'include':[{'model':db[_0x3e4f('0xe')],'attributes':['id',_0x3e4f('0x16'),'email'],'include':[{'model':db[_0x3e4f('0x38')],'as':_0x3e4f('0x11'),'include':[{'model':db['CloudProvider'],'as':_0x3e4f('0x39')}]}]}]})['then'](function(_0x4f604a){var _0x4b1de7=_[_0x3e4f('0x3a')](manager['jobs']);var _0x1c5cd0=_[_0x3e4f('0x3b')](_0x4f604a,function(_0x23233f){return _0x23233f['id'][_0x3e4f('0x3c')]();});var _0x8a58e5=_[_0x3e4f('0x3d')](_0x4f604a,function(_0xe91140){return _0xe91140['id']['toString']();});var _0x4eba56=_0x27e78d?_0x1c5cd0:_['difference'](_0x1c5cd0,_0x4b1de7);var _0x3567f5=_[_0x3e4f('0x3e')](_0x1c5cd0,_0x4b1de7);var _0x49facd=_[_0x3e4f('0x3f')](_0x4b1de7,_0x1c5cd0);var _0x41e883;var _0x5ccb70;for(_0x41e883=0x0;_0x41e883<_0x49facd['length']&&!_0x27e78d;_0x41e883+=0x1){_0x5ccb70=_0x49facd[_0x41e883][_0x3e4f('0x3c')]();if(manager[_0x3e4f('0x40')](_0x5ccb70)){manager[_0x3e4f('0x41')](_0x5ccb70);manager[_0x3e4f('0x42')](_0x5ccb70);logger[_0x3e4f('0xb')](_0x3e4f('0x43'),_0x5ccb70);}}logger[_0x3e4f('0xb')](_0x3e4f('0x44'),JSON[_0x3e4f('0x21')](_0x4eba56));for(_0x41e883=0x0;_0x41e883<_0x4eba56[_0x3e4f('0x45')];_0x41e883+=0x1){_0x5ccb70=_0x4eba56[_0x41e883][_0x3e4f('0x3c')]();logger['info'](_0x3e4f('0x46'),_0x5ccb70);if(_0x27e78d){logger[_0x3e4f('0xb')](_0x3e4f('0x47'),_0x27e78d);logger['info'](JSON['stringify'](_0x8a58e5[_0x5ccb70]));BPromise[_0x3e4f('0x48')]()[_0x3e4f('0x34')](handleJob(_0x8a58e5[_0x5ccb70]));logger[_0x3e4f('0xb')]('run\x20job',_0x8a58e5[_0x5ccb70]['name'],_0x8a58e5[_0x5ccb70]['cron']);}else if(_0x8a58e5[_0x5ccb70][_0x3e4f('0x49')]&&_0x8a58e5[_0x5ccb70]['active']&&moment()[_0x3e4f('0x4a')](_0x8a58e5[_0x5ccb70]['startAt'],_0x8a58e5[_0x5ccb70][_0x3e4f('0x4b')])){manager['add'](_0x5ccb70,_0x8a58e5[_0x5ccb70][_0x3e4f('0x49')],handleJob(_0x8a58e5[_0x5ccb70]));manager[_0x3e4f('0x4c')](_0x5ccb70);logger[_0x3e4f('0xb')](_0x3e4f('0x4d'),_0x8a58e5[_0x5ccb70][_0x3e4f('0x16')],_0x8a58e5[_0x5ccb70][_0x3e4f('0x49')]);}else if(manager[_0x3e4f('0x40')](_0x5ccb70)){manager['stop'](_0x5ccb70);manager['deleteJob'](_0x5ccb70);logger[_0x3e4f('0xb')](_0x3e4f('0x4e'),_0x8a58e5[_0x5ccb70][_0x3e4f('0x16')],_0x8a58e5[_0x5ccb70][_0x3e4f('0x49')]);}}for(_0x41e883=0x0,_0x5ccb70;_0x41e883<_0x3567f5['length']&&!_0x27e78d;_0x41e883+=0x1){_0x5ccb70=_0x3567f5[_0x41e883]['toString']();if(manager[_0x3e4f('0x40')](_0x5ccb70)){if(_0x8a58e5[_0x5ccb70]['cron']&&_0x8a58e5[_0x5ccb70][_0x3e4f('0x4f')]&&moment()[_0x3e4f('0x4a')](_0x8a58e5[_0x5ccb70][_0x3e4f('0x50')],_0x8a58e5[_0x5ccb70][_0x3e4f('0x4b')])){manager[_0x3e4f('0x51')](_0x5ccb70,_0x8a58e5[_0x5ccb70][_0x3e4f('0x49')],handleJob(_0x8a58e5[_0x5ccb70]));logger['info'](_0x3e4f('0x52'),_0x8a58e5[_0x5ccb70]['name'],_0x8a58e5[_0x5ccb70]['cron']);}else{manager[_0x3e4f('0x41')](_0x5ccb70);manager[_0x3e4f('0x42')](_0x5ccb70);logger[_0x3e4f('0xb')](_0x3e4f('0x4e'),_0x8a58e5[_0x5ccb70][_0x3e4f('0x16')],_0x8a58e5[_0x5ccb70][_0x3e4f('0x49')]);}}}})[_0x3e4f('0x2a')](function(_0x26c815){logger[_0x3e4f('0x27')](JSON[_0x3e4f('0x21')](_0x26c815));});}exports[_0x3e4f('0x53')]=function(_0x54cb75){return getJobs(_0x54cb75);};exports[_0x3e4f('0x4c')]=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 76fad2c..30ea5ab 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 _0x8721=['No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','forEach','push','all','inspect','start','lodash','aws-sdk','request-promise','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','sentimentAccountId','ValidationError','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS'];(function(_0x391ace,_0x1aaece){var _0x5776af=function(_0x578c82){while(--_0x578c82){_0x391ace['push'](_0x391ace['shift']());}};_0x5776af(++_0x1aaece);}(_0x8721,0xd9));var _0x1872=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x8721[_0x12bcf7];return _0x2825a;};var _=require(_0x1872('0x0'));var AWS=require(_0x1872('0x1'));var rp=require(_0x1872('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x1872('0x3'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x50a1c5,_0x40690e,_0x1cd36f,_0x3678b3){return new Promise(function(_0x47ca3a,_0x4befaf){var _0x2dc064=new AWS[(_0x1872('0x4'))]({'accessKeyId':_0x40690e,'secretAccessKey':_0x50a1c5,'region':_0x1cd36f});_0x2dc064[_0x1872('0x5')]({'TranscriptionJobName':_0x3678b3},function(_0x4d019e,_0x2aaad6){if(_0x4d019e){return _0x4befaf(_0x4d019e);}else{return _0x47ca3a(_0x2aaad6);}});});}function sentiment(_0x2c2f41,_0x3fe445,_0x2c2b48,_0x1f43c6,_0x1b057e){return new Promise(function(_0x120590,_0x1c18fc){var _0x406daf=new AWS[(_0x1872('0x6'))]({'accessKeyId':_0x3fe445,'secretAccessKey':_0x2c2f41,'region':_0x2c2b48});_0x406daf[_0x1872('0x7')]({'Text':_0x1f43c6,'LanguageCode':_0x1b057e['substring'](0x0,0x2)},function(_0x15a121,_0x392b65){if(_0x15a121){return _0x1c18fc(_0x15a121);}else{return _0x120590(_0x392b65);}});});}function checkTranscribeJob(_0xb6951b,_0x4345d0,_0x5122df){var _0x412663;return new BPromise(function(_0x1a8e90,_0x12ad66){logger[_0x1872('0x8')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xb6951b['id'],_0xb6951b[_0x1872('0x9')]));return getTranscriptionJob(_0x5122df[_0x1872('0xa')],_0x5122df[_0x1872('0xb')],_0x4345d0[_0x1872('0xc')],_0xb6951b[_0x1872('0x9')])[_0x1872('0xd')](function(_0x4be58a){logger['info'](util[_0x1872('0xe')](_0x1872('0xf'),_0xb6951b['id'],_0xb6951b[_0x1872('0x9')],_0x4be58a['TranscriptionJob'][_0x1872('0x10')]));if(!_0xb6951b['fileText']){switch(_0x4be58a[_0x1872('0x11')][_0x1872('0x10')]){case _0x1872('0x12'):var _0x4d1f11={'transcribeStatus':_0x4be58a[_0x1872('0x11')]['TranscriptionJobStatus'],'fileUri':_0x4be58a[_0x1872('0x11')][_0x1872('0x13')][_0x1872('0x14')]};logger[_0x1872('0x8')](util[_0x1872('0xe')]('[RECORDING:%d]\x20Get\x20transcript',_0xb6951b['id']));return rp({'uri':_0x4be58a[_0x1872('0x11')][_0x1872('0x13')][_0x1872('0x14')],'json':!![]})[_0x1872('0xd')](function(_0xcc4221){logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x15'),_0xb6951b['id']));if(_0xcc4221&&_0xcc4221[_0x1872('0x16')]&&_0xcc4221['results']['transcripts']&&_0xcc4221['results'][_0x1872('0x17')][_0x1872('0x18')]){_0x4d1f11[_0x1872('0x19')]='';for(var _0x32499a=0x0;_0x32499a<_0xcc4221['results'][_0x1872('0x17')][_0x1872('0x18')];_0x32499a++){_0x4d1f11[_0x1872('0x19')]+=_0xcc4221['results'][_0x1872('0x17')][_0x32499a]['transcript']+'';}}return _0xb6951b[_0x1872('0x1a')](_0x4d1f11);})[_0x1872('0xd')](function(){logger[_0x1872('0x8')](util['format'](_0x1872('0x1b'),_0xb6951b['id']));if(!_0xb6951b[_0x1872('0x1c')]){throw new db['Sequelize']['ValidationError'](_0x1872('0x1d'));}if(!_0x4345d0['sentiment']||!_0x4345d0['sentimentAccountId']||!_0x4345d0[_0x1872('0x1e')]||!_0x4345d0['language']||!_0x4345d0[_0x1872('0x1f')]){throw new db[(_0x1872('0x20'))]['ValidationError'](_0x1872('0x21'));}if(!_0x4d1f11[_0x1872('0x19')]){throw new Error(_0x1872('0x22'));}if(_0x4345d0['sentimentAccountId']===_0x5122df['id']){return _0x5122df;}else{return db[_0x1872('0x23')][_0x1872('0x24')]({'where':{'id':_settings[_0x1872('0x25')]}});}})[_0x1872('0xd')](function(_0x372f7b){if(!_0x372f7b){throw new db['Sequelize'][(_0x1872('0x26'))](_0x1872('0x27'));}if(!_0x372f7b[_0x1872('0xa')]||!_0x372f7b[_0x1872('0xb')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x412663=_0x372f7b;logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x28'),_0xb6951b['id']));return sentiment(_0x412663[_0x1872('0xa')],_0x412663[_0x1872('0xb')],_0x4345d0[_0x1872('0x1e')],_0x4d1f11[_0x1872('0x19')],_0x4345d0[_0x1872('0x29')]);})['then'](function(_0x4a8c86){logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x2a'),_0xb6951b['id']));return _0xb6951b[_0x1872('0x1a')]({'sentiment':_0x4a8c86[_0x1872('0x2b')],'sPositive':_0x4a8c86[_0x1872('0x2c')]['Positive'],'sNegative':_0x4a8c86[_0x1872('0x2c')][_0x1872('0x2d')],'sMixed':_0x4a8c86['SentimentScore']['Mixed'],'sNeutral':_0x4a8c86['SentimentScore'][_0x1872('0x2e')]});})[_0x1872('0xd')](function(){logger[_0x1872('0x8')](util['format'](_0x1872('0x1b'),_0xb6951b['id']));_0x1a8e90();});case _0x1872('0x2f'):return _0xb6951b[_0x1872('0x1a')]({'transcribeStatus':_0x1872('0x2f'),'failureReason':_0x4be58a[_0x1872('0x11')][_0x1872('0x30')]})['then'](function(){logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x1b'),_0xb6951b['id']));_0x1a8e90();});default:logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x31'),_0xb6951b['id']));break;}}else{return BPromise[_0x1872('0x32')]()[_0x1872('0xd')](function(){if(!_0xb6951b['tempSentiment']){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))](_0x1872('0x1d'));}if(!_0x4345d0['sentiment']||!_0x4345d0[_0x1872('0x25')]||!_0x4345d0[_0x1872('0x1e')]||!_0x4345d0['language']||!_0x4345d0[_0x1872('0x1f')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))](_0x1872('0x21'));}if(!_0xb6951b[_0x1872('0x19')]){throw new Error('Transcript\x20not\x20available');}if(_0x4345d0[_0x1872('0x25')]===_0x5122df['id']){return _0x5122df;}else{return db[_0x1872('0x23')][_0x1872('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x1872('0xd')](function(_0x1df449){if(!_0x1df449){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))](_0x1872('0x27'));}if(!_0x1df449[_0x1872('0xa')]||!_0x1df449[_0x1872('0xb')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x412663=_0x1df449;logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x28'),_0xb6951b['id']));return sentiment(_0x412663[_0x1872('0xa')],_0x412663[_0x1872('0xb')],_0x4345d0[_0x1872('0x1e')],_0xb6951b[_0x1872('0x19')],_0x4345d0['language']);})['then'](function(_0x42618f){logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x2a'),_0xb6951b['id']));return _0xb6951b['update']({'sentiment':_0x42618f['Sentiment'],'sPositive':_0x42618f['SentimentScore']['Positive'],'sNegative':_0x42618f[_0x1872('0x2c')]['Negative'],'sMixed':_0x42618f[_0x1872('0x2c')][_0x1872('0x33')],'sNeutral':_0x42618f['SentimentScore'][_0x1872('0x2e')],'transcribeStatus':_0x1872('0x12')});})['then'](function(){logger[_0x1872('0x8')](util[_0x1872('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xb6951b['id']));_0x1a8e90();});}})[_0x1872('0x34')](function(_0x41042b){if(_0x41042b){if(!_0x41042b[_0x1872('0x35')]||_0x41042b[_0x1872('0x35')]!==_0x1872('0x36')){logger[_0x1872('0x37')](util[_0x1872('0xe')](_0x1872('0x38'),_0xb6951b['id']),util['inspect'](_0x41042b,{'showHidden':![],'depth':null}));}}_0x1a8e90();});});}function checkTranscribe(){var _0x5b7f62;var _0x8c015;var _0x1b555f;return db[_0x1872('0x39')]['findAll']({'where':{'transcribeStatus':_0x1872('0x3a')}})[_0x1872('0xd')](function(_0x8a4098){if(!_0x8a4098||!_0x8a4098[_0x1872('0x18')]){throw new db[(_0x1872('0x20'))]['ValidationError'](_0x1872('0x3b'));}_0x5b7f62=_0x8a4098;return db[_0x1872('0x3c')][_0x1872('0x24')]({'where':{'id':0x1}});})[_0x1872('0xd')](function(_0x3fc8c2){if(!_0x3fc8c2){throw new db['Sequelize'][(_0x1872('0x26'))](_0x1872('0x3d'));}_0x8c015=_0x3fc8c2;if(!_0x8c015[_0x1872('0x3e')]||!_0x8c015[_0x1872('0x3f')]||!_0x8c015[_0x1872('0xc')]||!_0x8c015[_0x1872('0x29')]||!_0x8c015[_0x1872('0x1f')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Transcribe\x20not\x20configured');}return db[_0x1872('0x23')][_0x1872('0x24')]({'where':{'id':_0x8c015[_0x1872('0x3f')]}});})[_0x1872('0xd')](function(_0x340570){if(!_0x340570){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x340570['data1']||!_0x340570[_0x1872('0xb')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x1b555f=_0x340570;var _0x25004c=[];_0x5b7f62[_0x1872('0x40')](function(_0xd33499){_0x25004c[_0x1872('0x41')](checkTranscribeJob(_0xd33499,_0x8c015,_0x1b555f));});return BPromise[_0x1872('0x42')](_0x25004c);})[_0x1872('0x34')](function(_0x1614de){if(_0x1614de){if(!_0x1614de[_0x1872('0x35')]||_0x1614de['name']!==_0x1872('0x36')){logger['error'](util[_0x1872('0x43')](_0x1614de,{'showHidden':![],'depth':null}));}}});}exports[_0x1872('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x5825=['[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','start','lodash','aws-sdk','request-promise','util','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','transcribeName','data1','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','then'];(function(_0x1efaac,_0x9d7996){var _0x114379=function(_0x31464d){while(--_0x31464d){_0x1efaac['push'](_0x1efaac['shift']());}};_0x114379(++_0x9d7996);}(_0x5825,0x78));var _0x5582=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5825[_0x40a045];return _0x1a687c;};var _=require(_0x5582('0x0'));var AWS=require(_0x5582('0x1'));var rp=require(_0x5582('0x2'));var util=require(_0x5582('0x3'));var BPromise=require('bluebird');var db=require(_0x5582('0x4'))['db'];var logger=require('../../config/logger')(_0x5582('0x5'));function getTranscriptionJob(_0x2dbcea,_0x3713d6,_0x2d2e03,_0xeba364){return new Promise(function(_0x11eb87,_0x17a897){var _0x5d618a=new AWS[(_0x5582('0x6'))]({'accessKeyId':_0x3713d6,'secretAccessKey':_0x2dbcea,'region':_0x2d2e03});_0x5d618a[_0x5582('0x7')]({'TranscriptionJobName':_0xeba364},function(_0x39b66,_0x5fa603){if(_0x39b66){return _0x17a897(_0x39b66);}else{return _0x11eb87(_0x5fa603);}});});}function sentiment(_0x5e8681,_0x2904ad,_0x3aa455,_0x24413f,_0x4eacaa){return new Promise(function(_0x40215a,_0xd1cc57){var _0x1fb98c=new AWS['Comprehend']({'accessKeyId':_0x2904ad,'secretAccessKey':_0x5e8681,'region':_0x3aa455});_0x1fb98c[_0x5582('0x8')]({'Text':_0x24413f,'LanguageCode':_0x4eacaa[_0x5582('0x9')](0x0,0x2)},function(_0x542179,_0x421f72){if(_0x542179){return _0xd1cc57(_0x542179);}else{return _0x40215a(_0x421f72);}});});}function checkTranscribeJob(_0xac1c6b,_0x4798d6,_0x5a9a4e){var _0x132be7;return new BPromise(function(_0x4fb9a5,_0x583fb7){logger[_0x5582('0xa')](util[_0x5582('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xac1c6b['id'],_0xac1c6b[_0x5582('0xc')]));return getTranscriptionJob(_0x5a9a4e[_0x5582('0xd')],_0x5a9a4e['data2'],_0x4798d6[_0x5582('0xe')],_0xac1c6b[_0x5582('0xc')])['then'](function(_0x511268){logger[_0x5582('0xa')](util['format'](_0x5582('0xf'),_0xac1c6b['id'],_0xac1c6b[_0x5582('0xc')],_0x511268[_0x5582('0x10')][_0x5582('0x11')]));if(!_0xac1c6b[_0x5582('0x12')]){switch(_0x511268[_0x5582('0x10')][_0x5582('0x11')]){case _0x5582('0x13'):var _0x563ac0={'transcribeStatus':_0x511268[_0x5582('0x10')][_0x5582('0x11')],'fileUri':_0x511268[_0x5582('0x10')][_0x5582('0x14')]['TranscriptFileUri']};logger[_0x5582('0xa')](util[_0x5582('0xb')](_0x5582('0x15'),_0xac1c6b['id']));return rp({'uri':_0x511268[_0x5582('0x10')][_0x5582('0x14')][_0x5582('0x16')],'json':!![]})[_0x5582('0x17')](function(_0x3efcfb){logger[_0x5582('0xa')](util['format'](_0x5582('0x18'),_0xac1c6b['id']));if(_0x3efcfb&&_0x3efcfb['results']&&_0x3efcfb[_0x5582('0x19')]['transcripts']&&_0x3efcfb[_0x5582('0x19')]['transcripts']['length']){_0x563ac0[_0x5582('0x12')]='';for(var _0xbd8cb4=0x0;_0xbd8cb4<_0x3efcfb[_0x5582('0x19')][_0x5582('0x1a')][_0x5582('0x1b')];_0xbd8cb4++){_0x563ac0[_0x5582('0x12')]+=_0x3efcfb['results'][_0x5582('0x1a')][_0xbd8cb4]['transcript']+'';}}return _0xac1c6b[_0x5582('0x1c')](_0x563ac0);})[_0x5582('0x17')](function(){logger['info'](util[_0x5582('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xac1c6b['id']));if(!_0xac1c6b[_0x5582('0x1d')]){throw new db[(_0x5582('0x1e'))][(_0x5582('0x1f'))](_0x5582('0x20'));}if(!_0x4798d6[_0x5582('0x21')]||!_0x4798d6[_0x5582('0x22')]||!_0x4798d6[_0x5582('0x23')]||!_0x4798d6[_0x5582('0x24')]||!_0x4798d6[_0x5582('0x25')]){throw new db['Sequelize'][(_0x5582('0x1f'))](_0x5582('0x26'));}if(!_0x563ac0[_0x5582('0x12')]){throw new Error(_0x5582('0x27'));}if(_0x4798d6[_0x5582('0x22')]===_0x5a9a4e['id']){return _0x5a9a4e;}else{return db[_0x5582('0x28')][_0x5582('0x29')]({'where':{'id':_settings[_0x5582('0x22')]}});}})['then'](function(_0xa4b2ca){if(!_0xa4b2ca){throw new db[(_0x5582('0x1e'))][(_0x5582('0x1f'))](_0x5582('0x2a'));}if(!_0xa4b2ca['data1']||!_0xa4b2ca[_0x5582('0x2b')]){throw new db[(_0x5582('0x1e'))]['ValidationError'](_0x5582('0x2c'));}_0x132be7=_0xa4b2ca;logger['info'](util[_0x5582('0xb')](_0x5582('0x2d'),_0xac1c6b['id']));return sentiment(_0x132be7['data1'],_0x132be7[_0x5582('0x2b')],_0x4798d6[_0x5582('0x23')],_0x563ac0[_0x5582('0x12')],_0x4798d6[_0x5582('0x24')]);})[_0x5582('0x17')](function(_0x8fec59){logger[_0x5582('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xac1c6b['id']));return _0xac1c6b[_0x5582('0x1c')]({'sentiment':_0x8fec59[_0x5582('0x2e')],'sPositive':_0x8fec59[_0x5582('0x2f')]['Positive'],'sNegative':_0x8fec59['SentimentScore']['Negative'],'sMixed':_0x8fec59['SentimentScore'][_0x5582('0x30')],'sNeutral':_0x8fec59[_0x5582('0x2f')][_0x5582('0x31')]});})[_0x5582('0x17')](function(){logger[_0x5582('0xa')](util[_0x5582('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xac1c6b['id']));_0x4fb9a5();});case'FAILED':return _0xac1c6b[_0x5582('0x1c')]({'transcribeStatus':_0x5582('0x32'),'failureReason':_0x511268[_0x5582('0x10')][_0x5582('0x33')]})[_0x5582('0x17')](function(){logger[_0x5582('0xa')](util[_0x5582('0xb')](_0x5582('0x34'),_0xac1c6b['id']));_0x4fb9a5();});default:logger[_0x5582('0xa')](util[_0x5582('0xb')](_0x5582('0x35'),_0xac1c6b['id']));break;}}else{return BPromise[_0x5582('0x36')]()['then'](function(){if(!_0xac1c6b[_0x5582('0x1d')]){throw new db['Sequelize']['ValidationError'](_0x5582('0x20'));}if(!_0x4798d6['sentiment']||!_0x4798d6[_0x5582('0x22')]||!_0x4798d6[_0x5582('0x23')]||!_0x4798d6[_0x5582('0x24')]||!_0x4798d6[_0x5582('0x25')]){throw new db[(_0x5582('0x1e'))]['ValidationError'](_0x5582('0x26'));}if(!_0xac1c6b[_0x5582('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x4798d6[_0x5582('0x22')]===_0x5a9a4e['id']){return _0x5a9a4e;}else{return db[_0x5582('0x28')][_0x5582('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x5582('0x17')](function(_0x2f394f){if(!_0x2f394f){throw new db[(_0x5582('0x1e'))][(_0x5582('0x1f'))](_0x5582('0x2a'));}if(!_0x2f394f[_0x5582('0xd')]||!_0x2f394f[_0x5582('0x2b')]){throw new db[(_0x5582('0x1e'))][(_0x5582('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x132be7=_0x2f394f;logger['info'](util['format'](_0x5582('0x2d'),_0xac1c6b['id']));return sentiment(_0x132be7['data1'],_0x132be7['data2'],_0x4798d6['sentimentRegion'],_0xac1c6b[_0x5582('0x12')],_0x4798d6[_0x5582('0x24')]);})[_0x5582('0x17')](function(_0x323cb6){logger[_0x5582('0xa')](util['format'](_0x5582('0x37'),_0xac1c6b['id']));return _0xac1c6b[_0x5582('0x1c')]({'sentiment':_0x323cb6[_0x5582('0x2e')],'sPositive':_0x323cb6[_0x5582('0x2f')][_0x5582('0x38')],'sNegative':_0x323cb6[_0x5582('0x2f')]['Negative'],'sMixed':_0x323cb6[_0x5582('0x2f')][_0x5582('0x30')],'sNeutral':_0x323cb6[_0x5582('0x2f')][_0x5582('0x31')],'transcribeStatus':_0x5582('0x13')});})[_0x5582('0x17')](function(){logger[_0x5582('0xa')](util[_0x5582('0xb')](_0x5582('0x34'),_0xac1c6b['id']));_0x4fb9a5();});}})[_0x5582('0x39')](function(_0x154a12){if(_0x154a12){if(!_0x154a12[_0x5582('0x3a')]||_0x154a12['name']!==_0x5582('0x3b')){logger[_0x5582('0x3c')](util[_0x5582('0xb')](_0x5582('0x3d'),_0xac1c6b['id']),util[_0x5582('0x3e')](_0x154a12,{'showHidden':![],'depth':null}));}}_0x4fb9a5();});});}function checkTranscribe(){var _0x2ac99a;var _0x3eb692;var _0x5632ed;return db['VoiceRecording'][_0x5582('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x5582('0x17')](function(_0xdff3a0){if(!_0xdff3a0||!_0xdff3a0[_0x5582('0x1b')]){throw new db['Sequelize'][(_0x5582('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x2ac99a=_0xdff3a0;return db[_0x5582('0x40')]['findOne']({'where':{'id':0x1}});})[_0x5582('0x17')](function(_0x201bd7){if(!_0x201bd7){throw new db[(_0x5582('0x1e'))]['ValidationError'](_0x5582('0x41'));}_0x3eb692=_0x201bd7;if(!_0x3eb692[_0x5582('0x5')]||!_0x3eb692['transcribeAccountId']||!_0x3eb692[_0x5582('0xe')]||!_0x3eb692[_0x5582('0x24')]||!_0x3eb692[_0x5582('0x25')]){throw new db[(_0x5582('0x1e'))]['ValidationError'](_0x5582('0x42'));}return db[_0x5582('0x28')][_0x5582('0x29')]({'where':{'id':_0x3eb692[_0x5582('0x43')]}});})[_0x5582('0x17')](function(_0x4c23cb){if(!_0x4c23cb){throw new db['Sequelize']['ValidationError'](_0x5582('0x2a'));}if(!_0x4c23cb['data1']||!_0x4c23cb[_0x5582('0x2b')]){throw new db['Sequelize'][(_0x5582('0x1f'))](_0x5582('0x2c'));}_0x5632ed=_0x4c23cb;var _0x178575=[];_0x2ac99a[_0x5582('0x44')](function(_0x3d12b4){_0x178575[_0x5582('0x45')](checkTranscribeJob(_0x3d12b4,_0x3eb692,_0x5632ed));});return BPromise[_0x5582('0x46')](_0x178575);})[_0x5582('0x39')](function(_0x1cc436){if(_0x1cc436){if(!_0x1cc436[_0x5582('0x3a')]||_0x1cc436[_0x5582('0x3a')]!=='SequelizeValidationError'){logger[_0x5582('0x3c')](util['inspect'](_0x1cc436,{'showHidden':![],'depth':null}));}}});}exports[_0x5582('0x47')]=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 88179fe..f83ed01 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 _0xfd58=['moment','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','timeout','format','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xfd58,0xb3));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8fd5('0x0'));var moment=require(_0x8fd5('0x1'));var Redis=require('ioredis');var util=require(_0x8fd5('0x2'));var config=require(_0x8fd5('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x8fd5('0x4'))(_0x8fd5('0x5'));config[_0x8fd5('0x6')]=_[_0x8fd5('0x7')](config['redis'],{'host':_0x8fd5('0x8'),'port':0x18eb});var io=require(_0x8fd5('0x9'))(new Redis(config[_0x8fd5('0x6')]));function closeInteractions(){var _0x4e10e4=[];return db[_0x8fd5('0xa')][_0x8fd5('0xb')]({'raw':!![],'attributes':['id',_0x8fd5('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8fd5('0xd')](0x18,_0x8fd5('0xe'))}}})['then'](function(_0x462ac4){if(_0x462ac4&&_0x462ac4['length']){_0x4e10e4=_['map'](_0x462ac4||[],'id');logger[_0x8fd5('0xf')](_0x8fd5('0x10'),_0x4e10e4['join']());return db[_0x8fd5('0xa')][_0x8fd5('0x11')]({'closeReason':'system','disposition':_0x8fd5('0x12'),'closed':!![],'closedAt':moment()[_0x8fd5('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4e10e4}});}})[_0x8fd5('0x14')](function(){if(_0x4e10e4&&_0x4e10e4[_0x8fd5('0x15')]){logger[_0x8fd5('0xf')](_0x8fd5('0x16'),_0x4e10e4['join']());for(var _0x5a80e4=0x0;_0x5a80e4<_0x4e10e4['length'];_0x5a80e4++){io[_0x8fd5('0x17')](_0x8fd5('0x18'),{'id':_0x4e10e4[_0x5a80e4],'closed':!![]});}}})[_0x8fd5('0x19')](function(_0x141ccb){logger[_0x8fd5('0x1a')](_0x8fd5('0x1b'),_0x141ccb?util[_0x8fd5('0x1c')](_0x141ccb,{'showHidden':![],'depth':null}):'');});}exports[_0x8fd5('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb584=['../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','length','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb'];(function(_0x4981b2,_0x2575e4){var _0x47f437=function(_0x445de1){while(--_0x445de1){_0x4981b2['push'](_0x4981b2['shift']());}};_0x47f437(++_0x2575e4);}(_0xb584,0x8c));var _0x4b58=function(_0x24faaa,_0x18420e){_0x24faaa=_0x24faaa-0x0;var _0x24fbf0=_0xb584[_0x24faaa];return _0x24fbf0;};'use strict';var _=require(_0x4b58('0x0'));var moment=require(_0x4b58('0x1'));var Redis=require(_0x4b58('0x2'));var util=require(_0x4b58('0x3'));var config=require('../../config/environment');var db=require(_0x4b58('0x4'))['db'];var logger=require(_0x4b58('0x5'))(_0x4b58('0x6'));config[_0x4b58('0x7')]=_[_0x4b58('0x8')](config[_0x4b58('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4b58('0x9'))(new Redis(config[_0x4b58('0x7')]));function closeInteractions(){var _0x4138e3=[];return db[_0x4b58('0xa')][_0x4b58('0xb')]({'raw':!![],'attributes':['id',_0x4b58('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4b58('0xd')](0x18,'hours')}}})[_0x4b58('0xe')](function(_0xeacc9b){if(_0xeacc9b&&_0xeacc9b['length']){_0x4138e3=_[_0x4b58('0xf')](_0xeacc9b||[],'id');logger['info'](_0x4b58('0x10'),_0x4138e3[_0x4b58('0x11')]());return db['WhatsappInteraction'][_0x4b58('0x12')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x4b58('0x13')](_0x4b58('0x14'))},{'where':{'id':_0x4138e3}});}})[_0x4b58('0xe')](function(){if(_0x4138e3&&_0x4138e3['length']){logger[_0x4b58('0x15')](_0x4b58('0x16'),_0x4138e3[_0x4b58('0x11')]());for(var _0x299a2f=0x0;_0x299a2f<_0x4138e3[_0x4b58('0x17')];_0x299a2f++){io['emit'](_0x4b58('0x18'),{'id':_0x4138e3[_0x299a2f],'closed':!![]});}}})[_0x4b58('0x19')](function(_0x5452b3){logger['error'](_0x4b58('0x1a'),_0x5452b3?util[_0x4b58('0x1b')](_0x5452b3,{'showHidden':![],'depth':null}):'');});}exports[_0x4b58('0x1c')]=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 30b57e1..4cc18eb 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf55=['@xcally.com','push','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','../mysqldb','Innocenzo','Biondo','innocenzo.biondo'];(function(_0x40b50c,_0x1c1f08){var _0x135895=function(_0x238a0f){while(--_0x238a0f){_0x40b50c['push'](_0x40b50c['shift']());}};_0x135895(++_0x1c1f08);}(_0xbf55,0x7a));var _0x5bf5=function(_0xa0ccb2,_0x43917c){_0xa0ccb2=_0xa0ccb2-0x0;var _0x3ddbc9=_0xbf55[_0xa0ccb2];return _0x3ddbc9;};'use strict';var util=require('util');var db=require(_0x5bf5('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x5bf5('0x1')+i,'lastName':_0x5bf5('0x2')+i,'phone':0xf879fb460+i,'email':_0x5bf5('0x3')+i+_0x5bf5('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5bf5('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x5bf5('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5bf5('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5bf5('0x5')]({'id':i,'firstName':_0x5bf5('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x5bf5('0x3')+i+_0x5bf5('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5bf5('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x5bf5('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5bf5('0x6')](),'updatedAt':Date[_0x5bf5('0x6')]()});}db[_0x5bf5('0x7')][_0x5bf5('0x8')]({'where':{}})[_0x5bf5('0x9')](function(){return db[_0x5bf5('0x7')][_0x5bf5('0xa')](contacts);})[_0x5bf5('0x9')](function(){console[_0x5bf5('0xb')](_0x5bf5('0xc'),_0x5bf5('0xd'));return db[_0x5bf5('0xe')][_0x5bf5('0x8')]({'where':{}});})[_0x5bf5('0x9')](function(){return db[_0x5bf5('0xe')][_0x5bf5('0xa')](hopper);})[_0x5bf5('0x9')](function(){console['log'](_0x5bf5('0xc'),_0x5bf5('0xf'));return db[_0x5bf5('0x7')][_0x5bf5('0xa')](contacts2);})[_0x5bf5('0x9')](function(){console['log'](_0x5bf5('0xc'),_0x5bf5('0x10'));return db[_0x5bf5('0xe')][_0x5bf5('0xa')](hopper2);})[_0x5bf5('0x9')](function(){console['log'](_0x5bf5('0xc'),_0x5bf5('0x11'));})['catch'](function(_0x18629c){console[_0x5bf5('0xb')](_0x18629c);}); \ No newline at end of file +var _0x273c=['destroy','bulkCreate','log','finished\x20populating','contacts1','CmHopper','then','hopper1','CmContact','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo'];(function(_0x362284,_0x2b2eb0){var _0x1a15c0=function(_0x2c882b){while(--_0x2c882b){_0x362284['push'](_0x362284['shift']());}};_0x1a15c0(++_0x2b2eb0);}(_0x273c,0xef));var _0xc273=function(_0x4257b6,_0x2348c7){_0x4257b6=_0x4257b6-0x0;var _0x4ad68c=_0x273c[_0x4257b6];return _0x4ad68c;};'use strict';var util=require(_0xc273('0x0'));var db=require(_0xc273('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc273('0x2')]({'id':i,'firstName':_0xc273('0x3')+i,'lastName':_0xc273('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xc273('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc273('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc273('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc273('0x6')](),'updatedAt':Date[_0xc273('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc273('0x2')]({'id':i,'firstName':_0xc273('0x3')+i,'lastName':_0xc273('0x4')+i,'phone':0xf879fb460+i,'email':_0xc273('0x7')+i+_0xc273('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc273('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc273('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xc273('0x6')]()});}db['CmContact'][_0xc273('0x8')]({'where':{}})['then'](function(){return db['CmContact'][_0xc273('0x9')](contacts);})['then'](function(){console[_0xc273('0xa')](_0xc273('0xb'),_0xc273('0xc'));return db[_0xc273('0xd')][_0xc273('0x8')]({'where':{}});})[_0xc273('0xe')](function(){return db['CmHopper'][_0xc273('0x9')](hopper);})['then'](function(){console[_0xc273('0xa')](_0xc273('0xb'),_0xc273('0xf'));return db[_0xc273('0x10')][_0xc273('0x9')](contacts2);})['then'](function(){console[_0xc273('0xa')](_0xc273('0xb'),_0xc273('0x11'));return db['CmHopper'][_0xc273('0x9')](hopper2);})[_0xc273('0xe')](function(){console[_0xc273('0xa')](_0xc273('0xb'),'hopper2');})[_0xc273('0x12')](function(_0x53c39a){console[_0xc273('0xa')](_0x53c39a);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index cbb931d..d427ab5 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6943=['agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','catch','log','../mysqldb','push','%s%s','format'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x6943,0x1b4));var _0x3694=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x6943[_0x179e11];return _0x549f04;};'use strict';var util=require('util');var db=require(_0x3694('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3694('0x1')]({'name':util['format'](_0x3694('0x2'),'agent',i),'fullname':util[_0x3694('0x3')](_0x3694('0x2'),_0x3694('0x4'),i),'email':util[_0x3694('0x3')](_0x3694('0x5'),_0x3694('0x4'),i),'role':_0x3694('0x4'),'password':_0x3694('0x6'),'internal':0xfa0+i,'type':_0x3694('0x7'),'transport':[_0x3694('0x8'),'ws',_0x3694('0x9')],'disallow':[_0x3694('0xa')],'allow':[_0x3694('0xb')],'defaultuser':util[_0x3694('0x3')](_0x3694('0x2'),'agent',i),'encryption':'yes','avpf':_0x3694('0xc'),'force_avp':_0x3694('0xc'),'icesupport':'yes','dtlsenable':_0x3694('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x3694('0xd'),'dtlssetup':_0x3694('0xe'),'callerid':util['format'](_0x3694('0xf'),util[_0x3694('0x3')](_0x3694('0x2'),_0x3694('0x4'),i),0xfa0+i)});}db[_0x3694('0x10')]['bulkCreate'](users)[_0x3694('0x11')](function(){console['log']('add\x20user');})[_0x3694('0x12')](function(_0x16a04f){console[_0x3694('0x13')](_0x16a04f);}); \ No newline at end of file +var _0xbd9e=['bulkCreate','log','add\x20user','util','../mysqldb','push','agent','%s%s','format','password','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0xbd9e,0x1f1));var _0xebd9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbd9e[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0xebd9('0x0'));var db=require(_0xebd9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xebd9('0x2')]({'name':util['format']('%s%s',_0xebd9('0x3'),i),'fullname':util['format'](_0xebd9('0x4'),_0xebd9('0x3'),i),'email':util[_0xebd9('0x5')]('%s%s@xcally.com',_0xebd9('0x3'),i),'role':_0xebd9('0x3'),'password':_0xebd9('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0xebd9('0x7'),'ws',_0xebd9('0x8')],'disallow':['all'],'allow':[_0xebd9('0x9')],'defaultuser':util[_0xebd9('0x5')](_0xebd9('0x4'),_0xebd9('0x3'),i),'encryption':'yes','avpf':_0xebd9('0xa'),'force_avp':_0xebd9('0xa'),'icesupport':_0xebd9('0xa'),'dtlsenable':_0xebd9('0xa'),'dtlsverify':'no','dtlscertfile':_0xebd9('0xb'),'dtlsprivatekey':_0xebd9('0xc'),'dtlssetup':_0xebd9('0xd'),'callerid':util['format'](_0xebd9('0xe'),util['format'](_0xebd9('0x4'),'agent',i),0xfa0+i)});}db[_0xebd9('0xf')][_0xebd9('0x10')](users)['then'](function(){console[_0xebd9('0x11')](_0xebd9('0x12'));})['catch'](function(_0x809fbe){console[_0xebd9('0x11')](_0x809fbe);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index f9eb548..059ec83 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4991=['OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','SmsQueues','MailQueues','IvrCampaigns','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','SmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','setMaxListeners','request','connection','remoteAddress','remotePort','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','./environment','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','autoAssociation','ChatQueues','FaxQueues','WhatsappQueues','findAll','Telephones','Trunks','resourceId','then','map','where','telephone','Campaign','format','%s:queue:%s','length','user:%s','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue'];(function(_0x451f90,_0x4827ea){var _0x1d8007=function(_0x591bca){while(--_0x591bca){_0x451f90['push'](_0x451f90['shift']());}};_0x1d8007(++_0x4827ea);}(_0x4991,0xf7));var _0x1499=function(_0x348951,_0x2ed2ff){_0x348951=_0x348951-0x0;var _0x217bd4=_0x4991[_0x348951];return _0x217bd4;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var BPromise=require(_0x1499('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x1499('0x2'));var queryQueues={'attributes':['id',_0x1499('0x3')],'include':[{'as':_0x1499('0x4'),'model':db[_0x1499('0x5')],'attributes':['id',_0x1499('0x3'),_0x1499('0x6')],'raw':!![],'where':{'role':_0x1499('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1499('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x1499('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x1499('0x3')],'where':{'role':_0x1499('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1499('0x3'),_0x1499('0x8')],'where':{'type':_0x1499('0x9')}};function getAssociatedResources(_0x3277b3,_0x15b291,_0x48d2ca){return db[_0x1499('0xa')][_0x1499('0xb')]({'where':{'name':_0x3277b3,'userProfileId':_0x15b291},'raw':!![]})['then'](function(_0x2a4816){if(_0x2a4816){if(_0x2a4816[_0x1499('0xc')]){switch(_0x3277b3){case'VoiceQueues':case _0x1499('0xd'):case _0x1499('0xe'):case'SmsQueues':case'MailQueues':case'OpenchannelQueues':case _0x1499('0xf'):return db[_0x48d2ca][_0x1499('0x10')](queryQueues);case _0x1499('0x11'):return db[_0x48d2ca][_0x1499('0x10')](queryTelephones);case _0x1499('0x12'):return db[_0x48d2ca]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x48d2ca][_0x1499('0x10')](queryCampaigns);}}else{return db['UserProfileResource'][_0x1499('0x10')]({'attributes':[_0x1499('0x13')],'where':{'sectionId':_0x2a4816['id']},'raw':!![]})[_0x1499('0x14')](function(_0x3ab605){if(_0x3ab605){var _0x48f654={'where':{'id':_[_0x1499('0x15')](_0x3ab605,_0x1499('0x13'))},'raw':!![]};switch(_0x48d2ca){case'User':_0x48f654[_0x1499('0x16')][_0x1499('0x6')]=_0x1499('0x17');break;case _0x1499('0x18'):_0x48f654[_0x1499('0x16')][_0x1499('0x8')]='ivr';break;}return db[_0x48d2ca]['findAll'](_0x48f654);}else{return[];}});}}else{return[];}})['then'](function(_0x2172b3){return _0x2172b3;});}function joinOrLeaveQueues(_0xad534b,_0x4a4e28,_0x351da9,_0x3c13a1){_0xad534b[_0x4a4e28](util[_0x1499('0x19')](_0x1499('0x1a'),_0x351da9,_0x3c13a1[_0x1499('0x3')]));if(_0x3c13a1[_0x1499('0x4')]){for(var _0x2b0458=0x0;_0x2b0458<_0x3c13a1[_0x1499('0x4')][_0x1499('0x1b')];_0x2b0458+=0x1){_0xad534b[_0x4a4e28](util[_0x1499('0x19')](_0x1499('0x1c'),_0x3c13a1[_0x1499('0x4')][_0x2b0458][_0x1499('0x3')]));}}}function joinOrLeave(_0x3b73f6,_0x4ec57a,_0x1e2c51){var _0x2c7f57;if(_0x3b73f6['handshake'][_0x1499('0x1d')]['id']){db[_0x1499('0x5')][_0x1499('0x1e')]({'attributes':['id',_0x1499('0x3'),_0x1499('0x6'),_0x1499('0x1f')],'where':{'id':_0x3b73f6['handshake']['query']['id']},'include':[{'model':db[_0x1499('0x20')],'as':_0x1499('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x1499('0x22')],'as':_0x1499('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x1499('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1499('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1499('0x26')],'as':_0x1499('0x27'),'attributes':['id'],'raw':!![]}]})[_0x1499('0x14')](function(_0x1b460b){if(_0x1b460b){_0x2c7f57=_0x1b460b;_0x3b73f6[_0x4ec57a](util[_0x1499('0x19')](_0x1499('0x1c'),_0x1b460b[_0x1499('0x3')]));var _0x5d3ec5=[];switch(_0x1b460b[_0x1499('0x6')]){case _0x1499('0x28'):_0x3b73f6[_0x4ec57a](_0x1499('0x29'));_0x3b73f6[_0x4ec57a]('voice:outbound');if(queryQueues[_0x1499('0x2a')](_0x1499('0x2b'))){delete queryQueues['include'];}_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x2d')]['findAll'](queryQueues));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x2e')][_0x1499('0x10')](queryQueues));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x2f')][_0x1499('0x10')](queryQueues));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x30')][_0x1499('0x10')](queryQueues));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x31')][_0x1499('0x10')](queryQueues));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x32')][_0x1499('0x10')](queryQueues));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x33')][_0x1499('0x10')](queryQueues));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x5')]['findAll'](queryTelephones));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x34')][_0x1499('0x10')](queryTrunks));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x18')][_0x1499('0x10')](queryCampaigns));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x5')][_0x1499('0x10')](queryAgents));break;case _0x1499('0x35'):_0x3b73f6[_0x4ec57a](_0x1499('0x29'));_0x3b73f6[_0x4ec57a]('voice:outbound');_0x5d3ec5['push'](getAssociatedResources(_0x1499('0x36'),_0x1b460b['userProfileId'],_0x1499('0x2d')));_0x5d3ec5['push'](getAssociatedResources(_0x1499('0xd'),_0x1b460b[_0x1499('0x1f')],_0x1499('0x2e')));_0x5d3ec5[_0x1499('0x2c')](getAssociatedResources('FaxQueues',_0x1b460b[_0x1499('0x1f')],'FaxQueue'));_0x5d3ec5[_0x1499('0x2c')](getAssociatedResources(_0x1499('0x37'),_0x1b460b[_0x1499('0x1f')],_0x1499('0x30')));_0x5d3ec5['push'](getAssociatedResources(_0x1499('0x38'),_0x1b460b[_0x1499('0x1f')],_0x1499('0x31')));_0x5d3ec5[_0x1499('0x2c')](getAssociatedResources('OpenchannelQueues',_0x1b460b[_0x1499('0x1f')],'OpenchannelQueue'));_0x5d3ec5[_0x1499('0x2c')](getAssociatedResources(_0x1499('0xf'),_0x1b460b[_0x1499('0x1f')],_0x1499('0x33')));_0x5d3ec5[_0x1499('0x2c')](getAssociatedResources(_0x1499('0x11'),_0x1b460b[_0x1499('0x1f')],_0x1499('0x5')));_0x5d3ec5[_0x1499('0x2c')](getAssociatedResources(_0x1499('0x12'),_0x1b460b['userProfileId'],_0x1499('0x34')));_0x5d3ec5['push'](getAssociatedResources(_0x1499('0x39'),_0x1b460b[_0x1499('0x1f')],'Campaign'));_0x5d3ec5[_0x1499('0x2c')](db[_0x1499('0x5')][_0x1499('0x10')](queryAgents));break;case _0x1499('0x7'):_0x3b73f6[_0x4ec57a](_0x1499('0x29'));_0x3b73f6[_0x4ec57a]('voice:outbound');_0x5d3ec5['push'](_0x1b460b[_0x1499('0x3a')]({'attributes':['id',_0x1499('0x3')]}));_0x5d3ec5['push'](_0x1b460b[_0x1499('0x3b')]({'attributes':['id',_0x1499('0x3')]}));_0x5d3ec5['push'](_0x1b460b['getFaxQueues']({'attributes':['id',_0x1499('0x3')]}));_0x5d3ec5[_0x1499('0x2c')](_0x1b460b[_0x1499('0x3c')]({'attributes':['id','name']}));_0x5d3ec5[_0x1499('0x2c')](_0x1b460b[_0x1499('0x3d')]({'attributes':['id',_0x1499('0x3')]}));_0x5d3ec5[_0x1499('0x2c')](_0x1b460b['getOpenchannelQueues']({'attributes':['id',_0x1499('0x3')]}));_0x5d3ec5[_0x1499('0x2c')](_0x1b460b[_0x1499('0x3e')]({'attributes':['id',_0x1499('0x3')]}));break;}return BPromise['all'](_0x5d3ec5);}})[_0x1499('0x14')](function(_0x123a1d){if(_0x123a1d&&_0x123a1d[_0x1499('0x1b')]){for(var _0x4b36c4=0x0;_0x4b36c4<_0x123a1d['length'];_0x4b36c4+=0x1){for(var _0xe49a9f=0x0;_0xe49a9f<_0x123a1d[_0x4b36c4]['length'];_0xe49a9f+=0x1){switch(_0x4b36c4){case 0x0:joinOrLeaveQueues(_0x3b73f6,_0x4ec57a,_0x1499('0x3f'),_0x123a1d[_0x4b36c4][_0xe49a9f]);break;case 0x1:joinOrLeaveQueues(_0x3b73f6,_0x4ec57a,_0x1499('0x40'),_0x123a1d[_0x4b36c4][_0xe49a9f]);break;case 0x2:joinOrLeaveQueues(_0x3b73f6,_0x4ec57a,_0x1499('0x41'),_0x123a1d[_0x4b36c4][_0xe49a9f]);break;case 0x3:joinOrLeaveQueues(_0x3b73f6,_0x4ec57a,_0x1499('0x42'),_0x123a1d[_0x4b36c4][_0xe49a9f]);break;case 0x4:joinOrLeaveQueues(_0x3b73f6,_0x4ec57a,_0x1499('0x43'),_0x123a1d[_0x4b36c4][_0xe49a9f]);break;case 0x5:joinOrLeaveQueues(_0x3b73f6,_0x4ec57a,_0x1499('0x44'),_0x123a1d[_0x4b36c4][_0xe49a9f]);break;case 0x6:joinOrLeaveQueues(_0x3b73f6,_0x4ec57a,_0x1499('0x45'),_0x123a1d[_0x4b36c4][_0xe49a9f]);break;case 0x7:if(_0x2c7f57['role']!==_0x1499('0x7'))_0x3b73f6[_0x4ec57a](util['format'](_0x1499('0x46'),_0x123a1d[_0x4b36c4][_0xe49a9f][_0x1499('0x3')]));break;case 0x8:if(_0x2c7f57['role']!==_0x1499('0x7'))_0x3b73f6[_0x4ec57a](util[_0x1499('0x19')](_0x1499('0x47'),_0x123a1d[_0x4b36c4][_0xe49a9f]['name']));break;case 0x9:if(_0x2c7f57[_0x1499('0x6')]!==_0x1499('0x7'))_0x3b73f6[_0x4ec57a](util[_0x1499('0x19')](_0x1499('0x48'),_0x123a1d[_0x4b36c4][_0xe49a9f][_0x1499('0x8')],_0x123a1d[_0x4b36c4][_0xe49a9f][_0x1499('0x3')]));break;case 0xa:_0x3b73f6[_0x4ec57a](util[_0x1499('0x19')](_0x1499('0x1c'),_0x123a1d[_0x4b36c4][_0xe49a9f][_0x1499('0x3')]));break;}}}}})[_0x1499('0x14')](function(){if(_0x4ec57a==='leave'){var _0x13770a=_[_0x1499('0x15')](_0x2c7f57[_0x1499('0x21')],'id');return _0x2c7f57['removeChatInteractions'](_0x13770a)[_0x1499('0x14')](function(){for(var _0x2a7614=0x0;_0x2a7614<_0x13770a['length'];_0x2a7614+=0x1){_0x1e2c51[_0x1499('0x49')](_0x1499('0x4a'),{'ChatInteractionId':Number(_0x13770a[_0x2a7614]),'UserId':Number(_0x2c7f57['id'])});}});}})['then'](function(){if(_0x4ec57a===_0x1499('0x4b')){var _0x1fb718=_[_0x1499('0x15')](_0x2c7f57[_0x1499('0x23')],'id');return _0x2c7f57[_0x1499('0x4c')](_0x1fb718)[_0x1499('0x14')](function(){for(var _0x10450f=0x0;_0x10450f<_0x1fb718['length'];_0x10450f+=0x1){_0x1e2c51[_0x1499('0x49')](_0x1499('0x4d'),{'MailInteractionId':Number(_0x1fb718[_0x10450f]),'UserId':Number(_0x2c7f57['id'])});}});}})[_0x1499('0x14')](function(){if(_0x4ec57a===_0x1499('0x4b')){var _0x52f4ae=_['map'](_0x2c7f57[_0x1499('0x4e')],'id');return _0x2c7f57[_0x1499('0x4f')](_0x52f4ae)['then'](function(){for(var _0x3c3a20=0x0;_0x3c3a20<_0x52f4ae[_0x1499('0x1b')];_0x3c3a20+=0x1){_0x1e2c51[_0x1499('0x49')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x52f4ae[_0x3c3a20]),'UserId':Number(_0x2c7f57['id'])});}});}})['then'](function(){if(_0x4ec57a==='leave'){var _0x308ce2=_[_0x1499('0x15')](_0x2c7f57[_0x1499('0x50')],'id');return _0x2c7f57['removeSmsInteractions'](_0x308ce2)[_0x1499('0x14')](function(){for(var _0x588e56=0x0;_0x588e56<_0x308ce2[_0x1499('0x1b')];_0x588e56+=0x1){_0x1e2c51[_0x1499('0x49')](_0x1499('0x51'),{'SmsInteractionId':Number(_0x308ce2[_0x588e56]),'UserId':Number(_0x2c7f57['id'])});}});}})[_0x1499('0x14')](function(){if(_0x4ec57a==='leave'){var _0x53a9da=_['map'](_0x2c7f57[_0x1499('0x52')],'id');return _0x2c7f57[_0x1499('0x53')](_0x53a9da)[_0x1499('0x14')](function(){for(var _0x28866f=0x0;_0x28866f<_0x53a9da['length'];_0x28866f+=0x1){_0x1e2c51[_0x1499('0x49')](_0x1499('0x54'),{'OpenchannelInteractionId':Number(_0x53a9da[_0x28866f]),'UserId':Number(_0x2c7f57['id'])});}});}})['then'](function(){if(_0x4ec57a===_0x1499('0x4b')){var _0x4f2887=_[_0x1499('0x15')](_0x2c7f57[_0x1499('0x27')],'id');return _0x2c7f57[_0x1499('0x55')](_0x4f2887)['then'](function(){for(var _0x739e63=0x0;_0x739e63<_0x4f2887[_0x1499('0x1b')];_0x739e63+=0x1){_0x1e2c51[_0x1499('0x49')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x4f2887[_0x739e63]),'UserId':Number(_0x2c7f57['id'])});}});}})[_0x1499('0x56')](function(_0x3ff1ce){_0x3b73f6[_0x1499('0x57')](_0x3ff1ce);});}}function onDisconnect(_0x4a7706,_0x305fee){joinOrLeave(_0x4a7706,_0x1499('0x4b'),_0x305fee);}function onConnect(_0x217399){joinOrLeave(_0x217399,_0x1499('0x58'));}exports[_0x1499('0x59')]=function(_0x96a0ed){_0x96a0ed['on']('connection',function(_0x1df8d0){_0x1df8d0[_0x1499('0x5a')](0x0);_0x1df8d0['address']=_0x1df8d0[_0x1499('0x5b')][_0x1499('0x5c')][_0x1499('0x5d')]+':'+_0x1df8d0[_0x1499('0x5b')][_0x1499('0x5c')][_0x1499('0x5e')];_0x1df8d0['connectedAt']=new Date();_0x1df8d0[_0x1499('0x57')]=function(_0x3bd8c9){console[_0x1499('0x57')]('SocketIO\x20'+_0x1df8d0[_0x1499('0x5f')][_0x1499('0x3')]+'['+_0x1df8d0['address']+']',_0x3bd8c9);};_0x1df8d0['on'](_0x1499('0x60'),function(){onDisconnect(_0x1df8d0,_0x96a0ed);_0x1df8d0[_0x1499('0x57')](_0x1499('0x61'));});onConnect(_0x1df8d0);_0x1df8d0[_0x1499('0x57')](_0x1499('0x62'));});}; \ No newline at end of file +var _0xfbc5=['WhatsappInteractions','user:%s','admin','voice:inbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','voice:outbound','VoiceQueue','MailQueues','Trunk','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','mail','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeFaxInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','setMaxListeners','address','connection','remoteAddress','request','remotePort','connectedAt','nsp','disconnect','bluebird','../mysqldb','./environment','name','User','role','telephone','agent','type','ivr','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','Telephones','Trunks','findAll','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','length','find','userProfileId','handshake','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction'];(function(_0x1caef6,_0x3664e9){var _0x392cf3=function(_0x183cd4){while(--_0x183cd4){_0x1caef6['push'](_0x1caef6['shift']());}};_0x392cf3(++_0x3664e9);}(_0xfbc5,0x1ab));var _0x5fbc=function(_0x14edda,_0x10009e){_0x14edda=_0x14edda-0x0;var _0x3816b7=_0xfbc5[_0x14edda];return _0x3816b7;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x5fbc('0x0'));var db=require(_0x5fbc('0x1'))['db'];var config=require(_0x5fbc('0x2'));var queryQueues={'attributes':['id',_0x5fbc('0x3')],'include':[{'as':'Agents','model':db[_0x5fbc('0x4')],'attributes':['id',_0x5fbc('0x3'),_0x5fbc('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x5fbc('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5fbc('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x5fbc('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x5fbc('0x8')],'where':{'type':_0x5fbc('0x9')}};function getAssociatedResources(_0x208c4c,_0x49b4ae,_0x2c3a9a){return db['UserProfileSection']['findOne']({'where':{'name':_0x208c4c,'userProfileId':_0x49b4ae},'raw':!![]})[_0x5fbc('0xa')](function(_0x269d6f){if(_0x269d6f){if(_0x269d6f[_0x5fbc('0xb')]){switch(_0x208c4c){case _0x5fbc('0xc'):case _0x5fbc('0xd'):case _0x5fbc('0xe'):case _0x5fbc('0xf'):case'MailQueues':case'OpenchannelQueues':case'WhatsappQueues':return db[_0x2c3a9a]['findAll'](queryQueues);case _0x5fbc('0x10'):return db[_0x2c3a9a]['findAll'](queryTelephones);case _0x5fbc('0x11'):return db[_0x2c3a9a][_0x5fbc('0x12')](queryTrunks);case _0x5fbc('0x13'):return db[_0x2c3a9a]['findAll'](queryCampaigns);}}else{return db[_0x5fbc('0x14')][_0x5fbc('0x12')]({'attributes':[_0x5fbc('0x15')],'where':{'sectionId':_0x269d6f['id']},'raw':!![]})[_0x5fbc('0xa')](function(_0x8aa7a2){if(_0x8aa7a2){var _0x1dc455={'where':{'id':_[_0x5fbc('0x16')](_0x8aa7a2,'resourceId')},'raw':!![]};switch(_0x2c3a9a){case _0x5fbc('0x4'):_0x1dc455[_0x5fbc('0x17')][_0x5fbc('0x5')]=_0x5fbc('0x6');break;case _0x5fbc('0x18'):_0x1dc455['where'][_0x5fbc('0x8')]=_0x5fbc('0x9');break;}return db[_0x2c3a9a][_0x5fbc('0x12')](_0x1dc455);}else{return[];}});}}else{return[];}})['then'](function(_0x37cb11){return _0x37cb11;});}function joinOrLeaveQueues(_0x1fc5e4,_0x3e7514,_0x47367a,_0x24404b){_0x1fc5e4[_0x3e7514](util[_0x5fbc('0x19')](_0x5fbc('0x1a'),_0x47367a,_0x24404b[_0x5fbc('0x3')]));if(_0x24404b[_0x5fbc('0x1b')]){for(var _0x1653e5=0x0;_0x1653e5<_0x24404b[_0x5fbc('0x1b')][_0x5fbc('0x1c')];_0x1653e5+=0x1){_0x1fc5e4[_0x3e7514](util[_0x5fbc('0x19')]('user:%s',_0x24404b[_0x5fbc('0x1b')][_0x1653e5][_0x5fbc('0x3')]));}}}function joinOrLeave(_0x5d48ca,_0x44bdc3,_0x5a1c71){var _0x49b0ba;if(_0x5d48ca['handshake']['query']['id']){db['User'][_0x5fbc('0x1d')]({'attributes':['id',_0x5fbc('0x3'),_0x5fbc('0x5'),_0x5fbc('0x1e')],'where':{'id':_0x5d48ca[_0x5fbc('0x1f')][_0x5fbc('0x20')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x5fbc('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x5fbc('0x22')],'as':_0x5fbc('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x5fbc('0x24')],'as':_0x5fbc('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5fbc('0x26')],'as':_0x5fbc('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x5fbc('0x28')],'as':_0x5fbc('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x5fbc('0x2a')],'as':_0x5fbc('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x5fbc('0xa')](function(_0x2344b9){if(_0x2344b9){_0x49b0ba=_0x2344b9;_0x5d48ca[_0x44bdc3](util[_0x5fbc('0x19')](_0x5fbc('0x2c'),_0x2344b9[_0x5fbc('0x3')]));var _0x28b829=[];switch(_0x2344b9[_0x5fbc('0x5')]){case _0x5fbc('0x2d'):_0x5d48ca[_0x44bdc3](_0x5fbc('0x2e'));_0x5d48ca[_0x44bdc3]('voice:outbound');if(queryQueues[_0x5fbc('0x2f')](_0x5fbc('0x30'))){delete queryQueues['include'];}_0x28b829[_0x5fbc('0x31')](db['VoiceQueue']['findAll'](queryQueues));_0x28b829['push'](db[_0x5fbc('0x32')][_0x5fbc('0x12')](queryQueues));_0x28b829['push'](db[_0x5fbc('0x33')][_0x5fbc('0x12')](queryQueues));_0x28b829[_0x5fbc('0x31')](db[_0x5fbc('0x34')][_0x5fbc('0x12')](queryQueues));_0x28b829[_0x5fbc('0x31')](db[_0x5fbc('0x35')][_0x5fbc('0x12')](queryQueues));_0x28b829[_0x5fbc('0x31')](db[_0x5fbc('0x36')][_0x5fbc('0x12')](queryQueues));_0x28b829['push'](db[_0x5fbc('0x37')][_0x5fbc('0x12')](queryQueues));_0x28b829['push'](db[_0x5fbc('0x4')][_0x5fbc('0x12')](queryTelephones));_0x28b829[_0x5fbc('0x31')](db['Trunk'][_0x5fbc('0x12')](queryTrunks));_0x28b829[_0x5fbc('0x31')](db[_0x5fbc('0x18')][_0x5fbc('0x12')](queryCampaigns));_0x28b829[_0x5fbc('0x31')](db[_0x5fbc('0x4')][_0x5fbc('0x12')](queryAgents));break;case _0x5fbc('0x38'):_0x5d48ca[_0x44bdc3](_0x5fbc('0x2e'));_0x5d48ca[_0x44bdc3](_0x5fbc('0x39'));_0x28b829[_0x5fbc('0x31')](getAssociatedResources(_0x5fbc('0xc'),_0x2344b9[_0x5fbc('0x1e')],_0x5fbc('0x3a')));_0x28b829[_0x5fbc('0x31')](getAssociatedResources(_0x5fbc('0xd'),_0x2344b9[_0x5fbc('0x1e')],'ChatQueue'));_0x28b829[_0x5fbc('0x31')](getAssociatedResources(_0x5fbc('0xe'),_0x2344b9[_0x5fbc('0x1e')],'FaxQueue'));_0x28b829[_0x5fbc('0x31')](getAssociatedResources(_0x5fbc('0xf'),_0x2344b9[_0x5fbc('0x1e')],_0x5fbc('0x34')));_0x28b829[_0x5fbc('0x31')](getAssociatedResources(_0x5fbc('0x3b'),_0x2344b9['userProfileId'],_0x5fbc('0x35')));_0x28b829[_0x5fbc('0x31')](getAssociatedResources('OpenchannelQueues',_0x2344b9[_0x5fbc('0x1e')],_0x5fbc('0x36')));_0x28b829[_0x5fbc('0x31')](getAssociatedResources('WhatsappQueues',_0x2344b9['userProfileId'],_0x5fbc('0x37')));_0x28b829[_0x5fbc('0x31')](getAssociatedResources(_0x5fbc('0x10'),_0x2344b9[_0x5fbc('0x1e')],_0x5fbc('0x4')));_0x28b829['push'](getAssociatedResources(_0x5fbc('0x11'),_0x2344b9[_0x5fbc('0x1e')],_0x5fbc('0x3c')));_0x28b829[_0x5fbc('0x31')](getAssociatedResources('IvrCampaigns',_0x2344b9[_0x5fbc('0x1e')],'Campaign'));_0x28b829[_0x5fbc('0x31')](db[_0x5fbc('0x4')]['findAll'](queryAgents));break;case'agent':_0x5d48ca[_0x44bdc3](_0x5fbc('0x2e'));_0x5d48ca[_0x44bdc3](_0x5fbc('0x39'));_0x28b829['push'](_0x2344b9[_0x5fbc('0x3d')]({'attributes':['id','name']}));_0x28b829[_0x5fbc('0x31')](_0x2344b9['getChatQueues']({'attributes':['id',_0x5fbc('0x3')]}));_0x28b829[_0x5fbc('0x31')](_0x2344b9[_0x5fbc('0x3e')]({'attributes':['id','name']}));_0x28b829[_0x5fbc('0x31')](_0x2344b9[_0x5fbc('0x3f')]({'attributes':['id',_0x5fbc('0x3')]}));_0x28b829['push'](_0x2344b9[_0x5fbc('0x40')]({'attributes':['id','name']}));_0x28b829['push'](_0x2344b9[_0x5fbc('0x41')]({'attributes':['id',_0x5fbc('0x3')]}));_0x28b829[_0x5fbc('0x31')](_0x2344b9['getWhatsappQueues']({'attributes':['id',_0x5fbc('0x3')]}));break;}return BPromise[_0x5fbc('0x42')](_0x28b829);}})[_0x5fbc('0xa')](function(_0x267ec5){if(_0x267ec5&&_0x267ec5[_0x5fbc('0x1c')]){for(var _0x3abbda=0x0;_0x3abbda<_0x267ec5[_0x5fbc('0x1c')];_0x3abbda+=0x1){for(var _0x4ae82b=0x0;_0x4ae82b<_0x267ec5[_0x3abbda]['length'];_0x4ae82b+=0x1){switch(_0x3abbda){case 0x0:joinOrLeaveQueues(_0x5d48ca,_0x44bdc3,_0x5fbc('0x43'),_0x267ec5[_0x3abbda][_0x4ae82b]);break;case 0x1:joinOrLeaveQueues(_0x5d48ca,_0x44bdc3,_0x5fbc('0x44'),_0x267ec5[_0x3abbda][_0x4ae82b]);break;case 0x2:joinOrLeaveQueues(_0x5d48ca,_0x44bdc3,_0x5fbc('0x45'),_0x267ec5[_0x3abbda][_0x4ae82b]);break;case 0x3:joinOrLeaveQueues(_0x5d48ca,_0x44bdc3,'sms',_0x267ec5[_0x3abbda][_0x4ae82b]);break;case 0x4:joinOrLeaveQueues(_0x5d48ca,_0x44bdc3,_0x5fbc('0x46'),_0x267ec5[_0x3abbda][_0x4ae82b]);break;case 0x5:joinOrLeaveQueues(_0x5d48ca,_0x44bdc3,'openchannel',_0x267ec5[_0x3abbda][_0x4ae82b]);break;case 0x6:joinOrLeaveQueues(_0x5d48ca,_0x44bdc3,'whatsapp',_0x267ec5[_0x3abbda][_0x4ae82b]);break;case 0x7:if(_0x49b0ba[_0x5fbc('0x5')]!==_0x5fbc('0x7'))_0x5d48ca[_0x44bdc3](util[_0x5fbc('0x19')](_0x5fbc('0x47'),_0x267ec5[_0x3abbda][_0x4ae82b][_0x5fbc('0x3')]));break;case 0x8:if(_0x49b0ba['role']!=='agent')_0x5d48ca[_0x44bdc3](util[_0x5fbc('0x19')]('trunk:%s',_0x267ec5[_0x3abbda][_0x4ae82b][_0x5fbc('0x3')]));break;case 0x9:if(_0x49b0ba[_0x5fbc('0x5')]!=='agent')_0x5d48ca[_0x44bdc3](util[_0x5fbc('0x19')](_0x5fbc('0x48'),_0x267ec5[_0x3abbda][_0x4ae82b]['type'],_0x267ec5[_0x3abbda][_0x4ae82b][_0x5fbc('0x3')]));break;case 0xa:_0x5d48ca[_0x44bdc3](util[_0x5fbc('0x19')](_0x5fbc('0x2c'),_0x267ec5[_0x3abbda][_0x4ae82b][_0x5fbc('0x3')]));break;}}}}})[_0x5fbc('0xa')](function(){if(_0x44bdc3===_0x5fbc('0x49')){var _0xad31a2=_[_0x5fbc('0x16')](_0x49b0ba[_0x5fbc('0x21')],'id');return _0x49b0ba[_0x5fbc('0x4a')](_0xad31a2)[_0x5fbc('0xa')](function(){for(var _0x171552=0x0;_0x171552<_0xad31a2[_0x5fbc('0x1c')];_0x171552+=0x1){_0x5a1c71[_0x5fbc('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xad31a2[_0x171552]),'UserId':Number(_0x49b0ba['id'])});}});}})[_0x5fbc('0xa')](function(){if(_0x44bdc3===_0x5fbc('0x49')){var _0x8993e0=_[_0x5fbc('0x16')](_0x49b0ba['MailInteractions'],'id');return _0x49b0ba['removeMailInteractions'](_0x8993e0)[_0x5fbc('0xa')](function(){for(var _0x3f4b7b=0x0;_0x3f4b7b<_0x8993e0[_0x5fbc('0x1c')];_0x3f4b7b+=0x1){_0x5a1c71[_0x5fbc('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x8993e0[_0x3f4b7b]),'UserId':Number(_0x49b0ba['id'])});}});}})[_0x5fbc('0xa')](function(){if(_0x44bdc3===_0x5fbc('0x49')){var _0x3ac2c1=_['map'](_0x49b0ba[_0x5fbc('0x25')],'id');return _0x49b0ba[_0x5fbc('0x4c')](_0x3ac2c1)[_0x5fbc('0xa')](function(){for(var _0x5bf16e=0x0;_0x5bf16e<_0x3ac2c1[_0x5fbc('0x1c')];_0x5bf16e+=0x1){_0x5a1c71['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3ac2c1[_0x5bf16e]),'UserId':Number(_0x49b0ba['id'])});}});}})[_0x5fbc('0xa')](function(){if(_0x44bdc3===_0x5fbc('0x49')){var _0x4044ab=_[_0x5fbc('0x16')](_0x49b0ba['SmsInteractions'],'id');return _0x49b0ba['removeSmsInteractions'](_0x4044ab)[_0x5fbc('0xa')](function(){for(var _0x1dbaa7=0x0;_0x1dbaa7<_0x4044ab[_0x5fbc('0x1c')];_0x1dbaa7+=0x1){_0x5a1c71[_0x5fbc('0x4b')](_0x5fbc('0x4d'),{'SmsInteractionId':Number(_0x4044ab[_0x1dbaa7]),'UserId':Number(_0x49b0ba['id'])});}});}})['then'](function(){if(_0x44bdc3===_0x5fbc('0x49')){var _0x5384e3=_[_0x5fbc('0x16')](_0x49b0ba[_0x5fbc('0x29')],'id');return _0x49b0ba[_0x5fbc('0x4e')](_0x5384e3)[_0x5fbc('0xa')](function(){for(var _0x26eed3=0x0;_0x26eed3<_0x5384e3[_0x5fbc('0x1c')];_0x26eed3+=0x1){_0x5a1c71[_0x5fbc('0x4b')](_0x5fbc('0x4f'),{'OpenchannelInteractionId':Number(_0x5384e3[_0x26eed3]),'UserId':Number(_0x49b0ba['id'])});}});}})['then'](function(){if(_0x44bdc3===_0x5fbc('0x49')){var _0x4a0cf2=_['map'](_0x49b0ba[_0x5fbc('0x2b')],'id');return _0x49b0ba[_0x5fbc('0x50')](_0x4a0cf2)['then'](function(){for(var _0xf57d4=0x0;_0xf57d4<_0x4a0cf2['length'];_0xf57d4+=0x1){_0x5a1c71[_0x5fbc('0x4b')](_0x5fbc('0x51'),{'WhatsappInteractionId':Number(_0x4a0cf2[_0xf57d4]),'UserId':Number(_0x49b0ba['id'])});}});}})[_0x5fbc('0x52')](function(_0x167c43){_0x5d48ca[_0x5fbc('0x53')](_0x167c43);});}}function onDisconnect(_0x193b73,_0x248d75){joinOrLeave(_0x193b73,_0x5fbc('0x49'),_0x248d75);}function onConnect(_0x14d174){joinOrLeave(_0x14d174,_0x5fbc('0x54'));}exports['default']=function(_0x19a54e){_0x19a54e['on']('connection',function(_0x4868a6){_0x4868a6[_0x5fbc('0x55')](0x0);_0x4868a6[_0x5fbc('0x56')]=_0x4868a6['request'][_0x5fbc('0x57')][_0x5fbc('0x58')]+':'+_0x4868a6[_0x5fbc('0x59')]['connection'][_0x5fbc('0x5a')];_0x4868a6[_0x5fbc('0x5b')]=new Date();_0x4868a6[_0x5fbc('0x53')]=function(_0x489a50){console[_0x5fbc('0x53')]('SocketIO\x20'+_0x4868a6[_0x5fbc('0x5c')][_0x5fbc('0x3')]+'['+_0x4868a6[_0x5fbc('0x56')]+']',_0x489a50);};_0x4868a6['on'](_0x5fbc('0x5d'),function(){onDisconnect(_0x4868a6,_0x19a54e);_0x4868a6[_0x5fbc('0x53')]('DISCONNECTED');});onConnect(_0x4868a6);_0x4868a6['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b94472d..182c761 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 _0xc2ed=['Chat','ChatInteraction','closedinteraction','ChatMessage','ChatOfflineMessage','newmessage','Sms','SmsInteraction','afterCreate','newinteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','then','info','Trigger,\x20%s','EventManager','error','code','get','channel','motionChannel','event','ContactId','undefined','sequelize','query','QueryTypes','SELECT','contact','UserId','interface','SIP/%s','name','agent','incomingmessage','AfterCreateMessage','offlineMessage','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','format','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','email','internal','default','length','hasOwnProperty','model','hook','callback','condition','util','jayson/promise','triggers','client','http'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0xc2ed,0x1b1));var _0xdc2e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xc2ed[_0x38a7ac];return _0x53061a;};'use strict';var util=require(_0xdc2e('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdc2e('0x1'));var logger=require('../logger')(_0xdc2e('0x2'));var client=jayson[_0xdc2e('0x3')][_0xdc2e('0x4')]({'port':0x232a});var triggers=[{'channel':_0xdc2e('0x5'),'model':'ChatInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0xdc2e('0x6'),'event':'afterUpdate','condition':_0xdc2e('0x7'),'callback':afterUpdate},{'channel':_0xdc2e('0x5'),'model':_0xdc2e('0x8'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xdc2e('0x5'),'model':_0xdc2e('0x9'),'event':'afterCreate','condition':_0xdc2e('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xdc2e('0xb'),'model':_0xdc2e('0xc'),'event':_0xdc2e('0xd'),'condition':_0xdc2e('0xe'),'callback':afterCreate},{'channel':_0xdc2e('0xb'),'model':'SmsInteraction','event':_0xdc2e('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdc2e('0xb'),'model':_0xdc2e('0x10'),'event':'afterCreate','condition':_0xdc2e('0xa'),'callback':afterCreateMessage},{'channel':_0xdc2e('0x11'),'model':_0xdc2e('0x12'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xdc2e('0x11'),'model':_0xdc2e('0x12'),'event':_0xdc2e('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdc2e('0x11'),'model':_0xdc2e('0x13'),'event':_0xdc2e('0xd'),'condition':_0xdc2e('0xa'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':'afterCreate','condition':_0xdc2e('0xe'),'callback':afterCreate},{'channel':_0xdc2e('0x14'),'model':'FaxInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdc2e('0x14'),'model':_0xdc2e('0x15'),'event':_0xdc2e('0xd'),'condition':_0xdc2e('0xa'),'callback':afterCreateMessage},{'channel':_0xdc2e('0x16'),'model':_0xdc2e('0x17'),'event':_0xdc2e('0xd'),'condition':_0xdc2e('0xe'),'callback':afterCreate},{'channel':_0xdc2e('0x16'),'model':_0xdc2e('0x17'),'event':'afterUpdate','condition':_0xdc2e('0x7'),'callback':afterUpdate},{'channel':_0xdc2e('0x16'),'model':_0xdc2e('0x18'),'event':_0xdc2e('0xd'),'condition':_0xdc2e('0xa'),'callback':afterCreateMessage},{'channel':_0xdc2e('0x19'),'model':'OpenchannelInteraction','event':_0xdc2e('0xd'),'condition':_0xdc2e('0xe'),'callback':afterCreate},{'channel':_0xdc2e('0x19'),'model':_0xdc2e('0x1a'),'event':_0xdc2e('0xf'),'condition':_0xdc2e('0x7'),'callback':afterUpdate},{'channel':_0xdc2e('0x19'),'model':'OpenchannelMessage','event':_0xdc2e('0xd'),'condition':_0xdc2e('0xa'),'callback':afterCreateMessage}];function request(_0x2b3260){return client[_0xdc2e('0x1b')]('EventManager',_0x2b3260)[_0xdc2e('0x1c')](function(_0x591ff9){logger[_0xdc2e('0x1d')](_0xdc2e('0x1e'),_0xdc2e('0x1f'),_0x591ff9);if(_0x591ff9[_0xdc2e('0x20')]){if(_0x591ff9[_0xdc2e('0x20')][_0xdc2e('0x21')]===0x1f4){logger[_0xdc2e('0x20')]('Trigger,\x20%s',_0xdc2e('0x1f'),_0x591ff9['error']);}}})['catch'](function(_0x345d72){logger[_0xdc2e('0x20')](_0xdc2e('0x1e'),_0xdc2e('0x1f'),_0x345d72);});}function afterCreateMessage(_0x182487){return function(_0x1c429f){_0x1c429f=_0x1c429f[_0xdc2e('0x22')]({'plain':!![]});_0x1c429f[_0xdc2e('0x23')]=_0x182487;_0x1c429f[_0xdc2e('0x24')]=_0x182487;_0x1c429f[_0xdc2e('0x25')]=_0x1c429f['direction'];Promise['resolve']()[_0xdc2e('0x1c')](function(){if(typeof _0x1c429f[_0xdc2e('0x26')]===_0xdc2e('0x27'))return null;var _0x423a9f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c429f[_0xdc2e('0x26')];return db[_0xdc2e('0x28')][_0xdc2e('0x29')](_0x423a9f,{'type':db['Sequelize'][_0xdc2e('0x2a')][_0xdc2e('0x2b')],'raw':!![]});})[_0xdc2e('0x1c')](function(_0x39880a){if(_0x39880a){_0x1c429f[_0xdc2e('0x2c')]=_0x39880a[0x0];}if(typeof _0x1c429f[_0xdc2e('0x2d')]===_0xdc2e('0x27'))return;return getAgent(_0x1c429f[_0xdc2e('0x2d')]);})[_0xdc2e('0x1c')](function(_0x4628af){if(_0x4628af){_0x1c429f[_0xdc2e('0x2e')]=util['format'](_0xdc2e('0x2f'),_0x4628af[_0xdc2e('0x30')]);_0x1c429f[_0xdc2e('0x31')]=_0x4628af;_0x1c429f[_0xdc2e('0x23')]=_0x182487;return request({'event':_0xdc2e('0x32'),'message':_0x1c429f});}else{return request({'event':'outgoingmessage','message':_0x1c429f});}})['catch'](function(_0x4ddefa){logger['error'](_0xdc2e('0x1e'),_0xdc2e('0x33'),_0x4ddefa);});};}function afterCreateOfflineMessage(_0xb2f097){return function(_0x276a4b){_0x276a4b=_0x276a4b[_0xdc2e('0x22')]({'plain':!![]});_0x276a4b[_0xdc2e('0x23')]=_0xb2f097;_0x276a4b['motionChannel']=_0xb2f097;_0x276a4b[_0xdc2e('0x25')]=_0xdc2e('0x34');return request({'event':_0x276a4b['event'],'message':_0x276a4b});};}function afterCreate(_0x22fea2,_0x25852b){return function(_0x7a87a){_0x7a87a=_0x7a87a[_0xdc2e('0x22')]({'plain':!![]});_0x7a87a[_0xdc2e('0x23')]=_0x22fea2;_0x7a87a[_0xdc2e('0x24')]=_0x22fea2;_0x7a87a[_0xdc2e('0x25')]='opened';Promise[_0xdc2e('0x35')]()[_0xdc2e('0x1c')](function(){var _0x5bf29d=_0xdc2e('0x36')+_0x7a87a[_0xdc2e('0x26')];return db[_0xdc2e('0x28')][_0xdc2e('0x29')](_0x5bf29d,{'type':db[_0xdc2e('0x37')][_0xdc2e('0x2a')][_0xdc2e('0x2b')],'raw':!![]});})[_0xdc2e('0x1c')](function(_0x10c9bd){if(_0x10c9bd){_0x7a87a[_0xdc2e('0x2c')]=_0x10c9bd[0x0];}if(typeof _0x7a87a[_0xdc2e('0x2d')]===_0xdc2e('0x27'))return;return getAgent(_0x7a87a[_0xdc2e('0x2d')]);})[_0xdc2e('0x1c')](function(_0x21e4d0){if(_0x21e4d0){_0x7a87a['interface']=util[_0xdc2e('0x38')](_0xdc2e('0x2f'),_0x21e4d0[_0xdc2e('0x30')]);_0x7a87a[_0xdc2e('0x31')]=_0x21e4d0;}return request({'event':_0x25852b,'message':_0x7a87a});})['catch'](function(_0x2596c1){logger[_0xdc2e('0x20')](_0xdc2e('0x1e'),_0xdc2e('0x39'),_0x2596c1);});};}function afterUpdate(_0x424bc9){return function(_0x3d8bdd){var _0xf5dc67=_0x3d8bdd[_0xdc2e('0x3a')](_0xdc2e('0x3b'))&&_0x3d8bdd[_0xdc2e('0x3b')];var _0x796239=_0x3d8bdd['changed'](_0xdc2e('0x3c'));if(_0xf5dc67||_0x796239){var _0x11f955=_0xf5dc67?'closedinteraction':_0xdc2e('0x3c');var _0xa78032=_0x3d8bdd[_0xdc2e('0x22')]({'plain':!![]});_0xa78032[_0xdc2e('0x23')]=_0x424bc9;_0xa78032[_0xdc2e('0x24')]=_0x424bc9;_0xa78032[_0xdc2e('0x25')]=_0xf5dc67?_0xdc2e('0x3b'):_0xdc2e('0x3c');var _0xbd7713=_0xdc2e('0x36')+_0xa78032[_0xdc2e('0x26')];return db[_0xdc2e('0x28')]['query'](_0xbd7713,{'type':db[_0xdc2e('0x37')][_0xdc2e('0x2a')]['SELECT'],'raw':!![]})[_0xdc2e('0x1c')](function(_0x1c40f0){if(_0x1c40f0){_0xa78032[_0xdc2e('0x2c')]=_0x1c40f0[0x0];}if(typeof _0xa78032[_0xdc2e('0x2d')]===_0xdc2e('0x27'))return;return getAgent(_0xa78032[_0xdc2e('0x2d')]);})[_0xdc2e('0x1c')](function(_0x3b5adb){if(_0x3b5adb){_0xa78032[_0xdc2e('0x2e')]=util[_0xdc2e('0x38')](_0xdc2e('0x2f'),_0x3b5adb[_0xdc2e('0x30')]);_0xa78032['agent']=_0x3b5adb;}return request({'event':_0x11f955,'message':_0xa78032});})['catch'](function(_0x3f72d5){logger[_0xdc2e('0x20')](_0xdc2e('0x1e'),_0xdc2e('0x3d'),_0x3f72d5);});}};}function getAgent(_0x4dcaf0){return db[_0xdc2e('0x3e')][_0xdc2e('0x3f')]({'where':{'id':_0x4dcaf0},'attributes':['id',_0xdc2e('0x30'),'fullname',_0xdc2e('0x40'),_0xdc2e('0x41')],'raw':!![]})[_0xdc2e('0x1c')](function(_0x2a96a8){return _0x2a96a8;});}exports[_0xdc2e('0x42')]=function(){for(var _0x110e49=0x0;_0x110e49=_0x3cfde7[_0xe3d0('0x12')]){throw Error(_0xe3d0('0x13'));}_0xb027f8(_0x3b92d8);})[_0xe3d0('0x14')](function(_0x4d7b1d){_0xd8edc0(_0x4d7b1d);});});}; \ No newline at end of file +var _0xe1d2=['whatsapp','openchannel','isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','getLicense','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','./license/util','voice','mail','chat','fax','sms'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe1d2,0x19d));var _0x2e1d=function(_0x1891ac,_0x2c7699){_0x1891ac=_0x1891ac-0x0;var _0x1d7a03=_0xe1d2[_0x1891ac];return _0x1d7a03;};'use strict';var _=require('lodash');var BPromise=require(_0x2e1d('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x2e1d('0x1'));var channels=[_0x2e1d('0x2'),_0x2e1d('0x3'),_0x2e1d('0x4'),_0x2e1d('0x5'),_0x2e1d('0x6'),_0x2e1d('0x7'),_0x2e1d('0x8')];exports['getChannels']=function(){return channels;};exports[_0x2e1d('0x9')]=function(_0x4925e7){_0x4925e7=_0x4925e7[_0x2e1d('0xa')]();return _['includes'](channels,_0x4925e7);};exports[_0x2e1d('0xb')]=function(_0x43031f,_0xc0127f,_0x3e846c,_0x175519){var _0x13e6a0={'loginAttempts':_0xc0127f,'blocked':_0x3e846c};if(!_[_0x2e1d('0xc')](_0x175519)){_0x13e6a0[_0x2e1d('0xd')]=_0x175519;}return _0x43031f['updateAttributes'](_0x13e6a0);};exports[_0x2e1d('0xe')]=function(_0x2b45e0){return new BPromise(function(_0x42620e,_0x2f1d22){var _0x54a438=0x0;if(_0x2b45e0['role']!==_0x2e1d('0xf')){_0x42620e(_0x2b45e0);}db[_0x2e1d('0x10')]['count']({'where':{'role':_0x2e1d('0xf'),'online':!![],'id':{'$ne':_0x2b45e0['id']}}})[_0x2e1d('0x11')](function(_0x2052e3){_0x54a438=_0x2052e3;return util[_0x2e1d('0xe')]();})[_0x2e1d('0x11')](function(_0x4609cd){if(_0x4609cd&&_0x4609cd[_0x2e1d('0x12')]&&_0x54a438>=_0x4609cd[_0x2e1d('0x12')]){throw Error(_0x2e1d('0x13'));}_0x42620e(_0x2b45e0);})[_0x2e1d('0x14')](function(_0x31f455){_0x2f1d22(_0x31f455);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index f62e7f8..df0c158 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb821=['status','exports','../config/logger','api','message','Error','inherits','name','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack'];(function(_0x45b7be,_0x4a88d5){var _0x61f17e=function(_0x3ecad1){while(--_0x3ecad1){_0x45b7be['push'](_0x45b7be['shift']());}};_0x61f17e(++_0x4a88d5);}(_0xb821,0xa7));var _0x1b82=function(_0x2fd274,_0x3a9812){_0x2fd274=_0x2fd274-0x0;var _0x2f3bfd=_0xb821[_0x2fd274];return _0x2f3bfd;};'use strict';var util=require('util');var logger=require(_0x1b82('0x0'))(_0x1b82('0x1'));var APIError=function(_0x5924c6,_0x4a4f81){this[_0x1b82('0x2')]=_0x5924c6||'Internal\x20Server\x20Error';this['name']=_0x4a4f81||_0x1b82('0x3');util[_0x1b82('0x4')](APIError,Error);};var APIBadRequestError=function(_0x3fadf0){this[_0x1b82('0x2')]=_0x3fadf0||'Bad\x20Request';this[_0x1b82('0x5')]=_0x1b82('0x6');util[_0x1b82('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3632dd){this[_0x1b82('0x2')]=_0x3632dd||_0x1b82('0x7');this[_0x1b82('0x5')]=_0x1b82('0x8');util[_0x1b82('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x4955b5){switch(_0x4955b5){case _0x1b82('0x6'):return 0x190;case _0x1b82('0x9'),_0x1b82('0xa'):return 0x193;case _0x1b82('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xcffb87){return function(_0x17a96b){logger[_0x1b82('0xb')](_0x17a96b[_0x1b82('0xc')]);var _0x5f521f=getStatusCode(_0x17a96b[_0x1b82('0x5')]);if(_0x17a96b[_0x1b82('0x5')])delete _0x17a96b[_0x1b82('0x5')];return _0xcffb87[_0x1b82('0xd')](_0x5f521f)['send'](_0x17a96b);};}module[_0x1b82('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xaa88=['Not\x20Found','Forbidden','OutOfInterval','error','stack','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','inherits','Entity\x20not\x20found'];(function(_0x2d5243,_0x5ee6ee){var _0xb10a4c=function(_0x10bb8d){while(--_0x10bb8d){_0x2d5243['push'](_0x2d5243['shift']());}};_0xb10a4c(++_0x5ee6ee);}(_0xaa88,0x137));var _0x8aa8=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0xaa88[_0x60df74];return _0x5ee872;};'use strict';var util=require(_0x8aa8('0x0'));var logger=require(_0x8aa8('0x1'))(_0x8aa8('0x2'));var APIError=function(_0x51c79b,_0x4aee38){this[_0x8aa8('0x3')]=_0x51c79b||_0x8aa8('0x4');this[_0x8aa8('0x5')]=_0x4aee38||_0x8aa8('0x6');util[_0x8aa8('0x7')](APIError,Error);};var APIBadRequestError=function(_0x350e8b){this['message']=_0x350e8b||'Bad\x20Request';this[_0x8aa8('0x5')]='Bad\x20Request';util[_0x8aa8('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x1ed84d){this[_0x8aa8('0x3')]=_0x1ed84d||_0x8aa8('0x8');this['name']=_0x8aa8('0x9');util[_0x8aa8('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x224f25){switch(_0x224f25){case'Bad\x20Request':return 0x190;case _0x8aa8('0xa'),_0x8aa8('0xb'):return 0x193;case _0x8aa8('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x33cc5c){return function(_0x583688){logger[_0x8aa8('0xc')](_0x583688[_0x8aa8('0xd')]);var _0x50787d=getStatusCode(_0x583688[_0x8aa8('0x5')]);if(_0x583688[_0x8aa8('0x5')])delete _0x583688[_0x8aa8('0x5')];return _0x33cc5c['status'](_0x50787d)[_0x8aa8('0xe')](_0x583688);};}module[_0x8aa8('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 9276feb..1466e90 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a23=['json','send','exports','404','status','render'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7a23,0x170));var _0x37a2=function(_0x255042,_0x4cf58c){_0x255042=_0x255042-0x0;var _0x211362=_0x7a23[_0x255042];return _0x211362;};'use strict';module[_0x37a2('0x0')][0x194]=function pageNotFound(_0x48a1ba,_0x2c48a3){var _0x3fcc11=_0x37a2('0x1');var _0x2e3941=0x194;var _0x325254={'status':_0x2e3941};_0x2c48a3[_0x37a2('0x2')](_0x325254['status']);_0x2c48a3[_0x37a2('0x3')](_0x3fcc11,{},function(_0x33f708,_0x3dae42){if(_0x33f708){return _0x2c48a3['status'](_0x325254['status'])[_0x37a2('0x4')](_0x325254);}_0x2c48a3[_0x37a2('0x5')](_0x3dae42);});}; \ No newline at end of file +var _0x57f5=['render','404','status'];(function(_0x49cff3,_0xf315b7){var _0x3fb1b2=function(_0x377d0c){while(--_0x377d0c){_0x49cff3['push'](_0x49cff3['shift']());}};_0x3fb1b2(++_0xf315b7);}(_0x57f5,0x1e7));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';module['exports'][0x194]=function pageNotFound(_0x189d9d,_0x2ba223){var _0x39f042=_0x557f('0x0');var _0x55b1d3=0x194;var _0x13eca3={'status':_0x55b1d3};_0x2ba223['status'](_0x13eca3[_0x557f('0x1')]);_0x2ba223[_0x557f('0x2')](_0x39f042,{},function(_0x2e75b7,_0x5639f5){if(_0x2e75b7){return _0x2ba223[_0x557f('0x1')](_0x13eca3[_0x557f('0x1')])['json'](_0x13eca3);}_0x2ba223['send'](_0x5639f5);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index beeef0c..4e08148 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x58c851,_0x1f3d96){var _0x534d8a=function(_0x10c1a0){while(--_0x10c1a0){_0x58c851['push'](_0x58c851['shift']());}};_0x534d8a(++_0x1f3d96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 7b7aa8e..a17ecf9 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7783=['/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/disposition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/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/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','route','get','sendFile','resolve','appPath','path','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','/api/users','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./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/fax/messages','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication'];(function(_0x2d1419,_0x35e992){var _0x274148=function(_0x480d49){while(--_0x480d49){_0x2d1419['push'](_0x2d1419['shift']());}};_0x274148(++_0x35e992);}(_0x7783,0xc7));var _0x3778=function(_0x26401d,_0x1d6a22){_0x26401d=_0x26401d-0x0;var _0x699c1d=_0x7783[_0x26401d];return _0x699c1d;};'use strict';var path=require(_0x3778('0x0'));var express=require('express');var errors=require('./errors');var config=require(_0x3778('0x1'));var setupLoggers=require(_0x3778('0x2'))[_0x3778('0x3')];var clientSideLogs=require(_0x3778('0x4'));exports['default']=function(_0x4a72de){return setupLoggers(_0x4a72de)[_0x3778('0x5')](function(){_0x4a72de['use'](_0x3778('0x6'),require('./api/user'));_0x4a72de[_0x3778('0x7')](_0x3778('0x8'),require(_0x3778('0x9')));_0x4a72de[_0x3778('0x7')](_0x3778('0xa'),require(_0x3778('0xb')));_0x4a72de[_0x3778('0x7')](_0x3778('0xc'),require(_0x3778('0xd')));_0x4a72de['use'](_0x3778('0xe'),require('./api/voiceMusicOnHold'));_0x4a72de['use'](_0x3778('0xf'),require(_0x3778('0x10')));_0x4a72de[_0x3778('0x7')]('/api/voice/recordings',require(_0x3778('0x11')));_0x4a72de['use'](_0x3778('0x12'),require('./api/screenRecording'));_0x4a72de[_0x3778('0x7')](_0x3778('0x13'),require(_0x3778('0x14')));_0x4a72de[_0x3778('0x7')](_0x3778('0x15'),require('./api/voiceMailMessage'));_0x4a72de[_0x3778('0x7')]('/api/voice/calls/reports',require(_0x3778('0x16')));_0x4a72de['use'](_0x3778('0x17'),require('./api/voiceDialReport'));_0x4a72de[_0x3778('0x7')](_0x3778('0x18'),require(_0x3778('0x19')));_0x4a72de[_0x3778('0x7')]('/api/voice/queues/reports',require(_0x3778('0x1a')));_0x4a72de[_0x3778('0x7')](_0x3778('0x1b'),require(_0x3778('0x1c')));_0x4a72de[_0x3778('0x7')](_0x3778('0x1d'),require(_0x3778('0x1e')));_0x4a72de[_0x3778('0x7')](_0x3778('0x1f'),require(_0x3778('0x20')));_0x4a72de[_0x3778('0x7')](_0x3778('0x21'),require('./api/mailServerOut'));_0x4a72de[_0x3778('0x7')](_0x3778('0x22'),require('./api/mailAccount'));_0x4a72de['use'](_0x3778('0x23'),require(_0x3778('0x24')));_0x4a72de[_0x3778('0x7')]('/api/mail/substatuses',require(_0x3778('0x25')));_0x4a72de[_0x3778('0x7')](_0x3778('0x26'),require(_0x3778('0x27')));_0x4a72de[_0x3778('0x7')]('/api/mail/messages',require(_0x3778('0x28')));_0x4a72de[_0x3778('0x7')](_0x3778('0x29'),require('./api/mailApplication'));_0x4a72de[_0x3778('0x7')](_0x3778('0x2a'),require(_0x3778('0x2b')));_0x4a72de['use'](_0x3778('0x2c'),require(_0x3778('0x2d')));_0x4a72de[_0x3778('0x7')](_0x3778('0x2e'),require(_0x3778('0x2f')));_0x4a72de[_0x3778('0x7')](_0x3778('0x30'),require(_0x3778('0x31')));_0x4a72de[_0x3778('0x7')](_0x3778('0x32'),require(_0x3778('0x33')));_0x4a72de[_0x3778('0x7')](_0x3778('0x34'),require('./api/faxInteraction'));_0x4a72de[_0x3778('0x7')](_0x3778('0x35'),require('./api/faxMessage'));_0x4a72de['use']('/api/fax/queues',require('./api/faxQueue'));_0x4a72de[_0x3778('0x7')](_0x3778('0x36'),require('./api/faxQueueReport'));_0x4a72de[_0x3778('0x7')](_0x3778('0x37'),require(_0x3778('0x38')));_0x4a72de[_0x3778('0x7')](_0x3778('0x39'),require(_0x3778('0x3a')));_0x4a72de[_0x3778('0x7')](_0x3778('0x3b'),require('./api/smsInteraction'));_0x4a72de[_0x3778('0x7')](_0x3778('0x3c'),require(_0x3778('0x3d')));_0x4a72de[_0x3778('0x7')](_0x3778('0x3e'),require(_0x3778('0x3f')));_0x4a72de[_0x3778('0x7')](_0x3778('0x40'),require('./api/openchannelAccount'));_0x4a72de['use'](_0x3778('0x41'),require(_0x3778('0x42')));_0x4a72de[_0x3778('0x7')](_0x3778('0x43'),require(_0x3778('0x44')));_0x4a72de[_0x3778('0x7')]('/api/openchannel/messages',require(_0x3778('0x45')));_0x4a72de[_0x3778('0x7')](_0x3778('0x46'),require('./api/openchannelQueue'));_0x4a72de['use']('/api/chat/websites',require(_0x3778('0x47')));_0x4a72de[_0x3778('0x7')](_0x3778('0x48'),require(_0x3778('0x49')));_0x4a72de[_0x3778('0x7')]('/api/chat/applications',require('./api/chatApplication'));_0x4a72de[_0x3778('0x7')]('/api/chat/interactions',require(_0x3778('0x4a')));_0x4a72de[_0x3778('0x7')](_0x3778('0x4b'),require(_0x3778('0x4c')));_0x4a72de['use']('/api/chat/offline_messages',require(_0x3778('0x4d')));_0x4a72de[_0x3778('0x7')](_0x3778('0x4e'),require(_0x3778('0x4f')));_0x4a72de[_0x3778('0x7')]('/api/chat/groups',require(_0x3778('0x50')));_0x4a72de[_0x3778('0x7')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x4a72de[_0x3778('0x7')](_0x3778('0x51'),require(_0x3778('0x52')));_0x4a72de[_0x3778('0x7')](_0x3778('0x53'),require('./api/cmContact'));_0x4a72de['use'](_0x3778('0x54'),require(_0x3778('0x55')));_0x4a72de[_0x3778('0x7')](_0x3778('0x56'),require(_0x3778('0x57')));_0x4a72de[_0x3778('0x7')](_0x3778('0x58'),require(_0x3778('0x59')));_0x4a72de[_0x3778('0x7')](_0x3778('0x5a'),require(_0x3778('0x5b')));_0x4a72de[_0x3778('0x7')](_0x3778('0x5c'),require(_0x3778('0x5d')));_0x4a72de['use']('/api/actions',require(_0x3778('0x5e')));_0x4a72de[_0x3778('0x7')](_0x3778('0x5f'),require(_0x3778('0x60')));_0x4a72de[_0x3778('0x7')](_0x3778('0x61'),require('./api/cannedAnswer'));_0x4a72de[_0x3778('0x7')]('/api/dispositions',require(_0x3778('0x62')));_0x4a72de[_0x3778('0x7')]('/api/conditions',require('./api/condition'));_0x4a72de[_0x3778('0x7')](_0x3778('0x63'),require(_0x3778('0x64')));_0x4a72de[_0x3778('0x7')]('/api/pauses',require(_0x3778('0x65')));_0x4a72de[_0x3778('0x7')](_0x3778('0x66'),require(_0x3778('0x67')));_0x4a72de[_0x3778('0x7')]('/api/voiceQueuesLog',require(_0x3778('0x68')));_0x4a72de[_0x3778('0x7')]('/api/schedules',require('./api/schedule'));_0x4a72de[_0x3778('0x7')](_0x3778('0x69'),require(_0x3778('0x6a')));_0x4a72de[_0x3778('0x7')]('/api/tags',require('./api/tag'));_0x4a72de['use'](_0x3778('0x6b'),require(_0x3778('0x6c')));_0x4a72de[_0x3778('0x7')]('/api/cm_contact_has_items',require(_0x3778('0x6d')));_0x4a72de[_0x3778('0x7')](_0x3778('0x6e'),require(_0x3778('0x6f')));_0x4a72de['use'](_0x3778('0x70'),require(_0x3778('0x71')));_0x4a72de[_0x3778('0x7')]('/api/triggers',require(_0x3778('0x72')));_0x4a72de[_0x3778('0x7')](_0x3778('0x73'),require(_0x3778('0x74')));_0x4a72de[_0x3778('0x7')](_0x3778('0x75'),require('./api/integration'));_0x4a72de['use']('/api/integrations/reports',require('./api/integrationReport'));_0x4a72de[_0x3778('0x7')](_0x3778('0x76'),require('./api/analyticCustomReport'));_0x4a72de[_0x3778('0x7')](_0x3778('0x77'),require('./api/analyticDefaultReport'));_0x4a72de['use'](_0x3778('0x78'),require(_0x3778('0x79')));_0x4a72de['use'](_0x3778('0x7a'),require(_0x3778('0x7b')));_0x4a72de[_0x3778('0x7')](_0x3778('0x7c'),require('./api/analyticFieldReport'));_0x4a72de[_0x3778('0x7')](_0x3778('0x7d'),require(_0x3778('0x7e')));_0x4a72de[_0x3778('0x7')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x4a72de[_0x3778('0x7')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x4a72de['use']('/api/integrations/salesforce/fields',require(_0x3778('0x7f')));_0x4a72de['use'](_0x3778('0x80'),require(_0x3778('0x81')));_0x4a72de[_0x3778('0x7')](_0x3778('0x82'),require(_0x3778('0x83')));_0x4a72de[_0x3778('0x7')](_0x3778('0x84'),require(_0x3778('0x85')));_0x4a72de[_0x3778('0x7')](_0x3778('0x86'),require(_0x3778('0x87')));_0x4a72de[_0x3778('0x7')](_0x3778('0x88'),require(_0x3778('0x89')));_0x4a72de[_0x3778('0x7')](_0x3778('0x8a'),require('./api/intDeskField'));_0x4a72de[_0x3778('0x7')](_0x3778('0x8b'),require(_0x3778('0x8c')));_0x4a72de[_0x3778('0x7')](_0x3778('0x8d'),require('./api/intZohoConfiguration'));_0x4a72de[_0x3778('0x7')](_0x3778('0x8e'),require(_0x3778('0x8f')));_0x4a72de[_0x3778('0x7')](_0x3778('0x90'),require(_0x3778('0x91')));_0x4a72de['use'](_0x3778('0x92'),require('./api/intZendeskConfiguration'));_0x4a72de['use'](_0x3778('0x93'),require(_0x3778('0x94')));_0x4a72de[_0x3778('0x7')](_0x3778('0x95'),require(_0x3778('0x96')));_0x4a72de['use']('/api/integrations/freshdesk/configurations',require(_0x3778('0x97')));_0x4a72de[_0x3778('0x7')](_0x3778('0x98'),require(_0x3778('0x99')));_0x4a72de[_0x3778('0x7')](_0x3778('0x9a'),require('./api/intVtigerAccount'));_0x4a72de[_0x3778('0x7')](_0x3778('0x9b'),require(_0x3778('0x9c')));_0x4a72de[_0x3778('0x7')](_0x3778('0x9d'),require(_0x3778('0x9e')));_0x4a72de[_0x3778('0x7')]('/api/integrations/servicenow/accounts',require(_0x3778('0x9f')));_0x4a72de[_0x3778('0x7')](_0x3778('0xa0'),require('./api/intServicenowConfiguration'));_0x4a72de[_0x3778('0x7')](_0x3778('0xa1'),require(_0x3778('0xa2')));_0x4a72de[_0x3778('0x7')]('/api/integrations/dynamics365/accounts',require(_0x3778('0xa3')));_0x4a72de[_0x3778('0x7')](_0x3778('0xa4'),require(_0x3778('0xa5')));_0x4a72de[_0x3778('0x7')]('/api/integrations/dynamics365/fields',require(_0x3778('0xa6')));_0x4a72de[_0x3778('0x7')](_0x3778('0xa7'),require(_0x3778('0xa8')));_0x4a72de[_0x3778('0x7')](_0x3778('0xa9'),require(_0x3778('0xaa')));_0x4a72de[_0x3778('0x7')]('/api/integrations/freshsales/fields',require(_0x3778('0xab')));_0x4a72de[_0x3778('0x7')](_0x3778('0xac'),require(_0x3778('0xad')));_0x4a72de['use'](_0x3778('0xae'),require(_0x3778('0xaf')));_0x4a72de[_0x3778('0x7')](_0x3778('0xb0'),require(_0x3778('0xb1')));_0x4a72de[_0x3778('0x7')](_0x3778('0xb2'),require(_0x3778('0xb3')));_0x4a72de[_0x3778('0x7')](_0x3778('0xb4'),require(_0x3778('0xb5')));_0x4a72de[_0x3778('0x7')](_0x3778('0xb6'),require(_0x3778('0xb7')));_0x4a72de[_0x3778('0x7')](_0x3778('0xb8'),require('./api/smsQueueReport'));_0x4a72de[_0x3778('0x7')]('/api/square/reports',require(_0x3778('0xb9')));_0x4a72de['use']('/api/square/details/reports',require(_0x3778('0xba')));_0x4a72de['use'](_0x3778('0xbb'),require(_0x3778('0xbc')));_0x4a72de[_0x3778('0x7')]('/api/settings',require(_0x3778('0xbd')));_0x4a72de[_0x3778('0x7')](_0x3778('0xbe'),require(_0x3778('0xbf')));_0x4a72de[_0x3778('0x7')]('/api/square/projects',require('./api/squareProject'));_0x4a72de[_0x3778('0x7')](_0x3778('0xc0'),require(_0x3778('0xc1')));_0x4a72de[_0x3778('0x7')]('/api/square/messages',require(_0x3778('0xc2')));_0x4a72de[_0x3778('0x7')](_0x3778('0xc3'),require(_0x3778('0xc4')));_0x4a72de[_0x3778('0x7')](_0x3778('0xc5'),require('./api/license'));_0x4a72de['use']('/api/campaigns',require(_0x3778('0xc6')));_0x4a72de['use']('/api/migrations',require(_0x3778('0xc7')));_0x4a72de['use'](_0x3778('0xc8'),require(_0x3778('0xc9')));_0x4a72de[_0x3778('0x7')](_0x3778('0xca'),require('./api/plugin'));_0x4a72de['use'](_0x3778('0xcb'),require(_0x3778('0xcc')));_0x4a72de[_0x3778('0x7')](_0x3778('0xcd'),require('./api/chatTransferReport'));_0x4a72de[_0x3778('0x7')](_0x3778('0xce'),require(_0x3778('0xcf')));_0x4a72de['use'](_0x3778('0xd0'),require(_0x3778('0xd1')));_0x4a72de['use']('/api/sms/reports/transfer',require(_0x3778('0xd2')));_0x4a72de[_0x3778('0x7')](_0x3778('0xd3'),require(_0x3778('0xd4')));_0x4a72de[_0x3778('0x7')](_0x3778('0xd5'),require(_0x3778('0xd6')));_0x4a72de[_0x3778('0x7')](_0x3778('0xd7'),require(_0x3778('0xd8')));_0x4a72de[_0x3778('0x7')](_0x3778('0xd9'),require(_0x3778('0xda')));_0x4a72de[_0x3778('0x7')]('/api/userProfile/resources',require(_0x3778('0xdb')));_0x4a72de['use'](_0x3778('0xdc'),require(_0x3778('0xdd')));_0x4a72de[_0x3778('0x7')](_0x3778('0xde'),require(_0x3778('0xdf')));_0x4a72de[_0x3778('0x7')]('/api/whatsapp/applications',require(_0x3778('0xe0')));_0x4a72de[_0x3778('0x7')](_0x3778('0xe1'),require(_0x3778('0xe2')));_0x4a72de[_0x3778('0x7')](_0x3778('0xe3'),require(_0x3778('0xe4')));_0x4a72de['use'](_0x3778('0xe5'),require(_0x3778('0xe6')));_0x4a72de['use'](_0x3778('0xe7'),require('./api/whatsappTransferReport'));_0x4a72de[_0x3778('0x7')](_0x3778('0xe8'),require('./api/whatsappQueue'));_0x4a72de[_0x3778('0x7')]('/api/cloudProviders',require(_0x3778('0xe9')));_0x4a72de['use'](_0x3778('0xea'),require(_0x3778('0xeb')));_0x4a72de[_0x3778('0x7')](_0x3778('0xec'),require(_0x3778('0xed')));_0x4a72de['use'](_0x3778('0xee'),require(_0x3778('0xef')));_0x4a72de[_0x3778('0x7')](_0x3778('0xf0'),require('./api/authGoogle'));_0x4a72de[_0x3778('0x7')]('/api/auth/activedirectory',require(_0x3778('0xf1')));_0x4a72de[_0x3778('0x7')](_0x3778('0xf2'),require('./api/jira'));_0x4a72de[_0x3778('0x7')](_0x3778('0xf3'),require(_0x3778('0xf4')));_0x4a72de[_0x3778('0x7')](_0x3778('0xf5'),require(_0x3778('0xf6')));_0x4a72de[_0x3778('0x7')](_0x3778('0xf7'),require(_0x3778('0xf8')));_0x4a72de['use'](_0x3778('0xf9'),require(_0x3778('0xfa')));_0x4a72de[_0x3778('0x7')](_0x3778('0xfb'),require('./api/webbar'));_0x4a72de[_0x3778('0x7')](_0x3778('0xfc'),clientSideLogs);_0x4a72de[_0x3778('0x7')](_0x3778('0xfd'),express[_0x3778('0xfe')](path[_0x3778('0xff')](config[_0x3778('0x100')],'/apidoc')));_0x4a72de[_0x3778('0x7')](_0x3778('0x101'),express[_0x3778('0xfe')](path[_0x3778('0xff')](config[_0x3778('0x100')],_0x3778('0x101'))));_0x4a72de[_0x3778('0x7')]('/demo',express[_0x3778('0xfe')](path[_0x3778('0xff')](config[_0x3778('0x100')],_0x3778('0x102'))));_0x4a72de['use'](_0x3778('0x103'),express['static'](path[_0x3778('0xff')](config[_0x3778('0x100')],_0x3778('0x104'),'3.1.0')));_0x4a72de[_0x3778('0x7')]('/plugins',express['static'](path[_0x3778('0xff')](config['root'],'/server/files/plugins')));_0x4a72de[_0x3778('0x105')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x3778('0x106')](errors[0x194]);_0x4a72de[_0x3778('0x105')]('/*')[_0x3778('0x106')](function(_0x73f19e,_0x355b44){_0x355b44[_0x3778('0x107')](path[_0x3778('0x108')](_0x4a72de[_0x3778('0x106')](_0x3778('0x109'))+'/index.html'));});return _0x4a72de;});}; \ No newline at end of file +var _0xd7ef=['./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.1.0','/plugins','/server/files/plugins','get','sendFile','resolve','appPath','/index.html','path','express','./errors','setupLoggers','./api/client-side-logs','default','/api/users','./api/user','use','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','./api/sound','/api/tags','./api/tag','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/license','/api/campaigns','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources'];(function(_0x20a086,_0x15cef2){var _0x379cc3=function(_0xe4c176){while(--_0xe4c176){_0x20a086['push'](_0x20a086['shift']());}};_0x379cc3(++_0x15cef2);}(_0xd7ef,0x13b));var _0xfd7e=function(_0x58dcd4,_0x578309){_0x58dcd4=_0x58dcd4-0x0;var _0xf9c742=_0xd7ef[_0x58dcd4];return _0xf9c742;};'use strict';var path=require(_0xfd7e('0x0'));var express=require(_0xfd7e('0x1'));var errors=require(_0xfd7e('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0xfd7e('0x3')];var clientSideLogs=require(_0xfd7e('0x4'));exports[_0xfd7e('0x5')]=function(_0x219546){return setupLoggers(_0x219546)['then'](function(){_0x219546['use'](_0xfd7e('0x6'),require(_0xfd7e('0x7')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x9'),require('./api/voiceChanSpy'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xa'),require(_0xfd7e('0xb')));_0x219546['use'](_0xfd7e('0xc'),require(_0xfd7e('0xd')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xe'),require('./api/voiceMusicOnHold'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xf'),require('./api/voiceQueue'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x10'),require('./api/voiceRecording'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x11'),require('./api/screenRecording'));_0x219546[_0xfd7e('0x8')]('/api/voice/mails',require(_0xfd7e('0x12')));_0x219546[_0xfd7e('0x8')]('/api/voice/mails/messages',require(_0xfd7e('0x13')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x14'),require(_0xfd7e('0x15')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x16'),require('./api/voiceDialReport'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x17'),require(_0xfd7e('0x18')));_0x219546['use']('/api/voice/queues/reports',require(_0xfd7e('0x19')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x1a'),require(_0xfd7e('0x1b')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x1c'),require(_0xfd7e('0x1d')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x1e'),require(_0xfd7e('0x1f')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x20'),require(_0xfd7e('0x21')));_0x219546['use']('/api/mail/accounts',require(_0xfd7e('0x22')));_0x219546['use'](_0xfd7e('0x23'),require(_0xfd7e('0x24')));_0x219546[_0xfd7e('0x8')]('/api/mail/substatuses',require(_0xfd7e('0x25')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x26'),require('./api/mailInteraction'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x27'),require(_0xfd7e('0x28')));_0x219546['use'](_0xfd7e('0x29'),require(_0xfd7e('0x2a')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x2b'),require('./api/mailQueueReport'));_0x219546['use'](_0xfd7e('0x2c'),require('./api/dashboard'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x2d'),require('./api/dashboardItem'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x2e'),require(_0xfd7e('0x2f')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x30'),require(_0xfd7e('0x31')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x32'),require(_0xfd7e('0x33')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x34'),require(_0xfd7e('0x35')));_0x219546['use'](_0xfd7e('0x36'),require(_0xfd7e('0x37')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x38'),require('./api/faxQueueReport'));_0x219546[_0xfd7e('0x8')]('/api/sms/accounts',require('./api/smsAccount'));_0x219546['use']('/api/sms/applications',require(_0xfd7e('0x39')));_0x219546['use'](_0xfd7e('0x3a'),require(_0xfd7e('0x3b')));_0x219546['use'](_0xfd7e('0x3c'),require(_0xfd7e('0x3d')));_0x219546['use']('/api/sms/queues',require(_0xfd7e('0x3e')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x3f'),require(_0xfd7e('0x40')));_0x219546[_0xfd7e('0x8')]('/api/openchannel/applications',require(_0xfd7e('0x41')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x42'),require(_0xfd7e('0x43')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x44'),require(_0xfd7e('0x45')));_0x219546['use']('/api/openchannel/queues',require(_0xfd7e('0x46')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x47'),require(_0xfd7e('0x48')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x49'),require(_0xfd7e('0x4a')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x4b'),require(_0xfd7e('0x4c')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x4d'),require(_0xfd7e('0x4e')));_0x219546[_0xfd7e('0x8')]('/api/chat/messages',require(_0xfd7e('0x4f')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x50'),require('./api/chatOfflineMessage'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x51'),require(_0xfd7e('0x52')));_0x219546['use']('/api/chat/groups',require('./api/chatGroup'));_0x219546[_0xfd7e('0x8')]('/api/chat/proactive_actions',require(_0xfd7e('0x53')));_0x219546['use'](_0xfd7e('0x54'),require(_0xfd7e('0x55')));_0x219546['use'](_0xfd7e('0x56'),require(_0xfd7e('0x57')));_0x219546[_0xfd7e('0x8')]('/api/cm/hopper',require('./api/cmHopper'));_0x219546['use'](_0xfd7e('0x58'),require(_0xfd7e('0x59')));_0x219546[_0xfd7e('0x8')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x219546['use'](_0xfd7e('0x5a'),require(_0xfd7e('0x5b')));_0x219546[_0xfd7e('0x8')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x5c'),require(_0xfd7e('0x5d')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x5e'),require(_0xfd7e('0x5f')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x60'),require('./api/cannedAnswer'));_0x219546['use'](_0xfd7e('0x61'),require(_0xfd7e('0x62')));_0x219546['use'](_0xfd7e('0x63'),require(_0xfd7e('0x64')));_0x219546['use'](_0xfd7e('0x65'),require('./api/interval'));_0x219546['use'](_0xfd7e('0x66'),require(_0xfd7e('0x67')));_0x219546['use'](_0xfd7e('0x68'),require(_0xfd7e('0x69')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x6a'),require(_0xfd7e('0x6b')));_0x219546[_0xfd7e('0x8')]('/api/schedules',require(_0xfd7e('0x6c')));_0x219546['use']('/api/sounds',require(_0xfd7e('0x6d')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x6e'),require(_0xfd7e('0x6f')));_0x219546[_0xfd7e('0x8')]('/api/contact_item_types',require('./api/contactItemType'));_0x219546[_0xfd7e('0x8')]('/api/cm_contact_has_items',require(_0xfd7e('0x70')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x71'),require('./api/cmHopperAdditionalPhone'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x72'),require(_0xfd7e('0x73')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x74'),require(_0xfd7e('0x75')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x76'),require(_0xfd7e('0x77')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x78'),require(_0xfd7e('0x79')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x7a'),require('./api/integrationReport'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x7b'),require('./api/analyticCustomReport'));_0x219546['use'](_0xfd7e('0x7c'),require(_0xfd7e('0x7d')));_0x219546['use'](_0xfd7e('0x7e'),require('./api/analyticExtractedReport'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x7f'),require('./api/analyticMetric'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x80'),require(_0xfd7e('0x81')));_0x219546['use'](_0xfd7e('0x82'),require(_0xfd7e('0x83')));_0x219546['use'](_0xfd7e('0x84'),require('./api/intSalesforceAccount'));_0x219546[_0xfd7e('0x8')]('/api/integrations/salesforce/configurations',require(_0xfd7e('0x85')));_0x219546['use']('/api/integrations/salesforce/fields',require(_0xfd7e('0x86')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x87'),require('./api/intSugarcrmAccount'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x88'),require(_0xfd7e('0x89')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x8a'),require(_0xfd7e('0x8b')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x8c'),require(_0xfd7e('0x8d')));_0x219546[_0xfd7e('0x8')]('/api/integrations/desk/configurations',require(_0xfd7e('0x8e')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x8f'),require(_0xfd7e('0x90')));_0x219546['use'](_0xfd7e('0x91'),require(_0xfd7e('0x92')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x93'),require(_0xfd7e('0x94')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x95'),require(_0xfd7e('0x96')));_0x219546['use']('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x97'),require(_0xfd7e('0x98')));_0x219546[_0xfd7e('0x8')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x99'),require(_0xfd7e('0x9a')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x9b'),require(_0xfd7e('0x9c')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x9d'),require(_0xfd7e('0x9e')));_0x219546[_0xfd7e('0x8')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x219546['use'](_0xfd7e('0x9f'),require(_0xfd7e('0xa0')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xa1'),require('./api/intVtigerField'));_0x219546[_0xfd7e('0x8')]('/api/integrations/servicenow/accounts',require(_0xfd7e('0xa2')));_0x219546[_0xfd7e('0x8')]('/api/integrations/servicenow/configurations',require(_0xfd7e('0xa3')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xa4'),require('./api/intServicenowField'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xa5'),require(_0xfd7e('0xa6')));_0x219546[_0xfd7e('0x8')]('/api/integrations/dynamics365/configurations',require(_0xfd7e('0xa7')));_0x219546['use'](_0xfd7e('0xa8'),require(_0xfd7e('0xa9')));_0x219546[_0xfd7e('0x8')]('/api/integrations/freshsales/accounts',require(_0xfd7e('0xaa')));_0x219546[_0xfd7e('0x8')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xab'),require(_0xfd7e('0xac')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xad'),require('./api/network'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xae'),require(_0xfd7e('0xaf')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xb0'),require(_0xfd7e('0xb1')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xb2'),require(_0xfd7e('0xb3')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xb4'),require('./api/jscriptyQuestionReport'));_0x219546['use'](_0xfd7e('0xb5'),require(_0xfd7e('0xb6')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xb7'),require(_0xfd7e('0xb8')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xb9'),require(_0xfd7e('0xba')));_0x219546[_0xfd7e('0x8')]('/api/square/details/reports',require(_0xfd7e('0xbb')));_0x219546['use'](_0xfd7e('0xbc'),require('./api/jscriptyProject'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xbd'),require(_0xfd7e('0xbe')));_0x219546['use'](_0xfd7e('0xbf'),require(_0xfd7e('0xc0')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xc1'),require(_0xfd7e('0xc2')));_0x219546['use']('/api/square/recordings',require(_0xfd7e('0xc3')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xc4'),require(_0xfd7e('0xc5')));_0x219546[_0xfd7e('0x8')]('/api/teams',require('./api/team'));_0x219546[_0xfd7e('0x8')]('/api/license',require(_0xfd7e('0xc6')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xc7'),require('./api/campaign'));_0x219546[_0xfd7e('0x8')]('/api/migrations',require(_0xfd7e('0xc8')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xc9'),require(_0xfd7e('0xca')));_0x219546[_0xfd7e('0x8')]('/api/plugins',require(_0xfd7e('0xcb')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xcc'),require(_0xfd7e('0xcd')));_0x219546[_0xfd7e('0x8')]('/api/chat/reports/transfer',require(_0xfd7e('0xce')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xcf'),require(_0xfd7e('0xd0')));_0x219546['use'](_0xfd7e('0xd1'),require(_0xfd7e('0xd2')));_0x219546[_0xfd7e('0x8')]('/api/sms/reports/transfer',require(_0xfd7e('0xd3')));_0x219546[_0xfd7e('0x8')]('/api/cm/lists',require(_0xfd7e('0xd4')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xd5'),require(_0xfd7e('0xd6')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xd7'),require('./api/userProfile'));_0x219546['use'](_0xfd7e('0xd8'),require(_0xfd7e('0xd9')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xda'),require(_0xfd7e('0xdb')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xdc'),require('./api/userNotification'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xdd'),require(_0xfd7e('0xde')));_0x219546['use'](_0xfd7e('0xdf'),require(_0xfd7e('0xe0')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xe1'),require('./api/whatsappInteraction'));_0x219546['use'](_0xfd7e('0xe2'),require(_0xfd7e('0xe3')));_0x219546['use'](_0xfd7e('0xe4'),require('./api/whatsappQueueReport'));_0x219546[_0xfd7e('0x8')]('/api/whatsapp/reports/transfer',require(_0xfd7e('0xe5')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xe6'),require(_0xfd7e('0xe7')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xe8'),require('./api/cloudProvider'));_0x219546['use'](_0xfd7e('0xe9'),require('./api/realtime'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xea'),require(_0xfd7e('0xeb')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xec'),require(_0xfd7e('0xed')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xee'),require(_0xfd7e('0xef')));_0x219546[_0xfd7e('0x8')]('/api/auth/activedirectory',require(_0xfd7e('0xf0')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xf1'),require(_0xfd7e('0xf2')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xf3'),require(_0xfd7e('0xf4')));_0x219546['use']('/api/version',require('./api/version'));_0x219546['use'](_0xfd7e('0xf5'),require('./api/system'));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xf6'),require(_0xfd7e('0xf7')));_0x219546['use'](_0xfd7e('0xf8'),require(_0xfd7e('0xf9')));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xfa'),clientSideLogs);_0x219546[_0xfd7e('0x8')](_0xfd7e('0xfb'),express[_0xfd7e('0xfc')](path[_0xfd7e('0xfd')](config[_0xfd7e('0xfe')],_0xfd7e('0xfb'))));_0x219546[_0xfd7e('0x8')](_0xfd7e('0xff'),express[_0xfd7e('0xfc')](path[_0xfd7e('0xfd')](config[_0xfd7e('0xfe')],_0xfd7e('0xff'))));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x100'),express[_0xfd7e('0xfc')](path[_0xfd7e('0xfd')](config[_0xfd7e('0xfe')],_0xfd7e('0x100'))));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x101'),express[_0xfd7e('0xfc')](path[_0xfd7e('0xfd')](config[_0xfd7e('0xfe')],_0xfd7e('0x102'),_0xfd7e('0x103'))));_0x219546[_0xfd7e('0x8')](_0xfd7e('0x104'),express['static'](path['join'](config[_0xfd7e('0xfe')],_0xfd7e('0x105'))));_0x219546['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0xfd7e('0x106')](errors[0x194]);_0x219546['route']('/*')[_0xfd7e('0x106')](function(_0x2ef86f,_0x82776b){_0x82776b[_0xfd7e('0x107')](path[_0xfd7e('0x108')](_0x219546['get'](_0xfd7e('0x109'))+_0xfd7e('0x10a')));});return _0x219546;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 9cc6a8b..31549bf 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x843b=['port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/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/mailApplication/mailApplication.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/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x843b,0x91));var _0xb843=function(_0x4ed32c,_0xd62543){_0x4ed32c=_0x4ed32c-0x0;var _0x574516=_0x843b[_0x4ed32c];return _0x574516;};'use strict';var jayson=require(_0xb843('0x0'));var _=require(_0xb843('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x2d214b,_0x25fb9e){var _0x2e36cd={};_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x2')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x4')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/voiceQueue/voiceQueue.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x5')));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x6')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x7')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x8')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x9')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0xa')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0xb')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0xc')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0xd')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0xe')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0xf')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x10')));_0x2e36cd=_['merge'](_0x2e36cd,require('../api/mailMessage/mailMessage.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x11')));_0x2e36cd=_['merge'](_0x2e36cd,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x12')));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x13')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x14')));_0x2e36cd=_['merge'](_0x2e36cd,require('../api/faxMessage/faxMessage.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x15')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x16')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x17')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x18')));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x19')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x1a')));_0x2e36cd=_['merge'](_0x2e36cd,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x1b')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x1c')));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x1d')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x1e')));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x1f')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x20')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/cmContact/cmContact.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/cmHopper/cmHopper.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x21')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x22')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x23')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x24')));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x25')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x26')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x27')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x28')));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x29')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x2a')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x2b')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x2c')));_0x2e36cd=_['merge'](_0x2e36cd,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x2d')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x2e')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x2f')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x30')));_0x2e36cd=_['merge'](_0x2e36cd,require('../api/setting/setting.rpc'));_0x2e36cd=_['merge'](_0x2e36cd,require('../api/squareOdbc/squareOdbc.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x31')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/squareRecording/squareRecording.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/squareMessage/squareMessage.rpc'));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x32')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x33')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x34')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x35')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x36')));_0x2e36cd=_[_0xb843('0x3')](_0x2e36cd,require(_0xb843('0x37')));_0x2e36cd=_['merge'](_0x2e36cd,require(_0xb843('0x38')));var _0x5b1379=jayson['server'](_0x2e36cd)[_0xb843('0x39')]();var _0x169bc8=config[_0xb843('0x3a')][_0xb843('0x3b')]||config[_0xb843('0x3b')]+0x1;var _0x1670bc=config[_0xb843('0x3a')]['ip']||_0xb843('0x3c');_0x5b1379['on'](_0xb843('0x3d'),function(_0x26317e){return _0x25fb9e(_0x26317e);});_0x5b1379[_0xb843('0x3e')](_0x169bc8,_0x1670bc,function(){console[_0xb843('0x3f')](_0xb843('0x40'),_0x1670bc,_0x169bc8);require(_0xb843('0x41'))[_0xb843('0x42')]();return _0x2d214b(_0xb843('0x43')+_0x1670bc+':'+_0x169bc8);});});}; \ No newline at end of file +var _0x914a=['../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','log','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x914a,0x18e));var _0xa914=function(_0xd4ec0c,_0x2afcd2){_0xd4ec0c=_0xd4ec0c-0x0;var _0x580218=_0x914a[_0xd4ec0c];return _0x580218;};'use strict';var jayson=require('jayson/promise');var _=require(_0xa914('0x0'));var config=require(_0xa914('0x1'));exports[_0xa914('0x2')]=function(){return new Promise(function(_0xa25f2f,_0xd37794){var _0x475c3a={};_0x475c3a=_['merge'](_0x475c3a,require('../api/user/user.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/voiceExtension/voiceExtension.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/voiceQueue/voiceQueue.rpc'));_0x475c3a=_['merge'](_0x475c3a,require('../api/voiceRecording/voiceRecording.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x4')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x5')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x6')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x7')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x8')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x9')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0xa')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/mailServerIn/mailServerIn.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0xb')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0xc')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0xd')));_0x475c3a=_['merge'](_0x475c3a,require('../api/mailMessage/mailMessage.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/mailApplication/mailApplication.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0xe')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0xf')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x10')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x11')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x12')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x13')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x14')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/smsInteraction/smsInteraction.rpc'));_0x475c3a=_['merge'](_0x475c3a,require('../api/smsMessage/smsMessage.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/smsQueue/smsQueue.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x15')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x16')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x17')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x18')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x19')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x1a')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x1b')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x1c')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/cmHopper/cmHopper.rpc'));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x1d')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x1e')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x1f')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x20')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x21')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x22')));_0x475c3a=_['merge'](_0x475c3a,require('../api/sound/sound.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x23')));_0x475c3a=_['merge'](_0x475c3a,require('../api/template/template.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x24')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x25')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x26')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x27')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x28')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x29')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x2a')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x2b')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x2c')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x2d')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x2e')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x2f')));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x30')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x31')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x32')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x33')));_0x475c3a=_['merge'](_0x475c3a,require('../api/squareProject/squareProject.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x34')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x35')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x36')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/attachment/attachment.rpc'));_0x475c3a=_['merge'](_0x475c3a,require('../api/plugin/plugin.rpc'));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x475c3a=_['merge'](_0x475c3a,require(_0xa914('0x37')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x38')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x39')));_0x475c3a=_[_0xa914('0x3')](_0x475c3a,require(_0xa914('0x3a')));var _0x162962=jayson[_0xa914('0x3b')](_0x475c3a)[_0xa914('0x3c')]();var _0xd314c2=config['rpc']['port']||config[_0xa914('0x3d')]+0x1;var _0x90ec88=config[_0xa914('0x3e')]['ip']||_0xa914('0x3f');_0x162962['on']('error',function(_0x49130e){return _0xd37794(_0x49130e);});_0x162962[_0xa914('0x2')](_0xd314c2,_0x90ec88,function(){console[_0xa914('0x40')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x90ec88,_0xd314c2);require(_0xa914('0x41'))[_0xa914('0x42')]();return _0xa25f2f(_0xa914('0x43')+_0x90ec88+':'+_0xd314c2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index f88d785..4f83a7d 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 _0x1c23=['format','exec','isArray','EXEC\x20%s\x20%s','setContext','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','toLowerCase','hangup','substring','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','write','inherits','prototype','sendRequest','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE'];(function(_0x5480fd,_0x46600d){var _0x2ec312=function(_0x32797c){while(--_0x32797c){_0x5480fd['push'](_0x5480fd['shift']());}};_0x2ec312(++_0x46600d);}(_0x1c23,0x1d5));var _0x31c2=function(_0x26962e,_0x4395b7){_0x26962e=_0x26962e-0x0;var _0x596dd2=_0x1c23[_0x26962e];return _0x596dd2;};'use strict';var util=require(_0x31c2('0x0'));var _=require(_0x31c2('0x1'));var EventEmitter=require(_0x31c2('0x2'))[_0x31c2('0x3')];var AGIReply=require(_0x31c2('0x4'));var AGIError=require(_0x31c2('0x5'));function AGIChannel(_0x4af174){var _0x30a2af=this,_0x2da7ad=new AGIReply(),_0x55e8c3=![],_0x50b513={};EventEmitter[_0x31c2('0x6')](_0x30a2af);_0x4af174[_0x31c2('0x7')](_0x31c2('0x8'));_0x4af174[_0x31c2('0x9')](0x8*0x3c*0x3c*0x3e8);_0x2da7ad['setEncoding'](_0x31c2('0x8'));_0x2da7ad['on'](_0x31c2('0xa'),function(_0x37d859){for(var _0x101f42 in _0x37d859){_0x30a2af[_0x101f42]=_0x37d859[_0x101f42];}_0x30a2af[_0x31c2('0xb')]('ready');});_0x2da7ad['on']('line',function(_0x3794c4){if(_0x3794c4[_0x31c2('0xc')]()==_0x31c2('0xd')){_0x30a2af[_0x31c2('0xb')](_0x31c2('0xd'));return;}if(_0x3794c4[_0x31c2('0xe')](0x0,0xb)=='520-Invalid'){_0x55e8c3=!![];}if(_0x55e8c3){_0x50b513['rx']+=_0x3794c4+'\x0a';if(_0x3794c4[_0x31c2('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x55e8c3=![];}}else{_0x50b513['rx']=_0x3794c4;}if(_0x55e8c3){return;}if(typeof _0x50b513['cb']==_0x31c2('0x10')){var _0x2df4e5=_0x50b513['rx'][_0x31c2('0xe')](0x0,0x3),_0x1d8406=null,_0x5f573a=null;_0x2df4e5=parseInt(_0x2df4e5);if(isNaN(_0x2df4e5)){_0x50b513['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x31c2('0x11')});return;}if(_0x2df4e5!=0xc8){_0x50b513['cb'](null,{'code':_0x2df4e5,'result':-0x1,'extra':'KO'});return;}_0x1d8406=_0x50b513['rx']['substring'](0x4)[_0x31c2('0x12')](_0x31c2('0x13'),'');if(_0x1d8406[_0x31c2('0x14')]('\x20')!=-0x1){_0x1d8406=_0x1d8406[_0x31c2('0x15')](0x0,_0x1d8406[_0x31c2('0x14')]('\x20'));}if(_[_0x31c2('0x16')](_0x1d8406,'-1')){_0x1d8406=parseInt(_0x1d8406);}_0x5f573a=_0x50b513['rx'][_0x31c2('0x17')]('\x20');if(_0x5f573a[_0x31c2('0x18')]==0x3){_0x5f573a=_0x5f573a[0x2][_0x31c2('0xe')](0x1,_0x5f573a[0x2][_0x31c2('0x18')]-0x1);}else if(_0x5f573a[_0x31c2('0x18')]>0x3){var _0x5660fb=/\((.+)\)/;var _0x4cf53a=_0x50b513['rx'][_0x31c2('0x19')](_0x5660fb);if(_0x4cf53a){_0x5f573a=_0x4cf53a[0x1];}else{_0x5f573a=null;}}else{_0x5f573a=null;}_0x50b513['cb'](null,{'code':_0x2df4e5,'result':_0x1d8406,'extra':_0x5f573a});}});_0x4af174['on'](_0x31c2('0x1a'),function(_0x1f7f83){_0x30a2af['emit']('error',new AGIError(_0x31c2('0x1b'),_0x1f7f83['code']));});_0x4af174['on'](_0x31c2('0x1c'),function(){_0x30a2af[_0x31c2('0xb')](_0x31c2('0x1c'),new AGIError(_0x31c2('0x1d')));});_0x4af174['on']('timeout',function(){_0x30a2af[_0x31c2('0xb')]('timeout',new AGIError(_0x31c2('0x1e')));_0x4af174[_0x31c2('0x1f')]();});_0x4af174['pipe'](_0x2da7ad);this['command']=function(_0x3c14bc,_0x36ae8e){var _0x3c14bc=_0x3c14bc||'',_0x36ae8e=typeof _0x36ae8e==_0x31c2('0x10')?_0x36ae8e:new Function();_0x50b513={'tx':_0x3c14bc,'rx':'','cb':_0x36ae8e};_0x4af174[_0x31c2('0x20')](_0x3c14bc+'\x0a');},this[_0x31c2('0x1c')]=function(){_0x4af174['destroy']();};}util[_0x31c2('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x31c2('0x22')]['sendRequest']=function(_0x259a5b){return this['command']['sync'](this,_0x259a5b);};AGIChannel[_0x31c2('0x22')]['answer']=function(){return this[_0x31c2('0x23')](_0x31c2('0x24'));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x25')]=function(_0x3ad658,_0x5c3fb0,_0x344cd7){_0x3ad658=_0x3ad658===undefined?_0x31c2('0x26'):_0x3ad658;_0x5c3fb0=_0x5c3fb0===undefined?'5':_0x5c3fb0;_0x344cd7=_0x344cd7===undefined?'1':_0x344cd7;return this[_0x31c2('0x23')](util['format'](_0x31c2('0x27'),_0x3ad658,_0x5c3fb0*0x3e8,_0x344cd7));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x28')]=function(_0x2a936e){_0x2a936e=_0x2a936e||_0x31c2('0x29');return this[_0x31c2('0x23')](util[_0x31c2('0x2a')]('VERBOSE\x20\x22%s\x22',_0x2a936e));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x2b')]=function(_0x1eb509,_0x2488eb){if(_[_0x31c2('0x2c')](_0x2488eb)){return this[_0x31c2('0x23')](util[_0x31c2('0x2a')]('EXEC\x20%s\x20%s',_0x1eb509,_0x2488eb['join'](',')));}return this[_0x31c2('0x23')](util['format'](_0x31c2('0x2d'),_0x1eb509,_0x2488eb));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x2e')]=function(_0x664112){return this['sendRequest'](util[_0x31c2('0x2a')]('SET\x20CONTEXT\x20%s',_0x664112));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x2f')]=function(_0x325d14){return this[_0x31c2('0x23')](util['format']('SET\x20EXTENSION\x20%s',_0x325d14));};AGIChannel['prototype'][_0x31c2('0x30')]=function(_0x3c1d7b){return this[_0x31c2('0x23')](util[_0x31c2('0x2a')](_0x31c2('0x31'),_0x3c1d7b));};AGIChannel[_0x31c2('0x22')][_0x31c2('0xd')]=function(){return this[_0x31c2('0x23')](_0x31c2('0x32'));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x33')]=function(_0x409cf0,_0x20a1f3){var _0x209d08=_[_0x31c2('0x34')](_0x20a1f3)||_['isNumber'](_0x20a1f3)?_0x20a1f3['toString']():_0x20a1f3;return this[_0x31c2('0x23')](util[_0x31c2('0x2a')](_0x31c2('0x35'),_0x409cf0,_0x209d08?_0x209d08[_0x31c2('0x36')]()[_0x31c2('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x29d419,_0x33f8a5){return this[_0x31c2('0x23')](util[_0x31c2('0x2a')](_0x31c2('0x37'),_0x29d419,_0x33f8a5));};AGIChannel['prototype'][_0x31c2('0x38')]=function(_0x4026e9,_0x592258){return this[_0x31c2('0x23')](util['format'](_0x31c2('0x39'),_0x4026e9,_0x592258));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x3a')]=function(_0x158cca,_0x54980e){return this[_0x31c2('0x23')](util[_0x31c2('0x2a')](_0x31c2('0x3b'),_0x158cca,_0x54980e));};AGIChannel[_0x31c2('0x22')]['continueAt']=function(_0xa59d36,_0x252259,_0x2bad2d){_0x252259=_0x252259||this[_0x31c2('0x3c')];_0x2bad2d=_0x2bad2d||0x1;this[_0x31c2('0x2e')](_0xa59d36);this['setExtension'](_0x252259);this[_0x31c2('0x30')](_0x2bad2d);return this['noop'](util[_0x31c2('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0xa59d36,_0x252259,_0x2bad2d));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x3d')]=function(_0x149bd0){return this[_0x31c2('0x23')](util[_0x31c2('0x2a')](_0x31c2('0x3e'),_0x149bd0));};AGIChannel[_0x31c2('0x22')]['recordFile']=function(_0x78a253,_0x1eeaf,_0x3e5763,_0x65e1bb,_0x3841f1,_0x3448f4){_0x1eeaf=_0x1eeaf||_0x31c2('0x3f');_0x3e5763=_0x3e5763||'';_0x65e1bb=_0x65e1bb===undefined?-0x1:_0x65e1bb==='-1'?-0x1:_0x65e1bb*0x3e8;_0x3841f1=_0x3841f1===undefined?'':'s='+_0x3841f1;_0x3448f4=_0x3448f4?_0x31c2('0x40'):'';return this[_0x31c2('0x23')](util[_0x31c2('0x2a')](_0x31c2('0x41'),_0x78a253,_0x1eeaf,_0x3e5763,_0x65e1bb,_0x3448f4,_0x3841f1));};AGIChannel[_0x31c2('0x22')][_0x31c2('0x42')]=function(_0x37eef2,_0x64a8b){_0x64a8b=_0x64a8b||'';return this[_0x31c2('0x23')](util[_0x31c2('0x2a')](_0x31c2('0x43'),_0x37eef2,_0x64a8b));};AGIChannel['prototype'][_0x31c2('0x44')]=function(_0x2b15a5){return this['exec'](_0x31c2('0x45'),_0x2b15a5);};AGIChannel[_0x31c2('0x22')][_0x31c2('0x46')]=function(_0x20f49a){return this[_0x31c2('0x2b')](_0x31c2('0x47'),_0x20f49a);};AGIChannel[_0x31c2('0x22')]['error']=function(_0x47a700,_0x583842){this[_0x31c2('0x28')](util[_0x31c2('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x47a700['id'],_0x47a700['label'],_0x583842));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x31c2('0x48')]=AGIChannel; \ No newline at end of file +var _0x03fc=['wait','WAIT','label','exports','lodash','events','EventEmitter','./reply','./error','call','setEncoding','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','substring','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','inherits','sendRequest','command','prototype','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22'];(function(_0x56ef2b,_0x426c0a){var _0xd840d7=function(_0x27f92e){while(--_0x27f92e){_0x56ef2b['push'](_0x56ef2b['shift']());}};_0xd840d7(++_0x426c0a);}(_0x03fc,0x128));var _0xc03f=function(_0x22ae56,_0x16955c){_0x22ae56=_0x22ae56-0x0;var _0x1544f5=_0x03fc[_0x22ae56];return _0x1544f5;};'use strict';var util=require('util');var _=require(_0xc03f('0x0'));var EventEmitter=require(_0xc03f('0x1'))[_0xc03f('0x2')];var AGIReply=require(_0xc03f('0x3'));var AGIError=require(_0xc03f('0x4'));function AGIChannel(_0x3585ee){var _0x251999=this,_0x3d234e=new AGIReply(),_0x14d692=![],_0x3e3198={};EventEmitter[_0xc03f('0x5')](_0x251999);_0x3585ee['setEncoding']('utf8');_0x3585ee['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3d234e[_0xc03f('0x6')]('utf8');_0x3d234e['on']('headers',function(_0x26ff74){for(var _0x4f1801 in _0x26ff74){_0x251999[_0x4f1801]=_0x26ff74[_0x4f1801];}_0x251999[_0xc03f('0x7')](_0xc03f('0x8'));});_0x3d234e['on'](_0xc03f('0x9'),function(_0x22447b){if(_0x22447b[_0xc03f('0xa')]()==_0xc03f('0xb')){_0x251999[_0xc03f('0x7')](_0xc03f('0xb'));return;}if(_0x22447b['substring'](0x0,0xb)==_0xc03f('0xc')){_0x14d692=!![];}if(_0x14d692){_0x3e3198['rx']+=_0x22447b+'\x0a';if(_0x22447b[_0xc03f('0xd')](_0xc03f('0xe'))!=-0x1){_0x14d692=![];}}else{_0x3e3198['rx']=_0x22447b;}if(_0x14d692){return;}if(typeof _0x3e3198['cb']==_0xc03f('0xf')){var _0x57ecc=_0x3e3198['rx']['substring'](0x0,0x3),_0x186948=null,_0x1870c6=null;_0x57ecc=parseInt(_0x57ecc);if(isNaN(_0x57ecc)){_0x3e3198['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xc03f('0x10')});return;}if(_0x57ecc!=0xc8){_0x3e3198['cb'](null,{'code':_0x57ecc,'result':-0x1,'extra':'KO'});return;}_0x186948=_0x3e3198['rx'][_0xc03f('0x11')](0x4)[_0xc03f('0x12')](_0xc03f('0x13'),'');if(_0x186948[_0xc03f('0x14')]('\x20')!=-0x1){_0x186948=_0x186948['substr'](0x0,_0x186948['indexOf']('\x20'));}if(_[_0xc03f('0x15')](_0x186948,'-1')){_0x186948=parseInt(_0x186948);}_0x1870c6=_0x3e3198['rx'][_0xc03f('0x16')]('\x20');if(_0x1870c6[_0xc03f('0x17')]==0x3){_0x1870c6=_0x1870c6[0x2]['substring'](0x1,_0x1870c6[0x2]['length']-0x1);}else if(_0x1870c6['length']>0x3){var _0x160efd=/\((.+)\)/;var _0x226a9a=_0x3e3198['rx'][_0xc03f('0x18')](_0x160efd);if(_0x226a9a){_0x1870c6=_0x226a9a[0x1];}else{_0x1870c6=null;}}else{_0x1870c6=null;}_0x3e3198['cb'](null,{'code':_0x57ecc,'result':_0x186948,'extra':_0x1870c6});}});_0x3585ee['on'](_0xc03f('0x19'),function(_0x4ec892){_0x251999[_0xc03f('0x7')](_0xc03f('0x19'),new AGIError(_0xc03f('0x1a'),_0x4ec892[_0xc03f('0x1b')]));});_0x3585ee['on'](_0xc03f('0x1c'),function(){_0x251999[_0xc03f('0x7')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3585ee['on'](_0xc03f('0x1d'),function(){_0x251999['emit']('timeout',new AGIError(_0xc03f('0x1e')));_0x3585ee[_0xc03f('0x1f')]();});_0x3585ee[_0xc03f('0x20')](_0x3d234e);this['command']=function(_0x56f25d,_0x3089b9){var _0x56f25d=_0x56f25d||'',_0x3089b9=typeof _0x3089b9=='function'?_0x3089b9:new Function();_0x3e3198={'tx':_0x56f25d,'rx':'','cb':_0x3089b9};_0x3585ee['write'](_0x56f25d+'\x0a');},this[_0xc03f('0x1c')]=function(){_0x3585ee[_0xc03f('0x1f')]();};}util[_0xc03f('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xc03f('0x22')]=function(_0x163b2c){return this[_0xc03f('0x23')]['sync'](this,_0x163b2c);};AGIChannel[_0xc03f('0x24')][_0xc03f('0x25')]=function(){return this[_0xc03f('0x22')](_0xc03f('0x26'));};AGIChannel[_0xc03f('0x24')][_0xc03f('0x27')]=function(_0x12e15f,_0x5ddabb,_0x14692e){_0x12e15f=_0x12e15f===undefined?_0xc03f('0x28'):_0x12e15f;_0x5ddabb=_0x5ddabb===undefined?'5':_0x5ddabb;_0x14692e=_0x14692e===undefined?'1':_0x14692e;return this[_0xc03f('0x22')](util[_0xc03f('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x12e15f,_0x5ddabb*0x3e8,_0x14692e));};AGIChannel[_0xc03f('0x24')][_0xc03f('0x2a')]=function(_0x2a7b27){_0x2a7b27=_0x2a7b27||_0xc03f('0x2b');return this[_0xc03f('0x22')](util[_0xc03f('0x29')](_0xc03f('0x2c'),_0x2a7b27));};AGIChannel[_0xc03f('0x24')][_0xc03f('0x2d')]=function(_0x1276c3,_0xdd6a5d){if(_['isArray'](_0xdd6a5d)){return this['sendRequest'](util[_0xc03f('0x29')](_0xc03f('0x2e'),_0x1276c3,_0xdd6a5d['join'](',')));}return this[_0xc03f('0x22')](util[_0xc03f('0x29')](_0xc03f('0x2e'),_0x1276c3,_0xdd6a5d));};AGIChannel[_0xc03f('0x24')]['setContext']=function(_0x216d4f){return this['sendRequest'](util['format'](_0xc03f('0x2f'),_0x216d4f));};AGIChannel[_0xc03f('0x24')][_0xc03f('0x30')]=function(_0x2076a1){return this[_0xc03f('0x22')](util[_0xc03f('0x29')]('SET\x20EXTENSION\x20%s',_0x2076a1));};AGIChannel[_0xc03f('0x24')][_0xc03f('0x31')]=function(_0x471e3c){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0x471e3c));};AGIChannel[_0xc03f('0x24')]['hangup']=function(){return this[_0xc03f('0x22')]('HANGUP');};AGIChannel[_0xc03f('0x24')][_0xc03f('0x32')]=function(_0x4f6db8,_0x363d68){var _0x2146b0=_[_0xc03f('0x33')](_0x363d68)||_[_0xc03f('0x34')](_0x363d68)?_0x363d68[_0xc03f('0x35')]():_0x363d68;return this[_0xc03f('0x22')](util['format'](_0xc03f('0x36'),_0x4f6db8,_0x2146b0?_0x2146b0['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x2f6087,_0x56b13e){return this[_0xc03f('0x22')](util[_0xc03f('0x29')](_0xc03f('0x37'),_0x2f6087,_0x56b13e));};AGIChannel['prototype'][_0xc03f('0x38')]=function(_0x344222,_0x9ea941){return this[_0xc03f('0x22')](util[_0xc03f('0x29')](_0xc03f('0x39'),_0x344222,_0x9ea941));};AGIChannel[_0xc03f('0x24')][_0xc03f('0x3a')]=function(_0x31b50e,_0x4068a5){return this['sendRequest'](util[_0xc03f('0x29')](_0xc03f('0x3b'),_0x31b50e,_0x4068a5));};AGIChannel[_0xc03f('0x24')][_0xc03f('0x3c')]=function(_0x25c69c,_0x519433,_0x36d686){_0x519433=_0x519433||this[_0xc03f('0x3d')];_0x36d686=_0x36d686||0x1;this['setContext'](_0x25c69c);this[_0xc03f('0x30')](_0x519433);this[_0xc03f('0x31')](_0x36d686);return this['noop'](util['format']('GOTO\x20%s\x20%s\x20%s',_0x25c69c,_0x519433,_0x36d686));};AGIChannel[_0xc03f('0x24')]['getVariable']=function(_0x21ee60){return this[_0xc03f('0x22')](util[_0xc03f('0x29')](_0xc03f('0x3e'),_0x21ee60));};AGIChannel[_0xc03f('0x24')][_0xc03f('0x3f')]=function(_0x432229,_0x423d0a,_0x57b12a,_0x17b2ad,_0x246085,_0x1caaf1){_0x423d0a=_0x423d0a||_0xc03f('0x40');_0x57b12a=_0x57b12a||'';_0x17b2ad=_0x17b2ad===undefined?-0x1:_0x17b2ad==='-1'?-0x1:_0x17b2ad*0x3e8;_0x246085=_0x246085===undefined?'':'s='+_0x246085;_0x1caaf1=_0x1caaf1?_0xc03f('0x41'):'';return this[_0xc03f('0x22')](util[_0xc03f('0x29')](_0xc03f('0x42'),_0x432229,_0x423d0a,_0x57b12a,_0x17b2ad,_0x1caaf1,_0x246085));};AGIChannel['prototype'][_0xc03f('0x43')]=function(_0x1efc3b,_0x52b3f9){_0x52b3f9=_0x52b3f9||'';return this[_0xc03f('0x22')](util[_0xc03f('0x29')](_0xc03f('0x44'),_0x1efc3b,_0x52b3f9));};AGIChannel[_0xc03f('0x24')]['agi']=function(_0x44abe1){return this['exec']('AGI',_0x44abe1);};AGIChannel['prototype'][_0xc03f('0x45')]=function(_0x2378d7){return this['exec'](_0xc03f('0x46'),_0x2378d7);};AGIChannel['prototype'][_0xc03f('0x19')]=function(_0x199370,_0x2536c9){this[_0xc03f('0x2a')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x199370['id'],_0x199370[_0xc03f('0x47')],_0x2536c9));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xc03f('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 58b10ee..cfbcbe4 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 _0x32a4=['Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x32a4,0x132));var _0x432a=function(_0x30825f,_0x5d92b0){_0x30825f=_0x30825f-0x0;var _0x296ee5=_0x32a4[_0x30825f];return _0x296ee5;};'use strict';var util=require(_0x432a('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x432a('0x1'),'E_AGI_SERVER_ERROR':_0x432a('0x2'),'E_AGI_SERVER_CLOSE':_0x432a('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x432a('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x432a('0x5'),'E_AGI_COMMAND_EMPTY':_0x432a('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x432a('0x7')};function AGIError(_0x3e366d){var _0x3e366d=_0x3e366d||null,_0x151fcd=_0x151fcd||[],_0xb5c950=0x1,_0x111e9e='';if(!error[_0x3e366d]){_0x3e366d='E_AGI_UNDEFINED';}_0x151fcd['push'](error[_0x3e366d]);while(arguments[_0xb5c950]){_0x151fcd[_0x432a('0x8')](arguments[_0xb5c950]);_0xb5c950++;}_0x111e9e=util[_0x432a('0x9')][_0x432a('0xa')](util,_0x151fcd);this['message']=_0x111e9e;this[_0x432a('0xb')]=_0x3e366d;}module['exports']=AGIError; \ No newline at end of file +var _0xbd70=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0xbd70,0x1c1));var _0x0bd7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbd70[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x0bd7('0x0'));var error={'E_AGI_UNDEFINED':_0x0bd7('0x1'),'E_AGI_ARGUMENT_PORT':_0x0bd7('0x2'),'E_AGI_SERVER_ERROR':_0x0bd7('0x3'),'E_AGI_SERVER_CLOSE':_0x0bd7('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x0bd7('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x0bd7('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x0bd7('0x7'),'E_AGI_COMMAND_EMPTY':_0x0bd7('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0bd7('0x9'),'E_AGI_IVR_ENTRY':_0x0bd7('0xa')};function AGIError(_0x514484){var _0x514484=_0x514484||null,_0x3c2317=_0x3c2317||[],_0x15d42f=0x1,_0x2417a9='';if(!error[_0x514484]){_0x514484=_0x0bd7('0xb');}_0x3c2317[_0x0bd7('0xc')](error[_0x514484]);while(arguments[_0x15d42f]){_0x3c2317[_0x0bd7('0xc')](arguments[_0x15d42f]);_0x15d42f++;}_0x2417a9=util[_0x0bd7('0xd')][_0x0bd7('0xe')](util,_0x3c2317);this[_0x0bd7('0xf')]=_0x2417a9;this[_0x0bd7('0x10')]=_0x514484;}module[_0x0bd7('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index f9170a2..d67eb99 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 _0x63fa=['./error','../../config/environment','redis','defaults','localhost','subscribe','agi','error','E_AGI_SERVER_ERROR','parse','emit','exports','lodash','events','EventEmitter','ioredis'];(function(_0x555441,_0x26e246){var _0x5133eb=function(_0x3ab665){while(--_0x3ab665){_0x555441['push'](_0x555441['shift']());}};_0x5133eb(++_0x26e246);}(_0x63fa,0x6c));var _0xa63f=function(_0x3f2b2,_0x2996f9){_0x3f2b2=_0x3f2b2-0x0;var _0x596f62=_0x63fa[_0x3f2b2];return _0x596f62;};'use strict';var _=require(_0xa63f('0x0'));var EventEmitter=require(_0xa63f('0x1'))[_0xa63f('0x2')];var Redis=require(_0xa63f('0x3'));var AGIError=require(_0xa63f('0x4'));var config=require(_0xa63f('0x5'));config[_0xa63f('0x6')]=_[_0xa63f('0x7')](config[_0xa63f('0x6')],{'host':_0xa63f('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xa63f('0x6')]);sub[_0xa63f('0x9')](_0xa63f('0xa'),function(_0x33c56f){if(_0x33c56f)return eventEmitter['emit'](_0xa63f('0xb'),new AGIError(_0xa63f('0xc'),_0x33c56f));});sub['on']('message',function(_0x5b32c7,_0x53aea3){if(_0x5b32c7!=='agi')return;try{var _0x4efd55=JSON[_0xa63f('0xd')](_0x53aea3);eventEmitter[_0xa63f('0xe')]('projectUpdate',_0x4efd55);}catch(_0x18a51b){eventEmitter[_0xa63f('0xe')](_0xa63f('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x18a51b));}});module[_0xa63f('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x06c3=['error','E_AGI_SERVER_ERROR','message','exports','lodash','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','subscribe','agi','emit'];(function(_0x578d34,_0x42b092){var _0x10e534=function(_0x1735b6){while(--_0x1735b6){_0x578d34['push'](_0x578d34['shift']());}};_0x10e534(++_0x42b092);}(_0x06c3,0xac));var _0x306c=function(_0x2c3a55,_0x4dc4d6){_0x2c3a55=_0x2c3a55-0x0;var _0x41df3e=_0x06c3[_0x2c3a55];return _0x41df3e;};'use strict';var _=require(_0x306c('0x0'));var EventEmitter=require('events')[_0x306c('0x1')];var Redis=require(_0x306c('0x2'));var AGIError=require(_0x306c('0x3'));var config=require(_0x306c('0x4'));config[_0x306c('0x5')]=_[_0x306c('0x6')](config[_0x306c('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x306c('0x7')](_0x306c('0x8'),function(_0x4d5245){if(_0x4d5245)return eventEmitter[_0x306c('0x9')](_0x306c('0xa'),new AGIError(_0x306c('0xb'),_0x4d5245));});sub['on'](_0x306c('0xc'),function(_0x16a144,_0x4b67ab){if(_0x16a144!==_0x306c('0x8'))return;try{var _0x2c6633=JSON['parse'](_0x4b67ab);eventEmitter[_0x306c('0x9')]('projectUpdate',_0x2c6633);}catch(_0xfc2d30){eventEmitter[_0x306c('0x9')](_0x306c('0xa'),new AGIError(_0x306c('0xb'),_0xfc2d30));}});module[_0x306c('0xd')]={'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 dc58c92..f069761 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 _0x8bcb=['menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','size','getVertex','info','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','vswitch','target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','exports','lodash','../../../config/logger','agi'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x8bcb,0xcf));var _0xb8bc=function(_0x3a041f,_0x1c2e64){_0x3a041f=_0x3a041f-0x0;var _0xbdf5a=_0x8bcb[_0x3a041f];return _0xbdf5a;};'use strict';var _=require(_0xb8bc('0x0'));var logger=require(_0xb8bc('0x1'))(_0xb8bc('0x2'));var verticesWithRetry=[_0xb8bc('0x3'),_0xb8bc('0x4'),_0xb8bc('0x5')];var Graph=function(){this[_0xb8bc('0x6')]={};this[_0xb8bc('0x7')]={};this[_0xb8bc('0x8')]=0x0;};Graph['prototype'][_0xb8bc('0x9')]=function(_0x4b7448){this['vertices'][_0x4b7448['id']]=_0x4b7448;this[_0xb8bc('0x7')][_0x4b7448['id']]=[];};Graph[_0xb8bc('0xa')][_0xb8bc('0xb')]=function(_0x410aed,_0xaa28eb,_0x2eec44){this[_0xb8bc('0x7')][_0x410aed][_0xb8bc('0xc')]({'target':_0xaa28eb,'condition':_0x2eec44});this[_0xb8bc('0x8')]+=0x1;};Graph['prototype'][_0xb8bc('0xd')]=function(){return _['size'](this[_0xb8bc('0x6')]);};Graph[_0xb8bc('0xa')]['relations']=function(){return this[_0xb8bc('0x8')];};Graph[_0xb8bc('0xa')][_0xb8bc('0xe')]=function(_0x41e371){return this[_0xb8bc('0x6')][_0x41e371];};Graph[_0xb8bc('0xa')]['traverseBFS']=function(_0x137a97,_0x43682d){if(!this[_0xb8bc('0x6')][_0x137a97]){return logger[_0xb8bc('0xf')]('no\x20vertex\x20found');}var _0x2c7d95=_0x43682d(this[_0xb8bc('0x6')][_0x137a97]);if(!_0x2c7d95){return logger[_0xb8bc('0xf')](_0xb8bc('0x10'));}if(this[_0xb8bc('0x7')][_0x137a97]['length']===0x0){return logger['info'](_0xb8bc('0x11'));}for(var _0xb951a6=0x0,_0x5b31e4=[],_0x20ba58=![];_0xb951a6\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','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc1bc,0x112));var _0xcc1b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc1bc[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xcc1b('0x0'));var syncho=require('syncho');var util=require('util');var config=require('../../config/environment');var logger=require(_0xcc1b('0x1'))(_0xcc1b('0x2'));var utilLicense=require(_0xcc1b('0x3'));var rpc=require(_0xcc1b('0x4'));var Project=require('./project');var AGIEmitter=require(_0xcc1b('0x5'))[_0xcc1b('0x6')];var projects=[];config[_0xcc1b('0x2')]=_[_0xcc1b('0x7')](config[_0xcc1b('0x2')],{'ip':_0xcc1b('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x3978ee){process[_0xcc1b('0x9')](function(){syncho(function(){try{setChannelVariables(_0x3978ee);agiHandler(_0x3978ee);}catch(_0x1a3ba1){logger[_0xcc1b('0xa')](_0x1a3ba1[_0xcc1b('0xb')]);}});});}function projectUpdateHandler(_0x339205){try{var _0x55db61=_['findIndex'](projects,['id',_0x339205['id']]);if(_0x55db61>-0x1){if(_0x339205[_0xcc1b('0xc')]===!![]){projects[_0xcc1b('0xd')](_0x55db61,0x1);}else{projects[_0x55db61]=_0x339205;}}else{projects['push'](_0x339205);}}catch(_0xee13a1){logger['error'](_0xee13a1['stack']);}}function listeningHandler(){console[_0xcc1b('0xe')](_0xcc1b('0xf'),config[_0xcc1b('0x2')][_0xcc1b('0x10')]);logger['info'](util['format'](_0xcc1b('0x11'),config[_0xcc1b('0x2')]['ip'],config[_0xcc1b('0x2')]['port']));}function errorHandler(_0xee4131){if(_0xee4131&&_0xee4131[_0xcc1b('0x12')]&&_0xee4131[_0xcc1b('0x13')]){logger[_0xcc1b('0xa')](util[_0xcc1b('0x14')](_0xcc1b('0x15'),_0xee4131[_0xcc1b('0x12')],_0xee4131['message']));}else{logger[_0xcc1b('0xa')](util[_0xcc1b('0x14')](_0xcc1b('0x16'),_0xee4131[_0xcc1b('0xb')]));}}function closeHandler(){logger['info'](util[_0xcc1b('0x14')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xcc1b('0x17')],this[_0xcc1b('0x18')],this[_0xcc1b('0x19')],this[_0xcc1b('0x1a')],this[_0xcc1b('0x1b')]));try{createSquareReport(this);}catch(_0x5ab754){logger['error'](_0x5ab754[_0xcc1b('0xb')]);}}function timeoutHandler(){logger[_0xcc1b('0x1c')](util[_0xcc1b('0x14')](_0xcc1b('0x1d'),this[_0xcc1b('0x17')],this[_0xcc1b('0x18')],this[_0xcc1b('0x19')],this[_0xcc1b('0x1a')],this[_0xcc1b('0x1b')]));}function hangupHandler(){logger[_0xcc1b('0x1c')](util[_0xcc1b('0x14')](_0xcc1b('0x1e'),this[_0xcc1b('0x17')],this[_0xcc1b('0x18')],this['callerid'],this[_0xcc1b('0x1a')],this['uniqueid']));this[_0xcc1b('0x1f')]=!![];}function createSquareReport(_0x335045,_0x41d5a4){rpc[_0xcc1b('0x20')](_0x335045)[_0xcc1b('0x21')](function(_0x5f338c){if(_0x41d5a4){_0x41d5a4(null,_0x5f338c);}})[_0xcc1b('0x22')](function(_0x3a5738){if(_0x41d5a4){_0x41d5a4(null,_0x3a5738);}});}function setChannelVariables(_0x3990d0){for(var _0x4166b2 in _0x3990d0){if(_0x3990d0[_0xcc1b('0x23')](_0x4166b2)){if(_0x4166b2[_0xcc1b('0x24')](_0xcc1b('0x25'))===0x0){_0x3990d0[_0x4166b2[_0xcc1b('0x26')](0x4)]=_0x3990d0[_0x4166b2];delete _0x3990d0[_0x4166b2];}}}}function agiHandler(_0x14f6f1){logger[_0xcc1b('0x27')]('variables',JSON[_0xcc1b('0x28')](_0x14f6f1,null,0x2));logger[_0xcc1b('0x1c')](util[_0xcc1b('0x14')](_0xcc1b('0x29'),_0x14f6f1[_0xcc1b('0x17')],_0x14f6f1[_0xcc1b('0x18')],_0x14f6f1[_0xcc1b('0x19')],_0x14f6f1[_0xcc1b('0x1a')],_0x14f6f1[_0xcc1b('0x1b')]));_0x14f6f1['on'](_0xcc1b('0xa'),errorHandler);_0x14f6f1['on']('close',closeHandler);_0x14f6f1['on']('timeout',timeoutHandler);_0x14f6f1[_0xcc1b('0x1f')]=![];_0x14f6f1['on']('hangup',hangupHandler);var _0x4b2710=_['find'](projects,['name',_0x14f6f1[_0xcc1b('0x17')]]);if(!_0x4b2710)return Project[_0xcc1b('0x2a')](_0x14f6f1);if(!_0x4b2710[_0xcc1b('0x2b')])return Project[_0xcc1b('0x2c')](_0x14f6f1);return Project[_0xcc1b('0x2d')](_0x4b2710,_0x14f6f1);}function main(){var _0x3105a2;return utilLicense[_0xcc1b('0x2e')]()[_0xcc1b('0x21')](function(_0x562c10){if(!_0x562c10)return;if(_0x562c10[_0xcc1b('0x2f')]){if(_0x562c10['callysquare']&&_0x562c10[_0xcc1b('0x30')]>0x0){logger[_0xcc1b('0x1c')](util[_0xcc1b('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x562c10[_0xcc1b('0x30')]));_0x3105a2=_0x562c10[_0xcc1b('0x30')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xcc1b('0x1c')](_0xcc1b('0x31'));_0x3105a2=-0x1;}})[_0xcc1b('0x21')](function(){return Project[_0xcc1b('0x32')]();})['then'](function(_0x350a2f){projects=_0x350a2f;return;})[_0xcc1b('0x22')](function(_0x184259){logger[_0xcc1b('0xa')](_0xcc1b('0x33'),_0x184259[_0xcc1b('0xb')]);})[_0xcc1b('0x34')](function(){var _0x3a961f=require('./server')(config[_0xcc1b('0x2')][_0xcc1b('0x10')],config[_0xcc1b('0x2')]['ip'],_0x3105a2);_0x3a961f['on'](_0xcc1b('0xa'),errorHandler);_0x3a961f['on'](_0xcc1b('0x35'),listeningHandler);_0x3a961f['on'](_0xcc1b('0x36'),connectionHandler);_0x3a961f['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xd64c=['port','connection','lodash','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','error','stack','findIndex','deleted','splice','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','catch','agi_','substring','debug','variables','stringify','close','timeout','handleNotFound','handleUnpublished','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','./server'];(function(_0x38b7a6,_0x29d10c){var _0x3ea610=function(_0x390639){while(--_0x390639){_0x38b7a6['push'](_0x38b7a6['shift']());}};_0x3ea610(++_0x29d10c);}(_0xd64c,0xa7));var _0xcd64=function(_0x1efb79,_0x32fb44){_0x1efb79=_0x1efb79-0x0;var _0x117ac4=_0xd64c[_0x1efb79];return _0x117ac4;};'use strict';var _=require(_0xcd64('0x0'));var syncho=require(_0xcd64('0x1'));var util=require('util');var config=require(_0xcd64('0x2'));var logger=require(_0xcd64('0x3'))(_0xcd64('0x4'));var utilLicense=require(_0xcd64('0x5'));var rpc=require(_0xcd64('0x6'));var Project=require('./project');var AGIEmitter=require(_0xcd64('0x7'))[_0xcd64('0x8')];var projects=[];config[_0xcd64('0x4')]=_[_0xcd64('0x9')](config[_0xcd64('0x4')],{'ip':_0xcd64('0xa'),'port':0x11dd});AGIEmitter['on'](_0xcd64('0xb'),projectUpdateHandler);function connectionHandler(_0x4b9019){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4b9019);agiHandler(_0x4b9019);}catch(_0x26db9a){logger[_0xcd64('0xc')](_0x26db9a[_0xcd64('0xd')]);}});});}function projectUpdateHandler(_0x45d303){try{var _0x1c9507=_[_0xcd64('0xe')](projects,['id',_0x45d303['id']]);if(_0x1c9507>-0x1){if(_0x45d303[_0xcd64('0xf')]===!![]){projects[_0xcd64('0x10')](_0x1c9507,0x1);}else{projects[_0x1c9507]=_0x45d303;}}else{projects['push'](_0x45d303);}}catch(_0x246469){logger[_0xcd64('0xc')](_0x246469[_0xcd64('0xd')]);}}function listeningHandler(){console[_0xcd64('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xcd64('0x4')]['port']);logger[_0xcd64('0x12')](util[_0xcd64('0x13')](_0xcd64('0x14'),config[_0xcd64('0x4')]['ip'],config['agi']['port']));}function errorHandler(_0x1294fc){if(_0x1294fc&&_0x1294fc[_0xcd64('0x15')]&&_0x1294fc[_0xcd64('0x16')]){logger[_0xcd64('0xc')](util[_0xcd64('0x13')](_0xcd64('0x17'),_0x1294fc[_0xcd64('0x15')],_0x1294fc['message']));}else{logger[_0xcd64('0xc')](util[_0xcd64('0x13')](_0xcd64('0x18'),_0x1294fc['stack']));}}function closeHandler(){logger[_0xcd64('0x12')](util[_0xcd64('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xcd64('0x19')],this[_0xcd64('0x1a')],this['callerid'],this[_0xcd64('0x1b')],this[_0xcd64('0x1c')]));try{createSquareReport(this);}catch(_0x46c338){logger[_0xcd64('0xc')](_0x46c338[_0xcd64('0xd')]);}}function timeoutHandler(){logger[_0xcd64('0x12')](util[_0xcd64('0x13')](_0xcd64('0x1d'),this['arg_1'],this[_0xcd64('0x1a')],this[_0xcd64('0x1e')],this['dnid'],this[_0xcd64('0x1c')]));}function hangupHandler(){logger[_0xcd64('0x12')](util['format'](_0xcd64('0x1f'),this[_0xcd64('0x19')],this[_0xcd64('0x1a')],this[_0xcd64('0x1e')],this[_0xcd64('0x1b')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x3647fc,_0x3b33aa){rpc[_0xcd64('0x20')](_0x3647fc)['then'](function(_0x21561b){if(_0x3b33aa){_0x3b33aa(null,_0x21561b);}})[_0xcd64('0x21')](function(_0x4063b8){if(_0x3b33aa){_0x3b33aa(null,_0x4063b8);}});}function setChannelVariables(_0x52a730){for(var _0x39ba71 in _0x52a730){if(_0x52a730['hasOwnProperty'](_0x39ba71)){if(_0x39ba71['indexOf'](_0xcd64('0x22'))===0x0){_0x52a730[_0x39ba71[_0xcd64('0x23')](0x4)]=_0x52a730[_0x39ba71];delete _0x52a730[_0x39ba71];}}}}function agiHandler(_0xdbac6b){logger[_0xcd64('0x24')](_0xcd64('0x25'),JSON[_0xcd64('0x26')](_0xdbac6b,null,0x2));logger[_0xcd64('0x12')](util[_0xcd64('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xdbac6b[_0xcd64('0x19')],_0xdbac6b[_0xcd64('0x1a')],_0xdbac6b[_0xcd64('0x1e')],_0xdbac6b[_0xcd64('0x1b')],_0xdbac6b['uniqueid']));_0xdbac6b['on'](_0xcd64('0xc'),errorHandler);_0xdbac6b['on'](_0xcd64('0x27'),closeHandler);_0xdbac6b['on'](_0xcd64('0x28'),timeoutHandler);_0xdbac6b['evtHangup']=![];_0xdbac6b['on']('hangup',hangupHandler);var _0x46e45d=_['find'](projects,[_0xcd64('0x15'),_0xdbac6b[_0xcd64('0x19')]]);if(!_0x46e45d)return Project[_0xcd64('0x29')](_0xdbac6b);if(!_0x46e45d['production'])return Project[_0xcd64('0x2a')](_0xdbac6b);return Project['initialize'](_0x46e45d,_0xdbac6b);}function main(){var _0x1fc4e2;return utilLicense[_0xcd64('0x2b')]()[_0xcd64('0x2c')](function(_0x4f3da2){if(!_0x4f3da2)return;if(_0x4f3da2[_0xcd64('0x2d')]){if(_0x4f3da2[_0xcd64('0x2e')]&&_0x4f3da2[_0xcd64('0x2e')]>0x0){logger['info'](util[_0xcd64('0x13')](_0xcd64('0x2f'),_0x4f3da2['callysquare']));_0x1fc4e2=_0x4f3da2['callysquare'];}else{logger[_0xcd64('0x12')](_0xcd64('0x30'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1fc4e2=-0x1;}})['then'](function(){return Project[_0xcd64('0x31')]();})[_0xcd64('0x2c')](function(_0x183d5e){projects=_0x183d5e;return;})[_0xcd64('0x21')](function(_0x493834){logger['error'](_0xcd64('0x32'),_0x493834[_0xcd64('0xd')]);})[_0xcd64('0x33')](function(){var _0x445fdc=require(_0xcd64('0x34'))(config[_0xcd64('0x4')][_0xcd64('0x35')],config[_0xcd64('0x4')]['ip'],_0x1fc4e2);_0x445fdc['on']('error',errorHandler);_0x445fdc['on']('listening',listeningHandler);_0x445fdc['on'](_0xcd64('0x36'),connectionHandler);_0x445fdc['on'](_0xcd64('0x27'),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 c7c73da..f9b95a4 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 _0xf1eb=['http','request','then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0xf1eb,0xef));var _0xbf1e=function(_0x2ad753,_0x1e242e){_0x2ad753=_0x2ad753-0x0;var _0x4cfbc1=_0xf1eb[_0x2ad753];return _0x4cfbc1;};'use strict';var BPromise=require(_0xbf1e('0x0'));var jayson=require(_0xbf1e('0x1'));var client=jayson[_0xbf1e('0x2')][_0xbf1e('0x3')]({'port':0x232b});function request(_0x4a6a3e,_0x5c51b2){return new BPromise(function(_0x1f2d3b,_0x498276){return client[_0xbf1e('0x4')](_0x4a6a3e,_0x5c51b2)[_0xbf1e('0x5')](function(_0x26eb8e){if(_0x26eb8e[_0xbf1e('0x6')]){return _0x498276(_0x26eb8e['error'][_0xbf1e('0x7')]);}else{return _0x1f2d3b(_0x26eb8e['result']);}})[_0xbf1e('0x8')](function(_0x5dcf97){return _0x498276(_0x5dcf97);});});}exports[_0xbf1e('0x9')]=function(_0x3d0fcf,_0x2a5f49){return request(_0xbf1e('0xa'),{'account':_0x3d0fcf,'message':_0x2a5f49});}; \ No newline at end of file +var _0x0d03=['catch','bluebird','jayson/promise','client','http','then','error','result'];(function(_0x3f7372,_0x3f410){var _0x469320=function(_0x1b5ea7){while(--_0x1b5ea7){_0x3f7372['push'](_0x3f7372['shift']());}};_0x469320(++_0x3f410);}(_0x0d03,0x1a1));var _0x30d0=function(_0xe01ce,_0x3da228){_0xe01ce=_0xe01ce-0x0;var _0x3508d0=_0x0d03[_0xe01ce];return _0x3508d0;};'use strict';var BPromise=require(_0x30d0('0x0'));var jayson=require(_0x30d0('0x1'));var client=jayson[_0x30d0('0x2')][_0x30d0('0x3')]({'port':0x232b});function request(_0x334545,_0x205f0b){return new BPromise(function(_0x5cbc97,_0xacba2){return client['request'](_0x334545,_0x205f0b)[_0x30d0('0x4')](function(_0x359910){if(_0x359910[_0x30d0('0x5')]){return _0xacba2(_0x359910[_0x30d0('0x5')]['message']);}else{return _0x5cbc97(_0x359910[_0x30d0('0x6')]);}})[_0x30d0('0x7')](function(_0x253ab7){return _0xacba2(_0x253ab7);});});}exports['sendMailMessage']=function(_0x583fef,_0x37287e){return request('SendMail',{'account':_0x583fef,'message':_0x37287e});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 6ef5ac1..6de5655 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 _0x2b52=['source','target','addEdge','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','format','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','dnid','clear','vertex','stringify','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[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','lodash','xml2json','util','./rpc','./vertices','catch','error','stack','agicommand','hasOwnProperty','retry','maxRetry','omit','isArray','length'];(function(_0x423767,_0x2888c5){var _0x282c19=function(_0x5df554){while(--_0x5df554){_0x423767['push'](_0x423767['shift']());}};_0x282c19(++_0x2888c5);}(_0x2b52,0x104));var _0x22b5=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x2b52[_0x2e8418];return _0x548fe6;};'use strict';var _=require(_0x22b5('0x0'));var moment=require('moment');var parser=require(_0x22b5('0x1'));var util=require(_0x22b5('0x2'));var logger=require('../../config/logger')('agi');var rpc=require(_0x22b5('0x3'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0x22b5('0x4'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x22b5('0x5')](function(_0x29e484){logger[_0x22b5('0x6')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x29e484[_0x22b5('0x7')]);return[];});}function addVertex(_0x30c028,_0x2c1e8d,_0x33dc2b){_0x2c1e8d[_0x22b5('0x8')]=_0x33dc2b;if(_0x2c1e8d[_0x22b5('0x9')](_0x22b5('0xa'))){_0x2c1e8d[_0x22b5('0xb')]=parseInt(_0x2c1e8d['retry'],0xa);}_0x30c028['addVertex'](_[_0x22b5('0xc')](_0x2c1e8d,'mxCell'));}function initGraph(_0x52c2c3,_0x366bf3){var _0x238354=new Graph();for(var _0x141f36 in _0x52c2c3){if(_0x52c2c3[_0x22b5('0x9')](_0x141f36)){if(_[_0x22b5('0xd')](_0x52c2c3[_0x141f36])){for(var _0x1d740a=0x0;_0x1d740a<_0x52c2c3[_0x141f36][_0x22b5('0xe')];_0x1d740a+=0x1){addVertex(_0x238354,_0x52c2c3[_0x141f36][_0x1d740a],_0x141f36);}}else{addVertex(_0x238354,_0x52c2c3[_0x141f36],_0x141f36);}}}for(var _0x3fc2f8=0x0;_0x3fc2f8<_0x366bf3[_0x22b5('0xe')];_0x3fc2f8+=0x1){if(_0x366bf3[_0x3fc2f8][_0x22b5('0xf')]&&_0x366bf3[_0x3fc2f8][_0x22b5('0x10')]){_0x238354[_0x22b5('0x11')](_0x366bf3[_0x3fc2f8][_0x22b5('0xf')],_0x366bf3[_0x3fc2f8][_0x22b5('0x10')],_0x366bf3[_0x3fc2f8]['value']);}}return _0x238354;}function getRoot(_0x3ca246){return parser[_0x22b5('0x12')](_0x3ca246,{'object':!![]})[_0x22b5('0x13')][_0x22b5('0x14')];}function inspect(_0x2f356a){return util[_0x22b5('0x15')](_0x2f356a,{'showHidden':![],'depth':null});}function initialize(_0x17cb52,_0x541aca){var _0xb1593=getRoot(_0x17cb52[_0x22b5('0x16')]);if(!_0xb1593||!_0xb1593[_0x22b5('0x17')])return;var _0x33264f,_0x1456c9,_0x3f15c4;logger[_0x22b5('0x18')](_0x22b5('0x14'),JSON['stringify'](_0xb1593,null,0x2));_0x541aca[_0x22b5('0x19')]=moment()[_0x22b5('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');_0x33264f=initGraph(_[_0x22b5('0xc')](_0xb1593,'mxCell'),_0xb1593[_0x22b5('0x1b')]);_0x1456c9=new Vertices(_0x541aca,rpc,mailRpc);logger[_0x22b5('0x1c')](util['format'](_0x22b5('0x1d'),_0x541aca[_0x22b5('0x1e')],_0x541aca[_0x22b5('0x1f')],_0x541aca[_0x22b5('0x20')],_0x541aca[_0x22b5('0x21')],_0x541aca['uniqueid']));_0x33264f['traverseBFS'](_0xb1593[_0x22b5('0x17')]['id'],function(_0x4a54c9){try{_0x4a54c9=_0x1456c9[_0x22b5('0x22')](_0x4a54c9);logger['debug'](_0x22b5('0x23'),JSON[_0x22b5('0x24')](_0x4a54c9,null,0x2));if(_0x4a54c9['agicommand']==='gotoc'){logger[_0x22b5('0x1c')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x541aca['context']=_0x4a54c9[_0x22b5('0x25')]||_0x541aca[_0x22b5('0x25')];_0x541aca[_0x22b5('0x26')]=_0x4a54c9[_0x22b5('0x26')];_0x541aca[_0x22b5('0x27')]=_0x4a54c9[_0x22b5('0x27')]?_0x4a54c9[_0x22b5('0x27')]-0x1:0x1;return null;}else if(_0x4a54c9&&_0x1456c9[_0x4a54c9['agicommand']]){_0x3f15c4=_0x1456c9[_0x4a54c9[_0x22b5('0x8')]](_0x4a54c9);logger['info'](_0x22b5('0x28'),JSON[_0x22b5('0x24')](_0x3f15c4,null,0x2));if(_0x3f15c4&&_0x3f15c4[_0x22b5('0x29')]===AGI_CODE_SUCCESS&&_0x3f15c4[_0x22b5('0x2a')]!==AGI_RESULT_ERROR&&!_0x541aca['evtHangup']){logger[_0x22b5('0x18')](_0x22b5('0x28'),inspect(_0x3f15c4));return _[_0x22b5('0x2b')](_0x3f15c4[_0x22b5('0x2a')])?null:_0x3f15c4['result'][_0x22b5('0x2c')]();}else{logger[_0x22b5('0x6')]('response',inspect(_0x3f15c4));return null;}}else{logger[_0x22b5('0x6')](_0x22b5('0x2d'));return null;}}catch(_0x9b3369){logger['error'](_0x9b3369['stack']);return null;}});if(_0xb1593[_0x22b5('0x2e')]){logger[_0x22b5('0x1c')](util[_0x22b5('0x1a')](_0x22b5('0x2f'),_0x541aca[_0x22b5('0x1e')],_0x541aca[_0x22b5('0x1f')],_0x541aca[_0x22b5('0x20')],_0x541aca['dnid'],_0x541aca[_0x22b5('0x30')]));_0x33264f['traverseBFS'](_0xb1593[_0x22b5('0x2e')]['id'],function(_0x503341){try{_0x503341=_0x1456c9[_0x22b5('0x22')](_0x503341);logger['debug'](_0x22b5('0x23'),JSON[_0x22b5('0x24')](_0x503341,null,0x2));if(_0x503341&&_0x1456c9[_0x503341['agicommand']]){_0x3f15c4=_0x1456c9[_0x503341['agicommand']](_0x503341);if(_0x3f15c4){logger[_0x22b5('0x18')]('response',inspect(_0x3f15c4));return _[_0x22b5('0x2b')](_0x3f15c4[_0x22b5('0x2a')])?null:_0x3f15c4[_0x22b5('0x2a')]['toString']();}else{logger[_0x22b5('0x6')](_0x22b5('0x28'),inspect(_0x3f15c4));return null;}}else{logger['error'](_0x22b5('0x2d'));return null;}}catch(_0x28d3c2){logger['error'](_0x28d3c2[_0x22b5('0x7')]);return null;}});}logger[_0x22b5('0x1c')](util[_0x22b5('0x1a')](_0x22b5('0x31'),_0x541aca[_0x22b5('0x1e')],_0x541aca[_0x22b5('0x1f')],_0x541aca[_0x22b5('0x20')],_0x541aca['dnid'],_0x541aca[_0x22b5('0x30')]));logger[_0x22b5('0x1c')](util[_0x22b5('0x1a')](_0x22b5('0x32'),_0x541aca[_0x22b5('0x25')],_0x541aca[_0x22b5('0x26')],parseInt(_0x541aca[_0x22b5('0x27')],0xa)+0x1));_0x541aca[_0x22b5('0x33')](_0x541aca[_0x22b5('0x25')],_0x541aca[_0x22b5('0x26')],parseInt(_0x541aca[_0x22b5('0x27')],0xa)+0x1);_0x541aca[_0x22b5('0x34')]();}function handleNotFound(_0x57b083){logger[_0x22b5('0x6')](util[_0x22b5('0x1a')](_0x22b5('0x35'),_0x57b083[_0x22b5('0x1e')]));_0x57b083['continueAt'](_0x57b083[_0x22b5('0x25')],_0x57b083['extension'],parseInt(_0x57b083[_0x22b5('0x27')],0xa)+0x1);_0x57b083['close']();}function handleUnpublished(_0x751df6){logger[_0x22b5('0x6')](util[_0x22b5('0x1a')](_0x22b5('0x36'),_0x751df6[_0x22b5('0x1e')]));_0x751df6['continueAt'](_0x751df6[_0x22b5('0x25')],_0x751df6['extension'],parseInt(_0x751df6[_0x22b5('0x27')],0xa)+0x1);_0x751df6['close']();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x2f5d=['toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','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','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','../../config/logger','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','omit','isArray','length','source','addEdge','target','value','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined'];(function(_0x2b1b6d,_0x517c89){var _0x422682=function(_0x215ce4){while(--_0x215ce4){_0x2b1b6d['push'](_0x2b1b6d['shift']());}};_0x422682(++_0x517c89);}(_0x2f5d,0x10c));var _0xd2f5=function(_0x15f0eb,_0x3f85bc){_0x15f0eb=_0x15f0eb-0x0;var _0x42adbc=_0x2f5d[_0x15f0eb];return _0x42adbc;};'use strict';var _=require(_0xd2f5('0x0'));var moment=require(_0xd2f5('0x1'));var parser=require(_0xd2f5('0x2'));var util=require('util');var logger=require(_0xd2f5('0x3'))('agi');var rpc=require(_0xd2f5('0x4'));var mailRpc=require(_0xd2f5('0x5'));var Graph=require('./graph');var Vertices=require(_0xd2f5('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xd2f5('0x7')]()[_0xd2f5('0x8')](function(_0x12935f){logger[_0xd2f5('0x9')](_0xd2f5('0xa'),_0x12935f[_0xd2f5('0xb')]);return[];});}function addVertex(_0xbe494b,_0x5cc40a,_0x3c7c55){_0x5cc40a[_0xd2f5('0xc')]=_0x3c7c55;if(_0x5cc40a[_0xd2f5('0xd')](_0xd2f5('0xe'))){_0x5cc40a[_0xd2f5('0xf')]=parseInt(_0x5cc40a['retry'],0xa);}_0xbe494b['addVertex'](_[_0xd2f5('0x10')](_0x5cc40a,'mxCell'));}function initGraph(_0x1f9ecf,_0x1bbcbe){var _0x17ab10=new Graph();for(var _0x8c805e in _0x1f9ecf){if(_0x1f9ecf['hasOwnProperty'](_0x8c805e)){if(_[_0xd2f5('0x11')](_0x1f9ecf[_0x8c805e])){for(var _0x1fc100=0x0;_0x1fc100<_0x1f9ecf[_0x8c805e]['length'];_0x1fc100+=0x1){addVertex(_0x17ab10,_0x1f9ecf[_0x8c805e][_0x1fc100],_0x8c805e);}}else{addVertex(_0x17ab10,_0x1f9ecf[_0x8c805e],_0x8c805e);}}}for(var _0x50451f=0x0;_0x50451f<_0x1bbcbe[_0xd2f5('0x12')];_0x50451f+=0x1){if(_0x1bbcbe[_0x50451f][_0xd2f5('0x13')]&&_0x1bbcbe[_0x50451f]['target']){_0x17ab10[_0xd2f5('0x14')](_0x1bbcbe[_0x50451f]['source'],_0x1bbcbe[_0x50451f][_0xd2f5('0x15')],_0x1bbcbe[_0x50451f][_0xd2f5('0x16')]);}}return _0x17ab10;}function getRoot(_0xef2309){return parser[_0xd2f5('0x17')](_0xef2309,{'object':!![]})[_0xd2f5('0x18')][_0xd2f5('0x19')];}function inspect(_0x1b7e79){return util[_0xd2f5('0x1a')](_0x1b7e79,{'showHidden':![],'depth':null});}function initialize(_0x16fd34,_0x1313a2){var _0x1e1466=getRoot(_0x16fd34[_0xd2f5('0x1b')]);if(!_0x1e1466||!_0x1e1466[_0xd2f5('0x1c')])return;var _0x479fde,_0x2888ea,_0x28cb65;logger[_0xd2f5('0x1d')](_0xd2f5('0x19'),JSON[_0xd2f5('0x1e')](_0x1e1466,null,0x2));_0x1313a2[_0xd2f5('0x1f')]=moment()['format'](_0xd2f5('0x20'));_0x479fde=initGraph(_[_0xd2f5('0x10')](_0x1e1466,_0xd2f5('0x21')),_0x1e1466[_0xd2f5('0x21')]);_0x2888ea=new Vertices(_0x1313a2,rpc,mailRpc);logger[_0xd2f5('0x22')](util[_0xd2f5('0x23')](_0xd2f5('0x24'),_0x1313a2['arg_1'],_0x1313a2['calleridname'],_0x1313a2[_0xd2f5('0x25')],_0x1313a2['dnid'],_0x1313a2[_0xd2f5('0x26')]));_0x479fde[_0xd2f5('0x27')](_0x1e1466[_0xd2f5('0x1c')]['id'],function(_0x492258){try{_0x492258=_0x2888ea[_0xd2f5('0x28')](_0x492258);logger[_0xd2f5('0x1d')](_0xd2f5('0x29'),JSON[_0xd2f5('0x1e')](_0x492258,null,0x2));if(_0x492258[_0xd2f5('0xc')]===_0xd2f5('0x2a')){logger[_0xd2f5('0x22')](_0xd2f5('0x2b'));_0x1313a2[_0xd2f5('0x2c')]=_0x492258['context']||_0x1313a2[_0xd2f5('0x2c')];_0x1313a2[_0xd2f5('0x2d')]=_0x492258[_0xd2f5('0x2d')];_0x1313a2[_0xd2f5('0x2e')]=_0x492258[_0xd2f5('0x2e')]?_0x492258[_0xd2f5('0x2e')]-0x1:0x1;return null;}else if(_0x492258&&_0x2888ea[_0x492258['agicommand']]){_0x28cb65=_0x2888ea[_0x492258[_0xd2f5('0xc')]](_0x492258);logger[_0xd2f5('0x22')](_0xd2f5('0x2f'),JSON[_0xd2f5('0x1e')](_0x28cb65,null,0x2));if(_0x28cb65&&_0x28cb65[_0xd2f5('0x30')]===AGI_CODE_SUCCESS&&_0x28cb65[_0xd2f5('0x31')]!==AGI_RESULT_ERROR&&!_0x1313a2[_0xd2f5('0x32')]){logger[_0xd2f5('0x1d')](_0xd2f5('0x2f'),inspect(_0x28cb65));return _[_0xd2f5('0x33')](_0x28cb65['result'])?null:_0x28cb65[_0xd2f5('0x31')][_0xd2f5('0x34')]();}else{logger[_0xd2f5('0x9')](_0xd2f5('0x2f'),inspect(_0x28cb65));return null;}}else{logger[_0xd2f5('0x9')](_0xd2f5('0x35'));return null;}}catch(_0xed9469){logger['error'](_0xed9469[_0xd2f5('0xb')]);return null;}});if(_0x1e1466['finally']){logger[_0xd2f5('0x22')](util[_0xd2f5('0x23')](_0xd2f5('0x36'),_0x1313a2[_0xd2f5('0x37')],_0x1313a2[_0xd2f5('0x38')],_0x1313a2[_0xd2f5('0x25')],_0x1313a2[_0xd2f5('0x39')],_0x1313a2['uniqueid']));_0x479fde[_0xd2f5('0x27')](_0x1e1466['finally']['id'],function(_0x24bbb6){try{_0x24bbb6=_0x2888ea['clear'](_0x24bbb6);logger['debug'](_0xd2f5('0x29'),JSON[_0xd2f5('0x1e')](_0x24bbb6,null,0x2));if(_0x24bbb6&&_0x2888ea[_0x24bbb6[_0xd2f5('0xc')]]){_0x28cb65=_0x2888ea[_0x24bbb6[_0xd2f5('0xc')]](_0x24bbb6);if(_0x28cb65){logger[_0xd2f5('0x1d')](_0xd2f5('0x2f'),inspect(_0x28cb65));return _[_0xd2f5('0x33')](_0x28cb65['result'])?null:_0x28cb65[_0xd2f5('0x31')][_0xd2f5('0x34')]();}else{logger[_0xd2f5('0x9')](_0xd2f5('0x2f'),inspect(_0x28cb65));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3b9a1c){logger[_0xd2f5('0x9')](_0x3b9a1c[_0xd2f5('0xb')]);return null;}});}logger[_0xd2f5('0x22')](util[_0xd2f5('0x23')](_0xd2f5('0x3a'),_0x1313a2['arg_1'],_0x1313a2[_0xd2f5('0x38')],_0x1313a2[_0xd2f5('0x25')],_0x1313a2[_0xd2f5('0x39')],_0x1313a2[_0xd2f5('0x26')]));logger[_0xd2f5('0x22')](util[_0xd2f5('0x23')](_0xd2f5('0x3b'),_0x1313a2[_0xd2f5('0x2c')],_0x1313a2['extension'],parseInt(_0x1313a2['priority'],0xa)+0x1));_0x1313a2['continueAt'](_0x1313a2[_0xd2f5('0x2c')],_0x1313a2[_0xd2f5('0x2d')],parseInt(_0x1313a2[_0xd2f5('0x2e')],0xa)+0x1);_0x1313a2['close']();}function handleNotFound(_0x421126){logger[_0xd2f5('0x9')](util[_0xd2f5('0x23')](_0xd2f5('0x3c'),_0x421126['arg_1']));_0x421126[_0xd2f5('0x3d')](_0x421126[_0xd2f5('0x2c')],_0x421126['extension'],parseInt(_0x421126[_0xd2f5('0x2e')],0xa)+0x1);_0x421126['close']();}function handleUnpublished(_0xf1fa){logger[_0xd2f5('0x9')](util[_0xd2f5('0x23')](_0xd2f5('0x3e'),_0xf1fa[_0xd2f5('0x37')]));_0xf1fa[_0xd2f5('0x3d')](_0xf1fa[_0xd2f5('0x2c')],_0xf1fa['extension'],parseInt(_0xf1fa[_0xd2f5('0x2e')],0xa)+0x1);_0xf1fa['close']();}module[_0xd2f5('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 ee43863..1ea490b 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 _0xe3db=['line','exports','util','stream','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','slice','trim','emit','headers'];(function(_0x3f807d,_0x32a3b1){var _0x45ad62=function(_0x32b5d9){while(--_0x32b5d9){_0x3f807d['push'](_0x3f807d['shift']());}};_0x45ad62(++_0x32a3b1);}(_0xe3db,0xc8));var _0xbe3d=function(_0x4a1f01,_0x45e5c4){_0x4a1f01=_0x4a1f01-0x0;var _0x135de8=_0xe3db[_0x4a1f01];return _0x135de8;};'use strict';var util=require(_0xbe3d('0x0'));var Transform=require(_0xbe3d('0x1'))['Transform'];function AGIReply(_0xef2899){Transform[_0xbe3d('0x2')](this,_0xef2899);this[_0xbe3d('0x3')]='';this[_0xbe3d('0x4')]=![];}util[_0xbe3d('0x5')](AGIReply,Transform);AGIReply[_0xbe3d('0x6')][_0xbe3d('0x7')]=function(_0x472825,_0x22d579,_0xd5a81){var _0x2b4c19='\x0a',_0x4c255b=['\x0a\x0a',_0xbe3d('0x8')],_0x314709=-0x1,_0x90d1ab=-0x1,_0x24136a='',_0x37e7c0=0x0,_0x55df34='',_0x105b9e='';this['_localBuffer']+=_0x472825['toString']();_0x55df34=this[_0xbe3d('0x3')];if(!this[_0xbe3d('0x4')]){_0x37e7c0=0x0;while(_0x4c255b[_0x37e7c0]){while((_0x90d1ab=_0x55df34[_0xbe3d('0x9')](_0x4c255b[_0x37e7c0]))!=-0x1){_0x24136a=_0x4c255b[_0x37e7c0];_0x105b9e=_0x55df34[_0xbe3d('0xa')](0x0,_0x90d1ab);_0x55df34=_0x55df34[_0xbe3d('0xa')](_0x90d1ab+_0x24136a[_0xbe3d('0xb')]);var _0xfb42af=_0x105b9e['split'](_0x2b4c19),_0x2a772f=0x0,_0x1ff83c={},_0x276e4c='',_0x4d25e7='',_0x2fad2d=-0x1;while(_0xfb42af[_0x2a772f]){_0x2fad2d=_0xfb42af[_0x2a772f][_0xbe3d('0x9')](':');if(_0x2fad2d!=-0x1){_0x276e4c=_0xfb42af[_0x2a772f][_0xbe3d('0xc')](0x0,_0x2fad2d)[_0xbe3d('0xd')]();_0x4d25e7=_0xfb42af[_0x2a772f][_0xbe3d('0xc')](_0x2fad2d+0x1)[_0xbe3d('0xd')]();if(_0x276e4c[_0xbe3d('0xb')]>0x0){_0x1ff83c[_0x276e4c]=_0x4d25e7;}}else{}_0x2a772f++;}this[_0xbe3d('0xe')](_0xbe3d('0xf'),_0x1ff83c);this[_0xbe3d('0x4')]=!![];}_0x37e7c0++;}this[_0xbe3d('0x3')]=_0x55df34;}else{while((_0x314709=_0x55df34[_0xbe3d('0x9')](_0x2b4c19))!=-0x1){_0x105b9e=_0x55df34[_0xbe3d('0xa')](0x0,_0x314709);this[_0xbe3d('0xe')](_0xbe3d('0x10'),_0x105b9e);_0x55df34=_0x55df34['substring'](_0x314709+_0x2b4c19[_0xbe3d('0xb')]);}this[_0xbe3d('0x3')]=_0x55df34;}_0xd5a81();};module[_0xbe3d('0x11')]=AGIReply; \ No newline at end of file +var _0x8a01=['_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','split','indexOf','slice','trim','length','emit','headers','line','exports','stream','Transform','call','_localBuffer'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0x8a01,0x13c));var _0x18a0=function(_0x151ed4,_0x23cfb8){_0x151ed4=_0x151ed4-0x0;var _0x1c6f7e=_0x8a01[_0x151ed4];return _0x1c6f7e;};'use strict';var util=require('util');var Transform=require(_0x18a0('0x0'))[_0x18a0('0x1')];function AGIReply(_0x3f9dd4){Transform[_0x18a0('0x2')](this,_0x3f9dd4);this[_0x18a0('0x3')]='';this[_0x18a0('0x4')]=![];}util[_0x18a0('0x5')](AGIReply,Transform);AGIReply[_0x18a0('0x6')][_0x18a0('0x7')]=function(_0x124108,_0x17ee6f,_0x49198e){var _0x343996='\x0a',_0x297f53=['\x0a\x0a',_0x18a0('0x8')],_0x11a8dc=-0x1,_0x494331=-0x1,_0x14c039='',_0x2c7596=0x0,_0x42dcf6='',_0x412989='';this[_0x18a0('0x3')]+=_0x124108[_0x18a0('0x9')]();_0x42dcf6=this['_localBuffer'];if(!this['_inBody']){_0x2c7596=0x0;while(_0x297f53[_0x2c7596]){while((_0x494331=_0x42dcf6['indexOf'](_0x297f53[_0x2c7596]))!=-0x1){_0x14c039=_0x297f53[_0x2c7596];_0x412989=_0x42dcf6[_0x18a0('0xa')](0x0,_0x494331);_0x42dcf6=_0x42dcf6['substring'](_0x494331+_0x14c039['length']);var _0x227a7c=_0x412989[_0x18a0('0xb')](_0x343996),_0x55befe=0x0,_0x1552cd={},_0x1ef43e='',_0x594576='',_0x4ec803=-0x1;while(_0x227a7c[_0x55befe]){_0x4ec803=_0x227a7c[_0x55befe][_0x18a0('0xc')](':');if(_0x4ec803!=-0x1){_0x1ef43e=_0x227a7c[_0x55befe][_0x18a0('0xd')](0x0,_0x4ec803)[_0x18a0('0xe')]();_0x594576=_0x227a7c[_0x55befe][_0x18a0('0xd')](_0x4ec803+0x1)[_0x18a0('0xe')]();if(_0x1ef43e[_0x18a0('0xf')]>0x0){_0x1552cd[_0x1ef43e]=_0x594576;}}else{}_0x55befe++;}this[_0x18a0('0x10')](_0x18a0('0x11'),_0x1552cd);this[_0x18a0('0x4')]=!![];}_0x2c7596++;}this[_0x18a0('0x3')]=_0x42dcf6;}else{while((_0x11a8dc=_0x42dcf6[_0x18a0('0xc')](_0x343996))!=-0x1){_0x412989=_0x42dcf6[_0x18a0('0xa')](0x0,_0x11a8dc);this['emit'](_0x18a0('0x12'),_0x412989);_0x42dcf6=_0x42dcf6[_0x18a0('0xa')](_0x11a8dc+_0x343996[_0x18a0('0xf')]);}this[_0x18a0('0x3')]=_0x42dcf6;}_0x49198e();};module[_0x18a0('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 92a6aa1..fe8d86a 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 _0x27c5=['jayson/promise','client','http','request','then','error','message','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','getUserById','GetContactByPhone','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','phone','getPauseById','ShowPause','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser'];(function(_0x1ccb11,_0x1358c6){var _0x18e0c3=function(_0x3354eb){while(--_0x3354eb){_0x1ccb11['push'](_0x1ccb11['shift']());}};_0x18e0c3(++_0x1358c6);}(_0x27c5,0x173));var _0x527c=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x27c5[_0x2555d0];return _0x3bb486;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0x527c('0x0'));var client=jayson[_0x527c('0x1')][_0x527c('0x2')]({'port':0x2329});function request(_0x5771e6,_0x1a35ed){return new Promise(function(_0x458db1,_0x371ae5){return client[_0x527c('0x3')](_0x5771e6,_0x1a35ed)[_0x527c('0x4')](function(_0x2bb668){if(_0x2bb668[_0x527c('0x5')]){return _0x371ae5(_0x2bb668['error'][_0x527c('0x6')]);}else{return _0x458db1(_0x2bb668['result']);}})[_0x527c('0x7')](function(_0x5e07ba){return _0x371ae5(_0x5e07ba);});});}exports[_0x527c('0x8')]=function(){return request(_0x527c('0x9'),{'options':{'raw':![],'attributes':['id',_0x527c('0xa'),'production']}});};exports[_0x527c('0xb')]=function(_0x99813d){return request(_0x527c('0xc'),{'options':{'raw':![],'where':{'name':_0x99813d},'attributes':[_0x527c('0xd')]}});};exports[_0x527c('0xe')]=function(_0x6c5ef7){return request(_0x527c('0xf'),{'options':{'raw':![],'where':{'id':_0x6c5ef7},'include':[{'model':_0x527c('0x10'),'as':_0x527c('0x11'),'include':[{'model':_0x527c('0x12'),'as':_0x527c('0x12')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0x527c('0x13')]=function(_0xd8e9e){return request(_0x527c('0xc'),{'options':{'where':{'id':_0xd8e9e},'attributes':[_0x527c('0xa')]}});};exports['getVoiceQueueById']=function(_0x416ed8){return request(_0x527c('0x14'),{'options':{'where':{'id':_0x416ed8},'attributes':['name']}});};exports['getVariableById']=function(_0x2fce03){return request('ShowVariable',{'options':{'where':{'id':_0x2fce03},'attributes':['name']}});};exports[_0x527c('0x15')]=function(_0x18f4b5){return request(_0x527c('0x16'),{'options':{'where':{'id':_0x18f4b5},'attributes':['dsn']}});};exports[_0x527c('0x17')]=function(_0x1f2702){return request('ShowUser',{'options':{'where':{'id':_0x1f2702},'attributes':[_0x527c('0xa')]}});};exports['getContactByPhone']=function(_0x117dae){return request(_0x527c('0x18'),{'options':{'where':{'phone':_0x117dae['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x3e1a1c){return request(_0x527c('0x19'),{'options':{'where':{'id':_0x3e1a1c},'attributes':[_0x527c('0xa')]}});};exports[_0x527c('0x1a')]=function(_0x494a89){return request(_0x527c('0x1b'),{'options':{'where':{'id':_0x494a89},'attributes':['save_name']}});};exports[_0x527c('0x1c')]=function(_0x56a42d){return request(_0x527c('0x1d'),{'options':{'raw':![],'where':{'id':_0x56a42d},'include':[{'model':'Interval','as':_0x527c('0x1e')}]}});};exports[_0x527c('0x1f')]=function(_0x37e0be){return request('ShowSmsAccount',{'options':{'where':{'id':_0x37e0be},'attributes':['id',_0x527c('0xa')]}});};exports['createSmsMessage']=function(_0x176e11){return request(_0x527c('0x20'),{'body':_0x176e11});};exports[_0x527c('0x21')]=function(_0x8c6a38){return request(_0x527c('0x22'),{'body':_0x8c6a38});};exports[_0x527c('0x23')]=function(_0x296350){return request(_0x527c('0x24'),{'body':_['merge'](_0x296350,{'project_name':_0x296350[_0x527c('0x25')],'prev_project_name':_0x296350[_0x527c('0x26')]||'','is_subproject':_0x296350['arg_2']?!![]:![],'leaveAt':moment()[_0x527c('0x27')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x527c('0x28')]=function(_0x2a512d){return request(_0x527c('0x29'),{'body':_0x2a512d});};exports['createSquareMessage']=function(_0x4e1894){return request(_0x527c('0x2a'),{'body':_0x4e1894});};exports['createCmContact']=function(_0x296689){return request(_0x527c('0x2b'),{'options':{'raw':![],'where':{'phone':_0x296689[_0x527c('0x2c')],'ListId':_0x296689['ListId']}}})[_0x527c('0x4')](function(_0x1bafe9){if(_0x1bafe9){return _0x1bafe9;}return request('CreateCmContact',{'body':_0x296689});});};exports[_0x527c('0x2d')]=function(_0x5f1b3d){return request(_0x527c('0x2e'),{'options':{'where':{'id':_0x5f1b3d},'attributes':[_0x527c('0xa')]}});};exports['agentLogin']=function(_0x48d56c,_0x1f40c2){return request(_0x527c('0x2f'),{'body':{'interface':_0x1f40c2},'options':{'where':_0x48d56c}});};exports[_0x527c('0x30')]=function(_0xdec2f8,_0x54e062,_0x4459cb){return request('PauseUser',{'body':{'type':_0x54e062,'uniqueid':_0x4459cb},'options':{'where':_0xdec2f8}});};exports[_0x527c('0x31')]=function(_0x44e928){return request(_0x527c('0x32'),{'body':{},'options':{'where':_0x44e928}});};exports[_0x527c('0x33')]=function(_0xa809d4){return request(_0x527c('0x34'),{'body':{},'options':{'where':_0xa809d4}});}; \ No newline at end of file +var _0xac95=['client','request','then','error','message','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','MailServerOut','CloudProvider','email','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','createSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','agentLogout','lodash','moment','jayson/promise'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0xac95,0xa8));var _0x5ac9=function(_0x99fabc,_0x44ab39){_0x99fabc=_0x99fabc-0x0;var _0x6b4d5f=_0xac95[_0x99fabc];return _0x6b4d5f;};'use strict';var _=require(_0x5ac9('0x0'));var moment=require(_0x5ac9('0x1'));var jayson=require(_0x5ac9('0x2'));var client=jayson[_0x5ac9('0x3')]['http']({'port':0x2329});function request(_0x57ca1c,_0x4562f2){return new Promise(function(_0x1ebdea,_0x550511){return client[_0x5ac9('0x4')](_0x57ca1c,_0x4562f2)[_0x5ac9('0x5')](function(_0x5b445a){if(_0x5b445a[_0x5ac9('0x6')]){return _0x550511(_0x5b445a[_0x5ac9('0x6')][_0x5ac9('0x7')]);}else{return _0x1ebdea(_0x5b445a['result']);}})['catch'](function(_0x32afbc){return _0x550511(_0x32afbc);});});}exports[_0x5ac9('0x8')]=function(){return request(_0x5ac9('0x9'),{'options':{'raw':![],'attributes':['id',_0x5ac9('0xa'),_0x5ac9('0xb')]}});};exports[_0x5ac9('0xc')]=function(_0x5ad3b7){return request(_0x5ac9('0xd'),{'options':{'raw':![],'where':{'name':_0x5ad3b7},'attributes':[_0x5ac9('0xb')]}});};exports['getMailAccountById']=function(_0x28b5b9){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x28b5b9},'include':[{'model':_0x5ac9('0xe'),'as':'Smtp','include':[{'model':_0x5ac9('0xf'),'as':_0x5ac9('0xf')}]}],'attributes':['id',_0x5ac9('0xa'),_0x5ac9('0x10')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x517409){return request(_0x5ac9('0xd'),{'options':{'where':{'id':_0x517409},'attributes':['name']}});};exports[_0x5ac9('0x11')]=function(_0x364007){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x364007},'attributes':[_0x5ac9('0xa')]}});};exports[_0x5ac9('0x12')]=function(_0x3f8fac){return request(_0x5ac9('0x13'),{'options':{'where':{'id':_0x3f8fac},'attributes':[_0x5ac9('0xa')]}});};exports[_0x5ac9('0x14')]=function(_0x44a5b1){return request(_0x5ac9('0x15'),{'options':{'where':{'id':_0x44a5b1},'attributes':[_0x5ac9('0x16')]}});};exports['getUserById']=function(_0x53a8db){return request(_0x5ac9('0x17'),{'options':{'where':{'id':_0x53a8db},'attributes':[_0x5ac9('0xa')]}});};exports[_0x5ac9('0x18')]=function(_0x4463ff){return request(_0x5ac9('0x19'),{'options':{'where':{'phone':_0x4463ff[_0x5ac9('0x1a')]},'attributes':['id']}});};exports[_0x5ac9('0x1b')]=function(_0x429bf3){return request(_0x5ac9('0x1c'),{'options':{'where':{'id':_0x429bf3},'attributes':[_0x5ac9('0xa')]}});};exports[_0x5ac9('0x1d')]=function(_0x2b144e){return request(_0x5ac9('0x1e'),{'options':{'where':{'id':_0x2b144e},'attributes':['save_name']}});};exports[_0x5ac9('0x1f')]=function(_0x1f5546){return request(_0x5ac9('0x20'),{'options':{'raw':![],'where':{'id':_0x1f5546},'include':[{'model':_0x5ac9('0x21'),'as':_0x5ac9('0x22')}]}});};exports['getSmsAccountById']=function(_0x45417d){return request(_0x5ac9('0x23'),{'options':{'where':{'id':_0x45417d},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x5a4664){return request(_0x5ac9('0x24'),{'body':_0x5a4664});};exports[_0x5ac9('0x25')]=function(_0x4e3b64){return request('CreateSquareDetailsReport',{'body':_0x4e3b64});};exports[_0x5ac9('0x26')]=function(_0x59c3fd){return request('CreateSquareReport',{'body':_[_0x5ac9('0x27')](_0x59c3fd,{'project_name':_0x59c3fd['arg_1'],'prev_project_name':_0x59c3fd[_0x5ac9('0x28')]||'','is_subproject':_0x59c3fd[_0x5ac9('0x28')]?!![]:![],'leaveAt':moment()[_0x5ac9('0x29')](_0x5ac9('0x2a'))})});};exports[_0x5ac9('0x2b')]=function(_0x174cfe){return request(_0x5ac9('0x2c'),{'body':_0x174cfe});};exports[_0x5ac9('0x2d')]=function(_0x203d19){return request('CreateSquareMessage',{'body':_0x203d19});};exports[_0x5ac9('0x2e')]=function(_0x14a7fe){return request(_0x5ac9('0x2f'),{'options':{'raw':![],'where':{'phone':_0x14a7fe[_0x5ac9('0x1a')],'ListId':_0x14a7fe[_0x5ac9('0x30')]}}})['then'](function(_0x47f6ad){if(_0x47f6ad){return _0x47f6ad;}return request(_0x5ac9('0x31'),{'body':_0x14a7fe});});};exports[_0x5ac9('0x32')]=function(_0x4a784e){return request(_0x5ac9('0x33'),{'options':{'where':{'id':_0x4a784e},'attributes':['name']}});};exports[_0x5ac9('0x34')]=function(_0x2c85dc,_0x1d0d5a){return request('LoginUser',{'body':{'interface':_0x1d0d5a},'options':{'where':_0x2c85dc}});};exports[_0x5ac9('0x35')]=function(_0x128866,_0x446050,_0x30fb2b){return request(_0x5ac9('0x36'),{'body':{'type':_0x446050,'uniqueid':_0x30fb2b},'options':{'where':_0x128866}});};exports[_0x5ac9('0x37')]=function(_0x4e7aee){return request('UnpauseUser',{'body':{},'options':{'where':_0x4e7aee}});};exports[_0x5ac9('0x38')]=function(_0x53ef31){return request('LogoutUser',{'body':{},'options':{'where':_0x53ef31}});}; \ 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 28cfe96..957ce98 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 polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd5da=['./lex','./polly'];(function(_0x5c2d8a,_0x5b9a66){var _0x5e6810=function(_0x20afb6){while(--_0x20afb6){_0x5c2d8a['push'](_0x5c2d8a['shift']());}};_0x5e6810(++_0x5b9a66);}(_0xd5da,0x9f));var _0xad5d=function(_0x1cfd3b,_0xf63d70){_0x1cfd3b=_0x1cfd3b-0x0;var _0x274311=_0xd5da[_0x1cfd3b];return _0x274311;};var polly=require(_0xad5d('0x0'));var lex=require(_0xad5d('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index fca7929..69834e6 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 _0x6324=['./lib/api','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x6324,0x142));var _0x4632=function(_0x1ef726,_0x16fdea){_0x1ef726=_0x1ef726-0x0;var _0x4c3c66=_0x6324[_0x1ef726];return _0x4c3c66;};'use strict';var lex=require(_0x4632('0x0'));module[_0x4632('0x1')]=function(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40){return lex(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40);}; \ No newline at end of file +var _0xe706=['exports','./lib/api'];(function(_0x1cc4c1,_0x41ec38){var _0x4e840d=function(_0x4bb5da){while(--_0x4bb5da){_0x1cc4c1['push'](_0x1cc4c1['shift']());}};_0x4e840d(++_0x41ec38);}(_0xe706,0xa3));var _0x6e70=function(_0x2ac8f0,_0x21d3df){_0x2ac8f0=_0x2ac8f0-0x0;var _0x4e9e93=_0xe706[_0x2ac8f0];return _0x4e9e93;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ 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 80eef0a..08756c5 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(_0x52c261,_0x1ae128){var _0x2df810=function(_0x217f49){while(--_0x217f49){_0x52c261['push'](_0x52c261['shift']());}};_0x2df810(++_0x1ae128);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x34f381,_0x3cf900){var _0x10279b=function(_0x4f55fa){while(--_0x4f55fa){_0x34f381['push'](_0x34f381['shift']());}};_0x10279b(++_0x3cf900);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 de40e61..db606e1 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 _0x98a4=['./lib/api','exports'];(function(_0x5e1605,_0x7fbd70){var _0x175005=function(_0xd292c4){while(--_0xd292c4){_0x5e1605['push'](_0x5e1605['shift']());}};_0x175005(++_0x7fbd70);}(_0x98a4,0x16a));var _0x498a=function(_0x38e702,_0x2932c5){_0x38e702=_0x38e702-0x0;var _0x37da97=_0x98a4[_0x38e702];return _0x37da97;};'use strict';var polly=require(_0x498a('0x0'));module[_0x498a('0x1')]=function(_0x5806f4,_0x244a43,_0x3283f8,_0x12b8df,_0x3aecc0,_0x4087fa,_0x1fb263){return polly(_0x5806f4,_0x244a43,_0x3283f8,_0x12b8df,_0x3aecc0,_0x4087fa,_0x1fb263);}; \ No newline at end of file +var _0x17e8=['exports','./lib/api'];(function(_0x378472,_0x4d8511){var _0x503cdf=function(_0x5aa734){while(--_0x5aa734){_0x378472['push'](_0x378472['shift']());}};_0x503cdf(++_0x4d8511);}(_0x17e8,0x139));var _0x817e=function(_0x3fb689,_0x33597d){_0x3fb689=_0x3fb689-0x0;var _0x394698=_0x17e8[_0x3fb689];return _0x394698;};'use strict';var polly=require(_0x817e('0x0'));module[_0x817e('0x1')]=function(_0x1a5d24,_0x4cc426,_0x238427,_0x3e1f28,_0x8b5e34,_0x1f05f3,_0x3ab6be){return polly(_0x1a5d24,_0x4cc426,_0x238427,_0x3e1f28,_0x8b5e34,_0x1f05f3,_0x3ab6be);}; \ 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 8671ece..dab21ca 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 _0xf6e8=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf6e8,0xea));var _0x8f6e=function(_0x437def,_0x3e6c72){_0x437def=_0x437def-0x0;var _0x2bf8ee=_0xf6e8[_0x437def];return _0x2bf8ee;};'use strict';var fs=require('fs');var path=require(_0x8f6e('0x0'));var BPromise=require(_0x8f6e('0x1'));var rs=require(_0x8f6e('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x5eefc6,_0x4c64e0,_0x29885f){return new BPromise(function(_0x3e1149,_0x32ab37){_0x5eefc6[_0x8f6e('0x3')](_0x4c64e0,function(_0x1437f1,_0x20f833){if(_0x1437f1){_0x32ab37(_0x1437f1);}else if(_0x20f833){if(_0x20f833[_0x8f6e('0x4')]instanceof Buffer){fs[_0x8f6e('0x5')](_0x29885f,_0x20f833[_0x8f6e('0x4')],function(_0x2a6431){if(_0x2a6431){_0x32ab37(_0x2a6431);}else{_0x3e1149();}});}else{_0x32ab37(new Error(_0x8f6e('0x6')));}}else{_0x32ab37(new Error(_0x8f6e('0x7')));}});});}module[_0x8f6e('0x8')]=function(_0x51db79,_0x231053,_0x3fc6e2,_0xc1cd05,_0x3b7707,_0x4ac17b,_0xebe84b){var _0x52e65b=new AWS[(_0x8f6e('0x9'))]({'accessKeyId':_0x51db79,'secretAccessKey':_0x231053,'region':_0x3fc6e2});var _0x539d8b={'Text':_0x3b7707,'TextType':_0x4ac17b||_0x8f6e('0xa'),'OutputFormat':_0x8f6e('0xb'),'VoiceId':_0xc1cd05};return pollyResult(_0x52e65b,_0x539d8b,_0xebe84b);}; \ No newline at end of file +var _0xe85c=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','bluebird','randomstring','synthesizeSpeech','writeFile','AudioStream'];(function(_0x5639a9,_0x35960b){var _0x624d20=function(_0x59f6ce){while(--_0x59f6ce){_0x5639a9['push'](_0x5639a9['shift']());}};_0x624d20(++_0x35960b);}(_0xe85c,0x1bc));var _0xce85=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe85c[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0xce85('0x0'));var BPromise=require(_0xce85('0x1'));var rs=require(_0xce85('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x21af5f,_0x9e8b33,_0x5118ad){return new BPromise(function(_0x2acc58,_0x589ba1){_0x21af5f[_0xce85('0x3')](_0x9e8b33,function(_0x42d8bb,_0x3c4ea4){if(_0x42d8bb){_0x589ba1(_0x42d8bb);}else if(_0x3c4ea4){if(_0x3c4ea4['AudioStream']instanceof Buffer){fs[_0xce85('0x4')](_0x5118ad,_0x3c4ea4[_0xce85('0x5')],function(_0x1626d0){if(_0x1626d0){_0x589ba1(_0x1626d0);}else{_0x2acc58();}});}else{_0x589ba1(new Error(_0xce85('0x6')));}}else{_0x589ba1(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xce85('0x7')]=function(_0x14365d,_0x393298,_0x1f9b5b,_0x303b1a,_0x29abcf,_0xfa0368,_0x1c569a){var _0x5f303c=new AWS[(_0xce85('0x8'))]({'accessKeyId':_0x14365d,'secretAccessKey':_0x393298,'region':_0x1f9b5b});var _0x199c22={'Text':_0x29abcf,'TextType':_0xfa0368||'text','OutputFormat':_0xce85('0x9'),'VoiceId':_0x303b1a};return pollyResult(_0x5f303c,_0x199c22,_0x1c569a);}; \ 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 01c7741..a9eb696 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 _0x108c=['./lib/api','exports'];(function(_0x13033f,_0x2045af){var _0x2ed576=function(_0x491a78){while(--_0x491a78){_0x13033f['push'](_0x13033f['shift']());}};_0x2ed576(++_0x2045af);}(_0x108c,0x8c));var _0xc108=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x108c[_0x20a584];return _0x4b41a8;};'use strict';var asr=require(_0xc108('0x0'));module[_0xc108('0x1')]=function(_0x3d918c,_0x557f09,_0x5e7d20,_0x171cab){return asr(_0x3d918c,_0x557f09,_0x5e7d20);}; \ No newline at end of file +var _0xc365=['exports','./lib/api'];(function(_0x29b2a2,_0x4b7224){var _0x836e8c=function(_0xbea41e){while(--_0xbea41e){_0x29b2a2['push'](_0x29b2a2['shift']());}};_0x836e8c(++_0x4b7224);}(_0xc365,0x19d));var _0x5c36=function(_0x455eb6,_0x3d3dfb){_0x455eb6=_0x455eb6-0x0;var _0x15fa87=_0xc365[_0x455eb6];return _0x15fa87;};'use strict';var asr=require(_0x5c36('0x0'));module[_0x5c36('0x1')]=function(_0x50354a,_0x2e03ca,_0x24671a,_0x425835){return asr(_0x50354a,_0x2e03ca,_0x24671a);}; \ 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 b6a0563..6f35cb7 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 _0xde2c=['LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0xca24f2,_0x1458b5){var _0x31292f=function(_0x3118fd){while(--_0x3118fd){_0xca24f2['push'](_0xca24f2['shift']());}};_0x31292f(++_0x1458b5);}(_0xde2c,0x7f));var _0xcde2=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0xde2c[_0x511b76];return _0x5424ff;};'use strict';var url=require(_0xcde2('0x0'));var BPromise=require(_0xcde2('0x1'));var fs=require('fs');var host=_0xcde2('0x2');module[_0xcde2('0x3')]=function(_0x7595ed,_0x40fa0a,_0x33bb0c){return new BPromise(function(_0x3a309f,_0x55c175){var _0x4353c8;if(typeof _0x7595ed!==_0xcde2('0x4')||_0x7595ed[_0xcde2('0x5')]===0x0){return _0x55c175(_0xcde2('0x6'));}if(typeof _0x40fa0a!==_0xcde2('0x4')||_0x40fa0a['length']===0x0){return _0x55c175(_0xcde2('0x7'));}if(typeof _0x33bb0c!==_0xcde2('0x8')&&(typeof _0x33bb0c!==_0xcde2('0x4')||_0x33bb0c['length']===0x0)){return _0x55c175('lang\x20should\x20be\x20a\x20string');}try{_0x4353c8=fs[_0xcde2('0x9')](_0x7595ed)[_0xcde2('0xa')]('base64');}catch(_0x181a73){return _0x55c175(_0x181a73);}return _0x3a309f({'method':_0xcde2('0xb'),'uri':host+_0xcde2('0xc')+_0x40fa0a,'body':{'config':{'encoding':_0xcde2('0xd'),'sampleRateHertz':'8000','languageCode':_0x33bb0c},'audio':{'content':_0x4353c8}},'json':!![]});});}; \ No newline at end of file +var _0x49e9=['readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var url=require(_0x949e('0x0'));var BPromise=require(_0x949e('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x949e('0x2')]=function(_0x1db1b8,_0x259795,_0x5c303a){return new BPromise(function(_0x4f1295,_0x114f65){var _0x4c284b;if(typeof _0x1db1b8!==_0x949e('0x3')||_0x1db1b8[_0x949e('0x4')]===0x0){return _0x114f65(_0x949e('0x5'));}if(typeof _0x259795!=='string'||_0x259795[_0x949e('0x4')]===0x0){return _0x114f65(_0x949e('0x6'));}if(typeof _0x5c303a!==_0x949e('0x7')&&(typeof _0x5c303a!==_0x949e('0x3')||_0x5c303a[_0x949e('0x4')]===0x0)){return _0x114f65(_0x949e('0x8'));}try{_0x4c284b=fs[_0x949e('0x9')](_0x1db1b8)['toString'](_0x949e('0xa'));}catch(_0x50ca96){return _0x114f65(_0x50ca96);}return _0x4f1295({'method':_0x949e('0xb'),'uri':host+_0x949e('0xc')+_0x259795,'body':{'config':{'encoding':_0x949e('0xd'),'sampleRateHertz':'8000','languageCode':_0x5c303a},'audio':{'content':_0x4c284b}},'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 bd2f7f3..66489fc 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 _0x78de=['./asr','exports'];(function(_0x2eade5,_0x5593b8){var _0x1e9966=function(_0x4c6612){while(--_0x4c6612){_0x2eade5['push'](_0x2eade5['shift']());}};_0x1e9966(++_0x5593b8);}(_0x78de,0x1ba));var _0xe78d=function(_0xb5e37f,_0xc624f1){_0xb5e37f=_0xb5e37f-0x0;var _0x23f431=_0x78de[_0xb5e37f];return _0x23f431;};var asr=require(_0xe78d('0x0'));module[_0xe78d('0x1')]={'asr':asr}; \ No newline at end of file +var _0x8812=['./asr'];(function(_0x296cbc,_0x27b779){var _0x21737e=function(_0x1c1a46){while(--_0x1c1a46){_0x296cbc['push'](_0x296cbc['shift']());}};_0x21737e(++_0x27b779);}(_0x8812,0x90));var _0x2881=function(_0x118463,_0x302ea5){_0x118463=_0x118463-0x0;var _0x4e3d2d=_0x8812[_0x118463];return _0x4e3d2d;};var asr=require(_0x2881('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 0c2dc61..225c540 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 _0x01b6=['bluebird','dialogflow','http','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','pipe','end','https:','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','writeFile','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','generic','data','length','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','map','alternatives','transcript','join','results','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','dirName','apiai-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01b6,0x89));var _0x601b=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x01b6[_0x220afa];return _0x1b79d1;};'use strict';var apiai=require(_0x601b('0x0'));var BPromise=require(_0x601b('0x1'));var dialogflow=require(_0x601b('0x2'));var fs=require('fs');var http=require(_0x601b('0x3'));var https=require('https');var md5=require('md5');var path=require(_0x601b('0x4'));var querystring=require('querystring');var rp=require(_0x601b('0x5'));var rs=require(_0x601b('0x6'));var sox=require(_0x601b('0x7'));var tts=require(_0x601b('0x8'));var urlParse=require(_0x601b('0x9'))[_0x601b('0xa')];var util=require(_0x601b('0xb'));var aws=require(_0x601b('0xc'));var google=require('./google');var sestek=require(_0x601b('0xd'));var tilde=require(_0x601b('0xe'));var logger=require(_0x601b('0xf'))(_0x601b('0x10'));var ISPEECH_API=_0x601b('0x11');function downloadFile(_0x549dcb,_0x478f6f){return new BPromise(function(_0x3fd7e4,_0x1a00c2){var _0x5bea9d=urlParse(_0x549dcb);var _0x2039a0=_0x5bea9d[_0x601b('0x12')]==='https:'?https:http;var _0x4a3832={'host':_0x5bea9d[_0x601b('0x13')],'path':_0x5bea9d[_0x601b('0x4')],'headers':{'user-agent':_0x601b('0x14')}};_0x2039a0['get'](_0x4a3832,function(_0x4d3a59){if(_0x4d3a59[_0x601b('0x15')]!==0xc8){logger[_0x601b('0x16')](_0x601b('0x17')+_0x549dcb+_0x601b('0x18')+_0x4d3a59[_0x601b('0x15')]+'\x20('+_0x4d3a59[_0x601b('0x19')]+')');_0x1a00c2(new Error(_0x601b('0x17')+_0x549dcb+_0x601b('0x18')+_0x4d3a59[_0x601b('0x15')]+'\x20('+_0x4d3a59[_0x601b('0x19')]+')'));return;}var _0x15c638=fs[_0x601b('0x1a')](_0x478f6f);_0x15c638['on']('finish',function(){logger[_0x601b('0x1b')](_0x601b('0x1c'));_0x15c638[_0x601b('0x1d')](_0x3fd7e4);});_0x15c638['on']('error',function(_0x282a7d){fs[_0x601b('0x1e')](_0x478f6f);logger[_0x601b('0x16')]('download\x20error',_0x282a7d);_0x1a00c2(_0x282a7d);});_0x4d3a59[_0x601b('0x1f')](_0x15c638);})['on'](_0x601b('0x16'),function(_0x614174){logger[_0x601b('0x16')](_0x614174);_0x1a00c2(_0x614174);})[_0x601b('0x20')]();});}function uploadFile(_0x288f30){return new BPromise(function(_0x20d3f4,_0xbd7b74){var _0xb5f816=urlParse(_0x288f30);var _0x220ec9=_0xb5f816[_0x601b('0x12')]===_0x601b('0x21')?https:http;var _0x142733={'host':_0xb5f816['host'],'path':_0xb5f816[_0x601b('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x220ec9['get'](_0x142733,function(_0x393920){if(_0x393920[_0x601b('0x15')]!==0xc8){_0xbd7b74(new Error(_0x601b('0x17')+_0x288f30+_0x601b('0x18')+_0x393920[_0x601b('0x15')]+'\x20('+_0x393920[_0x601b('0x19')]+')'));return;}var _0x1f6b8e='';_0x393920['on']('data',function(_0xb74714){_0x1f6b8e+=_0xb74714;});_0x393920['on'](_0x601b('0x20'),function(){_0x20d3f4(_0x1f6b8e);});})['on'](_0x601b('0x16'),function(_0x1f3760){_0xbd7b74(_0x1f3760);})[_0x601b('0x20')]();});}function convertFile(_0x2e541f,_0x3ca81c){return new BPromise(function(_0x1445ac,_0x5c722f){var _0x4c70c3=sox[_0x601b('0x22')](_0x2e541f,_0x3ca81c,{'sampleRate':0x1f40,'format':_0x601b('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4c70c3['on'](_0x601b('0x16'),function(_0x510ec0){logger['error'](_0x601b('0x24'),_0x510ec0);_0x5c722f(_0x510ec0);});_0x4c70c3['on']('end',function(){logger['info'](_0x601b('0x25'));_0x1445ac();});_0x4c70c3[_0x601b('0x26')]();});}function base64Decode(_0x11e719,_0x4a39bc){var _0x128b40=path[_0x601b('0x27')](__dirname,_0x601b('0x28'),rs[_0x601b('0x29')](0x4)+_0x601b('0x2a'));fs[_0x601b('0x2b')](_0x128b40,_0x11e719,_0x601b('0x2c'));return convertFile(_0x128b40,_0x4a39bc)[_0x601b('0x2d')](function(){try{fs[_0x601b('0x1e')](_0x128b40);fs[_0x601b('0x2e')](_0x4a39bc,_0x601b('0x2f'));}catch(_0x413a9d){logger['error'](_0x413a9d);}return _0x4a39bc[_0x601b('0x30')]('.')[0x0];});}function base64Encode(_0x3bb3c1){var _0x15419a=fs[_0x601b('0x31')](_0x3bb3c1);return new Buffer(_0x15419a)[_0x601b('0x32')]('base64');}exports[_0x601b('0x33')]=function(_0x157347,_0x469dd9,_0x3c4b2f,_0x4095e7,_0x22e841,_0x5c1a58){var _0x3868e1,_0xbfa8fd;var _0x20543b=_0x601b('0x34');var _0x109e52='?key='+_0x157347;var _0xff08f1={};if(_0x469dd9==='ssml'){_0xff08f1['input']={'ssml':_0x3c4b2f};}else{_0xff08f1[_0x601b('0x35')]={'text':_0x3c4b2f};};_0xff08f1[_0x601b('0x36')]={'languageCode':_0x4095e7,'ssmlGender':_0x22e841};_0xff08f1[_0x601b('0x37')]={'audioEncoding':_0x601b('0x38'),'sampleRateHertz':0x1f40};var _0x1edf67={'url':_0x20543b+_0x601b('0x39')+_0x109e52,'method':_0x601b('0x3a'),'json':!![],'body':_0xff08f1};return rp(_0x1edf67)[_0x601b('0x2d')](function(_0x1195f8){return new BPromise(function(_0x2e8948,_0x40f84d){_0x3868e1=path[_0x601b('0x27')](__dirname,_0x601b('0x28'),rs['generate'](0x4)+_0x601b('0x3b'));var _0x50acb3=Buffer['from'](_0x1195f8[_0x601b('0x3c')],_0x601b('0x2c'));return fs[_0x601b('0x3d')](_0x3868e1,_0x50acb3,function(_0x10d0ac){_0x40f84d(_0x10d0ac);},function(_0x4b08bc){fs[_0x601b('0x2e')](_0x3868e1,_0x601b('0x2f'));_0x2e8948(_0x4b08bc);});});})[_0x601b('0x2d')](function(_0x4fbeff){_0xbfa8fd=path[_0x601b('0x27')](__dirname,_0x601b('0x28'),rs[_0x601b('0x29')](0x4)+'.wav');return convertFile(_0x3868e1,_0xbfa8fd);})['then'](function(){try{fs[_0x601b('0x1e')](_0x3868e1);fs[_0x601b('0x2e')](_0xbfa8fd,_0x601b('0x2f'));}catch(_0x17504d){logger[_0x601b('0x16')](_0x17504d);}logger[_0x601b('0x1b')]('googleCloudTTS\x20path',_0xbfa8fd['split']('.')[0x0]);return _0xbfa8fd[_0x601b('0x30')]('.')[0x0];});};exports[_0x601b('0x3e')]=function(_0x341ce1,_0x277b3d){var _0x210c0a=_0x601b('0x3f');var _0x16ca67,_0x5f5cc7;var _0x56f369;var _0x23f1cf={'encoding':_0x601b('0x40'),'method':_0x601b('0x3a'),'timeout':0x2710,'url':_0x210c0a,'headers':{'Content-Type':_0x601b('0x41')},'body':_0x601b('0x42')+encodeURIComponent(JSON['stringify']([[[_0x601b('0x43'),JSON[_0x601b('0x44')]([_0x341ce1,_0x277b3d||'en',![],'null']),null,_0x601b('0x45')]]]))};return rp(_0x23f1cf)[_0x601b('0x2d')](function(_0x2b647f){try{_0x56f369=eval(_0x2b647f['slice'](0x5))[0x0][0x2];}catch(_0x401d08){throw new Error('parse\x20response\x20failed:\x0a'+_0x2b647f[_0x601b('0x46')]);}if(!_0x56f369){if(_0x341ce1[_0x601b('0x47')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x277b3d+_0x601b('0x48'));}}try{_0x56f369=eval(_0x56f369)[0x0];}catch(_0x32109e){throw new Error(_0x601b('0x49')+res[_0x601b('0x46')]);}const _0x569fa0=_0x56f369;_0x16ca67=path[_0x601b('0x27')](__dirname,'tmp',rs[_0x601b('0x29')](0x4)+_0x601b('0x3b'));fs[_0x601b('0x2b')](_0x16ca67,_0x56f369,{'encoding':'base64'});_0x5f5cc7=path[_0x601b('0x27')](__dirname,_0x601b('0x28'),rs[_0x601b('0x29')](0x4)+_0x601b('0x2a'));return convertFile(_0x16ca67,_0x5f5cc7);})[_0x601b('0x2d')](function(){try{fs[_0x601b('0x1e')](_0x16ca67);fs[_0x601b('0x2e')](_0x5f5cc7,_0x601b('0x2f'));}catch(_0x1b496e){logger['error'](_0x1b496e);}logger['info'](_0x601b('0x4a'),_0x5f5cc7[_0x601b('0x30')]('.')[0x0]);return _0x5f5cc7[_0x601b('0x30')]('.')[0x0];});};exports[_0x601b('0x4b')]=function(_0x199766,_0x227826,_0x58158f){return google[_0x601b('0x4c')](_0x199766,_0x227826,_0x58158f)['then'](function(_0x2c2aed){logger['info'](_0x2c2aed['uri']);return rp(_0x2c2aed);})['then'](function(_0x4ef927){var _0x52259b='';var _0x4b2ee6=0x0;try{fs[_0x601b('0x1e')](_0x199766);}catch(_0xa4118e){logger[_0x601b('0x16')](_0xa4118e);}if(_0x4ef927&&_0x4ef927['results']){_0x52259b=_0x4ef927['results'][_0x601b('0x4d')](function(_0x5451d5){return _0x5451d5&&_0x5451d5[_0x601b('0x4e')][0x0]&&_0x5451d5['alternatives'][0x0][_0x601b('0x4f')]?_0x5451d5[_0x601b('0x4e')][0x0]['transcript']:'';})[_0x601b('0x50')]('\x0a');_0x4b2ee6=_0x4ef927[_0x601b('0x51')][_0x601b('0x4d')](function(_0x5c5ba2){return _0x5c5ba2&&_0x5c5ba2[_0x601b('0x4e')][0x0]&&_0x5c5ba2['alternatives'][0x0][_0x601b('0x52')]?_0x5c5ba2[_0x601b('0x4e')][0x0][_0x601b('0x52')]:0x0;})[_0x601b('0x50')]('\x0a');}logger['info'](_0x601b('0x53'),_0x52259b);logger[_0x601b('0x1b')](_0x601b('0x54'),_0x4b2ee6);return{'transcript':_0x52259b,'confidence':_0x4b2ee6};})[_0x601b('0x55')](function(_0xe08a9b){logger['error'](_0x601b('0x56'),_0xe08a9b[_0x601b('0x15')],_0xe08a9b[_0x601b('0x57')],_0xe08a9b[_0x601b('0x58')]);});};exports[_0x601b('0x59')]=function(_0x43f462,_0x2237dd,_0x15c9a8,_0x3a0cca){var _0x5c1c45=apiai(_0x2237dd,{'language':_0x3a0cca||'en'});return _0x5c1c45[_0x601b('0x5a')](_0x15c9a8,{'sessionId':md5(_0x43f462)})['then'](function(_0x12ec66){logger[_0x601b('0x1b')](JSON['stringify'](_0x12ec66));return{'source':_0x12ec66[_0x601b('0x5b')][_0x601b('0x5c')],'resolvedQuery':_0x12ec66['result'][_0x601b('0x5d')],'action':_0x12ec66[_0x601b('0x5b')][_0x601b('0x5e')],'actionIncomplete':_0x12ec66[_0x601b('0x5b')][_0x601b('0x5f')],'speech':_0x12ec66['result'][_0x601b('0x60')][_0x601b('0x61')],'score':_0x12ec66['result']['score'],'statusCode':_0x12ec66[_0x601b('0x62')]['code'],'endConversation':_0x12ec66[_0x601b('0x5b')][_0x601b('0x63')][_0x601b('0x64')]||![],'isFallbackIntent':_0x12ec66[_0x601b('0x5b')][_0x601b('0x63')][_0x601b('0x65')]};});};exports[_0x601b('0x66')]=function(_0x209469,_0x132f95,_0x2003cd,_0x2a9b1a,_0x2122a2,_0x134166){var _0x552d67=_0x2a9b1a[_0x601b('0x67')](/\\n/g,'\x0a');var _0x540566={'credentials':{'private_key':_0x552d67,'client_email':_0x2003cd}};var _0xdd0ec8=new dialogflow['SessionsClient'](_0x540566);var _0x5e8dbc=_0xdd0ec8[_0x601b('0x68')](_0x132f95,md5(_0x209469));var _0x1b26aa={'session':_0x5e8dbc,'queryInput':{'text':{'text':_0x2122a2,'languageCode':_0x134166}}};return _0xdd0ec8[_0x601b('0x69')](_0x1b26aa)['then'](function(_0x49a0f4){if(_0x49a0f4&&_0x49a0f4['length']){logger['info'](_0x601b('0x6a'),JSON['stringify'](_0x49a0f4));var _0x1d1c62=_0x49a0f4[0x0];if(_0x1d1c62){var _0x492da0={'action':_0x1d1c62[_0x601b('0x6b')]['action'],'allRequiredParamsPresent':_0x1d1c62['queryResult'][_0x601b('0x6c')],'endConversation':_0x1d1c62['queryResult']['diagnosticInfo']&&_0x1d1c62[_0x601b('0x6b')][_0x601b('0x6d')]['fields']?_0x1d1c62[_0x601b('0x6b')][_0x601b('0x6d')][_0x601b('0x6e')][_0x601b('0x6f')][_0x601b('0x70')]:![],'fulfillmentText':_0x1d1c62[_0x601b('0x6b')][_0x601b('0x71')],'intentName':_0x1d1c62[_0x601b('0x6b')][_0x601b('0x72')][_0x601b('0x57')],'intentDisplayName':_0x1d1c62['queryResult'][_0x601b('0x72')]['displayName'],'isFallbackIntent':_0x1d1c62[_0x601b('0x6b')][_0x601b('0x72')][_0x601b('0x73')],'languageCode':_0x1d1c62['queryResult'][_0x601b('0x74')],'queryText':_0x1d1c62[_0x601b('0x6b')][_0x601b('0x75')],'responseId':_0x1d1c62[_0x601b('0x76')],'score':_0x1d1c62[_0x601b('0x6b')][_0x601b('0x77')],'speech':_0x1d1c62[_0x601b('0x6b')][_0x601b('0x71')],'providerResponse':JSON[_0x601b('0x44')](_0x49a0f4)};return _0x492da0;}}});};exports['tildeASR']=function(_0x4d50c8,_0x5aa9df,_0x1fccc4,_0x35bfa7){return tilde['asr'](_0x4d50c8,_0x5aa9df,_0x1fccc4,_0x35bfa7)[_0x601b('0x2d')](function(_0xc0ef00){try{fs['unlink'](_0x4d50c8);}catch(_0xd1bd75){logger[_0x601b('0x16')](_0xd1bd75);}logger[_0x601b('0x1b')](_0x601b('0x78'),_0xc0ef00[_0x601b('0x4f')]);logger[_0x601b('0x1b')]('Tilde\x20ASR\x20confidence',_0xc0ef00['confidence']);return _0xc0ef00;});};exports[_0x601b('0x79')]=function(_0x92e71f,_0x1208fb,_0x1ec2f7,_0x3b3430,_0x4e631f,_0x48b422){var _0x31ab8c=path['resolve'](__dirname,_0x601b('0x28'),rs['generate'](0x4)+_0x601b('0x3b'));var _0x26a075;return aws[_0x601b('0x7a')](_0x92e71f,_0x1208fb,_0x1ec2f7,_0x3b3430,_0x4e631f,_0x48b422,_0x31ab8c)[_0x601b('0x2d')](function(){_0x26a075=path[_0x601b('0x27')](__dirname,_0x601b('0x28'),rs[_0x601b('0x29')](0x4)+'.wav');return convertFile(_0x31ab8c,_0x26a075);})[_0x601b('0x2d')](function(){try{fs[_0x601b('0x1e')](_0x31ab8c);fs[_0x601b('0x2e')](_0x26a075,'777');}catch(_0x145e9a){logger[_0x601b('0x16')](_0x145e9a);}return _0x26a075[_0x601b('0x30')]('.')[0x0];});};exports[_0x601b('0x7b')]=function(_0x57210a,_0xa83c19,_0x8b0606,_0x40923f,_0x429973,_0x56167d){return aws[_0x601b('0x7c')](_0x57210a,_0xa83c19,_0x8b0606,_0x40923f,_0x429973,_0x56167d)[_0x601b('0x2d')](function(_0x2a8047){logger[_0x601b('0x1b')](JSON[_0x601b('0x44')](_0x2a8047));return _0x2a8047;});};exports[_0x601b('0x7d')]=function(_0x48c967,_0x450f69,_0x1d5663,_0xe256f4){var _0x3638a7=util[_0x601b('0x7e')](_0x601b('0x7f'),ISPEECH_API,_0x48c967,encodeURIComponent(_0x450f69),_0x1d5663,_0xe256f4);var _0x4324c0=path[_0x601b('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x601b('0x3b'));var _0x558c58;return downloadFile(_0x3638a7,_0x4324c0)[_0x601b('0x2d')](function(){_0x558c58=path[_0x601b('0x27')](__dirname,_0x601b('0x28'),rs[_0x601b('0x29')](0x4)+_0x601b('0x2a'));return convertFile(_0x4324c0,_0x558c58);})[_0x601b('0x2d')](function(){try{fs[_0x601b('0x1e')](_0x4324c0);fs[_0x601b('0x2e')](_0x558c58,_0x601b('0x2f'));}catch(_0x311326){logger[_0x601b('0x16')](_0x311326);}return _0x558c58[_0x601b('0x30')]('.')[0x0];});};exports[_0x601b('0x80')]=function(_0x44e702,_0x3cf94b,_0x3325f6,_0x11420a){var _0x504b60=util['format'](_0x601b('0x81'),ISPEECH_API,_0x3cf94b,_0x3325f6,base64Encode(_0x44e702),_0x11420a?util[_0x601b('0x7e')](_0x601b('0x82'),encodeURIComponent(_0x11420a)):'freeform=3');return uploadFile(_0x504b60)['then'](function(_0x31ab23){return querystring['parse'](_0x31ab23);});};exports[_0x601b('0x83')]=function(_0x2bf41f,_0x8369){return sestek[_0x601b('0x84')](_0x2bf41f,_0x8369)['then'](function(_0x3a8fa8){logger[_0x601b('0x1b')](JSON[_0x601b('0x44')](_0x3a8fa8));var _0x15026f={'speech':_0x3a8fa8[_0x601b('0x85')],'action':_0x3a8fa8[_0x601b('0x86')]?_0x3a8fa8[_0x601b('0x86')][_0x601b('0x87')]:undefined,'actiondata':_0x3a8fa8['channelData']?_0x3a8fa8[_0x601b('0x86')]['CustomActionData']:undefined};if(_0x3a8fa8[_0x601b('0x86')]&&_0x3a8fa8[_0x601b('0x86')]['AudioFromTts']){return base64Decode(_0x3a8fa8[_0x601b('0x86')][_0x601b('0x88')]['Data'],path[_0x601b('0x27')](__dirname,_0x601b('0x28'),rs[_0x601b('0x29')](0x4)+_0x601b('0x2a')))[_0x601b('0x2d')](function(_0x4603e5){_0x15026f['audiofile']=_0x4603e5;return _0x15026f;});}return _0x15026f;});};exports[_0x601b('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0xa71c=['googleTTS','utf8','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','generate','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','message','source','resolvedQuery','result','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','allRequiredParamsPresent','queryResult','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','model=%s','sestekNDA','nda','text','CustomAction','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./google','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','get','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','.wav','writeFileSync','base64','chmodSync','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','then','tmp','.mp3','from','audioContent','writeFile','777'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xa71c,0x1d6));var _0xca71=function(_0x5cc06e,_0x38e805){_0x5cc06e=_0x5cc06e-0x0;var _0x1e569f=_0xa71c[_0x5cc06e];return _0x1e569f;};'use strict';var apiai=require(_0xca71('0x0'));var BPromise=require(_0xca71('0x1'));var dialogflow=require(_0xca71('0x2'));var fs=require('fs');var http=require(_0xca71('0x3'));var https=require(_0xca71('0x4'));var md5=require('md5');var path=require(_0xca71('0x5'));var querystring=require('querystring');var rp=require(_0xca71('0x6'));var rs=require(_0xca71('0x7'));var sox=require(_0xca71('0x8'));var tts=require(_0xca71('0x9'));var urlParse=require(_0xca71('0xa'))[_0xca71('0xb')];var util=require(_0xca71('0xc'));var aws=require('./aws');var google=require(_0xca71('0xd'));var sestek=require(_0xca71('0xe'));var tilde=require('./tilde');var logger=require(_0xca71('0xf'))('agi');var ISPEECH_API=_0xca71('0x10');function downloadFile(_0x1263d7,_0x3e6914){return new BPromise(function(_0x34dc53,_0x2fa806){var _0x1a66b8=urlParse(_0x1263d7);var _0x10bdf1=_0x1a66b8[_0xca71('0x11')]==='https:'?https:http;var _0x4f7a33={'host':_0x1a66b8[_0xca71('0x12')],'path':_0x1a66b8['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x10bdf1[_0xca71('0x13')](_0x4f7a33,function(_0xb65504){if(_0xb65504[_0xca71('0x14')]!==0xc8){logger['error'](_0xca71('0x15')+_0x1263d7+'\x20failed,\x20status\x20code\x20=\x20'+_0xb65504[_0xca71('0x14')]+'\x20('+_0xb65504[_0xca71('0x16')]+')');_0x2fa806(new Error(_0xca71('0x15')+_0x1263d7+_0xca71('0x17')+_0xb65504['statusCode']+'\x20('+_0xb65504[_0xca71('0x16')]+')'));return;}var _0x3be898=fs[_0xca71('0x18')](_0x3e6914);_0x3be898['on'](_0xca71('0x19'),function(){logger[_0xca71('0x1a')](_0xca71('0x1b'));_0x3be898[_0xca71('0x1c')](_0x34dc53);});_0x3be898['on'](_0xca71('0x1d'),function(_0x2a2894){fs[_0xca71('0x1e')](_0x3e6914);logger['error'](_0xca71('0x1f'),_0x2a2894);_0x2fa806(_0x2a2894);});_0xb65504[_0xca71('0x20')](_0x3be898);})['on'](_0xca71('0x1d'),function(_0x2525a1){logger['error'](_0x2525a1);_0x2fa806(_0x2525a1);})['end']();});}function uploadFile(_0x1e1d56){return new BPromise(function(_0x243f27,_0x2d4d28){var _0x168e0=urlParse(_0x1e1d56);var _0x1e5979=_0x168e0['protocol']==='https:'?https:http;var _0x56c7d3={'host':_0x168e0[_0xca71('0x12')],'path':_0x168e0['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x1e5979[_0xca71('0x13')](_0x56c7d3,function(_0x49631e){if(_0x49631e[_0xca71('0x14')]!==0xc8){_0x2d4d28(new Error(_0xca71('0x15')+_0x1e1d56+_0xca71('0x17')+_0x49631e[_0xca71('0x14')]+'\x20('+_0x49631e['statusMessage']+')'));return;}var _0x24ada3='';_0x49631e['on'](_0xca71('0x21'),function(_0x57fcfd){_0x24ada3+=_0x57fcfd;});_0x49631e['on'](_0xca71('0x22'),function(){_0x243f27(_0x24ada3);});})['on']('error',function(_0x442a9b){_0x2d4d28(_0x442a9b);})[_0xca71('0x22')]();});}function convertFile(_0x5d09b5,_0x47b713){return new BPromise(function(_0x28225c,_0x38a15f){var _0x4a4daa=sox[_0xca71('0x23')](_0x5d09b5,_0x47b713,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4a4daa['on'](_0xca71('0x1d'),function(_0x138505){logger[_0xca71('0x1d')](_0xca71('0x24'),_0x138505);_0x38a15f(_0x138505);});_0x4a4daa['on'](_0xca71('0x22'),function(){logger[_0xca71('0x1a')](_0xca71('0x25'));_0x28225c();});_0x4a4daa[_0xca71('0x26')]();});}function base64Decode(_0x23fd4f,_0x513a24){var _0x2aac56=path[_0xca71('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0xca71('0x28'));fs[_0xca71('0x29')](_0x2aac56,_0x23fd4f,_0xca71('0x2a'));return convertFile(_0x2aac56,_0x513a24)['then'](function(){try{fs['unlink'](_0x2aac56);fs[_0xca71('0x2b')](_0x513a24,'777');}catch(_0x2ff11d){logger['error'](_0x2ff11d);}return _0x513a24[_0xca71('0x2c')]('.')[0x0];});}function base64Encode(_0x22e7b5){var _0x4b2934=fs[_0xca71('0x2d')](_0x22e7b5);return new Buffer(_0x4b2934)[_0xca71('0x2e')](_0xca71('0x2a'));}exports['googleCloudTTS']=function(_0x3a53b3,_0x262380,_0x2b72f3,_0x29a982,_0x2a8b8a,_0x243cf1){var _0x58937e,_0x22f5c7;var _0x231f8b=_0xca71('0x2f');var _0x4f3a53=_0xca71('0x30')+_0x3a53b3;var _0x56b7cd={};if(_0x262380==='ssml'){_0x56b7cd['input']={'ssml':_0x2b72f3};}else{_0x56b7cd[_0xca71('0x31')]={'text':_0x2b72f3};};_0x56b7cd[_0xca71('0x32')]={'languageCode':_0x29a982,'ssmlGender':_0x2a8b8a};_0x56b7cd[_0xca71('0x33')]={'audioEncoding':_0xca71('0x34'),'sampleRateHertz':0x1f40};var _0x1426bf={'url':_0x231f8b+_0xca71('0x35')+_0x4f3a53,'method':_0xca71('0x36'),'json':!![],'body':_0x56b7cd};return rp(_0x1426bf)[_0xca71('0x37')](function(_0x577d13){return new BPromise(function(_0x2f384b,_0xfabeb1){_0x58937e=path['resolve'](__dirname,_0xca71('0x38'),rs['generate'](0x4)+_0xca71('0x39'));var _0x3cc5e8=Buffer[_0xca71('0x3a')](_0x577d13[_0xca71('0x3b')],_0xca71('0x2a'));return fs[_0xca71('0x3c')](_0x58937e,_0x3cc5e8,function(_0x29ee09){_0xfabeb1(_0x29ee09);},function(_0xa138c4){fs[_0xca71('0x2b')](_0x58937e,_0xca71('0x3d'));_0x2f384b(_0xa138c4);});});})[_0xca71('0x37')](function(_0x5de7a2){_0x22f5c7=path[_0xca71('0x27')](__dirname,_0xca71('0x38'),rs['generate'](0x4)+_0xca71('0x28'));return convertFile(_0x58937e,_0x22f5c7);})[_0xca71('0x37')](function(){try{fs[_0xca71('0x1e')](_0x58937e);fs['chmodSync'](_0x22f5c7,_0xca71('0x3d'));}catch(_0x3e78f7){logger['error'](_0x3e78f7);}logger[_0xca71('0x1a')]('googleCloudTTS\x20path',_0x22f5c7['split']('.')[0x0]);return _0x22f5c7[_0xca71('0x2c')]('.')[0x0];});};exports[_0xca71('0x3e')]=function(_0x1539c8,_0x541c64){var _0x3d5f96='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0xd4f1d9,_0x222df7;var _0x5b3836;var _0x22823d={'encoding':_0xca71('0x3f'),'method':_0xca71('0x36'),'timeout':0x2710,'url':_0x3d5f96,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xca71('0x40')+encodeURIComponent(JSON[_0xca71('0x41')]([[['jQ1olc',JSON[_0xca71('0x41')]([_0x1539c8,_0x541c64||'en',![],'null']),null,_0xca71('0x42')]]]))};return rp(_0x22823d)[_0xca71('0x37')](function(_0x2aa9e9){try{_0x5b3836=eval(_0x2aa9e9[_0xca71('0x43')](0x5))[0x0][0x2];}catch(_0xef660e){throw new Error(_0xca71('0x44')+_0x2aa9e9[_0xca71('0x21')]);}if(!_0x5b3836){if(_0x1539c8[_0xca71('0x45')]>0xc8){throw new Error(_0xca71('0x46'));}else{throw new Error(_0xca71('0x47')+_0x541c64+_0xca71('0x48'));}}try{_0x5b3836=eval(_0x5b3836)[0x0];}catch(_0x20b83c){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0xabde09=_0x5b3836;_0xd4f1d9=path[_0xca71('0x27')](__dirname,_0xca71('0x38'),rs[_0xca71('0x49')](0x4)+_0xca71('0x39'));fs[_0xca71('0x29')](_0xd4f1d9,_0x5b3836,{'encoding':_0xca71('0x2a')});_0x222df7=path[_0xca71('0x27')](__dirname,'tmp',rs[_0xca71('0x49')](0x4)+'.wav');return convertFile(_0xd4f1d9,_0x222df7);})['then'](function(){try{fs[_0xca71('0x1e')](_0xd4f1d9);fs[_0xca71('0x2b')](_0x222df7,_0xca71('0x3d'));}catch(_0x2db491){logger[_0xca71('0x1d')](_0x2db491);}logger['info'](_0xca71('0x4a'),_0x222df7[_0xca71('0x2c')]('.')[0x0]);return _0x222df7[_0xca71('0x2c')]('.')[0x0];});};exports[_0xca71('0x4b')]=function(_0x21ca6e,_0x783e9c,_0x256898){return google[_0xca71('0x4c')](_0x21ca6e,_0x783e9c,_0x256898)[_0xca71('0x37')](function(_0xdc673a){logger[_0xca71('0x1a')](_0xdc673a['uri']);return rp(_0xdc673a);})[_0xca71('0x37')](function(_0x4dfeef){var _0x3802ce='';var _0x20aded=0x0;try{fs['unlink'](_0x21ca6e);}catch(_0x256805){logger[_0xca71('0x1d')](_0x256805);}if(_0x4dfeef&&_0x4dfeef[_0xca71('0x4d')]){_0x3802ce=_0x4dfeef[_0xca71('0x4d')][_0xca71('0x4e')](function(_0x4cf89c){return _0x4cf89c&&_0x4cf89c[_0xca71('0x4f')][0x0]&&_0x4cf89c['alternatives'][0x0][_0xca71('0x50')]?_0x4cf89c[_0xca71('0x4f')][0x0][_0xca71('0x50')]:'';})[_0xca71('0x51')]('\x0a');_0x20aded=_0x4dfeef[_0xca71('0x4d')][_0xca71('0x4e')](function(_0x283ced){return _0x283ced&&_0x283ced[_0xca71('0x4f')][0x0]&&_0x283ced[_0xca71('0x4f')][0x0][_0xca71('0x52')]?_0x283ced['alternatives'][0x0]['confidence']:0x0;})[_0xca71('0x51')]('\x0a');}logger[_0xca71('0x1a')]('googleASR\x20transcription',_0x3802ce);logger[_0xca71('0x1a')](_0xca71('0x53'),_0x20aded);return{'transcript':_0x3802ce,'confidence':_0x20aded};})[_0xca71('0x54')](function(_0x4ed78d){logger[_0xca71('0x1d')]('[%s]\x20%s:%s',_0x4ed78d[_0xca71('0x14')],_0x4ed78d['name'],_0x4ed78d[_0xca71('0x55')]);});};exports['googleDialogflow']=function(_0x5894e6,_0x29b902,_0x59d017,_0x8a88de){var _0x3e2d2=apiai(_0x29b902,{'language':_0x8a88de||'en'});return _0x3e2d2['textRequest'](_0x59d017,{'sessionId':md5(_0x5894e6)})[_0xca71('0x37')](function(_0x588771){logger[_0xca71('0x1a')](JSON['stringify'](_0x588771));return{'source':_0x588771['result'][_0xca71('0x56')],'resolvedQuery':_0x588771['result'][_0xca71('0x57')],'action':_0x588771[_0xca71('0x58')][_0xca71('0x59')],'actionIncomplete':_0x588771[_0xca71('0x58')][_0xca71('0x5a')],'speech':_0x588771[_0xca71('0x58')][_0xca71('0x5b')][_0xca71('0x5c')],'score':_0x588771[_0xca71('0x58')][_0xca71('0x5d')],'statusCode':_0x588771['status'][_0xca71('0x5e')],'endConversation':_0x588771['result'][_0xca71('0x5f')][_0xca71('0x60')]||![],'isFallbackIntent':_0x588771[_0xca71('0x58')][_0xca71('0x5f')][_0xca71('0x61')]};});};exports[_0xca71('0x62')]=function(_0x1296e8,_0xfae38e,_0x30c700,_0x2a32b2,_0x1eb157,_0x47c4c8){var _0x1933a8=_0x2a32b2[_0xca71('0x63')](/\\n/g,'\x0a');var _0x166f36={'credentials':{'private_key':_0x1933a8,'client_email':_0x30c700}};var _0x375f5c=new dialogflow[(_0xca71('0x64'))](_0x166f36);var _0x6d7f51=_0x375f5c[_0xca71('0x65')](_0xfae38e,md5(_0x1296e8));var _0x510214={'session':_0x6d7f51,'queryInput':{'text':{'text':_0x1eb157,'languageCode':_0x47c4c8}}};return _0x375f5c[_0xca71('0x66')](_0x510214)['then'](function(_0x29ccc3){if(_0x29ccc3&&_0x29ccc3[_0xca71('0x45')]){logger[_0xca71('0x1a')]('Dialogflow\x20V2\x20response:',JSON[_0xca71('0x41')](_0x29ccc3));var _0x1cf2f3=_0x29ccc3[0x0];if(_0x1cf2f3){var _0x584898={'action':_0x1cf2f3['queryResult'][_0xca71('0x59')],'allRequiredParamsPresent':_0x1cf2f3['queryResult'][_0xca71('0x67')],'endConversation':_0x1cf2f3[_0xca71('0x68')]['diagnosticInfo']&&_0x1cf2f3['queryResult']['diagnosticInfo'][_0xca71('0x69')]?_0x1cf2f3[_0xca71('0x68')]['diagnosticInfo']['fields'][_0xca71('0x6a')][_0xca71('0x6b')]:![],'fulfillmentText':_0x1cf2f3[_0xca71('0x68')][_0xca71('0x6c')],'intentName':_0x1cf2f3[_0xca71('0x68')][_0xca71('0x6d')][_0xca71('0x6e')],'intentDisplayName':_0x1cf2f3[_0xca71('0x68')][_0xca71('0x6d')][_0xca71('0x6f')],'isFallbackIntent':_0x1cf2f3[_0xca71('0x68')][_0xca71('0x6d')]['isFallback'],'languageCode':_0x1cf2f3[_0xca71('0x68')][_0xca71('0x70')],'queryText':_0x1cf2f3['queryResult'][_0xca71('0x71')],'responseId':_0x1cf2f3[_0xca71('0x72')],'score':_0x1cf2f3[_0xca71('0x68')][_0xca71('0x73')],'speech':_0x1cf2f3[_0xca71('0x68')][_0xca71('0x6c')],'providerResponse':JSON[_0xca71('0x41')](_0x29ccc3)};return _0x584898;}}});};exports['tildeASR']=function(_0x48d534,_0x3d44b9,_0x2eaae3,_0x103178){return tilde[_0xca71('0x4c')](_0x48d534,_0x3d44b9,_0x2eaae3,_0x103178)['then'](function(_0x186b68){try{fs[_0xca71('0x1e')](_0x48d534);}catch(_0x839798){logger[_0xca71('0x1d')](_0x839798);}logger[_0xca71('0x1a')](_0xca71('0x74'),_0x186b68[_0xca71('0x50')]);logger[_0xca71('0x1a')](_0xca71('0x75'),_0x186b68[_0xca71('0x52')]);return _0x186b68;});};exports[_0xca71('0x76')]=function(_0x477cf8,_0x269d45,_0x1d55a1,_0x16480a,_0x1878cf,_0x3b2d9d){var _0xe505d4=path['resolve'](__dirname,_0xca71('0x38'),rs[_0xca71('0x49')](0x4)+_0xca71('0x39'));var _0x182d4c;return aws[_0xca71('0x77')](_0x477cf8,_0x269d45,_0x1d55a1,_0x16480a,_0x1878cf,_0x3b2d9d,_0xe505d4)[_0xca71('0x37')](function(){_0x182d4c=path[_0xca71('0x27')](__dirname,_0xca71('0x38'),rs[_0xca71('0x49')](0x4)+_0xca71('0x28'));return convertFile(_0xe505d4,_0x182d4c);})[_0xca71('0x37')](function(){try{fs[_0xca71('0x1e')](_0xe505d4);fs['chmodSync'](_0x182d4c,_0xca71('0x3d'));}catch(_0x41185c){logger[_0xca71('0x1d')](_0x41185c);}return _0x182d4c[_0xca71('0x2c')]('.')[0x0];});};exports['awsLex']=function(_0x54e526,_0x254a71,_0x160e28,_0x12170d,_0x5a858a,_0xa5a812){return aws['lex'](_0x54e526,_0x254a71,_0x160e28,_0x12170d,_0x5a858a,_0xa5a812)[_0xca71('0x37')](function(_0x2f0081){logger[_0xca71('0x1a')](JSON[_0xca71('0x41')](_0x2f0081));return _0x2f0081;});};exports['ispeechTTS']=function(_0x2fc972,_0x462686,_0x979e5e,_0x3d3c7a){var _0x27b22d=util[_0xca71('0x78')](_0xca71('0x79'),ISPEECH_API,_0x2fc972,encodeURIComponent(_0x462686),_0x979e5e,_0x3d3c7a);var _0x761bc9=path['resolve'](__dirname,_0xca71('0x38'),rs[_0xca71('0x49')](0x4)+_0xca71('0x39'));var _0x5542a2;return downloadFile(_0x27b22d,_0x761bc9)[_0xca71('0x37')](function(){_0x5542a2=path[_0xca71('0x27')](__dirname,'tmp',rs[_0xca71('0x49')](0x4)+_0xca71('0x28'));return convertFile(_0x761bc9,_0x5542a2);})['then'](function(){try{fs[_0xca71('0x1e')](_0x761bc9);fs[_0xca71('0x2b')](_0x5542a2,_0xca71('0x3d'));}catch(_0x482764){logger['error'](_0x482764);}return _0x5542a2[_0xca71('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x253289,_0x13912f,_0x32dd58,_0x41d798){var _0x736b22=util[_0xca71('0x78')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x13912f,_0x32dd58,base64Encode(_0x253289),_0x41d798?util[_0xca71('0x78')](_0xca71('0x7a'),encodeURIComponent(_0x41d798)):'freeform=3');return uploadFile(_0x736b22)['then'](function(_0x5a927f){return querystring['parse'](_0x5a927f);});};exports[_0xca71('0x7b')]=function(_0x9417cb,_0x577f4b){return sestek[_0xca71('0x7c')](_0x9417cb,_0x577f4b)[_0xca71('0x37')](function(_0x4bce21){logger['info'](JSON['stringify'](_0x4bce21));var _0x5779db={'speech':_0x4bce21[_0xca71('0x7d')],'action':_0x4bce21['channelData']?_0x4bce21['channelData'][_0xca71('0x7e')]:undefined,'actiondata':_0x4bce21[_0xca71('0x7f')]?_0x4bce21['channelData'][_0xca71('0x80')]:undefined};if(_0x4bce21[_0xca71('0x7f')]&&_0x4bce21[_0xca71('0x7f')]['AudioFromTts']){return base64Decode(_0x4bce21['channelData'][_0xca71('0x81')][_0xca71('0x82')],path[_0xca71('0x27')](__dirname,'tmp',rs[_0xca71('0x49')](0x4)+_0xca71('0x28')))[_0xca71('0x37')](function(_0x2b012a){_0x5779db[_0xca71('0x83')]=_0x2b012a;return _0x5779db;});}return _0x5779db;});};exports[_0xca71('0x84')]=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 6b39daf..7f45a99 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 _0x19b6=['exports'];(function(_0x2dc0d6,_0x1bde99){var _0x5c4c3e=function(_0x5049ef){while(--_0x5049ef){_0x2dc0d6['push'](_0x2dc0d6['shift']());}};_0x5c4c3e(++_0x1bde99);}(_0x19b6,0x1e3));var _0x619b=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0x19b6[_0x4fe19c];return _0x952ac7;};var nda=require('./nda');module[_0x619b('0x0')]={'nda':nda}; \ No newline at end of file +var _0xd16e=['exports'];(function(_0x3c4177,_0x4bb568){var _0x357fd2=function(_0x1ac79d){while(--_0x1ac79d){_0x3c4177['push'](_0x3c4177['shift']());}};_0x357fd2(++_0x4bb568);}(_0xd16e,0x1b3));var _0xed16=function(_0x4bdf0c,_0xab8401){_0x4bdf0c=_0x4bdf0c-0x0;var _0x7316a5=_0xd16e[_0x4bdf0c];return _0x7316a5;};var nda=require('./nda');module[_0xed16('0x0')]={'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 cb6a865..aa12167 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 _0xc29b=['resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','channelData','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','exports','POST'];(function(_0xbb799f,_0xf6fd94){var _0x3daf27=function(_0x14c664){while(--_0x14c664){_0xbb799f['push'](_0xbb799f['shift']());}};_0x3daf27(++_0xf6fd94);}(_0xc29b,0x12d));var _0xbc29=function(_0x4290ec,_0x3dd0d5){_0x4290ec=_0x4290ec-0x0;var _0xa56bb8=_0xc29b[_0x4290ec];return _0xa56bb8;};'use strict';var rp=require(_0xbc29('0x0'));var url=require(_0xbc29('0x1'));var logger=require(_0xbc29('0x2'))('agi');module[_0xbc29('0x3')]=function(_0x45ba7a,_0x4b6382){var _0x3032cb={'method':_0xbc29('0x4'),'uri':url[_0xbc29('0x5')](_0x4b6382[_0xbc29('0x6')],_0xbc29('0x7')),'form':{'grant_type':_0xbc29('0x8'),'username':_0x4b6382[_0xbc29('0x9')],'password':_0x4b6382[_0xbc29('0x8')]},'json':!![]};return rp(_0x3032cb)[_0xbc29('0xa')](function(_0x37d9dd){var _0x2e5fb7={'method':_0xbc29('0x4'),'uri':url[_0xbc29('0x5')](_0x4b6382[_0xbc29('0xb')],_0xbc29('0xc')),'body':{'type':_0x4b6382[_0xbc29('0xd')]||_0xbc29('0xe'),'channelId':_0xbc29('0xf'),'conversation':{'id':_0x45ba7a[_0xbc29('0x10')]},'from':{'id':_0x45ba7a[_0xbc29('0x11')],'name':_0x45ba7a['calleridname']},'recipient':{'id':_0x45ba7a[_0xbc29('0x12')],'name':_0x45ba7a[_0xbc29('0x13')]},'text':_0x4b6382[_0xbc29('0x14')],'channelData':{}},'headers':{'Authorization':_0xbc29('0x15')+_0x37d9dd[_0xbc29('0x16')]},'json':!![]};if(_0x4b6382[_0xbc29('0x17')]){_0x2e5fb7[_0xbc29('0x18')]['channelData'][_0xbc29('0x19')]=_0x4b6382[_0xbc29('0x17')];}if(_0x4b6382[_0xbc29('0x1a')]=='1'){_0x2e5fb7['body']['channelData'][_0xbc29('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x4b6382[_0xbc29('0x1c')]){_0x2e5fb7[_0xbc29('0x18')][_0xbc29('0x1d')]['CustomAction']=_0x4b6382[_0xbc29('0x1c')];if(_0x4b6382['custom_action_data']){_0x2e5fb7[_0xbc29('0x18')][_0xbc29('0x1d')][_0xbc29('0x1e')]=_0x4b6382[_0xbc29('0x1f')];}}logger[_0xbc29('0x20')](JSON[_0xbc29('0x21')](_0x2e5fb7));return rp(_0x2e5fb7);});}; \ No newline at end of file +var _0xc2e8=['request-promise','url','exports','POST','ndauth_url','/token','password','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','stringify'];(function(_0x33b295,_0x32fa89){var _0x225279=function(_0x41609c){while(--_0x41609c){_0x33b295['push'](_0x33b295['shift']());}};_0x225279(++_0x32fa89);}(_0xc2e8,0x70));var _0x8c2e=function(_0x2a6420,_0x2fe8fa){_0x2a6420=_0x2a6420-0x0;var _0x390ec4=_0xc2e8[_0x2a6420];return _0x390ec4;};'use strict';var rp=require(_0x8c2e('0x0'));var url=require(_0x8c2e('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x8c2e('0x2')]=function(_0x4df201,_0x8e4f3e){var _0x3c074b={'method':_0x8c2e('0x3'),'uri':url['resolve'](_0x8e4f3e[_0x8c2e('0x4')],_0x8c2e('0x5')),'form':{'grant_type':_0x8c2e('0x6'),'username':_0x8e4f3e['username'],'password':_0x8e4f3e['password']},'json':!![]};return rp(_0x3c074b)['then'](function(_0x487731){var _0x4abd39={'method':_0x8c2e('0x3'),'uri':url[_0x8c2e('0x7')](_0x8e4f3e[_0x8c2e('0x8')],_0x8c2e('0x9')),'body':{'type':_0x8e4f3e[_0x8c2e('0xa')]||_0x8c2e('0xb'),'channelId':_0x8c2e('0xc'),'conversation':{'id':_0x4df201[_0x8c2e('0xd')]},'from':{'id':_0x4df201['callerid'],'name':_0x4df201[_0x8c2e('0xe')]},'recipient':{'id':_0x4df201[_0x8c2e('0xf')],'name':_0x4df201[_0x8c2e('0x10')]},'text':_0x8e4f3e['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x487731['access_token']},'json':!![]};if(_0x8e4f3e[_0x8c2e('0x11')]){_0x4abd39[_0x8c2e('0x12')][_0x8c2e('0x13')][_0x8c2e('0x14')]=_0x8e4f3e[_0x8c2e('0x11')];}if(_0x8e4f3e[_0x8c2e('0x15')]=='1'){_0x4abd39[_0x8c2e('0x12')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8c2e('0x16')};}if(_0x8e4f3e[_0x8c2e('0x17')]){_0x4abd39[_0x8c2e('0x12')][_0x8c2e('0x13')][_0x8c2e('0x18')]=_0x8e4f3e[_0x8c2e('0x17')];if(_0x8e4f3e['custom_action_data']){_0x4abd39[_0x8c2e('0x12')][_0x8c2e('0x13')][_0x8c2e('0x19')]=_0x8e4f3e[_0x8c2e('0x1a')];}}logger['info'](JSON[_0x8c2e('0x1b')](_0x4abd39));return rp(_0x4abd39);});}; \ 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 01b1935..75f0aed 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 _0x4815=['exports','./lib/api'];(function(_0x54c2b7,_0x162ca8){var _0x3a41e5=function(_0x4b7c53){while(--_0x4b7c53){_0x54c2b7['push'](_0x54c2b7['shift']());}};_0x3a41e5(++_0x162ca8);}(_0x4815,0xff));var _0x5481=function(_0x14bb3e,_0x5b63c4){_0x14bb3e=_0x14bb3e-0x0;var _0x5acfc9=_0x4815[_0x14bb3e];return _0x5acfc9;};'use strict';var asr=require(_0x5481('0x0'));module[_0x5481('0x1')]=function(_0x325314,_0x3ac100,_0x9fd940,_0x32ee83){return asr(_0x325314,_0x3ac100,_0x9fd940,_0x32ee83);}; \ No newline at end of file +var _0x040d=['exports'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x040d,0x7c));var _0xd040=function(_0x53c2a9,_0x591554){_0x53c2a9=_0x53c2a9-0x0;var _0x3030a3=_0x040d[_0x53c2a9];return _0x3030a3;};'use strict';var asr=require('./lib/api');module[_0xd040('0x0')]=function(_0x1459f7,_0x53a33d,_0x14a6aa,_0x54be2f){return asr(_0x1459f7,_0x53a33d,_0x14a6aa,_0x54be2f);}; \ 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 d590bcc..7f5580c 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 _0x8e2d=['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','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','close','error','terminate','parse','result','final','stringify','hypotheses','transcript','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI'];(function(_0x38a211,_0x1c21ff){var _0x78f594=function(_0x2cd0f3){while(--_0x2cd0f3){_0x38a211['push'](_0x38a211['shift']());}};_0x78f594(++_0x1c21ff);}(_0x8e2d,0x80));var _0xd8e2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e2d[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var _=require(_0xd8e2('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xd8e2('0x1'));var crypto=require(_0xd8e2('0x2'));var logger=require(_0xd8e2('0x3'))(_0xd8e2('0x4'));module[_0xd8e2('0x5')]=function(_0x11204b,_0x225209,_0x2bc0ed,_0x28de1d){return new BPromise(function(_0x48cc54,_0x123f69){logger[_0xd8e2('0x6')](_0xd8e2('0x7'),_0x28de1d||_0xd8e2('0x8'));var _0x2b5534=new WebSocket(_0x28de1d||_0xd8e2('0x8'),{'perMessageDeflate':![]});var _0x4d2a75='';var _0x664bff='0';var _0x1b5aef='1';var _0x789ad2=_0xd8e2('0x9');function _0x2ef249(_0x42f75b){var _0x4c9d83=crypto['createHash'](_0xd8e2('0xa'));_0x4c9d83[_0xd8e2('0xb')](_0x42f75b);return _0x4c9d83[_0xd8e2('0xc')](_0xd8e2('0xd'));}function _0x2860fe(){try{logger[_0xd8e2('0x6')](_0xd8e2('0xe'));var _0x505053=moment()[_0xd8e2('0xf')]();var _0xacf11a=_0x2ef249(_0x505053+_0x225209+_0x2bc0ed);_0x2b5534[_0xd8e2('0x10')](JSON['stringify']({'appID':_0x225209,'timestamp':_0x505053,'appKey':_0xacf11a}));var _0x44ffad=fs['createReadStream'](_0x11204b);_0x44ffad['on']('data',function(_0x3afa95){_0x2b5534['send'](_0x3afa95);});_0x44ffad['on'](_0xd8e2('0x11'),function(){_0x2b5534[_0xd8e2('0x10')]('EOS');});}catch(_0x75ed9e){logger[_0xd8e2('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x75ed9e));_0x2b5534[_0xd8e2('0x13')]();}}function _0x260555(_0x3de477){try{if(_0x3de477){var _0x2dd1c2=JSON[_0xd8e2('0x14')](_0x3de477);switch(_0x2dd1c2['status']){case 0x0:if(_0x2dd1c2[_0xd8e2('0x15')]){if(_0x2dd1c2[_0xd8e2('0x15')][_0xd8e2('0x16')]){logger[_0xd8e2('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0xd8e2('0x17')](_0x2dd1c2[_0xd8e2('0x15')]['hypotheses']));_0x4d2a75=_0x2dd1c2[_0xd8e2('0x15')][_0xd8e2('0x18')][0x0][_0xd8e2('0x19')];_0x664bff=_0x2dd1c2['result'][_0xd8e2('0x18')][0x0]['likelihood'];_0x1b5aef='0';_0x789ad2='Success.';_0x2b5534[_0xd8e2('0x13')]();}}break;case 0x1:logger[_0xd8e2('0x6')](_0xd8e2('0x9'));_0x1b5aef='1';_0x789ad2=_0xd8e2('0x9');break;case 0x2:logger[_0xd8e2('0x6')](_0xd8e2('0x1a'));_0x1b5aef='2';_0x789ad2=_0xd8e2('0x1a');break;case 0x9:logger[_0xd8e2('0x6')](_0xd8e2('0x1b'));_0x1b5aef='9';_0x789ad2=_0xd8e2('0x1b');break;case 0xa:logger[_0xd8e2('0x6')](_0xd8e2('0x1c'));_0x1b5aef='10';_0x789ad2=_0xd8e2('0x1c');break;case 0xb:logger[_0xd8e2('0x6')](_0xd8e2('0x1d'));_0x1b5aef='11';_0x789ad2=_0xd8e2('0x1d');}}}catch(_0x44a81c){logger[_0xd8e2('0x12')](_0xd8e2('0x1e'),JSON[_0xd8e2('0x17')](_0x44a81c));_0x2b5534[_0xd8e2('0x13')]();}}function _0x3ba704(){logger[_0xd8e2('0x6')](_0xd8e2('0x1f'));_0x48cc54({'transcript':_0x4d2a75,'confidence':_0x664bff,'status':_0x1b5aef,'status_message':_0x789ad2});}function _0x23ae58(_0x2a55d9){logger[_0xd8e2('0x12')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xd8e2('0x20')](_0x2a55d9)){logger[_0xd8e2('0x12')](_[_0xd8e2('0x21')](_0x2a55d9)?JSON[_0xd8e2('0x17')](_0x2a55d9):_0x2a55d9);}}_0x2b5534['on']('open',_0x2860fe);_0x2b5534['on']('message',_0x260555);_0x2b5534['on']('close',_0x3ba704);_0x2b5534['on'](_0xd8e2('0x12'),_0x23ae58);});}; \ No newline at end of file +var _0xe4fc=['sha1','hex','info','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe4fc,0x18f));var _0xce4f=function(_0x1ddc7d,_0x10674b){_0x1ddc7d=_0x1ddc7d-0x0;var _0x593fff=_0xe4fc[_0x1ddc7d];return _0x593fff;};'use strict';var BPromise=require(_0xce4f('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xce4f('0x1'));var logger=require(_0xce4f('0x2'))(_0xce4f('0x3'));module[_0xce4f('0x4')]=function(_0x3ea18c,_0x538ba5,_0xcee6b4,_0x330de1){return new BPromise(function(_0x1d3b38,_0x187c69){logger['info'](_0xce4f('0x5'),_0x330de1||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x2c1778=new WebSocket(_0x330de1||_0xce4f('0x6'),{'perMessageDeflate':![]});var _0x559826='';var _0x48fd4e='0';var _0x476aff='1';var _0x49d8f5=_0xce4f('0x7');function _0x41b4c7(_0x4ce53d){var _0x5959ce=crypto[_0xce4f('0x8')](_0xce4f('0x9'));_0x5959ce['update'](_0x4ce53d);return _0x5959ce['digest'](_0xce4f('0xa'));}function _0x22683f(){try{logger[_0xce4f('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x1511b7=moment()['unix']();var _0x1fed31=_0x41b4c7(_0x1511b7+_0x538ba5+_0xcee6b4);_0x2c1778[_0xce4f('0xc')](JSON[_0xce4f('0xd')]({'appID':_0x538ba5,'timestamp':_0x1511b7,'appKey':_0x1fed31}));var _0x2e5c8a=fs[_0xce4f('0xe')](_0x3ea18c);_0x2e5c8a['on'](_0xce4f('0xf'),function(_0x3e8818){_0x2c1778[_0xce4f('0xc')](_0x3e8818);});_0x2e5c8a['on'](_0xce4f('0x10'),function(){_0x2c1778[_0xce4f('0xc')]('EOS');});}catch(_0x372ce4){logger[_0xce4f('0x11')](_0xce4f('0x12'),JSON[_0xce4f('0xd')](_0x372ce4));_0x2c1778[_0xce4f('0x13')]();}}function _0x30c367(_0x171ff0){try{if(_0x171ff0){var _0x5360cb=JSON[_0xce4f('0x14')](_0x171ff0);switch(_0x5360cb[_0xce4f('0x15')]){case 0x0:if(_0x5360cb[_0xce4f('0x16')]){if(_0x5360cb[_0xce4f('0x16')][_0xce4f('0x17')]){logger['info'](_0xce4f('0x18'),JSON[_0xce4f('0xd')](_0x5360cb['result'][_0xce4f('0x19')]));_0x559826=_0x5360cb[_0xce4f('0x16')][_0xce4f('0x19')][0x0]['transcript'];_0x48fd4e=_0x5360cb[_0xce4f('0x16')]['hypotheses'][0x0][_0xce4f('0x1a')];_0x476aff='0';_0x49d8f5='Success.';_0x2c1778['terminate']();}}break;case 0x1:logger[_0xce4f('0xb')](_0xce4f('0x7'));_0x476aff='1';_0x49d8f5=_0xce4f('0x7');break;case 0x2:logger[_0xce4f('0xb')](_0xce4f('0x1b'));_0x476aff='2';_0x49d8f5='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x476aff='9';_0x49d8f5=_0xce4f('0x1c');break;case 0xa:logger[_0xce4f('0xb')]('Authentication\x20failed.');_0x476aff='10';_0x49d8f5='Authentication\x20failed.';break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x476aff='11';_0x49d8f5=_0xce4f('0x1d');}}}catch(_0x567adc){logger[_0xce4f('0x11')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xce4f('0xd')](_0x567adc));_0x2c1778[_0xce4f('0x13')]();}}function _0x2e9b3e(){logger[_0xce4f('0xb')](_0xce4f('0x1e'));_0x1d3b38({'transcript':_0x559826,'confidence':_0x48fd4e,'status':_0x476aff,'status_message':_0x49d8f5});}function _0x3050f2(_0x50d7ff){logger[_0xce4f('0x11')](_0xce4f('0x1f'));if(!_['isNil'](_0x50d7ff)){logger[_0xce4f('0x11')](_[_0xce4f('0x20')](_0x50d7ff)?JSON['stringify'](_0x50d7ff):_0x50d7ff);}}_0x2c1778['on']('open',_0x22683f);_0x2c1778['on'](_0xce4f('0x21'),_0x30c367);_0x2c1778['on'](_0xce4f('0x10'),_0x2e9b3e);_0x2c1778['on'](_0xce4f('0x11'),_0x3050f2);});}; \ 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 ecda3ec..54b94f5 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 _0x6727=['exports','./asr'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6727,0x109));var _0x7672=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x6727[_0x135904];return _0x1ce7d5;};var asr=require(_0x7672('0x0'));module[_0x7672('0x1')]={'asr':asr}; \ No newline at end of file +var _0x1b37=['exports','./asr'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b37,0x1eb));var _0x71b3=function(_0x271aa7,_0x309496){_0x271aa7=_0x271aa7-0x0;var _0xbb50e0=_0x1b37[_0x271aa7];return _0xbb50e0;};var asr=require(_0x71b3('0x0'));module[_0x71b3('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 049f372..df98063 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x9b5bb2,_0x5db315){var _0x2e1e92=function(_0x5621c9){while(--_0x5621c9){_0x9b5bb2['push'](_0x9b5bb2['shift']());}};_0x2e1e92(++_0x5db315);}(_0xe706,0xa3));var _0x6e70=function(_0x46aaaa,_0x3af897){_0x46aaaa=_0x46aaaa-0x0;var _0x26d04e=_0xe706[_0x46aaaa];return _0x26d04e;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index bd343f4..3050c65 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 _0x47fd=['ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','setVariable','replaceObjectAllVariables','split','replaceAll','getVariable','extra','result','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','getAndSetVariable','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','minutes','createCmContact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','lumenvoxasr','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','getQueryOdbc','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','googleDialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','maxdigit','mindigit','hiddendigitsnum','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','sayDigits','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','no\x20subproject\x20selected','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','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','rawHeaders','getdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','Intervals','format','open','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','isEmpty','isNil','callback_','lastName','phone','list_id','callback','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','timeout','number','includes','POST','method','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','parse','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA'];(function(_0x1bedd5,_0x877155){var _0x13c4d4=function(_0x5b9aff){while(--_0x5b9aff){_0x1bedd5['push'](_0x1bedd5['shift']());}};_0x13c4d4(++_0x877155);}(_0x47fd,0x13c));var _0xd47f=function(_0x5f027c,_0x37ff66){_0x5f027c=_0x5f027c-0x0;var _0x202e3d=_0x47fd[_0x5f027c];return _0x202e3d;};'use strict';var fs=require('fs');var util=require(_0xd47f('0x0'));var _=require(_0xd47f('0x1'));var sh=require(_0xd47f('0x2'));var odbc=require(_0xd47f('0x3'))();var rs=require(_0xd47f('0x4'));var moment=require(_0xd47f('0x5'));var Mustache=require(_0xd47f('0x6'));var rp=require(_0xd47f('0x7'));var logger=require(_0xd47f('0x8'))(_0xd47f('0x9'));var config=require('../../config/environment');var shared=require(_0xd47f('0xa'));var scripts=require(_0xd47f('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xd47f('0xc'),'rawBody'];var verticesWithRetry=['menu',_0xd47f('0xd'),'getsecretdigits'];var AGIVertices=function(_0x48efff,_0xc6b72d,_0x2b694d){this[_0xd47f('0xe')]=_0x48efff;this[_0xd47f('0xf')]=_0xc6b72d;this[_0xd47f('0x10')]=_0x2b694d;};AGIVertices[_0xd47f('0x11')]['getVariable']=function(_0x1894f8,_0x30c391){this['rpc'][_0xd47f('0x12')](_0x1894f8)[_0xd47f('0x13')](function(_0x63d1b){_0x30c391(null,_0x63d1b?_0x63d1b[_0xd47f('0x14')]:![]);})[_0xd47f('0x15')](function(_0x3fa73b){_0x30c391(_0x3fa73b);});};AGIVertices['prototype'][_0xd47f('0x16')]=function(_0x423938,_0x18e12f){this[_0xd47f('0xf')][_0xd47f('0x17')](_0x423938)[_0xd47f('0x13')](function(_0x395bfd){_0x18e12f(null,_0x395bfd?_0x395bfd[_0xd47f('0x14')]:![]);})[_0xd47f('0x15')](function(_0x567f43){_0x18e12f(_0x567f43);});};AGIVertices['prototype'][_0xd47f('0x18')]=function(_0x2c4998,_0x4d23b5){this[_0xd47f('0xf')][_0xd47f('0x19')](_0x2c4998)[_0xd47f('0x13')](function(_0x40c533){_0x4d23b5(null,_0x40c533?_0x40c533[_0xd47f('0x14')]:![]);})['catch'](function(_0x2bde6a){_0x4d23b5(_0x2bde6a);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x1a')]=function(_0x77e050,_0x146a99){this[_0xd47f('0xf')][_0xd47f('0x1b')](_0x77e050)[_0xd47f('0x13')](function(_0x3663d3){_0x146a99(null,_0x3663d3?_0x3663d3[_0xd47f('0x1c')]:![]);})[_0xd47f('0x15')](function(_0x3f2e37){_0x146a99(_0x3f2e37);});};AGIVertices[_0xd47f('0x11')]['getUser']=function(_0x50f3f6,_0x336e1){this['rpc'][_0xd47f('0x1d')](_0x50f3f6)[_0xd47f('0x13')](function(_0x117d9b){_0x336e1(null,_0x117d9b?_0x117d9b['name']:![]);})['catch'](function(_0x50b1d6){_0x336e1(_0x50b1d6);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x1e')]=function(_0x42873c,_0xc690c3){this[_0xd47f('0xf')]['getTrunkById'](_0x42873c)[_0xd47f('0x13')](function(_0x4bff08){_0xc690c3(null,_0x4bff08?_0x4bff08['name']:![]);})['catch'](function(_0x4dc109){_0xc690c3(_0x4dc109);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x1f')]=function(_0x5e2514,_0x597440){var _0x46131e=this;this[_0xd47f('0xf')]['getSoundById'](_0x5e2514)[_0xd47f('0x13')](function(_0x375476){_0x597440(null,_0x375476?_0x46131e[_0xd47f('0x20')](_0x375476[_0xd47f('0x21')]):![]);})[_0xd47f('0x15')](function(_0x2e4777){_0x597440(_0x2e4777);});};AGIVertices['prototype'][_0xd47f('0x22')]=function(_0x591042,_0x3f82b7){this['rpc'][_0xd47f('0x23')](_0x591042)[_0xd47f('0x13')](function(_0xd12466){_0x3f82b7(null,_0xd12466?_0xd12466:![]);})['catch'](function(_0x595b3e){_0x3f82b7(_0x595b3e);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x24')]=function(_0x289fe3,_0x46ce22,_0x4291bb){this[_0xd47f('0x10')][_0xd47f('0x24')](_0x289fe3,_0x46ce22)[_0xd47f('0x13')](function(){_0x4291bb(null);})['catch'](function(_0x25017b){_0x4291bb(_0x25017b);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x25')]=function(_0x433f37,_0x224753){this[_0xd47f('0xf')]['getIntervalById'](_0x433f37)[_0xd47f('0x13')](function(_0xf3165a){if(_0xf3165a){if(_0xf3165a[_0xd47f('0x26')]){_0x224753(null,[_0xf3165a[_0xd47f('0x27')]]);}else{_0x224753(null,_['map'](_0xf3165a[_0xd47f('0x28')],_0xd47f('0x27')));}}else{_0x224753(null,![]);}})[_0xd47f('0x15')](function(_0x5e0472){_0x224753(_0x5e0472);});};AGIVertices['prototype'][_0xd47f('0x20')]=function(_0x12bbe0){return util[_0xd47f('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x12bbe0);};AGIVertices[_0xd47f('0x11')]['getQueryOdbc']=function(_0x1d9429,_0x689672,_0x45cc02){odbc[_0xd47f('0x2a')](_0x1d9429,function(_0xdc1fc){if(_0xdc1fc){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0xdc1fc);_0x45cc02(_0xdc1fc);}else{logger[_0xd47f('0x2b')](_0xd47f('0x2c'));odbc[_0xd47f('0x2d')](_0x689672,function(_0x5499ad,_0x29881e){if(_0x5499ad){logger[_0xd47f('0x2b')](_0xd47f('0x2e'),_0x689672);_0x45cc02(_0x5499ad);}else{logger[_0xd47f('0x2b')](_0xd47f('0x2f'),_0x689672);odbc[_0xd47f('0x30')](function(_0x55804b){if(_0x55804b){logger[_0xd47f('0x31')](_0xd47f('0x32'),_0x55804b);}_0x45cc02(null,_0x29881e);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x1e2437,_0x5d866f){this[_0xd47f('0xf')][_0xd47f('0x33')](_0x1e2437)['then'](function(_0x17ee0b){_0x5d866f(null,_0x17ee0b?_0x17ee0b:![]);})[_0xd47f('0x15')](function(_0x3803fc){_0x5d866f(_0x3803fc);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x34')]=function(_0x582ca1,_0x3a3c07){this['rpc'][_0xd47f('0x34')](_0x582ca1)[_0xd47f('0x13')](function(_0x515ee8){_0x3a3c07(null,_0x515ee8);})['catch'](function(_0x5b2dd3){_0x3a3c07(_0x5b2dd3);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x35')]=function(_0x5567e5,_0x280291,_0x4f636){this[_0xd47f('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xd47f('0xe')][_0xd47f('0x36')],'node':_0x5567e5[_0xd47f('0x37')],'application':_0x5567e5[_0xd47f('0x38')],'data':_0x280291||null,'project_name':this['channel'][_0xd47f('0x39')],'callerid':this['channel'][_0xd47f('0x3a')]})[_0xd47f('0x13')](function(_0x557f7b){if(_0x4f636){_0x4f636(null,_0x557f7b);}})[_0xd47f('0x15')](function(_0x238a2e){if(_0x4f636){_0x4f636(_0x238a2e);}});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x3b')]=function(_0x1d0a7d,_0x768a0d,_0x169383,_0x20dce8){this[_0xd47f('0xf')][_0xd47f('0x3b')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0xd47f('0xe')][_0xd47f('0x3a')],'calleridname':this['channel'][_0xd47f('0x3c')],'context':this[_0xd47f('0xe')]['context'],'extension':this[_0xd47f('0xe')][_0xd47f('0x3d')],'priority':this[_0xd47f('0xe')][_0xd47f('0x3e')],'accountcode':this[_0xd47f('0xe')][_0xd47f('0x3f')],'dnid':this['channel'][_0xd47f('0x40')],'projectName':this[_0xd47f('0xe')]['arg_1'],'saveName':_0x768a0d,'filename':_0x1d0a7d[_0xd47f('0x41')]||_0x768a0d,'savePath':_0x169383})[_0xd47f('0x13')](function(_0x55310b){_0x20dce8(null,_0x55310b);})[_0xd47f('0x15')](function(_0x25d158){_0x20dce8(_0x25d158);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x42')]=function(_0x4814bd,_0x4b613c,_0x4b53f7,_0x165618,_0x530ed3){this['rpc'][_0xd47f('0x42')]({'uniqueid':this['channel'][_0xd47f('0x36')],'body':_0x4814bd,'direction':_0x4b613c,'providerName':_0x4b53f7,'providerResponse':_0x165618})[_0xd47f('0x13')](function(_0x23f1c9){if(_0x530ed3){_0x530ed3(null,_0x23f1c9);}})[_0xd47f('0x15')](function(_0x33d1f6){if(_0x530ed3){_0x530ed3(_0x33d1f6);}});};AGIVertices['prototype']['createCmContact']=function(_0x316678,_0x5655ab){this[_0xd47f('0xf')]['createCmContact']({'firstName':_[_0xd47f('0x43')](_0x316678['name'])||_[_0xd47f('0x44')](_0x316678[_0xd47f('0x14')])?_0xd47f('0x45')+Math['random']():_0x316678[_0xd47f('0x14')],'lastName':_[_0xd47f('0x43')](_0x316678[_0xd47f('0x46')])||_[_0xd47f('0x44')](_0x316678['lastName'])?null:_0x316678[_0xd47f('0x46')],'phone':_0x316678[_0xd47f('0x47')],'ListId':_0x316678[_0xd47f('0x48')],'scheduledat':_0x316678['scheduledAt'],'callbackUniqueid':this['channel'][_0xd47f('0x36')],'tags':_0xd47f('0x49'),'description':'Callback\x20scheduled\x20at\x20'+_0x316678[_0xd47f('0x4a')][_0xd47f('0x4b')](),'priority':_0x316678[_0xd47f('0x4c')]})[_0xd47f('0x13')](function(_0x49087d){_0x5655ab(null,_0x49087d);})['catch'](function(_0x41fc3d){_0x5655ab(_0x41fc3d);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x4d')]=function(_0xe333e2,_0x52c96c){this[_0xd47f('0xf')][_0xd47f('0x4e')](_0xe333e2)[_0xd47f('0x13')](function(_0x50d9fe){_0x52c96c(null,_0x50d9fe?_0x50d9fe[_0xd47f('0x14')]:![]);})[_0xd47f('0x15')](function(_0x273f57){_0x52c96c(_0x273f57);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x4f')]=function(_0x57c84f,_0x19280a,_0x5867a6){var _0x48f0a2={'role':'agent'};_0x48f0a2[_0x57c84f]=this[_0xd47f('0xe')][_0xd47f('0x3a')];this[_0xd47f('0xf')]['agentPause'](_0x48f0a2,_0x19280a,this[_0xd47f('0xe')][_0xd47f('0x36')])[_0xd47f('0x13')](function(_0x17dd9c){_0x5867a6(null,_[_0xd47f('0x44')](_0x17dd9c)?![]:!![]);})['catch'](function(_0x2db7d1){logger[_0xd47f('0x31')](_0x2db7d1);_0x5867a6(null,![]);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x50')]=function(_0x270b65,_0x2c72ee){var _0x19dd7b={'role':_0xd47f('0x51')};_0x19dd7b[_0x270b65]=this[_0xd47f('0xe')][_0xd47f('0x3a')];this[_0xd47f('0xf')]['agentUnpause'](_0x19dd7b)[_0xd47f('0x13')](function(_0x4c40d8){_0x2c72ee(null,_[_0xd47f('0x44')](_0x4c40d8)?![]:!![]);})[_0xd47f('0x15')](function(_0x165cfc){logger[_0xd47f('0x31')](_0x165cfc);_0x2c72ee(null,![]);});};AGIVertices['prototype'][_0xd47f('0x52')]=function(_0x38bfbb,_0x44a2d4){var _0x4fd428={'role':_0xd47f('0x51')};_0x4fd428[_0x38bfbb]=this['channel'][_0xd47f('0x3a')];this[_0xd47f('0xf')]['agentLogout'](_0x4fd428)[_0xd47f('0x13')](function(_0x3cb57d){_0x44a2d4(null,_[_0xd47f('0x44')](_0x3cb57d)?![]:!![]);})['catch'](function(_0x24497e){logger[_0xd47f('0x31')](_0x24497e);_0x44a2d4(null,![]);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x53')]=function(_0x3214b1,_0x19d2ce){var _0x373439={'role':_0xd47f('0x51')};_0x373439[_0x3214b1]=this['channel']['callerid'];var _0x24b4d2=_0x3214b1!=_0xd47f('0x54')?util[_0xd47f('0x29')](_0xd47f('0x55'),'LOCAL',this[_0xd47f('0xe')][_0xd47f('0x3a')]):undefined;this[_0xd47f('0xf')][_0xd47f('0x53')](_0x373439,_0x24b4d2)[_0xd47f('0x13')](function(_0x89f0ed){_0x19d2ce(null,_[_0xd47f('0x44')](_0x89f0ed)?![]:!![]);})[_0xd47f('0x15')](function(_0x1e8bfd){logger[_0xd47f('0x31')](_0x1e8bfd);_0x19d2ce(null,![]);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x56')]=function(_0x2c7fe0,_0x910bd){sh[_0xd47f('0x57')](_[_0xd47f('0x58')](_0x2c7fe0),function(_0x3a8472,_0x912153){var _0x530aa8=_0x912153[_0xd47f('0x59')](/(\r\n|\n|\r)/gm,'');_0x910bd(null,_0x530aa8);});};AGIVertices['prototype'][_0xd47f('0x5a')]=function(_0x43d228,_0x548f02){scripts[_0xd47f('0x5a')](_0x43d228[_0xd47f('0x5b')],_0x43d228['google_cloud_tts_text_type']||_0xd47f('0x5c'),_0x43d228['text'],_0x43d228['languageCode']||_0xd47f('0x5d'),_0x43d228[_0xd47f('0x5e')]||_0xd47f('0x5f'),_0x43d228[_0xd47f('0x60')]||_0xd47f('0x61'))[_0xd47f('0x13')](function(_0x1e51f8){_0x548f02(null,_0x1e51f8);})[_0xd47f('0x15')](function(_0x56bfd9){_0x548f02(_0x56bfd9);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x62')]=function(_0xc49631,_0x2e37c8){scripts[_0xd47f('0x62')](_0xc49631[_0xd47f('0x5c')],_0xc49631['google_tts_language']||'en',0x1)[_0xd47f('0x13')](function(_0x5c530a){_0x2e37c8(null,_0x5c530a);})['catch'](function(_0x29b06d){_0x2e37c8(_0x29b06d);});};AGIVertices['prototype'][_0xd47f('0x63')]=function(_0x282b34,_0x26108b){var _0x27889f={'uri':_0x282b34[_0xd47f('0x64')],'method':_0x282b34['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x282b34[_0xd47f('0x65')])===_0xd47f('0x66')&&parseInt(_0x282b34[_0xd47f('0x65')])>=0x1?parseInt(_0x282b34[_0xd47f('0x65')])*0x3e8:0x5*0x3e8};if(_[_0xd47f('0x67')]([_0xd47f('0x68'),'PUT'],_0x27889f[_0xd47f('0x69')][_0xd47f('0x6a')]())){try{_0x27889f[_0xd47f('0x6b')]=_0x282b34['rawBody']?JSON['parse'](_0x282b34[_0xd47f('0x6c')]):{};}catch(_0x18896c){logger[_0xd47f('0x31')](_0xd47f('0x6d'),_0x18896c);}}try{_0x27889f[_0xd47f('0x6e')]=_0x282b34['rawHeaders']?JSON['parse'](_0x282b34[_0xd47f('0xc')]):{};}catch(_0xf822f8){logger[_0xd47f('0x31')](_0xd47f('0x6f'),_0xf822f8);}if(_0x282b34[_0xd47f('0x70')]){try{var _0x1de1bc=require(_0x282b34[_0xd47f('0x70')])['sync'](this,_0x27889f);_0x27889f[_0xd47f('0x71')]=Mustache[_0xd47f('0x72')](_0x282b34[_0xd47f('0x64')],_0x1de1bc,{},['$$','$$']);if(_0x27889f['headers']){_0x27889f[_0xd47f('0x6e')]=JSON['parse'](Mustache[_0xd47f('0x72')](JSON[_0xd47f('0x73')](_0x27889f[_0xd47f('0x6e')]),_0x1de1bc,{},['$$','$$']));}if(_0x27889f['body']){_0x27889f[_0xd47f('0x6b')]=JSON[_0xd47f('0x74')](Mustache[_0xd47f('0x72')](JSON[_0xd47f('0x73')](_0x27889f[_0xd47f('0x6b')]),_0x1de1bc,{},['$$','$$']));}}catch(_0x39a76d){logger[_0xd47f('0x31')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x39a76d);}}rp(_0x27889f)['then'](function(_0x1353a9){var _0x35c5e0={'statusCode':_0x1353a9['statusCode']||0xc8,'statusMessage':_0x1353a9[_0xd47f('0x75')]||'OK','headers':_0x1353a9[_0xd47f('0x6e')]||{},'body':_0x1353a9[_0xd47f('0x6b')]||{}};_0x26108b(null,_0x35c5e0);})[_0xd47f('0x15')](function(_0x29fdf9){var _0xac1f60={'statusCode':_0x29fdf9[_0xd47f('0x76')]||0x1f4,'statusMessage':_0x29fdf9[_0xd47f('0x77')]||_0xd47f('0x78'),'headers':_0x29fdf9[_0xd47f('0x79')][_0xd47f('0x6e')]||{},'body':_0x29fdf9[_0xd47f('0x79')][_0xd47f('0x6b')]||{}};_0x26108b(null,_0xac1f60);});};AGIVertices[_0xd47f('0x11')]['googleDialogflow']=function(_0x260b6b,_0x2b48ec){scripts[_0xd47f('0x7a')](this['channel'][_0xd47f('0x36')],_0x260b6b[_0xd47f('0x7b')],_0x260b6b[_0xd47f('0x5c')],_0x260b6b[_0xd47f('0x7c')]||'en')[_0xd47f('0x13')](function(_0x5059d5){_0x2b48ec(null,_0x5059d5);})[_0xd47f('0x15')](function(_0xb47773){_0x2b48ec(_0xb47773);});};AGIVertices[_0xd47f('0x11')]['googleDialogflowV2']=function(_0x2c30b2,_0x1b23bb){scripts['googleDialogflowV2'](this[_0xd47f('0xe')][_0xd47f('0x36')],_0x2c30b2[_0xd47f('0x7d')],_0x2c30b2[_0xd47f('0x7e')],_0x2c30b2[_0xd47f('0x7f')],_0x2c30b2[_0xd47f('0x5c')],_0x2c30b2[_0xd47f('0x80')]||'en')['then'](function(_0x2b70a2){_0x1b23bb(null,_0x2b70a2);})['catch'](function(_0x40d6e5){_0x1b23bb(_0x40d6e5);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x81')]=function(_0x4fcc0e,_0x11c6d9){scripts[_0xd47f('0x81')](this['channel'],_0x4fcc0e)[_0xd47f('0x13')](function(_0x17f0a1){_0x11c6d9(null,_0x17f0a1);})['catch'](function(_0x1348ba){_0x11c6d9(_0x1348ba);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x82')]=function(_0x129680,_0x8f5003){scripts[_0xd47f('0x82')](_0x129680[_0xd47f('0x7b')],_0x129680[_0xd47f('0x5c')],_0x129680['ispeech_tts_language']||_0xd47f('0x5d'),_0x129680[_0xd47f('0x83')])[_0xd47f('0x13')](function(_0x46ddf6){_0x8f5003(null,_0x46ddf6);})[_0xd47f('0x15')](function(_0x2a2e27){_0x8f5003(_0x2a2e27);});};AGIVertices['prototype'][_0xd47f('0x84')]=function(_0x14aa22,_0x2afa32,_0x760cdb){scripts[_0xd47f('0x84')](_0x2afa32,_0x14aa22[_0xd47f('0x7b')],_0x14aa22[_0xd47f('0x85')]||_0xd47f('0x5d'),this[_0xd47f('0x86')](_0x14aa22[_0xd47f('0x87')])?_0x14aa22[_0xd47f('0x87')]:undefined)[_0xd47f('0x13')](function(_0x454709){_0x760cdb(null,_0x454709);})[_0xd47f('0x15')](function(_0x267926){_0x760cdb(_0x267926);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x88')]=function(_0x25bff7,_0x56fb72){scripts['awsPolly'](_0x25bff7[_0xd47f('0x89')],_0x25bff7[_0xd47f('0x8a')],_0x25bff7[_0xd47f('0x8b')],_0x25bff7[_0xd47f('0x8c')]||'Amy',_0x25bff7[_0xd47f('0x5c')],_0x25bff7[_0xd47f('0x8d')]||_0xd47f('0x5c'))[_0xd47f('0x13')](function(_0x315ec3){_0x56fb72(null,_0x315ec3);})[_0xd47f('0x15')](function(_0x3b79fa){_0x56fb72(_0x3b79fa);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x8e')]=function(_0x20d3f4,_0x3f961d){scripts[_0xd47f('0x8e')](this[_0xd47f('0xe')][_0xd47f('0x36')],_0x20d3f4[_0xd47f('0x89')],_0x20d3f4['aws_secret_access_key'],_0x20d3f4[_0xd47f('0x8f')],_0x20d3f4['text'],_0x20d3f4[_0xd47f('0x90')])['then'](function(_0x2837b5){_0x3f961d(null,_0x2837b5);})[_0xd47f('0x15')](function(_0x3a29f3){_0x3f961d(_0x3a29f3);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x91')]=function(_0x2091cf,_0x49ce80,_0x36c38e){scripts[_0xd47f('0x91')](_0x49ce80,_0x2091cf[_0xd47f('0x7b')],_0x2091cf[_0xd47f('0x92')]||_0xd47f('0x5d'))[_0xd47f('0x13')](function(_0x4b088f){_0x36c38e(null,_0x4b088f);})['catch'](function(_0x2d694c){_0x36c38e(_0x2d694c);});};AGIVertices[_0xd47f('0x11')][_0xd47f('0x93')]=function(_0x4ac4a9,_0xe9c54e,_0xd142d9){scripts['tildeASR'](_0xe9c54e,_0x4ac4a9[_0xd47f('0x94')],_0x4ac4a9['appsecret'],_0x4ac4a9['uri'])[_0xd47f('0x13')](function(_0x44c951){_0xd142d9(null,_0x44c951);})[_0xd47f('0x15')](function(_0x4b0a97){_0xd142d9(_0x4b0a97);});};AGIVertices['prototype']['clear']=function(_0x25a339){var _0x17c300=_[_0xd47f('0x67')](verticesWithRetry,_0x25a339[_0xd47f('0x38')])?_0x25a339:_['clone'](_0x25a339);for(var _0x43cda5 in _0x17c300){if(_0x17c300[_0xd47f('0x95')](_0x43cda5)){if(_0x17c300[_0x43cda5]&&_[_0xd47f('0x96')](_0x17c300[_0x43cda5])){if(_[_0xd47f('0x67')](recursiveMapAttributes,_0x43cda5)){_0x17c300[_0x43cda5]=this['replaceObjectAllVariables'](_0x17c300[_0x43cda5]);}else{_0x17c300[_0x43cda5]=this[_0xd47f('0x97')](_0x17c300[_0x43cda5]);}}}}return _0x17c300;};AGIVertices[_0xd47f('0x11')][_0xd47f('0x98')]=function(_0x46affd){for(var _0x40f590 in _0x46affd){if(_0x46affd[_0xd47f('0x95')](_0x40f590)){if(_[_0xd47f('0x99')](_0x46affd[_0x40f590])){this['recursiveNodeIndex'](_0x46affd[_0x40f590]);}else if(_[_0xd47f('0x9a')](_0x46affd[_0x40f590])){for(var _0x1caa7a=0x0;_0x1caa7a<_0x46affd[_0x40f590]['length'];_0x1caa7a++){this['recursiveNodeIndex'](_0x46affd[_0x40f590][_0x1caa7a]);}}else if(_['isString'](_0x46affd[_0x40f590])){_0x46affd[_0x40f590]=this['replaceAllVariables'](_0x46affd[_0x40f590]);}}}};AGIVertices['prototype'][_0xd47f('0x9b')]=function(_0x2b7bf3,_0x44562a){for(var _0x21bf1f in _0x2b7bf3){if(_0x2b7bf3[_0xd47f('0x95')](_0x21bf1f)){if(_[_0xd47f('0x99')](_0x2b7bf3[_0x21bf1f])){if(!_[_0xd47f('0x43')](_0x2b7bf3[_0x21bf1f])){this[_0xd47f('0x9b')](_0x2b7bf3[_0x21bf1f],util[_0xd47f('0x29')](_0xd47f('0x9c'),_0x44562a,_0x21bf1f));}}else if(_[_0xd47f('0x9a')](_0x2b7bf3[_0x21bf1f])){for(var _0x5b57c6=0x0;_0x5b57c6<_0x2b7bf3[_0x21bf1f][_0xd47f('0x9d')];_0x5b57c6++){this[_0xd47f('0x9b')](_0x2b7bf3[_0x21bf1f][_0x5b57c6],util['format'](_0xd47f('0x9c'),_0x44562a,_0x21bf1f+'['+_0x5b57c6+']'));}}else{if(!_[_0xd47f('0x44')](_0x2b7bf3[_0x21bf1f])){this['channel'][_0xd47f('0x9e')](util['format'](_0xd47f('0x9c'),_0x44562a,_0x21bf1f),_0x2b7bf3[_0x21bf1f]);}}}}};AGIVertices[_0xd47f('0x11')][_0xd47f('0x9f')]=function(_0x38a6f7){try{var _0x239df1=JSON[_0xd47f('0x74')](_0x38a6f7);this[_0xd47f('0x98')](_0x239df1);return JSON['stringify'](_0x239df1);}catch(_0x38505f){return this[_0xd47f('0x97')](_0x38a6f7);}};AGIVertices[_0xd47f('0x11')][_0xd47f('0x97')]=function(_0x4dff37){var _0x3a784c=_0x4dff37[_0xd47f('0xa0')]('{');for(var _0x5f1350=0x1;_0x5f1350<_0x3a784c[_0xd47f('0x9d')];_0x5f1350+=0x1){var _0x3f0ea2=_0x3a784c[_0x5f1350][_0xd47f('0xa0')]('}');if(_0x3f0ea2['length']>0x1){_0x4dff37=_0x4dff37[_0xd47f('0xa1')]('{'+_0x3f0ea2[0x0]+'}',this[_0xd47f('0xe')][_0xd47f('0xa2')](_0x3f0ea2[0x0])[_0xd47f('0xa3')]||_0x3f0ea2[0x0]);}}if(_0x3a784c[_0xd47f('0x9d')]===0x1){return _0x4dff37[_0xd47f('0x4b')]();}return this[_0xd47f('0x97')](_0x4dff37);};AGIVertices['prototype']['getAndSetVariable']=function(_0xf2a8a2,_0x59a02c){var _0x5efd25=this[_0xd47f('0xe')][_0xd47f('0xa2')](_0xf2a8a2);if(_0x5efd25[_0xd47f('0xa4')]===-0x1){return _0x5efd25;}logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x59a02c,_0x5efd25[_0xd47f('0xa3')]));return this[_0xd47f('0xe')]['setVariable'](_0x59a02c,_0x5efd25[_0xd47f('0xa3')]);};AGIVertices[_0xd47f('0x11')]['isConfigured']=function(_0x1f9cd2){return _0x1f9cd2&&_0x1f9cd2!=='0'&&_0x1f9cd2!=='-1'&&_0x1f9cd2!=='';};AGIVertices['prototype']['maxRetry']=function(_0x5f5700){this[_0xd47f('0x35')][_0xd47f('0xa5')](this,_0x5f5700,'-');_0x5f5700[_0xd47f('0xa6')]=_0x5f5700['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd47f('0x11')][_0xd47f('0xa7')]=function(_0x18664b){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0xa8'),_0x18664b[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x18664b['text'])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaa'));}var _0x4d4745='\x22'+_0x18664b[_0xd47f('0x5c')]+'\x22';if(this[_0xd47f('0x86')](_0x18664b[_0xd47f('0x79')])){_0x4d4745+=','+_0x18664b[_0xd47f('0x79')];}var _0x2a0695=this[_0xd47f('0xe')]['exec']('MRCPSynth',_0x4d4745);if(_0x2a0695['result']===-0x1){return _0x2a0695;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xab'),_0x4d4745));};AGIVertices[_0xd47f('0x11')][_0xd47f('0xac')]=function(_0x1bb1d6){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0xad'),_0x1bb1d6[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x1bb1d6[_0xd47f('0xae')])){return this['channel'][_0xd47f('0xa9')](_0xd47f('0xaf'));}var _0x5a5922=_0x1bb1d6['grammar'];if(this[_0xd47f('0x86')](_0x1bb1d6[_0xd47f('0x79')])){_0x5a5922+=','+_0x1bb1d6[_0xd47f('0x79')];}var _0x2c45f6=this['channel'][_0xd47f('0x57')](_0xd47f('0xb0'),_0x5a5922);if(_0x2c45f6[_0xd47f('0xa4')]===-0x1){return _0x2c45f6;}var _0x53e80b=this['getAndSetVariable'](_0xd47f('0xb1'),_0xd47f('0xb2'));if(_0x53e80b[_0xd47f('0xa4')]===-0x1){return _0x53e80b;}var _0x40c2fc=this['getAndSetVariable'](_0xd47f('0xb3'),_0xd47f('0xb4'));if(_0x40c2fc[_0xd47f('0xa4')]===-0x1){return _0x40c2fc;}var _0x55c45e=this[_0xd47f('0xb5')]('RECOG_INSTANCE()',_0xd47f('0xb6'));if(_0x55c45e['result']===-0x1){return _0x55c45e;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xb7'),_0x5a5922));};AGIVertices['prototype'][_0xd47f('0x9')]=function(_0x2b6769){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0xb8'),_0x2b6769['label']));return this['channel'][_0xd47f('0x9')]([_0x2b6769[_0xd47f('0xb9')],_0x2b6769['args']]);};AGIVertices[_0xd47f('0x11')][_0xd47f('0xba')]=function(_0x4526d3){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0xbb'),_0x4526d3[_0xd47f('0x37')]));if(this['isConfigured'](_0x4526d3[_0xd47f('0x65')])){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0xbc'),_0x4526d3['timeout']));var _0x1ecccd=this[_0xd47f('0xe')][_0xd47f('0xbd')](_0x4526d3[_0xd47f('0x65')]);if(_0x1ecccd[_0xd47f('0xa4')]===-0x1){return _0x1ecccd;}}return this['channel'][_0xd47f('0xba')]();};AGIVertices[_0xd47f('0x11')][_0xd47f('0x49')]=function(_0x5281cb){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5281cb['label']));if(!this[_0xd47f('0x86')](_0x5281cb['list_id'])){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x5281cb,_0xd47f('0xbe'));}_0x5281cb[_0xd47f('0x4a')]=moment();if(this[_0xd47f('0x86')](_0x5281cb[_0xd47f('0xbf')])){_0x5281cb[_0xd47f('0x4a')]=moment()['add'](_0x5281cb[_0xd47f('0xbf')],_0xd47f('0xc0'));}if(!this[_0xd47f('0x86')](_0x5281cb[_0xd47f('0x4c')])){_0x5281cb[_0xd47f('0x4c')]=0x2;}this[_0xd47f('0xc1')][_0xd47f('0xa5')](this,_0x5281cb);return this['channel'][_0xd47f('0xa9')](util['format'](_0xd47f('0xc2'),_0x5281cb[_0xd47f('0x47')],_0x5281cb[_0xd47f('0x48')],_0x5281cb['scheduledAt']));};AGIVertices[_0xd47f('0x11')]['custom_app']=function(_0x5a7b6a){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0xc3'),_0x5a7b6a[_0xd47f('0x37')]));var _0x579fb5=this[_0xd47f('0xe')][_0xd47f('0x57')](_0x5a7b6a[_0xd47f('0xc4')],_0x5a7b6a[_0xd47f('0x79')]);if(_0x579fb5['result']===-0x1){return _0x579fb5;}return this[_0xd47f('0xe')]['noop'](util['format'](_0xd47f('0xc5'),_0x5a7b6a[_0xd47f('0xc4')],_0x5a7b6a[_0xd47f('0x79')]));};AGIVertices[_0xd47f('0x11')][_0xd47f('0xc6')]=function(_0x34dece){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x34dece[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x34dece['text'])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaa'));}var _0x4b6cd0='\x22'+_0x34dece[_0xd47f('0x5c')]+'\x22';if(this[_0xd47f('0x86')](_0x34dece[_0xd47f('0x79')])){_0x4b6cd0+=','+_0x34dece[_0xd47f('0x79')];}var _0x25c8b3=this[_0xd47f('0xe')]['exec'](_0xd47f('0xc7'),_0x4b6cd0);if(_0x25c8b3[_0xd47f('0xa4')]===-0x1){return _0x25c8b3;}return this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')](_0xd47f('0xab'),_0x4b6cd0));};AGIVertices[_0xd47f('0x11')]['sestektts']=function(_0x553a56){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x553a56[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x553a56[_0xd47f('0x5c')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaa'));}var _0xe4d2b='\x22'+_0x553a56[_0xd47f('0x5c')]+'\x22';if(this[_0xd47f('0x86')](_0x553a56['options'])){_0xe4d2b+=','+_0x553a56[_0xd47f('0x79')];}var _0x42d8db=this[_0xd47f('0xe')][_0xd47f('0x57')](_0xd47f('0xc7'),_0xe4d2b);if(_0x42d8db[_0xd47f('0xa4')]===-0x1){return _0x42d8db;}return this['channel']['noop'](util['format'](_0xd47f('0xab'),_0xe4d2b));};AGIVertices[_0xd47f('0x11')][_0xd47f('0xc8')]=function(_0x109a51){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x109a51[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x109a51[_0xd47f('0xae')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaf'));}var _0x982659=_0x109a51[_0xd47f('0xae')];if(this[_0xd47f('0x86')](_0x109a51['options'])){_0x982659+=','+_0x109a51['options'];}var _0x58f57=this[_0xd47f('0xe')]['exec'](_0xd47f('0xb0'),_0x982659);if(_0x58f57[_0xd47f('0xa4')]===-0x1){return _0x58f57;}var _0x161215=this[_0xd47f('0xb5')](_0xd47f('0xb1'),'LUMENVOX_ASR_CONFIDENCE');if(_0x161215[_0xd47f('0xa4')]===-0x1){return _0x161215;}var _0x3fd4f8=this[_0xd47f('0xb5')](_0xd47f('0xb3'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3fd4f8[_0xd47f('0xa4')]===-0x1){return _0x3fd4f8;}var _0x5771b6=this['getAndSetVariable'](_0xd47f('0xc9'),_0xd47f('0xca'));if(_0x5771b6[_0xd47f('0xa4')]===-0x1){return _0x5771b6;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xb7'),_0x982659));};AGIVertices[_0xd47f('0x11')][_0xd47f('0xcb')]=function(_0x25c411){logger['info'](util[_0xd47f('0x29')](_0xd47f('0xcc'),_0x25c411[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x25c411[_0xd47f('0xae')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaf'));}var _0x19f7af=_0x25c411['grammar'];if(this[_0xd47f('0x86')](_0x25c411[_0xd47f('0x79')])){_0x19f7af+=','+_0x25c411['options'];}var _0x3a6810=this[_0xd47f('0xe')]['exec']('MRCPRecog',_0x19f7af);if(_0x3a6810[_0xd47f('0xa4')]===-0x1){return _0x3a6810;}var _0x5195c8=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xd47f('0xcd'));if(_0x5195c8[_0xd47f('0xa4')]===-0x1){return _0x5195c8;}var _0x51647f=this[_0xd47f('0xb5')](_0xd47f('0xb3'),_0xd47f('0xce'));if(_0x51647f['result']===-0x1){return _0x51647f;}var _0x3449ff=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x3449ff[_0xd47f('0xa4')]===-0x1){return _0x3449ff;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x19f7af));};AGIVertices[_0xd47f('0x11')]['database']=function(_0x1b4820){logger[_0xd47f('0x2b')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x1b4820[_0xd47f('0x37')]));if(!this['isConfigured'](_0x1b4820[_0xd47f('0xcf')])){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x1b4820,_0xd47f('0xd0'));}var _0x5affb9=this['getSquareOdbc'][_0xd47f('0xa5')](this,_0x1b4820['odbc_id']);if(!_0x5affb9){return this['channel']['error'](_0x1b4820,_0xd47f('0xd1'));}if(!this['isConfigured'](_0x1b4820[_0xd47f('0x2d')])){return this['channel'][_0xd47f('0x31')](_0x1b4820,'no\x20query\x20configured');}var _0x2503c1=_0x1b4820[_0xd47f('0x2d')][_0xd47f('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')]('query:\x20%s',_0x2503c1));var _0x24c386=this[_0xd47f('0xd2')][_0xd47f('0xa5')](this,_0x5affb9,_0x2503c1);this['createSquareDetailsReport'][_0xd47f('0xa5')](this,_0x1b4820,_0x2503c1);if(!this[_0xd47f('0x86')](_0x1b4820['variable_id'])){return this[_0xd47f('0xe')][_0xd47f('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x8a3766=this['getVariable'][_0xd47f('0xa5')](this,_0x1b4820[_0xd47f('0xd3')]);if(!_0x8a3766){return this['channel'][_0xd47f('0x31')](_0x1b4820,_0xd47f('0xd4'));}var _0xb96d26=this;_0x24c386[_0xd47f('0xd5')](function(_0x37b492,_0x43d3f3){Object[_0xd47f('0xd6')](_0x37b492)['forEach'](function(_0x550245){_0xb96d26[_0xd47f('0xe')][_0xd47f('0x9e')](util[_0xd47f('0x29')](_0xd47f('0xd7'),_0x8a3766,_0x43d3f3,_0x550245),_0x37b492[_0x550245]);});});this[_0xd47f('0xe')][_0xd47f('0x9e')](util['format']('%s_ROWS_COUNT',_0x8a3766),_0x24c386[_0xd47f('0x9d')]);return this[_0xd47f('0xe')][_0xd47f('0xa9')](util['format']('variable\x20%s\x20set',_0x8a3766));};AGIVertices[_0xd47f('0x11')][_0xd47f('0xd8')]=function(_0x438e0e){logger[_0xd47f('0xd9')](util[_0xd47f('0x29')](_0xd47f('0xda'),_0x438e0e[_0xd47f('0x37')]));if(!this['isConfigured'](_0x438e0e['sip_id'])){return this['channel']['error'](_0x438e0e,_0xd47f('0xdb'));}var _0x4a2874=this[_0xd47f('0xdc')][_0xd47f('0xa5')](this,_0x438e0e[_0xd47f('0xdd')]);if(!_0x4a2874){return this['channel'][_0xd47f('0x31')](_0x438e0e,_0xd47f('0xde'));}var _0x107204=this[_0xd47f('0xe')][_0xd47f('0x57')]('DIAL',[util[_0xd47f('0x29')](_0xd47f('0xdf'),_0x4a2874),_0x438e0e[_0xd47f('0x65')],_0x438e0e[_0xd47f('0xe0')],_0x438e0e[_0xd47f('0x64')]]);if(_0x107204[_0xd47f('0xa4')]===-0x1){return _0x107204;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xe1'),_0xd47f('0xe2')));};AGIVertices[_0xd47f('0x11')][_0xd47f('0xe3')]=function(_0x35040d){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0xe4'),_0x35040d['label']));if(!this[_0xd47f('0x86')](_0x35040d['key'])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xe5'));}if(!this[_0xd47f('0x86')](_0x35040d['text'])){return this[_0xd47f('0xe')][_0xd47f('0xa9')]('no\x20text\x20configured');}this[_0xd47f('0xe')][_0xd47f('0xe6')]=!![];this[_0xd47f('0x35')](_0x35040d);this['createSquareMessage'](_0x35040d[_0xd47f('0x5c')],'in','','');this[_0xd47f('0xe')][_0xd47f('0xa9')](util['format'](_0xd47f('0xe7'),_0x35040d[_0xd47f('0x5c')]));var _0x3cdef5=this[_0xd47f('0x7a')][_0xd47f('0xa5')](this,_0x35040d);if(_0x3cdef5){for(var _0x5e9982 in _0x3cdef5){if(_0x3cdef5[_0xd47f('0x95')](_0x5e9982)){this['channel'][_0xd47f('0x9e')](util['format'](_0xd47f('0xe8'),_0x5e9982['toUpperCase']()),_0x3cdef5[_0x5e9982]);}}this['createSquareMessage'](_0x3cdef5[_0xd47f('0xe9')],_0xd47f('0xea'),_0xd47f('0xe3'),'');return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')]('Dialogflow\x20Result\x20%s',_0x3cdef5[_0xd47f('0xe9')]));}return this[_0xd47f('0xe')]['error'](_0x35040d,_0xd47f('0xeb'));};AGIVertices[_0xd47f('0x11')][_0xd47f('0xec')]=function(_0x34ffae){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0xed'),_0x34ffae[_0xd47f('0x37')]));if(!this['isConfigured'](_0x34ffae[_0xd47f('0x7d')])){return this[_0xd47f('0xe')]['noop']('no\x20project_id\x20configured');}if(!this[_0xd47f('0x86')](_0x34ffae[_0xd47f('0x7e')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xee'));}if(!this[_0xd47f('0x86')](_0x34ffae['private_key'])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xef'));}if(!this[_0xd47f('0x86')](_0x34ffae[_0xd47f('0x80')])){return this['channel'][_0xd47f('0xa9')](_0xd47f('0xf0'));}if(!this['isConfigured'](_0x34ffae[_0xd47f('0x5c')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaa'));}this[_0xd47f('0xe')][_0xd47f('0xe6')]=!![];this[_0xd47f('0x35')](_0x34ffae);this[_0xd47f('0x42')](_0x34ffae['text'],'in','','');this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x34ffae['text']));var _0x1a097a=this[_0xd47f('0xf1')]['sync'](this,_0x34ffae);if(_0x1a097a){for(var _0x45ae38 in _0x1a097a){if(_0x1a097a['hasOwnProperty'](_0x45ae38)){if(_0x45ae38!=='providerResponse'){this['channel'][_0xd47f('0x9e')](util[_0xd47f('0x29')]('DIALOGFLOW_%s',_0x45ae38[_0xd47f('0x6a')]()),_0x1a097a[_0x45ae38]);}}}this['createSquareMessage'](_0x1a097a['speech'],_0xd47f('0xea'),_0xd47f('0xec'),_0x1a097a[_0xd47f('0xf2')]);return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xf3'),_0x1a097a['speech']));}return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x34ffae,_0xd47f('0xf4'));};AGIVertices[_0xd47f('0x11')]['sesteknda']=function(_0x3fec52){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0xf5'),_0x3fec52[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x3fec52[_0xd47f('0xf6')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xf7'));}if(!this['isConfigured'](_0x3fec52[_0xd47f('0xf8')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xf9'));}if(!this[_0xd47f('0x86')](_0x3fec52[_0xd47f('0xfa')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xfb'));}if(!this[_0xd47f('0x86')](_0x3fec52['ndassistant_url'])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaa'));}this[_0xd47f('0xe')][_0xd47f('0xe6')]=!![];this[_0xd47f('0x35')](_0x3fec52);this[_0xd47f('0x42')](_0x3fec52['text'],'in','','');this[_0xd47f('0xe')][_0xd47f('0xa9')](util['format'](_0xd47f('0xfc'),_0x3fec52[_0xd47f('0x5c')]));var _0x4f5b1f=this[_0xd47f('0x81')][_0xd47f('0xa5')](this,_0x3fec52);if(_0x4f5b1f){for(var _0x479557 in _0x4f5b1f){if(_0x4f5b1f[_0xd47f('0x95')](_0x479557)){this[_0xd47f('0xe')][_0xd47f('0x9e')](util[_0xd47f('0x29')](_0xd47f('0xfd'),_0x479557['toUpperCase']()),_0x4f5b1f[_0x479557]);}}this[_0xd47f('0x42')](_0x4f5b1f[_0xd47f('0xe9')],_0xd47f('0xea'),'sesteknda','');if(_0x4f5b1f[_0xd47f('0xfe')]){this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xff'),_0x4f5b1f[_0xd47f('0xfe')]));var _0x1ffab8=this[_0xd47f('0xe')][_0xd47f('0x100')](_0x4f5b1f[_0xd47f('0xfe')]);try{fs[_0xd47f('0x101')](_0x4f5b1f[_0xd47f('0xfe')]+_0xd47f('0x102'));}catch(_0x5208f5){logger[_0xd47f('0x31')](_0x5208f5);}return _0x1ffab8;}else{return this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')](_0xd47f('0x103'),_0x4f5b1f['speech']));}}return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x3fec52,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xd47f('0x11')]['end']=function(_0x22e49e){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x104'),_0x22e49e[_0xd47f('0x37')]));return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0x105'));};AGIVertices['prototype'][_0xd47f('0x106')]=function(_0x46083d){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x107'),_0x46083d['label']));var _0x4b2df3='';if(_0x46083d[_0xd47f('0x108')]){if(!this[_0xd47f('0x86')](_0x46083d['trunk_id'])){return this[_0xd47f('0xe')]['error'](_0x46083d,'no\x20trunk\x20selected');}else{var _0x184a1b=parseInt(_0x46083d['trunk_id'],0xa);if(isNaN(_0x184a1b)){_0x4b2df3=_0x46083d[_0xd47f('0x108')];}else{_0x4b2df3=this[_0xd47f('0x1e')][_0xd47f('0xa5')](this,_0x46083d[_0xd47f('0x108')]);if(!_0x4b2df3){return this[_0xd47f('0xe')]['error'](_0x46083d,_0xd47f('0x109'));}}}}else if(_0x46083d[_0xd47f('0x10a')]){_0x4b2df3=_0x46083d[_0xd47f('0x10a')];}else{return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x46083d,_0xd47f('0x10b'));}var _0x5cd024=this['channel'][_0xd47f('0x57')](_0xd47f('0xe2'),[util[_0xd47f('0x29')](_0xd47f('0x10c'),_0x4b2df3,_0x46083d[_0xd47f('0x47')]),_0x46083d[_0xd47f('0x65')],_0x46083d[_0xd47f('0xe0')],_0x46083d['url']]);if(_0x5cd024[_0xd47f('0xa4')]===-0x1){return _0x5cd024;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xe1'),_0xd47f('0xe2')));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x10d')]=function(_0x44bd24){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x10e'),_0x44bd24[_0xd47f('0x37')]));return this['channel'][_0xd47f('0xa9')](_0xd47f('0x10d'));};AGIVertices['prototype'][_0xd47f('0xd')]=function(_0x470664){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x10f'),_0x470664[_0xd47f('0x37')]));if(_0x470664[_0xd47f('0xa6')]===0x0){return this[_0xd47f('0x110')](_0x470664);}_0x470664[_0xd47f('0xa6')]-=0x1;if(!this['isConfigured'](_0x470664[_0xd47f('0x111')])){return this[_0xd47f('0xe')]['error'](_0x470664,_0xd47f('0x112'));}var _0x32c643=this[_0xd47f('0x1f')]['sync'](this,_0x470664[_0xd47f('0x111')]);if(!_0x32c643){return this['channel'][_0xd47f('0x31')](_0x470664,_0xd47f('0x113'));}if(!this['isConfigured'](_0x470664['variable_id'])){return this[_0xd47f('0xe')]['error'](_0xd47f('0x114'));}var _0x106e71=this['channel']['getData'](_0x32c643,_0x470664['response'],_0x470664[_0xd47f('0x115')]);var _0x2059dd=_0x106e71[_0xd47f('0xa4')]?_0x106e71[_0xd47f('0xa4')]['toString']():'';logger[_0xd47f('0x2b')]('test',JSON['stringify'](_0x106e71));if(_0x106e71[_0xd47f('0xa4')]===-0x1){this[_0xd47f('0x35')][_0xd47f('0xa5')](this,_0x470664,_0x2059dd);return _0x106e71;}else if(_0x106e71[_0xd47f('0xa3')]===_0xd47f('0x65')){_0x106e71[_0xd47f('0xa4')]=_0x2059dd[_0xd47f('0x9d')]>=parseInt(_0x470664[_0xd47f('0x116')])?'x':'i';}else{_0x106e71[_0xd47f('0xa4')]=_0x2059dd['length']>=parseInt(_0x470664[_0xd47f('0x116')])&&_0x2059dd[_0xd47f('0x9d')]<=parseInt(_0x470664[_0xd47f('0x115')])?'x':'i';}var _0x279990=this[_0xd47f('0xa2')][_0xd47f('0xa5')](this,_0x470664[_0xd47f('0xd3')]);if(!_0x279990){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x470664,'no\x20variable\x20found');}this['channel'][_0xd47f('0x9e')](_0x279990,_0x2059dd);if(this[_0xd47f('0x86')](_0x470664[_0xd47f('0x117')])){var _0x4bcd30=parseInt(_0x470664[_0xd47f('0x117')],0xa);var _0x5aba04=rs['generate']({'charset':'*','length':_0x4bcd30});var _0x31de10=_0x2059dd[_0xd47f('0x9d')];if(_0x31de10>0x0){if(_0x31de10>_0x4bcd30){this[_0xd47f('0x35')][_0xd47f('0xa5')](this,_0x470664,_0x470664['hiddendigitspos']==='first'?_0x5aba04+_0x2059dd[_0xd47f('0x118')](_0x4bcd30):_0x2059dd[_0xd47f('0x118')](0x0,_0x31de10-_0x4bcd30)+_0x5aba04);}else{this[_0xd47f('0x35')]['sync'](this,_0x470664,rs[_0xd47f('0x119')]({'charset':'*','length':_0x31de10}));}}else{this[_0xd47f('0x35')][_0xd47f('0xa5')](this,_0x470664,'');}}else{this[_0xd47f('0x35')][_0xd47f('0xa5')](this,_0x470664,_0x2059dd);}return _0x106e71;};AGIVertices[_0xd47f('0x11')][_0xd47f('0x11a')]=function(_0x4763e3){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x11b'),_0x4763e3[_0xd47f('0x37')]));return this[_0xd47f('0xd')](_0x4763e3);};AGIVertices[_0xd47f('0x11')][_0xd47f('0x11c')]=function(_0x5b2cfb){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x11d'),_0x5b2cfb[_0xd47f('0x37')]));this[_0xd47f('0x35')]['sync'](this,_0x5b2cfb,_0x5b2cfb[_0xd47f('0x11e')]);return this['channel']['noop'](util[_0xd47f('0x29')](_0xd47f('0x11f'),_0x5b2cfb['goalname']));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x120')]=function(_0x42e871){logger['info'](util[_0xd47f('0x29')](_0xd47f('0x121'),_0x42e871[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x42e871[_0xd47f('0x89')])||!this[_0xd47f('0x86')](_0x42e871[_0xd47f('0x8a')])){return this[_0xd47f('0xe')]['noop'](_0xd47f('0x122'));}if(!this[_0xd47f('0x86')](_0x42e871[_0xd47f('0x5c')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaa'));}this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')](_0xd47f('0x123'),_0x42e871[_0xd47f('0x5c')]));var _0x6e2bfa=this[_0xd47f('0x88')][_0xd47f('0xa5')](this,_0x42e871);if(_0x6e2bfa){this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x6e2bfa));var _0x4b1878=this[_0xd47f('0xe')][_0xd47f('0x100')](_0x6e2bfa);try{fs[_0xd47f('0x101')](_0x6e2bfa+_0xd47f('0x102'));}catch(_0x4b63f4){logger[_0xd47f('0x31')](_0x4b63f4);}return _0x4b1878;}return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x42e871,_0xd47f('0x124'));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x125')]=function(_0x130aad){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x126'),_0x130aad[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x130aad[_0xd47f('0x89')])||!this[_0xd47f('0x86')](_0x130aad[_0xd47f('0x8a')])){return this['channel'][_0xd47f('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xd47f('0x86')](_0x130aad['aws_bot_name'])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0x127'));}if(!this['isConfigured'](_0x130aad[_0xd47f('0x5c')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')]('no\x20text\x20configured');}this[_0xd47f('0xe')][_0xd47f('0xe6')]=!![];this['createSquareDetailsReport'](_0x130aad);this[_0xd47f('0x42')](_0x130aad['text'],'in','','');this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x128'),_0x130aad[_0xd47f('0x5c')]));var _0x110a89=this['awsLex'][_0xd47f('0xa5')](this,_0x130aad);if(_0x110a89){for(var _0x1373db in _0x110a89){if(_0x110a89[_0xd47f('0x95')](_0x1373db)&&_['isString'](_0x110a89[_0x1373db])){this[_0xd47f('0xe')][_0xd47f('0x9e')](util[_0xd47f('0x29')](_0xd47f('0x129'),_0x1373db['toUpperCase']()),_0x110a89[_0x1373db]);}}if(_[_0xd47f('0x44')](_0x110a89[_0xd47f('0x77')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0x12a'));}else{this['createSquareMessage'](_0x110a89[_0xd47f('0x77')],_0xd47f('0xea'),_0xd47f('0x12b'),'');return this['channel'][_0xd47f('0xa9')](util[_0xd47f('0x29')]('Amazon\x20Lex\x20Result\x20%s',_0x110a89['message']));}}return this[_0xd47f('0xe')]['error'](_0x130aad,_0xd47f('0x12c'));};AGIVertices[_0xd47f('0x11')]['googleasr']=function(_0x108142){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x108142[_0xd47f('0x37')],_0x108142[_0xd47f('0x65')]));if(!this[_0xd47f('0x86')](_0x108142[_0xd47f('0x7b')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')]('no\x20key\x20configured');}var _0x3b4e6b='wav';var _0x2ecb53=util[_0xd47f('0x29')](_0xd47f('0x12d'),FILES_PATH,rs[_0xd47f('0x119')](0x4));var _0x5a1883=util[_0xd47f('0x29')]('%s.%s',_0x2ecb53,_0x3b4e6b);var _0x15625c=!![];if(_0x108142[_0xd47f('0x12e')]===_0xd47f('0x12f')){_0x15625c=![];}var _0x5bff56=this['channel'][_0xd47f('0x130')](_0x2ecb53,_0x3b4e6b,_0x108142[_0xd47f('0x131')],_0x108142[_0xd47f('0x65')],undefined,_0x15625c);if(_0x5bff56['result']!==-0x1){this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')]('google\x20%s\x20file\x20created',_0x5a1883));var _0x433c12=this[_0xd47f('0x91')]['sync'](this,_0x108142,_0x5a1883);if(_0x433c12){for(var _0x4d0d2 in _0x433c12){if(_0x433c12[_0xd47f('0x95')](_0x4d0d2)){this[_0xd47f('0xe')][_0xd47f('0x9e')](util[_0xd47f('0x29')](_0xd47f('0x132'),_0x4d0d2[_0xd47f('0x6a')]()),_0x433c12[_0x4d0d2]);}}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')]('GoogleASR\x20Result\x20%s',JSON[_0xd47f('0x73')](_0x433c12)));}}return _0x5bff56;};AGIVertices[_0xd47f('0x11')][_0xd47f('0x133')]=function(_0x3492f0){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x134'),_0x3492f0['label']));if(!this[_0xd47f('0x86')](_0x3492f0[_0xd47f('0x94')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0x135'));}if(!this[_0xd47f('0x86')](_0x3492f0[_0xd47f('0x136')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0x137'));}var _0xdbdf90='wav';var _0x1803af=util['format'](_0xd47f('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x3b9ccc=util[_0xd47f('0x29')](_0xd47f('0x9c'),_0x1803af,_0xdbdf90);var _0xd828d6=!![];if(_0x3492f0['beep']===_0xd47f('0x12f')){_0xd828d6=![];}var _0x2e0dc3=this[_0xd47f('0xe')]['recordFile'](_0x1803af,_0xdbdf90,_0x3492f0[_0xd47f('0x131')],_0x3492f0['timeout'],undefined,_0xd828d6);if(_0x2e0dc3['result']!==-0x1){this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x138'),_0x3b9ccc));var _0x26d3ba=this[_0xd47f('0x93')]['sync'](this,_0x3492f0,_0x3b9ccc);if(_0x26d3ba){for(var _0x5005d9 in _0x26d3ba){if(_0x26d3ba[_0xd47f('0x95')](_0x5005d9)){this['channel']['setVariable'](util['format']('TILDE_ASR_%s',_0x5005d9['toUpperCase']()),_0x26d3ba[_0x5005d9]);}}return this['channel'][_0xd47f('0xa9')](util[_0xd47f('0x29')]('TildeASR\x20Result\x20%s',JSON[_0xd47f('0x73')](_0x26d3ba)));}}return _0x2e0dc3;};AGIVertices[_0xd47f('0x11')]['gotoc']=function(_0x1050ec){logger['info'](util[_0xd47f('0x29')](_0xd47f('0x139'),_0x1050ec['label']));return this[_0xd47f('0xe')][_0xd47f('0x13a')](_0x1050ec[_0xd47f('0x13b')],_0x1050ec[_0xd47f('0x3d')],_0x1050ec[_0xd47f('0x3e')]);};AGIVertices[_0xd47f('0x11')][_0xd47f('0x13c')]=function(_0xaf942f){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x13d'),_0xaf942f['label']));if(!this[_0xd47f('0x86')](_0xaf942f[_0xd47f('0x13e')])){return this[_0xd47f('0xe')]['error'](_0xaf942f,_0xd47f('0x13f'));}try{var _0x27ecb4=eval(_0xaf942f[_0xd47f('0x13e')])?_0xd47f('0x140'):_0xd47f('0x141');this[_0xd47f('0xe')][_0xd47f('0xa9')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0xaf942f[_0xd47f('0x13e')],_0x27ecb4));return{'code':0xc8,'result':_0x27ecb4};}catch(_0x4de7a3){return{'code':0xc8,'result':_0xd47f('0x141')};}};AGIVertices[_0xd47f('0x11')][_0xd47f('0x142')]=function(_0x267f6e){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x143'),_0x267f6e[_0xd47f('0x37')]));if(!this['isConfigured'](_0x267f6e[_0xd47f('0x144')])){return this[_0xd47f('0xe')]['error'](_0x267f6e,'no\x20interval\x20configured');}var _0x549b6a=this[_0xd47f('0x25')][_0xd47f('0xa5')](this,_0x267f6e[_0xd47f('0x144')]);if(!_0x549b6a){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x267f6e,_0xd47f('0x145'));}for(var _0x2ad4e6=0x0;_0x2ad4e6<_0x549b6a[_0xd47f('0x9d')];_0x2ad4e6+=0x1){var _0x1fda9f=this['channel']['getVariable'](util[_0xd47f('0x29')](_0xd47f('0x146'),_0x549b6a[_0x2ad4e6]));if(_0x1fda9f[_0xd47f('0xa4')]===-0x1){return _0x1fda9f;}logger['info'](util[_0xd47f('0x29')]('IFTIME\x20%s\x20%s',_0x549b6a[_0x2ad4e6],_0x1fda9f['extra']));if(_0x1fda9f['extra']==='true'){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x147'),_0x549b6a[_0x2ad4e6],_0xd47f('0x140')));this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x147'),_0x549b6a[_0x2ad4e6],_0xd47f('0x140')));return{'code':0xc8,'result':'true'};}else{logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x147'),_0x549b6a[_0x2ad4e6],_0xd47f('0x141')));this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x147'),_0x549b6a[_0x2ad4e6],_0xd47f('0x141')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0xd47f('0x148')]=function(_0x5f3a15){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x149'),_0x5f3a15[_0xd47f('0x37')]));return this['channel']['hangup']();};AGIVertices[_0xd47f('0x11')][_0xd47f('0x14a')]=function(_0x358bf1){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x358bf1[_0xd47f('0x37')]));if(!this['isConfigured'](_0x358bf1[_0xd47f('0x7b')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xe5'));}var _0x57dcbe='wav';var _0x4ff92c=util[_0xd47f('0x29')](_0xd47f('0x12d'),FILES_PATH,rs[_0xd47f('0x119')](0x4));var _0x5eb000=util[_0xd47f('0x29')]('%s.%s',_0x4ff92c,_0x57dcbe);var _0xda601d=!![];if(_0x358bf1[_0xd47f('0x12e')]===_0xd47f('0x12f')){_0xda601d=![];}var _0x5f5cb7=this[_0xd47f('0xe')][_0xd47f('0x130')](_0x4ff92c,_0x57dcbe,_0x358bf1['intKey'],_0x358bf1[_0xd47f('0x65')],undefined,_0xda601d);if(_0x5f5cb7['result']!==-0x1){this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')](_0xd47f('0x14b'),_0x5eb000));var _0x31bc32=this[_0xd47f('0x84')][_0xd47f('0xa5')](this,_0x358bf1,_0x5eb000);if(_0x31bc32){for(var _0x3d3d38 in _0x31bc32){if(_0x31bc32[_0xd47f('0x95')](_0x3d3d38)){this['channel'][_0xd47f('0x9e')](util['format'](_0xd47f('0x14c'),_0x3d3d38[_0xd47f('0x6a')]()),_0x31bc32[_0x3d3d38]);}}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x14d'),JSON[_0xd47f('0x73')](_0x31bc32)));}}return _0x5f5cb7;};AGIVertices[_0xd47f('0x11')][_0xd47f('0x14e')]=function(_0x87c4d8){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x87c4d8['label']));if(!this['isConfigured'](_0x87c4d8[_0xd47f('0x7b')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xe5'));}if(!this['isConfigured'](_0x87c4d8[_0xd47f('0x5c')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0xaa'));}this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x14f'),_0x87c4d8['text']));var _0x4702fb=this['ispeechTTS']['sync'](this,_0x87c4d8);if(_0x4702fb){this['channel']['noop'](util['format'](_0xd47f('0x14b'),_0x4702fb));var _0x333176=this['channel'][_0xd47f('0x100')](_0x4702fb,_0x87c4d8[_0xd47f('0x131')]);try{fs[_0xd47f('0x101')](_0x4702fb+_0xd47f('0x102'));}catch(_0x11d768){logger['error'](_0x11d768);}return _0x333176;}return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x87c4d8,_0xd47f('0x150'));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x151')]=function(_0x3b1dfa){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x152'),_0x3b1dfa['label']));if(!this[_0xd47f('0x86')](_0x3b1dfa['findBy'])){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x3b1dfa,_0xd47f('0x153'));}logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x154'),this[_0xd47f('0xe')][_0xd47f('0x3a')],_0x3b1dfa[_0xd47f('0x155')]));var _0x3a3346=this[_0xd47f('0x53')][_0xd47f('0xa5')](this,_0x3b1dfa['findBy']);if(_0x3a3346){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd47f('0xe')][_0xd47f('0x3a')],_0x3b1dfa[_0xd47f('0x155')]));this[_0xd47f('0xe')]['noop'](util['format'](_0xd47f('0x156'),this['channel']['callerid'],_0x3b1dfa['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd47f('0x3a')],_0x3b1dfa['findBy']));this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x157'),this['channel'][_0xd47f('0x3a')],_0x3b1dfa[_0xd47f('0x155')]));return{'code':0xc8,'result':_0xd47f('0x158')};}};AGIVertices[_0xd47f('0x11')]['logout']=function(_0x268e4f){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x159'),_0x268e4f[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x268e4f[_0xd47f('0x155')])){return this['channel'][_0xd47f('0x31')](_0x268e4f,_0xd47f('0x153'));}logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x154'),this[_0xd47f('0xe')][_0xd47f('0x3a')],_0x268e4f[_0xd47f('0x155')]));var _0x40c107=this[_0xd47f('0x52')]['sync'](this,_0x268e4f[_0xd47f('0x155')]);if(_0x40c107){logger['info'](util[_0xd47f('0x29')](_0xd47f('0x156'),this[_0xd47f('0xe')][_0xd47f('0x3a')],_0x268e4f[_0xd47f('0x155')]));this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x268e4f[_0xd47f('0x155')]));return{'code':0xc8,'result':_0xd47f('0x15a')};}else{logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x157'),this[_0xd47f('0xe')][_0xd47f('0x3a')],_0x268e4f[_0xd47f('0x155')]));this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x157'),this[_0xd47f('0xe')]['callerid'],_0x268e4f['findBy']));return{'code':0xc8,'result':_0xd47f('0x158')};}};AGIVertices[_0xd47f('0x11')][_0xd47f('0x15b')]=function(_0x2ccd0c){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x15c'),_0x2ccd0c[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x2ccd0c['operation'])){return this[_0xd47f('0xe')]['error'](_0x2ccd0c,_0xd47f('0x15d'));}this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')](_0xd47f('0x15e'),_0x2ccd0c[_0xd47f('0x15f')]));var _0x46f7f3=eval(_0x2ccd0c['operation']);if(!this['isConfigured'](_0x2ccd0c[_0xd47f('0xd3')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0x114'));}var _0x1adf1d=this['getVariable'][_0xd47f('0xa5')](this,_0x2ccd0c['variable_id']);if(!_0x1adf1d){return this['channel'][_0xd47f('0x31')](_0x2ccd0c,_0xd47f('0xd4'));}if(_[_0xd47f('0x9a')](_0x46f7f3)){var _0x1e2ae1=this;_0x46f7f3[_0xd47f('0xd5')](function(_0x26eaba,_0x19aeac){_0x1e2ae1[_0xd47f('0xe')][_0xd47f('0x9e')](util[_0xd47f('0x29')]('%s[%s]',_0x1adf1d,_0x19aeac),_0x26eaba);});return this[_0xd47f('0xe')]['noop'](util['format'](_0xd47f('0x160'),_0x1adf1d));}else{return this[_0xd47f('0xe')][_0xd47f('0x9e')](_0x1adf1d,_0x46f7f3);}};AGIVertices['prototype'][_0xd47f('0x161')]=function(_0x4a5b28){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x162'),_0x4a5b28['label']));if(_0x4a5b28[_0xd47f('0xa6')]===0x0){return this['maxRetry'](_0x4a5b28);}_0x4a5b28[_0xd47f('0xa6')]-=0x1;if(!this['isConfigured'](_0x4a5b28[_0xd47f('0x111')])){return this['channel']['error'](_0x4a5b28,_0xd47f('0x112'));}var _0xc15a20=this[_0xd47f('0x1f')][_0xd47f('0xa5')](this,_0x4a5b28[_0xd47f('0x111')]);if(!_0xc15a20){return this['channel']['error'](_0x4a5b28,_0xd47f('0x113'));}var _0x458eff=this[_0xd47f('0xe')][_0xd47f('0x163')](_0xc15a20,_0x4a5b28[_0xd47f('0x164')],_0x4a5b28[_0xd47f('0x165')]);var _0x36cc77=_0x458eff['result'];if(_0x458eff[_0xd47f('0xa4')]===-0x1){this[_0xd47f('0x35')][_0xd47f('0xa5')](this,_0x4a5b28,'-1');return _0x458eff;}else if(_0x458eff[_0xd47f('0xa3')]===_0xd47f('0x65')){_0x458eff['result']=_0x458eff[_0xd47f('0xa4')][_0xd47f('0x9d')]>0x0?_0x458eff[_0xd47f('0xa4')]:'t';}else if(_[_0xd47f('0x43')](_0x458eff[_0xd47f('0xa4')])){_0x458eff[_0xd47f('0xa4')]='#';_0x36cc77='#';}if(!this['isConfigured'](_0x4a5b28[_0xd47f('0xd3')])){this['channel'][_0xd47f('0xa9')](_0xd47f('0x114'));}else{var _0x48dedb=this[_0xd47f('0xa2')][_0xd47f('0xa5')](this,_0x4a5b28[_0xd47f('0xd3')]);if(!_0x48dedb){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x4a5b28,_0xd47f('0xd4'));}this[_0xd47f('0xe')][_0xd47f('0x9e')](_0x48dedb,_0x36cc77);}this[_0xd47f('0x35')][_0xd47f('0xa5')](this,_0x4a5b28,_0x36cc77);return _0x458eff;};AGIVertices[_0xd47f('0x11')]['noop']=function(_0x40b7b5){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x166'),_0x40b7b5[_0xd47f('0x37')]));return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0x40b7b5[_0xd47f('0x167')]||_0x40b7b5[_0xd47f('0x37')]);};AGIVertices[_0xd47f('0x11')][_0xd47f('0x168')]=function(_0xaa1321){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0xaa1321[_0xd47f('0x37')]));if(!this['isConfigured'](_0xaa1321[_0xd47f('0x155')])){return this['channel'][_0xd47f('0x31')](_0xaa1321,'no\x20find\x20by\x20configured');}logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x154'),this[_0xd47f('0xe')][_0xd47f('0x3a')],_0xaa1321[_0xd47f('0x155')]));var _0x1fa11e=this[_0xd47f('0x4d')][_0xd47f('0xa5')](this,_0xaa1321['pause_id']);var _0x376de1=this['agentPause'][_0xd47f('0xa5')](this,_0xaa1321['findBy'],_0x1fa11e);if(_0x376de1){logger['info'](util[_0xd47f('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd47f('0x3a')],_0xaa1321[_0xd47f('0x155')]));this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x156'),this[_0xd47f('0xe')][_0xd47f('0x3a')],_0xaa1321[_0xd47f('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x157'),this['channel'][_0xd47f('0x3a')],_0xaa1321['findBy']));this['channel'][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x156'),this['channel']['callerid'],_0xaa1321[_0xd47f('0x155')]));return{'code':0xc8,'result':_0xd47f('0x158')};}};AGIVertices[_0xd47f('0x11')][_0xd47f('0x169')]=function(_0x420b33){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x16a'),_0x420b33['label']));if(!this['isConfigured'](_0x420b33[_0xd47f('0x111')])){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x420b33,'no\x20file\x20audio\x20selected');}var _0x224703=this[_0xd47f('0x1f')][_0xd47f('0xa5')](this,_0x420b33[_0xd47f('0x111')]);if(!_0x224703){return this['channel']['error'](_0x420b33,_0xd47f('0x113'));}var _0x986f74=this['channel'][_0xd47f('0x57')](_0xd47f('0x16b'),[_0x224703,_0x420b33['opts']]);if(_0x986f74[_0xd47f('0xa4')]===-0x1){return _0x986f74;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xc5'),_0xd47f('0x16b'),_0x224703));};AGIVertices['prototype'][_0xd47f('0x16c')]=function(_0x69eace){logger[_0xd47f('0x2b')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x69eace['label']));if(!this[_0xd47f('0x86')](_0x69eace[_0xd47f('0x16d')])){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x69eace,'no\x20queue\x20selected');}var _0x36cb43='';var _0x247837=parseInt(_0x69eace[_0xd47f('0x16d')],0xa);if(isNaN(_0x247837)){_0x36cb43=_0x69eace[_0xd47f('0x16d')];}else{_0x36cb43=this[_0xd47f('0x16')]['sync'](this,_0x69eace['queue_id']);if(!_0x36cb43){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x69eace,'no\x20queue\x20found');}}var _0x378cd4='';if(this[_0xd47f('0x86')](_0x69eace[_0xd47f('0x111')])){var _0xf4abe4=this[_0xd47f('0x1f')][_0xd47f('0xa5')](this,_0x69eace[_0xd47f('0x111')]);if(_0xf4abe4){_0x378cd4=_0xf4abe4;}}this[_0xd47f('0x35')]['sync'](this,_0x69eace,_0x36cb43);if(_0x69eace[_0xd47f('0xe0')]['indexOf']('x')<0x0){_0x69eace[_0xd47f('0xe0')]+='x';}if(_0x69eace[_0xd47f('0xe0')]['indexOf']('X')<0x0){_0x69eace[_0xd47f('0xe0')]+='X';}this[_0xd47f('0xe')][_0xd47f('0x9e')](_0xd47f('0x16e'),_0x36cb43?_0x36cb43[_0xd47f('0x16f')]():'');var _0x11acc2=this[_0xd47f('0xe')][_0xd47f('0x57')](_0xd47f('0x170'),[_0x36cb43,_0x69eace['opts'],_0x69eace[_0xd47f('0x64')],_0x378cd4,_0x69eace[_0xd47f('0x65')],_0x69eace[_0xd47f('0x9')],_0x69eace[_0xd47f('0x171')],_0x69eace['gosub'],'',_0x69eace[_0xd47f('0x172')]]);if(_0x11acc2['result']===-0x1){return _0x11acc2;}return this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')](_0xd47f('0xc5'),'QUEUE',_0x36cb43));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x173')]=function(_0x2f2470){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x174'),_0x2f2470[_0xd47f('0x37')]));var _0x55acfa=_0x2f2470[_0xd47f('0x175')]||'wav';var _0x1fbb5e=util[_0xd47f('0x29')](_0xd47f('0x176'),this['channel']['uniqueid'],rs['generate'](0x5));var _0xf09621=util[_0xd47f('0x29')](_0xd47f('0x177'),FILES_PATH,_0x1fbb5e,_0x55acfa);var _0x11ed9e=util[_0xd47f('0x29')](_0xd47f('0x12d'),FILES_PATH,_0x1fbb5e);this[_0xd47f('0x3b')][_0xd47f('0xa5')](this,_0x2f2470,_0x1fbb5e,_0xf09621);this[_0xd47f('0xe')][_0xd47f('0x9e')](_0xd47f('0x178'),_0x1fbb5e);logger[_0xd47f('0x2b')](_0xd47f('0x179'),_0x11ed9e,_0x55acfa,_0x2f2470[_0xd47f('0x17a')],_0x2f2470['timeout']);return this[_0xd47f('0xe')][_0xd47f('0x130')](_0x11ed9e,_0x55acfa,_0x2f2470[_0xd47f('0x17a')],_0x2f2470[_0xd47f('0x65')],undefined,!![]);};AGIVertices[_0xd47f('0x11')][_0xd47f('0x17b')]=function(_0x569903){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x17c'),_0x569903[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x569903[_0xd47f('0x64')])){return this[_0xd47f('0xe')]['noop'](_0xd47f('0x17d'));}var _0x4683b5=this[_0xd47f('0x63')]['sync'](this,_0x569903);logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x17e'),util[_0xd47f('0x17f')](_0x4683b5,{'showHidden':![],'depth':null})));if(!this[_0xd47f('0x86')](_0x569903[_0xd47f('0xd3')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')](_0xd47f('0x180'));}var _0x2139aa=this[_0xd47f('0xa2')][_0xd47f('0xa5')](this,_0x569903[_0xd47f('0xd3')]);if(!_0x2139aa){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x569903,'no\x20variable\x20found');}this['channel']['setVariable'](util['format']('%s_STATUS_CODE',_0x2139aa),_0x4683b5[_0xd47f('0x76')]?_0x4683b5[_0xd47f('0x76')]:_0xd47f('0x181'));this[_0xd47f('0xe')][_0xd47f('0x9e')](util[_0xd47f('0x29')]('%s_STATUS_MESSAGE',_0x2139aa),_0x4683b5['statusMessage']?_0x4683b5[_0xd47f('0x75')]:'OK');if(_0x4683b5[_0xd47f('0x6b')]){try{this['saveRestApiResult'](_0x4683b5[_0xd47f('0x6b')],_0x2139aa);}catch(_0xa4d773){logger[_0xd47f('0x31')](util['format'](_0xd47f('0x182'),_0x2139aa));}}return this['channel'][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x183'),_0x2139aa));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x184')]=function(_0x24036e){logger['info'](util[_0xd47f('0x29')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x24036e[_0xd47f('0x37')]));return this[_0xd47f('0xe')][_0xd47f('0x185')](_0x24036e[_0xd47f('0x186')]['replace'](/\s+/g,''),_0x24036e[_0xd47f('0x17a')]);};AGIVertices[_0xd47f('0x11')][_0xd47f('0x187')]=function(_0x3e7910){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3e7910[_0xd47f('0x37')]));return this['channel'][_0xd47f('0x188')](_0x3e7910[_0xd47f('0x66')][_0xd47f('0x59')](/\s+/g,''),_0x3e7910[_0xd47f('0x17a')]);};AGIVertices['prototype'][_0xd47f('0x189')]=function(_0x325492){logger['info'](util[_0xd47f('0x29')](_0xd47f('0x18a'),_0x325492[_0xd47f('0x37')]));return this[_0xd47f('0xe')][_0xd47f('0x18b')](_0x325492[_0xd47f('0x5c')],_0x325492['escape_digits']);};AGIVertices[_0xd47f('0x11')][_0xd47f('0x18c')]=function(_0x312ab7){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x312ab7[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x312ab7['account_id'])){return this['channel'][_0xd47f('0xa9')]('no\x20mail\x20account\x20configured');}var _0x35148f=this[_0xd47f('0x22')][_0xd47f('0xa5')](this,_0x312ab7[_0xd47f('0x18d')]);if(!_0x35148f||!_0x35148f[_0xd47f('0x18e')]){return this[_0xd47f('0xe')]['error'](_0x312ab7,'no\x20mail\x20account\x20found');}var _0x5941ca={'from':util[_0xd47f('0x29')]('\x22%s\x22\x20<%s>',_0x35148f[_0xd47f('0x14')],_0x35148f[_0xd47f('0x18f')]||_0x35148f['Smtp'][_0xd47f('0x190')]),'to':_0x312ab7['to']||'','cc':_0x312ab7['cc']||'','bcc':_0x312ab7[_0xd47f('0x191')]||'','subject':_0x312ab7[_0xd47f('0x192')],'html':_0x312ab7[_0xd47f('0x5c')],'text':_0x312ab7[_0xd47f('0x5c')]};if(this['isConfigured'](_0x312ab7[_0xd47f('0x193')])){}logger[_0xd47f('0xd9')]('sendMail\x20message',JSON['stringify'](_0x5941ca));this[_0xd47f('0x35')]['sync'](this,_0x312ab7,_0x312ab7[_0xd47f('0x18d')]);this['channel'][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x194'),_0x35148f['name']));this['sendMailMessage'][_0xd47f('0xa5')](this,_0x35148f['smtpOptions'],_0x5941ca);return this[_0xd47f('0xe')]['noop'](_0xd47f('0x195'));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x196')]=function(_0x3d6356){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x3d6356[_0xd47f('0x37')]));return this[_0xd47f('0xe')]['noop'](_0xd47f('0x197'));};AGIVertices['prototype']['sendSMS']=function(_0x1f3fdb){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x198'),_0x1f3fdb[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x1f3fdb['sms_account_id'])){return this[_0xd47f('0xe')]['noop'](_0xd47f('0x199'));}var _0x36469f=this['getSmsAccount'][_0xd47f('0xa5')](this,_0x1f3fdb[_0xd47f('0x19a')]);if(!_0x36469f){return this['channel']['error'](_0x1f3fdb,'no\x20sms\x20account\x20found');}var _0x105efd={'body':_0x1f3fdb['sms_text'],'phone':_0x1f3fdb['to']||'','SmsAccountId':_0x36469f['id']};logger['debug']('sendSMS\x20message',JSON[_0xd47f('0x73')](_0x105efd));this['createSquareDetailsReport']['sync'](this,_0x1f3fdb,_0x1f3fdb['sms_account_id']);this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x19b'),_0x36469f['name']));this[_0xd47f('0x34')][_0xd47f('0xa5')](this,_0x105efd);return this['channel'][_0xd47f('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xd47f('0x11')]['set']=function(_0x5b3853){logger['info'](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x5b3853[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x5b3853[_0xd47f('0xd3')])){return this[_0xd47f('0xe')]['error'](_0x5b3853,_0xd47f('0x19c'));}var _0x4a9ec7=this[_0xd47f('0xa2')]['sync'](this,_0x5b3853['variable_id']);if(!_0x4a9ec7){return this['channel']['error'](_0x5b3853,'no\x20variable\x20found');}return this['channel'][_0xd47f('0x9e')](_0x4a9ec7,_0x5b3853[_0xd47f('0x19d')]);};AGIVertices[_0xd47f('0x11')][_0xd47f('0x19e')]=function(_0x326336){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x19f'),_0x326336['label']));this['channel'][_0xd47f('0xa9')](_0xd47f('0x1a0'));if(_0x326336[_0xd47f('0xba')]===_0xd47f('0x1a1')){this[_0xd47f('0xe')]['noop'](_0xd47f('0x1a2'));return this[_0xd47f('0xe')][_0xd47f('0xba')]();}return this['channel']['noop']('Skipped\x20Answer');};AGIVertices[_0xd47f('0x11')][_0xd47f('0x1a3')]=function(_0x34e1c1){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x34e1c1[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x34e1c1['project_id'])){return this['channel']['error'](_0x34e1c1,_0xd47f('0x1a4'));}var _0x5d4b22=this[_0xd47f('0x18')][_0xd47f('0xa5')](this,_0x34e1c1[_0xd47f('0x1a5')]);if(!this[_0xd47f('0x86')](_0x5d4b22)){return this['channel'][_0xd47f('0x31')](_0x34e1c1,util['format'](_0xd47f('0x1a6'),_0x34e1c1[_0xd47f('0x1a5')]));}if(_0x5d4b22===this[_0xd47f('0xe')][_0xd47f('0x39')]){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x34e1c1,_0xd47f('0x1a7'));}this[_0xd47f('0x35')]['sync'](this,_0x34e1c1,_0x5d4b22);var _0x4de1c4=this[_0xd47f('0xe')][_0xd47f('0x57')](_0xd47f('0x1a8'),util[_0xd47f('0x29')](_0xd47f('0x1a9'),config['agi'][_0xd47f('0x1aa')]||_0xd47f('0x1ab'),_0x5d4b22,this[_0xd47f('0xe')][_0xd47f('0x39')]));if(_0x4de1c4[_0xd47f('0xa4')]===-0x1){return _0x4de1c4;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xc5'),_0xd47f('0x1a8'),_0x5d4b22));};AGIVertices[_0xd47f('0x11')]['system']=function(_0x2dbbca){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x1ac'),_0x2dbbca[_0xd47f('0x37')]));var _0x4ac9c6=this[_0xd47f('0x56')][_0xd47f('0xa5')](this,_0x2dbbca[_0xd47f('0xb9')]);this['createSquareDetailsReport']['sync'](this,_0x2dbbca,_0x2dbbca[_0xd47f('0xb9')]);if(this['isConfigured'](_0x2dbbca[_0xd47f('0xd3')])){var _0x45780b=this[_0xd47f('0xa2')][_0xd47f('0xa5')](this,_0x2dbbca[_0xd47f('0xd3')]);if(_0x45780b){this[_0xd47f('0xe')][_0xd47f('0x9e')](_0x45780b,_0x4ac9c6);return this[_0xd47f('0xe')]['noop'](util[_0xd47f('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2dbbca[_0xd47f('0xb9')],_0x45780b));}}return this['channel'][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x1ad'),_0x2dbbca['command']));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x1ae')]=function(_0x554688){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x1af'),_0x554688['label']));_0x554688['text']=_0x554688[_0xd47f('0x5c')][_0xd47f('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x554688[_0xd47f('0x5b')])){return this[_0xd47f('0xe')][_0xd47f('0xa9')]('no\x20apiKey\x20configured');}if(!this[_0xd47f('0x86')](_0x554688[_0xd47f('0x5c')])){return this[_0xd47f('0xe')]['noop'](_0xd47f('0xaa'));}this['channel'][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x1b0'),_0x554688[_0xd47f('0x5c')]));var _0x259e7e=this[_0xd47f('0x5a')][_0xd47f('0xa5')](this,_0x554688);if(_0x259e7e){this[_0xd47f('0xe')]['noop'](util['format'](_0xd47f('0x1b1'),_0x259e7e));var _0x1543cd=this['channel'][_0xd47f('0x100')](_0x259e7e);try{fs[_0xd47f('0x101')](_0x259e7e+_0xd47f('0x102'));}catch(_0x2a4b50){logger[_0xd47f('0x31')](_0x2a4b50);}return _0x1543cd;}return this['channel'][_0xd47f('0x31')](_0x554688,_0xd47f('0x1b2'));};AGIVertices[_0xd47f('0x11')][_0xd47f('0x1b3')]=function(_0x324588){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x324588['label']));_0x324588[_0xd47f('0x5c')]=_0x324588[_0xd47f('0x5c')][_0xd47f('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd47f('0x86')](_0x324588[_0xd47f('0x5c')])){return this['channel'][_0xd47f('0xa9')]('no\x20text\x20configured');}this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')]('Trying\x20Google\x20TTS\x20%s',_0x324588[_0xd47f('0x5c')]));var _0x28d7a5=this[_0xd47f('0x62')][_0xd47f('0xa5')](this,_0x324588);if(_0x28d7a5){this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0x1b4'),_0x28d7a5));var _0xc8ff8=this[_0xd47f('0xe')][_0xd47f('0x100')](_0x28d7a5);try{fs[_0xd47f('0x101')](_0x28d7a5+'.wav');}catch(_0xd92c0c){logger['error'](_0xd92c0c);}return _0xc8ff8;}return this[_0xd47f('0xe')]['error'](_0x324588,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd47f('0x11')][_0xd47f('0x1b5')]=function(_0x223e4a){logger[_0xd47f('0x2b')](util['format'](_0xd47f('0x1b6'),_0x223e4a[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x223e4a[_0xd47f('0x155')])){return this[_0xd47f('0xe')][_0xd47f('0x31')](_0x223e4a,'no\x20find\x20by\x20configured');}logger[_0xd47f('0x2b')](util[_0xd47f('0x29')](_0xd47f('0x154'),this[_0xd47f('0xe')][_0xd47f('0x3a')],_0x223e4a[_0xd47f('0x155')]));var _0x33201a=this[_0xd47f('0x50')][_0xd47f('0xa5')](this,_0x223e4a[_0xd47f('0x155')]);if(_0x33201a){logger['info'](util[_0xd47f('0x29')](_0xd47f('0x156'),this[_0xd47f('0xe')][_0xd47f('0x3a')],_0x223e4a[_0xd47f('0x155')]));this['channel'][_0xd47f('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd47f('0xe')]['callerid'],_0x223e4a['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd47f('0x3a')],_0x223e4a[_0xd47f('0x155')]));this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd47f('0xe')][_0xd47f('0x3a')],_0x223e4a[_0xd47f('0x155')]));return{'code':0xc8,'result':_0xd47f('0x158')};}};AGIVertices[_0xd47f('0x11')][_0xd47f('0x1b7')]=function(_0x579051){logger[_0xd47f('0x2b')](util[_0xd47f('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x579051[_0xd47f('0x37')]));var _0xbe3fb8=this[_0xd47f('0xe')][_0xd47f('0x57')]('VOICEMAIL',[_0x579051[_0xd47f('0x1b8')],_0x579051[_0xd47f('0x79')]]);if(_0xbe3fb8['result']===-0x1){return _0xbe3fb8;}return this[_0xd47f('0xe')][_0xd47f('0xa9')](util[_0xd47f('0x29')](_0xd47f('0xc5'),_0xd47f('0x1b9'),_0x579051[_0xd47f('0x1b8')]));};AGIVertices['prototype'][_0xd47f('0x1ba')]=function(_0x4f79ed){logger['info'](util[_0xd47f('0x29')](_0xd47f('0x1bb'),_0x4f79ed[_0xd47f('0x37')]));if(!this[_0xd47f('0x86')](_0x4f79ed[_0xd47f('0xd3')])){return this['channel'][_0xd47f('0x31')](_0x4f79ed,_0xd47f('0x19c'));}var _0x571b2d=this[_0xd47f('0xa2')]['sync'](this,_0x4f79ed[_0xd47f('0xd3')]);if(!_0x571b2d){return this['channel'][_0xd47f('0x31')](_0x4f79ed,_0xd47f('0xd4'));}var _0x51cc94=this[_0xd47f('0xe')][_0xd47f('0xa2')](_0x571b2d);return{'code':0xc8,'result':_0x51cc94[_0xd47f('0xa3')]?_0x51cc94[_0xd47f('0xa3')]:'-'};};String['prototype'][_0xd47f('0xa1')]=function(_0x15d327,_0x168a0a){return this[_0xd47f('0xa0')](_0x15d327)[_0xd47f('0x1bc')](_0x168a0a);};module[_0xd47f('0x1bd')]=AGIVertices; \ No newline at end of file +var _0x7834=['aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','saveRestApiResult','%s.%s','length','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','setVariable','createSquareDetailsReport','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','exec','MRCPSynth','result','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','no\x20list\x20selected','add','delay','createCmContact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','createSquareMessage','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','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','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','isArray','%s[%s]','variable\x20%s[key]\x20set','maxRetry','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','replace','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','then','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','save_name','getMailAccount','sendMailMessage','getIntervals','interval','map','Intervals','format','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','channel','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','dnid','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','includes','PUT','toUpperCase','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','parse','stringify','render','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','Amy','aws_text_type','awsLex'];(function(_0x2513ea,_0x3d9cb8){var _0x49f511=function(_0x357ae6){while(--_0x357ae6){_0x2513ea['push'](_0x2513ea['shift']());}};_0x49f511(++_0x3d9cb8);}(_0x7834,0x13f));var _0x4783=function(_0x2f3ca5,_0x3ba4ac){_0x2f3ca5=_0x2f3ca5-0x0;var _0x11cc85=_0x7834[_0x2f3ca5];return _0x11cc85;};'use strict';var fs=require('fs');var util=require(_0x4783('0x0'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x4783('0x1'))();var rs=require('randomstring');var moment=require(_0x4783('0x2'));var Mustache=require(_0x4783('0x3'));var rp=require(_0x4783('0x4'));var logger=require(_0x4783('0x5'))(_0x4783('0x6'));var config=require(_0x4783('0x7'));var shared=require(_0x4783('0x8'));var scripts=require('./scripts');var FILES_PATH=_0x4783('0x9');var recursiveMapAttributes=[_0x4783('0xa'),'rawBody'];var verticesWithRetry=[_0x4783('0xb'),_0x4783('0xc'),_0x4783('0xd')];var AGIVertices=function(_0x112a19,_0xc8b2d7,_0x1f8b29){this['channel']=_0x112a19;this[_0x4783('0xe')]=_0xc8b2d7;this[_0x4783('0xf')]=_0x1f8b29;};AGIVertices[_0x4783('0x10')][_0x4783('0x11')]=function(_0x6cfdfb,_0x1eaeea){this[_0x4783('0xe')]['getVariableById'](_0x6cfdfb)['then'](function(_0x1a40c0){_0x1eaeea(null,_0x1a40c0?_0x1a40c0[_0x4783('0x12')]:![]);})['catch'](function(_0x2afbdc){_0x1eaeea(_0x2afbdc);});};AGIVertices['prototype'][_0x4783('0x13')]=function(_0x2fbc53,_0x41d853){this[_0x4783('0xe')][_0x4783('0x14')](_0x2fbc53)['then'](function(_0x3dcc1f){_0x41d853(null,_0x3dcc1f?_0x3dcc1f[_0x4783('0x12')]:![]);})[_0x4783('0x15')](function(_0x20788f){_0x41d853(_0x20788f);});};AGIVertices[_0x4783('0x10')][_0x4783('0x16')]=function(_0x3d4e04,_0x40dbcf){this[_0x4783('0xe')][_0x4783('0x17')](_0x3d4e04)[_0x4783('0x18')](function(_0x323a90){_0x40dbcf(null,_0x323a90?_0x323a90['name']:![]);})[_0x4783('0x15')](function(_0xcda581){_0x40dbcf(_0xcda581);});};AGIVertices['prototype'][_0x4783('0x19')]=function(_0x4a9dc8,_0x3064a){this[_0x4783('0xe')][_0x4783('0x1a')](_0x4a9dc8)[_0x4783('0x18')](function(_0x1b5e90){_0x3064a(null,_0x1b5e90?_0x1b5e90[_0x4783('0x1b')]:![]);})[_0x4783('0x15')](function(_0x4e15d7){_0x3064a(_0x4e15d7);});};AGIVertices[_0x4783('0x10')]['getUser']=function(_0x429801,_0x2d592f){this[_0x4783('0xe')][_0x4783('0x1c')](_0x429801)[_0x4783('0x18')](function(_0x54529d){_0x2d592f(null,_0x54529d?_0x54529d[_0x4783('0x12')]:![]);})[_0x4783('0x15')](function(_0xba686e){_0x2d592f(_0xba686e);});};AGIVertices[_0x4783('0x10')][_0x4783('0x1d')]=function(_0x1c7ebf,_0x2afc09){this['rpc'][_0x4783('0x1e')](_0x1c7ebf)[_0x4783('0x18')](function(_0x5d33f5){_0x2afc09(null,_0x5d33f5?_0x5d33f5['name']:![]);})[_0x4783('0x15')](function(_0xb5f71c){_0x2afc09(_0xb5f71c);});};AGIVertices['prototype'][_0x4783('0x1f')]=function(_0x532961,_0x5c5a6a){var _0x5368d3=this;this['rpc']['getSoundById'](_0x532961)['then'](function(_0x250b9d){_0x5c5a6a(null,_0x250b9d?_0x5368d3['getSoundPath'](_0x250b9d[_0x4783('0x20')]):![]);})[_0x4783('0x15')](function(_0x424806){_0x5c5a6a(_0x424806);});};AGIVertices[_0x4783('0x10')][_0x4783('0x21')]=function(_0x52b18f,_0x1e23f4){this[_0x4783('0xe')]['getMailAccountById'](_0x52b18f)[_0x4783('0x18')](function(_0x54ed15){_0x1e23f4(null,_0x54ed15?_0x54ed15:![]);})['catch'](function(_0x24d208){_0x1e23f4(_0x24d208);});};AGIVertices['prototype'][_0x4783('0x22')]=function(_0x4e999c,_0x3dc9fd,_0x3e519e){this['mailRpc'][_0x4783('0x22')](_0x4e999c,_0x3dc9fd)[_0x4783('0x18')](function(){_0x3e519e(null);})[_0x4783('0x15')](function(_0x1efca5){_0x3e519e(_0x1efca5);});};AGIVertices['prototype'][_0x4783('0x23')]=function(_0x40a06c,_0x36b94d){this[_0x4783('0xe')]['getIntervalById'](_0x40a06c)[_0x4783('0x18')](function(_0x16539){if(_0x16539){if(_0x16539['IntervalId']){_0x36b94d(null,[_0x16539[_0x4783('0x24')]]);}else{_0x36b94d(null,_[_0x4783('0x25')](_0x16539[_0x4783('0x26')],_0x4783('0x24')));}}else{_0x36b94d(null,![]);}})[_0x4783('0x15')](function(_0x4e6902){_0x36b94d(_0x4e6902);});};AGIVertices[_0x4783('0x10')]['getSoundPath']=function(_0x4b4441){return util[_0x4783('0x27')](_0x4783('0x28'),FILES_PATH,_0x4b4441);};AGIVertices[_0x4783('0x10')]['getQueryOdbc']=function(_0x12f078,_0x521a3b,_0x321184){odbc['open'](_0x12f078,function(_0x2f476e){if(_0x2f476e){logger[_0x4783('0x29')](_0x4783('0x2a'),_0x2f476e);_0x321184(_0x2f476e);}else{logger['info'](_0x4783('0x2b'));odbc['query'](_0x521a3b,function(_0x372cea,_0x2da1d6){if(_0x372cea){logger[_0x4783('0x2c')](_0x4783('0x2d'),_0x521a3b);_0x321184(_0x372cea);}else{logger['info'](_0x4783('0x2e'),_0x521a3b);odbc[_0x4783('0x2f')](function(_0x34bf03){if(_0x34bf03){logger['error'](_0x4783('0x30'),_0x34bf03);}_0x321184(null,_0x2da1d6);});}});}});};AGIVertices[_0x4783('0x10')][_0x4783('0x31')]=function(_0x50c1c3,_0x49adfd){this[_0x4783('0xe')][_0x4783('0x32')](_0x50c1c3)[_0x4783('0x18')](function(_0xbb6755){_0x49adfd(null,_0xbb6755?_0xbb6755:![]);})[_0x4783('0x15')](function(_0x158fc8){_0x49adfd(_0x158fc8);});};AGIVertices[_0x4783('0x10')][_0x4783('0x33')]=function(_0x135dd7,_0x5d34b8){this['rpc'][_0x4783('0x33')](_0x135dd7)['then'](function(_0xc577a9){_0x5d34b8(null,_0xc577a9);})[_0x4783('0x15')](function(_0x4708be){_0x5d34b8(_0x4708be);});};AGIVertices[_0x4783('0x10')]['createSquareDetailsReport']=function(_0x409ac6,_0xa29d9c,_0x3db344){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x4783('0x34')][_0x4783('0x35')],'node':_0x409ac6['label'],'application':_0x409ac6[_0x4783('0x36')],'data':_0xa29d9c||null,'project_name':this['channel'][_0x4783('0x37')],'callerid':this[_0x4783('0x34')][_0x4783('0x38')]})[_0x4783('0x18')](function(_0x2975fa){if(_0x3db344){_0x3db344(null,_0x2975fa);}})[_0x4783('0x15')](function(_0x2ab285){if(_0x3db344){_0x3db344(_0x2ab285);}});};AGIVertices[_0x4783('0x10')]['createSquareRecording']=function(_0x5dcf8c,_0x3523a4,_0x537a96,_0x1708c2){this[_0x4783('0xe')][_0x4783('0x39')]({'uniqueid':this[_0x4783('0x34')][_0x4783('0x35')],'callerid':this[_0x4783('0x34')][_0x4783('0x38')],'calleridname':this[_0x4783('0x34')][_0x4783('0x3a')],'context':this[_0x4783('0x34')][_0x4783('0x3b')],'extension':this[_0x4783('0x34')]['extension'],'priority':this['channel'][_0x4783('0x3c')],'accountcode':this[_0x4783('0x34')]['accountcode'],'dnid':this['channel'][_0x4783('0x3d')],'projectName':this[_0x4783('0x34')][_0x4783('0x37')],'saveName':_0x3523a4,'filename':_0x5dcf8c['file']||_0x3523a4,'savePath':_0x537a96})[_0x4783('0x18')](function(_0x56d50c){_0x1708c2(null,_0x56d50c);})[_0x4783('0x15')](function(_0x2e481c){_0x1708c2(_0x2e481c);});};AGIVertices['prototype']['createSquareMessage']=function(_0x58c570,_0x62fc1d,_0x419333,_0x47a0c5,_0x1fee84){this[_0x4783('0xe')]['createSquareMessage']({'uniqueid':this[_0x4783('0x34')]['uniqueid'],'body':_0x58c570,'direction':_0x62fc1d,'providerName':_0x419333,'providerResponse':_0x47a0c5})[_0x4783('0x18')](function(_0x591f91){if(_0x1fee84){_0x1fee84(null,_0x591f91);}})[_0x4783('0x15')](function(_0x54406b){if(_0x1fee84){_0x1fee84(_0x54406b);}});};AGIVertices[_0x4783('0x10')]['createCmContact']=function(_0x5f0f9a,_0x525b5a){this[_0x4783('0xe')]['createCmContact']({'firstName':_[_0x4783('0x3e')](_0x5f0f9a[_0x4783('0x12')])||_[_0x4783('0x3f')](_0x5f0f9a[_0x4783('0x12')])?_0x4783('0x40')+Math[_0x4783('0x41')]():_0x5f0f9a['name'],'lastName':_['isEmpty'](_0x5f0f9a[_0x4783('0x42')])||_[_0x4783('0x3f')](_0x5f0f9a[_0x4783('0x42')])?null:_0x5f0f9a[_0x4783('0x42')],'phone':_0x5f0f9a['phone'],'ListId':_0x5f0f9a[_0x4783('0x43')],'scheduledat':_0x5f0f9a[_0x4783('0x44')],'callbackUniqueid':this[_0x4783('0x34')][_0x4783('0x35')],'tags':_0x4783('0x45'),'description':_0x4783('0x46')+_0x5f0f9a[_0x4783('0x44')]['toString'](),'priority':_0x5f0f9a['callback_priority']})[_0x4783('0x18')](function(_0x74b4ce){_0x525b5a(null,_0x74b4ce);})[_0x4783('0x15')](function(_0xb0502d){_0x525b5a(_0xb0502d);});};AGIVertices[_0x4783('0x10')][_0x4783('0x47')]=function(_0x349e5b,_0x383294){this[_0x4783('0xe')][_0x4783('0x48')](_0x349e5b)[_0x4783('0x18')](function(_0x4bbb9e){_0x383294(null,_0x4bbb9e?_0x4bbb9e[_0x4783('0x12')]:![]);})[_0x4783('0x15')](function(_0x3a7305){_0x383294(_0x3a7305);});};AGIVertices[_0x4783('0x10')][_0x4783('0x49')]=function(_0x2be320,_0x289efc,_0x59abc1){var _0x2b23bc={'role':_0x4783('0x4a')};_0x2b23bc[_0x2be320]=this[_0x4783('0x34')][_0x4783('0x38')];this[_0x4783('0xe')][_0x4783('0x49')](_0x2b23bc,_0x289efc,this['channel']['uniqueid'])[_0x4783('0x18')](function(_0x2d1416){_0x59abc1(null,_[_0x4783('0x3f')](_0x2d1416)?![]:!![]);})[_0x4783('0x15')](function(_0x5d9e16){logger[_0x4783('0x29')](_0x5d9e16);_0x59abc1(null,![]);});};AGIVertices[_0x4783('0x10')][_0x4783('0x4b')]=function(_0x4822a6,_0x23351f){var _0x15da2b={'role':_0x4783('0x4a')};_0x15da2b[_0x4822a6]=this['channel'][_0x4783('0x38')];this[_0x4783('0xe')]['agentUnpause'](_0x15da2b)['then'](function(_0x390d0a){_0x23351f(null,_[_0x4783('0x3f')](_0x390d0a)?![]:!![]);})[_0x4783('0x15')](function(_0xf7a1de){logger[_0x4783('0x29')](_0xf7a1de);_0x23351f(null,![]);});};AGIVertices[_0x4783('0x10')][_0x4783('0x4c')]=function(_0x4b0667,_0x527909){var _0x2a7296={'role':_0x4783('0x4a')};_0x2a7296[_0x4b0667]=this[_0x4783('0x34')]['callerid'];this[_0x4783('0xe')][_0x4783('0x4c')](_0x2a7296)[_0x4783('0x18')](function(_0x200d05){_0x527909(null,_['isNil'](_0x200d05)?![]:!![]);})[_0x4783('0x15')](function(_0x44ec0d){logger['error'](_0x44ec0d);_0x527909(null,![]);});};AGIVertices[_0x4783('0x10')][_0x4783('0x4d')]=function(_0x5edbc1,_0x5700a3){var _0x1ec871={'role':_0x4783('0x4a')};_0x1ec871[_0x5edbc1]=this[_0x4783('0x34')][_0x4783('0x38')];var _0x4decca=_0x5edbc1!='internal'?util[_0x4783('0x27')]('%s/%s@from-sip/n',_0x4783('0x4e'),this[_0x4783('0x34')][_0x4783('0x38')]):undefined;this[_0x4783('0xe')][_0x4783('0x4d')](_0x1ec871,_0x4decca)[_0x4783('0x18')](function(_0x14f903){_0x5700a3(null,_[_0x4783('0x3f')](_0x14f903)?![]:!![]);})[_0x4783('0x15')](function(_0x4fe4ae){logger[_0x4783('0x29')](_0x4fe4ae);_0x5700a3(null,![]);});};AGIVertices[_0x4783('0x10')][_0x4783('0x4f')]=function(_0xf39703,_0x4985cd){sh['exec'](_['trim'](_0xf39703),function(_0x1be0e3,_0x34cfc1){var _0x8a6349=_0x34cfc1['replace'](/(\r\n|\n|\r)/gm,'');_0x4985cd(null,_0x8a6349);});};AGIVertices['prototype'][_0x4783('0x50')]=function(_0x45fb65,_0x540f7f){scripts[_0x4783('0x50')](_0x45fb65[_0x4783('0x51')],_0x45fb65['google_cloud_tts_text_type']||_0x4783('0x52'),_0x45fb65['text'],_0x45fb65[_0x4783('0x53')]||'en-US',_0x45fb65[_0x4783('0x54')]||_0x4783('0x55'),_0x45fb65[_0x4783('0x56')]||_0x4783('0x57'))[_0x4783('0x18')](function(_0x239259){_0x540f7f(null,_0x239259);})['catch'](function(_0x3b6826){_0x540f7f(_0x3b6826);});};AGIVertices['prototype'][_0x4783('0x58')]=function(_0xcb232c,_0x4633aa){scripts[_0x4783('0x58')](_0xcb232c[_0x4783('0x52')],_0xcb232c[_0x4783('0x59')]||'en',0x1)[_0x4783('0x18')](function(_0x45e6bd){_0x4633aa(null,_0x45e6bd);})['catch'](function(_0x1f10c2){_0x4633aa(_0x1f10c2);});};AGIVertices[_0x4783('0x10')][_0x4783('0x5a')]=function(_0x27f10c,_0x3c2959){var _0x48b388={'uri':_0x27f10c['url'],'method':_0x27f10c[_0x4783('0x5b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x27f10c['timeout'])==='number'&&parseInt(_0x27f10c[_0x4783('0x5c')])>=0x1?parseInt(_0x27f10c[_0x4783('0x5c')])*0x3e8:0x5*0x3e8};if(_[_0x4783('0x5d')](['POST',_0x4783('0x5e')],_0x48b388[_0x4783('0x5b')][_0x4783('0x5f')]())){try{_0x48b388['body']=_0x27f10c['rawBody']?JSON['parse'](_0x27f10c[_0x4783('0x60')]):{};}catch(_0xb77d54){logger[_0x4783('0x29')](_0x4783('0x61'),_0xb77d54);}}try{_0x48b388[_0x4783('0x62')]=_0x27f10c[_0x4783('0xa')]?JSON['parse'](_0x27f10c[_0x4783('0xa')]):{};}catch(_0x4cba4d){logger[_0x4783('0x29')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4cba4d);}if(_0x27f10c[_0x4783('0x63')]){try{var _0xdaa9f2=require(_0x27f10c[_0x4783('0x63')])[_0x4783('0x64')](this,_0x48b388);_0x48b388[_0x4783('0x65')]=Mustache['render'](_0x27f10c['url'],_0xdaa9f2,{},['$$','$$']);if(_0x48b388['headers']){_0x48b388['headers']=JSON[_0x4783('0x66')](Mustache['render'](JSON[_0x4783('0x67')](_0x48b388[_0x4783('0x62')]),_0xdaa9f2,{},['$$','$$']));}if(_0x48b388['body']){_0x48b388['body']=JSON[_0x4783('0x66')](Mustache[_0x4783('0x68')](JSON[_0x4783('0x67')](_0x48b388[_0x4783('0x69')]),_0xdaa9f2,{},['$$','$$']));}}catch(_0x96136b){logger[_0x4783('0x29')](_0x4783('0x6a'),_0x96136b);}}rp(_0x48b388)[_0x4783('0x18')](function(_0x36f5a5){var _0x3a9630={'statusCode':_0x36f5a5[_0x4783('0x6b')]||0xc8,'statusMessage':_0x36f5a5[_0x4783('0x6c')]||'OK','headers':_0x36f5a5[_0x4783('0x62')]||{},'body':_0x36f5a5['body']||{}};_0x3c2959(null,_0x3a9630);})[_0x4783('0x15')](function(_0x121929){var _0x395f9e={'statusCode':_0x121929[_0x4783('0x6b')]||0x1f4,'statusMessage':_0x121929[_0x4783('0x6d')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x121929['options'][_0x4783('0x62')]||{},'body':_0x121929[_0x4783('0x6e')][_0x4783('0x69')]||{}};_0x3c2959(null,_0x395f9e);});};AGIVertices[_0x4783('0x10')]['googleDialogflow']=function(_0x2eda31,_0x191d3a){scripts[_0x4783('0x6f')](this[_0x4783('0x34')][_0x4783('0x35')],_0x2eda31[_0x4783('0x70')],_0x2eda31[_0x4783('0x52')],_0x2eda31['dialogflow_language']||'en')[_0x4783('0x18')](function(_0x41121e){_0x191d3a(null,_0x41121e);})[_0x4783('0x15')](function(_0x46c608){_0x191d3a(_0x46c608);});};AGIVertices[_0x4783('0x10')][_0x4783('0x71')]=function(_0x32a665,_0x45aff6){scripts['googleDialogflowV2'](this[_0x4783('0x34')]['uniqueid'],_0x32a665['dialogflowV2_project_id'],_0x32a665[_0x4783('0x72')],_0x32a665[_0x4783('0x73')],_0x32a665[_0x4783('0x52')],_0x32a665[_0x4783('0x74')]||'en')['then'](function(_0x2e7350){_0x45aff6(null,_0x2e7350);})[_0x4783('0x15')](function(_0x527478){_0x45aff6(_0x527478);});};AGIVertices[_0x4783('0x10')][_0x4783('0x75')]=function(_0x4cbdfd,_0x57658b){scripts[_0x4783('0x75')](this[_0x4783('0x34')],_0x4cbdfd)[_0x4783('0x18')](function(_0x2072e5){_0x57658b(null,_0x2072e5);})[_0x4783('0x15')](function(_0x4f773d){_0x57658b(_0x4f773d);});};AGIVertices[_0x4783('0x10')]['ispeechTTS']=function(_0x1d3ebe,_0x4437b2){scripts['ispeechTTS'](_0x1d3ebe['key'],_0x1d3ebe[_0x4783('0x52')],_0x1d3ebe[_0x4783('0x76')]||_0x4783('0x77'),_0x1d3ebe[_0x4783('0x78')])[_0x4783('0x18')](function(_0x1a715d){_0x4437b2(null,_0x1a715d);})[_0x4783('0x15')](function(_0x4224c9){_0x4437b2(_0x4224c9);});};AGIVertices[_0x4783('0x10')]['ispeechASR']=function(_0x2abcc6,_0x44456b,_0x4bced1){scripts[_0x4783('0x79')](_0x44456b,_0x2abcc6[_0x4783('0x70')],_0x2abcc6[_0x4783('0x7a')]||'en-US',this[_0x4783('0x7b')](_0x2abcc6[_0x4783('0x7c')])?_0x2abcc6[_0x4783('0x7c')]:undefined)[_0x4783('0x18')](function(_0xfd822b){_0x4bced1(null,_0xfd822b);})[_0x4783('0x15')](function(_0x5b353b){_0x4bced1(_0x5b353b);});};AGIVertices['prototype'][_0x4783('0x7d')]=function(_0x3f6353,_0x3f705d){scripts[_0x4783('0x7d')](_0x3f6353['aws_access_key_id'],_0x3f6353[_0x4783('0x7e')],_0x3f6353['aws_polly_region'],_0x3f6353['aws_polly_voice']||_0x4783('0x7f'),_0x3f6353[_0x4783('0x52')],_0x3f6353[_0x4783('0x80')]||_0x4783('0x52'))[_0x4783('0x18')](function(_0x2b0164){_0x3f705d(null,_0x2b0164);})[_0x4783('0x15')](function(_0x6ef7a8){_0x3f705d(_0x6ef7a8);});};AGIVertices[_0x4783('0x10')][_0x4783('0x81')]=function(_0x4abe31,_0x4b3d91){scripts['awsLex'](this[_0x4783('0x34')][_0x4783('0x35')],_0x4abe31['aws_access_key_id'],_0x4abe31[_0x4783('0x7e')],_0x4abe31['aws_lex_region'],_0x4abe31[_0x4783('0x52')],_0x4abe31[_0x4783('0x82')])['then'](function(_0x596246){_0x4b3d91(null,_0x596246);})[_0x4783('0x15')](function(_0x10d089){_0x4b3d91(_0x10d089);});};AGIVertices[_0x4783('0x10')][_0x4783('0x83')]=function(_0xe8cbb4,_0x573dc2,_0x45cd0e){scripts[_0x4783('0x83')](_0x573dc2,_0xe8cbb4[_0x4783('0x70')],_0xe8cbb4[_0x4783('0x84')]||_0x4783('0x77'))['then'](function(_0x11360b){_0x45cd0e(null,_0x11360b);})[_0x4783('0x15')](function(_0x3c4e55){_0x45cd0e(_0x3c4e55);});};AGIVertices[_0x4783('0x10')][_0x4783('0x85')]=function(_0x54e485,_0x4b31a3,_0x8ed524){scripts[_0x4783('0x85')](_0x4b31a3,_0x54e485[_0x4783('0x86')],_0x54e485['appsecret'],_0x54e485['uri'])[_0x4783('0x18')](function(_0x1962a9){_0x8ed524(null,_0x1962a9);})['catch'](function(_0x3724fc){_0x8ed524(_0x3724fc);});};AGIVertices['prototype'][_0x4783('0x87')]=function(_0x965f01){var _0x181c68=_['includes'](verticesWithRetry,_0x965f01['agicommand'])?_0x965f01:_[_0x4783('0x88')](_0x965f01);for(var _0x47c136 in _0x181c68){if(_0x181c68[_0x4783('0x89')](_0x47c136)){if(_0x181c68[_0x47c136]&&_[_0x4783('0x8a')](_0x181c68[_0x47c136])){if(_[_0x4783('0x5d')](recursiveMapAttributes,_0x47c136)){_0x181c68[_0x47c136]=this['replaceObjectAllVariables'](_0x181c68[_0x47c136]);}else{_0x181c68[_0x47c136]=this[_0x4783('0x8b')](_0x181c68[_0x47c136]);}}}}return _0x181c68;};AGIVertices[_0x4783('0x10')][_0x4783('0x8c')]=function(_0x53edea){for(var _0x341dd3 in _0x53edea){if(_0x53edea[_0x4783('0x89')](_0x341dd3)){if(_['isPlainObject'](_0x53edea[_0x341dd3])){this[_0x4783('0x8c')](_0x53edea[_0x341dd3]);}else if(_['isArray'](_0x53edea[_0x341dd3])){for(var _0x41ab80=0x0;_0x41ab80<_0x53edea[_0x341dd3]['length'];_0x41ab80++){this[_0x4783('0x8c')](_0x53edea[_0x341dd3][_0x41ab80]);}}else if(_[_0x4783('0x8a')](_0x53edea[_0x341dd3])){_0x53edea[_0x341dd3]=this[_0x4783('0x8b')](_0x53edea[_0x341dd3]);}}}};AGIVertices[_0x4783('0x10')][_0x4783('0x8d')]=function(_0x15879f,_0x1ef27c){for(var _0x1087ca in _0x15879f){if(_0x15879f[_0x4783('0x89')](_0x1087ca)){if(_['isPlainObject'](_0x15879f[_0x1087ca])){if(!_['isEmpty'](_0x15879f[_0x1087ca])){this[_0x4783('0x8d')](_0x15879f[_0x1087ca],util[_0x4783('0x27')](_0x4783('0x8e'),_0x1ef27c,_0x1087ca));}}else if(_['isArray'](_0x15879f[_0x1087ca])){for(var _0x2ce8bb=0x0;_0x2ce8bb<_0x15879f[_0x1087ca][_0x4783('0x8f')];_0x2ce8bb++){this[_0x4783('0x8d')](_0x15879f[_0x1087ca][_0x2ce8bb],util[_0x4783('0x27')](_0x4783('0x8e'),_0x1ef27c,_0x1087ca+'['+_0x2ce8bb+']'));}}else{if(!_[_0x4783('0x3f')](_0x15879f[_0x1087ca])){this['channel']['setVariable'](util[_0x4783('0x27')](_0x4783('0x8e'),_0x1ef27c,_0x1087ca),_0x15879f[_0x1087ca]);}}}}};AGIVertices[_0x4783('0x10')][_0x4783('0x90')]=function(_0x3935ae){try{var _0x3eb63a=JSON[_0x4783('0x66')](_0x3935ae);this[_0x4783('0x8c')](_0x3eb63a);return JSON[_0x4783('0x67')](_0x3eb63a);}catch(_0x118baa){return this[_0x4783('0x8b')](_0x3935ae);}};AGIVertices[_0x4783('0x10')][_0x4783('0x8b')]=function(_0x7867af){var _0x2b1a34=_0x7867af[_0x4783('0x91')]('{');for(var _0x2eeb50=0x1;_0x2eeb50<_0x2b1a34[_0x4783('0x8f')];_0x2eeb50+=0x1){var _0x323a40=_0x2b1a34[_0x2eeb50][_0x4783('0x91')]('}');if(_0x323a40[_0x4783('0x8f')]>0x1){_0x7867af=_0x7867af[_0x4783('0x92')]('{'+_0x323a40[0x0]+'}',this[_0x4783('0x34')][_0x4783('0x11')](_0x323a40[0x0])[_0x4783('0x93')]||_0x323a40[0x0]);}}if(_0x2b1a34[_0x4783('0x8f')]===0x1){return _0x7867af['toString']();}return this['replaceAllVariables'](_0x7867af);};AGIVertices[_0x4783('0x10')][_0x4783('0x94')]=function(_0x144cd0,_0x1d05ef){var _0x3149fa=this[_0x4783('0x34')][_0x4783('0x11')](_0x144cd0);if(_0x3149fa['result']===-0x1){return _0x3149fa;}logger[_0x4783('0x2c')](util[_0x4783('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1d05ef,_0x3149fa[_0x4783('0x93')]));return this['channel'][_0x4783('0x95')](_0x1d05ef,_0x3149fa[_0x4783('0x93')]);};AGIVertices['prototype']['isConfigured']=function(_0x536870){return _0x536870&&_0x536870!=='0'&&_0x536870!=='-1'&&_0x536870!=='';};AGIVertices[_0x4783('0x10')]['maxRetry']=function(_0x39ee9b){this[_0x4783('0x96')][_0x4783('0x64')](this,_0x39ee9b,'-');_0x39ee9b[_0x4783('0x97')]=_0x39ee9b['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4783('0x10')]['mrcpsynth']=function(_0x7356fc){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x98'),_0x7356fc[_0x4783('0x99')]));if(!this['isConfigured'](_0x7356fc[_0x4783('0x52')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x9b'));}var _0x572482='\x22'+_0x7356fc[_0x4783('0x52')]+'\x22';if(this[_0x4783('0x7b')](_0x7356fc['options'])){_0x572482+=','+_0x7356fc[_0x4783('0x6e')];}var _0x42eff7=this['channel'][_0x4783('0x9c')](_0x4783('0x9d'),_0x572482);if(_0x42eff7[_0x4783('0x9e')]===-0x1){return _0x42eff7;}return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x572482));};AGIVertices[_0x4783('0x10')][_0x4783('0x9f')]=function(_0x25bad8){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0xa0'),_0x25bad8[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x25bad8[_0x4783('0xa1')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xa2'));}var _0x2ea8c1=_0x25bad8[_0x4783('0xa1')];if(this['isConfigured'](_0x25bad8[_0x4783('0x6e')])){_0x2ea8c1+=','+_0x25bad8[_0x4783('0x6e')];}var _0x5385bf=this[_0x4783('0x34')][_0x4783('0x9c')]('MRCPRecog',_0x2ea8c1);if(_0x5385bf[_0x4783('0x9e')]===-0x1){return _0x5385bf;}var _0x1c3551=this['getAndSetVariable'](_0x4783('0xa3'),'MRCP_RECOG_CONFIDENCE');if(_0x1c3551['result']===-0x1){return _0x1c3551;}var _0x4a8ac9=this[_0x4783('0x94')]('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x4a8ac9[_0x4783('0x9e')]===-0x1){return _0x4a8ac9;}var _0x3a6f13=this['getAndSetVariable'](_0x4783('0xa4'),_0x4783('0xa5'));if(_0x3a6f13['result']===-0x1){return _0x3a6f13;}return this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0xa6'),_0x2ea8c1));};AGIVertices[_0x4783('0x10')][_0x4783('0x6')]=function(_0x3b562c){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0xa7'),_0x3b562c[_0x4783('0x99')]));return this[_0x4783('0x34')][_0x4783('0x6')]([_0x3b562c[_0x4783('0xa8')],_0x3b562c['args']]);};AGIVertices[_0x4783('0x10')][_0x4783('0xa9')]=function(_0x476a62){logger['info'](util['format'](_0x4783('0xaa'),_0x476a62[_0x4783('0x99')]));if(this['isConfigured'](_0x476a62['timeout'])){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x476a62[_0x4783('0x5c')]));var _0x3d558d=this['channel'][_0x4783('0xab')](_0x476a62[_0x4783('0x5c')]);if(_0x3d558d[_0x4783('0x9e')]===-0x1){return _0x3d558d;}}return this['channel']['answer']();};AGIVertices['prototype'][_0x4783('0x45')]=function(_0x672261){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x672261[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x672261[_0x4783('0x43')])){return this['channel'][_0x4783('0x29')](_0x672261,_0x4783('0xac'));}_0x672261[_0x4783('0x44')]=moment();if(this[_0x4783('0x7b')](_0x672261['delay'])){_0x672261[_0x4783('0x44')]=moment()[_0x4783('0xad')](_0x672261[_0x4783('0xae')],'minutes');}if(!this[_0x4783('0x7b')](_0x672261['callback_priority'])){_0x672261['callback_priority']=0x2;}this[_0x4783('0xaf')][_0x4783('0x64')](this,_0x672261);return this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0xb0'),_0x672261[_0x4783('0xb1')],_0x672261[_0x4783('0x43')],_0x672261[_0x4783('0x44')]));};AGIVertices[_0x4783('0x10')][_0x4783('0xb2')]=function(_0x5b1c29){logger[_0x4783('0x2c')](util['format'](_0x4783('0xb3'),_0x5b1c29[_0x4783('0x99')]));var _0x378ae9=this[_0x4783('0x34')][_0x4783('0x9c')](_0x5b1c29[_0x4783('0xb4')],_0x5b1c29['options']);if(_0x378ae9[_0x4783('0x9e')]===-0x1){return _0x378ae9;}return this[_0x4783('0x34')]['noop'](util[_0x4783('0x27')](_0x4783('0xb5'),_0x5b1c29['application'],_0x5b1c29[_0x4783('0x6e')]));};AGIVertices[_0x4783('0x10')]['lumenvoxtts']=function(_0x2ab86e){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0xb6'),_0x2ab86e[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x2ab86e[_0x4783('0x52')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x9b'));}var _0x18b8c9='\x22'+_0x2ab86e[_0x4783('0x52')]+'\x22';if(this[_0x4783('0x7b')](_0x2ab86e['options'])){_0x18b8c9+=','+_0x2ab86e[_0x4783('0x6e')];}var _0x16cd85=this[_0x4783('0x34')]['exec'](_0x4783('0x9d'),_0x18b8c9);if(_0x16cd85[_0x4783('0x9e')]===-0x1){return _0x16cd85;}return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xb7'),_0x18b8c9));};AGIVertices['prototype'][_0x4783('0xb8')]=function(_0x208617){logger[_0x4783('0x2c')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x208617[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x208617[_0x4783('0x52')])){return this[_0x4783('0x34')][_0x4783('0x9a')]('no\x20text\x20configured');}var _0xd1d58e='\x22'+_0x208617[_0x4783('0x52')]+'\x22';if(this[_0x4783('0x7b')](_0x208617['options'])){_0xd1d58e+=','+_0x208617[_0x4783('0x6e')];}var _0x3a6dd0=this[_0x4783('0x34')][_0x4783('0x9c')](_0x4783('0x9d'),_0xd1d58e);if(_0x3a6dd0[_0x4783('0x9e')]===-0x1){return _0x3a6dd0;}return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xb7'),_0xd1d58e));};AGIVertices[_0x4783('0x10')]['lumenvoxasr']=function(_0x3b925a){logger[_0x4783('0x2c')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3b925a['label']));if(!this[_0x4783('0x7b')](_0x3b925a['grammar'])){return this['channel'][_0x4783('0x9a')](_0x4783('0xa2'));}var _0x58da52=_0x3b925a[_0x4783('0xa1')];if(this['isConfigured'](_0x3b925a[_0x4783('0x6e')])){_0x58da52+=','+_0x3b925a[_0x4783('0x6e')];}var _0x250f0f=this[_0x4783('0x34')][_0x4783('0x9c')](_0x4783('0xb9'),_0x58da52);if(_0x250f0f['result']===-0x1){return _0x250f0f;}var _0x1e089e=this[_0x4783('0x94')](_0x4783('0xa3'),_0x4783('0xba'));if(_0x1e089e['result']===-0x1){return _0x1e089e;}var _0xcd1c17=this[_0x4783('0x94')](_0x4783('0xbb'),_0x4783('0xbc'));if(_0xcd1c17['result']===-0x1){return _0xcd1c17;}var _0x54775e=this[_0x4783('0x94')](_0x4783('0xa4'),_0x4783('0xbd'));if(_0x54775e['result']===-0x1){return _0x54775e;}return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xa6'),_0x58da52));};AGIVertices[_0x4783('0x10')][_0x4783('0xbe')]=function(_0x50d208){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0xbf'),_0x50d208[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x50d208['grammar'])){return this[_0x4783('0x34')]['noop'](_0x4783('0xa2'));}var _0x616b05=_0x50d208[_0x4783('0xa1')];if(this[_0x4783('0x7b')](_0x50d208['options'])){_0x616b05+=','+_0x50d208[_0x4783('0x6e')];}var _0x13e5f7=this[_0x4783('0x34')][_0x4783('0x9c')]('MRCPRecog',_0x616b05);if(_0x13e5f7[_0x4783('0x9e')]===-0x1){return _0x13e5f7;}var _0x171194=this['getAndSetVariable'](_0x4783('0xa3'),_0x4783('0xc0'));if(_0x171194[_0x4783('0x9e')]===-0x1){return _0x171194;}var _0x112ff7=this[_0x4783('0x94')]('RECOG_INPUT()',_0x4783('0xc1'));if(_0x112ff7['result']===-0x1){return _0x112ff7;}var _0x8d030b=this['getAndSetVariable'](_0x4783('0xa4'),_0x4783('0xc2'));if(_0x8d030b[_0x4783('0x9e')]===-0x1){return _0x8d030b;}return this['channel']['noop'](util[_0x4783('0x27')](_0x4783('0xa6'),_0x616b05));};AGIVertices['prototype'][_0x4783('0xc3')]=function(_0x323b25){logger[_0x4783('0x2c')](util['format'](_0x4783('0xc4'),_0x323b25['label']));if(!this['isConfigured'](_0x323b25[_0x4783('0xc5')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x323b25,_0x4783('0xc6'));}var _0xab300f=this[_0x4783('0x19')][_0x4783('0x64')](this,_0x323b25[_0x4783('0xc5')]);if(!_0xab300f){return this[_0x4783('0x34')]['error'](_0x323b25,_0x4783('0xc7'));}if(!this['isConfigured'](_0x323b25[_0x4783('0xc8')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x323b25,_0x4783('0xc9'));}var _0x5bf796=_0x323b25[_0x4783('0xc8')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0xca'),_0x5bf796));var _0x187a92=this[_0x4783('0xcb')][_0x4783('0x64')](this,_0xab300f,_0x5bf796);this[_0x4783('0x96')][_0x4783('0x64')](this,_0x323b25,_0x5bf796);if(!this[_0x4783('0x7b')](_0x323b25['variable_id'])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xcc'));}var _0x275bd1=this['getVariable'][_0x4783('0x64')](this,_0x323b25[_0x4783('0xcd')]);if(!_0x275bd1){return this['channel']['error'](_0x323b25,'no\x20variable\x20found');}var _0x5131a0=this;_0x187a92[_0x4783('0xce')](function(_0x13f85a,_0x3d641b){Object[_0x4783('0xcf')](_0x13f85a)[_0x4783('0xce')](function(_0x232600){_0x5131a0[_0x4783('0x34')][_0x4783('0x95')](util[_0x4783('0x27')]('%s[%s][%s]',_0x275bd1,_0x3d641b,_0x232600),_0x13f85a[_0x232600]);});});this[_0x4783('0x34')][_0x4783('0x95')](util[_0x4783('0x27')](_0x4783('0xd0'),_0x275bd1),_0x187a92[_0x4783('0x8f')]);return this['channel'][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xd1'),_0x275bd1));};AGIVertices[_0x4783('0x10')][_0x4783('0xd2')]=function(_0x55259d){logger[_0x4783('0xd3')](util[_0x4783('0x27')](_0x4783('0xd4'),_0x55259d[_0x4783('0x99')]));if(!this['isConfigured'](_0x55259d[_0x4783('0xd5')])){return this[_0x4783('0x34')]['error'](_0x55259d,_0x4783('0xd6'));}var _0x132165=this['getUser'][_0x4783('0x64')](this,_0x55259d[_0x4783('0xd5')]);if(!_0x132165){return this[_0x4783('0x34')]['error'](_0x55259d,'no\x20user\x20found');}var _0x2762c1=this['channel'][_0x4783('0x9c')](_0x4783('0xd7'),[util[_0x4783('0x27')](_0x4783('0xd8'),_0x132165),_0x55259d[_0x4783('0x5c')],_0x55259d[_0x4783('0xd9')],_0x55259d[_0x4783('0xda')]]);if(_0x2762c1[_0x4783('0x9e')]===-0x1){return _0x2762c1;}return this['channel']['noop'](util['format'](_0x4783('0xdb'),'DIAL'));};AGIVertices['prototype'][_0x4783('0xdc')]=function(_0x5a6f67){logger['info'](util[_0x4783('0x27')](_0x4783('0xdd'),_0x5a6f67[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x5a6f67[_0x4783('0x70')])){return this[_0x4783('0x34')][_0x4783('0x9a')]('no\x20key\x20configured');}if(!this[_0x4783('0x7b')](_0x5a6f67[_0x4783('0x52')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x9b'));}this[_0x4783('0x34')]['bot']=!![];this[_0x4783('0x96')](_0x5a6f67);this[_0x4783('0xde')](_0x5a6f67[_0x4783('0x52')],'in','','');this['channel'][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xdf'),_0x5a6f67[_0x4783('0x52')]));var _0x17802e=this[_0x4783('0x6f')][_0x4783('0x64')](this,_0x5a6f67);if(_0x17802e){for(var _0x4af66a in _0x17802e){if(_0x17802e['hasOwnProperty'](_0x4af66a)){this[_0x4783('0x34')][_0x4783('0x95')](util[_0x4783('0x27')]('DIALOGFLOW_%s',_0x4af66a[_0x4783('0x5f')]()),_0x17802e[_0x4af66a]);}}this[_0x4783('0xde')](_0x17802e[_0x4783('0xe0')],_0x4783('0xe1'),_0x4783('0xdc'),'');return this[_0x4783('0x34')]['noop'](util['format'](_0x4783('0xe2'),_0x17802e[_0x4783('0xe0')]));}return this[_0x4783('0x34')][_0x4783('0x29')](_0x5a6f67,_0x4783('0xe3'));};AGIVertices['prototype']['dialogflowV2']=function(_0x58c960){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0xe4'),_0x58c960[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x58c960[_0x4783('0xe5')])){return this['channel']['noop'](_0x4783('0xe6'));}if(!this[_0x4783('0x7b')](_0x58c960[_0x4783('0x72')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xe7'));}if(!this[_0x4783('0x7b')](_0x58c960[_0x4783('0x73')])){return this['channel'][_0x4783('0x9a')](_0x4783('0xe8'));}if(!this['isConfigured'](_0x58c960[_0x4783('0x74')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xe9'));}if(!this['isConfigured'](_0x58c960['text'])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x9b'));}this[_0x4783('0x34')][_0x4783('0xea')]=!![];this[_0x4783('0x96')](_0x58c960);this[_0x4783('0xde')](_0x58c960[_0x4783('0x52')],'in','','');this[_0x4783('0x34')]['noop'](util[_0x4783('0x27')](_0x4783('0xeb'),_0x58c960['text']));var _0x4da4d0=this[_0x4783('0x71')][_0x4783('0x64')](this,_0x58c960);if(_0x4da4d0){for(var _0x57ec46 in _0x4da4d0){if(_0x4da4d0['hasOwnProperty'](_0x57ec46)){if(_0x57ec46!=='providerResponse'){this[_0x4783('0x34')][_0x4783('0x95')](util[_0x4783('0x27')](_0x4783('0xec'),_0x57ec46[_0x4783('0x5f')]()),_0x4da4d0[_0x57ec46]);}}}this[_0x4783('0xde')](_0x4da4d0[_0x4783('0xe0')],_0x4783('0xe1'),_0x4783('0xed'),_0x4da4d0[_0x4783('0xee')]);return this[_0x4783('0x34')]['noop'](util[_0x4783('0x27')](_0x4783('0xef'),_0x4da4d0[_0x4783('0xe0')]));}return this[_0x4783('0x34')]['error'](_0x58c960,_0x4783('0xf0'));};AGIVertices[_0x4783('0x10')][_0x4783('0xf1')]=function(_0x2f7719){logger['info'](util[_0x4783('0x27')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x2f7719[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x2f7719['ndauth_url'])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xf2'));}if(!this['isConfigured'](_0x2f7719[_0x4783('0xf3')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xf4'));}if(!this[_0x4783('0x7b')](_0x2f7719[_0x4783('0xf5')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xf6'));}if(!this[_0x4783('0x7b')](_0x2f7719[_0x4783('0xf7')])){return this['channel']['noop'](_0x4783('0x9b'));}this[_0x4783('0x34')][_0x4783('0xea')]=!![];this[_0x4783('0x96')](_0x2f7719);this[_0x4783('0xde')](_0x2f7719['text'],'in','','');this[_0x4783('0x34')]['noop'](util[_0x4783('0x27')](_0x4783('0xf8'),_0x2f7719[_0x4783('0x52')]));var _0x26087c=this['sestekNDA'][_0x4783('0x64')](this,_0x2f7719);if(_0x26087c){for(var _0x3c2ece in _0x26087c){if(_0x26087c[_0x4783('0x89')](_0x3c2ece)){this['channel'][_0x4783('0x95')](util[_0x4783('0x27')](_0x4783('0xf9'),_0x3c2ece[_0x4783('0x5f')]()),_0x26087c[_0x3c2ece]);}}this[_0x4783('0xde')](_0x26087c['speech'],'out','sesteknda','');if(_0x26087c['audiofile']){this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xfa'),_0x26087c[_0x4783('0xfb')]));var _0x286b42=this[_0x4783('0x34')]['streamFile'](_0x26087c['audiofile']);try{fs[_0x4783('0xfc')](_0x26087c[_0x4783('0xfb')]+'.wav');}catch(_0x2035df){logger[_0x4783('0x29')](_0x2035df);}return _0x286b42;}else{return this[_0x4783('0x34')][_0x4783('0x9a')](util['format']('SestekNDA\x20Result\x20%s',_0x26087c[_0x4783('0xe0')]));}}return this['channel'][_0x4783('0x29')](_0x2f7719,_0x4783('0xfd'));};AGIVertices['prototype'][_0x4783('0xfe')]=function(_0x27e26a){logger[_0x4783('0x2c')](util['format'](_0x4783('0xff'),_0x27e26a['label']));return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xfe'));};AGIVertices[_0x4783('0x10')]['ext_dial']=function(_0x26f22c){logger[_0x4783('0x2c')](util['format'](_0x4783('0x100'),_0x26f22c[_0x4783('0x99')]));var _0x10a985='';if(_0x26f22c[_0x4783('0x101')]){if(!this[_0x4783('0x7b')](_0x26f22c[_0x4783('0x101')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x26f22c,_0x4783('0x102'));}else{var _0x58ada5=parseInt(_0x26f22c[_0x4783('0x101')],0xa);if(isNaN(_0x58ada5)){_0x10a985=_0x26f22c['trunk_id'];}else{_0x10a985=this['getTrunk'][_0x4783('0x64')](this,_0x26f22c['trunk_id']);if(!_0x10a985){return this['channel']['error'](_0x26f22c,_0x4783('0x103'));}}}}else if(_0x26f22c[_0x4783('0x104')]){_0x10a985=_0x26f22c[_0x4783('0x104')];}else{return this[_0x4783('0x34')][_0x4783('0x29')](_0x26f22c,_0x4783('0x102'));}var _0xd46e44=this['channel'][_0x4783('0x9c')]('DIAL',[util[_0x4783('0x27')]('SIP/%s/%s',_0x10a985,_0x26f22c['phone']),_0x26f22c[_0x4783('0x5c')],_0x26f22c[_0x4783('0xd9')],_0x26f22c[_0x4783('0xda')]]);if(_0xd46e44[_0x4783('0x9e')]===-0x1){return _0xd46e44;}return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xdb'),_0x4783('0xd7')));};AGIVertices[_0x4783('0x10')][_0x4783('0x105')]=function(_0x4bf4c5){logger['info'](util[_0x4783('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x4bf4c5[_0x4783('0x99')]));return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x105'));};AGIVertices['prototype'][_0x4783('0xc')]=function(_0x3f481a){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x106'),_0x3f481a[_0x4783('0x99')]));if(_0x3f481a[_0x4783('0x97')]===0x0){return this['maxRetry'](_0x3f481a);}_0x3f481a[_0x4783('0x97')]-=0x1;if(!this['isConfigured'](_0x3f481a[_0x4783('0x107')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x3f481a,_0x4783('0x108'));}var _0x156b25=this[_0x4783('0x1f')][_0x4783('0x64')](this,_0x3f481a['file_id']);if(!_0x156b25){return this[_0x4783('0x34')][_0x4783('0x29')](_0x3f481a,'no\x20file\x20audio\x20found');}if(!this[_0x4783('0x7b')](_0x3f481a[_0x4783('0xcd')])){return this['channel']['error'](_0x4783('0xcc'));}var _0x1b42a4=this[_0x4783('0x34')][_0x4783('0x109')](_0x156b25,_0x3f481a[_0x4783('0x10a')],_0x3f481a[_0x4783('0x10b')]);var _0x212aa8=_0x1b42a4[_0x4783('0x9e')]?_0x1b42a4[_0x4783('0x9e')]['toString']():'';logger[_0x4783('0x2c')]('test',JSON[_0x4783('0x67')](_0x1b42a4));if(_0x1b42a4[_0x4783('0x9e')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x3f481a,_0x212aa8);return _0x1b42a4;}else if(_0x1b42a4['extra']==='timeout'){_0x1b42a4['result']=_0x212aa8[_0x4783('0x8f')]>=parseInt(_0x3f481a[_0x4783('0x10c')])?'x':'i';}else{_0x1b42a4[_0x4783('0x9e')]=_0x212aa8[_0x4783('0x8f')]>=parseInt(_0x3f481a['mindigit'])&&_0x212aa8[_0x4783('0x8f')]<=parseInt(_0x3f481a[_0x4783('0x10b')])?'x':'i';}var _0x267e20=this[_0x4783('0x11')]['sync'](this,_0x3f481a['variable_id']);if(!_0x267e20){return this[_0x4783('0x34')][_0x4783('0x29')](_0x3f481a,_0x4783('0x10d'));}this['channel'][_0x4783('0x95')](_0x267e20,_0x212aa8);if(this[_0x4783('0x7b')](_0x3f481a[_0x4783('0x10e')])){var _0x407658=parseInt(_0x3f481a['hiddendigitsnum'],0xa);var _0x52def4=rs[_0x4783('0x10f')]({'charset':'*','length':_0x407658});var _0x11a594=_0x212aa8['length'];if(_0x11a594>0x0){if(_0x11a594>_0x407658){this['createSquareDetailsReport'][_0x4783('0x64')](this,_0x3f481a,_0x3f481a['hiddendigitspos']===_0x4783('0x110')?_0x52def4+_0x212aa8['substr'](_0x407658):_0x212aa8[_0x4783('0x111')](0x0,_0x11a594-_0x407658)+_0x52def4);}else{this[_0x4783('0x96')][_0x4783('0x64')](this,_0x3f481a,rs['generate']({'charset':'*','length':_0x11a594}));}}else{this[_0x4783('0x96')]['sync'](this,_0x3f481a,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x3f481a,_0x212aa8);}return _0x1b42a4;};AGIVertices[_0x4783('0x10')]['getsecretdigits']=function(_0x305c23){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x112'),_0x305c23['label']));return this[_0x4783('0xc')](_0x305c23);};AGIVertices[_0x4783('0x10')]['goal']=function(_0x45998c){logger[_0x4783('0x2c')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x45998c[_0x4783('0x99')]));this[_0x4783('0x96')]['sync'](this,_0x45998c,_0x45998c[_0x4783('0x113')]);return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x114'),_0x45998c[_0x4783('0x113')]));};AGIVertices[_0x4783('0x10')][_0x4783('0x115')]=function(_0x378910){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x116'),_0x378910[_0x4783('0x99')]));if(!this['isConfigured'](_0x378910[_0x4783('0x117')])||!this[_0x4783('0x7b')](_0x378910[_0x4783('0x7e')])){return this[_0x4783('0x34')]['noop'](_0x4783('0x118'));}if(!this[_0x4783('0x7b')](_0x378910['text'])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x9b'));}this['channel'][_0x4783('0x9a')](util['format'](_0x4783('0x119'),_0x378910[_0x4783('0x52')]));var _0xf9a4e1=this['awsPolly'][_0x4783('0x64')](this,_0x378910);if(_0xf9a4e1){this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x11a'),_0xf9a4e1));var _0x574cc6=this[_0x4783('0x34')]['streamFile'](_0xf9a4e1);try{fs['unlink'](_0xf9a4e1+_0x4783('0x11b'));}catch(_0x2cdb05){logger[_0x4783('0x29')](_0x2cdb05);}return _0x574cc6;}return this[_0x4783('0x34')][_0x4783('0x29')](_0x378910,_0x4783('0x11c'));};AGIVertices['prototype']['awslex']=function(_0x5b06ea){logger['info'](util[_0x4783('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5b06ea[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x5b06ea[_0x4783('0x117')])||!this['isConfigured'](_0x5b06ea[_0x4783('0x7e')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x118'));}if(!this['isConfigured'](_0x5b06ea[_0x4783('0x82')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x11d'));}if(!this[_0x4783('0x7b')](_0x5b06ea[_0x4783('0x52')])){return this['channel'][_0x4783('0x9a')]('no\x20text\x20configured');}this[_0x4783('0x34')][_0x4783('0xea')]=!![];this['createSquareDetailsReport'](_0x5b06ea);this[_0x4783('0xde')](_0x5b06ea[_0x4783('0x52')],'in','','');this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x11e'),_0x5b06ea[_0x4783('0x52')]));var _0x5a6e84=this[_0x4783('0x81')][_0x4783('0x64')](this,_0x5b06ea);if(_0x5a6e84){for(var _0x50a6c6 in _0x5a6e84){if(_0x5a6e84[_0x4783('0x89')](_0x50a6c6)&&_[_0x4783('0x8a')](_0x5a6e84[_0x50a6c6])){this[_0x4783('0x34')][_0x4783('0x95')](util['format']('AWS_LEX_%s',_0x50a6c6[_0x4783('0x5f')]()),_0x5a6e84[_0x50a6c6]);}}if(_[_0x4783('0x3f')](_0x5a6e84[_0x4783('0x6d')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x11f'));}else{this[_0x4783('0xde')](_0x5a6e84[_0x4783('0x6d')],_0x4783('0xe1'),_0x4783('0x120'),'');return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x121'),_0x5a6e84[_0x4783('0x6d')]));}}return this[_0x4783('0x34')][_0x4783('0x29')](_0x5b06ea,_0x4783('0x122'));};AGIVertices[_0x4783('0x10')]['googleasr']=function(_0x3ee90a){logger['info'](util[_0x4783('0x27')](_0x4783('0x123'),_0x3ee90a[_0x4783('0x99')],_0x3ee90a[_0x4783('0x5c')]));if(!this[_0x4783('0x7b')](_0x3ee90a[_0x4783('0x70')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x124'));}var _0x4fad49=_0x4783('0x125');var _0x4d38db=util[_0x4783('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x4783('0x10f')](0x4));var _0x5e2b88=util[_0x4783('0x27')]('%s.%s',_0x4d38db,_0x4fad49);var _0x2da75a=!![];if(_0x3ee90a[_0x4783('0x126')]===_0x4783('0x127')){_0x2da75a=![];}var _0x1cd1f1=this[_0x4783('0x34')]['recordFile'](_0x4d38db,_0x4fad49,_0x3ee90a[_0x4783('0x128')],_0x3ee90a[_0x4783('0x5c')],undefined,_0x2da75a);if(_0x1cd1f1[_0x4783('0x9e')]!==-0x1){this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x129'),_0x5e2b88));var _0x1df898=this['googleASR'][_0x4783('0x64')](this,_0x3ee90a,_0x5e2b88);if(_0x1df898){for(var _0x1c13d0 in _0x1df898){if(_0x1df898['hasOwnProperty'](_0x1c13d0)){this[_0x4783('0x34')][_0x4783('0x95')](util[_0x4783('0x27')](_0x4783('0x12a'),_0x1c13d0['toUpperCase']()),_0x1df898[_0x1c13d0]);}}return this['channel'][_0x4783('0x9a')](util['format'](_0x4783('0x12b'),JSON[_0x4783('0x67')](_0x1df898)));}}return _0x1cd1f1;};AGIVertices[_0x4783('0x10')][_0x4783('0x12c')]=function(_0x40eb49){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x40eb49[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x40eb49['appid'])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x12d'));}if(!this[_0x4783('0x7b')](_0x40eb49['appsecret'])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x12e'));}var _0x30dd12=_0x4783('0x125');var _0x2ebb51=util['format'](_0x4783('0x12f'),FILES_PATH,rs[_0x4783('0x10f')](0x4));var _0x2a5ab5=util['format']('%s.%s',_0x2ebb51,_0x30dd12);var _0x4805bf=!![];if(_0x40eb49[_0x4783('0x126')]===_0x4783('0x127')){_0x4805bf=![];}var _0x265af8=this['channel'][_0x4783('0x130')](_0x2ebb51,_0x30dd12,_0x40eb49['intKey'],_0x40eb49[_0x4783('0x5c')],undefined,_0x4805bf);if(_0x265af8[_0x4783('0x9e')]!==-0x1){this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x131'),_0x2a5ab5));var _0x53be3a=this[_0x4783('0x85')][_0x4783('0x64')](this,_0x40eb49,_0x2a5ab5);if(_0x53be3a){for(var _0x72023d in _0x53be3a){if(_0x53be3a[_0x4783('0x89')](_0x72023d)){this[_0x4783('0x34')][_0x4783('0x95')](util['format'](_0x4783('0x132'),_0x72023d['toUpperCase']()),_0x53be3a[_0x72023d]);}}return this[_0x4783('0x34')]['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0x4783('0x67')](_0x53be3a)));}}return _0x265af8;};AGIVertices[_0x4783('0x10')][_0x4783('0x133')]=function(_0x100a26){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x100a26[_0x4783('0x99')]));return this[_0x4783('0x34')][_0x4783('0x134')](_0x100a26['context'],_0x100a26[_0x4783('0x135')],_0x100a26[_0x4783('0x3c')]);};AGIVertices[_0x4783('0x10')][_0x4783('0x136')]=function(_0x2959ab){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x137'),_0x2959ab[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x2959ab[_0x4783('0x138')])){return this[_0x4783('0x34')]['error'](_0x2959ab,_0x4783('0x139'));}try{var _0x470f28=eval(_0x2959ab[_0x4783('0x138')])?_0x4783('0x13a'):_0x4783('0x13b');this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x13c'),_0x2959ab[_0x4783('0x138')],_0x470f28));return{'code':0xc8,'result':_0x470f28};}catch(_0x13edfb){return{'code':0xc8,'result':_0x4783('0x13b')};}};AGIVertices['prototype']['gotoiftime']=function(_0x88d6f3){logger[_0x4783('0x2c')](util['format'](_0x4783('0x13d'),_0x88d6f3[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x88d6f3[_0x4783('0x13e')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x88d6f3,_0x4783('0x13f'));}var _0x39a47a=this['getIntervals'][_0x4783('0x64')](this,_0x88d6f3[_0x4783('0x13e')]);if(!_0x39a47a){return this[_0x4783('0x34')][_0x4783('0x29')](_0x88d6f3,_0x4783('0x140'));}for(var _0x1b9173=0x0;_0x1b9173<_0x39a47a[_0x4783('0x8f')];_0x1b9173+=0x1){var _0x4b3072=this['channel'][_0x4783('0x11')](util[_0x4783('0x27')](_0x4783('0x141'),_0x39a47a[_0x1b9173]));if(_0x4b3072['result']===-0x1){return _0x4b3072;}logger[_0x4783('0x2c')](util[_0x4783('0x27')]('IFTIME\x20%s\x20%s',_0x39a47a[_0x1b9173],_0x4b3072[_0x4783('0x93')]));if(_0x4b3072[_0x4783('0x93')]===_0x4783('0x13a')){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x142'),_0x39a47a[_0x1b9173],'true'));this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')]('IFTIME\x20%s\x20%s',_0x39a47a[_0x1b9173],'true'));return{'code':0xc8,'result':_0x4783('0x13a')};}else{logger[_0x4783('0x2c')](util[_0x4783('0x27')]('IFTIME\x20%s\x20%s',_0x39a47a[_0x1b9173],_0x4783('0x13b')));this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0x142'),_0x39a47a[_0x1b9173],_0x4783('0x13b')));}}return{'code':0xc8,'result':_0x4783('0x13b')};};AGIVertices['prototype'][_0x4783('0x143')]=function(_0x5ce25b){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x144'),_0x5ce25b[_0x4783('0x99')]));return this[_0x4783('0x34')]['hangup']();};AGIVertices['prototype'][_0x4783('0x145')]=function(_0x153167){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x153167[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x153167[_0x4783('0x70')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x124'));}var _0x4e2272=_0x4783('0x125');var _0x299b77=util[_0x4783('0x27')](_0x4783('0x12f'),FILES_PATH,rs[_0x4783('0x10f')](0x4));var _0x45bf74=util[_0x4783('0x27')](_0x4783('0x8e'),_0x299b77,_0x4e2272);var _0x2953c4=!![];if(_0x153167[_0x4783('0x126')]===_0x4783('0x127')){_0x2953c4=![];}var _0x4a8284=this[_0x4783('0x34')][_0x4783('0x130')](_0x299b77,_0x4e2272,_0x153167[_0x4783('0x128')],_0x153167[_0x4783('0x5c')],undefined,_0x2953c4);if(_0x4a8284[_0x4783('0x9e')]!==-0x1){this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x146'),_0x45bf74));var _0x20db0d=this['ispeechASR'][_0x4783('0x64')](this,_0x153167,_0x45bf74);if(_0x20db0d){for(var _0x346b73 in _0x20db0d){if(_0x20db0d[_0x4783('0x89')](_0x346b73)){this['channel'][_0x4783('0x95')](util[_0x4783('0x27')]('ISPEECH_ASR_%s',_0x346b73[_0x4783('0x5f')]()),_0x20db0d[_0x346b73]);}}return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x147'),JSON[_0x4783('0x67')](_0x20db0d)));}}return _0x4a8284;};AGIVertices[_0x4783('0x10')][_0x4783('0x148')]=function(_0x4681d1){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x149'),_0x4681d1[_0x4783('0x99')]));if(!this['isConfigured'](_0x4681d1[_0x4783('0x70')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x124'));}if(!this['isConfigured'](_0x4681d1[_0x4783('0x52')])){return this[_0x4783('0x34')][_0x4783('0x9a')]('no\x20text\x20configured');}this[_0x4783('0x34')]['noop'](util[_0x4783('0x27')](_0x4783('0x14a'),_0x4681d1[_0x4783('0x52')]));var _0xa39cc1=this[_0x4783('0x14b')]['sync'](this,_0x4681d1);if(_0xa39cc1){this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x146'),_0xa39cc1));var _0x1cabdd=this[_0x4783('0x34')]['streamFile'](_0xa39cc1,_0x4681d1['intKey']);try{fs[_0x4783('0xfc')](_0xa39cc1+_0x4783('0x11b'));}catch(_0x231fc9){logger[_0x4783('0x29')](_0x231fc9);}return _0x1cabdd;}return this['channel'][_0x4783('0x29')](_0x4681d1,_0x4783('0x14c'));};AGIVertices[_0x4783('0x10')][_0x4783('0x14d')]=function(_0x193e88){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x193e88[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x193e88['findBy'])){return this[_0x4783('0x34')]['error'](_0x193e88,_0x4783('0x14e'));}logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x14f'),this['channel']['callerid'],_0x193e88['findBy']));var _0x57d4c6=this[_0x4783('0x4d')][_0x4783('0x64')](this,_0x193e88[_0x4783('0x150')]);if(_0x57d4c6){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x151'),this[_0x4783('0x34')][_0x4783('0x38')],_0x193e88[_0x4783('0x150')]));this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0x151'),this[_0x4783('0x34')]['callerid'],_0x193e88[_0x4783('0x150')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x4783('0x27')](_0x4783('0x152'),this[_0x4783('0x34')][_0x4783('0x38')],_0x193e88['findBy']));this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x152'),this[_0x4783('0x34')]['callerid'],_0x193e88[_0x4783('0x150')]));return{'code':0xc8,'result':_0x4783('0x153')};}};AGIVertices['prototype'][_0x4783('0x154')]=function(_0x4d62b7){logger['info'](util[_0x4783('0x27')](_0x4783('0x155'),_0x4d62b7[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x4d62b7[_0x4783('0x150')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x4d62b7,_0x4783('0x14e'));}logger[_0x4783('0x2c')](util['format'](_0x4783('0x14f'),this[_0x4783('0x34')][_0x4783('0x38')],_0x4d62b7[_0x4783('0x150')]));var _0x2fe207=this[_0x4783('0x4c')]['sync'](this,_0x4d62b7[_0x4783('0x150')]);if(_0x2fe207){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x151'),this['channel'][_0x4783('0x38')],_0x4d62b7[_0x4783('0x150')]));this[_0x4783('0x34')]['noop'](util[_0x4783('0x27')](_0x4783('0x151'),this['channel'][_0x4783('0x38')],_0x4d62b7['findBy']));return{'code':0xc8,'result':_0x4783('0x156')};}else{logger[_0x4783('0x2c')](util[_0x4783('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x4783('0x38')],_0x4d62b7[_0x4783('0x150')]));this[_0x4783('0x34')]['noop'](util['format'](_0x4783('0x152'),this['channel'][_0x4783('0x38')],_0x4d62b7[_0x4783('0x150')]));return{'code':0xc8,'result':_0x4783('0x153')};}};AGIVertices[_0x4783('0x10')][_0x4783('0x157')]=function(_0x414b12){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x158'),_0x414b12['label']));if(!this[_0x4783('0x7b')](_0x414b12['operation'])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x414b12,_0x4783('0x159'));}this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x15a'),_0x414b12[_0x4783('0x15b')]));var _0x458c29=eval(_0x414b12['operation']);if(!this['isConfigured'](_0x414b12['variable_id'])){return this['channel'][_0x4783('0x9a')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x31e2a8=this[_0x4783('0x11')][_0x4783('0x64')](this,_0x414b12[_0x4783('0xcd')]);if(!_0x31e2a8){return this[_0x4783('0x34')]['error'](_0x414b12,_0x4783('0x10d'));}if(_[_0x4783('0x15c')](_0x458c29)){var _0x4945ff=this;_0x458c29[_0x4783('0xce')](function(_0xd51231,_0xccb582){_0x4945ff['channel'][_0x4783('0x95')](util[_0x4783('0x27')](_0x4783('0x15d'),_0x31e2a8,_0xccb582),_0xd51231);});return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x15e'),_0x31e2a8));}else{return this[_0x4783('0x34')][_0x4783('0x95')](_0x31e2a8,_0x458c29);}};AGIVertices[_0x4783('0x10')]['menu']=function(_0x6a215d){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x6a215d['label']));if(_0x6a215d[_0x4783('0x97')]===0x0){return this[_0x4783('0x15f')](_0x6a215d);}_0x6a215d[_0x4783('0x97')]-=0x1;if(!this['isConfigured'](_0x6a215d['file_id'])){return this['channel'][_0x4783('0x29')](_0x6a215d,_0x4783('0x108'));}var _0x19b09c=this[_0x4783('0x1f')][_0x4783('0x64')](this,_0x6a215d[_0x4783('0x107')]);if(!_0x19b09c){return this[_0x4783('0x34')]['error'](_0x6a215d,'no\x20file\x20audio\x20found');}var _0xe8adf3=this[_0x4783('0x34')]['getData'](_0x19b09c,_0x6a215d[_0x4783('0x10a')],_0x6a215d[_0x4783('0x160')]);var _0x566747=_0xe8adf3[_0x4783('0x9e')];if(_0xe8adf3[_0x4783('0x9e')]===-0x1){this['createSquareDetailsReport'][_0x4783('0x64')](this,_0x6a215d,'-1');return _0xe8adf3;}else if(_0xe8adf3['extra']===_0x4783('0x5c')){_0xe8adf3[_0x4783('0x9e')]=_0xe8adf3[_0x4783('0x9e')][_0x4783('0x8f')]>0x0?_0xe8adf3[_0x4783('0x9e')]:'t';}else if(_[_0x4783('0x3e')](_0xe8adf3[_0x4783('0x9e')])){_0xe8adf3['result']='#';_0x566747='#';}if(!this[_0x4783('0x7b')](_0x6a215d[_0x4783('0xcd')])){this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0xcc'));}else{var _0x5c86df=this['getVariable'][_0x4783('0x64')](this,_0x6a215d['variable_id']);if(!_0x5c86df){return this['channel'][_0x4783('0x29')](_0x6a215d,'no\x20variable\x20found');}this[_0x4783('0x34')][_0x4783('0x95')](_0x5c86df,_0x566747);}this[_0x4783('0x96')][_0x4783('0x64')](this,_0x6a215d,_0x566747);return _0xe8adf3;};AGIVertices[_0x4783('0x10')]['noop']=function(_0x53a6ec){logger['info'](util['format'](_0x4783('0x161'),_0x53a6ec['label']));return this['channel'][_0x4783('0x9a')](_0x53a6ec[_0x4783('0x162')]||_0x53a6ec[_0x4783('0x99')]);};AGIVertices['prototype'][_0x4783('0x163')]=function(_0x578841){logger['info'](util[_0x4783('0x27')](_0x4783('0x164'),_0x578841[_0x4783('0x99')]));if(!this['isConfigured'](_0x578841['findBy'])){return this[_0x4783('0x34')]['error'](_0x578841,_0x4783('0x14e'));}logger['info'](util[_0x4783('0x27')](_0x4783('0x14f'),this[_0x4783('0x34')][_0x4783('0x38')],_0x578841[_0x4783('0x150')]));var _0x1d5fb3=this['getPause'][_0x4783('0x64')](this,_0x578841['pause_id']);var _0x5edcc0=this['agentPause'][_0x4783('0x64')](this,_0x578841[_0x4783('0x150')],_0x1d5fb3);if(_0x5edcc0){logger[_0x4783('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x4783('0x38')],_0x578841[_0x4783('0x150')]));this['channel'][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x151'),this[_0x4783('0x34')][_0x4783('0x38')],_0x578841[_0x4783('0x150')]));return{'code':0xc8,'result':_0x4783('0x156')};}else{logger[_0x4783('0x2c')](util[_0x4783('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x4783('0x38')],_0x578841['findBy']));this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x151'),this[_0x4783('0x34')][_0x4783('0x38')],_0x578841[_0x4783('0x150')]));return{'code':0xc8,'result':_0x4783('0x153')};}};AGIVertices[_0x4783('0x10')]['playback']=function(_0x7a46a9){logger['info'](util[_0x4783('0x27')](_0x4783('0x165'),_0x7a46a9[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x7a46a9[_0x4783('0x107')])){return this['channel'][_0x4783('0x29')](_0x7a46a9,_0x4783('0x108'));}var _0x25f06f=this[_0x4783('0x1f')][_0x4783('0x64')](this,_0x7a46a9[_0x4783('0x107')]);if(!_0x25f06f){return this[_0x4783('0x34')][_0x4783('0x29')](_0x7a46a9,_0x4783('0x166'));}var _0x53fe3=this[_0x4783('0x34')]['exec']('PLAYBACK',[_0x25f06f,_0x7a46a9['opts']]);if(_0x53fe3['result']===-0x1){return _0x53fe3;}return this['channel'][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xb5'),_0x4783('0x167'),_0x25f06f));};AGIVertices[_0x4783('0x10')][_0x4783('0x168')]=function(_0x1ae7ca){logger[_0x4783('0x2c')](util['format'](_0x4783('0x169'),_0x1ae7ca['label']));if(!this[_0x4783('0x7b')](_0x1ae7ca[_0x4783('0x16a')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x1ae7ca,_0x4783('0x16b'));}var _0x760bdd='';var _0x1a0b2d=parseInt(_0x1ae7ca[_0x4783('0x16a')],0xa);if(isNaN(_0x1a0b2d)){_0x760bdd=_0x1ae7ca[_0x4783('0x16a')];}else{_0x760bdd=this[_0x4783('0x13')]['sync'](this,_0x1ae7ca[_0x4783('0x16a')]);if(!_0x760bdd){return this[_0x4783('0x34')]['error'](_0x1ae7ca,_0x4783('0x16c'));}}var _0x5c402b='';if(this[_0x4783('0x7b')](_0x1ae7ca['file_id'])){var _0x50e3d5=this[_0x4783('0x1f')][_0x4783('0x64')](this,_0x1ae7ca[_0x4783('0x107')]);if(_0x50e3d5){_0x5c402b=_0x50e3d5;}}this[_0x4783('0x96')][_0x4783('0x64')](this,_0x1ae7ca,_0x760bdd);if(_0x1ae7ca[_0x4783('0xd9')][_0x4783('0x16d')]('x')<0x0){_0x1ae7ca[_0x4783('0xd9')]+='x';}if(_0x1ae7ca[_0x4783('0xd9')][_0x4783('0x16d')]('X')<0x0){_0x1ae7ca['opts']+='X';}this['channel'][_0x4783('0x95')](_0x4783('0x16e'),_0x760bdd?_0x760bdd['toLowerCase']():'');var _0x47d40e=this['channel'][_0x4783('0x9c')](_0x4783('0x16f'),[_0x760bdd,_0x1ae7ca[_0x4783('0xd9')],_0x1ae7ca[_0x4783('0xda')],_0x5c402b,_0x1ae7ca[_0x4783('0x5c')],_0x1ae7ca[_0x4783('0x6')],_0x1ae7ca['macro'],_0x1ae7ca[_0x4783('0x170')],'',_0x1ae7ca['position']]);if(_0x47d40e['result']===-0x1){return _0x47d40e;}return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xb5'),_0x4783('0x16f'),_0x760bdd));};AGIVertices[_0x4783('0x10')]['record']=function(_0x4da506){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x171'),_0x4da506['label']));var _0x3b8aa9=_0x4da506[_0x4783('0x172')]||_0x4783('0x125');var _0x591c91=util[_0x4783('0x27')]('%s_%s',this['channel'][_0x4783('0x35')],rs[_0x4783('0x10f')](0x5));var _0x1bb646=util[_0x4783('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x591c91,_0x3b8aa9);var _0x2aad4d=util['format'](_0x4783('0x12f'),FILES_PATH,_0x591c91);this['createSquareRecording'][_0x4783('0x64')](this,_0x4da506,_0x591c91,_0x1bb646);this[_0x4783('0x34')][_0x4783('0x95')]('RECORDING_SAVENAME',_0x591c91);logger[_0x4783('0x2c')](_0x4783('0x173'),_0x2aad4d,_0x3b8aa9,_0x4da506[_0x4783('0x174')],_0x4da506[_0x4783('0x5c')]);return this[_0x4783('0x34')][_0x4783('0x130')](_0x2aad4d,_0x3b8aa9,_0x4da506[_0x4783('0x174')],_0x4da506[_0x4783('0x5c')],undefined,!![]);};AGIVertices['prototype'][_0x4783('0x175')]=function(_0x41b45e){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x176'),_0x41b45e[_0x4783('0x99')]));if(!this['isConfigured'](_0x41b45e[_0x4783('0xda')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x177'));}var _0xcd3f9b=this[_0x4783('0x5a')][_0x4783('0x64')](this,_0x41b45e);logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Response:',util[_0x4783('0x178')](_0xcd3f9b,{'showHidden':![],'depth':null})));if(!this[_0x4783('0x7b')](_0x41b45e['variable_id'])){return this[_0x4783('0x34')]['noop'](_0x4783('0x179'));}var _0x52e18b=this[_0x4783('0x11')][_0x4783('0x64')](this,_0x41b45e[_0x4783('0xcd')]);if(!_0x52e18b){return this[_0x4783('0x34')][_0x4783('0x29')](_0x41b45e,'no\x20variable\x20found');}this[_0x4783('0x34')][_0x4783('0x95')](util[_0x4783('0x27')](_0x4783('0x17a'),_0x52e18b),_0xcd3f9b[_0x4783('0x6b')]?_0xcd3f9b['statusCode']:_0x4783('0x17b'));this[_0x4783('0x34')][_0x4783('0x95')](util[_0x4783('0x27')](_0x4783('0x17c'),_0x52e18b),_0xcd3f9b[_0x4783('0x6c')]?_0xcd3f9b[_0x4783('0x6c')]:'OK');if(_0xcd3f9b['body']){try{this[_0x4783('0x8d')](_0xcd3f9b['body'],_0x52e18b);}catch(_0x16a044){logger['error'](util[_0x4783('0x27')](_0x4783('0x17d'),_0x52e18b));}}return this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0xd1'),_0x52e18b));};AGIVertices[_0x4783('0x10')][_0x4783('0x17e')]=function(_0x14f578){logger['info'](util[_0x4783('0x27')](_0x4783('0x17f'),_0x14f578[_0x4783('0x99')]));return this['channel'][_0x4783('0x180')](_0x14f578[_0x4783('0x181')][_0x4783('0x182')](/\s+/g,''),_0x14f578[_0x4783('0x174')]);};AGIVertices['prototype']['saynumber']=function(_0x45a16a){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x45a16a[_0x4783('0x99')]));return this['channel'][_0x4783('0x183')](_0x45a16a['number'][_0x4783('0x182')](/\s+/g,''),_0x45a16a[_0x4783('0x174')]);};AGIVertices[_0x4783('0x10')][_0x4783('0x184')]=function(_0x5896c2){logger['info'](util['format'](_0x4783('0x185'),_0x5896c2[_0x4783('0x99')]));return this[_0x4783('0x34')][_0x4783('0x186')](_0x5896c2['text'],_0x5896c2[_0x4783('0x174')]);};AGIVertices[_0x4783('0x10')]['sendMail']=function(_0x20b1c6){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x187'),_0x20b1c6[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x20b1c6[_0x4783('0x188')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x189'));}var _0x357813=this[_0x4783('0x21')][_0x4783('0x64')](this,_0x20b1c6[_0x4783('0x188')]);if(!_0x357813||!_0x357813[_0x4783('0x18a')]){return this[_0x4783('0x34')]['error'](_0x20b1c6,_0x4783('0x18b'));}var _0x59de0e={'from':util[_0x4783('0x27')](_0x4783('0x18c'),_0x357813[_0x4783('0x12')],_0x357813[_0x4783('0x18d')]||_0x357813[_0x4783('0x18a')][_0x4783('0x18e')]),'to':_0x20b1c6['to']||'','cc':_0x20b1c6['cc']||'','bcc':_0x20b1c6[_0x4783('0x18f')]||'','subject':_0x20b1c6[_0x4783('0x190')],'html':_0x20b1c6['text'],'text':_0x20b1c6[_0x4783('0x52')]};if(this[_0x4783('0x7b')](_0x20b1c6['template_id'])){}logger[_0x4783('0xd3')](_0x4783('0x191'),JSON[_0x4783('0x67')](_0x59de0e));this[_0x4783('0x96')][_0x4783('0x64')](this,_0x20b1c6,_0x20b1c6[_0x4783('0x188')]);this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0x192'),_0x357813[_0x4783('0x12')]));this[_0x4783('0x22')][_0x4783('0x64')](this,_0x357813[_0x4783('0x193')],_0x59de0e);return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x194'));};AGIVertices[_0x4783('0x10')][_0x4783('0x195')]=function(_0x17712e){logger[_0x4783('0x2c')](util['format'](_0x4783('0x196'),_0x17712e['label']));return this[_0x4783('0x34')]['noop'](_0x4783('0x197'));};AGIVertices[_0x4783('0x10')][_0x4783('0x198')]=function(_0x179a9f){logger[_0x4783('0x2c')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x179a9f[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x179a9f[_0x4783('0x199')])){return this['channel'][_0x4783('0x9a')](_0x4783('0x19a'));}var _0x4b83ad=this[_0x4783('0x31')]['sync'](this,_0x179a9f['sms_account_id']);if(!_0x4b83ad){return this[_0x4783('0x34')][_0x4783('0x29')](_0x179a9f,'no\x20sms\x20account\x20found');}var _0xf8715e={'body':_0x179a9f['sms_text'],'phone':_0x179a9f['to']||'','SmsAccountId':_0x4b83ad['id']};logger[_0x4783('0xd3')](_0x4783('0x19b'),JSON[_0x4783('0x67')](_0xf8715e));this[_0x4783('0x96')]['sync'](this,_0x179a9f,_0x179a9f[_0x4783('0x199')]);this[_0x4783('0x34')]['noop'](util['format'](_0x4783('0x19c'),_0x4b83ad[_0x4783('0x12')]));this[_0x4783('0x33')][_0x4783('0x64')](this,_0xf8715e);return this['channel'][_0x4783('0x9a')](_0x4783('0x19d'));};AGIVertices[_0x4783('0x10')]['set']=function(_0x224ba7){logger[_0x4783('0x2c')](util['format'](_0x4783('0x19e'),_0x224ba7[_0x4783('0x99')]));if(!this['isConfigured'](_0x224ba7[_0x4783('0xcd')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x224ba7,_0x4783('0x19f'));}var _0x1c52be=this['getVariable'][_0x4783('0x64')](this,_0x224ba7[_0x4783('0xcd')]);if(!_0x1c52be){return this[_0x4783('0x34')][_0x4783('0x29')](_0x224ba7,'no\x20variable\x20found');}return this['channel'][_0x4783('0x95')](_0x1c52be,_0x224ba7['variable_value']);};AGIVertices['prototype'][_0x4783('0x1a0')]=function(_0x55d5ad){logger[_0x4783('0x2c')](util['format'](_0x4783('0x1a1'),_0x55d5ad[_0x4783('0x99')]));this[_0x4783('0x34')]['noop'](_0x4783('0x1a2'));if(_0x55d5ad[_0x4783('0xa9')]===_0x4783('0x1a3')){this['channel'][_0x4783('0x9a')](_0x4783('0x1a4'));return this['channel']['answer']();}return this['channel'][_0x4783('0x9a')](_0x4783('0x1a5'));};AGIVertices[_0x4783('0x10')][_0x4783('0x1a6')]=function(_0x53214b){logger['info'](util[_0x4783('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x53214b[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x53214b[_0x4783('0x1a7')])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x53214b,_0x4783('0x1a8'));}var _0x4f1be2=this[_0x4783('0x16')]['sync'](this,_0x53214b[_0x4783('0x1a7')]);if(!this[_0x4783('0x7b')](_0x4f1be2)){return this[_0x4783('0x34')]['error'](_0x53214b,util[_0x4783('0x27')](_0x4783('0x1a9'),_0x53214b[_0x4783('0x1a7')]));}if(_0x4f1be2===this[_0x4783('0x34')]['arg_1']){return this['channel'][_0x4783('0x29')](_0x53214b,_0x4783('0x1aa'));}this[_0x4783('0x96')][_0x4783('0x64')](this,_0x53214b,_0x4f1be2);var _0x5a6eb1=this[_0x4783('0x34')][_0x4783('0x9c')](_0x4783('0x1ab'),util[_0x4783('0x27')](_0x4783('0x1ac'),config[_0x4783('0x6')][_0x4783('0x1ad')]||'127.0.0.1',_0x4f1be2,this[_0x4783('0x34')]['arg_1']));if(_0x5a6eb1[_0x4783('0x9e')]===-0x1){return _0x5a6eb1;}return this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0xb5'),_0x4783('0x1ab'),_0x4f1be2));};AGIVertices['prototype'][_0x4783('0x1ae')]=function(_0x27e77b){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x1af'),_0x27e77b[_0x4783('0x99')]));var _0x5cb8fe=this[_0x4783('0x4f')][_0x4783('0x64')](this,_0x27e77b['command']);this[_0x4783('0x96')][_0x4783('0x64')](this,_0x27e77b,_0x27e77b[_0x4783('0xa8')]);if(this[_0x4783('0x7b')](_0x27e77b[_0x4783('0xcd')])){var _0x4efa85=this['getVariable'][_0x4783('0x64')](this,_0x27e77b[_0x4783('0xcd')]);if(_0x4efa85){this[_0x4783('0x34')][_0x4783('0x95')](_0x4efa85,_0x5cb8fe);return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x27e77b[_0x4783('0xa8')],_0x4efa85));}}return this['channel']['noop'](util[_0x4783('0x27')](_0x4783('0x1b0'),_0x27e77b[_0x4783('0xa8')]));};AGIVertices[_0x4783('0x10')][_0x4783('0x1b1')]=function(_0x5de46a){logger[_0x4783('0x2c')](util[_0x4783('0x27')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x5de46a[_0x4783('0x99')]));_0x5de46a['text']=_0x5de46a[_0x4783('0x52')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4783('0x7b')](_0x5de46a[_0x4783('0x51')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x1b2'));}if(!this[_0x4783('0x7b')](_0x5de46a[_0x4783('0x52')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x9b'));}this['channel'][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x1b3'),_0x5de46a['text']));var _0x50374c=this[_0x4783('0x50')]['sync'](this,_0x5de46a);if(_0x50374c){this[_0x4783('0x34')][_0x4783('0x9a')](util['format'](_0x4783('0x1b4'),_0x50374c));var _0x3b8ce1=this[_0x4783('0x34')]['streamFile'](_0x50374c);try{fs[_0x4783('0xfc')](_0x50374c+_0x4783('0x11b'));}catch(_0x36aff0){logger[_0x4783('0x29')](_0x36aff0);}return _0x3b8ce1;}return this[_0x4783('0x34')][_0x4783('0x29')](_0x5de46a,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x4783('0x10')][_0x4783('0x1b5')]=function(_0x5a5268){logger['info'](util[_0x4783('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5a5268[_0x4783('0x99')]));_0x5a5268[_0x4783('0x52')]=_0x5a5268[_0x4783('0x52')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5a5268[_0x4783('0x52')])){return this[_0x4783('0x34')][_0x4783('0x9a')](_0x4783('0x9b'));}this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x5a5268[_0x4783('0x52')]));var _0x5e9e6b=this[_0x4783('0x58')]['sync'](this,_0x5a5268);if(_0x5e9e6b){this['channel']['noop'](util[_0x4783('0x27')](_0x4783('0x1b6'),_0x5e9e6b));var _0x43f846=this[_0x4783('0x34')]['streamFile'](_0x5e9e6b);try{fs[_0x4783('0xfc')](_0x5e9e6b+'.wav');}catch(_0x10831a){logger['error'](_0x10831a);}return _0x43f846;}return this[_0x4783('0x34')][_0x4783('0x29')](_0x5a5268,_0x4783('0x1b7'));};AGIVertices[_0x4783('0x10')][_0x4783('0x1b8')]=function(_0x2270c1){logger['info'](util[_0x4783('0x27')](_0x4783('0x1b9'),_0x2270c1[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x2270c1[_0x4783('0x150')])){return this['channel']['error'](_0x2270c1,'no\x20find\x20by\x20configured');}logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x14f'),this[_0x4783('0x34')][_0x4783('0x38')],_0x2270c1[_0x4783('0x150')]));var _0x5d3d11=this[_0x4783('0x4b')][_0x4783('0x64')](this,_0x2270c1[_0x4783('0x150')]);if(_0x5d3d11){logger[_0x4783('0x2c')](util['format'](_0x4783('0x151'),this[_0x4783('0x34')][_0x4783('0x38')],_0x2270c1[_0x4783('0x150')]));this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0x151'),this['channel'][_0x4783('0x38')],_0x2270c1['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x152'),this[_0x4783('0x34')][_0x4783('0x38')],_0x2270c1[_0x4783('0x150')]));this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4783('0x34')][_0x4783('0x38')],_0x2270c1[_0x4783('0x150')]));return{'code':0xc8,'result':_0x4783('0x153')};}};AGIVertices[_0x4783('0x10')]['voicemail']=function(_0x34a766){logger[_0x4783('0x2c')](util[_0x4783('0x27')](_0x4783('0x1ba'),_0x34a766[_0x4783('0x99')]));var _0x404792=this['channel'][_0x4783('0x9c')](_0x4783('0x1bb'),[_0x34a766[_0x4783('0x1bc')],_0x34a766[_0x4783('0x6e')]]);if(_0x404792[_0x4783('0x9e')]===-0x1){return _0x404792;}return this[_0x4783('0x34')][_0x4783('0x9a')](util[_0x4783('0x27')](_0x4783('0xb5'),'VOICEMAIL',_0x34a766[_0x4783('0x1bc')]));};AGIVertices[_0x4783('0x10')][_0x4783('0x1bd')]=function(_0x49d534){logger['info'](util[_0x4783('0x27')](_0x4783('0x1be'),_0x49d534[_0x4783('0x99')]));if(!this[_0x4783('0x7b')](_0x49d534['variable_id'])){return this[_0x4783('0x34')][_0x4783('0x29')](_0x49d534,'no\x20variable\x20selected');}var _0x380ee9=this[_0x4783('0x11')][_0x4783('0x64')](this,_0x49d534[_0x4783('0xcd')]);if(!_0x380ee9){return this[_0x4783('0x34')]['error'](_0x49d534,_0x4783('0x10d'));}var _0x27547e=this[_0x4783('0x34')][_0x4783('0x11')](_0x380ee9);return{'code':0xc8,'result':_0x27547e[_0x4783('0x93')]?_0x27547e[_0x4783('0x93')]:'-'};};String[_0x4783('0x10')]['replaceAll']=function(_0x32d1b3,_0x41ecde){return this[_0x4783('0x91')](_0x32d1b3)[_0x4783('0x1bf')](_0x41ecde);};module[_0x4783('0x1c0')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 6d42740..498e3b5 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 _0xfdfb=['error','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','queue','[ACW][syncAgentConnect]\x20%s','message','attended','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','[%s][UPDATE][ERRORS:%s]'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xfdfb,0x112));var _0xbfdf=function(_0x16d206,_0x22df50){_0x16d206=_0x16d206-0x0;var _0x52012a=_0xfdfb[_0x16d206];return _0x52012a;};'use strict';var _=require(_0xbfdf('0x0'));var moment=require(_0xbfdf('0x1'));var ami=require('../ami');var logger=require(_0xbfdf('0x2'))(_0xbfdf('0x3'));var RpcUser=require(_0xbfdf('0x4'));var RpcVoiceAgentReport=require(_0xbfdf('0x5'));function Acw(_0xe5dcbc){this[_0xbfdf('0x6')]=_0xe5dcbc[_0xbfdf('0x6')];this[_0xbfdf('0x7')]=_0xe5dcbc[_0xbfdf('0x7')];this['timers']=_0xe5dcbc[_0xbfdf('0x8')];this[_0xbfdf('0x9')]={};ami['on'](_0xbfdf('0xa'),this[_0xbfdf('0xb')][_0xbfdf('0xc')](this));ami['on'](_0xbfdf('0xd'),this[_0xbfdf('0xe')][_0xbfdf('0xc')](this));ami['on'](_0xbfdf('0xf'),this[_0xbfdf('0x10')][_0xbfdf('0xc')](this));ami['on'](_0xbfdf('0x11'),this[_0xbfdf('0x12')][_0xbfdf('0xc')](this));ami['on'](_0xbfdf('0x13'),this[_0xbfdf('0x14')][_0xbfdf('0xc')](this));ami['on'](_0xbfdf('0x15'),this[_0xbfdf('0x16')][_0xbfdf('0xc')](this));ami['on'](_0xbfdf('0x17'),this[_0xbfdf('0x18')][_0xbfdf('0xc')](this));}function getDiff(_0x2668a0){var _0x55c8c0=moment()[_0xbfdf('0x19')](0x0);var _0xf13b6=moment(_0x2668a0)[_0xbfdf('0x19')](0x0);return _0x55c8c0[_0xbfdf('0x1a')](_0xf13b6,_0xbfdf('0x1b'));}Acw[_0xbfdf('0x1c')][_0xbfdf('0x1d')]=function(_0x33a0e8){try{var _0x4d92eb=this;var _0x4b9cf6=this[_0xbfdf('0x9')][_0x33a0e8][_0xbfdf('0x1e')];var _0x1e89c9=this[_0xbfdf('0x9')][_0x33a0e8]['queue'];var _0x3570b4=this[_0xbfdf('0x6')][_0x1e89c9];var _0x6029cd=![];var _0x3ae229=_0xbfdf('0x1f');if(_0x3570b4[_0xbfdf('0x20')]){if(_0x3570b4['mandatoryDispositionPause']['name']){_0x6029cd=!![];_0x3ae229=_0x3570b4[_0xbfdf('0x21')][_0xbfdf('0x22')];}}return ami[_0xbfdf('0x23')]({'action':'QueuePause','interface':_0x4b9cf6,'paused':!![],'reason':_0x3ae229})[_0xbfdf('0x24')](function(){if(_0x4d92eb['agents'][_0x4b9cf6]){return RpcUser[_0xbfdf('0x25')](_0x4d92eb[_0xbfdf('0x7')][_0x4b9cf6]['id'])[_0xbfdf('0x24')](function(_0x24b34c){if(_0x24b34c&&!_0x24b34c['voicePause']){logger[_0xbfdf('0x26')](_0xbfdf('0x27'),_0x33a0e8,_0x4b9cf6,_0x1e89c9);var _0x1f6f7c=_0x4d92eb[_0xbfdf('0x9')][_0x33a0e8]['attended']&&_0x4d92eb[_0xbfdf('0x9')][_0x33a0e8][_0xbfdf('0x28')]?_0x4d92eb[_0xbfdf('0x9')][_0x33a0e8][_0xbfdf('0x28')]:_0x33a0e8;return RpcUser[_0xbfdf('0x29')](_0x4d92eb[_0xbfdf('0x7')][_0x4b9cf6],_0x3ae229,_0x1f6f7c)['then'](function(){if(!_0x6029cd){_0x4d92eb['timers'][_0x4b9cf6]={};logger[_0xbfdf('0x26')](_0xbfdf('0x2a'),_0x33a0e8,_0x4d92eb[_0xbfdf('0x6')][_0x1e89c9][_0xbfdf('0x2b')],_0x4b9cf6,_0x1e89c9);_0x4d92eb[_0xbfdf('0x8')][_0x4b9cf6][_0xbfdf('0x2c')]=setTimeout(_0x4d92eb[_0xbfdf('0x2d')]['bind'](_0x4d92eb,_0x4b9cf6),_0x4d92eb[_0xbfdf('0x6')][_0x1e89c9][_0xbfdf('0x2b')]*0x3e8);_0x4d92eb['timers'][_0x4b9cf6][_0xbfdf('0x2e')]=moment()[_0xbfdf('0x2f')](_0xbfdf('0x30'));_0x4d92eb[_0xbfdf('0x8')][_0x4b9cf6][_0xbfdf('0x31')]=_0x33a0e8;_0x4d92eb[_0xbfdf('0x8')][_0x4b9cf6]['queue']=_0x1e89c9;_0x4d92eb[_0xbfdf('0x8')][_0x4b9cf6][_0xbfdf('0x32')]=function(){var _0x1f4a48=getDiff(_0x4d92eb[_0xbfdf('0x8')][_0x4b9cf6][_0xbfdf('0x2e')]);clearTimeout(_0x4d92eb[_0xbfdf('0x8')][_0x4b9cf6][_0xbfdf('0x2c')]);_0x4d92eb[_0xbfdf('0x8')][_0x4b9cf6][_0xbfdf('0x2c')]=![];RpcVoiceAgentReport[_0xbfdf('0x33')]({'acwtime':_0x1f4a48},_0x4d92eb[_0xbfdf('0x8')][_0x4b9cf6]['uniqueid'],_0x4b9cf6)[_0xbfdf('0x24')](function(_0x219514){logger[_0xbfdf('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x33a0e8,_0x1f4a48,_0x219514);})[_0xbfdf('0x34')](function(_0x194f7b){logger['error'](_0xbfdf('0x35'),_0x33a0e8,_0x194f7b);});delete _0x4d92eb['timers'][_0x4b9cf6];};}});}else{logger[_0xbfdf('0x26')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x33a0e8,_0x4b9cf6,_0x1e89c9);}});}})[_0xbfdf('0x34')](function(){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x33a0e8,_0x4d92eb[_0xbfdf('0x6')][_0x1e89c9][_0xbfdf('0x2b')],_0x4b9cf6,_0x1e89c9);})['finally'](function(){delete _0x4d92eb[_0xbfdf('0x9')][_0x33a0e8];});}catch(_0x18e6cb){logger[_0xbfdf('0x36')]('[ACW][START]\x20%s',_0x18e6cb['message']);}};Acw['prototype'][_0xbfdf('0x2d')]=function(_0x154862){try{var _0x5b9341=this;if(_0x5b9341[_0xbfdf('0x8')][_0x154862]){_0x5b9341['timers'][_0x154862]['timer']=![];var _0x139b8d=_0x5b9341[_0xbfdf('0x8')][_0x154862][_0xbfdf('0x31')];var _0x2f1ab1=_0x5b9341[_0xbfdf('0x8')][_0x154862]['queue'];var _0x3a08f2=_0x5b9341['voiceQueues'][_0x2f1ab1]['acwTimeout'];logger[_0xbfdf('0x26')](_0xbfdf('0x37'),_0x139b8d,_0x154862);RpcUser['saveUnpause'](this[_0xbfdf('0x7')][_0x154862]);RpcVoiceAgentReport[_0xbfdf('0x33')]({'acwtime':_0x3a08f2,'agentacw':!![]},_0x139b8d,_0x154862)[_0xbfdf('0x24')](function(_0x621ea7){logger[_0xbfdf('0x26')](_0xbfdf('0x38'),_0x139b8d,_0x3a08f2,_0x621ea7);})['catch'](function(_0x5451dc){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x139b8d,_0x5451dc);});}else{logger['error'](_0xbfdf('0x39'),_0x154862);if(_0x5b9341[_0xbfdf('0x8')]){logger['info'](_0xbfdf('0x3a'),JSON[_0xbfdf('0x3b')](_0x5b9341[_0xbfdf('0x8')]));}}}catch(_0x4002c0){logger[_0xbfdf('0x36')](_0xbfdf('0x3c'),_0x4002c0['message']);}};Acw[_0xbfdf('0x1c')][_0xbfdf('0xb')]=function(_0x22c134){try{if(this['voiceQueues'][_0x22c134[_0xbfdf('0x3d')]]&&(this[_0xbfdf('0x6')][_0x22c134['queue']]['acw']||this[_0xbfdf('0x6')][_0x22c134[_0xbfdf('0x3d')]][_0xbfdf('0x20')])){if(this['agents'][_0x22c134[_0xbfdf('0x1e')]]){this[_0xbfdf('0x9')][_0x22c134[_0xbfdf('0x31')]]={'queue':_0x22c134[_0xbfdf('0x3d')],'interface':_0x22c134[_0xbfdf('0x1e')],'destlinkedid':_0x22c134['destlinkedid']};}}}catch(_0x1af0d6){logger[_0xbfdf('0x36')](_0xbfdf('0x3e'),_0x1af0d6['message']);}};Acw[_0xbfdf('0x1c')][_0xbfdf('0x18')]=function(_0x5b9aab){try{if(this[_0xbfdf('0x6')][_0x5b9aab[_0xbfdf('0x3d')]]&&(this[_0xbfdf('0x6')][_0x5b9aab['queue']][_0xbfdf('0x3')]||this[_0xbfdf('0x6')][_0x5b9aab[_0xbfdf('0x3d')]]['mandatoryDisposition'])){if(this[_0xbfdf('0x7')][_0x5b9aab['interface']]){this['channels'][_0x5b9aab[_0xbfdf('0x31')]]={'queue':_0x5b9aab[_0xbfdf('0x3d')],'interface':_0x5b9aab['interface']};}}}catch(_0x2bf53e){logger[_0xbfdf('0x36')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2bf53e[_0xbfdf('0x3f')]);}};Acw[_0xbfdf('0x1c')][_0xbfdf('0xe')]=function(_0xa0b4e6){try{if(this[_0xbfdf('0x9')][_0xa0b4e6[_0xbfdf('0x31')]]&&_['isUndefined'](this[_0xbfdf('0x9')][_0xa0b4e6['uniqueid']][_0xbfdf('0x40')])){logger[_0xbfdf('0x26')]('[%s][HANGUP:UNIQUEID]',_0xa0b4e6[_0xbfdf('0x31')]);this[_0xbfdf('0x1d')](_0xa0b4e6['uniqueid']);}else if(this['channels'][_0xa0b4e6[_0xbfdf('0x41')]]&&_['isUndefined'](this['channels'][_0xa0b4e6['linkedid']][_0xbfdf('0x40')])){logger[_0xbfdf('0x26')](_0xbfdf('0x42'),_0xa0b4e6[_0xbfdf('0x41')]);this[_0xbfdf('0x1d')](_0xa0b4e6['linkedid']);}}catch(_0x235739){logger[_0xbfdf('0x36')]('[ACW][syncHangupRequest]\x20%s',_0x235739[_0xbfdf('0x3f')]);}};Acw['prototype'][_0xbfdf('0x10')]=function(_0x57bf34){try{if(this[_0xbfdf('0x9')][_0x57bf34['uniqueid']]&&this[_0xbfdf('0x9')][_0x57bf34[_0xbfdf('0x31')]]['attended']){logger[_0xbfdf('0x26')](_0xbfdf('0x43'),_0x57bf34[_0xbfdf('0x31')]);this['startAcw'](_0x57bf34['uniqueid']);}else if(this['channels'][_0x57bf34['linkedid']]&&this[_0xbfdf('0x9')][_0x57bf34[_0xbfdf('0x41')]][_0xbfdf('0x40')]){logger[_0xbfdf('0x26')](_0xbfdf('0x44'),_0x57bf34[_0xbfdf('0x41')]);this['startAcw'](_0x57bf34['linkedid']);}}catch(_0xf42a4f){logger[_0xbfdf('0x36')]('[ACW][syncHangup]\x20%s',_0xf42a4f[_0xbfdf('0x3f')]);}};Acw['prototype'][_0xbfdf('0x14')]=function(_0x131b35){try{if(!_[_0xbfdf('0x45')](this[_0xbfdf('0x9')][_0x131b35[_0xbfdf('0x46')]])){this[_0xbfdf('0x1d')](_0x131b35[_0xbfdf('0x46')]);if(this[_0xbfdf('0x9')][_0x131b35[_0xbfdf('0x47')]]){this[_0xbfdf('0x9')][_0x131b35['secondtransfereruniqueid']][_0xbfdf('0x40')]=!![];this[_0xbfdf('0x9')][_0x131b35[_0xbfdf('0x48')]]=this[_0xbfdf('0x9')][_0x131b35[_0xbfdf('0x47')]];delete this['channels'][_0x131b35[_0xbfdf('0x47')]];}}else if(!_[_0xbfdf('0x45')](this[_0xbfdf('0x9')][_0x131b35[_0xbfdf('0x48')]])){this[_0xbfdf('0x1d')](_0x131b35[_0xbfdf('0x48')]);if(this[_0xbfdf('0x9')][_0x131b35['origtransfereruniqueid']]){this[_0xbfdf('0x9')][_0x131b35[_0xbfdf('0x49')]][_0xbfdf('0x40')]=!![];this[_0xbfdf('0x9')][_0x131b35[_0xbfdf('0x46')]]=this['channels'][_0x131b35[_0xbfdf('0x49')]];delete this[_0xbfdf('0x9')][_0x131b35[_0xbfdf('0x49')]];}}}catch(_0x45b405){logger[_0xbfdf('0x36')](_0xbfdf('0x4a'),_0x45b405[_0xbfdf('0x3f')]);}};Acw[_0xbfdf('0x1c')][_0xbfdf('0x16')]=function(_0x23c5f5){try{if(this[_0xbfdf('0x9')][_0x23c5f5[_0xbfdf('0x4b')]]){logger[_0xbfdf('0x26')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xbfdf('0x3b')](_0x23c5f5[_0xbfdf('0x4b')]));this['startAcw'](_0x23c5f5['transfereruniqueid']);}else if(this[_0xbfdf('0x9')][_0x23c5f5[_0xbfdf('0x4c')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xbfdf('0x3b')](_0x23c5f5[_0xbfdf('0x4c')]));this[_0xbfdf('0x1d')](_0x23c5f5[_0xbfdf('0x4c')]);}}catch(_0x1e0fb0){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x1e0fb0[_0xbfdf('0x3f')]);}};Acw[_0xbfdf('0x1c')][_0xbfdf('0x12')]=function(_0x26569a){try{if(this['voiceQueues'][_0x26569a[_0xbfdf('0x3d')]]&&this['voiceQueues'][_0x26569a[_0xbfdf('0x3d')]][_0xbfdf('0x4d')]===_0xbfdf('0x4e')){if(this['agents'][_0x26569a['interface']]){logger[_0xbfdf('0x26')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x26569a[_0xbfdf('0x31')],_0x26569a['interface'],_0x26569a['queue']);return RpcUser[_0xbfdf('0x29')](this[_0xbfdf('0x7')][_0x26569a[_0xbfdf('0x1e')]],_0xbfdf('0x4f'),_0x26569a[_0xbfdf('0x31')]);}}}catch(_0x10e9eb){logger[_0xbfdf('0x36')](_0xbfdf('0x50'),_0x10e9eb['message']);}};module[_0xbfdf('0x51')]=Acw; \ No newline at end of file +var _0xa215=['prototype','interface','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds'];(function(_0x5aaa83,_0x199263){var _0x393d10=function(_0x1a59cc){while(--_0x1a59cc){_0x5aaa83['push'](_0x5aaa83['shift']());}};_0x393d10(++_0x199263);}(_0xa215,0x1ec));var _0x5a21=function(_0x1bb11e,_0x58fd78){_0x1bb11e=_0x1bb11e-0x0;var _0x422492=_0xa215[_0x1bb11e];return _0x422492;};'use strict';var _=require(_0x5a21('0x0'));var moment=require('moment');var ami=require(_0x5a21('0x1'));var logger=require(_0x5a21('0x2'))('acw');var RpcUser=require(_0x5a21('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x55adfb){this[_0x5a21('0x4')]=_0x55adfb['voiceQueues'];this[_0x5a21('0x5')]=_0x55adfb[_0x5a21('0x5')];this[_0x5a21('0x6')]=_0x55adfb['timers'];this[_0x5a21('0x7')]={};ami['on'](_0x5a21('0x8'),this[_0x5a21('0x9')][_0x5a21('0xa')](this));ami['on'](_0x5a21('0xb'),this[_0x5a21('0xc')][_0x5a21('0xa')](this));ami['on'](_0x5a21('0xd'),this[_0x5a21('0xe')][_0x5a21('0xa')](this));ami['on'](_0x5a21('0xf'),this['syncAgentRingNoAnswer'][_0x5a21('0xa')](this));ami['on'](_0x5a21('0x10'),this[_0x5a21('0x11')][_0x5a21('0xa')](this));ami['on'](_0x5a21('0x12'),this[_0x5a21('0x13')]['bind'](this));ami['on'](_0x5a21('0x14'),this[_0x5a21('0x15')][_0x5a21('0xa')](this));}function getDiff(_0x20aba4){var _0x181c76=moment()[_0x5a21('0x16')](0x0);var _0x167abf=moment(_0x20aba4)[_0x5a21('0x16')](0x0);return _0x181c76['diff'](_0x167abf,_0x5a21('0x17'));}Acw[_0x5a21('0x18')]['startAcw']=function(_0x146c03){try{var _0x269036=this;var _0x3cb4fc=this[_0x5a21('0x7')][_0x146c03][_0x5a21('0x19')];var _0x37bbce=this[_0x5a21('0x7')][_0x146c03]['queue'];var _0x2d06da=this[_0x5a21('0x4')][_0x37bbce];var _0x16d432=![];var _0xab85d7='ACW';if(_0x2d06da[_0x5a21('0x1a')]){if(_0x2d06da['mandatoryDispositionPause'][_0x5a21('0x1b')]){_0x16d432=!![];_0xab85d7=_0x2d06da[_0x5a21('0x1c')]['name'];}}return ami[_0x5a21('0x1d')]({'action':_0x5a21('0x1e'),'interface':_0x3cb4fc,'paused':!![],'reason':_0xab85d7})[_0x5a21('0x1f')](function(){if(_0x269036[_0x5a21('0x5')][_0x3cb4fc]){return RpcUser[_0x5a21('0x20')](_0x269036[_0x5a21('0x5')][_0x3cb4fc]['id'])[_0x5a21('0x1f')](function(_0x3b8cd3){if(_0x3b8cd3&&!_0x3b8cd3[_0x5a21('0x21')]){logger[_0x5a21('0x22')](_0x5a21('0x23'),_0x146c03,_0x3cb4fc,_0x37bbce);var _0xa3fdb4=_0x269036[_0x5a21('0x7')][_0x146c03]['attended']&&_0x269036[_0x5a21('0x7')][_0x146c03][_0x5a21('0x24')]?_0x269036[_0x5a21('0x7')][_0x146c03][_0x5a21('0x24')]:_0x146c03;return RpcUser[_0x5a21('0x25')](_0x269036['agents'][_0x3cb4fc],_0xab85d7,_0xa3fdb4)[_0x5a21('0x1f')](function(){if(!_0x16d432){_0x269036[_0x5a21('0x6')][_0x3cb4fc]={};logger[_0x5a21('0x22')](_0x5a21('0x26'),_0x146c03,_0x269036[_0x5a21('0x4')][_0x37bbce][_0x5a21('0x27')],_0x3cb4fc,_0x37bbce);_0x269036[_0x5a21('0x6')][_0x3cb4fc][_0x5a21('0x28')]=setTimeout(_0x269036['stopAcw']['bind'](_0x269036,_0x3cb4fc),_0x269036[_0x5a21('0x4')][_0x37bbce][_0x5a21('0x27')]*0x3e8);_0x269036[_0x5a21('0x6')][_0x3cb4fc][_0x5a21('0x29')]=moment()[_0x5a21('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');_0x269036[_0x5a21('0x6')][_0x3cb4fc][_0x5a21('0x2b')]=_0x146c03;_0x269036[_0x5a21('0x6')][_0x3cb4fc][_0x5a21('0x2c')]=_0x37bbce;_0x269036['timers'][_0x3cb4fc][_0x5a21('0x2d')]=function(){var _0x17d364=getDiff(_0x269036[_0x5a21('0x6')][_0x3cb4fc][_0x5a21('0x29')]);clearTimeout(_0x269036['timers'][_0x3cb4fc][_0x5a21('0x28')]);_0x269036[_0x5a21('0x6')][_0x3cb4fc][_0x5a21('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x17d364},_0x269036['timers'][_0x3cb4fc]['uniqueid'],_0x3cb4fc)[_0x5a21('0x1f')](function(_0x58525c){logger[_0x5a21('0x22')](_0x5a21('0x2e'),_0x146c03,_0x17d364,_0x58525c);})[_0x5a21('0x2f')](function(_0x399bce){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x146c03,_0x399bce);});delete _0x269036[_0x5a21('0x6')][_0x3cb4fc];};}});}else{logger[_0x5a21('0x22')](_0x5a21('0x30'),_0x146c03,_0x3cb4fc,_0x37bbce);}});}})[_0x5a21('0x2f')](function(){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x146c03,_0x269036['voiceQueues'][_0x37bbce]['acwTimeout'],_0x3cb4fc,_0x37bbce);})[_0x5a21('0x31')](function(){delete _0x269036[_0x5a21('0x7')][_0x146c03];});}catch(_0x258895){logger[_0x5a21('0x32')](_0x5a21('0x33'),_0x258895[_0x5a21('0x34')]);}};Acw[_0x5a21('0x18')][_0x5a21('0x35')]=function(_0x33b094){try{var _0x1c1af8=this;if(_0x1c1af8['timers'][_0x33b094]){_0x1c1af8[_0x5a21('0x6')][_0x33b094][_0x5a21('0x28')]=![];var _0x267e16=_0x1c1af8['timers'][_0x33b094]['uniqueid'];var _0x254b47=_0x1c1af8[_0x5a21('0x6')][_0x33b094]['queue'];var _0x33865b=_0x1c1af8[_0x5a21('0x4')][_0x254b47][_0x5a21('0x27')];logger['info'](_0x5a21('0x36'),_0x267e16,_0x33b094);RpcUser[_0x5a21('0x37')](this['agents'][_0x33b094]);RpcVoiceAgentReport['update']({'acwtime':_0x33865b,'agentacw':!![]},_0x267e16,_0x33b094)[_0x5a21('0x1f')](function(_0x4073e4){logger[_0x5a21('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x267e16,_0x33865b,_0x4073e4);})[_0x5a21('0x2f')](function(_0x17735d){logger[_0x5a21('0x32')](_0x5a21('0x38'),_0x267e16,_0x17735d);});}else{logger[_0x5a21('0x32')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x33b094);if(_0x1c1af8[_0x5a21('0x6')]){logger[_0x5a21('0x22')](_0x5a21('0x39'),JSON[_0x5a21('0x3a')](_0x1c1af8[_0x5a21('0x6')]));}}}catch(_0x3daee1){logger['error'](_0x5a21('0x3b'),_0x3daee1[_0x5a21('0x34')]);}};Acw['prototype'][_0x5a21('0x9')]=function(_0x30f4b6){try{if(this[_0x5a21('0x4')][_0x30f4b6[_0x5a21('0x2c')]]&&(this['voiceQueues'][_0x30f4b6[_0x5a21('0x2c')]]['acw']||this['voiceQueues'][_0x30f4b6['queue']]['mandatoryDisposition'])){if(this[_0x5a21('0x5')][_0x30f4b6[_0x5a21('0x19')]]){this['channels'][_0x30f4b6[_0x5a21('0x2b')]]={'queue':_0x30f4b6[_0x5a21('0x2c')],'interface':_0x30f4b6[_0x5a21('0x19')],'destlinkedid':_0x30f4b6[_0x5a21('0x24')]};}}}catch(_0x16effc){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x16effc[_0x5a21('0x34')]);}};Acw[_0x5a21('0x18')][_0x5a21('0x15')]=function(_0x4dc458){try{if(this[_0x5a21('0x4')][_0x4dc458[_0x5a21('0x2c')]]&&(this['voiceQueues'][_0x4dc458[_0x5a21('0x2c')]][_0x5a21('0x3c')]||this[_0x5a21('0x4')][_0x4dc458[_0x5a21('0x2c')]][_0x5a21('0x1a')])){if(this[_0x5a21('0x5')][_0x4dc458['interface']]){this[_0x5a21('0x7')][_0x4dc458['uniqueid']]={'queue':_0x4dc458[_0x5a21('0x2c')],'interface':_0x4dc458[_0x5a21('0x19')]};}}}catch(_0x3d14f4){logger[_0x5a21('0x32')](_0x5a21('0x3d'),_0x3d14f4['message']);}};Acw[_0x5a21('0x18')][_0x5a21('0xc')]=function(_0x3f4bc1){try{if(this[_0x5a21('0x7')][_0x3f4bc1[_0x5a21('0x2b')]]&&_[_0x5a21('0x3e')](this[_0x5a21('0x7')][_0x3f4bc1[_0x5a21('0x2b')]][_0x5a21('0x3f')])){logger[_0x5a21('0x22')](_0x5a21('0x40'),_0x3f4bc1[_0x5a21('0x2b')]);this['startAcw'](_0x3f4bc1['uniqueid']);}else if(this['channels'][_0x3f4bc1[_0x5a21('0x41')]]&&_[_0x5a21('0x3e')](this[_0x5a21('0x7')][_0x3f4bc1['linkedid']][_0x5a21('0x3f')])){logger[_0x5a21('0x22')](_0x5a21('0x42'),_0x3f4bc1[_0x5a21('0x41')]);this[_0x5a21('0x43')](_0x3f4bc1[_0x5a21('0x41')]);}}catch(_0x569f02){logger[_0x5a21('0x32')](_0x5a21('0x44'),_0x569f02['message']);}};Acw[_0x5a21('0x18')]['syncHangup']=function(_0x464aaf){try{if(this[_0x5a21('0x7')][_0x464aaf[_0x5a21('0x2b')]]&&this[_0x5a21('0x7')][_0x464aaf['uniqueid']]['attended']){logger[_0x5a21('0x22')](_0x5a21('0x45'),_0x464aaf[_0x5a21('0x2b')]);this[_0x5a21('0x43')](_0x464aaf[_0x5a21('0x2b')]);}else if(this[_0x5a21('0x7')][_0x464aaf[_0x5a21('0x41')]]&&this[_0x5a21('0x7')][_0x464aaf['linkedid']][_0x5a21('0x3f')]){logger[_0x5a21('0x22')](_0x5a21('0x46'),_0x464aaf[_0x5a21('0x41')]);this[_0x5a21('0x43')](_0x464aaf['linkedid']);}}catch(_0x42e7f2){logger[_0x5a21('0x32')](_0x5a21('0x47'),_0x42e7f2[_0x5a21('0x34')]);}};Acw[_0x5a21('0x18')][_0x5a21('0x11')]=function(_0x2dca30){try{if(!_['isNil'](this[_0x5a21('0x7')][_0x2dca30['transfereeuniqueid']])){this[_0x5a21('0x43')](_0x2dca30[_0x5a21('0x48')]);if(this[_0x5a21('0x7')][_0x2dca30['secondtransfereruniqueid']]){this[_0x5a21('0x7')][_0x2dca30[_0x5a21('0x49')]][_0x5a21('0x3f')]=!![];this[_0x5a21('0x7')][_0x2dca30[_0x5a21('0x4a')]]=this['channels'][_0x2dca30[_0x5a21('0x49')]];delete this['channels'][_0x2dca30[_0x5a21('0x49')]];}}else if(!_[_0x5a21('0x4b')](this[_0x5a21('0x7')][_0x2dca30[_0x5a21('0x4a')]])){this[_0x5a21('0x43')](_0x2dca30[_0x5a21('0x4a')]);if(this[_0x5a21('0x7')][_0x2dca30[_0x5a21('0x4c')]]){this['channels'][_0x2dca30[_0x5a21('0x4c')]][_0x5a21('0x3f')]=!![];this[_0x5a21('0x7')][_0x2dca30['transfereeuniqueid']]=this[_0x5a21('0x7')][_0x2dca30['origtransfereruniqueid']];delete this[_0x5a21('0x7')][_0x2dca30[_0x5a21('0x4c')]];}}}catch(_0x41830e){logger[_0x5a21('0x32')](_0x5a21('0x4d'),_0x41830e[_0x5a21('0x34')]);}};Acw['prototype'][_0x5a21('0x13')]=function(_0x1a3f21){try{if(this['channels'][_0x1a3f21[_0x5a21('0x4e')]]){logger[_0x5a21('0x22')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x5a21('0x3a')](_0x1a3f21[_0x5a21('0x4e')]));this[_0x5a21('0x43')](_0x1a3f21[_0x5a21('0x4e')]);}else if(this[_0x5a21('0x7')][_0x1a3f21[_0x5a21('0x4f')]]){logger[_0x5a21('0x22')](_0x5a21('0x50'),JSON['stringify'](_0x1a3f21[_0x5a21('0x4f')]));this[_0x5a21('0x43')](_0x1a3f21[_0x5a21('0x4f')]);}}catch(_0x267e51){logger[_0x5a21('0x32')]('[ACW][syncBlindTransfer]\x20%s',_0x267e51[_0x5a21('0x34')]);}};Acw[_0x5a21('0x18')][_0x5a21('0x51')]=function(_0x59d2f7){try{if(this[_0x5a21('0x4')][_0x59d2f7[_0x5a21('0x2c')]]&&this['voiceQueues'][_0x59d2f7[_0x5a21('0x2c')]]['autopause']===_0x5a21('0x52')){if(this[_0x5a21('0x5')][_0x59d2f7[_0x5a21('0x19')]]){logger[_0x5a21('0x22')](_0x5a21('0x53'),_0x59d2f7['uniqueid'],_0x59d2f7['interface'],_0x59d2f7[_0x5a21('0x2c')]);return RpcUser['savePause'](this[_0x5a21('0x5')][_0x59d2f7[_0x5a21('0x19')]],_0x5a21('0x54'),_0x59d2f7['uniqueid']);}}}catch(_0x4b1373){logger['error'](_0x5a21('0x55'),_0x4b1373[_0x5a21('0x34')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 8dfb683..2aa4ed8 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 _0xb82b=['action','error','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','devicestatelist','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionDeviceStateList','actionSipPeerStatus','[ami.js][fullybooted]','exports','util','../../config/logger','../../config/environment','asterisk','port','username','keepConnected','promisify'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0xb82b,0x142));var _0xbb82=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb82b[_0xa464c9];return _0x3d73c4;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var util=require(_0xbb82('0x0'));var logger=require(_0xbb82('0x1'))('ami');var config=require(_0xbb82('0x2'));var ami=new Manager(config[_0xbb82('0x3')][_0xbb82('0x4')],config[_0xbb82('0x3')]['ip'],config[_0xbb82('0x3')][_0xbb82('0x5')],config[_0xbb82('0x3')]['password'],!![]);ami[_0xbb82('0x6')]();ami['Action']=BPromise[_0xbb82('0x7')](ami[_0xbb82('0x8')]);function error(_0x5b7f6e){logger[_0xbb82('0x9')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xbb82('0x3')][_0xbb82('0x5')],config['asterisk']['ip'],config[_0xbb82('0x3')][_0xbb82('0x4')],util[_0xbb82('0xa')](_0x5b7f6e,![],null)));}function close(){logger[_0xbb82('0x9')](util[_0xbb82('0xb')](_0xbb82('0xc'),config[_0xbb82('0x3')][_0xbb82('0x5')],config[_0xbb82('0x3')]['ip'],config[_0xbb82('0x3')][_0xbb82('0x4')]));}ami[_0xbb82('0xd')]=function(){return function(){return ami[_0xbb82('0xe')]({'action':_0xbb82('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xbb82('0xe')]({'action':_0xbb82('0x10')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xbb82('0xe')]({'action':_0xbb82('0x11')});};};ami[_0xbb82('0x12')]=function(){return function(){return ami[_0xbb82('0xe')]({'action':'queuesummary'});};};ami[_0xbb82('0x13')]=function(){return function(){return ami[_0xbb82('0xe')]({'action':_0xbb82('0x14')});};};function connect(){logger[_0xbb82('0x15')](util['format'](_0xbb82('0x16'),config['asterisk'][_0xbb82('0x5')],config[_0xbb82('0x3')]['ip'],config['asterisk'][_0xbb82('0x4')]));ami['once'](_0xbb82('0x9'),error);ami[_0xbb82('0x17')](_0xbb82('0x18'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x5ce5c7){logger['info'](util[_0xbb82('0xb')](_0xbb82('0x19'),config[_0xbb82('0x3')]['username'],config[_0xbb82('0x3')]['ip'],config[_0xbb82('0x3')][_0xbb82('0x4')],util['inspect'](_0x5ce5c7,![],null)));});ami['on'](_0xbb82('0x1a'),function(){logger[_0xbb82('0x15')](util[_0xbb82('0xb')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xbb82('0x3')][_0xbb82('0x5')],config[_0xbb82('0x3')]['ip'],config['asterisk'][_0xbb82('0x4')]));return Promise[_0xbb82('0x1b')]()[_0xbb82('0x1c')](ami[_0xbb82('0xd')]())[_0xbb82('0x1c')](ami[_0xbb82('0x1d')]())[_0xbb82('0x1c')](ami[_0xbb82('0x1e')]())[_0xbb82('0x1c')](ami[_0xbb82('0x12')]())[_0xbb82('0x1c')](ami[_0xbb82('0x13')]())['catch'](function(_0x59e25e){logger[_0xbb82('0x9')](_0xbb82('0x1f'),util[_0xbb82('0xa')](_0x59e25e,{'showHidden':![],'depth':null}));});});ami[_0xbb82('0x17')](_0xbb82('0x9'),error);ami[_0xbb82('0x17')](_0xbb82('0x18'),close);module[_0xbb82('0x20')]=ami; \ No newline at end of file +var _0x1ce8=['coreshowchannels','once','close','connect','shutdown','info','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','[ami.js][fullybooted]','exports','bluebird','util','ami','asterisk','port','username','password','Action','error','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x2ac5ac,_0x3f105e){var _0x55949c=function(_0x58c2c7){while(--_0x58c2c7){_0x2ac5ac['push'](_0x2ac5ac['shift']());}};_0x55949c(++_0x3f105e);}(_0x1ce8,0xae));var _0x81ce=function(_0x1231be,_0x6563a2){_0x1231be=_0x1231be-0x0;var _0x55a107=_0x1ce8[_0x1231be];return _0x55a107;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x81ce('0x0'));var util=require(_0x81ce('0x1'));var logger=require('../../config/logger')(_0x81ce('0x2'));var config=require('../../config/environment');var ami=new Manager(config[_0x81ce('0x3')][_0x81ce('0x4')],config[_0x81ce('0x3')]['ip'],config[_0x81ce('0x3')][_0x81ce('0x5')],config[_0x81ce('0x3')][_0x81ce('0x6')],!![]);ami['keepConnected']();ami[_0x81ce('0x7')]=BPromise['promisify'](ami['action']);function error(_0xa3b8e3){logger[_0x81ce('0x8')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x81ce('0x3')][_0x81ce('0x5')],config[_0x81ce('0x3')]['ip'],config[_0x81ce('0x3')]['port'],util[_0x81ce('0x9')](_0xa3b8e3,![],null)));}function close(){logger['error'](util[_0x81ce('0xa')](_0x81ce('0xb'),config['asterisk'][_0x81ce('0x5')],config[_0x81ce('0x3')]['ip'],config[_0x81ce('0x3')]['port']));}ami[_0x81ce('0xc')]=function(){return function(){return ami['Action']({'action':_0x81ce('0xd')});};};ami[_0x81ce('0xe')]=function(){return function(){return ami[_0x81ce('0x7')]({'action':_0x81ce('0xf')});};};ami[_0x81ce('0x10')]=function(){return function(){return ami[_0x81ce('0x7')]({'action':_0x81ce('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x81ce('0x7')]({'action':_0x81ce('0x12')});};};function connect(){logger['info'](util[_0x81ce('0xa')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0x81ce('0x5')],config[_0x81ce('0x3')]['ip'],config[_0x81ce('0x3')][_0x81ce('0x4')]));ami[_0x81ce('0x13')](_0x81ce('0x8'),error);ami[_0x81ce('0x13')](_0x81ce('0x14'),close);}ami['on'](_0x81ce('0x15'),connect);ami['on'](_0x81ce('0x16'),function(_0xf7b6b9){logger[_0x81ce('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x81ce('0x3')][_0x81ce('0x5')],config[_0x81ce('0x3')]['ip'],config[_0x81ce('0x3')]['port'],util[_0x81ce('0x9')](_0xf7b6b9,![],null)));});ami['on'](_0x81ce('0x18'),function(){logger[_0x81ce('0x17')](util[_0x81ce('0xa')](_0x81ce('0x19'),config[_0x81ce('0x3')][_0x81ce('0x5')],config[_0x81ce('0x3')]['ip'],config[_0x81ce('0x3')][_0x81ce('0x4')]));return Promise[_0x81ce('0x1a')]()[_0x81ce('0x1b')](ami[_0x81ce('0xc')]())['then'](ami['actionDeviceStateList']())['then'](ami[_0x81ce('0x10')]())[_0x81ce('0x1b')](ami[_0x81ce('0x1c')]())['then'](ami['actionCoreShowChannels']())[_0x81ce('0x1d')](function(_0x18f90b){logger[_0x81ce('0x8')](_0x81ce('0x1e'),util[_0x81ce('0x9')](_0x18f90b,{'showHidden':![],'depth':null}));});});ami[_0x81ce('0x13')](_0x81ce('0x8'),error);ami[_0x81ce('0x13')]('close',close);module[_0x81ce('0x1f')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index ea0a409..40772d2 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 _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x46d4dd,_0x3bd996){var _0x30a249=function(_0x6c1a45){while(--_0x6c1a45){_0x46d4dd['push'](_0x46d4dd['shift']());}};_0x30a249(++_0x3bd996);}(_0xaa88,0x137));var _0x8aa8=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0xaa88[_0xa388a2];return _0x7ce7f6;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0xb7e7,0x121));var _0x7b7e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb7e7[_0x502c7d];return _0x30b7ed;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 18a0b69..c3b1b8f 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 _0xbf43=['dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','Contact','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','Trunk','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','stateGlobal','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','swapAdditionalPhones','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','getContactDialer','countReScheduled','[countReScheduled]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','checkContactLowerLimitOriginate','checkIsBlackList','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\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]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','getSettings','then','isUndefined','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','predictiveIntervalTotalCalls','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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','getSeconds','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','state','endtime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','[ifTime][Action]','Error','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','indexOf','catch','push','true','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','Intervals','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueId','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','statedesc','Drop','dropreason','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','rescheduleContact','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','pick','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialGlobalMaxRetry','dialMachineMaxRetry','[syncHangupIvr]','dialQueueProject','[syncHangupIvr][createHistory]','moveContactManagedDialer','outboundUnknownCallsDay','cause-txt','running','isPreviewCampaign','statusMessage','available','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','UserId','[emptyContact][createHistory]','[emptyContact]','checkPreviewRecallReminder','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE'];(function(_0x57cd47,_0x519a1c){var _0x149651=function(_0x433212){while(--_0x433212){_0x57cd47['push'](_0x57cd47['shift']());}};_0x149651(++_0x519a1c);}(_0xbf43,0xbc));var _0x3bf4=function(_0x36dff8,_0x983918){_0x36dff8=_0x36dff8-0x0;var _0x1310b9=_0xbf43[_0x36dff8];return _0x1310b9;};'use strict';var util=require(_0x3bf4('0x0'));var _=require(_0x3bf4('0x1'));var uuid=require('uuid');var moment=require(_0x3bf4('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x3bf4('0x3'));var hopperUtils=require(_0x3bf4('0x4'));var ut=require(_0x3bf4('0x5'));var config=require(_0x3bf4('0x6'));var logger=require(_0x3bf4('0x7'))(_0x3bf4('0x8'));var loggerBooked=require(_0x3bf4('0x7'))(_0x3bf4('0x9'));var loggerPredictive=require('../../../config/logger')(_0x3bf4('0xa'));var loggerPredictiveCalls=require(_0x3bf4('0x7'))(_0x3bf4('0xb'));var loggerSyncQueueSummary=require(_0x3bf4('0x7'))(_0x3bf4('0xc'));var ami=require('../ami');config[_0x3bf4('0xd')]=_[_0x3bf4('0xe')](config['redis'],{'host':_0x3bf4('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x3bf4('0x10'));var voiceQueueRt=require(_0x3bf4('0x11'));var RpcSetting=require(_0x3bf4('0x12'));var Interval=require('../rpc/interval');var Action=require(_0x3bf4('0x13'));var History=require(_0x3bf4('0x14'));var Final=require(_0x3bf4('0x15'));var AgentComplete=require(_0x3bf4('0x16'));var QueueCallerAbandon=require(_0x3bf4('0x17'));var Hangup=require('./models/hangup');var ipAgi=process[_0x3bf4('0x18')]['XCALLY_IP_AGI']||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3bf4('0x19')][_0x3bf4('0x1a')]=function(_0x10a84b){this[_0x3bf4('0x1b')]=this['tail']?this[_0x3bf4('0x1b')][_0x3bf4('0x1c')](_0x10a84b):_0x10a84b();};function Dialer(_0x5daac2,_0x33e81a){this[_0x3bf4('0x1d')]=new Sequence();this[_0x3bf4('0x1e')]=_0x33e81a;this['voiceQueues']=_0x5daac2[_0x3bf4('0x1f')];this[_0x3bf4('0x20')]=_0x5daac2[_0x3bf4('0x20')];this[_0x3bf4('0x21')]=_0x5daac2[_0x3bf4('0x21')];this[_0x3bf4('0x22')]=_0x5daac2['trunks'];this[_0x3bf4('0x23')]=config[_0x3bf4('0x23')]||0x2;this[_0x3bf4('0x24')]={};this['actions']={};this[_0x3bf4('0x25')]={};this['uniqueId']={};this[_0x3bf4('0x26')]={};this[_0x3bf4('0x27')]={};this[_0x3bf4('0x28')]={};this[_0x3bf4('0x29')]={};this[_0x3bf4('0x2a')]={};this[_0x3bf4('0x2b')]={};this[_0x3bf4('0x2c')]={};ami['on'](_0x3bf4('0x2d'),this[_0x3bf4('0x2e')][_0x3bf4('0x2f')](this));ami['on']('queuecallerabandon',this[_0x3bf4('0x30')][_0x3bf4('0x2f')](this));ami['on'](_0x3bf4('0x31'),this['syncOriginateResponse'][_0x3bf4('0x2f')](this));ami['on']('agentcomplete',this[_0x3bf4('0x32')][_0x3bf4('0x2f')](this));ami['on'](_0x3bf4('0x33'),this['syncQueueSummary'][_0x3bf4('0x2f')](this));ami['on'](_0x3bf4('0x34'),this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0x3bf4('0x35'),this['syncHangup'][_0x3bf4('0x2f')](this));ami['on'](_0x3bf4('0x36'),this[_0x3bf4('0x37')][_0x3bf4('0x2f')](this));ami['on'](_0x3bf4('0x38'),this[_0x3bf4('0x39')][_0x3bf4('0x2f')](this));ami['on'](_0x3bf4('0x3a'),this[_0x3bf4('0x3b')][_0x3bf4('0x2f')](this));ami['on']('queuestatuscomplete',this[_0x3bf4('0x3c')][_0x3bf4('0x2f')](this));this[_0x3bf4('0x3d')]();this['loopClearZombieChannels']();RpcSetting[_0x3bf4('0x3e')]()[_0x3bf4('0x3f')](function(_0x567f4b){previewRecallmeReminderInterval=_0x567f4b['previewRecallmeReminderInterval'];});}function isNotNull(_0x190a97){return _0x190a97!==null&&!_[_0x3bf4('0x40')](_0x190a97);}function msgResponse(_0x211c3f,_0x49d1e6,_0x185be0){return{'action':_0x211c3f,'response':_0x49d1e6,'message':_0x185be0,'stack':_0x185be0};}function emit(_0x1c004f,_0x4dde4c,_0x17ae62){io['to'](_0x1c004f)['emit'](_0x4dde4c,_0x17ae62);}function emitOutboundVoiceQueueSummary(_0x496d6a){if(_0x496d6a[_0x3bf4('0x41')]===_0x3bf4('0x42')){logger[_0x3bf4('0x43')](_0x3bf4('0x44'),util[_0x3bf4('0x45')](_0x496d6a,{'showHidden':![],'depth':null}));emit(util[_0x3bf4('0x46')](_0x3bf4('0x47'),_0x496d6a[_0x3bf4('0x48')]),_0x3bf4('0x49'),_0x496d6a);}}function checkGetDataPredictive(_0x168bbf){if(isNotNull(_0x168bbf)&&!_[_0x3bf4('0x4a')](_0x168bbf)){loggerPredictive['info'](_0x3bf4('0x4b'));loggerPredictive[_0x3bf4('0x4c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x168bbf[_0x3bf4('0x4d')]);loggerPredictive['info'](_0x3bf4('0x4e'),_0x168bbf[_0x3bf4('0x4f')]);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x50'),_0x168bbf['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x3bf4('0x4c')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x168bbf[_0x3bf4('0x51')]);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x52'),_0x168bbf[_0x3bf4('0x53')]);loggerPredictive[_0x3bf4('0x4c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x168bbf[_0x3bf4('0x54')]);loggerPredictive[_0x3bf4('0x4c')]('---------------------------');if(_0x168bbf['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x168bbf[_0x3bf4('0x54')])&&_0x168bbf[_0x3bf4('0x54')]>0x0){return!![];}loggerPredictive['info'](_0x3bf4('0x55'));if(!_[_0x3bf4('0x40')](_0x168bbf[_0x3bf4('0x53')])&&_0x168bbf[_0x3bf4('0x53')]>0x0){return!![];}loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x56'));}else{loggerPredictive['info'](_0x3bf4('0x57'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1f9acc){return function(_0xf4daa2){loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x58'));loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x59'),_0xf4daa2[_0x3bf4('0x5a')]);loggerPredictive['info'](_0x3bf4('0x5b'),_0xf4daa2[_0x3bf4('0x5c')]);loggerPredictive[_0x3bf4('0x4c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf4daa2[_0x3bf4('0x5d')]);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x5e'),_0xf4daa2[_0x3bf4('0x5f')]);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x60'),_0xf4daa2[_0x3bf4('0x5d')]);loggerPredictive['info'](_0x3bf4('0x61'));_[_0x3bf4('0x62')](_0x1f9acc,_0xf4daa2);};}function ifInterval(_0x3bbde5,_0x550c0d){if(_[_0x3bf4('0x40')](_0x550c0d)){return![];}return utils[_0x3bf4('0x63')](undefined,_0x550c0d)<_0x3bbde5*0x3c;}function clearPredictiveAttributes(_0x51884c){if(_0x51884c['startProgressive']){_0x51884c['startProgressive']=undefined;loggerPredictive[_0x3bf4('0x43')](_0x51884c[_0x3bf4('0x48')],'startProgressive\x20value\x20cleared');}if(_0x51884c[_0x3bf4('0x27')]){_0x51884c['startPredictive']=undefined;loggerPredictive['debug'](_0x51884c[_0x3bf4('0x48')],'startPredictive\x20value\x20cleared');}if(_0x51884c[_0x3bf4('0x64')]){clearInterval(_0x51884c[_0x3bf4('0x64')]);_0x51884c['handlePredictive']=undefined;loggerPredictive['debug'](_0x51884c[_0x3bf4('0x48')],_0x3bf4('0x65'));}}function loggerCatchPredictive(_0x58e1ec,_0x14e5e5){return function(_0x9109bc){loggerPredictive[_0x3bf4('0x66')](_0x14e5e5[_0x3bf4('0x48')],_0x58e1ec);loggerPredictive['error'](_0x9109bc[_0x3bf4('0x67')]);clearPredictiveAttributes(_0x14e5e5);};}function loggerCatch(_0x2b80dd){return function(_0x56c160){logger[_0x3bf4('0x66')](_0x2b80dd,util[_0x3bf4('0x45')](_0x56c160,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x651aee,_0x114419,_0xc53e0a){return function(_0x5b8dd2){utils['checkContactLowerLimitOriginate'](_0x114419,_0xc53e0a,0x0);logger[_0x3bf4('0x66')](_0x651aee,util[_0x3bf4('0x45')](_0x5b8dd2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x259cd3){return function(_0x4facfd){if(isNotNull(_0x4facfd)&&isNotNull(_0x4facfd[0x0])){if(_0x4facfd[0x0][_0x3bf4('0x68')]>0x0){_0x259cd3[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')][_0x3bf4('0x6b')];logger['info'](_0x3bf4('0x6c')+_0x259cd3[_0x3bf4('0x48')],_0x4facfd[0x0][_0x3bf4('0x68')],_0x3bf4('0x6d'));}else{_0x259cd3[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')][_0x3bf4('0x6e')];logger[_0x3bf4('0x4c')]('[getContactDialer2][Empty]'+_0x259cd3['name']);}}};}function createObjHistory(_0x54b603,_0x6c2dad,_0xedf43a,_0x1984c4,_0x190607){_0x54b603[_0x3bf4('0x69')]=_0xedf43a;var _0x5dc5f0=new Action(_0x54b603,_0x6c2dad);var _0x1bf346=new History(_0x5dc5f0);_0x1bf346[_0x3bf4('0x6f')]=_0x1984c4;_0x1bf346['statedesc']=_0x190607;_0x1bf346[_0x3bf4('0x70')]=_0x5dc5f0['starttime'];return _0x1bf346;}function unlockQueueStatus(_0x3d1f43,_0x2d6762){setTimeout(function(){if(_[_0x3bf4('0x40')](_0x3d1f43['queueStatusComplete'])){loggerBooked[_0x3bf4('0x66')](_0x3bf4('0x71'),_0x2d6762);}_0x3d1f43[_0x3bf4('0x72')]=!![];loggerBooked[_0x3bf4('0x4c')](_0x3bf4('0x73'),_0x2d6762,JSON[_0x3bf4('0x74')](_['pick'](_0x3d1f43,[_0x3bf4('0x48'),_0x3bf4('0x72')])));},0x1f3);}function checkInterval(_0x143182){return function(){if(!isNotNull(_0x143182[_0x3bf4('0x75')])){_0x143182[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')][_0x3bf4('0x76')];throw _0x143182['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x143182['Interval']['Intervals'])){_0x143182['message']=utils[_0x3bf4('0x6a')][_0x3bf4('0x76')];throw _0x143182[_0x3bf4('0x48')]+_0x3bf4('0x77');}if(!isNotNull(_['isEmpty'](_0x143182[_0x3bf4('0x75')]['Intervals']))){_0x143182[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')][_0x3bf4('0x76')];throw _0x143182[_0x3bf4('0x48')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x347cd1){return function(){if(!utils[_0x3bf4('0x78')](_0x347cd1)){_0x347cd1[_0x3bf4('0x69')]=utils['CAMPAIGN_STATUS'][_0x3bf4('0x79')];throw _0x347cd1[_0x3bf4('0x48')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x474547){if(utils[_0x3bf4('0x7a')](_0x474547)){emit(util[_0x3bf4('0x46')]('campaign:ivr:%s',_0x474547[_0x3bf4('0x48')]),_0x3bf4('0x7b'),_0x474547);}}function loggerCatchQueueSummary(_0x7ff404,_0x2a8ae1){return function(_0x1f7aa5){clearPredictiveAttributes(_0x2a8ae1);emitCampaignSummary(_0x2a8ae1);loggerSyncQueueSummary[_0x3bf4('0x43')](_0x7ff404,util[_0x3bf4('0x45')](_0x1f7aa5,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x526db4){if(_0x526db4[_0x3bf4('0x7c')]){if(_0x526db4[_0x3bf4('0x7d')]===0x0){_0x526db4['sendMessageOneNotActive']=![];_0x526db4[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')][_0x3bf4('0x79')];loggerSyncQueueSummary['debug'](_0x3bf4('0x7e'),_0x526db4[_0x3bf4('0x48')],_0x3bf4('0x7f'));}else{_0x526db4['message']=utils[_0x3bf4('0x6a')]['DISACTIVED'];loggerSyncQueueSummary[_0x3bf4('0x43')](_0x3bf4('0x7e'),_0x526db4[_0x3bf4('0x48')],'is\x20disactive');}emitCampaignSummary(_0x526db4);}}function myreject(_0x140125){return function(_0x3900c3){return _0x140125(msgResponse(_0x3bf4('0x80'),_0x3bf4('0x81'),JSON['stringify'](_0x3900c3)));};}Dialer[_0x3bf4('0x19')]['isTrunkReachable']=function(_0x3d4ab3){return!_[_0x3bf4('0x40')](_0x3d4ab3)&&_0x3d4ab3&&!_[_0x3bf4('0x40')](_0x3d4ab3[_0x3bf4('0x48')])&&!_[_0x3bf4('0x40')](_0x3d4ab3[_0x3bf4('0x82')])&&_0x3d4ab3[_0x3bf4('0x82')]&&(this[_0x3bf4('0x22')][util[_0x3bf4('0x46')](_0x3bf4('0x83'),_0x3d4ab3[_0x3bf4('0x48')])][_0x3bf4('0x84')]===_0x3bf4('0x85')||this['trunks'][util[_0x3bf4('0x46')](_0x3bf4('0x83'),_0x3d4ab3[_0x3bf4('0x48')])]['status']===_0x3bf4('0x86'));};Dialer[_0x3bf4('0x19')][_0x3bf4('0x87')]=function(_0x1870ee){var _0x581b6d=this;return function(){if(!_0x581b6d['isTrunkReachable'](_0x1870ee['Trunk'])){if(!_0x581b6d[_0x3bf4('0x88')](_0x1870ee[_0x3bf4('0x89')])){_0x1870ee['message']=utils[_0x3bf4('0x6a')][_0x3bf4('0x8a')];throw _0x1870ee[_0x3bf4('0x48')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0x3bf4('0x8b')]=function(_0x263b97,_0x493c06,_0x421998,_0x3f7670){var _0x2c1ce2=this;return function(){var _0x2e35d2=!![];return _0x2c1ce2[_0x3bf4('0x8c')](_0x263b97,_0x493c06,_0x421998,_0x3f7670,_0x2e35d2);};};Dialer[_0x3bf4('0x19')][_0x3bf4('0x8d')]=function(_0x20244a,_0x2cd9a1,_0x2c081b,_0x5d5002){var _0x39b80f=this;return function(){var _0x42d5d2=![];return _0x39b80f['ifTimeIvr'](_0x20244a['Intervals'],_0x2cd9a1,_0x2c081b,_0x5d5002,_0x42d5d2);};};Dialer[_0x3bf4('0x19')][_0x3bf4('0x8c')]=function(_0x36dc5d,_0x31fce0,_0x527c73,_0x1c0cc1,_0x2f7c0a){var _0x78c58a=[];return new Promise(function(_0x214b2c,_0x288d00){if(!isNotNull(_0x36dc5d)){_0x1c0cc1[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')]['NULL_INTERVAL'];return _0x288d00(msgResponse('ifTime','Failure',_0x527c73+_0x3bf4('0x8e')));}if(_[_0x3bf4('0x4a')](_0x36dc5d)){_0x1c0cc1[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')][_0x3bf4('0x8f')];return _0x288d00(msgResponse(_0x3bf4('0x90'),_0x3bf4('0x91'),_0x527c73+_0x3bf4('0x92')));}if(_0x31fce0&&_[_0x3bf4('0x40')](config[_0x3bf4('0x93')][_0x31fce0])){_0x1c0cc1['message']=utils[_0x3bf4('0x6a')][_0x3bf4('0x94')];return _0x288d00(msgResponse(_0x3bf4('0x90'),'Failure',_0x527c73+_0x3bf4('0x95')+_0x31fce0));}if(_[_0x3bf4('0x96')](_0x36dc5d)){for(var _0x12cc47=0x0;_0x12cc47<_0x36dc5d['length'];_0x12cc47+=0x1){_0x78c58a['push'](ami[_0x3bf4('0x97')]({'action':_0x3bf4('0x98'),'command':util['format'](_0x3bf4('0x99'),_0x36dc5d[_0x12cc47][_0x3bf4('0x9a')],!_[_0x3bf4('0x40')](config[_0x3bf4('0x93')][_0x31fce0])?_0x31fce0:'')})[_0x3bf4('0x3f')](function(_0x6c3615){return _0x6c3615['content'][_0x3bf4('0x9b')]('true')>=0x0;})[_0x3bf4('0x9c')](myreject(_0x288d00)));}}else{_0x78c58a[_0x3bf4('0x9d')](ami[_0x3bf4('0x97')]({'action':_0x3bf4('0x98'),'command':util[_0x3bf4('0x46')](_0x3bf4('0x99'),_0x36dc5d,!_[_0x3bf4('0x40')](config[_0x3bf4('0x93')][_0x31fce0])?_0x31fce0:'')})[_0x3bf4('0x3f')](function(_0x38a794){return _0x38a794['content'][_0x3bf4('0x9b')](_0x3bf4('0x9e'))>=0x0;})[_0x3bf4('0x9c')](myreject(_0x288d00)));}Promise[_0x3bf4('0x9f')](_0x78c58a)[_0x3bf4('0x3f')](function(_0x202d76){var _0x408d05=_[_0x3bf4('0xa0')](_0x202d76);if(_0x408d05){return _0x214b2c(_0x408d05);}else{_0x1c0cc1[_0x3bf4('0x69')]=_0x2f7c0a?utils[_0x3bf4('0x6a')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x3bf4('0xa1')];return _0x288d00(msgResponse(_0x3bf4('0xa2'),'Failure',_0x3bf4('0xa3')+_0x2f7c0a+'\x20'+_0x527c73+'\x20Interval\x20is\x20overtime:\x20'+util[_0x3bf4('0x45')](_0x36dc5d,{'showHidden':![],'depth':null})+_0x3bf4('0xa4')+_0x31fce0));}})[_0x3bf4('0x9c')](function(_0x53ce48){return _0x288d00(msgResponse('ifTime',_0x3bf4('0x91'),JSON[_0x3bf4('0x74')](_0x53ce48)));});});};Dialer['prototype'][_0x3bf4('0x3d')]=function(){var _0x396354=this;return cmHopper[_0x3bf4('0xa5')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x396354[_0x3bf4('0xa6')]();},0x3e8);});};Dialer[_0x3bf4('0x19')][_0x3bf4('0xa6')]=function(){var _0x43bf1a=this;var _0x17246c;for(var _0x33f08b in this['campaigns']){if(typeof this['campaigns'][_0x33f08b]!==_0x3bf4('0xa7')){_0x17246c=this['campaigns'][_0x33f08b];if(utils[_0x3bf4('0x7a')](_0x17246c)&&utils['isIVRCampaignActive'](_0x17246c)){_0x17246c['sendMessageOneNotActive']=!![];Promise[_0x3bf4('0xa8')]()[_0x3bf4('0x3f')](checkIsIVRCampaignActive(_0x17246c))[_0x3bf4('0x3f')](checkInterval(_0x17246c))['then'](_0x43bf1a['checkIsTrunkReachable'](_0x17246c))[_0x3bf4('0x3f')](_0x43bf1a['checkIfTime'](_0x17246c[_0x3bf4('0xa9')],_0x17246c[_0x3bf4('0xaa')],_0x17246c[_0x3bf4('0x48')],_0x17246c))[_0x3bf4('0x3f')](_0x43bf1a[_0x3bf4('0x8d')](_0x17246c['Interval'],_0x17246c[_0x3bf4('0xaa')],_0x17246c[_0x3bf4('0x48')],_0x17246c))['then'](_0x43bf1a[_0x3bf4('0xab')](_0x17246c))[_0x3bf4('0x9c')](loggerCatchQueueSummary('[syncCampaigns]',_0x17246c));}else{notSendMessagesCampaign(_0x17246c);}}}};Dialer['prototype'][_0x3bf4('0xac')]=function(_0x499081){if(_0x499081[_0x3bf4('0xad')]!==_0x3bf4('0xa')){clearPredictiveAttributes(_0x499081);}switch(_0x499081[_0x3bf4('0xad')]){case _0x3bf4('0xae'):this[_0x3bf4('0xaf')](_0x499081,0x1);break;case _0x3bf4('0xb0'):this[_0x3bf4('0xaf')](_0x499081,_0x499081[_0x3bf4('0xb1')]);break;case'predictive':this[_0x3bf4('0xa')](_0x499081);break;case'booked':this['handlePower'](_0x499081,0x1);break;default:logger[_0x3bf4('0x66')](_0x3bf4('0xb2'),_0x499081['name'],_0x3bf4('0xb3'));}};Dialer[_0x3bf4('0x19')][_0x3bf4('0x90')]=function(_0x1d2ba0,_0x5c1a51){var _0x56a5dc=_0x1d2ba0[_0x3bf4('0xaa')];var _0x308ead=_0x5c1a51?_0x1d2ba0[_0x3bf4('0xa9')]:_0x1d2ba0['Interval'][_0x3bf4('0xb4')];logger[_0x3bf4('0xb5')]('Dialer::ifTime()',_0x308ead,_0x56a5dc,_0x1d2ba0[_0x3bf4('0x48')],util[_0x3bf4('0x46')](_0x3bf4('0xb6'),_0x1d2ba0[_0x3bf4('0x48')],_0x1d2ba0['id']));var _0x2bf460=null;return Interval[_0x3bf4('0xb7')](_0x308ead,_0x56a5dc)[_0x3bf4('0x3f')](function(_0x351be1){if(_0x351be1===!![]){return _0x351be1;}else{_0x1d2ba0['message']=_0x5c1a51?utils[_0x3bf4('0x6a')][_0x3bf4('0xb8')]:utils[_0x3bf4('0x6a')][_0x3bf4('0xa1')];_0x2bf460=msgResponse(_0x3bf4('0xa2'),'Failure',_0x3bf4('0xa3')+_0x5c1a51+'\x20'+_0x1d2ba0[_0x3bf4('0x48')]+_0x3bf4('0xb9')+util[_0x3bf4('0x45')](_0x308ead,{'showHidden':![],'depth':null})+_0x3bf4('0xa4')+_0x56a5dc);}if(_0x2bf460!==null){logger[_0x3bf4('0xb5')](_0x3bf4('0xba'),_0x2bf460);_0x2bf460[_0x3bf4('0xbb')]=_0x5c1a51;throw _0x2bf460;}})[_0x3bf4('0x9c')](function(_0x343bb8){logger[_0x3bf4('0x66')](_0x3bf4('0xbc'),_0x343bb8);throw msgResponse(_0x3bf4('0x80'),_0x3bf4('0x81'),util[_0x3bf4('0x45')](_0x343bb8,{'showHidden':![],'depth':null}));});};Dialer[_0x3bf4('0x19')][_0x3bf4('0x2e')]=function(_0x3aa399){if(this['voiceQueues'][_0x3aa399[_0x3bf4('0xbd')]]){if(this[_0x3bf4('0xbe')][_0x3aa399[_0x3bf4('0xbf')]]&&this[_0x3bf4('0xbe')][_0x3aa399['uniqueid']]['type']!==_0x3bf4('0xc0')){this[_0x3bf4('0xc1')](this[_0x3bf4('0x1f')][_0x3aa399[_0x3bf4('0xbd')]]);this['uniqueId'][_0x3aa399[_0x3bf4('0xbf')]]['answertime']=moment()[_0x3bf4('0x46')](_0x3bf4('0xc2'));}}};Dialer['prototype'][_0x3bf4('0x32')]=function(_0x1479c3){var _0x506ac7=this[_0x3bf4('0xbe')][_0x1479c3[_0x3bf4('0xbf')]];if(this[_0x3bf4('0x1f')][_0x1479c3[_0x3bf4('0xbd')]]){if(_0x506ac7&&_0x506ac7[_0x3bf4('0x41')]!==_0x3bf4('0xc0')){delete this[_0x3bf4('0xbe')][_0x1479c3[_0x3bf4('0xbf')]];this[_0x3bf4('0x1f')][_0x1479c3[_0x3bf4('0xbd')]][_0x3bf4('0xc3')]+=0x1;var _0x30a754=new AgentComplete(_0x506ac7,_0x1479c3);if(_0x1479c3[_0x3bf4('0xc4')]===_0x3bf4('0xc5')){_0x30a754[_0x3bf4('0xc6')]=this[_0x3bf4('0x1f')][_0x1479c3[_0x3bf4('0xbd')]][_0x3bf4('0xc7')]&&this[_0x3bf4('0x1f')][_0x1479c3[_0x3bf4('0xbd')]][_0x3bf4('0xc8')]?moment()[_0x3bf4('0x46')](_0x3bf4('0xc2')):undefined;}hopperUtils[_0x3bf4('0xc9')](_0x30a754)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0xca')));hopperUtils['moveContactManagedDialer'](_0x30a754)['catch'](loggerCatch(_0x3bf4('0xcb')));}}};Dialer[_0x3bf4('0x19')][_0x3bf4('0x30')]=function(_0x8e20a1){var _0x4f3d8e=this[_0x3bf4('0xbe')][_0x8e20a1[_0x3bf4('0xbf')]];var _0x5e9e11=this;var _0x18636f=![];var _0x4dfe14;var _0x455d33;if(this[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]]){if(_0x4f3d8e&&_0x4f3d8e[_0x3bf4('0x41')]!=='ivr'){delete this[_0x3bf4('0xbe')][_0x8e20a1[_0x3bf4('0xbf')]];this['updateOriginated'](this[_0x3bf4('0x1f')][_0x8e20a1['queue']]);_0x4f3d8e[_0x3bf4('0xcc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4dcc00=new QueueCallerAbandon(_0x4f3d8e,_0x8e20a1);if(utils[_0x3bf4('0x63')](_0x4f3d8e[_0x3bf4('0xcc')],_0x4f3d8e[_0x3bf4('0xcd')])>=_0x4f3d8e[_0x3bf4('0xce')]){this[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]][_0x3bf4('0xcf')]+=0x1;this[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]][_0x3bf4('0xd0')]+=0x1;this[_0x3bf4('0x1f')][_0x8e20a1['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4dcc00[_0x3bf4('0x6f')]=0xa;_0x4dcc00[_0x3bf4('0xd1')]=_0x3bf4('0xd2');_0x4dcc00[_0x3bf4('0xd3')]=_0x3bf4('0xd4');_0x4dcc00['agiafterat']=this[_0x3bf4('0x1f')][_0x8e20a1['queue']][_0x3bf4('0xc7')]?moment()[_0x3bf4('0x46')](_0x3bf4('0xc2')):undefined;_0x4dcc00[_0x3bf4('0xd5')]+=0x1;_0x4dcc00[_0x3bf4('0xd6')]+=0x1;_0x4dfe14=this[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]]['dialDropRetryFrequency'];_0x455d33=this[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]][_0x3bf4('0xd7')];hopperUtils[_0x3bf4('0xd8')](_0x4dcc00,_0x4dcc00['state'],_0x4f3d8e[_0x3bf4('0xd9')])[_0x3bf4('0x3f')](function(_0x82a9db){_0x18636f=_0x82a9db[_0x3bf4('0xda')]==0x1;if(_0x4dcc00[_0x3bf4('0xd5')]>=_0x5e9e11[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]]['dialDropMaxRetry']){_0x5e9e11[_0x3bf4('0xdb')](_0x4dcc00,_0x82a9db[_0x3bf4('0xda')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4dcc00[_0x3bf4('0xd5')],'scheduledat':moment()['add'](_0x5e9e11[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]][_0x3bf4('0xdc')],_0x3bf4('0xdd'))[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0x4f3d8e[_0x3bf4('0xde')],'ListId':_0x4f3d8e[_0x3bf4('0xdf')],'VoiceQueueId':_0x4f3d8e[_0x3bf4('0xe0')]||undefined,'CampaignId':_0x4f3d8e[_0x3bf4('0xe1')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x460326=new History(_0x4dcc00);_0x460326[_0x3bf4('0x6f')]=0xa;_0x460326[_0x3bf4('0xd1')]=_0x3bf4('0xd2');_0x460326[_0x3bf4('0xe2')]=moment()[_0x3bf4('0x46')](_0x3bf4('0xc2'));_0x460326[_0x3bf4('0x70')]=_0x460326[_0x3bf4('0xe2')];_0x460326[_0x3bf4('0xe3')]=_0x4dcc00[_0x3bf4('0xe3')];_0x460326[_0x3bf4('0xe4')]=_0x4dcc00[_0x3bf4('0xe4')];hopperUtils[_0x3bf4('0xc9')](_0x460326)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0xe5')));}})['then'](function(){if(_0x18636f)hopperUtils['swapAdditionalPhones'](_0x4dcc00,_0x4dfe14,_0x455d33)[_0x3bf4('0x3f')](function(){return 0x1;});});}else{this[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]][_0x3bf4('0x51')]+=0x1;this['voiceQueues'][_0x8e20a1['queue']][_0x3bf4('0xe6')]+=0x1;_0x4dcc00[_0x3bf4('0x6f')]=0xb;_0x4dcc00[_0x3bf4('0xd1')]=_0x3bf4('0xe7');_0x4dcc00[_0x3bf4('0xd3')]='CALLEREXIT';_0x4dcc00[_0x3bf4('0xe8')]+=0x1;_0x4dcc00['countglobal']+=0x1;_0x4dfe14=this['voiceQueues'][_0x8e20a1['queue']][_0x3bf4('0xe9')];_0x455d33=this['voiceQueues'][_0x8e20a1[_0x3bf4('0xbd')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x4dcc00,_0x4dcc00['state'],_0x4f3d8e[_0x3bf4('0xd9')])[_0x3bf4('0x3f')](function(_0x394680){if(_0x4dcc00[_0x3bf4('0xe8')]>=_0x5e9e11[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]][_0x3bf4('0xea')]){_0x5e9e11[_0x3bf4('0xdb')](_0x4dcc00,_0x394680[_0x3bf4('0xda')]);}else{hopperUtils[_0x3bf4('0xeb')]({'active':![],'countabandonedretry':_0x4dcc00[_0x3bf4('0xe8')],'scheduledat':moment()['add'](_0x5e9e11[_0x3bf4('0x1f')][_0x8e20a1[_0x3bf4('0xbd')]]['dialAbandonedRetryFrequency'],_0x3bf4('0xdd'))[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0x4f3d8e[_0x3bf4('0xde')],'ListId':_0x4f3d8e[_0x3bf4('0xdf')],'VoiceQueueId':_0x4f3d8e[_0x3bf4('0xe0')]||undefined,'CampaignId':_0x4f3d8e['CampaignId']||undefined})[_0x3bf4('0x9c')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x397c68=new History(_0x4dcc00);_0x397c68[_0x3bf4('0x6f')]=0xb;_0x397c68[_0x3bf4('0xd1')]=_0x3bf4('0xe7');_0x397c68[_0x3bf4('0xe2')]=moment()[_0x3bf4('0x46')](_0x3bf4('0xc2'));_0x397c68[_0x3bf4('0x70')]=_0x397c68[_0x3bf4('0xe2')];_0x397c68[_0x3bf4('0xe3')]=_0x4dcc00[_0x3bf4('0xe3')];_0x397c68['calleridnum']=_0x4dcc00[_0x3bf4('0xe4')];hopperUtils[_0x3bf4('0xc9')](_0x397c68)['catch'](loggerCatch(_0x3bf4('0xec')));}})[_0x3bf4('0x3f')](function(){if(_0x18636f)hopperUtils['swapAdditionalPhones'](_0x4dcc00,_0x4dfe14,_0x455d33)[_0x3bf4('0x3f')](function(){return 0x1;});});}}}};Dialer[_0x3bf4('0x19')][_0x3bf4('0x37')]=function(_0x185dda){if(this[_0x3bf4('0xed')][_0x185dda[_0x3bf4('0xbf')]]){this[_0x3bf4('0xed')][_0x185dda['uniqueid']]['channel']=_0x185dda[_0x3bf4('0xee')];}if(this[_0x3bf4('0xbe')][_0x185dda[_0x3bf4('0xbf')]]){this[_0x3bf4('0xbe')][_0x185dda['uniqueid']][_0x3bf4('0xee')]=_0x185dda[_0x3bf4('0xee')];}};Dialer[_0x3bf4('0x19')][_0x3bf4('0x3b')]=function(_0x2c9949){if(!this[_0x3bf4('0xed')][_0x2c9949['actionid']]){return;}var _0x4f9615=this[_0x3bf4('0x1f')][this[_0x3bf4('0xed')][_0x2c9949[_0x3bf4('0xef')]][_0x3bf4('0xbd')]][_0x3bf4('0xf0')]||_0x3bf4('0xf1');if(_0x4f9615==='roundrobin'){if(this['actions'][_0x2c9949[_0x3bf4('0xef')]]&&_[_0x3bf4('0xf2')](this[_0x3bf4('0xed')][_0x2c9949[_0x3bf4('0xef')]][_0x3bf4('0xf3')])&&_0x2c9949[_0x3bf4('0x84')]==='1'&&_0x2c9949[_0x3bf4('0xf4')]==='0'){if(this['agents'][_0x2c9949[_0x3bf4('0xf5')]]){if(!this[_0x3bf4('0x21')][_0x2c9949[_0x3bf4('0xf5')]][_0x3bf4('0xf3')]){this['agents'][_0x2c9949[_0x3bf4('0xf5')]][_0x3bf4('0xf3')]=!![];this[_0x3bf4('0xed')][_0x2c9949[_0x3bf4('0xef')]][_0x3bf4('0xf3')]=!![];this[_0x3bf4('0xed')][_0x2c9949[_0x3bf4('0xef')]][_0x3bf4('0xf5')]=_0x2c9949['stateinterface'];}}}}else if(_0x4f9615==='rrmemory'){if(this['actions'][_0x2c9949[_0x3bf4('0xef')]]){if(this[_0x3bf4('0x21')][_0x2c9949[_0x3bf4('0xf5')]]){this[_0x3bf4('0xed')][_0x2c9949['actionid']][_0x3bf4('0xf5')]=_0x2c9949[_0x3bf4('0xf5')];if(_[_0x3bf4('0xf2')](this['queueBooked'][this[_0x3bf4('0xed')][_0x2c9949['actionid']][_0x3bf4('0xbd')]])){this[_0x3bf4('0x2a')][this[_0x3bf4('0xed')][_0x2c9949[_0x3bf4('0xef')]][_0x3bf4('0xbd')]]=[];}this['queueBooked'][this['actions'][_0x2c9949[_0x3bf4('0xef')]][_0x3bf4('0xbd')]][_0x3bf4('0x9d')](_[_0x3bf4('0x62')](_[_0x3bf4('0xf6')](this[_0x3bf4('0xed')][_0x2c9949[_0x3bf4('0xef')]],[_0x3bf4('0xf7'),_0x3bf4('0xf5')]),{'status':_0x2c9949['status'],'paused':_0x2c9949[_0x3bf4('0xf4')]}));}}}};Dialer['prototype'][_0x3bf4('0x3c')]=function(_0x523e01){if(!this['actions'][_0x523e01[_0x3bf4('0xef')]]){return;}var _0x409143=this;var _0x2bbf2a=this[_0x3bf4('0x1f')][this[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xbd')]];var _0x44e422=_0x2bbf2a['strategy']||'rrmemory';if(_0x44e422==='roundrobin'){if(this[_0x3bf4('0xed')][_0x523e01['actionid']]&&this[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xf5')]){this[_0x3bf4('0x1e')][_0x3bf4('0xf8')](this[_0x3bf4('0xed')][_0x523e01['actionid']][_0x3bf4('0xf7')],this['actions'][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xf5')])[_0x3bf4('0x9c')](function(_0x5b162b){logger[_0x3bf4('0x66')](_0x3bf4('0xf9'),util['inspect'](_0x5b162b,{'showHidden':![],'depth':null}));})[_0x3bf4('0x1c')](function(){_0x409143['updateOriginated'](_0x409143['voiceQueues'][_0x409143[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xbd')]]);_0x409143[_0x3bf4('0x21')][_0x409143['actions'][_0x523e01[_0x3bf4('0xef')]]['stateinterface']][_0x3bf4('0xf3')]=![];delete _0x409143[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]];unlockQueueStatus(_0x2bbf2a);});}else{this[_0x3bf4('0xc1')](this[_0x3bf4('0x1f')][this[_0x3bf4('0xed')][_0x523e01['actionid']][_0x3bf4('0xbd')]]);hopperUtils[_0x3bf4('0xeb')]({'active':![],'ContactId':this['actions'][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xde')],'ListId':this['actions'][_0x523e01[_0x3bf4('0xef')]]['ListId'],'VoiceQueueId':this[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xe0')]||undefined,'CampaignId':this[_0x3bf4('0xed')][_0x523e01['actionid']][_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0xfa')));delete this[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]];unlockQueueStatus(_0x2bbf2a);}}else if(_0x44e422===_0x3bf4('0xf1')){var _0x41a50d;if(this[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]]&&!_[_0x3bf4('0x4a')](this['queueBooked'][this[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xbd')]])){if(this[_0x3bf4('0x2b')][_0x409143[_0x3bf4('0xed')][_0x523e01['actionid']][_0x3bf4('0xbd')]]){this['queueBookedRR'][_0x409143['actions'][_0x523e01['actionid']]['queue']]=this[_0x3bf4('0x2b')][this['actions'][_0x523e01['actionid']][_0x3bf4('0xbd')]]?this[_0x3bf4('0x2b')][this['actions'][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xbd')]]:this[_0x3bf4('0x2a')][this['actions'][_0x523e01[_0x3bf4('0xef')]]['queue']]?this[_0x3bf4('0x2a')][this[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]]['queue']][_0x3bf4('0xfb')]||0x0:0x0;}this[_0x3bf4('0x2a')][this['actions'][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xbd')]][_0x3bf4('0xfb')]=this[_0x3bf4('0x2b')][this[_0x3bf4('0xed')][_0x523e01[_0x3bf4('0xef')]][_0x3bf4('0xbd')]];for(var _0xc3eaa8=0x0;_0xc3eaa8=_0x481910['dialGlobalMaxRetry']){_0x1c6f68['stateGlobal'](_0x8be9aa,_0x47f9,_0x415c67,_0x3bf4('0x123'));}else{if(_0x8be9aa[_0x3bf4('0x121')]>=_0x481910['dialMachineMaxRetry']){_0x1c6f68[_0x3bf4('0x124')](_0x8be9aa,_0x47f9,_0x415c67,_0x3bf4('0x125'));}else{hopperUtils[_0x3bf4('0xeb')]({'active':![],'countmachineretry':_0x8be9aa[_0x3bf4('0x121')],'scheduledat':moment()[_0x3bf4('0x126')](_0x481910[_0x3bf4('0x127')],_0x3bf4('0xdd'))[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0x8be9aa[_0x3bf4('0xde')],'ListId':_0x8be9aa[_0x3bf4('0xdf')],'VoiceQueueId':_0x8be9aa[_0x3bf4('0xe0')]||undefined,'CampaignId':_0x8be9aa[_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x128')));_0x47f9({'reschedule':0x1});}}});}if(_0x2a0ad9['type']===_0x3bf4('0xc0')&&this['campaigns'][_0x2a0ad9[_0x3bf4('0xbd')]]['dialAMDActive']&&_0x110364[_0x3bf4('0x10e')]===_0x3bf4('0x10f')){delete this[_0x3bf4('0xbe')][_0x110364[_0x3bf4('0xbf')]];this[_0x3bf4('0xc1')](this[_0x3bf4('0x20')][_0x2a0ad9[_0x3bf4('0xbd')]]);_0x40e68f=new Hangup(_0x2a0ad9,_0x110364);_0x40e68f[_0x3bf4('0x6f')]=0x12;_0x40e68f[_0x3bf4('0xd1')]=_0x3bf4('0x111');_0x40e68f[_0x3bf4('0x112')]='AMD';ami['emit'](_0x3bf4('0x115'),ut[_0x3bf4('0x116')](_0x40e68f,_0x3bf4('0x117')));this[_0x3bf4('0x118')](_0x40e68f,_0x3bf4('0x129'),_0x3bf4('0x12a'));}if(_0x2a0ad9['type']===_0x3bf4('0xc0')&&this[_0x3bf4('0x20')][_0x2a0ad9[_0x3bf4('0xbd')]][_0x3bf4('0x10d')]&&_0x110364[_0x3bf4('0x10e')]===_0x3bf4('0x11a')){return new Promise(function(_0x5ce9ba,_0x50f212){delete _0x1c6f68[_0x3bf4('0xbe')][_0x110364[_0x3bf4('0xbf')]];_0x1c6f68[_0x3bf4('0xc1')](_0x1c6f68[_0x3bf4('0x20')][_0x2a0ad9[_0x3bf4('0xbd')]]);_0x1c6f68[_0x3bf4('0x20')][_0x2a0ad9[_0x3bf4('0xbd')]][_0x3bf4('0xc3')]+=0x1;_0x1c6f68['campaigns'][_0x2a0ad9[_0x3bf4('0xbd')]][_0x3bf4('0x110')]+=0x1;var _0xcd8174=_0x1c6f68[_0x3bf4('0x20')][_0x2a0ad9[_0x3bf4('0xbd')]];var _0xb80561=new Hangup(_0x2a0ad9,_0x110364);_0xb80561[_0x3bf4('0x6f')]=0x13;_0xb80561[_0x3bf4('0xd1')]=_0x3bf4('0x11b');_0xb80561[_0x3bf4('0x112')]=_0x3bf4('0x113');_0xb80561[_0x3bf4('0x121')]+=0x1;_0xb80561[_0x3bf4('0xd6')]+=0x1;_0xb80561[_0x3bf4('0x117')]=!![];ami[_0x3bf4('0x114')]('custom:amd',ut['buildObj'](_0xb80561,_0x3bf4('0x117')));hopperUtils['createHistory'](_0xb80561)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x11c')));if(_0xb80561[_0x3bf4('0x11d')]+_0xb80561[_0x3bf4('0x11e')]+_0xb80561[_0x3bf4('0x11f')]+_0xb80561[_0x3bf4('0x120')]+_0xb80561[_0x3bf4('0xd5')]+_0xb80561['countabandonedretry']+_0xb80561[_0x3bf4('0x121')]+_0xb80561[_0x3bf4('0x122')]>=_0xcd8174[_0x3bf4('0x12b')]){_0x1c6f68['stateGlobal'](_0xb80561,_0x5ce9ba,_0x50f212,_0x3bf4('0x123'));}else{if(_0xb80561[_0x3bf4('0x121')]>=_0xcd8174[_0x3bf4('0x12c')]){_0x1c6f68[_0x3bf4('0x124')](_0xb80561,_0x5ce9ba,_0x50f212,_0x3bf4('0x125'));}else{hopperUtils[_0x3bf4('0xeb')]({'active':![],'countmachineretry':_0xb80561['countmachineretry'],'scheduledat':moment()[_0x3bf4('0x126')](_0xcd8174[_0x3bf4('0x127')],_0x3bf4('0xdd'))[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0xb80561['ContactId'],'ListId':_0xb80561[_0x3bf4('0xdf')],'VoiceQueueId':_0xb80561[_0x3bf4('0xe0')]||undefined,'CampaignId':_0xb80561['CampaignId']||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x128')));_0x5ce9ba({'reschedule':0x1});}}});}}};Dialer[_0x3bf4('0x19')]['syncHangup']=function(_0x332f57){var _0x717d19=this[_0x3bf4('0xbe')][_0x332f57[_0x3bf4('0xbf')]];var _0x23b9e5;if(_0x717d19&&_0x717d19[_0x3bf4('0x41')]===_0x3bf4('0xc0')){delete this['uniqueId'][_0x332f57['uniqueid']];this[_0x3bf4('0xc1')](this[_0x3bf4('0x20')][_0x717d19[_0x3bf4('0xbd')]]);this[_0x3bf4('0x20')][_0x717d19[_0x3bf4('0xbd')]]['ivrAnswerCallsDay']+=0x1;_0x23b9e5=new Hangup(_0x717d19,_0x332f57);hopperUtils['createHistory'](_0x23b9e5)[_0x3bf4('0x9c')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x23b9e5)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x12d')));}if(_0x717d19&&_0x717d19['type']!=='ivr'&&isNotNull(this['voiceQueues'][_0x717d19[_0x3bf4('0xbd')]][_0x3bf4('0x12e')])){delete this[_0x3bf4('0xbe')][_0x332f57[_0x3bf4('0xbf')]];this[_0x3bf4('0xc1')](this['voiceQueues'][_0x717d19['queue']]);this[_0x3bf4('0x1f')][_0x717d19[_0x3bf4('0xbd')]][_0x3bf4('0xc3')]+=0x1;this[_0x3bf4('0x1f')][_0x717d19['queue']][_0x3bf4('0x110')]+=0x1;_0x23b9e5=new Hangup(_0x717d19,_0x332f57);_0x23b9e5[_0x3bf4('0x6f')]=0x10;_0x23b9e5['statedesc']='AnswerAGI';_0x23b9e5[_0x3bf4('0x112')]='AGI';hopperUtils['createHistory'](_0x23b9e5)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x12f')));hopperUtils[_0x3bf4('0x130')](_0x23b9e5)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x12d')));}if(_0x717d19&&_0x717d19['type']!==_0x3bf4('0xc0')&&!isNotNull(this['voiceQueues'][_0x717d19[_0x3bf4('0xbd')]]['dialQueueProject'])){delete this['uniqueId'][_0x332f57[_0x3bf4('0xbf')]];this[_0x3bf4('0xc1')](this[_0x3bf4('0x1f')][_0x717d19[_0x3bf4('0xbd')]]);this['voiceQueues'][_0x717d19[_0x3bf4('0xbd')]][_0x3bf4('0x131')]+=0x1;_0x23b9e5=new Hangup(_0x717d19,_0x332f57);_0x23b9e5[_0x3bf4('0x6f')]=0xc;_0x23b9e5[_0x3bf4('0xd1')]=_0x332f57[_0x3bf4('0x132')];_0x23b9e5['membername']='Unknow';hopperUtils[_0x3bf4('0xc9')](_0x23b9e5)['catch'](loggerCatch(_0x3bf4('0x12f')));hopperUtils[_0x3bf4('0x130')](_0x23b9e5)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x12d')));}};Dialer[_0x3bf4('0x19')]['syncQueueSummary']=function(_0x347ba7){var _0x315179=this;if(!_0x315179['queuesSummary'][_0x347ba7[_0x3bf4('0x48')]]){_0x315179[_0x3bf4('0x2c')][_0x347ba7[_0x3bf4('0x48')]]={'running':![]};}else if(_0x315179[_0x3bf4('0x2c')][_0x347ba7[_0x3bf4('0x48')]][_0x3bf4('0x133')]===!![]){return;}else if(_0x315179['queuesSummary'][_0x347ba7['name']][_0x3bf4('0x133')]===![]){_0x315179['queuesSummary'][_0x347ba7[_0x3bf4('0x48')]][_0x3bf4('0x133')]=!![];}var _0x424f5b=_0x315179['voiceQueues'][_0x347ba7['name']];var _0x382b58=_0x424f5b[_0x3bf4('0x69')]!==utils['CAMPAIGN_STATUS'][_0x3bf4('0x79')];var _0x2afaaf=utils[_0x3bf4('0x134')](_0x424f5b);_0x424f5b[_0x3bf4('0x135')]=utils['getQueueCampaignStatusMessage'](_0x424f5b,_0x315179[_0x3bf4('0x22')]);Promise[_0x3bf4('0xa8')]()['then'](function(){if(_0x424f5b['statusMessage']===utils[_0x3bf4('0x6a')][_0x3bf4('0x79')]){if(_0x382b58){clearPredictiveAttributes(_0x424f5b);_0x347ba7[_0x3bf4('0x27')]=undefined;_0x347ba7[_0x3bf4('0x28')]=undefined;}if(_0x424f5b[_0x3bf4('0x135')]===utils[_0x3bf4('0x6a')][_0x3bf4('0x79')]){_0x347ba7[_0x3bf4('0x136')]=0x0;_0x347ba7[_0x3bf4('0xf4')]=0x0;_0x347ba7['inUse']=0x0;_0x347ba7[_0x3bf4('0x137')]=0x0;_0x347ba7[_0x3bf4('0x138')]=0x0;}}else if(_0x424f5b[_0x3bf4('0x135')]===utils[_0x3bf4('0x6a')][_0x3bf4('0x139')]&&!_0x2afaaf){return _0x315179[_0x3bf4('0x90')](_0x424f5b,!![])[_0x3bf4('0x3f')](function(){return _0x315179[_0x3bf4('0x90')](_0x424f5b,![]);})[_0x3bf4('0x3f')](function(){return _0x315179[_0x3bf4('0xac')](_0x424f5b);})[_0x3bf4('0x9c')](function(_0xe98a2b){loggerSyncQueueSummary[_0x3bf4('0x43')](_0x3bf4('0x13a'),util[_0x3bf4('0x45')](_0xe98a2b,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x424f5b);});}else{clearPredictiveAttributes(_0x424f5b);}})['then'](function(){var _0x4bb9a2=_0x347ba7['compareToOutboundQueue'](_0x424f5b);if(_0x4bb9a2||_0x424f5b[_0x3bf4('0x13b')]){_0x424f5b[_0x3bf4('0x13b')]=![];_0x347ba7[_0x3bf4('0x13c')](_0x424f5b);Object[_0x3bf4('0x13d')](_0x424f5b,_0x347ba7);emitOutboundVoiceQueueSummary(_0x347ba7);}_0x315179['queuesSummary'][_0x424f5b['name']][_0x3bf4('0x133')]=![];})[_0x3bf4('0x9c')](function(_0x3c5ad3){logger['error']('[syncQueueSummary]',util[_0x3bf4('0x45')](_0x3c5ad3,{'showHidden':![],'depth':null}));_0x315179[_0x3bf4('0x2c')][_0x424f5b[_0x3bf4('0x48')]][_0x3bf4('0x133')]=![];});};Dialer['prototype']['syncQueueSummaryComplete']=_[_0x3bf4('0x13e')](function(){var _0x910ce0=_[_0x3bf4('0x13f')](this[_0x3bf4('0x1f')],function(_0x30e4e4){return _0x30e4e4['dialPreviewRecallmeReminder'];});var _0x58cafc=_['filter'](this[_0x3bf4('0x21')],function(_0x26245d){return _0x26245d[_0x3bf4('0x140')]&&_0x26245d[_0x3bf4('0x84')]===_0x3bf4('0x85');});if(_0x910ce0[_0x3bf4('0xfc')]>0x0&&_0x58cafc['length']>0x0){return Promise[_0x3bf4('0xa8')]()['then'](cmHopper[_0x3bf4('0x141')](_['map'](_0x910ce0,'id'),previewRecallmeReminderInterval,_[_0x3bf4('0x142')](_0x58cafc,'id')))['then'](function(_0x235665){for(var _0x5a3a70=0x0;_0x5a3a70<_0x235665[_0x3bf4('0xfc')];_0x5a3a70++){var _0x17b3cb=_0x235665[_0x5a3a70]['Agent'][_0x3bf4('0x48')];if(_0x17b3cb)io['to'](util[_0x3bf4('0x46')](_0x3bf4('0x143'),_0x17b3cb))[_0x3bf4('0x114')](_0x3bf4('0x144'),{'hopper':_0x235665[_0x5a3a70]});}})['catch'](function(_0x2015d8){logger['error']('checkPreviewRecallReminder',_0x2015d8);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x370144=this;setInterval(function(){_0x370144[_0x3bf4('0x145')](_0x370144[_0x3bf4('0xbe')],_0x3bf4('0x146'));_0x370144['clearZombieChannels'](_0x370144[_0x3bf4('0xed')],_0x3bf4('0x147'));},0x32c8);};Dialer[_0x3bf4('0x19')][_0x3bf4('0x145')]=function(_0x128cb9,_0x20c37c){var _0x417560=this;for(var _0x35e903 in _0x128cb9){if(typeof _0x128cb9[_0x35e903]!==_0x3bf4('0xa7')){this[_0x3bf4('0x1d')][_0x3bf4('0x1a')](function(){if(!_[_0x3bf4('0xf2')](_0x128cb9[_0x35e903])){return ami['Action']({'action':_0x3bf4('0x84'),'channel':_0x128cb9[_0x35e903][_0x3bf4('0xee')]})[_0x3bf4('0x9c')](function(_0x45a002){if(_0x45a002[_0x3bf4('0x69')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x128cb9[_0x35e903]&&_0x128cb9[_0x35e903][_0x3bf4('0x41')]!==_0x3bf4('0xc0')){_0x417560[_0x3bf4('0xc1')](_0x417560['voiceQueues'][_0x128cb9[_0x35e903][_0x3bf4('0xbd')]]);logger[_0x3bf4('0x66')](_0x3bf4('0x148'),_0x20c37c,_0x35e903,_0x128cb9[_0x35e903]['queue']);delete _0x128cb9[_0x35e903];}if(_0x128cb9[_0x35e903]&&_0x128cb9[_0x35e903][_0x3bf4('0x41')]===_0x3bf4('0xc0')){_0x417560[_0x3bf4('0xc1')](_0x417560[_0x3bf4('0x20')][_0x128cb9[_0x35e903][_0x3bf4('0xbd')]]);logger[_0x3bf4('0x66')](_0x3bf4('0x149'),_0x20c37c,_0x35e903,_0x128cb9[_0x35e903]['queue']);delete _0x128cb9[_0x35e903];}},0x2328);}});}});}}};Dialer[_0x3bf4('0x19')][_0x3bf4('0x14a')]=function(_0x4811c5){return Promise[_0x3bf4('0xa8')]()[_0x3bf4('0x3f')](voiceQueueRt[_0x3bf4('0x14a')](_0x4811c5))[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x14b')));};Dialer[_0x3bf4('0x19')]['updateOriginated']=function(_0x1b9318){if(!_['isUndefined'](_0x1b9318)&&_0x1b9318!==null){if(typeof _0x1b9318[_0x3bf4('0x7d')]!=='undefined'){if(_0x1b9318['originated']>0x0){_0x1b9318[_0x3bf4('0x7d')]-=0x1;}else{logger[_0x3bf4('0x66')](_0x3bf4('0x14c'));}}}else{logger[_0x3bf4('0x66')](_0x3bf4('0x14d'));}};Dialer['prototype']['loggerHandler']=function(_0x2108a1,_0xad21a5){var _0x28316f=this;return function(_0x476dc3){_0x28316f[_0x3bf4('0xc1')](_0xad21a5);logger[_0x3bf4('0x66')](_0x2108a1,util[_0x3bf4('0x45')](_0x476dc3,{'showHidden':![],'depth':null}));};};Dialer[_0x3bf4('0x19')]['emptyContact']=function(_0x550cdb,_0x55be7f,_0x2840da){var _0x478966={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x55be7f);this[_0x3bf4('0x118')](_['merge'](_0x478966,_[_0x3bf4('0xf6')](_0x2840da,[_0x3bf4('0xde'),_0x3bf4('0xdf'),_0x3bf4('0x14e'),_0x3bf4('0xe0'),'CampaignId'])),_0x3bf4('0x14f'),_0x3bf4('0x150'));logger['error'](_0x550cdb);};Dialer[_0x3bf4('0x19')][_0x3bf4('0x118')]=function(_0xc80d62,_0x451ad6,_0x7dec7d){hopperUtils[_0x3bf4('0xc9')](_0xc80d62)['catch'](loggerCatch(_0x451ad6));hopperUtils[_0x3bf4('0x130')](_0xc80d62)[_0x3bf4('0x9c')](loggerCatch(_0x7dec7d));};Dialer['prototype'][_0x3bf4('0xdb')]=function(_0x3dad15,_0x29d320){hopperUtils['createHistory'](_0x3dad15)[_0x3bf4('0x9c')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x29d320==0x0){hopperUtils['moveContactManagedDialer'](_0x3dad15)[_0x3bf4('0x9c')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x3bf4('0x19')][_0x3bf4('0x151')]=function(_0x53bc79){return Promise['resolve']()[_0x3bf4('0x3f')](cmHopper[_0x3bf4('0x141')](_0x53bc79['id'],previewRecallmeReminderInterval))[_0x3bf4('0x3f')](function(_0x99118d){for(var _0x5f5bbc=0x0;_0x5f5bbc<_0x99118d['length'];_0x5f5bbc++){var _0x5e8673=_0x99118d[_0x5f5bbc]['Agent'][_0x3bf4('0x48')];if(_0x5e8673)io['to'](util[_0x3bf4('0x46')](_0x3bf4('0x143'),_0x5e8673))['emit'](_0x3bf4('0x144'),{'hopper':_0x99118d[_0x5f5bbc]});}})[_0x3bf4('0x9c')](function(){});};Dialer['prototype'][_0x3bf4('0xab')]=function(_0x4115e3){var _0x5f571b=this;return function(){_0x5f571b[_0x3bf4('0x152')](_0x4115e3);};};Dialer['prototype']['actionOriginate']=function(_0x26d758,_0x3f8609){var _0x1f2279=this;var _0x3099f5=uuid['v4']();this[_0x3bf4('0xed')][_0x3099f5]=new Action(_0x26d758,_0x3f8609,_0x3099f5);return new Promise(function(_0x49160f,_0x5953f3){if(_['isUndefined'](_0x26d758)&&typeof _0x26d758!==_0x3bf4('0x153')){return _0x5953f3(msgResponse(_0x3bf4('0x154'),_0x3bf4('0x91'),_0x3bf4('0x155')));}if(_[_0x3bf4('0x40')](_0x3f8609['phone'])||_0x3f8609[_0x3bf4('0x156')]===null){return _0x5953f3(msgResponse('originate',_0x3bf4('0x91'),_0x3bf4('0x157')));}var _0x1f7c6a={'XMD-CALLERID':_0x1f2279['actions'][_0x3099f5][_0x3bf4('0x158')](),'XMD-AGI':_0x26d758[_0x3bf4('0x12e')]?util['format'](_0x3bf4('0x159'),ipAgi,_0x26d758[_0x3bf4('0x12e')]):_0x3bf4('0x15a'),'XMD-AGIAFTER':_0x26d758['dialQueueProject2']?util[_0x3bf4('0x46')](_0x3bf4('0x159'),ipAgi,_0x26d758[_0x3bf4('0xc7')]):_0x3bf4('0x15a'),'XMD-QUEUE':utils['isOutboundQueue'](_0x26d758)?util['format'](_0x3bf4('0x15b'),_0x26d758[_0x3bf4('0x48')],_0x26d758[_0x3bf4('0x15c')]||'',_0x26d758[_0x3bf4('0xc8')]?'c':'',_0x26d758[_0x3bf4('0xce')]||0x3):_0x3bf4('0x15a'),'XMD-CONTACTID':_0x3f8609[_0x3bf4('0xde')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1f2279[_0x3bf4('0xed')][_0x3099f5][_0x3bf4('0x158')](),'XMD-AMD':_0x26d758[_0x3bf4('0x10d')]?_0x3bf4('0x139'):_0x3bf4('0x15a'),'XMD-DESTINATION':_0x3bf4('0x10c')};if(_0x26d758[_0x3bf4('0x10d')]){_0x1f7c6a[_0x3bf4('0x15d')]=_0x26d758[_0x3bf4('0x15e')]||0x9c4;_0x1f7c6a[_0x3bf4('0x15f')]=_0x26d758[_0x3bf4('0x160')]||0x5dc;_0x1f7c6a[_0x3bf4('0x161')]=_0x26d758[_0x3bf4('0x162')]||0x320;_0x1f7c6a['XMD-AMDTOTALANALYSISTIME']=_0x26d758['dialAMDTotalAnalysisTime']||0x1388;_0x1f7c6a[_0x3bf4('0x163')]=_0x26d758[_0x3bf4('0x164')]||0x64;_0x1f7c6a['XMD-AMDBETWEENWORDSSILENCE']=_0x26d758[_0x3bf4('0x165')]||0x32;_0x1f7c6a[_0x3bf4('0x166')]=_0x26d758[_0x3bf4('0x167')]||0x3;_0x1f7c6a[_0x3bf4('0x168')]=_0x26d758[_0x3bf4('0x169')]||0x100;_0x1f7c6a[_0x3bf4('0x16a')]=_0x26d758['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x26d758)){_0x1f7c6a[_0x3bf4('0x16b')]=_0x3f8609[_0x3bf4('0xe0')];}else{_0x1f7c6a['XMD-CAMPAIGNID']=_0x3f8609[_0x3bf4('0xe1')];}var _0x41dabe=utils['setXMDContactVariables'](_0x3f8609[_0x3bf4('0x16c')]);Object[_0x3bf4('0x13d')](_0x1f7c6a,_0x41dabe);var _0x3f9511=_0x1f2279[_0x3bf4('0x88')](_0x26d758['Trunk'])?utils['getCallerId'](_0x26d758['Trunk']['callerid'],_0x26d758[_0x3bf4('0x16d')],_0x26d758[_0x3bf4('0x16e')]>0x0?utils[_0x3bf4('0x16f')](_0x26d758['dialOriginateCallerIdNumber'],_0x26d758[_0x3bf4('0x16e')]):_0x26d758[_0x3bf4('0x170')]):utils[_0x3bf4('0x171')](_[_0x3bf4('0xf2')](_0x26d758[_0x3bf4('0x89')])?_0x26d758[_0x3bf4('0x172')][_0x3bf4('0x173')]:_0x26d758[_0x3bf4('0x89')]['callerid'],_0x26d758[_0x3bf4('0x16d')],_0x26d758['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x3bf4('0x16f')](_0x26d758['dialOriginateCallerIdNumber'],_0x26d758[_0x3bf4('0x16e')]):_0x26d758[_0x3bf4('0x170')]);if(_0x3f9511){_0x1f7c6a[_0x3bf4('0x174')]=_0x1f2279[_0x3bf4('0xed')][_0x3099f5][_0x3bf4('0x175')]=utils[_0x3bf4('0x176')](_0x3f9511);_0x1f7c6a[_0x3bf4('0x177')]=_0x3f8609[_0x3bf4('0x156')];}_0x26d758[_0x3bf4('0x178')]=_0x1f7c6a;return ami[_0x3bf4('0x97')]({'actionid':_0x3099f5,'action':_0x3bf4('0x154'),'channel':_0x1f2279[_0x3bf4('0x88')](_0x26d758['Trunk'])?util[_0x3bf4('0x46')](_0x3bf4('0x179'),_0x26d758[_0x3bf4('0x172')][_0x3bf4('0x48')],isNotNull(_0x26d758['dialPrefix'])?_0x26d758['dialPrefix'][_0x3bf4('0x17a')]()||'':'',_0x26d758[_0x3bf4('0x17b')]>0x0?_0x3f8609['phone']['substring'](_0x26d758[_0x3bf4('0x17b')]):_0x3f8609[_0x3bf4('0x156')]):util['format'](_0x3bf4('0x179'),_[_0x3bf4('0xf2')](_0x26d758['TrunkBackup'])?_0x26d758[_0x3bf4('0x172')]['name']:_0x26d758[_0x3bf4('0x89')][_0x3bf4('0x48')],isNotNull(_0x26d758[_0x3bf4('0x17c')])?_0x26d758[_0x3bf4('0x17c')][_0x3bf4('0x17a')]()||'':'',_0x26d758[_0x3bf4('0x17b')]>0x0?_0x3f8609[_0x3bf4('0x156')][_0x3bf4('0x17d')](_0x26d758[_0x3bf4('0x17b')]):_0x3f8609[_0x3bf4('0x156')]),'callerid':_0x3f9511,'Exten':_0x3bf4('0x10c'),'Context':'from-sip','Priority':'1','variable':_0x1f7c6a,'timeout':(_0x26d758[_0x3bf4('0x17e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3099f5})['then'](function(_0x731391){return _0x49160f(_0x731391);})[_0x3bf4('0x9c')](function(_0x123b88){_0x26d758[_0x3bf4('0x17f')]+=0x1;var _0x369bed=new History(_0x1f2279[_0x3bf4('0xed')][_0x3099f5]);logger[_0x3bf4('0x66')](util[_0x3bf4('0x46')]('[originateError]:\x20%s',JSON['stringify'](_0x123b88)));_0x369bed['state']=0xe;_0x369bed[_0x3bf4('0xd1')]=_0x3bf4('0x180');_0x369bed['starttime']=moment()[_0x3bf4('0x46')](_0x3bf4('0xc2'));_0x369bed[_0x3bf4('0x70')]=_0x369bed[_0x3bf4('0xe2')];hopperUtils['createHistory'](_0x369bed)[_0x3bf4('0x9c')](loggerCatch('[originate][error]'));_0x1f2279['moveContactManagedDialer'](_0x369bed)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x181')))[_0x3bf4('0x1c')](function(){delete _0x1f2279['actions'][_0x3099f5];return _0x5953f3(msgResponse('originate','Error',_0x3bf4('0x182')));});});});};Dialer[_0x3bf4('0x19')][_0x3bf4('0x183')]=function(_0x1cd01e,_0x52420e,_0xfa043c){var _0xf4536=new History(_0x52420e);if(_0xf4536[_0x3bf4('0x11d')]+_0xf4536[_0x3bf4('0x11e')]+_0xf4536['countnoanswerretry']+_0xf4536[_0x3bf4('0x120')]+_0xf4536[_0x3bf4('0xd5')]+_0xf4536[_0x3bf4('0xe8')]+_0xf4536[_0x3bf4('0x121')]+_0xf4536[_0x3bf4('0x122')]>=_0xfa043c[_0x3bf4('0x12b')]-0x1){return!![];}switch(_0x1cd01e){case 0x3:if(_0xf4536['countnoanswerretry']>=_0xfa043c[_0x3bf4('0x184')]-0x1){return!![];}hopperUtils[_0x3bf4('0xeb')]({'active':![],'countnoanswerretry':_0xf4536[_0x3bf4('0x11f')]+=0x1,'scheduledat':moment()[_0x3bf4('0x126')](_0xfa043c[_0x3bf4('0x185')],_0x3bf4('0xdd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf4536[_0x3bf4('0xde')],'ListId':_0xf4536[_0x3bf4('0xdf')],'VoiceQueueId':_0xf4536[_0x3bf4('0xe0')]||undefined,'CampaignId':_0xf4536[_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x186')));break;case 0x5:if(_0xf4536['countbusyretry']>=_0xfa043c[_0x3bf4('0x187')]-0x1){return!![];}hopperUtils[_0x3bf4('0xeb')]({'active':![],'countbusyretry':_0xf4536[_0x3bf4('0x11d')]+=0x1,'scheduledat':moment()[_0x3bf4('0x126')](_0xfa043c[_0x3bf4('0x188')],_0x3bf4('0xdd'))[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0xf4536[_0x3bf4('0xde')],'ListId':_0xf4536['ListId'],'VoiceQueueId':_0xf4536['VoiceQueueId']||undefined,'CampaignId':_0xf4536[_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x189')));break;case 0x8:if(_0xf4536[_0x3bf4('0x11e')]>=_0xfa043c[_0x3bf4('0x18a')]-0x1){return!![];}hopperUtils[_0x3bf4('0xeb')]({'active':![],'countcongestionretry':_0xf4536[_0x3bf4('0x11e')]+=0x1,'scheduledat':moment()[_0x3bf4('0x126')](_0xfa043c['dialCongestionRetryFrequency'],'minutes')[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0xf4536['ContactId'],'ListId':_0xf4536[_0x3bf4('0xdf')],'VoiceQueueId':_0xf4536[_0x3bf4('0xe0')]||undefined,'CampaignId':_0xf4536['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0xf4536[_0x3bf4('0x120')]>=_0xfa043c[_0x3bf4('0x18b')]-0x1){return!![];}else{hopperUtils[_0x3bf4('0xeb')]({'active':![],'countnosuchnumberretry':_0xf4536['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0xfa043c[_0x3bf4('0x18c')],_0x3bf4('0xdd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf4536[_0x3bf4('0xde')],'ListId':_0xf4536['ListId'],'VoiceQueueId':_0xf4536['VoiceQueueId']||undefined,'CampaignId':_0xf4536['CampaignId']||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x18d')));}break;case 0xa:if(_0xf4536[_0x3bf4('0xd5')]>=_0xfa043c['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x3bf4('0xeb')]({'active':![],'countdropretry':_0xf4536['countdropretry']+=0x1,'scheduledat':moment()[_0x3bf4('0x126')](_0xfa043c[_0x3bf4('0xdc')],_0x3bf4('0xdd'))[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0xf4536[_0x3bf4('0xde')],'ListId':_0xf4536['ListId'],'VoiceQueueId':_0xf4536[_0x3bf4('0xe0')]||undefined,'CampaignId':_0xf4536[_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0xf4536[_0x3bf4('0xe8')]>=_0xfa043c[_0x3bf4('0xea')]-0x1){return!![];}hopperUtils[_0x3bf4('0xeb')]({'active':![],'countabandonedretry':_0xf4536[_0x3bf4('0xe8')]+=0x1,'scheduledat':moment()[_0x3bf4('0x126')](_0xfa043c[_0x3bf4('0xe9')],_0x3bf4('0xdd'))[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0xf4536['ContactId'],'ListId':_0xf4536['ListId'],'VoiceQueueId':_0xf4536['VoiceQueueId']||undefined,'CampaignId':_0xf4536[_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x18e')));break;case 0x13:if(_0xf4536[_0x3bf4('0x121')]>=_0xfa043c[_0x3bf4('0x12c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0xf4536[_0x3bf4('0x121')]+=0x1,'scheduledat':moment()[_0x3bf4('0x126')](_0xfa043c[_0x3bf4('0x127')],_0x3bf4('0xdd'))[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0xf4536[_0x3bf4('0xde')],'ListId':_0xf4536[_0x3bf4('0xdf')],'VoiceQueueId':_0xf4536[_0x3bf4('0xe0')]||undefined,'CampaignId':_0xf4536[_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x128')));break;case 0x14:if(_0xf4536[_0x3bf4('0x122')]>=_0xfa043c[_0x3bf4('0x18f')]-0x1){return!![];}hopperUtils[_0x3bf4('0xeb')]({'active':![],'countagentrejectretry':_0xf4536[_0x3bf4('0x122')]+=0x1,'scheduledat':moment()[_0x3bf4('0x126')](_0xfa043c[_0x3bf4('0x190')],'minutes')[_0x3bf4('0x46')](_0x3bf4('0xc2')),'ContactId':_0xf4536[_0x3bf4('0xde')],'ListId':_0xf4536[_0x3bf4('0xdf')],'VoiceQueueId':_0xf4536['VoiceQueueId']||undefined,'CampaignId':_0xf4536[_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x191')));break;default:return!![];}};Dialer[_0x3bf4('0x19')][_0x3bf4('0x108')]=function(_0x2ec0f6,_0x20743b,_0x54fa7f){var _0xeaba30=this;var _0x28a0fc=new History(_0x2ec0f6);var _0x6093dc=![];var _0x230883;var _0x2e8361;return new Promise(function(_0x3283b8,_0x1bedbf){if(_[_0x3bf4('0x40')](_0x20743b)&&typeof _0x20743b!==_0x3bf4('0x153')){return _0x1bedbf(msgResponse(_0x3bf4('0x192'),_0x3bf4('0x91'),'entity\x20is\x20undefine'));}if(_[_0x3bf4('0x40')](_0x54fa7f)&&typeof _0x54fa7f!==_0x3bf4('0x153')){return _0x1bedbf(msgResponse(_0x3bf4('0x192'),_0x3bf4('0x91'),'evt\x20is\x20undefine'));}hopperUtils[_0x3bf4('0xd8')](_0x28a0fc,_0x54fa7f['reason'],_0x20743b)[_0x3bf4('0x3f')](function(_0x1fa602){if(_0x1fa602[_0x3bf4('0xda')]==0x1)_0x6093dc=!![];switch(_0x54fa7f[_0x3bf4('0xc4')]){case'0':_0x20743b[_0x3bf4('0x193')]+=0x1;_0x28a0fc[_0x3bf4('0x6f')]=0x0;_0x28a0fc[_0x3bf4('0xd1')]=_0x3bf4('0x194');_0x28a0fc[_0x3bf4('0x120')]+=0x1;_0x28a0fc[_0x3bf4('0xd6')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x3bf4('0x116')](_0x2ec0f6,_0x3bf4('0x195')));_0x230883=_0x20743b[_0x3bf4('0x18c')];_0x2e8361=_0x20743b['callAdditionalPhoneAfterMin'];hopperUtils[_0x3bf4('0xc9')](_0x28a0fc)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x11c')));if(_0xeaba30['checkRetriveMax'](0x0,_0x2ec0f6,_0x20743b)&&!_0x6093dc){if(_0x28a0fc[_0x3bf4('0x120')]>=_0x20743b['dialNoSuchNumberMaxRetry']){_0xeaba30[_0x3bf4('0x124')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x196'));}else{_0xeaba30[_0x3bf4('0x197')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x196'));}}break;case'3':_0x20743b[_0x3bf4('0x198')]+=0x1;_0x28a0fc[_0x3bf4('0x6f')]=0x3;_0x28a0fc[_0x3bf4('0xd1')]=_0x3bf4('0x199');_0x28a0fc[_0x3bf4('0x11f')]+=0x1;_0x28a0fc[_0x3bf4('0xd6')]+=0x1;var _0x349f02=ut[_0x3bf4('0x19a')](_0x2ec0f6,_0x20743b);ami[_0x3bf4('0x114')](_0x3bf4('0x19b'),_0x349f02);_0x230883=_0x20743b[_0x3bf4('0x185')];_0x2e8361=_0x20743b[_0x3bf4('0xd7')];hopperUtils['createHistory'](_0x28a0fc)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x19c')));if(_0xeaba30[_0x3bf4('0x183')](0x3,_0x2ec0f6,_0x20743b)&&!_0x6093dc){if(_0x28a0fc[_0x3bf4('0x11f')]>=_0x20743b['dialNoAnswerMaxRetry']){_0xeaba30[_0x3bf4('0x124')](_0x28a0fc,_0x3283b8,_0x1bedbf,'reason\x203\x20ringing\x20no\x20answer');}else{_0xeaba30[_0x3bf4('0x197')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x19d'));}}break;case'5':_0x20743b['outboundBusyCallsDay']+=0x1;_0x28a0fc[_0x3bf4('0x6f')]=0x5;_0x28a0fc[_0x3bf4('0xd1')]='Busy';_0x28a0fc[_0x3bf4('0x11d')]+=0x1;_0x28a0fc['countglobal']+=0x1;ami[_0x3bf4('0x114')](_0x3bf4('0x19e'),ut[_0x3bf4('0x116')](_0x2ec0f6,_0x3bf4('0x19f')));_0x230883=_0x20743b[_0x3bf4('0x188')];_0x2e8361=_0x20743b[_0x3bf4('0xd7')];hopperUtils['createHistory'](_0x28a0fc)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0xeaba30['checkRetriveMax'](0x5,_0x2ec0f6,_0x20743b)&&!_0x6093dc){if(_0x28a0fc[_0x3bf4('0x11d')]>=_0x20743b[_0x3bf4('0x187')]){_0xeaba30[_0x3bf4('0x124')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x1a0'));}else{_0xeaba30[_0x3bf4('0x197')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x1a0'));}}break;case'8':_0x20743b[_0x3bf4('0x1a1')]+=0x1;_0x28a0fc[_0x3bf4('0x6f')]=0x8;_0x28a0fc[_0x3bf4('0xd1')]='Congestion';_0x28a0fc[_0x3bf4('0x11e')]+=0x1;_0x28a0fc[_0x3bf4('0xd6')]+=0x1;_0x230883=_0x20743b[_0x3bf4('0x1a2')];_0x2e8361=_0x20743b[_0x3bf4('0xd7')];ami[_0x3bf4('0x114')](_0x3bf4('0x1a3'),ut[_0x3bf4('0x116')](_0x2ec0f6,_0x3bf4('0x1a4')));hopperUtils['createHistory'](_0x28a0fc)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x1a5')));if(_0xeaba30[_0x3bf4('0x183')](0x8,_0x2ec0f6,_0x20743b)&&!_0x6093dc){if(_0x28a0fc[_0x3bf4('0x11e')]>=_0x20743b[_0x3bf4('0x18a')]){_0xeaba30['createStateFinal'](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x1a6'));}else{_0xeaba30['stateGlobal'](_0x28a0fc,_0x3283b8,_0x1bedbf,'reason\x208\x20congestion');}}break;case'11':_0x20743b[_0x3bf4('0x1a7')]+=0x1;_0x28a0fc['state']=0xb;_0x28a0fc[_0x3bf4('0xd1')]=_0x3bf4('0xe7');_0x28a0fc[_0x3bf4('0xe8')]+=0x1;_0x28a0fc[_0x3bf4('0xd6')]+=0x1;_0x230883=_0x20743b[_0x3bf4('0xe9')];_0x2e8361=_0x20743b[_0x3bf4('0xd7')];hopperUtils[_0x3bf4('0xc9')](_0x28a0fc)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0xec')));if(_0xeaba30[_0x3bf4('0x183')](0xb,_0x2ec0f6,_0x20743b)&&!_0x6093dc){if(_0x28a0fc[_0x3bf4('0xe8')]>=_0x20743b[_0x3bf4('0xea')]){_0xeaba30[_0x3bf4('0x124')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x1a8'));}else{_0xeaba30[_0x3bf4('0x197')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x1a8'));}}break;case'20':_0x20743b[_0x3bf4('0x1a9')]+=0x1;_0x28a0fc['state']=0x14;_0x28a0fc[_0x3bf4('0xd1')]='AgentReject';_0x28a0fc[_0x3bf4('0x122')]+=0x1;_0x28a0fc[_0x3bf4('0xd6')]+=0x1;_0x230883=_0x20743b['dialAgentRejectRetryFrequency'];_0x2e8361=_0x20743b[_0x3bf4('0xd7')];ami['emit'](_0x3bf4('0x1aa'),ut[_0x3bf4('0x116')](_0x2ec0f6,'agentreject'));hopperUtils['createHistory'](_0x28a0fc)['catch'](loggerCatch(_0x3bf4('0x1ab')));if(_0xeaba30[_0x3bf4('0x183')](0x14,_0x2ec0f6,_0x20743b)&&!_0x6093dc){if(_0x28a0fc[_0x3bf4('0x122')]>=_0x20743b[_0x3bf4('0x18f')]){_0xeaba30['createStateFinal'](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x3bf4('0x1ac'));}else{_0xeaba30[_0x3bf4('0x197')](_0x28a0fc,_0x3283b8,_0x1bedbf,'reason\x2020\x20agentreject');}}break;default:_0x20743b[_0x3bf4('0x131')]+=0x1;_0x28a0fc[_0x3bf4('0x6f')]=0xc;_0x28a0fc[_0x3bf4('0xd1')]=_0x54fa7f[_0x3bf4('0xc4')];_0x230883=_0x20743b[_0x3bf4('0x190')];_0x2e8361=_0x20743b['callAdditionalPhoneAfterMin'];hopperUtils[_0x3bf4('0xc9')](_0x28a0fc)[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x1ad')));if(_0xeaba30[_0x3bf4('0x183')](_0x54fa7f[_0x3bf4('0xc4')],_0x2ec0f6,_0x20743b)&&!_0x6093dc){if(_0x28a0fc[_0x3bf4('0x11d')]+_0x28a0fc['countcongestionretry']+_0x28a0fc[_0x3bf4('0x11f')]+_0x28a0fc['countnosuchnumberretry']+_0x28a0fc[_0x3bf4('0xd5')]+_0x28a0fc[_0x3bf4('0xe8')]+_0x28a0fc[_0x3bf4('0x121')]+_0x28a0fc[_0x3bf4('0x122')]>=_0x20743b[_0x3bf4('0x12b')]){_0xeaba30[_0x3bf4('0x197')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x54fa7f[_0x3bf4('0xc4')]);}else{_0xeaba30[_0x3bf4('0x124')](_0x28a0fc,_0x3283b8,_0x1bedbf,_0x54fa7f['reason']);}}}})['then'](function(){if(_0x6093dc){hopperUtils[_0x3bf4('0x1ae')](_0x28a0fc,_0x230883,_0x2e8361)['then'](function(){return _0x3283b8(0x1);});}});});};Dialer['prototype'][_0x3bf4('0x197')]=function(_0xadaabe,_0x3bda08,_0x40b8bb,_0x868835){var _0x8ea098=new Final(_0xadaabe);_0x8ea098['state']=0xf;_0x8ea098[_0x3bf4('0xd1')]=_0x3bf4('0x1af');this[_0x3bf4('0x124')](_0x8ea098,_0x3bda08,_0x40b8bb,_0x868835);};Dialer['prototype'][_0x3bf4('0x124')]=function(_0x27efb5,_0x1b6176,_0x4c6edc,_0x3879c4){hopperUtils[_0x3bf4('0x130')](_0x27efb5)[_0x3bf4('0x3f')](function(){return _0x1b6176(msgResponse(_0x3bf4('0x192'),_0x3bf4('0x1b0'),_0x3879c4));})['catch'](function(){return _0x4c6edc(msgResponse(_0x3bf4('0x1b1'),_0x3bf4('0x91'),_0x3bf4('0x1b2')));});};Dialer[_0x3bf4('0x19')][_0x3bf4('0xa')]=function(_0x2b0e09){var _0x3110d1=_0x2b0e09[_0x3bf4('0x1b3')]/0x64;var _0x2cedcf=_0x2b0e09[_0x3bf4('0xd0')]/(_0x2b0e09['outboundDropCallsDayTimeout']+_0x2b0e09['outboundAnswerCallsDay']);var _0x250125=Math[_0x3bf4('0x1b4')](_0x2b0e09[_0x3bf4('0x1b5')]*(_0x2b0e09['predictiveIntervalMaxThreshold']/0x64));var _0x515d9f=Math[_0x3bf4('0x1b4')](_0x2b0e09['predictiveIntervalAvailable']*(_0x2b0e09[_0x3bf4('0x1b6')]/0x64));var _0x5e294a=_0x2b0e09[_0x3bf4('0x136')]+_0x2b0e09[_0x3bf4('0x137')];var _0x53d4a3=Math[_0x3bf4('0x1b7')](_0x2b0e09[_0x3bf4('0x5a')]*_0x2b0e09['erlangAbandonmentRate']*_0x2b0e09[_0x3bf4('0x1b8')]*_0x2b0e09[_0x3bf4('0x1b9')]);if(_[_0x3bf4('0x40')](_0x2b0e09['startProgressive'])){if(!_[_0x3bf4('0x40')](_0x2b0e09[_0x3bf4('0x27')])){_0x2b0e09[_0x3bf4('0x27')]=undefined;loggerPredictive['error'](_0x3bf4('0x1ba'),_0x3bf4('0x1bb'));}if(!_[_0x3bf4('0x40')](_0x2b0e09['handlePredictive'])){loggerPredictive[_0x3bf4('0x66')](_0x3bf4('0x1ba'),_0x3bf4('0x1bc'));clearInterval(_0x2b0e09[_0x3bf4('0x64')]);_0x2b0e09[_0x3bf4('0x64')]=undefined;}_0x2b0e09[_0x3bf4('0x28')]=moment()[_0x3bf4('0x46')](_0x3bf4('0xc2'));loggerPredictive[_0x3bf4('0x4c')](_0x2b0e09[_0x3bf4('0x48')],_0x3bf4('0x1bd'),_0x2b0e09[_0x3bf4('0x28')]);this[_0x3bf4('0xaf')](_0x2b0e09,0x1);}else if(ifInterval(_0x2b0e09[_0x3bf4('0x1be')],_0x2b0e09['startProgressive'])){this['handlePower'](_0x2b0e09,0x1);loggerPredictiveCalls[_0x3bf4('0x4c')](_0x3bf4('0x1bf'),_0x2b0e09[_0x3bf4('0x28')],_0x2b0e09[_0x3bf4('0x48')]);_0x2b0e09[_0x3bf4('0x5a')]=0x0;_0x2b0e09[_0x3bf4('0x1c0')]=0x0;}else if(_0x3110d1<_0x2cedcf&&_0x2b0e09[_0x3bf4('0x1c1')]==='dropRate'){clearPredictiveAttributes(_0x2b0e09);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x1c2'),_0x3bf4('0x1c3'),_0x2cedcf,'startProgressive',_0x2b0e09[_0x3bf4('0x48')]);}else if(_0x53d4a3<_0x2b0e09['predictiveIntervalErlangCallsDroppedCalls']&&_0x2b0e09[_0x3bf4('0x1c1')]===_0x3bf4('0x1c4')){clearPredictiveAttributes(_0x2b0e09);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x1c5'),'Max\x20Drop\x20',_0x53d4a3,_0x3bf4('0x1c6'),_0x2b0e09[_0x3bf4('0x1c0')],_0x3bf4('0x28'),_0x2b0e09[_0x3bf4('0x48')]);}else if(!ifInterval(_0x2b0e09['dialPredictiveInterval'],_0x2b0e09[_0x3bf4('0x28')])&&_[_0x3bf4('0x40')](_0x2b0e09['startPredictive'])&&!_['isUndefined'](_0x2b0e09['startProgressive'])){_0x2b0e09['startPredictive']=moment()[_0x3bf4('0x46')](_0x3bf4('0xc2'));loggerPredictive[_0x3bf4('0x4c')](_0x2b0e09[_0x3bf4('0x48')],_0x3bf4('0x1c7'),_0x2b0e09[_0x3bf4('0x27')]);hopperUtils[_0x3bf4('0x1c8')](_0x2b0e09[_0x3bf4('0x1be')])[_0x3bf4('0x3f')](this[_0x3bf4('0x1c9')](_0x2b0e09))[_0x3bf4('0x3f')](mergeDataErlangB(_0x2b0e09))[_0x3bf4('0x3f')](this[_0x3bf4('0x1ca')](_0x2b0e09))[_0x3bf4('0x9c')](loggerCatchPredictive(_0x3bf4('0x1cb'),_0x2b0e09));}else if(!ifInterval(_0x2b0e09[_0x3bf4('0x1be')],_0x2b0e09[_0x3bf4('0x27')])){_0x2b0e09[_0x3bf4('0x1c0')]=0x0;_0x2b0e09[_0x3bf4('0x27')]=moment()['format'](_0x3bf4('0xc2'));loggerPredictive[_0x3bf4('0x4c')](_0x2b0e09[_0x3bf4('0x48')],_0x3bf4('0x1cc'),_0x2b0e09[_0x3bf4('0x27')]);clearInterval(_0x2b0e09['handlePredictive']);_0x2b0e09[_0x3bf4('0x64')]=undefined;hopperUtils[_0x3bf4('0x1c8')](_0x2b0e09[_0x3bf4('0x1be')])[_0x3bf4('0x3f')](this[_0x3bf4('0x1c9')](_0x2b0e09))['then'](mergeDataErlangB(_0x2b0e09))[_0x3bf4('0x3f')](this[_0x3bf4('0x1ca')](_0x2b0e09))[_0x3bf4('0x9c')](loggerCatchPredictive(_0x3bf4('0x1cd'),_0x2b0e09));}else if(_0x2b0e09[_0x3bf4('0x1b5')]&&_0x5e294a<_0x2b0e09[_0x3bf4('0x1b5')]-_0x515d9f){clearPredictiveAttributes(_0x2b0e09);loggerPredictive[_0x3bf4('0x4c')](_0x2b0e09[_0x3bf4('0x48')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5e294a,_0x3bf4('0x1ce'),_0x2b0e09[_0x3bf4('0x1b5')],'-',_0x515d9f,'=',_0x2b0e09[_0x3bf4('0x1b5')]-_0x515d9f,')');}else if(_0x2b0e09[_0x3bf4('0x1b5')]&&_0x5e294a>_0x2b0e09[_0x3bf4('0x1b5')]+_0x250125){clearPredictiveAttributes(_0x2b0e09);loggerPredictive['info'](_0x2b0e09['name'],_0x3bf4('0x1cf'),_0x5e294a,_0x3bf4('0x1d0'),_0x2b0e09[_0x3bf4('0x1b5')],'+',_0x250125,'=',_0x2b0e09[_0x3bf4('0x1b5')]+_0x250125,')');}};Dialer['prototype'][_0x3bf4('0x1c9')]=function(_0x27f7cb){var _0x634724=this;return function(_0x29a8f6){return new Promise(function(_0x44bd91,_0x16a725){_['merge'](_0x27f7cb,_0x29a8f6[0x0]);if(checkGetDataPredictive(_0x29a8f6[0x0])){var _0x105455=_0x27f7cb[_0x3bf4('0x1b5')]=_0x27f7cb[_0x3bf4('0x137')]+_0x27f7cb[_0x3bf4('0x136')];var _0x351528=_0x27f7cb[_0x3bf4('0x1be')]*0x3c;var _0x562801=_0x29a8f6[0x0]['predictiveIntervalAvgTalktime']+_0x29a8f6[0x0][_0x3bf4('0x53')];var _0x428227=(_0x29a8f6[0x0][_0x3bf4('0x4f')]+_0x29a8f6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x29a8f6[0x0][_0x3bf4('0x51')])/_0x29a8f6[0x0]['predictiveIntervalTotalCalls'];_0x27f7cb['predictiveIntervalHitRate']=_0x428227>0x0?_0x428227:0x1;switch(_0x27f7cb[_0x3bf4('0x1c1')]){case _0x3bf4('0x1c4'):var _0x440820=_0x27f7cb[_0x3bf4('0x1b3')]/0x64;return _0x634724[_0x3bf4('0x1d1')](_0x105455,_0x351528,_0x562801,_0x428227,_0x440820)['then'](function(_0x349e82){return _0x44bd91(_0x349e82);});case _0x3bf4('0x1d2'):var _0xc674a2=_0x27f7cb[_0x3bf4('0x1b3')]/0x64;return _0x634724[_0x3bf4('0x1d3')](_0x105455,_0x351528,_0x562801,_0x428227,_0xc674a2)[_0x3bf4('0x3f')](function(_0x125bde){return _0x44bd91(_0x125bde);});default:return _0x16a725(msgResponse(_0x3bf4('0x1d4'),'Failure',_0x3bf4('0x1d5')));}}else{return _0x16a725(msgResponse(_0x3bf4('0x1d4'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0x3bf4('0x1d6')]=function(_0x25123d){var _0x3c8360=this;return function(_0x1bf9fc){return new Promise(function(_0x53cbed,_0x57afa4){_[_0x3bf4('0x62')](_0x25123d,_0x1bf9fc[0x0]);if(checkGetDataPredictive(_0x1bf9fc[0x0])){loggerPredictive[_0x3bf4('0x4c')](JSON[_0x3bf4('0x74')](_0x1bf9fc[0x0]));if(_0x25123d['dialPredictiveOptimization']===_0x3bf4('0x1c4')){return _0x3c8360[_0x3bf4('0x14a')](_0x25123d['id'])[_0x3bf4('0x3f')](function(_0x1fab5d){var _0x1c24f5=_0x25123d[_0x3bf4('0x1d7')]-_0x1fab5d[0x0][_0x3bf4('0x1d8')];var _0x5e4715=_0x25123d['dialPredictiveInterval']*0x3c;var _0x2dfac1=_0x1bf9fc[0x0][_0x3bf4('0x54')]+_0x1bf9fc[0x0][_0x3bf4('0x53')];var _0x3c60eb=(_0x1bf9fc[0x0][_0x3bf4('0x4f')]+_0x1bf9fc[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1bf9fc[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1bf9fc[0x0][_0x3bf4('0x4d')];var _0x20860c=_0x25123d['dialPredictiveOptimizationPercentage']/0x64;_0x25123d[_0x3bf4('0x1d9')]=_0x1fab5d[0x0]['outboundQueuePauses']||0x0;_0x25123d['predictiveIntervalHitRate']=_0x3c60eb>0x0?_0x3c60eb:0x1;return _0x3c8360['abandonmentRate'](_0x1c24f5,_0x5e4715,_0x2dfac1,_0x3c60eb,_0x20860c);})['then'](function(_0x591a7c){return _0x53cbed(_0x591a7c);})[_0x3bf4('0x9c')](function(_0x518aca){return _0x57afa4(msgResponse('[CatchErlangB]',_0x3bf4('0x91'),JSON[_0x3bf4('0x74')](_0x518aca)));});}if(_0x25123d[_0x3bf4('0x1c1')]==='agentBusyFactor'){return _0x3c8360['getVoiceQueueRtPauses'](_0x25123d['id'])[_0x3bf4('0x3f')](function(_0x4e5c6c){var _0x205f23=_0x25123d['loggedIn']-_0x4e5c6c[0x0][_0x3bf4('0x1d8')];var _0x380904=_0x25123d['dialPredictiveInterval']*0x3c;var _0x2d2c2e=_0x1bf9fc[0x0][_0x3bf4('0x54')]+_0x1bf9fc[0x0][_0x3bf4('0x53')];var _0x4e83da=(_0x1bf9fc[0x0]['predictiveIntervalAnsweredCalls']+_0x1bf9fc[0x0][_0x3bf4('0xcf')]+_0x1bf9fc[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1bf9fc[0x0][_0x3bf4('0x4d')];var _0x732f2c=_0x25123d[_0x3bf4('0x1b3')]/0x64;_0x25123d['predictiveIntervalPauses']=_0x4e5c6c[0x0][_0x3bf4('0x1d8')]||0x0;_0x25123d[_0x3bf4('0x1b8')]=_0x4e83da>0x0?_0x4e83da:0x1;return _0x3c8360['busyFactor'](_0x205f23,_0x380904,_0x2d2c2e,_0x4e83da,_0x732f2c);})['then'](function(_0x5befd9){return _0x53cbed(_0x5befd9);})[_0x3bf4('0x9c')](function(_0x9a2ee6){return _0x57afa4(msgResponse(_0x3bf4('0x1da'),_0x3bf4('0x91'),JSON[_0x3bf4('0x74')](_0x9a2ee6)));});}}else{return _0x57afa4(msgResponse(_0x3bf4('0x1d4'),_0x3bf4('0x91'),'check\x20failure'));}});};};Dialer[_0x3bf4('0x19')]['startMethodPredictive']=function(_0x295be3){var _0x6616d3=this;return function(){var _0x14a1ee=0x0;var _0x30090d=Math[_0x3bf4('0x1b7')](_0x295be3[_0x3bf4('0x5c')]*0x3e8);if(_0x30090d>0x0){_0x30090d=_0x30090d<0x64?0x64:_0x30090d;loggerPredictive[_0x3bf4('0x4c')](_0x295be3[_0x3bf4('0x48')],_0x3bf4('0x1db'),_0x30090d,'milliseconds');_0x295be3['handlePredictive']=setInterval(function(){_0x6616d3[_0x3bf4('0x64')](_0x295be3);loggerPredictiveCalls[_0x3bf4('0x4c')](_0x3bf4('0x1dc'),_0x14a1ee+=0x1);},_0x30090d);}else{loggerPredictive['info'](_0x295be3['name'],_0x3bf4('0x1dd'));}};};Dialer[_0x3bf4('0x19')][_0x3bf4('0x1de')]=function(_0x272d22,_0xdb7329){var _0x38f2db=this;return function(_0x2bb7ad){if(_['isEmpty'](_0x2bb7ad)){if(_[_0x3bf4('0xf2')](_0xdb7329[_0x3bf4('0x14e')])||!_0xdb7329[_0x3bf4('0x1df')]){if(_0x272d22['dialMethod']==='booked'){_0x272d22[_0x3bf4('0x72')]=_['isUndefined'](_0x272d22[_0x3bf4('0x72')])?!![]:_0x272d22['queueStatusComplete'];var _0x25a984=uuid['v4']();_0x38f2db[_0x3bf4('0xed')][_0x25a984]=new Action(_0x272d22,_0xdb7329,_0x25a984);loggerBooked[_0x3bf4('0x4c')](_0x3bf4('0x1e0'),_0x25a984,_0x3bf4('0x1e1'),JSON['stringify'](_0x272d22[_0x3bf4('0x72')]),_0x3bf4('0x1e2'),_0x272d22[_0x3bf4('0x48')]);if(_0x272d22[_0x3bf4('0x72')]){_0x272d22[_0x3bf4('0x72')]=![];_0x38f2db['queueBooked'][_0x38f2db[_0x3bf4('0xed')][_0x25a984][_0x3bf4('0xbd')]]=[];ami['Action']({'actionid':_0x25a984,'action':_0x3bf4('0x1e3'),'queue':_0x272d22[_0x3bf4('0x48')]})[_0x3bf4('0x9c')](function(){_0x38f2db[_0x3bf4('0xc1')](_0x272d22);hopperUtils[_0x3bf4('0xeb')]({'active':![],'ContactId':_0x38f2db['actions'][_0x25a984][_0x3bf4('0xde')],'ListId':_0x38f2db[_0x3bf4('0xed')][_0x25a984][_0x3bf4('0xdf')],'VoiceQueueId':_0x38f2db['actions'][_0x25a984][_0x3bf4('0xe0')]||undefined,'CampaignId':_0x38f2db[_0x3bf4('0xed')][_0x25a984][_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x38f2db[_0x3bf4('0xed')][_0x25a984];});}else{loggerBooked[_0x3bf4('0x4c')](_0x3bf4('0x1e4'),JSON[_0x3bf4('0x74')](_0x272d22['queueStatusComplete']),_0x3bf4('0x1e2'),_0x272d22[_0x3bf4('0x48')]);_0x38f2db[_0x3bf4('0xc1')](_0x272d22);hopperUtils[_0x3bf4('0xeb')]({'active':![],'ContactId':_0x38f2db[_0x3bf4('0xed')][_0x25a984][_0x3bf4('0xde')],'ListId':_0x38f2db[_0x3bf4('0xed')][_0x25a984][_0x3bf4('0xdf')],'VoiceQueueId':_0x38f2db[_0x3bf4('0xed')][_0x25a984][_0x3bf4('0xe0')]||undefined,'CampaignId':_0x38f2db[_0x3bf4('0xed')][_0x25a984][_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x1e5')));delete _0x38f2db[_0x3bf4('0xed')][_0x25a984];}}else{return _0x38f2db[_0x3bf4('0x1e6')](_0x272d22,_0xdb7329);}}else{if(utils['getSeconds'](undefined,_0xdb7329[_0x3bf4('0x1e7')])<_0x272d22[_0x3bf4('0x1e8')]*0x3c){if(_0xdb7329[_0x3bf4('0x1e9')]&&!_0xdb7329[_0x3bf4('0x1e9')]['voicePause']){_0x38f2db[_0x3bf4('0x1e')][_0x3bf4('0xf8')](_0xdb7329['id'])[_0x3bf4('0x1c')](function(){_0x38f2db[_0x3bf4('0xc1')](_0x272d22);});}else{hopperUtils[_0x3bf4('0x1ea')]({'active':![]},_0xdb7329['id'],0x1)[_0x3bf4('0x1c')](function(){_0x38f2db[_0x3bf4('0xc1')](_0x272d22);});}}else{_0x272d22[_0x3bf4('0x1eb')]+=0x1;_0x38f2db['updateOriginated'](_0x272d22);if(_0x272d22[_0x3bf4('0x1ec')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0xdb7329[_0x3bf4('0xde')],'ListId':_0xdb7329[_0x3bf4('0xdf')],'VoiceQueueId':_0xdb7329[_0x3bf4('0xe0')]||undefined,'CampaignId':_0xdb7329[_0x3bf4('0xe1')]||undefined})[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x1ed')));hopperUtils[_0x3bf4('0xc9')](createObjHistory(_0x272d22,_0xdb7329,utils[_0x3bf4('0x6a')][_0x3bf4('0x1ee')],0x17,_0x3bf4('0x1ef')))['catch'](loggerCatch(_0x3bf4('0x1f0')));}else{_0x38f2db[_0x3bf4('0x118')](createObjHistory(_0x272d22,_0xdb7329,utils[_0x3bf4('0x6a')][_0x3bf4('0x1f1')],0x16,_0x3bf4('0x1f2')),_0x3bf4('0x1f3'),_0x3bf4('0x1f4'));}}}}else{_0x272d22['outboundBlacklistCallsDay']+=0x1;_0x38f2db[_0x3bf4('0x118')](createObjHistory(_0x272d22,_0xdb7329,utils['CAMPAIGN_STATUS'][_0x3bf4('0x1f5')],0xd,_0x3bf4('0x1f6')),_0x3bf4('0x1f7'),'[Originate][MoveBlacklist]');throw _0x3bf4('0x1f8');}};};Dialer['prototype'][_0x3bf4('0x152')]=function(_0xaae354){var _0x4f30fa=this;var _0x8dfa8=_0xaae354['limitCalls']-_0xaae354['originated'];emitCampaignSummary(_0xaae354);if(_0x8dfa8>0x0&&_0xaae354[_0x3bf4('0x1f9')]==0x0){if(_0x8dfa8>this[_0x3bf4('0x23')]){_0x8dfa8=this[_0x3bf4('0x23')];}_0xaae354[_0x3bf4('0x1f9')]=0x1;hopperUtils[_0x3bf4('0x1fa')](_0xaae354,_0x8dfa8)[_0x3bf4('0x3f')](function(_0x2c2d20){_0xaae354[_0x3bf4('0x1f9')]=0x0;if(_0x2c2d20){if(!utils[_0x3bf4('0x1fb')](_0x2c2d20)){_0xaae354[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')]['NO_AVAILABLE_CONTACTS'];logger['info'](_0x3bf4('0x1fc')+_0xaae354['name']);}else{_0xaae354['originated']+=_0x2c2d20[_0x3bf4('0xfc')];_0xaae354[_0x3bf4('0x69')]=utils[_0x3bf4('0x6a')][_0x3bf4('0x1fd')];for(var _0x10b88e=0x0;_0x10b88e<_0x2c2d20[_0x3bf4('0xfc')];_0x10b88e+=0x1){_0xaae354[_0x3bf4('0x1fe')]+=0x1;if(_[_0x3bf4('0xf2')](_0x2c2d20[_0x10b88e])||_[_0x3bf4('0xf2')](_0x2c2d20[_0x10b88e]['Contact'])||_[_0x3bf4('0xf2')](_0x2c2d20[_0x10b88e][_0x3bf4('0x156')])){_0x4f30fa[_0x3bf4('0x1ff')](_0x3bf4('0x200'),_0xaae354,_0x2c2d20[_0x10b88e]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x3bf4('0xf6')](_0x2c2d20[_0x10b88e],['CampaignId',_0x3bf4('0x156')]))[_0x3bf4('0x3f')](_0x4f30fa[_0x3bf4('0x1de')](_0xaae354,_0x2c2d20[_0x10b88e]))[_0x3bf4('0x9c')](_0x4f30fa[_0x3bf4('0x201')](_0x3bf4('0x202'),_0xaae354));}}}}})['catch'](loggerGetContactDialer(_0x3bf4('0x203'),_0xaae354,_0x8dfa8));}};Dialer[_0x3bf4('0x19')][_0x3bf4('0xaf')]=function(_0x5bb512,_0x1392fb){var _0x53db9d=this;var _0x37c1b4=[];if(_0x1392fb<0x1||_0x5bb512[_0x3bf4('0xad')]===_0x3bf4('0x9')){_0x1392fb=0x1;}var _0xc9e395=Math[_0x3bf4('0x1b7')](_0x5bb512['available']*_0x1392fb)-_0x5bb512[_0x3bf4('0x7d')];if(_0x5bb512['dialLimitQueue']>0x0){var _0x3431bf=_0x5bb512['dialLimitQueue']-_0x5bb512['originated']-_0x5bb512[_0x3bf4('0x137')]-_0x5bb512[_0x3bf4('0x138')];if(_0xc9e395>_0x3431bf){_0xc9e395=_0x3431bf;}}if(_0xc9e395>0x0&&_0x5bb512[_0x3bf4('0x1f9')]==0x0){if(_0x5bb512[_0x3bf4('0xad')]===_0x3bf4('0x9')){_0xc9e395=0x1;}if(_0xc9e395>this[_0x3bf4('0x23')]){_0xc9e395=this[_0x3bf4('0x23')];}for(var _0x476001 in this[_0x3bf4('0x21')]){if(typeof this['agents'][_0x476001]!==_0x3bf4('0xa7')){if(this['agents'][_0x476001]['state']==='not_inuse'&&this[_0x3bf4('0x21')][_0x476001]['status']==='reachable'){_0x37c1b4[_0x3bf4('0x9d')](this[_0x3bf4('0x21')][_0x476001]['id']);}}}_0x5bb512[_0x3bf4('0x1f9')]=0x1;hopperUtils[_0x3bf4('0x204')](_0x5bb512,_0x37c1b4,_0xc9e395)[_0x3bf4('0x3f')](function(_0x5a4d23){_0x5bb512['temp']=0x0;if(_0x5a4d23){if(!utils['checkContactEmpty'](_0x5a4d23)){hopperUtils[_0x3bf4('0x205')](_0x5bb512)[_0x3bf4('0x3f')](sendMessageReschedule(_0x5bb512))[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x206')));}else{_0x5bb512[_0x3bf4('0x7d')]+=_0x5a4d23[_0x3bf4('0xfc')];_0x5bb512[_0x3bf4('0x69')]=_0x5bb512[_0x3bf4('0xad')]===_0x3bf4('0x9')?utils[_0x3bf4('0x6a')][_0x3bf4('0x139')]:utils['CAMPAIGN_STATUS'][_0x3bf4('0x1fd')];for(var _0x3ae89a=0x0;_0x3ae89a<_0x5a4d23['length'];_0x3ae89a+=0x1){if(_['isNil'](_0x5a4d23[_0x3ae89a])||_['isNil'](_0x5a4d23[_0x3ae89a][_0x3bf4('0x16c')])||_[_0x3bf4('0xf2')](_0x5a4d23[_0x3ae89a][_0x3bf4('0x156')])){_0x53db9d[_0x3bf4('0x1ff')](_0x3bf4('0x200'),_0x5bb512,_0x5a4d23[_0x3ae89a]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x5a4d23[_0x3ae89a],[_0x3bf4('0xe0'),'phone']))[_0x3bf4('0x3f')](_0x53db9d[_0x3bf4('0x1de')](_0x5bb512,_0x5a4d23[_0x3ae89a]))[_0x3bf4('0x9c')](_0x53db9d[_0x3bf4('0x201')](_0x3bf4('0x200'),_0x5bb512));}}}}})[_0x3bf4('0x9c')](loggerGetContactDialer(_0x3bf4('0x207'),_0x5bb512,_0xc9e395));}};Dialer[_0x3bf4('0x19')]['handlePredictive']=function(_0x7f1ea7){if(_0x7f1ea7[_0x3bf4('0x208')]>0x0){var _0x4ee826=_0x7f1ea7[_0x3bf4('0x208')]-_0x7f1ea7[_0x3bf4('0x7d')]-_0x7f1ea7[_0x3bf4('0x137')];if(_0x4ee826>0x0&&_0x7f1ea7[_0x3bf4('0x1f9')]==0x0){this[_0x3bf4('0x209')](_0x7f1ea7);}else{loggerPredictiveCalls['info'](_0x3bf4('0x20a'));}}else{this['tryOriginatePredictive'](_0x7f1ea7);}};Dialer[_0x3bf4('0x19')][_0x3bf4('0x209')]=function(_0x526b09){var _0x3427c5=this;var _0x41ab1d=[];_0x526b09[_0x3bf4('0x7d')]+=0x1;for(var _0x39641e in this['agents']){if(typeof this[_0x3bf4('0x21')][_0x39641e]!==_0x3bf4('0xa7')){if(this[_0x3bf4('0x21')][_0x39641e][_0x3bf4('0x6f')]===_0x3bf4('0x20b')&&this[_0x3bf4('0x21')][_0x39641e]['status']===_0x3bf4('0x85')){_0x41ab1d[_0x3bf4('0x9d')](this[_0x3bf4('0x21')][_0x39641e]['id']);}}}_0x526b09['temp']=0x1;return this[_0x3bf4('0x204')](_0x526b09['id'],_0x41ab1d,0x1,_0x526b09['dialOrderByScheduledAt'],_0x526b09)['then'](function(_0x190c2d){_0x526b09[_0x3bf4('0x1f9')]=0x1;if(_0x190c2d){if(!utils['checkContactEmpty'](_0x190c2d)){utils[_0x3bf4('0x20c')](_0x526b09,0x1,0x0);return hopperUtils[_0x3bf4('0x205')](_0x526b09)[_0x3bf4('0x3f')](sendMessageReschedule(_0x526b09))[_0x3bf4('0x9c')](loggerCatch(_0x3bf4('0x206')));}else{_0x526b09[_0x3bf4('0x69')]=utils['CAMPAIGN_STATUS']['RUNNING'];if(_['isNil'](_0x190c2d[0x0])||_[_0x3bf4('0xf2')](_0x190c2d[0x0]['Contact'])||_['isNil'](_0x190c2d[0x0][_0x3bf4('0x156')])){_0x3427c5[_0x3bf4('0x1ff')](_0x3bf4('0x200'),_0x526b09,_0x190c2d[0x0]);}else{return hopperUtils[_0x3bf4('0x20d')](_[_0x3bf4('0xf6')](_0x190c2d[0x0],[_0x3bf4('0xe0'),_0x3bf4('0x156')]))[_0x3bf4('0x3f')](_0x3427c5[_0x3bf4('0x1de')](_0x526b09,_0x190c2d[0x0]))[_0x3bf4('0x9c')](_0x3427c5[_0x3bf4('0x201')](_0x3bf4('0x20e'),_0x526b09));}}}})[_0x3bf4('0x9c')](loggerGetContactDialer('[getContactDialerPredictive]',_0x526b09,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x16fb43,_0x316131,_0x20c985,_0x3d478c,_0x11fd48,_0x27b4d5){loggerPredictive['info'](_0x3bf4('0x20f'));loggerPredictive[_0x3bf4('0x4c')]('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',_0x16fb43);loggerPredictive['info'](_0x3bf4('0x210'),_0x316131);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x211'),_0x20c985);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x212'),_0x3d478c);loggerPredictive[_0x3bf4('0x4c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11fd48);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x61'));return new Promise(function(_0x18c068,_0x296c20){if(_0x16fb43<=0x0||isNaN(_0x16fb43)){return _0x296c20(msgResponse(_0x3bf4('0x213'),_0x3bf4('0x81'),'m\x20=\x20'+_0x16fb43));}if(_0x20c985<=0x0||isNaN(_0x20c985)){return _0x296c20(msgResponse(_0x3bf4('0x213'),_0x3bf4('0x81'),_0x3bf4('0x214')+_0x20c985));}if(_0x3d478c<=0x0||isNaN(_0x3d478c)){return _0x296c20(msgResponse(_0x3bf4('0x213'),_0x3bf4('0x81'),_0x3bf4('0x215')+_0x3d478c));}if(_0x316131<=0x0||isNaN(_0x316131)){return _0x296c20(msgResponse(_0x3bf4('0x213'),_0x3bf4('0x81'),_0x3bf4('0x216')+_0x316131));}if(_0x11fd48<=0x0||isNaN(_0x11fd48)){return _0x296c20(msgResponse(_0x3bf4('0x213'),_0x3bf4('0x81'),_0x3bf4('0x217')+_0x11fd48));}_0x27b4d5=_0x27b4d5||0x0;var _0x4f8645=0x1/_0x20c985;var _0x3d3121=0x0;var _0x213db5=0x0;var _0x1f2b33=0x0;var _0x272ca5=0x0;for(var _0x1335b8=0x0;_0x1f2b33<_0x11fd48;_0x1335b8+=0x1){_0x213db5=_0x1335b8/_0x316131;_0x3d3121=(_0x3d478c*_0x213db5+_0x27b4d5)/_0x4f8645;_0x1f2b33=utils[_0x3bf4('0x218')](_0x3d3121,_0x16fb43);_0x272ca5=_0x3d3121/_0x16fb43*(0x1-utils['erlangb'](_0x3d3121,_0x16fb43));}return _0x18c068({'erlangCalls':_0x1335b8,'erlangCallToSecond':_0x316131/_0x1335b8,'erlangAbandonmentRate':_0x1f2b33,'erlangBusyFactor':_0x272ca5});});};Dialer['prototype'][_0x3bf4('0x1d3')]=function(_0x1e9537,_0x2ecc03,_0x4f31fd,_0x564c9e,_0x3af999,_0x4101f4){loggerPredictive[_0x3bf4('0x4c')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x3bf4('0x4c')]('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',_0x1e9537);loggerPredictive[_0x3bf4('0x4c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2ecc03);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x211'),_0x4f31fd);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x212'),_0x564c9e);loggerPredictive[_0x3bf4('0x4c')](_0x3bf4('0x219'),_0x3af999);loggerPredictive['info']('---------------------------');return new Promise(function(_0x398bf9,_0x32b0c2){if(_0x1e9537<=0x0||isNaN(_0x1e9537)){return _0x32b0c2(msgResponse(_0x3bf4('0x21a'),'Error',_0x3bf4('0x21b')+_0x1e9537));}if(_0x4f31fd<=0x0||isNaN(_0x4f31fd)){return _0x32b0c2(msgResponse(_0x3bf4('0x21a'),_0x3bf4('0x81'),_0x3bf4('0x214')+_0x4f31fd));}if(_0x564c9e<=0x0||isNaN(_0x564c9e)){return _0x32b0c2(msgResponse(_0x3bf4('0x21a'),'Error',_0x3bf4('0x215')+_0x564c9e));}if(_0x2ecc03<=0x0||isNaN(_0x2ecc03)){return _0x32b0c2(msgResponse(_0x3bf4('0x21a'),_0x3bf4('0x81'),_0x3bf4('0x216')+_0x2ecc03));}if(_0x3af999<=0x0||isNaN(_0x3af999)){return _0x32b0c2(msgResponse(_0x3bf4('0x21a'),_0x3bf4('0x81'),_0x3bf4('0x21c')+_0x3af999));}_0x4101f4=_0x4101f4||0x0;var _0x33f22c=0x1/_0x4f31fd;var _0x20ab2b=0x0;var _0x174e0d=0x0;var _0x30e19e=0x0;var _0x443985=0x0;for(var _0x2a01d4=0x0;_0x443985<_0x3af999;_0x2a01d4+=0x1){_0x174e0d=_0x2a01d4/_0x2ecc03;_0x20ab2b=(_0x564c9e*_0x174e0d+_0x4101f4)/_0x33f22c;_0x30e19e=utils[_0x3bf4('0x218')](_0x20ab2b,_0x1e9537);_0x443985=_0x20ab2b/_0x1e9537*(0x1-utils[_0x3bf4('0x218')](_0x20ab2b,_0x1e9537));}return _0x398bf9({'erlangCalls':_0x2a01d4,'erlangCallToSecond':_0x2ecc03/_0x2a01d4,'erlangAbandonmentRate':_0x30e19e,'erlangBusyFactor':_0x443985});});};module[_0x3bf4('0x21d')]=Dialer; \ No newline at end of file +var _0xe174=['countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','createHistory','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedRetryFrequency','verifyAdditionalPhones','countabandonedretry','add','Abandoned','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','rrmemory','locked','paused','stateinterface','isNil','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','countglobal','dialMachineMaxRetry','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','sequence','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','UserId','[emptyContact][createHistory]','[emptyContact]','checkPreviewRecallReminder','handlePreviewRecallNotifications','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','isOutboundQueue','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','updatedAt','%s%s','XMD-','toUpper','getCallerId','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','dialPredictiveOptimization','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','startMethodPredictive','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','queueBooked','queueBookedRR','queuesSummary','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncQueueMember','then','previewRecallmeReminderInterval','type','outbound','debug','inspect','format','voice:queue:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','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','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','name','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','Failure','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','interval','content','indexOf','true','command','catch','all','some','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','undefined','resolve','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','booked','Queue','silly','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','isGlobal','queue','uniqueid','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2'];(function(_0x179b99,_0x3f150b){var _0x10977b=function(_0x4a1f8d){while(--_0x4a1f8d){_0x179b99['push'](_0x179b99['shift']());}};_0x10977b(++_0x3f150b);}(_0xe174,0x14a));var _0x4e17=function(_0x3d2f31,_0x475cff){_0x3d2f31=_0x3d2f31-0x0;var _0x105e92=_0xe174[_0x3d2f31];return _0x105e92;};'use strict';var util=require(_0x4e17('0x0'));var _=require(_0x4e17('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0x4e17('0x2'));var utils=require('./utils');var hopperUtils=require(_0x4e17('0x3'));var ut=require(_0x4e17('0x4'));var config=require(_0x4e17('0x5'));var logger=require(_0x4e17('0x6'))(_0x4e17('0x7'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0x4e17('0x6'))(_0x4e17('0x8'));var loggerPredictiveCalls=require(_0x4e17('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x4e17('0x6'))(_0x4e17('0x9'));var ami=require('../ami');config[_0x4e17('0xa')]=_[_0x4e17('0xb')](config[_0x4e17('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x4e17('0xc'))(new Redis(config[_0x4e17('0xa')]));var cmHopper=require(_0x4e17('0xd'));var voiceQueueRt=require(_0x4e17('0xe'));var RpcSetting=require(_0x4e17('0xf'));var Interval=require(_0x4e17('0x10'));var Action=require(_0x4e17('0x11'));var History=require(_0x4e17('0x12'));var Final=require(_0x4e17('0x13'));var AgentComplete=require(_0x4e17('0x14'));var QueueCallerAbandon=require(_0x4e17('0x15'));var Hangup=require(_0x4e17('0x16'));var ipAgi=process[_0x4e17('0x17')][_0x4e17('0x18')]||_0x4e17('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4e17('0x1a')]['enqueue']=function(_0x355b44){this[_0x4e17('0x1b')]=this['tail']?this[_0x4e17('0x1b')][_0x4e17('0x1c')](_0x355b44):_0x355b44();};function Dialer(_0x2b6fec,_0x34c7d4){this['sequence']=new Sequence();this[_0x4e17('0x1d')]=_0x34c7d4;this[_0x4e17('0x1e')]=_0x2b6fec[_0x4e17('0x1e')];this[_0x4e17('0x1f')]=_0x2b6fec[_0x4e17('0x1f')];this[_0x4e17('0x20')]=_0x2b6fec[_0x4e17('0x20')];this[_0x4e17('0x21')]=_0x2b6fec[_0x4e17('0x21')];this['maxNumberOriginate']=config[_0x4e17('0x22')]||0x2;this[_0x4e17('0x23')]={};this['actions']={};this[_0x4e17('0x24')]={};this[_0x4e17('0x25')]={};this[_0x4e17('0x26')]={};this['startPredictive']={};this[_0x4e17('0x27')]={};this['ivrOriginated']={};this[_0x4e17('0x28')]={};this[_0x4e17('0x29')]={};this[_0x4e17('0x2a')]={};ami['on']('agentconnect',this[_0x4e17('0x2b')][_0x4e17('0x2c')](this));ami['on']('queuecallerabandon',this[_0x4e17('0x2d')]['bind'](this));ami['on'](_0x4e17('0x2e'),this[_0x4e17('0x2f')][_0x4e17('0x2c')](this));ami['on'](_0x4e17('0x30'),this[_0x4e17('0x31')][_0x4e17('0x2c')](this));ami['on'](_0x4e17('0x32'),this[_0x4e17('0x9')][_0x4e17('0x2c')](this));ami['on'](_0x4e17('0x33'),this[_0x4e17('0x34')]['bind'](this));ami['on'](_0x4e17('0x35'),this[_0x4e17('0x36')][_0x4e17('0x2c')](this));ami['on'](_0x4e17('0x37'),this[_0x4e17('0x38')][_0x4e17('0x2c')](this));ami['on'](_0x4e17('0x39'),this['syncVarSet'][_0x4e17('0x2c')](this));ami['on']('queuemember',this[_0x4e17('0x3a')][_0x4e17('0x2c')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x4e17('0x2c')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0x4e17('0x3b')](function(_0x5a475f){previewRecallmeReminderInterval=_0x5a475f[_0x4e17('0x3c')];});}function isNotNull(_0x18359c){return _0x18359c!==null&&!_['isUndefined'](_0x18359c);}function msgResponse(_0x2b87b7,_0x3597f6,_0x3be34c){return{'action':_0x2b87b7,'response':_0x3597f6,'message':_0x3be34c,'stack':_0x3be34c};}function emit(_0x5cad9f,_0x53840d,_0x2d0db4){io['to'](_0x5cad9f)['emit'](_0x53840d,_0x2d0db4);}function emitOutboundVoiceQueueSummary(_0x548cdf){if(_0x548cdf[_0x4e17('0x3d')]===_0x4e17('0x3e')){logger[_0x4e17('0x3f')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x4e17('0x40')](_0x548cdf,{'showHidden':![],'depth':null}));emit(util[_0x4e17('0x41')](_0x4e17('0x42'),_0x548cdf['name']),'voice_queue:save',_0x548cdf);}}function checkGetDataPredictive(_0x167941){if(isNotNull(_0x167941)&&!_[_0x4e17('0x43')](_0x167941)){loggerPredictive[_0x4e17('0x44')](_0x4e17('0x45'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x167941[_0x4e17('0x46')]);loggerPredictive['info'](_0x4e17('0x47'),_0x167941[_0x4e17('0x48')]);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x49'),_0x167941[_0x4e17('0x4a')]);loggerPredictive['info'](_0x4e17('0x4b'),_0x167941[_0x4e17('0x4c')]);loggerPredictive['info'](_0x4e17('0x4d'),_0x167941[_0x4e17('0x4e')]);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x4f'),_0x167941[_0x4e17('0x50')]);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x51'));if(_0x167941['predictiveIntervalTotalCalls']>0x0){if(!_[_0x4e17('0x52')](_0x167941[_0x4e17('0x50')])&&_0x167941['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0x4e17('0x53'));if(!_['isUndefined'](_0x167941[_0x4e17('0x4e')])&&_0x167941[_0x4e17('0x4e')]>0x0){return!![];}loggerPredictive[_0x4e17('0x44')](_0x4e17('0x54'));}else{loggerPredictive[_0x4e17('0x44')](_0x4e17('0x55'));}}else{loggerPredictive[_0x4e17('0x44')](_0x4e17('0x56'));}return![];}function mergeDataErlangB(_0x1177cc){return function(_0x93a739){loggerPredictive[_0x4e17('0x44')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x4e17('0x57'),_0x93a739['erlangCalls']);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x58'),_0x93a739[_0x4e17('0x59')]);loggerPredictive[_0x4e17('0x44')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x93a739[_0x4e17('0x5a')]);loggerPredictive['info'](_0x4e17('0x5b'),_0x93a739[_0x4e17('0x5c')]);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x5d'),_0x93a739['erlangAbandonmentRate']);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x51'));_[_0x4e17('0x5e')](_0x1177cc,_0x93a739);};}function ifInterval(_0x4b548c,_0x4c656b){if(_[_0x4e17('0x52')](_0x4c656b)){return![];}return utils[_0x4e17('0x5f')](undefined,_0x4c656b)<_0x4b548c*0x3c;}function clearPredictiveAttributes(_0x1c0d56){if(_0x1c0d56[_0x4e17('0x27')]){_0x1c0d56['startProgressive']=undefined;loggerPredictive[_0x4e17('0x3f')](_0x1c0d56[_0x4e17('0x60')],_0x4e17('0x61'));}if(_0x1c0d56['startPredictive']){_0x1c0d56[_0x4e17('0x62')]=undefined;loggerPredictive[_0x4e17('0x3f')](_0x1c0d56[_0x4e17('0x60')],_0x4e17('0x63'));}if(_0x1c0d56[_0x4e17('0x64')]){clearInterval(_0x1c0d56['handlePredictive']);_0x1c0d56['handlePredictive']=undefined;loggerPredictive[_0x4e17('0x3f')](_0x1c0d56[_0x4e17('0x60')],_0x4e17('0x65'));}}function loggerCatchPredictive(_0x440f99,_0x5e1883){return function(_0x51ca1d){loggerPredictive[_0x4e17('0x66')](_0x5e1883[_0x4e17('0x60')],_0x440f99);loggerPredictive[_0x4e17('0x66')](_0x51ca1d[_0x4e17('0x67')]);clearPredictiveAttributes(_0x5e1883);};}function loggerCatch(_0x2a2081){return function(_0xd2608a){logger[_0x4e17('0x66')](_0x2a2081,util[_0x4e17('0x40')](_0xd2608a,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x37f67a,_0x2070e2,_0xe919c1){return function(_0x28b1a7){utils[_0x4e17('0x68')](_0x2070e2,_0xe919c1,0x0);logger['error'](_0x37f67a,util[_0x4e17('0x40')](_0x28b1a7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5e112f){return function(_0x49ca15){if(isNotNull(_0x49ca15)&&isNotNull(_0x49ca15[0x0])){if(_0x49ca15[0x0][_0x4e17('0x69')]>0x0){_0x5e112f[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x6c')];logger[_0x4e17('0x44')](_0x4e17('0x6d')+_0x5e112f[_0x4e17('0x60')],_0x49ca15[0x0][_0x4e17('0x69')],_0x4e17('0x6e'));}else{_0x5e112f[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x6f')];logger[_0x4e17('0x44')]('[getContactDialer2][Empty]'+_0x5e112f[_0x4e17('0x60')]);}}};}function createObjHistory(_0x354de4,_0x58d2ff,_0x2a6925,_0x1b6926,_0x3af14b){_0x354de4['message']=_0x2a6925;var _0x1e7b59=new Action(_0x354de4,_0x58d2ff);var _0xa165af=new History(_0x1e7b59);_0xa165af[_0x4e17('0x70')]=_0x1b6926;_0xa165af[_0x4e17('0x71')]=_0x3af14b;_0xa165af[_0x4e17('0x72')]=_0x1e7b59[_0x4e17('0x73')];return _0xa165af;}function unlockQueueStatus(_0x2ae3c7,_0x13c692){setTimeout(function(){if(_['isUndefined'](_0x2ae3c7[_0x4e17('0x74')])){loggerBooked[_0x4e17('0x66')]('[unlockQueueStatus][undefined]',_0x13c692);}_0x2ae3c7[_0x4e17('0x74')]=!![];loggerBooked[_0x4e17('0x44')](_0x4e17('0x75'),_0x13c692,JSON[_0x4e17('0x76')](_[_0x4e17('0x77')](_0x2ae3c7,[_0x4e17('0x60'),_0x4e17('0x74')])));},0x1f3);}function checkInterval(_0x3b3719){return function(){if(!isNotNull(_0x3b3719[_0x4e17('0x78')])){_0x3b3719[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x79')];throw _0x3b3719[_0x4e17('0x60')]+_0x4e17('0x7a');}if(!isNotNull(_0x3b3719['Interval'][_0x4e17('0x7b')])){_0x3b3719[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')]['NULL_INTERVAL'];throw _0x3b3719[_0x4e17('0x60')]+_0x4e17('0x7a');}if(!isNotNull(_[_0x4e17('0x43')](_0x3b3719[_0x4e17('0x78')][_0x4e17('0x7b')]))){_0x3b3719[_0x4e17('0x6a')]=utils['CAMPAIGN_STATUS'][_0x4e17('0x79')];throw _0x3b3719[_0x4e17('0x60')]+_0x4e17('0x7a');}};}function checkIsIVRCampaignActive(_0x167c52){return function(){if(!utils[_0x4e17('0x7c')](_0x167c52)){_0x167c52[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x7d')];throw _0x167c52[_0x4e17('0x60')]+_0x4e17('0x7e');}};}function emitCampaignSummary(_0x15ed19){if(utils[_0x4e17('0x7f')](_0x15ed19)){emit(util[_0x4e17('0x41')](_0x4e17('0x80'),_0x15ed19[_0x4e17('0x60')]),'campaign:save',_0x15ed19);}}function loggerCatchQueueSummary(_0x1c7a1f,_0x16740){return function(_0x18d0a2){clearPredictiveAttributes(_0x16740);emitCampaignSummary(_0x16740);loggerSyncQueueSummary[_0x4e17('0x3f')](_0x1c7a1f,util[_0x4e17('0x40')](_0x18d0a2,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x312a89){if(_0x312a89[_0x4e17('0x81')]){if(_0x312a89[_0x4e17('0x82')]===0x0){_0x312a89[_0x4e17('0x81')]=![];_0x312a89[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x7d')];loggerSyncQueueSummary[_0x4e17('0x3f')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x312a89[_0x4e17('0x60')],_0x4e17('0x83'));}else{_0x312a89[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x84')];loggerSyncQueueSummary[_0x4e17('0x3f')](_0x4e17('0x85'),_0x312a89[_0x4e17('0x60')],_0x4e17('0x86'));}emitCampaignSummary(_0x312a89);}}function myreject(_0x324de6){return function(_0xb07557){return _0x324de6(msgResponse(_0x4e17('0x87'),_0x4e17('0x88'),JSON[_0x4e17('0x76')](_0xb07557)));};}Dialer['prototype'][_0x4e17('0x89')]=function(_0x5cd567){return!_[_0x4e17('0x52')](_0x5cd567)&&_0x5cd567&&!_[_0x4e17('0x52')](_0x5cd567[_0x4e17('0x60')])&&!_[_0x4e17('0x52')](_0x5cd567[_0x4e17('0x8a')])&&_0x5cd567[_0x4e17('0x8a')]&&(this[_0x4e17('0x21')][util[_0x4e17('0x41')](_0x4e17('0x8b'),_0x5cd567[_0x4e17('0x60')])]['status']===_0x4e17('0x8c')||this[_0x4e17('0x21')][util[_0x4e17('0x41')](_0x4e17('0x8b'),_0x5cd567[_0x4e17('0x60')])][_0x4e17('0x8d')]===_0x4e17('0x8e'));};Dialer[_0x4e17('0x1a')][_0x4e17('0x8f')]=function(_0x1ad7f8){var _0x58122f=this;return function(){if(!_0x58122f['isTrunkReachable'](_0x1ad7f8['Trunk'])){if(!_0x58122f[_0x4e17('0x89')](_0x1ad7f8[_0x4e17('0x90')])){_0x1ad7f8['message']=utils[_0x4e17('0x6b')][_0x4e17('0x91')];throw _0x1ad7f8['name']+_0x4e17('0x92');}}};};Dialer[_0x4e17('0x1a')][_0x4e17('0x93')]=function(_0xb894b8,_0x46ad91,_0x1e06ab,_0x1407d7){var _0x13b7d1=this;return function(){var _0x2503fb=!![];return _0x13b7d1[_0x4e17('0x94')](_0xb894b8,_0x46ad91,_0x1e06ab,_0x1407d7,_0x2503fb);};};Dialer[_0x4e17('0x1a')]['checkIfTimeIntervals']=function(_0x4a4185,_0x2294ee,_0x1f2436,_0x24ccc7){var _0x27a07a=this;return function(){var _0x30345e=![];return _0x27a07a[_0x4e17('0x94')](_0x4a4185[_0x4e17('0x7b')],_0x2294ee,_0x1f2436,_0x24ccc7,_0x30345e);};};Dialer[_0x4e17('0x1a')][_0x4e17('0x94')]=function(_0x33a191,_0xd6cde5,_0x2012d8,_0x3a739c,_0x496b27){var _0x4e27cb=[];return new Promise(function(_0xb2a985,_0x179f61){if(!isNotNull(_0x33a191)){_0x3a739c[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x79')];return _0x179f61(msgResponse(_0x4e17('0x95'),'Failure',_0x2012d8+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x4e17('0x43')](_0x33a191)){_0x3a739c[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x96')];return _0x179f61(msgResponse(_0x4e17('0x95'),'Failure',_0x2012d8+'\x20Intervals\x20is\x20empty\x20'));}if(_0xd6cde5&&_[_0x4e17('0x52')](config[_0x4e17('0x97')][_0xd6cde5])){_0x3a739c[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x98')];return _0x179f61(msgResponse('ifTime',_0x4e17('0x99'),_0x2012d8+_0x4e17('0x9a')+_0xd6cde5));}if(_[_0x4e17('0x9b')](_0x33a191)){for(var _0x33369d=0x0;_0x33369d<_0x33a191[_0x4e17('0x9c')];_0x33369d+=0x1){_0x4e27cb[_0x4e17('0x9d')](ami[_0x4e17('0x9e')]({'action':'command','command':util['format'](_0x4e17('0x9f'),_0x33a191[_0x33369d][_0x4e17('0xa0')],!_[_0x4e17('0x52')](config[_0x4e17('0x97')][_0xd6cde5])?_0xd6cde5:'')})[_0x4e17('0x3b')](function(_0x3f4964){return _0x3f4964[_0x4e17('0xa1')][_0x4e17('0xa2')](_0x4e17('0xa3'))>=0x0;})['catch'](myreject(_0x179f61)));}}else{_0x4e27cb[_0x4e17('0x9d')](ami[_0x4e17('0x9e')]({'action':_0x4e17('0xa4'),'command':util[_0x4e17('0x41')]('iftime\x20%s,%s',_0x33a191,!_['isUndefined'](config[_0x4e17('0x97')][_0xd6cde5])?_0xd6cde5:'')})['then'](function(_0x9c55e){return _0x9c55e['content'][_0x4e17('0xa2')](_0x4e17('0xa3'))>=0x0;})[_0x4e17('0xa5')](myreject(_0x179f61)));}Promise[_0x4e17('0xa6')](_0x4e27cb)[_0x4e17('0x3b')](function(_0x2b781b){var _0x4448bf=_[_0x4e17('0xa7')](_0x2b781b);if(_0x4448bf){return _0xb2a985(_0x4448bf);}else{_0x3a739c[_0x4e17('0x6a')]=_0x496b27?utils[_0x4e17('0x6b')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x4e17('0x6b')][_0x4e17('0xa8')];return _0x179f61(msgResponse('[ifTime][promiseAll]',_0x4e17('0x99'),_0x4e17('0xa9')+_0x496b27+'\x20'+_0x2012d8+_0x4e17('0xaa')+util[_0x4e17('0x40')](_0x33a191,{'showHidden':![],'depth':null})+_0x4e17('0xab')+_0xd6cde5));}})[_0x4e17('0xa5')](function(_0x105c45){return _0x179f61(msgResponse(_0x4e17('0x95'),'Failure',JSON['stringify'](_0x105c45)));});});};Dialer[_0x4e17('0x1a')][_0x4e17('0xac')]=function(){var _0x49496c=this;return cmHopper[_0x4e17('0xad')]({'active':![]},{'where':{'active':!![]}})[_0x4e17('0x3b')](function(){setInterval(function(){_0x49496c['syncCampaigns']();},0x3e8);});};Dialer[_0x4e17('0x1a')]['syncCampaigns']=function(){var _0x33de51=this;var _0x162066;for(var _0x4c42b6 in this[_0x4e17('0x1f')]){if(typeof this[_0x4e17('0x1f')][_0x4c42b6]!==_0x4e17('0xae')){_0x162066=this[_0x4e17('0x1f')][_0x4c42b6];if(utils[_0x4e17('0x7f')](_0x162066)&&utils[_0x4e17('0x7c')](_0x162066)){_0x162066[_0x4e17('0x81')]=!![];Promise[_0x4e17('0xaf')]()[_0x4e17('0x3b')](checkIsIVRCampaignActive(_0x162066))[_0x4e17('0x3b')](checkInterval(_0x162066))['then'](_0x33de51[_0x4e17('0x8f')](_0x162066))[_0x4e17('0x3b')](_0x33de51[_0x4e17('0x93')](_0x162066[_0x4e17('0xb0')],_0x162066[_0x4e17('0xb1')],_0x162066[_0x4e17('0x60')],_0x162066))['then'](_0x33de51[_0x4e17('0xb2')](_0x162066[_0x4e17('0x78')],_0x162066[_0x4e17('0xb1')],_0x162066[_0x4e17('0x60')],_0x162066))[_0x4e17('0x3b')](_0x33de51[_0x4e17('0xb3')](_0x162066))['catch'](loggerCatchQueueSummary(_0x4e17('0xb4'),_0x162066));}else{notSendMessagesCampaign(_0x162066);}}}};Dialer['prototype'][_0x4e17('0xb5')]=function(_0x234401){if(_0x234401[_0x4e17('0xb6')]!==_0x4e17('0x8')){clearPredictiveAttributes(_0x234401);}switch(_0x234401['dialMethod']){case _0x4e17('0xb7'):this[_0x4e17('0xb8')](_0x234401,0x1);break;case _0x4e17('0xb9'):this[_0x4e17('0xb8')](_0x234401,_0x234401['dialPowerLevel']);break;case _0x4e17('0x8'):this[_0x4e17('0x8')](_0x234401);break;case _0x4e17('0xba'):this[_0x4e17('0xb8')](_0x234401,0x1);break;default:logger['error'](_0x4e17('0xbb'),_0x234401['name'],'method\x20not\x20recognized');}};Dialer[_0x4e17('0x1a')][_0x4e17('0x95')]=function(_0x254f66,_0x7a960e){var _0xeb3594=_0x254f66[_0x4e17('0xb1')];var _0x1adc94=_0x7a960e?_0x254f66['dialGlobalInterval']:_0x254f66[_0x4e17('0x78')]['Intervals'];logger[_0x4e17('0xbc')]('Dialer::ifTime()',_0x1adc94,_0xeb3594,_0x254f66[_0x4e17('0x60')],util['format']('Voice\x20Queue\x20%s\x20$s',_0x254f66[_0x4e17('0x60')],_0x254f66['id']));var _0x345c7c=null;return Interval['intervalIftime'](_0x1adc94,_0xeb3594)[_0x4e17('0x3b')](function(_0x7fe530){if(_0x7fe530===!![]){return _0x7fe530;}else{_0x254f66[_0x4e17('0x6a')]=_0x7a960e?utils[_0x4e17('0x6b')][_0x4e17('0xbd')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];_0x345c7c=msgResponse(_0x4e17('0xbe'),'Failure','Global:\x20'+_0x7a960e+'\x20'+_0x254f66[_0x4e17('0x60')]+_0x4e17('0xaa')+util[_0x4e17('0x40')](_0x1adc94,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xeb3594);}if(_0x345c7c!==null){logger[_0x4e17('0xbc')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x345c7c);_0x345c7c[_0x4e17('0xbf')]=_0x7a960e;throw _0x345c7c;}})[_0x4e17('0xa5')](function(_0x45c310){logger['error']('AMI\x20IfTime',_0x45c310);throw msgResponse(_0x4e17('0x87'),_0x4e17('0x88'),util[_0x4e17('0x40')](_0x45c310,{'showHidden':![],'depth':null}));});};Dialer[_0x4e17('0x1a')]['syncAgentConnect']=function(_0x44f5cd){if(this['voiceQueues'][_0x44f5cd[_0x4e17('0xc0')]]){if(this[_0x4e17('0x25')][_0x44f5cd[_0x4e17('0xc1')]]&&this[_0x4e17('0x25')][_0x44f5cd['uniqueid']][_0x4e17('0x3d')]!==_0x4e17('0xc2')){this['updateOriginated'](this['voiceQueues'][_0x44f5cd[_0x4e17('0xc0')]]);this['uniqueId'][_0x44f5cd[_0x4e17('0xc1')]][_0x4e17('0xc3')]=moment()['format'](_0x4e17('0xc4'));}}};Dialer[_0x4e17('0x1a')][_0x4e17('0x31')]=function(_0x770f88){var _0x5adf75=this[_0x4e17('0x25')][_0x770f88[_0x4e17('0xc1')]];if(this[_0x4e17('0x1e')][_0x770f88[_0x4e17('0xc0')]]){if(_0x5adf75&&_0x5adf75['type']!==_0x4e17('0xc2')){delete this['uniqueId'][_0x770f88[_0x4e17('0xc1')]];this[_0x4e17('0x1e')][_0x770f88[_0x4e17('0xc0')]][_0x4e17('0xc5')]+=0x1;var _0x4223a2=new AgentComplete(_0x5adf75,_0x770f88);if(_0x770f88[_0x4e17('0xc6')]===_0x4e17('0xc7')){_0x4223a2[_0x4e17('0xc8')]=this[_0x4e17('0x1e')][_0x770f88['queue']]['dialQueueProject2']&&this[_0x4e17('0x1e')][_0x770f88[_0x4e17('0xc0')]]['dialAgiAfterHangupAgent']?moment()[_0x4e17('0x41')](_0x4e17('0xc4')):undefined;}hopperUtils['createHistory'](_0x4223a2)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0xc9')));hopperUtils[_0x4e17('0xca')](_0x4223a2)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x4e17('0x1a')][_0x4e17('0x2d')]=function(_0x31c8d1){var _0xaf325a=this['uniqueId'][_0x31c8d1[_0x4e17('0xc1')]];var _0x419eeb=this;var _0x1a0ef7=![];var _0x44cdd9;var _0x4e4818;if(this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]]){if(_0xaf325a&&_0xaf325a[_0x4e17('0x3d')]!==_0x4e17('0xc2')){delete this[_0x4e17('0x25')][_0x31c8d1[_0x4e17('0xc1')]];this['updateOriginated'](this[_0x4e17('0x1e')][_0x31c8d1['queue']]);_0xaf325a[_0x4e17('0xcb')]=moment()[_0x4e17('0x41')](_0x4e17('0xc4'));var _0x4a510d=new QueueCallerAbandon(_0xaf325a,_0x31c8d1);if(utils[_0x4e17('0x5f')](_0xaf325a[_0x4e17('0xcb')],_0xaf325a['responsetime'])>=_0xaf325a[_0x4e17('0xcc')]){this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0x4a')]+=0x1;this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xcd')]+=0x1;this[_0x4e17('0x1e')][_0x31c8d1['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4a510d[_0x4e17('0x70')]=0xa;_0x4a510d[_0x4e17('0x71')]=_0x4e17('0xce');_0x4a510d[_0x4e17('0xcf')]=_0x4e17('0xd0');_0x4a510d['agiafterat']=this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xd1')]?moment()[_0x4e17('0x41')](_0x4e17('0xc4')):undefined;_0x4a510d[_0x4e17('0xd2')]+=0x1;_0x4a510d['countglobal']+=0x1;_0x44cdd9=this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xd3')];_0x4e4818=this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xd4')];hopperUtils['verifyAdditionalPhones'](_0x4a510d,_0x4a510d[_0x4e17('0x70')],_0xaf325a[_0x4e17('0xd5')])['then'](function(_0x17e53c){_0x1a0ef7=_0x17e53c[_0x4e17('0xd6')]==0x1;if(_0x4a510d[_0x4e17('0xd2')]>=_0x419eeb[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xd7')]){_0x419eeb[_0x4e17('0xd8')](_0x4a510d,_0x17e53c[_0x4e17('0xd6')]);}else{hopperUtils[_0x4e17('0xd9')]({'active':![],'countdropretry':_0x4a510d[_0x4e17('0xd2')],'scheduledat':moment()['add'](_0x419eeb['voiceQueues'][_0x31c8d1[_0x4e17('0xc0')]]['dialDropRetryFrequency'],_0x4e17('0xda'))[_0x4e17('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xaf325a[_0x4e17('0xdb')],'ListId':_0xaf325a[_0x4e17('0xdc')],'VoiceQueueId':_0xaf325a[_0x4e17('0xdd')]||undefined,'CampaignId':_0xaf325a[_0x4e17('0xde')]||undefined})[_0x4e17('0xa5')](loggerCatch(_0x4e17('0xdf')));var _0x1be76b=new History(_0x4a510d);_0x1be76b[_0x4e17('0x70')]=0xa;_0x1be76b['statedesc']=_0x4e17('0xce');_0x1be76b['starttime']=moment()[_0x4e17('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x1be76b['endtime']=_0x1be76b['starttime'];_0x1be76b[_0x4e17('0xe0')]=_0x4a510d[_0x4e17('0xe0')];_0x1be76b[_0x4e17('0xe1')]=_0x4a510d[_0x4e17('0xe1')];hopperUtils[_0x4e17('0xe2')](_0x1be76b)[_0x4e17('0xa5')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x4e17('0x3b')](function(){if(_0x1a0ef7)hopperUtils[_0x4e17('0xe3')](_0x4a510d,_0x44cdd9,_0x4e4818)[_0x4e17('0x3b')](function(){return 0x1;});});}else{this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0x4c')]+=0x1;this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xe4')]+=0x1;_0x4a510d['state']=0xb;_0x4a510d[_0x4e17('0x71')]='Abandoned';_0x4a510d[_0x4e17('0xcf')]=_0x4e17('0xe5');_0x4a510d['countabandonedretry']+=0x1;_0x4a510d['countglobal']+=0x1;_0x44cdd9=this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xe6')];_0x4e4818=this[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xd4')];hopperUtils[_0x4e17('0xe7')](_0x4a510d,_0x4a510d[_0x4e17('0x70')],_0xaf325a['voiceQueue'])[_0x4e17('0x3b')](function(_0x12fe9b){if(_0x4a510d['countabandonedretry']>=_0x419eeb[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]]['dialAbandonedMaxRetry']){_0x419eeb[_0x4e17('0xd8')](_0x4a510d,_0x12fe9b[_0x4e17('0xd6')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4a510d[_0x4e17('0xe8')],'scheduledat':moment()[_0x4e17('0xe9')](_0x419eeb[_0x4e17('0x1e')][_0x31c8d1[_0x4e17('0xc0')]][_0x4e17('0xe6')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xaf325a[_0x4e17('0xdb')],'ListId':_0xaf325a[_0x4e17('0xdc')],'VoiceQueueId':_0xaf325a[_0x4e17('0xdd')]||undefined,'CampaignId':_0xaf325a[_0x4e17('0xde')]||undefined})[_0x4e17('0xa5')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x7b8033=new History(_0x4a510d);_0x7b8033['state']=0xb;_0x7b8033[_0x4e17('0x71')]=_0x4e17('0xea');_0x7b8033[_0x4e17('0x73')]=moment()['format'](_0x4e17('0xc4'));_0x7b8033[_0x4e17('0x72')]=_0x7b8033[_0x4e17('0x73')];_0x7b8033['calleridname']=_0x4a510d[_0x4e17('0xe0')];_0x7b8033[_0x4e17('0xe1')]=_0x4a510d[_0x4e17('0xe1')];hopperUtils[_0x4e17('0xe2')](_0x7b8033)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0xeb')));}})[_0x4e17('0x3b')](function(){if(_0x1a0ef7)hopperUtils['swapAdditionalPhones'](_0x4a510d,_0x44cdd9,_0x4e4818)['then'](function(){return 0x1;});});}}}};Dialer[_0x4e17('0x1a')]['syncNewExten']=function(_0x323834){if(this[_0x4e17('0xec')][_0x323834['uniqueid']]){this['actions'][_0x323834[_0x4e17('0xc1')]][_0x4e17('0xed')]=_0x323834[_0x4e17('0xed')];}if(this['uniqueId'][_0x323834['uniqueid']]){this[_0x4e17('0x25')][_0x323834[_0x4e17('0xc1')]][_0x4e17('0xed')]=_0x323834['channel'];}};Dialer['prototype']['syncQueueMember']=function(_0x9c1a4c){if(!this[_0x4e17('0xec')][_0x9c1a4c[_0x4e17('0xee')]]){return;}var _0x5c3bc8=this[_0x4e17('0x1e')][this['actions'][_0x9c1a4c[_0x4e17('0xee')]][_0x4e17('0xc0')]][_0x4e17('0xef')]||_0x4e17('0xf0');if(_0x5c3bc8==='roundrobin'){if(this[_0x4e17('0xec')][_0x9c1a4c[_0x4e17('0xee')]]&&_['isNil'](this[_0x4e17('0xec')][_0x9c1a4c['actionid']][_0x4e17('0xf1')])&&_0x9c1a4c[_0x4e17('0x8d')]==='1'&&_0x9c1a4c[_0x4e17('0xf2')]==='0'){if(this[_0x4e17('0x20')][_0x9c1a4c['stateinterface']]){if(!this[_0x4e17('0x20')][_0x9c1a4c[_0x4e17('0xf3')]][_0x4e17('0xf1')]){this['agents'][_0x9c1a4c[_0x4e17('0xf3')]]['locked']=!![];this[_0x4e17('0xec')][_0x9c1a4c[_0x4e17('0xee')]]['locked']=!![];this['actions'][_0x9c1a4c['actionid']][_0x4e17('0xf3')]=_0x9c1a4c[_0x4e17('0xf3')];}}}}else if(_0x5c3bc8===_0x4e17('0xf0')){if(this[_0x4e17('0xec')][_0x9c1a4c[_0x4e17('0xee')]]){if(this[_0x4e17('0x20')][_0x9c1a4c[_0x4e17('0xf3')]]){this[_0x4e17('0xec')][_0x9c1a4c[_0x4e17('0xee')]][_0x4e17('0xf3')]=_0x9c1a4c['stateinterface'];if(_[_0x4e17('0xf4')](this[_0x4e17('0x28')][this[_0x4e17('0xec')][_0x9c1a4c['actionid']][_0x4e17('0xc0')]])){this[_0x4e17('0x28')][this[_0x4e17('0xec')][_0x9c1a4c['actionid']][_0x4e17('0xc0')]]=[];}this[_0x4e17('0x28')][this[_0x4e17('0xec')][_0x9c1a4c[_0x4e17('0xee')]][_0x4e17('0xc0')]]['push'](_['merge'](_[_0x4e17('0x77')](this[_0x4e17('0xec')][_0x9c1a4c[_0x4e17('0xee')]],[_0x4e17('0xf5'),'stateinterface']),{'status':_0x9c1a4c[_0x4e17('0x8d')],'paused':_0x9c1a4c[_0x4e17('0xf2')]}));}}}};Dialer[_0x4e17('0x1a')]['syncQueueStatusComplete']=function(_0x44cdba){if(!this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]]){return;}var _0x57aaba=this;var _0x32a737=this[_0x4e17('0x1e')][this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xc0')]];var _0x1a57cb=_0x32a737['strategy']||_0x4e17('0xf0');if(_0x1a57cb==='roundrobin'){if(this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]]&&this['actions'][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xf3')]){this[_0x4e17('0x1d')][_0x4e17('0xf6')](this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xf5')],this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xf3')])[_0x4e17('0xa5')](function(_0x2bf623){logger[_0x4e17('0x66')](_0x4e17('0xf7'),util[_0x4e17('0x40')](_0x2bf623,{'showHidden':![],'depth':null}));})[_0x4e17('0x1c')](function(){_0x57aaba[_0x4e17('0xf8')](_0x57aaba[_0x4e17('0x1e')][_0x57aaba['actions'][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xc0')]]);_0x57aaba[_0x4e17('0x20')][_0x57aaba[_0x4e17('0xec')][_0x44cdba['actionid']][_0x4e17('0xf3')]][_0x4e17('0xf1')]=![];delete _0x57aaba[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]];unlockQueueStatus(_0x32a737);});}else{this['updateOriginated'](this[_0x4e17('0x1e')][this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xc0')]]);hopperUtils[_0x4e17('0xd9')]({'active':![],'ContactId':this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]]['ContactId'],'ListId':this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]]['ListId'],'VoiceQueueId':this['actions'][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xdd')]||undefined,'CampaignId':this['actions'][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xde')]||undefined})['catch'](loggerCatch(_0x4e17('0xf9')));delete this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]];unlockQueueStatus(_0x32a737);}}else if(_0x1a57cb===_0x4e17('0xf0')){var _0x2b4bb8;if(this['actions'][_0x44cdba[_0x4e17('0xee')]]&&!_[_0x4e17('0x43')](this['queueBooked'][this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xc0')]])){if(this[_0x4e17('0x29')][_0x57aaba['actions'][_0x44cdba[_0x4e17('0xee')]]['queue']]){this[_0x4e17('0x29')][_0x57aaba['actions'][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xc0')]]=this['queueBookedRR'][this[_0x4e17('0xec')][_0x44cdba['actionid']][_0x4e17('0xc0')]]?this[_0x4e17('0x29')][this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]]['queue']]:this[_0x4e17('0x28')][this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]]['queue']]?this[_0x4e17('0x28')][this[_0x4e17('0xec')][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xc0')]][_0x4e17('0xfa')]||0x0:0x0;}this[_0x4e17('0x28')][this['actions'][_0x44cdba['actionid']][_0x4e17('0xc0')]][_0x4e17('0xfa')]=this[_0x4e17('0x29')][this['actions'][_0x44cdba[_0x4e17('0xee')]][_0x4e17('0xc0')]];for(var _0x18691b=0x0;_0x18691b=_0xdc0b06[_0x4e17('0x11f')]){_0x3e67fc[_0x4e17('0x120')](_0x3afead,_0x275a4b,_0x21c204,_0x4e17('0x121'));}else{if(_0x3afead['countmachineretry']>=_0xdc0b06['dialMachineMaxRetry']){_0x3e67fc[_0x4e17('0x122')](_0x3afead,_0x275a4b,_0x21c204,'reason\x2019\x20machine....');}else{hopperUtils[_0x4e17('0xd9')]({'active':![],'countmachineretry':_0x3afead[_0x4e17('0x118')],'scheduledat':moment()[_0x4e17('0xe9')](_0xdc0b06[_0x4e17('0x123')],_0x4e17('0xda'))[_0x4e17('0x41')](_0x4e17('0xc4')),'ContactId':_0x3afead[_0x4e17('0xdb')],'ListId':_0x3afead[_0x4e17('0xdc')],'VoiceQueueId':_0x3afead[_0x4e17('0xdd')]||undefined,'CampaignId':_0x3afead['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x275a4b({'reschedule':0x1});}}});}if(_0x4cd5e9[_0x4e17('0x3d')]===_0x4e17('0xc2')&&this[_0x4e17('0x1f')][_0x4cd5e9[_0x4e17('0xc0')]][_0x4e17('0x109')]&&_0x50633b[_0x4e17('0x10a')]===_0x4e17('0x10b')){delete this[_0x4e17('0x25')][_0x50633b[_0x4e17('0xc1')]];this[_0x4e17('0xf8')](this[_0x4e17('0x1f')][_0x4cd5e9['queue']]);_0x41e09d=new Hangup(_0x4cd5e9,_0x50633b);_0x41e09d[_0x4e17('0x70')]=0x12;_0x41e09d[_0x4e17('0x71')]='HangupInAMD';_0x41e09d[_0x4e17('0x10e')]=_0x4e17('0x10f');ami[_0x4e17('0x110')](_0x4e17('0x111'),ut['buildObj'](_0x41e09d,_0x4e17('0x113')));this['saveInDb'](_0x41e09d,_0x4e17('0x124'),'[syncHangupInAMDIvr]');}if(_0x4cd5e9[_0x4e17('0x3d')]===_0x4e17('0xc2')&&this[_0x4e17('0x1f')][_0x4cd5e9[_0x4e17('0xc0')]]['dialAMDActive']&&_0x50633b['value']===_0x4e17('0x116')){return new Promise(function(_0x1ad78d,_0x5ecd3a){delete _0x3e67fc[_0x4e17('0x25')][_0x50633b[_0x4e17('0xc1')]];_0x3e67fc['updateOriginated'](_0x3e67fc[_0x4e17('0x1f')][_0x4cd5e9[_0x4e17('0xc0')]]);_0x3e67fc['campaigns'][_0x4cd5e9[_0x4e17('0xc0')]]['outboundAnswerCallsDay']+=0x1;_0x3e67fc[_0x4e17('0x1f')][_0x4cd5e9['queue']][_0x4e17('0x10c')]+=0x1;var _0x65fe79=_0x3e67fc['campaigns'][_0x4cd5e9[_0x4e17('0xc0')]];var _0x34a56e=new Hangup(_0x4cd5e9,_0x50633b);_0x34a56e[_0x4e17('0x70')]=0x13;_0x34a56e[_0x4e17('0x71')]=_0x4e17('0x117');_0x34a56e['membername']=_0x4e17('0x10f');_0x34a56e[_0x4e17('0x118')]+=0x1;_0x34a56e[_0x4e17('0x125')]+=0x1;_0x34a56e[_0x4e17('0x113')]=!![];ami['emit'](_0x4e17('0x111'),ut[_0x4e17('0x112')](_0x34a56e,_0x4e17('0x113')));hopperUtils[_0x4e17('0xe2')](_0x34a56e)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x119')));if(_0x34a56e[_0x4e17('0x11a')]+_0x34a56e[_0x4e17('0x11b')]+_0x34a56e['countnoanswerretry']+_0x34a56e['countnosuchnumberretry']+_0x34a56e[_0x4e17('0xd2')]+_0x34a56e[_0x4e17('0xe8')]+_0x34a56e['countmachineretry']+_0x34a56e[_0x4e17('0x11e')]>=_0x65fe79[_0x4e17('0x11f')]){_0x3e67fc[_0x4e17('0x120')](_0x34a56e,_0x1ad78d,_0x5ecd3a,_0x4e17('0x121'));}else{if(_0x34a56e[_0x4e17('0x118')]>=_0x65fe79[_0x4e17('0x126')]){_0x3e67fc[_0x4e17('0x122')](_0x34a56e,_0x1ad78d,_0x5ecd3a,'reason\x2019\x20machine....');}else{hopperUtils[_0x4e17('0xd9')]({'active':![],'countmachineretry':_0x34a56e[_0x4e17('0x118')],'scheduledat':moment()['add'](_0x65fe79[_0x4e17('0x123')],_0x4e17('0xda'))[_0x4e17('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x34a56e[_0x4e17('0xdb')],'ListId':_0x34a56e[_0x4e17('0xdc')],'VoiceQueueId':_0x34a56e[_0x4e17('0xdd')]||undefined,'CampaignId':_0x34a56e['CampaignId']||undefined})[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x127')));_0x1ad78d({'reschedule':0x1});}}});}}};Dialer[_0x4e17('0x1a')][_0x4e17('0x36')]=function(_0x63dc5e){var _0x6f49a6=this[_0x4e17('0x25')][_0x63dc5e['uniqueid']];var _0x534774;if(_0x6f49a6&&_0x6f49a6[_0x4e17('0x3d')]===_0x4e17('0xc2')){delete this[_0x4e17('0x25')][_0x63dc5e[_0x4e17('0xc1')]];this['updateOriginated'](this[_0x4e17('0x1f')][_0x6f49a6['queue']]);this[_0x4e17('0x1f')][_0x6f49a6['queue']]['ivrAnswerCallsDay']+=0x1;_0x534774=new Hangup(_0x6f49a6,_0x63dc5e);hopperUtils[_0x4e17('0xe2')](_0x534774)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x128')));hopperUtils[_0x4e17('0xca')](_0x534774)[_0x4e17('0xa5')](loggerCatch('[syncHangupIvr]'));}if(_0x6f49a6&&_0x6f49a6[_0x4e17('0x3d')]!=='ivr'&&isNotNull(this[_0x4e17('0x1e')][_0x6f49a6[_0x4e17('0xc0')]][_0x4e17('0x129')])){delete this['uniqueId'][_0x63dc5e['uniqueid']];this[_0x4e17('0xf8')](this[_0x4e17('0x1e')][_0x6f49a6['queue']]);this['voiceQueues'][_0x6f49a6[_0x4e17('0xc0')]][_0x4e17('0xc5')]+=0x1;this[_0x4e17('0x1e')][_0x6f49a6['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x534774=new Hangup(_0x6f49a6,_0x63dc5e);_0x534774['state']=0x10;_0x534774[_0x4e17('0x71')]=_0x4e17('0x12a');_0x534774[_0x4e17('0x10e')]=_0x4e17('0x12b');hopperUtils[_0x4e17('0xe2')](_0x534774)[_0x4e17('0xa5')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x534774)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x12c')));}if(_0x6f49a6&&_0x6f49a6[_0x4e17('0x3d')]!==_0x4e17('0xc2')&&!isNotNull(this[_0x4e17('0x1e')][_0x6f49a6[_0x4e17('0xc0')]][_0x4e17('0x129')])){delete this[_0x4e17('0x25')][_0x63dc5e[_0x4e17('0xc1')]];this[_0x4e17('0xf8')](this[_0x4e17('0x1e')][_0x6f49a6[_0x4e17('0xc0')]]);this[_0x4e17('0x1e')][_0x6f49a6[_0x4e17('0xc0')]]['outboundUnknownCallsDay']+=0x1;_0x534774=new Hangup(_0x6f49a6,_0x63dc5e);_0x534774[_0x4e17('0x70')]=0xc;_0x534774[_0x4e17('0x71')]=_0x63dc5e[_0x4e17('0x12d')];_0x534774[_0x4e17('0x10e')]='Unknow';hopperUtils[_0x4e17('0xe2')](_0x534774)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x128')));hopperUtils[_0x4e17('0xca')](_0x534774)['catch'](loggerCatch(_0x4e17('0x12c')));}};Dialer[_0x4e17('0x1a')]['syncQueueSummary']=function(_0x2d941b){var _0x205e42=this;if(!_0x205e42[_0x4e17('0x2a')][_0x2d941b['name']]){_0x205e42[_0x4e17('0x2a')][_0x2d941b[_0x4e17('0x60')]]={'running':![]};}else if(_0x205e42[_0x4e17('0x2a')][_0x2d941b[_0x4e17('0x60')]][_0x4e17('0x12e')]===!![]){return;}else if(_0x205e42['queuesSummary'][_0x2d941b[_0x4e17('0x60')]][_0x4e17('0x12e')]===![]){_0x205e42['queuesSummary'][_0x2d941b[_0x4e17('0x60')]][_0x4e17('0x12e')]=!![];}var _0x3546dc=_0x205e42['voiceQueues'][_0x2d941b[_0x4e17('0x60')]];var _0x4e7655=_0x3546dc[_0x4e17('0x6a')]!==utils[_0x4e17('0x6b')][_0x4e17('0x7d')];var _0xe6e15e=utils['isPreviewCampaign'](_0x3546dc);_0x3546dc[_0x4e17('0x12f')]=utils[_0x4e17('0x130')](_0x3546dc,_0x205e42[_0x4e17('0x21')]);Promise[_0x4e17('0xaf')]()['then'](function(){if(_0x3546dc[_0x4e17('0x12f')]===utils[_0x4e17('0x6b')][_0x4e17('0x7d')]){if(_0x4e7655){clearPredictiveAttributes(_0x3546dc);_0x2d941b[_0x4e17('0x62')]=undefined;_0x2d941b[_0x4e17('0x27')]=undefined;}if(_0x3546dc['statusMessage']===utils[_0x4e17('0x6b')][_0x4e17('0x7d')]){_0x2d941b[_0x4e17('0x131')]=0x0;_0x2d941b['paused']=0x0;_0x2d941b[_0x4e17('0x132')]=0x0;_0x2d941b[_0x4e17('0x133')]=0x0;_0x2d941b[_0x4e17('0x134')]=0x0;}}else if(_0x3546dc[_0x4e17('0x12f')]===utils[_0x4e17('0x6b')][_0x4e17('0x135')]&&!_0xe6e15e){return _0x205e42[_0x4e17('0x95')](_0x3546dc,!![])['then'](function(){return _0x205e42['ifTime'](_0x3546dc,![]);})[_0x4e17('0x3b')](function(){return _0x205e42[_0x4e17('0xb5')](_0x3546dc);})[_0x4e17('0xa5')](function(_0xa3a2f1){loggerSyncQueueSummary[_0x4e17('0x3f')](_0x4e17('0x136'),util[_0x4e17('0x40')](_0xa3a2f1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3546dc);});}else{clearPredictiveAttributes(_0x3546dc);}})['then'](function(){var _0x5c5689=_0x2d941b[_0x4e17('0x137')](_0x3546dc);if(_0x5c5689||_0x3546dc['queueSummaryCountersUpdated']){_0x3546dc[_0x4e17('0x138')]=![];_0x2d941b[_0x4e17('0x139')](_0x3546dc);Object[_0x4e17('0x13a')](_0x3546dc,_0x2d941b);emitOutboundVoiceQueueSummary(_0x2d941b);}_0x205e42[_0x4e17('0x2a')][_0x3546dc[_0x4e17('0x60')]][_0x4e17('0x12e')]=![];})[_0x4e17('0xa5')](function(_0x4abace){logger[_0x4e17('0x66')](_0x4e17('0x136'),util[_0x4e17('0x40')](_0x4abace,{'showHidden':![],'depth':null}));_0x205e42[_0x4e17('0x2a')][_0x3546dc['name']][_0x4e17('0x12e')]=![];});};Dialer[_0x4e17('0x1a')]['syncQueueSummaryComplete']=_[_0x4e17('0x13b')](function(){var _0x380d53=_[_0x4e17('0x13c')](this[_0x4e17('0x1e')],function(_0x3aa22c){return _0x3aa22c[_0x4e17('0x13d')];});var _0x57cbc8=_['filter'](this[_0x4e17('0x20')],function(_0x26954b){return _0x26954b[_0x4e17('0x13e')]&&_0x26954b[_0x4e17('0x8d')]===_0x4e17('0x8c');});if(_0x380d53[_0x4e17('0x9c')]>0x0&&_0x57cbc8[_0x4e17('0x9c')]>0x0){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0x4e17('0x13f')](_0x380d53,'id'),previewRecallmeReminderInterval,_[_0x4e17('0x13f')](_0x57cbc8,'id')))['then'](function(_0x7bda05){for(var _0x190a05=0x0;_0x190a05<_0x7bda05[_0x4e17('0x9c')];_0x190a05++){var _0x559679=_0x7bda05[_0x190a05][_0x4e17('0x140')][_0x4e17('0x60')];if(_0x559679)io['to'](util[_0x4e17('0x41')](_0x4e17('0x141'),_0x559679))[_0x4e17('0x110')](_0x4e17('0x142'),{'hopper':_0x7bda05[_0x190a05]});}})[_0x4e17('0xa5')](function(_0x18b4a0){logger['error']('checkPreviewRecallReminder',_0x18b4a0);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x4e17('0x1a')]['loopClearZombieChannels']=function(){var _0x1b1892=this;setInterval(function(){_0x1b1892[_0x4e17('0x143')](_0x1b1892[_0x4e17('0x25')],_0x4e17('0x144'));_0x1b1892[_0x4e17('0x143')](_0x1b1892['actions'],_0x4e17('0x145'));},0x32c8);};Dialer[_0x4e17('0x1a')][_0x4e17('0x143')]=function(_0x51592b,_0x409607){var _0x1be33c=this;for(var _0x2162cd in _0x51592b){if(typeof _0x51592b[_0x2162cd]!==_0x4e17('0xae')){this[_0x4e17('0x146')]['enqueue'](function(){if(!_[_0x4e17('0xf4')](_0x51592b[_0x2162cd])){return ami[_0x4e17('0x9e')]({'action':'status','channel':_0x51592b[_0x2162cd][_0x4e17('0xed')]})[_0x4e17('0xa5')](function(_0x3f028a){if(_0x3f028a[_0x4e17('0x6a')]===_0x4e17('0x147')){setTimeout(function(){if(_0x51592b[_0x2162cd]&&_0x51592b[_0x2162cd][_0x4e17('0x3d')]!==_0x4e17('0xc2')){_0x1be33c[_0x4e17('0xf8')](_0x1be33c['voiceQueues'][_0x51592b[_0x2162cd][_0x4e17('0xc0')]]);logger['error'](_0x4e17('0x148'),_0x409607,_0x2162cd,_0x51592b[_0x2162cd]['queue']);delete _0x51592b[_0x2162cd];}if(_0x51592b[_0x2162cd]&&_0x51592b[_0x2162cd][_0x4e17('0x3d')]==='ivr'){_0x1be33c[_0x4e17('0xf8')](_0x1be33c[_0x4e17('0x1f')][_0x51592b[_0x2162cd][_0x4e17('0xc0')]]);logger[_0x4e17('0x66')](_0x4e17('0x149'),_0x409607,_0x2162cd,_0x51592b[_0x2162cd][_0x4e17('0xc0')]);delete _0x51592b[_0x2162cd];}},0x2328);}});}});}}};Dialer[_0x4e17('0x1a')][_0x4e17('0x14a')]=function(_0x3a28e9){return Promise[_0x4e17('0xaf')]()[_0x4e17('0x3b')](voiceQueueRt[_0x4e17('0x14a')](_0x3a28e9))[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x14b')));};Dialer[_0x4e17('0x1a')][_0x4e17('0xf8')]=function(_0x4db724){if(!_['isUndefined'](_0x4db724)&&_0x4db724!==null){if(typeof _0x4db724[_0x4e17('0x82')]!==_0x4e17('0xae')){if(_0x4db724[_0x4e17('0x82')]>0x0){_0x4db724[_0x4e17('0x82')]-=0x1;}else{logger[_0x4e17('0x66')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x4e17('0x66')](_0x4e17('0x14c'));}};Dialer[_0x4e17('0x1a')]['loggerHandler']=function(_0x568bbe,_0x5dded1){var _0x4ebed0=this;return function(_0x257c73){_0x4ebed0[_0x4e17('0xf8')](_0x5dded1);logger['error'](_0x568bbe,util[_0x4e17('0x40')](_0x257c73,{'showHidden':![],'depth':null}));};};Dialer[_0x4e17('0x1a')][_0x4e17('0x14d')]=function(_0x1dbb5c,_0x80b07b,_0x1f11d3){var _0x4f5ae8={'state':0x19,'statedesc':_0x4e17('0x14e')};this[_0x4e17('0xf8')](_0x80b07b);this[_0x4e17('0x14f')](_[_0x4e17('0x5e')](_0x4f5ae8,_[_0x4e17('0x77')](_0x1f11d3,[_0x4e17('0xdb'),'ListId',_0x4e17('0x150'),_0x4e17('0xdd'),_0x4e17('0xde')])),_0x4e17('0x151'),_0x4e17('0x152'));logger[_0x4e17('0x66')](_0x1dbb5c);};Dialer['prototype'][_0x4e17('0x14f')]=function(_0x1d14a4,_0x4191a0,_0xc5a5a1){hopperUtils['createHistory'](_0x1d14a4)[_0x4e17('0xa5')](loggerCatch(_0x4191a0));hopperUtils['moveContactManagedDialer'](_0x1d14a4)[_0x4e17('0xa5')](loggerCatch(_0xc5a5a1));};Dialer[_0x4e17('0x1a')][_0x4e17('0xd8')]=function(_0x480403,_0x66a105){hopperUtils[_0x4e17('0xe2')](_0x480403)['catch'](loggerCatch(_0x4e17('0xc9')));if(_0x66a105==0x0){hopperUtils[_0x4e17('0xca')](_0x480403)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x4e17('0x1a')][_0x4e17('0x153')]=function(_0x4ef69f){return Promise[_0x4e17('0xaf')]()['then'](cmHopper[_0x4e17('0x154')](_0x4ef69f['id'],previewRecallmeReminderInterval))['then'](function(_0x38d022){for(var _0x5a27a7=0x0;_0x5a27a7<_0x38d022['length'];_0x5a27a7++){var _0x27257e=_0x38d022[_0x5a27a7][_0x4e17('0x140')]['name'];if(_0x27257e)io['to'](util[_0x4e17('0x41')]('user:%s',_0x27257e))[_0x4e17('0x110')]('user:dialPreviewRecallReminder',{'hopper':_0x38d022[_0x5a27a7]});}})[_0x4e17('0xa5')](function(){});};Dialer[_0x4e17('0x1a')][_0x4e17('0xb3')]=function(_0x2a9525){var _0x4a575f=this;return function(){_0x4a575f['handleIvr'](_0x2a9525);};};Dialer[_0x4e17('0x1a')][_0x4e17('0x155')]=function(_0x25cd1a,_0x38d594){var _0x5c4bdc=this;var _0x14befc=uuid['v4']();this[_0x4e17('0xec')][_0x14befc]=new Action(_0x25cd1a,_0x38d594,_0x14befc);return new Promise(function(_0x2c0c92,_0x1d2e03){if(_['isUndefined'](_0x25cd1a)&&typeof _0x25cd1a!=='object'){return _0x1d2e03(msgResponse(_0x4e17('0x156'),_0x4e17('0x99'),_0x4e17('0x157')));}if(_[_0x4e17('0x52')](_0x38d594[_0x4e17('0x158')])||_0x38d594[_0x4e17('0x158')]===null){return _0x1d2e03(msgResponse(_0x4e17('0x156'),_0x4e17('0x99'),_0x4e17('0x159')));}var _0xd37bd4={'XMD-CALLERID':_0x5c4bdc[_0x4e17('0xec')][_0x14befc][_0x4e17('0x15a')](),'XMD-AGI':_0x25cd1a['dialQueueProject']?util[_0x4e17('0x41')]('\x22agi://%s/square,%s\x22',ipAgi,_0x25cd1a[_0x4e17('0x129')]):_0x4e17('0x15b'),'XMD-AGIAFTER':_0x25cd1a[_0x4e17('0xd1')]?util[_0x4e17('0x41')]('\x22agi://%s/square,%s\x22',ipAgi,_0x25cd1a[_0x4e17('0xd1')]):_0x4e17('0x15b'),'XMD-QUEUE':utils[_0x4e17('0x15c')](_0x25cd1a)?util[_0x4e17('0x41')]('\x22%s,%s%s,,,%s\x22',_0x25cd1a[_0x4e17('0x60')],_0x25cd1a[_0x4e17('0x15d')]||'',_0x25cd1a[_0x4e17('0x15e')]?'c':'',_0x25cd1a['dialQueueTimeout']||0x3):_0x4e17('0x15b'),'XMD-CONTACTID':_0x38d594[_0x4e17('0xdb')],'XMD-CDRTYPE':_0x4e17('0x7'),'CALLERID(all)':_0x5c4bdc[_0x4e17('0xec')][_0x14befc][_0x4e17('0x15a')](),'XMD-AMD':_0x25cd1a[_0x4e17('0x109')]?'ACTIVE':_0x4e17('0x15b'),'XMD-DESTINATION':_0x4e17('0x108')};if(_0x25cd1a[_0x4e17('0x109')]){_0xd37bd4[_0x4e17('0x15f')]=_0x25cd1a[_0x4e17('0x160')]||0x9c4;_0xd37bd4['XMD-AMDGREETING']=_0x25cd1a['dialAMDGreeting']||0x5dc;_0xd37bd4[_0x4e17('0x161')]=_0x25cd1a[_0x4e17('0x162')]||0x320;_0xd37bd4[_0x4e17('0x163')]=_0x25cd1a[_0x4e17('0x164')]||0x1388;_0xd37bd4[_0x4e17('0x165')]=_0x25cd1a[_0x4e17('0x166')]||0x64;_0xd37bd4[_0x4e17('0x167')]=_0x25cd1a[_0x4e17('0x168')]||0x32;_0xd37bd4[_0x4e17('0x169')]=_0x25cd1a[_0x4e17('0x16a')]||0x3;_0xd37bd4['XMD-AMDSILENCETHRESHOLD']=_0x25cd1a['dialAMDSilenceThreshold']||0x100;_0xd37bd4['XMD-AMDMAXIMUMWORDLENGTH']=_0x25cd1a[_0x4e17('0x16b')]||0x1388;}if(utils[_0x4e17('0x15c')](_0x25cd1a)){_0xd37bd4[_0x4e17('0x16c')]=_0x38d594['VoiceQueueId'];}else{_0xd37bd4[_0x4e17('0x16d')]=_0x38d594[_0x4e17('0xde')];}for(var _0x33a52e in _0x38d594[_0x4e17('0x16e')]){if(typeof _0x38d594[_0x4e17('0x16e')][_0x33a52e]!==_0x4e17('0xae')){if(isNotNull(_0x38d594[_0x4e17('0x16e')][_0x33a52e])&&_0x33a52e!=='id'&&_0x33a52e!=='tags'&&_0x33a52e!=='createdAt'&&_0x33a52e!==_0x4e17('0x16f')){_0xd37bd4[util[_0x4e17('0x41')](_0x4e17('0x170'),_0x4e17('0x171'),_[_0x4e17('0x172')](_0x33a52e))]=_0x38d594['Contact'][_0x33a52e];}}}var _0x4d71bb=_0x5c4bdc['isTrunkReachable'](_0x25cd1a['Trunk'])?utils[_0x4e17('0x173')](_0x25cd1a[_0x4e17('0x174')][_0x4e17('0x175')],_0x25cd1a[_0x4e17('0x176')],_0x25cd1a[_0x4e17('0x177')]>0x0?utils['getCallerIdRandom'](_0x25cd1a[_0x4e17('0x178')],_0x25cd1a[_0x4e17('0x177')]):_0x25cd1a[_0x4e17('0x178')]):utils[_0x4e17('0x173')](_[_0x4e17('0xf4')](_0x25cd1a[_0x4e17('0x90')])?_0x25cd1a['Trunk'][_0x4e17('0x175')]:_0x25cd1a['TrunkBackup'][_0x4e17('0x175')],_0x25cd1a[_0x4e17('0x176')],_0x25cd1a['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x4e17('0x179')](_0x25cd1a[_0x4e17('0x178')],_0x25cd1a[_0x4e17('0x177')]):_0x25cd1a[_0x4e17('0x178')]);if(_0x4d71bb){_0xd37bd4[_0x4e17('0x17a')]=_0x5c4bdc['actions'][_0x14befc]['originatecalleridname']=utils['extractCalleridName'](_0x4d71bb);_0xd37bd4[_0x4e17('0x17b')]=_0x38d594[_0x4e17('0x158')];}_0x25cd1a[_0x4e17('0x17c')]=_0xd37bd4;return ami['Action']({'actionid':_0x14befc,'action':_0x4e17('0x156'),'channel':_0x5c4bdc[_0x4e17('0x89')](_0x25cd1a['Trunk'])?util[_0x4e17('0x41')](_0x4e17('0x17d'),_0x25cd1a[_0x4e17('0x174')][_0x4e17('0x60')],isNotNull(_0x25cd1a[_0x4e17('0x17e')])?_0x25cd1a[_0x4e17('0x17e')][_0x4e17('0x17f')]()||'':'',_0x25cd1a[_0x4e17('0x180')]>0x0?_0x38d594['phone'][_0x4e17('0x181')](_0x25cd1a['dialCutDigit']):_0x38d594[_0x4e17('0x158')]):util[_0x4e17('0x41')]('SIP/%s/%s%s',_[_0x4e17('0xf4')](_0x25cd1a[_0x4e17('0x90')])?_0x25cd1a[_0x4e17('0x174')]['name']:_0x25cd1a[_0x4e17('0x90')][_0x4e17('0x60')],isNotNull(_0x25cd1a[_0x4e17('0x17e')])?_0x25cd1a[_0x4e17('0x17e')][_0x4e17('0x17f')]()||'':'',_0x25cd1a[_0x4e17('0x180')]>0x0?_0x38d594[_0x4e17('0x158')][_0x4e17('0x181')](_0x25cd1a[_0x4e17('0x180')]):_0x38d594[_0x4e17('0x158')]),'callerid':_0x4d71bb,'Exten':_0x4e17('0x108'),'Context':'from-sip','Priority':'1','variable':_0xd37bd4,'timeout':(_0x25cd1a['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x14befc})['then'](function(_0x5e8dcd){return _0x2c0c92(_0x5e8dcd);})[_0x4e17('0xa5')](function(_0x57f69b){_0x25cd1a[_0x4e17('0x182')]+=0x1;var _0x58659e=new History(_0x5c4bdc[_0x4e17('0xec')][_0x14befc]);logger[_0x4e17('0x66')](util[_0x4e17('0x41')](_0x4e17('0x183'),JSON[_0x4e17('0x76')](_0x57f69b)));_0x58659e['state']=0xe;_0x58659e[_0x4e17('0x71')]=_0x4e17('0x184');_0x58659e[_0x4e17('0x73')]=moment()[_0x4e17('0x41')](_0x4e17('0xc4'));_0x58659e[_0x4e17('0x72')]=_0x58659e[_0x4e17('0x73')];hopperUtils[_0x4e17('0xe2')](_0x58659e)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x185')));_0x5c4bdc[_0x4e17('0xca')](_0x58659e)['catch'](loggerCatch(_0x4e17('0x185')))[_0x4e17('0x1c')](function(){delete _0x5c4bdc[_0x4e17('0xec')][_0x14befc];return _0x1d2e03(msgResponse(_0x4e17('0x156'),_0x4e17('0x88'),'originate\x20action\x20Error'));});});});};Dialer[_0x4e17('0x1a')]['checkRetriveMax']=function(_0x1a99fb,_0x328f69,_0x212580){var _0x39174c=new History(_0x328f69);if(_0x39174c[_0x4e17('0x11a')]+_0x39174c[_0x4e17('0x11b')]+_0x39174c[_0x4e17('0x11c')]+_0x39174c['countnosuchnumberretry']+_0x39174c[_0x4e17('0xd2')]+_0x39174c[_0x4e17('0xe8')]+_0x39174c['countmachineretry']+_0x39174c[_0x4e17('0x11e')]>=_0x212580['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1a99fb){case 0x3:if(_0x39174c[_0x4e17('0x11c')]>=_0x212580[_0x4e17('0x186')]-0x1){return!![];}hopperUtils[_0x4e17('0xd9')]({'active':![],'countnoanswerretry':_0x39174c[_0x4e17('0x11c')]+=0x1,'scheduledat':moment()[_0x4e17('0xe9')](_0x212580['dialNoAnswerRetryFrequency'],_0x4e17('0xda'))[_0x4e17('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x39174c['ContactId'],'ListId':_0x39174c['ListId'],'VoiceQueueId':_0x39174c[_0x4e17('0xdd')]||undefined,'CampaignId':_0x39174c['CampaignId']||undefined})[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x187')));break;case 0x5:if(_0x39174c[_0x4e17('0x11a')]>=_0x212580[_0x4e17('0x188')]-0x1){return!![];}hopperUtils[_0x4e17('0xd9')]({'active':![],'countbusyretry':_0x39174c['countbusyretry']+=0x1,'scheduledat':moment()[_0x4e17('0xe9')](_0x212580[_0x4e17('0x189')],_0x4e17('0xda'))[_0x4e17('0x41')](_0x4e17('0xc4')),'ContactId':_0x39174c['ContactId'],'ListId':_0x39174c[_0x4e17('0xdc')],'VoiceQueueId':_0x39174c[_0x4e17('0xdd')]||undefined,'CampaignId':_0x39174c['CampaignId']||undefined})[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x18a')));break;case 0x8:if(_0x39174c[_0x4e17('0x11b')]>=_0x212580[_0x4e17('0x18b')]-0x1){return!![];}hopperUtils[_0x4e17('0xd9')]({'active':![],'countcongestionretry':_0x39174c['countcongestionretry']+=0x1,'scheduledat':moment()[_0x4e17('0xe9')](_0x212580['dialCongestionRetryFrequency'],'minutes')[_0x4e17('0x41')](_0x4e17('0xc4')),'ContactId':_0x39174c[_0x4e17('0xdb')],'ListId':_0x39174c[_0x4e17('0xdc')],'VoiceQueueId':_0x39174c[_0x4e17('0xdd')]||undefined,'CampaignId':_0x39174c[_0x4e17('0xde')]||undefined})[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x18c')));break;case 0x0:if(_0x39174c[_0x4e17('0x11d')]>=_0x212580['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x4e17('0xd9')]({'active':![],'countnosuchnumberretry':_0x39174c['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x4e17('0xe9')](_0x212580['dialNoSuchNumberRetryFrequency'],_0x4e17('0xda'))[_0x4e17('0x41')](_0x4e17('0xc4')),'ContactId':_0x39174c[_0x4e17('0xdb')],'ListId':_0x39174c[_0x4e17('0xdc')],'VoiceQueueId':_0x39174c[_0x4e17('0xdd')]||undefined,'CampaignId':_0x39174c[_0x4e17('0xde')]||undefined})[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x18d')));}break;case 0xa:if(_0x39174c[_0x4e17('0xd2')]>=_0x212580[_0x4e17('0xd7')]-0x1){return!![];}hopperUtils[_0x4e17('0xd9')]({'active':![],'countdropretry':_0x39174c[_0x4e17('0xd2')]+=0x1,'scheduledat':moment()[_0x4e17('0xe9')](_0x212580[_0x4e17('0xd3')],'minutes')[_0x4e17('0x41')](_0x4e17('0xc4')),'ContactId':_0x39174c['ContactId'],'ListId':_0x39174c[_0x4e17('0xdc')],'VoiceQueueId':_0x39174c['VoiceQueueId']||undefined,'CampaignId':_0x39174c[_0x4e17('0xde')]||undefined})[_0x4e17('0xa5')](loggerCatch(_0x4e17('0xdf')));break;case 0xb:if(_0x39174c[_0x4e17('0xe8')]>=_0x212580[_0x4e17('0x18e')]-0x1){return!![];}hopperUtils[_0x4e17('0xd9')]({'active':![],'countabandonedretry':_0x39174c['countabandonedretry']+=0x1,'scheduledat':moment()[_0x4e17('0xe9')](_0x212580['dialAbandonedRetryFrequency'],_0x4e17('0xda'))[_0x4e17('0x41')](_0x4e17('0xc4')),'ContactId':_0x39174c['ContactId'],'ListId':_0x39174c[_0x4e17('0xdc')],'VoiceQueueId':_0x39174c[_0x4e17('0xdd')]||undefined,'CampaignId':_0x39174c[_0x4e17('0xde')]||undefined})['catch'](loggerCatch(_0x4e17('0x18f')));break;case 0x13:if(_0x39174c[_0x4e17('0x118')]>=_0x212580[_0x4e17('0x126')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x39174c[_0x4e17('0x118')]+=0x1,'scheduledat':moment()[_0x4e17('0xe9')](_0x212580[_0x4e17('0x123')],_0x4e17('0xda'))['format'](_0x4e17('0xc4')),'ContactId':_0x39174c['ContactId'],'ListId':_0x39174c[_0x4e17('0xdc')],'VoiceQueueId':_0x39174c[_0x4e17('0xdd')]||undefined,'CampaignId':_0x39174c[_0x4e17('0xde')]||undefined})[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x127')));break;case 0x14:if(_0x39174c[_0x4e17('0x11e')]>=_0x212580[_0x4e17('0x190')]-0x1){return!![];}hopperUtils[_0x4e17('0xd9')]({'active':![],'countagentrejectretry':_0x39174c[_0x4e17('0x11e')]+=0x1,'scheduledat':moment()[_0x4e17('0xe9')](_0x212580['dialAgentRejectRetryFrequency'],_0x4e17('0xda'))[_0x4e17('0x41')](_0x4e17('0xc4')),'ContactId':_0x39174c[_0x4e17('0xdb')],'ListId':_0x39174c[_0x4e17('0xdc')],'VoiceQueueId':_0x39174c['VoiceQueueId']||undefined,'CampaignId':_0x39174c['CampaignId']||undefined})[_0x4e17('0xa5')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x4e17('0x1a')][_0x4e17('0x102')]=function(_0x2b6c2c,_0x2167a9,_0x1beac0){var _0x37a96d=this;var _0x262df4=new History(_0x2b6c2c);var _0x90b034=![];var _0x209177;var _0x517db6;return new Promise(function(_0x3bdb8,_0x193d8b){if(_[_0x4e17('0x52')](_0x2167a9)&&typeof _0x2167a9!==_0x4e17('0x191')){return _0x193d8b(msgResponse(_0x4e17('0x192'),'Failure',_0x4e17('0x193')));}if(_['isUndefined'](_0x1beac0)&&typeof _0x1beac0!==_0x4e17('0x191')){return _0x193d8b(msgResponse(_0x4e17('0x192'),_0x4e17('0x99'),_0x4e17('0x194')));}hopperUtils['verifyAdditionalPhones'](_0x262df4,_0x1beac0[_0x4e17('0xc6')],_0x2167a9)['then'](function(_0x1f075c){if(_0x1f075c[_0x4e17('0xd6')]==0x1)_0x90b034=!![];switch(_0x1beac0[_0x4e17('0xc6')]){case'0':_0x2167a9['outboundNoSuchCallsDay']+=0x1;_0x262df4[_0x4e17('0x70')]=0x0;_0x262df4[_0x4e17('0x71')]=_0x4e17('0x195');_0x262df4[_0x4e17('0x11d')]+=0x1;_0x262df4[_0x4e17('0x125')]+=0x1;ami[_0x4e17('0x110')](_0x4e17('0x196'),ut[_0x4e17('0x112')](_0x2b6c2c,_0x4e17('0x197')));_0x209177=_0x2167a9['dialNoSuchNumberRetryFrequency'];_0x517db6=_0x2167a9[_0x4e17('0xd4')];hopperUtils['createHistory'](_0x262df4)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x119')));if(_0x37a96d['checkRetriveMax'](0x0,_0x2b6c2c,_0x2167a9)&&!_0x90b034){if(_0x262df4['countnosuchnumberretry']>=_0x2167a9[_0x4e17('0x198')]){_0x37a96d[_0x4e17('0x122')](_0x262df4,_0x3bdb8,_0x193d8b,'reason\x200\x20no\x20such\x20number....');}else{_0x37a96d[_0x4e17('0x120')](_0x262df4,_0x3bdb8,_0x193d8b,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x2167a9[_0x4e17('0x199')]+=0x1;_0x262df4[_0x4e17('0x70')]=0x3;_0x262df4['statedesc']=_0x4e17('0x19a');_0x262df4[_0x4e17('0x11c')]+=0x1;_0x262df4[_0x4e17('0x125')]+=0x1;var _0x5c0648=ut[_0x4e17('0x19b')](_0x2b6c2c,_0x2167a9);ami[_0x4e17('0x110')]('custom:agentnoanswer',_0x5c0648);_0x209177=_0x2167a9[_0x4e17('0x19c')];_0x517db6=_0x2167a9[_0x4e17('0xd4')];hopperUtils[_0x4e17('0xe2')](_0x262df4)['catch'](loggerCatch(_0x4e17('0x19d')));if(_0x37a96d[_0x4e17('0x19e')](0x3,_0x2b6c2c,_0x2167a9)&&!_0x90b034){if(_0x262df4[_0x4e17('0x11c')]>=_0x2167a9[_0x4e17('0x186')]){_0x37a96d[_0x4e17('0x122')](_0x262df4,_0x3bdb8,_0x193d8b,_0x4e17('0x19f'));}else{_0x37a96d[_0x4e17('0x120')](_0x262df4,_0x3bdb8,_0x193d8b,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2167a9[_0x4e17('0x1a0')]+=0x1;_0x262df4['state']=0x5;_0x262df4[_0x4e17('0x71')]=_0x4e17('0x1a1');_0x262df4[_0x4e17('0x11a')]+=0x1;_0x262df4[_0x4e17('0x125')]+=0x1;ami[_0x4e17('0x110')]('custom:agentbusy',ut[_0x4e17('0x112')](_0x2b6c2c,_0x4e17('0x1a2')));_0x209177=_0x2167a9[_0x4e17('0x189')];_0x517db6=_0x2167a9[_0x4e17('0xd4')];hopperUtils[_0x4e17('0xe2')](_0x262df4)['catch'](loggerCatch(_0x4e17('0x1a3')));if(_0x37a96d[_0x4e17('0x19e')](0x5,_0x2b6c2c,_0x2167a9)&&!_0x90b034){if(_0x262df4[_0x4e17('0x11a')]>=_0x2167a9[_0x4e17('0x188')]){_0x37a96d[_0x4e17('0x122')](_0x262df4,_0x3bdb8,_0x193d8b,_0x4e17('0x1a4'));}else{_0x37a96d[_0x4e17('0x120')](_0x262df4,_0x3bdb8,_0x193d8b,_0x4e17('0x1a4'));}}break;case'8':_0x2167a9[_0x4e17('0x1a5')]+=0x1;_0x262df4[_0x4e17('0x70')]=0x8;_0x262df4[_0x4e17('0x71')]=_0x4e17('0x1a6');_0x262df4[_0x4e17('0x11b')]+=0x1;_0x262df4[_0x4e17('0x125')]+=0x1;_0x209177=_0x2167a9[_0x4e17('0x1a7')];_0x517db6=_0x2167a9[_0x4e17('0xd4')];ami['emit'](_0x4e17('0x1a8'),ut['buildObj'](_0x2b6c2c,_0x4e17('0x1a9')));hopperUtils[_0x4e17('0xe2')](_0x262df4)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x1aa')));if(_0x37a96d[_0x4e17('0x19e')](0x8,_0x2b6c2c,_0x2167a9)&&!_0x90b034){if(_0x262df4[_0x4e17('0x11b')]>=_0x2167a9[_0x4e17('0x18b')]){_0x37a96d['createStateFinal'](_0x262df4,_0x3bdb8,_0x193d8b,_0x4e17('0x1ab'));}else{_0x37a96d[_0x4e17('0x120')](_0x262df4,_0x3bdb8,_0x193d8b,_0x4e17('0x1ab'));}}break;case'11':_0x2167a9[_0x4e17('0x1ac')]+=0x1;_0x262df4[_0x4e17('0x70')]=0xb;_0x262df4[_0x4e17('0x71')]=_0x4e17('0xea');_0x262df4[_0x4e17('0xe8')]+=0x1;_0x262df4[_0x4e17('0x125')]+=0x1;_0x209177=_0x2167a9[_0x4e17('0xe6')];_0x517db6=_0x2167a9[_0x4e17('0xd4')];hopperUtils[_0x4e17('0xe2')](_0x262df4)['catch'](loggerCatch(_0x4e17('0xeb')));if(_0x37a96d[_0x4e17('0x19e')](0xb,_0x2b6c2c,_0x2167a9)&&!_0x90b034){if(_0x262df4[_0x4e17('0xe8')]>=_0x2167a9[_0x4e17('0x18e')]){_0x37a96d[_0x4e17('0x122')](_0x262df4,_0x3bdb8,_0x193d8b,_0x4e17('0x1ad'));}else{_0x37a96d[_0x4e17('0x120')](_0x262df4,_0x3bdb8,_0x193d8b,_0x4e17('0x1ad'));}}break;case'20':_0x2167a9[_0x4e17('0x1ae')]+=0x1;_0x262df4[_0x4e17('0x70')]=0x14;_0x262df4['statedesc']='AgentReject';_0x262df4[_0x4e17('0x11e')]+=0x1;_0x262df4[_0x4e17('0x125')]+=0x1;_0x209177=_0x2167a9[_0x4e17('0x1af')];_0x517db6=_0x2167a9[_0x4e17('0xd4')];ami[_0x4e17('0x110')](_0x4e17('0x1b0'),ut['buildObj'](_0x2b6c2c,_0x4e17('0x1b1')));hopperUtils[_0x4e17('0xe2')](_0x262df4)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x1b2')));if(_0x37a96d[_0x4e17('0x19e')](0x14,_0x2b6c2c,_0x2167a9)&&!_0x90b034){if(_0x262df4['countagentrejectretry']>=_0x2167a9[_0x4e17('0x190')]){_0x37a96d[_0x4e17('0x122')](_0x262df4,_0x3bdb8,_0x193d8b,'reason\x2020\x20agentreject');}else{_0x37a96d[_0x4e17('0x120')](_0x262df4,_0x3bdb8,_0x193d8b,_0x4e17('0x1b3'));}}break;default:_0x2167a9['outboundUnknownCallsDay']+=0x1;_0x262df4[_0x4e17('0x70')]=0xc;_0x262df4[_0x4e17('0x71')]=_0x1beac0[_0x4e17('0xc6')];_0x209177=_0x2167a9[_0x4e17('0x1af')];_0x517db6=_0x2167a9[_0x4e17('0xd4')];hopperUtils[_0x4e17('0xe2')](_0x262df4)[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x1b4')));if(_0x37a96d[_0x4e17('0x19e')](_0x1beac0[_0x4e17('0xc6')],_0x2b6c2c,_0x2167a9)&&!_0x90b034){if(_0x262df4[_0x4e17('0x11a')]+_0x262df4['countcongestionretry']+_0x262df4['countnoanswerretry']+_0x262df4[_0x4e17('0x11d')]+_0x262df4[_0x4e17('0xd2')]+_0x262df4[_0x4e17('0xe8')]+_0x262df4['countmachineretry']+_0x262df4['countagentrejectretry']>=_0x2167a9['dialGlobalMaxRetry']){_0x37a96d[_0x4e17('0x120')](_0x262df4,_0x3bdb8,_0x193d8b,_0x1beac0[_0x4e17('0xc6')]);}else{_0x37a96d[_0x4e17('0x122')](_0x262df4,_0x3bdb8,_0x193d8b,_0x1beac0['reason']);}}}})['then'](function(){if(_0x90b034){hopperUtils[_0x4e17('0xe3')](_0x262df4,_0x209177,_0x517db6)['then'](function(){return _0x3bdb8(0x1);});}});});};Dialer[_0x4e17('0x1a')][_0x4e17('0x120')]=function(_0x979b69,_0x231721,_0x117618,_0x5241b4){var _0x4395b5=new Final(_0x979b69);_0x4395b5[_0x4e17('0x70')]=0xf;_0x4395b5[_0x4e17('0x71')]=_0x4e17('0x1b5');this[_0x4e17('0x122')](_0x4395b5,_0x231721,_0x117618,_0x5241b4);};Dialer[_0x4e17('0x1a')]['createStateFinal']=function(_0x4081d4,_0x181ae1,_0xb45fb5,_0x5989b4){hopperUtils[_0x4e17('0xca')](_0x4081d4)['then'](function(){return _0x181ae1(msgResponse('[callProgressDetecting]',_0x4e17('0x1b6'),_0x5989b4));})['catch'](function(){return _0xb45fb5(msgResponse('[moveContactManagedDialer][0]',_0x4e17('0x99'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x4e17('0x8')]=function(_0x2b3915){var _0x4d43e4=_0x2b3915[_0x4e17('0x1b7')]/0x64;var _0x95197a=_0x2b3915[_0x4e17('0xcd')]/(_0x2b3915[_0x4e17('0xcd')]+_0x2b3915[_0x4e17('0xc5')]);var _0x1f36bd=Math[_0x4e17('0x1b8')](_0x2b3915[_0x4e17('0x1b9')]*(_0x2b3915['predictiveIntervalMaxThreshold']/0x64));var _0x17f9c3=Math[_0x4e17('0x1b8')](_0x2b3915[_0x4e17('0x1b9')]*(_0x2b3915[_0x4e17('0x1ba')]/0x64));var _0x1cc1fd=_0x2b3915[_0x4e17('0x131')]+_0x2b3915[_0x4e17('0x133')];var _0x44eade=Math[_0x4e17('0x1bb')](_0x2b3915[_0x4e17('0x1bc')]*_0x2b3915[_0x4e17('0x5a')]*_0x2b3915[_0x4e17('0x1bd')]*_0x2b3915[_0x4e17('0x1be')]);if(_[_0x4e17('0x52')](_0x2b3915[_0x4e17('0x27')])){if(!_[_0x4e17('0x52')](_0x2b3915[_0x4e17('0x62')])){_0x2b3915[_0x4e17('0x62')]=undefined;loggerPredictive[_0x4e17('0x66')](_0x4e17('0x1bf'),_0x4e17('0x1c0'));}if(!_[_0x4e17('0x52')](_0x2b3915[_0x4e17('0x64')])){loggerPredictive[_0x4e17('0x66')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2b3915['handlePredictive']);_0x2b3915['handlePredictive']=undefined;}_0x2b3915[_0x4e17('0x27')]=moment()[_0x4e17('0x41')](_0x4e17('0xc4'));loggerPredictive[_0x4e17('0x44')](_0x2b3915[_0x4e17('0x60')],'collection\x20data\x20in\x20progressive\x20at',_0x2b3915['startProgressive']);this[_0x4e17('0xb8')](_0x2b3915,0x1);}else if(ifInterval(_0x2b3915['dialPredictiveInterval'],_0x2b3915[_0x4e17('0x27')])){this['handlePower'](_0x2b3915,0x1);loggerPredictiveCalls[_0x4e17('0x44')](_0x4e17('0x1c1'),_0x2b3915[_0x4e17('0x27')],_0x2b3915['name']);_0x2b3915[_0x4e17('0x1bc')]=0x0;_0x2b3915[_0x4e17('0x1c2')]=0x0;}else if(_0x4d43e4<_0x95197a&&_0x2b3915['dialPredictiveOptimization']===_0x4e17('0x1c3')){clearPredictiveAttributes(_0x2b3915);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x1c4'),'Dropped\x20calls\x20day',_0x95197a,'startProgressive',_0x2b3915[_0x4e17('0x60')]);}else if(_0x44eade<_0x2b3915[_0x4e17('0x1c2')]&&_0x2b3915['dialPredictiveOptimization']===_0x4e17('0x1c3')){clearPredictiveAttributes(_0x2b3915);loggerPredictive['info'](_0x4e17('0x1c5'),'Max\x20Drop\x20',_0x44eade,_0x4e17('0x1c6'),_0x2b3915['predictiveIntervalErlangCallsDroppedCalls'],_0x4e17('0x27'),_0x2b3915[_0x4e17('0x60')]);}else if(!ifInterval(_0x2b3915[_0x4e17('0x1c7')],_0x2b3915[_0x4e17('0x27')])&&_[_0x4e17('0x52')](_0x2b3915[_0x4e17('0x62')])&&!_[_0x4e17('0x52')](_0x2b3915['startProgressive'])){_0x2b3915[_0x4e17('0x62')]=moment()[_0x4e17('0x41')](_0x4e17('0xc4'));loggerPredictive[_0x4e17('0x44')](_0x2b3915[_0x4e17('0x60')],'started\x20in\x20predictive\x20at',_0x2b3915[_0x4e17('0x62')]);hopperUtils[_0x4e17('0x1c8')](_0x2b3915[_0x4e17('0x1c7')])[_0x4e17('0x3b')](this[_0x4e17('0x1c9')](_0x2b3915))[_0x4e17('0x3b')](mergeDataErlangB(_0x2b3915))[_0x4e17('0x3b')](this['startMethodPredictive'](_0x2b3915))[_0x4e17('0xa5')](loggerCatchPredictive(_0x4e17('0x1ca'),_0x2b3915));}else if(!ifInterval(_0x2b3915['dialPredictiveInterval'],_0x2b3915[_0x4e17('0x62')])){_0x2b3915['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2b3915[_0x4e17('0x62')]=moment()[_0x4e17('0x41')](_0x4e17('0xc4'));loggerPredictive[_0x4e17('0x44')](_0x2b3915[_0x4e17('0x60')],'recalculate\x20predictive\x20at',_0x2b3915[_0x4e17('0x62')]);clearInterval(_0x2b3915[_0x4e17('0x64')]);_0x2b3915[_0x4e17('0x64')]=undefined;hopperUtils[_0x4e17('0x1c8')](_0x2b3915[_0x4e17('0x1c7')])[_0x4e17('0x3b')](this[_0x4e17('0x1c9')](_0x2b3915))['then'](mergeDataErlangB(_0x2b3915))[_0x4e17('0x3b')](this['startMethodPredictive'](_0x2b3915))[_0x4e17('0xa5')](loggerCatchPredictive(_0x4e17('0x1cb'),_0x2b3915));}else if(_0x2b3915[_0x4e17('0x1b9')]&&_0x1cc1fd<_0x2b3915[_0x4e17('0x1b9')]-_0x17f9c3){clearPredictiveAttributes(_0x2b3915);loggerPredictive[_0x4e17('0x44')](_0x2b3915[_0x4e17('0x60')],_0x4e17('0x1cc'),_0x1cc1fd,')\x20are\x20less\x20than\x20threshold\x20(',_0x2b3915['predictiveIntervalAvailable'],'-',_0x17f9c3,'=',_0x2b3915[_0x4e17('0x1b9')]-_0x17f9c3,')');}else if(_0x2b3915[_0x4e17('0x1b9')]&&_0x1cc1fd>_0x2b3915['predictiveIntervalAvailable']+_0x1f36bd){clearPredictiveAttributes(_0x2b3915);loggerPredictive[_0x4e17('0x44')](_0x2b3915[_0x4e17('0x60')],_0x4e17('0x1cc'),_0x1cc1fd,_0x4e17('0x1cd'),_0x2b3915[_0x4e17('0x1b9')],'+',_0x1f36bd,'=',_0x2b3915[_0x4e17('0x1b9')]+_0x1f36bd,')');}};Dialer[_0x4e17('0x1a')][_0x4e17('0x1c9')]=function(_0x42e249){var _0x263f96=this;return function(_0x5a4dd9){return new Promise(function(_0x4f2d61,_0x24c40f){_[_0x4e17('0x5e')](_0x42e249,_0x5a4dd9[0x0]);if(checkGetDataPredictive(_0x5a4dd9[0x0])){var _0x3e5868=_0x42e249[_0x4e17('0x1b9')]=_0x42e249[_0x4e17('0x133')]+_0x42e249[_0x4e17('0x131')];var _0x24dfbc=_0x42e249[_0x4e17('0x1c7')]*0x3c;var _0x1872be=_0x5a4dd9[0x0][_0x4e17('0x50')]+_0x5a4dd9[0x0]['predictiveIntervalAvgHoldtime'];var _0x3f577c=(_0x5a4dd9[0x0][_0x4e17('0x48')]+_0x5a4dd9[0x0][_0x4e17('0x4a')]+_0x5a4dd9[0x0][_0x4e17('0x4c')])/_0x5a4dd9[0x0][_0x4e17('0x46')];_0x42e249[_0x4e17('0x1bd')]=_0x3f577c>0x0?_0x3f577c:0x1;switch(_0x42e249['dialPredictiveOptimization']){case _0x4e17('0x1c3'):var _0x525f53=_0x42e249['dialPredictiveOptimizationPercentage']/0x64;return _0x263f96['abandonmentRate'](_0x3e5868,_0x24dfbc,_0x1872be,_0x3f577c,_0x525f53)[_0x4e17('0x3b')](function(_0x140c25){return _0x4f2d61(_0x140c25);});case _0x4e17('0x1ce'):var _0x3cc3c6=_0x42e249[_0x4e17('0x1b7')]/0x64;return _0x263f96[_0x4e17('0x1cf')](_0x3e5868,_0x24dfbc,_0x1872be,_0x3f577c,_0x3cc3c6)[_0x4e17('0x3b')](function(_0x254439){return _0x4f2d61(_0x254439);});default:return _0x24c40f(msgResponse(_0x4e17('0x1d0'),_0x4e17('0x99'),_0x4e17('0x1d1')));}}else{return _0x24c40f(msgResponse(_0x4e17('0x1d0'),_0x4e17('0x99'),_0x4e17('0x1d2')));}});};};Dialer['prototype'][_0x4e17('0x1d3')]=function(_0x291c5e){var _0x4e3583=this;return function(_0x20cd2a){return new Promise(function(_0x5cbd83,_0x155024){_[_0x4e17('0x5e')](_0x291c5e,_0x20cd2a[0x0]);if(checkGetDataPredictive(_0x20cd2a[0x0])){loggerPredictive[_0x4e17('0x44')](JSON['stringify'](_0x20cd2a[0x0]));if(_0x291c5e[_0x4e17('0x1d4')]==='dropRate'){return _0x4e3583[_0x4e17('0x14a')](_0x291c5e['id'])[_0x4e17('0x3b')](function(_0x5d10d9){var _0x5a34bb=_0x291c5e[_0x4e17('0x1d5')]-_0x5d10d9[0x0][_0x4e17('0x1d6')];var _0x149d8d=_0x291c5e['dialPredictiveInterval']*0x3c;var _0x6a2f9f=_0x20cd2a[0x0][_0x4e17('0x50')]+_0x20cd2a[0x0]['predictiveIntervalAvgHoldtime'];var _0xf9793d=(_0x20cd2a[0x0]['predictiveIntervalAnsweredCalls']+_0x20cd2a[0x0][_0x4e17('0x4a')]+_0x20cd2a[0x0][_0x4e17('0x4c')])/_0x20cd2a[0x0][_0x4e17('0x46')];var _0x338372=_0x291c5e[_0x4e17('0x1b7')]/0x64;_0x291c5e[_0x4e17('0x1d7')]=_0x5d10d9[0x0][_0x4e17('0x1d6')]||0x0;_0x291c5e[_0x4e17('0x1bd')]=_0xf9793d>0x0?_0xf9793d:0x1;return _0x4e3583['abandonmentRate'](_0x5a34bb,_0x149d8d,_0x6a2f9f,_0xf9793d,_0x338372);})[_0x4e17('0x3b')](function(_0x36ce3a){return _0x5cbd83(_0x36ce3a);})['catch'](function(_0x58f144){return _0x155024(msgResponse(_0x4e17('0x1d8'),_0x4e17('0x99'),JSON[_0x4e17('0x76')](_0x58f144)));});}if(_0x291c5e['dialPredictiveOptimization']===_0x4e17('0x1ce')){return _0x4e3583[_0x4e17('0x14a')](_0x291c5e['id'])[_0x4e17('0x3b')](function(_0x4ae103){var _0x28275a=_0x291c5e[_0x4e17('0x1d5')]-_0x4ae103[0x0][_0x4e17('0x1d6')];var _0x765957=_0x291c5e['dialPredictiveInterval']*0x3c;var _0x5bcb83=_0x20cd2a[0x0][_0x4e17('0x50')]+_0x20cd2a[0x0]['predictiveIntervalAvgHoldtime'];var _0x301a9f=(_0x20cd2a[0x0][_0x4e17('0x48')]+_0x20cd2a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x20cd2a[0x0][_0x4e17('0x4c')])/_0x20cd2a[0x0][_0x4e17('0x46')];var _0x586355=_0x291c5e[_0x4e17('0x1b7')]/0x64;_0x291c5e[_0x4e17('0x1d7')]=_0x4ae103[0x0]['outboundQueuePauses']||0x0;_0x291c5e[_0x4e17('0x1bd')]=_0x301a9f>0x0?_0x301a9f:0x1;return _0x4e3583[_0x4e17('0x1cf')](_0x28275a,_0x765957,_0x5bcb83,_0x301a9f,_0x586355);})[_0x4e17('0x3b')](function(_0x67890){return _0x5cbd83(_0x67890);})[_0x4e17('0xa5')](function(_0x3cfa74){return _0x155024(msgResponse(_0x4e17('0x1d8'),'Failure',JSON[_0x4e17('0x76')](_0x3cfa74)));});}}else{return _0x155024(msgResponse(_0x4e17('0x1d0'),_0x4e17('0x99'),'check\x20failure'));}});};};Dialer[_0x4e17('0x1a')][_0x4e17('0x1d9')]=function(_0x1631c0){var _0x29f24b=this;return function(){var _0x219f33=0x0;var _0x5dd2cb=Math[_0x4e17('0x1bb')](_0x1631c0[_0x4e17('0x59')]*0x3e8);if(_0x5dd2cb>0x0){_0x5dd2cb=_0x5dd2cb<0x64?0x64:_0x5dd2cb;loggerPredictive[_0x4e17('0x44')](_0x1631c0[_0x4e17('0x60')],'one\x20call\x20every:',_0x5dd2cb,'milliseconds');_0x1631c0[_0x4e17('0x64')]=setInterval(function(){_0x29f24b[_0x4e17('0x64')](_0x1631c0);loggerPredictiveCalls[_0x4e17('0x44')](_0x4e17('0x1da'),_0x219f33+=0x1);},_0x5dd2cb);}else{loggerPredictive[_0x4e17('0x44')](_0x1631c0[_0x4e17('0x60')],_0x4e17('0x1db'));}};};Dialer[_0x4e17('0x1a')][_0x4e17('0x1dc')]=function(_0x99d0bd,_0x18e65b){var _0xa73c47=this;return function(_0x17239a){if(_[_0x4e17('0x43')](_0x17239a)){if(_[_0x4e17('0xf4')](_0x18e65b[_0x4e17('0x150')])||!_0x18e65b['recallme']){if(_0x99d0bd[_0x4e17('0xb6')]==='booked'){_0x99d0bd['queueStatusComplete']=_['isUndefined'](_0x99d0bd[_0x4e17('0x74')])?!![]:_0x99d0bd[_0x4e17('0x74')];var _0x39c2b0=uuid['v4']();_0xa73c47[_0x4e17('0xec')][_0x39c2b0]=new Action(_0x99d0bd,_0x18e65b,_0x39c2b0);loggerBooked[_0x4e17('0x44')](_0x4e17('0x1dd'),_0x39c2b0,_0x4e17('0x1de'),JSON['stringify'](_0x99d0bd[_0x4e17('0x74')]),_0x4e17('0x1df'),_0x99d0bd[_0x4e17('0x60')]);if(_0x99d0bd[_0x4e17('0x74')]){_0x99d0bd[_0x4e17('0x74')]=![];_0xa73c47[_0x4e17('0x28')][_0xa73c47[_0x4e17('0xec')][_0x39c2b0][_0x4e17('0xc0')]]=[];ami[_0x4e17('0x9e')]({'actionid':_0x39c2b0,'action':_0x4e17('0x1e0'),'queue':_0x99d0bd[_0x4e17('0x60')]})['catch'](function(){_0xa73c47['updateOriginated'](_0x99d0bd);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0xa73c47[_0x4e17('0xec')][_0x39c2b0][_0x4e17('0xdb')],'ListId':_0xa73c47[_0x4e17('0xec')][_0x39c2b0][_0x4e17('0xdc')],'VoiceQueueId':_0xa73c47[_0x4e17('0xec')][_0x39c2b0][_0x4e17('0xdd')]||undefined,'CampaignId':_0xa73c47[_0x4e17('0xec')][_0x39c2b0][_0x4e17('0xde')]||undefined})['catch'](loggerCatch(_0x4e17('0x1e1')));delete _0xa73c47['actions'][_0x39c2b0];});}else{loggerBooked['info'](_0x4e17('0x1e2'),JSON[_0x4e17('0x76')](_0x99d0bd[_0x4e17('0x74')]),_0x4e17('0x1df'),_0x99d0bd[_0x4e17('0x60')]);_0xa73c47[_0x4e17('0xf8')](_0x99d0bd);hopperUtils[_0x4e17('0xd9')]({'active':![],'ContactId':_0xa73c47[_0x4e17('0xec')][_0x39c2b0][_0x4e17('0xdb')],'ListId':_0xa73c47[_0x4e17('0xec')][_0x39c2b0][_0x4e17('0xdc')],'VoiceQueueId':_0xa73c47[_0x4e17('0xec')][_0x39c2b0][_0x4e17('0xdd')]||undefined,'CampaignId':_0xa73c47['actions'][_0x39c2b0][_0x4e17('0xde')]||undefined})['catch'](loggerCatch(_0x4e17('0x1e1')));delete _0xa73c47[_0x4e17('0xec')][_0x39c2b0];}}else{return _0xa73c47[_0x4e17('0x155')](_0x99d0bd,_0x18e65b);}}else{if(utils[_0x4e17('0x5f')](undefined,_0x18e65b[_0x4e17('0x1e3')])<_0x99d0bd['dialRecallMeTimeout']*0x3c){if(_0x18e65b[_0x4e17('0x140')]&&!_0x18e65b[_0x4e17('0x140')][_0x4e17('0x1e4')]){_0xa73c47['preview'][_0x4e17('0xf6')](_0x18e65b['id'])[_0x4e17('0x1c')](function(){_0xa73c47[_0x4e17('0xf8')](_0x99d0bd);});}else{hopperUtils[_0x4e17('0x1e5')]({'active':![]},_0x18e65b['id'],0x1)[_0x4e17('0x1c')](function(){_0xa73c47[_0x4e17('0xf8')](_0x99d0bd);});}}else{_0x99d0bd[_0x4e17('0x1e6')]+=0x1;_0xa73c47[_0x4e17('0xf8')](_0x99d0bd);if(_0x99d0bd[_0x4e17('0x1e7')]){hopperUtils[_0x4e17('0xd9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x18e65b['ContactId'],'ListId':_0x18e65b['ListId'],'VoiceQueueId':_0x18e65b[_0x4e17('0xdd')]||undefined,'CampaignId':_0x18e65b[_0x4e17('0xde')]||undefined})['catch'](loggerCatch(_0x4e17('0x1e8')));hopperUtils['createHistory'](createObjHistory(_0x99d0bd,_0x18e65b,utils[_0x4e17('0x6b')][_0x4e17('0x1e9')],0x17,_0x4e17('0x1ea')))[_0x4e17('0xa5')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xa73c47[_0x4e17('0x14f')](createObjHistory(_0x99d0bd,_0x18e65b,utils[_0x4e17('0x6b')][_0x4e17('0x1eb')],0x16,_0x4e17('0x1ec')),_0x4e17('0x1ed'),'[Originate][HistoryRecallClose]');}}}}else{_0x99d0bd[_0x4e17('0x1ee')]+=0x1;_0xa73c47[_0x4e17('0x14f')](createObjHistory(_0x99d0bd,_0x18e65b,utils[_0x4e17('0x6b')][_0x4e17('0x1ef')],0xd,_0x4e17('0x1f0')),_0x4e17('0x1f1'),_0x4e17('0x1f2'));throw _0x4e17('0x1f3');}};};Dialer['prototype'][_0x4e17('0x1f4')]=function(_0x8418d4){var _0x52ab58=this;var _0x4bc5d3=_0x8418d4[_0x4e17('0x1f5')]-_0x8418d4[_0x4e17('0x82')]-_0x8418d4[_0x4e17('0x1f6')];emitCampaignSummary(_0x8418d4);if(_0x4bc5d3>0x0){if(_0x4bc5d3>this[_0x4e17('0x22')]){_0x4bc5d3=this['maxNumberOriginate'];}_0x8418d4['temp']+=_0x4bc5d3;hopperUtils[_0x4e17('0x1f7')](_0x8418d4,_0x4bc5d3)[_0x4e17('0x3b')](function(_0x4529b4){_0x8418d4[_0x4e17('0x1f6')]-=_0x4bc5d3;_0x8418d4[_0x4e17('0x1f6')]=_0x8418d4[_0x4e17('0x1f6')]>0x0?_0x8418d4[_0x4e17('0x1f6')]:0x0;if(!utils[_0x4e17('0x1f8')](_0x4529b4)){_0x8418d4[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x6f')];logger[_0x4e17('0x44')](_0x4e17('0x1f9')+_0x8418d4[_0x4e17('0x60')]);}else{_0x8418d4['originated']+=_0x4529b4[_0x4e17('0x9c')];_0x8418d4['message']=utils['CAMPAIGN_STATUS'][_0x4e17('0x1fa')];for(var _0x45ae6e=0x0;_0x45ae6e<_0x4529b4[_0x4e17('0x9c')];_0x45ae6e+=0x1){_0x8418d4['ivrTotalCallsDays']+=0x1;if(_[_0x4e17('0xf4')](_0x4529b4[_0x45ae6e])||_[_0x4e17('0xf4')](_0x4529b4[_0x45ae6e][_0x4e17('0x16e')])||_[_0x4e17('0xf4')](_0x4529b4[_0x45ae6e][_0x4e17('0x158')])){_0x52ab58[_0x4e17('0x14d')](_0x4e17('0x1fb'),_0x8418d4,_0x4529b4[_0x45ae6e]);}else{hopperUtils[_0x4e17('0x1fc')](_[_0x4e17('0x77')](_0x4529b4[_0x45ae6e],[_0x4e17('0xde'),'phone']))[_0x4e17('0x3b')](_0x52ab58[_0x4e17('0x1dc')](_0x8418d4,_0x4529b4[_0x45ae6e]))[_0x4e17('0xa5')](_0x52ab58[_0x4e17('0x1fd')](_0x4e17('0x1fe'),_0x8418d4));}}}})[_0x4e17('0xa5')](loggerGetContactDialer(_0x4e17('0x1ff'),_0x8418d4,_0x4bc5d3));}};Dialer[_0x4e17('0x1a')][_0x4e17('0xb8')]=function(_0x36f03a,_0x4fc151){var _0x44133b=this;var _0x554af1=[];if(_0x4fc151<0x1||_0x36f03a['dialMethod']===_0x4e17('0xba')){_0x4fc151=0x1;}var _0x119009=Math[_0x4e17('0x1bb')](_0x36f03a['available']*_0x4fc151)-_0x36f03a[_0x4e17('0x82')]-_0x36f03a['temp'];if(_0x36f03a[_0x4e17('0x200')]>0x0){var _0x4eb232=_0x36f03a[_0x4e17('0x200')]-_0x36f03a[_0x4e17('0x82')]-_0x36f03a['talking']-_0x36f03a['temp']-_0x36f03a[_0x4e17('0x134')];if(_0x119009>_0x4eb232){_0x119009=_0x4eb232;}}if(_0x119009>0x0){if(_0x36f03a['dialMethod']===_0x4e17('0xba')){_0x119009=0x1;}if(_0x119009>this[_0x4e17('0x22')]){_0x119009=this[_0x4e17('0x22')];}_0x36f03a[_0x4e17('0x1f6')]+=_0x119009;for(var _0x45b1b2 in this[_0x4e17('0x20')]){if(typeof this[_0x4e17('0x20')][_0x45b1b2]!==_0x4e17('0xae')){if(this[_0x4e17('0x20')][_0x45b1b2][_0x4e17('0x70')]===_0x4e17('0x201')&&this[_0x4e17('0x20')][_0x45b1b2][_0x4e17('0x8d')]===_0x4e17('0x8c')){_0x554af1['push'](this['agents'][_0x45b1b2]['id']);}}}hopperUtils[_0x4e17('0x202')](_0x36f03a,_0x554af1,_0x119009)[_0x4e17('0x3b')](function(_0x2c81ed){_0x36f03a['temp']-=_0x119009;_0x36f03a['temp']=_0x36f03a[_0x4e17('0x1f6')]>0x0?_0x36f03a[_0x4e17('0x1f6')]:0x0;if(!utils[_0x4e17('0x1f8')](_0x2c81ed)){hopperUtils[_0x4e17('0x203')](_0x36f03a)['then'](sendMessageReschedule(_0x36f03a))[_0x4e17('0xa5')](loggerCatch('[countReScheduled]\x20'));}else{_0x36f03a['originated']+=_0x2c81ed['length'];_0x36f03a[_0x4e17('0x6a')]=_0x36f03a[_0x4e17('0xb6')]===_0x4e17('0xba')?utils[_0x4e17('0x6b')][_0x4e17('0x135')]:utils[_0x4e17('0x6b')][_0x4e17('0x1fa')];for(var _0x2a8236=0x0;_0x2a8236<_0x2c81ed['length'];_0x2a8236+=0x1){if(_['isNil'](_0x2c81ed[_0x2a8236])||_[_0x4e17('0xf4')](_0x2c81ed[_0x2a8236][_0x4e17('0x16e')])||_['isNil'](_0x2c81ed[_0x2a8236][_0x4e17('0x158')])){_0x44133b[_0x4e17('0x14d')](_0x4e17('0x1fb'),_0x36f03a,_0x2c81ed[_0x2a8236]);}else{hopperUtils['checkIsBlackList'](_[_0x4e17('0x77')](_0x2c81ed[_0x2a8236],[_0x4e17('0xdd'),_0x4e17('0x158')]))[_0x4e17('0x3b')](_0x44133b['checkContactBlack'](_0x36f03a,_0x2c81ed[_0x2a8236]))[_0x4e17('0xa5')](_0x44133b[_0x4e17('0x1fd')](_0x4e17('0x1fb'),_0x36f03a));}}}})[_0x4e17('0xa5')](loggerGetContactDialer(_0x4e17('0x204'),_0x36f03a,_0x119009));}};Dialer['prototype'][_0x4e17('0x64')]=function(_0x183a5f){if(_0x183a5f[_0x4e17('0x200')]>0x0){var _0x513fbf=_0x183a5f['dialLimitQueue']-_0x183a5f['originated']-_0x183a5f[_0x4e17('0x133')];if(_0x513fbf>0x0){this[_0x4e17('0x205')](_0x183a5f);}else{loggerPredictiveCalls['info'](_0x4e17('0x206'));}}else{this[_0x4e17('0x205')](_0x183a5f);}};Dialer[_0x4e17('0x1a')][_0x4e17('0x205')]=function(_0x3f0e53){var _0x6e1e10=this;var _0x188be0=[];_0x3f0e53[_0x4e17('0x82')]+=0x1;for(var _0x54eff6 in this[_0x4e17('0x20')]){if(typeof this['agents'][_0x54eff6]!==_0x4e17('0xae')){if(this[_0x4e17('0x20')][_0x54eff6][_0x4e17('0x70')]==='not_inuse'&&this[_0x4e17('0x20')][_0x54eff6][_0x4e17('0x8d')]===_0x4e17('0x8c')){_0x188be0[_0x4e17('0x9d')](this[_0x4e17('0x20')][_0x54eff6]['id']);}}}return this[_0x4e17('0x202')](_0x3f0e53['id'],_0x188be0,0x1,_0x3f0e53[_0x4e17('0x207')],_0x3f0e53)[_0x4e17('0x3b')](function(_0x8eea55){if(!utils['checkContactEmpty'](_0x8eea55)){utils['checkContactLowerLimitOriginate'](_0x3f0e53,0x1,0x0);return hopperUtils[_0x4e17('0x203')](_0x3f0e53)[_0x4e17('0x3b')](sendMessageReschedule(_0x3f0e53))[_0x4e17('0xa5')](loggerCatch(_0x4e17('0x208')));}else{_0x3f0e53[_0x4e17('0x6a')]=utils[_0x4e17('0x6b')][_0x4e17('0x1fa')];if(_[_0x4e17('0xf4')](_0x8eea55[0x0])||_['isNil'](_0x8eea55[0x0][_0x4e17('0x16e')])||_[_0x4e17('0xf4')](_0x8eea55[0x0][_0x4e17('0x158')])){_0x6e1e10['emptyContact'](_0x4e17('0x1fb'),_0x3f0e53,_0x8eea55[0x0]);}else{return hopperUtils[_0x4e17('0x209')](_[_0x4e17('0x77')](_0x8eea55[0x0],['VoiceQueueId',_0x4e17('0x158')]))[_0x4e17('0x3b')](_0x6e1e10['checkContactBlack'](_0x3f0e53,_0x8eea55[0x0]))[_0x4e17('0xa5')](_0x6e1e10['loggerHandler'](_0x4e17('0x20a'),_0x3f0e53));}}})[_0x4e17('0xa5')](loggerGetContactDialer(_0x4e17('0x20b'),_0x3f0e53,0x1));};Dialer[_0x4e17('0x1a')][_0x4e17('0x20c')]=function(_0x262f65,_0x115b5f,_0x113daf,_0x13510b,_0x3e8e2c,_0x24781c){loggerPredictive[_0x4e17('0x44')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x4e17('0x44')](_0x4e17('0x20d'),_0x262f65);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x20e'),_0x115b5f);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x113daf);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x20f'),_0x13510b);loggerPredictive[_0x4e17('0x44')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e8e2c);loggerPredictive['info']('---------------------------');return new Promise(function(_0x1246d6,_0x3e5719){if(_0x262f65<=0x0||isNaN(_0x262f65)){return _0x3e5719(msgResponse(_0x4e17('0x210'),_0x4e17('0x88'),_0x4e17('0x211')+_0x262f65));}if(_0x113daf<=0x0||isNaN(_0x113daf)){return _0x3e5719(msgResponse(_0x4e17('0x210'),_0x4e17('0x88'),'Ts\x20=\x20'+_0x113daf));}if(_0x13510b<=0x0||isNaN(_0x13510b)){return _0x3e5719(msgResponse('[abandonmentRate]',_0x4e17('0x88'),_0x4e17('0x212')+_0x13510b));}if(_0x115b5f<=0x0||isNaN(_0x115b5f)){return _0x3e5719(msgResponse('[abandonmentRate]',_0x4e17('0x88'),_0x4e17('0x213')+_0x115b5f));}if(_0x3e8e2c<=0x0||isNaN(_0x3e8e2c)){return _0x3e5719(msgResponse(_0x4e17('0x210'),'Error',_0x4e17('0x214')+_0x3e8e2c));}_0x24781c=_0x24781c||0x0;var _0xcc6787=0x1/_0x113daf;var _0x4ca7d8=0x0;var _0x222fc7=0x0;var _0x5a1922=0x0;var _0x758f6c=0x0;for(var _0x33242a=0x0;_0x5a1922<_0x3e8e2c;_0x33242a+=0x1){_0x222fc7=_0x33242a/_0x115b5f;_0x4ca7d8=(_0x13510b*_0x222fc7+_0x24781c)/_0xcc6787;_0x5a1922=utils['erlangb'](_0x4ca7d8,_0x262f65);_0x758f6c=_0x4ca7d8/_0x262f65*(0x1-utils[_0x4e17('0x215')](_0x4ca7d8,_0x262f65));}return _0x1246d6({'erlangCalls':_0x33242a,'erlangCallToSecond':_0x115b5f/_0x33242a,'erlangAbandonmentRate':_0x5a1922,'erlangBusyFactor':_0x758f6c});});};Dialer[_0x4e17('0x1a')][_0x4e17('0x1cf')]=function(_0x5d0c71,_0x109d2c,_0x38fcc3,_0x190dfa,_0x3f10b2,_0x40e3e5){loggerPredictive[_0x4e17('0x44')](_0x4e17('0x216'));loggerPredictive[_0x4e17('0x44')](_0x4e17('0x20d'),_0x5d0c71);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x20e'),_0x109d2c);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x217'),_0x38fcc3);loggerPredictive['info'](_0x4e17('0x20f'),_0x190dfa);loggerPredictive[_0x4e17('0x44')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3f10b2);loggerPredictive[_0x4e17('0x44')](_0x4e17('0x51'));return new Promise(function(_0x3c9244,_0x1f5e1d){if(_0x5d0c71<=0x0||isNaN(_0x5d0c71)){return _0x1f5e1d(msgResponse(_0x4e17('0x218'),'Error',_0x4e17('0x211')+_0x5d0c71));}if(_0x38fcc3<=0x0||isNaN(_0x38fcc3)){return _0x1f5e1d(msgResponse(_0x4e17('0x218'),_0x4e17('0x88'),_0x4e17('0x219')+_0x38fcc3));}if(_0x190dfa<=0x0||isNaN(_0x190dfa)){return _0x1f5e1d(msgResponse(_0x4e17('0x218'),_0x4e17('0x88'),_0x4e17('0x212')+_0x190dfa));}if(_0x109d2c<=0x0||isNaN(_0x109d2c)){return _0x1f5e1d(msgResponse(_0x4e17('0x218'),'Error',_0x4e17('0x213')+_0x109d2c));}if(_0x3f10b2<=0x0||isNaN(_0x3f10b2)){return _0x1f5e1d(msgResponse(_0x4e17('0x218'),'Error',_0x4e17('0x21a')+_0x3f10b2));}_0x40e3e5=_0x40e3e5||0x0;var _0x15db55=0x1/_0x38fcc3;var _0x1445fb=0x0;var _0x4cdba3=0x0;var _0x49ebdc=0x0;var _0x58953b=0x0;for(var _0x5ccba9=0x0;_0x58953b<_0x3f10b2;_0x5ccba9+=0x1){_0x4cdba3=_0x5ccba9/_0x109d2c;_0x1445fb=(_0x190dfa*_0x4cdba3+_0x40e3e5)/_0x15db55;_0x49ebdc=utils['erlangb'](_0x1445fb,_0x5d0c71);_0x58953b=_0x1445fb/_0x5d0c71*(0x1-utils[_0x4e17('0x215')](_0x1445fb,_0x5d0c71));}return _0x3c9244({'erlangCalls':_0x5ccba9,'erlangCallToSecond':_0x109d2c/_0x5ccba9,'erlangAbandonmentRate':_0x49ebdc,'erlangBusyFactor':_0x58953b});});};module[_0x4e17('0x21b')]=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 fbcc69f..0ab3cf2 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 _0xdfb9=['ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x471169,_0xdb1892){var _0x213a2d=function(_0x55f44f){while(--_0x55f44f){_0x471169['push'](_0x471169['shift']());}};_0x213a2d(++_0xdb1892);}(_0xdfb9,0x177));var _0x9dfb=function(_0x13a958,_0xa6326d){_0x13a958=_0x13a958-0x0;var _0x364e1f=_0xdfb9[_0x13a958];return _0x364e1f;};'use strict';var util=require(_0x9dfb('0x0'));var _=require(_0x9dfb('0x1'));var moment=require(_0x9dfb('0x2'));function checkNameSurname(_0x488c6f,_0xb93719,_0x71d3fa){var _0x36d5b8='';if(!_[_0x9dfb('0x3')](_0xb93719)&&_0x9dfb('0x4')===typeof _0xb93719){_0x36d5b8+=_0xb93719;}if(!_[_0x9dfb('0x3')](_0x71d3fa)&&'string'===typeof _0x71d3fa){_0x36d5b8+='\x20'+_0x71d3fa;}if(_0x36d5b8!==''){return _0x36d5b8;}return _0x488c6f;}function Action(_0x35f47d,_0x44cc92,_0x21d661){this[_0x9dfb('0x5')]=_0x35f47d;this[_0x9dfb('0x6')]=_0x21d661||undefined;this[_0x9dfb('0x7')]=checkNameSurname(_0x44cc92[_0x9dfb('0x8')][_0x9dfb('0x9')],_0x44cc92[_0x9dfb('0x8')][_0x9dfb('0xa')],_0x44cc92[_0x9dfb('0x8')]['lastName']);this[_0x9dfb('0xb')]=_0x44cc92[_0x9dfb('0x9')];this[_0x9dfb('0xc')]=_0x35f47d[_0x9dfb('0x7')];this[_0x9dfb('0xd')]=_0x44cc92[_0x9dfb('0xd')]||![];this[_0x9dfb('0xe')]=_0x35f47d[_0x9dfb('0xe')];this[_0x9dfb('0xf')]=_0x35f47d['dialQueueTimeout']||0x3;this[_0x9dfb('0x10')]=_0x44cc92[_0x9dfb('0x10')];this[_0x9dfb('0x11')]=_0x44cc92[_0x9dfb('0x11')];this[_0x9dfb('0x12')]=_0x44cc92[_0x9dfb('0x12')];this[_0x9dfb('0x13')]=_0x44cc92[_0x9dfb('0x13')];this[_0x9dfb('0x14')]=_0x44cc92[_0x9dfb('0x14')];this[_0x9dfb('0x15')]=_0x44cc92[_0x9dfb('0x15')];this[_0x9dfb('0x16')]=_0x44cc92[_0x9dfb('0x16')];this[_0x9dfb('0x17')]=_0x44cc92[_0x9dfb('0x17')];this[_0x9dfb('0x18')]=_0x44cc92['countagentrejectretry'];this[_0x9dfb('0x19')]=_0x44cc92[_0x9dfb('0x19')];this[_0x9dfb('0x1a')]=_0x44cc92[_0x9dfb('0x1a')];this[_0x9dfb('0x1b')]=_0x44cc92['UserId'];this[_0x9dfb('0x1c')]=_0x44cc92[_0x9dfb('0x1c')];this[_0x9dfb('0x1d')]=_0x44cc92[_0x9dfb('0x1d')];this['idHopper']=_0x44cc92['id'];this[_0x9dfb('0x1e')]=_0x44cc92[_0x9dfb('0x8')]['firstName']||'';this['starttime']=moment()['format'](_0x9dfb('0x1f'));this['callback']=_0x44cc92[_0x9dfb('0x20')];this[_0x9dfb('0x21')]=_0x44cc92[_0x9dfb('0x21')];this[_0x9dfb('0x22')]=_0x44cc92[_0x9dfb('0x22')];this[_0x9dfb('0x23')]=_0x44cc92[_0x9dfb('0x23')];this[_0x9dfb('0x24')]='';this['originatecalleridname']='';}Action[_0x9dfb('0x25')][_0x9dfb('0x26')]=function(){return util[_0x9dfb('0x27')](_0x9dfb('0x28'),this[_0x9dfb('0x7')],this['voiceQueue'][_0x9dfb('0x29')]>0x0?this['number'][_0x9dfb('0x2a')](this[_0x9dfb('0x5')]['dialCutDigit']):this[_0x9dfb('0xb')]);};Action[_0x9dfb('0x25')][_0x9dfb('0x2b')]=function(){return this['queue'];};module[_0x9dfb('0x2c')]=Action; \ No newline at end of file +var _0x2d81=['voiceQueue','uniqueid','name','firstName','Contact','lastName','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','number','substring','getQueue','moment','isNil','string'];(function(_0x1c9fc4,_0x1654cb){var _0x5b9763=function(_0x48e36d){while(--_0x48e36d){_0x1c9fc4['push'](_0x1c9fc4['shift']());}};_0x5b9763(++_0x1654cb);}(_0x2d81,0x1ab));var _0x12d8=function(_0x338e51,_0x26291c){_0x338e51=_0x338e51-0x0;var _0x552ad5=_0x2d81[_0x338e51];return _0x552ad5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x12d8('0x0'));function checkNameSurname(_0x5d3314,_0x40feb2,_0x4121c0){var _0x4cc149='';if(!_[_0x12d8('0x1')](_0x40feb2)&&_0x12d8('0x2')===typeof _0x40feb2){_0x4cc149+=_0x40feb2;}if(!_['isNil'](_0x4121c0)&&'string'===typeof _0x4121c0){_0x4cc149+='\x20'+_0x4121c0;}if(_0x4cc149!==''){return _0x4cc149;}return _0x5d3314;}function Action(_0x5451b0,_0x8a9711,_0x32a48b){this[_0x12d8('0x3')]=_0x5451b0;this[_0x12d8('0x4')]=_0x32a48b||undefined;this[_0x12d8('0x5')]=checkNameSurname(_0x8a9711['Contact']['phone'],_0x8a9711['Contact'][_0x12d8('0x6')],_0x8a9711[_0x12d8('0x7')][_0x12d8('0x8')]);this['number']=_0x8a9711[_0x12d8('0x9')];this[_0x12d8('0xa')]=_0x5451b0[_0x12d8('0x5')];this[_0x12d8('0xb')]=_0x8a9711[_0x12d8('0xb')]||![];this[_0x12d8('0xc')]=_0x5451b0[_0x12d8('0xc')];this[_0x12d8('0xd')]=_0x5451b0['dialQueueTimeout']||0x3;this['scheduledat']=_0x8a9711[_0x12d8('0xe')];this[_0x12d8('0xf')]=_0x8a9711[_0x12d8('0xf')];this[_0x12d8('0x10')]=_0x8a9711[_0x12d8('0x10')];this[_0x12d8('0x11')]=_0x8a9711['countnoanswerretry'];this[_0x12d8('0x12')]=_0x8a9711['countnosuchnumberretry'];this[_0x12d8('0x13')]=_0x8a9711[_0x12d8('0x13')];this[_0x12d8('0x14')]=_0x8a9711[_0x12d8('0x14')];this['countmachineretry']=_0x8a9711[_0x12d8('0x15')];this['countagentrejectretry']=_0x8a9711['countagentrejectretry'];this[_0x12d8('0x16')]=_0x8a9711[_0x12d8('0x16')];this[_0x12d8('0x17')]=_0x8a9711[_0x12d8('0x17')];this[_0x12d8('0x18')]=_0x8a9711[_0x12d8('0x18')];this[_0x12d8('0x19')]=_0x8a9711[_0x12d8('0x19')];this['CampaignId']=_0x8a9711[_0x12d8('0x1a')];this[_0x12d8('0x1b')]=_0x8a9711['id'];this['ContactFirstName']=_0x8a9711['Contact'][_0x12d8('0x6')]||'';this[_0x12d8('0x1c')]=moment()[_0x12d8('0x1d')](_0x12d8('0x1e'));this[_0x12d8('0x1f')]=_0x8a9711[_0x12d8('0x1f')];this[_0x12d8('0x20')]=_0x8a9711[_0x12d8('0x20')];this[_0x12d8('0x21')]=_0x8a9711[_0x12d8('0x21')];this[_0x12d8('0x22')]=_0x8a9711[_0x12d8('0x22')];this[_0x12d8('0x23')]='';this[_0x12d8('0x24')]='';}Action[_0x12d8('0x25')][_0x12d8('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0x12d8('0x27')]>0x0?this[_0x12d8('0x28')][_0x12d8('0x29')](this['voiceQueue']['dialCutDigit']):this[_0x12d8('0x28')]);};Action['prototype'][_0x12d8('0x2a')]=function(){return this[_0x12d8('0xa')];};module['exports']=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 050bf9e..8790d45 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 _0x8fc1=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','talktime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x8fc1,0x15d));var _0x18fc=function(_0x434795,_0x416b99){_0x434795=_0x434795-0x0;var _0x491b5d=_0x8fc1[_0x434795];return _0x491b5d;};'use strict';var moment=require(_0x18fc('0x0'));var utils=require(_0x18fc('0x1'));function AgentComplete(_0x2d3f88,_0x43591c){this[_0x18fc('0x2')]=0x4;this['statedesc']=_0x18fc('0x3');this[_0x18fc('0x4')]=_0x2d3f88[_0x18fc('0x4')];this[_0x18fc('0x5')]=_0x2d3f88[_0x18fc('0x5')];this[_0x18fc('0x6')]=_0x2d3f88[_0x18fc('0x5')]===_0x18fc('0x7')?_0x18fc('0x8'):_0x2d3f88['type'];this[_0x18fc('0x9')]=_0x2d3f88[_0x18fc('0x9')];this[_0x18fc('0xa')]=_0x2d3f88[_0x18fc('0xa')];this['countnoanswerretry']=_0x2d3f88[_0x18fc('0xb')];this[_0x18fc('0xc')]=_0x2d3f88['countbusyretry']+_0x2d3f88[_0x18fc('0xa')]+_0x2d3f88[_0x18fc('0xb')]+_0x2d3f88[_0x18fc('0xd')]+_0x2d3f88[_0x18fc('0xe')]+_0x2d3f88[_0x18fc('0xf')]+_0x2d3f88[_0x18fc('0x10')]+_0x2d3f88[_0x18fc('0x11')];this[_0x18fc('0xd')]=_0x2d3f88['countnosuchnumberretry'];this[_0x18fc('0xe')]=_0x2d3f88[_0x18fc('0xe')];this[_0x18fc('0xf')]=_0x2d3f88[_0x18fc('0xf')];this[_0x18fc('0x10')]=_0x2d3f88[_0x18fc('0x10')];this[_0x18fc('0x11')]=_0x2d3f88['countagentrejectretry'];this['uniqueid']=_0x43591c['uniqueid'];this[_0x18fc('0x12')]=_0x2d3f88[_0x18fc('0x13')];this[_0x18fc('0x14')]=_0x2d3f88[_0x18fc('0x15')];this['starttime']=_0x2d3f88[_0x18fc('0x16')];this[_0x18fc('0x17')]=_0x2d3f88['responsetime'];this[_0x18fc('0x18')]=_0x2d3f88[_0x18fc('0x18')];this[_0x18fc('0x19')]=moment()[_0x18fc('0x1a')](_0x18fc('0x1b'));this[_0x18fc('0x1c')]=utils['getSeconds'](_0x2d3f88[_0x18fc('0x17')],_0x2d3f88['starttime']);this[_0x18fc('0x1d')]=utils[_0x18fc('0x1e')](_0x2d3f88[_0x18fc('0x18')],_0x2d3f88[_0x18fc('0x17')]);this[_0x18fc('0x1f')]=utils[_0x18fc('0x1e')](this[_0x18fc('0x19')],_0x2d3f88['answertime']);this[_0x18fc('0x8')]=_0x43591c['queue'];this[_0x18fc('0x20')]=_0x43591c[_0x18fc('0x20')];this[_0x18fc('0x21')]=_0x43591c[_0x18fc('0x21')];this['callback']=_0x2d3f88['callback'];this[_0x18fc('0x22')]=_0x2d3f88[_0x18fc('0x22')];this[_0x18fc('0x23')]=_0x2d3f88['callbackat'];this['recallme']=_0x2d3f88[_0x18fc('0x24')];this[_0x18fc('0x25')]=_0x2d3f88[_0x18fc('0x25')];this['ListId']=_0x2d3f88[_0x18fc('0x26')];this[_0x18fc('0x27')]=_0x2d3f88[_0x18fc('0x27')];this[_0x18fc('0x28')]=_0x2d3f88[_0x18fc('0x28')];this[_0x18fc('0x29')]=_0x2d3f88[_0x18fc('0x29')];this[_0x18fc('0x2a')]=_0x2d3f88[_0x18fc('0x2a')]||'';this[_0x18fc('0x2b')]=_0x2d3f88[_0x18fc('0x2b')]||'';this['agiafterat']=_0x2d3f88['agiafterat'];}module[_0x18fc('0x2c')]=AgentComplete; \ No newline at end of file +var _0x7a9c=['callback','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','talktime','membername','reason'];(function(_0x40cf20,_0x3b5733){var _0x58dbd3=function(_0x1b5b15){while(--_0x1b5b15){_0x40cf20['push'](_0x40cf20['shift']());}};_0x58dbd3(++_0x3b5733);}(_0x7a9c,0x197));var _0xc7a9=function(_0x1c208e,_0x2a0a5b){_0x1c208e=_0x1c208e-0x0;var _0x5104ff=_0x7a9c[_0x1c208e];return _0x5104ff;};'use strict';var moment=require('moment');var utils=require(_0xc7a9('0x0'));function AgentComplete(_0x714b3,_0xf76a96){this[_0xc7a9('0x1')]=0x4;this[_0xc7a9('0x2')]='Answer';this[_0xc7a9('0x3')]=_0x714b3[_0xc7a9('0x3')];this[_0xc7a9('0x4')]=_0x714b3[_0xc7a9('0x4')];this[_0xc7a9('0x5')]=_0x714b3[_0xc7a9('0x4')]===_0xc7a9('0x6')?_0xc7a9('0x7'):_0x714b3['type'];this[_0xc7a9('0x8')]=_0x714b3[_0xc7a9('0x8')];this['countcongestionretry']=_0x714b3[_0xc7a9('0x9')];this[_0xc7a9('0xa')]=_0x714b3['countnoanswerretry'];this[_0xc7a9('0xb')]=_0x714b3[_0xc7a9('0x8')]+_0x714b3['countcongestionretry']+_0x714b3['countnoanswerretry']+_0x714b3[_0xc7a9('0xc')]+_0x714b3[_0xc7a9('0xd')]+_0x714b3['countabandonedretry']+_0x714b3[_0xc7a9('0xe')]+_0x714b3[_0xc7a9('0xf')];this[_0xc7a9('0xc')]=_0x714b3[_0xc7a9('0xc')];this[_0xc7a9('0xd')]=_0x714b3[_0xc7a9('0xd')];this[_0xc7a9('0x10')]=_0x714b3['countabandonedretry'];this['countmachineretry']=_0x714b3[_0xc7a9('0xe')];this[_0xc7a9('0xf')]=_0x714b3[_0xc7a9('0xf')];this['uniqueid']=_0xf76a96[_0xc7a9('0x11')];this[_0xc7a9('0x12')]=_0x714b3['name'];this[_0xc7a9('0x13')]=_0x714b3[_0xc7a9('0x14')];this[_0xc7a9('0x15')]=_0x714b3[_0xc7a9('0x15')];this[_0xc7a9('0x16')]=_0x714b3['responsetime'];this[_0xc7a9('0x17')]=_0x714b3[_0xc7a9('0x17')];this[_0xc7a9('0x18')]=moment()[_0xc7a9('0x19')](_0xc7a9('0x1a'));this[_0xc7a9('0x1b')]=utils['getSeconds'](_0x714b3[_0xc7a9('0x16')],_0x714b3[_0xc7a9('0x15')]);this[_0xc7a9('0x1c')]=utils[_0xc7a9('0x1d')](_0x714b3[_0xc7a9('0x17')],_0x714b3[_0xc7a9('0x16')]);this[_0xc7a9('0x1e')]=utils[_0xc7a9('0x1d')](this[_0xc7a9('0x18')],_0x714b3['answertime']);this[_0xc7a9('0x7')]=_0xf76a96[_0xc7a9('0x7')];this[_0xc7a9('0x1f')]=_0xf76a96[_0xc7a9('0x1f')];this[_0xc7a9('0x20')]=_0xf76a96[_0xc7a9('0x20')];this[_0xc7a9('0x21')]=_0x714b3[_0xc7a9('0x21')];this['callbackuniqueid']=_0x714b3['callbackuniqueid'];this['callbackat']=_0x714b3[_0xc7a9('0x22')];this['recallme']=_0x714b3[_0xc7a9('0x23')];this['ContactId']=_0x714b3['ContactId'];this[_0xc7a9('0x24')]=_0x714b3[_0xc7a9('0x24')];this[_0xc7a9('0x25')]=_0x714b3[_0xc7a9('0x25')];this['VoiceQueueId']=_0x714b3[_0xc7a9('0x26')];this[_0xc7a9('0x27')]=_0x714b3['CampaignId'];this[_0xc7a9('0x28')]=_0x714b3[_0xc7a9('0x28')]||'';this[_0xc7a9('0x29')]=_0x714b3[_0xc7a9('0x29')]||'';this[_0xc7a9('0x2a')]=_0x714b3[_0xc7a9('0x2a')];}module[_0xc7a9('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 db2787d..7c78d5a 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 _0xd81a=['uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports'];(function(_0x4332c4,_0x29861d){var _0x2e57bb=function(_0x45198d){while(--_0x45198d){_0x4332c4['push'](_0x4332c4['shift']());}};_0x2e57bb(++_0x29861d);}(_0xd81a,0x174));var _0xad81=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xd81a[_0x465028];return _0xb783d4;};'use strict';function Final(_0x5a67cf){this['uniqueid']=_0x5a67cf[_0xad81('0x0')];this[_0xad81('0x1')]=_0x5a67cf['scheduledat'];this[_0xad81('0x2')]=_0x5a67cf[_0xad81('0x2')];this['campaigntype']=_0x5a67cf[_0xad81('0x2')]===_0xad81('0x3')?'queue':_0x5a67cf['type'];this[_0xad81('0x4')]=_0x5a67cf['countbusyretry'];this[_0xad81('0x5')]=_0x5a67cf[_0xad81('0x5')];this[_0xad81('0x6')]=_0x5a67cf[_0xad81('0x6')];this[_0xad81('0x7')]=_0x5a67cf[_0xad81('0x4')]+_0x5a67cf['countcongestionretry']+_0x5a67cf['countnoanswerretry']+_0x5a67cf['countnosuchnumberretry']+_0x5a67cf[_0xad81('0x8')]+_0x5a67cf[_0xad81('0x9')]+_0x5a67cf['countmachineretry']+_0x5a67cf[_0xad81('0xa')];this[_0xad81('0xb')]=_0x5a67cf[_0xad81('0xb')];this[_0xad81('0x8')]=_0x5a67cf[_0xad81('0x8')];this[_0xad81('0x9')]=_0x5a67cf[_0xad81('0x9')];this[_0xad81('0xc')]=_0x5a67cf[_0xad81('0xc')];this[_0xad81('0xa')]=_0x5a67cf['countagentrejectretry'];this[_0xad81('0xd')]=_0x5a67cf['queue'];this[_0xad81('0xe')]=_0x5a67cf[_0xad81('0xe')];this[_0xad81('0xf')]=_0x5a67cf[_0xad81('0xf')];this[_0xad81('0x10')]=_0x5a67cf[_0xad81('0x10')];this['responsetime']=_0x5a67cf[_0xad81('0x11')];this['endtime']=_0x5a67cf['responsetime'];this['ringtime']=_0x5a67cf[_0xad81('0x12')]||0x0;this['holdtime']=_0x5a67cf[_0xad81('0x13')]||0x0;this[_0xad81('0x14')]=_0x5a67cf['talktime']||0x0;this['callback']=_0x5a67cf['callback'];this[_0xad81('0x15')]=_0x5a67cf[_0xad81('0x15')];this['callbackat']=_0x5a67cf[_0xad81('0x16')];this['recallme']=_0x5a67cf['recallme'];this['ContactId']=_0x5a67cf['ContactId'];this[_0xad81('0x17')]=_0x5a67cf[_0xad81('0x17')];this['UserId']=_0x5a67cf[_0xad81('0x18')];this['VoiceQueueId']=_0x5a67cf['VoiceQueueId'];this[_0xad81('0x19')]=_0x5a67cf[_0xad81('0x19')];this[_0xad81('0x1a')]=_0x5a67cf[_0xad81('0x1a')]||'';this[_0xad81('0x1b')]=_0x5a67cf['originatecalleridname']||'';this[_0xad81('0x1c')]=_0x5a67cf[_0xad81('0x1c')];this[_0xad81('0x1d')]=_0x5a67cf['statedesc'];}module[_0xad81('0x1e')]=Final; \ No newline at end of file +var _0xddc2=['countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x5beb3b,_0x493142){var _0x44aa86=function(_0x822a50){while(--_0x822a50){_0x5beb3b['push'](_0x5beb3b['shift']());}};_0x44aa86(++_0x493142);}(_0xddc2,0xa2));var _0x2ddc=function(_0x2b92f9,_0x5889c0){_0x2b92f9=_0x2b92f9-0x0;var _0x2937fb=_0xddc2[_0x2b92f9];return _0x2937fb;};'use strict';function Final(_0x51b90a){this[_0x2ddc('0x0')]=_0x51b90a[_0x2ddc('0x0')];this[_0x2ddc('0x1')]=_0x51b90a[_0x2ddc('0x1')];this[_0x2ddc('0x2')]=_0x51b90a[_0x2ddc('0x2')];this[_0x2ddc('0x3')]=_0x51b90a[_0x2ddc('0x2')]===_0x2ddc('0x4')?'queue':_0x51b90a['type'];this['countbusyretry']=_0x51b90a['countbusyretry'];this['countcongestionretry']=_0x51b90a[_0x2ddc('0x5')];this[_0x2ddc('0x6')]=_0x51b90a[_0x2ddc('0x6')];this[_0x2ddc('0x7')]=_0x51b90a[_0x2ddc('0x8')]+_0x51b90a[_0x2ddc('0x5')]+_0x51b90a[_0x2ddc('0x6')]+_0x51b90a[_0x2ddc('0x9')]+_0x51b90a[_0x2ddc('0xa')]+_0x51b90a[_0x2ddc('0xb')]+_0x51b90a['countmachineretry']+_0x51b90a[_0x2ddc('0xc')];this[_0x2ddc('0x9')]=_0x51b90a[_0x2ddc('0x9')];this[_0x2ddc('0xa')]=_0x51b90a[_0x2ddc('0xa')];this[_0x2ddc('0xb')]=_0x51b90a[_0x2ddc('0xb')];this[_0x2ddc('0xd')]=_0x51b90a[_0x2ddc('0xd')];this['countagentrejectretry']=_0x51b90a[_0x2ddc('0xc')];this['queue']=_0x51b90a[_0x2ddc('0xe')];this[_0x2ddc('0xf')]=_0x51b90a[_0x2ddc('0xf')];this[_0x2ddc('0x10')]=_0x51b90a['calleridnum'];this[_0x2ddc('0x11')]=_0x51b90a['starttime'];this[_0x2ddc('0x12')]=_0x51b90a[_0x2ddc('0x12')];this['endtime']=_0x51b90a['responsetime'];this[_0x2ddc('0x13')]=_0x51b90a[_0x2ddc('0x13')]||0x0;this['holdtime']=_0x51b90a['holdtime']||0x0;this['talktime']=_0x51b90a['talktime']||0x0;this[_0x2ddc('0x14')]=_0x51b90a['callback'];this['callbackuniqueid']=_0x51b90a[_0x2ddc('0x15')];this[_0x2ddc('0x16')]=_0x51b90a[_0x2ddc('0x16')];this['recallme']=_0x51b90a[_0x2ddc('0x17')];this[_0x2ddc('0x18')]=_0x51b90a[_0x2ddc('0x18')];this[_0x2ddc('0x19')]=_0x51b90a['ListId'];this['UserId']=_0x51b90a[_0x2ddc('0x1a')];this[_0x2ddc('0x1b')]=_0x51b90a['VoiceQueueId'];this[_0x2ddc('0x1c')]=_0x51b90a[_0x2ddc('0x1c')];this[_0x2ddc('0x1d')]=_0x51b90a['originatecalleridnum']||'';this[_0x2ddc('0x1e')]=_0x51b90a[_0x2ddc('0x1e')]||'';this[_0x2ddc('0x1f')]=_0x51b90a[_0x2ddc('0x1f')];this[_0x2ddc('0x20')]=_0x51b90a[_0x2ddc('0x20')];}module[_0x2ddc('0x21')]=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 b7368ce..3b01488 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 _0x5f95=['queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','CampaignId','../utils','statedesc','scheduledat','type','campaigntype','outbound'];(function(_0x12cd8f,_0x4bed51){var _0x3f054e=function(_0x474bc3){while(--_0x474bc3){_0x12cd8f['push'](_0x12cd8f['shift']());}};_0x3f054e(++_0x4bed51);}(_0x5f95,0x1b6));var _0x55f9=function(_0x24833f,_0x307994){_0x24833f=_0x24833f-0x0;var _0x150f47=_0x5f95[_0x24833f];return _0x150f47;};'use strict';var moment=require('moment');var utils=require(_0x55f9('0x0'));function Hangup(_0x1383e6,_0x3ad1e5){this['state']=0x4;this[_0x55f9('0x1')]='Answer';this[_0x55f9('0x2')]=_0x1383e6[_0x55f9('0x2')];this['type']=_0x1383e6[_0x55f9('0x3')];this[_0x55f9('0x4')]=_0x1383e6[_0x55f9('0x3')]===_0x55f9('0x5')?_0x55f9('0x6'):_0x1383e6[_0x55f9('0x3')];this['amd']=_0x1383e6[_0x55f9('0x7')]||![];this['countbusyretry']=_0x1383e6[_0x55f9('0x8')];this['countcongestionretry']=_0x1383e6[_0x55f9('0x9')];this['countnoanswerretry']=_0x1383e6[_0x55f9('0xa')];this['countglobal']=_0x1383e6['countbusyretry']+_0x1383e6[_0x55f9('0x9')]+_0x1383e6[_0x55f9('0xa')]+_0x1383e6[_0x55f9('0xb')]+_0x1383e6['countdropretry']+_0x1383e6['countabandonedretry']+_0x1383e6[_0x55f9('0xc')]+_0x1383e6['countagentrejectretry'];this[_0x55f9('0xb')]=_0x1383e6[_0x55f9('0xb')];this[_0x55f9('0xd')]=_0x1383e6[_0x55f9('0xd')];this[_0x55f9('0xe')]=_0x1383e6[_0x55f9('0xe')];this[_0x55f9('0xc')]=_0x1383e6[_0x55f9('0xc')];this[_0x55f9('0xf')]=_0x1383e6[_0x55f9('0xf')];this[_0x55f9('0x10')]=_0x3ad1e5[_0x55f9('0x10')];this['calleridname']=_0x1383e6['name'];this[_0x55f9('0x11')]=_0x1383e6[_0x55f9('0x12')];this[_0x55f9('0x13')]=_0x1383e6[_0x55f9('0x13')];this[_0x55f9('0x14')]=_0x1383e6[_0x55f9('0x14')];this['endtime']=moment()[_0x55f9('0x15')](_0x55f9('0x16'));this[_0x55f9('0x17')]=utils['getSeconds'](_0x1383e6['responsetime'],_0x1383e6[_0x55f9('0x13')]);this[_0x55f9('0x18')]=0x0;this['talktime']=utils['getSeconds'](this[_0x55f9('0x19')],_0x1383e6[_0x55f9('0x14')]);this['queue']=_0x1383e6[_0x55f9('0x6')];this[_0x55f9('0x1a')]=_0x55f9('0x1b');this[_0x55f9('0x1c')]=_0x3ad1e5[_0x55f9('0x1d')];this[_0x55f9('0x1e')]=_0x1383e6['callback'];this['callbackuniqueid']=_0x1383e6[_0x55f9('0x1f')];this['callbackat']=_0x1383e6[_0x55f9('0x20')];this[_0x55f9('0x21')]=_0x1383e6[_0x55f9('0x21')];this['ContactId']=_0x1383e6['ContactId'];this[_0x55f9('0x22')]=_0x1383e6['ListId'];this[_0x55f9('0x23')]=_0x1383e6['UserId'];this['VoiceQueueId']=_0x1383e6['VoiceQueueId'];this[_0x55f9('0x24')]=_0x1383e6[_0x55f9('0x24')];}module['exports']=Hangup; \ No newline at end of file +var _0xe951=['endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x5c67a9,_0x14f104){var _0x5a1979=function(_0x3c6116){while(--_0x3c6116){_0x5c67a9['push'](_0x5c67a9['shift']());}};_0x5a1979(++_0x14f104);}(_0xe951,0x10d));var _0x1e95=function(_0x12f59c,_0x13d956){_0x12f59c=_0x12f59c-0x0;var _0x2db43e=_0xe951[_0x12f59c];return _0x2db43e;};'use strict';var moment=require('moment');var utils=require(_0x1e95('0x0'));function Hangup(_0x139557,_0x59e466){this[_0x1e95('0x1')]=0x4;this[_0x1e95('0x2')]=_0x1e95('0x3');this[_0x1e95('0x4')]=_0x139557[_0x1e95('0x4')];this['type']=_0x139557['type'];this['campaigntype']=_0x139557[_0x1e95('0x5')]===_0x1e95('0x6')?_0x1e95('0x7'):_0x139557[_0x1e95('0x5')];this[_0x1e95('0x8')]=_0x139557[_0x1e95('0x8')]||![];this[_0x1e95('0x9')]=_0x139557['countbusyretry'];this[_0x1e95('0xa')]=_0x139557[_0x1e95('0xa')];this[_0x1e95('0xb')]=_0x139557[_0x1e95('0xb')];this[_0x1e95('0xc')]=_0x139557[_0x1e95('0x9')]+_0x139557['countcongestionretry']+_0x139557[_0x1e95('0xb')]+_0x139557[_0x1e95('0xd')]+_0x139557[_0x1e95('0xe')]+_0x139557['countabandonedretry']+_0x139557[_0x1e95('0xf')]+_0x139557[_0x1e95('0x10')];this[_0x1e95('0xd')]=_0x139557['countnosuchnumberretry'];this['countdropretry']=_0x139557['countdropretry'];this[_0x1e95('0x11')]=_0x139557[_0x1e95('0x11')];this[_0x1e95('0xf')]=_0x139557[_0x1e95('0xf')];this[_0x1e95('0x10')]=_0x139557[_0x1e95('0x10')];this[_0x1e95('0x12')]=_0x59e466['uniqueid'];this[_0x1e95('0x13')]=_0x139557[_0x1e95('0x14')];this[_0x1e95('0x15')]=_0x139557[_0x1e95('0x16')];this[_0x1e95('0x17')]=_0x139557['starttime'];this[_0x1e95('0x18')]=_0x139557[_0x1e95('0x18')];this[_0x1e95('0x19')]=moment()['format'](_0x1e95('0x1a'));this[_0x1e95('0x1b')]=utils[_0x1e95('0x1c')](_0x139557['responsetime'],_0x139557[_0x1e95('0x17')]);this[_0x1e95('0x1d')]=0x0;this[_0x1e95('0x1e')]=utils[_0x1e95('0x1c')](this[_0x1e95('0x19')],_0x139557[_0x1e95('0x18')]);this[_0x1e95('0x7')]=_0x139557[_0x1e95('0x7')];this['membername']=_0x1e95('0x1f');this['reason']=_0x59e466[_0x1e95('0x20')];this[_0x1e95('0x21')]=_0x139557[_0x1e95('0x21')];this[_0x1e95('0x22')]=_0x139557['callbackuniqueid'];this['callbackat']=_0x139557[_0x1e95('0x23')];this['recallme']=_0x139557[_0x1e95('0x24')];this[_0x1e95('0x25')]=_0x139557[_0x1e95('0x25')];this[_0x1e95('0x26')]=_0x139557['ListId'];this[_0x1e95('0x27')]=_0x139557[_0x1e95('0x27')];this['VoiceQueueId']=_0x139557['VoiceQueueId'];this['CampaignId']=_0x139557[_0x1e95('0x28')];}module[_0x1e95('0x29')]=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 a7e0cc9..32d30a7 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 _0xd39f=['exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc'];(function(_0x1263d5,_0x5a1e64){var _0x29b1fa=function(_0x33b69a){while(--_0x33b69a){_0x1263d5['push'](_0x1263d5['shift']());}};_0x29b1fa(++_0x5a1e64);}(_0xd39f,0x173));var _0xfd39=function(_0x265add,_0x3ef9af){_0x265add=_0x265add-0x0;var _0x308f38=_0xd39f[_0x265add];return _0x308f38;};'use strict';var utils=require(_0xfd39('0x0'));function History(_0x43739a){this['uniqueid']=_0x43739a['uniqueid'];this[_0xfd39('0x1')]=_0x43739a[_0xfd39('0x1')]||undefined;this[_0xfd39('0x2')]=_0x43739a[_0xfd39('0x2')];this['campaigntype']=_0x43739a[_0xfd39('0x2')]===_0xfd39('0x3')?_0xfd39('0x4'):_0x43739a['type'];this['countbusyretry']=_0x43739a[_0xfd39('0x5')];this[_0xfd39('0x6')]=_0x43739a['countcongestionretry'];this['countnoanswerretry']=_0x43739a[_0xfd39('0x7')];this['countglobal']=_0x43739a['countbusyretry']+_0x43739a[_0xfd39('0x6')]+_0x43739a[_0xfd39('0x7')]+_0x43739a[_0xfd39('0x8')]+_0x43739a[_0xfd39('0x9')]+_0x43739a[_0xfd39('0xa')]+_0x43739a[_0xfd39('0xb')]+_0x43739a[_0xfd39('0xc')];this[_0xfd39('0x8')]=_0x43739a[_0xfd39('0x8')];this['countdropretry']=_0x43739a[_0xfd39('0x9')];this['countabandonedretry']=_0x43739a['countabandonedretry'];this[_0xfd39('0xb')]=_0x43739a['countmachineretry'];this['countagentrejectretry']=_0x43739a[_0xfd39('0xc')];this[_0xfd39('0x4')]=_0x43739a[_0xfd39('0x4')];this[_0xfd39('0xd')]=_0x43739a[_0xfd39('0xe')];this[_0xfd39('0xf')]=_0x43739a[_0xfd39('0x10')];this[_0xfd39('0x11')]=_0x43739a['starttime'];this['responsetime']=_0x43739a[_0xfd39('0x12')];this[_0xfd39('0x13')]=_0x43739a[_0xfd39('0x12')];this[_0xfd39('0x14')]=utils[_0xfd39('0x15')](_0x43739a[_0xfd39('0x12')],_0x43739a['starttime']);this[_0xfd39('0x16')]=0x0;this['talktime']=0x0;this[_0xfd39('0x17')]=_0x43739a['callback'];this[_0xfd39('0x18')]=_0x43739a[_0xfd39('0x18')];this[_0xfd39('0x19')]=_0x43739a[_0xfd39('0x19')];this[_0xfd39('0x1a')]=_0x43739a[_0xfd39('0x1a')];this['ContactId']=_0x43739a[_0xfd39('0x1b')];this[_0xfd39('0x1c')]=_0x43739a[_0xfd39('0x1c')];this[_0xfd39('0x1d')]=_0x43739a[_0xfd39('0x1d')];this['VoiceQueueId']=_0x43739a[_0xfd39('0x1e')];this['CampaignId']=_0x43739a[_0xfd39('0x1f')];this[_0xfd39('0x20')]=_0x43739a[_0xfd39('0x20')]||'';this[_0xfd39('0x21')]=_0x43739a[_0xfd39('0x21')]||'';this[_0xfd39('0x22')]=_0x43739a[_0xfd39('0x22')];this[_0xfd39('0x23')]=_0x43739a[_0xfd39('0x23')];}module[_0xfd39('0x24')]=History; \ No newline at end of file +var _0xfae2=['originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','starttime','responsetime','endtime','getSeconds','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x5a38eb,_0x2206d9){var _0x20be81=function(_0x2b8647){while(--_0x2b8647){_0x5a38eb['push'](_0x5a38eb['shift']());}};_0x20be81(++_0x2206d9);}(_0xfae2,0x1e0));var _0x2fae=function(_0x561975,_0x1d64fc){_0x561975=_0x561975-0x0;var _0x15b7f5=_0xfae2[_0x561975];return _0x15b7f5;};'use strict';var utils=require(_0x2fae('0x0'));function History(_0x18f423){this[_0x2fae('0x1')]=_0x18f423[_0x2fae('0x1')];this[_0x2fae('0x2')]=_0x18f423[_0x2fae('0x2')]||undefined;this[_0x2fae('0x3')]=_0x18f423[_0x2fae('0x3')];this[_0x2fae('0x4')]=_0x18f423['type']==='outbound'?_0x2fae('0x5'):_0x18f423[_0x2fae('0x3')];this[_0x2fae('0x6')]=_0x18f423[_0x2fae('0x6')];this[_0x2fae('0x7')]=_0x18f423[_0x2fae('0x7')];this[_0x2fae('0x8')]=_0x18f423['countnoanswerretry'];this[_0x2fae('0x9')]=_0x18f423['countbusyretry']+_0x18f423['countcongestionretry']+_0x18f423['countnoanswerretry']+_0x18f423[_0x2fae('0xa')]+_0x18f423[_0x2fae('0xb')]+_0x18f423[_0x2fae('0xc')]+_0x18f423[_0x2fae('0xd')]+_0x18f423[_0x2fae('0xe')];this[_0x2fae('0xa')]=_0x18f423[_0x2fae('0xa')];this['countdropretry']=_0x18f423['countdropretry'];this['countabandonedretry']=_0x18f423[_0x2fae('0xc')];this[_0x2fae('0xd')]=_0x18f423[_0x2fae('0xd')];this[_0x2fae('0xe')]=_0x18f423[_0x2fae('0xe')];this[_0x2fae('0x5')]=_0x18f423[_0x2fae('0x5')];this['calleridname']=_0x18f423[_0x2fae('0xf')];this[_0x2fae('0x10')]=_0x18f423['number'];this[_0x2fae('0x11')]=_0x18f423[_0x2fae('0x11')];this[_0x2fae('0x12')]=_0x18f423[_0x2fae('0x12')];this[_0x2fae('0x13')]=_0x18f423[_0x2fae('0x12')];this['ringtime']=utils[_0x2fae('0x14')](_0x18f423['responsetime'],_0x18f423[_0x2fae('0x11')]);this['holdtime']=0x0;this[_0x2fae('0x15')]=0x0;this[_0x2fae('0x16')]=_0x18f423[_0x2fae('0x16')];this['callbackuniqueid']=_0x18f423['callbackuniqueid'];this[_0x2fae('0x17')]=_0x18f423[_0x2fae('0x17')];this[_0x2fae('0x18')]=_0x18f423[_0x2fae('0x18')];this[_0x2fae('0x19')]=_0x18f423[_0x2fae('0x19')];this['ListId']=_0x18f423[_0x2fae('0x1a')];this['UserId']=_0x18f423[_0x2fae('0x1b')];this[_0x2fae('0x1c')]=_0x18f423[_0x2fae('0x1c')];this[_0x2fae('0x1d')]=_0x18f423[_0x2fae('0x1d')];this['originatecalleridnum']=_0x18f423[_0x2fae('0x1e')]||'';this[_0x2fae('0x1f')]=_0x18f423[_0x2fae('0x1f')]||'';this['state']=_0x18f423[_0x2fae('0x20')];this[_0x2fae('0x21')]=_0x18f423[_0x2fae('0x21')];}module['exports']=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 e42f5e1..b81172c 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 _0xfb73=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry'];(function(_0x15f682,_0x501486){var _0x57c396=function(_0x339826){while(--_0x339826){_0x15f682['push'](_0x15f682['shift']());}};_0x57c396(++_0x501486);}(_0xfb73,0xa3));var _0x3fb7=function(_0x20200d,_0x389d61){_0x20200d=_0x20200d-0x0;var _0x33d569=_0xfb73[_0x20200d];return _0x33d569;};'use strict';var utils=require(_0x3fb7('0x0'));function QueueCallerAbandon(_0x333345,_0x6084a9){this['scheduledat']=_0x333345[_0x3fb7('0x1')];this[_0x3fb7('0x2')]=_0x333345['type'];this[_0x3fb7('0x3')]=_0x333345[_0x3fb7('0x2')]==='outbound'?_0x3fb7('0x4'):_0x333345[_0x3fb7('0x2')];this['countbusyretry']=_0x333345[_0x3fb7('0x5')];this[_0x3fb7('0x6')]=_0x333345[_0x3fb7('0x6')];this[_0x3fb7('0x7')]=_0x333345[_0x3fb7('0x7')];this['countglobal']=_0x333345[_0x3fb7('0x5')]+_0x333345[_0x3fb7('0x6')]+_0x333345[_0x3fb7('0x7')]+_0x333345['countnosuchnumberretry']+_0x333345[_0x3fb7('0x8')]+_0x333345[_0x3fb7('0x9')]+_0x333345[_0x3fb7('0xa')]+_0x333345[_0x3fb7('0xb')];this[_0x3fb7('0xc')]=_0x333345[_0x3fb7('0xc')];this[_0x3fb7('0x8')]=_0x333345[_0x3fb7('0x8')];this[_0x3fb7('0x9')]=_0x333345['countabandonedretry'];this[_0x3fb7('0xa')]=_0x333345[_0x3fb7('0xa')];this[_0x3fb7('0xb')]=_0x333345[_0x3fb7('0xb')];this[_0x3fb7('0xd')]=_0x6084a9[_0x3fb7('0xd')];this['calleridname']=_0x333345[_0x3fb7('0xe')];this[_0x3fb7('0xf')]=_0x333345[_0x3fb7('0x10')];this[_0x3fb7('0x11')]=_0x333345[_0x3fb7('0x11')];this[_0x3fb7('0x12')]=_0x333345['responsetime'];this[_0x3fb7('0x13')]=_0x333345[_0x3fb7('0x13')];this['dropreason']=_0x333345[_0x3fb7('0x14')];this[_0x3fb7('0x15')]=this[_0x3fb7('0x13')];this['ringtime']=utils[_0x3fb7('0x16')](_0x333345[_0x3fb7('0x12')],_0x333345[_0x3fb7('0x11')]);this[_0x3fb7('0x17')]=utils[_0x3fb7('0x16')](this[_0x3fb7('0x13')],_0x333345[_0x3fb7('0x12')]);this[_0x3fb7('0x18')]=0x0;this[_0x3fb7('0x4')]=_0x6084a9[_0x3fb7('0x4')];this[_0x3fb7('0x19')]=_0x6084a9[_0x3fb7('0x1a')];this['reason']=_0x6084a9[_0x3fb7('0x1b')];this[_0x3fb7('0x1c')]=_0x333345[_0x3fb7('0x1c')];this[_0x3fb7('0x1d')]=_0x333345[_0x3fb7('0x1d')];this['callbackat']=_0x333345[_0x3fb7('0x1e')];this['recallme']=_0x333345[_0x3fb7('0x1f')];this[_0x3fb7('0x20')]=_0x333345['ContactId'];this[_0x3fb7('0x21')]=_0x333345[_0x3fb7('0x21')];this['UserId']=_0x333345[_0x3fb7('0x22')];this[_0x3fb7('0x23')]=_0x333345[_0x3fb7('0x23')];this['CampaignId']=_0x333345[_0x3fb7('0x24')];this[_0x3fb7('0x25')]=_0x333345[_0x3fb7('0x25')]||'';this['originatecalleridname']=_0x333345[_0x3fb7('0x26')]||'';this[_0x3fb7('0x27')]=_0x333345[_0x3fb7('0x27')];this[_0x3fb7('0x28')]=_0x333345[_0x3fb7('0x28')];this[_0x3fb7('0x29')]=_0x333345[_0x3fb7('0x29')];}module[_0x3fb7('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xa1f7=['countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','../utils','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry'];(function(_0x3b9623,_0x5589a5){var _0x17d360=function(_0xe9006a){while(--_0xe9006a){_0x3b9623['push'](_0x3b9623['shift']());}};_0x17d360(++_0x5589a5);}(_0xa1f7,0x167));var _0x7a1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa1f7[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x7a1f('0x0'));function QueueCallerAbandon(_0xd892c3,_0x5d1325){this['scheduledat']=_0xd892c3[_0x7a1f('0x1')];this['type']=_0xd892c3['type'];this[_0x7a1f('0x2')]=_0xd892c3[_0x7a1f('0x3')]===_0x7a1f('0x4')?'queue':_0xd892c3[_0x7a1f('0x3')];this[_0x7a1f('0x5')]=_0xd892c3[_0x7a1f('0x5')];this[_0x7a1f('0x6')]=_0xd892c3[_0x7a1f('0x6')];this[_0x7a1f('0x7')]=_0xd892c3[_0x7a1f('0x7')];this[_0x7a1f('0x8')]=_0xd892c3[_0x7a1f('0x5')]+_0xd892c3[_0x7a1f('0x6')]+_0xd892c3[_0x7a1f('0x7')]+_0xd892c3['countnosuchnumberretry']+_0xd892c3[_0x7a1f('0x9')]+_0xd892c3['countabandonedretry']+_0xd892c3[_0x7a1f('0xa')]+_0xd892c3[_0x7a1f('0xb')];this[_0x7a1f('0xc')]=_0xd892c3['countnosuchnumberretry'];this[_0x7a1f('0x9')]=_0xd892c3[_0x7a1f('0x9')];this['countabandonedretry']=_0xd892c3['countabandonedretry'];this[_0x7a1f('0xa')]=_0xd892c3['countmachineretry'];this[_0x7a1f('0xb')]=_0xd892c3[_0x7a1f('0xb')];this[_0x7a1f('0xd')]=_0x5d1325[_0x7a1f('0xd')];this[_0x7a1f('0xe')]=_0xd892c3[_0x7a1f('0xf')];this[_0x7a1f('0x10')]=_0xd892c3[_0x7a1f('0x11')];this[_0x7a1f('0x12')]=_0xd892c3[_0x7a1f('0x12')];this[_0x7a1f('0x13')]=_0xd892c3['responsetime'];this['droptime']=_0xd892c3[_0x7a1f('0x14')];this[_0x7a1f('0x15')]=_0xd892c3[_0x7a1f('0x15')];this[_0x7a1f('0x16')]=this[_0x7a1f('0x14')];this['ringtime']=utils[_0x7a1f('0x17')](_0xd892c3['responsetime'],_0xd892c3[_0x7a1f('0x12')]);this[_0x7a1f('0x18')]=utils[_0x7a1f('0x17')](this[_0x7a1f('0x14')],_0xd892c3['responsetime']);this[_0x7a1f('0x19')]=0x0;this[_0x7a1f('0x1a')]=_0x5d1325['queue'];this['membername']=_0x5d1325[_0x7a1f('0x1b')];this['reason']=_0x5d1325[_0x7a1f('0x1c')];this[_0x7a1f('0x1d')]=_0xd892c3['callback'];this[_0x7a1f('0x1e')]=_0xd892c3[_0x7a1f('0x1e')];this['callbackat']=_0xd892c3['callbackat'];this[_0x7a1f('0x1f')]=_0xd892c3[_0x7a1f('0x1f')];this['ContactId']=_0xd892c3[_0x7a1f('0x20')];this[_0x7a1f('0x21')]=_0xd892c3[_0x7a1f('0x21')];this[_0x7a1f('0x22')]=_0xd892c3[_0x7a1f('0x22')];this[_0x7a1f('0x23')]=_0xd892c3[_0x7a1f('0x23')];this[_0x7a1f('0x24')]=_0xd892c3[_0x7a1f('0x24')];this[_0x7a1f('0x25')]=_0xd892c3['originatecalleridnum']||'';this[_0x7a1f('0x26')]=_0xd892c3[_0x7a1f('0x26')]||'';this['agiafterat']=_0xd892c3['agiafterat'];this['state']=_0xd892c3['state'];this['statedesc']=_0xd892c3[_0x7a1f('0x27')];}module[_0x7a1f('0x28')]=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 5b312af..517accd 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 _0x430c=['[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','util','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','dialOrderByScheduledAt','temp','error','[getContactDialer]','getContactDialer','getContactDialerIvr','[getContactDialerIvr]','catch','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x14aa41,_0x29c9d8){var _0x5215bf=function(_0x5bbf0f){while(--_0x5bbf0f){_0x14aa41['push'](_0x14aa41['shift']());}};_0x5215bf(++_0x29c9d8);}(_0x430c,0x1a1));var _0xc430=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0x430c[_0x4d934b];return _0xc0338b;};'use strict';var util=require(_0xc430('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require(_0xc430('0x1'));var cmHopperAdditionalPhone=require(_0xc430('0x2'));var cmHopperBlack=require(_0xc430('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x4f0118){return util['inspect'](_0x4f0118,{'showHidden':![],'depth':null});}function getContactDialer(_0x47d8b9,_0x338a82,_0x2408f5){return cmHopper['getContactDialer'](_0x47d8b9['id'],_0x338a82,_0x2408f5,_0x47d8b9[_0xc430('0x4')])['catch'](function(_0x212354){_0x47d8b9[_0xc430('0x5')]=0x0;logger[_0xc430('0x6')](_0xc430('0x7'),inspectError(_0x212354));});}exports[_0xc430('0x8')]=getContactDialer;function getContactDialerIvr(_0x11f4b0,_0x861581){return cmHopper[_0xc430('0x9')](_0x11f4b0['id'],_0x861581,_0x11f4b0[_0xc430('0x4')])['catch'](function(_0x97fa5b){_0x11f4b0[_0xc430('0x5')]=0x0;logger['error'](_0xc430('0xa'),inspectError(_0x97fa5b));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x3b84bc){return cmHopper['countReScheduled'](_0x3b84bc)[_0xc430('0xb')](function(_0x8aa2e6){logger[_0xc430('0x6')](_0xc430('0xc'),inspectError(_0x8aa2e6));});}exports[_0xc430('0xd')]=countReScheduled;function rescheduleContact(_0x2777af){return cmHopper[_0xc430('0xe')](_0x2777af)['catch'](function(_0x4e9134){logger[_0xc430('0x6')](_0xc430('0xf'),inspectError(_0x4e9134));});}exports[_0xc430('0xe')]=rescheduleContact;function unlockContact(_0x2ef538,_0x31d3b7,_0x55cc6c){return cmHopper[_0xc430('0x10')](_0x2ef538,_0x31d3b7,_0x55cc6c)['catch'](function(_0x4bf91f){logger[_0xc430('0x6')](_0xc430('0x11'),inspectError(_0x4bf91f));});}exports[_0xc430('0x10')]=unlockContact;function moveContactManagedDialer(_0x5830b0){return cmHopper['moveContactManagedDialer'](_0x5830b0)[_0xc430('0xb')](function(_0x4c1937){logger[_0xc430('0x6')]('[moveContactManagedDialer]',inspectError(_0x4c1937));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x2f3203){return cmHopperBlack['checkIsBlackList'](_0x2f3203)[_0xc430('0xb')](function(_0x1eae3b){logger[_0xc430('0x6')](_0xc430('0x12'),inspectError(_0x1eae3b));});}exports[_0xc430('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5af282){return cmHopperBlack[_0xc430('0x14')](_0x5af282)['catch'](function(_0x4d2d43){logger[_0xc430('0x6')](_0xc430('0x15'),inspectError(_0x4d2d43));});}exports[_0xc430('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x56dd16,_0x3fd56b,_0x57d26e){return cmHopperAdditionalPhone[_0xc430('0x16')](_0x56dd16,_0x3fd56b,_0x57d26e)[_0xc430('0xb')](function(_0x4efecd){logger[_0xc430('0x6')](_0xc430('0x17'),inspectError(_0x4efecd));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x2f9af4,_0x59c498,_0x3aa85e){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2f9af4,_0x59c498,_0x3aa85e)[_0xc430('0xb')](function(_0x21e28a){logger['error'](_0xc430('0x18'),inspectError(_0x21e28a));});}exports[_0xc430('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x2c0422){return cmHopperHistory[_0xc430('0x1a')](_0x2c0422)[_0xc430('0xb')](function(_0x57cd72){logger[_0xc430('0x6')](_0xc430('0x1b'),inspectError(_0x57cd72));});}exports[_0xc430('0x1a')]=avgHandleTime;function createHistory(_0x1591e3){return cmHopperHistory['createHistory'](_0x1591e3)[_0xc430('0xb')](function(_0x4cf56c){logger[_0xc430('0x6')]('[createHistory]',inspectError(_0x4cf56c));});}exports[_0xc430('0x1c')]=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x50acc9,_0x5c3b86){var _0x1abb24=function(_0x24c8ca){while(--_0x24c8ca){_0x50acc9['push'](_0x50acc9['shift']());}};_0x1abb24(++_0x5c3b86);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=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 3a6f42c..76db3c6 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 _0xf4e8=['preview','isPreviewCampaign','ivr','isIVRCampaign','type','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','pTalking','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','DISACTIVED','INACTIVE','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','%s%s','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS'];(function(_0x340d49,_0x4525c1){var _0x582685=function(_0x3ebf6b){while(--_0x3ebf6b){_0x340d49['push'](_0x340d49['shift']());}};_0x582685(++_0x4525c1);}(_0xf4e8,0x98));var _0x8f4e=function(_0xc5b1aa,_0x436c79){_0xc5b1aa=_0xc5b1aa-0x0;var _0x4cfe8d=_0xf4e8[_0xc5b1aa];return _0x4cfe8d;};'use strict';var _=require('lodash');var moment=require(_0x8f4e('0x0'));var util=require(_0x8f4e('0x1'));var logger=require('../../../../config/logger')(_0x8f4e('0x2'));var timezones=require(_0x8f4e('0x3'))[_0x8f4e('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x8f4e('0x5'),'BLACKLIST':_0x8f4e('0x6'),'CONTACTS_RESCHEDULED':_0x8f4e('0x7'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x8f4e('0x8'),'EMPTY_INTERVAL':_0x8f4e('0x9'),'INACTIVE':_0x8f4e('0xa'),'NO_AGENTS_LOGGED':_0x8f4e('0xb'),'NO_AVAILABLE_CONTACTS':_0x8f4e('0xc'),'NULL_INTERVAL':_0x8f4e('0xd'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x8f4e('0xe'),'QUEUE_RECALL':_0x8f4e('0xf'),'RECALL_TIMEOUT':_0x8f4e('0x10'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x8f4e('0x11'),'UNREACHABLE_TRUNK':_0x8f4e('0x12')};exports[_0x8f4e('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2feb4e){return _0x2feb4e['dialMethod']===_0x8f4e('0x14');}exports[_0x8f4e('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x1f99a8){return _0x1f99a8['type']===_0x8f4e('0x16');}exports[_0x8f4e('0x17')]=isIVRCampaign;function isOutboundQueue(_0x1639af){return _0x1639af[_0x8f4e('0x18')]===_0x8f4e('0x19');}exports[_0x8f4e('0x1a')]=isOutboundQueue;function isQueueCampaignActive(_0x17fd38){return _0x17fd38[_0x8f4e('0x1b')];}exports[_0x8f4e('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x32be95){return _0x32be95['active'];}exports[_0x8f4e('0x1d')]=isIVRCampaignActive;function getSeconds(_0x3b144e,_0x516b26){var _0x41d0a5=moment(_0x3b144e)[_0x8f4e('0x1e')](0x0);var _0x2a7f3d=moment(_0x516b26)[_0x8f4e('0x1e')](0x0);return _0x41d0a5['diff'](_0x2a7f3d,'seconds');}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x2d3bf2,_0x5da9be){var _0x4249a8=![];var _0x1bc6ea=_0x2d3bf2['dialMethod']!==_0x5da9be[_0x8f4e('0x1f')]||_0x2d3bf2['dialActive']!==_0x5da9be[_0x8f4e('0x1b')]||_0x2d3bf2['message']!==_0x5da9be[_0x8f4e('0x20')];var _0x15d2bb=_0x2d3bf2[_0x8f4e('0x21')]!==_0x5da9be[_0x8f4e('0x21')]||_0x2d3bf2[_0x8f4e('0x22')]!==_0x5da9be[_0x8f4e('0x22')]||_0x2d3bf2['loggedInDb']!==_0x5da9be[_0x8f4e('0x23')]||_0x2d3bf2['paused']!==_0x5da9be[_0x8f4e('0x24')]||_0x2d3bf2[_0x8f4e('0x25')]!==_0x5da9be[_0x8f4e('0x25')]||_0x2d3bf2['pTalking']!==_0x5da9be['pTalking']||_0x2d3bf2[_0x8f4e('0x26')]!==_0x5da9be[_0x8f4e('0x26')]||_0x2d3bf2[_0x8f4e('0x27')]!==_0x5da9be['inUse']||_0x2d3bf2['originated']!==_0x5da9be[_0x8f4e('0x28')];if(_0x2d3bf2[_0x8f4e('0x29')]&&_0x5da9be[_0x8f4e('0x29')]){_0x4249a8=_0x2d3bf2[_0x8f4e('0x29')][_0x8f4e('0x2a')]!==_0x5da9be['Trunk'][_0x8f4e('0x2a')]||_0x2d3bf2[_0x8f4e('0x29')][_0x8f4e('0x2b')]!==_0x5da9be[_0x8f4e('0x29')][_0x8f4e('0x2b')];}return _0x1bc6ea||_0x15d2bb||_0x4249a8;}exports[_0x8f4e('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x59988d){var _0x41c894=null;var _0x389215=_0x59988d['dialTimezone'];if(_[_0x8f4e('0x2d')](_0x59988d[_0x8f4e('0x2e')])||_['isNil'](_0x59988d[_0x8f4e('0x2f')])||_[_0x8f4e('0x2d')](_0x59988d['Interval'][_0x8f4e('0x30')])){_0x41c894=CAMPAIGN_STATUS[_0x8f4e('0x31')];}else if(_[_0x8f4e('0x32')](_0x59988d[_0x8f4e('0x2e')])||_[_0x8f4e('0x32')](_0x59988d[_0x8f4e('0x2f')]['Intervals'])){_0x41c894=CAMPAIGN_STATUS[_0x8f4e('0x33')];}else if(_0x389215&&!timezones[_0x389215]){_0x41c894=CAMPAIGN_STATUS[_0x8f4e('0x34')];}return _0x41c894;}function checkAnyValidTrunk(_0x2db1fc,_0xaac67a){var _0x419a36=null;var _0x4cc2e6=_0x8f4e('0x35');var _0x4ccc4b=[_0x8f4e('0x36'),_0x8f4e('0x37')];var _0x5d4b70=!![];if(_0x2db1fc[_0x8f4e('0x29')]&&_0x2db1fc[_0x8f4e('0x29')]['active']){_0x4cc2e6+=_0x2db1fc[_0x8f4e('0x29')][_0x8f4e('0x2a')];_0x419a36=_0xaac67a[_0x4cc2e6];_0x5d4b70=_0x4ccc4b[_0x8f4e('0x38')](_0x419a36[_0x8f4e('0x39')]);}else if(_0x2db1fc[_0x8f4e('0x3a')]&&_0x2db1fc[_0x8f4e('0x3a')][_0x8f4e('0x2b')]){_0x4cc2e6+=_0x2db1fc[_0x8f4e('0x3a')]['name'];_0x419a36=_0xaac67a[_0x4cc2e6];_0x5d4b70=_0x4ccc4b['includes'](_0x419a36[_0x8f4e('0x39')]);}return _0x5d4b70;}function getQueueCampaignStatusMessage(_0x562322,_0x10b070){var _0x2e2706=CAMPAIGN_STATUS['ACTIVE'];var _0xf7b671=isPreviewCampaign(_0x562322);if(!isQueueCampaignActive(_0x562322)){if(_0xf7b671){_0x2e2706=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x562322[_0x8f4e('0x28')]===0x0&&_0x562322[_0x8f4e('0x25')]===0x0&&_0x562322[_0x8f4e('0x26')]===0x0&&(_0x562322[_0x8f4e('0x3b')]||0x0)===0x0){_0x2e2706=CAMPAIGN_STATUS['INACTIVE'];}else{_0x2e2706=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x562322[_0x8f4e('0x22')]===0x0){_0x2e2706=CAMPAIGN_STATUS[_0x8f4e('0x3c')];}else if(!checkAnyValidTrunk(_0x562322,_0x10b070)){_0x2e2706=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x562322)){var _0x4ab006=checkAnyValidQueueCampaignInterval(_0x562322);if(_0x4ab006){_0x2e2706=_0x4ab006;}}return _0x2e2706;}exports[_0x8f4e('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3fefad){var _0x10c58c=CAMPAIGN_STATUS[_0x8f4e('0x3e')];if(_0x3fefad['originated']===0x0&&_0x3fefad[_0x8f4e('0x25')]===0x0&&_0x3fefad[_0x8f4e('0x26')]===0x0&&(_0x3fefad[_0x8f4e('0x3b')]||0x0)===0x0){_0x10c58c=CAMPAIGN_STATUS[_0x8f4e('0x3f')];}return _0x10c58c;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x135a5a){var _0x81e62f=_0x135a5a[_0x8f4e('0x40')](/"(.*?)"/);return _0x81e62f?_0x81e62f[0x1]:_0x135a5a;}exports[_0x8f4e('0x41')]=extractCalleridName;function getCallerId(_0x2e27bc,_0x33ed7a,_0x3e6e29){if(!_[_0x8f4e('0x42')](_0x3e6e29)&&typeof _0x3e6e29===_0x8f4e('0x43')&&!_['isEmpty'](_0x3e6e29)){if(!_[_0x8f4e('0x42')](_0x33ed7a)&&typeof _0x33ed7a===_0x8f4e('0x43')&&!_[_0x8f4e('0x32')](_0x33ed7a)){return util[_0x8f4e('0x44')](_0x8f4e('0x45'),_0x33ed7a,_0x3e6e29);}return util[_0x8f4e('0x44')](_0x8f4e('0x45'),_0x3e6e29,_0x3e6e29);}if(!_[_0x8f4e('0x42')](_0x2e27bc)&&typeof _0x2e27bc===_0x8f4e('0x43')&&!_[_0x8f4e('0x32')](_0x2e27bc)){return _0x2e27bc;}return _0x8f4e('0x46');}exports[_0x8f4e('0x47')]=getCallerId;function getCallerIdRandom(_0xe5ab45,_0x1e2352){var _0x3a30b5;var _0x4bf337;var _0x3c8da8;if(_0x1e2352<=0x0){_0x1e2352=0x1;}_0x3a30b5=new RegExp(_0x8f4e('0x48')+_0x1e2352+'}$');_0x4bf337=Math[_0x8f4e('0x49')](0xa,_0x1e2352-0x1);_0x3c8da8=Math[_0x8f4e('0x49')](0xa,_0x1e2352)-0x1;return util['format']('%s',_[_0x8f4e('0x4a')](_0xe5ab45,_0x3a30b5,_[_0x8f4e('0x4b')](_0x4bf337,_0x3c8da8)['toString']()));}exports[_0x8f4e('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x5e4372){if(_0x5e4372[_0x8f4e('0x28')]&&_0x5e4372['originated']>0x0){_0x5e4372['originated']-=0x1;}else{logger[_0x8f4e('0x4d')](_0x8f4e('0x4e'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x2bc441){return _0x2bc441&&_0x2bc441['length']>0x0;}exports[_0x8f4e('0x4f')]=checkContactEmpty;function erlangb(_0x87f11c,_0x50826c){if(_0x50826c===0x0){return 0x0;}var _0x7d2807=0x1;for(var _0x51c56a=0x1;_0x51c56a<=_0x50826c;_0x51c56a+=0x1){_0x7d2807=0x1+_0x7d2807*_0x51c56a/_0x87f11c;}return 0x1/_0x7d2807;}exports[_0x8f4e('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x550cab,_0xd3c54d,_0x8324f5){if(_0xd3c54d>_0x8324f5){for(var _0x44ac9a=0x0;_0x44ac9a<_0xd3c54d-_0x8324f5;_0x44ac9a+=0x1){decrementOriginate(_0x550cab);}}}exports[_0x8f4e('0x51')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x16bddd){var _0x502516={};var _0x5b1f81=['id',_0x8f4e('0x52'),'description','tags',_0x8f4e('0x53')];if(_0x16bddd){for(var _0x28557e in _0x16bddd){if(typeof _0x16bddd[_0x28557e]!==_0x8f4e('0x54')){if(!_['isNil'](_0x16bddd[_0x28557e])&&!_0x5b1f81[_0x8f4e('0x38')](_0x28557e)){_0x502516[util[_0x8f4e('0x44')](_0x8f4e('0x55'),'XMD-',_0x28557e['toUpperCase']())]=_0x16bddd[_0x28557e];}}}}return _0x502516;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file +var _0x672d=['diff','message','available','loggedIn','loggedInDb','paused','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','error','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','moment','util','../../../../config/logger','dialer','timezones','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds'];(function(_0x4be610,_0x131b7a){var _0x3c80af=function(_0x35386a){while(--_0x35386a){_0x4be610['push'](_0x4be610['shift']());}};_0x3c80af(++_0x131b7a);}(_0x672d,0x1c8));var _0xd672=function(_0x4ee336,_0x4583f7){_0x4ee336=_0x4ee336-0x0;var _0x54c0f9=_0x672d[_0x4ee336];return _0x54c0f9;};'use strict';var _=require(_0xd672('0x0'));var moment=require(_0xd672('0x1'));var util=require(_0xd672('0x2'));var logger=require(_0xd672('0x3'))(_0xd672('0x4'));var timezones=require('../../../../config/environment/shared')[_0xd672('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xd672('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xd672('0x7'),'DISACTIVED':_0xd672('0x8'),'EMPTY_INTERVAL':_0xd672('0x9'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0xd672('0xa'),'NO_AVAILABLE_CONTACTS':_0xd672('0xb'),'NULL_INTERVAL':_0xd672('0xc'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0xd672('0xd'),'RECALL_TIMEOUT':_0xd672('0xe'),'RUNNING':_0xd672('0xf'),'UNKNOWN_TIMEZONE':_0xd672('0x10'),'UNREACHABLE_TRUNK':_0xd672('0x11')};exports[_0xd672('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x36afa2){return _0x36afa2[_0xd672('0x13')]===_0xd672('0x14');}exports[_0xd672('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x48054d){return _0x48054d[_0xd672('0x16')]===_0xd672('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x35f3dd){return _0x35f3dd[_0xd672('0x16')]===_0xd672('0x18');}exports[_0xd672('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0xe0aa6){return _0xe0aa6[_0xd672('0x1a')];}exports[_0xd672('0x1b')]=isQueueCampaignActive;function isIVRCampaignActive(_0x3ce562){return _0x3ce562['active'];}exports[_0xd672('0x1c')]=isIVRCampaignActive;function getSeconds(_0x497abc,_0xebe25b){var _0x552f94=moment(_0x497abc)[_0xd672('0x1d')](0x0);var _0x3c6b1b=moment(_0xebe25b)['milliseconds'](0x0);return _0x552f94[_0xd672('0x1e')](_0x3c6b1b,'seconds');}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0xea2ec0,_0x55ae9d){var _0x16af22=![];var _0x36bd67=_0xea2ec0[_0xd672('0x13')]!==_0x55ae9d[_0xd672('0x13')]||_0xea2ec0['dialActive']!==_0x55ae9d['dialActive']||_0xea2ec0[_0xd672('0x1f')]!==_0x55ae9d[_0xd672('0x1f')];var _0x513f93=_0xea2ec0[_0xd672('0x20')]!==_0x55ae9d[_0xd672('0x20')]||_0xea2ec0[_0xd672('0x21')]!==_0x55ae9d['loggedIn']||_0xea2ec0[_0xd672('0x22')]!==_0x55ae9d['loggedInDb']||_0xea2ec0['paused']!==_0x55ae9d[_0xd672('0x23')]||_0xea2ec0['talking']!==_0x55ae9d['talking']||_0xea2ec0['pTalking']!==_0x55ae9d[_0xd672('0x24')]||_0xea2ec0[_0xd672('0x25')]!==_0x55ae9d[_0xd672('0x25')]||_0xea2ec0[_0xd672('0x26')]!==_0x55ae9d[_0xd672('0x26')]||_0xea2ec0[_0xd672('0x27')]!==_0x55ae9d[_0xd672('0x27')];if(_0xea2ec0[_0xd672('0x28')]&&_0x55ae9d['Trunk']){_0x16af22=_0xea2ec0[_0xd672('0x28')][_0xd672('0x29')]!==_0x55ae9d[_0xd672('0x28')][_0xd672('0x29')]||_0xea2ec0[_0xd672('0x28')][_0xd672('0x2a')]!==_0x55ae9d[_0xd672('0x28')]['active'];}return _0x36bd67||_0x513f93||_0x16af22;}exports[_0xd672('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1132a2){var _0x300f72=null;var _0x128607=_0x1132a2[_0xd672('0x2c')];if(_[_0xd672('0x2d')](_0x1132a2[_0xd672('0x2e')])||_[_0xd672('0x2d')](_0x1132a2[_0xd672('0x2f')])||_[_0xd672('0x2d')](_0x1132a2[_0xd672('0x2f')][_0xd672('0x30')])){_0x300f72=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xd672('0x31')](_0x1132a2[_0xd672('0x2e')])||_[_0xd672('0x31')](_0x1132a2['Interval'][_0xd672('0x30')])){_0x300f72=CAMPAIGN_STATUS[_0xd672('0x32')];}else if(_0x128607&&!timezones[_0x128607]){_0x300f72=CAMPAIGN_STATUS[_0xd672('0x33')];}return _0x300f72;}function checkAnyValidTrunk(_0x442b87,_0x202596){var _0x1fe822=null;var _0x4d9dbf=_0xd672('0x34');var _0x3bc0cf=[_0xd672('0x35'),'unmonitored'];var _0x2bd1a7=!![];if(_0x442b87[_0xd672('0x28')]&&_0x442b87[_0xd672('0x28')][_0xd672('0x2a')]){_0x4d9dbf+=_0x442b87[_0xd672('0x28')]['name'];_0x1fe822=_0x202596[_0x4d9dbf];_0x2bd1a7=_0x3bc0cf[_0xd672('0x36')](_0x1fe822[_0xd672('0x37')]);}else if(_0x442b87[_0xd672('0x38')]&&_0x442b87[_0xd672('0x38')][_0xd672('0x2a')]){_0x4d9dbf+=_0x442b87[_0xd672('0x38')][_0xd672('0x29')];_0x1fe822=_0x202596[_0x4d9dbf];_0x2bd1a7=_0x3bc0cf[_0xd672('0x36')](_0x1fe822[_0xd672('0x37')]);}return _0x2bd1a7;}function getQueueCampaignStatusMessage(_0x3bb7e1,_0x5ca169){var _0x38242b=CAMPAIGN_STATUS[_0xd672('0x39')];var _0x3f498d=isPreviewCampaign(_0x3bb7e1);if(!isQueueCampaignActive(_0x3bb7e1)){if(_0x3f498d){_0x38242b=CAMPAIGN_STATUS[_0xd672('0x3a')];}else{if(_0x3bb7e1['originated']===0x0&&_0x3bb7e1['talking']===0x0&&_0x3bb7e1[_0xd672('0x25')]===0x0&&(_0x3bb7e1[_0xd672('0x24')]||0x0)===0x0){_0x38242b=CAMPAIGN_STATUS[_0xd672('0x3a')];}else{_0x38242b=CAMPAIGN_STATUS[_0xd672('0x3b')];}}}else if(_0x3bb7e1[_0xd672('0x21')]===0x0){_0x38242b=CAMPAIGN_STATUS[_0xd672('0x3c')];}else if(!checkAnyValidTrunk(_0x3bb7e1,_0x5ca169)){_0x38242b=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x3bb7e1)){var _0x553c8a=checkAnyValidQueueCampaignInterval(_0x3bb7e1);if(_0x553c8a){_0x38242b=_0x553c8a;}}return _0x38242b;}exports[_0xd672('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x12794c){var _0x395427=CAMPAIGN_STATUS[_0xd672('0x3b')];if(_0x12794c[_0xd672('0x27')]===0x0&&_0x12794c['talking']===0x0&&_0x12794c[_0xd672('0x25')]===0x0&&(_0x12794c[_0xd672('0x24')]||0x0)===0x0){_0x395427=CAMPAIGN_STATUS[_0xd672('0x3a')];}return _0x395427;}exports[_0xd672('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4dbdea){var _0x37f612=_0x4dbdea[_0xd672('0x3f')](/"(.*?)"/);return _0x37f612?_0x37f612[0x1]:_0x4dbdea;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x2764ef,_0x19a27e,_0x535e9b){if(!_[_0xd672('0x40')](_0x535e9b)&&typeof _0x535e9b==='string'&&!_['isEmpty'](_0x535e9b)){if(!_[_0xd672('0x40')](_0x19a27e)&&typeof _0x19a27e===_0xd672('0x41')&&!_[_0xd672('0x31')](_0x19a27e)){return util[_0xd672('0x42')](_0xd672('0x43'),_0x19a27e,_0x535e9b);}return util[_0xd672('0x42')](_0xd672('0x43'),_0x535e9b,_0x535e9b);}if(!_['isUndefined'](_0x2764ef)&&typeof _0x2764ef===_0xd672('0x41')&&!_['isEmpty'](_0x2764ef)){return _0x2764ef;}return _0xd672('0x44');}exports[_0xd672('0x45')]=getCallerId;function getCallerIdRandom(_0x39f970,_0x251c37){var _0x389106;var _0x5e0c99;var _0x527a0a;if(_0x251c37<=0x0){_0x251c37=0x1;}_0x389106=new RegExp(_0xd672('0x46')+_0x251c37+'}$');_0x5e0c99=Math['pow'](0xa,_0x251c37-0x1);_0x527a0a=Math[_0xd672('0x47')](0xa,_0x251c37)-0x1;return util['format']('%s',_[_0xd672('0x48')](_0x39f970,_0x389106,_[_0xd672('0x49')](_0x5e0c99,_0x527a0a)[_0xd672('0x4a')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x213303){if(_0x213303['originated']&&_0x213303[_0xd672('0x27')]>0x0){_0x213303[_0xd672('0x27')]-=0x1;}else{logger[_0xd672('0x4b')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xd672('0x4c')]=decrementOriginate;function checkContactEmpty(_0x31ac81){return _0x31ac81&&_0x31ac81[_0xd672('0x4d')]>0x0;}exports[_0xd672('0x4e')]=checkContactEmpty;function erlangb(_0x1ef443,_0xbfcf2f){if(_0xbfcf2f===0x0){return 0x0;}var _0xf13109=0x1;for(var _0x33193a=0x1;_0x33193a<=_0xbfcf2f;_0x33193a+=0x1){_0xf13109=0x1+_0xf13109*_0x33193a/_0x1ef443;}return 0x1/_0xf13109;}exports[_0xd672('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x251ad9,_0x59df37,_0x596023){if(_0x59df37>_0x596023){for(var _0x330ee0=0x0;_0x330ee0<_0x59df37-_0x596023;_0x330ee0+=0x1){decrementOriginate(_0x251ad9);}}}exports[_0xd672('0x50')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ddd843e..753f174 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(_0x4f7328,_0xac8018){var _0x1a9463=function(_0x33b8f1){while(--_0x33b8f1){_0x4f7328['push'](_0x4f7328['shift']());}};_0x1a9463(++_0xac8018);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x511a35,_0x2f8f83){var _0x19d677=function(_0x1c3784){while(--_0x1c3784){_0x511a35['push'](_0x511a35['shift']());}};_0x19d677(++_0x2f8f83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 f938112..b505450 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 _0x18f2=['../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','syncOriginateResponse','context','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','operation','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','faxpages','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','Trunk','isValid','Trunk\x20Reachable','message','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','.pdf','isNil','active','SIP/%s','unmonitored','checkTrunk','[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','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount'];(function(_0x579dc7,_0x262e2a){var _0x3f5389=function(_0x30bb4c){while(--_0x30bb4c){_0x579dc7['push'](_0x579dc7['shift']());}};_0x3f5389(++_0x262e2a);}(_0x18f2,0x1b7));var _0x218f=function(_0x5508a2,_0x9133df){_0x5508a2=_0x5508a2-0x0;var _0x57d532=_0x18f2[_0x5508a2];return _0x57d532;};'use strict';var util=require(_0x218f('0x0'));var _=require(_0x218f('0x1'));var BPromise=require(_0x218f('0x2'));var uuid=require(_0x218f('0x3'));var moment=require(_0x218f('0x4'));var path=require('path');var tiff2pdf=require(_0x218f('0x5'));var gs=require(_0x218f('0x6'));var logger=require('../../../config/logger')(_0x218f('0x7'));var ami=require(_0x218f('0x8'));var rpcDb=require(_0x218f('0x9'));var Channel=require('./channel');var ut=require(_0x218f('0xa'));var Action=require(_0x218f('0xb'));var faxAccount=require(_0x218f('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x218f('0xd'));function Fax(_0x37f0c7){this[_0x218f('0xe')]={};this[_0x218f('0xf')]=_0x37f0c7[_0x218f('0xf')];this[_0x218f('0x10')]=_0x37f0c7[_0x218f('0x10')];this[_0x218f('0x11')]={};ami['on'](_0x218f('0x12'),this[_0x218f('0x13')][_0x218f('0x14')](this));ami['on'](_0x218f('0x15'),this['syncVarSet'][_0x218f('0x14')](this));ami['on'](_0x218f('0x16'),this['syncNewState'][_0x218f('0x14')](this));ami['on'](_0x218f('0x17'),this['syncNewExten'][_0x218f('0x14')](this));ami['on'](_0x218f('0x18'),this[_0x218f('0x19')][_0x218f('0x14')](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x218f('0x1a'),this[_0x218f('0x1b')]['bind'](this));ami['on'](_0x218f('0x1c'),this[_0x218f('0x1d')]['bind'](this));}Fax['prototype'][_0x218f('0x13')]=function(_0x59d464){if(_0x59d464[_0x218f('0x1e')]==='from-voip-provider'){for(var _0xfaacad in this[_0x218f('0xf')]){if(this[_0x218f('0xf')][_0x218f('0x1f')](_0xfaacad)){if(_0x59d464['exten']===this[_0x218f('0xf')][_0xfaacad][_0x218f('0x20')]){this[_0x218f('0xe')][_0x59d464[_0x218f('0x21')]]={};this[_0x218f('0xe')][_0x59d464['uniqueid']][_0x218f('0x22')]=_0x59d464['channel'];this[_0x218f('0xe')][_0x59d464['uniqueid']]['id']=this[_0x218f('0xf')][_0xfaacad]['id'];this[_0x218f('0xe')][_0x59d464['uniqueid']][_0x218f('0x23')]=this[_0x218f('0xf')][_0xfaacad]['name'];logger['info'](_0x59d464[_0x218f('0x21')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x59d464[_0x218f('0x21')]]){this[_0x218f('0xe')][_0x59d464[_0x218f('0x21')]]={};this[_0x218f('0xe')][_0x59d464[_0x218f('0x21')]][_0x218f('0x22')]=_0x59d464[_0x218f('0x22')];logger[_0x218f('0x24')](_0x59d464['uniqueid'],_0x218f('0x25'));}};Fax[_0x218f('0x26')]['syncVarSet']=function(_0x3f5051){if(this[_0x218f('0xe')][_0x3f5051[_0x218f('0x21')]]){for(var _0x4673b4 in _0x3f5051[_0x218f('0x27')]){if(_0x3f5051[_0x218f('0x27')][_0x218f('0x1f')](_0x4673b4)){this[_0x218f('0xe')][_0x3f5051['uniqueid']][_0x4673b4]=_0x3f5051[_0x218f('0x28')];}}}};Fax[_0x218f('0x26')][_0x218f('0x29')]=function(_0x4c8ec6){if(this['channels'][_0x4c8ec6[_0x218f('0x21')]]){this[_0x218f('0xe')][_0x4c8ec6['uniqueid']][_0x218f('0x2a')]=_0x4c8ec6[_0x218f('0x2a')];this[_0x218f('0xe')][_0x4c8ec6[_0x218f('0x21')]][_0x218f('0x2b')]=_0x4c8ec6[_0x218f('0x2b')];}};Fax[_0x218f('0x26')][_0x218f('0x2c')]=function(_0x1e0e79){if(this['channels'][_0x1e0e79[_0x218f('0x21')]]){for(var _0x5ba075 in _0x1e0e79[_0x218f('0x27')]){if(_0x1e0e79[_0x218f('0x27')][_0x218f('0x1f')](_0x5ba075)){this[_0x218f('0xe')][_0x1e0e79['uniqueid']][_0x5ba075]=_0x1e0e79[_0x218f('0x28')];}}}};Fax[_0x218f('0x26')][_0x218f('0x19')]=function(_0x2af64e){if(this['channels'][_0x2af64e['uniqueid']]){this[_0x218f('0xe')][_0x2af64e[_0x218f('0x21')]][_0x218f('0x2d')]=_0x2af64e['operation'];this[_0x218f('0xe')][_0x2af64e[_0x218f('0x21')]][_0x218f('0x2e')]=_0x2af64e[_0x218f('0x2e')];this['channels'][_0x2af64e[_0x218f('0x21')]][_0x218f('0x20')]=_0x2af64e[_0x218f('0x20')];this[_0x218f('0xe')][_0x2af64e[_0x218f('0x21')]][_0x218f('0x2f')]=_0x2af64e[_0x218f('0x2f')];logger[_0x218f('0x24')](_0x2af64e[_0x218f('0x21')],'\x20syncFaxStatus\x20');}};Fax[_0x218f('0x26')][_0x218f('0x30')]=function(_0x22b95d){var _0xc8b7c3=this;if(this['channels'][_0x22b95d['uniqueid']]){var _0x442fe8=this['channels'][_0x22b95d[_0x218f('0x21')]]['id'];this[_0x218f('0xe')][_0x22b95d[_0x218f('0x21')]][_0x218f('0x31')]=_0x22b95d[_0x218f('0x31')];this['channels'][_0x22b95d[_0x218f('0x21')]][_0x218f('0x32')]=_0x22b95d['pagestransferred'];this[_0x218f('0xe')][_0x22b95d[_0x218f('0x21')]][_0x218f('0x20')]=_0x22b95d[_0x218f('0x20')];this[_0x218f('0xe')][_0x22b95d['uniqueid']]['resolution']=_0x22b95d[_0x218f('0x33')];this[_0x218f('0xe')][_0x22b95d[_0x218f('0x21')]][_0x218f('0x34')]=_0x22b95d[_0x218f('0x34')];this[_0x218f('0xe')][_0x22b95d[_0x218f('0x21')]][_0x218f('0x2f')]=_0x22b95d[_0x218f('0x2f')];this['channels'][_0x22b95d[_0x218f('0x21')]]['calleridnum']=_0x22b95d[_0x218f('0x35')];if(this[_0x218f('0xe')][_0x22b95d[_0x218f('0x21')]][_0x218f('0x32')]>0x0){tiff2pdf(_0x22b95d[_0x218f('0x2f')],_0x218f('0x36'),function(_0x38f992){logger['info'](_0x22b95d[_0x218f('0x21')],'\x20result\x20conversion\x20file\x20',_0x38f992['message']);attachment[_0x218f('0x37')]({'name':path[_0x218f('0x38')](_0x22b95d[_0x218f('0x2f')])[_0x218f('0x23')],'basename':path[_0x218f('0x38')](_0x22b95d[_0x218f('0x2f')])[_0x218f('0x23')]+'.pdf','type':'application/pdf'})['then'](function(_0x561322){faxAccount[_0x218f('0x39')](_0x442fe8,{'from':_0x22b95d[_0x218f('0x35')],'mapKey':_0x218f('0x7'),'body':path['parse'](_0x22b95d[_0x218f('0x2f')])[_0x218f('0x23')]+'.pdf','AttachmentId':_0x561322['id']})['catch'](function(_0x52b3a1){logger[_0x218f('0x3a')](_0x22b95d[_0x218f('0x21')],_0x218f('0x3b'),JSON[_0x218f('0x3c')](_0x52b3a1));});})[_0x218f('0x3d')](function(_0x13f203){logger[_0x218f('0x3a')](_0x22b95d[_0x218f('0x21')],'\x20receiveFax\x20',JSON[_0x218f('0x3c')](_0x13f203));});});}logger['info'](_0x22b95d[_0x218f('0x21')],_0x218f('0x3e'));}};Fax[_0x218f('0x26')][_0x218f('0x1d')]=function(_0x303343){if(this['actions'][_0x303343['uniqueid']]){_[_0x218f('0x3f')](this[_0x218f('0xe')][_0x303343[_0x218f('0x21')]],_['pick'](_0x303343,['response',_0x218f('0x40')]));}};function updateStatus(_0xa5b36f){if(_0xa5b36f[_0x218f('0x41')]){faxMessage[_0x218f('0x42')](_0xa5b36f['AttachmentId'],{'failMessage':_0x218f('0x43')})[_0x218f('0x44')](function(_0x5099a6){ut['logger']('[Fax][Message][Error][Updated]',_0x5099a6);})['catch'](function(_0x340910){ut[_0x218f('0x45')](_0x218f('0x46'),_0x340910);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x218f('0x26')][_0x218f('0x47')]=function(_0x575f88,_0x53fa06,_0x509f45){var _0x1f2a3d=this;var _0x26d384={};if(_0x53fa06){_0x26d384={'read':_0x53fa06};}else{_0x26d384={'failMessage':_0x509f45};}if(this[_0x218f('0x11')][_0x575f88][_0x218f('0x41')]){faxMessage[_0x218f('0x42')](this[_0x218f('0x11')][_0x575f88][_0x218f('0x41')],_0x26d384)[_0x218f('0x44')](function(_0x22086e){ut[_0x218f('0x45')](_0x218f('0x48'),_0x22086e);})[_0x218f('0x3d')](function(_0x56280e){ut[_0x218f('0x45')](_0x218f('0x49'),_0x56280e);})[_0x218f('0x4a')](function(){delete _0x1f2a3d[_0x218f('0xe')][_0x575f88];delete _0x1f2a3d['actions'][_0x575f88];});}else{ut[_0x218f('0x45')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x575f88];delete this['actions'][_0x575f88];}};Fax[_0x218f('0x26')][_0x218f('0x1b')]=function(_0x20e1a0){var _0x139225=this;if(this['channels'][_0x20e1a0[_0x218f('0x21')]]){if(this['actions'][_0x20e1a0['uniqueid']]){this[_0x218f('0xe')][_0x20e1a0[_0x218f('0x21')]]['id']=this['actions'][_0x20e1a0['uniqueid']]['id'];this[_0x218f('0xe')][_0x20e1a0[_0x218f('0x21')]][_0x218f('0x23')]=this[_0x218f('0x11')][_0x20e1a0[_0x218f('0x21')]][_0x218f('0x23')];}logger['info'](_0x20e1a0[_0x218f('0x21')],this[_0x218f('0x11')][_0x20e1a0['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x218f('0x4b'),JSON['stringify'](this[_0x218f('0xe')][_0x20e1a0['uniqueid']]));if(this[_0x218f('0x11')][_0x20e1a0[_0x218f('0x21')]]){if(this['channels'][_0x20e1a0['uniqueid']][_0x218f('0x4c')]>0x0&&this[_0x218f('0xe')][_0x20e1a0[_0x218f('0x21')]][_0x218f('0x18')]==='SUCCESS'){this[_0x218f('0x47')](_0x20e1a0[_0x218f('0x21')],!![]);}else{this['updateStatus'](_0x20e1a0[_0x218f('0x21')],![],this['channels'][_0x20e1a0['uniqueid']]['faxstatusstring']?_0x218f('0x4d')+this[_0x218f('0xe')][_0x20e1a0[_0x218f('0x21')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x218f('0x26')][_0x218f('0x4e')]=function(_0x1469b4){var _0x417020=this;return new BPromise(function(_0x2f718d,_0x585efa){_0x417020[_0x218f('0x4f')](_0x1469b4,_0x417020[_0x218f('0xf')][_0x1469b4[_0x218f('0x50')]])['then'](function(_0x4fdf32){ut[_0x218f('0x45')](_0x218f('0x51'),_0x4fdf32);_0x2f718d(ut['message'](_0x218f('0x52')));})['catch'](function(_0x2ea92a){ut[_0x218f('0x45')](_0x218f('0x53'),_0x2ea92a);updateStatus(_0x1469b4);_0x585efa(ut['message'](_0x218f('0x54')));});});};Fax['prototype']['checkAfterSend']=function(_0x5ceec7){var _0x1284fb=this;return new BPromise(function(_0x31d859,_0x4dbdd8){var _0x420225=_0x1284fb['checkTrunk'](_0x1284fb[_0x218f('0xf')][_0x5ceec7[_0x218f('0x50')]][_0x218f('0x55')],_0x5ceec7);if(_0x420225[_0x218f('0x56')]){_0x31d859(ut['message'](_0x218f('0x57')));}else{_0x4dbdd8(ut[_0x218f('0x58')](_0x420225[_0x218f('0x58')]));}});};function originate(_0x20d76b,_0x114079,_0xd25591){return new BPromise(function(_0xb9b405,_0x55a69c){if(_0xd25591){var _0x269909=util[_0x218f('0x59')](_0x218f('0x5a'),path[_0x218f('0x38')](_0x20d76b[_0x218f('0x5b')])[_0x218f('0x23')],_0x20d76b[_0x218f('0x5b')]);gs[_0x218f('0x5c')](_0x269909)[_0x218f('0x44')](function(){_0x20d76b[_0x218f('0x5b')]=util['format'](_0x218f('0x5d'),path[_0x218f('0x38')](_0x20d76b[_0x218f('0x5b')])['dir'],path[_0x218f('0x38')](_0x20d76b[_0x218f('0x5b')])[_0x218f('0x23')]);_0x114079[_0x218f('0x5e')]=_0x20d76b[_0x218f('0x5b')];ut[_0x218f('0x45')](_0x218f('0x5f'),'');ami[_0x218f('0x60')](ut[_0x218f('0x61')](_0x20d76b,_0x114079))[_0x218f('0x44')](function(_0x23b0a8){_0xb9b405(_0x23b0a8);})['catch'](function(_0x13f709){_0x55a69c(_0x13f709);});})[_0x218f('0x3d')](function(_0x4b8300){_0x55a69c(_0x4b8300);});}else{ami['Action'](ut[_0x218f('0x61')](_0x20d76b,_0x114079))[_0x218f('0x44')](function(_0x5dca0d){_0xb9b405(_0x5dca0d);})['catch'](function(_0x142f8e){_0x55a69c(_0x142f8e);});}});}Fax[_0x218f('0x26')][_0x218f('0x4f')]=function(_0x184e4d,_0xcf4336){var _0x1fc583=this;return new BPromise(function(_0x2fc1c3,_0x21be7b){var _0x3aee9b=uuid['v4']();var _0x5b0b48=ut['addVariables'](_0x184e4d,_0xcf4336);_0x1fc583[_0x218f('0x11')][_0x3aee9b]=new Action(_0x3aee9b,_0xcf4336,_0x184e4d);var _0x16daa3=_0x1fc583[_0x218f('0x11')][_0x3aee9b];if(path[_0x218f('0x38')](_0x184e4d[_0x218f('0x5b')])[_0x218f('0x62')]===_0x218f('0x63')){originate(_0x16daa3,_0x5b0b48,!![])[_0x218f('0x44')](function(_0x3235ea){_0x2fc1c3(_0x3235ea);})[_0x218f('0x3d')](function(_0x5bf2de){_0x21be7b(_0x5bf2de);});}else{originate(_0x16daa3,_0x5b0b48,![])[_0x218f('0x44')](function(_0x3410f0){_0x2fc1c3(_0x3410f0);})[_0x218f('0x3d')](function(_0x10bfd4){_0x21be7b(_0x10bfd4);});}});};Fax[_0x218f('0x26')]['isTrunkReachable']=function(_0x52ba1c){return!_['isNil'](_0x52ba1c)&&!_[_0x218f('0x64')](_0x52ba1c['name'])&&!_[_0x218f('0x64')](_0x52ba1c['active'])&&_0x52ba1c[_0x218f('0x65')]&&!_[_0x218f('0x64')](this[_0x218f('0x10')][util[_0x218f('0x59')](_0x218f('0x66'),_0x52ba1c['name'])])&&!_['isNil'](this[_0x218f('0x10')][util[_0x218f('0x59')]('SIP/%s',_0x52ba1c[_0x218f('0x23')])][_0x218f('0x2e')])&&(this[_0x218f('0x10')][util[_0x218f('0x59')](_0x218f('0x66'),_0x52ba1c[_0x218f('0x23')])]['status']==='reachable'||this[_0x218f('0x10')][util['format'](_0x218f('0x66'),_0x52ba1c[_0x218f('0x23')])][_0x218f('0x2e')]===_0x218f('0x67'));};Fax[_0x218f('0x26')][_0x218f('0x68')]=function(_0x34ab6e,_0x43a4c0){if(!this['isTrunkReachable'](_0x34ab6e)){ut[_0x218f('0x45')](_0x218f('0x69'),_['isNil'](_0x34ab6e)?'':_0x34ab6e[_0x218f('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x218f('0x6a')};}if(_['isNil'](_0x43a4c0[_0x218f('0x7')])){ut[_0x218f('0x45')](_0x218f('0x6b'),JSON[_0x218f('0x3c')](_0x43a4c0));return{'isValid':![],'message':_0x218f('0x6c')};}if(_[_0x218f('0x64')](_0x43a4c0['path'])){ut[_0x218f('0x45')](_0x218f('0x6d'),JSON['stringify'](_0x43a4c0));return{'isValid':![],'message':_0x218f('0x6e')};}return{'isValid':!![],'message':_0x218f('0x6f')};};module[_0x218f('0x70')]=Fax; \ No newline at end of file +var _0xba44=['SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','Fax\x20received','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','parse','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','moment','path','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','prototype','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','.pdf','then','notify','catch','\x20notify\x20','error','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages'];(function(_0x52991d,_0x429d72){var _0x5b9004=function(_0x4bfe0d){while(--_0x4bfe0d){_0x52991d['push'](_0x52991d['shift']());}};_0x5b9004(++_0x429d72);}(_0xba44,0x189));var _0x4ba4=function(_0x205066,_0x7241c9){_0x205066=_0x205066-0x0;var _0x11f663=_0xba44[_0x205066];return _0x11f663;};'use strict';var util=require('util');var _=require(_0x4ba4('0x0'));var BPromise=require(_0x4ba4('0x1'));var uuid=require(_0x4ba4('0x2'));var moment=require(_0x4ba4('0x3'));var path=require(_0x4ba4('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x4ba4('0x5'))(_0x4ba4('0x6'));var ami=require(_0x4ba4('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x4ba4('0x8'));var ut=require(_0x4ba4('0x9'));var Action=require(_0x4ba4('0xa'));var faxAccount=require(_0x4ba4('0xb'));var attachment=require(_0x4ba4('0xc'));var faxMessage=require(_0x4ba4('0xd'));function Fax(_0x2a54b7){this[_0x4ba4('0xe')]={};this[_0x4ba4('0xf')]=_0x2a54b7[_0x4ba4('0xf')];this[_0x4ba4('0x10')]=_0x2a54b7[_0x4ba4('0x10')];this[_0x4ba4('0x11')]={};ami['on'](_0x4ba4('0x12'),this['syncNewchannel'][_0x4ba4('0x13')](this));ami['on'](_0x4ba4('0x14'),this[_0x4ba4('0x15')][_0x4ba4('0x13')](this));ami['on'](_0x4ba4('0x16'),this['syncNewState'][_0x4ba4('0x13')](this));ami['on'](_0x4ba4('0x17'),this['syncNewExten'][_0x4ba4('0x13')](this));ami['on'](_0x4ba4('0x18'),this[_0x4ba4('0x19')][_0x4ba4('0x13')](this));ami['on'](_0x4ba4('0x1a'),this[_0x4ba4('0x1b')]['bind'](this));ami['on']('hangup',this[_0x4ba4('0x1c')]['bind'](this));ami['on']('originateresponse',this[_0x4ba4('0x1d')][_0x4ba4('0x13')](this));}Fax['prototype'][_0x4ba4('0x1e')]=function(_0x264bb5){if(_0x264bb5[_0x4ba4('0x1f')]===_0x4ba4('0x20')){for(var _0x262e1e in this[_0x4ba4('0xf')]){if(this[_0x4ba4('0xf')][_0x4ba4('0x21')](_0x262e1e)){if(_0x264bb5[_0x4ba4('0x22')]===this[_0x4ba4('0xf')][_0x262e1e][_0x4ba4('0x23')]){this[_0x4ba4('0xe')][_0x264bb5[_0x4ba4('0x24')]]={};this['channels'][_0x264bb5[_0x4ba4('0x24')]]['channel']=_0x264bb5[_0x4ba4('0x25')];this[_0x4ba4('0xe')][_0x264bb5[_0x4ba4('0x24')]]['id']=this['faxAccounts'][_0x262e1e]['id'];this[_0x4ba4('0xe')][_0x264bb5['uniqueid']][_0x4ba4('0x26')]=this[_0x4ba4('0xf')][_0x262e1e][_0x4ba4('0x26')];logger[_0x4ba4('0x27')](_0x264bb5[_0x4ba4('0x24')],_0x4ba4('0x28'));}}}}if(this[_0x4ba4('0x11')][_0x264bb5[_0x4ba4('0x24')]]){this[_0x4ba4('0xe')][_0x264bb5[_0x4ba4('0x24')]]={};this['channels'][_0x264bb5['uniqueid']][_0x4ba4('0x25')]=_0x264bb5[_0x4ba4('0x25')];logger['info'](_0x264bb5['uniqueid'],_0x4ba4('0x28'));}};Fax['prototype'][_0x4ba4('0x15')]=function(_0x29c434){if(this[_0x4ba4('0xe')][_0x29c434[_0x4ba4('0x24')]]){for(var _0x327747 in _0x29c434[_0x4ba4('0x29')]){if(_0x29c434['variable'][_0x4ba4('0x21')](_0x327747)){this[_0x4ba4('0xe')][_0x29c434[_0x4ba4('0x24')]][_0x327747]=_0x29c434[_0x4ba4('0x2a')];}}}};Fax[_0x4ba4('0x2b')][_0x4ba4('0x2c')]=function(_0x34856d){if(this[_0x4ba4('0xe')][_0x34856d[_0x4ba4('0x24')]]){this[_0x4ba4('0xe')][_0x34856d[_0x4ba4('0x24')]][_0x4ba4('0x2d')]=_0x34856d[_0x4ba4('0x2d')];this[_0x4ba4('0xe')][_0x34856d[_0x4ba4('0x24')]]['channelstatedesc']=_0x34856d[_0x4ba4('0x2e')];}};Fax[_0x4ba4('0x2b')]['syncNewExten']=function(_0x2a0c53){if(this[_0x4ba4('0xe')][_0x2a0c53[_0x4ba4('0x24')]]){for(var _0x5c36c2 in _0x2a0c53['variable']){if(_0x2a0c53['variable']['hasOwnProperty'](_0x5c36c2)){this['channels'][_0x2a0c53['uniqueid']][_0x5c36c2]=_0x2a0c53[_0x4ba4('0x2a')];}}}};Fax[_0x4ba4('0x2b')][_0x4ba4('0x19')]=function(_0x511dfa){if(this[_0x4ba4('0xe')][_0x511dfa[_0x4ba4('0x24')]]){this[_0x4ba4('0xe')][_0x511dfa[_0x4ba4('0x24')]]['operation']=_0x511dfa[_0x4ba4('0x2f')];this[_0x4ba4('0xe')][_0x511dfa[_0x4ba4('0x24')]][_0x4ba4('0x30')]=_0x511dfa[_0x4ba4('0x30')];this['channels'][_0x511dfa[_0x4ba4('0x24')]][_0x4ba4('0x23')]=_0x511dfa[_0x4ba4('0x23')];this[_0x4ba4('0xe')][_0x511dfa[_0x4ba4('0x24')]]['filename']=_0x511dfa[_0x4ba4('0x31')];logger[_0x4ba4('0x27')](_0x511dfa[_0x4ba4('0x24')],_0x4ba4('0x32'));}};Fax[_0x4ba4('0x2b')][_0x4ba4('0x1b')]=function(_0xd1effd){var _0x166fd8=this;if(this[_0x4ba4('0xe')][_0xd1effd[_0x4ba4('0x24')]]){var _0x120646=this[_0x4ba4('0xe')][_0xd1effd['uniqueid']]['id'];this[_0x4ba4('0xe')][_0xd1effd['uniqueid']][_0x4ba4('0x33')]=_0xd1effd[_0x4ba4('0x33')];this[_0x4ba4('0xe')][_0xd1effd[_0x4ba4('0x24')]]['pagestransferred']=_0xd1effd[_0x4ba4('0x34')];this['channels'][_0xd1effd[_0x4ba4('0x24')]][_0x4ba4('0x23')]=_0xd1effd[_0x4ba4('0x23')];this[_0x4ba4('0xe')][_0xd1effd[_0x4ba4('0x24')]]['resolution']=_0xd1effd['resolution'];this[_0x4ba4('0xe')][_0xd1effd[_0x4ba4('0x24')]]['transferrate']=_0xd1effd[_0x4ba4('0x35')];this[_0x4ba4('0xe')][_0xd1effd[_0x4ba4('0x24')]][_0x4ba4('0x31')]=_0xd1effd[_0x4ba4('0x31')];this[_0x4ba4('0xe')][_0xd1effd[_0x4ba4('0x24')]][_0x4ba4('0x36')]=_0xd1effd[_0x4ba4('0x36')];if(this['channels'][_0xd1effd[_0x4ba4('0x24')]][_0x4ba4('0x34')]>0x0){tiff2pdf(_0xd1effd[_0x4ba4('0x31')],_0x4ba4('0x37'),function(_0x35a72b){logger['info'](_0xd1effd[_0x4ba4('0x24')],_0x4ba4('0x38'),_0x35a72b[_0x4ba4('0x39')]);attachment['create']({'name':path['parse'](_0xd1effd['filename'])[_0x4ba4('0x26')],'basename':path['parse'](_0xd1effd[_0x4ba4('0x31')])['name']+_0x4ba4('0x3a'),'type':'application/pdf'})[_0x4ba4('0x3b')](function(_0xe5444f){faxAccount[_0x4ba4('0x3c')](_0x120646,{'from':_0xd1effd[_0x4ba4('0x36')],'mapKey':'fax','body':path['parse'](_0xd1effd[_0x4ba4('0x31')])[_0x4ba4('0x26')]+_0x4ba4('0x3a'),'AttachmentId':_0xe5444f['id']})[_0x4ba4('0x3d')](function(_0x1002f4){logger['error'](_0xd1effd[_0x4ba4('0x24')],_0x4ba4('0x3e'),JSON['stringify'](_0x1002f4));});})[_0x4ba4('0x3d')](function(_0x58a07a){logger[_0x4ba4('0x3f')](_0xd1effd['uniqueid'],_0x4ba4('0x40'),JSON[_0x4ba4('0x41')](_0x58a07a));});});}logger[_0x4ba4('0x27')](_0xd1effd['uniqueid'],_0x4ba4('0x40'));}};Fax[_0x4ba4('0x2b')][_0x4ba4('0x1d')]=function(_0x4902af){if(this['actions'][_0x4902af[_0x4ba4('0x24')]]){_[_0x4ba4('0x42')](this['channels'][_0x4902af[_0x4ba4('0x24')]],_[_0x4ba4('0x43')](_0x4902af,[_0x4ba4('0x44'),_0x4ba4('0x45')]));}};function updateStatus(_0x19df6b){if(_0x19df6b['AttachmentId']){faxMessage['update'](_0x19df6b[_0x4ba4('0x46')],{'failMessage':_0x4ba4('0x47')})[_0x4ba4('0x3b')](function(_0x4f5e0f){ut[_0x4ba4('0x48')]('[Fax][Message][Error][Updated]',_0x4f5e0f);})['catch'](function(_0x1847cf){ut[_0x4ba4('0x48')](_0x4ba4('0x49'),_0x1847cf);});}else{ut[_0x4ba4('0x48')](_0x4ba4('0x4a'));}}Fax[_0x4ba4('0x2b')][_0x4ba4('0x4b')]=function(_0x17e952,_0x202833,_0x5aefe5){var _0x56dba6=this;var _0x2a4ca7={};if(_0x202833){_0x2a4ca7={'read':_0x202833};}else{_0x2a4ca7={'failMessage':_0x5aefe5};}if(this[_0x4ba4('0x11')][_0x17e952][_0x4ba4('0x46')]){faxMessage[_0x4ba4('0x4c')](this['actions'][_0x17e952][_0x4ba4('0x46')],_0x2a4ca7)['then'](function(_0xd81b7d){ut['logger'](_0x4ba4('0x4d'),_0xd81b7d);})['catch'](function(_0x4c2249){ut[_0x4ba4('0x48')](_0x4ba4('0x4e'),_0x4c2249);})[_0x4ba4('0x4f')](function(){delete _0x56dba6[_0x4ba4('0xe')][_0x17e952];delete _0x56dba6[_0x4ba4('0x11')][_0x17e952];});}else{ut[_0x4ba4('0x48')]('[Fax][Message][NoUpdate2]');delete this[_0x4ba4('0xe')][_0x17e952];delete this[_0x4ba4('0x11')][_0x17e952];}};Fax[_0x4ba4('0x2b')][_0x4ba4('0x1c')]=function(_0x3b33cb){var _0x4da99d=this;if(this[_0x4ba4('0xe')][_0x3b33cb['uniqueid']]){if(this[_0x4ba4('0x11')][_0x3b33cb[_0x4ba4('0x24')]]){this[_0x4ba4('0xe')][_0x3b33cb[_0x4ba4('0x24')]]['id']=this[_0x4ba4('0x11')][_0x3b33cb[_0x4ba4('0x24')]]['id'];this['channels'][_0x3b33cb[_0x4ba4('0x24')]]['name']=this[_0x4ba4('0x11')][_0x3b33cb[_0x4ba4('0x24')]][_0x4ba4('0x26')];}logger[_0x4ba4('0x27')](_0x3b33cb['uniqueid'],this[_0x4ba4('0x11')][_0x3b33cb[_0x4ba4('0x24')]]?_0x4ba4('0x50'):_0x4ba4('0x51'),JSON['stringify'](this[_0x4ba4('0xe')][_0x3b33cb[_0x4ba4('0x24')]]));if(this['actions'][_0x3b33cb[_0x4ba4('0x24')]]){if(this[_0x4ba4('0xe')][_0x3b33cb[_0x4ba4('0x24')]][_0x4ba4('0x52')]>0x0&&this[_0x4ba4('0xe')][_0x3b33cb[_0x4ba4('0x24')]]['faxstatus']===_0x4ba4('0x53')){this[_0x4ba4('0x4b')](_0x3b33cb[_0x4ba4('0x24')],!![]);}else{this[_0x4ba4('0x4b')](_0x3b33cb[_0x4ba4('0x24')],![],this[_0x4ba4('0xe')][_0x3b33cb[_0x4ba4('0x24')]]['faxstatusstring']?_0x4ba4('0x54')+this['channels'][_0x3b33cb['uniqueid']][_0x4ba4('0x55')]:_0x4ba4('0x56'));}}}};Fax[_0x4ba4('0x2b')][_0x4ba4('0x57')]=function(_0x5eb4cf){var _0x43a90d=this;return new BPromise(function(_0x3c9eab,_0x32e40){_0x43a90d[_0x4ba4('0x58')](_0x5eb4cf,_0x43a90d[_0x4ba4('0xf')][_0x5eb4cf['FaxAccountId']])[_0x4ba4('0x3b')](function(_0x375ddf){ut[_0x4ba4('0x48')]('[Fax][execOriginate][success]',_0x375ddf);_0x3c9eab(ut[_0x4ba4('0x39')](_0x4ba4('0x59')));})[_0x4ba4('0x3d')](function(_0x55352d){ut[_0x4ba4('0x48')]('[Fax][execOriginate][failure]',_0x55352d);updateStatus(_0x5eb4cf);_0x32e40(ut[_0x4ba4('0x39')]('Fax\x20failed'));});});};Fax[_0x4ba4('0x2b')]['checkAfterSend']=function(_0xc181cc){var _0x2711aa=this;return new BPromise(function(_0x15f3d6,_0x429cb6){var _0x1b6b28=_0x2711aa[_0x4ba4('0x5a')](_0x2711aa[_0x4ba4('0xf')][_0xc181cc[_0x4ba4('0x5b')]][_0x4ba4('0x5c')],_0xc181cc);if(_0x1b6b28[_0x4ba4('0x5d')]){_0x15f3d6(ut[_0x4ba4('0x39')](_0x4ba4('0x5e')));}else{_0x429cb6(ut[_0x4ba4('0x39')](_0x1b6b28[_0x4ba4('0x39')]));}});};function originate(_0x13dbf5,_0x185881,_0x5eb749){return new BPromise(function(_0x4fc3ab,_0xeb63cf){if(_0x5eb749){var _0x105873=util[_0x4ba4('0x5f')](_0x4ba4('0x60'),path[_0x4ba4('0x61')](_0x13dbf5[_0x4ba4('0x4')])[_0x4ba4('0x26')],_0x13dbf5[_0x4ba4('0x4')]);gs[_0x4ba4('0x62')](_0x105873)[_0x4ba4('0x3b')](function(){_0x13dbf5[_0x4ba4('0x4')]=util['format'](_0x4ba4('0x63'),path[_0x4ba4('0x61')](_0x13dbf5[_0x4ba4('0x4')])[_0x4ba4('0x64')],path['parse'](_0x13dbf5[_0x4ba4('0x4')])[_0x4ba4('0x26')]);_0x185881['XMF-PATH']=_0x13dbf5['path'];ut[_0x4ba4('0x48')](_0x4ba4('0x65'),'');ami[_0x4ba4('0x66')](ut[_0x4ba4('0x67')](_0x13dbf5,_0x185881))[_0x4ba4('0x3b')](function(_0x5450a8){_0x4fc3ab(_0x5450a8);})[_0x4ba4('0x3d')](function(_0x2e3acd){_0xeb63cf(_0x2e3acd);});})[_0x4ba4('0x3d')](function(_0x1eca42){_0xeb63cf(_0x1eca42);});}else{ami[_0x4ba4('0x66')](ut[_0x4ba4('0x67')](_0x13dbf5,_0x185881))['then'](function(_0x1f1da0){_0x4fc3ab(_0x1f1da0);})[_0x4ba4('0x3d')](function(_0x5c1510){_0xeb63cf(_0x5c1510);});}});}Fax['prototype'][_0x4ba4('0x58')]=function(_0x3844c1,_0x52166c){var _0x3a4406=this;return new BPromise(function(_0x162467,_0x777b53){var _0x5a834a=uuid['v4']();var _0x27aae8=ut[_0x4ba4('0x68')](_0x3844c1,_0x52166c);_0x3a4406[_0x4ba4('0x11')][_0x5a834a]=new Action(_0x5a834a,_0x52166c,_0x3844c1);var _0x28f0a9=_0x3a4406[_0x4ba4('0x11')][_0x5a834a];if(path[_0x4ba4('0x61')](_0x3844c1['path'])[_0x4ba4('0x69')]===_0x4ba4('0x3a')){originate(_0x28f0a9,_0x27aae8,!![])['then'](function(_0x21712d){_0x162467(_0x21712d);})[_0x4ba4('0x3d')](function(_0x42de2c){_0x777b53(_0x42de2c);});}else{originate(_0x28f0a9,_0x27aae8,![])[_0x4ba4('0x3b')](function(_0x12b015){_0x162467(_0x12b015);})[_0x4ba4('0x3d')](function(_0x2ad44d){_0x777b53(_0x2ad44d);});}});};Fax[_0x4ba4('0x2b')][_0x4ba4('0x6a')]=function(_0x377fa5){return!_[_0x4ba4('0x6b')](_0x377fa5)&&!_['isNil'](_0x377fa5['name'])&&!_[_0x4ba4('0x6b')](_0x377fa5[_0x4ba4('0x6c')])&&_0x377fa5[_0x4ba4('0x6c')]&&!_[_0x4ba4('0x6b')](this['trunks'][util[_0x4ba4('0x5f')](_0x4ba4('0x6d'),_0x377fa5[_0x4ba4('0x26')])])&&!_[_0x4ba4('0x6b')](this['trunks'][util[_0x4ba4('0x5f')](_0x4ba4('0x6d'),_0x377fa5[_0x4ba4('0x26')])][_0x4ba4('0x30')])&&(this['trunks'][util[_0x4ba4('0x5f')](_0x4ba4('0x6d'),_0x377fa5[_0x4ba4('0x26')])][_0x4ba4('0x30')]===_0x4ba4('0x6e')||this[_0x4ba4('0x10')][util[_0x4ba4('0x5f')](_0x4ba4('0x6d'),_0x377fa5[_0x4ba4('0x26')])][_0x4ba4('0x30')]===_0x4ba4('0x6f'));};Fax[_0x4ba4('0x2b')][_0x4ba4('0x5a')]=function(_0x3a88bb,_0x3252b0){if(!this[_0x4ba4('0x6a')](_0x3a88bb)){ut['logger'](_0x4ba4('0x70'),_[_0x4ba4('0x6b')](_0x3a88bb)?'':_0x3a88bb[_0x4ba4('0x26')]+_0x4ba4('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x4ba4('0x6b')](_0x3252b0[_0x4ba4('0x6')])){ut[_0x4ba4('0x48')](_0x4ba4('0x72'),JSON['stringify'](_0x3252b0));return{'isValid':![],'message':_0x4ba4('0x73')};}if(_['isNil'](_0x3252b0[_0x4ba4('0x4')])){ut['logger'](_0x4ba4('0x74'),JSON[_0x4ba4('0x41')](_0x3252b0));return{'isValid':![],'message':_0x4ba4('0x75')};}return{'isValid':!![],'message':_0x4ba4('0x76')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 53ca65d..7613a6a 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 _0xbfba=['inspect','notify','then','[Notify]\x20','bluebird','../../../config/logger','lodash'];(function(_0xa1f946,_0x1b2d2d){var _0x5b6448=function(_0x4e79f8){while(--_0x4e79f8){_0xa1f946['push'](_0xa1f946['shift']());}};_0x5b6448(++_0x1b2d2d);}(_0xbfba,0x74));var _0xabfb=function(_0x4a311c,_0x5ea54b){_0x4a311c=_0x4a311c-0x0;var _0x3a4ef5=_0xbfba[_0x4a311c];return _0x3a4ef5;};'use strict';var util=require('util');var BPromise=require(_0xabfb('0x0'));var logger=require(_0xabfb('0x1'))('preview');var _=require(_0xabfb('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0xb7f4f5){return function(_0x186a2c){logger['error'](_0xb7f4f5,util[_0xabfb('0x3')](_0x186a2c,{'showHidden':![],'depth':null}));};}exports[_0xabfb('0x4')]=function(_0x505c6d,_0x55efc1){return BPromise['resolve']()[_0xabfb('0x5')](faxAccount[_0xabfb('0x4')](_0x505c6d,_0x55efc1))['catch'](loggerCatch(_0xabfb('0x6')));}; \ No newline at end of file +var _0xb4c1=['notify','resolve','then','catch','[Notify]\x20','util','bluebird','preview','error','inspect'];(function(_0x1e397a,_0x345f5b){var _0x2efb4d=function(_0x552c32){while(--_0x552c32){_0x1e397a['push'](_0x1e397a['shift']());}};_0x2efb4d(++_0x345f5b);}(_0xb4c1,0x9b));var _0x1b4c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb4c1[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x1b4c('0x0'));var BPromise=require(_0x1b4c('0x1'));var logger=require('../../../config/logger')(_0x1b4c('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1495f9){return function(_0x388715){logger[_0x1b4c('0x3')](_0x1495f9,util[_0x1b4c('0x4')](_0x388715,{'showHidden':![],'depth':null}));};}exports[_0x1b4c('0x5')]=function(_0x5dcfc7,_0x3066af){return BPromise[_0x1b4c('0x6')]()[_0x1b4c('0x7')](faxAccount[_0x1b4c('0x5')](_0x5dcfc7,_0x3066af))[_0x1b4c('0x8')](loggerCatch(_0x1b4c('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 6db71a4..8bbcceb 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 _0x1e73=['\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird','execute','info','Exec\x20gs'];(function(_0x23a766,_0x2eab2c){var _0x439cd4=function(_0x4b2913){while(--_0x4b2913){_0x23a766['push'](_0x23a766['shift']());}};_0x439cd4(++_0x2eab2c);}(_0x1e73,0x17a));var _0x31e7=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0x1e73[_0x576e2b];return _0x46461a;};'use strict';var util=require('util');var logger=require(_0x31e7('0x0'))(_0x31e7('0x1'));var BPromise=require(_0x31e7('0x2'));var exec=require('child_process')['exec'];exports[_0x31e7('0x3')]=function(_0x3af17d){return new BPromise(function(_0x411a88,_0x8ba578){exec(_0x3af17d,function(_0x4691e6,_0x576f1b,_0x8c7b23){logger['info']('Exec\x20gs',_0x576f1b);if(_0x4691e6){logger[_0x31e7('0x4')](_0x31e7('0x5'),_0x31e7('0x6'),util[_0x31e7('0x7')](_0x4691e6,{'showHidden':![],'depth':null}),_0x576f1b,_0x8c7b23);_0x8ba578(_0x4691e6);}_0x411a88(_0x576f1b);});});}; \ No newline at end of file +var _0xadc4=['execute','Exec\x20gs','info','\x20Error\x20:','inspect','util','../../../../config/logger','bluebird','child_process','exec'];(function(_0x1c2607,_0xb7333b){var _0xc38a62=function(_0x1ea270){while(--_0x1ea270){_0x1c2607['push'](_0x1c2607['shift']());}};_0xc38a62(++_0xb7333b);}(_0xadc4,0x195));var _0x4adc=function(_0x5af1ce,_0x318f6e){_0x5af1ce=_0x5af1ce-0x0;var _0x4e7f4f=_0xadc4[_0x5af1ce];return _0x4e7f4f;};'use strict';var util=require(_0x4adc('0x0'));var logger=require(_0x4adc('0x1'))('fax');var BPromise=require(_0x4adc('0x2'));var exec=require(_0x4adc('0x3'))[_0x4adc('0x4')];exports[_0x4adc('0x5')]=function(_0xcf0050){return new BPromise(function(_0x1c2563,_0xc61d08){exec(_0xcf0050,function(_0x1dfd03,_0x2286f3,_0x14c6a7){logger['info'](_0x4adc('0x6'),_0x2286f3);if(_0x1dfd03){logger[_0x4adc('0x7')]('Exec\x20gs',_0x4adc('0x8'),util[_0x4adc('0x9')](_0x1dfd03,{'showHidden':![],'depth':null}),_0x2286f3,_0x14c6a7);_0xc61d08(_0x1dfd03);}_0x1c2563(_0x2286f3);});});}; \ 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 7b6b615..4d0e846 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 _0x5cbf=['xcally-motion-fax','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','message','logger','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path'];(function(_0x73b80e,_0x4daa4a){var _0x4c31cd=function(_0x3663a0){while(--_0x3663a0){_0x73b80e['push'](_0x73b80e['shift']());}};_0x4c31cd(++_0x4daa4a);}(_0x5cbf,0x179));var _0xf5cb=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x5cbf[_0x2faddb];return _0x273c05;};'use strict';var util=require(_0xf5cb('0x0'));var _=require(_0xf5cb('0x1'));var moment=require(_0xf5cb('0x2'));var logger=require(_0xf5cb('0x3'))('fax');exports[_0xf5cb('0x4')]=function(_0x38b64a){return{'message':_0x38b64a};};exports[_0xf5cb('0x5')]=function(_0x53b1ef,_0xf622e2){logger['info'](_0x53b1ef,util[_0xf5cb('0x6')](_0xf622e2,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x94f9bf,_0x2afca8){var _0x2aaf1c={'XMF-ECM':_0x2afca8[_0xf5cb('0x7')],'XMF-HEADERINFO':_0x2afca8[_0xf5cb('0x8')],'XMF-MINRATE':_0x2afca8[_0xf5cb('0x9')],'XMF-MAXRATE':_0x2afca8[_0xf5cb('0xa')],'XMF-MODEM':util[_0xf5cb('0xb')](_0xf5cb('0xc'),_0x2afca8[_0xf5cb('0xd')]),'XMF-GATEWAY':_0x2afca8[_0xf5cb('0xe')],'XMF-FAXDETECT':_0x2afca8[_0xf5cb('0xf')],'XMF-T38TIMEOUT':_0x2afca8[_0xf5cb('0x10')],'XMF-LOCALSTATIONID':_0x2afca8[_0xf5cb('0x11')],'XMF-PATH':_0x94f9bf[_0xf5cb('0x12')]};return _0x2aaf1c;};exports['variablesAction']=function(_0x18199e,_0x1e2e82){return{'actionid':_0x18199e['uniqueid'],'action':'originate','channel':_0x18199e['channel'],'Exten':_0xf5cb('0x13'),'Context':'from-sip','Priority':'1','callerid':util[_0xf5cb('0xb')](_0xf5cb('0x14'),_0x18199e[_0xf5cb('0x8')]?_0x18199e[_0xf5cb('0x8')]:'',_0x18199e[_0xf5cb('0x11')]),'variable':_0x1e2e82,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x18199e[_0xf5cb('0x15')]};}; \ No newline at end of file +var _0x29e5=['inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','t38timeout','localstationid','variablesAction','originate','from-sip','format','\x22%s\x22\x20<%s>','uniqueid','lodash','moment','fax','logger','info'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x29e5,0x1f3));var _0x529e=function(_0x5c21b1,_0x44fb56){_0x5c21b1=_0x5c21b1-0x0;var _0x16012e=_0x29e5[_0x5c21b1];return _0x16012e;};'use strict';var util=require('util');var _=require(_0x529e('0x0'));var moment=require(_0x529e('0x1'));var logger=require('../../../../config/logger')(_0x529e('0x2'));exports['message']=function(_0x15df84){return{'message':_0x15df84};};exports[_0x529e('0x3')]=function(_0x1144e2,_0x12bc96){logger[_0x529e('0x4')](_0x1144e2,util[_0x529e('0x5')](_0x12bc96,{'showHidden':![],'depth':null}));};exports[_0x529e('0x6')]=function(_0x44b95a,_0x48a7e6){var _0x5538a1={'XMF-ECM':_0x48a7e6[_0x529e('0x7')],'XMF-HEADERINFO':_0x48a7e6[_0x529e('0x8')],'XMF-MINRATE':_0x48a7e6[_0x529e('0x9')],'XMF-MAXRATE':_0x48a7e6[_0x529e('0xa')],'XMF-MODEM':util['format'](_0x529e('0xb'),_0x48a7e6[_0x529e('0xc')]),'XMF-GATEWAY':_0x48a7e6['gateway'],'XMF-FAXDETECT':_0x48a7e6['faxdetect'],'XMF-T38TIMEOUT':_0x48a7e6[_0x529e('0xd')],'XMF-LOCALSTATIONID':_0x48a7e6[_0x529e('0xe')],'XMF-PATH':_0x44b95a['path']};return _0x5538a1;};exports[_0x529e('0xf')]=function(_0x2dbf7a,_0x20e924){return{'actionid':_0x2dbf7a['uniqueid'],'action':_0x529e('0x10'),'channel':_0x2dbf7a['channel'],'Exten':'xcally-motion-fax','Context':_0x529e('0x11'),'Priority':'1','callerid':util[_0x529e('0x12')](_0x529e('0x13'),_0x2dbf7a[_0x529e('0x8')]?_0x2dbf7a[_0x529e('0x8')]:'',_0x2dbf7a['localstationid']),'variable':_0x20e924,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2dbf7a[_0x529e('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index e04c6dd..c2603d6 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 _0x34df=['initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','inspect','listen','sync','error','[index.js][main]','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','initTemplates','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts'];(function(_0x390319,_0x4ae1ac){var _0x5bbef7=function(_0x4010f4){while(--_0x4010f4){_0x390319['push'](_0x390319['shift']());}};_0x5bbef7(++_0x4ae1ac);}(_0x34df,0x160));var _0xf34d=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x34df[_0x680821];return _0x3f132c;};'use strict';var util=require('util');var moment=require('moment');var server=require(_0xf34d('0x0'));var Realtime=require('./realtime');var Report=require(_0xf34d('0x1'));var Acw=require(_0xf34d('0x2'));var Trigger=require(_0xf34d('0x3'));var Dialer=require(_0xf34d('0x4'));var Preview=require(_0xf34d('0x5'));var Fax=require(_0xf34d('0x6'));var user=require(_0xf34d('0x7'));var voiceQueue=require(_0xf34d('0x8'));var voiceQueueReport=require(_0xf34d('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xf34d('0xa'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xf34d('0xb'));var zendesk=require(_0xf34d('0xc'));var salesforce=require(_0xf34d('0xd'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xf34d('0xe'));var desk=require(_0xf34d('0xf'));var zoho=require(_0xf34d('0x10'));var vtiger=require(_0xf34d('0x11'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xf34d('0x12'));var dynamics365=require(_0xf34d('0x13'));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(_0xf34d('0x14'))(_0xf34d('0x15'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xf34d('0x16')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf34d('0x16')](_0xf34d('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xf34d('0x18')]()[_0xf34d('0x19')](user[_0xf34d('0x1a')]())[_0xf34d('0x19')](realtime[_0xf34d('0x1b')]())[_0xf34d('0x19')](user[_0xf34d('0x1c')]())['then'](realtime['initTelephones']())['then'](trunk[_0xf34d('0x1d')]())[_0xf34d('0x19')](realtime[_0xf34d('0x1e')]())[_0xf34d('0x19')](voiceQueue[_0xf34d('0x1f')]())[_0xf34d('0x19')](realtime['initVoiceQueues']())[_0xf34d('0x19')](trigger[_0xf34d('0x20')]())[_0xf34d('0x19')](realtime[_0xf34d('0x21')]())[_0xf34d('0x19')](template['getTemplates']())[_0xf34d('0x19')](realtime[_0xf34d('0x22')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())[_0xf34d('0x19')](salesforce[_0xf34d('0x23')]())['then'](realtime[_0xf34d('0x24')]())[_0xf34d('0x19')](sugarcrm[_0xf34d('0x25')]())[_0xf34d('0x19')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xf34d('0x26')]())[_0xf34d('0x19')](realtime[_0xf34d('0x27')]())[_0xf34d('0x19')](desk[_0xf34d('0x28')]())[_0xf34d('0x19')](realtime[_0xf34d('0x29')]())[_0xf34d('0x19')](zoho[_0xf34d('0x2a')]())['then'](realtime[_0xf34d('0x2b')]())[_0xf34d('0x19')](vtiger[_0xf34d('0x2c')]())[_0xf34d('0x19')](realtime[_0xf34d('0x2d')]())[_0xf34d('0x19')](freshsales[_0xf34d('0x2e')]())[_0xf34d('0x19')](realtime[_0xf34d('0x2f')]())[_0xf34d('0x19')](servicenow[_0xf34d('0x30')]())[_0xf34d('0x19')](realtime[_0xf34d('0x31')]())[_0xf34d('0x19')](dynamics365['getDynamics365Accounts']())[_0xf34d('0x19')](realtime[_0xf34d('0x32')]())[_0xf34d('0x19')](campaign[_0xf34d('0x33')]())[_0xf34d('0x19')](realtime[_0xf34d('0x34')]())['then'](voiceExtension[_0xf34d('0x35')]())[_0xf34d('0x19')](realtime[_0xf34d('0x36')]())['then'](faxAccount[_0xf34d('0x37')]())[_0xf34d('0x19')](realtime[_0xf34d('0x38')]())[_0xf34d('0x19')](function(){return realtime;});}function initParams(){return Promise[_0xf34d('0x18')]()[_0xf34d('0x19')](voiceQueueReport[_0xf34d('0x39')]())[_0xf34d('0x19')](realtime['initVoiceQueueReports']())[_0xf34d('0x19')](cmHopperHistory[_0xf34d('0x3a')]())[_0xf34d('0x19')](realtime[_0xf34d('0x3b')]())[_0xf34d('0x19')](cmHopperHistory[_0xf34d('0x3c')]())[_0xf34d('0x19')](realtime[_0xf34d('0x3d')]())[_0xf34d('0x19')](voiceCallReport['getVoiceCallReports']())[_0xf34d('0x19')](realtime['initVoiceCallReports']())[_0xf34d('0x3e')](function(_0x141c9a){logger['error']('[index.js][initParams]',util[_0xf34d('0x3f')](_0x141c9a,{'showHidden':![],'depth':null}));});}function main(){return server[_0xf34d('0x40')](realtime,preview,fax)[_0xf34d('0x19')](function(){return initRealtime();})[_0xf34d('0x19')](function(){return initParams();})[_0xf34d('0x19')](function(){report[_0xf34d('0x41')]();setInterval(initRealtime,0x1388);})[_0xf34d('0x3e')](function(_0x1aacab){logger[_0xf34d('0x42')](_0xf34d('0x43'),util[_0xf34d('0x3f')](_0x1aacab,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xf5a5=['./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then','initAgents','getTelephones','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','moment','./server'];(function(_0x6cf13f,_0x4d2970){var _0x489e2=function(_0x14f6c6){while(--_0x14f6c6){_0x6cf13f['push'](_0x6cf13f['shift']());}};_0x489e2(++_0x4d2970);}(_0xf5a5,0x152));var _0x5f5a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xf5a5[_0x5f09c5];return _0x426ad9;};'use strict';var util=require('util');var moment=require(_0x5f5a('0x0'));var server=require(_0x5f5a('0x1'));var Realtime=require(_0x5f5a('0x2'));var Report=require(_0x5f5a('0x3'));var Acw=require(_0x5f5a('0x4'));var Trigger=require(_0x5f5a('0x5'));var Dialer=require(_0x5f5a('0x6'));var Preview=require(_0x5f5a('0x7'));var Fax=require(_0x5f5a('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0x5f5a('0x9'));var voiceQueueReport=require(_0x5f5a('0xa'));var voiceCallReport=require(_0x5f5a('0xb'));var trunk=require(_0x5f5a('0xc'));var trigger=require(_0x5f5a('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0x5f5a('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x5f5a('0xf'));var faxAccount=require(_0x5f5a('0x10'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x5f5a('0x11'));var freshdesk=require(_0x5f5a('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x5f5a('0x13'));var vtiger=require(_0x5f5a('0x14'));var freshsales=require(_0x5f5a('0x15'));var servicenow=require(_0x5f5a('0x16'));var dynamics365=require(_0x5f5a('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x5f5a('0x18'))(_0x5f5a('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5f5a('0x1a')](_0x5f5a('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5f5a('0x1a')](_0x5f5a('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x5f5a('0x1c')](user['getAgents']())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x1d')]())[_0x5f5a('0x1c')](user[_0x5f5a('0x1e')]())[_0x5f5a('0x1c')](realtime['initTelephones']())[_0x5f5a('0x1c')](trunk['getTrunks']())[_0x5f5a('0x1c')](realtime['initTrunks']())[_0x5f5a('0x1c')](voiceQueue['getVoiceQueues']())['then'](realtime[_0x5f5a('0x1f')]())['then'](trigger[_0x5f5a('0x20')]())['then'](realtime[_0x5f5a('0x21')]())[_0x5f5a('0x1c')](template[_0x5f5a('0x22')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x23')]())[_0x5f5a('0x1c')](zendesk[_0x5f5a('0x24')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x25')]())[_0x5f5a('0x1c')](salesforce[_0x5f5a('0x26')]())[_0x5f5a('0x1c')](realtime['initSalesforceAccounts']())[_0x5f5a('0x1c')](sugarcrm[_0x5f5a('0x27')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x28')]())[_0x5f5a('0x1c')](freshdesk[_0x5f5a('0x29')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x2a')]())['then'](desk[_0x5f5a('0x2b')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x2c')]())[_0x5f5a('0x1c')](zoho[_0x5f5a('0x2d')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x2e')]())[_0x5f5a('0x1c')](vtiger['getVtigerAccounts']())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x2f')]())[_0x5f5a('0x1c')](freshsales['getFreshsalesAccounts']())[_0x5f5a('0x1c')](realtime['initFreshsalesAccounts']())[_0x5f5a('0x1c')](servicenow['getServicenowAccounts']())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x30')]())[_0x5f5a('0x1c')](dynamics365[_0x5f5a('0x31')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x32')]())['then'](campaign[_0x5f5a('0x33')]())['then'](realtime[_0x5f5a('0x34')]())[_0x5f5a('0x1c')](voiceExtension[_0x5f5a('0x35')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x36')]())[_0x5f5a('0x1c')](faxAccount[_0x5f5a('0x37')]())[_0x5f5a('0x1c')](realtime['initFaxAccounts']())[_0x5f5a('0x1c')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x5f5a('0x1c')](voiceQueueReport[_0x5f5a('0x38')]())[_0x5f5a('0x1c')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x5f5a('0x39')]())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x3a')]())[_0x5f5a('0x1c')](cmHopperHistory['getCampaignHopperHistory']())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x3b')]())[_0x5f5a('0x1c')](voiceCallReport['getVoiceCallReports']())[_0x5f5a('0x1c')](realtime[_0x5f5a('0x3c')]())[_0x5f5a('0x3d')](function(_0x1d0c74){logger[_0x5f5a('0x3e')](_0x5f5a('0x3f'),util[_0x5f5a('0x40')](_0x1d0c74,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5f5a('0x41')](realtime,preview,fax)[_0x5f5a('0x1c')](function(){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x5f5a('0x42')]();setInterval(initRealtime,0x1388);})['catch'](function(_0xabfbe7){logger['error'](_0x5f5a('0x43'),util[_0x5f5a('0x40')](_0xabfbe7,{'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 7eca801..0627275 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 _0x484c=['moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','accountcode','fullname','unknown','stateTime','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format','email','state','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util'];(function(_0x2e6c7d,_0x4ef753){var _0x5a1061=function(_0x13ac00){while(--_0x13ac00){_0x2e6c7d['push'](_0x2e6c7d['shift']());}};_0x5a1061(++_0x4ef753);}(_0x484c,0x198));var _0xc484=function(_0x34e31c,_0x1b1282){_0x34e31c=_0x34e31c-0x0;var _0x5c2c0e=_0x484c[_0x34e31c];return _0x5c2c0e;};'use strict';var _=require(_0xc484('0x0'));var util=require(_0xc484('0x1'));var moment=require(_0xc484('0x2'));var md5=require(_0xc484('0x3'));var Redis=require(_0xc484('0x4'));var config=require(_0xc484('0x5'));config['redis']=_['defaults'](config[_0xc484('0x6')],{'host':_0xc484('0x7'),'port':0x18eb});var io=require(_0xc484('0x8'))(new Redis(config[_0xc484('0x6')]));function Agent(_0xfcb3d6){this['id']=_0xfcb3d6['id']||0x0;this[_0xc484('0x9')]=_0xfcb3d6[_0xc484('0x9')]||'';this['email']=_0xfcb3d6['email']||'';this['accountcode']=_0xfcb3d6[_0xc484('0xa')]||'';this[_0xc484('0xb')]=_0xfcb3d6[_0xc484('0xb')]||'';this['state']=_0xc484('0xc');this[_0xc484('0xd')]=0x0;this['status']=_0xc484('0xc');this[_0xc484('0xe')]='';this[_0xc484('0xf')]='';this[_0xc484('0x10')]='';this[_0xc484('0x11')]='';this['online']=_0xfcb3d6[_0xc484('0x12')]||![];this[_0xc484('0x13')]=_0xc484('0xc');this[_0xc484('0x14')]=0x0;this[_0xc484('0x15')]='';this[_0xc484('0x16')]='';this[_0xc484('0x17')]=![];this[_0xc484('0x18')]=![];this[_0xc484('0x3')]='';}Agent['prototype'][_0xc484('0x19')]=function(_0x344c5f){var _0x3bc0de;if(_0x344c5f&&_0x344c5f['state']){_0x3bc0de=_0x344c5f['state'][_0xc484('0x1a')]();switch(_0x3bc0de){case _0xc484('0x1b'):_0x3bc0de=_0xc484('0x1c');break;case _0xc484('0x1d'):_0x3bc0de='talking';break;}}if(_0x3bc0de&&this['voiceStatus']!==_0x3bc0de||_0x344c5f[_0xc484('0x1e')]){this[_0xc484('0x14')]=_[_0xc484('0x1f')](moment()[_0xc484('0x20')]('x'));}if(_0x3bc0de){this[_0xc484('0x13')]=_0x3bc0de;}var _0x187808={'id':this['id'],'name':this[_0xc484('0x9')],'email':this[_0xc484('0x21')],'accountcode':this[_0xc484('0xa')],'fullname':this[_0xc484('0xb')],'state':this[_0xc484('0x22')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0xc484('0xe')],'online':this[_0xc484('0x12')],'voiceStatus':this[_0xc484('0x13')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xc484('0x15')],'voiceStatusQueue':this[_0xc484('0x16')],'interface':this[_0xc484('0x11')],'onhold':this[_0xc484('0x17')]};var _0x47918d=md5(JSON[_0xc484('0x23')](_0x187808));if(this[_0xc484('0x3')]!==_0x47918d){this[_0xc484('0x3')]=_0x47918d;io['to'](util[_0xc484('0x20')](_0xc484('0x24'),_0x187808['name']))[_0xc484('0x25')](_0xc484('0x26'),_0x187808);io['emit'](_0xc484('0x27'),_0x187808);}};module[_0xc484('0x28')]=Agent; \ No newline at end of file +var _0x848e=['fullname','state','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','not_inuse','inuse','statePause','toNumber','format','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','md5','ioredis','redis','defaults','socket.io-emitter','name','email','accountcode'];(function(_0x5c2d61,_0x4c301a){var _0x33947a=function(_0x256752){while(--_0x256752){_0x5c2d61['push'](_0x5c2d61['shift']());}};_0x33947a(++_0x4c301a);}(_0x848e,0x91));var _0xe848=function(_0x1180d3,_0x7161b5){_0x1180d3=_0x1180d3-0x0;var _0x1500c8=_0x848e[_0x1180d3];return _0x1500c8;};'use strict';var _=require(_0xe848('0x0'));var util=require(_0xe848('0x1'));var moment=require(_0xe848('0x2'));var md5=require(_0xe848('0x3'));var Redis=require(_0xe848('0x4'));var config=require('../../../config/environment');config[_0xe848('0x5')]=_[_0xe848('0x6')](config[_0xe848('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe848('0x7'))(new Redis(config[_0xe848('0x5')]));function Agent(_0x4e9abd){this['id']=_0x4e9abd['id']||0x0;this['name']=_0x4e9abd[_0xe848('0x8')]||'';this[_0xe848('0x9')]=_0x4e9abd[_0xe848('0x9')]||'';this[_0xe848('0xa')]=_0x4e9abd[_0xe848('0xa')]||'';this[_0xe848('0xb')]=_0x4e9abd['fullname']||'';this[_0xe848('0xc')]=_0xe848('0xd');this[_0xe848('0xe')]=0x0;this[_0xe848('0xf')]=_0xe848('0xd');this[_0xe848('0x10')]='';this['phone']='';this[_0xe848('0x11')]='';this[_0xe848('0x12')]='';this[_0xe848('0x13')]=_0x4e9abd[_0xe848('0x13')]||![];this[_0xe848('0x14')]=_0xe848('0xd');this[_0xe848('0x15')]=0x0;this[_0xe848('0x16')]='';this[_0xe848('0x17')]='';this[_0xe848('0x18')]=![];this[_0xe848('0x19')]=![];this[_0xe848('0x3')]='';}Agent[_0xe848('0x1a')][_0xe848('0x1b')]=function(_0x29af97){var _0x4a0310;if(_0x29af97&&_0x29af97[_0xe848('0xc')]){_0x4a0310=_0x29af97['state']['toLowerCase']();switch(_0x4a0310){case _0xe848('0x1c'):_0x4a0310='idle';break;case _0xe848('0x1d'):_0x4a0310='talking';break;}}if(_0x4a0310&&this[_0xe848('0x14')]!==_0x4a0310||_0x29af97[_0xe848('0x1e')]){this['voiceStatusTime']=_[_0xe848('0x1f')](moment()[_0xe848('0x20')]('x'));}if(_0x4a0310){this['voiceStatus']=_0x4a0310;}var _0x193df8={'id':this['id'],'name':this[_0xe848('0x8')],'email':this[_0xe848('0x9')],'accountcode':this[_0xe848('0xa')],'fullname':this[_0xe848('0xb')],'state':this[_0xe848('0xc')],'stateTime':this[_0xe848('0xe')],'status':this['status'],'address':this['address'],'online':this[_0xe848('0x13')],'voiceStatus':this[_0xe848('0x14')],'voiceStatusTime':this[_0xe848('0x15')],'voiceStatusCallerIdNumber':this[_0xe848('0x16')],'voiceStatusQueue':this[_0xe848('0x17')],'interface':this['interface'],'onhold':this[_0xe848('0x18')]};var _0x4103f1=md5(JSON[_0xe848('0x21')](_0x193df8));if(this[_0xe848('0x3')]!==_0x4103f1){this['md5']=_0x4103f1;io['to'](util[_0xe848('0x20')](_0xe848('0x22'),_0x193df8[_0xe848('0x8')]))[_0xe848('0x23')](_0xe848('0x24'),_0x193df8);io[_0xe848('0x23')](_0xe848('0x25'),_0x193df8);}};module[_0xe848('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 30d4a48..e5cafa1 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 _0xf5f1=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x1a37a2,_0x7c8e29){var _0x305d48=function(_0x5214cb){while(--_0x5214cb){_0x1a37a2['push'](_0x1a37a2['shift']());}};_0x305d48(++_0x7c8e29);}(_0xf5f1,0x1bc));var _0x1f5f=function(_0x5acc2d,_0x587970){_0x5acc2d=_0x5acc2d-0x0;var _0x28207=_0xf5f1[_0x5acc2d];return _0x28207;};'use strict';function Campaign(_0x5f0b76){this['id']=_0x5f0b76['id']||0x0;this[_0x1f5f('0x0')]=_0x5f0b76[_0x1f5f('0x0')]||'';this[_0x1f5f('0x1')]=_0x5f0b76[_0x1f5f('0x1')]||_0x1f5f('0x2');this[_0x1f5f('0x3')]=0x0;this[_0x1f5f('0x4')]=0x0;this[_0x1f5f('0x5')]=0x0;this[_0x1f5f('0x6')]=0x0;this[_0x1f5f('0x7')]='';this[_0x1f5f('0x8')]=!![];this[_0x1f5f('0x9')]=_0x5f0b76[_0x1f5f('0x9')];this[_0x1f5f('0xa')]=_0x5f0b76['limitCalls'];this[_0x1f5f('0xb')]=_0x5f0b76[_0x1f5f('0xb')]||null;this[_0x1f5f('0xc')]=_0x5f0b76['dialGlobalInterval']?_0x5f0b76[_0x1f5f('0xc')]:null;this[_0x1f5f('0xd')]=_0x5f0b76[_0x1f5f('0xd')];this[_0x1f5f('0xe')]=_0x5f0b76[_0x1f5f('0xe')];this[_0x1f5f('0xf')]=_0x5f0b76[_0x1f5f('0xf')]||0x1e;this['dialCongestionMaxRetry']=_0x5f0b76[_0x1f5f('0x10')];this[_0x1f5f('0x11')]=_0x5f0b76[_0x1f5f('0x11')];this[_0x1f5f('0x12')]=_0x5f0b76[_0x1f5f('0x12')];this['dialBusyRetryFrequency']=_0x5f0b76[_0x1f5f('0x13')];this[_0x1f5f('0x14')]=_0x5f0b76['dialNoAnswerMaxRetry'];this[_0x1f5f('0x15')]=_0x5f0b76[_0x1f5f('0x15')];this[_0x1f5f('0x16')]=_0x5f0b76[_0x1f5f('0x16')];this[_0x1f5f('0x17')]=_0x5f0b76[_0x1f5f('0x17')]||0x3;this[_0x1f5f('0x18')]=_0x5f0b76[_0x1f5f('0x18')]||0x96;this['dialDropMaxRetry']=_0x5f0b76[_0x1f5f('0x19')]||0x3;this[_0x1f5f('0x1a')]=_0x5f0b76[_0x1f5f('0x1a')]||0x96;this['dialAbandonedMaxRetry']=_0x5f0b76['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x5f0b76[_0x1f5f('0x1b')]||0x96;this[_0x1f5f('0x1c')]=_0x5f0b76[_0x1f5f('0x1c')]||0x3;this[_0x1f5f('0x1d')]=_0x5f0b76['dialMachineRetryFrequency']||0x96;this[_0x1f5f('0x1e')]=_0x5f0b76[_0x1f5f('0x1e')]||0x3;this[_0x1f5f('0x1f')]=_0x5f0b76['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x5f0b76[_0x1f5f('0x20')]||_0x1f5f('0x21');this[_0x1f5f('0x22')]=_0x5f0b76[_0x1f5f('0x22')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5f0b76[_0x1f5f('0x23')]||undefined;this[_0x1f5f('0x24')]=_0x5f0b76['dialCutDigit']||undefined;this['TrunkBackup']=_0x5f0b76['TrunkBackup']?_0x5f0b76['TrunkBackup']:undefined;this['Trunk']=_0x5f0b76[_0x1f5f('0x25')]?_0x5f0b76[_0x1f5f('0x25')]:undefined;this[_0x1f5f('0x26')]=_0x5f0b76['Interval']?_0x5f0b76[_0x1f5f('0x26')]:undefined;this['SquareProject']=_0x5f0b76[_0x1f5f('0x27')]?_0x5f0b76[_0x1f5f('0x27')]:undefined;this[_0x1f5f('0x28')]=_0x5f0b76['SquareProject']?_0x5f0b76[_0x1f5f('0x27')][_0x1f5f('0x0')]:undefined;this['dialAMDActive']=_0x5f0b76[_0x1f5f('0x29')]||![];this[_0x1f5f('0x2a')]=_0x5f0b76[_0x1f5f('0x2a')];this[_0x1f5f('0x2b')]=_0x5f0b76[_0x1f5f('0x2b')];this[_0x1f5f('0x2c')]=_0x5f0b76[_0x1f5f('0x2c')];this[_0x1f5f('0x2d')]=_0x5f0b76['dialAMDTotalAnalysisTime'];this[_0x1f5f('0x2e')]=_0x5f0b76[_0x1f5f('0x2e')];this[_0x1f5f('0x2f')]=_0x5f0b76[_0x1f5f('0x2f')];this['dialAMDMaximumNumberOfWords']=_0x5f0b76[_0x1f5f('0x30')];this['dialAMDSilenceThreshold']=_0x5f0b76[_0x1f5f('0x31')];this[_0x1f5f('0x32')]=_0x5f0b76[_0x1f5f('0x32')];}module[_0x1f5f('0x33')]=Campaign; \ No newline at end of file +var _0xf06e=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC'];(function(_0x4c4648,_0x4493d7){var _0x436276=function(_0x90dcc3){while(--_0x90dcc3){_0x4c4648['push'](_0x4c4648['shift']());}};_0x436276(++_0x4493d7);}(_0xf06e,0x178));var _0xef06=function(_0x4a155f,_0x44b6c5){_0x4a155f=_0x4a155f-0x0;var _0x5200ca=_0xf06e[_0x4a155f];return _0x5200ca;};'use strict';function Campaign(_0x18d11e){this['id']=_0x18d11e['id']||0x0;this[_0xef06('0x0')]=_0x18d11e['name']||'';this[_0xef06('0x1')]=_0x18d11e[_0xef06('0x1')]||_0xef06('0x2');this[_0xef06('0x3')]=0x0;this['temp']=0x0;this[_0xef06('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xef06('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xef06('0x6')]=_0x18d11e[_0xef06('0x6')];this[_0xef06('0x7')]=_0x18d11e[_0xef06('0x7')];this[_0xef06('0x8')]=_0x18d11e['dialTimezone']||null;this['dialGlobalInterval']=_0x18d11e[_0xef06('0x9')]?_0x18d11e[_0xef06('0x9')]:null;this['dialOriginateCallerIdName']=_0x18d11e['dialOriginateCallerIdName'];this[_0xef06('0xa')]=_0x18d11e['dialOriginateCallerIdNumber'];this[_0xef06('0xb')]=_0x18d11e[_0xef06('0xb')]||0x1e;this[_0xef06('0xc')]=_0x18d11e['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x18d11e[_0xef06('0xd')];this['dialBusyMaxRetry']=_0x18d11e['dialBusyMaxRetry'];this[_0xef06('0xe')]=_0x18d11e[_0xef06('0xe')];this['dialNoAnswerMaxRetry']=_0x18d11e[_0xef06('0xf')];this['dialNoAnswerRetryFrequency']=_0x18d11e[_0xef06('0x10')];this['dialGlobalMaxRetry']=_0x18d11e[_0xef06('0x11')];this['dialNoSuchNumberMaxRetry']=_0x18d11e[_0xef06('0x12')]||0x3;this[_0xef06('0x13')]=_0x18d11e[_0xef06('0x13')]||0x96;this['dialDropMaxRetry']=_0x18d11e[_0xef06('0x14')]||0x3;this[_0xef06('0x15')]=_0x18d11e[_0xef06('0x15')]||0x96;this[_0xef06('0x16')]=_0x18d11e[_0xef06('0x16')]||0x3;this['dialAbandonedRetryFrequency']=_0x18d11e[_0xef06('0x17')]||0x96;this[_0xef06('0x18')]=_0x18d11e['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x18d11e['dialMachineRetryFrequency']||0x96;this[_0xef06('0x19')]=_0x18d11e[_0xef06('0x19')]||0x3;this[_0xef06('0x1a')]=_0x18d11e['dialAgentRejectRetryFrequency']||0x96;this[_0xef06('0x1b')]=_0x18d11e[_0xef06('0x1b')]||_0xef06('0x1c');this[_0xef06('0x1d')]=_0x18d11e[_0xef06('0x1d')]||undefined;this[_0xef06('0x1e')]=_0x18d11e[_0xef06('0x1e')]||undefined;this[_0xef06('0x1f')]=_0x18d11e[_0xef06('0x1f')]||undefined;this[_0xef06('0x20')]=_0x18d11e['TrunkBackup']?_0x18d11e[_0xef06('0x20')]:undefined;this[_0xef06('0x21')]=_0x18d11e[_0xef06('0x21')]?_0x18d11e[_0xef06('0x21')]:undefined;this[_0xef06('0x22')]=_0x18d11e['Interval']?_0x18d11e[_0xef06('0x22')]:undefined;this[_0xef06('0x23')]=_0x18d11e[_0xef06('0x23')]?_0x18d11e[_0xef06('0x23')]:undefined;this[_0xef06('0x24')]=_0x18d11e[_0xef06('0x23')]?_0x18d11e[_0xef06('0x23')][_0xef06('0x0')]:undefined;this['dialAMDActive']=_0x18d11e['dialAMDActive']||![];this[_0xef06('0x25')]=_0x18d11e[_0xef06('0x25')];this[_0xef06('0x26')]=_0x18d11e[_0xef06('0x26')];this[_0xef06('0x27')]=_0x18d11e[_0xef06('0x27')];this['dialAMDTotalAnalysisTime']=_0x18d11e['dialAMDTotalAnalysisTime'];this[_0xef06('0x28')]=_0x18d11e['dialAMDMinWordLength'];this[_0xef06('0x29')]=_0x18d11e[_0xef06('0x29')];this[_0xef06('0x2a')]=_0x18d11e[_0xef06('0x2a')];this[_0xef06('0x2b')]=_0x18d11e[_0xef06('0x2b')];this['dialAMDMaximumWordLength']=_0x18d11e[_0xef06('0x2c')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index d3a85aa..6a6e55d 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 _0xd456=['lastapplication','billableseconds','type','tag','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','transferType','exports','channel','destinationchannel','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned'];(function(_0x21b73b,_0x389295){var _0x918a42=function(_0x58ec7d){while(--_0x58ec7d){_0x21b73b['push'](_0x21b73b['shift']());}};_0x918a42(++_0x389295);}(_0xd456,0x107));var _0x6d45=function(_0x393740,_0x4aa14a){_0x393740=_0x393740-0x0;var _0x96e241=_0xd456[_0x393740];return _0x96e241;};'use strict';function Channel(){this['starttime']=null;this[_0x6d45('0x0')]='';this[_0x6d45('0x1')]='';this['calleridnum']=0x0;this[_0x6d45('0x2')]='';this['connectedlinenum']=undefined;this[_0x6d45('0x3')]=undefined;this[_0x6d45('0x4')]=0x0;this[_0x6d45('0x5')]='';this[_0x6d45('0x6')]=0x0;this[_0x6d45('0x7')]=0x0;this[_0x6d45('0x8')]=0x0;this[_0x6d45('0x9')]=![];this[_0x6d45('0xa')]=null;this[_0x6d45('0xb')]=null;this['unmanaged']=![];this[_0x6d45('0xc')]=![];this[_0x6d45('0xd')]='';this['lastdata']='';this['duration']=0x0;this[_0x6d45('0xe')]=0x0;this['holdtime']=0x0;this[_0x6d45('0xf')]=null;this[_0x6d45('0x10')]=null;this['disposition']=null;this['monitor']=![];this[_0x6d45('0x11')]=null;this[_0x6d45('0x12')]=null;this['monitors']=[];this[_0x6d45('0x13')]=undefined;this[_0x6d45('0x14')]=undefined;this[_0x6d45('0x15')]=undefined;this['mohtime']=0x0;}module[_0x6d45('0x16')]=Channel; \ No newline at end of file +var _0x326b=['endtime','unmanaged','abandoned','lastapplication','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','uniqueid','exten','answertime'];(function(_0xd14e33,_0x272e5d){var _0x4a7d08=function(_0x391d29){while(--_0x391d29){_0xd14e33['push'](_0xd14e33['shift']());}};_0x4a7d08(++_0x272e5d);}(_0x326b,0x1dc));var _0xb326=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x326b[_0x1d1219];return _0x5b5b89;};'use strict';function Channel(){this[_0xb326('0x0')]=null;this[_0xb326('0x1')]='';this[_0xb326('0x2')]='';this[_0xb326('0x3')]=0x0;this[_0xb326('0x4')]='';this[_0xb326('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xb326('0x6')]=0x0;this['context']='';this[_0xb326('0x7')]=0x0;this['linkedid']=0x0;this[_0xb326('0x8')]=0x0;this['answered']=![];this[_0xb326('0x9')]=null;this[_0xb326('0xa')]=null;this[_0xb326('0xb')]=![];this[_0xb326('0xc')]=![];this[_0xb326('0xd')]='';this['lastdata']='';this['duration']=0x0;this[_0xb326('0xe')]=0x0;this[_0xb326('0xf')]=0x0;this[_0xb326('0x10')]=null;this[_0xb326('0x11')]=null;this[_0xb326('0x12')]=null;this[_0xb326('0x13')]=![];this[_0xb326('0x14')]=null;this[_0xb326('0x15')]=null;this[_0xb326('0x16')]=[];this['transfercalleridnum']=undefined;this[_0xb326('0x17')]=undefined;this[_0xb326('0x18')]=undefined;this[_0xb326('0x19')]=0x0;}module[_0xb326('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index bf9cad6..1dad42d 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 _0x9018=['consumerSecret','token','tokenSecret','type','serverUrl','exports','name','username','remoteUri','authType','password'];(function(_0x50c2c8,_0x17421e){var _0x55f8a3=function(_0x1fb37e){while(--_0x1fb37e){_0x50c2c8['push'](_0x50c2c8['shift']());}};_0x55f8a3(++_0x17421e);}(_0x9018,0x17c));var _0x8901=function(_0x7f04ce,_0x51d650){_0x7f04ce=_0x7f04ce-0x0;var _0x5ee6c7=_0x9018[_0x7f04ce];return _0x5ee6c7;};'use strict';function DeskAccount(_0x3d5774){this['id']=_0x3d5774['id']||0x0;this[_0x8901('0x0')]=_0x3d5774[_0x8901('0x0')]||'';this[_0x8901('0x1')]=_0x3d5774[_0x8901('0x1')]||'';this['remoteUri']=_0x3d5774[_0x8901('0x2')]||'';this[_0x8901('0x3')]=_0x3d5774[_0x8901('0x3')]||'';this[_0x8901('0x4')]=_0x3d5774[_0x8901('0x4')]||'';this['consumerKey']=_0x3d5774['consumerKey']||'';this[_0x8901('0x5')]=_0x3d5774[_0x8901('0x5')]||'';this[_0x8901('0x6')]=_0x3d5774['token']||'';this['tokenSecret']=_0x3d5774[_0x8901('0x7')]||'';this[_0x8901('0x8')]=_0x3d5774[_0x8901('0x8')]||'';this[_0x8901('0x9')]=_0x3d5774[_0x8901('0x9')]||'';this['Configurations']=_0x3d5774['Configurations']||{};}module[_0x8901('0xa')]=DeskAccount; \ No newline at end of file +var _0x43e2=['exports','name','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x552cf7,_0x3300fc){var _0x8bfdcc=function(_0x2dca3d){while(--_0x2dca3d){_0x552cf7['push'](_0x552cf7['shift']());}};_0x8bfdcc(++_0x3300fc);}(_0x43e2,0x12d));var _0x243e=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x43e2[_0xe73080];return _0x12cbc4;};'use strict';function DeskAccount(_0x215e60){this['id']=_0x215e60['id']||0x0;this['name']=_0x215e60[_0x243e('0x0')]||'';this['username']=_0x215e60['username']||'';this[_0x243e('0x1')]=_0x215e60[_0x243e('0x1')]||'';this[_0x243e('0x2')]=_0x215e60[_0x243e('0x2')]||'';this[_0x243e('0x3')]=_0x215e60[_0x243e('0x3')]||'';this[_0x243e('0x4')]=_0x215e60[_0x243e('0x4')]||'';this[_0x243e('0x5')]=_0x215e60['consumerSecret']||'';this[_0x243e('0x6')]=_0x215e60['token']||'';this['tokenSecret']=_0x215e60[_0x243e('0x7')]||'';this[_0x243e('0x8')]=_0x215e60[_0x243e('0x8')]||'';this[_0x243e('0x9')]=_0x215e60[_0x243e('0x9')]||'';this['Configurations']=_0x215e60[_0x243e('0xa')]||{};}module[_0x243e('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index f1bb9eb..5d61d15 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 _0x108c=['name','username','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x108c,0xa0));var _0xc108=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x108c[_0x122ef9];return _0x42fba0;};'use strict';function Dynamics365Account(_0x3e19eb){this['id']=_0x3e19eb['id']||0x0;this['name']=_0x3e19eb[_0xc108('0x0')]||'';this['username']=_0x3e19eb[_0xc108('0x1')]||'';this['password']=_0x3e19eb['password']||'';this[_0xc108('0x2')]=_0x3e19eb[_0xc108('0x2')]||'';this[_0xc108('0x3')]=_0x3e19eb[_0xc108('0x3')]||'';this[_0xc108('0x4')]=_0x3e19eb['clientId']||'';this[_0xc108('0x5')]=_0x3e19eb[_0xc108('0x5')]||{};this[_0xc108('0x6')]=_0x3e19eb['serverUrl']||'';this[_0xc108('0x7')]=_0x3e19eb[_0xc108('0x7')]||![];this[_0xc108('0x8')]=_0x3e19eb[_0xc108('0x8')]||{};this[_0xc108('0x9')]=_0x3e19eb[_0xc108('0x9')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x4e15=['CloudProvider','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x5c0cbe,_0x5a7cfc){var _0x343c38=function(_0x5526a0){while(--_0x5526a0){_0x5c0cbe['push'](_0x5c0cbe['shift']());}};_0x343c38(++_0x5a7cfc);}(_0x4e15,0x18d));var _0x54e1=function(_0x570ee0,_0x581979){_0x570ee0=_0x570ee0-0x0;var _0x4057cd=_0x4e15[_0x570ee0];return _0x4057cd;};'use strict';function Dynamics365Account(_0x42cb75){this['id']=_0x42cb75['id']||0x0;this[_0x54e1('0x0')]=_0x42cb75[_0x54e1('0x0')]||'';this[_0x54e1('0x1')]=_0x42cb75[_0x54e1('0x1')]||'';this[_0x54e1('0x2')]=_0x42cb75['password']||'';this[_0x54e1('0x3')]=_0x42cb75['remoteUri']||'';this[_0x54e1('0x4')]=_0x42cb75[_0x54e1('0x4')]||'';this[_0x54e1('0x5')]=_0x42cb75[_0x54e1('0x5')]||'';this[_0x54e1('0x6')]=_0x42cb75[_0x54e1('0x6')]||{};this[_0x54e1('0x7')]=_0x42cb75[_0x54e1('0x7')]||'';this['modernAuthentication']=_0x42cb75[_0x54e1('0x8')]||![];this[_0x54e1('0x9')]=_0x42cb75[_0x54e1('0x9')]||{};this[_0x54e1('0xa')]=_0x42cb75[_0x54e1('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 254cd02..a27eb42 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 _0xf192=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x3ba5ef,_0x3f7ffe){var _0x3a98d5=function(_0xf6cf5e){while(--_0xf6cf5e){_0x3ba5ef['push'](_0x3ba5ef['shift']());}};_0x3a98d5(++_0x3f7ffe);}(_0xf192,0xa3));var _0x2f19=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf192[_0x167cc1];return _0x10bc4b;};'use strict';function FaxAccount(_0x3d2688){this['id']=_0x3d2688['id']||0x0;this[_0x2f19('0x0')]=_0x3d2688[_0x2f19('0x0')]||'';this['description']=_0x3d2688[_0x2f19('0x1')];this[_0x2f19('0x2')]=_0x3d2688['ecm'];this[_0x2f19('0x3')]=_0x3d2688[_0x2f19('0x3')];this['localstationid']=_0x3d2688[_0x2f19('0x4')];this[_0x2f19('0x5')]=_0x3d2688[_0x2f19('0x5')]||0x960;this[_0x2f19('0x6')]=_0x3d2688[_0x2f19('0x6')]||0x3840;this['modem']=_0x3d2688[_0x2f19('0x7')]||_0x2f19('0x8');this[_0x2f19('0x9')]=_0x3d2688['gateway']||'no';this['faxdetect']=_0x3d2688[_0x2f19('0xa')]||'no';this[_0x2f19('0xb')]=_0x3d2688[_0x2f19('0xb')]||0x1388;this[_0x2f19('0xc')]=_0x3d2688[_0x2f19('0xc')]||'SIP';this[_0x2f19('0xd')]=_0x3d2688[_0x2f19('0xd')]?_0x3d2688[_0x2f19('0xd')]:undefined;this[_0x2f19('0xe')]=_0x3d2688[_0x2f19('0xe')];this[_0x2f19('0xf')]=_0x3d2688[_0x2f19('0xf')];}module[_0x2f19('0x10')]=FaxAccount; \ No newline at end of file +var _0xd2a8=['Trunk','ListId','key','name','description','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xd2a8,0x1f3));var _0x8d2a=function(_0x2d1a6e,_0x26f215){_0x2d1a6e=_0x2d1a6e-0x0;var _0x4b1674=_0xd2a8[_0x2d1a6e];return _0x4b1674;};'use strict';function FaxAccount(_0x6cd23d){this['id']=_0x6cd23d['id']||0x0;this[_0x8d2a('0x0')]=_0x6cd23d[_0x8d2a('0x0')]||'';this[_0x8d2a('0x1')]=_0x6cd23d[_0x8d2a('0x1')];this['ecm']=_0x6cd23d['ecm'];this[_0x8d2a('0x2')]=_0x6cd23d[_0x8d2a('0x2')];this['localstationid']=_0x6cd23d[_0x8d2a('0x3')];this[_0x8d2a('0x4')]=_0x6cd23d[_0x8d2a('0x4')]||0x960;this[_0x8d2a('0x5')]=_0x6cd23d[_0x8d2a('0x5')]||0x3840;this[_0x8d2a('0x6')]=_0x6cd23d['modem']||_0x8d2a('0x7');this[_0x8d2a('0x8')]=_0x6cd23d[_0x8d2a('0x8')]||'no';this[_0x8d2a('0x9')]=_0x6cd23d[_0x8d2a('0x9')]||'no';this[_0x8d2a('0xa')]=_0x6cd23d[_0x8d2a('0xa')]||0x1388;this[_0x8d2a('0xb')]=_0x6cd23d[_0x8d2a('0xb')]||_0x8d2a('0xc');this[_0x8d2a('0xd')]=_0x6cd23d[_0x8d2a('0xd')]?_0x6cd23d[_0x8d2a('0xd')]:undefined;this[_0x8d2a('0xe')]=_0x6cd23d[_0x8d2a('0xe')];this[_0x8d2a('0xf')]=_0x6cd23d['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index d4c3b29..0cc0ee8 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 _0xcaf5=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x319c87,_0x50aa2c){var _0x22e47f=function(_0x52c31a){while(--_0x52c31a){_0x319c87['push'](_0x319c87['shift']());}};_0x22e47f(++_0x50aa2c);}(_0xcaf5,0xe9));var _0x5caf=function(_0x2e3766,_0x538848){_0x2e3766=_0x2e3766-0x0;var _0x4aaef8=_0xcaf5[_0x2e3766];return _0x4aaef8;};'use strict';function FreshdeskAccount(_0x26215c){this['id']=_0x26215c['id']||0x0;this[_0x5caf('0x0')]=_0x26215c[_0x5caf('0x0')]||'';this['username']=_0x26215c[_0x5caf('0x1')]||'';this[_0x5caf('0x2')]=_0x26215c[_0x5caf('0x3')]||'';this[_0x5caf('0x4')]=_0x26215c[_0x5caf('0x4')]||'';this[_0x5caf('0x5')]=_0x26215c[_0x5caf('0x5')]||'';this[_0x5caf('0x6')]=_0x26215c[_0x5caf('0x6')]||{};}module[_0x5caf('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xb0a8=['serverUrl','name','apiKey','token','remoteUri'];(function(_0x303480,_0x350e71){var _0xd20497=function(_0x30e6a2){while(--_0x30e6a2){_0x303480['push'](_0x303480['shift']());}};_0xd20497(++_0x350e71);}(_0xb0a8,0xce));var _0x8b0a=function(_0x11e24e,_0x2b8bb1){_0x11e24e=_0x11e24e-0x0;var _0x2caedc=_0xb0a8[_0x11e24e];return _0x2caedc;};'use strict';function FreshdeskAccount(_0x3a0267){this['id']=_0x3a0267['id']||0x0;this[_0x8b0a('0x0')]=_0x3a0267[_0x8b0a('0x0')]||'';this['username']=_0x3a0267['username']||'';this[_0x8b0a('0x1')]=_0x3a0267[_0x8b0a('0x2')]||'';this['remoteUri']=_0x3a0267[_0x8b0a('0x3')]||'';this[_0x8b0a('0x4')]=_0x3a0267[_0x8b0a('0x4')]||'';this['Configurations']=_0x3a0267['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 3873740..ec1006e 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 _0x2494=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x1f30cf,_0x3ce632){var _0xd0a144=function(_0x255329){while(--_0x255329){_0x1f30cf['push'](_0x1f30cf['shift']());}};_0xd0a144(++_0x3ce632);}(_0x2494,0x82));var _0x4249=function(_0x5c29a9,_0xf4c5bc){_0x5c29a9=_0x5c29a9-0x0;var _0x1141e5=_0x2494[_0x5c29a9];return _0x1141e5;};'use strict';function FreshsalesAccount(_0x9190f6){this['id']=_0x9190f6['id']||0x0;this['name']=_0x9190f6[_0x4249('0x0')]||'';this[_0x4249('0x1')]=_0x9190f6[_0x4249('0x1')]||'';this[_0x4249('0x2')]=_0x9190f6[_0x4249('0x3')]||'';this[_0x4249('0x4')]=_0x9190f6['remoteUri']||'';this['serverUrl']=_0x9190f6[_0x4249('0x5')]||'';this['Configurations']=_0x9190f6[_0x4249('0x6')]||{};}module[_0x4249('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x0dee=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x1b77e2,_0x206291){var _0x2a731a=function(_0x361499){while(--_0x361499){_0x1b77e2['push'](_0x1b77e2['shift']());}};_0x2a731a(++_0x206291);}(_0x0dee,0xf7));var _0xe0de=function(_0x6e2168,_0x161980){_0x6e2168=_0x6e2168-0x0;var _0x1a539f=_0x0dee[_0x6e2168];return _0x1a539f;};'use strict';function FreshsalesAccount(_0x2d297c){this['id']=_0x2d297c['id']||0x0;this[_0xe0de('0x0')]=_0x2d297c['name']||'';this[_0xe0de('0x1')]=_0x2d297c['username']||'';this[_0xe0de('0x2')]=_0x2d297c[_0xe0de('0x3')]||'';this['remoteUri']=_0x2d297c[_0xe0de('0x4')]||'';this[_0xe0de('0x5')]=_0x2d297c[_0xe0de('0x5')]||'';this['Configurations']=_0x2d297c[_0xe0de('0x6')]||{};}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 f81c730..63c8ecc 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 _0xca80=['priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','type','queuecallerleaveAt','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','originalposition','channel','connectedlinenum','accountcode','context'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0xca80,0xc7));var _0x0ca8=function(_0x2faf0f,_0x537761){_0x2faf0f=_0x2faf0f-0x0;var _0x138afe=_0xca80[_0x2faf0f];return _0x138afe;};'use strict';function QueueReport(){this[_0x0ca8('0x0')]='inbound';this['uniqueid']='';this['calleridnum']='';this['calleridname']='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x0ca8('0x1')]=null;this['position']=0x1;this[_0x0ca8('0x2')]=0x1;this[_0x0ca8('0x3')]=![];this['queuecallerabandonAt']=null;this[_0x0ca8('0x4')]=![];this[_0x0ca8('0x5')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0x0ca8('0x6')]=0x1;this[_0x0ca8('0x7')]='';this[_0x0ca8('0x8')]='';this['connectedlinename']='';this[_0x0ca8('0x9')]='';this[_0x0ca8('0xa')]='';this['exten']='';this[_0x0ca8('0xb')]='';this[_0x0ca8('0xc')]=0x0;this[_0x0ca8('0xd')]=![];this[_0x0ca8('0xe')]='';this[_0x0ca8('0xf')]=_0x0ca8('0x10');this[_0x0ca8('0x11')]=null;this[_0x0ca8('0x12')]=0x0;this[_0x0ca8('0x13')]={};}module[_0x0ca8('0x14')]=QueueReport; \ No newline at end of file +var _0x0a02=['variables','type','inbound','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime'];(function(_0x2d0184,_0x2d9541){var _0x22477b=function(_0x4db1d7){while(--_0x4db1d7){_0x2d0184['push'](_0x2d0184['shift']());}};_0x22477b(++_0x2d9541);}(_0x0a02,0xbe));var _0x20a0=function(_0x186222,_0x3bdfb0){_0x186222=_0x186222-0x0;var _0x226a38=_0x0a02[_0x186222];return _0x226a38;};'use strict';function QueueReport(){this[_0x20a0('0x0')]=_0x20a0('0x1');this['uniqueid']='';this['calleridnum']='';this['calleridname']='';this[_0x20a0('0x2')]='';this[_0x20a0('0x3')]=null;this[_0x20a0('0x4')]=null;this[_0x20a0('0x5')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x20a0('0x6')]=null;this[_0x20a0('0x7')]=![];this['queuecallercompleteAt']=null;this[_0x20a0('0x8')]=![];this[_0x20a0('0x9')]=null;this[_0x20a0('0xa')]=0x1;this[_0x20a0('0xb')]='';this['connectedlinenum']='';this[_0x20a0('0xc')]='';this['accountcode']='';this[_0x20a0('0xd')]='';this[_0x20a0('0xe')]='';this[_0x20a0('0xf')]='';this[_0x20a0('0x10')]=0x0;this[_0x20a0('0x11')]=![];this[_0x20a0('0x12')]='';this['motionChannel']='voice';this['routealias']=null;this[_0x20a0('0x13')]=0x0;this[_0x20a0('0x14')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 5d55332..28b10b8 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 _0xa2d7=['remoteUri','password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x1b3e24,_0x1b1f5f){var _0x28cb8f=function(_0x4183ce){while(--_0x4183ce){_0x1b3e24['push'](_0x1b3e24['shift']());}};_0x28cb8f(++_0x1b1f5f);}(_0xa2d7,0x195));var _0x7a2d=function(_0x12ace3,_0x28da14){_0x12ace3=_0x12ace3-0x0;var _0x41338e=_0xa2d7[_0x12ace3];return _0x41338e;};'use strict';function SalesforceAccount(_0x41abad){this['id']=_0x41abad['id']||0x0;this['name']=_0x41abad[_0x7a2d('0x0')]||'';this['username']=_0x41abad[_0x7a2d('0x1')]||'';this[_0x7a2d('0x2')]=_0x41abad[_0x7a2d('0x2')]||'';this[_0x7a2d('0x3')]=_0x41abad[_0x7a2d('0x3')]||'';this[_0x7a2d('0x4')]=_0x41abad[_0x7a2d('0x4')]||'';this[_0x7a2d('0x5')]=_0x41abad['clientSecret']||'';this['securityToken']=_0x41abad['securityToken']||'';this[_0x7a2d('0x6')]=_0x41abad[_0x7a2d('0x6')]||_0x7a2d('0x7');this[_0x7a2d('0x8')]=_0x41abad[_0x7a2d('0x8')]||'';this[_0x7a2d('0x9')]=_0x41abad[_0x7a2d('0x9')]||{};}module[_0x7a2d('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x68b3=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name'];(function(_0x2a6d27,_0x9b4400){var _0x3e48ec=function(_0x4a5c50){while(--_0x4a5c50){_0x2a6d27['push'](_0x2a6d27['shift']());}};_0x3e48ec(++_0x9b4400);}(_0x68b3,0x1d8));var _0x368b=function(_0x1f483c,_0x1e8c59){_0x1f483c=_0x1f483c-0x0;var _0x502d81=_0x68b3[_0x1f483c];return _0x502d81;};'use strict';function SalesforceAccount(_0x41f40a){this['id']=_0x41f40a['id']||0x0;this[_0x368b('0x0')]=_0x41f40a[_0x368b('0x0')]||'';this[_0x368b('0x1')]=_0x41f40a[_0x368b('0x1')]||'';this['remoteUri']=_0x41f40a[_0x368b('0x2')]||'';this[_0x368b('0x3')]=_0x41f40a[_0x368b('0x3')]||'';this[_0x368b('0x4')]=_0x41f40a['clientId']||'';this[_0x368b('0x5')]=_0x41f40a[_0x368b('0x5')]||'';this[_0x368b('0x6')]=_0x41f40a[_0x368b('0x6')]||'';this[_0x368b('0x7')]=_0x41f40a[_0x368b('0x7')]||_0x368b('0x8');this[_0x368b('0x9')]=_0x41f40a[_0x368b('0x9')]||'';this[_0x368b('0xa')]=_0x41f40a[_0x368b('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 504352d..728f157 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 _0x6698=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x4604d6,_0x48f3ea){var _0x3df7dd=function(_0x504319){while(--_0x504319){_0x4604d6['push'](_0x4604d6['shift']());}};_0x3df7dd(++_0x48f3ea);}(_0x6698,0x1ba));var _0x8669=function(_0x542179,_0x23212e){_0x542179=_0x542179-0x0;var _0x59a4e8=_0x6698[_0x542179];return _0x59a4e8;};'use strict';function ServicenowAccount(_0xa99d0b){this['id']=_0xa99d0b['id']||0x0;this[_0x8669('0x0')]=_0xa99d0b[_0x8669('0x0')]||'';this[_0x8669('0x1')]=_0xa99d0b[_0x8669('0x1')]||'';this[_0x8669('0x2')]=_0xa99d0b[_0x8669('0x2')]||'';this[_0x8669('0x3')]=_0xa99d0b[_0x8669('0x3')]||'';this[_0x8669('0x4')]=_0xa99d0b[_0x8669('0x4')]||'';this['Configurations']=_0xa99d0b[_0x8669('0x5')]||{};}module[_0x8669('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x0923=['remoteUri','serverUrl','name','username','password'];(function(_0x4b0e62,_0x3e1b3d){var _0x2ec671=function(_0x2a3c71){while(--_0x2a3c71){_0x4b0e62['push'](_0x4b0e62['shift']());}};_0x2ec671(++_0x3e1b3d);}(_0x0923,0xd4));var _0x3092=function(_0x4ec555,_0x25d2ab){_0x4ec555=_0x4ec555-0x0;var _0x40d757=_0x0923[_0x4ec555];return _0x40d757;};'use strict';function ServicenowAccount(_0x5d7a46){this['id']=_0x5d7a46['id']||0x0;this['name']=_0x5d7a46[_0x3092('0x0')]||'';this[_0x3092('0x1')]=_0x5d7a46[_0x3092('0x1')]||'';this[_0x3092('0x2')]=_0x5d7a46[_0x3092('0x2')]||'';this[_0x3092('0x3')]=_0x5d7a46[_0x3092('0x3')]||'';this[_0x3092('0x4')]=_0x5d7a46['serverUrl']||'';this['Configurations']=_0x5d7a46['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 5879adc..fa6d187 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 _0x009f=['password','remoteUri','serverUrl','name','username'];(function(_0x717594,_0x2fb294){var _0xbba377=function(_0x54a502){while(--_0x54a502){_0x717594['push'](_0x717594['shift']());}};_0xbba377(++_0x2fb294);}(_0x009f,0xe9));var _0xf009=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x009f[_0x257642];return _0x3d813b;};'use strict';function SugarcrmAccount(_0x768b12){this['id']=_0x768b12['id']||0x0;this[_0xf009('0x0')]=_0x768b12[_0xf009('0x0')]||'';this[_0xf009('0x1')]=_0x768b12[_0xf009('0x1')]||'';this[_0xf009('0x2')]=_0x768b12[_0xf009('0x2')]||'';this[_0xf009('0x3')]=_0x768b12['remoteUri']||'';this['serverUrl']=_0x768b12[_0xf009('0x4')]||'';this['Configurations']=_0x768b12['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x65dc=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x26aaf5,_0x57ffa5){var _0x64721b=function(_0xb0fdc0){while(--_0xb0fdc0){_0x26aaf5['push'](_0x26aaf5['shift']());}};_0x64721b(++_0x57ffa5);}(_0x65dc,0x7b));var _0xc65d=function(_0x289c3e,_0x3614b5){_0x289c3e=_0x289c3e-0x0;var _0x25a4b3=_0x65dc[_0x289c3e];return _0x25a4b3;};'use strict';function SugarcrmAccount(_0x418e03){this['id']=_0x418e03['id']||0x0;this[_0xc65d('0x0')]=_0x418e03['name']||'';this[_0xc65d('0x1')]=_0x418e03[_0xc65d('0x1')]||'';this[_0xc65d('0x2')]=_0x418e03[_0xc65d('0x2')]||'';this[_0xc65d('0x3')]=_0x418e03[_0xc65d('0x3')]||'';this[_0xc65d('0x4')]=_0x418e03[_0xc65d('0x4')]||'';this[_0xc65d('0x5')]=_0x418e03[_0xc65d('0x5')]||{};}module[_0xc65d('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 7eb1981..877cc40 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 _0x2100=['stateTime','status','unknown','address','exports','name','accountcode'];(function(_0xd496c6,_0x152ab9){var _0x4033ad=function(_0x39a522){while(--_0x39a522){_0xd496c6['push'](_0xd496c6['shift']());}};_0x4033ad(++_0x152ab9);}(_0x2100,0x9f));var _0x0210=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x2100[_0xc6be3a];return _0x56a310;};'use strict';function Telephone(_0x5871dd){this['id']=_0x5871dd['id']||0x0;this[_0x0210('0x0')]=_0x5871dd[_0x0210('0x0')]||'';this[_0x0210('0x1')]=_0x5871dd[_0x0210('0x1')]||'';this['state']='unknown';this[_0x0210('0x2')]=0x0;this[_0x0210('0x3')]=_0x0210('0x4');this[_0x0210('0x5')]='';}module[_0x0210('0x6')]=Telephone; \ No newline at end of file +var _0x4c29=['stateTime','address','name','accountcode','unknown'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x4c29,0x16a));var _0x94c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c29[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x5d1120){this['id']=_0x5d1120['id']||0x0;this[_0x94c2('0x0')]=_0x5d1120['name']||'';this['accountcode']=_0x5d1120[_0x94c2('0x1')]||'';this['state']=_0x94c2('0x2');this[_0x94c2('0x3')]=0x0;this['status']=_0x94c2('0x2');this[_0x94c2('0x4')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 673b808..a2d8cd8 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(_0x5a9c4f,_0x83ab1c){var _0x28934c=function(_0x16b6f2){while(--_0x16b6f2){_0x5a9c4f['push'](_0x5a9c4f['shift']());}};_0x28934c(++_0x83ab1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x5a47fb,_0x1b2011){var _0x3b5075=function(_0x565cf3){while(--_0x565cf3){_0x5a47fb['push'](_0x5a47fb['shift']());}};_0x3b5075(++_0x1b2011);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 d5b39ea..5fceef8 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1cf594,_0x237525){var _0x4dbc1a=function(_0x3d0fcb){while(--_0x3d0fcb){_0x1cf594['push'](_0x1cf594['shift']());}};_0x4dbc1a(++_0x237525);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x46bf0d,_0x31d1c1){_0x46bf0d=_0x46bf0d-0x0;var _0x4b9e5f=_0x9ffd[_0x46bf0d];return _0x4b9e5f;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x4df4d2,_0x31dd52){var _0x3b9f52=function(_0x304bd0){while(--_0x304bd0){_0x4df4d2['push'](_0x4df4d2['shift']());}};_0x3b9f52(++_0x31dd52);}(_0x4fc2,0x111));var _0x24fc=function(_0x4c77f3,_0x2ece5f){_0x4c77f3=_0x4c77f3-0x0;var _0x2c5022=_0x4fc2[_0x4c77f3];return _0x2c5022;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 20dbbae..a13ca70 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 _0x8c95=['stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','domain','domainport','refresh'];(function(_0x225264,_0x1968d0){var _0x4c0a1f=function(_0x146f3a){while(--_0x146f3a){_0x225264['push'](_0x225264['shift']());}};_0x4c0a1f(++_0x1968d0);}(_0x8c95,0x16d));var _0x58c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c95[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x2a0b8f){this['id']=_0x2a0b8f['id']||0x0;this[_0x58c9('0x0')]=_0x2a0b8f[_0x58c9('0x0')]||![];this['name']=_0x2a0b8f[_0x58c9('0x1')]||'';this[_0x58c9('0x2')]=_0x58c9('0x3');this[_0x58c9('0x4')]=0x0;this[_0x58c9('0x5')]='unknown';this[_0x58c9('0x6')]=_0x2a0b8f[_0x58c9('0x6')]&&_0x2a0b8f['registry'][_0x58c9('0x7')](':')?_0x2a0b8f['registry'][_0x58c9('0x8')](':')[0x0]:'';this[_0x58c9('0x9')]='';this['port']='';this[_0x58c9('0xa')]='';this[_0x58c9('0xb')]='';this[_0x58c9('0xc')]='';this[_0x58c9('0xd')]=_0x58c9('0x3');this[_0x58c9('0xe')]='';this[_0x58c9('0xf')]='';this['defaultuser']=_0x2a0b8f[_0x58c9('0x10')]||'';}module[_0x58c9('0x11')]=Trunk; \ No newline at end of file +var _0xdb76=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','status','registry','port','domain','domainport'];(function(_0x3f01dd,_0x128e0f){var _0x4bae40=function(_0x35a022){while(--_0x35a022){_0x3f01dd['push'](_0x3f01dd['shift']());}};_0x4bae40(++_0x128e0f);}(_0xdb76,0x68));var _0x6db7=function(_0x263031,_0x6d3a49){_0x263031=_0x263031-0x0;var _0xdc832c=_0xdb76[_0x263031];return _0xdc832c;};'use strict';function Trunk(_0x54d5fa){this['id']=_0x54d5fa['id']||0x0;this[_0x6db7('0x0')]=_0x54d5fa[_0x6db7('0x0')]||![];this['name']=_0x54d5fa[_0x6db7('0x1')]||'';this['state']=_0x6db7('0x2');this['stateTime']=0x0;this[_0x6db7('0x3')]=_0x6db7('0x2');this[_0x6db7('0x4')]=_0x54d5fa['registry']&&_0x54d5fa[_0x6db7('0x4')]['indexOf'](':')?_0x54d5fa['registry']['split'](':')[0x0]:'';this['host']='';this[_0x6db7('0x5')]='';this[_0x6db7('0x6')]='';this[_0x6db7('0x7')]='';this[_0x6db7('0x8')]='';this[_0x6db7('0x9')]='unknown';this[_0x6db7('0xa')]='';this[_0x6db7('0xb')]='';this[_0x6db7('0xc')]=_0x54d5fa[_0x6db7('0xc')]||'';}module[_0x6db7('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index fca6813..f7a8c71 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 _0x5e64=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x1202c5,_0x5913ef){var _0x5345ec=function(_0x1e3f55){while(--_0x1e3f55){_0x1202c5['push'](_0x1202c5['shift']());}};_0x5345ec(++_0x5913ef);}(_0x5e64,0x7f));var _0x45e6=function(_0x4ed6ae,_0x2bc1e2){_0x4ed6ae=_0x4ed6ae-0x0;var _0x46f5aa=_0x5e64[_0x4ed6ae];return _0x46f5aa;};'use strict';function voiceExtension(_0x598060){this['id']=_0x598060['id']||0x0;this[_0x45e6('0x0')]=_0x598060['exten']||'';this[_0x45e6('0x1')]=_0x598060[_0x45e6('0x1')]||'none';this['mandatoryDisposition']=_0x598060[_0x45e6('0x2')]||![];}module[_0x45e6('0x3')]=voiceExtension; \ No newline at end of file +var _0xfdce=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x37fe84,_0x3fb99f){var _0xc85724=function(_0x444c2e){while(--_0x444c2e){_0x37fe84['push'](_0x37fe84['shift']());}};_0xc85724(++_0x3fb99f);}(_0xfdce,0xbf));var _0xefdc=function(_0x195319,_0x55f91d){_0x195319=_0x195319-0x0;var _0x4c9c09=_0xfdce[_0x195319];return _0x4c9c09;};'use strict';function voiceExtension(_0x85c689){this['id']=_0x85c689['id']||0x0;this[_0xefdc('0x0')]=_0x85c689[_0xefdc('0x0')]||'';this['recordingFormat']=_0x85c689[_0xefdc('0x1')]||_0xefdc('0x2');this[_0xefdc('0x3')]=_0x85c689[_0xefdc('0x3')]||![];}module[_0xefdc('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 5556447..9279686 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 _0xf072=['TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','random','roundrobin','rrmemory','wrandom','name','type','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','inUse','invalid','loggedIn','onHold','paused','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk'];(function(_0xeb7302,_0x43fd5c){var _0x1b931e=function(_0x3da7b5){while(--_0x3da7b5){_0xeb7302['push'](_0xeb7302['shift']());}};_0x1b931e(++_0x43fd5c);}(_0xf072,0x131));var _0x2f07=function(_0x4e215b,_0x49d15e){_0x4e215b=_0x4e215b-0x0;var _0x438a75=_0xf072[_0x4e215b];return _0x438a75;};'use strict';var monitorFormat={'wav':_0x2f07('0x0'),'wav49':_0x2f07('0x1'),'gsm':_0x2f07('0x2')};var strategy={'fewestcalls':_0x2f07('0x3'),'leastrecent':'leastrecent','linear':_0x2f07('0x4'),'random':_0x2f07('0x5'),'ringall':'ringall','rr':_0x2f07('0x6'),'rrmemory':_0x2f07('0x7'),'rrordered':'rrordered','wrandom':_0x2f07('0x8')};function VoiceQueue(_0x19cd36){this['id']=_0x19cd36['id']||0x0;this[_0x2f07('0x9')]=_0x19cd36['name']||'';this['monitor_format']=_0x19cd36['monitor_format']||'';this[_0x2f07('0xa')]=_0x19cd36[_0x2f07('0xa')]||'inbound';this[_0x2f07('0xb')]=0x0;this['total']=0x0;this[_0x2f07('0xc')]=0x0;this[_0x2f07('0xd')]=0x0;this[_0x2f07('0xe')]=0x0;this[_0x2f07('0xf')]=0x0;this[_0x2f07('0x10')]=0x0;this[_0x2f07('0x11')]=0x0;this[_0x2f07('0x12')]=0x0;this['busy']=0x0;this[_0x2f07('0x13')]=0x0;this[_0x2f07('0x14')]=0x0;this[_0x2f07('0x15')]=0x0;this['notInUse']=0x0;this[_0x2f07('0x16')]=0x0;this[_0x2f07('0x17')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this['talking']=0x0;this[_0x2f07('0x18')]=0x0;this['unknown']=0x0;this[_0x2f07('0x19')]=_0x19cd36[_0x2f07('0x19')]||![];this[_0x2f07('0x1a')]=_0x19cd36['acwTimeout']||0xa;this[_0x2f07('0x1b')]=_0x19cd36[_0x2f07('0x1b')]||'no';this[_0x2f07('0x1c')]=!![];this[_0x2f07('0x1d')]='';this[_0x2f07('0x1e')]='';this[_0x2f07('0x1f')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x19cd36['dialTimezone']||null;this['dialGlobalInterval']=_0x19cd36[_0x2f07('0x20')]?_0x19cd36[_0x2f07('0x20')]:null;this[_0x2f07('0x21')]=_0x19cd36[_0x2f07('0x21')];this[_0x2f07('0x22')]=_0x19cd36[_0x2f07('0x22')]||_0x2f07('0x23');this[_0x2f07('0x24')]=_0x19cd36[_0x2f07('0x24')]||0x0;this[_0x2f07('0x25')]=_0x19cd36[_0x2f07('0x25')]||0x0;this[_0x2f07('0x26')]=_0x19cd36[_0x2f07('0x26')]||0x1;this[_0x2f07('0x27')]=_0x19cd36[_0x2f07('0x27')]||_0x2f07('0x28');this['dialPredictiveOptimizationPercentage']=_0x19cd36['dialPredictiveOptimizationPercentage']||0.03;this[_0x2f07('0x29')]=_0x19cd36['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x19cd36[_0x2f07('0x2a')]||_0x2f07('0x2b');this[_0x2f07('0x2c')]=_0x19cd36[_0x2f07('0x2c')]||_0x2f07('0x2b');this[_0x2f07('0x2d')]=_0x19cd36[_0x2f07('0x2d')]||0x1e;this[_0x2f07('0x2e')]=_0x19cd36[_0x2f07('0x2e')]||_0x2f07('0x2f');this[_0x2f07('0x30')]=_0x19cd36[_0x2f07('0x30')]||0x3;this[_0x2f07('0x31')]=_0x19cd36['dialQueueProject']||undefined;this[_0x2f07('0x32')]=_0x19cd36[_0x2f07('0x32')]||0x3;this['dialCongestionRetryFrequency']=_0x19cd36['dialCongestionRetryFrequency']||0x96;this[_0x2f07('0x33')]=_0x19cd36[_0x2f07('0x33')]||0x3;this[_0x2f07('0x34')]=_0x19cd36[_0x2f07('0x34')]||0x96;this[_0x2f07('0x35')]=_0x19cd36['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x19cd36[_0x2f07('0x36')]||0x96;this[_0x2f07('0x37')]=_0x19cd36[_0x2f07('0x37')]||0x3;this[_0x2f07('0x38')]=_0x19cd36['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x19cd36[_0x2f07('0x39')]||0x3;this[_0x2f07('0x3a')]=_0x19cd36['dialDropRetryFrequency']||0x96;this[_0x2f07('0x3b')]=_0x19cd36['dialAbandonedMaxRetry']||0x3;this[_0x2f07('0x3c')]=_0x19cd36[_0x2f07('0x3c')]||0x96;this[_0x2f07('0x3d')]=_0x19cd36['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x19cd36[_0x2f07('0x3e')]||0x96;this[_0x2f07('0x3f')]=_0x19cd36[_0x2f07('0x3f')]||0x3;this['dialAgentRejectRetryFrequency']=_0x19cd36[_0x2f07('0x40')]||0x96;this[_0x2f07('0x41')]=_0x19cd36['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x19cd36['dialGlobalMaxRetry']||0x4;this[_0x2f07('0x42')]=_0x19cd36[_0x2f07('0x42')]?_0x19cd36[_0x2f07('0x42')]:undefined;this['TrunkBackup']=_0x19cd36['TrunkBackup']?_0x19cd36[_0x2f07('0x43')]:undefined;this[_0x2f07('0x44')]=_0x19cd36[_0x2f07('0x44')]||undefined;this[_0x2f07('0x45')]=_0x19cd36[_0x2f07('0x45')]?_0x19cd36[_0x2f07('0x45')]:undefined;this[_0x2f07('0x46')]=_0x19cd36[_0x2f07('0x46')]||_0x2f07('0x47');this['dialRandomLastDigitCallerIdNumber']=_0x19cd36[_0x2f07('0x48')]||undefined;this[_0x2f07('0x49')]=_0x19cd36['dialCutDigit']||undefined;this['strategy']=strategy[_0x19cd36[_0x2f07('0x4a')]];this[_0x2f07('0x4b')]=!![];this['dialAMDActive']=_0x19cd36[_0x2f07('0x4c')]||![];this[_0x2f07('0x4d')]=_0x19cd36[_0x2f07('0x4d')];this[_0x2f07('0x4e')]=_0x19cd36['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x19cd36['dialAMDAfterGreetingSilence'];this[_0x2f07('0x4f')]=_0x19cd36[_0x2f07('0x4f')];this[_0x2f07('0x50')]=_0x19cd36['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x19cd36[_0x2f07('0x51')];this[_0x2f07('0x52')]=_0x19cd36[_0x2f07('0x52')];this[_0x2f07('0x53')]=_0x19cd36[_0x2f07('0x53')];this[_0x2f07('0x54')]=_0x19cd36[_0x2f07('0x54')];this['outboundRejectCallsDay']=0x0;this[_0x2f07('0x55')]=0x0;this['timeout']=_0x19cd36[_0x2f07('0x56')];this['outboundAnswerCallsDay']=0x0;this[_0x2f07('0x57')]=0x0;this[_0x2f07('0x58')]=0x0;this[_0x2f07('0x59')]=0x0;this[_0x2f07('0x5a')]=0x0;this[_0x2f07('0x5b')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x2f07('0x5c')]=0x0;this[_0x2f07('0x5d')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x2f07('0x5e')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x2f07('0x5f')]=0x0;this[_0x2f07('0x60')]=0x0;this[_0x2f07('0x61')]=undefined;this[_0x2f07('0x62')]=undefined;this['handlePredictive']=undefined;this[_0x2f07('0x63')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x2f07('0x64')]=0x0;this[_0x2f07('0x65')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x2f07('0x66')]=0x0;this[_0x2f07('0x67')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x2f07('0x68')]=0x0;this[_0x2f07('0x69')]=_0x19cd36[_0x2f07('0x6a')]||0x14;this[_0x2f07('0x6b')]=_0x19cd36['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x2f07('0x6c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x2f07('0x6d')]=0x1;this[_0x2f07('0x6e')]=0x0;this[_0x2f07('0x6f')]=0x0;this[_0x2f07('0x70')]=0x0;this[_0x2f07('0x71')]=0x0;this[_0x2f07('0x72')]=_0x19cd36[_0x2f07('0x72')]||0x1e;this[_0x2f07('0x73')]=_0x19cd36['dialRecallInQueue']||![];this[_0x2f07('0x74')]=!!_0x19cd36['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x19cd36['dialPreviewRecallmeReminder']||![];this[_0x2f07('0x75')]=_0x19cd36[_0x2f07('0x75')]||undefined;this['dialAgiAfterHangupClient']=_0x19cd36['dialAgiAfterHangupClient']||![];this[_0x2f07('0x76')]=_0x19cd36[_0x2f07('0x76')]||![];this[_0x2f07('0x77')]=monitorFormat[_0x19cd36[_0x2f07('0x77')]]?monitorFormat[_0x19cd36[_0x2f07('0x77')]]:undefined;this[_0x2f07('0x78')]=_0x19cd36['mandatoryDisposition']||![];this[_0x2f07('0x79')]=_0x19cd36[_0x2f07('0x79')]?_0x19cd36[_0x2f07('0x79')]:undefined;this[_0x2f07('0x7a')]=![];}module[_0x2f07('0x7b')]=VoiceQueue; \ No newline at end of file +var _0x9ac7=['wav49','fewestcalls','leastrecent','random','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','available','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','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','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav'];(function(_0x419e17,_0x7fe78c){var _0x1f2044=function(_0x3723e6){while(--_0x3723e6){_0x419e17['push'](_0x419e17['shift']());}};_0x1f2044(++_0x7fe78c);}(_0x9ac7,0x80));var _0x79ac=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9ac7[_0x543084];return _0x306a57;};'use strict';var monitorFormat={'wav':_0x79ac('0x0'),'wav49':_0x79ac('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x79ac('0x2'),'leastrecent':_0x79ac('0x3'),'linear':'linear','random':_0x79ac('0x4'),'ringall':_0x79ac('0x5'),'rr':_0x79ac('0x6'),'rrmemory':_0x79ac('0x7'),'rrordered':_0x79ac('0x8'),'wrandom':'wrandom'};function VoiceQueue(_0x39ba24){this['id']=_0x39ba24['id']||0x0;this['name']=_0x39ba24[_0x79ac('0x9')]||'';this[_0x79ac('0xa')]=_0x39ba24[_0x79ac('0xa')]||'';this[_0x79ac('0xb')]=_0x39ba24[_0x79ac('0xb')]||_0x79ac('0xc');this[_0x79ac('0xd')]=0x0;this[_0x79ac('0xe')]=0x0;this[_0x79ac('0xf')]=0x0;this[_0x79ac('0x10')]=0x0;this[_0x79ac('0x11')]=0x0;this['sumBillable']=0x0;this[_0x79ac('0x12')]=0x0;this[_0x79ac('0x13')]=0x0;this[_0x79ac('0x14')]=0x0;this['busy']=0x0;this[_0x79ac('0x15')]=0x0;this[_0x79ac('0x16')]=0x0;this[_0x79ac('0x17')]=0x0;this[_0x79ac('0x18')]=0x0;this[_0x79ac('0x19')]=0x0;this[_0x79ac('0x1a')]=0x0;this[_0x79ac('0x1b')]=0x0;this['ringInUse']=0x0;this[_0x79ac('0x1c')]=0x0;this[_0x79ac('0x1d')]=0x0;this[_0x79ac('0x1e')]=0x0;this[_0x79ac('0x1f')]=_0x39ba24[_0x79ac('0x1f')]||![];this['acwTimeout']=_0x39ba24[_0x79ac('0x20')]||0xa;this[_0x79ac('0x21')]=_0x39ba24[_0x79ac('0x21')]||'no';this[_0x79ac('0x22')]=!![];this[_0x79ac('0x23')]='';this['statusMessage']='';this[_0x79ac('0x24')]=0x0;this['temp']=0x0;this[_0x79ac('0x25')]=_0x39ba24[_0x79ac('0x25')]||null;this[_0x79ac('0x26')]=_0x39ba24[_0x79ac('0x26')]?_0x39ba24[_0x79ac('0x26')]:null;this['dialActive']=_0x39ba24[_0x79ac('0x27')];this['dialMethod']=_0x39ba24[_0x79ac('0x28')]||_0x79ac('0x29');this[_0x79ac('0x2a')]=_0x39ba24['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x39ba24[_0x79ac('0x2b')]||0x0;this[_0x79ac('0x2c')]=_0x39ba24['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x39ba24[_0x79ac('0x2d')]||_0x79ac('0x2e');this[_0x79ac('0x2f')]=_0x39ba24[_0x79ac('0x2f')]||0.03;this['dialPredictiveInterval']=_0x39ba24[_0x79ac('0x30')]||0x258;this[_0x79ac('0x31')]=_0x39ba24[_0x79ac('0x31')]||_0x79ac('0x32');this['dialOriginateCallerIdNumber']=_0x39ba24['dialOriginateCallerIdNumber']||_0x79ac('0x32');this[_0x79ac('0x33')]=_0x39ba24[_0x79ac('0x33')]||0x1e;this['dialQueueOptions']=_0x39ba24[_0x79ac('0x34')]||_0x79ac('0x35');this['dialQueueTimeout']=_0x39ba24[_0x79ac('0x36')]||0x3;this[_0x79ac('0x37')]=_0x39ba24[_0x79ac('0x37')]||undefined;this[_0x79ac('0x38')]=_0x39ba24[_0x79ac('0x38')]||0x3;this['dialCongestionRetryFrequency']=_0x39ba24[_0x79ac('0x39')]||0x96;this[_0x79ac('0x3a')]=_0x39ba24[_0x79ac('0x3a')]||0x3;this[_0x79ac('0x3b')]=_0x39ba24['dialBusyRetryFrequency']||0x96;this[_0x79ac('0x3c')]=_0x39ba24['dialNoAnswerMaxRetry']||0x3;this[_0x79ac('0x3d')]=_0x39ba24[_0x79ac('0x3d')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x39ba24[_0x79ac('0x3e')]||0x3;this[_0x79ac('0x3f')]=_0x39ba24[_0x79ac('0x3f')]||0x96;this[_0x79ac('0x40')]=_0x39ba24[_0x79ac('0x40')]||0x3;this[_0x79ac('0x41')]=_0x39ba24[_0x79ac('0x41')]||0x96;this[_0x79ac('0x42')]=_0x39ba24[_0x79ac('0x42')]||0x3;this[_0x79ac('0x43')]=_0x39ba24[_0x79ac('0x43')]||0x96;this['dialMachineMaxRetry']=_0x39ba24[_0x79ac('0x44')]||0x3;this[_0x79ac('0x45')]=_0x39ba24['dialMachineRetryFrequency']||0x96;this[_0x79ac('0x46')]=_0x39ba24[_0x79ac('0x46')]||0x3;this[_0x79ac('0x47')]=_0x39ba24[_0x79ac('0x47')]||0x96;this[_0x79ac('0x48')]=_0x39ba24[_0x79ac('0x48')]||0x3;this[_0x79ac('0x49')]=_0x39ba24[_0x79ac('0x49')]||0x4;this[_0x79ac('0x4a')]=_0x39ba24[_0x79ac('0x4a')]?_0x39ba24[_0x79ac('0x4a')]:undefined;this[_0x79ac('0x4b')]=_0x39ba24[_0x79ac('0x4b')]?_0x39ba24[_0x79ac('0x4b')]:undefined;this[_0x79ac('0x4c')]=_0x39ba24[_0x79ac('0x4c')]||undefined;this['Interval']=_0x39ba24[_0x79ac('0x4d')]?_0x39ba24[_0x79ac('0x4d')]:undefined;this[_0x79ac('0x4e')]=_0x39ba24[_0x79ac('0x4e')]||'DESC';this[_0x79ac('0x4f')]=_0x39ba24[_0x79ac('0x4f')]||undefined;this['dialCutDigit']=_0x39ba24[_0x79ac('0x50')]||undefined;this['strategy']=strategy[_0x39ba24[_0x79ac('0x51')]];this[_0x79ac('0x52')]=!![];this['dialAMDActive']=_0x39ba24[_0x79ac('0x53')]||![];this['dialAMDInitialSilence']=_0x39ba24[_0x79ac('0x54')];this[_0x79ac('0x55')]=_0x39ba24['dialAMDGreeting'];this[_0x79ac('0x56')]=_0x39ba24[_0x79ac('0x56')];this[_0x79ac('0x57')]=_0x39ba24[_0x79ac('0x57')];this[_0x79ac('0x58')]=_0x39ba24[_0x79ac('0x58')];this[_0x79ac('0x59')]=_0x39ba24[_0x79ac('0x59')];this['dialAMDMaximumNumberOfWords']=_0x39ba24[_0x79ac('0x5a')];this[_0x79ac('0x5b')]=_0x39ba24[_0x79ac('0x5b')];this['dialAMDMaximumWordLength']=_0x39ba24[_0x79ac('0x5c')];this[_0x79ac('0x5d')]=0x0;this[_0x79ac('0x5e')]=0x0;this[_0x79ac('0x5f')]=_0x39ba24[_0x79ac('0x5f')];this['outboundAnswerCallsDay']=0x0;this[_0x79ac('0x60')]=0x0;this[_0x79ac('0x61')]=0x0;this[_0x79ac('0x62')]=0x0;this[_0x79ac('0x63')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x79ac('0x64')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x79ac('0x65')]=0x0;this[_0x79ac('0x66')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x79ac('0x67')]=undefined;this['handlePredictive']=undefined;this[_0x79ac('0x68')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x79ac('0x69')]=0x0;this[_0x79ac('0x6a')]=0x0;this[_0x79ac('0x6b')]=0x0;this[_0x79ac('0x6c')]=0x0;this[_0x79ac('0x6d')]=0x0;this[_0x79ac('0x6e')]=_0x39ba24[_0x79ac('0x6f')]||0x14;this['predictiveIntervalMinThreshold']=_0x39ba24[_0x79ac('0x6f')]||0xa;this[_0x79ac('0x70')]=0x0;this[_0x79ac('0x71')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x79ac('0x72')]=0x0;this[_0x79ac('0x73')]=0x0;this[_0x79ac('0x74')]=0x0;this[_0x79ac('0x75')]=0x0;this[_0x79ac('0x76')]=_0x39ba24[_0x79ac('0x76')]||0x1e;this['dialRecallInQueue']=_0x39ba24[_0x79ac('0x77')]||![];this['dialPreviewAutoRecallMe']=!!_0x39ba24[_0x79ac('0x78')]||![];this['dialPreviewRecallmeReminder']=!!_0x39ba24[_0x79ac('0x79')]||![];this[_0x79ac('0x7a')]=_0x39ba24['dialQueueProject2']||undefined;this[_0x79ac('0x7b')]=_0x39ba24['dialAgiAfterHangupClient']||![];this[_0x79ac('0x7c')]=_0x39ba24[_0x79ac('0x7c')]||![];this[_0x79ac('0xa')]=monitorFormat[_0x39ba24['monitor_format']]?monitorFormat[_0x39ba24[_0x79ac('0xa')]]:undefined;this['mandatoryDisposition']=_0x39ba24[_0x79ac('0x7d')]||![];this[_0x79ac('0x7e')]=_0x39ba24['mandatoryDispositionPause']?_0x39ba24[_0x79ac('0x7e')]:undefined;this[_0x79ac('0x7f')]=![];}module[_0x79ac('0x80')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 039079b..8b42283 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 _0x044a=['length','SIP/','online','includes','status','booked','keys','queue','dialer','xcally-motion-preview','some','message','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','statusMessage','Trunk','name','active','prototype','createReport','loggedin','callers'];(function(_0x259754,_0xcb1c03){var _0x7a42e2=function(_0x1be047){while(--_0x1be047){_0x259754['push'](_0x259754['shift']());}};_0x7a42e2(++_0xcb1c03);}(_0x044a,0x173));var _0xa044=function(_0x12de81,_0x4ed498){_0x12de81=_0x12de81-0x0;var _0x147e5f=_0x044a[_0x12de81];return _0x147e5f;};'use strict';var INBOUND_COUNTERS=[_0xa044('0x0'),_0xa044('0x1'),_0xa044('0x2'),_0xa044('0x3'),_0xa044('0x4'),_0xa044('0x5'),_0xa044('0x6')];var OUTBOUND_COUNTERS=[_0xa044('0x0'),_0xa044('0x7'),_0xa044('0x8'),'loggedIn',_0xa044('0x2'),_0xa044('0x9'),_0xa044('0xa'),_0xa044('0xb'),'outboundBlacklistCallsDay',_0xa044('0xc'),_0xa044('0xd'),_0xa044('0xe'),_0xa044('0xf'),'outboundReCallsDay',_0xa044('0x10'),_0xa044('0x11'),_0xa044('0x3'),'pTalking',_0xa044('0x5'),_0xa044('0x12'),_0xa044('0x13'),_0xa044('0x14'),'waiting'];function VoiceQueueSummary(_0x195edf){this['id']=_0x195edf['id'];this['name']=_0x195edf['name'];this[_0xa044('0x15')]=_0x195edf[_0xa044('0x15')];this[_0xa044('0x16')]=_0x195edf[_0xa044('0x16')]||0x0;this[_0xa044('0x7')]=_0x195edf[_0xa044('0x7')]||0x0;this[_0xa044('0x0')]=_0x195edf['available']||0x0;this[_0xa044('0x17')]=_0x195edf['busy']||0x0;this[_0xa044('0x8')]=_0x195edf[_0xa044('0x8')]||0x0;this[_0xa044('0x18')]=_0x195edf[_0xa044('0x18')]||0x0;this[_0xa044('0x1')]=_0x195edf['loggedIn']||0x0;this['loggedInDb']=_0x195edf[_0xa044('0x2')]||0x0;this['onHold']=_0x195edf[_0xa044('0x19')]||0x0;this[_0xa044('0x1a')]=_0x195edf[_0xa044('0x1a')]||0x0;this[_0xa044('0x3')]=_0x195edf[_0xa044('0x3')]||0x0;this['ringing']=_0x195edf['ringing']||0x0;this['ringInUse']=_0x195edf[_0xa044('0x1b')];this[_0xa044('0x12')]=_0x195edf[_0xa044('0x12')];this['sumDuration']=_0x195edf[_0xa044('0x13')];this[_0xa044('0x1c')]=_0x195edf['sumHoldTime']||0x0;this[_0xa044('0x5')]=_0x195edf[_0xa044('0x5')]||0x0;this[_0xa044('0x14')]=_0x195edf['total']||0x0;this[_0xa044('0x1d')]=_0x195edf[_0xa044('0x1d')];this[_0xa044('0x1e')]=_0x195edf[_0xa044('0x1e')]||0x0;this[_0xa044('0x1f')]=_0x195edf[_0xa044('0x1f')]||0x0;this[_0xa044('0x20')]=_0x195edf[_0xa044('0x20')]||0x0;this[_0xa044('0x6')]=_0x195edf['waiting']||0x0;if(_0x195edf['type']===_0xa044('0x21')){this[_0xa044('0x22')]=_0x195edf[_0xa044('0x22')]||0x0;this['dialActive']=_0x195edf[_0xa044('0x23')];this[_0xa044('0x24')]=_0x195edf['dialMethod'];this[_0xa044('0x25')]=_0x195edf[_0xa044('0x25')];this['dialOriginateCallerIdNumber']=_0x195edf[_0xa044('0x26')];this[_0xa044('0x27')]=_0x195edf['dialOriginateTimeout'];this['dialPrefix']=_0x195edf['dialPrefix'];this[_0xa044('0x28')]=_0x195edf[_0xa044('0x28')];this[_0xa044('0x29')]=_0x195edf['outboundAnswerAgiCallsDay'];this[_0xa044('0xb')]=_0x195edf[_0xa044('0xb')];this['outboundBlacklistCallsDay']=_0x195edf[_0xa044('0x2a')];this['outboundBusyCallsDay']=_0x195edf['outboundBusyCallsDay'];this[_0xa044('0xd')]=_0x195edf['outboundCongestionCallsDay'];this[_0xa044('0x2b')]=_0x195edf[_0xa044('0x2b')];this[_0xa044('0x2c')]=_0x195edf[_0xa044('0x2c')];this[_0xa044('0x2d')]=_0x195edf[_0xa044('0x2d')];this['outboundNoAnswerCallsDay']=_0x195edf[_0xa044('0xe')];this[_0xa044('0xf')]=_0x195edf[_0xa044('0xf')];this[_0xa044('0x2e')]=_0x195edf['outboundOriginateFailureCallsDay'];this[_0xa044('0x2f')]=_0x195edf[_0xa044('0x2f')];this['outboundRejectCallsDay']=_0x195edf['outboundRejectCallsDay'];this[_0xa044('0x11')]=_0x195edf[_0xa044('0x11')];this['predictiveIntervalAnsweredCalls']=_0x195edf[_0xa044('0x30')];this[_0xa044('0x31')]=_0x195edf[_0xa044('0x31')];this['predictiveIntervalAvgTalktime']=_0x195edf[_0xa044('0x32')];this[_0xa044('0x33')]=_0x195edf[_0xa044('0x33')];this[_0xa044('0x34')]=_0x195edf[_0xa044('0x34')];this['predictiveIntervalErlangCalls']=_0x195edf[_0xa044('0x35')];this[_0xa044('0x36')]=_0x195edf[_0xa044('0x36')];this['predictiveIntervalHitRate']=_0x195edf[_0xa044('0x37')];this[_0xa044('0x38')]=_0x195edf['predictiveIntervalMultiplicativeFactor'];this[_0xa044('0x39')]=_0x195edf[_0xa044('0x39')];this[_0xa044('0x3a')]=_0x195edf[_0xa044('0x3a')];this[_0xa044('0x3b')]=_0x195edf[_0xa044('0x3b')];this[_0xa044('0x9')]=_0x195edf[_0xa044('0x9')];this['erlangCalls']=_0x195edf[_0xa044('0x3c')];this[_0xa044('0x3d')]=_0x195edf[_0xa044('0x3d')];this[_0xa044('0x3e')]=_0x195edf[_0xa044('0x3e')];this['erlangBusyFactor']=_0x195edf[_0xa044('0x3f')];this['startPredictive']=_0x195edf[_0xa044('0x40')];this[_0xa044('0x41')]=_0x195edf['startProgressive'];this['message']=_0x195edf['message'];this[_0xa044('0x42')]=_0x195edf[_0xa044('0x42')];}if(_0x195edf[_0xa044('0x43')]){this[_0xa044('0x43')]={'id':_0x195edf[_0xa044('0x43')]['id'],'name':_0x195edf[_0xa044('0x43')][_0xa044('0x44')],'active':_0x195edf[_0xa044('0x43')][_0xa044('0x45')],'callerid':_0x195edf[_0xa044('0x43')]['callerid']};}}VoiceQueueSummary[_0xa044('0x46')][_0xa044('0x47')]=function(_0x1e84c1,_0x7d768b,_0xde6a4c,_0x1295c0){this[_0xa044('0x2')]=0x0;this[_0xa044('0x5')]=0x0;this[_0xa044('0x3')]=0x0;this[_0xa044('0x1f')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this[_0xa044('0x17')]=0x0;this['invalid']=0x0;this[_0xa044('0x1e')]=0x0;this[_0xa044('0x4')]=0x0;this[_0xa044('0x1b')]=0x0;this[_0xa044('0x19')]=0x0;if(_0xde6a4c){if(_0xde6a4c[_0xa044('0x0')]){this[_0xa044('0x0')]=Number(_0xde6a4c['available']);}if(_0xde6a4c[_0xa044('0x48')]){this['loggedIn']=Number(_0xde6a4c[_0xa044('0x48')]);}if(_0xde6a4c[_0xa044('0x49')]){this[_0xa044('0x6')]=Number(_0xde6a4c['callers']);}}for(var _0x543e64=0x0;_0x543e64<_0x1e84c1[_0xa044('0x4a')];_0x543e64++){var _0x1e4a4f=_0x7d768b[_0xa044('0x4b')+_0x1e84c1[_0x543e64][_0xa044('0x44')]];if(_0x1e4a4f&&_0x1e4a4f[_0xa044('0x4c')]){this[_0xa044('0x2')]+=0x1;}if(_0x1e84c1[_0x543e64]['incall']==='1'){this[_0xa044('0x5')]+=0x1;}if(_0x1e84c1[_0x543e64][_0xa044('0x3')]==='1'&&!['2','7','8'][_0xa044('0x4d')](_0x1e84c1[_0x543e64][_0xa044('0x4e')])){this[_0xa044('0x3')]+=0x1;}switch(_0x1e84c1[_0x543e64][_0xa044('0x4e')]){case'0':this[_0xa044('0x1f')]+=0x1;break;case'1':this[_0xa044('0x1a')]+=0x1;break;case'2':this[_0xa044('0x8')]+=0x1;break;case'3':this[_0xa044('0x17')]+=0x1;break;case'4':this[_0xa044('0x18')]+=0x1;break;case'5':this[_0xa044('0x1e')]+=0x1;break;case'6':this[_0xa044('0x4')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xa044('0x19')]+=0x1;break;}}if(this[_0xa044('0x24')]===_0xa044('0x4f')){var _0x228fc0=Object[_0xa044('0x50')](_0x1295c0);for(var _0x230ecf=0x0;_0x230ecf<_0x228fc0[_0xa044('0x4a')];_0x230ecf++){var _0x5c2498=_0x228fc0[_0x230ecf];var _0x57261c=_0x1295c0[_0x5c2498];if(_0x57261c[_0xa044('0x51')]===this[_0xa044('0x44')]&&_0x57261c[_0xa044('0x1d')]===_0xa044('0x52')&&_0x57261c['exten']===_0xa044('0x53')){this[_0xa044('0x5')]+=0x1;}}if(this[_0xa044('0x5')]>this[_0xa044('0x8')]){this[_0xa044('0x5')]=this[_0xa044('0x8')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xa044('0x46')]['compareToInboundQueue']=function(_0x5ad9fa){var _0x4152c7=![];if(_0x5ad9fa){_0x4152c7=INBOUND_COUNTERS[_0xa044('0x54')](function(_0x3ea870){return this[_0x3ea870]!==_0x5ad9fa[_0x3ea870];},this);}return _0x4152c7;};VoiceQueueSummary[_0xa044('0x46')]['compareToOutboundQueue']=function(_0x55f25d){var _0x4e50d5=![];var _0x26e66a=![];var _0x698e27=![];if(_0x55f25d){_0x4e50d5=this['dialMethod']!==_0x55f25d[_0xa044('0x24')]||this[_0xa044('0x23')]!==_0x55f25d['dialActive']||this['message']!==_0x55f25d[_0xa044('0x55')]||this[_0xa044('0x42')]!==_0x55f25d[_0xa044('0x42')];_0x26e66a=OUTBOUND_COUNTERS[_0xa044('0x54')](function(_0x4c91d0){return this[_0x4c91d0]!==_0x55f25d[_0x4c91d0];},this);if(this[_0xa044('0x43')]&&_0x55f25d[_0xa044('0x43')]){_0x698e27=this[_0xa044('0x43')][_0xa044('0x44')]!==_0x55f25d[_0xa044('0x43')][_0xa044('0x44')]||this[_0xa044('0x43')][_0xa044('0x45')]!==_0x55f25d[_0xa044('0x43')][_0xa044('0x45')];}}return _0x4e50d5||_0x26e66a||_0x698e27;};VoiceQueueSummary[_0xa044('0x46')][_0xa044('0x56')]=function(_0x2b6fa4){this[_0xa044('0x7')]=_0x2b6fa4[_0xa044('0x7')];this['message']=_0x2b6fa4[_0xa044('0x55')];this[_0xa044('0x42')]=_0x2b6fa4[_0xa044('0x42')];this[_0xa044('0x9')]=_0x2b6fa4[_0xa044('0x9')];this[_0xa044('0xa')]=_0x2b6fa4['outboundAbandonedCallsDay'];this[_0xa044('0xb')]=_0x2b6fa4[_0xa044('0xb')];this[_0xa044('0x2a')]=_0x2b6fa4[_0xa044('0x2a')];this[_0xa044('0xc')]=_0x2b6fa4['outboundBusyCallsDay'];this[_0xa044('0xd')]=_0x2b6fa4['outboundCongestionCallsDay'];this['outboundNoAnswerCallsDay']=_0x2b6fa4[_0xa044('0xe')];this[_0xa044('0xf')]=_0x2b6fa4['outboundNoSuchCallsDay'];this[_0xa044('0x2f')]=_0x2b6fa4[_0xa044('0x2f')];this['outboundRejectCallsDay']=_0x2b6fa4[_0xa044('0x10')];this['outboundUnknownCallsDay']=_0x2b6fa4['outboundUnknownCallsDay'];this[_0xa044('0x12')]=_0x2b6fa4['sumBillable'];this['sumDuration']=_0x2b6fa4[_0xa044('0x13')];this[_0xa044('0x14')]=_0x2b6fa4[_0xa044('0x14')];if(this['dialMethod']===_0xa044('0x57')){this[_0xa044('0x22')]=_0x2b6fa4[_0xa044('0x22')];}};module[_0xa044('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0x9b8e=['outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','invalid','loggedIn','onHold','notInUse','ringing','ringInUse','sumHoldTime','talking','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','busy','callers','length','SIP/','online','incall','includes','status','booked','keys','dialer','exten','xcally-motion-preview','some','compareToOutboundQueue','active','updateReportFromOutboundQueue','preview','exports','available','loggedInDb','paused','waiting','answered','inUse','originated','outboundAbandonedCallsDay'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b8e,0x158));var _0xe9b8=function(_0x57aca1,_0x23ebfb){_0x57aca1=_0x57aca1-0x0;var _0x1de320=_0x9b8e[_0x57aca1];return _0x1de320;};'use strict';var INBOUND_COUNTERS=[_0xe9b8('0x0'),'loggedIn',_0xe9b8('0x1'),_0xe9b8('0x2'),'ringing','talking',_0xe9b8('0x3')];var OUTBOUND_COUNTERS=['available',_0xe9b8('0x4'),_0xe9b8('0x5'),'loggedIn',_0xe9b8('0x1'),_0xe9b8('0x6'),_0xe9b8('0x7'),_0xe9b8('0x8'),_0xe9b8('0x9'),_0xe9b8('0xa'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0xe9b8('0xb'),_0xe9b8('0xc'),_0xe9b8('0xd'),_0xe9b8('0xe'),'paused',_0xe9b8('0xf'),'talking',_0xe9b8('0x10'),_0xe9b8('0x11'),_0xe9b8('0x12'),_0xe9b8('0x3')];function VoiceQueueSummary(_0x1fa429){this['id']=_0x1fa429['id'];this[_0xe9b8('0x13')]=_0x1fa429[_0xe9b8('0x13')];this[_0xe9b8('0x14')]=_0x1fa429[_0xe9b8('0x14')];this[_0xe9b8('0x15')]=_0x1fa429[_0xe9b8('0x15')]||0x0;this[_0xe9b8('0x4')]=_0x1fa429[_0xe9b8('0x4')]||0x0;this['available']=_0x1fa429['available']||0x0;this['busy']=_0x1fa429['busy']||0x0;this[_0xe9b8('0x5')]=_0x1fa429['inUse']||0x0;this['invalid']=_0x1fa429[_0xe9b8('0x16')]||0x0;this[_0xe9b8('0x17')]=_0x1fa429[_0xe9b8('0x17')]||0x0;this[_0xe9b8('0x1')]=_0x1fa429[_0xe9b8('0x1')]||0x0;this[_0xe9b8('0x18')]=_0x1fa429['onHold']||0x0;this[_0xe9b8('0x19')]=_0x1fa429[_0xe9b8('0x19')]||0x0;this[_0xe9b8('0x2')]=_0x1fa429[_0xe9b8('0x2')]||0x0;this[_0xe9b8('0x1a')]=_0x1fa429[_0xe9b8('0x1a')]||0x0;this['ringInUse']=_0x1fa429[_0xe9b8('0x1b')];this['sumBillable']=_0x1fa429[_0xe9b8('0x10')];this[_0xe9b8('0x11')]=_0x1fa429[_0xe9b8('0x11')];this['sumHoldTime']=_0x1fa429[_0xe9b8('0x1c')]||0x0;this[_0xe9b8('0x1d')]=_0x1fa429[_0xe9b8('0x1d')]||0x0;this[_0xe9b8('0x12')]=_0x1fa429[_0xe9b8('0x12')]||0x0;this['type']=_0x1fa429[_0xe9b8('0x1e')];this['unavailable']=_0x1fa429[_0xe9b8('0x1f')]||0x0;this[_0xe9b8('0x20')]=_0x1fa429[_0xe9b8('0x20')]||0x0;this[_0xe9b8('0x21')]=_0x1fa429[_0xe9b8('0x21')]||0x0;this['waiting']=_0x1fa429['waiting']||0x0;if(_0x1fa429[_0xe9b8('0x1e')]===_0xe9b8('0x22')){this[_0xe9b8('0xf')]=_0x1fa429['pTalking']||0x0;this['dialActive']=_0x1fa429[_0xe9b8('0x23')];this['dialMethod']=_0x1fa429[_0xe9b8('0x24')];this['dialOriginateCallerIdName']=_0x1fa429[_0xe9b8('0x25')];this[_0xe9b8('0x26')]=_0x1fa429[_0xe9b8('0x26')];this['dialOriginateTimeout']=_0x1fa429[_0xe9b8('0x27')];this['dialPrefix']=_0x1fa429[_0xe9b8('0x28')];this['temp']=_0x1fa429[_0xe9b8('0x29')];this[_0xe9b8('0x2a')]=_0x1fa429[_0xe9b8('0x2a')];this[_0xe9b8('0x8')]=_0x1fa429[_0xe9b8('0x8')];this[_0xe9b8('0x9')]=_0x1fa429[_0xe9b8('0x9')];this[_0xe9b8('0xa')]=_0x1fa429['outboundBusyCallsDay'];this[_0xe9b8('0x2b')]=_0x1fa429[_0xe9b8('0x2b')];this[_0xe9b8('0x2c')]=_0x1fa429[_0xe9b8('0x2c')];this[_0xe9b8('0x2d')]=_0x1fa429['outboundDropCallsDayCallersExit'];this[_0xe9b8('0x2e')]=_0x1fa429[_0xe9b8('0x2e')];this[_0xe9b8('0x2f')]=_0x1fa429[_0xe9b8('0x2f')];this[_0xe9b8('0xb')]=_0x1fa429[_0xe9b8('0xb')];this['outboundOriginateFailureCallsDay']=_0x1fa429['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x1fa429['outboundReCallsDay'];this[_0xe9b8('0xd')]=_0x1fa429[_0xe9b8('0xd')];this[_0xe9b8('0xe')]=_0x1fa429['outboundUnknownCallsDay'];this[_0xe9b8('0x30')]=_0x1fa429['predictiveIntervalAnsweredCalls'];this['predictiveIntervalAvgHoldtime']=_0x1fa429[_0xe9b8('0x31')];this[_0xe9b8('0x32')]=_0x1fa429['predictiveIntervalAvgTalktime'];this[_0xe9b8('0x33')]=_0x1fa429[_0xe9b8('0x33')];this[_0xe9b8('0x34')]=_0x1fa429[_0xe9b8('0x34')];this[_0xe9b8('0x35')]=_0x1fa429['predictiveIntervalErlangCalls'];this['predictiveIntervalErlangCallsDroppedCalls']=_0x1fa429[_0xe9b8('0x36')];this['predictiveIntervalHitRate']=_0x1fa429[_0xe9b8('0x37')];this['predictiveIntervalMultiplicativeFactor']=_0x1fa429['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0x1fa429[_0xe9b8('0x38')];this['predictiveIntervalAvailable']=_0x1fa429[_0xe9b8('0x39')];this['predictiveIntervalTotalCalls']=_0x1fa429['predictiveIntervalTotalCalls'];this['originated']=_0x1fa429[_0xe9b8('0x6')];this[_0xe9b8('0x3a')]=_0x1fa429[_0xe9b8('0x3a')];this[_0xe9b8('0x3b')]=_0x1fa429[_0xe9b8('0x3b')];this[_0xe9b8('0x3c')]=_0x1fa429[_0xe9b8('0x3c')];this[_0xe9b8('0x3d')]=_0x1fa429[_0xe9b8('0x3d')];this['startPredictive']=_0x1fa429['startPredictive'];this[_0xe9b8('0x3e')]=_0x1fa429['startProgressive'];this[_0xe9b8('0x3f')]=_0x1fa429[_0xe9b8('0x3f')];this[_0xe9b8('0x40')]=_0x1fa429[_0xe9b8('0x40')];}if(_0x1fa429[_0xe9b8('0x41')]){this[_0xe9b8('0x41')]={'id':_0x1fa429[_0xe9b8('0x41')]['id'],'name':_0x1fa429[_0xe9b8('0x41')][_0xe9b8('0x13')],'active':_0x1fa429[_0xe9b8('0x41')]['active'],'callerid':_0x1fa429[_0xe9b8('0x41')][_0xe9b8('0x42')]};}}VoiceQueueSummary[_0xe9b8('0x43')][_0xe9b8('0x44')]=function(_0x2d7a6e,_0xef13b5,_0x4fa923,_0x5da168){this[_0xe9b8('0x1')]=0x0;this['talking']=0x0;this[_0xe9b8('0x2')]=0x0;this[_0xe9b8('0x20')]=0x0;this[_0xe9b8('0x19')]=0x0;this[_0xe9b8('0x5')]=0x0;this[_0xe9b8('0x45')]=0x0;this['invalid']=0x0;this[_0xe9b8('0x1f')]=0x0;this[_0xe9b8('0x1a')]=0x0;this['ringInUse']=0x0;this[_0xe9b8('0x18')]=0x0;if(_0x4fa923){if(_0x4fa923[_0xe9b8('0x0')]){this[_0xe9b8('0x0')]=Number(_0x4fa923['available']);}if(_0x4fa923['loggedin']){this[_0xe9b8('0x17')]=Number(_0x4fa923['loggedin']);}if(_0x4fa923[_0xe9b8('0x46')]){this['waiting']=Number(_0x4fa923[_0xe9b8('0x46')]);}}for(var _0x36ba36=0x0;_0x36ba36<_0x2d7a6e[_0xe9b8('0x47')];_0x36ba36++){var _0x56147c=_0xef13b5[_0xe9b8('0x48')+_0x2d7a6e[_0x36ba36]['name']];if(_0x56147c&&_0x56147c[_0xe9b8('0x49')]){this['loggedInDb']+=0x1;}if(_0x2d7a6e[_0x36ba36][_0xe9b8('0x4a')]==='1'){this[_0xe9b8('0x1d')]+=0x1;}if(_0x2d7a6e[_0x36ba36]['paused']==='1'&&!['2','7','8'][_0xe9b8('0x4b')](_0x2d7a6e[_0x36ba36][_0xe9b8('0x4c')])){this[_0xe9b8('0x2')]+=0x1;}switch(_0x2d7a6e[_0x36ba36][_0xe9b8('0x4c')]){case'0':this[_0xe9b8('0x20')]+=0x1;break;case'1':this[_0xe9b8('0x19')]+=0x1;break;case'2':this[_0xe9b8('0x5')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xe9b8('0x16')]+=0x1;break;case'5':this[_0xe9b8('0x1f')]+=0x1;break;case'6':this[_0xe9b8('0x1a')]+=0x1;break;case'7':this[_0xe9b8('0x1b')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0xe9b8('0x24')]===_0xe9b8('0x4d')){var _0x3459ab=Object[_0xe9b8('0x4e')](_0x5da168);for(var _0x30adfc=0x0;_0x30adfc<_0x3459ab[_0xe9b8('0x47')];_0x30adfc++){var _0x5dc32e=_0x3459ab[_0x30adfc];var _0x6a32ea=_0x5da168[_0x5dc32e];if(_0x6a32ea['queue']===this[_0xe9b8('0x13')]&&_0x6a32ea[_0xe9b8('0x1e')]===_0xe9b8('0x4f')&&_0x6a32ea[_0xe9b8('0x50')]===_0xe9b8('0x51')){this['talking']+=0x1;}}if(this[_0xe9b8('0x1d')]>this[_0xe9b8('0x5')]){this[_0xe9b8('0x1d')]=this[_0xe9b8('0x5')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xe9b8('0x43')]['compareToInboundQueue']=function(_0x125306){var _0x390f90=![];if(_0x125306){_0x390f90=INBOUND_COUNTERS[_0xe9b8('0x52')](function(_0x399d57){return this[_0x399d57]!==_0x125306[_0x399d57];},this);}return _0x390f90;};VoiceQueueSummary[_0xe9b8('0x43')][_0xe9b8('0x53')]=function(_0x58bbcc){var _0x307fa8=![];var _0x18997a=![];var _0x4d208a=![];if(_0x58bbcc){_0x307fa8=this[_0xe9b8('0x24')]!==_0x58bbcc['dialMethod']||this[_0xe9b8('0x23')]!==_0x58bbcc['dialActive']||this[_0xe9b8('0x3f')]!==_0x58bbcc['message']||this[_0xe9b8('0x40')]!==_0x58bbcc[_0xe9b8('0x40')];_0x18997a=OUTBOUND_COUNTERS[_0xe9b8('0x52')](function(_0x1a600a){return this[_0x1a600a]!==_0x58bbcc[_0x1a600a];},this);if(this[_0xe9b8('0x41')]&&_0x58bbcc[_0xe9b8('0x41')]){_0x4d208a=this['Trunk']['name']!==_0x58bbcc[_0xe9b8('0x41')][_0xe9b8('0x13')]||this[_0xe9b8('0x41')][_0xe9b8('0x54')]!==_0x58bbcc[_0xe9b8('0x41')]['active'];}}return _0x307fa8||_0x18997a||_0x4d208a;};VoiceQueueSummary[_0xe9b8('0x43')][_0xe9b8('0x55')]=function(_0x5aa621){this[_0xe9b8('0x4')]=_0x5aa621['answered'];this[_0xe9b8('0x3f')]=_0x5aa621[_0xe9b8('0x3f')];this[_0xe9b8('0x40')]=_0x5aa621[_0xe9b8('0x40')];this[_0xe9b8('0x6')]=_0x5aa621['originated'];this['outboundAbandonedCallsDay']=_0x5aa621['outboundAbandonedCallsDay'];this[_0xe9b8('0x8')]=_0x5aa621[_0xe9b8('0x8')];this[_0xe9b8('0x9')]=_0x5aa621[_0xe9b8('0x9')];this['outboundBusyCallsDay']=_0x5aa621[_0xe9b8('0xa')];this[_0xe9b8('0x2b')]=_0x5aa621[_0xe9b8('0x2b')];this['outboundNoAnswerCallsDay']=_0x5aa621[_0xe9b8('0x2f')];this[_0xe9b8('0xb')]=_0x5aa621[_0xe9b8('0xb')];this[_0xe9b8('0xc')]=_0x5aa621['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x5aa621[_0xe9b8('0xd')];this[_0xe9b8('0xe')]=_0x5aa621[_0xe9b8('0xe')];this[_0xe9b8('0x10')]=_0x5aa621[_0xe9b8('0x10')];this['sumDuration']=_0x5aa621[_0xe9b8('0x11')];this[_0xe9b8('0x12')]=_0x5aa621[_0xe9b8('0x12')];if(this['dialMethod']===_0xe9b8('0x56')){this['pTalking']=_0x5aa621[_0xe9b8('0xf')];}};module[_0xe9b8('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 1b29bca..70141be 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 _0x0ff1=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x1d0d23,_0x43e210){var _0x2d295b=function(_0x214774){while(--_0x214774){_0x1d0d23['push'](_0x1d0d23['shift']());}};_0x2d295b(++_0x43e210);}(_0x0ff1,0x9a));var _0x10ff=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0x0ff1[_0x36b037];return _0x409194;};'use strict';function VtigerAccount(_0x2bdf0d){this['id']=_0x2bdf0d['id']||0x0;this[_0x10ff('0x0')]=_0x2bdf0d['name']||'';this[_0x10ff('0x1')]=_0x2bdf0d[_0x10ff('0x1')]||'';this['accessKey']=_0x2bdf0d[_0x10ff('0x2')]||'';this['remoteUri']=_0x2bdf0d[_0x10ff('0x3')]||'';this[_0x10ff('0x4')]=_0x2bdf0d[_0x10ff('0x4')]||'';this[_0x10ff('0x5')]=_0x2bdf0d[_0x10ff('0x5')]||{};}module[_0x10ff('0x6')]=VtigerAccount; \ No newline at end of file +var _0xb5d4=['serverUrl','Configurations','name','username','accessKey','remoteUri'];(function(_0xb64b8b,_0x1ece29){var _0x2234ce=function(_0x5183d5){while(--_0x5183d5){_0xb64b8b['push'](_0xb64b8b['shift']());}};_0x2234ce(++_0x1ece29);}(_0xb5d4,0x1f4));var _0x4b5d=function(_0x1ccf9b,_0xec214b){_0x1ccf9b=_0x1ccf9b-0x0;var _0x26a007=_0xb5d4[_0x1ccf9b];return _0x26a007;};'use strict';function VtigerAccount(_0x4c4d20){this['id']=_0x4c4d20['id']||0x0;this[_0x4b5d('0x0')]=_0x4c4d20[_0x4b5d('0x0')]||'';this[_0x4b5d('0x1')]=_0x4c4d20[_0x4b5d('0x1')]||'';this['accessKey']=_0x4c4d20[_0x4b5d('0x2')]||'';this[_0x4b5d('0x3')]=_0x4c4d20[_0x4b5d('0x3')]||'';this[_0x4b5d('0x4')]=_0x4c4d20['serverUrl']||'';this[_0x4b5d('0x5')]=_0x4c4d20[_0x4b5d('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index bca4508..e33bb41 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 _0x22f2=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x2cadfb,_0x474633){var _0x4449d0=function(_0x1a1ebc){while(--_0x1a1ebc){_0x2cadfb['push'](_0x2cadfb['shift']());}};_0x4449d0(++_0x474633);}(_0x22f2,0x1af));var _0x222f=function(_0x38ba2b,_0xa1b9f4){_0x38ba2b=_0x38ba2b-0x0;var _0x55bca9=_0x22f2[_0x38ba2b];return _0x55bca9;};'use strict';function ZendeskAccount(_0x54b5f4){this['id']=_0x54b5f4['id']||0x0;this[_0x222f('0x0')]=_0x54b5f4[_0x222f('0x0')]||'';this[_0x222f('0x1')]=_0x54b5f4[_0x222f('0x1')]||'';this[_0x222f('0x2')]=_0x54b5f4[_0x222f('0x2')]||'';this[_0x222f('0x3')]=_0x54b5f4[_0x222f('0x3')]||'';this[_0x222f('0x4')]=_0x54b5f4[_0x222f('0x4')]||'';this[_0x222f('0x5')]=_0x54b5f4[_0x222f('0x5')]||'';this[_0x222f('0x6')]=_0x54b5f4[_0x222f('0x6')]||'integrationTab';this[_0x222f('0x7')]=_0x54b5f4['serverUrl']||'';this[_0x222f('0x8')]=_0x54b5f4[_0x222f('0x8')]||{};}module[_0x222f('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x1318=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x1cc312,_0x1da163){var _0x19eb1b=function(_0x4b974c){while(--_0x4b974c){_0x1cc312['push'](_0x1cc312['shift']());}};_0x19eb1b(++_0x1da163);}(_0x1318,0xaa));var _0x8131=function(_0xc395cc,_0x54d2fe){_0xc395cc=_0xc395cc-0x0;var _0x57def1=_0x1318[_0xc395cc];return _0x57def1;};'use strict';function ZendeskAccount(_0x2ba74d){this['id']=_0x2ba74d['id']||0x0;this[_0x8131('0x0')]=_0x2ba74d[_0x8131('0x0')]||'';this[_0x8131('0x1')]=_0x2ba74d[_0x8131('0x1')]||'';this[_0x8131('0x2')]=_0x2ba74d[_0x8131('0x2')]||'';this[_0x8131('0x3')]=_0x2ba74d[_0x8131('0x3')]||'';this[_0x8131('0x4')]=_0x2ba74d['remoteUri']||'';this[_0x8131('0x5')]=_0x2ba74d[_0x8131('0x5')]||'';this[_0x8131('0x6')]=_0x2ba74d[_0x8131('0x6')]||_0x8131('0x7');this[_0x8131('0x8')]=_0x2ba74d[_0x8131('0x8')]||'';this['Configurations']=_0x2ba74d[_0x8131('0x9')]||{};}module[_0x8131('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 15ba4a5..0584627 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 _0xc9c8=['Configurations','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x370b49,_0x151875){var _0x23864c=function(_0x142ae5){while(--_0x142ae5){_0x370b49['push'](_0x370b49['shift']());}};_0x23864c(++_0x151875);}(_0xc9c8,0x1c3));var _0x8c9c=function(_0x4809fb,_0x58c89a){_0x4809fb=_0x4809fb-0x0;var _0x396853=_0xc9c8[_0x4809fb];return _0x396853;};'use strict';function ZohoAccount(_0x447fb8){this['id']=_0x447fb8['id']||0x0;this['name']=_0x447fb8['name']||'';this[_0x8c9c('0x0')]=_0x447fb8[_0x8c9c('0x0')]||'';this[_0x8c9c('0x1')]=_0x447fb8[_0x8c9c('0x1')]||'';this[_0x8c9c('0x2')]=_0x447fb8[_0x8c9c('0x2')]||'';this[_0x8c9c('0x3')]=_0x447fb8['clientId']||'';this[_0x8c9c('0x4')]=_0x447fb8[_0x8c9c('0x4')]||'';this['serverUrl']=_0x447fb8[_0x8c9c('0x5')]||'';this[_0x8c9c('0x6')]=_0x447fb8['code']||'';this[_0x8c9c('0x7')]=_0x447fb8[_0x8c9c('0x7')]||'';this[_0x8c9c('0x8')]=_0x447fb8[_0x8c9c('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x775c=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x380911,_0x1efacc){var _0x2174dc=function(_0x2e4b14){while(--_0x2e4b14){_0x380911['push'](_0x380911['shift']());}};_0x2174dc(++_0x1efacc);}(_0x775c,0x1a4));var _0xc775=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x775c[_0x339129];return _0x1570df;};'use strict';function ZohoAccount(_0x2ca1b4){this['id']=_0x2ca1b4['id']||0x0;this[_0xc775('0x0')]=_0x2ca1b4[_0xc775('0x0')]||'';this[_0xc775('0x1')]=_0x2ca1b4[_0xc775('0x1')]||'';this[_0xc775('0x2')]=_0x2ca1b4[_0xc775('0x2')]||'';this['zone']=_0x2ca1b4[_0xc775('0x3')]||'';this[_0xc775('0x4')]=_0x2ca1b4[_0xc775('0x4')]||'';this[_0xc775('0x5')]=_0x2ca1b4[_0xc775('0x5')]||'';this[_0xc775('0x6')]=_0x2ca1b4['serverUrl']||'';this[_0xc775('0x7')]=_0x2ca1b4[_0xc775('0x7')]||'';this[_0xc775('0x8')]=_0x2ca1b4[_0xc775('0x8')]||'';this['Configurations']=_0x2ca1b4[_0xc775('0x9')]||{};}module[_0xc775('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index e64fa6c..c134498 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 _0x160f=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','type','campaigntype','queue','Agent','channelAgent','membername','format','SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat'];(function(_0xd9baeb,_0x4647da){var _0xf4921d=function(_0x3ee7d4){while(--_0x3ee7d4){_0xd9baeb['push'](_0xd9baeb['shift']());}};_0xf4921d(++_0x4647da);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf160('0x0'));var _=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));function checkNameSurname(_0x2966aa,_0x5bf9e1,_0x4513f1){var _0x2fb414='';if(!_[_0xf160('0x3')](_0x5bf9e1)&&_0xf160('0x4')===typeof _0x5bf9e1){_0x2fb414+=_0x5bf9e1;}if(!_[_0xf160('0x3')](_0x4513f1)&&_0xf160('0x4')===typeof _0x4513f1){_0x2fb414+='\x20'+_0x4513f1;}if(_0x2fb414!==''){return _0x2fb414;}return _0x2966aa;}function Action(_0x4a6f3d,_0x311d63,_0x11902f,_0x49fe49,_0x59440e){this[_0xf160('0x5')]=_0x11902f||undefined;this['idContact']=_0x4a6f3d['id'];this['queue']=_0x311d63['name'];this[_0xf160('0x6')]=_0x311d63[_0xf160('0x6')];this[_0xf160('0x7')]=_0xf160('0x8');this['dialAnswer']=![];this['membername']=_[_0xf160('0x3')](_0x4a6f3d[_0xf160('0x9')])?undefined:_0x4a6f3d[_0xf160('0x9')]['name'];this[_0xf160('0xa')]=this[_0xf160('0xb')]?util[_0xf160('0xc')](_0xf160('0xd'),this[_0xf160('0xb')]):_0x49fe49||undefined;this['calleridname']=checkNameSurname(_0x4a6f3d[_0xf160('0xe')]['phone'],_0x4a6f3d[_0xf160('0xe')][_0xf160('0xf')],_0x4a6f3d[_0xf160('0xe')][_0xf160('0x10')]);this[_0xf160('0x11')]=_0x4a6f3d[_0xf160('0x11')]||![];this[_0xf160('0x12')]=_0x4a6f3d[_0xf160('0x13')];this[_0xf160('0x14')]=_0x4a6f3d['scheduledat'];this[_0xf160('0x15')]=_0x4a6f3d[_0xf160('0x15')]||0x0;this[_0xf160('0x16')]=_0x4a6f3d[_0xf160('0x16')]||0x0;this['countnoanswerretry']=_0x4a6f3d[_0xf160('0x17')]||0x0;this['countglobal']=(_0x4a6f3d[_0xf160('0x15')]||0x0)+(_0x4a6f3d[_0xf160('0x16')]||0x0)+(_0x4a6f3d[_0xf160('0x17')]||0x0)+(_0x4a6f3d[_0xf160('0x18')]||0x0)+(_0x4a6f3d[_0xf160('0x19')]||0x0)+(_0x4a6f3d[_0xf160('0x1a')]||0x0)+(_0x4a6f3d[_0xf160('0x1b')]||0x0)+(_0x4a6f3d[_0xf160('0x1c')]||0x0);this[_0xf160('0x18')]=_0x4a6f3d['countnosuchnumberretry']||0x0;this[_0xf160('0x19')]=_0x4a6f3d[_0xf160('0x19')]||0x0;this[_0xf160('0x1a')]=_0x4a6f3d['countabandonedretry']||0x0;this[_0xf160('0x1b')]=_0x4a6f3d[_0xf160('0x1b')]||0x0;this[_0xf160('0x1c')]=_0x4a6f3d[_0xf160('0x1c')]||0x0;this[_0xf160('0x1d')]=_0x4a6f3d[_0xf160('0x1d')];this[_0xf160('0x1e')]=_0x4a6f3d['callbackuniqueid'];this[_0xf160('0x1f')]=_0x4a6f3d[_0xf160('0x1f')];this[_0xf160('0x20')]=_0x4a6f3d[_0xf160('0x20')];this['ContactId']=_0x4a6f3d[_0xf160('0x21')];this[_0xf160('0x22')]=_0x4a6f3d['ListId'];this['UserId']=_[_0xf160('0x3')](_0x4a6f3d[_0xf160('0x9')])?_0x4a6f3d[_0xf160('0x23')]:_0x4a6f3d['Agent']['id'];this[_0xf160('0x24')]=_0x4a6f3d[_0xf160('0x24')];this[_0xf160('0x25')]='';this[_0xf160('0x26')]='';}Action[_0xf160('0x27')][_0xf160('0x28')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0xf160('0x29')]);};module[_0xf160('0x2a')]=Action; \ No newline at end of file +var _0x1a85=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','moment','isNil','string','uniqueid','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x1a85,0x178));var _0x51a8=function(_0x55dd60,_0x479fb7){_0x55dd60=_0x55dd60-0x0;var _0x505abb=_0x1a85[_0x55dd60];return _0x505abb;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x51a8('0x0'));function checkNameSurname(_0x382cb8,_0x43e22a,_0x498466){var _0x562d89='';if(!_[_0x51a8('0x1')](_0x43e22a)&&_0x51a8('0x2')===typeof _0x43e22a){_0x562d89+=_0x43e22a;}if(!_[_0x51a8('0x1')](_0x498466)&&'string'===typeof _0x498466){_0x562d89+='\x20'+_0x498466;}if(_0x562d89!==''){return _0x562d89;}return _0x382cb8;}function Action(_0xaac0bf,_0x4b76a8,_0x2c1180,_0x5cf430,_0x331117){this[_0x51a8('0x3')]=_0x2c1180||undefined;this['idContact']=_0xaac0bf['id'];this[_0x51a8('0x4')]=_0x4b76a8['name'];this['type']=_0x4b76a8[_0x51a8('0x5')];this[_0x51a8('0x6')]=_0x51a8('0x4');this[_0x51a8('0x7')]=![];this[_0x51a8('0x8')]=_[_0x51a8('0x1')](_0xaac0bf[_0x51a8('0x9')])?undefined:_0xaac0bf[_0x51a8('0x9')][_0x51a8('0xa')];this[_0x51a8('0xb')]=this[_0x51a8('0x8')]?util[_0x51a8('0xc')](_0x51a8('0xd'),this[_0x51a8('0x8')]):_0x5cf430||undefined;this[_0x51a8('0xe')]=checkNameSurname(_0xaac0bf[_0x51a8('0xf')][_0x51a8('0x10')],_0xaac0bf['Contact'][_0x51a8('0x11')],_0xaac0bf[_0x51a8('0xf')][_0x51a8('0x12')]);this['active']=_0xaac0bf[_0x51a8('0x13')]||![];this['calleridnum']=_0xaac0bf[_0x51a8('0x10')];this[_0x51a8('0x14')]=_0xaac0bf[_0x51a8('0x14')];this[_0x51a8('0x15')]=_0xaac0bf[_0x51a8('0x15')]||0x0;this[_0x51a8('0x16')]=_0xaac0bf[_0x51a8('0x16')]||0x0;this['countnoanswerretry']=_0xaac0bf[_0x51a8('0x17')]||0x0;this[_0x51a8('0x18')]=(_0xaac0bf[_0x51a8('0x15')]||0x0)+(_0xaac0bf[_0x51a8('0x16')]||0x0)+(_0xaac0bf[_0x51a8('0x17')]||0x0)+(_0xaac0bf[_0x51a8('0x19')]||0x0)+(_0xaac0bf['countdropretry']||0x0)+(_0xaac0bf[_0x51a8('0x1a')]||0x0)+(_0xaac0bf[_0x51a8('0x1b')]||0x0)+(_0xaac0bf[_0x51a8('0x1c')]||0x0);this[_0x51a8('0x19')]=_0xaac0bf[_0x51a8('0x19')]||0x0;this[_0x51a8('0x1d')]=_0xaac0bf[_0x51a8('0x1d')]||0x0;this[_0x51a8('0x1a')]=_0xaac0bf['countabandonedretry']||0x0;this[_0x51a8('0x1b')]=_0xaac0bf['countmachineretry']||0x0;this[_0x51a8('0x1c')]=_0xaac0bf[_0x51a8('0x1c')]||0x0;this[_0x51a8('0x1e')]=_0xaac0bf[_0x51a8('0x1e')];this['callbackuniqueid']=_0xaac0bf[_0x51a8('0x1f')];this['callbackat']=_0xaac0bf['callbackat'];this[_0x51a8('0x20')]=_0xaac0bf['recallme'];this[_0x51a8('0x21')]=_0xaac0bf[_0x51a8('0x21')];this[_0x51a8('0x22')]=_0xaac0bf[_0x51a8('0x22')];this[_0x51a8('0x23')]=_[_0x51a8('0x1')](_0xaac0bf[_0x51a8('0x9')])?_0xaac0bf[_0x51a8('0x23')]:_0xaac0bf['Agent']['id'];this[_0x51a8('0x24')]=_0xaac0bf[_0x51a8('0x24')];this[_0x51a8('0x25')]='';this[_0x51a8('0x26')]='';}Action[_0x51a8('0x27')][_0x51a8('0x28')]=function(){return util[_0x51a8('0xc')](_0x51a8('0x29'),this[_0x51a8('0xe')],this[_0x51a8('0x2a')]);};module[_0x51a8('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index dc59b87..56af589 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 _0x31aa=['ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[action]','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','actioncountonusuch','idContact','swapAdditionalPhones','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[16]','Answer','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','outboundBusyCallsDay','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','countbusyretry','dialBusyMaxRetry','unlockAgent','incrementPreviewCounters','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','agentreject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','ANSWER','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','Queue:\x20','custom:agentcalled','called','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','disableContact','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','\x20Not\x20Active','execCall','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','getCallerId','callerid','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','addVariables','setXMDContactVariables','Contact','assign','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','unlockContact','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','preview','./rpcDb','./action','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','info','stringify','format','name','emit','voice_queue_presence:remove','originated','sendMessageOneNotActive','available','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pTalking','dialAnswer','pick','contactId','VoiceQueueId'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x31aa,0xec));var _0xa31a=function(_0x112185,_0x3b7fd0){_0x112185=_0x112185-0x0;var _0xeff470=_0x31aa[_0x112185];return _0xeff470;};'use strict';var util=require(_0xa31a('0x0'));var _=require(_0xa31a('0x1'));var uuid=require(_0xa31a('0x2'));var moment=require(_0xa31a('0x3'));var Redis=require(_0xa31a('0x4'));var config=require(_0xa31a('0x5'));var logger=require('../../../config/logger')(_0xa31a('0x6'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require('../ami');var rpcDb=require(_0xa31a('0x7'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xa31a('0x8'));var ut=require(_0xa31a('0x9'));var utils=require(_0xa31a('0xa'));config[_0xa31a('0xb')]=_[_0xa31a('0xc')](config[_0xa31a('0xb')],{'host':_0xa31a('0xd'),'port':0x18eb});var io=require(_0xa31a('0xe'))(new Redis(config[_0xa31a('0xb')]));var Sequence=function(){};Sequence[_0xa31a('0xf')][_0xa31a('0x10')]=function(_0x2164f5){this[_0xa31a('0x11')]=this['tail']?this[_0xa31a('0x11')][_0xa31a('0x12')](_0x2164f5):_0x2164f5();};function Preview(_0x581424){this[_0xa31a('0x13')]=new Sequence();this[_0xa31a('0x14')]=_0x581424[_0xa31a('0x15')];this[_0xa31a('0x16')]=_0x581424[_0xa31a('0x16')];this[_0xa31a('0x17')]={};this[_0xa31a('0x18')]=_0x581424[_0xa31a('0x18')];this[_0xa31a('0x19')]=0x0;ami['on'](_0xa31a('0x1a'),this[_0xa31a('0x1b')][_0xa31a('0x1c')](this));ami['on'](_0xa31a('0x1d'),this[_0xa31a('0x1e')][_0xa31a('0x1c')](this));ami['on'](_0xa31a('0x1f'),this[_0xa31a('0x20')][_0xa31a('0x1c')](this));ami['on'](_0xa31a('0x21'),this[_0xa31a('0x22')]['bind'](this));ami['on'](_0xa31a('0x23'),this[_0xa31a('0x24')][_0xa31a('0x1c')](this));ami['on'](_0xa31a('0x25'),this[_0xa31a('0x26')][_0xa31a('0x1c')](this));ami['on'](_0xa31a('0x27'),this[_0xa31a('0x28')][_0xa31a('0x1c')](this));ami['on'](_0xa31a('0x29'),this['syncBlindTransfer'][_0xa31a('0x1c')](this));this[_0xa31a('0x2a')](this[_0xa31a('0x14')]);}function emit(_0x2e54b3,_0x1e617b,_0x327b5b){io['to'](_0x2e54b3)['emit'](_0x1e617b,_0x327b5b);}function emitVoiceQueueChannelRemove(_0x7090c3){logger[_0xa31a('0x2b')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xa31a('0x2c')](_0x7090c3));emit(util[_0xa31a('0x2d')]('voice:queue:%s',_0x7090c3[_0xa31a('0x2e')]),'voice_queue_channel:remove',_0x7090c3);io[_0xa31a('0x2f')](_0xa31a('0x30'),_0x7090c3);}function notSendMessagesQueue(_0x5b0b07){if(_0x5b0b07['sendMessageOneNotActive']){if(_0x5b0b07[_0xa31a('0x31')]===0x0&&_0x5b0b07['pTalking']===0x0){_0x5b0b07[_0xa31a('0x32')]=![];_0x5b0b07[_0xa31a('0x33')]=0x0;_0x5b0b07[_0xa31a('0x34')]=0x0;_0x5b0b07['message']=utils[_0xa31a('0x35')][_0xa31a('0x36')];ut[_0xa31a('0x37')](_0xa31a('0x38'),_0x5b0b07[_0xa31a('0x2e')]+'\x20is\x20not\x20active');}else{_0x5b0b07[_0xa31a('0x39')]=utils[_0xa31a('0x35')][_0xa31a('0x3a')];ut[_0xa31a('0x37')](_0xa31a('0x38'),_0x5b0b07[_0xa31a('0x2e')]+'\x20is\x20deactivated');}}}Preview[_0xa31a('0xf')][_0xa31a('0x2a')]=function(){var _0x731aa0=this;setInterval(function(){_0x731aa0[_0xa31a('0x3b')]();},0x7cf);};Preview[_0xa31a('0xf')][_0xa31a('0x3b')]=function(){var _0x1306b7=this['campaignsPreview'];this[_0xa31a('0x19')]+=0x1;for(var _0x57d034 in _0x1306b7){if(_0x1306b7[_0xa31a('0x3c')](_0x57d034)&&(_0x1306b7[_0x57d034][_0xa31a('0x3d')]===_0xa31a('0x6')||_0x1306b7[_0x57d034]['dialMethod']===_0xa31a('0x3e'))&&_0x1306b7[_0x57d034][_0xa31a('0x3f')]==='outbound'){if(this[_0xa31a('0x19')]>0x7){this[_0xa31a('0x19')]=0x0;this['clearZombieChannels']();}}if(_0x1306b7[_0xa31a('0x3c')](_0x57d034)&&_0x1306b7[_0x57d034]['dialMethod']===_0xa31a('0x6')&&_0x1306b7[_0x57d034]['type']===_0xa31a('0x40')){if(_0x1306b7[_0x57d034][_0xa31a('0x41')]){this[_0xa31a('0x42')](_0x1306b7[_0x57d034]);if(_0x1306b7[_0x57d034][_0xa31a('0x43')])this[_0xa31a('0x44')](_0x1306b7[_0x57d034]);}else{notSendMessagesQueue(_0x1306b7[_0x57d034]);}}}};Preview['prototype'][_0xa31a('0x45')]=function(_0x5ba7af){var _0x506644=this;this[_0xa31a('0x13')][_0xa31a('0x10')](function(){if(!_[_0xa31a('0x46')](_0x506644[_0xa31a('0x17')][_0x5ba7af])){loggerAction[_0xa31a('0x2b')](_0xa31a('0x47'),_0x5ba7af,_0xa31a('0x48'),_0x506644[_0xa31a('0x17')][_0x5ba7af][_0xa31a('0x49')],_0xa31a('0x4a'),JSON[_0xa31a('0x2c')](_0x506644['campaignsPreview'][_0x506644[_0xa31a('0x17')][_0x5ba7af]['queue']][_0xa31a('0x31')]),_0xa31a('0x4b'),JSON[_0xa31a('0x2c')](_0x506644['campaignsPreview'][_0x506644[_0xa31a('0x17')][_0x5ba7af][_0xa31a('0x49')]][_0xa31a('0x4c')]),JSON[_0xa31a('0x2c')](_0x506644['actions'][_0x5ba7af][_0xa31a('0x4d')]),JSON[_0xa31a('0x2c')](_[_0xa31a('0x4e')](_0x506644['actions'][_0x5ba7af],[_0xa31a('0x4f'),'UserId',_0xa31a('0x50'),_0xa31a('0x51')])));return ami[_0xa31a('0x52')]({'action':_0xa31a('0x53'),'channel':_0x506644['actions'][_0x5ba7af][_0xa31a('0x54')]})[_0xa31a('0x55')](function(_0x530c2c){if(_0x530c2c['message']===_0xa31a('0x56')){setTimeout(function(){if(_0x506644[_0xa31a('0x17')][_0x5ba7af]){ut[_0xa31a('0x57')](_0x506644[_0xa31a('0x14')][_0x506644[_0xa31a('0x17')][_0x5ba7af][_0xa31a('0x49')]],_0xa31a('0x58'));if(_0x506644[_0xa31a('0x17')][_0x5ba7af][_0xa31a('0x4d')]===!![]){ut['decrementTalkink'](_0x506644[_0xa31a('0x14')][_0x506644['actions'][_0x5ba7af][_0xa31a('0x49')]],'[clearZombieChannel]');ut[_0xa31a('0x59')]('[Dialer][checkChannel][pTalking][Preview]'+_0x5ba7af,_0x506644[_0xa31a('0x17')][_0x5ba7af][_0xa31a('0x49')]);}ut[_0xa31a('0x59')]('[Dialer][checkChannel][Preview]'+_0x5ba7af,_0x506644['actions'][_0x5ba7af][_0xa31a('0x49')]);delete _0x506644[_0xa31a('0x17')][_0x5ba7af];}},0x2328);}});}});};Preview[_0xa31a('0xf')]['clearZombieChannels']=function(){var _0x4665e4=this;loggerAction[_0xa31a('0x2b')](_0xa31a('0x5a'),_['size'](this['actions']));for(var _0x26072e in this['actions']){if(_0x4665e4[_0xa31a('0x17')][_0xa31a('0x3c')](_0x26072e)){_0x4665e4['clearZombieChannel'](_0x26072e);}}};Preview['prototype'][_0xa31a('0x44')]=function(_0x13f59d){var _0x49001e=this;rpcDb[_0xa31a('0x5b')](_0x13f59d['id'],ut[_0xa31a('0x5c')](this[_0xa31a('0x18')]))[_0xa31a('0x5d')](function(_0x520334){if(!_[_0xa31a('0x46')](_0x520334)){for(var _0x176716=0x0;_0x176716<_0x520334[_0xa31a('0x5e')];_0x176716+=0x1){if(ut[_0xa31a('0x5f')](_0x520334[_0x176716]['scheduledat'])<_0x13f59d[_0xa31a('0x60')]*0x3c){if(_0x520334[_0x176716][_0xa31a('0x61')]&&!_0x520334[_0x176716]['Agent']['voicePause']){_0x49001e[_0xa31a('0x62')](_0x520334[_0x176716]['id'])[_0xa31a('0x5d')](ut[_0xa31a('0x63')](_0xa31a('0x64')))[_0xa31a('0x55')](ut[_0xa31a('0x63')](_0xa31a('0x64')));}else{rpcDb['disableContact'](_0x520334[_0x176716]['id']);}}else{var _0x59a8b5=new Action(_0x520334[_0x176716],_0x13f59d);_0x59a8b5['starttime']=moment()[_0xa31a('0x2d')](_0xa31a('0x65'));_0x13f59d[_0xa31a('0x66')]+=0x1;ut[_0xa31a('0x67')](_0x59a8b5,0x17,_0xa31a('0x68'));if(_0x13f59d[_0xa31a('0x69')]){rpcDb[_0xa31a('0x6a')](ut[_0xa31a('0x6b')](_0x520334[_0x176716]));rpcDb[_0xa31a('0x6c')](_0x59a8b5,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xa31a('0x67')](_0x59a8b5,0x16,_0xa31a('0x6d'));rpcDb[_0xa31a('0x6c')](_0x59a8b5,'[HistoryRecallClose]');rpcDb[_0xa31a('0x6e')](_0x59a8b5,_0xa31a('0x6f'));}}}}})[_0xa31a('0x55')](ut[_0xa31a('0x63')](_0xa31a('0x70')));};Preview[_0xa31a('0xf')][_0xa31a('0x42')]=function(_0x40aa4f){_0x40aa4f[_0xa31a('0x32')]=!![];if(ut[_0xa31a('0x71')](_0x40aa4f['loggedIn'])){_0x40aa4f[_0xa31a('0x39')]=utils[_0xa31a('0x35')][_0xa31a('0x72')];}else if(!ut[_0xa31a('0x73')](_0x40aa4f['dialActive'])){_0x40aa4f[_0xa31a('0x39')]=utils['CAMPAIGN_STATUS'][_0xa31a('0x36')];}else if(!this[_0xa31a('0x74')](_0x40aa4f[_0xa31a('0x75')])){if(!this[_0xa31a('0x74')](_0x40aa4f[_0xa31a('0x76')])){_0x40aa4f['message']=utils[_0xa31a('0x35')][_0xa31a('0x77')];}else{_0x40aa4f[_0xa31a('0x39')]=utils[_0xa31a('0x35')]['ACTIVE'];}}else{_0x40aa4f[_0xa31a('0x39')]=utils[_0xa31a('0x35')]['ACTIVE'];}};Preview[_0xa31a('0xf')][_0xa31a('0x78')]=function(_0x3aa241,_0x9d4f59,_0x4c9c8b){var _0x281129=this;var _0x13e755=this[_0xa31a('0x17')][_0x9d4f59];var _0x53a505=this['campaignsPreview'][_0x13e755[_0xa31a('0x49')]];var _0x24c4fe;var _0xe48c0d=![];var _0x37d1ee=0x2;var _0x55a1a8=0x3;if(_0x53a505){switch(_0x4c9c8b){case'1':_0x53a505[_0xa31a('0x79')]+=0x1;_0x13e755[_0xa31a('0x7a')]+=0x1;_0x13e755[_0xa31a('0x7b')]=ut[_0xa31a('0x7c')](_0x13e755);ut[_0xa31a('0x67')](_0x13e755,0x0,_0xa31a('0x7d'));ami[_0xa31a('0x2f')]('custom:agentnosuchnumber',ut[_0xa31a('0x7e')](_0x13e755,_0xa31a('0x7f')));rpcDb[_0xa31a('0x6c')](_0x13e755,_0xa31a('0x80'));_0x281129['verifyAdditionalPhones'](_0x13e755,'0',_0x53a505)[_0xa31a('0x5d')](function(_0x1f958){_0xe48c0d=_0x1f958[_0xa31a('0x81')]==0x1;_0x37d1ee=_0x53a505[_0xa31a('0x82')];_0x55a1a8=_0x53a505[_0xa31a('0x83')];if(!_0xe48c0d){if(ut[_0xa31a('0x7c')](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut[_0xa31a('0x85')](_0x13e755,0xf,_0xa31a('0x86'));rpcDb[_0xa31a('0x6e')](_0x24c4fe,_0xa31a('0x87'));}else{if(_0x13e755[_0xa31a('0x7a')]>=_0x53a505['dialNoSuchNumberMaxRetry']){rpcDb[_0xa31a('0x6e')](_0x13e755,_0xa31a('0x87'));}else{rpcDb[_0xa31a('0x88')](ut[_0xa31a('0x89')](_0x13e755,_0xa31a('0x7a'),_0x53a505['dialNoSuchNumberRetryFrequency']),_0x13e755['unlockAgent'],_0x13e755[_0xa31a('0x8a')]);}}delete this[_0xa31a('0x17')][_0x3aa241['linkedid']];}else{_0x13e755[_0xa31a('0x7a')]++;logger['info'](_0xa31a('0x8b'),_0x13e755[_0xa31a('0x7a')]);logger['info']('id',_0x13e755[_0xa31a('0x8c')]);_0x281129['incrementPreviewCounters']({'id':_0x13e755[_0xa31a('0x8c')],'field':{'countnosuchnumberretry':_0x13e755['countnosuchnumberretry']}})['then'](function(){_0x281129[_0xa31a('0x8d')](_0x13e755,_0x37d1ee,_0x55a1a8)[_0xa31a('0x5d')](function(){});});}});break;case'ANSWER':var _0x18ec39=moment()[_0xa31a('0x2d')](_0xa31a('0x65'));_0x13e755[_0xa31a('0x8e')]=_0x18ec39;_0x13e755[_0xa31a('0x8f')]=_0x18ec39;_0x13e755[_0xa31a('0x4d')]=!![];_0x53a505[_0xa31a('0x4c')]+=0x1;logger[_0xa31a('0x2b')](_0xa31a('0x90'),_0x13e755['uniqueid'],_0xa31a('0x91'),_0x53a505[_0xa31a('0x2e')],'pTalking:\x20',_0x53a505[_0xa31a('0x4c')]);ami[_0xa31a('0x2f')](_0xa31a('0x92'),ut[_0xa31a('0x7e')](_0x13e755,_0xa31a('0x93'),this['campaignsPreview'][_0x13e755[_0xa31a('0x49')]]));if(_0x53a505[_0xa31a('0x94')]){ami[_0xa31a('0x2f')](_0xa31a('0x95'),ut[_0xa31a('0x96')](_0x13e755));}break;case'16':ami[_0xa31a('0x2f')]('custom:agentcomplete',ut[_0xa31a('0x7e')](_0x13e755,_0xa31a('0x97'),this[_0xa31a('0x14')][_0x13e755[_0xa31a('0x49')]]));emitVoiceQueueChannelRemove(ut[_0xa31a('0x7e')](_0x13e755,_0xa31a('0x97')));_0x53a505[_0xa31a('0x98')]+=0x1;_0x53a505[_0xa31a('0x99')]+=0x1;_0x53a505[_0xa31a('0x9a')]+=0x1;ut[_0xa31a('0x9b')](_0x53a505,_0xa31a('0x9c'));_0x13e755[_0xa31a('0x7b')]=ut['totalGlobal'](_0x13e755);ut['logCustomer'](_0x13e755,0x4,_0xa31a('0x9d'));rpcDb[_0xa31a('0x6c')](_0x13e755,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xa31a('0x6e')](_0x13e755,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xa31a('0x9e')](_0x13e755);_0x53a505[_0xa31a('0x9f')]+=_0x13e755[_0xa31a('0xa0')];_0x53a505[_0xa31a('0xa1')]+=_0x13e755[_0xa31a('0xa0')];logger[_0xa31a('0x2b')](_0xa31a('0xa2'),_0x13e755['uniqueid'],'\x20Queue',_0x53a505['name'],_0xa31a('0x4b'),_0x53a505['pTalking']);delete this[_0xa31a('0x17')][_0x3aa241[_0xa31a('0xa3')]];break;case _0xa31a('0xa4'):_0x53a505[_0xa31a('0xa5')]+=0x1;_0x13e755['countbusyretry']+=0x1;_0x13e755['countglobal']=ut[_0xa31a('0x7c')](_0x13e755);ut['logCustomer'](_0x13e755,0x5,'Busy');_0x37d1ee=_0x53a505[_0xa31a('0xa6')];_0x55a1a8=_0x53a505[_0xa31a('0x83')];ami[_0xa31a('0x2f')]('custom:agentbusy',ut[_0xa31a('0x7e')](_0x13e755,_0xa31a('0xa7')));rpcDb['createCustomerHistory'](_0x13e755,_0xa31a('0xa8'));_0x281129[_0xa31a('0xa9')](_0x13e755,'5',_0x53a505)['then'](function(_0x577455){_0xe48c0d=_0x577455[_0xa31a('0x81')]==0x1;if(!_0xe48c0d){if(ut[_0xa31a('0x7c')](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut[_0xa31a('0x85')](_0x13e755,0xf,_0xa31a('0x86'));rpcDb[_0xa31a('0x6e')](_0x24c4fe,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x13e755[_0xa31a('0xaa')]>=_0x53a505[_0xa31a('0xab')]){rpcDb[_0xa31a('0x6e')](_0x13e755,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0xa31a('0x89')](_0x13e755,_0xa31a('0xaa'),_0x53a505['dialBusyRetryFrequency']),_0x13e755[_0xa31a('0xac')],_0x13e755['activeContact']);}}}else{_0x13e755[_0xa31a('0xaa')]++;_0x281129[_0xa31a('0xad')]({'id':_0x13e755[_0xa31a('0x8c')],'field':{'countbusyretry':_0x13e755[_0xa31a('0xaa')]}})[_0xa31a('0x5d')](function(){_0x281129[_0xa31a('0x8d')](_0x13e755,_0x37d1ee,_0x55a1a8)[_0xa31a('0x5d')](function(){});});}});break;case'NOANSWER':_0x53a505['outboundNoAnswerCallsDay']+=0x1;_0x13e755['countnoanswerretry']+=0x1;_0x13e755[_0xa31a('0x7b')]=ut['totalGlobal'](_0x13e755);ut['logCustomer'](_0x13e755,0x3,_0xa31a('0xae'));_0x37d1ee=_0x53a505[_0xa31a('0xaf')];_0x55a1a8=_0x53a505[_0xa31a('0x83')];var _0x898fa6=ut[_0xa31a('0xb0')](_0x13e755,_0x53a505);ami['emit'](_0xa31a('0xb1'),_0x898fa6);rpcDb['createCustomerHistory'](_0x13e755,'[callProgressDetectingCustomer][logNoAnswer]');_0x281129[_0xa31a('0xa9')](_0x13e755,'3',_0x53a505)[_0xa31a('0x5d')](function(_0x7a47e5){_0xe48c0d=_0x7a47e5['additional']==0x1;if(!_0xe48c0d){if(ut[_0xa31a('0x7c')](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut['cloneAction'](_0x13e755,0xf,'Global');rpcDb[_0xa31a('0x6e')](_0x24c4fe,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x13e755[_0xa31a('0xb2')]>=_0x53a505[_0xa31a('0xb3')]){rpcDb[_0xa31a('0x6e')](_0x13e755,_0xa31a('0xb4'));}else{rpcDb['rescheduleContact'](ut[_0xa31a('0x89')](_0x13e755,_0xa31a('0xb2'),_0x53a505[_0xa31a('0xaf')]),_0x13e755[_0xa31a('0xac')],_0x13e755[_0xa31a('0x8a')]);}}}else{_0x13e755[_0xa31a('0xb2')]++;_0x281129[_0xa31a('0xad')]({'id':_0x13e755[_0xa31a('0x8c')],'field':{'countnoanswerretry':_0x13e755[_0xa31a('0xb2')]}})[_0xa31a('0x5d')](function(){_0x281129['swapAdditionalPhones'](_0x13e755,_0x37d1ee,_0x55a1a8)['then'](function(){});});}});break;case'CONGESTION':_0x53a505['outboundCongestionCallsDay']+=0x1;_0x13e755['countcongestionretry']+=0x1;_0x13e755[_0xa31a('0x7b')]=ut[_0xa31a('0x7c')](_0x13e755);ut['logCustomer'](_0x13e755,0x8,'Congestion');_0x37d1ee=_0x53a505[_0xa31a('0xb5')];_0x55a1a8=_0x53a505['callAdditionalPhoneAfterMin'];ami[_0xa31a('0x2f')](_0xa31a('0xb6'),ut[_0xa31a('0x7e')](_0x13e755,_0xa31a('0xb7')));rpcDb[_0xa31a('0x6c')](_0x13e755,_0xa31a('0xb8'));_0x281129['verifyAdditionalPhones'](_0x13e755,'8',_0x53a505)[_0xa31a('0x5d')](function(_0x990711){_0xe48c0d=_0x990711[_0xa31a('0x81')]==0x1;if(!_0xe48c0d){if(ut['totalGlobal'](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut[_0xa31a('0x85')](_0x13e755,0xf,_0xa31a('0x86'));rpcDb[_0xa31a('0x6e')](_0x24c4fe,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x13e755[_0xa31a('0xb9')]>=_0x53a505[_0xa31a('0xba')]){rpcDb[_0xa31a('0x6e')](_0x13e755,_0xa31a('0xb8'));}else{rpcDb[_0xa31a('0x88')](ut[_0xa31a('0x89')](_0x13e755,'countcongestionretry',_0x53a505[_0xa31a('0xa6')]),_0x13e755['unlockAgent'],_0x13e755[_0xa31a('0x8a')]);}}}else{_0x13e755[_0xa31a('0xb9')]++;_0x281129[_0xa31a('0xad')]({'id':_0x13e755['idContact'],'field':{'countcongestionretry':_0x13e755[_0xa31a('0xb9')]}})[_0xa31a('0x5d')](function(){_0x281129['swapAdditionalPhones'](_0x13e755,_0x37d1ee,_0x55a1a8)[_0xa31a('0x5d')](function(){});});}});break;case _0xa31a('0xbb'):_0x53a505[_0xa31a('0xbc')]+=0x1;_0x13e755[_0xa31a('0xbd')]+=0x1;_0x13e755['countglobal']=ut['totalGlobal'](_0x13e755);ut[_0xa31a('0x67')](_0x13e755,0x14,_0xa31a('0xbe'));_0x37d1ee=_0x53a505[_0xa31a('0xbf')];_0x55a1a8=_0x53a505[_0xa31a('0x83')];ami[_0xa31a('0x2f')]('custom:agentreject',ut['buildObj'](_0x13e755,_0xa31a('0xc0')));rpcDb[_0xa31a('0x6c')](_0x13e755,'[syncHangupRequest][logAgentReject]');_0x281129[_0xa31a('0xa9')](_0x13e755,'20',_0x53a505)[_0xa31a('0x5d')](function(_0x2f88f0){_0xe48c0d=_0x2f88f0[_0xa31a('0x81')]==0x1;if(!_0xe48c0d){if(ut[_0xa31a('0x7c')](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut['cloneAction'](_0x13e755,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x24c4fe,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x13e755[_0xa31a('0xbd')]>=_0x53a505[_0xa31a('0xc1')]){rpcDb[_0xa31a('0x6e')](_0x13e755,_0xa31a('0xc2'));}else{rpcDb[_0xa31a('0x88')](ut[_0xa31a('0x89')](_0x13e755,_0xa31a('0xbd'),_0x53a505['dialAgentRejectRetryFrequency']),_0x13e755[_0xa31a('0xac')],_0x13e755[_0xa31a('0x8a')]);}}}else{_0x13e755[_0xa31a('0xb2')]++;_0x281129['incrementPreviewCounters']({'id':_0x13e755[_0xa31a('0x8c')],'field':{'countnoanswerretry':_0x13e755[_0xa31a('0xb2')]}})[_0xa31a('0x5d')](function(){_0x281129[_0xa31a('0x8d')](_0x13e755,_0x37d1ee,_0x55a1a8)[_0xa31a('0x5d')](function(){});});}});break;case'ABANDONED':_0x53a505[_0xa31a('0xc3')]+=0x1;_0x13e755[_0xa31a('0xc4')]+=0x1;_0x13e755[_0xa31a('0x7b')]=ut[_0xa31a('0x7c')](_0x13e755);ut[_0xa31a('0x67')](_0x13e755,0xb,_0xa31a('0xc5'));rpcDb[_0xa31a('0x6c')](_0x13e755,'[callProgressDetectingCustomer][logAbandoned]');_0x281129[_0xa31a('0xa9')](_0x13e755,'11',_0x53a505)['then'](function(_0x3f2a42){_0xe48c0d=_0x3f2a42['additional']==0x1;if(!_0xe48c0d){if(ut['totalGlobal'](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut[_0xa31a('0x85')](_0x13e755,0xf,_0xa31a('0x86'));rpcDb[_0xa31a('0x6e')](_0x24c4fe,_0xa31a('0xc6'));}else{if(_0x13e755[_0xa31a('0xc7')]>=_0x53a505['dialAbandonedMaxRety']){rpcDb[_0xa31a('0x6e')](_0x13e755,_0xa31a('0xc6'));}else{rpcDb['rescheduleContact'](ut[_0xa31a('0x89')](_0x13e755,'countabandonedretry',_0x53a505[_0xa31a('0xc8')]),_0x13e755[_0xa31a('0xac')],_0x13e755[_0xa31a('0x8a')]);}}}else{_0x13e755[_0xa31a('0xb2')]++;_0x281129[_0xa31a('0xad')]({'id':_0x13e755[_0xa31a('0x8c')],'field':{'countnoanswerretry':_0x13e755[_0xa31a('0xb2')]}})[_0xa31a('0x5d')](function(){_0x281129[_0xa31a('0x8d')](_0x13e755,_0x37d1ee,_0x55a1a8)[_0xa31a('0x5d')](function(){});});}});break;case'18':_0x53a505[_0xa31a('0xc9')]+=0x1;_0x13e755[_0xa31a('0xca')]+=0x1;_0x13e755['countglobal']=ut[_0xa31a('0x7c')](_0x13e755);ut['logCustomer'](_0x13e755,0x12,_0x3aa241['cause-txt']||_0x3aa241[_0xa31a('0xcb')]);ami[_0xa31a('0x2f')]('custom:amd',ut['buildObj'](_0x13e755,_0xa31a('0xcc')));rpcDb[_0xa31a('0x6c')](_0x13e755,_0xa31a('0xcd'));_0x281129['verifyAdditionalPhones'](_0x13e755,'18',_0x53a505)['then'](function(_0x5db892){_0xe48c0d=_0x5db892['additional']==0x1;if(!_0xe48c0d){if(ut[_0xa31a('0x7c')](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut[_0xa31a('0x85')](_0x13e755,0x12,_0xa31a('0x86'));rpcDb[_0xa31a('0x6e')](_0x24c4fe,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x13e755,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x13e755[_0xa31a('0xb2')]++;_0x281129['incrementPreviewCounters']({'id':_0x13e755[_0xa31a('0x8c')],'field':{'countnoanswerretry':_0x13e755[_0xa31a('0xb2')]}})[_0xa31a('0x5d')](function(){_0x281129[_0xa31a('0x8d')](_0x13e755,_0x37d1ee,_0x55a1a8)[_0xa31a('0x5d')](function(){});});}});delete this[_0xa31a('0x17')][_0x3aa241[_0xa31a('0xa3')]];break;case'19':_0x53a505[_0xa31a('0xc9')]+=0x1;_0x13e755['countglobal']=ut[_0xa31a('0x7c')](_0x13e755);ut[_0xa31a('0x67')](_0x13e755,0x13,_0x3aa241[_0xa31a('0xce')]||_0x3aa241[_0xa31a('0xcb')]);ami['emit'](_0xa31a('0xcf'),ut[_0xa31a('0x7e')](_0x13e755,'amd'));rpcDb[_0xa31a('0x6c')](_0x13e755,_0xa31a('0xd0'));_0x281129['verifyAdditionalPhones'](_0x13e755,'18',_0x53a505)[_0xa31a('0x5d')](function(_0x34b534){_0xe48c0d=_0x34b534[_0xa31a('0x81')]==0x1;if(!_0xe48c0d){if(ut[_0xa31a('0x7c')](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut[_0xa31a('0x85')](_0x13e755,0xf,_0xa31a('0x86'));rpcDb['createCustomerFinal'](_0x24c4fe,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xa31a('0x6e')](_0x13e755,'[callProgressDetectingCustomer][machine]');}}else{_0x13e755['countnoanswerretry']++;_0x281129['incrementPreviewCounters']({'id':_0x13e755[_0xa31a('0x8c')],'field':{'countnoanswerretry':_0x13e755['countnoanswerretry']}})[_0xa31a('0x5d')](function(){_0x281129[_0xa31a('0x8d')](_0x13e755,_0x37d1ee,_0x55a1a8)['then'](function(){});});}});delete this[_0xa31a('0x17')][_0x3aa241[_0xa31a('0xa3')]];break;default:if(_0x13e755[_0xa31a('0x4d')]){ut[_0xa31a('0x9b')](_0x53a505,'[default]');ut[_0xa31a('0x59')](_0xa31a('0xd1')+_0x53a505[_0xa31a('0x2e')],_0x3aa241);}_0x53a505[_0xa31a('0xc9')]+=0x1;_0x13e755[_0xa31a('0x7b')]=ut[_0xa31a('0x7c')](_0x13e755);ut['logCustomer'](_0x13e755,0xc,_0x3aa241['cause-txt']||_0x3aa241[_0xa31a('0xcb')]);_0x37d1ee=_0x53a505[_0xa31a('0xbf')];_0x55a1a8=_0x53a505[_0xa31a('0x83')];rpcDb['createCustomerHistory'](_0x13e755,_0xa31a('0xd2'));_0x281129[_0xa31a('0xa9')](_0x13e755,'20',_0x53a505)[_0xa31a('0x5d')](function(_0x208810){_0xe48c0d=_0x208810[_0xa31a('0x81')]==0x1;if(!_0xe48c0d){if(ut[_0xa31a('0x7c')](_0x13e755)>=_0x53a505[_0xa31a('0x84')]){_0x24c4fe=ut[_0xa31a('0x85')](_0x13e755,0xf,'Global');rpcDb['createCustomerFinal'](_0x24c4fe,_0xa31a('0xd3'));}else{rpcDb['createCustomerFinal'](_0x13e755,_0xa31a('0xd3'));}delete this[_0xa31a('0x17')][_0x3aa241[_0xa31a('0xa3')]];}else{_0x281129[_0xa31a('0x8d')](_0x13e755,_0x37d1ee,_0x55a1a8)['then'](function(){});}});}if(!(_0x13e755[_0xa31a('0x4d')]&&_0x4c9c8b==='16')){ut['updateOriginated'](_0x53a505,'[callProgressDetectingCustomer]');logger['info'](_0xa31a('0xd4'),_0x13e755[_0xa31a('0xd5')],'\x20Queue',_0x53a505[_0xa31a('0x2e')],_0xa31a('0x4a'),_0x53a505[_0xa31a('0x31')]);}if(_0x4c9c8b!==_0xa31a('0xd6')){delete this[_0xa31a('0x17')][_0x3aa241[_0xa31a('0xa3')]];delete this[_0xa31a('0x17')][_0x3aa241[_0xa31a('0xd7')]];}_0x53a505[_0xa31a('0xd8')]=!![];}};Preview[_0xa31a('0xf')][_0xa31a('0xd9')]=function(_0x87db67,_0x48943b,_0x3ecb52){if(_[_0xa31a('0xda')](_0x48943b)&&_0xa31a('0xdb')!==typeof _0x48943b){return;}if(_[_0xa31a('0xda')](_0x3ecb52)&&_0xa31a('0xdb')!==typeof _0x3ecb52){return;}switch(_0x3ecb52[_0xa31a('0xdc')]){case'0':ut['logAgent'](_0x87db67,0x0,'NoSuchNumber');rpcDb[_0xa31a('0xdd')](_0x87db67,_0xa31a('0xde'));break;case'3':ut[_0xa31a('0xdf')](_0x87db67,0x3,_0xa31a('0xae'));rpcDb[_0xa31a('0xdd')](_0x87db67,_0xa31a('0xe0'));break;case'5':ut[_0xa31a('0xdf')](_0x87db67,0x5,_0xa31a('0xe1'));rpcDb[_0xa31a('0xdd')](_0x87db67,_0xa31a('0xe2'));break;case'8':ut[_0xa31a('0xdf')](_0x87db67,0x8,_0xa31a('0xe3'));rpcDb[_0xa31a('0xdd')](_0x87db67,_0xa31a('0xe4'));break;case'22':ut[_0xa31a('0xdf')](_0x87db67,0x16,_0xa31a('0xe5'));rpcDb[_0xa31a('0xdd')](_0x87db67,_0xa31a('0xe6'));break;default:ut[_0xa31a('0xdf')](_0x87db67,0xc,_0x3ecb52[_0xa31a('0xdc')]);rpcDb['createAgentHistory'](_0x87db67,_0xa31a('0xe4'));}ut[_0xa31a('0x57')](_0x48943b,_0xa31a('0xe7'));logger[_0xa31a('0x2b')](_0xa31a('0xe8'),_0x87db67[_0xa31a('0xd5')],_0xa31a('0x91'),_0x48943b[_0xa31a('0x2e')],_0xa31a('0x4a'),_0x48943b[_0xa31a('0x31')]);delete this[_0xa31a('0x17')][_0x87db67['uniqueid']];};Preview[_0xa31a('0xf')][_0xa31a('0xa9')]=function(_0x4fa541,_0x573557,_0x508215){return cmHopperAdditionalPhone[_0xa31a('0xa9')](_0x4fa541,_0x573557,_0x508215)[_0xa31a('0x55')](logger[_0xa31a('0x2b')](_0xa31a('0xe9')));};Preview[_0xa31a('0xf')][_0xa31a('0x8d')]=function(_0x377932,_0x4f10cc,_0x48e5f7){return cmHopperAdditionalPhone[_0xa31a('0x8d')](_0x377932,_0x4f10cc,_0x48e5f7)['catch'](logger[_0xa31a('0x2b')](_0xa31a('0xea')));};Preview['prototype']['incrementPreviewCounters']=function(_0x281ae5){return Promise[_0xa31a('0xeb')]()[_0xa31a('0x5d')](cmHopperAdditionalPhone[_0xa31a('0xad')](_0x281ae5))['catch'](logger['info'](_0xa31a('0xec')));};Preview[_0xa31a('0xf')][_0xa31a('0xed')]=function(_0x273dea,_0xa4a065,_0x128b54,_0x5f5659,_0x383080){var _0x3e3c8a=this;return new Promise(function(_0x2173a1,_0x3e7c48){if(_[_0xa31a('0x46')](_0xa4a065)||_['isNil'](_0xa4a065['Contact'])||_['isNil'](_0xa4a065[_0xa31a('0xee')])||_[_0xa31a('0x46')](_0xa4a065['VoiceQueueId'])){_0x3e7c48(ut[_0xa31a('0x39')](_0xa31a('0xef'),_0x5f5659,_0x383080));return;}var _0x3d3576=uuid['v4']();var _0x2cae1c=_0x3e3c8a[_0xa31a('0x14')][_0xa4a065['Queue'][_0xa31a('0x2e')]];var _0x39839a=_0x128b54?_0x3e3c8a['agents'][_0x128b54]['id']:undefined;_0x3e3c8a['actions'][_0x3d3576]=new Action(_0xa4a065,_0x2cae1c,_0x3d3576,_0x128b54,_0x39839a);var _0x423574=_0x3e3c8a[_0xa31a('0x17')][_0x3d3576];_0x423574[_0xa31a('0xac')]=_0x5f5659;_0x423574[_0xa31a('0x8a')]=_0x383080;_0x423574[_0xa31a('0xf0')]=_0x128b54;if(_[_0xa31a('0xf1')](_0x273dea)){_0x3e3c8a['execCall'](_0x423574,_0x2cae1c,_0xa4a065,_0x128b54)[_0xa31a('0x5d')](function(_0x3a614e){logger[_0xa31a('0x2b')]('[Preview][execCall][success]',_0xa31a('0xf2')+_0x423574[_0xa31a('0x49')]+'\x20IdHopper:\x20'+_0x423574[_0xa31a('0x8c')],JSON['stringify'](_0x3a614e));ami['emit'](_0xa31a('0xf3'),ut[_0xa31a('0x7e')](_0x423574,_0xa31a('0xf4'),_0x3e3c8a[_0xa31a('0x14')][_0x423574[_0xa31a('0x49')]]));_0x2173a1(ut[_0xa31a('0x39')]('Calling'));})[_0xa31a('0x55')](function(_0xce2761){ut[_0xa31a('0x37')]('[Preview][execCall][failure]',_0xce2761);_0x3e7c48(ut['message'](_0xa31a('0xf5'),_0x5f5659,_0x383080));});}else{_0x2cae1c[_0xa31a('0xf6')]+=0x1;ut[_0xa31a('0xf7')](_0x423574);rpcDb[_0xa31a('0xf8')](_0x423574,_0xa31a('0xf9'));delete _0x3e3c8a[_0xa31a('0x17')][_0x3d3576];_0x3e7c48(ut[_0xa31a('0x39')](_0xa31a('0xfa'),_0x5f5659,_0x383080));}});};Preview[_0xa31a('0xf')][_0xa31a('0x74')]=function(_0x157844){return!_[_0xa31a('0x46')](_0x157844)&&!_[_0xa31a('0x46')](_0x157844['name'])&&!_[_0xa31a('0x46')](_0x157844[_0xa31a('0xfb')])&&_0x157844[_0xa31a('0xfb')]&&!_[_0xa31a('0x46')](this['trunks'][util[_0xa31a('0x2d')]('SIP/%s',_0x157844['name'])])&&!_[_0xa31a('0x46')](this[_0xa31a('0x16')][util[_0xa31a('0x2d')](_0xa31a('0xfc'),_0x157844[_0xa31a('0x2e')])]['status'])&&(this[_0xa31a('0x16')][util[_0xa31a('0x2d')](_0xa31a('0xfc'),_0x157844[_0xa31a('0x2e')])]['status']==='reachable'||this[_0xa31a('0x16')][util[_0xa31a('0x2d')]('SIP/%s',_0x157844[_0xa31a('0x2e')])][_0xa31a('0x53')]===_0xa31a('0xfd'));};Preview[_0xa31a('0xf')][_0xa31a('0x62')]=function(_0x350bc4,_0xec150d){return this[_0xa31a('0xfe')](_0x350bc4,_0xec150d)['then'](function(_0x4ef5b2){return _['pick'](_0x4ef5b2,[_0xa31a('0x39')]);})['catch'](function(_0xdc5aa7){if(_0xdc5aa7[_0xa31a('0xff')]){rpcDb['unlockContact'](_0x350bc4);}if(_0xdc5aa7[_0xa31a('0xfb')]){rpcDb[_0xa31a('0x100')](_0x350bc4);}throw _[_0xa31a('0x4e')](_0xdc5aa7,[_0xa31a('0x39')]);});};Preview[_0xa31a('0xf')]['execRun']=function(_0x126995,_0x1ea794){var _0x1683dc=this;var _0x322ce4,_0x3cfdb7;return rpcDb['getContactPreview'](_0x126995)['then'](function(_0x5aa8b8){if(!_[_0xa31a('0x46')](_0x5aa8b8[0x0])){_0x3cfdb7=_0x5aa8b8[0x0]['recallme']?![]:!![];_0x322ce4=_0x5aa8b8[0x0][_0xa31a('0x101')]?!![]:![];_0x322ce4=_0x1ea794?!![]:_0x322ce4;}var _0x1e24b0=_0x1683dc[_0xa31a('0x102')](_0x5aa8b8);if(_0x1e24b0[_0xa31a('0x103')]){rpcDb[_0xa31a('0x104')](_[_0xa31a('0x4e')](_0x5aa8b8[0x0],['VoiceQueueId','phone']))[_0xa31a('0x5d')](function(_0x3aafbd){_0x1683dc['checkInBlack'](_0x3aafbd,_0x5aa8b8[0x0],_0x1ea794,_0x3cfdb7,_0x322ce4)['then'](function(_0x10b3db){return _0x10b3db;})[_0xa31a('0x55')](function(_0x2fee67){throw _0x2fee67;});})[_0xa31a('0x55')](function(_0x32e128){ut[_0xa31a('0x37')](_0xa31a('0x105'),_0x32e128);throw ut[_0xa31a('0x39')](_0xa31a('0x106'),_0x3cfdb7,_0x322ce4);});}else{throw ut[_0xa31a('0x39')](_0x1e24b0['message'],_0x3cfdb7,_0x322ce4);}})[_0xa31a('0x55')](function(_0x52da73){ut['logger'](_0xa31a('0x107'),_0x52da73);throw ut['message'](_0xa31a('0x106'),![],!![]);});};Preview[_0xa31a('0xf')]['validateContact']=function(_0x39f64a){if(_[_0xa31a('0x46')](_0x39f64a)||_['isEmpty'](_0x39f64a)||!_[_0xa31a('0x46')](_0x39f64a[0x0][_0xa31a('0x61')])&&_[_0xa31a('0x46')](_0x39f64a[0x0]['Agent'][_0xa31a('0x2e')])){ut[_0xa31a('0x37')](_0xa31a('0x108'),_0x39f64a);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x195a14=this[_0xa31a('0x14')][_0x39f64a[0x0][_0xa31a('0x48')]['name']];_0x195a14[_0xa31a('0x39')]=utils[_0xa31a('0x35')]['ACTIVE'];if(_['isNil'](_0x195a14)){ut[_0xa31a('0x37')](_0xa31a('0x109'),_0x195a14);return{'isValid':![],'message':_0xa31a('0x10a')};}if(!this[_0xa31a('0x74')](_0x195a14['Trunk'])){ut[_0xa31a('0x37')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20'+_0x195a14[_0xa31a('0x2e')]+_0xa31a('0x10b'));if(!this[_0xa31a('0x74')](_0x195a14[_0xa31a('0x76')])){ut[_0xa31a('0x37')](_0xa31a('0x10c'),_0x195a14[_0xa31a('0x2e')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xa31a('0x73')](_0x195a14['dialActive'])){ut['logger'](_0xa31a('0x10d'),_0x195a14[_0xa31a('0x2e')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xa31a('0x10e')+_0x195a14['name']+_0xa31a('0x10f')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xa31a('0xf')][_0xa31a('0x110')]=function(_0x2e2cc5,_0x4966a1,_0x5bf881,_0x553605){var _0x340d95=this;return new Promise(function(_0x358261,_0x2a3d68){var _0x12313f=_0x2e2cc5['uniqueid'];var _0x33c29a=_0x340d95[_0xa31a('0x74')](_0x4966a1['Trunk'])?util['format'](_0xa31a('0x111'),_0x4966a1[_0xa31a('0x75')][_0xa31a('0x2e')],_['isNil'](_0x4966a1[_0xa31a('0x112')])?'':_0x4966a1['dialPrefix'][_0xa31a('0x113')]()||'',_0x4966a1['dialCutDigit']>0x0?_0x5bf881[_0xa31a('0xee')][_0xa31a('0x114')](_0x4966a1[_0xa31a('0x115')]):_0x5bf881[_0xa31a('0xee')]):util[_0xa31a('0x2d')](_0xa31a('0x111'),_['isNil'](_0x4966a1[_0xa31a('0x76')])?_0x4966a1[_0xa31a('0x75')][_0xa31a('0x2e')]:_0x4966a1[_0xa31a('0x76')][_0xa31a('0x2e')],_['isNil'](_0x4966a1[_0xa31a('0x112')])?'':_0x4966a1[_0xa31a('0x112')]['trim']()||'',_0x4966a1[_0xa31a('0x115')]>0x0?_0x5bf881[_0xa31a('0xee')][_0xa31a('0x114')](_0x4966a1[_0xa31a('0x115')]):_0x5bf881[_0xa31a('0xee')]);var _0x118d53=_0x340d95[_0xa31a('0x74')](_0x4966a1['Trunk'])?ut[_0xa31a('0x116')](_0x4966a1[_0xa31a('0x75')][_0xa31a('0x117')],_0x4966a1['dialOriginateCallerIdName'],_0x4966a1['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x4966a1[_0xa31a('0x118')],_0x4966a1[_0xa31a('0x119')]):_0x4966a1[_0xa31a('0x118')]):ut[_0xa31a('0x116')](_[_0xa31a('0x46')](_0x4966a1[_0xa31a('0x76')])?_0x4966a1[_0xa31a('0x75')][_0xa31a('0x117')]:_0x4966a1['TrunkBackup'][_0xa31a('0x117')],_0x4966a1['dialOriginateCallerIdName'],_0x4966a1[_0xa31a('0x119')]>0x0?ut['getCallerIdRandom'](_0x4966a1['dialOriginateCallerIdNumber'],_0x4966a1['dialRandomLastDigitCallerIdNumber']):_0x4966a1[_0xa31a('0x118')]);if(_0x118d53){_0x2e2cc5[_0xa31a('0x11a')]=ut['extractCalleridName'](_0x118d53);_0x2e2cc5[_0xa31a('0x11b')]=ut['extractCalleridNumber'](_0x118d53);}var _0x1618bf=ut[_0xa31a('0x11c')](_0x4966a1,_0x5bf881,_0x33c29a,_0x118d53,_0x12313f,_0x2e2cc5);var _0x19b901=utils[_0xa31a('0x11d')](_0x5bf881[_0xa31a('0x11e')]);Object[_0xa31a('0x11f')](_0x1618bf,_0x19b901);_['merge'](_0x2e2cc5,ut['toLowerVariables'](_0x1618bf));_0x2e2cc5['starttime']=moment()[_0xa31a('0x2d')](_0xa31a('0x65'));_0x4966a1['variables']=_0x1618bf;var _0x348949=ut[_0xa31a('0x120')](_0x2e2cc5,_0x4966a1,_0x1618bf,_0x2e2cc5['activeContact'],_0x553605);return ami['Action'](_0x348949)['then'](function(_0x551e3a){_0x4966a1['originated']+=0x1;logger['info'](_0xa31a('0x121'),_0x12313f,_0xa31a('0x91'),_0x4966a1['name'],'originated:\x20',_0x4966a1['originated']);_0x358261(_0x551e3a);})[_0xa31a('0x55')](function(_0x1c03ed){ut['logAgent'](_0x2e2cc5,0xe,'OriginateError');rpcDb[_0xa31a('0xdd')](_0x2e2cc5,_0xa31a('0x122'));_0x2a3d68(_0x1c03ed);});});};Preview[_0xa31a('0xf')][_0xa31a('0x24')]=function(_0x30e342){if(this[_0xa31a('0x17')][_0x30e342['linkedid']]){this[_0xa31a('0x17')][_0x30e342['linkedid']][_0xa31a('0x54')]=_0x30e342[_0xa31a('0x54')];}};Preview[_0xa31a('0xf')][_0xa31a('0x1b')]=function(_0x4098b9){var _0x346c9f=this;var _0x2131fe=this[_0xa31a('0x17')][_0x4098b9[_0xa31a('0x123')]];if(_0x2131fe){if(_0x2131fe[_0xa31a('0xf0')]&&this[_0xa31a('0x18')][_0x2131fe['lookAgent']]){ut[_0xa31a('0x124')](_0x2131fe,this[_0xa31a('0x18')][_0x2131fe['lookAgent']]['name'],this[_0xa31a('0x18')][_0x2131fe[_0xa31a('0xf0')]]['id']);}var _0x455c16=_[_0xa31a('0x125')](_0x2131fe);_0x455c16[_0xa31a('0x8e')]=moment()[_0xa31a('0x2d')](_0xa31a('0x65'));var _0x241cc3=_0x346c9f['campaignsPreview'][_0x2131fe[_0xa31a('0x49')]];if(ut[_0xa31a('0x126')](_0x4098b9[_0xa31a('0x127')])){if(_0x2131fe[_0xa31a('0xac')]){rpcDb[_0xa31a('0x128')](_0x2131fe[_0xa31a('0x8c')]);}if(_0x2131fe['activeContact']){rpcDb[_0xa31a('0x100')](_0x2131fe[_0xa31a('0x8c')]);}ami[_0xa31a('0x2f')]('custom:agentringnoanswer',ut[_0xa31a('0x7e')](_0x2131fe,_0xa31a('0x129'),this[_0xa31a('0x14')][_0x2131fe['queue']]));this['callProgressDetectingAgent'](_0x455c16,_0x241cc3,_0x4098b9);}else{_0x2131fe['starttime']=moment()[_0xa31a('0x2d')](_0xa31a('0x65'));ut['logAgent'](_0x455c16,0x4,_0xa31a('0x9d'));rpcDb['createAgentHistory'](_0x455c16,_0xa31a('0x12a'));}}};Preview[_0xa31a('0xf')]['syncHangup']=function(_0x52198f){var _0x1af51e=this[_0xa31a('0x17')][_0x52198f[_0xa31a('0xa3')]];var _0x3ae36d;if(_0x1af51e){_0x3ae36d=this[_0xa31a('0x14')][_0x1af51e[_0xa31a('0x49')]];logger['info'](_0xa31a('0x12b'),_0x52198f[_0xa31a('0xa3')],'\x20Queue',_0x3ae36d['name'],_0xa31a('0x4b'),_0x3ae36d[_0xa31a('0x4c')]);}if(this['actions'][_0x52198f[_0xa31a('0xa3')]]&&_0x52198f['linkedid']!==_0x52198f[_0xa31a('0xd5')]){if(_0x52198f['cause']==='16'&&this['actions'][_0x52198f[_0xa31a('0xa3')]][_0xa31a('0x4d')]){this['callProgressDetectingCustomer'](_0x52198f,_0x52198f['linkedid'],_0x52198f[_0xa31a('0x12c')]);}else if(this[_0xa31a('0x17')][_0x52198f[_0xa31a('0xa3')]][_0xa31a('0x4d')]){logger[_0xa31a('0x2b')]('[syncHangup][talking][cause]',_0x52198f['linkedid'],_0x52198f[_0xa31a('0x12c')],_0xa31a('0x91'),_0x3ae36d['name'],_0xa31a('0x4b'),_0x3ae36d['pTalking']);this[_0xa31a('0x78')](_0x52198f,_0x52198f[_0xa31a('0xa3')],_0x52198f['cause']);}}else if(_0x1af51e&&_[_0xa31a('0x46')](_0x1af51e[_0xa31a('0x12d')])&&_0x3ae36d[_0xa31a('0x12e')]&&_0x52198f[_0xa31a('0xa3')]===_0x52198f['uniqueid']&&_[_0xa31a('0x46')](_0x52198f[_0xa31a('0xdc')])&&_0x52198f[_0xa31a('0x12c')]==='16'&&_0x52198f['channelstate']==='6'&&_['isUndefined'](_0x1af51e[_0xa31a('0x12f')])){if(_0x1af51e[_0xa31a('0xac')]){rpcDb[_0xa31a('0x128')](_0x1af51e[_0xa31a('0x8c')]);}if(_0x1af51e[_0xa31a('0x8a')]){rpcDb[_0xa31a('0x100')](_0x1af51e[_0xa31a('0x8c')]);}_0x52198f['reason']='22';this[_0xa31a('0xd9')](_0x1af51e,_0x3ae36d,_0x52198f);}else if(_0x1af51e&&_0x1af51e[_0xa31a('0x12f')]){if(_0x52198f['cause']==='16'&&this[_0xa31a('0x17')][_0x52198f['linkedid']][_0xa31a('0x4d')]){logger['info'](_0xa31a('0x130'),_0x52198f[_0xa31a('0xa3')],_0x52198f[_0xa31a('0x12c')],_0xa31a('0x91'),_0x3ae36d[_0xa31a('0x2e')],_0xa31a('0x4b'),_0x3ae36d[_0xa31a('0x4c')]);this[_0xa31a('0x78')](_0x52198f,_0x52198f[_0xa31a('0xa3')],_0x52198f['cause']);}else if(this['actions'][_0x52198f['linkedid']][_0xa31a('0x4d')]){logger[_0xa31a('0x2b')](_0xa31a('0x131'),_0x52198f[_0xa31a('0xa3')],_0x52198f[_0xa31a('0x12c')],_0xa31a('0x91'),_0x3ae36d[_0xa31a('0x2e')],'pTalking:\x20',_0x3ae36d['pTalking']);this[_0xa31a('0x78')](_0x52198f,_0x52198f[_0xa31a('0xa3')],_0x52198f['cause']);}}};Preview[_0xa31a('0xf')][_0xa31a('0x22')]=function(_0x2f24f2){if(this[_0xa31a('0x17')][_0x2f24f2['destlinkedid']]&&_0x2f24f2['destlinkedid']!==_0x2f24f2['destuniqueid']){this[_0xa31a('0x78')](_0x2f24f2,_0x2f24f2[_0xa31a('0xd7')],_0x2f24f2[_0xa31a('0xcb')]);}};Preview[_0xa31a('0xf')]['syncHangupRequest']=function(_0x3fe43c){if(this['actions'][_0x3fe43c[_0xa31a('0xa3')]]&&_0x3fe43c[_0xa31a('0xa3')]!==_0x3fe43c[_0xa31a('0xd5')]&&!this[_0xa31a('0x17')][_0x3fe43c[_0xa31a('0xa3')]][_0xa31a('0x4d')]){if(_0x3fe43c[_0xa31a('0x12c')]==='1'){this['callProgressDetectingCustomer'](_0x3fe43c,_0x3fe43c[_0xa31a('0xa3')],_0x3fe43c[_0xa31a('0x12c')]);}}};Preview[_0xa31a('0xf')][_0xa31a('0x132')]=function(_0x49649a,_0x2236fd,_0x273227){if(this['actions'][_0x49649a]){if(_[_0xa31a('0x46')](this[_0xa31a('0x17')][_0x49649a][_0xa31a('0x133')])){this[_0xa31a('0x17')][_0x49649a][_0xa31a('0x133')]={};}this[_0xa31a('0x17')][_0x49649a][_0xa31a('0x133')][_0x2236fd]=_0x273227;}};Preview['prototype'][_0xa31a('0x26')]=function(_0x5db74e){try{if(!_[_0xa31a('0x46')](_0x5db74e)){if(ut[_0xa31a('0x134')](_['keys'](_0x5db74e[_0xa31a('0x135')])[0x0])){this[_0xa31a('0x132')](_0x5db74e[_0xa31a('0xd5')],_[_0xa31a('0x136')](_0x5db74e[_0xa31a('0x135')])[0x0],_0x5db74e[_0xa31a('0x137')]);}}}catch(_0x3a2928){logger['error'](_0xa31a('0x138'),util[_0xa31a('0x139')](_0x3a2928,{'showHidden':![],'depth':null}));}};Preview[_0xa31a('0xf')][_0xa31a('0x28')]=function(_0x30da4b){if(_0x30da4b){if(this['actions'][_0x30da4b[_0xa31a('0x13a')]]){this['actions'][_0x30da4b['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xa31a('0xf')]['syncBlindTransfer']=function(_0x1b30ec){if(_0x1b30ec){if(this[_0xa31a('0x17')][_0x1b30ec[_0xa31a('0x13b')]]){this['actions'][_0x1b30ec['transfererlinkedid']][_0xa31a('0x12f')]=!![];}}};module[_0xa31a('0x13c')]=Preview; \ No newline at end of file +var _0x55ca=['syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','originated','sendMessageOneNotActive','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','prototype','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','preview','booked','type','outbound','clockClearZombieChannels','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','pick','UserId','ListId','Action','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','getContactRecallMe','agents','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','catch','starttime','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','dialActive','Trunk','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','cloneAction','countnosuchnumberretry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','pTalking','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','outboundBusyCallsDay','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','Queue','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','Calling','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','trunks','SIP/%s','status','reachable','unmonitored','run','unlock','disableContact','getContactPreview','recallme','validateContact','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','unlockContact','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','actions','originateresponse','syncOriginateResponse','bind','hangup','syncHangup'];(function(_0x3fe869,_0x300424){var _0x145f87=function(_0x1f9a9f){while(--_0x1f9a9f){_0x3fe869['push'](_0x3fe869['shift']());}};_0x145f87(++_0x300424);}(_0x55ca,0x126));var _0xa55c=function(_0x23bca9,_0x590fef){_0x23bca9=_0x23bca9-0x0;var _0x5eb135=_0x55ca[_0x23bca9];return _0x5eb135;};'use strict';var util=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var uuid=require('uuid');var moment=require('moment');var Redis=require('ioredis');var config=require(_0xa55c('0x2'));var logger=require(_0xa55c('0x3'))('preview');var loggerAction=require(_0xa55c('0x3'))(_0xa55c('0x4'));var ami=require(_0xa55c('0x5'));var rpcDb=require(_0xa55c('0x6'));var cmHopperAdditionalPhone=require(_0xa55c('0x7'));var Action=require(_0xa55c('0x8'));var ut=require(_0xa55c('0x9'));var utils=require('../dialer/utils');config[_0xa55c('0xa')]=_[_0xa55c('0xb')](config['redis'],{'host':_0xa55c('0xc'),'port':0x18eb});var io=require(_0xa55c('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xa55c('0xe')]=function(_0x20c76a){this[_0xa55c('0xf')]=this[_0xa55c('0xf')]?this[_0xa55c('0xf')][_0xa55c('0x10')](_0x20c76a):_0x20c76a();};function Preview(_0x508342){this[_0xa55c('0x11')]=new Sequence();this[_0xa55c('0x12')]=_0x508342[_0xa55c('0x13')];this['trunks']=_0x508342['trunks'];this[_0xa55c('0x14')]={};this['agents']=_0x508342['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xa55c('0x15'),this[_0xa55c('0x16')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x18'),this[_0xa55c('0x19')][_0xa55c('0x17')](this));ami['on']('hanguprequest',this[_0xa55c('0x1a')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x1b'),this[_0xa55c('0x1c')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x1d'),this[_0xa55c('0x1e')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x1f'),this['syncVarSet'][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x20'),this[_0xa55c('0x21')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x22'),this[_0xa55c('0x23')]['bind'](this));this['loopCampaigns'](this[_0xa55c('0x12')]);}function emit(_0x3776ac,_0xade4c4,_0x4cfe10){io['to'](_0x3776ac)[_0xa55c('0x24')](_0xade4c4,_0x4cfe10);}function emitVoiceQueueChannelRemove(_0x2fcb90){logger['info'](_0xa55c('0x25'),JSON[_0xa55c('0x26')](_0x2fcb90));emit(util[_0xa55c('0x27')](_0xa55c('0x28'),_0x2fcb90[_0xa55c('0x29')]),'voice_queue_channel:remove',_0x2fcb90);io[_0xa55c('0x24')]('voice_queue_presence:remove',_0x2fcb90);}function notSendMessagesQueue(_0x5ba836){if(_0x5ba836['sendMessageOneNotActive']){if(_0x5ba836[_0xa55c('0x2a')]===0x0&&_0x5ba836['pTalking']===0x0){_0x5ba836[_0xa55c('0x2b')]=![];_0x5ba836[_0xa55c('0x2c')]=0x0;_0x5ba836[_0xa55c('0x2d')]=0x0;_0x5ba836[_0xa55c('0x2e')]=utils[_0xa55c('0x2f')][_0xa55c('0x30')];ut[_0xa55c('0x31')](_0xa55c('0x32'),_0x5ba836[_0xa55c('0x29')]+_0xa55c('0x33'));}else{_0x5ba836[_0xa55c('0x2e')]=utils['CAMPAIGN_STATUS'][_0xa55c('0x34')];ut[_0xa55c('0x31')](_0xa55c('0x32'),_0x5ba836[_0xa55c('0x29')]+'\x20is\x20deactivated');}}}Preview[_0xa55c('0x35')][_0xa55c('0x36')]=function(){var _0x1b8388=this;setInterval(function(){_0x1b8388[_0xa55c('0x37')]();},0x7cf);};Preview[_0xa55c('0x35')][_0xa55c('0x37')]=function(){var _0x52d37f=this[_0xa55c('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x35c9c2 in _0x52d37f){if(_0x52d37f[_0xa55c('0x38')](_0x35c9c2)&&(_0x52d37f[_0x35c9c2][_0xa55c('0x39')]===_0xa55c('0x3a')||_0x52d37f[_0x35c9c2]['dialMethod']===_0xa55c('0x3b'))&&_0x52d37f[_0x35c9c2][_0xa55c('0x3c')]===_0xa55c('0x3d')){if(this[_0xa55c('0x3e')]>0x7){this[_0xa55c('0x3e')]=0x0;this[_0xa55c('0x3f')]();}}if(_0x52d37f[_0xa55c('0x38')](_0x35c9c2)&&_0x52d37f[_0x35c9c2][_0xa55c('0x39')]===_0xa55c('0x3a')&&_0x52d37f[_0x35c9c2][_0xa55c('0x3c')]===_0xa55c('0x3d')){if(_0x52d37f[_0x35c9c2]['dialActive']){this['setMessage'](_0x52d37f[_0x35c9c2]);if(_0x52d37f[_0x35c9c2][_0xa55c('0x40')])this[_0xa55c('0x41')](_0x52d37f[_0x35c9c2]);}else{notSendMessagesQueue(_0x52d37f[_0x35c9c2]);}}}};Preview['prototype'][_0xa55c('0x42')]=function(_0x2f0110){var _0x2e9623=this;this[_0xa55c('0x11')][_0xa55c('0xe')](function(){if(!_[_0xa55c('0x43')](_0x2e9623[_0xa55c('0x14')][_0x2f0110])){loggerAction[_0xa55c('0x44')](_0xa55c('0x45'),_0x2f0110,'Queue',_0x2e9623['actions'][_0x2f0110]['queue'],_0xa55c('0x46'),JSON[_0xa55c('0x26')](_0x2e9623[_0xa55c('0x12')][_0x2e9623['actions'][_0x2f0110][_0xa55c('0x47')]]['originated']),_0xa55c('0x48'),JSON['stringify'](_0x2e9623[_0xa55c('0x12')][_0x2e9623[_0xa55c('0x14')][_0x2f0110][_0xa55c('0x47')]]['pTalking']),JSON[_0xa55c('0x26')](_0x2e9623[_0xa55c('0x14')][_0x2f0110]['dialAnswer']),JSON[_0xa55c('0x26')](_[_0xa55c('0x49')](_0x2e9623['actions'][_0x2f0110],['contactId',_0xa55c('0x4a'),'VoiceQueueId',_0xa55c('0x4b')])));return ami[_0xa55c('0x4c')]({'action':'status','channel':_0x2e9623['actions'][_0x2f0110]['channel']})['catch'](function(_0x3b3308){if(_0x3b3308[_0xa55c('0x2e')]===_0xa55c('0x4d')){setTimeout(function(){if(_0x2e9623[_0xa55c('0x14')][_0x2f0110]){ut[_0xa55c('0x4e')](_0x2e9623['campaignsPreview'][_0x2e9623[_0xa55c('0x14')][_0x2f0110][_0xa55c('0x47')]],_0xa55c('0x4f'));if(_0x2e9623[_0xa55c('0x14')][_0x2f0110][_0xa55c('0x50')]===!![]){ut[_0xa55c('0x51')](_0x2e9623['campaignsPreview'][_0x2e9623[_0xa55c('0x14')][_0x2f0110]['queue']],'[clearZombieChannel]');ut[_0xa55c('0x52')](_0xa55c('0x53')+_0x2f0110,_0x2e9623['actions'][_0x2f0110][_0xa55c('0x47')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x2f0110,_0x2e9623[_0xa55c('0x14')][_0x2f0110][_0xa55c('0x47')]);delete _0x2e9623[_0xa55c('0x14')][_0x2f0110];}},0x2328);}});}});};Preview['prototype'][_0xa55c('0x3f')]=function(){var _0xd5a006=this;loggerAction['info'](_0xa55c('0x54'),_['size'](this[_0xa55c('0x14')]));for(var _0x43a42d in this['actions']){if(_0xd5a006[_0xa55c('0x14')][_0xa55c('0x38')](_0x43a42d)){_0xd5a006['clearZombieChannel'](_0x43a42d);}}};Preview[_0xa55c('0x35')][_0xa55c('0x41')]=function(_0x204767){var _0x59a6c8=this;rpcDb[_0xa55c('0x55')](_0x204767['id'],ut['agentReadyId'](this[_0xa55c('0x56')]))[_0xa55c('0x57')](function(_0x451269){if(!_['isNil'](_0x451269)){for(var _0x41eab1=0x0;_0x41eab1<_0x451269[_0xa55c('0x58')];_0x41eab1+=0x1){if(ut['getDiff'](_0x451269[_0x41eab1][_0xa55c('0x59')])<_0x204767[_0xa55c('0x5a')]*0x3c){if(_0x451269[_0x41eab1]['Agent']&&!_0x451269[_0x41eab1][_0xa55c('0x5b')][_0xa55c('0x5c')]){_0x59a6c8['run'](_0x451269[_0x41eab1]['id'])[_0xa55c('0x57')](ut[_0xa55c('0x5d')](_0xa55c('0x5e')))[_0xa55c('0x5f')](ut['logger2'](_0xa55c('0x5e')));}else{rpcDb['disableContact'](_0x451269[_0x41eab1]['id']);}}else{var _0x2157d6=new Action(_0x451269[_0x41eab1],_0x204767);_0x2157d6[_0xa55c('0x60')]=moment()[_0xa55c('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x204767[_0xa55c('0x61')]+=0x1;ut[_0xa55c('0x62')](_0x2157d6,0x17,'RecallInQueue');if(_0x204767[_0xa55c('0x63')]){rpcDb[_0xa55c('0x64')](ut[_0xa55c('0x65')](_0x451269[_0x41eab1]));rpcDb[_0xa55c('0x66')](_0x2157d6,_0xa55c('0x67'));}else{ut[_0xa55c('0x62')](_0x2157d6,0x16,_0xa55c('0x68'));rpcDb[_0xa55c('0x66')](_0x2157d6,_0xa55c('0x69'));rpcDb[_0xa55c('0x6a')](_0x2157d6,'[HistoryRecallClose]');}}}}})[_0xa55c('0x5f')](ut[_0xa55c('0x5d')](_0xa55c('0x6b')));};Preview['prototype'][_0xa55c('0x6c')]=function(_0x35bf0a){_0x35bf0a['sendMessageOneNotActive']=!![];if(ut[_0xa55c('0x6d')](_0x35bf0a['loggedIn'])){_0x35bf0a[_0xa55c('0x2e')]=utils[_0xa55c('0x2f')][_0xa55c('0x6e')];}else if(!ut[_0xa55c('0x6f')](_0x35bf0a[_0xa55c('0x70')])){_0x35bf0a['message']=utils[_0xa55c('0x2f')][_0xa55c('0x30')];}else if(!this['isTrunkReachable'](_0x35bf0a[_0xa55c('0x71')])){if(!this[_0xa55c('0x72')](_0x35bf0a[_0xa55c('0x73')])){_0x35bf0a[_0xa55c('0x2e')]=utils['CAMPAIGN_STATUS']['UNREACHABLE_TRUNK'];}else{_0x35bf0a[_0xa55c('0x2e')]=utils[_0xa55c('0x2f')][_0xa55c('0x74')];}}else{_0x35bf0a[_0xa55c('0x2e')]=utils['CAMPAIGN_STATUS'][_0xa55c('0x74')];}};Preview['prototype'][_0xa55c('0x75')]=function(_0x437ced,_0x20593d,_0x2ccfb1){var _0xec640=this;var _0x53b2f7=this[_0xa55c('0x14')][_0x20593d];var _0x54f776=this[_0xa55c('0x12')][_0x53b2f7[_0xa55c('0x47')]];var _0x2cfe08;var _0x1e1c5b=![];var _0x19aaf5=0x2;var _0x138c9e=0x3;if(_0x54f776){switch(_0x2ccfb1){case'1':_0x54f776[_0xa55c('0x76')]+=0x1;_0x53b2f7['countnosuchnumberretry']+=0x1;_0x53b2f7[_0xa55c('0x77')]=ut[_0xa55c('0x78')](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0x0,_0xa55c('0x79'));ami[_0xa55c('0x24')]('custom:agentnosuchnumber',ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0x7b')));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0x7c'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'0',_0x54f776)['then'](function(_0xdd92c1){_0x1e1c5b=_0xdd92c1[_0xa55c('0x7e')]==0x1;_0x19aaf5=_0x54f776[_0xa55c('0x7f')];_0x138c9e=_0x54f776[_0xa55c('0x80')];if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut[_0xa55c('0x81')](_0x53b2f7,0xf,'Global');rpcDb[_0xa55c('0x6a')](_0x2cfe08,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x53b2f7[_0xa55c('0x82')]>=_0x54f776['dialNoSuchNumberMaxRetry']){rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0x83'));}else{rpcDb[_0xa55c('0x84')](ut[_0xa55c('0x85')](_0x53b2f7,_0xa55c('0x82'),_0x54f776[_0xa55c('0x7f')]),_0x53b2f7[_0xa55c('0x86')],_0x53b2f7[_0xa55c('0x87')]);}}delete this[_0xa55c('0x14')][_0x437ced[_0xa55c('0x88')]];}else{_0x53b2f7['countnosuchnumberretry']++;logger[_0xa55c('0x44')](_0xa55c('0x89'),_0x53b2f7['countnosuchnumberretry']);logger[_0xa55c('0x44')]('id',_0x53b2f7[_0xa55c('0x8a')]);_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnosuchnumberretry':_0x53b2f7[_0xa55c('0x82')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});break;case'ANSWER':var _0x1dfaf7=moment()[_0xa55c('0x27')](_0xa55c('0x8d'));_0x53b2f7[_0xa55c('0x8e')]=_0x1dfaf7;_0x53b2f7[_0xa55c('0x8f')]=_0x1dfaf7;_0x53b2f7[_0xa55c('0x50')]=!![];_0x54f776[_0xa55c('0x90')]+=0x1;logger[_0xa55c('0x44')](_0xa55c('0x91'),_0x53b2f7['uniqueid'],_0xa55c('0x92'),_0x54f776[_0xa55c('0x29')],_0xa55c('0x48'),_0x54f776[_0xa55c('0x90')]);ami[_0xa55c('0x24')](_0xa55c('0x93'),ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0x94'),this[_0xa55c('0x12')][_0x53b2f7[_0xa55c('0x47')]]));if(_0x54f776[_0xa55c('0x95')]){ami['emit'](_0xa55c('0x96'),ut['buildAcw'](_0x53b2f7));}break;case'16':ami[_0xa55c('0x24')](_0xa55c('0x97'),ut[_0xa55c('0x7a')](_0x53b2f7,'complete',this['campaignsPreview'][_0x53b2f7[_0xa55c('0x47')]]));emitVoiceQueueChannelRemove(ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0x98')));_0x54f776[_0xa55c('0x99')]+=0x1;_0x54f776['total']+=0x1;_0x54f776[_0xa55c('0x9a')]+=0x1;ut[_0xa55c('0x51')](_0x54f776,_0xa55c('0x9b'));_0x53b2f7[_0xa55c('0x77')]=ut[_0xa55c('0x78')](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0x4,'Answer');rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0x9c'));rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0x9d'));rpcDb[_0xa55c('0x9e')](_0x53b2f7);_0x54f776['sumDuration']+=_0x53b2f7[_0xa55c('0x9f')];_0x54f776[_0xa55c('0xa0')]+=_0x53b2f7['talktime'];logger[_0xa55c('0x44')](_0xa55c('0xa1'),_0x53b2f7[_0xa55c('0xa2')],'\x20Queue',_0x54f776[_0xa55c('0x29')],_0xa55c('0x48'),_0x54f776[_0xa55c('0x90')]);delete this[_0xa55c('0x14')][_0x437ced[_0xa55c('0x88')]];break;case'BUSY':_0x54f776[_0xa55c('0xa3')]+=0x1;_0x53b2f7[_0xa55c('0xa4')]+=0x1;_0x53b2f7['countglobal']=ut['totalGlobal'](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0x5,'Busy');_0x19aaf5=_0x54f776[_0xa55c('0xa5')];_0x138c9e=_0x54f776[_0xa55c('0x80')];ami[_0xa55c('0x24')](_0xa55c('0xa6'),ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0xa7')));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0xa8'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'5',_0x54f776)['then'](function(_0x463195){_0x1e1c5b=_0x463195[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776[_0xa55c('0xa9')]){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xab'));}else{if(_0x53b2f7[_0xa55c('0xa4')]>=_0x54f776['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x53b2f7,_0xa55c('0xa8'));}else{rpcDb[_0xa55c('0x84')](ut[_0xa55c('0x85')](_0x53b2f7,_0xa55c('0xa4'),_0x54f776['dialBusyRetryFrequency']),_0x53b2f7['unlockAgent'],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7[_0xa55c('0xa4')]++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countbusyretry':_0x53b2f7[_0xa55c('0xa4')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)['then'](function(){});});}});break;case _0xa55c('0xac'):_0x54f776['outboundNoAnswerCallsDay']+=0x1;_0x53b2f7[_0xa55c('0xad')]+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0x3,_0xa55c('0xae'));_0x19aaf5=_0x54f776[_0xa55c('0xaf')];_0x138c9e=_0x54f776[_0xa55c('0x80')];var _0x402f02=ut[_0xa55c('0xb0')](_0x53b2f7,_0x54f776);ami[_0xa55c('0x24')]('custom:agentnoanswer',_0x402f02);rpcDb['createCustomerHistory'](_0x53b2f7,_0xa55c('0xb1'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'3',_0x54f776)[_0xa55c('0x57')](function(_0x256db0){_0x1e1c5b=_0x256db0[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut[_0xa55c('0x81')](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xb2'));}else{if(_0x53b2f7[_0xa55c('0xad')]>=_0x54f776[_0xa55c('0xb3')]){rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xb1'));}else{rpcDb['rescheduleContact'](ut[_0xa55c('0x85')](_0x53b2f7,_0xa55c('0xad'),_0x54f776[_0xa55c('0xaf')]),_0x53b2f7[_0xa55c('0x86')],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7['countnoanswerretry']++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7['countnoanswerretry']}})['then'](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});break;case'CONGESTION':_0x54f776['outboundCongestionCallsDay']+=0x1;_0x53b2f7['countcongestionretry']+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0x8,_0xa55c('0xb4'));_0x19aaf5=_0x54f776[_0xa55c('0xb5')];_0x138c9e=_0x54f776[_0xa55c('0x80')];ami[_0xa55c('0x24')]('custom:agentcongestion',ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0xb6')));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0xb7'));_0xec640['verifyAdditionalPhones'](_0x53b2f7,'8',_0x54f776)[_0xa55c('0x57')](function(_0x25e4e0){_0x1e1c5b=_0x25e4e0[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut['totalGlobal'](_0x53b2f7)>=_0x54f776[_0xa55c('0xa9')]){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0xf,'Global');rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xb8'));}else{if(_0x53b2f7[_0xa55c('0xb9')]>=_0x54f776[_0xa55c('0xba')]){rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xb7'));}else{rpcDb[_0xa55c('0x84')](ut['scheduledAt'](_0x53b2f7,'countcongestionretry',_0x54f776[_0xa55c('0xa5')]),_0x53b2f7[_0xa55c('0x86')],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7[_0xa55c('0xb9')]++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countcongestionretry':_0x53b2f7[_0xa55c('0xb9')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});break;case'CANCEL':_0x54f776[_0xa55c('0xbb')]+=0x1;_0x53b2f7[_0xa55c('0xbc')]+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0x14,_0xa55c('0xbd'));_0x19aaf5=_0x54f776[_0xa55c('0xbe')];_0x138c9e=_0x54f776[_0xa55c('0x80')];ami[_0xa55c('0x24')](_0xa55c('0xbf'),ut['buildObj'](_0x53b2f7,_0xa55c('0xc0')));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0xc1'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'20',_0x54f776)[_0xa55c('0x57')](function(_0x31287c){_0x1e1c5b=_0x31287c[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut['totalGlobal'](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0x14,_0xa55c('0xbd'));rpcDb['createCustomerFinal'](_0x2cfe08,_0xa55c('0xc2'));}else{if(_0x53b2f7[_0xa55c('0xbc')]>=_0x54f776[_0xa55c('0xc3')]){rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xc2'));}else{rpcDb['rescheduleContact'](ut[_0xa55c('0x85')](_0x53b2f7,'countagentrejectretry',_0x54f776[_0xa55c('0xbe')]),_0x53b2f7[_0xa55c('0x86')],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7[_0xa55c('0xad')]++;_0xec640['incrementPreviewCounters']({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7[_0xa55c('0xad')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});break;case _0xa55c('0xc4'):_0x54f776[_0xa55c('0xc5')]+=0x1;_0x53b2f7[_0xa55c('0xc6')]+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0xb,_0xa55c('0xc7'));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0xc8'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'11',_0x54f776)['then'](function(_0x46124b){_0x1e1c5b=_0x46124b['additional']==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut[_0xa55c('0x81')](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x53b2f7[_0xa55c('0xc9')]>=_0x54f776[_0xa55c('0xca')]){rpcDb[_0xa55c('0x6a')](_0x53b2f7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xa55c('0x84')](ut['scheduledAt'](_0x53b2f7,_0xa55c('0xc6'),_0x54f776[_0xa55c('0xcb')]),_0x53b2f7['unlockAgent'],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7['countnoanswerretry']++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7['countnoanswerretry']}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)['then'](function(){});});}});break;case'18':_0x54f776[_0xa55c('0xcc')]+=0x1;_0x53b2f7[_0xa55c('0xcd')]+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0x12,_0x437ced['cause-txt']||_0x437ced[_0xa55c('0xce')]);ami[_0xa55c('0x24')](_0xa55c('0xcf'),ut[_0xa55c('0x7a')](_0x53b2f7,'amd'));rpcDb[_0xa55c('0x66')](_0x53b2f7,'[callProgressDetectingCustomer][hangupInAMD]');_0xec640[_0xa55c('0x7d')](_0x53b2f7,'18',_0x54f776)['then'](function(_0x4ab9f1){_0x1e1c5b=_0x4ab9f1['additional']==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0x12,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xd0'));}else{rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xd0'));}}else{_0x53b2f7[_0xa55c('0xad')]++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7[_0xa55c('0xad')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});delete this[_0xa55c('0x14')][_0x437ced['linkedid']];break;case'19':_0x54f776[_0xa55c('0xcc')]+=0x1;_0x53b2f7['countglobal']=ut['totalGlobal'](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0x13,_0x437ced[_0xa55c('0xd1')]||_0x437ced['dialstatus']);ami[_0xa55c('0x24')]('custom:amd',ut[_0xa55c('0x7a')](_0x53b2f7,'amd'));rpcDb['createCustomerHistory'](_0x53b2f7,_0xa55c('0xd2'));_0xec640['verifyAdditionalPhones'](_0x53b2f7,'18',_0x54f776)['then'](function(_0x2961b6){_0x1e1c5b=_0x2961b6[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut['totalGlobal'](_0x53b2f7)>=_0x54f776[_0xa55c('0xa9')]){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xd2'));}else{rpcDb['createCustomerFinal'](_0x53b2f7,'[callProgressDetectingCustomer][machine]');}}else{_0x53b2f7[_0xa55c('0xad')]++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7[_0xa55c('0xad')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});delete this[_0xa55c('0x14')][_0x437ced['linkedid']];break;default:if(_0x53b2f7[_0xa55c('0x50')]){ut[_0xa55c('0x51')](_0x54f776,_0xa55c('0xd3'));ut[_0xa55c('0x52')](_0xa55c('0xd4')+_0x54f776[_0xa55c('0x29')],_0x437ced);}_0x54f776[_0xa55c('0xcc')]+=0x1;_0x53b2f7[_0xa55c('0x77')]=ut[_0xa55c('0x78')](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0xc,_0x437ced[_0xa55c('0xd1')]||_0x437ced[_0xa55c('0xce')]);_0x19aaf5=_0x54f776[_0xa55c('0xbe')];_0x138c9e=_0x54f776['callAdditionalPhoneAfterMin'];rpcDb['createCustomerHistory'](_0x53b2f7,'[callProgressDetectingCustomer][logUnknown]');_0xec640[_0xa55c('0x7d')](_0x53b2f7,'20',_0x54f776)['then'](function(_0x1ba04f){_0x1e1c5b=_0x1ba04f[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776[_0xa55c('0xa9')]){_0x2cfe08=ut[_0xa55c('0x81')](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xd5'));}else{rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xd5'));}delete this[_0xa55c('0x14')][_0x437ced[_0xa55c('0x88')]];}else{_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});}});}if(!(_0x53b2f7[_0xa55c('0x50')]&&_0x2ccfb1==='16')){ut[_0xa55c('0x4e')](_0x54f776,_0xa55c('0xd6'));logger[_0xa55c('0x44')](_0xa55c('0xd7'),_0x53b2f7[_0xa55c('0xa2')],_0xa55c('0x92'),_0x54f776[_0xa55c('0x29')],_0xa55c('0x46'),_0x54f776[_0xa55c('0x2a')]);}if(_0x2ccfb1!=='ANSWER'){delete this[_0xa55c('0x14')][_0x437ced[_0xa55c('0x88')]];delete this['actions'][_0x437ced[_0xa55c('0xd8')]];}_0x54f776[_0xa55c('0xd9')]=!![];}};Preview[_0xa55c('0x35')][_0xa55c('0xda')]=function(_0x31767b,_0x4d9b66,_0x456dd4){if(_['isUndefined'](_0x4d9b66)&&'object'!==typeof _0x4d9b66){return;}if(_[_0xa55c('0xdb')](_0x456dd4)&&_0xa55c('0xdc')!==typeof _0x456dd4){return;}switch(_0x456dd4[_0xa55c('0xdd')]){case'0':ut[_0xa55c('0xde')](_0x31767b,0x0,_0xa55c('0x79'));rpcDb[_0xa55c('0xdf')](_0x31767b,_0xa55c('0xe0'));break;case'3':ut[_0xa55c('0xde')](_0x31767b,0x3,_0xa55c('0xae'));rpcDb[_0xa55c('0xdf')](_0x31767b,_0xa55c('0xe1'));break;case'5':ut[_0xa55c('0xde')](_0x31767b,0x5,_0xa55c('0xe2'));rpcDb[_0xa55c('0xdf')](_0x31767b,_0xa55c('0xe3'));break;case'8':ut[_0xa55c('0xde')](_0x31767b,0x8,_0xa55c('0xb4'));rpcDb[_0xa55c('0xdf')](_0x31767b,_0xa55c('0xe4'));break;case'22':ut['logAgent'](_0x31767b,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x31767b,_0xa55c('0xe5'));break;default:ut[_0xa55c('0xde')](_0x31767b,0xc,_0x456dd4['reason']);rpcDb[_0xa55c('0xdf')](_0x31767b,'[callProgressDetectingAgent][logCongestion]');}ut[_0xa55c('0x4e')](_0x4d9b66,'[callProgressDetectingAgent]');logger[_0xa55c('0x44')](_0xa55c('0xe6'),_0x31767b[_0xa55c('0xa2')],_0xa55c('0x92'),_0x4d9b66[_0xa55c('0x29')],_0xa55c('0x46'),_0x4d9b66[_0xa55c('0x2a')]);delete this[_0xa55c('0x14')][_0x31767b[_0xa55c('0xa2')]];};Preview[_0xa55c('0x35')][_0xa55c('0x7d')]=function(_0x53f209,_0x59f3a4,_0xde7bd){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x53f209,_0x59f3a4,_0xde7bd)[_0xa55c('0x5f')](logger['info'](_0xa55c('0xe7')));};Preview[_0xa55c('0x35')][_0xa55c('0x8c')]=function(_0x5b20c5,_0x3b8f15,_0x18584c){return cmHopperAdditionalPhone[_0xa55c('0x8c')](_0x5b20c5,_0x3b8f15,_0x18584c)['catch'](logger[_0xa55c('0x44')]('[swapAdditionalPhone]\x20'));};Preview[_0xa55c('0x35')]['incrementPreviewCounters']=function(_0x4e8433){return Promise[_0xa55c('0xe8')]()[_0xa55c('0x57')](cmHopperAdditionalPhone[_0xa55c('0x8b')](_0x4e8433))['catch'](logger[_0xa55c('0x44')](_0xa55c('0xe9')));};Preview[_0xa55c('0x35')][_0xa55c('0xea')]=function(_0x4399bd,_0x3e9384,_0x2e76ad,_0x24db74,_0x4b1762){var _0x402298=this;return new Promise(function(_0x1b8b05,_0x80befe){if(_[_0xa55c('0x43')](_0x3e9384)||_[_0xa55c('0x43')](_0x3e9384[_0xa55c('0xeb')])||_[_0xa55c('0x43')](_0x3e9384[_0xa55c('0xec')])||_[_0xa55c('0x43')](_0x3e9384[_0xa55c('0xed')])){_0x80befe(ut[_0xa55c('0x2e')]('Contact\x20is\x20undefined',_0x24db74,_0x4b1762));return;}var _0x263d16=uuid['v4']();var _0x48127c=_0x402298['campaignsPreview'][_0x3e9384[_0xa55c('0xee')]['name']];var _0x427e3b=_0x2e76ad?_0x402298['agents'][_0x2e76ad]['id']:undefined;_0x402298[_0xa55c('0x14')][_0x263d16]=new Action(_0x3e9384,_0x48127c,_0x263d16,_0x2e76ad,_0x427e3b);var _0x231499=_0x402298[_0xa55c('0x14')][_0x263d16];_0x231499[_0xa55c('0x86')]=_0x24db74;_0x231499[_0xa55c('0x87')]=_0x4b1762;_0x231499[_0xa55c('0xef')]=_0x2e76ad;if(_[_0xa55c('0xf0')](_0x4399bd)){_0x402298['execCall'](_0x231499,_0x48127c,_0x3e9384,_0x2e76ad)[_0xa55c('0x57')](function(_0x590c0c){logger['info'](_0xa55c('0xf1'),_0xa55c('0xf2')+_0x231499['queue']+_0xa55c('0xf3')+_0x231499[_0xa55c('0x8a')],JSON[_0xa55c('0x26')](_0x590c0c));ami['emit']('custom:agentcalled',ut['buildObj'](_0x231499,'called',_0x402298[_0xa55c('0x12')][_0x231499[_0xa55c('0x47')]]));_0x1b8b05(ut['message'](_0xa55c('0xf4')));})[_0xa55c('0x5f')](function(_0x3b3be0){ut['logger'](_0xa55c('0xf5'),_0x3b3be0);_0x80befe(ut['message']('Call\x20failed',_0x24db74,_0x4b1762));});}else{_0x48127c['outboundBlacklistCallsDay']+=0x1;ut[_0xa55c('0xf6')](_0x231499);rpcDb['createHistory'](_0x231499,_0xa55c('0xf7'));delete _0x402298['actions'][_0x263d16];_0x80befe(ut[_0xa55c('0x2e')](_0xa55c('0xf8'),_0x24db74,_0x4b1762));}});};Preview[_0xa55c('0x35')]['isTrunkReachable']=function(_0x1c016d){return!_[_0xa55c('0x43')](_0x1c016d)&&!_[_0xa55c('0x43')](_0x1c016d[_0xa55c('0x29')])&&!_[_0xa55c('0x43')](_0x1c016d[_0xa55c('0xf9')])&&_0x1c016d[_0xa55c('0xf9')]&&!_[_0xa55c('0x43')](this[_0xa55c('0xfa')][util['format'](_0xa55c('0xfb'),_0x1c016d[_0xa55c('0x29')])])&&!_[_0xa55c('0x43')](this[_0xa55c('0xfa')][util[_0xa55c('0x27')](_0xa55c('0xfb'),_0x1c016d['name'])][_0xa55c('0xfc')])&&(this['trunks'][util[_0xa55c('0x27')](_0xa55c('0xfb'),_0x1c016d['name'])][_0xa55c('0xfc')]===_0xa55c('0xfd')||this['trunks'][util['format'](_0xa55c('0xfb'),_0x1c016d[_0xa55c('0x29')])][_0xa55c('0xfc')]===_0xa55c('0xfe'));};Preview[_0xa55c('0x35')][_0xa55c('0xff')]=function(_0x31b866,_0x37ed47){return this['execRun'](_0x31b866,_0x37ed47)[_0xa55c('0x57')](function(_0x331595){return _[_0xa55c('0x49')](_0x331595,[_0xa55c('0x2e')]);})[_0xa55c('0x5f')](function(_0x59a69d){if(_0x59a69d[_0xa55c('0x100')]){rpcDb['unlockContact'](_0x31b866);}if(_0x59a69d['active']){rpcDb[_0xa55c('0x101')](_0x31b866);}throw _[_0xa55c('0x49')](_0x59a69d,[_0xa55c('0x2e')]);});};Preview[_0xa55c('0x35')]['execRun']=function(_0x125812,_0x155c6e){var _0xa22273=this;var _0x1c7506,_0x3b76df;return rpcDb[_0xa55c('0x102')](_0x125812)[_0xa55c('0x57')](function(_0x239b2e){if(!_['isNil'](_0x239b2e[0x0])){_0x3b76df=_0x239b2e[0x0][_0xa55c('0x103')]?![]:!![];_0x1c7506=_0x239b2e[0x0][_0xa55c('0x103')]?!![]:![];_0x1c7506=_0x155c6e?!![]:_0x1c7506;}var _0x2639cc=_0xa22273[_0xa55c('0x104')](_0x239b2e);if(_0x2639cc['isValid']){rpcDb[_0xa55c('0x105')](_[_0xa55c('0x49')](_0x239b2e[0x0],[_0xa55c('0xed'),'phone']))[_0xa55c('0x57')](function(_0x3a67fb){_0xa22273[_0xa55c('0xea')](_0x3a67fb,_0x239b2e[0x0],_0x155c6e,_0x3b76df,_0x1c7506)[_0xa55c('0x57')](function(_0x19e506){return _0x19e506;})[_0xa55c('0x5f')](function(_0x127c2f){throw _0x127c2f;});})['catch'](function(_0xcd4f3a){ut[_0xa55c('0x31')]('[Preview][checkIsBlackList]',_0xcd4f3a);throw ut[_0xa55c('0x2e')](_0xa55c('0x106'),_0x3b76df,_0x1c7506);});}else{throw ut[_0xa55c('0x2e')](_0x2639cc['message'],_0x3b76df,_0x1c7506);}})['catch'](function(_0x4dba17){ut[_0xa55c('0x31')](_0xa55c('0x107'),_0x4dba17);throw ut['message']('Call\x20unsuccessful',![],!![]);});};Preview[_0xa55c('0x35')][_0xa55c('0x104')]=function(_0x591ee3){if(_['isNil'](_0x591ee3)||_[_0xa55c('0xf0')](_0x591ee3)||!_[_0xa55c('0x43')](_0x591ee3[0x0][_0xa55c('0x5b')])&&_['isNil'](_0x591ee3[0x0]['Agent'][_0xa55c('0x29')])){ut['logger'](_0xa55c('0x108'),_0x591ee3);return{'isValid':![],'message':_0xa55c('0x109')};}var _0x5a4e69=this[_0xa55c('0x12')][_0x591ee3[0x0]['Queue']['name']];_0x5a4e69['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0xa55c('0x43')](_0x5a4e69)){ut['logger'](_0xa55c('0x10a'),_0x5a4e69);return{'isValid':![],'message':_0xa55c('0x10b')};}if(!this[_0xa55c('0x72')](_0x5a4e69['Trunk'])){ut[_0xa55c('0x31')](_0xa55c('0x10c'),_0xa55c('0x10d')+_0x5a4e69[_0xa55c('0x29')]+_0xa55c('0x10e'));if(!this[_0xa55c('0x72')](_0x5a4e69[_0xa55c('0x73')])){ut[_0xa55c('0x31')](_0xa55c('0x10c'),_0x5a4e69[_0xa55c('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xa55c('0x10f')};}}if(!ut[_0xa55c('0x6f')](_0x5a4e69['dialActive'])){ut[_0xa55c('0x31')](_0xa55c('0x110'),_0x5a4e69[_0xa55c('0x29')]+_0xa55c('0x111'));return{'isValid':![],'message':_0xa55c('0x10d')+_0x5a4e69[_0xa55c('0x29')]+_0xa55c('0x111')};}return{'isValid':!![],'message':_0xa55c('0x112')};};Preview[_0xa55c('0x35')][_0xa55c('0x113')]=function(_0x131288,_0x197953,_0x262d72,_0x228d12){var _0x16e229=this;return new Promise(function(_0x5c8713,_0x2d03b2){var _0x4b2e75=_0x131288[_0xa55c('0xa2')];var _0x3d0c6d=_0x16e229[_0xa55c('0x72')](_0x197953[_0xa55c('0x71')])?util['format'](_0xa55c('0x114'),_0x197953[_0xa55c('0x71')][_0xa55c('0x29')],_['isNil'](_0x197953[_0xa55c('0x115')])?'':_0x197953[_0xa55c('0x115')][_0xa55c('0x116')]()||'',_0x197953['dialCutDigit']>0x0?_0x262d72[_0xa55c('0xec')][_0xa55c('0x117')](_0x197953[_0xa55c('0x118')]):_0x262d72['phone']):util[_0xa55c('0x27')]('SIP/%s/%s%s',_[_0xa55c('0x43')](_0x197953[_0xa55c('0x73')])?_0x197953[_0xa55c('0x71')][_0xa55c('0x29')]:_0x197953[_0xa55c('0x73')]['name'],_[_0xa55c('0x43')](_0x197953[_0xa55c('0x115')])?'':_0x197953[_0xa55c('0x115')]['trim']()||'',_0x197953[_0xa55c('0x118')]>0x0?_0x262d72[_0xa55c('0xec')][_0xa55c('0x117')](_0x197953['dialCutDigit']):_0x262d72[_0xa55c('0xec')]);var _0x2becbd=_0x16e229[_0xa55c('0x72')](_0x197953[_0xa55c('0x71')])?ut[_0xa55c('0x119')](_0x197953[_0xa55c('0x71')][_0xa55c('0x11a')],_0x197953['dialOriginateCallerIdName'],_0x197953[_0xa55c('0x11b')]>0x0?ut[_0xa55c('0x11c')](_0x197953[_0xa55c('0x11d')],_0x197953[_0xa55c('0x11b')]):_0x197953['dialOriginateCallerIdNumber']):ut[_0xa55c('0x119')](_[_0xa55c('0x43')](_0x197953[_0xa55c('0x73')])?_0x197953[_0xa55c('0x71')][_0xa55c('0x11a')]:_0x197953[_0xa55c('0x73')][_0xa55c('0x11a')],_0x197953['dialOriginateCallerIdName'],_0x197953[_0xa55c('0x11b')]>0x0?ut[_0xa55c('0x11c')](_0x197953[_0xa55c('0x11d')],_0x197953[_0xa55c('0x11b')]):_0x197953[_0xa55c('0x11d')]);if(_0x2becbd){_0x131288['originatecalleridname']=ut['extractCalleridName'](_0x2becbd);_0x131288['originatecalleridnum']=ut[_0xa55c('0x11e')](_0x2becbd);}var _0x124873=ut[_0xa55c('0x11f')](_0x197953,_0x262d72,_0x3d0c6d,_0x2becbd,_0x4b2e75,_0x131288);_[_0xa55c('0x120')](_0x131288,ut[_0xa55c('0x121')](_0x124873));_0x131288[_0xa55c('0x60')]=moment()[_0xa55c('0x27')](_0xa55c('0x8d'));_0x197953['variables']=_0x124873;var _0x35c42c=ut[_0xa55c('0x122')](_0x131288,_0x197953,_0x124873,_0x131288[_0xa55c('0x87')],_0x228d12);return ami[_0xa55c('0x4c')](_0x35c42c)[_0xa55c('0x57')](function(_0xd511c0){_0x197953['originated']+=0x1;logger[_0xa55c('0x44')]('[originated][increment]',_0x4b2e75,'\x20Queue',_0x197953['name'],'originated:\x20',_0x197953[_0xa55c('0x2a')]);_0x5c8713(_0xd511c0);})[_0xa55c('0x5f')](function(_0x4732b4){ut[_0xa55c('0xde')](_0x131288,0xe,_0xa55c('0x123'));rpcDb[_0xa55c('0xdf')](_0x131288,_0xa55c('0x124'));_0x2d03b2(_0x4732b4);});});};Preview[_0xa55c('0x35')][_0xa55c('0x1e')]=function(_0x9c98af){if(this[_0xa55c('0x14')][_0x9c98af['linkedid']]){this['actions'][_0x9c98af[_0xa55c('0x88')]]['channel']=_0x9c98af[_0xa55c('0x125')];}};Preview[_0xa55c('0x35')][_0xa55c('0x16')]=function(_0x340570){var _0x2ef96f=this;var _0x582b22=this[_0xa55c('0x14')][_0x340570[_0xa55c('0x126')]];if(_0x582b22){if(_0x582b22[_0xa55c('0xef')]&&this['agents'][_0x582b22[_0xa55c('0xef')]]){ut[_0xa55c('0x127')](_0x582b22,this['agents'][_0x582b22['lookAgent']][_0xa55c('0x29')],this[_0xa55c('0x56')][_0x582b22[_0xa55c('0xef')]]['id']);}var _0x4f2883=_[_0xa55c('0x128')](_0x582b22);_0x4f2883[_0xa55c('0x8e')]=moment()[_0xa55c('0x27')](_0xa55c('0x8d'));var _0x5a37d6=_0x2ef96f['campaignsPreview'][_0x582b22[_0xa55c('0x47')]];if(ut['isFailure'](_0x340570['response'])){if(_0x582b22[_0xa55c('0x86')]){rpcDb[_0xa55c('0x129')](_0x582b22[_0xa55c('0x8a')]);}if(_0x582b22[_0xa55c('0x87')]){rpcDb['disableContact'](_0x582b22[_0xa55c('0x8a')]);}ami[_0xa55c('0x24')](_0xa55c('0x12a'),ut[_0xa55c('0x7a')](_0x582b22,_0xa55c('0x12b'),this['campaignsPreview'][_0x582b22[_0xa55c('0x47')]]));this[_0xa55c('0xda')](_0x4f2883,_0x5a37d6,_0x340570);}else{_0x582b22[_0xa55c('0x60')]=moment()[_0xa55c('0x27')](_0xa55c('0x8d'));ut[_0xa55c('0xde')](_0x4f2883,0x4,_0xa55c('0x12c'));rpcDb['createAgentHistory'](_0x4f2883,_0xa55c('0x12d'));}}};Preview['prototype'][_0xa55c('0x19')]=function(_0x26946f){var _0x3755a7=this['actions'][_0x26946f['linkedid']];var _0x307b39;if(_0x3755a7){_0x307b39=this[_0xa55c('0x12')][_0x3755a7['queue']];logger['info'](_0xa55c('0x12e'),_0x26946f[_0xa55c('0x88')],'\x20Queue',_0x307b39[_0xa55c('0x29')],'pTalking:\x20',_0x307b39[_0xa55c('0x90')]);}if(this[_0xa55c('0x14')][_0x26946f[_0xa55c('0x88')]]&&_0x26946f[_0xa55c('0x88')]!==_0x26946f['uniqueid']){if(_0x26946f[_0xa55c('0x12f')]==='16'&&this[_0xa55c('0x14')][_0x26946f[_0xa55c('0x88')]]['dialAnswer']){this['callProgressDetectingCustomer'](_0x26946f,_0x26946f[_0xa55c('0x88')],_0x26946f['cause']);}else if(this['actions'][_0x26946f[_0xa55c('0x88')]][_0xa55c('0x50')]){logger[_0xa55c('0x44')](_0xa55c('0x130'),_0x26946f[_0xa55c('0x88')],_0x26946f[_0xa55c('0x12f')],_0xa55c('0x92'),_0x307b39[_0xa55c('0x29')],_0xa55c('0x48'),_0x307b39[_0xa55c('0x90')]);this['callProgressDetectingCustomer'](_0x26946f,_0x26946f['linkedid'],_0x26946f[_0xa55c('0x12f')]);}}else if(_0x3755a7&&_[_0xa55c('0x43')](_0x3755a7[_0xa55c('0x131')])&&_0x307b39[_0xa55c('0x132')]&&_0x26946f['linkedid']===_0x26946f[_0xa55c('0xa2')]&&_[_0xa55c('0x43')](_0x26946f[_0xa55c('0xdd')])&&_0x26946f[_0xa55c('0x12f')]==='16'&&_0x26946f['channelstate']==='6'&&_[_0xa55c('0xdb')](_0x3755a7['transfer'])){if(_0x3755a7['unlockAgent']){rpcDb['unlockContact'](_0x3755a7['idContact']);}if(_0x3755a7[_0xa55c('0x87')]){rpcDb[_0xa55c('0x101')](_0x3755a7['idContact']);}_0x26946f[_0xa55c('0xdd')]='22';this[_0xa55c('0xda')](_0x3755a7,_0x307b39,_0x26946f);}else if(_0x3755a7&&_0x3755a7[_0xa55c('0x133')]){if(_0x26946f[_0xa55c('0x12f')]==='16'&&this[_0xa55c('0x14')][_0x26946f[_0xa55c('0x88')]]['dialAnswer']){logger[_0xa55c('0x44')](_0xa55c('0x134'),_0x26946f[_0xa55c('0x88')],_0x26946f[_0xa55c('0x12f')],'\x20Queue',_0x307b39['name'],'pTalking:\x20',_0x307b39[_0xa55c('0x90')]);this[_0xa55c('0x75')](_0x26946f,_0x26946f[_0xa55c('0x88')],_0x26946f[_0xa55c('0x12f')]);}else if(this[_0xa55c('0x14')][_0x26946f[_0xa55c('0x88')]][_0xa55c('0x50')]){logger[_0xa55c('0x44')]('[syncHangup][talking][cause]',_0x26946f['linkedid'],_0x26946f[_0xa55c('0x12f')],_0xa55c('0x92'),_0x307b39['name'],_0xa55c('0x48'),_0x307b39[_0xa55c('0x90')]);this['callProgressDetectingCustomer'](_0x26946f,_0x26946f['linkedid'],_0x26946f[_0xa55c('0x12f')]);}}};Preview[_0xa55c('0x35')][_0xa55c('0x1c')]=function(_0x236015){if(this['actions'][_0x236015['destlinkedid']]&&_0x236015[_0xa55c('0xd8')]!==_0x236015[_0xa55c('0x135')]){this[_0xa55c('0x75')](_0x236015,_0x236015[_0xa55c('0xd8')],_0x236015[_0xa55c('0xce')]);}};Preview[_0xa55c('0x35')][_0xa55c('0x1a')]=function(_0x2511fe){if(this[_0xa55c('0x14')][_0x2511fe[_0xa55c('0x88')]]&&_0x2511fe['linkedid']!==_0x2511fe[_0xa55c('0xa2')]&&!this['actions'][_0x2511fe[_0xa55c('0x88')]][_0xa55c('0x50')]){if(_0x2511fe[_0xa55c('0x12f')]==='1'){this[_0xa55c('0x75')](_0x2511fe,_0x2511fe[_0xa55c('0x88')],_0x2511fe[_0xa55c('0x12f')]);}}};Preview[_0xa55c('0x35')][_0xa55c('0x136')]=function(_0x1e8760,_0x329808,_0x35ad66){if(this[_0xa55c('0x14')][_0x1e8760]){if(_[_0xa55c('0x43')](this['actions'][_0x1e8760][_0xa55c('0x137')])){this[_0xa55c('0x14')][_0x1e8760]['variables']={};}this[_0xa55c('0x14')][_0x1e8760][_0xa55c('0x137')][_0x329808]=_0x35ad66;}};Preview[_0xa55c('0x35')]['syncVarSet']=function(_0x238a43){try{if(!_[_0xa55c('0x43')](_0x238a43)){if(ut['filterKey'](_[_0xa55c('0x138')](_0x238a43[_0xa55c('0x139')])[0x0])){this['addVariable'](_0x238a43[_0xa55c('0xa2')],_['keys'](_0x238a43[_0xa55c('0x139')])[0x0],_0x238a43[_0xa55c('0x13a')]);}}}catch(_0x2a6c2d){logger[_0xa55c('0x13b')](_0xa55c('0x13c'),util[_0xa55c('0x13d')](_0x2a6c2d,{'showHidden':![],'depth':null}));}};Preview[_0xa55c('0x35')][_0xa55c('0x21')]=function(_0x9b5e3a){if(_0x9b5e3a){if(this[_0xa55c('0x14')][_0x9b5e3a[_0xa55c('0x13e')]]){this[_0xa55c('0x14')][_0x9b5e3a[_0xa55c('0x13e')]][_0xa55c('0x133')]=!![];}}};Preview[_0xa55c('0x35')][_0xa55c('0x23')]=function(_0x5ac4fa){if(_0x5ac4fa){if(this[_0xa55c('0x14')][_0x5ac4fa['transfererlinkedid']]){this[_0xa55c('0x14')][_0x5ac4fa[_0xa55c('0x13f')]][_0xa55c('0x133')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index f850ffb..ddac04a 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 _0xbe3c=['[createHistory]\x20','resolve','createHistory','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect'];(function(_0x412c5c,_0x217e8a){var _0x422bd9=function(_0xf4e8d6){while(--_0xf4e8d6){_0x412c5c['push'](_0x412c5c['shift']());}};_0x422bd9(++_0x217e8a);}(_0xbe3c,0x1d3));var _0xcbe3=function(_0x347cc3,_0x1f05cd){_0x347cc3=_0x347cc3-0x0;var _0x1df0f8=_0xbe3c[_0x347cc3];return _0x1df0f8;};'use strict';var util=require(_0xcbe3('0x0'));var BPromise=require(_0xcbe3('0x1'));var logger=require(_0xcbe3('0x2'))(_0xcbe3('0x3'));var cmHopper=require(_0xcbe3('0x4'));var cmHopperHistory=require(_0xcbe3('0x5'));var cmHopperBlack=require(_0xcbe3('0x6'));var agentReportPreview=require(_0xcbe3('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x33aa32){return function(_0x9f5371){logger[_0xcbe3('0x8')](_0x33aa32,util[_0xcbe3('0x9')](_0x9f5371,{'showHidden':![],'depth':null}));};}function create(_0x39aad3){return cmHopperHistory['createHistory'](_0x39aad3)['catch'](loggerCatch(_0xcbe3('0xa')));}function createAgent(_0x5892b7){return BPromise[_0xcbe3('0xb')]()['then'](agentReportPreview[_0xcbe3('0xc')](_0x5892b7))[_0xcbe3('0xd')](loggerCatch(_0xcbe3('0xa')));}function moveContact(_0x5f0926){return cmHopper[_0xcbe3('0xe')](_0x5f0926,!![])[_0xcbe3('0xd')](loggerCatch(_0xcbe3('0xf')));}exports[_0xcbe3('0x10')]=function(_0x4080a6){return cmHopperBlack[_0xcbe3('0x10')](_0x4080a6)['catch'](loggerCatch(_0xcbe3('0x11')));};exports[_0xcbe3('0x12')]=function(_0x432732){return BPromise[_0xcbe3('0xb')]()[_0xcbe3('0x13')](cmHopper[_0xcbe3('0x12')](_0x432732))[_0xcbe3('0xd')](loggerCatch(_0xcbe3('0x14')));};exports[_0xcbe3('0xc')]=function(_0xb0eb0,_0x144184){create(_0xb0eb0)[_0xcbe3('0xd')](loggerCatch(_0x144184));moveContact(_0xb0eb0)[_0xcbe3('0xd')](loggerCatch(_0x144184));};exports[_0xcbe3('0x15')]=function(_0x2b33a4,_0x39c653){createAgent(_0x2b33a4)[_0xcbe3('0xd')](loggerCatch(_0x39c653));};exports[_0xcbe3('0x16')]=function(_0x532d27,_0x4050de){create(_0x532d27)[_0xcbe3('0xd')](loggerCatch(_0x4050de));};exports[_0xcbe3('0x17')]=function(_0x3e61fe,_0x4b476f){moveContact(_0x3e61fe)[_0xcbe3('0xd')](loggerCatch(_0x4b476f));};exports[_0xcbe3('0x18')]=function(_0x5d2e6c,_0x4383db,_0x4ad42b){if(_0x4383db){_0x5d2e6c[_0xcbe3('0x19')]=null;}if(_0x4ad42b){_0x5d2e6c[_0xcbe3('0x1a')]=![];}return cmHopper['rescheduleContact'](_0x5d2e6c)[_0xcbe3('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xcbe3('0x1b')]=function(_0x19f990){return cmHopper['countReScheduled'](_0x19f990)['catch'](loggerCatch(_0xcbe3('0x1c')));};exports[_0xcbe3('0x1d')]=function(_0x44fb7d){return cmHopper[_0xcbe3('0x1d')]({'UserId':null},_0x44fb7d,0x1)[_0xcbe3('0xd')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x33e2af){return cmHopper[_0xcbe3('0x1d')]({'active':![]},_0x33e2af,0x1)[_0xcbe3('0xd')](loggerCatch(_0xcbe3('0x1e')));};exports[_0xcbe3('0x1f')]=function(_0x2a53e0){var _0xf0d292={};_0xf0d292[_0xcbe3('0x20')]=_0x2a53e0['type'];_0xf0d292[_0xcbe3('0x21')]=_0x2a53e0['uniqueid'];_0xf0d292[_0xcbe3('0x22')]=_0x2a53e0[_0xcbe3('0x22')];_0xf0d292['calleridname']=_0x2a53e0['calleridname'];_0xf0d292[_0xcbe3('0x23')]=_0x2a53e0[_0xcbe3('0x23')];_0xf0d292['queuecallerjoinAt']=_0x2a53e0['answertime'];_0xf0d292['queuecallerleaveAt']=_0x2a53e0[_0xcbe3('0x24')];_0xf0d292[_0xcbe3('0x25')]=0x1;_0xf0d292[_0xcbe3('0x26')]=_0x2a53e0[_0xcbe3('0x27')];_0xf0d292[_0xcbe3('0x28')]=_0x2a53e0[_0xcbe3('0x29')];_0xf0d292[_0xcbe3('0x2a')]=_0xcbe3('0x2b');_0xf0d292[_0xcbe3('0x2c')]=_0xcbe3('0x2d');_0xf0d292[_0xcbe3('0x2e')]=0x0;_0xf0d292[_0xcbe3('0x2f')]=0x1;_0xf0d292[_0xcbe3('0x30')]=_0x2a53e0[_0xcbe3('0x29')];_0xf0d292['queuecallerexitreason']=_0xcbe3('0x31');return BPromise[_0xcbe3('0xb')]()[_0xcbe3('0x13')](voiceQueueReport[_0xcbe3('0x32')](_0xf0d292))[_0xcbe3('0xd')](loggerCatch(_0xcbe3('0x33')));};exports[_0xcbe3('0x34')]=function(_0x2a2b5b,_0x55e8ca){return BPromise['resolve']()[_0xcbe3('0x13')](cmHopper[_0xcbe3('0x34')](_0x2a2b5b,_0x55e8ca))[_0xcbe3('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x3c724a){return cmHopper[_0xcbe3('0x18')](_0x3c724a,!![],!![])[_0xcbe3('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xf78a=['[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','rescheduleContact','UserId','active','[rescheduleContact]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','checkIsBlackList'];(function(_0x3611ca,_0x4620b0){var _0x36912b=function(_0x50fb92){while(--_0x50fb92){_0x3611ca['push'](_0x3611ca['shift']());}};_0x36912b(++_0x4620b0);}(_0xf78a,0x136));var _0xaf78=function(_0x509c83,_0x511882){_0x509c83=_0x509c83-0x0;var _0x534626=_0xf78a[_0x509c83];return _0x534626;};'use strict';var util=require(_0xaf78('0x0'));var BPromise=require('bluebird');var logger=require(_0xaf78('0x1'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0xaf78('0x2'));var voiceQueueReport=require(_0xaf78('0x3'));function loggerCatch(_0x2bc380){return function(_0x5cb29d){logger[_0xaf78('0x4')](_0x2bc380,util['inspect'](_0x5cb29d,{'showHidden':![],'depth':null}));};}function create(_0x1fa34e){return cmHopperHistory[_0xaf78('0x5')](_0x1fa34e)[_0xaf78('0x6')](loggerCatch(_0xaf78('0x7')));}function createAgent(_0x2d3f0e){return BPromise[_0xaf78('0x8')]()[_0xaf78('0x9')](agentReportPreview['createHistory'](_0x2d3f0e))[_0xaf78('0x6')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x545aca){return cmHopper[_0xaf78('0xa')](_0x545aca,!![])[_0xaf78('0x6')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xaf78('0xb')]=function(_0x213307){return cmHopperBlack[_0xaf78('0xb')](_0x213307)[_0xaf78('0x6')](loggerCatch(_0xaf78('0xc')));};exports[_0xaf78('0xd')]=function(_0x7e8d79){return BPromise[_0xaf78('0x8')]()[_0xaf78('0x9')](cmHopper[_0xaf78('0xd')](_0x7e8d79))['catch'](loggerCatch(_0xaf78('0xe')));};exports[_0xaf78('0x5')]=function(_0x7d769b,_0x542160){create(_0x7d769b)[_0xaf78('0x6')](loggerCatch(_0x542160));moveContact(_0x7d769b)[_0xaf78('0x6')](loggerCatch(_0x542160));};exports['createAgentHistory']=function(_0x55459a,_0x3d4507){createAgent(_0x55459a)['catch'](loggerCatch(_0x3d4507));};exports['createCustomerHistory']=function(_0x12aa49,_0x325ec9){create(_0x12aa49)[_0xaf78('0x6')](loggerCatch(_0x325ec9));};exports['createCustomerFinal']=function(_0x543301,_0x1f412b){moveContact(_0x543301)['catch'](loggerCatch(_0x1f412b));};exports[_0xaf78('0xf')]=function(_0x37100e,_0x1acecb,_0x35dea6){if(_0x1acecb){_0x37100e[_0xaf78('0x10')]=null;}if(_0x35dea6){_0x37100e[_0xaf78('0x11')]=![];}return cmHopper[_0xaf78('0xf')](_0x37100e)['catch'](loggerCatch(_0xaf78('0x12')));};exports['countReScheduled']=function(_0x429926){return cmHopper['countReScheduled'](_0x429926)[_0xaf78('0x6')](loggerCatch('[countReScheduled]\x20'));};exports[_0xaf78('0x13')]=function(_0x846f98){return cmHopper[_0xaf78('0x13')]({'UserId':null},_0x846f98,0x1)[_0xaf78('0x6')](loggerCatch('[unlockContact]\x20'));};exports[_0xaf78('0x14')]=function(_0x5dc0b8){return cmHopper[_0xaf78('0x13')]({'active':![]},_0x5dc0b8,0x1)[_0xaf78('0x6')](loggerCatch(_0xaf78('0x15')));};exports[_0xaf78('0x16')]=function(_0x4e2587){var _0x4a5a4d={};_0x4a5a4d['type']=_0x4e2587[_0xaf78('0x17')];_0x4a5a4d[_0xaf78('0x18')]=_0x4e2587['uniqueid'];_0x4a5a4d[_0xaf78('0x19')]=_0x4e2587[_0xaf78('0x19')];_0x4a5a4d[_0xaf78('0x1a')]=_0x4e2587[_0xaf78('0x1a')];_0x4a5a4d['queue']=_0x4e2587['queue'];_0x4a5a4d[_0xaf78('0x1b')]=_0x4e2587[_0xaf78('0x1c')];_0x4a5a4d['queuecallerleaveAt']=_0x4e2587[_0xaf78('0x1c')];_0x4a5a4d[_0xaf78('0x1d')]=0x1;_0x4a5a4d[_0xaf78('0x1e')]=_0x4e2587[_0xaf78('0x1f')];_0x4a5a4d[_0xaf78('0x20')]=_0x4e2587[_0xaf78('0x21')];_0x4a5a4d[_0xaf78('0x22')]=_0xaf78('0x23');_0x4a5a4d['exten']=_0xaf78('0x24');_0x4a5a4d[_0xaf78('0x25')]=0x0;_0x4a5a4d[_0xaf78('0x26')]=0x1;_0x4a5a4d['lastAssignedTo']=_0x4e2587[_0xaf78('0x21')];_0x4a5a4d[_0xaf78('0x27')]=_0xaf78('0x28');return BPromise['resolve']()[_0xaf78('0x9')](voiceQueueReport[_0xaf78('0x29')](_0x4a5a4d))[_0xaf78('0x6')](loggerCatch(_0xaf78('0x2a')));};exports[_0xaf78('0x2b')]=function(_0xd5dfa0,_0x26717b){return BPromise[_0xaf78('0x8')]()[_0xaf78('0x9')](cmHopper[_0xaf78('0x2b')](_0xd5dfa0,_0x26717b))[_0xaf78('0x6')](loggerCatch(_0xaf78('0x2c')));};exports['rescheduleContactInQueue']=function(_0x5ac4d1){return cmHopper[_0xaf78('0xf')](_0x5ac4d1,!![],!![])[_0xaf78('0x6')](loggerCatch(_0xaf78('0x2d')));}; \ 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 681b27f..54b0b9a 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 _0x4376=['dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','getSeconds','logLookAgent','membername','UserId','talktime','answertime','Failure','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','interface','agentReadyId','reachable','push','milliseconds','seconds','CampaignId','filterKey','type','campaigntype','dialAnswer','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','inspect','logger','info','error','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)'];(function(_0x342149,_0x4372df){var _0x45505a=function(_0x2d045f){while(--_0x2d045f){_0x342149['push'](_0x342149['shift']());}};_0x45505a(++_0x4372df);}(_0x4376,0x18e));var _0x6437=function(_0x4dced6,_0x143c14){_0x4dced6=_0x4dced6-0x0;var _0x21c499=_0x4376[_0x4dced6];return _0x21c499;};'use strict';var util=require(_0x6437('0x0'));var _=require(_0x6437('0x1'));var moment=require(_0x6437('0x2'));var logger=require(_0x6437('0x3'))(_0x6437('0x4'));var ipAgi=process['env'][_0x6437('0x5')]||_0x6437('0x6');var utils=require(_0x6437('0x7'));exports['loggerCatch']=function(_0x15e575){return function(_0x3022e4){logger['error'](_0x15e575,util[_0x6437('0x8')](_0x3022e4,{'showHidden':![],'depth':null}));};};exports[_0x6437('0x9')]=function(_0x17f99f,_0x56c250){logger[_0x6437('0xa')](_0x17f99f,util[_0x6437('0x8')](_0x56c250,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0xc514c8,_0x1d8a2f){logger[_0x6437('0xb')](_0xc514c8,util[_0x6437('0x8')](_0x1d8a2f,{'showHidden':![],'depth':null}));};exports[_0x6437('0xc')]=function(_0x22ff98){return function(_0x3243a4){logger[_0x6437('0xa')](_0x22ff98,util['inspect'](_0x3243a4,{'showHidden':![],'depth':null}));};};exports[_0x6437('0xd')]=function(_0x2e7144,_0x4839c6,_0x2cb892){return{'message':_0x2e7144,'unlock':_0x4839c6,'active':_0x2cb892};};exports[_0x6437('0xe')]=function(_0x476786,_0x119112,_0x1aa4ec){if(!_['isUndefined'](_0x1aa4ec)&&_0x6437('0xf')===typeof _0x1aa4ec&&!_[_0x6437('0x10')](_0x1aa4ec)){if(!_[_0x6437('0x11')](_0x119112)&&_0x6437('0xf')===typeof _0x119112&&!_['isEmpty'](_0x119112)){return util[_0x6437('0x12')](_0x6437('0x13'),_0x119112,_0x1aa4ec);}return util[_0x6437('0x12')](_0x6437('0x13'),_0x1aa4ec,_0x1aa4ec);}if(!_[_0x6437('0x11')](_0x476786)&&_0x6437('0xf')===typeof _0x476786&&!_['isEmpty'](_0x476786)){return _0x476786;}return _0x6437('0x14');};exports[_0x6437('0x15')]=function(_0x199e49){if(_[_0x6437('0x16')](_0x199e49)){return![];}return _0x199e49;};exports[_0x6437('0x17')]=function(_0x56bed1,_0x4a5c43,_0x813d6b,_0x4e1ebe,_0x2a8a21,_0x174dd8){var _0x4ab654={'XMD-QUEUE':_0x4a5c43[_0x6437('0x18')]?_0x4a5c43['Queue'][_0x6437('0x19')]:'','XMD-CALLERID':_0x4e1ebe,'XMD-CALLERID-PREVIEW':_0x174dd8?util[_0x6437('0x12')](_0x6437('0x13'),_0x174dd8[_0x6437('0x1a')],_0x174dd8[_0x6437('0x1b')]):_0x4e1ebe,'XMD-DIALID':_0x2a8a21,'XMD-CONTACTID':_0x4a5c43[_0x6437('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4e1ebe,'XMD-VOICEQUEUEID':_0x4a5c43[_0x6437('0x1d')],'XMD-DIALCHANNEL':_0x813d6b,'XMD-DIALTIMEOUT':_0x56bed1['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x6437('0x12')](_0x6437('0x1e'),_0x56bed1[_0x6437('0x1f')]?'g':'',_['isEmpty'](_0x56bed1[_0x6437('0x20')])?'':_0x6437('0x21')),'XMD-DIALURL':_0x56bed1[_0x6437('0x22')]||'','XMD-AGI':_0x56bed1[_0x6437('0x23')]?util[_0x6437('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x56bed1[_0x6437('0x23')]):'NONE','XMD-AGIAFTER':_0x56bed1[_0x6437('0x1f')]?util[_0x6437('0x12')](_0x6437('0x24'),ipAgi,_0x56bed1[_0x6437('0x1f')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x174dd8?_0x174dd8[_0x6437('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x174dd8?_0x174dd8['originatecalleridname']:'','XMD-DESTINATION':_0x6437('0x26'),'SIPADDHEADER':_0x6437('0x27')};if(!_[_0x6437('0x10')](_0x56bed1[_0x6437('0x20')])){_0x4ab654[util[_0x6437('0x12')]('%s',_0x6437('0x28'))]=_0x56bed1[_0x6437('0x20')];_0x4ab654[util[_0x6437('0x12')]('%s',_0x6437('0x29'))]=_0x2a8a21;}return _0x4ab654;};exports[_0x6437('0x2a')]=function(_0x39e9ad){var _0x2e742d={};for(var _0x15d6f1 in _0x39e9ad){if(_0x39e9ad[_0x6437('0x2b')](_0x15d6f1)){_0x2e742d[util[_0x6437('0x12')]('%s',_[_0x6437('0x2c')](_0x15d6f1))]=_0x39e9ad[_0x15d6f1];}}return{'variables':_0x2e742d};};exports[_0x6437('0x2d')]=function(_0x3b4869,_0x57807c){if(!_[_0x6437('0x16')](_0x3b4869)){if(_0x3b4869[_0x6437('0x2b')](_0x6437('0x2e'))){if(_0x3b4869['originated']>0x0){_0x3b4869['originated']-=0x1;}else{logger[_0x6437('0xb')](_0x6437('0x2f'),_0x57807c);}}}else{logger[_0x6437('0xb')](_0x6437('0x30'),_0x57807c);}};exports[_0x6437('0x31')]=function(_0x1580ec){var _0x474b8c=moment()['format'](_0x6437('0x32'));_0x1580ec['state']=0xd;_0x1580ec[_0x6437('0x33')]=_0x6437('0x34');_0x1580ec[_0x6437('0x35')]=_0x474b8c;_0x1580ec[_0x6437('0x36')]=_0x474b8c;_0x1580ec[_0x6437('0x37')]=_0x474b8c;};exports[_0x6437('0x38')]=function(_0x3507fb,_0x4a6633,_0x521cfb){var _0x17b194=moment()['format'](_0x6437('0x32'));_0x3507fb[_0x6437('0x39')]=_0x4a6633;_0x3507fb[_0x6437('0x33')]=_0x521cfb;_0x3507fb['responsetime']=_0x17b194;_0x3507fb[_0x6437('0x3a')]=utils[_0x6437('0x3b')](_0x3507fb[_0x6437('0x36')],_0x3507fb[_0x6437('0x35')]);};exports[_0x6437('0x3c')]=function(_0x1ac100,_0xd4b9ef,_0x51c24a){_0x1ac100[_0x6437('0x3d')]=_0xd4b9ef;_0x1ac100[_0x6437('0x3e')]=_0x51c24a;};exports['logCustomer']=function(_0x1e9e30,_0x42e173,_0x5ac21e){var _0x4ed9d6=moment()['format'](_0x6437('0x32'));_0x1e9e30['state']=_0x42e173;_0x1e9e30['statedesc']=_0x5ac21e;_0x1e9e30[_0x6437('0x36')]=_0x1e9e30['responsetime']?_0x1e9e30[_0x6437('0x36')]:_0x4ed9d6;_0x1e9e30[_0x6437('0x37')]=_0x1e9e30['endtime']?_0x1e9e30[_0x6437('0x37')]:_0x4ed9d6;_0x1e9e30[_0x6437('0x3a')]=utils[_0x6437('0x3b')](_0x1e9e30[_0x6437('0x36')]||0x0,_0x1e9e30['starttime']||0x0);_0x1e9e30[_0x6437('0x3f')]=_0x1e9e30['answertime']?utils[_0x6437('0x3b')](_0x1e9e30[_0x6437('0x37')],_0x1e9e30[_0x6437('0x40')]):0x0;};exports['isFailure']=function(_0x331f2f){return _0x331f2f===_0x6437('0x41');};exports['variablesAction']=function(_0x1a9352,_0x4f6f26,_0x3f938b,_0xce271a,_0x2d97d0){var _0x28429d=_0xce271a?'RECALL':_0x1a9352[_0x6437('0x1a')];_0x28429d=_0x2d97d0?_0x6437('0x42'):_0x28429d;return{'actionid':_0x1a9352[_0x6437('0x43')],'action':_0x6437('0x44'),'channel':_0x1a9352[_0x6437('0x45')],'callerid':util[_0x6437('0x12')](_0x6437('0x13'),_0x28429d,_0x1a9352[_0x6437('0x1b')]),'Exten':_0x6437('0x26'),'Context':'from-sip','Priority':'1','variable':_0x3f938b,'timeout':(_0x4f6f26[_0x6437('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1a9352[_0x6437('0x43')]};};exports[_0x6437('0x47')]=function(_0x2efb6a){return _0x2efb6a['countbusyretry']+_0x2efb6a[_0x6437('0x48')]+_0x2efb6a[_0x6437('0x49')]+_0x2efb6a[_0x6437('0x4a')]+_0x2efb6a[_0x6437('0x4b')];};exports[_0x6437('0x4c')]=function(_0x88c523){var _0xe165a=_[_0x6437('0x4d')](_0x88c523);_0xe165a['state']=0xf;_0xe165a['statedesc']=_0x6437('0x4e');return _0xe165a;};exports[_0x6437('0x4f')]=function(_0x190b80,_0x1bb861,_0x3e4404){var _0x1f804b={};_0x1f804b[_0x1bb861]=_0x190b80[_0x1bb861];_0x1f804b[_0x6437('0x50')]=![];_0x1f804b[_0x6437('0x51')]=moment()[_0x6437('0x52')](_0x3e4404,_0x6437('0x53'))[_0x6437('0x12')](_0x6437('0x32'));_0x1f804b['ContactId']=_0x190b80['ContactId'];_0x1f804b['ListId']=_0x190b80[_0x6437('0x54')];_0x1f804b['VoiceQueueId']=_0x190b80[_0x6437('0x1d')]||undefined;return _0x1f804b;};exports[_0x6437('0x55')]=function(_0x5a4211,_0x4a0fa7){if(!_[_0x6437('0x16')](_0x5a4211)){if(_0x5a4211[_0x6437('0x56')]>0x0){_0x5a4211['pTalking']-=0x1;}else{logger['error'](_0x4a0fa7,_0x6437('0x57'));}}else{logger['error'](_0x4a0fa7,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x6437('0x58')]=function(_0x444379){if(_0x444379<=0x0){return!![];}return![];};function buildObj(_0x429d2d,_0x1b5081,_0x2550e4){_0x429d2d[_0x6437('0x59')]=_0x1b5081;_0x429d2d[_0x6437('0x19')]=_0x429d2d[_0x6437('0x5a')];_0x429d2d['interface']=_0x429d2d[_0x6437('0x45')];_0x429d2d[_0x6437('0x5b')]=_0x6437('0x5c');if(_0x2550e4){_0x429d2d[_0x6437('0x5d')]=_0x2550e4[_0x6437('0x5d')];}return _0x429d2d;}exports[_0x6437('0x5e')]=buildObj;exports['buildAcw']=function(_0x59886c){var _0x4f1df2={};_0x4f1df2[_0x6437('0x5a')]=_0x59886c[_0x6437('0x5a')];_0x4f1df2[_0x6437('0x5f')]=_0x59886c[_0x6437('0x45')];_0x4f1df2[_0x6437('0x43')]=_0x59886c[_0x6437('0x43')];return _0x4f1df2;};exports[_0x6437('0x60')]=function(_0x497f42){var _0x2998aa=[];for(var _0x5c9a2e in _0x497f42){if(_0x497f42[_0x6437('0x2b')](_0x5c9a2e)){if(!_['isNil'](_0x497f42[_0x5c9a2e])&&_0x497f42[_0x5c9a2e]['state']==='not_inuse'&&_0x497f42[_0x5c9a2e]['status']===_0x6437('0x61')){_0x2998aa[_0x6437('0x62')](_0x497f42[_0x5c9a2e]['id']);}}}return _0x2998aa;};exports['getDiff']=function(_0x498482){var _0x4aed75=moment()[_0x6437('0x63')](0x0);var _0x5f50bd=moment(_0x498482)[_0x6437('0x63')](0x0);return _0x4aed75['diff'](_0x5f50bd,_0x6437('0x64'));};exports['createBody']=function(_0x33e9ad){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x33e9ad[_0x6437('0x1c')],'ListId':_0x33e9ad[_0x6437('0x54')],'VoiceQueueId':_0x33e9ad['VoiceQueueId']||undefined,'CampaignId':_0x33e9ad[_0x6437('0x65')]||undefined};};exports[_0x6437('0x66')]=function(_0x166aae){if(_0x166aae===_0x6437('0x43')||_0x166aae==='idContact'||_0x166aae===_0x6437('0x5a')||_0x166aae===_0x6437('0x67')||_0x166aae===_0x6437('0x68')||_0x166aae===_0x6437('0x69')||_0x166aae===_0x6437('0x3d')||_0x166aae===_0x6437('0x45')||_0x166aae==='calleridname'||_0x166aae===_0x6437('0x50')||_0x166aae==='calleridnum'||_0x166aae===_0x6437('0x51')||_0x166aae===_0x6437('0x6a')||_0x166aae===_0x6437('0x48')||_0x166aae===_0x6437('0x49')||_0x166aae===_0x6437('0x6b')||_0x166aae===_0x6437('0x6c')||_0x166aae===_0x6437('0x6d')||_0x166aae===_0x6437('0x6e')||_0x166aae===_0x6437('0x6f')||_0x166aae===_0x6437('0x1c')||_0x166aae===_0x6437('0x54')||_0x166aae===_0x6437('0x3e')||_0x166aae===_0x6437('0x1d')||_0x166aae===_0x6437('0x70')||_0x166aae==='xmd-voicequeueid'||_0x166aae==='xmd-queue'||_0x166aae===_0x6437('0x71')||_0x166aae===_0x6437('0x72')||_0x166aae===_0x6437('0x73')||_0x166aae===_0x6437('0x74')||_0x166aae===_0x6437('0x75')||_0x166aae==='xmd-dialid'||_0x166aae===_0x6437('0x76')||_0x166aae===_0x6437('0x77')||_0x166aae===_0x6437('0x78')||_0x166aae==='xmd-callerid'||_0x166aae===_0x6437('0x79')||_0x166aae===_0x6437('0x7a')||_0x166aae===_0x6437('0x7b')||_0x166aae==='rtpaudioqosbridged'||_0x166aae===_0x6437('0x7c')||_0x166aae===_0x6437('0x7d')||_0x166aae===_0x6437('0x7e')||_0x166aae==='rtpaudioqoslossbridged'||_0x166aae==='rtpaudioqosrtt'||_0x166aae===_0x6437('0x7f')||_0x166aae===_0x6437('0x7b')||_0x166aae===_0x6437('0x80')||_0x166aae===_0x6437('0x7c')||_0x166aae===_0x6437('0x7d')||_0x166aae===_0x6437('0x7e')||_0x166aae==='rtpaudioqoslossbridged'||_0x166aae==='rtpaudioqosrtt'||_0x166aae===_0x6437('0x7f')||_0x166aae===_0x6437('0x81')||_0x166aae===_0x6437('0x82')||_0x166aae===_0x6437('0x39')||_0x166aae===_0x6437('0x33')){return![];}return!![];};exports[_0x6437('0x83')]=function(_0x2787a8,_0x5330dc){var _0x8d23b9,_0x8d60fa,_0x5ca772;if(_0x5330dc<=0x0){_0x5330dc=0x1;}_0x8d23b9=new RegExp(_0x6437('0x84')+_0x5330dc+'}$');_0x8d60fa=Math[_0x6437('0x85')](0xa,_0x5330dc-0x1);_0x5ca772=Math['pow'](0xa,_0x5330dc)-0x1;return util['format']('%s',_[_0x6437('0x86')](_0x2787a8,_0x8d23b9,_['random'](_0x8d60fa,_0x5ca772)));};exports[_0x6437('0x87')]=function(_0x20cdde){var _0x148c19=_0x20cdde[_0x6437('0x88')](/"(.*?)"/);return _0x148c19?_0x148c19[0x1]:_0x20cdde;};exports[_0x6437('0x89')]=function(_0xcbe324){var _0x326775=_0xcbe324[_0x6437('0x88')](/<(.*?)>/);return _0x326775?_0x326775[0x1]:_0xcbe324;};function buildNoAnswerEventPayload(_0x2cf424,_0x3f2de7){var _0x43f335=buildObj(_0x2cf424,_0x6437('0x8a'));if(!_[_0x6437('0x10')](_0x3f2de7[_0x6437('0x8b')])){Object[_0x6437('0x8c')](_0x3f2de7[_0x6437('0x8b')])[_0x6437('0x8d')](function(_0x220bc4){_0x43f335[_0x220bc4[_0x6437('0x8e')]()]=_0x3f2de7[_0x6437('0x8b')][_0x220bc4];});}return _0x43f335;}exports[_0x6437('0x8f')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x5e70=['originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','buildObj','buildAcw','not_inuse','status','reachable','milliseconds','seconds','createBody','filterKey','idContact','type','campaigntype','dialAnswer','countcongestionretry','countnoanswerretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','extractCalleridNumber','match','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','info','inspect','loggerError','message','isEmpty','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','name','format','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','hasOwnProperty','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','endtime','logAgent','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer','responsetime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x5e70,0xda));var _0x05e7=function(_0x14cc9d,_0x138641){_0x14cc9d=_0x14cc9d-0x0;var _0x28fee3=_0x5e70[_0x14cc9d];return _0x28fee3;};'use strict';var util=require('util');var _=require(_0x05e7('0x0'));var moment=require(_0x05e7('0x1'));var logger=require(_0x05e7('0x2'))(_0x05e7('0x3'));var ipAgi=process[_0x05e7('0x4')][_0x05e7('0x5')]||_0x05e7('0x6');var utils=require(_0x05e7('0x7'));exports['loggerCatch']=function(_0x560099){return function(_0x4e5f54){logger['error'](_0x560099,util['inspect'](_0x4e5f54,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4772d8,_0x36b57d){logger[_0x05e7('0x8')](_0x4772d8,util[_0x05e7('0x9')](_0x36b57d,{'showHidden':![],'depth':null}));};exports[_0x05e7('0xa')]=function(_0x110fc0,_0x2c1333){logger['error'](_0x110fc0,util[_0x05e7('0x9')](_0x2c1333,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x35c0da){return function(_0x116128){logger[_0x05e7('0x8')](_0x35c0da,util[_0x05e7('0x9')](_0x116128,{'showHidden':![],'depth':null}));};};exports[_0x05e7('0xb')]=function(_0x52e884,_0x50a968,_0x56a12c){return{'message':_0x52e884,'unlock':_0x50a968,'active':_0x56a12c};};exports['getCallerId']=function(_0x1bcabb,_0x1f3fd6,_0x2b08ba){if(!_['isUndefined'](_0x2b08ba)&&'string'===typeof _0x2b08ba&&!_[_0x05e7('0xc')](_0x2b08ba)){if(!_['isUndefined'](_0x1f3fd6)&&_0x05e7('0xd')===typeof _0x1f3fd6&&!_['isEmpty'](_0x1f3fd6)){return util['format']('\x22%s\x22\x20<%s>',_0x1f3fd6,_0x2b08ba);}return util['format'](_0x05e7('0xe'),_0x2b08ba,_0x2b08ba);}if(!_['isUndefined'](_0x1bcabb)&&'string'===typeof _0x1bcabb&&!_[_0x05e7('0xc')](_0x1bcabb)){return _0x1bcabb;}return _0x05e7('0xf');};exports['isActive']=function(_0x52783d){if(_[_0x05e7('0x10')](_0x52783d)){return![];}return _0x52783d;};exports[_0x05e7('0x11')]=function(_0x8c924,_0x35877d,_0x15c632,_0x53a3b9,_0x35b788,_0x3879dd){var _0x31d6d4={'XMD-QUEUE':_0x35877d['Queue']?_0x35877d['Queue'][_0x05e7('0x12')]:'','XMD-CALLERID':_0x53a3b9,'XMD-CALLERID-PREVIEW':_0x3879dd?util[_0x05e7('0x13')](_0x05e7('0xe'),_0x3879dd[_0x05e7('0x14')],_0x3879dd[_0x05e7('0x15')]):_0x53a3b9,'XMD-DIALID':_0x35b788,'XMD-CONTACTID':_0x35877d[_0x05e7('0x16')],'XMD-CDRTYPE':_0x05e7('0x17'),'CALLERID(all)':_0x53a3b9,'XMD-VOICEQUEUEID':_0x35877d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x15c632,'XMD-DIALTIMEOUT':_0x8c924[_0x05e7('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0x05e7('0x13')](_0x05e7('0x19'),_0x8c924[_0x05e7('0x1a')]?'g':'',_[_0x05e7('0xc')](_0x8c924[_0x05e7('0x1b')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x8c924['dialPreviewUrl']||'','XMD-AGI':_0x8c924[_0x05e7('0x1c')]?util[_0x05e7('0x13')](_0x05e7('0x1d'),ipAgi,_0x8c924[_0x05e7('0x1c')]):_0x05e7('0x1e'),'XMD-AGIAFTER':_0x8c924['dialQueueProject2']?util[_0x05e7('0x13')](_0x05e7('0x1d'),ipAgi,_0x8c924[_0x05e7('0x1a')]):_0x05e7('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x3879dd?_0x3879dd[_0x05e7('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x3879dd?_0x3879dd[_0x05e7('0x20')]:'','XMD-DESTINATION':_0x05e7('0x21'),'SIPADDHEADER':_0x05e7('0x22')};if(!_[_0x05e7('0xc')](_0x8c924[_0x05e7('0x1b')])){_0x31d6d4[util['format']('%s',_0x05e7('0x23'))]=_0x8c924[_0x05e7('0x1b')];_0x31d6d4[util[_0x05e7('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x35b788;}if(_0x35877d&&_0x35877d[_0x05e7('0x24')]){for(var _0x4b87f0 in _0x35877d['Contact']){if(_0x35877d[_0x05e7('0x24')]['hasOwnProperty'](_0x4b87f0)){if(!_[_0x05e7('0x10')](_0x35877d[_0x05e7('0x24')][_0x4b87f0])&&_0x4b87f0!=='id'&&_0x4b87f0!==_0x05e7('0x25')&&_0x4b87f0!=='createdAt'&&_0x4b87f0!=='updatedAt'){_0x31d6d4[util[_0x05e7('0x13')](_0x05e7('0x26'),_0x05e7('0x27'),_[_0x05e7('0x28')](_0x4b87f0))]=_0x35877d['Contact'][_0x4b87f0];}}}}return _0x31d6d4;};exports[_0x05e7('0x29')]=function(_0x5bc907){var _0x1b6792={};for(var _0x409b12 in _0x5bc907){if(_0x5bc907['hasOwnProperty'](_0x409b12)){_0x1b6792[util[_0x05e7('0x13')]('%s',_[_0x05e7('0x2a')](_0x409b12))]=_0x5bc907[_0x409b12];}}return{'variables':_0x1b6792};};exports[_0x05e7('0x2b')]=function(_0x444512,_0x20cfa6){if(!_[_0x05e7('0x10')](_0x444512)){if(_0x444512[_0x05e7('0x2c')](_0x05e7('0x2d'))){if(_0x444512[_0x05e7('0x2d')]>0x0){_0x444512['originated']-=0x1;}else{logger[_0x05e7('0x2e')](_0x05e7('0x2f'),_0x20cfa6);}}}else{logger[_0x05e7('0x2e')](_0x05e7('0x30'),_0x20cfa6);}};exports['logBlacklist']=function(_0x241c90){var _0x41d2d3=moment()[_0x05e7('0x13')](_0x05e7('0x31'));_0x241c90[_0x05e7('0x32')]=0xd;_0x241c90[_0x05e7('0x33')]=_0x05e7('0x34');_0x241c90['starttime']=_0x41d2d3;_0x241c90['responsetime']=_0x41d2d3;_0x241c90[_0x05e7('0x35')]=_0x41d2d3;};exports[_0x05e7('0x36')]=function(_0x6c7d53,_0x33fda0,_0x11d3f4){var _0x128378=moment()[_0x05e7('0x13')](_0x05e7('0x31'));_0x6c7d53['state']=_0x33fda0;_0x6c7d53[_0x05e7('0x33')]=_0x11d3f4;_0x6c7d53['responsetime']=_0x128378;_0x6c7d53[_0x05e7('0x37')]=utils[_0x05e7('0x38')](_0x6c7d53['responsetime'],_0x6c7d53[_0x05e7('0x39')]);};exports[_0x05e7('0x3a')]=function(_0x9104fd,_0x4e6f1d,_0x298e8d){_0x9104fd[_0x05e7('0x3b')]=_0x4e6f1d;_0x9104fd[_0x05e7('0x3c')]=_0x298e8d;};exports[_0x05e7('0x3d')]=function(_0x4c3732,_0x265668,_0x382b47){var _0x4ec01b=moment()[_0x05e7('0x13')](_0x05e7('0x31'));_0x4c3732[_0x05e7('0x32')]=_0x265668;_0x4c3732[_0x05e7('0x33')]=_0x382b47;_0x4c3732[_0x05e7('0x3e')]=_0x4c3732[_0x05e7('0x3e')]?_0x4c3732[_0x05e7('0x3e')]:_0x4ec01b;_0x4c3732[_0x05e7('0x35')]=_0x4c3732[_0x05e7('0x35')]?_0x4c3732['endtime']:_0x4ec01b;_0x4c3732[_0x05e7('0x37')]=utils['getSeconds'](_0x4c3732[_0x05e7('0x3e')]||0x0,_0x4c3732[_0x05e7('0x39')]||0x0);_0x4c3732[_0x05e7('0x3f')]=_0x4c3732[_0x05e7('0x40')]?utils['getSeconds'](_0x4c3732[_0x05e7('0x35')],_0x4c3732[_0x05e7('0x40')]):0x0;};exports[_0x05e7('0x41')]=function(_0x56e30e){return _0x56e30e==='Failure';};exports[_0x05e7('0x42')]=function(_0x16aa34,_0x41b1dd,_0x189709,_0x26245f,_0x5cb4f2){var _0x43ed14=_0x26245f?_0x05e7('0x43'):_0x16aa34[_0x05e7('0x14')];_0x43ed14=_0x5cb4f2?_0x05e7('0x44'):_0x43ed14;return{'actionid':_0x16aa34[_0x05e7('0x45')],'action':_0x05e7('0x46'),'channel':_0x16aa34[_0x05e7('0x47')],'callerid':util[_0x05e7('0x13')](_0x05e7('0xe'),_0x43ed14,_0x16aa34['calleridnum']),'Exten':_0x05e7('0x21'),'Context':_0x05e7('0x48'),'Priority':'1','variable':_0x189709,'timeout':(_0x41b1dd[_0x05e7('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x16aa34['uniqueid']};};exports[_0x05e7('0x4a')]=function(_0x5bf278){return _0x5bf278[_0x05e7('0x4b')]+_0x5bf278['countcongestionretry']+_0x5bf278['countnoanswerretry']+_0x5bf278[_0x05e7('0x4c')]+_0x5bf278[_0x05e7('0x4d')];};exports[_0x05e7('0x4e')]=function(_0x2779aa){var _0x6bd78f=_['clone'](_0x2779aa);_0x6bd78f[_0x05e7('0x32')]=0xf;_0x6bd78f['statedesc']=_0x05e7('0x4f');return _0x6bd78f;};exports[_0x05e7('0x50')]=function(_0xce5fa7,_0x280f45,_0x3da4ec){var _0x4bf302={};_0x4bf302[_0x280f45]=_0xce5fa7[_0x280f45];_0x4bf302[_0x05e7('0x51')]=![];_0x4bf302[_0x05e7('0x52')]=moment()[_0x05e7('0x53')](_0x3da4ec,_0x05e7('0x54'))[_0x05e7('0x13')](_0x05e7('0x31'));_0x4bf302[_0x05e7('0x16')]=_0xce5fa7[_0x05e7('0x16')];_0x4bf302[_0x05e7('0x55')]=_0xce5fa7[_0x05e7('0x55')];_0x4bf302[_0x05e7('0x56')]=_0xce5fa7[_0x05e7('0x56')]||undefined;return _0x4bf302;};exports[_0x05e7('0x57')]=function(_0x5d3736,_0x43bdd3){if(!_['isNil'](_0x5d3736)){if(_0x5d3736[_0x05e7('0x58')]>0x0){_0x5d3736['pTalking']-=0x1;}else{logger[_0x05e7('0x2e')](_0x43bdd3,_0x05e7('0x59'));}}else{logger['error'](_0x43bdd3,_0x05e7('0x5a'));}};exports[_0x05e7('0x5b')]=function(_0xdeb392){if(_0xdeb392<=0x0){return!![];}return![];};function buildObj(_0x13a420,_0x2f9a63,_0x22c43b){_0x13a420[_0x05e7('0x5c')]=_0x2f9a63;_0x13a420[_0x05e7('0x12')]=_0x13a420[_0x05e7('0x5d')];_0x13a420[_0x05e7('0x5e')]=_0x13a420[_0x05e7('0x47')];_0x13a420['motionChannel']=_0x05e7('0x5f');if(_0x22c43b){_0x13a420[_0x05e7('0x60')]=_0x22c43b[_0x05e7('0x60')];}return _0x13a420;}exports[_0x05e7('0x61')]=buildObj;exports[_0x05e7('0x62')]=function(_0x1eb0d7){var _0x4efddb={};_0x4efddb[_0x05e7('0x5d')]=_0x1eb0d7[_0x05e7('0x5d')];_0x4efddb[_0x05e7('0x5e')]=_0x1eb0d7[_0x05e7('0x47')];_0x4efddb[_0x05e7('0x45')]=_0x1eb0d7[_0x05e7('0x45')];return _0x4efddb;};exports['agentReadyId']=function(_0x586353){var _0xd90bde=[];for(var _0x17a067 in _0x586353){if(_0x586353[_0x05e7('0x2c')](_0x17a067)){if(!_[_0x05e7('0x10')](_0x586353[_0x17a067])&&_0x586353[_0x17a067][_0x05e7('0x32')]===_0x05e7('0x63')&&_0x586353[_0x17a067][_0x05e7('0x64')]===_0x05e7('0x65')){_0xd90bde['push'](_0x586353[_0x17a067]['id']);}}}return _0xd90bde;};exports['getDiff']=function(_0x3d4b9e){var _0x1cdede=moment()['milliseconds'](0x0);var _0x41425c=moment(_0x3d4b9e)[_0x05e7('0x66')](0x0);return _0x1cdede['diff'](_0x41425c,_0x05e7('0x67'));};exports[_0x05e7('0x68')]=function(_0x2da27b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2da27b[_0x05e7('0x16')],'ListId':_0x2da27b[_0x05e7('0x55')],'VoiceQueueId':_0x2da27b['VoiceQueueId']||undefined,'CampaignId':_0x2da27b['CampaignId']||undefined};};exports[_0x05e7('0x69')]=function(_0x3b0ef7){if(_0x3b0ef7===_0x05e7('0x45')||_0x3b0ef7===_0x05e7('0x6a')||_0x3b0ef7===_0x05e7('0x5d')||_0x3b0ef7===_0x05e7('0x6b')||_0x3b0ef7===_0x05e7('0x6c')||_0x3b0ef7===_0x05e7('0x6d')||_0x3b0ef7===_0x05e7('0x3b')||_0x3b0ef7===_0x05e7('0x47')||_0x3b0ef7===_0x05e7('0x14')||_0x3b0ef7==='active'||_0x3b0ef7===_0x05e7('0x15')||_0x3b0ef7===_0x05e7('0x52')||_0x3b0ef7==='countbusyretry'||_0x3b0ef7===_0x05e7('0x6e')||_0x3b0ef7===_0x05e7('0x6f')||_0x3b0ef7===_0x05e7('0x70')||_0x3b0ef7===_0x05e7('0x71')||_0x3b0ef7==='callbackuniqueid'||_0x3b0ef7===_0x05e7('0x72')||_0x3b0ef7===_0x05e7('0x73')||_0x3b0ef7==='ContactId'||_0x3b0ef7===_0x05e7('0x55')||_0x3b0ef7===_0x05e7('0x3c')||_0x3b0ef7===_0x05e7('0x56')||_0x3b0ef7===_0x05e7('0x74')||_0x3b0ef7==='xmd-voicequeueid'||_0x3b0ef7==='xmd-queue'||_0x3b0ef7==='xmd-phone'||_0x3b0ef7==='xmd-listid'||_0x3b0ef7===_0x05e7('0x75')||_0x3b0ef7===_0x05e7('0x76')||_0x3b0ef7===_0x05e7('0x77')||_0x3b0ef7==='xmd-dialid'||_0x3b0ef7==='xmd-dialchannel'||_0x3b0ef7==='xmd-contactid'||_0x3b0ef7===_0x05e7('0x78')||_0x3b0ef7==='xmd-callerid'||_0x3b0ef7===_0x05e7('0x79')||_0x3b0ef7===_0x05e7('0x7a')||_0x3b0ef7===_0x05e7('0x7b')||_0x3b0ef7===_0x05e7('0x7c')||_0x3b0ef7===_0x05e7('0x7d')||_0x3b0ef7==='rtpaudioqosjitterbridged'||_0x3b0ef7===_0x05e7('0x7e')||_0x3b0ef7===_0x05e7('0x7f')||_0x3b0ef7===_0x05e7('0x80')||_0x3b0ef7===_0x05e7('0x81')||_0x3b0ef7==='rtpaudioqos'||_0x3b0ef7===_0x05e7('0x7c')||_0x3b0ef7==='rtpaudioqosjitter'||_0x3b0ef7===_0x05e7('0x82')||_0x3b0ef7===_0x05e7('0x7e')||_0x3b0ef7===_0x05e7('0x7f')||_0x3b0ef7==='rtpaudioqosrtt'||_0x3b0ef7===_0x05e7('0x81')||_0x3b0ef7===_0x05e7('0x83')||_0x3b0ef7===_0x05e7('0x84')||_0x3b0ef7===_0x05e7('0x32')||_0x3b0ef7===_0x05e7('0x33')){return![];}return!![];};exports[_0x05e7('0x85')]=function(_0x84e422,_0x1f0cd8){var _0x46ba3a,_0x750c5e,_0x4aebaa;if(_0x1f0cd8<=0x0){_0x1f0cd8=0x1;}_0x46ba3a=new RegExp(_0x05e7('0x86')+_0x1f0cd8+'}$');_0x750c5e=Math[_0x05e7('0x87')](0xa,_0x1f0cd8-0x1);_0x4aebaa=Math[_0x05e7('0x87')](0xa,_0x1f0cd8)-0x1;return util[_0x05e7('0x13')]('%s',_['replace'](_0x84e422,_0x46ba3a,_['random'](_0x750c5e,_0x4aebaa)));};exports[_0x05e7('0x88')]=function(_0x41e013){var _0x1064ea=_0x41e013['match'](/"(.*?)"/);return _0x1064ea?_0x1064ea[0x1]:_0x41e013;};exports[_0x05e7('0x89')]=function(_0x1d79a0){var _0x196765=_0x1d79a0[_0x05e7('0x8a')](/<(.*?)>/);return _0x196765?_0x196765[0x1]:_0x1d79a0;};function buildNoAnswerEventPayload(_0x29b682,_0x3478b9){var _0x217c25=buildObj(_0x29b682,'noanswer');if(!_['isEmpty'](_0x3478b9[_0x05e7('0x8b')])){Object[_0x05e7('0x8c')](_0x3478b9[_0x05e7('0x8b')])[_0x05e7('0x8d')](function(_0x8ea397){_0x217c25[_0x8ea397[_0x05e7('0x8e')]()]=_0x3478b9[_0x05e7('0x8b')][_0x8ea397];});}return _0x217c25;}exports[_0x05e7('0x8f')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index fe83494..c08f4f8 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 _0x8c9a=['voicequeuechannelredirect','string','boolean','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x8c9a,0x1e9));var _0xa8c9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8c9a[_0x3ab51d];return _0x29a04e;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xa8c9('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xa8c9('0x1'),'required':![]}};exports['queueremove']={'queue':{'type':_0xa8c9('0x0'),'required':!![]},'interface':{'type':_0xa8c9('0x0'),'required':!![]}};exports[_0xa8c9('0x2')]={'interface':{'type':_0xa8c9('0x0'),'required':!![]},'paused':{'type':_0xa8c9('0x1')},'reason':{'type':_0xa8c9('0x0'),'required':![]}};exports[_0xa8c9('0x3')]={'module':{'type':_0xa8c9('0x0'),'required':![]}};exports[_0xa8c9('0x4')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xa8c9('0x5')]={'uniqueid':{'type':_0xa8c9('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xa8c9('0x0')},'mixmonitorid':{'type':_0xa8c9('0x0')}};exports[_0xa8c9('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xa8c9('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xa8c9('0x0'),'required':!![]},'context':{'type':_0xa8c9('0x0')}}; \ No newline at end of file +var _0xeed9=['queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x1dff5d,_0x57c1d5){var _0x3ac2e8=function(_0xdbfdf0){while(--_0xdbfdf0){_0x1dff5d['push'](_0x1dff5d['shift']());}};_0x3ac2e8(++_0x57c1d5);}(_0xeed9,0x155));var _0x9eed=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xeed9[_0x2f1762];return _0x8ab21;};'use strict';exports[_0x9eed('0x0')]={'queue':{'type':_0x9eed('0x1'),'required':!![]},'interface':{'type':_0x9eed('0x1'),'required':!![]},'membername':{'type':_0x9eed('0x1'),'required':!![]},'penalty':{'type':_0x9eed('0x2'),'required':![]},'paused':{'type':_0x9eed('0x3'),'required':![]}};exports[_0x9eed('0x4')]={'queue':{'type':_0x9eed('0x1'),'required':!![]},'interface':{'type':_0x9eed('0x1'),'required':!![]}};exports[_0x9eed('0x5')]={'interface':{'type':_0x9eed('0x1'),'required':!![]},'paused':{'type':_0x9eed('0x3')},'reason':{'type':_0x9eed('0x1'),'required':![]}};exports[_0x9eed('0x6')]={'module':{'type':_0x9eed('0x1'),'required':![]}};exports[_0x9eed('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x9eed('0x8')]={'uniqueid':{'type':_0x9eed('0x1'),'required':!![]},'filename':{'type':_0x9eed('0x1')},'format':{'type':_0x9eed('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x9eed('0x9')]={'uniqueid':{'type':_0x9eed('0x1'),'required':!![]}};exports[_0x9eed('0xa')]={'uniqueid':{'type':_0x9eed('0x1'),'required':!![]},'exten':{'type':_0x9eed('0x1'),'required':!![]},'context':{'type':_0x9eed('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 31f4394..6b220cc 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 _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(_0x1a6395,_0x330e4d){var _0x1ac4b6=function(_0x52d73f){while(--_0x52d73f){_0x1a6395['push'](_0x1a6395['shift']());}};_0x1ac4b6(++_0x330e4d);}(_0x5f2f,0x73));var _0xf5f2=function(_0xfd424c,_0xe96502){_0xfd424c=_0xfd424c-0x0;var _0x5a5325=_0x5f2f[_0xfd424c];return _0x5a5325;};'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 +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(_0xc11eb7,_0x14c399){var _0x442a61=function(_0x2b9d70){while(--_0x2b9d70){_0xc11eb7['push'](_0xc11eb7['shift']());}};_0x442a61(++_0x14c399);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3cf7df,_0x43b053){_0x3cf7df=_0x3cf7df-0x0;var _0x52ca51=_0x5f2f[_0x3cf7df];return _0x52ca51;};'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 92baae3..78b4635 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 _0x233a=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x233a,0xfe));var _0xa233=function(_0x27734f,_0x5be8f5){_0x27734f=_0x27734f-0x0;var _0x330da2=_0x233a[_0x27734f];return _0x330da2;};'use strict';function mergeDBDataToRealtime(_0x4969c5,_0x3bc56e){var _0x65f6ac=Object[_0xa233('0x0')]({},_0x4969c5);for(var _0x16af28 in _0x3bc56e){if(_0x65f6ac[_0xa233('0x1')](_0x16af28)){_0x65f6ac[_0x16af28]=_0x3bc56e[_0x16af28];}}return _0x65f6ac;}exports[_0xa233('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xa6ff=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x53bf2d,_0x7eccdf){var _0x463bc9=function(_0x58dec6){while(--_0x58dec6){_0x53bf2d['push'](_0x53bf2d['shift']());}};_0x463bc9(++_0x7eccdf);}(_0xa6ff,0x1cd));var _0xfa6f=function(_0x26e123,_0x276a42){_0x26e123=_0x26e123-0x0;var _0x24b5de=_0xa6ff[_0x26e123];return _0x24b5de;};'use strict';function mergeDBDataToRealtime(_0x3649ed,_0x160aa5){var _0x3214ab=Object[_0xfa6f('0x0')]({},_0x3649ed);for(var _0x3fa184 in _0x160aa5){if(_0x3214ab[_0xfa6f('0x1')](_0x3fa184)){_0x3214ab[_0x3fa184]=_0x160aa5[_0x3fa184];}}return _0x3214ab;}exports[_0xfa6f('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index e5b3384..0bb10a5 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 _0xbfb4=['../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','name','interface','format','SIP/%s','length','connectedlinenum','accountcode','assigned','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','create','getAgentByInternal','keys','channel','split','calleridnum','outbound','internal','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','isNil','getCallType','UserId','membername','monitor','monitorFilename','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','util'];(function(_0xcb8e59,_0x571c83){var _0x572e67=function(_0x23f116){while(--_0x23f116){_0xcb8e59['push'](_0xcb8e59['shift']());}};_0x572e67(++_0x571c83);}(_0xbfb4,0x1e8));var _0x4bfb=function(_0x56e97f,_0x98746c){_0x56e97f=_0x56e97f-0x0;var _0x1bfd4e=_0xbfb4[_0x56e97f];return _0x1bfd4e;};'use strict';var _=require(_0x4bfb('0x0'));var moment=require('moment');var util=require(_0x4bfb('0x1'));var config=require(_0x4bfb('0x2'));var ami=require(_0x4bfb('0x3'));var RpcVoiceAgentReport=require(_0x4bfb('0x4'));var RpcVoiceCallReport=require(_0x4bfb('0x5'));var RpcVoiceDialReport=require(_0x4bfb('0x6'));var RpcMemberReport=require(_0x4bfb('0x7'));var RpcVoiceQueueReport=require(_0x4bfb('0x8'));var RpcVoiceRecording=require(_0x4bfb('0x9'));var RpcVoiceTransferReport=require(_0x4bfb('0xa'));var VoiceQueueReport=require(_0x4bfb('0xb'));var VoiceCallReport=require(_0x4bfb('0xc'));var VoiceAgentReport=require(_0x4bfb('0xd'));var VoiceDialReport=require(_0x4bfb('0xe'));var UserReport=require(_0x4bfb('0xf'));function Report(_0xbf177e){this['realtime']=_0xbf177e;this['agents']=_0xbf177e[_0x4bfb('0x10')];this[_0x4bfb('0x11')]=_0xbf177e[_0x4bfb('0x11')];}Report[_0x4bfb('0x12')][_0x4bfb('0x13')]=function(_0x471e9d){var _0xaba7bd=new VoiceQueueReport(this['realtime']);var _0x5172da=new VoiceAgentReport(this['realtime']);var _0x4df64d=new VoiceDialReport(this['realtime']);var _0x389cc0=new VoiceCallReport(this[_0x4bfb('0x14')]);var _0x224cdf=new UserReport(this['realtime']);if(config[_0x4bfb('0x15')]&&config[_0x4bfb('0x15')]['disabled']){ami['on'](_0x4bfb('0x16'),this[_0x4bfb('0x17')]['bind'](this));ami['on'](_0x4bfb('0x18'),this[_0x4bfb('0x19')][_0x4bfb('0x1a')](this));ami['on']('custom:voiceAgentReport',this[_0x4bfb('0x1b')][_0x4bfb('0x1a')](this));ami['on'](_0x4bfb('0x1c'),this[_0x4bfb('0x1d')]['bind'](this));ami['on'](_0x4bfb('0x1e'),this[_0x4bfb('0x1f')][_0x4bfb('0x1a')](this));ami['on'](_0x4bfb('0x20'),this[_0x4bfb('0x21')][_0x4bfb('0x1a')](this));}};Report[_0x4bfb('0x12')][_0x4bfb('0x22')]=function(_0x301b12){var _0x1780cf;_0x1780cf=_[_0x4bfb('0x23')](this['agents'],function(_0x1cdce7){return _0x1cdce7['accountcode']==_0x301b12||_0x1cdce7['name']==_0x301b12;});if(_['isNil'](_0x1780cf)){var _0x1e35cd=_['find'](this[_0x4bfb('0x11')],function(_0x3216fe){return _0x3216fe['accountcode']==_0x301b12||_0x3216fe[_0x4bfb('0x24')]==_0x301b12;});if(_0x1e35cd){_0x1780cf=_[_0x4bfb('0x23')](this['agents'],function(_0x49d629){return _0x49d629[_0x4bfb('0x25')]==util[_0x4bfb('0x26')](_0x4bfb('0x27'),_0x1e35cd[_0x4bfb('0x24')]);});}}return _0x1780cf;};Report[_0x4bfb('0x12')][_0x4bfb('0x17')]=function(_0x549efb){for(var _0xe72f2a=0x0;_0xe72f2a<_0x549efb[_0x4bfb('0x28')];_0xe72f2a+=0x1){var _0xcafdb9=this[_0x4bfb('0x22')](_0x549efb[_0xe72f2a][_0x4bfb('0x29')]);if(_0xcafdb9){_0x549efb[_0xe72f2a][_0x4bfb('0x2a')]=_0xcafdb9[_0x4bfb('0x2a')];_0x549efb[_0xe72f2a][_0x4bfb('0x2b')]=!![];_0x549efb[_0xe72f2a]['lastAssignedTo']=_0xcafdb9[_0x4bfb('0x24')];_0x549efb[_0xe72f2a]['interface']=_['isNil'](_0xcafdb9['interface'])?util[_0x4bfb('0x26')](_0x4bfb('0x27'),_0xcafdb9[_0x4bfb('0x24')]):_0xcafdb9['interface'];if(_0x549efb[_0xe72f2a][_0x4bfb('0x2c')]){_0x549efb[_0xe72f2a][_0x4bfb('0x2d')]=moment()[_0x4bfb('0x26')](_0x4bfb('0x2e'));}if(_0x549efb[_0xe72f2a]['queuecallerexit']){_0x549efb[_0xe72f2a]['queuecallerexitAt']=moment()[_0x4bfb('0x26')](_0x4bfb('0x2e'));}RpcMemberReport['voiceQueueReport'](_0x549efb[_0xe72f2a]);}RpcVoiceQueueReport[_0x4bfb('0x2f')](_0x549efb[_0xe72f2a]);}};function extractCalleridNumber(_0x2ca3b9){var _0x188fb4=_0x2ca3b9['match'](/<(.*?)>/);return _0x188fb4?_0x188fb4[0x1]:_0x2ca3b9;}Report[_0x4bfb('0x12')][_0x4bfb('0x30')]=function(_0x29af0a){for(var _0x527f62=0x0;_0x527f62','calleridname','transfers','linkedid','type','UserId','membername','monitor','monitors','createdAt','exten','xcally-motion-preview','connectedlinename','xcally-motion-dialer','indexOf','mobile','phone','substring','lodash','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind'];(function(_0x982244,_0x4aca5f){var _0x550589=function(_0x523876){while(--_0x523876){_0x982244['push'](_0x982244['shift']());}};_0x550589(++_0x4aca5f);}(_0x56c1,0xe8));var _0x156c=function(_0x571ec1,_0x45684b){_0x571ec1=_0x571ec1-0x0;var _0xb02e0=_0x56c1[_0x571ec1];return _0xb02e0;};'use strict';var _=require(_0x156c('0x0'));var moment=require('moment');var util=require(_0x156c('0x1'));var config=require(_0x156c('0x2'));var ami=require(_0x156c('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x156c('0x4'));var RpcVoiceDialReport=require(_0x156c('0x5'));var RpcMemberReport=require(_0x156c('0x6'));var RpcVoiceQueueReport=require(_0x156c('0x7'));var RpcVoiceRecording=require(_0x156c('0x8'));var RpcVoiceTransferReport=require(_0x156c('0x9'));var VoiceQueueReport=require(_0x156c('0xa'));var VoiceCallReport=require(_0x156c('0xb'));var VoiceAgentReport=require(_0x156c('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x6eb8bf){this[_0x156c('0xd')]=_0x6eb8bf;this[_0x156c('0xe')]=_0x6eb8bf[_0x156c('0xe')];this[_0x156c('0xf')]=_0x6eb8bf[_0x156c('0xf')];}Report[_0x156c('0x10')][_0x156c('0x11')]=function(_0x3695b8){var _0xdd3edb=new VoiceQueueReport(this[_0x156c('0xd')]);var _0x470d68=new VoiceAgentReport(this[_0x156c('0xd')]);var _0x210f68=new VoiceDialReport(this['realtime']);var _0x10d670=new VoiceCallReport(this[_0x156c('0xd')]);var _0x49758c=new UserReport(this[_0x156c('0xd')]);if(config[_0x156c('0x12')]&&config[_0x156c('0x12')][_0x156c('0x13')]){ami['on'](_0x156c('0x14'),this[_0x156c('0x15')][_0x156c('0x16')](this));ami['on'](_0x156c('0x17'),this[_0x156c('0x18')][_0x156c('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0x156c('0x19')][_0x156c('0x16')](this));ami['on']('custom:voiceDialReport',this[_0x156c('0x1a')][_0x156c('0x16')](this));ami['on'](_0x156c('0x1b'),this[_0x156c('0x1c')]['bind'](this));ami['on'](_0x156c('0x1d'),this[_0x156c('0x1e')][_0x156c('0x16')](this));}};Report[_0x156c('0x10')][_0x156c('0x1f')]=function(_0x2e7435){var _0x23750f;_0x23750f=_[_0x156c('0x20')](this[_0x156c('0xe')],function(_0x46653d){return _0x46653d[_0x156c('0x21')]==_0x2e7435||_0x46653d[_0x156c('0x22')]==_0x2e7435;});if(_[_0x156c('0x23')](_0x23750f)){var _0x4cea32=_['find'](this[_0x156c('0xf')],function(_0xc8d201){return _0xc8d201['accountcode']==_0x2e7435||_0xc8d201[_0x156c('0x22')]==_0x2e7435;});if(_0x4cea32){_0x23750f=_['find'](this[_0x156c('0xe')],function(_0x409b72){return _0x409b72['interface']==util[_0x156c('0x24')](_0x156c('0x25'),_0x4cea32[_0x156c('0x22')]);});}}return _0x23750f;};Report[_0x156c('0x10')][_0x156c('0x15')]=function(_0x2fb896){for(var _0x2f5731=0x0;_0x2f5731<_0x2fb896[_0x156c('0x26')];_0x2f5731+=0x1){var _0x2348ec=this[_0x156c('0x1f')](_0x2fb896[_0x2f5731]['connectedlinenum']);if(_0x2348ec){_0x2fb896[_0x2f5731]['accountcode']=_0x2348ec[_0x156c('0x21')];_0x2fb896[_0x2f5731]['assigned']=!![];_0x2fb896[_0x2f5731]['lastAssignedTo']=_0x2348ec[_0x156c('0x22')];_0x2fb896[_0x2f5731][_0x156c('0x27')]=_[_0x156c('0x23')](_0x2348ec[_0x156c('0x27')])?util[_0x156c('0x24')]('SIP/%s',_0x2348ec[_0x156c('0x22')]):_0x2348ec['interface'];if(_0x2fb896[_0x2f5731][_0x156c('0x28')]){_0x2fb896[_0x2f5731][_0x156c('0x29')]=moment()[_0x156c('0x24')](_0x156c('0x2a'));}if(_0x2fb896[_0x2f5731]['queuecallerexit']){_0x2fb896[_0x2f5731][_0x156c('0x2b')]=moment()[_0x156c('0x24')](_0x156c('0x2a'));}RpcMemberReport[_0x156c('0x15')](_0x2fb896[_0x2f5731]);}RpcVoiceQueueReport[_0x156c('0x2c')](_0x2fb896[_0x2f5731]);}};function extractCalleridNumber(_0x391686){var _0x333304=_0x391686[_0x156c('0x2d')](/<(.*?)>/);return _0x333304?_0x333304[0x1]:_0x391686;}Report[_0x156c('0x10')][_0x156c('0x2e')]=function(_0x18108c){for(var _0xa8243b=0x0;_0xa8243b0x0?!![]:![];if(!_0x1f9ec2){return this['syncQueueSummaryComplete'](this[_0x69a6('0x48')][_0x69a6('0x6d')]);}};VoiceQueueReport[_0x69a6('0x3c')][_0x69a6('0x1b')]=function(_0x10880e){var _0x3c1ebc=this[_0x69a6('0x48')]['id'];if(this[_0x69a6('0x48')][_0x69a6('0x61')][_0x3c1ebc]&&this[_0x69a6('0x48')][_0x69a6('0x61')][_0x3c1ebc][_0x10880e[_0x69a6('0x60')]]){this[_0x69a6('0x48')]['queuestatus'][_0x3c1ebc][_0x10880e[_0x69a6('0x60')]]['agents']['push'](_0x10880e);}};VoiceQueueReport['prototype'][_0x69a6('0x17')]=function(_0x208dc2){var _0x2690e4=this;try{if(this[_0x69a6('0x6e')](_0x208dc2)&&this[_0x69a6('0x6e')](_0x208dc2[_0x69a6('0x50')])){logger[_0x69a6('0x4d')](_0x69a6('0x6f'),util[_0x69a6('0x43')](_0x208dc2,{'showHidden':![],'depth':null}));var _0x52f417=this['voiceQueues'][_0x208dc2[_0x69a6('0x50')]];if(_0x52f417){logger['debug'](_0x69a6('0x70'),_0x52f417[_0x69a6('0x65')]);this[_0x69a6('0x48')][_0x69a6('0x64')][_0x52f417[_0x69a6('0x65')]]={'summaryEvent':_0x208dc2};this[_0x69a6('0x48')]['statusRequests']+=0x1;return ami[_0x69a6('0x3e')]({'action':_0x69a6('0x61'),'queue':_0x52f417[_0x69a6('0x65')]})[_0x69a6('0x5f')](function(_0x1f6ae5){if(!_0x2690e4['summary'][_0x69a6('0x61')][_0x208dc2[_0x69a6('0x60')]]){_0x2690e4[_0x69a6('0x48')][_0x69a6('0x61')][_0x208dc2[_0x69a6('0x60')]]={};}_0x2690e4[_0x69a6('0x48')]['queuestatus'][_0x208dc2[_0x69a6('0x60')]][_0x1f6ae5['actionid']]={'queue':_0x52f417[_0x69a6('0x65')],'agents':[]};})[_0x69a6('0x3f')](function(_0xc4b2c2){throw _0xc4b2c2;});}}}catch(_0x218260){logger['error'](_0x69a6('0x62'),util[_0x69a6('0x43')](_0x218260,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x69a6('0x19')]=function(_0x2c6db4){if(this[_0x69a6('0x48')]['statusRequests']>0x0){this[_0x69a6('0x48')][_0x69a6('0x6d')]=_0x2c6db4;return;}logger[_0x69a6('0x4d')](_0x69a6('0x71'),util[_0x69a6('0x43')](_0x2c6db4,{'showHidden':![],'depth':null}));this[_0x69a6('0x48')]=initializeSummary();ami[_0x69a6('0x4b')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x69a6('0x3c')][_0x69a6('0x1f')]=function(_0x84da1e){try{if(this[_0x69a6('0x6e')](_0x84da1e)){logger[_0x69a6('0x4d')](_0x69a6('0x72'),_0x84da1e[_0x69a6('0x4e')],util[_0x69a6('0x43')](_0x84da1e,{'showHidden':![],'depth':null}));if(_[_0x69a6('0x73')](this[_0x69a6('0xf')][_0x84da1e['uniqueid']])){this['queueReports'][_0x84da1e['uniqueid']]=[];}if(_['isUndefined'](this['channels'][_0x84da1e[_0x69a6('0x4e')]])){this[_0x69a6('0x12')][_0x84da1e[_0x69a6('0x4e')]]={};}var _0x27cfe3=new QueueReport();_0x27cfe3[_0x69a6('0x50')]=_0x84da1e[_0x69a6('0x50')];_0x27cfe3[_0x69a6('0x58')]=this[_0x69a6('0x13')][_0x27cfe3['queue']]&&this['voiceQueues'][_0x27cfe3['queue']]['type']?this[_0x69a6('0x13')][_0x27cfe3[_0x69a6('0x50')]]['type']||_0x69a6('0x59'):_0x69a6('0x59');_0x27cfe3[_0x69a6('0x74')]=moment()['format'](_0x69a6('0x75'));_0x27cfe3[_0x69a6('0x76')]=_0x84da1e['position'];_0x27cfe3[_0x69a6('0x77')]=_0x84da1e[_0x69a6('0x77')];_0x27cfe3['uniqueid']=_0x84da1e[_0x69a6('0x4e')];_0x27cfe3[_0x69a6('0x78')]=this['channels'][_0x84da1e['uniqueid']][_0x69a6('0x78')];logger[_0x69a6('0x79')](_0x69a6('0x7a'),_0x27cfe3[_0x69a6('0x50')],_0x27cfe3['type']);Object['assign'](_0x27cfe3,_[_0x69a6('0x7b')](_0x84da1e,_['keys'](_0x27cfe3)));this[_0x69a6('0xf')][_0x84da1e['uniqueid']]['push'](_0x27cfe3);this['channels'][_0x84da1e[_0x69a6('0x4e')]]=_0x27cfe3;this[_0x69a6('0x4c')](_0x27cfe3,_0x69a6('0x1e'));}}catch(_0x4d0575){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x84da1e[_0x69a6('0x4e')],util[_0x69a6('0x43')](_0x4d0575,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69a6('0x3c')][_0x69a6('0x21')]=function(_0x42d44a){try{if(this['isNotNull'](_0x42d44a)){logger[_0x69a6('0x4d')]('[%s][voiceQueueReport][queuecallerabandon]',_0x42d44a[_0x69a6('0x4e')],util[_0x69a6('0x43')](_0x42d44a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x42d44a[_0x69a6('0x4e')]]){var _0xf26bd4=_[_0x69a6('0x7c')](this['queueReports'][_0x42d44a[_0x69a6('0x4e')]]);_0xf26bd4['queuecallercomplete']=![];_0xf26bd4[_0x69a6('0x7d')]=null;_0xf26bd4[_0x69a6('0x7e')]=_0x42d44a[_0x69a6('0x7e')];_0xf26bd4[_0x69a6('0x7f')]=_0x42d44a[_0x69a6('0x7f')];_0xf26bd4[_0x69a6('0x20')]=!![];_0xf26bd4['queuecallerabandonAt']=moment()[_0x69a6('0x4f')](_0x69a6('0x75'));_0xf26bd4[_0x69a6('0x80')]=_0x69a6('0x81');_0xf26bd4[_0x69a6('0x82')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0xf26bd4[_0x69a6('0x50')],_0xf26bd4['type']);this[_0x69a6('0x12')][_0x42d44a[_0x69a6('0x4e')]]=_0xf26bd4;this[_0x69a6('0x49')](_0xf26bd4,_0x69a6('0x20'));}}}catch(_0x282061){logger[_0x69a6('0x44')](_0x69a6('0x83'),_0x42d44a[_0x69a6('0x4e')],util[_0x69a6('0x43')](_0x282061,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x4f67c8){try{if(this[_0x69a6('0x6e')](_0x4f67c8)){logger[_0x69a6('0x4d')](_0x69a6('0x84'),_0x4f67c8['uniqueid'],util[_0x69a6('0x43')](_0x4f67c8,{'showHidden':![],'depth':null}));if(this[_0x69a6('0xf')][_0x4f67c8['uniqueid']]){var _0x4b221f=_[_0x69a6('0x7c')](this[_0x69a6('0xf')][_0x4f67c8[_0x69a6('0x4e')]]);_0x4b221f[_0x69a6('0x85')]=moment()[_0x69a6('0x4f')](_0x69a6('0x75'));_0x4b221f[_0x69a6('0x86')]=_0x4f67c8['connectedlinenum'];_0x4b221f[_0x69a6('0x87')]=_0x4f67c8['connectedlinename'];logger[_0x69a6('0x79')](_0x69a6('0x88'),_0x4b221f[_0x69a6('0x50')],_0x4b221f[_0x69a6('0x58')],_0x4f67c8['connectedlinenum'],_0x4f67c8[_0x69a6('0x87')]);this[_0x69a6('0x12')][_0x4f67c8['uniqueid']]=_0x4b221f;this['emitVoiceQueueChannelSave'](_0x4b221f,_0x69a6('0x22'));}}}catch(_0x52558f){logger[_0x69a6('0x44')]('[%s][voiceQueueReport][queuecallerleave]',_0x4f67c8[_0x69a6('0x4e')],util[_0x69a6('0x43')](_0x52558f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69a6('0x3c')][_0x69a6('0x25')]=function(_0x4a5984){try{if(this['isNotNull'](_0x4a5984)){logger[_0x69a6('0x4d')]('[%s][voiceQueueReport][agentconnect]',_0x4a5984[_0x69a6('0x4e')],util[_0x69a6('0x43')](_0x4a5984,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4a5984[_0x69a6('0x4e')]]){var _0x50788e=_['last'](this[_0x69a6('0xf')][_0x4a5984[_0x69a6('0x4e')]]);_0x50788e['queuecallercomplete']=!![];_0x50788e[_0x69a6('0x80')]='COMPLETEDBYAGENT';logger[_0x69a6('0x79')](_0x69a6('0x89'),_0x50788e['queue'],_0x50788e[_0x69a6('0x58')]);}}}catch(_0x521596){logger[_0x69a6('0x44')](_0x69a6('0x8a'),_0x4a5984[_0x69a6('0x4e')],util[_0x69a6('0x43')](_0x521596,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69a6('0x3c')][_0x69a6('0x8b')]=function(_0xe3def8){try{if(this[_0x69a6('0x6e')](_0xe3def8)){logger['debug'](_0x69a6('0x8c'),_0xe3def8['uniqueid'],util[_0x69a6('0x43')](_0xe3def8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xe3def8[_0x69a6('0x4e')]]){var _0x245db9=_[_0x69a6('0x7c')](this[_0x69a6('0xf')][_0xe3def8[_0x69a6('0x4e')]]);_0x245db9['queuecallerabandon']=![];_0x245db9['queuecallerabandonAt']=null;_0x245db9['assigned']=!![];_0x245db9[_0x69a6('0x82')]=_0xe3def8['membername'];_0x245db9[_0x69a6('0x7e')]=_0xe3def8['holdtime'];_0x245db9[_0x69a6('0x3b')]=!![];_0x245db9[_0x69a6('0x3a')]=![];_0x245db9[_0x69a6('0x8d')]=null;if(!_0x245db9[_0x69a6('0x8e')]){if(_0xe3def8[_0x69a6('0x8f')]==_0x69a6('0x8e')){_0x245db9['queuecallerexitreason']=_0x69a6('0x90');logger['info'](_0x69a6('0x91'),_0x245db9[_0x69a6('0x50')],_0x245db9['type']);}else{if(_[_0x69a6('0x92')](_0xe3def8[_0x69a6('0x93')][_0x69a6('0x94')](),_0x69a6('0x95'))){if(this['queueReports'][_0xe3def8[_0x69a6('0x96')]]){var _0x5010a3=_[_0x69a6('0x7c')](this['queueReports'][_0xe3def8[_0x69a6('0x96')]]);_0x5010a3[_0x69a6('0x3b')]=![];_0x5010a3[_0x69a6('0x3a')]=!![];_0x5010a3[_0x69a6('0x8d')]=moment(_0x245db9['queuecallerjoinAt'])['add'](_0xe3def8[_0x69a6('0x7e')],_0x69a6('0x97'))[_0x69a6('0x4f')](_0x69a6('0x75'));_0x5010a3[_0x69a6('0x80')]=_0x69a6('0x98');_0x5010a3['transfer']=!![];_0x5010a3[_0x69a6('0x99')]=_0x69a6('0x9a');_0x5010a3[_0x69a6('0x9b')]=_0xe3def8[_0x69a6('0x9c')];_0x5010a3[_0x69a6('0x9d')]=_0xe3def8[_0x69a6('0x4e')];logger[_0x69a6('0x79')](_0x69a6('0x9e'),_0x5010a3[_0x69a6('0x50')],_0x5010a3['type']);var _0x1b8bd9=this[_0x69a6('0xf')][_0xe3def8['linkedid']];this[_0x69a6('0xf')][_0xe3def8[_0x69a6('0x96')]]=this['queueReports'][_0xe3def8[_0x69a6('0x4e')]];this[_0x69a6('0xf')][_0xe3def8[_0x69a6('0x4e')]]=_0x1b8bd9;}}else{_0x245db9[_0x69a6('0x80')]='COMPLETEDBY'+_0xe3def8[_0x69a6('0x8f')][_0x69a6('0x9f')]();logger[_0x69a6('0x79')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x245db9['queue'],_0x245db9[_0x69a6('0x58')],_0x245db9[_0x69a6('0x80')]);}}}this[_0x69a6('0x12')][_0xe3def8[_0x69a6('0x4e')]]=_0x245db9;}}}catch(_0x34801f){logger[_0x69a6('0x44')](_0x69a6('0x8c'),_0xe3def8[_0x69a6('0x4e')],util[_0x69a6('0x43')](_0x34801f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69a6('0x3c')][_0x69a6('0x26')]=function(_0x19fcf5){try{if(this[_0x69a6('0x6e')](_0x19fcf5)){logger[_0x69a6('0x4d')](_0x69a6('0xa0'),_0x19fcf5['uniqueid'],util[_0x69a6('0x43')](_0x19fcf5,{'showHidden':![],'depth':null}));this[_0x69a6('0xa1')](_0x19fcf5[_0x69a6('0x4e')],_[_0x69a6('0xa2')](_0x19fcf5[_0x69a6('0xa3')])[0x0],_0x19fcf5[_0x69a6('0xa4')]);if(this['queueReports'][_0x19fcf5[_0x69a6('0x4e')]]){var _0x259207=_[_0x69a6('0x7c')](this[_0x69a6('0xf')][_0x19fcf5[_0x69a6('0x4e')]]);if(_0x259207){if(this[_0x69a6('0x6e')](_0x19fcf5[_0x69a6('0xa3')])&&this[_0x69a6('0x6e')](_0x19fcf5[_0x69a6('0xa3')][_0x69a6('0x61')])){switch(_0x19fcf5[_0x69a6('0xa4')]){case'CONTINUE':_0x259207[_0x69a6('0x3a')]=![];_0x259207['queuecallerexitAt']=null;break;case'TIMEOUT':_0x259207[_0x69a6('0xa5')]='timeout';_0x259207['queuecallerexit']=!![];_0x259207[_0x69a6('0x8d')]=moment()[_0x69a6('0x4f')](_0x69a6('0x75'));_0x259207[_0x69a6('0x85')]=moment()[_0x69a6('0x4f')](_0x69a6('0x75'));logger['debug'](_0x69a6('0xa6'),_0x19fcf5['uniqueid'],util['inspect'](_0x259207,{'showHidden':![],'depth':null}));ami[_0x69a6('0x4b')](_0x69a6('0xa7'),_0x259207);break;default:_0x259207[_0x69a6('0x3a')]=!![];_0x259207[_0x69a6('0x8d')]=moment()[_0x69a6('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x259207['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x259207[_0x69a6('0x20')]=![];_0x259207[_0x69a6('0xa8')]=null;_0x259207[_0x69a6('0x80')]=_0x19fcf5[_0x69a6('0xa4')];this['channels'][_0x19fcf5[_0x69a6('0x4e')]]=_0x259207;this['emitVoiceQueueChannelRemove'](_0x259207,_0x69a6('0xa9'));}else if(this[_0x69a6('0x6e')](_0x19fcf5[_0x69a6('0xa3')])&&this['isNotNull'](_0x19fcf5[_0x69a6('0xa3')][_0x69a6('0xaa')])){if(!_0x259207[_0x69a6('0x20')]){_0x259207[_0x69a6('0x3a')]=!![];_0x259207[_0x69a6('0x8d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x259207[_0x69a6('0x80')]=_0x69a6('0xab');_0x259207[_0x69a6('0x85')]=moment()[_0x69a6('0x4f')](_0x69a6('0x75'));this['channels'][_0x19fcf5[_0x69a6('0x4e')]]=_0x259207;}}logger[_0x69a6('0x79')](_0x69a6('0xac'),_0x19fcf5[_0x69a6('0x4e')],_0x259207[_0x69a6('0x50')],_0x259207[_0x69a6('0x58')],_[_0x69a6('0xa2')](_0x19fcf5[_0x69a6('0xa3')])[0x0],_0x19fcf5['value']);_0x259207[_0x69a6('0x15')]=this['variables'][_0x19fcf5[_0x69a6('0x4e')]];}}}}catch(_0x4be2cd){logger[_0x69a6('0x44')]('[%s][voiceQueueReport][varset]',_0x19fcf5[_0x69a6('0x4e')],util['inspect'](_0x4be2cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69a6('0x3c')][_0x69a6('0xa1')]=function(_0x57ce5a,_0x4b0e03,_0x96e268){var _0x1c665f=[_0x69a6('0xad'),_0x69a6('0xae'),'rtpaudioqosjitter',_0x69a6('0xaf'),'rtpaudioqosloss',_0x69a6('0xb0'),_0x69a6('0xb1'),_0x69a6('0xb2'),_0x69a6('0xb3'),_0x69a6('0xb4'),'bridgepeer',_0x69a6('0xb5'),_0x69a6('0xb6'),_0x69a6('0xb7'),_0x69a6('0xb8'),_0x69a6('0xb9'),_0x69a6('0xba'),_0x69a6('0xbb'),_0x69a6('0xbc')];if(!_['isNil'](_0x4b0e03)&&!_['includes'](_0x1c665f,_0x4b0e03)){if(_[_0x69a6('0x73')](this[_0x69a6('0x15')][_0x57ce5a])){this[_0x69a6('0x15')][_0x57ce5a]={};}this[_0x69a6('0x15')][_0x57ce5a][_0x4b0e03]=_0x96e268;}};VoiceQueueReport[_0x69a6('0x3c')]['handleHangup']=function(_0xe43654,_0x2ec0e4,_0x3ef132){try{var _0x1fba95={};if(this[_0x69a6('0xf')][_0xe43654]){for(var _0x1c4ec7=0x0;_0x1c4ec70x0?!![]:![];if(!_0x227225){return this[_0x5c04('0x17')](this[_0x5c04('0x46')]['completeEvent']);}};VoiceQueueReport['prototype'][_0x5c04('0x1a')]=function(_0xa210b8){var _0x51f34e=this['summary']['id'];if(this['summary'][_0x5c04('0x5d')][_0x51f34e]&&this['summary'][_0x5c04('0x5d')][_0x51f34e][_0xa210b8[_0x5c04('0x5e')]]){this[_0x5c04('0x46')][_0x5c04('0x5d')][_0x51f34e][_0xa210b8[_0x5c04('0x5e')]][_0x5c04('0xf')][_0x5c04('0x6c')](_0xa210b8);}};VoiceQueueReport[_0x5c04('0xa')][_0x5c04('0x6d')]=function(_0xe5c2b6){var _0x565693=this;try{if(this[_0x5c04('0x5a')](_0xe5c2b6)&&this[_0x5c04('0x5a')](_0xe5c2b6[_0x5c04('0x54')])){logger[_0x5c04('0x4a')](_0x5c04('0x6e'),util[_0x5c04('0x42')](_0xe5c2b6,{'showHidden':![],'depth':null}));var _0x588a8c=this['voiceQueues'][_0xe5c2b6['queue']];if(_0x588a8c){logger[_0x5c04('0x4a')](_0x5c04('0x6f'),_0x588a8c[_0x5c04('0x61')]);this[_0x5c04('0x46')]['queues'][_0x588a8c[_0x5c04('0x61')]]={'summaryEvent':_0xe5c2b6};this[_0x5c04('0x46')][_0x5c04('0x6b')]+=0x1;return ami['Action']({'action':_0x5c04('0x5d'),'queue':_0x588a8c[_0x5c04('0x61')]})['then'](function(_0x2aa724){if(!_0x565693[_0x5c04('0x46')]['queuestatus'][_0xe5c2b6[_0x5c04('0x5e')]]){_0x565693[_0x5c04('0x46')][_0x5c04('0x5d')][_0xe5c2b6[_0x5c04('0x5e')]]={};}_0x565693[_0x5c04('0x46')]['queuestatus'][_0xe5c2b6[_0x5c04('0x5e')]][_0x2aa724[_0x5c04('0x5e')]]={'queue':_0x588a8c[_0x5c04('0x61')],'agents':[]};})[_0x5c04('0x70')](function(_0x306b19){throw _0x306b19;});}}}catch(_0x5b92a7){logger[_0x5c04('0x3f')](_0x5c04('0x5f'),util[_0x5c04('0x42')](_0x5b92a7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5c04('0x17')]=function(_0x397d8b){if(this[_0x5c04('0x46')][_0x5c04('0x6b')]>0x0){this[_0x5c04('0x46')]['completeEvent']=_0x397d8b;return;}logger[_0x5c04('0x4a')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x397d8b,{'showHidden':![],'depth':null}));this[_0x5c04('0x46')]=initializeSummary();ami['emit'](_0x5c04('0x71'),{});};VoiceQueueReport['prototype'][_0x5c04('0x1e')]=function(_0x339cc8){try{if(this[_0x5c04('0x5a')](_0x339cc8)){logger[_0x5c04('0x4a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x339cc8[_0x5c04('0x4c')],util[_0x5c04('0x42')](_0x339cc8,{'showHidden':![],'depth':null}));if(_[_0x5c04('0x72')](this[_0x5c04('0xe')][_0x339cc8[_0x5c04('0x4c')]])){this[_0x5c04('0xe')][_0x339cc8[_0x5c04('0x4c')]]=[];}if(_['isUndefined'](this[_0x5c04('0x10')][_0x339cc8[_0x5c04('0x4c')]])){this[_0x5c04('0x10')][_0x339cc8[_0x5c04('0x4c')]]={};}var _0x2ba8ef=new QueueReport();_0x2ba8ef[_0x5c04('0x54')]=_0x339cc8[_0x5c04('0x54')];_0x2ba8ef[_0x5c04('0x57')]=this[_0x5c04('0x12')][_0x2ba8ef[_0x5c04('0x54')]]&&this['voiceQueues'][_0x2ba8ef[_0x5c04('0x54')]][_0x5c04('0x57')]?this[_0x5c04('0x12')][_0x2ba8ef[_0x5c04('0x54')]][_0x5c04('0x57')]||_0x5c04('0x58'):_0x5c04('0x58');_0x2ba8ef[_0x5c04('0x73')]=moment()[_0x5c04('0x52')](_0x5c04('0x74'));_0x2ba8ef[_0x5c04('0x75')]=_0x339cc8['position'];_0x2ba8ef[_0x5c04('0x76')]=_0x339cc8[_0x5c04('0x76')];_0x2ba8ef['uniqueid']=_0x339cc8[_0x5c04('0x4c')];_0x2ba8ef['routealias']=this[_0x5c04('0x10')][_0x339cc8[_0x5c04('0x4c')]]['routealias'];logger[_0x5c04('0x77')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2ba8ef[_0x5c04('0x54')],_0x2ba8ef[_0x5c04('0x57')]);Object['assign'](_0x2ba8ef,_[_0x5c04('0x78')](_0x339cc8,_[_0x5c04('0x79')](_0x2ba8ef)));this['queueReports'][_0x339cc8['uniqueid']][_0x5c04('0x6c')](_0x2ba8ef);this[_0x5c04('0x10')][_0x339cc8['uniqueid']]=_0x2ba8ef;this[_0x5c04('0x49')](_0x2ba8ef,_0x5c04('0x1d'));}}catch(_0x34197e){logger[_0x5c04('0x3f')](_0x5c04('0x7a'),_0x339cc8[_0x5c04('0x4c')],util[_0x5c04('0x42')](_0x34197e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5c04('0xa')][_0x5c04('0x20')]=function(_0x2b32b5){try{if(this['isNotNull'](_0x2b32b5)){logger[_0x5c04('0x4a')](_0x5c04('0x7b'),_0x2b32b5[_0x5c04('0x4c')],util['inspect'](_0x2b32b5,{'showHidden':![],'depth':null}));if(this[_0x5c04('0xe')][_0x2b32b5[_0x5c04('0x4c')]]){var _0x4735d0=_[_0x5c04('0x7c')](this['queueReports'][_0x2b32b5[_0x5c04('0x4c')]]);_0x4735d0['queuecallercomplete']=![];_0x4735d0[_0x5c04('0x7d')]=null;_0x4735d0[_0x5c04('0x7e')]=_0x2b32b5[_0x5c04('0x7e')];_0x4735d0[_0x5c04('0x7f')]=_0x2b32b5[_0x5c04('0x7f')];_0x4735d0[_0x5c04('0x1f')]=!![];_0x4735d0[_0x5c04('0x80')]=moment()[_0x5c04('0x52')](_0x5c04('0x74'));_0x4735d0[_0x5c04('0x50')]='ABANDONED';_0x4735d0[_0x5c04('0x81')]=null;logger[_0x5c04('0x77')](_0x5c04('0x82'),_0x4735d0[_0x5c04('0x54')],_0x4735d0[_0x5c04('0x57')]);this['channels'][_0x2b32b5[_0x5c04('0x4c')]]=_0x4735d0;this[_0x5c04('0x83')](_0x4735d0,_0x5c04('0x1f'));}}}catch(_0x7704b7){logger[_0x5c04('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2b32b5[_0x5c04('0x4c')],util[_0x5c04('0x42')](_0x7704b7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x7efb70){try{if(this[_0x5c04('0x5a')](_0x7efb70)){logger[_0x5c04('0x4a')](_0x5c04('0x84'),_0x7efb70[_0x5c04('0x4c')],util['inspect'](_0x7efb70,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x7efb70[_0x5c04('0x4c')]]){var _0x190a2f=_[_0x5c04('0x7c')](this[_0x5c04('0xe')][_0x7efb70['uniqueid']]);_0x190a2f[_0x5c04('0x85')]=moment()['format'](_0x5c04('0x74'));_0x190a2f['connectedlinenum']=_0x7efb70[_0x5c04('0x86')];_0x190a2f[_0x5c04('0x87')]=_0x7efb70[_0x5c04('0x87')];logger[_0x5c04('0x77')](_0x5c04('0x88'),_0x190a2f['queue'],_0x190a2f[_0x5c04('0x57')],_0x7efb70[_0x5c04('0x86')],_0x7efb70[_0x5c04('0x87')]);this[_0x5c04('0x10')][_0x7efb70[_0x5c04('0x4c')]]=_0x190a2f;this[_0x5c04('0x49')](_0x190a2f,_0x5c04('0x21'));}}}catch(_0x497f82){logger[_0x5c04('0x3f')](_0x5c04('0x84'),_0x7efb70[_0x5c04('0x4c')],util[_0x5c04('0x42')](_0x497f82,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5c04('0xa')]['syncAgentConnect']=function(_0x113db6){try{if(this['isNotNull'](_0x113db6)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x113db6['uniqueid'],util[_0x5c04('0x42')](_0x113db6,{'showHidden':![],'depth':null}));if(this[_0x5c04('0xe')][_0x113db6[_0x5c04('0x4c')]]){var _0x4b57c9=_[_0x5c04('0x7c')](this[_0x5c04('0xe')][_0x113db6['uniqueid']]);_0x4b57c9['queuecallercomplete']=!![];_0x4b57c9[_0x5c04('0x50')]=_0x5c04('0x89');logger[_0x5c04('0x77')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4b57c9['queue'],_0x4b57c9[_0x5c04('0x57')]);}}}catch(_0x213696){logger[_0x5c04('0x3f')](_0x5c04('0x8a'),_0x113db6['uniqueid'],util['inspect'](_0x213696,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5c04('0xa')][_0x5c04('0x23')]=function(_0x10475e){try{if(this[_0x5c04('0x5a')](_0x10475e)){logger[_0x5c04('0x4a')]('[%s][voiceQueueReport][agentcomplete]',_0x10475e[_0x5c04('0x4c')],util[_0x5c04('0x42')](_0x10475e,{'showHidden':![],'depth':null}));if(this[_0x5c04('0xe')][_0x10475e['uniqueid']]){var _0x4f9793=_[_0x5c04('0x7c')](this[_0x5c04('0xe')][_0x10475e[_0x5c04('0x4c')]]);_0x4f9793[_0x5c04('0x1f')]=![];_0x4f9793['queuecallerabandonAt']=null;_0x4f9793[_0x5c04('0x8b')]=!![];_0x4f9793[_0x5c04('0x81')]=_0x10475e['membername'];_0x4f9793['holdtime']=_0x10475e[_0x5c04('0x7e')];_0x4f9793[_0x5c04('0x37')]=!![];_0x4f9793['queuecallerexit']=![];_0x4f9793[_0x5c04('0x8c')]=null;if(!_0x4f9793[_0x5c04('0x8d')]){if(_0x10475e[_0x5c04('0x8e')]==_0x5c04('0x8d')){_0x4f9793['queuecallerexitreason']='COMPLETED';logger[_0x5c04('0x77')](_0x5c04('0x8f'),_0x4f9793[_0x5c04('0x54')],_0x4f9793['type']);}else{if(_[_0x5c04('0x90')](_0x10475e[_0x5c04('0x3c')]['toLowerCase'](),_0x5c04('0x91'))){if(this[_0x5c04('0xe')][_0x10475e['linkedid']]){var _0x563d63=_[_0x5c04('0x7c')](this[_0x5c04('0xe')][_0x10475e[_0x5c04('0x92')]]);_0x563d63[_0x5c04('0x37')]=![];_0x563d63['queuecallerexit']=!![];_0x563d63[_0x5c04('0x8c')]=moment(_0x4f9793['queuecallerjoinAt'])[_0x5c04('0x93')](_0x10475e[_0x5c04('0x7e')],_0x5c04('0x94'))['format'](_0x5c04('0x74'));_0x563d63[_0x5c04('0x50')]=_0x5c04('0x95');_0x563d63[_0x5c04('0x8d')]=!![];_0x563d63['transfertype']=_0x5c04('0x96');_0x563d63[_0x5c04('0x97')]=_0x10475e[_0x5c04('0x98')];_0x563d63[_0x5c04('0x99')]=_0x10475e[_0x5c04('0x4c')];logger[_0x5c04('0x77')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x563d63[_0x5c04('0x54')],_0x563d63[_0x5c04('0x57')]);var _0x49cb32=this['queueReports'][_0x10475e[_0x5c04('0x92')]];this['queueReports'][_0x10475e[_0x5c04('0x92')]]=this[_0x5c04('0xe')][_0x10475e[_0x5c04('0x4c')]];this[_0x5c04('0xe')][_0x10475e[_0x5c04('0x4c')]]=_0x49cb32;}}else{_0x4f9793[_0x5c04('0x50')]=_0x5c04('0x9a')+_0x10475e[_0x5c04('0x8e')][_0x5c04('0x9b')]();logger[_0x5c04('0x77')](_0x5c04('0x9c'),_0x4f9793['queue'],_0x4f9793[_0x5c04('0x57')],_0x4f9793[_0x5c04('0x50')]);}}}this['channels'][_0x10475e[_0x5c04('0x4c')]]=_0x4f9793;}}}catch(_0x481270){logger[_0x5c04('0x3f')](_0x5c04('0x9d'),_0x10475e[_0x5c04('0x4c')],util[_0x5c04('0x42')](_0x481270,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5c04('0xa')][_0x5c04('0x26')]=function(_0x18eafc){try{if(this['isNotNull'](_0x18eafc)){logger[_0x5c04('0x4a')](_0x5c04('0x9e'),_0x18eafc[_0x5c04('0x4c')],util[_0x5c04('0x42')](_0x18eafc,{'showHidden':![],'depth':null}));this[_0x5c04('0x9f')](_0x18eafc[_0x5c04('0x4c')],_[_0x5c04('0x79')](_0x18eafc['variable'])[0x0],_0x18eafc['value']);if(this['queueReports'][_0x18eafc['uniqueid']]){var _0x5e6987=_[_0x5c04('0x7c')](this[_0x5c04('0xe')][_0x18eafc[_0x5c04('0x4c')]]);if(_0x5e6987){if(this[_0x5c04('0x5a')](_0x18eafc[_0x5c04('0xa0')])&&this[_0x5c04('0x5a')](_0x18eafc[_0x5c04('0xa0')]['queuestatus'])){switch(_0x18eafc[_0x5c04('0xa1')]){case'CONTINUE':_0x5e6987[_0x5c04('0xa2')]=![];_0x5e6987[_0x5c04('0x8c')]=null;break;case _0x5c04('0xa3'):_0x5e6987['lastevent']=_0x5c04('0xa4');_0x5e6987[_0x5c04('0xa2')]=!![];_0x5e6987[_0x5c04('0x8c')]=moment()['format'](_0x5c04('0x74'));_0x5e6987[_0x5c04('0x85')]=moment()[_0x5c04('0x52')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x5c04('0x4a')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x18eafc['uniqueid'],util['inspect'](_0x5e6987,{'showHidden':![],'depth':null}));ami[_0x5c04('0x48')](_0x5c04('0xa5'),_0x5e6987);break;default:_0x5e6987[_0x5c04('0xa2')]=!![];_0x5e6987['queuecallerexitAt']=moment()['format'](_0x5c04('0x74'));_0x5e6987[_0x5c04('0x85')]=moment()[_0x5c04('0x52')](_0x5c04('0x74'));}_0x5e6987[_0x5c04('0x1f')]=![];_0x5e6987[_0x5c04('0x80')]=null;_0x5e6987[_0x5c04('0x50')]=_0x18eafc[_0x5c04('0xa1')];this['channels'][_0x18eafc[_0x5c04('0x4c')]]=_0x5e6987;this['emitVoiceQueueChannelRemove'](_0x5e6987,_0x5c04('0xa6'));}else if(this[_0x5c04('0x5a')](_0x18eafc[_0x5c04('0xa0')])&&this[_0x5c04('0x5a')](_0x18eafc[_0x5c04('0xa0')][_0x5c04('0xa7')])){if(!_0x5e6987[_0x5c04('0x1f')]){_0x5e6987[_0x5c04('0xa2')]=!![];_0x5e6987['queuecallerexitAt']=moment()[_0x5c04('0x52')](_0x5c04('0x74'));_0x5e6987[_0x5c04('0x50')]=_0x5c04('0xa8');_0x5e6987[_0x5c04('0x85')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x5c04('0x10')][_0x18eafc['uniqueid']]=_0x5e6987;}}logger['info'](_0x5c04('0xa9'),_0x18eafc[_0x5c04('0x4c')],_0x5e6987[_0x5c04('0x54')],_0x5e6987[_0x5c04('0x57')],_['keys'](_0x18eafc[_0x5c04('0xa0')])[0x0],_0x18eafc[_0x5c04('0xa1')]);_0x5e6987[_0x5c04('0x14')]=this['variables'][_0x18eafc['uniqueid']];}}}}catch(_0x58616){logger[_0x5c04('0x3f')](_0x5c04('0x9e'),_0x18eafc['uniqueid'],util[_0x5c04('0x42')](_0x58616,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5c04('0xa')][_0x5c04('0x9f')]=function(_0x29ca59,_0x5dae9e,_0x1e5ed7){var _0x2e4529=[_0x5c04('0xaa'),_0x5c04('0xab'),'rtpaudioqosjitter',_0x5c04('0xac'),_0x5c04('0xad'),_0x5c04('0xae'),_0x5c04('0xaf'),_0x5c04('0xb0'),_0x5c04('0xb1'),_0x5c04('0xb2'),_0x5c04('0xb3'),_0x5c04('0xb4'),_0x5c04('0xb5'),_0x5c04('0xb6'),_0x5c04('0xb7'),'memberlastcall','membername',_0x5c04('0xb8'),'memberrealtime'];if(!_['isNil'](_0x5dae9e)&&!_[_0x5c04('0xb9')](_0x2e4529,_0x5dae9e)){if(_['isUndefined'](this[_0x5c04('0x14')][_0x29ca59])){this['variables'][_0x29ca59]={};}this[_0x5c04('0x14')][_0x29ca59][_0x5dae9e]=_0x1e5ed7;}};VoiceQueueReport[_0x5c04('0xa')][_0x5c04('0xba')]=function(_0x17f2ed,_0x4083ef,_0x331241){var _0x5cf58f={};for(var _0x3f1189=0x0;_0x3f1189=0x0?moment(_0x38f6ca[_0x1b4a('0x1c')])['diff'](_0x38f6ca['starttime'],_0x1b4a('0x10')):null,'data1':_0x1b4a('0x1d'),'data2':_0x38f6ca['accountcode'],'data3':_0x38f6ca[_0x1b4a('0x12')],'data4':_0x38f6ca['dialstring']||null,'role':_0x1b4a('0x14'),'internal':_0x38f6ca[_0x1b4a('0x15')]?_['toNumber'](_0x38f6ca[_0x1b4a('0x15')]):undefined,'uniqueid':_0x38f6ca['uniqueid']},'log':_0x1b4a('0x7')});}; \ No newline at end of file +var _0x6cc9=['SIP/%s','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','toNumber','accountcode','voiceDialReport','TALKING','starttime','endtime','outbound','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x6cc9,0x1b5));var _0x96cc=function(_0x2937e3,_0x2a2875){_0x2937e3=_0x2937e3-0x0;var _0xc463fb=_0x6cc9[_0x2937e3];return _0xc463fb;};'use strict';var moment=require(_0x96cc('0x0'));var _=require(_0x96cc('0x1'));var util=require(_0x96cc('0x2'));var client=require(_0x96cc('0x3'));exports[_0x96cc('0x4')]=function(_0x454c6d){var _0x43b1a9=_0x454c6d[_0x96cc('0x5')]||_0x454c6d[_0x96cc('0x6')];return client[_0x96cc('0x7')](_0x96cc('0x8'),{'body':{'channel':_0x96cc('0x9'),'membername':_0x454c6d[_0x96cc('0xa')],'interface':_[_0x96cc('0xb')](_0x454c6d[_0x96cc('0xc')])?util['format'](_0x96cc('0xd'),_0x454c6d[_0x96cc('0xa')]):_0x454c6d[_0x96cc('0xc')],'type':'TALKING','enterAt':_0x454c6d[_0x96cc('0xe')],'exitAt':_0x43b1a9,'duration':moment(_0x43b1a9)[_0x96cc('0xf')](_0x454c6d['queuecallerleaveAt'],_0x96cc('0x10')),'data1':_0x96cc('0x11'),'data2':_0x454c6d[_0x96cc('0x12')],'data3':_0x454c6d[_0x96cc('0x13')],'data4':null,'data5':_0x454c6d[_0x96cc('0x14')],'role':_0x96cc('0x15'),'internal':_0x454c6d['accountcode']?_[_0x96cc('0x16')](_0x454c6d[_0x96cc('0x17')]):undefined,'uniqueid':_0x454c6d['uniqueid']},'log':_0x96cc('0x8')});};exports[_0x96cc('0x18')]=function(_0x551be5){return client['Request'](_0x96cc('0x8'),{'body':{'channel':_0x96cc('0x9'),'membername':_0x551be5['membername'],'interface':_0x551be5[_0x96cc('0xc')],'type':_0x96cc('0x19'),'enterAt':_0x551be5[_0x96cc('0x1a')],'exitAt':_0x551be5['endtime'],'duration':moment(_0x551be5['endtime'])[_0x96cc('0xf')](_0x551be5[_0x96cc('0x1a')],_0x96cc('0x10'))>=0x0?moment(_0x551be5[_0x96cc('0x1b')])[_0x96cc('0xf')](_0x551be5[_0x96cc('0x1a')],'seconds'):null,'data1':_0x96cc('0x1c'),'data2':_0x551be5['accountcode'],'data3':_0x551be5[_0x96cc('0x13')],'data4':_0x551be5[_0x96cc('0x1d')]||null,'role':_0x96cc('0x15'),'internal':_0x551be5[_0x96cc('0x17')]?_[_0x96cc('0x16')](_0x551be5[_0x96cc('0x17')]):undefined,'uniqueid':_0x551be5['uniqueid']},'log':_0x96cc('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 04340f2..350c177 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 _0x11e3=['ShowSetting','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x1516f0,_0x1eb87f){var _0x378104=function(_0x392a2b){while(--_0x392a2b){_0x1516f0['push'](_0x1516f0['shift']());}};_0x378104(++_0x1eb87f);}(_0x11e3,0x6f));var _0x311e=function(_0x415854,_0x2b79d2){_0x415854=_0x415854-0x0;var _0x467ad8=_0x11e3[_0x415854];return _0x467ad8;};'use strict';var client=require(_0x311e('0x0'));exports[_0x311e('0x1')]=function(){return client[_0x311e('0x2')](_0x311e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x311e('0x4')]},'log':_0x311e('0x5')});}; \ No newline at end of file +var _0xa19c=['Request','previewRecallmeReminderInterval','../client','getSettings'];(function(_0x14742f,_0x2bb4dc){var _0x354747=function(_0x5a0751){while(--_0x5a0751){_0x14742f['push'](_0x14742f['shift']());}};_0x354747(++_0x2bb4dc);}(_0xa19c,0xce));var _0xca19=function(_0x2bc077,_0x42b6ee){_0x2bc077=_0x2bc077-0x0;var _0x45aff0=_0xa19c[_0x2bc077];return _0x45aff0;};'use strict';var client=require(_0xca19('0x0'));exports[_0xca19('0x1')]=function(){return client[_0xca19('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xca19('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 3c7e887..0b658f0 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 _0xccc2=['../client','name','GetTemplate'];(function(_0x466a11,_0x5a2503){var _0x1fea40=function(_0x4df100){while(--_0x4df100){_0x466a11['push'](_0x466a11['shift']());}};_0x1fea40(++_0x5a2503);}(_0xccc2,0xa2));var _0x2ccc=function(_0x26478e,_0xa4ba6c){_0x26478e=_0x26478e-0x0;var _0x342471=_0xccc2[_0x26478e];return _0x342471;};'use strict';var client=require(_0x2ccc('0x0'));exports['getTemplates']=function(_0x5694e6){return function(_0x3a6f7c){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x2ccc('0x1'),'html']},'log':_0x2ccc('0x2')});};}; \ No newline at end of file +var _0x52e1=['GetTemplate','../client','getTemplates','Request','name','html'];(function(_0x5acc7b,_0x22adf0){var _0x58d32d=function(_0x36e7df){while(--_0x36e7df){_0x5acc7b['push'](_0x5acc7b['shift']());}};_0x58d32d(++_0x22adf0);}(_0x52e1,0x175));var _0x152e=function(_0x53c3dd,_0x583b9a){_0x53c3dd=_0x53c3dd-0x0;var _0x6dcf16=_0x52e1[_0x53c3dd];return _0x6dcf16;};'use strict';var client=require(_0x152e('0x0'));exports[_0x152e('0x1')]=function(_0x188f4a){return function(_0x53d97c){return client[_0x152e('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x152e('0x3'),_0x152e('0x4')]},'log':_0x152e('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 508a85e..2d97d81 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 _0xdbe3=['action','data1','data2','data3','data5','getTriggers','Request','GetTrigger','name','channel','status','AllConditions','field','operator','value','Condition','AnyConditions','Action','Actions'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xdbe3,0x64));var _0x3dbe=function(_0x57d81d,_0x31731b){_0x57d81d=_0x57d81d-0x0;var _0x2f0cfb=_0xdbe3[_0x57d81d];return _0x2f0cfb;};'use strict';var client=require('../client');exports[_0x3dbe('0x0')]=function(_0x14917f){return function(_0x1246a6){return client[_0x3dbe('0x1')](_0x3dbe('0x2'),{'options':{'raw':![],'attributes':['id',_0x3dbe('0x3'),_0x3dbe('0x4'),_0x3dbe('0x5')],'include':[{'model':'Condition','as':_0x3dbe('0x6'),'attributes':['id',_0x3dbe('0x7'),_0x3dbe('0x8'),_0x3dbe('0x9')]},{'model':_0x3dbe('0xa'),'as':_0x3dbe('0xb'),'attributes':['id','field',_0x3dbe('0x8'),'value']},{'model':_0x3dbe('0xc'),'as':_0x3dbe('0xd'),'attributes':['id',_0x3dbe('0xe'),_0x3dbe('0xf'),_0x3dbe('0x10'),_0x3dbe('0x11'),'data4',_0x3dbe('0x12'),'data6','data7']}]},'log':_0x3dbe('0x2')});};}; \ No newline at end of file +var _0xef47=['field','Action','Actions','data1','data3','data4','data5','data6','data7','getTriggers','GetTrigger','name','channel','status','Condition','AllConditions','operator','value'];(function(_0x480fc2,_0x482fba){var _0x540a95=function(_0x4b5a56){while(--_0x4b5a56){_0x480fc2['push'](_0x480fc2['shift']());}};_0x540a95(++_0x482fba);}(_0xef47,0x1b9));var _0x7ef4=function(_0x4a38f0,_0x157ed2){_0x4a38f0=_0x4a38f0-0x0;var _0x40fb0a=_0xef47[_0x4a38f0];return _0x40fb0a;};'use strict';var client=require('../client');exports[_0x7ef4('0x0')]=function(_0x23566e){return function(_0x2ff638){return client['Request'](_0x7ef4('0x1'),{'options':{'raw':![],'attributes':['id',_0x7ef4('0x2'),_0x7ef4('0x3'),_0x7ef4('0x4')],'include':[{'model':_0x7ef4('0x5'),'as':_0x7ef4('0x6'),'attributes':['id','field',_0x7ef4('0x7'),_0x7ef4('0x8')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x7ef4('0x9'),_0x7ef4('0x7'),_0x7ef4('0x8')]},{'model':_0x7ef4('0xa'),'as':_0x7ef4('0xb'),'attributes':['id','action',_0x7ef4('0xc'),'data2',_0x7ef4('0xd'),_0x7ef4('0xe'),_0x7ef4('0xf'),_0x7ef4('0x10'),_0x7ef4('0x11')]}]},'log':_0x7ef4('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index f5c903e..1073b29 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 _0xb73c=['Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xb73c,0x1cd));var _0xcb73=function(_0x4d93a6,_0x44e4fd){_0x4d93a6=_0x4d93a6-0x0;var _0x4d0e65=_0xb73c[_0x4d93a6];return _0x4d0e65;};'use strict';var client=require(_0xcb73('0x0'));exports['getTrunks']=function(_0x39fe5e){return function(_0x35ef5e){return client[_0xcb73('0x1')](_0xcb73('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xcb73('0x3'),_0xcb73('0x4'),_0xcb73('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xa952=['name','defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x1bca2e,_0x2e5dbc){var _0x11ab8d=function(_0x3e40d4){while(--_0x3e40d4){_0x1bca2e['push'](_0x1bca2e['shift']());}};_0x11ab8d(++_0x2e5dbc);}(_0xa952,0x1b2));var _0x2a95=function(_0x438578,_0xeccb24){_0x438578=_0x438578-0x0;var _0x55f90b=_0xa952[_0x438578];return _0x55f90b;};'use strict';var client=require(_0x2a95('0x0'));exports[_0x2a95('0x1')]=function(_0x1b8b45){return function(_0x3e7c4){return client[_0x2a95('0x2')](_0x2a95('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2a95('0x4'),'registry',_0x2a95('0x5')]},'log':_0x2a95('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index a587844..f10f28a 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x98402c,_0x474b56){var _0x31839c=function(_0x5d7067){while(--_0x5d7067){_0x98402c['push'](_0x98402c['shift']());}};_0x31839c(++_0x474b56);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index b627876..61918c6 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 _0xb8f6=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xb8f6,0x11b));var _0x6b8f=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xb8f6[_0x3511d3];return _0x5d6321;};'use strict';var client=require(_0x6b8f('0x0'));exports[_0x6b8f('0x1')]=function(_0x476183){return client[_0x6b8f('0x2')](_0x6b8f('0x3'),{'body':_0x476183,'log':'CreateVoiceAgentReport'});};exports[_0x6b8f('0x4')]=function(_0x2df910,_0xd3a178,_0x30d06e){return client[_0x6b8f('0x2')](_0x6b8f('0x5'),{'body':_0x2df910,'options':{'where':{'uniqueid':_0xd3a178,'interface':_0x30d06e,'agentcomplete':!![]}},'log':_0x6b8f('0x5')});}; \ No newline at end of file +var _0x2ecf=['update','Request','UpdateVoiceAgentReport','create','CreateVoiceAgentReport'];(function(_0x2d31d1,_0x554675){var _0x394f92=function(_0x23da38){while(--_0x23da38){_0x2d31d1['push'](_0x2d31d1['shift']());}};_0x394f92(++_0x554675);}(_0x2ecf,0x15c));var _0xf2ec=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x2ecf[_0x1969a7];return _0x3d665f;};'use strict';var client=require('../client');exports[_0xf2ec('0x0')]=function(_0x39436e){return client['Request'](_0xf2ec('0x1'),{'body':_0x39436e,'log':_0xf2ec('0x1')});};exports[_0xf2ec('0x2')]=function(_0x600b3a,_0x3fcef1,_0x512019){return client[_0xf2ec('0x3')](_0xf2ec('0x4'),{'body':_0x600b3a,'options':{'where':{'uniqueid':_0x3fcef1,'interface':_0x512019,'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 92a8ca7..31a3e9b 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 _0x5e14=['DOCUMENTATION','getVoiceCallReports','Request','startOf','YYYY-MM-DD\x20HH:mm:ss','format','type','disposition','GetVoiceCallReports','moment','lodash','../client','create','CreateVoiceCallReport','context','callerid'];(function(_0x18dfcf,_0x58a550){var _0x406404=function(_0x12a2a6){while(--_0x12a2a6){_0x18dfcf['push'](_0x18dfcf['shift']());}};_0x406404(++_0x58a550);}(_0x5e14,0x139));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x45e1('0x0'));var util=require('util');var _=require(_0x45e1('0x1'));var client=require(_0x45e1('0x2'));exports[_0x45e1('0x3')]=function(_0x1ef613){return client['Request'](_0x45e1('0x4'),{'body':_['merge'](_0x1ef613,{'source':_0x1ef613['calleridnum'],'destinationcontext':_0x1ef613[_0x45e1('0x5')],'callerid':_0x1ef613[_0x45e1('0x6')],'amaflags':_0x45e1('0x7')}),'log':_0x45e1('0x4')});};exports[_0x45e1('0x8')]=function(){return function(){return client[_0x45e1('0x9')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x45e1('0xa')]('day')['format'](_0x45e1('0xb')),moment()['endOf']('day')[_0x45e1('0xc')](_0x45e1('0xb'))]}},'attributes':[_0x45e1('0xd'),_0x45e1('0xe'),'duration','billableseconds']},'log':_0x45e1('0xf')});};}; \ No newline at end of file +var _0xa988=['billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration'];(function(_0xae5354,_0x44cdda){var _0x4ee434=function(_0xa383d9){while(--_0xa383d9){_0xae5354['push'](_0xae5354['shift']());}};_0x4ee434(++_0x44cdda);}(_0xa988,0x17c));var _0x8a98=function(_0x7ec322,_0xc55c5f){_0x7ec322=_0x7ec322-0x0;var _0x45b5db=_0xa988[_0x7ec322];return _0x45b5db;};'use strict';var moment=require(_0x8a98('0x0'));var util=require(_0x8a98('0x1'));var _=require(_0x8a98('0x2'));var client=require(_0x8a98('0x3'));exports['create']=function(_0xf5a03c){return client[_0x8a98('0x4')](_0x8a98('0x5'),{'body':_['merge'](_0xf5a03c,{'source':_0xf5a03c['calleridnum'],'destinationcontext':_0xf5a03c[_0x8a98('0x6')],'callerid':_0xf5a03c[_0x8a98('0x7')],'amaflags':_0x8a98('0x8')}),'log':_0x8a98('0x5')});};exports[_0x8a98('0x9')]=function(){return function(){return client[_0x8a98('0x4')](_0x8a98('0xa'),{'options':{'where':{'type':[_0x8a98('0xb')],'createdAt':{'$between':[moment()[_0x8a98('0xc')]('day')['format'](_0x8a98('0xd')),moment()[_0x8a98('0xe')]('day')[_0x8a98('0xf')](_0x8a98('0xd'))]}},'attributes':[_0x8a98('0x10'),_0x8a98('0x11'),_0x8a98('0x12'),_0x8a98('0x13')]},'log':_0x8a98('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 26743ff..24f7d57 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 _0xc701=['../client','create','Request','CreateVoiceDialReport'];(function(_0x484ba8,_0x54bea3){var _0x2b9ac8=function(_0x2e8570){while(--_0x2e8570){_0x484ba8['push'](_0x484ba8['shift']());}};_0x2b9ac8(++_0x54bea3);}(_0xc701,0x98));var _0x1c70=function(_0x52af0b,_0x580c97){_0x52af0b=_0x52af0b-0x0;var _0x40ed35=_0xc701[_0x52af0b];return _0x40ed35;};'use strict';var client=require(_0x1c70('0x0'));exports[_0x1c70('0x1')]=function(_0x57ff54){return client[_0x1c70('0x2')](_0x1c70('0x3'),{'body':_0x57ff54,'log':_0x1c70('0x3')});}; \ No newline at end of file +var _0x9967=['create','Request','CreateVoiceDialReport','../client'];(function(_0x3ffaaf,_0x2a0388){var _0x1a4efc=function(_0x46e23c){while(--_0x46e23c){_0x3ffaaf['push'](_0x3ffaaf['shift']());}};_0x1a4efc(++_0x2a0388);}(_0x9967,0xb3));var _0x7996=function(_0x3a4184,_0x4d4439){_0x3a4184=_0x3a4184-0x0;var _0x5c19a8=_0x9967[_0x3a4184];return _0x5c19a8;};'use strict';var client=require(_0x7996('0x0'));exports[_0x7996('0x1')]=function(_0x59d1bc){return client[_0x7996('0x2')]('CreateVoiceDialReport',{'body':_0x59d1bc,'log':_0x7996('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3f9c812..4b3d354 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 _0x1bca=['getVoiceExtensions','exten'];(function(_0x36d5d5,_0x1c1590){var _0x4eaa56=function(_0x56fa0e){while(--_0x56fa0e){_0x36d5d5['push'](_0x36d5d5['shift']());}};_0x4eaa56(++_0x1c1590);}(_0x1bca,0xb6));var _0xa1bc=function(_0x3c1ff2,_0x491cbc){_0x3c1ff2=_0x3c1ff2-0x0;var _0x1f4fc9=_0x1bca[_0x3c1ff2];return _0x1f4fc9;};'use strict';var client=require('../client');exports[_0xa1bc('0x0')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xa1bc('0x1'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xa1bc('0x0')});};}; \ No newline at end of file +var _0x9e0d=['GetVoiceExtension','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x4d68e1,_0x3cf4e3){var _0x32d1d3=function(_0x363bbe){while(--_0x363bbe){_0x4d68e1['push'](_0x4d68e1['shift']());}};_0x32d1d3(++_0x3cf4e3);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x183b97,_0x2d297c){_0x183b97=_0x183b97-0x0;var _0x629cf7=_0x9e0d[_0x183b97];return _0x629cf7;};'use strict';var client=require(_0xd9e0('0x0'));exports[_0xd9e0('0x1')]=function(){return function(){return client[_0xd9e0('0x2')](_0xd9e0('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xd9e0('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xd9e0('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index f440358..907e9ff 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 _0x43f7=['dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','name','Interval','Intervals','../client','getVoiceQueues','Request','acwTimeout','autopause','monitor_format','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43f7,0x8e));var _0x743f=function(_0xec9536,_0x35bb16){_0xec9536=_0xec9536-0x0;var _0x27b6f8=_0x43f7[_0xec9536];return _0x27b6f8;};'use strict';var client=require(_0x743f('0x0'));exports[_0x743f('0x1')]=function(){return function(){return client[_0x743f('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0x743f('0x3'),_0x743f('0x4'),_0x743f('0x5'),'type','dialActive',_0x743f('0x6'),_0x743f('0x7'),_0x743f('0x8'),'dialPowerLevel',_0x743f('0x9'),_0x743f('0xa'),'dialPredictiveInterval',_0x743f('0xb'),_0x743f('0xc'),_0x743f('0xd'),_0x743f('0xe'),_0x743f('0xf'),'dialQueueProject',_0x743f('0x10'),_0x743f('0x11'),_0x743f('0x12'),'dialBusyRetryFrequency',_0x743f('0x13'),_0x743f('0x14'),'dialGlobalMaxRetry',_0x743f('0x15'),_0x743f('0x16'),'dialPrefix',_0x743f('0x17'),_0x743f('0x18'),_0x743f('0x19'),_0x743f('0x1a'),_0x743f('0x1b'),_0x743f('0x1c'),_0x743f('0x1d'),'dialAMDBetweenWordsSilence',_0x743f('0x1e'),_0x743f('0x1f'),_0x743f('0x20'),_0x743f('0x21'),_0x743f('0x22'),_0x743f('0x23'),_0x743f('0x24'),_0x743f('0x25'),_0x743f('0x26'),_0x743f('0x27'),'monitor_format','strategy',_0x743f('0x28'),_0x743f('0x29'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x743f('0x2a'),_0x743f('0x2b'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x743f('0x2c'),_0x743f('0x2d'),_0x743f('0x2e'),_0x743f('0x2f'),_0x743f('0x30'),_0x743f('0x31'),'dialPredictiveIntervalMinThreshold',_0x743f('0x32'),_0x743f('0x33')],'include':[{'model':'Trunk','as':_0x743f('0x34'),'attributes':['id','name',_0x743f('0x35'),_0x743f('0x36')]},{'model':_0x743f('0x37'),'as':'mandatoryDispositionPause','attributes':['id',_0x743f('0x38')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x743f('0x38'),_0x743f('0x35'),_0x743f('0x36')]},{'model':_0x743f('0x39'),'as':'Interval','attributes':['id',_0x743f('0x38')],'include':[{'model':_0x743f('0x39'),'as':_0x743f('0x3a'),'attributes':['id',_0x743f('0x38'),'interval']}]}]},'log':_0x743f('0x1')});};}; \ No newline at end of file +var _0xd1b1=['dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','monitor_format','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd1b1,0x8b));var _0x1d1b=function(_0x79743c,_0x2f9cb9){_0x79743c=_0x79743c-0x0;var _0xae37c=_0xd1b1[_0x79743c];return _0xae37c;};'use strict';var client=require('../client');exports[_0x1d1b('0x0')]=function(){return function(){return client[_0x1d1b('0x1')](_0x1d1b('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d1b('0x3'),_0x1d1b('0x4'),'acwTimeout','autopause','monitor_format','type',_0x1d1b('0x5'),_0x1d1b('0x6'),_0x1d1b('0x7'),'dialLimitQueue',_0x1d1b('0x8'),'dialPredictiveOptimization',_0x1d1b('0x9'),'dialPredictiveInterval',_0x1d1b('0xa'),_0x1d1b('0xb'),'dialOriginateTimeout',_0x1d1b('0xc'),_0x1d1b('0xd'),_0x1d1b('0xe'),_0x1d1b('0xf'),_0x1d1b('0x10'),_0x1d1b('0x11'),_0x1d1b('0x12'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency',_0x1d1b('0x13'),_0x1d1b('0x14'),_0x1d1b('0x15'),'dialPrefix','dialCheckDuplicateType',_0x1d1b('0x16'),_0x1d1b('0x17'),_0x1d1b('0x18'),_0x1d1b('0x19'),'dialAMDTotalAnalysisTime',_0x1d1b('0x1a'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x1d1b('0x1b'),'timeout','dialRecallMeTimeout',_0x1d1b('0x1c'),_0x1d1b('0x1d'),_0x1d1b('0x1e'),_0x1d1b('0x1f'),'dialQueueProject2',_0x1d1b('0x20'),'strategy',_0x1d1b('0x21'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0x1d1b('0x22'),_0x1d1b('0x23'),_0x1d1b('0x24'),_0x1d1b('0x25'),_0x1d1b('0x26'),_0x1d1b('0x27'),_0x1d1b('0x28'),'dialAgentRejectMaxRetry',_0x1d1b('0x29'),_0x1d1b('0x2a'),_0x1d1b('0x2b'),_0x1d1b('0x2c'),_0x1d1b('0x2d'),_0x1d1b('0x2e')],'include':[{'model':'Trunk','as':_0x1d1b('0x2f'),'attributes':['id',_0x1d1b('0x3'),_0x1d1b('0x30'),_0x1d1b('0x31')]},{'model':'Pause','as':_0x1d1b('0x32'),'attributes':['id','name']},{'model':_0x1d1b('0x2f'),'as':'TrunkBackup','attributes':['id',_0x1d1b('0x3'),_0x1d1b('0x30'),_0x1d1b('0x31')]},{'model':_0x1d1b('0x33'),'as':_0x1d1b('0x33'),'attributes':['id','name'],'include':[{'model':_0x1d1b('0x33'),'as':'Intervals','attributes':['id',_0x1d1b('0x3'),_0x1d1b('0x34')]}]}]},'log':_0x1d1b('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4ecacd2..2be561f 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(_0xece035,_0x881116){var _0x36f9f0=function(_0x3d115b){while(--_0x3d115b){_0xece035['push'](_0xece035['shift']());}};_0x36f9f0(++_0x881116);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x9d16f0,_0x2b662d){var _0x468346=function(_0x31d2dd){while(--_0x31d2dd){_0x9d16f0['push'](_0x9d16f0['shift']());}};_0x468346(++_0x2b662d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 01ea725..a0a8665 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 _0x31c8=['getVoiceQueueRtPauses','Request'];(function(_0x30392d,_0x4d1354){var _0x16819d=function(_0xc25bbe){while(--_0xc25bbe){_0x30392d['push'](_0x30392d['shift']());}};_0x16819d(++_0x4d1354);}(_0x31c8,0x74));var _0x831c=function(_0x44b827,_0x1bb1aa){_0x44b827=_0x44b827-0x0;var _0x527342=_0x31c8[_0x44b827];return _0x527342;};'use strict';var client=require('../client');exports[_0x831c('0x0')]=function(_0x41d5cf){return function(){return client[_0x831c('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x41d5cf,'paused':!![]},'raw':!![]},'log':_0x831c('0x0')});};}; \ No newline at end of file +var _0x0c5e=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x4f8a36,_0x37224f){var _0x5471e5=function(_0x1ca1ff){while(--_0x1ca1ff){_0x4f8a36['push'](_0x4f8a36['shift']());}};_0x5471e5(++_0x37224f);}(_0x0c5e,0x199));var _0xe0c5=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x0c5e[_0x4d82ea];return _0x257f4a;};'use strict';var client=require(_0xe0c5('0x0'));exports[_0xe0c5('0x1')]=function(_0x44c651){return function(){return client['Request'](_0xe0c5('0x2'),{'options':{'where':{'VoiceQueueId':_0x44c651,'paused':!![]},'raw':!![]},'log':_0xe0c5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d06dd4d..966e1d0 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x53ff87,_0x31a6c4){var _0x353b28=function(_0xec4d63){while(--_0xec4d63){_0x53ff87['push'](_0x53ff87['shift']());}};_0x353b28(++_0x31a6c4);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x5436f3,_0x1d4061){var _0x3ece25=function(_0x254484){while(--_0x254484){_0x5436f3['push'](_0x5436f3['shift']());}};_0x3ece25(++_0x1d4061);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 2ab919c..f5eefc6 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 _0x31eb=['transfereelinkedid','isexternal','context','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x31eb,0x1a8));var _0xb31e=function(_0x57f666,_0x1e2703){_0x57f666=_0x57f666-0x0;var _0x2cbaad=_0x31eb[_0x57f666];return _0x2cbaad;};'use strict';var client=require(_0xb31e('0x0'));exports[_0xb31e('0x1')]={};exports[_0xb31e('0x2')]=function(_0x254dc5){return client[_0xb31e('0x3')](_0xb31e('0x4'),{'body':{'result':_0x254dc5[_0xb31e('0x5')],'transfererchannel':_0x254dc5['transfererchannel'],'transferercalleridnum':_0x254dc5[_0xb31e('0x6')],'transferercalleridname':_0x254dc5[_0xb31e('0x7')],'transfererconnectedlinenum':_0x254dc5[_0xb31e('0x8')],'transfererconnectedlinename':_0x254dc5[_0xb31e('0x9')],'transfereraccountcode':_0x254dc5[_0xb31e('0xa')],'transferercontext':_0x254dc5[_0xb31e('0xb')],'transfererexten':_0x254dc5[_0xb31e('0xc')],'transfererlinkedid':_0x254dc5['transfererlinkedid'],'transfereechannel':_0x254dc5[_0xb31e('0xd')],'transfereecalleridnum':_0x254dc5[_0xb31e('0xe')],'transfereecalleridname':_0x254dc5[_0xb31e('0xf')],'transfereeconnectedlinenum':_0x254dc5['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x254dc5[_0xb31e('0x10')],'transfereeaccountcode':_0x254dc5[_0xb31e('0x11')],'transfereecontext':_0x254dc5[_0xb31e('0x12')],'transfereeexten':_0x254dc5[_0xb31e('0x13')],'transfereelinkedid':_0x254dc5[_0xb31e('0x14')],'isexternal':_0x254dc5[_0xb31e('0x15')],'context':_0x254dc5[_0xb31e('0x16')],'extension':_0x254dc5['extension'],'type':'blind'},'log':_0xb31e('0x4')});};exports['attendedTransfer']=function(_0x51e7d8){return client[_0xb31e('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x51e7d8['result'],'transfererchannel':_0x51e7d8[_0xb31e('0x17')],'transferercalleridnum':_0x51e7d8['origtransferercalleridnum'],'transferercalleridname':_0x51e7d8[_0xb31e('0x18')],'transfererconnectedlinenum':_0x51e7d8['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x51e7d8[_0xb31e('0x19')],'transfereraccountcode':_0x51e7d8['origtransfereraccountcode'],'transferercontext':_0x51e7d8[_0xb31e('0x1a')],'transfererexten':_0x51e7d8['secondtransfererexten'],'transfererlinkedid':_0x51e7d8[_0xb31e('0x1b')],'transfereechannel':_0x51e7d8['transfertargetchannel'],'transfereecalleridnum':_0x51e7d8[_0xb31e('0x1c')],'transfereecalleridname':_0x51e7d8['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x51e7d8[_0xb31e('0x1d')],'transfereeconnectedlinename':_0x51e7d8[_0xb31e('0x1e')],'transfereeaccountcode':_0x51e7d8[_0xb31e('0x1f')],'transfereecontext':_0x51e7d8[_0xb31e('0x20')],'transfereeexten':_0x51e7d8['transfertargetexten'],'transfereelinkedid':_0x51e7d8[_0xb31e('0x21')],'isexternal':_0x51e7d8[_0xb31e('0x15')],'context':_0x51e7d8[_0xb31e('0x22')],'extension':_0x51e7d8[_0xb31e('0x23')],'type':_0xb31e('0x24')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x05fe=['isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereelinkedid'];(function(_0x11af6c,_0xf0fc16){var _0x2b043f=function(_0x2e5e87){while(--_0x2e5e87){_0x11af6c['push'](_0x11af6c['shift']());}};_0x2b043f(++_0xf0fc16);}(_0x05fe,0x1b1));var _0xe05f=function(_0x4c3314,_0x5b7c1a){_0x4c3314=_0x4c3314-0x0;var _0x3d1c47=_0x05fe[_0x4c3314];return _0x3d1c47;};'use strict';var client=require(_0xe05f('0x0'));exports[_0xe05f('0x1')]={};exports[_0xe05f('0x2')]=function(_0x49ae14){return client[_0xe05f('0x3')](_0xe05f('0x4'),{'body':{'result':_0x49ae14[_0xe05f('0x5')],'transfererchannel':_0x49ae14[_0xe05f('0x6')],'transferercalleridnum':_0x49ae14[_0xe05f('0x7')],'transferercalleridname':_0x49ae14[_0xe05f('0x8')],'transfererconnectedlinenum':_0x49ae14[_0xe05f('0x9')],'transfererconnectedlinename':_0x49ae14['transfererconnectedlinename'],'transfereraccountcode':_0x49ae14[_0xe05f('0xa')],'transferercontext':_0x49ae14[_0xe05f('0xb')],'transfererexten':_0x49ae14[_0xe05f('0xc')],'transfererlinkedid':_0x49ae14['transfererlinkedid'],'transfereechannel':_0x49ae14[_0xe05f('0xd')],'transfereecalleridnum':_0x49ae14[_0xe05f('0xe')],'transfereecalleridname':_0x49ae14[_0xe05f('0xf')],'transfereeconnectedlinenum':_0x49ae14[_0xe05f('0x10')],'transfereeconnectedlinename':_0x49ae14['transfereeconnectedlinename'],'transfereeaccountcode':_0x49ae14['transfereeaccountcode'],'transfereecontext':_0x49ae14['transfereecontext'],'transfereeexten':_0x49ae14['transfereeexten'],'transfereelinkedid':_0x49ae14[_0xe05f('0x11')],'isexternal':_0x49ae14[_0xe05f('0x12')],'context':_0x49ae14[_0xe05f('0x13')],'extension':_0x49ae14[_0xe05f('0x14')],'type':_0xe05f('0x15')},'log':_0xe05f('0x4')});};exports[_0xe05f('0x16')]=function(_0x2ae6c4){return client[_0xe05f('0x3')](_0xe05f('0x4'),{'body':{'result':_0x2ae6c4['result'],'transfererchannel':_0x2ae6c4[_0xe05f('0x17')],'transferercalleridnum':_0x2ae6c4[_0xe05f('0x18')],'transferercalleridname':_0x2ae6c4[_0xe05f('0x19')],'transfererconnectedlinenum':_0x2ae6c4[_0xe05f('0x1a')],'transfererconnectedlinename':_0x2ae6c4[_0xe05f('0x1b')],'transfereraccountcode':_0x2ae6c4[_0xe05f('0x1c')],'transferercontext':_0x2ae6c4['secondtransferercontext'],'transfererexten':_0x2ae6c4[_0xe05f('0x1d')],'transfererlinkedid':_0x2ae6c4[_0xe05f('0x1e')],'transfereechannel':_0x2ae6c4[_0xe05f('0x1f')],'transfereecalleridnum':_0x2ae6c4[_0xe05f('0x20')],'transfereecalleridname':_0x2ae6c4[_0xe05f('0x21')],'transfereeconnectedlinenum':_0x2ae6c4['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2ae6c4[_0xe05f('0x22')],'transfereeaccountcode':_0x2ae6c4['transfertargetaccountcode'],'transfereecontext':_0x2ae6c4[_0xe05f('0x23')],'transfereeexten':_0x2ae6c4[_0xe05f('0x24')],'transfereelinkedid':_0x2ae6c4[_0xe05f('0x25')],'isexternal':_0x2ae6c4[_0xe05f('0x12')],'context':_0x2ae6c4[_0xe05f('0x26')],'extension':_0x2ae6c4[_0xe05f('0x27')],'type':_0xe05f('0x28')},'log':_0xe05f('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 330236c..9a46018 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 _0x5fd1=['agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','join','pick','keys','reload','Reload','then','message','catch','isConnected','error','command','action','Command','Action','content','voiceQueues','hasOwnProperty','push','find','omit','undefined','channels','length','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','isNil','monitors','mixmonitorid','status','MixMonitor\x20Success','toLowerCase','resolve','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','values','type','outbound','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../ami','../model/voiceQueueSummary','listen','format','SIP','timers','updateAcw'];(function(_0x4dd4eb,_0x2908b4){var _0x2830a7=function(_0x198018){while(--_0x198018){_0x4dd4eb['push'](_0x4dd4eb['shift']());}};_0x2830a7(++_0x2908b4);}(_0x5fd1,0x155));var _0x15fd=function(_0x4e9c19,_0x201e23){_0x4e9c19=_0x4e9c19-0x0;var _0x555b8e=_0x5fd1[_0x4e9c19];return _0x555b8e;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var jayson=require(_0x15fd('0x1'));var schema=require(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x15fd('0x4'));var VoiceQueueSummary=require(_0x15fd('0x5'));exports[_0x15fd('0x6')]=function(_0x5e1d7e,_0x1e3b97,_0x386441){return new Promise(function(_0x18450c,_0x2e88bf){var _0x225728={'QueuePause':function(_0x534e63){return new Promise(function(_0x210e90){var _0x1ee117=util[_0x15fd('0x7')]('%s/%s',_0x15fd('0x8'),_0x534e63['name']);if(_0x5e1d7e[_0x15fd('0x9')]&&_0x5e1d7e[_0x15fd('0x9')][_0x1ee117]&&_0x5e1d7e['timers'][_0x1ee117]['timer']){_0x5e1d7e['timers'][_0x1ee117][_0x15fd('0xa')]();}if(_0x5e1d7e[_0x15fd('0xb')][_0x1ee117]){_0x5e1d7e[_0x15fd('0xb')][_0x1ee117][_0x15fd('0xc')]({'statePause':_0x534e63[_0x15fd('0xd')]?!![]:![]});}_0x210e90({'code':0xc8,'message':_0x15fd('0xe')});});},'Reload':function(_0x346ab1){var _0x2660db=this;return new Promise(function(_0x459fa4,_0x4cb391){if(ami['isConnected']()==![]){return _0x4cb391(_0x2660db['error'](0x1f4,[config[_0x15fd('0xf')]['ip'],config[_0x15fd('0xf')][_0x15fd('0x10')],_0x15fd('0x11')][_0x15fd('0x12')]('\x20')));}_0x346ab1=_[_0x15fd('0x13')](_0x346ab1,_[_0x15fd('0x14')](properties[_0x15fd('0x15')]['module']));_0x346ab1['action']=_0x15fd('0x16');return ami['Action'](_0x346ab1)[_0x15fd('0x17')](function(_0x579ee2){_0x459fa4({'code':0xc8,'message':_0x579ee2[_0x15fd('0x18')]});})[_0x15fd('0x19')](function(_0x855bae){_0x4cb391(_0x2660db['error'](0x1f5,_0x855bae[_0x15fd('0x18')]));});});},'Command':function(_0x2ad0de){var _0x8b7b9e=this;return new Promise(function(_0x229f8a,_0x2fb919){if(ami[_0x15fd('0x1a')]()==![]){return _0x2fb919(_0x8b7b9e[_0x15fd('0x1b')](0x1f4,[config[_0x15fd('0xf')]['ip'],config[_0x15fd('0xf')][_0x15fd('0x10')],_0x15fd('0x11')]['join']('\x20')));}_0x2ad0de=_['pick'](_0x2ad0de,_0x15fd('0x1c'));_0x2ad0de[_0x15fd('0x1d')]=_0x15fd('0x1e');return ami[_0x15fd('0x1f')](_0x2ad0de)[_0x15fd('0x17')](function(_0x11496a){_0x229f8a({'code':0xc8,'message':_0x11496a[_0x15fd('0x20')]});})['catch'](function(_0x40d43){_0x2fb919(_0x8b7b9e[_0x15fd('0x1b')](0x1f5,_0x40d43[_0x15fd('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x5c7aa9){var _0x27528f=[];for(var _0x49062f in _0x5e1d7e[_0x15fd('0x21')]){if(_0x5e1d7e[_0x15fd('0x21')][_0x15fd('0x22')](_0x49062f)){var _0x4c9708=_0x5e1d7e[_0x15fd('0x21')][_0x49062f];var _0x1cbf2c=new VoiceQueueSummary(_0x4c9708);_0x27528f[_0x15fd('0x23')](_0x1cbf2c);}}_0x5c7aa9({'count':_0x27528f['length'],'rows':_0x27528f});});},'UpdateVoiceQueue':function(_0x44e8c8){return new Promise(function(_0x544685,_0x3d33cd){var _0x7e70d6=_[_0x15fd('0x24')](_0x5e1d7e[_0x15fd('0x21')],{'id':parseInt(_0x44e8c8['id'])});var _0x233ed3=_[_0x15fd('0x25')](_0x44e8c8,['id']);if(_0x7e70d6){for(var _0x218034 in _0x233ed3){if(typeof _0x233ed3[_0x218034]!==_0x15fd('0x26')&&typeof _0x7e70d6[_0x218034]!==_0x15fd('0x26')){_0x7e70d6[_0x218034]=_0x233ed3[_0x218034];}}_0x544685(_0x7e70d6);}else{_0x3d33cd();}});},'VoiceChannels':function(){return new Promise(function(_0x160226){var _0x38993d=_['values'](_0x5e1d7e[_0x15fd('0x27')]);_0x160226({'count':_0x38993d[_0x15fd('0x28')],'rows':_0x38993d});});},'VoiceChannelMixMonitor':function(_0x50381a){var _0x39e744=this;return new Promise(function(_0xf6ddbe,_0x5f406a){if(ami[_0x15fd('0x1a')]()==![]){return _0x5f406a(_0x39e744[_0x15fd('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x15fd('0xf')][_0x15fd('0x10')],_0x15fd('0x11')][_0x15fd('0x12')]('\x20')));}var _0x42edc3=schema(properties[_0x15fd('0x29')])['validate'](_0x50381a);if(_0x42edc3[_0x15fd('0x28')]>0x0){return _0x5f406a(_0x39e744[_0x15fd('0x1b')](0x1f4,_[_0x15fd('0x2a')](_0x42edc3,_0x15fd('0x18'))['join'](',\x20')));}var _0x1f0fca=_[_0x15fd('0x24')](_0x5e1d7e[_0x15fd('0x27')],{'uniqueid':_0x50381a[_0x15fd('0x2b')]});if(_0x1f0fca&&_0x1f0fca[_0x15fd('0x2c')]){var _0x296a0c=util['format'](_0x15fd('0x2d'),_0x50381a[_0x15fd('0x2e')]||_0x50381a['uniqueid'],_0x50381a[_0x15fd('0x7')]||_0x15fd('0x2f'));return ami[_0x15fd('0x1f')]({'action':'MixMonitor','channel':_0x1f0fca[_0x15fd('0x2c')],'file':_0x296a0c,'options':_0x15fd('0x30')})[_0x15fd('0x17')](function(_0xbe50e7){var _0x163380=_[_0x15fd('0x24')](_0x1f0fca['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x296a0c['toLowerCase']()});if(_[_0x15fd('0x31')](_0x163380)){_0x1f0fca[_0x15fd('0x32')][_0x15fd('0x23')]({'filename':'/var/spool/asterisk/monitor/'+_0x296a0c['toLowerCase'](),'createdAt':moment()[_0x15fd('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0xbe50e7['mixmonitorid'],'status':'rec'});}else{_0x163380[_0x15fd('0x33')]=_0xbe50e7[_0x15fd('0x33')];_0x163380[_0x15fd('0x34')]='rec';}_0xf6ddbe({'code':0xc8,'message':[_0x50381a[_0x15fd('0x2b')],_0x15fd('0x35'),_0xbe50e7[_0x15fd('0x33')]]['join']('\x20'),'mixmonitorid':_0xbe50e7[_0x15fd('0x33')]});})[_0x15fd('0x19')](function(_0x2e81cb){_0x5f406a(_0x39e744[_0x15fd('0x1b')](0x1f5,[_0x50381a[_0x15fd('0x2b')],_0x2e81cb[_0x15fd('0x18')][_0x15fd('0x36')]()][_0x15fd('0x12')]('\x20')));});}else{return _0x5f406a(_0x39e744[_0x15fd('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x41eee0){var _0x44e83c=this;return new Promise(function(_0x180433,_0x304736){if(ami[_0x15fd('0x1a')]()==![]){return _0x304736(_0x44e83c[_0x15fd('0x1b')](0x1f4,[config[_0x15fd('0xf')]['ip'],config[_0x15fd('0xf')][_0x15fd('0x10')],_0x15fd('0x11')][_0x15fd('0x12')]('\x20')));}var _0x145eab=schema(properties[_0x15fd('0x29')])[_0x15fd('0x2')](_0x41eee0);if(_0x145eab[_0x15fd('0x28')]>0x0){return _0x304736(_0x44e83c['error'](0x1f4,_[_0x15fd('0x2a')](_0x145eab,_0x15fd('0x18'))[_0x15fd('0x12')](',\x20')));}var _0x37c43e=_[_0x15fd('0x24')](_0x5e1d7e[_0x15fd('0x27')],{'uniqueid':_0x41eee0[_0x15fd('0x2b')]});if(_0x37c43e){return Promise[_0x15fd('0x37')]()['then'](function(){if(_0x37c43e['channel']){return ami[_0x15fd('0x1f')]({'action':'StopMixMonitor','channel':_0x37c43e[_0x15fd('0x2c')],'mixmonitorid':_0x41eee0[_0x15fd('0x33')]})['catch'](function(){});}})[_0x15fd('0x17')](function(){if(_0x37c43e[_0x15fd('0x38')]){return ami[_0x15fd('0x1f')]({'action':_0x15fd('0x39'),'channel':_0x37c43e[_0x15fd('0x38')],'mixmonitorid':_0x41eee0[_0x15fd('0x33')]})['catch'](function(){});}})[_0x15fd('0x17')](function(){var _0x1af11f=_[_0x15fd('0x24')](_0x37c43e[_0x15fd('0x32')],{'mixmonitorid':_0x41eee0[_0x15fd('0x33')]});if(_0x1af11f){_0x1af11f[_0x15fd('0x34')]=_0x15fd('0x3a');}})[_0x15fd('0x17')](function(){var _0x24cb44=util[_0x15fd('0x7')](_0x15fd('0x2d'),_0x41eee0[_0x15fd('0x2e')]||_0x41eee0['uniqueid'],_0x41eee0[_0x15fd('0x7')]||'wav');var _0x284f51=_[_0x15fd('0x24')](_0x37c43e[_0x15fd('0x32')],{'filename':'/var/spool/asterisk/monitor/'+_0x24cb44[_0x15fd('0x36')]()});if(_0x284f51){_0x284f51[_0x15fd('0x34')]=_0x15fd('0x3a');}})[_0x15fd('0x17')](function(){_0x180433({'code':0xc8,'message':[_0x41eee0['uniqueid'],_0x15fd('0x3b')][_0x15fd('0x12')]('\x20')});})[_0x15fd('0x19')](function(_0x2d9018){_0x304736(_0x44e83c['error'](0x1f5,[_0x41eee0[_0x15fd('0x2b')],_0x2d9018[_0x15fd('0x18')]['toLowerCase']()]['join']('\x20')));});}else{return _0x304736(_0x44e83c['error'](0x1f5,_0x15fd('0x3c')));}});},'VoiceQueuesChannels':function(_0x246bba){var _0x366c49=this;return new Promise(function(_0x10cf04){var _0x292174=_[_0x15fd('0x3d')](_0x5e1d7e['queueChannels']);var _0xbe7dc3={'count':_0x292174[_0x15fd('0x28')],'rows':_0x292174};if(_0x246bba&&_0x246bba[_0x15fd('0x3e')]){if(!['inbound',_0x15fd('0x3f')]['includes'](_0x246bba[_0x15fd('0x3e')])){return _0x2e88bf(_0x366c49[_0x15fd('0x1b')](0x190,_0x15fd('0x40')));}var _0x42d4de=_[_0x15fd('0x41')](_0x292174,function(_0x1b0b6f){return _0x1b0b6f[_0x15fd('0x3e')]===_0x246bba[_0x15fd('0x3e')];});_0xbe7dc3[_0x15fd('0x42')]=_0x42d4de[_0x15fd('0x28')];_0xbe7dc3[_0x15fd('0x43')]=_0x42d4de;}_0x10cf04(_0xbe7dc3);});},'VoiceQueuesChannel':function(_0x36eaf7){var _0x2db992=this;return new Promise(function(_0x5343b8,_0x23d976){var _0x535dfa=schema(properties[_0x15fd('0x44')])['validate'](_0x36eaf7);if(_0x535dfa[_0x15fd('0x28')]>0x0){return _0x23d976(_0x2db992[_0x15fd('0x1b')](0x1f4,_[_0x15fd('0x2a')](_0x535dfa,'message')['join'](',\x20')));}var _0x185767=_[_0x15fd('0x24')](_0x5e1d7e[_0x15fd('0x45')],{'uniqueid':_0x36eaf7[_0x15fd('0x2b')]});if(_0x185767){_0x5343b8(_0x185767);}else{return _0x23d976(_0x2db992['error'](0x1f5,_0x15fd('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x13306d){var _0x42116b=this;return new Promise(function(_0xeda9db,_0x387e7d){if(ami[_0x15fd('0x1a')]()==![]){return _0x387e7d(_0x42116b['error'](0x1f4,[config[_0x15fd('0xf')]['ip'],config[_0x15fd('0xf')][_0x15fd('0x10')],_0x15fd('0x11')][_0x15fd('0x12')]('\x20')));}var _0x135c9a=schema(properties['voicequeuechannelhangup'])['validate'](_0x13306d);if(_0x135c9a[_0x15fd('0x28')]>0x0){return _0x387e7d(_0x42116b[_0x15fd('0x1b')](0x1f4,_['map'](_0x135c9a,_0x15fd('0x18'))[_0x15fd('0x12')](',\x20')));}var _0x5b0635=_[_0x15fd('0x24')](_0x5e1d7e[_0x15fd('0x45')],{'uniqueid':_0x13306d[_0x15fd('0x2b')]});if(_0x5b0635&&_0x5b0635['channel']){return ami[_0x15fd('0x1f')]({'action':_0x15fd('0x46'),'channel':_0x5b0635[_0x15fd('0x2c')]})[_0x15fd('0x17')](function(_0xa206b){_0xeda9db({'code':0xc8,'message':[_0x13306d[_0x15fd('0x2b')],_0xa206b[_0x15fd('0x18')][_0x15fd('0x36')]()][_0x15fd('0x12')]('\x20')});})[_0x15fd('0x19')](function(_0x4e2301){_0x387e7d(_0x42116b[_0x15fd('0x1b')](0x1f5,[_0x13306d[_0x15fd('0x2b')],_0x4e2301['message']['toLowerCase']()][_0x15fd('0x12')]('\x20')));});}else{return _0x387e7d(_0x42116b[_0x15fd('0x1b')](0x1f5,_0x15fd('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x105f03){var _0x12fd6c=this;return new Promise(function(_0x1b6f59,_0x4f2ff6){if(ami[_0x15fd('0x1a')]()==![]){return _0x4f2ff6(_0x12fd6c[_0x15fd('0x1b')](0x1f4,[config[_0x15fd('0xf')]['ip'],config[_0x15fd('0xf')][_0x15fd('0x10')],_0x15fd('0x11')][_0x15fd('0x12')]('\x20')));}var _0x1fe6cb=schema(properties[_0x15fd('0x47')])[_0x15fd('0x2')](_0x105f03);if(_0x1fe6cb[_0x15fd('0x28')]>0x0){return _0x4f2ff6(_0x12fd6c['error'](0x1f4,_['map'](_0x1fe6cb,_0x15fd('0x18'))[_0x15fd('0x12')](',\x20')));}var _0x1d3865=_[_0x15fd('0x24')](_0x5e1d7e[_0x15fd('0x45')],{'uniqueid':_0x105f03[_0x15fd('0x2b')]});if(_0x1d3865&&_0x1d3865[_0x15fd('0x2c')]){return ami['Action']({'action':_0x15fd('0x48'),'channel':_0x1d3865['channel'],'exten':_0x105f03[_0x15fd('0x49')],'context':_0x105f03['context']||_0x1d3865[_0x15fd('0x4a')],'priority':0x1})['then'](function(_0x33bfd1){_0x1b6f59({'code':0xc8,'message':[_0x105f03[_0x15fd('0x2b')],_0x33bfd1[_0x15fd('0x18')][_0x15fd('0x36')]()][_0x15fd('0x12')]('\x20')});})[_0x15fd('0x19')](function(_0xb910a4){_0x4f2ff6(_0x12fd6c[_0x15fd('0x1b')](0x1f5,[_0x105f03[_0x15fd('0x2b')],_0xb910a4['message']['toLowerCase']()][_0x15fd('0x12')]('\x20')));});}else{return _0x4f2ff6(_0x12fd6c[_0x15fd('0x1b')](0x1f5,_0x15fd('0x3c')));}});},'Agents':function(_0x4a8659){return new Promise(function(_0x2614b6){var _0x36bc03=_[_0x15fd('0x3d')](_0x5e1d7e['agents']);if(_0x4a8659&&_0x4a8659['id']){var _0x3bf85b=_[_0x15fd('0x24')](_0x36bc03,function(_0x58b433){return _0x58b433['id']===_0x4a8659['id'];});_0x2614b6(_0x3bf85b);}else{_0x2614b6({'count':_0x36bc03[_0x15fd('0x28')],'rows':_0x36bc03});}});},'Telephones':function(){return new Promise(function(_0x5bcf44){var _0x255549=_[_0x15fd('0x3d')](_0x5e1d7e[_0x15fd('0x4b')]);_0x5bcf44({'count':_0x255549[_0x15fd('0x28')],'rows':_0x255549});});},'Trunks':function(){return new Promise(function(_0x35965f){var _0x4cd9a2=_[_0x15fd('0x3d')](_0x5e1d7e['trunks']);_0x35965f({'count':_0x4cd9a2[_0x15fd('0x28')],'rows':_0x4cd9a2});});},'OutboundChannels':function(){return new Promise(function(_0x4a165f){var _0x386c9b=_[_0x15fd('0x3d')](_0x5e1d7e['outboundChannels']);_0x4a165f({'count':_0x386c9b[_0x15fd('0x28')],'rows':_0x386c9b});});},'Outbound':function(){return new Promise(function(_0x369f35){_0x369f35(_0x5e1d7e['outbound']);});},'Campaigns':function(){return new Promise(function(_0x484cd1){var _0xcf21c7=_['values'](_0x5e1d7e[_0x15fd('0x4c')]);_0x484cd1({'count':_0xcf21c7[_0x15fd('0x28')],'rows':_0xcf21c7});});},'VoiceQueuesPreview':function(_0x166016){var _0x2121cb=this;return new Promise(function(_0x2d1c93,_0x54ab7d){_0x1e3b97[_0x15fd('0x4d')](_0x166016['id'])[_0x15fd('0x17')](function(_0x50bd27){_0x2d1c93({'code':0xc8,'message':_0x50bd27[_0x15fd('0x18')]});})[_0x15fd('0x19')](function(_0x582cce){_0x54ab7d(_0x2121cb[_0x15fd('0x1b')](0x1f4,_0x582cce[_0x15fd('0x18')]));});});},'EventManager':function(_0x1d529d){var _0x438ee3=this;return new Promise(function(_0x39b777,_0x44d78d){if(!_0x1d529d[_0x15fd('0x4e')]){return _0x44d78d(_0x438ee3[_0x15fd('0x1b')](0x1f4,_0x15fd('0x4f')));}ami[_0x15fd('0x50')](_0x15fd('0x51')+_0x1d529d['event'],_0x1d529d[_0x15fd('0x18')]);_0x39b777({'code':0xc8,'message':_0x1d529d});});},'FaxAccounts':function(){return new Promise(function(_0x5cddfd){var _0x3614dd=_[_0x15fd('0x3d')](_0x5e1d7e[_0x15fd('0x52')]);_0x5cddfd({'count':_0x3614dd[_0x15fd('0x28')],'rows':_0x3614dd});});},'SendFax':function(_0x58f942){var _0x583f38=this;return new Promise(function(_0x19e46b,_0x32d748){_0x386441[_0x15fd('0x53')](_0x58f942)['then'](function(_0x2023ba){_0x19e46b({'code':0xc8,'message':_0x2023ba[_0x15fd('0x18')]});})['catch'](function(_0x88fbae){_0x32d748(_0x583f38[_0x15fd('0x1b')](0x1f4,_0x88fbae[_0x15fd('0x18')]));});});},'CheckAfterSend':function(_0x57089a){var _0x112122=this;return new Promise(function(_0x3bc908,_0x3146bd){_0x386441[_0x15fd('0x54')](_0x57089a)[_0x15fd('0x17')](function(_0x2d24a2){_0x3bc908({'code':0xc8,'message':_0x2d24a2[_0x15fd('0x18')]});})[_0x15fd('0x19')](function(_0x15a645){_0x3146bd(_0x112122[_0x15fd('0x1b')](0x1f4,_0x15a645[_0x15fd('0x18')]));});});}};var _0x3cab37=jayson['server'](_0x225728)[_0x15fd('0x55')]();_0x3cab37['on'](_0x15fd('0x1b'),function(_0x2026b8){return _0x2e88bf(_0x2026b8);});_0x3cab37[_0x15fd('0x6')](0x232a,_0x15fd('0x56'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x18450c(_0x15fd('0x57')+0x232a);});});}; \ No newline at end of file +var _0xc3b5=['filter','count','rows','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','context','telephones','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts','send','checkAfterSend','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','join','reload','module','action','Action','then','catch','message','pick','command','Command','content','voiceQueues','push','length','find','omit','undefined','values','channels','ami\x20disconnected','voicechannel','map','uniqueid','channel','filename','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','inbound','outbound','type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x242db9,_0x2fdb28){_0x242db9=_0x242db9-0x0;var _0x26c49e=_0xc3b5[_0x242db9];return _0x26c49e;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0x5c3b('0x0'));var schema=require(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var config=require(_0x5c3b('0x3'));var properties=require(_0x5c3b('0x4'));var ami=require(_0x5c3b('0x5'));var VoiceQueueSummary=require(_0x5c3b('0x6'));exports[_0x5c3b('0x7')]=function(_0x587055,_0x181e5b,_0x6b8a1e){return new Promise(function(_0x56345e,_0x568a28){var _0x30a08f={'QueuePause':function(_0x420839){return new Promise(function(_0x3892ad){var _0x5be9ee=util[_0x5c3b('0x8')](_0x5c3b('0x9'),_0x5c3b('0xa'),_0x420839[_0x5c3b('0xb')]);if(_0x587055['timers']&&_0x587055[_0x5c3b('0xc')][_0x5be9ee]&&_0x587055[_0x5c3b('0xc')][_0x5be9ee][_0x5c3b('0xd')]){_0x587055[_0x5c3b('0xc')][_0x5be9ee][_0x5c3b('0xe')]();}if(_0x587055['agents'][_0x5be9ee]){_0x587055[_0x5c3b('0xf')][_0x5be9ee][_0x5c3b('0x10')]({'statePause':_0x420839['pause']?!![]:![]});}_0x3892ad({'code':0xc8,'message':_0x5c3b('0x11')});});},'Reload':function(_0x3b953d){var _0x507c2e=this;return new Promise(function(_0x24b9d0,_0xbff1cc){if(ami[_0x5c3b('0x12')]()==![]){return _0xbff1cc(_0x507c2e[_0x5c3b('0x13')](0x1f4,[config[_0x5c3b('0x14')]['ip'],config[_0x5c3b('0x14')][_0x5c3b('0x15')],'ami\x20disconnected'][_0x5c3b('0x16')]('\x20')));}_0x3b953d=_['pick'](_0x3b953d,_['keys'](properties[_0x5c3b('0x17')][_0x5c3b('0x18')]));_0x3b953d[_0x5c3b('0x19')]='Reload';return ami[_0x5c3b('0x1a')](_0x3b953d)[_0x5c3b('0x1b')](function(_0x5b5810){_0x24b9d0({'code':0xc8,'message':_0x5b5810['message']});})[_0x5c3b('0x1c')](function(_0x34144d){_0xbff1cc(_0x507c2e['error'](0x1f5,_0x34144d[_0x5c3b('0x1d')]));});});},'Command':function(_0x4658ce){var _0x2b2307=this;return new Promise(function(_0x681ac1,_0x103943){if(ami[_0x5c3b('0x12')]()==![]){return _0x103943(_0x2b2307[_0x5c3b('0x13')](0x1f4,[config[_0x5c3b('0x14')]['ip'],config[_0x5c3b('0x14')][_0x5c3b('0x15')],'ami\x20disconnected']['join']('\x20')));}_0x4658ce=_[_0x5c3b('0x1e')](_0x4658ce,_0x5c3b('0x1f'));_0x4658ce['action']=_0x5c3b('0x20');return ami['Action'](_0x4658ce)[_0x5c3b('0x1b')](function(_0xb8006){_0x681ac1({'code':0xc8,'message':_0xb8006[_0x5c3b('0x21')]});})[_0x5c3b('0x1c')](function(_0x529c39){_0x103943(_0x2b2307[_0x5c3b('0x13')](0x1f5,_0x529c39[_0x5c3b('0x1d')]));});});},'VoiceQueues':function(){return new Promise(function(_0x54ab06){var _0x17f86d=[];for(var _0x2c8682 in _0x587055[_0x5c3b('0x22')]){if(_0x587055[_0x5c3b('0x22')]['hasOwnProperty'](_0x2c8682)){var _0x15ae38=_0x587055[_0x5c3b('0x22')][_0x2c8682];var _0x2099dc=new VoiceQueueSummary(_0x15ae38);_0x17f86d[_0x5c3b('0x23')](_0x2099dc);}}_0x54ab06({'count':_0x17f86d[_0x5c3b('0x24')],'rows':_0x17f86d});});},'UpdateVoiceQueue':function(_0x2a293d){return new Promise(function(_0x511963,_0x51fa32){var _0x4796ab=_[_0x5c3b('0x25')](_0x587055[_0x5c3b('0x22')],{'id':parseInt(_0x2a293d['id'])});var _0x59b640=_[_0x5c3b('0x26')](_0x2a293d,['id']);if(_0x4796ab){for(var _0x15044e in _0x59b640){if(typeof _0x59b640[_0x15044e]!==_0x5c3b('0x27')&&typeof _0x4796ab[_0x15044e]!==_0x5c3b('0x27')){_0x4796ab[_0x15044e]=_0x59b640[_0x15044e];}}_0x511963(_0x4796ab);}else{_0x51fa32();}});},'VoiceChannels':function(){return new Promise(function(_0x19a73d){var _0x35b48e=_[_0x5c3b('0x28')](_0x587055[_0x5c3b('0x29')]);_0x19a73d({'count':_0x35b48e[_0x5c3b('0x24')],'rows':_0x35b48e});});},'VoiceChannelMixMonitor':function(_0x13ca8a){var _0x4765b3=this;return new Promise(function(_0x347b91,_0x5a5d9e){if(ami[_0x5c3b('0x12')]()==![]){return _0x5a5d9e(_0x4765b3[_0x5c3b('0x13')](0x1f4,[config[_0x5c3b('0x14')]['ip'],config[_0x5c3b('0x14')][_0x5c3b('0x15')],_0x5c3b('0x2a')][_0x5c3b('0x16')]('\x20')));}var _0x2e2b9c=schema(properties[_0x5c3b('0x2b')])[_0x5c3b('0x1')](_0x13ca8a);if(_0x2e2b9c[_0x5c3b('0x24')]>0x0){return _0x5a5d9e(_0x4765b3[_0x5c3b('0x13')](0x1f4,_[_0x5c3b('0x2c')](_0x2e2b9c,_0x5c3b('0x1d'))[_0x5c3b('0x16')](',\x20')));}var _0xdd0996=_[_0x5c3b('0x25')](_0x587055['channels'],{'uniqueid':_0x13ca8a[_0x5c3b('0x2d')]});if(_0xdd0996&&_0xdd0996[_0x5c3b('0x2e')]){var _0x389c53=util[_0x5c3b('0x8')]('%s.%s',_0x13ca8a[_0x5c3b('0x2f')]||_0x13ca8a[_0x5c3b('0x2d')],_0x13ca8a['format']||_0x5c3b('0x30'));return ami[_0x5c3b('0x1a')]({'action':_0x5c3b('0x31'),'channel':_0xdd0996[_0x5c3b('0x2e')],'file':_0x389c53,'options':_0x5c3b('0x32')})[_0x5c3b('0x1b')](function(_0x27b34d){var _0x22fe25=_[_0x5c3b('0x25')](_0xdd0996['monitors'],{'filename':_0x5c3b('0x33')+_0x389c53[_0x5c3b('0x34')]()});if(_['isNil'](_0x22fe25)){_0xdd0996['monitors'][_0x5c3b('0x23')]({'filename':_0x5c3b('0x33')+_0x389c53[_0x5c3b('0x34')](),'createdAt':moment()[_0x5c3b('0x8')](_0x5c3b('0x35')),'mixmonitorid':_0x27b34d[_0x5c3b('0x36')],'status':_0x5c3b('0x37')});}else{_0x22fe25['mixmonitorid']=_0x27b34d['mixmonitorid'];_0x22fe25[_0x5c3b('0x38')]=_0x5c3b('0x37');}_0x347b91({'code':0xc8,'message':[_0x13ca8a[_0x5c3b('0x2d')],_0x5c3b('0x39'),_0x27b34d['mixmonitorid']][_0x5c3b('0x16')]('\x20'),'mixmonitorid':_0x27b34d['mixmonitorid']});})[_0x5c3b('0x1c')](function(_0x33f3ac){_0x5a5d9e(_0x4765b3[_0x5c3b('0x13')](0x1f5,[_0x13ca8a[_0x5c3b('0x2d')],_0x33f3ac[_0x5c3b('0x1d')][_0x5c3b('0x34')]()][_0x5c3b('0x16')]('\x20')));});}else{return _0x5a5d9e(_0x4765b3[_0x5c3b('0x13')](0x1f5,_0x5c3b('0x3a')));}});},'VoiceChannelStopMixMonitor':function(_0x546827){var _0x5d2fb3=this;return new Promise(function(_0x345149,_0x34f04b){if(ami[_0x5c3b('0x12')]()==![]){return _0x34f04b(_0x5d2fb3[_0x5c3b('0x13')](0x1f4,[config[_0x5c3b('0x14')]['ip'],config[_0x5c3b('0x14')][_0x5c3b('0x15')],_0x5c3b('0x2a')][_0x5c3b('0x16')]('\x20')));}var _0x56a53e=schema(properties[_0x5c3b('0x2b')])[_0x5c3b('0x1')](_0x546827);if(_0x56a53e[_0x5c3b('0x24')]>0x0){return _0x34f04b(_0x5d2fb3['error'](0x1f4,_[_0x5c3b('0x2c')](_0x56a53e,_0x5c3b('0x1d'))[_0x5c3b('0x16')](',\x20')));}var _0x5addf6=_[_0x5c3b('0x25')](_0x587055[_0x5c3b('0x29')],{'uniqueid':_0x546827[_0x5c3b('0x2d')]});if(_0x5addf6){return Promise[_0x5c3b('0x3b')]()[_0x5c3b('0x1b')](function(){if(_0x5addf6[_0x5c3b('0x2e')]){return ami[_0x5c3b('0x1a')]({'action':'StopMixMonitor','channel':_0x5addf6[_0x5c3b('0x2e')],'mixmonitorid':_0x546827['mixmonitorid']})[_0x5c3b('0x1c')](function(){});}})[_0x5c3b('0x1b')](function(){if(_0x5addf6['destinationchannel']){return ami[_0x5c3b('0x1a')]({'action':_0x5c3b('0x3c'),'channel':_0x5addf6[_0x5c3b('0x3d')],'mixmonitorid':_0x546827['mixmonitorid']})[_0x5c3b('0x1c')](function(){});}})['then'](function(){var _0x176b50=_[_0x5c3b('0x25')](_0x5addf6[_0x5c3b('0x3e')],{'mixmonitorid':_0x546827[_0x5c3b('0x36')]});if(_0x176b50){_0x176b50[_0x5c3b('0x38')]=_0x5c3b('0x3f');}})[_0x5c3b('0x1b')](function(){var _0x3d6034=util[_0x5c3b('0x8')](_0x5c3b('0x40'),_0x546827[_0x5c3b('0x2f')]||_0x546827['uniqueid'],_0x546827[_0x5c3b('0x8')]||'wav');var _0x155b22=_[_0x5c3b('0x25')](_0x5addf6[_0x5c3b('0x3e')],{'filename':'/var/spool/asterisk/monitor/'+_0x3d6034[_0x5c3b('0x34')]()});if(_0x155b22){_0x155b22[_0x5c3b('0x38')]='stop';}})[_0x5c3b('0x1b')](function(){_0x345149({'code':0xc8,'message':[_0x546827[_0x5c3b('0x2d')],_0x5c3b('0x41')][_0x5c3b('0x16')]('\x20')});})[_0x5c3b('0x1c')](function(_0x44aaad){_0x34f04b(_0x5d2fb3[_0x5c3b('0x13')](0x1f5,[_0x546827[_0x5c3b('0x2d')],_0x44aaad[_0x5c3b('0x1d')][_0x5c3b('0x34')]()][_0x5c3b('0x16')]('\x20')));});}else{return _0x34f04b(_0x5d2fb3['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x50fbb6){var _0x434c28=this;return new Promise(function(_0x203ae2){var _0x5f14fa=_[_0x5c3b('0x28')](_0x587055[_0x5c3b('0x42')]);var _0x1a978b={'count':_0x5f14fa[_0x5c3b('0x24')],'rows':_0x5f14fa};if(_0x50fbb6&&_0x50fbb6['type']){if(![_0x5c3b('0x43'),_0x5c3b('0x44')]['includes'](_0x50fbb6[_0x5c3b('0x45')])){return _0x568a28(_0x434c28[_0x5c3b('0x13')](0x190,_0x5c3b('0x46')));}var _0x98bcef=_[_0x5c3b('0x47')](_0x5f14fa,function(_0x1ba2da){return _0x1ba2da[_0x5c3b('0x45')]===_0x50fbb6[_0x5c3b('0x45')];});_0x1a978b[_0x5c3b('0x48')]=_0x98bcef[_0x5c3b('0x24')];_0x1a978b[_0x5c3b('0x49')]=_0x98bcef;}_0x203ae2(_0x1a978b);});},'VoiceQueuesChannel':function(_0x24187d){var _0x42b1d9=this;return new Promise(function(_0x5b07ee,_0x5191b5){var _0x2602ff=schema(properties[_0x5c3b('0x4a')])[_0x5c3b('0x1')](_0x24187d);if(_0x2602ff['length']>0x0){return _0x5191b5(_0x42b1d9['error'](0x1f4,_['map'](_0x2602ff,_0x5c3b('0x1d'))['join'](',\x20')));}var _0x2ddd9d=_[_0x5c3b('0x25')](_0x587055[_0x5c3b('0x42')],{'uniqueid':_0x24187d[_0x5c3b('0x2d')]});if(_0x2ddd9d){_0x5b07ee(_0x2ddd9d);}else{return _0x5191b5(_0x42b1d9[_0x5c3b('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x23d7cb){var _0x4fffb5=this;return new Promise(function(_0x2656da,_0x5e55e4){if(ami[_0x5c3b('0x12')]()==![]){return _0x5e55e4(_0x4fffb5[_0x5c3b('0x13')](0x1f4,[config[_0x5c3b('0x14')]['ip'],config[_0x5c3b('0x14')][_0x5c3b('0x15')],_0x5c3b('0x2a')][_0x5c3b('0x16')]('\x20')));}var _0x409d2e=schema(properties[_0x5c3b('0x4b')])[_0x5c3b('0x1')](_0x23d7cb);if(_0x409d2e[_0x5c3b('0x24')]>0x0){return _0x5e55e4(_0x4fffb5['error'](0x1f4,_['map'](_0x409d2e,'message')[_0x5c3b('0x16')](',\x20')));}var _0x15345e=_[_0x5c3b('0x25')](_0x587055[_0x5c3b('0x42')],{'uniqueid':_0x23d7cb['uniqueid']});if(_0x15345e&&_0x15345e['channel']){return ami[_0x5c3b('0x1a')]({'action':'Hangup','channel':_0x15345e['channel']})[_0x5c3b('0x1b')](function(_0x2b4ea3){_0x2656da({'code':0xc8,'message':[_0x23d7cb[_0x5c3b('0x2d')],_0x2b4ea3[_0x5c3b('0x1d')][_0x5c3b('0x34')]()][_0x5c3b('0x16')]('\x20')});})[_0x5c3b('0x1c')](function(_0x13043b){_0x5e55e4(_0x4fffb5[_0x5c3b('0x13')](0x1f5,[_0x23d7cb[_0x5c3b('0x2d')],_0x13043b[_0x5c3b('0x1d')][_0x5c3b('0x34')]()]['join']('\x20')));});}else{return _0x5e55e4(_0x4fffb5[_0x5c3b('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x80afe9){var _0x35b9f8=this;return new Promise(function(_0x2e0907,_0x237ed2){if(ami[_0x5c3b('0x12')]()==![]){return _0x237ed2(_0x35b9f8[_0x5c3b('0x13')](0x1f4,[config[_0x5c3b('0x14')]['ip'],config[_0x5c3b('0x14')]['username'],_0x5c3b('0x2a')]['join']('\x20')));}var _0x56c5bb=schema(properties[_0x5c3b('0x4c')])[_0x5c3b('0x1')](_0x80afe9);if(_0x56c5bb[_0x5c3b('0x24')]>0x0){return _0x237ed2(_0x35b9f8['error'](0x1f4,_[_0x5c3b('0x2c')](_0x56c5bb,_0x5c3b('0x1d'))[_0x5c3b('0x16')](',\x20')));}var _0x497515=_[_0x5c3b('0x25')](_0x587055['queueChannels'],{'uniqueid':_0x80afe9[_0x5c3b('0x2d')]});if(_0x497515&&_0x497515[_0x5c3b('0x2e')]){return ami[_0x5c3b('0x1a')]({'action':'Redirect','channel':_0x497515[_0x5c3b('0x2e')],'exten':_0x80afe9['exten'],'context':_0x80afe9[_0x5c3b('0x4d')]||_0x497515[_0x5c3b('0x4d')],'priority':0x1})[_0x5c3b('0x1b')](function(_0x5b1028){_0x2e0907({'code':0xc8,'message':[_0x80afe9[_0x5c3b('0x2d')],_0x5b1028['message'][_0x5c3b('0x34')]()][_0x5c3b('0x16')]('\x20')});})[_0x5c3b('0x1c')](function(_0x1c468f){_0x237ed2(_0x35b9f8[_0x5c3b('0x13')](0x1f5,[_0x80afe9[_0x5c3b('0x2d')],_0x1c468f[_0x5c3b('0x1d')][_0x5c3b('0x34')]()][_0x5c3b('0x16')]('\x20')));});}else{return _0x237ed2(_0x35b9f8[_0x5c3b('0x13')](0x1f5,_0x5c3b('0x3a')));}});},'Agents':function(_0x445217){return new Promise(function(_0x467427){var _0x4a07c5=_[_0x5c3b('0x28')](_0x587055[_0x5c3b('0xf')]);if(_0x445217&&_0x445217['id']){var _0x57fda1=_[_0x5c3b('0x25')](_0x4a07c5,function(_0x1ddb1d){return _0x1ddb1d['id']===_0x445217['id'];});_0x467427(_0x57fda1);}else{_0x467427({'count':_0x4a07c5[_0x5c3b('0x24')],'rows':_0x4a07c5});}});},'Telephones':function(){return new Promise(function(_0x40ec2b){var _0x398396=_[_0x5c3b('0x28')](_0x587055[_0x5c3b('0x4e')]);_0x40ec2b({'count':_0x398396[_0x5c3b('0x24')],'rows':_0x398396});});},'Trunks':function(){return new Promise(function(_0x348fc4){var _0x50f6ab=_['values'](_0x587055['trunks']);_0x348fc4({'count':_0x50f6ab['length'],'rows':_0x50f6ab});});},'OutboundChannels':function(){return new Promise(function(_0x5ac5dd){var _0x274b66=_[_0x5c3b('0x28')](_0x587055[_0x5c3b('0x4f')]);_0x5ac5dd({'count':_0x274b66['length'],'rows':_0x274b66});});},'Outbound':function(){return new Promise(function(_0x324525){_0x324525(_0x587055['outbound']);});},'Campaigns':function(){return new Promise(function(_0x328170){var _0x1aa23c=_[_0x5c3b('0x28')](_0x587055[_0x5c3b('0x50')]);_0x328170({'count':_0x1aa23c[_0x5c3b('0x24')],'rows':_0x1aa23c});});},'VoiceQueuesPreview':function(_0xbc0e51){var _0x183fa9=this;return new Promise(function(_0x1db4f0,_0x419955){_0x181e5b[_0x5c3b('0x51')](_0xbc0e51['id'])[_0x5c3b('0x1b')](function(_0x3fc618){_0x1db4f0({'code':0xc8,'message':_0x3fc618['message']});})[_0x5c3b('0x1c')](function(_0x1df72a){_0x419955(_0x183fa9[_0x5c3b('0x13')](0x1f4,_0x1df72a[_0x5c3b('0x1d')]));});});},'EventManager':function(_0x3d2b86){var _0xa84b04=this;return new Promise(function(_0x4b741d,_0x5f14dc){if(!_0x3d2b86[_0x5c3b('0x52')]){return _0x5f14dc(_0xa84b04[_0x5c3b('0x13')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x5c3b('0x53')](_0x5c3b('0x54')+_0x3d2b86[_0x5c3b('0x52')],_0x3d2b86['message']);_0x4b741d({'code':0xc8,'message':_0x3d2b86});});},'FaxAccounts':function(){return new Promise(function(_0x92d28d){var _0x1ca6cb=_[_0x5c3b('0x28')](_0x587055[_0x5c3b('0x55')]);_0x92d28d({'count':_0x1ca6cb['length'],'rows':_0x1ca6cb});});},'SendFax':function(_0x4ba6a0){var _0x1fa3fc=this;return new Promise(function(_0x15550d,_0xfb1dd0){_0x6b8a1e[_0x5c3b('0x56')](_0x4ba6a0)[_0x5c3b('0x1b')](function(_0x1545f2){_0x15550d({'code':0xc8,'message':_0x1545f2[_0x5c3b('0x1d')]});})[_0x5c3b('0x1c')](function(_0x41bc7a){_0xfb1dd0(_0x1fa3fc['error'](0x1f4,_0x41bc7a[_0x5c3b('0x1d')]));});});},'CheckAfterSend':function(_0x2348cb){var _0x394f3e=this;return new Promise(function(_0x30f7ab,_0xd88dc8){_0x6b8a1e[_0x5c3b('0x57')](_0x2348cb)[_0x5c3b('0x1b')](function(_0x36c6cd){_0x30f7ab({'code':0xc8,'message':_0x36c6cd[_0x5c3b('0x1d')]});})['catch'](function(_0x40a3d9){_0xd88dc8(_0x394f3e[_0x5c3b('0x13')](0x1f4,_0x40a3d9[_0x5c3b('0x1d')]));});});}};var _0x39a477=jayson['server'](_0x30a08f)['http']();_0x39a477['on']('error',function(_0x36df93){return _0x568a28(_0x36df93);});_0x39a477[_0x5c3b('0x7')](0x232a,_0x5c3b('0x58'),function(){console['log'](_0x5c3b('0x59'),0x232a);return _0x56345e(_0x5c3b('0x5a')+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 1750502..d6ab6d0 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 _0x8a8a=['calleridname','','Unknown','destcalleridname','createContact','push','format','user:%s','name','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data5','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil'];(function(_0xa9c122,_0x3e1630){var _0x5994b6=function(_0xe36aa3){while(--_0xe36aa3){_0xa9c122['push'](_0xa9c122['shift']());}};_0x5994b6(++_0x3e1630);}(_0x8a8a,0x1f2));var _0xa8a8=function(_0x571a53,_0x169654){_0x571a53=_0x571a53-0x0;var _0x28d033=_0x8a8a[_0x571a53];return _0x28d033;};'use strict';var _=require(_0xa8a8('0x0'));var BPromise=require(_0xa8a8('0x1'));var Redis=require(_0xa8a8('0x2'));var util=require(_0xa8a8('0x3'));var config=require(_0xa8a8('0x4'));var logger=require('../../../../config/logger')(_0xa8a8('0x5'));var cmContactRpc=require(_0xa8a8('0x6'));config['redis']=_[_0xa8a8('0x7')](config[_0xa8a8('0x8')],{'host':_0xa8a8('0x9'),'port':0x18eb});var io=require(_0xa8a8('0xa'))(new Redis(config[_0xa8a8('0x8')]));function emit(_0x44fa1e,_0x405460,_0x11ee6c,_0x9b70ce,_0x516379){logger[_0xa8a8('0xb')](_0xa8a8('0xc'),_0x44fa1e,_0x405460['id'],_0x11ee6c,_0x9b70ce,JSON[_0xa8a8('0xd')](_0x516379));io['to'](_0x11ee6c)[_0xa8a8('0xe')](_0x9b70ce,_0x516379);}exports[_0xa8a8('0xf')]=function(_0x325271,_0x3ecc68,_0x3d19fa,_0x31b069){var _0x43faab,_0x59807c;var _0x524a89={};var _0x3bcd8b;var _0x4ca454=Number(_0x3d19fa['data1']);var _0x13a55e=_0x3d19fa['data2']?Boolean(Number(_0x3d19fa['data2'])):![];var _0x364371;var _0x289466=![];if(!_['isNil'](_0x3d19fa[_0xa8a8('0x10')])){if(_0x3d19fa['data5']=='1')_0x289466=!![];}if(!_0x289466){if(_0x31b069[_0xa8a8('0x11')]){_0x524a89['id']=_0x31b069['xmd-contactid'];}}if(!_0x524a89['id']){_0x524a89['ListId']=_0x4ca454;_0x364371=_0x3d19fa['data3']&&_0x3d19fa['data3']!=='0'?_0x3d19fa[_0xa8a8('0x12')][_0xa8a8('0x13')](','):[_0xa8a8('0x14')];_0x524a89[_0xa8a8('0x15')]=_[_0xa8a8('0x16')](_0x364371,function(_0x5bb88a){var _0x1813b9={};_0x1813b9[_0x5bb88a]=_0x31b069[_0xa8a8('0x17')]?_0x31b069[_0xa8a8('0x18')]:_0x31b069[_0xa8a8('0x19')];return _0x1813b9;});_0x3bcd8b=_0x31b069[_0xa8a8('0x17')]?_0x31b069[_0xa8a8('0x18')]:_0x31b069['calleridnum'];}var _0x5075a1=['id',_0xa8a8('0x1a'),'lastName','phone',_0xa8a8('0x1b'),_0xa8a8('0x1c'),'ListId',_0xa8a8('0x1d'),'scheduledAt',_0xa8a8('0x1e')];var _0x2949b7=_[_0xa8a8('0x1f')](_0x5075a1,_0x364371);BPromise[_0xa8a8('0x20')]()[_0xa8a8('0x21')](cmContactRpc[_0xa8a8('0x22')]({'attributes':_0x2949b7,'where':_0x524a89,'phone':_0x3bcd8b}))[_0xa8a8('0x21')](function(_0xd48299){_0x59807c=_0xd48299;if(!_['isEmpty'](_0x59807c)){if(_0x59807c['length']===0x1){_0x43faab=_0x59807c[0x0];logger[_0xa8a8('0xb')](_0xa8a8('0x23'),_0x31b069[_0xa8a8('0x24')],_0x3ecc68['id'],_0x43faab['id']);}else{logger[_0xa8a8('0xb')](_0xa8a8('0x25'),_0x31b069[_0xa8a8('0x24')],_0x3ecc68['id'],_[_0xa8a8('0x16')](_0x59807c,'id')['join'](','));}return;}else{logger[_0xa8a8('0xb')](_0xa8a8('0x26'),_0x31b069[_0xa8a8('0x24')],_0x3ecc68['id']);var _0x1c8008={'ListId':_0x4ca454};var _0x2718cd=_0x3d19fa[_0xa8a8('0x27')]&&_0x3d19fa[_0xa8a8('0x27')]!=='0'?_0x3d19fa['data4']:_0xa8a8('0x14');if(_0x13a55e){logger[_0xa8a8('0xb')](_0xa8a8('0x28'),_0x31b069[_0xa8a8('0x24')],_0x3ecc68['id']);_0x1c8008[_0x2718cd]=_['isNil'](_0x31b069[_0xa8a8('0x17')])?_0x31b069['calleridnum']:_0x31b069['destcalleridnum'];if(_[_0xa8a8('0x29')](_0x31b069[_0xa8a8('0x17')])){_0x1c8008[_0xa8a8('0x1a')]=_0x31b069[_0xa8a8('0x2a')]&&_0x31b069['calleridname']!==_0xa8a8('0x2b')?_0x31b069[_0xa8a8('0x2a')]:_0xa8a8('0x2c');}else{_0x1c8008[_0xa8a8('0x1a')]=_0x31b069['destcalleridname']&&_0x31b069[_0xa8a8('0x2d')]!==''?_0x31b069[_0xa8a8('0x2d')]:_0xa8a8('0x2c');}return BPromise[_0xa8a8('0x20')]()[_0xa8a8('0x21')](cmContactRpc[_0xa8a8('0x2e')](_0x1c8008))[_0xa8a8('0x21')](function(_0x5cd759){_0x43faab=_0x5cd759;_0x59807c[_0xa8a8('0x2f')](_0x5cd759);if(_0x43faab){logger[_0xa8a8('0xb')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x31b069[_0xa8a8('0x24')],_0x3ecc68['id'],_0x43faab['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x31b069[_0xa8a8('0x24')],_0x3ecc68['id']);_0x1c8008[_0x2718cd]=_['isNil'](_0x31b069[_0xa8a8('0x17')])?_0x31b069['calleridnum']:_0x31b069[_0xa8a8('0x18')];if(_['isNil'](_0x31b069[_0xa8a8('0x17')])){_0x1c8008[_0xa8a8('0x1a')]=_0x31b069[_0xa8a8('0x2a')]&&_0x31b069[_0xa8a8('0x2a')]!==_0xa8a8('0x2b')?_0x31b069['calleridname']:_0xa8a8('0x2c');}else{_0x1c8008['firstName']=_0x31b069[_0xa8a8('0x2d')]&&_0x31b069[_0xa8a8('0x2d')]!==_0xa8a8('0x2b')?_0x31b069[_0xa8a8('0x2d')]:_0xa8a8('0x2c');}_0x43faab=_0x1c8008;_0x59807c[_0xa8a8('0x2f')](_0x1c8008);return;}}})[_0xa8a8('0x21')](function(){if(_0x325271){emit(_0x31b069[_0xa8a8('0x24')],_0x3ecc68,util[_0xa8a8('0x30')](_0xa8a8('0x31'),_0x325271[_0xa8a8('0x32')]),util['format']('trigger:%s',_0x3d19fa[_0xa8a8('0x33')][_0xa8a8('0x34')]()),{'evt':_[_0xa8a8('0x35')](_0x31b069,{'autoCreate':_0x13a55e}),'contact':_0x43faab===undefined?{}:_0x43faab,'contacts':_0x59807c['length']===0x0?undefined:_0x59807c});}});}; \ No newline at end of file +var _0x8e93=['data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','destcalleridnum','calleridnum','firstName','mobile','scheduledAt','updatedAt','union','resolve','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4','routeId','calleridname','','Unknown','destcalleridname','then','push','[CM][%s][%s]\x20Contact\x20created:%s','user:%s','name','trigger:%s','merge','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1'];(function(_0x28127a,_0x437784){var _0x36e6f8=function(_0x1b9f07){while(--_0x1b9f07){_0x28127a['push'](_0x28127a['shift']());}};_0x36e6f8(++_0x437784);}(_0x8e93,0xba));var _0x38e9=function(_0xb3701a,_0x4c26ac){_0xb3701a=_0xb3701a-0x0;var _0x3f2375=_0x8e93[_0xb3701a];return _0x3f2375;};'use strict';var _=require('lodash');var BPromise=require(_0x38e9('0x0'));var Redis=require(_0x38e9('0x1'));var util=require(_0x38e9('0x2'));var config=require(_0x38e9('0x3'));var logger=require('../../../../config/logger')(_0x38e9('0x4'));var cmContactRpc=require(_0x38e9('0x5'));config[_0x38e9('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x38e9('0x7'))(new Redis(config[_0x38e9('0x6')]));function emit(_0x107001,_0x4a2856,_0x3a3237,_0x4ee09,_0xbf3e86){logger[_0x38e9('0x8')](_0x38e9('0x9'),_0x107001,_0x4a2856['id'],_0x3a3237,_0x4ee09,JSON[_0x38e9('0xa')](_0xbf3e86));io['to'](_0x3a3237)[_0x38e9('0xb')](_0x4ee09,_0xbf3e86);}exports[_0x38e9('0xc')]=function(_0x328bb4,_0x4e18e4,_0x59c0c8,_0xebddf7){var _0x1719cc,_0x1a1a6b;var _0x3ffd40={};var _0x3fe313;var _0x511bc5=Number(_0x59c0c8[_0x38e9('0xd')]);var _0x8976ff=_0x59c0c8[_0x38e9('0xe')]?Boolean(Number(_0x59c0c8[_0x38e9('0xe')])):![];var _0xb3d1ed;var _0x1d721a=![];if(!_[_0x38e9('0xf')](_0x59c0c8[_0x38e9('0x10')])){if(_0x59c0c8[_0x38e9('0x10')]=='1')_0x1d721a=!![];}if(!_0x1d721a){if(_0xebddf7['xmd-contactid']){_0x3ffd40['id']=_0xebddf7[_0x38e9('0x11')];}}if(!_0x3ffd40['id']){_0x3ffd40[_0x38e9('0x12')]=_0x511bc5;_0xb3d1ed=_0x59c0c8[_0x38e9('0x13')]&&_0x59c0c8[_0x38e9('0x13')]!=='0'?_0x59c0c8[_0x38e9('0x13')]['split'](','):[_0x38e9('0x14')];_0x3ffd40[_0x38e9('0x15')]=_[_0x38e9('0x16')](_0xb3d1ed,function(_0x13ae8a){var _0x840302={};_0x840302[_0x13ae8a]=_0xebddf7['routeId']?_0xebddf7[_0x38e9('0x17')]:_0xebddf7[_0x38e9('0x18')];return _0x840302;});_0x3fe313=_0xebddf7['routeId']?_0xebddf7['destcalleridnum']:_0xebddf7[_0x38e9('0x18')];}var _0xfccd24=['id',_0x38e9('0x19'),'lastName',_0x38e9('0x14'),_0x38e9('0x1a'),'fax',_0x38e9('0x12'),'createdAt',_0x38e9('0x1b'),_0x38e9('0x1c')];var _0x1b0b1d=_[_0x38e9('0x1d')](_0xfccd24,_0xb3d1ed);BPromise[_0x38e9('0x1e')]()['then'](cmContactRpc['getContacts']({'attributes':_0x1b0b1d,'where':_0x3ffd40,'phone':_0x3fe313}))['then'](function(_0x4c929b){_0x1a1a6b=_0x4c929b;if(!_[_0x38e9('0x1f')](_0x1a1a6b)){if(_0x1a1a6b[_0x38e9('0x20')]===0x1){_0x1719cc=_0x1a1a6b[0x0];logger[_0x38e9('0x8')](_0x38e9('0x21'),_0xebddf7['uniqueid'],_0x4e18e4['id'],_0x1719cc['id']);}else{logger[_0x38e9('0x8')](_0x38e9('0x22'),_0xebddf7['uniqueid'],_0x4e18e4['id'],_[_0x38e9('0x16')](_0x1a1a6b,'id')['join'](','));}return;}else{logger[_0x38e9('0x8')](_0x38e9('0x23'),_0xebddf7[_0x38e9('0x24')],_0x4e18e4['id']);var _0x10ba5a={'ListId':_0x511bc5};var _0x29c469=_0x59c0c8['data4']&&_0x59c0c8[_0x38e9('0x25')]!=='0'?_0x59c0c8[_0x38e9('0x25')]:_0x38e9('0x14');if(_0x8976ff){logger[_0x38e9('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xebddf7[_0x38e9('0x24')],_0x4e18e4['id']);_0x10ba5a[_0x29c469]=_['isNil'](_0xebddf7[_0x38e9('0x26')])?_0xebddf7['calleridnum']:_0xebddf7[_0x38e9('0x17')];if(_[_0x38e9('0xf')](_0xebddf7['routeId'])){_0x10ba5a[_0x38e9('0x19')]=_0xebddf7['calleridname']&&_0xebddf7[_0x38e9('0x27')]!==_0x38e9('0x28')?_0xebddf7['calleridname']:_0x38e9('0x29');}else{_0x10ba5a[_0x38e9('0x19')]=_0xebddf7['destcalleridname']&&_0xebddf7[_0x38e9('0x2a')]!==_0x38e9('0x28')?_0xebddf7[_0x38e9('0x2a')]:'Unknown';}return BPromise[_0x38e9('0x1e')]()[_0x38e9('0x2b')](cmContactRpc['createContact'](_0x10ba5a))['then'](function(_0x18d5f4){_0x1719cc=_0x18d5f4;_0x1a1a6b[_0x38e9('0x2c')](_0x18d5f4);if(_0x1719cc){logger[_0x38e9('0x8')](_0x38e9('0x2d'),_0xebddf7[_0x38e9('0x24')],_0x4e18e4['id'],_0x1719cc['id']);}return;});}else{logger[_0x38e9('0x8')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xebddf7[_0x38e9('0x24')],_0x4e18e4['id']);_0x10ba5a[_0x29c469]=_[_0x38e9('0xf')](_0xebddf7['routeId'])?_0xebddf7[_0x38e9('0x18')]:_0xebddf7[_0x38e9('0x17')];if(_['isNil'](_0xebddf7[_0x38e9('0x26')])){_0x10ba5a[_0x38e9('0x19')]=_0xebddf7[_0x38e9('0x27')]&&_0xebddf7[_0x38e9('0x27')]!==_0x38e9('0x28')?_0xebddf7[_0x38e9('0x27')]:'Unknown';}else{_0x10ba5a['firstName']=_0xebddf7[_0x38e9('0x2a')]&&_0xebddf7[_0x38e9('0x2a')]!==''?_0xebddf7[_0x38e9('0x2a')]:'Unknown';}_0x1719cc=_0x10ba5a;_0x1a1a6b[_0x38e9('0x2c')](_0x10ba5a);return;}}})[_0x38e9('0x2b')](function(){if(_0x328bb4){emit(_0xebddf7[_0x38e9('0x24')],_0x4e18e4,util['format'](_0x38e9('0x2e'),_0x328bb4[_0x38e9('0x2f')]),util['format'](_0x38e9('0x30'),_0x59c0c8['action']['toLowerCase']()),{'evt':_[_0x38e9('0x31')](_0xebddf7,{'autoCreate':_0x8976ff}),'contact':_0x1719cc===undefined?{}:_0x1719cc,'contacts':_0x1a1a6b[_0x38e9('0x20')]===0x0?undefined:_0x1a1a6b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index cda3c37..0547047 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 _0x88d7=['name','format','trigger:%s:%s','merge','jscripty','toLowerCase','user:%s','exec','integration','queue','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','debug','checkTrigger:\x20trigger','account','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','message','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','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:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','undefined','motionChannel','voice','inspect','checkTriggers','status','checkTrigger','Actions','length','action','contactmanager','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data4','location','uriLocation','data5','800','windowHeight','data6','winApplication','data3','interface'];(function(_0x30461b,_0x299b2d){var _0x3cf839=function(_0x239b62){while(--_0x239b62){_0x30461b['push'](_0x30461b['shift']());}};_0x3cf839(++_0x299b2d);}(_0x88d7,0x1ab));var _0x788d=function(_0x10e8ea,_0x1b054c){_0x10e8ea=_0x10e8ea-0x0;var _0x14d2f2=_0x88d7[_0x10e8ea];return _0x14d2f2;};'use strict';var util=require(_0x788d('0x0'));var _=require(_0x788d('0x1'));var url=require(_0x788d('0x2'));var Mustache=require(_0x788d('0x3'));var Redis=require('ioredis');var urlforward=require(_0x788d('0x4'));var integration=require('./integration');var cmContact=require(_0x788d('0x5'));var script=require(_0x788d('0x6'));var config=require(_0x788d('0x7'));var logger=require(_0x788d('0x8'))(_0x788d('0x9'));var ami=require('../ami');config[_0x788d('0xa')]=_[_0x788d('0xb')](config['redis'],{'host':_0x788d('0xc'),'port':0x18eb});var io=require(_0x788d('0xd'))(new Redis(config[_0x788d('0xa')]));var operators={'equals':function(_0x8fedd9,_0x3fffde){return _0x8fedd9==_0x3fffde;},'not_equals':function(_0x192710,_0x1ac833){return _0x192710!=_0x1ac833;}};var barAndWebActions=[_0x788d('0xe'),'url',_0x788d('0xf')];function Trigger(_0x92e7b1){this['triggers']=_0x92e7b1[_0x788d('0x10')];this['agents']=_0x92e7b1[_0x788d('0x11')];this[_0x788d('0x12')]=_0x92e7b1['voiceQueues'];this[_0x788d('0x13')]=_0x92e7b1[_0x788d('0x13')];this[_0x788d('0x14')]=_0x92e7b1[_0x788d('0x14')];this[_0x788d('0x15')]=_0x92e7b1[_0x788d('0x15')];this['freshdeskAccounts']=_0x92e7b1[_0x788d('0x16')];this[_0x788d('0x17')]=_0x92e7b1['salesforceAccounts'];this[_0x788d('0x18')]=_0x92e7b1['sugarcrmAccounts'];this[_0x788d('0x19')]=_0x92e7b1[_0x788d('0x19')];this[_0x788d('0x1a')]=_0x92e7b1[_0x788d('0x1a')];this['vtigerAccounts']=_0x92e7b1['vtigerAccounts'];this[_0x788d('0x1b')]=_0x92e7b1['servicenowAccounts'];this[_0x788d('0x1c')]=_0x92e7b1[_0x788d('0x1c')];this[_0x788d('0x1d')]=_0x92e7b1[_0x788d('0x1d')];this[_0x788d('0x1e')]={'zendesk':this[_0x788d('0x15')],'salesforce':this[_0x788d('0x17')],'freshdesk':this[_0x788d('0x16')],'sugarcrm':this[_0x788d('0x18')],'zoho':this[_0x788d('0x19')],'desk':this['deskAccounts'],'vtiger':this[_0x788d('0x1f')],'dynamics365':this[_0x788d('0x1c')],'freshsales':this[_0x788d('0x1d')],'servicenow':this[_0x788d('0x1b')]};ami['on'](_0x788d('0x20'),this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on'](_0x788d('0x23'),this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on'](_0x788d('0x24'),this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on'](_0x788d('0x25'),this[_0x788d('0x21')]['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent'][_0x788d('0x22')](this));ami['on'](_0x788d('0x26'),this[_0x788d('0x21')]['bind'](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0x788d('0x22')](this));ami['on'](_0x788d('0x27'),this['syncCustomEvent'][_0x788d('0x22')](this));ami['on'](_0x788d('0x28'),this[_0x788d('0x21')]['bind'](this));ami['on'](_0x788d('0x29'),this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on'](_0x788d('0x2a'),this['syncCustomEvent'][_0x788d('0x22')](this));ami['on'](_0x788d('0x2b'),this['syncAgentDial'][_0x788d('0x22')](this));ami['on']('custom:dialconnect',this[_0x788d('0x2c')]['bind'](this));ami['on']('custom:dialend',this[_0x788d('0x2c')][_0x788d('0x22')](this));ami['on']('custom:newinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x788d('0x2d'),this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on'](_0x788d('0x2e'),this[_0x788d('0x21')]['bind'](this));ami['on'](_0x788d('0x2f'),this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on'](_0x788d('0x30'),this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on'](_0x788d('0x31'),this[_0x788d('0x21')][_0x788d('0x22')](this));ami['on'](_0x788d('0x32'),this['syncCustomEvent']['bind'](this));ami['on'](_0x788d('0x33'),this[_0x788d('0x21')][_0x788d('0x22')](this));}Trigger[_0x788d('0x34')][_0x788d('0x35')]=function(_0x4d7dbf,_0x45fdad,_0x3d1d8f){logger[_0x788d('0x36')](_0x4d7dbf,_0x45fdad,JSON[_0x788d('0x37')](_0x3d1d8f));io['to'](_0x4d7dbf)[_0x788d('0x35')](_0x45fdad,_0x3d1d8f);};Trigger['prototype'][_0x788d('0x21')]=function(_0x45ebf9){var _0x5dc623=_['clone'](_0x45ebf9);if(typeof _0x5dc623['motionChannel']===_0x788d('0x38')){_0x5dc623[_0x788d('0x39')]=_0x788d('0x3a');}logger['debug'](_0x788d('0x21'),util[_0x788d('0x3b')](_0x5dc623,{'showHidden':!![],'depth':null}));this[_0x788d('0x3c')](_0x5dc623);};Trigger['prototype']['syncAgentDial']=function(_0x1cb55c){if(this[_0x788d('0x11')][_0x1cb55c['interface']]){this['syncCustomEvent'](_0x1cb55c);}};Trigger['prototype'][_0x788d('0x3c')]=function(_0x29d196){var _0x45e2ea;for(var _0x4d6c19 in this[_0x788d('0x10')]){if(this[_0x788d('0x10')]['hasOwnProperty'](_0x4d6c19)){if(this[_0x788d('0x10')][_0x4d6c19][_0x788d('0x3d')]){_0x45e2ea=this[_0x788d('0x3e')](this[_0x788d('0x10')][_0x4d6c19],_0x29d196);if(_0x45e2ea){_['merge'](_0x29d196,_0x29d196['variables']);for(var _0x574365=0x0,_0x33f494,_0x534455,_0x3789e7;_0x5743650x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x5c5767,_0x3b2408){var _0x1748f9=function(_0x504768){while(--_0x504768){_0x5c5767['push'](_0x5c5767['shift']());}};_0x1748f9(++_0x3b2408);}(_0x3e74,0x175));var _0x43e7=function(_0x3b4f98,_0x1b9344){_0x3b4f98=_0x3b4f98-0x0;var _0x4391f2=_0x3e74[_0x3b4f98];return _0x4391f2;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_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 diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index c453747..f14f74f 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 _0xecc6=['emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','modernAuthentication','remoteUri','data7','CloudProvider','data2','data5','POST','clientId','username','password','then','access_token','catch','error','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','userEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','systemuserid','toLowerCase','outbound','destcalleridnum','calleridnum','odata-entityid','substring','lastIndexOf','enduserId','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','4.0','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','/systemusers(','phonecall','callDirection','queue','phonecalls','Subjects','headers','format','user:%s'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xecc6,0x89));var _0x6ecc=function(_0x582ceb,_0x15206f){_0x582ceb=_0x582ceb-0x0;var _0x5c0dfa=_0xecc6[_0x582ceb];return _0x5c0dfa;};'use strict';var _=require('lodash');var rp=require(_0x6ecc('0x0'));var util=require(_0x6ecc('0x1'));var intUtil=require(_0x6ecc('0x2'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x6ecc('0x3'))(_0x6ecc('0x4'));var config=require(_0x6ecc('0x5'));config[_0x6ecc('0x6')]=_[_0x6ecc('0x7')](config[_0x6ecc('0x6')],{'host':_0x6ecc('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6ecc('0x6')]));function getAuthToken(_0x21b682,_0x3f9b4c,_0x1e3bc9){if(_0x21b682[_0x6ecc('0x9')]){_0x21b682[_0x6ecc('0xa')]=_0x21b682['CloudProvider'][_0x6ecc('0xb')];_0x21b682['tenantId']=_0x21b682[_0x6ecc('0xc')][_0x6ecc('0xd')];return Promise['resolve'](_0x21b682[_0x6ecc('0xc')][_0x6ecc('0xe')]);}var _0x2d787e={'method':_0x6ecc('0xf'),'uri':_0x3f9b4c,'form':{'client_id':_0x21b682[_0x6ecc('0x10')],'resource':_0x21b682[_0x6ecc('0xa')],'username':_0x21b682[_0x6ecc('0x11')],'password':_0x21b682['password'],'grant_type':_0x6ecc('0x12'),'client_secret':_0x21b682['clientSecret']},'json':!![]};return rp(_0x2d787e)[_0x6ecc('0x13')](function(_0x81db32){return _0x81db32[_0x6ecc('0x14')];})[_0x6ecc('0x15')](function(_0x369585){logger[_0x6ecc('0x16')]('['+[_0x1e3bc9[_0x6ecc('0x17')]()]+']\x20Wrong\x20credentials!');return _0x369585[_0x6ecc('0x18')];});}function getUser(_0x3c72bf,_0x338e45,_0x48ffcd,_0x568661,_0x525b49,_0x3815ee){return new Promise(function(_0x32c538,_0x43935c){return getAuthToken(_0x338e45,_0x568661,_0x3815ee)[_0x6ecc('0x13')](function(_0x4370ac){var _0x24a516={'method':'GET','uri':_0x525b49+_0x6ecc('0x19'),'headers':{'Authorization':_0x6ecc('0x1a')+_0x4370ac,'OData-Version':'4.0'},'json':!![]};return rp(_0x24a516);})[_0x6ecc('0x13')](function(_0xf883e6){var _0x2b5d15=_0xf883e6[_0x6ecc('0x1b')];var _0x25a807=![];var _0x150565=null;if(!_[_0x6ecc('0x1c')](_0x48ffcd)){if(intUtil['validateEmail'](_0x48ffcd['email'])){_0x3c72bf[_0x6ecc('0x1d')]=_0x48ffcd[_0x6ecc('0x1e')];for(_0x150565=0x0;_0x150565<_0x2b5d15[_0x6ecc('0x1f')];_0x150565++){if(_0x2b5d15[_0x150565][_0x6ecc('0x20')]===_0x48ffcd[_0x6ecc('0x1e')]&&!_0x2b5d15[_0x150565][_0x6ecc('0x21')]){_0x25a807=!![];logger[_0x6ecc('0x22')]('['+[_0x3815ee[_0x6ecc('0x17')]()]+_0x6ecc('0x23')+_0x2b5d15[_0x150565]['systemuserid']+'!');_0x3c72bf[_0x6ecc('0x24')]=_0x2b5d15[_0x150565]['systemuserid'];}}}}if(!_0x25a807){logger[_0x6ecc('0x22')]('['+[_0x3815ee[_0x6ecc('0x17')]()]+_0x6ecc('0x25'));_0x3c72bf['userEmail']=_0x338e45[_0x6ecc('0x11')];for(_0x150565=0x0;_0x150565<_0x2b5d15[_0x6ecc('0x1f')];_0x150565++){if(_0x2b5d15[_0x150565][_0x6ecc('0x20')]===_0x338e45[_0x6ecc('0x11')]){_0x3c72bf[_0x6ecc('0x24')]=_0x2b5d15[_0x150565][_0x6ecc('0x26')];}}}_0x32c538(_0x3c72bf);})[_0x6ecc('0x15')](function(_0x2e2eca){_0x43935c(_0x2e2eca[_0x6ecc('0x18')]);});});}function createEndUser(_0x3a40bf,_0x6bd981,_0x3efb3f,_0x5bc234,_0x26619c,_0x5da49a,_0x144f83){return new Promise(function(_0x426252,_0xd7a612){return getAuthToken(_0x6bd981,_0x3efb3f,_0x5da49a)['then'](function(_0x46e307){var _0x3ddeeb=_0x5da49a[_0x6ecc('0x27')]()===_0x6ecc('0x28')?_0x26619c[_0x6ecc('0x29')]:_0x26619c[_0x6ecc('0x2a')];var _0x4727b7={'method':'POST','uri':_0x5bc234+'contacts','body':{'fullname':_0x3ddeeb,'firstname':_0x3ddeeb,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3a40bf[_0x6ecc('0x24')]+')'},'headers':{'Authorization':_0x6ecc('0x1a')+_0x46e307,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x4727b7['body'][_0x144f83]=_0x3ddeeb;return rp(_0x4727b7);})[_0x6ecc('0x13')](function(_0x47e1b9){var _0x27befb=_0x47e1b9['headers'][_0x6ecc('0x2b')];var _0x964889=_0x27befb[_0x6ecc('0x2c')](_0x27befb[_0x6ecc('0x2d')]('(')+0x1,_0x27befb[_0x6ecc('0x2d')](')'));_0x3a40bf[_0x6ecc('0x2e')]=_0x964889;_0x426252(_0x3a40bf);})['catch'](function(_0xc95ac1){_0xd7a612(_0xc95ac1['message']);});});}function getEndUser(_0x2381fc,_0x4f8587,_0x3d7616,_0x2d845a,_0x498abc,_0x5e7c06,_0x16f9cc,_0x218577){var _0x10165=_0x5e7c06[_0x6ecc('0x27')]()===_0x6ecc('0x28')?_0x498abc[_0x6ecc('0x29')]:_0x498abc[_0x6ecc('0x2a')];return getAuthToken(_0x4f8587,_0x3d7616,_0x5e7c06)[_0x6ecc('0x13')](function(_0x93c6d7){_0x218577=_0x218577?_0x218577:_0x6ecc('0x2f');var _0x12d634={'method':_0x6ecc('0x30'),'uri':_0x2d845a+_0x6ecc('0x31')+_0x218577+_0x6ecc('0x32')+_0x218577+_0x6ecc('0x33')+_0x10165[_0x6ecc('0x34')]('+',_0x6ecc('0x35'))+'\x27','headers':{'Authorization':_0x6ecc('0x1a')+_0x93c6d7,'If-None-Match':null,'OData-Version':_0x6ecc('0x36')},'json':!![]};return rp(_0x12d634);})['then'](function(_0x312226){var _0x3302ee=![];if(!_0x312226)return _0x3302ee;var _0x4e8e39=_0x312226[_0x6ecc('0x1b')];for(var _0x2a96f7=0x0;_0x2a96f7<_0x4e8e39[_0x6ecc('0x1f')];_0x2a96f7++){if(_0x4e8e39[_0x2a96f7][_0x218577]===_0x10165){_0x3302ee=!![];_0x2381fc['enduserId']=_0x4e8e39[_0x2a96f7][_0x6ecc('0x37')];}}return _0x3302ee;})[_0x6ecc('0x13')](function(_0x321840){if(_0x321840)return _0x2381fc;if(_0x16f9cc===_0x6ecc('0x38')){logger[_0x6ecc('0x22')]('['+[_0x5e7c06[_0x6ecc('0x17')]()]+_0x6ecc('0x39'));return _0x2381fc;}return createEndUser(_0x2381fc,_0x4f8587,_0x3d7616,_0x2d845a,_0x498abc,_0x5e7c06,_0x218577)['then'](function(_0x13ca8f){logger[_0x6ecc('0x22')]('['+[_0x5e7c06[_0x6ecc('0x17')]()]+_0x6ecc('0x3a'),_0x13ca8f[_0x6ecc('0x2e')]);return _0x13ca8f;});});}function getCustomFields(_0x419ac7,_0x263ad5,_0x2ce959){var _0xc4c7d1={};if(_0x419ac7[_0x6ecc('0x1f')]>0x0){_[_0x6ecc('0x3b')](_0x419ac7,function(_0x5959c9){if(_['includes']([_0x6ecc('0x3c'),_0x6ecc('0x3d')],_0x5959c9['type'])&&_0x5959c9[_0x6ecc('0x3e')]&&!_0x5959c9[_0x6ecc('0x3f')]){var _0x43cad5=_0x5959c9[_0x6ecc('0x40')]['toLowerCase']();var _0x21bf17=_0x43cad5[_0x6ecc('0x2c')](0x0,_0x43cad5[_0x6ecc('0x41')]('_'));var _0x28a23d=_0x43cad5['substring'](_0x43cad5[_0x6ecc('0x41')]('_')+0x1);if(_0x21bf17===_0x2ce959){_0xc4c7d1[_0x28a23d]=_0x5959c9[_0x6ecc('0x42')];}}});}return _0xc4c7d1;}function getTicket(_0x329c1d,_0x90d684,_0x4d1d68,_0x343461,_0x396366,_0x459a8a,_0x2a248b){return new Promise(function(_0x1b1d2a,_0x542909){var _0x578311;return getAuthToken(_0x90d684,_0x4d1d68,_0x2a248b)[_0x6ecc('0x13')](function(_0x23143c){if(_0x459a8a[_0x6ecc('0x43')]===_0x6ecc('0x44')){_0x578311={'method':'POST','uri':_0x343461+_0x6ecc('0x45'),'body':Object[_0x6ecc('0x46')]({},{'title':intUtil[_0x6ecc('0x47')](_0x459a8a['Subjects'],_0x396366,'\x20'),'description':intUtil['getString'](_0x459a8a[_0x6ecc('0x48')],_0x396366,'\x0a'),'customerid_contact@odata.bind':_0x329c1d['enduserId']?_0x6ecc('0x49')+_0x329c1d[_0x6ecc('0x2e')]+')':undefined,'ownerid@odata.bind':_0x6ecc('0x4a')+_0x329c1d['userId']+')','caseorigincode':'1'},getCustomFields(_0x459a8a['Fields'],_0x396366,_0x459a8a['ticketType'])),'headers':{'Authorization':_0x6ecc('0x1a')+_0x23143c,'OData-Version':_0x6ecc('0x36')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x459a8a[_0x6ecc('0x43')]===_0x6ecc('0x4b')){var _0x68487f=_0x329c1d[_0x6ecc('0x2e')]?[{'partyid_systemuser@odata.bind':_0x6ecc('0x4a')+_0x329c1d['userId']+')','participationtypemask':_0x329c1d[_0x6ecc('0x4c')]===_0x6ecc('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x6ecc('0x49')+_0x329c1d[_0x6ecc('0x2e')]+')','participationtypemask':_0x329c1d[_0x6ecc('0x4c')]===_0x6ecc('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x329c1d[_0x6ecc('0x24')]+')','participationtypemask':_0x329c1d[_0x6ecc('0x4c')]==='queue'?0x2:0x1}];_0x578311={'method':_0x6ecc('0xf'),'uri':_0x343461+_0x6ecc('0x4e'),'body':Object['assign']({},{'subject':intUtil[_0x6ecc('0x47')](_0x459a8a[_0x6ecc('0x4f')],_0x396366,'\x20'),'phonenumber':String(_0x396366[_0x6ecc('0x2a')]),'description':intUtil[_0x6ecc('0x47')](_0x459a8a['Descriptions'],_0x396366,'\x0a'),'regardingobjectid_contact@odata.bind':_0x329c1d[_0x6ecc('0x2e')]?_0x6ecc('0x49')+_0x329c1d[_0x6ecc('0x2e')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x329c1d['userId']+')','directioncode':_0x329c1d[_0x6ecc('0x4c')]===_0x6ecc('0x4d')?![]:!![],'phonecall_activity_parties':_0x68487f},getCustomFields(_0x459a8a['Fields'],_0x396366,_0x459a8a[_0x6ecc('0x43')])),'headers':{'Authorization':_0x6ecc('0x1a')+_0x23143c,'OData-Version':_0x6ecc('0x36')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x578311);})[_0x6ecc('0x13')](function(_0x519f45){var _0x3a7dde=_0x519f45[_0x6ecc('0x50')]['odata-entityid'];var _0x456700=_0x3a7dde['substring'](_0x3a7dde['lastIndexOf']('(')+0x1,_0x3a7dde[_0x6ecc('0x2d')](')'));_0x329c1d['ticketId']=_0x456700;_0x1b1d2a(_0x329c1d);})[_0x6ecc('0x15')](function(_0x59ef43){_0x542909(_0x59ef43['message']);});});}function emit(_0x3998cd,_0x18d829,_0x178a0d,_0x9b7ecb){var _0x5127f6={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x3998cd,_0x178a0d,_0x9b7ecb)};io['to'](util[_0x6ecc('0x51')](_0x6ecc('0x52'),_0x18d829))[_0x6ecc('0x53')](_0x6ecc('0x54'),_0x5127f6);}exports['cs']=function(_0xe70068,_0x2a5e67,_0xd633ad,_0x439709,_0xfa042b,_0x2de813,_0x1800e5,_0x8c63ad){var _0x298852={};_0x2de813['remoteUri']=_0x2de813[_0x6ecc('0x9')]?intUtil[_0x6ecc('0x55')](_0x2de813[_0x6ecc('0xc')][_0x6ecc('0xb')]):intUtil[_0x6ecc('0x55')](_0x2de813[_0x6ecc('0xa')]);_0x2de813['serverUrl']=intUtil[_0x6ecc('0x55')](_0x2de813[_0x6ecc('0x56')]);_0x298852[_0x6ecc('0x4c')]=_0x8c63ad===_0x6ecc('0x4d')||_0x8c63ad===_0x6ecc('0x57')?_0x6ecc('0x4d'):_0x6ecc('0x28');var _0x54173e=_0x2de813[_0x6ecc('0x9')]?util['format'](_0x6ecc('0x58'),_0x2de813[_0x6ecc('0xc')][_0x6ecc('0xb')]):util['format'](_0x6ecc('0x58'),_0x2de813[_0x6ecc('0xa')]);var _0x9baa6=util[_0x6ecc('0x51')](_0x6ecc('0x59'),_0x2de813[_0x6ecc('0x5a')]);var _0x34e59b=util['format'](_0x6ecc('0x5b'),_0x2de813[_0x6ecc('0x56')],_0x2a5e67['uniqueid'],md5(_0x2a5e67['uniqueid']));if(_0xfa042b&&_0xfa042b[_0x6ecc('0x5c')]){logger[_0x6ecc('0x22')](_0x6ecc('0x5d'),_0x6ecc('0x5e'));_0x2a5e67['recordingURL']=_0x34e59b;}else if(_0x1800e5&&_0x1800e5[_0x6ecc('0x5f')]&&_0x1800e5[_0x6ecc('0x5f')]!==_0x6ecc('0x60')){logger[_0x6ecc('0x22')](_0x6ecc('0x61'),_0x6ecc('0x5e'));_0x2a5e67[_0x6ecc('0x62')]=_0x34e59b;}else{_0x2a5e67['recordingURL']='';}return getUser(_0x298852,_0x2de813,_0x439709,_0x9baa6,_0x54173e,_0x8c63ad)[_0x6ecc('0x13')](function(_0x4c5805){logger[_0x6ecc('0x22')]('['+_0x8c63ad[_0x6ecc('0x17')]()+_0x6ecc('0x63'),_0x4c5805[_0x6ecc('0x24')]);logger['info']('['+_0x8c63ad['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x4c5805[_0x6ecc('0x1d')]);return getEndUser(_0x4c5805,_0x2de813,_0x9baa6,_0x54173e,_0x2a5e67,_0x8c63ad,_0xd633ad[_0x6ecc('0x64')],_0xd633ad['additionalSearchContact']);})[_0x6ecc('0x13')](function(_0x26fe92){logger[_0x6ecc('0x22')]('['+_0x8c63ad[_0x6ecc('0x17')]()+_0x6ecc('0x65'),_0x26fe92[_0x6ecc('0x2e')]);logger['info']('['+_0x8c63ad[_0x6ecc('0x17')]()+_0x6ecc('0x66'),_0x2a5e67[_0x6ecc('0x2a')]);return getTicket(_0x26fe92,_0x2de813,_0x9baa6,_0x54173e,_0x2a5e67,_0xd633ad,_0x8c63ad);})['then'](function(_0x2faf88){logger['info'](util['format']('['+_0x8c63ad['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0xd633ad[_0x6ecc('0x43')],_0x2faf88[_0x6ecc('0x67')]));logger[_0x6ecc('0x22')](util['format']('['+_0x8c63ad['toUpperCase']()+_0x6ecc('0x68'),_0x8c63ad));if(_0x8c63ad!==_0x6ecc('0x57')&&_0xd633ad[_0x6ecc('0x69')]){logger[_0x6ecc('0x22')]('['+_0x8c63ad[_0x6ecc('0x17')]()+']',_0x6ecc('0x6a'));emit(_0x2de813[_0x6ecc('0xa')],_0x439709[_0x6ecc('0x6b')],_0xd633ad[_0x6ecc('0x43')],_0x2faf88[_0x6ecc('0x67')]);}})[_0x6ecc('0x15')](function(_0x5065c5){logger[_0x6ecc('0x16')]('['+_0x8c63ad['toUpperCase']()+_0x6ecc('0x6c'),_0x5065c5['message']);console[_0x6ecc('0x16')](_0x6ecc('0x6d'),_0x5065c5);});}; \ No newline at end of file +var _0xbf2e=['&$filter=','%2b','value','contactid','nothing','info',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','picklist','nameField','customField','idField','indexOf','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','/systemusers(','callDirection','queue','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','body','headers','odata-entityid','substring','lastIndexOf','enduserId','message','calleridnum','telephone1','GET','contacts?$select='];(function(_0x4a53e2,_0x13321e){var _0x3f2d76=function(_0x50c5cf){while(--_0x50c5cf){_0x4a53e2['push'](_0x4a53e2['shift']());}};_0x3f2d76(++_0x13321e);}(_0xbf2e,0x1e6));var _0xebf2=function(_0xe3551e,_0x395ed4){_0xe3551e=_0xe3551e-0x0;var _0xaa327c=_0xbf2e[_0xe3551e];return _0xaa327c;};'use strict';var _=require(_0xebf2('0x0'));var rp=require(_0xebf2('0x1'));var util=require(_0xebf2('0x2'));var intUtil=require('./util');var md5=require(_0xebf2('0x3'));var Redis=require(_0xebf2('0x4'));var logger=require(_0xebf2('0x5'))(_0xebf2('0x6'));var config=require('../../../../config/environment');config[_0xebf2('0x7')]=_[_0xebf2('0x8')](config[_0xebf2('0x7')],{'host':_0xebf2('0x9'),'port':0x18eb});var io=require(_0xebf2('0xa'))(new Redis(config['redis']));function getAuthToken(_0x3854d6,_0x386e9e,_0x5992a9){if(_0x3854d6[_0xebf2('0xb')]){_0x3854d6[_0xebf2('0xc')]=_0x3854d6[_0xebf2('0xd')][_0xebf2('0xe')];_0x3854d6[_0xebf2('0xf')]=_0x3854d6[_0xebf2('0xd')][_0xebf2('0x10')];return Promise[_0xebf2('0x11')](_0x3854d6[_0xebf2('0xd')][_0xebf2('0x12')]);}var _0x4b8e11={'method':_0xebf2('0x13'),'uri':_0x386e9e,'form':{'client_id':_0x3854d6['clientId'],'resource':_0x3854d6[_0xebf2('0xc')],'username':_0x3854d6[_0xebf2('0x14')],'password':_0x3854d6['password'],'grant_type':_0xebf2('0x15'),'client_secret':_0x3854d6[_0xebf2('0x16')]},'json':!![]};return rp(_0x4b8e11)[_0xebf2('0x17')](function(_0x26ba9f){return _0x26ba9f[_0xebf2('0x18')];})[_0xebf2('0x19')](function(_0x2edfa6){logger['error']('['+[_0x5992a9[_0xebf2('0x1a')]()]+_0xebf2('0x1b'));return _0x2edfa6['message'];});}function getUser(_0x57a53c,_0x12e2cf,_0x5de17b,_0x1a447c,_0x4aac18,_0x4449fa){return new Promise(function(_0x29f634,_0x37b9f9){return getAuthToken(_0x12e2cf,_0x1a447c,_0x4449fa)[_0xebf2('0x17')](function(_0x2a7e3b){var _0x2ac778={'method':'GET','uri':_0x4aac18+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xebf2('0x1c')+_0x2a7e3b,'OData-Version':_0xebf2('0x1d')},'json':!![]};return rp(_0x2ac778);})[_0xebf2('0x17')](function(_0x4276a5){var _0x12d808=_0x4276a5['value'];var _0x5591fa=![];var _0x241b95=null;if(!_[_0xebf2('0x1e')](_0x5de17b)){if(intUtil[_0xebf2('0x1f')](_0x5de17b[_0xebf2('0x20')])){_0x57a53c[_0xebf2('0x21')]=_0x5de17b[_0xebf2('0x20')];for(_0x241b95=0x0;_0x241b95<_0x12d808[_0xebf2('0x22')];_0x241b95++){if(_0x12d808[_0x241b95][_0xebf2('0x23')]===_0x5de17b['email']&&!_0x12d808[_0x241b95][_0xebf2('0x24')]){_0x5591fa=!![];logger['info']('['+[_0x4449fa[_0xebf2('0x1a')]()]+']\x20Agent\x20found\x20'+_0x12d808[_0x241b95][_0xebf2('0x25')]+'!');_0x57a53c[_0xebf2('0x26')]=_0x12d808[_0x241b95][_0xebf2('0x25')];}}}}if(!_0x5591fa){logger['info']('['+[_0x4449fa[_0xebf2('0x1a')]()]+_0xebf2('0x27'));_0x57a53c[_0xebf2('0x21')]=_0x12e2cf[_0xebf2('0x14')];for(_0x241b95=0x0;_0x241b95<_0x12d808[_0xebf2('0x22')];_0x241b95++){if(_0x12d808[_0x241b95][_0xebf2('0x23')]===_0x12e2cf['username']){_0x57a53c[_0xebf2('0x26')]=_0x12d808[_0x241b95][_0xebf2('0x25')];}}}_0x29f634(_0x57a53c);})['catch'](function(_0x5c78b9){_0x37b9f9(_0x5c78b9['message']);});});}function createEndUser(_0x8c876e,_0x115dac,_0x253396,_0x5f489b,_0x487b98,_0x1a243e,_0x3cb7f0){return new Promise(function(_0x365daf,_0x2b563e){return getAuthToken(_0x115dac,_0x253396,_0x1a243e)[_0xebf2('0x17')](function(_0xe1b60e){var _0xc5d517=_0x1a243e[_0xebf2('0x28')]()===_0xebf2('0x29')?_0x487b98[_0xebf2('0x2a')]:_0x487b98['calleridnum'];var _0x4dc9eb={'method':_0xebf2('0x13'),'uri':_0x5f489b+'contacts','body':{'fullname':_0xc5d517,'firstname':_0xc5d517,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x8c876e['userId']+')'},'headers':{'Authorization':_0xebf2('0x1c')+_0xe1b60e,'OData-Version':_0xebf2('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x4dc9eb[_0xebf2('0x2b')][_0x3cb7f0]=_0xc5d517;return rp(_0x4dc9eb);})[_0xebf2('0x17')](function(_0x3e7920){var _0x5afae4=_0x3e7920[_0xebf2('0x2c')][_0xebf2('0x2d')];var _0x3099ee=_0x5afae4[_0xebf2('0x2e')](_0x5afae4[_0xebf2('0x2f')]('(')+0x1,_0x5afae4['lastIndexOf'](')'));_0x8c876e[_0xebf2('0x30')]=_0x3099ee;_0x365daf(_0x8c876e);})['catch'](function(_0x5e110e){_0x2b563e(_0x5e110e[_0xebf2('0x31')]);});});}function getEndUser(_0x42179a,_0x3b1ded,_0x329749,_0x118a49,_0x2c3a09,_0x5d75ae,_0x960576,_0x38d504){var _0x3c3764=_0x5d75ae[_0xebf2('0x28')]()==='outbound'?_0x2c3a09['destcalleridnum']:_0x2c3a09[_0xebf2('0x32')];return getAuthToken(_0x3b1ded,_0x329749,_0x5d75ae)[_0xebf2('0x17')](function(_0x40925d){_0x38d504=_0x38d504?_0x38d504:_0xebf2('0x33');var _0x495460={'method':_0xebf2('0x34'),'uri':_0x118a49+_0xebf2('0x35')+_0x38d504+_0xebf2('0x36')+_0x38d504+'\x20eq\x20\x27'+_0x3c3764['replace']('+',_0xebf2('0x37'))+'\x27','headers':{'Authorization':_0xebf2('0x1c')+_0x40925d,'If-None-Match':null,'OData-Version':_0xebf2('0x1d')},'json':!![]};return rp(_0x495460);})[_0xebf2('0x17')](function(_0x1e30df){var _0x213ddd=![];if(!_0x1e30df)return _0x213ddd;var _0x1bcec8=_0x1e30df[_0xebf2('0x38')];for(var _0xbcb62b=0x0;_0xbcb62b<_0x1bcec8[_0xebf2('0x22')];_0xbcb62b++){if(_0x1bcec8[_0xbcb62b][_0x38d504]===_0x3c3764){_0x213ddd=!![];_0x42179a['enduserId']=_0x1bcec8[_0xbcb62b][_0xebf2('0x39')];}}return _0x213ddd;})[_0xebf2('0x17')](function(_0x29d3c){if(_0x29d3c)return _0x42179a;if(_0x960576===_0xebf2('0x3a')){logger[_0xebf2('0x3b')]('['+[_0x5d75ae[_0xebf2('0x1a')]()]+_0xebf2('0x3c'));return _0x42179a;}return createEndUser(_0x42179a,_0x3b1ded,_0x329749,_0x118a49,_0x2c3a09,_0x5d75ae,_0x38d504)[_0xebf2('0x17')](function(_0x54da13){logger[_0xebf2('0x3b')]('['+[_0x5d75ae[_0xebf2('0x1a')]()]+_0xebf2('0x3d'),_0x54da13[_0xebf2('0x30')]);return _0x54da13;});});}function getCustomFields(_0x39ff21,_0x190f8d,_0x5142ff){var _0x3c22bd={};if(_0x39ff21[_0xebf2('0x22')]>0x0){_['forEach'](_0x39ff21,function(_0x5a9fab){if(_[_0xebf2('0x3e')](['string',_0xebf2('0x3f')],_0x5a9fab['type'])&&_0x5a9fab[_0xebf2('0x40')]&&!_0x5a9fab[_0xebf2('0x41')]){var _0xaf96e2=_0x5a9fab[_0xebf2('0x42')][_0xebf2('0x28')]();var _0x1f4f0a=_0xaf96e2[_0xebf2('0x2e')](0x0,_0xaf96e2[_0xebf2('0x43')]('_'));var _0x4b5587=_0xaf96e2[_0xebf2('0x2e')](_0xaf96e2[_0xebf2('0x43')]('_')+0x1);if(_0x1f4f0a===_0x5142ff){_0x3c22bd[_0x4b5587]=_0x5a9fab['content'];}}});}return _0x3c22bd;}function getTicket(_0x7e4ea6,_0x25a311,_0x350fdb,_0x537574,_0x16c8d6,_0x5c03dc,_0x30a328){return new Promise(function(_0x15a9ad,_0x115d06){var _0x3650cb;return getAuthToken(_0x25a311,_0x350fdb,_0x30a328)[_0xebf2('0x17')](function(_0x4971bf){if(_0x5c03dc[_0xebf2('0x44')]===_0xebf2('0x45')){_0x3650cb={'method':_0xebf2('0x13'),'uri':_0x537574+'incidents','body':Object[_0xebf2('0x46')]({},{'title':intUtil[_0xebf2('0x47')](_0x5c03dc[_0xebf2('0x48')],_0x16c8d6,'\x20'),'description':intUtil[_0xebf2('0x47')](_0x5c03dc[_0xebf2('0x49')],_0x16c8d6,'\x0a'),'customerid_contact@odata.bind':_0x7e4ea6['enduserId']?_0xebf2('0x4a')+_0x7e4ea6['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x7e4ea6['userId']+')','caseorigincode':'1'},getCustomFields(_0x5c03dc[_0xebf2('0x4b')],_0x16c8d6,_0x5c03dc[_0xebf2('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x4971bf,'OData-Version':_0xebf2('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5c03dc[_0xebf2('0x44')]===_0xebf2('0x4c')){var _0x5d21ee=_0x7e4ea6[_0xebf2('0x30')]?[{'partyid_systemuser@odata.bind':_0xebf2('0x4d')+_0x7e4ea6[_0xebf2('0x26')]+')','participationtypemask':_0x7e4ea6[_0xebf2('0x4e')]===_0xebf2('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x7e4ea6[_0xebf2('0x30')]+')','participationtypemask':_0x7e4ea6['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xebf2('0x4d')+_0x7e4ea6[_0xebf2('0x26')]+')','participationtypemask':_0x7e4ea6[_0xebf2('0x4e')]==='queue'?0x2:0x1}];_0x3650cb={'method':_0xebf2('0x13'),'uri':_0x537574+'phonecalls','body':Object[_0xebf2('0x46')]({},{'subject':intUtil[_0xebf2('0x47')](_0x5c03dc[_0xebf2('0x48')],_0x16c8d6,'\x20'),'phonenumber':String(_0x16c8d6[_0xebf2('0x32')]),'description':intUtil['getString'](_0x5c03dc['Descriptions'],_0x16c8d6,'\x0a'),'regardingobjectid_contact@odata.bind':_0x7e4ea6[_0xebf2('0x30')]?'/contacts('+_0x7e4ea6[_0xebf2('0x30')]+')':undefined,'ownerid@odata.bind':_0xebf2('0x4d')+_0x7e4ea6[_0xebf2('0x26')]+')','directioncode':_0x7e4ea6['callDirection']===_0xebf2('0x4f')?![]:!![],'phonecall_activity_parties':_0x5d21ee},getCustomFields(_0x5c03dc['Fields'],_0x16c8d6,_0x5c03dc[_0xebf2('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x4971bf,'OData-Version':_0xebf2('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3650cb);})['then'](function(_0x2514a2){var _0x1cafb1=_0x2514a2[_0xebf2('0x2c')]['odata-entityid'];var _0x267994=_0x1cafb1['substring'](_0x1cafb1['lastIndexOf']('(')+0x1,_0x1cafb1[_0xebf2('0x2f')](')'));_0x7e4ea6['ticketId']=_0x267994;_0x15a9ad(_0x7e4ea6);})[_0xebf2('0x19')](function(_0x2167aa){_0x115d06(_0x2167aa[_0xebf2('0x31')]);});});}function emit(_0x387801,_0x5ec9da,_0x5c5283,_0x31b9f4){var _0x1fc2ae={'uri':util['format'](_0xebf2('0x50'),_0x387801,_0x5c5283,_0x31b9f4)};io['to'](util[_0xebf2('0x51')]('user:%s',_0x5ec9da))['emit'](_0xebf2('0x52'),_0x1fc2ae);}exports['cs']=function(_0x2d7f94,_0x3e02cd,_0xe94686,_0x3d7786,_0x163130,_0x5c76e7,_0x27eeb2,_0x16e57a){var _0x1df9b3={};_0x5c76e7[_0xebf2('0xc')]=_0x5c76e7[_0xebf2('0xb')]?intUtil['stripTrailingSlash'](_0x5c76e7['CloudProvider'][_0xebf2('0xe')]):intUtil[_0xebf2('0x53')](_0x5c76e7[_0xebf2('0xc')]);_0x5c76e7[_0xebf2('0x54')]=intUtil[_0xebf2('0x53')](_0x5c76e7[_0xebf2('0x54')]);_0x1df9b3['callDirection']=_0x16e57a===_0xebf2('0x4f')||_0x16e57a===_0xebf2('0x55')?'queue':'outbound';var _0x2cc46a=_0x5c76e7[_0xebf2('0xb')]?util['format'](_0xebf2('0x56'),_0x5c76e7['CloudProvider'][_0xebf2('0xe')]):util[_0xebf2('0x51')](_0xebf2('0x56'),_0x5c76e7[_0xebf2('0xc')]);var _0x22345b=util[_0xebf2('0x51')](_0xebf2('0x57'),_0x5c76e7[_0xebf2('0xf')]);var _0x336186=util[_0xebf2('0x51')](_0xebf2('0x58'),_0x5c76e7['serverUrl'],_0x3e02cd[_0xebf2('0x59')],md5(_0x3e02cd[_0xebf2('0x59')]));if(_0x163130&&_0x163130['monitor_format']){logger['info'](_0xebf2('0x5a'),_0xebf2('0x5b'));_0x3e02cd['recordingURL']=_0x336186;}else if(_0x27eeb2&&_0x27eeb2[_0xebf2('0x5c')]&&_0x27eeb2[_0xebf2('0x5c')]!==_0xebf2('0x5d')){logger[_0xebf2('0x3b')](_0xebf2('0x5e'),_0xebf2('0x5b'));_0x3e02cd[_0xebf2('0x5f')]=_0x336186;}else{_0x3e02cd['recordingURL']='';}return getUser(_0x1df9b3,_0x5c76e7,_0x3d7786,_0x22345b,_0x2cc46a,_0x16e57a)[_0xebf2('0x17')](function(_0x398bc3){logger[_0xebf2('0x3b')]('['+_0x16e57a[_0xebf2('0x1a')]()+_0xebf2('0x60'),_0x398bc3['userId']);logger[_0xebf2('0x3b')]('['+_0x16e57a[_0xebf2('0x1a')]()+']\x20The\x20User\x20email\x20is:',_0x398bc3[_0xebf2('0x21')]);return getEndUser(_0x398bc3,_0x5c76e7,_0x22345b,_0x2cc46a,_0x3e02cd,_0x16e57a,_0xe94686['moduleCreate'],_0xe94686[_0xebf2('0x61')]);})[_0xebf2('0x17')](function(_0x4ab3b0){logger[_0xebf2('0x3b')]('['+_0x16e57a['toUpperCase']()+_0xebf2('0x62'),_0x4ab3b0[_0xebf2('0x30')]);logger[_0xebf2('0x3b')]('['+_0x16e57a[_0xebf2('0x1a')]()+_0xebf2('0x63'),_0x3e02cd[_0xebf2('0x32')]);return getTicket(_0x4ab3b0,_0x5c76e7,_0x22345b,_0x2cc46a,_0x3e02cd,_0xe94686,_0x16e57a);})[_0xebf2('0x17')](function(_0x1ddfb5){logger[_0xebf2('0x3b')](util[_0xebf2('0x51')]('['+_0x16e57a['toUpperCase']()+_0xebf2('0x64'),_0xe94686[_0xebf2('0x44')],_0x1ddfb5[_0xebf2('0x65')]));logger['info'](util['format']('['+_0x16e57a[_0xebf2('0x1a')]()+_0xebf2('0x66'),_0x16e57a));if(_0x16e57a!==_0xebf2('0x55')&&_0xe94686[_0xebf2('0x67')]){logger[_0xebf2('0x3b')]('['+_0x16e57a[_0xebf2('0x1a')]()+']',_0xebf2('0x68'));emit(_0x5c76e7[_0xebf2('0xc')],_0x3d7786['name'],_0xe94686[_0xebf2('0x44')],_0x1ddfb5[_0xebf2('0x65')]);}})['catch'](function(_0x591df6){logger[_0xebf2('0x69')]('['+_0x16e57a[_0xebf2('0x1a')]()+_0xebf2('0x6a'),_0x591df6[_0xebf2('0x31')]);console[_0xebf2('0x69')](_0xebf2('0x6b'),_0x591df6);});}; \ 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 77a3210..c142f89 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 _0x1201=['Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','then','Ticket\x20created!','%s/api/v2/agents','length','find','contact','%s/api/v2/agents/me','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','GET','map','forEach','includes','string','nameField','customField','toLowerCase','picklist','type','idField','content','variable','variableName','push','customVariable','Variable','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','catch','stringify','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','defaults','redis','localhost','application/json','info','merge','format'];(function(_0x1e5ba8,_0x483233){var _0x48b666=function(_0x52f2f1){while(--_0x52f2f1){_0x1e5ba8['push'](_0x1e5ba8['shift']());}};_0x48b666(++_0x483233);}(_0x1201,0x1af));var _0x1120=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0x1201[_0x25c988];return _0x45fcc2;};'use strict';var _=require(_0x1120('0x0'));var rp=require(_0x1120('0x1'));var md5=require('md5');var util=require(_0x1120('0x2'));var Redis=require(_0x1120('0x3'));var intUtil=require(_0x1120('0x4'));var config=require(_0x1120('0x5'));var logger=require('../../../../config/logger')(_0x1120('0x6'));config['redis']=_[_0x1120('0x7')](config[_0x1120('0x8')],{'host':_0x1120('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1120('0x8')]));var headers={'Content-Type':_0x1120('0xa'),'Accept':_0x1120('0xa')};function emit(_0x5935bf,_0x5240da,_0x4eb856){io['to'](_0x5935bf)['emit'](_0x5240da,_0x4eb856);}function getTicket(_0x35c607,_0x19e717,_0x50fee0,_0xca42b9,_0x2409e7){logger[_0x1120('0xb')]('Creating\x20new\x20ticket...');var _0x3ad4fb=_[_0x1120('0xc')]({'responder_id':_0x19e717['id'],'requester_id':_0x50fee0['id'],'name':util[_0x1120('0xd')](_0x1120('0xe'),_0x2409e7['calleridname']),'phone':_0x2409e7[_0x1120('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1120('0x10')](_0xca42b9[_0x1120('0x11')],_0x2409e7,'\x20'),'description':intUtil[_0x1120('0x10')](_0xca42b9[_0x1120('0x12')],_0x2409e7,_0x1120('0x13')),'tags':getTags(_0xca42b9['Tags'],_0x1120('0x14'))},getCustomFields(_0xca42b9[_0x1120('0x15')],_0x2409e7));_0x3ad4fb[_0x1120('0x16')]=_[_0x1120('0x17')](_[_0x1120('0x18')](_0x3ad4fb[_0x1120('0x16')],'id'),'value');return request({'uri':util[_0x1120('0xd')]('%s/api/v2/tickets',_0x35c607['remoteUri']),'method':'POST','body':_0x3ad4fb})[_0x1120('0x19')](function(_0x2b83a0){logger['info'](_0x1120('0x1a'));return _0x2b83a0;});}function getUser(_0x483fe6,_0x327538){if(intUtil['validateEmail'](_0x327538)){return request({'uri':util[_0x1120('0xd')](_0x1120('0x1b'),_0x483fe6['remoteUri']),'qs':{'email':_0x327538}})[_0x1120('0x19')](function(_0x5adc6b){if(_0x5adc6b[_0x1120('0x1c')]){logger[_0x1120('0xb')]('Agent\x20found!');return _[_0x1120('0x1d')](_0x5adc6b,function(_0x1b7cc3){return _0x1b7cc3[_0x1120('0x1e')]['email']===_0x327538;});}else{logger[_0x1120('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1120('0xd')](_0x1120('0x1f'),_0x483fe6[_0x1120('0x20')])})['then'](function(_0x1ffc93){logger[_0x1120('0xb')](_0x1120('0x21'));return _0x1ffc93;});}});}else{logger[_0x1120('0xb')](_0x1120('0x22'));return request({'uri':util[_0x1120('0xd')](_0x1120('0x1f'),_0x483fe6[_0x1120('0x20')])})['then'](function(_0x51cb6b){logger[_0x1120('0xb')](_0x1120('0x21'));return _0x51cb6b;});}}function getEndUser(_0x4e96f3,_0x5266b9,_0xecec72){logger[_0x1120('0xb')](_0x1120('0x23'),_0xecec72);return request({'uri':util[_0x1120('0xd')](_0x1120('0x24'),_0x4e96f3[_0x1120('0x20')]),'qs':{'phone':_0xecec72}})[_0x1120('0x19')](function(_0x1abb20){if(_0x1abb20['length']){logger[_0x1120('0xb')](_0x1120('0x25'));return _[_0x1120('0x1d')](_0x1abb20,{'phone':_0xecec72});}else{logger[_0x1120('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x1120('0xd')]('%s/api/v2/contacts',_0x4e96f3[_0x1120('0x20')]),'method':_0x1120('0x26'),'body':{'name':_0x5266b9,'phone':_0xecec72}})[_0x1120('0x19')](function(_0x2f6e47){logger[_0x1120('0xb')](_0x1120('0x27'));return _0x2f6e47;});}});}function getAuth(_0x1a69a9){return util['format'](_0x1120('0x28'),new Buffer(_0x1a69a9[_0x1120('0x29')]+':X')[_0x1120('0x2a')]('base64'));}function request(_0x29a5b8){logger[_0x1120('0x2b')](_0x1120('0x2c'),JSON['stringify'](_0x29a5b8));return rp(_[_0x1120('0x7')](_0x29a5b8,{'method':_0x1120('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x1142cf,_0x387ee8){var _0x12b45a=[];if(_0x1142cf&&_0x1142cf[_0x1120('0x1c')]>0x0){_0x12b45a=_[_0x1120('0x2e')](_0x1142cf,_0x387ee8);}return _0x12b45a;}function getCustomFields(_0x4e59e8,_0x32b16f){var _0x9be67a=[];var _0xfdeb96={'custom_fields':[]};if(_0x4e59e8['length']>0x0){_[_0x1120('0x2f')](_0x4e59e8,function(_0x253290){if(_[_0x1120('0x30')]([_0x1120('0x31'),'picklist'],_0x253290['type'])&&_0x253290[_0x1120('0x32')]&&!_0x253290[_0x1120('0x33')]){_0xfdeb96[_0x253290[_0x1120('0x32')][_0x1120('0x34')]()]=_0x253290['content'][_0x1120('0x2a')]();}else if(_[_0x1120('0x30')]([_0x1120('0x31'),_0x1120('0x35')],_0x253290[_0x1120('0x36')])&&_0x253290[_0x1120('0x37')]&&_0x253290[_0x1120('0x33')]){_0xfdeb96[_0x1120('0x16')]['push']({'id':_0x253290[_0x1120('0x37')],'value':_0x253290[_0x1120('0x38')]['toString']()});}else if(_0x253290[_0x1120('0x36')]===_0x1120('0x39')&&_0x253290[_0x1120('0x3a')]&&_0x253290[_0x1120('0x37')]&&_0x253290[_0x1120('0x33')]){_0x32b16f[_0x253290['variableName']]&&_0xfdeb96[_0x1120('0x16')][_0x1120('0x3b')]({'id':_0x253290[_0x1120('0x37')],'value':_0x32b16f[_0x253290['variableName']][_0x1120('0x2a')]()});}else if(_0x253290[_0x1120('0x36')]===_0x1120('0x3c')&&_0x253290['Variable']&&_0x253290[_0x1120('0x3d')][_0x1120('0x14')]&&_0x253290[_0x1120('0x37')]&&_0x253290[_0x1120('0x33')]){_0x32b16f[_0x253290[_0x1120('0x3d')]['name'][_0x1120('0x34')]()]&&_0xfdeb96[_0x1120('0x16')][_0x1120('0x3b')]({'id':_0x253290['idField'],'value':_0x32b16f[_0x253290[_0x1120('0x3d')][_0x1120('0x14')]['toLowerCase']()][_0x1120('0x2a')]()});}});}return _0xfdeb96;}exports['queue']=function(_0x147470,_0x3162e8,_0x45eb39,_0x21ac01,_0x555baf,_0x2d970b){var _0xde9974,_0x13c1a9;_0x2d970b[_0x1120('0x20')]=intUtil[_0x1120('0x3e')](_0x2d970b[_0x1120('0x20')]);_0x2d970b['serverUrl']=intUtil[_0x1120('0x3e')](_0x2d970b['serverUrl']);if(_0x555baf&&_0x555baf[_0x1120('0x3f')]){logger[_0x1120('0xb')]('[QUEUE]',_0x1120('0x40'));_0x3162e8[_0x1120('0x41')]=util[_0x1120('0xd')](_0x1120('0x42'),_0x2d970b[_0x1120('0x43')],_0x3162e8[_0x1120('0x44')],md5(_0x3162e8[_0x1120('0x44')]));}else{_0x3162e8[_0x1120('0x41')]='';}headers[_0x1120('0x45')]=getAuth(_0x2d970b);return getUser(_0x2d970b,_0x21ac01[_0x1120('0x46')])[_0x1120('0x19')](function(_0x17c153){_0xde9974=_0x17c153;logger['info'](_0x1120('0x47'),_0xde9974['id']);return getEndUser(_0x2d970b,_0x3162e8[_0x1120('0x48')],_0x3162e8['calleridnum']);})['then'](function(_0x2b1a69){_0x13c1a9=_0x2b1a69;logger[_0x1120('0xb')](_0x1120('0x49'),_0x13c1a9['id']);return getTicket(_0x2d970b,_0xde9974,_0x13c1a9,_0x45eb39,_0x3162e8);})[_0x1120('0x19')](function(_0x3c2287){if(_0x3c2287&&_0x3c2287['id']){logger[_0x1120('0xb')](_0x1120('0x1a'));logger[_0x1120('0xb')](_0x1120('0x4a'),_0x3c2287['id']);logger['info']('[QUEUE]',_0x1120('0x4b'));emit(util['format']('user:%s',_0x21ac01['name']),_0x1120('0x4c'),{'uri':util[_0x1120('0xd')]('%s/helpdesk/tickets/%d',_0x2d970b['remoteUri'],_0x3c2287['id'])});}})['catch'](function(_0x2eb031){logger[_0x1120('0x4d')](_0x1120('0x4e'),JSON['stringify'](_0x2eb031));});};exports[_0x1120('0x4f')]=function(_0x41904f,_0x464d87,_0xce6df8,_0x3f4c19,_0x1c90c8,_0x394ed3,_0x3472aa){var _0x1737ca,_0x4a0133;_0x394ed3['remoteUri']=intUtil[_0x1120('0x3e')](_0x394ed3[_0x1120('0x20')]);_0x394ed3[_0x1120('0x43')]=intUtil[_0x1120('0x3e')](_0x394ed3['serverUrl']);if(_0x3472aa&&_0x3472aa[_0x1120('0x50')]&&_0x3472aa['recordingFormat']!=='none'){logger[_0x1120('0xb')](_0x1120('0x51'),_0x1120('0x40'));_0x464d87[_0x1120('0x41')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x394ed3['serverUrl'],_0x464d87[_0x1120('0x44')],md5(_0x464d87[_0x1120('0x44')]));}headers[_0x1120('0x45')]=getAuth(_0x394ed3);return getUser(_0x394ed3,_0x3f4c19[_0x1120('0x46')])[_0x1120('0x19')](function(_0x341b38){_0x1737ca=_0x341b38;logger[_0x1120('0xb')](_0x1120('0x47'),_0x1737ca['id']);return getEndUser(_0x394ed3,_0x464d87[_0x1120('0x52')],_0x464d87[_0x1120('0x53')]);})[_0x1120('0x19')](function(_0x1b8bb1){_0x4a0133=_0x1b8bb1;logger[_0x1120('0xb')](_0x1120('0x49'),_0x4a0133['id']);return getTicket(_0x394ed3,_0x1737ca,_0x4a0133,_0xce6df8,_0x464d87);})[_0x1120('0x19')](function(_0x497115){if(_0x497115&&_0x497115['id']){logger['info'](_0x1120('0x1a'));logger[_0x1120('0xb')](_0x1120('0x4a'),_0x497115['id']);logger[_0x1120('0xb')](_0x1120('0x51'),_0x1120('0x4b'));emit(util[_0x1120('0xd')](_0x1120('0x54'),_0x3f4c19[_0x1120('0x14')]),'trigger:browser:url',{'uri':util[_0x1120('0xd')]('%s/helpdesk/tickets/%d',_0x394ed3[_0x1120('0x20')],_0x497115['id'])});}})[_0x1120('0x55')](function(_0x164496){logger[_0x1120('0x4d')](_0x1120('0x51'),JSON[_0x1120('0x56')](_0x164496));});};exports['unmanaged']=function(_0x6d59bc,_0x1330d3,_0x14ab1b,_0x3b154f,_0x41f6f3,_0x5e4b77){var _0x571d10,_0x190c02;_0x5e4b77[_0x1120('0x20')]=intUtil['stripTrailingSlash'](_0x5e4b77[_0x1120('0x20')]);_0x5e4b77[_0x1120('0x43')]=intUtil['stripTrailingSlash'](_0x5e4b77[_0x1120('0x43')]);if(_0x41f6f3&&_0x41f6f3['monitor_format']){logger[_0x1120('0xb')]('['+_0x1330d3[_0x1120('0x57')]['toUpperCase']()+']',_0x1120('0x40'));_0x1330d3[_0x1120('0x41')]=util['format'](_0x1120('0x42'),_0x5e4b77[_0x1120('0x43')],_0x1330d3['uniqueid'],md5(_0x1330d3[_0x1120('0x44')]));}else{_0x1330d3[_0x1120('0x41')]='';}headers[_0x1120('0x45')]=getAuth(_0x5e4b77);return getUser(_0x5e4b77,'')[_0x1120('0x19')](function(_0x50e290){_0x571d10=_0x50e290;logger['info'](_0x1120('0x47'),_0x571d10['id']);return getEndUser(_0x5e4b77,_0x1330d3[_0x1120('0x48')],_0x1330d3[_0x1120('0xf')]);})[_0x1120('0x19')](function(_0x37e37c){_0x190c02=_0x37e37c;logger[_0x1120('0xb')]('The\x20Enduser\x20ID\x20is:',_0x190c02['id']);return getTicket(_0x5e4b77,_0x571d10,_0x190c02,_0x14ab1b,_0x1330d3);})['then'](function(_0x2f3bf2){if(_0x2f3bf2){logger[_0x1120('0xb')](_0x1120('0x1a'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2f3bf2['id']);}})['catch'](function(_0x8e2c3d){logger[_0x1120('0x4d')]('['+_0x1330d3[_0x1120('0x57')][_0x1120('0x58')]()+']',JSON['stringify'](_0x8e2c3d));});}; \ No newline at end of file +var _0x78e9=['Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','lastevent','calleridname','catch','toUpperCase','lodash','request-promise','md5','ioredis','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','value','%s/api/v2/tickets','then','Ticket\x20created!','remoteUri','length','Agent\x20found!','find','contact','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','GET','map','forEach','includes','string','nameField','customField','content','picklist','idField','type','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid'];(function(_0x18329c,_0x5804b7){var _0x19cbc5=function(_0x1732ca){while(--_0x1732ca){_0x18329c['push'](_0x18329c['shift']());}};_0x19cbc5(++_0x5804b7);}(_0x78e9,0x182));var _0x978e=function(_0x469229,_0x4f4270){_0x469229=_0x469229-0x0;var _0x50bf5b=_0x78e9[_0x469229];return _0x50bf5b;};'use strict';var _=require(_0x978e('0x0'));var rp=require(_0x978e('0x1'));var md5=require(_0x978e('0x2'));var util=require('util');var Redis=require(_0x978e('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x978e('0x4'))(_0x978e('0x5'));config[_0x978e('0x6')]=_[_0x978e('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x978e('0x8'))(new Redis(config[_0x978e('0x6')]));var headers={'Content-Type':'application/json','Accept':_0x978e('0x9')};function emit(_0x55d7da,_0x4ce13b,_0x2c9a90){io['to'](_0x55d7da)[_0x978e('0xa')](_0x4ce13b,_0x2c9a90);}function getTicket(_0x28e592,_0x1b11d0,_0x1305cb,_0x1980dc,_0x56f948){logger[_0x978e('0xb')](_0x978e('0xc'));var _0x4bb2e5=_[_0x978e('0xd')]({'responder_id':_0x1b11d0['id'],'requester_id':_0x1305cb['id'],'name':util[_0x978e('0xe')]('Caller\x20-\x20%s',_0x56f948['calleridname']),'phone':_0x56f948[_0x978e('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x978e('0x10')](_0x1980dc[_0x978e('0x11')],_0x56f948,'\x20'),'description':intUtil[_0x978e('0x10')](_0x1980dc[_0x978e('0x12')],_0x56f948,_0x978e('0x13')),'tags':getTags(_0x1980dc['Tags'],_0x978e('0x14'))},getCustomFields(_0x1980dc[_0x978e('0x15')],_0x56f948));_0x4bb2e5[_0x978e('0x16')]=_['mapValues'](_['keyBy'](_0x4bb2e5[_0x978e('0x16')],'id'),_0x978e('0x17'));return request({'uri':util[_0x978e('0xe')](_0x978e('0x18'),_0x28e592['remoteUri']),'method':'POST','body':_0x4bb2e5})[_0x978e('0x19')](function(_0x41f294){logger[_0x978e('0xb')](_0x978e('0x1a'));return _0x41f294;});}function getUser(_0x510bc0,_0x8d863){if(intUtil['validateEmail'](_0x8d863)){return request({'uri':util[_0x978e('0xe')]('%s/api/v2/agents',_0x510bc0[_0x978e('0x1b')]),'qs':{'email':_0x8d863}})['then'](function(_0x3db92e){if(_0x3db92e[_0x978e('0x1c')]){logger['info'](_0x978e('0x1d'));return _[_0x978e('0x1e')](_0x3db92e,function(_0x3291fe){return _0x3291fe[_0x978e('0x1f')][_0x978e('0x20')]===_0x8d863;});}else{logger[_0x978e('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x978e('0xe')]('%s/api/v2/agents/me',_0x510bc0[_0x978e('0x1b')])})[_0x978e('0x19')](function(_0x186333){logger[_0x978e('0xb')](_0x978e('0x21'));return _0x186333;});}});}else{logger['info'](_0x978e('0x22'));return request({'uri':util['format'](_0x978e('0x23'),_0x510bc0[_0x978e('0x1b')])})['then'](function(_0x68d9c){logger['info']('Admin\x20account\x20selected.');return _0x68d9c;});}}function getEndUser(_0x157956,_0x3f0ba6,_0x4b3ae0){logger['info']('Searching\x20enduser\x20with\x20phone',_0x4b3ae0);return request({'uri':util['format'](_0x978e('0x24'),_0x157956[_0x978e('0x1b')]),'qs':{'phone':_0x4b3ae0}})[_0x978e('0x19')](function(_0x521c3c){if(_0x521c3c[_0x978e('0x1c')]){logger['info']('Enduser\x20found!');return _['find'](_0x521c3c,{'phone':_0x4b3ae0});}else{logger['info'](_0x978e('0x25'));return request({'uri':util['format'](_0x978e('0x24'),_0x157956[_0x978e('0x1b')]),'method':_0x978e('0x26'),'body':{'name':_0x3f0ba6,'phone':_0x4b3ae0}})[_0x978e('0x19')](function(_0x2060a6){logger['info'](_0x978e('0x27'));return _0x2060a6;});}});}function getAuth(_0x80109){return util['format'](_0x978e('0x28'),new Buffer(_0x80109[_0x978e('0x29')]+':X')[_0x978e('0x2a')](_0x978e('0x2b')));}function request(_0x5c14f1){logger['debug'](_0x978e('0x2c'),JSON['stringify'](_0x5c14f1));return rp(_[_0x978e('0x7')](_0x5c14f1,{'method':_0x978e('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x5ce80e,_0x78c9be){var _0x2ff16d=[];if(_0x5ce80e&&_0x5ce80e[_0x978e('0x1c')]>0x0){_0x2ff16d=_[_0x978e('0x2e')](_0x5ce80e,_0x78c9be);}return _0x2ff16d;}function getCustomFields(_0x22b9a0,_0xaa83ca){var _0x34b8ba=[];var _0x49ffab={'custom_fields':[]};if(_0x22b9a0[_0x978e('0x1c')]>0x0){_[_0x978e('0x2f')](_0x22b9a0,function(_0x5278cb){if(_[_0x978e('0x30')]([_0x978e('0x31'),'picklist'],_0x5278cb['type'])&&_0x5278cb[_0x978e('0x32')]&&!_0x5278cb[_0x978e('0x33')]){_0x49ffab[_0x5278cb[_0x978e('0x32')]['toLowerCase']()]=_0x5278cb[_0x978e('0x34')]['toString']();}else if(_['includes'](['string',_0x978e('0x35')],_0x5278cb['type'])&&_0x5278cb['idField']&&_0x5278cb['customField']){_0x49ffab['custom_fields']['push']({'id':_0x5278cb[_0x978e('0x36')],'value':_0x5278cb[_0x978e('0x34')][_0x978e('0x2a')]()});}else if(_0x5278cb[_0x978e('0x37')]===_0x978e('0x38')&&_0x5278cb['variableName']&&_0x5278cb['idField']&&_0x5278cb['customField']){_0xaa83ca[_0x5278cb[_0x978e('0x39')]]&&_0x49ffab[_0x978e('0x16')][_0x978e('0x3a')]({'id':_0x5278cb[_0x978e('0x36')],'value':_0xaa83ca[_0x5278cb[_0x978e('0x39')]][_0x978e('0x2a')]()});}else if(_0x5278cb['type']===_0x978e('0x3b')&&_0x5278cb[_0x978e('0x3c')]&&_0x5278cb[_0x978e('0x3c')]['name']&&_0x5278cb[_0x978e('0x36')]&&_0x5278cb[_0x978e('0x33')]){_0xaa83ca[_0x5278cb[_0x978e('0x3c')][_0x978e('0x14')][_0x978e('0x3d')]()]&&_0x49ffab[_0x978e('0x16')][_0x978e('0x3a')]({'id':_0x5278cb[_0x978e('0x36')],'value':_0xaa83ca[_0x5278cb[_0x978e('0x3c')][_0x978e('0x14')][_0x978e('0x3d')]()][_0x978e('0x2a')]()});}});}return _0x49ffab;}exports[_0x978e('0x3e')]=function(_0x410209,_0x253757,_0x5d9e68,_0x5ba4de,_0x34db36,_0x314545){var _0x358ee2,_0x48331c;_0x314545[_0x978e('0x1b')]=intUtil[_0x978e('0x3f')](_0x314545[_0x978e('0x1b')]);_0x314545['serverUrl']=intUtil['stripTrailingSlash'](_0x314545[_0x978e('0x40')]);if(_0x34db36&&_0x34db36[_0x978e('0x41')]){logger[_0x978e('0xb')]('[QUEUE]',_0x978e('0x42'));_0x253757[_0x978e('0x43')]=util[_0x978e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x314545[_0x978e('0x40')],_0x253757[_0x978e('0x44')],md5(_0x253757[_0x978e('0x44')]));}else{_0x253757[_0x978e('0x43')]='';}headers[_0x978e('0x45')]=getAuth(_0x314545);return getUser(_0x314545,_0x5ba4de['email'])['then'](function(_0x57e290){_0x358ee2=_0x57e290;logger[_0x978e('0xb')](_0x978e('0x46'),_0x358ee2['id']);return getEndUser(_0x314545,_0x253757['calleridname'],_0x253757[_0x978e('0xf')]);})['then'](function(_0x49d14b){_0x48331c=_0x49d14b;logger['info'](_0x978e('0x47'),_0x48331c['id']);return getTicket(_0x314545,_0x358ee2,_0x48331c,_0x5d9e68,_0x253757);})[_0x978e('0x19')](function(_0x297f42){if(_0x297f42&&_0x297f42['id']){logger['info'](_0x978e('0x1a'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x297f42['id']);logger[_0x978e('0xb')]('[QUEUE]',_0x978e('0x48'));emit(util[_0x978e('0xe')](_0x978e('0x49'),_0x5ba4de[_0x978e('0x14')]),_0x978e('0x4a'),{'uri':util[_0x978e('0xe')](_0x978e('0x4b'),_0x314545[_0x978e('0x1b')],_0x297f42['id'])});}})['catch'](function(_0x39219d){logger[_0x978e('0x4c')](_0x978e('0x4d'),JSON[_0x978e('0x4e')](_0x39219d));});};exports[_0x978e('0x4f')]=function(_0x461bca,_0xc65be0,_0x563d38,_0x502169,_0x5bc1ad,_0x1b0e0f,_0x3eb8e7){var _0xb93108,_0x4e8cab;_0x1b0e0f['remoteUri']=intUtil[_0x978e('0x3f')](_0x1b0e0f['remoteUri']);_0x1b0e0f[_0x978e('0x40')]=intUtil[_0x978e('0x3f')](_0x1b0e0f[_0x978e('0x40')]);if(_0x3eb8e7&&_0x3eb8e7[_0x978e('0x50')]&&_0x3eb8e7[_0x978e('0x50')]!==_0x978e('0x51')){logger[_0x978e('0xb')](_0x978e('0x52'),_0x978e('0x42'));_0xc65be0[_0x978e('0x43')]=util[_0x978e('0xe')](_0x978e('0x53'),_0x1b0e0f[_0x978e('0x40')],_0xc65be0[_0x978e('0x44')],md5(_0xc65be0[_0x978e('0x44')]));}headers['Authorization']=getAuth(_0x1b0e0f);return getUser(_0x1b0e0f,_0x502169[_0x978e('0x20')])[_0x978e('0x19')](function(_0x59217c){_0xb93108=_0x59217c;logger['info'](_0x978e('0x46'),_0xb93108['id']);return getEndUser(_0x1b0e0f,_0xc65be0[_0x978e('0x54')],_0xc65be0[_0x978e('0x55')]);})[_0x978e('0x19')](function(_0x1d5599){_0x4e8cab=_0x1d5599;logger[_0x978e('0xb')](_0x978e('0x47'),_0x4e8cab['id']);return getTicket(_0x1b0e0f,_0xb93108,_0x4e8cab,_0x563d38,_0xc65be0);})[_0x978e('0x19')](function(_0x507756){if(_0x507756&&_0x507756['id']){logger[_0x978e('0xb')](_0x978e('0x1a'));logger['info'](_0x978e('0x56'),_0x507756['id']);logger[_0x978e('0xb')](_0x978e('0x52'),_0x978e('0x48'));emit(util['format'](_0x978e('0x49'),_0x502169[_0x978e('0x14')]),_0x978e('0x4a'),{'uri':util[_0x978e('0xe')](_0x978e('0x4b'),_0x1b0e0f[_0x978e('0x1b')],_0x507756['id'])});}})['catch'](function(_0x404531){logger[_0x978e('0x4c')](_0x978e('0x52'),JSON['stringify'](_0x404531));});};exports['unmanaged']=function(_0x5e7c33,_0x217b8b,_0x44eb75,_0x1a780d,_0x2cfd3f,_0x4ad609){var _0x4cab69,_0x576ffe;_0x4ad609[_0x978e('0x1b')]=intUtil[_0x978e('0x3f')](_0x4ad609[_0x978e('0x1b')]);_0x4ad609[_0x978e('0x40')]=intUtil[_0x978e('0x3f')](_0x4ad609[_0x978e('0x40')]);if(_0x2cfd3f&&_0x2cfd3f[_0x978e('0x41')]){logger[_0x978e('0xb')]('['+_0x217b8b[_0x978e('0x57')]['toUpperCase']()+']',_0x978e('0x42'));_0x217b8b[_0x978e('0x43')]=util[_0x978e('0xe')](_0x978e('0x53'),_0x4ad609[_0x978e('0x40')],_0x217b8b['uniqueid'],md5(_0x217b8b[_0x978e('0x44')]));}else{_0x217b8b['recordingURL']='';}headers[_0x978e('0x45')]=getAuth(_0x4ad609);return getUser(_0x4ad609,'')[_0x978e('0x19')](function(_0x13660b){_0x4cab69=_0x13660b;logger['info']('The\x20User\x20ID\x20is:',_0x4cab69['id']);return getEndUser(_0x4ad609,_0x217b8b[_0x978e('0x58')],_0x217b8b[_0x978e('0xf')]);})[_0x978e('0x19')](function(_0x503cd1){_0x576ffe=_0x503cd1;logger[_0x978e('0xb')](_0x978e('0x47'),_0x576ffe['id']);return getTicket(_0x4ad609,_0x4cab69,_0x576ffe,_0x44eb75,_0x217b8b);})[_0x978e('0x19')](function(_0x3e03ad){if(_0x3e03ad){logger[_0x978e('0xb')](_0x978e('0x1a'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3e03ad['id']);}})[_0x978e('0x59')](function(_0x10d774){logger[_0x978e('0x4c')]('['+_0x217b8b[_0x978e('0x57')][_0x978e('0x5a')]()+']',JSON[_0x978e('0x4e')](_0x10d774));});}; \ 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 b4e1c6c..94676ce 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 _0x9cab=['Contact','ticketId','task','Task\x20created:','user:%s','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','GET','agentEmail','userId','User\x20found:','Admin\x20selected','toUpperCase','&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString'];(function(_0x25b3d5,_0x3e3c25){var _0x173328=function(_0x1690ff){while(--_0x1690ff){_0x25b3d5['push'](_0x25b3d5['shift']());}};_0x173328(++_0x3e3c25);}(_0x9cab,0x1a9));var _0xb9ca=function(_0x318aaa,_0x2d1a9d){_0x318aaa=_0x318aaa-0x0;var _0x595c2c=_0x9cab[_0x318aaa];return _0x595c2c;};'use strict';var _=require(_0xb9ca('0x0'));var rp=require(_0xb9ca('0x1'));var md5=require(_0xb9ca('0x2'));var util=require(_0xb9ca('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0xb9ca('0x4'));var intUtil=require(_0xb9ca('0x5'));var config=require(_0xb9ca('0x6'));var logger=require(_0xb9ca('0x7'))(_0xb9ca('0x8'));config[_0xb9ca('0x9')]=_['defaults'](config[_0xb9ca('0x9')],{'host':_0xb9ca('0xa'),'port':0x18eb});var io=require(_0xb9ca('0xb'))(new Redis(config[_0xb9ca('0x9')]));function getAdminId(_0x343bb7,_0x28c3d7,_0x6d6c76,_0x58e6b9){return new Promise(function(_0x42a83b,_0x238998){var _0x3acb80=![];var _0x4e2d32={'method':'GET','uri':_0x58e6b9+_0xb9ca('0xc'),'json':!![]};_0x4e2d32[_0xb9ca('0xd')]=_0x6d6c76;logger[_0xb9ca('0xe')](_0xb9ca('0xf'));return rp(_0x4e2d32)[_0xb9ca('0x10')](function(_0x43106a){if(_0x43106a){var _0x5547c1=_0x43106a[_0xb9ca('0x11')];var _0x5d69c8=null;for(_0x5d69c8=0x0;_0x5d69c8<_0x5547c1[_0xb9ca('0x12')];_0x5d69c8++){if(_0x5547c1[_0x5d69c8][_0xb9ca('0x13')]===_0x343bb7[_0xb9ca('0x14')]){_0x343bb7['adminId']=_0x5547c1[_0x5d69c8]['id'];_0x3acb80=!![];}}if(_0x3acb80){logger[_0xb9ca('0xe')]('Admin\x20found:',_0x343bb7[_0xb9ca('0x15')]);_0x42a83b(_0x343bb7);}else{_0x238998({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x238998({'statusCode':0x194,'message':_0xb9ca('0x16')});}})[_0xb9ca('0x17')](function(_0x455beb){logger[_0xb9ca('0x18')]('['+[_0x28c3d7['toUpperCase']()]+']',_0x455beb[_0xb9ca('0x19')]);_0x238998(_0x455beb);});});}function getUser(_0x3a0fd4,_0x343912,_0x352959){return function(_0x46217c){return new Promise(function(_0x262941,_0x561297){var _0x55da68={'method':_0xb9ca('0x1a'),'uri':_0x352959+_0xb9ca('0xc'),'json':!![]};_0x55da68[_0xb9ca('0xd')]=_0x343912;logger[_0xb9ca('0xe')]('Getting\x20user\x20list');return rp(_0x55da68)[_0xb9ca('0x10')](function(_0x499018){if(_0x499018){var _0x11c388=_0x499018['users'];var _0x29e68b=![];var _0x2a5902=null;if(_0x46217c[_0xb9ca('0x1b')]!==null){logger[_0xb9ca('0xe')]('Getting\x20user\x20with\x20email',_0x46217c['agentEmail']);_0x46217c['userEmail']=_0x46217c[_0xb9ca('0x1b')];for(_0x2a5902=0x0;_0x2a5902<_0x11c388[_0xb9ca('0x12')];_0x2a5902++){if(_0x11c388[_0x2a5902][_0xb9ca('0x13')]===_0x46217c['agentEmail']){_0x29e68b=!![];_0x46217c[_0xb9ca('0x1c')]=_0x11c388[_0x2a5902]['id'];logger[_0xb9ca('0xe')](_0xb9ca('0x1d'),_0x46217c[_0xb9ca('0x1c')]);}}}if(!_0x29e68b){logger['info'](_0xb9ca('0x1e'));_0x46217c['userEmail']=_0x46217c[_0xb9ca('0x14')];_0x46217c[_0xb9ca('0x1c')]=_0x46217c[_0xb9ca('0x15')];_0x29e68b=!![];}if(_0x29e68b){_0x262941(_0x46217c);}else{_0x561297({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x561297({'statusCode':0x194,'message':_0xb9ca('0x16')});}})[_0xb9ca('0x17')](function(_0x413412){logger['error']('['+[_0x3a0fd4[_0xb9ca('0x1f')]()]+']',_0x413412['message']);_0x561297(_0x413412);});});};}function searchContact(_0x26dbfb,_0x5e40ac,_0x23e95d,_0x8413c9){return new Promise(function(_0x50b32c,_0x52d6c7){var _0x44c0c8={'method':_0xb9ca('0x1a'),'headers':_0x5e40ac,'uri':_0x26dbfb+'/api/lookup?q='+_0x8413c9+_0xb9ca('0x20')+_0x23e95d+'&entities=contact','json':!![]};rp(_0x44c0c8)[_0xb9ca('0x10')](function(_0x447e09){var _0x56254e=_['find'](_0x447e09[_0xb9ca('0x21')][_0xb9ca('0x21')],[_0x23e95d,_0x8413c9]);_0x50b32c(_0x56254e);})[_0xb9ca('0x17')](function(_0x30bd97){_0x52d6c7(_0x30bd97);});});}function getEndUser(_0x42bbe0,_0x12d34a,_0x329b55){return function(_0x458cd8){return new Promise(function(_0x176b03,_0x3ebc51){logger['info'](util[_0xb9ca('0x22')](_0xb9ca('0x23'),_0x458cd8[_0xb9ca('0x24')]));searchContact(_0x329b55,_0x12d34a,'mobile_number',_0x458cd8['contactNumber'])[_0xb9ca('0x10')](function(_0x7559ab){if(_0x7559ab){_0x458cd8[_0xb9ca('0x25')]=_0x7559ab['id'];logger['info'](_0xb9ca('0x26'),_0x458cd8[_0xb9ca('0x25')]);return _0x176b03(_0x458cd8);}searchContact(_0x329b55,_0x12d34a,_0xb9ca('0x27'),_0x458cd8[_0xb9ca('0x24')])[_0xb9ca('0x10')](function(_0x2ee9d9){if(_0x2ee9d9){_0x458cd8['endUserId']=_0x2ee9d9['id'];logger[_0xb9ca('0xe')]('Contact\x20found\x20work_number:',_0x458cd8[_0xb9ca('0x25')]);return _0x176b03(_0x458cd8);}createEndUser(_0x458cd8,_0x42bbe0,_0x12d34a,_0x329b55)[_0xb9ca('0x10')](function(_0x551ef0){logger['info'](_0xb9ca('0x28'),_0x551ef0[_0xb9ca('0x25')]);return _0x176b03(_0x551ef0);});});})[_0xb9ca('0x17')](function(_0x4fe91b){_0x3ebc51(_0x4fe91b);});});};}function createEndUser(_0x2610fe,_0x346f4f,_0x1e0974,_0x59c2ba){return new Promise(function(_0x26ad86,_0x4a1cf5){var _0x1803c3=moment();var _0x2f80d5={'method':_0xb9ca('0x29'),'uri':_0x59c2ba+_0xb9ca('0x2a'),'body':{'contact':{'last_name':_0x2610fe['contactNumber'],'work_number':_0x2610fe[_0xb9ca('0x24')],'mobile_number':_0x2610fe[_0xb9ca('0x24')],'owner_id':_0x2610fe['userId'],'created_at':_0x1803c3[_0xb9ca('0x22')](_0xb9ca('0x2b'))}},'json':!![]};_0x2f80d5[_0xb9ca('0xd')]=_0x1e0974;logger['info'](_0xb9ca('0x2c'));return rp(_0x2f80d5)[_0xb9ca('0x10')](function(_0x304a21){_0x2610fe[_0xb9ca('0x25')]=_0x304a21[_0xb9ca('0x2d')]['id'];_0x26ad86(_0x2610fe);})[_0xb9ca('0x17')](function(_0x1ddc29){logger[_0xb9ca('0x18')]('['+[_0x346f4f['toUpperCase']()]+']',_0x1ddc29[_0xb9ca('0x19')]);_0x4a1cf5(_0x1ddc29[_0xb9ca('0x19')]);});});}function getTicket(_0x5d3539,_0x2e9efe,_0x2926df,_0x472758,_0xeedeb7){return function(_0x290a84){logger[_0xb9ca('0xe')](_0xb9ca('0x2e'));return new Promise(function(_0x2e28eb,_0x14b8bb){var _0x185b2f=moment();var _0x2d4b15={'method':_0xb9ca('0x29'),'uri':_0x2926df+_0xb9ca('0x2f'),'body':{'title':intUtil[_0xb9ca('0x30')](_0x472758['Subjects'],_0xeedeb7,'\x20'),'description':intUtil['getString'](_0x472758['Descriptions'],_0xeedeb7,'\x0a'),'owner_id':_0x290a84[_0xb9ca('0x1c')],'creater_id':_0x290a84[_0xb9ca('0x15')],'targetable_id':_0x290a84[_0xb9ca('0x25')],'targetable_type':_0xb9ca('0x31'),'created_at':_0x185b2f[_0xb9ca('0x22')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x185b2f['add'](0x1e,'m')['format'](_0xb9ca('0x2b'))},'json':!![]};_0x2d4b15[_0xb9ca('0xd')]=_0x2e9efe;return rp(_0x2d4b15)['then'](function(_0x4dfe1a){_0x290a84[_0xb9ca('0x32')]=_0x4dfe1a[_0xb9ca('0x33')]['id'];logger[_0xb9ca('0xe')](_0xb9ca('0x34'),_0x290a84[_0xb9ca('0x32')]);_0x2e28eb(_0x290a84);})['catch'](function(_0x58ed4f){logger[_0xb9ca('0x18')]('['+[_0x5d3539['toUpperCase']()]+']',_0x58ed4f['message']);_0x14b8bb(_0x58ed4f['message']);});});};}function emit(_0x5f5c2e,_0x15845e,_0x5d99a1){var _0x1fd540={'uri':_0x5f5c2e+'/contacts/'+_0x5d99a1};io['to'](util[_0xb9ca('0x22')](_0xb9ca('0x35'),_0x15845e))['emit']('trigger:browser:url',_0x1fd540);}exports['cs']=function(_0x4170cb,_0x5dbb4b,_0x378072,_0x2cbae3,_0x95a614,_0x36d036,_0x2b4d20,_0x5e44ae){var _0x20068c={};var _0x208f78={'Authorization':_0xb9ca('0x36')+_0x36d036['apiKey']};_0x36d036[_0xb9ca('0x37')]=intUtil[_0xb9ca('0x38')](_0x36d036[_0xb9ca('0x37')]);_0x36d036['serverUrl']=intUtil['stripTrailingSlash'](_0x36d036[_0xb9ca('0x39')]);var _0x16f4bb=_0x36d036['remoteUri'];_0x20068c['adminEmail']=_0x36d036[_0xb9ca('0x3a')];_0x20068c[_0xb9ca('0x24')]=_0x5e44ae[_0xb9ca('0x3b')]()==='outbound'?_0x5dbb4b[_0xb9ca('0x3c')]:_0x5dbb4b[_0xb9ca('0x3d')];_0x20068c[_0xb9ca('0x3e')]=_0x5e44ae===_0xb9ca('0x3f')||_0x5e44ae===_0xb9ca('0x40')?_0xb9ca('0x3f'):_0xb9ca('0x41');if(_0x2cbae3){_0x20068c[_0xb9ca('0x1b')]=_0x2cbae3['email'];}var _0x58c2a3=util[_0xb9ca('0x22')](_0xb9ca('0x42'),_0x36d036[_0xb9ca('0x39')],_0x5dbb4b['uniqueid'],md5(_0x5dbb4b[_0xb9ca('0x43')]));if(_0x95a614&&_0x95a614[_0xb9ca('0x44')]){logger[_0xb9ca('0xe')]('[QUEUE]',_0xb9ca('0x45'));_0x5dbb4b[_0xb9ca('0x46')]=_0x58c2a3;}else if(_0x2b4d20&&_0x2b4d20[_0xb9ca('0x47')]&&_0x2b4d20[_0xb9ca('0x47')]!==_0xb9ca('0x48')){logger['info'](_0xb9ca('0x49'),_0xb9ca('0x45'));_0x5dbb4b['recordingURL']=_0x58c2a3;}else{_0x5dbb4b[_0xb9ca('0x46')]='';}return getAdminId(_0x20068c,_0x5e44ae,_0x208f78,_0x16f4bb)['then'](getUser(_0x5e44ae,_0x208f78,_0x16f4bb))['then'](getEndUser(_0x5e44ae,_0x208f78,_0x16f4bb))[_0xb9ca('0x10')](getTicket(_0x5e44ae,_0x208f78,_0x16f4bb,_0x378072,_0x5dbb4b))['then'](function(_0x520372){logger[_0xb9ca('0xe')](util[_0xb9ca('0x22')](_0xb9ca('0x4a'),_0x520372['ticketId']));if(_0x5e44ae!=='unmanaged'){logger[_0xb9ca('0xe')]('['+[_0x5e44ae['toUpperCase']()]+']',_0xb9ca('0x4b'));emit(_0x16f4bb,_0x2cbae3[_0xb9ca('0x4c')],_0x520372[_0xb9ca('0x25')]);}})['catch'](function(_0x17014b){logger[_0xb9ca('0x18')]('['+[_0x5e44ae[_0xb9ca('0x1f')]()]+_0xb9ca('0x4d'),util[_0xb9ca('0x4e')](_0x17014b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x379e=['POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','error','Creating\x20new\x20task','Subjects','getString','Descriptions','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','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','defaults','redis','/api/selector/owners','info','Getting\x20admin\x20information','then','users','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','message','GET','headers','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','catch','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:'];(function(_0x2842b4,_0x2b1b7b){var _0x2b9521=function(_0x3613b8){while(--_0x3613b8){_0x2842b4['push'](_0x2842b4['shift']());}};_0x2b9521(++_0x2b1b7b);}(_0x379e,0x179));var _0xe379=function(_0x46afff,_0x45011e){_0x46afff=_0x46afff-0x0;var _0x1b376a=_0x379e[_0x46afff];return _0x1b376a;};'use strict';var _=require('lodash');var rp=require(_0xe379('0x0'));var md5=require(_0xe379('0x1'));var util=require(_0xe379('0x2'));var moment=require(_0xe379('0x3'));var Promise=require(_0xe379('0x4'));var Redis=require(_0xe379('0x5'));var intUtil=require(_0xe379('0x6'));var config=require(_0xe379('0x7'));var logger=require(_0xe379('0x8'))('freshsales');config['redis']=_[_0xe379('0x9')](config[_0xe379('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe379('0xa')]));function getAdminId(_0x455823,_0xaa3926,_0x480819,_0x2fd95f){return new Promise(function(_0x2c257f,_0x1a1945){var _0x193f70=![];var _0x1f940a={'method':'GET','uri':_0x2fd95f+_0xe379('0xb'),'json':!![]};_0x1f940a['headers']=_0x480819;logger[_0xe379('0xc')](_0xe379('0xd'));return rp(_0x1f940a)[_0xe379('0xe')](function(_0x280d9f){if(_0x280d9f){var _0x1bb39d=_0x280d9f[_0xe379('0xf')];var _0x411d33=null;for(_0x411d33=0x0;_0x411d33<_0x1bb39d['length'];_0x411d33++){if(_0x1bb39d[_0x411d33][_0xe379('0x10')]===_0x455823['adminEmail']){_0x455823[_0xe379('0x11')]=_0x1bb39d[_0x411d33]['id'];_0x193f70=!![];}}if(_0x193f70){logger[_0xe379('0xc')](_0xe379('0x12'),_0x455823[_0xe379('0x11')]);_0x2c257f(_0x455823);}else{_0x1a1945({'statusCode':0x194,'message':_0xe379('0x13')});}}else{_0x1a1945({'statusCode':0x194,'message':_0xe379('0x13')});}})['catch'](function(_0x12e507){logger['error']('['+[_0xaa3926[_0xe379('0x14')]()]+']',_0x12e507[_0xe379('0x15')]);_0x1a1945(_0x12e507);});});}function getUser(_0x4e3bfa,_0x20fdec,_0x3602b0){return function(_0xc27e2d){return new Promise(function(_0x45bb60,_0x2660ac){var _0x40a743={'method':_0xe379('0x16'),'uri':_0x3602b0+_0xe379('0xb'),'json':!![]};_0x40a743[_0xe379('0x17')]=_0x20fdec;logger[_0xe379('0xc')]('Getting\x20user\x20list');return rp(_0x40a743)['then'](function(_0x28f4ba){if(_0x28f4ba){var _0x26e087=_0x28f4ba[_0xe379('0xf')];var _0x555704=![];var _0x47f8c3=null;if(_0xc27e2d[_0xe379('0x18')]!==null){logger[_0xe379('0xc')]('Getting\x20user\x20with\x20email',_0xc27e2d[_0xe379('0x18')]);_0xc27e2d[_0xe379('0x19')]=_0xc27e2d[_0xe379('0x18')];for(_0x47f8c3=0x0;_0x47f8c3<_0x26e087['length'];_0x47f8c3++){if(_0x26e087[_0x47f8c3]['email']===_0xc27e2d[_0xe379('0x18')]){_0x555704=!![];_0xc27e2d[_0xe379('0x1a')]=_0x26e087[_0x47f8c3]['id'];logger['info'](_0xe379('0x1b'),_0xc27e2d['userId']);}}}if(!_0x555704){logger['info'](_0xe379('0x1c'));_0xc27e2d[_0xe379('0x19')]=_0xc27e2d[_0xe379('0x1d')];_0xc27e2d['userId']=_0xc27e2d[_0xe379('0x11')];_0x555704=!![];}if(_0x555704){_0x45bb60(_0xc27e2d);}else{_0x2660ac({'statusCode':0x194,'message':_0xe379('0x13')});}}else{_0x2660ac({'statusCode':0x194,'message':_0xe379('0x13')});}})[_0xe379('0x1e')](function(_0x5eeb93){logger['error']('['+[_0x4e3bfa[_0xe379('0x14')]()]+']',_0x5eeb93[_0xe379('0x15')]);_0x2660ac(_0x5eeb93);});});};}function searchContact(_0x2048b2,_0x5b45af,_0x33c861,_0x43ed9a){return new Promise(function(_0x4598f7,_0x5da416){var _0x4fea27={'method':_0xe379('0x16'),'headers':_0x5b45af,'uri':_0x2048b2+_0xe379('0x1f')+_0x43ed9a+_0xe379('0x20')+_0x33c861+_0xe379('0x21'),'json':!![]};rp(_0x4fea27)[_0xe379('0xe')](function(_0x369f21){var _0x189698=_[_0xe379('0x22')](_0x369f21[_0xe379('0x23')][_0xe379('0x23')],[_0x33c861,_0x43ed9a]);_0x4598f7(_0x189698);})[_0xe379('0x1e')](function(_0x5c6dfb){_0x5da416(_0x5c6dfb);});});}function getEndUser(_0x22fab3,_0x48212a,_0x5d83e8){return function(_0x28c18a){return new Promise(function(_0x48c462,_0x418b05){logger[_0xe379('0xc')](util[_0xe379('0x24')](_0xe379('0x25'),_0x28c18a[_0xe379('0x26')]));searchContact(_0x5d83e8,_0x48212a,_0xe379('0x27'),_0x28c18a['contactNumber'])[_0xe379('0xe')](function(_0x292094){if(_0x292094){_0x28c18a[_0xe379('0x28')]=_0x292094['id'];logger[_0xe379('0xc')](_0xe379('0x29'),_0x28c18a[_0xe379('0x28')]);return _0x48c462(_0x28c18a);}searchContact(_0x5d83e8,_0x48212a,'work_number',_0x28c18a[_0xe379('0x26')])[_0xe379('0xe')](function(_0x139253){if(_0x139253){_0x28c18a[_0xe379('0x28')]=_0x139253['id'];logger[_0xe379('0xc')](_0xe379('0x2a'),_0x28c18a[_0xe379('0x28')]);return _0x48c462(_0x28c18a);}createEndUser(_0x28c18a,_0x22fab3,_0x48212a,_0x5d83e8)[_0xe379('0xe')](function(_0x9da2c5){logger['info']('Contact\x20created:',_0x9da2c5[_0xe379('0x28')]);return _0x48c462(_0x9da2c5);});});})[_0xe379('0x1e')](function(_0x1bdc7e){_0x418b05(_0x1bdc7e);});});};}function createEndUser(_0x2bc233,_0x322735,_0x119621,_0x23489d){return new Promise(function(_0x261d15,_0x5b986){var _0x57538e=moment();var _0x34d20e={'method':_0xe379('0x2b'),'uri':_0x23489d+_0xe379('0x2c'),'body':{'contact':{'last_name':_0x2bc233[_0xe379('0x26')],'work_number':_0x2bc233[_0xe379('0x26')],'mobile_number':_0x2bc233[_0xe379('0x26')],'owner_id':_0x2bc233[_0xe379('0x1a')],'created_at':_0x57538e[_0xe379('0x24')](_0xe379('0x2d'))}},'json':!![]};_0x34d20e['headers']=_0x119621;logger[_0xe379('0xc')](_0xe379('0x2e'));return rp(_0x34d20e)[_0xe379('0xe')](function(_0x15403c){_0x2bc233[_0xe379('0x28')]=_0x15403c['contact']['id'];_0x261d15(_0x2bc233);})[_0xe379('0x1e')](function(_0x43bc55){logger[_0xe379('0x2f')]('['+[_0x322735['toUpperCase']()]+']',_0x43bc55[_0xe379('0x15')]);_0x5b986(_0x43bc55[_0xe379('0x15')]);});});}function getTicket(_0x1250af,_0x1c40b1,_0x14d884,_0x13a983,_0x471156){return function(_0xa85aae){logger[_0xe379('0xc')](_0xe379('0x30'));return new Promise(function(_0x57d16b,_0x238593){var _0x37dd5b=moment();var _0x4d1754={'method':_0xe379('0x2b'),'uri':_0x14d884+'/api/tasks','body':{'title':intUtil['getString'](_0x13a983[_0xe379('0x31')],_0x471156,'\x20'),'description':intUtil[_0xe379('0x32')](_0x13a983[_0xe379('0x33')],_0x471156,'\x0a'),'owner_id':_0xa85aae[_0xe379('0x1a')],'creater_id':_0xa85aae['adminId'],'targetable_id':_0xa85aae[_0xe379('0x28')],'targetable_type':_0xe379('0x34'),'created_at':_0x37dd5b[_0xe379('0x24')](_0xe379('0x2d')),'due_date':_0x37dd5b[_0xe379('0x35')](0x1e,'m')[_0xe379('0x24')](_0xe379('0x2d'))},'json':!![]};_0x4d1754['headers']=_0x1c40b1;return rp(_0x4d1754)[_0xe379('0xe')](function(_0x12c562){_0xa85aae[_0xe379('0x36')]=_0x12c562['task']['id'];logger[_0xe379('0xc')](_0xe379('0x37'),_0xa85aae['ticketId']);_0x57d16b(_0xa85aae);})[_0xe379('0x1e')](function(_0xce8edd){logger[_0xe379('0x2f')]('['+[_0x1250af[_0xe379('0x14')]()]+']',_0xce8edd[_0xe379('0x15')]);_0x238593(_0xce8edd[_0xe379('0x15')]);});});};}function emit(_0x25eb5f,_0x43a7db,_0x3afbb7){var _0x422608={'uri':_0x25eb5f+_0xe379('0x38')+_0x3afbb7};io['to'](util[_0xe379('0x24')](_0xe379('0x39'),_0x43a7db))['emit'](_0xe379('0x3a'),_0x422608);}exports['cs']=function(_0x53a8bc,_0xfa9a50,_0x4454d8,_0x247cce,_0x345792,_0x1c29b4,_0x2926e9,_0x2fb7e6){var _0x566eea={};var _0x427532={'Authorization':_0xe379('0x3b')+_0x1c29b4[_0xe379('0x3c')]};_0x1c29b4['remoteUri']=intUtil[_0xe379('0x3d')](_0x1c29b4[_0xe379('0x3e')]);_0x1c29b4[_0xe379('0x3f')]=intUtil[_0xe379('0x3d')](_0x1c29b4[_0xe379('0x3f')]);var _0x52cf4a=_0x1c29b4['remoteUri'];_0x566eea[_0xe379('0x1d')]=_0x1c29b4[_0xe379('0x40')];_0x566eea[_0xe379('0x26')]=_0x2fb7e6[_0xe379('0x41')]()===_0xe379('0x42')?_0xfa9a50[_0xe379('0x43')]:_0xfa9a50['calleridnum'];_0x566eea[_0xe379('0x44')]=_0x2fb7e6===_0xe379('0x45')||_0x2fb7e6===_0xe379('0x46')?_0xe379('0x45'):_0xe379('0x42');if(_0x247cce){_0x566eea[_0xe379('0x18')]=_0x247cce[_0xe379('0x10')];}var _0x3d5967=util[_0xe379('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c29b4[_0xe379('0x3f')],_0xfa9a50[_0xe379('0x47')],md5(_0xfa9a50[_0xe379('0x47')]));if(_0x345792&&_0x345792[_0xe379('0x48')]){logger[_0xe379('0xc')](_0xe379('0x49'),_0xe379('0x4a'));_0xfa9a50[_0xe379('0x4b')]=_0x3d5967;}else if(_0x2926e9&&_0x2926e9[_0xe379('0x4c')]&&_0x2926e9[_0xe379('0x4c')]!==_0xe379('0x4d')){logger[_0xe379('0xc')](_0xe379('0x4e'),_0xe379('0x4a'));_0xfa9a50[_0xe379('0x4b')]=_0x3d5967;}else{_0xfa9a50['recordingURL']='';}return getAdminId(_0x566eea,_0x2fb7e6,_0x427532,_0x52cf4a)['then'](getUser(_0x2fb7e6,_0x427532,_0x52cf4a))[_0xe379('0xe')](getEndUser(_0x2fb7e6,_0x427532,_0x52cf4a))['then'](getTicket(_0x2fb7e6,_0x427532,_0x52cf4a,_0x4454d8,_0xfa9a50))[_0xe379('0xe')](function(_0x58ad41){logger[_0xe379('0xc')](util[_0xe379('0x24')](_0xe379('0x4f'),_0x58ad41[_0xe379('0x36')]));if(_0x2fb7e6!=='unmanaged'){logger[_0xe379('0xc')]('['+[_0x2fb7e6[_0xe379('0x14')]()]+']',_0xe379('0x50'));emit(_0x52cf4a,_0x247cce[_0xe379('0x51')],_0x58ad41[_0xe379('0x28')]);}})['catch'](function(_0x4207ee){logger[_0xe379('0x2f')]('['+[_0x2fb7e6['toUpperCase']()]+_0xe379('0x52'),util[_0xe379('0x53')](_0x4207ee,{'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 400f449..6f8256f 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 _0x3eb8=['./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','zoho','desk','dynamics365','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','sugarcrm','freshdesk','vtiger','freshsales','servicenow','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util'];(function(_0x4d6b49,_0x309a58){var _0x205fb4=function(_0x54ec15){while(--_0x54ec15){_0x4d6b49['push'](_0x4d6b49['shift']());}};_0x205fb4(++_0x309a58);}(_0x3eb8,0x184));var _0x83eb=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x3eb8[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x83eb('0x0'));var util=require(_0x83eb('0x1'));var zendesk=require(_0x83eb('0x2'));var salesforce=require(_0x83eb('0x3'));var sugarcrm=require(_0x83eb('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x83eb('0x5'));var desk=require('./desk');var vtiger=require(_0x83eb('0x6'));var servicenow=require(_0x83eb('0x7'));var dynamics365=require(_0x83eb('0x8'));var freshsales=require(_0x83eb('0x9'));var integrations=[_0x83eb('0xa'),_0x83eb('0xb'),'sugarcrm','freshdesk',_0x83eb('0xc'),_0x83eb('0xd'),'vtiger',_0x83eb('0xe'),'freshsales','servicenow'];exports[_0x83eb('0xf')]=function(_0x4b96eb,_0x4adf78,_0x597eff,_0x287a0c,_0x18b9ae,_0x399420){if(_0x597eff){if(_[_0x83eb('0x10')](integrations,_0x4b96eb[_0x83eb('0x11')][_0x83eb('0x12')]())){try{var _0x1817cc=null;var _0x56a28f='';var _0x2c0fcc=_0x597eff[_0x4b96eb['data1'][_0x83eb('0x12')]()];if(_0x2c0fcc){var _0x2fe27d=_0x2c0fcc[_0x4b96eb[_0x83eb('0x13')]];if(_0x2fe27d){var _0x1f85d5=_[_0x83eb('0x14')](_0x2fe27d[_0x83eb('0x15')],{'id':parseInt(_0x4b96eb[_0x83eb('0x16')],0xa)});if(_0x1f85d5){if(_0x287a0c){if(_0x18b9ae&&_0x4adf78[_0x83eb('0x17')]){_0x56a28f='queue';}else if(_0x4adf78[_0x83eb('0x18')]){_0x56a28f=_0x83eb('0x19');}else{console[_0x83eb('0x1a')](_0x83eb('0x1b'),_0x4adf78);}}else{_0x56a28f='unmanaged';}switch(_0x4b96eb['data1'][_0x83eb('0x12')]()){case'zendesk':zendesk[_0x56a28f](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420);break;case _0x83eb('0xb'):salesforce[_0x56a28f](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420);break;case _0x83eb('0x1c'):sugarcrm[_0x56a28f](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420);break;case _0x83eb('0x1d'):freshdesk[_0x56a28f](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420);break;case'zoho':zoho[_0x56a28f](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420);break;case _0x83eb('0xd'):desk[_0x56a28f](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420);break;case _0x83eb('0x1e'):vtiger[_0x56a28f](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420);break;case _0x83eb('0x1f'):freshsales['cs'](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420,_0x56a28f);break;case _0x83eb('0x20'):servicenow['cs'](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420,_0x56a28f);break;case _0x83eb('0xe'):dynamics365['cs'](_0x4b96eb,_0x4adf78,_0x1f85d5,_0x287a0c,_0x18b9ae,_0x2fe27d,_0x399420,_0x56a28f);break;default:console[_0x83eb('0x1a')]('unknown\x20integration');}}else{_0x1817cc=require(_0x83eb('0x21'))(_0x4b96eb['data1'][_0x83eb('0x12')]());_0x1817cc['error']('[EXEC]',util[_0x83eb('0x22')](_0x83eb('0x23'),_0x4b96eb[_0x83eb('0x11')][_0x83eb('0x12')](),_0x4b96eb[_0x83eb('0x16')]));}}else{_0x1817cc=require(_0x83eb('0x21'))(_0x4b96eb[_0x83eb('0x11')][_0x83eb('0x12')]());_0x1817cc[_0x83eb('0x24')](_0x83eb('0x25'),util[_0x83eb('0x22')](_0x83eb('0x26'),_0x4b96eb['data1'][_0x83eb('0x12')](),_0x4b96eb[_0x83eb('0x13')]));}}else{}}catch(_0x295c3d){console[_0x83eb('0x24')](_0x295c3d);}}}}; \ No newline at end of file +var _0x2e22=['log','EVENT\x20UNKNOWN','zendesk','freshdesk','vtiger','dynamics365','unknown\x20integration','../../../../config/logger','[EXEC]','format','data3','error','%s\x20account\x20#%s\x20not\x20found','lodash','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./dynamics365','salesforce','sugarcrm','zoho','desk','freshsales','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound'];(function(_0x2d24e2,_0x38c3af){var _0x330f61=function(_0x15c233){while(--_0x15c233){_0x2d24e2['push'](_0x2d24e2['shift']());}};_0x330f61(++_0x38c3af);}(_0x2e22,0x199));var _0x22e2=function(_0x4e85f2,_0x1cf40b){_0x4e85f2=_0x4e85f2-0x0;var _0x3ac183=_0x2e22[_0x4e85f2];return _0x3ac183;};'use strict';var _=require(_0x22e2('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0x22e2('0x1'));var sugarcrm=require(_0x22e2('0x2'));var freshdesk=require(_0x22e2('0x3'));var zoho=require(_0x22e2('0x4'));var desk=require('./desk');var vtiger=require(_0x22e2('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x22e2('0x6'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x22e2('0x7'),_0x22e2('0x8'),'freshdesk',_0x22e2('0x9'),_0x22e2('0xa'),'vtiger','dynamics365',_0x22e2('0xb'),'servicenow'];exports['exec']=function(_0x5bd816,_0x4cfce3,_0x4a7d7e,_0x3e3de2,_0x32b249,_0x1ec652){if(_0x4a7d7e){if(_['includes'](integrations,_0x5bd816[_0x22e2('0xc')][_0x22e2('0xd')]())){try{var _0x5918c2=null;var _0x2ad92d='';var _0x5528fe=_0x4a7d7e[_0x5bd816[_0x22e2('0xc')][_0x22e2('0xd')]()];if(_0x5528fe){var _0x3e026c=_0x5528fe[_0x5bd816[_0x22e2('0xe')]];if(_0x3e026c){var _0x33f245=_[_0x22e2('0xf')](_0x3e026c[_0x22e2('0x10')],{'id':parseInt(_0x5bd816['data3'],0xa)});if(_0x33f245){if(_0x3e3de2){if(_0x32b249&&_0x4cfce3[_0x22e2('0x11')]){_0x2ad92d='queue';}else if(_0x4cfce3[_0x22e2('0x12')]){_0x2ad92d=_0x22e2('0x13');}else{console[_0x22e2('0x14')](_0x22e2('0x15'),_0x4cfce3);}}else{_0x2ad92d='unmanaged';}switch(_0x5bd816['data1']['toLowerCase']()){case _0x22e2('0x16'):zendesk[_0x2ad92d](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652);break;case _0x22e2('0x7'):salesforce[_0x2ad92d](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652);break;case _0x22e2('0x8'):sugarcrm[_0x2ad92d](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652);break;case _0x22e2('0x17'):freshdesk[_0x2ad92d](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652);break;case _0x22e2('0x9'):zoho[_0x2ad92d](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652);break;case'desk':desk[_0x2ad92d](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652);break;case _0x22e2('0x18'):vtiger[_0x2ad92d](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652);break;case _0x22e2('0xb'):freshsales['cs'](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652,_0x2ad92d);break;case'servicenow':servicenow['cs'](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652,_0x2ad92d);break;case _0x22e2('0x19'):dynamics365['cs'](_0x5bd816,_0x4cfce3,_0x33f245,_0x3e3de2,_0x32b249,_0x3e026c,_0x1ec652,_0x2ad92d);break;default:console[_0x22e2('0x14')](_0x22e2('0x1a'));}}else{_0x5918c2=require(_0x22e2('0x1b'))(_0x5bd816['data1'][_0x22e2('0xd')]());_0x5918c2['error'](_0x22e2('0x1c'),util[_0x22e2('0x1d')]('%s\x20configuration\x20#%s\x20not\x20found',_0x5bd816[_0x22e2('0xc')][_0x22e2('0xd')](),_0x5bd816[_0x22e2('0x1e')]));}}else{_0x5918c2=require(_0x22e2('0x1b'))(_0x5bd816[_0x22e2('0xc')]['toLowerCase']());_0x5918c2[_0x22e2('0x1f')](_0x22e2('0x1c'),util[_0x22e2('0x1d')](_0x22e2('0x20'),_0x5bd816[_0x22e2('0xc')][_0x22e2('0xd')](),_0x5bd816[_0x22e2('0xe')]));}}else{}}catch(_0x3acb33){console['error'](_0x3acb33);}}}}; \ 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 525d201..5223617 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 _0x6971=['request-promise','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','assign','getString','Subjects','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','then','length','find','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','execute','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Contact','Lead','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','','Company','No\x20Company','Caller\x20-\x20%s','upperFirst','forEach','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','name','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','user:%s','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash'];(function(_0x228cdb,_0xd499ae){var _0x49d8d0=function(_0x25327d){while(--_0x25327d){_0x228cdb['push'](_0x228cdb['shift']());}};_0x49d8d0(++_0xd499ae);}(_0x6971,0x185));var _0x1697=function(_0x3307ef,_0x4719ed){_0x3307ef=_0x3307ef-0x0;var _0x29717b=_0x6971[_0x3307ef];return _0x29717b;};'use strict';var _=require(_0x1697('0x0'));var rp=require(_0x1697('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x1697('0x2'));var jsforce=require(_0x1697('0x3'));var util=require('util');var Redis=require(_0x1697('0x4'));var intUtil=require(_0x1697('0x5'));var config=require(_0x1697('0x6'));var logger=require(_0x1697('0x7'))('salesforce');config[_0x1697('0x8')]=_['defaults'](config[_0x1697('0x8')],{'host':_0x1697('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1697('0x8')]));function emit(_0x4af677,_0x53f890,_0x45e10e){io['to'](_0x4af677)['emit'](_0x53f890,_0x45e10e);}function getTicket(_0x1392c5,_0x3fa5c6,_0x4ada8d,_0xa3feb3,_0x14e951,_0xe537d8,_0x217805,_0x3e7f32){var _0x4a4d92=Object[_0x1697('0xa')]({},{'OwnerId':_0x3fa5c6['id'],'Subject':intUtil[_0x1697('0xb')](_0xa3feb3[_0x1697('0xc')],_0x14e951,'\x20'),'Description':intUtil[_0x1697('0xb')](_0xa3feb3['Descriptions'],_0x14e951,'\x0a')},getCustomFields(_0xe537d8,_0x14e951));if(_0x4ada8d){if(_0xa3feb3[_0x1697('0xd')]===_0x1697('0xe')){_0x4a4d92[_0x1697('0xf')]=moment[_0x1697('0x10')]();_0x4a4d92['IsReminderSet']=![];_0x4a4d92[_0x1697('0x11')]=![];if(_0x4ada8d['endUserType']==='contact'||_0x4ada8d[_0x1697('0x12')]===_0x1697('0x13')){_0x4a4d92[_0x1697('0x14')]=_0x4ada8d['id'];}else if(_0x4ada8d['endUserType']===_0x1697('0x15')){_0x4a4d92[_0x1697('0x16')]=_0x4ada8d['id'];}}else if(_0xa3feb3['ticketType']===_0x1697('0x17')){if(_0x4ada8d[_0x1697('0x12')]===_0x1697('0x18')){_0x4a4d92[_0x1697('0x19')]=_0x4ada8d['id'];}else if(_0x4ada8d[_0x1697('0x12')]==='account'){_0x4a4d92[_0x1697('0x1a')]=_0x4ada8d['id'];}else if(_0x4ada8d[_0x1697('0x12')]==='lead'&&_0xa3feb3[_0x1697('0x1b')]){_0x4a4d92[_0xa3feb3[_0x1697('0x1b')]]=_0x4ada8d['id'];}else{logger[_0x1697('0x1c')](_0x1697('0x1d'));}}}return _0x217805[_0x1697('0x1e')](_0xa3feb3['ticketType'])[_0x1697('0x1f')](_0x4a4d92);}function getUser(_0x16fdaa,_0x3fb7ae,_0x23f87e){if(!_[_0x1697('0x20')](_0x3fb7ae)&&intUtil[_0x1697('0x21')](_0x3fb7ae)){var _0x2a58c4={'Email':_0x3fb7ae};var _0x406fa9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x23f87e[_0x1697('0x1e')]('User')['find'](_0x2a58c4,_0x406fa9)['execute']()[_0x1697('0x22')](function(_0x2f2cfe){if(_0x2f2cfe[_0x1697('0x23')]){var _0x434896=_[_0x1697('0x24')](_0x2f2cfe,function(_0x44c9a2){return _0x44c9a2['Email']===_0x3fb7ae;});if(_0x434896){logger['info'](_0x1697('0x25'),_0x3fb7ae);return BPromise[_0x1697('0x26')]({'id':_0x434896['Id'],'name':_0x434896[_0x1697('0x27')]});}}else{logger[_0x1697('0x1c')](_0x1697('0x28'),_0x3fb7ae);return _0x23f87e['identity']()[_0x1697('0x22')](function(_0x14c8b9){return BPromise[_0x1697('0x26')]({'id':_0x14c8b9[_0x1697('0x29')],'name':_0x14c8b9['display_name']});});}});}else{logger[_0x1697('0x1c')](_0x1697('0x28'),_0x3fb7ae);return _0x23f87e[_0x1697('0x2a')]()[_0x1697('0x22')](function(_0x5b07c3){return BPromise[_0x1697('0x26')]({'id':_0x5b07c3[_0x1697('0x29')],'name':_0x5b07c3[_0x1697('0x2b')]});});}}function getEndUser(_0x50f28c,_0x1d3188,_0x4d380f,_0x211464,_0x3c6f5e){var _0x55d665={'$or':{'Phone':_0x211464}};var _0x21bd59={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1697('0x26')]()[_0x1697('0x22')](function(){logger[_0x1697('0x1c')](_0x1697('0x2c'),_0x211464,_0x1d3188['moduleSearch']);switch(_0x1d3188[_0x1697('0x2d')]){case _0x1697('0x2e'):var _0x3f6bee=_[_0x1697('0x2f')](_0x55d665);if(_0x1d3188[_0x1697('0x30')]){var _0x2e1d7a={};_0x2e1d7a[_0x1d3188[_0x1697('0x30')]]=_0x211464;_[_0x1697('0x31')](_0x3f6bee[_0x1697('0x32')],_0x2e1d7a);}return _0x3c6f5e[_0x1697('0x1e')]('Contact')[_0x1697('0x24')](_0x3f6bee,_0x21bd59)[_0x1697('0x33')]()['then'](function(_0x900b7f){if(_0x900b7f&&_0x900b7f[_0x1697('0x23')]){return _0x900b7f;}else{var _0x31dc95=_[_0x1697('0x2f')](_0x55d665);if(_0x1d3188[_0x1697('0x34')]){var _0x312cb2={};_0x312cb2[_0x1d3188[_0x1697('0x34')]]=_0x211464;_[_0x1697('0x31')](_0x31dc95['$or'],_0x312cb2);}return _0x3c6f5e['sobject']('Lead')['find'](_0x31dc95,_0x21bd59);}});case _0x1697('0x35'):var _0x515f87=_[_0x1697('0x2f')](_0x55d665);if(_0x1d3188[_0x1697('0x36')]){var _0x2e1d7a={};_0x2e1d7a[_0x1d3188[_0x1697('0x36')]]=_0x211464;_[_0x1697('0x31')](_0x515f87[_0x1697('0x32')],_0x2e1d7a);}return _0x3c6f5e[_0x1697('0x1e')](_0x1697('0x37'))['find'](_0x515f87,_0x21bd59)[_0x1697('0x33')]()['then'](function(_0xf16f8a){if(_0xf16f8a&&_0xf16f8a[_0x1697('0x23')]){return _0xf16f8a;}else{var _0x787b98=_[_0x1697('0x2f')](_0x55d665);if(_0x1d3188[_0x1697('0x30')]){var _0x2b50ac={};_0x2b50ac[_0x1d3188[_0x1697('0x30')]]=_0x211464;_[_0x1697('0x31')](_0x787b98['$or'],_0x2b50ac);}return _0x3c6f5e['sobject'](_0x1697('0x38'))[_0x1697('0x24')](_0x787b98,_0x21bd59)[_0x1697('0x22')](function(_0x1fc228){if(_0x1fc228&&_0x1fc228[_0x1697('0x23')]){return _0x1fc228;}else{var _0x222702=_['cloneDeep'](_0x55d665);if(_0x1d3188['additionalSearchLead']){var _0x5f2032={};_0x5f2032[_0x1d3188[_0x1697('0x34')]]=_0x211464;_[_0x1697('0x31')](_0x222702[_0x1697('0x32')],_0x5f2032);}return _0x3c6f5e[_0x1697('0x1e')]('Lead')['find'](_0x222702,_0x21bd59);}});}});case _0x1697('0x18'):var _0x3f6bee=_[_0x1697('0x2f')](_0x55d665);if(_0x1d3188['additionalSearchContact']){var _0x2e1d7a={};_0x2e1d7a[_0x1d3188['additionalSearchContact']]=_0x211464;_[_0x1697('0x31')](_0x3f6bee['$or'],_0x2e1d7a);}return _0x3c6f5e['sobject'](_0x1697('0x38'))[_0x1697('0x24')](_0x3f6bee,_0x21bd59)['execute']();case'lead':var _0x1192a2=_['cloneDeep'](_0x55d665);if(_0x1d3188[_0x1697('0x34')]){var _0x2e1d7a={};_0x2e1d7a[_0x1d3188[_0x1697('0x34')]]=_0x211464;_['merge'](_0x1192a2['$or'],_0x2e1d7a);}return _0x3c6f5e['sobject'](_0x1697('0x39'))[_0x1697('0x24')](_0x1192a2,_0x21bd59);case _0x1697('0x15'):var _0x515f87=_[_0x1697('0x2f')](_0x55d665);if(_0x1d3188[_0x1697('0x36')]){var _0x2e1d7a={};_0x2e1d7a[_0x1d3188[_0x1697('0x36')]]=_0x211464;_[_0x1697('0x31')](_0x515f87[_0x1697('0x32')],_0x2e1d7a);}return _0x3c6f5e['sobject'](_0x1697('0x37'))['find'](_0x515f87,_0x21bd59);default:return null;}})['then'](function(_0x3fa0e9){if(_0x3fa0e9&&_0x3fa0e9[_0x1697('0x23')]){var _0x1df2d3=_[_0x1697('0x3a')](_0x3fa0e9);if(_0x1df2d3){return BPromise['resolve']({'id':_0x1df2d3['Id'],'name':_0x1df2d3[_0x1697('0x27')],'phone':_0x1df2d3[_0x1697('0x3b')],'endUserType':_0x1df2d3[_0x1697('0x3c')]['type'][_0x1697('0x3d')]()});}}})[_0x1697('0x22')](function(_0x2819d5){if(_0x2819d5){logger[_0x1697('0x1c')](_0x1697('0x3e'),_0x2819d5[_0x1697('0x12')],_0x211464);return BPromise[_0x1697('0x26')](_0x2819d5);}else{logger[_0x1697('0x1c')](_0x1697('0x3f'),_0x211464);var _0x533391={'Phone':_0x211464};if(_0x1d3188[_0x1697('0x40')]){if(_0x1d3188[_0x1697('0x40')]===_0x1697('0x18')){logger['info'](_0x1697('0x41'),_0x211464,_0x1d3188['moduleCreate']);_0x533391[_0x1697('0x42')]=_0x4d380f!==''?_0x4d380f:util[_0x1697('0x43')]('Caller\x20-\x20%s',_0x211464);}else if(_0x1d3188[_0x1697('0x40')]==='lead'){logger['info'](_0x1697('0x41'),_0x211464,_0x1d3188[_0x1697('0x40')]);_0x533391[_0x1697('0x42')]=_0x4d380f!==_0x1697('0x44')?_0x4d380f:util[_0x1697('0x43')]('Caller\x20-\x20%s',_0x211464);_0x533391[_0x1697('0x45')]=_0x1697('0x46');}else if(_0x1d3188[_0x1697('0x40')]==='account'){logger[_0x1697('0x1c')](_0x1697('0x41'),_0x211464,_0x1d3188['moduleCreate']);_0x533391[_0x1697('0x27')]=_0x4d380f!==_0x1697('0x44')?_0x4d380f:util[_0x1697('0x43')](_0x1697('0x47'),_0x211464);}else{return null;}}return _0x3c6f5e['sobject'](_[_0x1697('0x48')](_0x1d3188[_0x1697('0x40')]))[_0x1697('0x1f')](_0x533391)[_0x1697('0x22')](function(_0x2a0681){return BPromise['resolve']({'id':_0x2a0681['id'],'endUserType':_0x1d3188[_0x1697('0x40')]});});}});}function getCustomFields(_0x3a046c,_0xc12de2){var _0x30d4f9={};if(_0x3a046c[_0x1697('0x23')]>0x0){_[_0x1697('0x49')](_0x3a046c,function(_0x223481){if(_[_0x1697('0x4a')](['string',_0x1697('0x4b')],_0x223481[_0x1697('0x4c')])&&_0x223481[_0x1697('0x4d')]){_0x30d4f9[_0x223481[_0x1697('0x4d')]]=_0x223481[_0x1697('0x4e')][_0x1697('0x4f')]();}else if(_0x223481[_0x1697('0x4c')]===_0x1697('0x50')&&_0x223481[_0x1697('0x51')]&&_0x223481[_0x1697('0x4d')]){_0xc12de2[_0x223481['variableName']]&&(_0x30d4f9[_0x223481['idField']]=_0xc12de2[_0x223481[_0x1697('0x51')]][_0x1697('0x4f')]());}else if(_0x223481[_0x1697('0x4c')]===_0x1697('0x52')&&_0x223481[_0x1697('0x53')]&&_0x223481[_0x1697('0x53')]['name']&&_0x223481[_0x1697('0x4d')]){_0xc12de2[_0x223481['Variable']['name'][_0x1697('0x3d')]()]&&(_0x30d4f9[_0x223481[_0x1697('0x4d')]]=_0xc12de2[_0x223481[_0x1697('0x53')]['name'][_0x1697('0x3d')]()]['toString']());}});}return _0x30d4f9;}function getConnection(_0x3b9138){var _0x5b8b1b=_0x3b9138[_0x1697('0x54')][_0x1697('0x55')](_0x3b9138[_0x1697('0x56')]);var _0x53b027=new jsforce[(_0x1697('0x57'))]({'oauth2':{'loginUrl':_0x3b9138[_0x1697('0x58')]||_0x1697('0x59'),'clientId':_0x3b9138['clientId'],'clientSecret':_0x3b9138[_0x1697('0x5a')]}});return _0x53b027[_0x1697('0x5b')](_0x3b9138[_0x1697('0x5c')],_0x5b8b1b)[_0x1697('0x22')](function(){logger[_0x1697('0x1c')](_0x1697('0x5d'));return _0x53b027;});}exports[_0x1697('0x5e')]=function(_0xba1f5b,_0x24597b,_0xfcabce,_0x55c102,_0x29622b,_0x40793f){var _0x3174da,_0x31f933,_0x1c28db,_0x2872b5;_0x40793f[_0x1697('0x5f')]=intUtil[_0x1697('0x60')](_0x40793f[_0x1697('0x5f')]);_0x40793f['remoteUri']=intUtil[_0x1697('0x60')](_0x40793f[_0x1697('0x58')]);if(_0x29622b&&_0x29622b['monitor_format']){logger[_0x1697('0x1c')]('[QUEUE]',_0x1697('0x61'));_0x24597b[_0x1697('0x62')]=util[_0x1697('0x43')](_0x1697('0x63'),_0x40793f[_0x1697('0x5f')],_0x24597b[_0x1697('0x64')],md5(_0x24597b[_0x1697('0x64')]));}else{_0x24597b[_0x1697('0x62')]='';}return getConnection(_0x40793f)[_0x1697('0x22')](function(_0x5dcccd){_0x2872b5=_0x5dcccd;return getUser(_0x40793f,_0x55c102['email'],_0x2872b5);})['then'](function(_0x5368ae){_0x3174da=_0x5368ae;return getEndUser(_0x40793f,_0xfcabce,_0x24597b[_0x1697('0x65')],_0x24597b[_0x1697('0x66')],_0x2872b5);})['then'](function(_0x418a5e){_0x31f933=_0x418a5e;return getTicket(_0x40793f,_0x3174da,_0x31f933,_0xfcabce,_0x24597b,_0xfcabce[_0x1697('0x67')],_0x2872b5,_0x1697('0x5e'));})[_0x1697('0x22')](function(_0x29cd0a){_0x1c28db=_0x29cd0a;logger[_0x1697('0x1c')](_0x1697('0x68'),_0x1c28db['id']);logger[_0x1697('0x1c')](_0x1697('0x69'),_0x1c28db['id'],_0x55c102[_0x1697('0x6a')],_0x40793f[_0x1697('0x4c')]);switch(_0x40793f[_0x1697('0x4c')]){case _0x1697('0x6b'):emit(util[_0x1697('0x43')]('user:%s',_0x55c102[_0x1697('0x6a')]),_0x1697('0x6c'),{'recordId':_0x1c28db['id']});break;case _0x1697('0x6d'):emit(util['format']('user:%s',_0x55c102[_0x1697('0x6a')]),_0x1697('0x6e'),{'uri':util[_0x1697('0x43')](_0x1697('0x6f'),_0x2872b5[_0x1697('0x70')],_0x1c28db['id'])});break;default:logger[_0x1697('0x71')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x1697('0x72')](function(_0x1b6d23){logger[_0x1697('0x71')](_0x1697('0x73'),_0x1b6d23);});};exports[_0x1697('0x74')]=function(_0x1874a5,_0x41cde4,_0x294b31,_0x22e243,_0x4a7567,_0x35391d,_0x103b1b){var _0x59ee61,_0x26a903,_0x396f88,_0x38242f;_0x35391d[_0x1697('0x5f')]=intUtil[_0x1697('0x60')](_0x35391d[_0x1697('0x5f')]);_0x35391d[_0x1697('0x58')]=intUtil['stripTrailingSlash'](_0x35391d[_0x1697('0x58')]);if(_0x103b1b&&_0x103b1b[_0x1697('0x75')]&&_0x103b1b['recordingFormat']!==_0x1697('0x76')){logger[_0x1697('0x1c')](_0x1697('0x77'),'Recording\x20is\x20enabled!');_0x41cde4['recordingURL']=util['format'](_0x1697('0x63'),_0x35391d[_0x1697('0x5f')],_0x41cde4[_0x1697('0x64')],md5(_0x41cde4[_0x1697('0x64')]));}return getConnection(_0x35391d)['then'](function(_0x2a7730){_0x38242f=_0x2a7730;return getUser(_0x35391d,_0x22e243[_0x1697('0x78')],_0x38242f);})[_0x1697('0x22')](function(_0x1fc174){_0x59ee61=_0x1fc174;return getEndUser(_0x35391d,_0x294b31,_0x41cde4[_0x1697('0x79')],_0x41cde4['destcalleridnum'],_0x38242f);})[_0x1697('0x22')](function(_0x11b915){_0x26a903=_0x11b915;return getTicket(_0x35391d,_0x59ee61,_0x26a903,_0x294b31,_0x41cde4,_0x294b31[_0x1697('0x67')],_0x38242f,'outbound');})[_0x1697('0x22')](function(_0x11ad6e){_0x396f88=_0x11ad6e;logger[_0x1697('0x1c')](_0x1697('0x7a'),_0x396f88['id']);logger[_0x1697('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x396f88['id'],_0x22e243[_0x1697('0x6a')],_0x35391d[_0x1697('0x4c')]);switch(_0x35391d[_0x1697('0x4c')]){case _0x1697('0x6b'):emit(util[_0x1697('0x43')](_0x1697('0x7b'),_0x22e243[_0x1697('0x6a')]),'trigger:salesforce:display',{'recordId':_0x396f88['id']});break;case _0x1697('0x6d'):emit(util[_0x1697('0x43')](_0x1697('0x7b'),_0x22e243[_0x1697('0x6a')]),_0x1697('0x6e'),{'uri':util[_0x1697('0x43')](_0x1697('0x6f'),_0x38242f[_0x1697('0x70')],_0x396f88['id'])});break;default:logger[_0x1697('0x71')](_0x1697('0x77'),_0x1697('0x7c'));}})[_0x1697('0x72')](function(_0x1a74c1){logger[_0x1697('0x71')](_0x1697('0x77'),_0x1a74c1);});};exports[_0x1697('0x7d')]=function(_0x5ca88a,_0x3e5e19,_0x361200,_0x2dec5c,_0x31aafe,_0x51516c){var _0x2745ab,_0x41700c,_0x15e200,_0x11dfe9;_0x51516c[_0x1697('0x5f')]=intUtil[_0x1697('0x60')](_0x51516c[_0x1697('0x5f')]);_0x51516c[_0x1697('0x58')]=intUtil[_0x1697('0x60')](_0x51516c[_0x1697('0x58')]);if(_0x31aafe&&_0x31aafe[_0x1697('0x7e')]){logger[_0x1697('0x1c')]('['+_0x3e5e19[_0x1697('0x7f')][_0x1697('0x80')]()+']',_0x1697('0x61'));_0x3e5e19['recordingURL']=util[_0x1697('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51516c[_0x1697('0x5f')],_0x3e5e19[_0x1697('0x64')],md5(_0x3e5e19[_0x1697('0x64')]));}else{_0x3e5e19[_0x1697('0x62')]='';}return getConnection(_0x51516c)[_0x1697('0x22')](function(_0x592e69){_0x11dfe9=_0x592e69;if(!_['isNil'](_0x2dec5c)){return getUser(_0x51516c,_0x2dec5c['name'],_0x11dfe9);}else{return getUser(_0x51516c,null,_0x11dfe9);}})['then'](function(_0x4c0528){_0x2745ab=_0x4c0528;return getEndUser(_0x51516c,_0x361200,_0x3e5e19['calleridname'],_0x3e5e19['calleridnum'],_0x11dfe9);})[_0x1697('0x22')](function(_0xd4adbe){_0x41700c=_0xd4adbe;return getTicket(_0x51516c,_0x2745ab,_0x41700c,_0x361200,_0x3e5e19,_0x361200['Fields'],_0x11dfe9);})[_0x1697('0x22')](function(_0x4476ef){_0x15e200=_0x4476ef;logger[_0x1697('0x1c')]('['+_0x3e5e19[_0x1697('0x7f')][_0x1697('0x80')]()+_0x1697('0x81'),_0x15e200['id']);logger[_0x1697('0x1c')]('['+_0x3e5e19[_0x1697('0x7f')][_0x1697('0x80')]()+']\x20Integration\x20account\x20type\x20%s.',_0x51516c['type']);})[_0x1697('0x72')](function(_0x29232f){logger['error']('['+_0x3e5e19[_0x1697('0x7f')][_0x1697('0x80')]()+']',_0x29232f);});}; \ No newline at end of file +var _0xdbc7=['additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Contact','first','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','Company','No\x20Company','','upperFirst','forEach','includes','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','trigger:salesforce:display','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','contact','endUserType','lead','account','WhatId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep'];(function(_0x3fde0a,_0x4606bb){var _0x3e4ae2=function(_0x21b466){while(--_0x21b466){_0x3fde0a['push'](_0x3fde0a['shift']());}};_0x3e4ae2(++_0x4606bb);}(_0xdbc7,0xcc));var _0x7dbc=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0xdbc7[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0x7dbc('0x0'));var rp=require(_0x7dbc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x7dbc('0x2'));var jsforce=require(_0x7dbc('0x3'));var util=require(_0x7dbc('0x4'));var Redis=require('ioredis');var intUtil=require(_0x7dbc('0x5'));var config=require(_0x7dbc('0x6'));var logger=require(_0x7dbc('0x7'))(_0x7dbc('0x8'));config['redis']=_[_0x7dbc('0x9')](config[_0x7dbc('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7dbc('0xa')]));function emit(_0x294c2d,_0x450be5,_0x1d3686){io['to'](_0x294c2d)[_0x7dbc('0xb')](_0x450be5,_0x1d3686);}function getTicket(_0x3a4b6e,_0x58d68f,_0x269067,_0x29699f,_0x28c2db,_0x35cd6c,_0x2430ff,_0x407ff2){var _0x480c7d=Object['assign']({},{'OwnerId':_0x58d68f['id'],'Subject':intUtil[_0x7dbc('0xc')](_0x29699f[_0x7dbc('0xd')],_0x28c2db,'\x20'),'Description':intUtil[_0x7dbc('0xc')](_0x29699f[_0x7dbc('0xe')],_0x28c2db,'\x0a')},getCustomFields(_0x35cd6c,_0x28c2db));if(_0x269067){if(_0x29699f[_0x7dbc('0xf')]===_0x7dbc('0x10')){_0x480c7d[_0x7dbc('0x11')]=moment[_0x7dbc('0x12')]();_0x480c7d[_0x7dbc('0x13')]=![];_0x480c7d['IsRecurrence']=![];if(_0x269067['endUserType']===_0x7dbc('0x14')||_0x269067[_0x7dbc('0x15')]===_0x7dbc('0x16')){_0x480c7d['WhoId']=_0x269067['id'];}else if(_0x269067[_0x7dbc('0x15')]===_0x7dbc('0x17')){_0x480c7d[_0x7dbc('0x18')]=_0x269067['id'];}}else if(_0x29699f['ticketType']==='Case'){if(_0x269067[_0x7dbc('0x15')]==='contact'){_0x480c7d['ContactId']=_0x269067['id'];}else if(_0x269067[_0x7dbc('0x15')]==='account'){_0x480c7d[_0x7dbc('0x19')]=_0x269067['id'];}else if(_0x269067['endUserType']===_0x7dbc('0x16')&&_0x29699f[_0x7dbc('0x1a')]){_0x480c7d[_0x29699f[_0x7dbc('0x1a')]]=_0x269067['id'];}else{logger[_0x7dbc('0x1b')](_0x7dbc('0x1c'));}}}return _0x2430ff[_0x7dbc('0x1d')](_0x29699f[_0x7dbc('0xf')])[_0x7dbc('0x1e')](_0x480c7d);}function getUser(_0x2fb52c,_0x101e80,_0x2e8866){if(!_[_0x7dbc('0x1f')](_0x101e80)&&intUtil[_0x7dbc('0x20')](_0x101e80)){var _0xf1b639={'Email':_0x101e80};var _0x2a4217={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2e8866['sobject'](_0x7dbc('0x21'))[_0x7dbc('0x22')](_0xf1b639,_0x2a4217)[_0x7dbc('0x23')]()[_0x7dbc('0x24')](function(_0x239f43){if(_0x239f43[_0x7dbc('0x25')]){var _0x5e13cb=_[_0x7dbc('0x22')](_0x239f43,function(_0xaa15d8){return _0xaa15d8['Email']===_0x101e80;});if(_0x5e13cb){logger[_0x7dbc('0x1b')](_0x7dbc('0x26'),_0x101e80);return BPromise['resolve']({'id':_0x5e13cb['Id'],'name':_0x5e13cb[_0x7dbc('0x27')]});}}else{logger[_0x7dbc('0x1b')](_0x7dbc('0x28'),_0x101e80);return _0x2e8866[_0x7dbc('0x29')]()[_0x7dbc('0x24')](function(_0x5920d7){return BPromise[_0x7dbc('0x2a')]({'id':_0x5920d7[_0x7dbc('0x2b')],'name':_0x5920d7[_0x7dbc('0x2c')]});});}});}else{logger[_0x7dbc('0x1b')](_0x7dbc('0x28'),_0x101e80);return _0x2e8866[_0x7dbc('0x29')]()['then'](function(_0x14485f){return BPromise['resolve']({'id':_0x14485f[_0x7dbc('0x2b')],'name':_0x14485f[_0x7dbc('0x2c')]});});}}function getEndUser(_0x2cc5ea,_0x2a1ddd,_0x54318a,_0xed66a7,_0x4eb843){var _0x6ea192={'$or':{'Phone':_0xed66a7}};var _0x153eec={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7dbc('0x2a')]()['then'](function(){logger[_0x7dbc('0x1b')](_0x7dbc('0x2d'),_0xed66a7,_0x2a1ddd[_0x7dbc('0x2e')]);switch(_0x2a1ddd['moduleSearch']){case'contact_lead':var _0x22e310=_[_0x7dbc('0x2f')](_0x6ea192);if(_0x2a1ddd[_0x7dbc('0x30')]){var _0x415798={};_0x415798[_0x2a1ddd[_0x7dbc('0x30')]]=_0xed66a7;_[_0x7dbc('0x31')](_0x22e310[_0x7dbc('0x32')],_0x415798);}return _0x4eb843['sobject']('Contact')[_0x7dbc('0x22')](_0x22e310,_0x153eec)['execute']()[_0x7dbc('0x24')](function(_0x1d3ebd){if(_0x1d3ebd&&_0x1d3ebd['length']){return _0x1d3ebd;}else{var _0x5467e1=_[_0x7dbc('0x2f')](_0x6ea192);if(_0x2a1ddd['additionalSearchLead']){var _0x508742={};_0x508742[_0x2a1ddd[_0x7dbc('0x33')]]=_0xed66a7;_[_0x7dbc('0x31')](_0x5467e1[_0x7dbc('0x32')],_0x508742);}return _0x4eb843[_0x7dbc('0x1d')](_0x7dbc('0x34'))['find'](_0x5467e1,_0x153eec);}});case _0x7dbc('0x35'):var _0x240af6=_[_0x7dbc('0x2f')](_0x6ea192);if(_0x2a1ddd[_0x7dbc('0x36')]){var _0x415798={};_0x415798[_0x2a1ddd[_0x7dbc('0x36')]]=_0xed66a7;_[_0x7dbc('0x31')](_0x240af6[_0x7dbc('0x32')],_0x415798);}return _0x4eb843[_0x7dbc('0x1d')]('Account')[_0x7dbc('0x22')](_0x240af6,_0x153eec)[_0x7dbc('0x23')]()[_0x7dbc('0x24')](function(_0x133bc0){if(_0x133bc0&&_0x133bc0[_0x7dbc('0x25')]){return _0x133bc0;}else{var _0x3881d1=_[_0x7dbc('0x2f')](_0x6ea192);if(_0x2a1ddd['additionalSearchContact']){var _0x1af731={};_0x1af731[_0x2a1ddd[_0x7dbc('0x30')]]=_0xed66a7;_[_0x7dbc('0x31')](_0x3881d1[_0x7dbc('0x32')],_0x1af731);}return _0x4eb843['sobject'](_0x7dbc('0x37'))[_0x7dbc('0x22')](_0x3881d1,_0x153eec)[_0x7dbc('0x24')](function(_0x5ba9fe){if(_0x5ba9fe&&_0x5ba9fe[_0x7dbc('0x25')]){return _0x5ba9fe;}else{var _0x173130=_[_0x7dbc('0x2f')](_0x6ea192);if(_0x2a1ddd['additionalSearchLead']){var _0x4db926={};_0x4db926[_0x2a1ddd['additionalSearchLead']]=_0xed66a7;_[_0x7dbc('0x31')](_0x173130['$or'],_0x4db926);}return _0x4eb843[_0x7dbc('0x1d')](_0x7dbc('0x34'))[_0x7dbc('0x22')](_0x173130,_0x153eec);}});}});case _0x7dbc('0x14'):var _0x22e310=_[_0x7dbc('0x2f')](_0x6ea192);if(_0x2a1ddd[_0x7dbc('0x30')]){var _0x415798={};_0x415798[_0x2a1ddd[_0x7dbc('0x30')]]=_0xed66a7;_[_0x7dbc('0x31')](_0x22e310[_0x7dbc('0x32')],_0x415798);}return _0x4eb843[_0x7dbc('0x1d')]('Contact')[_0x7dbc('0x22')](_0x22e310,_0x153eec)[_0x7dbc('0x23')]();case _0x7dbc('0x16'):var _0x2ba5f5=_[_0x7dbc('0x2f')](_0x6ea192);if(_0x2a1ddd['additionalSearchLead']){var _0x415798={};_0x415798[_0x2a1ddd['additionalSearchLead']]=_0xed66a7;_[_0x7dbc('0x31')](_0x2ba5f5[_0x7dbc('0x32')],_0x415798);}return _0x4eb843[_0x7dbc('0x1d')](_0x7dbc('0x34'))[_0x7dbc('0x22')](_0x2ba5f5,_0x153eec);case'account':var _0x240af6=_[_0x7dbc('0x2f')](_0x6ea192);if(_0x2a1ddd[_0x7dbc('0x36')]){var _0x415798={};_0x415798[_0x2a1ddd['additionalSearchAccount']]=_0xed66a7;_[_0x7dbc('0x31')](_0x240af6['$or'],_0x415798);}return _0x4eb843[_0x7dbc('0x1d')]('Account')['find'](_0x240af6,_0x153eec);default:return null;}})['then'](function(_0xadbeac){if(_0xadbeac&&_0xadbeac[_0x7dbc('0x25')]){var _0x2dbded=_[_0x7dbc('0x38')](_0xadbeac);if(_0x2dbded){return BPromise[_0x7dbc('0x2a')]({'id':_0x2dbded['Id'],'name':_0x2dbded['Name'],'phone':_0x2dbded['Phone'],'endUserType':_0x2dbded[_0x7dbc('0x39')]['type'][_0x7dbc('0x3a')]()});}}})[_0x7dbc('0x24')](function(_0x7c14a7){if(_0x7c14a7){logger[_0x7dbc('0x1b')](_0x7dbc('0x3b'),_0x7c14a7[_0x7dbc('0x15')],_0xed66a7);return BPromise[_0x7dbc('0x2a')](_0x7c14a7);}else{logger[_0x7dbc('0x1b')](_0x7dbc('0x3c'),_0xed66a7);var _0x34e6e0={'Phone':_0xed66a7};if(_0x2a1ddd[_0x7dbc('0x3d')]){if(_0x2a1ddd[_0x7dbc('0x3d')]==='contact'){logger['info'](_0x7dbc('0x3e'),_0xed66a7,_0x2a1ddd[_0x7dbc('0x3d')]);_0x34e6e0[_0x7dbc('0x3f')]=_0x54318a!==''?_0x54318a:util[_0x7dbc('0x40')](_0x7dbc('0x41'),_0xed66a7);}else if(_0x2a1ddd['moduleCreate']===_0x7dbc('0x16')){logger[_0x7dbc('0x1b')](_0x7dbc('0x3e'),_0xed66a7,_0x2a1ddd['moduleCreate']);_0x34e6e0[_0x7dbc('0x3f')]=_0x54318a!==''?_0x54318a:util['format'](_0x7dbc('0x41'),_0xed66a7);_0x34e6e0[_0x7dbc('0x42')]=_0x7dbc('0x43');}else if(_0x2a1ddd[_0x7dbc('0x3d')]===_0x7dbc('0x17')){logger['info'](_0x7dbc('0x3e'),_0xed66a7,_0x2a1ddd[_0x7dbc('0x3d')]);_0x34e6e0[_0x7dbc('0x27')]=_0x54318a!==_0x7dbc('0x44')?_0x54318a:util[_0x7dbc('0x40')]('Caller\x20-\x20%s',_0xed66a7);}else{return null;}}return _0x4eb843[_0x7dbc('0x1d')](_[_0x7dbc('0x45')](_0x2a1ddd[_0x7dbc('0x3d')]))[_0x7dbc('0x1e')](_0x34e6e0)[_0x7dbc('0x24')](function(_0x2d534b){return BPromise[_0x7dbc('0x2a')]({'id':_0x2d534b['id'],'endUserType':_0x2a1ddd['moduleCreate']});});}});}function getCustomFields(_0x19d369,_0x3dc175){var _0x2dafae={};if(_0x19d369[_0x7dbc('0x25')]>0x0){_[_0x7dbc('0x46')](_0x19d369,function(_0x24a16d){if(_[_0x7dbc('0x47')](['string',_0x7dbc('0x48')],_0x24a16d[_0x7dbc('0x49')])&&_0x24a16d[_0x7dbc('0x4a')]){_0x2dafae[_0x24a16d[_0x7dbc('0x4a')]]=_0x24a16d['content'][_0x7dbc('0x4b')]();}else if(_0x24a16d[_0x7dbc('0x49')]===_0x7dbc('0x4c')&&_0x24a16d[_0x7dbc('0x4d')]&&_0x24a16d[_0x7dbc('0x4a')]){_0x3dc175[_0x24a16d[_0x7dbc('0x4d')]]&&(_0x2dafae[_0x24a16d[_0x7dbc('0x4a')]]=_0x3dc175[_0x24a16d[_0x7dbc('0x4d')]]['toString']());}else if(_0x24a16d[_0x7dbc('0x49')]===_0x7dbc('0x4e')&&_0x24a16d[_0x7dbc('0x4f')]&&_0x24a16d['Variable'][_0x7dbc('0x50')]&&_0x24a16d[_0x7dbc('0x4a')]){_0x3dc175[_0x24a16d[_0x7dbc('0x4f')][_0x7dbc('0x50')][_0x7dbc('0x3a')]()]&&(_0x2dafae[_0x24a16d[_0x7dbc('0x4a')]]=_0x3dc175[_0x24a16d[_0x7dbc('0x4f')][_0x7dbc('0x50')][_0x7dbc('0x3a')]()][_0x7dbc('0x4b')]());}});}return _0x2dafae;}function getConnection(_0x45bcda){var _0x444ca3=_0x45bcda[_0x7dbc('0x51')][_0x7dbc('0x52')](_0x45bcda[_0x7dbc('0x53')]);var _0x5e7ff3=new jsforce['Connection']({'oauth2':{'loginUrl':_0x45bcda[_0x7dbc('0x54')]||_0x7dbc('0x55'),'clientId':_0x45bcda[_0x7dbc('0x56')],'clientSecret':_0x45bcda[_0x7dbc('0x57')]}});return _0x5e7ff3[_0x7dbc('0x58')](_0x45bcda[_0x7dbc('0x59')],_0x444ca3)[_0x7dbc('0x24')](function(){logger[_0x7dbc('0x1b')](_0x7dbc('0x5a'));return _0x5e7ff3;});}exports['queue']=function(_0x5945a1,_0xbe5c8d,_0xd251d0,_0x17e80f,_0x22d986,_0x2adec9){var _0x3a29d6,_0x35cca5,_0x5b89cd,_0x5b5c0d;_0x2adec9[_0x7dbc('0x5b')]=intUtil[_0x7dbc('0x5c')](_0x2adec9[_0x7dbc('0x5b')]);_0x2adec9[_0x7dbc('0x54')]=intUtil[_0x7dbc('0x5c')](_0x2adec9[_0x7dbc('0x54')]);if(_0x22d986&&_0x22d986[_0x7dbc('0x5d')]){logger[_0x7dbc('0x1b')](_0x7dbc('0x5e'),_0x7dbc('0x5f'));_0xbe5c8d[_0x7dbc('0x60')]=util['format'](_0x7dbc('0x61'),_0x2adec9[_0x7dbc('0x5b')],_0xbe5c8d[_0x7dbc('0x62')],md5(_0xbe5c8d['uniqueid']));}else{_0xbe5c8d[_0x7dbc('0x60')]='';}return getConnection(_0x2adec9)[_0x7dbc('0x24')](function(_0x29e38a){_0x5b5c0d=_0x29e38a;return getUser(_0x2adec9,_0x17e80f[_0x7dbc('0x63')],_0x5b5c0d);})[_0x7dbc('0x24')](function(_0x46bf11){_0x3a29d6=_0x46bf11;return getEndUser(_0x2adec9,_0xd251d0,_0xbe5c8d[_0x7dbc('0x64')],_0xbe5c8d[_0x7dbc('0x65')],_0x5b5c0d);})['then'](function(_0x557a44){_0x35cca5=_0x557a44;return getTicket(_0x2adec9,_0x3a29d6,_0x35cca5,_0xd251d0,_0xbe5c8d,_0xd251d0[_0x7dbc('0x66')],_0x5b5c0d,_0x7dbc('0x67'));})['then'](function(_0x27c621){_0x5b89cd=_0x27c621;logger[_0x7dbc('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x5b89cd['id']);logger[_0x7dbc('0x1b')](_0x7dbc('0x68'),_0x5b89cd['id'],_0x17e80f[_0x7dbc('0x50')],_0x2adec9[_0x7dbc('0x49')]);switch(_0x2adec9[_0x7dbc('0x49')]){case _0x7dbc('0x69'):emit(util[_0x7dbc('0x40')](_0x7dbc('0x6a'),_0x17e80f[_0x7dbc('0x50')]),'trigger:salesforce:display',{'recordId':_0x5b89cd['id']});break;case _0x7dbc('0x6b'):emit(util[_0x7dbc('0x40')]('user:%s',_0x17e80f[_0x7dbc('0x50')]),_0x7dbc('0x6c'),{'uri':util[_0x7dbc('0x40')]('%s/%s/e',_0x5b5c0d[_0x7dbc('0x6d')],_0x5b89cd['id'])});break;default:logger[_0x7dbc('0x6e')](_0x7dbc('0x6f'));}})[_0x7dbc('0x70')](function(_0x1bd48e){logger[_0x7dbc('0x6e')](_0x7dbc('0x5e'),_0x1bd48e);});};exports[_0x7dbc('0x71')]=function(_0xe38c80,_0x256922,_0x525654,_0x5dcaf2,_0x3c8ede,_0x561e80,_0x45d991){var _0x4bfb9d,_0x3b0002,_0x588bf0,_0x43a117;_0x561e80['serverUrl']=intUtil[_0x7dbc('0x5c')](_0x561e80[_0x7dbc('0x5b')]);_0x561e80[_0x7dbc('0x54')]=intUtil[_0x7dbc('0x5c')](_0x561e80[_0x7dbc('0x54')]);if(_0x45d991&&_0x45d991['recordingFormat']&&_0x45d991[_0x7dbc('0x72')]!==_0x7dbc('0x73')){logger[_0x7dbc('0x1b')](_0x7dbc('0x74'),_0x7dbc('0x5f'));_0x256922[_0x7dbc('0x60')]=util[_0x7dbc('0x40')](_0x7dbc('0x61'),_0x561e80[_0x7dbc('0x5b')],_0x256922['uniqueid'],md5(_0x256922[_0x7dbc('0x62')]));}return getConnection(_0x561e80)[_0x7dbc('0x24')](function(_0x46eab7){_0x43a117=_0x46eab7;return getUser(_0x561e80,_0x5dcaf2[_0x7dbc('0x63')],_0x43a117);})['then'](function(_0x581b34){_0x4bfb9d=_0x581b34;return getEndUser(_0x561e80,_0x525654,_0x256922[_0x7dbc('0x75')],_0x256922['destcalleridnum'],_0x43a117);})[_0x7dbc('0x24')](function(_0x1c1f49){_0x3b0002=_0x1c1f49;return getTicket(_0x561e80,_0x4bfb9d,_0x3b0002,_0x525654,_0x256922,_0x525654['Fields'],_0x43a117,_0x7dbc('0x71'));})[_0x7dbc('0x24')](function(_0x22db2f){_0x588bf0=_0x22db2f;logger[_0x7dbc('0x1b')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x588bf0['id']);logger[_0x7dbc('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x588bf0['id'],_0x5dcaf2['name'],_0x561e80[_0x7dbc('0x49')]);switch(_0x561e80[_0x7dbc('0x49')]){case _0x7dbc('0x69'):emit(util['format'](_0x7dbc('0x6a'),_0x5dcaf2[_0x7dbc('0x50')]),_0x7dbc('0x76'),{'recordId':_0x588bf0['id']});break;case'newTab':emit(util[_0x7dbc('0x40')]('user:%s',_0x5dcaf2[_0x7dbc('0x50')]),_0x7dbc('0x6c'),{'uri':util[_0x7dbc('0x40')](_0x7dbc('0x77'),_0x43a117[_0x7dbc('0x6d')],_0x588bf0['id'])});break;default:logger[_0x7dbc('0x6e')](_0x7dbc('0x74'),_0x7dbc('0x78'));}})['catch'](function(_0x1dfe43){logger[_0x7dbc('0x6e')]('[OUTBOUND]',_0x1dfe43);});};exports[_0x7dbc('0x79')]=function(_0x9fce53,_0x5ca2e1,_0x48b9b,_0x2347c1,_0x1b71ab,_0x4000e7){var _0x57974b,_0x39814a,_0x52f46e,_0x229fa1;_0x4000e7[_0x7dbc('0x5b')]=intUtil[_0x7dbc('0x5c')](_0x4000e7[_0x7dbc('0x5b')]);_0x4000e7[_0x7dbc('0x54')]=intUtil[_0x7dbc('0x5c')](_0x4000e7[_0x7dbc('0x54')]);if(_0x1b71ab&&_0x1b71ab['monitor_format']){logger['info']('['+_0x5ca2e1[_0x7dbc('0x7a')][_0x7dbc('0x7b')]()+']',_0x7dbc('0x5f'));_0x5ca2e1[_0x7dbc('0x60')]=util[_0x7dbc('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4000e7['serverUrl'],_0x5ca2e1['uniqueid'],md5(_0x5ca2e1[_0x7dbc('0x62')]));}else{_0x5ca2e1['recordingURL']='';}return getConnection(_0x4000e7)[_0x7dbc('0x24')](function(_0x2ed0d7){_0x229fa1=_0x2ed0d7;if(!_[_0x7dbc('0x1f')](_0x2347c1)){return getUser(_0x4000e7,_0x2347c1[_0x7dbc('0x50')],_0x229fa1);}else{return getUser(_0x4000e7,null,_0x229fa1);}})[_0x7dbc('0x24')](function(_0x3f9c98){_0x57974b=_0x3f9c98;return getEndUser(_0x4000e7,_0x48b9b,_0x5ca2e1[_0x7dbc('0x64')],_0x5ca2e1[_0x7dbc('0x65')],_0x229fa1);})['then'](function(_0x111bdf){_0x39814a=_0x111bdf;return getTicket(_0x4000e7,_0x57974b,_0x39814a,_0x48b9b,_0x5ca2e1,_0x48b9b[_0x7dbc('0x66')],_0x229fa1);})[_0x7dbc('0x24')](function(_0x4f4b1b){_0x52f46e=_0x4f4b1b;logger['info']('['+_0x5ca2e1[_0x7dbc('0x7a')][_0x7dbc('0x7b')]()+_0x7dbc('0x7c'),_0x52f46e['id']);logger[_0x7dbc('0x1b')]('['+_0x5ca2e1['lastevent']['toUpperCase']()+_0x7dbc('0x7d'),_0x4000e7[_0x7dbc('0x49')]);})['catch'](function(_0x1ff4cd){logger[_0x7dbc('0x6e')]('['+_0x5ca2e1['lastevent'][_0x7dbc('0x7b')]()+']',_0x1ff4cd);});}; \ 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 f0ceb44..e10365e 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 _0x5b53=['calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','result','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum'];(function(_0x22422f,_0x249b02){var _0x51e7db=function(_0x5f4546){while(--_0x5f4546){_0x22422f['push'](_0x22422f['shift']());}};_0x51e7db(++_0x249b02);}(_0x5b53,0x85));var _0x35b5=function(_0x38d832,_0xf2104d){_0x38d832=_0x38d832-0x0;var _0x2e166e=_0x5b53[_0x38d832];return _0x2e166e;};'use strict';var _=require('lodash');var Promise=require(_0x35b5('0x0'));var rp=require(_0x35b5('0x1'));var util=require(_0x35b5('0x2'));var md5=require('md5');var Redis=require(_0x35b5('0x3'));var intUtil=require(_0x35b5('0x4'));var config=require(_0x35b5('0x5'));var logger=require(_0x35b5('0x6'))(_0x35b5('0x7'));config['redis']=_['defaults'](config[_0x35b5('0x8')],{'host':_0x35b5('0x9'),'port':0x18eb});var io=require(_0x35b5('0xa'))(new Redis(config[_0x35b5('0x8')]));function getAdminUser(_0x12c525,_0x5e996e,_0x3cc2c2,_0x3b516a,_0xa5917a,_0x4e42bc){return new Promise(function(_0x476c0a,_0xc3c192){var _0x30e699={'method':'GET','uri':_0x3b516a+_0x35b5('0xb')+'&'+_0xa5917a+'&'+_0x4e42bc,'auth':_0x5e996e,'json':!![]};return rp(_0x30e699)[_0x35b5('0xc')](function(_0x572a4c){if(_0x572a4c['result'][_0x35b5('0xd')]>0x0){_0x3cc2c2['adminId']=_0x572a4c['result'][0x0][_0x35b5('0xe')];}logger[_0x35b5('0xf')]('['+[_0x12c525[_0x35b5('0x10')]()]+_0x35b5('0x11'),_0x3cc2c2);_0x476c0a(_0x3cc2c2);})[_0x35b5('0x12')](function(_0x474e82){logger[_0x35b5('0x13')]('['+[_0x12c525[_0x35b5('0x10')]()]+']',_0x474e82[_0x35b5('0x14')]);_0xc3c192(_0x474e82[_0x35b5('0x14')]);});});}function getUser(_0x5577af,_0x5d6327,_0x34b07a,_0x4125f4,_0x5aa110){return function(_0x56b355){logger[_0x35b5('0xf')]('['+[_0x5577af[_0x35b5('0x10')]()]+_0x35b5('0x15'),_0x56b355);return new Promise(function(_0x477ad2,_0x2d9ade){if(intUtil[_0x35b5('0x16')](_0x56b355[_0x35b5('0x17')])){var _0xeceae0={'method':_0x35b5('0x18'),'uri':_0x34b07a+_0x35b5('0x19')+_0x56b355[_0x35b5('0x17')]+'&'+_0x4125f4+'&'+_0x5aa110,'auth':_0x5d6327,'json':!![]};logger[_0x35b5('0xf')]('['+[_0x5577af['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0xeceae0);return rp(_0xeceae0)['then'](function(_0x5bfd9f){logger[_0x35b5('0xf')]('['+[_0x5577af[_0x35b5('0x10')]()]+_0x35b5('0x1a'),_0x5bfd9f);if(_0x5bfd9f['result'][_0x35b5('0xd')]>0x0&&String(_0x5bfd9f['result'][0x0][_0x35b5('0x1b')])===_0x35b5('0x1c')){_0x56b355[_0x35b5('0x1d')]=_0x5bfd9f[_0x35b5('0x1e')][0x0][_0x35b5('0xe')];}else{_0x56b355[_0x35b5('0x1d')]=_0x56b355[_0x35b5('0x1f')];_0x56b355[_0x35b5('0x17')]=_0x56b355[_0x35b5('0x20')];}logger[_0x35b5('0xf')]('['+[_0x5577af[_0x35b5('0x10')]()]+_0x35b5('0x21'),_0x56b355);_0x477ad2(_0x56b355);})[_0x35b5('0x12')](function(_0x24964e){logger['error']('['+[_0x5577af[_0x35b5('0x10')]()]+']',_0x24964e['message']);_0x2d9ade(_0x24964e['message']);});}else{logger[_0x35b5('0xf')]('['+[_0x5577af[_0x35b5('0x10')]()]+_0x35b5('0x22'));_0x56b355[_0x35b5('0x1d')]=_0x56b355[_0x35b5('0x1f')];_0x56b355[_0x35b5('0x17')]=_0x56b355[_0x35b5('0x20')];_0x477ad2(_0x56b355);}});};}function createEndUser(_0x59f8f5,_0x50e212,_0x4a5f4e,_0x392ecc,_0x120676){logger['info']('['+[_0x59f8f5[_0x35b5('0x10')]()]+_0x35b5('0x23'),_0x4a5f4e);return new Promise(function(_0x51c70c,_0x3bc75a){var _0x32faab={'method':_0x35b5('0x24'),'uri':_0x392ecc+_0x35b5('0x25')+_0x120676,'body':{'user_name':_0x4a5f4e[_0x35b5('0x26')],'roles':_0x35b5('0x27'),'first_name':_0x4a5f4e[_0x35b5('0x26')],'active':'true','date_format':_0x35b5('0x28'),'phone':_0x4a5f4e[_0x35b5('0x26')]},'auth':_0x50e212,'json':!![]};return rp(_0x32faab)[_0x35b5('0xc')](function(_0xf4e2ef){logger['info']('['+[_0x59f8f5[_0x35b5('0x10')]()]+_0x35b5('0x29'),_0xf4e2ef[_0x35b5('0x1e')]);_0x4a5f4e[_0x35b5('0x2a')]=_0xf4e2ef[_0x35b5('0x1e')][_0x35b5('0xe')];_0x51c70c(_0x4a5f4e);})[_0x35b5('0x12')](function(_0x29c360){logger[_0x35b5('0x13')]('['+[_0x59f8f5[_0x35b5('0x10')]()]+']',_0x29c360[_0x35b5('0x14')]);_0x3bc75a(_0x29c360[_0x35b5('0x14')]);});});}function getEndUser(_0x15ef24,_0x3fd042,_0xc6459f,_0x55576a,_0x16aa2f){return function(_0x2024d1){logger[_0x35b5('0xf')]('['+[_0x15ef24[_0x35b5('0x10')]()]+_0x35b5('0x2b'),_0x2024d1);return new Promise(function(_0x11c4a6,_0x1e4cfb){var _0x4141db={'method':_0x35b5('0x18'),'uri':_0xc6459f+_0x35b5('0x2c')+_0x2024d1['endUserNumber']+'&'+_0x55576a+'&'+_0x16aa2f,'auth':_0x3fd042,'json':!![]};return rp(_0x4141db)[_0x35b5('0xc')](function(_0x4535ad){if(_0x4535ad[_0x35b5('0x1e')][_0x35b5('0xd')]>0x0){_0x2024d1[_0x35b5('0x2a')]=_0x4535ad['result'][0x0][_0x35b5('0xe')];logger[_0x35b5('0xf')]('['+[_0x15ef24[_0x35b5('0x10')]()]+_0x35b5('0x2d'),_0x2024d1);_0x11c4a6(_0x2024d1);}else{return createEndUser(_0x15ef24,_0x3fd042,_0x2024d1,_0xc6459f,_0x55576a)[_0x35b5('0xc')](function(_0x436483){logger[_0x35b5('0xf')]('['+[_0x15ef24[_0x35b5('0x10')]()]+_0x35b5('0x2e'),_0x436483);_0x11c4a6(_0x436483);});}})[_0x35b5('0x12')](function(_0x322c0){logger[_0x35b5('0x13')]('['+[_0x15ef24[_0x35b5('0x10')]()]+']',_0x322c0[_0x35b5('0x14')]);_0x1e4cfb(_0x322c0['message']);});});};}function getCustomFields(_0x35f0b0,_0x7803ea){var _0x30f54d={};if(_0x35f0b0['length']>0x0){_['forEach'](_0x35f0b0,function(_0x481f32){if(_[_0x35b5('0x2f')](['string',_0x35b5('0x30')],_0x481f32[_0x35b5('0x31')])&&_0x481f32[_0x35b5('0x32')]&&!_0x481f32[_0x35b5('0x33')]){_0x30f54d[_0x481f32[_0x35b5('0x32')][_0x35b5('0x34')]()]=_0x481f32[_0x35b5('0x35')][_0x35b5('0x36')]();}else if(_['includes']([_0x35b5('0x37'),_0x35b5('0x30')],_0x481f32[_0x35b5('0x31')])&&_0x481f32['idField']&&_0x481f32[_0x35b5('0x33')]){_0x30f54d[_0x481f32[_0x35b5('0x38')][_0x35b5('0x34')]()]=_0x481f32[_0x35b5('0x35')][_0x35b5('0x36')]();}else if(_0x481f32[_0x35b5('0x31')]===_0x35b5('0x39')&&_0x481f32[_0x35b5('0x3a')]&&_0x481f32['idField']&&_0x481f32[_0x35b5('0x33')]){_0x30f54d[_0x481f32[_0x35b5('0x38')]['toLowerCase']()]=_0x7803ea[_0x481f32[_0x35b5('0x3a')]]['toString']();}else if(_0x481f32[_0x35b5('0x31')]==='customVariable'&&_0x481f32[_0x35b5('0x3b')]&&_0x481f32[_0x35b5('0x3b')][_0x35b5('0x3c')]&&_0x481f32[_0x35b5('0x38')]&&_0x481f32[_0x35b5('0x33')]){_0x30f54d[_0x481f32[_0x35b5('0x38')][_0x35b5('0x34')]()]=_0x7803ea[_0x481f32[_0x35b5('0x3b')][_0x35b5('0x3c')]['toLowerCase']()]['toString']();}});}return _0x30f54d;}function getTicket(_0x173ed2,_0x61102a,_0x5dbaaf,_0x4b64ad,_0x1f5115,_0x44ece8){return function(_0x3bb3f2){logger[_0x35b5('0xf')]('['+[_0x173ed2[_0x35b5('0x10')]()]+_0x35b5('0x3d'),_0x3bb3f2);return new Promise(function(_0x59b27d,_0x49a6c6){var _0x1a2923=_0x173ed2[_0x35b5('0x34')]()===_0x35b5('0x3e')?_0x3bb3f2[_0x35b5('0x1d')]:_0x3bb3f2[_0x35b5('0x2a')];var _0x1e8ffb={'method':_0x35b5('0x24'),'uri':_0x5dbaaf+'incident'+'?'+_0x44ece8,'body':Object[_0x35b5('0x3f')]({},{'active':'true','caller_id':_0x1a2923,'assigned_to':_0x3bb3f2[_0x35b5('0x1d')],'short_description':intUtil[_0x35b5('0x40')](_0x4b64ad[_0x35b5('0x41')],_0x1f5115,'\x20'),'description':intUtil['getString'](_0x4b64ad[_0x35b5('0x42')],_0x1f5115,'\x0a')},getCustomFields(_0x4b64ad[_0x35b5('0x43')],_0x1f5115)),'auth':_0x61102a,'json':!![]};return rp(_0x1e8ffb)['then'](function(_0x16b226){logger[_0x35b5('0xf')]('['+[_0x173ed2[_0x35b5('0x10')]()]+_0x35b5('0x44'),_0x16b226[_0x35b5('0x1e')]);_0x3bb3f2[_0x35b5('0x45')]=_0x16b226[_0x35b5('0x1e')][_0x35b5('0xe')];_0x3bb3f2[_0x35b5('0x46')]=_0x16b226['result'][_0x35b5('0x47')];logger[_0x35b5('0xf')]('['+[_0x173ed2[_0x35b5('0x10')]()]+_0x35b5('0x48'),_0x3bb3f2);_0x59b27d(_0x3bb3f2);})[_0x35b5('0x12')](function(_0x534c6b){logger[_0x35b5('0x13')]('['+[_0x173ed2[_0x35b5('0x10')]()]+']',_0x534c6b[_0x35b5('0x14')]);_0x49a6c6(_0x534c6b[_0x35b5('0x14')]);});});};}function createRemoteTag(_0x42e66f,_0x2c884c,_0x2303b6,_0x5c180c){return new Promise(function(_0x1933ca,_0x2a2caf){var _0x30773d={'method':_0x35b5('0x24'),'uri':_0x2303b6+'label'+'?'+_0x5c180c,'body':{'short_description':_0x42e66f,'global':!![],'active':!![],'name':_0x42e66f},'auth':_0x2c884c,'json':!![]};return rp(_0x30773d)[_0x35b5('0xc')](function(_0x1ca54f){var _0xee828f=_0x1ca54f[_0x35b5('0x1e')]['sys_id'];_0x1933ca(_0xee828f);});});}function getRemoteTag(_0x3e6b77,_0x541e18,_0x5b645a,_0x33125a,_0x8d79ef){return new Promise(function(_0x109789,_0xfd83f8){var _0x566723={'method':_0x35b5('0x18'),'uri':_0x5b645a+_0x35b5('0x49')+'?sysparm_query=name%3D'+_0x3e6b77+'&'+_0x33125a,'auth':_0x541e18,'json':!![]};return rp(_0x566723)[_0x35b5('0xc')](function(_0x19d7af){if(_0x19d7af[_0x35b5('0x1e')][_0x35b5('0xd')]>0x0){var _0x28c331=_0x19d7af[_0x35b5('0x1e')][0x0][_0x35b5('0xe')];_0x109789(_0x28c331);}else{return createRemoteTag(_0x3e6b77,_0x541e18,_0x5b645a,_0x33125a)[_0x35b5('0xc')](function(_0xcb3c14){_0x109789(_0xcb3c14);});}});});}function assignTagToIncident(_0x4ac53d,_0x76e1a0,_0x59641e,_0x39a795,_0x32e95f){return new Promise(function(_0x9bf592,_0xbe4eb6){var _0x13dc51={'method':_0x35b5('0x24'),'uri':_0x59641e+_0x35b5('0x4a')+'?'+_0x32e95f,'body':{'label':_0x4ac53d,'table':'incident','id_type':_0x35b5('0x4b'),'table_key':_0x39a795[_0x35b5('0x45')],'title':'Incident\x20-\x20'+_0x39a795[_0x35b5('0x46')],'id_display':_0x39a795[_0x35b5('0x46')]},'auth':_0x76e1a0,'json':!![]};return rp(_0x13dc51)[_0x35b5('0xc')](function(_0x2743e5){_0x9bf592();})[_0x35b5('0x12')](function(){_0x9bf592();});});}function manageTags(_0x30cd98,_0x8149d0,_0x7dbdd2,_0x5c1a04,_0x2c8ecb,_0x3fdc54,_0x50c6e8){return new Promise(function(_0x1331a8,_0x550d39){var _0x2370ef=[];_0x8149d0[_0x35b5('0x4c')](function(_0xe5726c){_0x2370ef[_0x35b5('0x4d')](getRemoteTag(_0xe5726c,_0x7dbdd2,_0x5c1a04,_0x3fdc54,_0x50c6e8));});return Promise[_0x35b5('0x4e')](_0x2370ef)[_0x35b5('0xc')](function(_0x1094e5){if(_0x1094e5['length']){logger[_0x35b5('0xf')]('['+[_0x30cd98[_0x35b5('0x10')]()]+_0x35b5('0x4f'),_0x1094e5);var _0x4d96f7=[];_0x1094e5[_0x35b5('0x4c')](function(_0x4df795){_0x4d96f7[_0x35b5('0x4d')](assignTagToIncident(_0x4df795,_0x7dbdd2,_0x5c1a04,_0x2c8ecb,_0x3fdc54));});return Promise['all'](_0x4d96f7)[_0x35b5('0xc')](function(){_0x1331a8();})[_0x35b5('0x12')](function(){_0x1331a8();});}else{_0x1331a8();}});});}function getTags(_0x159e43,_0x217630,_0x3f0cbf,_0x4ee6ef,_0x5c85d8,_0x131d46){return function(_0x15ebcd){return new Promise(function(_0x2b381a,_0x12b9d5){var _0x4b2502=[];var _0x5cf54a=_0x4ee6ef[_0x35b5('0x50')];if(_0x5cf54a&&_0x5cf54a['length']>0x0){_0x4b2502=_[_0x35b5('0x51')](_0x5cf54a,_0x35b5('0x3c'));}if(_0x4b2502[_0x35b5('0xd')]>0x0){return manageTags(_0x159e43,_0x4b2502,_0x217630,_0x3f0cbf,_0x15ebcd,_0x5c85d8,_0x131d46)[_0x35b5('0xc')](function(){_0x2b381a(_0x15ebcd);});}else{_0x2b381a(_0x15ebcd);}});};}function emit(_0x20d4bf,_0x19f13f,_0xb0df19){var _0xfe77a=_0x35b5('0x52')+_0x35b5('0x53')+_0x35b5('0x54')+'%255EORDERBYDESCnumber';var _0x5a0d3a={'uri':_0x20d4bf+_0x35b5('0x55')+_0xb0df19+_0xfe77a};io['to'](util[_0x35b5('0x56')](_0x35b5('0x57'),_0x19f13f))[_0x35b5('0x58')](_0x35b5('0x59'),_0x5a0d3a);}exports['cs']=function(_0x30d8ba,_0x57e328,_0x1ae939,_0x5a3945,_0x99dae0,_0x1e360e,_0x56a122,_0xebaddd){var _0x51dec4={};var _0x3073cb={'user':_0x1e360e[_0x35b5('0x5a')],'pass':_0x1e360e[_0x35b5('0x5b')]};var _0x40c771=_0x35b5('0x5c');var _0x11f6b4=_0x35b5('0x5d');_0x1e360e[_0x35b5('0x5e')]=intUtil[_0x35b5('0x5f')](_0x1e360e[_0x35b5('0x5e')]);_0x1e360e[_0x35b5('0x60')]=intUtil[_0x35b5('0x5f')](_0x1e360e[_0x35b5('0x60')]);var _0x48a381=util[_0x35b5('0x56')](_0x35b5('0x61'),_0x1e360e[_0x35b5('0x5e')]);_0x51dec4[_0x35b5('0x17')]=!_[_0x35b5('0x62')](_0x5a3945)?_0x5a3945['email']:null;_0x51dec4[_0x35b5('0x20')]=_0x1e360e[_0x35b5('0x63')];_0x51dec4[_0x35b5('0x26')]=_0xebaddd['toLowerCase']()===_0x35b5('0x3e')?_0x57e328[_0x35b5('0x64')]:_0x57e328[_0x35b5('0x65')];_0x51dec4[_0x35b5('0x66')]=_0xebaddd===_0x35b5('0x67')||_0xebaddd==='unmanaged'?'queue':_0x35b5('0x3e');var _0x406ef9=util[_0x35b5('0x56')](_0x35b5('0x68'),_0x1e360e[_0x35b5('0x60')],_0x57e328['uniqueid'],md5(_0x57e328['uniqueid']));if(_0x99dae0&&_0x99dae0[_0x35b5('0x69')]){logger[_0x35b5('0xf')](_0x35b5('0x6a'),'Recording\x20is\x20enabled!');_0x57e328[_0x35b5('0x6b')]=_0x406ef9;}else if(_0x56a122&&_0x56a122[_0x35b5('0x6c')]&&_0x56a122['recordingFormat']!=='none'){logger[_0x35b5('0xf')](_0x35b5('0x6d'),_0x35b5('0x6e'));_0x57e328[_0x35b5('0x6b')]=_0x406ef9;}else{_0x57e328['recordingURL']='';}return getAdminUser(_0xebaddd,_0x3073cb,_0x51dec4,_0x48a381,_0x11f6b4,_0x40c771)[_0x35b5('0xc')](getUser(_0xebaddd,_0x3073cb,_0x48a381,_0x11f6b4,_0x40c771))[_0x35b5('0xc')](getEndUser(_0xebaddd,_0x3073cb,_0x48a381,_0x11f6b4,_0x40c771))[_0x35b5('0xc')](getTicket(_0xebaddd,_0x3073cb,_0x48a381,_0x1ae939,_0x57e328,_0x11f6b4))[_0x35b5('0xc')](function(_0x5df631){logger['info'](util[_0x35b5('0x56')](_0x35b5('0x6f'),_0x5df631[_0x35b5('0x45')]));logger[_0x35b5('0xf')](util[_0x35b5('0x56')](_0x35b5('0x70'),_0xebaddd));if(_0xebaddd!==_0x35b5('0x71')){logger['info']('['+[_0xebaddd[_0x35b5('0x10')]()]+']',_0x35b5('0x72'));emit(_0x1e360e[_0x35b5('0x5e')],_0x5a3945['name'],_0x5df631['ticketId']);}})[_0x35b5('0x12')](function(_0xd7937d){logger[_0x35b5('0x13')]('['+[_0xebaddd[_0x35b5('0x10')]()]+_0x35b5('0x73'),util[_0x35b5('0x74')](_0xd7937d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xbae9=['destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','],\x20getUser\x20input\x20crm','validateEmail','GET','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','active','true','adminEmail','],\x20getUser\x20crm','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','endUserId','],\x20getEndUser\x20crm','error','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email'];(function(_0x4db942,_0x1674bb){var _0x3af92e=function(_0x315c31){while(--_0x315c31){_0x4db942['push'](_0x4db942['shift']());}};_0x3af92e(++_0x1674bb);}(_0xbae9,0xf0));var _0x9bae=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0xbae9[_0x3bcf9e];return _0x1bb37c;};'use strict';var _=require(_0x9bae('0x0'));var Promise=require(_0x9bae('0x1'));var rp=require(_0x9bae('0x2'));var util=require(_0x9bae('0x3'));var md5=require(_0x9bae('0x4'));var Redis=require(_0x9bae('0x5'));var intUtil=require(_0x9bae('0x6'));var config=require(_0x9bae('0x7'));var logger=require(_0x9bae('0x8'))(_0x9bae('0x9'));config[_0x9bae('0xa')]=_['defaults'](config['redis'],{'host':_0x9bae('0xb'),'port':0x18eb});var io=require(_0x9bae('0xc'))(new Redis(config['redis']));function getAdminUser(_0x1766d8,_0x1ad8eb,_0x562d99,_0x326bff,_0x56260c,_0x120349){return new Promise(function(_0x1ffe56,_0x344660){var _0x4e66d4={'method':'GET','uri':_0x326bff+_0x9bae('0xd')+'&'+_0x56260c+'&'+_0x120349,'auth':_0x1ad8eb,'json':!![]};return rp(_0x4e66d4)[_0x9bae('0xe')](function(_0x2bd37e){if(_0x2bd37e[_0x9bae('0xf')][_0x9bae('0x10')]>0x0){_0x562d99[_0x9bae('0x11')]=_0x2bd37e[_0x9bae('0xf')][0x0][_0x9bae('0x12')];}logger['info']('['+[_0x1766d8[_0x9bae('0x13')]()]+_0x9bae('0x14'),_0x562d99);_0x1ffe56(_0x562d99);})[_0x9bae('0x15')](function(_0x243a4a){logger['error']('['+[_0x1766d8[_0x9bae('0x13')]()]+']',_0x243a4a['message']);_0x344660(_0x243a4a[_0x9bae('0x16')]);});});}function getUser(_0x19a62c,_0x4371af,_0x5cc1a3,_0x3b02bb,_0x39cdd2){return function(_0x1b8c07){logger[_0x9bae('0x17')]('['+[_0x19a62c[_0x9bae('0x13')]()]+_0x9bae('0x18'),_0x1b8c07);return new Promise(function(_0x1223d2,_0x3a6f81){if(intUtil[_0x9bae('0x19')](_0x1b8c07['userEmail'])){var _0x2e18b7={'method':_0x9bae('0x1a'),'uri':_0x5cc1a3+_0x9bae('0x1b')+_0x1b8c07[_0x9bae('0x1c')]+'&'+_0x3b02bb+'&'+_0x39cdd2,'auth':_0x4371af,'json':!![]};logger['info']('['+[_0x19a62c['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x2e18b7);return rp(_0x2e18b7)['then'](function(_0x191a78){logger[_0x9bae('0x17')]('['+[_0x19a62c[_0x9bae('0x13')]()]+_0x9bae('0x1d'),_0x191a78);if(_0x191a78['result'][_0x9bae('0x10')]>0x0&&String(_0x191a78[_0x9bae('0xf')][0x0][_0x9bae('0x1e')])===_0x9bae('0x1f')){_0x1b8c07['userId']=_0x191a78[_0x9bae('0xf')][0x0][_0x9bae('0x12')];}else{_0x1b8c07['userId']=_0x1b8c07['adminId'];_0x1b8c07['userEmail']=_0x1b8c07[_0x9bae('0x20')];}logger[_0x9bae('0x17')]('['+[_0x19a62c[_0x9bae('0x13')]()]+_0x9bae('0x21'),_0x1b8c07);_0x1223d2(_0x1b8c07);})['catch'](function(_0x3d2823){logger['error']('['+[_0x19a62c[_0x9bae('0x13')]()]+']',_0x3d2823[_0x9bae('0x16')]);_0x3a6f81(_0x3d2823[_0x9bae('0x16')]);});}else{logger[_0x9bae('0x17')]('['+[_0x19a62c[_0x9bae('0x13')]()]+']\x20using\x20admin\x20profile');_0x1b8c07[_0x9bae('0x22')]=_0x1b8c07[_0x9bae('0x11')];_0x1b8c07['userEmail']=_0x1b8c07[_0x9bae('0x20')];_0x1223d2(_0x1b8c07);}});};}function createEndUser(_0x5ae055,_0x266423,_0x4dc256,_0x2f2dbc,_0x57d5f2){logger[_0x9bae('0x17')]('['+[_0x5ae055[_0x9bae('0x13')]()]+_0x9bae('0x23'),_0x4dc256);return new Promise(function(_0x35bdbd,_0x51912d){var _0x1c0681={'method':_0x9bae('0x24'),'uri':_0x2f2dbc+_0x9bae('0x25')+_0x57d5f2,'body':{'user_name':_0x4dc256[_0x9bae('0x26')],'roles':_0x9bae('0x27'),'first_name':_0x4dc256['endUserNumber'],'active':_0x9bae('0x1f'),'date_format':_0x9bae('0x28'),'phone':_0x4dc256[_0x9bae('0x26')]},'auth':_0x266423,'json':!![]};return rp(_0x1c0681)['then'](function(_0x22d9f8){logger[_0x9bae('0x17')]('['+[_0x5ae055[_0x9bae('0x13')]()]+_0x9bae('0x29'),_0x22d9f8[_0x9bae('0xf')]);_0x4dc256['endUserId']=_0x22d9f8[_0x9bae('0xf')][_0x9bae('0x12')];_0x35bdbd(_0x4dc256);})[_0x9bae('0x15')](function(_0x227888){logger['error']('['+[_0x5ae055[_0x9bae('0x13')]()]+']',_0x227888[_0x9bae('0x16')]);_0x51912d(_0x227888[_0x9bae('0x16')]);});});}function getEndUser(_0x5ad9cb,_0x4d5ffd,_0x5629ef,_0x12b3a5,_0x1a2f68){return function(_0x12b0ea){logger[_0x9bae('0x17')]('['+[_0x5ad9cb[_0x9bae('0x13')]()]+_0x9bae('0x2a'),_0x12b0ea);return new Promise(function(_0x317895,_0xb28f42){var _0x114045={'method':_0x9bae('0x1a'),'uri':_0x5629ef+'sys_user?sysparm_query=phone%3D'+_0x12b0ea[_0x9bae('0x26')]+'&'+_0x12b3a5+'&'+_0x1a2f68,'auth':_0x4d5ffd,'json':!![]};return rp(_0x114045)[_0x9bae('0xe')](function(_0x497196){if(_0x497196[_0x9bae('0xf')][_0x9bae('0x10')]>0x0){_0x12b0ea[_0x9bae('0x2b')]=_0x497196[_0x9bae('0xf')][0x0][_0x9bae('0x12')];logger[_0x9bae('0x17')]('['+[_0x5ad9cb[_0x9bae('0x13')]()]+_0x9bae('0x2c'),_0x12b0ea);_0x317895(_0x12b0ea);}else{return createEndUser(_0x5ad9cb,_0x4d5ffd,_0x12b0ea,_0x5629ef,_0x12b3a5)[_0x9bae('0xe')](function(_0x592192){logger[_0x9bae('0x17')]('['+[_0x5ad9cb[_0x9bae('0x13')]()]+'],\x20createEndUser\x20crm',_0x592192);_0x317895(_0x592192);});}})[_0x9bae('0x15')](function(_0xb4a0b8){logger[_0x9bae('0x2d')]('['+[_0x5ad9cb[_0x9bae('0x13')]()]+']',_0xb4a0b8[_0x9bae('0x16')]);_0xb28f42(_0xb4a0b8['message']);});});};}function getCustomFields(_0x1f0111,_0x4c00f9){var _0x4f5f1d={};if(_0x1f0111[_0x9bae('0x10')]>0x0){_[_0x9bae('0x2e')](_0x1f0111,function(_0x2d220c){if(_[_0x9bae('0x2f')]([_0x9bae('0x30'),_0x9bae('0x31')],_0x2d220c[_0x9bae('0x32')])&&_0x2d220c[_0x9bae('0x33')]&&!_0x2d220c[_0x9bae('0x34')]){_0x4f5f1d[_0x2d220c[_0x9bae('0x33')][_0x9bae('0x35')]()]=_0x2d220c[_0x9bae('0x36')]['toString']();}else if(_['includes']([_0x9bae('0x30'),'picklist'],_0x2d220c[_0x9bae('0x32')])&&_0x2d220c[_0x9bae('0x37')]&&_0x2d220c[_0x9bae('0x34')]){_0x4f5f1d[_0x2d220c[_0x9bae('0x37')][_0x9bae('0x35')]()]=_0x2d220c[_0x9bae('0x36')][_0x9bae('0x38')]();}else if(_0x2d220c[_0x9bae('0x32')]===_0x9bae('0x39')&&_0x2d220c['variableName']&&_0x2d220c[_0x9bae('0x37')]&&_0x2d220c[_0x9bae('0x34')]){_0x4f5f1d[_0x2d220c[_0x9bae('0x37')][_0x9bae('0x35')]()]=_0x4c00f9[_0x2d220c[_0x9bae('0x3a')]]['toString']();}else if(_0x2d220c['type']===_0x9bae('0x3b')&&_0x2d220c[_0x9bae('0x3c')]&&_0x2d220c[_0x9bae('0x3c')][_0x9bae('0x3d')]&&_0x2d220c[_0x9bae('0x37')]&&_0x2d220c['customField']){_0x4f5f1d[_0x2d220c['idField']['toLowerCase']()]=_0x4c00f9[_0x2d220c['Variable']['name'][_0x9bae('0x35')]()][_0x9bae('0x38')]();}});}return _0x4f5f1d;}function getTicket(_0x2725d1,_0x2b1e59,_0x1e6b16,_0x1d6db0,_0x29db82,_0x404820){return function(_0x506707){logger[_0x9bae('0x17')]('['+[_0x2725d1[_0x9bae('0x13')]()]+_0x9bae('0x3e'),_0x506707);return new Promise(function(_0x3bb396,_0x259fe2){var _0x5ef121=_0x2725d1[_0x9bae('0x35')]()===_0x9bae('0x3f')?_0x506707[_0x9bae('0x22')]:_0x506707[_0x9bae('0x2b')];var _0x215664={'method':_0x9bae('0x24'),'uri':_0x1e6b16+'incident'+'?'+_0x404820,'body':Object[_0x9bae('0x40')]({},{'active':_0x9bae('0x1f'),'caller_id':_0x5ef121,'assigned_to':_0x506707['userId'],'short_description':intUtil[_0x9bae('0x41')](_0x1d6db0['Subjects'],_0x29db82,'\x20'),'description':intUtil[_0x9bae('0x41')](_0x1d6db0[_0x9bae('0x42')],_0x29db82,'\x0a')},getCustomFields(_0x1d6db0[_0x9bae('0x43')],_0x29db82)),'auth':_0x2b1e59,'json':!![]};return rp(_0x215664)[_0x9bae('0xe')](function(_0xcf2f48){logger[_0x9bae('0x17')]('['+[_0x2725d1[_0x9bae('0x13')]()]+_0x9bae('0x44'),_0xcf2f48[_0x9bae('0xf')]);_0x506707[_0x9bae('0x45')]=_0xcf2f48[_0x9bae('0xf')][_0x9bae('0x12')];_0x506707[_0x9bae('0x46')]=_0xcf2f48[_0x9bae('0xf')][_0x9bae('0x47')];logger[_0x9bae('0x17')]('['+[_0x2725d1[_0x9bae('0x13')]()]+']\x20getTicket\x20crm',_0x506707);_0x3bb396(_0x506707);})['catch'](function(_0x7ea1ae){logger[_0x9bae('0x2d')]('['+[_0x2725d1[_0x9bae('0x13')]()]+']',_0x7ea1ae[_0x9bae('0x16')]);_0x259fe2(_0x7ea1ae['message']);});});};}function createRemoteTag(_0x2bb6c4,_0x302705,_0x263851,_0x39055e){return new Promise(function(_0x2d496a,_0x497939){var _0x287f8e={'method':_0x9bae('0x24'),'uri':_0x263851+_0x9bae('0x48')+'?'+_0x39055e,'body':{'short_description':_0x2bb6c4,'global':!![],'active':!![],'name':_0x2bb6c4},'auth':_0x302705,'json':!![]};return rp(_0x287f8e)[_0x9bae('0xe')](function(_0x225749){var _0x1b24e3=_0x225749[_0x9bae('0xf')]['sys_id'];_0x2d496a(_0x1b24e3);});});}function getRemoteTag(_0x1dd2d0,_0x48a129,_0xbc73b8,_0x350798,_0x5dbdd2){return new Promise(function(_0x2eb5da,_0x38f398){var _0x3a8c1d={'method':'GET','uri':_0xbc73b8+'label'+_0x9bae('0x49')+_0x1dd2d0+'&'+_0x350798,'auth':_0x48a129,'json':!![]};return rp(_0x3a8c1d)['then'](function(_0x2dbf1b){if(_0x2dbf1b[_0x9bae('0xf')]['length']>0x0){var _0x37f5ce=_0x2dbf1b[_0x9bae('0xf')][0x0][_0x9bae('0x12')];_0x2eb5da(_0x37f5ce);}else{return createRemoteTag(_0x1dd2d0,_0x48a129,_0xbc73b8,_0x350798)[_0x9bae('0xe')](function(_0x447230){_0x2eb5da(_0x447230);});}});});}function assignTagToIncident(_0x12250e,_0x294d52,_0x1dfdf1,_0x59cfca,_0x99e04){return new Promise(function(_0x3f4c8b,_0x211f5e){var _0x38f22c={'method':_0x9bae('0x24'),'uri':_0x1dfdf1+_0x9bae('0x4a')+'?'+_0x99e04,'body':{'label':_0x12250e,'table':_0x9bae('0x4b'),'id_type':_0x9bae('0x4c'),'table_key':_0x59cfca['ticketId'],'title':_0x9bae('0x4d')+_0x59cfca['ticketNumber'],'id_display':_0x59cfca['ticketNumber']},'auth':_0x294d52,'json':!![]};return rp(_0x38f22c)['then'](function(_0x51f9ae){_0x3f4c8b();})[_0x9bae('0x15')](function(){_0x3f4c8b();});});}function manageTags(_0x5a3a35,_0x5b0622,_0x10eb08,_0x9d12f2,_0x455b61,_0x445f18,_0x26836f){return new Promise(function(_0x1626ac,_0xaab52b){var _0xf03de5=[];_0x5b0622['forEach'](function(_0x39116b){_0xf03de5[_0x9bae('0x4e')](getRemoteTag(_0x39116b,_0x10eb08,_0x9d12f2,_0x445f18,_0x26836f));});return Promise[_0x9bae('0x4f')](_0xf03de5)['then'](function(_0x7ebb96){if(_0x7ebb96['length']){logger[_0x9bae('0x17')]('['+[_0x5a3a35[_0x9bae('0x13')]()]+_0x9bae('0x50'),_0x7ebb96);var _0x3a64c9=[];_0x7ebb96[_0x9bae('0x2e')](function(_0x5b6f64){_0x3a64c9[_0x9bae('0x4e')](assignTagToIncident(_0x5b6f64,_0x10eb08,_0x9d12f2,_0x455b61,_0x445f18));});return Promise['all'](_0x3a64c9)['then'](function(){_0x1626ac();})[_0x9bae('0x15')](function(){_0x1626ac();});}else{_0x1626ac();}});});}function getTags(_0x441572,_0x271ac7,_0x48ecdd,_0x16000a,_0x259af5,_0x1e2cf2){return function(_0x14cd18){return new Promise(function(_0x2d706a,_0x351587){var _0xe14e5e=[];var _0x16cd8b=_0x16000a['Tags'];if(_0x16cd8b&&_0x16cd8b[_0x9bae('0x10')]>0x0){_0xe14e5e=_[_0x9bae('0x51')](_0x16cd8b,'name');}if(_0xe14e5e[_0x9bae('0x10')]>0x0){return manageTags(_0x441572,_0xe14e5e,_0x271ac7,_0x48ecdd,_0x14cd18,_0x259af5,_0x1e2cf2)[_0x9bae('0xe')](function(){_0x2d706a(_0x14cd18);});}else{_0x2d706a(_0x14cd18);}});};}function emit(_0x377eb0,_0x24bb70,_0x18d9bc){var _0xe9c989=_0x9bae('0x52')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x9bae('0x53');var _0x52cc34={'uri':_0x377eb0+_0x9bae('0x54')+_0x18d9bc+_0xe9c989};io['to'](util[_0x9bae('0x55')]('user:%s',_0x24bb70))[_0x9bae('0x56')](_0x9bae('0x57'),_0x52cc34);}exports['cs']=function(_0x5c6ef2,_0x410e4a,_0x564f3e,_0x315307,_0x174b02,_0x37323b,_0x5ab154,_0x308fb1){var _0x4d565a={};var _0x5b396e={'user':_0x37323b['username'],'pass':_0x37323b[_0x9bae('0x58')]};var _0x23d110=_0x9bae('0x59');var _0x5515d0=_0x9bae('0x5a');_0x37323b[_0x9bae('0x5b')]=intUtil[_0x9bae('0x5c')](_0x37323b[_0x9bae('0x5b')]);_0x37323b[_0x9bae('0x5d')]=intUtil[_0x9bae('0x5c')](_0x37323b[_0x9bae('0x5d')]);var _0x5ad7f2=util['format']('%s/api/now/table/',_0x37323b[_0x9bae('0x5b')]);_0x4d565a['userEmail']=!_[_0x9bae('0x5e')](_0x315307)?_0x315307[_0x9bae('0x5f')]:null;_0x4d565a[_0x9bae('0x20')]=_0x37323b[_0x9bae('0x5f')];_0x4d565a[_0x9bae('0x26')]=_0x308fb1[_0x9bae('0x35')]()===_0x9bae('0x3f')?_0x410e4a[_0x9bae('0x60')]:_0x410e4a[_0x9bae('0x61')];_0x4d565a[_0x9bae('0x62')]=_0x308fb1===_0x9bae('0x63')||_0x308fb1===_0x9bae('0x64')?_0x9bae('0x63'):'outbound';var _0x41103f=util[_0x9bae('0x55')](_0x9bae('0x65'),_0x37323b[_0x9bae('0x5d')],_0x410e4a[_0x9bae('0x66')],md5(_0x410e4a[_0x9bae('0x66')]));if(_0x174b02&&_0x174b02[_0x9bae('0x67')]){logger[_0x9bae('0x17')](_0x9bae('0x68'),_0x9bae('0x69'));_0x410e4a[_0x9bae('0x6a')]=_0x41103f;}else if(_0x5ab154&&_0x5ab154['recordingFormat']&&_0x5ab154[_0x9bae('0x6b')]!=='none'){logger[_0x9bae('0x17')](_0x9bae('0x6c'),_0x9bae('0x69'));_0x410e4a['recordingURL']=_0x41103f;}else{_0x410e4a[_0x9bae('0x6a')]='';}return getAdminUser(_0x308fb1,_0x5b396e,_0x4d565a,_0x5ad7f2,_0x5515d0,_0x23d110)[_0x9bae('0xe')](getUser(_0x308fb1,_0x5b396e,_0x5ad7f2,_0x5515d0,_0x23d110))[_0x9bae('0xe')](getEndUser(_0x308fb1,_0x5b396e,_0x5ad7f2,_0x5515d0,_0x23d110))['then'](getTicket(_0x308fb1,_0x5b396e,_0x5ad7f2,_0x564f3e,_0x410e4a,_0x5515d0))[_0x9bae('0xe')](function(_0x429280){logger[_0x9bae('0x17')](util[_0x9bae('0x55')]('The\x20ticket\x20ID\x20is:\x20%s',_0x429280[_0x9bae('0x45')]));logger[_0x9bae('0x17')](util[_0x9bae('0x55')]('call\x20direction:\x20%s',_0x308fb1));if(_0x308fb1!==_0x9bae('0x64')){logger['info']('['+[_0x308fb1[_0x9bae('0x13')]()]+']',_0x9bae('0x6d'));emit(_0x37323b[_0x9bae('0x5b')],_0x315307['name'],_0x429280[_0x9bae('0x45')]);}})[_0x9bae('0x15')](function(_0x38c7ca){logger[_0x9bae('0x2d')]('['+[_0x308fb1[_0x9bae('0x13')]()]+_0x9bae('0x6e'),util[_0x9bae('0x6f')](_0x38c7ca,{'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 d778d95..366f4df 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 _0xa201=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','unmanaged','toUpperCase','isNil','users','lastevent','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','then','find','entry_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','name_value_list','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Enduser\x20created.','debug','merge','map','forEach','nameField','toLowerCase','content','string','customField','custom_fields','type','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','contacts','charAt'];(function(_0x45cd35,_0x41147c){var _0x16db84=function(_0x1ce5e9){while(--_0x1ce5e9){_0x45cd35['push'](_0x45cd35['shift']());}};_0x16db84(++_0x41147c);}(_0xa201,0x101));var _0x1a20=function(_0x279f8a,_0x532876){_0x279f8a=_0x279f8a-0x0;var _0x46a22f=_0xa201[_0x279f8a];return _0x46a22f;};'use strict';var _=require(_0x1a20('0x0'));var rp=require('request-promise');var BPromise=require(_0x1a20('0x1'));var md5=require(_0x1a20('0x2'));var util=require(_0x1a20('0x3'));var Redis=require(_0x1a20('0x4'));var intUtil=require(_0x1a20('0x5'));var config=require(_0x1a20('0x6'));var logger=require(_0x1a20('0x7'))(_0x1a20('0x8'));config[_0x1a20('0x9')]=_[_0x1a20('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1a20('0xb'))(new Redis(config[_0x1a20('0x9')]));var def={'method':_0x1a20('0xc'),'json':!![]};function emit(_0x1ea35e,_0x1bee79,_0x5a1720){io['to'](_0x1ea35e)[_0x1a20('0xd')](_0x1bee79,_0x5a1720);}function getTicket(_0x27fb6e,_0x11512c,_0xc4b0e8,_0x99655a,_0x5570a1,_0x5df1a3,_0x5d1802,_0x506297){logger[_0x1a20('0xe')](_0x1a20('0xf'));var _0x4d4427=new Date();var _0x63517b=[{'name':_0x1a20('0x10'),'value':intUtil[_0x1a20('0x11')](_0x99655a['Subjects'],_0x5570a1,'\x20')},{'name':_0x1a20('0x12'),'value':_0x11512c['id']},{'name':_0x1a20('0x13'),'value':_0x11512c['id']},{'name':_0x1a20('0x14'),'value':intUtil[_0x1a20('0x11')](_0x99655a[_0x1a20('0x15')],_0x5570a1,'\x0a')},{'name':_0x1a20('0x16'),'value':_0x4d4427['toISOString']()['slice'](0x0,0x13)[_0x1a20('0x17')]('T','\x20')},{'name':_0x1a20('0x18'),'value':'0'},{'name':_0x1a20('0x19'),'value':'15'},{'name':_0x1a20('0x1a'),'value':_0xc4b0e8['id']},{'name':_0x1a20('0x1b'),'value':_0x1a20('0x1c')},{'name':_0x1a20('0x1d'),'value':_0xc4b0e8['name']},{'name':_0x1a20('0x1e'),'value':_0x506297}];if(_0x5df1a3[_0x1a20('0x1f')]){_['forEach'](_0x5df1a3,function(_0x3bdace){if(_0x5570a1[_0x3bdace[_0x1a20('0x20')]]){_0x63517b[_0x1a20('0x21')]({'name':_0x3bdace[_0x1a20('0x22')],'value':_0x5570a1[_0x3bdace['variableName']]});}});}return request({'form':{'method':_0x1a20('0x23'),'input_type':'JSON','response_type':_0x1a20('0x24'),'rest_data':JSON[_0x1a20('0x25')]({'session':_0x5d1802['id'],'module_name':_0x1a20('0x26'),'name_value_list':_0x63517b})}});}function getAuth(_0x1de463){return util[_0x1a20('0x27')]('Basic\x20%s',new Buffer(_0x1de463[_0x1a20('0x28')]+':X')[_0x1a20('0x29')](_0x1a20('0x2a')));}function getServerInfo(_0x3283cb){return request({'form':{'method':_0x1a20('0x2b'),'input_type':_0x1a20('0x24'),'response_type':'JSON','rest_data':JSON[_0x1a20('0x25')]({'session':_0x3283cb['id']})}});}function getUser(_0x52b2f2,_0xa3ddf8,_0x313ea9){if(!_['isNil'](_0xa3ddf8)){logger[_0x1a20('0xe')](_0x1a20('0x2c'),_0xa3ddf8);return request({'form':{'method':_0x1a20('0x2d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1a20('0x25')]({'session':_0x313ea9['id'],'module_name':'Employees','query':util[_0x1a20('0x27')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0xa3ddf8),'order_by':'','offset':'0','select_fields':['id',_0x1a20('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1a20('0x2e')](function(_0x36b82e){if(_0x36b82e['entry_list'][_0x1a20('0x1f')]){var _0x1af5eb=_[_0x1a20('0x2f')](_0x36b82e[_0x1a20('0x30')],function(_0x34d4f2){return _0x34d4f2['name_value_list'][_0x1a20('0x31')][_0x1a20('0x32')]===_0xa3ddf8;});if(_0x1af5eb){logger[_0x1a20('0xe')](_0x1a20('0x33'));return BPromise[_0x1a20('0x34')]({'id':_0x1af5eb['name_value_list']['id'][_0x1a20('0x32')],'name':_0x1af5eb['name_value_list'][_0x1a20('0x10')][_0x1a20('0x32')]});}}logger[_0x1a20('0xe')](_0x1a20('0x35'));return BPromise[_0x1a20('0x34')]({'id':_0x313ea9['name_value_list'][_0x1a20('0x36')][_0x1a20('0x32')],'name':_0x313ea9[_0x1a20('0x37')][_0x1a20('0x31')][_0x1a20('0x32')]});});}else{logger[_0x1a20('0xe')](_0x1a20('0x38'));return BPromise[_0x1a20('0x34')]({'id':_0x313ea9[_0x1a20('0x37')]['user_id'][_0x1a20('0x32')],'name':_0x313ea9[_0x1a20('0x37')]['user_name'][_0x1a20('0x32')]});}}function getEndUser(_0x3bfa1c,_0x1c5fd6,_0x48c482,_0x44ca3e){logger[_0x1a20('0xe')](_0x1a20('0x39'),_0x48c482);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x1a20('0x24'),'rest_data':JSON[_0x1a20('0x25')]({'session':_0x44ca3e['id'],'module_name':'Contacts','query':util[_0x1a20('0x27')](_0x1a20('0x3a'),_0x48c482),'order_by':'','offset':'0','select_fields':['id','name',_0x1a20('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1a20('0x2e')](function(_0x180f0f){if(_0x180f0f[_0x1a20('0x30')][_0x1a20('0x1f')]){var _0x5cd373=_['find'](_0x180f0f['entry_list'],function(_0x5a5ed6){return _0x5a5ed6['name_value_list'][_0x1a20('0x3b')]['value']===_0x48c482;});if(_0x5cd373){logger[_0x1a20('0xe')](_0x1a20('0x3c'));return BPromise[_0x1a20('0x34')]({'id':_0x5cd373[_0x1a20('0x37')]['id']['value'],'name':_0x5cd373[_0x1a20('0x37')][_0x1a20('0x10')][_0x1a20('0x32')],'phone':_0x5cd373[_0x1a20('0x37')][_0x1a20('0x3b')][_0x1a20('0x32')]});}}else{logger[_0x1a20('0xe')](_0x1a20('0x3d'));return request({'form':{'method':_0x1a20('0x23'),'input_type':_0x1a20('0x24'),'response_type':'JSON','rest_data':JSON[_0x1a20('0x25')]({'session':_0x44ca3e['id'],'module_name':_0x1a20('0x1c'),'name_value_list':[{'name':_0x1a20('0x3e'),'value':_0x1c5fd6!==''?_0x1c5fd6:util['format']('Caller\x20-\x20%s',_0x48c482)},{'name':_0x1a20('0x3b'),'value':_0x48c482}]})}})[_0x1a20('0x2e')](function(_0x67a6e7){logger['info'](_0x1a20('0x3f'));return BPromise[_0x1a20('0x34')]({'id':_0x67a6e7['id'],'name':_0x67a6e7[_0x1a20('0x30')][_0x1a20('0x3e')][_0x1a20('0x32')],'phone':_0x67a6e7[_0x1a20('0x30')][_0x1a20('0x3b')]['value']});});}});}function request(_0x27c412){logger[_0x1a20('0x40')]('[HTTP]',JSON[_0x1a20('0x25')](_0x27c412));return rp(_[_0x1a20('0x41')](def,_0x27c412));}function getTags(_0x5034a3,_0x3df943){var _0x1482fb=[];if(_0x5034a3&&_0x5034a3[_0x1a20('0x1f')]>0x0){_0x1482fb=_[_0x1a20('0x42')](_0x5034a3,_0x3df943);}return _0x1482fb;}function getCustomFields(_0x557e50,_0x9b7a79){var _0xad1a99=[];var _0x21440b={'custom_fields':[]};if(_0x557e50[_0x1a20('0x1f')]>0x0){_[_0x1a20('0x43')](_0x557e50,function(_0x5da2f9){if(_0x5da2f9['type']==='string'&&_0x5da2f9[_0x1a20('0x44')]&&!_0x5da2f9['customField']){_0x21440b[_0x5da2f9['nameField'][_0x1a20('0x45')]()]=_0x5da2f9[_0x1a20('0x46')][_0x1a20('0x29')]();}else if(_0x5da2f9['type']===_0x1a20('0x47')&&_0x5da2f9[_0x1a20('0x22')]&&_0x5da2f9[_0x1a20('0x48')]){_0x21440b[_0x1a20('0x49')]['push']({'id':_0x5da2f9[_0x1a20('0x22')],'value':_0x5da2f9[_0x1a20('0x46')]['toString']()});}else if(_0x5da2f9[_0x1a20('0x4a')]===_0x1a20('0x4b')&&_0x5da2f9['variableName']&&_0x5da2f9[_0x1a20('0x22')]&&_0x5da2f9['customField']){_0x9b7a79[_0x5da2f9[_0x1a20('0x20')]]&&_0x21440b[_0x1a20('0x49')][_0x1a20('0x21')]({'id':_0x5da2f9['idField'],'value':_0x9b7a79[_0x5da2f9[_0x1a20('0x20')]][_0x1a20('0x29')]()});}else if(_0x5da2f9[_0x1a20('0x4a')]===_0x1a20('0x4c')&&_0x5da2f9[_0x1a20('0x4d')]&&_0x5da2f9['Variable']['name']&&_0x5da2f9['idField']&&_0x5da2f9['customField']){_0x9b7a79[_0x5da2f9[_0x1a20('0x4d')]['name'][_0x1a20('0x45')]()]&&_0x21440b[_0x1a20('0x49')][_0x1a20('0x21')]({'id':_0x5da2f9['idField'],'value':_0x9b7a79[_0x5da2f9[_0x1a20('0x4d')]['name']['toLowerCase']()][_0x1a20('0x29')]()});}});}return _0x21440b;}function getConnection(_0xc4f5a){return request({'method':_0x1a20('0xc'),'form':{'method':_0x1a20('0x4e'),'input_type':_0x1a20('0x24'),'response_type':_0x1a20('0x24'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xc4f5a[_0x1a20('0x4f')],'password':_0xc4f5a[_0x1a20('0x50')],'encryption':_0x1a20('0x51')},'application':_0x1a20('0x52')})}})[_0x1a20('0x2e')](function(_0x4ab381){var _0x5dca82=_0x4ab381;if(_0x5dca82['id']){def[_0x1a20('0x53')]=_0x5dca82['id'];return BPromise[_0x1a20('0x34')](_0x5dca82);}else{throw new Error(util[_0x1a20('0x27')](_0x1a20('0x54'),_0xc4f5a['id']));}});}function setRelationship(_0x167626,_0xbcfa28,_0x389aa1,_0x5abfb4){return request({'form':{'method':_0x1a20('0x55'),'input_type':_0x1a20('0x24'),'response_type':_0x1a20('0x24'),'rest_data':JSON['stringify']({'session':_0x167626['id'],'module_name':_0x1a20('0x26'),'module_id':_0x389aa1['id'],'link_field_name':_0x5abfb4,'related_ids':[_0xbcfa28['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x4e0f4e,_0xc786b0,_0x1d7d76,_0x1ce1e1,_0x327a5e,_0x3b3bfa){var _0x40255f,_0x1796d1,_0x255b0a,_0x2df503;_0x3b3bfa[_0x1a20('0x56')]=intUtil['stripTrailingSlash'](_0x3b3bfa[_0x1a20('0x56')]);_0x3b3bfa[_0x1a20('0x57')]=intUtil[_0x1a20('0x58')](_0x3b3bfa[_0x1a20('0x57')]);def[_0x1a20('0x59')]=util[_0x1a20('0x27')](_0x1a20('0x5a'),_0x3b3bfa[_0x1a20('0x56')]);if(_0x327a5e&&_0x327a5e[_0x1a20('0x5b')]){logger['info'](_0x1a20('0x5c'),_0x1a20('0x5d'));_0xc786b0[_0x1a20('0x5e')]=util[_0x1a20('0x27')](_0x1a20('0x5f'),_0x3b3bfa[_0x1a20('0x57')],_0xc786b0['uniqueid'],md5(_0xc786b0[_0x1a20('0x60')]));}else{_0xc786b0[_0x1a20('0x5e')]='';}return getConnection(_0x3b3bfa)[_0x1a20('0x2e')](function(_0x394e82){_0x2df503=_0x394e82;return getUser(_0x3b3bfa,_0x1ce1e1[_0x1a20('0x10')],_0x2df503);})[_0x1a20('0x2e')](function(_0x34594d){_0x40255f=_0x34594d;logger[_0x1a20('0xe')]('The\x20User\x20ID\x20is:',_0x40255f['id']);return getEndUser(_0x3b3bfa,_0xc786b0[_0x1a20('0x61')],_0xc786b0[_0x1a20('0x62')],_0x2df503);})[_0x1a20('0x2e')](function(_0x2d8146){_0x1796d1=_0x2d8146;logger[_0x1a20('0xe')](_0x1a20('0x63'),_0x1796d1['id']);return getTicket(_0x3b3bfa,_0x40255f,_0x1796d1,_0x1d7d76,_0xc786b0,_0x1d7d76[_0x1a20('0x64')],_0x2df503,_0x1a20('0x65'));})[_0x1a20('0x2e')](function(_0x1d9303){_0x255b0a=_0x1d9303;logger[_0x1a20('0xe')](_0x1a20('0x66'));logger[_0x1a20('0xe')](_0x1a20('0x67'),_0x255b0a['id']);return setRelationship(_0x2df503,_0x40255f,_0x255b0a,'users');})[_0x1a20('0x2e')](function(){return setRelationship(_0x2df503,_0x1796d1,_0x255b0a,'contacts');})[_0x1a20('0x2e')](function(){return getServerInfo(_0x2df503);})[_0x1a20('0x2e')](function(_0x15458e){var _0xf46c40=parseInt(_0x15458e[_0x1a20('0x68')]['charAt'](0x0));var _0x40c5ab=util[_0x1a20('0x27')](_0x1a20('0x69'),_0x3b3bfa[_0x1a20('0x56')],_0x255b0a['id']);if(_0xf46c40>0x6){_0x40c5ab=util[_0x1a20('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3b3bfa[_0x1a20('0x56')],_0x255b0a['id']);}logger[_0x1a20('0xe')](_0x1a20('0x5c'),_0x1a20('0x6a'));emit(util[_0x1a20('0x27')](_0x1a20('0x6b'),_0x1ce1e1['name']),_0x1a20('0x6c'),{'uri':_0x40c5ab});})[_0x1a20('0x6d')](function(_0xb8dee){logger[_0x1a20('0x6e')]('[QUEUE]',JSON[_0x1a20('0x25')](_0xb8dee));});};exports['outbound']=function(_0x58fbd3,_0x252e0c,_0x50fdd0,_0x3ec10b,_0x32309b,_0x4c0908,_0x4ebad0){var _0x56c966,_0x1faad5,_0x1254fa,_0x26379a;_0x4c0908[_0x1a20('0x56')]=intUtil[_0x1a20('0x58')](_0x4c0908[_0x1a20('0x56')]);_0x4c0908[_0x1a20('0x57')]=intUtil[_0x1a20('0x58')](_0x4c0908[_0x1a20('0x57')]);def[_0x1a20('0x59')]=util[_0x1a20('0x27')](_0x1a20('0x5a'),_0x4c0908[_0x1a20('0x56')]);if(_0x4ebad0&&_0x4ebad0[_0x1a20('0x6f')]&&_0x4ebad0['recordingFormat']!==_0x1a20('0x70')){logger[_0x1a20('0xe')]('[OUTBOUND]',_0x1a20('0x5d'));_0x252e0c[_0x1a20('0x5e')]=util[_0x1a20('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c0908[_0x1a20('0x57')],_0x252e0c[_0x1a20('0x60')],md5(_0x252e0c[_0x1a20('0x60')]));}return getConnection(_0x4c0908)[_0x1a20('0x2e')](function(_0x515581){_0x26379a=_0x515581;return getUser(_0x4c0908,_0x3ec10b[_0x1a20('0x10')],_0x26379a);})[_0x1a20('0x2e')](function(_0x2697c6){_0x56c966=_0x2697c6;logger[_0x1a20('0xe')](_0x1a20('0x71'),_0x56c966['id']);return getEndUser(_0x4c0908,_0x252e0c['destcalleridname'],_0x252e0c[_0x1a20('0x72')],_0x26379a);})[_0x1a20('0x2e')](function(_0x91bba0){_0x1faad5=_0x91bba0;logger[_0x1a20('0xe')](_0x1a20('0x63'),_0x1faad5['id']);return getTicket(_0x4c0908,_0x56c966,_0x1faad5,_0x50fdd0,_0x252e0c,_0x50fdd0['Fields'],_0x26379a,_0x1a20('0x73'));})[_0x1a20('0x2e')](function(_0x3c79f0){_0x1254fa=_0x3c79f0;logger[_0x1a20('0xe')](_0x1a20('0x66'));logger['info'](_0x1a20('0x67'),_0x1254fa['id']);return setRelationship(_0x26379a,_0x56c966,_0x1254fa,'users');})[_0x1a20('0x2e')](function(){return setRelationship(_0x26379a,_0x1faad5,_0x1254fa,_0x1a20('0x74'));})[_0x1a20('0x2e')](function(){return getServerInfo(_0x26379a);})[_0x1a20('0x2e')](function(_0x3650d3){var _0x500de0=parseInt(_0x3650d3[_0x1a20('0x68')][_0x1a20('0x75')](0x0));var _0x49e27a=util[_0x1a20('0x27')](_0x1a20('0x69'),_0x4c0908[_0x1a20('0x56')],_0x1254fa['id']);if(_0x500de0>0x6){_0x49e27a=util[_0x1a20('0x27')](_0x1a20('0x76'),_0x4c0908[_0x1a20('0x56')],_0x1254fa['id']);}logger['info'](_0x1a20('0x77'),_0x1a20('0x6a'));emit(util[_0x1a20('0x27')](_0x1a20('0x6b'),_0x3ec10b['name']),_0x1a20('0x6c'),{'uri':_0x49e27a});})[_0x1a20('0x6d')](function(_0x5691df){logger['error'](_0x1a20('0x77'),JSON[_0x1a20('0x25')](_0x5691df));});};exports[_0x1a20('0x78')]=function(_0x303325,_0x34bf78,_0x14c2ef,_0xf97213,_0x4cb110,_0x23f17b){var _0x36199b,_0x52f2b1,_0xca6016,_0x5a0217;_0x23f17b[_0x1a20('0x56')]=intUtil[_0x1a20('0x58')](_0x23f17b[_0x1a20('0x56')]);_0x23f17b[_0x1a20('0x57')]=intUtil[_0x1a20('0x58')](_0x23f17b['serverUrl']);def[_0x1a20('0x59')]=util[_0x1a20('0x27')]('%s/service/v4_1/rest.php',_0x23f17b[_0x1a20('0x56')]);if(_0x4cb110&&_0x4cb110[_0x1a20('0x5b')]){logger[_0x1a20('0xe')]('['+_0x34bf78['lastevent'][_0x1a20('0x79')]()+']',_0x1a20('0x5d'));_0x34bf78[_0x1a20('0x5e')]=util[_0x1a20('0x27')](_0x1a20('0x5f'),_0x23f17b[_0x1a20('0x57')],_0x34bf78[_0x1a20('0x60')],md5(_0x34bf78['uniqueid']));}else{_0x34bf78[_0x1a20('0x5e')]='';}return getConnection(_0x23f17b)[_0x1a20('0x2e')](function(_0x22c7f1){_0x5a0217=_0x22c7f1;if(!_[_0x1a20('0x7a')](_0xf97213)){return getUser(_0x23f17b,_0xf97213[_0x1a20('0x10')],_0x5a0217);}else{return getUser(_0x23f17b,null,_0x5a0217);}})['then'](function(_0x2e763c){_0x36199b=_0x2e763c;logger[_0x1a20('0xe')](_0x1a20('0x71'),_0x36199b['id']);return getEndUser(_0x23f17b,_0x34bf78['calleridname'],_0x34bf78[_0x1a20('0x62')],_0x5a0217);})[_0x1a20('0x2e')](function(_0x593ee3){_0x52f2b1=_0x593ee3;logger[_0x1a20('0xe')]('The\x20Enduser\x20ID\x20is:',_0x52f2b1['id']);return getTicket(_0x23f17b,_0x36199b,_0x52f2b1,_0x14c2ef,_0x34bf78,_0x14c2ef[_0x1a20('0x64')],_0x5a0217,_0x1a20('0x65'));})[_0x1a20('0x2e')](function(_0x1c80e2){_0xca6016=_0x1c80e2;logger['info'](_0x1a20('0x66'));logger['info'](_0x1a20('0x67'),_0xca6016['id']);return setRelationship(_0x5a0217,_0x36199b,_0xca6016,_0x1a20('0x7b'));})['then'](function(){return setRelationship(_0x5a0217,_0x52f2b1,_0xca6016,_0x1a20('0x74'));})[_0x1a20('0x2e')](function(){return getServerInfo(_0x5a0217);})[_0x1a20('0x6d')](function(_0x573168){logger[_0x1a20('0x6e')]('['+_0x34bf78[_0x1a20('0x7c')][_0x1a20('0x79')]()+']',JSON[_0x1a20('0x25')](_0x573168));});}; \ No newline at end of file +var _0xa07a=['[OUTBOUND]','destcalleridname','version','catch','lastevent','toUpperCase','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','info','name','getString','Subjects','assigned_user_id','description','Descriptions','toISOString','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','login','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xa07a,0x16e));var _0xaa07=function(_0x4f4c67,_0x59332b){_0x4f4c67=_0x4f4c67-0x0;var _0x386698=_0xa07a[_0x4f4c67];return _0x386698;};'use strict';var _=require('lodash');var rp=require(_0xaa07('0x0'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xaa07('0x1'));var Redis=require(_0xaa07('0x2'));var intUtil=require(_0xaa07('0x3'));var config=require(_0xaa07('0x4'));var logger=require(_0xaa07('0x5'))(_0xaa07('0x6'));config[_0xaa07('0x7')]=_['defaults'](config[_0xaa07('0x7')],{'host':_0xaa07('0x8'),'port':0x18eb});var io=require(_0xaa07('0x9'))(new Redis(config[_0xaa07('0x7')]));var def={'method':_0xaa07('0xa'),'json':!![]};function emit(_0x26223e,_0x47dbb7,_0x27e93b){io['to'](_0x26223e)['emit'](_0x47dbb7,_0x27e93b);}function getTicket(_0x2a7510,_0xd8b7a0,_0x3d83e5,_0x5118e4,_0x4839a4,_0x1d7c57,_0x572b68,_0x15acc2){logger[_0xaa07('0xb')]('Creating\x20new\x20ticket...');var _0x85fea1=new Date();var _0x48074c=[{'name':_0xaa07('0xc'),'value':intUtil[_0xaa07('0xd')](_0x5118e4[_0xaa07('0xe')],_0x4839a4,'\x20')},{'name':_0xaa07('0xf'),'value':_0xd8b7a0['id']},{'name':'created_by','value':_0xd8b7a0['id']},{'name':_0xaa07('0x10'),'value':intUtil[_0xaa07('0xd')](_0x5118e4[_0xaa07('0x11')],_0x4839a4,'\x0a')},{'name':'date_start','value':_0x85fea1[_0xaa07('0x12')]()[_0xaa07('0x13')](0x0,0x13)[_0xaa07('0x14')]('T','\x20')},{'name':_0xaa07('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xaa07('0x16'),'value':_0x3d83e5['id']},{'name':_0xaa07('0x17'),'value':_0xaa07('0x18')},{'name':_0xaa07('0x19'),'value':_0x3d83e5[_0xaa07('0xc')]},{'name':_0xaa07('0x1a'),'value':_0x15acc2}];if(_0x1d7c57[_0xaa07('0x1b')]){_[_0xaa07('0x1c')](_0x1d7c57,function(_0x3b93db){if(_0x4839a4[_0x3b93db[_0xaa07('0x1d')]]){_0x48074c[_0xaa07('0x1e')]({'name':_0x3b93db[_0xaa07('0x1f')],'value':_0x4839a4[_0x3b93db[_0xaa07('0x1d')]]});}});}return request({'form':{'method':_0xaa07('0x20'),'input_type':'JSON','response_type':_0xaa07('0x21'),'rest_data':JSON[_0xaa07('0x22')]({'session':_0x572b68['id'],'module_name':_0xaa07('0x23'),'name_value_list':_0x48074c})}});}function getAuth(_0x4d9a07){return util[_0xaa07('0x24')](_0xaa07('0x25'),new Buffer(_0x4d9a07[_0xaa07('0x26')]+':X')[_0xaa07('0x27')](_0xaa07('0x28')));}function getServerInfo(_0x29e868){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x29e868['id']})}});}function getUser(_0x4d4a26,_0x1910ce,_0x5ccf2f){if(!_[_0xaa07('0x29')](_0x1910ce)){logger[_0xaa07('0xb')](_0xaa07('0x2a'),_0x1910ce);return request({'form':{'method':_0xaa07('0x2b'),'input_type':_0xaa07('0x21'),'response_type':_0xaa07('0x21'),'rest_data':JSON[_0xaa07('0x22')]({'session':_0x5ccf2f['id'],'module_name':_0xaa07('0x2c'),'query':util['format'](_0xaa07('0x2d'),_0x1910ce),'order_by':'','offset':'0','select_fields':['id','name',_0xaa07('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xaa07('0x2f')](function(_0x13a138){if(_0x13a138[_0xaa07('0x30')][_0xaa07('0x1b')]){var _0xfc0e3f=_[_0xaa07('0x31')](_0x13a138[_0xaa07('0x30')],function(_0x3a2903){return _0x3a2903[_0xaa07('0x32')][_0xaa07('0x2e')][_0xaa07('0x33')]===_0x1910ce;});if(_0xfc0e3f){logger[_0xaa07('0xb')](_0xaa07('0x34'));return BPromise[_0xaa07('0x35')]({'id':_0xfc0e3f[_0xaa07('0x32')]['id'][_0xaa07('0x33')],'name':_0xfc0e3f[_0xaa07('0x32')][_0xaa07('0xc')][_0xaa07('0x33')]});}}logger[_0xaa07('0xb')](_0xaa07('0x36'));return BPromise['resolve']({'id':_0x5ccf2f[_0xaa07('0x32')][_0xaa07('0x37')][_0xaa07('0x33')],'name':_0x5ccf2f['name_value_list'][_0xaa07('0x2e')]['value']});});}else{logger[_0xaa07('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x5ccf2f[_0xaa07('0x32')][_0xaa07('0x37')]['value'],'name':_0x5ccf2f[_0xaa07('0x32')][_0xaa07('0x2e')]['value']});}}function getEndUser(_0x10ee84,_0x23d993,_0xb3bdc9,_0x13bcca){logger[_0xaa07('0xb')](_0xaa07('0x38'),_0xb3bdc9);return request({'form':{'method':'get_entry_list','input_type':_0xaa07('0x21'),'response_type':'JSON','rest_data':JSON[_0xaa07('0x22')]({'session':_0x13bcca['id'],'module_name':_0xaa07('0x18'),'query':util[_0xaa07('0x24')](_0xaa07('0x39'),_0xb3bdc9),'order_by':'','offset':'0','select_fields':['id',_0xaa07('0xc'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4a8279){if(_0x4a8279[_0xaa07('0x30')][_0xaa07('0x1b')]){var _0x1defc1=_[_0xaa07('0x31')](_0x4a8279[_0xaa07('0x30')],function(_0x3786b4){return _0x3786b4[_0xaa07('0x32')][_0xaa07('0x3a')][_0xaa07('0x33')]===_0xb3bdc9;});if(_0x1defc1){logger[_0xaa07('0xb')](_0xaa07('0x3b'));return BPromise['resolve']({'id':_0x1defc1['name_value_list']['id'][_0xaa07('0x33')],'name':_0x1defc1[_0xaa07('0x32')][_0xaa07('0xc')][_0xaa07('0x33')],'phone':_0x1defc1['name_value_list']['phone_home'][_0xaa07('0x33')]});}}else{logger[_0xaa07('0xb')](_0xaa07('0x3c'));return request({'form':{'method':_0xaa07('0x20'),'input_type':_0xaa07('0x21'),'response_type':_0xaa07('0x21'),'rest_data':JSON[_0xaa07('0x22')]({'session':_0x13bcca['id'],'module_name':_0xaa07('0x18'),'name_value_list':[{'name':'first_name','value':_0x23d993!==_0xaa07('0x3d')?_0x23d993:util[_0xaa07('0x24')](_0xaa07('0x3e'),_0xb3bdc9)},{'name':'phone_home','value':_0xb3bdc9}]})}})[_0xaa07('0x2f')](function(_0x4668d3){logger[_0xaa07('0xb')](_0xaa07('0x3f'));return BPromise[_0xaa07('0x35')]({'id':_0x4668d3['id'],'name':_0x4668d3[_0xaa07('0x30')]['first_name'][_0xaa07('0x33')],'phone':_0x4668d3[_0xaa07('0x30')]['phone_home']['value']});});}});}function request(_0x4d5b21){logger['debug'](_0xaa07('0x40'),JSON[_0xaa07('0x22')](_0x4d5b21));return rp(_[_0xaa07('0x41')](def,_0x4d5b21));}function getTags(_0x56b096,_0x47c48e){var _0x48d388=[];if(_0x56b096&&_0x56b096[_0xaa07('0x1b')]>0x0){_0x48d388=_['map'](_0x56b096,_0x47c48e);}return _0x48d388;}function getCustomFields(_0x4e9ac7,_0x141b46){var _0x24f0f7=[];var _0x4dd582={'custom_fields':[]};if(_0x4e9ac7['length']>0x0){_[_0xaa07('0x1c')](_0x4e9ac7,function(_0x4a7c53){if(_0x4a7c53[_0xaa07('0x42')]===_0xaa07('0x43')&&_0x4a7c53[_0xaa07('0x44')]&&!_0x4a7c53[_0xaa07('0x45')]){_0x4dd582[_0x4a7c53['nameField'][_0xaa07('0x46')]()]=_0x4a7c53[_0xaa07('0x47')][_0xaa07('0x27')]();}else if(_0x4a7c53['type']===_0xaa07('0x43')&&_0x4a7c53[_0xaa07('0x1f')]&&_0x4a7c53[_0xaa07('0x45')]){_0x4dd582[_0xaa07('0x48')][_0xaa07('0x1e')]({'id':_0x4a7c53[_0xaa07('0x1f')],'value':_0x4a7c53[_0xaa07('0x47')][_0xaa07('0x27')]()});}else if(_0x4a7c53[_0xaa07('0x42')]===_0xaa07('0x49')&&_0x4a7c53[_0xaa07('0x1d')]&&_0x4a7c53[_0xaa07('0x1f')]&&_0x4a7c53['customField']){_0x141b46[_0x4a7c53[_0xaa07('0x1d')]]&&_0x4dd582[_0xaa07('0x48')][_0xaa07('0x1e')]({'id':_0x4a7c53[_0xaa07('0x1f')],'value':_0x141b46[_0x4a7c53[_0xaa07('0x1d')]][_0xaa07('0x27')]()});}else if(_0x4a7c53[_0xaa07('0x42')]===_0xaa07('0x4a')&&_0x4a7c53[_0xaa07('0x4b')]&&_0x4a7c53[_0xaa07('0x4b')]['name']&&_0x4a7c53[_0xaa07('0x1f')]&&_0x4a7c53['customField']){_0x141b46[_0x4a7c53[_0xaa07('0x4b')][_0xaa07('0xc')][_0xaa07('0x46')]()]&&_0x4dd582['custom_fields'][_0xaa07('0x1e')]({'id':_0x4a7c53[_0xaa07('0x1f')],'value':_0x141b46[_0x4a7c53['Variable'][_0xaa07('0xc')]['toLowerCase']()][_0xaa07('0x27')]()});}});}return _0x4dd582;}function getConnection(_0x590135){return request({'method':_0xaa07('0xa'),'form':{'method':_0xaa07('0x4c'),'input_type':_0xaa07('0x21'),'response_type':_0xaa07('0x21'),'rest_data':JSON[_0xaa07('0x22')]({'user_auth':{'user_name':_0x590135['username'],'password':_0x590135['password'],'encryption':_0xaa07('0x4d')},'application':_0xaa07('0x4e')})}})[_0xaa07('0x2f')](function(_0x4778b6){var _0x4bf51d=_0x4778b6;if(_0x4bf51d['id']){def[_0xaa07('0x4f')]=_0x4bf51d['id'];return BPromise[_0xaa07('0x35')](_0x4bf51d);}else{throw new Error(util['format'](_0xaa07('0x50'),_0x590135['id']));}});}function setRelationship(_0x37ad04,_0x3e48b4,_0x287adc,_0x3ed4cc){return request({'form':{'method':_0xaa07('0x51'),'input_type':_0xaa07('0x21'),'response_type':_0xaa07('0x21'),'rest_data':JSON[_0xaa07('0x22')]({'session':_0x37ad04['id'],'module_name':_0xaa07('0x23'),'module_id':_0x287adc['id'],'link_field_name':_0x3ed4cc,'related_ids':[_0x3e48b4['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xaa07('0x52')]=function(_0x217653,_0x107a80,_0x550dfd,_0x7be440,_0xc322b,_0x584bd2){var _0x324e5b,_0x226ee3,_0x39a8c5,_0x1b4a73;_0x584bd2[_0xaa07('0x53')]=intUtil[_0xaa07('0x54')](_0x584bd2[_0xaa07('0x53')]);_0x584bd2[_0xaa07('0x55')]=intUtil[_0xaa07('0x54')](_0x584bd2[_0xaa07('0x55')]);def[_0xaa07('0x56')]=util['format'](_0xaa07('0x57'),_0x584bd2[_0xaa07('0x53')]);if(_0xc322b&&_0xc322b[_0xaa07('0x58')]){logger[_0xaa07('0xb')]('[QUEUE]',_0xaa07('0x59'));_0x107a80['recordingURL']=util[_0xaa07('0x24')](_0xaa07('0x5a'),_0x584bd2[_0xaa07('0x55')],_0x107a80[_0xaa07('0x5b')],md5(_0x107a80['uniqueid']));}else{_0x107a80[_0xaa07('0x5c')]='';}return getConnection(_0x584bd2)[_0xaa07('0x2f')](function(_0x107c67){_0x1b4a73=_0x107c67;return getUser(_0x584bd2,_0x7be440[_0xaa07('0xc')],_0x1b4a73);})[_0xaa07('0x2f')](function(_0x20ccb8){_0x324e5b=_0x20ccb8;logger[_0xaa07('0xb')](_0xaa07('0x5d'),_0x324e5b['id']);return getEndUser(_0x584bd2,_0x107a80[_0xaa07('0x5e')],_0x107a80[_0xaa07('0x5f')],_0x1b4a73);})[_0xaa07('0x2f')](function(_0x1454e1){_0x226ee3=_0x1454e1;logger[_0xaa07('0xb')](_0xaa07('0x60'),_0x226ee3['id']);return getTicket(_0x584bd2,_0x324e5b,_0x226ee3,_0x550dfd,_0x107a80,_0x550dfd[_0xaa07('0x61')],_0x1b4a73,_0xaa07('0x62'));})['then'](function(_0x4c641f){_0x39a8c5=_0x4c641f;logger['info'](_0xaa07('0x63'));logger['info'](_0xaa07('0x64'),_0x39a8c5['id']);return setRelationship(_0x1b4a73,_0x324e5b,_0x39a8c5,_0xaa07('0x65'));})[_0xaa07('0x2f')](function(){return setRelationship(_0x1b4a73,_0x226ee3,_0x39a8c5,_0xaa07('0x66'));})[_0xaa07('0x2f')](function(){return getServerInfo(_0x1b4a73);})[_0xaa07('0x2f')](function(_0x1b9c3f){var _0x57c0bf=parseInt(_0x1b9c3f['version'][_0xaa07('0x67')](0x0));var _0x573c8c=util['format'](_0xaa07('0x68'),_0x584bd2[_0xaa07('0x53')],_0x39a8c5['id']);if(_0x57c0bf>0x6){_0x573c8c=util[_0xaa07('0x24')](_0xaa07('0x69'),_0x584bd2[_0xaa07('0x53')],_0x39a8c5['id']);}logger['info'](_0xaa07('0x6a'),_0xaa07('0x6b'));emit(util[_0xaa07('0x24')](_0xaa07('0x6c'),_0x7be440[_0xaa07('0xc')]),_0xaa07('0x6d'),{'uri':_0x573c8c});})['catch'](function(_0x3c92e1){logger[_0xaa07('0x6e')](_0xaa07('0x6a'),JSON[_0xaa07('0x22')](_0x3c92e1));});};exports[_0xaa07('0x6f')]=function(_0x53e298,_0x4ad6b0,_0x4f6c9c,_0x53ed02,_0x24e556,_0x16ae48,_0x183e2e){var _0x4cee68,_0x4ff6be,_0x5183e7,_0x453f80;_0x16ae48[_0xaa07('0x53')]=intUtil[_0xaa07('0x54')](_0x16ae48['remoteUri']);_0x16ae48[_0xaa07('0x55')]=intUtil[_0xaa07('0x54')](_0x16ae48['serverUrl']);def[_0xaa07('0x56')]=util[_0xaa07('0x24')](_0xaa07('0x57'),_0x16ae48[_0xaa07('0x53')]);if(_0x183e2e&&_0x183e2e[_0xaa07('0x70')]&&_0x183e2e['recordingFormat']!==_0xaa07('0x71')){logger[_0xaa07('0xb')](_0xaa07('0x72'),_0xaa07('0x59'));_0x4ad6b0[_0xaa07('0x5c')]=util[_0xaa07('0x24')](_0xaa07('0x5a'),_0x16ae48[_0xaa07('0x55')],_0x4ad6b0[_0xaa07('0x5b')],md5(_0x4ad6b0[_0xaa07('0x5b')]));}return getConnection(_0x16ae48)[_0xaa07('0x2f')](function(_0x25c92f){_0x453f80=_0x25c92f;return getUser(_0x16ae48,_0x53ed02[_0xaa07('0xc')],_0x453f80);})[_0xaa07('0x2f')](function(_0x230ee8){_0x4cee68=_0x230ee8;logger[_0xaa07('0xb')](_0xaa07('0x5d'),_0x4cee68['id']);return getEndUser(_0x16ae48,_0x4ad6b0[_0xaa07('0x73')],_0x4ad6b0['destcalleridnum'],_0x453f80);})[_0xaa07('0x2f')](function(_0x2f02e8){_0x4ff6be=_0x2f02e8;logger[_0xaa07('0xb')]('The\x20Enduser\x20ID\x20is:',_0x4ff6be['id']);return getTicket(_0x16ae48,_0x4cee68,_0x4ff6be,_0x4f6c9c,_0x4ad6b0,_0x4f6c9c[_0xaa07('0x61')],_0x453f80,'Outbound');})[_0xaa07('0x2f')](function(_0xbb856b){_0x5183e7=_0xbb856b;logger[_0xaa07('0xb')](_0xaa07('0x63'));logger[_0xaa07('0xb')](_0xaa07('0x64'),_0x5183e7['id']);return setRelationship(_0x453f80,_0x4cee68,_0x5183e7,'users');})[_0xaa07('0x2f')](function(){return setRelationship(_0x453f80,_0x4ff6be,_0x5183e7,_0xaa07('0x66'));})[_0xaa07('0x2f')](function(){return getServerInfo(_0x453f80);})[_0xaa07('0x2f')](function(_0x16d008){var _0x3fc5c3=parseInt(_0x16d008[_0xaa07('0x74')][_0xaa07('0x67')](0x0));var _0x1c89d4=util[_0xaa07('0x24')](_0xaa07('0x68'),_0x16ae48['remoteUri'],_0x5183e7['id']);if(_0x3fc5c3>0x6){_0x1c89d4=util[_0xaa07('0x24')](_0xaa07('0x69'),_0x16ae48[_0xaa07('0x53')],_0x5183e7['id']);}logger[_0xaa07('0xb')](_0xaa07('0x72'),_0xaa07('0x6b'));emit(util[_0xaa07('0x24')](_0xaa07('0x6c'),_0x53ed02[_0xaa07('0xc')]),_0xaa07('0x6d'),{'uri':_0x1c89d4});})[_0xaa07('0x75')](function(_0x482f57){logger['error'](_0xaa07('0x72'),JSON[_0xaa07('0x22')](_0x482f57));});};exports['unmanaged']=function(_0x49b66e,_0x1d1589,_0x2cb9de,_0x1995cb,_0x1253a4,_0x42f20a){var _0xec423c,_0x37c4c0,_0x131dcd,_0x21c740;_0x42f20a[_0xaa07('0x53')]=intUtil[_0xaa07('0x54')](_0x42f20a[_0xaa07('0x53')]);_0x42f20a[_0xaa07('0x55')]=intUtil[_0xaa07('0x54')](_0x42f20a[_0xaa07('0x55')]);def[_0xaa07('0x56')]=util['format']('%s/service/v4_1/rest.php',_0x42f20a['remoteUri']);if(_0x1253a4&&_0x1253a4['monitor_format']){logger[_0xaa07('0xb')]('['+_0x1d1589[_0xaa07('0x76')][_0xaa07('0x77')]()+']',_0xaa07('0x59'));_0x1d1589['recordingURL']=util[_0xaa07('0x24')](_0xaa07('0x5a'),_0x42f20a['serverUrl'],_0x1d1589[_0xaa07('0x5b')],md5(_0x1d1589['uniqueid']));}else{_0x1d1589[_0xaa07('0x5c')]='';}return getConnection(_0x42f20a)[_0xaa07('0x2f')](function(_0x1e32a0){_0x21c740=_0x1e32a0;if(!_[_0xaa07('0x29')](_0x1995cb)){return getUser(_0x42f20a,_0x1995cb[_0xaa07('0xc')],_0x21c740);}else{return getUser(_0x42f20a,null,_0x21c740);}})[_0xaa07('0x2f')](function(_0x16e769){_0xec423c=_0x16e769;logger[_0xaa07('0xb')]('The\x20User\x20ID\x20is:',_0xec423c['id']);return getEndUser(_0x42f20a,_0x1d1589[_0xaa07('0x5e')],_0x1d1589[_0xaa07('0x5f')],_0x21c740);})['then'](function(_0x5db338){_0x37c4c0=_0x5db338;logger[_0xaa07('0xb')](_0xaa07('0x60'),_0x37c4c0['id']);return getTicket(_0x42f20a,_0xec423c,_0x37c4c0,_0x2cb9de,_0x1d1589,_0x2cb9de['Fields'],_0x21c740,_0xaa07('0x62'));})[_0xaa07('0x2f')](function(_0x4f97a3){_0x131dcd=_0x4f97a3;logger[_0xaa07('0xb')](_0xaa07('0x63'));logger[_0xaa07('0xb')](_0xaa07('0x64'),_0x131dcd['id']);return setRelationship(_0x21c740,_0xec423c,_0x131dcd,'users');})[_0xaa07('0x2f')](function(){return setRelationship(_0x21c740,_0x37c4c0,_0x131dcd,_0xaa07('0x66'));})[_0xaa07('0x2f')](function(){return getServerInfo(_0x21c740);})['catch'](function(_0xd729d){logger[_0xaa07('0x6e')]('['+_0x1d1589[_0xaa07('0x76')][_0xaa07('0x77')]()+']',JSON['stringify'](_0xd729d));});}; \ 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 4211064..e223ed2 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 _0x63e9=['keyContent','key','format','join','slice','substring','lastIndexOf','test','lodash','util','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','%s:\x20%s'];(function(_0x22c00d,_0x12daf9){var _0x8730d=function(_0x3cf92b){while(--_0x3cf92b){_0x22c00d['push'](_0x22c00d['shift']());}};_0x8730d(++_0x12daf9);}(_0x63e9,0x8a));var _0x963e=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x63e9[_0x263b0e];return _0x113fee;};'use strict';var _=require(_0x963e('0x0'));var util=require(_0x963e('0x1'));exports['getString']=function(_0x2aa26f,_0x4d2993,_0x16a7fc){var _0x5edc1e=[];if(_0x2aa26f[_0x963e('0x2')]>0x0){var _0x9f3db1=_[_0x963e('0x3')](_0x2aa26f,['id']);for(var _0xbfa059=0x0;_0xbfa059<_0x9f3db1[_0x963e('0x2')];_0xbfa059++){var _0x491927=_0x9f3db1[_0xbfa059];if(_0x491927[_0x963e('0x4')]===_0x963e('0x5')){_0x5edc1e[_0x963e('0x6')](_0x491927[_0x963e('0x7')]);}else if(_0x491927[_0x963e('0x4')]===_0x963e('0x8')&&_0x491927[_0x963e('0x9')]){_0x4d2993[_0x491927[_0x963e('0x9')]]&&_0x5edc1e[_0x963e('0x6')](_0x4d2993[_0x491927[_0x963e('0x9')]][_0x963e('0xa')]());}else if(_0x491927[_0x963e('0x4')]===_0x963e('0xb')&&_0x491927[_0x963e('0xc')]&&_0x491927[_0x963e('0xc')][_0x963e('0xd')]){_0x4d2993[_0x491927[_0x963e('0xc')][_0x963e('0xd')][_0x963e('0xe')]()]&&_0x5edc1e['push'](_0x4d2993[_0x491927[_0x963e('0xc')][_0x963e('0xd')][_0x963e('0xe')]()]['toString']());}else if(_0x491927['type']===_0x963e('0xf')){if(_0x491927[_0x963e('0x10')]===_0x963e('0x5')&&_0x491927['key']){_0x5edc1e[_0x963e('0x6')](util['format'](_0x963e('0x11'),_0x491927['key'],_0x491927[_0x963e('0x12')]));}else if(_0x491927[_0x963e('0x10')]==='variable'&&_0x491927[_0x963e('0x9')]&&_0x491927[_0x963e('0x13')]){_0x4d2993[_0x491927[_0x963e('0x9')]]&&_0x5edc1e['push'](util['format']('%s:\x20%s',_0x491927[_0x963e('0x13')],_0x4d2993[_0x491927['variableName']]));}else if(_0x491927[_0x963e('0x10')]===_0x963e('0xb')&&_0x491927[_0x963e('0xc')]&&_0x491927['Variable'][_0x963e('0xd')]&&_0x491927[_0x963e('0x13')]){_0x4d2993[_0x491927[_0x963e('0xc')]['name']['toLowerCase']()]&&_0x5edc1e['push'](util[_0x963e('0x14')](_0x963e('0x11'),_0x491927[_0x963e('0x13')],_0x4d2993[_0x491927['Variable'][_0x963e('0xd')][_0x963e('0xe')]()]));}}}}return _0x5edc1e[_0x963e('0x15')](_0x16a7fc);};exports['stripTrailingSlash']=function(_0x11a808){var _0x31fb00=_0x11a808[_0x963e('0x16')](-0x1);if(_0x31fb00==='/'){_0x11a808=_0x11a808[_0x963e('0x17')](0x0,_0x11a808[_0x963e('0x18')](_0x31fb00));}return _0x11a808;};exports['validateEmail']=function(_0x1eecee){if(!_['isNil'](_0x1eecee)&&_0x1eecee!==''){var _0x2186d0=/^(([^<>()\[\]\\.,;:\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 _0x2186d0[_0x963e('0x19')](String(_0x1eecee)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x21cb=['format','keyContent','keyType','slice','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','string','push','content','type','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key'];(function(_0x64bef1,_0x5841ee){var _0x32a991=function(_0x5f5c4a){while(--_0x5f5c4a){_0x64bef1['push'](_0x64bef1['shift']());}};_0x32a991(++_0x5841ee);}(_0x21cb,0x1a5));var _0xb21c=function(_0x5d5a38,_0x4cfe6d){_0x5d5a38=_0x5d5a38-0x0;var _0x2f3fd2=_0x21cb[_0x5d5a38];return _0x2f3fd2;};'use strict';var _=require(_0xb21c('0x0'));var util=require(_0xb21c('0x1'));exports[_0xb21c('0x2')]=function(_0x443605,_0x4fe702,_0xffd6e9){var _0x29ea93=[];if(_0x443605[_0xb21c('0x3')]>0x0){var _0x3d900f=_['sortBy'](_0x443605,['id']);for(var _0x1e5f36=0x0;_0x1e5f36<_0x3d900f[_0xb21c('0x3')];_0x1e5f36++){var _0x17f110=_0x3d900f[_0x1e5f36];if(_0x17f110['type']===_0xb21c('0x4')){_0x29ea93[_0xb21c('0x5')](_0x17f110[_0xb21c('0x6')]);}else if(_0x17f110[_0xb21c('0x7')]==='variable'&&_0x17f110[_0xb21c('0x8')]){_0x4fe702[_0x17f110[_0xb21c('0x8')]]&&_0x29ea93['push'](_0x4fe702[_0x17f110[_0xb21c('0x8')]][_0xb21c('0x9')]());}else if(_0x17f110[_0xb21c('0x7')]===_0xb21c('0xa')&&_0x17f110[_0xb21c('0xb')]&&_0x17f110[_0xb21c('0xb')][_0xb21c('0xc')]){_0x4fe702[_0x17f110[_0xb21c('0xb')]['name']['toLowerCase']()]&&_0x29ea93[_0xb21c('0x5')](_0x4fe702[_0x17f110['Variable'][_0xb21c('0xc')][_0xb21c('0xd')]()]['toString']());}else if(_0x17f110[_0xb21c('0x7')]===_0xb21c('0xe')){if(_0x17f110['keyType']==='string'&&_0x17f110[_0xb21c('0xf')]){_0x29ea93[_0xb21c('0x5')](util[_0xb21c('0x10')]('%s:\x20%s',_0x17f110[_0xb21c('0xf')],_0x17f110[_0xb21c('0x11')]));}else if(_0x17f110[_0xb21c('0x12')]==='variable'&&_0x17f110[_0xb21c('0x8')]&&_0x17f110[_0xb21c('0xf')]){_0x4fe702[_0x17f110[_0xb21c('0x8')]]&&_0x29ea93[_0xb21c('0x5')](util[_0xb21c('0x10')]('%s:\x20%s',_0x17f110[_0xb21c('0xf')],_0x4fe702[_0x17f110[_0xb21c('0x8')]]));}else if(_0x17f110[_0xb21c('0x12')]==='customVariable'&&_0x17f110['Variable']&&_0x17f110[_0xb21c('0xb')]['name']&&_0x17f110[_0xb21c('0xf')]){_0x4fe702[_0x17f110[_0xb21c('0xb')][_0xb21c('0xc')][_0xb21c('0xd')]()]&&_0x29ea93['push'](util[_0xb21c('0x10')]('%s:\x20%s',_0x17f110[_0xb21c('0xf')],_0x4fe702[_0x17f110[_0xb21c('0xb')][_0xb21c('0xc')][_0xb21c('0xd')]()]));}}}}return _0x29ea93['join'](_0xffd6e9);};exports['stripTrailingSlash']=function(_0x5974d2){var _0x47697b=_0x5974d2[_0xb21c('0x13')](-0x1);if(_0x47697b==='/'){_0x5974d2=_0x5974d2['substring'](0x0,_0x5974d2[_0xb21c('0x14')](_0x47697b));}return _0x5974d2;};exports[_0xb21c('0x15')]=function(_0x2a0790){if(!_[_0xb21c('0x16')](_0x2a0790)&&_0x2a0790!==''){var _0xc4ba32=/^(([^<>()\[\]\\.,;:\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 _0xc4ba32['test'](String(_0x2a0790)[_0xb21c('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 2b47d1c..f407458 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x38ba36,_0x1b931e){var _0x71e0f1=function(_0x2261a8){while(--_0x2261a8){_0x38ba36['push'](_0x38ba36['shift']());}};_0x71e0f1(++_0x1b931e);}(_0xe706,0xa3));var _0x6e70=function(_0x2db146,_0x509cc5){_0x2db146=_0x2db146-0x0;var _0x524bcb=_0xe706[_0x2db146];return _0x524bcb;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 561fea6..103aecd 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 _0xb3c5=['zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','Basic\x20%s','base64','debug','[HTTP]','stringify','length','map','includes','string','type','nameField','customField','picklist','push','content','toString','variable','idField','variableName','custom_fields','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','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...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','destcalleridname','destcalleridnum','[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','ioredis','./util','../../../../config/logger'];(function(_0x187193,_0x24e49d){var _0x5002aa=function(_0x2ede6b){while(--_0x2ede6b){_0x187193['push'](_0x187193['shift']());}};_0x5002aa(++_0x24e49d);}(_0xb3c5,0xe1));var _0x5b3c=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xb3c5[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0x5b3c('0x0'));var rp=require(_0x5b3c('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x5b3c('0x2'));var intUtil=require(_0x5b3c('0x3'));var config=require('../../../../config/environment');var logger=require(_0x5b3c('0x4'))(_0x5b3c('0x5'));config[_0x5b3c('0x6')]=_[_0x5b3c('0x7')](config[_0x5b3c('0x6')],{'host':_0x5b3c('0x8'),'port':0x18eb});var io=require(_0x5b3c('0x9'))(new Redis(config[_0x5b3c('0x6')]));function emit(_0xdbca07,_0x1dfc4d,_0xe1e783){io['to'](_0xdbca07)[_0x5b3c('0xa')](_0x1dfc4d,_0xe1e783);}var headers={'Content-Type':_0x5b3c('0xb'),'Accept':'application/json'};function getTicket(_0x13bb83,_0x2a49fa,_0x38c3e7,_0x353c79,_0x61cc5e){logger[_0x5b3c('0xc')](_0x5b3c('0xd'));return request({'uri':util['format'](_0x5b3c('0xe'),_0x13bb83[_0x5b3c('0xf')]),'method':_0x5b3c('0x10'),'body':{'ticket':_[_0x5b3c('0x11')]({'requester_id':_0x38c3e7['id'],'submitter_id':_0x2a49fa?_0x2a49fa['id']:undefined,'assignee_id':_0x2a49fa?_0x2a49fa['id']:undefined,'tags':getTags(_0x353c79[_0x5b3c('0x12')],_0x5b3c('0x13')),'subject':intUtil[_0x5b3c('0x14')](_0x353c79['Subjects'],_0x61cc5e,'\x20'),'description':intUtil[_0x5b3c('0x14')](_0x353c79[_0x5b3c('0x15')],_0x61cc5e,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5b3c('0x14')](_0x353c79[_0x5b3c('0x15')],_0x61cc5e,'\x0a')}},getCustomFields(_0x353c79[_0x5b3c('0x16')],_0x61cc5e))}})[_0x5b3c('0x17')](function(_0x28923e){logger[_0x5b3c('0xc')](_0x5b3c('0x18'));return _0x28923e[_0x5b3c('0x19')];});}function getUser(_0x55b71a,_0x4a0594){if(intUtil[_0x5b3c('0x1a')](_0x4a0594)){logger['info'](_0x5b3c('0x1b'),_0x4a0594);return request({'uri':util['format'](_0x5b3c('0x1c'),_0x55b71a['remoteUri']),'qs':{'query':util['format'](_0x5b3c('0x1d'),_0x4a0594)}})['then'](function(_0x1b01d1){if(_0x1b01d1[_0x5b3c('0x1e')]){logger[_0x5b3c('0xc')](_0x5b3c('0x1f'));return _[_0x5b3c('0x20')](_0x1b01d1['results'],{'email':_0x4a0594,'role':'agent'});}else{logger[_0x5b3c('0xc')](_0x5b3c('0x21'));return request({'uri':util[_0x5b3c('0x22')]('%s/users/me.json',_0x55b71a[_0x5b3c('0xf')])})['then'](function(_0x5752d2){logger[_0x5b3c('0xc')](_0x5b3c('0x23'));return _0x5752d2[_0x5b3c('0x24')];});}});}else{logger[_0x5b3c('0xc')](_0x5b3c('0x21'));return request({'uri':util['format'](_0x5b3c('0x25'),_0x55b71a[_0x5b3c('0xf')])})[_0x5b3c('0x17')](function(_0x4ae5ab){logger[_0x5b3c('0xc')]('Admin\x20account\x20selected.');return _0x4ae5ab[_0x5b3c('0x24')];});}}function getEndUser(_0x2b56ca,_0x365e38,_0x1dc417){logger[_0x5b3c('0xc')](_0x5b3c('0x26'),_0x1dc417);return request({'uri':util[_0x5b3c('0x22')](_0x5b3c('0x1c'),_0x2b56ca[_0x5b3c('0xf')]),'qs':{'query':util[_0x5b3c('0x22')](_0x5b3c('0x27'),_0x1dc417)}})[_0x5b3c('0x17')](function(_0x5599d7){var _0x44a72e;if(_0x5599d7[_0x5b3c('0x28')]['length']){_0x5599d7['results']=_[_0x5b3c('0x29')](_0x5599d7[_0x5b3c('0x28')],{'suspended':![],'role':_0x5b3c('0x2a')});if(_0x5599d7[_0x5b3c('0x28')]['length']){_0x44a72e=_[_0x5b3c('0x2b')](_0x5599d7[_0x5b3c('0x28')]);}}if(_0x44a72e){logger[_0x5b3c('0xc')](_0x5b3c('0x2c'));return _0x44a72e;}else{logger['info'](_0x5b3c('0x2d'));return request({'uri':util[_0x5b3c('0x22')](_0x5b3c('0x2e'),_0x2b56ca['remoteUri']),'method':'POST','body':{'user':{'role':_0x5b3c('0x2a'),'name':util[_0x5b3c('0x22')](_0x5b3c('0x2f'),_0x365e38||_0x1dc417),'phone':_0x1dc417}}})['then'](function(_0x139761){logger[_0x5b3c('0xc')](_0x5b3c('0x30'));return _0x139761[_0x5b3c('0x24')];});}});}function getAuth(_0x4c9fc8){var _0x345d96;if(_0x4c9fc8[_0x5b3c('0x31')]===_0x5b3c('0x32')){_0x345d96=util['format']('%s:%s',_0x4c9fc8[_0x5b3c('0x33')],_0x4c9fc8['password']);}else if(_0x4c9fc8[_0x5b3c('0x31')]==='token'){_0x345d96=util[_0x5b3c('0x22')]('%s/token:%s',_0x4c9fc8[_0x5b3c('0x33')],_0x4c9fc8[_0x5b3c('0x34')]);}return util[_0x5b3c('0x22')](_0x5b3c('0x35'),new Buffer(_0x345d96)['toString'](_0x5b3c('0x36')));}function request(_0x465184){logger[_0x5b3c('0x37')](_0x5b3c('0x38'),JSON[_0x5b3c('0x39')](_0x465184));return rp(_['defaults'](_0x465184,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xdedbb,_0x2ce024){var _0x47ac99=[];if(_0xdedbb&&_0xdedbb[_0x5b3c('0x3a')]>0x0){_0x47ac99=_[_0x5b3c('0x3b')](_0xdedbb,_0x2ce024);}return _0x47ac99;}function getCustomFields(_0x3f1a8c,_0x36b6ab){var _0x14d802=[];var _0x243204={'custom_fields':[]};if(_0x3f1a8c[_0x5b3c('0x3a')]>0x0){_['forEach'](_0x3f1a8c,function(_0x3f576f){if(_[_0x5b3c('0x3c')]([_0x5b3c('0x3d'),'picklist'],_0x3f576f[_0x5b3c('0x3e')])&&_0x3f576f[_0x5b3c('0x3f')]&&!_0x3f576f[_0x5b3c('0x40')]){_0x243204[_0x3f576f[_0x5b3c('0x3f')]['toLowerCase']()]=_0x3f576f['content']['toString']();}else if(_['includes']([_0x5b3c('0x3d'),_0x5b3c('0x41')],_0x3f576f[_0x5b3c('0x3e')])&&_0x3f576f['idField']&&_0x3f576f[_0x5b3c('0x40')]){_0x243204['custom_fields'][_0x5b3c('0x42')]({'id':_0x3f576f['idField'],'value':_0x3f576f[_0x5b3c('0x43')][_0x5b3c('0x44')]()});}else if(_0x3f576f[_0x5b3c('0x3e')]===_0x5b3c('0x45')&&_0x3f576f['variableName']&&_0x3f576f[_0x5b3c('0x46')]&&_0x3f576f['customField']){_0x36b6ab[_0x3f576f[_0x5b3c('0x47')]]&&_0x243204[_0x5b3c('0x48')][_0x5b3c('0x42')]({'id':_0x3f576f[_0x5b3c('0x46')],'value':_0x36b6ab[_0x3f576f[_0x5b3c('0x47')]][_0x5b3c('0x44')]()});}else if(_0x3f576f[_0x5b3c('0x3e')]==='customVariable'&&_0x3f576f[_0x5b3c('0x49')]&&_0x3f576f['Variable'][_0x5b3c('0x13')]&&_0x3f576f[_0x5b3c('0x46')]&&_0x3f576f[_0x5b3c('0x40')]){_0x36b6ab[_0x3f576f[_0x5b3c('0x49')][_0x5b3c('0x13')]['toLowerCase']()]&&_0x243204['custom_fields']['push']({'id':_0x3f576f['idField'],'value':_0x36b6ab[_0x3f576f[_0x5b3c('0x49')][_0x5b3c('0x13')][_0x5b3c('0x4a')]()][_0x5b3c('0x44')]()});}});}return _0x243204;}exports[_0x5b3c('0x4b')]=function(_0x175a5e,_0x54972d,_0x5c9176,_0x12f635,_0x2f0d62,_0x137bf4){var _0x39fed3,_0x5c8ed5;_0x137bf4[_0x5b3c('0xf')]=intUtil[_0x5b3c('0x4c')](_0x137bf4[_0x5b3c('0xf')]);_0x137bf4[_0x5b3c('0x4d')]=intUtil[_0x5b3c('0x4c')](_0x137bf4[_0x5b3c('0x4d')]);if(_0x2f0d62&&_0x2f0d62[_0x5b3c('0x4e')]){logger[_0x5b3c('0xc')](_0x5b3c('0x4f'),_0x5b3c('0x50'));_0x54972d[_0x5b3c('0x51')]=util[_0x5b3c('0x22')](_0x5b3c('0x52'),_0x137bf4['serverUrl'],_0x54972d[_0x5b3c('0x53')],md5(_0x54972d[_0x5b3c('0x53')]));}else{_0x54972d[_0x5b3c('0x51')]='';}headers[_0x5b3c('0x54')]=getAuth(_0x137bf4);return getUser(_0x137bf4,_0x12f635[_0x5b3c('0x55')])[_0x5b3c('0x17')](function(_0x322e18){_0x39fed3=_0x322e18;logger[_0x5b3c('0xc')](_0x5b3c('0x56'),_0x39fed3['id']);return getEndUser(_0x137bf4,_0x54972d[_0x5b3c('0x57')],_0x54972d[_0x5b3c('0x58')]);})[_0x5b3c('0x17')](function(_0x4207e3){_0x5c8ed5=_0x4207e3;logger[_0x5b3c('0xc')](_0x5b3c('0x59'),_0x5c8ed5['id']);return getTicket(_0x137bf4,_0x39fed3,_0x5c8ed5,_0x5c9176,_0x54972d);})[_0x5b3c('0x17')](function(_0x587ed5){if(_0x587ed5){logger['info'](_0x5b3c('0x5a'),_0x587ed5['id']);switch(_0x137bf4[_0x5b3c('0x3e')]){case _0x5b3c('0x5b'):logger[_0x5b3c('0xc')]('[QUEUE]',_0x5b3c('0x5c'));return request({'uri':util[_0x5b3c('0x22')](_0x5b3c('0x5d'),_0x137bf4[_0x5b3c('0xf')],_0x39fed3['id'],_0x587ed5['id']),'method':'POST'});case _0x5b3c('0x5e'):logger['info'](_0x5b3c('0x4f'),_0x5b3c('0x5f'));emit(util[_0x5b3c('0x22')](_0x5b3c('0x60'),_0x12f635[_0x5b3c('0x13')]),_0x5b3c('0x61'),{'uri':util['format'](_0x5b3c('0x62'),_0x137bf4['remoteUri'][_0x5b3c('0x63')](_0x5b3c('0x64'),''),_0x587ed5['id'])});break;default:logger[_0x5b3c('0x65')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x5b3c('0x66')](function(_0x3c0ec5){logger[_0x5b3c('0x65')](_0x5b3c('0x67'),util['inspect'](_0x3c0ec5,{'showHidden':!![],'depth':null}));});};exports[_0x5b3c('0x68')]=function(_0x21eb45,_0x20c15c,_0x1fcb07,_0xc95e91,_0x57525f,_0x5347c7,_0x51fe61){var _0x336b18,_0xe3fd83;_0x5347c7[_0x5b3c('0xf')]=intUtil[_0x5b3c('0x4c')](_0x5347c7['remoteUri']);_0x5347c7[_0x5b3c('0x4d')]=intUtil[_0x5b3c('0x4c')](_0x5347c7[_0x5b3c('0x4d')]);if(_0x51fe61&&_0x51fe61['recordingFormat']&&_0x51fe61['recordingFormat']!=='none'){logger[_0x5b3c('0xc')]('[OUTBOUND]',_0x5b3c('0x50'));_0x20c15c[_0x5b3c('0x51')]=util[_0x5b3c('0x22')](_0x5b3c('0x52'),_0x5347c7['serverUrl'],_0x20c15c[_0x5b3c('0x53')],md5(_0x20c15c['uniqueid']));}headers[_0x5b3c('0x54')]=getAuth(_0x5347c7);return getUser(_0x5347c7,_0xc95e91[_0x5b3c('0x55')])[_0x5b3c('0x17')](function(_0xf73228){_0x336b18=_0xf73228;logger['info'](_0x5b3c('0x56'),_0x336b18['id']);return getEndUser(_0x5347c7,_0x20c15c[_0x5b3c('0x69')],_0x20c15c[_0x5b3c('0x6a')]);})[_0x5b3c('0x17')](function(_0x31ab61){_0xe3fd83=_0x31ab61;logger['info'](_0x5b3c('0x59'),_0xe3fd83['id']);return getTicket(_0x5347c7,_0x336b18,_0xe3fd83,_0x1fcb07,_0x20c15c);})[_0x5b3c('0x17')](function(_0x1bb56f){if(_0x1bb56f){logger[_0x5b3c('0xc')]('The\x20Ticket\x20ID\x20is:',_0x1bb56f['id']);switch(_0x5347c7[_0x5b3c('0x3e')]){case _0x5b3c('0x5b'):logger[_0x5b3c('0xc')](_0x5b3c('0x6b'),_0x5b3c('0x5c'));return request({'uri':util[_0x5b3c('0x22')](_0x5b3c('0x5d'),_0x5347c7[_0x5b3c('0xf')],_0x336b18['id'],_0x1bb56f['id']),'method':_0x5b3c('0x10')});case _0x5b3c('0x5e'):logger[_0x5b3c('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5b3c('0x60'),_0xc95e91[_0x5b3c('0x13')]),'trigger:browser:url',{'uri':util[_0x5b3c('0x22')]('%s/agent/tickets/%s',_0x5347c7[_0x5b3c('0xf')]['replace'](_0x5b3c('0x64'),''),_0x1bb56f['id'])});break;default:logger[_0x5b3c('0x65')]('[OUTBOUND]',_0x5b3c('0x6c'));}}})[_0x5b3c('0x66')](function(_0x4b71b1){logger[_0x5b3c('0x65')](_0x5b3c('0x6d'),util[_0x5b3c('0x6e')](_0x4b71b1,{'showHidden':!![],'depth':null}));});};exports[_0x5b3c('0x6f')]=function(_0x52dc29,_0x51cfb4,_0x163a41,_0x316a93,_0x3c201c,_0x46f8ef){var _0x1a61d3,_0x207303;_0x46f8ef[_0x5b3c('0xf')]=intUtil[_0x5b3c('0x4c')](_0x46f8ef[_0x5b3c('0xf')]);_0x46f8ef[_0x5b3c('0x4d')]=intUtil[_0x5b3c('0x4c')](_0x46f8ef[_0x5b3c('0x4d')]);if(_0x3c201c&&_0x3c201c[_0x5b3c('0x4e')]){logger[_0x5b3c('0xc')]('['+_0x51cfb4['lastevent'][_0x5b3c('0x70')]()+']',_0x5b3c('0x50'));_0x51cfb4[_0x5b3c('0x51')]=util[_0x5b3c('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x46f8ef[_0x5b3c('0x4d')],_0x51cfb4[_0x5b3c('0x53')],md5(_0x51cfb4[_0x5b3c('0x53')]));}else{_0x51cfb4['recordingURL']='';}headers[_0x5b3c('0x54')]=getAuth(_0x46f8ef);return getUser(_0x46f8ef)[_0x5b3c('0x17')](function(_0x13fbc9){_0x1a61d3=_0x13fbc9;logger[_0x5b3c('0xc')]('The\x20User\x20ID\x20is:',_0x1a61d3['id']);return getEndUser(_0x46f8ef,_0x51cfb4[_0x5b3c('0x57')],_0x51cfb4['calleridnum']);})[_0x5b3c('0x17')](function(_0x3cfc61){_0x207303=_0x3cfc61;logger['info']('The\x20Enduser\x20ID\x20is:',_0x207303['id']);return getTicket(_0x46f8ef,_0x1a61d3,_0x207303,_0x163a41,_0x51cfb4);})[_0x5b3c('0x17')](function(_0x469429){if(_0x469429){logger[_0x5b3c('0xc')](_0x5b3c('0x5a'),_0x469429['id']);}})[_0x5b3c('0x66')](function(_0x12d6f0){logger['error']('['+_0x51cfb4[_0x5b3c('0x71')][_0x5b3c('0x70')]()+']'+_0x5b3c('0x72'),util[_0x5b3c('0x6e')](_0x12d6f0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x04cf=['user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/search.json','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','%s/users/me.json','Admin\x20account\x20selected.'];(function(_0x5381ca,_0x3b09fd){var _0x545d09=function(_0x9c03c7){while(--_0x9c03c7){_0x5381ca['push'](_0x5381ca['shift']());}};_0x545d09(++_0x3b09fd);}(_0x04cf,0xb9));var _0xf04c=function(_0x46f3b4,_0x26f2c6){_0x46f3b4=_0x46f3b4-0x0;var _0x641ca8=_0x04cf[_0x46f3b4];return _0x641ca8;};'use strict';var _=require(_0xf04c('0x0'));var rp=require('request-promise');var md5=require(_0xf04c('0x1'));var util=require(_0xf04c('0x2'));var Redis=require(_0xf04c('0x3'));var intUtil=require('./util');var config=require(_0xf04c('0x4'));var logger=require(_0xf04c('0x5'))(_0xf04c('0x6'));config['redis']=_[_0xf04c('0x7')](config[_0xf04c('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf04c('0x9'))(new Redis(config[_0xf04c('0x8')]));function emit(_0x58d4ab,_0x37eef1,_0x2151c3){io['to'](_0x58d4ab)['emit'](_0x37eef1,_0x2151c3);}var headers={'Content-Type':'application/json','Accept':_0xf04c('0xa')};function getTicket(_0x191075,_0x5187f7,_0x463d10,_0x284e85,_0x32e4f0){logger[_0xf04c('0xb')](_0xf04c('0xc'));return request({'uri':util[_0xf04c('0xd')](_0xf04c('0xe'),_0x191075[_0xf04c('0xf')]),'method':_0xf04c('0x10'),'body':{'ticket':_[_0xf04c('0x11')]({'requester_id':_0x463d10['id'],'submitter_id':_0x5187f7?_0x5187f7['id']:undefined,'assignee_id':_0x5187f7?_0x5187f7['id']:undefined,'tags':getTags(_0x284e85[_0xf04c('0x12')],'name'),'subject':intUtil[_0xf04c('0x13')](_0x284e85[_0xf04c('0x14')],_0x32e4f0,'\x20'),'description':intUtil['getString'](_0x284e85[_0xf04c('0x15')],_0x32e4f0,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf04c('0x13')](_0x284e85['Descriptions'],_0x32e4f0,'\x0a')}},getCustomFields(_0x284e85[_0xf04c('0x16')],_0x32e4f0))}})[_0xf04c('0x17')](function(_0x114a6c){logger[_0xf04c('0xb')](_0xf04c('0x18'));return _0x114a6c[_0xf04c('0x19')];});}function getUser(_0x4fa9d4,_0x5b9f1a){if(intUtil[_0xf04c('0x1a')](_0x5b9f1a)){logger[_0xf04c('0xb')](_0xf04c('0x1b'),_0x5b9f1a);return request({'uri':util[_0xf04c('0xd')]('%s/search.json',_0x4fa9d4['remoteUri']),'qs':{'query':util[_0xf04c('0xd')](_0xf04c('0x1c'),_0x5b9f1a)}})['then'](function(_0x48a9fa){if(_0x48a9fa[_0xf04c('0x1d')]){logger['info'](_0xf04c('0x1e'));return _[_0xf04c('0x1f')](_0x48a9fa[_0xf04c('0x20')],{'email':_0x5b9f1a,'role':'agent'});}else{logger[_0xf04c('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf04c('0xd')](_0xf04c('0x21'),_0x4fa9d4[_0xf04c('0xf')])})[_0xf04c('0x17')](function(_0x144314){logger['info'](_0xf04c('0x22'));return _0x144314[_0xf04c('0x23')];});}});}else{logger[_0xf04c('0xb')](_0xf04c('0x24'));return request({'uri':util['format'](_0xf04c('0x21'),_0x4fa9d4['remoteUri'])})['then'](function(_0x3d2dcc){logger['info'](_0xf04c('0x22'));return _0x3d2dcc['user'];});}}function getEndUser(_0x35a3e4,_0x53a8a7,_0x1caeb4){logger[_0xf04c('0xb')]('Searching\x20enduser\x20with\x20phone',_0x1caeb4);return request({'uri':util[_0xf04c('0xd')](_0xf04c('0x25'),_0x35a3e4[_0xf04c('0xf')]),'qs':{'query':util[_0xf04c('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x1caeb4)}})[_0xf04c('0x17')](function(_0x451075){var _0x45e5b0;if(_0x451075['results'][_0xf04c('0x26')]){_0x451075[_0xf04c('0x20')]=_[_0xf04c('0x27')](_0x451075[_0xf04c('0x20')],{'suspended':![],'role':_0xf04c('0x28')});if(_0x451075['results']['length']){_0x45e5b0=_['first'](_0x451075[_0xf04c('0x20')]);}}if(_0x45e5b0){logger['info'](_0xf04c('0x29'));return _0x45e5b0;}else{logger[_0xf04c('0xb')](_0xf04c('0x2a'));return request({'uri':util['format']('%s/users.json',_0x35a3e4[_0xf04c('0xf')]),'method':_0xf04c('0x10'),'body':{'user':{'role':_0xf04c('0x28'),'name':util[_0xf04c('0xd')](_0xf04c('0x2b'),_0x53a8a7||_0x1caeb4),'phone':_0x1caeb4}}})[_0xf04c('0x17')](function(_0x22e54d){logger['info']('Enduser\x20created.');return _0x22e54d[_0xf04c('0x23')];});}});}function getAuth(_0x5573d0){var _0x5c0ac1;if(_0x5573d0['authType']==='password'){_0x5c0ac1=util[_0xf04c('0xd')]('%s:%s',_0x5573d0[_0xf04c('0x2c')],_0x5573d0[_0xf04c('0x2d')]);}else if(_0x5573d0['authType']===_0xf04c('0x2e')){_0x5c0ac1=util[_0xf04c('0xd')](_0xf04c('0x2f'),_0x5573d0[_0xf04c('0x2c')],_0x5573d0['token']);}return util[_0xf04c('0xd')](_0xf04c('0x30'),new Buffer(_0x5c0ac1)[_0xf04c('0x31')](_0xf04c('0x32')));}function request(_0x12055a){logger[_0xf04c('0x33')](_0xf04c('0x34'),JSON['stringify'](_0x12055a));return rp(_['defaults'](_0x12055a,{'method':_0xf04c('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x449ce3,_0x17e22c){var _0x59698f=[];if(_0x449ce3&&_0x449ce3[_0xf04c('0x26')]>0x0){_0x59698f=_[_0xf04c('0x36')](_0x449ce3,_0x17e22c);}return _0x59698f;}function getCustomFields(_0x2fd234,_0x1a6d76){var _0x67651=[];var _0x486ea3={'custom_fields':[]};if(_0x2fd234[_0xf04c('0x26')]>0x0){_['forEach'](_0x2fd234,function(_0xeaf0d2){if(_[_0xf04c('0x37')]([_0xf04c('0x38'),_0xf04c('0x39')],_0xeaf0d2[_0xf04c('0x3a')])&&_0xeaf0d2[_0xf04c('0x3b')]&&!_0xeaf0d2[_0xf04c('0x3c')]){_0x486ea3[_0xeaf0d2[_0xf04c('0x3b')][_0xf04c('0x3d')]()]=_0xeaf0d2[_0xf04c('0x3e')][_0xf04c('0x31')]();}else if(_[_0xf04c('0x37')]([_0xf04c('0x38'),_0xf04c('0x39')],_0xeaf0d2['type'])&&_0xeaf0d2[_0xf04c('0x3f')]&&_0xeaf0d2[_0xf04c('0x3c')]){_0x486ea3[_0xf04c('0x40')][_0xf04c('0x41')]({'id':_0xeaf0d2[_0xf04c('0x3f')],'value':_0xeaf0d2[_0xf04c('0x3e')]['toString']()});}else if(_0xeaf0d2['type']===_0xf04c('0x42')&&_0xeaf0d2[_0xf04c('0x43')]&&_0xeaf0d2[_0xf04c('0x3f')]&&_0xeaf0d2['customField']){_0x1a6d76[_0xeaf0d2['variableName']]&&_0x486ea3[_0xf04c('0x40')][_0xf04c('0x41')]({'id':_0xeaf0d2[_0xf04c('0x3f')],'value':_0x1a6d76[_0xeaf0d2[_0xf04c('0x43')]][_0xf04c('0x31')]()});}else if(_0xeaf0d2[_0xf04c('0x3a')]===_0xf04c('0x44')&&_0xeaf0d2['Variable']&&_0xeaf0d2[_0xf04c('0x45')]['name']&&_0xeaf0d2[_0xf04c('0x3f')]&&_0xeaf0d2['customField']){_0x1a6d76[_0xeaf0d2[_0xf04c('0x45')][_0xf04c('0x46')][_0xf04c('0x3d')]()]&&_0x486ea3[_0xf04c('0x40')]['push']({'id':_0xeaf0d2[_0xf04c('0x3f')],'value':_0x1a6d76[_0xeaf0d2[_0xf04c('0x45')][_0xf04c('0x46')][_0xf04c('0x3d')]()][_0xf04c('0x31')]()});}});}return _0x486ea3;}exports[_0xf04c('0x47')]=function(_0x386558,_0x573c3f,_0x35cde1,_0x1f3b1f,_0x511813,_0x3a4102){var _0x2b38dd,_0x377f0a;_0x3a4102[_0xf04c('0xf')]=intUtil[_0xf04c('0x48')](_0x3a4102[_0xf04c('0xf')]);_0x3a4102['serverUrl']=intUtil['stripTrailingSlash'](_0x3a4102[_0xf04c('0x49')]);if(_0x511813&&_0x511813[_0xf04c('0x4a')]){logger[_0xf04c('0xb')](_0xf04c('0x4b'),_0xf04c('0x4c'));_0x573c3f[_0xf04c('0x4d')]=util['format'](_0xf04c('0x4e'),_0x3a4102['serverUrl'],_0x573c3f[_0xf04c('0x4f')],md5(_0x573c3f[_0xf04c('0x4f')]));}else{_0x573c3f['recordingURL']='';}headers[_0xf04c('0x50')]=getAuth(_0x3a4102);return getUser(_0x3a4102,_0x1f3b1f[_0xf04c('0x51')])[_0xf04c('0x17')](function(_0x473698){_0x2b38dd=_0x473698;logger[_0xf04c('0xb')](_0xf04c('0x52'),_0x2b38dd['id']);return getEndUser(_0x3a4102,_0x573c3f[_0xf04c('0x53')],_0x573c3f['calleridnum']);})['then'](function(_0x49ed10){_0x377f0a=_0x49ed10;logger[_0xf04c('0xb')](_0xf04c('0x54'),_0x377f0a['id']);return getTicket(_0x3a4102,_0x2b38dd,_0x377f0a,_0x35cde1,_0x573c3f);})[_0xf04c('0x17')](function(_0x3c06f7){if(_0x3c06f7){logger[_0xf04c('0xb')](_0xf04c('0x55'),_0x3c06f7['id']);switch(_0x3a4102[_0xf04c('0x3a')]){case _0xf04c('0x56'):logger[_0xf04c('0xb')](_0xf04c('0x4b'),_0xf04c('0x57'));return request({'uri':util[_0xf04c('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3a4102[_0xf04c('0xf')],_0x2b38dd['id'],_0x3c06f7['id']),'method':'POST'});case _0xf04c('0x58'):logger['info'](_0xf04c('0x4b'),_0xf04c('0x59'));emit(util[_0xf04c('0xd')](_0xf04c('0x5a'),_0x1f3b1f[_0xf04c('0x46')]),_0xf04c('0x5b'),{'uri':util[_0xf04c('0xd')]('%s/agent/tickets/%s',_0x3a4102[_0xf04c('0xf')][_0xf04c('0x5c')](_0xf04c('0x5d'),''),_0x3c06f7['id'])});break;default:logger[_0xf04c('0x5e')](_0xf04c('0x4b'),_0xf04c('0x5f'));}}})[_0xf04c('0x60')](function(_0xc2e5e1){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf04c('0x61')](_0xc2e5e1,{'showHidden':!![],'depth':null}));});};exports[_0xf04c('0x62')]=function(_0x4923a7,_0xb8aecf,_0xa5db71,_0x11db5d,_0x4daabe,_0xff1de8,_0x30de52){var _0x29482f,_0x54b556;_0xff1de8[_0xf04c('0xf')]=intUtil['stripTrailingSlash'](_0xff1de8[_0xf04c('0xf')]);_0xff1de8[_0xf04c('0x49')]=intUtil[_0xf04c('0x48')](_0xff1de8[_0xf04c('0x49')]);if(_0x30de52&&_0x30de52[_0xf04c('0x63')]&&_0x30de52['recordingFormat']!==_0xf04c('0x64')){logger[_0xf04c('0xb')](_0xf04c('0x65'),_0xf04c('0x4c'));_0xb8aecf['recordingURL']=util[_0xf04c('0xd')](_0xf04c('0x4e'),_0xff1de8[_0xf04c('0x49')],_0xb8aecf['uniqueid'],md5(_0xb8aecf[_0xf04c('0x4f')]));}headers[_0xf04c('0x50')]=getAuth(_0xff1de8);return getUser(_0xff1de8,_0x11db5d[_0xf04c('0x51')])['then'](function(_0x43d2b3){_0x29482f=_0x43d2b3;logger['info'](_0xf04c('0x52'),_0x29482f['id']);return getEndUser(_0xff1de8,_0xb8aecf[_0xf04c('0x66')],_0xb8aecf['destcalleridnum']);})[_0xf04c('0x17')](function(_0x560906){_0x54b556=_0x560906;logger[_0xf04c('0xb')](_0xf04c('0x54'),_0x54b556['id']);return getTicket(_0xff1de8,_0x29482f,_0x54b556,_0xa5db71,_0xb8aecf);})['then'](function(_0x52d74b){if(_0x52d74b){logger[_0xf04c('0xb')](_0xf04c('0x55'),_0x52d74b['id']);switch(_0xff1de8['type']){case'integrationTab':logger[_0xf04c('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf04c('0xd')](_0xf04c('0x67'),_0xff1de8[_0xf04c('0xf')],_0x29482f['id'],_0x52d74b['id']),'method':'POST'});case'newTab':logger[_0xf04c('0xb')](_0xf04c('0x65'),_0xf04c('0x59'));emit(util[_0xf04c('0xd')](_0xf04c('0x5a'),_0x11db5d[_0xf04c('0x46')]),'trigger:browser:url',{'uri':util[_0xf04c('0xd')](_0xf04c('0x68'),_0xff1de8[_0xf04c('0xf')]['replace'](_0xf04c('0x5d'),''),_0x52d74b['id'])});break;default:logger[_0xf04c('0x5e')](_0xf04c('0x65'),_0xf04c('0x5f'));}}})[_0xf04c('0x60')](function(_0x502f71){logger[_0xf04c('0x5e')](_0xf04c('0x69'),util[_0xf04c('0x61')](_0x502f71,{'showHidden':!![],'depth':null}));});};exports[_0xf04c('0x6a')]=function(_0x5b3677,_0x10b7a9,_0x574b91,_0x860a20,_0x4dcf37,_0x2a54de){var _0x9043bb,_0x24a8d6;_0x2a54de[_0xf04c('0xf')]=intUtil[_0xf04c('0x48')](_0x2a54de[_0xf04c('0xf')]);_0x2a54de[_0xf04c('0x49')]=intUtil[_0xf04c('0x48')](_0x2a54de['serverUrl']);if(_0x4dcf37&&_0x4dcf37[_0xf04c('0x4a')]){logger[_0xf04c('0xb')]('['+_0x10b7a9[_0xf04c('0x6b')][_0xf04c('0x6c')]()+']',_0xf04c('0x4c'));_0x10b7a9[_0xf04c('0x4d')]=util[_0xf04c('0xd')](_0xf04c('0x4e'),_0x2a54de[_0xf04c('0x49')],_0x10b7a9['uniqueid'],md5(_0x10b7a9[_0xf04c('0x4f')]));}else{_0x10b7a9['recordingURL']='';}headers[_0xf04c('0x50')]=getAuth(_0x2a54de);return getUser(_0x2a54de)['then'](function(_0x136704){_0x9043bb=_0x136704;logger[_0xf04c('0xb')]('The\x20User\x20ID\x20is:',_0x9043bb['id']);return getEndUser(_0x2a54de,_0x10b7a9[_0xf04c('0x53')],_0x10b7a9['calleridnum']);})[_0xf04c('0x17')](function(_0x5acfd8){_0x24a8d6=_0x5acfd8;logger[_0xf04c('0xb')](_0xf04c('0x54'),_0x24a8d6['id']);return getTicket(_0x2a54de,_0x9043bb,_0x24a8d6,_0x574b91,_0x10b7a9);})['then'](function(_0x341738){if(_0x341738){logger['info']('The\x20Ticket\x20ID\x20is:',_0x341738['id']);}})[_0xf04c('0x60')](function(_0xfb513){logger[_0xf04c('0x5e')]('['+_0x10b7a9[_0xf04c('0x6b')]['toUpperCase']()+']'+_0xf04c('0x6d'),util['inspect'](_0xfb513,{'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 3f1662e..5cd2377 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 _0x3481=['Descriptions','Full_Name','Last_Name','What_Id','First_Name','talktime','Call_Duration','utc','mm:ss','endtime','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','connect','rejected','Abandoned','timeout','Call_Start_Time','agentcalledAt','Call_Type','merge','stack','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','/crm/EntityInfo.do?module=Calls&id=','toUpperCase','lastevent','lodash','request-promise','md5','moment','ioredis','bluebird','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','forEach','includes','picklist','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','Failing\x20creating\x20the\x20access_token','info','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','catch','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','Contacts','nothing','lead','administrator','role','Subject','Subjects','getString'];(function(_0x11cae3,_0x24c750){var _0xe6c11f=function(_0x357b7f){while(--_0x357b7f){_0x11cae3['push'](_0x11cae3['shift']());}};_0xe6c11f(++_0x24c750);}(_0x3481,0x159));var _0x1348=function(_0x1d41f4,_0x5f0be5){_0x1d41f4=_0x1d41f4-0x0;var _0x5dceda=_0x3481[_0x1d41f4];return _0x5dceda;};'use strict';var _=require(_0x1348('0x0'));var rp=require(_0x1348('0x1'));var md5=require(_0x1348('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0x1348('0x3'));var Redis=require(_0x1348('0x4'));var BPromise=require(_0x1348('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1348('0x6'));config[_0x1348('0x7')]=_[_0x1348('0x8')](config[_0x1348('0x7')],{'host':_0x1348('0x9'),'port':0x18eb});var io=require(_0x1348('0xa'))(new Redis(config['redis']));function emit(_0x3c1a5b,_0x104100,_0x1ff13a){io['to'](_0x3c1a5b)[_0x1348('0xb')](_0x104100,_0x1ff13a);}function request(_0x4c500c){logger[_0x1348('0xc')]('[HTTP]',JSON[_0x1348('0xd')](_0x4c500c));return rp(_0x4c500c);}function getCustomFields(_0x24f965,_0x440e6b){var _0x36c83b={};if(_0x24f965['length']>0x0){_[_0x1348('0xe')](_0x24f965,function(_0xee00cd){if(_[_0x1348('0xf')](['string',_0x1348('0x10')],_0xee00cd['type'])&&_0xee00cd[_0x1348('0x11')]){_0x36c83b[_0xee00cd['idField']]=_0xee00cd['content'][_0x1348('0x12')]();}else if(_0xee00cd[_0x1348('0x13')]===_0x1348('0x14')&&_0xee00cd['variableName']&&_0xee00cd[_0x1348('0x11')]&&_0x440e6b[_0xee00cd[_0x1348('0x15')]]){_0x36c83b[_0xee00cd['idField']]=_0x440e6b[_0xee00cd[_0x1348('0x15')]]['toString']();}else if(_0xee00cd[_0x1348('0x13')]===_0x1348('0x16')&&_0xee00cd[_0x1348('0x17')]&&_0xee00cd[_0x1348('0x17')][_0x1348('0x18')]&&_0xee00cd[_0x1348('0x11')]&&_0x440e6b[_0xee00cd[_0x1348('0x17')][_0x1348('0x18')][_0x1348('0x19')]()]){_0x36c83b[_0xee00cd['idField']]=_0x440e6b[_0xee00cd[_0x1348('0x17')]['name']['toLowerCase']()][_0x1348('0x12')]();}});}return _0x36c83b;}function getName(_0x24e184){if(_0x24e184[_0x1348('0x1a')]('\x20')>0x0){var _0x3baeb7=_0x24e184[_0x1348('0x1b')](/ (.+)/);if(_0x3baeb7[0x1]){return _0x3baeb7;}}return[_0x24e184,_0x24e184];}var accountsTokens={};function getAccessToken(_0x4e35f3){return new Promise(function(_0xead0be,_0x5bd69b){if(!_[_0x1348('0x1c')](accountsTokens[_0x4e35f3['id']])&&!_[_0x1348('0x1c')](accountsTokens[_0x4e35f3['id']][_0x1348('0x1d')])){if(moment()['isBefore'](accountsTokens[_0x4e35f3['id']][_0x1348('0x1e')])){_0xead0be(accountsTokens[_0x4e35f3['id']][_0x1348('0x1d')]);}}var _0x5219b7;switch(_0x4e35f3[_0x1348('0x1f')]){case'US':_0x5219b7=_0x1348('0x20');break;case'AU':_0x5219b7='https://accounts.zoho.com.au';break;case'EU':_0x5219b7='https://accounts.zoho.eu';break;case'IN':_0x5219b7=_0x1348('0x21');break;case'CN':_0x5219b7=_0x1348('0x22');break;default:_0x5219b7=_0x1348('0x23');break;}var _0x5c809f={'method':_0x1348('0x24'),'uri':_0x5219b7+_0x1348('0x25'),'qs':{'refresh_token':_0x4e35f3[_0x1348('0x26')],'client_id':_0x4e35f3[_0x1348('0x27')],'client_secret':_0x4e35f3[_0x1348('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5c809f)[_0x1348('0x29')](function(_0x5d7fa1){accountsTokens[_0x4e35f3['id']]={'access_token':_0x5d7fa1[_0x1348('0x1d')],'expires_in':moment()[_0x1348('0x2a')](_0x5d7fa1[_0x1348('0x1e')],_0x1348('0x2b'))};_0xead0be(_0x5d7fa1[_0x1348('0x1d')]);})['catch'](function(_0x37cd34){logger['error'](_0x1348('0x2c'),_0x37cd34['stack']);_0x5bd69b(_0x37cd34);});});}function getUser(_0x3da2ac,_0x333503,_0xe9b5bb,_0x3b4a8b){logger[_0x1348('0x2d')]('Search\x20user');return request({'method':_0x1348('0x2e'),'uri':util[_0x1348('0x2f')](_0x1348('0x30'),_0x333503),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x1348('0x31')+_0x3da2ac},'json':!![]})[_0x1348('0x29')](function(_0x982b71){if(_0x982b71[_0x1348('0x32')]){var _0x18a4e2=-0x1;if(_['isArrayLikeObject'](_0x982b71['users'])){if(!_[_0x1348('0x1c')](_0x3b4a8b)){_0x18a4e2=_[_0x1348('0x33')](_0x982b71[_0x1348('0x32')],function(_0x598477){return _0x598477['email']===_0x3b4a8b;});}if(_0x18a4e2>=0x0){logger[_0x1348('0x2d')](_0x1348('0x34'));}else{logger[_0x1348('0x2d')](_0x1348('0x35'));_0x18a4e2=_['findIndex'](_0x982b71[_0x1348('0x32')],function(_0x2a1bbd){return _0x2a1bbd[_0x1348('0x36')][_0x1348('0x18')]===_0x1348('0x37');});}return _0x982b71['users'][_0x18a4e2];}else{if(_0x982b71[_0x1348('0x38')][_0x1348('0x36')][_0x1348('0x18')]===_0x1348('0x37')){logger[_0x1348('0x2d')](_0x1348('0x35'));user=_0x982b71['user'];return user;}else{logger[_0x1348('0x39')](_0x1348('0x3a'),JSON[_0x1348('0xd')](_0x982b71));throw new Error(_0x1348('0x3b')+JSON['stringify'](_0x982b71));}}}else{logger[_0x1348('0x39')](_0x1348('0x3a'),JSON[_0x1348('0xd')](_0x982b71));throw new Error(_0x1348('0x3b')+JSON[_0x1348('0xd')](_0x982b71));}})['catch'](function(_0xfdddfa){console[_0x1348('0x39')](_0xfdddfa);});}function getZohoUser(_0x3b8966,_0x59f350){return new BPromise(function(_0x182b25,_0x40e6c0){request(_0x3b8966)['then'](function(_0x155358){var _0x4aec4d=null;if(_0x155358){_0x4aec4d=_0x155358[_0x1348('0x3c')][0x0];_0x4aec4d[_0x1348('0x3d')]=_0x59f350;}_0x182b25(_0x4aec4d);})[_0x1348('0x3e')](function(_0x3282ac){_0x40e6c0(_0x3282ac);});});}function createEndUser(_0x48f60f,_0x52bfde,_0x535cbe,_0x7002ff,_0x5451cb,_0x2f23a3){var _0x535cbe=getName(_0x535cbe);return request({'method':_0x1348('0x24'),'uri':_0x1348('0x3f')+_0x52bfde+_0x1348('0x40')+_[_0x1348('0x41')](_0x2f23a3[_0x1348('0x42')])+'s','body':{'data':[{'Last_Name':_0x535cbe[0x1],'First_Name':_0x535cbe[0x0],'Phone':_0x7002ff,'Owner':{'name':!_[_0x1348('0x1c')](_0x5451cb['role'][_0x1348('0x18')])?_0x5451cb['role'][_0x1348('0x18')]:!_[_0x1348('0x1c')](_0x5451cb[_0x1348('0x43')])?_0x5451cb[_0x1348('0x43')]+'\x20'+_0x5451cb[_0x1348('0x44')]:_0x5451cb[_0x1348('0x44')],'id':_0x5451cb['id']}}]},'headers':{'Authorization':_0x1348('0x31')+_0x48f60f},'json':!![]})[_0x1348('0x29')](function(_0x47c4ab){if(_0x47c4ab&&_0x47c4ab[_0x1348('0x3c')][0x0][_0x1348('0x45')]===_0x1348('0x46')){var _0x51cc42=_0x47c4ab['data'][0x0][_0x1348('0x47')];_0x51cc42[_0x1348('0x3d')]=_[_0x1348('0x41')](_0x2f23a3[_0x1348('0x42')])+'s';return _0x51cc42;}logger['error'](_0x1348('0x3a'),JSON[_0x1348('0xd')](data));throw new Error(_0x1348('0x48')+JSON[_0x1348('0xd')](data));})['catch'](function(_0x9bb01d){console[_0x1348('0x49')](_0x1348('0x4a'),_0x9bb01d);});}function getEndUser(_0x41f5da,_0x2deed6,_0x5e2e6e,_0x568e25,_0x18644d,_0xe2b92a,_0x36647e){var _0xfe9906={'method':'GET','uri':'','headers':{'Authorization':_0x1348('0x31')+_0x41f5da},'json':!![]};switch(_0x36647e[_0x1348('0x4b')]){case _0x1348('0x4c'):_0xfe9906[_0x1348('0x4d')]=_0x1348('0x3f')+_0x2deed6+_0x1348('0x4e')+_0x18644d+'))';return getZohoUser(_0xfe9906,'Contacts')[_0x1348('0x29')](function(_0xdc0072){if(_0xdc0072)return _0xdc0072;_0xfe9906['uri']=_0x1348('0x3f')+_0x2deed6+_0x1348('0x4f')+_0x18644d+'))';return getZohoUser(_0xfe9906,_0x1348('0x50'))[_0x1348('0x29')](function(_0x5c68ba){if(_0x5c68ba)return _0x5c68ba;if(_0x36647e[_0x1348('0x42')]!='nothing'){return createEndUser(_0x41f5da,_0x2deed6,_0x568e25,_0x18644d,_0xe2b92a,_0x36647e);}else{return{};}});});break;case _0x1348('0x51'):_0xfe9906[_0x1348('0x4d')]=_0x1348('0x3f')+_0x2deed6+_0x1348('0x4e')+_0x18644d+'))';return getZohoUser(_0xfe9906,_0x1348('0x52'))[_0x1348('0x29')](function(_0x40786f){if(_0x40786f)return _0x40786f;if(_0x36647e['moduleCreate']!=_0x1348('0x53')){return createEndUser(_0x41f5da,_0x2deed6,_0x568e25,_0x18644d,_0xe2b92a,_0x36647e);}else{return{};}});break;case _0x1348('0x54'):_0xfe9906[_0x1348('0x4d')]=_0x1348('0x3f')+_0x2deed6+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x18644d+'))';return getZohoUser(_0xfe9906,_0x1348('0x50'))[_0x1348('0x29')](function(_0x2c9351){if(_0x2c9351)return _0x2c9351;if(_0x36647e[_0x1348('0x42')]!='nothing'){return createEndUser(_0x41f5da,_0x2deed6,_0x568e25,_0x18644d,_0xe2b92a,_0x36647e);}else{return{};}});break;}}function getCall(_0x9708c3,_0x4a2af9,_0x173fef,_0x5fb858,_0x4f0751,_0x23d4ad,_0x54aa2a,_0x3c3be9){logger['info']('Creating\x20new\x20call...');var _0x3af4fa={};_0x3af4fa['Owner']={'name':!_['isNil'](_0x5fb858['role']['name'])&&!_[_0x1348('0x1c')](_0x5fb858[_0x1348('0x36')]['name'])&&_0x5fb858[_0x1348('0x36')][_0x1348('0x18')]===_0x1348('0x55')?_0x5fb858[_0x1348('0x56')][_0x1348('0x18')]:!_[_0x1348('0x1c')](_0x5fb858[_0x1348('0x43')])?_0x5fb858[_0x1348('0x43')]+'\x20'+_0x5fb858['last_name']:_0x5fb858[_0x1348('0x44')],'id':_0x5fb858['id']};_0x3af4fa[_0x1348('0x57')]=intUtil['getString'](_0x23d4ad[_0x1348('0x58')],_0x54aa2a,'\x20');_0x3af4fa['Description']=intUtil[_0x1348('0x59')](_0x23d4ad[_0x1348('0x5a')],_0x54aa2a,'\x0a');if(_0x4f0751[_0x1348('0x3d')]===_0x1348('0x52')){_0x3af4fa['Who_Id']={'name':!_['isNil'](_0x4f0751[_0x1348('0x5b')])?_0x4f0751[_0x1348('0x5b')]:!_[_0x1348('0x1c')](_0x4f0751['First_Name'])?_0x4f0751['First_Name']+'\x20'+_0x4f0751[_0x1348('0x5c')]:_0x4f0751['Last_Name'],'id':_0x4f0751['id']};}if(_0x4f0751[_0x1348('0x3d')]==='Leads'){_0x3af4fa[_0x1348('0x5d')]={'name':!_[_0x1348('0x1c')](_0x4f0751[_0x1348('0x5b')])?_0x4f0751['Full_Name']:!_[_0x1348('0x1c')](_0x4f0751[_0x1348('0x5e')])?_0x4f0751['First_Name']+'\x20'+_0x4f0751[_0x1348('0x5c')]:_0x4f0751['Last_Name'],'id':_0x4f0751['id']};_0x3af4fa['$se_module']=_[_0x1348('0x41')](_0x4f0751[_0x1348('0x3d')]);}if(_0x54aa2a[_0x1348('0x5f')]){_0x3af4fa[_0x1348('0x60')]=moment[_0x1348('0x61')](parseInt(_0x54aa2a[_0x1348('0x5f')])*0x3e8)[_0x1348('0x2f')](_0x1348('0x62'));}else if(_0x54aa2a['answertime']&&_0x54aa2a[_0x1348('0x63')]){_0x3af4fa[_0x1348('0x60')]=moment[_0x1348('0x61')](moment(_0x54aa2a[_0x1348('0x63')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x54aa2a[_0x1348('0x64')],_0x1348('0x65'))))[_0x1348('0x2f')]('mm:ss');}switch(_0x54aa2a['lastevent']){case _0x1348('0x66'):_0x3af4fa[_0x1348('0x67')]='Called';break;case'complete':case _0x1348('0x68'):_0x3af4fa[_0x1348('0x67')]='Answered';break;case _0x1348('0x69'):_0x3af4fa[_0x1348('0x67')]='Rejected';break;case'abandoned':_0x3af4fa[_0x1348('0x67')]=_0x1348('0x6a');break;case _0x1348('0x6b'):_0x3af4fa['Call_Result']='Timeout';default:}_0x3af4fa[_0x1348('0x6c')]=(_0x3c3be9==='outbound'?moment(_0x54aa2a[_0x1348('0x64')])[_0x1348('0x2f')](_0x1348('0x65')):moment(_0x54aa2a[_0x1348('0x6d')])['format'](_0x1348('0x65')))||moment()[_0x1348('0x2f')](_0x1348('0x65'));_0x3af4fa[_0x1348('0x6e')]=_0x3c3be9||'Inbound';_0x3af4fa=_[_0x1348('0x6f')](_0x3af4fa,getCustomFields(_0x23d4ad['Fields'],_0x54aa2a));return request({'method':_0x1348('0x24'),'uri':'https://www.zohoapis.'+_0x4a2af9+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x9708c3},'body':{'data':[_0x3af4fa]},'json':!![]})[_0x1348('0x29')](function(_0x23d3ae){if(_0x23d3ae&&_0x23d3ae[_0x1348('0x3c')][0x0][_0x1348('0x45')]===_0x1348('0x46')){logger[_0x1348('0x2d')]('Call\x20created!');return{'id':_0x23d3ae['data'][0x0][_0x1348('0x47')]['id']};}})[_0x1348('0x3e')](function(_0x309040){logger[_0x1348('0x2d')]('err',_0x309040[_0x1348('0x70')]);console[_0x1348('0x49')](_0x1348('0x71'),_0x309040);});}exports[_0x1348('0x72')]=function(_0x186b88,_0x113c13,_0x3784ce,_0x11fee8,_0x2407e8,_0x434de6){var _0x368bb9,_0x30535d,_0x3c7dda;_0x434de6[_0x1348('0x73')]=intUtil[_0x1348('0x74')](_0x434de6[_0x1348('0x73')]);_0x434de6[_0x1348('0x75')]=intUtil['stripTrailingSlash'](_0x434de6[_0x1348('0x75')]);if(_0x2407e8&&_0x2407e8[_0x1348('0x76')]){logger[_0x1348('0x2d')]('[QUEUE]',_0x1348('0x77'));_0x113c13['recordingURL']=_0x434de6[_0x1348('0x75')]+_0x1348('0x78')+_0x113c13[_0x1348('0x79')]+_0x1348('0x7a')+md5(_0x113c13[_0x1348('0x79')]);}else{_0x113c13[_0x1348('0x7b')]='';}var _0x3f845e=_0x434de6[_0x1348('0x73')]===_0x1348('0x7c')?'eu':_0x1348('0x7d');return getAccessToken(_0x434de6)[_0x1348('0x29')](function(_0x3fa72d){_0x3c7dda=_0x3fa72d;return getUser(_0x3c7dda,_0x3f845e,_0x434de6,_0x11fee8[_0x1348('0x7e')]);})['then'](function(_0x4cb7ce){_0x368bb9=_0x4cb7ce;logger[_0x1348('0x2d')](_0x1348('0x7f'),_0x368bb9['id']);return getEndUser(_0x3c7dda,_0x3f845e,_0x434de6,_0x113c13[_0x1348('0x80')],_0x113c13[_0x1348('0x81')],_0x368bb9,_0x3784ce);})[_0x1348('0x29')](function(_0x3fa626){_0x30535d=_0x3fa626;return getCall(_0x3c7dda,_0x3f845e,_0x434de6,_0x368bb9,_0x30535d,_0x3784ce,_0x113c13,_0x1348('0x82'));})['then'](function(_0x3d941b){if(_0x3d941b){logger[_0x1348('0x2d')]('The\x20Call\x20ID\x20is:',_0x3d941b['id']);logger[_0x1348('0x2d')](_0x1348('0x83'),_0x1348('0x84'));emit(util['format'](_0x1348('0x85'),_0x11fee8[_0x1348('0x18')]),_0x1348('0x86'),{'uri':_0x1348('0x87')+_0x434de6['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x3d941b['id']});}})['catch'](function(_0x5b0210){logger[_0x1348('0x39')]('[QUEUE]',JSON[_0x1348('0xd')](_0x5b0210));});};exports['outbound']=function(_0x1a960a,_0x20f962,_0x25a46e,_0x3feac9,_0x5798b1,_0xef95b6,_0x5d0d5){var _0x2f72cb,_0x58f4bd,_0x1b7699;_0xef95b6[_0x1348('0x73')]=intUtil[_0x1348('0x74')](_0xef95b6[_0x1348('0x73')]);_0xef95b6[_0x1348('0x75')]=intUtil[_0x1348('0x74')](_0xef95b6['serverUrl']);if(_0x5d0d5&&_0x5d0d5[_0x1348('0x88')]&&_0x5d0d5[_0x1348('0x88')]!==_0x1348('0x89')){logger[_0x1348('0x2d')](_0x1348('0x8a'),'Recording\x20is\x20enabled!');_0x20f962[_0x1348('0x7b')]=_0xef95b6['serverUrl']+'/api/voice/recordings/'+_0x20f962['uniqueid']+_0x1348('0x7a')+md5(_0x20f962[_0x1348('0x79')]);}var _0x17e694=_0xef95b6[_0x1348('0x73')]===_0x1348('0x7c')?'eu':_0x1348('0x7d');return getAccessToken(_0xef95b6)[_0x1348('0x29')](function(_0x53eb1b){_0x1b7699=_0x53eb1b;return getUser(_0x1b7699,_0x17e694,_0xef95b6,_0x3feac9['email']);})[_0x1348('0x29')](function(_0x2069f1){_0x2f72cb=_0x2069f1;logger[_0x1348('0x2d')](_0x1348('0x7f'),_0x2f72cb['id']);return getEndUser(_0x1b7699,_0x17e694,_0xef95b6,_0x20f962['destcalleridname'],_0x20f962[_0x1348('0x8b')],_0x2f72cb,_0x25a46e);})[_0x1348('0x29')](function(_0x57de67){_0x58f4bd=_0x57de67;return getCall(_0x1b7699,_0x17e694,_0xef95b6,_0x2f72cb,_0x58f4bd,_0x25a46e,_0x20f962,_0x1348('0x8c'));})['then'](function(_0x4f6eab){if(_0x4f6eab){logger[_0x1348('0x2d')](_0x1348('0x8d'),_0x4f6eab['id']);logger[_0x1348('0x2d')](_0x1348('0x8a'),_0x1348('0x84'));emit(util[_0x1348('0x2f')](_0x1348('0x85'),_0x3feac9[_0x1348('0x18')]),_0x1348('0x86'),{'uri':'https://crm.'+_0xef95b6[_0x1348('0x73')]+_0x1348('0x8e')+_0x4f6eab['id']});}})[_0x1348('0x3e')](function(_0x2f0e12){logger[_0x1348('0x39')](_0x1348('0x8a'),JSON['stringify'](_0x2f0e12));});};exports['unmanaged']=function(_0x41f5ac,_0x2d4c1b,_0x11ee03,_0x3bc64e,_0x67d24d,_0x44faa8){var _0x43b177,_0x5654bf,_0xe47d2e;_0x44faa8[_0x1348('0x73')]=intUtil[_0x1348('0x74')](_0x44faa8[_0x1348('0x73')]);_0x44faa8[_0x1348('0x75')]=intUtil[_0x1348('0x74')](_0x44faa8[_0x1348('0x75')]);if(_0x67d24d&&_0x67d24d['monitor_format']){logger[_0x1348('0x2d')]('['+_0x2d4c1b['lastevent'][_0x1348('0x8f')]()+']',_0x1348('0x77'));_0x2d4c1b[_0x1348('0x7b')]=_0x44faa8['serverUrl']+_0x1348('0x78')+_0x2d4c1b[_0x1348('0x79')]+_0x1348('0x7a')+md5(_0x2d4c1b[_0x1348('0x79')]);}else{_0x2d4c1b[_0x1348('0x7b')]='';}var _0x1e20b9=_0x44faa8[_0x1348('0x73')]==='zoho.eu'?'eu':_0x1348('0x7d');return getAccessToken(_0x44faa8)[_0x1348('0x29')](function(_0x1b2439){_0xe47d2e=_0x1b2439;return getUser(_0xe47d2e,_0x1e20b9,_0x44faa8);})[_0x1348('0x29')](function(_0x162c14){_0x43b177=_0x162c14;logger[_0x1348('0x2d')](_0x1348('0x7f'),_0x43b177['id']);return getEndUser(_0xe47d2e,_0x1e20b9,_0x44faa8,_0x2d4c1b[_0x1348('0x80')],_0x2d4c1b[_0x1348('0x81')],_0x43b177,_0x11ee03);})[_0x1348('0x29')](function(_0x48120b){_0x5654bf=_0x48120b;return getCall(_0xe47d2e,_0x1e20b9,_0x44faa8,_0x43b177,_0x5654bf,_0x11ee03,_0x2d4c1b,_0x1348('0x82'));})[_0x1348('0x29')](function(_0x34656b){if(_0x34656b){logger[_0x1348('0x2d')]('The\x20Call\x20ID\x20is:',_0x34656b['id']);}})['catch'](function(_0x1d5aa3){logger[_0x1348('0x39')]('['+_0x2d4c1b[_0x1348('0x90')][_0x1348('0x8f')]()+']',JSON[_0x1348('0xd')](_0x1d5aa3));});}; \ No newline at end of file +var _0xdeaf=['toLowerCase','indexOf','isNil','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','refresh_token','then','add','expires_in','seconds','Failing\x20creating\x20the\x20access_token','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','profile','Using\x20the\x20admin\x20account!','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','catch','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','Contacts','uri','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','$se_module','Call_Duration','utc','talktime','answertime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','format','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','host','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','destcalleridname','[OUTBOUND]','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','moment','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','includes','string','picklist','content','variable','variableName','idField','toString','type','customVariable','Variable','name'];(function(_0x16150f,_0x1921f3){var _0x1f46bd=function(_0x5313d){while(--_0x5313d){_0x16150f['push'](_0x16150f['shift']());}};_0x1f46bd(++_0x1921f3);}(_0xdeaf,0x19e));var _0xfdea=function(_0x40174f,_0x3a6751){_0x40174f=_0x40174f-0x0;var _0x40717c=_0xdeaf[_0x40174f];return _0x40717c;};'use strict';var _=require(_0xfdea('0x0'));var rp=require(_0xfdea('0x1'));var md5=require(_0xfdea('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0xfdea('0x3'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xfdea('0x4'));config[_0xfdea('0x5')]=_[_0xfdea('0x6')](config[_0xfdea('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xfdea('0x7'))(new Redis(config[_0xfdea('0x5')]));function emit(_0x117bca,_0x473992,_0x4ca109){io['to'](_0x117bca)[_0xfdea('0x8')](_0x473992,_0x4ca109);}function request(_0x4a12ef){logger[_0xfdea('0x9')](_0xfdea('0xa'),JSON[_0xfdea('0xb')](_0x4a12ef));return rp(_0x4a12ef);}function getCustomFields(_0x25efc6,_0x2095bb){var _0x4f0917={};if(_0x25efc6['length']>0x0){_['forEach'](_0x25efc6,function(_0x6da5b0){if(_[_0xfdea('0xc')]([_0xfdea('0xd'),_0xfdea('0xe')],_0x6da5b0['type'])&&_0x6da5b0['idField']){_0x4f0917[_0x6da5b0['idField']]=_0x6da5b0[_0xfdea('0xf')]['toString']();}else if(_0x6da5b0['type']===_0xfdea('0x10')&&_0x6da5b0[_0xfdea('0x11')]&&_0x6da5b0[_0xfdea('0x12')]&&_0x2095bb[_0x6da5b0[_0xfdea('0x11')]]){_0x4f0917[_0x6da5b0[_0xfdea('0x12')]]=_0x2095bb[_0x6da5b0[_0xfdea('0x11')]][_0xfdea('0x13')]();}else if(_0x6da5b0[_0xfdea('0x14')]===_0xfdea('0x15')&&_0x6da5b0[_0xfdea('0x16')]&&_0x6da5b0[_0xfdea('0x16')]['name']&&_0x6da5b0[_0xfdea('0x12')]&&_0x2095bb[_0x6da5b0[_0xfdea('0x16')][_0xfdea('0x17')][_0xfdea('0x18')]()]){_0x4f0917[_0x6da5b0[_0xfdea('0x12')]]=_0x2095bb[_0x6da5b0[_0xfdea('0x16')]['name']['toLowerCase']()][_0xfdea('0x13')]();}});}return _0x4f0917;}function getName(_0x215efa){if(_0x215efa[_0xfdea('0x19')]('\x20')>0x0){var _0x169a4a=_0x215efa['split'](/ (.+)/);if(_0x169a4a[0x1]){return _0x169a4a;}}return[_0x215efa,_0x215efa];}var accountsTokens={};function getAccessToken(_0xd1776e){return new Promise(function(_0x1c7c82,_0x558ba2){if(!_[_0xfdea('0x1a')](accountsTokens[_0xd1776e['id']])&&!_[_0xfdea('0x1a')](accountsTokens[_0xd1776e['id']][_0xfdea('0x1b')])){if(moment()['isBefore'](accountsTokens[_0xd1776e['id']]['expires_in'])){_0x1c7c82(accountsTokens[_0xd1776e['id']]['access_token']);}}var _0x249f4e;switch(_0xd1776e[_0xfdea('0x1c')]){case'US':_0x249f4e=_0xfdea('0x1d');break;case'AU':_0x249f4e=_0xfdea('0x1e');break;case'EU':_0x249f4e=_0xfdea('0x1f');break;case'IN':_0x249f4e='https://accounts.zoho.in';break;case'CN':_0x249f4e='https://accounts.zoho.com.cn';break;default:_0x249f4e=_0xfdea('0x1f');break;}var _0x26edde={'method':_0xfdea('0x20'),'uri':_0x249f4e+_0xfdea('0x21'),'qs':{'refresh_token':_0xd1776e[_0xfdea('0x22')],'client_id':_0xd1776e['clientId'],'client_secret':_0xd1776e['clientSecret'],'grant_type':_0xfdea('0x23')},'json':!![]};return rp(_0x26edde)[_0xfdea('0x24')](function(_0xfb5168){accountsTokens[_0xd1776e['id']]={'access_token':_0xfb5168[_0xfdea('0x1b')],'expires_in':moment()[_0xfdea('0x25')](_0xfb5168[_0xfdea('0x26')],_0xfdea('0x27'))};_0x1c7c82(_0xfb5168[_0xfdea('0x1b')]);})['catch'](function(_0x2b3cf5){logger['error'](_0xfdea('0x28'),_0x2b3cf5['stack']);_0x558ba2(_0x2b3cf5);});});}function getUser(_0x35d15a,_0x5f55a6,_0x2c2a6f,_0x411414){logger[_0xfdea('0x29')](_0xfdea('0x2a'));return request({'method':'GET','uri':util['format'](_0xfdea('0x2b'),_0x5f55a6),'qs':{'type':_0xfdea('0x2c')},'headers':{'Authorization':_0xfdea('0x2d')+_0x35d15a},'json':!![]})[_0xfdea('0x24')](function(_0x54afa9){if(_0x54afa9[_0xfdea('0x2e')]){var _0x32b330=-0x1;if(_[_0xfdea('0x2f')](_0x54afa9[_0xfdea('0x2e')])){if(!_[_0xfdea('0x1a')](_0x411414)){_0x32b330=_[_0xfdea('0x30')](_0x54afa9[_0xfdea('0x2e')],function(_0x3dae41){return _0x3dae41['email']===_0x411414;});}if(_0x32b330>=0x0){logger[_0xfdea('0x29')]('Agent\x20found!');}else{logger['info']('Using\x20the\x20admin\x20account!');_0x32b330=_[_0xfdea('0x30')](_0x54afa9[_0xfdea('0x2e')],function(_0x2ff6a1){return _0x2ff6a1[_0xfdea('0x31')]['name']==='Administrator';});}return _0x54afa9[_0xfdea('0x2e')][_0x32b330];}else{if(_0x54afa9['user'][_0xfdea('0x31')][_0xfdea('0x17')]==='Administrator'){logger[_0xfdea('0x29')](_0xfdea('0x32'));user=_0x54afa9[_0xfdea('0x33')];return user;}else{logger[_0xfdea('0x34')](_0xfdea('0x35'),JSON['stringify'](_0x54afa9));throw new Error(_0xfdea('0x36')+JSON[_0xfdea('0xb')](_0x54afa9));}}}else{logger[_0xfdea('0x34')](_0xfdea('0x35'),JSON['stringify'](_0x54afa9));throw new Error(_0xfdea('0x36')+JSON[_0xfdea('0xb')](_0x54afa9));}})['catch'](function(_0x4163c6){console[_0xfdea('0x34')](_0x4163c6);});}function getZohoUser(_0x575ce7,_0xc269a7){return new BPromise(function(_0x58b401,_0x13ebc6){request(_0x575ce7)[_0xfdea('0x24')](function(_0x4da1f8){var _0x41e123=null;if(_0x4da1f8){_0x41e123=_0x4da1f8[_0xfdea('0x37')][0x0];_0x41e123[_0xfdea('0x38')]=_0xc269a7;}_0x58b401(_0x41e123);})[_0xfdea('0x39')](function(_0x5ebcc9){_0x13ebc6(_0x5ebcc9);});});}function createEndUser(_0x2a5c28,_0x3cfcc4,_0xd0cfac,_0x45d23e,_0x47f5ec,_0x3cd96c){var _0xd0cfac=getName(_0xd0cfac);return request({'method':'POST','uri':_0xfdea('0x3a')+_0x3cfcc4+_0xfdea('0x3b')+_[_0xfdea('0x3c')](_0x3cd96c[_0xfdea('0x3d')])+'s','body':{'data':[{'Last_Name':_0xd0cfac[0x1],'First_Name':_0xd0cfac[0x0],'Phone':_0x45d23e,'Owner':{'name':!_[_0xfdea('0x1a')](_0x47f5ec[_0xfdea('0x3e')][_0xfdea('0x17')])?_0x47f5ec[_0xfdea('0x3e')][_0xfdea('0x17')]:!_[_0xfdea('0x1a')](_0x47f5ec[_0xfdea('0x3f')])?_0x47f5ec[_0xfdea('0x3f')]+'\x20'+_0x47f5ec[_0xfdea('0x40')]:_0x47f5ec['last_name'],'id':_0x47f5ec['id']}}]},'headers':{'Authorization':_0xfdea('0x2d')+_0x2a5c28},'json':!![]})[_0xfdea('0x24')](function(_0x529779){if(_0x529779&&_0x529779[_0xfdea('0x37')][0x0][_0xfdea('0x41')]===_0xfdea('0x42')){var _0x15c2c7=_0x529779[_0xfdea('0x37')][0x0][_0xfdea('0x43')];_0x15c2c7[_0xfdea('0x38')]=_[_0xfdea('0x3c')](_0x3cd96c['moduleCreate'])+'s';return _0x15c2c7;}logger['error'](_0xfdea('0x35'),JSON[_0xfdea('0xb')](data));throw new Error(_0xfdea('0x44')+JSON[_0xfdea('0xb')](data));})[_0xfdea('0x39')](function(_0x8b34aa){console[_0xfdea('0x45')](_0xfdea('0x46'),_0x8b34aa);});}function getEndUser(_0x5eb977,_0x200d0b,_0x39da48,_0x3258d8,_0x2b1e5c,_0x3e56c6,_0x4fa78a){var _0x1a4d30={'method':_0xfdea('0x47'),'uri':'','headers':{'Authorization':_0xfdea('0x2d')+_0x5eb977},'json':!![]};switch(_0x4fa78a[_0xfdea('0x48')]){case _0xfdea('0x49'):_0x1a4d30['uri']=_0xfdea('0x3a')+_0x200d0b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2b1e5c+'))';return getZohoUser(_0x1a4d30,_0xfdea('0x4a'))[_0xfdea('0x24')](function(_0x1c71d7){if(_0x1c71d7)return _0x1c71d7;_0x1a4d30[_0xfdea('0x4b')]=_0xfdea('0x3a')+_0x200d0b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2b1e5c+'))';return getZohoUser(_0x1a4d30,_0xfdea('0x4c'))[_0xfdea('0x24')](function(_0x379b5e){if(_0x379b5e)return _0x379b5e;if(_0x4fa78a[_0xfdea('0x3d')]!=_0xfdea('0x4d')){return createEndUser(_0x5eb977,_0x200d0b,_0x3258d8,_0x2b1e5c,_0x3e56c6,_0x4fa78a);}else{return{};}});});break;case'contact':_0x1a4d30[_0xfdea('0x4b')]=_0xfdea('0x3a')+_0x200d0b+_0xfdea('0x4e')+_0x2b1e5c+'))';return getZohoUser(_0x1a4d30,'Contacts')['then'](function(_0x32e224){if(_0x32e224)return _0x32e224;if(_0x4fa78a[_0xfdea('0x3d')]!=_0xfdea('0x4d')){return createEndUser(_0x5eb977,_0x200d0b,_0x3258d8,_0x2b1e5c,_0x3e56c6,_0x4fa78a);}else{return{};}});break;case _0xfdea('0x4f'):_0x1a4d30[_0xfdea('0x4b')]=_0xfdea('0x3a')+_0x200d0b+_0xfdea('0x50')+_0x2b1e5c+'))';return getZohoUser(_0x1a4d30,_0xfdea('0x4c'))['then'](function(_0x35b33b){if(_0x35b33b)return _0x35b33b;if(_0x4fa78a[_0xfdea('0x3d')]!=_0xfdea('0x4d')){return createEndUser(_0x5eb977,_0x200d0b,_0x3258d8,_0x2b1e5c,_0x3e56c6,_0x4fa78a);}else{return{};}});break;}}function getCall(_0x27570d,_0x1a1403,_0x15ba82,_0x566107,_0xbda88a,_0x3cf776,_0x4252a2,_0x37fc2f){logger[_0xfdea('0x29')](_0xfdea('0x51'));var _0x441ced={};_0x441ced['Owner']={'name':!_['isNil'](_0x566107[_0xfdea('0x3e')][_0xfdea('0x17')])&&!_[_0xfdea('0x1a')](_0x566107[_0xfdea('0x31')][_0xfdea('0x17')])&&_0x566107[_0xfdea('0x31')][_0xfdea('0x17')]==='administrator'?_0x566107[_0xfdea('0x3e')]['name']:!_[_0xfdea('0x1a')](_0x566107['first_name'])?_0x566107['first_name']+'\x20'+_0x566107[_0xfdea('0x40')]:_0x566107[_0xfdea('0x40')],'id':_0x566107['id']};_0x441ced[_0xfdea('0x52')]=intUtil[_0xfdea('0x53')](_0x3cf776[_0xfdea('0x54')],_0x4252a2,'\x20');_0x441ced[_0xfdea('0x55')]=intUtil[_0xfdea('0x53')](_0x3cf776['Descriptions'],_0x4252a2,'\x0a');if(_0xbda88a[_0xfdea('0x38')]===_0xfdea('0x4a')){_0x441ced[_0xfdea('0x56')]={'name':!_[_0xfdea('0x1a')](_0xbda88a[_0xfdea('0x57')])?_0xbda88a[_0xfdea('0x57')]:!_[_0xfdea('0x1a')](_0xbda88a[_0xfdea('0x58')])?_0xbda88a[_0xfdea('0x58')]+'\x20'+_0xbda88a[_0xfdea('0x59')]:_0xbda88a[_0xfdea('0x59')],'id':_0xbda88a['id']};}if(_0xbda88a[_0xfdea('0x38')]===_0xfdea('0x4c')){_0x441ced['What_Id']={'name':!_[_0xfdea('0x1a')](_0xbda88a[_0xfdea('0x57')])?_0xbda88a[_0xfdea('0x57')]:!_[_0xfdea('0x1a')](_0xbda88a[_0xfdea('0x58')])?_0xbda88a['First_Name']+'\x20'+_0xbda88a[_0xfdea('0x59')]:_0xbda88a['Last_Name'],'id':_0xbda88a['id']};_0x441ced[_0xfdea('0x5a')]=_['startCase'](_0xbda88a['enduserType']);}if(_0x4252a2['talktime']){_0x441ced[_0xfdea('0x5b')]=moment[_0xfdea('0x5c')](parseInt(_0x4252a2[_0xfdea('0x5d')])*0x3e8)['format']('mm:ss');}else if(_0x4252a2[_0xfdea('0x5e')]&&_0x4252a2['endtime']){_0x441ced[_0xfdea('0x5b')]=moment[_0xfdea('0x5c')](moment(_0x4252a2['endtime'],_0xfdea('0x5f'))[_0xfdea('0x60')](moment(_0x4252a2[_0xfdea('0x61')],_0xfdea('0x5f'))))['format']('mm:ss');}switch(_0x4252a2['lastevent']){case'called':_0x441ced[_0xfdea('0x62')]=_0xfdea('0x63');break;case _0xfdea('0x64'):case _0xfdea('0x65'):_0x441ced[_0xfdea('0x62')]=_0xfdea('0x66');break;case _0xfdea('0x67'):_0x441ced[_0xfdea('0x62')]=_0xfdea('0x68');break;case _0xfdea('0x69'):_0x441ced[_0xfdea('0x62')]='Abandoned';break;case'timeout':_0x441ced[_0xfdea('0x62')]=_0xfdea('0x6a');default:}_0x441ced[_0xfdea('0x6b')]=(_0x37fc2f===_0xfdea('0x6c')?moment(_0x4252a2[_0xfdea('0x61')])['format'](_0xfdea('0x5f')):moment(_0x4252a2[_0xfdea('0x6d')])[_0xfdea('0x6e')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xfdea('0x6e')](_0xfdea('0x5f'));_0x441ced[_0xfdea('0x6f')]=_0x37fc2f||_0xfdea('0x70');_0x441ced=_[_0xfdea('0x71')](_0x441ced,getCustomFields(_0x3cf776[_0xfdea('0x72')],_0x4252a2));return request({'method':_0xfdea('0x20'),'uri':_0xfdea('0x3a')+_0x1a1403+_0xfdea('0x73'),'headers':{'Authorization':_0xfdea('0x2d')+_0x27570d},'body':{'data':[_0x441ced]},'json':!![]})[_0xfdea('0x24')](function(_0x39a72b){if(_0x39a72b&&_0x39a72b[_0xfdea('0x37')][0x0][_0xfdea('0x41')]==='SUCCESS'){logger[_0xfdea('0x29')](_0xfdea('0x74'));return{'id':_0x39a72b['data'][0x0][_0xfdea('0x43')]['id']};}})[_0xfdea('0x39')](function(_0x4c9bdc){logger[_0xfdea('0x29')](_0xfdea('0x75'),_0x4c9bdc['stack']);console[_0xfdea('0x45')]('err',_0x4c9bdc);});}exports[_0xfdea('0x76')]=function(_0x1be7de,_0x5cc90d,_0x3d963a,_0x2087e9,_0x2c146d,_0x1cefcc){var _0x421253,_0x28c9fd,_0x2fb82c;_0x1cefcc['host']=intUtil[_0xfdea('0x77')](_0x1cefcc['host']);_0x1cefcc['serverUrl']=intUtil['stripTrailingSlash'](_0x1cefcc[_0xfdea('0x78')]);if(_0x2c146d&&_0x2c146d[_0xfdea('0x79')]){logger[_0xfdea('0x29')]('[QUEUE]',_0xfdea('0x7a'));_0x5cc90d[_0xfdea('0x7b')]=_0x1cefcc[_0xfdea('0x78')]+_0xfdea('0x7c')+_0x5cc90d[_0xfdea('0x7d')]+_0xfdea('0x7e')+md5(_0x5cc90d[_0xfdea('0x7d')]);}else{_0x5cc90d['recordingURL']='';}var _0x49b70f=_0x1cefcc['host']===_0xfdea('0x7f')?'eu':_0xfdea('0x80');return getAccessToken(_0x1cefcc)[_0xfdea('0x24')](function(_0x433c39){_0x2fb82c=_0x433c39;return getUser(_0x2fb82c,_0x49b70f,_0x1cefcc,_0x2087e9[_0xfdea('0x81')]);})[_0xfdea('0x24')](function(_0x4dd01e){_0x421253=_0x4dd01e;logger[_0xfdea('0x29')](_0xfdea('0x82'),_0x421253['id']);return getEndUser(_0x2fb82c,_0x49b70f,_0x1cefcc,_0x5cc90d[_0xfdea('0x83')],_0x5cc90d['calleridnum'],_0x421253,_0x3d963a);})[_0xfdea('0x24')](function(_0x2f2236){_0x28c9fd=_0x2f2236;return getCall(_0x2fb82c,_0x49b70f,_0x1cefcc,_0x421253,_0x28c9fd,_0x3d963a,_0x5cc90d,_0xfdea('0x70'));})['then'](function(_0x6141c0){if(_0x6141c0){logger['info'](_0xfdea('0x84'),_0x6141c0['id']);logger[_0xfdea('0x29')](_0xfdea('0x85'),_0xfdea('0x86'));emit(util['format'](_0xfdea('0x87'),_0x2087e9[_0xfdea('0x17')]),_0xfdea('0x88'),{'uri':_0xfdea('0x89')+_0x1cefcc[_0xfdea('0x8a')]+_0xfdea('0x8b')+_0x6141c0['id']});}})[_0xfdea('0x39')](function(_0x4c8dc6){logger['error'](_0xfdea('0x85'),JSON[_0xfdea('0xb')](_0x4c8dc6));});};exports[_0xfdea('0x6c')]=function(_0x2683de,_0x4cc8cd,_0x3e0887,_0x16b51d,_0x1b4e4d,_0x55e25a,_0x228702){var _0x170f20,_0x2335c1,_0xfdf07e;_0x55e25a[_0xfdea('0x8a')]=intUtil[_0xfdea('0x77')](_0x55e25a[_0xfdea('0x8a')]);_0x55e25a[_0xfdea('0x78')]=intUtil[_0xfdea('0x77')](_0x55e25a[_0xfdea('0x78')]);if(_0x228702&&_0x228702[_0xfdea('0x8c')]&&_0x228702[_0xfdea('0x8c')]!=='none'){logger[_0xfdea('0x29')]('[OUTBOUND]',_0xfdea('0x7a'));_0x4cc8cd['recordingURL']=_0x55e25a['serverUrl']+_0xfdea('0x7c')+_0x4cc8cd[_0xfdea('0x7d')]+_0xfdea('0x7e')+md5(_0x4cc8cd[_0xfdea('0x7d')]);}var _0x39ac69=_0x55e25a['host']===_0xfdea('0x7f')?'eu':_0xfdea('0x80');return getAccessToken(_0x55e25a)[_0xfdea('0x24')](function(_0x14b1bc){_0xfdf07e=_0x14b1bc;return getUser(_0xfdf07e,_0x39ac69,_0x55e25a,_0x16b51d[_0xfdea('0x81')]);})['then'](function(_0x2b05c9){_0x170f20=_0x2b05c9;logger[_0xfdea('0x29')](_0xfdea('0x82'),_0x170f20['id']);return getEndUser(_0xfdf07e,_0x39ac69,_0x55e25a,_0x4cc8cd[_0xfdea('0x8d')],_0x4cc8cd['destcalleridnum'],_0x170f20,_0x3e0887);})[_0xfdea('0x24')](function(_0x5cd845){_0x2335c1=_0x5cd845;return getCall(_0xfdf07e,_0x39ac69,_0x55e25a,_0x170f20,_0x2335c1,_0x3e0887,_0x4cc8cd,'Outbound');})[_0xfdea('0x24')](function(_0x2f4ae2){if(_0x2f4ae2){logger[_0xfdea('0x29')](_0xfdea('0x84'),_0x2f4ae2['id']);logger['info'](_0xfdea('0x8e'),_0xfdea('0x86'));emit(util[_0xfdea('0x6e')](_0xfdea('0x87'),_0x16b51d[_0xfdea('0x17')]),_0xfdea('0x88'),{'uri':_0xfdea('0x89')+_0x55e25a[_0xfdea('0x8a')]+_0xfdea('0x8b')+_0x2f4ae2['id']});}})[_0xfdea('0x39')](function(_0x131d03){logger[_0xfdea('0x34')](_0xfdea('0x8e'),JSON[_0xfdea('0xb')](_0x131d03));});};exports[_0xfdea('0x8f')]=function(_0x1eb091,_0x1912db,_0x218ad4,_0x1bbc8d,_0x1a7733,_0x2b2051){var _0x10629c,_0x12b119,_0x23a347;_0x2b2051['host']=intUtil[_0xfdea('0x77')](_0x2b2051[_0xfdea('0x8a')]);_0x2b2051[_0xfdea('0x78')]=intUtil[_0xfdea('0x77')](_0x2b2051[_0xfdea('0x78')]);if(_0x1a7733&&_0x1a7733[_0xfdea('0x79')]){logger['info']('['+_0x1912db['lastevent'][_0xfdea('0x90')]()+']',_0xfdea('0x7a'));_0x1912db[_0xfdea('0x7b')]=_0x2b2051[_0xfdea('0x78')]+_0xfdea('0x7c')+_0x1912db['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x1912db[_0xfdea('0x7d')]);}else{_0x1912db[_0xfdea('0x7b')]='';}var _0x183680=_0x2b2051[_0xfdea('0x8a')]===_0xfdea('0x7f')?'eu':_0xfdea('0x80');return getAccessToken(_0x2b2051)[_0xfdea('0x24')](function(_0x22ef3a){_0x23a347=_0x22ef3a;return getUser(_0x23a347,_0x183680,_0x2b2051);})[_0xfdea('0x24')](function(_0x453270){_0x10629c=_0x453270;logger[_0xfdea('0x29')](_0xfdea('0x82'),_0x10629c['id']);return getEndUser(_0x23a347,_0x183680,_0x2b2051,_0x1912db[_0xfdea('0x83')],_0x1912db['calleridnum'],_0x10629c,_0x218ad4);})[_0xfdea('0x24')](function(_0x1ebcac){_0x12b119=_0x1ebcac;return getCall(_0x23a347,_0x183680,_0x2b2051,_0x10629c,_0x12b119,_0x218ad4,_0x1912db,_0xfdea('0x70'));})['then'](function(_0xab91a9){if(_0xab91a9){logger[_0xfdea('0x29')](_0xfdea('0x84'),_0xab91a9['id']);}})[_0xfdea('0x39')](function(_0x412b9d){logger[_0xfdea('0x34')]('['+_0x1912db[_0xfdea('0x91')]['toUpperCase']()+']',JSON['stringify'](_0x412b9d));});}; \ 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 fe387f1..017cfe5 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 _0x3991=['render','exec','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','data2','Script','data3'];(function(_0xdd1f52,_0x227e9e){var _0x368782=function(_0x480309){while(--_0x480309){_0xdd1f52['push'](_0xdd1f52['shift']());}};_0x368782(++_0x227e9e);}(_0x3991,0x7b));var _0x1399=function(_0x39ee52,_0x25f753){_0x39ee52=_0x39ee52-0x0;var _0xc65d3f=_0x3991[_0x39ee52];return _0xc65d3f;};'use strict';var util=require('util');var sh=require(_0x1399('0x0'));var Mustache=require(_0x1399('0x1'));var logger=require(_0x1399('0x2'))(_0x1399('0x3'));exports['exec']=function(_0x3a4f03,_0xb65f77){var _0x5357cf=_0x3a4f03[_0x1399('0x4')]?_0x3a4f03[_0x1399('0x4')]:_0x1399('0x5');var _0x58abee=_0x3a4f03[_0x1399('0x6')]?Mustache[_0x1399('0x7')](_0x3a4f03['data3'],_0xb65f77):_0xb65f77;sh[_0x1399('0x8')](_0x58abee,function(_0x4ab3a4,_0x4cf44d,_0x2b1149){if(_0x4ab3a4!==0x0){logger['error'](util['format'](_0x1399('0x9'),_0x5357cf,_0x58abee,_0x4ab3a4,_0x2b1149));}else{logger[_0x1399('0xa')](util[_0x1399('0xb')](_0x1399('0xc'),_0x5357cf,_0x58abee,_0x4cf44d));}});}; \ No newline at end of file +var _0xd3d2=['data3','exec','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','data2','Script'];(function(_0x4883d4,_0x1b9087){var _0x2de58c=function(_0x30059e){while(--_0x30059e){_0x4883d4['push'](_0x4883d4['shift']());}};_0x2de58c(++_0x1b9087);}(_0xd3d2,0x1aa));var _0x2d3d=function(_0x1d4f24,_0x5ee686){_0x1d4f24=_0x1d4f24-0x0;var _0x43f1fc=_0xd3d2[_0x1d4f24];return _0x43f1fc;};'use strict';var util=require(_0x2d3d('0x0'));var sh=require(_0x2d3d('0x1'));var Mustache=require('mustache');var logger=require(_0x2d3d('0x2'))(_0x2d3d('0x3'));exports['exec']=function(_0x211e60,_0x19bbf1){var _0x34235f=_0x211e60[_0x2d3d('0x4')]?_0x211e60[_0x2d3d('0x4')]:_0x2d3d('0x5');var _0x1b0ca3=_0x211e60[_0x2d3d('0x6')]?Mustache['render'](_0x211e60[_0x2d3d('0x6')],_0x19bbf1):_0x19bbf1;sh[_0x2d3d('0x7')](_0x1b0ca3,function(_0x458da3,_0x42c20d,_0x3166fe){if(_0x458da3!==0x0){logger[_0x2d3d('0x8')](util['format'](_0x2d3d('0x9'),_0x34235f,_0x1b0ca3,_0x458da3,_0x3166fe));}else{logger['info'](util[_0x2d3d('0xa')](_0x2d3d('0xb'),_0x34235f,_0x1b0ca3,_0x42c20d));}});}; \ 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 dd54d48..8298f00 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 _0xae18=['DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','lodash','mustache','trigger','exec','data1','toUpperCase','render','data5','headers','data6','parse','stack','GET'];(function(_0x4ded16,_0x23fcbf){var _0x4a525a=function(_0x2c6b5e){while(--_0x2c6b5e){_0x4ded16['push'](_0x4ded16['shift']());}};_0x4a525a(++_0x23fcbf);}(_0xae18,0xc9));var _0x8ae1=function(_0x6d4a24,_0x59fc17){_0x6d4a24=_0x6d4a24-0x0;var _0x2f4b8b=_0xae18[_0x6d4a24];return _0x2f4b8b;};'use strict';var rp=require(_0x8ae1('0x0'));var util=require(_0x8ae1('0x1'));var _=require(_0x8ae1('0x2'));var Mustache=require(_0x8ae1('0x3'));var logger=require('../../../../config/logger')(_0x8ae1('0x4'));exports[_0x8ae1('0x5')]=function(_0x1f45d0,_0x179b59){var _0x4e7fe0,_0x243398;var _0xd73fb4={'method':_0x1f45d0[_0x8ae1('0x6')][_0x8ae1('0x7')](),'uri':Mustache[_0x8ae1('0x8')](_0x1f45d0['data2'],_0x179b59),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1f45d0['data5'])==='number'&&parseInt(_0x1f45d0['data5'])>=0x1&&parseInt(_0x1f45d0[_0x8ae1('0x9')])<=0xa?parseInt(_0x1f45d0[_0x8ae1('0x9')])*0x3e8:0x5*0x3e8};try{_0xd73fb4[_0x8ae1('0xa')]=_0x1f45d0[_0x8ae1('0xb')]?JSON[_0x8ae1('0xc')](Mustache[_0x8ae1('0x8')](_0x1f45d0[_0x8ae1('0xb')],_0x179b59)):{};}catch(_0x2ef956){logger['error'](_0x2ef956[_0x8ae1('0xd')]);}switch(_0x1f45d0[_0x8ae1('0x6')]['toUpperCase']()){case _0x8ae1('0xe'):case _0x8ae1('0xf'):_0x4e7fe0=null;_0xd73fb4['qs']=_0x179b59;break;case _0x8ae1('0x10'):case _0x8ae1('0x11'):if(_0x1f45d0['data7']){try{_0x4e7fe0=JSON[_0x8ae1('0xc')](Mustache['render'](_0x1f45d0[_0x8ae1('0x12')],_0x179b59));_0xd73fb4[_0x8ae1('0x13')]=_0x4e7fe0;}catch(_0x5db32d){logger[_0x8ae1('0x14')](_0x5db32d['stack']);logger[_0x8ae1('0x14')](_0x8ae1('0x15'));}}else{_0x4e7fe0=_0x179b59;_0xd73fb4['body']=_0x4e7fe0;}break;}logger[_0x8ae1('0x16')](util[_0x8ae1('0x17')](_0x8ae1('0x18'),_0x1f45d0[_0x8ae1('0x6')],_0x1f45d0[_0x8ae1('0x19')],JSON[_0x8ae1('0x1a')](_0xd73fb4)));rp(_0xd73fb4)[_0x8ae1('0x1b')](function(_0x3b5771){_0x4e7fe0=!_[_0x8ae1('0x1c')](_0x4e7fe0)?_0x8ae1('0x1d')+_0x4e7fe0:'';_0x243398=typeof _0x3b5771['body']===_0x8ae1('0x1e')?JSON[_0x8ae1('0x1a')](_0x3b5771[_0x8ae1('0x13')]):_0x3b5771['body'];logger['info'](util[_0x8ae1('0x17')](_0x8ae1('0x1f'),_0x1f45d0[_0x8ae1('0x6')],_0x1f45d0[_0x8ae1('0x19')],_0x3b5771[_0x8ae1('0x20')],_0x243398));})[_0x8ae1('0x21')](function(_0x1dfdb3){logger[_0x8ae1('0x14')](util['format'](_0x8ae1('0x22'),_0x1f45d0[_0x8ae1('0x6')],_0x1f45d0[_0x8ae1('0x19')],_0x1dfdb3[_0x8ae1('0x20')],_0x1dfdb3['name'],_0x1dfdb3[_0x8ae1('0x23')]));});}; \ No newline at end of file +var _0x35ce=['stringify','statusCode','catch','name','util','lodash','mustache','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object'];(function(_0x413b33,_0x43076a){var _0x3d2916=function(_0x33d654){while(--_0x33d654){_0x413b33['push'](_0x413b33['shift']());}};_0x3d2916(++_0x43076a);}(_0x35ce,0x184));var _0xe35c=function(_0x1629f3,_0x4411e1){_0x1629f3=_0x1629f3-0x0;var _0x12c47a=_0x35ce[_0x1629f3];return _0x12c47a;};'use strict';var rp=require('request-promise');var util=require(_0xe35c('0x0'));var _=require(_0xe35c('0x1'));var Mustache=require(_0xe35c('0x2'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x3c8f16,_0x4a21f3){var _0x333517,_0x3dbfa6;var _0x4ac775={'method':_0x3c8f16[_0xe35c('0x3')][_0xe35c('0x4')](),'uri':Mustache[_0xe35c('0x5')](_0x3c8f16[_0xe35c('0x6')],_0x4a21f3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3c8f16[_0xe35c('0x7')])===_0xe35c('0x8')&&parseInt(_0x3c8f16[_0xe35c('0x7')])>=0x1&&parseInt(_0x3c8f16[_0xe35c('0x7')])<=0xa?parseInt(_0x3c8f16['data5'])*0x3e8:0x5*0x3e8};try{_0x4ac775[_0xe35c('0x9')]=_0x3c8f16[_0xe35c('0xa')]?JSON[_0xe35c('0xb')](Mustache['render'](_0x3c8f16[_0xe35c('0xa')],_0x4a21f3)):{};}catch(_0x4dad23){logger['error'](_0x4dad23[_0xe35c('0xc')]);}switch(_0x3c8f16['data1'][_0xe35c('0x4')]()){case _0xe35c('0xd'):case _0xe35c('0xe'):_0x333517=null;_0x4ac775['qs']=_0x4a21f3;break;case _0xe35c('0xf'):case _0xe35c('0x10'):if(_0x3c8f16['data7']){try{_0x333517=JSON[_0xe35c('0xb')](Mustache['render'](_0x3c8f16[_0xe35c('0x11')],_0x4a21f3));_0x4ac775[_0xe35c('0x12')]=_0x333517;}catch(_0x4beae8){logger[_0xe35c('0x13')](_0x4beae8[_0xe35c('0xc')]);logger[_0xe35c('0x13')](_0xe35c('0x14'));}}else{_0x333517=_0x4a21f3;_0x4ac775['body']=_0x333517;}break;}logger[_0xe35c('0x15')](util[_0xe35c('0x16')](_0xe35c('0x17'),_0x3c8f16[_0xe35c('0x3')],_0x3c8f16[_0xe35c('0x6')],JSON['stringify'](_0x4ac775)));rp(_0x4ac775)[_0xe35c('0x18')](function(_0x41b44a){_0x333517=!_[_0xe35c('0x19')](_0x333517)?_0xe35c('0x1a')+_0x333517:'';_0x3dbfa6=typeof _0x41b44a[_0xe35c('0x12')]===_0xe35c('0x1b')?JSON[_0xe35c('0x1c')](_0x41b44a[_0xe35c('0x12')]):_0x41b44a['body'];logger['info'](util[_0xe35c('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3c8f16['data1'],_0x3c8f16[_0xe35c('0x6')],_0x41b44a[_0xe35c('0x1d')],_0x3dbfa6));})[_0xe35c('0x1e')](function(_0x49bdae){logger[_0xe35c('0x13')](util[_0xe35c('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3c8f16[_0xe35c('0x3')],_0x3c8f16[_0xe35c('0x6')],_0x49bdae[_0xe35c('0x1d')],_0x49bdae[_0xe35c('0x1f')],_0x49bdae['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d179fc7..fa11724 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 _0x6090=['error','message','result','exports','jayson/promise','bluebird','../../config/logger','client','Request','request','then','rpc','routing'];(function(_0x41afaa,_0x290e0d){var _0x2b57c6=function(_0x467c9b){while(--_0x467c9b){_0x41afaa['push'](_0x41afaa['shift']());}};_0x2b57c6(++_0x290e0d);}(_0x6090,0x86));var _0x0609=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x6090[_0x24237f];return _0x48298e;};'use strict';var jayson=require(_0x0609('0x0'));var BPromise=require(_0x0609('0x1'));var logger=require(_0x0609('0x2'))('routing');var client=jayson[_0x0609('0x3')]['http']({'port':0x2329});client[_0x0609('0x4')]=function(_0x44ee0e,_0x341194){return new BPromise(function(_0x32b433,_0x267de9){return client[_0x0609('0x5')](_0x44ee0e,_0x341194)[_0x0609('0x6')](function(_0x1af9a6){logger['debug'](_0x0609('0x7'),_0x0609('0x8'),_0x44ee0e,_0x341194,_0x1af9a6);if(_0x1af9a6[_0x0609('0x9')]){logger[_0x0609('0x9')]('rpc',_0x0609('0x8'),_0x44ee0e,_0x1af9a6['error'][_0x0609('0xa')],_0x341194);return _0x267de9(_0x1af9a6['error'][_0x0609('0xa')]);}else{return _0x32b433(_0x1af9a6[_0x0609('0xb')]);}})['catch'](function(_0x42befe){logger[_0x0609('0x9')](_0x0609('0x7'),_0x0609('0x8'),_0x44ee0e,_0x42befe,_0x341194);return _0x267de9(_0x42befe);});});};module[_0x0609('0xc')]=client; \ No newline at end of file +var _0x149b=['routing','client','http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x149b,0x8d));var _0xb149=function(_0x5080d3,_0x1995d6){_0x5080d3=_0x5080d3-0x0;var _0x51af9f=_0x149b[_0x5080d3];return _0x51af9f;};'use strict';var jayson=require(_0xb149('0x0'));var BPromise=require(_0xb149('0x1'));var logger=require(_0xb149('0x2'))(_0xb149('0x3'));var client=jayson[_0xb149('0x4')][_0xb149('0x5')]({'port':0x2329});client[_0xb149('0x6')]=function(_0x4b0b7a,_0x3cabf7){return new BPromise(function(_0x44e8fc,_0x5b77a4){return client[_0xb149('0x7')](_0x4b0b7a,_0x3cabf7)[_0xb149('0x8')](function(_0x29f173){logger[_0xb149('0x9')](_0xb149('0xa'),_0xb149('0x3'),_0x4b0b7a,_0x3cabf7,_0x29f173);if(_0x29f173[_0xb149('0xb')]){logger['error'](_0xb149('0xa'),_0xb149('0x3'),_0x4b0b7a,_0x29f173['error']['message'],_0x3cabf7);return _0x5b77a4(_0x29f173['error'][_0xb149('0xc')]);}else{return _0x44e8fc(_0x29f173[_0xb149('0xd')]);}})[_0xb149('0xe')](function(_0x2a338c){logger[_0xb149('0xb')](_0xb149('0xa'),'routing',_0x4b0b7a,_0x2a338c,_0x3cabf7);return _0x5b77a4(_0x2a338c);});});};module[_0xb149('0xf')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1c9c3a0..2da8b72 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 _0x0d0c=['../../config/logger','email','resolve','then','refresh','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./realtime','./rpc/mailAccount'];(function(_0x116e76,_0x14c0a4){var _0x42cd06=function(_0x15d868){while(--_0x15d868){_0x116e76['push'](_0x116e76['shift']());}};_0x42cd06(++_0x14c0a4);}(_0x0d0c,0x15d));var _0xc0d0=function(_0x15a107,_0x2ddbe1){_0x15a107=_0x15a107-0x0;var _0x2a08fb=_0x0d0c[_0x15a107];return _0x2a08fb;};'use strict';var server=require('./server');var Realtime=require(_0xc0d0('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xc0d0('0x1'));var setting=require('./rpc/setting');var logger=require(_0xc0d0('0x2'))(_0xc0d0('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xc0d0('0x4')]()[_0xc0d0('0x5')](mailAccount['getMailAccounts']())[_0xc0d0('0x5')](realtime['initMailAccounts']())[_0xc0d0('0x5')](function(){email[_0xc0d0('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xc0d0('0x7')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0xc0d0('0x8')]();})[_0xc0d0('0x5')](function(_0x22a9ab){return setInterval(initRealtime,_0x22a9ab[_0xc0d0('0x9')]*0x3e8);})[_0xc0d0('0xa')](function(_0x5ecf04){logger[_0xc0d0('0xb')](_0xc0d0('0xc'),_0x5ecf04);});}main(); \ No newline at end of file +var _0x3190=['listen','getSettings','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x3190,0x1b7));var _0x0319=function(_0x5052e1,_0x2f6ab8){_0x5052e1=_0x5052e1-0x0;var _0x174252=_0x3190[_0x5052e1];return _0x174252;};'use strict';var server=require('./server');var Realtime=require(_0x0319('0x0'));var EmailChannel=require(_0x0319('0x1'));var mailAccount=require(_0x0319('0x2'));var setting=require('./rpc/setting');var logger=require(_0x0319('0x3'))(_0x0319('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x0319('0x5')]()[_0x0319('0x6')](mailAccount[_0x0319('0x7')]())[_0x0319('0x6')](realtime[_0x0319('0x8')]())[_0x0319('0x6')](function(){email[_0x0319('0x9')](realtime[_0x0319('0xa')]);return realtime;});}function main(){return server[_0x0319('0xb')](realtime,email)[_0x0319('0x6')](function(){return initRealtime();})[_0x0319('0x6')](function(){return setting[_0x0319('0xc')]();})[_0x0319('0x6')](function(_0x58fa0f){return setInterval(initRealtime,_0x58fa0f['loginMailFrequency']*0x3e8);})['catch'](function(_0x48fb76){logger[_0x0319('0xd')](_0x0319('0xe'),_0x48fb76);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index c944480..9a70a68 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 _0xcd11=['isNil','refresh','active','service','custom','provider','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','disabled','connected','name','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','sendMail','send','verifySmtp','Smtp','lastSync','verify','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','Imap','status','messageStatus'];(function(_0x531f7,_0x447621){var _0x3bb761=function(_0x50a34c){while(--_0x50a34c){_0x531f7['push'](_0x531f7['shift']());}};_0x3bb761(++_0x447621);}(_0xcd11,0x1ac));var _0x1cd1=function(_0x17819a,_0x5bf69f){_0x17819a=_0x17819a-0x0;var _0x3a2d1e=_0xcd11[_0x17819a];return _0x3a2d1e;};'use strict';var _=require(_0x1cd1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x1cd1('0x1'));var Redis=require(_0x1cd1('0x2'));var config=require(_0x1cd1('0x3'));var logger=require('../../../config/logger')('email');config['redis']=_[_0x1cd1('0x4')](config[_0x1cd1('0x5')],{'host':_0x1cd1('0x6'),'port':0x18eb});var io=require(_0x1cd1('0x7'))(new Redis(config[_0x1cd1('0x5')]));var EmailImap=require(_0x1cd1('0x8'));var EmailSmtp=require(_0x1cd1('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x265f33){logger['info'](_0x1cd1('0xa'));this[_0x1cd1('0xb')]=_0x265f33['mailAccounts'];this[_0x1cd1('0xc')]={};this[_0x1cd1('0xd')]=new EmailSmtp();}EmailChannel[_0x1cd1('0xe')][_0x1cd1('0xf')]=function(_0x1222ac){var _0x3f170e=this[_0x1cd1('0xb')][_0x1222ac];var _0x495f8f={'id':_0x3f170e['id'],'name':_0x3f170e['name'],'key':_0x3f170e[_0x1cd1('0x10')],'active':_0x3f170e['active'],'Imap':{'status':_0x3f170e[_0x1cd1('0x11')][_0x1cd1('0x12')],'messageStatus':_0x3f170e['Imap'][_0x1cd1('0x13')],'total':_0x3f170e['Imap']['total']}};if(_[_0x1cd1('0x14')](md5Accounts[_0x1222ac])){md5Accounts[_0x1222ac]={};}var _0x517740=md5(JSON['stringify'](_0x495f8f));if(md5Accounts[_0x1222ac][_0x1cd1('0x1')]!==_0x517740){md5Accounts[_0x1222ac]['md5']=_0x517740;io[_0x1cd1('0xf')]('mailAccount:update',_0x495f8f);}};EmailChannel[_0x1cd1('0xe')][_0x1cd1('0x15')]=function(_0x4dde5c){for(var _0x13777b in _0x4dde5c){if(_0x4dde5c['hasOwnProperty'](_0x13777b)){if(_0x4dde5c[_0x13777b][_0x1cd1('0x11')]&&_0x4dde5c[_0x13777b][_0x1cd1('0x16')]){var _0x5c075a=_0x4dde5c[_0x13777b][_0x1cd1('0x11')];if(!_0x5c075a[_0x1cd1('0x17')]&&_0x4dde5c[_0x13777b]['provider']!==_0x1cd1('0x18'))_0x5c075a[_0x1cd1('0x17')]=_0x4dde5c[_0x13777b][_0x1cd1('0x19')];if(!this['imapAccounts'][_0x1cd1('0x1a')](_0x5c075a['id'])){this[_0x1cd1('0xc')][_0x5c075a['id']]=new EmailImap(_0x5c075a,_0x4dde5c[_0x13777b][_0x1cd1('0x1b')]);this[_0x1cd1('0xc')][_0x5c075a['id']]['on'](_0x1cd1('0x1c'),this[_0x1cd1('0x1d')][_0x1cd1('0x1e')](this,_0x13777b));this['imapAccounts'][_0x5c075a['id']]['on'](_0x1cd1('0x1b'),this[_0x1cd1('0x1f')][_0x1cd1('0x1e')](this,_0x13777b));this['imapAccounts'][_0x5c075a['id']]['on'](_0x1cd1('0x20'),this['handleImapEnd'][_0x1cd1('0x1e')](this,_0x13777b));this[_0x1cd1('0xc')][_0x5c075a['id']]['on'](_0x1cd1('0x21'),this[_0x1cd1('0x22')][_0x1cd1('0x1e')](this,_0x13777b));}}else{if(_['isNil'](this[_0x1cd1('0xb')][_0x13777b]['Imap'])){this['mailAccounts'][_0x13777b]['Imap']={};}this[_0x1cd1('0xb')][_0x13777b]['Imap'][_0x1cd1('0x12')]=_0x1cd1('0x23');this[_0x1cd1('0xb')][_0x13777b][_0x1cd1('0x11')]['messageStatus']='';this[_0x1cd1('0xf')](_0x13777b);}}}};EmailChannel[_0x1cd1('0xe')][_0x1cd1('0x1d')]=function(_0x3e15de,_0x268322){if(this[_0x1cd1('0xb')][_0x3e15de]){this[_0x1cd1('0xb')][_0x3e15de][_0x1cd1('0x11')][_0x1cd1('0x12')]=_0x1cd1('0x24');this['mailAccounts'][_0x3e15de][_0x1cd1('0x11')][_0x1cd1('0x13')]=_0x268322[_0x1cd1('0x25')];if(_0x268322['messages']){this[_0x1cd1('0xb')][_0x3e15de][_0x1cd1('0x11')][_0x1cd1('0x26')]=_0x268322['messages'][_0x1cd1('0x26')];}return this[_0x1cd1('0xf')](_0x3e15de);}};EmailChannel['prototype'][_0x1cd1('0x1f')]=function(_0x432779,_0x5a08a2){logger['info'](_0x1cd1('0x27'),_0x5a08a2[_0x1cd1('0x28')],_0x5a08a2[_0x1cd1('0x29')],_0x5a08a2['from'],_0x432779);if(this[_0x1cd1('0xb')][_0x432779]){return mailAccount[_0x1cd1('0x2a')](_0x432779,_0x5a08a2)[_0x1cd1('0x2b')](function(_0x39af01){if(_0x39af01){logger['info'](_0x1cd1('0x2c'));}})[_0x1cd1('0x2d')](function(_0x111d85){logger[_0x1cd1('0x21')](_0x1cd1('0x2e'),JSON[_0x1cd1('0x2f')](_0x111d85));});}};EmailChannel[_0x1cd1('0xe')][_0x1cd1('0x30')]=function(_0x3943fa){if(this[_0x1cd1('0xb')][_0x3943fa]&&this['mailAccounts'][_0x3943fa][_0x1cd1('0x11')]){if(this[_0x1cd1('0xc')][this[_0x1cd1('0xb')][_0x3943fa][_0x1cd1('0x11')]['id']]){delete this[_0x1cd1('0xc')][this[_0x1cd1('0xb')][_0x3943fa][_0x1cd1('0x11')]['id']];}this[_0x1cd1('0xb')][_0x3943fa][_0x1cd1('0x11')]['lastSync']=moment();this[_0x1cd1('0xf')](_0x3943fa);}};EmailChannel[_0x1cd1('0xe')][_0x1cd1('0x22')]=function(_0x3aa070,_0x1fcc99){if(this['mailAccounts'][_0x3aa070]){this[_0x1cd1('0xb')][_0x3aa070]['Imap'][_0x1cd1('0x12')]=_0x1cd1('0x21');this[_0x1cd1('0xb')][_0x3aa070][_0x1cd1('0x11')]['messageStatus']=_0x1fcc99;return this[_0x1cd1('0xf')](_0x3aa070);}};EmailChannel[_0x1cd1('0xe')][_0x1cd1('0x31')]=function(_0x4a012f,_0x4b9fc9){return this[_0x1cd1('0xd')][_0x1cd1('0x32')](_0x4a012f,_0x4b9fc9);};EmailChannel[_0x1cd1('0xe')][_0x1cd1('0x33')]=function(_0x622a14){var _0x3ce9e8=this;if(this[_0x1cd1('0xb')][_0x622a14['id']]){if(_[_0x1cd1('0x14')](this[_0x1cd1('0xb')][_0x622a14['id']]['Smtp'])){this[_0x1cd1('0xb')][_0x622a14['id']][_0x1cd1('0x34')]={};}this['mailAccounts'][_0x622a14['id']][_0x1cd1('0x34')][_0x1cd1('0x35')]=moment();return new BPromise(function(_0x126718,_0x3821a1){return _0x3ce9e8[_0x1cd1('0xd')][_0x1cd1('0x36')](_0x622a14)[_0x1cd1('0x2b')](function(_0x568c29){_0x3ce9e8['mailAccounts'][_0x622a14['id']][_0x1cd1('0x34')][_0x1cd1('0x12')]='verified';_0x3ce9e8[_0x1cd1('0xb')][_0x622a14['id']][_0x1cd1('0x34')][_0x1cd1('0x13')]='';_0x3ce9e8['emit'](_0x622a14['id']);_0x126718(_0x568c29);})[_0x1cd1('0x2d')](function(_0x20265c){_0x3ce9e8[_0x1cd1('0xb')][_0x622a14['id']]['Smtp']['status']='error';_0x3ce9e8[_0x1cd1('0xb')][_0x622a14['id']][_0x1cd1('0x34')][_0x1cd1('0x13')]=_0x20265c;_0x3ce9e8[_0x1cd1('0xf')](_0x622a14['id']);_0x3821a1(_0x20265c);});});}return this[_0x1cd1('0xd')][_0x1cd1('0x36')](_0x622a14);};module[_0x1cd1('0x37')]=EmailChannel; \ No newline at end of file +var _0x13c7=['socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','mailAccount:update','hasOwnProperty','service','custom','provider','email','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','status','connected','messages','firstName','lastName','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost'];(function(_0x351134,_0x392b05){var _0x5a5278=function(_0x5a4a7f){while(--_0x5a4a7f){_0x351134['push'](_0x351134['shift']());}};_0x5a5278(++_0x392b05);}(_0x13c7,0x11d));var _0x713c=function(_0x4742b4,_0xfb0bb8){_0x4742b4=_0x4742b4-0x0;var _0x3e69e2=_0x13c7[_0x4742b4];return _0x3e69e2;};'use strict';var _=require(_0x713c('0x0'));var moment=require(_0x713c('0x1'));var BPromise=require(_0x713c('0x2'));var md5=require(_0x713c('0x3'));var Redis=require(_0x713c('0x4'));var config=require(_0x713c('0x5'));var logger=require(_0x713c('0x6'))('email');config['redis']=_[_0x713c('0x7')](config[_0x713c('0x8')],{'host':_0x713c('0x9'),'port':0x18eb});var io=require(_0x713c('0xa'))(new Redis(config[_0x713c('0x8')]));var EmailImap=require(_0x713c('0xb'));var EmailSmtp=require(_0x713c('0xc'));var mailAccount=require(_0x713c('0xd'));var md5Accounts={};function EmailChannel(_0x1ba4ad){logger[_0x713c('0xe')](_0x713c('0xf'));this[_0x713c('0x10')]=_0x1ba4ad['mailAccounts'];this[_0x713c('0x11')]={};this[_0x713c('0x12')]=new EmailSmtp();}EmailChannel[_0x713c('0x13')][_0x713c('0x14')]=function(_0x54d262){var _0x15f33d=this[_0x713c('0x10')][_0x54d262];var _0x54428d={'id':_0x15f33d['id'],'name':_0x15f33d[_0x713c('0x15')],'key':_0x15f33d[_0x713c('0x16')],'active':_0x15f33d[_0x713c('0x17')],'Imap':{'status':_0x15f33d[_0x713c('0x18')]['status'],'messageStatus':_0x15f33d[_0x713c('0x18')][_0x713c('0x19')],'total':_0x15f33d['Imap'][_0x713c('0x1a')]}};if(_[_0x713c('0x1b')](md5Accounts[_0x54d262])){md5Accounts[_0x54d262]={};}var _0x18f941=md5(JSON['stringify'](_0x54428d));if(md5Accounts[_0x54d262]['md5']!==_0x18f941){md5Accounts[_0x54d262][_0x713c('0x3')]=_0x18f941;io[_0x713c('0x14')](_0x713c('0x1c'),_0x54428d);}};EmailChannel[_0x713c('0x13')]['refresh']=function(_0x494b6b){for(var _0x4cd6bf in _0x494b6b){if(_0x494b6b[_0x713c('0x1d')](_0x4cd6bf)){if(_0x494b6b[_0x4cd6bf][_0x713c('0x18')]&&_0x494b6b[_0x4cd6bf][_0x713c('0x17')]){var _0x4ddd11=_0x494b6b[_0x4cd6bf][_0x713c('0x18')];if(!_0x4ddd11[_0x713c('0x1e')]&&_0x494b6b[_0x4cd6bf]['provider']!==_0x713c('0x1f'))_0x4ddd11[_0x713c('0x1e')]=_0x494b6b[_0x4cd6bf][_0x713c('0x20')];if(!this[_0x713c('0x11')][_0x713c('0x1d')](_0x4ddd11['id'])){this[_0x713c('0x11')][_0x4ddd11['id']]=new EmailImap(_0x4ddd11,_0x494b6b[_0x4cd6bf][_0x713c('0x21')]);this['imapAccounts'][_0x4ddd11['id']]['on'](_0x713c('0x22'),this[_0x713c('0x23')][_0x713c('0x24')](this,_0x4cd6bf));this[_0x713c('0x11')][_0x4ddd11['id']]['on']('email',this[_0x713c('0x25')][_0x713c('0x24')](this,_0x4cd6bf));this['imapAccounts'][_0x4ddd11['id']]['on']('end',this[_0x713c('0x26')][_0x713c('0x24')](this,_0x4cd6bf));this[_0x713c('0x11')][_0x4ddd11['id']]['on'](_0x713c('0x27'),this[_0x713c('0x28')][_0x713c('0x24')](this,_0x4cd6bf));}}else{if(_[_0x713c('0x1b')](this['mailAccounts'][_0x4cd6bf][_0x713c('0x18')])){this['mailAccounts'][_0x4cd6bf][_0x713c('0x18')]={};}this[_0x713c('0x10')][_0x4cd6bf]['Imap']['status']=_0x713c('0x29');this[_0x713c('0x10')][_0x4cd6bf][_0x713c('0x18')]['messageStatus']='';this[_0x713c('0x14')](_0x4cd6bf);}}}};EmailChannel[_0x713c('0x13')][_0x713c('0x23')]=function(_0x2937b3,_0x5de173){if(this[_0x713c('0x10')][_0x2937b3]){this[_0x713c('0x10')][_0x2937b3][_0x713c('0x18')][_0x713c('0x2a')]=_0x713c('0x2b');this[_0x713c('0x10')][_0x2937b3][_0x713c('0x18')][_0x713c('0x19')]=_0x5de173[_0x713c('0x15')];if(_0x5de173[_0x713c('0x2c')]){this[_0x713c('0x10')][_0x2937b3][_0x713c('0x18')][_0x713c('0x1a')]=_0x5de173[_0x713c('0x2c')]['total'];}return this[_0x713c('0x14')](_0x2937b3);}};EmailChannel[_0x713c('0x13')][_0x713c('0x25')]=function(_0x337553,_0x3cdd1e){logger[_0x713c('0xe')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3cdd1e[_0x713c('0x2d')],_0x3cdd1e[_0x713c('0x2e')],_0x3cdd1e['from'],_0x337553);if(this['mailAccounts'][_0x337553]){return mailAccount['notify'](_0x337553,_0x3cdd1e)[_0x713c('0x2f')](function(_0x8d1de7){if(_0x8d1de7){logger['info'](_0x713c('0x30'));}})[_0x713c('0x31')](function(_0x334a9e){logger['error'](_0x713c('0x32'),JSON[_0x713c('0x33')](_0x334a9e));});}};EmailChannel['prototype'][_0x713c('0x26')]=function(_0x16eb15){if(this[_0x713c('0x10')][_0x16eb15]&&this['mailAccounts'][_0x16eb15]['Imap']){if(this[_0x713c('0x11')][this[_0x713c('0x10')][_0x16eb15]['Imap']['id']]){delete this['imapAccounts'][this[_0x713c('0x10')][_0x16eb15]['Imap']['id']];}this[_0x713c('0x10')][_0x16eb15][_0x713c('0x18')]['lastSync']=moment();this[_0x713c('0x14')](_0x16eb15);}};EmailChannel[_0x713c('0x13')][_0x713c('0x28')]=function(_0x2697d8,_0x27850b){if(this[_0x713c('0x10')][_0x2697d8]){this[_0x713c('0x10')][_0x2697d8][_0x713c('0x18')][_0x713c('0x2a')]=_0x713c('0x27');this['mailAccounts'][_0x2697d8][_0x713c('0x18')]['messageStatus']=_0x27850b;return this[_0x713c('0x14')](_0x2697d8);}};EmailChannel[_0x713c('0x13')][_0x713c('0x34')]=function(_0x5c7e28,_0x218628){return this[_0x713c('0x12')][_0x713c('0x35')](_0x5c7e28,_0x218628);};EmailChannel[_0x713c('0x13')][_0x713c('0x36')]=function(_0x2b9c0f){var _0xe025b0=this;if(this[_0x713c('0x10')][_0x2b9c0f['id']]){if(_[_0x713c('0x1b')](this[_0x713c('0x10')][_0x2b9c0f['id']]['Smtp'])){this[_0x713c('0x10')][_0x2b9c0f['id']]['Smtp']={};}this[_0x713c('0x10')][_0x2b9c0f['id']][_0x713c('0x37')]['lastSync']=moment();return new BPromise(function(_0x4fc970,_0x290bb9){return _0xe025b0[_0x713c('0x12')][_0x713c('0x38')](_0x2b9c0f)[_0x713c('0x2f')](function(_0x5b82c3){_0xe025b0[_0x713c('0x10')][_0x2b9c0f['id']][_0x713c('0x37')][_0x713c('0x2a')]=_0x713c('0x39');_0xe025b0[_0x713c('0x10')][_0x2b9c0f['id']][_0x713c('0x37')][_0x713c('0x19')]='';_0xe025b0['emit'](_0x2b9c0f['id']);_0x4fc970(_0x5b82c3);})[_0x713c('0x31')](function(_0x295305){_0xe025b0[_0x713c('0x10')][_0x2b9c0f['id']][_0x713c('0x37')][_0x713c('0x2a')]=_0x713c('0x27');_0xe025b0[_0x713c('0x10')][_0x2b9c0f['id']][_0x713c('0x37')][_0x713c('0x19')]=_0x295305;_0xe025b0[_0x713c('0x14')](_0x2b9c0f['id']);_0x290bb9(_0x295305);});});}return this[_0x713c('0x12')][_0x713c('0x38')](_0x2b9c0f);};module[_0x713c('0x3a')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 1e84018..b2ad206 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 _0xd288=['port','tls','required','handleReady','openBox','mailbox','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchMessage','closeBox','body','handleMessageBody','attributes','end','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','email','handleFetchError','stringify','textCode','hasOwnProperty','util','imap','mailparser','simpleParser','iconv','Iconv','./utils','account','getAccount','once','ready','bind','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','host'];(function(_0x3553d5,_0x4e4186){var _0x2958f5=function(_0x3765ce){while(--_0x3765ce){_0x3553d5['push'](_0x3553d5['shift']());}};_0x2958f5(++_0x4e4186);}(_0xd288,0xcf));var _0x8d28=function(_0x48f915,_0x3e5598){_0x48f915=_0x48f915-0x0;var _0x38fbe4=_0xd288[_0x48f915];return _0x38fbe4;};'use strict';var _=require('lodash');var util=require(_0x8d28('0x0'));var Imap=require(_0x8d28('0x1'));var simpleParser=require(_0x8d28('0x2'))[_0x8d28('0x3')];var Iconv=require(_0x8d28('0x4'))[_0x8d28('0x5')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0x8d28('0x6'));var logger=require('../../../config/logger')('email');function EmailImap(_0x1755ba,_0x1742be){this['mailbox']=_0x1755ba['mailbox'];this[_0x8d28('0x7')]=this[_0x8d28('0x8')](_0x1755ba,_0x1742be);this['imap']=new Imap(this[_0x8d28('0x7')]);this[_0x8d28('0x1')][_0x8d28('0x9')](_0x8d28('0xa'),this['handleReady'][_0x8d28('0xb')](this));this[_0x8d28('0x1')]['once']('end',this[_0x8d28('0xc')]['bind'](this));this[_0x8d28('0x1')]['on'](_0x8d28('0xd'),this[_0x8d28('0xe')][_0x8d28('0xb')](this));this['imap'][_0x8d28('0xf')]();}util[_0x8d28('0x10')](EmailImap,EventEmitter);EmailImap[_0x8d28('0x11')][_0x8d28('0x8')]=function(_0x3b348c,_0x316d1b){var _0x98c9f9={'connTimeout':_0x3b348c[_0x8d28('0x12')]?_0x3b348c[_0x8d28('0x12')]*0x3e8:0x2710,'authTimeout':_0x3b348c[_0x8d28('0x13')]?_0x3b348c[_0x8d28('0x13')]*0x3e8:0x1388};if(_0x3b348c[_0x8d28('0x14')]){_0x98c9f9['user']=_0x3b348c[_0x8d28('0x15')];if(_0x3b348c[_0x8d28('0x16')]){_0x98c9f9[_0x8d28('0x17')]=utils[_0x8d28('0x18')](_0x3b348c[_0x8d28('0x19')]['data5'],_0x3b348c[_0x8d28('0x15')]);}else{_0x98c9f9[_0x8d28('0x1a')]=_0x3b348c['password'];}}else{if(_0x3b348c[_0x8d28('0x1b')]){_0x98c9f9['user']=_0x3b348c[_0x8d28('0x15')];_0x98c9f9[_0x8d28('0x1a')]=_0x3b348c[_0x8d28('0x1a')];}}_0x98c9f9['email']=_0x316d1b||_0x3b348c[_0x8d28('0x15')]||'anonymous@xcally.com';_0x98c9f9['host']=_0x3b348c[_0x8d28('0x1c')];_0x98c9f9[_0x8d28('0x1d')]=_0x3b348c[_0x8d28('0x1d')]||0x3e1;if(_0x3b348c[_0x8d28('0x1e')]){_0x98c9f9[_0x8d28('0x1e')]=!![];}else{_0x98c9f9['tls']=![];_0x98c9f9['autotls']=_0x8d28('0x1f');}return _0x98c9f9;};EmailImap[_0x8d28('0x11')][_0x8d28('0x20')]=function(){this[_0x8d28('0x1')][_0x8d28('0x21')](this[_0x8d28('0x22')],![],this[_0x8d28('0x23')][_0x8d28('0xb')](this));};EmailImap[_0x8d28('0x11')]['handleOpenBox']=function(_0x3982cc,_0x14f332){if(_0x3982cc){this[_0x8d28('0xe')](_0x3982cc,!![]);}else{this[_0x8d28('0x24')]('box',_0x14f332);this[_0x8d28('0x25')]();}};EmailImap[_0x8d28('0x11')][_0x8d28('0x26')]=function(_0x475ff6){if(_0x475ff6){this[_0x8d28('0xe')](_0x475ff6,!![]);}else{this[_0x8d28('0x1')]['end']();}};EmailImap['prototype'][_0x8d28('0x25')]=function(){this['imap'][_0x8d28('0x27')](['UNSEEN'],this[_0x8d28('0x28')][_0x8d28('0xb')](this));};EmailImap[_0x8d28('0x11')][_0x8d28('0x28')]=function(_0x4ec989,_0x37ee11){if(_0x4ec989){this[_0x8d28('0xe')](_0x4ec989,!![]);}else{if(_0x37ee11[_0x8d28('0x29')]){try{var _0x2ff2cb=this[_0x8d28('0x1')][_0x8d28('0x2a')](_0x37ee11,{'bodies':'','markSeen':!![]});_0x2ff2cb['on'](_0x8d28('0x2b'),this[_0x8d28('0x2c')][_0x8d28('0xb')](this));_0x2ff2cb[_0x8d28('0x9')](_0x8d28('0xd'),this['handleFetchError'][_0x8d28('0xb')](this));_0x2ff2cb[_0x8d28('0x9')]('end',this['handleFetchEnd']['bind'](this));}catch(_0x30cb78){logger[_0x8d28('0xd')](_0x30cb78);}}else{this[_0x8d28('0x1')][_0x8d28('0x2d')](!![],this[_0x8d28('0x26')][_0x8d28('0xb')](this));}}};EmailImap['prototype'][_0x8d28('0x2c')]=function(_0x401736){_0x401736['on'](_0x8d28('0x2e'),this[_0x8d28('0x2f')]['bind'](this));_0x401736[_0x8d28('0x9')](_0x8d28('0x30'),this['handleMessageAttributes'][_0x8d28('0xb')](this));_0x401736[_0x8d28('0x9')](_0x8d28('0x31'),this[_0x8d28('0x32')][_0x8d28('0xb')](this));};EmailImap['prototype'][_0x8d28('0x2f')]=function(_0x448f36){simpleParser(_0x448f36,{'Iconv':Iconv},this[_0x8d28('0x33')][_0x8d28('0xb')](this));};EmailImap[_0x8d28('0x11')][_0x8d28('0x34')]=function(){};EmailImap[_0x8d28('0x11')][_0x8d28('0x32')]=function(){};EmailImap['prototype'][_0x8d28('0x33')]=function(_0x54cb6c,_0xf76447){if(_0x54cb6c){logger[_0x8d28('0xd')](_0x54cb6c);}else{var _0x222440=this;utils[_0x8d28('0x35')](this['account'],_0xf76447,function(_0x263f88){_0x222440['emit'](_0x8d28('0x36'),_0x263f88);});}};EmailImap[_0x8d28('0x11')]['handleFetchEnd']=function(){this[_0x8d28('0x1')][_0x8d28('0x2d')](!![],this[_0x8d28('0x26')][_0x8d28('0xb')](this));};EmailImap['prototype'][_0x8d28('0x37')]=function(_0x23f901){this[_0x8d28('0xe')](_0x23f901);this['imap'][_0x8d28('0x2d')](!![],this[_0x8d28('0x26')][_0x8d28('0xb')](this));};EmailImap[_0x8d28('0x11')][_0x8d28('0xc')]=function(){this[_0x8d28('0x24')](_0x8d28('0x31'));};EmailImap[_0x8d28('0x11')]['handleError']=function(_0x5ad042,_0x3af6e){logger['error'](_0x8d28('0xe'),this['account'][_0x8d28('0x36')],JSON[_0x8d28('0x38')](_0x5ad042));var _0x275f6d='';if(_0x5ad042){if(_0x5ad042[_0x8d28('0x39')]){_0x275f6d=_0x5ad042[_0x8d28('0x39')];}else{for(var _0x1b35b4 in _0x5ad042){if(_0x5ad042[_0x8d28('0x3a')](_0x1b35b4)){_0x275f6d+=_['upperFirst'](_0x1b35b4)+':\x20'+_0x5ad042[_0x1b35b4]+'\x0a';}}}}if(_0x3af6e){this[_0x8d28('0x1')][_0x8d28('0x31')]();}else{this[_0x8d28('0x24')](_0x8d28('0xd'),_0x275f6d);this['emit']('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0x4489=['email','mailbox','account','getAccount','once','ready','handleReady','end','handleEnd','handleError','inherits','prototype','connTimeout','authTimeout','user','modernAuthentication','xoauth2','data5','password','authentication','anonymous@xcally.com','host','port','tls','handleOpenBox','bind','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','error','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','textCode','hasOwnProperty','upperFirst','exports','util','imap','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger'];(function(_0x3ecbaa,_0xa4d584){var _0x20177c=function(_0x558499){while(--_0x558499){_0x3ecbaa['push'](_0x3ecbaa['shift']());}};_0x20177c(++_0xa4d584);}(_0x4489,0x1cf));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9448('0x0'));var Imap=require(_0x9448('0x1'));var simpleParser=require(_0x9448('0x2'))[_0x9448('0x3')];var Iconv=require(_0x9448('0x4'))[_0x9448('0x5')];var EventEmitter=require('events')[_0x9448('0x6')];var utils=require(_0x9448('0x7'));var logger=require(_0x9448('0x8'))(_0x9448('0x9'));function EmailImap(_0x54fb5b,_0x546c32){this[_0x9448('0xa')]=_0x54fb5b[_0x9448('0xa')];this[_0x9448('0xb')]=this[_0x9448('0xc')](_0x54fb5b,_0x546c32);this[_0x9448('0x1')]=new Imap(this[_0x9448('0xb')]);this['imap'][_0x9448('0xd')](_0x9448('0xe'),this[_0x9448('0xf')]['bind'](this));this['imap'][_0x9448('0xd')](_0x9448('0x10'),this[_0x9448('0x11')]['bind'](this));this[_0x9448('0x1')]['on']('error',this[_0x9448('0x12')]['bind'](this));this[_0x9448('0x1')]['connect']();}util[_0x9448('0x13')](EmailImap,EventEmitter);EmailImap[_0x9448('0x14')]['getAccount']=function(_0x116b86,_0x55e8a3){var _0x506d0a={'connTimeout':_0x116b86[_0x9448('0x15')]?_0x116b86[_0x9448('0x15')]*0x3e8:0x2710,'authTimeout':_0x116b86[_0x9448('0x16')]?_0x116b86[_0x9448('0x16')]*0x3e8:0x1388};if(_0x116b86['service']){_0x506d0a[_0x9448('0x17')]=_0x116b86[_0x9448('0x17')];if(_0x116b86[_0x9448('0x18')]){_0x506d0a[_0x9448('0x19')]=utils['generateXOAuth2Token'](_0x116b86['CloudProvider'][_0x9448('0x1a')],_0x116b86['user']);}else{_0x506d0a[_0x9448('0x1b')]=_0x116b86['password'];}}else{if(_0x116b86[_0x9448('0x1c')]){_0x506d0a[_0x9448('0x17')]=_0x116b86['user'];_0x506d0a[_0x9448('0x1b')]=_0x116b86[_0x9448('0x1b')];}}_0x506d0a[_0x9448('0x9')]=_0x55e8a3||_0x116b86[_0x9448('0x17')]||_0x9448('0x1d');_0x506d0a[_0x9448('0x1e')]=_0x116b86[_0x9448('0x1e')];_0x506d0a[_0x9448('0x1f')]=_0x116b86[_0x9448('0x1f')]||0x3e1;if(_0x116b86[_0x9448('0x20')]){_0x506d0a[_0x9448('0x20')]=!![];}else{_0x506d0a['tls']=![];_0x506d0a['autotls']='required';}return _0x506d0a;};EmailImap[_0x9448('0x14')]['handleReady']=function(){this[_0x9448('0x1')]['openBox'](this[_0x9448('0xa')],![],this[_0x9448('0x21')][_0x9448('0x22')](this));};EmailImap[_0x9448('0x14')][_0x9448('0x21')]=function(_0x64380f,_0x513e75){if(_0x64380f){this['handleError'](_0x64380f,!![]);}else{this[_0x9448('0x23')](_0x9448('0x24'),_0x513e75);this[_0x9448('0x25')]();}};EmailImap[_0x9448('0x14')][_0x9448('0x26')]=function(_0x35dc2a){if(_0x35dc2a){this[_0x9448('0x12')](_0x35dc2a,!![]);}else{this[_0x9448('0x1')][_0x9448('0x10')]();}};EmailImap[_0x9448('0x14')][_0x9448('0x25')]=function(){this['imap'][_0x9448('0x27')]([_0x9448('0x28')],this[_0x9448('0x29')][_0x9448('0x22')](this));};EmailImap[_0x9448('0x14')][_0x9448('0x29')]=function(_0xa3ced8,_0x280545){if(_0xa3ced8){this['handleError'](_0xa3ced8,!![]);}else{if(_0x280545[_0x9448('0x2a')]){try{var _0x2f33b1=this[_0x9448('0x1')][_0x9448('0x2b')](_0x280545,{'bodies':'','markSeen':!![]});_0x2f33b1['on'](_0x9448('0x2c'),this[_0x9448('0x2d')][_0x9448('0x22')](this));_0x2f33b1['once']('error',this['handleFetchError']['bind'](this));_0x2f33b1['once']('end',this[_0x9448('0x2e')]['bind'](this));}catch(_0xd1a140){logger[_0x9448('0x2f')](_0xd1a140);}}else{this['imap'][_0x9448('0x30')](!![],this[_0x9448('0x26')]['bind'](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x3c5f4d){_0x3c5f4d['on'](_0x9448('0x31'),this[_0x9448('0x32')][_0x9448('0x22')](this));_0x3c5f4d[_0x9448('0xd')](_0x9448('0x33'),this[_0x9448('0x34')]['bind'](this));_0x3c5f4d[_0x9448('0xd')](_0x9448('0x10'),this['handleMessageEnd']['bind'](this));};EmailImap[_0x9448('0x14')][_0x9448('0x32')]=function(_0x2b980c){simpleParser(_0x2b980c,{'Iconv':Iconv},this[_0x9448('0x35')][_0x9448('0x22')](this));};EmailImap[_0x9448('0x14')][_0x9448('0x34')]=function(){};EmailImap[_0x9448('0x14')][_0x9448('0x36')]=function(){};EmailImap['prototype'][_0x9448('0x35')]=function(_0x41e674,_0x5968af){if(_0x41e674){logger['error'](_0x41e674);}else{var _0x6465c3=this;utils['parser'](this['account'],_0x5968af,function(_0x551710){_0x6465c3[_0x9448('0x23')](_0x9448('0x9'),_0x551710);});}};EmailImap[_0x9448('0x14')][_0x9448('0x2e')]=function(){this[_0x9448('0x1')][_0x9448('0x30')](!![],this['handleCloseBox'][_0x9448('0x22')](this));};EmailImap[_0x9448('0x14')]['handleFetchError']=function(_0x5a95df){this['handleError'](_0x5a95df);this[_0x9448('0x1')][_0x9448('0x30')](!![],this[_0x9448('0x26')][_0x9448('0x22')](this));};EmailImap[_0x9448('0x14')][_0x9448('0x11')]=function(){this['emit'](_0x9448('0x10'));};EmailImap['prototype'][_0x9448('0x12')]=function(_0xb6fa8a,_0x4ba48c){logger[_0x9448('0x2f')](_0x9448('0x12'),this[_0x9448('0xb')][_0x9448('0x9')],JSON['stringify'](_0xb6fa8a));var _0x46af22='';if(_0xb6fa8a){if(_0xb6fa8a[_0x9448('0x37')]){_0x46af22=_0xb6fa8a[_0x9448('0x37')];}else{for(var _0xee1e03 in _0xb6fa8a){if(_0xb6fa8a[_0x9448('0x38')](_0xee1e03)){_0x46af22+=_[_0x9448('0x39')](_0xee1e03)+':\x20'+_0xb6fa8a[_0xee1e03]+'\x0a';}}}}if(_0x4ba48c){this[_0x9448('0x1')][_0x9448('0x10')]();}else{this[_0x9448('0x23')](_0x9448('0x2f'),_0x46af22);this[_0x9448('0x23')](_0x9448('0x10'));}};module[_0x9448('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 a6d4333..103bd17 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 _0xad62=['send','use','sendMail','toString','verify','exports','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x907d3c,_0x1429d8){var _0x317212=function(_0x29a70f){while(--_0x29a70f){_0x907d3c['push'](_0x907d3c['shift']());}};_0x317212(++_0x1429d8);}(_0xad62,0x10b));var _0x2ad6=function(_0x52788c,_0x235d0a){_0x52788c=_0x52788c-0x0;var _0x203c56=_0xad62[_0x52788c];return _0x203c56;};'use strict';var nodemailer=require(_0x2ad6('0x0'));var inlineBase64=require(_0x2ad6('0x1'));function EmailSmtp(){}EmailSmtp[_0x2ad6('0x2')][_0x2ad6('0x3')]=function(_0x323f21,_0x57c491){return new Promise(function(_0xb8cb18,_0x185816){var _0x3bc46b=nodemailer['createTransport'](_0x323f21);_0x3bc46b[_0x2ad6('0x4')]('compile',inlineBase64());_0x3bc46b[_0x2ad6('0x5')](_0x57c491,function(_0x3a4afb,_0x65a60d){if(_0x3a4afb){_0x185816(_0x3a4afb[_0x2ad6('0x6')]());}else{_0xb8cb18(_0x65a60d);}});});};EmailSmtp[_0x2ad6('0x2')][_0x2ad6('0x7')]=function(_0x2f237c){return new Promise(function(_0x6f60a,_0x407d81){var _0x353958=nodemailer['createTransport'](_0x2f237c);_0x353958[_0x2ad6('0x7')](function(_0x305008,_0x55601e){if(_0x305008){_0x407d81(_0x305008['toString']());}else{if(_0x55601e){_0x6f60a(_0x55601e);}else{_0x407d81('Not\x20verifired');}}});});};module[_0x2ad6('0x8')]=EmailSmtp; \ No newline at end of file +var _0x65b7=['sendMail','verify','toString','exports','prototype','compile'];(function(_0x4a7c97,_0x1ceb34){var _0x55f99c=function(_0x569bb5){while(--_0x569bb5){_0x4a7c97['push'](_0x4a7c97['shift']());}};_0x55f99c(++_0x1ceb34);}(_0x65b7,0x178));var _0x765b=function(_0x314ceb,_0x383495){_0x314ceb=_0x314ceb-0x0;var _0x5a3a6a=_0x65b7[_0x314ceb];return _0x5a3a6a;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x765b('0x0')]['send']=function(_0x3d2788,_0x1818be){return new Promise(function(_0x58eecc,_0x2c0b32){var _0xfa78ca=nodemailer['createTransport'](_0x3d2788);_0xfa78ca['use'](_0x765b('0x1'),inlineBase64());_0xfa78ca[_0x765b('0x2')](_0x1818be,function(_0x425607,_0xa6a3f0){if(_0x425607){_0x2c0b32(_0x425607['toString']());}else{_0x58eecc(_0xa6a3f0);}});});};EmailSmtp[_0x765b('0x0')][_0x765b('0x3')]=function(_0xfa9af3){return new Promise(function(_0x2fab80,_0xc1423){var _0x27b89b=nodemailer['createTransport'](_0xfa9af3);_0x27b89b[_0x765b('0x3')](function(_0x1d1923,_0x321d58){if(_0x1d1923){_0xc1423(_0x1d1923[_0x765b('0x4')]());}else{if(_0x321d58){_0x2fab80(_0x321d58);}else{_0xc1423('Not\x20verifired');}}});});};module[_0x765b('0x5')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index a117546..275baa6 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 _0x9760=['now','join','root','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','date','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','moment','path','util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','bcc','attachments','length','type','attachment-','format','%s-%s'];(function(_0x472471,_0x366d56){var _0x5f3f14=function(_0x545dc8){while(--_0x545dc8){_0x472471['push'](_0x472471['shift']());}};_0x5f3f14(++_0x366d56);}(_0x9760,0x1c7));var _0x0976=function(_0x562265,_0x14c206){_0x562265=_0x562265-0x0;var _0x43c900=_0x9760[_0x562265];return _0x43c900;};'use strict';var _=require('lodash');var moment=require(_0x0976('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x0976('0x1'));var util=require(_0x0976('0x2'));var tnef=require(_0x0976('0x3'));var logger=require('../../../config/logger')(_0x0976('0x4'));var config=require(_0x0976('0x5'));function getAddress(_0x240c0f){var _0x263d7a=_[_0x0976('0x6')](_0x240c0f[_0x0976('0x7')]);return _0x263d7a&&_0x263d7a['address']?_0x263d7a[_0x0976('0x8')]:_0x0976('0x9')+random[_0x0976('0xa')](0x6)+_0x0976('0xb');}function getFirstName(_0x4323ac){var _0x4743ea=_[_0x0976('0x6')](_0x4323ac[_0x0976('0x7')]);if(_0x4743ea&&_0x4743ea[_0x0976('0xc')]){if(_0x4743ea['name']==_0x4743ea['address']){return _0x4743ea[_0x0976('0xc')][_0x0976('0xd')](0x0,_0x4743ea[_0x0976('0xc')][_0x0976('0xe')]('@'));}var _0x33a595=_0x4743ea[_0x0976('0xc')][_0x0976('0xf')](/\s+/);return _0x33a595['length']>0x1?_0x33a595[_0x0976('0x10')](0x0,-0x1)['join']('\x20'):_0x4743ea[_0x0976('0xc')];}return'Anonymous';}function getLastName(_0x5e18e1){var _0x4570d4=_[_0x0976('0x6')](_0x5e18e1[_0x0976('0x7')]);if(_0x4570d4&&_0x4570d4[_0x0976('0xc')]){var _0x1fca1f=_0x4570d4[_0x0976('0xc')][_0x0976('0xf')](/\s+/);return _0x1fca1f['length']>0x1?_0x1fca1f['pop']():'';}return'';}function getMails(_0x23a89a,_0x179b9c){var _0x16a961='';for(var _0x53abab=0x0;_0x53abab<_0x179b9c['value']['length'];_0x53abab+=0x1){if(_0x179b9c[_0x0976('0x7')][_0x53abab][_0x0976('0x8')]!==_0x23a89a){if(!_[_0x0976('0x11')](_0x16a961)){_0x16a961+=',';}_0x16a961+=_0x179b9c['value'][_0x53abab][_0x0976('0xc')]||_0x179b9c['value'][_0x53abab][_0x0976('0x8')]||'';_0x16a961+='\x20<';_0x16a961+=_0x179b9c[_0x0976('0x7')][_0x53abab][_0x0976('0x8')]?_0x179b9c[_0x0976('0x7')][_0x53abab]['address']:_0x0976('0x9')+random[_0x0976('0xa')](0x6)+_0x0976('0xb');_0x16a961+='>';}}return _0x16a961;}function parseEmail(_0x3d20a0,_0x21abf3,_0x3de36d){if(_0x21abf3[_0x0976('0x12')]){var _0x4933fd=/)<[^<]*)*<\/script>/gi;while(_0x4933fd[_0x0976('0x13')](_0x21abf3[_0x0976('0x12')])){_0x21abf3[_0x0976('0x12')]=_0x21abf3[_0x0976('0x12')][_0x0976('0x14')](_0x4933fd,'');}if(_0x21abf3['html'][_0x0976('0x15')](_0x0976('0x16'))){var _0x20c788=[];_0x21abf3['attachments'][_0x0976('0x17')](_0x438325=>{_0x20c788[_0x0976('0x18')](_0x438325[_0x0976('0x19')]);});var _0x5ab6fa=/]+>/g;var _0xb528bb=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1fa959=_0x21abf3[_0x0976('0x12')][_0x0976('0x14')](_0xb528bb,_0x0976('0x1a'));var _0x21d25c=_0x1fa959[_0x0976('0x14')](_0x5ab6fa,_0x0976('0x1b'));for(let _0x3d8da8=0x0;_0x3d8da8<_0x20c788['length'];_0x3d8da8++){var _0x1c71f8=_0x21d25c['replace'](_0x0976('0x1b'),_0x0976('0x1c')+_0x20c788[_0x3d8da8]+_0x0976('0x1d'));_0x21d25c=_0x1c71f8;}_0x21abf3['html']=_0x21d25c;}_0x3de36d['body']=_0x21abf3['html'];}else{_0x3de36d[_0x0976('0x1e')]=_0x21abf3[_0x0976('0x1f')];}if(_0x3de36d[_0x0976('0x1e')]){_0x3de36d['body']=_0x3de36d['body'][_0x0976('0x14')](/0x0){var _0x1e86ea=[_0x0976('0x31'),'X-Auto-Response-Suppress:\x20All',_0x0976('0x32')];for(var _0x538608=0x0;_0x538608<_0x21abf3[_0x0976('0x30')][_0x0976('0x25')];_0x538608++){var _0xa93ca1=_[_0x0976('0xe')](_0x1e86ea,_0x21abf3['headerLines'][_0x538608][_0x0976('0x33')]);if(_0xa93ca1>=0x0){_0x3de36d[_0x0976('0x34')]=!![];}}}return _0x3de36d;}exports[_0x0976('0x35')]=function(_0x21e6b1,_0x5f1c77,_0x233fd5){var _0x299a5a={'from':getAddress(_0x5f1c77[_0x0976('0x36')]),'firstName':getFirstName(_0x5f1c77['from']),'lastName':getLastName(_0x5f1c77[_0x0976('0x36')]),'mapKey':_0x0976('0x4'),'message':{'from':getMails(_0x21e6b1[_0x0976('0x4')],_0x5f1c77['from']),'to':_0x21e6b1[_0x0976('0x4')],'cc':'','subject':_0x5f1c77[_0x0976('0x37')]||'','messageId':_0x5f1c77[_0x0976('0x38')],'inReplyTo':_0x5f1c77['inReplyTo'],'sentAt':moment(_0x5f1c77[_0x0976('0x39')])[_0x0976('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x5f1c77['html']&&!_0x5f1c77[_0x0976('0x1f')]){var _0x22089b=_['filter'](_0x5f1c77[_0x0976('0x24')],{'contentType':_0x0976('0x3a')});if(_0x22089b[_0x0976('0x25')]){logger[_0x0976('0x3b')](util[_0x0976('0x28')](_0x0976('0x3c'),_0x5f1c77[_0x0976('0x38')]));tnef['parseBuffer'](_[_0x0976('0x3d')](_0x22089b)['content'],function(_0x429193,_0x15b1f1){if(_0x15b1f1){_0x5f1c77['html']=_0x15b1f1[_0x0976('0x3e')]||_0x0976('0x3f');if(_0x15b1f1[_0x0976('0x40')]){for(var _0xce4c6f=0x0;_0xce4c6f<_0x15b1f1['Attachments'][_0x0976('0x25')];_0xce4c6f++){var _0x190b36=_0x15b1f1['Attachments'][_0xce4c6f];_0x299a5a['message']['attachments']['push']({'filename':_0x190b36[_0x0976('0x41')],'content':Buffer['from'](_0x190b36[_0x0976('0x42')])});}}}_0x233fd5(parseEmail(_0x21e6b1,_0x5f1c77,_0x299a5a));});}else{_0x5f1c77[_0x0976('0x12')]=_0x0976('0x3f');_0x233fd5(parseEmail(_0x21e6b1,_0x5f1c77,_0x299a5a));}}else{_0x233fd5(parseEmail(_0x21e6b1,_0x5f1c77,_0x299a5a));}};exports[_0x0976('0x43')]=function(_0x86369,_0x3ad740){var _0x39188a=[_0x0976('0x44')+(_0x3ad740||''),_0x0976('0x45')+_0x86369,'',''];return Buffer[_0x0976('0x36')](_0x39188a['join'](''),'utf-8')[_0x0976('0x46')]('base64');}; \ No newline at end of file +var _0x7911=['../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','slice','join','Anonymous','split','length','pop','isEmpty','@xcally.com','html','test','includes','\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','utf-8','toString','lodash','randomstring','path','node-tnef','email'];(function(_0x362777,_0xb94156){var _0xe4a158=function(_0x4b6285){while(--_0x4b6285){_0x362777['push'](_0x362777['shift']());}};_0xe4a158(++_0xb94156);}(_0x7911,0x1e5));var _0x1791=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x7911[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x1791('0x0'));var moment=require('moment');var random=require(_0x1791('0x1'));var fs=require('fs');var path=require(_0x1791('0x2'));var util=require('util');var tnef=require(_0x1791('0x3'));var logger=require('../../../config/logger')(_0x1791('0x4'));var config=require(_0x1791('0x5'));function getAddress(_0x5022bb){var _0x2616a2=_[_0x1791('0x6')](_0x5022bb[_0x1791('0x7')]);return _0x2616a2&&_0x2616a2['address']?_0x2616a2[_0x1791('0x8')]:_0x1791('0x9')+random[_0x1791('0xa')](0x6)+'@xcally.com';}function getFirstName(_0xc5f7db){var _0x926359=_[_0x1791('0x6')](_0xc5f7db[_0x1791('0x7')]);if(_0x926359&&_0x926359['name']){if(_0x926359[_0x1791('0xb')]==_0x926359[_0x1791('0x8')]){return _0x926359[_0x1791('0xb')][_0x1791('0xc')](0x0,_0x926359[_0x1791('0xb')][_0x1791('0xd')]('@'));}var _0x2f27e5=_0x926359['name']['split'](/\s+/);return _0x2f27e5['length']>0x1?_0x2f27e5[_0x1791('0xe')](0x0,-0x1)[_0x1791('0xf')]('\x20'):_0x926359[_0x1791('0xb')];}return _0x1791('0x10');}function getLastName(_0x376897){var _0x1def7b=_[_0x1791('0x6')](_0x376897[_0x1791('0x7')]);if(_0x1def7b&&_0x1def7b['name']){var _0x2f994e=_0x1def7b['name'][_0x1791('0x11')](/\s+/);return _0x2f994e[_0x1791('0x12')]>0x1?_0x2f994e[_0x1791('0x13')]():'';}return'';}function getMails(_0x453483,_0x4650e3){var _0x426a68='';for(var _0x4c2b7e=0x0;_0x4c2b7e<_0x4650e3['value'][_0x1791('0x12')];_0x4c2b7e+=0x1){if(_0x4650e3[_0x1791('0x7')][_0x4c2b7e]['address']!==_0x453483){if(!_[_0x1791('0x14')](_0x426a68)){_0x426a68+=',';}_0x426a68+=_0x4650e3['value'][_0x4c2b7e]['name']||_0x4650e3[_0x1791('0x7')][_0x4c2b7e][_0x1791('0x8')]||'';_0x426a68+='\x20<';_0x426a68+=_0x4650e3[_0x1791('0x7')][_0x4c2b7e][_0x1791('0x8')]?_0x4650e3[_0x1791('0x7')][_0x4c2b7e][_0x1791('0x8')]:_0x1791('0x9')+random['generate'](0x6)+_0x1791('0x15');_0x426a68+='>';}}return _0x426a68;}function parseEmail(_0x4dad02,_0x2fbaad,_0x444210){if(_0x2fbaad[_0x1791('0x16')]){var _0x1c4442=/)<[^<]*)*<\/script>/gi;while(_0x1c4442[_0x1791('0x17')](_0x2fbaad[_0x1791('0x16')])){_0x2fbaad[_0x1791('0x16')]=_0x2fbaad[_0x1791('0x16')]['replace'](_0x1c4442,'');}if(_0x2fbaad[_0x1791('0x16')][_0x1791('0x18')](_0x1791('0x19'))){var _0x2de179=[];_0x2fbaad[_0x1791('0x1a')][_0x1791('0x1b')](_0x4eb390=>{_0x2de179[_0x1791('0x1c')](_0x4eb390[_0x1791('0x1d')]);});var _0x2e1342=/]+>/g;var _0x4d287b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x11b537=_0x2fbaad[_0x1791('0x16')]['replace'](_0x4d287b,_0x1791('0x1e'));var _0x1e5619=_0x11b537[_0x1791('0x1f')](_0x2e1342,'_IMG');for(let _0xb1c95c=0x0;_0xb1c95c<_0x2de179[_0x1791('0x12')];_0xb1c95c++){var _0x135baf=_0x1e5619[_0x1791('0x1f')](_0x1791('0x20'),_0x1791('0x21')+_0x2de179[_0xb1c95c]+'\x20]');_0x1e5619=_0x135baf;}_0x2fbaad[_0x1791('0x16')]=_0x1e5619;}_0x444210[_0x1791('0x22')]=_0x2fbaad[_0x1791('0x16')];}else{_0x444210['body']=_0x2fbaad[_0x1791('0x23')];}if(_0x444210[_0x1791('0x22')]){_0x444210['body']=_0x444210[_0x1791('0x22')][_0x1791('0x1f')](/0x0){var _0x460532=[_0x1791('0x30'),_0x1791('0x31'),_0x1791('0x32')];for(var _0x4774ba=0x0;_0x4774ba<_0x2fbaad[_0x1791('0x2f')][_0x1791('0x12')];_0x4774ba++){var _0x248f2a=_[_0x1791('0xd')](_0x460532,_0x2fbaad['headerLines'][_0x4774ba][_0x1791('0x33')]);if(_0x248f2a>=0x0){_0x444210['isAutoreply']=!![];}}}return _0x444210;}exports['parser']=function(_0x42bb3b,_0x16726c,_0x56960e){var _0x35c6e0={'from':getAddress(_0x16726c[_0x1791('0x34')]),'firstName':getFirstName(_0x16726c[_0x1791('0x34')]),'lastName':getLastName(_0x16726c['from']),'mapKey':_0x1791('0x4'),'message':{'from':getMails(_0x42bb3b[_0x1791('0x4')],_0x16726c[_0x1791('0x34')]),'to':_0x42bb3b['email'],'cc':'','subject':_0x16726c[_0x1791('0x35')]||'','messageId':_0x16726c[_0x1791('0x36')],'inReplyTo':_0x16726c[_0x1791('0x37')],'sentAt':moment(_0x16726c['date'])[_0x1791('0x38')](_0x1791('0x39')),'attach':![],'attachments':[]}};if(!_0x16726c[_0x1791('0x16')]&&!_0x16726c[_0x1791('0x23')]){var _0x11c1fc=_[_0x1791('0x3a')](_0x16726c[_0x1791('0x1a')],{'contentType':_0x1791('0x3b')});if(_0x11c1fc[_0x1791('0x12')]){logger[_0x1791('0x3c')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x16726c['messageId']));tnef[_0x1791('0x3d')](_['first'](_0x11c1fc)['content'],function(_0x5e8100,_0x24347c){if(_0x24347c){_0x16726c[_0x1791('0x16')]=_0x24347c[_0x1791('0x3e')]||_0x1791('0x3f');if(_0x24347c[_0x1791('0x40')]){for(var _0x1aefbb=0x0;_0x1aefbb<_0x24347c['Attachments'][_0x1791('0x12')];_0x1aefbb++){var _0x3ea8cd=_0x24347c[_0x1791('0x40')][_0x1aefbb];_0x35c6e0[_0x1791('0x25')]['attachments'][_0x1791('0x1c')]({'filename':_0x3ea8cd[_0x1791('0x41')],'content':Buffer[_0x1791('0x34')](_0x3ea8cd['Data'])});}}}_0x56960e(parseEmail(_0x42bb3b,_0x16726c,_0x35c6e0));});}else{_0x16726c[_0x1791('0x16')]=_0x1791('0x3f');_0x56960e(parseEmail(_0x42bb3b,_0x16726c,_0x35c6e0));}}else{_0x56960e(parseEmail(_0x42bb3b,_0x16726c,_0x35c6e0));}};exports[_0x1791('0x42')]=function(_0x58456d,_0x376a09){var _0x313085=[_0x1791('0x43')+(_0x376a09||''),'auth=Bearer\x20'+_0x58456d,'',''];return Buffer[_0x1791('0x34')](_0x313085[_0x1791('0xf')](''),_0x1791('0x44'))[_0x1791('0x45')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 56d9638..cfd9dfb 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 _0x9883=['Imap','lodash','name','Service','key','active'];(function(_0x5eb35b,_0xec7757){var _0x11a150=function(_0x3dfe33){while(--_0x3dfe33){_0x5eb35b['push'](_0x5eb35b['shift']());}};_0x11a150(++_0xec7757);}(_0x9883,0x199));var _0x3988=function(_0x413bc0,_0x877473){_0x413bc0=_0x413bc0-0x0;var _0x4827fd=_0x9883[_0x413bc0];return _0x4827fd;};'use strict';var _=require(_0x3988('0x0'));function MailAccount(_0x2502fe){this['id']=_0x2502fe['id']||0x0;this['name']=_0x2502fe[_0x3988('0x1')]||_0x3988('0x2');this[_0x3988('0x3')]=_0x2502fe[_0x3988('0x3')]||'SERV';this[_0x3988('0x4')]=_0x2502fe[_0x3988('0x4')]||![];this[_0x3988('0x5')]=_0x2502fe[_0x3988('0x5')]||[];this['Smtp']=_0x2502fe['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x90a6=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x180485,_0x5335d4){var _0x3b84ab=function(_0x135f71){while(--_0x135f71){_0x180485['push'](_0x180485['shift']());}};_0x3b84ab(++_0x5335d4);}(_0x90a6,0x95));var _0x690a=function(_0x15009d,_0x1037f2){_0x15009d=_0x15009d-0x0;var _0x50d8e9=_0x90a6[_0x15009d];return _0x50d8e9;};'use strict';var _=require(_0x690a('0x0'));function MailAccount(_0x42af0d){this['id']=_0x42af0d['id']||0x0;this['name']=_0x42af0d[_0x690a('0x1')]||_0x690a('0x2');this[_0x690a('0x3')]=_0x42af0d[_0x690a('0x3')]||_0x690a('0x4');this[_0x690a('0x5')]=_0x42af0d[_0x690a('0x5')]||![];this['Imap']=_0x42af0d[_0x690a('0x6')]||[];this[_0x690a('0x7')]=_0x42af0d[_0x690a('0x7')]||[];}module[_0x690a('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index c59410b..eafae53 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 _0x4c7e=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','exports','lodash','../model/mailAccount'];(function(_0x476011,_0x27d0f7){var _0x4f44cc=function(_0x1cb7c4){while(--_0x1cb7c4){_0x476011['push'](_0x476011['shift']());}};_0x4f44cc(++_0x27d0f7);}(_0x4c7e,0x1a2));var _0xe4c7=function(_0x493c5b,_0x4523de){_0x493c5b=_0x493c5b-0x0;var _0x3e487d=_0x4c7e[_0x493c5b];return _0x3e487d;};'use strict';var _=require(_0xe4c7('0x0'));var MailAccount=require(_0xe4c7('0x1'));var Realtime=function(){this[_0xe4c7('0x2')]={};};function freeIsNotKey(_0x41624f,_0x1407b9,_0x2a15f1){var _0xfb4260=_[_0xe4c7('0x3')](_0x41624f,function(_0x1c51ea,_0x375c9e){return _0x1c51ea[_0x2a15f1];});for(var _0x394e1b in _0x1407b9){if(_0x1407b9[_0xe4c7('0x4')](_0x394e1b)){if(!_0xfb4260[_0x394e1b]){delete _0x1407b9[_0x394e1b];}}}}Realtime[_0xe4c7('0x5')][_0xe4c7('0x6')]=function(_0x1075e6,_0x7203d9){for(var _0x49c604 in _0x7203d9){if(_0x1075e6['hasOwnProperty'](_0x49c604)){_0x1075e6[_0x49c604]=_0x7203d9[_0x49c604];}}};Realtime[_0xe4c7('0x5')]['initMailAccounts']=function(){var _0x36dac5=this;return function(_0x3001f1){if(_0x3001f1){freeIsNotKey(_0x3001f1,_0x36dac5['mailAccounts'],'id');for(var _0x5968d2=0x0,_0x24e669={},_0x4633cb={};_0x5968d2<_0x3001f1[_0xe4c7('0x7')];_0x5968d2+=0x1){_0x24e669=_0x3001f1[_0x5968d2];if(_[_0xe4c7('0x8')](_0x36dac5[_0xe4c7('0x2')][_0x24e669['id']])){_0x36dac5[_0xe4c7('0x2')][_0x24e669['id']]=new MailAccount(_0x24e669);}else{_['merge'](_0x36dac5[_0xe4c7('0x2')][_0x24e669['id']],_0x24e669);}}}return _0x36dac5['mailAccounts'];};};module[_0xe4c7('0x9')]=Realtime; \ No newline at end of file +var _0x48f3=['isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x48f3,0x183));var _0x348f=function(_0x4480c4,_0x27253d){_0x4480c4=_0x4480c4-0x0;var _0xc9c375=_0x48f3[_0x4480c4];return _0xc9c375;};'use strict';var _=require(_0x348f('0x0'));var MailAccount=require(_0x348f('0x1'));var Realtime=function(){this[_0x348f('0x2')]={};};function freeIsNotKey(_0x2d6881,_0x381b82,_0x183b52){var _0x2e8690=_[_0x348f('0x3')](_0x2d6881,function(_0x1f43e7,_0x283245){return _0x1f43e7[_0x183b52];});for(var _0x28cfcf in _0x381b82){if(_0x381b82[_0x348f('0x4')](_0x28cfcf)){if(!_0x2e8690[_0x28cfcf]){delete _0x381b82[_0x28cfcf];}}}}Realtime[_0x348f('0x5')][_0x348f('0x6')]=function(_0x295de9,_0x3ded88){for(var _0x526df2 in _0x3ded88){if(_0x295de9[_0x348f('0x4')](_0x526df2)){_0x295de9[_0x526df2]=_0x3ded88[_0x526df2];}}};Realtime[_0x348f('0x5')][_0x348f('0x7')]=function(){var _0x5bd5aa=this;return function(_0x49d76a){if(_0x49d76a){freeIsNotKey(_0x49d76a,_0x5bd5aa[_0x348f('0x2')],'id');for(var _0x5a2451=0x0,_0x110393={},_0x3111bb={};_0x5a2451<_0x49d76a[_0x348f('0x8')];_0x5a2451+=0x1){_0x110393=_0x49d76a[_0x5a2451];if(_[_0x348f('0x9')](_0x5bd5aa[_0x348f('0x2')][_0x110393['id']])){_0x5bd5aa[_0x348f('0x2')][_0x110393['id']]=new MailAccount(_0x110393);}else{_[_0x348f('0xa')](_0x5bd5aa[_0x348f('0x2')][_0x110393['id']],_0x110393);}}}return _0x5bd5aa[_0x348f('0x2')];};};module[_0x348f('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 438f055..02f28cf 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 _0x31f0=['NotifyMailAccount','../client','Request','name','provider','service','email','key','ListId','CloudProvider','type','data5','Smtp','getMailAccount'];(function(_0x4da224,_0x31cca8){var _0x1d4ce4=function(_0xd2930e){while(--_0xd2930e){_0x4da224['push'](_0x4da224['shift']());}};_0x1d4ce4(++_0x31cca8);}(_0x31f0,0xb7));var _0x031f=function(_0x569d40,_0x272f7b){_0x569d40=_0x569d40-0x0;var _0x47aa5a=_0x31f0[_0x569d40];return _0x47aa5a;};'use strict';var client=require(_0x031f('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x031f('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0x031f('0x2'),_0x031f('0x3'),_0x031f('0x4'),_0x031f('0x5'),'active',_0x031f('0x6'),_0x031f('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x031f('0x8'),'attributes':['id','name',_0x031f('0x4'),_0x031f('0x9'),_0x031f('0xa')],'as':_0x031f('0x8')}]},{'model':'MailServerOut','as':_0x031f('0xb'),'include':[{'model':_0x031f('0x8'),'attributes':['id',_0x031f('0x2'),_0x031f('0x4'),_0x031f('0x9'),_0x031f('0xa')],'as':_0x031f('0x8')}]}]},'log':_0x031f('0xc')});};};exports['notify']=function(_0x5c3657,_0x353744){return client[_0x031f('0x1')](_0x031f('0xd'),{'account':{'id':_0x5c3657},'body':_0x353744,'log':_0x031f('0xd')});}; \ No newline at end of file +var _0x6eec=['MailServerOut','type','data5','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','service','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','name'];(function(_0x5f36cd,_0x37d4c9){var _0x49832a=function(_0xa82985){while(--_0xa82985){_0x5f36cd['push'](_0x5f36cd['shift']());}};_0x49832a(++_0x37d4c9);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc6ee('0x0'));exports[_0xc6ee('0x1')]=function(){return function(){return client[_0xc6ee('0x2')](_0xc6ee('0x3'),{'options':{'attributes':['id','name',_0xc6ee('0x4'),_0xc6ee('0x5'),'email',_0xc6ee('0x6'),_0xc6ee('0x7'),_0xc6ee('0x8'),_0xc6ee('0x9')],'raw':![],'include':[{'model':_0xc6ee('0xa'),'as':_0xc6ee('0xb'),'include':[{'model':_0xc6ee('0xc'),'attributes':['id',_0xc6ee('0xd'),_0xc6ee('0x5'),'type','data5'],'as':_0xc6ee('0xc')}]},{'model':_0xc6ee('0xe'),'as':'Smtp','include':[{'model':_0xc6ee('0xc'),'attributes':['id','name',_0xc6ee('0x5'),_0xc6ee('0xf'),_0xc6ee('0x10')],'as':_0xc6ee('0xc')}]}]},'log':'getMailAccount'});};};exports[_0xc6ee('0x11')]=function(_0x1727a7,_0xe87f07){return client['Request'](_0xc6ee('0x12'),{'account':{'id':_0x1727a7},'body':_0xe87f07,'log':_0xc6ee('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 6278819..a3b0bb3 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 _0x6c09=['Request','ShowSetting','GetSettings'];(function(_0x210b0c,_0x43f54f){var _0x5b1043=function(_0x76f2d4){while(--_0x76f2d4){_0x210b0c['push'](_0x210b0c['shift']());}};_0x5b1043(++_0x43f54f);}(_0x6c09,0xa8));var _0x96c0=function(_0x310d70,_0x491a36){_0x310d70=_0x310d70-0x0;var _0xa1477b=_0x6c09[_0x310d70];return _0xa1477b;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x96c0('0x0')](_0x96c0('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x96c0('0x2')});}; \ No newline at end of file +var _0xb393=['getSettings','loginMailFrequency','GetSettings','../client'];(function(_0x5b1c1f,_0xb03c9){var _0x44d610=function(_0x122526){while(--_0x122526){_0x5b1c1f['push'](_0x5b1c1f['shift']());}};_0x44d610(++_0xb03c9);}(_0xb393,0xaf));var _0x3b39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb393[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3b39('0x0'));exports[_0x3b39('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3b39('0x2')]},'log':_0x3b39('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index c17d166..7d42ea3 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(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 c05ec67..5754b4c 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 _0x1b5a=['createServer','timeout','listen','port','websocket','polling','redis','localhost','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis'];(function(_0x117397,_0x550e07){var _0x9ec48d=function(_0x1896d6){while(--_0x1896d6){_0x117397['push'](_0x117397['shift']());}};_0x9ec48d(++_0x550e07);}(_0x1b5a,0xee));var _0xa1b5=function(_0x1d6634,_0x6cb01b){_0x1d6634=_0x1d6634-0x0;var _0x609f36=_0x1b5a[_0x1d6634];return _0x609f36;};'use strict';var _=require(_0xa1b5('0x0'));var http=require('http');var express=require(_0xa1b5('0x1'));var sticky=require(_0xa1b5('0x2'));var Redis=require(_0xa1b5('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xa1b5('0x4')](app);server[_0xa1b5('0x5')]=0xdbba0;if(sticky[_0xa1b5('0x6')](server,config[_0xa1b5('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0xa1b5('0x8'),_0xa1b5('0x9')]});config[_0xa1b5('0xa')]=_['defaults'](config[_0xa1b5('0xa')],{'host':_0xa1b5('0xb'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xa1b5('0xa')])}));require(_0xa1b5('0xc'))['default']();require(_0xa1b5('0xd'))[_0xa1b5('0xe')](socketio);require(_0xa1b5('0xf'))[_0xa1b5('0xe')](app);require(_0xa1b5('0x10'))[_0xa1b5('0xe')](app);}else{server[_0xa1b5('0x11')](_0xa1b5('0x12'),function(){console[_0xa1b5('0x13')](_0xa1b5('0x14'),config[_0xa1b5('0x7')]);});}exports=module[_0xa1b5('0x15')]=app; \ No newline at end of file +var _0x1bde=['log','port','exports','lodash','http','ioredis','../../config/environment','createServer','listen','socket.io','websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','once','listening'];(function(_0x106159,_0x5b3f6a){var _0x2eef86=function(_0x5a83de){while(--_0x5a83de){_0x106159['push'](_0x106159['shift']());}};_0x2eef86(++_0x5b3f6a);}(_0x1bde,0x12e));var _0xe1bd=function(_0x1c55f1,_0x3669ca){_0x1c55f1=_0x1c55f1-0x0;var _0x44dd27=_0x1bde[_0x1c55f1];return _0x44dd27;};'use strict';var _=require(_0xe1bd('0x0'));var http=require(_0xe1bd('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0xe1bd('0x2'));var config=require(_0xe1bd('0x3'));var app=express();var server=http[_0xe1bd('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xe1bd('0x5')](server,config['port'])){var socketio=require(_0xe1bd('0x6'))(server,{'transports':[_0xe1bd('0x7'),_0xe1bd('0x8')]});config['redis']=_[_0xe1bd('0x9')](config[_0xe1bd('0xa')],{'host':_0xe1bd('0xb'),'port':0x18eb});socketio[_0xe1bd('0xc')](require(_0xe1bd('0xd'))({'pubClient':new Redis(config[_0xe1bd('0xa')]),'subClient':new Redis(config[_0xe1bd('0xa')])}));require(_0xe1bd('0xe'))[_0xe1bd('0xf')]();require(_0xe1bd('0x10'))['default'](socketio);require(_0xe1bd('0x11'))[_0xe1bd('0xf')](app);require('../../routes')['default'](app);}else{server[_0xe1bd('0x12')](_0xe1bd('0x13'),function(){console[_0xe1bd('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe1bd('0x15')]);});}exports=module[_0xe1bd('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 4f9eff7..be12b8f 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 _0x0a56=['client','http','Request','request','then','debug','error','rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x1c4d98,_0x16453b){var _0x28ef49=function(_0x4352bc){while(--_0x4352bc){_0x1c4d98['push'](_0x1c4d98['shift']());}};_0x28ef49(++_0x16453b);}(_0x0a56,0x1cd));var _0x60a5=function(_0x233a89,_0x320e8b){_0x233a89=_0x233a89-0x0;var _0x585f9a=_0x0a56[_0x233a89];return _0x585f9a;};'use strict';var jayson=require(_0x60a5('0x0'));var BPromise=require(_0x60a5('0x1'));var logger=require(_0x60a5('0x2'))(_0x60a5('0x3'));var client=jayson[_0x60a5('0x4')][_0x60a5('0x5')]({'port':0x2329});client[_0x60a5('0x6')]=function(_0x5c2894,_0x3f4aa4){return new BPromise(function(_0x476737,_0x38e600){return client[_0x60a5('0x7')](_0x5c2894,_0x3f4aa4)[_0x60a5('0x8')](function(_0x1b00b9){logger[_0x60a5('0x9')]('rpc',_0x60a5('0x3'),_0x5c2894,_0x3f4aa4,_0x1b00b9);if(_0x1b00b9[_0x60a5('0xa')]){logger[_0x60a5('0xa')](_0x60a5('0xb'),_0x60a5('0x3'),_0x5c2894,_0x1b00b9[_0x60a5('0xa')][_0x60a5('0xc')],_0x3f4aa4);return _0x38e600(_0x1b00b9[_0x60a5('0xa')][_0x60a5('0xc')]);}else{return _0x476737(_0x1b00b9['result']);}})[_0x60a5('0xd')](function(_0x5d1056){logger[_0x60a5('0xa')](_0x60a5('0xb'),_0x60a5('0x3'),_0x5c2894,_0x5d1056,_0x3f4aa4);return _0x38e600(_0x5d1056);});});};module[_0x60a5('0xe')]=client; \ No newline at end of file +var _0xee57=['request','then','debug','error','rpc','message','result','catch','exports','jayson/promise','bluebird','routing','client','http'];(function(_0x59ab85,_0x4944ba){var _0x512fc8=function(_0x5d0ca6){while(--_0x5d0ca6){_0x59ab85['push'](_0x59ab85['shift']());}};_0x512fc8(++_0x4944ba);}(_0xee57,0xdb));var _0x7ee5=function(_0x440500,_0x2ac2f0){_0x440500=_0x440500-0x0;var _0x27efcd=_0xee57[_0x440500];return _0x27efcd;};'use strict';var jayson=require(_0x7ee5('0x0'));var BPromise=require(_0x7ee5('0x1'));var logger=require('../../config/logger')(_0x7ee5('0x2'));var client=jayson[_0x7ee5('0x3')][_0x7ee5('0x4')]({'port':0x2329});client['Request']=function(_0x34ba53,_0x57421b){return new BPromise(function(_0x144f67,_0x44b074){return client[_0x7ee5('0x5')](_0x34ba53,_0x57421b)[_0x7ee5('0x6')](function(_0x34ef6a){logger[_0x7ee5('0x7')]('rpc',_0x7ee5('0x2'),_0x34ba53,_0x57421b,_0x34ef6a);if(_0x34ef6a[_0x7ee5('0x8')]){logger[_0x7ee5('0x8')](_0x7ee5('0x9'),'routing',_0x34ba53,_0x34ef6a[_0x7ee5('0x8')][_0x7ee5('0xa')],_0x57421b);return _0x44b074(_0x34ef6a[_0x7ee5('0x8')][_0x7ee5('0xa')]);}else{return _0x144f67(_0x34ef6a[_0x7ee5('0xb')]);}})[_0x7ee5('0xc')](function(_0x3be705){logger[_0x7ee5('0x8')]('rpc',_0x7ee5('0x2'),_0x34ba53,_0x3be705,_0x57421b);return _0x44b074(_0x3be705);});});};module[_0x7ee5('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index b266a9c..248a5a3 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 _0x897f=['listen','catch','bluebird','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x897f,0x1e6));var _0xf897=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x897f[_0x187d80];return _0x498a77;};'use strict';var BPromise=require(_0xf897('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0xf897('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xf897('0x2'));var smsQueue=require(_0xf897('0x3'));var mailQueue=require(_0xf897('0x4'));var faxQueue=require(_0xf897('0x5'));var whatsappQueue=require(_0xf897('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xf897('0x7')](user[_0xf897('0x8')]())[_0xf897('0x7')](realtime[_0xf897('0x9')]())['then'](interval[_0xf897('0xa')]())[_0xf897('0x7')](realtime[_0xf897('0xb')]())['then'](openchannelQueue[_0xf897('0xc')]())['then'](realtime[_0xf897('0xd')]())[_0xf897('0x7')](chatQueue[_0xf897('0xe')]())['then'](realtime[_0xf897('0xf')]())[_0xf897('0x7')](smsQueue['getSmsQueues']())['then'](realtime[_0xf897('0x10')]())['then'](mailQueue['getMailQueues']())[_0xf897('0x7')](realtime[_0xf897('0x11')]())[_0xf897('0x7')](faxQueue['getFaxQueues']())[_0xf897('0x7')](realtime['initFaxQueues']())[_0xf897('0x7')](whatsappQueue[_0xf897('0x12')]())['then'](realtime[_0xf897('0x13')]())[_0xf897('0x7')](function(){return realtime;});}function main(){return server[_0xf897('0x14')](realtime)[_0xf897('0x7')](function(_0x1f0506){return initRealtime();})[_0xf897('0x7')](function(_0x5c038b){return setInterval(initRealtime,0x1388);})[_0xf897('0x15')](function(_0x43f90f){console['log'](_0x43f90f);});}main(); \ No newline at end of file +var _0xa990=['getWhatsappQueues','listen','log','bluebird','./server','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues'];(function(_0x420e84,_0x1d53b6){var _0x155213=function(_0xef47cf){while(--_0xef47cf){_0x420e84['push'](_0x420e84['shift']());}};_0x155213(++_0x1d53b6);}(_0xa990,0xb2));var _0x0a99=function(_0x516d90,_0x11cbcc){_0x516d90=_0x516d90-0x0;var _0x2a3f4c=_0xa990[_0x516d90];return _0x2a3f4c;};'use strict';var BPromise=require(_0x0a99('0x0'));var server=require(_0x0a99('0x1'));var Realtime=require('./realtime');var user=require(_0x0a99('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x0a99('0x3'));var smsQueue=require(_0x0a99('0x4'));var mailQueue=require(_0x0a99('0x5'));var faxQueue=require(_0x0a99('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x0a99('0x7')]()[_0x0a99('0x8')](user['getAgents']())[_0x0a99('0x8')](realtime[_0x0a99('0x9')]())[_0x0a99('0x8')](interval[_0x0a99('0xa')]())[_0x0a99('0x8')](realtime[_0x0a99('0xb')]())[_0x0a99('0x8')](openchannelQueue[_0x0a99('0xc')]())[_0x0a99('0x8')](realtime[_0x0a99('0xd')]())[_0x0a99('0x8')](chatQueue[_0x0a99('0xe')]())[_0x0a99('0x8')](realtime[_0x0a99('0xf')]())[_0x0a99('0x8')](smsQueue[_0x0a99('0x10')]())[_0x0a99('0x8')](realtime[_0x0a99('0x11')]())[_0x0a99('0x8')](mailQueue[_0x0a99('0x12')]())[_0x0a99('0x8')](realtime[_0x0a99('0x13')]())[_0x0a99('0x8')](faxQueue[_0x0a99('0x14')]())[_0x0a99('0x8')](realtime[_0x0a99('0x15')]())[_0x0a99('0x8')](whatsappQueue[_0x0a99('0x16')]())[_0x0a99('0x8')](realtime['initWhatsappQueues']())[_0x0a99('0x8')](function(){return realtime;});}function main(){return server[_0x0a99('0x17')](realtime)[_0x0a99('0x8')](function(_0xc82d4a){return initRealtime();})[_0x0a99('0x8')](function(_0x1a9f16){return setInterval(initRealtime,0x1388);})['catch'](function(_0x53413f){console[_0x0a99('0x18')](_0x53413f);});}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 5f2c237..8252d8f 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x223510,_0x226f77){var _0x4b3f52=function(_0x358f9e){while(--_0x358f9e){_0x223510['push'](_0x223510['shift']());}};_0x4b3f52(++_0x226f77);}(_0x7a54,0x106));var _0x47a5=function(_0xf875ab,_0x26368e){_0xf875ab=_0xf875ab-0x0;var _0x2d4e86=_0x7a54[_0xf875ab];return _0x2d4e86;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x2cc594,_0x4d727b){_0x2cc594=_0x2cc594-0x0;var _0x4abff7=_0x1261[_0x2cc594];return _0x4abff7;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 0851d5e..c195b93 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 _0x5fdb=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then','error','message','result'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5fdb,0x12c));var _0xb5fd=function(_0xbc2605,_0x2af13d){_0xbc2605=_0xbc2605-0x0;var _0x107f33=_0x5fdb[_0xbc2605];return _0x107f33;};'use strict';var BPromise=require(_0xb5fd('0x0'));var jayson=require(_0xb5fd('0x1'));var client=jayson[_0xb5fd('0x2')][_0xb5fd('0x3')]({'port':0x232b});function request(_0x58e133,_0x5273d9){return new BPromise(function(_0x5b9f83,_0x4e08d4){return client['request'](_0x58e133,_0x5273d9)[_0xb5fd('0x4')](function(_0xec19fa){if(_0xec19fa[_0xb5fd('0x5')]){return _0x4e08d4(_0xec19fa[_0xb5fd('0x5')][_0xb5fd('0x6')]);}else{return _0x5b9f83(_0xec19fa[_0xb5fd('0x7')]);}})[_0xb5fd('0x8')](function(_0x253873){return _0x4e08d4(_0x253873);});});}exports[_0xb5fd('0x9')]=function(_0x50efdd,_0x36c6f9){return request(_0xb5fd('0xa'),{'account':_0x50efdd,'message':_0x36c6f9});}; \ No newline at end of file +var _0x47eb=['client','http','request','then','error','message','catch','bluebird','jayson/promise'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x47eb,0x1ae));var _0xb47e=function(_0x43d79c,_0x531a55){_0x43d79c=_0x43d79c-0x0;var _0x4866b0=_0x47eb[_0x43d79c];return _0x4866b0;};'use strict';var BPromise=require(_0xb47e('0x0'));var jayson=require(_0xb47e('0x1'));var client=jayson[_0xb47e('0x2')][_0xb47e('0x3')]({'port':0x232b});function request(_0x2bd25f,_0x29e839){return new BPromise(function(_0x28b144,_0x42afae){return client[_0xb47e('0x4')](_0x2bd25f,_0x29e839)[_0xb47e('0x5')](function(_0x29b2dc){if(_0x29b2dc[_0xb47e('0x6')]){return _0x42afae(_0x29b2dc[_0xb47e('0x6')][_0xb47e('0x7')]);}else{return _0x28b144(_0x29b2dc['result']);}})[_0xb47e('0x8')](function(_0x1d959f){return _0x42afae(_0x1d959f);});});}exports['sendMailMessage']=function(_0x3d99b9,_0x422a0e){return request('SendMail',{'account':_0x3d99b9,'message':_0x422a0e});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index a72fcdc..25245f6 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 _0xa03c=['format','smsStatus','whatsappStatusTime','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime','mail','chat','openchannel','fax','whatsapp','length','Status','StatusTime'];(function(_0x157c09,_0x34a9fc){var _0x4f3a52=function(_0x57ad2d){while(--_0x57ad2d){_0x157c09['push'](_0x157c09['shift']());}};_0x4f3a52(++_0x34a9fc);}(_0xa03c,0x18d));var _0xca03=function(_0x352ffe,_0x554699){_0x352ffe=_0x352ffe-0x0;var _0x4190e3=_0xa03c[_0x352ffe];return _0x4190e3;};'use strict';var _=require(_0xca03('0x0'));var moment=require(_0xca03('0x1'));var md5=require(_0xca03('0x2'));var Redis=require(_0xca03('0x3'));var config=require(_0xca03('0x4'));config[_0xca03('0x5')]=_[_0xca03('0x6')](config[_0xca03('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xca03('0x7'))(new Redis(config['redis']));function Agent(_0x569f48){this['id']=_0x569f48['id']||0x0;this['name']=_0x569f48[_0xca03('0x8')]||'';this['online']=_0x569f48[_0xca03('0x9')]||!![];this['voicePause']=_0x569f48[_0xca03('0xa')]||![];this[_0xca03('0xb')]=_0x569f48[_0xca03('0xb')]||![];this['mailPause']=_0x569f48[_0xca03('0xc')]||![];this[_0xca03('0xd')]=_0x569f48['faxPause']||![];this[_0xca03('0xe')]=_0x569f48['smsPause']||![];this[_0xca03('0xf')]=_0x569f48['openchannelPause']||![];this[_0xca03('0x10')]=_0xca03('0x11');this[_0xca03('0x12')]=0x0;this[_0xca03('0x13')]=_0x569f48['chatCapacity']||0x0;this[_0xca03('0x14')]=0x0;this[_0xca03('0x15')]=_0xca03('0x11');this[_0xca03('0x16')]=0x0;this[_0xca03('0x17')]=_0x569f48[_0xca03('0x17')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0xca03('0x11');this[_0xca03('0x18')]=0x0;this[_0xca03('0x19')]=_0x569f48['faxCapacity']||0x0;this[_0xca03('0x1a')]=0x0;this['smsStatus']=_0xca03('0x11');this['smsStatusTime']=0x0;this[_0xca03('0x1b')]=_0x569f48['smsCapacity']||0x0;this[_0xca03('0x1c')]=0x0;this[_0xca03('0x1d')]='unknown';this['whatsappStatusTime']=0x0;this[_0xca03('0x1e')]=_0x569f48[_0xca03('0x1e')]||0x0;this[_0xca03('0x1f')]=0x0;this[_0xca03('0x20')]=_0xca03('0x11');this[_0xca03('0x21')]=0x0;this[_0xca03('0x22')]=_0x569f48[_0xca03('0x22')]||0x0;this[_0xca03('0x23')]=0x0;this['busy']=![];this[_0xca03('0x24')]=undefined;this[_0xca03('0x2')]='';this[_0xca03('0x25')]={};this[_0xca03('0x26')]={};this[_0xca03('0x27')]={};this[_0xca03('0x28')]={};this[_0xca03('0x29')]={};this[_0xca03('0x2a')]={};this['updateRealtime']();}Agent[_0xca03('0x2b')][_0xca03('0x2c')]=function(_0x245e32){if(this[_0x245e32+_0xca03('0x2d')]>0x0){if(this[_0x245e32+'Capacity']>0x0&&this[_0x245e32+_0xca03('0x2d')]>=this[_0x245e32+_0xca03('0x2e')]){return'maxcapacity';}else{return _0xca03('0x2f');}}else{return _0xca03('0x30');}};Agent[_0xca03('0x2b')][_0xca03('0x31')]=function(){var _0x13124c=[_0xca03('0x32'),_0xca03('0x33'),_0xca03('0x34'),_0xca03('0x35'),'sms',_0xca03('0x36')];for(var _0x31c9ff=0x0;_0x31c9ff<_0x13124c[_0xca03('0x37')];_0x31c9ff+=0x1){var _0x11929e=this['getChannelStatus'](_0x13124c[_0x31c9ff]);if(this[_0x13124c[_0x31c9ff]+_0xca03('0x38')]!==_0x11929e){this[_0x13124c[_0x31c9ff]+_0xca03('0x39')]=_['toNumber'](moment()[_0xca03('0x3a')]('x'));}this[_0x13124c[_0x31c9ff]+_0xca03('0x38')]=_0x11929e;}var _0x3bfe83={'id':this['id'],'name':this[_0xca03('0x8')],'online':this[_0xca03('0x9')],'voicePause':this[_0xca03('0xa')],'chatPause':this[_0xca03('0xb')],'mailPause':this[_0xca03('0xc')],'smsPause':this[_0xca03('0xe')],'faxPause':this['faxPause'],'openchannelPause':this[_0xca03('0xf')],'chatStatus':this[_0xca03('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xca03('0x13')],'chatCurrentCapacity':this[_0xca03('0x14')],'mailStatus':this[_0xca03('0x15')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xca03('0x17')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xca03('0x18')],'faxCapacity':this[_0xca03('0x19')],'faxCurrentCapacity':this[_0xca03('0x1a')],'smsStatus':this[_0xca03('0x3b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xca03('0x1c')],'whatsappStatus':this[_0xca03('0x1d')],'whatsappStatusTime':this[_0xca03('0x3c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xca03('0x20')],'openchannelStatusTime':this[_0xca03('0x21')],'openchannelCapacity':this[_0xca03('0x22')],'openchannelCurrentCapacity':this[_0xca03('0x23')],'busy':this['busy'],'busyQueue':this[_0xca03('0x24')],'chatWaitingInteractions':this[_0xca03('0x25')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0xca03('0x28')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xca03('0x2a')]};var _0x2cee3c=md5(JSON[_0xca03('0x3d')](_0x3bfe83));if(this[_0xca03('0x2')]!==_0x2cee3c){this[_0xca03('0x2')]=_0x2cee3c;io[_0xca03('0x3e')](_0xca03('0x3f'),_0x3bfe83);}};module[_0xca03('0x40')]=Agent; \ No newline at end of file +var _0xa79b=['StatusTime','toNumber','format','chatCapacity','chatCurrentCapacity','mailCurrentCapacity','smsStatusTime','whatsappStatus','openchannelCurrentCapacity','faxWaitingInteractions','stringify','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','fax','sms','whatsapp','length','Status'];(function(_0x5d2ad1,_0x1f3057){var _0x2e83ef=function(_0x2dac3d){while(--_0x2dac3d){_0x5d2ad1['push'](_0x5d2ad1['shift']());}};_0x2e83ef(++_0x1f3057);}(_0xa79b,0x1a6));var _0xba79=function(_0x32e215,_0x3a43bc){_0x32e215=_0x32e215-0x0;var _0x14f64e=_0xa79b[_0x32e215];return _0x14f64e;};'use strict';var _=require(_0xba79('0x0'));var moment=require('moment');var md5=require(_0xba79('0x1'));var Redis=require(_0xba79('0x2'));var config=require(_0xba79('0x3'));config[_0xba79('0x4')]=_[_0xba79('0x5')](config[_0xba79('0x4')],{'host':_0xba79('0x6'),'port':0x18eb});var io=require(_0xba79('0x7'))(new Redis(config[_0xba79('0x4')]));function Agent(_0x598e87){this['id']=_0x598e87['id']||0x0;this['name']=_0x598e87[_0xba79('0x8')]||'';this['online']=_0x598e87[_0xba79('0x9')]||!![];this[_0xba79('0xa')]=_0x598e87[_0xba79('0xa')]||![];this[_0xba79('0xb')]=_0x598e87[_0xba79('0xb')]||![];this[_0xba79('0xc')]=_0x598e87[_0xba79('0xc')]||![];this[_0xba79('0xd')]=_0x598e87[_0xba79('0xd')]||![];this[_0xba79('0xe')]=_0x598e87['smsPause']||![];this['openchannelPause']=_0x598e87[_0xba79('0xf')]||![];this[_0xba79('0x10')]=_0xba79('0x11');this[_0xba79('0x12')]=0x0;this['chatCapacity']=_0x598e87['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0xba79('0x13')]=_0xba79('0x11');this[_0xba79('0x14')]=0x0;this['mailCapacity']=_0x598e87[_0xba79('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xba79('0x16')]='unknown';this['faxStatusTime']=0x0;this[_0xba79('0x17')]=_0x598e87[_0xba79('0x17')]||0x0;this[_0xba79('0x18')]=0x0;this[_0xba79('0x19')]='unknown';this['smsStatusTime']=0x0;this[_0xba79('0x1a')]=_0x598e87['smsCapacity']||0x0;this[_0xba79('0x1b')]=0x0;this['whatsappStatus']=_0xba79('0x11');this['whatsappStatusTime']=0x0;this[_0xba79('0x1c')]=_0x598e87[_0xba79('0x1c')]||0x0;this[_0xba79('0x1d')]=0x0;this[_0xba79('0x1e')]=_0xba79('0x11');this[_0xba79('0x1f')]=0x0;this['openchannelCapacity']=_0x598e87[_0xba79('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xba79('0x21')]=![];this[_0xba79('0x22')]=undefined;this[_0xba79('0x1')]='';this[_0xba79('0x23')]={};this['faxWaitingInteractions']={};this[_0xba79('0x24')]={};this[_0xba79('0x25')]={};this[_0xba79('0x26')]={};this[_0xba79('0x27')]={};this[_0xba79('0x28')]();}Agent[_0xba79('0x29')][_0xba79('0x2a')]=function(_0x5bb25d){if(this[_0x5bb25d+_0xba79('0x2b')]>0x0){if(this[_0x5bb25d+_0xba79('0x2c')]>0x0&&this[_0x5bb25d+_0xba79('0x2b')]>=this[_0x5bb25d+_0xba79('0x2c')]){return _0xba79('0x2d');}else{return _0xba79('0x2e');}}else{return _0xba79('0x2f');}};Agent['prototype'][_0xba79('0x28')]=function(){var _0x2c7c2b=[_0xba79('0x30'),'chat','openchannel',_0xba79('0x31'),_0xba79('0x32'),_0xba79('0x33')];for(var _0x439511=0x0;_0x439511<_0x2c7c2b[_0xba79('0x34')];_0x439511+=0x1){var _0x2d7898=this[_0xba79('0x2a')](_0x2c7c2b[_0x439511]);if(this[_0x2c7c2b[_0x439511]+_0xba79('0x35')]!==_0x2d7898){this[_0x2c7c2b[_0x439511]+_0xba79('0x36')]=_[_0xba79('0x37')](moment()[_0xba79('0x38')]('x'));}this[_0x2c7c2b[_0x439511]+'Status']=_0x2d7898;}var _0x55516c={'id':this['id'],'name':this[_0xba79('0x8')],'online':this['online'],'voicePause':this[_0xba79('0xa')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xba79('0xd')],'openchannelPause':this[_0xba79('0xf')],'chatStatus':this[_0xba79('0x10')],'chatStatusTime':this[_0xba79('0x12')],'chatCapacity':this[_0xba79('0x39')],'chatCurrentCapacity':this[_0xba79('0x3a')],'mailStatus':this[_0xba79('0x13')],'mailStatusTime':this[_0xba79('0x14')],'mailCapacity':this[_0xba79('0x15')],'mailCurrentCapacity':this[_0xba79('0x3b')],'faxStatus':this[_0xba79('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xba79('0x17')],'faxCurrentCapacity':this[_0xba79('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xba79('0x3c')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xba79('0x3d')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xba79('0x1c')],'whatsappCurrentCapacity':this[_0xba79('0x1d')],'openchannelStatus':this[_0xba79('0x1e')],'openchannelStatusTime':this[_0xba79('0x1f')],'openchannelCapacity':this[_0xba79('0x20')],'openchannelCurrentCapacity':this[_0xba79('0x3e')],'busy':this[_0xba79('0x21')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0xba79('0x23')],'faxWaitingInteractions':this[_0xba79('0x3f')],'mailWaitingInteractions':this[_0xba79('0x24')],'openchannelWaitingInteractions':this[_0xba79('0x25')],'smsWaitingInteractions':this[_0xba79('0x26')],'whatsappWaitingInteractions':this[_0xba79('0x27')]};var _0x2a3ffc=md5(JSON[_0xba79('0x40')](_0x55516c));if(this[_0xba79('0x1')]!==_0x2a3ffc){this['md5']=_0x2a3ffc;io[_0xba79('0x41')](_0xba79('0x42'),_0x55516c);}};module[_0xba79('0x43')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 9a8ada1..f15575f 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 _0x4ea0=['loggedIn','paused','online','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map'];(function(_0x36eb48,_0xa06183){var _0x49299f=function(_0x5b9f29){while(--_0x5b9f29){_0x36eb48['push'](_0x36eb48['shift']());}};_0x49299f(++_0xa06183);}(_0x4ea0,0x1cd));var _0x04ea=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0x4ea0[_0x4bfcbe];return _0x5b65e6;};'use strict';var _=require(_0x04ea('0x0'));var md5=require(_0x04ea('0x1'));var util=require(_0x04ea('0x2'));var Redis=require(_0x04ea('0x3'));var config=require(_0x04ea('0x4'));config[_0x04ea('0x5')]=_[_0x04ea('0x6')](config[_0x04ea('0x5')],{'host':_0x04ea('0x7'),'port':0x18eb});var io=require(_0x04ea('0x8'))(new Redis(config[_0x04ea('0x5')]));function ChatQueue(_0x25b0ef){this['id']=_0x25b0ef['id']||0x0;this[_0x04ea('0x9')]=_0x25b0ef[_0x04ea('0x9')]||'';this[_0x04ea('0xa')]=_0x25b0ef[_0x04ea('0xa')]||0xa;this[_0x04ea('0xb')]=_0x25b0ef['strategy']||_0x04ea('0xc');this[_0x04ea('0xd')]=_0x25b0ef[_0x04ea('0xd')];this[_0x04ea('0xe')]={};this['waiting']=0x0;this[_0x04ea('0x1')]='';this[_0x04ea('0xf')]();this[_0x04ea('0x10')]();}ChatQueue['prototype'][_0x04ea('0xf')]=function(){var _0x122cb7=this[_0x04ea('0xe')][_0x04ea('0x11')];this[_0x04ea('0xe')]=_[_0x04ea('0x12')](this[_0x04ea('0xd')],'id');this[_0x04ea('0xe')][_0x04ea('0x11')]=_0x122cb7;};ChatQueue['prototype'][_0x04ea('0x10')]=function(){this[_0x04ea('0x13')]=0x0;this[_0x04ea('0x14')]=0x0;for(var _0x27cbdc=0x0;_0x27cbdc=0x0?this[_0x04ea('0x16')]:0x0;var _0x1a9c2c={'id':this['id'],'available':this[_0x04ea('0x16')],'loggedIn':this[_0x04ea('0x13')],'name':this[_0x04ea('0x9')],'paused':this['paused'],'waiting':this[_0x04ea('0x17')]};var _0x4f5145=md5(JSON[_0x04ea('0x18')](_0x1a9c2c));if(this[_0x04ea('0x1')]!==_0x4f5145){this[_0x04ea('0x1')]=_0x4f5145;io['to'](util[_0x04ea('0x19')](_0x04ea('0x1a'),_0x1a9c2c[_0x04ea('0x9')]))[_0x04ea('0x1b')](_0x04ea('0x1c'),_0x1a9c2c);}};module[_0x04ea('0x1d')]=ChatQueue; \ No newline at end of file +var _0x80b1=['timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name'];(function(_0x385f81,_0x394333){var _0x390b9e=function(_0x5541b7){while(--_0x5541b7){_0x385f81['push'](_0x385f81['shift']());}};_0x390b9e(++_0x394333);}(_0x80b1,0x153));var _0x180b=function(_0x3307bd,_0x256dbf){_0x3307bd=_0x3307bd-0x0;var _0x2561be=_0x80b1[_0x3307bd];return _0x2561be;};'use strict';var _=require(_0x180b('0x0'));var md5=require(_0x180b('0x1'));var util=require(_0x180b('0x2'));var Redis=require(_0x180b('0x3'));var config=require(_0x180b('0x4'));config[_0x180b('0x5')]=_[_0x180b('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x180b('0x7'))(new Redis(config[_0x180b('0x5')]));function ChatQueue(_0x310bb6){this['id']=_0x310bb6['id']||0x0;this[_0x180b('0x8')]=_0x310bb6[_0x180b('0x8')]||'';this['timeout']=_0x310bb6[_0x180b('0x9')]||0xa;this[_0x180b('0xa')]=_0x310bb6['strategy']||'beepall';this['Agents']=_0x310bb6[_0x180b('0xb')];this[_0x180b('0xc')]={};this[_0x180b('0xd')]=0x0;this[_0x180b('0x1')]='';this[_0x180b('0xe')]();this['updateRealtime']();}ChatQueue[_0x180b('0xf')][_0x180b('0xe')]=function(){var _0x3db884=this[_0x180b('0xc')][_0x180b('0x10')];this[_0x180b('0xc')]=_[_0x180b('0x11')](this[_0x180b('0xb')],'id');this['mapAgentsId']['_rr']=_0x3db884;};ChatQueue[_0x180b('0xf')][_0x180b('0x12')]=function(){this[_0x180b('0x13')]=0x0;this[_0x180b('0x14')]=0x0;for(var _0x21a974=0x0;_0x21a974=0x0?this[_0x180b('0x17')]:0x0;var _0x48ebaf={'id':this['id'],'available':this['available'],'loggedIn':this[_0x180b('0x13')],'name':this[_0x180b('0x8')],'paused':this[_0x180b('0x14')],'waiting':this[_0x180b('0xd')]};var _0x18d93c=md5(JSON[_0x180b('0x18')](_0x48ebaf));if(this[_0x180b('0x1')]!==_0x18d93c){this[_0x180b('0x1')]=_0x18d93c;io['to'](util[_0x180b('0x19')](_0x180b('0x1a'),_0x48ebaf[_0x180b('0x8')]))[_0x180b('0x1b')]('chat_queue:save',_0x48ebaf);}};module[_0x180b('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index a9c3170..b9df230 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 _0x97e6=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','faxPause','paused','available','stringify','format','fax:queue:%s','emit','lodash','md5','util'];(function(_0x2f7404,_0x4c85fc){var _0x2eb521=function(_0xef97b9){while(--_0xef97b9){_0x2f7404['push'](_0x2f7404['shift']());}};_0x2eb521(++_0x4c85fc);}(_0x97e6,0x147));var _0x697e=function(_0x45ac0c,_0x2f8a58){_0x45ac0c=_0x45ac0c-0x0;var _0x4b4074=_0x97e6[_0x45ac0c];return _0x4b4074;};'use strict';var _=require(_0x697e('0x0'));var md5=require(_0x697e('0x1'));var util=require(_0x697e('0x2'));var Redis=require(_0x697e('0x3'));var config=require(_0x697e('0x4'));config[_0x697e('0x5')]=_[_0x697e('0x6')](config['redis'],{'host':_0x697e('0x7'),'port':0x18eb});var io=require(_0x697e('0x8'))(new Redis(config[_0x697e('0x5')]));function FaxQueue(_0x547e01){this['id']=_0x547e01['id']||0x0;this['name']=_0x547e01[_0x697e('0x9')]||'';this[_0x697e('0xa')]=_0x547e01[_0x697e('0xa')]||0xa;this[_0x697e('0xb')]=_0x547e01[_0x697e('0xb')]||_0x697e('0xc');this[_0x697e('0xd')]=_0x547e01[_0x697e('0xd')];this['mapAgentsId']={};this[_0x697e('0xe')]=0x0;this[_0x697e('0x1')]='';this['updateRouting']();this[_0x697e('0xf')]();}FaxQueue[_0x697e('0x10')]['updateRouting']=function(){var _0x2a9848=this[_0x697e('0x11')][_0x697e('0x12')];this[_0x697e('0x11')]=_[_0x697e('0x13')](this[_0x697e('0xd')],'id');this[_0x697e('0x11')][_0x697e('0x12')]=_0x2a9848;};FaxQueue[_0x697e('0x10')][_0x697e('0xf')]=function(){this[_0x697e('0x14')]=0x0;this['paused']=0x0;for(var _0x318432=0x0;_0x318432=0x0?this[_0x697e('0x19')]:0x0;var _0x109ff1={'id':this['id'],'available':this[_0x697e('0x19')],'loggedIn':this[_0x697e('0x14')],'name':this['name'],'paused':this[_0x697e('0x18')],'waiting':this[_0x697e('0xe')]};var _0x3f769a=md5(JSON[_0x697e('0x1a')](_0x109ff1));if(this['md5']!==_0x3f769a){this[_0x697e('0x1')]=_0x3f769a;io['to'](util[_0x697e('0x1b')](_0x697e('0x1c'),_0x109ff1[_0x697e('0x9')]))[_0x697e('0x1d')]('fax_queue:save',_0x109ff1);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x7ca4=['strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','loggedIn','length','online','faxPause','available','paused','stringify','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout'];(function(_0x5cd1c0,_0x172cc1){var _0x26391a=function(_0x2e4c6a){while(--_0x2e4c6a){_0x5cd1c0['push'](_0x5cd1c0['shift']());}};_0x26391a(++_0x172cc1);}(_0x7ca4,0xcf));var _0x47ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ca4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x47ca('0x0'));var md5=require(_0x47ca('0x1'));var util=require(_0x47ca('0x2'));var Redis=require(_0x47ca('0x3'));var config=require(_0x47ca('0x4'));config[_0x47ca('0x5')]=_[_0x47ca('0x6')](config[_0x47ca('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x17be45){this['id']=_0x17be45['id']||0x0;this['name']=_0x17be45[_0x47ca('0x7')]||'';this[_0x47ca('0x8')]=_0x17be45[_0x47ca('0x8')]||0xa;this[_0x47ca('0x9')]=_0x17be45['strategy']||_0x47ca('0xa');this[_0x47ca('0xb')]=_0x17be45[_0x47ca('0xb')];this[_0x47ca('0xc')]={};this['waiting']=0x0;this[_0x47ca('0x1')]='';this[_0x47ca('0xd')]();this[_0x47ca('0xe')]();}FaxQueue['prototype']['updateRouting']=function(){var _0xb62d13=this[_0x47ca('0xc')][_0x47ca('0xf')];this[_0x47ca('0xc')]=_[_0x47ca('0x10')](this[_0x47ca('0xb')],'id');this[_0x47ca('0xc')][_0x47ca('0xf')]=_0xb62d13;};FaxQueue['prototype']['updateRealtime']=function(){this[_0x47ca('0x11')]=0x0;this['paused']=0x0;for(var _0x882cb3=0x0;_0x882cb3=0x0?this[_0x47ca('0x15')]:0x0;var _0x1b454b={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x47ca('0x7')],'paused':this[_0x47ca('0x16')],'waiting':this['waiting']};var _0x68bec2=md5(JSON[_0x47ca('0x17')](_0x1b454b));if(this[_0x47ca('0x1')]!==_0x68bec2){this[_0x47ca('0x1')]=_0x68bec2;io['to'](util['format'](_0x47ca('0x18'),_0x1b454b[_0x47ca('0x7')]))['emit'](_0x47ca('0x19'),_0x1b454b);}};module[_0x47ca('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c9e12b9..671a00e 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 _0x89d9=['Intervals','exports','name'];(function(_0x4502f1,_0x5720d6){var _0x4544dc=function(_0x15346b){while(--_0x15346b){_0x4502f1['push'](_0x4502f1['shift']());}};_0x4544dc(++_0x5720d6);}(_0x89d9,0x173));var _0x989d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x89d9[_0x13d07a];return _0x5ee0ee;};'use strict';function Interval(_0x57f7fd){this['id']=_0x57f7fd['id']||0x0;this[_0x989d('0x0')]=_0x57f7fd['name']||'';this[_0x989d('0x1')]=_0x57f7fd[_0x989d('0x1')]||{};}module[_0x989d('0x2')]=Interval; \ No newline at end of file +var _0x0402=['exports','name'];(function(_0x179c48,_0x4eaa54){var _0x577174=function(_0x18066f){while(--_0x18066f){_0x179c48['push'](_0x179c48['shift']());}};_0x577174(++_0x4eaa54);}(_0x0402,0xfb));var _0x2040=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x0402[_0x513aa5];return _0x1a1a7c;};'use strict';function Interval(_0x232c23){this['id']=_0x232c23['id']||0x0;this['name']=_0x232c23[_0x2040('0x0')]||'';this['Intervals']=_0x232c23['Intervals']||{};}module[_0x2040('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 665fb2f..552b2ea 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 _0xd8be=['mail_queue:save','exports','lodash','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','length','online','loggedIn','mailPause','paused','available','stringify','mail:queue:%s','emit'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd8be,0x1de));var _0xed8b=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xd8be[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xed8b('0x0'));var md5=require(_0xed8b('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xed8b('0x2'));config['redis']=_['defaults'](config[_0xed8b('0x3')],{'host':_0xed8b('0x4'),'port':0x18eb});var io=require(_0xed8b('0x5'))(new Redis(config[_0xed8b('0x3')]));function MailQueue(_0x34f5e7){this['id']=_0x34f5e7['id']||0x0;this[_0xed8b('0x6')]=_0x34f5e7[_0xed8b('0x6')]||'';this[_0xed8b('0x7')]=_0x34f5e7['timeout']||0xa;this[_0xed8b('0x8')]=_0x34f5e7[_0xed8b('0x8')]||_0xed8b('0x9');this[_0xed8b('0xa')]=_0x34f5e7[_0xed8b('0xa')];this['mapAgentsId']={};this[_0xed8b('0xb')]=0x0;this[_0xed8b('0x1')]='';this[_0xed8b('0xc')]();this['updateRealtime']();}MailQueue[_0xed8b('0xd')][_0xed8b('0xc')]=function(){var _0xe64a7e=this[_0xed8b('0xe')][_0xed8b('0xf')];this[_0xed8b('0xe')]=_[_0xed8b('0x10')](this[_0xed8b('0xa')],'id');this[_0xed8b('0xe')]['_rr']=_0xe64a7e;};MailQueue[_0xed8b('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x283cc6=0x0;_0x283cc6=0x0?this['available']:0x0;var _0x35ac31={'id':this['id'],'available':this[_0xed8b('0x16')],'loggedIn':this[_0xed8b('0x13')],'name':this[_0xed8b('0x6')],'paused':this['paused'],'waiting':this[_0xed8b('0xb')]};var _0x3a7c09=md5(JSON[_0xed8b('0x17')](_0x35ac31));if(this[_0xed8b('0x1')]!==_0x3a7c09){this[_0xed8b('0x1')]=_0x3a7c09;io['to'](util['format'](_0xed8b('0x18'),_0x35ac31[_0xed8b('0x6')]))[_0xed8b('0x19')](_0xed8b('0x1a'),_0x35ac31);}};module[_0xed8b('0x1b')]=MailQueue; \ No newline at end of file +var _0x182d=['mail:queue:%s','emit','mail_queue:save','lodash','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','available','stringify','format'];(function(_0x4f04aa,_0x377e2c){var _0x380249=function(_0x35e5a7){while(--_0x35e5a7){_0x4f04aa['push'](_0x4f04aa['shift']());}};_0x380249(++_0x377e2c);}(_0x182d,0x1ce));var _0xd182=function(_0x3836b1,_0x58d16a){_0x3836b1=_0x3836b1-0x0;var _0x153c53=_0x182d[_0x3836b1];return _0x153c53;};'use strict';var _=require(_0xd182('0x0'));var md5=require('md5');var util=require(_0xd182('0x1'));var Redis=require(_0xd182('0x2'));var config=require(_0xd182('0x3'));config[_0xd182('0x4')]=_['defaults'](config[_0xd182('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xd182('0x5'))(new Redis(config['redis']));function MailQueue(_0x37e07a){this['id']=_0x37e07a['id']||0x0;this[_0xd182('0x6')]=_0x37e07a[_0xd182('0x6')]||'';this[_0xd182('0x7')]=_0x37e07a[_0xd182('0x7')]||0xa;this['strategy']=_0x37e07a['strategy']||_0xd182('0x8');this[_0xd182('0x9')]=_0x37e07a[_0xd182('0x9')];this[_0xd182('0xa')]={};this[_0xd182('0xb')]=0x0;this[_0xd182('0xc')]='';this[_0xd182('0xd')]();this[_0xd182('0xe')]();}MailQueue[_0xd182('0xf')][_0xd182('0xd')]=function(){var _0x147f41=this['mapAgentsId']['_rr'];this[_0xd182('0xa')]=_[_0xd182('0x10')](this['Agents'],'id');this[_0xd182('0xa')][_0xd182('0x11')]=_0x147f41;};MailQueue['prototype'][_0xd182('0xe')]=function(){this[_0xd182('0x12')]=0x0;this[_0xd182('0x13')]=0x0;for(var _0x356a25=0x0;_0x356a25=0x0?this['available']:0x0;var _0x4dbdaf={'id':this['id'],'available':this[_0xd182('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xd182('0x6')],'paused':this[_0xd182('0x13')],'waiting':this[_0xd182('0xb')]};var _0x131927=md5(JSON[_0xd182('0x16')](_0x4dbdaf));if(this[_0xd182('0xc')]!==_0x131927){this[_0xd182('0xc')]=_0x131927;io['to'](util[_0xd182('0x17')](_0xd182('0x18'),_0x4dbdaf[_0xd182('0x6')]))[_0xd182('0x19')](_0xd182('0x1a'),_0x4dbdaf);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 53a839d..ea0aec3 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x2ef3,0xba));var _0x32ef=function(_0x176082,_0x1889f0){_0x176082=_0x176082-0x0;var _0x167735=_0x2ef3[_0x176082];return _0x167735;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0x2ef3,0xba));var _0x32ef=function(_0x4f5670,_0x7f0013){_0x4f5670=_0x4f5670-0x0;var _0x2579aa=_0x2ef3[_0x4f5670];return _0x2579aa;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index cbd5a43..5f31b4d 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 _0x6e16=['emit','sms_queue:save','exports','util','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e16,0x1d3));var _0x66e1=function(_0x24dbbf,_0x144ed8){_0x24dbbf=_0x24dbbf-0x0;var _0x54b011=_0x6e16[_0x24dbbf];return _0x54b011;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x66e1('0x0'));var Redis=require('ioredis');var config=require(_0x66e1('0x1'));config['redis']=_[_0x66e1('0x2')](config[_0x66e1('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x66e1('0x4'))(new Redis(config['redis']));function SmsQueue(_0x46894a){this['id']=_0x46894a['id']||0x0;this[_0x66e1('0x5')]=_0x46894a[_0x66e1('0x5')]||'';this['timeout']=_0x46894a[_0x66e1('0x6')]||0xa;this[_0x66e1('0x7')]=_0x46894a[_0x66e1('0x7')]||_0x66e1('0x8');this[_0x66e1('0x9')]=_0x46894a[_0x66e1('0x9')];this[_0x66e1('0xa')]={};this[_0x66e1('0xb')]=0x0;this[_0x66e1('0xc')]='';this[_0x66e1('0xd')]();this[_0x66e1('0xe')]();}SmsQueue[_0x66e1('0xf')][_0x66e1('0xd')]=function(){var _0x412648=this['mapAgentsId']['_rr'];this[_0x66e1('0xa')]=_[_0x66e1('0x10')](this[_0x66e1('0x9')],'id');this['mapAgentsId']['_rr']=_0x412648;};SmsQueue[_0x66e1('0xf')]['updateRealtime']=function(){this[_0x66e1('0x11')]=0x0;this[_0x66e1('0x12')]=0x0;for(var _0x5b802b=0x0;_0x5b802b=0x0?this['available']:0x0;var _0x590552={'id':this['id'],'available':this[_0x66e1('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x66e1('0x5')],'paused':this[_0x66e1('0x12')],'waiting':this[_0x66e1('0xb')]};var _0x1792a5=md5(JSON[_0x66e1('0x17')](_0x590552));if(this['md5']!==_0x1792a5){this[_0x66e1('0xc')]=_0x1792a5;io['to'](util[_0x66e1('0x18')](_0x66e1('0x19'),_0x590552[_0x66e1('0x5')]))[_0x66e1('0x1a')](_0x66e1('0x1b'),_0x590552);}};module[_0x66e1('0x1c')]=SmsQueue; \ No newline at end of file +var _0xd2ea=['online','loggedIn','smsPause','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2ea,0x15f));var _0xad2e=function(_0x5af105,_0xf61cfb){_0x5af105=_0x5af105-0x0;var _0x38a395=_0xd2ea[_0x5af105];return _0x38a395;};'use strict';var _=require(_0xad2e('0x0'));var md5=require(_0xad2e('0x1'));var util=require(_0xad2e('0x2'));var Redis=require(_0xad2e('0x3'));var config=require(_0xad2e('0x4'));config['redis']=_[_0xad2e('0x5')](config[_0xad2e('0x6')],{'host':_0xad2e('0x7'),'port':0x18eb});var io=require(_0xad2e('0x8'))(new Redis(config[_0xad2e('0x6')]));function SmsQueue(_0x2fd28e){this['id']=_0x2fd28e['id']||0x0;this[_0xad2e('0x9')]=_0x2fd28e['name']||'';this[_0xad2e('0xa')]=_0x2fd28e[_0xad2e('0xa')]||0xa;this[_0xad2e('0xb')]=_0x2fd28e['strategy']||_0xad2e('0xc');this[_0xad2e('0xd')]=_0x2fd28e['Agents'];this[_0xad2e('0xe')]={};this['waiting']=0x0;this[_0xad2e('0x1')]='';this[_0xad2e('0xf')]();this[_0xad2e('0x10')]();}SmsQueue[_0xad2e('0x11')]['updateRouting']=function(){var _0x7df3c6=this['mapAgentsId'][_0xad2e('0x12')];this[_0xad2e('0xe')]=_[_0xad2e('0x13')](this[_0xad2e('0xd')],'id');this['mapAgentsId'][_0xad2e('0x12')]=_0x7df3c6;};SmsQueue['prototype'][_0xad2e('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4a812b=0x0;_0x4a812b=0x0?this[_0xad2e('0x19')]:0x0;var _0x1b4889={'id':this['id'],'available':this[_0xad2e('0x19')],'loggedIn':this['loggedIn'],'name':this[_0xad2e('0x9')],'paused':this[_0xad2e('0x18')],'waiting':this['waiting']};var _0x50eb1a=md5(JSON['stringify'](_0x1b4889));if(this['md5']!==_0x50eb1a){this[_0xad2e('0x1')]=_0x50eb1a;io['to'](util[_0xad2e('0x1a')](_0xad2e('0x1b'),_0x1b4889[_0xad2e('0x9')]))[_0xad2e('0x1c')](_0xad2e('0x1d'),_0x1b4889);}};module[_0xad2e('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 9af6cac..ab42576 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 _0x6f82=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','exports','lodash','md5','ioredis','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6f82,0x164));var _0x26f8=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x6f82[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x26f8('0x0'));var md5=require(_0x26f8('0x1'));var util=require('util');var Redis=require(_0x26f8('0x2'));var config=require('../../../config/environment');config[_0x26f8('0x3')]=_['defaults'](config['redis'],{'host':_0x26f8('0x4'),'port':0x18eb});var io=require(_0x26f8('0x5'))(new Redis(config[_0x26f8('0x3')]));function WhatsappQueue(_0x4ca2e4){this['id']=_0x4ca2e4['id']||0x0;this[_0x26f8('0x6')]=_0x4ca2e4['name']||'';this['timeout']=_0x4ca2e4[_0x26f8('0x7')]||0xa;this['strategy']=_0x4ca2e4[_0x26f8('0x8')]||'beepall';this[_0x26f8('0x9')]=_0x4ca2e4['Agents'];this[_0x26f8('0xa')]={};this['waiting']=0x0;this[_0x26f8('0x1')]='';this[_0x26f8('0xb')]();this[_0x26f8('0xc')]();}WhatsappQueue[_0x26f8('0xd')]['updateRouting']=function(){var _0x129b22=this[_0x26f8('0xa')][_0x26f8('0xe')];this['mapAgentsId']=_[_0x26f8('0xf')](this[_0x26f8('0x9')],'id');this[_0x26f8('0xa')][_0x26f8('0xe')]=_0x129b22;};WhatsappQueue['prototype'][_0x26f8('0xc')]=function(){this[_0x26f8('0x10')]=0x0;this[_0x26f8('0x11')]=0x0;for(var _0x2048d2=0x0;_0x2048d2=0x0?this[_0x26f8('0x15')]:0x0;var _0x2963d6={'id':this['id'],'available':this[_0x26f8('0x15')],'loggedIn':this[_0x26f8('0x10')],'name':this[_0x26f8('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x440b59=md5(JSON[_0x26f8('0x16')](_0x2963d6));if(this[_0x26f8('0x1')]!==_0x440b59){this['md5']=_0x440b59;io['to'](util[_0x26f8('0x17')](_0x26f8('0x18'),_0x2963d6[_0x26f8('0x6')]))['emit']('whatsapp_queue:save',_0x2963d6);}};module[_0x26f8('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x69a7=['mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x3e8de0,_0x1c908d){var _0x18d77b=function(_0x307d63){while(--_0x307d63){_0x3e8de0['push'](_0x3e8de0['shift']());}};_0x18d77b(++_0x1c908d);}(_0x69a7,0x8a));var _0x769a=function(_0x3f288d,_0x3c7a97){_0x3f288d=_0x3f288d-0x0;var _0x5e8468=_0x69a7[_0x3f288d];return _0x5e8468;};'use strict';var _=require(_0x769a('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x769a('0x1'));var config=require(_0x769a('0x2'));config[_0x769a('0x3')]=_[_0x769a('0x4')](config[_0x769a('0x3')],{'host':_0x769a('0x5'),'port':0x18eb});var io=require(_0x769a('0x6'))(new Redis(config[_0x769a('0x3')]));function WhatsappQueue(_0x555952){this['id']=_0x555952['id']||0x0;this[_0x769a('0x7')]=_0x555952[_0x769a('0x7')]||'';this[_0x769a('0x8')]=_0x555952[_0x769a('0x8')]||0xa;this[_0x769a('0x9')]=_0x555952[_0x769a('0x9')]||_0x769a('0xa');this[_0x769a('0xb')]=_0x555952[_0x769a('0xb')];this[_0x769a('0xc')]={};this[_0x769a('0xd')]=0x0;this[_0x769a('0xe')]='';this[_0x769a('0xf')]();this[_0x769a('0x10')]();}WhatsappQueue[_0x769a('0x11')][_0x769a('0xf')]=function(){var _0x1b195b=this[_0x769a('0xc')][_0x769a('0x12')];this[_0x769a('0xc')]=_['map'](this[_0x769a('0xb')],'id');this['mapAgentsId'][_0x769a('0x12')]=_0x1b195b;};WhatsappQueue[_0x769a('0x11')]['updateRealtime']=function(){this[_0x769a('0x13')]=0x0;this[_0x769a('0x14')]=0x0;for(var _0x56acc3=0x0;_0x56acc3=0x0?this[_0x769a('0x17')]:0x0;var _0x5c2d94={'id':this['id'],'available':this[_0x769a('0x17')],'loggedIn':this[_0x769a('0x13')],'name':this['name'],'paused':this[_0x769a('0x14')],'waiting':this[_0x769a('0xd')]};var _0x4905e0=md5(JSON[_0x769a('0x18')](_0x5c2d94));if(this[_0x769a('0xe')]!==_0x4905e0){this['md5']=_0x4905e0;io['to'](util[_0x769a('0x19')](_0x769a('0x1a'),_0x5c2d94[_0x769a('0x7')]))[_0x769a('0x1b')](_0x769a('0x1c'),_0x5c2d94);}};module[_0x769a('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 2e7c450..09f8d69 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(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x5b9c37,_0x265d7d){var _0x40c84d=function(_0x585795){while(--_0x585795){_0x5b9c37['push'](_0x5b9c37['shift']());}};_0x40c84d(++_0x265d7d);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ff022,_0x183a9c){_0x2ff022=_0x2ff022-0x0;var _0x1cbaa5=_0xb10b[_0x2ff022];return _0x1cbaa5;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index f662c80..121b3ed 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 _0x4b78=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x4b78,0x113));var _0x84b7=function(_0x4ecf95,_0x239eb4){_0x4ecf95=_0x4ecf95-0x0;var _0x4b62b5=_0x4b78[_0x4ecf95];return _0x4b62b5;};'use strict';var client=require(_0x84b7('0x0'));exports['update']=function(_0x4197cd,_0x28cb05){return client[_0x84b7('0x1')](_0x84b7('0x2'),{'body':_0x28cb05,'options':{'where':{'id':_0x4197cd}},'log':_0x84b7('0x3')});};exports[_0x84b7('0x4')]=function(_0x229656,_0x526a7c){return client['Request'](_0x84b7('0x5'),{'body':_0x526a7c,'options':{'where':{'id':_0x229656}},'log':_0x84b7('0x6')});}; \ No newline at end of file +var _0xa755=['update','UpdateChatInteraction','updateChatInteraction','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x503001,_0x25873a){var _0x537c7f=function(_0xb66da6){while(--_0xb66da6){_0x503001['push'](_0x503001['shift']());}};_0x537c7f(++_0x25873a);}(_0xa755,0x192));var _0x5a75=function(_0x23fb81,_0x18f794){_0x23fb81=_0x23fb81-0x0;var _0x410fda=_0xa755[_0x23fb81];return _0x410fda;};'use strict';var client=require('../client');exports[_0x5a75('0x0')]=function(_0x20313a,_0x3107c1){return client['Request'](_0x5a75('0x1'),{'body':_0x3107c1,'options':{'where':{'id':_0x20313a}},'log':_0x5a75('0x2')});};exports['addTags']=function(_0x50f9af,_0x5e7cde){return client[_0x5a75('0x3')](_0x5a75('0x4'),{'body':_0x5e7cde,'options':{'where':{'id':_0x50f9af}},'log':_0x5a75('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 9848ec2..cf7eb18 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 _0x40af=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x862be0,_0x263d9a){var _0xf5ec21=function(_0x30d027){while(--_0x30d027){_0x862be0['push'](_0x862be0['shift']());}};_0xf5ec21(++_0x263d9a);}(_0x40af,0xbb));var _0xf40a=function(_0x3ff5e7,_0x1d2a13){_0x3ff5e7=_0x3ff5e7-0x0;var _0x43fe23=_0x40af[_0x3ff5e7];return _0x43fe23;};'use strict';var client=require('../client');exports[_0xf40a('0x0')]=function(_0x1a3d4f){return client[_0xf40a('0x1')](_0xf40a('0x2'),{'body':_0x1a3d4f,'log':_0xf40a('0x3')});}; \ No newline at end of file +var _0x78f3=['Request','CreateChatMessage','createChatMessage','../client'];(function(_0x235e70,_0x4d9dcd){var _0x293e91=function(_0x3bd0a4){while(--_0x3bd0a4){_0x235e70['push'](_0x235e70['shift']());}};_0x293e91(++_0x4d9dcd);}(_0x78f3,0x1af));var _0x378f=function(_0x2a7e3f,_0x262d4d){_0x2a7e3f=_0x2a7e3f-0x0;var _0x50524d=_0x78f3[_0x2a7e3f];return _0x50524d;};'use strict';var client=require(_0x378f('0x0'));exports['create']=function(_0x130fc4){return client[_0x378f('0x1')](_0x378f('0x2'),{'body':_0x130fc4,'log':_0x378f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9a9dc0e..de10a28 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 _0x1af3=['Request','GetChatQueue','name','timeout','strategy','User','Agents','chatPause','../client','getChatQueues'];(function(_0x59733f,_0x24037b){var _0x48bcb7=function(_0xca7953){while(--_0xca7953){_0x59733f['push'](_0x59733f['shift']());}};_0x48bcb7(++_0x24037b);}(_0x1af3,0x1ca));var _0x31af=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x1af3[_0x5bfa44];return _0x43815f;};'use strict';var client=require(_0x31af('0x0'));exports[_0x31af('0x1')]=function(){return function(){return client[_0x31af('0x2')](_0x31af('0x3'),{'options':{'raw':![],'attributes':['id',_0x31af('0x4'),_0x31af('0x5'),_0x31af('0x6')],'include':[{'model':_0x31af('0x7'),'as':_0x31af('0x8'),'attributes':['id',_0x31af('0x4'),'online',_0x31af('0x9')]}]},'log':_0x31af('0x1')});};}; \ No newline at end of file +var _0xbc8d=['timeout','User','Agents','chatPause','getChatQueues','../client','Request','GetChatQueue','name'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xdbc8('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xdbc8('0x1')](_0xdbc8('0x2'),{'options':{'raw':![],'attributes':['id',_0xdbc8('0x3'),_0xdbc8('0x4'),'strategy'],'include':[{'model':_0xdbc8('0x5'),'as':_0xdbc8('0x6'),'attributes':['id',_0xdbc8('0x3'),'online',_0xdbc8('0x7')]}]},'log':_0xdbc8('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 4f7a197..9aeaa55 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 _0xee24=['UpdateChatQueueReport','DESC','create','CreateChatQueueReport','update','Request'];(function(_0x54ad9e,_0x592034){var _0x3f983e=function(_0x5b97dc){while(--_0x5b97dc){_0x54ad9e['push'](_0x54ad9e['shift']());}};_0x3f983e(++_0x592034);}(_0xee24,0x1a6));var _0x4ee2=function(_0x1548a0,_0x4bd793){_0x1548a0=_0x1548a0-0x0;var _0x27d824=_0xee24[_0x1548a0];return _0x27d824;};'use strict';var client=require('../client');exports[_0x4ee2('0x0')]=function(_0x2b4e8f){return client['Request'](_0x4ee2('0x1'),{'body':_0x2b4e8f,'log':_0x4ee2('0x1')});};exports[_0x4ee2('0x2')]=function(_0x34b373,_0x5546e1){return client[_0x4ee2('0x3')](_0x4ee2('0x4'),{'body':_0x5546e1,'options':{'where':{'uniqueid':_0x34b373},'order':[['id',_0x4ee2('0x5')]],'limit':0x1},'log':_0x4ee2('0x4')});}; \ No newline at end of file +var _0xc02d=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x4b0c88,_0x592863){var _0x1a0a1e=function(_0x49a5d2){while(--_0x49a5d2){_0x4b0c88['push'](_0x4b0c88['shift']());}};_0x1a0a1e(++_0x592863);}(_0xc02d,0x1aa));var _0xdc02=function(_0x20e452,_0x4551e8){_0x20e452=_0x20e452-0x0;var _0x5bfa1e=_0xc02d[_0x20e452];return _0x5bfa1e;};'use strict';var client=require('../client');exports[_0xdc02('0x0')]=function(_0xe12553){return client[_0xdc02('0x1')](_0xdc02('0x2'),{'body':_0xe12553,'log':_0xdc02('0x2')});};exports[_0xdc02('0x3')]=function(_0x137fde,_0x29f176){return client[_0xdc02('0x1')](_0xdc02('0x4'),{'body':_0x29f176,'options':{'where':{'uniqueid':_0x137fde},'order':[['id',_0xdc02('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e5c19c8..c0efce9 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x7a54,0x106));var _0x47a5=function(_0x1e100c,_0x23c6d0){_0x1e100c=_0x1e100c-0x0;var _0x42500c=_0x7a54[_0x1e100c];return _0x42500c;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1568ed,_0x12b743){var _0x5437dd=function(_0x38715b){while(--_0x38715b){_0x1568ed['push'](_0x1568ed['shift']());}};_0x5437dd(++_0x12b743);}(_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 9eb6526..41bd8ad 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 _0x06a8=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x06a8,0x104));var _0x806a=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x06a8[_0x19b3f9];return _0x18c3f6;};'use strict';var client=require('../client');exports[_0x806a('0x0')]=function(_0x501753){return client[_0x806a('0x1')](_0x806a('0x2'),{'body':_0x501753,'log':_0x806a('0x3')});}; \ No newline at end of file +var _0x4195=['CreateFaxMessage','createFaxMessage','Request'];(function(_0xceb482,_0xcb2dc8){var _0x3cb3e5=function(_0x4cf639){while(--_0x4cf639){_0xceb482['push'](_0xceb482['shift']());}};_0x3cb3e5(++_0xcb2dc8);}(_0x4195,0xf2));var _0x5419=function(_0x347ea8,_0x2ac098){_0x347ea8=_0x347ea8-0x0;var _0x2e83f4=_0x4195[_0x347ea8];return _0x2e83f4;};'use strict';var client=require('../client');exports['create']=function(_0x410a19){return client[_0x5419('0x0')](_0x5419('0x1'),{'body':_0x410a19,'log':_0x5419('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ff78675..54b6c05 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 _0x5bd1=['GetFaxQueue','name','timeout','User','faxPause','../client','getFaxQueues','Request'];(function(_0x44210e,_0x1c76d6){var _0x2c6399=function(_0xae5886){while(--_0xae5886){_0x44210e['push'](_0x44210e['shift']());}};_0x2c6399(++_0x1c76d6);}(_0x5bd1,0x185));var _0x15bd=function(_0x373096,_0x4d37aa){_0x373096=_0x373096-0x0;var _0x14a6d0=_0x5bd1[_0x373096];return _0x14a6d0;};'use strict';var client=require(_0x15bd('0x0'));exports[_0x15bd('0x1')]=function(){return function(){return client[_0x15bd('0x2')](_0x15bd('0x3'),{'options':{'raw':![],'attributes':['id',_0x15bd('0x4'),_0x15bd('0x5'),'strategy'],'include':[{'model':_0x15bd('0x6'),'as':'Agents','attributes':['id',_0x15bd('0x4'),'online',_0x15bd('0x7')]}]},'log':_0x15bd('0x1')});};}; \ No newline at end of file +var _0x06d2=['strategy','User','Agents','online','faxPause','getFaxQueues','timeout'];(function(_0x2ec66f,_0x51487f){var _0x4825c6=function(_0x182df2){while(--_0x182df2){_0x2ec66f['push'](_0x2ec66f['shift']());}};_0x4825c6(++_0x51487f);}(_0x06d2,0x11d));var _0x206d=function(_0x18e71e,_0x1d8724){_0x18e71e=_0x18e71e-0x0;var _0x4c8d98=_0x06d2[_0x18e71e];return _0x4c8d98;};'use strict';var client=require('../client');exports[_0x206d('0x0')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x206d('0x1'),_0x206d('0x2')],'include':[{'model':_0x206d('0x3'),'as':_0x206d('0x4'),'attributes':['id','name',_0x206d('0x5'),_0x206d('0x6')]}]},'log':_0x206d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index a8369fb..080abb9 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 _0x5fea=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC'];(function(_0x51dd3f,_0x25d090){var _0x3a3729=function(_0x25df29){while(--_0x25df29){_0x51dd3f['push'](_0x51dd3f['shift']());}};_0x3a3729(++_0x25d090);}(_0x5fea,0x1c8));var _0xa5fe=function(_0x19b351,_0x547358){_0x19b351=_0x19b351-0x0;var _0x104803=_0x5fea[_0x19b351];return _0x104803;};'use strict';var client=require(_0xa5fe('0x0'));exports[_0xa5fe('0x1')]=function(_0x11a114){return client[_0xa5fe('0x2')]('CreateFaxQueueReport',{'body':_0x11a114,'log':_0xa5fe('0x3')});};exports['update']=function(_0x3e7f05,_0x50d4d6){return client['Request'](_0xa5fe('0x4'),{'body':_0x50d4d6,'options':{'where':{'uniqueid':_0x3e7f05},'order':[['id',_0xa5fe('0x5')]],'limit':0x1},'log':_0xa5fe('0x4')});}; \ No newline at end of file +var _0xd3f1=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','create','Request'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xd3f1,0x1ed));var _0x1d3f=function(_0x19c7b8,_0x1b8313){_0x19c7b8=_0x19c7b8-0x0;var _0x197141=_0xd3f1[_0x19c7b8];return _0x197141;};'use strict';var client=require('../client');exports[_0x1d3f('0x0')]=function(_0x1efbd2){return client[_0x1d3f('0x1')](_0x1d3f('0x2'),{'body':_0x1efbd2,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x5ecdde,_0x55aa85){return client[_0x1d3f('0x1')](_0x1d3f('0x3'),{'body':_0x55aa85,'options':{'where':{'uniqueid':_0x5ecdde},'order':[['id',_0x1d3f('0x4')]],'limit':0x1},'log':_0x1d3f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 21fd348..4b0a9dc 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 _0xfc83=['name','Interval','interval','../client','getIntervals','Request','GetInterval'];(function(_0x3f704c,_0x463113){var _0xffe997=function(_0xd93b57){while(--_0xd93b57){_0x3f704c['push'](_0x3f704c['shift']());}};_0xffe997(++_0x463113);}(_0xfc83,0x192));var _0x3fc8=function(_0x5e700e,_0x299a73){_0x5e700e=_0x5e700e-0x0;var _0x1401f2=_0xfc83[_0x5e700e];return _0x1401f2;};'use strict';var client=require(_0x3fc8('0x0'));exports[_0x3fc8('0x1')]=function(){return function(){return client[_0x3fc8('0x2')](_0x3fc8('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3fc8('0x4')],'include':[{'model':_0x3fc8('0x5'),'as':'Intervals','attributes':['id',_0x3fc8('0x4'),_0x3fc8('0x6')]}]},'log':_0x3fc8('0x1')});};}; \ No newline at end of file +var _0xffcd=['../client','getIntervals','Request','GetInterval','name','Interval','Intervals','interval'];(function(_0x24c141,_0x3e5d7a){var _0x3e653b=function(_0x264a71){while(--_0x264a71){_0x24c141['push'](_0x24c141['shift']());}};_0x3e653b(++_0x3e5d7a);}(_0xffcd,0xf8));var _0xdffc=function(_0x47d8a6,_0x23771e){_0x47d8a6=_0x47d8a6-0x0;var _0xdf7e8b=_0xffcd[_0x47d8a6];return _0xdf7e8b;};'use strict';var client=require(_0xdffc('0x0'));exports[_0xdffc('0x1')]=function(){return function(){return client[_0xdffc('0x2')](_0xdffc('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xdffc('0x4')],'include':[{'model':_0xdffc('0x5'),'as':_0xdffc('0x6'),'attributes':['id',_0xdffc('0x4'),_0xdffc('0x7')]}]},'log':_0xdffc('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 78bae0f..d238300 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 _0xf2e3=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x4f19ba,_0x2e73d2){var _0x1cf423=function(_0x1d1a3c){while(--_0x1d1a3c){_0x4f19ba['push'](_0x4f19ba['shift']());}};_0x1cf423(++_0x2e73d2);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xf2e3[_0x220f3f];return _0x1f170e;};'use strict';var client=require(_0x3f2e('0x0'));exports['update']=function(_0x143e9e,_0x231b2b){return client[_0x3f2e('0x1')](_0x3f2e('0x2'),{'body':_0x231b2b,'options':{'where':{'id':_0x143e9e}},'log':_0x3f2e('0x3')});};exports[_0x3f2e('0x4')]=function(_0x3938e2,_0xabcf5c){return client[_0x3f2e('0x1')]('AddTagsToMailInteraction',{'body':_0xabcf5c,'options':{'where':{'id':_0x3938e2}},'log':_0x3f2e('0x5')});}; \ No newline at end of file +var _0x1967=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','update'];(function(_0x3ce059,_0x31d1ca){var _0x4f1705=function(_0x4908a3){while(--_0x4908a3){_0x3ce059['push'](_0x3ce059['shift']());}};_0x4f1705(++_0x31d1ca);}(_0x1967,0x173));var _0x7196=function(_0x457d8c,_0x239817){_0x457d8c=_0x457d8c-0x0;var _0x3a5449=_0x1967[_0x457d8c];return _0x3a5449;};'use strict';var client=require('../client');exports[_0x7196('0x0')]=function(_0xdb72bb,_0x4d0a98){return client[_0x7196('0x1')](_0x7196('0x2'),{'body':_0x4d0a98,'options':{'where':{'id':_0xdb72bb}},'log':_0x7196('0x3')});};exports[_0x7196('0x4')]=function(_0x1aaddd,_0x458ae8){return client[_0x7196('0x1')]('AddTagsToMailInteraction',{'body':_0x458ae8,'options':{'where':{'id':_0x1aaddd}},'log':_0x7196('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 78b3d7f..0200159 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 _0x92cc=['createMailMessage','../client'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0x92cc,0x8b));var _0xc92c=function(_0x33433f,_0x17ab0e){_0x33433f=_0x33433f-0x0;var _0x595ef8=_0x92cc[_0x33433f];return _0x595ef8;};'use strict';var client=require(_0xc92c('0x0'));exports['create']=function(_0x4c2c40){return client['Request']('CreateMailMessage',{'body':_0x4c2c40,'log':_0xc92c('0x1')});}; \ No newline at end of file +var _0xb64d=['../client','create','CreateMailMessage'];(function(_0x6643f9,_0x4ebf6c){var _0x138f5f=function(_0x2d1d03){while(--_0x2d1d03){_0x6643f9['push'](_0x6643f9['shift']());}};_0x138f5f(++_0x4ebf6c);}(_0xb64d,0x1a4));var _0xdb64=function(_0xf3ecc9,_0x1be36b){_0xf3ecc9=_0xf3ecc9-0x0;var _0x4b0aa1=_0xb64d[_0xf3ecc9];return _0x4b0aa1;};'use strict';var client=require(_0xdb64('0x0'));exports[_0xdb64('0x1')]=function(_0x2bbb12){return client['Request'](_0xdb64('0x2'),{'body':_0x2bbb12,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 2d3d51f..0b0cd72 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 _0x892e=['mailPause','../client','getMailQueues','name','strategy','User','Agents','online'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x892e,0x191));var _0xe892=function(_0xcf48b3,_0x1d9a72){_0xcf48b3=_0xcf48b3-0x0;var _0x2cd3a4=_0x892e[_0xcf48b3];return _0x2cd3a4;};'use strict';var client=require(_0xe892('0x0'));exports[_0xe892('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xe892('0x2'),'timeout',_0xe892('0x3')],'include':[{'model':_0xe892('0x4'),'as':_0xe892('0x5'),'attributes':['id',_0xe892('0x2'),_0xe892('0x6'),_0xe892('0x7')]}]},'log':_0xe892('0x1')});};}; \ No newline at end of file +var _0x8cb1=['mailPause','../client','getMailQueues','Request','GetMailQueue','timeout','strategy','User','Agents'];(function(_0x3ce53d,_0x1cda93){var _0x5c36ed=function(_0x330f63){while(--_0x330f63){_0x3ce53d['push'](_0x3ce53d['shift']());}};_0x5c36ed(++_0x1cda93);}(_0x8cb1,0xfd));var _0x18cb=function(_0x545a5e,_0x324f8e){_0x545a5e=_0x545a5e-0x0;var _0x2d7a7c=_0x8cb1[_0x545a5e];return _0x2d7a7c;};'use strict';var client=require(_0x18cb('0x0'));exports[_0x18cb('0x1')]=function(){return function(){return client[_0x18cb('0x2')](_0x18cb('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x18cb('0x4'),_0x18cb('0x5')],'include':[{'model':_0x18cb('0x6'),'as':_0x18cb('0x7'),'attributes':['id','name','online',_0x18cb('0x8')]}]},'log':_0x18cb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 07f818a..b1afa92 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 _0x83bd=['update','UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x28ba5b,_0x35e8d9){var _0x3ae23a=function(_0x26e17c){while(--_0x26e17c){_0x28ba5b['push'](_0x28ba5b['shift']());}};_0x3ae23a(++_0x35e8d9);}(_0x83bd,0xed));var _0xd83b=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x83bd[_0x2d61b2];return _0x12df89;};'use strict';var client=require('../client');exports[_0xd83b('0x0')]=function(_0x188585){return client[_0xd83b('0x1')](_0xd83b('0x2'),{'body':_0x188585,'log':_0xd83b('0x2')});};exports[_0xd83b('0x3')]=function(_0x331b6a,_0x49e444){return client[_0xd83b('0x1')](_0xd83b('0x4'),{'body':_0x49e444,'options':{'where':{'uniqueid':_0x331b6a},'order':[['id',_0xd83b('0x5')]],'limit':0x1},'log':_0xd83b('0x4')});}; \ No newline at end of file +var _0xf8a3=['Request','UpdateMailQueueReport','DESC','CreateMailQueueReport','update'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0xf8a3,0x184));var _0x3f8a=function(_0x43a7d5,_0x27b94a){_0x43a7d5=_0x43a7d5-0x0;var _0x4bafe3=_0xf8a3[_0x43a7d5];return _0x4bafe3;};'use strict';var client=require('../client');exports['create']=function(_0x148073){return client['Request'](_0x3f8a('0x0'),{'body':_0x148073,'log':_0x3f8a('0x0')});};exports[_0x3f8a('0x1')]=function(_0x5ec518,_0x1ee9e2){return client[_0x3f8a('0x2')](_0x3f8a('0x3'),{'body':_0x1ee9e2,'options':{'where':{'uniqueid':_0x5ec518},'order':[['id',_0x3f8a('0x4')]],'limit':0x1},'log':_0x3f8a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 55e401d..66696f0 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 _0x4542=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client','update','Request'];(function(_0x47745a,_0x3b69c0){var _0x30c719=function(_0x3011bf){while(--_0x3011bf){_0x47745a['push'](_0x47745a['shift']());}};_0x30c719(++_0x3b69c0);}(_0x4542,0x1cb));var _0x2454=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4542[_0x46e363];return _0x3fb059;};'use strict';var client=require(_0x2454('0x0'));exports[_0x2454('0x1')]=function(_0x37addd,_0x6ad4c1){return client[_0x2454('0x2')](_0x2454('0x3'),{'body':_0x6ad4c1,'options':{'where':{'id':_0x37addd}},'log':_0x2454('0x4')});};exports[_0x2454('0x5')]=function(_0x5592be,_0x1e7739){return client[_0x2454('0x2')](_0x2454('0x6'),{'body':_0x1e7739,'options':{'where':{'id':_0x5592be}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x6006=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x3b025b,_0x486835){var _0x2c944f=function(_0x374121){while(--_0x374121){_0x3b025b['push'](_0x3b025b['shift']());}};_0x2c944f(++_0x486835);}(_0x6006,0x199));var _0x6600=function(_0x463610,_0x226588){_0x463610=_0x463610-0x0;var _0x271745=_0x6006[_0x463610];return _0x271745;};'use strict';var client=require('../client');exports[_0x6600('0x0')]=function(_0x59c057,_0x48fb62){return client[_0x6600('0x1')](_0x6600('0x2'),{'body':_0x48fb62,'options':{'where':{'id':_0x59c057}},'log':_0x6600('0x3')});};exports[_0x6600('0x4')]=function(_0x57ed82,_0x25075a){return client[_0x6600('0x1')](_0x6600('0x5'),{'body':_0x25075a,'options':{'where':{'id':_0x57ed82}},'log':_0x6600('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index e7ed89a..20acd4f 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 _0x488d=['../client','Request','createOpenchannelMessage'];(function(_0x4697b1,_0x4b9cfd){var _0x429280=function(_0x50ab40){while(--_0x50ab40){_0x4697b1['push'](_0x4697b1['shift']());}};_0x429280(++_0x4b9cfd);}(_0x488d,0x1a7));var _0xd488=function(_0x15ec5d,_0x277104){_0x15ec5d=_0x15ec5d-0x0;var _0x513a54=_0x488d[_0x15ec5d];return _0x513a54;};'use strict';var client=require(_0xd488('0x0'));exports['create']=function(_0x634623){return client[_0xd488('0x1')]('CreateOpenchannelMessage',{'body':_0x634623,'log':_0xd488('0x2')});}; \ No newline at end of file +var _0xa817=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x540b27,_0x1302ba){var _0x4c53a5=function(_0x5421da){while(--_0x5421da){_0x540b27['push'](_0x540b27['shift']());}};_0x4c53a5(++_0x1302ba);}(_0xa817,0x7f));var _0x7a81=function(_0x1934c0,_0x5429ba){_0x1934c0=_0x1934c0-0x0;var _0x3d2688=_0xa817[_0x1934c0];return _0x3d2688;};'use strict';var client=require(_0x7a81('0x0'));exports[_0x7a81('0x1')]=function(_0x35be11){return client[_0x7a81('0x2')](_0x7a81('0x3'),{'body':_0x35be11,'log':_0x7a81('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 9d32a82..11a7993 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 _0x47e0=['online','openchannelPause','getOpenchannelQueues','timeout','User','Agents','name'];(function(_0x3982ab,_0x3db8e5){var _0x4903e1=function(_0x12199c){while(--_0x12199c){_0x3982ab['push'](_0x3982ab['shift']());}};_0x4903e1(++_0x3db8e5);}(_0x47e0,0x113));var _0x047e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x47e0[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x047e('0x0')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x047e('0x1'),'strategy'],'include':[{'model':_0x047e('0x2'),'as':_0x047e('0x3'),'attributes':['id',_0x047e('0x4'),_0x047e('0x5'),_0x047e('0x6')]}]},'log':_0x047e('0x0')});};}; \ No newline at end of file +var _0x8676=['online','openchannelPause','../client','getOpenchannelQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x3d159e,_0x312bff){var _0x4e3ae1=function(_0x3f6dca){while(--_0x3f6dca){_0x3d159e['push'](_0x3d159e['shift']());}};_0x4e3ae1(++_0x312bff);}(_0x8676,0x16a));var _0x6867=function(_0x22f9eb,_0x20b914){_0x22f9eb=_0x22f9eb-0x0;var _0x3609de=_0x8676[_0x22f9eb];return _0x3609de;};'use strict';var client=require(_0x6867('0x0'));exports[_0x6867('0x1')]=function(){return function(){return client[_0x6867('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x6867('0x3'),_0x6867('0x4'),_0x6867('0x5')],'include':[{'model':_0x6867('0x6'),'as':_0x6867('0x7'),'attributes':['id',_0x6867('0x3'),_0x6867('0x8'),_0x6867('0x9')]}]},'log':_0x6867('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index c51f058..3985dc1 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 _0x7267=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x2f5100,_0x565cbe){var _0x40c4bc=function(_0x525168){while(--_0x525168){_0x2f5100['push'](_0x2f5100['shift']());}};_0x40c4bc(++_0x565cbe);}(_0x7267,0x97));var _0x7726=function(_0x19572c,_0x1a0f81){_0x19572c=_0x19572c-0x0;var _0x4ebc79=_0x7267[_0x19572c];return _0x4ebc79;};'use strict';var client=require(_0x7726('0x0'));exports[_0x7726('0x1')]=function(_0x1ed1bc){return client[_0x7726('0x2')](_0x7726('0x3'),{'body':_0x1ed1bc,'log':_0x7726('0x3')});};exports[_0x7726('0x4')]=function(_0x34d050,_0x19584d){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x19584d,'options':{'where':{'uniqueid':_0x34d050},'order':[['id',_0x7726('0x5')]],'limit':0x1},'log':_0x7726('0x6')});}; \ No newline at end of file +var _0x51a8=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x4cd7ec,_0xa60741){var _0x1feb8a=function(_0x4ae776){while(--_0x4ae776){_0x4cd7ec['push'](_0x4cd7ec['shift']());}};_0x1feb8a(++_0xa60741);}(_0x51a8,0xec));var _0x851a=function(_0xf95dc6,_0x592248){_0xf95dc6=_0xf95dc6-0x0;var _0x4efea6=_0x51a8[_0xf95dc6];return _0x4efea6;};'use strict';var client=require(_0x851a('0x0'));exports[_0x851a('0x1')]=function(_0x507fc9){return client[_0x851a('0x2')]('CreateOpenchannelQueueReport',{'body':_0x507fc9,'log':_0x851a('0x3')});};exports['update']=function(_0x410dbd,_0x3fa2fa){return client[_0x851a('0x2')](_0x851a('0x4'),{'body':_0x3fa2fa,'options':{'where':{'uniqueid':_0x410dbd},'order':[['id',_0x851a('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7d3bd7a..78217e9 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 _0x44ae=['Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','addTags'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x44ae,0x17d));var _0xe44a=function(_0x48b41d,_0x2f433f){_0x48b41d=_0x48b41d-0x0;var _0x10732e=_0x44ae[_0x48b41d];return _0x10732e;};'use strict';var client=require(_0xe44a('0x0'));exports[_0xe44a('0x1')]=function(_0x3619c5,_0x452d04){return client['Request'](_0xe44a('0x2'),{'body':_0x452d04,'options':{'where':{'id':_0x3619c5}},'log':'updateSmsInteraction'});};exports[_0xe44a('0x3')]=function(_0x18455c,_0x174a3f){return client[_0xe44a('0x4')](_0xe44a('0x5'),{'body':_0x174a3f,'options':{'where':{'id':_0x18455c}},'log':_0xe44a('0x6')});}; \ No newline at end of file +var _0x2830=['update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x6688d5,_0x3d27df){var _0x1497b9=function(_0x202196){while(--_0x202196){_0x6688d5['push'](_0x6688d5['shift']());}};_0x1497b9(++_0x3d27df);}(_0x2830,0x117));var _0x0283=function(_0x2d25a7,_0x5950c5){_0x2d25a7=_0x2d25a7-0x0;var _0x5dafc9=_0x2830[_0x2d25a7];return _0x5dafc9;};'use strict';var client=require(_0x0283('0x0'));exports[_0x0283('0x1')]=function(_0x4ee0cd,_0x3f6626){return client[_0x0283('0x2')](_0x0283('0x3'),{'body':_0x3f6626,'options':{'where':{'id':_0x4ee0cd}},'log':_0x0283('0x4')});};exports['addTags']=function(_0x414c89,_0x4aa050){return client[_0x0283('0x2')](_0x0283('0x5'),{'body':_0x4aa050,'options':{'where':{'id':_0x414c89}},'log':_0x0283('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 4f2514f..f3993e5 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 _0x3195=['create','CreateSmsMessage'];(function(_0x32372d,_0x280c34){var _0xaf96e0=function(_0x11c393){while(--_0x11c393){_0x32372d['push'](_0x32372d['shift']());}};_0xaf96e0(++_0x280c34);}(_0x3195,0x122));var _0x5319=function(_0x4a8ced,_0x348b2b){_0x4a8ced=_0x4a8ced-0x0;var _0x5d0d75=_0x3195[_0x4a8ced];return _0x5d0d75;};'use strict';var client=require('../client');exports[_0x5319('0x0')]=function(_0x11318a){return client['Request'](_0x5319('0x1'),{'body':_0x11318a,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x63bb=['createSmsMessage','../client','create','CreateSmsMessage'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x63bb,0xf5));var _0xb63b=function(_0x2166a3,_0x237c50){_0x2166a3=_0x2166a3-0x0;var _0x260035=_0x63bb[_0x2166a3];return _0x260035;};'use strict';var client=require(_0xb63b('0x0'));exports[_0xb63b('0x1')]=function(_0x22bd09){return client['Request'](_0xb63b('0x2'),{'body':_0x22bd09,'log':_0xb63b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 11f4a0d..7ce15a9 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x50e962,_0x4a65b2){var _0x32a36b=function(_0x2385e0){while(--_0x2385e0){_0x50e962['push'](_0x50e962['shift']());}};_0x32a36b(++_0x4a65b2);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 0e7a100..fb362fa 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0xe2750f,_0x25df92){var _0xd1e418=function(_0x7da1f4){while(--_0x7da1f4){_0xe2750f['push'](_0xe2750f['shift']());}};_0xd1e418(++_0x25df92);}(_0x3e74,0x175));var _0x43e7=function(_0x20c4c1,_0x12be19){_0x20c4c1=_0x20c4c1-0x0;var _0x194567=_0x3e74[_0x20c4c1];return _0x194567;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x5c88d3,_0x516f85){var _0x4bc489=function(_0x35859b){while(--_0x35859b){_0x5c88d3['push'](_0x5c88d3['shift']());}};_0x4bc489(++_0x516f85);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index fe63822..1303215 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(_0x3f3663,_0xa80fa8){var _0x3b9dd0=function(_0x1acf1c){while(--_0x1acf1c){_0x3f3663['push'](_0x3f3663['shift']());}};_0x3b9dd0(++_0xa80fa8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x217f04,_0x28ae0d){var _0x44ff7f=function(_0x57ec0f){while(--_0x57ec0f){_0x217f04['push'](_0x217f04['shift']());}};_0x44ff7f(++_0x28ae0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 166070a..bde9ee1 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 _0x3d49=['addTags','AddTagsToWhatsappInteraction','update','Request','updateWhatsappInteraction'];(function(_0x2959f2,_0x70f6ee){var _0x5f21fd=function(_0x30939d){while(--_0x30939d){_0x2959f2['push'](_0x2959f2['shift']());}};_0x5f21fd(++_0x70f6ee);}(_0x3d49,0x151));var _0x93d4=function(_0x35731c,_0x5ab1d1){_0x35731c=_0x35731c-0x0;var _0x2f2957=_0x3d49[_0x35731c];return _0x2f2957;};'use strict';var client=require('../client');exports[_0x93d4('0x0')]=function(_0x444cad,_0xae3607){return client[_0x93d4('0x1')]('UpdateWhatsappInteraction',{'body':_0xae3607,'options':{'where':{'id':_0x444cad}},'log':_0x93d4('0x2')});};exports[_0x93d4('0x3')]=function(_0xa1de2e,_0x41313a){return client[_0x93d4('0x1')](_0x93d4('0x4'),{'body':_0x41313a,'options':{'where':{'id':_0xa1de2e}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x4753=['addTags','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x7fdd2d,_0x475d95){var _0x4fa987=function(_0x3d8d63){while(--_0x3d8d63){_0x7fdd2d['push'](_0x7fdd2d['shift']());}};_0x4fa987(++_0x475d95);}(_0x4753,0x1f4));var _0x3475=function(_0x9e9c67,_0x33da8e){_0x9e9c67=_0x9e9c67-0x0;var _0x109ff9=_0x4753[_0x9e9c67];return _0x109ff9;};'use strict';var client=require(_0x3475('0x0'));exports[_0x3475('0x1')]=function(_0x321ed2,_0x5b20e3){return client[_0x3475('0x2')](_0x3475('0x3'),{'body':_0x5b20e3,'options':{'where':{'id':_0x321ed2}},'log':'updateWhatsappInteraction'});};exports[_0x3475('0x4')]=function(_0x4c6fd2,_0x5a801b){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x5a801b,'options':{'where':{'id':_0x4c6fd2}},'log':_0x3475('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 5b9d889..d15e3be 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 _0xe739=['create','Request','CreateWhatsappMessage','../client'];(function(_0x1dc97a,_0x2a5cc7){var _0x4d1fcd=function(_0x32203d){while(--_0x32203d){_0x1dc97a['push'](_0x1dc97a['shift']());}};_0x4d1fcd(++_0x2a5cc7);}(_0xe739,0x1bf));var _0x9e73=function(_0x100e00,_0x28f6c8){_0x100e00=_0x100e00-0x0;var _0x1c29ad=_0xe739[_0x100e00];return _0x1c29ad;};'use strict';var client=require(_0x9e73('0x0'));exports[_0x9e73('0x1')]=function(_0xeee80b){return client[_0x9e73('0x2')](_0x9e73('0x3'),{'body':_0xeee80b,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xdcb6=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x9f60ee,_0x4d5758){var _0x5445e8=function(_0x4735c8){while(--_0x4735c8){_0x9f60ee['push'](_0x9f60ee['shift']());}};_0x5445e8(++_0x4d5758);}(_0xdcb6,0x77));var _0x6dcb=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xdcb6[_0x17b6e3];return _0x3906f3;};'use strict';var client=require(_0x6dcb('0x0'));exports[_0x6dcb('0x1')]=function(_0x1361c9){return client[_0x6dcb('0x2')](_0x6dcb('0x3'),{'body':_0x1361c9,'log':_0x6dcb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 22d3970..aeb7d10 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 _0xd027=['User','online','getWhatsappQueues','../client','name','timeout','strategy'];(function(_0x222aed,_0x4eb06a){var _0x2eb9da=function(_0x2da3fa){while(--_0x2da3fa){_0x222aed['push'](_0x222aed['shift']());}};_0x2eb9da(++_0x4eb06a);}(_0xd027,0xab));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7d02('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x7d02('0x1'),_0x7d02('0x2'),_0x7d02('0x3')],'include':[{'model':_0x7d02('0x4'),'as':'Agents','attributes':['id','name',_0x7d02('0x5'),'whatsappPause']}]},'log':_0x7d02('0x6')});};}; \ No newline at end of file +var _0x4a37=['User','Agents','online','whatsappPause','getWhatsappQueues','../client','Request','GetWhatsappQueue','strategy'];(function(_0x4b23ea,_0x2d593a){var _0x104169=function(_0xe0c5a2){while(--_0xe0c5a2){_0x4b23ea['push'](_0x4b23ea['shift']());}};_0x104169(++_0x2d593a);}(_0x4a37,0x12e));var _0x74a3=function(_0x31d65f,_0x20e4c3){_0x31d65f=_0x31d65f-0x0;var _0x5b4cc7=_0x4a37[_0x31d65f];return _0x5b4cc7;};'use strict';var client=require(_0x74a3('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x74a3('0x1')](_0x74a3('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x74a3('0x3')],'include':[{'model':_0x74a3('0x4'),'as':_0x74a3('0x5'),'attributes':['id','name',_0x74a3('0x6'),_0x74a3('0x7')]}]},'log':_0x74a3('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 2bdc564..e62b172 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 _0x556b=['../client','create','CreateWhatsappQueueReport','Request','UpdateWhatsappQueueReport'];(function(_0x3c9e74,_0x4334c5){var _0x4fea21=function(_0x5a2cbb){while(--_0x5a2cbb){_0x3c9e74['push'](_0x3c9e74['shift']());}};_0x4fea21(++_0x4334c5);}(_0x556b,0x140));var _0xb556=function(_0x5b70f0,_0x5aa0ef){_0x5b70f0=_0x5b70f0-0x0;var _0x18ee06=_0x556b[_0x5b70f0];return _0x18ee06;};'use strict';var client=require(_0xb556('0x0'));exports[_0xb556('0x1')]=function(_0x391542){return client['Request']('CreateWhatsappQueueReport',{'body':_0x391542,'log':_0xb556('0x2')});};exports['update']=function(_0x3b4a08,_0x3428ba){return client[_0xb556('0x3')](_0xb556('0x4'),{'body':_0x3428ba,'options':{'where':{'uniqueid':_0x3b4a08},'order':[['id','DESC']],'limit':0x1},'log':_0xb556('0x4')});}; \ No newline at end of file +var _0x3dbc=['CreateWhatsappQueueReport','Request','DESC','../client','create'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x3dbc,0x13e));var _0xc3db=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0x3dbc[_0x507965];return _0x3608fc;};'use strict';var client=require(_0xc3db('0x0'));exports[_0xc3db('0x1')]=function(_0x40ac0a){return client['Request'](_0xc3db('0x2'),{'body':_0x40ac0a,'log':_0xc3db('0x2')});};exports['update']=function(_0x40ee80,_0x4c13b5){return client[_0xc3db('0x3')]('UpdateWhatsappQueueReport',{'body':_0x4c13b5,'options':{'where':{'uniqueid':_0x40ee80},'order':[['id',_0xc3db('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 07ccd63..75c2597 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 _0x5104=['createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','name','toLowerCase','validate','length','[%s][AGENT]\x20%s','map','message','stop','find','timeout'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5104,0x14d));var _0x4510=function(_0x4822fd,_0x399594){_0x4822fd=_0x4822fd-0x0;var _0x57e1d4=_0x5104[_0x4822fd];return _0x57e1d4;};'use strict';var schema=require('validate');var _=require(_0x4510('0x0'));var util=require(_0x4510('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x4510('0x2'))(_0x4510('0x3'));var strategy=require(_0x4510('0x4'));var queue=schema({'name':{'type':_0x4510('0x5'),'required':!![],'message':_0x4510('0x6')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x38aee7,_0x2a9eb3,_0x13e25f){return logger[_0x4510('0x7')](util[_0x4510('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x38aee7,_0x2a9eb3[_0x4510('0x9')],_0x13e25f));}function handleFindAgent(_0x12eb32){return function(_0x321f8f){return _0x321f8f[_0x4510('0x9')]['toLowerCase']()===_0x12eb32[_0x4510('0xa')]();};}exports['consequence']=function(_0x3bb876,_0x32ca21,_0x1d43e2,_0xd3240c){return function(_0x5af9e9){try{var _0x3c4fc3={'name':_0x32ca21[0x0],'timeout':_0x32ca21[0x1]};var _0x48df37=queue[_0x4510('0xb')](_0x3c4fc3,{'typecast':!![]});if(_0x48df37[_0x4510('0xc')]){logger['error'](_0x4510('0xd'),_0x3bb876,_[_0x4510('0xe')](_0x48df37,_0x4510('0xf'))['join'](',\x20'));_0x5af9e9[_0x4510('0x10')]();}else{var _0x7e32ad=_[_0x4510('0x11')](_0x1d43e2['agents'],handleFindAgent(_0x3c4fc3[_0x4510('0x9')]));if(_0x7e32ad){var _0x3caf7c=(_0x3c4fc3[_0x4510('0x12')]||0xa)*0x3e8;var _0x4a4eec,_0xa18a2a;var _0x17b968=seqqueue[_0x4510('0x13')](_0x3caf7c);_0x17b968['id']=_0x3bb876;_0x17b968[_0x4510('0x14')]=_0x3caf7c;_0x17b968[_0x4510('0x15')]=_0xd3240c[_0x4510('0x15')];writeLog(_0x3bb876,_0x7e32ad,util[_0x4510('0x8')](_0x4510('0x16'),_0x3caf7c));_0x1d43e2[_0x4510('0x17')][_0x3bb876]['on']('end',function(){logger[_0x4510('0x7')](_0x4510('0x18'),_0x3bb876);clearTimeout(_0xa18a2a);_0xa18a2a=undefined;_0x17b968[_0x4510('0x19')]();if(_0x1d43e2[_0x4510('0x17')][_0x3bb876]){delete _0x1d43e2[_0x4510('0x17')][_0x3bb876];}_0x5af9e9['stop']();});_0x1d43e2[_0x4510('0x17')][_0x3bb876]['on'](_0x4510('0x1a'),function(){if(_0x1d43e2[_0x4510('0x17')][_0x3bb876]){delete _0x1d43e2[_0x4510('0x17')][_0x3bb876];}});_0xa18a2a=setTimeout(function(){logger[_0x4510('0x7')](_0x4510('0x1b'),_0x3bb876);clearTimeout(_0xa18a2a);_0x17b968[_0x4510('0x19')]();_0x5af9e9['next']();},_0x3caf7c);strategy['agent'](_0x17b968,_0x7e32ad,_0x1d43e2,_0xd3240c);}else{logger[_0x4510('0x1c')](_0x4510('0x1d'),_0x3bb876,_0x3c4fc3['name']);_0x5af9e9[_0x4510('0x10')]();}}}catch(_0x1b14ec){console[_0x4510('0x1e')](_0x1b14ec);logger[_0x4510('0x1c')](_0x4510('0x1f'),_0x3bb876,_0x1b14ec['stack']);_0x5af9e9['stop']();}};}; \ No newline at end of file +var _0x0f94=['timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','validate','length','error','[%s][AGENT]\x20%s','map','join','stop','find','name','START:%s','rules','end','close','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x9872a6,_0x179192){var _0x17c2de=function(_0x40b2b6){while(--_0x40b2b6){_0x9872a6['push'](_0x9872a6['shift']());}};_0x17c2de(++_0x179192);}(_0x0f94,0x107));var _0x40f9=function(_0x438033,_0x1f39da){_0x438033=_0x438033-0x0;var _0x25583f=_0x0f94[_0x438033];return _0x25583f;};'use strict';var schema=require('validate');var _=require(_0x40f9('0x0'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x40f9('0x1'))(_0x40f9('0x2'));var strategy=require(_0x40f9('0x3'));var queue=schema({'name':{'type':_0x40f9('0x4'),'required':!![],'message':_0x40f9('0x5')},'timeout':{'type':_0x40f9('0x6'),'message':_0x40f9('0x7')}});function writeLog(_0xe5f17c,_0x46c14f,_0x5e2e36){return logger[_0x40f9('0x8')](util[_0x40f9('0x9')](_0x40f9('0xa'),_0xe5f17c,_0x46c14f['name'],_0x5e2e36));}function handleFindAgent(_0x4c15ce){return function(_0x364366){return _0x364366['name'][_0x40f9('0xb')]()===_0x4c15ce['toLowerCase']();};}exports['consequence']=function(_0x5d5050,_0xe97d55,_0x508320,_0x1320b0){return function(_0xcc4732){try{var _0xaeac66={'name':_0xe97d55[0x0],'timeout':_0xe97d55[0x1]};var _0x5299d2=queue[_0x40f9('0xc')](_0xaeac66,{'typecast':!![]});if(_0x5299d2[_0x40f9('0xd')]){logger[_0x40f9('0xe')](_0x40f9('0xf'),_0x5d5050,_[_0x40f9('0x10')](_0x5299d2,'message')[_0x40f9('0x11')](',\x20'));_0xcc4732[_0x40f9('0x12')]();}else{var _0x3d6456=_[_0x40f9('0x13')](_0x508320['agents'],handleFindAgent(_0xaeac66[_0x40f9('0x14')]));if(_0x3d6456){var _0x1616de=(_0xaeac66['timeout']||0xa)*0x3e8;var _0x3d31ca,_0x44e295;var _0x387256=seqqueue['createQueue'](_0x1616de);_0x387256['id']=_0x5d5050;_0x387256['atimeout']=_0x1616de;_0x387256['channel']=_0x1320b0['channel'];writeLog(_0x5d5050,_0x3d6456,util[_0x40f9('0x9')](_0x40f9('0x15'),_0x1616de));_0x508320[_0x40f9('0x16')][_0x5d5050]['on'](_0x40f9('0x17'),function(){logger[_0x40f9('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5d5050);clearTimeout(_0x44e295);_0x44e295=undefined;_0x387256[_0x40f9('0x18')]();if(_0x508320['rules'][_0x5d5050]){delete _0x508320[_0x40f9('0x16')][_0x5d5050];}_0xcc4732[_0x40f9('0x12')]();});_0x508320[_0x40f9('0x16')][_0x5d5050]['on']('complete',function(){if(_0x508320[_0x40f9('0x16')][_0x5d5050]){delete _0x508320[_0x40f9('0x16')][_0x5d5050];}});_0x44e295=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x5d5050);clearTimeout(_0x44e295);_0x387256[_0x40f9('0x18')]();_0xcc4732['next']();},_0x1616de);strategy[_0x40f9('0x19')](_0x387256,_0x3d6456,_0x508320,_0x1320b0);}else{logger[_0x40f9('0xe')](_0x40f9('0x1a'),_0x5d5050,_0xaeac66[_0x40f9('0x14')]);_0xcc4732['stop']();}}}catch(_0x2b691b){console[_0x40f9('0x1b')](_0x2b691b);logger[_0x40f9('0xe')](_0x40f9('0x1c'),_0x5d5050,_0x2b691b[_0x40f9('0x1d')]);_0xcc4732[_0x40f9('0x12')]();}};}; \ 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 4de28e2..61a93d6 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 _0x1357=['contact','out','sms','channel','whatsapp','phone','interaction','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','then','body','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','amazonlex','providerName','providerResponse','Message','dialogState','lodash','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0x2d81de,_0x2ed903){var _0xe91fc1=function(_0x4ae7d0){while(--_0x4ae7d0){_0x2d81de['push'](_0x2d81de['shift']());}};_0xe91fc1(++_0x2ed903);}(_0x1357,0x7c));var _0x7135=function(_0x42c7b5,_0x3f2ccf){_0x42c7b5=_0x42c7b5-0x0;var _0x3919b2=_0x1357[_0x42c7b5];return _0x3919b2;};'use strict';var _=require(_0x7135('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x7135('0x1'));var logger=require(_0x7135('0x2'))(_0x7135('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7135('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7135('0x5')),'whatsappMessage':require(_0x7135('0x6'))};exports[_0x7135('0x7')]=function(_0x23d191,_0x489d7a){return function(_0x30f0c0){try{if(!_[_0x7135('0x8')](this['interaction'][_0x7135('0x9')])){logger[_0x7135('0xa')](_0x7135('0xb'),_0x23d191,_0x7135('0xc'));return _0x30f0c0[_0x7135('0xd')]();}var _0x2c751f={'ContactId':this[_0x7135('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x7135('0xf')};if(this['channel']===_0x7135('0x10')||this[_0x7135('0x11')]===_0x7135('0x12')){_0x2c751f[_0x7135('0x13')]=this[_0x7135('0x14')][_0x7135('0x13')];}var _0x3d03ae=this['channel'];if(_0x3d03ae==='chat'){_0x2c751f[_0x7135('0x15')]=this['account']['id'];}else{_0x2c751f[_[_0x7135('0x16')](_0x3d03ae)+_0x7135('0x17')]=this[_0x7135('0x18')]['id'];}_0x2c751f[_[_0x7135('0x16')](_0x3d03ae)+_0x7135('0x19')]=this[_0x7135('0x14')]['id'];if(this[_0x7135('0x14')][_0x7135('0x1a')]){var _0x159e2b=_0x489d7a[0x4];if(!_[_0x7135('0x1b')](_0x159e2b)){_0x2c751f['body']=utils[_0x7135('0x1c')](_0x159e2b,this);return rpc[_0x3d03ae+'Message']['create'](_0x2c751f)[_0x7135('0x1d')](function(_0x588217){logger[_0x7135('0xa')]('[%s][AMAZONLEX]\x20%s',_0x23d191,_0x2c751f[_0x7135('0x1e')]);})[_0x7135('0x1f')](function(_0x422d08){logger[_0x7135('0x20')]('[%s][AMAZONLEX]\x20%s',_0x23d191,JSON[_0x7135('0x21')](_0x422d08));})['finally'](function(){logger[_0x7135('0xa')](_0x7135('0x22'),_0x23d191);_0x30f0c0[_0x7135('0x23')]();});}else{logger[_0x7135('0xa')](_0x7135('0x24'),_0x23d191);_0x30f0c0[_0x7135('0x23')]();}}else{var _0x534bdb=this;var _0x3919b8=new AWS[(_0x7135('0x25'))]({'accessKeyId':_0x489d7a[0x0],'secretAccessKey':_0x489d7a[0x1],'region':_0x489d7a[0x2]});var _0x3c8c11={'botAlias':_0x7135('0x26'),'botName':_0x489d7a[0x3],'inputText':this[_0x7135('0x27')][_0x7135('0x1e')],'userId':this[_0x7135('0x11')]+':'+this[_0x7135('0x14')]['id'][_0x7135('0x28')]()};_0x3919b8['postText'](_0x3c8c11,function(_0x298b3b,_0x3ac6f6){if(_0x298b3b){logger[_0x7135('0x20')](_0x7135('0xb'),_0x23d191,_0x298b3b['message']);_0x30f0c0[_0x7135('0xd')]();}else if(_0x3ac6f6&&_0x3ac6f6[_0x7135('0x27')]){_0x534bdb[_0x7135('0x1e')][_0x7135('0x29')]=_0x3ac6f6;_0x2c751f[_0x7135('0x1e')]=_0x3ac6f6[_0x7135('0x27')];_0x2c751f[_0x7135('0x2a')]=_0x7135('0x29');_0x2c751f[_0x7135('0x2b')]=JSON['stringify'](_0x3ac6f6);return rpc[_0x3d03ae+_0x7135('0x2c')]['create'](_0x2c751f)[_0x7135('0x1d')](function(_0x3c2e5c){logger[_0x7135('0xa')](_0x7135('0xb'),_0x23d191,_0x2c751f['body']);if(_0x3ac6f6[_0x7135('0x2d')]=='Failed'){_0x30f0c0['next']();}else{_0x30f0c0['stop']();}})[_0x7135('0x1f')](function(_0x3f5866){logger[_0x7135('0x20')](_0x7135('0xb'),_0x23d191,JSON[_0x7135('0x21')](_0x3f5866));_0x30f0c0[_0x7135('0xd')]();});}else{_0x30f0c0[_0x7135('0xd')]();}});}}catch(_0x338faf){logger[_0x7135('0x20')](_0x7135('0xb'),_0x23d191,JSON['stringify'](_0x338faf));_0x30f0c0[_0x7135('0x23')]();}};}; \ No newline at end of file +var _0x6f22=['then','catch','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','postText','message','providerName','amazonlex','providerResponse','dialogState','Failed','stop','error','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create'];(function(_0x27054f,_0x457a4d){var _0x15bc6c=function(_0x42db85){while(--_0x42db85){_0x27054f['push'](_0x27054f['shift']());}};_0x15bc6c(++_0x457a4d);}(_0x6f22,0x124));var _0x26f2=function(_0x3a3731,_0x2d573a){_0x3a3731=_0x3a3731-0x0;var _0x23ee93=_0x6f22[_0x3a3731];return _0x23ee93;};'use strict';var _=require('lodash');var moment=require(_0x26f2('0x0'));var AWS=require(_0x26f2('0x1'));var utils=require('./utils');var logger=require(_0x26f2('0x2'))(_0x26f2('0x3'));var rpc={'chatMessage':require(_0x26f2('0x4')),'openchannelMessage':require(_0x26f2('0x5')),'mailMessage':require(_0x26f2('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x26f2('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x26f2('0x8')]=function(_0x177efb,_0x54b2e4){return function(_0x40b715){try{if(!_[_0x26f2('0x9')](this[_0x26f2('0xa')][_0x26f2('0xb')])){logger[_0x26f2('0xc')](_0x26f2('0xd'),_0x177efb,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x40b715[_0x26f2('0xe')]();}var _0x32724d={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x26f2('0xf')),'direction':'out'};if(this[_0x26f2('0x10')]==='sms'||this[_0x26f2('0x10')]===_0x26f2('0x11')){_0x32724d[_0x26f2('0x12')]=this[_0x26f2('0xa')][_0x26f2('0x12')];}var _0x33b689=this[_0x26f2('0x10')];if(_0x33b689==='chat'){_0x32724d[_0x26f2('0x13')]=this['account']['id'];}else{_0x32724d[_[_0x26f2('0x14')](_0x33b689)+_0x26f2('0x15')]=this[_0x26f2('0x16')]['id'];}_0x32724d[_[_0x26f2('0x14')](_0x33b689)+_0x26f2('0x17')]=this[_0x26f2('0xa')]['id'];if(this[_0x26f2('0xa')][_0x26f2('0x18')]){var _0x489099=_0x54b2e4[0x4];if(!_[_0x26f2('0x19')](_0x489099)){_0x32724d[_0x26f2('0x1a')]=utils[_0x26f2('0x1b')](_0x489099,this);return rpc[_0x33b689+_0x26f2('0x1c')][_0x26f2('0x1d')](_0x32724d)[_0x26f2('0x1e')](function(_0x22da62){logger[_0x26f2('0xc')](_0x26f2('0xd'),_0x177efb,_0x32724d['body']);})[_0x26f2('0x1f')](function(_0x34cc4e){logger['error'](_0x26f2('0xd'),_0x177efb,JSON[_0x26f2('0x20')](_0x34cc4e));})['finally'](function(){logger['info'](_0x26f2('0x21'),_0x177efb);_0x40b715['stop']();});}else{logger[_0x26f2('0xc')](_0x26f2('0x22'),_0x177efb);_0x40b715['stop']();}}else{var _0x553425=this;var _0x4f5c3e=new AWS[(_0x26f2('0x23'))]({'accessKeyId':_0x54b2e4[0x0],'secretAccessKey':_0x54b2e4[0x1],'region':_0x54b2e4[0x2]});var _0x3cba67={'botAlias':'$LATEST','botName':_0x54b2e4[0x3],'inputText':this['message']['body'],'userId':this[_0x26f2('0x10')]+':'+this['interaction']['id'][_0x26f2('0x24')]()};_0x4f5c3e[_0x26f2('0x25')](_0x3cba67,function(_0x42eff2,_0x4a4b7c){if(_0x42eff2){logger['error'](_0x26f2('0xd'),_0x177efb,_0x42eff2[_0x26f2('0x26')]);_0x40b715['next']();}else if(_0x4a4b7c&&_0x4a4b7c[_0x26f2('0x26')]){_0x553425['body']['amazonlex']=_0x4a4b7c;_0x32724d[_0x26f2('0x1a')]=_0x4a4b7c[_0x26f2('0x26')];_0x32724d[_0x26f2('0x27')]=_0x26f2('0x28');_0x32724d[_0x26f2('0x29')]=JSON['stringify'](_0x4a4b7c);return rpc[_0x33b689+_0x26f2('0x1c')]['create'](_0x32724d)[_0x26f2('0x1e')](function(_0x1fbdb6){logger['info'](_0x26f2('0xd'),_0x177efb,_0x32724d[_0x26f2('0x1a')]);if(_0x4a4b7c[_0x26f2('0x2a')]==_0x26f2('0x2b')){_0x40b715[_0x26f2('0xe')]();}else{_0x40b715[_0x26f2('0x2c')]();}})[_0x26f2('0x1f')](function(_0x2bef6f){logger[_0x26f2('0x2d')](_0x26f2('0xd'),_0x177efb,JSON[_0x26f2('0x20')](_0x2bef6f));_0x40b715[_0x26f2('0xe')]();});}else{_0x40b715[_0x26f2('0xe')]();}});}}catch(_0x5e1aed){logger[_0x26f2('0x2d')](_0x26f2('0xd'),_0x177efb,JSON[_0x26f2('0x20')](_0x5e1aed));_0x40b715[_0x26f2('0x2c')]();}};}; \ 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 03384c9..52ec815 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 _0xa8c1=['../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','InteractionId','Message','inReplyTo','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','account','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','finally','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa8c1,0x1d6));var _0x1a8c=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xa8c1[_0x2cc8bb];return _0x140e40;};'use strict';var _=require('lodash');var moment=require(_0x1a8c('0x0'));var utils=require(_0x1a8c('0x1'));var logger=require(_0x1a8c('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x1a8c('0x3')),'mailMessage':require(_0x1a8c('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1a8c('0x5')),'whatsappMessage':require(_0x1a8c('0x6')),'chatInteraction':require(_0x1a8c('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x1a8c('0x8')),'smsInteraction':require(_0x1a8c('0x9')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1a8c('0xa'))};var mailRpc=require(_0x1a8c('0xb'));exports[_0x1a8c('0xc')]=function(_0x3dad3b,_0x106a0c,_0x5c79b4,_0x24c2e3){return function(_0x168468){try{var _0x6e24f2=this[_0x1a8c('0xd')];if(_0x6e24f2===_0x1a8c('0xe')&&_0x24c2e3['body']['isAutoreply']){logger[_0x1a8c('0xf')]('[%s][AUTOREPLY]\x20%s',_0x3dad3b,_0x1a8c('0x10'));return _0x168468[_0x1a8c('0x11')]();}if(_0x106a0c[0x0]==='1'&&(_[_0x1a8c('0x12')](this['interaction'][_0x1a8c('0x13')])||!this[_0x1a8c('0x14')][_0x1a8c('0x13')])){logger[_0x1a8c('0xf')](_0x1a8c('0x15'),_0x3dad3b,_0x1a8c('0x16'));return _0x168468[_0x1a8c('0x11')]();}if(_0x106a0c[0x0]==='2'&&this['interaction'][_0x1a8c('0x17')]){logger[_0x1a8c('0xf')](_0x1a8c('0x18'),_0x3dad3b,_0x1a8c('0x19'));return _0x168468[_0x1a8c('0x11')]();}var _0x5be567={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1a8c('0x1a')](_0x1a8c('0x1b')),'direction':_0x1a8c('0x1c')};if(this[_0x1a8c('0xd')]===_0x1a8c('0xe')){_0x5be567[_0x1a8c('0x1d')]=utils[_0x1a8c('0x1e')](_0x106a0c[0x2],this);}else{_0x5be567[_0x1a8c('0x1d')]=utils[_0x1a8c('0x1e')](_0x106a0c[0x1],this);}if(this[_0x1a8c('0x1f')]){_0x5be567['to']=this[_0x1a8c('0x1f')][_0x1a8c('0x20')]||'';if(this['channel']===_0x1a8c('0xe')&&_0x106a0c[0x1]==='1'){_0x5be567['cc']=this[_0x1a8c('0x1f')]['cc']||'';}_0x5be567['from']=this[_0x1a8c('0x1f')]['to']||'';_0x5be567[_0x1a8c('0x21')]=this['message'][_0x1a8c('0x21')]||'';_0x5be567[_0x1a8c('0x22')]=!![];if(this[_0x1a8c('0x1f')][_0x1a8c('0x23')]){_0x5be567['subject']='';_0x5be567[_0x1a8c('0x23')]+=_[_0x1a8c('0x24')](this[_0x1a8c('0x1f')][_0x1a8c('0x23')],_0x1a8c('0x25'))?'':_0x1a8c('0x26');_0x5be567[_0x1a8c('0x23')]+=this['message'][_0x1a8c('0x23')];}}if(this[_0x1a8c('0xd')]===_0x1a8c('0x27')){_0x5be567['ChatWebsiteId']=this['account']['id'];}else{_0x5be567[_['upperFirst'](this['channel'])+'AccountId']=this['account']['id'];}_0x5be567[_['upperFirst'](this['channel'])+_0x1a8c('0x28')]=this['interaction']['id'];var _0x412c5b=this[_0x1a8c('0x14')];if(rpc[this['channel']+_0x1a8c('0x29')]){if(this[_0x1a8c('0xd')]==='mail'){_0x5be567[_0x1a8c('0x2a')]=this[_0x1a8c('0x1f')]['messageId'];_0x5be567[_0x1a8c('0x2b')]=_0x1a8c('0x2c')+_[_0x1a8c('0x2d')](_0x5be567[_0x1a8c('0x1d')],_0x1a8c('0x2e'),_0x1a8c('0x2f'))+_0x1a8c('0x30');_0x5be567[_0x1a8c('0x31')]={'Auto-Submitted':_0x1a8c('0x32'),'X-Auto-Response-Suppress':_0x1a8c('0x33'),'Precedence':_0x1a8c('0x34')};return mailRpc[_0x1a8c('0x35')](this[_0x1a8c('0x36')]['smtpOptions'],_0x5be567)[_0x1a8c('0x37')](function(_0x573841){logger['info'](_0x1a8c('0x38'),_0x3dad3b);_0x5be567['messageId']=_0x573841['message']['messageId'];return rpc[_0x6e24f2+_0x1a8c('0x29')][_0x1a8c('0x39')](_0x5be567);})[_0x1a8c('0x37')](function(_0x49afbc){logger[_0x1a8c('0xf')](_0x1a8c('0x15'),_0x3dad3b,JSON[_0x1a8c('0x3a')](_0x49afbc));})[_0x1a8c('0x3b')](function(_0x332c8e){logger[_0x1a8c('0x3c')](_0x1a8c('0x3d'),_0x3dad3b,JSON['stringify'](_0x332c8e));})['finally'](function(){Promise['resolve']()[_0x1a8c('0x37')](function(){if(_0x106a0c[0x0]!=='2'||_0x412c5b[_0x1a8c('0x17')])return;return rpc[_0x6e24f2+_0x1a8c('0x3e')][_0x1a8c('0x3f')](_0x412c5b['id'],{'autoreplyExecuted':!![]})[_0x1a8c('0x37')](function(_0x45ce1e){logger[_0x1a8c('0xf')](_0x1a8c('0x18'),_0x3dad3b,JSON['stringify'](_0x45ce1e));})[_0x1a8c('0x3b')](function(_0x5e0d29){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3dad3b,JSON[_0x1a8c('0x3a')](_0x5e0d29));});})[_0x1a8c('0x37')](function(){_0x168468[_0x1a8c('0x11')]();});});}else{return rpc[this[_0x1a8c('0xd')]+_0x1a8c('0x29')][_0x1a8c('0x39')](_0x5be567)['then'](function(){logger[_0x1a8c('0xf')](_0x1a8c('0x15'),_0x3dad3b,_0x5be567[_0x1a8c('0x1d')]);})[_0x1a8c('0x3b')](function(_0x1fa9fc){logger[_0x1a8c('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x3dad3b,JSON[_0x1a8c('0x3a')](_0x1fa9fc));})[_0x1a8c('0x40')](function(){Promise[_0x1a8c('0x41')]()['then'](function(){if(_0x106a0c[0x0]!=='2'||_0x412c5b[_0x1a8c('0x17')])return;return rpc[_0x6e24f2+'Interaction'][_0x1a8c('0x3f')](_0x412c5b['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1306ac){logger[_0x1a8c('0xf')](_0x1a8c('0x18'),_0x3dad3b,JSON[_0x1a8c('0x3a')](_0x1306ac));})[_0x1a8c('0x3b')](function(_0x3b5be1){logger[_0x1a8c('0x3c')](_0x1a8c('0x42'),_0x3dad3b,JSON['stringify'](_0x3b5be1));});})[_0x1a8c('0x37')](function(){_0x168468[_0x1a8c('0x11')]();});});}}}catch(_0x4c89dd){logger['error'](_0x1a8c('0x15'),_0x3dad3b,JSON[_0x1a8c('0x3a')](_0x4c89dd));_0x168468[_0x1a8c('0x43')]();}};}; \ No newline at end of file +var _0x7d2e=['../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','info','[%s][AUTOREPLY]\x20%s','next','isNil','created','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','body','getMustacheRender','message','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','Message','create','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','catch','finally','stop','moment','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction'];(function(_0x3ec203,_0x4d6848){var _0x317595=function(_0xa0d92e){while(--_0xa0d92e){_0x3ec203['push'](_0x3ec203['shift']());}};_0x317595(++_0x4d6848);}(_0x7d2e,0x79));var _0xe7d2=function(_0x5c81d1,_0x3e1d94){_0x5c81d1=_0x5c81d1-0x0;var _0x275777=_0x7d2e[_0x5c81d1];return _0x275777;};'use strict';var _=require('lodash');var moment=require(_0xe7d2('0x0'));var utils=require(_0xe7d2('0x1'));var logger=require(_0xe7d2('0x2'))(_0xe7d2('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xe7d2('0x4')),'smsMessage':require(_0xe7d2('0x5')),'faxMessage':require(_0xe7d2('0x6')),'whatsappMessage':require(_0xe7d2('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xe7d2('0x8')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xe7d2('0x9')),'faxInteraction':require(_0xe7d2('0xa')),'whatsappInteraction':require(_0xe7d2('0xb'))};var mailRpc=require(_0xe7d2('0xc'));exports['consequence']=function(_0x25ad6c,_0xa30c3e,_0x249a51,_0x2d3bd7){return function(_0x1002a6){try{var _0x55e1e7=this['channel'];if(_0x55e1e7===_0xe7d2('0xd')&&_0x2d3bd7['body']['isAutoreply']){logger[_0xe7d2('0xe')](_0xe7d2('0xf'),_0x25ad6c,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x1002a6[_0xe7d2('0x10')]();}if(_0xa30c3e[0x0]==='1'&&(_[_0xe7d2('0x11')](this['interaction'][_0xe7d2('0x12')])||!this[_0xe7d2('0x13')][_0xe7d2('0x12')])){logger['info'](_0xe7d2('0xf'),_0x25ad6c,_0xe7d2('0x14'));return _0x1002a6['next']();}if(_0xa30c3e[0x0]==='2'&&this['interaction'][_0xe7d2('0x15')]){logger[_0xe7d2('0xe')](_0xe7d2('0x16'),_0x25ad6c,_0xe7d2('0x17'));return _0x1002a6[_0xe7d2('0x10')]();}var _0x4165c1={'ContactId':this[_0xe7d2('0x18')]['id'],'sentAt':moment()[_0xe7d2('0x19')](_0xe7d2('0x1a')),'direction':_0xe7d2('0x1b')};if(this[_0xe7d2('0x1c')]===_0xe7d2('0xd')){_0x4165c1[_0xe7d2('0x1d')]=utils[_0xe7d2('0x1e')](_0xa30c3e[0x2],this);}else{_0x4165c1['body']=utils['getMustacheRender'](_0xa30c3e[0x1],this);}if(this[_0xe7d2('0x1f')]){_0x4165c1['to']=this['message']['from']||'';if(this[_0xe7d2('0x1c')]==='mail'&&_0xa30c3e[0x1]==='1'){_0x4165c1['cc']=this[_0xe7d2('0x1f')]['cc']||'';}_0x4165c1['from']=this[_0xe7d2('0x1f')]['to']||'';_0x4165c1['phone']=this[_0xe7d2('0x1f')][_0xe7d2('0x20')]||'';_0x4165c1[_0xe7d2('0x21')]=!![];if(this[_0xe7d2('0x1f')][_0xe7d2('0x22')]){_0x4165c1[_0xe7d2('0x22')]='';_0x4165c1[_0xe7d2('0x22')]+=_[_0xe7d2('0x23')](this[_0xe7d2('0x1f')][_0xe7d2('0x22')],_0xe7d2('0x24'))?'':_0xe7d2('0x25');_0x4165c1[_0xe7d2('0x22')]+=this[_0xe7d2('0x1f')][_0xe7d2('0x22')];}}if(this['channel']===_0xe7d2('0x26')){_0x4165c1[_0xe7d2('0x27')]=this[_0xe7d2('0x28')]['id'];}else{_0x4165c1[_[_0xe7d2('0x29')](this[_0xe7d2('0x1c')])+_0xe7d2('0x2a')]=this['account']['id'];}_0x4165c1[_[_0xe7d2('0x29')](this[_0xe7d2('0x1c')])+_0xe7d2('0x2b')]=this[_0xe7d2('0x13')]['id'];var _0x1d07c7=this['interaction'];if(rpc[this['channel']+'Message']){if(this[_0xe7d2('0x1c')]===_0xe7d2('0xd')){_0x4165c1['inReplyTo']=this['message'][_0xe7d2('0x2c')];_0x4165c1[_0xe7d2('0x2d')]=_0xe7d2('0x2e')+_[_0xe7d2('0x2f')](_0x4165c1[_0xe7d2('0x1d')],']+(>|$)/g,''),'priorityTrue':_0x453890[0x1],'priorityFalse':_0x453890[0x2]};var _0x424526=gotoif['validate'](_0x4159d2,{'typecast':!![]});if(_0x424526[_0xd59a('0xc')]){logger[_0xd59a('0xd')](_0xd59a('0xe'),_0x46d16b,_[_0xd59a('0xf')](_0x424526,'message')[_0xd59a('0x10')](',\x20'));_0x3761e2[_0xd59a('0x11')]();}else{try{var _0x18a706=eval('('+_0x4159d2['condition']+')');var _0x51f1ab=_0x18a706?_0x4159d2[_0xd59a('0x12')]:_0x4159d2[_0xd59a('0x13')];logger['info'](_0xd59a('0x14'),_0x46d16b,_0x4159d2[_0xd59a('0x15')],_0x18a706,_0x51f1ab||'next');if(_0x51f1ab){var _0x5da2ca=_[_0xd59a('0x16')](_0x3761e2['rules'](),{'p':_0x51f1ab});if(_0x5da2ca>=0x0){logger[_0xd59a('0x17')](_0xd59a('0x18'),_0x46d16b,_0x51f1ab||_0xd59a('0x19'),_0x5da2ca);_0x3761e2[_0xd59a('0x19')](_0x5da2ca);}else{logger[_0xd59a('0x17')](_0xd59a('0x1a'),_0x46d16b,_0x51f1ab||_0xd59a('0x19'));_0x3761e2[_0xd59a('0x11')]();}}else{_0x3761e2[_0xd59a('0x19')]();}}catch(_0x27e06e){logger[_0xd59a('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x46d16b,_0x27e06e['message']);_0x3761e2[_0xd59a('0x11')]();}}}catch(_0x552b9c){logger['error'](_0xd59a('0xe'),_0x46d16b,JSON['stringify'](_0x552b9c));_0x3761e2[_0xd59a('0x11')]();}};}; \ No newline at end of file +var _0x0306=['routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stringify','validate','lodash','html-to-text','./utils'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0306,0x68));var _0x6030=function(_0x10d32f,_0x5cd3aa){_0x10d32f=_0x10d32f-0x0;var _0x67588c=_0x0306[_0x10d32f];return _0x67588c;};'use strict';var schema=require(_0x6030('0x0'));var _=require(_0x6030('0x1'));var htmlToText=require(_0x6030('0x2'));var utils=require(_0x6030('0x3'));var logger=require('../../../../config/logger')(_0x6030('0x4'));var gotoif=schema({'condition':{'type':_0x6030('0x5'),'required':!![],'message':_0x6030('0x6')},'priorityTrue':{'type':_0x6030('0x7'),'message':_0x6030('0x8')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x6030('0x9')]=function(_0x504535,_0x193b7a){return function(_0x11f773){try{var _0x1387d2={'condition':htmlToText[_0x6030('0xa')](utils['getMustacheRender'](_0x193b7a[0x0],this),{'wordwrap':![]})[_0x6030('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x193b7a[0x1],'priorityFalse':_0x193b7a[0x2]};var _0x6e85c4=gotoif[_0x6030('0x0')](_0x1387d2,{'typecast':!![]});if(_0x6e85c4['length']){logger[_0x6030('0xc')](_0x6030('0xd'),_0x504535,_['map'](_0x6e85c4,_0x6030('0xe'))[_0x6030('0xf')](',\x20'));_0x11f773[_0x6030('0x10')]();}else{try{var _0x324d21=eval('('+_0x1387d2[_0x6030('0x11')]+')');var _0x1028cd=_0x324d21?_0x1387d2[_0x6030('0x12')]:_0x1387d2[_0x6030('0x13')];logger['info'](_0x6030('0x14'),_0x504535,_0x1387d2[_0x6030('0x11')],_0x324d21,_0x1028cd||_0x6030('0x15'));if(_0x1028cd){var _0x5c47ea=_[_0x6030('0x16')](_0x11f773[_0x6030('0x17')](),{'p':_0x1028cd});if(_0x5c47ea>=0x0){logger[_0x6030('0x18')](_0x6030('0x19'),_0x504535,_0x1028cd||'next',_0x5c47ea);_0x11f773[_0x6030('0x15')](_0x5c47ea);}else{logger[_0x6030('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x504535,_0x1028cd||_0x6030('0x15'));_0x11f773['stop']();}}else{_0x11f773[_0x6030('0x15')]();}}catch(_0x37ef9d){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x504535,_0x37ef9d[_0x6030('0xe')]);_0x11f773[_0x6030('0x10')]();}}}catch(_0x38306c){logger[_0x6030('0xc')](_0x6030('0xd'),_0x504535,JSON[_0x6030('0x1a')](_0x38306c));_0x11f773[_0x6030('0x10')]();}};}; \ 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 62a7fc2..b5f3242 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 _0x9f0d=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x9f0d,0x190));var _0xd9f0=function(_0x39d4a1,_0x46ba00){_0x39d4a1=_0x39d4a1-0x0;var _0x13c306=_0x9f0d[_0x39d4a1];return _0x13c306;};'use strict';var schema=require(_0xd9f0('0x0'));var _=require(_0xd9f0('0x1'));var logger=require(_0xd9f0('0x2'))(_0xd9f0('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xd9f0('0x4')}});exports[_0xd9f0('0x5')]=function(_0x42a329,_0xb6279e){return function(_0x5118f7){try{var _0x202dec={'priority':_0xb6279e[0x0]};var _0x4ff783=gotop[_0xd9f0('0x0')](_0x202dec,{'typecast':!![]});if(_0x4ff783[_0xd9f0('0x6')]){logger[_0xd9f0('0x7')](_0xd9f0('0x8'),_0x42a329,_[_0xd9f0('0x9')](_0x4ff783,_0xd9f0('0xa'))[_0xd9f0('0xb')](',\x20'));_0x5118f7[_0xd9f0('0xc')]();}else{logger[_0xd9f0('0xd')](_0xd9f0('0xe'),_0x42a329,_0x202dec[_0xd9f0('0xf')]);if(_0x202dec[_0xd9f0('0xf')]){var _0x19e651=_['findIndex'](_0x5118f7['rules'](),{'p':_0x202dec['priority']});if(_0x19e651>=0x0){logger[_0xd9f0('0xd')](_0xd9f0('0x10'),_0x42a329,_0x202dec['priority']||_0xd9f0('0x11'),_0x19e651);_0x5118f7[_0xd9f0('0x11')](_0x19e651);}else{logger[_0xd9f0('0xd')](_0xd9f0('0x12'),_0x42a329,_0x202dec['priority']||_0xd9f0('0x11'));_0x5118f7[_0xd9f0('0xc')]();}}else{_0x5118f7[_0xd9f0('0x11')]();}}}catch(_0x53c7ae){logger['error'](_0xd9f0('0x8'),_0x42a329,JSON['stringify'](_0x53c7ae));_0x5118f7[_0xd9f0('0xc')]();}};}; \ No newline at end of file +var _0x27bb=['[%s][GOTOP]\x20priority\x20%s','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','length','error','map','message','join','stop','info'];(function(_0x5a4257,_0x3ae34d){var _0x3746a7=function(_0x31fff0){while(--_0x31fff0){_0x5a4257['push'](_0x5a4257['shift']());}};_0x3746a7(++_0x3ae34d);}(_0x27bb,0x95));var _0xb27b=function(_0x247a7f,_0x3884e2){_0x247a7f=_0x247a7f-0x0;var _0x1f49ae=_0x27bb[_0x247a7f];return _0x1f49ae;};'use strict';var schema=require(_0xb27b('0x0'));var _=require(_0xb27b('0x1'));var logger=require(_0xb27b('0x2'))(_0xb27b('0x3'));var gotop=schema({'priority':{'type':_0xb27b('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xb27b('0x5')]=function(_0x275169,_0x4d5e1b){return function(_0x5bd175){try{var _0x132fd6={'priority':_0x4d5e1b[0x0]};var _0xf00c1d=gotop[_0xb27b('0x0')](_0x132fd6,{'typecast':!![]});if(_0xf00c1d[_0xb27b('0x6')]){logger[_0xb27b('0x7')]('[%s][GOTOP]\x20%s',_0x275169,_[_0xb27b('0x8')](_0xf00c1d,_0xb27b('0x9'))[_0xb27b('0xa')](',\x20'));_0x5bd175[_0xb27b('0xb')]();}else{logger[_0xb27b('0xc')](_0xb27b('0xd'),_0x275169,_0x132fd6[_0xb27b('0xe')]);if(_0x132fd6['priority']){var _0x383681=_['findIndex'](_0x5bd175['rules'](),{'p':_0x132fd6[_0xb27b('0xe')]});if(_0x383681>=0x0){logger[_0xb27b('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x275169,_0x132fd6['priority']||_0xb27b('0xf'),_0x383681);_0x5bd175[_0xb27b('0xf')](_0x383681);}else{logger[_0xb27b('0xc')](_0xb27b('0x10'),_0x275169,_0x132fd6[_0xb27b('0xe')]||'next');_0x5bd175[_0xb27b('0xb')]();}}else{_0x5bd175[_0xb27b('0xf')]();}}}catch(_0x1a3f52){logger['error']('[%s][GOTOP]\x20%s',_0x275169,JSON[_0xb27b('0x11')](_0x1a3f52));_0x5bd175[_0xb27b('0xb')]();}};}; \ 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 cb925c9..9f79df8 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 _0xeae6=['interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','channel','chat','account','upperFirst'];(function(_0x4e9293,_0x4f35f6){var _0x8d74eb=function(_0x4ed1e1){while(--_0x4ed1e1){_0x4e9293['push'](_0x4e9293['shift']());}};_0x8d74eb(++_0x4f35f6);}(_0xeae6,0xc3));var _0x6eae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeae6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6eae('0x0'));var utils=require(_0x6eae('0x1'));var logger=require(_0x6eae('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6eae('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6eae('0x4')),'faxMessage':require(_0x6eae('0x5')),'whatsappMessage':require(_0x6eae('0x6'))};exports[_0x6eae('0x7')]=function(_0x3e0903,_0x134c6a){return function(_0x19d1e9){try{var _0x778b34={'body':utils['getMustacheRender'](_0x134c6a[0x0],this),'ContactId':this['contact']['id']};if(this[_0x6eae('0x8')]===_0x6eae('0x9')){_0x778b34['ChatWebsiteId']=this[_0x6eae('0xa')]['id'];}else{_0x778b34[_[_0x6eae('0xb')](this['channel'])+'AccountId']=this[_0x6eae('0xa')]['id'];}_0x778b34[_['upperFirst'](this['channel'])+'InteractionId']=this[_0x6eae('0xc')]['id'];if(rpc[this[_0x6eae('0x8')]+'Message']){return rpc[this[_0x6eae('0x8')]+_0x6eae('0xd')][_0x6eae('0xe')](_0x778b34)[_0x6eae('0xf')](function(_0x118bc0){logger[_0x6eae('0x10')](_0x6eae('0x11'),_0x3e0903,_0x778b34['body']);_0x19d1e9[_0x6eae('0x12')]();})[_0x6eae('0x13')](function(_0x147b90){logger[_0x6eae('0x14')](_0x6eae('0x11'),_0x3e0903,JSON[_0x6eae('0x15')](_0x147b90));_0x19d1e9[_0x6eae('0x16')]();});}}catch(_0x350393){logger[_0x6eae('0x14')](_0x6eae('0x11'),_0x3e0903,JSON[_0x6eae('0x15')](_0x350393));_0x19d1e9[_0x6eae('0x16')]();}};}; \ No newline at end of file +var _0xed4b=['create','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','Message'];(function(_0x1c05c0,_0x38e872){var _0x4b8d87=function(_0x4eb807){while(--_0x4eb807){_0x1c05c0['push'](_0x1c05c0['shift']());}};_0x4b8d87(++_0x38e872);}(_0xed4b,0x96));var _0xbed4=function(_0x35e7fb,_0x156793){_0x35e7fb=_0x35e7fb-0x0;var _0x45f6a6=_0xed4b[_0x35e7fb];return _0x45f6a6;};'use strict';var _=require(_0xbed4('0x0'));var utils=require(_0xbed4('0x1'));var logger=require(_0xbed4('0x2'))('routing');var rpc={'chatMessage':require(_0xbed4('0x3')),'openchannelMessage':require(_0xbed4('0x4')),'mailMessage':require(_0xbed4('0x5')),'smsMessage':require(_0xbed4('0x6')),'faxMessage':require(_0xbed4('0x7')),'whatsappMessage':require(_0xbed4('0x8'))};exports['consequence']=function(_0x26da19,_0xf71a47){return function(_0x403756){try{var _0x272560={'body':utils[_0xbed4('0x9')](_0xf71a47[0x0],this),'ContactId':this[_0xbed4('0xa')]['id']};if(this[_0xbed4('0xb')]===_0xbed4('0xc')){_0x272560[_0xbed4('0xd')]=this[_0xbed4('0xe')]['id'];}else{_0x272560[_[_0xbed4('0xf')](this[_0xbed4('0xb')])+_0xbed4('0x10')]=this['account']['id'];}_0x272560[_[_0xbed4('0xf')](this[_0xbed4('0xb')])+'InteractionId']=this['interaction']['id'];if(rpc[this['channel']+_0xbed4('0x11')]){return rpc[this[_0xbed4('0xb')]+_0xbed4('0x11')][_0xbed4('0x12')](_0x272560)[_0xbed4('0x13')](function(_0x24f19e){logger[_0xbed4('0x14')]('[%s][MESSAGE]\x20%s',_0x26da19,_0x272560[_0xbed4('0x15')]);_0x403756[_0xbed4('0x16')]();})[_0xbed4('0x17')](function(_0x4a5c97){logger[_0xbed4('0x18')](_0xbed4('0x19'),_0x26da19,JSON[_0xbed4('0x1a')](_0x4a5c97));_0x403756[_0xbed4('0x1b')]();});}}catch(_0x299bce){logger['error']('[%s][MESSAGE]\x20%s',_0x26da19,JSON['stringify'](_0x299bce));_0x403756[_0xbed4('0x1b')]();}};}; \ 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 e2cf5eb..013106a 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 _0x69db=['routing','info','getMustacheRender','error','[%s][NOOP]\x20%s','stringify','stop','./utils'];(function(_0x2960be,_0x70ed56){var _0x4529df=function(_0x1f0040){while(--_0x1f0040){_0x2960be['push'](_0x2960be['shift']());}};_0x4529df(++_0x70ed56);}(_0x69db,0x12f));var _0xb69d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x69db[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xb69d('0x0'));var logger=require('../../../../config/logger')(_0xb69d('0x1'));exports['consequence']=function(_0x4de0b4,_0x2f2fb7){return function(_0x56b4ec){try{logger[_0xb69d('0x2')]('[%s][NOOP]\x20%s',_0x4de0b4,utils[_0xb69d('0x3')](_0x2f2fb7[0x0],this));_0x56b4ec['next']();}catch(_0x298794){logger[_0xb69d('0x4')](_0xb69d('0x5'),_0x4de0b4,JSON[_0xb69d('0x6')](_0x298794));_0x56b4ec[_0xb69d('0x7')]();}};}; \ No newline at end of file +var _0x78b9=['stringify','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error'];(function(_0x272ad3,_0x56f0b2){var _0x1f1ccb=function(_0xf4d6c6){while(--_0xf4d6c6){_0x272ad3['push'](_0x272ad3['shift']());}};_0x1f1ccb(++_0x56f0b2);}(_0x78b9,0x9a));var _0x978b=function(_0x419eb7,_0x19c2ef){_0x419eb7=_0x419eb7-0x0;var _0x15c9f4=_0x78b9[_0x419eb7];return _0x15c9f4;};'use strict';var utils=require(_0x978b('0x0'));var logger=require(_0x978b('0x1'))(_0x978b('0x2'));exports[_0x978b('0x3')]=function(_0x55453c,_0x38519f){return function(_0x11e180){try{logger[_0x978b('0x4')](_0x978b('0x5'),_0x55453c,utils[_0x978b('0x6')](_0x38519f[0x0],this));_0x11e180['next']();}catch(_0x1ce7bd){logger[_0x978b('0x7')](_0x978b('0x5'),_0x55453c,JSON[_0x978b('0x8')](_0x1ce7bd));_0x11e180['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 752ebba..c5523dd 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 _0xe3d8=['info','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','find','Queues','timeout','createQueue','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','util','moment','ioredis','../../../../config/logger','routing','defaults','redis','localhost','queue_id','account','queue','joinAt','emit','clone','push','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','WebsiteId'];(function(_0x16a223,_0x31b6e8){var _0x5ded66=function(_0x25eb5f){while(--_0x25eb5f){_0x16a223['push'](_0x16a223['shift']());}};_0x5ded66(++_0x31b6e8);}(_0xe3d8,0x1a9));var _0x8e3d=function(_0x39c555,_0x5d71cd){_0x39c555=_0x39c555-0x0;var _0x182ffa=_0xe3d8[_0x39c555];return _0x182ffa;};'use strict';var schema=require(_0x8e3d('0x0'));var _=require(_0x8e3d('0x1'));var util=require(_0x8e3d('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x8e3d('0x3'));var Redis=require(_0x8e3d('0x4'));var config=require('../../../../config/environment');var logger=require(_0x8e3d('0x5'))(_0x8e3d('0x6'));var strategy=require('./strategy');config['redis']=_[_0x8e3d('0x7')](config[_0x8e3d('0x8')],{'host':_0x8e3d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8e3d('0x8')]));var attributes=['id',_0x8e3d('0xa'),_0x8e3d('0xb'),_0x8e3d('0xc'),'from',_0x8e3d('0xd')];function emit(_0x2247d7,_0x1e8271,_0x34f72f){io['to'](_0x2247d7)[_0x8e3d('0xe')](_0x1e8271,_0x34f72f);}function emitChannelQueueInteraction(_0x5bee07,_0x264be7,_0x5c595c,_0x3f1d14,_0x27d4be,_0x5b412e,_0x4e4cdc,_0x31dc11){var _0x591faa=_[_0x8e3d('0xf')](_0x5c595c);_0x591faa[_0x8e3d('0xa')]=_0x31dc11;_0x591faa[_0x8e3d('0xc')]=_0x264be7;_0x591faa['account']=_0x3f1d14;_0x591faa['id']=_0x27d4be;if(_0x5b412e){attributes[_0x8e3d('0x10')](_['capitalize'](_0x5bee07)+'InteractionId');_0x4e4cdc[util['format'](_0x8e3d('0x11'),_0x5bee07)][_0x27d4be]=_[_0x8e3d('0x12')](_0x591faa,attributes);}else{delete _0x4e4cdc[util[_0x8e3d('0x13')](_0x8e3d('0x11'),_0x5bee07)][_0x27d4be];}emit(util[_0x8e3d('0x13')](_0x8e3d('0x14'),_0x5bee07,_0x264be7),util['format']('%s_queue_waiting_interaction:%s',_0x5bee07,_0x5b412e?_0x8e3d('0x15'):'remove'),_[_0x8e3d('0x12')](_0x591faa,attributes));}var rpc={'openchannelQueueReport':require(_0x8e3d('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x8e3d('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x8e3d('0x18')),'whatsappQueueReport':require(_0x8e3d('0x19'))};var queue=schema({'name':{'type':_0x8e3d('0x1a'),'required':!![],'message':_0x8e3d('0x1b')},'timeout':{'type':'number','message':_0x8e3d('0x1c')}});function startRouting(_0x3858a3,_0x45c6d3,_0x3f1d38,_0x207e3c){if(_0x3858a3&&_0x45c6d3&&_0x3f1d38){_0x45c6d3[_0x8e3d('0x1d')]+=0x1;var _0x10a0e5={'uniqueid':_0x3858a3,'from':_0x3f1d38[_0x8e3d('0x1e')]?_0x3f1d38[_0x8e3d('0x1e')][_0x8e3d('0x1f')]:'','joinAt':moment()[_0x8e3d('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3f1d38[_0x8e3d('0x20')]?_0x3f1d38['contact']['id']:null,'ListId':_0x3f1d38[_0x8e3d('0x21')]?_0x3f1d38[_0x8e3d('0x21')]['id']:null};_0x10a0e5[_[_0x8e3d('0x22')](_0x3f1d38['channel'])+_0x8e3d('0x23')]=_0x45c6d3['id']||null;_0x10a0e5[_['upperFirst'](_0x3f1d38[_0x8e3d('0x24')])+_0x8e3d('0x25')]=_0x3f1d38[_0x8e3d('0x26')]?_0x3f1d38[_0x8e3d('0x26')]['id']:null;_0x10a0e5[_[_0x8e3d('0x22')](_0x3f1d38[_0x8e3d('0x24')])+_0x8e3d('0x27')]=_0x3f1d38[_0x8e3d('0x28')]?_0x3f1d38[_0x8e3d('0x28')]['id']:null;_0x10a0e5[_[_0x8e3d('0x22')](_0x3f1d38[_0x8e3d('0x24')])+(_0x3f1d38[_0x8e3d('0x24')]!==_0x8e3d('0x29')?'AccountId':_0x8e3d('0x2a'))]=_0x3f1d38['account']?_0x3f1d38['account']['id']:null;logger[_0x8e3d('0x2b')](util[_0x8e3d('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x3858a3,_0x45c6d3[_0x8e3d('0x2c')]));emitChannelQueueInteraction(_0x3f1d38[_0x8e3d('0x24')],_0x45c6d3[_0x8e3d('0x2c')],_0x10a0e5,_0x3f1d38[_0x8e3d('0xb')][_0x8e3d('0x2c')],_0x3f1d38[_0x8e3d('0x28')]['id'],!![],_0x207e3c,_0x45c6d3['id']);if(rpc[_0x3f1d38[_0x8e3d('0x24')]+'QueueReport']){return rpc[_0x3f1d38[_0x8e3d('0x24')]+_0x8e3d('0x2d')][_0x8e3d('0x2e')](_0x10a0e5)[_0x8e3d('0x2f')](function(_0x35aa14){logger[_0x8e3d('0x30')](_0x8e3d('0x31'));});}}}function stopRouting(_0x17afd6,_0x20cda4,_0x3169b2,_0x190f51){if(_0x17afd6&&_0x20cda4){_0x20cda4['waiting']-=0x1;var _0x47412f={'leaveAt':moment()[_0x8e3d('0x13')](_0x8e3d('0x32')),'acceptAt':moment()[_0x8e3d('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8e3d('0x33')};logger['info'](util['format'](_0x8e3d('0x34'),_0x17afd6,_0x20cda4[_0x8e3d('0x2c')]));emitChannelQueueInteraction(_0x3169b2[_0x8e3d('0x24')],_0x20cda4[_0x8e3d('0x2c')],_0x3169b2[_0x8e3d('0x1e')],_0x3169b2[_0x8e3d('0xb')][_0x8e3d('0x2c')],_0x3169b2[_0x8e3d('0x28')]['id'],![],_0x190f51,_0x20cda4['id']);if(rpc[_0x3169b2['channel']+'QueueReport']){return rpc[_0x3169b2[_0x8e3d('0x24')]+_0x8e3d('0x2d')][_0x8e3d('0x35')](_0x17afd6,_0x47412f)['catch'](function(_0x3a5487){logger[_0x8e3d('0x30')](_0x8e3d('0x36'));});}}}function endRouting(_0x321106,_0x475345,_0xe53c9,_0x5a2ac3){if(_0x321106&&_0x475345){_0x475345['waiting']-=0x1;var _0x410771={'leaveAt':moment()[_0x8e3d('0x13')](_0x8e3d('0x32')),'exitAt':moment()['format'](_0x8e3d('0x32')),'reason':'timeout'};logger[_0x8e3d('0x2b')](util[_0x8e3d('0x13')](_0x8e3d('0x37'),_0x321106,_0x475345['name']));emitChannelQueueInteraction(_0xe53c9['channel'],_0x475345['name'],_0xe53c9[_0x8e3d('0x1e')],_0xe53c9[_0x8e3d('0xb')][_0x8e3d('0x2c')],_0xe53c9[_0x8e3d('0x28')]['id'],![],_0x5a2ac3);if(rpc[_0xe53c9[_0x8e3d('0x24')]+_0x8e3d('0x2d')]){return rpc[_0xe53c9[_0x8e3d('0x24')]+'QueueReport'][_0x8e3d('0x35')](_0x321106,_0x410771)[_0x8e3d('0x2f')](function(_0x3c361a){logger['error'](_0x8e3d('0x36'));});}}}function handleFindQueue(_0x190d87){return function(_0x4a2f90){return _0x4a2f90['name'][_0x8e3d('0x38')]()===_0x190d87[_0x8e3d('0x38')]();};}exports[_0x8e3d('0x39')]=function(_0x2e1b0a,_0xaab8d3,_0x1399d2,_0x24e7d7){return function(_0x122f15){try{var _0x4a4fd1={'name':_0xaab8d3[0x0],'timeout':_0xaab8d3[0x1]};var _0xd30ab3=queue[_0x8e3d('0x0')](_0x4a4fd1,{'typecast':!![]});if(_0xd30ab3[_0x8e3d('0x3a')]){logger[_0x8e3d('0x30')]('[%s][QUEUE]\x20%s',_0x2e1b0a,_[_0x8e3d('0x3b')](_0xd30ab3,_0x8e3d('0x28'))[_0x8e3d('0x3c')](',\x20'));_0x122f15[_0x8e3d('0x3d')]();}else{var _0x51f3c8=_[_0x8e3d('0x3e')](_0x1399d2[_0x24e7d7[_0x8e3d('0x24')]+_0x8e3d('0x3f')],handleFindQueue(_0x4a4fd1[_0x8e3d('0x2c')]));if(_0x51f3c8){startRouting(_0x2e1b0a,_0x51f3c8,_0x24e7d7,_0x1399d2);var _0x18c3dc=(_0x51f3c8[_0x8e3d('0x40')]||0xa)*0x3e8;var _0x97e93c=(_0x4a4fd1[_0x8e3d('0x40')]||0x14)*0x3e8;var _0x5a8dc7;if(_0x18c3dc>_0x97e93c){_0x97e93c=_0x18c3dc;}var _0xd7823d=seqqueue[_0x8e3d('0x41')](_0x18c3dc);_0xd7823d['id']=_0x2e1b0a;_0xd7823d['atimeout']=_0x18c3dc;_0xd7823d['qtimeout']=_0x97e93c;_0xd7823d['channel']=_0x24e7d7['channel'];_0x1399d2[_0x8e3d('0x42')][_0x2e1b0a]['on'](_0x8e3d('0x43'),function(){logger[_0x8e3d('0x2b')](_0x8e3d('0x44'),_0x2e1b0a);stopRouting(_0x2e1b0a,_0x51f3c8,_0x24e7d7,_0x1399d2);clearTimeout(_0x5a8dc7);_0x5a8dc7=undefined;_0xd7823d['close'](!![]);if(_0x1399d2[_0x8e3d('0x42')][_0x2e1b0a]){delete _0x1399d2[_0x8e3d('0x42')][_0x2e1b0a];}_0x122f15[_0x8e3d('0x3d')]();});_0x1399d2['rules'][_0x2e1b0a]['on'](_0x8e3d('0x45'),function(){if(_0x1399d2[_0x8e3d('0x42')][_0x2e1b0a]){delete _0x1399d2[_0x8e3d('0x42')][_0x2e1b0a];}});_0x5a8dc7=setTimeout(function(){logger['info'](_0x8e3d('0x46'),_0x2e1b0a);endRouting(_0x2e1b0a,_0x51f3c8,_0x24e7d7,_0x1399d2);clearTimeout(_0x5a8dc7);_0xd7823d[_0x8e3d('0x47')](!![]);_0x122f15[_0x8e3d('0x48')]();},_0x97e93c);switch(_0x51f3c8[_0x8e3d('0x49')]){case _0x8e3d('0x4a'):strategy[_0x8e3d('0x4a')](_0xd7823d,_0x51f3c8,_0x1399d2,_0x24e7d7);break;default:strategy[_0x8e3d('0x4b')](_0xd7823d,_0x51f3c8,_0x1399d2,_0x24e7d7);}}else{logger['error'](_0x8e3d('0x4c'),_0x2e1b0a,_0x4a4fd1[_0x8e3d('0x2c')]);_0x122f15[_0x8e3d('0x3d')]();}}}catch(_0x9497e7){console[_0x8e3d('0x4d')](_0x9497e7);logger[_0x8e3d('0x30')]('[%s][QUEUE]\x20%s',_0x2e1b0a,_0x9497e7['stack']);_0x122f15['stop']();}};}; \ No newline at end of file +var _0x957f=['upperFirst','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','QueueReport','update','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20APPLICATION\x20END','close','next','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','queue_id','account','queue','from','emit','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','channel','QueueId','interaction'];(function(_0x18e3b3,_0x3e631d){var _0xbb7bc7=function(_0x44c41b){while(--_0x44c41b){_0x18e3b3['push'](_0x18e3b3['shift']());}};_0xbb7bc7(++_0x3e631d);}(_0x957f,0x150));var _0xf957=function(_0x5d8e11,_0x1b2574){_0x5d8e11=_0x5d8e11-0x0;var _0x25fa53=_0x957f[_0x5d8e11];return _0x25fa53;};'use strict';var schema=require('validate');var _=require(_0xf957('0x0'));var util=require(_0xf957('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xf957('0x2'));var Redis=require(_0xf957('0x3'));var config=require(_0xf957('0x4'));var logger=require(_0xf957('0x5'))('routing');var strategy=require(_0xf957('0x6'));config[_0xf957('0x7')]=_[_0xf957('0x8')](config['redis'],{'host':_0xf957('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf957('0x7')]));var attributes=['id',_0xf957('0xa'),_0xf957('0xb'),_0xf957('0xc'),_0xf957('0xd'),'joinAt'];function emit(_0x4127e0,_0x9b057d,_0x3d7813){io['to'](_0x4127e0)[_0xf957('0xe')](_0x9b057d,_0x3d7813);}function emitChannelQueueInteraction(_0x21cea4,_0x2591a4,_0x59bbb1,_0x3bc802,_0x4d658c,_0x436877,_0x10ce0f,_0x6b3aa2){var _0x208f89=_['clone'](_0x59bbb1);_0x208f89[_0xf957('0xa')]=_0x6b3aa2;_0x208f89['queue']=_0x2591a4;_0x208f89['account']=_0x3bc802;_0x208f89['id']=_0x4d658c;if(_0x436877){attributes['push'](_[_0xf957('0xf')](_0x21cea4)+_0xf957('0x10'));_0x10ce0f[util[_0xf957('0x11')](_0xf957('0x12'),_0x21cea4)][_0x4d658c]=_[_0xf957('0x13')](_0x208f89,attributes);}else{delete _0x10ce0f[util[_0xf957('0x11')]('%sQueuesWaitingInteractions',_0x21cea4)][_0x4d658c];}emit(util[_0xf957('0x11')](_0xf957('0x14'),_0x21cea4,_0x2591a4),util[_0xf957('0x11')](_0xf957('0x15'),_0x21cea4,_0x436877?'save':_0xf957('0x16')),_['pick'](_0x208f89,attributes));}var rpc={'openchannelQueueReport':require(_0xf957('0x17')),'mailQueueReport':require(_0xf957('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xf957('0x19'),'required':!![],'message':_0xf957('0x1a')},'timeout':{'type':'number','message':_0xf957('0x1b')}});function startRouting(_0x28b23e,_0x19542f,_0x202d31,_0xd4bb22){if(_0x28b23e&&_0x19542f&&_0x202d31){_0x19542f[_0xf957('0x1c')]+=0x1;var _0x587fce={'uniqueid':_0x28b23e,'from':_0x202d31['body']?_0x202d31['body'][_0xf957('0xd')]:'','joinAt':moment()['format'](_0xf957('0x1d')),'ContactId':_0x202d31[_0xf957('0x1e')]?_0x202d31[_0xf957('0x1e')]['id']:null,'ListId':_0x202d31['list']?_0x202d31['list']['id']:null};_0x587fce[_['upperFirst'](_0x202d31[_0xf957('0x1f')])+_0xf957('0x20')]=_0x19542f['id']||null;_0x587fce[_['upperFirst'](_0x202d31[_0xf957('0x1f')])+_0xf957('0x10')]=_0x202d31[_0xf957('0x21')]?_0x202d31[_0xf957('0x21')]['id']:null;_0x587fce[_[_0xf957('0x22')](_0x202d31[_0xf957('0x1f')])+_0xf957('0x23')]=_0x202d31['message']?_0x202d31[_0xf957('0x24')]['id']:null;_0x587fce[_['upperFirst'](_0x202d31[_0xf957('0x1f')])+(_0x202d31[_0xf957('0x1f')]!=='chat'?'AccountId':_0xf957('0x25'))]=_0x202d31['account']?_0x202d31[_0xf957('0xb')]['id']:null;logger[_0xf957('0x26')](util[_0xf957('0x11')](_0xf957('0x27'),_0x28b23e,_0x19542f[_0xf957('0x28')]));emitChannelQueueInteraction(_0x202d31[_0xf957('0x1f')],_0x19542f[_0xf957('0x28')],_0x587fce,_0x202d31['account'][_0xf957('0x28')],_0x202d31[_0xf957('0x24')]['id'],!![],_0xd4bb22,_0x19542f['id']);if(rpc[_0x202d31[_0xf957('0x1f')]+'QueueReport']){return rpc[_0x202d31[_0xf957('0x1f')]+'QueueReport'][_0xf957('0x29')](_0x587fce)[_0xf957('0x2a')](function(_0x43974){logger[_0xf957('0x2b')](_0xf957('0x2c'));});}}}function stopRouting(_0x1d0c37,_0x4cb5cf,_0x3e6778,_0x45c7fc){if(_0x1d0c37&&_0x4cb5cf){_0x4cb5cf[_0xf957('0x1c')]-=0x1;var _0x1c1b79={'leaveAt':moment()['format'](_0xf957('0x1d')),'acceptAt':moment()['format'](_0xf957('0x1d')),'reason':_0xf957('0x2d')};logger['info'](util[_0xf957('0x11')](_0xf957('0x2e'),_0x1d0c37,_0x4cb5cf[_0xf957('0x28')]));emitChannelQueueInteraction(_0x3e6778[_0xf957('0x1f')],_0x4cb5cf[_0xf957('0x28')],_0x3e6778[_0xf957('0x2f')],_0x3e6778[_0xf957('0xb')][_0xf957('0x28')],_0x3e6778[_0xf957('0x24')]['id'],![],_0x45c7fc,_0x4cb5cf['id']);if(rpc[_0x3e6778[_0xf957('0x1f')]+'QueueReport']){return rpc[_0x3e6778[_0xf957('0x1f')]+'QueueReport']['update'](_0x1d0c37,_0x1c1b79)['catch'](function(_0x4a70cf){logger[_0xf957('0x2b')](_0xf957('0x30'));});}}}function endRouting(_0x5bf542,_0x5a222f,_0x3be3b5,_0x471ff5){if(_0x5bf542&&_0x5a222f){_0x5a222f[_0xf957('0x1c')]-=0x1;var _0x19b112={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xf957('0x1d')),'reason':_0xf957('0x31')};logger[_0xf957('0x26')](util[_0xf957('0x11')](_0xf957('0x32'),_0x5bf542,_0x5a222f['name']));emitChannelQueueInteraction(_0x3be3b5[_0xf957('0x1f')],_0x5a222f[_0xf957('0x28')],_0x3be3b5['body'],_0x3be3b5[_0xf957('0xb')]['name'],_0x3be3b5[_0xf957('0x24')]['id'],![],_0x471ff5);if(rpc[_0x3be3b5['channel']+_0xf957('0x33')]){return rpc[_0x3be3b5[_0xf957('0x1f')]+'QueueReport'][_0xf957('0x34')](_0x5bf542,_0x19b112)[_0xf957('0x2a')](function(_0x3ed485){logger[_0xf957('0x2b')](_0xf957('0x30'));});}}}function handleFindQueue(_0x3265b6){return function(_0x109f41){return _0x109f41['name']['toLowerCase']()===_0x3265b6[_0xf957('0x35')]();};}exports[_0xf957('0x36')]=function(_0x1ba97f,_0x310438,_0x15887a,_0x55092f){return function(_0x27d565){try{var _0xcfd8a3={'name':_0x310438[0x0],'timeout':_0x310438[0x1]};var _0x4079c8=queue[_0xf957('0x37')](_0xcfd8a3,{'typecast':!![]});if(_0x4079c8[_0xf957('0x38')]){logger[_0xf957('0x2b')](_0xf957('0x39'),_0x1ba97f,_[_0xf957('0x3a')](_0x4079c8,_0xf957('0x24'))[_0xf957('0x3b')](',\x20'));_0x27d565[_0xf957('0x3c')]();}else{var _0x3d4e73=_[_0xf957('0x3d')](_0x15887a[_0x55092f[_0xf957('0x1f')]+'Queues'],handleFindQueue(_0xcfd8a3[_0xf957('0x28')]));if(_0x3d4e73){startRouting(_0x1ba97f,_0x3d4e73,_0x55092f,_0x15887a);var _0xf26bf8=(_0x3d4e73[_0xf957('0x31')]||0xa)*0x3e8;var _0x44629a=(_0xcfd8a3[_0xf957('0x31')]||0x14)*0x3e8;var _0x130318;if(_0xf26bf8>_0x44629a){_0x44629a=_0xf26bf8;}var _0x44474e=seqqueue[_0xf957('0x3e')](_0xf26bf8);_0x44474e['id']=_0x1ba97f;_0x44474e['atimeout']=_0xf26bf8;_0x44474e[_0xf957('0x3f')]=_0x44629a;_0x44474e[_0xf957('0x1f')]=_0x55092f[_0xf957('0x1f')];_0x15887a[_0xf957('0x40')][_0x1ba97f]['on'](_0xf957('0x41'),function(){logger[_0xf957('0x26')](_0xf957('0x42'),_0x1ba97f);stopRouting(_0x1ba97f,_0x3d4e73,_0x55092f,_0x15887a);clearTimeout(_0x130318);_0x130318=undefined;_0x44474e['close'](!![]);if(_0x15887a[_0xf957('0x40')][_0x1ba97f]){delete _0x15887a[_0xf957('0x40')][_0x1ba97f];}_0x27d565[_0xf957('0x3c')]();});_0x15887a['rules'][_0x1ba97f]['on']('complete',function(){if(_0x15887a[_0xf957('0x40')][_0x1ba97f]){delete _0x15887a[_0xf957('0x40')][_0x1ba97f];}});_0x130318=setTimeout(function(){logger[_0xf957('0x26')](_0xf957('0x43'),_0x1ba97f);endRouting(_0x1ba97f,_0x3d4e73,_0x55092f,_0x15887a);clearTimeout(_0x130318);_0x44474e[_0xf957('0x44')](!![]);_0x27d565[_0xf957('0x45')]();},_0x44629a);switch(_0x3d4e73['strategy']){case _0xf957('0x46'):strategy['rrmemory'](_0x44474e,_0x3d4e73,_0x15887a,_0x55092f);break;default:strategy['beepall'](_0x44474e,_0x3d4e73,_0x15887a,_0x55092f);}}else{logger[_0xf957('0x2b')](_0xf957('0x47'),_0x1ba97f,_0xcfd8a3[_0xf957('0x28')]);_0x27d565['stop']();}}}catch(_0x3f8bda){console[_0xf957('0x48')](_0x3f8bda);logger[_0xf957('0x2b')]('[%s][QUEUE]\x20%s',_0x1ba97f,_0x3f8bda[_0xf957('0x49')]);_0x27d565[_0xf957('0x3c')]();}};}; \ 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 5922f33..0325278 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 _0x4bc3=['hideNotification','STOP','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','bind','handleTimeout','timeout','drained','handleDrained','push','handleRun','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','busy','busyQueue','saveWaitingNotification','channel','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x11c5e6,_0x361aa8){var _0x341a85=function(_0x1cea7d){while(--_0x1cea7d){_0x11c5e6['push'](_0x11c5e6['shift']());}};_0x341a85(++_0x361aa8);}(_0x4bc3,0x16e));var _0x34bc=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x4bc3[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x34bc('0x0'));var uuid=require(_0x34bc('0x1'));var util=require('./util');var logger=require(_0x34bc('0x2'))(_0x34bc('0x3'));var Agent=function(_0x5b45c7,_0x178fc0,_0x616014,_0x3ce1c3){this[_0x34bc('0x4')]=uuid['v4']();this[_0x34bc('0x5')]=_0x5b45c7;this[_0x34bc('0x6')]=_0x178fc0;this[_0x34bc('0x7')]=_0x616014;this['routing']=_0x3ce1c3;this[_0x34bc('0x5')]['push'](this['handleRun'][_0x34bc('0x8')](this),this[_0x34bc('0x9')][_0x34bc('0x8')](this));this[_0x34bc('0x5')]['on'](_0x34bc('0xa'),this[_0x34bc('0x9')]['bind'](this));this['squeue']['on'](_0x34bc('0xb'),this[_0x34bc('0xc')][_0x34bc('0x8')](this));};Agent['prototype'][_0x34bc('0xd')]=function(){this['squeue'][_0x34bc('0xd')](this[_0x34bc('0xe')][_0x34bc('0x8')](this),this['handleTimeout'][_0x34bc('0x8')](this));};Agent['prototype'][_0x34bc('0xc')]=function(){this[_0x34bc('0x9')](!![]);};Agent[_0x34bc('0xf')]['handleRun']=function(){logger['debug'](_0x34bc('0x10'),this['squeue']['id'],this[_0x34bc('0x6')]['id']);if(_[_0x34bc('0x11')](this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']])){logger[_0x34bc('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}else{if(this[_0x34bc('0x3')][_0x34bc('0x14')]||util['isAgentAvailable'](this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')]['agents'][this[_0x34bc('0x6')]['id']],this[_0x34bc('0x5')]['channel'],![])){this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']][_0x34bc('0x15')]=!![];this[_0x34bc('0x7')][_0x34bc('0x12')][this['agent']['id']][_0x34bc('0x16')]=undefined;util[_0x34bc('0x17')](this[_0x34bc('0x7')],this['routing'],this['agent'],this[_0x34bc('0x5')][_0x34bc('0x18')]);util[_0x34bc('0x19')](this[_0x34bc('0x4')],this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],null,this[_0x34bc('0x3')]);util[_0x34bc('0x1a')](this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')]['agents'][this[_0x34bc('0x6')]['id']],'RINGING'+(this['routing'][_0x34bc('0x14')]?':FORCED':''));}else{logger[_0x34bc('0x13')](_0x34bc('0x1b'),this[_0x34bc('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}}};Agent[_0x34bc('0xf')][_0x34bc('0x9')]=function(_0x2bb874){if(_[_0x34bc('0x11')](this['realtime'][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']])){return logger[_0x34bc('0x13')](_0x34bc('0x1c'),this[_0x34bc('0x5')]['id'],this[_0x34bc('0x6')]['id']);}else{logger['debug'](_0x34bc('0x1d'),this['squeue']['id'],this['agent']['id']);util[_0x34bc('0x1e')](this['notificationId'],this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],null,this[_0x34bc('0x3')]);this[_0x34bc('0x7')][_0x34bc('0x12')][this['agent']['id']][_0x34bc('0x15')]=![];this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']][_0x34bc('0x16')]=undefined;util['removeWaitingNotification'](this[_0x34bc('0x7')],this[_0x34bc('0x3')],this[_0x34bc('0x6')],this[_0x34bc('0x5')][_0x34bc('0x18')]);util['writeLog'](this['squeue']['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],_0x2bb874?_0x34bc('0x1f'):'TIMEOUT');}if(!_0x2bb874){setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}};function agent(_0x32cf3b,_0x5b6acd,_0x37cd30,_0x42d1eb){return new Agent(_0x32cf3b,_0x5b6acd,_0x37cd30,_0x42d1eb);}module[_0x34bc('0x20')]=agent; \ No newline at end of file +var _0x5178=['isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','saveWaitingNotification','channel','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','agent','squeue','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x5178,0x171));var _0x8517=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x5178[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var uuid=require(_0x8517('0x0'));var util=require(_0x8517('0x1'));var logger=require(_0x8517('0x2'))(_0x8517('0x3'));var Agent=function(_0x38d5b3,_0x5e0a44,_0x483381,_0x3ed6a5){this[_0x8517('0x4')]=uuid['v4']();this['squeue']=_0x38d5b3;this[_0x8517('0x5')]=_0x5e0a44;this['realtime']=_0x483381;this[_0x8517('0x3')]=_0x3ed6a5;this[_0x8517('0x6')][_0x8517('0x7')](this[_0x8517('0x8')][_0x8517('0x9')](this),this['handleTimeout'][_0x8517('0x9')](this));this['squeue']['on']('timeout',this[_0x8517('0xa')][_0x8517('0x9')](this));this['squeue']['on'](_0x8517('0xb'),this[_0x8517('0xc')][_0x8517('0x9')](this));};Agent[_0x8517('0xd')][_0x8517('0x7')]=function(){this[_0x8517('0x6')][_0x8517('0x7')](this[_0x8517('0x8')]['bind'](this),this[_0x8517('0xa')][_0x8517('0x9')](this));};Agent[_0x8517('0xd')][_0x8517('0xc')]=function(){this[_0x8517('0xa')](!![]);};Agent['prototype'][_0x8517('0x8')]=function(){logger[_0x8517('0xe')](_0x8517('0xf'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);if(_[_0x8517('0x10')](this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']])){logger[_0x8517('0xe')](_0x8517('0x13'),this[_0x8517('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x8517('0x7')][_0x8517('0x9')](this),0x3e8);}else{if(this[_0x8517('0x3')][_0x8517('0x14')]||util[_0x8517('0x15')](this[_0x8517('0x6')]['id'],this[_0x8517('0x11')]['agents'][this[_0x8517('0x5')]['id']],this['squeue']['channel'],![])){this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']][_0x8517('0x16')]=!![];this[_0x8517('0x11')][_0x8517('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x8517('0x17')](this[_0x8517('0x11')],this[_0x8517('0x3')],this[_0x8517('0x5')],this[_0x8517('0x6')][_0x8517('0x18')]);util['showNotification'](this[_0x8517('0x4')],this[_0x8517('0x6')]['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],null,this[_0x8517('0x3')]);util['writeLog'](this[_0x8517('0x6')]['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],_0x8517('0x19')+(this[_0x8517('0x3')][_0x8517('0x14')]?_0x8517('0x1a'):''));}else{logger['debug'](_0x8517('0x1b'),this['squeue']['id'],this[_0x8517('0x5')]['id']);setTimeout(this[_0x8517('0x7')][_0x8517('0x9')](this),0x3e8);}}};Agent[_0x8517('0xd')][_0x8517('0xa')]=function(_0x1b2423){if(_['isNil'](this[_0x8517('0x11')]['agents'][this[_0x8517('0x5')]['id']])){return logger[_0x8517('0xe')](_0x8517('0x13'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);}else{logger[_0x8517('0xe')](_0x8517('0x1c'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);util['hideNotification'](this[_0x8517('0x4')],this[_0x8517('0x6')]['id'],this[_0x8517('0x11')]['agents'][this['agent']['id']],null,this['routing']);this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']][_0x8517('0x16')]=![];this[_0x8517('0x11')][_0x8517('0x12')][this['agent']['id']][_0x8517('0x1d')]=undefined;util[_0x8517('0x1e')](this[_0x8517('0x11')],this['routing'],this[_0x8517('0x5')],this['squeue'][_0x8517('0x18')]);util[_0x8517('0x1f')](this['squeue']['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],_0x1b2423?_0x8517('0x20'):_0x8517('0x21'));}if(!_0x1b2423){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x2cb889,_0x11a1b3,_0x1835ac,_0x516fb1){return new Agent(_0x2cb889,_0x11a1b3,_0x1835ac,_0x516fb1);}module[_0x8517('0x22')]=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 5e362b9..a54fb56 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 _0x9c97=['isNil','queue','Agents','length','agents','debug','RINGING','busy','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','STOP','busyQueue','removeWaitingNotification','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','handleRun','bind','handleTimeout','prototype','push'];(function(_0x3b0371,_0x1e643d){var _0x48dfa2=function(_0x5dfbaa){while(--_0x5dfbaa){_0x3b0371['push'](_0x3b0371['shift']());}};_0x48dfa2(++_0x1e643d);}(_0x9c97,0x8a));var _0x79c9=function(_0x5722ce,_0x3c06f4){_0x5722ce=_0x5722ce-0x0;var _0x12a111=_0x9c97[_0x5722ce];return _0x12a111;};'use strict';var _=require(_0x79c9('0x0'));var uuid=require('uuid');var util=require(_0x79c9('0x1'));var logger=require(_0x79c9('0x2'))(_0x79c9('0x3'));var Beepall=function(_0x2308e6,_0x3dde2b,_0x1044fe,_0x2639de){this[_0x79c9('0x4')]=uuid['v4']();this[_0x79c9('0x5')]=_0x2308e6;this['queue']=_0x3dde2b;this[_0x79c9('0x6')]=_0x1044fe;this[_0x79c9('0x3')]=_0x2639de;this[_0x79c9('0x5')]['push'](this[_0x79c9('0x7')][_0x79c9('0x8')](this),this[_0x79c9('0x9')][_0x79c9('0x8')](this));this[_0x79c9('0x5')]['on']('timeout',this[_0x79c9('0x9')][_0x79c9('0x8')](this));this[_0x79c9('0x5')]['on']('drained',this['handleDrained'][_0x79c9('0x8')](this));};Beepall[_0x79c9('0xa')][_0x79c9('0xb')]=function(){this['squeue'][_0x79c9('0xb')](this['handleRun'][_0x79c9('0x8')](this),this[_0x79c9('0x9')][_0x79c9('0x8')](this));};Beepall['prototype']['handleDrained']=function(){this[_0x79c9('0x9')](!![]);};Beepall[_0x79c9('0xa')][_0x79c9('0x7')]=function(){var _0x47c5d3=!![];if(!_[_0x79c9('0xc')](this[_0x79c9('0xd')])&&!_[_0x79c9('0xc')](this[_0x79c9('0xd')][_0x79c9('0xe')])&&this[_0x79c9('0xd')][_0x79c9('0xe')][_0x79c9('0xf')]>0x0){for(var _0x19447b=0x0,_0x1ca78a;_0x19447b0x0){for(var _0x3b9f15=0x0,_0x1ab969;_0x3b9f150x0&&_0x3e4638[_0x16ce1f+_0x8339('0x25')]>=_0x3e4638[_0x16ce1f+_0x8339('0x23')]){writeLog(_0x3cf77e,_0x3e4638,_0x16ce1f[_0x8339('0x26')]()+_0x8339('0x27'));return![];}}return!![];};exports[_0x8339('0x28')]=function(_0x5f0c10,_0x2cc03d,_0x426153,_0x53a47a,_0xf75b3){return sendNotification(!![],_0x5f0c10,_0x2cc03d,_0x426153,_0x53a47a,_0xf75b3);};exports[_0x8339('0x29')]=function(_0x101911,_0x346767,_0x4429f7,_0x2752b9,_0x5281ab){return sendNotification(![],_0x101911,_0x346767,_0x4429f7,_0x2752b9,_0x5281ab);};exports[_0x8339('0x2a')]=function(_0x55f5c7,_0x4e4c0d,_0x2d7f42){var _0x64e66e=_0x4e4c0d['interaction'][_0x8339('0x2b')];if(!_0x64e66e&&_0x2d7f42){_0x64e66e=_0x2d7f42['id'];}var _0xf06b12=_[_0x8339('0x2c')](_0x55f5c7[_0x4e4c0d[_0x8339('0x2d')]+_0x8339('0x2e')],function(_0x1712d3){var _0x3dd3f9=_['capitalize'](_0x4e4c0d[_0x8339('0x2d')])+'InteractionId';return _0x1712d3[_0x3dd3f9]===_0x4e4c0d['interaction']['id'];});if(!_0xf06b12&&_0x64e66e){_0xf06b12=_[_0x8339('0x2c')](_0x55f5c7[_0x8339('0x2f')][_0x64e66e][_0x4e4c0d['channel']+_0x8339('0x30')],function(_0x4a0113){return _0x4a0113['id']===_0x4e4c0d[_0x8339('0x31')]['id'];});}return _0xf06b12;};exports[_0x8339('0x32')]=function(_0x2498d1,_0x22f88b,_0x2325d4,_0x8fe05){_0x2498d1[_0x8339('0x2f')][_0x2325d4['id']][_0x8fe05+_0x8339('0x30')][_0x22f88b[_0x8339('0x1a')]['id']]={'id':_0x22f88b[_0x8339('0x31')]['id']};};exports[_0x8339('0x33')]=function(_0x160bc5,_0x133ea3,_0x1ae488,_0x41cbf5){delete _0x160bc5[_0x8339('0x2f')][_0x1ae488['id']][_0x41cbf5+_0x8339('0x30')][_0x133ea3[_0x8339('0x1a')]['id']];};exports[_0x8339('0x34')]=writeLog; \ No newline at end of file +var _0xdce6=['interaction','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','redis','socket.io-emitter','user:%s','name','emit','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','format','[%s][QUEUE]\x20%s','notification:%s','save','remove','debug','isAgentAvailable','busy','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','checkWaitingNotifications','UserId','some','QueuesWaitingInteractions','capitalize','channel'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0xdce6,0x68));var _0x6dce=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdce6[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x6dce('0x0'));var util=require('util');var utils=require(_0x6dce('0x1'));var Redis=require(_0x6dce('0x2'));var config=require(_0x6dce('0x3'));var logger=require('../../../../../config/logger')('routing');config[_0x6dce('0x4')]=_['defaults'](config[_0x6dce('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x6dce('0x5'))(new Redis(config['redis']));function sendNotification(_0x5d7cf9,_0x784bee,_0x223c0d,_0x566b2d,_0x327afa,_0x56514c){io['to'](util['format'](_0x6dce('0x6'),_0x566b2d[_0x6dce('0x7')]))[_0x6dce('0x8')]('user:save',_0x566b2d);var _0x3be136=_0x56514c||{};var _0x13b5fe=_0x223c0d[_0x6dce('0x9')]('.');var _0x10a9c0={'uniqueid':_0x784bee,'channel':_0x13b5fe[0x0],'id':_0x13b5fe[0x1],'title':_0x13b5fe[0x0]+_0x6dce('0xa'),'interactionId':_0x13b5fe[0x2],'queue':_0x327afa?_0x327afa['name']:null,'sound':_0x3be136[_0x6dce('0xb')][_0x6dce('0xc')],'shake':_0x3be136['account'][_0x6dce('0xd')]};try{if(!_0x3be136[_0x6dce('0xe')]){_0x3be136[_0x6dce('0xe')]={};}if(_0x327afa){_0x3be136[_0x6dce('0xe')]['queue']=_0x327afa;}else if(_0x3be136['body'][_0x6dce('0xf')]){delete _0x3be136[_0x6dce('0xe')][_0x6dce('0xf')];}_0x10a9c0['msg']=utils[_0x6dce('0x10')](_0x3be136[_0x6dce('0xb')][_0x6dce('0x11')],_0x3be136);}catch(_0x16f73a){_0x10a9c0['msg']=_0x6dce('0x12');logger['error'](util[_0x6dce('0x13')](_0x6dce('0x14'),_0x784bee,_0x16f73a['message']));}io['to'](util['format'](_0x6dce('0x6'),_0x566b2d['name']))[_0x6dce('0x8')](util[_0x6dce('0x13')](_0x6dce('0x15'),_0x5d7cf9?_0x6dce('0x16'):_0x6dce('0x17')),_0x10a9c0);}function writeLog(_0x175bc2,_0x52a08b,_0x42cf8b){return logger[_0x6dce('0x18')](util[_0x6dce('0x13')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x175bc2,_0x52a08b[_0x6dce('0x7')],_0x42cf8b));}exports[_0x6dce('0x19')]=function(_0x27021b,_0x1b087c,_0x3d79ff,_0x56279c){if(_0x1b087c[_0x6dce('0x1a')]){writeLog(_0x27021b,_0x1b087c,'BUSY');return![];}if(!_0x1b087c[_0x6dce('0x1b')]){writeLog(_0x27021b,_0x1b087c,_0x6dce('0x1c'));return![];}if(_0x1b087c[_0x3d79ff+_0x6dce('0x1d')]){writeLog(_0x27021b,_0x1b087c,_0x6dce('0x1e'));return![];}if(_0x56279c&&_0x1b087c[_0x6dce('0x1f')](_0x3d79ff+_0x6dce('0x20'))&&_0x1b087c[_0x6dce('0x1f')](_0x3d79ff+_0x6dce('0x21'))){if(_0x1b087c[_0x3d79ff+'Capacity']>0x0&&_0x1b087c[_0x3d79ff+_0x6dce('0x21')]>=_0x1b087c[_0x3d79ff+_0x6dce('0x20')]){writeLog(_0x27021b,_0x1b087c,_0x3d79ff[_0x6dce('0x22')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x6dce('0x23')]=function(_0x129ac2,_0x9a3087,_0x48139c,_0x18de9b,_0xba4869){return sendNotification(!![],_0x129ac2,_0x9a3087,_0x48139c,_0x18de9b,_0xba4869);};exports[_0x6dce('0x24')]=function(_0x1bf5c0,_0x5806c4,_0x4bbf16,_0x10da9d,_0x2726db){return sendNotification(![],_0x1bf5c0,_0x5806c4,_0x4bbf16,_0x10da9d,_0x2726db);};exports[_0x6dce('0x25')]=function(_0x44172e,_0x4246da,_0x1ab235){var _0x546607=_0x4246da['interaction'][_0x6dce('0x26')];if(!_0x546607&&_0x1ab235){_0x546607=_0x1ab235['id'];}var _0x44a716=_[_0x6dce('0x27')](_0x44172e[_0x4246da['channel']+_0x6dce('0x28')],function(_0x38d9d2){var _0x4c1452=_[_0x6dce('0x29')](_0x4246da[_0x6dce('0x2a')])+'InteractionId';return _0x38d9d2[_0x4c1452]===_0x4246da[_0x6dce('0x2b')]['id'];});if(!_0x44a716&&_0x546607){_0x44a716=_['some'](_0x44172e[_0x6dce('0x2c')][_0x546607][_0x4246da[_0x6dce('0x2a')]+_0x6dce('0x2d')],function(_0x3216ca){return _0x3216ca['id']===_0x4246da['interaction']['id'];});}return _0x44a716;};exports[_0x6dce('0x2e')]=function(_0x51a55f,_0x4d6d12,_0x2196db,_0x2b6c89){_0x51a55f[_0x6dce('0x2c')][_0x2196db['id']][_0x2b6c89+'WaitingInteractions'][_0x4d6d12['message']['id']]={'id':_0x4d6d12[_0x6dce('0x2b')]['id']};};exports[_0x6dce('0x2f')]=function(_0x3cec57,_0x8fb495,_0x1d27bc,_0x36046c){delete _0x3cec57[_0x6dce('0x2c')][_0x1d27bc['id']][_0x36046c+_0x6dce('0x2d')][_0x8fb495['message']['id']];};exports[_0x6dce('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 8bc6ca8..cc336d7 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 _0x7793=['error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','body','isObject','stringify','shelljs','lodash','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate'];(function(_0x866a2a,_0xf17725){var _0x49fac5=function(_0x14f56a){while(--_0x14f56a){_0x866a2a['push'](_0x866a2a['shift']());}};_0x49fac5(++_0xf17725);}(_0x7793,0x120));var _0x3779=function(_0x555ca3,_0x32d463){_0x555ca3=_0x555ca3-0x0;var _0x544c23=_0x7793[_0x555ca3];return _0x544c23;};'use strict';var schema=require('validate');var sh=require(_0x3779('0x0'));var _=require(_0x3779('0x1'));var utils=require('./utils');var logger=require(_0x3779('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x3779('0x3')}});exports[_0x3779('0x4')]=function(_0x498410,_0x3ee452){return function(_0x4744b4){try{var _0x59dfb7={'command':_0x3ee452[0x0]};var _0x25b30d=system[_0x3779('0x5')](_0x59dfb7,{'typecast':!![]});if(_0x25b30d['length']){logger[_0x3779('0x6')](_0x3779('0x7'),_0x498410,_['map'](_0x25b30d,_0x3779('0x8'))[_0x3779('0x9')](',\x20'));logger[_0x3779('0xa')](_0x3779('0xb'),_0x498410);_0x4744b4[_0x3779('0xc')]();}else{var _0x308869=this;var _0x38cbf7=utils['getMustacheRender'](_0x3ee452[0x0],this);logger[_0x3779('0xa')](_0x3779('0xd'),_0x498410,_0x38cbf7);sh[_0x3779('0xe')](_[_0x3779('0xf')](_0x38cbf7),function(_0x5eb989,_0x240acf){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x498410,_0x5eb989);if(_0x5eb989==0x0){var _0x1b8384=_0x240acf[_0x3779('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x3779('0x11')](_0x3ee452[0x1])||_['isEmpty'](_0x3ee452[0x1])){logger[_0x3779('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x498410);_0x308869['body'][_0x3ee452[0x1]]=_0x1b8384;}else{logger[_0x3779('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x498410,_0x3ee452[0x1],_0x1b8384);_0x308869[_0x3779('0x12')][_0x3ee452[0x1]]=_0x1b8384;}}_0x4744b4[_0x3779('0xc')]();});}}catch(_0x1e4ed6){logger[_0x3779('0x6')](_0x3779('0x7'),_0x498410,_[_0x3779('0x13')](_0x1e4ed6)?JSON[_0x3779('0x14')](_0x1e4ed6):_0x1e4ed6);logger[_0x3779('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x498410);_0x4744b4[_0x3779('0xc')]();}};}; \ No newline at end of file +var _0x395a=['error','[%s][SYSTEM]\x20%s','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','next','stringify','validate','shelljs','lodash','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x1fdb8e,_0x2add5a){var _0xc6cf45=function(_0x2dc639){while(--_0x2dc639){_0x1fdb8e['push'](_0x1fdb8e['shift']());}};_0xc6cf45(++_0x2add5a);}(_0x395a,0x159));var _0xa395=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x395a[_0x79cd47];return _0x3b9484;};'use strict';var schema=require(_0xa395('0x0'));var sh=require(_0xa395('0x1'));var _=require(_0xa395('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0xa395('0x3'),'required':!![],'message':_0xa395('0x4')}});exports[_0xa395('0x5')]=function(_0x4e7666,_0x33d649){return function(_0x154073){try{var _0x28f745={'command':_0x33d649[0x0]};var _0x4e38ad=system['validate'](_0x28f745,{'typecast':!![]});if(_0x4e38ad[_0xa395('0x6')]){logger[_0xa395('0x7')](_0xa395('0x8'),_0x4e7666,_['map'](_0x4e38ad,_0xa395('0x9'))['join'](',\x20'));logger[_0xa395('0xa')](_0xa395('0xb'),_0x4e7666);_0x154073['next']();}else{var _0x1d0f8f=this;var _0x29c074=utils[_0xa395('0xc')](_0x33d649[0x0],this);logger[_0xa395('0xa')](_0xa395('0xd'),_0x4e7666,_0x29c074);sh[_0xa395('0xe')](_[_0xa395('0xf')](_0x29c074),function(_0x3deb08,_0x283756){logger[_0xa395('0xa')](_0xa395('0x10'),_0x4e7666,_0x3deb08);if(_0x3deb08==0x0){var _0x25c6a4=_0x283756[_0xa395('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x33d649[0x1])||_['isEmpty'](_0x33d649[0x1])){logger[_0xa395('0xa')](_0xa395('0x12'),_0x4e7666);_0x1d0f8f[_0xa395('0x13')][_0x33d649[0x1]]=_0x25c6a4;}else{logger[_0xa395('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x4e7666,_0x33d649[0x1],_0x25c6a4);_0x1d0f8f[_0xa395('0x13')][_0x33d649[0x1]]=_0x25c6a4;}}_0x154073[_0xa395('0x14')]();});}}catch(_0xab9af7){logger['error']('[%s][SYSTEM]\x20%s',_0x4e7666,_['isObject'](_0xab9af7)?JSON[_0xa395('0x15')](_0xab9af7):_0xab9af7);logger[_0xa395('0xa')](_0xa395('0xb'),_0x4e7666);_0x154073[_0xa395('0x14')]();}};}; \ 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 1f81754..93e8a04 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 _0xa999=['stringify','finally','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','join','info','Interaction','channel','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error'];(function(_0x446874,_0x3a9c22){var _0x41fa06=function(_0x39c48e){while(--_0x39c48e){_0x446874['push'](_0x446874['shift']());}};_0x41fa06(++_0x3a9c22);}(_0xa999,0xb3));var _0x9a99=function(_0x588cb1,_0x2940f4){_0x588cb1=_0x588cb1-0x0;var _0x11dca9=_0xa999[_0x588cb1];return _0x11dca9;};'use strict';var schema=require(_0x9a99('0x0'));var _=require(_0x9a99('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x9a99('0x2')),'smsInteraction':require(_0x9a99('0x3')),'mailInteraction':require(_0x9a99('0x4')),'faxInteraction':require(_0x9a99('0x5')),'whatsappInteraction':require(_0x9a99('0x6'))};var logger=require('../../../../config/logger')(_0x9a99('0x7'));var tag=schema({'tag':{'type':_0x9a99('0x8'),'required':!![],'message':_0x9a99('0x9')}});exports[_0x9a99('0xa')]=function(_0x1fdb04,_0x6aa474,_0x27aa90,_0x5a1479){return function(_0x5b635b){try{var _0x2b8809={'tag':_0x6aa474[0x0]};var _0x3870ec=tag[_0x9a99('0x0')](_0x2b8809,{'typecast':!![]});if(_0x3870ec[_0x9a99('0xb')]){logger['error'](_0x9a99('0xc'),_0x1fdb04,_[_0x9a99('0xd')](_0x3870ec,_0x9a99('0xe'))[_0x9a99('0xf')](',\x20'));logger[_0x9a99('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1fdb04);_0x5b635b['next']();}else{var _0x57e4ef={'ids':[_0x6aa474[0x0]]};if(rpc[_0x5a1479['channel']+_0x9a99('0x11')]){rpc[_0x5a1479[_0x9a99('0x12')]+_0x9a99('0x11')][_0x9a99('0x13')](_0x5a1479[_0x9a99('0x14')]['id'],_0x57e4ef)['then'](function(_0xa7a3a4){logger[_0x9a99('0x10')](_0x9a99('0x15'),_0x1fdb04,_0x6aa474[0x1],_0x5a1479[_0x9a99('0x12')],_0x5a1479['interaction']['id']);})[_0x9a99('0x16')](function(_0x1fc2ea){logger[_0x9a99('0x17')](_0x9a99('0xc'),_0x1fdb04,JSON[_0x9a99('0x18')](_0x1fc2ea));logger[_0x9a99('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1fdb04);})[_0x9a99('0x19')](function(){_0x5b635b['next']();});}}}catch(_0x4d80f8){logger[_0x9a99('0x17')](_0x9a99('0xc'),_0x1fdb04,_[_0x9a99('0x1a')](_0x4d80f8)?JSON[_0x9a99('0x18')](_0x4d80f8):_0x4d80f8);logger['info'](_0x9a99('0x1b'),_0x1fdb04);_0x5b635b[_0x9a99('0x1c')]();}};}; \ No newline at end of file +var _0xbbca=['interaction','catch','[%s][TAG]\x20%s','stringify','finally','error','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','consequence','validate','length','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x4c56b6,_0x239082){var _0x1ee73a=function(_0x43687e){while(--_0x43687e){_0x4c56b6['push'](_0x4c56b6['shift']());}};_0x1ee73a(++_0x239082);}(_0xbbca,0x19e));var _0xabbc=function(_0x256091,_0x4f06dd){_0x256091=_0x256091-0x0;var _0x404d65=_0xbbca[_0x256091];return _0x404d65;};'use strict';var schema=require('validate');var _=require(_0xabbc('0x0'));var rpc={'chatInteraction':require(_0xabbc('0x1')),'openchannelInteraction':require(_0xabbc('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xabbc('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xabbc('0x4'))};var logger=require(_0xabbc('0x5'))('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xabbc('0x6')]=function(_0x2ae3e5,_0x2c826e,_0x569012,_0x4fce73){return function(_0x36263a){try{var _0x24abd3={'tag':_0x2c826e[0x0]};var _0x33d21d=tag[_0xabbc('0x7')](_0x24abd3,{'typecast':!![]});if(_0x33d21d[_0xabbc('0x8')]){logger['error']('[%s][TAG]\x20%s',_0x2ae3e5,_['map'](_0x33d21d,_0xabbc('0x9'))['join'](',\x20'));logger[_0xabbc('0xa')](_0xabbc('0xb'),_0x2ae3e5);_0x36263a[_0xabbc('0xc')]();}else{var _0x30e03c={'ids':[_0x2c826e[0x0]]};if(rpc[_0x4fce73[_0xabbc('0xd')]+_0xabbc('0xe')]){rpc[_0x4fce73[_0xabbc('0xd')]+_0xabbc('0xe')][_0xabbc('0xf')](_0x4fce73['interaction']['id'],_0x30e03c)[_0xabbc('0x10')](function(_0x3ac20c){logger[_0xabbc('0xa')](_0xabbc('0x11'),_0x2ae3e5,_0x2c826e[0x1],_0x4fce73['channel'],_0x4fce73[_0xabbc('0x12')]['id']);})[_0xabbc('0x13')](function(_0x5de144){logger['error'](_0xabbc('0x14'),_0x2ae3e5,JSON[_0xabbc('0x15')](_0x5de144));logger[_0xabbc('0xa')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2ae3e5);})[_0xabbc('0x16')](function(){_0x36263a[_0xabbc('0xc')]();});}}}catch(_0x219ce1){logger[_0xabbc('0x17')](_0xabbc('0x14'),_0x2ae3e5,_['isObject'](_0x219ce1)?JSON[_0xabbc('0x15')](_0x219ce1):_0x219ce1);logger[_0xabbc('0xa')](_0xabbc('0xb'),_0x2ae3e5);_0x36263a['next']();}};}; \ 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 3c884e6..ab2030a 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 _0xce19=['title','jsonrpc','2.0','login','stringify','utf8','POST','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnRing'];(function(_0xda8259,_0xe4f8ca){var _0x12d224=function(_0x27a10c){while(--_0x27a10c){_0xda8259['push'](_0xda8259['shift']());}};_0x12d224(++_0xe4f8ca);}(_0xce19,0xd6));var _0x9ce1=function(_0x37edaf,_0x399cda){_0x37edaf=_0x37edaf-0x0;var _0x21c4ae=_0xce19[_0x37edaf];return _0x21c4ae;};'use strict';var rp=require(_0x9ce1('0x0'));var logger=require(_0x9ce1('0x1'))(_0x9ce1('0x2'));var _=require(_0x9ce1('0x3'));var arr=[];exports[_0x9ce1('0x4')]=function(_0x5508d5,_0x564c42){return function(_0x2f3aeb){var _0xd9df88=_0x564c42[0xa];var _0x1ebe37=_0x564c42[0xb];var _0x3f654a=_0x564c42[0xc];var _0x1f1067=_0x564c42[0xd];var _0x84a5ec=_0x564c42[0xe];var _0x54ed7d=_0x564c42[0xf][_0x9ce1('0x5')](/\n/g,_0x9ce1('0x6'));var _0x1a9d20=_0x564c42[0x10][_0x9ce1('0x5')](/\n/g,'\x20');if(!arr[_0x9ce1('0x7')](_0x1ebe37)){arr[_0x9ce1('0x8')](_0x1ebe37);var _0x2e9583=_0x564c42[0x3];var _0x391100=_0x564c42[0x4];var _0x28ba55=_0x564c42[0x1];var _0x5383b3=_0x564c42[0x0];var _0xcf7933={};_0xcf7933['urlOnAnswer']=_0x564c42[0x8]+'?params='+_0x3f654a+'|'+_0xd9df88+'|'+_0x1f1067+'|'+_0x1ebe37+'|'+_0x84a5ec;_0xcf7933[_0x9ce1('0x9')]=_0x564c42[0x7]+'?params='+_0x3f654a+'|'+_0xd9df88+'|'+_0x1f1067+'|'+_0x1ebe37+'|'+_0x84a5ec+'|'+_0x54ed7d+'|'+_0x1a9d20;_0xcf7933[_0x9ce1('0xa')]=_0x564c42[0x9];var _0x3943d4={};_0x3943d4[_0x9ce1('0xb')]=_0x9ce1('0xc');_0x3943d4['method']=_0x9ce1('0xd');var _0x264f58=[];_0x264f58[_0x9ce1('0x8')](_0x564c42[0x2]);_0x264f58['push'](_0x564c42[0x5]);_0x264f58[_0x9ce1('0x8')](_0x564c42[0x6]);_0x3943d4['params']=_0x264f58;_0x3943d4['id']=0x1;var _0x523fcd=JSON[_0x9ce1('0xe')](_0x3943d4);var _0xecbcce={'encoding':_0x9ce1('0xf'),'method':_0x9ce1('0x10'),'timeout':0x2710,'url':_0x2e9583,'headers':{'Content-Type':'application/json-rpc'},'body':_0x523fcd};return rp(_0xecbcce)['then'](function(_0x1c70df){const _0x39d9ec=JSON['parse'](_0x1c70df);if(!_0x39d9ec['result']['logged']){throw new Error(_0x9ce1('0x11'));}var _0x12538=_0x1ebe37;var _0xd0858b=_0x9ce1('0x12')+_0x28ba55+'&serviceId='+_0x5383b3+_0x9ce1('0x13')+_0x12538+'&data='+JSON[_0x9ce1('0xe')](_0xcf7933);var _0x4c6d9e=_0x391100+'?'+_0xd0858b;return rp(_0x4c6d9e);})[_0x9ce1('0x14')](function(_0x36f45f){logger[_0x9ce1('0x15')](_0x9ce1('0x16'),_0x5508d5,_0x36f45f);_0x2f3aeb['stop']();})['catch'](function(_0x24345f){logger[_0x9ce1('0x17')]('[%s][TVOX]\x20%s',_0x5508d5,_[_0x9ce1('0x18')](_0x24345f)?JSON[_0x9ce1('0xe')](_0x24345f):_0x24345f);_0x2f3aeb[_0x9ce1('0x19')]();});}else{logger[_0x9ce1('0x15')](_0x9ce1('0x1a'),_0x5508d5);_0x2f3aeb[_0x9ce1('0x1b')]();}};}; \ No newline at end of file +var _0xd300=['includes','push','?params=','title','jsonrpc','2.0','login','stringify','utf8','application/json-rpc','then','parse','result','logged','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','next','request-promise','../../../../config/logger','lodash','consequence','replace'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xd300,0x1c6));var _0x0d30=function(_0x128715,_0xbad57e){_0x128715=_0x128715-0x0;var _0x5be107=_0xd300[_0x128715];return _0x5be107;};'use strict';var rp=require(_0x0d30('0x0'));var logger=require(_0x0d30('0x1'))('routing');var _=require(_0x0d30('0x2'));var arr=[];exports[_0x0d30('0x3')]=function(_0xb3da08,_0x28a451){return function(_0x1dccca){var _0x5b2b57=_0x28a451[0xa];var _0x2516e5=_0x28a451[0xb];var _0x1d9c85=_0x28a451[0xc];var _0x2201cf=_0x28a451[0xd];var _0x4ec063=_0x28a451[0xe];var _0x3a5890=_0x28a451[0xf][_0x0d30('0x4')](/\n/g,'\x20-\x20');var _0x198b81=_0x28a451[0x10][_0x0d30('0x4')](/\n/g,'\x20');if(!arr[_0x0d30('0x5')](_0x2516e5)){arr[_0x0d30('0x6')](_0x2516e5);var _0x221ed5=_0x28a451[0x3];var _0x2ecc2b=_0x28a451[0x4];var _0x1fbf28=_0x28a451[0x1];var _0x1f8e1c=_0x28a451[0x0];var _0x4b64b1={};_0x4b64b1['urlOnAnswer']=_0x28a451[0x8]+'?params='+_0x1d9c85+'|'+_0x5b2b57+'|'+_0x2201cf+'|'+_0x2516e5+'|'+_0x4ec063;_0x4b64b1['urlOnRing']=_0x28a451[0x7]+_0x0d30('0x7')+_0x1d9c85+'|'+_0x5b2b57+'|'+_0x2201cf+'|'+_0x2516e5+'|'+_0x4ec063+'|'+_0x3a5890+'|'+_0x198b81;_0x4b64b1[_0x0d30('0x8')]=_0x28a451[0x9];var _0x2dccc8={};_0x2dccc8[_0x0d30('0x9')]=_0x0d30('0xa');_0x2dccc8['method']=_0x0d30('0xb');var _0x75012b=[];_0x75012b[_0x0d30('0x6')](_0x28a451[0x2]);_0x75012b[_0x0d30('0x6')](_0x28a451[0x5]);_0x75012b[_0x0d30('0x6')](_0x28a451[0x6]);_0x2dccc8['params']=_0x75012b;_0x2dccc8['id']=0x1;var _0xdf7d83=JSON[_0x0d30('0xc')](_0x2dccc8);var _0x104458={'encoding':_0x0d30('0xd'),'method':'POST','timeout':0x2710,'url':_0x221ed5,'headers':{'Content-Type':_0x0d30('0xe')},'body':_0xdf7d83};return rp(_0x104458)[_0x0d30('0xf')](function(_0x4882f7){const _0x228381=JSON[_0x0d30('0x10')](_0x4882f7);if(!_0x228381[_0x0d30('0x11')][_0x0d30('0x12')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x476f3e=_0x2516e5;var _0x2c0eb5='channelId='+_0x1fbf28+'&serviceId='+_0x1f8e1c+_0x0d30('0x13')+_0x476f3e+_0x0d30('0x14')+JSON['stringify'](_0x4b64b1);var _0x14aa65=_0x2ecc2b+'?'+_0x2c0eb5;return rp(_0x14aa65);})[_0x0d30('0xf')](function(_0x532c88){logger['info'](_0x0d30('0x15'),_0xb3da08,_0x532c88);_0x1dccca[_0x0d30('0x16')]();})[_0x0d30('0x17')](function(_0x4f55e8){logger[_0x0d30('0x18')]('[%s][TVOX]\x20%s',_0xb3da08,_[_0x0d30('0x19')](_0x4f55e8)?JSON[_0x0d30('0xc')](_0x4f55e8):_0x4f55e8);_0x1dccca[_0x0d30('0x16')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0xb3da08);_0x1dccca[_0x0d30('0x1a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 41fa406..56ce38c 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 _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x4e2ecb,_0x57ee22){var _0x1cada8=function(_0x1f7dd1){while(--_0x1f7dd1){_0x4e2ecb['push'](_0x4e2ecb['shift']());}};_0x1cada8(++_0x57ee22);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x333194,_0x48d930){var _0x369f5f=function(_0x1dccfb){while(--_0x1dccfb){_0x333194['push'](_0x333194['shift']());}};_0x369f5f(++_0x48d930);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 7575110..68036f5 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 _0x08cf=['length','join','app','autoreply','appdata','split','mail','push','slice','dialogflow','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agents','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','applications','isArray'];(function(_0x200af4,_0x8416e8){var _0x3831b6=function(_0xf139c0){while(--_0xf139c0){_0x200af4['push'](_0x200af4['shift']());}};_0x3831b6(++_0x8416e8);}(_0x08cf,0xb5));var _0xf08c=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0x08cf[_0x470f63];return _0x4f09e2;};'use strict';var _=require(_0xf08c('0x0'));var util=require(_0xf08c('0x1'));var path=require(_0xf08c('0x2'));var fs=require('fs');var jayson=require(_0xf08c('0x3'));var BPromise=require(_0xf08c('0x4'));var utils=require(_0xf08c('0x5'));var sUtils=require('./applications/strategy/util');var logger=require(_0xf08c('0x6'))(_0xf08c('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xf08c('0x8')),'smsQueueReport':require(_0xf08c('0x9')),'faxQueueReport':require(_0xf08c('0xa')),'whatsappQueueReport':require(_0xf08c('0xb'))};var RuleEngine=require(_0xf08c('0xc'));function getId(_0x2dc92f,_0x314d27,_0x1443f4){return util[_0xf08c('0xd')](_0xf08c('0xe'),_0x2dc92f,_0x314d27||0x0,_0x1443f4||0x0);}function getIntervals(_0x216d03,_0x4deac0){var _0x128454=[];if(!_[_0xf08c('0xf')](_0x4deac0[_0xf08c('0x10')])&&!_[_0xf08c('0xf')](_0x216d03[_0x4deac0[_0xf08c('0x10')]])&&!_[_0xf08c('0xf')](_0x216d03[_0x4deac0['IntervalId']][_0xf08c('0x11')])){_0x128454=_[_0xf08c('0x12')](_0x216d03[_0x4deac0['IntervalId']][_0xf08c('0x11')],_0xf08c('0x13'));}else if(!_['isNil'](_0x4deac0['interval'])){_0x128454=[_0x4deac0['interval']];}return _0x128454;}exports['listen']=function(_0x12d344){_0x12d344[_0xf08c('0x14')]={};return new BPromise(function(_0x577410,_0x30877c){var _0x44d1ac={'Start':function(_0xb3329a){var _0x5ea810=this;return new Promise(function(_0x3ccc26,_0x30aca6){if(_0xb3329a){try{var _0x390989=[];var _0x549247=getId(_0xb3329a[_0xf08c('0x15')],_0xb3329a[_0xf08c('0x16')]?_0xb3329a[_0xf08c('0x16')]['id']:0x0,_0xb3329a[_0xf08c('0x17')]?_0xb3329a[_0xf08c('0x17')]['id']:0x0);var _0x653dff=sUtils[_0xf08c('0x18')](_0x12d344,_0xb3329a);if(!_0x653dff&&_0xb3329a[_0xf08c('0x19')]&&_[_0xf08c('0x1a')](_0xb3329a[_0xf08c('0x19')])&&_0xb3329a[_0xf08c('0x19')][_0xf08c('0x1b')]){for(var _0x1a3ef7=0x0;_0x1a3ef7<_0xb3329a[_0xf08c('0x19')]['length'];_0x1a3ef7+=0x1){var _0x2546ce=_0xb3329a[_0xf08c('0x19')][_0x1a3ef7];if(fs['existsSync'](path[_0xf08c('0x1c')](__dirname,_0xf08c('0x19'),_0x2546ce[_0xf08c('0x1d')]+'.js'))){var _0x4577bd=[];switch(_0x2546ce['app']['toLowerCase']()){case _0xf08c('0x1e'):var _0x4a7158=_0x2546ce[_0xf08c('0x1f')][_0xf08c('0x20')](',');if(_0xb3329a[_0xf08c('0x15')]===_0xf08c('0x21')){_0x4577bd[_0xf08c('0x22')](_0x4a7158[0x0]);_0x4577bd[_0xf08c('0x22')](_0x4a7158[0x1]);_0x4577bd[_0xf08c('0x22')](_0x4a7158[_0xf08c('0x23')](0x2,_0x4a7158[_0xf08c('0x1b')])[_0xf08c('0x1c')](','));}else{_0x4577bd['push'](_0x4a7158[0x0]);_0x4577bd['push'](_0x4a7158[_0xf08c('0x23')](0x1,_0x4a7158[_0xf08c('0x1b')])[_0xf08c('0x1c')](','));}break;case _0xf08c('0x24'):var _0x592380=_0x2546ce[_0xf08c('0x1f')][_0xf08c('0x20')](',');_0x4577bd[_0xf08c('0x22')](_0x592380[0x0]);_0x4577bd[_0xf08c('0x22')](_0x592380[0x1]);_0x4577bd[_0xf08c('0x22')](_0x592380['slice'](0x2,_0x592380[_0xf08c('0x1b')])[_0xf08c('0x1c')](','));break;case'dialogflowv2':var _0x12dc3e=_0x2546ce['appdata'][_0xf08c('0x20')](',');_0x4577bd[_0xf08c('0x22')](_0x12dc3e[0x0]);_0x4577bd[_0xf08c('0x22')](_0x12dc3e[0x1]);_0x4577bd[_0xf08c('0x22')](_0x12dc3e[0x2]);_0x4577bd[_0xf08c('0x22')](_0x12dc3e[0x3]);_0x4577bd[_0xf08c('0x22')](_0x12dc3e['slice'](0x4,_0x12dc3e['length'])[_0xf08c('0x1c')](','));break;case'amazonlex':var _0x377120=_0x2546ce['appdata'][_0xf08c('0x20')](',');_0x4577bd['push'](_0x377120[0x0]);_0x4577bd[_0xf08c('0x22')](_0x377120[0x1]);_0x4577bd['push'](_0x377120[0x2]);_0x4577bd[_0xf08c('0x22')](_0x377120[0x3]);_0x4577bd['push'](_0x377120['slice'](0x4,_0x377120['length'])[_0xf08c('0x1c')](','));break;case _0xf08c('0x16'):_0x4577bd[_0xf08c('0x22')](_0x2546ce[_0xf08c('0x1f')]);break;case'tag':_0x4577bd[_0xf08c('0x22')](_0x2546ce[_0xf08c('0x25')]);_0x4577bd[_0xf08c('0x22')](_0x2546ce[_0xf08c('0x1f')]);break;case _0xf08c('0x26'):var _0xf30e4=utils[_0xf08c('0x27')](_0xb3329a[_0xf08c('0x28')][_0xf08c('0x29')],_0xb3329a);var _0x37fcd6=_0x2546ce[_0xf08c('0x1f')]['split'](',');_0x4577bd[_0xf08c('0x22')](_0x37fcd6[0x0]);_0x4577bd[_0xf08c('0x22')](_0x37fcd6[0x1]);_0x4577bd['push'](_0x37fcd6[0x2]);_0x4577bd['push'](_0x37fcd6[0x3]);_0x4577bd[_0xf08c('0x22')](_0x37fcd6[0x4]);_0x4577bd[_0xf08c('0x22')](_0x37fcd6[0x5]);_0x4577bd['push'](_0x37fcd6[0x6]);_0x4577bd['push'](_0x37fcd6[0x7]);_0x4577bd[_0xf08c('0x22')](_0x37fcd6[0x8]);_0x4577bd[_0xf08c('0x22')](_0x37fcd6[0x9]);_0x4577bd['push'](_0x37fcd6[0xa]);_0x4577bd[_0xf08c('0x22')](_0xb3329a[_0xf08c('0x17')]['id']);_0x4577bd[_0xf08c('0x22')](_0xb3329a['message']['id']);_0x4577bd[_0xf08c('0x22')](_0x2546ce['ChatWebsiteId']);_0x4577bd[_0xf08c('0x22')](_0xb3329a['interaction'][_0xf08c('0x2a')]);_0x4577bd[_0xf08c('0x22')](_0xb3329a[_0xf08c('0x2b')][_0xf08c('0x2b')]);_0x4577bd['push'](_0xf30e4);break;default:_0x4577bd=_[_0xf08c('0xf')](_0x2546ce[_0xf08c('0x1f')])?[]:_0x2546ce[_0xf08c('0x1f')][_0xf08c('0x20')](',');}var _0x59ace7={'id':util['format'](_0xf08c('0x2c'),_0x549247,_0x2546ce['id'],_0x2546ce[_0xf08c('0x1d')]),'condition':require(_0xf08c('0x2d'))[_0xf08c('0x2e')](_0x549247,getIntervals(_0x12d344[_0xf08c('0x2f')],_0x2546ce),_0x12d344),'consequence':require(_0xf08c('0x30')+_0x2546ce[_0xf08c('0x1d')])[_0xf08c('0x31')](_0x549247,_0x4577bd,_0x12d344,_0xb3329a),'p':_0x2546ce[_0xf08c('0x32')]||0x0};logger[_0xf08c('0x33')](_0xf08c('0x34'),_0x59ace7['id'],_0xf08c('0x35'),getIntervals(_0x12d344[_0xf08c('0x2f')],_0x2546ce)[_0xf08c('0x1c')](_0xf08c('0x36')));_0x390989['push'](_0x59ace7);}else{logger['error'](_0xf08c('0x37'),path['join'](__dirname,'applications',_0x2546ce['app']+'.js'));}}_0x12d344['rules'][_0x549247]=new RuleEngine(_0x390989);_0x12d344['rules'][_0x549247][_0xf08c('0x38')](_0xb3329a,function(_0xe4b609){logger[_0xf08c('0x33')](_0xf08c('0x39'),JSON[_0xf08c('0x3a')](_0xe4b609[_0xf08c('0x3b')]));if(_0x12d344['rules'][_0x549247]){_0x12d344[_0xf08c('0x14')][_0x549247][_0xf08c('0x3c')](_0xf08c('0x3d'));}});return _0x3ccc26({'code':0xc8,'message':_0xb3329a});}else{if(_0x653dff){logger[_0xf08c('0x33')](util[_0xf08c('0xd')](_0xf08c('0x3e'),_0x549247));}else{logger[_0xf08c('0x33')](_0xf08c('0x3f'));}return _0x3ccc26({'code':0xc8,'message':_0xb3329a});}}catch(_0x6c9594){logger[_0xf08c('0x40')](_0x6c9594[_0xf08c('0x41')]);return _0x30aca6(_0x5ea810['error'](0x1f4,_0x6c9594));}}return _0x30aca6(_0xf08c('0x42'));});},'AcceptMessage':function(_0x52fe03){var _0x1e89bc=this;return new Promise(function(_0x50f770,_0x3ec0dd){if(_0x52fe03['agent']&&_0x52fe03['agent']['id']){if(_0x12d344['agents'][_0x52fe03[_0xf08c('0x43')]['id']]){_0x12d344['agents'][_0x52fe03[_0xf08c('0x43')]['id']][_0xf08c('0x44')]=![];_0x12d344['agents'][_0x52fe03['agent']['id']][_0xf08c('0x45')]=undefined;}}if(_0x52fe03[_0xf08c('0x16')]&&_0x52fe03[_0xf08c('0x16')]['id']){try{var _0x591c24=getId(_0x52fe03[_0xf08c('0x15')],_0x52fe03[_0xf08c('0x16')]?_0x52fe03[_0xf08c('0x16')]['id']:0x0,_0x52fe03[_0xf08c('0x17')]?_0x52fe03['interaction']['id']:0x0);if(_0x12d344['rules'][_0x591c24]){_0x12d344[_0xf08c('0x14')][_0x591c24][_0xf08c('0x3c')](_0xf08c('0x46'));if(rpc[_0x52fe03[_0xf08c('0x15')]+_0xf08c('0x47')]){rpc[_0x52fe03[_0xf08c('0x15')]+_0xf08c('0x47')][_0xf08c('0x48')](_0x591c24,{'UserId':_0x52fe03[_0xf08c('0x16')][_0xf08c('0x49')]})[_0xf08c('0x4a')](function(){logger['error'](_0xf08c('0x4b'));});}}return _0x50f770({'code':0xc8,'message':_0x52fe03});}catch(_0x1d692a){logger[_0xf08c('0x40')](_0x1d692a['stack']);return _0x3ec0dd(_0x1e89bc[_0xf08c('0x40')](0x1f4,_0x1d692a));}}logger[_0xf08c('0x40')](_0xf08c('0x4c'));return _0x3ec0dd(_0x1e89bc['error'](0x1f4,_0xf08c('0x4c')));});},'RejectMessage':function(_0x18b131){var _0x38919d=this;return new Promise(function(_0x16569c,_0x4c2cea){if(_0x18b131[_0xf08c('0x43')]&&_0x18b131[_0xf08c('0x43')]['id']){try{if(_0x12d344[_0xf08c('0x4d')][_0x18b131[_0xf08c('0x43')]['id']]){_0x12d344['agents'][_0x18b131[_0xf08c('0x43')]['id']][_0xf08c('0x44')]=![];_0x12d344[_0xf08c('0x4d')][_0x18b131[_0xf08c('0x43')]['id']][_0xf08c('0x45')]=undefined;}return _0x16569c({'code':0xc8,'message':_0x18b131});}catch(_0x14c104){logger[_0xf08c('0x40')](_0x14c104['stack']);return _0x4c2cea(_0x38919d[_0xf08c('0x40')](0x1f4,_0x14c104));}}logger[_0xf08c('0x40')](_0xf08c('0x4c'));return _0x4c2cea(_0x38919d[_0xf08c('0x40')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x8505ec){var _0x37aaf4=this;return new Promise(function(_0x16adc6,_0x203ec3){if(_0x8505ec['channel']&&_0x8505ec[_0xf08c('0x17')]&&_0x8505ec[_0xf08c('0x17')]['id']){try{var _0x10ec68=getId(_0x8505ec[_0xf08c('0x15')],_0x8505ec[_0xf08c('0x16')]?_0x8505ec['message']['id']:0x0,_0x8505ec[_0xf08c('0x17')]?_0x8505ec['interaction']['id']:0x0);if(_0x12d344[_0xf08c('0x14')][_0x10ec68]){_0x12d344[_0xf08c('0x14')][_0x10ec68]['emit'](_0xf08c('0x46'));}return _0x16adc6({'code':0xc8,'message':_0x8505ec});}catch(_0x589c85){logger[_0xf08c('0x40')](_0x589c85['stack']);return _0x203ec3(_0x37aaf4[_0xf08c('0x40')](0x1f4,_0x589c85));}}logger[_0xf08c('0x40')](_0xf08c('0x4c'));return _0x203ec3(_0x37aaf4['error'](0x1f4,_0xf08c('0x4c')));});},'AgentCapacity':function(_0x2418d5){var _0x36560f=this;return new Promise(function(_0x17bf8f,_0x43a49d){if(_0x12d344['agents'][_0xf08c('0x4e')](_0x2418d5['id'])){for(var _0x58d167 in _0x2418d5[_0xf08c('0x4f')]){if(_0x2418d5[_0xf08c('0x4f')][_0xf08c('0x4e')](_0x58d167)){if(_0x12d344[_0xf08c('0x4d')][_0x2418d5['id']][_0xf08c('0x4e')](_0x58d167+_0xf08c('0x50'))){_0x12d344['agents'][_0x2418d5['id']][_0x58d167+'CurrentCapacity']=parseInt(_0x2418d5[_0xf08c('0x4f')][_0x58d167],0xa);}}}_0x12d344[_0xf08c('0x4d')][_0x2418d5['id']][_0xf08c('0x51')]();return _0x17bf8f({'code':0xc8,'message':_0x12d344[_0xf08c('0x4d')][_0x2418d5['id']]});}else{return _0x43a49d(_0x36560f[_0xf08c('0x40')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xef98f8){return new Promise(function(_0x227a68){var _0x21e2ea=_[_0xf08c('0x52')](_0x12d344[_0xf08c('0x4d')]);if(_0xef98f8&&_0xef98f8['id']){var _0x25f77a=_[_0xf08c('0x53')](_0x21e2ea,function(_0x1c910e){return _0x1c910e['id']===_0xef98f8['id'];});_0x227a68(_0x25f77a);}else{_0x227a68({'count':_0x21e2ea[_0xf08c('0x1b')],'rows':_0x21e2ea});}});},'ChatQueues':function(){return new Promise(function(_0x4a8400){var _0x1dbf12=[];for(var _0x1aa9db in _0x12d344[_0xf08c('0x54')]){if(_0x12d344[_0xf08c('0x54')][_0xf08c('0x4e')](_0x1aa9db)){var _0x30c65e=_0x12d344[_0xf08c('0x54')][_0x1aa9db];var _0x1430df={'id':_0x30c65e['id'],'available':_0x30c65e[_0xf08c('0x55')],'loggedIn':_0x30c65e['loggedIn'],'name':_0x30c65e[_0xf08c('0x56')],'paused':_0x30c65e[_0xf08c('0x57')],'waiting':_0x30c65e[_0xf08c('0x58')]};_0x1dbf12['push'](_0x1430df);}}_0x4a8400({'count':_0x1dbf12[_0xf08c('0x1b')],'rows':_0x1dbf12});});},'MailQueues':function(){return new Promise(function(_0x329f0c){var _0x5282a9=[];for(var _0x1d59ea in _0x12d344[_0xf08c('0x59')]){if(_0x12d344[_0xf08c('0x59')][_0xf08c('0x4e')](_0x1d59ea)){var _0x2e425f=_0x12d344[_0xf08c('0x59')][_0x1d59ea];var _0x1c0964={'id':_0x2e425f['id'],'available':_0x2e425f[_0xf08c('0x55')],'loggedIn':_0x2e425f[_0xf08c('0x5a')],'name':_0x2e425f['name'],'paused':_0x2e425f['paused'],'waiting':_0x2e425f[_0xf08c('0x58')]};_0x5282a9[_0xf08c('0x22')](_0x1c0964);}}_0x329f0c({'count':_0x5282a9[_0xf08c('0x1b')],'rows':_0x5282a9});});},'OpenchannelQueues':function(){return new Promise(function(_0x4a83be){var _0xec1d7d=[];for(var _0x2a69ff in _0x12d344[_0xf08c('0x5b')]){if(_0x12d344['openchannelQueues']['hasOwnProperty'](_0x2a69ff)){var _0x3345f4=_0x12d344[_0xf08c('0x5b')][_0x2a69ff];var _0x5cb762={'id':_0x3345f4['id'],'available':_0x3345f4[_0xf08c('0x55')],'loggedIn':_0x3345f4['loggedIn'],'name':_0x3345f4[_0xf08c('0x56')],'paused':_0x3345f4['paused'],'waiting':_0x3345f4['waiting']};_0xec1d7d[_0xf08c('0x22')](_0x5cb762);}}_0x4a83be({'count':_0xec1d7d[_0xf08c('0x1b')],'rows':_0xec1d7d});});},'SmsQueues':function(){return new Promise(function(_0x143c2f){var _0x2b7c4a=[];for(var _0xb68857 in _0x12d344[_0xf08c('0x5c')]){if(_0x12d344[_0xf08c('0x5c')][_0xf08c('0x4e')](_0xb68857)){var _0x148339=_0x12d344[_0xf08c('0x5c')][_0xb68857];var _0x4793cb={'id':_0x148339['id'],'available':_0x148339[_0xf08c('0x55')],'loggedIn':_0x148339[_0xf08c('0x5a')],'name':_0x148339['name'],'paused':_0x148339[_0xf08c('0x57')],'waiting':_0x148339[_0xf08c('0x58')]};_0x2b7c4a[_0xf08c('0x22')](_0x4793cb);}}_0x143c2f({'count':_0x2b7c4a[_0xf08c('0x1b')],'rows':_0x2b7c4a});});},'FaxQueues':function(){return new Promise(function(_0x92b331){var _0x12639f=[];for(var _0x20d39a in _0x12d344[_0xf08c('0x5d')]){if(_0x12d344[_0xf08c('0x5d')][_0xf08c('0x4e')](_0x20d39a)){var _0x5cb2a5=_0x12d344['faxQueues'][_0x20d39a];var _0x113385={'id':_0x5cb2a5['id'],'available':_0x5cb2a5[_0xf08c('0x55')],'loggedIn':_0x5cb2a5[_0xf08c('0x5a')],'name':_0x5cb2a5[_0xf08c('0x56')],'paused':_0x5cb2a5['paused'],'waiting':_0x5cb2a5[_0xf08c('0x58')]};_0x12639f[_0xf08c('0x22')](_0x113385);}}_0x92b331({'count':_0x12639f[_0xf08c('0x1b')],'rows':_0x12639f});});},'WhatsappQueues':function(){return new Promise(function(_0xd1a9eb){var _0x3aa997=[];for(var _0x350fb2 in _0x12d344[_0xf08c('0x5e')]){if(_0x12d344[_0xf08c('0x5e')]['hasOwnProperty'](_0x350fb2)){var _0x5afd98=_0x12d344[_0xf08c('0x5e')][_0x350fb2];var _0x2efea0={'id':_0x5afd98['id'],'available':_0x5afd98[_0xf08c('0x55')],'loggedIn':_0x5afd98[_0xf08c('0x5a')],'name':_0x5afd98[_0xf08c('0x56')],'paused':_0x5afd98[_0xf08c('0x57')],'waiting':_0x5afd98[_0xf08c('0x58')]};_0x3aa997['push'](_0x2efea0);}}_0xd1a9eb({'count':_0x3aa997[_0xf08c('0x1b')],'rows':_0x3aa997});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1d648c){var _0x39305a=_[_0xf08c('0x52')](_0x12d344[_0xf08c('0x5f')]);_0x1d648c({'count':_0x39305a[_0xf08c('0x1b')],'rows':_0x39305a});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3c3087){var _0x4d43e5=_['values'](_0x12d344['mailQueuesWaitingInteractions']);_0x3c3087({'count':_0x4d43e5[_0xf08c('0x1b')],'rows':_0x4d43e5});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xe3f308){var _0x67d06e=_['values'](_0x12d344[_0xf08c('0x60')]);_0xe3f308({'count':_0x67d06e[_0xf08c('0x1b')],'rows':_0x67d06e});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x30d455){var _0x324699=_['values'](_0x12d344[_0xf08c('0x61')]);_0x30d455({'count':_0x324699[_0xf08c('0x1b')],'rows':_0x324699});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x25907a){var _0x158b32=_[_0xf08c('0x52')](_0x12d344['faxQueuesWaitingInteractions']);_0x25907a({'count':_0x158b32['length'],'rows':_0x158b32});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5abf3a){var _0x5e27e8=_[_0xf08c('0x52')](_0x12d344['whatsappQueuesWaitingInteractions']);_0x5abf3a({'count':_0x5e27e8[_0xf08c('0x1b')],'rows':_0x5e27e8});});}};var _0x4b4639=jayson[_0xf08c('0x62')](_0x44d1ac)['http']();_0x4b4639['on'](_0xf08c('0x40'),function(_0x5bb418){logger[_0xf08c('0x40')](JSON[_0xf08c('0x3a')](_0x5bb418));return _0x30877c(_0x5bb418);});_0x4b4639[_0xf08c('0x63')](0x232c,_0xf08c('0x64'),function(){console[_0xf08c('0x65')](_0xf08c('0x66'),0x232c);return _0x577410(_0xf08c('0x67')+0x232c);});});}; \ No newline at end of file +var _0x6f69=['http','stringify','log','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','interaction','checkWaitingNotifications','applications','length','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','message','ContactId','body','./interval','condition','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','.js','execute','Applications\x20executed','matchPath','emit','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x6f69,0x67));var _0x96f6=function(_0x345ffb,_0x2834a0){_0x345ffb=_0x345ffb-0x0;var _0x41522e=_0x6f69[_0x345ffb];return _0x41522e;};'use strict';var _=require('lodash');var util=require(_0x96f6('0x0'));var path=require(_0x96f6('0x1'));var fs=require('fs');var jayson=require(_0x96f6('0x2'));var BPromise=require(_0x96f6('0x3'));var utils=require(_0x96f6('0x4'));var sUtils=require(_0x96f6('0x5'));var logger=require(_0x96f6('0x6'))(_0x96f6('0x7'));var rpc={'openchannelQueueReport':require(_0x96f6('0x8')),'mailQueueReport':require(_0x96f6('0x9')),'chatQueueReport':require(_0x96f6('0xa')),'smsQueueReport':require(_0x96f6('0xb')),'faxQueueReport':require(_0x96f6('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x96f6('0xd'));function getId(_0x5d20d9,_0x3e1a88,_0xc6e277){return util[_0x96f6('0xe')](_0x96f6('0xf'),_0x5d20d9,_0x3e1a88||0x0,_0xc6e277||0x0);}function getIntervals(_0x54cb0,_0x355108){var _0x473d5b=[];if(!_['isNil'](_0x355108['IntervalId'])&&!_[_0x96f6('0x10')](_0x54cb0[_0x355108[_0x96f6('0x11')]])&&!_[_0x96f6('0x10')](_0x54cb0[_0x355108[_0x96f6('0x11')]][_0x96f6('0x12')])){_0x473d5b=_[_0x96f6('0x13')](_0x54cb0[_0x355108[_0x96f6('0x11')]][_0x96f6('0x12')],_0x96f6('0x14'));}else if(!_[_0x96f6('0x10')](_0x355108[_0x96f6('0x14')])){_0x473d5b=[_0x355108[_0x96f6('0x14')]];}return _0x473d5b;}exports[_0x96f6('0x15')]=function(_0x134a11){_0x134a11[_0x96f6('0x16')]={};return new BPromise(function(_0x575016,_0x2bd616){var _0x2b8e75={'Start':function(_0x476e1f){var _0x3d23e1=this;return new Promise(function(_0x1ebb2f,_0x5835ef){if(_0x476e1f){try{var _0x25b2ba=[];var _0x2853cb=getId(_0x476e1f[_0x96f6('0x17')],_0x476e1f['message']?_0x476e1f['message']['id']:0x0,_0x476e1f[_0x96f6('0x18')]?_0x476e1f[_0x96f6('0x18')]['id']:0x0);var _0x1fb08b=sUtils[_0x96f6('0x19')](_0x134a11,_0x476e1f);if(!_0x1fb08b&&_0x476e1f[_0x96f6('0x1a')]&&_['isArray'](_0x476e1f['applications'])&&_0x476e1f[_0x96f6('0x1a')][_0x96f6('0x1b')]){for(var _0x69a12a=0x0;_0x69a12a<_0x476e1f[_0x96f6('0x1a')][_0x96f6('0x1b')];_0x69a12a+=0x1){var _0x3a2b71=_0x476e1f['applications'][_0x69a12a];if(fs['existsSync'](path[_0x96f6('0x1c')](__dirname,_0x96f6('0x1a'),_0x3a2b71[_0x96f6('0x1d')]+'.js'))){var _0x130e57=[];switch(_0x3a2b71[_0x96f6('0x1d')][_0x96f6('0x1e')]()){case _0x96f6('0x1f'):var _0x315252=_0x3a2b71[_0x96f6('0x20')][_0x96f6('0x21')](',');if(_0x476e1f[_0x96f6('0x17')]===_0x96f6('0x22')){_0x130e57['push'](_0x315252[0x0]);_0x130e57[_0x96f6('0x23')](_0x315252[0x1]);_0x130e57[_0x96f6('0x23')](_0x315252[_0x96f6('0x24')](0x2,_0x315252[_0x96f6('0x1b')])['join'](','));}else{_0x130e57[_0x96f6('0x23')](_0x315252[0x0]);_0x130e57['push'](_0x315252[_0x96f6('0x24')](0x1,_0x315252[_0x96f6('0x1b')])[_0x96f6('0x1c')](','));}break;case'dialogflow':var _0x3d7a57=_0x3a2b71['appdata'][_0x96f6('0x21')](',');_0x130e57[_0x96f6('0x23')](_0x3d7a57[0x0]);_0x130e57[_0x96f6('0x23')](_0x3d7a57[0x1]);_0x130e57[_0x96f6('0x23')](_0x3d7a57[_0x96f6('0x24')](0x2,_0x3d7a57[_0x96f6('0x1b')])[_0x96f6('0x1c')](','));break;case'dialogflowv2':var _0x138779=_0x3a2b71['appdata'][_0x96f6('0x21')](',');_0x130e57[_0x96f6('0x23')](_0x138779[0x0]);_0x130e57[_0x96f6('0x23')](_0x138779[0x1]);_0x130e57[_0x96f6('0x23')](_0x138779[0x2]);_0x130e57[_0x96f6('0x23')](_0x138779[0x3]);_0x130e57[_0x96f6('0x23')](_0x138779[_0x96f6('0x24')](0x4,_0x138779['length'])[_0x96f6('0x1c')](','));break;case _0x96f6('0x25'):var _0x23992e=_0x3a2b71['appdata']['split'](',');_0x130e57[_0x96f6('0x23')](_0x23992e[0x0]);_0x130e57['push'](_0x23992e[0x1]);_0x130e57[_0x96f6('0x23')](_0x23992e[0x2]);_0x130e57[_0x96f6('0x23')](_0x23992e[0x3]);_0x130e57[_0x96f6('0x23')](_0x23992e[_0x96f6('0x24')](0x4,_0x23992e['length'])[_0x96f6('0x1c')](','));break;case'message':_0x130e57[_0x96f6('0x23')](_0x3a2b71['appdata']);break;case'tag':_0x130e57['push'](_0x3a2b71[_0x96f6('0x26')]);_0x130e57['push'](_0x3a2b71['appdata']);break;case _0x96f6('0x27'):var _0x2af674=utils[_0x96f6('0x28')](_0x476e1f[_0x96f6('0x29')][_0x96f6('0x2a')],_0x476e1f);var _0x442642=_0x3a2b71[_0x96f6('0x20')][_0x96f6('0x21')](',');_0x130e57[_0x96f6('0x23')](_0x442642[0x0]);_0x130e57[_0x96f6('0x23')](_0x442642[0x1]);_0x130e57[_0x96f6('0x23')](_0x442642[0x2]);_0x130e57[_0x96f6('0x23')](_0x442642[0x3]);_0x130e57[_0x96f6('0x23')](_0x442642[0x4]);_0x130e57[_0x96f6('0x23')](_0x442642[0x5]);_0x130e57[_0x96f6('0x23')](_0x442642[0x6]);_0x130e57[_0x96f6('0x23')](_0x442642[0x7]);_0x130e57['push'](_0x442642[0x8]);_0x130e57[_0x96f6('0x23')](_0x442642[0x9]);_0x130e57['push'](_0x442642[0xa]);_0x130e57[_0x96f6('0x23')](_0x476e1f[_0x96f6('0x18')]['id']);_0x130e57[_0x96f6('0x23')](_0x476e1f[_0x96f6('0x2b')]['id']);_0x130e57[_0x96f6('0x23')](_0x3a2b71['ChatWebsiteId']);_0x130e57[_0x96f6('0x23')](_0x476e1f[_0x96f6('0x18')][_0x96f6('0x2c')]);_0x130e57['push'](_0x476e1f['body'][_0x96f6('0x2d')]);_0x130e57['push'](_0x2af674);break;default:_0x130e57=_['isNil'](_0x3a2b71[_0x96f6('0x20')])?[]:_0x3a2b71[_0x96f6('0x20')][_0x96f6('0x21')](',');}var _0x1529d3={'id':util['format']('%s:%s:%s',_0x2853cb,_0x3a2b71['id'],_0x3a2b71[_0x96f6('0x1d')]),'condition':require(_0x96f6('0x2e'))[_0x96f6('0x2f')](_0x2853cb,getIntervals(_0x134a11['intervals'],_0x3a2b71),_0x134a11),'consequence':require(_0x96f6('0x30')+_0x3a2b71[_0x96f6('0x1d')])[_0x96f6('0x31')](_0x2853cb,_0x130e57,_0x134a11,_0x476e1f),'p':_0x3a2b71['priority']||0x0};logger[_0x96f6('0x32')](_0x96f6('0x33'),_0x1529d3['id'],_0x96f6('0x34'),getIntervals(_0x134a11[_0x96f6('0x35')],_0x3a2b71)[_0x96f6('0x1c')](_0x96f6('0x36')));_0x25b2ba[_0x96f6('0x23')](_0x1529d3);}else{logger[_0x96f6('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x96f6('0x1c')](__dirname,_0x96f6('0x1a'),_0x3a2b71[_0x96f6('0x1d')]+_0x96f6('0x38')));}}_0x134a11[_0x96f6('0x16')][_0x2853cb]=new RuleEngine(_0x25b2ba);_0x134a11[_0x96f6('0x16')][_0x2853cb][_0x96f6('0x39')](_0x476e1f,function(_0x219c28){logger[_0x96f6('0x32')](_0x96f6('0x3a'),JSON['stringify'](_0x219c28[_0x96f6('0x3b')]));if(_0x134a11['rules'][_0x2853cb]){_0x134a11[_0x96f6('0x16')][_0x2853cb][_0x96f6('0x3c')]('complete');}});return _0x1ebb2f({'code':0xc8,'message':_0x476e1f});}else{if(_0x1fb08b){logger['info'](util[_0x96f6('0xe')]('Skipped\x20routing\x20for\x20%s',_0x2853cb));}else{logger[_0x96f6('0x32')]('No\x20applications\x20to\x20execute');}return _0x1ebb2f({'code':0xc8,'message':_0x476e1f});}}catch(_0x23aa7c){logger['error'](_0x23aa7c[_0x96f6('0x3d')]);return _0x5835ef(_0x3d23e1[_0x96f6('0x37')](0x1f4,_0x23aa7c));}}return _0x5835ef(_0x96f6('0x3e'));});},'AcceptMessage':function(_0x2f0b56){var _0x378905=this;return new Promise(function(_0x41563d,_0x23321e){if(_0x2f0b56[_0x96f6('0x3f')]&&_0x2f0b56['agent']['id']){if(_0x134a11['agents'][_0x2f0b56[_0x96f6('0x3f')]['id']]){_0x134a11[_0x96f6('0x40')][_0x2f0b56['agent']['id']][_0x96f6('0x41')]=![];_0x134a11[_0x96f6('0x40')][_0x2f0b56[_0x96f6('0x3f')]['id']][_0x96f6('0x42')]=undefined;}}if(_0x2f0b56[_0x96f6('0x2b')]&&_0x2f0b56['message']['id']){try{var _0x49a6eb=getId(_0x2f0b56['channel'],_0x2f0b56[_0x96f6('0x2b')]?_0x2f0b56[_0x96f6('0x2b')]['id']:0x0,_0x2f0b56[_0x96f6('0x18')]?_0x2f0b56[_0x96f6('0x18')]['id']:0x0);if(_0x134a11[_0x96f6('0x16')][_0x49a6eb]){_0x134a11[_0x96f6('0x16')][_0x49a6eb][_0x96f6('0x3c')]('end');if(rpc[_0x2f0b56[_0x96f6('0x17')]+'QueueReport']){rpc[_0x2f0b56[_0x96f6('0x17')]+_0x96f6('0x43')][_0x96f6('0x44')](_0x49a6eb,{'UserId':_0x2f0b56[_0x96f6('0x2b')][_0x96f6('0x45')]})['catch'](function(){logger[_0x96f6('0x37')](_0x96f6('0x46'));});}}return _0x41563d({'code':0xc8,'message':_0x2f0b56});}catch(_0x38f28a){logger['error'](_0x38f28a[_0x96f6('0x3d')]);return _0x23321e(_0x378905[_0x96f6('0x37')](0x1f4,_0x38f28a));}}logger[_0x96f6('0x37')](_0x96f6('0x47'));return _0x23321e(_0x378905['error'](0x1f4,_0x96f6('0x47')));});},'RejectMessage':function(_0x4ae92b){var _0x59ce17=this;return new Promise(function(_0x320626,_0x8b0b8d){if(_0x4ae92b['agent']&&_0x4ae92b[_0x96f6('0x3f')]['id']){try{if(_0x134a11[_0x96f6('0x40')][_0x4ae92b['agent']['id']]){_0x134a11[_0x96f6('0x40')][_0x4ae92b[_0x96f6('0x3f')]['id']][_0x96f6('0x41')]=![];_0x134a11['agents'][_0x4ae92b[_0x96f6('0x3f')]['id']]['busyQueue']=undefined;}return _0x320626({'code':0xc8,'message':_0x4ae92b});}catch(_0x19a1f2){logger[_0x96f6('0x37')](_0x19a1f2[_0x96f6('0x3d')]);return _0x8b0b8d(_0x59ce17[_0x96f6('0x37')](0x1f4,_0x19a1f2));}}logger[_0x96f6('0x37')](_0x96f6('0x47'));return _0x8b0b8d(_0x59ce17[_0x96f6('0x37')](0x1f4,_0x96f6('0x47')));});},'AbandonInteraction':function(_0x3198b0){var _0x3bc6ec=this;return new Promise(function(_0x2fd198,_0x2b1ca2){if(_0x3198b0[_0x96f6('0x17')]&&_0x3198b0[_0x96f6('0x18')]&&_0x3198b0[_0x96f6('0x18')]['id']){try{var _0x50c8bb=getId(_0x3198b0[_0x96f6('0x17')],_0x3198b0['message']?_0x3198b0['message']['id']:0x0,_0x3198b0[_0x96f6('0x18')]?_0x3198b0[_0x96f6('0x18')]['id']:0x0);if(_0x134a11['rules'][_0x50c8bb]){_0x134a11['rules'][_0x50c8bb][_0x96f6('0x3c')]('end');}return _0x2fd198({'code':0xc8,'message':_0x3198b0});}catch(_0x2f9e6a){logger['error'](_0x2f9e6a[_0x96f6('0x3d')]);return _0x2b1ca2(_0x3bc6ec['error'](0x1f4,_0x2f9e6a));}}logger[_0x96f6('0x37')]('message\x20is\x20empty');return _0x2b1ca2(_0x3bc6ec[_0x96f6('0x37')](0x1f4,_0x96f6('0x47')));});},'AgentCapacity':function(_0x408f8a){var _0x345b21=this;return new Promise(function(_0x32182d,_0x4694d1){if(_0x134a11['agents'][_0x96f6('0x48')](_0x408f8a['id'])){for(var _0x52d2e0 in _0x408f8a[_0x96f6('0x49')]){if(_0x408f8a[_0x96f6('0x49')][_0x96f6('0x48')](_0x52d2e0)){if(_0x134a11[_0x96f6('0x40')][_0x408f8a['id']][_0x96f6('0x48')](_0x52d2e0+_0x96f6('0x4a'))){_0x134a11[_0x96f6('0x40')][_0x408f8a['id']][_0x52d2e0+_0x96f6('0x4a')]=parseInt(_0x408f8a[_0x96f6('0x49')][_0x52d2e0],0xa);}}}_0x134a11[_0x96f6('0x40')][_0x408f8a['id']][_0x96f6('0x4b')]();return _0x32182d({'code':0xc8,'message':_0x134a11[_0x96f6('0x40')][_0x408f8a['id']]});}else{return _0x4694d1(_0x345b21['error'](0x1f4,_0x96f6('0x4c')));}});},'Agents':function(_0x4e6deb){return new Promise(function(_0x18e11e){var _0xcca2a4=_['values'](_0x134a11[_0x96f6('0x40')]);if(_0x4e6deb&&_0x4e6deb['id']){var _0x200403=_[_0x96f6('0x4d')](_0xcca2a4,function(_0x4298e4){return _0x4298e4['id']===_0x4e6deb['id'];});_0x18e11e(_0x200403);}else{_0x18e11e({'count':_0xcca2a4[_0x96f6('0x1b')],'rows':_0xcca2a4});}});},'ChatQueues':function(){return new Promise(function(_0x517de2){var _0x219cbc=[];for(var _0x3c662a in _0x134a11[_0x96f6('0x4e')]){if(_0x134a11['chatQueues'][_0x96f6('0x48')](_0x3c662a)){var _0x4c2731=_0x134a11[_0x96f6('0x4e')][_0x3c662a];var _0xded583={'id':_0x4c2731['id'],'available':_0x4c2731[_0x96f6('0x4f')],'loggedIn':_0x4c2731['loggedIn'],'name':_0x4c2731[_0x96f6('0x50')],'paused':_0x4c2731[_0x96f6('0x51')],'waiting':_0x4c2731[_0x96f6('0x52')]};_0x219cbc['push'](_0xded583);}}_0x517de2({'count':_0x219cbc['length'],'rows':_0x219cbc});});},'MailQueues':function(){return new Promise(function(_0x1b05e2){var _0xa04dff=[];for(var _0xaca04f in _0x134a11[_0x96f6('0x53')]){if(_0x134a11[_0x96f6('0x53')]['hasOwnProperty'](_0xaca04f)){var _0x4aa95a=_0x134a11['mailQueues'][_0xaca04f];var _0x388ff7={'id':_0x4aa95a['id'],'available':_0x4aa95a[_0x96f6('0x4f')],'loggedIn':_0x4aa95a[_0x96f6('0x54')],'name':_0x4aa95a[_0x96f6('0x50')],'paused':_0x4aa95a[_0x96f6('0x51')],'waiting':_0x4aa95a[_0x96f6('0x52')]};_0xa04dff[_0x96f6('0x23')](_0x388ff7);}}_0x1b05e2({'count':_0xa04dff['length'],'rows':_0xa04dff});});},'OpenchannelQueues':function(){return new Promise(function(_0x2aec86){var _0x58417b=[];for(var _0x5b07a6 in _0x134a11[_0x96f6('0x55')]){if(_0x134a11[_0x96f6('0x55')][_0x96f6('0x48')](_0x5b07a6)){var _0x538256=_0x134a11[_0x96f6('0x55')][_0x5b07a6];var _0x2273bc={'id':_0x538256['id'],'available':_0x538256[_0x96f6('0x4f')],'loggedIn':_0x538256[_0x96f6('0x54')],'name':_0x538256[_0x96f6('0x50')],'paused':_0x538256[_0x96f6('0x51')],'waiting':_0x538256[_0x96f6('0x52')]};_0x58417b['push'](_0x2273bc);}}_0x2aec86({'count':_0x58417b[_0x96f6('0x1b')],'rows':_0x58417b});});},'SmsQueues':function(){return new Promise(function(_0x315d92){var _0x28d11c=[];for(var _0x556007 in _0x134a11[_0x96f6('0x56')]){if(_0x134a11[_0x96f6('0x56')][_0x96f6('0x48')](_0x556007)){var _0x4d67e4=_0x134a11['smsQueues'][_0x556007];var _0x2b6614={'id':_0x4d67e4['id'],'available':_0x4d67e4['available'],'loggedIn':_0x4d67e4[_0x96f6('0x54')],'name':_0x4d67e4[_0x96f6('0x50')],'paused':_0x4d67e4[_0x96f6('0x51')],'waiting':_0x4d67e4[_0x96f6('0x52')]};_0x28d11c[_0x96f6('0x23')](_0x2b6614);}}_0x315d92({'count':_0x28d11c[_0x96f6('0x1b')],'rows':_0x28d11c});});},'FaxQueues':function(){return new Promise(function(_0xc34c16){var _0x5101b9=[];for(var _0x564fc2 in _0x134a11[_0x96f6('0x57')]){if(_0x134a11['faxQueues'][_0x96f6('0x48')](_0x564fc2)){var _0x14b514=_0x134a11[_0x96f6('0x57')][_0x564fc2];var _0x1537fe={'id':_0x14b514['id'],'available':_0x14b514[_0x96f6('0x4f')],'loggedIn':_0x14b514[_0x96f6('0x54')],'name':_0x14b514['name'],'paused':_0x14b514[_0x96f6('0x51')],'waiting':_0x14b514[_0x96f6('0x52')]};_0x5101b9[_0x96f6('0x23')](_0x1537fe);}}_0xc34c16({'count':_0x5101b9[_0x96f6('0x1b')],'rows':_0x5101b9});});},'WhatsappQueues':function(){return new Promise(function(_0x4d0f8a){var _0xb615f3=[];for(var _0x39d401 in _0x134a11['whatsappQueues']){if(_0x134a11[_0x96f6('0x58')][_0x96f6('0x48')](_0x39d401)){var _0x138f6d=_0x134a11[_0x96f6('0x58')][_0x39d401];var _0x17180d={'id':_0x138f6d['id'],'available':_0x138f6d['available'],'loggedIn':_0x138f6d['loggedIn'],'name':_0x138f6d[_0x96f6('0x50')],'paused':_0x138f6d[_0x96f6('0x51')],'waiting':_0x138f6d['waiting']};_0xb615f3['push'](_0x17180d);}}_0x4d0f8a({'count':_0xb615f3['length'],'rows':_0xb615f3});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x385a71){var _0x3d4b35=_[_0x96f6('0x59')](_0x134a11[_0x96f6('0x5a')]);_0x385a71({'count':_0x3d4b35[_0x96f6('0x1b')],'rows':_0x3d4b35});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4217d6){var _0x45e832=_['values'](_0x134a11[_0x96f6('0x5b')]);_0x4217d6({'count':_0x45e832[_0x96f6('0x1b')],'rows':_0x45e832});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x28be94){var _0x4ef403=_[_0x96f6('0x59')](_0x134a11['openchannelQueuesWaitingInteractions']);_0x28be94({'count':_0x4ef403[_0x96f6('0x1b')],'rows':_0x4ef403});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2b45b5){var _0x4d7596=_['values'](_0x134a11[_0x96f6('0x5c')]);_0x2b45b5({'count':_0x4d7596[_0x96f6('0x1b')],'rows':_0x4d7596});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3fd5be){var _0x13293e=_['values'](_0x134a11[_0x96f6('0x5d')]);_0x3fd5be({'count':_0x13293e[_0x96f6('0x1b')],'rows':_0x13293e});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x403ef){var _0x44f008=_[_0x96f6('0x59')](_0x134a11[_0x96f6('0x5e')]);_0x403ef({'count':_0x44f008[_0x96f6('0x1b')],'rows':_0x44f008});});}};var _0x275b29=jayson['server'](_0x2b8e75)[_0x96f6('0x5f')]();_0x275b29['on'](_0x96f6('0x37'),function(_0x1e76e4){logger[_0x96f6('0x37')](JSON[_0x96f6('0x60')](_0x1e76e4));return _0x2bd616(_0x1e76e4);});_0x275b29[_0x96f6('0x15')](0x232c,'127.0.0.1',function(){console[_0x96f6('0x61')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x575016(_0x96f6('0x62')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 7cce998..694cce9 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 _0xa2ab=['jayson/promise','lodash','routing','client','http','request','then','error','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','catch','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','util','bluebird'];(function(_0x345087,_0x53b1e6){var _0x453863=function(_0xb93236){while(--_0xb93236){_0x345087['push'](_0x345087['shift']());}};_0x453863(++_0x53b1e6);}(_0xa2ab,0x194));var _0xba2a=function(_0x302fcf,_0x4e4901){_0x302fcf=_0x302fcf-0x0;var _0x2de7b7=_0xa2ab[_0x302fcf];return _0x2de7b7;};'use strict';var util=require(_0xba2a('0x0'));var BPromise=require(_0xba2a('0x1'));var jayson=require(_0xba2a('0x2'));var _=require(_0xba2a('0x3'));var logger=require('../../../config/logger')(_0xba2a('0x4'));var client=jayson[_0xba2a('0x5')][_0xba2a('0x6')]({'port':0x232a});function request(_0x43a865,_0x2e848d){return new BPromise(function(_0x40d941,_0x19ac7e){return client[_0xba2a('0x7')](_0x43a865,_0x2e848d)[_0xba2a('0x8')](function(_0x24e62a){if(_0x24e62a[_0xba2a('0x9')]){return _0x19ac7e(_0x24e62a[_0xba2a('0x9')][_0xba2a('0xa')]);}else{return _0x40d941(_0x24e62a['result']);}})['catch'](function(_0x248d05){return _0x19ac7e(_0x248d05);});});}exports[_0xba2a('0xb')]=function(_0x6573bd,_0x109310,_0x3f92de){return function(_0x29e373){if(_0x3f92de[_0xba2a('0xc')]&&!_0x3f92de[_0xba2a('0xc')][_0x6573bd]){logger[_0xba2a('0xd')](_0xba2a('0xe'),_0x6573bd);return _0x29e373[_0xba2a('0xf')]();}var _0x52dd66=[];for(var _0x5797ec=0x0;_0x5797ec<_0x109310[_0xba2a('0x10')];_0x5797ec+=0x1){_0x52dd66[_0xba2a('0x11')](request(_0xba2a('0x12'),{'command':util[_0xba2a('0x13')](_0xba2a('0x14'),_0x109310[_0x5797ec])})[_0xba2a('0x8')](function(_0x30577b){return _0x30577b&&_0x30577b['message']&&_0x30577b[_0xba2a('0xa')][_0xba2a('0x15')]('true')>=0x0?!![]:![];})[_0xba2a('0x16')](function(_0x21b500){logger[_0xba2a('0x9')](_0xba2a('0x17'),_0x6573bd,_0x109310[_0x5797ec]);}));}BPromise['all'](_0x52dd66)[_0xba2a('0x8')](function(_0x55be91){var _0x3cf689=_[_0xba2a('0x18')](_0x55be91);logger[_0xba2a('0xd')](_0xba2a('0x19'),_0x6573bd,_0x109310[_0xba2a('0x1a')]('\x20|\x20'),_0x3cf689);_0x29e373['when'](_0x3cf689);})['catch'](function(_0x81cdc1){console['log'](_0x81cdc1);logger[_0xba2a('0x9')](_0xba2a('0x19'),_0x6573bd,_0x109310[_0xba2a('0x1a')](_0xba2a('0x1b')),_0x81cdc1[_0xba2a('0x1c')]);_0x29e373['stop']();});};}; \ No newline at end of file +var _0x84db=['request','then','error','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','message','indexOf','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','log','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http'];(function(_0x34b390,_0x11b0bf){var _0x545829=function(_0x315b63){while(--_0x315b63){_0x34b390['push'](_0x34b390['shift']());}};_0x545829(++_0x11b0bf);}(_0x84db,0x138));var _0xb84d=function(_0x12acae,_0x1bc38c){_0x12acae=_0x12acae-0x0;var _0x31fda5=_0x84db[_0x12acae];return _0x31fda5;};'use strict';var util=require(_0xb84d('0x0'));var BPromise=require(_0xb84d('0x1'));var jayson=require(_0xb84d('0x2'));var _=require(_0xb84d('0x3'));var logger=require(_0xb84d('0x4'))('routing');var client=jayson[_0xb84d('0x5')][_0xb84d('0x6')]({'port':0x232a});function request(_0x4407a9,_0x309783){return new BPromise(function(_0x5833e4,_0xd744d2){return client[_0xb84d('0x7')](_0x4407a9,_0x309783)[_0xb84d('0x8')](function(_0x3bc138){if(_0x3bc138[_0xb84d('0x9')]){return _0xd744d2(_0x3bc138['error']['message']);}else{return _0x5833e4(_0x3bc138[_0xb84d('0xa')]);}})[_0xb84d('0xb')](function(_0x53f5ad){return _0xd744d2(_0x53f5ad);});});}exports[_0xb84d('0xc')]=function(_0x44cc34,_0x317e84,_0x214778){return function(_0x4a0ded){if(_0x214778['rules']&&!_0x214778[_0xb84d('0xd')][_0x44cc34]){logger['info'](_0xb84d('0xe'),_0x44cc34);return _0x4a0ded[_0xb84d('0xf')]();}var _0x20d642=[];for(var _0x4fefa8=0x0;_0x4fefa8<_0x317e84[_0xb84d('0x10')];_0x4fefa8+=0x1){_0x20d642[_0xb84d('0x11')](request('Command',{'command':util[_0xb84d('0x12')]('iftime\x20%s',_0x317e84[_0x4fefa8])})[_0xb84d('0x8')](function(_0x1c0e79){return _0x1c0e79&&_0x1c0e79[_0xb84d('0x13')]&&_0x1c0e79[_0xb84d('0x13')][_0xb84d('0x14')]('true')>=0x0?!![]:![];})['catch'](function(_0x3f5e08){logger[_0xb84d('0x9')](_0xb84d('0x15'),_0x44cc34,_0x317e84[_0x4fefa8]);}));}BPromise[_0xb84d('0x16')](_0x20d642)['then'](function(_0x46c15c){var _0x42840c=_[_0xb84d('0x17')](_0x46c15c);logger['info'](_0xb84d('0x18'),_0x44cc34,_0x317e84['join']('\x20|\x20'),_0x42840c);_0x4a0ded['when'](_0x42840c);})[_0xb84d('0xb')](function(_0x32aa47){console[_0xb84d('0x19')](_0x32aa47);logger[_0xb84d('0x9')](_0xb84d('0x18'),_0x44cc34,_0x317e84[_0xb84d('0x1a')](_0xb84d('0x1b')),_0x32aa47[_0xb84d('0x1c')]);_0x4a0ded['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index cb74fd4..b0199fb 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 _0xd3d1=['transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension'];(function(_0x1bd2d7,_0x4979aa){var _0x379bbd=function(_0x40701a){while(--_0x40701a){_0x1bd2d7['push'](_0x1bd2d7['shift']());}};_0x379bbd(++_0x4979aa);}(_0xd3d1,0x172));var _0x1d3d=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xd3d1[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56f01c,_0x2d0605){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x4'),_0x56f01c[_0x1d3d('0x5')],_0x56f01c[_0x1d3d('0x6')],_0x56f01c[_0x1d3d('0x7')],_0x56f01c[_0x1d3d('0x8')],_0x56f01c[_0x1d3d('0x9')],_0x56f01c[_0x1d3d('0xa')],_0x56f01c[_0x1d3d('0xb')],_0x56f01c[_0x1d3d('0xc')]));if(_0x56f01c[_0x1d3d('0x7')]){utils[_0x1d3d('0xd')](_0x56f01c[_0x1d3d('0x7')])[_0x1d3d('0xe')](function(_0x3683c9){if(_0x3683c9){_0x56f01c['type']=_0x3683c9[_0x1d3d('0xf')];_0x56f01c[_0x1d3d('0x10')]=_0x56f01c[_0x1d3d('0x11')]?_0x3683c9[_0x1d3d('0x12')]:![];_0x56f01c[_0x1d3d('0x13')]=_0x56f01c[_0x1d3d('0x10')]?_0x3683c9[_0x1d3d('0x14')]:0x0;}utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);});}else{utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);}if(_0x2d0605){delete transfers[_0x56f01c['uniqueid']];}else{delete agents[_0x56f01c[_0x1d3d('0x17')]];}}exports[_0x1d3d('0x18')]=function(_0x494b82){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x19'),_0x494b82[_0x1d3d('0x5')]),_0x494b82);agents[_0x494b82['destuniqueid']]=_0x494b82;agents[_0x494b82[_0x1d3d('0x17')]]['agentcalledAt']=utils[_0x1d3d('0x1a')]();agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x1b');agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xb')]=null;agents[_0x494b82[_0x1d3d('0x17')]]['connectedlinename']=null;utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x1c'),_0x494b82['uniqueid'],agents[_0x494b82[_0x1d3d('0x17')]]['membername'],_0x494b82[_0x1d3d('0x17')]));}catch(_0x392e92){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][agentcalled]',_0x494b82[_0x1d3d('0x5')]),_0x392e92);}};exports['agentringnoanswer']=function(_0x56c424){try{if(!_[_0x1d3d('0x1e')](agents[_0x56c424[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x56c424);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x21'),_0x56c424[_0x1d3d('0x5')],agents[_0x56c424[_0x1d3d('0x17')]]['membername'],_0x56c424[_0x1d3d('0x17')]));agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswer']=!![];agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswerAt']=utils[_0x1d3d('0x1a')]();agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x23')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x24')]=_0x56c424[_0x1d3d('0x25')]?parseInt(_0x56c424[_0x1d3d('0x25')])/0x3e8:0x0;agents[_0x56c424['destuniqueid']][_0x1d3d('0x26')]=0x0;unanswered['push'](_0x56c424[_0x1d3d('0x17')]);}}catch(_0x2bcc2){utils['error'](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x2bcc2);}};exports[_0x1d3d('0x27')]=function(_0x4abbfc){try{_[_0x1d3d('0x28')](agents,function(_0x235ef3,_0x5d1b6c){if(_0x235ef3[_0x1d3d('0x5')]==_0x4abbfc['uniqueid']&&!_[_0x1d3d('0x29')](unanswered,_0x235ef3[_0x1d3d('0x17')])){utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc[_0x1d3d('0x5')]),_0x4abbfc);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2b'),_0x4abbfc[_0x1d3d('0x5')],_0x235ef3[_0x1d3d('0x8')],_0x235ef3[_0x1d3d('0x17')]));_0x235ef3['agentringnoanswer']=!![];_0x235ef3[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x235ef3[_0x1d3d('0xc')]=_0x1d3d('0x2d');_0x235ef3['reason']='abandoned';_0x235ef3[_0x1d3d('0x24')]=_0x4abbfc[_0x1d3d('0x24')];_0x235ef3['talktime']=0x0;writeDB(_0x235ef3);}});}catch(_0x43ef5d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc['uniqueid']),_0x43ef5d);}};exports['agentconnect']=function(_0x29fa6c){try{if(agents[_0x29fa6c['destuniqueid']]){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c[_0x1d3d('0x5')]),_0x29fa6c);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2f'),_0x29fa6c[_0x1d3d('0x5')],agents[_0x29fa6c['destuniqueid']][_0x1d3d('0x8')],_0x29fa6c['destuniqueid']));agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0x30')]=utils['now']();agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0xb')]=_0x29fa6c[_0x1d3d('0xb')];agents[_0x29fa6c[_0x1d3d('0x17')]]['connectedlinename']=_0x29fa6c['connectedlinename'];agents[_0x29fa6c[_0x1d3d('0x17')]]['holdtime']=_0x29fa6c[_0x1d3d('0x25')];agents[_0x29fa6c[_0x1d3d('0x17')]]['lastevent']=_0x1d3d('0x31');_[_0x1d3d('0x28')](agents,function(_0x51be79,_0x2d5015){if(_0x51be79[_0x1d3d('0x17')]!=_0x29fa6c[_0x1d3d('0x17')]&&_0x51be79[_0x1d3d('0x5')]==_0x29fa6c[_0x1d3d('0x5')]){_0x51be79[_0x1d3d('0x26')]=0x0;_0x51be79['holdtime']=_0x29fa6c[_0x1d3d('0x25')];_0x51be79[_0x1d3d('0x32')]=!![];_0x51be79[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x51be79[_0x1d3d('0xc')]='answered_elsewhere';_0x51be79[_0x1d3d('0x23')]=_0x1d3d('0x33');_0x51be79[_0x1d3d('0x34')]=_0x29fa6c[_0x1d3d('0x17')];_0x51be79['answeredelsewheremembername']=_0x29fa6c[_0x1d3d('0x8')];writeDB(_0x51be79);}});}}catch(_0x977ea8){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c['uniqueid']),_0x977ea8);}};exports['agentcomplete']=function(_0x229f48){try{if(!_[_0x1d3d('0x1e')](agents[_0x229f48[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')]('[%s][agents][agentcomplete]',_0x229f48[_0x1d3d('0x5')]),_0x229f48);utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x35'),_0x229f48[_0x1d3d('0x5')],agents[_0x229f48[_0x1d3d('0x17')]]['membername'],_0x229f48[_0x1d3d('0x17')]));agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x11')]=!![];agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x229f48[_0x1d3d('0x17')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x229f48['destuniqueid']][_0x1d3d('0x36')],agents[_0x229f48[_0x1d3d('0x17')]]['agentconnectAt']);agents[_0x229f48[_0x1d3d('0x17')]]['reason']=_0x229f48[_0x1d3d('0x23')];agents[_0x229f48['destuniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x38');writeDB(agents[_0x229f48[_0x1d3d('0x17')]]);}}catch(_0x25b547){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x39'),_0x229f48[_0x1d3d('0x5')]),_0x25b547);}};exports['blindtransfer']=function(_0x5899cc){try{if(!_['isNil'](agents[_0x5899cc[_0x1d3d('0x3a')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5899cc);utils[_0x1d3d('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5899cc['uniqueid'],agents[_0x5899cc['transfereruniqueid']][_0x1d3d('0x8')],agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')]));agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3c')]=!![];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3d')]=_0x1d3d('0x3e');agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3f')]=_0x5899cc[_0x1d3d('0x40')];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x41')]=agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')];}}catch(_0x5ce0d3){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5ce0d3);}};exports['attendedtransfer']=function(_0x41930f){try{utils['debug'](util['format'](_0x1d3d('0x42'),_0x41930f[_0x1d3d('0x43')]),_0x41930f);if(_0x41930f['origtransfereruniqueid']==_0x41930f[_0x1d3d('0x44')]){if(!_[_0x1d3d('0x1e')](agents[_0x41930f['secondtransfereruniqueid']])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x8')]));agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x46')]]['transfertype']=_0x1d3d('0x47');agents[_0x41930f['secondtransfereruniqueid']]['transferexten']=_0x41930f['origtransfererexten'];agents[_0x41930f['secondtransfereruniqueid']][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x43')];}if(_0x41930f[_0x1d3d('0x48')]&&agents[_0x41930f[_0x1d3d('0x48')]]){agents[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f['transfereeuniqueid']]=_[_0x1d3d('0x4a')](agents[_0x41930f[_0x1d3d('0x48')]]);transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0xa')]=agents[_0x41930f[_0x1d3d('0x46')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x4b')];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4c')]=utils['now']();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x24')]=0x0;transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x2;}}else if(_0x41930f['secondtransfereruniqueid']==_0x41930f[_0x1d3d('0x4d')]){if(!_['isNil'](agents[_0x41930f[_0x1d3d('0x43')]])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x8')]));agents[_0x41930f['origtransfereruniqueid']][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3d')]=_0x1d3d('0x47');agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3f')]=_0x41930f['secondtransfererexten'];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x46')];}if(_0x41930f[_0x1d3d('0x4e')]&&agents[_0x41930f[_0x1d3d('0x4e')]]){agents[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f[_0x1d3d('0x4e')]]=_[_0x1d3d('0x4a')](agents[_0x41930f['transfertargetuniqueid']]);transfers[_0x41930f[_0x1d3d('0x4e')]]['calleridnum']=agents[_0x41930f[_0x1d3d('0x43')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x43')]]['calleridname'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4c')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x4e')]]['holdtime']=0x0;transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x49')]=0x2;}}}catch(_0x37667d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][attendedtransfer]',_0x41930f[_0x1d3d('0x43')]),_0x37667d);}};exports[_0x1d3d('0x4f')]=function(_0x25f4e0){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x25f4e0);if(agents[_0x25f4e0[_0x1d3d('0x5')]]&&agents[_0x25f4e0[_0x1d3d('0x5')]]['reason']===_0x1d3d('0x22')){if(_0x25f4e0[_0x1d3d('0x51')]==='21'){agents[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x52');agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x52');}utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x25f4e0[_0x1d3d('0x5')],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(agents[_0x25f4e0[_0x1d3d('0x5')]]);var _0x4604cc=unanswered[_0x1d3d('0x53')](_0x25f4e0[_0x1d3d('0x5')]);if(_0x4604cc>-0x1){unanswered[_0x1d3d('0x54')](_0x4604cc,0x1);}}if(transfers[_0x25f4e0[_0x1d3d('0x5')]]){transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x11')]=!![];transfers[_0x25f4e0[_0x1d3d('0x5')]]['agentcompleteAt']=utils[_0x1d3d('0x1a')]();transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x26')]=utils['diffTime'](transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x30')]);transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x55');transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]='complete';utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(transfers[_0x25f4e0[_0x1d3d('0x5')]],!![]);}if(agents[_0x25f4e0['uniqueid']]&&agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]){agents[_0x25f4e0[_0x1d3d('0x5')]]['agentcomplete']=!![];agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x25f4e0[_0x1d3d('0x5')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]);agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x23')]=agents[_0x25f4e0['uniqueid']][_0x1d3d('0x3c')]?_0x1d3d('0x3c'):_0x1d3d('0x55');agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]=_0x1d3d('0x38');utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0[_0x1d3d('0x5')]]['lastevent']));writeDB(agents[_0x25f4e0['uniqueid']]);}}catch(_0x49d1e7){utils[_0x1d3d('0x1d')](util['format'](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x49d1e7);}}; \ No newline at end of file +var _0xf45e=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agentcalledAt','ATTENDED','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','ringtime','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','now','connectedlinename','answered_elsewhere','reason','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xf45e,0x115));var _0xef45=function(_0xc67271,_0x13f90a){_0xc67271=_0xc67271-0x0;var _0x48f489=_0xf45e[_0xc67271];return _0x48f489;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var utils=require(_0xef45('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5762da,_0x17b897){utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x4'),_0x5762da[_0xef45('0x5')],_0x5762da[_0xef45('0x6')],_0x5762da[_0xef45('0x7')],_0x5762da[_0xef45('0x8')],_0x5762da[_0xef45('0x9')],_0x5762da[_0xef45('0xa')],_0x5762da[_0xef45('0xb')],_0x5762da[_0xef45('0xc')]));if(_0x5762da[_0xef45('0x7')]){utils[_0xef45('0xd')](_0x5762da[_0xef45('0x7')])[_0xef45('0xe')](function(_0x134c86){if(_0x134c86){_0x5762da[_0xef45('0xf')]=_0x134c86[_0xef45('0xf')];_0x5762da['agentacw']=_0x5762da[_0xef45('0x10')]?_0x134c86[_0xef45('0x11')]:![];_0x5762da[_0xef45('0x12')]=_0x5762da[_0xef45('0x13')]?_0x134c86[_0xef45('0x14')]:0x0;}utils[_0xef45('0x15')]('CreateVoiceAgentReport',_0x5762da);});}else{utils[_0xef45('0x15')](_0xef45('0x16'),_0x5762da);}if(_0x17b897){delete transfers[_0x5762da[_0xef45('0x5')]];}else{delete agents[_0x5762da[_0xef45('0x17')]];}}exports[_0xef45('0x18')]=function(_0x4a6e5c){try{utils['debug'](util[_0xef45('0x3')]('[%s][agents][agentcalled]',_0x4a6e5c[_0xef45('0x5')]),_0x4a6e5c);agents[_0x4a6e5c[_0xef45('0x17')]]=_0x4a6e5c;agents[_0x4a6e5c[_0xef45('0x17')]]['agentcalledAt']=utils['now']();agents[_0x4a6e5c[_0xef45('0x17')]]['lastevent']=_0xef45('0x19');agents[_0x4a6e5c[_0xef45('0x17')]][_0xef45('0xb')]=null;agents[_0x4a6e5c[_0xef45('0x17')]]['connectedlinename']=null;utils['info'](util[_0xef45('0x3')](_0xef45('0x1a'),_0x4a6e5c[_0xef45('0x5')],agents[_0x4a6e5c[_0xef45('0x17')]]['membername'],_0x4a6e5c['destuniqueid']));}catch(_0x2c57fc){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x1c'),_0x4a6e5c[_0xef45('0x5')]),_0x2c57fc);}};exports[_0xef45('0x1d')]=function(_0x375cbd){try{if(!_['isNil'](agents[_0x375cbd[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x1f'),_0x375cbd[_0xef45('0x5')]),_0x375cbd);utils['info'](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x375cbd['uniqueid'],agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x8')],_0x375cbd[_0xef45('0x17')]));agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x1d')]=!![];agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x20')]=utils['now']();agents[_0x375cbd[_0xef45('0x17')]]['lastevent']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['reason']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['holdtime']=_0x375cbd[_0xef45('0x22')]?parseInt(_0x375cbd['ringtime'])/0x3e8:0x0;agents[_0x375cbd['destuniqueid']]['talktime']=0x0;unanswered['push'](_0x375cbd[_0xef45('0x17')]);}}catch(_0x2f72ef){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]',_0x375cbd[_0xef45('0x5')]),_0x2f72ef);}};exports['queuecallerabandon']=function(_0x2525da){try{_['forIn'](agents,function(_0x3e6922,_0x5bfd2d){if(_0x3e6922['uniqueid']==_0x2525da[_0xef45('0x5')]&&!_[_0xef45('0x23')](unanswered,_0x3e6922[_0xef45('0x17')])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da['uniqueid']),_0x2525da);utils['info'](util[_0xef45('0x3')](_0xef45('0x24'),_0x2525da[_0xef45('0x5')],_0x3e6922[_0xef45('0x8')],_0x3e6922[_0xef45('0x17')]));_0x3e6922[_0xef45('0x1d')]=!![];_0x3e6922[_0xef45('0x20')]=utils['now']();_0x3e6922['lastevent']=_0xef45('0x25');_0x3e6922['reason']=_0xef45('0x25');_0x3e6922['holdtime']=_0x2525da[_0xef45('0x26')];_0x3e6922[_0xef45('0x27')]=0x0;writeDB(_0x3e6922);}});}catch(_0x2a7c53){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da[_0xef45('0x5')]),_0x2a7c53);}};exports[_0xef45('0x28')]=function(_0x9df07e){try{if(agents[_0x9df07e['destuniqueid']]){utils['debug'](util[_0xef45('0x3')](_0xef45('0x29'),_0x9df07e['uniqueid']),_0x9df07e);utils[_0xef45('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x9df07e[_0xef45('0x5')],agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x8')],_0x9df07e['destuniqueid']));agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();agents[_0x9df07e[_0xef45('0x17')]]['connectedlinenum']=_0x9df07e['connectedlinenum'];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2c')]=_0x9df07e[_0xef45('0x2c')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0xc')]='connect';_['forIn'](agents,function(_0x13f8b2,_0x35d014){if(_0x13f8b2[_0xef45('0x17')]!=_0x9df07e[_0xef45('0x17')]&&_0x13f8b2[_0xef45('0x5')]==_0x9df07e[_0xef45('0x5')]){_0x13f8b2[_0xef45('0x27')]=0x0;_0x13f8b2[_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];_0x13f8b2[_0xef45('0x1d')]=!![];_0x13f8b2[_0xef45('0x20')]=utils[_0xef45('0x2b')]();_0x13f8b2[_0xef45('0xc')]=_0xef45('0x2d');_0x13f8b2[_0xef45('0x2e')]=_0xef45('0x2d');_0x13f8b2['answeredelsewheredestinationuniqueid']=_0x9df07e[_0xef45('0x17')];_0x13f8b2[_0xef45('0x2f')]=_0x9df07e[_0xef45('0x8')];writeDB(_0x13f8b2);}});}}catch(_0x82c123){utils['error'](util[_0xef45('0x3')]('[%s][agents][agentconnect]',_0x9df07e[_0xef45('0x5')]),_0x82c123);}};exports['agentcomplete']=function(_0x5faf67){try{if(!_[_0xef45('0x30')](agents[_0x5faf67[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x31'),_0x5faf67[_0xef45('0x5')]),_0x5faf67);utils['info'](util[_0xef45('0x3')](_0xef45('0x32'),_0x5faf67[_0xef45('0x5')],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x8')],_0x5faf67[_0xef45('0x17')]));agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x10')]=!![];agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x33')]=utils[_0xef45('0x2b')]();agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x27')]=utils[_0xef45('0x34')](agents[_0x5faf67[_0xef45('0x17')]]['agentcompleteAt'],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x2a')]);agents[_0x5faf67[_0xef45('0x17')]]['reason']=_0x5faf67['reason'];agents[_0x5faf67['destuniqueid']][_0xef45('0xc')]=_0xef45('0x35');writeDB(agents[_0x5faf67[_0xef45('0x17')]]);}}catch(_0x34e9d5){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentcomplete]',_0x5faf67[_0xef45('0x5')]),_0x34e9d5);}};exports[_0xef45('0x36')]=function(_0x2b2419){try{if(!_['isNil'](agents[_0x2b2419['transfereruniqueid']])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][blindtransfer]',_0x2b2419[_0xef45('0x5')]),_0x2b2419);utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x37'),_0x2b2419[_0xef45('0x5')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x8')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')]));agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x39')]=!![];agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x3a')]=_0xef45('0x3b');agents[_0x2b2419['transfereruniqueid']][_0xef45('0x3c')]=_0x2b2419[_0xef45('0x3d')];agents[_0x2b2419[_0xef45('0x38')]]['transferuniqueid']=agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')];}}catch(_0x464bda){utils[_0xef45('0x1b')](util['format'](_0xef45('0x3e'),_0x2b2419[_0xef45('0x5')]),_0x464bda);}};exports[_0xef45('0x3f')]=function(_0x310105){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x310105);if(_0x310105[_0xef45('0x41')]==_0x310105[_0xef45('0x42')]){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x43')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x43')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x43')]]['transfer']=!![];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x3a')]='ATTENDED';agents[_0x310105[_0xef45('0x43')]][_0xef45('0x3c')]=_0x310105[_0xef45('0x45')];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x46')]=_0x310105[_0xef45('0x41')];}if(_0x310105['transfereeuniqueid']&&agents[_0x310105[_0xef45('0x47')]]){agents[_0x310105['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x310105[_0xef45('0x47')]]=_[_0xef45('0x48')](agents[_0x310105[_0xef45('0x47')]]);transfers[_0x310105[_0xef45('0x47')]][_0xef45('0xa')]=agents[_0x310105['secondtransfereruniqueid']][_0xef45('0xa')];transfers[_0x310105[_0xef45('0x47')]]['calleridname']=agents[_0x310105[_0xef45('0x43')]][_0xef45('0x49')];transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105['transfereeuniqueid']][_0xef45('0x26')]=0x0;transfers[_0x310105['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x310105[_0xef45('0x43')]==_0x310105['secondtransfererlinkedid']){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x41')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x41')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x41')]]['transfer']=!![];agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3a')]=_0xef45('0x4b');agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3c')]=_0x310105['secondtransfererexten'];agents[_0x310105[_0xef45('0x41')]]['transferuniqueid']=_0x310105[_0xef45('0x43')];}if(_0x310105[_0xef45('0x4c')]&&agents[_0x310105['transfertargetuniqueid']]){agents[_0x310105[_0xef45('0x4c')]][_0xef45('0x4d')]=0x1;transfers[_0x310105[_0xef45('0x4c')]]=_['clone'](agents[_0x310105['transfertargetuniqueid']]);transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0xa')]=agents[_0x310105[_0xef45('0x41')]]['calleridnum'];transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x49')]=agents[_0x310105['origtransfereruniqueid']][_0xef45('0x49')];transfers[_0x310105['transfertargetuniqueid']][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x26')]=0x0;transfers[_0x310105[_0xef45('0x4c')]]['agententerreason']=0x2;}}}catch(_0x3e6b06){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x3e6b06);}};exports[_0xef45('0x4e')]=function(_0xef7b79){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x4f'),_0xef7b79[_0xef45('0x5')]),_0xef7b79);if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]===_0xef45('0x21')){if(_0xef7b79[_0xef45('0x50')]==='21'){agents[_0xef7b79[_0xef45('0x5')]]['reason']=_0xef45('0x51');agents[_0xef7b79[_0xef45('0x5')]]['lastevent']='rejected';}utils[_0xef45('0x2')](util[_0xef45('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xef7b79['uniqueid'],agents[_0xef7b79['uniqueid']][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]]['reason'],agents[_0xef7b79['uniqueid']][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);var _0x36586a=unanswered[_0xef45('0x52')](_0xef7b79[_0xef45('0x5')]);if(_0x36586a>-0x1){unanswered[_0xef45('0x53')](_0x36586a,0x1);}}if(transfers[_0xef7b79[_0xef45('0x5')]]){transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x10')]=!![];transfers[_0xef7b79['uniqueid']][_0xef45('0x33')]=utils[_0xef45('0x2b')]();transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x27')]=utils[_0xef45('0x34')](transfers[_0xef7b79[_0xef45('0x5')]]['agentcompleteAt'],transfers[_0xef7b79['uniqueid']][_0xef45('0x2a')]);transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=_0xef45('0x54');transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils[_0xef45('0x2')](util['format'](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],transfers[_0xef7b79[_0xef45('0x5')]]['lastevent']));writeDB(transfers[_0xef7b79[_0xef45('0x5')]],!![]);}if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2a')]){agents[_0xef7b79['uniqueid']][_0xef45('0x10')]=!![];agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')]=utils['now']();agents[_0xef7b79[_0xef45('0x5')]]['talktime']=utils[_0xef45('0x34')](agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')],agents[_0xef7b79[_0xef45('0x5')]]['agentconnectAt']);agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=agents[_0xef7b79[_0xef45('0x5')]]['transfer']?_0xef45('0x39'):_0xef45('0x54');agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils['info'](util[_0xef45('0x3')](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);}}catch(_0xd3a51e){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][hangup]',_0xef7b79[_0xef45('0x5')]),_0xd3a51e);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index b938a74..064ea3d 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 _0x65ec=['origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','destination','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','cdr','split','lastIndexOf','includes','noop','gotoif','toLowerCase','[%s][calls][newexten]','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','destinationchannel','answertime','error','[%s][calls][hangup]','callerid','calleridname','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','_attended'];(function(_0x91964a,_0x2dc2f6){var _0x4490b1=function(_0x3ed329){while(--_0x3ed329){_0x91964a['push'](_0x91964a['shift']());}};_0x4490b1(++_0x2dc2f6);}(_0x65ec,0x16c));var _0xc65e=function(_0x469141,_0x5da788){_0x469141=_0x469141-0x0;var _0x2ba73d=_0x65ec[_0x469141];return _0x2ba73d;};'use strict';var _=require(_0xc65e('0x0'));var util=require(_0xc65e('0x1'));var utils=require(_0xc65e('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0xc65e('0x3'),'FAILED',_0xc65e('0x4'),_0xc65e('0x3'),_0xc65e('0x3'),_0xc65e('0x3'),_0xc65e('0x5'),_0xc65e('0x6'),_0xc65e('0x4'),_0xc65e('0x4'),_0xc65e('0x4')];var channels={};function writeDB(_0x5dc54a){var _0x19bc74;if(transfers[_0xc65e('0x7')][_0x5dc54a[_0xc65e('0x8')]]){_0x19bc74=_0x5dc54a[_0xc65e('0x8')];_0x5dc54a[_0xc65e('0x8')]=transfers[_0xc65e('0x7')][_0x5dc54a[_0xc65e('0x8')]]['transfereeuniqueid'];}utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0xb'),_0x5dc54a['uniqueid'],_0x5dc54a[_0xc65e('0xc')],_0x5dc54a['queue'],_0x5dc54a[_0xc65e('0xd')],_0x5dc54a[_0xc65e('0xe')],_0x5dc54a[_0xc65e('0xf')],_0x5dc54a[_0xc65e('0x10')],_0x5dc54a['lastevent']));if(_0x5dc54a[_0xc65e('0x11')]){utils[_0xc65e('0x12')](_0x5dc54a[_0xc65e('0x11')])['then'](function(_0x5e0a0c){if(_0x5e0a0c){_0x5dc54a[_0xc65e('0x13')]=_0x5e0a0c['id'];}utils[_0xc65e('0x14')](_0xc65e('0x15'),_0x5dc54a);});}else{utils[_0xc65e('0x14')](_0xc65e('0x15'),_0x5dc54a);}if(channels[_0x5dc54a[_0xc65e('0x8')]]){delete channels[_0x5dc54a['uniqueid']];}else if(_0x19bc74&&channels[_0x19bc74]){if(!transfers['blinds'][_0x19bc74][_0xc65e('0x16')])delete transfers[_0xc65e('0x7')][_0x19bc74];delete channels[_0x19bc74];}}exports[_0xc65e('0x17')]=function(_0xdbde91){try{utils[_0xc65e('0x18')](util[_0xc65e('0xa')](_0xc65e('0x19'),_0xdbde91[_0xc65e('0x8')]),_0xdbde91);if(_0xdbde91['uniqueid']==_0xdbde91[_0xc65e('0x1a')]&&_0xdbde91[_0xc65e('0xc')]!='OutgoingSpoolFailed'){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x1b'),_0xdbde91[_0xc65e('0x8')],_0xdbde91[_0xc65e('0x1c')],_0xdbde91[_0xc65e('0x1d')]));channels[_0xdbde91['uniqueid']]={'uniqueid':_0xdbde91[_0xc65e('0x8')],'accountcode':_0xdbde91[_0xc65e('0x11')],'source':_0xdbde91[_0xc65e('0xf')],'destination':_0xdbde91[_0xc65e('0x1d')],'destinationcontext':_0xdbde91[_0xc65e('0x1c')],'channel':_0xdbde91[_0xc65e('0xc')],'starttime':utils[_0xc65e('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xc65e('0x3'),'amaflags':_0xc65e('0x1f')};}}catch(_0x3fd1a6){utils['error'](util[_0xc65e('0xa')](_0xc65e('0x19'),_0xdbde91['uniqueid']),_0x3fd1a6);}};exports[_0xc65e('0x20')]=function(_0x110a0f){try{utils[_0xc65e('0x18')](util['format'](_0xc65e('0x21'),_0x110a0f['uniqueid']),_0x110a0f);if(!_[_0xc65e('0x22')](channels[_0x110a0f[_0xc65e('0x8')]])&&_0x110a0f[_0xc65e('0x23')]==0x6){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x24'),_0x110a0f['uniqueid'],_0x110a0f[_0xc65e('0x1c')],_0x110a0f[_0xc65e('0xc')]));if(_[_0xc65e('0x22')](channels[_0x110a0f['uniqueid']]['systemanswertime'])){channels[_0x110a0f[_0xc65e('0x8')]]['systemanswertime']=utils[_0xc65e('0x1e')]();}}else if(!_['isNil'](channels[_0x110a0f[_0xc65e('0x1a')]])&&_0x110a0f[_0xc65e('0x23')]==0x6&&_0x110a0f[_0xc65e('0x1c')]!='transfer'){utils['info'](util[_0xc65e('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x110a0f[_0xc65e('0x8')],_0x110a0f['linkedid'],_0x110a0f[_0xc65e('0x1c')],_0x110a0f[_0xc65e('0xc')]));channels[_0x110a0f[_0xc65e('0x1a')]][_0xc65e('0x11')]=_0x110a0f[_0xc65e('0x11')];channels[_0x110a0f[_0xc65e('0x1a')]][_0xc65e('0x25')]=_0x110a0f[_0xc65e('0xc')];if(_['isNil'](channels[_0x110a0f[_0xc65e('0x1a')]][_0xc65e('0x26')])){channels[_0x110a0f[_0xc65e('0x1a')]][_0xc65e('0x26')]=utils[_0xc65e('0x1e')]();}channels[_0x110a0f[_0xc65e('0x1a')]]['disposition']=dispositions[_['toNumber'](_0x110a0f[_0xc65e('0x23')])]||_0xc65e('0x5');}}catch(_0x1ec3e9){utils[_0xc65e('0x27')](util[_0xc65e('0xa')]('[%s][calls][newstate]',_0x110a0f[_0xc65e('0x8')]),_0x1ec3e9);}};exports['hangup']=function(_0x595357){try{if(!_[_0xc65e('0x22')](channels[_0x595357[_0xc65e('0x8')]])){utils[_0xc65e('0x18')](util['format'](_0xc65e('0x28'),_0x595357[_0xc65e('0x8')]),_0x595357);if(_['isNil'](channels[_0x595357[_0xc65e('0x8')]]['callerid'])){channels[_0x595357['uniqueid']][_0xc65e('0x29')]=_0x595357[_0xc65e('0x2a')]+'\x20<'+_0x595357[_0xc65e('0xf')]+'>';}utils[_0xc65e('0x9')](util[_0xc65e('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x595357[_0xc65e('0x8')],channels[_0x595357['uniqueid']]['callerid'],_0x595357['cause-txt']));channels[_0x595357[_0xc65e('0x8')]][_0xc65e('0x2b')]=utils[_0xc65e('0x1e')]();channels[_0x595357[_0xc65e('0x8')]][_0xc65e('0x2c')]=utils[_0xc65e('0x2d')](channels[_0x595357[_0xc65e('0x8')]][_0xc65e('0x2b')],channels[_0x595357['uniqueid']][_0xc65e('0x2e')]);channels[_0x595357[_0xc65e('0x8')]][_0xc65e('0x2f')]=channels[_0x595357[_0xc65e('0x8')]][_0xc65e('0x26')]?utils[_0xc65e('0x2d')](channels[_0x595357[_0xc65e('0x8')]][_0xc65e('0x2b')],channels[_0x595357['uniqueid']][_0xc65e('0x26')]):0x0;writeDB(channels[_0x595357[_0xc65e('0x8')]]);}}catch(_0x427d6d){utils['error'](util[_0xc65e('0xa')](_0xc65e('0x28'),_0x595357[_0xc65e('0x8')]),_0x427d6d);}};exports['attendedtransfer']=function(_0x12e432){try{if(!_[_0xc65e('0x22')](channels[_0x12e432['localtwolinkedid']])){utils[_0xc65e('0x18')](util[_0xc65e('0xa')](_0xc65e('0x30'),_0x12e432[_0xc65e('0x31')]),_0x12e432);if(channels[_0x12e432['localtwolinkedid']]['channel']==_0x12e432[_0xc65e('0x32')]){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x33'),_0x12e432[_0xc65e('0x31')],_0x12e432[_0xc65e('0x34')],_0x12e432[_0xc65e('0x35')]));channels[_0x12e432['localtwolinkedid']]['destinationchannel']=_0x12e432[_0xc65e('0x35')];channels[_0x12e432[_0xc65e('0x34')]][_0xc65e('0x36')]=_0xc65e('0x37');}else if(channels[_0x12e432[_0xc65e('0x34')]][_0xc65e('0xc')]=_0x12e432['transfertargetchannel']){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x33'),_0x12e432['origtransfereruniqueid'],_0x12e432['localtwolinkedid'],_0x12e432[_0xc65e('0x38')]));channels[_0x12e432['localtwolinkedid']][_0xc65e('0x25')]=_0x12e432[_0xc65e('0x38')];channels[_0x12e432[_0xc65e('0x34')]][_0xc65e('0x36')]=_0xc65e('0x37');}}}catch(_0x3755b5){utils['error'](util['format'](_0xc65e('0x30'),_0x12e432[_0xc65e('0x31')]),_0x3755b5);}};exports['musiconholdstart']=function(_0x4a0888){try{if(!_[_0xc65e('0x22')](channels[_0x4a0888[_0xc65e('0x8')]])){utils[_0xc65e('0x18')](util[_0xc65e('0xa')](_0xc65e('0x39'),_0x4a0888['uniqueid']),_0x4a0888);channels[_0x4a0888[_0xc65e('0x8')]][_0xc65e('0x3a')]=utils['now']();utils[_0xc65e('0x9')](util[_0xc65e('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4a0888[_0xc65e('0x8')],channels[_0x4a0888[_0xc65e('0x8')]]['musiconholdstartAt']));}}catch(_0x5d6cab){utils[_0xc65e('0x27')](util[_0xc65e('0xa')]('[%s][calls][musiconholdstart]',_0x4a0888[_0xc65e('0x8')]),_0x5d6cab);}};exports[_0xc65e('0x3b')]=function(_0x23a228){try{if(!_[_0xc65e('0x22')](channels[_0x23a228['uniqueid']])){utils[_0xc65e('0x18')](util['format'](_0xc65e('0x3c'),_0x23a228[_0xc65e('0x8')]),_0x23a228);if(!_[_0xc65e('0x22')](channels[_0x23a228[_0xc65e('0x8')]]['musiconholdstartAt'])){channels[_0x23a228['uniqueid']][_0xc65e('0x3d')]+=utils[_0xc65e('0x2d')](utils[_0xc65e('0x1e')](),channels[_0x23a228[_0xc65e('0x8')]][_0xc65e('0x3a')]);utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x3e'),_0x23a228[_0xc65e('0x8')],channels[_0x23a228['uniqueid']][_0xc65e('0x3d')]));delete channels[_0x23a228[_0xc65e('0x8')]][_0xc65e('0x3a')];}}}catch(_0x5b6563){utils[_0xc65e('0x27')](util[_0xc65e('0xa')](_0xc65e('0x3c'),_0x23a228['uniqueid']),_0x5b6563);}};exports[_0xc65e('0x3f')]=function(_0x41a835){try{if(!_['isNil'](channels[_0x41a835[_0xc65e('0x8')]])){utils[_0xc65e('0x18')](util['format']('[%s][calls][varset]',_0x41a835[_0xc65e('0x8')]),_0x41a835);if(!_[_0xc65e('0x22')](_0x41a835['variable'][_0xc65e('0x40')])){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x41'),_0x41a835[_0xc65e('0x8')],_0x41a835[_0xc65e('0x42')]));channels[_0x41a835[_0xc65e('0x8')]]['source']=_0x41a835[_0xc65e('0x42')];}if(!_[_0xc65e('0x22')](_0x41a835['variable'][_0xc65e('0x43')])){utils[_0xc65e('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x41a835[_0xc65e('0x8')],_0x41a835['value']));channels[_0x41a835['uniqueid']][_0xc65e('0x44')]=_0x41a835[_0xc65e('0x42')];channels[_0x41a835[_0xc65e('0x8')]]['callerid']='\x22'+_0x41a835[_0xc65e('0x42')]+_0xc65e('0x45')+_0x41a835[_0xc65e('0x42')]+'>';}if(!_[_0xc65e('0x22')](_0x41a835[_0xc65e('0x46')][_0xc65e('0x47')])||!_[_0xc65e('0x22')](_0x41a835['variable'][_0xc65e('0x48')])){utils[_0xc65e('0x9')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x41a835[_0xc65e('0x8')],!_['isNil'](_0x41a835['variable'][_0xc65e('0x47')])?_0xc65e('0x47'):_0xc65e('0x48'),_0x41a835[_0xc65e('0x42')]));channels[_0x41a835[_0xc65e('0x8')]][_0xc65e('0x29')]=_0x41a835[_0xc65e('0x42')];}if(!_['isNil'](_0x41a835[_0xc65e('0x46')]['xmd-queue'])||!_[_0xc65e('0x22')](_0x41a835[_0xc65e('0x46')][_0xc65e('0x49')])){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x4a'),_0x41a835[_0xc65e('0x8')],!_['isNil'](_0x41a835[_0xc65e('0x46')][_0xc65e('0x4b')])?_0xc65e('0x4b'):'xmcs-queue',_0x41a835[_0xc65e('0x42')]));channels[_0x41a835['uniqueid']][_0xc65e('0x4c')]=_0xc65e('0x4d');channels[_0x41a835[_0xc65e('0x8')]][_0xc65e('0x4e')]=_0x41a835[_0xc65e('0x42')];channels[_0x41a835[_0xc65e('0x8')]][_0xc65e('0x4f')]=!![];}if(!_[_0xc65e('0x22')](_0x41a835[_0xc65e('0x46')][_0xc65e('0x50')])){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x51'),_0x41a835[_0xc65e('0x8')],_0x41a835[_0xc65e('0x42')]));channels[_0x41a835[_0xc65e('0x8')]][_0xc65e('0x52')]=_0x41a835[_0xc65e('0x42')];}if(!_[_0xc65e('0x22')](_0x41a835[_0xc65e('0x46')][_0xc65e('0x53')])){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x54'),_0x41a835[_0xc65e('0x8')],_0x41a835[_0xc65e('0x42')]));channels[_0x41a835[_0xc65e('0x8')]][_0xc65e('0x55')]=_0x41a835[_0xc65e('0x42')];}if(!_['isNil'](_0x41a835[_0xc65e('0x46')][_0xc65e('0x56')])){utils[_0xc65e('0x9')](util['format'](_0xc65e('0x57'),_0x41a835['uniqueid'],_0x41a835[_0xc65e('0x42')]));channels[_0x41a835[_0xc65e('0x8')]][_0xc65e('0x58')]=_0x41a835['value'];}if(!_[_0xc65e('0x22')](_0x41a835['variable'][_0xc65e('0x59')])){utils[_0xc65e('0x9')](util[_0xc65e('0xa')](_0xc65e('0x5a'),_0x41a835[_0xc65e('0x8')],_0x41a835['value']));channels[_0x41a835[_0xc65e('0x8')]][_0xc65e('0x59')]=_0x41a835[_0xc65e('0x42')];}}}catch(_0x316a8a){utils[_0xc65e('0x27')](util['format']('[%s][calls][varset]',_0x41a835[_0xc65e('0x8')]),_0x316a8a);}};exports[_0xc65e('0x5b')]=function(_0xbaba99){try{if(!_[_0xc65e('0x22')](channels[_0xbaba99['uniqueid']])){utils[_0xc65e('0x18')](util['format']('[%s][calls][newexten]',_0xbaba99['uniqueid']),_0xbaba99);utils[_0xc65e('0x9')](util['format'](_0xc65e('0x5c'),_0xbaba99[_0xc65e('0x8')],_0xbaba99[_0xc65e('0x5d')],_0xbaba99['appdata']));if(_0xbaba99[_0xc65e('0x5d')]['toLowerCase']()==_0xc65e('0x5e')&&_[_0xc65e('0x5f')](_0xbaba99[_0xc65e('0x60')]['toLowerCase'](),_0xc65e('0x61'))){var _0x352724=_0xbaba99[_0xc65e('0x60')][_0xc65e('0x62')]('=');var _0xeeb55e=_0x352724[0x0]['substring'](_0x352724[0x0]['lastIndexOf']('(')+0x1,_0x352724[0x0][_0xc65e('0x63')](')'));var _0x5a1237=_0x352724[0x1];channels[_0xbaba99[_0xc65e('0x8')]][_0xeeb55e]=_0x5a1237;}if(!_[_0xc65e('0x64')](['hangup',_0xc65e('0x65'),'execif','set',_0xc65e('0x66')],_0xbaba99[_0xc65e('0x5d')][_0xc65e('0x67')]())){channels[_0xbaba99[_0xc65e('0x8')]][_0xc65e('0x4c')]=_0xbaba99[_0xc65e('0x5d')];channels[_0xbaba99['uniqueid']]['lastdata']=_0xbaba99[_0xc65e('0x60')];}}}catch(_0x3212b8){utils[_0xc65e('0x27')](util[_0xc65e('0xa')](_0xc65e('0x68'),_0xbaba99[_0xc65e('0x8')]),_0x3212b8);}}; \ No newline at end of file +var _0x0837=['mohtime','varset','variable','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','substring','lastIndexOf','includes','hangup','noop','execif','toLowerCase','[%s][calls][newexten]','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','isNil','channelstate','info','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s'];(function(_0x52e613,_0xb74034){var _0x5e39f2=function(_0x35e469){while(--_0x35e469){_0x52e613['push'](_0x52e613['shift']());}};_0x5e39f2(++_0xb74034);}(_0x0837,0x1db));var _0x7083=function(_0x248495,_0x57ba62){_0x248495=_0x248495-0x0;var _0x5769a6=_0x0837[_0x248495];return _0x5769a6;};'use strict';var _=require(_0x7083('0x0'));var util=require(_0x7083('0x1'));var utils=require(_0x7083('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x7083('0x3'),_0x7083('0x4'),_0x7083('0x4'),_0x7083('0x3'),_0x7083('0x3'),_0x7083('0x3'),_0x7083('0x5'),_0x7083('0x6'),_0x7083('0x4'),'FAILED',_0x7083('0x4')];var channels={};function writeDB(_0x6bff72){var _0x12ccdd;if(transfers[_0x7083('0x7')][_0x6bff72[_0x7083('0x8')]]){_0x12ccdd=_0x6bff72[_0x7083('0x8')];_0x6bff72[_0x7083('0x8')]=transfers[_0x7083('0x7')][_0x6bff72[_0x7083('0x8')]][_0x7083('0x9')];}utils['info'](util['format'](_0x7083('0xa'),_0x6bff72['uniqueid'],_0x6bff72[_0x7083('0xb')],_0x6bff72['queue'],_0x6bff72[_0x7083('0xc')],_0x6bff72[_0x7083('0xd')],_0x6bff72[_0x7083('0xe')],_0x6bff72['connectedlinenum'],_0x6bff72['lastevent']));if(_0x6bff72[_0x7083('0xf')]){utils['getUserByInternal'](_0x6bff72[_0x7083('0xf')])[_0x7083('0x10')](function(_0x51190d){if(_0x51190d){_0x6bff72[_0x7083('0x11')]=_0x51190d['id'];}utils[_0x7083('0x12')](_0x7083('0x13'),_0x6bff72);});}else{utils['request'](_0x7083('0x13'),_0x6bff72);}if(channels[_0x6bff72['uniqueid']]){delete channels[_0x6bff72[_0x7083('0x8')]];}else if(_0x12ccdd&&channels[_0x12ccdd]){if(!transfers[_0x7083('0x7')][_0x12ccdd][_0x7083('0x14')])delete transfers[_0x7083('0x7')][_0x12ccdd];delete channels[_0x12ccdd];}}exports[_0x7083('0x15')]=function(_0x29b973){try{utils[_0x7083('0x16')](util[_0x7083('0x17')](_0x7083('0x18'),_0x29b973['uniqueid']),_0x29b973);if(_0x29b973['uniqueid']==_0x29b973[_0x7083('0x19')]&&_0x29b973[_0x7083('0xb')]!=_0x7083('0x1a')){utils['info'](util[_0x7083('0x17')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x29b973[_0x7083('0x8')],_0x29b973[_0x7083('0x1b')],_0x29b973[_0x7083('0x1c')]));channels[_0x29b973[_0x7083('0x8')]]={'uniqueid':_0x29b973[_0x7083('0x8')],'accountcode':_0x29b973['accountcode'],'source':_0x29b973['calleridnum'],'destination':_0x29b973[_0x7083('0x1c')],'destinationcontext':_0x29b973[_0x7083('0x1b')],'channel':_0x29b973[_0x7083('0xb')],'starttime':utils[_0x7083('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7083('0x3'),'amaflags':_0x7083('0x1e')};}}catch(_0x4749c3){utils[_0x7083('0x1f')](util[_0x7083('0x17')](_0x7083('0x18'),_0x29b973[_0x7083('0x8')]),_0x4749c3);}};exports['newstate']=function(_0x51c1bd){try{utils[_0x7083('0x16')](util[_0x7083('0x17')]('[%s][calls][newstate]',_0x51c1bd[_0x7083('0x8')]),_0x51c1bd);if(!_[_0x7083('0x20')](channels[_0x51c1bd[_0x7083('0x8')]])&&_0x51c1bd[_0x7083('0x21')]==0x6){utils[_0x7083('0x22')](util[_0x7083('0x17')](_0x7083('0x23'),_0x51c1bd['uniqueid'],_0x51c1bd[_0x7083('0x1b')],_0x51c1bd[_0x7083('0xb')]));if(_[_0x7083('0x20')](channels[_0x51c1bd[_0x7083('0x8')]][_0x7083('0x24')])){channels[_0x51c1bd[_0x7083('0x8')]][_0x7083('0x24')]=utils[_0x7083('0x1d')]();}}else if(!_[_0x7083('0x20')](channels[_0x51c1bd[_0x7083('0x19')]])&&_0x51c1bd['channelstate']==0x6&&_0x51c1bd[_0x7083('0x1b')]!=_0x7083('0x25')){utils[_0x7083('0x22')](util[_0x7083('0x17')](_0x7083('0x26'),_0x51c1bd[_0x7083('0x8')],_0x51c1bd['linkedid'],_0x51c1bd[_0x7083('0x1b')],_0x51c1bd['channel']));channels[_0x51c1bd[_0x7083('0x19')]][_0x7083('0xf')]=_0x51c1bd[_0x7083('0xf')];channels[_0x51c1bd[_0x7083('0x19')]][_0x7083('0x27')]=_0x51c1bd[_0x7083('0xb')];if(_['isNil'](channels[_0x51c1bd[_0x7083('0x19')]][_0x7083('0x28')])){channels[_0x51c1bd[_0x7083('0x19')]]['answertime']=utils[_0x7083('0x1d')]();}channels[_0x51c1bd[_0x7083('0x19')]][_0x7083('0x29')]=dispositions[_[_0x7083('0x2a')](_0x51c1bd['channelstate'])]||_0x7083('0x5');}}catch(_0x1a2a63){utils[_0x7083('0x1f')](util[_0x7083('0x17')](_0x7083('0x2b'),_0x51c1bd[_0x7083('0x8')]),_0x1a2a63);}};exports['hangup']=function(_0x100fcb){try{if(!_[_0x7083('0x20')](channels[_0x100fcb[_0x7083('0x8')]])){utils[_0x7083('0x16')](util[_0x7083('0x17')]('[%s][calls][hangup]',_0x100fcb[_0x7083('0x8')]),_0x100fcb);if(_['isNil'](channels[_0x100fcb['uniqueid']][_0x7083('0x2c')])){channels[_0x100fcb[_0x7083('0x8')]]['callerid']=_0x100fcb[_0x7083('0x2d')]+'\x20<'+_0x100fcb[_0x7083('0xe')]+'>';}utils['info'](util['format'](_0x7083('0x2e'),_0x100fcb[_0x7083('0x8')],channels[_0x100fcb[_0x7083('0x8')]][_0x7083('0x2c')],_0x100fcb['cause-txt']));channels[_0x100fcb[_0x7083('0x8')]][_0x7083('0x2f')]=utils[_0x7083('0x1d')]();channels[_0x100fcb[_0x7083('0x8')]][_0x7083('0x30')]=utils[_0x7083('0x31')](channels[_0x100fcb[_0x7083('0x8')]]['endtime'],channels[_0x100fcb[_0x7083('0x8')]][_0x7083('0x32')]);channels[_0x100fcb[_0x7083('0x8')]]['billableseconds']=channels[_0x100fcb[_0x7083('0x8')]][_0x7083('0x28')]?utils[_0x7083('0x31')](channels[_0x100fcb[_0x7083('0x8')]][_0x7083('0x2f')],channels[_0x100fcb['uniqueid']][_0x7083('0x28')]):0x0;writeDB(channels[_0x100fcb[_0x7083('0x8')]]);}}catch(_0x3812e7){utils[_0x7083('0x1f')](util[_0x7083('0x17')](_0x7083('0x33'),_0x100fcb[_0x7083('0x8')]),_0x3812e7);}};exports[_0x7083('0x34')]=function(_0x2fe6bd){try{if(!_['isNil'](channels[_0x2fe6bd[_0x7083('0x35')]])){utils[_0x7083('0x16')](util[_0x7083('0x17')](_0x7083('0x36'),_0x2fe6bd[_0x7083('0x37')]),_0x2fe6bd);if(channels[_0x2fe6bd[_0x7083('0x35')]]['channel']==_0x2fe6bd[_0x7083('0x38')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2fe6bd['origtransfereruniqueid'],_0x2fe6bd[_0x7083('0x35')],_0x2fe6bd[_0x7083('0x39')]));channels[_0x2fe6bd[_0x7083('0x35')]][_0x7083('0x27')]=_0x2fe6bd['secondtransfererchannel'];channels[_0x2fe6bd[_0x7083('0x35')]][_0x7083('0x3a')]=_0x7083('0x3b');}else if(channels[_0x2fe6bd[_0x7083('0x35')]][_0x7083('0xb')]=_0x2fe6bd[_0x7083('0x3c')]){utils['info'](util[_0x7083('0x17')](_0x7083('0x3d'),_0x2fe6bd[_0x7083('0x37')],_0x2fe6bd[_0x7083('0x35')],_0x2fe6bd[_0x7083('0x3e')]));channels[_0x2fe6bd['localtwolinkedid']][_0x7083('0x27')]=_0x2fe6bd[_0x7083('0x3e')];channels[_0x2fe6bd['localtwolinkedid']][_0x7083('0x3a')]=_0x7083('0x3b');}}}catch(_0x5e332a){utils[_0x7083('0x1f')](util[_0x7083('0x17')](_0x7083('0x36'),_0x2fe6bd[_0x7083('0x37')]),_0x5e332a);}};exports[_0x7083('0x3f')]=function(_0x297b36){try{if(!_[_0x7083('0x20')](channels[_0x297b36[_0x7083('0x8')]])){utils[_0x7083('0x16')](util[_0x7083('0x17')](_0x7083('0x40'),_0x297b36[_0x7083('0x8')]),_0x297b36);channels[_0x297b36['uniqueid']][_0x7083('0x41')]=utils['now']();utils[_0x7083('0x22')](util[_0x7083('0x17')](_0x7083('0x42'),_0x297b36[_0x7083('0x8')],channels[_0x297b36[_0x7083('0x8')]][_0x7083('0x41')]));}}catch(_0x19bf42){utils[_0x7083('0x1f')](util[_0x7083('0x17')](_0x7083('0x40'),_0x297b36['uniqueid']),_0x19bf42);}};exports[_0x7083('0x43')]=function(_0x365f2a){try{if(!_[_0x7083('0x20')](channels[_0x365f2a['uniqueid']])){utils[_0x7083('0x16')](util[_0x7083('0x17')](_0x7083('0x44'),_0x365f2a[_0x7083('0x8')]),_0x365f2a);if(!_[_0x7083('0x20')](channels[_0x365f2a[_0x7083('0x8')]][_0x7083('0x41')])){channels[_0x365f2a[_0x7083('0x8')]]['mohtime']+=utils[_0x7083('0x31')](utils[_0x7083('0x1d')](),channels[_0x365f2a[_0x7083('0x8')]][_0x7083('0x41')]);utils[_0x7083('0x22')](util[_0x7083('0x17')](_0x7083('0x45'),_0x365f2a['uniqueid'],channels[_0x365f2a[_0x7083('0x8')]][_0x7083('0x46')]));delete channels[_0x365f2a[_0x7083('0x8')]][_0x7083('0x41')];}}}catch(_0xf6782b){utils[_0x7083('0x1f')](util[_0x7083('0x17')]('[%s][calls][musiconholdstop]',_0x365f2a['uniqueid']),_0xf6782b);}};exports[_0x7083('0x47')]=function(_0x50491d){try{if(!_[_0x7083('0x20')](channels[_0x50491d[_0x7083('0x8')]])){utils[_0x7083('0x16')](util[_0x7083('0x17')]('[%s][calls][varset]',_0x50491d[_0x7083('0x8')]),_0x50491d);if(!_[_0x7083('0x20')](_0x50491d[_0x7083('0x48')]['xmd-originatecalleridnum'])){utils[_0x7083('0x22')](util[_0x7083('0x17')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x50491d['uniqueid'],_0x50491d[_0x7083('0x49')]));channels[_0x50491d[_0x7083('0x8')]]['source']=_0x50491d[_0x7083('0x49')];}if(!_[_0x7083('0x20')](_0x50491d['variable'][_0x7083('0x4a')])){utils['info'](util[_0x7083('0x17')](_0x7083('0x4b'),_0x50491d[_0x7083('0x8')],_0x50491d[_0x7083('0x49')]));channels[_0x50491d[_0x7083('0x8')]][_0x7083('0x4c')]=_0x50491d[_0x7083('0x49')];channels[_0x50491d[_0x7083('0x8')]][_0x7083('0x2c')]='\x22'+_0x50491d[_0x7083('0x49')]+_0x7083('0x4d')+_0x50491d[_0x7083('0x49')]+'>';}if(!_[_0x7083('0x20')](_0x50491d[_0x7083('0x48')][_0x7083('0x4e')])||!_[_0x7083('0x20')](_0x50491d[_0x7083('0x48')]['xmd-callerid'])){utils['info'](util['format'](_0x7083('0x4f'),_0x50491d[_0x7083('0x8')],!_['isNil'](_0x50491d['variable'][_0x7083('0x4e')])?_0x7083('0x4e'):_0x7083('0x50'),_0x50491d[_0x7083('0x49')]));channels[_0x50491d[_0x7083('0x8')]][_0x7083('0x2c')]=_0x50491d[_0x7083('0x49')];}if(!_['isNil'](_0x50491d[_0x7083('0x48')][_0x7083('0x51')])||!_[_0x7083('0x20')](_0x50491d[_0x7083('0x48')][_0x7083('0x52')])){utils[_0x7083('0x22')](util[_0x7083('0x17')](_0x7083('0x4f'),_0x50491d[_0x7083('0x8')],!_[_0x7083('0x20')](_0x50491d[_0x7083('0x48')][_0x7083('0x51')])?'xmd-queue':_0x7083('0x52'),_0x50491d[_0x7083('0x49')]));channels[_0x50491d['uniqueid']][_0x7083('0x53')]=_0x7083('0x54');channels[_0x50491d[_0x7083('0x8')]][_0x7083('0x55')]=_0x50491d[_0x7083('0x49')];channels[_0x50491d[_0x7083('0x8')]][_0x7083('0x56')]=!![];}if(!_[_0x7083('0x20')](_0x50491d[_0x7083('0x48')][_0x7083('0x57')])){utils[_0x7083('0x22')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x50491d[_0x7083('0x8')],_0x50491d[_0x7083('0x49')]));channels[_0x50491d[_0x7083('0x8')]][_0x7083('0x58')]=_0x50491d[_0x7083('0x49')];}if(!_[_0x7083('0x20')](_0x50491d[_0x7083('0x48')][_0x7083('0x59')])){utils[_0x7083('0x22')](util[_0x7083('0x17')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x50491d[_0x7083('0x8')],_0x50491d[_0x7083('0x49')]));channels[_0x50491d[_0x7083('0x8')]][_0x7083('0x5a')]=_0x50491d[_0x7083('0x49')];}if(!_[_0x7083('0x20')](_0x50491d[_0x7083('0x48')][_0x7083('0x5b')])){utils[_0x7083('0x22')](util[_0x7083('0x17')](_0x7083('0x5c'),_0x50491d[_0x7083('0x8')],_0x50491d[_0x7083('0x49')]));channels[_0x50491d['uniqueid']]['routeid']=_0x50491d[_0x7083('0x49')];}if(!_[_0x7083('0x20')](_0x50491d['variable']['sipcallid'])){utils[_0x7083('0x22')](util[_0x7083('0x17')](_0x7083('0x5d'),_0x50491d[_0x7083('0x8')],_0x50491d[_0x7083('0x49')]));channels[_0x50491d[_0x7083('0x8')]][_0x7083('0x5e')]=_0x50491d[_0x7083('0x49')];}}}catch(_0x4be3ab){utils[_0x7083('0x1f')](util[_0x7083('0x17')]('[%s][calls][varset]',_0x50491d['uniqueid']),_0x4be3ab);}};exports[_0x7083('0x5f')]=function(_0x48ccfa){try{if(!_[_0x7083('0x20')](channels[_0x48ccfa[_0x7083('0x8')]])){utils[_0x7083('0x16')](util['format']('[%s][calls][newexten]',_0x48ccfa['uniqueid']),_0x48ccfa);utils['info'](util[_0x7083('0x17')](_0x7083('0x60'),_0x48ccfa['uniqueid'],_0x48ccfa[_0x7083('0x61')],_0x48ccfa[_0x7083('0x62')]));if(_0x48ccfa[_0x7083('0x61')]['toLowerCase']()==_0x7083('0x63')&&_[_0x7083('0x64')](_0x48ccfa[_0x7083('0x62')]['toLowerCase'](),'cdr')){var _0x395d0e=_0x48ccfa['appdata']['split']('=');var _0xb576b7=_0x395d0e[0x0][_0x7083('0x65')](_0x395d0e[0x0][_0x7083('0x66')]('(')+0x1,_0x395d0e[0x0]['lastIndexOf'](')'));var _0x41872d=_0x395d0e[0x1];channels[_0x48ccfa['uniqueid']][_0xb576b7]=_0x41872d;}if(!_[_0x7083('0x67')]([_0x7083('0x68'),_0x7083('0x69'),_0x7083('0x6a'),_0x7083('0x63'),'gotoif'],_0x48ccfa['application'][_0x7083('0x6b')]())){channels[_0x48ccfa[_0x7083('0x8')]][_0x7083('0x53')]=_0x48ccfa[_0x7083('0x61')];channels[_0x48ccfa['uniqueid']][_0x7083('0x55')]=_0x48ccfa['appdata'];}}}catch(_0x4a3d09){utils[_0x7083('0x1f')](util[_0x7083('0x17')](_0x7083('0x6c'),_0x48ccfa[_0x7083('0x8')]),_0x4a3d09);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 5e0ca7d..ad29edb 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 _0xe0e9=['info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils','connect'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xe0e9,0x9a));var _0x9e0e=function(_0x15bd5e,_0x5d50b0){_0x15bd5e=_0x15bd5e-0x0;var _0x482d20=_0xe0e9[_0x15bd5e];return _0x482d20;};'use strict';var utils=require(_0x9e0e('0x0'));exports[_0x9e0e('0x1')]=function(){utils[_0x9e0e('0x2')](_0x9e0e('0x3'));};exports[_0x9e0e('0x4')]=function(){utils[_0x9e0e('0x2')](_0x9e0e('0x5'));};exports[_0x9e0e('0x6')]=function(){utils[_0x9e0e('0x2')](_0x9e0e('0x7'));};exports['error']=function(_0x4d8399){utils[_0x9e0e('0x8')](_0x9e0e('0x9'),_0x4d8399);};exports[_0x9e0e('0xa')]=function(){utils[_0x9e0e('0x2')](_0x9e0e('0xb'));};exports['managerevent']=function(_0x555947){}; \ No newline at end of file +var _0x47c8=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','info','[core]\x20connected'];(function(_0xfc28ad,_0x5f2924){var _0x2ab04a=function(_0x161f3b){while(--_0x161f3b){_0xfc28ad['push'](_0xfc28ad['shift']());}};_0x2ab04a(++_0x5f2924);}(_0x47c8,0x1cc));var _0x847c=function(_0x17ea2e,_0x30f79f){_0x17ea2e=_0x17ea2e-0x0;var _0x5aef45=_0x47c8[_0x17ea2e];return _0x5aef45;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x847c('0x0')](_0x847c('0x1'));};exports[_0x847c('0x2')]=function(){utils[_0x847c('0x0')](_0x847c('0x3'));};exports[_0x847c('0x4')]=function(){utils['info'](_0x847c('0x5'));};exports[_0x847c('0x6')]=function(_0x240bf0){utils[_0x847c('0x6')](_0x847c('0x7'),_0x240bf0);};exports[_0x847c('0x8')]=function(){utils['info'](_0x847c('0x9'));};exports[_0x847c('0xa')]=function(_0x1a803a){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index a13b5a7..b58514b 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 _0x3cb0=['format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','appdata','application','toLowerCase','set','startsWith','split','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','info','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils'];(function(_0x5165c9,_0x484237){var _0x1477ea=function(_0x2681da){while(--_0x2681da){_0x5165c9['push'](_0x5165c9['shift']());}};_0x1477ea(++_0x484237);}(_0x3cb0,0xf2));var _0x03cb=function(_0x1c98dd,_0x314f9e){_0x1c98dd=_0x1c98dd-0x0;var _0x23b146=_0x3cb0[_0x1c98dd];return _0x23b146;};'use strict';var _=require(_0x03cb('0x0'));var util=require(_0x03cb('0x1'));var utils=require(_0x03cb('0x2'));var dials={};function writeDB(_0x402524){utils['info'](util[_0x03cb('0x3')](_0x03cb('0x4'),_0x402524[_0x03cb('0x5')],_0x402524[_0x03cb('0x6')],_0x402524['dialstring'],_0x402524['calleridnum'],_0x402524['connectedlinenum'],_0x402524[_0x03cb('0x7')]));utils[_0x03cb('0x8')](_0x03cb('0x9'),_0x402524);delete dials[_0x402524[_0x03cb('0x5')]];}exports['newexten']=function(_0x5927b1){try{utils[_0x03cb('0xa')](util['format'](_0x03cb('0xb'),_0x5927b1['uniqueid']),_0x5927b1);utils['info'](util[_0x03cb('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x5927b1[_0x03cb('0x5')],_0x5927b1['application'],_0x5927b1[_0x03cb('0xc')]));if(_0x5927b1[_0x03cb('0xd')][_0x03cb('0xe')]()==_0x03cb('0xf')&&_[_0x03cb('0x10')](_0x5927b1[_0x03cb('0xc')][_0x03cb('0xe')](),'cdr(routeid)')){var _0x3d38f3=_0x5927b1[_0x03cb('0xc')][_0x03cb('0x11')]('=');dials[_0x5927b1[_0x03cb('0x5')]]={'routeId':_0x3d38f3[0x1]};}}catch(_0x27bffc){utils[_0x03cb('0x12')](util['format']('[%s][dials][newexten]',_0x5927b1[_0x03cb('0x5')]),_0x27bffc);}};exports[_0x03cb('0x13')]=function(_0xd6473d){try{utils[_0x03cb('0xa')](util[_0x03cb('0x3')]('[%s][dials][varset]',_0xd6473d['uniqueid']),_0xd6473d);if(!_[_0x03cb('0x14')](_0xd6473d[_0x03cb('0x15')][_0x03cb('0x16')])){utils['info'](util[_0x03cb('0x3')](_0x03cb('0x17'),_0xd6473d[_0x03cb('0x5')],_0xd6473d[_0x03cb('0x18')]));dials[_0xd6473d['uniqueid']]={'routeId':_0xd6473d[_0x03cb('0x18')]};}}catch(_0x1f745a){utils[_0x03cb('0x12')](util[_0x03cb('0x3')]('[%s][dials][varset]',_0xd6473d[_0x03cb('0x5')]),_0x1f745a);}};exports[_0x03cb('0x19')]=function(_0x3bbf75){try{if(!_[_0x03cb('0x14')](dials[_0x3bbf75[_0x03cb('0x5')]])){utils[_0x03cb('0xa')](util[_0x03cb('0x3')](_0x03cb('0x1a'),_0x3bbf75['uniqueid']),_0x3bbf75);dials[_0x3bbf75[_0x03cb('0x5')]]=_[_0x03cb('0x1b')](dials[_0x3bbf75[_0x03cb('0x5')]],_0x3bbf75);dials[_0x3bbf75[_0x03cb('0x5')]][_0x03cb('0x1c')]=utils[_0x03cb('0x1d')]();dials[_0x3bbf75[_0x03cb('0x5')]]['lastevent']=_0x03cb('0x1e');utils['info'](util['format'](_0x03cb('0x1f'),_0x3bbf75[_0x03cb('0x5')],dials[_0x3bbf75[_0x03cb('0x5')]]['starttime']));}}catch(_0x494479){utils[_0x03cb('0x12')](util[_0x03cb('0x3')](_0x03cb('0x1a'),_0x3bbf75['uniqueid']),_0x494479);}};exports[_0x03cb('0x20')]=function(_0x24df9d){try{if(!_[_0x03cb('0x14')](dials[_0x24df9d[_0x03cb('0x5')]])){utils[_0x03cb('0xa')](util[_0x03cb('0x3')](_0x03cb('0x21'),_0x24df9d[_0x03cb('0x5')]),_0x24df9d);dials[_0x24df9d[_0x03cb('0x5')]][_0x03cb('0x7')]=_0x24df9d[_0x03cb('0x7')];if(_0x24df9d[_0x03cb('0x7')]==_0x03cb('0x22')){dials[_0x24df9d[_0x03cb('0x5')]]=_['assign'](dials[_0x24df9d[_0x03cb('0x5')]],_0x24df9d);dials[_0x24df9d[_0x03cb('0x5')]][_0x03cb('0x23')]=utils[_0x03cb('0x1d')]();dials[_0x24df9d[_0x03cb('0x5')]]['lastevent']='connect';utils[_0x03cb('0x24')](util[_0x03cb('0x3')](_0x03cb('0x25'),_0x24df9d['uniqueid'],_0x24df9d[_0x03cb('0x7')],dials[_0x24df9d[_0x03cb('0x5')]][_0x03cb('0x23')]));}else{utils['info'](util[_0x03cb('0x3')](_0x03cb('0x26'),_0x24df9d['uniqueid'],_0x24df9d[_0x03cb('0x7')]));}}}catch(_0x44cd0c){utils[_0x03cb('0x12')](util[_0x03cb('0x3')]('[%s][dials][dialend]',_0x24df9d[_0x03cb('0x5')]),_0x44cd0c);}};exports[_0x03cb('0x27')]=function(_0x5be83d){try{if(!_[_0x03cb('0x14')](dials[_0x5be83d['uniqueid']])){utils[_0x03cb('0xa')](util[_0x03cb('0x3')]('[%s][dials][hangup]',_0x5be83d[_0x03cb('0x5')]),_0x5be83d);utils[_0x03cb('0x24')](util['format'](_0x03cb('0x28'),_0x5be83d[_0x03cb('0x5')],_0x5be83d[_0x03cb('0x29')],_0x5be83d[_0x03cb('0x2a')],_0x5be83d['cause-txt']));dials[_0x5be83d[_0x03cb('0x5')]]=_[_0x03cb('0x1b')](dials[_0x5be83d[_0x03cb('0x5')]],{'endtime':utils[_0x03cb('0x1d')](),'lastevent':_0x03cb('0x2b')});dials[_0x5be83d['uniqueid']][_0x03cb('0x2c')]=utils[_0x03cb('0x2d')](dials[_0x5be83d[_0x03cb('0x5')]][_0x03cb('0x2e')],dials[_0x5be83d[_0x03cb('0x5')]][_0x03cb('0x1c')]);dials[_0x5be83d[_0x03cb('0x5')]]['holdtime']=utils[_0x03cb('0x2d')](dials[_0x5be83d['uniqueid']][_0x03cb('0x23')]||dials[_0x5be83d[_0x03cb('0x5')]][_0x03cb('0x2e')],dials[_0x5be83d[_0x03cb('0x5')]][_0x03cb('0x1c')]);dials[_0x5be83d[_0x03cb('0x5')]][_0x03cb('0x2f')]=dials[_0x5be83d[_0x03cb('0x5')]][_0x03cb('0x23')]?utils[_0x03cb('0x2d')](dials[_0x5be83d[_0x03cb('0x5')]][_0x03cb('0x2e')],dials[_0x5be83d[_0x03cb('0x5')]][_0x03cb('0x23')]):0x0;writeDB(dials[_0x5be83d['uniqueid']]);}}catch(_0x5032db){utils[_0x03cb('0x12')](util[_0x03cb('0x3')](_0x03cb('0x30'),_0x5be83d[_0x03cb('0x5')]),_0x5032db);}}; \ No newline at end of file +var _0x08a4=['duration','endtime','holdtime','billableseconds','diffTime','[%s][dials][hangup]','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','format','[%s][dials][newexten]','appdata','application','toLowerCase','startsWith','cdr(routeid)','split','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','calleridname','cause-txt','complete'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x08a4,0x1d1));var _0x408a=function(_0x5c386b,_0x2338b7){_0x5c386b=_0x5c386b-0x0;var _0x3d56d3=_0x08a4[_0x5c386b];return _0x3d56d3;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x542934){utils[_0x408a('0x0')](util['format'](_0x408a('0x1'),_0x542934['uniqueid'],_0x542934[_0x408a('0x2')],_0x542934[_0x408a('0x3')],_0x542934[_0x408a('0x4')],_0x542934['connectedlinenum'],_0x542934[_0x408a('0x5')]));utils[_0x408a('0x6')](_0x408a('0x7'),_0x542934);delete dials[_0x542934[_0x408a('0x8')]];}exports[_0x408a('0x9')]=function(_0x125246){try{utils[_0x408a('0xa')](util[_0x408a('0xb')](_0x408a('0xc'),_0x125246[_0x408a('0x8')]),_0x125246);utils[_0x408a('0x0')](util[_0x408a('0xb')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x125246[_0x408a('0x8')],_0x125246['application'],_0x125246[_0x408a('0xd')]));if(_0x125246[_0x408a('0xe')][_0x408a('0xf')]()=='set'&&_[_0x408a('0x10')](_0x125246[_0x408a('0xd')]['toLowerCase'](),_0x408a('0x11'))){var _0x1c8925=_0x125246[_0x408a('0xd')][_0x408a('0x12')]('=');dials[_0x125246['uniqueid']]={'routeId':_0x1c8925[0x1]};}}catch(_0x52d95c){utils['error'](util[_0x408a('0xb')]('[%s][dials][newexten]',_0x125246[_0x408a('0x8')]),_0x52d95c);}};exports['varset']=function(_0x228152){try{utils['debug'](util[_0x408a('0xb')](_0x408a('0x13'),_0x228152['uniqueid']),_0x228152);if(!_['isNil'](_0x228152[_0x408a('0x14')][_0x408a('0x15')])){utils[_0x408a('0x0')](util[_0x408a('0xb')](_0x408a('0x16'),_0x228152['uniqueid'],_0x228152[_0x408a('0x17')]));dials[_0x228152[_0x408a('0x8')]]={'routeId':_0x228152[_0x408a('0x17')]};}}catch(_0x4cf13f){utils['error'](util[_0x408a('0xb')](_0x408a('0x13'),_0x228152[_0x408a('0x8')]),_0x4cf13f);}};exports[_0x408a('0x18')]=function(_0x434d95){try{if(!_[_0x408a('0x19')](dials[_0x434d95[_0x408a('0x8')]])){utils[_0x408a('0xa')](util[_0x408a('0xb')](_0x408a('0x1a'),_0x434d95['uniqueid']),_0x434d95);dials[_0x434d95[_0x408a('0x8')]]=_[_0x408a('0x1b')](dials[_0x434d95[_0x408a('0x8')]],_0x434d95);dials[_0x434d95['uniqueid']][_0x408a('0x1c')]=utils[_0x408a('0x1d')]();dials[_0x434d95[_0x408a('0x8')]][_0x408a('0x1e')]=_0x408a('0x1f');utils[_0x408a('0x0')](util['format'](_0x408a('0x20'),_0x434d95['uniqueid'],dials[_0x434d95[_0x408a('0x8')]][_0x408a('0x1c')]));}}catch(_0x20f56e){utils[_0x408a('0x21')](util[_0x408a('0xb')](_0x408a('0x1a'),_0x434d95['uniqueid']),_0x20f56e);}};exports[_0x408a('0x22')]=function(_0x10b03e){try{if(!_[_0x408a('0x19')](dials[_0x10b03e[_0x408a('0x8')]])){utils[_0x408a('0xa')](util[_0x408a('0xb')](_0x408a('0x23'),_0x10b03e['uniqueid']),_0x10b03e);dials[_0x10b03e[_0x408a('0x8')]][_0x408a('0x5')]=_0x10b03e[_0x408a('0x5')];if(_0x10b03e[_0x408a('0x5')]==_0x408a('0x24')){dials[_0x10b03e[_0x408a('0x8')]]=_['assign'](dials[_0x10b03e[_0x408a('0x8')]],_0x10b03e);dials[_0x10b03e['uniqueid']][_0x408a('0x25')]=utils[_0x408a('0x1d')]();dials[_0x10b03e[_0x408a('0x8')]][_0x408a('0x1e')]=_0x408a('0x26');utils[_0x408a('0x0')](util[_0x408a('0xb')](_0x408a('0x27'),_0x10b03e[_0x408a('0x8')],_0x10b03e[_0x408a('0x5')],dials[_0x10b03e['uniqueid']][_0x408a('0x25')]));}else{utils[_0x408a('0x0')](util[_0x408a('0xb')](_0x408a('0x28'),_0x10b03e[_0x408a('0x8')],_0x10b03e['dialstatus']));}}}catch(_0x46387e){utils['error'](util[_0x408a('0xb')](_0x408a('0x23'),_0x10b03e['uniqueid']),_0x46387e);}};exports[_0x408a('0x29')]=function(_0x51ec0b){try{if(!_[_0x408a('0x19')](dials[_0x51ec0b[_0x408a('0x8')]])){utils[_0x408a('0xa')](util[_0x408a('0xb')]('[%s][dials][hangup]',_0x51ec0b[_0x408a('0x8')]),_0x51ec0b);utils[_0x408a('0x0')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x51ec0b[_0x408a('0x8')],_0x51ec0b[_0x408a('0x4')],_0x51ec0b[_0x408a('0x2a')],_0x51ec0b[_0x408a('0x2b')]));dials[_0x51ec0b['uniqueid']]=_[_0x408a('0x1b')](dials[_0x51ec0b['uniqueid']],{'endtime':utils[_0x408a('0x1d')](),'lastevent':_0x408a('0x2c')});dials[_0x51ec0b[_0x408a('0x8')]][_0x408a('0x2d')]=utils['diffTime'](dials[_0x51ec0b[_0x408a('0x8')]][_0x408a('0x2e')],dials[_0x51ec0b[_0x408a('0x8')]][_0x408a('0x1c')]);dials[_0x51ec0b['uniqueid']][_0x408a('0x2f')]=utils['diffTime'](dials[_0x51ec0b[_0x408a('0x8')]][_0x408a('0x25')]||dials[_0x51ec0b['uniqueid']][_0x408a('0x2e')],dials[_0x51ec0b['uniqueid']][_0x408a('0x1c')]);dials[_0x51ec0b[_0x408a('0x8')]][_0x408a('0x30')]=dials[_0x51ec0b[_0x408a('0x8')]][_0x408a('0x25')]?utils[_0x408a('0x31')](dials[_0x51ec0b[_0x408a('0x8')]][_0x408a('0x2e')],dials[_0x51ec0b[_0x408a('0x8')]][_0x408a('0x25')]):0x0;writeDB(dials[_0x51ec0b[_0x408a('0x8')]]);}}catch(_0x5c1f86){utils['error'](util[_0x408a('0xb')](_0x408a('0x32'),_0x51ec0b['uniqueid']),_0x5c1f86);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index c9bc498..1a6f273 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 _0xff1c=['agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','debug','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]'];(function(_0x31c8fc,_0x161742){var _0x1b8400=function(_0x539a9d){while(--_0x539a9d){_0x31c8fc['push'](_0x31c8fc['shift']());}};_0x1b8400(++_0x161742);}(_0xff1c,0x12f));var _0xcff1=function(_0x2d7561,_0x162f40){_0x2d7561=_0x2d7561-0x0;var _0x14c9f4=_0xff1c[_0x2d7561];return _0x14c9f4;};var AsteriskManager=require(_0xcff1('0x0'));var config=require(_0xcff1('0x1'));var utils=require(_0xcff1('0x2'));var util=require(_0xcff1('0x3'));var isXDREnabled=config[_0xcff1('0x4')]&&config[_0xcff1('0x4')][_0xcff1('0x5')]?!config[_0xcff1('0x4')]['disabled']:!![];var isProduction=config['env']===_0xcff1('0x6')||![];var isLocalAsterisk=config[_0xcff1('0x4')]&&config[_0xcff1('0x4')][_0xcff1('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xcff1('0x8')]['port'],config[_0xcff1('0x8')]['ip'],config['asterisk']['username'],config['asterisk'][_0xcff1('0x9')],!![]);ami[_0xcff1('0xa')]();if(!isXDREnabled){utils['info'](_0xcff1('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xcff1('0xc')](_0xcff1('0xd'));}else{var agents=require(_0xcff1('0xe'));var calls=require(_0xcff1('0xf'));var queues=require('./queues.controller');var recordings=require(_0xcff1('0x10'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0xcff1('0x11'));var core=require(_0xcff1('0x12'));ami['on'](_0xcff1('0x13'),core[_0xcff1('0x13')]);ami['on']('shutdown',core[_0xcff1('0x14')]);ami['on'](_0xcff1('0x15'),core[_0xcff1('0x15')]);ami['on'](_0xcff1('0x16'),core['error']);ami['on'](_0xcff1('0x17'),core[_0xcff1('0x17')]);ami['on'](_0xcff1('0x18'),core[_0xcff1('0x18')]);ami['on'](_0xcff1('0x19'),function(_0x3a1b46){try{utils['debug'](util[_0xcff1('0x1a')](_0xcff1('0x1b'),_0x3a1b46[_0xcff1('0x1c')]),_0x3a1b46);members[_0xcff1('0x19')](_0x3a1b46);}catch(_0x3bb620){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')](_0xcff1('0x1b'),_0x3a1b46[_0xcff1('0x1c')]),_0x3bb620);}});ami['on']('agentcalled',function(_0x4e5684){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x1e'),_0x4e5684[_0xcff1('0x1f')]),_0x4e5684);agents[_0xcff1('0x20')](_0x4e5684);}catch(_0x430735){utils[_0xcff1('0x16')](util['format'](_0xcff1('0x1e'),_0x4e5684[_0xcff1('0x1f')]),_0x430735);}});ami['on'](_0xcff1('0x21'),function(_0x3b453e){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x22'),_0x3b453e[_0xcff1('0x1f')]),_0x3b453e);agents[_0xcff1('0x21')](_0x3b453e);}catch(_0x50dab7){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')](_0xcff1('0x22'),_0x3b453e[_0xcff1('0x1f')]),_0x50dab7);}});ami['on'](_0xcff1('0x23'),function(_0x27a331){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x24'),_0x27a331[_0xcff1('0x1f')]),_0x27a331);agents[_0xcff1('0x23')](_0x27a331);queues['agentconnect'](_0x27a331);}catch(_0xd51a0d){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')](_0xcff1('0x24'),_0x27a331[_0xcff1('0x1f')]),_0xd51a0d);}});ami['on'](_0xcff1('0x25'),function(_0x4b7dd7){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x26'),_0x4b7dd7['uniqueid']),_0x4b7dd7);agents['agentcomplete'](_0x4b7dd7);queues[_0xcff1('0x25')](_0x4b7dd7);members[_0xcff1('0x25')](_0x4b7dd7);}catch(_0x5cb9f8){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')](_0xcff1('0x26'),_0x4b7dd7[_0xcff1('0x1f')]),_0x5cb9f8);}});ami['on']('queuecallerabandon',function(_0x10898a){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x27'),_0x10898a[_0xcff1('0x1f')]),_0x10898a);agents['queuecallerabandon'](_0x10898a);queues['queuecallerabandon'](_0x10898a);}catch(_0x4768fd){utils['error'](util[_0xcff1('0x1a')](_0xcff1('0x27'),_0x10898a['uniqueid']),_0x4768fd);}});ami['on']('queuecallerjoin',function(_0x36a9b8){try{utils[_0xcff1('0x1d')](util['format'](_0xcff1('0x28'),_0x36a9b8['uniqueid']),_0x36a9b8);queues[_0xcff1('0x29')](_0x36a9b8);recordings['queuecallerjoin'](_0x36a9b8);}catch(_0xa6136f){utils[_0xcff1('0x16')](util['format']('[%s][index][queuecallerjoin]',_0x36a9b8[_0xcff1('0x1f')]),_0xa6136f);}});ami['on'](_0xcff1('0x2a'),function(_0x455553){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x2b'),_0x455553[_0xcff1('0x1f')]),_0x455553);queues[_0xcff1('0x2a')](_0x455553);}catch(_0x38a190){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')](_0xcff1('0x2b'),_0x455553[_0xcff1('0x1f')]),_0x38a190);}});ami['on'](_0xcff1('0x2c'),function(_0x2dc3ef){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')]('[%s][index][musiconholdstart]',_0x2dc3ef['uniqueid']),_0x2dc3ef);queues['musiconholdstart'](_0x2dc3ef);calls[_0xcff1('0x2c')](_0x2dc3ef);}catch(_0x1a4e0e){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')]('[%s][index][musiconholdstart]',_0x2dc3ef[_0xcff1('0x1f')]),_0x1a4e0e);}});ami['on'](_0xcff1('0x2d'),function(_0x3eb06e){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x2e'),_0x3eb06e['uniqueid']),_0x3eb06e);queues[_0xcff1('0x2d')](_0x3eb06e);calls[_0xcff1('0x2d')](_0x3eb06e);}catch(_0x68a108){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')]('[%s][index][musiconholdstop]',_0x3eb06e[_0xcff1('0x1f')]),_0x68a108);}});ami['on'](_0xcff1('0x2f'),function(_0x213e1b){try{utils['debug'](util[_0xcff1('0x1a')](_0xcff1('0x30'),_0x213e1b[_0xcff1('0x1f')]),_0x213e1b);calls['newstate'](_0x213e1b);recordings['newstate'](_0x213e1b);}catch(_0x51dbc0){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')](_0xcff1('0x30'),_0x213e1b['uniqueid']),_0x51dbc0);}});ami['on']('hangup',function(_0x637cb5){try{utils['debug'](util[_0xcff1('0x1a')](_0xcff1('0x31'),_0x637cb5[_0xcff1('0x1f')]),_0x637cb5);calls[_0xcff1('0x32')](_0x637cb5);recordings[_0xcff1('0x32')](_0x637cb5);dials['hangup'](_0x637cb5);agents[_0xcff1('0x32')](_0x637cb5);queues[_0xcff1('0x32')](_0x637cb5);}catch(_0x343dc7){utils['error'](util[_0xcff1('0x1a')]('[%s][index][hangup]',_0x637cb5[_0xcff1('0x1f')]),_0x343dc7);}});ami['on'](_0xcff1('0x33'),function(_0xce72fc){try{utils[_0xcff1('0x1d')](util['format'](_0xcff1('0x34'),_0xce72fc['uniqueid']),_0xce72fc);members[_0xcff1('0x33')](_0xce72fc);}catch(_0xed7d22){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')]('[%s][index][cdr]',_0xce72fc[_0xcff1('0x1f')]),_0xed7d22);}});ami['on'](_0xcff1('0x35'),function(_0x27c1d3){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x36'),_0x27c1d3[_0xcff1('0x1f')]),_0x27c1d3);queues['blindtransfer'](_0x27c1d3);agents[_0xcff1('0x35')](_0x27c1d3);transfers[_0xcff1('0x35')](_0x27c1d3);recordings[_0xcff1('0x35')](_0x27c1d3);}catch(_0x29d327){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')](_0xcff1('0x36'),_0x27c1d3['uniqueid']),_0x29d327);}});ami['on'](_0xcff1('0x37'),function(_0x5b2a3c){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x38'),_0x5b2a3c[_0xcff1('0x39')]),_0x5b2a3c);queues[_0xcff1('0x37')](_0x5b2a3c);transfers[_0xcff1('0x37')](_0x5b2a3c);agents['attendedtransfer'](_0x5b2a3c);calls[_0xcff1('0x37')](_0x5b2a3c);}catch(_0x34de39){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')](_0xcff1('0x38'),_0x5b2a3c[_0xcff1('0x39')]),_0x34de39);}});ami['on'](_0xcff1('0x3a'),function(_0x1a8f76){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x3b'),_0x1a8f76[_0xcff1('0x1f')]),_0x1a8f76);queues[_0xcff1('0x3a')](_0x1a8f76);recordings[_0xcff1('0x3a')](_0x1a8f76);calls[_0xcff1('0x3a')](_0x1a8f76);dials[_0xcff1('0x3a')](_0x1a8f76);}catch(_0x58eac){utils[_0xcff1('0x16')](util['format'](_0xcff1('0x3b'),_0x1a8f76['uniqueid']),_0x58eac);}});ami['on']('newexten',function(_0x56f3a2){try{utils['debug'](util[_0xcff1('0x1a')](_0xcff1('0x3c'),_0x56f3a2[_0xcff1('0x1f')]),_0x56f3a2);calls['newexten'](_0x56f3a2);recordings['newexten'](_0x56f3a2);dials[_0xcff1('0x3d')](_0x56f3a2);}catch(_0x5e062a){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')]('[%s][index][newexten]',_0x56f3a2[_0xcff1('0x1f')]),_0x5e062a);}});ami['on'](_0xcff1('0x3e'),function(_0x1701f3){try{utils['debug'](util[_0xcff1('0x1a')](_0xcff1('0x3f'),_0x1701f3[_0xcff1('0x1f')]),_0x1701f3);calls[_0xcff1('0x3e')](_0x1701f3);recordings[_0xcff1('0x3e')](_0x1701f3);}catch(_0x452f8b){utils['error'](util['format']('[%s][index][newchannel]',_0x1701f3[_0xcff1('0x1f')]),_0x452f8b);}});ami['on'](_0xcff1('0x40'),function(_0x26ab06){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x41'),_0x26ab06['uniqueid']),_0x26ab06);dials[_0xcff1('0x40')](_0x26ab06);}catch(_0x459918){utils[_0xcff1('0x16')](util[_0xcff1('0x1a')]('[%s]dialbegin',_0x26ab06['uniqueid']),_0x459918);}});ami['on'](_0xcff1('0x42'),function(_0x22da6b){try{utils[_0xcff1('0x1d')](util[_0xcff1('0x1a')](_0xcff1('0x43'),_0x22da6b[_0xcff1('0x1f')]),_0x22da6b);dials[_0xcff1('0x42')](_0x22da6b);}catch(_0x44c243){utils['error'](util['format'](_0xcff1('0x43'),_0x22da6b[_0xcff1('0x1f')]),_0x44c243);}});} \ No newline at end of file +var _0xd06e=['newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','info','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','device','[%s][index][devicestatechange]','agentcalled','format','uniqueid','[%s][index][agentcalled]','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][varset]','varset'];(function(_0x42fcf1,_0x65ee17){var _0x5af641=function(_0x4f0c44){while(--_0x4f0c44){_0x42fcf1['push'](_0x42fcf1['shift']());}};_0x5af641(++_0x65ee17);}(_0xd06e,0x91));var _0xed06=function(_0x169895,_0x116eb4){_0x169895=_0x169895-0x0;var _0x192798=_0xd06e[_0x169895];return _0x192798;};var AsteriskManager=require('asterisk-manager');var config=require(_0xed06('0x0'));var utils=require('./utils');var util=require(_0xed06('0x1'));var isXDREnabled=config[_0xed06('0x2')]&&config[_0xed06('0x2')][_0xed06('0x3')]?!config[_0xed06('0x2')][_0xed06('0x3')]:!![];var isProduction=config['env']===_0xed06('0x4')||![];var isLocalAsterisk=config[_0xed06('0x2')]&&config[_0xed06('0x2')][_0xed06('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xed06('0x6')][_0xed06('0x7')],config[_0xed06('0x6')]['ip'],config[_0xed06('0x6')][_0xed06('0x8')],config['asterisk'][_0xed06('0x9')],!![]);ami[_0xed06('0xa')]();if(!isXDREnabled){utils[_0xed06('0xb')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0xed06('0xc'));var queues=require(_0xed06('0xd'));var recordings=require(_0xed06('0xe'));var members=require(_0xed06('0xf'));var dials=require(_0xed06('0x10'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on']('connect',core[_0xed06('0x11')]);ami['on']('shutdown',core[_0xed06('0x12')]);ami['on'](_0xed06('0x13'),core[_0xed06('0x13')]);ami['on'](_0xed06('0x14'),core[_0xed06('0x14')]);ami['on'](_0xed06('0x15'),core[_0xed06('0x15')]);ami['on'](_0xed06('0x16'),core[_0xed06('0x16')]);ami['on'](_0xed06('0x17'),function(_0x5e66c9){try{utils[_0xed06('0x18')](util['format']('[%s][index][devicestatechange]',_0x5e66c9[_0xed06('0x19')]),_0x5e66c9);members['devicestatechange'](_0x5e66c9);}catch(_0x2ea7f5){utils['error'](util['format'](_0xed06('0x1a'),_0x5e66c9[_0xed06('0x19')]),_0x2ea7f5);}});ami['on'](_0xed06('0x1b'),function(_0x4bc202){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')]('[%s][index][agentcalled]',_0x4bc202[_0xed06('0x1d')]),_0x4bc202);agents[_0xed06('0x1b')](_0x4bc202);}catch(_0x4d4840){utils[_0xed06('0x14')](util['format'](_0xed06('0x1e'),_0x4bc202[_0xed06('0x1d')]),_0x4d4840);}});ami['on']('agentringnoanswer',function(_0x516bc7){try{utils['debug'](util['format'](_0xed06('0x1f'),_0x516bc7[_0xed06('0x1d')]),_0x516bc7);agents[_0xed06('0x20')](_0x516bc7);}catch(_0x443119){utils[_0xed06('0x14')](util[_0xed06('0x1c')](_0xed06('0x1f'),_0x516bc7[_0xed06('0x1d')]),_0x443119);}});ami['on'](_0xed06('0x21'),function(_0xee144c){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')]('[%s][index][agentconnect]',_0xee144c[_0xed06('0x1d')]),_0xee144c);agents[_0xed06('0x21')](_0xee144c);queues['agentconnect'](_0xee144c);}catch(_0x4f6920){utils['error'](util[_0xed06('0x1c')](_0xed06('0x22'),_0xee144c[_0xed06('0x1d')]),_0x4f6920);}});ami['on']('agentcomplete',function(_0x197ace){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x23'),_0x197ace[_0xed06('0x1d')]),_0x197ace);agents[_0xed06('0x24')](_0x197ace);queues[_0xed06('0x24')](_0x197ace);members[_0xed06('0x24')](_0x197ace);}catch(_0x38eb0a){utils[_0xed06('0x14')](util[_0xed06('0x1c')](_0xed06('0x23'),_0x197ace[_0xed06('0x1d')]),_0x38eb0a);}});ami['on']('queuecallerabandon',function(_0x794976){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x25'),_0x794976[_0xed06('0x1d')]),_0x794976);agents[_0xed06('0x26')](_0x794976);queues[_0xed06('0x26')](_0x794976);}catch(_0x2a124f){utils['error'](util[_0xed06('0x1c')]('[%s][index][queuecallerabandon]',_0x794976[_0xed06('0x1d')]),_0x2a124f);}});ami['on'](_0xed06('0x27'),function(_0x7c7267){try{utils['debug'](util[_0xed06('0x1c')]('[%s][index][queuecallerjoin]',_0x7c7267[_0xed06('0x1d')]),_0x7c7267);queues['queuecallerjoin'](_0x7c7267);recordings[_0xed06('0x27')](_0x7c7267);}catch(_0x40161a){utils[_0xed06('0x14')](util[_0xed06('0x1c')]('[%s][index][queuecallerjoin]',_0x7c7267[_0xed06('0x1d')]),_0x40161a);}});ami['on'](_0xed06('0x28'),function(_0x431f6e){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x29'),_0x431f6e[_0xed06('0x1d')]),_0x431f6e);queues[_0xed06('0x28')](_0x431f6e);}catch(_0x22082d){utils['error'](util[_0xed06('0x1c')]('[%s][index][queuecallerleave]',_0x431f6e[_0xed06('0x1d')]),_0x22082d);}});ami['on']('musiconholdstart',function(_0x35a8ed){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x2a'),_0x35a8ed['uniqueid']),_0x35a8ed);queues[_0xed06('0x2b')](_0x35a8ed);calls[_0xed06('0x2b')](_0x35a8ed);}catch(_0x4ab4d1){utils[_0xed06('0x14')](util['format'](_0xed06('0x2a'),_0x35a8ed[_0xed06('0x1d')]),_0x4ab4d1);}});ami['on']('musiconholdstop',function(_0x30541b){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x2c'),_0x30541b[_0xed06('0x1d')]),_0x30541b);queues['musiconholdstop'](_0x30541b);calls[_0xed06('0x2d')](_0x30541b);}catch(_0x21cb61){utils[_0xed06('0x14')](util['format'](_0xed06('0x2c'),_0x30541b['uniqueid']),_0x21cb61);}});ami['on'](_0xed06('0x2e'),function(_0xede325){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x2f'),_0xede325[_0xed06('0x1d')]),_0xede325);calls[_0xed06('0x2e')](_0xede325);recordings[_0xed06('0x2e')](_0xede325);}catch(_0x4b0f88){utils[_0xed06('0x14')](util['format'](_0xed06('0x2f'),_0xede325[_0xed06('0x1d')]),_0x4b0f88);}});ami['on'](_0xed06('0x30'),function(_0x3dd895){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x31'),_0x3dd895[_0xed06('0x1d')]),_0x3dd895);calls[_0xed06('0x30')](_0x3dd895);recordings[_0xed06('0x30')](_0x3dd895);dials[_0xed06('0x30')](_0x3dd895);agents[_0xed06('0x30')](_0x3dd895);queues[_0xed06('0x30')](_0x3dd895);}catch(_0x197ed9){utils[_0xed06('0x14')](util['format'](_0xed06('0x31'),_0x3dd895[_0xed06('0x1d')]),_0x197ed9);}});ami['on'](_0xed06('0x32'),function(_0x451059){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x33'),_0x451059[_0xed06('0x1d')]),_0x451059);members[_0xed06('0x32')](_0x451059);}catch(_0x354be9){utils[_0xed06('0x14')](util[_0xed06('0x1c')](_0xed06('0x33'),_0x451059[_0xed06('0x1d')]),_0x354be9);}});ami['on'](_0xed06('0x34'),function(_0x1ce4ba){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')]('[%s][index][blindtransfer]',_0x1ce4ba[_0xed06('0x1d')]),_0x1ce4ba);queues[_0xed06('0x34')](_0x1ce4ba);agents[_0xed06('0x34')](_0x1ce4ba);transfers[_0xed06('0x34')](_0x1ce4ba);recordings[_0xed06('0x34')](_0x1ce4ba);}catch(_0x59af98){utils['error'](util[_0xed06('0x1c')](_0xed06('0x35'),_0x1ce4ba[_0xed06('0x1d')]),_0x59af98);}});ami['on']('attendedtransfer',function(_0x1e3f3f){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x36'),_0x1e3f3f[_0xed06('0x37')]),_0x1e3f3f);queues[_0xed06('0x38')](_0x1e3f3f);transfers[_0xed06('0x38')](_0x1e3f3f);agents[_0xed06('0x38')](_0x1e3f3f);calls[_0xed06('0x38')](_0x1e3f3f);}catch(_0x4ab4cd){utils[_0xed06('0x14')](util[_0xed06('0x1c')](_0xed06('0x36'),_0x1e3f3f['origtransfereruniqueid']),_0x4ab4cd);}});ami['on']('varset',function(_0x38f37f){try{utils['debug'](util[_0xed06('0x1c')](_0xed06('0x39'),_0x38f37f[_0xed06('0x1d')]),_0x38f37f);queues[_0xed06('0x3a')](_0x38f37f);recordings['varset'](_0x38f37f);calls[_0xed06('0x3a')](_0x38f37f);dials[_0xed06('0x3a')](_0x38f37f);}catch(_0x543265){utils[_0xed06('0x14')](util[_0xed06('0x1c')](_0xed06('0x39'),_0x38f37f['uniqueid']),_0x543265);}});ami['on'](_0xed06('0x3b'),function(_0x43d192){try{utils[_0xed06('0x18')](util[_0xed06('0x1c')](_0xed06('0x3c'),_0x43d192[_0xed06('0x1d')]),_0x43d192);calls[_0xed06('0x3b')](_0x43d192);recordings[_0xed06('0x3b')](_0x43d192);dials[_0xed06('0x3b')](_0x43d192);}catch(_0x28d261){utils['error'](util['format'](_0xed06('0x3c'),_0x43d192[_0xed06('0x1d')]),_0x28d261);}});ami['on'](_0xed06('0x3d'),function(_0x4e432c){try{utils['debug'](util['format'](_0xed06('0x3e'),_0x4e432c[_0xed06('0x1d')]),_0x4e432c);calls[_0xed06('0x3d')](_0x4e432c);recordings[_0xed06('0x3d')](_0x4e432c);}catch(_0x255d8c){utils['error'](util[_0xed06('0x1c')](_0xed06('0x3e'),_0x4e432c['uniqueid']),_0x255d8c);}});ami['on'](_0xed06('0x3f'),function(_0x34d590){try{utils['debug'](util[_0xed06('0x1c')](_0xed06('0x40'),_0x34d590[_0xed06('0x1d')]),_0x34d590);dials[_0xed06('0x3f')](_0x34d590);}catch(_0x3042f3){utils[_0xed06('0x14')](util['format'](_0xed06('0x41'),_0x34d590['uniqueid']),_0x3042f3);}});ami['on'](_0xed06('0x42'),function(_0x2c8d92){try{utils['debug'](util[_0xed06('0x1c')]('[%s][index][dialend]',_0x2c8d92[_0xed06('0x1d')]),_0x2c8d92);dials[_0xed06('0x42')](_0x2c8d92);}catch(_0x5b849e){utils[_0xed06('0x14')](util[_0xed06('0x1c')](_0xed06('0x43'),_0x2c8d92[_0xed06('0x1d')]),_0x5b849e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e20a058..8c38070 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 _0x1f38=['util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','CreateMemberReport','getUserByName','split','request','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','info','state','INUSE','voice','TALKING','now','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash'];(function(_0x21b705,_0x403807){var _0xb2ea36=function(_0x87895f){while(--_0x87895f){_0x21b705['push'](_0x21b705['shift']());}};_0xb2ea36(++_0x403807);}(_0x1f38,0xd7));var _0x81f3=function(_0x5a488c,_0x4cc470){_0x5a488c=_0x5a488c-0x0;var _0x53a7d6=_0x1f38[_0x5a488c];return _0x53a7d6;};'use strict';var _=require(_0x81f3('0x0'));var util=require(_0x81f3('0x1'));var utils=require(_0x81f3('0x2'));var members={};var exclude=[_0x81f3('0x3'),_0x81f3('0x4')];function writeDB(_0x3ad066){utils['info'](util[_0x81f3('0x5')](_0x81f3('0x6'),_0x3ad066[_0x81f3('0x7')],_0x3ad066[_0x81f3('0x8')],_0x3ad066[_0x81f3('0x9')],_0x3ad066['data2'],_0x3ad066[_0x81f3('0xa')],_0x3ad066[_0x81f3('0xb')]));if(_0x3ad066[_0x81f3('0x8')]){utils[_0x81f3('0xc')](_0x3ad066[_0x81f3('0x8')])[_0x81f3('0xd')](function(_0x665f37){if(_0x665f37){_0x3ad066[_0x81f3('0xa')]=_0x665f37[_0x81f3('0xe')];_0x3ad066[_0x81f3('0xf')]=_0x665f37[_0x81f3('0xf')];utils['request'](_0x81f3('0x10'),_0x3ad066);}else{utils[_0x81f3('0x11')](_0x3ad066[_0x81f3('0x8')][_0x81f3('0x12')]('/')[0x1])[_0x81f3('0xd')](function(_0x5a1a63){if(_0x5a1a63){_0x3ad066['membername']=_0x5a1a63[_0x81f3('0xe')];_0x3ad066[_0x81f3('0xf')]=_0x5a1a63[_0x81f3('0xf')];utils[_0x81f3('0x13')](_0x81f3('0x10'),_0x3ad066);}});}})[_0x81f3('0x14')](function(_0x4ffea5){utils[_0x81f3('0x15')](util[_0x81f3('0x5')](_0x81f3('0x16'),_0x3ad066['uniqueid']),_0x4ffea5);});}delete members[_0x3ad066[_0x81f3('0x8')]];}function startsWith(_0x44c4e9,_0x3f177b){return _[_0x81f3('0x17')](_0x44c4e9,function(_0x19c5f1){return _[_0x81f3('0x18')](_0x3f177b,_0x19c5f1);});}exports[_0x81f3('0x19')]=function(_0x27321c){try{utils[_0x81f3('0x1a')](util[_0x81f3('0x5')](_0x81f3('0x1b'),members[_0x27321c['device']]?members[_0x27321c[_0x81f3('0x1c')]][_0x81f3('0x7')]:_0x27321c[_0x81f3('0x1c')]),_0x27321c);utils[_0x81f3('0x1d')](util[_0x81f3('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x27321c[_0x81f3('0x1c')]]?members[_0x27321c[_0x81f3('0x1c')]]['uniqueid']:_0x27321c[_0x81f3('0x1c')],_0x27321c['state'],_0x27321c[_0x81f3('0x1c')]));switch(_0x27321c[_0x81f3('0x1e')]){case _0x81f3('0x1f'):case'BUSY':if(!startsWith(exclude,_0x27321c['device'])){members[_0x27321c[_0x81f3('0x1c')]]={'channel':_0x81f3('0x20'),'interface':_0x27321c['device'],'type':_0x81f3('0x21'),'enterAt':utils[_0x81f3('0x22')](),'role':'agent'};}break;case _0x81f3('0x23'):if(!_[_0x81f3('0x24')](members[_0x27321c[_0x81f3('0x1c')]])){members[_0x27321c[_0x81f3('0x1c')]][_0x81f3('0x25')]=utils[_0x81f3('0x22')]();members[_0x27321c[_0x81f3('0x1c')]]['duration']=utils[_0x81f3('0x26')](members[_0x27321c['device']]['exitAt'],members[_0x27321c[_0x81f3('0x1c')]][_0x81f3('0x27')]);if(members[_0x27321c['device']][_0x81f3('0x7')]){writeDB(members[_0x27321c['device']]);}}break;default:break;}}catch(_0x256e0b){utils[_0x81f3('0x15')](util['format'](_0x81f3('0x1b'),members[_0x27321c[_0x81f3('0x1c')]]?members[_0x27321c[_0x81f3('0x1c')]][_0x81f3('0x7')]:_0x27321c[_0x81f3('0x1c')]),_0x256e0b);}};exports[_0x81f3('0x28')]=function(_0x25ef3e){try{if(!_['isNil'](members[_0x25ef3e[_0x81f3('0x8')]])){utils[_0x81f3('0x1a')](util[_0x81f3('0x5')](_0x81f3('0x29'),_0x25ef3e[_0x81f3('0x7')]),_0x25ef3e);utils[_0x81f3('0x1d')](util['format'](_0x81f3('0x2a'),_0x25ef3e['uniqueid'],_0x25ef3e['interface'],_0x25ef3e[_0x81f3('0x2b')]));members[_0x25ef3e['interface']]=_[_0x81f3('0x2c')](members[_0x25ef3e[_0x81f3('0x8')]],{'data4':_0x25ef3e[_0x81f3('0x2b')],'uniqueid':_0x25ef3e[_0x81f3('0x7')]});}}catch(_0x1db657){utils[_0x81f3('0x15')](util[_0x81f3('0x5')](_0x81f3('0x29'),_0x25ef3e[_0x81f3('0x7')]),_0x1db657);}};exports[_0x81f3('0x2d')]=function(_0x4fa004){try{utils[_0x81f3('0x1a')](util[_0x81f3('0x5')](_0x81f3('0x2e'),_0x4fa004['uniqueid']),_0x4fa004);if(_0x4fa004[_0x81f3('0x9')]){var _0x35ab8a=_0x4fa004['channel'][_0x81f3('0x12')]('-')[0x0];if(!_[_0x81f3('0x24')](members[_0x35ab8a])){members[_0x35ab8a]=_[_0x81f3('0x2c')](members[_0x35ab8a],{'data1':members[_0x35ab8a][_0x81f3('0x2f')]||_0x4fa004['type'],'data2':members[_0x35ab8a][_0x81f3('0x30')]||_0x4fa004[_0x81f3('0x31')],'data3':members[_0x35ab8a][_0x81f3('0x32')]||_0x4fa004[_0x81f3('0x33')],'uniqueid':members[_0x35ab8a][_0x81f3('0x7')]||_0x4fa004['uniqueid']});utils[_0x81f3('0x1d')](util['format'](_0x81f3('0x34'),_0x4fa004[_0x81f3('0x7')],members[_0x35ab8a][_0x81f3('0x2f')],members[_0x35ab8a][_0x81f3('0x30')],members[_0x35ab8a]['data3']));if(members[_0x35ab8a]['exitAt']){writeDB(members[_0x35ab8a]);}}}if(_0x4fa004[_0x81f3('0x35')]){var _0x59fffa=_0x4fa004['destinationchannel'][_0x81f3('0x12')]('-')[0x0];if(!_[_0x81f3('0x24')](members[_0x59fffa])){members[_0x59fffa]=_[_0x81f3('0x2c')](members[_0x59fffa],{'data1':members[_0x59fffa][_0x81f3('0x2f')]||_0x4fa004[_0x81f3('0xb')],'data2':members[_0x59fffa]['data2']||_0x4fa004[_0x81f3('0x31')],'data3':members[_0x59fffa]['data3']||_0x4fa004['destination'],'uniqueid':members[_0x59fffa][_0x81f3('0x7')]||_0x4fa004[_0x81f3('0x7')]});utils[_0x81f3('0x1d')](util['format'](_0x81f3('0x34'),_0x4fa004[_0x81f3('0x7')],members[_0x59fffa][_0x81f3('0x2f')],members[_0x59fffa][_0x81f3('0x30')],members[_0x59fffa][_0x81f3('0x32')]));if(members[_0x59fffa][_0x81f3('0x25')]){writeDB(members[_0x59fffa]);}}}}catch(_0xd334ef){utils[_0x81f3('0x15')](util[_0x81f3('0x5')](_0x81f3('0x2e'),_0x4fa004[_0x81f3('0x7')]),_0xd334ef);}}; \ No newline at end of file +var _0xbcc4=['internal','CreateMemberReport','getUserByName','split','request','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','TALKING','now','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','lodash','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','type','interface','then','name'];(function(_0x4e924c,_0x16a72c){var _0x32ce75=function(_0x35cae0){while(--_0x35cae0){_0x4e924c['push'](_0x4e924c['shift']());}};_0x32ce75(++_0x16a72c);}(_0xbcc4,0x12b));var _0x4bcc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbcc4[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4bcc('0x0'));var util=require('util');var utils=require(_0x4bcc('0x1'));var members={};var exclude=[_0x4bcc('0x2'),_0x4bcc('0x3')];function writeDB(_0x42ed85){utils['info'](util[_0x4bcc('0x4')](_0x4bcc('0x5'),_0x42ed85['uniqueid'],_0x42ed85['interface'],_0x42ed85[_0x4bcc('0x6')],_0x42ed85[_0x4bcc('0x7')],_0x42ed85[_0x4bcc('0x8')],_0x42ed85[_0x4bcc('0x9')]));if(_0x42ed85[_0x4bcc('0xa')]){utils['getUserByInterface'](_0x42ed85[_0x4bcc('0xa')])[_0x4bcc('0xb')](function(_0x200a23){if(_0x200a23){_0x42ed85[_0x4bcc('0x8')]=_0x200a23[_0x4bcc('0xc')];_0x42ed85[_0x4bcc('0xd')]=_0x200a23[_0x4bcc('0xd')];utils['request'](_0x4bcc('0xe'),_0x42ed85);}else{utils[_0x4bcc('0xf')](_0x42ed85['interface'][_0x4bcc('0x10')]('/')[0x1])[_0x4bcc('0xb')](function(_0x185235){if(_0x185235){_0x42ed85['membername']=_0x185235[_0x4bcc('0xc')];_0x42ed85[_0x4bcc('0xd')]=_0x185235[_0x4bcc('0xd')];utils[_0x4bcc('0x11')](_0x4bcc('0xe'),_0x42ed85);}});}})[_0x4bcc('0x12')](function(_0x4fb281){utils[_0x4bcc('0x13')](util[_0x4bcc('0x4')](_0x4bcc('0x14'),_0x42ed85['uniqueid']),_0x4fb281);});}delete members[_0x42ed85[_0x4bcc('0xa')]];}function startsWith(_0x3ab2f2,_0x32a9ad){return _[_0x4bcc('0x15')](_0x3ab2f2,function(_0x1382b0){return _[_0x4bcc('0x16')](_0x32a9ad,_0x1382b0);});}exports[_0x4bcc('0x17')]=function(_0x1077eb){try{utils[_0x4bcc('0x18')](util[_0x4bcc('0x4')](_0x4bcc('0x19'),members[_0x1077eb[_0x4bcc('0x1a')]]?members[_0x1077eb[_0x4bcc('0x1a')]][_0x4bcc('0x1b')]:_0x1077eb[_0x4bcc('0x1a')]),_0x1077eb);utils[_0x4bcc('0x1c')](util[_0x4bcc('0x4')](_0x4bcc('0x1d'),members[_0x1077eb['device']]?members[_0x1077eb[_0x4bcc('0x1a')]]['uniqueid']:_0x1077eb[_0x4bcc('0x1a')],_0x1077eb[_0x4bcc('0x1e')],_0x1077eb['device']));switch(_0x1077eb[_0x4bcc('0x1e')]){case _0x4bcc('0x1f'):case'BUSY':if(!startsWith(exclude,_0x1077eb[_0x4bcc('0x1a')])){members[_0x1077eb['device']]={'channel':'voice','interface':_0x1077eb[_0x4bcc('0x1a')],'type':_0x4bcc('0x20'),'enterAt':utils[_0x4bcc('0x21')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x4bcc('0x22')](members[_0x1077eb[_0x4bcc('0x1a')]])){members[_0x1077eb[_0x4bcc('0x1a')]]['exitAt']=utils[_0x4bcc('0x21')]();members[_0x1077eb[_0x4bcc('0x1a')]][_0x4bcc('0x23')]=utils[_0x4bcc('0x24')](members[_0x1077eb[_0x4bcc('0x1a')]][_0x4bcc('0x25')],members[_0x1077eb[_0x4bcc('0x1a')]][_0x4bcc('0x26')]);if(members[_0x1077eb[_0x4bcc('0x1a')]]['uniqueid']){writeDB(members[_0x1077eb[_0x4bcc('0x1a')]]);}}break;default:break;}}catch(_0x328e18){utils[_0x4bcc('0x13')](util[_0x4bcc('0x4')](_0x4bcc('0x19'),members[_0x1077eb[_0x4bcc('0x1a')]]?members[_0x1077eb['device']][_0x4bcc('0x1b')]:_0x1077eb['device']),_0x328e18);}};exports[_0x4bcc('0x27')]=function(_0x5b5fa9){try{if(!_['isNil'](members[_0x5b5fa9[_0x4bcc('0xa')]])){utils[_0x4bcc('0x18')](util['format'](_0x4bcc('0x28'),_0x5b5fa9[_0x4bcc('0x1b')]),_0x5b5fa9);utils[_0x4bcc('0x1c')](util[_0x4bcc('0x4')](_0x4bcc('0x29'),_0x5b5fa9[_0x4bcc('0x1b')],_0x5b5fa9[_0x4bcc('0xa')],_0x5b5fa9['queue']));members[_0x5b5fa9[_0x4bcc('0xa')]]=_[_0x4bcc('0x2a')](members[_0x5b5fa9[_0x4bcc('0xa')]],{'data4':_0x5b5fa9[_0x4bcc('0x2b')],'uniqueid':_0x5b5fa9[_0x4bcc('0x1b')]});}}catch(_0x2b7e33){utils[_0x4bcc('0x13')](util[_0x4bcc('0x4')](_0x4bcc('0x28'),_0x5b5fa9[_0x4bcc('0x1b')]),_0x2b7e33);}};exports[_0x4bcc('0x2c')]=function(_0xd924ac){try{utils['debug'](util[_0x4bcc('0x4')](_0x4bcc('0x2d'),_0xd924ac[_0x4bcc('0x1b')]),_0xd924ac);if(_0xd924ac['channel']){var _0xdc72cf=_0xd924ac[_0x4bcc('0x6')][_0x4bcc('0x10')]('-')[0x0];if(!_[_0x4bcc('0x22')](members[_0xdc72cf])){members[_0xdc72cf]=_[_0x4bcc('0x2a')](members[_0xdc72cf],{'data1':members[_0xdc72cf]['data1']||_0xd924ac['type'],'data2':members[_0xdc72cf][_0x4bcc('0x7')]||_0xd924ac[_0x4bcc('0x2e')],'data3':members[_0xdc72cf][_0x4bcc('0x2f')]||_0xd924ac[_0x4bcc('0x30')],'uniqueid':members[_0xdc72cf][_0x4bcc('0x1b')]||_0xd924ac['uniqueid']});utils[_0x4bcc('0x1c')](util[_0x4bcc('0x4')](_0x4bcc('0x31'),_0xd924ac[_0x4bcc('0x1b')],members[_0xdc72cf][_0x4bcc('0x32')],members[_0xdc72cf][_0x4bcc('0x7')],members[_0xdc72cf][_0x4bcc('0x2f')]));if(members[_0xdc72cf][_0x4bcc('0x25')]){writeDB(members[_0xdc72cf]);}}}if(_0xd924ac[_0x4bcc('0x33')]){var _0x4f8971=_0xd924ac[_0x4bcc('0x33')][_0x4bcc('0x10')]('-')[0x0];if(!_[_0x4bcc('0x22')](members[_0x4f8971])){members[_0x4f8971]=_[_0x4bcc('0x2a')](members[_0x4f8971],{'data1':members[_0x4f8971][_0x4bcc('0x32')]||_0xd924ac[_0x4bcc('0x9')],'data2':members[_0x4f8971]['data2']||_0xd924ac[_0x4bcc('0x2e')],'data3':members[_0x4f8971][_0x4bcc('0x2f')]||_0xd924ac[_0x4bcc('0x30')],'uniqueid':members[_0x4f8971][_0x4bcc('0x1b')]||_0xd924ac[_0x4bcc('0x1b')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xd924ac['uniqueid'],members[_0x4f8971][_0x4bcc('0x32')],members[_0x4f8971][_0x4bcc('0x7')],members[_0x4f8971][_0x4bcc('0x2f')]));if(members[_0x4f8971][_0x4bcc('0x25')]){writeDB(members[_0x4f8971]);}}}}catch(_0x1034d4){utils['error'](util[_0x4bcc('0x4')](_0x4bcc('0x2d'),_0xd924ac['uniqueid']),_0x1034d4);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 539322e..fa7dbd3 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 _0x64d5=['COMPLETEDBY','blindtransfer','transfereeuniqueid','transfer','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfererexten','ATTENDED','transfertargetlinkedid','queuecallerenterreason','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','queue','then','type','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','error','format','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','name','[%s][queues][varset]','queuestatus','value','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','reason','TRANSFER'];(function(_0x454bd3,_0x3e4d94){var _0x4eb066=function(_0x4478fa){while(--_0x4478fa){_0x454bd3['push'](_0x454bd3['shift']());}};_0x4eb066(++_0x3e4d94);}(_0x64d5,0x158));var _0x564d=function(_0x51a57c,_0x2d4f0c){_0x51a57c=_0x51a57c-0x0;var _0x3e777d=_0x64d5[_0x51a57c];return _0x3e777d;};'use strict';var _=require(_0x564d('0x0'));var util=require(_0x564d('0x1'));var utils=require(_0x564d('0x2'));var queues={};function writeDB(_0x588953){utils[_0x564d('0x3')](util['format'](_0x564d('0x4'),_0x588953[_0x564d('0x5')],_0x588953[_0x564d('0x6')],_0x588953['queue'],_0x588953[_0x564d('0x7')],_0x588953[_0x564d('0x8')],_0x588953[_0x564d('0x9')],_0x588953['queuecallerexitreason']));if(_0x588953['queue']){utils[_0x564d('0xa')](_0x588953[_0x564d('0xb')])[_0x564d('0xc')](function(_0x50b583){if(_0x50b583){_0x588953[_0x564d('0xd')]=_0x50b583['type'];}utils['request'](_0x564d('0xe'),_0x588953);});}else{utils['request'](_0x564d('0xe'),_0x588953);}if(_0x588953[_0x564d('0xf')]){delete queues[_0x588953['transfereduniqueid']];}else{delete queues[_0x588953[_0x564d('0x5')]];}}exports[_0x564d('0x10')]=function(_0x2cfc12){try{utils[_0x564d('0x11')](util['format'](_0x564d('0x12'),_0x2cfc12['uniqueid']),_0x2cfc12);utils[_0x564d('0x3')](util['format'](_0x564d('0x13'),_0x2cfc12[_0x564d('0x5')],_0x2cfc12['queue'],_0x2cfc12['position']));queues[_0x2cfc12[_0x564d('0x5')]]=_[_0x564d('0x14')](_0x2cfc12,{'originalposition':_0x2cfc12['position'],'queuecallerjoinAt':utils[_0x564d('0x15')](),'mohtime':0x0});}catch(_0xf88384){utils[_0x564d('0x16')](util[_0x564d('0x17')](_0x564d('0x12'),_0x2cfc12['uniqueid']),_0xf88384);}};exports[_0x564d('0x18')]=function(_0x252ab9){try{if(!_[_0x564d('0x19')](queues[_0x252ab9[_0x564d('0x5')]])){utils[_0x564d('0x11')](util[_0x564d('0x17')](_0x564d('0x1a'),_0x252ab9[_0x564d('0x5')]),_0x252ab9);if(queues[_0x252ab9[_0x564d('0x5')]][_0x564d('0x1b')]){if(!queues[_0x252ab9[_0x564d('0x5')]]['queuecallerabandon']&&!queues[_0x252ab9[_0x564d('0x5')]][_0x564d('0x1c')]){queues[_0x252ab9['uniqueid']][_0x564d('0x1d')]=!![];queues[_0x252ab9[_0x564d('0x5')]][_0x564d('0x1e')]=utils[_0x564d('0x15')]();queues[_0x252ab9['uniqueid']][_0x564d('0x1f')]='COMPLETEDBYAGENT';}utils['info'](util[_0x564d('0x17')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x252ab9[_0x564d('0x5')],queues[_0x252ab9[_0x564d('0x5')]][_0x564d('0x20')],queues[_0x252ab9[_0x564d('0x5')]][_0x564d('0x1f')]));writeDB(queues[_0x252ab9[_0x564d('0x5')]]);}else if(queues[_0x252ab9[_0x564d('0x5')]][_0x564d('0xf')]){utils[_0x564d('0x3')](util[_0x564d('0x17')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x252ab9[_0x564d('0x5')],queues[_0x252ab9[_0x564d('0x5')]][_0x564d('0x20')],queues[_0x252ab9['uniqueid']]['transfereduniqueid']));queues[queues[_0x252ab9['uniqueid']][_0x564d('0xf')]]=queues[_0x252ab9[_0x564d('0x5')]];queues[queues[_0x252ab9[_0x564d('0x5')]][_0x564d('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x252ab9[_0x564d('0x5')]];}}}catch(_0x39fa33){utils['error'](util[_0x564d('0x17')](_0x564d('0x1a'),_0x252ab9[_0x564d('0x5')]),_0x39fa33);}};exports['varset']=function(_0x34ec2f){try{utils[_0x564d('0x11')](util[_0x564d('0x17')](_0x564d('0x21'),_0x34ec2f[_0x564d('0x5')]),_0x34ec2f);if(!_['isNil'](_0x34ec2f['variable'][_0x564d('0x22')])&&_0x34ec2f[_0x564d('0x23')]['toUpperCase']()!==_0x564d('0x24')){if(!_[_0x564d('0x19')](queues[_0x34ec2f[_0x564d('0x5')]])){queues[_0x34ec2f['uniqueid']][_0x564d('0x25')]=![];queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x26')]=null;queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x1c')]=!![];queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x27')]=utils['now']();queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x1f')]=_0x34ec2f['value'][_0x564d('0x28')]();utils[_0x564d('0x3')](util[_0x564d('0x17')](_0x564d('0x29'),_0x34ec2f[_0x564d('0x5')],queues[_0x34ec2f['uniqueid']]['name'],_0x34ec2f[_0x564d('0x23')],queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x1f')]));writeDB(queues[_0x34ec2f[_0x564d('0x5')]]);}}else if(!_['isNil'](_0x34ec2f[_0x564d('0x2a')][_0x564d('0x2b')])){if(!_[_0x564d('0x19')](queues[_0x34ec2f[_0x564d('0x5')]])&&!queues[_0x34ec2f['uniqueid']][_0x564d('0x25')]){queues[_0x34ec2f[_0x564d('0x5')]]['queuecallerabandon']=![];queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x26')]=null;queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x1c')]=!![];queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x27')]=utils[_0x564d('0x15')]();queues[_0x34ec2f[_0x564d('0x5')]]['queuecallerexitreason']=_0x564d('0x2c');utils[_0x564d('0x3')](util[_0x564d('0x17')](_0x564d('0x2d'),_0x34ec2f['uniqueid'],queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x20')],_0x34ec2f[_0x564d('0x23')],queues[_0x34ec2f[_0x564d('0x5')]][_0x564d('0x1f')]));}}}catch(_0x47fd86){utils[_0x564d('0x16')](util[_0x564d('0x17')]('[%s][queues][varset]',_0x34ec2f[_0x564d('0x5')]),_0x47fd86);}};exports[_0x564d('0x25')]=function(_0x3debe5){try{if(!_['isNil'](queues[_0x3debe5[_0x564d('0x5')]])){utils[_0x564d('0x11')](util[_0x564d('0x17')](_0x564d('0x2e'),_0x3debe5[_0x564d('0x5')]),_0x3debe5);queues[_0x3debe5[_0x564d('0x5')]][_0x564d('0x1c')]=![];queues[_0x3debe5[_0x564d('0x5')]]['queuecallerexitAt']=null;queues[_0x3debe5[_0x564d('0x5')]][_0x564d('0x25')]=!![];queues[_0x3debe5[_0x564d('0x5')]][_0x564d('0x26')]=utils[_0x564d('0x15')]();queues[_0x3debe5[_0x564d('0x5')]]['queuecallerexitreason']=_0x564d('0x2f');utils[_0x564d('0x3')](util[_0x564d('0x17')](_0x564d('0x30'),_0x3debe5[_0x564d('0x5')],queues[_0x3debe5[_0x564d('0x5')]]['name'],queues[_0x3debe5[_0x564d('0x5')]][_0x564d('0x1f')]));}}catch(_0xf84138){utils[_0x564d('0x16')](util[_0x564d('0x17')]('[%s][queues][queuecallerabandon]',_0x3debe5[_0x564d('0x5')]),_0xf84138);}};exports[_0x564d('0x31')]=function(_0x2f8189){try{if(!_[_0x564d('0x19')](queues[_0x2f8189['uniqueid']])){utils[_0x564d('0x11')](util[_0x564d('0x17')](_0x564d('0x32'),_0x2f8189[_0x564d('0x5')]),_0x2f8189);utils[_0x564d('0x3')](util[_0x564d('0x17')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2f8189[_0x564d('0x5')],queues[_0x2f8189['uniqueid']][_0x564d('0x20')],_0x2f8189[_0x564d('0x33')],_0x2f8189['connectedlinename']));queues[_0x2f8189[_0x564d('0x5')]][_0x564d('0x31')]=!![];queues[_0x2f8189['uniqueid']][_0x564d('0x1b')]=utils[_0x564d('0x15')]();queues[_0x2f8189[_0x564d('0x5')]][_0x564d('0x34')]=utils[_0x564d('0x35')](queues[_0x2f8189['uniqueid']][_0x564d('0x1b')],queues[_0x2f8189[_0x564d('0x5')]][_0x564d('0x36')]);queues[_0x2f8189[_0x564d('0x5')]][_0x564d('0x37')]=_0x2f8189[_0x564d('0x37')];queues[_0x2f8189['uniqueid']][_0x564d('0x38')]=_0x2f8189['count'];queues[_0x2f8189[_0x564d('0x5')]]['connectedlinenum']=_0x2f8189[_0x564d('0x33')];queues[_0x2f8189['uniqueid']][_0x564d('0x39')]=_0x2f8189[_0x564d('0x39')];}}catch(_0x4afabe){utils[_0x564d('0x16')](util[_0x564d('0x17')]('[%s][queues][queuecallerleave]',_0x2f8189[_0x564d('0x5')]),_0x4afabe);}};exports[_0x564d('0x3a')]=function(_0x24b459){try{if(!_[_0x564d('0x19')](queues[_0x24b459[_0x564d('0x5')]])){utils[_0x564d('0x11')](util[_0x564d('0x17')](_0x564d('0x3b'),_0x24b459['uniqueid']),_0x24b459);utils[_0x564d('0x3')](util[_0x564d('0x17')](_0x564d('0x3c'),_0x24b459[_0x564d('0x5')],queues[_0x24b459[_0x564d('0x5')]][_0x564d('0x20')],_0x24b459['membername'],_0x24b459[_0x564d('0x3d')]));queues[_0x24b459[_0x564d('0x5')]][_0x564d('0x25')]=![];queues[_0x24b459[_0x564d('0x5')]][_0x564d('0x25')]=![];queues[_0x24b459[_0x564d('0x5')]][_0x564d('0x26')]=null;queues[_0x24b459[_0x564d('0x5')]][_0x564d('0x1c')]=![];queues[_0x24b459[_0x564d('0x5')]][_0x564d('0x1f')]=null;queues[_0x24b459[_0x564d('0x5')]]['queuecallerexitAt']=null;queues[_0x24b459[_0x564d('0x5')]][_0x564d('0x3e')]=!![];queues[_0x24b459[_0x564d('0x5')]]['accountcode']=_0x24b459[_0x564d('0x3d')];queues[_0x24b459['uniqueid']][_0x564d('0x7')]=_0x24b459[_0x564d('0x3f')];}}catch(_0x3a95e1){utils['error'](util[_0x564d('0x17')](_0x564d('0x3b'),_0x24b459[_0x564d('0x5')]),_0x3a95e1);}};exports[_0x564d('0x40')]=function(_0x44c851){try{if(!_[_0x564d('0x19')](queues[_0x44c851[_0x564d('0x5')]])){if(queues[_0x44c851[_0x564d('0x5')]]['queuecallerleaveAt']){utils['debug'](util[_0x564d('0x17')](_0x564d('0x41'),_0x44c851[_0x564d('0x5')]),_0x44c851);queues[_0x44c851['uniqueid']]['queuecallerabandon']=![];queues[_0x44c851['uniqueid']][_0x564d('0x25')]=![];queues[_0x44c851['uniqueid']][_0x564d('0x26')]=null;queues[_0x44c851[_0x564d('0x5')]][_0x564d('0x1c')]=![];queues[_0x44c851['uniqueid']][_0x564d('0x27')]=null;queues[_0x44c851[_0x564d('0x5')]]['assigned']=!![];queues[_0x44c851[_0x564d('0x5')]][_0x564d('0x7')]=_0x44c851[_0x564d('0x3f')];queues[_0x44c851['uniqueid']]['queuecallercomplete']=!![];queues[_0x44c851[_0x564d('0x5')]][_0x564d('0x1e')]=utils[_0x564d('0x15')]();if(_0x44c851[_0x564d('0x42')]=='transfer'){if(!queues[_0x44c851[_0x564d('0x5')]]['transfer']){queues[_0x44c851[_0x564d('0x5')]][_0x564d('0x1f')]=_0x564d('0x43');}}else{queues[_0x44c851['uniqueid']][_0x564d('0x1f')]=_0x564d('0x44')+_0x44c851[_0x564d('0x42')][_0x564d('0x28')]();}utils[_0x564d('0x3')](util[_0x564d('0x17')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x44c851[_0x564d('0x5')],queues[_0x44c851[_0x564d('0x5')]][_0x564d('0x20')],_0x44c851['membername'],queues[_0x44c851[_0x564d('0x5')]][_0x564d('0x1f')]));writeDB(queues[_0x44c851[_0x564d('0x5')]]);}}}catch(_0x504862){utils[_0x564d('0x16')](util[_0x564d('0x17')](_0x564d('0x41'),_0x44c851[_0x564d('0x5')]),_0x504862);}};exports[_0x564d('0x45')]=function(_0x575eed){try{if(!_['isNil'](queues[_0x575eed[_0x564d('0x46')]])){utils[_0x564d('0x11')](util[_0x564d('0x17')]('[%s][queues][blindtransfer]',_0x575eed[_0x564d('0x5')]),_0x575eed);queues[_0x575eed[_0x564d('0x46')]][_0x564d('0x47')]=!![];queues[_0x575eed[_0x564d('0x46')]][_0x564d('0x48')]=_0x564d('0x49');queues[_0x575eed[_0x564d('0x46')]][_0x564d('0x4a')]=_0x575eed['extension'];queues[_0x575eed[_0x564d('0x46')]][_0x564d('0x4b')]=_0x575eed[_0x564d('0x46')];queues[_0x575eed[_0x564d('0x46')]][_0x564d('0x1f')]=_0x564d('0x4c');utils[_0x564d('0x3')](util[_0x564d('0x17')](_0x564d('0x4d'),_0x575eed[_0x564d('0x5')],queues[_0x575eed[_0x564d('0x46')]][_0x564d('0x20')],_0x575eed[_0x564d('0x46')],_0x575eed['extension']));}}catch(_0x40b91c){utils[_0x564d('0x16')](util[_0x564d('0x17')](_0x564d('0x4e'),_0x575eed[_0x564d('0x5')]),_0x40b91c);}};exports['attendedtransfer']=function(_0x39e34f){try{utils[_0x564d('0x11')](util[_0x564d('0x17')]('[%s][queues][attendedtransfer]',_0x39e34f[_0x564d('0x4f')]),_0x39e34f);if(_0x39e34f[_0x564d('0x4f')]==_0x39e34f[_0x564d('0x50')]){if(!_[_0x564d('0x19')](queues[_0x39e34f['secondtransfererlinkedid']])){utils[_0x564d('0x3')](util[_0x564d('0x17')](_0x564d('0x51'),_0x39e34f[_0x564d('0x4f')],queues[_0x39e34f[_0x564d('0x52')]][_0x564d('0x20')],_0x39e34f[_0x564d('0x53')]));queues[_0x39e34f[_0x564d('0x52')]][_0x564d('0x47')]=!![];queues[_0x39e34f['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x39e34f['secondtransfererlinkedid']]['transferexten']=_0x39e34f[_0x564d('0x53')];queues[_0x39e34f[_0x564d('0x52')]][_0x564d('0x4b')]=_0x39e34f[_0x564d('0x4f')];queues[_0x39e34f[_0x564d('0x52')]]['queuecallerexitreason']=_0x564d('0x54');}if(!_['isNil'](queues[_0x39e34f[_0x564d('0x50')]])){if(_0x39e34f[_0x564d('0x55')]&&queues[_0x39e34f[_0x564d('0x55')]]){queues[_0x39e34f[_0x564d('0x55')]]['queuecallerenterreason']=0x1;queues[_0x39e34f['transfereeuniqueid']]=_[_0x564d('0x56')](queues[_0x39e34f[_0x564d('0x55')]]);queues[_0x39e34f[_0x564d('0x46')]][_0x564d('0xf')]=_0x39e34f[_0x564d('0x57')];queues[_0x39e34f[_0x564d('0x46')]]['queuecallerenterreason']=0x2;queues[_0x39e34f[_0x564d('0x46')]][_0x564d('0x8')]=queues[_0x39e34f['secondtransfererlinkedid']][_0x564d('0x8')];queues[_0x39e34f[_0x564d('0x46')]][_0x564d('0x58')]=queues[_0x39e34f[_0x564d('0x52')]][_0x564d('0x58')];queues[_0x39e34f['transfereeuniqueid']][_0x564d('0x36')]=utils[_0x564d('0x15')]();queues[_0x39e34f['transfereeuniqueid']][_0x564d('0x1b')]=utils[_0x564d('0x15')]();queues[_0x39e34f[_0x564d('0x46')]]['holdtime']=0x0;queues[_0x39e34f[_0x564d('0x46')]][_0x564d('0x59')]=0x0;utils[_0x564d('0x3')](util[_0x564d('0x17')](_0x564d('0x5a'),_0x39e34f[_0x564d('0x4f')],queues[_0x39e34f[_0x564d('0x46')]][_0x564d('0x20')],queues[_0x39e34f['transfereeuniqueid']][_0x564d('0x8')],queues[_0x39e34f[_0x564d('0x46')]]['calleridname']));}else{utils[_0x564d('0x3')](util[_0x564d('0x17')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x39e34f['origtransfereruniqueid'],queues[_0x39e34f[_0x564d('0x50')]][_0x564d('0x20')],_0x39e34f[_0x564d('0x52')]));queues[_0x39e34f[_0x564d('0x50')]]['transfereduniqueid']=_0x39e34f[_0x564d('0x52')];}}}else if(_0x39e34f['secondtransfereruniqueid']==_0x39e34f[_0x564d('0x52')]){if(!_['isNil'](queues[_0x39e34f[_0x564d('0x50')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x39e34f['origtransfereruniqueid'],queues[_0x39e34f[_0x564d('0x50')]][_0x564d('0x20')],_0x39e34f['secondtransfereruniqueid'],_0x39e34f[_0x564d('0x5b')]));queues[_0x39e34f[_0x564d('0x50')]][_0x564d('0x47')]=!![];queues[_0x39e34f[_0x564d('0x50')]][_0x564d('0x48')]=_0x564d('0x5c');queues[_0x39e34f[_0x564d('0x50')]]['transferexten']=_0x39e34f[_0x564d('0x5b')];queues[_0x39e34f['origtransfererlinkedid']][_0x564d('0x4b')]=_0x39e34f['secondtransfereruniqueid'];queues[_0x39e34f[_0x564d('0x50')]]['queuecallerexitreason']=_0x564d('0x54');}if(!_[_0x564d('0x19')](queues[_0x39e34f[_0x564d('0x52')]])){if(_0x39e34f['transfertargetlinkedid']&&queues[_0x39e34f[_0x564d('0x5d')]]){queues[_0x39e34f[_0x564d('0x5d')]][_0x564d('0x5e')]=0x1;queues[_0x39e34f[_0x564d('0x57')]]=_['clone'](queues[_0x39e34f['transfertargetlinkedid']]);queues[_0x39e34f[_0x564d('0x57')]][_0x564d('0xf')]=_0x39e34f[_0x564d('0x57')];queues[_0x39e34f[_0x564d('0x57')]]['queuecallerenterreason']=0x2;queues[_0x39e34f[_0x564d('0x57')]]['calleridnum']=queues[_0x39e34f[_0x564d('0x50')]]['calleridnum'];queues[_0x39e34f[_0x564d('0x57')]][_0x564d('0x58')]=queues[_0x39e34f['origtransfererlinkedid']][_0x564d('0x58')];queues[_0x39e34f[_0x564d('0x57')]]['queuecallerjoinAt']=utils[_0x564d('0x15')]();queues[_0x39e34f[_0x564d('0x57')]]['queuecallerleaveAt']=utils[_0x564d('0x15')]();queues[_0x39e34f[_0x564d('0x57')]][_0x564d('0x34')]=0x0;queues[_0x39e34f[_0x564d('0x57')]]['mohtime']=0x0;utils['info'](util[_0x564d('0x17')](_0x564d('0x5f'),_0x39e34f[_0x564d('0x4f')],queues[_0x39e34f[_0x564d('0x57')]]['name'],queues[_0x39e34f[_0x564d('0x57')]][_0x564d('0xf')],queues[_0x39e34f[_0x564d('0x57')]][_0x564d('0x8')],queues[_0x39e34f['transfertargetuniqueid']][_0x564d('0x58')]));}else{utils['info'](util[_0x564d('0x17')](_0x564d('0x60'),_0x39e34f[_0x564d('0x4f')],queues[_0x39e34f[_0x564d('0x52')]][_0x564d('0x20')],_0x39e34f[_0x564d('0x50')]));queues[_0x39e34f[_0x564d('0x52')]][_0x564d('0xf')]=_0x39e34f['origtransfererlinkedid'];}}}}catch(_0x1ba953){utils[_0x564d('0x16')](util['format']('[%s][queues][attendedtransfer]',_0x39e34f['origtransfereruniqueid']),_0x1ba953);}};exports['musiconholdstart']=function(_0x3f84b3){try{if(!_[_0x564d('0x19')](queues[_0x3f84b3[_0x564d('0x5')]])){utils[_0x564d('0x11')](util[_0x564d('0x17')](_0x564d('0x61'),_0x3f84b3['uniqueid']),_0x3f84b3);queues[_0x3f84b3['uniqueid']][_0x564d('0x62')]=utils[_0x564d('0x15')]();utils['info'](util['format'](_0x564d('0x63'),_0x3f84b3['uniqueid'],queues[_0x3f84b3[_0x564d('0x5')]][_0x564d('0x20')],queues[_0x3f84b3[_0x564d('0x5')]][_0x564d('0x62')]));}}catch(_0x135310){utils[_0x564d('0x16')](util[_0x564d('0x17')](_0x564d('0x61'),_0x3f84b3[_0x564d('0x5')]),_0x135310);}};exports[_0x564d('0x64')]=function(_0x3bd2e9){try{if(!_[_0x564d('0x19')](queues[_0x3bd2e9[_0x564d('0x5')]])){if(!_[_0x564d('0x19')](queues[_0x3bd2e9['uniqueid']][_0x564d('0x62')])){utils[_0x564d('0x11')](util['format'](_0x564d('0x65'),_0x3bd2e9[_0x564d('0x5')]),_0x3bd2e9);queues[_0x3bd2e9['uniqueid']]['mohtime']+=utils[_0x564d('0x35')](utils[_0x564d('0x15')](),queues[_0x3bd2e9[_0x564d('0x5')]]['musiconholdstartAt']);utils['info'](util['format'](_0x564d('0x66'),_0x3bd2e9[_0x564d('0x5')],queues[_0x3bd2e9[_0x564d('0x5')]][_0x564d('0x20')],queues[_0x3bd2e9[_0x564d('0x5')]][_0x564d('0x59')]));delete queues[_0x3bd2e9[_0x564d('0x5')]][_0x564d('0x62')];}}}catch(_0x7703be){utils[_0x564d('0x16')](util[_0x564d('0x17')]('[%s][queues][musiconholdstop]',_0x3bd2e9[_0x564d('0x5')]),_0x7703be);}}; \ No newline at end of file +var _0x9912=['queuecallercomplete','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','variable','value','toUpperCase','queuecallerabandonAt','queueposition','queuecallerexitAt','EXITWITHKEY','name','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','agentcomplete','queuecallercompleteAt','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','transfertype','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','musiconholdstart','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','[%s][queues][queuecallerjoin]','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9912,0x165));var _0x2991=function(_0x26d376,_0xf43f17){_0x26d376=_0x26d376-0x0;var _0x2accc2=_0x9912[_0x26d376];return _0x2accc2;};'use strict';var _=require('lodash');var util=require(_0x2991('0x0'));var utils=require('./utils');var queues={};function writeDB(_0xf22970){utils['info'](util[_0x2991('0x1')](_0x2991('0x2'),_0xf22970[_0x2991('0x3')],_0xf22970[_0x2991('0x4')],_0xf22970[_0x2991('0x5')],_0xf22970[_0x2991('0x6')],_0xf22970['calleridnum'],_0xf22970[_0x2991('0x7')],_0xf22970[_0x2991('0x8')]));if(_0xf22970[_0x2991('0x5')]){utils[_0x2991('0x9')](_0xf22970[_0x2991('0x5')])[_0x2991('0xa')](function(_0x23eb2e){if(_0x23eb2e){_0xf22970[_0x2991('0xb')]=_0x23eb2e[_0x2991('0xb')];}utils[_0x2991('0xc')](_0x2991('0xd'),_0xf22970);});}else{utils[_0x2991('0xc')](_0x2991('0xd'),_0xf22970);}if(_0xf22970[_0x2991('0xe')]){delete queues[_0xf22970[_0x2991('0xe')]];}else{delete queues[_0xf22970['uniqueid']];}}exports['queuecallerjoin']=function(_0x44e58c){try{utils[_0x2991('0xf')](util[_0x2991('0x1')]('[%s][queues][queuecallerjoin]',_0x44e58c['uniqueid']),_0x44e58c);utils[_0x2991('0x10')](util[_0x2991('0x1')](_0x2991('0x11'),_0x44e58c[_0x2991('0x3')],_0x44e58c[_0x2991('0x5')],_0x44e58c[_0x2991('0x12')]));queues[_0x44e58c[_0x2991('0x3')]]=_[_0x2991('0x13')](_0x44e58c,{'originalposition':_0x44e58c[_0x2991('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x50c9ed){utils[_0x2991('0x14')](util[_0x2991('0x1')](_0x2991('0x15'),_0x44e58c['uniqueid']),_0x50c9ed);}};exports['hangup']=function(_0x43ffcc){try{if(!_[_0x2991('0x16')](queues[_0x43ffcc[_0x2991('0x3')]])){utils[_0x2991('0xf')](util['format'](_0x2991('0x17'),_0x43ffcc['uniqueid']),_0x43ffcc);if(queues[_0x43ffcc[_0x2991('0x3')]][_0x2991('0x18')]){if(!queues[_0x43ffcc[_0x2991('0x3')]][_0x2991('0x19')]&&!queues[_0x43ffcc['uniqueid']][_0x2991('0x1a')]){queues[_0x43ffcc['uniqueid']][_0x2991('0x1b')]=!![];queues[_0x43ffcc[_0x2991('0x3')]]['queuecallercompleteAt']=utils[_0x2991('0x1c')]();queues[_0x43ffcc['uniqueid']][_0x2991('0x8')]=_0x2991('0x1d');}utils[_0x2991('0x10')](util[_0x2991('0x1')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x43ffcc[_0x2991('0x3')],queues[_0x43ffcc[_0x2991('0x3')]]['name'],queues[_0x43ffcc[_0x2991('0x3')]][_0x2991('0x8')]));writeDB(queues[_0x43ffcc['uniqueid']]);}else if(queues[_0x43ffcc['uniqueid']][_0x2991('0xe')]){utils[_0x2991('0x10')](util[_0x2991('0x1')](_0x2991('0x1e'),_0x43ffcc['uniqueid'],queues[_0x43ffcc[_0x2991('0x3')]]['name'],queues[_0x43ffcc['uniqueid']][_0x2991('0xe')]));queues[queues[_0x43ffcc[_0x2991('0x3')]][_0x2991('0xe')]]=queues[_0x43ffcc[_0x2991('0x3')]];queues[queues[_0x43ffcc['uniqueid']]['transfereduniqueid']][_0x2991('0x1f')]=0x2;delete queues[_0x43ffcc[_0x2991('0x3')]];}}}catch(_0x31fd7c){utils[_0x2991('0x14')](util[_0x2991('0x1')]('[%s][queues][hangup]',_0x43ffcc[_0x2991('0x3')]),_0x31fd7c);}};exports['varset']=function(_0x41dfd1){try{utils[_0x2991('0xf')](util[_0x2991('0x1')](_0x2991('0x20'),_0x41dfd1[_0x2991('0x3')]),_0x41dfd1);if(!_[_0x2991('0x16')](_0x41dfd1[_0x2991('0x21')]['queuestatus'])&&_0x41dfd1[_0x2991('0x22')][_0x2991('0x23')]()!=='CONTINUE'){if(!_[_0x2991('0x16')](queues[_0x41dfd1[_0x2991('0x3')]])){queues[_0x41dfd1[_0x2991('0x3')]][_0x2991('0x19')]=![];queues[_0x41dfd1[_0x2991('0x3')]][_0x2991('0x24')]=null;queues[_0x41dfd1[_0x2991('0x3')]][_0x2991('0x1a')]=!![];queues[_0x41dfd1[_0x2991('0x3')]]['queuecallerexitAt']=utils['now']();queues[_0x41dfd1[_0x2991('0x3')]][_0x2991('0x8')]=_0x41dfd1[_0x2991('0x22')][_0x2991('0x23')]();utils[_0x2991('0x10')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x41dfd1[_0x2991('0x3')],queues[_0x41dfd1[_0x2991('0x3')]]['name'],_0x41dfd1[_0x2991('0x22')],queues[_0x41dfd1[_0x2991('0x3')]][_0x2991('0x8')]));writeDB(queues[_0x41dfd1[_0x2991('0x3')]]);}}else if(!_[_0x2991('0x16')](_0x41dfd1[_0x2991('0x21')][_0x2991('0x25')])){if(!_['isNil'](queues[_0x41dfd1[_0x2991('0x3')]])&&!queues[_0x41dfd1[_0x2991('0x3')]]['queuecallerabandon']){queues[_0x41dfd1['uniqueid']][_0x2991('0x19')]=![];queues[_0x41dfd1['uniqueid']][_0x2991('0x24')]=null;queues[_0x41dfd1[_0x2991('0x3')]]['queuecallerexit']=!![];queues[_0x41dfd1['uniqueid']][_0x2991('0x26')]=utils[_0x2991('0x1c')]();queues[_0x41dfd1['uniqueid']][_0x2991('0x8')]=_0x2991('0x27');utils[_0x2991('0x10')](util[_0x2991('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x41dfd1[_0x2991('0x3')],queues[_0x41dfd1[_0x2991('0x3')]][_0x2991('0x28')],_0x41dfd1[_0x2991('0x22')],queues[_0x41dfd1[_0x2991('0x3')]]['queuecallerexitreason']));}}}catch(_0x4a2fe9){utils['error'](util[_0x2991('0x1')]('[%s][queues][varset]',_0x41dfd1[_0x2991('0x3')]),_0x4a2fe9);}};exports[_0x2991('0x19')]=function(_0x49da05){try{if(!_[_0x2991('0x16')](queues[_0x49da05['uniqueid']])){utils[_0x2991('0xf')](util[_0x2991('0x1')]('[%s][queues][queuecallerabandon]',_0x49da05[_0x2991('0x3')]),_0x49da05);queues[_0x49da05[_0x2991('0x3')]]['queuecallerexit']=![];queues[_0x49da05[_0x2991('0x3')]]['queuecallerexitAt']=null;queues[_0x49da05[_0x2991('0x3')]][_0x2991('0x19')]=!![];queues[_0x49da05['uniqueid']][_0x2991('0x24')]=utils[_0x2991('0x1c')]();queues[_0x49da05[_0x2991('0x3')]][_0x2991('0x8')]=_0x2991('0x29');utils[_0x2991('0x10')](util[_0x2991('0x1')](_0x2991('0x2a'),_0x49da05[_0x2991('0x3')],queues[_0x49da05[_0x2991('0x3')]][_0x2991('0x28')],queues[_0x49da05[_0x2991('0x3')]][_0x2991('0x8')]));}}catch(_0x3e4b27){utils[_0x2991('0x14')](util[_0x2991('0x1')](_0x2991('0x2b'),_0x49da05[_0x2991('0x3')]),_0x3e4b27);}};exports[_0x2991('0x2c')]=function(_0x4dc015){try{if(!_[_0x2991('0x16')](queues[_0x4dc015['uniqueid']])){utils[_0x2991('0xf')](util[_0x2991('0x1')](_0x2991('0x2d'),_0x4dc015[_0x2991('0x3')]),_0x4dc015);utils[_0x2991('0x10')](util[_0x2991('0x1')](_0x2991('0x2e'),_0x4dc015[_0x2991('0x3')],queues[_0x4dc015[_0x2991('0x3')]][_0x2991('0x28')],_0x4dc015['connectedlinenum'],_0x4dc015[_0x2991('0x2f')]));queues[_0x4dc015[_0x2991('0x3')]][_0x2991('0x2c')]=!![];queues[_0x4dc015[_0x2991('0x3')]]['queuecallerleaveAt']=utils['now']();queues[_0x4dc015[_0x2991('0x3')]][_0x2991('0x30')]=utils[_0x2991('0x31')](queues[_0x4dc015['uniqueid']][_0x2991('0x18')],queues[_0x4dc015['uniqueid']][_0x2991('0x32')]);queues[_0x4dc015[_0x2991('0x3')]][_0x2991('0x12')]=_0x4dc015[_0x2991('0x12')];queues[_0x4dc015[_0x2991('0x3')]][_0x2991('0x33')]=_0x4dc015[_0x2991('0x33')];queues[_0x4dc015['uniqueid']]['connectedlinenum']=_0x4dc015['connectedlinenum'];queues[_0x4dc015['uniqueid']][_0x2991('0x2f')]=_0x4dc015[_0x2991('0x2f')];}}catch(_0x405c0a){utils[_0x2991('0x14')](util[_0x2991('0x1')](_0x2991('0x2d'),_0x4dc015['uniqueid']),_0x405c0a);}};exports[_0x2991('0x34')]=function(_0x37c319){try{if(!_['isNil'](queues[_0x37c319[_0x2991('0x3')]])){utils[_0x2991('0xf')](util['format'](_0x2991('0x35'),_0x37c319[_0x2991('0x3')]),_0x37c319);utils['info'](util[_0x2991('0x1')](_0x2991('0x36'),_0x37c319['uniqueid'],queues[_0x37c319[_0x2991('0x3')]][_0x2991('0x28')],_0x37c319['membername'],_0x37c319[_0x2991('0x37')]));queues[_0x37c319[_0x2991('0x3')]]['queuecallerabandon']=![];queues[_0x37c319[_0x2991('0x3')]][_0x2991('0x19')]=![];queues[_0x37c319[_0x2991('0x3')]]['queuecallerabandonAt']=null;queues[_0x37c319[_0x2991('0x3')]][_0x2991('0x1a')]=![];queues[_0x37c319['uniqueid']][_0x2991('0x8')]=null;queues[_0x37c319['uniqueid']][_0x2991('0x26')]=null;queues[_0x37c319[_0x2991('0x3')]]['assigned']=!![];queues[_0x37c319[_0x2991('0x3')]][_0x2991('0x7')]=_0x37c319[_0x2991('0x37')];queues[_0x37c319[_0x2991('0x3')]][_0x2991('0x6')]=_0x37c319[_0x2991('0x38')];}}catch(_0x1de834){utils['error'](util['format'](_0x2991('0x35'),_0x37c319['uniqueid']),_0x1de834);}};exports[_0x2991('0x39')]=function(_0x265796){try{if(!_[_0x2991('0x16')](queues[_0x265796[_0x2991('0x3')]])){if(queues[_0x265796[_0x2991('0x3')]][_0x2991('0x18')]){utils[_0x2991('0xf')](util['format']('[%s][queues][agentcomplete]',_0x265796['uniqueid']),_0x265796);queues[_0x265796[_0x2991('0x3')]][_0x2991('0x19')]=![];queues[_0x265796[_0x2991('0x3')]][_0x2991('0x19')]=![];queues[_0x265796[_0x2991('0x3')]]['queuecallerabandonAt']=null;queues[_0x265796[_0x2991('0x3')]]['queuecallerexit']=![];queues[_0x265796[_0x2991('0x3')]][_0x2991('0x26')]=null;queues[_0x265796['uniqueid']]['assigned']=!![];queues[_0x265796[_0x2991('0x3')]][_0x2991('0x6')]=_0x265796[_0x2991('0x38')];queues[_0x265796['uniqueid']][_0x2991('0x1b')]=!![];queues[_0x265796[_0x2991('0x3')]][_0x2991('0x3a')]=utils[_0x2991('0x1c')]();if(_0x265796['reason']==_0x2991('0x3b')){if(!queues[_0x265796[_0x2991('0x3')]]['transfer']){queues[_0x265796[_0x2991('0x3')]][_0x2991('0x8')]=_0x2991('0x3c');}}else{queues[_0x265796[_0x2991('0x3')]][_0x2991('0x8')]=_0x2991('0x3d')+_0x265796[_0x2991('0x3e')][_0x2991('0x23')]();}utils[_0x2991('0x10')](util['format'](_0x2991('0x3f'),_0x265796[_0x2991('0x3')],queues[_0x265796['uniqueid']]['name'],_0x265796[_0x2991('0x38')],queues[_0x265796[_0x2991('0x3')]][_0x2991('0x8')]));writeDB(queues[_0x265796['uniqueid']]);}}}catch(_0x35f396){utils['error'](util[_0x2991('0x1')](_0x2991('0x40'),_0x265796['uniqueid']),_0x35f396);}};exports[_0x2991('0x41')]=function(_0x3ff56e){try{if(!_[_0x2991('0x16')](queues[_0x3ff56e[_0x2991('0x42')]])){utils[_0x2991('0xf')](util['format']('[%s][queues][blindtransfer]',_0x3ff56e[_0x2991('0x3')]),_0x3ff56e);queues[_0x3ff56e['transfereeuniqueid']]['transfer']=!![];queues[_0x3ff56e[_0x2991('0x42')]]['transfertype']=_0x2991('0x43');queues[_0x3ff56e['transfereeuniqueid']][_0x2991('0x44')]=_0x3ff56e[_0x2991('0x45')];queues[_0x3ff56e[_0x2991('0x42')]]['transferuniqueid']=_0x3ff56e[_0x2991('0x42')];queues[_0x3ff56e[_0x2991('0x42')]][_0x2991('0x8')]='BLINDTRANSFER';utils[_0x2991('0x10')](util[_0x2991('0x1')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x3ff56e[_0x2991('0x3')],queues[_0x3ff56e[_0x2991('0x42')]][_0x2991('0x28')],_0x3ff56e[_0x2991('0x42')],_0x3ff56e[_0x2991('0x45')]));}}catch(_0xe3968d){utils[_0x2991('0x14')](util[_0x2991('0x1')]('[%s][queues][blindtransfer]',_0x3ff56e['uniqueid']),_0xe3968d);}};exports[_0x2991('0x46')]=function(_0x1d45af){try{utils['debug'](util['format'](_0x2991('0x47'),_0x1d45af[_0x2991('0x48')]),_0x1d45af);if(_0x1d45af[_0x2991('0x48')]==_0x1d45af['origtransfererlinkedid']){if(!_[_0x2991('0x16')](queues[_0x1d45af[_0x2991('0x49')]])){utils[_0x2991('0x10')](util[_0x2991('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1d45af[_0x2991('0x48')],queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0x28')],_0x1d45af['origtransfererexten']));queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0x3b')]=!![];queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0x4a')]=_0x2991('0x4b');queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0x44')]=_0x1d45af[_0x2991('0x4c')];queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0x4d')]=_0x1d45af[_0x2991('0x48')];queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0x8')]=_0x2991('0x4e');}if(!_[_0x2991('0x16')](queues[_0x1d45af[_0x2991('0x4f')]])){if(_0x1d45af[_0x2991('0x50')]&&queues[_0x1d45af['transfereelinkedid']]){queues[_0x1d45af[_0x2991('0x50')]]['queuecallerenterreason']=0x1;queues[_0x1d45af[_0x2991('0x42')]]=_['clone'](queues[_0x1d45af['transfereelinkedid']]);queues[_0x1d45af[_0x2991('0x42')]][_0x2991('0xe')]=_0x1d45af['transfertargetuniqueid'];queues[_0x1d45af['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x1d45af[_0x2991('0x42')]][_0x2991('0x51')]=queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0x51')];queues[_0x1d45af[_0x2991('0x42')]][_0x2991('0x52')]=queues[_0x1d45af[_0x2991('0x49')]]['calleridname'];queues[_0x1d45af[_0x2991('0x42')]][_0x2991('0x32')]=utils[_0x2991('0x1c')]();queues[_0x1d45af['transfereeuniqueid']][_0x2991('0x18')]=utils[_0x2991('0x1c')]();queues[_0x1d45af[_0x2991('0x42')]][_0x2991('0x30')]=0x0;queues[_0x1d45af[_0x2991('0x42')]][_0x2991('0x53')]=0x0;utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1d45af[_0x2991('0x48')],queues[_0x1d45af[_0x2991('0x42')]][_0x2991('0x28')],queues[_0x1d45af[_0x2991('0x42')]]['calleridnum'],queues[_0x1d45af[_0x2991('0x42')]][_0x2991('0x52')]));}else{utils[_0x2991('0x10')](util[_0x2991('0x1')](_0x2991('0x54'),_0x1d45af[_0x2991('0x48')],queues[_0x1d45af[_0x2991('0x4f')]][_0x2991('0x28')],_0x1d45af[_0x2991('0x49')]));queues[_0x1d45af[_0x2991('0x4f')]][_0x2991('0xe')]=_0x1d45af[_0x2991('0x49')];}}}else if(_0x1d45af[_0x2991('0x55')]==_0x1d45af[_0x2991('0x49')]){if(!_[_0x2991('0x16')](queues[_0x1d45af[_0x2991('0x4f')]])){utils[_0x2991('0x10')](util[_0x2991('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1d45af[_0x2991('0x48')],queues[_0x1d45af[_0x2991('0x4f')]]['name'],_0x1d45af[_0x2991('0x55')],_0x1d45af[_0x2991('0x56')]));queues[_0x1d45af[_0x2991('0x4f')]]['transfer']=!![];queues[_0x1d45af[_0x2991('0x4f')]][_0x2991('0x4a')]=_0x2991('0x4b');queues[_0x1d45af[_0x2991('0x4f')]]['transferexten']=_0x1d45af['secondtransfererexten'];queues[_0x1d45af['origtransfererlinkedid']][_0x2991('0x4d')]=_0x1d45af[_0x2991('0x55')];queues[_0x1d45af[_0x2991('0x4f')]][_0x2991('0x8')]=_0x2991('0x4e');}if(!_['isNil'](queues[_0x1d45af[_0x2991('0x49')]])){if(_0x1d45af[_0x2991('0x57')]&&queues[_0x1d45af[_0x2991('0x57')]]){queues[_0x1d45af[_0x2991('0x57')]][_0x2991('0x1f')]=0x1;queues[_0x1d45af[_0x2991('0x58')]]=_[_0x2991('0x59')](queues[_0x1d45af[_0x2991('0x57')]]);queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0xe')]=_0x1d45af[_0x2991('0x58')];queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0x1f')]=0x2;queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0x51')]=queues[_0x1d45af[_0x2991('0x4f')]][_0x2991('0x51')];queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0x52')]=queues[_0x1d45af[_0x2991('0x4f')]][_0x2991('0x52')];queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0x32')]=utils[_0x2991('0x1c')]();queues[_0x1d45af[_0x2991('0x58')]]['queuecallerleaveAt']=utils[_0x2991('0x1c')]();queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0x30')]=0x0;queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0x53')]=0x0;utils['info'](util[_0x2991('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1d45af[_0x2991('0x48')],queues[_0x1d45af['transfertargetuniqueid']][_0x2991('0x28')],queues[_0x1d45af[_0x2991('0x58')]]['transfereduniqueid'],queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0x51')],queues[_0x1d45af[_0x2991('0x58')]][_0x2991('0x52')]));}else{utils[_0x2991('0x10')](util[_0x2991('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1d45af[_0x2991('0x48')],queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0x28')],_0x1d45af[_0x2991('0x4f')]));queues[_0x1d45af[_0x2991('0x49')]][_0x2991('0xe')]=_0x1d45af[_0x2991('0x4f')];}}}}catch(_0x1f0ec2){utils[_0x2991('0x14')](util[_0x2991('0x1')]('[%s][queues][attendedtransfer]',_0x1d45af[_0x2991('0x48')]),_0x1f0ec2);}};exports[_0x2991('0x5a')]=function(_0x51ed93){try{if(!_[_0x2991('0x16')](queues[_0x51ed93[_0x2991('0x3')]])){utils[_0x2991('0xf')](util['format']('[%s][queues][musiconholdstart]',_0x51ed93[_0x2991('0x3')]),_0x51ed93);queues[_0x51ed93['uniqueid']]['musiconholdstartAt']=utils['now']();utils[_0x2991('0x10')](util[_0x2991('0x1')](_0x2991('0x5b'),_0x51ed93[_0x2991('0x3')],queues[_0x51ed93[_0x2991('0x3')]][_0x2991('0x28')],queues[_0x51ed93[_0x2991('0x3')]][_0x2991('0x5c')]));}}catch(_0x1114d4){utils[_0x2991('0x14')](util[_0x2991('0x1')](_0x2991('0x5d'),_0x51ed93['uniqueid']),_0x1114d4);}};exports['musiconholdstop']=function(_0xee4e92){try{if(!_[_0x2991('0x16')](queues[_0xee4e92[_0x2991('0x3')]])){if(!_[_0x2991('0x16')](queues[_0xee4e92['uniqueid']][_0x2991('0x5c')])){utils[_0x2991('0xf')](util[_0x2991('0x1')]('[%s][queues][musiconholdstop]',_0xee4e92[_0x2991('0x3')]),_0xee4e92);queues[_0xee4e92['uniqueid']][_0x2991('0x53')]+=utils[_0x2991('0x31')](utils['now'](),queues[_0xee4e92[_0x2991('0x3')]][_0x2991('0x5c')]);utils[_0x2991('0x10')](util[_0x2991('0x1')](_0x2991('0x5e'),_0xee4e92[_0x2991('0x3')],queues[_0xee4e92['uniqueid']][_0x2991('0x28')],queues[_0xee4e92[_0x2991('0x3')]][_0x2991('0x53')]));delete queues[_0xee4e92[_0x2991('0x3')]]['musiconholdstartAt'];}}}catch(_0x4e24a4){utils['error'](util[_0x2991('0x1')](_0x2991('0x5f'),_0xee4e92[_0x2991('0x3')]),_0x4e24a4);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 6802c92..8d195d3 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 _0xb689=['value','endsWith','.wav49','replace','.WAV','find','monitors','push','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','error','[%s][recordings][newchannel]','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]'];(function(_0x9688d9,_0x422072){var _0x5a699f=function(_0x2e9695){while(--_0x2e9695){_0x9688d9['push'](_0x9688d9['shift']());}};_0x5a699f(++_0x422072);}(_0xb689,0x6f));var _0x9b68=function(_0xb3f660,_0x2937b6){_0xb3f660=_0xb3f660-0x0;var _0x4b3d1a=_0xb689[_0xb3f660];return _0x4b3d1a;};'use strict';var _=require(_0x9b68('0x0'));var util=require(_0x9b68('0x1'));var utils=require(_0x9b68('0x2'));var transfers=require(_0x9b68('0x3'));var recordings={};function writeDB(_0x52cd7b){var _0x5d8960;utils[_0x9b68('0x4')](util[_0x9b68('0x5')](_0x9b68('0x6'),_0x52cd7b[_0x9b68('0x7')]));if(transfers[_0x9b68('0x8')][_0x52cd7b[_0x9b68('0x7')]]){_0x5d8960=_0x52cd7b[_0x9b68('0x7')];_0x52cd7b[_0x9b68('0x7')]=transfers['blinds'][_0x52cd7b['uniqueid']][_0x9b68('0x9')];}if(_0x52cd7b[_0x9b68('0xa')]){utils[_0x9b68('0xb')](_0x52cd7b[_0x9b68('0xa')])[_0x9b68('0xc')](function(_0x2b0dbe){if(_0x2b0dbe){_0x52cd7b[_0x9b68('0xd')]=_0x2b0dbe[_0x9b68('0xe')];_0x52cd7b[_0x9b68('0xf')]=_0x2b0dbe['id'];}utils[_0x9b68('0x10')](_0x9b68('0x11'),_0x52cd7b);});}else{utils[_0x9b68('0x10')](_0x9b68('0x11'),_0x52cd7b);}if(_0x5d8960)delete transfers[_0x9b68('0x8')][_0x5d8960];}exports[_0x9b68('0x12')]=function(_0x57e733){try{utils[_0x9b68('0x13')](util[_0x9b68('0x5')]('[%s][recordings][newchannel]',_0x57e733['uniqueid']),_0x57e733);if(_0x57e733['uniqueid']==_0x57e733[_0x9b68('0x14')]){utils['info'](util['format'](_0x9b68('0x15'),_0x57e733['uniqueid'],_0x57e733[_0x9b68('0x16')],_0x57e733['exten']));recordings[_0x57e733[_0x9b68('0x7')]]={'uniqueid':_0x57e733[_0x9b68('0x7')],'accountcode':_0x57e733[_0x9b68('0xa')],'exten':_0x57e733['exten'],'context':_0x57e733[_0x9b68('0x16')],'channel':_0x57e733['channel'],'monitors':[]};}}catch(_0x1c4b81){utils[_0x9b68('0x17')](util['format'](_0x9b68('0x18'),_0x57e733[_0x9b68('0x7')]),_0x1c4b81);}};exports[_0x9b68('0x19')]=function(_0x3f95ce){try{utils[_0x9b68('0x13')](util[_0x9b68('0x5')]('[%s][recordings][newstate]',_0x3f95ce[_0x9b68('0x7')]),_0x3f95ce);if(!_[_0x9b68('0x1a')](recordings[_0x3f95ce[_0x9b68('0x7')]])&&_0x3f95ce[_0x9b68('0x1b')]==0x6){utils[_0x9b68('0x4')](util[_0x9b68('0x5')](_0x9b68('0x1c'),_0x3f95ce[_0x9b68('0x7')],_0x3f95ce[_0x9b68('0x16')],_0x3f95ce[_0x9b68('0x1d')]));}else if(!_['isNil'](recordings[_0x3f95ce[_0x9b68('0x14')]])&&_0x3f95ce[_0x9b68('0x1b')]==0x6&&_0x3f95ce[_0x9b68('0x16')]!='transfer'){utils[_0x9b68('0x4')](util[_0x9b68('0x5')](_0x9b68('0x1e'),_0x3f95ce[_0x9b68('0x7')],_0x3f95ce['linkedid'],_0x3f95ce['context'],_0x3f95ce['channel']));recordings[_0x3f95ce['linkedid']][_0x9b68('0xa')]=_0x3f95ce[_0x9b68('0xa')];}}catch(_0x31da07){utils['error'](util[_0x9b68('0x5')](_0x9b68('0x1f'),_0x3f95ce[_0x9b68('0x7')]),_0x31da07);}};exports[_0x9b68('0x20')]=function(_0x118461){try{if(!_[_0x9b68('0x1a')](_0x118461['variable'])&&!_[_0x9b68('0x1a')](_0x118461[_0x9b68('0x21')]['mixmonitor_filename'])){utils[_0x9b68('0x13')](util[_0x9b68('0x5')](_0x9b68('0x22'),_0x118461[_0x9b68('0x7')]),_0x118461);utils[_0x9b68('0x4')](util[_0x9b68('0x5')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x118461['uniqueid'],_0x118461[_0x9b68('0x21')],_0x118461[_0x9b68('0x23')]));if(_[_0x9b68('0x24')](_0x118461[_0x9b68('0x23')],_0x9b68('0x25'))){_0x118461[_0x9b68('0x23')]=_0x118461[_0x9b68('0x23')][_0x9b68('0x26')](_0x9b68('0x25'),_0x9b68('0x27'));}if(recordings[_0x118461['linkedid']]){var _0x1c8186=_[_0x9b68('0x28')](recordings[_0x118461[_0x9b68('0x14')]]['monitors'],{'value':_0x118461[_0x9b68('0x23')]});if(_['isNil'](_0x1c8186)){recordings[_0x118461[_0x9b68('0x14')]][_0x9b68('0x29')][_0x9b68('0x2a')]({'value':_0x118461['value']});}}}}catch(_0x49e1bc){utils['error'](util[_0x9b68('0x5')](_0x9b68('0x22'),_0x118461[_0x9b68('0x7')]),_0x49e1bc);}};exports['hangup']=function(_0x559e8a){try{if(!_[_0x9b68('0x1a')](recordings[_0x559e8a[_0x9b68('0x7')]])){utils[_0x9b68('0x13')](util[_0x9b68('0x5')]('[%s][recordings][hangup]',_0x559e8a[_0x9b68('0x7')]),_0x559e8a);utils['info'](util[_0x9b68('0x5')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x559e8a[_0x9b68('0x7')],_0x559e8a[_0x9b68('0x2b')],_0x559e8a[_0x9b68('0x2c')],_0x559e8a['cause-txt']));recordings[_0x559e8a[_0x9b68('0x7')]][_0x9b68('0x2b')]=_0x559e8a[_0x9b68('0x2b')];recordings[_0x559e8a[_0x9b68('0x7')]][_0x9b68('0x2c')]=_0x559e8a[_0x9b68('0x2c')];recordings[_0x559e8a[_0x9b68('0x7')]][_0x9b68('0x2d')]=_0x559e8a['connectedlinenum'];recordings[_0x559e8a[_0x9b68('0x7')]][_0x9b68('0x2e')]=_0x559e8a[_0x9b68('0x2e')];if(recordings[_0x559e8a[_0x9b68('0x7')]][_0x9b68('0x2f')]=='outbound'&&recordings[_0x559e8a['uniqueid']][_0x9b68('0xa')]){recordings[_0x559e8a[_0x9b68('0x7')]][_0x9b68('0x2d')]=recordings[_0x559e8a[_0x9b68('0x7')]][_0x9b68('0xa')];recordings[_0x559e8a['uniqueid']][_0x9b68('0x2e')]='';}recordings[_0x559e8a[_0x9b68('0x7')]][_0x9b68('0x29')][_0x9b68('0x30')](function(_0x235003){var _0x4d163e=_[_0x9b68('0x31')](recordings[_0x559e8a[_0x9b68('0x7')]]);_0x4d163e[_0x9b68('0x23')]=_0x235003['value'];writeDB(_0x4d163e);});delete recordings[_0x559e8a[_0x9b68('0x7')]];}}catch(_0x4d364d){utils['error'](util[_0x9b68('0x5')](_0x9b68('0x32'),_0x559e8a[_0x9b68('0x7')]),_0x4d364d);}};exports[_0x9b68('0x33')]=function(_0x261c6c){try{if(!_[_0x9b68('0x1a')](recordings[_0x261c6c[_0x9b68('0x7')]])){utils[_0x9b68('0x13')](util[_0x9b68('0x5')](_0x9b68('0x34'),_0x261c6c[_0x9b68('0x7')]),_0x261c6c);utils[_0x9b68('0x4')](util[_0x9b68('0x5')](_0x9b68('0x35'),_0x261c6c[_0x9b68('0x7')],_0x261c6c[_0x9b68('0x36')],_0x261c6c[_0x9b68('0x37')]));if(_0x261c6c[_0x9b68('0x36')][_0x9b68('0x38')]()==_0x9b68('0x39')&&_[_0x9b68('0x3a')](_0x261c6c[_0x9b68('0x37')][_0x9b68('0x38')](),'cdr')){var _0x26f21e=_0x261c6c[_0x9b68('0x37')][_0x9b68('0x3b')]('=');var _0x3f03a6=_0x26f21e[0x0][_0x9b68('0x3c')](_0x26f21e[0x0][_0x9b68('0x3d')]('(')+0x1,_0x26f21e[0x0]['lastIndexOf'](')'));var _0x1b4fd2=_0x26f21e[0x1];recordings[_0x261c6c[_0x9b68('0x7')]][_0x3f03a6]=_0x1b4fd2;}}}catch(_0x23de4f){utils[_0x9b68('0x17')](util['format'](_0x9b68('0x34'),_0x261c6c[_0x9b68('0x7')]),_0x23de4f);}};exports[_0x9b68('0x3e')]=function(_0x333c5c){try{if(!_[_0x9b68('0x1a')](recordings[_0x333c5c['uniqueid']])){utils[_0x9b68('0x13')](util[_0x9b68('0x5')](_0x9b68('0x3f'),_0x333c5c['uniqueid']),_0x333c5c);utils[_0x9b68('0x4')](util['format'](_0x9b68('0x40'),_0x333c5c[_0x9b68('0x7')],_0x333c5c['queue']));recordings[_0x333c5c[_0x9b68('0x7')]][_0x9b68('0x41')]=_0x333c5c['queue'];}}catch(_0x12ecad){utils['error'](util[_0x9b68('0x5')]('[%s][recordings][queuecallerjoin]',_0x333c5c['uniqueid']),_0x12ecad);}};exports[_0x9b68('0x42')]=function(_0x46e82c){try{utils[_0x9b68('0x13')](util[_0x9b68('0x5')](_0x9b68('0x43'),_0x46e82c[_0x9b68('0x7')]),_0x46e82c);utils[_0x9b68('0x4')](util[_0x9b68('0x5')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x46e82c[_0x9b68('0x7')],_0x46e82c[_0x9b68('0x44')],_0x46e82c[_0x9b68('0x45')],_0x46e82c[_0x9b68('0x46')],_0x46e82c['transfereecalleridname']));if(recordings[_0x46e82c['transfereruniqueid']]&&transfers[_0x9b68('0x8')][_0x46e82c[_0x9b68('0x47')]]){transfers['blinds'][_0x46e82c[_0x9b68('0x47')]][_0x9b68('0x48')]=!![];}}catch(_0x5e7b7a){utils['error'](util[_0x9b68('0x5')]('[%s][recordings][blindtransfer]',_0x46e82c[_0x9b68('0x7')]),_0x5e7b7a);}}; \ No newline at end of file +var _0x97a1=['calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./transfers.controller','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','channel','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','monitors','error','hangup','[%s][recordings][hangup]','calleridname','cause-txt'];(function(_0x24fae6,_0x350392){var _0x58da28=function(_0x51d126){while(--_0x51d126){_0x24fae6['push'](_0x24fae6['shift']());}};_0x58da28(++_0x350392);}(_0x97a1,0xa3));var _0x197a=function(_0x3980e5,_0x590de7){_0x3980e5=_0x3980e5-0x0;var _0x4aa039=_0x97a1[_0x3980e5];return _0x4aa039;};'use strict';var _=require(_0x197a('0x0'));var util=require(_0x197a('0x1'));var utils=require('./utils');var transfers=require(_0x197a('0x2'));var recordings={};function writeDB(_0x58c58e){var _0x124866;utils[_0x197a('0x3')](util[_0x197a('0x4')]('[%s][recordings][writeDB]',_0x58c58e['uniqueid']));if(transfers['blinds'][_0x58c58e[_0x197a('0x5')]]){_0x124866=_0x58c58e[_0x197a('0x5')];_0x58c58e['uniqueid']=transfers[_0x197a('0x6')][_0x58c58e[_0x197a('0x5')]][_0x197a('0x7')];}if(_0x58c58e[_0x197a('0x8')]){utils[_0x197a('0x9')](_0x58c58e[_0x197a('0x8')])[_0x197a('0xa')](function(_0xd520f9){if(_0xd520f9){_0x58c58e[_0x197a('0xb')]=_0xd520f9['name'];_0x58c58e[_0x197a('0xc')]=_0xd520f9['id'];}utils['request'](_0x197a('0xd'),_0x58c58e);});}else{utils[_0x197a('0xe')](_0x197a('0xd'),_0x58c58e);}if(_0x124866)delete transfers[_0x197a('0x6')][_0x124866];}exports[_0x197a('0xf')]=function(_0x2dbbea){try{utils[_0x197a('0x10')](util[_0x197a('0x4')](_0x197a('0x11'),_0x2dbbea[_0x197a('0x5')]),_0x2dbbea);if(_0x2dbbea['uniqueid']==_0x2dbbea[_0x197a('0x12')]){utils[_0x197a('0x3')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2dbbea['uniqueid'],_0x2dbbea[_0x197a('0x13')],_0x2dbbea[_0x197a('0x14')]));recordings[_0x2dbbea[_0x197a('0x5')]]={'uniqueid':_0x2dbbea[_0x197a('0x5')],'accountcode':_0x2dbbea[_0x197a('0x8')],'exten':_0x2dbbea['exten'],'context':_0x2dbbea[_0x197a('0x13')],'channel':_0x2dbbea[_0x197a('0x15')],'monitors':[]};}}catch(_0x3e664d){utils['error'](util[_0x197a('0x4')](_0x197a('0x11'),_0x2dbbea[_0x197a('0x5')]),_0x3e664d);}};exports['newstate']=function(_0x48669d){try{utils[_0x197a('0x10')](util[_0x197a('0x4')](_0x197a('0x16'),_0x48669d[_0x197a('0x5')]),_0x48669d);if(!_[_0x197a('0x17')](recordings[_0x48669d[_0x197a('0x5')]])&&_0x48669d['channelstate']==0x6){utils[_0x197a('0x3')](util[_0x197a('0x4')](_0x197a('0x18'),_0x48669d[_0x197a('0x5')],_0x48669d[_0x197a('0x13')],_0x48669d[_0x197a('0x15')]));}else if(!_[_0x197a('0x17')](recordings[_0x48669d[_0x197a('0x12')]])&&_0x48669d['channelstate']==0x6&&_0x48669d[_0x197a('0x13')]!='transfer'){utils[_0x197a('0x3')](util[_0x197a('0x4')](_0x197a('0x19'),_0x48669d[_0x197a('0x5')],_0x48669d[_0x197a('0x12')],_0x48669d[_0x197a('0x13')],_0x48669d['channel']));recordings[_0x48669d[_0x197a('0x12')]][_0x197a('0x8')]=_0x48669d[_0x197a('0x8')];}}catch(_0x2f37cf){utils['error'](util[_0x197a('0x4')]('[%s][recordings][newstate]',_0x48669d['uniqueid']),_0x2f37cf);}};exports['varset']=function(_0x4e8ace){try{if(!_['isNil'](_0x4e8ace['variable'])&&!_[_0x197a('0x17')](_0x4e8ace[_0x197a('0x1a')][_0x197a('0x1b')])){utils[_0x197a('0x10')](util[_0x197a('0x4')](_0x197a('0x1c'),_0x4e8ace[_0x197a('0x5')]),_0x4e8ace);utils['info'](util['format'](_0x197a('0x1d'),_0x4e8ace[_0x197a('0x5')],_0x4e8ace[_0x197a('0x1a')],_0x4e8ace[_0x197a('0x1e')]));if(_[_0x197a('0x1f')](_0x4e8ace['value'],_0x197a('0x20'))){_0x4e8ace[_0x197a('0x1e')]=_0x4e8ace[_0x197a('0x1e')]['replace'](_0x197a('0x20'),_0x197a('0x21'));}if(recordings[_0x4e8ace['linkedid']]){var _0x3617ef=_[_0x197a('0x22')](recordings[_0x4e8ace['linkedid']][_0x197a('0x23')],{'value':_0x4e8ace['value']});if(_[_0x197a('0x17')](_0x3617ef)){recordings[_0x4e8ace[_0x197a('0x12')]]['monitors']['push']({'value':_0x4e8ace[_0x197a('0x1e')]});}}}}catch(_0x1dec27){utils[_0x197a('0x24')](util[_0x197a('0x4')](_0x197a('0x1c'),_0x4e8ace['uniqueid']),_0x1dec27);}};exports[_0x197a('0x25')]=function(_0x1964b7){try{if(!_[_0x197a('0x17')](recordings[_0x1964b7[_0x197a('0x5')]])){utils['debug'](util[_0x197a('0x4')](_0x197a('0x26'),_0x1964b7[_0x197a('0x5')]),_0x1964b7);utils['info'](util[_0x197a('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1964b7[_0x197a('0x5')],_0x1964b7['calleridnum'],_0x1964b7[_0x197a('0x27')],_0x1964b7[_0x197a('0x28')]));recordings[_0x1964b7['uniqueid']][_0x197a('0x29')]=_0x1964b7['calleridnum'];recordings[_0x1964b7[_0x197a('0x5')]]['calleridname']=_0x1964b7[_0x197a('0x27')];recordings[_0x1964b7[_0x197a('0x5')]]['connectedlinenum']=_0x1964b7[_0x197a('0x2a')];recordings[_0x1964b7['uniqueid']]['connectedlinename']=_0x1964b7[_0x197a('0x2b')];if(recordings[_0x1964b7[_0x197a('0x5')]][_0x197a('0x2c')]==_0x197a('0x2d')&&recordings[_0x1964b7[_0x197a('0x5')]][_0x197a('0x8')]){recordings[_0x1964b7[_0x197a('0x5')]][_0x197a('0x2a')]=recordings[_0x1964b7['uniqueid']][_0x197a('0x8')];recordings[_0x1964b7['uniqueid']][_0x197a('0x2b')]='';}recordings[_0x1964b7[_0x197a('0x5')]][_0x197a('0x23')][_0x197a('0x2e')](function(_0x43c4b9){var _0x5dabc2=_['clone'](recordings[_0x1964b7[_0x197a('0x5')]]);_0x5dabc2['value']=_0x43c4b9[_0x197a('0x1e')];writeDB(_0x5dabc2);});delete recordings[_0x1964b7[_0x197a('0x5')]];}}catch(_0x9eec00){utils[_0x197a('0x24')](util[_0x197a('0x4')](_0x197a('0x26'),_0x1964b7['uniqueid']),_0x9eec00);}};exports[_0x197a('0x2f')]=function(_0xaf88c4){try{if(!_['isNil'](recordings[_0xaf88c4[_0x197a('0x5')]])){utils[_0x197a('0x10')](util[_0x197a('0x4')]('[%s][recordings][newexten]',_0xaf88c4[_0x197a('0x5')]),_0xaf88c4);utils[_0x197a('0x3')](util[_0x197a('0x4')](_0x197a('0x30'),_0xaf88c4[_0x197a('0x5')],_0xaf88c4['application'],_0xaf88c4[_0x197a('0x31')]));if(_0xaf88c4[_0x197a('0x32')][_0x197a('0x33')]()==_0x197a('0x34')&&_[_0x197a('0x35')](_0xaf88c4[_0x197a('0x31')][_0x197a('0x33')](),_0x197a('0x36'))){var _0x39b165=_0xaf88c4['appdata']['split']('=');var _0x34d853=_0x39b165[0x0][_0x197a('0x37')](_0x39b165[0x0][_0x197a('0x38')]('(')+0x1,_0x39b165[0x0][_0x197a('0x38')](')'));var _0x464317=_0x39b165[0x1];recordings[_0xaf88c4[_0x197a('0x5')]][_0x34d853]=_0x464317;}}}catch(_0x4cc8e5){utils[_0x197a('0x24')](util['format'](_0x197a('0x39'),_0xaf88c4[_0x197a('0x5')]),_0x4cc8e5);}};exports['queuecallerjoin']=function(_0x4bafa){try{if(!_[_0x197a('0x17')](recordings[_0x4bafa['uniqueid']])){utils[_0x197a('0x10')](util[_0x197a('0x4')](_0x197a('0x3a'),_0x4bafa[_0x197a('0x5')]),_0x4bafa);utils[_0x197a('0x3')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4bafa[_0x197a('0x5')],_0x4bafa['queue']));recordings[_0x4bafa[_0x197a('0x5')]][_0x197a('0x3b')]=_0x4bafa[_0x197a('0x3b')];}}catch(_0x42f288){utils[_0x197a('0x24')](util['format'](_0x197a('0x3a'),_0x4bafa['uniqueid']),_0x42f288);}};exports[_0x197a('0x3c')]=function(_0x918c8b){try{utils[_0x197a('0x10')](util['format'](_0x197a('0x3d'),_0x918c8b[_0x197a('0x5')]),_0x918c8b);utils['info'](util[_0x197a('0x4')](_0x197a('0x3e'),_0x918c8b[_0x197a('0x5')],_0x918c8b[_0x197a('0x3f')],_0x918c8b[_0x197a('0x40')],_0x918c8b[_0x197a('0x41')],_0x918c8b[_0x197a('0x42')]));if(recordings[_0x918c8b['transfereruniqueid']]&&transfers[_0x197a('0x6')][_0x918c8b[_0x197a('0x43')]]){transfers[_0x197a('0x6')][_0x918c8b[_0x197a('0x43')]]['recording']=!![];}}catch(_0x367035){utils[_0x197a('0x24')](util[_0x197a('0x4')](_0x197a('0x3d'),_0x918c8b[_0x197a('0x5')]),_0x367035);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a814ec3..bd215bd 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 _0xf679=['debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereecalleridname','blind','blinds','error'];(function(_0x338bc2,_0x1be2e3){var _0x336630=function(_0x27ff61){while(--_0x27ff61){_0x338bc2['push'](_0x338bc2['shift']());}};_0x336630(++_0x1be2e3);}(_0xf679,0x99));var _0x9f67=function(_0x5cd9ae,_0x5e2115){_0x5cd9ae=_0x5cd9ae-0x0;var _0x4a9c9d=_0xf679[_0x5cd9ae];return _0x4a9c9d;};'use strict';var _=require('lodash');var util=require(_0x9f67('0x0'));var utils=require(_0x9f67('0x1'));function writeDB(_0x2e8cf5){utils[_0x9f67('0x2')](util[_0x9f67('0x3')](_0x9f67('0x4'),_0x2e8cf5[_0x9f67('0x5')]===_0x9f67('0x6')?_0x2e8cf5[_0x9f67('0x7')]:_0x2e8cf5[_0x9f67('0x8')],_0x2e8cf5[_0x9f67('0x5')]));utils[_0x9f67('0x9')](_0x9f67('0xa'),_0x2e8cf5);}exports['blinds']={};exports[_0x9f67('0xb')]=function(_0x2b836c){try{utils['debug'](util[_0x9f67('0x3')](_0x9f67('0xc'),_0x2b836c['uniqueid']),_0x2b836c);utils[_0x9f67('0x2')](util['format'](_0x9f67('0xd'),_0x2b836c[_0x9f67('0x8')],_0x2b836c['transferercalleridnum'],_0x2b836c['transferercalleridname'],_0x2b836c[_0x9f67('0xe')],_0x2b836c[_0x9f67('0xf')]));_0x2b836c['type']=_0x9f67('0x10');exports[_0x9f67('0x11')][_0x2b836c['transfereruniqueid']]=_0x2b836c;writeDB(_0x2b836c);}catch(_0x1011f4){utils[_0x9f67('0x12')](util['format']('[%s][transfers][blindtransfer]',_0x2b836c[_0x9f67('0x8')]),_0x1011f4);}};exports['attendedtransfer']=function(_0xebe420){try{utils[_0x9f67('0x13')](util[_0x9f67('0x3')](_0x9f67('0x14'),_0xebe420[_0x9f67('0x7')]),_0xebe420);utils['info'](util[_0x9f67('0x3')](_0x9f67('0x15'),_0xebe420['origtransfereruniqueid'],_0xebe420['origtransferercalleridnum'],_0xebe420['origtransferercalleridname'],_0xebe420[_0x9f67('0x16')],_0xebe420[_0x9f67('0x17')]));_0xebe420=_[_0x9f67('0x18')](_0xebe420,{'transfererchannel':_0xebe420[_0x9f67('0x19')],'transferercalleridnum':_0xebe420[_0x9f67('0x1a')],'transferercalleridname':_0xebe420[_0x9f67('0x1b')],'transfererconnectedlinenum':_0xebe420[_0x9f67('0x1c')],'transfererconnectedlinename':_0xebe420[_0x9f67('0x1d')],'transfereraccountcode':_0xebe420[_0x9f67('0x1e')],'transferercontext':_0xebe420[_0x9f67('0x1f')],'transfererexten':_0xebe420[_0x9f67('0x20')],'transfererlinkedid':_0xebe420[_0x9f67('0x21')],'context':_0xebe420[_0x9f67('0x22')],'extension':_0xebe420[_0x9f67('0x23')],'type':_0x9f67('0x6')});if(_['isNil'](_0xebe420[_0x9f67('0x24')])){_0xebe420=_[_0x9f67('0x18')](_0xebe420,{'transfereechannel':_0xebe420[_0x9f67('0x25')],'transfereecalleridnum':_0xebe420['transfertargetcalleridnum'],'transfereecalleridname':_0xebe420[_0x9f67('0x17')],'transfereeconnectedlinenum':_0xebe420[_0x9f67('0x26')],'transfereeconnectedlinename':_0xebe420['transfertargetconnectedlinename'],'transfereeaccountcode':_0xebe420[_0x9f67('0x27')],'transfereecontext':_0xebe420[_0x9f67('0x28')],'transfereeexten':_0xebe420[_0x9f67('0x29')],'transfereelinkedid':_0xebe420[_0x9f67('0x2a')]});}writeDB(_0xebe420);}catch(_0x5b57da){utils['error'](util[_0x9f67('0x3')](_0x9f67('0x14'),_0xebe420[_0x9f67('0x7')]),_0x5b57da);}}; \ No newline at end of file +var _0x5ac0=['transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5ac0,0x1df));var _0x05ac=function(_0x56a2f2,_0x5c1825){_0x56a2f2=_0x56a2f2-0x0;var _0x2f1195=_0x5ac0[_0x56a2f2];return _0x2f1195;};'use strict';var _=require('lodash');var util=require(_0x05ac('0x0'));var utils=require(_0x05ac('0x1'));function writeDB(_0x1700d0){utils['info'](util[_0x05ac('0x2')](_0x05ac('0x3'),_0x1700d0[_0x05ac('0x4')]===_0x05ac('0x5')?_0x1700d0[_0x05ac('0x6')]:_0x1700d0[_0x05ac('0x7')],_0x1700d0['type']));utils[_0x05ac('0x8')](_0x05ac('0x9'),_0x1700d0);}exports[_0x05ac('0xa')]={};exports[_0x05ac('0xb')]=function(_0xd3685d){try{utils[_0x05ac('0xc')](util[_0x05ac('0x2')](_0x05ac('0xd'),_0xd3685d[_0x05ac('0x7')]),_0xd3685d);utils[_0x05ac('0xe')](util[_0x05ac('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xd3685d[_0x05ac('0x7')],_0xd3685d[_0x05ac('0xf')],_0xd3685d[_0x05ac('0x10')],_0xd3685d[_0x05ac('0x11')],_0xd3685d[_0x05ac('0x12')]));_0xd3685d[_0x05ac('0x4')]=_0x05ac('0x13');exports['blinds'][_0xd3685d[_0x05ac('0x14')]]=_0xd3685d;writeDB(_0xd3685d);}catch(_0x5c025d){utils[_0x05ac('0x15')](util[_0x05ac('0x2')]('[%s][transfers][blindtransfer]',_0xd3685d[_0x05ac('0x7')]),_0x5c025d);}};exports[_0x05ac('0x16')]=function(_0x3854ed){try{utils[_0x05ac('0xc')](util[_0x05ac('0x2')](_0x05ac('0x17'),_0x3854ed[_0x05ac('0x6')]),_0x3854ed);utils[_0x05ac('0xe')](util[_0x05ac('0x2')](_0x05ac('0x18'),_0x3854ed[_0x05ac('0x6')],_0x3854ed[_0x05ac('0x19')],_0x3854ed[_0x05ac('0x1a')],_0x3854ed['transfertargetcalleridnum'],_0x3854ed[_0x05ac('0x1b')]));_0x3854ed=_[_0x05ac('0x1c')](_0x3854ed,{'transfererchannel':_0x3854ed[_0x05ac('0x1d')],'transferercalleridnum':_0x3854ed[_0x05ac('0x19')],'transferercalleridname':_0x3854ed['origtransferercalleridname'],'transfererconnectedlinenum':_0x3854ed[_0x05ac('0x1e')],'transfererconnectedlinename':_0x3854ed[_0x05ac('0x1f')],'transfereraccountcode':_0x3854ed['origtransfereraccountcode'],'transferercontext':_0x3854ed['secondtransferercontext'],'transfererexten':_0x3854ed[_0x05ac('0x20')],'transfererlinkedid':_0x3854ed['origtransfererlinkedid'],'context':_0x3854ed[_0x05ac('0x21')],'extension':_0x3854ed[_0x05ac('0x22')],'type':_0x05ac('0x5')});if(_[_0x05ac('0x23')](_0x3854ed[_0x05ac('0x24')])){_0x3854ed=_[_0x05ac('0x1c')](_0x3854ed,{'transfereechannel':_0x3854ed[_0x05ac('0x25')],'transfereecalleridnum':_0x3854ed[_0x05ac('0x26')],'transfereecalleridname':_0x3854ed[_0x05ac('0x1b')],'transfereeconnectedlinenum':_0x3854ed['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3854ed[_0x05ac('0x27')],'transfereeaccountcode':_0x3854ed[_0x05ac('0x28')],'transfereecontext':_0x3854ed[_0x05ac('0x29')],'transfereeexten':_0x3854ed[_0x05ac('0x2a')],'transfereelinkedid':_0x3854ed['transfertargetlinkedid']});}writeDB(_0x3854ed);}catch(_0x265f6c){utils['error'](util[_0x05ac('0x2')]('[%s][transfers][attendedtransfer]',_0x3854ed['origtransfereruniqueid']),_0x265f6c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index ac03fda..6fd13ee 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 _0x3185=['type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','found','[utils][getVoiceQueueByName]','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','sumTime','now','format','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getVoiceQueueByName','GetVoiceQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3185,0x177));var _0x5318=function(_0x552d79,_0x389f1d){_0x552d79=_0x552d79-0x0;var _0x43ed11=_0x3185[_0x552d79];return _0x43ed11;};'use strict';var BPromise=require(_0x5318('0x0'));var jayson=require(_0x5318('0x1'));var moment=require(_0x5318('0x2'));var util=require(_0x5318('0x3'));var client=jayson[_0x5318('0x4')][_0x5318('0x5')]({'port':0x2329});var logger=require(_0x5318('0x6'))(_0x5318('0x7'));exports['info']=function(_0x2a6d5e,_0x1ebc90){logger[_0x5318('0x8')](_0x2a6d5e,_0x1ebc90?util[_0x5318('0x9')](_0x1ebc90,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4d5ca9,_0x2faca6){logger['debug'](_0x4d5ca9,_0x2faca6?util[_0x5318('0x9')](_0x2faca6,{'showHidden':![],'depth':null}):'');};exports[_0x5318('0xa')]=function(_0x5c42b1,_0x4cd520){logger[_0x5318('0xa')](_0x5c42b1,_0x4cd520?util[_0x5318('0x9')](_0x4cd520,{'showHidden':![],'depth':null}):'');};exports[_0x5318('0xb')]=function(_0x261f57,_0x10d47d){return client[_0x5318('0xb')](_0x261f57,{'body':_0x10d47d})[_0x5318('0xc')](function(_0x199fbd){logger['debug'](_0x5318('0xd'),_0x261f57,_0x199fbd?util[_0x5318('0x9')](_0x199fbd,{'showHidden':![],'depth':null}):'');})[_0x5318('0xe')](function(_0x194c0e){logger[_0x5318('0xa')](_0x5318('0xd'),_0x261f57,_0x194c0e?util['inspect'](_0x194c0e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x828450){return client[_0x5318('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x5318('0xf'),_0x5318('0x10'),_0x5318('0x11')],'where':_0x828450,'limit':0x1}})[_0x5318('0xc')](function(_0x16b989){logger['debug'](_0x5318('0x12'),JSON[_0x5318('0x13')](_0x828450),_0x16b989?util[_0x5318('0x9')](_0x16b989,{'showHidden':![],'depth':null}):'');return _0x16b989[_0x5318('0x14')][_0x5318('0x15')]?_0x16b989[_0x5318('0x14')][0x0]:null;});}exports[_0x5318('0x16')]=function(_0x2459ea){return new BPromise(function(_0xd535f4,_0x4335a9){if(_0x2459ea){return getUser({'internal':_0x2459ea})['then'](function(_0x31f366){logger['info'](_0x5318('0x17'),_0x2459ea,_0x31f366?'found':_0x5318('0x18'));return _0xd535f4(_0x31f366);})['catch'](function(_0x1f5a56){logger[_0x5318('0xa')](_0x5318('0x19'),_0x1f5a56?util['inspect'](_0x1f5a56,{'showHidden':![],'depth':null}):'');return _0xd535f4(null);});}return _0xd535f4(null);});};exports[_0x5318('0x1a')]=function(_0x46b0ee){return new BPromise(function(_0xc773c7,_0x46fe10){if(_0x46b0ee){return getUser({'interface':_0x46b0ee})[_0x5318('0xc')](function(_0x3f19ca){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x46b0ee,_0x3f19ca?'found':_0x5318('0x18'));return _0xc773c7(_0x3f19ca);})[_0x5318('0xe')](function(_0x50ea8c){logger[_0x5318('0xa')](_0x5318('0x1b'),_0x50ea8c?util[_0x5318('0x9')](_0x50ea8c,{'showHidden':![],'depth':null}):'');return _0xc773c7(null);});}return _0xc773c7(null);});};exports['getUserByName']=function(_0x2e3dfa){return new BPromise(function(_0xad376d,_0x2c9467){if(_0x2e3dfa){return getUser({'name':_0x2e3dfa})['then'](function(_0x59967e){logger[_0x5318('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2e3dfa,_0x59967e?'found':'notfound');return _0xad376d(_0x59967e);})[_0x5318('0xe')](function(_0x3f822f){logger['error']('[utils][getUserByName]',_0x3f822f?util[_0x5318('0x9')](_0x3f822f,{'showHidden':![],'depth':null}):'');return _0xad376d(null);});}return _0xad376d(null);});};exports[_0x5318('0x1c')]=function(_0x1c4389){return new BPromise(function(_0x56c892,_0x1d6d76){if(_0x1c4389){return client[_0x5318('0xb')](_0x5318('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x5318('0x10'),_0x5318('0x1e'),_0x5318('0x1f'),'acwTimeout'],'where':{'name':_0x1c4389},'limit':0x1}})['then'](function(_0x530e47){logger['debug'](_0x5318('0x20'),_0x1c4389,_0x530e47?util[_0x5318('0x9')](_0x530e47,{'showHidden':![],'depth':null}):'');logger['info'](_0x5318('0x21'),_0x1c4389,_0x530e47?_0x5318('0x22'):_0x5318('0x18'));return _0x56c892(_0x530e47['result']['length']?_0x530e47[_0x5318('0x14')][0x0]:null);})[_0x5318('0xe')](function(_0x1a3325){logger[_0x5318('0xa')](_0x5318('0x23'),_0x1a3325?util[_0x5318('0x9')](_0x1a3325,{'showHidden':![],'depth':null}):'');return _0x56c892(null);});}return _0x56c892(null);});};exports[_0x5318('0x24')]=function(_0x32e2c5,_0x513b9c){return moment(_0x32e2c5)['add'](_0x513b9c,_0x5318('0x25'))['format'](_0x5318('0x26'));};exports[_0x5318('0x27')]=function(_0x420977,_0x411287){return moment(_0x420977)['subtract'](_0x411287,_0x5318('0x25'))['format'](_0x5318('0x26'));};exports[_0x5318('0x28')]=function(_0x44a387,_0x5a7208){return moment(_0x44a387)['diff'](moment(_0x5a7208),_0x5318('0x25'));};exports[_0x5318('0x29')]=function(_0x202590,_0x3f9e76){return parseInt(_0x202590,0xa)+parseInt(_0x3f9e76,0xa);};exports[_0x5318('0x2a')]=function(){return moment()[_0x5318('0x2b')](_0x5318('0x26'));};exports['isAfter']=function(_0x5460a7,_0x59d826){if(_0x59d826){return moment(_0x5460a7)['isAfter'](_0x59d826);}return!![];};exports[_0x5318('0x2c')]=function(_0x414eaa,_0x546d61){if(_0x546d61){return moment(_0x414eaa)[_0x5318('0x2c')](_0x546d61);}else if(_0x414eaa){return!![];}return![];}; \ No newline at end of file +var _0x2e2c=['inspect','debug','request','then','[utils][request]\x20name:%s','error','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','format','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info'];(function(_0x1488d6,_0x5c5ef0){var _0x3af56f=function(_0x99e2d9){while(--_0x99e2d9){_0x1488d6['push'](_0x1488d6['shift']());}};_0x3af56f(++_0x5c5ef0);}(_0x2e2c,0x160));var _0xc2e2=function(_0x4459b8,_0x3271b8){_0x4459b8=_0x4459b8-0x0;var _0x4a4b07=_0x2e2c[_0x4459b8];return _0x4a4b07;};'use strict';var BPromise=require(_0xc2e2('0x0'));var jayson=require(_0xc2e2('0x1'));var moment=require(_0xc2e2('0x2'));var util=require(_0xc2e2('0x3'));var client=jayson[_0xc2e2('0x4')][_0xc2e2('0x5')]({'port':0x2329});var logger=require(_0xc2e2('0x6'))('xdr');exports['info']=function(_0x4f112b,_0x38aada){logger[_0xc2e2('0x7')](_0x4f112b,_0x38aada?util[_0xc2e2('0x8')](_0x38aada,{'showHidden':![],'depth':null}):'');};exports[_0xc2e2('0x9')]=function(_0x3a57a5,_0x36303d){logger['debug'](_0x3a57a5,_0x36303d?util[_0xc2e2('0x8')](_0x36303d,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x462c86,_0x19cdad){logger['error'](_0x462c86,_0x19cdad?util[_0xc2e2('0x8')](_0x19cdad,{'showHidden':![],'depth':null}):'');};exports[_0xc2e2('0xa')]=function(_0x4fcfe2,_0x145d79){return client['request'](_0x4fcfe2,{'body':_0x145d79})[_0xc2e2('0xb')](function(_0x43eb83){logger[_0xc2e2('0x9')](_0xc2e2('0xc'),_0x4fcfe2,_0x43eb83?util['inspect'](_0x43eb83,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2fe3ea){logger[_0xc2e2('0xd')]('[utils][request]\x20name:%s',_0x4fcfe2,_0x2fe3ea?util[_0xc2e2('0x8')](_0x2fe3ea,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5f4e45){return client['request'](_0xc2e2('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xc2e2('0xf'),_0xc2e2('0x10')],'where':_0x5f4e45,'limit':0x1}})[_0xc2e2('0xb')](function(_0x110e00){logger[_0xc2e2('0x9')](_0xc2e2('0x11'),JSON[_0xc2e2('0x12')](_0x5f4e45),_0x110e00?util[_0xc2e2('0x8')](_0x110e00,{'showHidden':![],'depth':null}):'');return _0x110e00[_0xc2e2('0x13')][_0xc2e2('0x14')]?_0x110e00[_0xc2e2('0x13')][0x0]:null;});}exports[_0xc2e2('0x15')]=function(_0x49618a){return new BPromise(function(_0x426160,_0x1e59ce){if(_0x49618a){return getUser({'internal':_0x49618a})[_0xc2e2('0xb')](function(_0x30daf6){logger['info'](_0xc2e2('0x16'),_0x49618a,_0x30daf6?_0xc2e2('0x17'):'notfound');return _0x426160(_0x30daf6);})[_0xc2e2('0x18')](function(_0x43a1fa){logger[_0xc2e2('0xd')](_0xc2e2('0x19'),_0x43a1fa?util[_0xc2e2('0x8')](_0x43a1fa,{'showHidden':![],'depth':null}):'');return _0x426160(null);});}return _0x426160(null);});};exports[_0xc2e2('0x1a')]=function(_0x14af8e){return new BPromise(function(_0x2b06a6,_0x229a47){if(_0x14af8e){return getUser({'interface':_0x14af8e})['then'](function(_0x2f1ecf){logger['info'](_0xc2e2('0x1b'),_0x14af8e,_0x2f1ecf?_0xc2e2('0x17'):'notfound');return _0x2b06a6(_0x2f1ecf);})[_0xc2e2('0x18')](function(_0x82ed71){logger[_0xc2e2('0xd')]('[utils][getUserByInterface]',_0x82ed71?util[_0xc2e2('0x8')](_0x82ed71,{'showHidden':![],'depth':null}):'');return _0x2b06a6(null);});}return _0x2b06a6(null);});};exports['getUserByName']=function(_0x58fc4d){return new BPromise(function(_0x1a7301,_0x569164){if(_0x58fc4d){return getUser({'name':_0x58fc4d})[_0xc2e2('0xb')](function(_0x5d7ae0){logger[_0xc2e2('0x7')](_0xc2e2('0x1c'),_0x58fc4d,_0x5d7ae0?_0xc2e2('0x17'):_0xc2e2('0x1d'));return _0x1a7301(_0x5d7ae0);})[_0xc2e2('0x18')](function(_0x14d5cc){logger['error'](_0xc2e2('0x1e'),_0x14d5cc?util[_0xc2e2('0x8')](_0x14d5cc,{'showHidden':![],'depth':null}):'');return _0x1a7301(null);});}return _0x1a7301(null);});};exports['getVoiceQueueByName']=function(_0x3a151d){return new BPromise(function(_0x3ea59b,_0x4d4db8){if(_0x3a151d){return client[_0xc2e2('0xa')](_0xc2e2('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xc2e2('0xf'),_0xc2e2('0x20'),'acw',_0xc2e2('0x21')],'where':{'name':_0x3a151d},'limit':0x1}})[_0xc2e2('0xb')](function(_0x454279){logger['debug'](_0xc2e2('0x22'),_0x3a151d,_0x454279?util[_0xc2e2('0x8')](_0x454279,{'showHidden':![],'depth':null}):'');logger['info'](_0xc2e2('0x23'),_0x3a151d,_0x454279?_0xc2e2('0x17'):'notfound');return _0x3ea59b(_0x454279[_0xc2e2('0x13')][_0xc2e2('0x14')]?_0x454279[_0xc2e2('0x13')][0x0]:null);})[_0xc2e2('0x18')](function(_0x14c425){logger['error'](_0xc2e2('0x24'),_0x14c425?util['inspect'](_0x14c425,{'showHidden':![],'depth':null}):'');return _0x3ea59b(null);});}return _0x3ea59b(null);});};exports[_0xc2e2('0x25')]=function(_0x3e3182,_0x5b7e46){return moment(_0x3e3182)['add'](_0x5b7e46,_0xc2e2('0x26'))['format'](_0xc2e2('0x27'));};exports['subtractTime']=function(_0x38e791,_0x53e3c1){return moment(_0x38e791)['subtract'](_0x53e3c1,'seconds')[_0xc2e2('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x574b3a,_0x1f1c6f){return moment(_0x574b3a)[_0xc2e2('0x29')](moment(_0x1f1c6f),'seconds');};exports['sumTime']=function(_0x21552f,_0x30b2f7){return parseInt(_0x21552f,0xa)+parseInt(_0x30b2f7,0xa);};exports[_0xc2e2('0x2a')]=function(){return moment()[_0xc2e2('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xc2e2('0x2b')]=function(_0x24cb62,_0x3cda8b){if(_0x3cda8b){return moment(_0x24cb62)['isAfter'](_0x3cda8b);}return!![];};exports[_0xc2e2('0x2c')]=function(_0x84994,_0x4ed583){if(_0x4ed583){return moment(_0x84994)['isBefore'](_0x4ed583);}else if(_0x84994){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 8bc2b2e..427a8d8 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 _0x00d6=['lodash','express-winston','path','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','log','xcally','join','client','role','name','then','catch','user','data','timestamp','error','api','set','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','method','headers','x-forwarded-for','remoteAddress','url','statusCode','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','responseTime','other','agent_id','agent_name','test','setupLoggers'];(function(_0xc1e691,_0x5b4bb2){var _0xa9b53f=function(_0x2a10cb){while(--_0x2a10cb){_0xc1e691['push'](_0xc1e691['shift']());}};_0xa9b53f(++_0x5b4bb2);}(_0x00d6,0x168));var _0x600d=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x00d6[_0x263a74];return _0x2aa86c;};var fs=require('fs-extra');var _=require(_0x600d('0x0'));var ewinston=require(_0x600d('0x1'));var path=require(_0x600d('0x2'));var util=require(_0x600d('0x3'));var fileLogger=require('./loggers')[_0x600d('0x4')];var safeTemplate=require(_0x600d('0x5'))[_0x600d('0x6')];var maskSensitiveData=require(_0x600d('0x7'))[_0x600d('0x8')];function ClientSideLogger(){function _0x349cf3(_0x214671){var _0x457635=path['join']('/var',_0x600d('0x9'),_0x600d('0xa'));var _0x18c040=path[_0x600d('0xb')](_0x600d('0xc'),_0x214671[_0x600d('0xd')]+'-'+_0x214671[_0x600d('0xe')]);return fs['ensureDir'](path[_0x600d('0xb')](_0x457635,_0x18c040))[_0x600d('0xf')](function(){var _0x452201=fileLogger(_0x600d('0xc'),path[_0x600d('0xb')](_0x457635,_0x18c040));return _0x452201;})[_0x600d('0x10')](function(_0x322968){throw _0x322968;});}this[_0x600d('0x9')]=function(_0x92284a,_0x17c6a9,_0x3c4af6,_0x27f526){return _0x349cf3(_0x92284a[_0x600d('0x11')])[_0x600d('0xf')](function(_0x4e6e4c){var _0x46c36f=_0x4e6e4c[_0x17c6a9];return _0x46c36f;})[_0x600d('0xf')](function(_0x5433db){var _0x4228ba=_0x92284a[_0x600d('0x11')]?_0x92284a['user']['id']:'no-user';var _0x7bb4d7=_0x27f526[_0x600d('0x12')];var _0x2ac951=_0x27f526[_0x600d('0x13')];var _0x42189c=new Date(Number(_0x2ac951));return _0x5433db(_0x4228ba,_0x42189c,_0x3c4af6,_0x7bb4d7);})[_0x600d('0x10')](function(_0x20896e){fileLogger(_0x600d('0xc'))[_0x600d('0x14')](_0x20896e);});};}function setupLoggers(_0x306901){return new Promise(function(_0x7b3d66){var _0x2de027=new ClientSideLogger();var _0x132c43=fileLogger(_0x600d('0x15'));var _0x4b63c1=fileLogger('auth');_0x306901[_0x600d('0x16')](_0x600d('0x17'),_0x2de027);_0x306901[_0x600d('0x18')](ewinston['logger']({'winstonInstance':_0x132c43,'meta':![],'statusLevels':!![],'msg':function(_0x26412d,_0x3424bd){var _0x5ea1a8=_0x600d('0x19');if(!_['isEmpty'](_0x26412d[_0x600d('0x1a')])){_0x5ea1a8+=_0x600d('0x1b');var _0x5b81fb=_0x26412d['body'];maskSensitiveData(_0x5b81fb);}return safeTemplate(util['format'](_0x5ea1a8,_0x26412d[_0x600d('0x1c')],_0x26412d[_0x600d('0x1d')][_0x600d('0x1e')]?_0x26412d[_0x600d('0x1d')][_0x600d('0x1e')]:_0x26412d['connection'][_0x600d('0x1f')]||_0x26412d['ip'],_0x26412d[_0x600d('0x20')],_0x3424bd[_0x600d('0x21')],_0x3424bd['responseTime'],_0x26412d['user']?_0x26412d[_0x600d('0x11')]['id']:null,_0x26412d['user']?_0x26412d[_0x600d('0x11')]['name']:null,_0x26412d[_0x600d('0x11')]?_0x26412d[_0x600d('0x11')]['role']:null,_0x5b81fb?util[_0x600d('0x22')](_0x5b81fb,![],null):''));}}));_0x306901[_0x600d('0x18')](ewinston['logger']({'winstonInstance':_0x4b63c1,'meta':![],'statusLevels':!![],'msg':function(_0x117d73,_0x18be06){var _0x3a74a8=_0x600d('0x23');if(_0x117d73['body']&&_0x117d73[_0x600d('0x1a')][_0x600d('0x24')]&&_0x117d73[_0x600d('0x1a')]['agent_id']){_0x3a74a8=_0x600d('0x25');}return util['format'](_0x3a74a8,_0x117d73['method'],_0x117d73[_0x600d('0x1d')][_0x600d('0x1e')]?_0x117d73[_0x600d('0x1d')][_0x600d('0x1e')]:_0x117d73[_0x600d('0x26')][_0x600d('0x1f')]||_0x117d73['ip'],_0x117d73['url'],_0x18be06['statusCode'],_0x18be06[_0x600d('0x27')],_0x117d73[_0x600d('0x11')]?_0x117d73['user']['id']:null,_0x117d73['user']?_0x117d73[_0x600d('0x11')][_0x600d('0xe')]:null,_0x117d73['user']?_0x117d73[_0x600d('0x11')][_0x600d('0xd')]:null,_0x117d73[_0x600d('0x1a')]&&_0x117d73[_0x600d('0x1a')][_0x600d('0x24')]?_0x117d73[_0x600d('0x1a')][_0x600d('0x24')]:_0x600d('0x28'),_0x117d73[_0x600d('0x1a')]&&_0x117d73[_0x600d('0x1a')]['agent_id']?_0x117d73[_0x600d('0x1a')][_0x600d('0x29')]:'',_0x117d73['body']&&_0x117d73['body']['agent_name']?_0x117d73['body'][_0x600d('0x2a')]:'');},'ignoreRoute':function(_0x433584){var _0x4a8282=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4a8282[_0x600d('0x2b')](_0x433584[_0x600d('0x20')]);}}));return _0x7b3d66();});}exports[_0x600d('0x2c')]=setupLoggers; \ No newline at end of file +var _0x34cc=['\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','format','responseTime','other','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','./safe-template','safeTemplate','maskSensitiveData','/var','log','xcally','join','role','name','ensureDir','catch','user','then','no-user','data','timestamp','client','error','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body'];(function(_0x8af245,_0x368074){var _0x36e49b=function(_0x25dab1){while(--_0x25dab1){_0x8af245['push'](_0x8af245['shift']());}};_0x36e49b(++_0x368074);}(_0x34cc,0x12b));var _0xc34c=function(_0x1c3f47,_0x19b8e7){_0x1c3f47=_0x1c3f47-0x0;var _0x42b621=_0x34cc[_0x1c3f47];return _0x42b621;};var fs=require(_0xc34c('0x0'));var _=require(_0xc34c('0x1'));var ewinston=require(_0xc34c('0x2'));var path=require('path');var util=require(_0xc34c('0x3'));var fileLogger=require(_0xc34c('0x4'))['fileLogger'];var safeTemplate=require(_0xc34c('0x5'))[_0xc34c('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0xc34c('0x7')];function ClientSideLogger(){function _0x291ef4(_0xa0626f){var _0x128985=path['join'](_0xc34c('0x8'),_0xc34c('0x9'),_0xc34c('0xa'));var _0x39a42c=path[_0xc34c('0xb')]('client',_0xa0626f[_0xc34c('0xc')]+'-'+_0xa0626f[_0xc34c('0xd')]);return fs[_0xc34c('0xe')](path[_0xc34c('0xb')](_0x128985,_0x39a42c))['then'](function(){var _0x1d9194=fileLogger('client',path[_0xc34c('0xb')](_0x128985,_0x39a42c));return _0x1d9194;})[_0xc34c('0xf')](function(_0x4bbb04){throw _0x4bbb04;});}this[_0xc34c('0x9')]=function(_0x2df85a,_0x3f53f0,_0x5ea2b2,_0x453257){return _0x291ef4(_0x2df85a[_0xc34c('0x10')])[_0xc34c('0x11')](function(_0x2fcd25){var _0x150194=_0x2fcd25[_0x3f53f0];return _0x150194;})[_0xc34c('0x11')](function(_0x2af135){var _0x46c901=_0x2df85a['user']?_0x2df85a[_0xc34c('0x10')]['id']:_0xc34c('0x12');var _0x33f616=_0x453257[_0xc34c('0x13')];var _0x51f37e=_0x453257[_0xc34c('0x14')];var _0x1df544=new Date(Number(_0x51f37e));return _0x2af135(_0x46c901,_0x1df544,_0x5ea2b2,_0x33f616);})['catch'](function(_0x3d19c3){fileLogger(_0xc34c('0x15'))[_0xc34c('0x16')](_0x3d19c3);});};}function setupLoggers(_0x52ff59){return new Promise(function(_0x2b6fce){var _0x11f1ce=new ClientSideLogger();var _0x1c0086=fileLogger('api');var _0x2539a8=fileLogger(_0xc34c('0x17'));_0x52ff59[_0xc34c('0x18')](_0xc34c('0x19'),_0x11f1ce);_0x52ff59[_0xc34c('0x1a')](ewinston[_0xc34c('0x1b')]({'winstonInstance':_0x1c0086,'meta':![],'statusLevels':!![],'msg':function(_0x4dae20,_0xb0f991){var _0x390ca7=_0xc34c('0x1c');if(!_['isEmpty'](_0x4dae20[_0xc34c('0x1d')])){_0x390ca7+=_0xc34c('0x1e');var _0x51837d=_0x4dae20[_0xc34c('0x1d')];maskSensitiveData(_0x51837d);}return safeTemplate(util['format'](_0x390ca7,_0x4dae20[_0xc34c('0x1f')],_0x4dae20[_0xc34c('0x20')][_0xc34c('0x21')]?_0x4dae20[_0xc34c('0x20')][_0xc34c('0x21')]:_0x4dae20[_0xc34c('0x22')][_0xc34c('0x23')]||_0x4dae20['ip'],_0x4dae20[_0xc34c('0x24')],_0xb0f991[_0xc34c('0x25')],_0xb0f991['responseTime'],_0x4dae20[_0xc34c('0x10')]?_0x4dae20[_0xc34c('0x10')]['id']:null,_0x4dae20['user']?_0x4dae20[_0xc34c('0x10')][_0xc34c('0xd')]:null,_0x4dae20[_0xc34c('0x10')]?_0x4dae20[_0xc34c('0x10')]['role']:null,_0x51837d?util[_0xc34c('0x26')](_0x51837d,![],null):''));}}));_0x52ff59[_0xc34c('0x1a')](ewinston[_0xc34c('0x1b')]({'winstonInstance':_0x2539a8,'meta':![],'statusLevels':!![],'msg':function(_0x12ddd0,_0x42048d){var _0x1d7c11=_0xc34c('0x27');if(_0x12ddd0['body']&&_0x12ddd0[_0xc34c('0x1d')][_0xc34c('0x28')]&&_0x12ddd0[_0xc34c('0x1d')][_0xc34c('0x29')]){_0x1d7c11='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xc34c('0x2a')](_0x1d7c11,_0x12ddd0[_0xc34c('0x1f')],_0x12ddd0[_0xc34c('0x20')][_0xc34c('0x21')]?_0x12ddd0['headers']['x-forwarded-for']:_0x12ddd0['connection'][_0xc34c('0x23')]||_0x12ddd0['ip'],_0x12ddd0[_0xc34c('0x24')],_0x42048d[_0xc34c('0x25')],_0x42048d[_0xc34c('0x2b')],_0x12ddd0[_0xc34c('0x10')]?_0x12ddd0[_0xc34c('0x10')]['id']:null,_0x12ddd0[_0xc34c('0x10')]?_0x12ddd0[_0xc34c('0x10')][_0xc34c('0xd')]:null,_0x12ddd0[_0xc34c('0x10')]?_0x12ddd0[_0xc34c('0x10')][_0xc34c('0xc')]:null,_0x12ddd0['body']&&_0x12ddd0[_0xc34c('0x1d')][_0xc34c('0x28')]?_0x12ddd0[_0xc34c('0x1d')]['device']:_0xc34c('0x2c'),_0x12ddd0['body']&&_0x12ddd0[_0xc34c('0x1d')]['agent_id']?_0x12ddd0[_0xc34c('0x1d')][_0xc34c('0x29')]:'',_0x12ddd0[_0xc34c('0x1d')]&&_0x12ddd0[_0xc34c('0x1d')]['agent_name']?_0x12ddd0[_0xc34c('0x1d')]['agent_name']:'');},'ignoreRoute':function(_0x7958b7){var _0x4bfd43=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4bfd43[_0xc34c('0x2d')](_0x7958b7[_0xc34c('0x24')]);}}));return _0x2b6fce();});}exports[_0xc34c('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 835a5e7..de18ba6 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42d9=['MMM','includes','monthCompare','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','circularMonthInterval','clone','minutes','startOf','day','endOf','isBetween','format','ddd','date','max','min'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x42d9,0x194));var _0x942d=function(_0x18bccf,_0x515956){_0x18bccf=_0x18bccf-0x0;var _0x3d07bd=_0x42d9[_0x18bccf];return _0x3d07bd;};var _=require(_0x942d('0x0'));var moment=require(_0x942d('0x1'));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][_0x942d('0x2')](function(_0x58ac4c){return _0x58ac4c[_0x942d('0x3')];})[_0x942d('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x942d('0x5');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x4c113b){if(!_0x4c113b[_0x942d('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x229f6e){var _0x3aa022=_0x229f6e[_0x942d('0x7')](':')[_0x942d('0x2')](function(_0x20b376){return parseInt(_0x20b376,0xa);});var _0x227d50=_0x3aa022[0x0];var _0x162ad0=_0x3aa022[0x1];if(_0x227d50<0x0||_0x227d50>0x17||_0x162ad0<0x0||_0x162ad0>0x3b){throw new Error(EINVALID_DATE);}return[_0x227d50,_0x162ad0];}function circularDoWInterval(_0x59133c,_0x2343a9){if(_0x59133c===_0x2343a9){return[_0x59133c];}else{var _0x2a1124=moment[_0x942d('0x8')]();moment[_0x942d('0x8')]('en');var _0x2d3351=moment[_0x942d('0x9')]()['map'](function(_0xf974d0){return _0xf974d0[_0x942d('0xa')]();});moment[_0x942d('0x8')](_0x2a1124);var _0x5afddf=_0x2d3351[_0x942d('0xb')](_0x59133c);var _0x48db05=_0x2d3351['indexOf'](_0x2343a9);if(_0x48db05>_0x5afddf){return _0x2d3351[_0x942d('0xc')](_0x5afddf,_0x48db05+0x1);}else{var _0x57cf27=_0x2d3351[_0x942d('0xc')](0x0,_0x48db05+0x1);var _0x41c820=_0x2d3351[_0x942d('0xc')](_0x5afddf);return _0x41c820[_0x942d('0xd')](_0x57cf27);}}}module[_0x942d('0xe')][_0x942d('0xf')]=circularDoWInterval;function circularMonthInterval(_0x5ed3dd,_0x5d9a42){if(_0x5ed3dd===_0x5d9a42){return[_0x5ed3dd];}else{var _0x513025=moment['locale']();moment['locale']('en');var _0x19eb76=moment['monthsShort']()[_0x942d('0x2')](function(_0x32f4fe){return _0x32f4fe['toLowerCase']();});moment['locale'](_0x513025);var _0x29c338=_0x19eb76[_0x942d('0xb')](_0x5ed3dd);var _0x25cf80=_0x19eb76['indexOf'](_0x5d9a42);if(_0x25cf80>_0x29c338){return _0x19eb76['slice'](_0x29c338,_0x25cf80+0x1);}else{var _0x123e93=_0x19eb76['slice'](0x0,_0x25cf80+0x1);var _0x15d99c=_0x19eb76[_0x942d('0xc')](_0x29c338);return _0x15d99c[_0x942d('0xd')](_0x123e93);}}}module['exports'][_0x942d('0x10')]=circularMonthInterval;function parseDom(_0x15f67f){var _0x4daf46=parseInt(_0x15f67f,0xa);if(_0x4daf46<0x1||_0x4daf46>0x1f){throw new Error(EINVALID_DATE);}return _0x4daf46;}function timeCompare(_0xa15e3e,_0x5d8fc6,_0x425999){var _0x21a4e6=_0xa15e3e[_0x942d('0x11')]();var _0x55352d=extractTime(_0x5d8fc6);var _0x5765fa=_0x55352d[0x0];var _0x1817f4=_0x55352d[0x1];var _0x51fe01=_0xa15e3e[_0x942d('0x11')]()['hours'](_0x5765fa)[_0x942d('0x12')](_0x1817f4);throwIfDateNotValid(_0x51fe01);var _0x17217a=extractTime(_0x425999);var _0x17cfbc=_0x17217a[0x0];var _0x1a316e=_0x17217a[0x1];var _0xcf00a7=_0xa15e3e[_0x942d('0x11')]()['hours'](_0x17cfbc)[_0x942d('0x12')](_0x1a316e);throwIfDateNotValid(_0xcf00a7);if(_0xcf00a7['isBefore'](_0x51fe01)){var _0x2951dd=_0x21a4e6[_0x942d('0x11')]()[_0x942d('0x13')](_0x942d('0x14'));var _0x53d42d=_0x21a4e6['clone']()[_0x942d('0x15')](_0x942d('0x14'));return _0x21a4e6['isBetween'](_0x51fe01,_0x53d42d,undefined,'[]')||_0x21a4e6[_0x942d('0x16')](_0x2951dd,_0xcf00a7,undefined,'[]');}else{return _0x21a4e6['isBetween'](_0x51fe01,_0xcf00a7,undefined,'[]');}}module[_0x942d('0xe')]['timeCompare']=timeCompare;function dowCompare(_0x220814,_0x2c137a,_0x1e1f39){var _0x3248d1=_0x220814[_0x942d('0x8')]('en')[_0x942d('0x17')](_0x942d('0x18'))['toLowerCase']();return circularDoWInterval(_0x2c137a,_0x1e1f39)['includes'](_0x3248d1);}module[_0x942d('0xe')]['dowCompare']=dowCompare;function domCompare(_0x1ff039,_0x446ce5,_0x192fc7){var _0x6e21f1=_0x1ff039[_0x942d('0x19')]();if(_0x446ce5===_0x192fc7){return _0x6e21f1===_0x446ce5;}else{var _0x40c64d=_0x1ff039['daysInMonth']();var _0x41b270=_0x446ce5<_0x192fc7;let _0x17361a=![];var _0x4a90e9=0x0;var _0x1dcc50=0x0;if(_0x41b270){_0x4a90e9=Math[_0x942d('0x1a')](0x1,_0x446ce5);_0x1dcc50=Math[_0x942d('0x1b')](_0x192fc7,_0x40c64d);_0x17361a=_0x6e21f1>=_0x4a90e9&&_0x6e21f1<=_0x1dcc50;}else{_0x4a90e9=Math[_0x942d('0x1b')](_0x446ce5,_0x40c64d);_0x1dcc50=Math[_0x942d('0x1a')](0x1,_0x192fc7);_0x17361a=_0x6e21f1>=_0x4a90e9||_0x6e21f1<=_0x1dcc50;}return _0x17361a;}}module[_0x942d('0xe')]['domCompare']=domCompare;function monthCompare(_0x4cf8f8,_0x1f8c3d,_0x554638){var _0x345af4=_0x4cf8f8[_0x942d('0x8')]('en')[_0x942d('0x17')](_0x942d('0x1c'))[_0x942d('0xa')]();return circularMonthInterval(_0x1f8c3d,_0x554638)[_0x942d('0x1d')](_0x345af4);}module[_0x942d('0xe')][_0x942d('0x1e')]=monthCompare;function iftime(_0x37ba89,_0x1ef26a=moment['tz']['guess'](),_0x5102db=moment()){if(!validateRx[_0x942d('0x1f')](_0x37ba89)){throw new Error(EINVALID_STRING);}else{var _0x33c5f3=(moment[_0x942d('0x20')](_0x5102db)?_0x5102db[_0x942d('0x11')]():moment(_0x5102db))['tz'](_0x1ef26a)[_0x942d('0x8')]('en');throwIfDateNotValid(_0x33c5f3);var _0x394ed3=_0x37ba89[_0x942d('0x7')](',');var _0x3a9ff2=_0x394ed3[0x0];var _0x1a7b7a=_0x394ed3[0x1];var _0x2fb487=_0x394ed3[0x2];var _0x276c89=_0x394ed3[0x3];let _0x43f890=!![];if(_0x3a9ff2!=='*'){var _0x4507c6=_0x3a9ff2['split']('-');var _0x4d5f4f=_[_0x942d('0x21')](_0x4507c6[0x0],0x5,'0');var _0xa42d8=_0x4507c6[_0x942d('0x22')]===0x2?_[_0x942d('0x21')](_0x4507c6[0x1],0x5,'0'):_0x4d5f4f;_0x43f890=timeCompare(_0x33c5f3,_0x4d5f4f,_0xa42d8);}let _0x15eb24=!![];if(_0x1a7b7a!=='*'){var _0x145a71=_0x1a7b7a['split']('-');var _0xd3b676=_0x145a71[0x0];var _0x39d209=_0x145a71['length']===0x2?_0x145a71[0x1]:_0xd3b676;_0x15eb24=dowCompare(_0x33c5f3,_0xd3b676,_0x39d209);}let _0x11d2d4=!![];if(_0x2fb487!=='*'){var _0x4aad20=_0x2fb487[_0x942d('0x7')]('-');var _0x4bb98c=parseDom(_0x4aad20[0x0]);var _0xf4c274=_0x4aad20['length']===0x2?parseDom(_0x4aad20[0x1]):_0x4bb98c;_0x11d2d4=domCompare(_0x33c5f3,_0x4bb98c,_0xf4c274);}let _0x55ce9c=!![];if(_0x276c89!=='*'){var _0x47b7aa=_0x276c89['split']('-');var _0x3935fa=_0x47b7aa[0x0];var _0x4259e4=_0x47b7aa[_0x942d('0x22')]===0x2?_0x47b7aa[0x1]:_0x47b7aa[0x0];_0x55ce9c=monthCompare(_0x33c5f3,_0x3935fa,_0x4259e4);}return _0x43f890&&_0x15eb24&&_0x11d2d4&&_0x55ce9c;}}module['exports'][_0x942d('0x23')]=iftime; \ No newline at end of file +var _0xcb89=['locale','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','includes','date','daysInMonth','max','min','domCompare','MMM','guess','test','isMoment','padStart','length','iftime','moment-timezone','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split'];(function(_0x594168,_0x3ac22f){var _0x31645f=function(_0x47f9a3){while(--_0x47f9a3){_0x594168['push'](_0x594168['shift']());}};_0x31645f(++_0x3ac22f);}(_0xcb89,0x190));var _0x9cb8=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xcb89[_0x25e7cb];return _0x375d92;};var _=require('lodash');var moment=require(_0x9cb8('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][_0x9cb8('0x1')](function(_0x71f7d6){return _0x71f7d6[_0x9cb8('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x9cb8('0x3');var EINVALID_DATE=_0x9cb8('0x4');function throwIfDateNotValid(_0x2ad72f){if(!_0x2ad72f[_0x9cb8('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x36a576){var _0x5c1df9=_0x36a576[_0x9cb8('0x6')](':')[_0x9cb8('0x1')](function(_0x1ca6a7){return parseInt(_0x1ca6a7,0xa);});var _0x448ff3=_0x5c1df9[0x0];var _0x508e9c=_0x5c1df9[0x1];if(_0x448ff3<0x0||_0x448ff3>0x17||_0x508e9c<0x0||_0x508e9c>0x3b){throw new Error(EINVALID_DATE);}return[_0x448ff3,_0x508e9c];}function circularDoWInterval(_0x5d717c,_0x15d057){if(_0x5d717c===_0x15d057){return[_0x5d717c];}else{var _0x26b14f=moment[_0x9cb8('0x7')]();moment[_0x9cb8('0x7')]('en');var _0x3aed9f=moment['weekdaysShort']()[_0x9cb8('0x1')](function(_0x5b3df8){return _0x5b3df8[_0x9cb8('0x8')]();});moment[_0x9cb8('0x7')](_0x26b14f);var _0x1ee678=_0x3aed9f[_0x9cb8('0x9')](_0x5d717c);var _0x2b587b=_0x3aed9f[_0x9cb8('0x9')](_0x15d057);if(_0x2b587b>_0x1ee678){return _0x3aed9f[_0x9cb8('0xa')](_0x1ee678,_0x2b587b+0x1);}else{var _0x2bafcb=_0x3aed9f['slice'](0x0,_0x2b587b+0x1);var _0x1baaa4=_0x3aed9f[_0x9cb8('0xa')](_0x1ee678);return _0x1baaa4[_0x9cb8('0xb')](_0x2bafcb);}}}module[_0x9cb8('0xc')][_0x9cb8('0xd')]=circularDoWInterval;function circularMonthInterval(_0x1b0c96,_0xe5ae68){if(_0x1b0c96===_0xe5ae68){return[_0x1b0c96];}else{var _0x1da354=moment['locale']();moment[_0x9cb8('0x7')]('en');var _0x4b701c=moment[_0x9cb8('0xe')]()[_0x9cb8('0x1')](function(_0x55ae97){return _0x55ae97[_0x9cb8('0x8')]();});moment[_0x9cb8('0x7')](_0x1da354);var _0x5dc707=_0x4b701c[_0x9cb8('0x9')](_0x1b0c96);var _0x3c59c3=_0x4b701c[_0x9cb8('0x9')](_0xe5ae68);if(_0x3c59c3>_0x5dc707){return _0x4b701c[_0x9cb8('0xa')](_0x5dc707,_0x3c59c3+0x1);}else{var _0x56247d=_0x4b701c['slice'](0x0,_0x3c59c3+0x1);var _0x2ab448=_0x4b701c[_0x9cb8('0xa')](_0x5dc707);return _0x2ab448[_0x9cb8('0xb')](_0x56247d);}}}module[_0x9cb8('0xc')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x308931){var _0x4ed80c=parseInt(_0x308931,0xa);if(_0x4ed80c<0x1||_0x4ed80c>0x1f){throw new Error(EINVALID_DATE);}return _0x4ed80c;}function timeCompare(_0x7ce216,_0x5c19a6,_0x3d931e){var _0x10a4d4=_0x7ce216['clone']();var _0x53bd8d=extractTime(_0x5c19a6);var _0x41973f=_0x53bd8d[0x0];var _0x18c873=_0x53bd8d[0x1];var _0x4bb3ca=_0x7ce216[_0x9cb8('0xf')]()[_0x9cb8('0x10')](_0x41973f)[_0x9cb8('0x11')](_0x18c873);throwIfDateNotValid(_0x4bb3ca);var _0x4297bf=extractTime(_0x3d931e);var _0x14d3a0=_0x4297bf[0x0];var _0x4548b6=_0x4297bf[0x1];var _0x3fadb0=_0x7ce216[_0x9cb8('0xf')]()['hours'](_0x14d3a0)[_0x9cb8('0x11')](_0x4548b6);throwIfDateNotValid(_0x3fadb0);if(_0x3fadb0[_0x9cb8('0x12')](_0x4bb3ca)){var _0x3e5681=_0x10a4d4['clone']()[_0x9cb8('0x13')](_0x9cb8('0x14'));var _0x57493f=_0x10a4d4[_0x9cb8('0xf')]()[_0x9cb8('0x15')](_0x9cb8('0x14'));return _0x10a4d4['isBetween'](_0x4bb3ca,_0x57493f,undefined,'[]')||_0x10a4d4[_0x9cb8('0x16')](_0x3e5681,_0x3fadb0,undefined,'[]');}else{return _0x10a4d4[_0x9cb8('0x16')](_0x4bb3ca,_0x3fadb0,undefined,'[]');}}module[_0x9cb8('0xc')][_0x9cb8('0x17')]=timeCompare;function dowCompare(_0x5aba9b,_0x14f0d9,_0x1434b8){var _0x416120=_0x5aba9b[_0x9cb8('0x7')]('en')['format']('ddd')[_0x9cb8('0x8')]();return circularDoWInterval(_0x14f0d9,_0x1434b8)[_0x9cb8('0x18')](_0x416120);}module[_0x9cb8('0xc')]['dowCompare']=dowCompare;function domCompare(_0x385949,_0x4b0ee0,_0xd3febb){var _0x51c59b=_0x385949[_0x9cb8('0x19')]();if(_0x4b0ee0===_0xd3febb){return _0x51c59b===_0x4b0ee0;}else{var _0x15e88f=_0x385949[_0x9cb8('0x1a')]();var _0x20e99d=_0x4b0ee0<_0xd3febb;let _0x1d8d1b=![];var _0x52dbf9=0x0;var _0x23fa12=0x0;if(_0x20e99d){_0x52dbf9=Math[_0x9cb8('0x1b')](0x1,_0x4b0ee0);_0x23fa12=Math['min'](_0xd3febb,_0x15e88f);_0x1d8d1b=_0x51c59b>=_0x52dbf9&&_0x51c59b<=_0x23fa12;}else{_0x52dbf9=Math[_0x9cb8('0x1c')](_0x4b0ee0,_0x15e88f);_0x23fa12=Math[_0x9cb8('0x1b')](0x1,_0xd3febb);_0x1d8d1b=_0x51c59b>=_0x52dbf9||_0x51c59b<=_0x23fa12;}return _0x1d8d1b;}}module['exports'][_0x9cb8('0x1d')]=domCompare;function monthCompare(_0x36823e,_0x47a355,_0x14b1ae){var _0x4cc3f6=_0x36823e[_0x9cb8('0x7')]('en')['format'](_0x9cb8('0x1e'))['toLowerCase']();return circularMonthInterval(_0x47a355,_0x14b1ae)['includes'](_0x4cc3f6);}module[_0x9cb8('0xc')]['monthCompare']=monthCompare;function iftime(_0x5545b8,_0x29cf20=moment['tz'][_0x9cb8('0x1f')](),_0x4d342f=moment()){if(!validateRx[_0x9cb8('0x20')](_0x5545b8)){throw new Error(EINVALID_STRING);}else{var _0x49486e=(moment[_0x9cb8('0x21')](_0x4d342f)?_0x4d342f[_0x9cb8('0xf')]():moment(_0x4d342f))['tz'](_0x29cf20)[_0x9cb8('0x7')]('en');throwIfDateNotValid(_0x49486e);var _0x15df13=_0x5545b8[_0x9cb8('0x6')](',');var _0x590bbc=_0x15df13[0x0];var _0x1f84bb=_0x15df13[0x1];var _0x2fe6e6=_0x15df13[0x2];var _0x38b517=_0x15df13[0x3];let _0x160029=!![];if(_0x590bbc!=='*'){var _0x1c213b=_0x590bbc['split']('-');var _0x47c6b4=_[_0x9cb8('0x22')](_0x1c213b[0x0],0x5,'0');var _0x1895f5=_0x1c213b['length']===0x2?_['padStart'](_0x1c213b[0x1],0x5,'0'):_0x47c6b4;_0x160029=timeCompare(_0x49486e,_0x47c6b4,_0x1895f5);}let _0x5a52ee=!![];if(_0x1f84bb!=='*'){var _0x1125be=_0x1f84bb[_0x9cb8('0x6')]('-');var _0x3b4da5=_0x1125be[0x0];var _0x3d45ac=_0x1125be['length']===0x2?_0x1125be[0x1]:_0x3b4da5;_0x5a52ee=dowCompare(_0x49486e,_0x3b4da5,_0x3d45ac);}let _0x158f8f=!![];if(_0x2fe6e6!=='*'){var _0x2fda90=_0x2fe6e6[_0x9cb8('0x6')]('-');var _0x325aa0=parseDom(_0x2fda90[0x0]);var _0x20e40d=_0x2fda90[_0x9cb8('0x23')]===0x2?parseDom(_0x2fda90[0x1]):_0x325aa0;_0x158f8f=domCompare(_0x49486e,_0x325aa0,_0x20e40d);}let _0x43f3e7=!![];if(_0x38b517!=='*'){var _0x186735=_0x38b517['split']('-');var _0x247a07=_0x186735[0x0];var _0x1f8b58=_0x186735['length']===0x2?_0x186735[0x1]:_0x186735[0x0];_0x43f3e7=monthCompare(_0x49486e,_0x247a07,_0x1f8b58);}return _0x160029&&_0x5a52ee&&_0x158f8f&&_0x43f3e7;}}module[_0x9cb8('0xc')][_0x9cb8('0x24')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 2408016..7c2e200 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe664=['meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','transports','Console','Logger','File','error','consoleLogger','fileLogger','path','util','debugLevel','info','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase'];(function(_0xb15095,_0x5cc773){var _0x3a6781=function(_0x35c022){while(--_0x35c022){_0xb15095['push'](_0xb15095['shift']());}};_0x3a6781(++_0x5cc773);}(_0xe664,0x1ec));var _0x4e66=function(_0x399e29,_0x588c7f){_0x399e29=_0x399e29-0x0;var _0x22a13f=_0xe664[_0x399e29];return _0x22a13f;};'use strict';var path=require(_0x4e66('0x0'));var util=require(_0x4e66('0x1'));var moment=require('moment');var winston=require('winston');var config=require('../config/environment');var debugLevel=config['debugLevel']?config[_0x4e66('0x2')]['toLowerCase']():_0x4e66('0x3');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0x4e66('0x4'),'info':_0x4e66('0x5'),'print':_0x4e66('0x6'),'success':_0x4e66('0x7'),'http':'gray','verbose':'bold\x20magenta','debug':_0x4e66('0x8'),'silly':_0x4e66('0x9')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x48f13f,_0x930a00,_0xaa131d){var _0x10a5b3=_0x48f13f||_0x4e66('0xa');return path[_0x4e66('0xb')](_0x10a5b3,util[_0x4e66('0xc')](_0x4e66('0xd'),_0x930a00,_0xaa131d));}function formatter(_0x44e08a,_0x178d9e){_0x178d9e[_0x4e66('0xe')]=_0x178d9e[_0x4e66('0xe')]['replace'](/@@{/g,_0x4e66('0xf'))[_0x4e66('0x10')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x4e66('0x10')](/}@/g,'}}');return util[_0x4e66('0xc')](_0x4e66('0x11'),moment()[_0x4e66('0xc')](_0x4e66('0x12')),_0x178d9e['level'][_0x4e66('0x13')](),_0x44e08a,_0x178d9e[_0x4e66('0xe')]);}function fileFormat(_0x55693e,_0xbf4d53){_0xbf4d53[_0x4e66('0xe')]=_0xbf4d53['message']['replace'](/@@{/g,'{{{')[_0x4e66('0x10')](/}@@/g,'}}}')[_0x4e66('0x10')](/@{/g,'{{')[_0x4e66('0x10')](/}@/g,'}}');var _0x3d5f10=_0xbf4d53[_0x4e66('0x14')]&&Object[_0x4e66('0x15')](_0xbf4d53['meta'])[_0x4e66('0x16')]?'\x0a\x09'+JSON['stringify'](_0xbf4d53[_0x4e66('0x14')]):'';return util['format'](_0x4e66('0x17'),moment()['format'](_0x4e66('0x12')),_0xbf4d53[_0x4e66('0x18')][_0x4e66('0x13')](),_0x55693e,_0xbf4d53[_0x4e66('0xe')],_0x3d5f10);}function consoleLogger(){var _0x2b0d10=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x4e66('0x19'))][(_0x4e66('0x1a'))]({'level':'warn','json':![],'formatter':function(_0x43dc83){return formatter('',_0x43dc83);}})]});return _0x2b0d10;}function fileLogger(_0x58ba48,_0x3380ff){var _0x2371dd=new winston[(_0x4e66('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x4e66('0x19'))][(_0x4e66('0x1c'))]({'name':util[_0x4e66('0xc')]('%s-%s',_0x58ba48,_0x4e66('0x1d')),'filename':getLogFileName(_0x3380ff,_0x58ba48,_0x4e66('0x1d')),'level':_0x4e66('0x1d'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x88b9c5){return fileFormat(_0x58ba48,_0x88b9c5);}}),new winston[(_0x4e66('0x19'))][(_0x4e66('0x1c'))]({'name':util[_0x4e66('0xc')]('%s-%s',_0x58ba48,debugLevel),'filename':getLogFileName(_0x3380ff,_0x58ba48,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x315325){return fileFormat(_0x58ba48,_0x315325);}}),new winston[(_0x4e66('0x19'))][(_0x4e66('0x1a'))]({'level':'warn','json':![],'formatter':function(_0xd120d4){return fileFormat(_0x58ba48,_0xd120d4);}})]});return _0x2371dd;}exports[_0x4e66('0x1e')]=consoleLogger;exports[_0x4e66('0x1f')]=fileLogger; \ No newline at end of file +var _0x3c30=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','stringify','Logger','Console','warn','transports','%s-%s','error','File','fileLogger','path','moment','winston','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','message','{{{','}}}','replace','format'];(function(_0x2bf845,_0x19bbff){var _0x185aa6=function(_0x2aa0fe){while(--_0x2aa0fe){_0x2bf845['push'](_0x2bf845['shift']());}};_0x185aa6(++_0x19bbff);}(_0x3c30,0x162));var _0x03c3=function(_0x30fcc8,_0xb1f24a){_0x30fcc8=_0x30fcc8-0x0;var _0x44c02d=_0x3c30[_0x30fcc8];return _0x44c02d;};'use strict';var path=require(_0x03c3('0x0'));var util=require('util');var moment=require(_0x03c3('0x1'));var winston=require(_0x03c3('0x2'));var config=require('../config/environment');var debugLevel=config[_0x03c3('0x3')]?config[_0x03c3('0x3')][_0x03c3('0x4')]():'info';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':_0x03c3('0x5'),'error':_0x03c3('0x6'),'warn':_0x03c3('0x7'),'info':'white','print':_0x03c3('0x8'),'success':'bold\x20green','http':'gray','verbose':_0x03c3('0x9'),'debug':_0x03c3('0xa'),'silly':_0x03c3('0xb')};winston[_0x03c3('0xc')](XC_LOG_COLORS);function getLogFileName(_0x547f9a,_0xce8e5d,_0x128939){var _0x38e9b5=_0x547f9a||_0x03c3('0xd');return path[_0x03c3('0xe')](_0x38e9b5,util['format']('%s-%s.log',_0xce8e5d,_0x128939));}function formatter(_0x3fd71d,_0x55bbb0){_0x55bbb0[_0x03c3('0xf')]=_0x55bbb0['message']['replace'](/@@{/g,_0x03c3('0x10'))['replace'](/}@@/g,_0x03c3('0x11'))[_0x03c3('0x12')](/@{/g,'{{')[_0x03c3('0x12')](/}@/g,'}}');return util[_0x03c3('0x13')](_0x03c3('0x14'),moment()[_0x03c3('0x13')](_0x03c3('0x15')),_0x55bbb0[_0x03c3('0x16')][_0x03c3('0x17')](),_0x3fd71d,_0x55bbb0[_0x03c3('0xf')]);}function fileFormat(_0x200503,_0x11ffb7){_0x11ffb7['message']=_0x11ffb7[_0x03c3('0xf')][_0x03c3('0x12')](/@@{/g,_0x03c3('0x10'))['replace'](/}@@/g,_0x03c3('0x11'))[_0x03c3('0x12')](/@{/g,'{{')[_0x03c3('0x12')](/}@/g,'}}');var _0x3ccff9=_0x11ffb7[_0x03c3('0x18')]&&Object['keys'](_0x11ffb7['meta'])['length']?'\x0a\x09'+JSON[_0x03c3('0x19')](_0x11ffb7[_0x03c3('0x18')]):'';return util[_0x03c3('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0x03c3('0x15')),_0x11ffb7['level'][_0x03c3('0x17')](),_0x200503,_0x11ffb7[_0x03c3('0xf')],_0x3ccff9);}function consoleLogger(){var _0x5b064e=new winston[(_0x03c3('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x03c3('0x1b'))]({'level':_0x03c3('0x1c'),'json':![],'formatter':function(_0x34ffbc){return formatter('',_0x34ffbc);}})]});return _0x5b064e;}function fileLogger(_0x36e7b9,_0x589287){var _0x474567=new winston[(_0x03c3('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x03c3('0x1d'))]['File']({'name':util[_0x03c3('0x13')](_0x03c3('0x1e'),_0x36e7b9,_0x03c3('0x1f')),'filename':getLogFileName(_0x589287,_0x36e7b9,'error'),'level':_0x03c3('0x1f'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x333add){return fileFormat(_0x36e7b9,_0x333add);}}),new winston[(_0x03c3('0x1d'))][(_0x03c3('0x20'))]({'name':util[_0x03c3('0x13')](_0x03c3('0x1e'),_0x36e7b9,debugLevel),'filename':getLogFileName(_0x589287,_0x36e7b9,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x28b01e){return fileFormat(_0x36e7b9,_0x28b01e);}}),new winston[(_0x03c3('0x1d'))][(_0x03c3('0x1b'))]({'level':_0x03c3('0x1c'),'json':![],'formatter':function(_0x2966e6){return fileFormat(_0x36e7b9,_0x2966e6);}})]});return _0x474567;}exports['consoleLogger']=consoleLogger;exports[_0x03c3('0x21')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index b9a3008..f138b50 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 _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x1967,0x173));var _0x7196=function(_0x3911a3,_0x36c14e){_0x3911a3=_0x3911a3-0x0;var _0x54f27f=_0x1967[_0x3911a3];return _0x54f27f;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x1a85,0x178));var _0x51a8=function(_0x15a26e,_0x334582){_0x15a26e=_0x15a26e-0x0;var _0x25bef6=_0x1a85[_0x15a26e];return _0x25bef6;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 097dccf..f9cf24a 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 _0x4213=['{\x20{\x20','\x20}\x20}','string','isArray','isPlainObject','keys','reduce','exports','safeTemplate','lodash'];(function(_0x1b4943,_0x59de96){var _0x211c66=function(_0x23bca7){while(--_0x23bca7){_0x1b4943['push'](_0x1b4943['shift']());}};_0x211c66(++_0x59de96);}(_0x4213,0x77));var _0x3421=function(_0x4819db,_0x8b336f){_0x4819db=_0x4819db-0x0;var _0x189ca1=_0x4213[_0x4819db];return _0x189ca1;};var _=require(_0x3421('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x445ef6){return _0x445ef6==='{{'?_0x3421('0x1'):_0x3421('0x2');}function safeTemplate(_0x2613b6){var _0x153f3a=_0x2613b6;if(typeof _0x2613b6===_0x3421('0x3')){_0x153f3a=_0x2613b6['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3421('0x4')](_0x2613b6)){_0x153f3a=_0x2613b6['map'](function(_0x459c5e){return safeTemplate(_0x459c5e);});}else if(_[_0x3421('0x5')](_0x2613b6)){_0x153f3a=Object[_0x3421('0x6')](_0x2613b6)[_0x3421('0x7')](function(_0x5469d8,_0x50e464){_0x5469d8[_0x50e464]=safeTemplate(_0x2613b6[_0x50e464]);return _0x5469d8;},{});}return _0x153f3a;}module[_0x3421('0x8')][_0x3421('0x9')]=safeTemplate; \ No newline at end of file +var _0x36ee=['replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','{\x20{\x20','string'];(function(_0x50e149,_0x385cd6){var _0x1d9503=function(_0x5393af){while(--_0x5393af){_0x50e149['push'](_0x50e149['shift']());}};_0x1d9503(++_0x385cd6);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4889d8){return _0x4889d8==='{{'?_0xe36e('0x0'):'\x20}\x20}';}function safeTemplate(_0xf6b517){var _0x4018bf=_0xf6b517;if(typeof _0xf6b517===_0xe36e('0x1')){_0x4018bf=_0xf6b517[_0xe36e('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe36e('0x3')](_0xf6b517)){_0x4018bf=_0xf6b517[_0xe36e('0x4')](function(_0x29e692){return safeTemplate(_0x29e692);});}else if(_[_0xe36e('0x5')](_0xf6b517)){_0x4018bf=Object[_0xe36e('0x6')](_0xf6b517)[_0xe36e('0x7')](function(_0x21be0b,_0x1aa596){_0x21be0b[_0x1aa596]=safeTemplate(_0xf6b517[_0x1aa596]);return _0x21be0b;},{});}return _0x4018bf;}module['exports'][_0xe36e('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index ccb866c..3071384 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 _0x8857=['legacy-libs','isArray','apps','findIndex','name','motion2','NODE_PATH','string','env','pathExists','then','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','root','resolve'];(function(_0x10c51f,_0x11270f){var _0x56a0cd=function(_0x563ac6){while(--_0x563ac6){_0x10c51f['push'](_0x10c51f['shift']());}};_0x56a0cd(++_0x11270f);}(_0x8857,0x153));var _0x7885=function(_0x1260eb,_0x3e0895){_0x1260eb=_0x1260eb-0x0;var _0x4f7682=_0x8857[_0x1260eb];return _0x4f7682;};var fs=require(_0x7885('0x0'));var path=require('path');var config=require('../config/environment');var root=config[_0x7885('0x1')];var APP_JSON_PATH=path[_0x7885('0x2')](root,'server/app.json');var NODEPATH=path[_0x7885('0x2')](root,_0x7885('0x3'));function setLegacyLibsNodeEnvPath(_0x200ac2){let _0xec2e33=![];if(Array[_0x7885('0x4')](_0x200ac2[_0x7885('0x5')])){var _0xfd399f=_0x200ac2[_0x7885('0x5')][_0x7885('0x6')](function(_0x3008b0){return _0x3008b0[_0x7885('0x7')]===_0x7885('0x8');});if(_0xfd399f>-0x1){var _0xed6194=_0x200ac2[_0x7885('0x5')][_0xfd399f];if(typeof _0xed6194['env'][_0x7885('0x9')]!==_0x7885('0xa')){_0xed6194[_0x7885('0xb')][_0x7885('0x9')]=NODEPATH;_0xec2e33=!![];}}return{'appConfig':_0x200ac2,'updated':_0xec2e33};}}function updateAppConfig(_0x175c6e){return fs[_0x7885('0xc')](APP_JSON_PATH)[_0x7885('0xd')](function(_0x3b9ddf){if(_0x3b9ddf){return fs['readJSON'](APP_JSON_PATH)[_0x7885('0xd')](function(_0x5d95c8){var _0xd487aa=setLegacyLibsNodeEnvPath(_0x5d95c8);if(_0xd487aa[_0x7885('0xe')]){_0x175c6e[_0x7885('0xf')](_0x7885('0x10'));return fs[_0x7885('0x11')](APP_JSON_PATH,_0x5d95c8,{'spaces':0x2});}else{return Promise[_0x7885('0x2')]();}});}else{return Promise[_0x7885('0x2')]();}});}module[_0x7885('0x12')]=updateAppConfig; \ No newline at end of file +var _0xec7f=['root','resolve','isArray','apps','findIndex','name','motion2','env','NODE_PATH','readJSON','updated','info','Updating\x20app.json','exports','fs-extra','path'];(function(_0x14f1bd,_0x2f27e2){var _0x238c4b=function(_0x1d1cea){while(--_0x1d1cea){_0x14f1bd['push'](_0x14f1bd['shift']());}};_0x238c4b(++_0x2f27e2);}(_0xec7f,0xae));var _0xfec7=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xec7f[_0x4b055c];return _0x4b62bb;};var fs=require(_0xfec7('0x0'));var path=require(_0xfec7('0x1'));var config=require('../config/environment');var root=config[_0xfec7('0x2')];var APP_JSON_PATH=path[_0xfec7('0x3')](root,'server/app.json');var NODEPATH=path[_0xfec7('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x2c1179){let _0x4b8bfc=![];if(Array[_0xfec7('0x4')](_0x2c1179[_0xfec7('0x5')])){var _0x4aed55=_0x2c1179[_0xfec7('0x5')][_0xfec7('0x6')](function(_0x2e6f08){return _0x2e6f08[_0xfec7('0x7')]===_0xfec7('0x8');});if(_0x4aed55>-0x1){var _0xb55057=_0x2c1179[_0xfec7('0x5')][_0x4aed55];if(typeof _0xb55057[_0xfec7('0x9')][_0xfec7('0xa')]!=='string'){_0xb55057[_0xfec7('0x9')][_0xfec7('0xa')]=NODEPATH;_0x4b8bfc=!![];}}return{'appConfig':_0x2c1179,'updated':_0x4b8bfc};}}function updateAppConfig(_0x279198){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x523e52){if(_0x523e52){return fs[_0xfec7('0xb')](APP_JSON_PATH)['then'](function(_0x5280e0){var _0x37216a=setLegacyLibsNodeEnvPath(_0x5280e0);if(_0x37216a[_0xfec7('0xc')]){_0x279198[_0xfec7('0xd')](_0xfec7('0xe'));return fs['writeJSON'](APP_JSON_PATH,_0x5280e0,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise['resolve']();}});}module[_0xfec7('0xf')]=updateAppConfig; \ No newline at end of file